var os = Object.defineProperty;
var kn = (n) => {
  throw TypeError(n);
};
var cs = (n, e, t) => e in n ? os(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
var Ft = (n, e, t) => cs(n, typeof e != "symbol" ? e + "" : e, t), Ai = (n, e, t) => e.has(n) || kn("Cannot " + t);
var Fr = (n, e, t) => (Ai(n, e, "read from private field"), t ? t.call(n) : e.get(n)), Mi = (n, e, t) => e.has(n) ? kn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), Ln = (n, e, t, r) => (Ai(n, e, "write to private field"), r ? r.call(n, t) : e.set(n, t), t), ui = (n, e, t) => (Ai(n, e, "access private method"), t);
function _mergeNamespaces(n, e) {
  for (var t = 0; t < e.length; t++) {
    const r = e[t];
    if (typeof r != "string" && !Array.isArray(r)) {
      for (const a in r)
        if (a !== "default" && !(a in n)) {
          const l = Object.getOwnPropertyDescriptor(r, a);
          l && Object.defineProperty(n, a, l.get ? l : {
            enumerable: !0,
            get: () => r[a]
          });
        }
    }
  }
  return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
}
const {
  SvelteComponent: SvelteComponent$q,
  assign: assign$2,
  children: children$n,
  claim_element: claim_element$f,
  create_slot: create_slot$7,
  detach: detach$q,
  element: element$f,
  get_all_dirty_from_scope: get_all_dirty_from_scope$7,
  get_slot_changes: get_slot_changes$7,
  get_spread_update: get_spread_update$2,
  init: init$q,
  insert_hydration: insert_hydration$q,
  safe_not_equal: safe_not_equal$r,
  set_dynamic_element_data,
  set_style: set_style$9,
  toggle_class: toggle_class$c,
  transition_in: transition_in$f,
  transition_out: transition_out$e,
  update_slot_base: update_slot_base$7
} = window.__gradio__svelte__internal;
function create_dynamic_element(n) {
  let e, t, r;
  const a = (
    /*#slots*/
    n[22].default
  ), l = create_slot$7(
    a,
    n,
    /*$$scope*/
    n[21],
    null
  );
  let h = [
    { "data-testid": (
      /*test_id*/
      n[9]
    ) },
    { id: (
      /*elem_id*/
      n[4]
    ) },
    {
      class: t = "block " + /*elem_classes*/
      n[5].join(" ") + " svelte-1ezsyiy"
    }
  ], c = {};
  for (let d = 0; d < h.length; d += 1)
    c = assign$2(c, h[d]);
  return {
    c() {
      e = element$f(
        /*tag*/
        n[18]
      ), l && l.c(), this.h();
    },
    l(d) {
      e = claim_element$f(
        d,
        /*tag*/
        (n[18] || "null").toUpperCase(),
        {
          "data-testid": !0,
          id: !0,
          class: !0
        }
      );
      var _ = children$n(e);
      l && l.l(_), _.forEach(detach$q), this.h();
    },
    h() {
      set_dynamic_element_data(
        /*tag*/
        n[18]
      )(e, c), toggle_class$c(
        e,
        "hidden",
        /*visible*/
        n[12] === !1
      ), toggle_class$c(
        e,
        "padded",
        /*padding*/
        n[8]
      ), toggle_class$c(
        e,
        "flex",
        /*flex*/
        n[17]
      ), toggle_class$c(
        e,
        "border_focus",
        /*border_mode*/
        n[7] === "focus"
      ), toggle_class$c(
        e,
        "border_contrast",
        /*border_mode*/
        n[7] === "contrast"
      ), toggle_class$c(e, "hide-container", !/*explicit_call*/
      n[10] && !/*container*/
      n[11]), set_style$9(
        e,
        "height",
        /*get_dimension*/
        n[19](
          /*height*/
          n[0]
        )
      ), set_style$9(
        e,
        "min-height",
        /*get_dimension*/
        n[19](
          /*min_height*/
          n[1]
        )
      ), set_style$9(
        e,
        "max-height",
        /*get_dimension*/
        n[19](
          /*max_height*/
          n[2]
        )
      ), set_style$9(e, "width", typeof /*width*/
      n[3] == "number" ? `calc(min(${/*width*/
      n[3]}px, 100%))` : (
        /*get_dimension*/
        n[19](
          /*width*/
          n[3]
        )
      )), set_style$9(
        e,
        "border-style",
        /*variant*/
        n[6]
      ), set_style$9(
        e,
        "overflow",
        /*allow_overflow*/
        n[13] ? (
          /*overflow_behavior*/
          n[14]
        ) : "hidden"
      ), set_style$9(
        e,
        "flex-grow",
        /*scale*/
        n[15]
      ), set_style$9(e, "min-width", `calc(min(${/*min_width*/
      n[16]}px, 100%))`), set_style$9(e, "border-width", "var(--block-border-width)");
    },
    m(d, _) {
      insert_hydration$q(d, e, _), l && l.m(e, null), r = !0;
    },
    p(d, _) {
      l && l.p && (!r || _ & /*$$scope*/
      2097152) && update_slot_base$7(
        l,
        a,
        d,
        /*$$scope*/
        d[21],
        r ? get_slot_changes$7(
          a,
          /*$$scope*/
          d[21],
          _,
          null
        ) : get_all_dirty_from_scope$7(
          /*$$scope*/
          d[21]
        ),
        null
      ), set_dynamic_element_data(
        /*tag*/
        d[18]
      )(e, c = get_spread_update$2(h, [
        (!r || _ & /*test_id*/
        512) && { "data-testid": (
          /*test_id*/
          d[9]
        ) },
        (!r || _ & /*elem_id*/
        16) && { id: (
          /*elem_id*/
          d[4]
        ) },
        (!r || _ & /*elem_classes*/
        32 && t !== (t = "block " + /*elem_classes*/
        d[5].join(" ") + " svelte-1ezsyiy")) && { class: t }
      ])), toggle_class$c(
        e,
        "hidden",
        /*visible*/
        d[12] === !1
      ), toggle_class$c(
        e,
        "padded",
        /*padding*/
        d[8]
      ), toggle_class$c(
        e,
        "flex",
        /*flex*/
        d[17]
      ), toggle_class$c(
        e,
        "border_focus",
        /*border_mode*/
        d[7] === "focus"
      ), toggle_class$c(
        e,
        "border_contrast",
        /*border_mode*/
        d[7] === "contrast"
      ), toggle_class$c(e, "hide-container", !/*explicit_call*/
      d[10] && !/*container*/
      d[11]), _ & /*height*/
      1 && set_style$9(
        e,
        "height",
        /*get_dimension*/
        d[19](
          /*height*/
          d[0]
        )
      ), _ & /*min_height*/
      2 && set_style$9(
        e,
        "min-height",
        /*get_dimension*/
        d[19](
          /*min_height*/
          d[1]
        )
      ), _ & /*max_height*/
      4 && set_style$9(
        e,
        "max-height",
        /*get_dimension*/
        d[19](
          /*max_height*/
          d[2]
        )
      ), _ & /*width*/
      8 && set_style$9(e, "width", typeof /*width*/
      d[3] == "number" ? `calc(min(${/*width*/
      d[3]}px, 100%))` : (
        /*get_dimension*/
        d[19](
          /*width*/
          d[3]
        )
      )), _ & /*variant*/
      64 && set_style$9(
        e,
        "border-style",
        /*variant*/
        d[6]
      ), _ & /*allow_overflow, overflow_behavior*/
      24576 && set_style$9(
        e,
        "overflow",
        /*allow_overflow*/
        d[13] ? (
          /*overflow_behavior*/
          d[14]
        ) : "hidden"
      ), _ & /*scale*/
      32768 && set_style$9(
        e,
        "flex-grow",
        /*scale*/
        d[15]
      ), _ & /*min_width*/
      65536 && set_style$9(e, "min-width", `calc(min(${/*min_width*/
      d[16]}px, 100%))`);
    },
    i(d) {
      r || (transition_in$f(l, d), r = !0);
    },
    o(d) {
      transition_out$e(l, d), r = !1;
    },
    d(d) {
      d && detach$q(e), l && l.d(d);
    }
  };
}
function create_fragment$q(n) {
  let e, t = (
    /*tag*/
    n[18] && create_dynamic_element(n)
  );
  return {
    c() {
      t && t.c();
    },
    l(r) {
      t && t.l(r);
    },
    m(r, a) {
      t && t.m(r, a), e = !0;
    },
    p(r, [a]) {
      /*tag*/
      r[18] && t.p(r, a);
    },
    i(r) {
      e || (transition_in$f(t, r), e = !0);
    },
    o(r) {
      transition_out$e(t, r), e = !1;
    },
    d(r) {
      t && t.d(r);
    }
  };
}
function instance$i(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { height: l = void 0 } = e, { min_height: h = void 0 } = e, { max_height: c = void 0 } = e, { width: d = void 0 } = e, { elem_id: _ = "" } = e, { elem_classes: m = [] } = e, { variant: y = "solid" } = e, { border_mode: x = "base" } = e, { padding: b = !0 } = e, { type: A = "normal" } = e, { test_id: f = void 0 } = e, { explicit_call: s = !1 } = e, { container: u = !0 } = e, { visible: p = !0 } = e, { allow_overflow: g = !0 } = e, { overflow_behavior: w = "auto" } = e, { scale: o = null } = e, { min_width: v = 0 } = e, { flex: M = !1 } = e, E = A === "fieldset" ? "fieldset" : "div";
  const $ = (k) => {
    if (k !== void 0) {
      if (typeof k == "number")
        return k + "px";
      if (typeof k == "string")
        return k;
    }
  };
  return n.$$set = (k) => {
    "height" in k && t(0, l = k.height), "min_height" in k && t(1, h = k.min_height), "max_height" in k && t(2, c = k.max_height), "width" in k && t(3, d = k.width), "elem_id" in k && t(4, _ = k.elem_id), "elem_classes" in k && t(5, m = k.elem_classes), "variant" in k && t(6, y = k.variant), "border_mode" in k && t(7, x = k.border_mode), "padding" in k && t(8, b = k.padding), "type" in k && t(20, A = k.type), "test_id" in k && t(9, f = k.test_id), "explicit_call" in k && t(10, s = k.explicit_call), "container" in k && t(11, u = k.container), "visible" in k && t(12, p = k.visible), "allow_overflow" in k && t(13, g = k.allow_overflow), "overflow_behavior" in k && t(14, w = k.overflow_behavior), "scale" in k && t(15, o = k.scale), "min_width" in k && t(16, v = k.min_width), "flex" in k && t(17, M = k.flex), "$$scope" in k && t(21, a = k.$$scope);
  }, [
    l,
    h,
    c,
    d,
    _,
    m,
    y,
    x,
    b,
    f,
    s,
    u,
    p,
    g,
    w,
    o,
    v,
    M,
    E,
    $,
    A,
    a,
    r
  ];
}
class Block extends SvelteComponent$q {
  constructor(e) {
    super(), init$q(this, e, instance$i, create_fragment$q, safe_not_equal$r, {
      height: 0,
      min_height: 1,
      max_height: 2,
      width: 3,
      elem_id: 4,
      elem_classes: 5,
      variant: 6,
      border_mode: 7,
      padding: 8,
      type: 20,
      test_id: 9,
      explicit_call: 10,
      container: 11,
      visible: 12,
      allow_overflow: 13,
      overflow_behavior: 14,
      scale: 15,
      min_width: 16,
      flex: 17
    });
  }
}
const color_values = [
  { 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 }
], tw_colors = {
  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"
  }
};
color_values.reduce(
  (n, { color: e, primary: t, secondary: r }) => ({
    ...n,
    [e]: {
      primary: tw_colors[e][t],
      secondary: tw_colors[e][r]
    }
  }),
  {}
);
const {
  SvelteComponent: SvelteComponent$p,
  append_hydration: append_hydration$k,
  attr: attr$l,
  children: children$m,
  claim_svg_element: claim_svg_element$a,
  detach: detach$p,
  init: init$p,
  insert_hydration: insert_hydration$p,
  noop: noop$g,
  safe_not_equal: safe_not_equal$q,
  set_style: set_style$8,
  svg_element: svg_element$a
} = window.__gradio__svelte__internal;
function create_fragment$p(n) {
  let e, t, r, a;
  return {
    c() {
      e = svg_element$a("svg"), t = svg_element$a("g"), r = svg_element$a("path"), a = svg_element$a("path"), this.h();
    },
    l(l) {
      e = claim_svg_element$a(l, "svg", {
        width: !0,
        height: !0,
        viewBox: !0,
        version: !0,
        xmlns: !0,
        "xmlns:xlink": !0,
        "xml:space": !0,
        stroke: !0,
        style: !0
      });
      var h = children$m(e);
      t = claim_svg_element$a(h, "g", { transform: !0 });
      var c = children$m(t);
      r = claim_svg_element$a(c, "path", { d: !0, style: !0 }), children$m(r).forEach(detach$p), c.forEach(detach$p), a = claim_svg_element$a(h, "path", { d: !0, style: !0 }), children$m(a).forEach(detach$p), h.forEach(detach$p), this.h();
    },
    h() {
      attr$l(r, "d", "M18,6L6.087,17.913"), set_style$8(r, "fill", "none"), set_style$8(r, "fill-rule", "nonzero"), set_style$8(r, "stroke-width", "2px"), attr$l(t, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$l(a, "d", "M4.364,4.364L19.636,19.636"), set_style$8(a, "fill", "none"), set_style$8(a, "fill-rule", "nonzero"), set_style$8(a, "stroke-width", "2px"), attr$l(e, "width", "100%"), attr$l(e, "height", "100%"), attr$l(e, "viewBox", "0 0 24 24"), attr$l(e, "version", "1.1"), attr$l(e, "xmlns", "http://www.w3.org/2000/svg"), attr$l(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$l(e, "xml:space", "preserve"), attr$l(e, "stroke", "currentColor"), set_style$8(e, "fill-rule", "evenodd"), set_style$8(e, "clip-rule", "evenodd"), set_style$8(e, "stroke-linecap", "round"), set_style$8(e, "stroke-linejoin", "round");
    },
    m(l, h) {
      insert_hydration$p(l, e, h), append_hydration$k(e, t), append_hydration$k(t, r), append_hydration$k(e, a);
    },
    p: noop$g,
    i: noop$g,
    o: noop$g,
    d(l) {
      l && detach$p(e);
    }
  };
}
class Clear extends SvelteComponent$p {
  constructor(e) {
    super(), init$p(this, e, null, create_fragment$p, safe_not_equal$q, {});
  }
}
const {
  SvelteComponent: SvelteComponent$o,
  append_hydration: append_hydration$j,
  attr: attr$k,
  children: children$l,
  claim_svg_element: claim_svg_element$9,
  detach: detach$o,
  init: init$o,
  insert_hydration: insert_hydration$o,
  noop: noop$f,
  safe_not_equal: safe_not_equal$p,
  svg_element: svg_element$9
} = window.__gradio__svelte__internal;
function create_fragment$o(n) {
  let e, t;
  return {
    c() {
      e = svg_element$9("svg"), t = svg_element$9("path"), this.h();
    },
    l(r) {
      e = claim_svg_element$9(r, "svg", {
        xmlns: !0,
        width: !0,
        height: !0,
        viewBox: !0
      });
      var a = children$l(e);
      t = claim_svg_element$9(a, "path", { fill: !0, d: !0 }), children$l(t).forEach(detach$o), a.forEach(detach$o), this.h();
    },
    h() {
      attr$k(t, "fill", "currentColor"), attr$k(t, "d", "M26 24v4H6v-4H4v4a2 2 0 0 0 2 2h20a2 2 0 0 0 2-2v-4zm0-10l-1.41-1.41L17 20.17V2h-2v18.17l-7.59-7.58L6 14l10 10l10-10z"), attr$k(e, "xmlns", "http://www.w3.org/2000/svg"), attr$k(e, "width", "100%"), attr$k(e, "height", "100%"), attr$k(e, "viewBox", "0 0 32 32");
    },
    m(r, a) {
      insert_hydration$o(r, e, a), append_hydration$j(e, t);
    },
    p: noop$f,
    i: noop$f,
    o: noop$f,
    d(r) {
      r && detach$o(e);
    }
  };
}
class Download extends SvelteComponent$o {
  constructor(e) {
    super(), init$o(this, e, null, create_fragment$o, safe_not_equal$p, {});
  }
}
const {
  SvelteComponent: SvelteComponent$n,
  append_hydration: append_hydration$i,
  attr: attr$j,
  children: children$k,
  claim_svg_element: claim_svg_element$8,
  detach: detach$n,
  init: init$n,
  insert_hydration: insert_hydration$n,
  noop: noop$e,
  safe_not_equal: safe_not_equal$o,
  svg_element: svg_element$8
} = window.__gradio__svelte__internal;
function create_fragment$n(n) {
  let e, t;
  return {
    c() {
      e = svg_element$8("svg"), t = svg_element$8("path"), this.h();
    },
    l(r) {
      e = claim_svg_element$8(r, "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 a = children$k(e);
      t = claim_svg_element$8(a, "path", { d: !0 }), children$k(t).forEach(detach$n), a.forEach(detach$n), this.h();
    },
    h() {
      attr$j(t, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), attr$j(e, "xmlns", "http://www.w3.org/2000/svg"), attr$j(e, "width", "100%"), attr$j(e, "height", "100%"), attr$j(e, "viewBox", "0 0 24 24"), attr$j(e, "fill", "none"), attr$j(e, "stroke", "currentColor"), attr$j(e, "stroke-width", "1.5"), attr$j(e, "stroke-linecap", "round"), attr$j(e, "stroke-linejoin", "round"), attr$j(e, "class", "feather feather-edit-2");
    },
    m(r, a) {
      insert_hydration$n(r, e, a), append_hydration$i(e, t);
    },
    p: noop$e,
    i: noop$e,
    o: noop$e,
    d(r) {
      r && detach$n(e);
    }
  };
}
class Edit extends SvelteComponent$n {
  constructor(e) {
    super(), init$n(this, e, null, create_fragment$n, safe_not_equal$o, {});
  }
}
const {
  SvelteComponent: SvelteComponent$m,
  append_hydration: append_hydration$h,
  attr: attr$i,
  children: children$j,
  claim_svg_element: claim_svg_element$7,
  detach: detach$m,
  init: init$m,
  insert_hydration: insert_hydration$m,
  noop: noop$d,
  safe_not_equal: safe_not_equal$n,
  svg_element: svg_element$7
} = window.__gradio__svelte__internal;
function create_fragment$m(n) {
  let e, t, r;
  return {
    c() {
      e = svg_element$7("svg"), t = svg_element$7("path"), r = svg_element$7("polyline"), this.h();
    },
    l(a) {
      e = claim_svg_element$7(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 l = children$j(e);
      t = claim_svg_element$7(l, "path", { d: !0 }), children$j(t).forEach(detach$m), r = claim_svg_element$7(l, "polyline", { points: !0 }), children$j(r).forEach(detach$m), l.forEach(detach$m), this.h();
    },
    h() {
      attr$i(t, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$i(r, "points", "13 2 13 9 20 9"), attr$i(e, "xmlns", "http://www.w3.org/2000/svg"), attr$i(e, "width", "100%"), attr$i(e, "height", "100%"), attr$i(e, "viewBox", "0 0 24 24"), attr$i(e, "fill", "none"), attr$i(e, "stroke", "currentColor"), attr$i(e, "stroke-width", "1.5"), attr$i(e, "stroke-linecap", "round"), attr$i(e, "stroke-linejoin", "round"), attr$i(e, "class", "feather feather-file");
    },
    m(a, l) {
      insert_hydration$m(a, e, l), append_hydration$h(e, t), append_hydration$h(e, r);
    },
    p: noop$d,
    i: noop$d,
    o: noop$d,
    d(a) {
      a && detach$m(e);
    }
  };
}
let File$1 = class extends SvelteComponent$m {
  constructor(e) {
    super(), init$m(this, e, null, create_fragment$m, safe_not_equal$n, {});
  }
};
const {
  SvelteComponent: SvelteComponent$l,
  append_hydration: append_hydration$g,
  attr: attr$h,
  children: children$i,
  claim_svg_element: claim_svg_element$6,
  detach: detach$l,
  init: init$l,
  insert_hydration: insert_hydration$l,
  noop: noop$c,
  safe_not_equal: safe_not_equal$m,
  svg_element: svg_element$6
} = window.__gradio__svelte__internal;
function create_fragment$l(n) {
  let e, t;
  return {
    c() {
      e = svg_element$6("svg"), t = svg_element$6("path"), this.h();
    },
    l(r) {
      e = claim_svg_element$6(r, "svg", { xmlns: !0, viewBox: !0 });
      var a = children$i(e);
      t = claim_svg_element$6(a, "path", { fill: !0, d: !0 }), children$i(t).forEach(detach$l), a.forEach(detach$l), this.h();
    },
    h() {
      attr$h(t, "fill", "currentColor"), attr$h(t, "d", "M13.75 2a2.25 2.25 0 0 1 2.236 2.002V4h1.764A2.25 2.25 0 0 1 20 6.25V11h-1.5V6.25a.75.75 0 0 0-.75-.75h-2.129c-.404.603-1.091 1-1.871 1h-3.5c-.78 0-1.467-.397-1.871-1H6.25a.75.75 0 0 0-.75.75v13.5c0 .414.336.75.75.75h4.78a4 4 0 0 0 .505 1.5H6.25A2.25 2.25 0 0 1 4 19.75V6.25A2.25 2.25 0 0 1 6.25 4h1.764a2.25 2.25 0 0 1 2.236-2zm2.245 2.096L16 4.25q0-.078-.005-.154M13.75 3.5h-3.5a.75.75 0 0 0 0 1.5h3.5a.75.75 0 0 0 0-1.5M15 12a3 3 0 0 0-3 3v5c0 .556.151 1.077.415 1.524l3.494-3.494a2.25 2.25 0 0 1 3.182 0l3.494 3.494c.264-.447.415-.968.415-1.524v-5a3 3 0 0 0-3-3zm0 11a3 3 0 0 1-1.524-.415l3.494-3.494a.75.75 0 0 1 1.06 0l3.494 3.494A3 3 0 0 1 20 23zm5-7a1 1 0 1 1 0-2 1 1 0 0 1 0 2"), attr$h(e, "xmlns", "http://www.w3.org/2000/svg"), attr$h(e, "viewBox", "0 0 24 24");
    },
    m(r, a) {
      insert_hydration$l(r, e, a), append_hydration$g(e, t);
    },
    p: noop$c,
    i: noop$c,
    o: noop$c,
    d(r) {
      r && detach$l(e);
    }
  };
}
class ImagePaste extends SvelteComponent$l {
  constructor(e) {
    super(), init$l(this, e, null, create_fragment$l, safe_not_equal$m, {});
  }
}
const {
  SvelteComponent: SvelteComponent$k,
  append_hydration: append_hydration$f,
  attr: attr$g,
  children: children$h,
  claim_svg_element: claim_svg_element$5,
  detach: detach$k,
  init: init$k,
  insert_hydration: insert_hydration$k,
  noop: noop$b,
  safe_not_equal: safe_not_equal$l,
  svg_element: svg_element$5
} = window.__gradio__svelte__internal;
function create_fragment$k(n) {
  let e, t, r;
  return {
    c() {
      e = svg_element$5("svg"), t = svg_element$5("polyline"), r = svg_element$5("path"), this.h();
    },
    l(a) {
      e = claim_svg_element$5(a, "svg", {
        "aria-label": !0,
        xmlns: !0,
        width: !0,
        height: !0,
        viewBox: !0,
        fill: !0,
        stroke: !0,
        "stroke-width": !0,
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        class: !0
      });
      var l = children$h(e);
      t = claim_svg_element$5(l, "polyline", { points: !0 }), children$h(t).forEach(detach$k), r = claim_svg_element$5(l, "path", { d: !0 }), children$h(r).forEach(detach$k), l.forEach(detach$k), this.h();
    },
    h() {
      attr$g(t, "points", "1 4 1 10 7 10"), attr$g(r, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), attr$g(e, "aria-label", "undo"), attr$g(e, "xmlns", "http://www.w3.org/2000/svg"), attr$g(e, "width", "100%"), attr$g(e, "height", "100%"), attr$g(e, "viewBox", "0 0 24 24"), attr$g(e, "fill", "none"), attr$g(e, "stroke", "currentColor"), attr$g(e, "stroke-width", "1.5"), attr$g(e, "stroke-linecap", "round"), attr$g(e, "stroke-linejoin", "round"), attr$g(e, "class", "feather feather-rotate-ccw");
    },
    m(a, l) {
      insert_hydration$k(a, e, l), append_hydration$f(e, t), append_hydration$f(e, r);
    },
    p: noop$b,
    i: noop$b,
    o: noop$b,
    d(a) {
      a && detach$k(e);
    }
  };
}
class Undo extends SvelteComponent$k {
  constructor(e) {
    super(), init$k(this, e, null, create_fragment$k, safe_not_equal$l, {});
  }
}
const {
  SvelteComponent: SvelteComponent$j,
  append_hydration: append_hydration$e,
  attr: attr$f,
  children: children$g,
  claim_svg_element: claim_svg_element$4,
  detach: detach$j,
  init: init$j,
  insert_hydration: insert_hydration$j,
  noop: noop$a,
  safe_not_equal: safe_not_equal$k,
  svg_element: svg_element$4
} = window.__gradio__svelte__internal;
function create_fragment$j(n) {
  let e, t, r, a;
  return {
    c() {
      e = svg_element$4("svg"), t = svg_element$4("path"), r = svg_element$4("polyline"), a = svg_element$4("line"), this.h();
    },
    l(l) {
      e = claim_svg_element$4(l, "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 h = children$g(e);
      t = claim_svg_element$4(h, "path", { d: !0 }), children$g(t).forEach(detach$j), r = claim_svg_element$4(h, "polyline", { points: !0 }), children$g(r).forEach(detach$j), a = claim_svg_element$4(h, "line", { x1: !0, y1: !0, x2: !0, y2: !0 }), children$g(a).forEach(detach$j), h.forEach(detach$j), this.h();
    },
    h() {
      attr$f(t, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), attr$f(r, "points", "17 8 12 3 7 8"), attr$f(a, "x1", "12"), attr$f(a, "y1", "3"), attr$f(a, "x2", "12"), attr$f(a, "y2", "15"), attr$f(e, "xmlns", "http://www.w3.org/2000/svg"), attr$f(e, "width", "90%"), attr$f(e, "height", "90%"), attr$f(e, "viewBox", "0 0 24 24"), attr$f(e, "fill", "none"), attr$f(e, "stroke", "currentColor"), attr$f(e, "stroke-width", "2"), attr$f(e, "stroke-linecap", "round"), attr$f(e, "stroke-linejoin", "round"), attr$f(e, "class", "feather feather-upload");
    },
    m(l, h) {
      insert_hydration$j(l, e, h), append_hydration$e(e, t), append_hydration$e(e, r), append_hydration$e(e, a);
    },
    p: noop$a,
    i: noop$a,
    o: noop$a,
    d(l) {
      l && detach$j(e);
    }
  };
}
let Upload$1 = class extends SvelteComponent$j {
  constructor(e) {
    super(), init$j(this, e, null, create_fragment$j, safe_not_equal$k, {});
  }
};
class SourceLocation {
  // 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 SourceLocation(e.loc.lexer, e.loc.start, t.loc.end) : e && e.loc;
  }
}
class Token {
  // 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 Token(t, SourceLocation.range(this, e));
  }
}
class ParseError {
  // 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, l, h = t && t.loc;
    if (h && h.start <= h.end) {
      var c = h.lexer.input;
      a = h.start, l = h.end, a === c.length ? r += " at end of input: " : r += " at position " + (a + 1) + ": ";
      var d = c.slice(a, l).replace(/[^]/g, "$&̲"), _;
      a > 15 ? _ = "…" + c.slice(a - 15, a) : _ = c.slice(0, a);
      var m;
      l + 15 < c.length ? m = c.slice(l, l + 15) + "…" : m = c.slice(l), r += _ + d + m;
    }
    var y = new Error(r);
    return y.name = "ParseError", y.__proto__ = ParseError.prototype, y.position = a, a != null && l != null && (y.length = l - a), y.rawMessage = e, y;
  }
}
ParseError.prototype.__proto__ = Error.prototype;
var contains = function(e, t) {
  return e.indexOf(t) !== -1;
}, deflt = function(e, t) {
  return e === void 0 ? t : e;
}, uppercase = /([A-Z])/g, hyphenate = function(e) {
  return e.replace(uppercase, "-$1").toLowerCase();
}, ESCAPE_LOOKUP = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  '"': "&quot;",
  "'": "&#x27;"
}, ESCAPE_REGEX = /[&><"']/g;
function escape$2(n) {
  return String(n).replace(ESCAPE_REGEX, (e) => ESCAPE_LOOKUP[e]);
}
var getBaseElem = 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;
}, isCharacterBox = function(e) {
  var t = getBaseElem(e);
  return t.type === "mathord" || t.type === "textord" || t.type === "atom";
}, assert = function(e) {
  if (!e)
    throw new Error("Expected non-null, but got " + String(e));
  return e;
}, protocolFromUrl = 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";
}, utils = {
  contains,
  deflt,
  escape: escape$2,
  hyphenate,
  getBaseElem,
  isCharacterBox,
  protocolFromUrl
};
class Style {
  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 styles[sup[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return styles[sub[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return styles[fracNum[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return styles[fracDen[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return styles[cramp[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return styles[text$1$1[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
var D = 0, Dc = 1, T = 2, Tc = 3, S = 4, Sc = 5, SS = 6, SSc = 7, styles = [new Style(D, 0, !1), new Style(Dc, 0, !0), new Style(T, 1, !1), new Style(Tc, 1, !0), new Style(S, 2, !1), new Style(Sc, 2, !0), new Style(SS, 3, !1), new Style(SSc, 3, !0)], sup = [S, Sc, S, Sc, SS, SSc, SS, SSc], sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc], fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc], fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc], cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc], text$1$1 = [D, Dc, T, Tc, T, Tc, T, Tc], Style$1 = {
  DISPLAY: styles[D],
  TEXT: styles[T],
  SCRIPT: styles[S],
  SCRIPTSCRIPT: styles[SS]
}, scriptData = [{
  // 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 scriptFromCodepoint(n) {
  for (var e = 0; e < scriptData.length; e++)
    for (var t = scriptData[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 allBlocks = [];
scriptData.forEach((n) => n.blocks.forEach((e) => allBlocks.push(...e)));
function supportedCodepoint(n) {
  for (var e = 0; e < allBlocks.length; e += 2)
    if (n >= allBlocks[e] && n <= allBlocks[e + 1])
      return !0;
  return !1;
}
var hLinePad = 80, sqrtMain = 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";
}, sqrtSize1 = 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";
}, sqrtSize2 = 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";
}, sqrtSize3 = 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";
}, sqrtSize4 = 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";
}, phasePath = function(e) {
  var t = e / 2;
  return "M400000 " + e + " H0 L" + t + " 0 l65 45 L145 " + (e - 80) + " H400000z";
}, sqrtTall = 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";
}, sqrtPath = function(e, t, r) {
  t = 1e3 * t;
  var a = "";
  switch (e) {
    case "sqrtMain":
      a = sqrtMain(t, hLinePad);
      break;
    case "sqrtSize1":
      a = sqrtSize1(t, hLinePad);
      break;
    case "sqrtSize2":
      a = sqrtSize2(t, hLinePad);
      break;
    case "sqrtSize3":
      a = sqrtSize3(t, hLinePad);
      break;
    case "sqrtSize4":
      a = sqrtSize4(t, hLinePad);
      break;
    case "sqrtTall":
      a = sqrtTall(t, hLinePad, r);
  }
  return a;
}, innerPath = 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 "";
  }
}, path = {
  // 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`
}, tallDelim = 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 DocumentFragment {
  // 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 utils.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 fontMetricsData = {
  "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]
  }
}, extraCharacterMap = {
  // 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 getCharacterMetrics(n, e, t) {
  if (!fontMetricsData[e])
    throw new Error("Font metrics not found for font: " + e + ".");
  var r = n.charCodeAt(0), a = fontMetricsData[e][r];
  if (!a && n[0] in extraCharacterMap && (r = extraCharacterMap[n[0]].charCodeAt(0), a = fontMetricsData[e][r]), !a && t === "text" && supportedCodepoint(r) && (a = fontMetricsData[e][77]), a)
    return {
      depth: a[0],
      height: a[1],
      italic: a[2],
      skew: a[3],
      width: a[4]
    };
}
var ptPerUnit = {
  // 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
}, relativeUnit = {
  ex: !0,
  em: !0,
  mu: !0
}, validUnit = function(e) {
  return typeof e != "string" && (e = e.unit), e in ptPerUnit || e in relativeUnit || e === "ex";
}, calculateSize = function(e, t) {
  var r;
  if (e.unit in ptPerUnit)
    r = ptPerUnit[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 ParseError("Invalid unit: '" + e.unit + "'");
    a !== t && (r *= a.sizeMultiplier / t.sizeMultiplier);
  }
  return Math.min(e.number * r, t.maxSize);
}, makeEm = function(e) {
  return +e.toFixed(4) + "em";
}, createClass = function(e) {
  return e.filter((t) => t).join(" ");
}, initNode = 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);
  }
}, toNode = function(e) {
  var t = document.createElement(e);
  t.className = createClass(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 l = 0; l < this.children.length; l++)
    t.appendChild(this.children[l].toNode());
  return t;
}, toMarkup = function(e) {
  var t = "<" + e;
  this.classes.length && (t += ' class="' + utils.escape(createClass(this.classes)) + '"');
  var r = "";
  for (var a in this.style)
    this.style.hasOwnProperty(a) && (r += utils.hyphenate(a) + ":" + this.style[a] + ";");
  r && (t += ' style="' + utils.escape(r) + '"');
  for (var l in this.attributes)
    this.attributes.hasOwnProperty(l) && (t += " " + l + '="' + utils.escape(this.attributes[l]) + '"');
  t += ">";
  for (var h = 0; h < this.children.length; h++)
    t += this.children[h].toMarkup();
  return t += "</" + e + ">", t;
};
class Span {
  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, initNode.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 utils.contains(this.classes, e);
  }
  toNode() {
    return toNode.call(this, "span");
  }
  toMarkup() {
    return toMarkup.call(this, "span");
  }
}
class Anchor {
  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, initNode.call(this, t, a), this.children = r || [], this.setAttribute("href", e);
  }
  setAttribute(e, t) {
    this.attributes[e] = t;
  }
  hasClass(e) {
    return utils.contains(this.classes, e);
  }
  toNode() {
    return toNode.call(this, "a");
  }
  toMarkup() {
    return toMarkup.call(this, "a");
  }
}
class Img {
  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 utils.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="' + utils.escape(this.src) + '"' + (' alt="' + utils.escape(this.alt) + '"'), t = "";
    for (var r in this.style)
      this.style.hasOwnProperty(r) && (t += utils.hyphenate(r) + ":" + this.style[r] + ";");
    return t && (e += ' style="' + utils.escape(t) + '"'), e += "'/>", e;
  }
}
var iCombinations = {
  î: "ı̂",
  ï: "ı̈",
  í: "ı́",
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  ì: "ı̀"
};
class SymbolNode {
  constructor(e, t, r, a, l, h, c, d) {
    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 = l || 0, this.width = h || 0, this.classes = c || [], this.style = d || {}, this.maxFontSize = 0;
    var _ = scriptFromCodepoint(this.text.charCodeAt(0));
    _ && this.classes.push(_ + "_fallback"), /[îïíì]/.test(this.text) && (this.text = iCombinations[this.text]);
  }
  hasClass(e) {
    return utils.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 = makeEm(this.italic)), this.classes.length > 0 && (t = t || document.createElement("span"), t.className = createClass(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 += utils.escape(createClass(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 += utils.hyphenate(a) + ":" + this.style[a] + ";");
    r && (e = !0, t += ' style="' + utils.escape(r) + '"');
    var l = utils.escape(this.text);
    return e ? (t += ">", t += l, t += "</span>", t) : l;
  }
}
class SvgNode {
  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 + '="' + utils.escape(this.attributes[t]) + '"');
    e += ">";
    for (var r = 0; r < this.children.length; r++)
      e += this.children[r].toMarkup();
    return e += "</svg>", e;
  }
}
class PathNode {
  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", path[this.pathName]), t;
  }
  toMarkup() {
    return this.alternate ? '<path d="' + utils.escape(this.alternate) + '"/>' : '<path d="' + utils.escape(path[this.pathName]) + '"/>';
  }
}
class LineNode {
  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 + '="' + utils.escape(this.attributes[t]) + '"');
    return e += "/>", e;
  }
}
function assertSymbolDomNode(n) {
  if (n instanceof SymbolNode)
    return n;
  throw new Error("Expected symbolNode but got " + String(n) + ".");
}
function assertSpan(n) {
  if (n instanceof Span)
    return n;
  throw new Error("Expected span<HtmlDomNode> but got " + String(n) + ".");
}
var NON_ATOMS = {
  "accent-token": 1,
  mathord: 1,
  "op-token": 1,
  spacing: 1,
  textord: 1
}, symbols = {
  math: {},
  text: {}
};
function defineSymbol(n, e, t, r, a, l) {
  symbols[n][a] = {
    font: e,
    group: t,
    replace: r
  }, l && r && (symbols[n][r] = symbols[n][a]);
}
var math = "math", text$a = "text", main = "main", ams = "ams", accent = "accent-token", bin = "bin", close = "close", inner = "inner", mathord = "mathord", op = "op-token", open = "open", punct = "punct", rel = "rel", spacing = "spacing", textord = "textord";
defineSymbol(math, main, rel, "≡", "\\equiv", !0);
defineSymbol(math, main, rel, "≺", "\\prec", !0);
defineSymbol(math, main, rel, "≻", "\\succ", !0);
defineSymbol(math, main, rel, "∼", "\\sim", !0);
defineSymbol(math, main, rel, "⊥", "\\perp");
defineSymbol(math, main, rel, "⪯", "\\preceq", !0);
defineSymbol(math, main, rel, "⪰", "\\succeq", !0);
defineSymbol(math, main, rel, "≃", "\\simeq", !0);
defineSymbol(math, main, rel, "∣", "\\mid", !0);
defineSymbol(math, main, rel, "≪", "\\ll", !0);
defineSymbol(math, main, rel, "≫", "\\gg", !0);
defineSymbol(math, main, rel, "≍", "\\asymp", !0);
defineSymbol(math, main, rel, "∥", "\\parallel");
defineSymbol(math, main, rel, "⋈", "\\bowtie", !0);
defineSymbol(math, main, rel, "⌣", "\\smile", !0);
defineSymbol(math, main, rel, "⊑", "\\sqsubseteq", !0);
defineSymbol(math, main, rel, "⊒", "\\sqsupseteq", !0);
defineSymbol(math, main, rel, "≐", "\\doteq", !0);
defineSymbol(math, main, rel, "⌢", "\\frown", !0);
defineSymbol(math, main, rel, "∋", "\\ni", !0);
defineSymbol(math, main, rel, "∝", "\\propto", !0);
defineSymbol(math, main, rel, "⊢", "\\vdash", !0);
defineSymbol(math, main, rel, "⊣", "\\dashv", !0);
defineSymbol(math, main, rel, "∋", "\\owns");
defineSymbol(math, main, punct, ".", "\\ldotp");
defineSymbol(math, main, punct, "⋅", "\\cdotp");
defineSymbol(math, main, textord, "#", "\\#");
defineSymbol(text$a, main, textord, "#", "\\#");
defineSymbol(math, main, textord, "&", "\\&");
defineSymbol(text$a, main, textord, "&", "\\&");
defineSymbol(math, main, textord, "ℵ", "\\aleph", !0);
defineSymbol(math, main, textord, "∀", "\\forall", !0);
defineSymbol(math, main, textord, "ℏ", "\\hbar", !0);
defineSymbol(math, main, textord, "∃", "\\exists", !0);
defineSymbol(math, main, textord, "∇", "\\nabla", !0);
defineSymbol(math, main, textord, "♭", "\\flat", !0);
defineSymbol(math, main, textord, "ℓ", "\\ell", !0);
defineSymbol(math, main, textord, "♮", "\\natural", !0);
defineSymbol(math, main, textord, "♣", "\\clubsuit", !0);
defineSymbol(math, main, textord, "℘", "\\wp", !0);
defineSymbol(math, main, textord, "♯", "\\sharp", !0);
defineSymbol(math, main, textord, "♢", "\\diamondsuit", !0);
defineSymbol(math, main, textord, "ℜ", "\\Re", !0);
defineSymbol(math, main, textord, "♡", "\\heartsuit", !0);
defineSymbol(math, main, textord, "ℑ", "\\Im", !0);
defineSymbol(math, main, textord, "♠", "\\spadesuit", !0);
defineSymbol(math, main, textord, "§", "\\S", !0);
defineSymbol(text$a, main, textord, "§", "\\S");
defineSymbol(math, main, textord, "¶", "\\P", !0);
defineSymbol(text$a, main, textord, "¶", "\\P");
defineSymbol(math, main, textord, "†", "\\dag");
defineSymbol(text$a, main, textord, "†", "\\dag");
defineSymbol(text$a, main, textord, "†", "\\textdagger");
defineSymbol(math, main, textord, "‡", "\\ddag");
defineSymbol(text$a, main, textord, "‡", "\\ddag");
defineSymbol(text$a, main, textord, "‡", "\\textdaggerdbl");
defineSymbol(math, main, close, "⎱", "\\rmoustache", !0);
defineSymbol(math, main, open, "⎰", "\\lmoustache", !0);
defineSymbol(math, main, close, "⟯", "\\rgroup", !0);
defineSymbol(math, main, open, "⟮", "\\lgroup", !0);
defineSymbol(math, main, bin, "∓", "\\mp", !0);
defineSymbol(math, main, bin, "⊖", "\\ominus", !0);
defineSymbol(math, main, bin, "⊎", "\\uplus", !0);
defineSymbol(math, main, bin, "⊓", "\\sqcap", !0);
defineSymbol(math, main, bin, "∗", "\\ast");
defineSymbol(math, main, bin, "⊔", "\\sqcup", !0);
defineSymbol(math, main, bin, "◯", "\\bigcirc", !0);
defineSymbol(math, main, bin, "∙", "\\bullet", !0);
defineSymbol(math, main, bin, "‡", "\\ddagger");
defineSymbol(math, main, bin, "≀", "\\wr", !0);
defineSymbol(math, main, bin, "⨿", "\\amalg");
defineSymbol(math, main, bin, "&", "\\And");
defineSymbol(math, main, rel, "⟵", "\\longleftarrow", !0);
defineSymbol(math, main, rel, "⇐", "\\Leftarrow", !0);
defineSymbol(math, main, rel, "⟸", "\\Longleftarrow", !0);
defineSymbol(math, main, rel, "⟶", "\\longrightarrow", !0);
defineSymbol(math, main, rel, "⇒", "\\Rightarrow", !0);
defineSymbol(math, main, rel, "⟹", "\\Longrightarrow", !0);
defineSymbol(math, main, rel, "↔", "\\leftrightarrow", !0);
defineSymbol(math, main, rel, "⟷", "\\longleftrightarrow", !0);
defineSymbol(math, main, rel, "⇔", "\\Leftrightarrow", !0);
defineSymbol(math, main, rel, "⟺", "\\Longleftrightarrow", !0);
defineSymbol(math, main, rel, "↦", "\\mapsto", !0);
defineSymbol(math, main, rel, "⟼", "\\longmapsto", !0);
defineSymbol(math, main, rel, "↗", "\\nearrow", !0);
defineSymbol(math, main, rel, "↩", "\\hookleftarrow", !0);
defineSymbol(math, main, rel, "↪", "\\hookrightarrow", !0);
defineSymbol(math, main, rel, "↘", "\\searrow", !0);
defineSymbol(math, main, rel, "↼", "\\leftharpoonup", !0);
defineSymbol(math, main, rel, "⇀", "\\rightharpoonup", !0);
defineSymbol(math, main, rel, "↙", "\\swarrow", !0);
defineSymbol(math, main, rel, "↽", "\\leftharpoondown", !0);
defineSymbol(math, main, rel, "⇁", "\\rightharpoondown", !0);
defineSymbol(math, main, rel, "↖", "\\nwarrow", !0);
defineSymbol(math, main, rel, "⇌", "\\rightleftharpoons", !0);
defineSymbol(math, ams, rel, "≮", "\\nless", !0);
defineSymbol(math, ams, rel, "", "\\@nleqslant");
defineSymbol(math, ams, rel, "", "\\@nleqq");
defineSymbol(math, ams, rel, "⪇", "\\lneq", !0);
defineSymbol(math, ams, rel, "≨", "\\lneqq", !0);
defineSymbol(math, ams, rel, "", "\\@lvertneqq");
defineSymbol(math, ams, rel, "⋦", "\\lnsim", !0);
defineSymbol(math, ams, rel, "⪉", "\\lnapprox", !0);
defineSymbol(math, ams, rel, "⊀", "\\nprec", !0);
defineSymbol(math, ams, rel, "⋠", "\\npreceq", !0);
defineSymbol(math, ams, rel, "⋨", "\\precnsim", !0);
defineSymbol(math, ams, rel, "⪹", "\\precnapprox", !0);
defineSymbol(math, ams, rel, "≁", "\\nsim", !0);
defineSymbol(math, ams, rel, "", "\\@nshortmid");
defineSymbol(math, ams, rel, "∤", "\\nmid", !0);
defineSymbol(math, ams, rel, "⊬", "\\nvdash", !0);
defineSymbol(math, ams, rel, "⊭", "\\nvDash", !0);
defineSymbol(math, ams, rel, "⋪", "\\ntriangleleft");
defineSymbol(math, ams, rel, "⋬", "\\ntrianglelefteq", !0);
defineSymbol(math, ams, rel, "⊊", "\\subsetneq", !0);
defineSymbol(math, ams, rel, "", "\\@varsubsetneq");
defineSymbol(math, ams, rel, "⫋", "\\subsetneqq", !0);
defineSymbol(math, ams, rel, "", "\\@varsubsetneqq");
defineSymbol(math, ams, rel, "≯", "\\ngtr", !0);
defineSymbol(math, ams, rel, "", "\\@ngeqslant");
defineSymbol(math, ams, rel, "", "\\@ngeqq");
defineSymbol(math, ams, rel, "⪈", "\\gneq", !0);
defineSymbol(math, ams, rel, "≩", "\\gneqq", !0);
defineSymbol(math, ams, rel, "", "\\@gvertneqq");
defineSymbol(math, ams, rel, "⋧", "\\gnsim", !0);
defineSymbol(math, ams, rel, "⪊", "\\gnapprox", !0);
defineSymbol(math, ams, rel, "⊁", "\\nsucc", !0);
defineSymbol(math, ams, rel, "⋡", "\\nsucceq", !0);
defineSymbol(math, ams, rel, "⋩", "\\succnsim", !0);
defineSymbol(math, ams, rel, "⪺", "\\succnapprox", !0);
defineSymbol(math, ams, rel, "≆", "\\ncong", !0);
defineSymbol(math, ams, rel, "", "\\@nshortparallel");
defineSymbol(math, ams, rel, "∦", "\\nparallel", !0);
defineSymbol(math, ams, rel, "⊯", "\\nVDash", !0);
defineSymbol(math, ams, rel, "⋫", "\\ntriangleright");
defineSymbol(math, ams, rel, "⋭", "\\ntrianglerighteq", !0);
defineSymbol(math, ams, rel, "", "\\@nsupseteqq");
defineSymbol(math, ams, rel, "⊋", "\\supsetneq", !0);
defineSymbol(math, ams, rel, "", "\\@varsupsetneq");
defineSymbol(math, ams, rel, "⫌", "\\supsetneqq", !0);
defineSymbol(math, ams, rel, "", "\\@varsupsetneqq");
defineSymbol(math, ams, rel, "⊮", "\\nVdash", !0);
defineSymbol(math, ams, rel, "⪵", "\\precneqq", !0);
defineSymbol(math, ams, rel, "⪶", "\\succneqq", !0);
defineSymbol(math, ams, rel, "", "\\@nsubseteqq");
defineSymbol(math, ams, bin, "⊴", "\\unlhd");
defineSymbol(math, ams, bin, "⊵", "\\unrhd");
defineSymbol(math, ams, rel, "↚", "\\nleftarrow", !0);
defineSymbol(math, ams, rel, "↛", "\\nrightarrow", !0);
defineSymbol(math, ams, rel, "⇍", "\\nLeftarrow", !0);
defineSymbol(math, ams, rel, "⇏", "\\nRightarrow", !0);
defineSymbol(math, ams, rel, "↮", "\\nleftrightarrow", !0);
defineSymbol(math, ams, rel, "⇎", "\\nLeftrightarrow", !0);
defineSymbol(math, ams, rel, "△", "\\vartriangle");
defineSymbol(math, ams, textord, "ℏ", "\\hslash");
defineSymbol(math, ams, textord, "▽", "\\triangledown");
defineSymbol(math, ams, textord, "◊", "\\lozenge");
defineSymbol(math, ams, textord, "Ⓢ", "\\circledS");
defineSymbol(math, ams, textord, "®", "\\circledR");
defineSymbol(text$a, ams, textord, "®", "\\circledR");
defineSymbol(math, ams, textord, "∡", "\\measuredangle", !0);
defineSymbol(math, ams, textord, "∄", "\\nexists");
defineSymbol(math, ams, textord, "℧", "\\mho");
defineSymbol(math, ams, textord, "Ⅎ", "\\Finv", !0);
defineSymbol(math, ams, textord, "⅁", "\\Game", !0);
defineSymbol(math, ams, textord, "‵", "\\backprime");
defineSymbol(math, ams, textord, "▲", "\\blacktriangle");
defineSymbol(math, ams, textord, "▼", "\\blacktriangledown");
defineSymbol(math, ams, textord, "■", "\\blacksquare");
defineSymbol(math, ams, textord, "⧫", "\\blacklozenge");
defineSymbol(math, ams, textord, "★", "\\bigstar");
defineSymbol(math, ams, textord, "∢", "\\sphericalangle", !0);
defineSymbol(math, ams, textord, "∁", "\\complement", !0);
defineSymbol(math, ams, textord, "ð", "\\eth", !0);
defineSymbol(text$a, main, textord, "ð", "ð");
defineSymbol(math, ams, textord, "╱", "\\diagup");
defineSymbol(math, ams, textord, "╲", "\\diagdown");
defineSymbol(math, ams, textord, "□", "\\square");
defineSymbol(math, ams, textord, "□", "\\Box");
defineSymbol(math, ams, textord, "◊", "\\Diamond");
defineSymbol(math, ams, textord, "¥", "\\yen", !0);
defineSymbol(text$a, ams, textord, "¥", "\\yen", !0);
defineSymbol(math, ams, textord, "✓", "\\checkmark", !0);
defineSymbol(text$a, ams, textord, "✓", "\\checkmark");
defineSymbol(math, ams, textord, "ℶ", "\\beth", !0);
defineSymbol(math, ams, textord, "ℸ", "\\daleth", !0);
defineSymbol(math, ams, textord, "ℷ", "\\gimel", !0);
defineSymbol(math, ams, textord, "ϝ", "\\digamma", !0);
defineSymbol(math, ams, textord, "ϰ", "\\varkappa");
defineSymbol(math, ams, open, "┌", "\\@ulcorner", !0);
defineSymbol(math, ams, close, "┐", "\\@urcorner", !0);
defineSymbol(math, ams, open, "└", "\\@llcorner", !0);
defineSymbol(math, ams, close, "┘", "\\@lrcorner", !0);
defineSymbol(math, ams, rel, "≦", "\\leqq", !0);
defineSymbol(math, ams, rel, "⩽", "\\leqslant", !0);
defineSymbol(math, ams, rel, "⪕", "\\eqslantless", !0);
defineSymbol(math, ams, rel, "≲", "\\lesssim", !0);
defineSymbol(math, ams, rel, "⪅", "\\lessapprox", !0);
defineSymbol(math, ams, rel, "≊", "\\approxeq", !0);
defineSymbol(math, ams, bin, "⋖", "\\lessdot");
defineSymbol(math, ams, rel, "⋘", "\\lll", !0);
defineSymbol(math, ams, rel, "≶", "\\lessgtr", !0);
defineSymbol(math, ams, rel, "⋚", "\\lesseqgtr", !0);
defineSymbol(math, ams, rel, "⪋", "\\lesseqqgtr", !0);
defineSymbol(math, ams, rel, "≑", "\\doteqdot");
defineSymbol(math, ams, rel, "≓", "\\risingdotseq", !0);
defineSymbol(math, ams, rel, "≒", "\\fallingdotseq", !0);
defineSymbol(math, ams, rel, "∽", "\\backsim", !0);
defineSymbol(math, ams, rel, "⋍", "\\backsimeq", !0);
defineSymbol(math, ams, rel, "⫅", "\\subseteqq", !0);
defineSymbol(math, ams, rel, "⋐", "\\Subset", !0);
defineSymbol(math, ams, rel, "⊏", "\\sqsubset", !0);
defineSymbol(math, ams, rel, "≼", "\\preccurlyeq", !0);
defineSymbol(math, ams, rel, "⋞", "\\curlyeqprec", !0);
defineSymbol(math, ams, rel, "≾", "\\precsim", !0);
defineSymbol(math, ams, rel, "⪷", "\\precapprox", !0);
defineSymbol(math, ams, rel, "⊲", "\\vartriangleleft");
defineSymbol(math, ams, rel, "⊴", "\\trianglelefteq");
defineSymbol(math, ams, rel, "⊨", "\\vDash", !0);
defineSymbol(math, ams, rel, "⊪", "\\Vvdash", !0);
defineSymbol(math, ams, rel, "⌣", "\\smallsmile");
defineSymbol(math, ams, rel, "⌢", "\\smallfrown");
defineSymbol(math, ams, rel, "≏", "\\bumpeq", !0);
defineSymbol(math, ams, rel, "≎", "\\Bumpeq", !0);
defineSymbol(math, ams, rel, "≧", "\\geqq", !0);
defineSymbol(math, ams, rel, "⩾", "\\geqslant", !0);
defineSymbol(math, ams, rel, "⪖", "\\eqslantgtr", !0);
defineSymbol(math, ams, rel, "≳", "\\gtrsim", !0);
defineSymbol(math, ams, rel, "⪆", "\\gtrapprox", !0);
defineSymbol(math, ams, bin, "⋗", "\\gtrdot");
defineSymbol(math, ams, rel, "⋙", "\\ggg", !0);
defineSymbol(math, ams, rel, "≷", "\\gtrless", !0);
defineSymbol(math, ams, rel, "⋛", "\\gtreqless", !0);
defineSymbol(math, ams, rel, "⪌", "\\gtreqqless", !0);
defineSymbol(math, ams, rel, "≖", "\\eqcirc", !0);
defineSymbol(math, ams, rel, "≗", "\\circeq", !0);
defineSymbol(math, ams, rel, "≜", "\\triangleq", !0);
defineSymbol(math, ams, rel, "∼", "\\thicksim");
defineSymbol(math, ams, rel, "≈", "\\thickapprox");
defineSymbol(math, ams, rel, "⫆", "\\supseteqq", !0);
defineSymbol(math, ams, rel, "⋑", "\\Supset", !0);
defineSymbol(math, ams, rel, "⊐", "\\sqsupset", !0);
defineSymbol(math, ams, rel, "≽", "\\succcurlyeq", !0);
defineSymbol(math, ams, rel, "⋟", "\\curlyeqsucc", !0);
defineSymbol(math, ams, rel, "≿", "\\succsim", !0);
defineSymbol(math, ams, rel, "⪸", "\\succapprox", !0);
defineSymbol(math, ams, rel, "⊳", "\\vartriangleright");
defineSymbol(math, ams, rel, "⊵", "\\trianglerighteq");
defineSymbol(math, ams, rel, "⊩", "\\Vdash", !0);
defineSymbol(math, ams, rel, "∣", "\\shortmid");
defineSymbol(math, ams, rel, "∥", "\\shortparallel");
defineSymbol(math, ams, rel, "≬", "\\between", !0);
defineSymbol(math, ams, rel, "⋔", "\\pitchfork", !0);
defineSymbol(math, ams, rel, "∝", "\\varpropto");
defineSymbol(math, ams, rel, "◀", "\\blacktriangleleft");
defineSymbol(math, ams, rel, "∴", "\\therefore", !0);
defineSymbol(math, ams, rel, "∍", "\\backepsilon");
defineSymbol(math, ams, rel, "▶", "\\blacktriangleright");
defineSymbol(math, ams, rel, "∵", "\\because", !0);
defineSymbol(math, ams, rel, "⋘", "\\llless");
defineSymbol(math, ams, rel, "⋙", "\\gggtr");
defineSymbol(math, ams, bin, "⊲", "\\lhd");
defineSymbol(math, ams, bin, "⊳", "\\rhd");
defineSymbol(math, ams, rel, "≂", "\\eqsim", !0);
defineSymbol(math, main, rel, "⋈", "\\Join");
defineSymbol(math, ams, rel, "≑", "\\Doteq", !0);
defineSymbol(math, ams, bin, "∔", "\\dotplus", !0);
defineSymbol(math, ams, bin, "∖", "\\smallsetminus");
defineSymbol(math, ams, bin, "⋒", "\\Cap", !0);
defineSymbol(math, ams, bin, "⋓", "\\Cup", !0);
defineSymbol(math, ams, bin, "⩞", "\\doublebarwedge", !0);
defineSymbol(math, ams, bin, "⊟", "\\boxminus", !0);
defineSymbol(math, ams, bin, "⊞", "\\boxplus", !0);
defineSymbol(math, ams, bin, "⋇", "\\divideontimes", !0);
defineSymbol(math, ams, bin, "⋉", "\\ltimes", !0);
defineSymbol(math, ams, bin, "⋊", "\\rtimes", !0);
defineSymbol(math, ams, bin, "⋋", "\\leftthreetimes", !0);
defineSymbol(math, ams, bin, "⋌", "\\rightthreetimes", !0);
defineSymbol(math, ams, bin, "⋏", "\\curlywedge", !0);
defineSymbol(math, ams, bin, "⋎", "\\curlyvee", !0);
defineSymbol(math, ams, bin, "⊝", "\\circleddash", !0);
defineSymbol(math, ams, bin, "⊛", "\\circledast", !0);
defineSymbol(math, ams, bin, "⋅", "\\centerdot");
defineSymbol(math, ams, bin, "⊺", "\\intercal", !0);
defineSymbol(math, ams, bin, "⋒", "\\doublecap");
defineSymbol(math, ams, bin, "⋓", "\\doublecup");
defineSymbol(math, ams, bin, "⊠", "\\boxtimes", !0);
defineSymbol(math, ams, rel, "⇢", "\\dashrightarrow", !0);
defineSymbol(math, ams, rel, "⇠", "\\dashleftarrow", !0);
defineSymbol(math, ams, rel, "⇇", "\\leftleftarrows", !0);
defineSymbol(math, ams, rel, "⇆", "\\leftrightarrows", !0);
defineSymbol(math, ams, rel, "⇚", "\\Lleftarrow", !0);
defineSymbol(math, ams, rel, "↞", "\\twoheadleftarrow", !0);
defineSymbol(math, ams, rel, "↢", "\\leftarrowtail", !0);
defineSymbol(math, ams, rel, "↫", "\\looparrowleft", !0);
defineSymbol(math, ams, rel, "⇋", "\\leftrightharpoons", !0);
defineSymbol(math, ams, rel, "↶", "\\curvearrowleft", !0);
defineSymbol(math, ams, rel, "↺", "\\circlearrowleft", !0);
defineSymbol(math, ams, rel, "↰", "\\Lsh", !0);
defineSymbol(math, ams, rel, "⇈", "\\upuparrows", !0);
defineSymbol(math, ams, rel, "↿", "\\upharpoonleft", !0);
defineSymbol(math, ams, rel, "⇃", "\\downharpoonleft", !0);
defineSymbol(math, main, rel, "⊶", "\\origof", !0);
defineSymbol(math, main, rel, "⊷", "\\imageof", !0);
defineSymbol(math, ams, rel, "⊸", "\\multimap", !0);
defineSymbol(math, ams, rel, "↭", "\\leftrightsquigarrow", !0);
defineSymbol(math, ams, rel, "⇉", "\\rightrightarrows", !0);
defineSymbol(math, ams, rel, "⇄", "\\rightleftarrows", !0);
defineSymbol(math, ams, rel, "↠", "\\twoheadrightarrow", !0);
defineSymbol(math, ams, rel, "↣", "\\rightarrowtail", !0);
defineSymbol(math, ams, rel, "↬", "\\looparrowright", !0);
defineSymbol(math, ams, rel, "↷", "\\curvearrowright", !0);
defineSymbol(math, ams, rel, "↻", "\\circlearrowright", !0);
defineSymbol(math, ams, rel, "↱", "\\Rsh", !0);
defineSymbol(math, ams, rel, "⇊", "\\downdownarrows", !0);
defineSymbol(math, ams, rel, "↾", "\\upharpoonright", !0);
defineSymbol(math, ams, rel, "⇂", "\\downharpoonright", !0);
defineSymbol(math, ams, rel, "⇝", "\\rightsquigarrow", !0);
defineSymbol(math, ams, rel, "⇝", "\\leadsto");
defineSymbol(math, ams, rel, "⇛", "\\Rrightarrow", !0);
defineSymbol(math, ams, rel, "↾", "\\restriction");
defineSymbol(math, main, textord, "‘", "`");
defineSymbol(math, main, textord, "$", "\\$");
defineSymbol(text$a, main, textord, "$", "\\$");
defineSymbol(text$a, main, textord, "$", "\\textdollar");
defineSymbol(math, main, textord, "%", "\\%");
defineSymbol(text$a, main, textord, "%", "\\%");
defineSymbol(math, main, textord, "_", "\\_");
defineSymbol(text$a, main, textord, "_", "\\_");
defineSymbol(text$a, main, textord, "_", "\\textunderscore");
defineSymbol(math, main, textord, "∠", "\\angle", !0);
defineSymbol(math, main, textord, "∞", "\\infty", !0);
defineSymbol(math, main, textord, "′", "\\prime");
defineSymbol(math, main, textord, "△", "\\triangle");
defineSymbol(math, main, textord, "Γ", "\\Gamma", !0);
defineSymbol(math, main, textord, "Δ", "\\Delta", !0);
defineSymbol(math, main, textord, "Θ", "\\Theta", !0);
defineSymbol(math, main, textord, "Λ", "\\Lambda", !0);
defineSymbol(math, main, textord, "Ξ", "\\Xi", !0);
defineSymbol(math, main, textord, "Π", "\\Pi", !0);
defineSymbol(math, main, textord, "Σ", "\\Sigma", !0);
defineSymbol(math, main, textord, "Υ", "\\Upsilon", !0);
defineSymbol(math, main, textord, "Φ", "\\Phi", !0);
defineSymbol(math, main, textord, "Ψ", "\\Psi", !0);
defineSymbol(math, main, textord, "Ω", "\\Omega", !0);
defineSymbol(math, main, textord, "A", "Α");
defineSymbol(math, main, textord, "B", "Β");
defineSymbol(math, main, textord, "E", "Ε");
defineSymbol(math, main, textord, "Z", "Ζ");
defineSymbol(math, main, textord, "H", "Η");
defineSymbol(math, main, textord, "I", "Ι");
defineSymbol(math, main, textord, "K", "Κ");
defineSymbol(math, main, textord, "M", "Μ");
defineSymbol(math, main, textord, "N", "Ν");
defineSymbol(math, main, textord, "O", "Ο");
defineSymbol(math, main, textord, "P", "Ρ");
defineSymbol(math, main, textord, "T", "Τ");
defineSymbol(math, main, textord, "X", "Χ");
defineSymbol(math, main, textord, "¬", "\\neg", !0);
defineSymbol(math, main, textord, "¬", "\\lnot");
defineSymbol(math, main, textord, "⊤", "\\top");
defineSymbol(math, main, textord, "⊥", "\\bot");
defineSymbol(math, main, textord, "∅", "\\emptyset");
defineSymbol(math, ams, textord, "∅", "\\varnothing");
defineSymbol(math, main, mathord, "α", "\\alpha", !0);
defineSymbol(math, main, mathord, "β", "\\beta", !0);
defineSymbol(math, main, mathord, "γ", "\\gamma", !0);
defineSymbol(math, main, mathord, "δ", "\\delta", !0);
defineSymbol(math, main, mathord, "ϵ", "\\epsilon", !0);
defineSymbol(math, main, mathord, "ζ", "\\zeta", !0);
defineSymbol(math, main, mathord, "η", "\\eta", !0);
defineSymbol(math, main, mathord, "θ", "\\theta", !0);
defineSymbol(math, main, mathord, "ι", "\\iota", !0);
defineSymbol(math, main, mathord, "κ", "\\kappa", !0);
defineSymbol(math, main, mathord, "λ", "\\lambda", !0);
defineSymbol(math, main, mathord, "μ", "\\mu", !0);
defineSymbol(math, main, mathord, "ν", "\\nu", !0);
defineSymbol(math, main, mathord, "ξ", "\\xi", !0);
defineSymbol(math, main, mathord, "ο", "\\omicron", !0);
defineSymbol(math, main, mathord, "π", "\\pi", !0);
defineSymbol(math, main, mathord, "ρ", "\\rho", !0);
defineSymbol(math, main, mathord, "σ", "\\sigma", !0);
defineSymbol(math, main, mathord, "τ", "\\tau", !0);
defineSymbol(math, main, mathord, "υ", "\\upsilon", !0);
defineSymbol(math, main, mathord, "ϕ", "\\phi", !0);
defineSymbol(math, main, mathord, "χ", "\\chi", !0);
defineSymbol(math, main, mathord, "ψ", "\\psi", !0);
defineSymbol(math, main, mathord, "ω", "\\omega", !0);
defineSymbol(math, main, mathord, "ε", "\\varepsilon", !0);
defineSymbol(math, main, mathord, "ϑ", "\\vartheta", !0);
defineSymbol(math, main, mathord, "ϖ", "\\varpi", !0);
defineSymbol(math, main, mathord, "ϱ", "\\varrho", !0);
defineSymbol(math, main, mathord, "ς", "\\varsigma", !0);
defineSymbol(math, main, mathord, "φ", "\\varphi", !0);
defineSymbol(math, main, bin, "∗", "*", !0);
defineSymbol(math, main, bin, "+", "+");
defineSymbol(math, main, bin, "−", "-", !0);
defineSymbol(math, main, bin, "⋅", "\\cdot", !0);
defineSymbol(math, main, bin, "∘", "\\circ", !0);
defineSymbol(math, main, bin, "÷", "\\div", !0);
defineSymbol(math, main, bin, "±", "\\pm", !0);
defineSymbol(math, main, bin, "×", "\\times", !0);
defineSymbol(math, main, bin, "∩", "\\cap", !0);
defineSymbol(math, main, bin, "∪", "\\cup", !0);
defineSymbol(math, main, bin, "∖", "\\setminus", !0);
defineSymbol(math, main, bin, "∧", "\\land");
defineSymbol(math, main, bin, "∨", "\\lor");
defineSymbol(math, main, bin, "∧", "\\wedge", !0);
defineSymbol(math, main, bin, "∨", "\\vee", !0);
defineSymbol(math, main, textord, "√", "\\surd");
defineSymbol(math, main, open, "⟨", "\\langle", !0);
defineSymbol(math, main, open, "∣", "\\lvert");
defineSymbol(math, main, open, "∥", "\\lVert");
defineSymbol(math, main, close, "?", "?");
defineSymbol(math, main, close, "!", "!");
defineSymbol(math, main, close, "⟩", "\\rangle", !0);
defineSymbol(math, main, close, "∣", "\\rvert");
defineSymbol(math, main, close, "∥", "\\rVert");
defineSymbol(math, main, rel, "=", "=");
defineSymbol(math, main, rel, ":", ":");
defineSymbol(math, main, rel, "≈", "\\approx", !0);
defineSymbol(math, main, rel, "≅", "\\cong", !0);
defineSymbol(math, main, rel, "≥", "\\ge");
defineSymbol(math, main, rel, "≥", "\\geq", !0);
defineSymbol(math, main, rel, "←", "\\gets");
defineSymbol(math, main, rel, ">", "\\gt", !0);
defineSymbol(math, main, rel, "∈", "\\in", !0);
defineSymbol(math, main, rel, "", "\\@not");
defineSymbol(math, main, rel, "⊂", "\\subset", !0);
defineSymbol(math, main, rel, "⊃", "\\supset", !0);
defineSymbol(math, main, rel, "⊆", "\\subseteq", !0);
defineSymbol(math, main, rel, "⊇", "\\supseteq", !0);
defineSymbol(math, ams, rel, "⊈", "\\nsubseteq", !0);
defineSymbol(math, ams, rel, "⊉", "\\nsupseteq", !0);
defineSymbol(math, main, rel, "⊨", "\\models");
defineSymbol(math, main, rel, "←", "\\leftarrow", !0);
defineSymbol(math, main, rel, "≤", "\\le");
defineSymbol(math, main, rel, "≤", "\\leq", !0);
defineSymbol(math, main, rel, "<", "\\lt", !0);
defineSymbol(math, main, rel, "→", "\\rightarrow", !0);
defineSymbol(math, main, rel, "→", "\\to");
defineSymbol(math, ams, rel, "≱", "\\ngeq", !0);
defineSymbol(math, ams, rel, "≰", "\\nleq", !0);
defineSymbol(math, main, spacing, " ", "\\ ");
defineSymbol(math, main, spacing, " ", "\\space");
defineSymbol(math, main, spacing, " ", "\\nobreakspace");
defineSymbol(text$a, main, spacing, " ", "\\ ");
defineSymbol(text$a, main, spacing, " ", " ");
defineSymbol(text$a, main, spacing, " ", "\\space");
defineSymbol(text$a, main, spacing, " ", "\\nobreakspace");
defineSymbol(math, main, spacing, null, "\\nobreak");
defineSymbol(math, main, spacing, null, "\\allowbreak");
defineSymbol(math, main, punct, ",", ",");
defineSymbol(math, main, punct, ";", ";");
defineSymbol(math, ams, bin, "⊼", "\\barwedge", !0);
defineSymbol(math, ams, bin, "⊻", "\\veebar", !0);
defineSymbol(math, main, bin, "⊙", "\\odot", !0);
defineSymbol(math, main, bin, "⊕", "\\oplus", !0);
defineSymbol(math, main, bin, "⊗", "\\otimes", !0);
defineSymbol(math, main, textord, "∂", "\\partial", !0);
defineSymbol(math, main, bin, "⊘", "\\oslash", !0);
defineSymbol(math, ams, bin, "⊚", "\\circledcirc", !0);
defineSymbol(math, ams, bin, "⊡", "\\boxdot", !0);
defineSymbol(math, main, bin, "△", "\\bigtriangleup");
defineSymbol(math, main, bin, "▽", "\\bigtriangledown");
defineSymbol(math, main, bin, "†", "\\dagger");
defineSymbol(math, main, bin, "⋄", "\\diamond");
defineSymbol(math, main, bin, "⋆", "\\star");
defineSymbol(math, main, bin, "◃", "\\triangleleft");
defineSymbol(math, main, bin, "▹", "\\triangleright");
defineSymbol(math, main, open, "{", "\\{");
defineSymbol(text$a, main, textord, "{", "\\{");
defineSymbol(text$a, main, textord, "{", "\\textbraceleft");
defineSymbol(math, main, close, "}", "\\}");
defineSymbol(text$a, main, textord, "}", "\\}");
defineSymbol(text$a, main, textord, "}", "\\textbraceright");
defineSymbol(math, main, open, "{", "\\lbrace");
defineSymbol(math, main, close, "}", "\\rbrace");
defineSymbol(math, main, open, "[", "\\lbrack", !0);
defineSymbol(text$a, main, textord, "[", "\\lbrack", !0);
defineSymbol(math, main, close, "]", "\\rbrack", !0);
defineSymbol(text$a, main, textord, "]", "\\rbrack", !0);
defineSymbol(math, main, open, "(", "\\lparen", !0);
defineSymbol(math, main, close, ")", "\\rparen", !0);
defineSymbol(text$a, main, textord, "<", "\\textless", !0);
defineSymbol(text$a, main, textord, ">", "\\textgreater", !0);
defineSymbol(math, main, open, "⌊", "\\lfloor", !0);
defineSymbol(math, main, close, "⌋", "\\rfloor", !0);
defineSymbol(math, main, open, "⌈", "\\lceil", !0);
defineSymbol(math, main, close, "⌉", "\\rceil", !0);
defineSymbol(math, main, textord, "\\", "\\backslash");
defineSymbol(math, main, textord, "∣", "|");
defineSymbol(math, main, textord, "∣", "\\vert");
defineSymbol(text$a, main, textord, "|", "\\textbar", !0);
defineSymbol(math, main, textord, "∥", "\\|");
defineSymbol(math, main, textord, "∥", "\\Vert");
defineSymbol(text$a, main, textord, "∥", "\\textbardbl");
defineSymbol(text$a, main, textord, "~", "\\textasciitilde");
defineSymbol(text$a, main, textord, "\\", "\\textbackslash");
defineSymbol(text$a, main, textord, "^", "\\textasciicircum");
defineSymbol(math, main, rel, "↑", "\\uparrow", !0);
defineSymbol(math, main, rel, "⇑", "\\Uparrow", !0);
defineSymbol(math, main, rel, "↓", "\\downarrow", !0);
defineSymbol(math, main, rel, "⇓", "\\Downarrow", !0);
defineSymbol(math, main, rel, "↕", "\\updownarrow", !0);
defineSymbol(math, main, rel, "⇕", "\\Updownarrow", !0);
defineSymbol(math, main, op, "∐", "\\coprod");
defineSymbol(math, main, op, "⋁", "\\bigvee");
defineSymbol(math, main, op, "⋀", "\\bigwedge");
defineSymbol(math, main, op, "⨄", "\\biguplus");
defineSymbol(math, main, op, "⋂", "\\bigcap");
defineSymbol(math, main, op, "⋃", "\\bigcup");
defineSymbol(math, main, op, "∫", "\\int");
defineSymbol(math, main, op, "∫", "\\intop");
defineSymbol(math, main, op, "∬", "\\iint");
defineSymbol(math, main, op, "∭", "\\iiint");
defineSymbol(math, main, op, "∏", "\\prod");
defineSymbol(math, main, op, "∑", "\\sum");
defineSymbol(math, main, op, "⨂", "\\bigotimes");
defineSymbol(math, main, op, "⨁", "\\bigoplus");
defineSymbol(math, main, op, "⨀", "\\bigodot");
defineSymbol(math, main, op, "∮", "\\oint");
defineSymbol(math, main, op, "∯", "\\oiint");
defineSymbol(math, main, op, "∰", "\\oiiint");
defineSymbol(math, main, op, "⨆", "\\bigsqcup");
defineSymbol(math, main, op, "∫", "\\smallint");
defineSymbol(text$a, main, inner, "…", "\\textellipsis");
defineSymbol(math, main, inner, "…", "\\mathellipsis");
defineSymbol(text$a, main, inner, "…", "\\ldots", !0);
defineSymbol(math, main, inner, "…", "\\ldots", !0);
defineSymbol(math, main, inner, "⋯", "\\@cdots", !0);
defineSymbol(math, main, inner, "⋱", "\\ddots", !0);
defineSymbol(math, main, textord, "⋮", "\\varvdots");
defineSymbol(math, main, accent, "ˊ", "\\acute");
defineSymbol(math, main, accent, "ˋ", "\\grave");
defineSymbol(math, main, accent, "¨", "\\ddot");
defineSymbol(math, main, accent, "~", "\\tilde");
defineSymbol(math, main, accent, "ˉ", "\\bar");
defineSymbol(math, main, accent, "˘", "\\breve");
defineSymbol(math, main, accent, "ˇ", "\\check");
defineSymbol(math, main, accent, "^", "\\hat");
defineSymbol(math, main, accent, "⃗", "\\vec");
defineSymbol(math, main, accent, "˙", "\\dot");
defineSymbol(math, main, accent, "˚", "\\mathring");
defineSymbol(math, main, mathord, "", "\\@imath");
defineSymbol(math, main, mathord, "", "\\@jmath");
defineSymbol(math, main, textord, "ı", "ı");
defineSymbol(math, main, textord, "ȷ", "ȷ");
defineSymbol(text$a, main, textord, "ı", "\\i", !0);
defineSymbol(text$a, main, textord, "ȷ", "\\j", !0);
defineSymbol(text$a, main, textord, "ß", "\\ss", !0);
defineSymbol(text$a, main, textord, "æ", "\\ae", !0);
defineSymbol(text$a, main, textord, "œ", "\\oe", !0);
defineSymbol(text$a, main, textord, "ø", "\\o", !0);
defineSymbol(text$a, main, textord, "Æ", "\\AE", !0);
defineSymbol(text$a, main, textord, "Œ", "\\OE", !0);
defineSymbol(text$a, main, textord, "Ø", "\\O", !0);
defineSymbol(text$a, main, accent, "ˊ", "\\'");
defineSymbol(text$a, main, accent, "ˋ", "\\`");
defineSymbol(text$a, main, accent, "ˆ", "\\^");
defineSymbol(text$a, main, accent, "˜", "\\~");
defineSymbol(text$a, main, accent, "ˉ", "\\=");
defineSymbol(text$a, main, accent, "˘", "\\u");
defineSymbol(text$a, main, accent, "˙", "\\.");
defineSymbol(text$a, main, accent, "¸", "\\c");
defineSymbol(text$a, main, accent, "˚", "\\r");
defineSymbol(text$a, main, accent, "ˇ", "\\v");
defineSymbol(text$a, main, accent, "¨", '\\"');
defineSymbol(text$a, main, accent, "˝", "\\H");
defineSymbol(text$a, main, accent, "◯", "\\textcircled");
var ligatures = {
  "--": !0,
  "---": !0,
  "``": !0,
  "''": !0
};
defineSymbol(text$a, main, textord, "–", "--", !0);
defineSymbol(text$a, main, textord, "–", "\\textendash");
defineSymbol(text$a, main, textord, "—", "---", !0);
defineSymbol(text$a, main, textord, "—", "\\textemdash");
defineSymbol(text$a, main, textord, "‘", "`", !0);
defineSymbol(text$a, main, textord, "‘", "\\textquoteleft");
defineSymbol(text$a, main, textord, "’", "'", !0);
defineSymbol(text$a, main, textord, "’", "\\textquoteright");
defineSymbol(text$a, main, textord, "“", "``", !0);
defineSymbol(text$a, main, textord, "“", "\\textquotedblleft");
defineSymbol(text$a, main, textord, "”", "''", !0);
defineSymbol(text$a, main, textord, "”", "\\textquotedblright");
defineSymbol(math, main, textord, "°", "\\degree", !0);
defineSymbol(text$a, main, textord, "°", "\\degree");
defineSymbol(text$a, main, textord, "°", "\\textdegree", !0);
defineSymbol(math, main, textord, "£", "\\pounds");
defineSymbol(math, main, textord, "£", "\\mathsterling", !0);
defineSymbol(text$a, main, textord, "£", "\\pounds");
defineSymbol(text$a, main, textord, "£", "\\textsterling", !0);
defineSymbol(math, ams, textord, "✠", "\\maltese");
defineSymbol(text$a, ams, textord, "✠", "\\maltese");
var mathTextSymbols = '0123456789/@."';
for (var i = 0; i < mathTextSymbols.length; i++) {
  var ch = mathTextSymbols.charAt(i);
  defineSymbol(math, main, textord, ch, ch);
}
var textSymbols = '0123456789!@*()-=+";:?/.,';
for (var _i = 0; _i < textSymbols.length; _i++) {
  var _ch = textSymbols.charAt(_i);
  defineSymbol(text$a, main, textord, _ch, _ch);
}
var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var _i2 = 0; _i2 < letters.length; _i2++) {
  var _ch2 = letters.charAt(_i2);
  defineSymbol(math, main, mathord, _ch2, _ch2), defineSymbol(text$a, main, textord, _ch2, _ch2);
}
defineSymbol(math, ams, textord, "C", "ℂ");
defineSymbol(text$a, ams, textord, "C", "ℂ");
defineSymbol(math, ams, textord, "H", "ℍ");
defineSymbol(text$a, ams, textord, "H", "ℍ");
defineSymbol(math, ams, textord, "N", "ℕ");
defineSymbol(text$a, ams, textord, "N", "ℕ");
defineSymbol(math, ams, textord, "P", "ℙ");
defineSymbol(text$a, ams, textord, "P", "ℙ");
defineSymbol(math, ams, textord, "Q", "ℚ");
defineSymbol(text$a, ams, textord, "Q", "ℚ");
defineSymbol(math, ams, textord, "R", "ℝ");
defineSymbol(text$a, ams, textord, "R", "ℝ");
defineSymbol(math, ams, textord, "Z", "ℤ");
defineSymbol(text$a, ams, textord, "Z", "ℤ");
defineSymbol(math, main, mathord, "h", "ℎ");
defineSymbol(text$a, main, mathord, "h", "ℎ");
var wideChar = "";
for (var _i3 = 0; _i3 < letters.length; _i3++) {
  var _ch3 = letters.charAt(_i3);
  wideChar = String.fromCharCode(55349, 56320 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56372 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56424 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56580 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56684 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56736 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56788 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56840 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56944 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), _i3 < 26 && (wideChar = String.fromCharCode(55349, 56632 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar), wideChar = String.fromCharCode(55349, 56476 + _i3), defineSymbol(math, main, mathord, _ch3, wideChar), defineSymbol(text$a, main, textord, _ch3, wideChar));
}
wideChar = "𝕜";
defineSymbol(math, main, mathord, "k", wideChar);
defineSymbol(text$a, main, textord, "k", wideChar);
for (var _i4 = 0; _i4 < 10; _i4++) {
  var _ch4 = _i4.toString();
  wideChar = String.fromCharCode(55349, 57294 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$a, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57314 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$a, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57324 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$a, main, textord, _ch4, wideChar), wideChar = String.fromCharCode(55349, 57334 + _i4), defineSymbol(math, main, mathord, _ch4, wideChar), defineSymbol(text$a, main, textord, _ch4, wideChar);
}
var extraLatin = "ÐÞþ";
for (var _i5 = 0; _i5 < extraLatin.length; _i5++) {
  var _ch5 = extraLatin.charAt(_i5);
  defineSymbol(math, main, mathord, _ch5, _ch5), defineSymbol(text$a, main, textord, _ch5, _ch5);
}
var wideLatinLetterData = [
  ["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
], wideNumeralData = [
  ["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
], wideCharacterFont = function(e, t) {
  var r = e.charCodeAt(0), a = e.charCodeAt(1), l = (r - 55296) * 1024 + (a - 56320) + 65536, h = t === "math" ? 0 : 1;
  if (119808 <= l && l < 120484) {
    var c = Math.floor((l - 119808) / 26);
    return [wideLatinLetterData[c][2], wideLatinLetterData[c][h]];
  } else if (120782 <= l && l <= 120831) {
    var d = Math.floor((l - 120782) / 10);
    return [wideNumeralData[d][2], wideNumeralData[d][h]];
  } else {
    if (l === 120485 || l === 120486)
      return [wideLatinLetterData[0][2], wideLatinLetterData[0][h]];
    if (120486 < l && l < 120782)
      return ["", ""];
    throw new ParseError("Unsupported character: " + e);
  }
}, lookupSymbol = function(e, t, r) {
  return symbols[r][e] && symbols[r][e].replace && (e = symbols[r][e].replace), {
    value: e,
    metrics: getCharacterMetrics(e, t, r)
  };
}, makeSymbol = function(e, t, r, a, l) {
  var h = lookupSymbol(e, t, r), c = h.metrics;
  e = h.value;
  var d;
  if (c) {
    var _ = c.italic;
    (r === "text" || a && a.font === "mathit") && (_ = 0), d = new SymbolNode(e, c.height, c.depth, _, c.skew, c.width, l);
  } else
    typeof console < "u" && console.warn("No character metrics " + ("for '" + e + "' in style '" + t + "' and mode '" + r + "'")), d = new SymbolNode(e, 0, 0, 0, 0, 0, l);
  if (a) {
    d.maxFontSize = a.sizeMultiplier, a.style.isTight() && d.classes.push("mtight");
    var m = a.getColor();
    m && (d.style.color = m);
  }
  return d;
}, mathsym = function(e, t, r, a) {
  return a === void 0 && (a = []), r.font === "boldsymbol" && lookupSymbol(e, "Main-Bold", t).metrics ? makeSymbol(e, "Main-Bold", t, r, a.concat(["mathbf"])) : e === "\\" || symbols[t][e].font === "main" ? makeSymbol(e, "Main-Regular", t, r, a) : makeSymbol(e, "AMS-Regular", t, r, a.concat(["amsrm"]));
}, boldsymbol = function(e, t, r, a, l) {
  return l !== "textord" && lookupSymbol(e, "Math-BoldItalic", t).metrics ? {
    fontName: "Math-BoldItalic",
    fontClass: "boldsymbol"
  } : {
    fontName: "Main-Bold",
    fontClass: "mathbf"
  };
}, makeOrd = function(e, t, r) {
  var a = e.mode, l = e.text, h = ["mord"], c = a === "math" || a === "text" && t.font, d = c ? t.font : t.fontFamily, _ = "", m = "";
  if (l.charCodeAt(0) === 55349 && ([_, m] = wideCharacterFont(l, a)), _.length > 0)
    return makeSymbol(l, _, a, t, h.concat(m));
  if (d) {
    var y, x;
    if (d === "boldsymbol") {
      var b = boldsymbol(l, a, t, h, r);
      y = b.fontName, x = [b.fontClass];
    } else c ? (y = fontMap[d].fontName, x = [d]) : (y = retrieveTextFontName(d, t.fontWeight, t.fontShape), x = [d, t.fontWeight, t.fontShape]);
    if (lookupSymbol(l, y, a).metrics)
      return makeSymbol(l, y, a, t, h.concat(x));
    if (ligatures.hasOwnProperty(l) && y.slice(0, 10) === "Typewriter") {
      for (var A = [], f = 0; f < l.length; f++)
        A.push(makeSymbol(l[f], y, a, t, h.concat(x)));
      return makeFragment(A);
    }
  }
  if (r === "mathord")
    return makeSymbol(l, "Math-Italic", a, t, h.concat(["mathnormal"]));
  if (r === "textord") {
    var s = symbols[a][l] && symbols[a][l].font;
    if (s === "ams") {
      var u = retrieveTextFontName("amsrm", t.fontWeight, t.fontShape);
      return makeSymbol(l, u, a, t, h.concat("amsrm", t.fontWeight, t.fontShape));
    } else if (s === "main" || !s) {
      var p = retrieveTextFontName("textrm", t.fontWeight, t.fontShape);
      return makeSymbol(l, p, a, t, h.concat(t.fontWeight, t.fontShape));
    } else {
      var g = retrieveTextFontName(s, t.fontWeight, t.fontShape);
      return makeSymbol(l, g, a, t, h.concat(g, t.fontWeight, t.fontShape));
    }
  } else
    throw new Error("unexpected type: " + r + " in makeOrd");
}, canCombine = (n, e) => {
  if (createClass(n.classes) !== createClass(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;
}, tryCombineChars = (n) => {
  for (var e = 0; e < n.length - 1; e++) {
    var t = n[e], r = n[e + 1];
    t instanceof SymbolNode && r instanceof SymbolNode && canCombine(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;
}, sizeElementFromChildren = function(e) {
  for (var t = 0, r = 0, a = 0, l = 0; l < e.children.length; l++) {
    var h = e.children[l];
    h.height > t && (t = h.height), h.depth > r && (r = h.depth), h.maxFontSize > a && (a = h.maxFontSize);
  }
  e.height = t, e.depth = r, e.maxFontSize = a;
}, makeSpan$2 = function(e, t, r, a) {
  var l = new Span(e, t, r, a);
  return sizeElementFromChildren(l), l;
}, makeSvgSpan = (n, e, t, r) => new Span(n, e, t, r), makeLineSpan = function(e, t, r) {
  var a = makeSpan$2([e], [], t);
  return a.height = Math.max(r || t.fontMetrics().defaultRuleThickness, t.minRuleThickness), a.style.borderBottomWidth = makeEm(a.height), a.maxFontSize = 1, a;
}, makeAnchor = function(e, t, r, a) {
  var l = new Anchor(e, t, r, a);
  return sizeElementFromChildren(l), l;
}, makeFragment = function(e) {
  var t = new DocumentFragment(e);
  return sizeElementFromChildren(t), t;
}, wrapFragment = function(e, t) {
  return e instanceof DocumentFragment ? makeSpan$2([], [e], t) : e;
}, getVListChildrenAndDepth = function(e) {
  if (e.positionType === "individualShift") {
    for (var t = e.children, r = [t[0]], a = -t[0].shift - t[0].elem.depth, l = a, h = 1; h < t.length; h++) {
      var c = -t[h].shift - l - t[h].elem.depth, d = c - (t[h - 1].elem.height + t[h - 1].elem.depth);
      l = l + c, r.push({
        type: "kern",
        size: d
      }), r.push(t[h]);
    }
    return {
      children: r,
      depth: a
    };
  }
  var _;
  if (e.positionType === "top") {
    for (var m = e.positionData, y = 0; y < e.children.length; y++) {
      var x = e.children[y];
      m -= x.type === "kern" ? x.size : x.elem.height + x.elem.depth;
    }
    _ = m;
  } else if (e.positionType === "bottom")
    _ = -e.positionData;
  else {
    var b = e.children[0];
    if (b.type !== "elem")
      throw new Error('First child must have type "elem".');
    if (e.positionType === "shift")
      _ = -b.elem.depth - e.positionData;
    else if (e.positionType === "firstBaseline")
      _ = -b.elem.depth;
    else
      throw new Error("Invalid positionType " + e.positionType + ".");
  }
  return {
    children: e.children,
    depth: _
  };
}, makeVList = function(e, t) {
  for (var {
    children: r,
    depth: a
  } = getVListChildrenAndDepth(e), l = 0, h = 0; h < r.length; h++) {
    var c = r[h];
    if (c.type === "elem") {
      var d = c.elem;
      l = Math.max(l, d.maxFontSize, d.height);
    }
  }
  l += 2;
  var _ = makeSpan$2(["pstrut"], []);
  _.style.height = makeEm(l);
  for (var m = [], y = a, x = a, b = a, A = 0; A < r.length; A++) {
    var f = r[A];
    if (f.type === "kern")
      b += f.size;
    else {
      var s = f.elem, u = f.wrapperClasses || [], p = f.wrapperStyle || {}, g = makeSpan$2(u, [_, s], void 0, p);
      g.style.top = makeEm(-l - b - s.depth), f.marginLeft && (g.style.marginLeft = f.marginLeft), f.marginRight && (g.style.marginRight = f.marginRight), m.push(g), b += s.height + s.depth;
    }
    y = Math.min(y, b), x = Math.max(x, b);
  }
  var w = makeSpan$2(["vlist"], m);
  w.style.height = makeEm(x);
  var o;
  if (y < 0) {
    var v = makeSpan$2([], []), M = makeSpan$2(["vlist"], [v]);
    M.style.height = makeEm(-y);
    var E = makeSpan$2(["vlist-s"], [new SymbolNode("​")]);
    o = [makeSpan$2(["vlist-r"], [w, E]), makeSpan$2(["vlist-r"], [M])];
  } else
    o = [makeSpan$2(["vlist-r"], [w])];
  var $ = makeSpan$2(["vlist-t"], o);
  return o.length === 2 && $.classes.push("vlist-t2"), $.height = x, $.depth = -y, $;
}, makeGlue = (n, e) => {
  var t = makeSpan$2(["mspace"], [], e), r = calculateSize(n, e);
  return t.style.marginRight = makeEm(r), t;
}, retrieveTextFontName = 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 l;
  return t === "textbf" && r === "textit" ? l = "BoldItalic" : t === "textbf" ? l = "Bold" : t === "textit" ? l = "Italic" : l = "Regular", a + "-" + l;
}, fontMap = {
  // 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"
  },
  // "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"
  }
}, svgData = {
  //   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]
}, staticSvg = function(e, t) {
  var [r, a, l] = svgData[e], h = new PathNode(r), c = new SvgNode([h], {
    width: makeEm(a),
    height: makeEm(l),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + makeEm(a),
    viewBox: "0 0 " + 1e3 * a + " " + 1e3 * l,
    preserveAspectRatio: "xMinYMin"
  }), d = makeSvgSpan(["overlay"], [c], t);
  return d.height = l, d.style.height = makeEm(l), d.style.width = makeEm(a), d;
}, buildCommon = {
  fontMap,
  makeSymbol,
  mathsym,
  makeSpan: makeSpan$2,
  makeSvgSpan,
  makeLineSpan,
  makeAnchor,
  makeFragment,
  wrapFragment,
  makeVList,
  makeOrd,
  makeGlue,
  staticSvg,
  svgData,
  tryCombineChars
}, thinspace = {
  number: 3,
  unit: "mu"
}, mediumspace = {
  number: 4,
  unit: "mu"
}, thickspace = {
  number: 5,
  unit: "mu"
}, spacings = {
  mord: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    minner: thinspace
  },
  mbin: {
    mord: mediumspace,
    mop: mediumspace,
    mopen: mediumspace,
    minner: mediumspace
  },
  mrel: {
    mord: thickspace,
    mop: thickspace,
    mopen: thickspace,
    minner: thickspace
  },
  mopen: {},
  mclose: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mpunct: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    mopen: thinspace,
    mclose: thinspace,
    mpunct: thinspace,
    minner: thinspace
  },
  minner: {
    mord: thinspace,
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    mopen: thinspace,
    mpunct: thinspace,
    minner: thinspace
  }
}, tightSpacings = {
  mord: {
    mop: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: thinspace
  },
  mpunct: {},
  minner: {
    mop: thinspace
  }
}, _functions = {}, _htmlGroupBuilders = {}, _mathmlGroupBuilders = {};
function defineFunction(n) {
  for (var {
    type: e,
    names: t,
    props: r,
    handler: a,
    htmlBuilder: l,
    mathmlBuilder: h
  } = n, c = {
    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
  }, d = 0; d < t.length; ++d)
    _functions[t[d]] = c;
  e && (l && (_htmlGroupBuilders[e] = l), h && (_mathmlGroupBuilders[e] = h));
}
function defineFunctionBuilders(n) {
  var {
    type: e,
    htmlBuilder: t,
    mathmlBuilder: r
  } = n;
  defineFunction({
    type: e,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error("Should never be called.");
    },
    htmlBuilder: t,
    mathmlBuilder: r
  });
}
var normalizeArgument = function(e) {
  return e.type === "ordgroup" && e.body.length === 1 ? e.body[0] : e;
}, ordargument = function(e) {
  return e.type === "ordgroup" ? e.body : [e];
}, makeSpan$1 = buildCommon.makeSpan, binLeftCanceller = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], binRightCanceller = ["rightmost", "mrel", "mclose", "mpunct"], styleMap$1 = {
  display: Style$1.DISPLAY,
  text: Style$1.TEXT,
  script: Style$1.SCRIPT,
  scriptscript: Style$1.SCRIPTSCRIPT
}, DomEnum = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
}, buildExpression$1 = function(e, t, r, a) {
  a === void 0 && (a = [null, null]);
  for (var l = [], h = 0; h < e.length; h++) {
    var c = buildGroup$1(e[h], t);
    if (c instanceof DocumentFragment) {
      var d = c.children;
      l.push(...d);
    } else
      l.push(c);
  }
  if (buildCommon.tryCombineChars(l), !r)
    return l;
  var _ = t;
  if (e.length === 1) {
    var m = e[0];
    m.type === "sizing" ? _ = t.havingSize(m.size) : m.type === "styling" && (_ = t.havingStyle(styleMap$1[m.style]));
  }
  var y = makeSpan$1([a[0] || "leftmost"], [], t), x = makeSpan$1([a[1] || "rightmost"], [], t), b = r === "root";
  return traverseNonSpaceNodes(l, (A, f) => {
    var s = f.classes[0], u = A.classes[0];
    s === "mbin" && utils.contains(binRightCanceller, u) ? f.classes[0] = "mord" : u === "mbin" && utils.contains(binLeftCanceller, s) && (A.classes[0] = "mord");
  }, {
    node: y
  }, x, b), traverseNonSpaceNodes(l, (A, f) => {
    var s = getTypeOfDomTree(f), u = getTypeOfDomTree(A), p = s && u ? A.hasClass("mtight") ? tightSpacings[s][u] : spacings[s][u] : null;
    if (p)
      return buildCommon.makeGlue(p, _);
  }, {
    node: y
  }, x, b), l;
}, traverseNonSpaceNodes = function n(e, t, r, a, l) {
  a && e.push(a);
  for (var h = 0; h < e.length; h++) {
    var c = e[h], d = checkPartialGroup(c);
    if (d) {
      n(d.children, t, r, null, l);
      continue;
    }
    var _ = !c.hasClass("mspace");
    if (_) {
      var m = t(c, r.node);
      m && (r.insertAfter ? r.insertAfter(m) : (e.unshift(m), h++));
    }
    _ ? r.node = c : l && c.hasClass("newline") && (r.node = makeSpan$1(["leftmost"])), r.insertAfter = /* @__PURE__ */ ((y) => (x) => {
      e.splice(y + 1, 0, x), h++;
    })(h);
  }
  a && e.pop();
}, checkPartialGroup = function(e) {
  return e instanceof DocumentFragment || e instanceof Anchor || e instanceof Span && e.hasClass("enclosing") ? e : null;
}, getOutermostNode = function n(e, t) {
  var r = checkPartialGroup(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;
}, getTypeOfDomTree = function(e, t) {
  return e ? (t && (e = getOutermostNode(e, t)), DomEnum[e.classes[0]] || null) : null;
}, makeNullDelimiter = function(e, t) {
  var r = ["nulldelimiter"].concat(e.baseSizingClasses());
  return makeSpan$1(t.concat(r));
}, buildGroup$1 = function(e, t, r) {
  if (!e)
    return makeSpan$1();
  if (_htmlGroupBuilders[e.type]) {
    var a = _htmlGroupBuilders[e.type](e, t);
    if (r && t.size !== r.size) {
      a = makeSpan$1(t.sizingClasses(r), [a], t);
      var l = t.sizeMultiplier / r.sizeMultiplier;
      a.height *= l, a.depth *= l;
    }
    return a;
  } else
    throw new ParseError("Got group of unknown type: '" + e.type + "'");
};
function newDocumentFragment(n) {
  return new DocumentFragment(n);
}
class MathNode {
  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 = createClass(this.classes));
    for (var r = 0; r < this.children.length; r++)
      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 += utils.escape(this.attributes[t]), e += '"');
    this.classes.length > 0 && (e += ' class ="' + utils.escape(createClass(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 TextNode {
  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 utils.escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
class SpaceNode {
  /**
   * 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", makeEm(this.width)), e;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    return this.character ? "<mtext>" + this.character + "</mtext>" : '<mspace width="' + makeEm(this.width) + '"/>';
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    return this.character ? this.character : " ";
  }
}
var mathMLTree = {
  MathNode,
  TextNode,
  SpaceNode,
  newDocumentFragment
}, makeText = function(e, t, r) {
  return symbols[t][e] && symbols[t][e].replace && e.charCodeAt(0) !== 55349 && !(ligatures.hasOwnProperty(e) && r && (r.fontFamily && r.fontFamily.slice(4, 6) === "tt" || r.font && r.font.slice(4, 6) === "tt")) && (e = symbols[t][e].replace), new mathMLTree.TextNode(e);
}, makeRow = function(e) {
  return e.length === 1 ? e[0] : new mathMLTree.MathNode("mrow", e);
}, getVariant = 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 === "mathfrak")
    return "fraktur";
  if (r === "mathscr" || r === "mathcal")
    return "script";
  if (r === "mathsf")
    return "sans-serif";
  if (r === "mathtt")
    return "monospace";
  var l = e.text;
  if (utils.contains(["\\imath", "\\jmath"], l))
    return null;
  symbols[a][l] && symbols[a][l].replace && (l = symbols[a][l].replace);
  var h = buildCommon.fontMap[r].fontName;
  return getCharacterMetrics(l, h, a) ? buildCommon.fontMap[r].variant : null;
}, buildExpression = function(e, t, r) {
  if (e.length === 1) {
    var a = buildGroup(e[0], t);
    return r && a instanceof MathNode && a.type === "mo" && (a.setAttribute("lspace", "0em"), a.setAttribute("rspace", "0em")), [a];
  }
  for (var l = [], h, c = 0; c < e.length; c++) {
    var d = buildGroup(e[c], t);
    if (d instanceof MathNode && h instanceof MathNode) {
      if (d.type === "mtext" && h.type === "mtext" && d.getAttribute("mathvariant") === h.getAttribute("mathvariant")) {
        h.children.push(...d.children);
        continue;
      } else if (d.type === "mn" && h.type === "mn") {
        h.children.push(...d.children);
        continue;
      } else if (d.type === "mi" && d.children.length === 1 && h.type === "mn") {
        var _ = d.children[0];
        if (_ instanceof TextNode && _.text === ".") {
          h.children.push(...d.children);
          continue;
        }
      } else if (h.type === "mi" && h.children.length === 1) {
        var m = h.children[0];
        if (m instanceof TextNode && m.text === "̸" && (d.type === "mo" || d.type === "mi" || d.type === "mn")) {
          var y = d.children[0];
          y instanceof TextNode && y.text.length > 0 && (y.text = y.text.slice(0, 1) + "̸" + y.text.slice(1), l.pop());
        }
      }
    }
    l.push(d), h = d;
  }
  return l;
}, buildExpressionRow = function(e, t, r) {
  return makeRow(buildExpression(e, t, r));
}, buildGroup = function(e, t) {
  if (!e)
    return new mathMLTree.MathNode("mrow");
  if (_mathmlGroupBuilders[e.type]) {
    var r = _mathmlGroupBuilders[e.type](e, t);
    return r;
  } else
    throw new ParseError("Got group of unknown type: '" + e.type + "'");
}, stretchyCodePoint = {
  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": "="
}, mathMLnode = function(e) {
  var t = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[e.replace(/^\\/, "")])]);
  return t.setAttribute("stretchy", "true"), t;
}, katexImagesData = {
  //   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]
}, groupLength = function(e) {
  return e.type === "ordgroup" ? e.body.length : 1;
}, svgSpan = function(e, t) {
  function r() {
    var c = 4e5, d = e.label.slice(1);
    if (utils.contains(["widehat", "widecheck", "widetilde", "utilde"], d)) {
      var _ = e, m = groupLength(_.base), y, x, b;
      if (m > 5)
        d === "widehat" || d === "widecheck" ? (y = 420, c = 2364, b = 0.42, x = d + "4") : (y = 312, c = 2340, b = 0.34, x = "tilde4");
      else {
        var A = [1, 1, 2, 2, 3, 3][m];
        d === "widehat" || d === "widecheck" ? (c = [0, 1062, 2364, 2364, 2364][A], y = [0, 239, 300, 360, 420][A], b = [0, 0.24, 0.3, 0.3, 0.36, 0.42][A], x = d + A) : (c = [0, 600, 1033, 2339, 2340][A], y = [0, 260, 286, 306, 312][A], b = [0, 0.26, 0.286, 0.3, 0.306, 0.34][A], x = "tilde" + A);
      }
      var f = new PathNode(x), s = new SvgNode([f], {
        width: "100%",
        height: makeEm(b),
        viewBox: "0 0 " + c + " " + y,
        preserveAspectRatio: "none"
      });
      return {
        span: buildCommon.makeSvgSpan([], [s], t),
        minWidth: 0,
        height: b
      };
    } else {
      var u = [], p = katexImagesData[d], [g, w, o] = p, v = o / 1e3, M = g.length, E, $;
      if (M === 1) {
        var k = p[3];
        E = ["hide-tail"], $ = [k];
      } else if (M === 2)
        E = ["halfarrow-left", "halfarrow-right"], $ = ["xMinYMin", "xMaxYMin"];
      else if (M === 3)
        E = ["brace-left", "brace-center", "brace-right"], $ = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      else
        throw new Error(`Correct katexImagesData or update code here to support
                    ` + M + " children.");
      for (var L = 0; L < M; L++) {
        var z = new PathNode(g[L]), O = new SvgNode([z], {
          width: "400em",
          height: makeEm(v),
          viewBox: "0 0 " + c + " " + o,
          preserveAspectRatio: $[L] + " slice"
        }), R = buildCommon.makeSvgSpan([E[L]], [O], t);
        if (M === 1)
          return {
            span: R,
            minWidth: w,
            height: v
          };
        R.style.height = makeEm(v), u.push(R);
      }
      return {
        span: buildCommon.makeSpan(["stretchy"], u, t),
        minWidth: w,
        height: v
      };
    }
  }
  var {
    span: a,
    minWidth: l,
    height: h
  } = r();
  return a.height = h, a.style.height = makeEm(h), l > 0 && (a.style.minWidth = makeEm(l)), a;
}, encloseSpan = function(e, t, r, a, l) {
  var h, c = e.height + e.depth + r + a;
  if (/fbox|color|angl/.test(t)) {
    if (h = buildCommon.makeSpan(["stretchy", t], [], l), t === "fbox") {
      var d = l.color && l.getColor();
      d && (h.style.borderColor = d);
    }
  } else {
    var _ = [];
    /^[bx]cancel$/.test(t) && _.push(new LineNode({
      x1: "0",
      y1: "0",
      x2: "100%",
      y2: "100%",
      "stroke-width": "0.046em"
    })), /^x?cancel$/.test(t) && _.push(new LineNode({
      x1: "0",
      y1: "100%",
      x2: "100%",
      y2: "0",
      "stroke-width": "0.046em"
    }));
    var m = new SvgNode(_, {
      width: "100%",
      height: makeEm(c)
    });
    h = buildCommon.makeSvgSpan([], [m], l);
  }
  return h.height = c, h.style.height = makeEm(c), h;
}, stretchy = {
  encloseSpan,
  mathMLnode,
  svgSpan
};
function assertNodeType(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 assertSymbolNodeType(n) {
  var e = checkSymbolNodeType(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 checkSymbolNodeType(n) {
  return n && (n.type === "atom" || NON_ATOMS.hasOwnProperty(n.type)) ? n : null;
}
var htmlBuilder$a = (n, e) => {
  var t, r, a;
  n && n.type === "supsub" ? (r = assertNodeType(n.base, "accent"), t = r.base, n.base = t, a = assertSpan(buildGroup$1(n, e)), n.base = r) : (r = assertNodeType(n, "accent"), t = r.base);
  var l = buildGroup$1(t, e.havingCrampedStyle()), h = r.isShifty && utils.isCharacterBox(t), c = 0;
  if (h) {
    var d = utils.getBaseElem(t), _ = buildGroup$1(d, e.havingCrampedStyle());
    c = assertSymbolDomNode(_).skew;
  }
  var m = r.label === "\\c", y = m ? l.height + l.depth : Math.min(l.height, e.fontMetrics().xHeight), x;
  if (r.isStretchy)
    x = stretchy.svgSpan(r, e), x = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: l
      }, {
        type: "elem",
        elem: x,
        wrapperClasses: ["svg-align"],
        wrapperStyle: c > 0 ? {
          width: "calc(100% - " + makeEm(2 * c) + ")",
          marginLeft: makeEm(2 * c)
        } : void 0
      }]
    }, e);
  else {
    var b, A;
    r.label === "\\vec" ? (b = buildCommon.staticSvg("vec", e), A = buildCommon.svgData.vec[1]) : (b = buildCommon.makeOrd({
      mode: r.mode,
      text: r.label
    }, e, "textord"), b = assertSymbolDomNode(b), b.italic = 0, A = b.width, m && (y += b.depth)), x = buildCommon.makeSpan(["accent-body"], [b]);
    var f = r.label === "\\textcircled";
    f && (x.classes.push("accent-full"), y = l.height);
    var s = c;
    f || (s -= A / 2), x.style.left = makeEm(s), r.label === "\\textcircled" && (x.style.top = ".2em"), x = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: -y
      }, {
        type: "elem",
        elem: x
      }]
    }, e);
  }
  var u = buildCommon.makeSpan(["mord", "accent"], [x], e);
  return a ? (a.children[0] = u, a.height = Math.max(u.height, a.height), a.classes[0] = "mord", a) : u;
}, mathmlBuilder$9 = (n, e) => {
  var t = n.isStretchy ? stretchy.mathMLnode(n.label) : new mathMLTree.MathNode("mo", [makeText(n.label, n.mode)]), r = new mathMLTree.MathNode("mover", [buildGroup(n.base, e), t]);
  return r.setAttribute("accent", "true"), r;
}, NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((n) => "\\" + n).join("|"));
defineFunction({
  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 = normalizeArgument(e[0]), r = !NON_STRETCHY_ACCENT_REGEX.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: htmlBuilder$a,
  mathmlBuilder: mathmlBuilder$9
});
defineFunction({
  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: htmlBuilder$a,
  mathmlBuilder: mathmlBuilder$9
});
defineFunction({
  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 = buildGroup$1(n.base, e), r = stretchy.svgSpan(n, e), a = n.label === "\\utilde" ? 0.12 : 0, l = buildCommon.makeVList({
      positionType: "top",
      positionData: t.height,
      children: [{
        type: "elem",
        elem: r,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: a
      }, {
        type: "elem",
        elem: t
      }]
    }, e);
    return buildCommon.makeSpan(["mord", "accentunder"], [l], e);
  },
  mathmlBuilder: (n, e) => {
    var t = stretchy.mathMLnode(n.label), r = new mathMLTree.MathNode("munder", [buildGroup(n.base, e), t]);
    return r.setAttribute("accentunder", "true"), r;
  }
});
var paddedNode = (n) => {
  var e = new mathMLTree.MathNode("mpadded", n ? [n] : []);
  return e.setAttribute("width", "+0.6em"), e.setAttribute("lspace", "0.3em"), e;
};
defineFunction({
  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 = buildCommon.wrapFragment(buildGroup$1(n.body, r, e), e), l = n.label.slice(0, 2) === "\\x" ? "x" : "cd";
    a.classes.push(l + "-arrow-pad");
    var h;
    n.below && (r = e.havingStyle(t.sub()), h = buildCommon.wrapFragment(buildGroup$1(n.below, r, e), e), h.classes.push(l + "-arrow-pad"));
    var c = stretchy.svgSpan(n, e), d = -e.fontMetrics().axisHeight + 0.5 * c.height, _ = -e.fontMetrics().axisHeight - 0.5 * c.height - 0.111;
    (a.depth > 0.25 || n.label === "\\xleftequilibrium") && (_ -= a.depth);
    var m;
    if (h) {
      var y = -e.fontMetrics().axisHeight + h.height + 0.5 * c.height + 0.111;
      m = buildCommon.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: _
        }, {
          type: "elem",
          elem: c,
          shift: d
        }, {
          type: "elem",
          elem: h,
          shift: y
        }]
      }, e);
    } else
      m = buildCommon.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: a,
          shift: _
        }, {
          type: "elem",
          elem: c,
          shift: d
        }]
      }, e);
    return m.children[0].children[0].children[1].classes.push("svg-align"), buildCommon.makeSpan(["mrel", "x-arrow"], [m], e);
  },
  mathmlBuilder(n, e) {
    var t = stretchy.mathMLnode(n.label);
    t.setAttribute("minsize", n.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var r;
    if (n.body) {
      var a = paddedNode(buildGroup(n.body, e));
      if (n.below) {
        var l = paddedNode(buildGroup(n.below, e));
        r = new mathMLTree.MathNode("munderover", [t, l, a]);
      } else
        r = new mathMLTree.MathNode("mover", [t, a]);
    } else if (n.below) {
      var h = paddedNode(buildGroup(n.below, e));
      r = new mathMLTree.MathNode("munder", [t, h]);
    } else
      r = paddedNode(), r = new mathMLTree.MathNode("mover", [t, r]);
    return r;
  }
});
var makeSpan = buildCommon.makeSpan;
function htmlBuilder$9(n, e) {
  var t = buildExpression$1(n.body, e, !0);
  return makeSpan([n.mclass], t, e);
}
function mathmlBuilder$8(n, e) {
  var t, r = buildExpression(n.body, e);
  return n.mclass === "minner" ? t = new mathMLTree.MathNode("mpadded", r) : n.mclass === "mord" ? n.isCharacterBox ? (t = r[0], t.type = "mi") : t = new mathMLTree.MathNode("mi", r) : (n.isCharacterBox ? (t = r[0], t.type = "mo") : t = new mathMLTree.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;
}
defineFunction({
  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: ordargument(a),
      isCharacterBox: utils.isCharacterBox(a)
    };
  },
  htmlBuilder: htmlBuilder$9,
  mathmlBuilder: mathmlBuilder$8
});
var binrelClass = (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";
};
defineFunction({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "mclass",
      mode: t.mode,
      mclass: binrelClass(e[0]),
      body: ordargument(e[1]),
      isCharacterBox: utils.isCharacterBox(e[1])
    };
  }
});
defineFunction({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(n, e) {
    var {
      parser: t,
      funcName: r
    } = n, a = e[1], l = e[0], h;
    r !== "\\stackrel" ? h = binrelClass(a) : h = "mrel";
    var c = {
      type: "op",
      mode: a.mode,
      limits: !0,
      alwaysHandleSupSub: !0,
      parentIsSupSub: !1,
      symbol: !1,
      suppressBaseShift: r !== "\\stackrel",
      body: ordargument(a)
    }, d = {
      type: "supsub",
      mode: l.mode,
      base: c,
      sup: r === "\\underset" ? null : l,
      sub: r === "\\underset" ? l : null
    };
    return {
      type: "mclass",
      mode: t.mode,
      mclass: h,
      body: [d],
      isCharacterBox: utils.isCharacterBox(d)
    };
  },
  htmlBuilder: htmlBuilder$9,
  mathmlBuilder: mathmlBuilder$8
});
defineFunction({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t
    } = n;
    return {
      type: "pmb",
      mode: t.mode,
      mclass: binrelClass(e[0]),
      body: ordargument(e[0])
    };
  },
  htmlBuilder(n, e) {
    var t = buildExpression$1(n.body, e, !0), r = buildCommon.makeSpan([n.mclass], t, e);
    return r.style.textShadow = "0.02em 0.01em 0.04px", r;
  },
  mathmlBuilder(n, e) {
    var t = buildExpression(n.body, e), r = new mathMLTree.MathNode("mstyle", t);
    return r.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), r;
  }
});
var cdArrowFunctionName = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  A: "\\uparrow",
  V: "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
}, newCell = () => ({
  type: "styling",
  body: [],
  mode: "math",
  style: "display"
}), isStartOfArrow = (n) => n.type === "textord" && n.text === "@", isLabelEnd = (n, e) => (n.type === "mathord" || n.type === "atom") && n.text === e;
function cdArrow(n, e, t) {
  var r = cdArrowFunctionName[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]], []), l = {
        type: "atom",
        text: r,
        mode: "math",
        family: "rel"
      }, h = t.callFunction("\\Big", [l], []), c = t.callFunction("\\\\cdright", [e[1]], []), d = {
        type: "ordgroup",
        mode: "math",
        body: [a, h, c]
      };
      return t.callFunction("\\\\cdparent", [d], []);
    }
    case "\\\\cdlongequal":
      return t.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert": {
      var _ = {
        type: "textord",
        text: "\\Vert",
        mode: "math"
      };
      return t.callFunction("\\Big", [_], []);
    }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function parseCD(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 ParseError("Expected \\\\ or \\cr or \\end", n.nextToken);
  }
  for (var r = [], a = [r], l = 0; l < e.length; l++) {
    for (var h = e[l], c = newCell(), d = 0; d < h.length; d++)
      if (!isStartOfArrow(h[d]))
        c.body.push(h[d]);
      else {
        r.push(c), d += 1;
        var _ = assertSymbolNodeType(h[d]).text, m = new Array(2);
        if (m[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, m[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, !("=|.".indexOf(_) > -1)) if ("<>AV".indexOf(_) > -1)
          for (var y = 0; y < 2; y++) {
            for (var x = !0, b = d + 1; b < h.length; b++) {
              if (isLabelEnd(h[b], _)) {
                x = !1, d = b;
                break;
              }
              if (isStartOfArrow(h[b]))
                throw new ParseError("Missing a " + _ + " character to complete a CD arrow.", h[b]);
              m[y].body.push(h[b]);
            }
            if (x)
              throw new ParseError("Missing a " + _ + " character to complete a CD arrow.", h[d]);
          }
        else
          throw new ParseError('Expected one of "<>AV=|." after @', h[d]);
        var A = cdArrow(_, m, n), f = {
          type: "styling",
          body: [A],
          mode: "math",
          style: "display"
          // CD is always displaystyle.
        };
        r.push(f), c = newCell();
      }
    l % 2 === 0 ? r.push(c) : r.shift(), r = [], a.push(r);
  }
  n.gullet.endGroup(), n.gullet.endGroup();
  var s = 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: s,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(a.length + 1).fill([])
  };
}
defineFunction({
  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 = buildCommon.wrapFragment(buildGroup$1(n.label, t, e), e);
    return r.classes.push("cd-label-" + n.side), r.style.bottom = makeEm(0.8 - r.depth), r.height = 0, r.depth = 0, r;
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mrow", [buildGroup(n.label, e)]);
    return t = new mathMLTree.MathNode("mpadded", [t]), t.setAttribute("width", "0"), n.side === "left" && t.setAttribute("lspace", "-1width"), t.setAttribute("voffset", "0.7em"), t = new mathMLTree.MathNode("mstyle", [t]), t.setAttribute("displaystyle", "false"), t.setAttribute("scriptlevel", "1"), t;
  }
});
defineFunction({
  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 = buildCommon.wrapFragment(buildGroup$1(n.fragment, e), e);
    return t.classes.push("cd-vert-arrow"), t;
  },
  mathmlBuilder(n, e) {
    return new mathMLTree.MathNode("mrow", [buildGroup(n.fragment, e)]);
  }
});
defineFunction({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(n, e) {
    for (var {
      parser: t
    } = n, r = assertNodeType(e[0], "ordgroup"), a = r.body, l = "", h = 0; h < a.length; h++) {
      var c = assertNodeType(a[h], "textord");
      l += c.text;
    }
    var d = parseInt(l), _;
    if (isNaN(d))
      throw new ParseError("\\@char has non-numeric argument " + l);
    if (d < 0 || d >= 1114111)
      throw new ParseError("\\@char with invalid code point " + l);
    return d <= 65535 ? _ = String.fromCharCode(d) : (d -= 65536, _ = String.fromCharCode((d >> 10) + 55296, (d & 1023) + 56320)), {
      type: "textord",
      mode: t.mode,
      text: _
    };
  }
});
var htmlBuilder$8 = (n, e) => {
  var t = buildExpression$1(n.body, e.withColor(n.color), !1);
  return buildCommon.makeFragment(t);
}, mathmlBuilder$7 = (n, e) => {
  var t = buildExpression(n.body, e.withColor(n.color)), r = new mathMLTree.MathNode("mstyle", t);
  return r.setAttribute("mathcolor", n.color), r;
};
defineFunction({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "original"]
  },
  handler(n, e) {
    var {
      parser: t
    } = n, r = assertNodeType(e[0], "color-token").color, a = e[1];
    return {
      type: "color",
      mode: t.mode,
      color: r,
      body: ordargument(a)
    };
  },
  htmlBuilder: htmlBuilder$8,
  mathmlBuilder: mathmlBuilder$7
});
defineFunction({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    argTypes: ["color"]
  },
  handler(n, e) {
    var {
      parser: t,
      breakOnTokenText: r
    } = n, a = assertNodeType(e[0], "color-token").color;
    t.gullet.macros.set("\\current@color", a);
    var l = t.parseExpression(!0, r);
    return {
      type: "color",
      mode: t.mode,
      color: a,
      body: l
    };
  },
  htmlBuilder: htmlBuilder$8,
  mathmlBuilder: mathmlBuilder$7
});
defineFunction({
  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, l = !r.settings.displayMode || !r.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
    return {
      type: "cr",
      mode: r.mode,
      newLine: l,
      size: a && assertNodeType(a, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(n, e) {
    var t = buildCommon.makeSpan(["mspace"], [], e);
    return n.newLine && (t.classes.push("newline"), n.size && (t.style.marginTop = makeEm(calculateSize(n.size, e)))), t;
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mspace");
    return n.newLine && (t.setAttribute("linebreak", "newline"), n.size && t.setAttribute("height", makeEm(calculateSize(n.size, e)))), t;
  }
});
var globalMap = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
}, checkControlSequence = (n) => {
  var e = n.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(e))
    throw new ParseError("Expected a control sequence", n);
  return e;
}, getRHS = (n) => {
  var e = n.gullet.popToken();
  return e.text === "=" && (e = n.gullet.popToken(), e.text === " " && (e = n.gullet.popToken())), e;
}, letCommand = (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);
};
defineFunction({
  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 (globalMap[r.text])
      return (t === "\\global" || t === "\\\\globallong") && (r.text = globalMap[r.text]), assertNodeType(e.parseFunction(), "internal");
    throw new ParseError("Invalid token after macro prefix", r);
  }
});
defineFunction({
  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 ParseError("Expected a control sequence", r);
    for (var l = 0, h, c = [[]]; e.gullet.future().text !== "{"; )
      if (r = e.gullet.popToken(), r.text === "#") {
        if (e.gullet.future().text === "{") {
          h = e.gullet.future(), c[l].push("{");
          break;
        }
        if (r = e.gullet.popToken(), !/^[1-9]$/.test(r.text))
          throw new ParseError('Invalid argument number "' + r.text + '"');
        if (parseInt(r.text) !== l + 1)
          throw new ParseError('Argument number "' + r.text + '" out of order');
        l++, c.push([]);
      } else {
        if (r.text === "EOF")
          throw new ParseError("Expected a macro definition");
        c[l].push(r.text);
      }
    var {
      tokens: d
    } = e.gullet.consumeArg();
    return h && d.unshift(h), (t === "\\edef" || t === "\\xdef") && (d = e.gullet.expandTokens(d), d.reverse()), e.gullet.macros.set(a, {
      tokens: d,
      numArgs: l,
      delimiters: c
    }, t === globalMap[t]), {
      type: "internal",
      mode: e.mode
    };
  }
});
defineFunction({
  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 = checkControlSequence(e.gullet.popToken());
    e.gullet.consumeSpaces();
    var a = getRHS(e);
    return letCommand(e, r, a, t === "\\\\globallet"), {
      type: "internal",
      mode: e.mode
    };
  }
});
defineFunction({
  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 = checkControlSequence(e.gullet.popToken()), a = e.gullet.popToken(), l = e.gullet.popToken();
    return letCommand(e, r, l, t === "\\\\globalfuture"), e.gullet.pushToken(l), e.gullet.pushToken(a), {
      type: "internal",
      mode: e.mode
    };
  }
});
var getMetrics = function(e, t, r) {
  var a = symbols.math[e] && symbols.math[e].replace, l = getCharacterMetrics(a || e, t, r);
  if (!l)
    throw new Error("Unsupported symbol " + e + " and font size " + t + ".");
  return l;
}, styleWrap = function(e, t, r, a) {
  var l = r.havingBaseStyle(t), h = buildCommon.makeSpan(a.concat(l.sizingClasses(r)), [e], r), c = l.sizeMultiplier / r.sizeMultiplier;
  return h.height *= c, h.depth *= c, h.maxFontSize = l.sizeMultiplier, h;
}, centerSpan = function(e, t, r) {
  var a = t.havingBaseStyle(r), l = (1 - t.sizeMultiplier / a.sizeMultiplier) * t.fontMetrics().axisHeight;
  e.classes.push("delimcenter"), e.style.top = makeEm(l), e.height -= l, e.depth += l;
}, makeSmallDelim = function(e, t, r, a, l, h) {
  var c = buildCommon.makeSymbol(e, "Main-Regular", l, a), d = styleWrap(c, t, a, h);
  return r && centerSpan(d, a, t), d;
}, mathrmSize = function(e, t, r, a) {
  return buildCommon.makeSymbol(e, "Size" + t + "-Regular", r, a);
}, makeLargeDelim = function(e, t, r, a, l, h) {
  var c = mathrmSize(e, t, l, a), d = styleWrap(buildCommon.makeSpan(["delimsizing", "size" + t], [c], a), Style$1.TEXT, a, h);
  return r && centerSpan(d, a, Style$1.TEXT), d;
}, makeGlyphSpan = function(e, t, r) {
  var a;
  t === "Size1-Regular" ? a = "delim-size1" : a = "delim-size4";
  var l = buildCommon.makeSpan(["delimsizinginner", a], [buildCommon.makeSpan([], [buildCommon.makeSymbol(e, t, r)])]);
  return {
    type: "elem",
    elem: l
  };
}, makeInner = function(e, t, r) {
  var a = fontMetricsData["Size4-Regular"][e.charCodeAt(0)] ? fontMetricsData["Size4-Regular"][e.charCodeAt(0)][4] : fontMetricsData["Size1-Regular"][e.charCodeAt(0)][4], l = new PathNode("inner", innerPath(e, Math.round(1e3 * t))), h = new SvgNode([l], {
    width: makeEm(a),
    height: makeEm(t),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + makeEm(a),
    viewBox: "0 0 " + 1e3 * a + " " + Math.round(1e3 * t),
    preserveAspectRatio: "xMinYMin"
  }), c = buildCommon.makeSvgSpan([], [h], r);
  return c.height = t, c.style.height = makeEm(t), c.style.width = makeEm(a), {
    type: "elem",
    elem: c
  };
}, lapInEms = 8e-3, lap = {
  type: "kern",
  size: -1 * lapInEms
}, verts = ["|", "\\lvert", "\\rvert", "\\vert"], doubleVerts = ["\\|", "\\lVert", "\\rVert", "\\Vert"], makeStackedDelim = function(e, t, r, a, l, h) {
  var c, d, _, m, y = "", x = 0;
  c = _ = m = e, d = null;
  var b = "Size1-Regular";
  e === "\\uparrow" ? _ = m = "⏐" : e === "\\Uparrow" ? _ = m = "‖" : e === "\\downarrow" ? c = _ = "⏐" : e === "\\Downarrow" ? c = _ = "‖" : e === "\\updownarrow" ? (c = "\\uparrow", _ = "⏐", m = "\\downarrow") : e === "\\Updownarrow" ? (c = "\\Uparrow", _ = "‖", m = "\\Downarrow") : utils.contains(verts, e) ? (_ = "∣", y = "vert", x = 333) : utils.contains(doubleVerts, e) ? (_ = "∥", y = "doublevert", x = 556) : e === "[" || e === "\\lbrack" ? (c = "⎡", _ = "⎢", m = "⎣", b = "Size4-Regular", y = "lbrack", x = 667) : e === "]" || e === "\\rbrack" ? (c = "⎤", _ = "⎥", m = "⎦", b = "Size4-Regular", y = "rbrack", x = 667) : e === "\\lfloor" || e === "⌊" ? (_ = c = "⎢", m = "⎣", b = "Size4-Regular", y = "lfloor", x = 667) : e === "\\lceil" || e === "⌈" ? (c = "⎡", _ = m = "⎢", b = "Size4-Regular", y = "lceil", x = 667) : e === "\\rfloor" || e === "⌋" ? (_ = c = "⎥", m = "⎦", b = "Size4-Regular", y = "rfloor", x = 667) : e === "\\rceil" || e === "⌉" ? (c = "⎤", _ = m = "⎥", b = "Size4-Regular", y = "rceil", x = 667) : e === "(" || e === "\\lparen" ? (c = "⎛", _ = "⎜", m = "⎝", b = "Size4-Regular", y = "lparen", x = 875) : e === ")" || e === "\\rparen" ? (c = "⎞", _ = "⎟", m = "⎠", b = "Size4-Regular", y = "rparen", x = 875) : e === "\\{" || e === "\\lbrace" ? (c = "⎧", d = "⎨", m = "⎩", _ = "⎪", b = "Size4-Regular") : e === "\\}" || e === "\\rbrace" ? (c = "⎫", d = "⎬", m = "⎭", _ = "⎪", b = "Size4-Regular") : e === "\\lgroup" || e === "⟮" ? (c = "⎧", m = "⎩", _ = "⎪", b = "Size4-Regular") : e === "\\rgroup" || e === "⟯" ? (c = "⎫", m = "⎭", _ = "⎪", b = "Size4-Regular") : e === "\\lmoustache" || e === "⎰" ? (c = "⎧", m = "⎭", _ = "⎪", b = "Size4-Regular") : (e === "\\rmoustache" || e === "⎱") && (c = "⎫", m = "⎩", _ = "⎪", b = "Size4-Regular");
  var A = getMetrics(c, b, l), f = A.height + A.depth, s = getMetrics(_, b, l), u = s.height + s.depth, p = getMetrics(m, b, l), g = p.height + p.depth, w = 0, o = 1;
  if (d !== null) {
    var v = getMetrics(d, b, l);
    w = v.height + v.depth, o = 2;
  }
  var M = f + g + w, E = Math.max(0, Math.ceil((t - M) / (o * u))), $ = M + E * o * u, k = a.fontMetrics().axisHeight;
  r && (k *= a.sizeMultiplier);
  var L = $ / 2 - k, z = [];
  if (y.length > 0) {
    var O = $ - f - g, R = Math.round($ * 1e3), N = tallDelim(y, Math.round(O * 1e3)), W = new PathNode(y, N), B = (x / 1e3).toFixed(3) + "em", P = (R / 1e3).toFixed(3) + "em", G = new SvgNode([W], {
      width: B,
      height: P,
      viewBox: "0 0 " + x + " " + R
    }), H = buildCommon.makeSvgSpan([], [G], a);
    H.height = R / 1e3, H.style.width = B, H.style.height = P, z.push({
      type: "elem",
      elem: H
    });
  } else {
    if (z.push(makeGlyphSpan(m, b, l)), z.push(lap), d === null) {
      var U = $ - f - g + 2 * lapInEms;
      z.push(makeInner(_, U, a));
    } else {
      var j = ($ - f - g - w) / 2 + 2 * lapInEms;
      z.push(makeInner(_, j, a)), z.push(lap), z.push(makeGlyphSpan(d, b, l)), z.push(lap), z.push(makeInner(_, j, a));
    }
    z.push(lap), z.push(makeGlyphSpan(c, b, l));
  }
  var re = a.havingBaseStyle(Style$1.TEXT), ie = buildCommon.makeVList({
    positionType: "bottom",
    positionData: L,
    children: z
  }, re);
  return styleWrap(buildCommon.makeSpan(["delimsizing", "mult"], [ie], re), Style$1.TEXT, a, h);
}, vbPad = 80, emPad = 0.08, sqrtSvg = function(e, t, r, a, l) {
  var h = sqrtPath(e, a, r), c = new PathNode(e, h), d = new SvgNode([c], {
    // Note: 1000:1 ratio of viewBox to document em width.
    width: "400em",
    height: makeEm(t),
    viewBox: "0 0 400000 " + r,
    preserveAspectRatio: "xMinYMin slice"
  });
  return buildCommon.makeSvgSpan(["hide-tail"], [d], l);
}, makeSqrtImage = function(e, t) {
  var r = t.havingBaseSizing(), a = traverseSequence("\\surd", e * r.sizeMultiplier, stackLargeDelimiterSequence, r), l = r.sizeMultiplier, h = Math.max(0, t.minRuleThickness - t.fontMetrics().sqrtRuleThickness), c, d = 0, _ = 0, m = 0, y;
  return a.type === "small" ? (m = 1e3 + 1e3 * h + vbPad, e < 1 ? l = 1 : e < 1.4 && (l = 0.7), d = (1 + h + emPad) / l, _ = (1 + h) / l, c = sqrtSvg("sqrtMain", d, m, h, t), c.style.minWidth = "0.853em", y = 0.833 / l) : a.type === "large" ? (m = (1e3 + vbPad) * sizeToMaxHeight[a.size], _ = (sizeToMaxHeight[a.size] + h) / l, d = (sizeToMaxHeight[a.size] + h + emPad) / l, c = sqrtSvg("sqrtSize" + a.size, d, m, h, t), c.style.minWidth = "1.02em", y = 1 / l) : (d = e + h + emPad, _ = e + h, m = Math.floor(1e3 * e + h) + vbPad, c = sqrtSvg("sqrtTall", d, m, h, t), c.style.minWidth = "0.742em", y = 1.056), c.height = _, c.style.height = makeEm(d), {
    span: c,
    advanceWidth: y,
    // 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 + h) * l
  };
}, stackLargeDelimiters = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3], makeSizedDelim = function(e, t, r, a, l) {
  if (e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle"), utils.contains(stackLargeDelimiters, e) || utils.contains(stackNeverDelimiters, e))
    return makeLargeDelim(e, t, !1, r, a, l);
  if (utils.contains(stackAlwaysDelimiters, e))
    return makeStackedDelim(e, sizeToMaxHeight[t], !1, r, a, l);
  throw new ParseError("Illegal delimiter: '" + e + "'");
}, stackNeverDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}], stackAlwaysDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "stack"
}], stackLargeDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}], delimTypeToFont = 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.");
}, traverseSequence = function(e, t, r, a) {
  for (var l = Math.min(2, 3 - a.style.size), h = l; h < r.length && r[h].type !== "stack"; h++) {
    var c = getMetrics(e, delimTypeToFont(r[h]), "math"), d = c.height + c.depth;
    if (r[h].type === "small") {
      var _ = a.havingBaseStyle(r[h].style);
      d *= _.sizeMultiplier;
    }
    if (d > t)
      return r[h];
  }
  return r[r.length - 1];
}, makeCustomSizedDelim = function(e, t, r, a, l, h) {
  e === "<" || e === "\\lt" || e === "⟨" ? e = "\\langle" : (e === ">" || e === "\\gt" || e === "⟩") && (e = "\\rangle");
  var c;
  utils.contains(stackNeverDelimiters, e) ? c = stackNeverDelimiterSequence : utils.contains(stackLargeDelimiters, e) ? c = stackLargeDelimiterSequence : c = stackAlwaysDelimiterSequence;
  var d = traverseSequence(e, t, c, a);
  return d.type === "small" ? makeSmallDelim(e, d.style, r, a, l, h) : d.type === "large" ? makeLargeDelim(e, d.size, r, a, l, h) : makeStackedDelim(e, t, r, a, l, h);
}, makeLeftRightDelim = function(e, t, r, a, l, h) {
  var c = a.fontMetrics().axisHeight * a.sizeMultiplier, d = 901, _ = 5 / a.fontMetrics().ptPerEm, m = Math.max(t - c, r + c), y = 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)
    m / 500 * d,
    2 * m - _
  );
  return makeCustomSizedDelim(e, y, !0, a, l, h);
}, delimiter = {
  sqrtImage: makeSqrtImage,
  sizedDelim: makeSizedDelim,
  sizeToMaxHeight,
  customSizedDelim: makeCustomSizedDelim,
  leftRightDelim: makeLeftRightDelim
}, delimiterSizes = {
  "\\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
  }
}, delimiters = ["(", "\\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 checkDelimiter(n, e) {
  var t = checkSymbolNodeType(n);
  if (t && utils.contains(delimiters, t.text))
    return t;
  throw t ? new ParseError("Invalid delimiter '" + t.text + "' after '" + e.funcName + "'", n) : new ParseError("Invalid delimiter type '" + n.type + "'", n);
}
defineFunction({
  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 = checkDelimiter(e[0], n);
    return {
      type: "delimsizing",
      mode: n.parser.mode,
      size: delimiterSizes[n.funcName].size,
      mclass: delimiterSizes[n.funcName].mclass,
      delim: t.text
    };
  },
  htmlBuilder: (n, e) => n.delim === "." ? buildCommon.makeSpan([n.mclass]) : delimiter.sizedDelim(n.delim, n.size, e, n.mode, [n.mclass]),
  mathmlBuilder: (n) => {
    var e = [];
    n.delim !== "." && e.push(makeText(n.delim, n.mode));
    var t = new mathMLTree.MathNode("mo", e);
    n.mclass === "mopen" || n.mclass === "mclose" ? t.setAttribute("fence", "true") : t.setAttribute("fence", "false"), t.setAttribute("stretchy", "true");
    var r = makeEm(delimiter.sizeToMaxHeight[n.size]);
    return t.setAttribute("minsize", r), t.setAttribute("maxsize", r), t;
  }
});
function assertParsed(n) {
  if (!n.body)
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
defineFunction({
  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 ParseError("\\current@color set to non-string in \\right");
    return {
      type: "leftright-right",
      mode: n.parser.mode,
      delim: checkDelimiter(e[0], n).text,
      color: t
      // undefined if not set via \color
    };
  }
});
defineFunction({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (n, e) => {
    var t = checkDelimiter(e[0], n), r = n.parser;
    ++r.leftrightDepth;
    var a = r.parseExpression(!1);
    --r.leftrightDepth, r.expect("\\right", !1);
    var l = assertNodeType(r.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: r.mode,
      body: a,
      left: t.text,
      right: l.delim,
      rightColor: l.color
    };
  },
  htmlBuilder: (n, e) => {
    assertParsed(n);
    for (var t = buildExpression$1(n.body, e, !0, ["mopen", "mclose"]), r = 0, a = 0, l = !1, h = 0; h < t.length; h++)
      t[h].isMiddle ? l = !0 : (r = Math.max(t[h].height, r), a = Math.max(t[h].depth, a));
    r *= e.sizeMultiplier, a *= e.sizeMultiplier;
    var c;
    if (n.left === "." ? c = makeNullDelimiter(e, ["mopen"]) : c = delimiter.leftRightDelim(n.left, r, a, e, n.mode, ["mopen"]), t.unshift(c), l)
      for (var d = 1; d < t.length; d++) {
        var _ = t[d], m = _.isMiddle;
        m && (t[d] = delimiter.leftRightDelim(m.delim, r, a, m.options, n.mode, []));
      }
    var y;
    if (n.right === ".")
      y = makeNullDelimiter(e, ["mclose"]);
    else {
      var x = n.rightColor ? e.withColor(n.rightColor) : e;
      y = delimiter.leftRightDelim(n.right, r, a, x, n.mode, ["mclose"]);
    }
    return t.push(y), buildCommon.makeSpan(["minner"], t, e);
  },
  mathmlBuilder: (n, e) => {
    assertParsed(n);
    var t = buildExpression(n.body, e);
    if (n.left !== ".") {
      var r = new mathMLTree.MathNode("mo", [makeText(n.left, n.mode)]);
      r.setAttribute("fence", "true"), t.unshift(r);
    }
    if (n.right !== ".") {
      var a = new mathMLTree.MathNode("mo", [makeText(n.right, n.mode)]);
      a.setAttribute("fence", "true"), n.rightColor && a.setAttribute("mathcolor", n.rightColor), t.push(a);
    }
    return makeRow(t);
  }
});
defineFunction({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (n, e) => {
    var t = checkDelimiter(e[0], n);
    if (!n.parser.leftrightDepth)
      throw new ParseError("\\middle without preceding \\left", t);
    return {
      type: "middle",
      mode: n.parser.mode,
      delim: t.text
    };
  },
  htmlBuilder: (n, e) => {
    var t;
    if (n.delim === ".")
      t = makeNullDelimiter(e, []);
    else {
      t = delimiter.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 === "|" ? makeText("|", "text") : makeText(n.delim, n.mode), r = new mathMLTree.MathNode("mo", [t]);
    return r.setAttribute("fence", "true"), r.setAttribute("lspace", "0.05em"), r.setAttribute("rspace", "0.05em"), r;
  }
});
var htmlBuilder$7 = (n, e) => {
  var t = buildCommon.wrapFragment(buildGroup$1(n.body, e), e), r = n.label.slice(1), a = e.sizeMultiplier, l, h = 0, c = utils.isCharacterBox(n.body);
  if (r === "sout")
    l = buildCommon.makeSpan(["stretchy", "sout"]), l.height = e.fontMetrics().defaultRuleThickness / a, h = -0.5 * e.fontMetrics().xHeight;
  else if (r === "phase") {
    var d = calculateSize({
      number: 0.6,
      unit: "pt"
    }, e), _ = calculateSize({
      number: 0.35,
      unit: "ex"
    }, e), m = e.havingBaseSizing();
    a = a / m.sizeMultiplier;
    var y = t.height + t.depth + d + _;
    t.style.paddingLeft = makeEm(y / 2 + d);
    var x = Math.floor(1e3 * y * a), b = phasePath(x), A = new SvgNode([new PathNode("phase", b)], {
      width: "400em",
      height: makeEm(x / 1e3),
      viewBox: "0 0 400000 " + x,
      preserveAspectRatio: "xMinYMin slice"
    });
    l = buildCommon.makeSvgSpan(["hide-tail"], [A], e), l.style.height = makeEm(y), h = t.depth + d + _;
  } else {
    /cancel/.test(r) ? c || t.classes.push("cancel-pad") : r === "angl" ? t.classes.push("anglpad") : t.classes.push("boxpad");
    var f = 0, s = 0, u = 0;
    /box/.test(r) ? (u = Math.max(
      e.fontMetrics().fboxrule,
      // default
      e.minRuleThickness
      // User override.
    ), f = e.fontMetrics().fboxsep + (r === "colorbox" ? 0 : u), s = f) : r === "angl" ? (u = Math.max(e.fontMetrics().defaultRuleThickness, e.minRuleThickness), f = 4 * u, s = Math.max(0, 0.25 - t.depth)) : (f = c ? 0.2 : 0, s = f), l = stretchy.encloseSpan(t, r, f, s, e), /fbox|boxed|fcolorbox/.test(r) ? (l.style.borderStyle = "solid", l.style.borderWidth = makeEm(u)) : r === "angl" && u !== 0.049 && (l.style.borderTopWidth = makeEm(u), l.style.borderRightWidth = makeEm(u)), h = t.depth + s, n.backgroundColor && (l.style.backgroundColor = n.backgroundColor, n.borderColor && (l.style.borderColor = n.borderColor));
  }
  var p;
  if (n.backgroundColor)
    p = buildCommon.makeVList({
      positionType: "individualShift",
      children: [
        // Put the color background behind inner;
        {
          type: "elem",
          elem: l,
          shift: h
        },
        {
          type: "elem",
          elem: t,
          shift: 0
        }
      ]
    }, e);
  else {
    var g = /cancel|phase/.test(r) ? ["svg-align"] : [];
    p = buildCommon.makeVList({
      positionType: "individualShift",
      children: [
        // Write the \cancel stroke on top of inner.
        {
          type: "elem",
          elem: t,
          shift: 0
        },
        {
          type: "elem",
          elem: l,
          shift: h,
          wrapperClasses: g
        }
      ]
    }, e);
  }
  return /cancel/.test(r) && (p.height = t.height, p.depth = t.depth), /cancel/.test(r) && !c ? buildCommon.makeSpan(["mord", "cancel-lap"], [p], e) : buildCommon.makeSpan(["mord"], [p], e);
}, mathmlBuilder$6 = (n, e) => {
  var t = 0, r = new mathMLTree.MathNode(n.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [buildGroup(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;
};
defineFunction({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "text"]
  },
  handler(n, e, t) {
    var {
      parser: r,
      funcName: a
    } = n, l = assertNodeType(e[0], "color-token").color, h = e[1];
    return {
      type: "enclose",
      mode: r.mode,
      label: a,
      backgroundColor: l,
      body: h
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: !0,
    argTypes: ["color", "color", "text"]
  },
  handler(n, e, t) {
    var {
      parser: r,
      funcName: a
    } = n, l = assertNodeType(e[0], "color-token").color, h = assertNodeType(e[1], "color-token").color, c = e[2];
    return {
      type: "enclose",
      mode: r.mode,
      label: a,
      backgroundColor: h,
      borderColor: l,
      body: c
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  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]
    };
  }
});
defineFunction({
  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: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  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 _environments = {};
function defineEnvironment(n) {
  for (var {
    type: e,
    names: t,
    props: r,
    handler: a,
    htmlBuilder: l,
    mathmlBuilder: h
  } = n, c = {
    type: e,
    numArgs: r.numArgs || 0,
    allowedInText: !1,
    numOptionalArgs: 0,
    handler: a
  }, d = 0; d < t.length; ++d)
    _environments[t[d]] = c;
  l && (_htmlGroupBuilders[e] = l), h && (_mathmlGroupBuilders[e] = h);
}
var _macros = {};
function defineMacro(n, e) {
  _macros[n] = e;
}
function getHLines(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 validateAmsEnvironmentContext = (n) => {
  var e = n.parser.settings;
  if (!e.displayMode)
    throw new ParseError("{" + n.envName + "} can be used only in display mode.");
};
function getAutoTag(n) {
  if (n.indexOf("ed") === -1)
    return n.indexOf("*") === -1;
}
function parseArray(n, e, t) {
  var {
    hskipBeforeAndAfter: r,
    addJot: a,
    cols: l,
    arraystretch: h,
    colSeparationType: c,
    autoTag: d,
    singleRow: _,
    emptySingleRow: m,
    maxNumCols: y,
    leqno: x
  } = e;
  if (n.gullet.beginGroup(), _ || n.gullet.macros.set("\\cr", "\\\\\\relax"), !h) {
    var b = n.gullet.expandMacroAsText("\\arraystretch");
    if (b == null)
      h = 1;
    else if (h = parseFloat(b), !h || h < 0)
      throw new ParseError("Invalid \\arraystretch: " + b);
  }
  n.gullet.beginGroup();
  var A = [], f = [A], s = [], u = [], p = d != null ? [] : void 0;
  function g() {
    d && n.gullet.macros.set("\\@eqnsw", "1", !0);
  }
  function w() {
    p && (n.gullet.macros.get("\\df@tag") ? (p.push(n.subparse([new Token("\\df@tag")])), n.gullet.macros.set("\\df@tag", void 0, !0)) : p.push(!!d && n.gullet.macros.get("\\@eqnsw") === "1"));
  }
  for (g(), u.push(getHLines(n)); ; ) {
    var o = n.parseExpression(!1, _ ? "\\end" : "\\\\");
    n.gullet.endGroup(), n.gullet.beginGroup(), o = {
      type: "ordgroup",
      mode: n.mode,
      body: o
    }, t && (o = {
      type: "styling",
      mode: n.mode,
      style: t,
      body: [o]
    }), A.push(o);
    var v = n.fetch().text;
    if (v === "&") {
      if (y && A.length === y) {
        if (_ || c)
          throw new ParseError("Too many tab characters: &", n.nextToken);
        n.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
      }
      n.consume();
    } else if (v === "\\end") {
      w(), A.length === 1 && o.type === "styling" && o.body[0].body.length === 0 && (f.length > 1 || !m) && f.pop(), u.length < f.length + 1 && u.push([]);
      break;
    } else if (v === "\\\\") {
      n.consume();
      var M = void 0;
      n.gullet.future().text !== " " && (M = n.parseSizeGroup(!0)), s.push(M ? M.value : null), w(), u.push(getHLines(n)), A = [], f.push(A), g();
    } else
      throw new ParseError("Expected & or \\\\ or \\cr or \\end", n.nextToken);
  }
  return n.gullet.endGroup(), n.gullet.endGroup(), {
    type: "array",
    mode: n.mode,
    addJot: a,
    arraystretch: h,
    body: f,
    cols: l,
    rowGaps: s,
    hskipBeforeAndAfter: r,
    hLinesBeforeRow: u,
    colSeparationType: c,
    tags: p,
    leqno: x
  };
}
function dCellStyle(n) {
  return n.slice(0, 1) === "d" ? "display" : "text";
}
var htmlBuilder$6 = function(e, t) {
  var r, a, l = e.body.length, h = e.hLinesBeforeRow, c = 0, d = new Array(l), _ = [], m = Math.max(
    // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
    t.fontMetrics().arrayRuleWidth,
    t.minRuleThickness
    // User override.
  ), y = 1 / t.fontMetrics().ptPerEm, x = 5 * y;
  if (e.colSeparationType && e.colSeparationType === "small") {
    var b = t.havingStyle(Style$1.SCRIPT).sizeMultiplier;
    x = 0.2778 * (b / t.sizeMultiplier);
  }
  var A = e.colSeparationType === "CD" ? calculateSize({
    number: 3,
    unit: "ex"
  }, t) : 12 * y, f = 3 * y, s = e.arraystretch * A, u = 0.7 * s, p = 0.3 * s, g = 0;
  function w(Ue) {
    for (var He = 0; He < Ue.length; ++He)
      He > 0 && (g += 0.25), _.push({
        pos: g,
        isDashed: Ue[He]
      });
  }
  for (w(h[0]), r = 0; r < e.body.length; ++r) {
    var o = e.body[r], v = u, M = p;
    c < o.length && (c = o.length);
    var E = new Array(o.length);
    for (a = 0; a < o.length; ++a) {
      var $ = buildGroup$1(o[a], t);
      M < $.depth && (M = $.depth), v < $.height && (v = $.height), E[a] = $;
    }
    var k = e.rowGaps[r], L = 0;
    k && (L = calculateSize(k, t), L > 0 && (L += p, M < L && (M = L), L = 0)), e.addJot && (M += f), E.height = v, E.depth = M, g += v, E.pos = g, g += M + L, d[r] = E, w(h[r + 1]);
  }
  var z = g / 2 + t.fontMetrics().axisHeight, O = e.cols || [], R = [], N, W, B = [];
  if (e.tags && e.tags.some((Ue) => Ue))
    for (r = 0; r < l; ++r) {
      var P = d[r], G = P.pos - z, H = e.tags[r], U = void 0;
      H === !0 ? U = buildCommon.makeSpan(["eqn-num"], [], t) : H === !1 ? U = buildCommon.makeSpan([], [], t) : U = buildCommon.makeSpan([], buildExpression$1(H, t, !0), t), U.depth = P.depth, U.height = P.height, B.push({
        type: "elem",
        elem: U,
        shift: G
      });
    }
  for (
    a = 0, W = 0;
    // Continue while either there are more columns or more column
    // descriptions, so trailing separators don't get lost.
    a < c || W < O.length;
    ++a, ++W
  ) {
    for (var j = O[W] || {}, re = !0; j.type === "separator"; ) {
      if (re || (N = buildCommon.makeSpan(["arraycolsep"], []), N.style.width = makeEm(t.fontMetrics().doubleRuleSep), R.push(N)), j.separator === "|" || j.separator === ":") {
        var ie = j.separator === "|" ? "solid" : "dashed", te = buildCommon.makeSpan(["vertical-separator"], [], t);
        te.style.height = makeEm(g), te.style.borderRightWidth = makeEm(m), te.style.borderRightStyle = ie, te.style.margin = "0 " + makeEm(-m / 2);
        var ue = g - z;
        ue && (te.style.verticalAlign = makeEm(-ue)), R.push(te);
      } else
        throw new ParseError("Invalid separator type: " + j.separator);
      W++, j = O[W] || {}, re = !1;
    }
    if (!(a >= c)) {
      var de = void 0;
      (a > 0 || e.hskipBeforeAndAfter) && (de = utils.deflt(j.pregap, x), de !== 0 && (N = buildCommon.makeSpan(["arraycolsep"], []), N.style.width = makeEm(de), R.push(N)));
      var oe = [];
      for (r = 0; r < l; ++r) {
        var J = d[r], Ee = J[a];
        if (Ee) {
          var se = J.pos - z;
          Ee.depth = J.depth, Ee.height = J.height, oe.push({
            type: "elem",
            elem: Ee,
            shift: se
          });
        }
      }
      oe = buildCommon.makeVList({
        positionType: "individualShift",
        children: oe
      }, t), oe = buildCommon.makeSpan(["col-align-" + (j.align || "c")], [oe]), R.push(oe), (a < c - 1 || e.hskipBeforeAndAfter) && (de = utils.deflt(j.postgap, x), de !== 0 && (N = buildCommon.makeSpan(["arraycolsep"], []), N.style.width = makeEm(de), R.push(N)));
    }
  }
  if (d = buildCommon.makeSpan(["mtable"], R), _.length > 0) {
    for (var Ae = buildCommon.makeLineSpan("hline", t, m), he = buildCommon.makeLineSpan("hdashline", t, m), ne = [{
      type: "elem",
      elem: d,
      shift: 0
    }]; _.length > 0; ) {
      var _e = _.pop(), Le = _e.pos - z;
      _e.isDashed ? ne.push({
        type: "elem",
        elem: he,
        shift: Le
      }) : ne.push({
        type: "elem",
        elem: Ae,
        shift: Le
      });
    }
    d = buildCommon.makeVList({
      positionType: "individualShift",
      children: ne
    }, t);
  }
  if (B.length === 0)
    return buildCommon.makeSpan(["mord"], [d], t);
  var Be = buildCommon.makeVList({
    positionType: "individualShift",
    children: B
  }, t);
  return Be = buildCommon.makeSpan(["tag"], [Be], t), buildCommon.makeFragment([d, Be]);
}, alignMap = {
  c: "center ",
  l: "left ",
  r: "right "
}, mathmlBuilder$5 = function(e, t) {
  for (var r = [], a = new mathMLTree.MathNode("mtd", [], ["mtr-glue"]), l = new mathMLTree.MathNode("mtd", [], ["mml-eqn-num"]), h = 0; h < e.body.length; h++) {
    for (var c = e.body[h], d = [], _ = 0; _ < c.length; _++)
      d.push(new mathMLTree.MathNode("mtd", [buildGroup(c[_], t)]));
    e.tags && e.tags[h] && (d.unshift(a), d.push(a), e.leqno ? d.unshift(l) : d.push(l)), r.push(new mathMLTree.MathNode("mtr", d));
  }
  var m = new mathMLTree.MathNode("mtable", r), y = e.arraystretch === 0.5 ? 0.1 : 0.16 + e.arraystretch - 1 + (e.addJot ? 0.09 : 0);
  m.setAttribute("rowspacing", makeEm(y));
  var x = "", b = "";
  if (e.cols && e.cols.length > 0) {
    var A = e.cols, f = "", s = !1, u = 0, p = A.length;
    A[0].type === "separator" && (x += "top ", u = 1), A[A.length - 1].type === "separator" && (x += "bottom ", p -= 1);
    for (var g = u; g < p; g++)
      A[g].type === "align" ? (b += alignMap[A[g].align], s && (f += "none "), s = !0) : A[g].type === "separator" && s && (f += A[g].separator === "|" ? "solid " : "dashed ", s = !1);
    m.setAttribute("columnalign", b.trim()), /[sd]/.test(f) && m.setAttribute("columnlines", f.trim());
  }
  if (e.colSeparationType === "align") {
    for (var w = e.cols || [], o = "", v = 1; v < w.length; v++)
      o += v % 2 ? "0em " : "1em ";
    m.setAttribute("columnspacing", o.trim());
  } else e.colSeparationType === "alignat" || e.colSeparationType === "gather" ? m.setAttribute("columnspacing", "0em") : e.colSeparationType === "small" ? m.setAttribute("columnspacing", "0.2778em") : e.colSeparationType === "CD" ? m.setAttribute("columnspacing", "0.5em") : m.setAttribute("columnspacing", "1em");
  var M = "", E = e.hLinesBeforeRow;
  x += E[0].length > 0 ? "left " : "", x += E[E.length - 1].length > 0 ? "right " : "";
  for (var $ = 1; $ < E.length - 1; $++)
    M += E[$].length === 0 ? "none " : E[$][0] ? "dashed " : "solid ";
  return /[sd]/.test(M) && m.setAttribute("rowlines", M.trim()), x !== "" && (m = new mathMLTree.MathNode("menclose", [m]), m.setAttribute("notation", x.trim())), e.arraystretch && e.arraystretch < 1 && (m = new mathMLTree.MathNode("mstyle", [m]), m.setAttribute("scriptlevel", "1")), m;
}, alignedHandler = function(e, t) {
  e.envName.indexOf("ed") === -1 && validateAmsEnvironmentContext(e);
  var r = [], a = e.envName.indexOf("at") > -1 ? "alignat" : "align", l = e.envName === "split", h = parseArray(e.parser, {
    cols: r,
    addJot: !0,
    autoTag: l ? void 0 : getAutoTag(e.envName),
    emptySingleRow: !0,
    colSeparationType: a,
    maxNumCols: l ? 2 : void 0,
    leqno: e.parser.settings.leqno
  }, "display"), c, d = 0, _ = {
    type: "ordgroup",
    mode: e.mode,
    body: []
  };
  if (t[0] && t[0].type === "ordgroup") {
    for (var m = "", y = 0; y < t[0].body.length; y++) {
      var x = assertNodeType(t[0].body[y], "textord");
      m += x.text;
    }
    c = Number(m), d = c * 2;
  }
  var b = !d;
  h.body.forEach(function(u) {
    for (var p = 1; p < u.length; p += 2) {
      var g = assertNodeType(u[p], "styling"), w = assertNodeType(g.body[0], "ordgroup");
      w.body.unshift(_);
    }
    if (b)
      d < u.length && (d = u.length);
    else {
      var o = u.length / 2;
      if (c < o)
        throw new ParseError("Too many math in a row: " + ("expected " + c + ", but got " + o), u[0]);
    }
  });
  for (var A = 0; A < d; ++A) {
    var f = "r", s = 0;
    A % 2 === 1 ? f = "l" : A > 0 && b && (s = 1), r[A] = {
      type: "align",
      align: f,
      pregap: s,
      postgap: 0
    };
  }
  return h.colSeparationType = b ? "align" : "alignat", h;
};
defineEnvironment({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var t = checkSymbolNodeType(e[0]), r = t ? [e[0]] : assertNodeType(e[0], "ordgroup").body, a = r.map(function(h) {
      var c = assertSymbolNodeType(h), d = c.text;
      if ("lcr".indexOf(d) !== -1)
        return {
          type: "align",
          align: d
        };
      if (d === "|")
        return {
          type: "separator",
          separator: "|"
        };
      if (d === ":")
        return {
          type: "separator",
          separator: ":"
        };
      throw new ParseError("Unknown column alignment: " + d, h);
    }), l = {
      cols: a,
      hskipBeforeAndAfter: !0,
      // \@preamble in lttab.dtx
      maxNumCols: a.length
    };
    return parseArray(n.parser, l, dCellStyle(n.envName));
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  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 ParseError("Expected l or c or r", a.nextToken);
        a.consume(), a.consumeSpaces(), a.expect("]"), a.consume(), r.cols = [{
          type: "align",
          align: t
        }];
      }
    }
    var l = parseArray(n.parser, r, dCellStyle(n.envName)), h = Math.max(0, ...l.body.map((c) => c.length));
    return l.cols = new Array(h).fill({
      type: "align",
      align: t
    }), e ? {
      type: "leftright",
      mode: n.mode,
      body: [l],
      left: e[0],
      right: e[1],
      rightColor: void 0
      // \right uninfluenced by \color in array
    } : l;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(n) {
    var e = {
      arraystretch: 0.5
    }, t = parseArray(n.parser, e, "script");
    return t.colSeparationType = "small", t;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(n, e) {
    var t = checkSymbolNodeType(e[0]), r = t ? [e[0]] : assertNodeType(e[0], "ordgroup").body, a = r.map(function(h) {
      var c = assertSymbolNodeType(h), d = c.text;
      if ("lc".indexOf(d) !== -1)
        return {
          type: "align",
          align: d
        };
      throw new ParseError("Unknown column alignment: " + d, h);
    });
    if (a.length > 1)
      throw new ParseError("{subarray} can contain only one column");
    var l = {
      cols: a,
      hskipBeforeAndAfter: !1,
      arraystretch: 0.5
    };
    if (l = parseArray(n.parser, l, "script"), l.body.length > 0 && l.body[0].length > 1)
      throw new ParseError("{subarray} can contain only one column");
    return l;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  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 = parseArray(n.parser, e, dCellStyle(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: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: alignedHandler,
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(n) {
    utils.contains(["gather", "gather*"], n.envName) && validateAmsEnvironmentContext(n);
    var e = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: !0,
      colSeparationType: "gather",
      autoTag: getAutoTag(n.envName),
      emptySingleRow: !0,
      leqno: n.parser.settings.leqno
    };
    return parseArray(n.parser, e, "display");
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: alignedHandler,
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(n) {
    validateAmsEnvironmentContext(n);
    var e = {
      autoTag: getAutoTag(n.envName),
      emptySingleRow: !0,
      singleRow: !0,
      maxNumCols: 1,
      leqno: n.parser.settings.leqno
    };
    return parseArray(n.parser, e, "display");
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(n) {
    return validateAmsEnvironmentContext(n), parseCD(n.parser);
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}");
defineMacro("\\notag", "\\nonumber");
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !0
  },
  handler(n, e) {
    throw new ParseError(n.funcName + " valid only within array environment");
  }
});
var environments = _environments;
defineFunction({
  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 ParseError("Invalid environment name", a);
    for (var l = "", h = 0; h < a.body.length; ++h)
      l += assertNodeType(a.body[h], "textord").text;
    if (r === "\\begin") {
      if (!environments.hasOwnProperty(l))
        throw new ParseError("No such environment: " + l, a);
      var c = environments[l], {
        args: d,
        optArgs: _
      } = t.parseArguments("\\begin{" + l + "}", c), m = {
        mode: t.mode,
        envName: l,
        parser: t
      }, y = c.handler(m, d, _);
      t.expect("\\end", !1);
      var x = t.nextToken, b = assertNodeType(t.parseFunction(), "environment");
      if (b.name !== l)
        throw new ParseError("Mismatch: \\begin{" + l + "} matched by \\end{" + b.name + "}", x);
      return y;
    }
    return {
      type: "environment",
      mode: t.mode,
      name: l,
      nameGroup: a
    };
  }
});
var htmlBuilder$5 = (n, e) => {
  var t = n.font, r = e.withFont(t);
  return buildGroup$1(n.body, r);
}, mathmlBuilder$4 = (n, e) => {
  var t = n.font, r = e.withFont(t);
  return buildGroup(n.body, r);
}, fontAliases = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak",
  "\\bm": "\\boldsymbol"
};
defineFunction({
  type: "font",
  names: [
    // styles, except \boldsymbol defined below
    "\\mathrm",
    "\\mathit",
    "\\mathbf",
    "\\mathnormal",
    // 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 = normalizeArgument(e[0]), l = r;
    return l in fontAliases && (l = fontAliases[l]), {
      type: "font",
      mode: t.mode,
      font: l.slice(1),
      body: a
    };
  },
  htmlBuilder: htmlBuilder$5,
  mathmlBuilder: mathmlBuilder$4
});
defineFunction({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[0], a = utils.isCharacterBox(r);
    return {
      type: "mclass",
      mode: t.mode,
      mclass: binrelClass(r),
      body: [{
        type: "font",
        mode: t.mode,
        font: "boldsymbol",
        body: r
      }],
      isCharacterBox: a
    };
  }
});
defineFunction({
  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: l
    } = t, h = t.parseExpression(!0, a), c = "math" + r.slice(1);
    return {
      type: "font",
      mode: l,
      font: c,
      body: {
        type: "ordgroup",
        mode: t.mode,
        body: h
      }
    };
  },
  htmlBuilder: htmlBuilder$5,
  mathmlBuilder: mathmlBuilder$4
});
var adjustStyle = (n, e) => {
  var t = e;
  return n === "display" ? t = t.id >= Style$1.SCRIPT.id ? t.text() : Style$1.DISPLAY : n === "text" && t.size === Style$1.DISPLAY.size ? t = Style$1.TEXT : n === "script" ? t = Style$1.SCRIPT : n === "scriptscript" && (t = Style$1.SCRIPTSCRIPT), t;
}, htmlBuilder$4 = (n, e) => {
  var t = adjustStyle(n.size, e.style), r = t.fracNum(), a = t.fracDen(), l;
  l = e.havingStyle(r);
  var h = buildGroup$1(n.numer, l, e);
  if (n.continued) {
    var c = 8.5 / e.fontMetrics().ptPerEm, d = 3.5 / e.fontMetrics().ptPerEm;
    h.height = h.height < c ? c : h.height, h.depth = h.depth < d ? d : h.depth;
  }
  l = e.havingStyle(a);
  var _ = buildGroup$1(n.denom, l, e), m, y, x;
  n.hasBarLine ? (n.barSize ? (y = calculateSize(n.barSize, e), m = buildCommon.makeLineSpan("frac-line", e, y)) : m = buildCommon.makeLineSpan("frac-line", e), y = m.height, x = m.height) : (m = null, y = 0, x = e.fontMetrics().defaultRuleThickness);
  var b, A, f;
  t.size === Style$1.DISPLAY.size || n.size === "display" ? (b = e.fontMetrics().num1, y > 0 ? A = 3 * x : A = 7 * x, f = e.fontMetrics().denom1) : (y > 0 ? (b = e.fontMetrics().num2, A = x) : (b = e.fontMetrics().num3, A = 3 * x), f = e.fontMetrics().denom2);
  var s;
  if (m) {
    var p = e.fontMetrics().axisHeight;
    b - h.depth - (p + 0.5 * y) < A && (b += A - (b - h.depth - (p + 0.5 * y))), p - 0.5 * y - (_.height - f) < A && (f += A - (p - 0.5 * y - (_.height - f)));
    var g = -(p - 0.5 * y);
    s = buildCommon.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: _,
        shift: f
      }, {
        type: "elem",
        elem: m,
        shift: g
      }, {
        type: "elem",
        elem: h,
        shift: -b
      }]
    }, e);
  } else {
    var u = b - h.depth - (_.height - f);
    u < A && (b += 0.5 * (A - u), f += 0.5 * (A - u)), s = buildCommon.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: _,
        shift: f
      }, {
        type: "elem",
        elem: h,
        shift: -b
      }]
    }, e);
  }
  l = e.havingStyle(t), s.height *= l.sizeMultiplier / e.sizeMultiplier, s.depth *= l.sizeMultiplier / e.sizeMultiplier;
  var w;
  t.size === Style$1.DISPLAY.size ? w = e.fontMetrics().delim1 : t.size === Style$1.SCRIPTSCRIPT.size ? w = e.havingStyle(Style$1.SCRIPT).fontMetrics().delim2 : w = e.fontMetrics().delim2;
  var o, v;
  return n.leftDelim == null ? o = makeNullDelimiter(e, ["mopen"]) : o = delimiter.customSizedDelim(n.leftDelim, w, !0, e.havingStyle(t), n.mode, ["mopen"]), n.continued ? v = buildCommon.makeSpan([]) : n.rightDelim == null ? v = makeNullDelimiter(e, ["mclose"]) : v = delimiter.customSizedDelim(n.rightDelim, w, !0, e.havingStyle(t), n.mode, ["mclose"]), buildCommon.makeSpan(["mord"].concat(l.sizingClasses(e)), [o, buildCommon.makeSpan(["mfrac"], [s]), v], e);
}, mathmlBuilder$3 = (n, e) => {
  var t = new mathMLTree.MathNode("mfrac", [buildGroup(n.numer, e), buildGroup(n.denom, e)]);
  if (!n.hasBarLine)
    t.setAttribute("linethickness", "0px");
  else if (n.barSize) {
    var r = calculateSize(n.barSize, e);
    t.setAttribute("linethickness", makeEm(r));
  }
  var a = adjustStyle(n.size, e.style);
  if (a.size !== e.style.size) {
    t = new mathMLTree.MathNode("mstyle", [t]);
    var l = a.size === Style$1.DISPLAY.size ? "true" : "false";
    t.setAttribute("displaystyle", l), t.setAttribute("scriptlevel", "0");
  }
  if (n.leftDelim != null || n.rightDelim != null) {
    var h = [];
    if (n.leftDelim != null) {
      var c = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(n.leftDelim.replace("\\", ""))]);
      c.setAttribute("fence", "true"), h.push(c);
    }
    if (h.push(t), n.rightDelim != null) {
      var d = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(n.rightDelim.replace("\\", ""))]);
      d.setAttribute("fence", "true"), h.push(d);
    }
    return makeRow(h);
  }
  return t;
};
defineFunction({
  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], l = e[1], h, c = null, d = null, _ = "auto";
    switch (r) {
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        h = !0;
        break;
      case "\\\\atopfrac":
        h = !1;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        h = !1, c = "(", d = ")";
        break;
      case "\\\\bracefrac":
        h = !1, c = "\\{", d = "\\}";
        break;
      case "\\\\brackfrac":
        h = !1, c = "[", d = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    switch (r) {
      case "\\dfrac":
      case "\\dbinom":
        _ = "display";
        break;
      case "\\tfrac":
      case "\\tbinom":
        _ = "text";
        break;
    }
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !1,
      numer: a,
      denom: l,
      hasBarLine: h,
      leftDelim: c,
      rightDelim: d,
      size: _,
      barSize: null
    };
  },
  htmlBuilder: htmlBuilder$4,
  mathmlBuilder: mathmlBuilder$3
});
defineFunction({
  type: "genfrac",
  names: ["\\cfrac"],
  props: {
    numArgs: 2
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0], l = e[1];
    return {
      type: "genfrac",
      mode: t.mode,
      continued: !0,
      numer: a,
      denom: l,
      hasBarLine: !0,
      leftDelim: null,
      rightDelim: null,
      size: "display",
      barSize: null
    };
  }
});
defineFunction({
  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 stylArray = ["display", "text", "script", "scriptscript"], delimFromValue = function(e) {
  var t = null;
  return e.length > 0 && (t = e, t = t === "." ? null : t), t;
};
defineFunction({
  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], l = normalizeArgument(e[0]), h = l.type === "atom" && l.family === "open" ? delimFromValue(l.text) : null, c = normalizeArgument(e[1]), d = c.type === "atom" && c.family === "close" ? delimFromValue(c.text) : null, _ = assertNodeType(e[2], "size"), m, y = null;
    _.isBlank ? m = !0 : (y = _.value, m = y.number > 0);
    var x = "auto", b = e[3];
    if (b.type === "ordgroup") {
      if (b.body.length > 0) {
        var A = assertNodeType(b.body[0], "textord");
        x = stylArray[Number(A.text)];
      }
    } else
      b = assertNodeType(b, "textord"), x = stylArray[Number(b.text)];
    return {
      type: "genfrac",
      mode: t.mode,
      numer: r,
      denom: a,
      continued: !1,
      hasBarLine: m,
      barSize: y,
      leftDelim: h,
      rightDelim: d,
      size: x
    };
  },
  htmlBuilder: htmlBuilder$4,
  mathmlBuilder: mathmlBuilder$3
});
defineFunction({
  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: assertNodeType(e[0], "size").value,
      token: a
    };
  }
});
defineFunction({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (n, e) => {
    var {
      parser: t,
      funcName: r
    } = n, a = e[0], l = assert(assertNodeType(e[1], "infix").size), h = e[2], c = l.number > 0;
    return {
      type: "genfrac",
      mode: t.mode,
      numer: a,
      denom: h,
      continued: !1,
      hasBarLine: c,
      barSize: l,
      leftDelim: null,
      rightDelim: null,
      size: "auto"
    };
  },
  htmlBuilder: htmlBuilder$4,
  mathmlBuilder: mathmlBuilder$3
});
var htmlBuilder$3 = (n, e) => {
  var t = e.style, r, a;
  n.type === "supsub" ? (r = n.sup ? buildGroup$1(n.sup, e.havingStyle(t.sup()), e) : buildGroup$1(n.sub, e.havingStyle(t.sub()), e), a = assertNodeType(n.base, "horizBrace")) : a = assertNodeType(n, "horizBrace");
  var l = buildGroup$1(a.base, e.havingBaseStyle(Style$1.DISPLAY)), h = stretchy.svgSpan(a, e), c;
  if (a.isOver ? (c = buildCommon.makeVList({
    positionType: "firstBaseline",
    children: [{
      type: "elem",
      elem: l
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: h
    }]
  }, e), c.children[0].children[0].children[1].classes.push("svg-align")) : (c = buildCommon.makeVList({
    positionType: "bottom",
    positionData: l.depth + 0.1 + h.height,
    children: [{
      type: "elem",
      elem: h
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: l
    }]
  }, e), c.children[0].children[0].children[0].classes.push("svg-align")), r) {
    var d = buildCommon.makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], e);
    a.isOver ? c = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: d
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: r
      }]
    }, e) : c = buildCommon.makeVList({
      positionType: "bottom",
      positionData: d.depth + 0.2 + r.height + r.depth,
      children: [{
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: d
      }]
    }, e);
  }
  return buildCommon.makeSpan(["mord", a.isOver ? "mover" : "munder"], [c], e);
}, mathmlBuilder$2 = (n, e) => {
  var t = stretchy.mathMLnode(n.label);
  return new mathMLTree.MathNode(n.isOver ? "mover" : "munder", [buildGroup(n.base, e), t]);
};
defineFunction({
  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: htmlBuilder$3,
  mathmlBuilder: mathmlBuilder$2
});
defineFunction({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = e[1], a = assertNodeType(e[0], "url").url;
    return t.settings.isTrusted({
      command: "\\href",
      url: a
    }) ? {
      type: "href",
      mode: t.mode,
      href: a,
      body: ordargument(r)
    } : t.formatUnsupportedCmd("\\href");
  },
  htmlBuilder: (n, e) => {
    var t = buildExpression$1(n.body, e, !1);
    return buildCommon.makeAnchor(n.href, [], t, e);
  },
  mathmlBuilder: (n, e) => {
    var t = buildExpressionRow(n.body, e);
    return t instanceof MathNode || (t = new MathNode("mrow", [t])), t.setAttribute("href", n.href), t;
  }
});
defineFunction({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n, r = assertNodeType(e[0], "url").url;
    if (!t.settings.isTrusted({
      command: "\\url",
      url: r
    }))
      return t.formatUnsupportedCmd("\\url");
    for (var a = [], l = 0; l < r.length; l++) {
      var h = r[l];
      h === "~" && (h = "\\textasciitilde"), a.push({
        type: "textord",
        mode: "text",
        text: h
      });
    }
    var c = {
      type: "text",
      mode: t.mode,
      font: "\\texttt",
      body: a
    };
    return {
      type: "href",
      mode: t.mode,
      href: r,
      body: ordargument(c)
    };
  }
});
defineFunction({
  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: ordargument(e[0])
    };
  },
  htmlBuilder(n, e) {
    var t = buildExpression$1(n.body, e, !1);
    return buildCommon.makeFragment(t);
  },
  mathmlBuilder(n, e) {
    return new mathMLTree.MathNode("mrow", buildExpression(n.body, e));
  }
});
defineFunction({
  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, l = assertNodeType(e[0], "raw").string, h = e[1];
    t.settings.strict && t.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    var c, d = {};
    switch (r) {
      case "\\htmlClass":
        d.class = l, c = {
          command: "\\htmlClass",
          class: l
        };
        break;
      case "\\htmlId":
        d.id = l, c = {
          command: "\\htmlId",
          id: l
        };
        break;
      case "\\htmlStyle":
        d.style = l, c = {
          command: "\\htmlStyle",
          style: l
        };
        break;
      case "\\htmlData": {
        for (var _ = l.split(","), m = 0; m < _.length; m++) {
          var y = _[m].split("=");
          if (y.length !== 2)
            throw new ParseError("Error parsing key-value for \\htmlData");
          d["data-" + y[0].trim()] = y[1].trim();
        }
        c = {
          command: "\\htmlData",
          attributes: d
        };
        break;
      }
      default:
        throw new Error("Unrecognized html command");
    }
    return t.settings.isTrusted(c) ? {
      type: "html",
      mode: t.mode,
      attributes: d,
      body: ordargument(h)
    } : t.formatUnsupportedCmd(r);
  },
  htmlBuilder: (n, e) => {
    var t = buildExpression$1(n.body, e, !1), r = ["enclosing"];
    n.attributes.class && r.push(...n.attributes.class.trim().split(/\s+/));
    var a = buildCommon.makeSpan(r, t, e);
    for (var l in n.attributes)
      l !== "class" && n.attributes.hasOwnProperty(l) && a.setAttribute(l, n.attributes[l]);
    return a;
  },
  mathmlBuilder: (n, e) => buildExpressionRow(n.body, e)
});
defineFunction({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n;
    return {
      type: "htmlmathml",
      mode: t.mode,
      html: ordargument(e[0]),
      mathml: ordargument(e[1])
    };
  },
  htmlBuilder: (n, e) => {
    var t = buildExpression$1(n.html, e, !1);
    return buildCommon.makeFragment(t);
  },
  mathmlBuilder: (n, e) => buildExpressionRow(n.mathml, e)
});
var sizeData = 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 ParseError("Invalid size: '" + e + "' in \\includegraphics");
  var r = {
    number: +(t[1] + t[2]),
    // sign + magnitude, cast to number
    unit: t[3]
  };
  if (!validUnit(r))
    throw new ParseError("Invalid unit: '" + r.unit + "' in \\includegraphics.");
  return r;
};
defineFunction({
  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"
    }, l = {
      number: 0.9,
      unit: "em"
    }, h = {
      number: 0,
      unit: "em"
    }, c = "";
    if (t[0])
      for (var d = assertNodeType(t[0], "raw").string, _ = d.split(","), m = 0; m < _.length; m++) {
        var y = _[m].split("=");
        if (y.length === 2) {
          var x = y[1].trim();
          switch (y[0].trim()) {
            case "alt":
              c = x;
              break;
            case "width":
              a = sizeData(x);
              break;
            case "height":
              l = sizeData(x);
              break;
            case "totalheight":
              h = sizeData(x);
              break;
            default:
              throw new ParseError("Invalid key: '" + y[0] + "' in \\includegraphics.");
          }
        }
      }
    var b = assertNodeType(e[0], "url").url;
    return c === "" && (c = b, c = c.replace(/^.*[\\/]/, ""), c = c.substring(0, c.lastIndexOf("."))), r.settings.isTrusted({
      command: "\\includegraphics",
      url: b
    }) ? {
      type: "includegraphics",
      mode: r.mode,
      alt: c,
      width: a,
      height: l,
      totalheight: h,
      src: b
    } : r.formatUnsupportedCmd("\\includegraphics");
  },
  htmlBuilder: (n, e) => {
    var t = calculateSize(n.height, e), r = 0;
    n.totalheight.number > 0 && (r = calculateSize(n.totalheight, e) - t);
    var a = 0;
    n.width.number > 0 && (a = calculateSize(n.width, e));
    var l = {
      height: makeEm(t + r)
    };
    a > 0 && (l.width = makeEm(a)), r > 0 && (l.verticalAlign = makeEm(-r));
    var h = new Img(n.src, n.alt, l);
    return h.height = t, h.depth = r, h;
  },
  mathmlBuilder: (n, e) => {
    var t = new mathMLTree.MathNode("mglyph", []);
    t.setAttribute("alt", n.alt);
    var r = calculateSize(n.height, e), a = 0;
    if (n.totalheight.number > 0 && (a = calculateSize(n.totalheight, e) - r, t.setAttribute("valign", makeEm(-a))), t.setAttribute("height", makeEm(r + a)), n.width.number > 0) {
      var l = calculateSize(n.width, e);
      t.setAttribute("width", makeEm(l));
    }
    return t.setAttribute("src", n.src), t;
  }
});
defineFunction({
  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 = assertNodeType(e[0], "size");
    if (t.settings.strict) {
      var l = r[1] === "m", h = a.value.unit === "mu";
      l ? (h || 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")) : h && 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 buildCommon.makeGlue(n.dimension, e);
  },
  mathmlBuilder(n, e) {
    var t = calculateSize(n.dimension, e);
    return new mathMLTree.SpaceNode(t);
  }
});
defineFunction({
  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 = buildCommon.makeSpan([], [buildGroup$1(n.body, e)]), t = buildCommon.makeSpan(["inner"], [t], e)) : t = buildCommon.makeSpan(["inner"], [buildGroup$1(n.body, e)]);
    var r = buildCommon.makeSpan(["fix"], []), a = buildCommon.makeSpan([n.alignment], [t, r], e), l = buildCommon.makeSpan(["strut"]);
    return l.style.height = makeEm(a.height + a.depth), a.depth && (l.style.verticalAlign = makeEm(-a.depth)), a.children.unshift(l), a = buildCommon.makeSpan(["thinbox"], [a], e), buildCommon.makeSpan(["mord", "vbox"], [a], e);
  },
  mathmlBuilder: (n, e) => {
    var t = new mathMLTree.MathNode("mpadded", [buildGroup(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;
  }
});
defineFunction({
  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 l = t === "\\(" ? "\\)" : "$", h = r.parseExpression(!1, l);
    return r.expect(l), r.switchMode(a), {
      type: "styling",
      mode: r.mode,
      style: "text",
      body: h
    };
  }
});
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(n, e) {
    throw new ParseError("Mismatched " + n.funcName);
  }
});
var chooseMathStyle = (n, e) => {
  switch (e.style.size) {
    case Style$1.DISPLAY.size:
      return n.display;
    case Style$1.TEXT.size:
      return n.text;
    case Style$1.SCRIPT.size:
      return n.script;
    case Style$1.SCRIPTSCRIPT.size:
      return n.scriptscript;
    default:
      return n.text;
  }
};
defineFunction({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: !0
  },
  handler: (n, e) => {
    var {
      parser: t
    } = n;
    return {
      type: "mathchoice",
      mode: t.mode,
      display: ordargument(e[0]),
      text: ordargument(e[1]),
      script: ordargument(e[2]),
      scriptscript: ordargument(e[3])
    };
  },
  htmlBuilder: (n, e) => {
    var t = chooseMathStyle(n, e), r = buildExpression$1(t, e, !1);
    return buildCommon.makeFragment(r);
  },
  mathmlBuilder: (n, e) => {
    var t = chooseMathStyle(n, e);
    return buildExpressionRow(t, e);
  }
});
var assembleSupSub = (n, e, t, r, a, l, h) => {
  n = buildCommon.makeSpan([], [n]);
  var c = t && utils.isCharacterBox(t), d, _;
  if (e) {
    var m = buildGroup$1(e, r.havingStyle(a.sup()), r);
    _ = {
      elem: m,
      kern: Math.max(r.fontMetrics().bigOpSpacing1, r.fontMetrics().bigOpSpacing3 - m.depth)
    };
  }
  if (t) {
    var y = buildGroup$1(t, r.havingStyle(a.sub()), r);
    d = {
      elem: y,
      kern: Math.max(r.fontMetrics().bigOpSpacing2, r.fontMetrics().bigOpSpacing4 - y.height)
    };
  }
  var x;
  if (_ && d) {
    var b = r.fontMetrics().bigOpSpacing5 + d.elem.height + d.elem.depth + d.kern + n.depth + h;
    x = buildCommon.makeVList({
      positionType: "bottom",
      positionData: b,
      children: [{
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: d.elem,
        marginLeft: makeEm(-l)
      }, {
        type: "kern",
        size: d.kern
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: _.kern
      }, {
        type: "elem",
        elem: _.elem,
        marginLeft: makeEm(l)
      }, {
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }]
    }, r);
  } else if (d) {
    var A = n.height - h;
    x = buildCommon.makeVList({
      positionType: "top",
      positionData: A,
      children: [{
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: d.elem,
        marginLeft: makeEm(-l)
      }, {
        type: "kern",
        size: d.kern
      }, {
        type: "elem",
        elem: n
      }]
    }, r);
  } else if (_) {
    var f = n.depth + h;
    x = buildCommon.makeVList({
      positionType: "bottom",
      positionData: f,
      children: [{
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: _.kern
      }, {
        type: "elem",
        elem: _.elem,
        marginLeft: makeEm(l)
      }, {
        type: "kern",
        size: r.fontMetrics().bigOpSpacing5
      }]
    }, r);
  } else
    return n;
  var s = [x];
  if (d && l !== 0 && !c) {
    var u = buildCommon.makeSpan(["mspace"], [], r);
    u.style.marginRight = makeEm(l), s.unshift(u);
  }
  return buildCommon.makeSpan(["mop", "op-limits"], s, r);
}, noSuccessor = ["\\smallint"], htmlBuilder$2 = (n, e) => {
  var t, r, a = !1, l;
  n.type === "supsub" ? (t = n.sup, r = n.sub, l = assertNodeType(n.base, "op"), a = !0) : l = assertNodeType(n, "op");
  var h = e.style, c = !1;
  h.size === Style$1.DISPLAY.size && l.symbol && !utils.contains(noSuccessor, l.name) && (c = !0);
  var d;
  if (l.symbol) {
    var _ = c ? "Size2-Regular" : "Size1-Regular", m = "";
    if ((l.name === "\\oiint" || l.name === "\\oiiint") && (m = l.name.slice(1), l.name = m === "oiint" ? "\\iint" : "\\iiint"), d = buildCommon.makeSymbol(l.name, _, "math", e, ["mop", "op-symbol", c ? "large-op" : "small-op"]), m.length > 0) {
      var y = d.italic, x = buildCommon.staticSvg(m + "Size" + (c ? "2" : "1"), e);
      d = buildCommon.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: d,
          shift: 0
        }, {
          type: "elem",
          elem: x,
          shift: c ? 0.08 : 0
        }]
      }, e), l.name = "\\" + m, d.classes.unshift("mop"), d.italic = y;
    }
  } else if (l.body) {
    var b = buildExpression$1(l.body, e, !0);
    b.length === 1 && b[0] instanceof SymbolNode ? (d = b[0], d.classes[0] = "mop") : d = buildCommon.makeSpan(["mop"], b, e);
  } else {
    for (var A = [], f = 1; f < l.name.length; f++)
      A.push(buildCommon.mathsym(l.name[f], l.mode, e));
    d = buildCommon.makeSpan(["mop"], A, e);
  }
  var s = 0, u = 0;
  return (d instanceof SymbolNode || l.name === "\\oiint" || l.name === "\\oiiint") && !l.suppressBaseShift && (s = (d.height - d.depth) / 2 - e.fontMetrics().axisHeight, u = d.italic), a ? assembleSupSub(d, t, r, e, h, u, s) : (s && (d.style.position = "relative", d.style.top = makeEm(s)), d);
}, mathmlBuilder$1 = (n, e) => {
  var t;
  if (n.symbol)
    t = new MathNode("mo", [makeText(n.name, n.mode)]), utils.contains(noSuccessor, n.name) && t.setAttribute("largeop", "false");
  else if (n.body)
    t = new MathNode("mo", buildExpression(n.body, e));
  else {
    t = new MathNode("mi", [new TextNode(n.name.slice(1))]);
    var r = new MathNode("mo", [makeText("⁡", "text")]);
    n.parentIsSupSub ? t = new MathNode("mrow", [t, r]) : t = newDocumentFragment([t, r]);
  }
  return t;
}, singleCharBigOps = {
  "∏": "\\prod",
  "∐": "\\coprod",
  "∑": "\\sum",
  "⋀": "\\bigwedge",
  "⋁": "\\bigvee",
  "⋂": "\\bigcap",
  "⋃": "\\bigcup",
  "⨀": "\\bigodot",
  "⨁": "\\bigoplus",
  "⨂": "\\bigotimes",
  "⨄": "\\biguplus",
  "⨆": "\\bigsqcup"
};
defineFunction({
  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 = singleCharBigOps[a]), {
      type: "op",
      mode: t.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !0,
      name: a
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
defineFunction({
  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: ordargument(r)
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
var singleCharIntegrals = {
  "∫": "\\int",
  "∬": "\\iint",
  "∭": "\\iiint",
  "∮": "\\oint",
  "∯": "\\oiint",
  "∰": "\\oiiint"
};
defineFunction({
  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: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
defineFunction({
  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: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
defineFunction({
  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 = singleCharIntegrals[r]), {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !0,
      name: r
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
var htmlBuilder$1 = (n, e) => {
  var t, r, a = !1, l;
  n.type === "supsub" ? (t = n.sup, r = n.sub, l = assertNodeType(n.base, "operatorname"), a = !0) : l = assertNodeType(n, "operatorname");
  var h;
  if (l.body.length > 0) {
    for (var c = l.body.map((y) => {
      var x = y.text;
      return typeof x == "string" ? {
        type: "textord",
        mode: y.mode,
        text: x
      } : y;
    }), d = buildExpression$1(c, e.withFont("mathrm"), !0), _ = 0; _ < d.length; _++) {
      var m = d[_];
      m instanceof SymbolNode && (m.text = m.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
    }
    h = buildCommon.makeSpan(["mop"], d, e);
  } else
    h = buildCommon.makeSpan(["mop"], [], e);
  return a ? assembleSupSub(h, t, r, e, e.style, 0, 0) : h;
}, mathmlBuilder = (n, e) => {
  for (var t = buildExpression(n.body, e.withFont("mathrm")), r = !0, a = 0; a < t.length; a++) {
    var l = t[a];
    if (!(l instanceof mathMLTree.SpaceNode)) if (l instanceof mathMLTree.MathNode)
      switch (l.type) {
        case "mi":
        case "mn":
        case "ms":
        case "mspace":
        case "mtext":
          break;
        case "mo": {
          var h = l.children[0];
          l.children.length === 1 && h instanceof mathMLTree.TextNode ? h.text = h.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : r = !1;
          break;
        }
        default:
          r = !1;
      }
    else
      r = !1;
  }
  if (r) {
    var c = t.map((m) => m.toText()).join("");
    t = [new mathMLTree.TextNode(c)];
  }
  var d = new mathMLTree.MathNode("mi", t);
  d.setAttribute("mathvariant", "normal");
  var _ = new mathMLTree.MathNode("mo", [makeText("⁡", "text")]);
  return n.parentIsSupSub ? new mathMLTree.MathNode("mrow", [d, _]) : mathMLTree.newDocumentFragment([d, _]);
};
defineFunction({
  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: ordargument(a),
      alwaysHandleSupSub: r === "\\operatornamewithlimits",
      limits: !1,
      parentIsSupSub: !1
    };
  },
  htmlBuilder: htmlBuilder$1,
  mathmlBuilder
});
defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
defineFunctionBuilders({
  type: "ordgroup",
  htmlBuilder(n, e) {
    return n.semisimple ? buildCommon.makeFragment(buildExpression$1(n.body, e, !1)) : buildCommon.makeSpan(["mord"], buildExpression$1(n.body, e, !0), e);
  },
  mathmlBuilder(n, e) {
    return buildExpressionRow(n.body, e, !0);
  }
});
defineFunction({
  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 = buildGroup$1(n.body, e.havingCrampedStyle()), r = buildCommon.makeLineSpan("overline-line", e), a = e.fontMetrics().defaultRuleThickness, l = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }, {
        type: "kern",
        size: 3 * a
      }, {
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: a
      }]
    }, e);
    return buildCommon.makeSpan(["mord", "overline"], [l], e);
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var r = new mathMLTree.MathNode("mover", [buildGroup(n.body, e), t]);
    return r.setAttribute("accent", "true"), r;
  }
});
defineFunction({
  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: ordargument(r)
    };
  },
  htmlBuilder: (n, e) => {
    var t = buildExpression$1(n.body, e.withPhantom(), !1);
    return buildCommon.makeFragment(t);
  },
  mathmlBuilder: (n, e) => {
    var t = buildExpression(n.body, e);
    return new mathMLTree.MathNode("mphantom", t);
  }
});
defineFunction({
  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 = buildCommon.makeSpan([], [buildGroup$1(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 = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e), buildCommon.makeSpan(["mord"], [t], e);
  },
  mathmlBuilder: (n, e) => {
    var t = buildExpression(ordargument(n.body), e), r = new mathMLTree.MathNode("mphantom", t), a = new mathMLTree.MathNode("mpadded", [r]);
    return a.setAttribute("height", "0px"), a.setAttribute("depth", "0px"), a;
  }
});
defineFunction({
  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 = buildCommon.makeSpan(["inner"], [buildGroup$1(n.body, e.withPhantom())]), r = buildCommon.makeSpan(["fix"], []);
    return buildCommon.makeSpan(["mord", "rlap"], [t, r], e);
  },
  mathmlBuilder: (n, e) => {
    var t = buildExpression(ordargument(n.body), e), r = new mathMLTree.MathNode("mphantom", t), a = new mathMLTree.MathNode("mpadded", [r]);
    return a.setAttribute("width", "0px"), a;
  }
});
defineFunction({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: !0
  },
  handler(n, e) {
    var {
      parser: t
    } = n, r = assertNodeType(e[0], "size").value, a = e[1];
    return {
      type: "raisebox",
      mode: t.mode,
      dy: r,
      body: a
    };
  },
  htmlBuilder(n, e) {
    var t = buildGroup$1(n.body, e), r = calculateSize(n.dy, e);
    return buildCommon.makeVList({
      positionType: "shift",
      positionData: -r,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mpadded", [buildGroup(n.body, e)]), r = n.dy.number + n.dy.unit;
    return t.setAttribute("voffset", r), t;
  }
});
defineFunction({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(n) {
    var {
      parser: e
    } = n;
    return {
      type: "internal",
      mode: e.mode
    };
  }
});
defineFunction({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    argTypes: ["size", "size", "size"]
  },
  handler(n, e, t) {
    var {
      parser: r
    } = n, a = t[0], l = assertNodeType(e[0], "size"), h = assertNodeType(e[1], "size");
    return {
      type: "rule",
      mode: r.mode,
      shift: a && assertNodeType(a, "size").value,
      width: l.value,
      height: h.value
    };
  },
  htmlBuilder(n, e) {
    var t = buildCommon.makeSpan(["mord", "rule"], [], e), r = calculateSize(n.width, e), a = calculateSize(n.height, e), l = n.shift ? calculateSize(n.shift, e) : 0;
    return t.style.borderRightWidth = makeEm(r), t.style.borderTopWidth = makeEm(a), t.style.bottom = makeEm(l), t.width = r, t.height = a + l, t.depth = -l, t.maxFontSize = a * 1.125 * e.sizeMultiplier, t;
  },
  mathmlBuilder(n, e) {
    var t = calculateSize(n.width, e), r = calculateSize(n.height, e), a = n.shift ? calculateSize(n.shift, e) : 0, l = e.color && e.getColor() || "black", h = new mathMLTree.MathNode("mspace");
    h.setAttribute("mathbackground", l), h.setAttribute("width", makeEm(t)), h.setAttribute("height", makeEm(r));
    var c = new mathMLTree.MathNode("mpadded", [h]);
    return a >= 0 ? c.setAttribute("height", makeEm(a)) : (c.setAttribute("height", makeEm(a)), c.setAttribute("depth", makeEm(-a))), c.setAttribute("voffset", makeEm(a)), c;
  }
});
function sizingGroup(n, e, t) {
  for (var r = buildExpression$1(n, e, !1), a = e.sizeMultiplier / t.sizeMultiplier, l = 0; l < r.length; l++) {
    var h = r[l].classes.indexOf("sizing");
    h < 0 ? Array.prototype.push.apply(r[l].classes, e.sizingClasses(t)) : r[l].classes[h + 1] === "reset-size" + e.size && (r[l].classes[h + 1] = "reset-size" + t.size), r[l].height *= a, r[l].depth *= a;
  }
  return buildCommon.makeFragment(r);
}
var sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], htmlBuilder = (n, e) => {
  var t = e.havingSize(n.size);
  return sizingGroup(n.body, t, e);
};
defineFunction({
  type: "sizing",
  names: sizeFuncs,
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (n, e) => {
    var {
      breakOnTokenText: t,
      funcName: r,
      parser: a
    } = n, l = a.parseExpression(!1, t);
    return {
      type: "sizing",
      mode: a.mode,
      // Figure out what size to use based on the list of functions above
      size: sizeFuncs.indexOf(r) + 1,
      body: l
    };
  },
  htmlBuilder,
  mathmlBuilder: (n, e) => {
    var t = e.havingSize(n.size), r = buildExpression(n.body, t), a = new mathMLTree.MathNode("mstyle", r);
    return a.setAttribute("mathsize", makeEm(t.sizeMultiplier)), a;
  }
});
defineFunction({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: !0
  },
  handler: (n, e, t) => {
    var {
      parser: r
    } = n, a = !1, l = !1, h = t[0] && assertNodeType(t[0], "ordgroup");
    if (h)
      for (var c = "", d = 0; d < h.body.length; ++d) {
        var _ = h.body[d];
        if (c = _.text, c === "t")
          a = !0;
        else if (c === "b")
          l = !0;
        else {
          a = !1, l = !1;
          break;
        }
      }
    else
      a = !0, l = !0;
    var m = e[0];
    return {
      type: "smash",
      mode: r.mode,
      body: m,
      smashHeight: a,
      smashDepth: l
    };
  },
  htmlBuilder: (n, e) => {
    var t = buildCommon.makeSpan([], [buildGroup$1(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 l = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
    return buildCommon.makeSpan(["mord"], [l], e);
  },
  mathmlBuilder: (n, e) => {
    var t = new mathMLTree.MathNode("mpadded", [buildGroup(n.body, e)]);
    return n.smashHeight && t.setAttribute("height", "0px"), n.smashDepth && t.setAttribute("depth", "0px"), t;
  }
});
defineFunction({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(n, e, t) {
    var {
      parser: r
    } = n, a = t[0], l = e[0];
    return {
      type: "sqrt",
      mode: r.mode,
      body: l,
      index: a
    };
  },
  htmlBuilder(n, e) {
    var t = buildGroup$1(n.body, e.havingCrampedStyle());
    t.height === 0 && (t.height = e.fontMetrics().xHeight), t = buildCommon.wrapFragment(t, e);
    var r = e.fontMetrics(), a = r.defaultRuleThickness, l = a;
    e.style.id < Style$1.TEXT.id && (l = e.fontMetrics().xHeight);
    var h = a + l / 4, c = t.height + t.depth + h + a, {
      span: d,
      ruleWidth: _,
      advanceWidth: m
    } = delimiter.sqrtImage(c, e), y = d.height - _;
    y > t.height + t.depth + h && (h = (h + y - t.height - t.depth) / 2);
    var x = d.height - t.height - h - _;
    t.style.paddingLeft = makeEm(m);
    var b = buildCommon.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: t,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(t.height + x)
      }, {
        type: "elem",
        elem: d
      }, {
        type: "kern",
        size: _
      }]
    }, e);
    if (n.index) {
      var A = e.havingStyle(Style$1.SCRIPTSCRIPT), f = buildGroup$1(n.index, A, e), s = 0.6 * (b.height - b.depth), u = buildCommon.makeVList({
        positionType: "shift",
        positionData: -s,
        children: [{
          type: "elem",
          elem: f
        }]
      }, e), p = buildCommon.makeSpan(["root"], [u]);
      return buildCommon.makeSpan(["mord", "sqrt"], [p, b], e);
    } else
      return buildCommon.makeSpan(["mord", "sqrt"], [b], e);
  },
  mathmlBuilder(n, e) {
    var {
      body: t,
      index: r
    } = n;
    return r ? new mathMLTree.MathNode("mroot", [buildGroup(t, e), buildGroup(r, e)]) : new mathMLTree.MathNode("msqrt", [buildGroup(t, e)]);
  }
});
var styleMap = {
  display: Style$1.DISPLAY,
  text: Style$1.TEXT,
  script: Style$1.SCRIPT,
  scriptscript: Style$1.SCRIPTSCRIPT
};
defineFunction({
  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, l = a.parseExpression(!0, t), h = 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: h,
      body: l
    };
  },
  htmlBuilder(n, e) {
    var t = styleMap[n.style], r = e.havingStyle(t).withFont("");
    return sizingGroup(n.body, r, e);
  },
  mathmlBuilder(n, e) {
    var t = styleMap[n.style], r = e.havingStyle(t), a = buildExpression(n.body, r), l = new mathMLTree.MathNode("mstyle", a), h = {
      display: ["0", "true"],
      text: ["0", "false"],
      script: ["1", "false"],
      scriptscript: ["2", "false"]
    }, c = h[n.style];
    return l.setAttribute("scriptlevel", c[0]), l.setAttribute("displaystyle", c[1]), l;
  }
});
var htmlBuilderDelegate = function(e, t) {
  var r = e.base;
  if (r)
    if (r.type === "op") {
      var a = r.limits && (t.style.size === Style$1.DISPLAY.size || r.alwaysHandleSupSub);
      return a ? htmlBuilder$2 : null;
    } else if (r.type === "operatorname") {
      var l = r.alwaysHandleSupSub && (t.style.size === Style$1.DISPLAY.size || r.limits);
      return l ? htmlBuilder$1 : null;
    } else {
      if (r.type === "accent")
        return utils.isCharacterBox(r.base) ? htmlBuilder$a : null;
      if (r.type === "horizBrace") {
        var h = !e.sub;
        return h === r.isOver ? htmlBuilder$3 : null;
      } else
        return null;
    }
  else return null;
};
defineFunctionBuilders({
  type: "supsub",
  htmlBuilder(n, e) {
    var t = htmlBuilderDelegate(n, e);
    if (t)
      return t(n, e);
    var {
      base: r,
      sup: a,
      sub: l
    } = n, h = buildGroup$1(r, e), c, d, _ = e.fontMetrics(), m = 0, y = 0, x = r && utils.isCharacterBox(r);
    if (a) {
      var b = e.havingStyle(e.style.sup());
      c = buildGroup$1(a, b, e), x || (m = h.height - b.fontMetrics().supDrop * b.sizeMultiplier / e.sizeMultiplier);
    }
    if (l) {
      var A = e.havingStyle(e.style.sub());
      d = buildGroup$1(l, A, e), x || (y = h.depth + A.fontMetrics().subDrop * A.sizeMultiplier / e.sizeMultiplier);
    }
    var f;
    e.style === Style$1.DISPLAY ? f = _.sup1 : e.style.cramped ? f = _.sup3 : f = _.sup2;
    var s = e.sizeMultiplier, u = makeEm(0.5 / _.ptPerEm / s), p = null;
    if (d) {
      var g = n.base && n.base.type === "op" && n.base.name && (n.base.name === "\\oiint" || n.base.name === "\\oiiint");
      (h instanceof SymbolNode || g) && (p = makeEm(-h.italic));
    }
    var w;
    if (c && d) {
      m = Math.max(m, f, c.depth + 0.25 * _.xHeight), y = Math.max(y, _.sub2);
      var o = _.defaultRuleThickness, v = 4 * o;
      if (m - c.depth - (d.height - y) < v) {
        y = v - (m - c.depth) + d.height;
        var M = 0.8 * _.xHeight - (m - c.depth);
        M > 0 && (m += M, y -= M);
      }
      var E = [{
        type: "elem",
        elem: d,
        shift: y,
        marginRight: u,
        marginLeft: p
      }, {
        type: "elem",
        elem: c,
        shift: -m,
        marginRight: u
      }];
      w = buildCommon.makeVList({
        positionType: "individualShift",
        children: E
      }, e);
    } else if (d) {
      y = Math.max(y, _.sub1, d.height - 0.8 * _.xHeight);
      var $ = [{
        type: "elem",
        elem: d,
        marginLeft: p,
        marginRight: u
      }];
      w = buildCommon.makeVList({
        positionType: "shift",
        positionData: y,
        children: $
      }, e);
    } else if (c)
      m = Math.max(m, f, c.depth + 0.25 * _.xHeight), w = buildCommon.makeVList({
        positionType: "shift",
        positionData: -m,
        children: [{
          type: "elem",
          elem: c,
          marginRight: u
        }]
      }, e);
    else
      throw new Error("supsub must have either sup or sub.");
    var k = getTypeOfDomTree(h, "right") || "mord";
    return buildCommon.makeSpan([k], [h, buildCommon.makeSpan(["msupsub"], [w])], 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 l = [buildGroup(n.base, e)];
    n.sub && l.push(buildGroup(n.sub, e)), n.sup && l.push(buildGroup(n.sup, e));
    var h;
    if (t)
      h = r ? "mover" : "munder";
    else if (n.sub)
      if (n.sup) {
        var _ = n.base;
        _ && _.type === "op" && _.limits && e.style === Style$1.DISPLAY || _ && _.type === "operatorname" && _.alwaysHandleSupSub && (e.style === Style$1.DISPLAY || _.limits) ? h = "munderover" : h = "msubsup";
      } else {
        var d = n.base;
        d && d.type === "op" && d.limits && (e.style === Style$1.DISPLAY || d.alwaysHandleSupSub) || d && d.type === "operatorname" && d.alwaysHandleSupSub && (d.limits || e.style === Style$1.DISPLAY) ? h = "munder" : h = "msub";
      }
    else {
      var c = n.base;
      c && c.type === "op" && c.limits && (e.style === Style$1.DISPLAY || c.alwaysHandleSupSub) || c && c.type === "operatorname" && c.alwaysHandleSupSub && (c.limits || e.style === Style$1.DISPLAY) ? h = "mover" : h = "msup";
    }
    return new mathMLTree.MathNode(h, l);
  }
});
defineFunctionBuilders({
  type: "atom",
  htmlBuilder(n, e) {
    return buildCommon.mathsym(n.text, n.mode, e, ["m" + n.family]);
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mo", [makeText(n.text, n.mode)]);
    if (n.family === "bin") {
      var r = getVariant(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 defaultVariant = {
  mi: "italic",
  mn: "normal",
  mtext: "normal"
};
defineFunctionBuilders({
  type: "mathord",
  htmlBuilder(n, e) {
    return buildCommon.makeOrd(n, e, "mathord");
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mi", [makeText(n.text, n.mode, e)]), r = getVariant(n, e) || "italic";
    return r !== defaultVariant[t.type] && t.setAttribute("mathvariant", r), t;
  }
});
defineFunctionBuilders({
  type: "textord",
  htmlBuilder(n, e) {
    return buildCommon.makeOrd(n, e, "textord");
  },
  mathmlBuilder(n, e) {
    var t = makeText(n.text, n.mode, e), r = getVariant(n, e) || "normal", a;
    return n.mode === "text" ? a = new mathMLTree.MathNode("mtext", [t]) : /[0-9]/.test(n.text) ? a = new mathMLTree.MathNode("mn", [t]) : n.text === "\\prime" ? a = new mathMLTree.MathNode("mo", [t]) : a = new mathMLTree.MathNode("mi", [t]), r !== defaultVariant[a.type] && a.setAttribute("mathvariant", r), a;
  }
});
var cssSpace = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
}, regularSpace = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
defineFunctionBuilders({
  type: "spacing",
  htmlBuilder(n, e) {
    if (regularSpace.hasOwnProperty(n.text)) {
      var t = regularSpace[n.text].className || "";
      if (n.mode === "text") {
        var r = buildCommon.makeOrd(n, e, "textord");
        return r.classes.push(t), r;
      } else
        return buildCommon.makeSpan(["mspace", t], [buildCommon.mathsym(n.text, n.mode, e)], e);
    } else {
      if (cssSpace.hasOwnProperty(n.text))
        return buildCommon.makeSpan(["mspace", cssSpace[n.text]], [], e);
      throw new ParseError('Unknown type of space "' + n.text + '"');
    }
  },
  mathmlBuilder(n, e) {
    var t;
    if (regularSpace.hasOwnProperty(n.text))
      t = new mathMLTree.MathNode("mtext", [new mathMLTree.TextNode(" ")]);
    else {
      if (cssSpace.hasOwnProperty(n.text))
        return new mathMLTree.MathNode("mspace");
      throw new ParseError('Unknown type of space "' + n.text + '"');
    }
    return t;
  }
});
var pad = () => {
  var n = new mathMLTree.MathNode("mtd", []);
  return n.setAttribute("width", "50%"), n;
};
defineFunctionBuilders({
  type: "tag",
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mtable", [new mathMLTree.MathNode("mtr", [pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(n.body, e)]), pad(), new mathMLTree.MathNode("mtd", [buildExpressionRow(n.tag, e)])])]);
    return t.setAttribute("width", "100%"), t;
  }
});
var textFontFamilies = {
  "\\text": void 0,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
}, textFontWeights = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
}, textFontShapes = {
  "\\textit": "textit",
  "\\textup": "textup"
}, optionsWithFont = (n, e) => {
  var t = n.font;
  if (t) {
    if (textFontFamilies[t])
      return e.withTextFontFamily(textFontFamilies[t]);
    if (textFontWeights[t])
      return e.withTextFontWeight(textFontWeights[t]);
    if (t === "\\emph")
      return e.fontShape === "textit" ? e.withTextFontShape("textup") : e.withTextFontShape("textit");
  } else return e;
  return e.withTextFontShape(textFontShapes[t]);
};
defineFunction({
  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: ordargument(a),
      font: r
    };
  },
  htmlBuilder(n, e) {
    var t = optionsWithFont(n, e), r = buildExpression$1(n.body, t, !0);
    return buildCommon.makeSpan(["mord", "text"], r, t);
  },
  mathmlBuilder(n, e) {
    var t = optionsWithFont(n, e);
    return buildExpressionRow(n.body, t);
  }
});
defineFunction({
  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 = buildGroup$1(n.body, e), r = buildCommon.makeLineSpan("underline-line", e), a = e.fontMetrics().defaultRuleThickness, l = buildCommon.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 buildCommon.makeSpan(["mord", "underline"], [l], e);
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode("‾")]);
    t.setAttribute("stretchy", "true");
    var r = new mathMLTree.MathNode("munder", [buildGroup(n.body, e), t]);
    return r.setAttribute("accentunder", "true"), r;
  }
});
defineFunction({
  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 = buildGroup$1(n.body, e), r = e.fontMetrics().axisHeight, a = 0.5 * (t.height - r - (t.depth + r));
    return buildCommon.makeVList({
      positionType: "shift",
      positionData: a,
      children: [{
        type: "elem",
        elem: t
      }]
    }, e);
  },
  mathmlBuilder(n, e) {
    return new mathMLTree.MathNode("mpadded", [buildGroup(n.body, e)], ["vcenter"]);
  }
});
defineFunction({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(n, e, t) {
    throw new ParseError("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(n, e) {
    for (var t = makeVerb(n), r = [], a = e.havingStyle(e.style.text()), l = 0; l < t.length; l++) {
      var h = t[l];
      h === "~" && (h = "\\textasciitilde"), r.push(buildCommon.makeSymbol(h, "Typewriter-Regular", n.mode, a, ["mord", "texttt"]));
    }
    return buildCommon.makeSpan(["mord", "text"].concat(a.sizingClasses(e)), buildCommon.tryCombineChars(r), a);
  },
  mathmlBuilder(n, e) {
    var t = new mathMLTree.TextNode(makeVerb(n)), r = new mathMLTree.MathNode("mtext", [t]);
    return r.setAttribute("mathvariant", "monospace"), r;
  }
});
var makeVerb = (n) => n.body.replace(/ /g, n.star ? "␣" : " "), functions = _functions;
defineMacro("\\noexpand", function(n) {
  var e = n.popToken();
  return n.isExpandable(e.text) && (e.noexpand = !0, e.treatAsRelax = !0), {
    tokens: [e],
    numArgs: 0
  };
});
defineMacro("\\expandafter", function(n) {
  var e = n.popToken();
  return n.expandOnce(!0), {
    tokens: [e],
    numArgs: 0
  };
});
defineMacro("\\@firstoftwo", function(n) {
  var e = n.consumeArgs(2);
  return {
    tokens: e[0],
    numArgs: 0
  };
});
defineMacro("\\@secondoftwo", function(n) {
  var e = n.consumeArgs(2);
  return {
    tokens: e[1],
    numArgs: 0
  };
});
defineMacro("\\@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
  };
});
defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
defineMacro("\\TextOrMath", function(n) {
  var e = n.consumeArgs(2);
  return n.mode === "text" ? {
    tokens: e[0],
    numArgs: 0
  } : {
    tokens: e[1],
    numArgs: 0
  };
});
var digitToNumber = {
  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
};
defineMacro("\\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 ParseError("\\char` missing argument");
      r = e.text.charCodeAt(0);
    }
  else
    t = 10;
  if (t) {
    if (r = digitToNumber[e.text], r == null || r >= t)
      throw new ParseError("Invalid base-" + t + " digit " + e.text);
    for (var a; (a = digitToNumber[n.future().text]) != null && a < t; )
      r *= t, r += a, n.popToken();
  }
  return "\\@char{" + r + "}";
});
var newcommand = (n, e, t) => {
  var r = n.consumeArg().tokens;
  if (r.length !== 1)
    throw new ParseError("\\newcommand's first argument must be a macro name");
  var a = r[0].text, l = n.isDefined(a);
  if (l && !e)
    throw new ParseError("\\newcommand{" + a + "} attempting to redefine " + (a + "; use \\renewcommand"));
  if (!l && !t)
    throw new ParseError("\\renewcommand{" + a + "} when command " + a + " does not yet exist; use \\newcommand");
  var h = 0;
  if (r = n.consumeArg().tokens, r.length === 1 && r[0].text === "[") {
    for (var c = "", d = n.expandNextToken(); d.text !== "]" && d.text !== "EOF"; )
      c += d.text, d = n.expandNextToken();
    if (!c.match(/^\s*[0-9]+\s*$/))
      throw new ParseError("Invalid number of arguments: " + c);
    h = parseInt(c), r = n.consumeArg().tokens;
  }
  return n.macros.set(a, {
    tokens: r,
    numArgs: h
  }), "";
};
defineMacro("\\newcommand", (n) => newcommand(n, !1, !0));
defineMacro("\\renewcommand", (n) => newcommand(n, !0, !1));
defineMacro("\\providecommand", (n) => newcommand(n, !0, !0));
defineMacro("\\message", (n) => {
  var e = n.consumeArgs(1)[0];
  return console.log(e.reverse().map((t) => t.text).join("")), "";
});
defineMacro("\\errmessage", (n) => {
  var e = n.consumeArgs(1)[0];
  return console.error(e.reverse().map((t) => t.text).join("")), "";
});
defineMacro("\\show", (n) => {
  var e = n.popToken(), t = e.text;
  return console.log(e, n.macros.get(t), functions[t], symbols.math[t], symbols.text[t]), "";
});
defineMacro("\\bgroup", "{");
defineMacro("\\egroup", "}");
defineMacro("~", "\\nobreakspace");
defineMacro("\\lq", "`");
defineMacro("\\rq", "'");
defineMacro("\\aa", "\\r a");
defineMacro("\\AA", "\\r A");
defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
defineMacro("ℬ", "\\mathscr{B}");
defineMacro("ℰ", "\\mathscr{E}");
defineMacro("ℱ", "\\mathscr{F}");
defineMacro("ℋ", "\\mathscr{H}");
defineMacro("ℐ", "\\mathscr{I}");
defineMacro("ℒ", "\\mathscr{L}");
defineMacro("ℳ", "\\mathscr{M}");
defineMacro("ℛ", "\\mathscr{R}");
defineMacro("ℭ", "\\mathfrak{C}");
defineMacro("ℌ", "\\mathfrak{H}");
defineMacro("ℨ", "\\mathfrak{Z}");
defineMacro("\\Bbbk", "\\Bbb{k}");
defineMacro("·", "\\cdotp");
defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");
defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");
defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");
defineMacro("\\mathstrut", "\\vphantom{(}");
defineMacro("\\underbar", "\\underline{\\text{#1}}");
defineMacro("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
defineMacro("\\ne", "\\neq");
defineMacro("≠", "\\neq");
defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");
defineMacro("∉", "\\notin");
defineMacro("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");
defineMacro("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");
defineMacro("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");
defineMacro("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");
defineMacro("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");
defineMacro("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");
defineMacro("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");
defineMacro("⟂", "\\perp");
defineMacro("‼", "\\mathclose{!\\mkern-0.8mu!}");
defineMacro("∌", "\\notni");
defineMacro("⌜", "\\ulcorner");
defineMacro("⌝", "\\urcorner");
defineMacro("⌞", "\\llcorner");
defineMacro("⌟", "\\lrcorner");
defineMacro("©", "\\copyright");
defineMacro("®", "\\textregistered");
defineMacro("️", "\\textregistered");
defineMacro("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
defineMacro("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
defineMacro("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
defineMacro("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
defineMacro("\\vdots", "\\mathord{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("⋮", "\\vdots");
defineMacro("\\varGamma", "\\mathit{\\Gamma}");
defineMacro("\\varDelta", "\\mathit{\\Delta}");
defineMacro("\\varTheta", "\\mathit{\\Theta}");
defineMacro("\\varLambda", "\\mathit{\\Lambda}");
defineMacro("\\varXi", "\\mathit{\\Xi}");
defineMacro("\\varPi", "\\mathit{\\Pi}");
defineMacro("\\varSigma", "\\mathit{\\Sigma}");
defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");
defineMacro("\\varPhi", "\\mathit{\\Phi}");
defineMacro("\\varPsi", "\\mathit{\\Psi}");
defineMacro("\\varOmega", "\\mathit{\\Omega}");
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
var dotsByToken = {
  ",": "\\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"
};
defineMacro("\\dots", function(n) {
  var e = "\\dotso", t = n.expandAfterFuture().text;
  return t in dotsByToken ? e = dotsByToken[t] : (t.slice(0, 4) === "\\not" || t in symbols.math && utils.contains(["bin", "rel"], symbols.math[t].group)) && (e = "\\dotsb"), e;
});
var spaceAfterDots = {
  // \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
};
defineMacro("\\dotso", function(n) {
  var e = n.future().text;
  return e in spaceAfterDots ? "\\ldots\\," : "\\ldots";
});
defineMacro("\\dotsc", function(n) {
  var e = n.future().text;
  return e in spaceAfterDots && e !== "," ? "\\ldots\\," : "\\ldots";
});
defineMacro("\\cdots", function(n) {
  var e = n.future().text;
  return e in spaceAfterDots ? "\\@cdots\\," : "\\@cdots";
});
defineMacro("\\dotsb", "\\cdots");
defineMacro("\\dotsm", "\\cdots");
defineMacro("\\dotsi", "\\!\\cdots");
defineMacro("\\dotsx", "\\ldots\\,");
defineMacro("\\DOTSI", "\\relax");
defineMacro("\\DOTSB", "\\relax");
defineMacro("\\DOTSX", "\\relax");
defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
defineMacro("\\thinspace", "\\,");
defineMacro("\\>", "\\mskip{4mu}");
defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
defineMacro("\\medspace", "\\:");
defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");
defineMacro("\\thickspace", "\\;");
defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");
defineMacro("\\negthinspace", "\\!");
defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");
defineMacro("\\enspace", "\\kern.5em ");
defineMacro("\\enskip", "\\hskip.5em\\relax");
defineMacro("\\quad", "\\hskip1em\\relax");
defineMacro("\\qquad", "\\hskip2em\\relax");
defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
defineMacro("\\tag@literal", (n) => {
  if (n.macros.get("\\df@tag"))
    throw new ParseError("Multiple \\tag");
  return "\\gdef\\df@tag{\\text{#1}}";
});
defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
defineMacro("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
defineMacro("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
defineMacro("\\newline", "\\\\\\relax");
defineMacro("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
var latexRaiseA = makeEm(fontMetricsData["Main-Regular"][84][1] - 0.7 * fontMetricsData["Main-Regular"][65][1]);
defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
defineMacro("\\@hspace", "\\hskip #1\\relax");
defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
defineMacro("\\ordinarycolon", ":");
defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
defineMacro("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
defineMacro("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
defineMacro("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
defineMacro("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
defineMacro("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
defineMacro("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
defineMacro("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
defineMacro("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
defineMacro("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
defineMacro("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
defineMacro("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
defineMacro("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
defineMacro("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
defineMacro("∷", "\\dblcolon");
defineMacro("∹", "\\eqcolon");
defineMacro("≔", "\\coloneqq");
defineMacro("≕", "\\eqqcolon");
defineMacro("⩴", "\\Coloneqq");
defineMacro("\\ratio", "\\vcentcolon");
defineMacro("\\coloncolon", "\\dblcolon");
defineMacro("\\colonequals", "\\coloneqq");
defineMacro("\\coloncolonequals", "\\Coloneqq");
defineMacro("\\equalscolon", "\\eqqcolon");
defineMacro("\\equalscoloncolon", "\\Eqqcolon");
defineMacro("\\colonminus", "\\coloneq");
defineMacro("\\coloncolonminus", "\\Coloneq");
defineMacro("\\minuscolon", "\\eqcolon");
defineMacro("\\minuscoloncolon", "\\Eqcolon");
defineMacro("\\coloncolonapprox", "\\Colonapprox");
defineMacro("\\coloncolonsim", "\\Colonsim");
defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");
defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}");
defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}");
defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}");
defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}");
defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{≰}");
defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}");
defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}");
defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}");
defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
defineMacro("\\imath", "\\html@mathml{\\@imath}{ı}");
defineMacro("\\jmath", "\\html@mathml{\\@jmath}{ȷ}");
defineMacro("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");
defineMacro("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");
defineMacro("⟦", "\\llbracket");
defineMacro("⟧", "\\rrbracket");
defineMacro("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
defineMacro("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
defineMacro("⦃", "\\lBrace");
defineMacro("⦄", "\\rBrace");
defineMacro("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
defineMacro("⦵", "\\minuso");
defineMacro("\\darr", "\\downarrow");
defineMacro("\\dArr", "\\Downarrow");
defineMacro("\\Darr", "\\Downarrow");
defineMacro("\\lang", "\\langle");
defineMacro("\\rang", "\\rangle");
defineMacro("\\uarr", "\\uparrow");
defineMacro("\\uArr", "\\Uparrow");
defineMacro("\\Uarr", "\\Uparrow");
defineMacro("\\N", "\\mathbb{N}");
defineMacro("\\R", "\\mathbb{R}");
defineMacro("\\Z", "\\mathbb{Z}");
defineMacro("\\alef", "\\aleph");
defineMacro("\\alefsym", "\\aleph");
defineMacro("\\Alpha", "\\mathrm{A}");
defineMacro("\\Beta", "\\mathrm{B}");
defineMacro("\\bull", "\\bullet");
defineMacro("\\Chi", "\\mathrm{X}");
defineMacro("\\clubs", "\\clubsuit");
defineMacro("\\cnums", "\\mathbb{C}");
defineMacro("\\Complex", "\\mathbb{C}");
defineMacro("\\Dagger", "\\ddagger");
defineMacro("\\diamonds", "\\diamondsuit");
defineMacro("\\empty", "\\emptyset");
defineMacro("\\Epsilon", "\\mathrm{E}");
defineMacro("\\Eta", "\\mathrm{H}");
defineMacro("\\exist", "\\exists");
defineMacro("\\harr", "\\leftrightarrow");
defineMacro("\\hArr", "\\Leftrightarrow");
defineMacro("\\Harr", "\\Leftrightarrow");
defineMacro("\\hearts", "\\heartsuit");
defineMacro("\\image", "\\Im");
defineMacro("\\infin", "\\infty");
defineMacro("\\Iota", "\\mathrm{I}");
defineMacro("\\isin", "\\in");
defineMacro("\\Kappa", "\\mathrm{K}");
defineMacro("\\larr", "\\leftarrow");
defineMacro("\\lArr", "\\Leftarrow");
defineMacro("\\Larr", "\\Leftarrow");
defineMacro("\\lrarr", "\\leftrightarrow");
defineMacro("\\lrArr", "\\Leftrightarrow");
defineMacro("\\Lrarr", "\\Leftrightarrow");
defineMacro("\\Mu", "\\mathrm{M}");
defineMacro("\\natnums", "\\mathbb{N}");
defineMacro("\\Nu", "\\mathrm{N}");
defineMacro("\\Omicron", "\\mathrm{O}");
defineMacro("\\plusmn", "\\pm");
defineMacro("\\rarr", "\\rightarrow");
defineMacro("\\rArr", "\\Rightarrow");
defineMacro("\\Rarr", "\\Rightarrow");
defineMacro("\\real", "\\Re");
defineMacro("\\reals", "\\mathbb{R}");
defineMacro("\\Reals", "\\mathbb{R}");
defineMacro("\\Rho", "\\mathrm{P}");
defineMacro("\\sdot", "\\cdot");
defineMacro("\\sect", "\\S");
defineMacro("\\spades", "\\spadesuit");
defineMacro("\\sub", "\\subset");
defineMacro("\\sube", "\\subseteq");
defineMacro("\\supe", "\\supseteq");
defineMacro("\\Tau", "\\mathrm{T}");
defineMacro("\\thetasym", "\\vartheta");
defineMacro("\\weierp", "\\wp");
defineMacro("\\Zeta", "\\mathrm{Z}");
defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");
defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");
defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
defineMacro("\\Bra", "\\left\\langle#1\\right|");
defineMacro("\\Ket", "\\left|#1\\right\\rangle");
var braketHelper = (n) => (e) => {
  var t = e.consumeArg().tokens, r = e.consumeArg().tokens, a = e.consumeArg().tokens, l = e.consumeArg().tokens, h = e.macros.get("|"), c = e.macros.get("\\|");
  e.macros.beginGroup();
  var d = (y) => (x) => {
    n && (x.macros.set("|", h), a.length && x.macros.set("\\|", c));
    var b = y;
    if (!y && a.length) {
      var A = x.future();
      A.text === "|" && (x.popToken(), b = !0);
    }
    return {
      tokens: b ? a : r,
      numArgs: 0
    };
  };
  e.macros.set("|", d(!1)), a.length && e.macros.set("\\|", d(!0));
  var _ = e.consumeArg().tokens, m = e.expandTokens([
    ...l,
    ..._,
    ...t
    // reversed
  ]);
  return e.macros.endGroup(), {
    tokens: m.reverse(),
    numArgs: 0
  };
};
defineMacro("\\bra@ket", braketHelper(!1));
defineMacro("\\bra@set", braketHelper(!0));
defineMacro("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
defineMacro("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
defineMacro("\\angln", "{\\angl n}");
defineMacro("\\blue", "\\textcolor{##6495ed}{#1}");
defineMacro("\\orange", "\\textcolor{##ffa500}{#1}");
defineMacro("\\pink", "\\textcolor{##ff00af}{#1}");
defineMacro("\\red", "\\textcolor{##df0030}{#1}");
defineMacro("\\green", "\\textcolor{##28ae7b}{#1}");
defineMacro("\\gray", "\\textcolor{gray}{#1}");
defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}");
defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}");
defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}");
defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}");
defineMacro("\\blueD", "\\textcolor{##11accd}{#1}");
defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}");
defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}");
defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}");
defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}");
defineMacro("\\tealD", "\\textcolor{##01a995}{#1}");
defineMacro("\\tealE", "\\textcolor{##208170}{#1}");
defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}");
defineMacro("\\greenB", "\\textcolor{##8af281}{#1}");
defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}");
defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}");
defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}");
defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}");
defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}");
defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}");
defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}");
defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}");
defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}");
defineMacro("\\redB", "\\textcolor{##ff8482}{#1}");
defineMacro("\\redC", "\\textcolor{##f9685d}{#1}");
defineMacro("\\redD", "\\textcolor{##e84d39}{#1}");
defineMacro("\\redE", "\\textcolor{##bc2612}{#1}");
defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}");
defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}");
defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}");
defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}");
defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}");
defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}");
defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}");
defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}");
defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}");
defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}");
defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}");
defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}");
defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}");
defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}");
defineMacro("\\grayE", "\\textcolor{##babec2}{#1}");
defineMacro("\\grayF", "\\textcolor{##888d93}{#1}");
defineMacro("\\grayG", "\\textcolor{##626569}{#1}");
defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}");
defineMacro("\\grayI", "\\textcolor{##21242c}{#1}");
defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}");
defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");
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.");
function _getDefaults() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null
  };
}
let _defaults = _getDefaults();
function changeDefaults(n) {
  _defaults = n;
}
const escapeTest = /[&<>"']/, escapeReplace = new RegExp(escapeTest.source, "g"), escapeTestNoEncode = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode = new RegExp(escapeTestNoEncode.source, "g"), escapeReplacements = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, getEscapeReplacement = (n) => escapeReplacements[n];
function escape$1(n, e) {
  if (e) {
    if (escapeTest.test(n))
      return n.replace(escapeReplace, getEscapeReplacement);
  } else if (escapeTestNoEncode.test(n))
    return n.replace(escapeReplaceNoEncode, getEscapeReplacement);
  return n;
}
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function unescape(n) {
  return n.replace(unescapeTest, (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 caret = /(^|[^\[])\^/g;
function edit(n, e) {
  let t = typeof n == "string" ? n : n.source;
  e = e || "";
  const r = {
    replace: (a, l) => {
      let h = typeof l == "string" ? l : l.source;
      return h = h.replace(caret, "$1"), t = t.replace(a, h), r;
    },
    getRegex: () => new RegExp(t, e)
  };
  return r;
}
function cleanUrl(n) {
  try {
    n = encodeURI(n).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return n;
}
const noopTest = { exec: () => null };
function splitCells(n, e) {
  const t = n.replace(/\|/g, (l, h, c) => {
    let d = !1, _ = h;
    for (; --_ >= 0 && c[_] === "\\"; )
      d = !d;
    return d ? "|" : " |";
  }), 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 rtrim(n, e, t) {
  const r = n.length;
  if (r === 0)
    return "";
  let a = 0;
  for (; a < r; ) {
    const l = n.charAt(r - a - 1);
    if (l === e && !t)
      a++;
    else if (l !== e && t)
      a++;
    else
      break;
  }
  return n.slice(0, r - a);
}
function findClosingBracket(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 outputLink(n, e, t, r) {
  const a = e.href, l = e.title ? escape$1(e.title) : null, h = n[1].replace(/\\([\[\]])/g, "$1");
  if (n[0].charAt(0) !== "!") {
    r.state.inLink = !0;
    const c = {
      type: "link",
      raw: t,
      href: a,
      title: l,
      text: h,
      tokens: r.inlineTokens(h)
    };
    return r.state.inLink = !1, c;
  }
  return {
    type: "image",
    raw: t,
    href: a,
    title: l,
    text: escape$1(h)
  };
}
function indentCodeCompensation(n, e) {
  const t = n.match(/^(\s+)(?:```)/);
  if (t === null)
    return e;
  const r = t[1];
  return e.split(`
`).map((a) => {
    const l = a.match(/^\s+/);
    if (l === null)
      return a;
    const [h] = l;
    return h.length >= r.length ? a.slice(r.length) : a;
  }).join(`
`);
}
class _Tokenizer {
  // set by the lexer
  constructor(e) {
    Ft(this, "options");
    Ft(this, "rules");
    // set by the lexer
    Ft(this, "lexer");
    this.options = e || _defaults;
  }
  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 : rtrim(r, `
`)
      };
    }
  }
  fences(e) {
    const t = this.rules.block.fences.exec(e);
    if (t) {
      const r = t[0], a = indentCodeCompensation(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 = rtrim(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 = rtrim(r.replace(/^ *>[ \t]?/gm, ""), `
`);
      const a = this.lexer.state.top;
      this.lexer.state.top = !0;
      const l = this.lexer.blockTokens(r);
      return this.lexer.state.top = a, {
        type: "blockquote",
        raw: t[0],
        tokens: l,
        text: r
      };
    }
  }
  list(e) {
    let t = this.rules.block.list.exec(e);
    if (t) {
      let r = t[1].trim();
      const a = r.length > 1, l = {
        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 h = new RegExp(`^( {0,3}${r})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let c = "", d = "", _ = !1;
      for (; e; ) {
        let m = !1;
        if (!(t = h.exec(e)) || this.rules.block.hr.test(e))
          break;
        c = t[0], e = e.substring(c.length);
        let y = t[2].split(`
`, 1)[0].replace(/^\t+/, (u) => " ".repeat(3 * u.length)), x = e.split(`
`, 1)[0], b = 0;
        this.options.pedantic ? (b = 2, d = y.trimStart()) : (b = t[2].search(/[^ ]/), b = b > 4 ? 1 : b, d = y.slice(b), b += t[1].length);
        let A = !1;
        if (!y && /^ *$/.test(x) && (c += x + `
`, e = e.substring(x.length + 1), m = !0), !m) {
          const u = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), p = new RegExp(`^ {0,${Math.min(3, b - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), g = new RegExp(`^ {0,${Math.min(3, b - 1)}}(?:\`\`\`|~~~)`), w = new RegExp(`^ {0,${Math.min(3, b - 1)}}#`);
          for (; e; ) {
            const o = e.split(`
`, 1)[0];
            if (x = o, this.options.pedantic && (x = x.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), g.test(x) || w.test(x) || u.test(x) || p.test(e))
              break;
            if (x.search(/[^ ]/) >= b || !x.trim())
              d += `
` + x.slice(b);
            else {
              if (A || y.search(/[^ ]/) >= 4 || g.test(y) || w.test(y) || p.test(y))
                break;
              d += `
` + x;
            }
            !A && !x.trim() && (A = !0), c += o + `
`, e = e.substring(o.length + 1), y = x.slice(b);
          }
        }
        l.loose || (_ ? l.loose = !0 : /\n *\n *$/.test(c) && (_ = !0));
        let f = null, s;
        this.options.gfm && (f = /^\[[ xX]\] /.exec(d), f && (s = f[0] !== "[ ] ", d = d.replace(/^\[[ xX]\] +/, ""))), l.items.push({
          type: "list_item",
          raw: c,
          task: !!f,
          checked: s,
          loose: !1,
          text: d,
          tokens: []
        }), l.raw += c;
      }
      l.items[l.items.length - 1].raw = c.trimEnd(), l.items[l.items.length - 1].text = d.trimEnd(), l.raw = l.raw.trimEnd();
      for (let m = 0; m < l.items.length; m++)
        if (this.lexer.state.top = !1, l.items[m].tokens = this.lexer.blockTokens(l.items[m].text, []), !l.loose) {
          const y = l.items[m].tokens.filter((b) => b.type === "space"), x = y.length > 0 && y.some((b) => /\n.*\n/.test(b.raw));
          l.loose = x;
        }
      if (l.loose)
        for (let m = 0; m < l.items.length; m++)
          l.items[m].loose = !0;
      return l;
    }
  }
  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") : "", l = 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: l
      };
    }
  }
  table(e) {
    const t = this.rules.block.table.exec(e);
    if (!t || !/[:|]/.test(t[2]))
      return;
    const r = splitCells(t[1]), a = t[2].replace(/^\||\| *$/g, "").split("|"), l = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
`) : [], h = {
      type: "table",
      raw: t[0],
      header: [],
      align: [],
      rows: []
    };
    if (r.length === a.length) {
      for (const c of a)
        /^ *-+: *$/.test(c) ? h.align.push("right") : /^ *:-+: *$/.test(c) ? h.align.push("center") : /^ *:-+ *$/.test(c) ? h.align.push("left") : h.align.push(null);
      for (const c of r)
        h.header.push({
          text: c,
          tokens: this.lexer.inline(c)
        });
      for (const c of l)
        h.rows.push(splitCells(c, h.header.length).map((d) => ({
          text: d,
          tokens: this.lexer.inline(d)
        })));
      return h;
    }
  }
  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: escape$1(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 h = rtrim(r.slice(0, -1), "\\");
        if ((r.length - h.length) % 2 === 0)
          return;
      } else {
        const h = findClosingBracket(t[2], "()");
        if (h > -1) {
          const d = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + h;
          t[2] = t[2].substring(0, h), t[0] = t[0].substring(0, d).trim(), t[3] = "";
        }
      }
      let a = t[2], l = "";
      if (this.options.pedantic) {
        const h = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);
        h && (a = h[1], l = h[3]);
      } else
        l = 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)), outputLink(t, {
        href: a && a.replace(this.rules.inline.anyPunctuation, "$1"),
        title: l && l.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, " "), l = t[a.toLowerCase()];
      if (!l) {
        const h = r[0].charAt(0);
        return {
          type: "text",
          raw: h,
          text: h
        };
      }
      return outputLink(r, l, 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 h = [...a[0]].length - 1;
      let c, d, _ = h, m = 0;
      const y = a[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (y.lastIndex = 0, t = t.slice(-1 * e.length + h); (a = y.exec(t)) != null; ) {
        if (c = a[1] || a[2] || a[3] || a[4] || a[5] || a[6], !c)
          continue;
        if (d = [...c].length, a[3] || a[4]) {
          _ += d;
          continue;
        } else if ((a[5] || a[6]) && h % 3 && !((h + d) % 3)) {
          m += d;
          continue;
        }
        if (_ -= d, _ > 0)
          continue;
        d = Math.min(d, d + _ + m);
        const x = [...a[0]][0].length, b = e.slice(0, h + a.index + x + d);
        if (Math.min(h, d) % 2) {
          const f = b.slice(1, -1);
          return {
            type: "em",
            raw: b,
            text: f,
            tokens: this.lexer.inlineTokens(f)
          };
        }
        const A = b.slice(2, -2);
        return {
          type: "strong",
          raw: b,
          text: A,
          tokens: this.lexer.inlineTokens(A)
        };
      }
    }
  }
  codespan(e) {
    const t = this.rules.inline.code.exec(e);
    if (t) {
      let r = t[2].replace(/\n/g, " ");
      const a = /[^ ]/.test(r), l = /^ /.test(r) && / $/.test(r);
      return a && l && (r = r.substring(1, r.length - 1)), r = escape$1(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 = escape$1(t[1]), a = "mailto:" + r) : (r = escape$1(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, l;
      if (t[2] === "@")
        a = escape$1(t[0]), l = "mailto:" + a;
      else {
        let h;
        do
          h = t[0], t[0] = ((r = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : r[0]) ?? "";
        while (h !== t[0]);
        a = escape$1(t[0]), t[1] === "www." ? l = "http://" + t[0] : l = t[0];
      }
      return {
        type: "link",
        raw: t[0],
        text: a,
        href: l,
        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 = escape$1(t[0]), {
        type: "text",
        raw: t[0],
        text: r
      };
    }
  }
}
const newline = /^(?: *(?:\n|$))+/, blockCode = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bullet = /(?:[*+-]|\d{1,9}[.)])/, lheading = edit(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, bullet).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(), _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, blockText = /^[^\n]+/, _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/, def = edit(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex(), _tag = "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", _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, html$2 = edit("^ {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", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), paragraph = edit(_paragraph).replace("hr", hr).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", _tag).getRegex(), blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex(), blockNormal = {
  blockquote,
  code: blockCode,
  def,
  fences,
  heading,
  hr,
  html: html$2,
  lheading,
  list,
  newline,
  paragraph,
  table: noopTest,
  text: blockText
}, gfmTable = edit("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", hr).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", _tag).getRegex(), blockGfm = {
  ...blockNormal,
  table: gfmTable,
  paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).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", _tag).getRegex()
}, blockPedantic = {
  ...blockNormal,
  html: edit(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", _comment).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: noopTest,
  // fences not supported
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  paragraph: edit(_paragraph).replace("hr", hr).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, escape = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, br = /^( {2,}|\\)\n(?!\s*$)/, inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _punctuation = "\\p{P}\\p{S}", punctuation = edit(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, _punctuation).getRegex(), blockSkip = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, emStrongLDelim = edit(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimAst = edit("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, _punctuation).getRegex(), emStrongRDelimUnd = edit("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, _punctuation).getRegex(), anyPunctuation = edit(/\\([punct])/, "gu").replace(/punct/g, _punctuation).getRegex(), autolink = edit(/^<(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(), _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex(), tag = edit("^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", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, link = edit(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex(), nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex(), reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex(), inlineNormal = {
  _backpedal: noopTest,
  // only used for GFM url
  anyPunctuation,
  autolink,
  blockSkip,
  br,
  code: inlineCode,
  del: noopTest,
  emStrongLDelim,
  emStrongRDelimAst,
  emStrongRDelimUnd,
  escape,
  link,
  nolink,
  punctuation,
  reflink,
  reflinkSearch,
  tag,
  text: inlineText,
  url: noopTest
}, inlinePedantic = {
  ...inlineNormal,
  link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(),
  reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex()
}, inlineGfm = {
  ...inlineNormal,
  escape: edit(escape).replace("])", "~|])").getRegex(),
  url: edit(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, inlineBreaks = {
  ...inlineGfm,
  br: edit(br).replace("{2,}", "*").getRegex(),
  text: edit(inlineGfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, block = {
  normal: blockNormal,
  gfm: blockGfm,
  pedantic: blockPedantic
}, inline = {
  normal: inlineNormal,
  gfm: inlineGfm,
  breaks: inlineBreaks,
  pedantic: inlinePedantic
};
class _Lexer {
  constructor(e) {
    Ft(this, "tokens");
    Ft(this, "options");
    Ft(this, "state");
    Ft(this, "tokenizer");
    Ft(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || _defaults, this.options.tokenizer = this.options.tokenizer || new _Tokenizer(), 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: block.normal,
      inline: inline.normal
    };
    this.options.pedantic ? (t.block = block.pedantic, t.inline = inline.pedantic) : this.options.gfm && (t.block = block.gfm, this.options.breaks ? t.inline = inline.breaks : t.inline = inline.gfm), this.tokenizer.rules = t;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block,
      inline
    };
  }
  /**
   * Static Lex Method
   */
  static lex(e, t) {
    return new _Lexer(t).lex(e);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(e, t) {
    return new _Lexer(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, (c, d, _) => d + "    ".repeat(_.length));
    let r, a, l, h;
    for (; e; )
      if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((c) => (r = c.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 (l = e, this.options.extensions && this.options.extensions.startBlock) {
          let c = 1 / 0;
          const d = e.slice(1);
          let _;
          this.options.extensions.startBlock.forEach((m) => {
            _ = m.call({ lexer: this }, d), typeof _ == "number" && _ >= 0 && (c = Math.min(c, _));
          }), c < 1 / 0 && c >= 0 && (l = e.substring(0, c + 1));
        }
        if (this.state.top && (r = this.tokenizer.paragraph(l))) {
          a = t[t.length - 1], h && 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), h = l.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 c = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(c);
            break;
          } else
            throw new Error(c);
        }
      }
    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, l, h = e, c, d, _;
    if (this.tokens.links) {
      const m = Object.keys(this.tokens.links);
      if (m.length > 0)
        for (; (c = this.tokenizer.rules.inline.reflinkSearch.exec(h)) != null; )
          m.includes(c[0].slice(c[0].lastIndexOf("[") + 1, -1)) && (h = h.slice(0, c.index) + "[" + "a".repeat(c[0].length - 2) + "]" + h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (c = this.tokenizer.rules.inline.blockSkip.exec(h)) != null; )
      h = h.slice(0, c.index) + "[" + "a".repeat(c[0].length - 2) + "]" + h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (c = this.tokenizer.rules.inline.anyPunctuation.exec(h)) != null; )
      h = h.slice(0, c.index) + "++" + h.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (d || (_ = ""), d = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((m) => (r = m.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, h, _)) {
          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 (l = e, this.options.extensions && this.options.extensions.startInline) {
          let m = 1 / 0;
          const y = e.slice(1);
          let x;
          this.options.extensions.startInline.forEach((b) => {
            x = b.call({ lexer: this }, y), typeof x == "number" && x >= 0 && (m = Math.min(m, x));
          }), m < 1 / 0 && m >= 0 && (l = e.substring(0, m + 1));
        }
        if (r = this.tokenizer.inlineText(l)) {
          e = e.substring(r.raw.length), r.raw.slice(-1) !== "_" && (_ = r.raw.slice(-1)), d = !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 m = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(m);
            break;
          } else
            throw new Error(m);
        }
      }
    return t;
  }
}
class _Renderer {
  constructor(e) {
    Ft(this, "options");
    this.options = e || _defaults;
  }
  code(e, t, r) {
    var l;
    const a = (l = (t || "").match(/^\S*/)) == null ? void 0 : l[0];
    return e = e.replace(/\n$/, "") + `
`, a ? '<pre><code class="language-' + escape$1(a) + '">' + (r ? e : escape$1(e, !0)) + `</code></pre>
` : "<pre><code>" + (r ? e : escape$1(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", l = t && r !== 1 ? ' start="' + r + '"' : "";
    return "<" + a + l + `>
` + 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 = cleanUrl(e);
    if (a === null)
      return r;
    e = a;
    let l = '<a href="' + e + '"';
    return t && (l += ' title="' + t + '"'), l += ">" + r + "</a>", l;
  }
  image(e, t, r) {
    const a = cleanUrl(e);
    if (a === null)
      return r;
    e = a;
    let l = `<img src="${e}" alt="${r}"`;
    return t && (l += ` title="${t}"`), l += ">", l;
  }
  text(e) {
    return e;
  }
}
class _TextRenderer {
  // 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 _Parser {
  constructor(e) {
    Ft(this, "options");
    Ft(this, "renderer");
    Ft(this, "textRenderer");
    this.options = e || _defaults, this.options.renderer = this.options.renderer || new _Renderer(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new _TextRenderer();
  }
  /**
   * Static Parse Method
   */
  static parse(e, t) {
    return new _Parser(t).parse(e);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(e, t) {
    return new _Parser(t).parseInline(e);
  }
  /**
   * Parse Loop
   */
  parse(e, t = !0) {
    let r = "";
    for (let a = 0; a < e.length; a++) {
      const l = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[l.type]) {
        const h = l, c = this.options.extensions.renderers[h.type].call({ parser: this }, h);
        if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(h.type)) {
          r += c || "";
          continue;
        }
      }
      switch (l.type) {
        case "space":
          continue;
        case "hr": {
          r += this.renderer.hr();
          continue;
        }
        case "heading": {
          const h = l;
          r += this.renderer.heading(this.parseInline(h.tokens), h.depth, unescape(this.parseInline(h.tokens, this.textRenderer)));
          continue;
        }
        case "code": {
          const h = l;
          r += this.renderer.code(h.text, h.lang, !!h.escaped);
          continue;
        }
        case "table": {
          const h = l;
          let c = "", d = "";
          for (let m = 0; m < h.header.length; m++)
            d += this.renderer.tablecell(this.parseInline(h.header[m].tokens), { header: !0, align: h.align[m] });
          c += this.renderer.tablerow(d);
          let _ = "";
          for (let m = 0; m < h.rows.length; m++) {
            const y = h.rows[m];
            d = "";
            for (let x = 0; x < y.length; x++)
              d += this.renderer.tablecell(this.parseInline(y[x].tokens), { header: !1, align: h.align[x] });
            _ += this.renderer.tablerow(d);
          }
          r += this.renderer.table(c, _);
          continue;
        }
        case "blockquote": {
          const h = l, c = this.parse(h.tokens);
          r += this.renderer.blockquote(c);
          continue;
        }
        case "list": {
          const h = l, c = h.ordered, d = h.start, _ = h.loose;
          let m = "";
          for (let y = 0; y < h.items.length; y++) {
            const x = h.items[y], b = x.checked, A = x.task;
            let f = "";
            if (x.task) {
              const s = this.renderer.checkbox(!!b);
              _ ? x.tokens.length > 0 && x.tokens[0].type === "paragraph" ? (x.tokens[0].text = s + " " + x.tokens[0].text, x.tokens[0].tokens && x.tokens[0].tokens.length > 0 && x.tokens[0].tokens[0].type === "text" && (x.tokens[0].tokens[0].text = s + " " + x.tokens[0].tokens[0].text)) : x.tokens.unshift({
                type: "text",
                text: s + " "
              }) : f += s + " ";
            }
            f += this.parse(x.tokens, _), m += this.renderer.listitem(f, A, !!b);
          }
          r += this.renderer.list(m, c, d);
          continue;
        }
        case "html": {
          const h = l;
          r += this.renderer.html(h.text, h.block);
          continue;
        }
        case "paragraph": {
          const h = l;
          r += this.renderer.paragraph(this.parseInline(h.tokens));
          continue;
        }
        case "text": {
          let h = l, c = h.tokens ? this.parseInline(h.tokens) : h.text;
          for (; a + 1 < e.length && e[a + 1].type === "text"; )
            h = e[++a], c += `
` + (h.tokens ? this.parseInline(h.tokens) : h.text);
          r += t ? this.renderer.paragraph(c) : c;
          continue;
        }
        default: {
          const h = 'Token with "' + l.type + '" type was not found.';
          if (this.options.silent)
            return console.error(h), "";
          throw new Error(h);
        }
      }
    }
    return r;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(e, t) {
    t = t || this.renderer;
    let r = "";
    for (let a = 0; a < e.length; a++) {
      const l = e[a];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[l.type]) {
        const h = this.options.extensions.renderers[l.type].call({ parser: this }, l);
        if (h !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(l.type)) {
          r += h || "";
          continue;
        }
      }
      switch (l.type) {
        case "escape": {
          const h = l;
          r += t.text(h.text);
          break;
        }
        case "html": {
          const h = l;
          r += t.html(h.text);
          break;
        }
        case "link": {
          const h = l;
          r += t.link(h.href, h.title, this.parseInline(h.tokens, t));
          break;
        }
        case "image": {
          const h = l;
          r += t.image(h.href, h.title, h.text);
          break;
        }
        case "strong": {
          const h = l;
          r += t.strong(this.parseInline(h.tokens, t));
          break;
        }
        case "em": {
          const h = l;
          r += t.em(this.parseInline(h.tokens, t));
          break;
        }
        case "codespan": {
          const h = l;
          r += t.codespan(h.text);
          break;
        }
        case "br": {
          r += t.br();
          break;
        }
        case "del": {
          const h = l;
          r += t.del(this.parseInline(h.tokens, t));
          break;
        }
        case "text": {
          const h = l;
          r += t.text(h.text);
          break;
        }
        default: {
          const h = 'Token with "' + l.type + '" type was not found.';
          if (this.options.silent)
            return console.error(h), "";
          throw new Error(h);
        }
      }
    }
    return r;
  }
}
class _Hooks {
  constructor(e) {
    Ft(this, "options");
    this.options = e || _defaults;
  }
  /**
   * 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;
  }
}
Ft(_Hooks, "passThroughHooks", /* @__PURE__ */ new Set([
  "preprocess",
  "postprocess",
  "processAllTokens"
]));
var Mr, Di, Fn;
class Marked {
  constructor(...e) {
    Mi(this, Mr);
    Ft(this, "defaults", _getDefaults());
    Ft(this, "options", this.setOptions);
    Ft(this, "parse", ui(this, Mr, Di).call(this, _Lexer.lex, _Parser.parse));
    Ft(this, "parseInline", ui(this, Mr, Di).call(this, _Lexer.lexInline, _Parser.parseInline));
    Ft(this, "Parser", _Parser);
    Ft(this, "Renderer", _Renderer);
    Ft(this, "TextRenderer", _TextRenderer);
    Ft(this, "Lexer", _Lexer);
    Ft(this, "Tokenizer", _Tokenizer);
    Ft(this, "Hooks", _Hooks);
    this.use(...e);
  }
  /**
   * Run callback for every token
   */
  walkTokens(e, t) {
    var a, l;
    let r = [];
    for (const h of e)
      switch (r = r.concat(t.call(this, h)), h.type) {
        case "table": {
          const c = h;
          for (const d of c.header)
            r = r.concat(this.walkTokens(d.tokens, t));
          for (const d of c.rows)
            for (const _ of d)
              r = r.concat(this.walkTokens(_.tokens, t));
          break;
        }
        case "list": {
          const c = h;
          r = r.concat(this.walkTokens(c.items, t));
          break;
        }
        default: {
          const c = h;
          (l = (a = this.defaults.extensions) == null ? void 0 : a.childTokens) != null && l[c.type] ? this.defaults.extensions.childTokens[c.type].forEach((d) => {
            const _ = c[d].flat(1 / 0);
            r = r.concat(this.walkTokens(_, t));
          }) : c.tokens && (r = r.concat(this.walkTokens(c.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((l) => {
        if (!l.name)
          throw new Error("extension name required");
        if ("renderer" in l) {
          const h = t.renderers[l.name];
          h ? t.renderers[l.name] = function(...c) {
            let d = l.renderer.apply(this, c);
            return d === !1 && (d = h.apply(this, c)), d;
          } : t.renderers[l.name] = l.renderer;
        }
        if ("tokenizer" in l) {
          if (!l.level || l.level !== "block" && l.level !== "inline")
            throw new Error("extension level must be 'block' or 'inline'");
          const h = t[l.level];
          h ? h.unshift(l.tokenizer) : t[l.level] = [l.tokenizer], l.start && (l.level === "block" ? t.startBlock ? t.startBlock.push(l.start) : t.startBlock = [l.start] : l.level === "inline" && (t.startInline ? t.startInline.push(l.start) : t.startInline = [l.start]));
        }
        "childTokens" in l && l.childTokens && (t.childTokens[l.name] = l.childTokens);
      }), a.extensions = t), r.renderer) {
        const l = this.defaults.renderer || new _Renderer(this.defaults);
        for (const h in r.renderer) {
          if (!(h in l))
            throw new Error(`renderer '${h}' does not exist`);
          if (h === "options")
            continue;
          const c = h, d = r.renderer[c], _ = l[c];
          l[c] = (...m) => {
            let y = d.apply(l, m);
            return y === !1 && (y = _.apply(l, m)), y || "";
          };
        }
        a.renderer = l;
      }
      if (r.tokenizer) {
        const l = this.defaults.tokenizer || new _Tokenizer(this.defaults);
        for (const h in r.tokenizer) {
          if (!(h in l))
            throw new Error(`tokenizer '${h}' does not exist`);
          if (["options", "rules", "lexer"].includes(h))
            continue;
          const c = h, d = r.tokenizer[c], _ = l[c];
          l[c] = (...m) => {
            let y = d.apply(l, m);
            return y === !1 && (y = _.apply(l, m)), y;
          };
        }
        a.tokenizer = l;
      }
      if (r.hooks) {
        const l = this.defaults.hooks || new _Hooks();
        for (const h in r.hooks) {
          if (!(h in l))
            throw new Error(`hook '${h}' does not exist`);
          if (h === "options")
            continue;
          const c = h, d = r.hooks[c], _ = l[c];
          _Hooks.passThroughHooks.has(h) ? l[c] = (m) => {
            if (this.defaults.async)
              return Promise.resolve(d.call(l, m)).then((x) => _.call(l, x));
            const y = d.call(l, m);
            return _.call(l, y);
          } : l[c] = (...m) => {
            let y = d.apply(l, m);
            return y === !1 && (y = _.apply(l, m)), y;
          };
        }
        a.hooks = l;
      }
      if (r.walkTokens) {
        const l = this.defaults.walkTokens, h = r.walkTokens;
        a.walkTokens = function(c) {
          let d = [];
          return d.push(h.call(this, c)), l && (d = d.concat(l.call(this, c))), d;
        };
      }
      this.defaults = { ...this.defaults, ...a };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, t) {
    return _Lexer.lex(e, t ?? this.defaults);
  }
  parser(e, t) {
    return _Parser.parse(e, t ?? this.defaults);
  }
}
Mr = new WeakSet(), Di = function(e, t) {
  return (r, a) => {
    const l = { ...a }, h = { ...this.defaults, ...l };
    this.defaults.async === !0 && l.async === !1 && (h.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), h.async = !0);
    const c = ui(this, Mr, Fn).call(this, !!h.silent, !!h.async);
    if (typeof r > "u" || r === null)
      return c(new Error("marked(): input parameter is undefined or null"));
    if (typeof r != "string")
      return c(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(r) + ", string expected"));
    if (h.hooks && (h.hooks.options = h), h.async)
      return Promise.resolve(h.hooks ? h.hooks.preprocess(r) : r).then((d) => e(d, h)).then((d) => h.hooks ? h.hooks.processAllTokens(d) : d).then((d) => h.walkTokens ? Promise.all(this.walkTokens(d, h.walkTokens)).then(() => d) : d).then((d) => t(d, h)).then((d) => h.hooks ? h.hooks.postprocess(d) : d).catch(c);
    try {
      h.hooks && (r = h.hooks.preprocess(r));
      let d = e(r, h);
      h.hooks && (d = h.hooks.processAllTokens(d)), h.walkTokens && this.walkTokens(d, h.walkTokens);
      let _ = t(d, h);
      return h.hooks && (_ = h.hooks.postprocess(_)), _;
    } catch (d) {
      return c(d);
    }
  };
}, Fn = 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>" + escape$1(r.message + "", !0) + "</pre>";
      return t ? Promise.resolve(a) : a;
    }
    if (t)
      return Promise.reject(r);
    throw r;
  };
};
const markedInstance = new Marked();
function marked(n, e) {
  return markedInstance.parse(n, e);
}
marked.options = marked.setOptions = function(n) {
  return markedInstance.setOptions(n), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked;
};
marked.getDefaults = _getDefaults;
marked.defaults = _defaults;
marked.use = function(...n) {
  return markedInstance.use(...n), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked;
};
marked.walkTokens = function(n, e) {
  return markedInstance.walkTokens(n, e);
};
marked.parseInline = markedInstance.parseInline;
marked.Parser = _Parser;
marked.parser = _Parser.parse;
marked.Renderer = _Renderer;
marked.TextRenderer = _TextRenderer;
marked.Lexer = _Lexer;
marked.lexer = _Lexer.lex;
marked.Tokenizer = _Tokenizer;
marked.Hooks = _Hooks;
marked.parse = marked;
marked.options;
marked.setOptions;
marked.use;
marked.walkTokens;
marked.parseInline;
_Parser.parse;
_Lexer.lex;
const regex = /[\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, own = Object.hasOwnProperty;
class BananaSlug {
  /**
   * 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 = slug(e, t === !0);
    const l = a;
    for (; own.call(r.occurrences, a); )
      r.occurrences[l]++, a = l + "-" + r.occurrences[l];
    return r.occurrences[a] = 0, a;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function slug(n, e) {
  return typeof n != "string" ? "" : (e || (n = n.toLowerCase()), n.replace(regex, "").replace(/ /g, "-"));
}
new BananaSlug();
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function getDefaultExportFromCjs(n) {
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
}
var prism = { 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, l = 0, h = {}, c = {
      /**
       * 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 p(g) {
          return g instanceof d ? new d(g.type, p(g.content), g.alias) : Array.isArray(g) ? g.map(p) : g.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(p) {
          return Object.prototype.toString.call(p).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(p) {
          return p.__id || Object.defineProperty(p, "__id", { value: ++l }), p.__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 p(g, w) {
          w = w || {};
          var o, v;
          switch (c.util.type(g)) {
            case "Object":
              if (v = c.util.objId(g), w[v])
                return w[v];
              o = /** @type {Record<string, any>} */
              {}, w[v] = o;
              for (var M in g)
                g.hasOwnProperty(M) && (o[M] = p(g[M], w));
              return (
                /** @type {any} */
                o
              );
            case "Array":
              return v = c.util.objId(g), w[v] ? w[v] : (o = [], w[v] = o, /** @type {Array} */
              /** @type {any} */
              g.forEach(function(E, $) {
                o[$] = p(E, w);
              }), /** @type {any} */
              o);
            default:
              return g;
          }
        },
        /**
         * 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(p) {
          for (; p; ) {
            var g = a.exec(p.className);
            if (g)
              return g[1].toLowerCase();
            p = p.parentElement;
          }
          return "none";
        },
        /**
         * Sets the Prism `language-xxxx` class of the given element.
         *
         * @param {Element} element
         * @param {string} language
         * @returns {void}
         */
        setLanguage: function(p, g) {
          p.className = p.className.replace(RegExp(a, "gi"), ""), p.classList.add("language-" + g);
        },
        /**
         * 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 (o) {
            var p = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(o.stack) || [])[1];
            if (p) {
              var g = document.getElementsByTagName("script");
              for (var w in g)
                if (g[w].src == p)
                  return g[w];
            }
            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(p, g, w) {
          for (var o = "no-" + g; p; ) {
            var v = p.classList;
            if (v.contains(g))
              return !0;
            if (v.contains(o))
              return !1;
            p = p.parentElement;
          }
          return !!w;
        }
      },
      /**
       * 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: h,
        plaintext: h,
        text: h,
        txt: h,
        /**
         * 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(p, g) {
          var w = c.util.clone(c.languages[p]);
          for (var o in g)
            w[o] = g[o];
          return w;
        },
        /**
         * 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(p, g, w, o) {
          o = o || /** @type {any} */
          c.languages;
          var v = o[p], M = {};
          for (var E in v)
            if (v.hasOwnProperty(E)) {
              if (E == g)
                for (var $ in w)
                  w.hasOwnProperty($) && (M[$] = w[$]);
              w.hasOwnProperty(E) || (M[E] = v[E]);
            }
          var k = o[p];
          return o[p] = M, c.languages.DFS(c.languages, function(L, z) {
            z === k && L != p && (this[L] = M);
          }), M;
        },
        // Traverse a language definition with Depth First Search
        DFS: function p(g, w, o, v) {
          v = v || {};
          var M = c.util.objId;
          for (var E in g)
            if (g.hasOwnProperty(E)) {
              w.call(g, E, g[E], o || E);
              var $ = g[E], k = c.util.type($);
              k === "Object" && !v[M($)] ? (v[M($)] = !0, p($, w, null, v)) : k === "Array" && !v[M($)] && (v[M($)] = !0, p($, w, E, v));
            }
        }
      },
      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(p, g) {
        c.highlightAllUnder(document, p, g);
      },
      /**
       * 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(p, g, w) {
        var o = {
          callback: w,
          container: p,
          selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
        };
        c.hooks.run("before-highlightall", o), o.elements = Array.prototype.slice.apply(o.container.querySelectorAll(o.selector)), c.hooks.run("before-all-elements-highlight", o);
        for (var v = 0, M; M = o.elements[v++]; )
          c.highlightElement(M, g === !0, o.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(p, g, w) {
        var o = c.util.getLanguage(p), v = c.languages[o];
        c.util.setLanguage(p, o);
        var M = p.parentElement;
        M && M.nodeName.toLowerCase() === "pre" && c.util.setLanguage(M, o);
        var E = p.textContent, $ = {
          element: p,
          language: o,
          grammar: v,
          code: E
        };
        function k(z) {
          $.highlightedCode = z, c.hooks.run("before-insert", $), $.element.innerHTML = $.highlightedCode, c.hooks.run("after-highlight", $), c.hooks.run("complete", $), w && w.call($.element);
        }
        if (c.hooks.run("before-sanity-check", $), M = $.element.parentElement, M && M.nodeName.toLowerCase() === "pre" && !M.hasAttribute("tabindex") && M.setAttribute("tabindex", "0"), !$.code) {
          c.hooks.run("complete", $), w && w.call($.element);
          return;
        }
        if (c.hooks.run("before-highlight", $), !$.grammar) {
          k(c.util.encode($.code));
          return;
        }
        if (g && r.Worker) {
          var L = new Worker(c.filename);
          L.onmessage = function(z) {
            k(z.data);
          }, L.postMessage(JSON.stringify({
            language: $.language,
            code: $.code,
            immediateClose: !0
          }));
        } else
          k(c.highlight($.code, $.grammar, $.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(p, g, w) {
        var o = {
          code: p,
          grammar: g,
          language: w
        };
        if (c.hooks.run("before-tokenize", o), !o.grammar)
          throw new Error('The language "' + o.language + '" has no grammar.');
        return o.tokens = c.tokenize(o.code, o.grammar), c.hooks.run("after-tokenize", o), d.stringify(c.util.encode(o.tokens), o.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(p, g) {
        var w = g.rest;
        if (w) {
          for (var o in w)
            g[o] = w[o];
          delete g.rest;
        }
        var v = new y();
        return x(v, v.head, p), m(p, v, g, v.head, 0), A(v);
      },
      /**
       * @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(p, g) {
          var w = c.hooks.all;
          w[p] = w[p] || [], w[p].push(g);
        },
        /**
         * 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(p, g) {
          var w = c.hooks.all[p];
          if (!(!w || !w.length))
            for (var o = 0, v; v = w[o++]; )
              v(g);
        }
      },
      Token: d
    };
    r.Prism = c;
    function d(p, g, w, o) {
      this.type = p, this.content = g, this.alias = w, this.length = (o || "").length | 0;
    }
    d.stringify = function p(g, w) {
      if (typeof g == "string")
        return g;
      if (Array.isArray(g)) {
        var o = "";
        return g.forEach(function(k) {
          o += p(k, w);
        }), o;
      }
      var v = {
        type: g.type,
        content: p(g.content, w),
        tag: "span",
        classes: ["token", g.type],
        attributes: {},
        language: w
      }, M = g.alias;
      M && (Array.isArray(M) ? Array.prototype.push.apply(v.classes, M) : v.classes.push(M)), c.hooks.run("wrap", v);
      var E = "";
      for (var $ in v.attributes)
        E += " " + $ + '="' + (v.attributes[$] || "").replace(/"/g, "&quot;") + '"';
      return "<" + v.tag + ' class="' + v.classes.join(" ") + '"' + E + ">" + v.content + "</" + v.tag + ">";
    };
    function _(p, g, w, o) {
      p.lastIndex = g;
      var v = p.exec(w);
      if (v && o && v[1]) {
        var M = v[1].length;
        v.index += M, v[0] = v[0].slice(M);
      }
      return v;
    }
    function m(p, g, w, o, v, M) {
      for (var E in w)
        if (!(!w.hasOwnProperty(E) || !w[E])) {
          var $ = w[E];
          $ = Array.isArray($) ? $ : [$];
          for (var k = 0; k < $.length; ++k) {
            if (M && M.cause == E + "," + k)
              return;
            var L = $[k], z = L.inside, O = !!L.lookbehind, R = !!L.greedy, N = L.alias;
            if (R && !L.pattern.global) {
              var W = L.pattern.toString().match(/[imsuy]*$/)[0];
              L.pattern = RegExp(L.pattern.source, W + "g");
            }
            for (var B = L.pattern || L, P = o.next, G = v; P !== g.tail && !(M && G >= M.reach); G += P.value.length, P = P.next) {
              var H = P.value;
              if (g.length > p.length)
                return;
              if (!(H instanceof d)) {
                var U = 1, j;
                if (R) {
                  if (j = _(B, G, p, O), !j || j.index >= p.length)
                    break;
                  var ue = j.index, re = j.index + j[0].length, ie = G;
                  for (ie += P.value.length; ue >= ie; )
                    P = P.next, ie += P.value.length;
                  if (ie -= P.value.length, G = ie, P.value instanceof d)
                    continue;
                  for (var te = P; te !== g.tail && (ie < re || typeof te.value == "string"); te = te.next)
                    U++, ie += te.value.length;
                  U--, H = p.slice(G, ie), j.index -= G;
                } else if (j = _(B, 0, H, O), !j)
                  continue;
                var ue = j.index, de = j[0], oe = H.slice(0, ue), J = H.slice(ue + de.length), Ee = G + H.length;
                M && Ee > M.reach && (M.reach = Ee);
                var se = P.prev;
                oe && (se = x(g, se, oe), G += oe.length), b(g, se, U);
                var Ae = new d(E, z ? c.tokenize(de, z) : de, N, de);
                if (P = x(g, se, Ae), J && x(g, P, J), U > 1) {
                  var he = {
                    cause: E + "," + k,
                    reach: Ee
                  };
                  m(p, g, w, P.prev, G, he), M && he.reach > M.reach && (M.reach = he.reach);
                }
              }
            }
          }
        }
    }
    function y() {
      var p = { value: null, prev: null, next: null }, g = { value: null, prev: p, next: null };
      p.next = g, this.head = p, this.tail = g, this.length = 0;
    }
    function x(p, g, w) {
      var o = g.next, v = { value: w, prev: g, next: o };
      return g.next = v, o.prev = v, p.length++, v;
    }
    function b(p, g, w) {
      for (var o = g.next, v = 0; v < w && o !== p.tail; v++)
        o = o.next;
      g.next = o, o.prev = g, p.length -= v;
    }
    function A(p) {
      for (var g = [], w = p.head.next; w !== p.tail; )
        g.push(w.value), w = w.next;
      return g;
    }
    if (!r.document)
      return r.addEventListener && (c.disableWorkerMessageHandler || r.addEventListener("message", function(p) {
        var g = JSON.parse(p.data), w = g.language, o = g.code, v = g.immediateClose;
        r.postMessage(c.highlight(o, c.languages[w], w)), v && r.close();
      }, !1)), c;
    var f = c.util.currentScript();
    f && (c.filename = f.src, f.hasAttribute("data-manual") && (c.manual = !0));
    function s() {
      c.manual || c.highlightAll();
    }
    if (!c.manual) {
      var u = document.readyState;
      u === "loading" || u === "interactive" && f && f.defer ? document.addEventListener("DOMContentLoaded", s) : window.requestAnimationFrame ? window.requestAnimationFrame(s) : window.setTimeout(s, 16);
    }
    return c;
  }(e);
  n.exports && (n.exports = t), typeof commonjsGlobal < "u" && (commonjsGlobal.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, l) {
      var h = {};
      h["language-" + l] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: t.languages[l]
      }, h.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var c = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: h
        }
      };
      c["language-" + l] = {
        pattern: /[\s\S]+/,
        inside: t.languages[l]
      };
      var d = {};
      d[a] = {
        pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
          return a;
        }), "i"),
        lookbehind: !0,
        greedy: !0,
        inside: c
      }, t.languages.insertBefore("markup", "cdata", d);
    }
  }), 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 l = r.languages.markup;
    l && (l.tag.addInlined("style", "css"), l.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(f, s) {
      return "✖ Error " + f + " while fetching file: " + s;
    }, l = "✖ Error: File does not exist or is empty", h = {
      js: "javascript",
      py: "python",
      rb: "ruby",
      ps1: "powershell",
      psm1: "powershell",
      sh: "bash",
      bat: "batch",
      h: "c",
      tex: "latex"
    }, c = "data-src-status", d = "loading", _ = "loaded", m = "failed", y = "pre[data-src]:not([" + c + '="' + _ + '"]):not([' + c + '="' + d + '"])';
    function x(f, s, u) {
      var p = new XMLHttpRequest();
      p.open("GET", f, !0), p.onreadystatechange = function() {
        p.readyState == 4 && (p.status < 400 && p.responseText ? s(p.responseText) : p.status >= 400 ? u(a(p.status, p.statusText)) : u(l));
      }, p.send(null);
    }
    function b(f) {
      var s = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(f || "");
      if (s) {
        var u = Number(s[1]), p = s[2], g = s[3];
        return p ? g ? [u, Number(g)] : [u, void 0] : [u, u];
      }
    }
    t.hooks.add("before-highlightall", function(f) {
      f.selector += ", " + y;
    }), t.hooks.add("before-sanity-check", function(f) {
      var s = (
        /** @type {HTMLPreElement} */
        f.element
      );
      if (s.matches(y)) {
        f.code = "", s.setAttribute(c, d);
        var u = s.appendChild(document.createElement("CODE"));
        u.textContent = r;
        var p = s.getAttribute("data-src"), g = f.language;
        if (g === "none") {
          var w = (/\.(\w+)$/.exec(p) || [, "none"])[1];
          g = h[w] || w;
        }
        t.util.setLanguage(u, g), t.util.setLanguage(s, g);
        var o = t.plugins.autoloader;
        o && o.loadLanguages(g), x(
          p,
          function(v) {
            s.setAttribute(c, _);
            var M = b(s.getAttribute("data-range"));
            if (M) {
              var E = v.split(/\r\n?|\n/g), $ = M[0], k = M[1] == null ? E.length : M[1];
              $ < 0 && ($ += E.length), $ = Math.max(0, Math.min($ - 1, E.length)), k < 0 && (k += E.length), k = Math.max(0, Math.min(k, E.length)), v = E.slice($, k).join(`
`), s.hasAttribute("data-start") || s.setAttribute("data-start", String($ + 1));
            }
            u.textContent = v, t.highlightElement(u);
          },
          function(v) {
            s.setAttribute(c, m), u.textContent = v;
          }
        );
      }
    }), 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(s) {
        for (var u = (s || document).querySelectorAll(y), p = 0, g; g = u[p++]; )
          t.highlightElement(g);
      }
    };
    var A = !1;
    t.fileHighlight = function() {
      A || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), A = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
    };
  }();
})(prism);
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"
  ], l = r.variable[1].inside, h = 0; h < a.length; h++)
    l[a[h]] = n.languages.bash[a[h]];
  n.languages.sh = n.languages.bash, n.languages.shell = n.languages.bash;
})(Prism);
new BananaSlug();
const mergeMaps = (n) => {
  const e = {};
  for (let t = 0, r = n.length; t < r; t++) {
    const a = n[t];
    for (const l in a)
      e[l] ? e[l] = e[l].concat(a[l]) : e[l] = a[l];
  }
  return e;
}, HTML_ELEMENTS_ALLOW = [
  "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"
], SVG_ELEMENTS_ALLOW = [
  "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"
], MATH_ELEMENTS_ALLOW = [
  "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"
], HTML_ATTRIBUTES_ALLOW = [
  "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"
], SVG_ATTRIBUTES_ALLOW = [
  "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"
], MATH_ATTRIBUTES_ALLOW = [
  "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"
];
[
  ...HTML_ELEMENTS_ALLOW,
  ...SVG_ELEMENTS_ALLOW.map((n) => `svg:${n}`),
  ...MATH_ELEMENTS_ALLOW.map((n) => `math:${n}`)
], mergeMaps([
  Object.fromEntries(HTML_ATTRIBUTES_ALLOW.map((n) => [n, ["*"]])),
  Object.fromEntries(SVG_ATTRIBUTES_ALLOW.map((n) => [n, ["svg:*"]])),
  Object.fromEntries(MATH_ATTRIBUTES_ALLOW.map((n) => [n, ["math:*"]]))
]);
function noop$9() {
}
function safe_not_equal$j(n, e) {
  return n != n ? e == e : n !== e || n && typeof n == "object" || typeof n == "function";
}
const is_client = typeof window < "u";
let now = is_client ? () => window.performance.now() : () => Date.now(), raf$1 = is_client ? (n) => requestAnimationFrame(n) : noop$9;
const tasks = /* @__PURE__ */ new Set();
function run_tasks(n) {
  tasks.forEach((e) => {
    e.c(n) || (tasks.delete(e), e.f());
  }), tasks.size !== 0 && raf$1(run_tasks);
}
function loop(n) {
  let e;
  return tasks.size === 0 && raf$1(run_tasks), {
    promise: new Promise((t) => {
      tasks.add(e = { c: n, f: t });
    }),
    abort() {
      tasks.delete(e);
    }
  };
}
const subscriber_queue = [];
function writable(n, e = noop$9) {
  let t;
  const r = /* @__PURE__ */ new Set();
  function a(c) {
    if (safe_not_equal$j(n, c) && (n = c, t)) {
      const d = !subscriber_queue.length;
      for (const _ of r)
        _[1](), subscriber_queue.push(_, n);
      if (d) {
        for (let _ = 0; _ < subscriber_queue.length; _ += 2)
          subscriber_queue[_][0](subscriber_queue[_ + 1]);
        subscriber_queue.length = 0;
      }
    }
  }
  function l(c) {
    a(c(n));
  }
  function h(c, d = noop$9) {
    const _ = [c, d];
    return r.add(_), r.size === 1 && (t = e(a, l) || noop$9), c(n), () => {
      r.delete(_), r.size === 0 && t && (t(), t = null);
    };
  }
  return { set: a, update: l, subscribe: h };
}
function is_date(n) {
  return Object.prototype.toString.call(n) === "[object Date]";
}
function tick_spring(n, e, t, r) {
  if (typeof t == "number" || is_date(t)) {
    const a = r - t, l = (t - e) / (n.dt || 1 / 60), h = n.opts.stiffness * a, c = n.opts.damping * l, d = (h - c) * n.inv_mass, _ = (l + d) * n.dt;
    return Math.abs(_) < n.opts.precision && Math.abs(a) < n.opts.precision ? r : (n.settled = !1, is_date(t) ? new Date(t.getTime() + _) : t + _);
  } else {
    if (Array.isArray(t))
      return t.map(
        (a, l) => tick_spring(n, e[l], t[l], r[l])
      );
    if (typeof t == "object") {
      const a = {};
      for (const l in t)
        a[l] = tick_spring(n, e[l], t[l], r[l]);
      return a;
    } else
      throw new Error(`Cannot spring ${typeof t} values`);
  }
}
function spring(n, e = {}) {
  const t = writable(n), { stiffness: r = 0.15, damping: a = 0.8, precision: l = 0.01 } = e;
  let h, c, d, _ = n, m = n, y = 1, x = 0, b = !1;
  function A(s, u = {}) {
    m = s;
    const p = d = {};
    return n == null || u.hard || f.stiffness >= 1 && f.damping >= 1 ? (b = !0, h = now(), _ = s, t.set(n = m), Promise.resolve()) : (u.soft && (x = 1 / ((u.soft === !0 ? 0.5 : +u.soft) * 60), y = 0), c || (h = now(), b = !1, c = loop((g) => {
      if (b)
        return b = !1, c = null, !1;
      y = Math.min(y + x, 1);
      const w = {
        inv_mass: y,
        opts: f,
        settled: !0,
        dt: (g - h) * 60 / 1e3
      }, o = tick_spring(w, _, n, m);
      return h = g, _ = n, t.set(n = o), w.settled && (c = null), !w.settled;
    })), new Promise((g) => {
      c.promise.then(() => {
        p === d && g();
      });
    }));
  }
  const f = {
    set: A,
    update: (s, u) => A(s(m, n), u),
    subscribe: t.subscribe,
    stiffness: r,
    damping: a,
    precision: l
  };
  return f;
}
/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */
const {
  entries,
  setPrototypeOf,
  isFrozen,
  getPrototypeOf,
  getOwnPropertyDescriptor
} = Object;
let {
  freeze,
  seal,
  create
} = Object, {
  apply,
  construct
} = typeof Reflect < "u" && Reflect;
freeze || (freeze = function(e) {
  return e;
});
seal || (seal = function(e) {
  return e;
});
apply || (apply = function(e, t, r) {
  return e.apply(t, r);
});
construct || (construct = function(e, t) {
  return new e(...t);
});
const arrayForEach = unapply(Array.prototype.forEach), arrayPop = unapply(Array.prototype.pop), arrayPush = unapply(Array.prototype.push), stringToLowerCase = unapply(String.prototype.toLowerCase), stringToString = unapply(String.prototype.toString), stringMatch = unapply(String.prototype.match), stringReplace = unapply(String.prototype.replace), stringIndexOf = unapply(String.prototype.indexOf), stringTrim = unapply(String.prototype.trim), objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty), regExpTest = unapply(RegExp.prototype.test), typeErrorCreate = unconstruct(TypeError);
function unapply(n) {
  return function(e) {
    for (var t = arguments.length, r = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
      r[a - 1] = arguments[a];
    return apply(n, e, r);
  };
}
function unconstruct(n) {
  return function() {
    for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
      t[r] = arguments[r];
    return construct(n, t);
  };
}
function addToSet(n, e) {
  let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
  setPrototypeOf && setPrototypeOf(n, null);
  let r = e.length;
  for (; r--; ) {
    let a = e[r];
    if (typeof a == "string") {
      const l = t(a);
      l !== a && (isFrozen(e) || (e[r] = l), a = l);
    }
    n[a] = !0;
  }
  return n;
}
function cleanArray(n) {
  for (let e = 0; e < n.length; e++)
    objectHasOwnProperty(n, e) || (n[e] = null);
  return n;
}
function clone(n) {
  const e = create(null);
  for (const [t, r] of entries(n))
    objectHasOwnProperty(n, t) && (Array.isArray(r) ? e[t] = cleanArray(r) : r && typeof r == "object" && r.constructor === Object ? e[t] = clone(r) : e[t] = r);
  return e;
}
function lookupGetter(n, e) {
  for (; n !== null; ) {
    const r = getOwnPropertyDescriptor(n, e);
    if (r) {
      if (r.get)
        return unapply(r.get);
      if (typeof r.value == "function")
        return unapply(r.value);
    }
    n = getPrototypeOf(n);
  }
  function t() {
    return null;
  }
  return t;
}
const html$1 = freeze(["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"]), svg$1 = freeze(["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"]), svgFilters = freeze(["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"]), svgDisallowed = freeze(["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"]), mathMl$1 = freeze(["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"]), mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), text$9 = freeze(["#text"]), html = freeze(["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"]), svg = freeze(["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"]), mathMl = freeze(["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"]), xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm), TMPLIT_EXPR = seal(/\${[\w\W]*}/gm), DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]/), ARIA_ATTR = seal(/^aria-[\-\w]+$/), IS_ALLOWED_URI = seal(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i), ATTR_WHITESPACE = seal(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), DOCTYPE_NAME = seal(/^html$/i), CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  MUSTACHE_EXPR,
  ERB_EXPR,
  TMPLIT_EXPR,
  DATA_ATTR,
  ARIA_ATTR,
  IS_ALLOWED_URI,
  IS_SCRIPT_OR_DATA,
  ATTR_WHITESPACE,
  DOCTYPE_NAME,
  CUSTOM_ELEMENT
});
const NODE_TYPE = {
  element: 1,
  attribute: 2,
  text: 3,
  cdataSection: 4,
  entityReference: 5,
  // Deprecated
  entityNode: 6,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9,
  documentType: 10,
  documentFragment: 11,
  notation: 12
  // Deprecated
}, getGlobal = function() {
  return typeof window > "u" ? null : window;
}, _createTrustedTypesPolicy = 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 l = "dompurify" + (r ? "#" + r : "");
  try {
    return e.createPolicy(l, {
      createHTML(h) {
        return h;
      },
      createScriptURL(h) {
        return h;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + l + " could not be created."), null;
  }
};
function createDOMPurify() {
  let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
  const e = (qe) => createDOMPurify(qe);
  if (e.version = "3.1.7", e.removed = [], !n || !n.document || n.document.nodeType !== NODE_TYPE.document)
    return e.isSupported = !1, e;
  let {
    document: t
  } = n;
  const r = t, a = r.currentScript, {
    DocumentFragment: l,
    HTMLTemplateElement: h,
    Node: c,
    Element: d,
    NodeFilter: _,
    NamedNodeMap: m = n.NamedNodeMap || n.MozNamedAttrMap,
    HTMLFormElement: y,
    DOMParser: x,
    trustedTypes: b
  } = n, A = d.prototype, f = lookupGetter(A, "cloneNode"), s = lookupGetter(A, "remove"), u = lookupGetter(A, "nextSibling"), p = lookupGetter(A, "childNodes"), g = lookupGetter(A, "parentNode");
  if (typeof h == "function") {
    const qe = t.createElement("template");
    qe.content && qe.content.ownerDocument && (t = qe.content.ownerDocument);
  }
  let w, o = "";
  const {
    implementation: v,
    createNodeIterator: M,
    createDocumentFragment: E,
    getElementsByTagName: $
  } = t, {
    importNode: k
  } = r;
  let L = {};
  e.isSupported = typeof entries == "function" && typeof g == "function" && v && v.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: z,
    ERB_EXPR: O,
    TMPLIT_EXPR: R,
    DATA_ATTR: N,
    ARIA_ATTR: W,
    IS_SCRIPT_OR_DATA: B,
    ATTR_WHITESPACE: P,
    CUSTOM_ELEMENT: G
  } = EXPRESSIONS;
  let {
    IS_ALLOWED_URI: H
  } = EXPRESSIONS, U = null;
  const j = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text$9]);
  let re = null;
  const ie = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
  let te = Object.seal(create(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
    }
  })), ue = null, de = null, oe = !0, J = !0, Ee = !1, se = !0, Ae = !1, he = !0, ne = !1, _e = !1, Le = !1, Be = !1, Ue = !1, He = !1, We = !0, Ge = !1;
  const Ne = "user-content-";
  let Pe = !0, Te = !1, Me = {}, De = null;
  const V = addToSet({}, ["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 Z = null;
  const ee = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
  let ye = null;
  const ce = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ie = "http://www.w3.org/1998/Math/MathML", ke = "http://www.w3.org/2000/svg", Y = "http://www.w3.org/1999/xhtml";
  let me = Y, we = !1, Re = null;
  const pe = addToSet({}, [Ie, ke, Y], stringToString);
  let $e = null;
  const X = ["application/xhtml+xml", "text/html"], ze = "text/html";
  let Ve = null, I = null;
  const xe = t.createElement("form"), be = function(ge) {
    return ge instanceof RegExp || ge instanceof Function;
  }, q = function() {
    let ge = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(I && I === ge)) {
      if ((!ge || typeof ge != "object") && (ge = {}), ge = clone(ge), $e = // eslint-disable-next-line unicorn/prefer-includes
      X.indexOf(ge.PARSER_MEDIA_TYPE) === -1 ? ze : ge.PARSER_MEDIA_TYPE, Ve = $e === "application/xhtml+xml" ? stringToString : stringToLowerCase, U = objectHasOwnProperty(ge, "ALLOWED_TAGS") ? addToSet({}, ge.ALLOWED_TAGS, Ve) : j, re = objectHasOwnProperty(ge, "ALLOWED_ATTR") ? addToSet({}, ge.ALLOWED_ATTR, Ve) : ie, Re = objectHasOwnProperty(ge, "ALLOWED_NAMESPACES") ? addToSet({}, ge.ALLOWED_NAMESPACES, stringToString) : pe, ye = objectHasOwnProperty(ge, "ADD_URI_SAFE_ATTR") ? addToSet(
        clone(ce),
        // eslint-disable-line indent
        ge.ADD_URI_SAFE_ATTR,
        // eslint-disable-line indent
        Ve
        // eslint-disable-line indent
      ) : ce, Z = objectHasOwnProperty(ge, "ADD_DATA_URI_TAGS") ? addToSet(
        clone(ee),
        // eslint-disable-line indent
        ge.ADD_DATA_URI_TAGS,
        // eslint-disable-line indent
        Ve
        // eslint-disable-line indent
      ) : ee, De = objectHasOwnProperty(ge, "FORBID_CONTENTS") ? addToSet({}, ge.FORBID_CONTENTS, Ve) : V, ue = objectHasOwnProperty(ge, "FORBID_TAGS") ? addToSet({}, ge.FORBID_TAGS, Ve) : {}, de = objectHasOwnProperty(ge, "FORBID_ATTR") ? addToSet({}, ge.FORBID_ATTR, Ve) : {}, Me = objectHasOwnProperty(ge, "USE_PROFILES") ? ge.USE_PROFILES : !1, oe = ge.ALLOW_ARIA_ATTR !== !1, J = ge.ALLOW_DATA_ATTR !== !1, Ee = ge.ALLOW_UNKNOWN_PROTOCOLS || !1, se = ge.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Ae = ge.SAFE_FOR_TEMPLATES || !1, he = ge.SAFE_FOR_XML !== !1, ne = ge.WHOLE_DOCUMENT || !1, Be = ge.RETURN_DOM || !1, Ue = ge.RETURN_DOM_FRAGMENT || !1, He = ge.RETURN_TRUSTED_TYPE || !1, Le = ge.FORCE_BODY || !1, We = ge.SANITIZE_DOM !== !1, Ge = ge.SANITIZE_NAMED_PROPS || !1, Pe = ge.KEEP_CONTENT !== !1, Te = ge.IN_PLACE || !1, H = ge.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, me = ge.NAMESPACE || Y, te = ge.CUSTOM_ELEMENT_HANDLING || {}, ge.CUSTOM_ELEMENT_HANDLING && be(ge.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (te.tagNameCheck = ge.CUSTOM_ELEMENT_HANDLING.tagNameCheck), ge.CUSTOM_ELEMENT_HANDLING && be(ge.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (te.attributeNameCheck = ge.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), ge.CUSTOM_ELEMENT_HANDLING && typeof ge.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (te.allowCustomizedBuiltInElements = ge.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Ae && (J = !1), Ue && (Be = !0), Me && (U = addToSet({}, text$9), re = [], Me.html === !0 && (addToSet(U, html$1), addToSet(re, html)), Me.svg === !0 && (addToSet(U, svg$1), addToSet(re, svg), addToSet(re, xml)), Me.svgFilters === !0 && (addToSet(U, svgFilters), addToSet(re, svg), addToSet(re, xml)), Me.mathMl === !0 && (addToSet(U, mathMl$1), addToSet(re, mathMl), addToSet(re, xml))), ge.ADD_TAGS && (U === j && (U = clone(U)), addToSet(U, ge.ADD_TAGS, Ve)), ge.ADD_ATTR && (re === ie && (re = clone(re)), addToSet(re, ge.ADD_ATTR, Ve)), ge.ADD_URI_SAFE_ATTR && addToSet(ye, ge.ADD_URI_SAFE_ATTR, Ve), ge.FORBID_CONTENTS && (De === V && (De = clone(De)), addToSet(De, ge.FORBID_CONTENTS, Ve)), Pe && (U["#text"] = !0), ne && addToSet(U, ["html", "head", "body"]), U.table && (addToSet(U, ["tbody"]), delete ue.tbody), ge.TRUSTED_TYPES_POLICY) {
        if (typeof ge.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof ge.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        w = ge.TRUSTED_TYPES_POLICY, o = w.createHTML("");
      } else
        w === void 0 && (w = _createTrustedTypesPolicy(b, a)), w !== null && typeof o == "string" && (o = w.createHTML(""));
      freeze && freeze(ge), I = ge;
    }
  }, fe = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]), Ce = addToSet({}, ["annotation-xml"]), Ze = addToSet({}, ["title", "style", "font", "a", "script"]), Xe = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]), Ye = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), lt = function(ge) {
    let Ke = g(ge);
    (!Ke || !Ke.tagName) && (Ke = {
      namespaceURI: me,
      tagName: "template"
    });
    const Qe = stringToLowerCase(ge.tagName), _t = stringToLowerCase(Ke.tagName);
    return Re[ge.namespaceURI] ? ge.namespaceURI === ke ? Ke.namespaceURI === Y ? Qe === "svg" : Ke.namespaceURI === Ie ? Qe === "svg" && (_t === "annotation-xml" || fe[_t]) : !!Xe[Qe] : ge.namespaceURI === Ie ? Ke.namespaceURI === Y ? Qe === "math" : Ke.namespaceURI === ke ? Qe === "math" && Ce[_t] : !!Ye[Qe] : ge.namespaceURI === Y ? Ke.namespaceURI === ke && !Ce[_t] || Ke.namespaceURI === Ie && !fe[_t] ? !1 : !Ye[Qe] && (Ze[Qe] || !Xe[Qe]) : !!($e === "application/xhtml+xml" && Re[ge.namespaceURI]) : !1;
  }, dt = function(ge) {
    arrayPush(e.removed, {
      element: ge
    });
    try {
      g(ge).removeChild(ge);
    } catch {
      s(ge);
    }
  }, it = function(ge, Ke) {
    try {
      arrayPush(e.removed, {
        attribute: Ke.getAttributeNode(ge),
        from: Ke
      });
    } catch {
      arrayPush(e.removed, {
        attribute: null,
        from: Ke
      });
    }
    if (Ke.removeAttribute(ge), ge === "is" && !re[ge])
      if (Be || Ue)
        try {
          dt(Ke);
        } catch {
        }
      else
        try {
          Ke.setAttribute(ge, "");
        } catch {
        }
  }, ot = function(ge) {
    let Ke = null, Qe = null;
    if (Le)
      ge = "<remove></remove>" + ge;
    else {
      const St = stringMatch(ge, /^[\r\n\t ]+/);
      Qe = St && St[0];
    }
    $e === "application/xhtml+xml" && me === Y && (ge = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + ge + "</body></html>");
    const _t = w ? w.createHTML(ge) : ge;
    if (me === Y)
      try {
        Ke = new x().parseFromString(_t, $e);
      } catch {
      }
    if (!Ke || !Ke.documentElement) {
      Ke = v.createDocument(me, "template", null);
      try {
        Ke.documentElement.innerHTML = we ? o : _t;
      } catch {
      }
    }
    const Mt = Ke.body || Ke.documentElement;
    return ge && Qe && Mt.insertBefore(t.createTextNode(Qe), Mt.childNodes[0] || null), me === Y ? $.call(Ke, ne ? "html" : "body")[0] : ne ? Ke.documentElement : Mt;
  }, nt = function(ge) {
    return M.call(
      ge.ownerDocument || ge,
      ge,
      // eslint-disable-next-line no-bitwise
      _.SHOW_ELEMENT | _.SHOW_COMMENT | _.SHOW_TEXT | _.SHOW_PROCESSING_INSTRUCTION | _.SHOW_CDATA_SECTION,
      null
    );
  }, Ct = function(ge) {
    return ge instanceof y && (typeof ge.nodeName != "string" || typeof ge.textContent != "string" || typeof ge.removeChild != "function" || !(ge.attributes instanceof m) || typeof ge.removeAttribute != "function" || typeof ge.setAttribute != "function" || typeof ge.namespaceURI != "string" || typeof ge.insertBefore != "function" || typeof ge.hasChildNodes != "function");
  }, ut = function(ge) {
    return typeof c == "function" && ge instanceof c;
  }, zt = function(ge, Ke, Qe) {
    L[ge] && arrayForEach(L[ge], (_t) => {
      _t.call(e, Ke, Qe, I);
    });
  }, Ut = function(ge) {
    let Ke = null;
    if (zt("beforeSanitizeElements", ge, null), Ct(ge))
      return dt(ge), !0;
    const Qe = Ve(ge.nodeName);
    if (zt("uponSanitizeElement", ge, {
      tagName: Qe,
      allowedTags: U
    }), ge.hasChildNodes() && !ut(ge.firstElementChild) && regExpTest(/<[/\w]/g, ge.innerHTML) && regExpTest(/<[/\w]/g, ge.textContent) || ge.nodeType === NODE_TYPE.progressingInstruction || he && ge.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, ge.data))
      return dt(ge), !0;
    if (!U[Qe] || ue[Qe]) {
      if (!ue[Qe] && mt(Qe) && (te.tagNameCheck instanceof RegExp && regExpTest(te.tagNameCheck, Qe) || te.tagNameCheck instanceof Function && te.tagNameCheck(Qe)))
        return !1;
      if (Pe && !De[Qe]) {
        const _t = g(ge) || ge.parentNode, Mt = p(ge) || ge.childNodes;
        if (Mt && _t) {
          const St = Mt.length;
          for (let It = St - 1; It >= 0; --It) {
            const Pt = f(Mt[It], !0);
            Pt.__removalCount = (ge.__removalCount || 0) + 1, _t.insertBefore(Pt, u(ge));
          }
        }
      }
      return dt(ge), !0;
    }
    return ge instanceof d && !lt(ge) || (Qe === "noscript" || Qe === "noembed" || Qe === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, ge.innerHTML) ? (dt(ge), !0) : (Ae && ge.nodeType === NODE_TYPE.text && (Ke = ge.textContent, arrayForEach([z, O, R], (_t) => {
      Ke = stringReplace(Ke, _t, " ");
    }), ge.textContent !== Ke && (arrayPush(e.removed, {
      element: ge.cloneNode()
    }), ge.textContent = Ke)), zt("afterSanitizeElements", ge, null), !1);
  }, wt = function(ge, Ke, Qe) {
    if (We && (Ke === "id" || Ke === "name") && (Qe in t || Qe in xe))
      return !1;
    if (!(J && !de[Ke] && regExpTest(N, Ke))) {
      if (!(oe && regExpTest(W, Ke))) {
        if (!re[Ke] || de[Ke]) {
          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
            !(mt(ge) && (te.tagNameCheck instanceof RegExp && regExpTest(te.tagNameCheck, ge) || te.tagNameCheck instanceof Function && te.tagNameCheck(ge)) && (te.attributeNameCheck instanceof RegExp && regExpTest(te.attributeNameCheck, Ke) || te.attributeNameCheck instanceof Function && te.attributeNameCheck(Ke)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            Ke === "is" && te.allowCustomizedBuiltInElements && (te.tagNameCheck instanceof RegExp && regExpTest(te.tagNameCheck, Qe) || te.tagNameCheck instanceof Function && te.tagNameCheck(Qe)))
          ) return !1;
        } else if (!ye[Ke]) {
          if (!regExpTest(H, stringReplace(Qe, P, ""))) {
            if (!((Ke === "src" || Ke === "xlink:href" || Ke === "href") && ge !== "script" && stringIndexOf(Qe, "data:") === 0 && Z[ge])) {
              if (!(Ee && !regExpTest(B, stringReplace(Qe, P, "")))) {
                if (Qe)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, mt = function(ge) {
    return ge !== "annotation-xml" && stringMatch(ge, G);
  }, vt = function(ge) {
    zt("beforeSanitizeAttributes", ge, null);
    const {
      attributes: Ke
    } = ge;
    if (!Ke)
      return;
    const Qe = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: re
    };
    let _t = Ke.length;
    for (; _t--; ) {
      const Mt = Ke[_t], {
        name: St,
        namespaceURI: It,
        value: Pt
      } = Mt, Zt = Ve(St);
      let Tt = St === "value" ? Pt : stringTrim(Pt);
      if (Qe.attrName = Zt, Qe.attrValue = Tt, Qe.keepAttr = !0, Qe.forceKeepAttr = void 0, zt("uponSanitizeAttribute", ge, Qe), Tt = Qe.attrValue, Qe.forceKeepAttr || (it(St, ge), !Qe.keepAttr))
        continue;
      if (!se && regExpTest(/\/>/i, Tt)) {
        it(St, ge);
        continue;
      }
      Ae && arrayForEach([z, O, R], (nr) => {
        Tt = stringReplace(Tt, nr, " ");
      });
      const mr = Ve(ge.nodeName);
      if (wt(mr, Zt, Tt)) {
        if (Ge && (Zt === "id" || Zt === "name") && (it(St, ge), Tt = Ne + Tt), he && regExpTest(/((--!?|])>)|<\/(style|title)/i, Tt)) {
          it(St, ge);
          continue;
        }
        if (w && typeof b == "object" && typeof b.getAttributeType == "function" && !It)
          switch (b.getAttributeType(mr, Zt)) {
            case "TrustedHTML": {
              Tt = w.createHTML(Tt);
              break;
            }
            case "TrustedScriptURL": {
              Tt = w.createScriptURL(Tt);
              break;
            }
          }
        try {
          It ? ge.setAttributeNS(It, St, Tt) : ge.setAttribute(St, Tt), Ct(ge) ? dt(ge) : arrayPop(e.removed);
        } catch {
        }
      }
    }
    zt("afterSanitizeAttributes", ge, null);
  }, Rt = function qe(ge) {
    let Ke = null;
    const Qe = nt(ge);
    for (zt("beforeSanitizeShadowDOM", ge, null); Ke = Qe.nextNode(); )
      zt("uponSanitizeShadowNode", Ke, null), !Ut(Ke) && (Ke.content instanceof l && qe(Ke.content), vt(Ke));
    zt("afterSanitizeShadowDOM", ge, null);
  };
  return e.sanitize = function(qe) {
    let ge = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Ke = null, Qe = null, _t = null, Mt = null;
    if (we = !qe, we && (qe = "<!-->"), typeof qe != "string" && !ut(qe))
      if (typeof qe.toString == "function") {
        if (qe = qe.toString(), typeof qe != "string")
          throw typeErrorCreate("dirty is not a string, aborting");
      } else
        throw typeErrorCreate("toString is not a function");
    if (!e.isSupported)
      return qe;
    if (_e || q(ge), e.removed = [], typeof qe == "string" && (Te = !1), Te) {
      if (qe.nodeName) {
        const Pt = Ve(qe.nodeName);
        if (!U[Pt] || ue[Pt])
          throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (qe instanceof c)
      Ke = ot("<!---->"), Qe = Ke.ownerDocument.importNode(qe, !0), Qe.nodeType === NODE_TYPE.element && Qe.nodeName === "BODY" || Qe.nodeName === "HTML" ? Ke = Qe : Ke.appendChild(Qe);
    else {
      if (!Be && !Ae && !ne && // eslint-disable-next-line unicorn/prefer-includes
      qe.indexOf("<") === -1)
        return w && He ? w.createHTML(qe) : qe;
      if (Ke = ot(qe), !Ke)
        return Be ? null : He ? o : "";
    }
    Ke && Le && dt(Ke.firstChild);
    const St = nt(Te ? qe : Ke);
    for (; _t = St.nextNode(); )
      Ut(_t) || (_t.content instanceof l && Rt(_t.content), vt(_t));
    if (Te)
      return qe;
    if (Be) {
      if (Ue)
        for (Mt = E.call(Ke.ownerDocument); Ke.firstChild; )
          Mt.appendChild(Ke.firstChild);
      else
        Mt = Ke;
      return (re.shadowroot || re.shadowrootmode) && (Mt = k.call(r, Mt, !0)), Mt;
    }
    let It = ne ? Ke.outerHTML : Ke.innerHTML;
    return ne && U["!doctype"] && Ke.ownerDocument && Ke.ownerDocument.doctype && Ke.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, Ke.ownerDocument.doctype.name) && (It = "<!DOCTYPE " + Ke.ownerDocument.doctype.name + `>
` + It), Ae && arrayForEach([z, O, R], (Pt) => {
      It = stringReplace(It, Pt, " ");
    }), w && He ? w.createHTML(It) : It;
  }, e.setConfig = function() {
    let qe = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    q(qe), _e = !0;
  }, e.clearConfig = function() {
    I = null, _e = !1;
  }, e.isValidAttribute = function(qe, ge, Ke) {
    I || q({});
    const Qe = Ve(qe), _t = Ve(ge);
    return wt(Qe, _t, Ke);
  }, e.addHook = function(qe, ge) {
    typeof ge == "function" && (L[qe] = L[qe] || [], arrayPush(L[qe], ge));
  }, e.removeHook = function(qe) {
    if (L[qe])
      return arrayPop(L[qe]);
  }, e.removeHooks = function(qe) {
    L[qe] && (L[qe] = []);
  }, e.removeAllHooks = function() {
    L = {};
  }, e;
}
createDOMPurify();
const {
  SvelteComponent: SvelteComponent$i,
  append_hydration: append_hydration$d,
  attr: attr$e,
  children: children$f,
  claim_component: claim_component$a,
  claim_element: claim_element$e,
  claim_space: claim_space$c,
  claim_text: claim_text$8,
  create_component: create_component$a,
  destroy_component: destroy_component$a,
  detach: detach$i,
  element: element$e,
  init: init$i,
  insert_hydration: insert_hydration$i,
  mount_component: mount_component$a,
  safe_not_equal: safe_not_equal$i,
  set_data: set_data$7,
  space: space$c,
  text: text$8,
  toggle_class: toggle_class$b,
  transition_in: transition_in$e,
  transition_out: transition_out$d
} = window.__gradio__svelte__internal;
function create_fragment$i(n) {
  let e, t, r, a, l, h;
  return r = new /*Icon*/
  n[1]({}), {
    c() {
      e = element$e("label"), t = element$e("span"), create_component$a(r.$$.fragment), a = space$c(), l = text$8(
        /*label*/
        n[0]
      ), this.h();
    },
    l(c) {
      e = claim_element$e(c, "LABEL", {
        for: !0,
        "data-testid": !0,
        class: !0
      });
      var d = children$f(e);
      t = claim_element$e(d, "SPAN", { class: !0 });
      var _ = children$f(t);
      claim_component$a(r.$$.fragment, _), _.forEach(detach$i), a = claim_space$c(d), l = claim_text$8(
        d,
        /*label*/
        n[0]
      ), d.forEach(detach$i), this.h();
    },
    h() {
      attr$e(t, "class", "svelte-168uj4v"), attr$e(e, "for", ""), attr$e(e, "data-testid", "block-label"), attr$e(e, "class", "svelte-168uj4v"), toggle_class$b(e, "hide", !/*show_label*/
      n[2]), toggle_class$b(e, "sr-only", !/*show_label*/
      n[2]), toggle_class$b(
        e,
        "float",
        /*float*/
        n[4]
      ), toggle_class$b(
        e,
        "hide-label",
        /*disable*/
        n[3]
      );
    },
    m(c, d) {
      insert_hydration$i(c, e, d), append_hydration$d(e, t), mount_component$a(r, t, null), append_hydration$d(e, a), append_hydration$d(e, l), h = !0;
    },
    p(c, [d]) {
      (!h || d & /*label*/
      1) && set_data$7(
        l,
        /*label*/
        c[0]
      ), (!h || d & /*show_label*/
      4) && toggle_class$b(e, "hide", !/*show_label*/
      c[2]), (!h || d & /*show_label*/
      4) && toggle_class$b(e, "sr-only", !/*show_label*/
      c[2]), (!h || d & /*float*/
      16) && toggle_class$b(
        e,
        "float",
        /*float*/
        c[4]
      ), (!h || d & /*disable*/
      8) && toggle_class$b(
        e,
        "hide-label",
        /*disable*/
        c[3]
      );
    },
    i(c) {
      h || (transition_in$e(r.$$.fragment, c), h = !0);
    },
    o(c) {
      transition_out$d(r.$$.fragment, c), h = !1;
    },
    d(c) {
      c && detach$i(e), destroy_component$a(r);
    }
  };
}
function instance$h(n, e, t) {
  let { label: r = null } = e, { Icon: a } = e, { show_label: l = !0 } = e, { disable: h = !1 } = e, { float: c = !0 } = e;
  return n.$$set = (d) => {
    "label" in d && t(0, r = d.label), "Icon" in d && t(1, a = d.Icon), "show_label" in d && t(2, l = d.show_label), "disable" in d && t(3, h = d.disable), "float" in d && t(4, c = d.float);
  }, [r, a, l, h, c];
}
class BlockLabel extends SvelteComponent$i {
  constructor(e) {
    super(), init$i(this, e, instance$h, create_fragment$i, safe_not_equal$i, {
      label: 0,
      Icon: 1,
      show_label: 2,
      disable: 3,
      float: 4
    });
  }
}
const {
  SvelteComponent: SvelteComponent$h,
  append_hydration: append_hydration$c,
  attr: attr$d,
  bubble: bubble$3,
  check_outros: check_outros$a,
  children: children$e,
  claim_component: claim_component$9,
  claim_element: claim_element$d,
  claim_space: claim_space$b,
  claim_text: claim_text$7,
  construct_svelte_component,
  create_component: create_component$9,
  destroy_component: destroy_component$9,
  detach: detach$h,
  element: element$d,
  group_outros: group_outros$a,
  init: init$h,
  insert_hydration: insert_hydration$h,
  listen: listen$5,
  mount_component: mount_component$9,
  safe_not_equal: safe_not_equal$h,
  set_data: set_data$6,
  set_style: set_style$7,
  space: space$b,
  text: text$7,
  toggle_class: toggle_class$a,
  transition_in: transition_in$d,
  transition_out: transition_out$c
} = window.__gradio__svelte__internal;
function create_if_block$c(n) {
  let e, t;
  return {
    c() {
      e = element$d("span"), t = text$7(
        /*label*/
        n[1]
      ), this.h();
    },
    l(r) {
      e = claim_element$d(r, "SPAN", { class: !0 });
      var a = children$e(e);
      t = claim_text$7(
        a,
        /*label*/
        n[1]
      ), a.forEach(detach$h), this.h();
    },
    h() {
      attr$d(e, "class", "svelte-vk34kx");
    },
    m(r, a) {
      insert_hydration$h(r, e, a), append_hydration$c(e, t);
    },
    p(r, a) {
      a & /*label*/
      2 && set_data$6(
        t,
        /*label*/
        r[1]
      );
    },
    d(r) {
      r && detach$h(e);
    }
  };
}
function create_fragment$h(n) {
  let e, t, r, a, l, h, c, d = (
    /*show_label*/
    n[2] && create_if_block$c(n)
  );
  var _ = (
    /*Icon*/
    n[0]
  );
  function m(y, x) {
    return {};
  }
  return _ && (a = construct_svelte_component(_, m())), {
    c() {
      e = element$d("button"), d && d.c(), t = space$b(), r = element$d("div"), a && create_component$9(a.$$.fragment), this.h();
    },
    l(y) {
      e = claim_element$d(y, "BUTTON", {
        "aria-label": !0,
        "aria-haspopup": !0,
        title: !0,
        class: !0
      });
      var x = children$e(e);
      d && d.l(x), t = claim_space$b(x), r = claim_element$d(x, "DIV", { class: !0 });
      var b = children$e(r);
      a && claim_component$9(a.$$.fragment, b), b.forEach(detach$h), x.forEach(detach$h), this.h();
    },
    h() {
      attr$d(r, "class", "svelte-vk34kx"), toggle_class$a(
        r,
        "small",
        /*size*/
        n[4] === "small"
      ), toggle_class$a(
        r,
        "large",
        /*size*/
        n[4] === "large"
      ), toggle_class$a(
        r,
        "medium",
        /*size*/
        n[4] === "medium"
      ), e.disabled = /*disabled*/
      n[7], attr$d(
        e,
        "aria-label",
        /*label*/
        n[1]
      ), attr$d(
        e,
        "aria-haspopup",
        /*hasPopup*/
        n[8]
      ), attr$d(
        e,
        "title",
        /*label*/
        n[1]
      ), attr$d(e, "class", "svelte-vk34kx"), toggle_class$a(
        e,
        "pending",
        /*pending*/
        n[3]
      ), toggle_class$a(
        e,
        "padded",
        /*padded*/
        n[5]
      ), toggle_class$a(
        e,
        "highlight",
        /*highlight*/
        n[6]
      ), toggle_class$a(
        e,
        "transparent",
        /*transparent*/
        n[9]
      ), set_style$7(e, "color", !/*disabled*/
      n[7] && /*_color*/
      n[11] ? (
        /*_color*/
        n[11]
      ) : "var(--block-label-text-color)"), set_style$7(e, "--bg-color", /*disabled*/
      n[7] ? "auto" : (
        /*background*/
        n[10]
      ));
    },
    m(y, x) {
      insert_hydration$h(y, e, x), d && d.m(e, null), append_hydration$c(e, t), append_hydration$c(e, r), a && mount_component$9(a, r, null), l = !0, h || (c = listen$5(
        e,
        "click",
        /*click_handler*/
        n[13]
      ), h = !0);
    },
    p(y, [x]) {
      if (/*show_label*/
      y[2] ? d ? d.p(y, x) : (d = create_if_block$c(y), d.c(), d.m(e, t)) : d && (d.d(1), d = null), x & /*Icon*/
      1 && _ !== (_ = /*Icon*/
      y[0])) {
        if (a) {
          group_outros$a();
          const b = a;
          transition_out$c(b.$$.fragment, 1, 0, () => {
            destroy_component$9(b, 1);
          }), check_outros$a();
        }
        _ ? (a = construct_svelte_component(_, m()), create_component$9(a.$$.fragment), transition_in$d(a.$$.fragment, 1), mount_component$9(a, r, null)) : a = null;
      }
      (!l || x & /*size*/
      16) && toggle_class$a(
        r,
        "small",
        /*size*/
        y[4] === "small"
      ), (!l || x & /*size*/
      16) && toggle_class$a(
        r,
        "large",
        /*size*/
        y[4] === "large"
      ), (!l || x & /*size*/
      16) && toggle_class$a(
        r,
        "medium",
        /*size*/
        y[4] === "medium"
      ), (!l || x & /*disabled*/
      128) && (e.disabled = /*disabled*/
      y[7]), (!l || x & /*label*/
      2) && attr$d(
        e,
        "aria-label",
        /*label*/
        y[1]
      ), (!l || x & /*hasPopup*/
      256) && attr$d(
        e,
        "aria-haspopup",
        /*hasPopup*/
        y[8]
      ), (!l || x & /*label*/
      2) && attr$d(
        e,
        "title",
        /*label*/
        y[1]
      ), (!l || x & /*pending*/
      8) && toggle_class$a(
        e,
        "pending",
        /*pending*/
        y[3]
      ), (!l || x & /*padded*/
      32) && toggle_class$a(
        e,
        "padded",
        /*padded*/
        y[5]
      ), (!l || x & /*highlight*/
      64) && toggle_class$a(
        e,
        "highlight",
        /*highlight*/
        y[6]
      ), (!l || x & /*transparent*/
      512) && toggle_class$a(
        e,
        "transparent",
        /*transparent*/
        y[9]
      ), x & /*disabled, _color*/
      2176 && set_style$7(e, "color", !/*disabled*/
      y[7] && /*_color*/
      y[11] ? (
        /*_color*/
        y[11]
      ) : "var(--block-label-text-color)"), x & /*disabled, background*/
      1152 && set_style$7(e, "--bg-color", /*disabled*/
      y[7] ? "auto" : (
        /*background*/
        y[10]
      ));
    },
    i(y) {
      l || (a && transition_in$d(a.$$.fragment, y), l = !0);
    },
    o(y) {
      a && transition_out$c(a.$$.fragment, y), l = !1;
    },
    d(y) {
      y && detach$h(e), d && d.d(), a && destroy_component$9(a), h = !1, c();
    }
  };
}
function instance$g(n, e, t) {
  let r, { Icon: a } = e, { label: l = "" } = e, { show_label: h = !1 } = e, { pending: c = !1 } = e, { size: d = "small" } = e, { padded: _ = !0 } = e, { highlight: m = !1 } = e, { disabled: y = !1 } = e, { hasPopup: x = !1 } = e, { color: b = "var(--block-label-text-color)" } = e, { transparent: A = !1 } = e, { background: f = "var(--block-background-fill)" } = e;
  function s(u) {
    bubble$3.call(this, n, u);
  }
  return n.$$set = (u) => {
    "Icon" in u && t(0, a = u.Icon), "label" in u && t(1, l = u.label), "show_label" in u && t(2, h = u.show_label), "pending" in u && t(3, c = u.pending), "size" in u && t(4, d = u.size), "padded" in u && t(5, _ = u.padded), "highlight" in u && t(6, m = u.highlight), "disabled" in u && t(7, y = u.disabled), "hasPopup" in u && t(8, x = u.hasPopup), "color" in u && t(12, b = u.color), "transparent" in u && t(9, A = u.transparent), "background" in u && t(10, f = u.background);
  }, n.$$.update = () => {
    n.$$.dirty & /*highlight, color*/
    4160 && t(11, r = m ? "var(--color-accent)" : b);
  }, [
    a,
    l,
    h,
    c,
    d,
    _,
    m,
    y,
    x,
    A,
    f,
    r,
    b,
    s
  ];
}
class IconButton extends SvelteComponent$h {
  constructor(e) {
    super(), init$h(this, e, instance$g, create_fragment$h, safe_not_equal$h, {
      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: SvelteComponent$g,
  append_hydration: append_hydration$b,
  attr: attr$c,
  binding_callbacks: binding_callbacks$4,
  children: children$d,
  claim_element: claim_element$c,
  create_slot: create_slot$6,
  detach: detach$g,
  element: element$c,
  get_all_dirty_from_scope: get_all_dirty_from_scope$6,
  get_slot_changes: get_slot_changes$6,
  init: init$g,
  insert_hydration: insert_hydration$g,
  safe_not_equal: safe_not_equal$g,
  toggle_class: toggle_class$9,
  transition_in: transition_in$c,
  transition_out: transition_out$b,
  update_slot_base: update_slot_base$6
} = window.__gradio__svelte__internal;
function create_fragment$g(n) {
  let e, t, r;
  const a = (
    /*#slots*/
    n[5].default
  ), l = create_slot$6(
    a,
    n,
    /*$$scope*/
    n[4],
    null
  );
  return {
    c() {
      e = element$c("div"), t = element$c("div"), l && l.c(), this.h();
    },
    l(h) {
      e = claim_element$c(h, "DIV", { class: !0, "aria-label": !0 });
      var c = children$d(e);
      t = claim_element$c(c, "DIV", { class: !0 });
      var d = children$d(t);
      l && l.l(d), d.forEach(detach$g), c.forEach(detach$g), this.h();
    },
    h() {
      attr$c(t, "class", "icon svelte-3w3rth"), attr$c(e, "class", "empty svelte-3w3rth"), attr$c(e, "aria-label", "Empty value"), toggle_class$9(
        e,
        "small",
        /*size*/
        n[0] === "small"
      ), toggle_class$9(
        e,
        "large",
        /*size*/
        n[0] === "large"
      ), toggle_class$9(
        e,
        "unpadded_box",
        /*unpadded_box*/
        n[1]
      ), toggle_class$9(
        e,
        "small_parent",
        /*parent_height*/
        n[3]
      );
    },
    m(h, c) {
      insert_hydration$g(h, e, c), append_hydration$b(e, t), l && l.m(t, null), n[6](e), r = !0;
    },
    p(h, [c]) {
      l && l.p && (!r || c & /*$$scope*/
      16) && update_slot_base$6(
        l,
        a,
        h,
        /*$$scope*/
        h[4],
        r ? get_slot_changes$6(
          a,
          /*$$scope*/
          h[4],
          c,
          null
        ) : get_all_dirty_from_scope$6(
          /*$$scope*/
          h[4]
        ),
        null
      ), (!r || c & /*size*/
      1) && toggle_class$9(
        e,
        "small",
        /*size*/
        h[0] === "small"
      ), (!r || c & /*size*/
      1) && toggle_class$9(
        e,
        "large",
        /*size*/
        h[0] === "large"
      ), (!r || c & /*unpadded_box*/
      2) && toggle_class$9(
        e,
        "unpadded_box",
        /*unpadded_box*/
        h[1]
      ), (!r || c & /*parent_height*/
      8) && toggle_class$9(
        e,
        "small_parent",
        /*parent_height*/
        h[3]
      );
    },
    i(h) {
      r || (transition_in$c(l, h), r = !0);
    },
    o(h) {
      transition_out$b(l, h), r = !1;
    },
    d(h) {
      h && detach$g(e), l && l.d(h), n[6](null);
    }
  };
}
function instance$f(n, e, t) {
  let r, { $$slots: a = {}, $$scope: l } = e, { size: h = "small" } = e, { unpadded_box: c = !1 } = e, d;
  function _(y) {
    var x;
    if (!y) return !1;
    const { height: b } = y.getBoundingClientRect(), { height: A } = ((x = y.parentElement) === null || x === void 0 ? void 0 : x.getBoundingClientRect()) || { height: b };
    return b > A + 2;
  }
  function m(y) {
    binding_callbacks$4[y ? "unshift" : "push"](() => {
      d = y, t(2, d);
    });
  }
  return n.$$set = (y) => {
    "size" in y && t(0, h = y.size), "unpadded_box" in y && t(1, c = y.unpadded_box), "$$scope" in y && t(4, l = y.$$scope);
  }, n.$$.update = () => {
    n.$$.dirty & /*el*/
    4 && t(3, r = _(d));
  }, [h, c, d, r, l, a, m];
}
class Empty extends SvelteComponent$g {
  constructor(e) {
    super(), init$g(this, e, instance$f, create_fragment$g, safe_not_equal$g, { size: 0, unpadded_box: 1 });
  }
}
const RE_HEADING = /^(#\s*)(.+)$/m;
function inject(n) {
  const e = n.trim(), t = e.match(RE_HEADING);
  if (!t)
    return [!1, e || !1];
  const [r, , a] = t, l = a.trim();
  if (e === r)
    return [l, !1];
  const h = t.index !== void 0 ? t.index + r.length : 0, d = e.substring(h).trim() || !1;
  return [l, d];
}
const {
  SvelteComponent: SvelteComponent$f,
  append_hydration: append_hydration$a,
  attr: attr$b,
  check_outros: check_outros$9,
  children: children$c,
  claim_component: claim_component$8,
  claim_element: claim_element$b,
  claim_space: claim_space$a,
  claim_text: claim_text$6,
  create_component: create_component$8,
  destroy_component: destroy_component$8,
  detach: detach$f,
  element: element$b,
  empty: empty$6,
  group_outros: group_outros$9,
  init: init$f,
  insert_hydration: insert_hydration$f,
  mount_component: mount_component$8,
  safe_not_equal: safe_not_equal$f,
  set_data: set_data$5,
  space: space$a,
  text: text$6,
  toggle_class: toggle_class$8,
  transition_in: transition_in$b,
  transition_out: transition_out$a
} = window.__gradio__svelte__internal;
function create_else_block_1$1(n) {
  let e, t;
  return e = new Upload$1({}), {
    c() {
      create_component$8(e.$$.fragment);
    },
    l(r) {
      claim_component$8(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$8(e, r, a), t = !0;
    },
    i(r) {
      t || (transition_in$b(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$a(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$8(e, r);
    }
  };
}
function create_if_block_4$2(n) {
  let e, t;
  return e = new ImagePaste({}), {
    c() {
      create_component$8(e.$$.fragment);
    },
    l(r) {
      claim_component$8(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$8(e, r, a), t = !0;
    },
    i(r) {
      t || (transition_in$b(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$a(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$8(e, r);
    }
  };
}
function create_else_block$9(n) {
  let e = (
    /*i18n*/
    n[1](
      /*defs*/
      n[7][
        /*type*/
        n[0]
      ] || /*defs*/
      n[7].file
    ) + ""
  ), t, r, a, l = (
    /*mode*/
    n[3] !== "short" && create_if_block_3$2(n)
  );
  return {
    c() {
      t = text$6(e), r = space$a(), l && l.c(), a = empty$6();
    },
    l(h) {
      t = claim_text$6(h, e), r = claim_space$a(h), l && l.l(h), a = empty$6();
    },
    m(h, c) {
      insert_hydration$f(h, t, c), insert_hydration$f(h, r, c), l && l.m(h, c), insert_hydration$f(h, a, c);
    },
    p(h, c) {
      c & /*i18n, type*/
      3 && e !== (e = /*i18n*/
      h[1](
        /*defs*/
        h[7][
          /*type*/
          h[0]
        ] || /*defs*/
        h[7].file
      ) + "") && set_data$5(t, e), /*mode*/
      h[3] !== "short" ? l ? l.p(h, c) : (l = create_if_block_3$2(h), l.c(), l.m(a.parentNode, a)) : l && (l.d(1), l = null);
    },
    d(h) {
      h && (detach$f(t), detach$f(r), detach$f(a)), l && l.d(h);
    }
  };
}
function create_if_block$b(n) {
  let e, t, r = (
    /*heading*/
    n[6] && create_if_block_2$4(n)
  ), a = (
    /*paragraph*/
    n[5] && create_if_block_1$9(n)
  );
  return {
    c() {
      r && r.c(), e = space$a(), a && a.c(), t = empty$6();
    },
    l(l) {
      r && r.l(l), e = claim_space$a(l), a && a.l(l), t = empty$6();
    },
    m(l, h) {
      r && r.m(l, h), insert_hydration$f(l, e, h), a && a.m(l, h), insert_hydration$f(l, t, h);
    },
    p(l, h) {
      /*heading*/
      l[6] ? r ? r.p(l, h) : (r = create_if_block_2$4(l), r.c(), r.m(e.parentNode, e)) : r && (r.d(1), r = null), /*paragraph*/
      l[5] ? a ? a.p(l, h) : (a = create_if_block_1$9(l), a.c(), a.m(t.parentNode, t)) : a && (a.d(1), a = null);
    },
    d(l) {
      l && (detach$f(e), detach$f(t)), r && r.d(l), a && a.d(l);
    }
  };
}
function create_if_block_3$2(n) {
  let e, t, r = (
    /*i18n*/
    n[1]("common.or") + ""
  ), a, l, h, c = (
    /*message*/
    (n[2] || /*i18n*/
    n[1]("upload_text.click_to_upload")) + ""
  ), d;
  return {
    c() {
      e = element$b("span"), t = text$6("- "), a = text$6(r), l = text$6(" -"), h = space$a(), d = text$6(c), this.h();
    },
    l(_) {
      e = claim_element$b(_, "SPAN", { class: !0 });
      var m = children$c(e);
      t = claim_text$6(m, "- "), a = claim_text$6(m, r), l = claim_text$6(m, " -"), m.forEach(detach$f), h = claim_space$a(_), d = claim_text$6(_, c), this.h();
    },
    h() {
      attr$b(e, "class", "or svelte-1xg7h5n");
    },
    m(_, m) {
      insert_hydration$f(_, e, m), append_hydration$a(e, t), append_hydration$a(e, a), append_hydration$a(e, l), insert_hydration$f(_, h, m), insert_hydration$f(_, d, m);
    },
    p(_, m) {
      m & /*i18n*/
      2 && r !== (r = /*i18n*/
      _[1]("common.or") + "") && set_data$5(a, r), m & /*message, i18n*/
      6 && c !== (c = /*message*/
      (_[2] || /*i18n*/
      _[1]("upload_text.click_to_upload")) + "") && set_data$5(d, c);
    },
    d(_) {
      _ && (detach$f(e), detach$f(h), detach$f(d));
    }
  };
}
function create_if_block_2$4(n) {
  let e, t;
  return {
    c() {
      e = element$b("h2"), t = text$6(
        /*heading*/
        n[6]
      ), this.h();
    },
    l(r) {
      e = claim_element$b(r, "H2", { class: !0 });
      var a = children$c(e);
      t = claim_text$6(
        a,
        /*heading*/
        n[6]
      ), a.forEach(detach$f), this.h();
    },
    h() {
      attr$b(e, "class", "svelte-1xg7h5n");
    },
    m(r, a) {
      insert_hydration$f(r, e, a), append_hydration$a(e, t);
    },
    p(r, a) {
      a & /*heading*/
      64 && set_data$5(
        t,
        /*heading*/
        r[6]
      );
    },
    d(r) {
      r && detach$f(e);
    }
  };
}
function create_if_block_1$9(n) {
  let e, t;
  return {
    c() {
      e = element$b("p"), t = text$6(
        /*paragraph*/
        n[5]
      ), this.h();
    },
    l(r) {
      e = claim_element$b(r, "P", { class: !0 });
      var a = children$c(e);
      t = claim_text$6(
        a,
        /*paragraph*/
        n[5]
      ), a.forEach(detach$f), this.h();
    },
    h() {
      attr$b(e, "class", "svelte-1xg7h5n");
    },
    m(r, a) {
      insert_hydration$f(r, e, a), append_hydration$a(e, t);
    },
    p(r, a) {
      a & /*paragraph*/
      32 && set_data$5(
        t,
        /*paragraph*/
        r[5]
      );
    },
    d(r) {
      r && detach$f(e);
    }
  };
}
function create_fragment$f(n) {
  let e, t, r, a, l, h;
  const c = [create_if_block_4$2, create_else_block_1$1], d = [];
  function _(b, A) {
    return (
      /*type*/
      b[0] === "clipboard" ? 0 : 1
    );
  }
  r = _(n), a = d[r] = c[r](n);
  function m(b, A) {
    return (
      /*heading*/
      b[6] || /*paragraph*/
      b[5] ? create_if_block$b : create_else_block$9
    );
  }
  let y = m(n), x = y(n);
  return {
    c() {
      e = element$b("div"), t = element$b("span"), a.c(), l = space$a(), x.c(), this.h();
    },
    l(b) {
      e = claim_element$b(b, "DIV", { class: !0 });
      var A = children$c(e);
      t = claim_element$b(A, "SPAN", { class: !0 });
      var f = children$c(t);
      a.l(f), f.forEach(detach$f), l = claim_space$a(A), x.l(A), A.forEach(detach$f), this.h();
    },
    h() {
      attr$b(t, "class", "icon-wrap svelte-1xg7h5n"), toggle_class$8(
        t,
        "hovered",
        /*hovered*/
        n[4]
      ), attr$b(e, "class", "wrap svelte-1xg7h5n");
    },
    m(b, A) {
      insert_hydration$f(b, e, A), append_hydration$a(e, t), d[r].m(t, null), append_hydration$a(e, l), x.m(e, null), h = !0;
    },
    p(b, [A]) {
      let f = r;
      r = _(b), r !== f && (group_outros$9(), transition_out$a(d[f], 1, 1, () => {
        d[f] = null;
      }), check_outros$9(), a = d[r], a || (a = d[r] = c[r](b), a.c()), transition_in$b(a, 1), a.m(t, null)), (!h || A & /*hovered*/
      16) && toggle_class$8(
        t,
        "hovered",
        /*hovered*/
        b[4]
      ), y === (y = m(b)) && x ? x.p(b, A) : (x.d(1), x = y(b), x && (x.c(), x.m(e, null)));
    },
    i(b) {
      h || (transition_in$b(a), h = !0);
    },
    o(b) {
      transition_out$a(a), h = !1;
    },
    d(b) {
      b && detach$f(e), d[r].d(), x.d();
    }
  };
}
function instance$e(n, e, t) {
  let r, a, { type: l = "file" } = e, { i18n: h } = e, { message: c = void 0 } = e, { mode: d = "full" } = e, { hovered: _ = !1 } = e, { placeholder: m = void 0 } = e;
  const y = {
    image: "upload_text.drop_image",
    video: "upload_text.drop_video",
    audio: "upload_text.drop_audio",
    file: "upload_text.drop_file",
    csv: "upload_text.drop_csv",
    gallery: "upload_text.drop_gallery",
    clipboard: "upload_text.paste_clipboard"
  };
  return n.$$set = (x) => {
    "type" in x && t(0, l = x.type), "i18n" in x && t(1, h = x.i18n), "message" in x && t(2, c = x.message), "mode" in x && t(3, d = x.mode), "hovered" in x && t(4, _ = x.hovered), "placeholder" in x && t(8, m = x.placeholder);
  }, n.$$.update = () => {
    n.$$.dirty & /*placeholder*/
    256 && t(6, [r, a] = m ? inject(m) : [!1, !1], r, (t(5, a), t(8, m)));
  }, [l, h, c, d, _, a, r, y, m];
}
class UploadText extends SvelteComponent$f {
  constructor(e) {
    super(), init$f(this, e, instance$e, create_fragment$f, safe_not_equal$f, {
      type: 0,
      i18n: 1,
      message: 2,
      mode: 3,
      hovered: 4,
      placeholder: 8
    });
  }
}
const {
  SvelteComponent: SvelteComponent$e,
  attr: attr$a,
  children: children$b,
  claim_element: claim_element$a,
  create_slot: create_slot$5,
  detach: detach$e,
  element: element$a,
  get_all_dirty_from_scope: get_all_dirty_from_scope$5,
  get_slot_changes: get_slot_changes$5,
  init: init$e,
  insert_hydration: insert_hydration$e,
  null_to_empty: null_to_empty$1,
  safe_not_equal: safe_not_equal$e,
  transition_in: transition_in$a,
  transition_out: transition_out$9,
  update_slot_base: update_slot_base$5
} = window.__gradio__svelte__internal;
function create_fragment$e(n) {
  let e, t, r;
  const a = (
    /*#slots*/
    n[2].default
  ), l = create_slot$5(
    a,
    n,
    /*$$scope*/
    n[1],
    null
  );
  return {
    c() {
      e = element$a("div"), l && l.c(), this.h();
    },
    l(h) {
      e = claim_element$a(h, "DIV", { class: !0 });
      var c = children$b(e);
      l && l.l(c), c.forEach(detach$e), this.h();
    },
    h() {
      attr$a(e, "class", t = null_to_empty$1(`icon-button-wrapper ${/*top_panel*/
      n[0] ? "top-panel" : ""}`) + " svelte-171ybii");
    },
    m(h, c) {
      insert_hydration$e(h, e, c), l && l.m(e, null), r = !0;
    },
    p(h, [c]) {
      l && l.p && (!r || c & /*$$scope*/
      2) && update_slot_base$5(
        l,
        a,
        h,
        /*$$scope*/
        h[1],
        r ? get_slot_changes$5(
          a,
          /*$$scope*/
          h[1],
          c,
          null
        ) : get_all_dirty_from_scope$5(
          /*$$scope*/
          h[1]
        ),
        null
      ), (!r || c & /*top_panel*/
      1 && t !== (t = null_to_empty$1(`icon-button-wrapper ${/*top_panel*/
      h[0] ? "top-panel" : ""}`) + " svelte-171ybii")) && attr$a(e, "class", t);
    },
    i(h) {
      r || (transition_in$a(l, h), r = !0);
    },
    o(h) {
      transition_out$9(l, h), r = !1;
    },
    d(h) {
      h && detach$e(e), l && l.d(h);
    }
  };
}
function instance$d(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { top_panel: l = !0 } = e;
  return n.$$set = (h) => {
    "top_panel" in h && t(0, l = h.top_panel), "$$scope" in h && t(1, a = h.$$scope);
  }, [l, a, r];
}
class IconButtonWrapper extends SvelteComponent$e {
  constructor(e) {
    super(), init$e(this, e, instance$d, create_fragment$e, safe_not_equal$e, { top_panel: 0 });
  }
}
const prettyBytes = (n) => {
  let e = ["B", "KB", "MB", "GB", "PB"], t = 0;
  for (; n > 1024; )
    n /= 1024, t++;
  let r = e[t];
  return n.toFixed(1) + "&nbsp;" + r;
}, { setContext, getContext } = window.__gradio__svelte__internal, WORKER_PROXY_CONTEXT_KEY = "WORKER_PROXY_CONTEXT_KEY";
function getWorkerProxyContext() {
  return getContext(WORKER_PROXY_CONTEXT_KEY);
}
const FAKE_LITE_HOST = "lite.local";
function is_self_host(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 === FAKE_LITE_HOST;
}
function getHeaderValue(n, e) {
  const t = e.toLowerCase();
  for (const [r, a] of Object.entries(n))
    if (r.toLowerCase() === t)
      return a;
}
function should_proxy_wasm_src(n) {
  const e = typeof window < "u";
  if (n == null || !e)
    return !1;
  const t = new URL(n, window.location.href);
  return !(!is_self_host(t) || t.protocol !== "http:" && t.protocol !== "https:");
}
const {
  SvelteComponent: SvelteComponent$d,
  assign: assign$1,
  check_outros: check_outros$8,
  children: children$a,
  claim_element: claim_element$9,
  compute_rest_props,
  create_slot: create_slot$4,
  detach: detach$d,
  element: element$9,
  empty: empty$5,
  exclude_internal_props,
  get_all_dirty_from_scope: get_all_dirty_from_scope$4,
  get_slot_changes: get_slot_changes$4,
  get_spread_update: get_spread_update$1,
  group_outros: group_outros$8,
  init: init$d,
  insert_hydration: insert_hydration$d,
  listen: listen$4,
  prevent_default: prevent_default$1,
  safe_not_equal: safe_not_equal$d,
  set_attributes,
  set_style: set_style$6,
  toggle_class: toggle_class$7,
  transition_in: transition_in$9,
  transition_out: transition_out$8,
  update_slot_base: update_slot_base$4
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$7 } = window.__gradio__svelte__internal;
function create_else_block_1(n) {
  let e, t, r, a, l;
  const h = (
    /*#slots*/
    n[8].default
  ), c = create_slot$4(
    h,
    n,
    /*$$scope*/
    n[7],
    null
  );
  let d = [
    { class: "download-link" },
    { href: (
      /*href*/
      n[0]
    ) },
    {
      target: t = typeof window < "u" && window.__is_colab__ ? "_blank" : null
    },
    { rel: "noopener noreferrer" },
    { download: (
      /*download*/
      n[1]
    ) },
    /*$$restProps*/
    n[6]
  ], _ = {};
  for (let m = 0; m < d.length; m += 1)
    _ = assign$1(_, d[m]);
  return {
    c() {
      e = element$9("a"), c && c.c(), this.h();
    },
    l(m) {
      e = claim_element$9(m, "A", {
        class: !0,
        href: !0,
        target: !0,
        rel: !0,
        download: !0
      });
      var y = children$a(e);
      c && c.l(y), y.forEach(detach$d), this.h();
    },
    h() {
      set_attributes(e, _), set_style$6(e, "position", "relative"), toggle_class$7(e, "svelte-151nsdd", !0);
    },
    m(m, y) {
      insert_hydration$d(m, e, y), c && c.m(e, null), r = !0, a || (l = listen$4(
        e,
        "click",
        /*dispatch*/
        n[3].bind(null, "click")
      ), a = !0);
    },
    p(m, y) {
      c && c.p && (!r || y & /*$$scope*/
      128) && update_slot_base$4(
        c,
        h,
        m,
        /*$$scope*/
        m[7],
        r ? get_slot_changes$4(
          h,
          /*$$scope*/
          m[7],
          y,
          null
        ) : get_all_dirty_from_scope$4(
          /*$$scope*/
          m[7]
        ),
        null
      ), set_attributes(e, _ = get_spread_update$1(d, [
        { class: "download-link" },
        (!r || y & /*href*/
        1) && { href: (
          /*href*/
          m[0]
        ) },
        { target: t },
        { rel: "noopener noreferrer" },
        (!r || y & /*download*/
        2) && { download: (
          /*download*/
          m[1]
        ) },
        y & /*$$restProps*/
        64 && /*$$restProps*/
        m[6]
      ])), set_style$6(e, "position", "relative"), toggle_class$7(e, "svelte-151nsdd", !0);
    },
    i(m) {
      r || (transition_in$9(c, m), r = !0);
    },
    o(m) {
      transition_out$8(c, m), r = !1;
    },
    d(m) {
      m && detach$d(e), c && c.d(m), a = !1, l();
    }
  };
}
function create_if_block$a(n) {
  let e, t, r, a;
  const l = [create_if_block_1$8, create_else_block$8], h = [];
  function c(d, _) {
    return (
      /*is_downloading*/
      d[2] ? 0 : 1
    );
  }
  return e = c(n), t = h[e] = l[e](n), {
    c() {
      t.c(), r = empty$5();
    },
    l(d) {
      t.l(d), r = empty$5();
    },
    m(d, _) {
      h[e].m(d, _), insert_hydration$d(d, r, _), a = !0;
    },
    p(d, _) {
      let m = e;
      e = c(d), e === m ? h[e].p(d, _) : (group_outros$8(), transition_out$8(h[m], 1, 1, () => {
        h[m] = null;
      }), check_outros$8(), t = h[e], t ? t.p(d, _) : (t = h[e] = l[e](d), t.c()), transition_in$9(t, 1), t.m(r.parentNode, r));
    },
    i(d) {
      a || (transition_in$9(t), a = !0);
    },
    o(d) {
      transition_out$8(t), a = !1;
    },
    d(d) {
      d && detach$d(r), h[e].d(d);
    }
  };
}
function create_else_block$8(n) {
  let e, t, r, a;
  const l = (
    /*#slots*/
    n[8].default
  ), h = create_slot$4(
    l,
    n,
    /*$$scope*/
    n[7],
    null
  );
  let c = [
    /*$$restProps*/
    n[6],
    { href: (
      /*href*/
      n[0]
    ) }
  ], d = {};
  for (let _ = 0; _ < c.length; _ += 1)
    d = assign$1(d, c[_]);
  return {
    c() {
      e = element$9("a"), h && h.c(), this.h();
    },
    l(_) {
      e = claim_element$9(_, "A", { href: !0 });
      var m = children$a(e);
      h && h.l(m), m.forEach(detach$d), this.h();
    },
    h() {
      set_attributes(e, d), toggle_class$7(e, "svelte-151nsdd", !0);
    },
    m(_, m) {
      insert_hydration$d(_, e, m), h && h.m(e, null), t = !0, r || (a = listen$4(e, "click", prevent_default$1(
        /*wasm_click_handler*/
        n[5]
      )), r = !0);
    },
    p(_, m) {
      h && h.p && (!t || m & /*$$scope*/
      128) && update_slot_base$4(
        h,
        l,
        _,
        /*$$scope*/
        _[7],
        t ? get_slot_changes$4(
          l,
          /*$$scope*/
          _[7],
          m,
          null
        ) : get_all_dirty_from_scope$4(
          /*$$scope*/
          _[7]
        ),
        null
      ), set_attributes(e, d = get_spread_update$1(c, [
        m & /*$$restProps*/
        64 && /*$$restProps*/
        _[6],
        (!t || m & /*href*/
        1) && { href: (
          /*href*/
          _[0]
        ) }
      ])), toggle_class$7(e, "svelte-151nsdd", !0);
    },
    i(_) {
      t || (transition_in$9(h, _), t = !0);
    },
    o(_) {
      transition_out$8(h, _), t = !1;
    },
    d(_) {
      _ && detach$d(e), h && h.d(_), r = !1, a();
    }
  };
}
function create_if_block_1$8(n) {
  let e;
  const t = (
    /*#slots*/
    n[8].default
  ), r = create_slot$4(
    t,
    n,
    /*$$scope*/
    n[7],
    null
  );
  return {
    c() {
      r && r.c();
    },
    l(a) {
      r && r.l(a);
    },
    m(a, l) {
      r && r.m(a, l), e = !0;
    },
    p(a, l) {
      r && r.p && (!e || l & /*$$scope*/
      128) && update_slot_base$4(
        r,
        t,
        a,
        /*$$scope*/
        a[7],
        e ? get_slot_changes$4(
          t,
          /*$$scope*/
          a[7],
          l,
          null
        ) : get_all_dirty_from_scope$4(
          /*$$scope*/
          a[7]
        ),
        null
      );
    },
    i(a) {
      e || (transition_in$9(r, a), e = !0);
    },
    o(a) {
      transition_out$8(r, a), e = !1;
    },
    d(a) {
      r && r.d(a);
    }
  };
}
function create_fragment$d(n) {
  let e, t, r, a, l;
  const h = [create_if_block$a, create_else_block_1], c = [];
  function d(_, m) {
    return m & /*href*/
    1 && (e = null), e == null && (e = !!/*worker_proxy*/
    (_[4] && should_proxy_wasm_src(
      /*href*/
      _[0]
    ))), e ? 0 : 1;
  }
  return t = d(n, -1), r = c[t] = h[t](n), {
    c() {
      r.c(), a = empty$5();
    },
    l(_) {
      r.l(_), a = empty$5();
    },
    m(_, m) {
      c[t].m(_, m), insert_hydration$d(_, a, m), l = !0;
    },
    p(_, [m]) {
      let y = t;
      t = d(_, m), t === y ? c[t].p(_, m) : (group_outros$8(), transition_out$8(c[y], 1, 1, () => {
        c[y] = null;
      }), check_outros$8(), r = c[t], r ? r.p(_, m) : (r = c[t] = h[t](_), r.c()), transition_in$9(r, 1), r.m(a.parentNode, a));
    },
    i(_) {
      l || (transition_in$9(r), l = !0);
    },
    o(_) {
      transition_out$8(r), l = !1;
    },
    d(_) {
      _ && detach$d(a), c[t].d(_);
    }
  };
}
function instance$c(n, e, t) {
  const r = ["href", "download"];
  let a = compute_rest_props(e, r), { $$slots: l = {}, $$scope: h } = e;
  var c = this && this.__awaiter || function(A, f, s, u) {
    function p(g) {
      return g instanceof s ? g : new s(function(w) {
        w(g);
      });
    }
    return new (s || (s = Promise))(function(g, w) {
      function o(E) {
        try {
          M(u.next(E));
        } catch ($) {
          w($);
        }
      }
      function v(E) {
        try {
          M(u.throw(E));
        } catch ($) {
          w($);
        }
      }
      function M(E) {
        E.done ? g(E.value) : p(E.value).then(o, v);
      }
      M((u = u.apply(A, f || [])).next());
    });
  };
  let { href: d = void 0 } = e, { download: _ } = e;
  const m = createEventDispatcher$7();
  let y = !1;
  const x = getWorkerProxyContext();
  function b() {
    return c(this, void 0, void 0, function* () {
      if (y)
        return;
      if (m("click"), d == null)
        throw new Error("href is not defined.");
      if (x == null)
        throw new Error("Wasm worker proxy is not available.");
      const f = new URL(d, window.location.href).pathname;
      t(2, y = !0), x.httpRequest({
        method: "GET",
        path: f,
        headers: {},
        query_string: ""
      }).then((s) => {
        if (s.status !== 200)
          throw new Error(`Failed to get file ${f} from the Wasm worker.`);
        const u = new Blob(
          [s.body],
          {
            type: getHeaderValue(s.headers, "content-type")
          }
        ), p = URL.createObjectURL(u), g = document.createElement("a");
        g.href = p, g.download = _, g.click(), URL.revokeObjectURL(p);
      }).finally(() => {
        t(2, y = !1);
      });
    });
  }
  return n.$$set = (A) => {
    e = assign$1(assign$1({}, e), exclude_internal_props(A)), t(6, a = compute_rest_props(e, r)), "href" in A && t(0, d = A.href), "download" in A && t(1, _ = A.download), "$$scope" in A && t(7, h = A.$$scope);
  }, [
    d,
    _,
    y,
    m,
    x,
    b,
    a,
    h,
    l
  ];
}
class DownloadLink extends SvelteComponent$d {
  constructor(e) {
    super(), init$d(this, e, instance$c, create_fragment$d, safe_not_equal$d, { href: 0, download: 1 });
  }
}
const {
  HtmlTagHydration,
  SvelteComponent: SvelteComponent$c,
  append_hydration: append_hydration$9,
  attr: attr$9,
  check_outros: check_outros$7,
  children: children$9,
  claim_component: claim_component$7,
  claim_element: claim_element$8,
  claim_html_tag,
  claim_space: claim_space$9,
  claim_text: claim_text$5,
  create_component: create_component$7,
  destroy_component: destroy_component$7,
  detach: detach$c,
  element: element$8,
  ensure_array_like: ensure_array_like$3,
  get_svelte_dataset: get_svelte_dataset$3,
  group_outros: group_outros$7,
  init: init$c,
  insert_hydration: insert_hydration$c,
  listen: listen$3,
  mount_component: mount_component$7,
  noop: noop$8,
  outro_and_destroy_block,
  run_all: run_all$3,
  safe_not_equal: safe_not_equal$c,
  set_data: set_data$4,
  set_style: set_style$5,
  space: space$9,
  text: text$5,
  toggle_class: toggle_class$6,
  transition_in: transition_in$8,
  transition_out: transition_out$7,
  update_keyed_each
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$6 } = window.__gradio__svelte__internal;
function get_each_context$3(n, e, t) {
  const r = n.slice();
  return r[11] = e[t], r[13] = t, r;
}
function create_else_block$7(n) {
  let e = (
    /*i18n*/
    n[2]("file.uploading") + ""
  ), t;
  return {
    c() {
      t = text$5(e);
    },
    l(r) {
      t = claim_text$5(r, e);
    },
    m(r, a) {
      insert_hydration$c(r, t, a);
    },
    p(r, a) {
      a & /*i18n*/
      4 && e !== (e = /*i18n*/
      r[2]("file.uploading") + "") && set_data$4(t, e);
    },
    i: noop$8,
    o: noop$8,
    d(r) {
      r && detach$c(t);
    }
  };
}
function create_if_block_1$7(n) {
  let e, t;
  return e = new DownloadLink({
    props: {
      href: (
        /*file*/
        n[11].url
      ),
      download: window.__is_colab__ ? null : (
        /*file*/
        n[11].orig_name
      ),
      $$slots: { default: [create_default_slot$4] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      create_component$7(e.$$.fragment);
    },
    l(r) {
      claim_component$7(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$7(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*normalized_files*/
      8 && (l.href = /*file*/
      r[11].url), a & /*normalized_files*/
      8 && (l.download = window.__is_colab__ ? null : (
        /*file*/
        r[11].orig_name
      )), a & /*$$scope, normalized_files*/
      16392 && (l.$$scope = { dirty: a, ctx: r }), e.$set(l);
    },
    i(r) {
      t || (transition_in$8(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$7(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$7(e, r);
    }
  };
}
function create_default_slot$4(n) {
  let e, t = (
    /*file*/
    (n[11].size != null ? prettyBytes(
      /*file*/
      n[11].size
    ) : "(size unknown)") + ""
  ), r;
  return {
    c() {
      e = new HtmlTagHydration(!1), r = text$5(" ⇣"), this.h();
    },
    l(a) {
      e = claim_html_tag(a, !1), r = claim_text$5(a, " ⇣"), this.h();
    },
    h() {
      e.a = r;
    },
    m(a, l) {
      e.m(t, a, l), insert_hydration$c(a, r, l);
    },
    p(a, l) {
      l & /*normalized_files*/
      8 && t !== (t = /*file*/
      (a[11].size != null ? prettyBytes(
        /*file*/
        a[11].size
      ) : "(size unknown)") + "") && e.p(t);
    },
    d(a) {
      a && (e.d(), detach$c(r));
    }
  };
}
function create_if_block$9(n) {
  let e, t, r = "×", a, l;
  function h() {
    return (
      /*click_handler*/
      n[7](
        /*i*/
        n[13]
      )
    );
  }
  function c(...d) {
    return (
      /*keydown_handler*/
      n[8](
        /*i*/
        n[13],
        ...d
      )
    );
  }
  return {
    c() {
      e = element$8("td"), t = element$8("button"), t.textContent = r, this.h();
    },
    l(d) {
      e = claim_element$8(d, "TD", { class: !0 });
      var _ = children$9(e);
      t = claim_element$8(_, "BUTTON", {
        class: !0,
        "aria-label": !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$3(t) !== "svelte-nhtord" && (t.textContent = r), _.forEach(detach$c), this.h();
    },
    h() {
      attr$9(t, "class", "label-clear-button svelte-1g4vug2"), attr$9(t, "aria-label", "Remove this file"), attr$9(e, "class", "svelte-1g4vug2");
    },
    m(d, _) {
      insert_hydration$c(d, e, _), append_hydration$9(e, t), a || (l = [
        listen$3(t, "click", h),
        listen$3(t, "keydown", c)
      ], a = !0);
    },
    p(d, _) {
      n = d;
    },
    d(d) {
      d && detach$c(e), a = !1, run_all$3(l);
    }
  };
}
function create_each_block$3(n, e) {
  let t, r, a, l = (
    /*file*/
    e[11].filename_stem + ""
  ), h, c, d, _ = (
    /*file*/
    e[11].filename_ext + ""
  ), m, y, x, b, A, f, s, u, p, g, w;
  const o = [create_if_block_1$7, create_else_block$7], v = [];
  function M(k, L) {
    return (
      /*file*/
      k[11].url ? 0 : 1
    );
  }
  A = M(e), f = v[A] = o[A](e);
  let E = (
    /*normalized_files*/
    e[3].length > 1 && create_if_block$9(e)
  );
  function $(...k) {
    return (
      /*click_handler_1*/
      e[9](
        /*i*/
        e[13],
        ...k
      )
    );
  }
  return {
    key: n,
    first: null,
    c() {
      t = element$8("tr"), r = element$8("td"), a = element$8("span"), h = text$5(l), c = space$9(), d = element$8("span"), m = text$5(_), x = space$9(), b = element$8("td"), f.c(), s = space$9(), E && E.c(), u = space$9(), this.h();
    },
    l(k) {
      t = claim_element$8(k, "TR", { class: !0 });
      var L = children$9(t);
      r = claim_element$8(L, "TD", { class: !0, "aria-label": !0 });
      var z = children$9(r);
      a = claim_element$8(z, "SPAN", { class: !0 });
      var O = children$9(a);
      h = claim_text$5(O, l), O.forEach(detach$c), c = claim_space$9(z), d = claim_element$8(z, "SPAN", { class: !0 });
      var R = children$9(d);
      m = claim_text$5(R, _), R.forEach(detach$c), z.forEach(detach$c), x = claim_space$9(L), b = claim_element$8(L, "TD", { class: !0 });
      var N = children$9(b);
      f.l(N), N.forEach(detach$c), s = claim_space$9(L), E && E.l(L), u = claim_space$9(L), L.forEach(detach$c), this.h();
    },
    h() {
      attr$9(a, "class", "stem svelte-1g4vug2"), attr$9(d, "class", "ext svelte-1g4vug2"), attr$9(r, "class", "filename svelte-1g4vug2"), attr$9(r, "aria-label", y = /*file*/
      e[11].orig_name), attr$9(b, "class", "download svelte-1g4vug2"), attr$9(t, "class", "file svelte-1g4vug2"), toggle_class$6(
        t,
        "selectable",
        /*selectable*/
        e[0]
      ), this.first = t;
    },
    m(k, L) {
      insert_hydration$c(k, t, L), append_hydration$9(t, r), append_hydration$9(r, a), append_hydration$9(a, h), append_hydration$9(r, c), append_hydration$9(r, d), append_hydration$9(d, m), append_hydration$9(t, x), append_hydration$9(t, b), v[A].m(b, null), append_hydration$9(t, s), E && E.m(t, null), append_hydration$9(t, u), p = !0, g || (w = listen$3(t, "click", $), g = !0);
    },
    p(k, L) {
      e = k, (!p || L & /*normalized_files*/
      8) && l !== (l = /*file*/
      e[11].filename_stem + "") && set_data$4(h, l), (!p || L & /*normalized_files*/
      8) && _ !== (_ = /*file*/
      e[11].filename_ext + "") && set_data$4(m, _), (!p || L & /*normalized_files*/
      8 && y !== (y = /*file*/
      e[11].orig_name)) && attr$9(r, "aria-label", y);
      let z = A;
      A = M(e), A === z ? v[A].p(e, L) : (group_outros$7(), transition_out$7(v[z], 1, 1, () => {
        v[z] = null;
      }), check_outros$7(), f = v[A], f ? f.p(e, L) : (f = v[A] = o[A](e), f.c()), transition_in$8(f, 1), f.m(b, null)), /*normalized_files*/
      e[3].length > 1 ? E ? E.p(e, L) : (E = create_if_block$9(e), E.c(), E.m(t, u)) : E && (E.d(1), E = null), (!p || L & /*selectable*/
      1) && toggle_class$6(
        t,
        "selectable",
        /*selectable*/
        e[0]
      );
    },
    i(k) {
      p || (transition_in$8(f), p = !0);
    },
    o(k) {
      transition_out$7(f), p = !1;
    },
    d(k) {
      k && detach$c(t), v[A].d(), E && E.d(), g = !1, w();
    }
  };
}
function create_fragment$c(n) {
  let e, t, r, a = [], l = /* @__PURE__ */ new Map(), h, c = ensure_array_like$3(
    /*normalized_files*/
    n[3]
  );
  const d = (_) => (
    /*file*/
    _[11]
  );
  for (let _ = 0; _ < c.length; _ += 1) {
    let m = get_each_context$3(n, c, _), y = d(m);
    l.set(y, a[_] = create_each_block$3(y, m));
  }
  return {
    c() {
      e = element$8("div"), t = element$8("table"), r = element$8("tbody");
      for (let _ = 0; _ < a.length; _ += 1)
        a[_].c();
      this.h();
    },
    l(_) {
      e = claim_element$8(_, "DIV", { class: !0, style: !0 });
      var m = children$9(e);
      t = claim_element$8(m, "TABLE", { class: !0 });
      var y = children$9(t);
      r = claim_element$8(y, "TBODY", { class: !0 });
      var x = children$9(r);
      for (let b = 0; b < a.length; b += 1)
        a[b].l(x);
      x.forEach(detach$c), y.forEach(detach$c), m.forEach(detach$c), this.h();
    },
    h() {
      attr$9(r, "class", "svelte-1g4vug2"), attr$9(t, "class", "file-preview svelte-1g4vug2"), attr$9(e, "class", "file-preview-holder svelte-1g4vug2"), set_style$5(e, "max-height", typeof /*height*/
      n[1] === void 0 ? "auto" : (
        /*height*/
        n[1] + "px"
      ));
    },
    m(_, m) {
      insert_hydration$c(_, e, m), append_hydration$9(e, t), append_hydration$9(t, r);
      for (let y = 0; y < a.length; y += 1)
        a[y] && a[y].m(r, null);
      h = !0;
    },
    p(_, [m]) {
      m & /*selectable, handle_row_click, normalized_files, remove_file, window, i18n*/
      61 && (c = ensure_array_like$3(
        /*normalized_files*/
        _[3]
      ), group_outros$7(), a = update_keyed_each(a, m, d, 1, _, c, l, r, outro_and_destroy_block, create_each_block$3, null, get_each_context$3), check_outros$7()), (!h || m & /*height*/
      2) && set_style$5(e, "max-height", typeof /*height*/
      _[1] === void 0 ? "auto" : (
        /*height*/
        _[1] + "px"
      ));
    },
    i(_) {
      if (!h) {
        for (let m = 0; m < c.length; m += 1)
          transition_in$8(a[m]);
        h = !0;
      }
    },
    o(_) {
      for (let m = 0; m < a.length; m += 1)
        transition_out$7(a[m]);
      h = !1;
    },
    d(_) {
      _ && detach$c(e);
      for (let m = 0; m < a.length; m += 1)
        a[m].d();
    }
  };
}
function split_filename(n) {
  const e = n.lastIndexOf(".");
  return e === -1 ? [n, ""] : [n.slice(0, e), n.slice(e)];
}
function instance$b(n, e, t) {
  let r;
  const a = createEventDispatcher$6();
  let { value: l } = e, { selectable: h = !1 } = e, { height: c = void 0 } = e, { i18n: d } = e;
  function _(A, f) {
    const s = A.currentTarget;
    (A.target === s || // Only select if the click is on the row itself
    s && s.firstElementChild && A.composedPath().includes(s.firstElementChild)) && a("select", {
      value: r[f].orig_name,
      index: f
    });
  }
  function m(A) {
    const f = r.splice(A, 1);
    t(3, r = [...r]), t(6, l = r), a("delete", f[0]), a("change", r);
  }
  const y = (A) => {
    m(A);
  }, x = (A, f) => {
    f.key === "Enter" && m(A);
  }, b = (A, f) => {
    _(f, A);
  };
  return n.$$set = (A) => {
    "value" in A && t(6, l = A.value), "selectable" in A && t(0, h = A.selectable), "height" in A && t(1, c = A.height), "i18n" in A && t(2, d = A.i18n);
  }, n.$$.update = () => {
    n.$$.dirty & /*value*/
    64 && t(3, r = (Array.isArray(l) ? l : [l]).map((A) => {
      var f;
      const [s, u] = split_filename((f = A.orig_name) !== null && f !== void 0 ? f : "");
      return Object.assign(Object.assign({}, A), { filename_stem: s, filename_ext: u });
    }));
  }, [
    h,
    c,
    d,
    r,
    _,
    m,
    l,
    y,
    x,
    b
  ];
}
class FilePreview extends SvelteComponent$c {
  constructor(e) {
    super(), init$c(this, e, instance$b, create_fragment$c, safe_not_equal$c, {
      value: 6,
      selectable: 0,
      height: 1,
      i18n: 2
    });
  }
}
var _3Dmol$1 = { exports: {} };
/*!
 * 3dmol v2.4.0
 * JavaScript/TypeScript molecular visualization library
 * Author: David Koes and contributors
 */
(function(module, exports) {
  (function(e, t) {
    module.exports = t();
  })(commonjsGlobal, () => (
    /******/
    (() => {
      var __webpack_modules__ = {
        /***/
        "./node_modules/iobuffer/lib-esm/IOBuffer.js": (
          /*!***************************************************!*\
            !*** ./node_modules/iobuffer/lib-esm/IOBuffer.js ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              IOBuffer: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var r = t(
              /*! ./text */
              "./node_modules/iobuffer/lib-esm/text.browser.js"
            );
            const a = 1024 * 8, l = (() => {
              const d = new Uint8Array(4), _ = new Uint32Array(d.buffer);
              return !((_[0] = 1) & d[0]);
            })(), h = {
              int8: globalThis.Int8Array,
              uint8: globalThis.Uint8Array,
              int16: globalThis.Int16Array,
              uint16: globalThis.Uint16Array,
              int32: globalThis.Int32Array,
              uint32: globalThis.Uint32Array,
              uint64: globalThis.BigUint64Array,
              int64: globalThis.BigInt64Array,
              float32: globalThis.Float32Array,
              float64: globalThis.Float64Array
            };
            class c {
              /**
               * @param data - The data to construct the IOBuffer with.
               * If data is a number, it will be the new buffer's length<br>
               * If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>
               * If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,
               * or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.
               * @param options
               */
              constructor(_ = a, m = {}) {
                let y = !1;
                typeof _ == "number" ? _ = new ArrayBuffer(_) : (y = !0, this.lastWrittenByte = _.byteLength);
                const x = m.offset ? m.offset >>> 0 : 0, b = _.byteLength - x;
                let A = x;
                (ArrayBuffer.isView(_) || _ instanceof c) && (_.byteLength !== _.buffer.byteLength && (A = _.byteOffset + x), _ = _.buffer), y ? this.lastWrittenByte = b : this.lastWrittenByte = 0, this.buffer = _, this.length = b, this.byteLength = b, this.byteOffset = A, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, A, b), this._mark = 0, this._marks = [];
              }
              /**
               * Checks if the memory allocated to the buffer is sufficient to store more
               * bytes after the offset.
               * @param byteLength - The needed memory in bytes.
               * @returns `true` if there is sufficient space and `false` otherwise.
               */
              available(_ = 1) {
                return this.offset + _ <= this.length;
              }
              /**
               * Check if little-endian mode is used for reading and writing multi-byte
               * values.
               * @returns `true` if little-endian mode is used, `false` otherwise.
               */
              isLittleEndian() {
                return this.littleEndian;
              }
              /**
               * Set little-endian mode for reading and writing multi-byte values.
               */
              setLittleEndian() {
                return this.littleEndian = !0, this;
              }
              /**
               * Check if big-endian mode is used for reading and writing multi-byte values.
               * @returns `true` if big-endian mode is used, `false` otherwise.
               */
              isBigEndian() {
                return !this.littleEndian;
              }
              /**
               * Switches to big-endian mode for reading and writing multi-byte values.
               */
              setBigEndian() {
                return this.littleEndian = !1, this;
              }
              /**
               * Move the pointer n bytes forward.
               * @param n - Number of bytes to skip.
               */
              skip(_ = 1) {
                return this.offset += _, this;
              }
              /**
               * Move the pointer n bytes backward.
               * @param n - Number of bytes to move back.
               */
              back(_ = 1) {
                return this.offset -= _, this;
              }
              /**
               * Move the pointer to the given offset.
               * @param offset
               */
              seek(_) {
                return this.offset = _, this;
              }
              /**
               * Store the current pointer offset.
               * @see {@link IOBuffer#reset}
               */
              mark() {
                return this._mark = this.offset, this;
              }
              /**
               * Move the pointer back to the last pointer offset set by mark.
               * @see {@link IOBuffer#mark}
               */
              reset() {
                return this.offset = this._mark, this;
              }
              /**
               * Push the current pointer offset to the mark stack.
               * @see {@link IOBuffer#popMark}
               */
              pushMark() {
                return this._marks.push(this.offset), this;
              }
              /**
               * Pop the last pointer offset from the mark stack, and set the current
               * pointer offset to the popped value.
               * @see {@link IOBuffer#pushMark}
               */
              popMark() {
                const _ = this._marks.pop();
                if (_ === void 0)
                  throw new Error("Mark stack empty");
                return this.seek(_), this;
              }
              /**
               * Move the pointer offset back to 0.
               */
              rewind() {
                return this.offset = 0, this;
              }
              /**
               * Make sure the buffer has sufficient memory to write a given byteLength at
               * the current pointer offset.
               * If the buffer's memory is insufficient, this method will create a new
               * buffer (a copy) with a length that is twice (byteLength + current offset).
               * @param byteLength
               */
              ensureAvailable(_ = 1) {
                if (!this.available(_)) {
                  const y = (this.offset + _) * 2, x = new Uint8Array(y);
                  x.set(new Uint8Array(this.buffer)), this.buffer = x.buffer, this.length = this.byteLength = y, this._data = new DataView(this.buffer);
                }
                return this;
              }
              /**
               * Read a byte and return false if the byte's value is 0, or true otherwise.
               * Moves pointer forward by one byte.
               */
              readBoolean() {
                return this.readUint8() !== 0;
              }
              /**
               * Read a signed 8-bit integer and move pointer forward by 1 byte.
               */
              readInt8() {
                return this._data.getInt8(this.offset++);
              }
              /**
               * Read an unsigned 8-bit integer and move pointer forward by 1 byte.
               */
              readUint8() {
                return this._data.getUint8(this.offset++);
              }
              /**
               * Alias for {@link IOBuffer#readUint8}.
               */
              readByte() {
                return this.readUint8();
              }
              /**
               * Read `n` bytes and move pointer forward by `n` bytes.
               */
              readBytes(_ = 1) {
                return this.readArray(_, "uint8");
              }
              /**
               * Creates an array of corresponding to the type `type` and size `size`.
               * For example type `uint8` will create a `Uint8Array`.
               * @param size - size of the resulting array
               * @param type - number type of elements to read
               */
              readArray(_, m) {
                const y = h[m].BYTES_PER_ELEMENT * _, x = this.byteOffset + this.offset, b = this.buffer.slice(x, x + y);
                if (this.littleEndian === l && m !== "uint8" && m !== "int8") {
                  const f = new Uint8Array(this.buffer.slice(x, x + y));
                  f.reverse();
                  const s = new h[m](f.buffer);
                  return this.offset += y, s.reverse(), s;
                }
                const A = new h[m](b);
                return this.offset += y, A;
              }
              /**
               * Read a 16-bit signed integer and move pointer forward by 2 bytes.
               */
              readInt16() {
                const _ = this._data.getInt16(this.offset, this.littleEndian);
                return this.offset += 2, _;
              }
              /**
               * Read a 16-bit unsigned integer and move pointer forward by 2 bytes.
               */
              readUint16() {
                const _ = this._data.getUint16(this.offset, this.littleEndian);
                return this.offset += 2, _;
              }
              /**
               * Read a 32-bit signed integer and move pointer forward by 4 bytes.
               */
              readInt32() {
                const _ = this._data.getInt32(this.offset, this.littleEndian);
                return this.offset += 4, _;
              }
              /**
               * Read a 32-bit unsigned integer and move pointer forward by 4 bytes.
               */
              readUint32() {
                const _ = this._data.getUint32(this.offset, this.littleEndian);
                return this.offset += 4, _;
              }
              /**
               * Read a 32-bit floating number and move pointer forward by 4 bytes.
               */
              readFloat32() {
                const _ = this._data.getFloat32(this.offset, this.littleEndian);
                return this.offset += 4, _;
              }
              /**
               * Read a 64-bit floating number and move pointer forward by 8 bytes.
               */
              readFloat64() {
                const _ = this._data.getFloat64(this.offset, this.littleEndian);
                return this.offset += 8, _;
              }
              /**
               * Read a 64-bit signed integer number and move pointer forward by 8 bytes.
               */
              readBigInt64() {
                const _ = this._data.getBigInt64(this.offset, this.littleEndian);
                return this.offset += 8, _;
              }
              /**
               * Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.
               */
              readBigUint64() {
                const _ = this._data.getBigUint64(this.offset, this.littleEndian);
                return this.offset += 8, _;
              }
              /**
               * Read a 1-byte ASCII character and move pointer forward by 1 byte.
               */
              readChar() {
                return String.fromCharCode(this.readInt8());
              }
              /**
               * Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.
               */
              readChars(_ = 1) {
                let m = "";
                for (let y = 0; y < _; y++)
                  m += this.readChar();
                return m;
              }
              /**
               * Read the next `n` bytes, return a UTF-8 decoded string and move pointer
               * forward by `n` bytes.
               */
              readUtf8(_ = 1) {
                return (0, r.decode)(this.readBytes(_));
              }
              /**
               * Read the next `n` bytes, return a string decoded with `encoding` and move pointer
               * forward by `n` bytes.
               * If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}
               */
              decodeText(_ = 1, m = "utf-8") {
                return (0, r.decode)(this.readBytes(_), m);
              }
              /**
               * Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer
               * forward by 1 byte.
               */
              writeBoolean(_) {
                return this.writeUint8(_ ? 255 : 0), this;
              }
              /**
               * Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.
               */
              writeInt8(_) {
                return this.ensureAvailable(1), this._data.setInt8(this.offset++, _), this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as an 8-bit unsigned integer and move pointer forward by 1
               * byte.
               */
              writeUint8(_) {
                return this.ensureAvailable(1), this._data.setUint8(this.offset++, _), this._updateLastWrittenByte(), this;
              }
              /**
               * An alias for {@link IOBuffer#writeUint8}.
               */
              writeByte(_) {
                return this.writeUint8(_);
              }
              /**
               * Write all elements of `bytes` as uint8 values and move pointer forward by
               * `bytes.length` bytes.
               */
              writeBytes(_) {
                this.ensureAvailable(_.length);
                for (let m = 0; m < _.length; m++)
                  this._data.setUint8(this.offset++, _[m]);
                return this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 16-bit signed integer and move pointer forward by 2
               * bytes.
               */
              writeInt16(_) {
                return this.ensureAvailable(2), this._data.setInt16(this.offset, _, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 16-bit unsigned integer and move pointer forward by 2
               * bytes.
               */
              writeUint16(_) {
                return this.ensureAvailable(2), this._data.setUint16(this.offset, _, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 32-bit signed integer and move pointer forward by 4
               * bytes.
               */
              writeInt32(_) {
                return this.ensureAvailable(4), this._data.setInt32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 32-bit unsigned integer and move pointer forward by 4
               * bytes.
               */
              writeUint32(_) {
                return this.ensureAvailable(4), this._data.setUint32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 32-bit floating number and move pointer forward by 4
               * bytes.
               */
              writeFloat32(_) {
                return this.ensureAvailable(4), this._data.setFloat32(this.offset, _, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 64-bit floating number and move pointer forward by 8
               * bytes.
               */
              writeFloat64(_) {
                return this.ensureAvailable(8), this._data.setFloat64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 64-bit signed bigint and move pointer forward by 8
               * bytes.
               */
              writeBigInt64(_) {
                return this.ensureAvailable(8), this._data.setBigInt64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
              }
              /**
               * Write `value` as a 64-bit unsigned bigint and move pointer forward by 8
               * bytes.
               */
              writeBigUint64(_) {
                return this.ensureAvailable(8), this._data.setBigUint64(this.offset, _, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
              }
              /**
               * Write the charCode of `str`'s first character as an 8-bit unsigned integer
               * and move pointer forward by 1 byte.
               */
              writeChar(_) {
                return this.writeUint8(_.charCodeAt(0));
              }
              /**
               * Write the charCodes of all `str`'s characters as 8-bit unsigned integers
               * and move pointer forward by `str.length` bytes.
               */
              writeChars(_) {
                for (let m = 0; m < _.length; m++)
                  this.writeUint8(_.charCodeAt(m));
                return this;
              }
              /**
               * UTF-8 encode and write `str` to the current pointer offset and move pointer
               * forward according to the encoded length.
               */
              writeUtf8(_) {
                return this.writeBytes((0, r.encode)(_));
              }
              /**
               * Export a Uint8Array view of the internal buffer.
               * The view starts at the byte offset and its length
               * is calculated to stop at the last written byte or the original length.
               */
              toArray() {
                return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);
              }
              /**
               * Update the last written byte offset
               * @private
               */
              _updateLastWrittenByte() {
                this.offset > this.lastWrittenByte && (this.lastWrittenByte = this.offset);
              }
            }
          }
        ),
        /***/
        "./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js": (
          /*!*****************************************************************!*\
            !*** ./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js ***!
            \*****************************************************************/
          /***/
          function() {
            (function(n) {
              if (n.TextEncoder && n.TextDecoder)
                return !1;
              function e(r = "utf-8") {
                if (r !== "utf-8")
                  throw new RangeError(`Failed to construct 'TextEncoder': The encoding label provided ('${r}') is invalid.`);
              }
              Object.defineProperty(e.prototype, "encoding", {
                value: "utf-8"
              }), e.prototype.encode = function(r, a = { stream: !1 }) {
                if (a.stream)
                  throw new Error("Failed to encode: the 'stream' option is unsupported.");
                let l = 0;
                const h = r.length;
                let c = 0, d = Math.max(32, h + (h >> 1) + 7), _ = new Uint8Array(d >> 3 << 3);
                for (; l < h; ) {
                  let m = r.charCodeAt(l++);
                  if (m >= 55296 && m <= 56319) {
                    if (l < h) {
                      const y = r.charCodeAt(l);
                      (y & 64512) === 56320 && (++l, m = ((m & 1023) << 10) + (y & 1023) + 65536);
                    }
                    if (m >= 55296 && m <= 56319)
                      continue;
                  }
                  if (c + 4 > _.length) {
                    d += 8, d *= 1 + l / r.length * 2, d = d >> 3 << 3;
                    const y = new Uint8Array(d);
                    y.set(_), _ = y;
                  }
                  if (m & 4294967168)
                    if (!(m & 4294965248))
                      _[c++] = m >> 6 & 31 | 192;
                    else if (!(m & 4294901760))
                      _[c++] = m >> 12 & 15 | 224, _[c++] = m >> 6 & 63 | 128;
                    else if (!(m & 4292870144))
                      _[c++] = m >> 18 & 7 | 240, _[c++] = m >> 12 & 63 | 128, _[c++] = m >> 6 & 63 | 128;
                    else
                      continue;
                  else {
                    _[c++] = m;
                    continue;
                  }
                  _[c++] = m & 63 | 128;
                }
                return _.slice(0, c);
              };
              function t(r = "utf-8", a = { fatal: !1 }) {
                if (r !== "utf-8")
                  throw new RangeError(`Failed to construct 'TextDecoder': The encoding label provided ('${r}') is invalid.`);
                if (a.fatal)
                  throw new Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");
              }
              Object.defineProperty(t.prototype, "encoding", {
                value: "utf-8"
              }), Object.defineProperty(t.prototype, "fatal", { value: !1 }), Object.defineProperty(t.prototype, "ignoreBOM", {
                value: !1
              }), t.prototype.decode = function(r, a = { stream: !1 }) {
                if (a.stream)
                  throw new Error("Failed to decode: the 'stream' option is unsupported.");
                const l = new Uint8Array(r);
                let h = 0;
                const c = l.length, d = [];
                for (; h < c; ) {
                  const _ = l[h++];
                  if (_ === 0)
                    break;
                  if (!(_ & 128))
                    d.push(_);
                  else if ((_ & 224) === 192) {
                    const m = l[h++] & 63;
                    d.push((_ & 31) << 6 | m);
                  } else if ((_ & 240) === 224) {
                    const m = l[h++] & 63, y = l[h++] & 63;
                    d.push((_ & 31) << 12 | m << 6 | y);
                  } else if ((_ & 248) === 240) {
                    const m = l[h++] & 63, y = l[h++] & 63, x = l[h++] & 63;
                    let b = (_ & 7) << 18 | m << 12 | y << 6 | x;
                    b > 65535 && (b -= 65536, d.push(b >>> 10 & 1023 | 55296), b = 56320 | b & 1023), d.push(b);
                  }
                }
                return String.fromCharCode.apply(null, d);
              }, n.TextEncoder = e, n.TextDecoder = t;
            })(typeof window < "u" ? window : typeof self < "u" ? self : this);
          }
        ),
        /***/
        "./node_modules/iobuffer/lib-esm/text.browser.js": (
          /*!*******************************************************!*\
            !*** ./node_modules/iobuffer/lib-esm/text.browser.js ***!
            \*******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              decode: () => (
                /* binding */
                r
              ),
              /* harmony export */
              encode: () => (
                /* binding */
                l
              )
              /* harmony export */
            }), t(
              /*! ./text-encoding-polyfill */
              "./node_modules/iobuffer/lib-esm/text-encoding-polyfill.js"
            );
            function r(h, c = "utf8") {
              return new TextDecoder(c).decode(h);
            }
            const a = new TextEncoder();
            function l(h) {
              return a.encode(h);
            }
          }
        ),
        /***/
        "./node_modules/netcdfjs/lib-esm/data.js": (
          /*!***********************************************!*\
            !*** ./node_modules/netcdfjs/lib-esm/data.js ***!
            \***********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              nonRecord: () => (
                /* binding */
                a
              ),
              /* harmony export */
              record: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./types */
              "./node_modules/netcdfjs/lib-esm/types.js"
            );
            function a(h, c) {
              const d = (0, r.str2num)(c.type), _ = c.size / (0, r.num2bytes)(d), m = new Array(_);
              for (let y = 0; y < _; y++)
                m[y] = (0, r.readType)(h, d, 1);
              return m;
            }
            function l(h, c, d) {
              const _ = (0, r.str2num)(c.type), m = c.size ? c.size / (0, r.num2bytes)(_) : 1, y = d.length, x = new Array(y), b = d.recordStep;
              if (b)
                for (let A = 0; A < y; A++) {
                  const f = h.offset;
                  x[A] = (0, r.readType)(h, _, m), h.seek(f + b);
                }
              else
                throw new Error("recordDimension.recordStep is undefined");
              return x;
            }
          }
        ),
        /***/
        "./node_modules/netcdfjs/lib-esm/header.js": (
          /*!*************************************************!*\
            !*** ./node_modules/netcdfjs/lib-esm/header.js ***!
            \*************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              header: () => (
                /* binding */
                m
              )
              /* harmony export */
            });
            var r = t(
              /*! ./types */
              "./node_modules/netcdfjs/lib-esm/types.js"
            ), a = t(
              /*! ./utils */
              "./node_modules/netcdfjs/lib-esm/utils.js"
            );
            const l = 0, h = 10, c = 11, d = 12, _ = 0;
            function m(A, f) {
              const s = { version: f }, u = {
                length: A.readUint32()
              }, p = y(A);
              Array.isArray(p) || (u.id = p.recordId, u.name = p.recordName, s.dimensions = p.dimensions), s.globalAttributes = x(A);
              const g = b(A, u == null ? void 0 : u.id, f);
              return Array.isArray(g) || (s.variables = g.variables, u.recordStep = g.recordStep), s.recordDimension = u, s;
            }
            function y(A) {
              const f = {};
              let s, u;
              const p = A.readUint32();
              let g;
              if (p === l)
                return (0, a.notNetcdf)(A.readUint32() !== l, "wrong empty tag for list of dimensions"), [];
              {
                (0, a.notNetcdf)(p !== h, "wrong tag for list of dimensions");
                const w = A.readUint32();
                g = new Array(w);
                for (let o = 0; o < w; o++) {
                  const v = (0, a.readName)(A), M = A.readUint32();
                  M === _ && (s = o, u = v), g[o] = {
                    name: v,
                    size: M
                  };
                }
              }
              return s !== void 0 && (f.recordId = s), u !== void 0 && (f.recordName = u), f.dimensions = g, f;
            }
            function x(A) {
              const f = A.readUint32();
              let s;
              if (f === l)
                return (0, a.notNetcdf)(A.readUint32() !== l, "wrong empty tag for list of attributes"), [];
              {
                (0, a.notNetcdf)(f !== d, "wrong tag for list of attributes");
                const u = A.readUint32();
                s = new Array(u);
                for (let p = 0; p < u; p++) {
                  const g = (0, a.readName)(A), w = A.readUint32();
                  (0, a.notNetcdf)(w < 1 || w > 6, `non valid type ${w}`);
                  const o = A.readUint32(), v = (0, r.readType)(A, w, o);
                  (0, a.padding)(A), s[p] = {
                    name: g,
                    type: (0, r.num2str)(w),
                    value: v
                  };
                }
              }
              return s;
            }
            function b(A, f, s) {
              const u = A.readUint32();
              let p = 0, g;
              if (u === l)
                return (0, a.notNetcdf)(A.readUint32() !== l, "wrong empty tag for list of variables"), [];
              {
                (0, a.notNetcdf)(u !== c, "wrong tag for list of variables");
                const w = A.readUint32();
                g = new Array(w);
                for (let o = 0; o < w; o++) {
                  const v = (0, a.readName)(A), M = A.readUint32(), E = new Array(M);
                  for (let R = 0; R < M; R++)
                    E[R] = A.readUint32();
                  const $ = x(A), k = A.readUint32();
                  (0, a.notNetcdf)(k < 1 && k > 6, `non valid type ${k}`);
                  const L = A.readUint32();
                  let z = A.readUint32();
                  s === 2 && ((0, a.notNetcdf)(z > 0, "offsets larger than 4GB not supported"), z = A.readUint32());
                  let O = !1;
                  typeof f < "u" && E[0] === f && (p += L, O = !0), g[o] = {
                    name: v,
                    dimensions: E,
                    attributes: $,
                    type: (0, r.num2str)(k),
                    size: L,
                    offset: z,
                    record: O
                  };
                }
              }
              return {
                variables: g,
                recordStep: p
              };
            }
          }
        ),
        /***/
        "./node_modules/netcdfjs/lib-esm/index.js": (
          /*!************************************************!*\
            !*** ./node_modules/netcdfjs/lib-esm/index.js ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              NetCDFReader: () => (
                /* reexport safe */
                r.NetCDFReader
              )
              /* harmony export */
            });
            var r = t(
              /*! ./parser */
              "./node_modules/netcdfjs/lib-esm/parser.js"
            );
          }
        ),
        /***/
        "./node_modules/netcdfjs/lib-esm/parser.js": (
          /*!*************************************************!*\
            !*** ./node_modules/netcdfjs/lib-esm/parser.js ***!
            \*************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              NetCDFReader: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! iobuffer */
              "./node_modules/iobuffer/lib-esm/IOBuffer.js"
            ), a = t(
              /*! ./data */
              "./node_modules/netcdfjs/lib-esm/data.js"
            ), l = t(
              /*! ./header */
              "./node_modules/netcdfjs/lib-esm/header.js"
            ), h = t(
              /*! ./toString */
              "./node_modules/netcdfjs/lib-esm/toString.js"
            ), c = t(
              /*! ./utils */
              "./node_modules/netcdfjs/lib-esm/utils.js"
            );
            class d {
              constructor(m) {
                this.toString = h.toString;
                const y = new r.IOBuffer(m);
                y.setBigEndian(), (0, c.notNetcdf)(y.readChars(3) !== "CDF", "should start with CDF");
                const x = y.readByte();
                (0, c.notNetcdf)(x > 2, "unknown version"), this.header = (0, l.header)(y, x), this.buffer = y;
              }
              /**
               * @return - Version for the NetCDF format
               */
              get version() {
                return this.header.version === 1 ? "classic format" : "64-bit offset format";
              }
              /**
               * @return {object} - Metadata for the record dimension
               *  * `length`: Number of elements in the record dimension
               *  * `id`: Id number in the list of dimensions for the record dimension
               *  * `name`: String with the name of the record dimension
               *  * `recordStep`: Number with the record variables step size
               */
              get recordDimension() {
                return this.header.recordDimension;
              }
              /**
               * @return - Array - List of dimensions with:
               *  * `name`: String with the name of the dimension
               *  * `size`: Number with the size of the dimension
               */
              get dimensions() {
                return this.header.dimensions;
              }
              /**
               * @return - Array - List of global attributes with:
               *  * `name`: String with the name of the attribute
               *  * `type`: String with the type of the attribute
               *  * `value`: A number or string with the value of the attribute
               */
              get globalAttributes() {
                return this.header.globalAttributes;
              }
              /**
               * Returns the value of an attribute
               * @param - AttributeName
               * @return - Value of the attributeName or null
               */
              getAttribute(m) {
                const y = this.globalAttributes.find((x) => x.name === m);
                return y ? y.value : null;
              }
              /**
               * Returns the value of a variable as a string
               * @param - variableName
               * @return - Value of the variable as a string or null
               */
              getDataVariableAsString(m) {
                const y = this.getDataVariable(m);
                return y ? y.join("") : null;
              }
              get variables() {
                return this.header.variables;
              }
              /**
               * Retrieves the data for a given variable
               * @param variableName - Name of the variable to search or variable object
               * @return The variable values
               */
              getDataVariable(m) {
                let y;
                if (typeof m == "string" ? y = this.header.variables.find((x) => x.name === m) : y = m, y === void 0)
                  throw new Error("Not a valid NetCDF v3.x file: variable not found");
                return this.buffer.seek(y.offset), y.record ? (0, a.record)(this.buffer, y, this.header.recordDimension) : (0, a.nonRecord)(this.buffer, y);
              }
              /**
               * Check if a dataVariable exists
               * @param variableName - Name of the variable to find
               * @return boolean
               */
              dataVariableExists(m) {
                return this.header.variables.find((x) => x.name === m) !== void 0;
              }
              /**
               * Check if an attribute exists
               * @param attributeName - Name of the attribute to find
               * @return boolean
               */
              attributeExists(m) {
                return this.globalAttributes.find((x) => x.name === m) !== void 0;
              }
            }
          }
        ),
        /***/
        "./node_modules/netcdfjs/lib-esm/toString.js": (
          /*!***************************************************!*\
            !*** ./node_modules/netcdfjs/lib-esm/toString.js ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              toString: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            function r() {
              const a = [];
              a.push("DIMENSIONS");
              for (const h of this.dimensions)
                a.push(`  ${h.name.padEnd(30)} = size: ${h.size}`);
              a.push(""), a.push("GLOBAL ATTRIBUTES");
              for (const h of this.globalAttributes)
                a.push(`  ${h.name.padEnd(30)} = ${h.value}`);
              const l = JSON.parse(JSON.stringify(this.variables));
              a.push(""), a.push("VARIABLES:");
              for (const h of l) {
                h.value = this.getDataVariable(h);
                let c = JSON.stringify(h.value);
                c.length > 50 && (c = c.substring(0, 50)), isNaN(h.value.length) || (c += ` (length: ${h.value.length})`), a.push(`  ${h.name.padEnd(30)} = ${c}`);
              }
              return a.join(`
`);
            }
          }
        ),
        /***/
        "./node_modules/netcdfjs/lib-esm/types.js": (
          /*!************************************************!*\
            !*** ./node_modules/netcdfjs/lib-esm/types.js ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              num2bytes: () => (
                /* binding */
                l
              ),
              /* harmony export */
              num2str: () => (
                /* binding */
                a
              ),
              /* harmony export */
              readType: () => (
                /* binding */
                d
              ),
              /* harmony export */
              str2num: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            const r = {
              BYTE: 1,
              CHAR: 2,
              SHORT: 3,
              INT: 4,
              FLOAT: 5,
              DOUBLE: 6
            };
            function a(m) {
              switch (Number(m)) {
                case r.BYTE:
                  return "byte";
                case r.CHAR:
                  return "char";
                case r.SHORT:
                  return "short";
                case r.INT:
                  return "int";
                case r.FLOAT:
                  return "float";
                case r.DOUBLE:
                  return "double";
                default:
                  return "undefined";
              }
            }
            function l(m) {
              switch (Number(m)) {
                case r.BYTE:
                  return 1;
                case r.CHAR:
                  return 1;
                case r.SHORT:
                  return 2;
                case r.INT:
                  return 4;
                case r.FLOAT:
                  return 4;
                case r.DOUBLE:
                  return 8;
                default:
                  return -1;
              }
            }
            function h(m) {
              switch (String(m)) {
                case "byte":
                  return r.BYTE;
                case "char":
                  return r.CHAR;
                case "short":
                  return r.SHORT;
                case "int":
                  return r.INT;
                case "float":
                  return r.FLOAT;
                case "double":
                  return r.DOUBLE;
                default:
                  return -1;
              }
            }
            function c(m, y) {
              if (m !== 1) {
                const x = new Array(m);
                for (let b = 0; b < m; b++)
                  x[b] = y();
                return x;
              } else
                return y();
            }
            function d(m, y, x) {
              switch (y) {
                case r.BYTE:
                  return Array.from(m.readBytes(x));
                case r.CHAR:
                  return _(m.readChars(x));
                case r.SHORT:
                  return c(x, m.readInt16.bind(m));
                case r.INT:
                  return c(x, m.readInt32.bind(m));
                case r.FLOAT:
                  return c(x, m.readFloat32.bind(m));
                case r.DOUBLE:
                  return c(x, m.readFloat64.bind(m));
                default:
                  throw new Error(`non valid type ${y}`);
              }
            }
            function _(m) {
              return m.charCodeAt(m.length - 1) === 0 ? m.substring(0, m.length - 1) : m;
            }
          }
        ),
        /***/
        "./node_modules/netcdfjs/lib-esm/utils.js": (
          /*!************************************************!*\
            !*** ./node_modules/netcdfjs/lib-esm/utils.js ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              notNetcdf: () => (
                /* binding */
                r
              ),
              /* harmony export */
              padding: () => (
                /* binding */
                a
              ),
              /* harmony export */
              readName: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            function r(h, c) {
              if (h)
                throw new TypeError(`Not a valid NetCDF v3.x file: ${c}`);
            }
            function a(h) {
              h.offset % 4 !== 0 && h.skip(4 - h.offset % 4);
            }
            function l(h) {
              const c = h.readUint32(), d = h.readChars(c);
              return a(h), d;
            }
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/basic/basic.frag": (
          /*!************************************************!*\
            !*** ./src/WebGL/shaders/lib/basic/basic.frag ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform mat4 viewMatrix;
uniform float opacity;
uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;
varying vec3 vColor;
//DEFINEFRAGCOLOR
void main() {
    gl_FragColor = vec4( vColor, opacity );
    float depth = gl_FragCoord.z / gl_FragCoord.w;
    float fogFactor = smoothstep( fogNear, fogFar, depth );
    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );
}`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/basic/basic.vert": (
          /*!************************************************!*\
            !*** ./src/WebGL/shaders/lib/basic/basic.vert ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat3 normalMatrix;

attribute vec3 position;
attribute vec3 color;

varying vec3 vColor;

void main() {

    vColor = color;
    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
    gl_Position = projectionMatrix * mvPosition;

}`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/blur/blur.frag": (
          /*!**********************************************!*\
            !*** ./src/WebGL/shaders/lib/blur/blur.frag ***!
            \**********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `const float INV_TOTAL_SAMPLES_FACTOR = 1.0 / 9.0;
uniform highp sampler2D inTex;
varying highp vec2 vTexCoords;
    
void main() {
 
 vec2 texelSize = 1.0 / vec2(textureSize(inTex,0));
 float blurred_visibility_factor = 0.0f;
 for (int t = -1; t <= 1; ++t) {
  for (int s = -1; s <= 1; ++s) {
   vec2 offset = vec2(float(s), float(t)) * texelSize;
   blurred_visibility_factor += texture2D(inTex, vTexCoords + offset).r;
  }
 }
    
 gl_FragDepthEXT = blurred_visibility_factor * INV_TOTAL_SAMPLES_FACTOR;
 
}`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/blur/blur.vert": (
          /*!**********************************************!*\
            !*** ./src/WebGL/shaders/lib/blur/blur.vert ***!
            \**********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `attribute vec2 vertexPosition;
varying highp vec2 vTexCoords;
const vec2 scale = vec2(0.5, 0.5);

void main() {
   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range
   gl_Position = vec4(vertexPosition, 0.0, 1.0);
}
        `;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/instanced/instanced.frag": (
          /*!********************************************************!*\
            !*** ./src/WebGL/shaders/lib/instanced/instanced.frag ***!
            \********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform mat4 viewMatrix;
uniform float opacity;

uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;
#ifdef SHADED
uniform highp sampler2D shading;
#endif
varying vec3 vLightFront;
varying vec3 vColor;
//DEFINEFRAGCOLOR

void main() {

    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );

    #ifndef WIREFRAME
    gl_FragColor.xyz *= vLightFront;
    #endif

#ifdef SHADED
    ivec2 dim = textureSize(shading,0);
    float shadowFactor = texture2D(shading,vec2(gl_FragCoord.x/float(dim.x),gl_FragCoord.y/float(dim.y))).r;
    vColor *= shadowFactor;
#endif
    gl_FragColor = gl_FragColor * vec4( vColor, opacity );
    float depth = gl_FragCoord.z / gl_FragCoord.w;

    float fogFactor = smoothstep( fogNear, fogFar, depth );

    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );

}


`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/instanced/instanced.vert": (
          /*!********************************************************!*\
            !*** ./src/WebGL/shaders/lib/instanced/instanced.vert ***!
            \********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat3 normalMatrix;
uniform vec3 directionalLightColor[ 1 ];
uniform vec3 directionalLightDirection[ 1 ];

attribute vec3 offset;
attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;
attribute float radius;

varying vec3 vColor;
varying vec3 vLightFront;

void main() {

    vColor = color;

    vec3 objectNormal = normal;
    vec3 transformedNormal = normalMatrix * objectNormal;
    vec4 mvPosition = modelViewMatrix * vec4( position * radius + offset, 1.0 );

    vLightFront = vec3( 0.0 );

    transformedNormal = normalize( transformedNormal );

    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );
    vec3 dirVector = normalize( lDirection.xyz );
    float dotProduct = dot( transformedNormal, dirVector );
    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );

    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;

    gl_Position = projectionMatrix * mvPosition;
}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambert/lambert.frag": (
          /*!****************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambert/lambert.frag ***!
            \****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform mat4 viewMatrix;
uniform float opacity;

uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;
#ifdef SHADED
uniform highp sampler2D shading;
#endif
varying vec3 vLightFront;
varying vec3 vColor;
//DEFINEFRAGCOLOR

void main() {

    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );

    #ifndef WIREFRAME
    gl_FragColor.xyz *= vLightFront;
    #endif
#ifdef SHADED
    ivec2 dim = textureSize(shading,0);
    float shadowFactor = texture2D(shading,vec2(gl_FragCoord.x/float(dim.x),gl_FragCoord.y/float(dim.y))).r;
    vColor *= shadowFactor;
#endif
    gl_FragColor = gl_FragColor * vec4( vColor, opacity );
    float depth = gl_FragCoord.z / gl_FragCoord.w;

    float fogFactor = smoothstep( fogNear, fogFar, depth );

    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );

}`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambert/lambert.vert": (
          /*!****************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambert/lambert.vert ***!
            \****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat3 normalMatrix;
uniform vec3 directionalLightColor[ 1 ];
uniform vec3 directionalLightDirection[ 1 ];

attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;

varying vec3 vColor;
varying vec3 vLightFront;

void main() {

    vColor = color;

    vec3 objectNormal = normal;
    vec3 transformedNormal = normalMatrix * objectNormal;
    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );

    vLightFront = vec3( 0.0 );

    transformedNormal = normalize( transformedNormal );

    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );
    vec3 dirVector = normalize( lDirection.xyz );
    float dotProduct = dot( transformedNormal, dirVector );
    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );

    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;

    gl_Position = projectionMatrix * mvPosition;
}`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag": (
          /*!****************************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag ***!
            \****************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `
#ifdef SHADED
uniform highp sampler2D shading;
#endif

uniform mat4 viewMatrix;
uniform float opacity;

uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;

varying vec3 vLightFront;
varying vec3 vLightBack;

varying vec3 vColor;


//DEFINEFRAGCOLOR

void main() {

    gl_FragColor = vec4( vec3 ( 1.0 ), opacity );

    #ifndef WIREFRAME
    if ( gl_FrontFacing )
       gl_FragColor.xyz *= vLightFront;
    else
       gl_FragColor.xyz *= vLightBack;
    #endif

    vec3 color = vColor;
#ifdef SHADED
    ivec2 dim = textureSize(shading,0);
    float shadowFactor = texture2D(shading,vec2(gl_FragCoord.x/float(dim.x),gl_FragCoord.y/float(dim.y))).r;
    color *= shadowFactor;
#endif
    gl_FragColor = gl_FragColor * vec4( color, opacity );
    float depth = gl_FragCoord.z / gl_FragCoord.w;

    float fogFactor = smoothstep( fogNear, fogFar, depth );

    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );

}


`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert": (
          /*!****************************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert ***!
            \****************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat3 normalMatrix;
uniform vec3 directionalLightColor[ 1 ];
uniform vec3 directionalLightDirection[ 1 ];

attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;

varying vec3 vColor;
varying vec3 vLightFront;
varying vec3 vLightBack;

void main() {

    vColor = color;

    vec3 objectNormal = normal;
    vec3 transformedNormal = normalMatrix * objectNormal;
    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );

    vLightFront = vec3( 0.0 );
    vLightBack = vec3( 0.0 );

    transformedNormal = normalize( transformedNormal );

    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );
    vec3 dirVector = normalize( lDirection.xyz );
    float dotProduct = dot( transformedNormal, dirVector );
    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );
    vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );

    vLightFront += directionalLightColor[ 0 ] * directionalLightWeighting;
    vLightBack += directionalLightColor[ 0 ] * directionalLightWeightingBack;

    gl_Position = projectionMatrix * mvPosition;
}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/outline/outline.frag": (
          /*!****************************************************!*\
            !*** ./src/WebGL/shaders/lib/outline/outline.frag ***!
            \****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform float opacity;
uniform vec3 outlineColor;
uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;
//DEFINEFRAGCOLOR

void main() {
    gl_FragColor = vec4( outlineColor, 1 );

    float depth = gl_FragCoord.z / gl_FragCoord.w;
    float fogFactor = smoothstep( fogNear, fogFar, depth );
    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );    
}


`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/outline/outline.vert": (
          /*!****************************************************!*\
            !*** ./src/WebGL/shaders/lib/outline/outline.vert ***!
            \****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform float outlineWidth;
uniform float outlinePushback;
uniform float vWidth;
uniform float vHeight;
uniform float outlineMaxPixels;

attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;

void main() {

    vec4 norm = modelViewMatrix*vec4(normalize(normal),0.0);
    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
    mvPosition.xy += norm.xy*outlineWidth;
    vec4 outpos = projectionMatrix * mvPosition;

    if(outlineMaxPixels > 0.0) {
        vec4 unadjusted = projectionMatrix*modelViewMatrix * vec4( position, 1.0 );
        float w = outpos.w;
        //normalize homogeneous coords
        unadjusted /= unadjusted.w;
        outpos /= outpos.w;
        vec2 diff = outpos.xy-unadjusted.xy;
        //put into pixels
        diff.x *= vWidth;
        diff.y *= vHeight;
        if ( length(diff) > outlineMaxPixels) {
            vec2 ndiff = normalize(diff)*outlineMaxPixels;
            ndiff.x /= vWidth;
            ndiff.y /= vHeight;
            outpos.xy = unadjusted.xy;
            outpos.xy += ndiff;
        }
        outpos *= w; //if I don't do this things blow up
    }
    gl_Position = outpos;
    mvPosition.z -= outlinePushback; //go backwards in model space
    vec4 pushpos = projectionMatrix*mvPosition; //project to get z in projection space, I'm probably missing some simple math to do the same thing..
    gl_Position.z = gl_Position.w*pushpos.z/pushpos.w;
}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screen/screen.frag": (
          /*!**************************************************!*\
            !*** ./src/WebGL/shaders/lib/screen/screen.frag ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform sampler2D colormap;
varying highp vec2 vTexCoords;
uniform vec2 dimensions;
//DEFINEFRAGCOLOR
void main (void) {
   gl_FragColor = texture2D(colormap, vTexCoords);

   //gl_FragColor.g = gl_FragColor.b =  gl_FragColor.r; //debug shading 
}
        `;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screen/screen.vert": (
          /*!**************************************************!*\
            !*** ./src/WebGL/shaders/lib/screen/screen.vert ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `attribute vec2 vertexPosition;
varying highp vec2 vTexCoords;
const vec2 scale = vec2(0.5, 0.5);

void main() {
   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range
   gl_Position = vec4(vertexPosition, 0.0, 1.0);
}
        `;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screenaa/screenaa.frag": (
          /*!******************************************************!*\
            !*** ./src/WebGL/shaders/lib/screenaa/screenaa.frag ***!
            \******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform highp sampler2D colormap;
varying highp vec2 vTexCoords;


// Basic FXAA implementation based on the code on geeks3d.com 
#define FXAA_REDUCE_MIN (1.0/ 128.0)
#define FXAA_REDUCE_MUL (1.0 / 8.0)
#define FXAA_SPAN_MAX 8.0


vec4 applyFXAA(vec2 fragCoord, highp sampler2D tex)
{
    vec4 color;
    ivec2 dim = textureSize(tex,0);
    vec2 dimensions = vec2(float(dim.x),float(dim.y));
    vec2 inverseVP = vec2(1.0 / dimensions.x, 1.0 / dimensions.y);
    vec3 rgbNW = texture2D(tex, fragCoord + vec2(-1.0, -1.0) * inverseVP).xyz;
    vec3 rgbNE = texture2D(tex, fragCoord + vec2(1.0, -1.0) * inverseVP).xyz;
    vec3 rgbSW = texture2D(tex, fragCoord + vec2(-1.0, 1.0) * inverseVP).xyz;
    vec3 rgbSE = texture2D(tex, fragCoord + vec2(1.0, 1.0) * inverseVP).xyz;
    vec4 rgbM  = texture2D(tex, fragCoord  * inverseVP);
    vec3 luma = vec3(0.299, 0.587, 0.114);
    float lumaNW = dot(rgbNW, luma);
    float lumaNE = dot(rgbNE, luma);
    float lumaSW = dot(rgbSW, luma);
    float lumaSE = dot(rgbSE, luma);
    float lumaM  = dot(rgbM.xyz,  luma);
    float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
    float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));

    vec2 dir;
    dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
    dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));

    float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *
                        (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);

    float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
    dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
            max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
            dir * rcpDirMin)) * inverseVP;

    vec3 rgbA = 0.5 * (
        texture2D(tex, fragCoord + dir * (1.0 / 3.0 - 0.5)).xyz +
        texture2D(tex, fragCoord  + dir * (2.0 / 3.0 - 0.5)).xyz);
    vec3 rgbB = rgbA * 0.5 + 0.25 * (
        texture2D(tex, fragCoord  + dir * -0.5).xyz +
        texture2D(tex, fragCoord  + dir * 0.5).xyz);

    float lumaB = dot(rgbB, luma);
    if ((lumaB < lumaMin) || (lumaB > lumaMax))
        color = vec4(rgbA, rgbM.w);
    else
        color = vec4(rgbB, rgbM.w);
    return color;
}


//DEFINEFRAGCOLOR
void main (void) {
    ivec2 dim = textureSize(colormap,0);

  gl_FragColor = applyFXAA(vTexCoords, colormap);
}
        `;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screenaa/screenaa.vert": (
          /*!******************************************************!*\
            !*** ./src/WebGL/shaders/lib/screenaa/screenaa.vert ***!
            \******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `attribute vec2 vertexPosition;
varying highp vec2 vTexCoords;
const vec2 scale = vec2(0.5, 0.5);

void main() {
   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range
   gl_Position = vec4(vertexPosition, 0.0, 1.0);
}
        `;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag": (
          /*!******************************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag ***!
            \******************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `
uniform mat4 viewMatrix;
uniform float opacity;
uniform mat4 projectionMatrix;

uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;
uniform float uDepth;
uniform vec3 directionalLightColor[ 1 ];

varying vec3 vColor;
varying vec2 mapping;
varying float rval;
varying vec3 vLight;
varying vec3 center;

#ifdef SHADED
uniform highp sampler2D shading;
#endif

//DEFINEFRAGCOLOR

void main() {
    float lensqr = dot(mapping,mapping);
    float rsqr = rval*rval;
    if(lensqr > rsqr)
       discard;
    float z = sqrt(rsqr-lensqr);
    vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z);
    vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);
    float ndcDepth = clipPos.z / clipPos.w;
    gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;
    vec3 norm = normalize(vec3(mapping.x,mapping.y,z));
    float dotProduct = dot( norm, vLight );
    vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );
    vec3 vLight = directionalLightColor[ 0 ] * directionalLightWeighting;
    vec3 color = vLight*vColor;
#ifdef SHADED
    ivec2 dim = textureSize(shading,0);
    float shadowFactor = texture2D(shading,vec2(gl_FragCoord.x/float(dim.x),gl_FragCoord.y/float(dim.y))).r;
    color *= shadowFactor;
#endif    
    gl_FragColor = vec4(color, opacity*opacity );
    float fogFactor = smoothstep( fogNear, fogFar, gl_FragDepthEXT/gl_FragCoord.w );
    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );


}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert": (
          /*!******************************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert ***!
            \******************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat3 normalMatrix;
uniform vec3 directionalLightColor[ 1 ];
uniform vec3 directionalLightDirection[ 1 ];

attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;

varying vec2 mapping;
varying vec3 vColor;
varying float rval;
varying vec3 vLight;
varying vec3 center;

void main() {

    vColor = color;
    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
    center = mvPosition.xyz;
    vec4 projPosition = projectionMatrix * mvPosition;
    vec4 adjust = projectionMatrix* vec4(normal,0.0); adjust.z = 0.0; adjust.w = 0.0;
    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );
    vLight = normalize( lDirection.xyz );
    mapping = normal.xy;
    rval = abs(normal.x);
    gl_Position = projPosition+adjust;

}
`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag": (
          /*!********************************************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag ***!
            \********************************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform float opacity;
uniform vec3 outlineColor;
uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;
uniform mat4 projectionMatrix;
varying vec2 mapping;
varying float rval;
varying vec3 center;

uniform float outlinePushback;

//DEFINEFRAGCOLOR

void main() {
    float lensqr = dot(mapping,mapping);
    float rsqr = rval*rval;
    if(lensqr > rsqr)
       discard;
    float z = sqrt(rsqr-lensqr);
    vec3 cameraPos = center+ vec3(mapping.x,mapping.y,z-outlinePushback);
    vec4 clipPos = projectionMatrix * vec4(cameraPos, 1.0);
    float ndcDepth = clipPos.z / clipPos.w;
    gl_FragDepthEXT = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;
    gl_FragColor = vec4(outlineColor, 1 );
}


`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert": (
          /*!********************************************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert ***!
            \********************************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform float outlineWidth;
uniform float outlinePushback;
uniform float outlineMaxPixels;
uniform float vWidth;
uniform float vHeight;

attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;

varying vec2 mapping;
varying float rval;
varying vec3 center;

void main() {

    vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
    center = mvPosition.xyz;
    vec4 projPosition = projectionMatrix * mvPosition;
    vec2 norm = normal.xy + vec2(sign(normal.x)*outlineWidth,sign(normal.y)*outlineWidth);

    vec4 adjust = projectionMatrix* vec4(norm,normal.z,1.0); 
    mapping = norm.xy;
    rval = abs(norm.x);
    gl_Position = projPosition+vec4(adjust.xy,0.0,0.0);

    if(outlineMaxPixels > 0.0) {
        vec4 unadjusted = projectionMatrix*vec4(center.x+normal.x, center.y,center.z,1.0); 
        vec4 ccoord = projectionMatrix*vec4(center.xyz,1.0);
        adjust = projectionMatrix* vec4(center.x+norm.x,center.y,center.z,1.0); 
        //subtract center 
        unadjusted.xyz -= ccoord.xyz;
        adjust.xyz -= ccoord.xyz;
        unadjusted /= unadjusted.w;
        adjust /= adjust.w;
        float diff = abs(adjust.x-unadjusted.x);
        diff *= vWidth;
        if(diff > outlineMaxPixels) {
            
            float fixlen = abs(unadjusted.x) + outlineMaxPixels/vWidth;
            //adjsut reval by ratio of lengths
            rval *= fixlen/abs(adjust.x);
        }

    }
}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sprite/sprite.frag": (
          /*!**************************************************!*\
            !*** ./src/WebGL/shaders/lib/sprite/sprite.frag ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform vec3 color;
uniform sampler2D map;
uniform float opacity;

uniform int fogType;
uniform vec3 fogColor;
uniform float fogDensity;
uniform float fogNear;
uniform float fogFar;
uniform float alphaTest;

varying vec2 vUV;
//DEFINEFRAGCOLOR

void main() {

    vec4 texture = texture2D(map, vUV);

    if (texture.a <= alphaTest) discard;

    gl_FragColor = vec4(color * texture.xyz, texture.a * opacity);

    if (fogType > 0) {

        float depth = gl_FragCoord.z / gl_FragCoord.w;
        float fogFactor = 0.0;

        if (fogType == 1) {
            fogFactor = smoothstep(fogNear, fogFar, depth);
        }

        else {
            const float LOG2 = 1.442695;
            float fogFactor = exp2(- fogDensity * fogDensity * depth * depth * LOG2);
            fogFactor = 1.0 - clamp(fogFactor, 0.0, 1.0);
        }

        gl_FragColor = mix(gl_FragColor, vec4(fogColor, gl_FragColor.w), fogFactor);

    }
}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sprite/sprite.vert": (
          /*!**************************************************!*\
            !*** ./src/WebGL/shaders/lib/sprite/sprite.vert ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform int useScreenCoordinates;
uniform vec3 screenPosition;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform float rotation;
uniform vec2 scale;
uniform vec2 alignment;
uniform vec2 uvOffset;
uniform vec2 uvScale;

attribute vec2 position;
attribute vec2 uv;

varying vec2 vUV;

void main() {

    vUV = uvOffset + uv * uvScale;

    vec2 alignedPosition = position + alignment;

    vec2 rotatedPosition;
    rotatedPosition.x = ( cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y ) * scale.x;
    rotatedPosition.y = ( sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y ) * scale.y;

    vec4 finalPosition;

    if(useScreenCoordinates != 0) {
        finalPosition = vec4(screenPosition.xy + rotatedPosition, screenPosition.z, 1.0);
    }

    else {
        finalPosition = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0); finalPosition /= finalPosition.w;
        finalPosition.xy += rotatedPosition; 
    }

    gl_Position = finalPosition;

}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/ssao/ssao.frag": (
          /*!**********************************************!*\
            !*** ./src/WebGL/shaders/lib/ssao/ssao.frag ***!
            \**********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform sampler2D depthmap;
varying highp vec2 vTexCoords;
uniform float vWidth;
uniform float vHeight;
uniform float total_strength;
uniform float radius;
uniform mat4 projinv;
uniform mat4 projectionMatrix;

//code for pseudorandom vector from chatgpt
float hash(vec3 p) {
    p = fract(p * vec3(0.1031, 0.1030, 0.0973));
    p += dot(p, p.yzx + 33.33);
    return fract((p.x + p.y) * p.z);
}

// Generate a pseudorandom vec3 from a seed vec3
vec3 pseudorandomVec3(vec3 seed) {
    vec3 randomVec;
    randomVec.x = hash(seed);
    randomVec.y = hash(seed + vec3(1.0, 0.0, 17.1));
    randomVec.z = hash(seed + vec3(0.0, 13.23, 0.0));
    return randomVec;
}

void main(void)
{   
   const float base = 0.2;
   const float area = 0.75;
   const int cycles = 1;

   const int samples = 64;
   vec3 sample_sphere[64] = vec3[](
      vec3(0.091258,-0.510164,0.000000),
      vec3(-0.204347,-0.872967,0.187199),
      vec3(0.009690,-0.263696,-0.110414),
      vec3(0.175208,-0.563987,0.228527),
      vec3(-0.001824,-0.003113,-0.000323),
      vec3(0.411134,-0.719869,-0.261530),
      vec3(-0.074272,-0.377368,0.276290),
      vec3(-0.147773,-0.381587,-0.284529),
      vec3(0.173317,-0.199635,0.063295),
      vec3(-0.186452,-0.199460,0.076965),
      vec3(0.143985,-0.308160,-0.307687),
      vec3(0.053194,-0.148286,0.169589),
      vec3(-0.547656,-0.486476,-0.317378),
      vec3(0.020804,-0.015092,-0.004574),
      vec3(-0.038006,-0.043165,0.054059),
      vec3(-0.094795,-0.443908,-0.731525),
      vec3(0.547552,-0.396466,0.461477),
      vec3(-0.176886,-0.089989,0.007315),
      vec3(0.074401,-0.048840,-0.074039),
      vec3(-0.008240,-0.075697,0.178197),
      vec3(-0.307880,-0.185053,-0.368943),
      vec3(0.309520,-0.108483,0.041646),
      vec3(-0.773478,-0.292946,0.538166),
      vec3(0.184487,-0.231594,-0.820065),
      vec3(0.207318,-0.100531,0.361797),
      vec3(-0.173306,-0.037737,-0.055289),
      vec3(0.548102,-0.105342,-0.253237),
      vec3(-0.119342,-0.043907,0.285162),
      vec3(-0.270247,-0.087861,-0.751357),
      vec3(0.449312,-0.039777,0.236146),
      vec3(-0.743773,-0.036095,0.196056),
      vec3(0.148819,-0.004300,-0.231448),
      vec3(0.008773,0.000809,0.051047),
      vec3(-0.461467,0.027390,-0.357386),
      vec3(0.169626,0.013338,-0.014053),
      vec3(-0.043786,0.007095,0.047331),
      vec3(0.004821,0.140371,-0.988260),
      vec3(0.092402,0.023994,0.101860),
      vec3(-0.295335,0.061530,-0.027372),
      vec3(0.024903,0.007537,-0.018901),
      vec3(-0.081463,0.125402,0.447794),
      vec3(-0.397119,0.231805,-0.631062),
      vec3(0.163853,0.059014,0.044905),
      vec3(-0.495220,0.214357,0.254139),
      vec3(0.306123,0.373687,-0.825715),
      vec3(0.021665,0.026737,0.053220),
      vec3(-0.208231,0.117129,-0.098685),
      vec3(0.139749,0.080968,-0.043086),
      vec3(-0.153599,0.182814,0.262090),
      vec3(-0.159673,0.496777,-0.743568),
      vec3(0.134797,0.117152,0.095753),
      vec3(-0.155626,0.120533,0.019395),
      vec3(0.042311,0.054462,-0.049709),
      vec3(0.001257,0.031288,0.034468),
      vec3(-0.002271,0.003199,-0.002304),
      vec3(0.662104,0.717307,0.033854),
      vec3(-0.373100,0.576021,0.308274),
      vec3(0.024233,0.231316,-0.173688),
      vec3(0.161311,0.420217,0.234273),
      vec3(-0.045248,0.078031,-0.010411),
      vec3(0.167453,0.376942,-0.094872),
      vec3(-0.056194,0.433247,0.173218),
      vec3(-0.016224,0.123149,-0.035569),
      vec3(0.067127,0.407641,0.028479)
   );

   float depth = texture2D(depthmap, vTexCoords).r;
   if(depth == 1.0) {
      discard;
   }

   vec4 screen_position = vec4(vTexCoords, depth,1.0);
   vec4 pos = projinv*screen_position;
   pos /= pos.w;
   vec3 position = pos.xyz;

   //approximate the normal from the depth map; I find this simpler
   //than trying to recompute the exact normal within every possible object shader

   //pixel offset positions in screen space
   ivec2 dim = textureSize(depthmap,0);
   vec2 offset1 = vec2(0.0,1.0/float(dim.y));
   vec2 offset2 = vec2(1.0/float(dim.x),0.0);
   float depth1 = texture2D(depthmap, vTexCoords + offset1).r;
   float depth2 = texture2D(depthmap, vTexCoords + offset2).r;
   
   vec3 p1 = vec3(screen_position.xy+offset1, depth1 - depth);
   vec3 p2 = vec3(screen_position.xy+offset2, depth2 - depth);

   //convert to model space
   vec4 pos1 = projinv*vec4(p1,1);
   pos1 /= pos1.w;
   vec4 pos2 = projinv*vec4(p2,1);
   pos2 /= pos2.w;

   vec3 normal = normalize(cross(pos1.xyz-position, pos2.xyz-position)); //model normal, important we normalize in model space

   //pseudo random number

   float occlusion = 0.0;
   for(int c = 0; c < cycles; c++) {
   vec3 random = normalize(pseudorandomVec3(position+float(c)));
   for(int i=0; i < samples; i++) {

      vec3 ray = radius * reflect(sample_sphere[i],random);
      vec3 hemi_ray = position + sign(dot(ray,normal)) * ray; //model space
      vec4 hemi_screen = projectionMatrix*vec4(hemi_ray,1.0);
      hemi_screen /= hemi_screen.w;
      
      float occ_depth = texture2D(depthmap, clamp(hemi_screen.xy,0.0,1.0)).r;
      float difference = hemi_screen.z - occ_depth;
      
      occlusion += step(0.0, difference) * (1.0-smoothstep(0.0, area, difference));
   }
   }
   float ao = 1.0 - total_strength * occlusion * (1.0 / float(cycles*samples));
   gl_FragDepthEXT = clamp(ao+base,0.0,1.0);

}`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/ssao/ssao.vert": (
          /*!**********************************************!*\
            !*** ./src/WebGL/shaders/lib/ssao/ssao.vert ***!
            \**********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `attribute vec2 vertexPosition;
varying highp vec2 vTexCoords;
const vec2 scale = vec2(0.5, 0.5);

void main() {
   vTexCoords  = vertexPosition * scale + scale; // scale vertex attribute to [0,1] range
   gl_Position = vec4(vertexPosition, 0.0, 1.0);
}
        `;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag": (
          /*!************************************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag ***!
            \************************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `    float dotProduct = dot( norm, vLight );
    vec3 light = vec3( max( dotProduct, 0.0 ) );
    color *= light;
#ifdef SHADED
    ivec2 dim = textureSize(shading,0);
    float shadowFactor = texture2D(shading,vec2(gl_FragCoord.x/float(dim.x),gl_FragCoord.y/float(dim.y))).r;
    color *= shadowFactor;
#endif    
    gl_FragColor = vec4(color, opacity*opacity );
    float fogFactor = smoothstep( fogNear, fogFar, depth );
    gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );
}`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposter/stickimposter.vert": (
          /*!****************************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposter/stickimposter.vert ***!
            \****************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat3 normalMatrix;
uniform vec3 directionalLightColor[ 1 ];
uniform vec3 directionalLightDirection[ 1 ];

attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;
attribute float radius;

varying vec3 vColor;
varying vec3 vLight;
varying vec3 cposition;
varying vec3 p1;
varying vec3 p2;
varying float r;

void main() {

    vColor = color; vColor.z = abs(vColor.z); //z indicates which vertex and so would vary
    r = abs(radius);
    vec4 to = modelViewMatrix*vec4(normal, 1.0); //normal is other point of cylinder
    vec4 pt = modelViewMatrix*vec4(position, 1.0);
    vec4 mvPosition = pt;
    p1 = pt.xyz; p2 = to.xyz;
    vec3 norm = to.xyz-pt.xyz;
    float mult = 1.1; //slop to account for perspective of sphere
    if(length(p1) > length(p2)) { //billboard at level of closest point
       mvPosition = to;
    }
    vec3 n = normalize(mvPosition.xyz);
//intersect with the plane defined by the camera looking at the billboard point
    if(color.z >= 0.0) { //p1
       if(projectionMatrix[3][3] == 0.0) { //perspective
         vec3 pnorm = normalize(p1);
         float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);
         mvPosition.xyz = p1+t*pnorm; 
       } else { //orthographic
         mvPosition.xyz = p1;
       }
    } else {
      if(projectionMatrix[3][3] == 0.0) { //perspective
         vec3 pnorm = normalize(p2);
         float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);
         mvPosition.xyz = p2+t*pnorm;
       } else { //orthographic
         mvPosition.xyz = p2;
       } 
       mult *= -1.0;
    }
    vec3 cr = normalize(cross(mvPosition.xyz,norm))*radius;
    vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*radius;
    mvPosition.xyz +=  mult*(cr + doublecr).xyz;
    cposition = mvPosition.xyz;
    gl_Position = projectionMatrix * mvPosition;
    vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ 0 ], 0.0 );
    vLight = normalize( lDirection.xyz )*directionalLightColor[0]; //not really sure this is right, but color is always white so..
}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposter/stickimposterFragmentShader.partial.frag": (
          /*!**************************************************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposter/stickimposterFragmentShader.partial.frag ***!
            \**************************************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform float opacity;
uniform mat4 projectionMatrix;

uniform vec3 fogColor;
uniform float fogNear;
uniform float fogFar;

varying vec3 vLight;
varying vec3 vColor;
varying vec3 cposition;
varying vec3 p1;
varying vec3 p2;
varying float r;

#ifdef SHADED
uniform highp sampler2D shading;
#endif

//DEFINEFRAGCOLOR

//cylinder-ray intersection testing taken from http://mrl.nyu.edu/~dzorin/cg05/lecture12.pdf
//also useful: http://stackoverflow.com/questions/9595300/cylinder-impostor-in-glsl
//with a bit more care (caps) this could be a general cylinder imposter (see also outline)
void main() {
    vec3 color = abs(vColor);
    vec3 pos = cposition;
    vec3 p = pos; //ray point
    vec3 v = vec3(0.0,0.0,-1.0); //ray normal - orthographic
    if(projectionMatrix[3][3] == 0.0) v = normalize(pos); //ray normal - perspective
    vec3 pa = p1; //cyl start
    vec3 va = normalize(p2-p1); //cyl norm
    vec3 tmp1 = v-(dot(v,va)*va);
    vec3 deltap = p-pa;
    float A = dot(tmp1,tmp1);
    if(A == 0.0) discard;
    vec3 tmp2 = deltap-(dot(deltap,va)*va);
    float B = 2.0*dot(tmp1, tmp2);
    float C = dot(tmp2,tmp2)-r*r;
//quadratic equation!
    float det = (B*B) - (4.0*A*C);
    if(det < 0.0) discard;
    float sqrtDet = sqrt(det);
    float posT = (-B+sqrtDet)/(2.0*A);
    float negT = (-B-sqrtDet)/(2.0*A);
    float intersectionT = min(posT,negT);
    vec3 qi = p+v*intersectionT;
    float dotp1 = dot(va,qi-p1);
    float dotp2 = dot(va,qi-p2);
    vec3 norm;
    if( dotp1 < 0.0 || dotp2 > 0.0) { //(p-c)^2 + 2(p-c)vt +v^2+t^2 - r^2 = 0
       vec3 cp;
       if( dotp1 < 0.0) {  
//        if(vColor.x < 0.0 ) discard; //color sign bit indicates if we should cap or not
        cp = p1;
       } else {
//          if(vColor.y < 0.0 ) discard;
          cp = p2;
       }
       vec3 diff = p-cp;
       A = dot(v,v);
       B = dot(diff,v)*2.0;
       C = dot(diff,diff)-r*r;
       det = (B*B) - (4.0*C);
       if(det < 0.0) discard;
       sqrtDet = sqrt(det);
       posT = (-B+sqrtDet)/(2.0);
       negT = (-B-sqrtDet)/(2.0);
       float t = min(posT,negT);
       qi = p+v*t; 
       norm = normalize(qi-cp); 
    } else {
       norm = normalize(qi-(dotp1*va + p1));
    }
    vec4 clipPos = projectionMatrix * vec4(qi, 1.0);
    float ndcDepth = clipPos.z / clipPos.w;
    float depth = ((gl_DepthRange.diff * ndcDepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;
    gl_FragDepthEXT = depth;`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert": (
          /*!******************************************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert ***!
            \******************************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat3 normalMatrix;
uniform vec3 directionalLightColor[ 1 ];
uniform vec3 directionalLightDirection[ 1 ];
uniform vec3 outlineColor;
uniform float outlineWidth;
uniform float outlinePushback;
uniform float outlineMaxPixels;
uniform float vWidth;
uniform mat4 projinv;


attribute vec3 position;
attribute vec3 normal;
attribute vec3 color;
attribute float radius;

varying vec3 vColor;
varying vec3 vLight;
varying vec3 cposition;
varying vec3 p1;
varying vec3 p2;
varying float r;

void main() {

    vColor = outlineColor;
    float rad = radius+sign(radius)*outlineWidth;
    r = abs(rad);

    vec4 to = modelViewMatrix*vec4(normal, 1.0); //normal is other point of cylinder
    vec4 pt = modelViewMatrix*vec4(position, 1.0);
//pushback
    float scale = 1.0;
    if(projectionMatrix[3][3] != 0.0) { //orthographic
        to.z -= outlinePushback;
        pt.z -= outlinePushback;
    } else { //perspective
        vec4 midbefore = pt;
        if(length(to.xyz) < length(pt)) {
            midbefore = to;
        }
        vec4 midafter = midbefore;
        midafter.xyz += normalize(midbefore.xyz)*outlinePushback;

        to.xyz += normalize(to.xyz)*outlinePushback;
        pt.xyz += normalize(pt.xyz)*outlinePushback;

        //figure out a scaling factor for radius to account for perspective setback
        vec4 midbeforer = vec4(midbefore.x+rad,midbefore.y, midbefore.z, midbefore.w);
        vec4 midafterr = vec4(midafter.x+rad,midafter.y, midafter.z, midafter.w);

        vec4 mb = projectionMatrix*midbefore;
        vec4 mbr = projectionMatrix*midbeforer;
        vec4 ma = projectionMatrix*midafter;
        vec4 mar = projectionMatrix*midafterr;
        mb /= mb.w;
        mbr /= mbr.w;
        ma /= ma.w;
        mar /= mar.w;
        scale = abs((mbr.x-mb.x)/(mar.x-ma.x));
        rad *= scale;
        r = abs(rad);
    }
    vec4 mvPosition = pt;
    p1 = pt.xyz; p2 = to.xyz;
    vec3 norm = to.xyz-pt.xyz;
    float mult = 1.1; //slop to account for perspective of sphere
    if(length(p1) > length(p2)) { //billboard at level of closest point
       mvPosition = to;
    }

    vec3 n = normalize(mvPosition.xyz);
//intersect with the plane defined by the camera looking at the billboard point
    if(color.z >= 0.0) { //p1
       vec3 pnorm = normalize(p1);
       float t = dot(mvPosition.xyz-p1,n)/dot(pnorm,n);
       mvPosition.xyz = p1+t*pnorm;
    } else {
       vec3 pnorm = normalize(p2);
       float t = dot(mvPosition.xyz-p2,n)/dot(pnorm,n);
       mvPosition.xyz = p2+t*pnorm;
       mult *= -1.0;
    }

    if(outlineMaxPixels > 0.0) {
        vec4 cpos = mvPosition;
        vec4 unadjusted = projectionMatrix*vec4(cpos.x+abs(scale*radius), cpos.y,cpos.z,cpos.w); 
        vec4 ccoord = projectionMatrix*cpos;
        vec4 adjust = projectionMatrix*vec4(cpos.x+r,cpos.y,cpos.z,cpos.w); 
        unadjusted /= unadjusted.w;
        adjust /= adjust.w;
        unadjusted.xyz -= ccoord.xyz/ccoord.w;
        adjust.xyz -= ccoord.xyz/ccoord.w;
        float diff = abs(adjust.x-unadjusted.x);
        diff *= vWidth; //this should now be in pixels
        if(diff > outlineMaxPixels) {
            float fixlen = abs(unadjusted.x) + outlineMaxPixels/vWidth; 
            vec4 pcoord = ccoord;
            pcoord.x += fixlen*pcoord.w;
            vec4 altc = projinv*pcoord;
            r= abs(altc.x-cpos.x);
        }
    }

    vec3 cr = normalize(cross(mvPosition.xyz,norm))*rad;
    vec3 doublecr = normalize(cross(mvPosition.xyz,cr))*rad;
    mvPosition.xy +=  mult*(cr + doublecr).xy;
    cposition = mvPosition.xyz;
    gl_Position = projectionMatrix * mvPosition;
    vLight = vec3(1.0,1.0,1.0);
}

`;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/volumetric/volumetric.frag": (
          /*!**********************************************************!*\
            !*** ./src/WebGL/shaders/lib/volumetric/volumetric.frag ***!
            \**********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `
uniform highp sampler3D data;
uniform highp sampler2D colormap;
uniform highp sampler2D depthmap;


uniform mat4 textmat;
uniform mat4 projinv;
uniform mat4 projectionMatrix;

uniform float step;
uniform float subsamples;
uniform float maxdepth;
uniform float transfermin;
uniform float transfermax;
in  vec4 mvPosition;
out vec4 color;
void main(void) {

   vec4 pos = mvPosition;
   bool seengood = false;
   float i = 0.0;
   color = vec4(1,1,1,0);
   float increment = 1.0/subsamples;
   float maxsteps = (maxdepth*subsamples/step);
//there's probably a better way to do this..
//calculate farthest possible point in model coordinates
   vec4 maxpos = vec4(pos.x,pos.y,pos.z-maxdepth,1.0);
// convert to projection
   maxpos = projectionMatrix*maxpos;
   vec4 startp = projectionMatrix*pos;
// homogonize
   maxpos /= maxpos.w;
   startp /= startp.w;
//take x,y from start and z from max
   maxpos = vec4(startp.x,startp.y,maxpos.z,1.0);
//convert back to model space
   maxpos = projinv*maxpos;
   maxpos /= maxpos.w;
   float incr = step/subsamples;
//get depth from depthmap
//startp is apparently [-1,1]
   vec2 tpos = startp.xy/2.0+0.5;
   float depth = texture(depthmap, tpos).r;
//compute vector between start and end
   vec4 direction = maxpos-pos;
   for( i = 0.0; i <= maxsteps; i++) {
      vec4 pt = (pos+(i/maxsteps)*direction);
      vec4 ppt = projectionMatrix*pt;
      float ptdepth = ppt.z/ppt.w;
      ptdepth = ((gl_DepthRange.diff * ptdepth) + gl_DepthRange.near + gl_DepthRange.far) / 2.0;
      if(ptdepth > depth) break;
      pt = textmat*pt;
//       pt /= pt.w;
      if(pt.x >= -0.01 && pt.y >= -0.01 && pt.z >= -0.01 && pt.x <= 1.01 && pt.y <= 1.01 && pt.z <= 1.01) {
         seengood = true;
      } else if(seengood) {
         break;
      }
      if( pt.x < -0.01 || pt.x > 1.01 || pt.y < -0.01 || pt.y > 1.01 || pt.z < -0.01 || pt.z > 1.01  ){
          color.a = 0.0;
          continue;
      }
      else {
         float val = texture(data, pt.zyx).r;
         if(isinf(val)) continue; //masked out
         float cval = (val-transfermin)/(transfermax-transfermin); //scale to texture 0-1 range
         vec4 val_color = texture(colormap, vec2(cval,0.5));
         color.rgb = color.rgb*color.a + (1.0-color.a)*val_color.a*val_color.rgb;
         color.a += (1.0 - color.a) * val_color.a; 
         if(color.a > 0.0) color.rgb /= color.a;
//          color = vec4(pt.x, pt.y, pt.z, 1.0);
      }
//       color = vec4(pt.x, pt.y, pt.z, 0.0)
    }
}

        `;
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/volumetric/volumetric.vert": (
          /*!**********************************************************!*\
            !*** ./src/WebGL/shaders/lib/volumetric/volumetric.vert ***!
            \**********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              default: () => r
              /* harmony export */
            });
            const r = `uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;

in vec3 position;
out vec4 mvPosition;
void main() {

    mvPosition = modelViewMatrix * vec4( position, 1.0 );
    gl_Position = projectionMatrix*mvPosition;
}
`;
          }
        ),
        /***/
        "./src/GLDraw.ts": (
          /*!***********************!*\
            !*** ./src/GLDraw.ts ***!
            \***********************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CAP: () => (
                /* binding */
                a
              ),
              /* harmony export */
              GLDraw: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), a;
            (function(h) {
              h[h.NONE = 0] = "NONE", h[h.FLAT = 1] = "FLAT", h[h.ROUND = 2] = "ROUND";
            })(a || (a = {}));
            var l;
            (function(h) {
              function c(f, s, u) {
                var p = Math.hypot(f, s), g, w, o, v, M;
                p < 1e-4 ? (w = 0, o = 1) : (w = -f / p, o = s / p), s = -w * f + o * s, g = Math.hypot(s, u), g < 1e-4 ? (v = 0, M = 1) : (v = u / g, M = s / g);
                var E = new Float32Array(9);
                return E[0] = o, E[1] = w, E[2] = 0, E[3] = -w * M, E[4] = o * M, E[5] = v, E[6] = w * v, E[7] = -o * v, E[8] = M, E;
              }
              class d {
                constructor() {
                  this.cache = {};
                  let s = [], u = 4, p = Math.pow(2, u), g = 2, w = Math.pow(2, g), o = p / w, v;
                  for (s[0] = new r.Vector3(-1, 0, 0), s[o] = new r.Vector3(0, 0, 1), s[o * 2] = new r.Vector3(1, 0, 0), s[o * 3] = new r.Vector3(0, 0, -1), g = 3; g <= u; g++) {
                    for (w = Math.pow(2, g - 1), o = p / w, v = 0; v < w - 1; v++)
                      s[o / 2 + v * o] = s[v * o].clone().add(s[(v + 1) * o]).normalize();
                    v = w - 1, s[o / 2 + v * o] = s[v * o].clone().add(s[0]).normalize();
                  }
                  this.basisVectors = s;
                }
                getVerticesForRadius(s, u, p) {
                  if (typeof this.cache < "u" && this.cache[s] !== void 0 && this.cache[s][u + p] !== void 0)
                    return this.cache[s][u + p];
                  for (var g = this.basisVectors.length, w = [], o = [], v, M = 0; M < g; M++)
                    w.push(this.basisVectors[M].clone().multiplyScalar(s)), w.push(this.basisVectors[M].clone().multiplyScalar(s)), v = this.basisVectors[M].clone().normalize(), o.push(v), o.push(v);
                  var E = [], $ = 10, k = g, L = 0, z = Math.PI * 2, O = 0, R = Math.PI, N, W, B = !1, P = !1;
                  for (W = 0; W <= $; W++) {
                    B = W === 0 || W === $, P = W === $ / 2;
                    var G = [], H = [];
                    for (N = 0; N <= k; N++) {
                      if (P) {
                        var U = N < k ? 2 * N : 0;
                        H.push(U + 1), G.push(U);
                        continue;
                      }
                      var j = N / k, re = W / $;
                      if (!B || N === 0)
                        if (N < k) {
                          var ie = new r.Vector3();
                          ie.x = -s * Math.cos(L + j * z) * Math.sin(O + re * R), u == 1 ? ie.y = 0 : ie.y = s * Math.cos(O + re * R), ie.z = s * Math.sin(L + j * z) * Math.sin(O + re * R), Math.abs(ie.x) < 1e-5 && (ie.x = 0), Math.abs(ie.y) < 1e-5 && (ie.y = 0), Math.abs(ie.z) < 1e-5 && (ie.z = 0), u == a.FLAT ? (v = new r.Vector3(0, Math.cos(O + re * R), 0), v.normalize()) : (v = new r.Vector3(ie.x, ie.y, ie.z), v.normalize()), w.push(ie), o.push(v), G.push(w.length - 1);
                        } else
                          G.push(w.length - k);
                      else B && G.push(w.length - 1);
                    }
                    P && E.push(H), E.push(G);
                  }
                  var te = {
                    vertices: w,
                    normals: o,
                    verticesRows: E,
                    w: k,
                    h: $
                  };
                  return s in this.cache || (this.cache[s] = {}), this.cache[s][u + p] = te, te;
                }
              }
              var _ = new d();
              function m(f, s, u, p, g, w = 0, o = 0) {
                if (!s || !u)
                  return;
                let v = function(Ce) {
                  if (typeof Ce == "string") {
                    let Ze = Ce;
                    return Ze.toLowerCase() == "flat" ? a.FLAT : Ze.toLowerCase() == "round" ? a.ROUND : a.NONE;
                  } else
                    return Ce;
                };
                w = v(w), o = v(o);
                var M = o || w;
                g = g || { r: 0, g: 0, b: 0 };
                var E = c(u.x - s.x, u.y - s.y, u.z - s.z), $ = _.getVerticesForRadius(p, o, "to"), k = $.w, L = $.h, z = M ? L * k + 2 : 2 * k, O = f.updateGeoGroup(z), R = $.vertices, N = $.normals, W = $.verticesRows, B = W[L / 2], P = W[L / 2 + 1], G = O.vertices, H, U, j, re, ie, te, ue = O.vertexArray, de = O.normalArray, oe = O.colorArray, J = O.faceArray;
                for (j = 0; j < k; ++j) {
                  var Ee = 2 * j;
                  re = E[0] * R[Ee].x + E[3] * R[Ee].y + E[6] * R[Ee].z, ie = E[1] * R[Ee].x + E[4] * R[Ee].y + E[7] * R[Ee].z, te = E[5] * R[Ee].y + E[8] * R[Ee].z, H = 3 * (G + Ee), U = O.faceidx, ue[H] = re + s.x, ue[H + 1] = ie + s.y, ue[H + 2] = te + s.z, ue[H + 3] = re + u.x, ue[H + 4] = ie + u.y, ue[H + 5] = te + u.z, de[H] = re, de[H + 3] = re, de[H + 1] = ie, de[H + 4] = ie, de[H + 2] = te, de[H + 5] = te, oe[H] = g.r, oe[H + 3] = g.r, oe[H + 1] = g.g, oe[H + 4] = g.g, oe[H + 2] = g.b, oe[H + 5] = g.b, J[U] = P[j] + G, J[U + 1] = P[j + 1] + G, J[U + 2] = B[j] + G, J[U + 3] = B[j] + G, J[U + 4] = P[j + 1] + G, J[U + 5] = B[j + 1] + G, O.faceidx += 6;
                }
                if (M) {
                  var se = o ? 0 : L / 2, Ae = w ? L + 1 : L / 2 + 1, he, ne, _e, Le, Be, Ue, He, We, Ge, Ne, Pe, Te, Me, De, V, Z, ee, ye, ce, Ie, ke, Y, me, we, Re, pe, $e, X, ze, Ve, I, xe;
                  for (ie = se; ie < Ae; ie++)
                    if (ie !== L / 2) {
                      var be = ie <= L / 2 ? u : s, q = _.getVerticesForRadius(p, o, "to"), fe = _.getVerticesForRadius(p, w, "from");
                      for (be === u ? (R = q.vertices, N = q.normals, W = q.verticesRows) : be == s && (R = fe.vertices, N = fe.normals, W = fe.verticesRows), re = 0; re < k; re++)
                        U = O.faceidx, he = W[ie][re + 1], ze = (he + G) * 3, ne = W[ie][re], Ve = (ne + G) * 3, _e = W[ie + 1][re], I = (_e + G) * 3, Le = W[ie + 1][re + 1], xe = (Le + G) * 3, Be = E[0] * R[he].x + E[3] * R[he].y + E[6] * R[he].z, Ue = E[0] * R[ne].x + E[3] * R[ne].y + E[6] * R[ne].z, He = E[0] * R[_e].x + E[3] * R[_e].y + E[6] * R[_e].z, We = E[0] * R[Le].x + E[3] * R[Le].y + E[6] * R[Le].z, Ge = E[1] * R[he].x + E[4] * R[he].y + E[7] * R[he].z, Ne = E[1] * R[ne].x + E[4] * R[ne].y + E[7] * R[ne].z, Pe = E[1] * R[_e].x + E[4] * R[_e].y + E[7] * R[_e].z, Te = E[1] * R[Le].x + E[4] * R[Le].y + E[7] * R[Le].z, Me = E[5] * R[he].y + E[8] * R[he].z, De = E[5] * R[ne].y + E[8] * R[ne].z, V = E[5] * R[_e].y + E[8] * R[_e].z, Z = E[5] * R[Le].y + E[8] * R[Le].z, ue[ze] = Be + be.x, ue[Ve] = Ue + be.x, ue[I] = He + be.x, ue[xe] = We + be.x, ue[ze + 1] = Ge + be.y, ue[Ve + 1] = Ne + be.y, ue[I + 1] = Pe + be.y, ue[xe + 1] = Te + be.y, ue[ze + 2] = Me + be.z, ue[Ve + 2] = De + be.z, ue[I + 2] = V + be.z, ue[xe + 2] = Z + be.z, oe[ze] = g.r, oe[Ve] = g.r, oe[I] = g.r, oe[xe] = g.r, oe[ze + 1] = g.g, oe[Ve + 1] = g.g, oe[I + 1] = g.g, oe[xe + 1] = g.g, oe[ze + 2] = g.b, oe[Ve + 2] = g.b, oe[I + 2] = g.b, oe[xe + 2] = g.b, ee = E[0] * N[he].x + E[3] * N[he].y + E[6] * N[he].z, ye = E[0] * N[ne].x + E[3] * N[ne].y + E[6] * N[ne].z, ce = E[0] * N[_e].x + E[3] * N[_e].y + E[6] * N[_e].z, Ie = E[0] * N[Le].x + E[3] * N[Le].y + E[6] * N[Le].z, ke = E[1] * N[he].x + E[4] * N[he].y + E[7] * N[he].z, Y = E[1] * N[ne].x + E[4] * N[ne].y + E[7] * N[ne].z, me = E[1] * N[_e].x + E[4] * N[_e].y + E[7] * N[_e].z, we = E[1] * N[Le].x + E[4] * N[Le].y + E[7] * N[Le].z, Re = E[5] * N[he].y + E[8] * N[he].z, pe = E[5] * N[ne].y + E[8] * N[ne].z, $e = E[5] * N[_e].y + E[8] * N[_e].z, X = E[5] * N[Le].y + E[8] * N[Le].z, ie === 0 ? (de[ze] = ee, de[I] = ce, de[xe] = Ie, de[ze + 1] = ke, de[I + 1] = me, de[xe + 1] = we, de[ze + 2] = Re, de[I + 2] = $e, de[xe + 2] = X, J[U] = he + G, J[U + 1] = _e + G, J[U + 2] = Le + G, O.faceidx += 3) : ie === Ae - 1 ? (de[ze] = ee, de[Ve] = ye, de[I] = ce, de[ze + 1] = ke, de[Ve + 1] = Y, de[I + 1] = me, de[ze + 2] = Re, de[Ve + 2] = pe, de[I + 2] = $e, J[U] = he + G, J[U + 1] = ne + G, J[U + 2] = _e + G, O.faceidx += 3) : (de[ze] = ee, de[Ve] = ye, de[xe] = Ie, de[ze + 1] = ke, de[Ve + 1] = Y, de[xe + 1] = we, de[ze + 2] = Re, de[Ve + 2] = pe, de[xe + 2] = X, de[Ve] = ye, de[I] = ce, de[xe] = Ie, de[Ve + 1] = Y, de[I + 1] = me, de[xe + 1] = we, de[Ve + 2] = pe, de[I + 2] = $e, de[xe + 2] = X, J[U] = he + G, J[U + 1] = ne + G, J[U + 2] = Le + G, J[U + 3] = ne + G, J[U + 4] = _e + G, J[U + 5] = Le + G, O.faceidx += 6);
                    }
                }
                O.vertices += z;
              }
              h.drawCylinder = m;
              function y(f, s, u, p, g) {
                if (!s || !u)
                  return;
                g = g || { r: 0, g: 0, b: 0 };
                let w = new r.Vector3(u.x - s.x, u.y - s.y, u.z - s.z);
                var o = c(w.x, w.y, w.z);
                w = w.normalize();
                var v = _.basisVectors.length, M = _.basisVectors, E = v + 2, $ = f.updateGeoGroup(E), k = $.vertices, L, z, O, R, N, W, B = $.vertexArray, P = $.normalArray, G = $.colorArray, H = $.faceArray;
                for (L = k * 3, B[L] = s.x, B[L + 1] = s.y, B[L + 2] = s.z, P[L] = -w.x, P[L + 1] = -w.y, P[L + 2] = -w.z, G[L] = g.r, G[L + 1] = g.g, G[L + 2] = g.b, B[L + 3] = u.x, B[L + 4] = u.y, B[L + 5] = u.z, P[L + 3] = w.x, P[L + 4] = w.y, P[L + 5] = w.z, G[L + 3] = g.r, G[L + 4] = g.g, G[L + 5] = g.b, L += 6, O = 0; O < v; ++O) {
                  var U = M[O].clone();
                  U.multiplyScalar(p), R = o[0] * U.x + o[3] * U.y + o[6] * U.z, N = o[1] * U.x + o[4] * U.y + o[7] * U.z, W = o[5] * U.y + o[8] * U.z, B[L] = R + s.x, B[L + 1] = N + s.y, B[L + 2] = W + s.z, P[L] = R, P[L + 1] = N, P[L + 2] = W, G[L] = g.r, G[L + 1] = g.g, G[L + 2] = g.b, L += 3;
                }
                for ($.vertices += v + 2, z = $.faceidx, O = 0; O < v; O++) {
                  var j = k + 2 + O, re = k + 2 + (O + 1) % v;
                  H[z] = j, H[z + 1] = re, H[z + 2] = k, z += 3, H[z] = j, H[z + 1] = re, H[z + 2] = k + 1, z += 3;
                }
                $.faceidx += 6 * v;
              }
              h.drawCone = y;
              class x {
                constructor() {
                  this.cache = /* @__PURE__ */ new Map();
                }
                getVerticesForRadius(s, u) {
                  u = u || 2, this.cache.has(u) || this.cache.set(u, /* @__PURE__ */ new Map());
                  let p = this.cache.get(u);
                  if (p.has(s))
                    return p.get(s);
                  var g = {
                    vertices: [],
                    verticesRows: [],
                    normals: []
                  }, w = 16 * u, o = 10 * u;
                  s < 1 && (w = 10 * u, o = 8 * u);
                  var v = 0, M = Math.PI * 2, E = 0, $ = Math.PI, k, L;
                  for (L = 0; L <= o; L++) {
                    let O = [];
                    for (k = 0; k <= w; k++) {
                      let R = k / w, N = L / o, W = -s * Math.cos(v + R * M) * Math.sin(E + N * $), B = s * Math.cos(E + N * $), P = s * Math.sin(v + R * M) * Math.sin(E + N * $);
                      var z = new r.Vector3(W, B, P);
                      z.normalize(), g.vertices.push({ x: W, y: B, z: P }), g.normals.push(z), O.push(g.vertices.length - 1);
                    }
                    g.verticesRows.push(O);
                  }
                  return p.set(s, g), g;
                }
              }
              var b = new x();
              function A(f, s, u, p, g) {
                var w = b.getVerticesForRadius(u, g), o = w.vertices, v = w.normals, M = f.updateGeoGroup(o.length), E = M.vertices, $ = M.vertexArray, k = M.colorArray, L = M.faceArray, z = M.lineArray, O = M.normalArray;
                for (let W = 0, B = o.length; W < B; ++W) {
                  let P = 3 * (E + W), G = o[W];
                  $[P] = G.x + s.x, $[P + 1] = G.y + s.y, $[P + 2] = G.z + s.z, k[P] = p.r, k[P + 1] = p.g, k[P + 2] = p.b;
                }
                M.vertices += o.length;
                let R = w.verticesRows, N = R.length - 1;
                for (let W = 0; W < N; W++) {
                  let B = R[W].length - 1;
                  for (let P = 0; P < B; P++) {
                    let G = M.faceidx, H = M.lineidx, U = R[W][P + 1] + E, j = U * 3, re = R[W][P] + E, ie = re * 3, te = R[W + 1][P] + E, ue = te * 3, de = R[W + 1][P + 1] + E, oe = de * 3, J = v[U - E], Ee = v[re - E], se = v[te - E], Ae = v[de - E];
                    Math.abs(o[U - E].y) === u ? (O[j] = J.x, O[ue] = se.x, O[oe] = Ae.x, O[j + 1] = J.y, O[ue + 1] = se.y, O[oe + 1] = Ae.y, O[j + 2] = J.z, O[ue + 2] = se.z, O[oe + 2] = Ae.z, L[G] = U, L[G + 1] = te, L[G + 2] = de, z[H] = U, z[H + 1] = te, z[H + 2] = U, z[H + 3] = de, z[H + 4] = te, z[H + 5] = de, M.faceidx += 3, M.lineidx += 6) : Math.abs(o[te - E].y) === u ? (O[j] = J.x, O[ie] = Ee.x, O[ue] = se.x, O[j + 1] = J.y, O[ie + 1] = Ee.y, O[ue + 1] = se.y, O[j + 2] = J.z, O[ie + 2] = Ee.z, O[ue + 2] = se.z, L[G] = U, L[G + 1] = re, L[G + 2] = te, z[H] = U, z[H + 1] = re, z[H + 2] = U, z[H + 3] = te, z[H + 4] = re, z[H + 5] = te, M.faceidx += 3, M.lineidx += 6) : (O[j] = J.x, O[ie] = Ee.x, O[oe] = Ae.x, O[j + 1] = J.y, O[ie + 1] = Ee.y, O[oe + 1] = Ae.y, O[j + 2] = J.z, O[ie + 2] = Ee.z, O[oe + 2] = Ae.z, O[ie] = Ee.x, O[ue] = se.x, O[oe] = Ae.x, O[ie + 1] = Ee.y, O[ue + 1] = se.y, O[oe + 1] = Ae.y, O[ie + 2] = Ee.z, O[ue + 2] = se.z, O[oe + 2] = Ae.z, L[G] = U, L[G + 1] = re, L[G + 2] = de, L[G + 3] = re, L[G + 4] = te, L[G + 5] = de, z[H] = U, z[H + 1] = re, z[H + 2] = U, z[H + 3] = de, z[H + 4] = re, z[H + 5] = te, z[H + 6] = te, z[H + 7] = de, M.faceidx += 6, M.lineidx += 8);
                  }
                }
              }
              h.drawSphere = A;
            })(l || (l = {}));
          }
        ),
        /***/
        "./src/GLModel.ts": (
          /*!************************!*\
            !*** ./src/GLModel.ts ***!
            \************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              GLModel: () => (
                /* binding */
                A
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./WebGL/shapes */
              "./src/WebGL/shapes/index.ts"
            ), l = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), h = t(
              /*! ./colors */
              "./src/colors.ts"
            ), c = t(
              /*! ./GLDraw */
              "./src/GLDraw.ts"
            ), d = t(
              /*! ./glcartoon */
              "./src/glcartoon.ts"
            ), _ = t(
              /*! ./utilities */
              "./src/utilities.ts"
            ), m = t(
              /*! ./Gradient */
              "./src/Gradient.ts"
            ), y = t(
              /*! ./parsers */
              "./src/parsers/index.ts"
            ), x = t(
              /*! netcdfjs */
              "./node_modules/netcdfjs/lib-esm/index.js"
            ), b = t(
              /*! ./parsers/utils/assignBonds */
              "./src/parsers/utils/assignBonds.ts"
            );
            class A {
              // class functions
              // return true if a and b represent the same style
              static sameObj(s, u) {
                return s && u ? JSON.stringify(s) == JSON.stringify(u) : s == u;
              }
              constructor(s, u) {
                this.atoms = [], this.frames = [], this.box = null, this.atomdfs = null, this.id = 0, this.hidden = !1, this.molObj = null, this.renderedMolObj = null, this.lastColors = null, this.modelData = {}, this.modelDatas = null, this.idMatrix = new l.Matrix4(), this.dontDuplicateAtoms = !0, this.defaultColor = h.elementColors.defaultColor, this.defaultStickRadius = 0.25, this.options = u || {}, this.ElementColors = this.options.defaultcolors ? this.options.defaultcolors : h.elementColors.defaultColors, this.defaultSphereRadius = this.options.defaultSphereRadius ? this.options.defaultSphereRadius : 1.5, this.defaultCartoonQuality = this.options.cartoonQuality ? this.options.cartoonQuality : 10, this.id = s;
              }
              // return proper radius for atom given style
              /**
               *
               * @param {AtomSpec} atom
               * @param {atomstyle} style
               * @return {number}
               *
               */
              getRadiusFromStyle(s, u) {
                var p = this.defaultSphereRadius;
                if (typeof u.radius < "u")
                  p = u.radius;
                else if (A.vdwRadii[s.elem])
                  p = A.vdwRadii[s.elem];
                else if (s.elem.length > 1) {
                  let g = s.elem;
                  g = g[0].toUpperCase() + g[1].toLowerCase(), A.vdwRadii[g] && (p = A.vdwRadii[g]);
                }
                return typeof u.scale < "u" && (p *= u.scale), p;
              }
              // cross drawing
              /**
               *
               * @param {AtomSpec} atom
               * @param {Record<number, Geometry>} geos
               */
              drawAtomCross(s, u) {
                if (s.style.cross) {
                  var p = s.style.cross;
                  if (!p.hidden) {
                    var g = p.linewidth || A.defaultlineWidth;
                    u[g] || (u[g] = new r.Geometry());
                    var w = u[g].updateGeoGroup(6), o = this.getRadiusFromStyle(s, p), v = [
                      [o, 0, 0],
                      [-o, 0, 0],
                      [0, o, 0],
                      [0, -o, 0],
                      [0, 0, o],
                      [0, 0, -o]
                    ], M = s.clickable || s.hoverable;
                    M && s.intersectionShape === void 0 && (s.intersectionShape = { sphere: [], cylinder: [], line: [] });
                    for (var E = (0, _.getColorFromStyle)(s, p), $ = w.vertexArray, k = w.colorArray, L = 0; L < 6; L++) {
                      var z = w.vertices * 3;
                      if (w.vertices++, $[z] = s.x + v[L][0], $[z + 1] = s.y + v[L][1], $[z + 2] = s.z + v[L][2], k[z] = E.r, k[z + 1] = E.g, k[z + 2] = E.b, M) {
                        var O = new l.Vector3(v[L][0], v[L][1], v[L][2]);
                        O.multiplyScalar(0.1), O.set(O.x + s.x, O.y + s.y, O.z + s.z), s.intersectionShape.line.push(O);
                      }
                    }
                  }
                }
              }
              getGoodCross(s, u, p, g) {
                for (var w = null, o = -1, v = 0, M = s.bonds.length; v < M; v++)
                  if (s.bonds[v] != u.index) {
                    let $ = s.bonds[v], k = this.atoms[$], z = new l.Vector3(k.x, k.y, k.z).clone();
                    z.sub(p);
                    let O = z.clone();
                    O.cross(g);
                    var E = O.lengthSq();
                    if (E > o && (o = E, w = O, o > 0.1))
                      return w;
                  }
                return w;
              }
              //from atom, return a normalized vector v that is orthogonal and along which
              //it is appropraite to draw multiple bonds
              getSideBondV(s, u, p) {
                var g, w, o, v, M, E = new l.Vector3(s.x, s.y, s.z), $ = new l.Vector3(u.x, u.y, u.z), k = $.clone(), L = null;
                if (k.sub(E), s.bonds.length === 1)
                  u.bonds.length === 1 ? (L = k.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1) : (g = (p + 1) % u.bonds.length, w = u.bonds[g], o = this.atoms[w], o.index == s.index && (g = (g + 1) % u.bonds.length, w = u.bonds[g], o = this.atoms[w]), v = new l.Vector3(o.x, o.y, o.z), M = v.clone(), M.sub(E), L = M.clone(), L.cross(k));
                else if (L = this.getGoodCross(s, u, E, k), L.lengthSq() < 0.01) {
                  var z = this.getGoodCross(u, s, E, k);
                  z != null && (L = z);
                }
                return L.lengthSq() < 0.01 && (L = k.clone(), Math.abs(L.x) > 1e-4 ? L.y += 1 : L.x += 1), L.cross(k), L.normalize(), L;
              }
              addLine(s, u, p, g, w, o) {
                s[p] = g.x, s[p + 1] = g.y, s[p + 2] = g.z, u[p] = o.r, u[p + 1] = o.g, u[p + 2] = o.b, s[p + 3] = w.x, s[p + 4] = w.y, s[p + 5] = w.z, u[p + 3] = o.r, u[p + 4] = o.g, u[p + 5] = o.b;
              }
              // bonds - both atoms must match bond style
              // standardize on only drawing for lowest to highest
              /**
               *
               * @param {AtomSpec}
               *            atom
               * @param {AtomSpec[]} atoms
               * @param {Record<number,Geometry>} geos
               */
              drawBondLines(s, u, p) {
                if (s.style.line) {
                  var g = s.style.line;
                  if (!g.hidden) {
                    var w, o, v, M, E = g.linewidth || A.defaultlineWidth;
                    p[E] || (p[E] = new r.Geometry());
                    for (var $ = p[E].updateGeoGroup(6 * s.bonds.length), k = $.vertexArray, L = $.colorArray, z = 0; z < s.bonds.length; z++) {
                      var O = s.bonds[z], R = u[O];
                      if (R.style.line && !(s.index >= R.index)) {
                        var N = new l.Vector3(s.x, s.y, s.z), W = new l.Vector3(R.x, R.y, R.z), B = N.clone().add(W).multiplyScalar(0.5), P = !1, G = s.clickable || s.hoverable, H = R.clickable || R.hoverable;
                        (G || H) && (G && (s.intersectionShape === void 0 && (s.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), s.intersectionShape.line.push(N), s.intersectionShape.line.push(B)), H && (R.intersectionShape === void 0 && (R.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), R.intersectionShape.line.push(B), R.intersectionShape.line.push(W)));
                        var U = (0, _.getColorFromStyle)(s, s.style.line), j = (0, _.getColorFromStyle)(R, R.style.line);
                        if (s.bondStyles && s.bondStyles[z]) {
                          var re = s.bondStyles[z];
                          if (!re.iswire)
                            continue;
                          re.singleBond && (P = !0), typeof re.color1 < "u" && (U = h.CC.color(re.color1)), typeof re.color2 < "u" && (j = h.CC.color(re.color2));
                        }
                        var ie = $.vertices * 3, te, ue;
                        if (s.bondOrder[z] > 1 && s.bondOrder[z] < 4 && !P) {
                          var de = this.getSideBondV(s, R, z), oe = W.clone();
                          oe.sub(N), s.bondOrder[z] == 2 ? (de.multiplyScalar(0.1), w = N.clone(), w.add(de), o = N.clone(), o.sub(de), v = w.clone(), v.add(oe), M = o.clone(), M.add(oe), U == j ? ($.vertices += 4, this.addLine(k, L, ie, w, v, U), this.addLine(k, L, ie + 6, o, M, U)) : ($.vertices += 8, oe.multiplyScalar(0.5), te = w.clone(), te.add(oe), ue = o.clone(), ue.add(oe), this.addLine(k, L, ie, w, te, U), this.addLine(k, L, ie + 6, te, v, j), this.addLine(k, L, ie + 12, o, ue, U), this.addLine(k, L, ie + 18, ue, M, j))) : s.bondOrder[z] == 3 && (de.multiplyScalar(0.1), w = N.clone(), w.add(de), o = N.clone(), o.sub(de), v = w.clone(), v.add(oe), M = o.clone(), M.add(oe), U == j ? ($.vertices += 6, this.addLine(k, L, ie, N, W, U), this.addLine(k, L, ie + 6, w, v, U), this.addLine(k, L, ie + 12, o, M, U)) : ($.vertices += 12, oe.multiplyScalar(0.5), te = w.clone(), te.add(oe), ue = o.clone(), ue.add(oe), this.addLine(k, L, ie, N, B, U), this.addLine(k, L, ie + 6, B, W, j), this.addLine(k, L, ie + 12, w, te, U), this.addLine(k, L, ie + 18, te, v, j), this.addLine(k, L, ie + 24, o, ue, U), this.addLine(k, L, ie + 30, ue, M, j)));
                        } else
                          U == j ? ($.vertices += 2, this.addLine(k, L, ie, N, W, U)) : ($.vertices += 4, this.addLine(k, L, ie, N, B, U), this.addLine(k, L, ie + 6, B, W, j));
                      }
                    }
                  }
                }
              }
              //sphere drawing
              //See also: drawCylinder
              /**
               *
               * @param {AtomSpec} atom
               * @param {Geometry} geo
               */
              drawAtomSphere(s, u) {
                if (s.style.sphere) {
                  var p = s.style.sphere;
                  if (!p.hidden) {
                    var g = (0, _.getColorFromStyle)(s, p), w = this.getRadiusFromStyle(s, p);
                    if ((s.clickable === !0 || s.hoverable) && s.intersectionShape !== void 0) {
                      var o = new l.Vector3(s.x, s.y, s.z);
                      s.intersectionShape.sphere.push(new a.Sphere(o, w));
                    }
                    c.GLDraw.drawSphere(u, s, w, g);
                  }
                }
              }
              /** Register atom shaped click handlers */
              drawAtomClickSphere(s) {
                if (s.style.clicksphere) {
                  var u = s.style.clicksphere;
                  if (!u.hidden) {
                    var p = this.getRadiusFromStyle(s, u);
                    if ((s.clickable === !0 || s.hoverable) && s.intersectionShape !== void 0) {
                      var g = new l.Vector3(s.x, s.y, s.z);
                      s.intersectionShape.sphere.push(new a.Sphere(g, p));
                    }
                  }
                }
              }
              drawAtomInstanced(s, u) {
                if (s.style.sphere) {
                  var p = s.style.sphere;
                  if (!p.hidden) {
                    var g = this.getRadiusFromStyle(s, p), w = (0, _.getColorFromStyle)(s, p), o = u.updateGeoGroup(1), v = o.vertices, M = v * 3, E = o.vertexArray, $ = o.colorArray, k = o.radiusArray;
                    if (E[M] = s.x, E[M + 1] = s.y, E[M + 2] = s.z, $[M] = w.r, $[M + 1] = w.g, $[M + 2] = w.b, k[v] = g, (s.clickable === !0 || s.hoverable) && s.intersectionShape !== void 0) {
                      var L = new l.Vector3(s.x, s.y, s.z);
                      s.intersectionShape.sphere.push(new a.Sphere(L, g));
                    }
                    o.vertices += 1;
                  }
                }
              }
              drawSphereImposter(s, u, p, g) {
                var w = s.updateGeoGroup(4), o, v = w.vertices, M = v * 3, E = w.vertexArray, $ = w.colorArray;
                for (o = 0; o < 4; o++)
                  E[M + 3 * o] = u.x, E[M + 3 * o + 1] = u.y, E[M + 3 * o + 2] = u.z;
                var k = w.normalArray;
                for (o = 0; o < 4; o++)
                  $[M + 3 * o] = g.r, $[M + 3 * o + 1] = g.g, $[M + 3 * o + 2] = g.b;
                k[M + 0] = -p, k[M + 1] = p, k[M + 2] = 0, k[M + 3] = -p, k[M + 4] = -p, k[M + 5] = 0, k[M + 6] = p, k[M + 7] = -p, k[M + 8] = 0, k[M + 9] = p, k[M + 10] = p, k[M + 11] = 0, w.vertices += 4;
                var L = w.faceArray, z = w.faceidx;
                L[z + 0] = v, L[z + 1] = v + 1, L[z + 2] = v + 2, L[z + 3] = v + 2, L[z + 4] = v + 3, L[z + 5] = v, w.faceidx += 6;
              }
              //dkoes -  code for sphere imposters
              drawAtomImposter(s, u) {
                if (s.style.sphere) {
                  var p = s.style.sphere;
                  if (!p.hidden) {
                    var g = this.getRadiusFromStyle(s, p), w = (0, _.getColorFromStyle)(s, p);
                    if ((s.clickable === !0 || s.hoverable) && s.intersectionShape !== void 0) {
                      var o = new l.Vector3(s.x, s.y, s.z);
                      s.intersectionShape.sphere.push(new a.Sphere(o, g));
                    }
                    this.drawSphereImposter(u, s, g, w);
                  }
                }
              }
              calculateDashes(s, u, p, g, w) {
                var o = Math.sqrt(Math.pow(s.x - u.x, 2) + Math.pow(s.y - u.y, 2) + Math.pow(s.z - u.z, 2));
                p = Math.max(p, 0), w = Math.max(w, 0) + 2 * p, g = Math.max(g, 1e-3), g + w > o && (g = o, w = 0);
                var v = Math.floor((o - g) / (g + w)) + 1, M = v * g;
                w = (o - M) / v;
                for (var E, $ = new l.Vector3(s.x, s.y, s.z), k = new l.Vector3((u.x - s.x) / (o / w), (u.y - s.y) / (o / w), (u.z - s.z) / (o / w)), L = new l.Vector3((u.x - s.x) / (o / g), (u.y - s.y) / (o / g), (u.z - s.z) / (o / g)), z = [], O = 0; O < v; O++)
                  E = new l.Vector3($.x + L.x, $.y + L.y, $.z + L.z), z.push({ from: $, to: E }), $ = new l.Vector3(E.x + k.x, E.y + k.y, E.z + k.z);
                return z;
              }
              static drawStickImposter(s, u, p, g, w, o = 0, v = 0) {
                for (var M = s.updateGeoGroup(4), E = M.vertices, $ = E * 3, k = M.vertexArray, L = M.colorArray, z = M.radiusArray, O = M.normalArray, R = w.r, N = w.g, W = w.b, B = function(j) {
                  var re = -j;
                  return re == 0 && (re = -1e-4), re;
                }, P = $, G = 0; G < 4; G++)
                  k[P] = u.x, O[P] = p.x, L[P] = R, P++, k[P] = u.y, O[P] = p.y, L[P] = N, P++, k[P] = u.z, O[P] = p.z, G < 2 ? L[P] = W : L[P] = B(W), P++;
                M.vertices += 4, z[E] = -g, z[E + 1] = g, z[E + 2] = -g, z[E + 3] = g;
                var H = M.faceArray, U = M.faceidx;
                H[U + 0] = E, H[U + 1] = E + 1, H[U + 2] = E + 2, H[U + 3] = E + 2, H[U + 4] = E + 3, H[U + 5] = E, M.faceidx += 6;
              }
              // draws cylinders and small spheres (at bond radius)
              drawBondSticks(s, u, p) {
                var g, w;
                if (s.style.stick) {
                  var o = s.style.stick;
                  if (!o.hidden) {
                    var v = o.radius || this.defaultStickRadius, M = o.doubleBondScaling || 0.4, E = o.tripleBondScaling || 0.25, $ = ((g = o.dashedBondConfig) === null || g === void 0 ? void 0 : g.dashLength) || 0.1, k = ((w = o.dashedBondConfig) === null || w === void 0 ? void 0 : w.gapLength) || 0.25, L = v, z = o.singleBonds || !1, O = o.dashedBonds || !1, R = 0, N = 0, W, B, P, G, H, U, j, re, ie, te, ue, de = (0, _.getColorFromStyle)(s, o), oe, J, Ee;
                    !s.capDrawn && s.bonds.length < 4 && (R = 2);
                    var se = (me) => {
                      var we = p.imposter ? A.drawStickImposter : c.GLDraw.drawCylinder;
                      return !O && me >= 1 ? we : (Re, pe, $e, X, ze, Ve = 0, I = 0, xe = 0.1, be = 0.25) => {
                        var q = this.calculateDashes(pe, $e, X, xe, be);
                        q.forEach((fe) => {
                          we(Re, fe.from, fe.to, X, ze, Ve, I);
                        });
                      };
                    };
                    for (P = 0; P < s.bonds.length; P++) {
                      var Ae = se(s.bondOrder[P]), he = s.bonds[P], ne = u[he];
                      if (oe = J = Ee = null, s.index < ne.index) {
                        var _e = ne.style;
                        if (!_e.stick || _e.stick.hidden)
                          continue;
                        var Le = (0, _.getColorFromStyle)(ne, _e.stick);
                        if (L = v, G = z, s.bondStyles && s.bondStyles[P]) {
                          if (H = s.bondStyles[P], H.iswire)
                            continue;
                          H.radius && (L = H.radius), H.singleBond && (G = !0), typeof H.color1 < "u" && (de = h.CC.color(H.color1)), typeof H.color2 < "u" && (Le = h.CC.color(H.color2));
                        }
                        var Be = new l.Vector3(s.x, s.y, s.z), Ue = new l.Vector3(ne.x, ne.y, ne.z);
                        if (s.bondOrder[P] <= 1 || G || s.bondOrder[P] > 3) {
                          if (s.bondOrder[P] < 1 && (L *= s.bondOrder[P]), !ne.capDrawn && ne.bonds.length < 4 && (N = 2), de != Le ? (oe = new l.Vector3().addVectors(Be, Ue).multiplyScalar(0.5), Ae(p, Be, oe, L, de, R, 0, $, k), Ae(p, oe, Ue, L, Le, 0, N, $, k)) : Ae(p, Be, Ue, L, de, R, N, $, k), W = s.clickable || s.hoverable, B = ne.clickable || ne.hoverable, W || B) {
                            if (oe || (oe = new l.Vector3().addVectors(Be, Ue).multiplyScalar(0.5)), W) {
                              var He = new a.Cylinder(Be, oe, L), We = new a.Sphere(Be, L);
                              s.intersectionShape.cylinder.push(He), s.intersectionShape.sphere.push(We);
                            }
                            if (B) {
                              var Ge = new a.Cylinder(Ue, oe, L), Ne = new a.Sphere(Ue, L);
                              ne.intersectionShape.cylinder.push(Ge), ne.intersectionShape.sphere.push(Ne);
                            }
                          }
                        } else if (s.bondOrder[P] > 1) {
                          var Pe = 0, Te = 0;
                          L != v && (Pe = 2, Te = 2);
                          var Me = Ue.clone(), De = null;
                          Me.sub(Be);
                          var V, Z, ee, ye, ce;
                          De = this.getSideBondV(s, ne, P), s.bondOrder[P] == 2 ? (V = L * M, De.multiplyScalar(V * 1.5), Z = Be.clone(), Z.add(De), ee = Be.clone(), ee.sub(De), ye = Z.clone(), ye.add(Me), ce = ee.clone(), ce.add(Me), de != Le ? (oe = new l.Vector3().addVectors(Z, ye).multiplyScalar(0.5), J = new l.Vector3().addVectors(ee, ce).multiplyScalar(0.5), Ae(p, Z, oe, V, de, Pe, 0), Ae(p, oe, ye, V, Le, 0, Te), Ae(p, ee, J, V, de, Pe, 0), Ae(p, J, ce, V, Le, 0, Te)) : (Ae(p, Z, ye, V, de, Pe, Te), Ae(p, ee, ce, V, de, Pe, Te)), W = s.clickable || s.hoverable, B = ne.clickable || ne.hoverable, (W || B) && (oe || (oe = new l.Vector3().addVectors(Z, ye).multiplyScalar(0.5)), J || (J = new l.Vector3().addVectors(ee, ce).multiplyScalar(0.5)), W && (U = new a.Cylinder(Z, oe, V), j = new a.Cylinder(ee, J, V), s.intersectionShape.cylinder.push(U), s.intersectionShape.cylinder.push(j)), B && (ie = new a.Cylinder(ye, oe, V), te = new a.Cylinder(ce, J, V), ne.intersectionShape.cylinder.push(ie), ne.intersectionShape.cylinder.push(te)))) : s.bondOrder[P] == 3 && (V = L * E, De.cross(Me), De.normalize(), De.multiplyScalar(V * 3), Z = Be.clone(), Z.add(De), ee = Be.clone(), ee.sub(De), ye = Z.clone(), ye.add(Me), ce = ee.clone(), ce.add(Me), de != Le ? (oe = new l.Vector3().addVectors(Z, ye).multiplyScalar(0.5), J = new l.Vector3().addVectors(ee, ce).multiplyScalar(0.5), Ee = new l.Vector3().addVectors(Be, Ue).multiplyScalar(0.5), Ae(p, Z, oe, V, de, Pe, 0), Ae(p, oe, ye, V, Le, 0, Te), Ae(p, Be, Ee, V, de, R, 0), Ae(p, Ee, Ue, V, Le, 0, N), Ae(p, ee, J, V, de, Pe, 0), Ae(p, J, ce, V, Le, 0, Te)) : (Ae(p, Z, ye, V, de, Pe, Te), Ae(p, Be, Ue, V, de, R, N), Ae(p, ee, ce, V, de, Pe, Te)), W = s.clickable || s.hoverable, B = ne.clickable || ne.hoverable, (W || B) && (oe || (oe = new l.Vector3().addVectors(Z, ye).multiplyScalar(0.5)), J || (J = new l.Vector3().addVectors(ee, ce).multiplyScalar(0.5)), Ee || (Ee = new l.Vector3().addVectors(Be, Ue).multiplyScalar(0.5)), W && (U = new a.Cylinder(Z.clone(), oe.clone(), V), j = new a.Cylinder(ee.clone(), J.clone(), V), re = new a.Cylinder(Be.clone(), Ee.clone(), V), s.intersectionShape.cylinder.push(U), s.intersectionShape.cylinder.push(j), s.intersectionShape.cylinder.push(re)), B && (ie = new a.Cylinder(ye.clone(), oe.clone(), V), te = new a.Cylinder(ce.clone(), J.clone(), V), ue = new a.Cylinder(Ue.clone(), Ee.clone(), V), ne.intersectionShape.cylinder.push(ie), ne.intersectionShape.cylinder.push(te), ne.intersectionShape.cylinder.push(ue))));
                        }
                      }
                    }
                    var Ie = !1, ke = 0, Y = !1;
                    for (P = 0; P < s.bonds.length; P++)
                      G = z, s.bondStyles && s.bondStyles[P] && (H = s.bondStyles[P], H.singleBond && (G = !0), H.radius && H.radius != v && (Y = !0)), (G || s.bondOrder[P] == 1) && ke++;
                    Y ? ke > 0 && (Ie = !0) : ke == 0 && (s.bonds.length > 0 || o.showNonBonded) && (Ie = !0), Ie && (L = v, p.imposter ? this.drawSphereImposter(p.sphereGeometry, s, L, de) : c.GLDraw.drawSphere(p, s, L, de));
                  }
                }
              }
              // go through all the atoms and regenerate their geometries
              // we try to have one geometry for each style since this is much much
              // faster
              // at some point we should optimize this to avoid unnecessary
              // recalculation
              /** param {AtomSpec[]} atoms */
              createMolObj(s, u) {
                u = u || {};
                var p = new r.Object3D(), g = [], w = {}, o = {}, v = this.drawAtomSphere, M = null, E = null;
                u.supportsImposters ? (v = this.drawAtomImposter, M = new r.Geometry(!0), M.imposter = !0, E = new r.Geometry(!0, !0), E.imposter = !0, E.sphereGeometry = new r.Geometry(!0), E.sphereGeometry.imposter = !0, E.drawnCaps = {}) : u.supportsAIA ? (v = this.drawAtomInstanced, M = new r.Geometry(!1, !0, !0), M.instanced = !0, E = new r.Geometry(!0)) : (M = new r.Geometry(!0), E = new r.Geometry(!0));
                var $, k, L, z, O = {}, R = [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY];
                for ($ = 0, L = s.length; $ < L; $++) {
                  var N = s[$];
                  if (N && N.style) {
                    (N.clickable || N.hoverable) && N.intersectionShape === void 0 && (N.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), z = { line: void 0, cross: void 0, stick: void 0, sphere: void 0 };
                    for (k in z)
                      N.style[k] ? N.style[k].opacity ? z[k] = parseFloat(N.style[k].opacity) : z[k] = 1 : z[k] = void 0, O[k] ? z[k] != null && O[k] != z[k] && (console.log("Warning: " + k + " opacity is ambiguous"), O[k] = 1) : O[k] = z[k];
                    v.call(this, N, M), this.drawAtomClickSphere(N), this.drawAtomCross(N, o), this.drawBondLines(N, s, w), this.drawBondSticks(N, s, E), typeof N.style.cartoon < "u" && !N.style.cartoon.hidden && (N.style.cartoon.color === "spectrum" && typeof N.resi == "number" && !N.hetflag && (N.resi < R[0] && (R[0] = N.resi), N.resi > R[1] && (R[1] = N.resi)), g.push(N));
                  }
                }
                if (g.length > 0 && (0, d.drawCartoon)(p, g, R, this.defaultCartoonQuality), M && M.vertices > 0) {
                  M.initTypedArrays();
                  var W = null, B = null;
                  M.imposter ? W = new r.SphereImposterMaterial({
                    ambient: 0,
                    vertexColors: !0,
                    reflectivity: 0
                  }) : M.instanced ? (B = new r.Geometry(!0), c.GLDraw.drawSphere(B, { x: 0, y: 0, z: 0 }, 1, new h.Color(0.5, 0.5, 0.5)), B.initTypedArrays(), W = new r.InstancedMaterial({
                    sphereMaterial: new r.MeshLambertMaterial({
                      ambient: 0,
                      vertexColors: !0,
                      reflectivity: 0
                    }),
                    sphere: B
                  })) : W = new r.MeshLambertMaterial({
                    ambient: 0,
                    vertexColors: !0,
                    reflectivity: 0
                  }), O.sphere < 1 && O.sphere >= 0 && (W.transparent = !0, W.opacity = O.sphere), B = new r.Mesh(M, W), p.add(B);
                }
                if (E.vertices > 0) {
                  var P = null, G = null, H = E.sphereGeometry;
                  (!H || typeof H.vertices > "u" || H.vertices == 0) && (H = null), E.initTypedArrays(), H && H.initTypedArrays();
                  var U = { ambient: 0, vertexColors: !0, reflectivity: 0 };
                  E.imposter ? (P = new r.StickImposterMaterial(U), G = new r.SphereImposterMaterial(U)) : (P = new r.MeshLambertMaterial(U), G = new r.MeshLambertMaterial(U), P.wireframe && (E.setUpWireframe(), H && H.setUpWireframe())), O.stick < 1 && O.stick >= 0 && (P.transparent = !0, P.opacity = O.stick, G.transparent = !0, G.opacity = O.stick);
                  var j = new r.Mesh(E, P);
                  if (p.add(j), H) {
                    var re = new r.Mesh(H, G);
                    p.add(re);
                  }
                }
                var ie;
                for ($ in w)
                  if (w.hasOwnProperty($)) {
                    ie = $;
                    var te = new r.LineBasicMaterial({
                      linewidth: ie,
                      vertexColors: !0
                    });
                    O.line < 1 && O.line >= 0 && (te.transparent = !0, te.opacity = O.line), w[$].initTypedArrays();
                    var ue = new r.Line(w[$], te, r.LineStyle.LinePieces);
                    p.add(ue);
                  }
                for ($ in o)
                  if (o.hasOwnProperty($)) {
                    ie = $;
                    var de = new r.LineBasicMaterial({
                      linewidth: ie,
                      vertexColors: !0
                    });
                    O.cross < 1 && O.cross >= 0 && (de.transparent = !0, de.opacity = O.cross), o[$].initTypedArrays();
                    var oe = new r.Line(o[$], de, r.LineStyle.LinePieces);
                    p.add(oe);
                  }
                if (this.dontDuplicateAtoms && this.modelData.symmetries && this.modelData.symmetries.length > 0) {
                  var J = new r.Object3D(), Ee;
                  for (Ee = 0; Ee < this.modelData.symmetries.length; Ee++) {
                    var se = new r.Object3D();
                    se = p.clone(), se.matrix.copy(this.modelData.symmetries[Ee]), se.matrixAutoUpdate = !1, J.add(se);
                  }
                  return J;
                }
                return p;
              }
              /**
               * Return object representing internal state of
               * the model appropriate for passing to setInternalState
               *
              */
              getInternalState() {
                return {
                  atoms: this.atoms,
                  frames: this.frames
                };
              }
              /**
               * Overwrite the internal model state with the passed state.
               *
              */
              setInternalState(s) {
                this.atoms = s.atoms, this.frames = s.frames, this.molObj = null;
              }
              /**
               * Returns crystallographic information if present.
               *
               *
               */
              getCrystData() {
                if (this.modelData.cryst) {
                  if (!this.modelData.cryst.matrix) {
                    const s = this.modelData.cryst;
                    this.modelData.cryst.matrix = (0, l.conversionMatrix3)(s.a, s.b, s.c, s.alpha, s.beta, s.gamma);
                  }
                  return this.modelData.cryst;
                } else
                  return null;
              }
              /**
              	     * Set crystallographic information using three angles and three lengths
              	     *
              	     * @param {number} a - length of unit cell side
              	     * @param {number} b - length of unit cell side
              	     * @param {number} c - length of unit cell side
              	     * @param {number} alpha - unit cell angle in degrees (default 90)
              	     * @param {number} beta - unit cell angle in degrees (default 90)
              	     * @param {number} gamma - unit cell angle in degrees (default 90)
              
              	     */
              setCrystData(s, u, p, g, w, o) {
                s = s || 1, u = u || 1, p = p || 1, g = g || 90, w = w || 90, o = o || 90;
                const v = (0, l.conversionMatrix3)(s, u, p, g, w, o);
                this.modelData.cryst = {
                  a: s,
                  b: u,
                  c: p,
                  alpha: g,
                  beta: w,
                  gamma: o,
                  matrix: v
                };
              }
              /**
               * Set the crystallographic matrix to the given matrix.
               *
               * This function removes `a`, `b`, `c`, `alpha`, `beta`, `gamma` from
               * the crystal data.
               *
               * @param {Matrix3} matrix - unit cell matrix
               */
              setCrystMatrix(s) {
                s = s || new l.Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1), this.modelData.cryst = {
                  matrix: s
                };
              }
              /**
               * Returns list of rotational/translational matrices if there is BIOMT data
               * Otherwise returns a list of just the ID matrix
               *
               * @return {Array<Matrix4>}
               *
               */
              getSymmetries() {
                return typeof this.modelData.symmetries > "u" && (this.modelData.symmetries = [this.idMatrix]), this.modelData.symmetries;
              }
              /**
               * Sets symmetries based on specified matrices in list
               *
               * @param {Array<Matrix4>} list
               *
               */
              setSymmetries(s) {
                typeof s > "u" ? this.modelData.symmetries = [this.idMatrix] : this.modelData.symmetries = s;
              }
              /**
               * Returns model id number
               *
               * @return {number} Model ID
               */
              getID() {
                return this.id;
              }
              /**
               * Returns model's frames property, a list of atom lists
               *
               * @return {number}
               */
              getNumFrames() {
                return this.frames.numFrames != null ? this.frames.numFrames : this.frames.length;
              }
              adjustCoord(s, u, p, g) {
                var w = u - s;
                return w < -p ? u + g : w > p ? u - g : u;
              }
              //go over current atoms in depth first order and ensure that connected
              //attoms aren't split across the box
              adjustCoordinatesToBox() {
                if (this.box && this.atomdfs)
                  for (var s = this.box[0], u = this.box[1], p = this.box[2], g = s * 0.9, w = u * 0.9, o = p * 0.9, v = 0; v < this.atomdfs.length; v++)
                    for (var M = this.atomdfs[v], E = 1; E < M.length; E++) {
                      var $ = this.atoms[M[E][0]], k = this.atoms[M[E][1]];
                      $.x = this.adjustCoord(k.x, $.x, g, s), $.y = this.adjustCoord(k.y, $.y, w, u), $.z = this.adjustCoord(k.z, $.z, o, p);
                    }
              }
              /**
               * Sets model's atomlist to specified frame
               * Sets to last frame if framenum out of range
               *
               * @param {number} framenum - model's atoms are set to this index in frames list
               * @return {Promise}
               */
              setFrame(s, u) {
                var p = this.getNumFrames();
                let g = this;
                return new Promise(function(w, o) {
                  if (p == 0 && w(), (s < 0 || s >= p) && (s = p - 1), g.frames.url != null) {
                    var v = g.frames.url;
                    (0, _.getbin)(v + "/traj/frame/" + s + "/" + g.frames.path, void 0, "POST", void 0).then(function(M) {
                      for (var E = new Float32Array(M, 44), $ = 0, k = 0; k < g.atoms.length; k++)
                        g.atoms[k].x = E[$++], g.atoms[k].y = E[$++], g.atoms[k].z = E[$++];
                      g.box && g.atomdfs && g.adjustCoordinatesToBox(), w();
                    }).catch(o);
                  } else
                    g.atoms = g.frames[s], w();
                  g.molObj = null, g.modelDatas && s < g.modelDatas.length && (g.modelData = g.modelDatas[s], g.unitCellObjects && u && (u.removeUnitCell(g), u.addUnitCell(g)));
                });
              }
              /**
               * Add atoms as frames of model
               *
               * @param {AtomSpec[]} atoms - atoms to be added
               */
              addFrame(s) {
                this.frames.push(s);
              }
              /**
              	     * If model atoms have dx, dy, dz properties (in some xyz files), vibrate populates the model's frame property based on parameters.
              	     * Model can then be animated
              	     *
              	     * @param {number} numFrames - number of frames to be created, default to 10
              	     * @param {number} amplitude - amplitude of distortion, default to 1 (full)
              	     * @param {boolean} bothWays - if true, extend both in positive and negative directions by numFrames
              	     * @param {GLViewer} viewer - required if arrowSpec is provided
              	     * @param {ArrowSpec} arrowSpec - specification for drawing animated arrows. If color isn't specified, atom color (sphere, stick, line preference) is used.
              	     *@example
              
              	      $3Dmol.download("pdb:4UAA",viewer,{},function(){
              	        viewer.setStyle({},{stick:{}});
              	        viewer.vibrate(10, 1);
              	        viewer.animate({loop: "forward",reps: 1});
              
              	        viewer.zoomTo();
              	              viewer.render();
              	          });
              	     */
              vibrate(s = 10, u = 1, p = !1, g, w) {
                var o = 0, v = s;
                p && (o = -s, v = s), this.frames !== void 0 && this.frames.origIndex !== void 0 ? this.setFrame(this.frames.origIndex) : this.setFrame(0), o < v && (this.frames = []), p && (this.frames.origIndex = s);
                for (var M = o; M < v; M++) {
                  var E = [], $ = this.frames.length;
                  if (M == 0 && !w) {
                    this.frames.push(this.atoms);
                    continue;
                  }
                  for (var k = 0; k < this.atoms.length; k++) {
                    var L = (0, _.getAtomProperty)(this.atoms[k], "dx"), z = (0, _.getAtomProperty)(this.atoms[k], "dy"), O = (0, _.getAtomProperty)(this.atoms[k], "dz"), R = new l.Vector3(L, z, O), N = new l.Vector3(this.atoms[k].x, this.atoms[k].y, this.atoms[k].z), W = M * u / s;
                    R.multiplyScalar(W), N.add(R);
                    var B = {};
                    for (var P in this.atoms[k])
                      B[P] = this.atoms[k][P];
                    if (B.x = N.x, B.y = N.y, B.z = N.z, E.push(B), g && w) {
                      var G = (0, _.extend)({}, w), H = new l.Vector3(L, z, O);
                      if (H.multiplyScalar(u), H.add(N), G.start = N, G.end = H, G.frame = $, !G.color) {
                        var U = B.style.sphere;
                        U || (U = B.style.stick), U || (U = B.style.line), G.color = (0, _.getColorFromStyle)(B, U);
                      }
                      g.addArrow(G);
                    }
                  }
                  this.frames.push(E);
                }
              }
              // set default style and colors for atoms
              setAtomDefaults(s) {
                for (let u = 0; u < s.length; u++) {
                  let p = s[u];
                  p && (p.style = p.style || (0, _.deepCopy)(A.defaultAtomStyle), p.color = p.color || this.ElementColors[p.elem] || this.defaultColor, p.model = this.id, (p.clickable || p.hoverable) && (p.intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }));
                }
              }
              /** add atoms to this model from molecular data string
               *
               * @param {string|ArrayBuffer} data - atom structure file input data string, for gzipped input use ArrayBuffer
               * @param {string} format - input file string format (e.g 'pdb', 'sdf', 'sdf.gz', etc.)
               * @param {ParserOptionsSpec} options - format dependent options. Attributes depend on the input format
               */
              addMolData(s, u, p = {}) {
                var g = A.parseMolData(s, u, p);
                this.dontDuplicateAtoms = !p.duplicateAssemblyAtoms;
                var w = g.modelData;
                if (w && (Array.isArray(w) ? (this.modelData = w[0], p.frames && (this.modelDatas = w)) : this.modelData = w), g.box ? this.box = g.box : this.box = null, this.frames.length == 0) {
                  for (let v = 0; v < g.length; v++)
                    g[v].length != 0 && this.frames.push(g[v]);
                  this.frames[0] && (this.atoms = this.frames[0]);
                } else if (p.frames)
                  for (let v = 0; v < g.length; v++)
                    this.frames.push(g[v]);
                else
                  for (var o = 0; o < g.length; o++)
                    this.addAtoms(g[o]);
                for (let v = 0; v < this.frames.length; v++)
                  this.setAtomDefaults(this.frames[v]);
                p.vibrate && p.vibrate.frames && p.vibrate.amplitude && this.vibrate(p.vibrate.frames, p.vibrate.amplitude), p.style && this.setStyle({}, p.style);
              }
              setDontDuplicateAtoms(s) {
                this.dontDuplicateAtoms = s;
              }
              setModelData(s) {
                this.modelData = s;
              }
              //return true if atom value matches property val
              propertyMatches(s, u) {
                if (s == u)
                  return !0;
                if (typeof u == "string" && typeof s == "number") {
                  var p = u.match(/(-?\d+)\s*-\s*(-?\d+)/);
                  if (p) {
                    var g = parseInt(p[1]), w = parseInt(p[2]);
                    if (p && s >= g && s <= w)
                      return !0;
                  }
                }
                return !1;
              }
              // make a deep copy of a selection object and create caches of expensive
              // selections.  We create a copy so caches are not attached to user
              // supplied objects where the user might change them invalidating the cache.
              // This does not support arbitrary
              // javascript objects, but support enough for eveything that is
              // used in selections: number, string, boolean, functions; as well
              // as arrays and nested objects with values of the aformentioned
              // types.
              static deepCopyAndCache(s, u) {
                if (typeof s != "object" || s == null || s.__cache_created)
                  return s;
                const p = {};
                for (const g in s) {
                  const w = s[g];
                  if (Array.isArray(w)) {
                    p[g] = [];
                    for (let o = 0; o < w.length; o++)
                      p[g].push(A.deepCopyAndCache(w[o], u));
                  } else typeof w == "object" && g != "properties" && g != "model" ? p[g] = A.deepCopyAndCache(w, u) : p[g] = w;
                  if (g == "and" || g == "or") {
                    const o = [];
                    for (const v of p[g]) {
                      const M = /* @__PURE__ */ new Set();
                      for (const E of u.selectedAtoms(v))
                        M.add(E.index);
                      o.push(M);
                    }
                    if (g == "and") {
                      const v = function(E, $) {
                        const k = /* @__PURE__ */ new Set();
                        for (const L of $)
                          E.has(L) && k.add(L);
                        return k;
                      };
                      let M = new Set(o[0]);
                      for (const E of o.splice(1))
                        M = v(M, E);
                      p[g].__cached_results = M;
                    } else if (g == "or") {
                      const v = /* @__PURE__ */ new Set();
                      for (const M of o)
                        for (const E of M)
                          v.add(E);
                      p[g].__cached_results = v;
                    }
                  }
                }
                return p.__cache_created = !0, p;
              }
              /** given a selection specification, return true if atom is selected.
               * Does not support context-aware selectors like expand/within/byres.
               *
               * @param {AtomSpec} atom
               * @param {AtomSelectionSpec} sel
               * @return {boolean}
               */
              atomIsSelected(s, u) {
                if (typeof u > "u")
                  return !0;
                var p = !!u.invert, g = !0;
                for (var w in u)
                  if (w == "and" || w == "or" || w == "not") {
                    if (w == "not") {
                      if (this.atomIsSelected(s, u[w])) {
                        g = !1;
                        break;
                      }
                    } else if (u[w].__cached_results === void 0 && (u = A.deepCopyAndCache(u, this)), g = u[w].__cached_results.has(s.index), !g)
                      break;
                  } else if (w === "predicate") {
                    if (!u.predicate(s)) {
                      g = !1;
                      break;
                    }
                  } else if (w == "properties" && s[w]) {
                    for (var o in u.properties)
                      if (!o.startsWith("__cache")) {
                        if (typeof s.properties[o] > "u") {
                          g = !1;
                          break;
                        }
                        if (s.properties[o] != u.properties[o]) {
                          g = !1;
                          break;
                        }
                      }
                  } else if (u.hasOwnProperty(w) && !A.ignoredKeys.has(w) && !w.startsWith("__cache")) {
                    if (typeof s[w] > "u") {
                      g = !1;
                      break;
                    }
                    var v = !1;
                    if (w === "bonds") {
                      var M = u[w];
                      if (M != s.bonds.length) {
                        g = !1;
                        break;
                      }
                    } else if (Array.isArray(u[w])) {
                      var E = u[w], $ = s[w];
                      for (let k = 0; k < E.length; k++)
                        if (this.propertyMatches($, E[k])) {
                          v = !0;
                          break;
                        }
                      if (!v) {
                        g = !1;
                        break;
                      }
                    } else {
                      let k = u[w];
                      if (!this.propertyMatches(s[w], k)) {
                        g = !1;
                        break;
                      }
                    }
                  }
                return p ? !g : g;
              }
              static squaredDistance(s, u) {
                var p = u.x - s.x, g = u.y - s.y, w = u.z - s.z;
                return p * p + g * g + w * w;
              }
              /** returns a list of atoms in the expanded bounding box, but not in the current one
               *
               *  Bounding box:
               *
               *    [ [ xmin, ymin, zmin ],
               *      [ xmax, ymax, zmax ],
               *      [ xctr, yctr, zctr ] ]
               *
               **/
              expandAtomList(s, u) {
                if (u <= 0)
                  return s;
                for (var p = (0, _.getExtent)(s, void 0), g = [[], [], []], w = 0; w < 3; w++)
                  g[0][w] = p[0][w] - u, g[1][w] = p[1][w] + u, g[2][w] = p[2][w];
                var o = [];
                for (let $ = 0; $ < this.atoms.length; $++) {
                  var v = this.atoms[$].x, M = this.atoms[$].y, E = this.atoms[$].z;
                  v >= g[0][0] && v <= g[1][0] && M >= g[0][1] && M <= g[1][1] && E >= g[0][2] && E <= g[1][2] && (v >= p[0][0] && v <= p[1][0] && M >= p[0][1] && M <= p[1][1] && E >= p[0][2] && E <= p[1][2] || o.push(this.atoms[$]));
                }
                return o;
              }
              static getFloat(s) {
                return typeof s == "number" ? s : parseFloat(s);
              }
              /** return list of atoms selected by sel, this is specific to glmodel
               *
               * @param {AtomSelectionSpec} sel
               * @return {Object[]}
               * @example
               $3Dmol.download("pdb:4wwy",viewer,{},function(){
                        var atoms = viewer.selectedAtoms({chain:'A'});
                        for(var i = 0, n = atoms.length; i < n; i++) {
                           atoms[i].b = 0.0;
                        }
                        viewer.setStyle({cartoon:{colorscheme:{prop:'b',gradient: 'roygb',min:0,max:30}}});
                        viewer.render();
                    });
               */
              selectedAtoms(s, u) {
                var p = [];
                s = A.deepCopyAndCache(s || {}, this), u || (u = this.atoms);
                for (var g = u.length, w = 0; w < g; w++) {
                  var o = u[w];
                  o && this.atomIsSelected(o, s) && p.push(o);
                }
                if (s.hasOwnProperty("expand")) {
                  const B = A.getFloat(s.expand);
                  let P = this.expandAtomList(p, B), G = p.length;
                  const H = B * B;
                  for (let U = 0; U < P.length; U++)
                    for (let j = 0; j < G; j++) {
                      var v = A.squaredDistance(P[U], p[j]);
                      v < H && v > 0 && p.push(P[U]);
                    }
                }
                if (s.hasOwnProperty("within") && s.within.hasOwnProperty("sel") && s.within.hasOwnProperty("distance")) {
                  var M = this.selectedAtoms(s.within.sel, this.atoms), E = {};
                  const B = A.getFloat(s.within.distance), P = B * B;
                  for (let G = 0; G < M.length; G++)
                    for (let H = 0; H < p.length; H++) {
                      let U = A.squaredDistance(M[G], p[H]);
                      U < P && U > 0 && (E[H] = 1);
                    }
                  var $ = [];
                  if (s.within.invert)
                    for (let G = 0; G < p.length; G++)
                      E[G] || $.push(p[G]);
                  else
                    for (let G in E)
                      $.push(p[G]);
                  p = $;
                }
                if (s.hasOwnProperty("byres")) {
                  var k = {}, L = [], z = [];
                  for (let B = 0; B < p.length; B++) {
                    let P = p[B];
                    var O = P.chain, R = P.resi;
                    if (k[O] === void 0 && (k[O] = {}), P.hasOwnProperty("resi") && k[O][R] === void 0) {
                      for (k[O][R] = !0, z.push(P); z.length > 0; )
                        if (P = z.pop(), O = P.chain, R = P.resi, L[P.index] === void 0) {
                          L[P.index] = !0;
                          for (var N = 0; N < P.bonds.length; N++) {
                            var W = this.atoms[P.bonds[N]];
                            L[W.index] === void 0 && W.hasOwnProperty("resi") && W.chain == O && W.resi == R && (z.push(W), p.push(W));
                          }
                        }
                    }
                  }
                }
                return p;
              }
              /** Add list of new atoms to model.  Adjusts bonds appropriately.
              	     *
              	     * @param {AtomSpec[]} newatoms
              	     * @example
              	     * var atoms = [{elem: 'C', x: 0, y: 0, z: 0, bonds: [1,2], bondOrder: [1,2]}, {elem: 'O', x: -1.5, y: 0, z: 0, bonds: [0]},{elem: 'O', x: 1.5, y: 0, z: 0, bonds: [0], bondOrder: [2]}];
              
              	        viewer.setBackgroundColor(0xffffffff);
              	        var m = viewer.addModel();
              	        m.addAtoms(atoms);
              	        m.setStyle({},{stick:{}});
              	        viewer.zoomTo();
              	        viewer.render();
              	     */
              addAtoms(s) {
                this.molObj = null;
                var u = this.atoms.length, p = [], g;
                for (g = 0; g < s.length; g++)
                  typeof s[g].index > "u" && (s[g].index = g), typeof s[g].serial > "u" && (s[g].serial = g), p[s[g].index] = u + g;
                for (g = 0; g < s.length; g++) {
                  var w = s[g], o = p[w.index], v = (0, _.extend)({}, w);
                  v.index = o, v.bonds = [], v.bondOrder = [], v.model = this.id, v.style = v.style || (0, _.deepCopy)(A.defaultAtomStyle), typeof v.color > "u" && (v.color = this.ElementColors[v.elem] || this.defaultColor);
                  for (var M = w.bonds ? w.bonds.length : 0, E = 0; E < M; E++) {
                    var $ = p[w.bonds[E]];
                    typeof $ < "u" && (v.bonds.push($), v.bondOrder.push(w.bondOrder ? w.bondOrder[E] : 1));
                  }
                  this.atoms.push(v);
                }
              }
              /** Assign bonds based on atomic coordinates.
               *  This currently uses a primitive distance-based algorithm that does not
               * consider valence constraints and will only create single bonds.
               */
              assignBonds() {
                (0, b.assignBonds)(this.atoms, { assignBonds: !0 });
              }
              /** Remove specified atoms from model
               *
               * @param {AtomSpec[]} badatoms - list of atoms
               */
              removeAtoms(s) {
                this.molObj = null;
                var u = [], p;
                for (p = 0; p < s.length; p++)
                  u[s[p].index] = !0;
                var g = [];
                for (p = 0; p < this.atoms.length; p++) {
                  var w = this.atoms[p];
                  u[w.index] || g.push(w);
                }
                this.atoms = [], this.addAtoms(g);
              }
              /** Set atom style of selected atoms
              	     *
              	     * @param {AtomSelectionSpec} sel
              	     * @param {AtomStyleSpec} style
              	     * @param {boolean} add - if true, add to current style, don't replace
              	     @example
              	    $3Dmol.download("pdb:4UB9",viewer,{},function(){
              	              viewer.setBackgroundColor(0xffffffff);
              
              	              viewer.setStyle({chain:'A'},{line:{hidden:true,colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.Sinebow($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.setStyle({chain:'B'},{line:{colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.Sinebow($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.setStyle({chain:'C'},{cross:{hidden:true,colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.Sinebow($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.setStyle({chain:'D'},{cross:{colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.RWB($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.setStyle({chain:'E'},{cross:{radius:2.0,colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.RWB($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.setStyle({chain:'F'},{stick:{hidden:true,colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.RWB($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.setStyle({chain:'G'},{stick:{radius:0.8,colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.ROYGB($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.setStyle({chain:'H'},{stick:{singleBonds:true,colorscheme:{prop:'b',gradient: new $3Dmol.Gradient.ROYGB($3Dmol.getPropertyRange(viewer.selectedAtoms(),'b'))}}});
              	              viewer.render();
              	          });
              	     */
              setStyle(s, u, p) {
                typeof u > "u" && typeof p > "u" && (u = s, s = {}), s = s, typeof u == "string" && (u = (0, _.specStringToObject)(u));
                var g = !1, w = this, o = function(M) {
                  var E = w.selectedAtoms(s, M);
                  for (let $ = 0; $ < M.length; $++)
                    M[$] && (M[$].capDrawn = !1);
                  for (let $ = 0; $ < E.length; $++) {
                    g = !0, (E[$].clickable || E[$].hoverable) && (E[$].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }), p || (E[$].style = {});
                    for (let k in u)
                      u.hasOwnProperty(k) && (E[$].style[k] = E[$].style[k] || {}, Object.assign(E[$].style[k], u[k]));
                  }
                };
                if (s.frame !== void 0 && s.frame < this.frames.length) {
                  let M = s.frame;
                  M < 0 && (M = this.frames.length + M), o(this.frames[M]);
                } else {
                  o(this.atoms);
                  for (var v = 0; v < this.frames.length; v++)
                    this.frames[v] !== this.atoms && o(this.frames[v]);
                }
                g && (this.molObj = null);
              }
              /** Set clickable and callback of selected atoms
              	     *
              	     * @param {AtomSelectionSpec} sel - atom selection to apply clickable settings to
              	     * @param {boolean} clickable - whether click-handling is enabled for the selection
              	     * @param {function} callback - function called when an atom in the selection is clicked
              
              	     */
              setClickable(s, u, p) {
                if (u = !!u, p = (0, _.makeFunction)(p), p === null) {
                  console.log("Callback is not a function");
                  return;
                }
                var g = this.selectedAtoms(s, this.atoms), w = g.length;
                for (let o = 0; o < w; o++)
                  g[o].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, g[o].clickable = u, p && (g[o].callback = p);
                w > 0 && (this.molObj = null);
              }
              /** Set hoverable and callback of selected atoms
              *
              * @param {AtomSelectionSpec} sel - atom selection to apply hoverable settings to
              * @param {boolean} hoverable - whether hover-handling is enabled for the selection
              * @param {function} hover_callback - function called when an atom in the selection is hovered over
              * @param {function} unhover_callback - function called when the mouse moves out of the hover area
              */
              setHoverable(s, u, p, g) {
                if (u = !!u, p = (0, _.makeFunction)(p), g = (0, _.makeFunction)(g), p === null) {
                  console.log("Hover_callback is not a function");
                  return;
                }
                if (g === null) {
                  console.log("Unhover_callback is not a function");
                  return;
                }
                var w = this.selectedAtoms(s, this.atoms), o = w.length;
                for (let v = 0; v < o; v++)
                  w[v].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, w[v].hoverable = u, p && (w[v].hover_callback = p), g && (w[v].unhover_callback = g);
                o > 0 && (this.molObj = null);
              }
              /** enable context menu of selected atoms
               *
               * @param {AtomSelectionSpec} sel - atom selection to apply hoverable settings to
               * @param {boolean} contextMenuEnabled - whether contextMenu-handling is enabled for the selection
               */
              enableContextMenu(s, u) {
                u = !!u;
                var p, g = this.selectedAtoms(s, this.atoms), w = g.length;
                for (p = 0; p < w; p++)
                  g[p].intersectionShape = { sphere: [], cylinder: [], line: [], triangle: [] }, g[p].contextMenuEnabled = u;
                w > 0 && (this.molObj = null);
              }
              /** given a mapping from element to color, set atom colors
               *
               * @param {AtomSelectionSpec} sel
               * @param {object} colors
               */
              setColorByElement(s, u) {
                if (!(this.molObj !== null && A.sameObj(u, this.lastColors))) {
                  this.lastColors = u;
                  var p = this.selectedAtoms(s, p);
                  p.length > 0 && (this.molObj = null);
                  for (var g = 0; g < p.length; g++) {
                    var w = p[g];
                    typeof u[w.elem] < "u" && (w.color = u[w.elem]);
                  }
                }
              }
              /**
               * @param {AtomSelectionSpec} sel
               * @param {string} prop
               * @param {Gradient|string} scheme
               */
              setColorByProperty(s, u, p, g) {
                var w, o, v = this.selectedAtoms(s, v);
                for (this.lastColors = null, v.length > 0 && (this.molObj = null), typeof p == "string" && typeof m.Gradient.builtinGradients[p] < "u" && (p = new m.Gradient.builtinGradients[p]()), p = p, g || (g = p.range()), g || (g = (0, _.getPropertyRange)(v, u)), w = 0; w < v.length; w++) {
                  o = v[w];
                  var M = (0, _.getAtomProperty)(o, u);
                  M != null && (o.color = p.valueToHex(parseFloat(o.properties[u]), g));
                }
              }
              /**
              	     * @deprecated use setStyle and colorfunc attribute
              	     * @param {AtomSelectionSpec} sel - selection object
              	     * @param {function} func - function to be used to set the color
              	     @example
              	      $3Dmol.download("pdb:4UAA",viewer,{},function(){
              	              viewer.setBackgroundColor(0xffffffff);
              	              var colorAsSnake = function(atom) {
              	                return atom.resi % 2 ? 'white': 'green'
              	              };
              
              	              viewer.setStyle( {}, { cartoon: {colorfunc: colorAsSnake }});
              
              	              viewer.render();
              	          });
              
              	     */
              setColorByFunction(s, u) {
                var p = this.selectedAtoms(s, p);
                if (typeof u == "function") {
                  this.lastColors = null, p.length > 0 && (this.molObj = null);
                  for (let g = 0; g < p.length; g++) {
                    let w = p[g];
                    w.color = u(w);
                  }
                }
              }
              /** Convert the model into an object in the format of a ChemDoodle JSON model.
               *
               * @param {boolean} whether or not to include style information. Defaults to false.
               * @return {Object}
               */
              toCDObject(s = !1) {
                var u = { a: [], b: [] };
                s && (u.s = []);
                for (let g = 0; g < this.atoms.length; g++) {
                  let w = {}, o = this.atoms[g];
                  if (w.x = o.x, w.y = o.y, w.z = o.z, o.elem != "C" && (w.l = o.elem), s) {
                    for (var p = 0; p < u.s.length && JSON.stringify(o.style) !== JSON.stringify(u.s[p]); )
                      p++;
                    p === u.s.length && u.s.push(o.style), p !== 0 && (w.s = p);
                  }
                  u.a.push(w);
                  for (let v = 0; v < o.bonds.length; v++) {
                    let M = g, E = o.bonds[v];
                    if (M >= E)
                      continue;
                    let $ = {
                      b: M,
                      e: E
                    }, k = o.bondOrder[v];
                    k != 1 && ($.o = k), u.b.push($);
                  }
                }
                return u;
              }
              /** manage the globj for this model in the possed modelGroup - if it has to be regenerated, remove and add
               *
               * @param {Object3D} group
               * @param Object options
               */
              globj(s, u) {
                (this.molObj === null || u.regen) && (this.molObj = this.createMolObj(this.atoms, u), this.renderedMolObj && (s.remove(this.renderedMolObj), this.renderedMolObj = null), this.renderedMolObj = this.molObj.clone(), this.hidden && (this.renderedMolObj.setVisible(!1), this.molObj.setVisible(!1)), s.add(this.renderedMolObj));
              }
              /** return a VRML string representation of the model.  Does not include VRML header information
               * @return VRML
               */
              exportVRML() {
                var s = this.createMolObj(this.atoms, { supportsImposters: !1, supportsAIA: !1 });
                return s.vrml();
              }
              /** Remove any renderable mol object from scene
               *
               * @param {Object3D} group
               */
              removegl(s) {
                this.renderedMolObj && (this.renderedMolObj.geometry !== void 0 && this.renderedMolObj.geometry.dispose(), this.renderedMolObj.material !== void 0 && this.renderedMolObj.material.dispose(), s.remove(this.renderedMolObj), this.renderedMolObj = null), this.molObj = null;
              }
              /**
              	     * Don't show this model in future renderings. Keep all styles and state
              	     * so it can be efficiencly shown again.
              	     *
              	     * * @see GLModel#show
              
              	     * @example
              	        $3Dmol.download("pdb:3ucr",viewer,{},function(){
              	        viewer.setStyle({},{stick:{}});
              	        viewer.getModel().hide();
              	        viewer.render();
              	        });
              	     */
              hide() {
                this.hidden = !0, this.renderedMolObj && this.renderedMolObj.setVisible(!1), this.molObj && this.molObj.setVisible(!1);
              }
              /**
               * Unhide a hidden model
               * @see GLModel#hide
               * @example
                  $3Dmol.download("pdb:3ucr",viewer,{},function(){
                  viewer.setStyle({},{stick:{}});
                  viewer.getModel().hide();
                  viewer.render(  )
                  viewer.getModel().show()
                  viewer.render();
                  });
               */
              show() {
                this.hidden = !1, this.renderedMolObj && this.renderedMolObj.setVisible(!0), this.molObj && this.molObj.setVisible(!0);
              }
              /** Create labels for atoms that show the value of the passed property.
               *
               * @param {String} prop - property name
               * @param {AtomSelectionSpec} sel
               * @param {GLViewer} viewer
               * @param {LabelSpec} options
               */
              addPropertyLabels(s, u, p, g) {
                for (var w = this.selectedAtoms(u, w), o = (0, _.deepCopy)(g), v = 0; v < w.length; v++) {
                  var M = w[v], E = null;
                  typeof M[s] < "u" ? E = String(M[s]) : typeof M.properties[s] < "u" && (E = String(M.properties[s])), E != null && (o.position = M, p.addLabel(E, o));
                }
              }
              /** Create labels for residues of selected atoms.
               * Will create a single label at the center of mass of all atoms
               * with the same chain,resn, and resi.
               *
               * @param {AtomSelectionSpec} sel
               * @param {GLViewer} viewer
               * @param {LabelSpec} options
               * @param {boolean} byframe - if true, create labels for every individual frame, not just current; frames must be loaded already
               */
              addResLabels(s, u, p, g = !1) {
                var w = [], o = function(M, E) {
                  for (var $ = M.selectedAtoms(s, $), k = {}, L = 0; L < $.length; L++) {
                    var z = $[L], O = z.chain, R = z.resn, N = z.resi, W = R + "" + N;
                    k[O] || (k[O] = {}), k[O][W] || (k[O][W] = []), k[O][W].push(z);
                  }
                  var B = (0, _.deepCopy)(p);
                  for (let G in k)
                    if (k.hasOwnProperty(G)) {
                      var P = k[G];
                      for (let H in P)
                        if (P.hasOwnProperty(H)) {
                          let U = P[H], j = new l.Vector3(0, 0, 0);
                          for (let ie = 0; ie < U.length; ie++) {
                            let te = U[ie];
                            j.x += te.x, j.y += te.y, j.z += te.z;
                          }
                          j.divideScalar(U.length), B.position = j, B.frame = E;
                          let re = u.addLabel(H, B, void 0, !0);
                          w.push(re);
                        }
                    }
                };
                if (g) {
                  var v = this.getNumFrames();
                  let M = this.atoms;
                  for (let E = 0; E < v; E++)
                    this.frames[E] && (this.atoms = this.frames[E], o(this, E));
                  this.atoms = M;
                } else
                  o(this);
                return w;
              }
              //recurse over the current atoms to establish a depth first order
              setupDFS() {
                this.atomdfs = [];
                var s = this, u = new Int8Array(this.atoms.length);
                u.fill(0);
                for (var p = function(v, M, E) {
                  E.push([v, M]);
                  var $ = s.atoms[v];
                  u[v] = 1;
                  for (var k = 0; k < $.bonds.length; k++) {
                    var L = $.bonds[k];
                    s.atoms[L] && !u[L] && p(L, v, E);
                  }
                }, g = 0; g < this.atoms.length; g++) {
                  var w = this.atoms[g];
                  if (w && !u[g]) {
                    var o = [];
                    p(g, -1, o), this.atomdfs.push(o);
                  }
                }
              }
              /**
              * Set coordinates from remote trajectory file.
              * @param {string} url - contains the url where mdsrv has been hosted
              * @param {string} path - contains the path of the file (<root>/filename)
              * @return {Promise}
              */
              setCoordinatesFromURL(s, u) {
                this.frames = [];
                var p = this;
                return this.box && this.setupDFS(), s.startsWith("http") || (s = "http://" + s), (0, _.get)(s + "/traj/numframes/" + u, function(g) {
                  if (!isNaN(parseInt(g)))
                    return p.frames.push(p.atoms), p.frames.numFrames = g, p.frames.url = s, p.frames.path = u, p.setFrame(0);
                });
              }
              /**
              * Set coordinates for the atoms from provided trajectory file.
              * @param {string|ArrayBuffer} str - contains the data of the file
              * @param {string} format - contains the format of the file (mdcrd, inpcrd, pdb, netcdf, or array).  Arrays should be TxNx3 where T is the number of timesteps and N the number of atoms.
                @example
                   let m = viewer.addModel()  //create an empty model
                   m.addAtoms([{x:0,y:0,z:0,elem:'C'},{x:2,y:0,z:0,elem:'C'}]) //provide a list of dictionaries representing the atoms
                   viewer.setStyle({'sphere':{}})
                   m.setCoordinates([[[0.0, 0.0, 0.0], [2.0, 0.0, 0.0]], [[0.0, 0.0, 0.0], [2.8888888359069824, 0.0, 0.0]], [[0.0, 0.0, 0.0], [3.777777671813965, 0.0, 0.0]], [[0.0, 0.0, 0.0], [4.666666507720947, 0.0, 0.0]], [[0.0, 0.0, 0.0], [5.55555534362793, 0.0, 0.0]], [[0.0, 0.0, 0.0], [6.44444465637207, 0.0, 0.0]], [[0.0, 0.0, 0.0], [7.333333492279053, 0.0, 0.0]], [[0.0, 0.0, 0.0], [8.222222328186035, 0.0, 0.0]], [[0.0, 0.0, 0.0], [9.11111068725586, 0.0, 0.0]], [[0.0, 0.0, 0.0], [10.0, 0.0, 0.0]]],'array');
                   viewer.animate({loop: "forward",reps: 1});
                   viewer.zoomTo();
                   viewer.zoom(0.5);
                   viewer.render();
              */
              setCoordinates(s, u) {
                if (u = u || "", !s)
                  return [];
                if (/\.gz$/.test(u)) {
                  u = u.replace(/\.gz$/, "");
                  try {
                    s = (0, _.inflateString)(s);
                  } catch (k) {
                    console.log(k);
                  }
                }
                var p = { mdcrd: "", inpcrd: "", pdb: "", netcdf: "", array: "" };
                if (p.hasOwnProperty(u)) {
                  this.frames = [];
                  for (var g = this.atoms.length, w = A.parseCrd(s, u), o = 0; o < w.length; ) {
                    for (var v = [], M = 0; M < g; M++) {
                      var E = {};
                      for (var $ in this.atoms[M])
                        E[$] = this.atoms[M][$];
                      v[M] = E, v[M].x = w[o++], v[M].y = w[o++], v[M].z = w[o++];
                    }
                    this.frames.push(v);
                  }
                  return this.atoms = this.frames[0], this.frames;
                }
                return [];
              }
              /**
               * add atomSpecs to validAtomSelectionSpecs
               * @deprecated
               * @param {Array} customAtomSpecs - array of strings that can be used as atomSelectionSpecs
               * this is to prevent the 'Unknown Selector x' message on the console for the strings passed.
               * These messages are no longer generated as, in theory, typescript will catch problems at compile time.
               * In practice, there may still be issues at run-time but we don't check for them...
               *
               * What we should do is use something like https://github.com/woutervh-/typescript-is to do runtime
               * type checking, but it currently doesn't work with our types...
               */
              addAtomSpecs(s) {
              }
              static parseCrd(s, u) {
                var p = [], g = 0;
                if (u == "pdb")
                  for (var w = s.indexOf(`
ATOM`); w != -1; ) {
                    for (; s.slice(w, w + 5) == `
ATOM` || s.slice(w, w + 7) == `
HETATM`; )
                      p[g++] = parseFloat(s.slice(w + 31, w + 39)), p[g++] = parseFloat(s.slice(w + 39, w + 47)), p[g++] = parseFloat(s.slice(w + 47, w + 55)), w = s.indexOf(`
`, w + 54), s.slice(w, w + 4) == `
TER` && (w = s.indexOf(`
`, w + 5));
                    w = s.indexOf(`
ATOM`, w);
                  }
                else if (u == "netcdf") {
                  var o = new x.NetCDFReader(s);
                  p = [].concat.apply([], o.getDataVariable("coordinates"));
                } else {
                  if (u == "array" || Array.isArray(s))
                    return s.flat(2);
                  {
                    let v = s.indexOf(`
`);
                    u == "inpcrd" && (v = s.indexOf(`
`, v + 1)), s = s.slice(v + 1), p = s.match(/\S+/g).map(parseFloat);
                  }
                }
                return p;
              }
              static parseMolData(s, u = "", p) {
                if (!s)
                  return [];
                if (/\.gz$/.test(u)) {
                  u = u.replace(/\.gz$/, "");
                  try {
                    u.match(/bcif/i) ? s = (0, _.inflateString)(s, !1) : s = (0, _.inflateString)(s);
                  } catch (o) {
                    console.log(o);
                  }
                }
                typeof y.Parsers[u] > "u" && (u = u.split(".").pop(), typeof y.Parsers[u] > "u" && (console.log("Unknown format: " + u), s instanceof Uint8Array ? u = "bcif" : s.match(/^@<TRIPOS>MOLECULE/gm) ? u = "mol2" : s.match(/^data_/gm) && s.match(/^loop_/gm) ? u = "cif" : s.match(/^HETATM/gm) || s.match(/^ATOM/gm) ? u = "pdb" : s.match(/ITEM: TIMESTEP/gm) ? u = "lammpstrj" : s.match(/^.*\n.*\n.\s*(\d+)\s+(\d+)/gm) ? u = "sdf" : s.match(/^%VERSION\s+VERSION_STAMP/gm) ? u = "prmtop" : u = "xyz", console.log("Best guess: " + u)));
                var g = y.Parsers[u], w = g(s, p);
                return w;
              }
            }
            A.defaultAtomStyle = {
              line: {}
            }, A.defaultlineWidth = 1, A.vdwRadii = {
              H: 1.2,
              He: 1.4,
              Li: 1.82,
              Be: 1.53,
              B: 1.92,
              C: 1.7,
              N: 1.55,
              O: 1.52,
              F: 1.47,
              Ne: 1.54,
              Na: 2.27,
              Mg: 1.73,
              Al: 1.84,
              Si: 2.1,
              P: 1.8,
              S: 1.8,
              Cl: 1.75,
              Ar: 1.88,
              K: 2.75,
              Ca: 2.31,
              Ni: 1.63,
              Cu: 1.4,
              Zn: 1.39,
              Ga: 1.87,
              Ge: 2.11,
              As: 1.85,
              Se: 1.9,
              Br: 1.85,
              Kr: 2.02,
              Rb: 3.03,
              Sr: 2.49,
              Pd: 1.63,
              Ag: 1.72,
              Cd: 1.58,
              In: 1.93,
              Sn: 2.17,
              Sb: 2.06,
              Te: 2.06,
              I: 1.98,
              Xe: 2.16,
              Cs: 3.43,
              Ba: 2.68,
              Pt: 1.75,
              Au: 1.66,
              Hg: 1.55,
              Tl: 1.96,
              Pb: 2.02,
              Bi: 2.07,
              Po: 1.97,
              At: 2.02,
              Rn: 2.2,
              Fr: 3.48,
              Ra: 2.83,
              U: 1.86
            }, A.ignoredKeys = /* @__PURE__ */ new Set(["props", "invert", "model", "frame", "byres", "expand", "within", "and", "or", "not"]);
          }
        ),
        /***/
        "./src/GLShape.ts": (
          /*!************************!*\
            !*** ./src/GLShape.ts ***!
            \************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              GLShape: () => (
                /* binding */
                x
              ),
              /* harmony export */
              splitMesh: () => (
                /* binding */
                b
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./WebGL/shapes */
              "./src/WebGL/shapes/index.ts"
            ), l = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), h = t(
              /*! ./colors */
              "./src/colors.ts"
            ), c = t(
              /*! ./ProteinSurface4 */
              "./src/ProteinSurface4.ts"
            ), d = t(
              /*! ./VolumeData */
              "./src/VolumeData.ts"
            ), _ = t(
              /*! ./GLDraw */
              "./src/GLDraw.ts"
            ), m = t(
              /*! ./glcartoon */
              "./src/glcartoon.ts"
            ), y = t(
              /*! ./utilities */
              "./src/utilities.ts"
            );
            class x {
              static finalizeGeo(f) {
                var s = f.updateGeoGroup(0);
                s.vertices > 0 && s.truncateArrayBuffers(!0, !0);
              }
              /*
               *
               * @param {Geometry}
               *            geo
               * @param {Color | colorlike} color
               */
              static updateColor(f, s) {
                s = s || h.CC.color(s), f.colorsNeedUpdate = !0;
                var u, p, g;
                s.constructor !== Array && (u = s.r, p = s.g, g = s.b);
                for (let w in f.geometryGroups) {
                  let o = f.geometryGroups[w], v = o.colorArray;
                  for (let M = 0, E = o.vertices; M < E; ++M) {
                    if (s.constructor === Array) {
                      let $ = s[M];
                      u = $.r, p = $.g, g = $.b;
                    }
                    v[M * 3] = u, v[M * 3 + 1] = p, v[M * 3 + 2] = g;
                  }
                }
              }
              /*
               * @param {GLShape}
               *            shape
               * @param {geometryGroup}
               *            geoGroup
               * @param {ArrowSpec}
               *            spec
               */
              static drawArrow(f, s, u) {
                var p = u.start, g = u.end, w = u.radius, o = u.radiusRatio, v = u.mid, M = u.midpos;
                if (!(p && g))
                  return;
                var E = s.updateGeoGroup(51), $ = new l.Vector3(g.x, g.y, g.z).sub(p);
                if (M) {
                  let pe = $.length();
                  M > 0 ? v = M / pe : v = (pe + M) / pe;
                }
                $.multiplyScalar(v);
                var k = new l.Vector3(p.x, p.y, p.z).add($), L = $.clone().negate();
                let z = new l.Vector3(p.x, p.y, p.z);
                f.intersectionShape.cylinder.push(new a.Cylinder(z, k.clone(), w)), f.intersectionShape.sphere.push(new a.Sphere(z, w));
                var O = [];
                O[0] = $.clone(), Math.abs(O[0].x) > 1e-4 ? O[0].y += 1 : O[0].x += 1, O[0].cross($), O[0].normalize(), O[4] = O[0].clone(), O[4].crossVectors(O[0], $), O[4].normalize(), O[8] = O[0].clone().negate(), O[12] = O[4].clone().negate(), O[2] = O[0].clone().add(O[4]).normalize(), O[6] = O[4].clone().add(O[8]).normalize(), O[10] = O[8].clone().add(O[12]).normalize(), O[14] = O[12].clone().add(O[0]).normalize(), O[1] = O[0].clone().add(O[2]).normalize(), O[3] = O[2].clone().add(O[4]).normalize(), O[5] = O[4].clone().add(O[6]).normalize(), O[7] = O[6].clone().add(O[8]).normalize(), O[9] = O[8].clone().add(O[10]).normalize(), O[11] = O[10].clone().add(O[12]).normalize(), O[13] = O[12].clone().add(O[14]).normalize(), O[15] = O[14].clone().add(O[0]).normalize();
                var R = E.vertices, N = E.vertexArray, W = E.faceArray, B = E.normalArray, P = E.lineArray, G, H, U;
                for (H = 0, U = O.length; H < U; ++H) {
                  G = 3 * (R + 3 * H);
                  var j = O[H].clone().multiplyScalar(w).add(p), re = O[H].clone().multiplyScalar(w).add(k), ie = O[H].clone().multiplyScalar(w * o).add(k);
                  if (N[G] = j.x, N[G + 1] = j.y, N[G + 2] = j.z, N[G + 3] = re.x, N[G + 4] = re.y, N[G + 5] = re.z, N[G + 6] = ie.x, N[G + 7] = ie.y, N[G + 8] = ie.z, H > 0) {
                    var te = N[G - 3], ue = N[G - 2], de = N[G - 1], oe = new l.Vector3(te, ue, de), J = new l.Vector3(g.x, g.y, g.z), Ee = k.clone(), se = new l.Vector3(ie.x, ie.y, ie.z);
                    f.intersectionShape.triangle.push(new a.Triangle(se, J, oe)), f.intersectionShape.triangle.push(new a.Triangle(oe.clone(), Ee, se.clone()));
                  }
                }
                E.vertices += 48, G = E.vertices * 3, N[G] = p.x, N[G + 1] = p.y, N[G + 2] = p.z, N[G + 3] = k.x, N[G + 4] = k.y, N[G + 5] = k.z, N[G + 6] = g.x, N[G + 7] = g.y, N[G + 8] = g.z, E.vertices += 3;
                var Ae, he, ne, _e, Le, Be, Ue, He, We, Ge, Ne, Pe, Te, Me, De, V, Z, ee, ye, ce = E.vertices - 3, Ie = E.vertices - 2, ke = E.vertices - 1, Y = ce * 3, me = Ie * 3, we = ke * 3;
                for (H = 0, U = O.length - 1; H < U; ++H) {
                  var Re = R + 3 * H;
                  G = Re * 3, he = E.faceidx, ne = E.lineidx, _e = Re, Ge = _e * 3, Le = Re + 1, Ne = Le * 3, Be = Re + 2, Pe = Be * 3, Ue = Re + 4, Te = Ue * 3, He = Re + 5, Me = He * 3, We = Re + 3, De = We * 3, V = Z = O[H], ee = ye = O[H + 1], B[Ge] = V.x, B[Ne] = Z.x, B[De] = ye.x, B[Ge + 1] = V.y, B[Ne + 1] = Z.y, B[De + 1] = ye.y, B[Ge + 2] = V.z, B[Ne + 2] = Z.z, B[De + 2] = ye.z, B[Ne] = Z.x, B[Te] = ee.x, B[De] = ye.x, B[Ne + 1] = Z.y, B[Te + 1] = ee.y, B[De + 1] = ye.y, B[Ne + 2] = Z.z, B[Te + 2] = ee.z, B[De + 2] = ye.z, B[Pe] = Z.x, B[Me] = ee.x, B[Pe + 1] = Z.y, B[Me + 1] = ee.y, B[Pe + 2] = Z.z, B[Me + 2] = ee.z, W[he] = _e, W[he + 1] = Le, W[he + 2] = We, W[he + 3] = Le, W[he + 4] = Ue, W[he + 5] = We, W[he + 6] = _e, W[he + 7] = We, W[he + 8] = ce, W[he + 9] = Be, W[he + 10] = Ie, W[he + 11] = He, W[he + 12] = Be, W[he + 13] = ke, W[he + 14] = He, P[ne] = _e, P[ne + 1] = Le, P[ne + 2] = _e, P[ne + 3] = We, P[ne + 4] = Ue, P[ne + 5] = We, P[ne + 6] = _e, P[ne + 7] = We, P[ne + 8] = Be, P[ne + 9] = Le, P[ne + 10] = Be, P[ne + 11] = He, P[ne + 12] = Ue, P[ne + 13] = He, P[ne + 14] = Be, P[ne + 15] = ke, P[ne + 16] = Be, P[ne + 17] = He, P[ne + 18] = ke, P[ne + 19] = He, E.faceidx += 15, E.lineidx += 20;
                }
                Ae = [
                  R + 45,
                  R + 46,
                  R + 1,
                  R,
                  R + 47,
                  R + 2
                ], he = E.faceidx, ne = E.lineidx, _e = Ae[0], Ge = _e * 3, Le = Ae[1], Ne = Le * 3, Be = Ae[4], Pe = Be * 3, Ue = Ae[2], Te = Ue * 3, He = Ae[5], Me = He * 3, We = Ae[3], De = We * 3, V = Z = O[15], ee = ye = O[0], B[Ge] = V.x, B[Ne] = Z.x, B[De] = ye.x, B[Ge + 1] = V.y, B[Ne + 1] = Z.y, B[De + 1] = ye.y, B[Ge + 2] = V.z, B[Ne + 2] = Z.z, B[De + 2] = ye.z, B[Ne] = Z.x, B[Te] = ee.x, B[De] = ye.x, B[Ne + 1] = Z.y, B[Te + 1] = ee.y, B[De + 1] = ye.y, B[Ne + 2] = Z.z, B[Te + 2] = ee.z, B[De + 2] = ye.z, B[Pe] = Z.x, B[Me] = ee.x, B[Pe + 1] = Z.y, B[Me + 1] = ee.y, B[Pe + 2] = Z.z, B[Me + 2] = ee.z, $.normalize(), L.normalize(), B[Y] = L.x, B[me] = B[we] = $.x, B[Y + 1] = L.y, B[me + 1] = B[we + 1] = $.y, B[Y + 2] = L.z, B[me + 2] = B[we + 2] = $.z, W[he] = _e, W[he + 1] = Le, W[he + 2] = We, W[he + 3] = Le, W[he + 4] = Ue, W[he + 5] = We, W[he + 6] = _e, W[he + 7] = We, W[he + 8] = ce, W[he + 9] = Be, W[he + 10] = Ie, W[he + 11] = He, W[he + 12] = Be, W[he + 13] = ke, W[he + 14] = He, P[ne] = _e, P[ne + 1] = Le, P[ne + 2] = _e, P[ne + 3] = We, P[ne + 4] = Ue, P[ne + 5] = We, P[ne + 6] = _e, P[ne + 7] = We, P[ne + 8] = Be, P[ne + 9] = Le, P[ne + 10] = Be, P[ne + 11] = He, P[ne + 12] = Ue, P[ne + 13] = He, P[ne + 14] = Be, P[ne + 15] = ke, P[ne + 16] = Be, P[ne + 17] = He, P[ne + 18] = ke, P[ne + 19] = He, E.faceidx += 15, E.lineidx += 20;
              }
              // Update a bounding sphere's position and radius
              // from list of centroids and new points
              /*
               * @param {Sphere}
               *            sphere
               * @param {Object}
               *            components, centroid of all objects in shape
               * @param {Array}
               *            points, flat array of all points in shape
               * @param {int} numPoints, number of valid poitns in points
               */
              static updateBoundingFromPoints(f, s, u, p) {
                f.center.set(0, 0, 0);
                let g = 1 / 0, w = 1 / 0, o = 1 / 0, v = -1 / 0, M = -1 / 0, E = -1 / 0;
                f.box && (g = f.box.min.x, v = f.box.max.x, w = f.box.min.y, M = f.box.max.y, o = f.box.min.z, E = f.box.max.z);
                for (let z = 0, O = p; z < O; z++) {
                  var $ = u[z * 3], k = u[z * 3 + 1], L = u[z * 3 + 2];
                  $ < g && (g = $), k < w && (w = k), L < o && (o = L), $ > v && (v = $), k > M && (M = k), L > E && (E = L);
                }
                f.center.set((v + g) / 2, (M + w) / 2, (E + o) / 2), f.radius = f.center.distanceTo({ x: v, y: M, z: E }), f.box = { min: { x: g, y: w, z: o }, max: { x: v, y: M, z: E } };
              }
              //helper function for adding an appropriately sized mesh
              static addCustomGeo(f, s, u, p, g) {
                var w = s.addGeoGroup(), o = u.vertexArr, v = u.normalArr, M = u.faceArr;
                w.vertices = o.length, w.faceidx = M.length;
                var E, $, k, L, z, O, R, N, W, B = w.vertexArray, P = w.colorArray;
                for (p.constructor !== Array && (N = p.r, W = p.g, L = p.b), O = 0, R = w.vertices; O < R; ++O)
                  E = O * 3, $ = o[O], B[E] = $.x, B[E + 1] = $.y, B[E + 2] = $.z, p.constructor === Array && (z = p[O], N = z.r, W = z.g, L = z.b), P[E] = N, P[E + 1] = W, P[E + 2] = L;
                if (g)
                  for (O = 0, R = w.faceidx / 3; O < R; ++O) {
                    E = O * 3, k = M[E], L = M[E + 1], z = M[E + 2];
                    var G = new l.Vector3(), H = new l.Vector3(), U = new l.Vector3();
                    f.intersectionShape.triangle.push(new a.Triangle(G.copy(o[k]), H.copy(o[L]), U.copy(o[z])));
                  }
                if (g) {
                  var j = new l.Vector3(0, 0, 0), re = 0;
                  for (let ue = 0; ue < s.geometryGroups.length; ue++)
                    j.add(s.geometryGroups[ue].getCentroid()), re++;
                  j.divideScalar(re), x.updateBoundingFromPoints(f.boundingSphere, { centroid: j }, B, w.vertices);
                }
                if (w.faceArray = new Uint16Array(M), w.truncateArrayBuffers(!0, !0), v.length < w.vertices)
                  w.setNormals();
                else {
                  var ie = w.normalArray = new Float32Array(w.vertices * 3), te;
                  for (O = 0, R = w.vertices; O < R; ++O)
                    E = O * 3, te = v[O], ie[E] = te.x, ie[E + 1] = te.y, ie[E + 2] = te.z;
                }
                w.setLineIndices(), w.lineidx = w.lineArray.length;
              }
              /*
               *
               * @param {$3Dmol.GLShape}
               *            shape
               * @param {ShapeSpec}
               *            stylespec
               * @returns {undefined}
               */
              static updateFromStyle(f, s) {
                typeof s.color < "u" ? (f.color = s.color || new h.Color(), s.color instanceof h.Color || (f.color = h.CC.color(s.color))) : f.color = h.CC.color(0), f.wireframe = !!s.wireframe, f.opacity = s.alpha ? (0, l.clamp)(s.alpha, 0, 1) : 1, typeof s.opacity < "u" && (f.opacity = (0, l.clamp)(s.opacity, 0, 1)), f.side = s.side !== void 0 ? s.side : r.DoubleSide, f.linewidth = typeof s.linewidth > "u" ? 1 : s.linewidth, f.clickable = !!s.clickable, f.callback = (0, y.makeFunction)(s.callback), f.hoverable = !!s.hoverable, f.hover_callback = (0, y.makeFunction)(s.hover_callback), f.unhover_callback = (0, y.makeFunction)(s.unhover_callback), f.contextMenuEnabled = !!s.contextMenuEnabled, f.hidden = s.hidden, f.frame = s.frame;
              }
              /**
               * Custom renderable shape
               *
               * @constructor
               *
               * @param {ShapeSpec} stylespec
               */
              constructor(f) {
                this.color = 16777215, this.hidden = !1, this.wireframe = !1, this.opacity = 1, this.linewidth = 1, this.clickable = !1, this.hoverable = !1, this.contextMenuEnabled = !1, this.side = r.DoubleSide, this.stylespec = f || {}, this.boundingSphere = new a.Sphere(), this.intersectionShape = {
                  sphere: [],
                  cylinder: [],
                  line: [],
                  triangle: []
                }, x.updateFromStyle(this, this.stylespec), this.components = [], this.shapeObj = null, this.renderedShapeObj = null, this.geo = new r.Geometry(!0), this.linegeo = new r.Geometry(!0);
              }
              /** Update shape with new style specification
               * @param {ShapeSpec} newspec
                 @example
                  let sphere = viewer.addSphere({center:{x:0,y:0,z:0},radius:10.0,color:'red'});
                  sphere.updateStyle({color:'yellow',opacity:0.5});
                  viewer.render();
               */
              updateStyle(f) {
                for (var s in f)
                  this.stylespec[s] = f[s];
                if (x.updateFromStyle(this, this.stylespec), f.voldata && f.volscheme) {
                  (0, y.adjustVolumeStyle)(f);
                  const u = f.volscheme, p = f.voldata, g = h.CC, w = u.range() || [-1, 1];
                  this.geo.setColors(function(o, v, M) {
                    let E = p.getVal(o, v, M);
                    return g.color(u.valueToHex(E, w));
                  }), delete this.color;
                }
              }
              /**
               * Creates a custom shape from supplied vertex and face arrays
               * @param {CustomShapeSpec} customSpec
               */
              addCustom(f) {
                f.vertexArr = f.vertexArr || [], f.faceArr = f.faceArr || [], f.normalArr = f.normalArr || [], x.drawCustom(this, this.geo, f);
              }
              /**
               * Creates a sphere shape
               * @param {SphereSpec} sphereSpec
               @example
               viewer.addSphere({center:{x:0,y:0,z:0},radius:10.0,color:'red'});
               
               viewer.render();
               */
              addSphere(f) {
                f.center || (f.center = new l.Vector3(0, 0, 0)), f.radius = f.radius ? (0, l.clamp)(f.radius, 0, 1 / 0) : 1.5, f.color = h.CC.color(f.color), this.intersectionShape.sphere.push(new a.Sphere(f.center, f.radius)), _.GLDraw.drawSphere(this.geo, f.center, f.radius, f.color, f.quality), this.components.push({
                  centroid: new l.Vector3(f.center.x, f.center.y, f.center.z)
                });
                var s = this.geo.updateGeoGroup(0);
                x.updateBoundingFromPoints(this.boundingSphere, this.components, s.vertexArray, s.vertices);
              }
              /**
               * Creates a box
               * @param {BoxSpec} boxSpec
               @example
               var shape = viewer.addShape({color:'red'});
               shape.addBox({corner: {x:1,y:2,z:0}, dimensions: {w: 4, h: 2, d: 6}});
               shape.addBox({corner: {x:-5,y:-3,z:0},
                             dimensions: { w: {x:1,y:1,z:0},
                                           h: {x:-1,y:1,z:0},
                                           d: {x:0,y:0,z:1} }});
               viewer.zoomTo();
               viewer.rotate(30);
               viewer.render();
               */
              addBox(f) {
                var s = f.dimensions || { w: 1, h: 1, d: 1 }, u;
                typeof s.w == "number" ? u = { x: s.w, y: 0, z: 0 } : u = s.w;
                var p;
                typeof s.h == "number" ? p = { x: 0, y: s.h, z: 0 } : p = s.h;
                var g;
                typeof s.d == "number" ? g = { x: 0, y: 0, z: s.d } : g = s.d;
                var w = f.corner;
                w == null && (f.center !== void 0 ? w = {
                  x: f.center.x - 0.5 * (u.x + p.x + g.x),
                  y: f.center.y - 0.5 * (u.y + p.y + g.y),
                  z: f.center.z - 0.5 * (u.z + p.z + g.z)
                } : w = { x: 0, y: 0, z: 0 });
                var o = [
                  { x: w.x, y: w.y, z: w.z },
                  { x: w.x + u.x, y: w.y + u.y, z: w.z + u.z },
                  { x: w.x + p.x, y: w.y + p.y, z: w.z + p.z },
                  { x: w.x + u.x + p.x, y: w.y + u.y + p.y, z: w.z + u.z + p.z },
                  { x: w.x + g.x, y: w.y + g.y, z: w.z + g.z },
                  { x: w.x + u.x + g.x, y: w.y + u.y + g.y, z: w.z + u.z + g.z },
                  { x: w.x + p.x + g.x, y: w.y + p.y + g.y, z: w.z + p.z + g.z },
                  { x: w.x + u.x + p.x + g.x, y: w.y + u.y + p.y + g.y, z: w.z + u.z + p.z + g.z }
                ], v = [], M = [];
                v.splice(v.length, 0, o[0], o[1], o[2], o[3]), M.splice(M.length, 0, 0, 2, 1, 1, 2, 3);
                var E = 4;
                v.splice(v.length, 0, o[2], o[3], o[6], o[7]), M.splice(M.length, 0, E + 0, E + 2, E + 1, E + 1, E + 2, E + 3), E += 4, v.splice(v.length, 0, o[4], o[5], o[0], o[1]), M.splice(M.length, 0, E + 0, E + 2, E + 1, E + 1, E + 2, E + 3), E += 4, v.splice(v.length, 0, o[6], o[7], o[4], o[5]), M.splice(M.length, 0, E + 0, E + 2, E + 1, E + 1, E + 2, E + 3), E += 4, v.splice(v.length, 0, o[3], o[1], o[7], o[5]), M.splice(M.length, 0, E + 0, E + 2, E + 1, E + 1, E + 2, E + 3), E += 4, v.splice(v.length, 0, o[2], o[6], o[0], o[4]), M.splice(M.length, 0, E + 0, E + 2, E + 1, E + 1, E + 2, E + 3), E += 4;
                var $ = (0, y.extend)({}, f);
                $.vertexArr = v, $.faceArr = M, $.normalArr = [], x.drawCustom(this, this.geo, $);
                var k = new l.Vector3();
                this.components.push({
                  centroid: k.addVectors(o[0], o[7]).multiplyScalar(0.5)
                });
                var L = this.geo.updateGeoGroup(0);
                x.updateBoundingFromPoints(this.boundingSphere, this.components, L.vertexArray, L.vertices);
              }
              /**
               * Creates a cylinder shape
               * @param {CylinderSpec} cylinderSpec
               @example
                    viewer.addCylinder({start:{x:0.0,y:0.0,z:0.0},
                                        end:{x:10.0,y:0.0,z:0.0},
                                        radius:1.0,
                                        fromCap:1,
                                        toCap:2,
                                        color:'red',
                                        hoverable:true,
                                        clickable:true,
                                        callback:function(){ this.color.setHex(0x00FFFF00);viewer.render( );},
                                        hover_callback: function(){ viewer.render( );},
                                        unhover_callback: function(){ this.color.setHex(0xFF000000);viewer.render( );}
                                       });
                    viewer.addCylinder({start:{x:0.0,y:2.0,z:0.0},
                                        end:{x:0.0,y:10.0,z:0.0},
                                        radius:0.5,
                                        fromCap:false,
                                        toCap:true,
                                        color:'teal'});
                    viewer.addCylinder({start:{x:15.0,y:0.0,z:0.0},
                                        end:{x:20.0,y:0.0,z:0.0},
                                        radius:1.0,
                                        color:'black',
                                        fromCap:false,
                                        toCap:false});
                    viewer.render();
               */
              addCylinder(f) {
                var s, u;
                f.start ? s = new l.Vector3(f.start.x || 0, f.start.y || 0, f.start.z || 0) : s = new l.Vector3(0, 0, 0), f.end ? (u = new l.Vector3(f.end.x, f.end.y || 0, f.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new l.Vector3(0, 0, 0);
                var p = f.radius || 0.1, g = h.CC.color(f.color);
                this.intersectionShape.cylinder.push(new a.Cylinder(s, u, p)), _.GLDraw.drawCylinder(this.geo, s, u, p, g, f.fromCap, f.toCap);
                var w = new l.Vector3();
                this.components.push({
                  centroid: w.addVectors(s, u).multiplyScalar(0.5)
                });
                var o = this.geo.updateGeoGroup(0);
                x.updateBoundingFromPoints(this.boundingSphere, this.components, o.vertexArray, o.vertices);
              }
              /**
               * Creates a dashed cylinder shape
               * @param {CylinderSpec} cylinderSpec
               */
              addDashedCylinder(f) {
                f.dashLength = f.dashLength || 0.25, f.gapLength = f.gapLength || 0.25;
                var s;
                f.start ? s = new l.Vector3(f.start.x || 0, f.start.y || 0, f.start.z || 0) : s = new l.Vector3(0, 0, 0);
                var u;
                f.end ? (u = new l.Vector3(f.end.x, f.end.y || 0, f.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new l.Vector3(3, 0, 0);
                for (var p = f.radius || 0.1, g = h.CC.color(f.color), w = Math.sqrt(Math.pow(s.x - u.x, 2) + Math.pow(s.y - u.y, 2) + Math.pow(s.z - u.z, 2)), o = w / (f.gapLength + f.dashLength), v = new l.Vector3(f.start.x || 0, f.start.y || 0, f.start.z || 0), M = new l.Vector3(f.end.x, f.end.y || 0, f.end.z || 0), E = new l.Vector3((u.x - s.x) / (w / f.gapLength), (u.y - s.y) / (w / f.gapLength), (u.z - s.z) / (w / f.gapLength)), $ = new l.Vector3((u.x - s.x) / (w / f.dashLength), (u.y - s.y) / (w / f.dashLength), (u.z - s.z) / (w / f.dashLength)), k = 0; k < o; k++)
                  M = new l.Vector3(v.x + $.x, v.y + $.y, v.z + $.z), this.intersectionShape.cylinder.push(new a.Cylinder(v, M, p)), _.GLDraw.drawCylinder(this.geo, v, M, p, g, f.fromCap, f.toCap), v = new l.Vector3(M.x + E.x, M.y + E.y, M.z + E.z);
                var L = new l.Vector3();
                this.components.push({
                  centroid: L.addVectors(s, u).multiplyScalar(0.5)
                });
                var z = this.geo.updateGeoGroup(0);
                x.updateBoundingFromPoints(this.boundingSphere, this.components, z.vertexArray, z.vertices);
              }
              /**
               * Creates a curved shape
               * @param {CurveSpec} curveSpec
               */
              addCurve(f) {
                f.points = f.points || [], f.smooth = f.smooth || 10, typeof f.fromCap > "u" && (f.fromCap = 2), typeof f.toCap > "u" && (f.toCap = 2);
                var s = (0, m.subdivide_spline)(f.points, f.smooth);
                if (s.length < 3) {
                  console.log("Too few points in addCurve");
                  return;
                }
                var u = f.radius || 0.1, p = h.CC.color(f.color), g = 0, w = s.length - 1, o = s[0].distanceTo(s[1]), v = Math.ceil(2 * u / o);
                if (f.toArrow) {
                  w -= v;
                  let k = {
                    start: s[w],
                    end: s[s.length - 1],
                    radius: u,
                    color: p,
                    mid: 1e-4
                  };
                  this.addArrow(k);
                }
                if (f.fromArrow) {
                  g += v;
                  let k = {
                    start: s[g],
                    end: s[0],
                    radius: u,
                    color: p,
                    mid: 1e-4
                  };
                  this.addArrow(k);
                }
                for (var M = Math.ceil(s.length / 2), E = { radius: u, color: p, fromCap: 2, toCap: 2 }, $ = g; $ < w; $++)
                  E.start = s[$], E.end = s[$ + 1], E.fromCap = 2, E.toCap = 2, $ < M ? (E.fromCap = 2, E.toCap = 0) : $ > M ? (E.fromCap = 0, E.toCap = 2) : (E.fromCap = 2, E.toCap = 2), this.addCylinder(E);
              }
              /**
               * Creates a line shape
               * @param {LineSpec} lineSpec
               @example
               $3Dmol.download("pdb:2ABJ",viewer,{},function(){
                        viewer.addLine({dashed:true,start:{x:0,y:0,z:0},end:{x:100,y:100,z:100}});
                        viewer.render(callback);
                    });
              
               */
              addLine(f) {
                var s, u;
                f.start ? s = new l.Vector3(f.start.x || 0, f.start.y || 0, f.start.z || 0) : s = new l.Vector3(0, 0, 0), f.end ? (u = new l.Vector3(f.end.x, f.end.y || 0, f.end.z || 0), typeof u.x > "u" && (u.x = 3)) : u = new l.Vector3(3, 0, 0);
                var p = this.geo.updateGeoGroup(2), g = p.vertices, w = g * 3, o = p.vertexArray;
                o[w] = s.x, o[w + 1] = s.y, o[w + 2] = s.z, o[w + 3] = u.x, o[w + 4] = u.y, o[w + 5] = u.z, p.vertices += 2;
                var v = p.lineArray, M = p.lineidx;
                v[M] = g, v[M + 1] = g + 1, p.lineidx += 2;
                var E = new l.Vector3();
                this.components.push({
                  centroid: E.addVectors(s, u).multiplyScalar(0.5)
                }), p = this.geo.updateGeoGroup(0), x.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices);
              }
              /**
               * Creates an arrow shape
               * @param {ArrowSpec} arrowSpec
               @example
                $3Dmol.download("pdb:4DM7",viewer,{},function(){
                        viewer.setBackgroundColor(0xffffffff);
                        viewer.addArrow({
                            start: {x:-10.0, y:0.0, z:0.0},
                            end: {x:0.0, y:-10.0, z:0.0},
                            radius: 1.0,
                            radiusRadio:1.0,
                            mid:1.0,
                            clickable:true,
                            callback:function(){
                                this.color.setHex(0xFF0000FF);
                                viewer.render( );
                            }
                        });
                        viewer.render();
                      });
               */
              addArrow(f) {
                if (f.start ? f.start = new l.Vector3(f.start.x || 0, f.start.y || 0, f.start.z || 0) : f.start = new l.Vector3(0, 0, 0), f.dir instanceof l.Vector3 && typeof f.length == "number") {
                  var s = f.dir.clone().multiplyScalar(f.length).add(f.start);
                  f.end = s;
                } else f.end ? (f.end = new l.Vector3(f.end.x, f.end.y || 0, f.end.z || 0), typeof f.end.x > "u" && (f.end.x = 3)) : f.end = new l.Vector3(3, 0, 0);
                f.radius = f.radius || 0.1, f.radiusRatio = f.radiusRatio || 1.618034, f.mid = 0 < f.mid && f.mid < 1 ? f.mid : 0.618034, x.drawArrow(this, this.geo, f);
                var u = new l.Vector3();
                this.components.push({
                  centroid: u.addVectors(f.start, f.end).multiplyScalar(0.5)
                });
                var p = this.geo.updateGeoGroup(0);
                x.updateBoundingFromPoints(this.boundingSphere, this.components, p.vertexArray, p.vertices);
              }
              static distance_from(f, s) {
                return Math.sqrt(Math.pow(f.x - s.x, 2) + Math.pow(f.y - s.y, 2) + Math.pow(f.z - s.z, 2));
              }
              static inSelectedRegion(f, s, u) {
                for (var p = 0; p < s.length; p++)
                  if (x.distance_from(s[p], f) <= u)
                    return !0;
                return !1;
              }
              /**
               * Create isosurface from volumetric data.
               * @param {VolumeData} data - volumetric input data
               * @param {IsoSurfaceSpec} isoSpec - volumetric data shape specification
               * @example //the user can specify a selected region for the isosurface
               $.get('../test_structs/benzene-homo.cube', function(data){
                        var voldata = new $3Dmol.VolumeData(data, "cube");
                        viewer.addIsosurface(voldata, {isoval: 0.01,
                                                       color: "blue",
                                                       alpha: 0.5,
                                                       smoothness: 10});
                        viewer.addIsosurface(voldata, {isoval: -0.01,
                                                       color: "red",
                                                       smoothness: 5,
                                                       opacity:0.5,
                                                       wireframe:true,
                                                       clickable:true,
                                                       callback:
                                                       function() {
                                                           this.opacity = 0.0;
                                                           viewer.render( );
                                                       }});
                        viewer.setStyle({}, {stick:{}});
                        viewer.zoomTo();
                        viewer.render();
                      });
               */
              addIsosurface(f, s, u, p) {
                var g = s.isoval !== void 0 && typeof s.isoval == "number" ? s.isoval : 0, w = !!s.voxel, o = s.smoothness === void 0 ? 1 : s.smoothness, v = f.size.x, M = f.size.y, E = f.size.z, $ = new Int16Array(v * M * E), k = f.data, L, z;
                for (L = 0, z = $.length; L < z; ++L)
                  $[L] = -1;
                var O = new Uint8Array(v * M * E);
                for (L = 0, z = k.length; L < z; ++L) {
                  var R = g >= 0 ? k[L] - g : g - k[L];
                  R > 0 && (O[L] |= x.ISDONE);
                }
                var N = [], W = [];
                c.MarchingCube.march(O, N, W, {
                  fulltable: !0,
                  voxel: w,
                  unitCube: f.unit,
                  origin: f.origin,
                  matrix: f.matrix,
                  nX: v,
                  nY: M,
                  nZ: E
                }), !w && o > 0 && c.MarchingCube.laplacianSmooth(o, N, W);
                var B = [], P = [], G = [];
                if (s.selectedRegion && s.coords === void 0 && (s.coords = s.selectedRegion), s.coords === void 0 && s.selection !== void 0 && (p ? s.coords = p.selectedAtoms(s.selection) : console.log("addIsosurface needs viewer is selection provided.")), s.coords !== void 0) {
                  var H = s.coords[0].x, U = s.coords[0].y, j = s.coords[0].z, re = s.coords[0].x, ie = s.coords[0].y, te = s.coords[0].z;
                  for (let ne = 0; ne < s.coords.length; ne++)
                    s.coords[ne].x > H ? H = s.coords[ne].x : s.coords[ne].x < re && (re = s.coords[ne].x), s.coords[ne].y > U ? U = s.coords[ne].y : s.coords[ne].y < ie && (ie = s.coords[ne].y), s.coords[ne].z > j ? j = s.coords[ne].z : s.coords[ne].z < te && (te = s.coords[ne].z);
                  var ue = 2;
                  s.radius !== void 0 && (ue = s.radius), s.selectedOffset !== void 0 && (ue = s.selectedOffset), s.seldist !== void 0 && (ue = s.seldist), re -= ue, H += ue, ie -= ue, U += ue, te -= ue, j += ue;
                  for (let ne = 0; ne < N.length; ne++)
                    N[ne].x > re && N[ne].x < H && N[ne].y > ie && N[ne].y < U && N[ne].z > te && N[ne].z < j && x.inSelectedRegion(N[ne], s.coords, ue) ? (B.push(P.length), P.push(N[ne])) : B.push(-1);
                  for (let ne = 0; ne + 2 < W.length; ne += 3)
                    B[W[ne]] !== -1 && B[W[ne + 1]] !== -1 && B[W[ne + 2]] !== -1 && (G.push(W[ne] - (W[ne] - B[W[ne]])), G.push(W[ne + 1] - (W[ne + 1] - B[W[ne + 1]])), G.push(W[ne + 2] - (W[ne + 2] - B[W[ne + 2]])));
                  N = P, W = G;
                }
                x.drawCustom(this, this.geo, {
                  vertexArr: N,
                  faceArr: W,
                  normalArr: [],
                  clickable: s.clickable,
                  hoverable: s.hoverable
                }), this.updateStyle(s);
                var de = new l.Vector3(f.origin.x, f.origin.y, f.origin.z), oe = new l.Vector3(f.size.x * f.unit.x, f.size.y * f.unit.y, f.size.z * f.unit.z), J = new l.Vector3(0, 0, 0), Ee = de.clone(), se = de.clone().add(oe);
                for (let ne = 0; ne < N.length; ne++)
                  J.add(N[ne]), Ee.max(N[ne]), se.min(N[ne]);
                J.divideScalar(N.length);
                var Ae = J.distanceTo(se), he = J.distanceTo(Ee);
                this.boundingSphere.center = J, this.boundingSphere.radius = Math.max(Ae, he), typeof u == "function" && u();
              }
              /**
               * @deprecated Use addIsosurface instead
               * Creates custom shape from volumetric data
               * @param {string} data - Volumetric input data
               * @param {string} fmt - Input data format (e.g. 'cube' for cube file format)
               * @param {IsoSurfaceSpec} isoSpec - Volumetric data shape specification
               */
              addVolumetricData(f, s, u) {
                f = new d.VolumeData(f, s), this.addIsosurface(f, u);
              }
              //for internal use, truncate buffers to save memory
              finalize() {
                return x.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.geo;
              }
              /*
               * Initialize webgl objects for rendering
               * @param {$3Dmol.Object3D} group
               *
               */
              globj(f) {
                if (this.renderedShapeObj && (f.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) {
                  x.finalizeGeo(this.geo), this.geo.initTypedArrays(), this.wireframe && this.geo.setUpWireframe(), typeof this.color < "u" && x.updateColor(this.geo, this.color), this.shapeObj = new r.Object3D();
                  var s = null;
                  this.side == r.DoubleSide ? s = new r.MeshDoubleLambertMaterial({
                    wireframe: this.wireframe,
                    side: this.side,
                    transparent: this.opacity < 1,
                    opacity: this.opacity,
                    wireframeLinewidth: this.linewidth,
                    vertexColors: r.Coloring.VertexColors
                  }) : s = new r.MeshLambertMaterial({
                    wireframe: this.wireframe,
                    side: this.side,
                    transparent: this.opacity < 1,
                    opacity: this.opacity,
                    wireframeLinewidth: this.linewidth,
                    vertexColors: r.Coloring.VertexColors
                  });
                  var u = new r.Mesh(this.geo, s);
                  if (this.shapeObj.add(u), this.linegeo && this.linegeo.vertices > 0) {
                    var p = new r.LineBasicMaterial({
                      linewidth: this.linewidth,
                      color: this.color
                    }), g = new r.Line(this.linegeo, p, r.LineStyle.LinePieces);
                    this.shapeObj.add(g);
                  }
                  this.renderedShapeObj = this.shapeObj.clone(), f.add(this.renderedShapeObj);
                }
              }
              removegl(f) {
                this.renderedShapeObj && (this.renderedShapeObj.geometry !== void 0 && this.renderedShapeObj.geometry.dispose(), this.renderedShapeObj.material !== void 0 && this.renderedShapeObj.material.dispose(), f.remove(this.renderedShapeObj), this.renderedShapeObj = null), this.shapeObj = null;
              }
              get position() {
                return this.boundingSphere.center;
              }
              get x() {
                return this.boundingSphere.center.x;
              }
              get y() {
                return this.boundingSphere.center.y;
              }
              get z() {
                return this.boundingSphere.center.z;
              }
            }
            x.ISDONE = 2, x.drawCustom = function(A, f, s) {
              var u = s, p = u.vertexArr, g = u.faceArr;
              (p.length === 0 || g.length === 0) && console.warn("Error adding custom shape component: No vertices and/or face indices supplied!");
              var w = s.color;
              typeof w > "u" && (w = A.color), w = h.CC.color(w);
              for (var o = b(u), v = 0, M = o.length; v < M; v++)
                x.addCustomGeo(A, f, o[v], o[v].colorArr ? o[v].colorArr : w, s.clickable);
            };
            function b(A) {
              var f = 64e3;
              if (A.vertexArr.length < f)
                return [A];
              var s = [{ vertexArr: [], normalArr: [], faceArr: [] }];
              A.colorArr && (s.colorArr = []);
              var u = [], p = [], g = 0, w = A.faceArr;
              for (let v = 0, M = w.length; v < M; v += 3) {
                let E = s[g];
                for (let $ = 0; $ < 3; $++) {
                  var o = w[v + $];
                  u[o] !== g && (u[o] = g, p[o] = E.vertexArr.length, E.vertexArr.push(A.vertexArr[o]), A.normalArr && A.normalArr[o] && E.normalArr.push(A.normalArr[o]), A.colorArr && A.colorArr[o] && E.colorArr.push(A.colorArr[o])), E.faceArr.push(p[o]);
                }
                E.vertexArr.length >= f && (s.push({ vertexArr: [], normalArr: [], faceArr: [] }), A.colorArr && (s.colorArr = []), g++);
              }
              return s;
            }
          }
        ),
        /***/
        "./src/GLViewer.ts": (
          /*!*************************!*\
            !*** ./src/GLViewer.ts ***!
            \*************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CONTEXTS_PER_VIEWPORT: () => (
                /* binding */
                f
              ),
              /* harmony export */
              GLViewer: () => (
                /* binding */
                s
              ),
              /* harmony export */
              createStereoViewer: () => (
                /* binding */
                g
              ),
              /* harmony export */
              createViewer: () => (
                /* binding */
                u
              ),
              /* harmony export */
              createViewerGrid: () => (
                /* binding */
                p
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), l = t(
              /*! ./colors */
              "./src/colors.ts"
            ), h = t(
              /*! ./utilities */
              "./src/utilities.ts"
            ), c = t(
              /*! ./Gradient */
              "./src/Gradient.ts"
            ), d = t(
              /*! ./GLModel */
              "./src/GLModel.ts"
            ), _ = t(
              /*! ./Label */
              "./src/Label.ts"
            ), m = t(
              /*! ./GLShape */
              "./src/GLShape.ts"
            ), y = t(
              /*! ./VolumeData */
              "./src/VolumeData.ts"
            ), x = t(
              /*! ./ProteinSurface4 */
              "./src/ProteinSurface4.ts"
            ), b = t(
              /*! ./VolumetricRender */
              "./src/VolumetricRender.ts"
            ), A = t(
              /*! upng-js */
              "./node_modules/upng-js/UPNG.js"
            );
            const f = 16;
            class s {
              getWidth() {
                let o = this.container, v = o.offsetWidth;
                if (v == 0 && o.style.display === "none") {
                  let M = o.style.position, E = o.style.visibility;
                  o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute", v = o.offsetWidth, o.style.display = "none", o.style.visibility = E, o.style.position = M;
                }
                return v;
              }
              getHeight() {
                let o = this.container, v = o.offsetHeight;
                if (v == 0 && o.style.display === "none") {
                  let M = o.style.position, E = o.style.visibility;
                  o.style.display = "block", o.style.visibility = "hidden", o.style.position = "absolute", v = o.offsetHeight, o.style.display = "none", o.style.visibility = E, o.style.position = M;
                }
                return v;
              }
              setupRenderer() {
                this.renderer = new r.Renderer({
                  antialias: this.config.antialias,
                  preserveDrawingBuffer: !0,
                  premultipliedAlpha: !1,
                  id: this.config.id,
                  row: this.config.row,
                  col: this.config.col,
                  rows: this.config.rows,
                  cols: this.config.cols,
                  canvas: this.config.canvas,
                  //cannot initialize with zero size - render will start out lost
                  containerWidth: this.WIDTH,
                  containerHeight: this.HEIGHT,
                  ambientOcclusion: this.config.ambientOcclusion,
                  outline: this.config.outline
                }), this.renderer.domElement.style.width = "100%", this.renderer.domElement.style.height = "100%", this.renderer.domElement.style.padding = "0", this.renderer.domElement.style.position = "absolute", this.renderer.domElement.style.top = "0px", this.renderer.domElement.style.left = "0px", this.renderer.domElement.style.zIndex = "0";
              }
              initializeScene() {
                this.scene = new r.Scene(), this.scene.fog = new r.Fog(this.bgColor, 100, 200), this.modelGroup = new r.Object3D(), this.rotationGroup = new r.Object3D(), this.rotationGroup.useQuaternion = !0, this.rotationGroup.quaternion = new a.Quaternion(0, 0, 0, 1), this.rotationGroup.add(this.modelGroup), this.scene.add(this.rotationGroup);
                var o = new r.Light(16777215);
                o.position = new a.Vector3(0.2, 0.2, 1).normalize(), o.intensity = 1, this.scene.add(o);
              }
              _handleLostContext(o) {
                const v = function(M) {
                  const E = M.getBoundingClientRect();
                  return !(E.right < 0 || E.bottom < 0 || E.top > (window.innerHeight || document.documentElement.clientHeight) || E.left > (window.innerWidth || document.documentElement.clientWidth));
                };
                if (v(this.container)) {
                  let M = 0;
                  for (let E of document.getElementsByTagName("canvas"))
                    if (v(E) && E._3dmol_viewer != null && (E._3dmol_viewer.resize(), M += 1, M >= f))
                      break;
                }
              }
              initContainer(o) {
                this.container = o, this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(), this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.renderer.setSize(this.WIDTH, this.HEIGHT), this.container.append(this.renderer.domElement), this.glDOM = this.renderer.domElement, this.glDOM._3dmol_viewer = this, this.glDOM.addEventListener("webglcontextlost", this._handleLostContext.bind(this)), this.nomouse || (this.glDOM.addEventListener("mousedown", this._handleMouseDown.bind(this), { passive: !1 }), this.glDOM.addEventListener("touchstart", this._handleMouseDown.bind(this), { passive: !1 }), this.glDOM.addEventListener("wheel", this._handleMouseScroll.bind(this), { passive: !1 }), this.glDOM.addEventListener("mousemove", this._handleMouseMove.bind(this), { passive: !1 }), this.glDOM.addEventListener("touchmove", this._handleMouseMove.bind(this), { passive: !1 }), this.glDOM.addEventListener("contextmenu", this._handleContextMenu.bind(this), { passive: !1 }));
              }
              decAnim() {
                this.animated--, this.animated < 0 && (this.animated = 0);
              }
              incAnim() {
                this.animated++;
              }
              nextSurfID() {
                var o = 0;
                for (let M in this.surfaces)
                  if (this.surfaces.hasOwnProperty(M)) {
                    var v = parseInt(M);
                    isNaN(v) || v > o && (o = v);
                  }
                return o + 1;
              }
              setSlabAndFog() {
                let o = this.camera.position.z - this.rotationGroup.position.z;
                o < 1 && (o = 1), this.camera.near = o + this.slabNear, this.camera.near < 1 && (this.camera.near = 1), this.camera.far = o + this.slabFar, this.camera.near + 1 > this.camera.far && (this.camera.far = this.camera.near + 1), this.camera.fov = this.fov, this.camera.right = o * Math.tan(Math.PI / 180 * this.fov), this.camera.left = -this.camera.right, this.camera.top = this.camera.right / this.ASPECT, this.camera.bottom = -this.camera.top, this.camera.updateProjectionMatrix(), this.scene.fog.near = this.camera.near + this.fogStart * (this.camera.far - this.camera.near), this.scene.fog.far = this.camera.far, this.config.disableFog && (this.scene.fog.near = this.scene.fog.far);
              }
              // display scene
              //if nolink is set/true, don't propagate changes to linked viewers
              show(o) {
                if (this.renderer.setViewport(), !!this.scene && (this.setSlabAndFog(), this.renderer.render(this.scene, this.camera), this.viewChangeCallback && this.viewChangeCallback(this._viewer.getView()), !o && this.linkedViewers.length > 0))
                  for (var v = this._viewer.getView(), M = 0; M < this.linkedViewers.length; M++) {
                    var E = this.linkedViewers[M];
                    E.setView(v, !0);
                  }
              }
              //regenerate the list of clickables
              //also updates hoverables
              updateClickables() {
                this.clickables.splice(0, this.clickables.length), this.hoverables.splice(0, this.hoverables.length), this.contextMenuEnabledObjects.splice(0, this.contextMenuEnabledObjects.length);
                for (let o = 0, v = this.models.length; o < v; o++) {
                  let M = this.models[o];
                  if (M) {
                    let E = M.selectedAtoms({
                      clickable: !0
                    }), $ = M.selectedAtoms({
                      hoverable: !0
                    }), k = M.selectedAtoms({ contextMenuEnabled: !0 });
                    for (let L = 0; L < $.length; L++)
                      this.hoverables.push($[L]);
                    for (let L = 0; L < E.length; L++)
                      this.clickables.push(E[L]);
                    for (let L = 0; L < k.length; L++)
                      this.contextMenuEnabledObjects.push(k[L]);
                  }
                }
                for (let o = 0, v = this.shapes.length; o < v; o++) {
                  let M = this.shapes[o];
                  M && M.clickable && this.clickables.push(M), M && M.hoverable && this.hoverables.push(M), M && M.contextMenuEnabled && this.contextMenuEnabledObjects.push(M);
                }
              }
              // Checks for selection intersects on mousedown
              handleClickSelection(o, v, M) {
                let E = this.targetedObjects(o, v, this.clickables);
                if (E.length) {
                  var $ = E[0].clickable;
                  $.callback !== void 0 && (typeof $.callback != "function" && ($.callback = (0, h.makeFunction)($.callback)), typeof $.callback == "function" && (this.mouseButton === 3 && this.contextMenuEnabledObjects.includes($) && this.userContextMenuHandler || $.callback($, this._viewer, M, this.container, E)));
                }
              }
              //return offset of container
              canvasOffset() {
                let o = this.glDOM, v = o.getBoundingClientRect(), M = o.ownerDocument, E = M.documentElement, $ = M.defaultView;
                return {
                  top: v.top + $.pageYOffset - E.clientTop,
                  left: v.left + $.pageXOffset - E.clientLeft
                };
              }
              //set current_hover to sel (which can be null), calling appropraite callbacks
              setHover(o, v, M) {
                this.current_hover != o && (this.current_hover && (typeof this.current_hover.unhover_callback != "function" && (this.current_hover.unhover_callback = (0, h.makeFunction)(this.current_hover.unhover_callback)), this.current_hover.unhover_callback(this.current_hover, this._viewer, v, this.container, M)), this.current_hover = o, o && o.hover_callback !== void 0 && (typeof o.hover_callback != "function" && (o.hover_callback = (0, h.makeFunction)(o.hover_callback)), typeof o.hover_callback == "function" && o.hover_callback(o, this._viewer, v, this.container, M)));
              }
              //checks for selection intersects on hover
              handleHoverSelection(o, v, M) {
                if (this.hoverables.length == 0)
                  return;
                let E = this.targetedObjects(o, v, this.hoverables);
                if (E.length) {
                  var $ = E[0].clickable;
                  this.setHover($, M, E), this.current_hover = $;
                } else
                  this.setHover(null);
              }
              //sees if the mouse is still on the object that invoked a hover event and if not then the unhover callback is called
              handleHoverContinue(o, v) {
                let M = this.targetedObjects(o, v, this.hoverables);
                (M.length == 0 || M[0] === void 0) && this.setHover(null), M[0] !== void 0 && M[0].clickable !== this.current_hover && this.setHover(null);
              }
              /**
               * Determine if a positioned event is "close enough" to mouseStart to be considered a click.
               * With a mouse, the position should be exact, but allow a slight delta for a touch interface.
               * @param {Event} event
               * @param {{ allowTolerance, tolerance: number }} options
               */
              closeEnoughForClick(o, { allowTolerance: v = o.targetTouches, tolerance: M = 5 } = {}) {
                const E = this.getX(o), $ = this.getY(o);
                if (v) {
                  const k = Math.abs(E - this.mouseStartX), L = Math.abs($ - this.mouseStartY);
                  return k <= M && L <= M;
                } else
                  return E === this.mouseStartX && $ === this.mouseStartY;
              }
              calcTouchDistance(o) {
                var v = o.targetTouches[0].pageX - o.targetTouches[1].pageX, M = o.targetTouches[0].pageY - o.targetTouches[1].pageY;
                return Math.hypot(v, M);
              }
              //check targetTouches as well
              getX(o) {
                var v = o.pageX;
                return v == null && (v = o.pageX), o.targetTouches && o.targetTouches[0] ? v = o.targetTouches[0].pageX : o.changedTouches && o.changedTouches[0] && (v = o.changedTouches[0].pageX), v;
              }
              getY(o) {
                var v = o.pageY;
                return v == null && (v = o.pageY), o.targetTouches && o.targetTouches[0] ? v = o.targetTouches[0].pageY : o.changedTouches && o.changedTouches[0] && (v = o.changedTouches[0].pageY), v;
              }
              //for grid viewers, return true if point is in this viewer
              isInViewer(o, v) {
                if (this.viewers != null) {
                  var M = this.WIDTH / this.cols, E = this.HEIGHT / this.rows, $ = this.canvasOffset(), k = o - $.left, L = v - $.top, z = this.rows - Math.floor(L / E) - 1, O = Math.floor(k / M);
                  if (z != this.row || O != this.col)
                    return !1;
                }
                return !0;
              }
              //if the user has specify zoom limits, readjust to fit within them
              //also, make sure we don't go past CAMERA_Z
              adjustZoomToLimits(o) {
                if (this.config.lowerZoomLimit && this.config.lowerZoomLimit > 0) {
                  let v = this.CAMERA_Z - this.config.lowerZoomLimit;
                  o > v && (o = v);
                }
                if (this.config.upperZoomLimit && this.config.upperZoomLimit > 0) {
                  let v = this.CAMERA_Z - this.config.upperZoomLimit;
                  o < v && (o = v);
                }
                return o > this.CAMERA_Z - 1 && (o = this.CAMERA_Z - 1), o;
              }
              //interpolate between two normalized quaternions (t between 0 and 1)
              //https://en.wikipedia.org/wiki/Slerp
              static slerp(o, v, M) {
                if (M == 1)
                  return v.clone();
                if (M == 0)
                  return o.clone();
                let E = o.x * v.x + o.y * v.y + o.z * v.z + o.w * v.w;
                if (E > 0.9995) {
                  let N = new a.Quaternion(o.x + M * (v.x - o.x), o.y + M * (v.y - o.y), o.z + M * (v.z - o.z), o.w + M * (v.w - o.w));
                  return N.normalize(), N;
                }
                E < 0 && (v = v.clone().multiplyScalar(-1), E = -E), E > 1 ? E = 1 : E < -1 && (E = -1);
                var $ = Math.acos(E), k = $ * M, L = v.clone();
                L.sub(o.clone().multiplyScalar(E)), L.normalize();
                var z = Math.cos(k), O = Math.sin(k), R = new a.Quaternion(o.x * z + L.x * O, o.y * z + L.y * O, o.z * z + L.z * O, o.w * z + L.w * O);
                return R.normalize(), R;
              }
              /* @param {Object} element HTML element within which to create viewer
               * @param {ViewerSpec} config Object containing optional configuration for the viewer
               */
              constructor(o, v = {}) {
                if (this.nomouse = !1, this.glDOM = null, this.models = [], this.surfaces = {}, this.shapes = [], this.labels = [], this.clickables = [], this.hoverables = [], this.contextMenuEnabledObjects = [], this.current_hover = null, this.hoverDuration = 500, this.longTouchDuration = 1e3, this.viewer_frame = 0, this.viewChangeCallback = null, this.stateChangeCallback = null, this.NEAR = 1, this.FAR = 800, this.CAMERA_Z = 150, this.fov = 20, this.linkedViewers = [], this.renderer = null, this.control_all = !1, this.scene = null, this.rotationGroup = null, this.modelGroup = null, this.fogStart = 0.4, this.slabNear = -50, this.slabFar = 50, this.cq = new a.Quaternion(0, 0, 0, 1), this.dq = new a.Quaternion(0, 0, 0, 1), this.animated = 0, this.animationTimers = /* @__PURE__ */ new Set(), this.isDragging = !1, this.mouseStartX = 0, this.mouseStartY = 0, this.touchDistanceStart = 0, this.touchHold = !1, this.currentModelPos = 0, this.cz = 0, this.cslabNear = 0, this.cslabFar = 0, this.userContextMenuHandler = null, this.config = v, this.callback = this.config.callback, this.defaultcolors = this.config.defaultcolors, this.defaultcolors || (this.defaultcolors = l.elementColors.defaultColors), this.nomouse = !!this.config.nomouse, this.bgColor = 0, this.config.backgroundColor = this.config.backgroundColor || "#ffffff", typeof this.config.backgroundColor < "u" && (this.bgColor = l.CC.color(this.config.backgroundColor).getHex()), this.config.backgroundAlpha = this.config.backgroundAlpha == null ? 1 : this.config.backgroundAlpha, this.camerax = 0, typeof this.config.camerax < "u" && (this.camerax = typeof this.config.camerax == "string" ? parseFloat(this.config.camerax) : this.config.camerax), this._viewer = this, this.container = o, this.config.hoverDuration != null && (this.hoverDuration = this.config.hoverDuration), this.config.antialias === void 0 && (this.config.antialias = !0), this.config.cartoonQuality === void 0 && (this.config.cartoonQuality = 10), this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight(), this.setupRenderer(), this.row = this.config.row == null ? 0 : this.config.row, this.col = this.config.col == null ? 0 : this.config.col, this.cols = this.config.cols, this.rows = this.config.rows, this.viewers = this.config.viewers, this.control_all = this.config.control_all, this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.camera = new r.Camera(this.fov, this.ASPECT, this.NEAR, this.FAR, this.config.orthographic), this.camera.position = new a.Vector3(this.camerax, 0, this.CAMERA_Z), this.lookingAt = new a.Vector3(), this.camera.lookAt(this.lookingAt), this.raycaster = new r.Raycaster(new a.Vector3(0, 0, 0), new a.Vector3(0, 0, 0)), this.projector = new r.Projector(), this.initializeScene(), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), this.scene.fog.color = l.CC.color(this.bgColor), document.body.addEventListener("mouseup", this._handleMouseUp.bind(this)), document.body.addEventListener("touchend", this._handleMouseUp.bind(this)), this.initContainer(this.container), this.config.style && this.setViewStyle(this.config), window.addEventListener("resize", this.resize.bind(this)), typeof window.ResizeObserver < "u" && (this.divwatcher = new window.ResizeObserver(this.resize.bind(this)), this.divwatcher.observe(this.container)), typeof window.IntersectionObserver < "u") {
                  let M = (E, $) => {
                    E.forEach((k) => {
                      k.isIntersecting && this.resize();
                    });
                  };
                  this.intwatcher = new window.IntersectionObserver(M), this.intwatcher.observe(this.container);
                }
                try {
                  typeof this.callback == "function" && this.callback(this);
                } catch (M) {
                  console.log("error with glviewer callback: " + M);
                }
              }
              /**
              * Return a list of objects that intersect that at the specified viewer position.
              *
              * @param x - x position in screen coordinates
              * @param y - y position in screen coordinates
              * @param {Object[]} - list of objects or selection object specifying what object to check for targeting
              */
              targetedObjects(o, v, M) {
                var E = {
                  x: o,
                  y: v,
                  z: -1
                };
                return Array.isArray(M) || (M = this.selectedAtoms(M)), M.length == 0 ? [] : (this.raycaster.setFromCamera(E, this.camera), this.raycaster.intersectObjects(this.modelGroup, M));
              }
              /** Convert model coordinates to screen coordinates.
               * @param {object | list} - an object or list of objects with x,y,z attributes (e.g. an atom)
               * @return {object | list} - and object or list of {x: screenX, y: screenY}
               */
              modelToScreen(o) {
                let v = !1;
                Array.isArray(o) || (o = [o], v = !0);
                let M = this.renderer.getXRatio(), E = this.renderer.getYRatio(), $ = this.col, k = this.row, L = $ * (this.WIDTH / M), z = (E - k - 1) * (this.HEIGHT / E), O = [], R = this.canvasOffset();
                return o.forEach((N) => {
                  let W = new a.Vector3(N.x, N.y, N.z);
                  W.applyMatrix4(this.modelGroup.matrixWorld), this.projector.projectVector(W, this.camera);
                  let B = this.WIDTH / M * (W.x + 1) / 2 + R.left + L, P = -(this.HEIGHT / E) * (W.y - 1) / 2 + R.top + z;
                  O.push({ x: B, y: P });
                }), v && (O = O[0]), O;
              }
              /**
               * For a given screen (x,y) displacement return model displacement
               * @param{x} x displacement in screen coordinates
               * @param{y} y displacement in screen corodinates
               * @param{modelz} z coordinate in model coordinates to compute offset for, default is model axis
              */
              screenOffsetToModel(o, v, M) {
                var E = o / this.WIDTH, $ = v / this.HEIGHT, k = M === void 0 ? this.rotationGroup.position.z : M, L = this.rotationGroup.quaternion, z = new a.Vector3(0, 0, k);
                return this.projector.projectVector(z, this.camera), z.x += E * 2, z.y -= $ * 2, this.projector.unprojectVector(z, this.camera), z.z = 0, z.applyQuaternion(L), z;
              }
              /**
               * Distance from screen coordinate to model coordinate assuming screen point
               * is projected to the same depth as model coordinate
               * @param{screen} xy screen coordinate
               * @param{model} xyz model coordinate
              */
              screenToModelDistance(o, v) {
                let M = this.canvasOffset(), E = new a.Vector3(v.x, v.y, v.z);
                E.applyMatrix4(this.modelGroup.matrixWorld);
                let $ = E.clone();
                this.projector.projectVector(E, this.camera);
                let k = new a.Vector3((o.x - M.left) * 2 / this.WIDTH - 1, (o.y - M.top) * 2 / -this.HEIGHT + 1, E.z);
                return this.projector.unprojectVector(k, this.camera), k.distanceTo($);
              }
              /**
               * Set a callback to call when the view has potentially changed.
               *
              */
              setViewChangeCallback(o) {
                (typeof o == "function" || o == null) && (this.viewChangeCallback = o);
              }
              /**
               * Set a callback to call when the view has potentially changed.
               *
              */
              setStateChangeCallback(o) {
                (typeof o == "function" || o == null) && (this.stateChangeCallback = o);
              }
              /**
               * Return configuration of viewer
               */
              getConfig() {
                return this.config;
              }
              /**
               * Set the configuration object.  Note that some settings may only
               * have an effect at viewer creation time.
               */
              setConfig(o) {
                this.config = o, o.ambientOcclusion && this.renderer.enableAmbientOcclusion(o.ambientOcclusion);
              }
              /**
               * Return object representing internal state of
               * the viewer appropriate for passing to setInternalState
               *
              */
              getInternalState() {
                var o = { models: [], surfaces: [], shapes: [], labels: [] };
                for (let v = 0; v < this.models.length; v++)
                  this.models[v] && (o.models[v] = this.models[v].getInternalState());
                return o;
              }
              /**
               * Overwrite internal state of the viewer with passed  object
               * which should come from getInternalState.
               *
              */
              setInternalState(o) {
                this.clear();
                var v = o.models;
                for (let M = 0; M < v.length; M++)
                  v[M] && (this.models[M] = new d.GLModel(M), this.models[M].setInternalState(v[M]));
                this.render();
              }
              /**
               * Set lower and upper limit stops for zoom.
               *
               * @param {lower} - limit on zoom in (positive number).  Default 0.
               * @param {upper} - limit on zoom out (positive number).  Default infinite.
               * @example
                $3Dmol.get("data/set1_122_complex.mol2", function(moldata) {
                      var m = viewer.addModel(moldata);
                      viewer.setStyle({stick:{colorscheme:"Jmol"}});
                      viewer.setZoomLimits(100,200);
                      viewer.zoomTo();
                      viewer.zoom(10); //will not zoom all the way
                      viewer.render();
                  });
              */
              setZoomLimits(o, v) {
                typeof o < "u" && (this.config.lowerZoomLimit = o), v && (this.config.upperZoomLimit = v), this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show();
              }
              /**
               * Set camera parameters (distance to the origin and field of view)
               *
               * @param {parameters} - new camera parameters, with possible fields
               *                       being fov for the field of view, z for the
               *                       distance to the origin, and orthographic (boolean)
               *                       for kind of projection (default false).
               * @example
                $3Dmol.get("data/set1_122_complex.mol2", function(data) {
                      var m = viewer.addModel(data);
                      viewer.setStyle({stick:{}});
                      viewer.zoomTo();
                      viewer.setCameraParameters({ fov: 10 , z: 300 });
                      viewer.render();
                  });
              */
              setCameraParameters(o) {
                o.fov !== void 0 && (this.fov = o.fov, this.camera.fov = this.fov), o.z !== void 0 && (this.CAMERA_Z = o.z, this.camera.z = this.CAMERA_Z), o.orthographic !== void 0 && (this.camera.ortho = o.orthographic);
              }
              _handleMouseDown(o) {
                if (o.preventDefault(), !this.scene)
                  return;
                var v = this.getX(o), M = this.getY(o);
                if (v === void 0)
                  return;
                this.isDragging = !0, this.mouseButton = o.which, this.mouseStartX = v, this.mouseStartY = M, this.touchHold = !0, this.touchDistanceStart = 0, o.targetTouches && o.targetTouches.length == 2 && (this.touchDistanceStart = this.calcTouchDistance(o)), this.cq = this.rotationGroup.quaternion.clone(), this.cz = this.rotationGroup.position.z, this.currentModelPos = this.modelGroup.position.clone(), this.cslabNear = this.slabNear, this.cslabFar = this.slabFar;
                let E = this;
                o.targetTouches && o.targetTouches.length === 1 && (this.longTouchTimeout = setTimeout(function() {
                  if (E.touchHold == !0) {
                    E.glDOM = E.renderer.domElement;
                    const $ = o.targetTouches[0], k = new PointerEvent("contextmenu", Object.assign(Object.assign({}, o), { pageX: $.pageX, pageY: $.pageY, screenX: $.screenX, screenY: $.screenY, clientX: $.clientX, clientY: $.clientY }));
                    E.glDOM.dispatchEvent(k);
                  }
                }, this.longTouchDuration));
              }
              _handleMouseUp(o) {
                if (this.touchHold = !1, this.isDragging && this.scene) {
                  var v = this.getX(o), M = this.getY(o);
                  if (this.closeEnoughForClick(o) && this.isInViewer(v, M)) {
                    let E = this.mouseXY(v, M);
                    this.handleClickSelection(E.x, E.y, o);
                  }
                }
                this.isDragging = !1;
              }
              _handleMouseScroll(o) {
                if (o.preventDefault(), !!this.scene) {
                  var v = this.getX(o), M = this.getY(o);
                  if (v !== void 0 && !(!this.control_all && !this.isInViewer(v, M))) {
                    var E = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, $ = 1;
                    if (o.ctrlKey && ($ = -1), o.detail)
                      this.rotationGroup.position.z += $ * E * o.detail / 10;
                    else if (o.wheelDelta) {
                      let k = o.wheelDelta * 600 / (o.wheelDelta + 600);
                      this.rotationGroup.position.z -= $ * E * k / 400;
                    }
                    this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z), this.show();
                  }
                }
              }
              /**
               * Return image URI of viewer contents (base64 encoded).     *
               */
              pngURI() {
                return this.getCanvas().toDataURL("image/png");
              }
              /**
               * Return a promise that resolves to an animated PNG image URI of
               viewer contents (base64 encoded) for nframes of viewer changes.
               * @return {Promise}
               */
              apngURI(o) {
                let v = this;
                return o = o || 1, new Promise(function(M) {
                  let E = 0, $ = v.viewChangeCallback, k = [], L = [], z = Date.now();
                  v.viewChangeCallback = function() {
                    L.push(Date.now() - z), z = Date.now(), k.push(new Promise((O) => {
                      v.getCanvas().toBlob(function(R) {
                        R.arrayBuffer().then(O);
                      }, "image/png");
                    })), E += 1, E == o && (v.viewChangeCallback = $, Promise.all(k).then((O) => {
                      let R = [];
                      for (let H = 0; H < O.length; H++) {
                        let U = (0, A.decode)(O[H]);
                        R.push((0, A.toRGBA8)(U)[0]);
                      }
                      let N = v.getCanvas().width, W = v.getCanvas().height, B = (0, A.encode)(R, N, W, 0, L), P = new Blob([B], { type: "image/png" }), G = new FileReader();
                      G.onload = function(H) {
                        M(H.target.result);
                      }, G.readAsDataURL(P);
                    }));
                  };
                });
              }
              /**
               * Return underlying canvas element.
               */
              getCanvas() {
                return this.glDOM;
              }
              /**
               * Return renderer element.
               */
              getRenderer() {
                return this.renderer;
              }
              /**
                   * Set the duration of the hover delay
                   *
                   * @param {number}
                   *            [hoverDuration] - an optional parameter that denotes
                   *            the duration of the hover delay (in milliseconds) before the hover action is called
                   *
               */
              setHoverDuration(o) {
                this.hoverDuration = o;
              }
              mouseXY(o, v) {
                let M = this.canvasOffset(), E = this.renderer.getXRatio(), $ = this.renderer.getYRatio(), k = this.col, L = this.row, z = k * (this.WIDTH / E), O = ($ - L - 1) * (this.HEIGHT / $), R = (o - M.left - z) / (this.WIDTH / E) * 2 - 1, N = -((v - M.top - O) / (this.HEIGHT / $)) * 2 + 1;
                return { x: R, y: N };
              }
              _handleMouseMove(o) {
                clearTimeout(this.hoverTimeout), o.preventDefault();
                let v = this.getX(o), M = this.getY(o);
                if (v === void 0)
                  return;
                let E = this.renderer.getXRatio(), $ = this.renderer.getYRatio(), k = this.mouseXY(v, M), L = this;
                this.current_hover !== null && this.handleHoverContinue(k.x, k.y);
                var z = 0;
                if (!(!this.control_all && !this.isInViewer(v, M)) && this.scene && (this.hoverables.length > 0 && (this.hoverTimeout = setTimeout(function() {
                  L.handleHoverSelection(k.x, k.y, o);
                }, this.hoverDuration)), !!this.isDragging)) {
                  o.targetTouches && (o.targetTouches.length > 1 || o.targetTouches.length === 1 && !this.closeEnoughForClick(o)) && clearTimeout(this.longTouchTimeout);
                  var O = (v - this.mouseStartX) / this.WIDTH, R = (M - this.mouseStartY) / this.HEIGHT;
                  if (this.touchDistanceStart != 0 && o.targetTouches && o.targetTouches.length == 2) {
                    var N = this.calcTouchDistance(o);
                    z = 2, R = (N - this.touchDistanceStart) * 2 / (this.WIDTH + this.HEIGHT);
                  } else o.targetTouches && o.targetTouches.length == 3 && (z = 1);
                  O *= E, R *= $;
                  var W = Math.hypot(O, R), B;
                  if (z == 3 || this.mouseButton == 3 && o.ctrlKey)
                    this.slabNear = this.cslabNear + O * 100, this.slabFar = this.cslabFar - R * 100;
                  else if (z == 2 || this.mouseButton == 3 || o.shiftKey)
                    B = (this.CAMERA_Z - this.rotationGroup.position.z) * 0.85, B < 80 && (B = 80), this.rotationGroup.position.z = this.cz + R * B, this.rotationGroup.position.z = this.adjustZoomToLimits(this.rotationGroup.position.z);
                  else if (z == 1 || this.mouseButton == 2 || o.ctrlKey) {
                    var P = this.screenOffsetToModel(E * (v - this.mouseStartX), $ * (M - this.mouseStartY));
                    this.modelGroup.position.addVectors(this.currentModelPos, P);
                  } else if ((z === 0 || this.mouseButton == 1) && W !== 0) {
                    var G = Math.sin(W * Math.PI) / W;
                    this.dq.x = Math.cos(W * Math.PI), this.dq.y = 0, this.dq.z = G * O, this.dq.w = -G * R, this.rotationGroup.quaternion.set(1, 0, 0, 0), this.rotationGroup.quaternion.multiply(this.dq), this.rotationGroup.quaternion.multiply(this.cq);
                  }
                  this.show();
                }
              }
              _handleContextMenu(o) {
                if (o.preventDefault(), this.closeEnoughForClick(o)) {
                  var E = this.mouseStartX, $ = this.mouseStartY, M = this.canvasOffset();
                  let k = this.mouseXY(E, $), L = k.x, z = k.y, O = this.targetedObjects(L, z, this.contextMenuEnabledObjects);
                  var v = null;
                  O.length && (v = O[0].clickable);
                  var M = this.canvasOffset(), E = this.mouseStartX - M.left, $ = this.mouseStartY - M.top;
                  this.userContextMenuHandler && (this.userContextMenuHandler(v, E, $, O, o), this.isDragging = !1);
                }
              }
              /**
              	     * Change the viewer's container element
              	     * Also useful if the original container element was removed from the DOM.
              	     *
              	     * @param {Object | string} element
              	     *            Either HTML element or string identifier. Defaults to the element used to initialize the viewer.
              
              	     */
              setContainer(o) {
                let v = (0, h.getElement)(o) || this.container;
                return this.initContainer(v), this;
              }
              /**
              	     * Set the background color (default white)
              	     *
              	     * @param {number}
              	     *            hex Hexcode specified background color, or standard color spec
              	     * @param {number}
              	     *            a Alpha level (default 1.0)
              	     *
              	     * @example
              	     *
              	     * viewer.setBackgroundColor("green",0.5);
              
              
              	     *
              	     */
              setBackgroundColor(o, v) {
                (typeof v > "u" || v < 0 || v > 1) && (v = 1);
                var M = l.CC.color(o);
                return this.scene.fog.color = M, this.bgColor = M.getHex(), this.renderer.setClearColorHex(M.getHex(), v), this.show(), this;
              }
              /**
              	     * Set view projection scheme.  Either orthographic or perspective.
              	     * Default is perspective.  Orthographic can also be enabled on viewer creation
              	     * by setting orthographic to true in the config object.
              	     *
              	     *
              	     * @example
              	     viewer.setViewStyle({style:"outline"});
              	          $3Dmol.get('data/1fas.pqr', function(data){
              	              viewer.addModel(data, "pqr");
              	              $3Dmol.get("data/1fas.cube",function(volumedata){
              	                  viewer.addSurface($3Dmol.SurfaceType.VDW, {opacity:0.85,voldata: new $3Dmol.VolumeData(volumedata, "cube"), volscheme: new $3Dmol.Gradient.RWB(-10,10)},{});
              	              });
              	              viewer.zoomTo();
              
              	              viewer.setProjection("orthographic");
              	              viewer.render(callback);
              	          });
              	     *
              	     */
              setProjection(o) {
                this.camera.ortho = o === "orthographic", this.setSlabAndFog();
              }
              /**
               * Set global view styles.
               *
               * @example
               *   viewer.setViewStyle({style:"outline"});
                    $3Dmol.get('data/1fas.pqr', function(data){
                        viewer.addModel(data, "pqr");
                        $3Dmol.get("data/1fas.cube",function(volumedata){
                            viewer.addSurface($3Dmol.SurfaceType.VDW, {opacity:0.85,voldata: new $3Dmol.VolumeData(volumedata, "cube"), volscheme: new $3Dmol.Gradient.RWB(-10,10)},{});
                        });
                        viewer.zoomTo();
                        viewer.render(callback);
                    });
               *
               */
              setViewStyle(o) {
                if (o = o || {}, o.style = o.style || "", o.style.includes("outline") ? this.renderer.enableOutline(o) : this.renderer.disableOutline(), o.style.includes("ambientOcclusion")) {
                  var v = {};
                  o.strength && (v.strength = o.strength), o.radius && (v.radius = o.radius), this.renderer.enableAmbientOcclusion(v);
                } else
                  this.renderer.disableAmbientOcclusion();
                return this;
              }
              updateSize() {
                this.renderer.setSize(this.WIDTH, this.HEIGHT), this.ASPECT = this.renderer.getAspect(this.WIDTH, this.HEIGHT), this.renderer.setSize(this.WIDTH, this.HEIGHT), this.camera.aspect = this.ASPECT, this.camera.updateProjectionMatrix();
              }
              /**
               * Set viewer width independently of the HTML container.  This is probably not what you want.
               *
               * @param {number} w Width in pixels
               */
              setWidth(o) {
                return this.WIDTH = o || this.WIDTH, this.updateSize(), this;
              }
              /**
               * Set viewer height independently of the HTML container.  This is probably not what you want.
               *
               * @param {number} h Height in pixels
               */
              setHeight(o) {
                return this.HEIGHT = o || this.HEIGHT, this.updateSize(), this;
              }
              /**
               * Resize viewer according to containing HTML element's dimensions
               *
               */
              resize() {
                this.WIDTH = this.getWidth(), this.HEIGHT = this.getHeight();
                let o = !1;
                if (this.renderer.isLost() && this.WIDTH > 0 && this.HEIGHT > 0) {
                  let v = !1, M = this.container.querySelector("canvas");
                  M && M != this.renderer.getCanvas() ? this.config.canvas = M : (M.remove(), this.config && this.config.canvas != null && (delete this.config.canvas, v = !0)), this.setupRenderer(), this.initContainer(this.container), this.renderer.setClearColorHex(this.bgColor, this.config.backgroundAlpha), o = !0, v && (this.config.canvas = this.renderer.getCanvas());
                }
                if (this.WIDTH == 0 || this.HEIGHT == 0 ? this.animated && this._viewer.pauseAnimate() : this.animated && this._viewer.resumeAnimate(), this.updateSize(), o) {
                  let v = this.renderer.supportedExtensions();
                  if (v.regen = !0, this.viewers)
                    for (let M = 0, E = this.viewers.length; M < E; M++)
                      for (let $ = 0, k = this.viewers[M].length; $ < k; $++)
                        this.viewers[M][$].render(null, v);
                  this._viewer.render(null, v);
                } else
                  this.show();
                return this;
              }
              /**
               * Return specified model
               *
               * @param {number}
               *            [id=last model id] - Retrieve model with specified id
               * @default Returns last model added to viewer or null if there are no models
               * @return {GLModel}
               *
               * @example // Retrieve reference to first GLModel added var m =
               *    $3Dmol.download("pdb:1UBQ",viewer,{},function(m1){
                        $3Dmol.download("pdb:1UBI", viewer,{}, function(m2) {
                          viewer.zoomTo();
                          m1.setStyle({cartoon: {color:'green'}});
                          //could use m2 here as well
                          viewer.getModel().setStyle({cartoon: {color:'blue'}});
                          viewer.render();
                      })
                    });
               */
              getModel(o) {
                return o === void 0 ? this.models.length == 0 ? null : this.models[this.models.length - 1] : o instanceof d.GLModel ? o : o in this.models ? this.models[o] : this.models.length == 0 ? null : this.models[this.models.length - 1];
              }
              /**
               * Continuously rotate a scene around the specified axis.
               *
               * Call `spin(false)` to stop spinning.
               *
               * @param  {string|boolean|Array} axis
               *            [axis] - Axis ("x", "y", "z", "vx", "vy", or "vz") to rotate around.
               *            Default "y".  View relative (rather than model relative) axes are prefixed with v.
               * @param  {number} speed
               *            [speed] - Speed multiplier for spinning the viewer. 1 is default and a negative
               *             value reverses the direction of the spin.
               *
               */
              spin(o, v = 1) {
                if (clearInterval(this.spinInterval), typeof o > "u" && (o = "y"), typeof o == "boolean")
                  if (o)
                    o = "y";
                  else
                    return;
                Array.isArray(o) && (o = { x: o[0], y: o[1], z: o[2] });
                var M = this;
                this.spinInterval = setInterval(function() {
                  !M.getCanvas().isConnected && M.renderer.isLost() && clearInterval(M.spinInterval), M.rotate(1 * v, o);
                }, 25);
              }
              //animate motion between current position and passed position
              // can set some parameters to null
              //if fixed is true will enforce the request animation, otherwise
              //does relative updates
              //positions objects have modelggroup position, rotation group position.z,
              //and rotationgroup quaternion
              //return array includes final position, but not current
              //the returned array includes an animate method
              animateMotion(o, v, M, E, $, k) {
                var L = 20, z = Math.ceil(o / L);
                z < 1 && (z = 1), this.incAnim();
                var O = {
                  mpos: this.modelGroup.position.clone(),
                  rz: this.rotationGroup.position.z,
                  rot: this.rotationGroup.quaternion.clone(),
                  cam: this.lookingAt.clone()
                };
                if (v) {
                  let W = new Array(z);
                  for (let H = 0; H < z; H++) {
                    let U = (H + 1) / z, j = { mpos: O.mpos, rz: O.rz, rot: O.rot };
                    j.mpos = M.clone().sub(O.mpos).multiplyScalar(U).add(O.mpos), j.rz = O.rz + U * (E - O.rz), j.rot = s.slerp(O.rot, $, U), j.cam = k.clone().sub(O.cam).multiplyScalar(U).add(O.cam), W[H] = j;
                  }
                  let B = 0, P = this, G = function() {
                    var H = W[B];
                    B += 1, P.modelGroup.position = H.mpos, P.rotationGroup.position.z = H.rz, P.rotationGroup.quaternion = H.rot, P.camera.lookAt(H.cam), B < W.length ? setTimeout(G, L) : P.decAnim(), P.show();
                  };
                  setTimeout(G, L);
                } else {
                  var R = {};
                  let W = 1 / z;
                  if (M && (R.mpos = M.clone().sub(O.mpos).multiplyScalar(W)), typeof E < "u" && E != null && (R.rz = W * (E - O.rz)), $) {
                    var N = s.slerp(O.rot, $, W);
                    R.rot = O.rot.clone().inverse().multiply(N);
                  }
                  k && (R.cam = k.clone().sub(O.cam).multiplyScalar(W));
                  let B = 0, P = this, G = function() {
                    B += 1, R.mpos && P.modelGroup.position.add(R.mpos), R.rz && (P.rotationGroup.position.z += R.rz), R.rot && P.rotationGroup.quaternion.multiply(R.rot), R.cam && (P.lookingAt.add(R.cam), P.camera.lookAt(P.lookingAt)), B < z ? setTimeout(G, L) : P.decAnim(), P.show();
                  };
                  setTimeout(G, L);
                }
              }
              /**
              	     * Rotate scene by angle degrees around axis
              	     *
              	     * @param {number}
              	     *            [angle] - Angle, in degrees, to rotate by.
              	     * @param {string}
              	     *            [axis] - Axis ("x", "y", "z", "vx", "vy", or "vz") to rotate around.
              	     *            Default "y".  View relative (rather than model relative) axes are prefixed with v.
              	     *            Axis can also be specified as a vector.
              	     * @param {number}
              	     *            [animationDuration] - an optional parameter that denotes
              	     *            the duration of the rotation animation. Default 0 (no animation)
              	     * @param {boolean} [fixedPath] - if true animation is constrained to
              	     *      requested motion, overriding updates that happen during the animation         *
              	     * @example     $3Dmol.download('cid:4000', viewer, {}, function() {
              	    viewer.setStyle({stick:{}});
              	    viewer.zoomTo();
              	    viewer.rotate(90,'y',1);
              	    viewer.render(callback);
              	    });
              
              	     *
              	     */
              rotate(o, v = "y", M = 0, E = !1) {
                if (v == "x" ? v = { x: 1, y: 0, z: 0 } : v == "y" ? v = { x: 0, y: 1, z: 0 } : v == "z" && (v = { x: 0, y: 0, z: 1 }), v == "vx" ? v = { vx: 1, vy: 0, vz: 0 } : v == "vy" ? v = { vx: 0, vy: 1, vz: 0 } : v == "vz" && (v = { vx: 0, vy: 0, vz: 1 }), typeof v.vx < "u") {
                  var $ = new a.Vector3(v.vx, v.vy, v.vz);
                  $.applyQuaternion(this.rotationGroup.quaternion), v = { x: $.x, y: $.y, z: $.z };
                }
                var k = function(R) {
                  var N = Math.sin(R / 2), W = Math.cos(R / 2), B = 0, P = 0, G = 0;
                  return B = v.x * N, P = v.y * N, G = v.z * N, new a.Quaternion(B, P, G, W).normalize();
                }, L = Math.PI * o / 180, z = k(L);
                if (M) {
                  var O = new a.Quaternion().copy(this.rotationGroup.quaternion).multiply(z);
                  this.animateMotion(M, E, this.modelGroup.position, this.rotationGroup.position.z, O, this.lookingAt);
                } else
                  this.rotationGroup.quaternion.multiply(z), this.show();
                return this;
              }
              surfacesFinished() {
                for (var o in this.surfaces)
                  if (!this.surfaces[o][0].done)
                    return !1;
                return !0;
              }
              /** Returns an array representing the current viewpoint.
               * Translation, zoom, and rotation quaternion.
               * @returns {Array.<number>} [ pos.x, pos.y, pos.z, rotationGroup.position.z, q.x, q.y, q.z, q.w ]
               *  */
              getView() {
                if (!this.modelGroup)
                  return [0, 0, 0, 0, 0, 0, 0, 1];
                var o = this.modelGroup.position, v = this.rotationGroup.quaternion;
                return [
                  o.x,
                  o.y,
                  o.z,
                  this.rotationGroup.position.z,
                  v.x,
                  v.y,
                  v.z,
                  v.w
                ];
              }
              /** Sets the view to the specified translation, zoom, and rotation.
               *
               * @param {Array.<number>} arg Array formatted identically to the return value of getView */
              setView(o, v) {
                return o === void 0 || !(o instanceof Array || o.length !== 8) ? this : !this.modelGroup || !this.rotationGroup ? this : (this.modelGroup.position.x = o[0], this.modelGroup.position.y = o[1], this.modelGroup.position.z = o[2], this.rotationGroup.position.z = o[3], this.rotationGroup.quaternion.x = o[4], this.rotationGroup.quaternion.y = o[5], this.rotationGroup.quaternion.z = o[6], this.rotationGroup.quaternion.w = o[7], typeof o[8] < "u" && (this.rotationGroup.position.x = o[8], this.rotationGroup.position.y = o[9]), this.show(v), this);
              }
              // apply styles, models, etc in viewer
              /**
               * Render current state of viewer, after
               * adding/removing models, applying styles, etc.
               *
               */
              render(o, v) {
                this.renderer.setViewport(), this.updateClickables();
                var M = this.getView();
                this.stateChangeCallback && this.stateChangeCallback(this.getInternalState());
                var E, $;
                for (v || (v = this.renderer.supportedExtensions()), E = 0; E < this.models.length; E++)
                  this.models[E] && this.models[E].globj(this.modelGroup, v);
                for (E = 0; E < this.shapes.length; E++)
                  this.shapes[E] && (typeof this.shapes[E].frame > "u" || this.viewer_frame < 0 || this.shapes[E].frame < 0 || this.shapes[E].frame == this.viewer_frame ? this.shapes[E].globj(this.modelGroup, v) : this.shapes[E].removegl(this.modelGroup));
                for (E = 0; E < this.labels.length; E++)
                  v.regen && (this.labels[E].dispose(), this.modelGroup.remove(this.labels[E].sprite), this.labels[E].setContext(), this.modelGroup.add(this.labels[E].sprite)), this.labels[E] && typeof this.labels[E].frame < "u" && this.labels[E].frame >= 0 && (this.modelGroup.remove(this.labels[E].sprite), (this.viewer_frame < 0 || this.labels[E].frame == this.viewer_frame) && this.modelGroup.add(this.labels[E].sprite));
                for (E in this.surfaces)
                  if (this.surfaces.hasOwnProperty(E)) {
                    var k = this.surfaces[E];
                    for ($ = 0; $ < k.length; $++)
                      if (k.hasOwnProperty($)) {
                        var L = k[$].geo;
                        if (!k[$].finished || v.regen) {
                          L.verticesNeedUpdate = !0, L.elementsNeedUpdate = !0, L.normalsNeedUpdate = !0, L.colorsNeedUpdate = !0, L.buffersNeedUpdate = !0, k[$].mat.needsUpdate = !0, k[$].done && (k[$].finished = !0), k[$].lastGL && this.modelGroup.remove(k[$].lastGL);
                          var z = null;
                          if (k[$].mat instanceof r.LineBasicMaterial ? z = new r.Line(L, k[$].mat) : z = new r.Mesh(L, k[$].mat), k[$].mat.transparent && k[$].mat.opacity == 0 ? z.visible = !1 : z.visible = !0, k[$].symmetries.length > 1 || k[$].symmetries.length == 1 && !k[$].symmetries[$].isIdentity()) {
                            var O, R = new r.Object3D();
                            for (O = 0; O < k[$].symmetries.length; O++) {
                              var N = z.clone();
                              N.matrix = k[$].symmetries[O], N.matrixAutoUpdate = !1, R.add(N);
                            }
                            k[$].lastGL = R, this.modelGroup.add(R);
                          } else
                            k[$].lastGL = z, this.modelGroup.add(z);
                        }
                      }
                  }
                return this.setView(M), typeof o == "function" && o(this), this;
              }
              /* @param {AtomSelectionSpec|any} sel
               * @return list of models specified by sel
               */
              getModelList(o) {
                let v = [];
                if (typeof o > "u" || typeof o.model > "u")
                  for (let E = 0; E < this.models.length; E++)
                    this.models[E] && v.push(this.models[E]);
                else {
                  let E = o.model;
                  Array.isArray(E) || (E = [E]);
                  for (let $ = 0; $ < E.length; $++)
                    if (typeof E[$] == "number") {
                      var M = E[$];
                      M < 0 && (M += this.models.length), v.push(this.models[M]);
                    } else
                      v.push(E[$]);
                }
                return v;
              }
              /**
               *
               * @param {AtomSelectionSpec}
               *            sel
               * @return {AtomSpec[]}
               */
              getAtomsFromSel(o) {
                var v = [];
                typeof o > "u" && (o = {});
                var M = this.getModelList(o);
                for (let E = 0; E < M.length; E++)
                  v = v.concat(M[E].selectedAtoms(o));
                return v;
              }
              /**
               *
               * @param {AtomSpec}
               *            atom
               * @param {AtomSelectionSpec}
               *            sel
               * @return {boolean}
               */
              atomIsSelected(o, v) {
                typeof v > "u" && (v = {});
                for (var M = this.getModelList(v), E = 0; E < M.length; E++)
                  if (M[E].atomIsSelected(o, v))
                    return !0;
                return !1;
              }
              /** return list of atoms selected by sel
               *
               * @param {AtomSelectionSpec} sel
               * @return {AtomSpec[]}
               */
              selectedAtoms(o) {
                return this.getAtomsFromSel(o);
              }
              /**
              * Returns valid values for the specified attribute in the given selection
              * @param {string} attribute
              * @param {AtomSelectionSpec} sel
              * @return {Array.<Object>}
              *
              */
              getUniqueValues(o, v) {
                typeof v > "u" && (v = {});
                var M = this.getAtomsFromSel(v), E = {};
                for (var $ in M)
                  if (M[$].hasOwnProperty(o)) {
                    var k = M[$][o];
                    E[k] = !0;
                  }
                return Object.keys(E);
              }
              /**
               * Return pdb output of selected atoms (if atoms from pdb input)
               *
               * @param {AtomSelectionSpec} sel - Selection specification specifying model and atom properties to select.  Default: all atoms in viewer
               * @return {string} PDB string of selected atoms
               */
              pdbData(o) {
                for (var v = this.getAtomsFromSel(o), M = "", E = 0, $ = v.length; E < $; ++E)
                  M += v[E].pdbline + `
`;
                return M;
              }
              /**
              	     * Zoom current view by a constant factor
              	     *
              	     * @param {number}
              	     *            [factor] - Magnification factor. Values greater than 1
              	     *            will zoom in, less than one will zoom out. Default 2.
              	     * @param {number}
              	     *            [animationDuration] - an optional parameter that denotes
              	     *            the duration of a zoom animation
              	     * @param {Boolean} [fixedPath] - if true animation is constrained to
              	     *      requested motion, overriding updates that happen during the animation
              	     * @example
              	    $3Dmol.get('data/4csv.pdb', function(data) {
              	    viewer.addModel(data,'pdb');
              	    viewer.setStyle({cartoon:{},stick:{}});
              	    viewer.zoomTo()
              	    viewer.zoom(2,1000);
              	    viewer.render();
              	    });
              
              	         */
              zoom(o = 2, v = 0, M = !1) {
                var E = (this.CAMERA_Z - this.rotationGroup.position.z) / o, $ = this.CAMERA_Z - E;
                return v > 0 ? this.animateMotion(v, M, this.modelGroup.position, this.adjustZoomToLimits($), this.rotationGroup.quaternion, this.lookingAt) : (this.rotationGroup.position.z = this.adjustZoomToLimits($), this.show()), this;
              }
              /**
               * Translate current view by x,y screen coordinates
               * This pans the camera rather than translating the model.
               *
               * @param {number} x Relative change in view coordinates of camera
               * @param {number} y Relative change in view coordinates of camera
               * @param {number}
               *            [animationDuration] - an optional parameter that denotes
               *            the duration of a zoom animation
               * @param {Boolean} [fixedPath] - if true animation is constrained to
               *      requested motion, overriding updates that happen during the animation         *
               * @example     $3Dmol.get('data/4csv.pdb', function(data) {
              viewer.addModel(data,'pdb');
              viewer.setStyle({cartoon:{},stick:{}});
              viewer.zoomTo();
              viewer.translate(200,50);
              viewer.rotate(90,'z');
              viewer.render(callback);
              });
               */
              translate(o, v, M = 0, E = !1) {
                var $ = o / this.WIDTH, k = v / this.HEIGHT, L = new a.Vector3(0, 0, -this.CAMERA_Z);
                this.projector.projectVector(L, this.camera), L.x -= $, L.y -= k, this.projector.unprojectVector(L, this.camera), L.z = 0;
                var z = this.lookingAt.clone().add(L);
                return M > 0 ? this.animateMotion(M, E, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, z) : (this.lookingAt = z, this.camera.lookAt(this.lookingAt), this.show()), this;
              }
              /**
               * Translate current models by x,y screen coordinates
               * This translates the models relative to the current view. It does
               * not change the center of rotation.
               *
               * @param {number} x Relative change in x screen coordinate
               * @param {number} y Relative change in y screen coordinate
               * @param {number}
               *            [animationDuration] - an optional parameter that denotes
               *            the duration of a zoom animation
               * @param {Boolean} [fixedPath] - if true animation is constrained to
               *      requested motion, overriding updates that happen during the animation         *
               * @example     $3Dmol.get('data/4csv.pdb', function(data) {
              viewer.addModel(data,'pdb');
              viewer.setStyle({cartoon:{},stick:{}});
              viewer.zoomTo();
              viewer.translateScene(200,50);
              viewer.rotate(90,'z'); // will no longer be around model center
              viewer.render(callback);
              });
               */
              translateScene(o, v, M = 0, E = !1) {
                var $ = this.screenOffsetToModel(o, v), k = this.modelGroup.position.clone().add($);
                return M > 0 ? this.animateMotion(M, E, this.modelGroup.position, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = k, this.show()), this;
              }
              /**
               * Adjust slab to fully enclose selection (default everything).
               *
               * @param {AtomSelectionSpec} sel
               *            Selection specification specifying model and atom
               *            properties to select. Default: all atoms in viewer
               */
              fitSlab(o) {
                o = o || {};
                var v = this.getAtomsFromSel(o), M = (0, h.getExtent)(v), E = M[1][0] - M[0][0], $ = M[1][1] - M[0][1], k = M[1][2] - M[0][2], L = Math.hypot(E, $, k);
                return L < 5 && (L = 5), this.slabNear = -L / 1.9, this.slabFar = L / 2, this;
              }
              /**
               * Re-center the viewer around the provided selection (unlike zoomTo, does not zoom).
               *
               * @param {AtomSelectionSpec}
               *            [sel] - Selection specification specifying model and atom
               *            properties to select. Default: all atoms in viewer
               * @param {number}
               *            [animationDuration] - an optional parameter that denotes
               *            the duration of a zoom animation
               * @param {Boolean} [fixedPath] - if true animation is constrained to
               *      requested motion, overriding updates that happen during the animation         *
               * @example // if the user were to pass the animationDuration value to
               *           // the function like so viewer.zoomTo({resn:'STI'},1000);
               *         //   the program would center on resn 'STI' over the course
               *         //   of 1 second(1000 milleseconds).
               *  // Reposition to centroid of all atoms of all models in this
               * //viewer glviewer.center();
              $3Dmol.get('data/4csv.pdb', function(data) {
              viewer.addModel(data,'pdb');
              viewer.setStyle({cartoon:{},stick:{}});
              viewer.center();
              viewer.render(callback);
              });
               */
              center(o = {}, v = 0, M = !1) {
                var E, $, k = this.getAtomsFromSel(o), L = (0, h.getExtent)(k);
                (0, h.isEmptyObject)(o) ? (this.shapes.forEach((U) => {
                  if (U && U.boundingSphere && U.boundingSphere.center) {
                    var j = U.boundingSphere.center, re = U.boundingSphere.radius;
                    re > 0 ? (k.push(new a.Vector3(j.x + re, j.y, j.z)), k.push(new a.Vector3(j.x - re, j.y, j.z)), k.push(new a.Vector3(j.x, j.y + re, j.z)), k.push(new a.Vector3(j.x, j.y - re, j.z)), k.push(new a.Vector3(j.x, j.y, j.z + re)), k.push(new a.Vector3(j.x, j.y, j.z - re))) : k.push(j);
                  }
                }), L = (0, h.getExtent)(k), E = k, $ = L) : (E = this.getAtomsFromSel({}), $ = (0, h.getExtent)(E));
                var z = new a.Vector3(L[2][0], L[2][1], L[2][2]), O = $[1][0] - $[0][0], R = $[1][1] - $[0][1], N = $[1][2] - $[0][2], W = Math.hypot(O, R, N);
                W < 5 && (W = 5), this.slabNear = -W / 1.9, this.slabFar = W / 2, O = L[1][0] - L[0][0], R = L[1][1] - L[0][1], N = L[1][2] - L[0][2], W = Math.hypot(O, R, N), W < 5 && (W = 5);
                for (var B = 25, P = 0; P < k.length; P++)
                  if (k[P]) {
                    var G = z.distanceToSquared(k[P]);
                    G > B && (B = G);
                  }
                W = Math.sqrt(B) * 2;
                var H = z.clone().multiplyScalar(-1);
                return v > 0 ? this.animateMotion(v, M, H, this.rotationGroup.position.z, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = H, this.show()), this;
              }
              /**
              	     * Zoom to center of atom selection.  The slab will be set appropriately for
              	     * the selection, unless an empty selection is provided, in which case there will be no slab.
              	     *
              	     * @param {Object}
              	     *            [sel] - Selection specification specifying model and atom
              	     *            properties to select. Default: all atoms in viewer
              	     * @param {number}
              	     *            [animationDuration] - an optional parameter that denotes
              	     *            the duration of a zoom animation
              	     * @param {Boolean} [fixedPath] - if true animation is constrained to
              	     *      requested motion, overriding updates that happen during the animation         *
              	      * @example
              
              
              	          $3Dmol.get('data/1fas.pqr', function(data){
              	              viewer.addModel(data, "pqr");
              	          viewer.zoomTo();
              	              $3Dmol.get("data/1fas.cube",function(volumedata){
              	                  viewer.addSurface($3Dmol.SurfaceType.VDW, {
              	                      opacity:0.85,
              	                      voldata: new $3Dmol.VolumeData(volumedata, "cube"),
              	                      volscheme: new $3Dmol.Gradient.Sinebow($3Dmol.getPropertyRange(viewer.selectedAtoms(),'charge'))
              	                  },{});
              
              	              viewer.render();
              	              });
              	            });
              	     */
              zoomTo(o = {}, v = 0, M = !1) {
                let E = this.getAtomsFromSel(o), $ = (0, h.getExtent)(E), k = $;
                if ((0, h.isEmptyObject)(o)) {
                  let j = E && E.length;
                  if (this.shapes.forEach((re) => {
                    if (re && re.boundingSphere) {
                      if (re.boundingSphere.box) {
                        let ue = re.boundingSphere.box;
                        E.push(new a.Vector3(ue.min.x, ue.min.y, ue.min.z)), E.push(new a.Vector3(ue.max.x, ue.max.y, ue.max.z));
                      } else if (re.boundingSphere.center) {
                        var ie = re.boundingSphere.center, te = re.boundingSphere.radius;
                        te > 0 ? (E.push(new a.Vector3(ie.x + te, ie.y, ie.z)), E.push(new a.Vector3(ie.x - te, ie.y, ie.z)), E.push(new a.Vector3(ie.x, ie.y + te, ie.z)), E.push(new a.Vector3(ie.x, ie.y - te, ie.z)), E.push(new a.Vector3(ie.x, ie.y, ie.z + te)), E.push(new a.Vector3(ie.x, ie.y, ie.z - te))) : E.push(ie);
                      }
                    }
                  }), k = (0, h.getExtent)(E), !j)
                    for (let re = 0; re < 3; re++)
                      $[2][re] = (k[0][re] + k[1][re]) / 2;
                } else {
                  let j = this.getAtomsFromSel({});
                  k = (0, h.getExtent)(j);
                }
                var L = new a.Vector3($[2][0], $[2][1], $[2][2]), z = k[1][0] - k[0][0], O = k[1][1] - k[0][1], R = k[1][2] - k[0][2], N = Math.hypot(z, O, R);
                N < 5 && (N = 5), this.slabNear = -N / 1.9, this.slabFar = N / 2, Object.keys(o).length === 0 && (this.slabNear = Math.min(-N * 2, -50), this.slabFar = Math.max(N * 2, 50));
                var W = this.config.minimumZoomToDistance || 5;
                z = $[1][0] - $[0][0], O = $[1][1] - $[0][1], R = $[1][2] - $[0][2], N = Math.hypot(z, O, R), N < W && (N = W);
                for (var B = W * W, P = 0; P < E.length; P++)
                  if (E[P]) {
                    var G = L.distanceToSquared(E[P]);
                    G > B && (B = G);
                  }
                N = Math.sqrt(B) * 2;
                var H = L.clone().multiplyScalar(-1), U = -(N * 0.5 / Math.tan(Math.PI / 180 * this.camera.fov / 2) - this.CAMERA_Z);
                return U = this.adjustZoomToLimits(U), v > 0 ? this.animateMotion(v, M, H, U, this.rotationGroup.quaternion, this.lookingAt) : (this.modelGroup.position = H, this.rotationGroup.position.z = U, this.show()), this;
              }
              /**
               * Set slab of view (contents outside of slab are clipped).
               * Must call render to update.
               *
               * @param {number} near near clipping plane distance
               * @param {number} far far clipping plane distance
               */
              setSlab(o, v) {
                this.slabNear = o, this.slabFar = v;
              }
              /**
               * Get slab of view (contents outside of slab are clipped).
               *
               * @return {Object}
               *      @property {number} near - near clipping plane distance
               *      @property {number} far - far clipping plane distance
               */
              getSlab() {
                return { near: this.slabNear, far: this.slabFar };
              }
              /**
              	     * Add label to viewer
              	     *
              	     * @param {string}
              	     *            text - Label text
              	     * @param {LabelSpec}
              	     *            options - Label style specification
              	      @param {AtomSelection}
              	     *            sel - Set position of label to center of this selection
              	     * @param {boolean} noshow - if true, do not immediately display label - when adding multiple labels this is more efficient
              	     * @return {Label}
              	     *
              	     * @example
              	     *  $3Dmol.download("pdb:2EJ0",viewer,{},function(){
              
              	              viewer.addLabel("Aromatic", {position: {x:-6.89, y:0.75, z:0.35}, backgroundColor: 0x800080, backgroundOpacity: 0.8});
              	              viewer.addLabel("Label",{font:'sans-serif',fontSize:18,fontColor:'white',fontOpacity:1,borderThickness:1.0,
              	                                       borderColor:'red',borderOpacity:0.5,backgroundColor:'black',backgroundOpacity:0.5,
              	                                       position:{x:50.0,y:0.0,z:0.0},inFront:true,showBackground:true});
              	              viewer.setStyle({chain:'A'},{cross:{hidden:true}});
              	              viewer.setStyle({chain:'B'},{cross:{hidden:false,
              	                                                  linewidth:1.0,
              	                                                  colorscheme:'greenCarbon'}});
              	              viewer.setStyle({chain:'C'},{cross:{hidden:false,
              	                                                  linewidth:1.0,
              	                                                  radius:0.5}});
              	              viewer.setStyle({chain:'D'},{cross:{hidden:false,
              	                                                  linewidth:10.0}});
              	              viewer.setStyle({chain:'E'},{cross:{hidden:false,
              	                                                  linewidth:1.0,
              	                                                  color:'black'}});
              
              	              viewer.render();
              
              
              	            });
              
              	     */
              addLabel(o, v = {}, M, E = !1) {
                if (M) {
                  var $ = (0, h.getExtent)(this.getAtomsFromSel(M));
                  v.position = { x: $[2][0], y: $[2][1], z: $[2][2] };
                }
                var k = new _.Label(o, v);
                return k.setContext(), this.modelGroup.add(k.sprite), this.labels.push(k), E || this.show(), k;
              }
              /** Add residue labels.  This will generate one label per a
               * residue within the selected atoms.  The label will be at the
               * centroid of the atoms and styled according to the passed style.
               * The label text will be [resn][resi]
               *
               * @param {AtomSelectionSpec} sel
               * @param {AtomStyleSpec} style
               * @param {boolean} byframe - if true, create labels for every individual frame, not just current
               *
               * @example
                   $3Dmol.download("mmtf:2ll5",viewer,{},function(){
                        viewer.setStyle({stick:{radius:0.15},cartoon:{}});
                        viewer.addResLabels({hetflag:false}, {font: 'Arial', fontColor:'black',showBackground:false, screenOffset: {x:0,y:0}});
                        viewer.zoomTo();
                        viewer.render();
                      });
               */
              addResLabels(o, v, M = !1) {
                let E = this.labels.length;
                return this.applyToModels("addResLabels", o, this, v, M), this.show(), this.labels.slice(E);
              }
              /** Add property labels.  This will generate one label per a selected
               * atom at the atom's coordinates with the property value as the label text.
               *
               * @param {string} prop - property name
               * @param {AtomSelectionSpec} sel
               * @param {AtomStyleSpec} style
               *
               * * @example
                   $3Dmol.download("cid:5291",viewer,{},function(){
                        viewer.setStyle({stick: {radius:.2}});
                        viewer.addPropertyLabels("index",{not:{elem:'H'}}, {fontColor:'black',font: 'sans-serif', fontSize: 28, showBackground:false,alignment:'center'});
                        viewer.zoomTo();
                        viewer.render();
                      });
               */
              addPropertyLabels(o, v, M) {
                return this.applyToModels("addPropertyLabels", o, v, this, M), this.show(), this;
              }
              /**
              	     * Remove label from viewer
              	     *
              	     * @param {Label} label - $3Dmol label
              	     *
              	     * @example // Remove labels created in
              	     $3Dmol.download("pdb:2EJ0",viewer,{},function(){
              	              var toremove = viewer.addLabel("Aromatic", {position: {x:-6.89, y:0.75, z:0.35}, backgroundColor: 0x800080, backgroundOpacity: 0.8});
              	              viewer.addLabel("Label",{font:'sans-serif',fontSize:18,fontColor:'white',fontOpacity:1,borderThickness:1.0,
              	                                       borderColor:'red',borderOpacity:0.5,backgroundColor:'black',backgroundOpacity:0.5,
              	                                       position:{x:50.0,y:0.0,z:0.0},inFront:true,showBackground:true});
              	              viewer.removeLabel(toremove);
              	              viewer.render();
              
              
              	            });
              
              	     */
              removeLabel(o) {
                for (var v = 0; v < this.labels.length; v++)
                  if (this.labels[v] == o) {
                    this.labels.splice(v, 1), o.dispose(), this.modelGroup.remove(o.sprite);
                    break;
                  }
                return this.show(), this;
              }
              /**
              	     * Remove all labels from viewer
              	     *
              	     *         @example
              	    $3Dmol.download("pdb:1ubq",viewer,{},function(){
              
              	           viewer.addResLabels();
              	           viewer.setStyle({},{stick:{}});
              	           viewer.render( ); //show labels
              
              	           viewer.removeAllLabels();
              	           viewer.render(); //hide labels
              	    });
              	     */
              removeAllLabels() {
                for (var o = 0; o < this.labels.length; o++)
                  this.labels[o] && this.labels[o].sprite && this.modelGroup.remove(this.labels[o].sprite);
                return this.labels.splice(0, this.labels.length), this.show(), this;
              }
              // Modify label style
              /**
               * Modify existing label's style
               *
               * @param {Label} label - $3Dmol label
               * @param {LabelSpec}
               *            stylespec - Label style specification
               * @return {Label}
               */
              setLabelStyle(o, v) {
                return this.modelGroup.remove(o.sprite), o.dispose(), o.stylespec = v, o.setContext(), this.modelGroup.add(o.sprite), this.show(), o;
              }
              // Change label text
              /**
               * Modify existing label's text
               *
               * @param {Label}  label - $3Dmol label
               * @param {String}
               *            text - Label text
               * @return {Label}
               */
              setLabelText(o, v) {
                return this.modelGroup.remove(o.sprite), o.dispose(), o.text = v, o.setContext(), this.modelGroup.add(o.sprite), this.show(), o;
              }
              /**
               * Add shape object to viewer
               * @see {GLShape}
               *
               * @param {ShapeSpec} shapeSpec - style specification for label
               * @return {GLShape}
               */
              addShape(o) {
                o = o || {};
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, this.shapes.push(v), v;
              }
              /**
               * Remove shape object from viewer
               *
               * @param {GLShape} shape - Reference to shape object to remove
               */
              removeShape(o) {
                if (!o)
                  return this;
                for (o.removegl(this.modelGroup), delete this.shapes[o.shapePosition]; this.shapes.length > 0 && typeof this.shapes[this.shapes.length - 1] > "u"; )
                  this.shapes.pop();
                return this;
              }
              /**
               * Remove all shape objects from viewer
               */
              removeAllShapes() {
                for (var o = 0; o < this.shapes.length; o++) {
                  var v = this.shapes[o];
                  v && v.removegl(this.modelGroup);
                }
                return this.shapes.splice(0, this.shapes.length), this;
              }
              //gets the center of the selection
              getSelectionCenter(o) {
                if (o.hasOwnProperty("x") && o.hasOwnProperty("y") && o.hasOwnProperty("z"))
                  return o;
                var v = this.getAtomsFromSel(o);
                if (v.length == 0)
                  return { x: 0, y: 0, z: 0 };
                var M = (0, h.getExtent)(v);
                return { x: M[0][0] + (M[1][0] - M[0][0]) / 2, y: M[0][1] + (M[1][1] - M[0][1]) / 2, z: M[0][2] + (M[1][2] - M[0][2]) / 2 };
              }
              /**
              	     * Create and add sphere shape. This method provides a shorthand
              	     * way to create a spherical shape object
              	     *
              	     * @param {SphereShapeSpec} spec - Sphere shape style specification
              	     * @return {GLShape}
              	     @example
              
              	     viewer.addSphere({center:{x:0,y:0,z:0},radius:10.0,color:'red'});
              
              	     viewer.render();
              	     */
              addSphere(o) {
                o = o || {}, o.center = this.getSelectionCenter(o.center);
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, v.addSphere(o), this.shapes.push(v), v.finalize(), v;
              }
              /**
              	     * Create and add box shape. This method provides a shorthand
              	     * way to create a box shape object
              	     *
              	     * @param {BoxSpec} spec - Box shape style specification
              	     * @return {GLShape}
              	     @example
              
              	     viewer.addLine({color:'red',start:{x:0,y:0,z:0},end:{x:5,y:0,z:0}});
              	     viewer.addLine({color:'blue',start:{x:0,y:0,z:0},end:{x:0,y:5,z:0}});
              	     viewer.addLine({color:'green',start:{x:0,y:0,z:0},end:{x:0,y:0,z:5}});
              
              	     viewer.addBox({center:{x:0,y:0,z:0},dimensions: {w:3,h:4,d:2},color:'magenta'});
              	     viewer.zoomTo();
              	     viewer.rotate(45, {x:1,y:1,z:1});
              	     viewer.render();
              	     */
              addBox(o = {}) {
                o.corner != null && (o.corner = this.getSelectionCenter(o.corner)), o.center != null && (o.center = this.getSelectionCenter(o.center));
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, v.addBox(o), this.shapes.push(v), v.finalize(), v;
              }
              /**
              	     * Create and add arrow shape
              	     *
              	     * @param {ArrowSpec} spec - Style specification
              	     * @return {GLShape}
              	     @example
              	    $3Dmol.download("pdb:4DM7",viewer,{},function(){
              
              	              viewer.setBackgroundColor(0xffffffff);
              	              viewer.addArrow({
              	                  start: {x:-10.0, y:0.0, z:0.0},
              	                  end: {x:0.0, y:-10.0, z:0.0},
              	                  radius: 1.0,
              	                  radiusRadio:1.0,
              	                  mid:1.0,
              	                  clickable:true,
              	                  callback:function(){
              	                      this.color.setHex(0xFF0000FF);
              	                      viewer.render( );
              	                  }
              	              });
              	              viewer.render();
              	            });
              	     */
              addArrow(o = {}) {
                o.start = this.getSelectionCenter(o.start), o.end = this.getSelectionCenter(o.end);
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, v.addArrow(o), this.shapes.push(v), v.finalize(), v;
              }
              /**
              	     * Create and add cylinder shape
              	     *
              	     * @param {CylinderSpec} spec - Style specification
              	     * @return {GLShape}
              
              	      @example
              	     viewer.setBackgroundColor(0xffffffff);
              	          viewer.addCylinder({start:{x:0.0,y:0.0,z:0.0},
              	                              end:{x:10.0,y:0.0,z:0.0},
              	                              radius:1.0,
              	                              fromCap:1,
              	                              toCap:2,
              	                              color:'red',
              	                              hoverable:true,
              	                              clickable:true,
              	                              callback:function(){ this.color.setHex(0x00FFFF00);viewer.render( );},
              	                              hover_callback: function(){ viewer.render( );},
              	                              unhover_callback: function(){ this.color.setHex(0xFF000000);viewer.render( );}
              	                             });
              	          viewer.addCylinder({start:{x:0.0,y:2.0,z:0.0},
              	                              end:{x:0.0,y:10.0,z:0.0},
              	                              radius:0.5,
              	                              fromCap:false,
              	                              toCap:true,
              	                              color:'teal'});
              	          viewer.addCylinder({start:{x:15.0,y:0.0,z:0.0},
              	                              end:{x:20.0,y:0.0,z:0.0},
              	                              radius:1.0,
              	                              color:'black',
              	                              fromCap:false,
              	                              toCap:false});
              	          viewer.render();
              	     */
              addCylinder(o = {}) {
                o.start = this.getSelectionCenter(o.start), o.end = this.getSelectionCenter(o.end);
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, o.dashed ? v.addDashedCylinder(o) : v.addCylinder(o), this.shapes.push(v), v.finalize(), v;
              }
              /**
              	     * Create and add Curve shape
              	     *
              	     * @param {CurveSpec} spec - Style specification
              	     * @return {GLShape}
              
              	     @example
              	          viewer.addCurve({points: [{x:0.0,y:0.0,z:0.0}, {x:5.0,y:3.0,z:0.0}, {x:5.0,y:7.0,z:0.0}, {x:0.0,y:10.0,z:0.0}],
              	                              radius:0.5,
              	                              smooth: 10,
              	                              fromArrow:false,
              	                              toArrow: true,
              	                              color:'orange',
              	                              });
              	          viewer.addCurve({points: [{x:-1,y:0.0,z:0.0}, {x:-5.0,y:5.0,z:0.0}, {x:-2,y:10.0,z:0.0}],
              	                              radius:1,
              	                              fromArrow:true,
              	                              toArrow: false,
              	                              color:'purple',
              	                              });
              	          viewer.zoomTo();
              	          viewer.render();
              	     */
              addCurve(o = {}) {
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, v.addCurve(o), this.shapes.push(v), v.finalize(), v;
              }
              /**
              	     * Create and add line shape
              	     *
              	     * @param {LineSpec} spec - Style specification, can specify dashed, dashLength, and gapLength
              	     * @return {GLShape}
              	     @example
              	     $3Dmol.download("pdb:2ABJ",viewer,{},function(){
              
              	              viewer.setViewStyle({style:"outline"});
              	              viewer.setStyle({chain:'A'},{sphere:{hidden:true}});
              	              viewer.setStyle({chain:'D'},{sphere:{radius:3.0}});
              	              viewer.setStyle({chain:'G'},{sphere:{colorscheme:'greenCarbon'}});
              	              viewer.setStyle({chain:'J'},{sphere:{color:'blue'}});
              	              viewer.addLine({dashed:true,start:{x:0,y:0,z:0},end:{x:100,y:100,z:100}});
              	              viewer.render();
              	          });
              
              	     */
              addLine(o = {}) {
                o.start = this.getSelectionCenter(o.start), o.end = this.getSelectionCenter(o.end), o.wireframe = !0;
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, o.dashed ? v = this.addLineDashed(o, v) : v.addLine(o), this.shapes.push(v), v.finalize(), v;
              }
              /**
              	     * Create and add unit cell visualization.
              	     *
              	     * @param {GLModel|number} model - Model with unit cell information (e.g., pdb derived).  If omitted uses most recently added model.
              	     * @param {UnitCellStyleSpec} spec - visualization style
              	       @example
              
              	            $3Dmol.get('data/1jpy.cif', function(data) {
              	              let m = viewer.addModel(data);
              	              viewer.addUnitCell(m, {box:{color:'purple'},alabel:'X',blabel:'Y',clabel:'Z',alabelstyle: {fontColor: 'black',backgroundColor:'white',inFront:true,fontSize:40},astyle:{color:'darkred', radius:5,midpos: -10}});
              	              viewer.zoomTo();
              	              viewer.render();
              	    });
              	     */
              addUnitCell(o, v) {
                o = this.getModel(o), v = v || { alabel: "a", blabel: "b", clabel: "c" }, v.box = v.box || {}, v.astyle = v.astyle || { color: "red", radius: 0.1, midpos: -1 }, v.bstyle = v.bstyle || { color: "green", radius: 0.1, midpos: -1 }, v.cstyle = v.cstyle || { color: "blue", radius: 0.1, midpos: -1 }, v.alabelstyle = v.alabelstyle || { fontColor: "red", showBackground: !1, alignment: "center", inFront: !1 }, v.blabelstyle = v.blabelstyle || { fontColor: "green", showBackground: !1, alignment: "center", inFront: !1 }, v.clabelstyle = v.clabelstyle || { fontColor: "blue", showBackground: !1, alignment: "center", inFront: !1 }, o.unitCellObjects && this.removeUnitCell(o), o.unitCellObjects = { shapes: [], labels: [] };
                var M = o.getCrystData(), E = null;
                if (M) {
                  if (M.matrix)
                    E = M.matrix;
                  else {
                    var $ = M.a, k = M.b, L = M.c, z = M.alpha, O = M.beta, R = M.gamma;
                    z = z * Math.PI / 180, O = O * Math.PI / 180, R = R * Math.PI / 180;
                    var N, W, B;
                    N = Math.cos(O), W = (Math.cos(z) - Math.cos(O) * Math.cos(R)) / Math.sin(R), B = Math.sqrt(Math.max(0, 1 - N * N - W * W)), E = new a.Matrix3($, k * Math.cos(R), L * N, 0, k * Math.sin(R), L * W, 0, 0, L * B);
                  }
                  var P = [
                    new a.Vector3(0, 0, 0),
                    new a.Vector3(1, 0, 0),
                    new a.Vector3(0, 1, 0),
                    new a.Vector3(0, 0, 1),
                    new a.Vector3(1, 1, 0),
                    new a.Vector3(0, 1, 1),
                    new a.Vector3(1, 0, 1),
                    new a.Vector3(1, 1, 1)
                  ];
                  if (M.matrix4)
                    for (let H = 0; H < P.length; H++)
                      M.size && P[H].multiplyVectors(P[H], M.size), P[H] = P[H].applyMatrix4(M.matrix4);
                  else
                    for (let H = 0; H < P.length; H++)
                      P[H] = P[H].applyMatrix3(E);
                  if (v.box && !v.box.hidden) {
                    v.box.wireframe = !0;
                    var G = new m.GLShape(v.box);
                    G.shapePosition = this.shapes.length, G.addLine({ start: P[0], end: P[1] }), G.addLine({ start: P[0], end: P[2] }), G.addLine({ start: P[1], end: P[4] }), G.addLine({ start: P[2], end: P[4] }), G.addLine({ start: P[0], end: P[3] }), G.addLine({ start: P[3], end: P[5] }), G.addLine({ start: P[2], end: P[5] }), G.addLine({ start: P[1], end: P[6] }), G.addLine({ start: P[4], end: P[7] }), G.addLine({ start: P[6], end: P[7] }), G.addLine({ start: P[3], end: P[6] }), G.addLine({ start: P[5], end: P[7] }), this.shapes.push(G), o.unitCellObjects.shapes.push(G), G.finalize();
                  }
                  if (!v.astyle.hidden) {
                    v.astyle.start = P[0], v.astyle.end = P[1];
                    let H = this.addArrow(v.astyle);
                    o.unitCellObjects.shapes.push(H);
                  }
                  if (!v.bstyle.hidden) {
                    v.bstyle.start = P[0], v.bstyle.end = P[2];
                    let H = this.addArrow(v.bstyle);
                    o.unitCellObjects.shapes.push(H);
                  }
                  if (!v.cstyle.hidden) {
                    v.cstyle.start = P[0], v.cstyle.end = P[3];
                    let H = this.addArrow(v.cstyle);
                    o.unitCellObjects.shapes.push(H);
                  }
                  if (v.alabel) {
                    v.alabelstyle.position = P[1];
                    let H = this.addLabel(v.alabel, v.alabelstyle);
                    o.unitCellObjects.labels.push(H);
                  }
                  if (v.blabel) {
                    v.blabelstyle.position = P[2];
                    let H = this.addLabel(v.blabel, v.blabelstyle);
                    o.unitCellObjects.labels.push(H);
                  }
                  if (v.clabel) {
                    v.clabelstyle.position = P[3];
                    let H = this.addLabel(v.clabel, v.clabelstyle);
                    o.unitCellObjects.labels.push(H);
                  }
                }
              }
              /**
              * Remove unit cell visualization from model.
              *
              * @param {GLModel|number} model - Model with unit cell information (e.g., pdb derived).  If omitted uses most recently added model.
                @example
                     $3Dmol.get('data/icsd_200866.cif', function(data) {
                       let m = viewer.addModel(data);
                       viewer.setStyle({sphere:{}})
                       viewer.addUnitCell();
                       viewer.zoomTo();
                       viewer.removeUnitCell();
                       viewer.render();
                 });
              */
              removeUnitCell(o) {
                if (o = this.getModel(o), o.unitCellObjects) {
                  let v = this;
                  o.unitCellObjects.shapes.forEach(function(M) {
                    v.removeShape(M);
                  }), o.unitCellObjects.labels.forEach(function(M) {
                    v.removeLabel(M);
                  });
                }
                delete o.unitCellObjects;
              }
              /**
              * Replicate atoms in model to form a super cell of the specified dimensions.
              * Original cell will be centered as much as possible.
              *
              * @param {integer} A - number of times to replicate cell in X dimension.
              * @param {integer} B - number of times to replicate cell in Y dimension.  If absent, X value is used.
              * @param {integer} C - number of times to replicate cell in Z dimension.  If absent, Y value is used.
              * @param {GLModel} model - Model with unit cell information (e.g., pdb derived).  If omitted uses most recently added model.
              * @param {boolean} addBonds - Create bonds between unit cells based on distances.
              * @param {boolean} prune - Keep only atoms that are within the original unit cell (i.e., on edges).  Alternatively, call replicateUnitCell(1).
                @example
                     $3Dmol.get('data/icsd_200866.cif', function(data) {
                       let m = viewer.addModel(data);
                       viewer.setStyle({sphere:{scale:.25}})
                       viewer.addUnitCell();
                       viewer.zoomTo();
                       viewer.replicateUnitCell(3,2,1,m);
                       viewer.render();
                 });
              */
              replicateUnitCell(o = 3, v = o, M = v, E, $, k) {
                E = this.getModel(E);
                let L = E.getCrystData();
                if (L) {
                  const z = E.selectedAtoms({}), O = L.matrix;
                  let R = function(W) {
                    return W % 2 == 0 ? -W / 2 : Math.ceil(W / 2);
                  };
                  o <= 1 && v <= 1 && M <= 1 && (k = !0, o = v = M = 3);
                  let N = function(W, B, P) {
                    return !1;
                  };
                  if (k) {
                    const W = new a.Matrix3().getInverse3(O);
                    N = function(B, P, G) {
                      let H = new a.Vector3(B, P, G).applyMatrix3(W);
                      return !(H.x > -1e-4 && H.x < 1.0001 && H.y > -1e-4 && H.y < 1.0001 && H.z > -1e-4 && H.z < 1.0001);
                    };
                  }
                  for (let W = 0; W < o; W++)
                    for (let B = 0; B < v; B++)
                      for (let P = 0; P < M; P++) {
                        if (W == 0 && B == 0 && P == 0)
                          continue;
                        let G = new a.Vector3(R(W), R(B), R(P));
                        G.applyMatrix3(O);
                        let H = [];
                        for (let U = 0; U < z.length; U++) {
                          let j = z[U].x + G.x, re = z[U].y + G.y, ie = z[U].z + G.z;
                          if (N(j, re, ie))
                            continue;
                          let te = {};
                          for (let ue in z[U])
                            te[ue] = z[U][ue];
                          te.x = j, te.y = re, te.z = ie, H.push(te);
                        }
                        E.addAtoms(H);
                      }
                  $ && E.assignBonds();
                }
              }
              /** Add dashed line to shape */
              addLineDashed(o, v) {
                o.dashLength = o.dashLength || 0.5, o.gapLength = o.gapLength || 0.5;
                var M;
                o.start ? M = new a.Vector3(o.start.x || 0, o.start.y || 0, o.start.z || 0) : M = new a.Vector3(0, 0, 0);
                var E;
                o.end ? E = new a.Vector3(o.end.x, o.end.y || 0, o.end.z || 0) : E = new a.Vector3(0, 0, 0);
                var $ = new a.Vector3(), k = new a.Vector3(), L = new a.Vector3(), z, O, R, N = M.clone(), W = 0;
                for ($.subVectors(E, M), z = $.length(), $.normalize(), k = $.clone(), L = $.clone(), k.multiplyScalar(o.dashLength), L.multiplyScalar(o.gapLength), O = k.length(), R = L.length(); W < z; ) {
                  if (W + O > z) {
                    o.start = M, o.end = E, v.addLine(o);
                    break;
                  }
                  N.addVectors(M, k), o.start = M, o.end = N, v.addLine(o), M = N.clone(), W += O, N.addVectors(M, L), M = N.clone(), W += R;
                }
                return v.finalize(), v;
              }
              /**
              	     * Add custom shape component from user supplied function
              	     *
              	     * @param {CustomSpec} spec - Style specification
              	     * @return {GLShape}
              	     @example
              	     function triangle(viewer) {
              	        var vertices = [];
              	        var normals = [];
              	        var colors = [];
              	        var r = 20;
              	        //triangle
              	        vertices.push(new $3Dmol.Vector3(0,0,0));
              	        vertices.push(new $3Dmol.Vector3(r,0,0));
              	        vertices.push(new $3Dmol.Vector3(0,r,0));
              
              	        normals.push(new $3Dmol.Vector3(0,0,1));
              	        normals.push(new $3Dmol.Vector3(0,0,1));
              	        normals.push(new $3Dmol.Vector3(0,0,1));
              
              	        colors.push({r:1,g:0,b:0});
              	        colors.push({r:0,g:1,b:0});
              	        colors.push({r:0,g:0,b:1});
              
              	        var faces = [ 0,1,2 ];
              
              	        var spec = {vertexArr:vertices, normalArr: normals, faceArr:faces,color:colors};
              	        viewer.addCustom(spec);
              	    }
              	    triangle(viewer);
              	    viewer.render();
              	     */
              addCustom(o) {
                o = o || {};
                var v = new m.GLShape(o);
                return v.shapePosition = this.shapes.length, v.addCustom(o), this.shapes.push(v), v.finalize(), v;
              }
              /**
              	     * Construct isosurface from volumetric data in gaussian cube format
              	     * @param {String} data - Input file contents
              	     * @param {String} format - Input file format
              	     * @param {VolumetricRendererSpec|IsoSurfaceSpec} spec - Shape style specification
              	     * @return {GLShape}
              	     *
              	     * @example
              
              
              	    $3Dmol.get('data/bohr.cube', function(data) {
              
              	    viewer.addVolumetricData(data, "cube", {isoval: -0.01, color: "red", opacity: 0.95});
              	    viewer.setStyle({cartoon:{},stick:{}});
              	    viewer.zoomTo();
              	    viewer.render();
              	    });
              
              
              	     */
              addVolumetricData(o, v, M = {}) {
                var E = new y.VolumeData(o, v);
                return M.hasOwnProperty("transferfn") ? this.addVolumetricRender(E, M) : this.addIsosurface(E, M);
              }
              /**
               * Construct isosurface from volumetric data.  This is more flexible
              * than addVolumetricData, but can not be used with py3Dmol.
               * @param {VolumeData} data - volumetric data
               * @param {IsoSurfaceSpec} spec - Shape style specification
               * @return {GLShape}
               *
               @example
               $3Dmol.get('../test_structs/benzene-homo.cube', function(data){
                        var voldata = new $3Dmol.VolumeData(data, "cube");
                        viewer.addIsosurface(voldata, {isoval: 0.01,
                                                       color: "blue"});
                        viewer.addIsosurface(voldata, {isoval: -0.01,
                                                       color: "red"});
                        viewer.zoomTo();
                        viewer.render();
                      });
               */
              addIsosurface(o, v = {}, M) {
                var E = new m.GLShape(v);
                return E.shapePosition = this.shapes.length, E.addIsosurface(o, v, M, this), this.shapes.push(E), E;
              }
              /**
               * Create volumetric renderer for volumetricData
               * @param {VolumeData} data - volumetric data
               * @param {VolumetricRenderSpec} spec - specification of volumetric render
               *
               * @return {GLShape}
               *
               */
              addVolumetricRender(o, v) {
                v = v || {};
                var M = new b.GLVolumetricRender(o, v, this);
                return M.shapePosition = this.shapes.length, this.shapes.push(M), M;
              }
              /**
               * Return true if volumetric rendering is supported (WebGL 2.0 required)
               *
               * @return {boolean}
               */
              hasVolumetricRender() {
                return this.renderer.supportsVolumetric();
              }
              /**
               * Enable/disable fog for content far from the camera
               *
               * @param {boolean} fog whether to enable or disable the fog
               */
              enableFog(o) {
                o ? this.scene.fog = new r.Fog(this.bgColor, 100, 200) : (this.config.disableFog = !0, this.show());
              }
              /**
               * Sets the atomlists of all models in the viewer to specified frame.
               * Shapes and labels can also be displayed by frame.
               * Sets to last frame if framenum out of range
               *
               * @param {number} framenum - fame index to use, starts at zero
               * @return {Promise}
               */
              setFrame(o) {
                this.viewer_frame = o;
                let v = this;
                return new Promise(function(M) {
                  var E = v.models.map(function($) {
                    return $.setFrame(o, v);
                  });
                  Promise.all(E).then(function() {
                    M();
                  });
                });
              }
              /**
               * Gets the current viewer frame.
               *
               */
              getFrame() {
                return this.viewer_frame;
              }
              /**
               * Returns the number of frames that the model with the most frames in the viewer has
               *
               * @return {number}
               */
              getNumFrames() {
                var o = 0;
                for (let v = 0; v < this.models.length; v++)
                  this.models[v].getNumFrames() > o && (o = this.models[v].getNumFrames());
                for (let v = 0; v < this.shapes.length; v++)
                  this.shapes[v].frame && this.shapes[v].frame >= o && (o = this.shapes[v].frame + 1);
                for (let v = 0; v < this.labels.length; v++)
                  this.labels[v].frame && this.labels[v].frame >= o && (o = this.labels[v].frame + 1);
                return o;
              }
              /**
               * Animate all models in viewer from their respective frames
               * @param {Object} options - can specify interval (speed of animation), loop (direction
               * of looping, 'backward', 'forward' or 'backAndForth'), step interval between frames ('step'), startFrame, and reps (numer of repetitions, 0 indicates infinite loop)
               *
               */
              animate(o) {
                this.incAnim();
                var v = 100, M = "forward", E = 1 / 0;
                o = o || {}, o.interval && (v = o.interval), o.loop && (M = o.loop), o.reps && (E = o.reps);
                var $ = this.getNumFrames(), k = this, L = 0;
                o.startFrame && (L = o.startFrame % $);
                var z = 1;
                o.step && (z = o.step, E /= z);
                var O = 0, R = $ * E, N = /* @__PURE__ */ new Date(), W, B, P = function(G) {
                  N = /* @__PURE__ */ new Date(), G == "forward" ? k.setFrame(L).then(function() {
                    L = (L + z) % $, W();
                  }) : G == "backward" ? k.setFrame($ - 1 - L).then(function() {
                    L = (L + z) % $, W();
                  }) : k.setFrame(L).then(function() {
                    L += z, z *= L % ($ - 1) == 0 ? -1 : 1, W();
                  });
                };
                return W = function() {
                  if (k.render(), !k.getCanvas().isConnected)
                    k.stopAnimate();
                  else if (++O >= R || !k.isAnimated())
                    B.cancel(), k.animationTimers.delete(B), k.decAnim();
                  else {
                    var G = v - ((/* @__PURE__ */ new Date()).getTime() - N.getTime());
                    G = G > 0 ? G : 0, k.animationTimers.delete(B), B = new h.PausableTimer(P, G, M), k.animationTimers.add(B);
                  }
                }, B = new h.PausableTimer(P, 0, M), this.animationTimers.add(B), this;
              }
              /**
               * Stop animation of all models in viewer
               */
              stopAnimate() {
                return this.animated = 0, this.animationTimers.forEach(function(o) {
                  o.cancel();
                }), this.animationTimers = /* @__PURE__ */ new Set(), this;
              }
              /**
               * Pause animation of all models in viewer
               */
              pauseAnimate() {
                return this.animationTimers.forEach(function(o) {
                  o.pause();
                }), this;
              }
              /**
               * Resume animation of all models in viewer
               */
              resumeAnimate() {
                return this.animationTimers.forEach(function(o) {
                  o.resume();
                }), this;
              }
              /**
               * Return true if viewer is currently being animated, false otherwise
               * @return {boolean}
               */
              isAnimated() {
                return this.animated > 0;
              }
              //setup options dict
              getModelOpt(o) {
                return o && !o.defaultcolors ? (o.defaultcolors = this.defaultcolors, o.cartoonQuality = o.cartoonQuality || this.config.cartoonQuality) : typeof o > "u" && (o = { defaultcolors: this.defaultcolors, cartoonQuality: this.config.cartoonQuality }), o;
              }
              /**
              	     * Create and add model to viewer, given molecular data and its format
              	     *
              	     * @param {string} data - Input data
              	     * @param {string} format - Input format ('pdb', 'sdf', 'xyz', 'pqr', or 'mol2')
              	     * @param {ParserOptionsSpec} options - format dependent options. Attributes depend on the input file format.
              	     * @example
              
              
              	          viewer.setViewStyle({style:"outline"});
              	          $3Dmol.get('data/1fas.pqr', function(data){
              	              viewer.addModel(data, "pqr");
              	              $3Dmol.get("data/1fas.cube",function(volumedata){
              	                  viewer.addSurface($3Dmol.SurfaceType.VDW, {opacity:0.85,voldata: new $3Dmol.VolumeData(volumedata, "cube"), volscheme: new $3Dmol.Gradient.RWB(-10,10)},{});
              
              	              viewer.render();
              	              });
              	              viewer.zoomTo();
              	          });
              	     *
              	     * @return {GLModel}
              	     */
              addModel(o, v = "", M) {
                M = this.getModelOpt(M);
                var E = new d.GLModel(this.models.length, M);
                return E.addMolData(o, v, M), this.models.push(E), E;
              }
              /**
               * Given multimodel file and its format, add atom data to the viewer as separate models
               * and return list of these models
               *
               * @param {string} data - Input data
               * @param {string} format - Input format (see {@link FileFormats})
               * @return {Array<GLModel>}
               */
              addModels(o, v, M) {
                M = this.getModelOpt(M), M.multimodel = !0, M.frames = !0;
                for (var E = d.GLModel.parseMolData(o, v, M), $ = 0; $ < E.length; $++) {
                  var k = new d.GLModel(this.models.length, M);
                  k.setAtomDefaults(E[$]), k.addFrame(E[$]), k.setFrame(0), E.modelData && k.setModelData(E.modelData[$]), k.setDontDuplicateAtoms(!M.duplicateAssemblyAtoms), this.models.push(k);
                }
                return this.models;
              }
              /**
               * Create and add model to viewer. Given multimodel file and its format,
               * different atomlists are stored in model's frame
               * property and model's atoms are set to the 0th frame
               *
               * @param {string} data - Input data
               * @param {string} format - Input format (see {@link FileFormats})
               * @return {GLModel}
               *
               * @example
                      $3Dmol.get('../test_structs/multiple2.xyz', function(data){
                        viewer.addModelsAsFrames(data, "xyz");
                        viewer.animate({loop: "forward",reps: 1});
                        viewer.setStyle({stick:{colorscheme:'magentaCarbon'}});
                        viewer.zoomTo();
                        viewer.render();
                    });
               */
              addModelsAsFrames(o, v, M) {
                M = this.getModelOpt(M), M.multimodel = !0, M.frames = !0;
                var E = new d.GLModel(this.models.length, M);
                return E.addMolData(o, v, M), this.models.push(E), E;
              }
              /**
              	     * Create and add model to viewer. Given multimodel file and its format,
              	     * all atoms are added to one model
              	     *
              	     * @param {string} data - Input data
              	     * @param {string} format - Input format (see {@link FileFormats})
              	     * @return {GLModel}
              	     @example
              
              
              	          $3Dmol.get('../test_structs/multiple.sdf', function(data){
              	              viewer.addAsOneMolecule(data, "sdf");
              	              viewer.zoomTo();
              	              viewer.render();
              	          });
              	     */
              addAsOneMolecule(o, v, M) {
                M = this.getModelOpt(M), M.multimodel = !0, M.onemol = !0;
                var E = new d.GLModel(this.models.length, M);
                return E.addMolData(o, v, M), this.models.push(E), E;
              }
              /**
               * Delete specified model from viewer
               *
               * @param {GLModel|number} model
               */
              removeModel(o) {
                if (o = this.getModel(o), !!o) {
                  for (o.removegl(this.modelGroup), delete this.models[o.getID()]; this.models.length > 0 && typeof this.models[this.models.length - 1] > "u"; )
                    this.models.pop();
                  return this;
                }
              }
              /**
               * Delete all existing models
               */
              removeAllModels() {
                for (var o = 0; o < this.models.length; o++) {
                  var v = this.models[o];
                  v && v.removegl(this.modelGroup);
                }
                return this.models.splice(0, this.models.length), this;
              }
              /**
               * Export one or all of the loaded models into ChemDoodle compatible JSON.
               * @param {boolean} includeStyles - Whether or not to include style information.
               * @param {number} modelID - Optional parameter for which model to export. If left out, export all of them.
               * @return {string}
               */
              exportJSON(o, v) {
                var M = {};
                return v === void 0 ? M.m = this.models.map(function(E) {
                  return E.toCDObject(o);
                }) : M.m = [this.models[v].toCDObject()], JSON.stringify(M);
              }
              /** return a VRML string representation of the scene.  Include VRML header information
               * @return VRML
               */
              exportVRML() {
                var o = this.modelGroup;
                this.applyToModels("removegl", this.modelGroup), this.modelGroup = new r.Object3D(), this.render(null, { supportsImposters: !1, supportsAIA: !1, regen: !0 });
                var v = `#VRML V2.0 utf8
` + this.modelGroup.vrml() + `
`;
                return this.applyToModels("removegl", this.modelGroup), this.modelGroup = o, v;
              }
              /**
               * Create a new model from atoms specified by sel.
               * If extract, removes selected atoms from existing models
               *
               * @param {AtomSelectionSpec} sel - Atom selection specification
               * @param {boolean=} extract - If true, remove selected atoms from existing models
               * @return {GLModel}
               */
              createModelFrom(o, v = !1) {
                for (var M = new d.GLModel(this.models.length, this.defaultcolors), E = 0; E < this.models.length; E++)
                  if (this.models[E]) {
                    var $ = this.models[E].selectedAtoms(o);
                    M.addAtoms($), v && this.models[E].removeAtoms($);
                  }
                return this.models.push(M), M;
              }
              applyToModels(o, v, M, E, $, k, L) {
                for (var z = this.getModelList(v), O = 0; O < z.length; O++)
                  z[O][o](v, M, E, $, k, L);
              }
              setStyle(o, v) {
                return typeof v > "u" && (v = o, o = {}), this.applyToModels("setStyle", o, v, !1), this;
              }
              addStyle(o, v) {
                return typeof v > "u" && (v = o, o = {}), this.applyToModels("setStyle", o, v, !0), this;
              }
              /**
              	     * Set click-handling properties to all selected atoms. *Important*: render must be called for this to take effect.
              	     *
              	     * @param {AtomSelectionSpec} sel - atom selection to apply clickable settings to
              	     * @param {boolean} clickable - whether click-handling is enabled for the selection
              	     * @param {function} callback - function called when an atom in the selection is clicked. The function is passed
              	     * the selected (foremost) object, the viewer, the triggering event, the associated container, and a list
              	     * of all intersecting objects with their distances from the viewer.
              	     *
              	     * @example
              	        $3Dmol.download("cid:307900",viewer,{},function(){
              
              	               viewer.setStyle({},{sphere:{}});
              	               viewer.setClickable({},true,function(atom,viewer,event,container) {
              	                   viewer.addLabel(atom.resn+":"+atom.atom,{position: atom, backgroundColor: 'darkgreen', backgroundOpacity: 0.8});
              	               });
              	               viewer.render();
              	    });
              	     */
              setClickable(o, v, M) {
                return this.applyToModels("setClickable", o, v, M), this;
              }
              /** Set hoverable and callback of selected atoms
              	     *
              	     * @param {AtomSelectionSpec} sel - atom selection to apply hoverable settings to
              	     * @param {boolean} hoverable - whether hover-handling is enabled for the selection
              	     * @param {function} hover_callback - function called when an atom in the selection is hovered over.  The function has the same signature as a click handler.
              	     * @param {function} unhover_callback - function called when the mouse moves out of the hover area
              	    @example
              	    $3Dmol.download("pdb:1ubq",viewer,{},function(){
              
              	           viewer.setHoverable({},true,function(atom,viewer,event,container) {
              	               if(!atom.label) {
              	                atom.label = viewer.addLabel(atom.resn+":"+atom.atom,{position: atom, backgroundColor: 'mintcream', fontColor:'black'});
              	               }
              	           },
              	           function(atom) {
              	               if(atom.label) {
              	                viewer.removeLabel(atom.label);
              	                delete atom.label;
              	               }
              	            }
              	           );
              	           viewer.setStyle({},{stick:{}});
              	           viewer.render();
              	    });
              
              	     */
              setHoverable(o, v, M, E) {
                return this.applyToModels("setHoverable", o, v, M, E), this;
              }
              /** enable context menu and callback of selected atoms
              	     *
              	     * @param {AtomSelectionSpec} sel - atom selection to apply hoverable settings to
              	     * @param {boolean} contextMenuEnabled - whether contextMenu-handling is enabled for the selection
              
              	     */
              enableContextMenu(o, v) {
                return this.applyToModels("enableContextMenu", o, v), this;
              }
              /**
               * If  atoms have dx, dy, dz properties (in some xyz files), vibrate populates each model's frame property based on parameters.
               * Models can then be animated
               *
               * @param {number} numFrames - number of frames to be created, default to 10
               * @param {number} amplitude - amplitude of distortion, default to 1 (full)
               * @param {boolean} bothWays - if true, extend both in positive and negative directions by numFrames
               * @param {ArrowSpec} arrowSpec - specification for drawing animated arrows. If color isn't specified, atom color (sphere, stick, line preference) is used.
               */
              vibrate(o, v, M, E) {
                return this.applyToModels("vibrate", o, v, M, this, E), this;
              }
              /**
               * @param {AtomSelectionSpec} sel
               * @param {string} prop
               * @param {Gradient|string} scheme
               * @param {object} range
               */
              setColorByProperty(o, v, M, E) {
                return this.applyToModels("setColorByProperty", o, v, M, E), this;
              }
              /**
               * @param {AtomSelectionSpec} sel
               * @param {object} colors
               */
              setColorByElement(o, v) {
                return this.applyToModels("setColorByElement", o, v), this;
              }
              /**
               *
               * @param {AtomSpec[]} atomlist
               * @param {Array}
               *            extent
               * @return {Array}
               */
              static getAtomsWithin(o, v) {
                var M = [];
                for (let $ = 0; $ < o.length; $++) {
                  var E = o[$];
                  typeof E > "u" || E.x < v[0][0] || E.x > v[1][0] || E.y < v[0][1] || E.y > v[1][1] || E.z < v[0][2] || E.z > v[1][2] || M.push(E);
                }
                return M;
              }
              // return volume of extent
              static volume(o) {
                var v = o[1][0] - o[0][0], M = o[1][1] - o[0][1], E = o[1][2] - o[0][2];
                return v * M * E;
              }
              // volume
              /*
               * Break up bounding box/atoms into smaller pieces so we can parallelize
               * with webworkers and also limit the size of the working memory Returns
               * a list of bounding boxes with the corresponding atoms. These extents
               * are expanded by 4 angstroms on each side.
               */
              /**
               *
               * @param {Array}
               *            extent
               * @param {AtomSpec[]} atomlist
               * @param {AtomSpec[]} atomstoshow
               * @return {Array}
               */
              carveUpExtent(o, v, M) {
                let E = [], $ = {};
                for (let N = 0, W = v.length; N < W; N++)
                  $[v[N].index] = N;
                let k = function(N) {
                  let W = [];
                  for (let B = 0, P = N.length; B < P; B++)
                    N[B].index in $ && W.push($[N[B].index]);
                  return W;
                }, L = function(N) {
                  let W = [];
                  return W[0] = [N[0][0], N[0][1], N[0][2]], W[1] = [N[1][0], N[1][1], N[1][2]], W;
                }, z = function(N) {
                  if (s.volume(N) < s.maxVolume)
                    return [N];
                  var W = N[1][0] - N[0][0], B = N[1][1] - N[0][1], P = N[1][2] - N[0][2], G;
                  W > B && W > P ? G = 0 : B > W && B > P ? G = 1 : G = 2;
                  var H = L(N), U = L(N), j = (N[1][G] - N[0][G]) / 2 + N[0][G];
                  H[1][G] = j, U[0][G] = j;
                  var re = z(H), ie = z(U);
                  return re.concat(ie);
                }, O = z(o), R = 6;
                for (let N = 0, W = O.length; N < W; N++) {
                  let B = L(O[N]);
                  B[0][0] -= R, B[0][1] -= R, B[0][2] -= R, B[1][0] += R, B[1][1] += R, B[1][2] += R;
                  let P = s.getAtomsWithin(v, B), G = s.getAtomsWithin(M, O[N]);
                  E.push({
                    extent: O[N],
                    atoms: k(P),
                    toshow: k(G)
                  });
                }
                return E;
              }
              // create a mesh defined from the passed vertices and faces and material
              // Just create a single geometry chunk - broken up whether sync or not
              /**
               *
               * @param {AtomSpec[]} atoms
               * @param {{vertices:number,faces:number}}
               *            VandF
               * @param {MeshLambertMaterial}
               *            mat
               * @return {Mesh}
               */
              static generateSurfaceMesh(o, v, M) {
                var E = new r.Geometry(!0), $ = E.updateGeoGroup(0), k = [];
                for (let he = 0, ne = o.length; he < ne; he++) {
                  var L = o[he];
                  L && (typeof L.surfaceColor < "u" ? k[he] = L.surfaceColor : L.color && (k[he] = l.CC.color(L.color)));
                }
                var z = $.vertexArray, O = v.vertices;
                for (let he = 0, ne = O.length; he < ne; he++) {
                  let _e = $.vertices * 3;
                  z[_e] = O[he].x, z[_e + 1] = O[he].y, z[_e + 2] = O[he].z, $.vertices++;
                }
                var R = $.colorArray;
                let N = $.atomArray;
                if (M.voldata && M.volscheme) {
                  var W = M.volscheme, B = M.voldata, P = W.range() || [-1, 1];
                  for (let he = 0, ne = O.length; he < ne; he++) {
                    let _e = O[he].atomid, Le = B.getVal(O[he].x, O[he].y, O[he].z), Be = l.CC.color(W.valueToHex(Le, P)), Ue = he * 3;
                    R[Ue] = Be.r, R[Ue + 1] = Be.g, R[Ue + 2] = Be.b, N[he] = o[_e];
                  }
                } else if (k.length > 0)
                  for (let he = 0, ne = O.length; he < ne; he++) {
                    let _e = O[he].atomid, Le = he * 3;
                    R[Le] = k[_e].r, R[Le + 1] = k[_e].g, R[Le + 2] = k[_e].b, N[he] = o[_e];
                  }
                var G = v.faces;
                $.faceidx = G.length, E.initTypedArrays();
                var H = $.vertexArray, U = $.normalArray, j, re, ie, te;
                for (let he = 0, ne = G.length; he < ne; he += 3) {
                  var ue = G[he], de = G[he + 1], oe = G[he + 2], J = ue * 3, Ee = de * 3, se = oe * 3;
                  j = new a.Vector3(H[J], H[J + 1], H[J + 2]), re = new a.Vector3(H[Ee], H[Ee + 1], H[Ee + 2]), ie = new a.Vector3(H[se], H[se + 1], H[se + 2]), ie.subVectors(ie, re), j.subVectors(j, re), ie.cross(j), te = ie, te.normalize(), U[J] += te.x, U[Ee] += te.x, U[se] += te.x, U[J + 1] += te.y, U[Ee + 1] += te.y, U[se + 1] += te.y, U[J + 2] += te.z, U[Ee + 2] += te.z, U[se + 2] += te.z;
                }
                $.faceArray = new Uint16Array(G);
                var Ae = new r.Mesh(E, M);
                return Ae;
              }
              // do same thing as worker in main thread
              /**
               *
               * @param {SurfaceType}
               *            type
               * @param {Array}
               *            expandedExtent
               * @param {AtomSpec[]}
               *            extendedAtoms
               * @param {AtomSpec[]}
               *            atomsToShow
               * @param {AtomSpec[]} atoms
               * @param {number}
               *            vol
               * @return {Object}
               */
              static generateMeshSyncHelper(o, v, M, E, $, k) {
                var L = new x.ProteinSurface();
                return L.initparm(v, o !== 1, k), L.fillvoxels($, M), L.buildboundary(), (o == x.SurfaceType.SES || o == x.SurfaceType.MS) && (L.fastdistancemap(), L.boundingatom(!1), L.fillvoxelswaals($, M)), L.marchingcube(o), L.getFacesAndVertices(E);
              }
              /*
               *
               * @param {SurfaceStyleSpec}
               *            style
               * @return {MeshLambertMaterial}
               */
              static getMatWithStyle(o) {
                let v = null;
                o.onesided ? v = new r.MeshLambertMaterial() : v = new r.MeshDoubleLambertMaterial(), v.vertexColors = r.Coloring.VertexColors;
                for (var M in o)
                  M === "color" || M === "map" || o.hasOwnProperty(M) && (v[M] = o[M]);
                return o.opacity !== void 0 && (o.opacity === 1 ? v.transparent = !1 : v.transparent = !0), v;
              }
              /**
               * Adds an explicit mesh as a surface object.
               * @param {Mesh}
               *            mesh
               * @param {Object}
               *            style
               * @returns {number} surfid
               */
              addMesh(o) {
                var v = {
                  geo: o.geometry,
                  mat: o.material,
                  done: !0,
                  finished: !1
                  //the rendered finishes surfaces when they are done
                }, M = this.nextSurfID();
                return this.surfaces[M] = [v], M;
              }
              //return a shallow copy of list l, e.g., for atoms so we can
              //ignore superficial changes (ie surfacecolor, position) that happen
              //while we're surface building
              static shallowCopy(o) {
                var v = [];
                let M = o.length;
                for (let E = 0; E < M; E++)
                  v[E] = (0, h.extend)({}, o[E]);
                return v;
              }
              /**
               * Add surface representation to atoms
               * @param {SurfaceType|string} type - Surface type (VDW, MS, SAS, or SES)
               * @param {SurfaceStyleSpec} style - optional style specification for surface material (e.g. for different coloring scheme, etc)
               * @param {AtomSelectionSpec} atomsel - Show surface for atoms in this selection
               * @param {AtomSelectionSpec} allsel - Use atoms in this selection to calculate surface; may be larger group than 'atomsel'
               * @param {AtomSelectionSpec} focus - Optionally begin rendering surface specified atoms
               * @param {function} surfacecallback - function to be called after setting the surface
               * @return {Promise} promise - Returns a promise that ultimately resovles to the surfid.  Returns surfid immediately if surfacecallback is specified.  Returned promise has a [surfid, GLViewer, style, atomsel, allsel, focus] fields for immediate access.
               */
              addSurface(o, v = {}, M = {}, E, $, k) {
                let L = this.nextSurfID(), z = null, O = this, R = x.SurfaceType.VDW;
                typeof o == "string" ? s.surfaceTypeMap[o.toUpperCase()] !== void 0 ? R = s.surfaceTypeMap[o] : console.log("Surface type : " + o + " is not recognized") : typeof o == "number" && (R = o);
                var N = null, W = null, B = s.shallowCopy(this.getAtomsFromSel(M));
                E ? N = s.shallowCopy(this.getAtomsFromSel(E)) : N = B, (0, h.adjustVolumeStyle)(v);
                var P = !1, G;
                for (G = 0; G < this.models.length; G++)
                  if (this.models[G]) {
                    var H = this.models[G].getSymmetries();
                    if (H.length > 1 || H.length == 1 && !H[0].isIdentity()) {
                      P = !0;
                      break;
                    }
                  }
                var U = function(oe, J, Ee) {
                  $ ? W = s.shallowCopy(O.getAtomsFromSel($)) : W = Ee;
                  var se, Ae = (0, h.getExtent)(Ee, !0);
                  if (v.map && v.map.prop) {
                    var he = v.map.prop;
                    let Te = (0, c.getGradient)(v.map.scheme || v.map.gradient || new c.Gradient.RWB()), Me = Te.range();
                    Me || (Me = (0, h.getPropertyRange)(Ee, he)), v.colorscheme = { prop: he, gradient: Te };
                  }
                  for (let Te = 0, Me = J.length; Te < Me; Te++)
                    se = J[Te], se.surfaceColor = (0, h.getColorFromStyle)(se, v);
                  var ne = s.volume(Ae), _e = O.carveUpExtent(Ae, J, Ee);
                  if (W && W.length && W.length > 0) {
                    var Le = (0, h.getExtent)(W, !0), Be = function(Te, Me) {
                      var De = function(ee, ye) {
                        var ce = ee.extent, Ie = ce[1][0] - ce[0][0], ke = ce[1][1] - ce[0][1], Y = ce[1][2] - ce[0][2], me = Ie - ye[2][0];
                        me *= me;
                        var we = ke - ye[2][1];
                        we *= we;
                        var Re = Y - ye[2][2];
                        return Re *= Re, me + we + Re;
                      }, V = De(Te, Le), Z = De(Me, Le);
                      return V - Z;
                    };
                    _e.sort(Be);
                  }
                  var Ue = [];
                  for (let Te = 0, Me = J.length; Te < Me; Te++)
                    se = J[Te], Ue[Te] = {
                      x: se.x,
                      y: se.y,
                      z: se.z,
                      serial: Te,
                      elem: se.elem
                    };
                  var He = !!x.syncSurface;
                  if (He) {
                    var We = function(Me) {
                      return new Promise(function(De) {
                        for (var V = s.generateMeshSyncHelper(R, _e[Me].extent, _e[Me].atoms, _e[Me].toshow, Ue, ne), Z = (0, m.splitMesh)({ vertexArr: V.vertices, faceArr: V.faces }), ee = 0, ye = Z.length; ee < ye; ee++) {
                          V = {
                            vertices: Z[ee].vertexArr,
                            faces: Z[ee].faceArr
                          };
                          var ce = s.generateSurfaceMesh(J, V, z);
                          (0, h.mergeGeos)(oe.geo, ce);
                        }
                        O.render(), De();
                      });
                    }, Ge = [];
                    for (let Te = 0; Te < _e.length; Te++)
                      Ge.push(We(Te));
                    return Promise.all(Ge).then(function() {
                      return oe.done = !0, Promise.resolve(L);
                    });
                  } else {
                    var Ne = [];
                    R < 0 && (R = 0);
                    for (let Te = 0, Me = s.numWorkers; Te < Me; Te++) {
                      var Pe = new Worker($3Dmol.SurfaceWorker);
                      Ne.push(Pe), Pe.postMessage({
                        type: -1,
                        atoms: Ue,
                        volume: ne
                      });
                    }
                    return new Promise(function(Te, Me) {
                      var De = 0, V = function() {
                        !Ne || !Ne.length || Ne.forEach(function(ce) {
                          ce && ce.terminate && ce.terminate();
                        });
                      }, Z = function(ce) {
                        for (var Ie = (0, m.splitMesh)({
                          vertexArr: ce.data.vertices,
                          faceArr: ce.data.faces
                        }), ke = 0, Y = Ie.length; ke < Y; ke++) {
                          var me = {
                            vertices: Ie[ke].vertexArr,
                            faces: Ie[ke].faceArr
                          }, we = s.generateSurfaceMesh(J, me, z);
                          (0, h.mergeGeos)(oe.geo, we);
                        }
                        O.render(), De++, De == _e.length && (oe.done = !0, V(), Te(L));
                      }, ee = function(ce) {
                        V(), console.log(ce.message + " (" + ce.filename + ":" + ce.lineno + ")"), Me(ce);
                      };
                      for (let ce = 0; ce < _e.length; ce++) {
                        var ye = Ne[ce % Ne.length];
                        ye.onmessage = Z, ye.onerror = ee, ye.postMessage({
                          type: R,
                          expandedExtent: _e[ce].extent,
                          extendedAtoms: _e[ce].atoms,
                          atomsToShow: _e[ce].toshow
                        });
                      }
                    });
                  }
                };
                v = v || {}, z = s.getMatWithStyle(v);
                var j = [];
                j.style = v, j.atomsel = M, j.allsel = E, j.focus = $;
                var re = null;
                if (P) {
                  var ie = {}, te = {};
                  for (G = 0; G < this.models.length; G++)
                    ie[G] = [], te[G] = [];
                  for (G = 0; G < N.length; G++)
                    ie[N[G].model].push(N[G]);
                  for (G = 0; G < B.length; G++)
                    te[B[G].model].push(B[G]);
                  var ue = [];
                  for (G = 0; G < this.models.length; G++)
                    te[G].length > 0 && (j.push({
                      geo: new r.Geometry(!0),
                      mat: z,
                      done: !1,
                      finished: !1,
                      symmetries: this.models[G].getSymmetries()
                      // also webgl initialized
                    }), ue.push(U(j[j.length - 1], ie[G], te[G])));
                  re = Promise.all(ue);
                } else
                  j.push({
                    geo: new r.Geometry(!0),
                    mat: z,
                    done: !1,
                    finished: !1,
                    symmetries: [new a.Matrix4()]
                  }), re = U(j[j.length - 1], N, B);
                return this.surfaces[L] = j, re.surfid = L, k && typeof k == "function" ? (re.then(function(de) {
                  k(de);
                }), L) : re;
              }
              /**
               * Set the surface material to something else, must render change
               * @param {number} surf - Surface ID to apply changes to
               * @param {SurfaceStyleSpec} style - new material style specification
               @example
               $3Dmol.get("data/9002806.cif",function(data){
                  viewer.addModel(data);
                  viewer.setStyle({stick:{}});
                  let surf = viewer.addSurface("SAS");
                  surf.then(function() {
                      viewer.setSurfaceMaterialStyle(surf.surfid, {color:'blue',opacity:0.5});
                      viewer.render();
                      });
                 });
               */
              setSurfaceMaterialStyle(o, v) {
                if ((0, h.adjustVolumeStyle)(v), this.surfaces[o]) {
                  var M = this.surfaces[o];
                  for (let $ = 0; $ < M.length; $++) {
                    var E = M[$].mat = s.getMatWithStyle(v);
                    if (M[$].mat.side = r.FrontSide, v.color) {
                      M[$].mat.color = l.CC.color(v.color), M[$].geo.colorsNeedUpdate = !0;
                      const k = l.CC.color(v.color);
                      M[$].geo.setColor(k);
                    } else if (E.voldata && E.volscheme) {
                      const k = E.volscheme, L = E.voldata, z = l.CC, O = k.range() || [-1, 1];
                      M[$].geo.setColors(function(R, N, W) {
                        let B = L.getVal(R, N, W);
                        return z.color(k.valueToHex(B, O));
                      });
                    } else {
                      M[$].geo.colorsNeedUpdate = !0;
                      for (let k of M[$].geo.geometryGroups)
                        for (let L = 0; L < k.vertices; L++) {
                          let z = (0, h.getColorFromStyle)(k.atomArray[L], v), O = 3 * L;
                          k.colorArray[O] = z.r, k.colorArray[O + 1] = z.g, k.colorArray[O + 2] = z.b;
                        }
                    }
                    M[$].finished = !1;
                  }
                }
                return this;
              }
              /**
               * Return surface object
               * @param {number} surf - surface id
               */
              getSurface(o) {
                return this.surfaces[o];
              }
              /**
               * Remove surface with given ID
               * @param {number} surf - surface id
               */
              removeSurface(o) {
                for (var v = this.surfaces[o], M = 0; M < v.length; M++)
                  v[M] && v[M].lastGL && (v[M].geo !== void 0 && v[M].geo.dispose(), v[M].mat !== void 0 && v[M].mat.dispose(), this.modelGroup.remove(v[M].lastGL));
                return delete this.surfaces[o], this.show(), this;
              }
              /** Remove all surfaces.
               **/
              removeAllSurfaces() {
                for (var o in this.surfaces)
                  if (this.surfaces.hasOwnProperty(o)) {
                    for (var v = this.surfaces[o], M = 0; M < v.length; M++)
                      v[M] && v[M].lastGL && (v[M].geo !== void 0 && v[M].geo.dispose(), v[M].mat !== void 0 && v[M].mat.dispose(), this.modelGroup.remove(v[M].lastGL));
                    delete this.surfaces[o];
                  }
                return this.show(), this;
              }
              /** return Jmol moveto command to position this scene */
              jmolMoveTo() {
                var o = this.modelGroup.position, v = "center { " + -o.x + " " + -o.y + " " + -o.z + " }; ", M = this.rotationGroup.quaternion;
                return v += "moveto .5 quaternion { " + M.x + " " + M.y + " " + M.z + " " + M.w + " };", v;
              }
              /** Clear scene of all objects
               * */
              clear() {
                return this.removeAllSurfaces(), this.removeAllModels(), this.removeAllLabels(), this.removeAllShapes(), this.show(), this;
              }
              // props is a list of objects that select certain atoms and enumerate
              // properties for those atoms
              /**
               * Add specified properties to all atoms matching input argument
               * @param {Object} props, either array of atom selectors with associated props, or function that takes atom and sets its properties
               * @param {AtomSelectionSpec} sel  - subset of atoms to work on - model selection must be specified here
                   @example
                   $3Dmol.get('../test_structs/b.sdf', function(data){
                            viewer.addModel(data,'sdf');
                            let props = [];
                            //make the atom index a property x
                            for(let i = 0; i < 8; i++) {
                              props.push({index:i,props:{'x':i}});
                            }
                            viewer.mapAtomProperties(props);
                            viewer.setStyle({sphere:{colorscheme:{gradient:'roygb',prop:'x',min:0,max:8}}});
                            viewer.zoomTo();
                            viewer.render();
                          });
               */
              mapAtomProperties(o, v) {
                v = v || {};
                var M = this.getAtomsFromSel(v);
                if (typeof o == "function")
                  for (let k = 0, L = M.length; k < L; k++) {
                    let z = M[k];
                    o(z);
                  }
                else
                  for (let k = 0, L = M.length; k < L; k++) {
                    var E = M[k];
                    for (let z = 0, O = o.length; z < O; z++) {
                      let R = o[z];
                      if (R.props)
                        for (var $ in R.props)
                          R.props.hasOwnProperty($) && this.atomIsSelected(E, R) && (E.properties || (E.properties = {}), E.properties[$] = R.props[$]);
                    }
                  }
                return this;
              }
              /**
               * Synchronize this view matrix of this viewer to the passed viewer.
               * When the viewpoint of this viewer changes, the other viewer will
               * be set to this viewer's view.
               * @param {GLViewer} otherview
               */
              linkViewer(o) {
                return this.linkedViewers.push(o), this;
              }
              /**
               * Return the z distance between the model and the camera
               * @return {number} distance
               */
              getPerceivedDistance() {
                return this.CAMERA_Z - this.rotationGroup.position.z;
              }
              /**
               * Set the distance between the model and the camera
               * Essentially zooming. Useful while stereo rendering.
               */
              setPerceivedDistance(o) {
                this.rotationGroup.position.z = this.CAMERA_Z - o;
              }
              /**
               * Used for setting an approx value of eyeSeparation. Created for calling by StereoViewer object
               * @return {number} camera x position
               */
              setAutoEyeSeparation(o, v) {
                var M = this.getPerceivedDistance();
                return v || (v = 5), o || this.camera.position.x > 0 ? this.camera.position.x = M * Math.tan(Math.PI / 180 * v) : this.camera.position.x = -M * Math.tan(Math.PI / 180 * v), this.camera.lookAt(new a.Vector3(0, 0, this.rotationGroup.position.z)), this.camera.position.x;
              }
              /**
               * Set the default cartoon quality for newly created models.  Default is 5.
               * Current models are not affected.
               * @number quality, higher results in higher resolution renders
               */
              setDefaultCartoonQuality(o) {
                this.config.cartoonQuality = o;
              }
            }
            s.numWorkers = 4, s.maxVolume = 64e3, s.surfaceTypeMap = {
              VDW: x.SurfaceType.VDW,
              MS: x.SurfaceType.MS,
              SAS: x.SurfaceType.SAS,
              SES: x.SurfaceType.SES
            };
            function u(w, o) {
              if (w = (0, h.getElement)(w), !!w) {
                o = o || {};
                try {
                  var v = new s(w, o);
                  return v;
                } catch (M) {
                  throw "error creating viewer: " + M;
                }
              }
            }
            function p(w, o = {}, v = {}) {
              if (w = (0, h.getElement)(w), !!w) {
                var M = [], E = document.createElement("canvas");
                v.rows = o.rows, v.cols = o.cols, v.control_all = o.control_all != null ? o.control_all : !1, w.appendChild(E);
                try {
                  for (var $ = 0; $ < o.rows; $++) {
                    for (var k = [], L = 0; L < o.cols; L++) {
                      v.row = $, v.col = L, v.canvas = E, v.viewers = M, v.control_all = o.control_all;
                      var z = u(w, (0, h.extend)({}, v));
                      k.push(z);
                    }
                    M.unshift(k);
                  }
                } catch (O) {
                  throw "error creating viewer grid: " + O;
                }
                return M;
              }
            }
            function g(w) {
              var o = this;
              if (w = (0, h.getElement)(w), !!w) {
                var v = p(w, { rows: 1, cols: 2, control_all: !0 });
                this.glviewer1 = v[0][0], this.glviewer2 = v[0][1], this.glviewer1.setAutoEyeSeparation(!1), this.glviewer2.setAutoEyeSeparation(!0), this.glviewer1.linkViewer(this.glviewer2), this.glviewer2.linkViewer(this.glviewer1);
                for (var M = Object.getOwnPropertyNames(this.glviewer1.__proto__).filter(function($) {
                  return typeof o.glviewer1[$] == "function";
                }), E = 0; E < M.length; E++)
                  this[M[E]] = /* @__PURE__ */ function($) {
                    return function() {
                      var k = this.glviewer1[$].apply(this.glviewer1, arguments), L = this.glviewer2[$].apply(this.glviewer2, arguments);
                      return [k, L];
                    };
                  }(M[E]);
                this.setCoordinates = function($, k, L) {
                  for (var z = 0; z < $.length; z++)
                    $[z].setCoordinates(k, L);
                }, this.surfacesFinished = function() {
                  return this.glviewer1.surfacesFinished() && this.glviewer2.surfacesFinished();
                }, this.isAnimated = function() {
                  return this.glviewer1.isAnimated() || this.glviewer2.isAnimated();
                }, this.render = function($) {
                  this.glviewer1.render(), this.glviewer2.render(), $ && $(this);
                }, this.getCanvas = function() {
                  return this.glviewer1.getCanvas();
                };
              }
            }
          }
        ),
        /***/
        "./src/Gradient.ts": (
          /*!*************************!*\
            !*** ./src/Gradient.ts ***!
            \*************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CustomLinear: () => (
                /* binding */
                m
              ),
              /* harmony export */
              Gradient: () => (
                /* binding */
                x
              ),
              /* harmony export */
              GradientType: () => (
                /* binding */
                a
              ),
              /* harmony export */
              ROYGB: () => (
                /* binding */
                d
              ),
              /* harmony export */
              RWB: () => (
                /* binding */
                c
              ),
              /* harmony export */
              Sinebow: () => (
                /* binding */
                _
              ),
              /* harmony export */
              builtinGradients: () => (
                /* binding */
                y
              ),
              /* harmony export */
              getGradient: () => (
                /* binding */
                h
              ),
              /* harmony export */
              normalizeValue: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./colors */
              "./src/colors.ts"
            );
            class a {
            }
            function l(b, A, f) {
              return A >= b ? (f < b && (f = b), f > A && (f = A), { lo: b, hi: A, val: f }) : (f > b && (f = b), f < A && (f = A), f = b - f + A, { lo: A, hi: b, val: f });
            }
            function h(b) {
              if (b instanceof a)
                return b;
              if (b.gradient !== void 0 && y[b.gradient]) {
                let A = b.min === void 0 ? -1 : b.min, f = b.max === void 0 ? 1 : b.max;
                return b.mid === void 0 ? b.colors === void 0 ? new y[b.gradient](A, f) : new y[b.gradient](A, f, b.colors) : new y[b.gradient](A, f, b.mid);
              } else if (typeof b.gradient == "string" && b.gradient.startsWith("linear_")) {
                let A = b.gradient.split("_");
                A.shift();
                let f = b.min === void 0 ? -1 : b.min, s = b.max === void 0 ? 1 : b.max;
                return new m(f, s, A);
              }
              return b;
            }
            class c extends a {
              constructor(A, f, s) {
                super(), this.gradient = "RWB", this.mult = 1, this.mid = s, this.min = A, this.max = f, typeof f > "u" && Array.isArray(A) && A.length >= 2 ? (this.max = A[1], this.min = A[0]) : A && f && !Array.isArray(A) && (this.min = A, this.max = f);
              }
              //return range used for color mapping, null if none set
              range() {
                return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null;
              }
              //map value to hex color, range is provided
              valueToHex(A, f) {
                var s, u;
                if (A = this.mult * A, f ? (s = f[0], u = f[1]) : (s = this.min, u = this.max), A === void 0)
                  return 16777215;
                var p = l(s, u, A);
                s = p.lo, u = p.hi, A = p.val;
                var g = (u + s) / 2;
                f && typeof f[2] < "u" ? g = f[2] : typeof this.mid < "u" ? g = this.mid : g = (s + u) / 2;
                var w, o;
                return A < g ? (w = Math.floor(255 * Math.sqrt((A - s) / (g - s))), o = 16711680 + 256 * w + w, o) : A > g ? (w = Math.floor(255 * Math.sqrt(1 - (A - g) / (u - g))), o = 65536 * w + 256 * w + 255, o) : 16777215;
              }
            }
            class d extends a {
              constructor(A, f) {
                super(), this.gradient = "ROYGB", this.mult = 1, this.min = A, this.max = f, typeof f > "u" && Array.isArray(A) && A.length >= 2 ? (this.max = A[1], this.min = A[0]) : A && f && !Array.isArray(A) && (this.min = A, this.max = f);
              }
              //map value to hex color, range is provided
              valueToHex(A, f) {
                var s, u;
                if (A = this.mult * A, f ? (s = f[0], u = f[1]) : (s = this.min, u = this.max), typeof A > "u")
                  return 16777215;
                var p = l(s, u, A);
                s = p.lo, u = p.hi, A = p.val;
                var g = (s + u) / 2, w = (s + g) / 2, o = (g + u) / 2, v, M;
                return A < w ? (v = Math.floor(255 * Math.sqrt((A - s) / (w - s))), M = 16711680 + 256 * v + 0, M) : A < g ? (v = Math.floor(255 * Math.sqrt(1 - (A - w) / (g - w))), M = 65536 * v + 65280 + 0, M) : A < o ? (v = Math.floor(255 * Math.sqrt((A - g) / (o - g))), M = 65280 + 1 * v, M) : (v = Math.floor(255 * Math.sqrt(1 - (A - o) / (u - o))), M = 0 + 256 * v + 255, M);
              }
              //return range used for color mapping, null if none set
              range() {
                return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null;
              }
            }
            class _ extends a {
              constructor(A, f) {
                super(), this.gradient = "Sinebow", this.mult = 1, this.min = A, this.max = f, typeof f > "u" && Array.isArray(A) && A.length >= 2 && (this.max = A[1], this.min = A[0]), f < A && (this.mult = -1, this.min *= -1, this.max *= -1);
              }
              //map value to hex color, range is provided
              valueToHex(A, f) {
                var s, u;
                if (A = this.mult * A, f ? (s = f[0], u = f[1]) : (s = this.min, u = this.max), typeof A > "u")
                  return 16777215;
                var p = x.normalizeValue(s, u, A);
                s = p.lo, u = p.hi, A = p.val;
                var g = (A - s) / (u - s), w = 5 * g / 6 + 0.5, o = Math.sin(Math.PI * w);
                o *= o * 255;
                var v = Math.sin(Math.PI * (w + 1 / 3));
                v *= v * 255;
                var M = Math.sin(Math.PI * (w + 2 / 3));
                return M *= M * 255, 65536 * Math.floor(o) + 256 * Math.floor(M) + 1 * Math.floor(v);
              }
              //return range used for color mapping, null if none set
              range() {
                return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null;
              }
            }
            class m extends a {
              constructor(A, f, s) {
                super(), this.gradient = "linear", this.colors = new Array();
                var u;
                if (Array.isArray(A) && A.length >= 2 ? (this.max = A[1], this.min = A[0], u = f) : (this.min = A, this.max = f, u = s), u)
                  for (let p of u)
                    this.colors.push(r.CC.color(p));
                else
                  this.colors.push(r.CC.color(0));
              }
              //return range used for color mapping, null if none set
              range() {
                return typeof this.min < "u" && typeof this.max < "u" ? [this.min, this.max] : null;
              }
              //map value to hex color, range is provided
              valueToHex(A, f) {
                var s, u;
                if (f ? (s = f[0], u = f[1]) : (s = this.min, u = this.max), A === void 0)
                  return 16777215;
                var p = l(s, u, A);
                s = p.lo, u = p.hi, A = p.val;
                let g = this.colors.length, w = (u - s) / g, o = Math.min(Math.floor((A - s) / w), g - 1), v = Math.min(o + 1, g - 1), M = (A - s - o * w) / w, E = this.colors[o], $ = this.colors[v];
                return new r.Color(E.r + M * ($.r - E.r), E.g + M * ($.g - E.g), E.b + M * ($.b - E.b)).getHex();
              }
            }
            const y = {
              rwb: c,
              RWB: c,
              roygb: d,
              ROYGB: d,
              sinebow: _,
              linear: m
            };
            class x extends a {
              valueToHex(A, f) {
                return 0;
              }
              range() {
                return null;
              }
            }
            x.RWB = c, x.ROYGB = d, x.Sinebow = _, x.CustomLinear = m, x.builtinGradients = y, x.normalizeValue = l, x.getGradient = h;
          }
        ),
        /***/
        "./src/Label.ts": (
          /*!**********************!*\
            !*** ./src/Label.ts ***!
            \**********************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Label: () => (
                /* binding */
                _
              ),
              /* harmony export */
              LabelCount: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./Gradient */
              "./src/Gradient.ts"
            ), l = t(
              /*! ./colors */
              "./src/colors.ts"
            );
            let h = 0;
            function c(m, y, x, b, A, f, s) {
              m.beginPath(), m.moveTo(y + f, x), m.lineTo(y + b - f, x), m.quadraticCurveTo(y + b, x, y + b, x + f), m.lineTo(y + b, x + A - f), m.quadraticCurveTo(y + b, x + A, y + b - f, x + A), m.lineTo(y + f, x + A), m.quadraticCurveTo(y, x + A, y, x + A - f), m.lineTo(y, x + f), m.quadraticCurveTo(y, x, y + f, x), m.closePath(), m.fill(), s && m.stroke();
            }
            function d(m, y, x) {
              var b = x;
              return typeof m < "u" && (m instanceof l.Color ? b = m.scaled() : (b = l.CC.color(m), typeof b.scaled < "u" && (b = b.scaled()))), typeof y < "u" && (b.a = parseFloat(y)), b;
            }
            class _ {
              constructor(y, x) {
                this.id = h++, this.stylespec = x || {}, this.canvas = document.createElement("canvas"), this.canvas.width = 134, this.canvas.height = 35, this.context = this.canvas.getContext("2d"), this.sprite = new r.Sprite(), this.text = y, this.frame = this.stylespec.frame;
              }
              getStyle() {
                return this.stylespec;
              }
              /** Hide this label. */
              hide() {
                this.sprite.visible = !1;
              }
              /** Show a hidden label. */
              show() {
                this.sprite.visible = !0;
              }
              setContext() {
                var y = this.stylespec, x = typeof y.useScreen > "u" ? !1 : y.useScreen, b = y.showBackground;
                (b === "0" || b === "false") && (b = !1), typeof b > "u" && (b = !0);
                var A = y.font ? y.font : "sans-serif", f = parseInt(y.fontSize) ? parseInt(y.fontSize) : 18, s = d(y.fontColor, y.fontOpacity, {
                  r: 255,
                  g: 255,
                  b: 255,
                  a: 1
                }), u = y.padding ? y.padding : 4, p = y.borderThickness ? y.borderThickness : 0, g = d(y.backgroundColor, y.backgroundOpacity, {
                  r: 0,
                  g: 0,
                  b: 0,
                  a: 1
                }), w = d(y.borderColor, y.borderOpacity, g), o = y.position ? y.position : {
                  x: -10,
                  y: 1,
                  z: 1
                }, v = y.inFront !== void 0 ? y.inFront : !0;
                (v === "false" || v === "0") && (v = !1);
                var M = y.alignment || r.SpriteAlignment.topLeft;
                typeof M == "string" && M in r.SpriteAlignment && (M = r.SpriteAlignment[M]);
                var E = "";
                y.bold && (E = "bold "), this.context.font = E + f + "px  " + A;
                var $ = this.context.measureText(this.text), k = $.width;
                b || (p = 0);
                var L = k + 2.5 * p + 2 * u, z = f * 1.25 + 2 * p + 2 * u;
                if (y.backgroundImage) {
                  var O = y.backgroundImage, R = y.backgroundWidth ? y.backgroundWidth : O.width, N = y.backgroundHeight ? y.backgroundHeight : O.height;
                  R > L && (L = R), N > z && (z = N);
                }
                if (this.canvas.width = L, this.canvas.height = z, this.context.clearRect(0, 0, this.canvas.width, this.canvas.height), E = "", y.bold && (E = "bold "), this.context.font = E + f + "px  " + A, this.context.fillStyle = "rgba(" + g.r + "," + g.g + "," + g.b + "," + g.a + ")", this.context.strokeStyle = "rgba(" + w.r + "," + w.g + "," + w.b + "," + w.a + ")", y.backgroundGradient) {
                  let B = this.context.createLinearGradient(0, z / 2, L, z / 2), P = a.Gradient.getGradient(y.backgroundGradient), G = P.range(), H = -1, U = 1;
                  G && (H = G[0], U = G[1]);
                  let j = U - H;
                  for (let re = 0; re < 1.01; re += 0.1) {
                    let ie = d(P.valueToHex(H + j * re)), te = "rgba(" + ie.r + "," + ie.g + "," + ie.b + "," + ie.a + ")";
                    B.addColorStop(re, te);
                  }
                  this.context.fillStyle = B;
                }
                this.context.lineWidth = p, b && c(this.context, p, p, L - 2 * p, z - 2 * p, 6, p > 0), y.backgroundImage && this.context.drawImage(O, 0, 0, L, z), this.context.fillStyle = "rgba(" + s.r + "," + s.g + "," + s.b + "," + s.a + ")", this.context.fillText(this.text, p + u, f + p + u, k);
                var W = new r.Texture(this.canvas);
                W.needsUpdate = !0, this.sprite.material = new r.SpriteMaterial({
                  map: W,
                  useScreenCoordinates: x,
                  alignment: M,
                  depthTest: !v,
                  screenOffset: y.screenOffset || null
                }), this.sprite.scale.set(1, 1, 1), this.sprite.position.set(o.x, o.y, o.z);
              }
              // clean up material and texture
              dispose() {
                this.sprite.material.map !== void 0 && this.sprite.material.map.dispose(), this.sprite.material !== void 0 && this.sprite.material.dispose();
              }
            }
          }
        ),
        /***/
        "./src/ProteinSurface4.ts": (
          /*!********************************!*\
            !*** ./src/ProteinSurface4.ts ***!
            \********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              MarchingCube: () => (
                /* binding */
                d
              ),
              /* harmony export */
              MarchingCubeInitializer: () => (
                /* binding */
                c
              ),
              /* harmony export */
              PointGrid: () => (
                /* binding */
                _
              ),
              /* harmony export */
              ProteinSurface: () => (
                /* binding */
                m
              ),
              /* harmony export */
              SurfaceType: () => (
                /* binding */
                a
              ),
              /* harmony export */
              setSyncSurface: () => (
                /* binding */
                h
              ),
              /* harmony export */
              syncSurface: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), a;
            (function(y) {
              y[y.VDW = 1] = "VDW", y[y.MS = 2] = "MS", y[y.SAS = 3] = "SAS", y[y.SES = 4] = "SES";
            })(a || (a = {}));
            var l = !1;
            function h(y) {
              l = y;
            }
            (window.navigator.userAgent.indexOf("MSIE ") >= 0 || window.navigator.userAgent.indexOf("Trident/") >= 0) && (l = !0);
            class c {
              constructor() {
                this.ISDONE = 2, this.edgeTable = new Uint32Array([
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  2816,
                  0,
                  0,
                  0,
                  1792,
                  0,
                  3328,
                  3584,
                  3840,
                  0,
                  0,
                  0,
                  138,
                  0,
                  21,
                  0,
                  134,
                  0,
                  0,
                  0,
                  652,
                  0,
                  2067,
                  3865,
                  3600,
                  0,
                  0,
                  0,
                  42,
                  0,
                  0,
                  0,
                  294,
                  0,
                  0,
                  21,
                  28,
                  0,
                  3875,
                  1049,
                  3360,
                  0,
                  168,
                  162,
                  170,
                  0,
                  645,
                  2475,
                  2210,
                  0,
                  687,
                  293,
                  172,
                  4010,
                  3747,
                  3497,
                  3232,
                  0,
                  0,
                  0,
                  0,
                  0,
                  69,
                  0,
                  900,
                  0,
                  0,
                  0,
                  1792,
                  138,
                  131,
                  1608,
                  1920,
                  0,
                  81,
                  0,
                  2074,
                  84,
                  85,
                  84,
                  86,
                  0,
                  81,
                  0,
                  3676,
                  330,
                  1105,
                  1881,
                  1616,
                  0,
                  0,
                  0,
                  42,
                  0,
                  69,
                  0,
                  502,
                  0,
                  0,
                  21,
                  3580,
                  138,
                  2035,
                  1273,
                  1520,
                  2816,
                  104,
                  2337,
                  106,
                  840,
                  581,
                  367,
                  102,
                  2816,
                  3695,
                  3429,
                  3180,
                  1898,
                  1635,
                  1385,
                  1120,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  3910,
                  0,
                  0,
                  69,
                  588,
                  42,
                  2083,
                  41,
                  2880,
                  0,
                  0,
                  0,
                  1722,
                  0,
                  2293,
                  4095,
                  3830,
                  0,
                  255,
                  757,
                  764,
                  2538,
                  2291,
                  3065,
                  2800,
                  0,
                  0,
                  81,
                  338,
                  0,
                  3925,
                  1119,
                  3414,
                  84,
                  855,
                  85,
                  340,
                  2130,
                  2899,
                  89,
                  2384,
                  1792,
                  712,
                  194,
                  1162,
                  4036,
                  3781,
                  3535,
                  3270,
                  708,
                  719,
                  197,
                  204,
                  3018,
                  2755,
                  2505,
                  2240,
                  0,
                  0,
                  0,
                  0,
                  168,
                  420,
                  168,
                  1958,
                  162,
                  162,
                  676,
                  2988,
                  170,
                  163,
                  680,
                  928,
                  3328,
                  3096,
                  3328,
                  3642,
                  52,
                  53,
                  1855,
                  1590,
                  2340,
                  2111,
                  2869,
                  2620,
                  298,
                  51,
                  825,
                  560,
                  3584,
                  3584,
                  3090,
                  3482,
                  1668,
                  1941,
                  1183,
                  1430,
                  146,
                  2975,
                  2069,
                  2460,
                  154,
                  915,
                  153,
                  400,
                  3840,
                  3592,
                  3329,
                  3082,
                  1796,
                  1541,
                  1295,
                  1030,
                  2818,
                  2575,
                  2309,
                  2060,
                  778,
                  515,
                  265,
                  0
                ]), this.triTable = [
                  [],
                  [],
                  [],
                  [],
                  [],
                  [],
                  [],
                  [11, 9, 8],
                  [],
                  [],
                  [],
                  [8, 10, 9],
                  [],
                  [10, 8, 11],
                  [9, 11, 10],
                  [8, 10, 9, 8, 11, 10],
                  [],
                  [],
                  [],
                  [1, 7, 3],
                  [],
                  [4, 2, 0],
                  [],
                  [2, 1, 7],
                  [],
                  [],
                  [],
                  [2, 7, 3, 2, 9, 7],
                  [],
                  [1, 4, 11, 1, 0, 4],
                  [3, 8, 0, 11, 9, 4, 11, 10, 9],
                  [4, 11, 9, 11, 10, 9],
                  [],
                  [],
                  [],
                  [5, 3, 1],
                  [],
                  [],
                  [],
                  [2, 5, 8, 2, 1, 5],
                  [],
                  [],
                  [2, 4, 0],
                  [3, 2, 4],
                  [],
                  [0, 9, 1, 8, 10, 5, 8, 11, 10],
                  [3, 4, 0, 3, 10, 4],
                  [5, 8, 10, 8, 11, 10],
                  [],
                  [3, 5, 7],
                  [7, 1, 5],
                  [1, 7, 3, 1, 5, 7],
                  [],
                  [9, 2, 0, 9, 7, 2],
                  [0, 3, 8, 1, 7, 11, 1, 5, 7],
                  [11, 1, 7, 1, 5, 7],
                  [],
                  [9, 1, 0, 5, 3, 2, 5, 7, 3],
                  [8, 2, 5, 8, 0, 2],
                  [2, 5, 3, 5, 7, 3],
                  [3, 9, 1, 3, 8, 9, 7, 11, 10, 7, 10, 5],
                  [9, 1, 0, 10, 7, 11, 10, 5, 7],
                  [3, 8, 0, 7, 10, 5, 7, 11, 10],
                  [11, 5, 7, 11, 10, 5],
                  [],
                  [],
                  [],
                  [],
                  [],
                  [0, 6, 2],
                  [],
                  [7, 2, 9, 7, 9, 8],
                  [],
                  [],
                  [],
                  [8, 10, 9],
                  [7, 1, 3],
                  [7, 1, 0],
                  [6, 9, 3, 6, 10, 9],
                  [7, 10, 8, 10, 9, 8],
                  [],
                  [6, 0, 4],
                  [],
                  [11, 1, 4, 11, 3, 1],
                  [2, 4, 6],
                  [2, 0, 4, 2, 4, 6],
                  [2, 4, 6],
                  [1, 4, 2, 4, 6, 2],
                  [],
                  [6, 0, 4],
                  [],
                  [2, 11, 3, 6, 9, 4, 6, 10, 9],
                  [8, 6, 1, 8, 1, 3],
                  [10, 0, 6, 0, 4, 6],
                  [8, 0, 3, 9, 6, 10, 9, 4, 6],
                  [10, 4, 6, 10, 9, 4],
                  [],
                  [],
                  [],
                  [5, 3, 1],
                  [],
                  [0, 6, 2],
                  [],
                  [7, 4, 8, 5, 2, 1, 5, 6, 2],
                  [],
                  [],
                  [2, 4, 0],
                  [7, 4, 8, 2, 11, 3, 10, 5, 6],
                  [7, 1, 3],
                  [5, 6, 10, 0, 9, 1, 8, 7, 4],
                  [5, 6, 10, 7, 0, 3, 7, 4, 0],
                  [10, 5, 6, 4, 8, 7],
                  [9, 11, 8],
                  [3, 5, 6],
                  [0, 5, 11, 0, 11, 8],
                  [6, 3, 5, 3, 1, 5],
                  [3, 9, 6, 3, 8, 9],
                  [9, 6, 0, 6, 2, 0],
                  [0, 3, 8, 2, 5, 6, 2, 1, 5],
                  [1, 6, 2, 1, 5, 6],
                  [9, 11, 8],
                  [1, 0, 9, 6, 10, 5, 11, 3, 2],
                  [6, 10, 5, 2, 8, 0, 2, 11, 8],
                  [3, 2, 11, 10, 5, 6],
                  [10, 5, 6, 9, 3, 8, 9, 1, 3],
                  [0, 9, 1, 5, 6, 10],
                  [8, 0, 3, 10, 5, 6],
                  [10, 5, 6],
                  [],
                  [],
                  [],
                  [],
                  [],
                  [],
                  [],
                  [1, 10, 2, 9, 11, 6, 9, 8, 11],
                  [],
                  [],
                  [6, 0, 2],
                  [3, 6, 9, 3, 2, 6],
                  [3, 5, 1],
                  [0, 5, 1, 0, 11, 5],
                  [0, 3, 5],
                  [6, 9, 11, 9, 8, 11],
                  [],
                  [],
                  [],
                  [4, 5, 9, 7, 1, 10, 7, 3, 1],
                  [],
                  [11, 6, 7, 2, 4, 5, 2, 0, 4],
                  [11, 6, 7, 8, 0, 3, 1, 10, 2, 9, 4, 5],
                  [6, 7, 11, 1, 10, 2, 9, 4, 5],
                  [],
                  [4, 1, 0, 4, 5, 1, 6, 7, 3, 6, 3, 2],
                  [9, 4, 5, 0, 6, 7, 0, 2, 6],
                  [4, 5, 9, 6, 3, 2, 6, 7, 3],
                  [6, 7, 11, 5, 3, 8, 5, 1, 3],
                  [6, 7, 11, 4, 1, 0, 4, 5, 1],
                  [4, 5, 9, 3, 8, 0, 11, 6, 7],
                  [9, 4, 5, 7, 11, 6],
                  [],
                  [],
                  [0, 6, 4],
                  [8, 6, 4, 8, 1, 6],
                  [],
                  [0, 10, 2, 0, 9, 10, 4, 8, 11, 4, 11, 6],
                  [10, 2, 1, 6, 0, 3, 6, 4, 0],
                  [10, 2, 1, 11, 4, 8, 11, 6, 4],
                  [4, 2, 6],
                  [1, 0, 9, 2, 4, 8, 2, 6, 4],
                  [2, 4, 0, 2, 6, 4],
                  [8, 2, 4, 2, 6, 4],
                  [11, 4, 1, 11, 6, 4],
                  [0, 9, 1, 4, 11, 6, 4, 8, 11],
                  [3, 6, 0, 6, 4, 0],
                  [8, 6, 4, 8, 11, 6],
                  [10, 8, 9],
                  [6, 3, 9, 6, 7, 3],
                  [6, 7, 1],
                  [10, 7, 1, 7, 3, 1],
                  [7, 11, 6, 8, 10, 2, 8, 9, 10],
                  [11, 6, 7, 10, 0, 9, 10, 2, 0],
                  [2, 1, 10, 7, 11, 6, 8, 0, 3],
                  [1, 10, 2, 6, 7, 11],
                  [7, 2, 6, 7, 9, 2],
                  [1, 0, 9, 3, 6, 7, 3, 2, 6],
                  [7, 0, 6, 0, 2, 6],
                  [2, 7, 3, 2, 6, 7],
                  [7, 11, 6, 3, 9, 1, 3, 8, 9],
                  [9, 1, 0, 11, 6, 7],
                  [0, 3, 8, 11, 6, 7],
                  [11, 6, 7],
                  [],
                  [],
                  [],
                  [],
                  [5, 3, 7],
                  [8, 5, 2, 8, 7, 5],
                  [5, 3, 7],
                  [1, 10, 2, 5, 8, 7, 5, 9, 8],
                  [1, 7, 5],
                  [1, 7, 5],
                  [9, 2, 7, 9, 7, 5],
                  [11, 3, 2, 8, 5, 9, 8, 7, 5],
                  [1, 3, 7, 1, 7, 5],
                  [0, 7, 1, 7, 5, 1],
                  [9, 3, 5, 3, 7, 5],
                  [9, 7, 5, 9, 8, 7],
                  [8, 10, 11],
                  [3, 4, 10, 3, 10, 11],
                  [8, 10, 11],
                  [5, 9, 4, 1, 11, 3, 1, 10, 11],
                  [2, 4, 5],
                  [5, 2, 4, 2, 0, 4],
                  [0, 3, 8, 5, 9, 4, 10, 2, 1],
                  [2, 1, 10, 9, 4, 5],
                  [2, 8, 5, 2, 11, 8],
                  [3, 2, 11, 1, 4, 5, 1, 0, 4],
                  [9, 4, 5, 8, 2, 11, 8, 0, 2],
                  [11, 3, 2, 9, 4, 5],
                  [8, 5, 3, 5, 1, 3],
                  [5, 0, 4, 5, 1, 0],
                  [3, 8, 0, 4, 5, 9],
                  [9, 4, 5],
                  [11, 9, 10],
                  [11, 9, 10],
                  [1, 11, 4, 1, 10, 11],
                  [8, 7, 4, 11, 1, 10, 11, 3, 1],
                  [2, 7, 9, 2, 9, 10],
                  [4, 8, 7, 0, 10, 2, 0, 9, 10],
                  [2, 1, 10, 0, 7, 4, 0, 3, 7],
                  [10, 2, 1, 8, 7, 4],
                  [1, 7, 4],
                  [3, 2, 11, 4, 8, 7, 9, 1, 0],
                  [11, 4, 2, 4, 0, 2],
                  [2, 11, 3, 7, 4, 8],
                  [4, 1, 7, 1, 3, 7],
                  [1, 0, 9, 8, 7, 4],
                  [3, 4, 0, 3, 7, 4],
                  [8, 7, 4],
                  [8, 9, 10, 8, 10, 11],
                  [3, 9, 11, 9, 10, 11],
                  [0, 10, 8, 10, 11, 8],
                  [10, 3, 1, 10, 11, 3],
                  [2, 8, 10, 8, 9, 10],
                  [9, 2, 0, 9, 10, 2],
                  [8, 0, 3, 1, 10, 2],
                  [10, 2, 1],
                  [1, 11, 9, 11, 8, 9],
                  [11, 3, 2, 0, 9, 1],
                  [11, 0, 2, 11, 8, 0],
                  [11, 3, 2],
                  [8, 1, 3, 8, 9, 1],
                  [9, 1, 0],
                  [8, 0, 3],
                  []
                ], this.edgeTable2 = [
                  0,
                  265,
                  515,
                  778,
                  2060,
                  2309,
                  2575,
                  2822,
                  1030,
                  1295,
                  1541,
                  1804,
                  3082,
                  3331,
                  3593,
                  3840,
                  400,
                  153,
                  915,
                  666,
                  2460,
                  2197,
                  2975,
                  2710,
                  1430,
                  1183,
                  1941,
                  1692,
                  3482,
                  3219,
                  3993,
                  3728,
                  560,
                  825,
                  51,
                  314,
                  2620,
                  2869,
                  2111,
                  2358,
                  1590,
                  1855,
                  1077,
                  1340,
                  3642,
                  3891,
                  3129,
                  3376,
                  928,
                  681,
                  419,
                  170,
                  2988,
                  2725,
                  2479,
                  2214,
                  1958,
                  1711,
                  1445,
                  1196,
                  4010,
                  3747,
                  3497,
                  3232,
                  2240,
                  2505,
                  2755,
                  3018,
                  204,
                  453,
                  719,
                  966,
                  3270,
                  3535,
                  3781,
                  4044,
                  1226,
                  1475,
                  1737,
                  1984,
                  2384,
                  2137,
                  2899,
                  2650,
                  348,
                  85,
                  863,
                  598,
                  3414,
                  3167,
                  3925,
                  3676,
                  1370,
                  1107,
                  1881,
                  1616,
                  2800,
                  3065,
                  2291,
                  2554,
                  764,
                  1013,
                  255,
                  502,
                  3830,
                  4095,
                  3317,
                  3580,
                  1786,
                  2035,
                  1273,
                  1520,
                  2912,
                  2665,
                  2403,
                  2154,
                  876,
                  613,
                  367,
                  102,
                  3942,
                  3695,
                  3429,
                  3180,
                  1898,
                  1635,
                  1385,
                  1120,
                  1120,
                  1385,
                  1635,
                  1898,
                  3180,
                  3429,
                  3695,
                  3942,
                  102,
                  367,
                  613,
                  876,
                  2154,
                  2403,
                  2665,
                  2912,
                  1520,
                  1273,
                  2035,
                  1786,
                  3580,
                  3317,
                  4095,
                  3830,
                  502,
                  255,
                  1013,
                  764,
                  2554,
                  2291,
                  3065,
                  2800,
                  1616,
                  1881,
                  1107,
                  1370,
                  3676,
                  3925,
                  3167,
                  3414,
                  598,
                  863,
                  85,
                  348,
                  2650,
                  2899,
                  2137,
                  2384,
                  1984,
                  1737,
                  1475,
                  1226,
                  4044,
                  3781,
                  3535,
                  3270,
                  966,
                  719,
                  453,
                  204,
                  3018,
                  2755,
                  2505,
                  2240,
                  3232,
                  3497,
                  3747,
                  4010,
                  1196,
                  1445,
                  1711,
                  1958,
                  2214,
                  2479,
                  2725,
                  2988,
                  170,
                  419,
                  681,
                  928,
                  3376,
                  3129,
                  3891,
                  3642,
                  1340,
                  1077,
                  1855,
                  1590,
                  2358,
                  2111,
                  2869,
                  2620,
                  314,
                  51,
                  825,
                  560,
                  3728,
                  3993,
                  3219,
                  3482,
                  1692,
                  1941,
                  1183,
                  1430,
                  2710,
                  2975,
                  2197,
                  2460,
                  666,
                  915,
                  153,
                  400,
                  3840,
                  3593,
                  3331,
                  3082,
                  1804,
                  1541,
                  1295,
                  1030,
                  2822,
                  2575,
                  2309,
                  2060,
                  778,
                  515,
                  265,
                  0
                ], this.triTable2 = [
                  [],
                  [8, 3, 0],
                  [9, 0, 1],
                  [8, 3, 1, 8, 1, 9],
                  [11, 2, 3],
                  [11, 2, 0, 11, 0, 8],
                  [11, 2, 3, 0, 1, 9],
                  [2, 1, 11, 1, 9, 11, 11, 9, 8],
                  [10, 1, 2],
                  [8, 3, 0, 1, 2, 10],
                  [9, 0, 2, 9, 2, 10],
                  [3, 2, 8, 2, 10, 8, 8, 10, 9],
                  [10, 1, 3, 10, 3, 11],
                  [1, 0, 10, 0, 8, 10, 10, 8, 11],
                  [0, 3, 9, 3, 11, 9, 9, 11, 10],
                  [8, 10, 9, 8, 11, 10],
                  [8, 4, 7],
                  [3, 0, 4, 3, 4, 7],
                  [1, 9, 0, 8, 4, 7],
                  [9, 4, 1, 4, 7, 1, 1, 7, 3],
                  [2, 3, 11, 7, 8, 4],
                  [7, 11, 4, 11, 2, 4, 4, 2, 0],
                  [3, 11, 2, 4, 7, 8, 9, 0, 1],
                  [2, 7, 11, 2, 1, 7, 1, 4, 7, 1, 9, 4],
                  [10, 1, 2, 8, 4, 7],
                  [2, 10, 1, 0, 4, 7, 0, 7, 3],
                  [4, 7, 8, 0, 2, 10, 0, 10, 9],
                  [2, 7, 3, 2, 9, 7, 7, 9, 4, 2, 10, 9],
                  [8, 4, 7, 11, 10, 1, 11, 1, 3],
                  [11, 4, 7, 1, 4, 11, 1, 11, 10, 1, 0, 4],
                  [3, 8, 0, 7, 11, 4, 11, 9, 4, 11, 10, 9],
                  [7, 11, 4, 4, 11, 9, 11, 10, 9],
                  [9, 5, 4],
                  [3, 0, 8, 4, 9, 5],
                  [5, 4, 0, 5, 0, 1],
                  [4, 8, 5, 8, 3, 5, 5, 3, 1],
                  [11, 2, 3, 9, 5, 4],
                  [9, 5, 4, 8, 11, 2, 8, 2, 0],
                  [3, 11, 2, 1, 5, 4, 1, 4, 0],
                  [8, 5, 4, 2, 5, 8, 2, 8, 11, 2, 1, 5],
                  [2, 10, 1, 9, 5, 4],
                  [0, 8, 3, 5, 4, 9, 10, 1, 2],
                  [10, 5, 2, 5, 4, 2, 2, 4, 0],
                  [3, 4, 8, 3, 2, 4, 2, 5, 4, 2, 10, 5],
                  [5, 4, 9, 1, 3, 11, 1, 11, 10],
                  [0, 9, 1, 4, 8, 5, 8, 10, 5, 8, 11, 10],
                  [3, 4, 0, 3, 10, 4, 4, 10, 5, 3, 11, 10],
                  [4, 8, 5, 5, 8, 10, 8, 11, 10],
                  [9, 5, 7, 9, 7, 8],
                  [0, 9, 3, 9, 5, 3, 3, 5, 7],
                  [8, 0, 7, 0, 1, 7, 7, 1, 5],
                  [1, 7, 3, 1, 5, 7],
                  [11, 2, 3, 8, 9, 5, 8, 5, 7],
                  [9, 2, 0, 9, 7, 2, 2, 7, 11, 9, 5, 7],
                  [0, 3, 8, 2, 1, 11, 1, 7, 11, 1, 5, 7],
                  [2, 1, 11, 11, 1, 7, 1, 5, 7],
                  [1, 2, 10, 5, 7, 8, 5, 8, 9],
                  [9, 1, 0, 10, 5, 2, 5, 3, 2, 5, 7, 3],
                  [5, 2, 10, 8, 2, 5, 8, 5, 7, 8, 0, 2],
                  [10, 5, 2, 2, 5, 3, 5, 7, 3],
                  [3, 9, 1, 3, 8, 9, 7, 11, 10, 7, 10, 5],
                  [9, 1, 0, 10, 7, 11, 10, 5, 7],
                  [3, 8, 0, 7, 10, 5, 7, 11, 10],
                  [11, 5, 7, 11, 10, 5],
                  [11, 7, 6],
                  [0, 8, 3, 11, 7, 6],
                  [9, 0, 1, 11, 7, 6],
                  [7, 6, 11, 3, 1, 9, 3, 9, 8],
                  [2, 3, 7, 2, 7, 6],
                  [8, 7, 0, 7, 6, 0, 0, 6, 2],
                  [1, 9, 0, 3, 7, 6, 3, 6, 2],
                  [7, 6, 2, 7, 2, 9, 2, 1, 9, 7, 9, 8],
                  [1, 2, 10, 6, 11, 7],
                  [2, 10, 1, 7, 6, 11, 8, 3, 0],
                  [11, 7, 6, 10, 9, 0, 10, 0, 2],
                  [7, 6, 11, 3, 2, 8, 8, 2, 10, 8, 10, 9],
                  [6, 10, 7, 10, 1, 7, 7, 1, 3],
                  [6, 10, 1, 6, 1, 7, 7, 1, 0, 7, 0, 8],
                  [9, 0, 3, 6, 9, 3, 6, 10, 9, 6, 3, 7],
                  [6, 10, 7, 7, 10, 8, 10, 9, 8],
                  [8, 4, 6, 8, 6, 11],
                  [11, 3, 6, 3, 0, 6, 6, 0, 4],
                  [0, 1, 9, 4, 6, 11, 4, 11, 8],
                  [1, 9, 4, 11, 1, 4, 11, 3, 1, 11, 4, 6],
                  [3, 8, 2, 8, 4, 2, 2, 4, 6],
                  [2, 0, 4, 2, 4, 6],
                  [1, 9, 0, 3, 8, 2, 2, 8, 4, 2, 4, 6],
                  [9, 4, 1, 1, 4, 2, 4, 6, 2],
                  [10, 1, 2, 11, 8, 4, 11, 4, 6],
                  [10, 1, 2, 11, 3, 6, 6, 3, 0, 6, 0, 4],
                  [0, 2, 10, 0, 10, 9, 4, 11, 8, 4, 6, 11],
                  [2, 11, 3, 6, 9, 4, 6, 10, 9],
                  [8, 4, 6, 8, 6, 1, 6, 10, 1, 8, 1, 3],
                  [1, 0, 10, 10, 0, 6, 0, 4, 6],
                  [8, 0, 3, 9, 6, 10, 9, 4, 6],
                  [10, 4, 6, 10, 9, 4],
                  [9, 5, 4, 7, 6, 11],
                  [4, 9, 5, 3, 0, 8, 11, 7, 6],
                  [6, 11, 7, 4, 0, 1, 4, 1, 5],
                  [6, 11, 7, 4, 8, 5, 5, 8, 3, 5, 3, 1],
                  [4, 9, 5, 6, 2, 3, 6, 3, 7],
                  [9, 5, 4, 8, 7, 0, 0, 7, 6, 0, 6, 2],
                  [4, 0, 1, 4, 1, 5, 6, 3, 7, 6, 2, 3],
                  [7, 4, 8, 5, 2, 1, 5, 6, 2],
                  [6, 11, 7, 1, 2, 10, 9, 5, 4],
                  [11, 7, 6, 8, 3, 0, 1, 2, 10, 9, 5, 4],
                  [11, 7, 6, 10, 5, 2, 2, 5, 4, 2, 4, 0],
                  [7, 4, 8, 2, 11, 3, 10, 5, 6],
                  [4, 9, 5, 6, 10, 7, 7, 10, 1, 7, 1, 3],
                  [5, 6, 10, 0, 9, 1, 8, 7, 4],
                  [5, 6, 10, 7, 0, 3, 7, 4, 0],
                  [10, 5, 6, 4, 8, 7],
                  [5, 6, 9, 6, 11, 9, 9, 11, 8],
                  [0, 9, 5, 0, 5, 3, 3, 5, 6, 3, 6, 11],
                  [0, 1, 5, 0, 5, 11, 5, 6, 11, 0, 11, 8],
                  [11, 3, 6, 6, 3, 5, 3, 1, 5],
                  [9, 5, 6, 3, 9, 6, 3, 8, 9, 3, 6, 2],
                  [5, 6, 9, 9, 6, 0, 6, 2, 0],
                  [0, 3, 8, 2, 5, 6, 2, 1, 5],
                  [1, 6, 2, 1, 5, 6],
                  [1, 2, 10, 5, 6, 9, 9, 6, 11, 9, 11, 8],
                  [1, 0, 9, 6, 10, 5, 11, 3, 2],
                  [6, 10, 5, 2, 8, 0, 2, 11, 8],
                  [3, 2, 11, 10, 5, 6],
                  [10, 5, 6, 9, 3, 8, 9, 1, 3],
                  [0, 9, 1, 5, 6, 10],
                  [8, 0, 3, 10, 5, 6],
                  [10, 5, 6],
                  [10, 6, 5],
                  [8, 3, 0, 10, 6, 5],
                  [0, 1, 9, 5, 10, 6],
                  [10, 6, 5, 9, 8, 3, 9, 3, 1],
                  [3, 11, 2, 10, 6, 5],
                  [6, 5, 10, 2, 0, 8, 2, 8, 11],
                  [1, 9, 0, 6, 5, 10, 11, 2, 3],
                  [1, 10, 2, 5, 9, 6, 9, 11, 6, 9, 8, 11],
                  [1, 2, 6, 1, 6, 5],
                  [0, 8, 3, 2, 6, 5, 2, 5, 1],
                  [5, 9, 6, 9, 0, 6, 6, 0, 2],
                  [9, 6, 5, 3, 6, 9, 3, 9, 8, 3, 2, 6],
                  [11, 6, 3, 6, 5, 3, 3, 5, 1],
                  [0, 5, 1, 0, 11, 5, 5, 11, 6, 0, 8, 11],
                  [0, 5, 9, 0, 3, 5, 3, 6, 5, 3, 11, 6],
                  [5, 9, 6, 6, 9, 11, 9, 8, 11],
                  [10, 6, 5, 4, 7, 8],
                  [5, 10, 6, 7, 3, 0, 7, 0, 4],
                  [5, 10, 6, 0, 1, 9, 8, 4, 7],
                  [4, 5, 9, 6, 7, 10, 7, 1, 10, 7, 3, 1],
                  [7, 8, 4, 2, 3, 11, 10, 6, 5],
                  [11, 6, 7, 10, 2, 5, 2, 4, 5, 2, 0, 4],
                  [11, 6, 7, 8, 0, 3, 1, 10, 2, 9, 4, 5],
                  [6, 7, 11, 1, 10, 2, 9, 4, 5],
                  [7, 8, 4, 5, 1, 2, 5, 2, 6],
                  [4, 1, 0, 4, 5, 1, 6, 7, 3, 6, 3, 2],
                  [9, 4, 5, 8, 0, 7, 0, 6, 7, 0, 2, 6],
                  [4, 5, 9, 6, 3, 2, 6, 7, 3],
                  [6, 7, 11, 4, 5, 8, 5, 3, 8, 5, 1, 3],
                  [6, 7, 11, 4, 1, 0, 4, 5, 1],
                  [4, 5, 9, 3, 8, 0, 11, 6, 7],
                  [9, 4, 5, 7, 11, 6],
                  [10, 6, 4, 10, 4, 9],
                  [8, 3, 0, 9, 10, 6, 9, 6, 4],
                  [1, 10, 0, 10, 6, 0, 0, 6, 4],
                  [8, 6, 4, 8, 1, 6, 6, 1, 10, 8, 3, 1],
                  [2, 3, 11, 6, 4, 9, 6, 9, 10],
                  [0, 10, 2, 0, 9, 10, 4, 8, 11, 4, 11, 6],
                  [10, 2, 1, 11, 6, 3, 6, 0, 3, 6, 4, 0],
                  [10, 2, 1, 11, 4, 8, 11, 6, 4],
                  [9, 1, 4, 1, 2, 4, 4, 2, 6],
                  [1, 0, 9, 3, 2, 8, 2, 4, 8, 2, 6, 4],
                  [2, 4, 0, 2, 6, 4],
                  [3, 2, 8, 8, 2, 4, 2, 6, 4],
                  [1, 4, 9, 11, 4, 1, 11, 1, 3, 11, 6, 4],
                  [0, 9, 1, 4, 11, 6, 4, 8, 11],
                  [11, 6, 3, 3, 6, 0, 6, 4, 0],
                  [8, 6, 4, 8, 11, 6],
                  [6, 7, 10, 7, 8, 10, 10, 8, 9],
                  [9, 3, 0, 6, 3, 9, 6, 9, 10, 6, 7, 3],
                  [6, 1, 10, 6, 7, 1, 7, 0, 1, 7, 8, 0],
                  [6, 7, 10, 10, 7, 1, 7, 3, 1],
                  [7, 11, 6, 3, 8, 2, 8, 10, 2, 8, 9, 10],
                  [11, 6, 7, 10, 0, 9, 10, 2, 0],
                  [2, 1, 10, 7, 11, 6, 8, 0, 3],
                  [1, 10, 2, 6, 7, 11],
                  [7, 2, 6, 7, 9, 2, 2, 9, 1, 7, 8, 9],
                  [1, 0, 9, 3, 6, 7, 3, 2, 6],
                  [8, 0, 7, 7, 0, 6, 0, 2, 6],
                  [2, 7, 3, 2, 6, 7],
                  [7, 11, 6, 3, 9, 1, 3, 8, 9],
                  [9, 1, 0, 11, 6, 7],
                  [0, 3, 8, 11, 6, 7],
                  [11, 6, 7],
                  [11, 7, 5, 11, 5, 10],
                  [3, 0, 8, 7, 5, 10, 7, 10, 11],
                  [9, 0, 1, 10, 11, 7, 10, 7, 5],
                  [3, 1, 9, 3, 9, 8, 7, 10, 11, 7, 5, 10],
                  [10, 2, 5, 2, 3, 5, 5, 3, 7],
                  [5, 10, 2, 8, 5, 2, 8, 7, 5, 8, 2, 0],
                  [9, 0, 1, 10, 2, 5, 5, 2, 3, 5, 3, 7],
                  [1, 10, 2, 5, 8, 7, 5, 9, 8],
                  [2, 11, 1, 11, 7, 1, 1, 7, 5],
                  [0, 8, 3, 2, 11, 1, 1, 11, 7, 1, 7, 5],
                  [9, 0, 2, 9, 2, 7, 2, 11, 7, 9, 7, 5],
                  [11, 3, 2, 8, 5, 9, 8, 7, 5],
                  [1, 3, 7, 1, 7, 5],
                  [8, 7, 0, 0, 7, 1, 7, 5, 1],
                  [0, 3, 9, 9, 3, 5, 3, 7, 5],
                  [9, 7, 5, 9, 8, 7],
                  [4, 5, 8, 5, 10, 8, 8, 10, 11],
                  [3, 0, 4, 3, 4, 10, 4, 5, 10, 3, 10, 11],
                  [0, 1, 9, 4, 5, 8, 8, 5, 10, 8, 10, 11],
                  [5, 9, 4, 1, 11, 3, 1, 10, 11],
                  [3, 8, 4, 3, 4, 2, 2, 4, 5, 2, 5, 10],
                  [10, 2, 5, 5, 2, 4, 2, 0, 4],
                  [0, 3, 8, 5, 9, 4, 10, 2, 1],
                  [2, 1, 10, 9, 4, 5],
                  [8, 4, 5, 2, 8, 5, 2, 11, 8, 2, 5, 1],
                  [3, 2, 11, 1, 4, 5, 1, 0, 4],
                  [9, 4, 5, 8, 2, 11, 8, 0, 2],
                  [11, 3, 2, 9, 4, 5],
                  [4, 5, 8, 8, 5, 3, 5, 1, 3],
                  [5, 0, 4, 5, 1, 0],
                  [3, 8, 0, 4, 5, 9],
                  [9, 4, 5],
                  [7, 4, 11, 4, 9, 11, 11, 9, 10],
                  [3, 0, 8, 7, 4, 11, 11, 4, 9, 11, 9, 10],
                  [11, 7, 4, 1, 11, 4, 1, 10, 11, 1, 4, 0],
                  [8, 7, 4, 11, 1, 10, 11, 3, 1],
                  [2, 3, 7, 2, 7, 9, 7, 4, 9, 2, 9, 10],
                  [4, 8, 7, 0, 10, 2, 0, 9, 10],
                  [2, 1, 10, 0, 7, 4, 0, 3, 7],
                  [10, 2, 1, 8, 7, 4],
                  [2, 11, 7, 2, 7, 1, 1, 7, 4, 1, 4, 9],
                  [3, 2, 11, 4, 8, 7, 9, 1, 0],
                  [7, 4, 11, 11, 4, 2, 4, 0, 2],
                  [2, 11, 3, 7, 4, 8],
                  [9, 1, 4, 4, 1, 7, 1, 3, 7],
                  [1, 0, 9, 8, 7, 4],
                  [3, 4, 0, 3, 7, 4],
                  [8, 7, 4],
                  [8, 9, 10, 8, 10, 11],
                  [0, 9, 3, 3, 9, 11, 9, 10, 11],
                  [1, 10, 0, 0, 10, 8, 10, 11, 8],
                  [10, 3, 1, 10, 11, 3],
                  [3, 8, 2, 2, 8, 10, 8, 9, 10],
                  [9, 2, 0, 9, 10, 2],
                  [8, 0, 3, 1, 10, 2],
                  [10, 2, 1],
                  [2, 11, 1, 1, 11, 9, 11, 8, 9],
                  [11, 3, 2, 0, 9, 1],
                  [11, 0, 2, 11, 8, 0],
                  [11, 3, 2],
                  [8, 1, 3, 8, 9, 1],
                  [9, 1, 0],
                  [8, 0, 3],
                  []
                ];
              }
              march(x, b, A, f) {
                let s = !!f.fulltable, u = f.hasOwnProperty("origin") && f.origin.hasOwnProperty("x") ? f.origin : { x: 0, y: 0, z: 0 }, p = !!f.voxel, g = f.matrix, w = f.nX || 0, o = f.nY || 0, v = f.nZ || 0, M = f.scale || 1, E = null;
                f.unitCube ? E = f.unitCube : E = { x: M, y: M, z: M };
                let $ = new Int32Array(w * o * v), k, L;
                for (k = 0, L = $.length; k < L; ++k)
                  $[k] = -1;
                let z = function(W, B, P, G, H, U) {
                  let j = { x: 0, y: 0, z: 0 }, re = !!(G & 1 << H), ie = !!(G & 1 << U), te = H;
                  if (!re && ie && (te = U), te & 1 && P++, te & 2 && B++, te & 4 && W++, g) {
                    let de = new r.Vector3(W, B, P);
                    de = de.applyMatrix4(g), j = { x: de.x, y: de.y, z: de.z };
                  } else
                    j.x = u.x + E.x * W, j.y = u.y + E.y * B, j.z = u.z + E.z * P;
                  let ue = (o * W + B) * v + P;
                  return p ? (b.push(j), b.length - 1) : ($[ue] < 0 && ($[ue] = b.length, b.push(j)), $[ue]);
                }, O = new Int32Array(12), R = s ? this.edgeTable2 : this.edgeTable, N = s ? this.triTable2 : this.triTable;
                for (k = 0; k < w - 1; ++k)
                  for (let W = 0; W < o - 1; ++W)
                    for (let B = 0; B < v - 1; ++B) {
                      let P = 0;
                      for (let U = 0; U < 8; ++U) {
                        let j = (o * (k + ((U & 4) >> 2)) + W + ((U & 2) >> 1)) * v + B + (U & 1), re = !!(x[j] & this.ISDONE);
                        P |= re << U;
                      }
                      if (P === 0 || P === 255)
                        continue;
                      let G = R[P];
                      if (G === 0)
                        continue;
                      let H = N[P];
                      G & 1 && (O[0] = z(k, W, B, P, 0, 1)), G & 2 && (O[1] = z(k, W, B, P, 1, 3)), G & 4 && (O[2] = z(k, W, B, P, 3, 2)), G & 8 && (O[3] = z(k, W, B, P, 2, 0)), G & 16 && (O[4] = z(k, W, B, P, 4, 5)), G & 32 && (O[5] = z(k, W, B, P, 5, 7)), G & 64 && (O[6] = z(k, W, B, P, 7, 6)), G & 128 && (O[7] = z(k, W, B, P, 6, 4)), G & 256 && (O[8] = z(k, W, B, P, 0, 4)), G & 512 && (O[9] = z(k, W, B, P, 1, 5)), G & 1024 && (O[10] = z(k, W, B, P, 3, 7)), G & 2048 && (O[11] = z(k, W, B, P, 2, 6));
                      for (let U = 0; U < H.length; U += 3) {
                        let j = O[H[U]], re = O[H[U + 1]], ie = O[H[U + 2]];
                        p && U >= 3 && (b.push(b[j]), j = b.length - 1, b.push(b[re]), re = b.length - 1, b.push(b[ie]), ie = b.length - 1), A.push(j), A.push(re), A.push(ie);
                      }
                    }
              }
              laplacianSmooth(x, b, A) {
                let f = new Array(b.length), s, u, p, g, w;
                for (s = 0, u = b.length; s < u; s++)
                  f[s] = {
                    x: 0,
                    y: 0,
                    z: 0
                  };
                let o = new Array(20), v;
                for (s = 0; s < 20; s++)
                  o[s] = new Array(b.length);
                for (s = 0, u = b.length; s < u; s++)
                  o[0][s] = 0;
                for (s = 0, u = A.length / 3; s < u; s++) {
                  let $ = s * 3, k = s * 3 + 1, L = s * 3 + 2;
                  for (v = !0, p = 0, g = o[0][A[$]]; p < g; p++)
                    if (A[k] == o[p + 1][A[$]]) {
                      v = !1;
                      break;
                    }
                  for (v && (o[0][A[$]]++, o[o[0][A[$]]][A[$]] = A[k]), v = !0, p = 0, g = o[0][A[$]]; p < g; p++)
                    if (A[L] == o[p + 1][A[$]]) {
                      v = !1;
                      break;
                    }
                  for (v && (o[0][A[$]]++, o[o[0][A[$]]][A[$]] = A[L]), v = !0, p = 0, g = o[0][A[k]]; p < g; p++)
                    if (A[$] == o[p + 1][A[k]]) {
                      v = !1;
                      break;
                    }
                  for (v && (o[0][A[k]]++, o[o[0][A[k]]][A[k]] = A[$]), v = !0, p = 0, g = o[0][A[k]]; p < g; p++)
                    if (A[L] == o[p + 1][A[k]]) {
                      v = !1;
                      break;
                    }
                  for (v && (o[0][A[k]]++, o[o[0][A[k]]][A[k]] = A[L]), v = !0, p = 0; p < o[0][A[L]]; p++)
                    if (A[$] == o[p + 1][A[L]]) {
                      v = !1;
                      break;
                    }
                  for (v && (o[0][A[L]]++, o[o[0][A[L]]][A[L]] = A[$]), v = !0, p = 0, g = o[0][A[L]]; p < g; p++)
                    if (A[k] == o[p + 1][A[L]]) {
                      v = !1;
                      break;
                    }
                  v && (o[0][A[L]]++, o[o[0][A[L]]][A[L]] = A[k]);
                }
                let M = 1, E = 0.5;
                for (w = 0; w < x; w++) {
                  for (s = 0, u = b.length; s < u; s++)
                    if (o[0][s] < 3)
                      f[s].x = b[s].x, f[s].y = b[s].y, f[s].z = b[s].z;
                    else if (o[0][s] == 3 || o[0][s] == 4) {
                      for (f[s].x = 0, f[s].y = 0, f[s].z = 0, p = 0, g = o[0][s]; p < g; p++)
                        f[s].x += b[o[p + 1][s]].x, f[s].y += b[o[p + 1][s]].y, f[s].z += b[o[p + 1][s]].z;
                      f[s].x += E * b[s].x, f[s].y += E * b[s].y, f[s].z += E * b[s].z, f[s].x /= E + o[0][s], f[s].y /= E + o[0][s], f[s].z /= E + o[0][s];
                    } else {
                      for (f[s].x = 0, f[s].y = 0, f[s].z = 0, p = 0, g = o[0][s]; p < g; p++)
                        f[s].x += b[o[p + 1][s]].x, f[s].y += b[o[p + 1][s]].y, f[s].z += b[o[p + 1][s]].z;
                      f[s].x += M * b[s].x, f[s].y += M * b[s].y, f[s].z += M * b[s].z, f[s].x /= M + o[0][s], f[s].y /= M + o[0][s], f[s].z /= M + o[0][s];
                    }
                  for (s = 0, u = b.length; s < u; s++)
                    b[s].x = f[s].x, b[s].y = f[s].y, b[s].z = f[s].z;
                }
              }
            }
            let d = new c();
            class _ {
              constructor(x, b, A) {
                this.data = new Int32Array(x * b * A * 3), this.width = b, this.height = A;
              }
              // set position x,y,z to pt, which has ix,iy,and iz
              set(x, b, A, f) {
                let s = ((x * this.width + b) * this.height + A) * 3;
                this.data[s] = f.ix, this.data[s + 1] = f.iy, this.data[s + 2] = f.iz;
              }
              // return point at x,y,z
              get(x, b, A) {
                let f = ((x * this.width + b) * this.height + A) * 3;
                return {
                  ix: this.data[f],
                  iy: this.data[f + 1],
                  iz: this.data[f + 2]
                };
              }
            }
            class m {
              constructor() {
                this.INOUT = 1, this.ISDONE = 2, this.ISBOUND = 4, this.ptranx = 0, this.ptrany = 0, this.ptranz = 0, this.probeRadius = 1.4, this.defaultScaleFactor = 2, this.scaleFactor = this.defaultScaleFactor, this.pHeight = 0, this.pWidth = 0, this.pLength = 0, this.cutRadius = 0, this.vpBits = null, this.vpDistance = null, this.vpAtomID = null, this.pminx = 0, this.pminy = 0, this.pminz = 0, this.pmaxx = 0, this.pmaxy = 0, this.pmaxz = 0, this.depty = {}, this.widxz = {}, this.faces = [], this.verts = [], this.vdwRadii = {
                  H: 1.2,
                  Li: 1.82,
                  Na: 2.27,
                  K: 2.75,
                  C: 1.7,
                  N: 1.55,
                  O: 1.52,
                  F: 1.47,
                  P: 1.8,
                  S: 1.8,
                  CL: 1.75,
                  BR: 1.85,
                  SE: 1.9,
                  ZN: 1.39,
                  CU: 1.4,
                  NI: 1.63,
                  X: 2
                }, this.nb = [
                  new Int32Array([1, 0, 0]),
                  new Int32Array([-1, 0, 0]),
                  new Int32Array([0, 1, 0]),
                  new Int32Array([0, -1, 0]),
                  new Int32Array([0, 0, 1]),
                  new Int32Array([0, 0, -1]),
                  new Int32Array([1, 1, 0]),
                  new Int32Array([1, -1, 0]),
                  new Int32Array([-1, 1, 0]),
                  new Int32Array([-1, -1, 0]),
                  new Int32Array([1, 0, 1]),
                  new Int32Array([1, 0, -1]),
                  new Int32Array([-1, 0, 1]),
                  new Int32Array([-1, 0, -1]),
                  new Int32Array([0, 1, 1]),
                  new Int32Array([0, 1, -1]),
                  new Int32Array([0, -1, 1]),
                  new Int32Array([0, -1, -1]),
                  new Int32Array([1, 1, 1]),
                  new Int32Array([1, 1, -1]),
                  new Int32Array([1, -1, 1]),
                  new Int32Array([-1, 1, 1]),
                  new Int32Array([1, -1, -1]),
                  new Int32Array([-1, -1, 1]),
                  new Int32Array([-1, 1, -1]),
                  new Int32Array([-1, -1, -1])
                ], m.MarchingCube || (m.MarchingCube = new c());
              }
              getVDWIndex(x) {
                return !x.elem || typeof this.vdwRadii[x.elem] > "u" ? "X" : x.elem;
              }
              getFacesAndVertices(x) {
                let b = {};
                for (let s = 0, u = x.length; s < u; s++)
                  b[x[s]] = !0;
                let A = this.verts;
                for (let s = 0, u = A.length; s < u; s++)
                  A[s].x = A[s].x / this.scaleFactor - this.ptranx, A[s].y = A[s].y / this.scaleFactor - this.ptrany, A[s].z = A[s].z / this.scaleFactor - this.ptranz;
                let f = [];
                for (let s = 0, u = this.faces.length; s < u; s += 3) {
                  let p = this.faces[s], g = this.faces[s + 1], w = this.faces[s + 2], o = A[p].atomid, v = A[g].atomid, M = A[w].atomid, E = o;
                  v < E && (E = v), M < E && (E = M), b[E] && p !== g && g !== w && p !== w && (f.push(p), f.push(g), f.push(w));
                }
                return this.vpBits = null, this.vpDistance = null, this.vpAtomID = null, {
                  vertices: A,
                  faces: f
                };
              }
              initparm(x, b, A) {
                A > 1e6 && (this.scaleFactor = this.defaultScaleFactor / 2);
                let f = 1 / this.scaleFactor * 5.5;
                this.pminx = x[0][0], this.pmaxx = x[1][0], this.pminy = x[0][1], this.pmaxy = x[1][1], this.pminz = x[0][2], this.pmaxz = x[1][2], b ? (this.pminx -= this.probeRadius + f, this.pminy -= this.probeRadius + f, this.pminz -= this.probeRadius + f, this.pmaxx += this.probeRadius + f, this.pmaxy += this.probeRadius + f, this.pmaxz += this.probeRadius + f) : (this.pminx -= f, this.pminy -= f, this.pminz -= f, this.pmaxx += f, this.pmaxy += f, this.pmaxz += f), this.pminx = Math.floor(this.pminx * this.scaleFactor) / this.scaleFactor, this.pminy = Math.floor(this.pminy * this.scaleFactor) / this.scaleFactor, this.pminz = Math.floor(this.pminz * this.scaleFactor) / this.scaleFactor, this.pmaxx = Math.ceil(this.pmaxx * this.scaleFactor) / this.scaleFactor, this.pmaxy = Math.ceil(this.pmaxy * this.scaleFactor) / this.scaleFactor, this.pmaxz = Math.ceil(this.pmaxz * this.scaleFactor) / this.scaleFactor, this.ptranx = -this.pminx, this.ptrany = -this.pminy, this.ptranz = -this.pminz, this.pLength = Math.ceil(this.scaleFactor * (this.pmaxx - this.pminx)) + 1, this.pWidth = Math.ceil(this.scaleFactor * (this.pmaxy - this.pminy)) + 1, this.pHeight = Math.ceil(this.scaleFactor * (this.pmaxz - this.pminz)) + 1, this.boundingatom(b), this.cutRadius = this.probeRadius * this.scaleFactor, this.vpBits = new Uint8Array(this.pLength * this.pWidth * this.pHeight), this.vpDistance = new Float64Array(this.pLength * this.pWidth * this.pHeight), this.vpAtomID = new Int32Array(this.pLength * this.pWidth * this.pHeight);
              }
              boundingatom(x) {
                let b = {};
                for (const A in this.vdwRadii) {
                  let f = this.vdwRadii[A];
                  x ? b[A] = (f + this.probeRadius) * this.scaleFactor + 0.5 : b[A] = f * this.scaleFactor + 0.5;
                  let s = b[A] * b[A];
                  this.widxz[A] = Math.floor(b[A]) + 1, this.depty[A] = new Int32Array(this.widxz[A] * this.widxz[A]);
                  let u = 0;
                  for (let p = 0; p < this.widxz[A]; p++)
                    for (let g = 0; g < this.widxz[A]; g++) {
                      let w = p * p + g * g;
                      if (w > s)
                        this.depty[A][u] = -1;
                      else {
                        let o = Math.sqrt(s - w);
                        this.depty[A][u] = Math.floor(o);
                      }
                      u++;
                    }
                }
              }
              fillvoxels(x, b) {
                for (let A = 0, f = this.vpBits.length; A < f; A++)
                  this.vpBits[A] = 0, this.vpDistance[A] = -1, this.vpAtomID[A] = -1;
                for (let A in b) {
                  let f = x[b[A]];
                  f !== void 0 && this.fillAtom(f, x);
                }
                for (let A = 0, f = this.vpBits.length; A < f; A++)
                  this.vpBits[A] & this.INOUT && (this.vpBits[A] |= this.ISDONE);
              }
              fillAtom(x, b) {
                let A = Math.floor(0.5 + this.scaleFactor * (x.x + this.ptranx)), f = Math.floor(0.5 + this.scaleFactor * (x.y + this.ptrany)), s = Math.floor(0.5 + this.scaleFactor * (x.z + this.ptranz)), u = this.getVDWIndex(x), p = 0, g = this.pWidth * this.pHeight;
                for (let w = 0, o = this.widxz[u]; w < o; w++)
                  for (let v = 0; v < o; v++) {
                    if (this.depty[u][p] != -1) {
                      for (let M = -1; M < 2; M++)
                        for (let E = -1; E < 2; E++)
                          for (let $ = -1; $ < 2; $++)
                            if (M !== 0 && E !== 0 && $ !== 0) {
                              let k = M * w, L = $ * v;
                              for (let z = 0; z <= this.depty[u][p]; z++) {
                                let O = z * E, R = A + k, N = f + O, W = s + L;
                                if (R < 0 || N < 0 || W < 0 || R >= this.pLength || N >= this.pWidth || W >= this.pHeight)
                                  continue;
                                let B = R * g + N * this.pHeight + W;
                                if (!(this.vpBits[B] & this.INOUT))
                                  this.vpBits[B] |= this.INOUT, this.vpAtomID[B] = x.serial;
                                else {
                                  let P = b[this.vpAtomID[B]];
                                  if (P.serial != x.serial) {
                                    let G = A + k - Math.floor(0.5 + this.scaleFactor * (P.x + this.ptranx)), H = f + O - Math.floor(0.5 + this.scaleFactor * (P.y + this.ptrany)), U = s + L - Math.floor(0.5 + this.scaleFactor * (P.z + this.ptranz));
                                    k * k + O * O + L * L < G * G + H * H + U * U && (this.vpAtomID[B] = x.serial);
                                  }
                                }
                              }
                            }
                    }
                    p++;
                  }
              }
              fillvoxelswaals(x, b) {
                for (let A = 0, f = this.vpBits.length; A < f; A++)
                  this.vpBits[A] &= ~this.ISDONE;
                for (let A in b) {
                  let f = x[b[A]];
                  f !== void 0 && this.fillAtomWaals(f, x);
                }
              }
              fillAtomWaals(x, b) {
                let A = 0, f = Math.floor(0.5 + this.scaleFactor * (x.x + this.ptranx)), s = Math.floor(0.5 + this.scaleFactor * (x.y + this.ptrany)), u = Math.floor(0.5 + this.scaleFactor * (x.z + this.ptranz)), p = this.getVDWIndex(x), g = this.pWidth * this.pHeight;
                for (let w = 0, o = this.widxz[p]; w < o; w++)
                  for (let v = 0; v < o; v++) {
                    if (this.depty[p][A] != -1) {
                      for (let M = -1; M < 2; M++)
                        for (let E = -1; E < 2; E++)
                          for (let $ = -1; $ < 2; $++)
                            if (M !== 0 && E !== 0 && $ !== 0) {
                              let k = M * w, L = $ * v;
                              for (let z = 0; z <= this.depty[p][A]; z++) {
                                let O = z * E, R = f + k, N = s + O, W = u + L;
                                if (R < 0 || N < 0 || W < 0 || R >= this.pLength || N >= this.pWidth || W >= this.pHeight)
                                  continue;
                                let B = R * g + N * this.pHeight + W;
                                if (!(this.vpBits[B] & this.ISDONE))
                                  this.vpBits[B] |= this.ISDONE, this.vpAtomID[B] = x.serial;
                                else {
                                  let P = b[this.vpAtomID[B]];
                                  if (P.serial != x.serial) {
                                    let G = f + k - Math.floor(0.5 + this.scaleFactor * (P.x + this.ptranx)), H = s + O - Math.floor(0.5 + this.scaleFactor * (P.y + this.ptrany)), U = u + L - Math.floor(0.5 + this.scaleFactor * (P.z + this.ptranz));
                                    k * k + O * O + L * L < G * G + H * H + U * U && (this.vpAtomID[B] = x.serial);
                                  }
                                }
                              }
                            }
                    }
                    A++;
                  }
              }
              buildboundary() {
                let x = this.pWidth * this.pHeight;
                for (let b = 0; b < this.pLength; b++)
                  for (let A = 0; A < this.pHeight; A++)
                    for (let f = 0; f < this.pWidth; f++) {
                      let s = b * x + f * this.pHeight + A;
                      if (this.vpBits[s] & this.INOUT) {
                        let u = 0;
                        for (; u < 26; ) {
                          let p = b + this.nb[u][0], g = A + this.nb[u][2], w = f + this.nb[u][1];
                          if (p > -1 && p < this.pLength && w > -1 && w < this.pWidth && g > -1 && g < this.pHeight && !(this.vpBits[p * x + w * this.pHeight + g] & this.INOUT)) {
                            this.vpBits[s] |= this.ISBOUND;
                            break;
                          } else
                            u++;
                        }
                      }
                    }
              }
              fastdistancemap() {
                let x = new _(this.pLength, this.pWidth, this.pHeight), b = this.pWidth * this.pHeight, A = this.cutRadius * this.cutRadius, f = [], s = [], u;
                for (let w = 0; w < this.pLength; w++)
                  for (let o = 0; o < this.pWidth; o++)
                    for (let v = 0; v < this.pHeight; v++)
                      if (u = w * b + o * this.pHeight + v, this.vpBits[u] &= ~this.ISDONE, this.vpBits[u] & this.INOUT && this.vpBits[u] & this.ISBOUND) {
                        let M = {
                          ix: w,
                          iy: o,
                          iz: v
                        };
                        x.set(w, o, v, M), f.push(M), this.vpDistance[u] = 0, this.vpBits[u] |= this.ISDONE, this.vpBits[u] &= ~this.ISBOUND;
                      }
                do {
                  s = this.fastoneshell(f, x), f = [];
                  for (let w = 0, o = s.length; w < o; w++)
                    u = b * s[w].ix + this.pHeight * s[w].iy + s[w].iz, this.vpBits[u] &= ~this.ISBOUND, this.vpDistance[u] <= 1.0404 * A && f.push({
                      ix: s[w].ix,
                      iy: s[w].iy,
                      iz: s[w].iz
                    });
                } while (f.length !== 0);
                f = [], s = [], x = null;
                let p = this.scaleFactor - 0.5;
                p < 0 && (p = 0);
                let g = A - 0.5 / (0.1 + p);
                for (let w = 0; w < this.pLength; w++)
                  for (let o = 0; o < this.pWidth; o++)
                    for (let v = 0; v < this.pHeight; v++)
                      u = w * b + o * this.pHeight + v, this.vpBits[u] &= ~this.ISBOUND, this.vpBits[u] & this.INOUT && (!(this.vpBits[u] & this.ISDONE) || this.vpBits[u] & this.ISDONE && this.vpDistance[u] >= g) && (this.vpBits[u] |= this.ISBOUND);
              }
              fastoneshell(x, b) {
                let A, f, s, u, p, g, w, o, v, M = [];
                if (x.length === 0)
                  return M;
                let E = {
                  ix: -1,
                  iy: -1,
                  iz: -1
                }, $ = this.pWidth * this.pHeight;
                for (let k = 0, L = x.length; k < L; k++) {
                  A = x[k].ix, f = x[k].iy, s = x[k].iz, o = b.get(A, f, s);
                  for (let z = 0; z < 6; z++)
                    E.ix = A + this.nb[z][0], E.iy = f + this.nb[z][1], E.iz = s + this.nb[z][2], E.ix < this.pLength && E.ix > -1 && E.iy < this.pWidth && E.iy > -1 && E.iz < this.pHeight && E.iz > -1 && (v = E.ix * $ + this.pHeight * E.iy + E.iz, this.vpBits[v] & this.INOUT && !(this.vpBits[v] & this.ISDONE) ? (b.set(E.ix, E.iy, s + this.nb[z][2], o), u = E.ix - o.ix, p = E.iy - o.iy, g = E.iz - o.iz, w = u * u + p * p + g * g, this.vpDistance[v] = w, this.vpBits[v] |= this.ISDONE, this.vpBits[v] |= this.ISBOUND, M.push({
                      ix: E.ix,
                      iy: E.iy,
                      iz: E.iz
                    })) : this.vpBits[v] & this.INOUT && this.vpBits[v] & this.ISDONE && (u = E.ix - o.ix, p = E.iy - o.iy, g = E.iz - o.iz, w = u * u + p * p + g * g, w < this.vpDistance[v] && (b.set(E.ix, E.iy, E.iz, o), this.vpDistance[v] = w, this.vpBits[v] & this.ISBOUND || (this.vpBits[v] |= this.ISBOUND, M.push({
                      ix: E.ix,
                      iy: E.iy,
                      iz: E.iz
                    })))));
                }
                for (let k = 0, L = x.length; k < L; k++) {
                  A = x[k].ix, f = x[k].iy, s = x[k].iz, o = b.get(A, f, s);
                  for (let z = 6; z < 18; z++)
                    E.ix = A + this.nb[z][0], E.iy = f + this.nb[z][1], E.iz = s + this.nb[z][2], E.ix < this.pLength && E.ix > -1 && E.iy < this.pWidth && E.iy > -1 && E.iz < this.pHeight && E.iz > -1 && (v = E.ix * $ + this.pHeight * E.iy + E.iz, this.vpBits[v] & this.INOUT && !(this.vpBits[v] & this.ISDONE) ? (b.set(E.ix, E.iy, s + this.nb[z][2], o), u = E.ix - o.ix, p = E.iy - o.iy, g = E.iz - o.iz, w = u * u + p * p + g * g, this.vpDistance[v] = w, this.vpBits[v] |= this.ISDONE, this.vpBits[v] |= this.ISBOUND, M.push({
                      ix: E.ix,
                      iy: E.iy,
                      iz: E.iz
                    })) : this.vpBits[v] & this.INOUT && this.vpBits[v] & this.ISDONE && (u = E.ix - o.ix, p = E.iy - o.iy, g = E.iz - o.iz, w = u * u + p * p + g * g, w < this.vpDistance[v] && (b.set(E.ix, E.iy, E.iz, o), this.vpDistance[v] = w, this.vpBits[v] & this.ISBOUND || (this.vpBits[v] |= this.ISBOUND, M.push({
                      ix: E.ix,
                      iy: E.iy,
                      iz: E.iz
                    })))));
                }
                for (let k = 0, L = x.length; k < L; k++) {
                  A = x[k].ix, f = x[k].iy, s = x[k].iz, o = b.get(A, f, s);
                  for (let z = 18; z < 26; z++)
                    E.ix = A + this.nb[z][0], E.iy = f + this.nb[z][1], E.iz = s + this.nb[z][2], E.ix < this.pLength && E.ix > -1 && E.iy < this.pWidth && E.iy > -1 && E.iz < this.pHeight && E.iz > -1 && (v = E.ix * $ + this.pHeight * E.iy + E.iz, this.vpBits[v] & this.INOUT && !(this.vpBits[v] & this.ISDONE) ? (b.set(E.ix, E.iy, s + this.nb[z][2], o), u = E.ix - o.ix, p = E.iy - o.iy, g = E.iz - o.iz, w = u * u + p * p + g * g, this.vpDistance[v] = w, this.vpBits[v] |= this.ISDONE, this.vpBits[v] |= this.ISBOUND, M.push({
                      ix: E.ix,
                      iy: E.iy,
                      iz: E.iz
                    })) : this.vpBits[v] & this.INOUT && this.vpBits[v] & this.ISDONE && (u = E.ix - o.ix, p = E.iy - o.iy, g = E.iz - o.iz, w = u * u + p * p + g * g, w < this.vpDistance[v] && (b.set(E.ix, E.iy, E.iz, o), this.vpDistance[v] = w, this.vpBits[v] & this.ISBOUND || (this.vpBits[v] |= this.ISBOUND, M.push({
                      ix: E.ix,
                      iy: E.iy,
                      iz: E.iz
                    })))));
                }
                return M;
              }
              marchingcubeinit(x) {
                for (let b = 0, A = this.vpBits.length; b < A; b++)
                  x == 1 ? this.vpBits[b] &= ~this.ISBOUND : x == 4 ? (this.vpBits[b] &= ~this.ISDONE, this.vpBits[b] & this.ISBOUND && (this.vpBits[b] |= this.ISDONE), this.vpBits[b] &= ~this.ISBOUND) : x == 2 ? this.vpBits[b] & this.ISBOUND && this.vpBits[b] & this.ISDONE ? this.vpBits[b] &= ~this.ISBOUND : this.vpBits[b] & this.ISBOUND && !(this.vpBits[b] & this.ISDONE) && (this.vpBits[b] |= this.ISDONE) : x == 3 && (this.vpBits[b] &= ~this.ISBOUND);
              }
              marchingcube(x) {
                this.marchingcubeinit(x), this.verts = [], this.faces = [], m.MarchingCube.march(this.vpBits, this.verts, this.faces, {
                  smooth: 1,
                  nX: this.pLength,
                  nY: this.pWidth,
                  nZ: this.pHeight
                });
                let b = this.pWidth * this.pHeight;
                for (let A = 0, f = this.verts.length; A < f; A++)
                  this.verts[A].atomid = this.vpAtomID[this.verts[A].x * b + this.pHeight * this.verts[A].y + this.verts[A].z];
                m.MarchingCube.laplacianSmooth(1, this.verts, this.faces);
              }
            }
            m.MarchingCube = new c();
          }
        ),
        /***/
        "./src/VolumeData.ts": (
          /*!***************************!*\
            !*** ./src/VolumeData.ts ***!
            \***************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              VolumeData: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ./utilities */
              "./src/utilities.ts"
            ), a = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), l = t(
              /*! ./parsers/VASP */
              "./src/parsers/VASP.ts"
            ), h = t(
              /*! ./parsers/CUBE */
              "./src/parsers/CUBE.ts"
            ), c = t(
              /*! pako */
              "./node_modules/pako/dist/pako.esm.mjs"
            );
            class d {
              constructor(m, y, x) {
                if (this.unit = {
                  x: 1,
                  y: 1,
                  z: 1
                }, this.origin = {
                  x: 0,
                  y: 0,
                  z: 0
                }, this.size = {
                  x: 0,
                  y: 0,
                  z: 0
                }, this.data = new Float32Array([]), this.matrix = null, this.inversematrix = null, this.isbinary = /* @__PURE__ */ new Set(["ccp4", "CCP4"]), this.getCoordinates = function(u) {
                  var p = u / (this.size.y * this.size.z), g = u % (this.size.y * this.size.z), w = u % this.size.z;
                  return p *= this.unit.x, g *= this.unit.y, w *= this.unit.z, p += this.origin.x, g += this.origin.y, w += this.origin.z, { x: p, y: g, z: w };
                }, this.vasp = function(u) {
                  var p = u.replace(/^\s+/, "").split(/[\n\r]/), g = (0, l.VASP)(u)[0], w = g.length;
                  if (w == 0) {
                    console.warn("No good formating of CHG or CHGCAR file, not atomic information provided in the file."), this.data = [];
                    return;
                  }
                  var o = 1.889725992, v = 0.036749309, M = parseFloat(p[1]), E;
                  E = p[2].replace(/^\s+/, "").split(/\s+/);
                  var $ = new a.Vector3(parseFloat(E[0]), parseFloat(E[1]), parseFloat(E[2])).multiplyScalar(M * o);
                  E = p[3].replace(/^\s+/, "").split(/\s+/);
                  var k = new a.Vector3(parseFloat(E[0]), parseFloat(E[1]), parseFloat(E[2])).multiplyScalar(M * o);
                  E = p[4].replace(/^\s+/, "").split(/\s+/);
                  var L = new a.Vector3(parseFloat(E[0]), parseFloat(E[1]), parseFloat(E[2])).multiplyScalar(M * o), z = $.x * (k.y * L.z - L.y * k.z) - k.x * ($.y * L.z - L.y * $.z) + L.x * ($.y * k.z - k.y * $.z);
                  z = Math.abs(z) / Math.pow(o, 3);
                  var O = 1 / z;
                  p.splice(0, 8 + w + 1);
                  var R = p[0].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), N = Math.abs(parseFloat(R[0])), W = Math.abs(parseFloat(R[1])), B = Math.abs(parseFloat(R[2])), P = this.origin = new a.Vector3(0, 0, 0);
                  this.size = { x: N, y: W, z: B }, this.unit = new a.Vector3($.x, k.y, L.z), $ = $.multiplyScalar(1 / (o * N)), k = k.multiplyScalar(1 / (o * W)), L = L.multiplyScalar(1 / (o * B)), ($.y != 0 || $.z != 0 || k.x != 0 || k.z != 0 || L.x != 0 || L.y != 0) && (this.matrix = new a.Matrix4($.x, k.x, L.x, 0, $.y, k.y, L.y, 0, $.z, k.z, L.z, 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new a.Matrix4().makeTranslation(P.x, P.y, P.z)), this.origin = new a.Vector3(0, 0, 0), this.unit = new a.Vector3(1, 1, 1)), p.splice(0, 1);
                  var G = p.join(" ");
                  G = G.replace(/^\s+/, "");
                  var H = G.split(/[\s\r]+/);
                  H.splice(N * W * B + 1);
                  for (var U = Float32Array.from(H, parseFloat), j = 0; j < U.length; j++)
                    U[j] = U[j] * O * v;
                  this.data = U;
                }, this.dx = function(u) {
                  var p = u.split(/[\n\r]+/), g, w = /gridpositions\s+counts\s+(\d+)\s+(\d+)\s+(\d+)/, o = /^origin\s+(\S+)\s+(\S+)\s+(\S+)/, v = /^delta\s+(\S+)\s+(\S+)\s+(\S+)/, M = /data follows/, E = 0;
                  for (E = 0; E < p.length; E++) {
                    var $ = p[E];
                    if (g = w.exec($)) {
                      var k = parseInt(g[1]), L = parseInt(g[2]), z = parseInt(g[3]);
                      this.size = { x: k, y: L, z };
                    } else if (g = v.exec($)) {
                      var O = parseFloat(g[1]);
                      if ((parseFloat(g[2]) != 0 || parseFloat(g[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), E += 1, $ = p[E], g = v.exec($), g == null) {
                        console.error("Parse error in dx delta matrix");
                        return;
                      }
                      var R = parseFloat(g[2]);
                      if ((parseFloat(g[1]) != 0 || parseFloat(g[3]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), E += 1, $ = p[E], g = v.exec($), g == null) {
                        console.error("Parse error in dx delta matrix");
                        return;
                      }
                      var N = parseFloat(g[3]);
                      (parseFloat(g[1]) != 0 || parseFloat(g[2]) != 0) && console.warn("Non-orthogonal delta matrix not currently supported in dx format"), this.unit = new a.Vector3(O, R, N);
                    } else if (g = o.exec($)) {
                      var W = parseFloat(g[1]), B = parseFloat(g[2]), P = parseFloat(g[3]);
                      this.origin = new a.Vector3(W, B, P);
                    } else if (g = M.exec($))
                      break;
                  }
                  if (E += 1, !this.size || !this.origin || !this.unit || !this.size) {
                    console.error("Error parsing dx format");
                    return;
                  }
                  var G = p.splice(E).join(" "), H = G.split(/[\s\r]+/);
                  this.data = Float32Array.from(H, parseFloat);
                }, y = y.toLowerCase(), /\.gz$/.test(y)) {
                  y = y.replace(/\.gz$/, "");
                  try {
                    this[y] && this.isbinary.has(y) ? (typeof m == "string" && (m = (0, r.base64ToArray)(m)), m = (0, c.inflate)(m)) : m = new TextDecoder("utf-8").decode((0, c.inflate)(m));
                  } catch (u) {
                    console.error(u);
                  }
                }
                if (this[y] && (this.isbinary.has(y) && typeof m == "string" && (m = (0, r.base64ToArray)(m)), this[y](m)), x) {
                  if (x.negate)
                    for (let u = 0, p = this.data.length; u < p; u++)
                      this.data[u] = -this.data[u];
                  if (x.normalize) {
                    var b = 0;
                    for (let u = 0, p = this.data.length; u < p; u++)
                      b += this.data[u];
                    var A = b / this.data.length;
                    b = 0;
                    for (let u = 0, p = this.data.length; u < p; u++) {
                      var f = this.data[u] - A;
                      b += f * f;
                    }
                    var s = b / this.data.length;
                    for (let u = 0, p = this.data.length; u < p; u++)
                      this.data[u] = (this.data[u] - A) / s;
                  }
                }
              }
              /**
               * @function $3Dmol.VolumeData.getIndex
               * @param {number} x,y,z - the coordinates
               * @returns - index into flat array closest to provided coordinate; -1 if invalid
               */
              getIndex(m, y, x) {
                if (this.matrix) {
                  this.inversematrix == null && (this.inversematrix = new a.Matrix4().getInverse(this.matrix));
                  var b = new a.Vector3(m, y, x);
                  b = b.applyMatrix4(this.inversematrix), m = b.x, y = b.y, x = b.z;
                } else
                  m -= this.origin.x, y -= this.origin.y, x -= this.origin.z, m /= this.unit.x, y /= this.unit.y, x /= this.unit.z;
                return m = Math.round(m), y = Math.round(y), x = Math.round(x), m < 0 || m >= this.size.x || y < 0 || y >= this.size.y || x < 0 || x >= this.size.z ? -1 : m * this.size.y * this.size.z + y * this.size.z + x;
              }
              /**
               * @function $3Dmol.VolumeData.getVal
               * @param {number} x,y,z - the coordinates
               * @returns - value closest to provided coordinate; zero if coordinate invalid
               */
              getVal(m, y, x) {
                let b = this.getIndex(m, y, x);
                return b < 0 ? 0 : this.data[b];
              }
              // parse cube data
              cube(m) {
                var y = m.split(/\r?\n/);
                if (!(y.length < 6)) {
                  var x = (0, h.CUBE)(m, {}).modelData[0].cryst, b = y[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), A = parseFloat(b[0]), f = Math.abs(A);
                  this.origin = x.origin, this.size = x.size, this.unit = x.unit, this.matrix = x.matrix4;
                  var s = 6;
                  A < 0 && s++;
                  var u = y.splice(f + s).join(" ");
                  u = u.replace(/^\s+/, "");
                  var p = u.split(/[\s\r]+/);
                  this.data = Float32Array.from(p, parseFloat);
                }
              }
              //parse cp4 files
              ccp4(m) {
                var y = {};
                m = new Int8Array(m);
                var x = new Int32Array(m.buffer, 0, 56), b = new Float32Array(m.buffer, 0, 56), A = new DataView(m.buffer);
                if (y.MAP = String.fromCharCode(A.getUint8(208), A.getUint8(209), A.getUint8(210), A.getUint8(211)), y.MACHST = [A.getUint8(212), A.getUint8(213)], y.MACHST[0] === 17 && y.MACHST[1] === 17)
                  for (var f = m.byteLength, s = 0; s < f; s += 4)
                    A.setFloat32(s, A.getFloat32(s), !0);
                y.NX = x[0], y.NY = x[1], y.NZ = x[2], y.MODE = x[3], y.NXSTART = x[4], y.NYSTART = x[5], y.NZSTART = x[6], y.MX = x[7], y.MY = x[8], y.MZ = x[9], y.xlen = b[10], y.ylen = b[11], y.zlen = b[12], y.alpha = b[13], y.beta = b[14], y.gamma = b[15], y.MAPC = x[16], y.MAPR = x[17], y.MAPS = x[18], y.DMIN = b[19], y.DMAX = b[20], y.DMEAN = b[21], y.ISPG = x[22], y.NSYMBT = x[23], y.LSKFLG = x[24], y.originX = b[49], y.originY = b[50], y.originZ = b[51], y.ARMS = b[54];
                var u = y, p = [
                  u.xlen,
                  0,
                  0
                ], g = [
                  u.ylen * Math.cos(Math.PI / 180 * u.gamma),
                  u.ylen * Math.sin(Math.PI / 180 * u.gamma),
                  0
                ], w = [
                  u.zlen * Math.cos(Math.PI / 180 * u.beta),
                  u.zlen * (Math.cos(Math.PI / 180 * u.alpha) - Math.cos(Math.PI / 180 * u.gamma) * Math.cos(Math.PI / 180 * u.beta)) / Math.sin(Math.PI / 180 * u.gamma),
                  0
                ];
                w[2] = Math.sqrt(u.zlen * u.zlen * Math.sin(Math.PI / 180 * u.beta) * Math.sin(Math.PI / 180 * u.beta) - w[1] * w[1]);
                var o = [0, p, g, w], v = [0, u.MX, u.MY, u.MZ], M = [0, u.MAPC, u.MAPR, u.MAPS];
                this.matrix = new a.Matrix4(), this.matrix.set(o[M[1]][0] / v[M[1]], o[M[2]][0] / v[M[2]], o[M[3]][0] / v[M[3]], 0, o[M[1]][1] / v[M[1]], o[M[2]][1] / v[M[2]], o[M[3]][1] / v[M[3]], 0, o[M[1]][2] / v[M[1]], o[M[2]][2] / v[M[2]], o[M[3]][2] / v[M[3]], 0, 0, 0, 0, 1), this.matrix = this.matrix.multiplyMatrices(this.matrix, new a.Matrix4().makeTranslation(u.NXSTART + u.originX, u.NYSTART + u.originY, u.NZSTART + u.originZ)), this.origin = new a.Vector3(0, 0, 0), this.unit = new a.Vector3(1, 1, 1), this.size = { x: y.NX, y: y.NY, z: y.NZ }, this.dimensionorder = [y.MAPC, y.MAPR, y.MAPS];
                var E = new Float32Array(m.buffer, 1024 + y.NSYMBT), $ = y.NX, k = y.NY, L = y.NZ;
                this.data = new Float32Array($ * k * L);
                for (let z = 0; z < $; z++)
                  for (let O = 0; O < k; O++)
                    for (let R = 0; R < L; R++)
                      this.data[(z * k + O) * L + R] = E[(R * k + O) * $ + z];
              }
            }
          }
        ),
        /***/
        "./src/VolumetricRender.ts": (
          /*!*********************************!*\
            !*** ./src/VolumetricRender.ts ***!
            \*********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              GLVolumetricRender: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL/shapes */
              "./src/WebGL/shapes/index.ts"
            ), a = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), l = t(
              /*! ./WebGL */
              "./src/WebGL/index.ts"
            ), h = t(
              /*! ./colors */
              "./src/colors.ts"
            ), c = t(
              /*! ./GLShape */
              "./src/GLShape.ts"
            );
            class d {
              static interpolateArray(m, y) {
                function x(w, o, v) {
                  return w + (o - w) * v;
                }
                var b = [], A = (m.length - 1) / (y - 1);
                b[0] = m[0];
                for (var f = 1; f < y - 1; f++) {
                  var s = f * A, u = Math.floor(s), p = Math.ceil(s), g = s - u;
                  b[f] = x(m[u], m[p], g);
                }
                return b[y - 1] = m[m.length - 1], b;
              }
              constructor(m, y, x) {
                this.hidden = !1, this.boundingSphere = new r.Sphere(), this.renderedShapeObj = null, this.shapeObj = null, this.subsamples = 5, this.data = null, this.transferfunctionbuffer = [], this.min = 0, this.max = 0, y = y || {};
                var b = Object.assign([], y.transferfn);
                this.subsamples = y.subsamples || 5;
                let A = 256;
                b.forEach(function(k) {
                  k.value = parseFloat(k.value);
                }), b.sort(function(k, L) {
                  return k.value - L.value;
                }), this.min = b[0].value, b.length == 0 && b.push(b[0]), this.max = b[b.length - 1].value;
                var f, s, u, p, g, w, o, v, M, E;
                for (let k = 0; k < b.length - 1; k++)
                  if (u = h.CC.color(b[k].color), p = h.CC.color(b[k + 1].color), M = b[k].opacity, E = b[k + 1].opacity, f = Math.floor((b[k].value - this.min) * A / (this.max - this.min)), s = Math.floor((b[k + 1].value - this.min) * A / (this.max - this.min)), f != s) {
                    g = d.interpolateArray([u.r * 255, p.r * 255], s - f), w = d.interpolateArray([u.g * 255, p.g * 255], s - f), o = d.interpolateArray([u.b * 255, p.b * 255], s - f), v = d.interpolateArray([M * 255, E * 255], s - f);
                    for (let L = 0; L < g.length; L++)
                      this.transferfunctionbuffer.push(g[L]), this.transferfunctionbuffer.push(w[L]), this.transferfunctionbuffer.push(o[L]), this.transferfunctionbuffer.push(v[L]);
                  }
                if (this.transferfunctionbuffer = new Uint8ClampedArray(this.transferfunctionbuffer), m.matrix) {
                  let k = new a.Vector3(0, 0, 0), L = new a.Vector3(m.size.x, m.size.y, m.size.z), z = new a.Vector3(1, 1, 1);
                  k.applyMatrix4(m.matrix), L.applyMatrix4(m.matrix), z.applyMatrix4(m.matrix).sub(k), this.extent = [[k.x, k.y, k.z], [L.x, L.y, L.z]];
                  for (let W = 1; W < 7; W++)
                    L.x = W & 1 ? m.size.x : 0, L.y = W & 2 ? m.size.y : 0, L.z = W & 4 ? m.size.z : 0, L.applyMatrix4(m.matrix), this.extent[0][0] = Math.min(this.extent[0][0], L.x), this.extent[0][1] = Math.min(this.extent[0][1], L.y), this.extent[0][2] = Math.min(this.extent[0][2], L.z), this.extent[1][0] = Math.max(this.extent[1][0], L.x), this.extent[1][1] = Math.max(this.extent[1][1], L.y), this.extent[1][2] = Math.max(this.extent[1][2], L.z);
                  let O = L.x - k.x, R = L.y - k.y, N = L.z - k.z;
                  this.maxdepth = Math.sqrt(O * O + R * R + N * N), this.minunit = Math.min(Math.min(z.x, z.y), z.z), this.texmatrix = new a.Matrix4().identity().scale({ x: m.size.x, y: m.size.y, z: m.size.z }), this.texmatrix = this.texmatrix.multiplyMatrices(m.matrix, this.texmatrix), this.texmatrix = this.texmatrix.getInverse(this.texmatrix);
                } else {
                  this.texmatrix = new a.Matrix4().identity();
                  let k = m.unit.x * m.size.x, L = m.unit.y * m.size.y, z = m.unit.z * m.size.z;
                  this.texmatrix.makeTranslation(-m.origin.x / k, -m.origin.y / L, -m.origin.z / z), this.texmatrix.scale({ x: 1 / k, y: 1 / L, z: 1 / z }), this.minunit = Math.min(Math.min(m.unit.x, m.unit.y), m.unit.z), this.extent = [
                    [m.origin.x, m.origin.y, m.origin.z],
                    [m.origin.x + k, m.origin.y + L, m.origin.z + z]
                  ], this.maxdepth = Math.sqrt(k * k + L * L + z * z);
                }
                var $ = new c.GLShape({});
                if ($.addBox({
                  corner: { x: this.extent[0][0], y: this.extent[0][1], z: this.extent[0][2] },
                  dimensions: {
                    w: this.extent[1][0] - this.extent[0][0],
                    h: this.extent[1][1] - this.extent[0][1],
                    d: this.extent[1][2] - this.extent[0][2]
                  }
                }), this.geo = $.finalize(), this.boundingSphere.center = new a.Vector3((this.extent[0][0] + this.extent[1][0]) / 2, (this.extent[0][1] + this.extent[1][1]) / 2, (this.extent[0][2] + this.extent[1][2]) / 2), this.boundingSphere.radius = this.maxdepth / 2, y.coords === void 0 && y.selection !== void 0 && (x ? y.coords = x.selectedAtoms(y.selection) : console.log("Need to provide viewer to volumetric renderer if selection specified.")), y.coords !== void 0 && y.seldist !== void 0) {
                  let k = new Uint8Array(m.data.length), L = y.seldist, z = L * L;
                  for (let O = 0, R = y.coords.length; O < R; O++) {
                    let N = y.coords[O], W = N.x - L, B = N.y - L, P = N.z - L, G = N.x + L, H = N.y + L, U = N.z + L;
                    if (m.getIndex(W, B, P) >= 0 || m.getIndex(G, H, U) >= 0)
                      for (let j = W; j < G; j += this.minunit)
                        for (let re = B; re < H; re += this.minunit)
                          for (let ie = P; ie < U; ie += this.minunit) {
                            let te = m.getIndex(j, re, ie);
                            te >= 0 && !k[te] && (j - N.x) * (j - N.x) + (re - N.y) * (re - N.y) + (ie - N.z) * (ie - N.z) < z && (k[te] = 1);
                          }
                  }
                  for (let O = 0, R = m.data.length; O < R; O++)
                    k[O] == 0 && (m.data[O] = 1 / 0);
                }
                this.data = m;
              }
              /**
               * Initialize webgl objects for rendering
               * @param {Object3D} group
               *
               */
              globj(m) {
                if (this.renderedShapeObj && (m.remove(this.renderedShapeObj), this.renderedShapeObj = null), !this.hidden) {
                  this.shapeObj = new l.Object3D();
                  var y = null, x = new l.Texture(this.data, !0), b = new l.Texture(this.transferfunctionbuffer, !1);
                  x.needsUpdate = !0, b.needsUpdate = !0, b.flipY = !1, y = new l.VolumetricMaterial({
                    transferfn: b,
                    transfermin: this.min,
                    transfermax: this.max,
                    map: x,
                    extent: this.extent,
                    maxdepth: this.maxdepth,
                    texmatrix: this.texmatrix,
                    unit: this.minunit,
                    subsamples: this.subsamples
                  });
                  var A = new l.Mesh(this.geo, y);
                  this.shapeObj.add(A), this.renderedShapeObj = this.shapeObj.clone(), m.add(this.renderedShapeObj);
                }
              }
              removegl(m) {
                this.renderedShapeObj && (this.renderedShapeObj.geometry !== void 0 && this.renderedShapeObj.geometry.dispose(), this.renderedShapeObj.material !== void 0 && this.renderedShapeObj.material.dispose(), m.remove(this.renderedShapeObj), this.renderedShapeObj = null), this.shapeObj = null;
              }
              get position() {
                return this.boundingSphere.center;
              }
              get x() {
                return this.boundingSphere.center.x;
              }
              get y() {
                return this.boundingSphere.center.y;
              }
              get z() {
                return this.boundingSphere.center.z;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/Camera.ts": (
          /*!*****************************!*\
            !*** ./src/WebGL/Camera.ts ***!
            \*****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Camera: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./core */
              "./src/WebGL/core/index.ts"
            ), a = t(
              /*! ./math */
              "./src/WebGL/math/index.ts"
            );
            class l extends r.Object3D {
              constructor(c = 50, d = 1, _ = 0.1, m = 2e3, y = !1) {
                super(), this.projectionMatrix = new a.Matrix4(), this.projectionMatrixInverse = new a.Matrix4(), this.matrixWorldInverse = new a.Matrix4(), this.fov = c, this.aspect = d, this.near = _, this.far = m;
                var x = this.position.z;
                this.right = x * Math.tan(Math.PI / 180 * c), this.left = -this.right, this.top = this.right / this.aspect, this.bottom = -this.top, this.ortho = !!y, this.updateProjectionMatrix();
              }
              lookAt(c) {
                this.matrix.lookAt(this.position, c, this.up), this.rotationAutoUpdate && (this.useQuaternion === !1 && this.rotation instanceof a.Vector3 ? this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder) : console.error("Unimplemented math operation."));
              }
              updateProjectionMatrix() {
                this.ortho ? this.projectionMatrix.makeOrthographic(this.left, this.right, this.top, this.bottom, this.near, this.far) : this.projectionMatrix.makePerspective(this.fov, this.aspect, this.near, this.far), this.projectionMatrixInverse.getInverse(this.projectionMatrix);
              }
            }
          }
        ),
        /***/
        "./src/WebGL/Fog.ts": (
          /*!**************************!*\
            !*** ./src/WebGL/Fog.ts ***!
            \**************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Fog: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../colors */
              "./src/colors.ts"
            );
            class a {
              constructor(h, c = 1, d = 1e3) {
                this.name = "", this.color = new r.Color(h), this.near = c, this.far = d;
              }
              clone() {
                return new a(this.color.getHex(), this.near, this.far);
              }
            }
          }
        ),
        /***/
        "./src/WebGL/Renderer.ts": (
          /*!*******************************!*\
            !*** ./src/WebGL/Renderer.ts ***!
            \*******************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Renderer: () => (
                /* binding */
                f
              )
              /* harmony export */
            });
            var r = t(
              /*! ./Camera */
              "./src/WebGL/Camera.ts"
            ), a = t(
              /*! ./constants/Sides */
              "./src/WebGL/constants/Sides.ts"
            ), l = t(
              /*! ./constants/TextureConstants */
              "./src/WebGL/constants/TextureConstants.ts"
            ), h = t(
              /*! ./core */
              "./src/WebGL/core/index.ts"
            ), c = t(
              /*! ../colors */
              "./src/colors.ts"
            ), d = t(
              /*! ./materials */
              "./src/WebGL/materials/index.ts"
            ), _ = t(
              /*! ./math */
              "./src/WebGL/math/index.ts"
            ), m = t(
              /*! ./objects */
              "./src/WebGL/objects/index.ts"
            ), y = t(
              /*! ./shaders */
              "./src/WebGL/shaders/index.ts"
            ), x = t(
              /*! ./SpritePlugin */
              "./src/WebGL/SpritePlugin.ts"
            ), b = null, A = null;
            class f {
              constructor(u) {
                this.context = null, this.devicePixelRatio = 1, this.sortObjects = !0, this.autoUpdateObjects = !0, this.autoUpdateScene = !0, this.info = {
                  memory: {
                    programs: 0,
                    geometries: 0,
                    textures: 0
                  },
                  render: {
                    calls: 0,
                    vertices: 0,
                    faces: 0,
                    points: 0
                  }
                }, this._offscreen = null, this._bitmap = null, this._programs = [], this._programs_counter = 0, this._webglversion = 1, this._currentProgram = null, this._currentMaterialId = -1, this._currentGeometryGroupHash = null, this._currentCamera = null, this._geometryGroupCounter = 0, this._oldDoubleSided = -1, this._oldFlipSided = -1, this._oldDepthTest = -1, this._oldDepthWrite = -1, this._oldPolygonOffset = null, this._oldLineWidth = null, this._viewportWidth = 0, this._viewportHeight = 0, this._currentWidth = 0, this._currentHeight = 0, this._enabledAttributes = {}, this._vector3 = new _.Vector3(), this._worldInverse = new _.Matrix4(), this._projInverse = new _.Matrix4(), this._textureMatrix = new _.Matrix4(), this._fullProjModelMatrix = new _.Matrix4(), this._fullProjModelMatrixInv = new _.Matrix4(), this._direction = new _.Vector3(), this._lightsNeedUpdate = !0, this._lights = {
                  ambient: [0, 0, 0],
                  directional: {
                    length: 0,
                    colors: [],
                    positions: []
                  },
                  point: {
                    length: 0,
                    colors: [],
                    positions: [],
                    distances: []
                  },
                  spot: {
                    length: 0,
                    colors: [],
                    positions: [],
                    distances: [],
                    directions: [],
                    anglesCos: [],
                    exponents: []
                  },
                  hemi: {
                    length: 0,
                    skyColors: [],
                    groundColors: [],
                    positions: []
                  }
                }, this.sprites = new x.SpritePlugin(), this._screenshader = null, this._AOshader = null, this._blurshader = null, this._vertexattribpos = null, this._aovertexattribpos = null, this._blurvertexattribpos = null, this._screenQuadVBO = null, this._fb = null, this._targetTexture = null, this._depthTexture = null, this._shadingTexture = null, this._scratchTexture = null, this._AOstrength = 1, this._AOradius = 5, this.SHADE_TEXTURE = 3, u = u || {}, this.row = u.row, this.col = u.col, this.rows = u.rows, this.cols = u.cols, this._canvas = u.canvas !== void 0 ? u.canvas : document.createElement("canvas"), this._precision = u.precision !== void 0 ? u.precision : "highp", this._alpha = u.alpha !== void 0 ? u.alpha : !0, this._premultipliedAlpha = u.premultipliedAlpha !== void 0 ? u.premultipliedAlpha : !0, this._antialias = u.antialias !== void 0 ? u.antialias : !1, this._preserveDrawingBuffer = u.preserveDrawingBuffer !== void 0 ? u.preserveDrawingBuffer : !1, this._clearColor = u.clearColor !== void 0 ? new c.Color(u.clearColor) : new c.Color(0), this._clearAlpha = u.clearAlpha !== void 0 ? u.clearAlpha : 0, this._outlineMaterial = new d.MeshOutlineMaterial(u.outline), this._outlineSphereImposterMaterial = new d.SphereImposterOutlineMaterial(u.outline), this._outlineStickImposterMaterial = new d.StickImposterOutlineMaterial(u.outline), this._outlineEnabled = !!u.outline, this._AOEnabled = !!u.ambientOcclusion, u.ambientOcclusion && typeof u.ambientOcclusion.strength < "u" && (this._AOstrength = parseFloat(u.ambientOcclusion.strength)), this._AOstrength == 0 && (this._AOEnabled = !1), u.ambientOcclusion && typeof u.ambientOcclusion.radius < "u" && (this._AOradius = parseFloat(u.ambientOcclusion.radius)), this.domElement = this._canvas, this._canvas.id = u.id, !(u.containerWidth == 0 || u.containerHeight == 0) && (this.initGL(), this.setDefaultGLState(), this.context = this._gl, this.isWebGL1() ? this._extInstanced = this._gl.getExtension("ANGLE_instanced_arrays") : this._extInstanced = {
                  vertexAttribDivisorANGLE: this._gl.vertexAttribDivisor.bind(this._gl),
                  drawElementsInstancedANGLE: this._gl.drawElementsInstanced.bind(this._gl)
                }, this._extFragDepth = this._gl.getExtension("EXT_frag_depth"), this._extFloatLinear = this._gl.getExtension("OES_texture_float_linear"), this._extColorBufferFloat = this._gl.getExtension("EXT_color_buffer_float"), this.sprites.init(this));
              }
              // API
              supportedExtensions() {
                return {
                  supportsAIA: !!this._extInstanced,
                  supportsImposters: !!this._extFragDepth || !this.isWebGL1(),
                  regen: !1
                };
              }
              getContext() {
                return this._gl;
              }
              getCanvas() {
                return this._canvas;
              }
              isLost() {
                return this._gl == null || this._gl.isContextLost();
              }
              getPrecision() {
                return this._precision;
              }
              setClearColorHex(u, p) {
                this._clearColor.setHex(u), this._clearAlpha = p, this.isLost() || this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha);
              }
              enableOutline(u) {
                this._outlineMaterial = new d.MeshOutlineMaterial(u), this._outlineSphereImposterMaterial = new d.SphereImposterOutlineMaterial(u), this._outlineStickImposterMaterial = new d.StickImposterOutlineMaterial(u), this._outlineEnabled = !0;
              }
              disableOutline() {
                this._outlineEnabled = !1;
              }
              enableAmbientOcclusion(u) {
                u && (u.strength && (this._AOstrength = u.strength), u.scale && (this._AOradius = u.scale)), this._AOEnabled = this._AOstrength > 0;
              }
              disableAmbientOcclusion() {
                this._AOEnabled = !1;
              }
              setViewport() {
                if (this._offscreen && (this._offscreen.width = this._canvas.width, this._offscreen.height = this._canvas.height), this.rows != null && this.cols != null && this.row != null && this.col != null) {
                  var u = this._canvas.width / this.cols, p = this._canvas.height / this.rows;
                  this._viewportWidth = u, this._viewportHeight = p, this.isLost() || (this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(u * this.col, p * this.row, u, p), this._gl.viewport(u * this.col, p * this.row, u, p));
                }
              }
              setSize(u, p) {
                if (this.devicePixelRatio = window.devicePixelRatio !== void 0 ? window.devicePixelRatio : 1, this._antialias && this.devicePixelRatio < 2 && (this.devicePixelRatio *= 2), this.rows != null && this.cols != null && this.row != null && this.col != null) {
                  var g = u / this.cols, w = p / this.rows;
                  this._canvas.width = u * this.devicePixelRatio, this._canvas.height = p * this.devicePixelRatio, this._viewportWidth = g * this.devicePixelRatio, this._viewportHeight = w * this.devicePixelRatio, this._canvas.style.width = u + "px", this._canvas.style.height = p + "px", this.setViewport();
                } else
                  this._viewportWidth = this._canvas.width = u * this.devicePixelRatio, this._viewportHeight = this._canvas.height = p * this.devicePixelRatio, this._canvas.style.width = u + "px", this._canvas.style.height = p + "px", this.isLost() || this._gl.viewport(0, 0, this._gl.drawingBufferWidth, this._gl.drawingBufferHeight);
                this.initFrameBuffer();
              }
              clear(u, p, g) {
                var w = 0;
                (u === void 0 || u) && (w |= this._gl.COLOR_BUFFER_BIT), (p === void 0 || p) && (w |= this._gl.DEPTH_BUFFER_BIT), (g === void 0 || g) && (w |= this._gl.STENCIL_BUFFER_BIT), this._gl.clear(w);
              }
              setMaterialFaces(u, p) {
                var g = u.side === a.DoubleSide, w = u.side === a.BackSide;
                u.imposter || (w = p ? !w : w), this._oldDoubleSided !== g && (g ? this._gl.disable(this._gl.CULL_FACE) : this._gl.enable(this._gl.CULL_FACE), this._oldDoubleSided = g), this._oldFlipSided !== w && (w ? this._gl.frontFace(this._gl.CW) : this._gl.frontFace(this._gl.CCW), this._oldFlipSided = w), this._gl.cullFace(this._gl.BACK);
              }
              setDepthTest(u) {
                this._oldDepthTest !== u && (u ? this._gl.enable(this._gl.DEPTH_TEST) : this._gl.disable(this._gl.DEPTH_TEST), this._oldDepthTest = u);
              }
              setDepthWrite(u) {
                this._oldDepthWrite !== u && (this._gl.depthMask(u), this._oldDepthWrite = u);
              }
              setBlending(u) {
                u ? (this._gl.enable(this._gl.BLEND), this._gl.blendEquationSeparate(this._gl.FUNC_ADD, this._gl.FUNC_ADD), this._gl.blendFuncSeparate(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA, this._gl.ONE, this._gl.ONE_MINUS_SRC_ALPHA)) : this._gl.disable(this._gl.BLEND);
              }
              // TODO: need to set up shader attributes and uniforms as attributes on
              // material object after attaching prgm
              // We need to attach appropriate uniform variables to material after shaders
              // have been chosen
              initMaterial(u, p, g, w) {
                u.addEventListener("dispose", this.onMaterialDispose.bind(this));
                var o, v;
                if (v = u.shaderID, v) {
                  var M = y.ShaderLib[v];
                  u.vertexShader = M.vertexShader, u.fragmentShader = M.fragmentShader, u.uniforms = y.ShaderUtils.clone(M.uniforms), u.shaded && u.makeShaded(this.SHADE_TEXTURE);
                }
                o = {
                  wireframe: u.wireframe,
                  fragdepth: u.imposter,
                  volumetric: u.volumetric,
                  shaded: u.shaded
                }, u.program = this.buildProgram(u.fragmentShader, u.vertexShader, u.uniforms, o);
              }
              renderBuffer(u, p, g, w, o, v) {
                if (w.visible) {
                  var M, E;
                  if (M = this.setProgram(u, p, g, w, v, this), !!M) {
                    E = M.attributes;
                    var $ = !1, k = w.wireframe ? 1 : 0, L = o.id * 16777215 + M.id * 2 + k;
                    L !== this._currentGeometryGroupHash && (this._currentGeometryGroupHash = L, $ = !0), $ && (this.disableAttributes(), E.position >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, o.__webglVertexBuffer), this.enableAttribute(E.position), this._gl.vertexAttribPointer(E.position, 3, this._gl.FLOAT, !1, 0, 0)), E.color >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, o.__webglColorBuffer), this.enableAttribute(E.color), this._gl.vertexAttribPointer(E.color, 3, this._gl.FLOAT, !1, 0, 0)), E.normal >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, o.__webglNormalBuffer), this.enableAttribute(E.normal), this._gl.vertexAttribPointer(E.normal, 3, this._gl.FLOAT, !1, 0, 0)), E.offset >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, o.__webglOffsetBuffer), this.enableAttribute(E.offset), this._gl.vertexAttribPointer(E.offset, 3, this._gl.FLOAT, !1, 0, 0)), E.radius >= 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, o.__webglRadiusBuffer), this.enableAttribute(E.radius), this._gl.vertexAttribPointer(E.radius, 1, this._gl.FLOAT, !1, 0, 0)));
                    var z, O;
                    if (v instanceof m.Mesh) {
                      if (w.shaderID === "instanced") {
                        var R = w.sphere.geometryGroups[0];
                        $ && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, o.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, R.vertexArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, o.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, R.normalArray, this._gl.STATIC_DRAW), this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, o.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, R.faceArray, this._gl.STATIC_DRAW)), z = R.faceidx, this._extInstanced.vertexAttribDivisorANGLE(E.offset, 1), this._extInstanced.vertexAttribDivisorANGLE(E.radius, 1), this._extInstanced.vertexAttribDivisorANGLE(E.color, 1), this._extInstanced.drawElementsInstancedANGLE(this._gl.TRIANGLES, z, this._gl.UNSIGNED_SHORT, 0, o.radiusArray.length), this._extInstanced.vertexAttribDivisorANGLE(E.offset, 0), this._extInstanced.vertexAttribDivisorANGLE(E.radius, 0), this._extInstanced.vertexAttribDivisorANGLE(E.color, 0);
                      } else w.wireframe ? (O = o.lineidx, this.setLineWidth(w.wireframeLinewidth), $ && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, o.__webglLineBuffer), this._gl.drawElements(this._gl.LINES, O, this._gl.UNSIGNED_SHORT, 0)) : (z = o.faceidx, $ && this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, o.__webglFaceBuffer), this._gl.drawElements(this._gl.TRIANGLES, z, this._gl.UNSIGNED_SHORT, 0));
                      this.info.render.calls++, this.info.render.vertices += z, this.info.render.faces += z / 3;
                    } else v instanceof m.Line && (O = o.vertices, this.setLineWidth(w.linewidth), this._gl.drawArrays(this._gl.LINES, 0, O), this.info.render.calls++);
                  }
                }
              }
              /* clear out the shading textures */
              clearShading() {
                this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._shadingTexture, 0), this.clear(!1, !0, !1), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0);
              }
              /* Setup the shading buffer to reflect desired shading (ambient occlusion) values.
                Only the matching object with materialType are considered. */
              setShading(u, p, g) {
                let w = u.__lights, o = u.fog, v = [];
                for (let $ = 0, k = u.__webglObjects.length; $ < k; $++) {
                  let L = u.__webglObjects[$];
                  L.render && L[g] && v.push(L);
                }
                if (v.length == 0)
                  return;
                this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._shadingTexture, 0), this._gl.framebufferTexture2D(
                  this._gl.FRAMEBUFFER,
                  this._gl.COLOR_ATTACHMENT0,
                  this._gl.TEXTURE_2D,
                  null,
                  //don't write colors (can we do this?)
                  0
                ), this.renderObjects(u.__webglObjects, !0, g + "Depth", p, w, o, !1), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._scratchTexture, 0), this.clear(!1, !0, !1), this._gl.useProgram(this._AOshader), this._currentProgram = this._AOshader, this.setDepthTest(-1), this.setDepthWrite(-1);
                let M = this._AOshader.uniforms;
                this._gl.uniform1f(M.total_strength, this._AOstrength), this._gl.uniform1f(M.radius, this._AOradius), this._fullProjModelMatrix = new _.Matrix4(), this._fullProjModelMatrixInv = new _.Matrix4();
                let E = v[0].object;
                this._fullProjModelMatrix.multiplyMatrices(p.projectionMatrix, E._modelViewMatrix), this._fullProjModelMatrixInv.getInverse(this._fullProjModelMatrix), this._gl.uniformMatrix4fv(M.projectionMatrix, !1, this._fullProjModelMatrix.elements), this._gl.uniformMatrix4fv(M.projinv, !1, this._fullProjModelMatrixInv.elements), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.enableVertexAttribArray(this._aovertexattribpos), this._gl.vertexAttribPointer(this._aovertexattribpos, 2, this._gl.FLOAT, !1, 0, 0), this._gl.activeTexture(this._gl.TEXTURE0), this._gl.bindTexture(this._gl.TEXTURE_2D, this._shadingTexture), this._gl.drawArrays(this._gl.TRIANGLES, 0, 6), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._shadingTexture, 0), this.clear(!1, !0, !1), this._gl.useProgram(this._blurshader), this._currentProgram = this._blurshader, this.setDepthTest(-1), this.setDepthWrite(-1), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.enableVertexAttribArray(this._blurvertexattribpos), this._gl.vertexAttribPointer(this._blurvertexattribpos, 2, this._gl.FLOAT, !1, 0, 0), this._gl.activeTexture(this._gl.TEXTURE0), this._gl.bindTexture(this._gl.TEXTURE_2D, this._scratchTexture), this._gl.drawArrays(this._gl.TRIANGLES, 0, 6), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.COLOR_ATTACHMENT0, this._gl.TEXTURE_2D, this._targetTexture, 0), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0);
              }
              render(u, p) {
                if (!(p instanceof r.Camera)) {
                  console.error("Renderer.render: camera is not an instance of Camera.");
                  return;
                }
                var g, w, o, v, M, E = u.__lights, $ = u.fog;
                if (this._currentMaterialId = -1, this._lightsNeedUpdate = !0, this.autoUpdateScene && u.updateMatrixWorld(), p.parent === void 0 && p.updateMatrixWorld(), p.matrixWorldInverse.getInverse(p.matrixWorld), this.isLost())
                  return;
                this.autoUpdateObjects && this.initWebGLObjects(u), this.info.render.calls = 0, this.info.render.vertices = 0, this.info.render.faces = 0, this.info.render.points = 0, this._currentWidth = this._viewportWidth, this._currentHeight = this._viewportHeight, this.setViewport(), this.setFrameBuffer(), this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha), this.clear(!0, !0, !0), M = u.__webglObjects;
                let k = !1, L = this._AOEnabled;
                for (g = 0, w = M.length; g < w; g++)
                  o = M[g], v = o.object, o.render = !1, v.visible && (this.setupMatrices(v, p), this.unrollBufferMaterial(o), o.render = !0, o.volumetric && (k = !0), o.hasAO && (L = !0));
                if (this.setBlending(!1), L && this.setShading(u, p, "opaque"), this.renderObjects(u.__webglObjects, !0, "opaque", p, E, $, !1), L && this.clearShading(), this.renderSprites(u, p, !1), this.renderObjects(u.__webglObjects, !0, "transparentDepth", p, E, $, !0), this.renderObjects(u.__webglObjects, !1, "transparent", p, E, $, !0), k && this._fb && (this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, null, 0), this.renderObjects(u.__webglObjects, !1, "volumetric", p, E, $, !0)), this.renderFrameBuffertoScreen(), this.setDepthTest(!0), this.setDepthWrite(!0), this.renderSprites(u, p, !0), this._bitmap) {
                  const z = this._offscreen.transferToImageBitmap();
                  this._bitmap.transferFromImageBitmap(z);
                }
              }
              //setup framebuffer for drawing into, assumes buffers already allocated
              setFrameBuffer() {
                if (this.isWebGL1() || !this._fb)
                  return;
                let u = this._viewportWidth, p = this._viewportHeight;
                this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, u, p), this._gl.viewport(0, 0, u, p), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, u, p, 0, this._gl.RGBA, this._gl.UNSIGNED_BYTE, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, p, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._shadingTexture && (this._gl.deleteTexture(this._shadingTexture), this._shadingTexture = this._gl.createTexture(), this._gl.bindTexture(this._gl.TEXTURE_2D, this._shadingTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, p, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.deleteTexture(this._scratchTexture), this._scratchTexture = this._gl.createTexture(), this._gl.bindTexture(this._gl.TEXTURE_2D, this._scratchTexture), this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.DEPTH_COMPONENT32F, u, p, 0, this._gl.DEPTH_COMPONENT, this._gl.FLOAT, null), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(this._gl.TEXTURE_2D, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE)), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, this._fb), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.COLOR_ATTACHMENT0, this._gl.TEXTURE_2D, this._targetTexture, 0), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._shadingTexture, 0), this._gl.clearDepth(1), this._gl.clear(this._gl.DEPTH_BUFFER_BIT), this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.DEPTH_ATTACHMENT, this._gl.TEXTURE_2D, this._depthTexture, 0);
              }
              //allocate buffers for framebuffer, needs to be called with every resize
              initFrameBuffer() {
                if (this.isWebGL1())
                  return;
                let u = this._viewportWidth, p = this._viewportHeight;
                this._gl.enable(this._gl.SCISSOR_TEST), this._gl.scissor(0, 0, u, p), this._gl.viewport(0, 0, u, p), this._targetTexture = this._gl.createTexture(), this._depthTexture = this._gl.createTexture(), this._shadingTexture = this._gl.createTexture(), this._scratchTexture = this._gl.createTexture(), this._fb = this._gl.createFramebuffer();
                var g = this._antialias ? y.ShaderLib.screenaa : y.ShaderLib.screen;
                this._screenshader = this.buildProgram(g.fragmentShader, g.vertexShader, g.uniforms, {}), this._vertexattribpos = this._gl.getAttribLocation(this._screenshader, "vertexPosition");
                var w = [
                  // First triangle:
                  1,
                  1,
                  -1,
                  1,
                  -1,
                  -1,
                  // Second triangle:
                  -1,
                  -1,
                  1,
                  -1,
                  1,
                  1
                ];
                this._screenQuadVBO = this._gl.createBuffer(), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.bufferData(this._gl.ARRAY_BUFFER, new Float32Array(w), this._gl.STATIC_DRAW);
                let o = y.ShaderLib.ssao;
                this._AOshader = this.buildProgram(o.fragmentShader, o.vertexShader, o.uniforms, {}), this._aovertexattribpos = this._gl.getAttribLocation(this._AOshader, "vertexPosition");
                let v = y.ShaderLib.blur;
                this._blurshader = this.buildProgram(v.fragmentShader, v.vertexShader, v.uniforms, {}), this._blurvertexattribpos = this._gl.getAttribLocation(this._blurshader, "vertexPosition");
              }
              renderFrameBuffertoScreen() {
                this.isWebGL1() || this._fb === null || (this.setViewport(), this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, null), this._gl.clear(this._gl.COLOR_BUFFER_BIT | this._gl.DEPTH_BUFFER_BIT), this._gl.frontFace(this._gl.CCW), this._gl.cullFace(this._gl.BACK), this._gl.useProgram(this._screenshader), this._currentProgram = this._screenshader, this.setDepthTest(-1), this.setDepthWrite(-1), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, this._screenQuadVBO), this._gl.enableVertexAttribArray(this._vertexattribpos), this._gl.vertexAttribPointer(this._vertexattribpos, 2, this._gl.FLOAT, !1, 0, 0), this._gl.activeTexture(this._gl.TEXTURE0), this._gl.bindTexture(this._gl.TEXTURE_2D, this._targetTexture), this._gl.drawArrays(this._gl.TRIANGLES, 0, 6));
              }
              initWebGLObjects(u) {
                if (u.__webglObjects || (u.__webglObjects = [], u.__webglObjectsImmediate = [], u.__webglSprites = [], u.__webglFlares = []), u.__objectsAdded.length) {
                  for (; u.__objectsAdded.length; )
                    this.addObject(u.__objectsAdded[0], u), u.__objectsAdded.splice(0, 1);
                  this._currentGeometryGroupHash = -1;
                }
                for (; u.__objectsRemoved.length; )
                  this.removeObject(u.__objectsRemoved[0], u), u.__objectsRemoved.splice(0, 1);
                for (var p = 0, g = u.__webglObjects.length; p < g; p++)
                  this.updateObject(u.__webglObjects[p].object);
              }
              getYRatio() {
                return this.rows !== void 0 && this.row !== void 0 ? this.rows : 1;
              }
              getXRatio() {
                return this.cols !== void 0 && this.col !== void 0 ? this.cols : 1;
              }
              getAspect(u, p) {
                (u == null || p == null) && (u = this._canvas.width, p = this._canvas.height);
                var g = u / p;
                if (this.rows != null && this.cols != null && this.row != null && this.col != null) {
                  var w = u / this.cols, o = p / this.rows;
                  g = w / o;
                }
                return g;
              }
              setTexture(u, p, g) {
                if (u.needsUpdate) {
                  u.__webglInit || (u.__webglInit = !0, u.addEventListener("dispose", this.onTextureDispose.bind(this)), u.__webglTexture = this._gl.createTexture(), this.info.memory.textures++), this._gl.activeTexture(this._gl.TEXTURE0 + p);
                  var w = g ? this._gl.TEXTURE_3D : this._gl.TEXTURE_2D;
                  this._gl.bindTexture(w, u.__webglTexture), this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, u.flipY), this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, u.premultiplyAlpha), this._gl.pixelStorei(this._gl.UNPACK_ALIGNMENT, u.unpackAlignment), this._gl.pixelStorei(this._gl.PACK_ALIGNMENT, u.unpackAlignment);
                  var o = this.paramToGL(u.format), v = this.paramToGL(u.type);
                  if (g)
                    this.setTextureParameters(this._gl.TEXTURE_3D, u), this._gl.texImage3D(this._gl.TEXTURE_3D, 0, this._gl.R32F, u.image.size.z, u.image.size.y, u.image.size.x, 0, this._gl.RED, this._gl.FLOAT, u.image.data);
                  else {
                    var M = u.image, E = M.width, $ = M.height;
                    typeof E > "u" && (E = M.length, o == this._gl.RGBA && (E /= 4), $ = 1), this.setTextureParameters(this._gl.TEXTURE_2D, u), this.isWebGL1() ? this._gl.texImage2D(this._gl.TEXTURE_2D, 0, o, o, v, u.image) : this._gl.texImage2D(this._gl.TEXTURE_2D, 0, o, E, $, 0, o, v, u.image);
                  }
                  u.needsUpdate = !1, u.onUpdate && u.onUpdate();
                } else
                  this._gl.activeTexture(this._gl.TEXTURE0 + p), g ? this._gl.bindTexture(this._gl.TEXTURE_3D, u.__webglTexture) : this._gl.bindTexture(this._gl.TEXTURE_2D, u.__webglTexture);
              }
              supportsVolumetric() {
                return !this.isWebGL1();
              }
              enableAttribute(u) {
                this._enabledAttributes[u] || (this._gl.enableVertexAttribArray(u), this._enabledAttributes[u] = !0);
              }
              disableAttributes() {
                for (let u in this._enabledAttributes)
                  this._enabledAttributes[u] && (this._gl.disableVertexAttribArray(u), this._enabledAttributes[u] = !1);
              }
              setPolygonOffset(u, p, g) {
                this._oldPolygonOffset !== u && (u ? this._gl.enable(this._gl.POLYGON_OFFSET_FILL) : this._gl.disable(this._gl.POLYGON_OFFSET_FILL));
              }
              setLineWidth(u) {
                u !== this._oldLineWidth && (this._gl.lineWidth(u), this._oldLineWidth = u);
              }
              deallocateGeometry(u) {
                if (u.__webglInit = void 0, u.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(u.__webglVertexBuffer), u.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(u.__webglColorBuffer), u.geometryGroups !== void 0)
                  for (var p = 0, g = u.groups; p < g; p++) {
                    var w = u.geometryGroups[p];
                    w.__webglVertexBuffer !== void 0 && this._gl.deleteBuffer(w.__webglVertexBuffer), w.__webglColorBuffer !== void 0 && this._gl.deleteBuffer(w.__webglColorBuffer), w.__webglNormalBuffer !== void 0 && this._gl.deleteBuffer(w.__webglNormalBuffer), w.__webglFaceBuffer !== void 0 && this._gl.deleteBuffer(w.__webglFaceBuffer), w.__webglLineBuffer !== void 0 && this._gl.deleteBuffer(w.__webglLineBuffer);
                  }
              }
              deallocateMaterial(u) {
                var p = u.program;
                if (p !== void 0) {
                  u.program = void 0;
                  var g, w, o, v = !1;
                  for (g = 0, w = this._programs.length; g < w; g++)
                    if (o = this._programs[g], o.program === p) {
                      o.usedTimes--, o.usedTimes === 0 && (v = !0);
                      break;
                    }
                  if (v === !0) {
                    var M = [];
                    for (g = 0, w = this._programs.length; g < w; g++)
                      o = this._programs[g], o.program !== p && M.push(o);
                    this._programs = M, this._gl.deleteProgram(p), this.info.memory.programs--;
                  }
                }
              }
              deallocateTexture(u) {
                if (u.image && u.image.__webglTextureCube)
                  this._gl.deleteTexture(u.image.__webglTextureCube);
                else {
                  if (!u.__webglInit)
                    return;
                  u.__webglInit = !1, this._gl.deleteTexture(u.__webglTexture);
                }
              }
              onGeometryDispose(u) {
                var p = u.target;
                p.removeEventListener("dispose", this.onGeometryDispose), this.deallocateGeometry(p), this.info.memory.geometries--;
              }
              onTextureDispose(u) {
                var p = u.target;
                p.removeEventListener("dispose", this.onTextureDispose), this.deallocateTexture(p), this.info.memory.textures--;
              }
              onMaterialDispose(u) {
                var p = u.target;
                p.removeEventListener("dispose", this.onMaterialDispose), this.deallocateMaterial(p);
              }
              // Compile and return shader
              getShader(u, p) {
                var g;
                return !this.isWebGL1() && !p.startsWith("#version") && (p = p.replace(/gl_FragDepthEXT/g, "gl_FragDepth"), u == "fragment" ? p = p.replace(/varying/g, "in") : p = p.replace(/varying/g, "out"), p = p.replace(/attribute/g, "in"), p = p.replace(/texture2D/g, "texture"), p = p.replace(/\/\/DEFINEFRAGCOLOR/g, "out vec4 glFragColor;"), p = p.replace(/gl_FragColor/g, "glFragColor"), p = `#version 300 es
` + p), u === "fragment" ? g = this._gl.createShader(this._gl.FRAGMENT_SHADER) : u === "vertex" && (g = this._gl.createShader(this._gl.VERTEX_SHADER)), g == null ? null : (this._gl.shaderSource(g, p), this._gl.compileShader(g), this._gl.getShaderParameter(g, this._gl.COMPILE_STATUS) ? g : (console.error(this._gl.getShaderInfoLog(g)), console.error("could not initialize shader"), null));
              }
              // Compile appropriate shaders (if necessary) from source code and attach to
              // gl program.
              buildProgram(u, p, g, w) {
                var o, v, M, E, $ = [];
                $.push(u), $.push(p);
                for (o in w)
                  $.push(o), $.push(w[o]);
                for (E = $.join(), o = 0, v = this._programs.length; o < v; o++) {
                  var k = this._programs[o];
                  if (k.code === E)
                    return k.usedTimes++, k.program;
                }
                if (this.isWebGL1() && w.volumetric)
                  throw new Error("Volumetric rendering requires webgl2 which is not supported by your hardware.");
                if (M = this._gl.createProgram(), M == null)
                  return null;
                var L = this._precision, z = "precision " + L + " float;", O = [
                  w.volumetric ? "#version 300 es" : "",
                  z
                ].join(`
`), R = [
                  w.volumetric ? "#version 300 es" : "",
                  w.fragdepth && this.isWebGL1() ? "#extension GL_EXT_frag_depth: enable" : "",
                  w.shaded ? "#define SHADED 1" : "",
                  w.wireframe ? "#define WIREFRAME 1" : "",
                  z
                ].join(`
`), N = this.getShader("fragment", R + u), W = this.getShader("vertex", O + p);
                W != null && this._gl.attachShader(M, W), N != null && this._gl.attachShader(M, N), this._gl.linkProgram(M), this._gl.getProgramParameter(M, this._gl.LINK_STATUS) || console.error("Could not initialize shader"), M.uniforms = {}, M.attributes = {};
                var B, P, G;
                B = [
                  "viewMatrix",
                  "modelViewMatrix",
                  "projectionMatrix",
                  "normalMatrix",
                  "vWidth",
                  "vHeight"
                ];
                for (P in g)
                  B.push(P);
                for (G = 0; G < B.length; G++) {
                  var H = B[G];
                  M.uniforms[H] = this._gl.getUniformLocation(M, H);
                }
                for (B = [
                  "position",
                  "normal",
                  "color",
                  "lineDistance",
                  "offset",
                  "radius"
                ], G = 0; G < B.length; G++) {
                  var U = B[G];
                  M.attributes[U] = this._gl.getAttribLocation(M, U);
                }
                return M.id = this._programs_counter++, this._programs.push({
                  program: M,
                  code: E,
                  usedTimes: 1
                }), this.info.memory.programs = this._programs.length, M;
              }
              setProgram(u, p, g, w, o, v) {
                if (w.needsUpdate && (w.program && this.deallocateMaterial(w), this.initMaterial(w, p, g, o), w.needsUpdate = !1), w.program == null)
                  return null;
                var M = !1, E = w.program, $ = E.uniforms, k = w.uniforms;
                if (E != this._currentProgram && (this._gl.useProgram(E), this._currentProgram = E, M = !0), w.id != this._currentMaterialId && (this._currentMaterialId = w.id, M = !0), u != this._currentCamera && (this._currentCamera = u, M = !0), $.projectionMatrix && this._gl.uniformMatrix4fv($.projectionMatrix, !1, u.projectionMatrix.elements), $.modelViewMatrix && this._gl.uniformMatrix4fv($.modelViewMatrix, !1, o._modelViewMatrix.elements), $.normalMatrix && this._gl.uniformMatrix3fv($.normalMatrix, !1, o._normalMatrix.elements), $.projinv && (this._projInverse.getInverse(u.projectionMatrix), this._gl.uniformMatrix4fv($.projinv, !1, this._projInverse.elements)), $.viewMatrix && this._gl.uniformMatrix4fv($.viewMatrix, !1, u.matrixWorldInverse.elements), $.vWidth && this._gl.uniform1f($.vWidth, this._viewportWidth), $.vHeight && this._gl.uniform1f($.vHeight, this._viewportHeight), M) {
                  if (k.fogColor.value = g.color, k.fogNear.value = g.near, k.fogFar.value = g.far, w.shaderID.startsWith("lambert") || w.shaderID === "instanced" || w.shaderID.endsWith("imposter"))
                    this._lightsNeedUpdate && (this.setupLights(E, p), this._lightsNeedUpdate = !1), k.directionalLightColor.value = this._lights.directional.colors, k.directionalLightDirection.value = this._lights.directional.positions;
                  else if (w.shaderID.endsWith("outline"))
                    k.outlineColor.value = w.outlineColor, k.outlineWidth.value = w.outlineWidth, k.outlinePushback.value = w.outlinePushback, k.outlineMaxPixels.value = w.outlineMaxPixels * this.devicePixelRatio;
                  else if (w.shaderID === "volumetric") {
                    o._modelViewMatrix.getScale(this._direction), this._worldInverse.getInverse(o._modelViewMatrix), this._projInverse.getInverse(u.projectionMatrix), this._textureMatrix.multiplyMatrices(o.material.texmatrix, this._worldInverse), this._gl.uniformMatrix4fv($.textmat, !1, this._textureMatrix.elements), this._gl.uniformMatrix4fv($.projinv, !1, this._projInverse.elements);
                    let L = Math.min(Math.min(this._direction.x, this._direction.y), this._direction.z);
                    k.step.value = o.material.unit * L, k.maxdepth.value = o.material.maxdepth * L, k.transfermax.value = o.material.transfermax, k.transfermin.value = o.material.transfermin, k.subsamples.value = o.material.subsamples, v.setTexture(o.material.transferfn, 4, !1), v.setTexture(o.material.map, 3, !0), this._gl.activeTexture(this._gl.TEXTURE5), this._gl.bindTexture(this._gl.TEXTURE_2D, this._depthTexture);
                  }
                  k.opacity.value = w.opacity, this.loadMaterialUniforms($, k);
                }
                return k.shading && (k.shading.value == 3 ? (this._gl.activeTexture(this._gl.TEXTURE0 + this.SHADE_TEXTURE), this._gl.bindTexture(this._gl.TEXTURE_2D, this._shadingTexture)) : console.error("Invalid shading textures.")), E;
              }
              loadMaterialUniforms(u, p) {
                var g, w, o, v;
                for (g in p)
                  u[g] && (w = p[g].type, o = p[g].value, v = u[g], w === "f" ? this._gl.uniform1f(v, o) : w === "i" ? this._gl.uniform1i(v, o) : w === "fv" ? this._gl.uniform3fv(v, o) : w === "c" ? this._gl.uniform3f(v, o.r, o.g, o.b) : w === "f4" && this._gl.uniform4f(v, o[0], o[1], o[2], o[3]));
              }
              // Objects adding
              addObject(u, p) {
                var g, w, o, v;
                if (!u.__webglInit && (u.__webglInit = !0, u._modelViewMatrix = new _.Matrix4(), u._normalMatrix = new _.Matrix3(), u.geometry !== void 0 && u.geometry.__webglInit === void 0 && (u.geometry.__webglInit = !0, u.geometry.addEventListener("dispose", this.onGeometryDispose.bind(this))), u instanceof m.Mesh || u instanceof m.Line))
                  for (o = u.geometry, g = 0, w = o.geometryGroups.length; g < w; g++)
                    v = o.geometryGroups[g], v.id = this._geometryGroupCounter++, v.__webglVertexBuffer || (u instanceof m.Mesh ? (this.createMeshBuffers(v), o.elementsNeedUpdate = !0, o.normalsNeedUpdate = !0) : u instanceof m.Line && this.createLineBuffers(v), o.verticesNeedUpdate = !0, o.colorsNeedUpdate = !0);
                if (!u.__webglActive) {
                  if (u instanceof m.Mesh || u instanceof m.Line)
                    for (o = u.geometry, g = 0, w = o.geometryGroups.length; g < w; g++)
                      v = o.geometryGroups[g], this.addBuffer(p.__webglObjects, v, u);
                  else u instanceof m.Sprite && p.__webglSprites.push(u);
                  u.__webglActive = !0;
                }
              }
              updateObject(u) {
                var p = u.geometry, g;
                if (u instanceof m.Mesh || u instanceof m.Line) {
                  for (var w = 0, o = p.geometryGroups.length; w < o; w++)
                    g = p.geometryGroups[w], (p.verticesNeedUpdate || p.elementsNeedUpdate || p.colorsNeedUpdate || p.normalsNeedUpdate) && this.setBuffers(g, this._gl.STATIC_DRAW);
                  p.verticesNeedUpdate = !1, p.elementsNeedUpdate = !1, p.normalsNeedUpdate = !1, p.colorsNeedUpdate = !1, p.buffersNeedUpdate = !1;
                }
              }
              removeObject(u, p) {
                u instanceof m.Mesh || u instanceof m.Line ? this.removeInstances(p.__webglObjects, u) : u instanceof m.Sprite && this.removeInstancesDirect(p.__webglSprites, u), u.__webglActive = !1;
              }
              removeInstances(u, p) {
                for (var g = u.length - 1; g >= 0; --g)
                  u[g].object === p && u.splice(g, 1);
              }
              removeInstancesDirect(u, p) {
                for (var g = u.length - 1; g >= 0; --g)
                  u[g] === p && u.splice(g, 1);
              }
              unrollBufferMaterial(u) {
                var p = u.object, g = p.material;
                if (g.volumetric)
                  u.opaque = null, u.transparent = null, u.volumetric = g;
                else if (g.transparent) {
                  if (u.opaque = null, u.volumetric = null, u.transparent = g, !g.wireframe) {
                    let w = g.clone();
                    w.opacity = 0, u.transparentDepth = w;
                  }
                } else {
                  if (u.opaque = g, u.transparent = null, u.volumetric = null, !g.wireframe) {
                    let w = g.clone();
                    w.opacity = 0, u.opaqueDepth = w;
                  }
                  g.hasAO && (u.hasAO = !0), (this._AOEnabled || u.hasAO) && (u.opaqueShaded = g.clone(), u.opaqueShaded.shaded = !0);
                }
              }
              setBuffers(u, p) {
                var g = u.vertexArray, w = u.colorArray;
                if (u.__webglOffsetBuffer !== void 0 ? (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglOffsetBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, g, p)) : (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglVertexBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, g, p)), this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglColorBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, w, p), u.normalArray && u.__webglNormalBuffer !== void 0) {
                  var o = u.normalArray;
                  this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglNormalBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, o, p);
                }
                if (u.radiusArray && u.__webglRadiusBuffer !== void 0 && (this._gl.bindBuffer(this._gl.ARRAY_BUFFER, u.__webglRadiusBuffer), this._gl.bufferData(this._gl.ARRAY_BUFFER, u.radiusArray, p)), u.faceArray && u.__webglFaceBuffer !== void 0) {
                  var v = u.faceArray;
                  this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, u.__webglFaceBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, v, p);
                }
                if (u.lineArray && u.__webglLineBuffer !== void 0) {
                  var M = u.lineArray;
                  this._gl.bindBuffer(this._gl.ELEMENT_ARRAY_BUFFER, u.__webglLineBuffer), this._gl.bufferData(this._gl.ELEMENT_ARRAY_BUFFER, M, p);
                }
              }
              // Creates appropriate gl buffers for geometry chunk
              // TODO: do we need line buffer for mesh objects?
              // Also, can we integrate this with createLineBuffers?
              createMeshBuffers(u) {
                u.radiusArray && (u.__webglRadiusBuffer = this._gl.createBuffer()), u.useOffset && (u.__webglOffsetBuffer = this._gl.createBuffer()), u.__webglVertexBuffer = this._gl.createBuffer(), u.__webglNormalBuffer = this._gl.createBuffer(), u.__webglColorBuffer = this._gl.createBuffer(), u.__webglFaceBuffer = this._gl.createBuffer(), u.__webglLineBuffer = this._gl.createBuffer(), this.info.memory.geometries++;
              }
              createLineBuffers(u) {
                u.__webglVertexBuffer = this._gl.createBuffer(), u.__webglColorBuffer = this._gl.createBuffer(), this.info.memory.geometries++;
              }
              addBuffer(u, p, g) {
                u.push({
                  buffer: p,
                  object: g,
                  opaque: null,
                  transparent: null
                });
              }
              setupMatrices(u, p) {
                u._modelViewMatrix.multiplyMatrices(p.matrixWorldInverse, u.matrixWorld), u._normalMatrix.getInverse(u._modelViewMatrix), u._normalMatrix.transpose();
              }
              // Fallback filters for non-power-of-2 textures
              filterFallback(u) {
                return this._gl.LINEAR;
              }
              setTextureParameters(u, p) {
                u == this._gl.TEXTURE_2D ? (this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this.filterFallback(p.magFilter)), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this.filterFallback(p.minFilter))) : (this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_S, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_T, this._gl.CLAMP_TO_EDGE), this._gl.texParameteri(u, this._gl.TEXTURE_WRAP_R, this._gl.CLAMP_TO_EDGE), this._extColorBufferFloat && this._extFloatLinear ? (this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this._gl.LINEAR), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this._gl.LINEAR)) : (this._gl.texParameteri(u, this._gl.TEXTURE_MAG_FILTER, this._gl.NEAREST), this._gl.texParameteri(u, this._gl.TEXTURE_MIN_FILTER, this._gl.NEAREST)));
              }
              // Map constants to WebGL constants
              paramToGL(u) {
                return u === l.UnsignedByteType ? this._gl.UNSIGNED_BYTE : u === l.RGBAFormat ? this._gl.RGBA : u === l.NearestFilter ? this._gl.NEAREST : 0;
              }
              setupLights(u, p) {
                var g, w, o, v = 0, M = 0, E = 0, $, k, L = this._lights, z = L.directional.colors, O = L.directional.positions, R = 0, N = 0;
                for (g = 0, w = p.length; g < w; g++)
                  if (o = p[g], $ = o.color, k = o.intensity, o instanceof h.Light) {
                    if (this._direction.getPositionFromMatrix(o.matrixWorld), this._vector3.getPositionFromMatrix(o.target.matrixWorld), this._direction.sub(this._vector3), this._direction.normalize(), this._direction.x === 0 && this._direction.y === 0 && this._direction.z === 0)
                      continue;
                    O[N] = this._direction.x, O[N + 1] = this._direction.y, O[N + 2] = this._direction.z, z[N] = $.r * k, z[N + 1] = $.g * k, z[N + 2] = $.b * k, N += 3, R++;
                  }
                L.ambient[0] = v, L.ambient[1] = M, L.ambient[2] = E, L.directional.length = R;
              }
              initGL() {
                try {
                  if (OffscreenCanvas && !(this.rows != null && this.cols != null && this.row != null && this.col != null))
                    (A == null || A.isContextLost()) && (b = new OffscreenCanvas(this._canvas.width, this._canvas.height), A = b.getContext("webgl2", {
                      alpha: !0,
                      premultipliedAlpha: this._premultipliedAlpha,
                      antialias: this._antialias,
                      preserveDrawingBuffer: this._preserveDrawingBuffer
                    })), this._offscreen = b, this._gl = A, this._bitmap = this._canvas.getContext("bitmaprenderer", {
                      alpha: !0
                    });
                  else if (!(this._gl = this._canvas.getContext("webgl2", {
                    alpha: this._alpha,
                    premultipliedAlpha: this._premultipliedAlpha,
                    antialias: this._antialias,
                    preserveDrawingBuffer: this._preserveDrawingBuffer
                  })) && !(this._gl = this._canvas.getContext("experimental-webgl", {
                    alpha: this._alpha,
                    premultipliedAlpha: this._premultipliedAlpha,
                    antialias: this._antialias,
                    preserveDrawingBuffer: this._preserveDrawingBuffer
                  })) && !(this._gl = this._canvas.getContext("webgl", {
                    alpha: this._alpha,
                    premultipliedAlpha: this._premultipliedAlpha,
                    antialias: this._antialias,
                    preserveDrawingBuffer: this._preserveDrawingBuffer
                  })))
                    throw "Error creating WebGL context.";
                  var u = this._gl.getParameter(this._gl.VERSION);
                  this._webglversion = parseInt(u[6]);
                } catch (p) {
                  console.error(p);
                }
              }
              isWebGL1() {
                return this._webglversion == 1;
              }
              setDefaultGLState() {
                this._gl.clearDepth(1), this._gl.clearStencil(0), this._gl.enable(this._gl.DEPTH_TEST), this._gl.depthFunc(this._gl.LEQUAL), this._gl.frontFace(this._gl.CCW), this._gl.cullFace(this._gl.BACK), this._gl.enable(this._gl.CULL_FACE), this._gl.enable(this._gl.BLEND), this._gl.blendEquation(this._gl.FUNC_ADD), this._gl.blendFunc(this._gl.SRC_ALPHA, this._gl.ONE_MINUS_SRC_ALPHA), this._gl.clearColor(this._clearColor.r, this._clearColor.g, this._clearColor.b, this._clearAlpha);
              }
              // rendering
              renderObjects(u, p, g, w, o, v, M) {
                var E, $, k, L, z, O, R;
                p ? (z = u.length - 1, O = -1, R = -1) : (z = 0, O = u.length, R = 1);
                for (var N = z; N !== O; N += R)
                  if (E = u[N], E.render) {
                    if ($ = E.object, k = E.buffer, L = E[g], (E.hasAO || this._AOEnabled) && E[g + "Shaded"] && (L = E[g + "Shaded"]), !L)
                      continue;
                    M && this.setBlending(!0), this.setDepthTest(L.depthTest), this.setDepthWrite(L.depthWrite), this.setPolygonOffset(L.polygonOffset, L.polygonOffsetFactor, L.polygonOffsetUnits);
                    var W = $._modelViewMatrix.isReflected();
                    if (this.setMaterialFaces(L, W), this.renderBuffer(w, o, v, L, k, $), (this._outlineEnabled || L.outline) && !L.wireframe && L.shaderID !== "basic" && L.opacity !== 0) {
                      let B = this._outlineMaterial;
                      L.shaderID == "sphereimposter" ? B = this._outlineSphereImposterMaterial : L.shaderID == "stickimposter" && (B = this._outlineStickImposterMaterial), this.renderBuffer(w, o, v, B, k, $);
                    }
                  }
              }
              renderSprites(u, p, g) {
                this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1, this._lightsNeedUpdate = !0, this.sprites.render(u, p, this._currentWidth, this._currentHeight, g), this._currentGeometryGroupHash = -1, this._currentProgram = null, this._currentCamera = null, this._oldDepthWrite = -1, this._oldDepthTest = -1, this._oldDoubleSided = -1, this._currentMaterialId = -1, this._oldFlipSided = -1;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/SpritePlugin.ts": (
          /*!***********************************!*\
            !*** ./src/WebGL/SpritePlugin.ts ***!
            \***********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              SpritePlugin: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ./shaders/index */
              "./src/WebGL/shaders/index.ts"
            );
            class a {
              constructor() {
                this.sprite = {
                  vertices: null,
                  faces: null,
                  vertexBuffer: null,
                  elementBuffer: null,
                  program: null,
                  attributes: {},
                  uniforms: null
                };
              }
              init(c) {
                this.gl = c.context, this.renderer = c, this.precision = c.getPrecision(), this.sprite.vertices = new Float32Array(16), this.sprite.faces = new Uint16Array(6);
                var d = 0;
                this.sprite.vertices[d++] = -1, this.sprite.vertices[d++] = -1, this.sprite.vertices[d++] = 0, this.sprite.vertices[d++] = 0, this.sprite.vertices[d++] = 1, this.sprite.vertices[d++] = -1, this.sprite.vertices[d++] = 1, this.sprite.vertices[d++] = 0, this.sprite.vertices[d++] = 1, this.sprite.vertices[d++] = 1, this.sprite.vertices[d++] = 1, this.sprite.vertices[d++] = 1, this.sprite.vertices[d++] = -1, this.sprite.vertices[d++] = 1, this.sprite.vertices[d++] = 0, this.sprite.vertices[d++] = 1, d = 0, this.sprite.faces[d++] = 0, this.sprite.faces[d++] = 1, this.sprite.faces[d++] = 2, this.sprite.faces[d++] = 0, this.sprite.faces[d++] = 2, this.sprite.faces[d++] = 3, this.sprite.vertexBuffer = this.gl.createBuffer(), this.sprite.elementBuffer = this.gl.createBuffer(), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.bufferData(this.gl.ARRAY_BUFFER, this.sprite.vertices, this.gl.STATIC_DRAW), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.faces, this.gl.STATIC_DRAW), this.sprite.program = this.createProgram(
                  r.ShaderLib.sprite,
                  this.precision || 1
                  /** added default to single precision */
                ), this.sprite.attributes = {};
                const _ = {};
                this.sprite.attributes.position = this.gl.getAttribLocation(this.sprite.program, "position"), this.sprite.attributes.uv = this.gl.getAttribLocation(this.sprite.program, "uv"), _.uvOffset = this.gl.getUniformLocation(this.sprite.program, "uvOffset"), _.uvScale = this.gl.getUniformLocation(this.sprite.program, "uvScale"), _.rotation = this.gl.getUniformLocation(this.sprite.program, "rotation"), _.scale = this.gl.getUniformLocation(this.sprite.program, "scale"), _.alignment = this.gl.getUniformLocation(this.sprite.program, "alignment"), _.color = this.gl.getUniformLocation(this.sprite.program, "color"), _.map = this.gl.getUniformLocation(this.sprite.program, "map"), _.opacity = this.gl.getUniformLocation(this.sprite.program, "opacity"), _.useScreenCoordinates = this.gl.getUniformLocation(this.sprite.program, "useScreenCoordinates"), _.screenPosition = this.gl.getUniformLocation(this.sprite.program, "screenPosition"), _.modelViewMatrix = this.gl.getUniformLocation(this.sprite.program, "modelViewMatrix"), _.projectionMatrix = this.gl.getUniformLocation(this.sprite.program, "projectionMatrix"), _.fogType = this.gl.getUniformLocation(this.sprite.program, "fogType"), _.fogDensity = this.gl.getUniformLocation(this.sprite.program, "fogDensity"), _.fogNear = this.gl.getUniformLocation(this.sprite.program, "fogNear"), _.fogFar = this.gl.getUniformLocation(this.sprite.program, "fogFar"), _.fogColor = this.gl.getUniformLocation(this.sprite.program, "fogColor"), _.alphaTest = this.gl.getUniformLocation(this.sprite.program, "alphaTest"), this.sprite.uniforms = _;
              }
              render(c, d, _, m, y) {
                var x, b, A, f, s, u, p, g, w, o;
                if (!this.gl)
                  throw new Error("WebGLRenderer not initialized");
                let v = [];
                (x = c == null ? void 0 : c.__webglSprites) === null || x === void 0 || x.forEach((re) => {
                  (y && re.material.depthTest == !1 || !y && re.material.depthTest) && v.push(re);
                });
                let M = v.length;
                if (!M)
                  return;
                const E = this.sprite.attributes, $ = this.sprite.uniforms;
                if (!$)
                  throw new Error("Uniforms not defined");
                var k = _ * 0.5, L = m * 0.5;
                this.gl.useProgram(this.sprite.program), this.gl.enableVertexAttribArray(E.position), this.gl.enableVertexAttribArray(E.uv), this.gl.disable(this.gl.CULL_FACE), this.gl.enable(this.gl.BLEND), this.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.sprite.vertexBuffer), this.gl.vertexAttribPointer(E.position, 2, this.gl.FLOAT, !1, 16, 0), this.gl.vertexAttribPointer(E.uv, 2, this.gl.FLOAT, !1, 16, 8), this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.sprite.elementBuffer), this.gl.uniformMatrix4fv($.projectionMatrix, !1, d.projectionMatrix.elements), this.gl.activeTexture(this.gl.TEXTURE0), this.gl.uniform1i($.map, 0);
                var z = 0, O = 0, R = c.fog;
                R ? (this.gl.uniform3f($.fogColor, R.color.r, R.color.g, R.color.b), this.gl.uniform1f($.fogNear, R.near), this.gl.uniform1f($.fogFar, R.far), this.gl.uniform1i($.fogType, 1), z = 1, O = 1) : (this.gl.uniform1i($.fogType, 0), z = 0, O = 0);
                var N;
                let W, B, P, G, H = [];
                for (N = 0; N < M; N++)
                  W = v[N], B = W.material, B && (B.depthTest == !1 && !y || !W.visible || B.opacity === 0 || (B.useScreenCoordinates ? W.z = -W.position.z : (W._modelViewMatrix.multiplyMatrices(d.matrixWorldInverse, W.matrixWorld), W.z = -W._modelViewMatrix.elements[14])));
                for (v.sort(l), N = 0; N < M; N++)
                  if (W = v[N], B = W.material, !!B && !(!W.visible || B.opacity === 0) && B.map && B.map.image && B.map.image.width) {
                    this.gl.uniform1f(($ == null ? void 0 : $.alphaTest) || null, B.alphaTest);
                    var U = B.map.image.width, j = B.map.image.height;
                    H[0] = U * this.renderer.devicePixelRatio / _, H[1] = j * this.renderer.devicePixelRatio / m, B.useScreenCoordinates === !0 ? (this.gl.uniform1i($.useScreenCoordinates, 1), this.gl.uniform3f($.screenPosition, (W.position.x * this.renderer.devicePixelRatio - k) / k, (L - W.position.y * this.renderer.devicePixelRatio) / L, Math.max(0, Math.min(1, W.position.z)))) : (this.gl.uniform1i($.useScreenCoordinates, 0), this.gl.uniformMatrix4fv($.modelViewMatrix, !1, W._modelViewMatrix.elements)), c.fog && B.fog ? G = O : G = 0, z !== G && (this.gl.uniform1i($.fogType, G), z = G), P = 1 / (B.scaleByViewport ? m : 1), H[0] *= P * W.scale.x, H[1] *= P * W.scale.y;
                    let re = (b = B == null ? void 0 : B.alignment) === null || b === void 0 ? void 0 : b.x, ie = (A = B == null ? void 0 : B.alignment) === null || A === void 0 ? void 0 : A.y;
                    B.screenOffset && (re = (re || 0) + 2 * B.screenOffset.x / U, ie = (ie || 0) + 2 * B.screenOffset.y / j), this.gl.uniform2f($.uvScale, ((f = B == null ? void 0 : B.uvScale) === null || f === void 0 ? void 0 : f.x) || 1, ((s = B == null ? void 0 : B.uvScale) === null || s === void 0 ? void 0 : s.y) || 1), this.gl.uniform2f($.uvOffset, ((u = B == null ? void 0 : B.uvOffset) === null || u === void 0 ? void 0 : u.x) || 0, ((p = B == null ? void 0 : B.uvOffset) === null || p === void 0 ? void 0 : p.y) || 0), this.gl.uniform2f($.alignment, re || 0, ie || 0), this.gl.uniform1f($.opacity, B.opacity), this.gl.uniform3f($.color, ((g = B == null ? void 0 : B.color) === null || g === void 0 ? void 0 : g.r) || 0, ((w = B == null ? void 0 : B.color) === null || w === void 0 ? void 0 : w.g) || 0, ((o = B == null ? void 0 : B.color) === null || o === void 0 ? void 0 : o.b) || 0), this.gl.uniform1f($.rotation, W.rotation), this.gl.uniform2fv($.scale, H), this.renderer.setDepthTest(B.depthTest), this.renderer.setDepthWrite(B.depthWrite), this.renderer.setTexture(B.map, 0), this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);
                  }
                this.gl.enable(this.gl.CULL_FACE);
              }
              createProgram(c, d) {
                if (!this.gl)
                  throw new Error("WebGL Rendering context not found");
                var _ = this.gl.createProgram();
                if (!_)
                  throw new Error("Error creating webgl program");
                var m = this.gl.createShader(this.gl.FRAGMENT_SHADER), y = this.gl.createShader(this.gl.VERTEX_SHADER);
                if (!m)
                  throw new Error("Unable to create fragment shader SpritePlugin.createProgram");
                if (!y)
                  throw new Error("Unable to create vertex shader SpritePlugin.createProgram");
                var x = "precision " + d + ` float;
`;
                if (this.gl.shaderSource(m, x + c.fragmentShader), this.gl.shaderSource(y, x + c.vertexShader), this.gl.compileShader(m), this.gl.compileShader(y), !this.gl.getShaderParameter(m, this.gl.COMPILE_STATUS) || !this.gl.getShaderParameter(y, this.gl.COMPILE_STATUS))
                  throw new Error(`Error compiling shader: 
      ${this.gl.getShaderInfoLog(m)} 
      ${this.gl.getShaderInfoLog(y)}`);
                return this.gl.attachShader(_, m), this.gl.attachShader(_, y), this.gl.linkProgram(_), this.gl.getProgramParameter(_, this.gl.LINK_STATUS) || console.error("Could not initialize shader"), _;
              }
            }
            function l(h, c) {
              return h.z !== c.z ? c.z - h.z : c.id - h.id;
            }
          }
        ),
        /***/
        "./src/WebGL/constants/Coloring.ts": (
          /*!*****************************************!*\
            !*** ./src/WebGL/constants/Coloring.ts ***!
            \*****************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Coloring: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            var r;
            (function(a) {
              a[a.NoColors = 0] = "NoColors", a[a.FaceColors = 1] = "FaceColors", a[a.VertexColors = 2] = "VertexColors";
            })(r || (r = {}));
          }
        ),
        /***/
        "./src/WebGL/constants/Shading.ts": (
          /*!****************************************!*\
            !*** ./src/WebGL/constants/Shading.ts ***!
            \****************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Shading: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            var r;
            (function(a) {
              a[a.NoShading = 0] = "NoShading", a[a.FlatShading = 1] = "FlatShading", a[a.SmoothShading = 2] = "SmoothShading";
            })(r || (r = {}));
          }
        ),
        /***/
        "./src/WebGL/constants/Sides.ts": (
          /*!**************************************!*\
            !*** ./src/WebGL/constants/Sides.ts ***!
            \**************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              BackSide: () => (
                /* binding */
                a
              ),
              /* harmony export */
              DoubleSide: () => (
                /* binding */
                l
              ),
              /* harmony export */
              FrontSide: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = 0, a = 1, l = 2;
          }
        ),
        /***/
        "./src/WebGL/constants/SpriteAlignment.ts": (
          /*!************************************************!*\
            !*** ./src/WebGL/constants/SpriteAlignment.ts ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              SpriteAlignment: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            );
            const a = {
              topLeft: new r.Vector2(1, -1),
              topCenter: new r.Vector2(0, -1),
              topRight: new r.Vector2(-1, -1),
              centerLeft: new r.Vector2(1, 0),
              center: new r.Vector2(0, 0),
              centerRight: new r.Vector2(-1, 0),
              bottomLeft: new r.Vector2(1, 1),
              bottomCenter: new r.Vector2(0, 1),
              bottomRight: new r.Vector2(-1, 1)
            };
          }
        ),
        /***/
        "./src/WebGL/constants/TextureConstants.ts": (
          /*!*************************************************!*\
            !*** ./src/WebGL/constants/TextureConstants.ts ***!
            \*************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              ClampToEdgeWrapping: () => (
                /* binding */
                r
              ),
              /* harmony export */
              FloatType: () => (
                /* binding */
                d
              ),
              /* harmony export */
              LinearFilter: () => (
                /* binding */
                a
              ),
              /* harmony export */
              LinearMipMapLinearFilter: () => (
                /* binding */
                h
              ),
              /* harmony export */
              NearestFilter: () => (
                /* binding */
                l
              ),
              /* harmony export */
              R32Format: () => (
                /* binding */
                y
              ),
              /* harmony export */
              RFormat: () => (
                /* binding */
                m
              ),
              /* harmony export */
              RGBAFormat: () => (
                /* binding */
                _
              ),
              /* harmony export */
              UnsignedByteType: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            const r = 1001, a = 1006, l = 1007, h = 1008, c = 1009, d = 1010, _ = 1021, m = 1022, y = 1023;
          }
        ),
        /***/
        "./src/WebGL/constants/TextureOperations.ts": (
          /*!**************************************************!*\
            !*** ./src/WebGL/constants/TextureOperations.ts ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              TextureOperations: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            var r;
            (function(a) {
              a[a.MultiplyOperation = 0] = "MultiplyOperation", a[a.MixOperation = 1] = "MixOperation", a[a.AddOperation = 2] = "AddOperation";
            })(r || (r = {}));
          }
        ),
        /***/
        "./src/WebGL/constants/index.ts": (
          /*!**************************************!*\
            !*** ./src/WebGL/constants/index.ts ***!
            \**************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              BackSide: () => (
                /* reexport safe */
                a.BackSide
              ),
              /* harmony export */
              ClampToEdgeWrapping: () => (
                /* reexport safe */
                c.ClampToEdgeWrapping
              ),
              /* harmony export */
              Coloring: () => (
                /* reexport safe */
                r.Coloring
              ),
              /* harmony export */
              DoubleSide: () => (
                /* reexport safe */
                a.DoubleSide
              ),
              /* harmony export */
              FloatType: () => (
                /* reexport safe */
                c.FloatType
              ),
              /* harmony export */
              FrontSide: () => (
                /* reexport safe */
                a.FrontSide
              ),
              /* harmony export */
              LinearFilter: () => (
                /* reexport safe */
                c.LinearFilter
              ),
              /* harmony export */
              LinearMipMapLinearFilter: () => (
                /* reexport safe */
                c.LinearMipMapLinearFilter
              ),
              /* harmony export */
              NearestFilter: () => (
                /* reexport safe */
                c.NearestFilter
              ),
              /* harmony export */
              R32Format: () => (
                /* reexport safe */
                c.R32Format
              ),
              /* harmony export */
              RFormat: () => (
                /* reexport safe */
                c.RFormat
              ),
              /* harmony export */
              RGBAFormat: () => (
                /* reexport safe */
                c.RGBAFormat
              ),
              /* harmony export */
              Shading: () => (
                /* reexport safe */
                l.Shading
              ),
              /* harmony export */
              SpriteAlignment: () => (
                /* reexport safe */
                h.SpriteAlignment
              ),
              /* harmony export */
              TextureOperations: () => (
                /* reexport safe */
                d.TextureOperations
              ),
              /* harmony export */
              UnsignedByteType: () => (
                /* reexport safe */
                c.UnsignedByteType
              )
              /* harmony export */
            });
            var r = t(
              /*! ./Coloring */
              "./src/WebGL/constants/Coloring.ts"
            ), a = t(
              /*! ./Sides */
              "./src/WebGL/constants/Sides.ts"
            ), l = t(
              /*! ./Shading */
              "./src/WebGL/constants/Shading.ts"
            ), h = t(
              /*! ./SpriteAlignment */
              "./src/WebGL/constants/SpriteAlignment.ts"
            ), c = t(
              /*! ./TextureConstants */
              "./src/WebGL/constants/TextureConstants.ts"
            ), d = t(
              /*! ./TextureOperations */
              "./src/WebGL/constants/TextureOperations.ts"
            );
          }
        ),
        /***/
        "./src/WebGL/core/EventDispatcher.ts": (
          /*!*******************************************!*\
            !*** ./src/WebGL/core/EventDispatcher.ts ***!
            \*******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              EventDispatcher: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            class r {
              constructor() {
                this.listeners = {};
              }
              dispatchEvent(l) {
                var h = this.listeners[l.type];
                if (h !== void 0) {
                  l.target = this;
                  for (var c = 0, d = h.length; c < d; c++)
                    h[c].call(this, l);
                }
              }
              removeEventListener(l, h) {
                if (!h)
                  this.listeners[l] = [];
                else {
                  var c = this.listeners[l].indexOf(h);
                  c !== -1 && this.listeners[l].splice(c, 1);
                }
              }
              addEventListener(l, h) {
                this.listeners[l] === void 0 && (this.listeners[l] = []), this.listeners[l].indexOf(h) === -1 && this.listeners[l].push(h);
              }
            }
          }
        ),
        /***/
        "./src/WebGL/core/Geometry.ts": (
          /*!************************************!*\
            !*** ./src/WebGL/core/Geometry.ts ***!
            \************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Geometry: () => (
                /* binding */
                _
              ),
              /* harmony export */
              GeometryGroup: () => (
                /* binding */
                d
              ),
              /* harmony export */
              GeometryIDCount: () => (
                /* binding */
                m
              )
              /* harmony export */
            });
            var r = t(
              /*! ../materials/LineBasicMaterial */
              "./src/WebGL/materials/LineBasicMaterial.ts"
            ), a = t(
              /*! ./EventDispatcher */
              "./src/WebGL/core/EventDispatcher.ts"
            ), l = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), h = t(
              /*! ../../colors */
              "./src/colors.ts"
            );
            const c = 65535;
            class d {
              constructor(x = 0) {
                this.vertexArray = null, this.colorArray = null, this.normalArray = null, this.radiusArray = null, this.faceArray = null, this.lineArray = null, this.atomArray = Array(), this.vertices = 0, this.faceidx = 0, this.lineidx = 0, this.__inittedArrays = !1, this.id = x;
              }
              setColor(x) {
                var b = this.vertexArray, A = this.colorArray;
                if (!b)
                  throw new Error("vertex array not initialized");
                if (!A)
                  throw new Error("color array not initialized");
                let f = h.CC.color(x);
                for (var s = 0; s < b.length; s += 3)
                  A[s] = f.r, A[s + 1] = f.g, A[s + 2] = f.b;
              }
              setColors(x) {
                var b = this.vertexArray, A = this.colorArray;
                if (!b)
                  throw new Error("vertex array not initialized");
                if (!A)
                  throw new Error("color array not initialized");
                if (b.length != A.length) {
                  console.log("Cannot re-color geometry group due to mismatched lengths.");
                  return;
                }
                for (var f = 0; f < b.length; f += 3) {
                  var s = x(b[f], b[f + 1], b[f + 2]);
                  s instanceof h.Color || (s = h.CC.color(s)), A[f] = s.r, A[f + 1] = s.g, A[f + 2] = s.b;
                }
              }
              getNumVertices() {
                return this.vertices;
              }
              getVertices() {
                return this.vertexArray;
              }
              getCentroid() {
                if (!this.vertexArray)
                  throw new Error("vertex array not initialized");
                for (var x = new l.Vector3(), b, A, f, s, u = 0; u < this.vertices; ++u)
                  b = u * 3, A = this.vertexArray[b], f = this.vertexArray[b + 1], s = this.vertexArray[b + 2], x.x += A, x.y += f, x.z += s;
                return x.divideScalar(this.vertices), x;
              }
              //setup normals - vertex and face array must exist
              setNormals() {
                var x = this.faceArray, b = this.vertexArray, A = this.normalArray;
                if (!(!this.vertices || !this.faceidx)) {
                  if (!x)
                    throw new Error("face array not initialized");
                  if (!b)
                    throw new Error("vertex array not initialized");
                  if (!A)
                    throw new Error("normal array not initialized");
                  for (var f, s, u, p, g, w, o, v = 0; v < x.length / 3; ++v)
                    f = x[v * 3] * 3, s = x[v * 3 + 1] * 3, u = x[v * 3 + 2] * 3, p = new l.Vector3(b[f], b[f + 1], b[f + 2]), g = new l.Vector3(b[s], b[s + 1], b[s + 2]), w = new l.Vector3(b[u], b[u + 1], b[u + 2]), p.subVectors(p, g), w.subVectors(w, g), w.cross(p), o = w, o.normalize(), A[f] += o.x, A[s] += o.x, A[u] += o.x, A[f + 1] += o.y, A[s + 1] += o.y, A[u + 1] += o.y, A[f + 2] += o.z, A[s + 2] += o.z, A[u + 2] += o.z;
                }
              }
              /* sets line index array from face arr
              Note - assumes all faces are triangles (i.e. there will
              be an extra diagonal for four-sided faces - user should
              specify linearr for custom shape generation to show wireframe squares
              as rectangles rather than two triangles) */
              setLineIndices() {
                if (this.faceidx && !(this.lineArray && this.lineArray.length == this.faceidx * 2 && this.lineidx == this.faceidx * 2)) {
                  var x = this.faceArray, b = this.lineArray = new Uint16Array(this.faceidx * 2);
                  if (this.lineidx = this.faceidx * 2, !x)
                    throw new Error("face array not initialized");
                  for (var A = 0; A < this.faceidx / 3; ++A) {
                    var f = A * 3, s = f * 2, u = x[f], p = x[f + 1], g = x[f + 2];
                    b[s] = u, b[s + 1] = p, b[s + 2] = u, b[s + 3] = g, b[s + 4] = p, b[s + 5] = g;
                  }
                }
              }
              vrml(x, b) {
                var A, f, s, u, p, g, w, o, v, M, E, $, k, L, z, O, R, N, W = "";
                if (W += x + `Shape {
` + x + ` appearance Appearance {
` + x + `  material Material {
` + x + "   diffuseColor " + ((A = b == null ? void 0 : b.color) === null || A === void 0 ? void 0 : A.r) + " " + ((f = b == null ? void 0 : b.color) === null || f === void 0 ? void 0 : f.g) + " " + ((s = b == null ? void 0 : b.color) === null || s === void 0 ? void 0 : s.b) + `
`, b.wireframe && this.colorArray) {
                  let P = this.colorArray;
                  W += x + "    emissiveColor " + P[0] + " " + P[1] + " " + P[2] + `
`;
                }
                b != null && b.transparent && (W += x + "   transparency " + (1 - b.opacity) + `
`), W += x + `  }
`, W += x + ` }
`;
                var B = x;
                if (x += " ", b instanceof r.LineBasicMaterial || b.wireframe) {
                  W += x + `geometry IndexedLineSet {
` + x + ` colorPerVertex TRUE
` + x + ` coord Coordinate {
` + x + `  point [
`;
                  let P, G, H;
                  for (let U = 0; U < this.vertices; ++U) {
                    let j = U * 3;
                    P = (u = this.vertexArray) === null || u === void 0 ? void 0 : u[j], G = (p = this.vertexArray) === null || p === void 0 ? void 0 : p[j + 1], H = (g = this.vertexArray) === null || g === void 0 ? void 0 : g[j + 2], W += x + "   " + P + " " + G + " " + H + `,
`;
                  }
                  if (W += x + `  ]
`, W += x + ` }
`, this.colorArray && !b.wireframe) {
                    W += x + ` color Color {
` + x + `  color [
`;
                    for (let U = 0; U < this.vertices; ++U) {
                      let j = U * 3;
                      P = this.colorArray[j], G = this.colorArray[j + 1], H = this.colorArray[j + 2], W += x + "   " + P + " " + G + " " + H + `,
`;
                    }
                    W += x + `  ]
`, W += x + ` }
`;
                  }
                  if (W += x + ` coordIndex [
`, b.wireframe && this.faceArray)
                    for (let U = 0; U < this.faceidx; U += 3)
                      P = (w = this.faceArray) === null || w === void 0 ? void 0 : w[U], G = (o = this.faceArray) === null || o === void 0 ? void 0 : o[U + 1], H = (v = this.faceArray) === null || v === void 0 ? void 0 : v[U + 2], W += x + "  " + P + ", " + G + ", " + H + `, -1,
`;
                  else
                    for (let U = 0; U < this.vertices - 1; U += 2)
                      W += x + "  " + U + ", " + (U + 1) + `, -1,
`;
                  W += x + ` ]
`, W += x + `}
`;
                } else {
                  W += x + `geometry IndexedFaceSet {
` + x + ` colorPerVertex TRUE
` + x + ` normalPerVertex TRUE
` + x + ` solid FALSE
`, W += x + ` coord Coordinate {
` + x + `  point [
`;
                  let P, G, H;
                  for (let U = 0; U < this.vertices; ++U) {
                    let j = U * 3;
                    P = (M = this.vertexArray) === null || M === void 0 ? void 0 : M[j], G = (E = this.vertexArray) === null || E === void 0 ? void 0 : E[j + 1], H = ($ = this.vertexArray) === null || $ === void 0 ? void 0 : $[j + 2], W += x + "   " + P + " " + G + " " + H + `,
`;
                  }
                  W += x + `  ]
`, W += x + ` }
`, W += x + ` normal Normal {
` + x + `  vector [
`;
                  for (let U = 0; U < this.vertices; ++U) {
                    let j = U * 3;
                    P = (k = this.normalArray) === null || k === void 0 ? void 0 : k[j], G = (L = this.normalArray) === null || L === void 0 ? void 0 : L[j + 1], H = (z = this.normalArray) === null || z === void 0 ? void 0 : z[j + 2], W += x + "   " + P + " " + G + " " + H + `,
`;
                  }
                  if (W += x + `  ]
`, W += x + ` }
`, this.colorArray) {
                    W += x + ` color Color {
` + x + `  color [
`;
                    for (let U = 0; U < this.vertices; ++U) {
                      let j = U * 3;
                      P = this.colorArray[j], G = this.colorArray[j + 1], H = this.colorArray[j + 2], W += x + "   " + P + " " + G + " " + H + `,
`;
                    }
                    W += x + `  ]
`, W += x + ` }
`;
                  }
                  W += x + ` coordIndex [
`;
                  for (let U = 0; U < this.faceidx; U += 3)
                    P = (O = this.faceArray) === null || O === void 0 ? void 0 : O[U], G = (R = this.faceArray) === null || R === void 0 ? void 0 : R[U + 1], H = (N = this.faceArray) === null || N === void 0 ? void 0 : N[U + 2], W += x + "  " + P + ", " + G + ", " + H + `, -1,
`;
                  W += x + ` ]
`, W += x + `}
`;
                }
                return W += B + "}", W;
              }
              truncateArrayBuffers(x = !0, b = !1) {
                var A = this.vertexArray, f = this.colorArray, s = this.normalArray, u = this.faceArray, p = this.lineArray, g = this.radiusArray;
                this.vertexArray = (A == null ? void 0 : A.subarray(0, this.vertices * 3)) || null, this.colorArray = (f == null ? void 0 : f.subarray(0, this.vertices * 3)) || null, x ? (this.normalArray = (s == null ? void 0 : s.subarray(0, this.vertices * 3)) || null, this.faceArray = (u == null ? void 0 : u.subarray(0, this.faceidx)) || null, this.lineidx > 0 ? this.lineArray = (p == null ? void 0 : p.subarray(0, this.lineidx)) || null : this.lineArray = new Uint16Array(0)) : (this.normalArray = new Float32Array(0), this.faceArray = new Uint16Array(0), this.lineArray = new Uint16Array(0)), g && (this.radiusArray = g.subarray(0, this.vertices)), b && (this.normalArray && (this.normalArray = new Float32Array(this.normalArray)), this.faceArray && (this.faceArray = new Uint16Array(this.faceArray)), this.lineArray && (this.lineArray = new Uint16Array(this.lineArray)), this.vertexArray && (this.vertexArray = new Float32Array(this.vertexArray)), this.colorArray && (this.colorArray = new Float32Array(this.colorArray)), this.radiusArray && (this.radiusArray = new Float32Array(this.radiusArray))), this.__inittedArrays = !0;
              }
            }
            class _ extends a.EventDispatcher {
              constructor(x = !1, b = !1, A = !1) {
                super(), this.name = "", this.hasTangents = !1, this.dynamic = !0, this.verticesNeedUpdate = !1, this.elementsNeedUpdate = !1, this.normalsNeedUpdate = !1, this.colorsNeedUpdate = !1, this.buffersNeedUpdate = !1, this.imposter = !1, this.instanced = !1, this.geometryGroups = [], this.groups = 0, this.id = m++, this.mesh = x, this.radii = b, this.offset = A;
              }
              //Get geometry group to accomodate addVertices new vertices - create
              // new group if necessary
              updateGeoGroup(x = 0) {
                var b, A = this.groups > 0 ? this.geometryGroups[this.groups - 1] : null;
                return (!A || A.vertices + x > (((b = A == null ? void 0 : A.vertexArray) === null || b === void 0 ? void 0 : b.length) || 0) / 3) && (A = this.addGeoGroup()), A;
              }
              //return comma separated list of IndexedFace (or Line) sets from geometry groups
              vrml(x, b) {
                for (var A = "", f = this.geometryGroups.length, s = 0; s < f; s++) {
                  var u = this.geometryGroups[s];
                  A += u.vrml(x, b) + `,
`;
                }
                return A;
              }
              addGeoGroup() {
                var x = new d(this.geometryGroups.length);
                return this.geometryGroups.push(x), this.groups = this.geometryGroups.length, x.vertexArray = new Float32Array(c * 3), x.colorArray = new Float32Array(c * 3), this.mesh && (x.normalArray = new Float32Array(c * 3), x.faceArray = new Uint16Array(c * 6), x.lineArray = new Uint16Array(c * 6)), this.radii && (x.radiusArray = new Float32Array(c)), x.useOffset = this.offset, x;
              }
              setUpNormals(...x) {
                for (var b = 0; b < this.groups; b++) {
                  var A = this.geometryGroups[b];
                  A.setNormals(...x);
                }
              }
              setColors(...x) {
                for (var b = this.geometryGroups.length, A = 0; A < b; A++) {
                  var f = this.geometryGroups[A];
                  f.setColors(...x);
                }
              }
              setColor(...x) {
                for (var b = this.geometryGroups.length, A = 0; A < b; A++) {
                  var f = this.geometryGroups[A];
                  f.setColor(...x);
                }
              }
              setUpWireframe(...x) {
                for (var b = 0; b < this.groups; b++) {
                  var A = this.geometryGroups[b];
                  A.setLineIndices(...x);
                }
              }
              //After vertices, colors, etc are collected in regular or typed arrays,
              //  create typed arrays from regular arrays if they don't already exist,
              initTypedArrays() {
                for (var x = 0; x < this.groups; x++) {
                  var b = this.geometryGroups[x];
                  b.__inittedArrays !== !0 && b.truncateArrayBuffers(this.mesh, !1);
                }
              }
              dispose() {
                this.dispatchEvent({ type: "dispose" });
              }
              get vertices() {
                for (var x = 0, b = 0; b < this.groups; b++)
                  x += this.geometryGroups[b].vertices;
                return x;
              }
            }
            let m = 0;
          }
        ),
        /***/
        "./src/WebGL/core/Object3D.ts": (
          /*!************************************!*\
            !*** ./src/WebGL/core/Object3D.ts ***!
            \************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Light: () => (
                /* binding */
                d
              ),
              /* harmony export */
              Object3D: () => (
                /* binding */
                h
              ),
              /* harmony export */
              Object3DIDCount: () => (
                /* binding */
                l
              ),
              /* harmony export */
              Scene: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), a = t(
              /*! ../../colors */
              "./src/colors.ts"
            );
            let l = 0;
            class h {
              constructor() {
                this.id = l++, this.name = "", this.children = [], this.position = new r.Vector3(), this.rotation = new r.Vector3(), this.matrix = new r.Matrix4(), this.matrixWorld = new r.Matrix4(), this.quaternion = new r.Quaternion(), this.eulerOrder = "XYZ", this.up = new r.Vector3(0, 1, 0), this.scale = new r.Vector3(1, 1, 1), this.matrixAutoUpdate = !0, this.matrixWorldNeedsUpdate = !0, this.rotationAutoUpdate = !0, this.useQuaternion = !1, this.visible = !0;
              }
              lookAt(m) {
                this.matrix.lookAt(m, this.position, this.up), this.rotationAutoUpdate && (this.useQuaternion === !0 ? console.error("Unimplemented math operation.") : this.rotation instanceof r.Vector3 && this.rotation.setEulerFromRotationMatrix(this.matrix, this.eulerOrder));
              }
              //add child object
              add(m) {
                if (m === this) {
                  console.error("Can't add $3Dmol.Object3D to itself");
                  return;
                }
                m.parent = this, this.children.push(m);
                for (var y = this; y.parent !== void 0; )
                  y = y.parent;
                y !== void 0 && y instanceof c && y.__addObject(m);
              }
              remove(m) {
                var y = this.children.indexOf(m);
                if (y !== -1) {
                  m.parent = void 0, this.children.splice(y, 1);
                  for (var x = this; x.parent !== void 0; )
                    x = x.parent;
                  x !== void 0 && x instanceof c && x.__removeObject(m);
                }
              }
              //convert to vrml
              vrml(m) {
                m || (m = " ");
                var y = 2 * Math.atan2(this.quaternion.lengthxyz(), this.quaternion.w), x = 0, b = 0, A = 0;
                if (y != 0) {
                  let u = Math.sin(y / 2);
                  x = this.quaternion.x / u, b = this.quaternion.y / u, A = this.quaternion.z / u;
                }
                var f = m + `Transform {
` + m + " center " + this.position.x + " " + this.position.y + " " + this.position.z + `
` + m + " rotation " + x + " " + b + " " + A + " " + y + `
` + m + ` children [
`;
                this.geometry && (f += this.geometry.vrml(m, this.material));
                for (var s = 0; s < this.children.length; s++)
                  f += this.children[s].vrml(m + " ") + `,
`;
                return f += ` ]
`, f += "}", f;
              }
              updateMatrix() {
                this.matrix.setPosition(this.position), this.useQuaternion === !1 && this.rotation instanceof r.Vector3 ? this.matrix.setRotationFromEuler(this.rotation, this.eulerOrder) : this.matrix.setRotationFromQuaternion(this.quaternion), (this.scale.x !== 1 || this.scale.y !== 1 || this.scale.z !== 1) && this.matrix.scale(this.scale), this.matrixWorldNeedsUpdate = !0;
              }
              updateMatrixWorld(m) {
                this.matrixAutoUpdate === !0 && this.updateMatrix(), (this.matrixWorldNeedsUpdate === !0 || m === !0) && (this.parent === void 0 ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix)), this.matrixWorldNeedsUpdate = !1;
                for (var y = 0; y < this.children.length; y++)
                  this.children[y].updateMatrixWorld(!0);
              }
              clone(m) {
                m === void 0 && (m = new h()), m.name = this.name, m.up.copy(this.up), m.position.copy(this.position), m.rotation instanceof r.Vector3 && this.rotation instanceof r.Vector3 ? m.rotation.copy(this.rotation) : m.rotation = this.rotation, m.eulerOrder = this.eulerOrder, m.scale.copy(this.scale), m.rotationAutoUpdate = this.rotationAutoUpdate, m.matrix.copy(this.matrix), m.matrixWorld.copy(this.matrixWorld), m.quaternion.copy(this.quaternion), m.matrixAutoUpdate = this.matrixAutoUpdate, m.matrixWorldNeedsUpdate = this.matrixWorldNeedsUpdate, m.useQuaternion = this.useQuaternion, m.visible = this.visible;
                for (var y = 0; y < this.children.length; y++) {
                  var x = this.children[y];
                  m.add(x.clone());
                }
                return m;
              }
              setVisible(m) {
                this.visible = m;
                for (var y = 0; y < this.children.length; y++) {
                  var x = this.children[y];
                  x.setVisible(m);
                }
              }
            }
            class c extends h {
              constructor() {
                super(...arguments), this.fog = null, this.overrideMaterial = null, this.matrixAutoUpdate = !1, this.__objects = [], this.__lights = [], this.__objectsAdded = [], this.__objectsRemoved = [];
              }
              __addObject(m) {
                if (m instanceof d)
                  this.__lights.indexOf(m) === -1 && this.__lights.push(m), m.target && m.target.parent === void 0 && this.add(m.target);
                else if (this.__objects.indexOf(m) === -1) {
                  this.__objects.push(m), this.__objectsAdded.push(m);
                  var y = this.__objectsRemoved.indexOf(m);
                  y !== -1 && this.__objectsRemoved.splice(y, 1);
                }
                for (var x = 0; x < m.children.length; x++)
                  this.__addObject(m.children[x]);
              }
              __removeObject(m) {
                var y;
                if (m instanceof d)
                  y = this.__lights.indexOf(m), y !== -1 && this.__lights.splice(y, 1);
                else if (y = this.__objects.indexOf(m), y !== -1) {
                  this.__objects.splice(y, 1), this.__objectsRemoved.push(m);
                  var x = this.__objectsAdded.indexOf(m);
                  x !== -1 && this.__objectsAdded.splice(y, 1);
                }
                for (var b = 0; b < m.children.length; b++)
                  this.__removeObject(m.children[b]);
              }
            }
            class d extends h {
              constructor(m, y = 1) {
                super(), this.position = new r.Vector3(0, 1, 0), this.target = new h(), this.castShadow = !1, this.onlyShadow = !1, this.color = new a.Color(m), this.intensity = y;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/core/Projector.ts": (
          /*!*************************************!*\
            !*** ./src/WebGL/core/Projector.ts ***!
            \*************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Projector: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            );
            const a = new r.Matrix4();
            class l {
              static unprojectVector(c, d) {
                return d.projectionMatrixInverse.getInverse(d.projectionMatrix), a.multiplyMatrices(d.matrixWorld, d.projectionMatrixInverse), c.applyProjection(a);
              }
              static projectVector(c, d) {
                return d.matrixWorldInverse.getInverse(d.matrixWorld), a.multiplyMatrices(d.projectionMatrix, d.matrixWorldInverse), c.applyProjection(a);
              }
              projectVector(c, d) {
                return l.projectVector(c, d);
              }
              unprojectVector(c, d) {
                return l.unprojectVector(c, d);
              }
            }
          }
        ),
        /***/
        "./src/WebGL/core/Raycaster.ts": (
          /*!*************************************!*\
            !*** ./src/WebGL/core/Raycaster.ts ***!
            \*************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Raycaster: () => (
                /* binding */
                c
              ),
              /* harmony export */
              intersectObject: () => (
                /* binding */
                u
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), a = t(
              /*! ../shapes */
              "./src/WebGL/shapes/index.ts"
            );
            const l = (p, g) => p.distance - g.distance, h = new r.Matrix4();
            class c {
              constructor(g, w, o, v) {
                this.precision = 1e-4, this.linePrecision = 0.2, this.ray = new r.Ray(g, w), this.ray.direction.lengthSq() > 0 && this.ray.direction.normalize(), this.near = v || 0, this.far = o || 1 / 0;
              }
              set(g, w) {
                this.ray.set(g, w);
              }
              setFromCamera(g, w) {
                w.ortho ? (this.ray.origin.set(g.x, g.y, (w.near + w.far) / (w.near - w.far)).unproject(w), this.ray.direction.set(0, 0, -1).transformDirection(w.matrixWorld)) : (this.ray.origin.setFromMatrixPosition(w.matrixWorld), this.ray.direction.set(g.x, g.y, g.z), w.projectionMatrixInverse.getInverse(w.projectionMatrix), h.multiplyMatrices(w.matrixWorld, w.projectionMatrixInverse), this.ray.direction.applyProjection(h), this.ray.direction.sub(this.ray.origin).normalize());
              }
              intersectObjects(g, w) {
                for (var o = [], v = 0, M = w.length; v < M; v++)
                  u(g, w[v], this, o);
                return o.sort(l), o;
              }
            }
            const d = (p) => Math.min(Math.max(p, -1), 1);
            var _ = new a.Sphere(), m = new a.Cylinder(), y = new a.Triangle(), x = new r.Vector3(), b = new r.Vector3(), A = new r.Vector3(), f = new r.Vector3(), s = new r.Vector3();
            function u(p, g, w, o) {
              if (s.getPositionFromMatrix(p.matrixWorld), g.intersectionShape === void 0)
                return o;
              var v = g.intersectionShape, M = w.linePrecision;
              M *= p.matrixWorld.getMaxScaleOnAxis();
              var E = M * M;
              if (g.boundingSphere !== void 0 && g.boundingSphere instanceof a.Sphere && (_.copy(g.boundingSphere), _.applyMatrix4(p.matrixWorld), !w.ray.isIntersectionSphere(_)))
                return o;
              var $, k, L, z, O, R, N, W, B, P, G, H, U, j;
              for ($ = 0, k = v.triangle.length; $ < k; $++)
                if (v.triangle[$] instanceof a.Triangle) {
                  if (y.copy(v.triangle[$]), y.applyMatrix4(p.matrixWorld), L = y.getNormal(), z = w.ray.direction.dot(L), z >= 0 || (x.subVectors(y.a, w.ray.origin), N = L.dot(x) / z, N < 0))
                    continue;
                  b.copy(w.ray.direction).multiplyScalar(N).add(w.ray.origin), b.sub(y.a), A.copy(y.b).sub(y.a), f.copy(y.c).sub(y.a);
                  var re = A.dot(f), ie = A.lengthSq(), te = f.lengthSq();
                  if (H = (ie * b.dot(f) - re * b.dot(A)) / (ie * te - re * re), H < 0 || H > 1 || (G = (b.dot(A) - H * re) / ie, G < 0 || G > 1 || G + H > 1))
                    continue;
                  o.push({ clickable: g, distance: N });
                }
              for ($ = 0, k = v.cylinder.length; $ < k; $++)
                if (v.cylinder[$] instanceof a.Cylinder) {
                  if (m.copy(v.cylinder[$]), m.applyMatrix4(p.matrixWorld), x.subVectors(m.c1, w.ray.origin), O = x.dot(m.direction), R = x.dot(w.ray.direction), z = d(w.ray.direction.dot(m.direction)), B = 1 - z * z, B === 0)
                    continue;
                  U = (z * R - O) / B, j = (R - z * O) / B, b.copy(m.direction).multiplyScalar(U).add(m.c1), A.copy(w.ray.direction).multiplyScalar(j).add(w.ray.origin), W = f.subVectors(b, A).lengthSq();
                  var ue = m.radius * m.radius;
                  if (W <= ue) {
                    if (P = (z * O - R) * (z * O - R) - B * (x.lengthSq() - O * O - ue), P <= 0 ? H = N = Math.sqrt(W) : H = N = (R - z * O - Math.sqrt(P)) / B, G = z * H - O, G < 0 || G * G > m.lengthSq() || H < 0)
                      continue;
                    o.push({ clickable: g, distance: N });
                  }
                }
              for ($ = 0, k = v.line.length; $ < k; $ += 2) {
                b.copy(v.line[$]), b.applyMatrix4(p.matrixWorld), A.copy(v.line[$ + 1]), A.applyMatrix4(p.matrixWorld), f.subVectors(A, b);
                var de = f.lengthSq();
                f.normalize(), x.subVectors(b, w.ray.origin);
                var oe = x.dot(f);
                R = x.dot(w.ray.direction), z = d(w.ray.direction.dot(f)), B = 1 - z * z, B !== 0 && (U = (z * R - oe) / B, j = (R - z * oe) / B, b.add(f.multiplyScalar(U)), A.copy(w.ray.direction).multiplyScalar(j).add(w.ray.origin), W = f.subVectors(A, b).lengthSq(), W < E && U * U < de && o.push({ clickable: g, distance: j }));
              }
              for ($ = 0, k = v.sphere.length; $ < k; $++)
                if (v.sphere[$] instanceof a.Sphere && (_.copy(v.sphere[$]), _.applyMatrix4(p.matrixWorld), w.ray.isIntersectionSphere(_))) {
                  b.subVectors(_.center, w.ray.origin);
                  var J = b.dot(w.ray.direction);
                  if (P = J * J - (b.lengthSq() - _.radius * _.radius), J < 0)
                    return o;
                  P <= 0 ? N = J : N = J - Math.sqrt(P), o.push({ clickable: g, distance: N });
                }
              return o;
            }
          }
        ),
        /***/
        "./src/WebGL/core/Texture.ts": (
          /*!***********************************!*\
            !*** ./src/WebGL/core/Texture.ts ***!
            \***********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Texture: () => (
                /* binding */
                c
              ),
              /* harmony export */
              TextureIdCount: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ../constants/TextureConstants */
              "./src/WebGL/constants/TextureConstants.ts"
            ), a = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), l = t(
              /*! ./EventDispatcher */
              "./src/WebGL/core/EventDispatcher.ts"
            ), h = t(
              /*! ./UVMapping */
              "./src/WebGL/core/UVMapping.ts"
            );
            class c extends l.EventDispatcher {
              constructor(m, y) {
                super(), this.id = d++, this.name = "", this.image = m, this.mapping = new h.UVMapping(), this.wrapS = r.ClampToEdgeWrapping, this.wrapT = r.ClampToEdgeWrapping, this.anisotropy = 1, y ? (this.format = r.RFormat, this.type = r.FloatType, this.premultiplyAlpha = !1, this.flipY = !1, this.unpackAlignment = 1, this.magFilter = r.NearestFilter, this.minFilter = r.NearestFilter) : (this.format = r.RGBAFormat, this.type = r.UnsignedByteType, this.offset = new a.Vector2(0, 0), this.repeat = new a.Vector2(1, 1), this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.magFilter = r.LinearFilter, this.minFilter = r.LinearMipMapLinearFilter), this.needsUpdate = !1, this.onUpdate = null;
              }
              clone(m = new c()) {
                return m.image = this.image, m.mapping = this.mapping, m.wrapS = this.wrapS, m.wrapT = this.wrapT, m.magFilter = this.magFilter, m.minFilter = this.minFilter, m.anisotropy = this.anisotropy, m.format = this.format, m.type = this.type, m.offset.copy(this.offset), m.repeat.copy(this.repeat), m.premultiplyAlpha = this.premultiplyAlpha, m.flipY = this.flipY, m.unpackAlignment = this.unpackAlignment, m;
              }
              dispose() {
                this.dispatchEvent({ type: "dispose" });
              }
            }
            let d = 0;
          }
        ),
        /***/
        "./src/WebGL/core/UVMapping.ts": (
          /*!*************************************!*\
            !*** ./src/WebGL/core/UVMapping.ts ***!
            \*************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              UVMapping: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            class r {
            }
          }
        ),
        /***/
        "./src/WebGL/core/index.ts": (
          /*!*********************************!*\
            !*** ./src/WebGL/core/index.ts ***!
            \*********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              EventDispatcher: () => (
                /* reexport safe */
                r.EventDispatcher
              ),
              /* harmony export */
              Geometry: () => (
                /* reexport safe */
                a.Geometry
              ),
              /* harmony export */
              GeometryGroup: () => (
                /* reexport safe */
                a.GeometryGroup
              ),
              /* harmony export */
              GeometryIDCount: () => (
                /* reexport safe */
                a.GeometryIDCount
              ),
              /* harmony export */
              Light: () => (
                /* reexport safe */
                l.Light
              ),
              /* harmony export */
              Object3D: () => (
                /* reexport safe */
                l.Object3D
              ),
              /* harmony export */
              Object3DIDCount: () => (
                /* reexport safe */
                l.Object3DIDCount
              ),
              /* harmony export */
              Projector: () => (
                /* reexport safe */
                h.Projector
              ),
              /* harmony export */
              Raycaster: () => (
                /* reexport safe */
                c.Raycaster
              ),
              /* harmony export */
              Scene: () => (
                /* reexport safe */
                l.Scene
              ),
              /* harmony export */
              Texture: () => (
                /* reexport safe */
                d.Texture
              ),
              /* harmony export */
              TextureIdCount: () => (
                /* reexport safe */
                d.TextureIdCount
              ),
              /* harmony export */
              UVMapping: () => (
                /* reexport safe */
                _.UVMapping
              ),
              /* harmony export */
              intersectObject: () => (
                /* reexport safe */
                c.intersectObject
              )
              /* harmony export */
            });
            var r = t(
              /*! ./EventDispatcher */
              "./src/WebGL/core/EventDispatcher.ts"
            ), a = t(
              /*! ./Geometry */
              "./src/WebGL/core/Geometry.ts"
            ), l = t(
              /*! ./Object3D */
              "./src/WebGL/core/Object3D.ts"
            ), h = t(
              /*! ./Projector */
              "./src/WebGL/core/Projector.ts"
            ), c = t(
              /*! ./Raycaster */
              "./src/WebGL/core/Raycaster.ts"
            ), d = t(
              /*! ./Texture */
              "./src/WebGL/core/Texture.ts"
            ), _ = t(
              /*! ./UVMapping */
              "./src/WebGL/core/UVMapping.ts"
            );
          }
        ),
        /***/
        "./src/WebGL/index.ts": (
          /*!****************************!*\
            !*** ./src/WebGL/index.ts ***!
            \****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              BackSide: () => (
                /* reexport safe */
                r.BackSide
              ),
              /* harmony export */
              Camera: () => (
                /* reexport safe */
                m.Camera
              ),
              /* harmony export */
              ClampToEdgeWrapping: () => (
                /* reexport safe */
                r.ClampToEdgeWrapping
              ),
              /* harmony export */
              Coloring: () => (
                /* reexport safe */
                r.Coloring
              ),
              /* harmony export */
              Cylinder: () => (
                /* reexport safe */
                _.Cylinder
              ),
              /* harmony export */
              DoubleSide: () => (
                /* reexport safe */
                r.DoubleSide
              ),
              /* harmony export */
              EventDispatcher: () => (
                /* reexport safe */
                a.EventDispatcher
              ),
              /* harmony export */
              FloatType: () => (
                /* reexport safe */
                r.FloatType
              ),
              /* harmony export */
              Fog: () => (
                /* reexport safe */
                y.Fog
              ),
              /* harmony export */
              FrontSide: () => (
                /* reexport safe */
                r.FrontSide
              ),
              /* harmony export */
              Geometry: () => (
                /* reexport safe */
                a.Geometry
              ),
              /* harmony export */
              GeometryGroup: () => (
                /* reexport safe */
                a.GeometryGroup
              ),
              /* harmony export */
              GeometryIDCount: () => (
                /* reexport safe */
                a.GeometryIDCount
              ),
              /* harmony export */
              ImposterMaterial: () => (
                /* reexport safe */
                l.ImposterMaterial
              ),
              /* harmony export */
              InstancedMaterial: () => (
                /* reexport safe */
                l.InstancedMaterial
              ),
              /* harmony export */
              Light: () => (
                /* reexport safe */
                a.Light
              ),
              /* harmony export */
              Line: () => (
                /* reexport safe */
                c.Line
              ),
              /* harmony export */
              LineBasicMaterial: () => (
                /* reexport safe */
                l.LineBasicMaterial
              ),
              /* harmony export */
              LineStyle: () => (
                /* reexport safe */
                c.LineStyle
              ),
              /* harmony export */
              LinearFilter: () => (
                /* reexport safe */
                r.LinearFilter
              ),
              /* harmony export */
              LinearMipMapLinearFilter: () => (
                /* reexport safe */
                r.LinearMipMapLinearFilter
              ),
              /* harmony export */
              Material: () => (
                /* reexport safe */
                l.Material
              ),
              /* harmony export */
              MaterialIdCount: () => (
                /* reexport safe */
                l.MaterialIdCount
              ),
              /* harmony export */
              Matrix3: () => (
                /* reexport safe */
                h.Matrix3
              ),
              /* harmony export */
              Matrix4: () => (
                /* reexport safe */
                h.Matrix4
              ),
              /* harmony export */
              Mesh: () => (
                /* reexport safe */
                c.Mesh
              ),
              /* harmony export */
              MeshDoubleLambertMaterial: () => (
                /* reexport safe */
                l.MeshDoubleLambertMaterial
              ),
              /* harmony export */
              MeshLambertMaterial: () => (
                /* reexport safe */
                l.MeshLambertMaterial
              ),
              /* harmony export */
              MeshOutlineMaterial: () => (
                /* reexport safe */
                l.MeshOutlineMaterial
              ),
              /* harmony export */
              NearestFilter: () => (
                /* reexport safe */
                r.NearestFilter
              ),
              /* harmony export */
              Object3D: () => (
                /* reexport safe */
                a.Object3D
              ),
              /* harmony export */
              Object3DIDCount: () => (
                /* reexport safe */
                a.Object3DIDCount
              ),
              /* harmony export */
              Projector: () => (
                /* reexport safe */
                a.Projector
              ),
              /* harmony export */
              Quaternion: () => (
                /* reexport safe */
                h.Quaternion
              ),
              /* harmony export */
              R32Format: () => (
                /* reexport safe */
                r.R32Format
              ),
              /* harmony export */
              RFormat: () => (
                /* reexport safe */
                r.RFormat
              ),
              /* harmony export */
              RGBAFormat: () => (
                /* reexport safe */
                r.RGBAFormat
              ),
              /* harmony export */
              Ray: () => (
                /* reexport safe */
                h.Ray
              ),
              /* harmony export */
              Raycaster: () => (
                /* reexport safe */
                a.Raycaster
              ),
              /* harmony export */
              Renderer: () => (
                /* reexport safe */
                x.Renderer
              ),
              /* harmony export */
              Scene: () => (
                /* reexport safe */
                a.Scene
              ),
              /* harmony export */
              ShaderLib: () => (
                /* reexport safe */
                d.ShaderLib
              ),
              /* harmony export */
              ShaderUtils: () => (
                /* reexport safe */
                d.ShaderUtils
              ),
              /* harmony export */
              Shading: () => (
                /* reexport safe */
                r.Shading
              ),
              /* harmony export */
              Sphere: () => (
                /* reexport safe */
                _.Sphere
              ),
              /* harmony export */
              SphereImposterMaterial: () => (
                /* reexport safe */
                l.SphereImposterMaterial
              ),
              /* harmony export */
              SphereImposterOutlineMaterial: () => (
                /* reexport safe */
                l.SphereImposterOutlineMaterial
              ),
              /* harmony export */
              Sprite: () => (
                /* reexport safe */
                c.Sprite
              ),
              /* harmony export */
              SpriteAlignment: () => (
                /* reexport safe */
                r.SpriteAlignment
              ),
              /* harmony export */
              SpriteMaterial: () => (
                /* reexport safe */
                l.SpriteMaterial
              ),
              /* harmony export */
              SpritePlugin: () => (
                /* reexport safe */
                b.SpritePlugin
              ),
              /* harmony export */
              StickImposterMaterial: () => (
                /* reexport safe */
                l.StickImposterMaterial
              ),
              /* harmony export */
              StickImposterOutlineMaterial: () => (
                /* reexport safe */
                l.StickImposterOutlineMaterial
              ),
              /* harmony export */
              Texture: () => (
                /* reexport safe */
                a.Texture
              ),
              /* harmony export */
              TextureIdCount: () => (
                /* reexport safe */
                a.TextureIdCount
              ),
              /* harmony export */
              TextureOperations: () => (
                /* reexport safe */
                r.TextureOperations
              ),
              /* harmony export */
              Triangle: () => (
                /* reexport safe */
                _.Triangle
              ),
              /* harmony export */
              UVMapping: () => (
                /* reexport safe */
                a.UVMapping
              ),
              /* harmony export */
              UnsignedByteType: () => (
                /* reexport safe */
                r.UnsignedByteType
              ),
              /* harmony export */
              Vector2: () => (
                /* reexport safe */
                h.Vector2
              ),
              /* harmony export */
              Vector3: () => (
                /* reexport safe */
                h.Vector3
              ),
              /* harmony export */
              VolumetricMaterial: () => (
                /* reexport safe */
                l.VolumetricMaterial
              ),
              /* harmony export */
              basic: () => (
                /* reexport safe */
                d.basic
              ),
              /* harmony export */
              clamp: () => (
                /* reexport safe */
                h.clamp
              ),
              /* harmony export */
              clone: () => (
                /* reexport safe */
                d.clone
              ),
              /* harmony export */
              conversionMatrix3: () => (
                /* reexport safe */
                h.conversionMatrix3
              ),
              /* harmony export */
              degToRad: () => (
                /* reexport safe */
                h.degToRad
              ),
              /* harmony export */
              instanced: () => (
                /* reexport safe */
                d.instanced
              ),
              /* harmony export */
              intersectObject: () => (
                /* reexport safe */
                a.intersectObject
              ),
              /* harmony export */
              lambert: () => (
                /* reexport safe */
                d.lambert
              ),
              /* harmony export */
              lambertdouble: () => (
                /* reexport safe */
                d.lambertdouble
              ),
              /* harmony export */
              outline: () => (
                /* reexport safe */
                d.outline
              ),
              /* harmony export */
              screen: () => (
                /* reexport safe */
                d.screen
              ),
              /* harmony export */
              screenaa: () => (
                /* reexport safe */
                d.screenaa
              ),
              /* harmony export */
              sphereimposter: () => (
                /* reexport safe */
                d.sphereimposter
              ),
              /* harmony export */
              sphereimposteroutline: () => (
                /* reexport safe */
                d.sphereimposteroutline
              ),
              /* harmony export */
              sprite: () => (
                /* reexport safe */
                d.sprite
              ),
              /* harmony export */
              stickimposter: () => (
                /* reexport safe */
                d.stickimposter
              ),
              /* harmony export */
              stickimposteroutline: () => (
                /* reexport safe */
                d.stickimposteroutline
              ),
              /* harmony export */
              volumetric: () => (
                /* reexport safe */
                d.volumetric
              )
              /* harmony export */
            });
            var r = t(
              /*! ./constants */
              "./src/WebGL/constants/index.ts"
            ), a = t(
              /*! ./core */
              "./src/WebGL/core/index.ts"
            ), l = t(
              /*! ./materials */
              "./src/WebGL/materials/index.ts"
            ), h = t(
              /*! ./math */
              "./src/WebGL/math/index.ts"
            ), c = t(
              /*! ./objects */
              "./src/WebGL/objects/index.ts"
            ), d = t(
              /*! ./shaders */
              "./src/WebGL/shaders/index.ts"
            ), _ = t(
              /*! ./shapes */
              "./src/WebGL/shapes/index.ts"
            ), m = t(
              /*! ./Camera */
              "./src/WebGL/Camera.ts"
            ), y = t(
              /*! ./Fog */
              "./src/WebGL/Fog.ts"
            ), x = t(
              /*! ./Renderer */
              "./src/WebGL/Renderer.ts"
            ), b = t(
              /*! ./SpritePlugin */
              "./src/WebGL/SpritePlugin.ts"
            );
          }
        ),
        /***/
        "./src/WebGL/materials/ImposterMaterial.ts": (
          /*!*************************************************!*\
            !*** ./src/WebGL/materials/ImposterMaterial.ts ***!
            \*************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              ImposterMaterial: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ./../constants/Coloring */
              "./src/WebGL/constants/Coloring.ts"
            ), a = t(
              /*! ./../constants/Shading */
              "./src/WebGL/constants/Shading.ts"
            ), l = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), h = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), c = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            );
            class d extends c.Material {
              constructor(m) {
                super(), this.color = new l.Color(16777215), this.ambient = new l.Color(1048575), this.emissive = new l.Color(0), this.imposter = !0, this.wrapAround = !1, this.wrapRGB = new h.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = a.Shading.SmoothShading, this.shaderID = null, this.vertexColors = r.Coloring.NoColors, this.skinning = !1, this.setValues(m);
              }
              clone(m = new d()) {
                return super.clone.call(this, m), m.color.copy(this.color), m.ambient.copy(this.ambient), m.emissive.copy(this.emissive), m.wrapAround = this.wrapAround, m.wrapRGB.copy(this.wrapRGB), m.map = this.map, m.lightMap = this.lightMap, m.specularMap = this.specularMap, m.envMap = this.envMap, m.combine = this.combine, m.reflectivity = this.reflectivity, m.refractionRatio = this.refractionRatio, m.fog = this.fog, m.shading = this.shading, m.shaderID = this.shaderID, m.vertexColors = this.vertexColors, m.skinning = this.skinning, m.morphTargets = this.morphTargets, m.morphNormals = this.morphNormals, m;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/InstancedMaterial.ts": (
          /*!**************************************************!*\
            !*** ./src/WebGL/materials/InstancedMaterial.ts ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              InstancedMaterial: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ../constants/Coloring */
              "./src/WebGL/constants/Coloring.ts"
            ), a = t(
              /*! ../constants/Shading */
              "./src/WebGL/constants/Shading.ts"
            ), l = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), h = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), c = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            );
            class d extends c.Material {
              constructor(m) {
                super(), this.color = new l.Color(16777215), this.ambient = new l.Color(1048575), this.emissive = new l.Color(0), this.wrapAround = !1, this.wrapRGB = new h.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = a.Shading.SmoothShading, this.shaderID = "instanced", this.vertexColors = r.Coloring.NoColors, this.skinning = !1, this.sphere = null, this.setValues(m);
              }
              clone(m = new d()) {
                return super.clone.call(this, m), m.color.copy(this.color), m.ambient.copy(this.ambient), m.emissive.copy(this.emissive), m.wrapAround = this.wrapAround, m.wrapRGB.copy(this.wrapRGB), m.map = this.map, m.lightMap = this.lightMap, m.specularMap = this.specularMap, m.envMap = this.envMap, m.combine = this.combine, m.reflectivity = this.reflectivity, m.refractionRatio = this.refractionRatio, m.fog = this.fog, m.shading = this.shading, m.shaderID = this.shaderID, m.vertexColors = this.vertexColors, m.skinning = this.skinning, m.morphTargets = this.morphTargets, m.morphNormals = this.morphNormals, m.sphere = this.sphere, m;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/LineBasicMaterial.ts": (
          /*!**************************************************!*\
            !*** ./src/WebGL/materials/LineBasicMaterial.ts ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              LineBasicMaterial: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), a = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            );
            class l extends a.Material {
              constructor(c) {
                super(), this.color = new r.Color(16777215), this.linewidth = 1, this.linecap = "round", this.linejoin = "round", this.vertexColors = !1, this.fog = !0, this.shaderID = "basic", this.setValues(c);
              }
              clone(c = new l()) {
                return super.clone.call(this, c), c.color.copy(this.color), c;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/Material.ts": (
          /*!*****************************************!*\
            !*** ./src/WebGL/materials/Material.ts ***!
            \*****************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Material: () => (
                /* binding */
                c
              ),
              /* harmony export */
              MaterialIdCount: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ../constants/Sides */
              "./src/WebGL/constants/Sides.ts"
            ), a = t(
              /*! ../core */
              "./src/WebGL/core/index.ts"
            ), l = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), h = t(
              /*! ../../colors */
              "./src/colors.ts"
            );
            class c extends a.EventDispatcher {
              constructor() {
                super(...arguments), this.id = d++, this.name = "", this.side = r.FrontSide, this.opacity = 1, this.transparent = !1, this.depthTest = !0, this.depthWrite = !0, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.alphaTest = 0, this.visible = !0, this.needsUpdate = !0, this.outline = !1, this.wireframe = !1, this.shaded = !1;
              }
              setValues(m = {}) {
                if (m !== void 0)
                  for (var y in m) {
                    var x = m[y];
                    if (x === void 0) {
                      console.warn("$3Dmol.Material: '" + y + "' parameter is undefined.");
                      continue;
                    }
                    if (y in this) {
                      var b = this[y];
                      b instanceof h.Color && x instanceof h.Color ? b.copy(x) : b instanceof h.Color ? b.set(x) : b instanceof l.Vector3 && x instanceof l.Vector3 ? b.copy(x) : this[y] = x;
                    }
                  }
              }
              //TODO: might want to look into blending equations
              clone(m = new c()) {
                return m.name = this.name, m.side = this.side, m.opacity = this.opacity, m.transparent = this.transparent, m.depthTest = this.depthTest, m.depthWrite = this.depthWrite, m.polygonOffset = this.polygonOffset, m.polygonOffsetFactor = this.polygonOffsetFactor, m.polygonOffsetUnits = this.polygonOffsetUnits, m.alphaTest = this.alphaTest, m.overdraw = this.overdraw, m.visible = this.visible, m;
              }
              makeShaded(m) {
                this.shaded = !0, this.uniforms && (this.uniforms.shading = { type: "i", value: m }, this.uniforms.vWidth = { type: "f", value: 1 }, this.uniforms.vHeight = { type: "f", value: 1 });
              }
              dispose() {
                this.dispatchEvent({ type: "dispose" });
              }
            }
            let d = 0;
          }
        ),
        /***/
        "./src/WebGL/materials/MeshDoubleLambertMaterial.ts": (
          /*!**********************************************************!*\
            !*** ./src/WebGL/materials/MeshDoubleLambertMaterial.ts ***!
            \**********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              MeshDoubleLambertMaterial: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./../constants/Sides */
              "./src/WebGL/constants/Sides.ts"
            ), a = t(
              /*! ./MeshLambertMaterial */
              "./src/WebGL/materials/MeshLambertMaterial.ts"
            );
            class l extends a.MeshLambertMaterial {
              constructor(c) {
                super(c), this.shaderID = "lambertdouble", this.side = r.DoubleSide, this.outline = !1;
              }
              clone(c = new l()) {
                return super.clone.call(this, c), c;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/MeshLambertMaterial.ts": (
          /*!****************************************************!*\
            !*** ./src/WebGL/materials/MeshLambertMaterial.ts ***!
            \****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              MeshLambertMaterial: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ./../constants/Coloring */
              "./src/WebGL/constants/Coloring.ts"
            ), a = t(
              /*! ./../constants/Shading */
              "./src/WebGL/constants/Shading.ts"
            ), l = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            ), h = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), c = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            );
            class d extends l.Material {
              constructor(m) {
                super(), this.color = new h.Color(16777215), this.ambient = new h.Color(1048575), this.emissive = new h.Color(0), this.wrapAround = !1, this.wrapRGB = new c.Vector3(1, 1, 1), this.map = void 0, this.lightMap = null, this.specularMap = null, this.envMap = null, this.reflectivity = 1, this.refractionRatio = 0.98, this.fog = !0, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.shading = a.Shading.SmoothShading, this.shaderID = "lambert", this.vertexColors = r.Coloring.NoColors, this.skinning = !1, this.setValues(m);
              }
              clone(m = new d()) {
                return super.clone.call(this, m), m.color.copy(this.color), m.ambient.copy(this.ambient), m.emissive.copy(this.emissive), m.wrapAround = this.wrapAround, m.wrapRGB.copy(this.wrapRGB), m.map = this.map, m.lightMap = this.lightMap, m.specularMap = this.specularMap, m.envMap = this.envMap, m.combine = this.combine, m.reflectivity = this.reflectivity, m.refractionRatio = this.refractionRatio, m.fog = this.fog, m.shading = this.shading, m.shaderID = this.shaderID, m.vertexColors = this.vertexColors, m.skinning = this.skinning, m.morphTargets = this.morphTargets, m.morphNormals = this.morphNormals, m;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/MeshOutlineMaterial.ts": (
          /*!****************************************************!*\
            !*** ./src/WebGL/materials/MeshOutlineMaterial.ts ***!
            \****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              MeshOutlineMaterial: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), a = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            );
            class l extends a.Material {
              constructor(c) {
                super(), c = c || {}, this.fog = !0, this.shaderID = "outline", this.wireframe = !1, this.outlineColor = r.CC.color(c.color || new r.Color(0, 0, 0)), this.outlineWidth = c.width || 0.1, this.outlinePushback = c.pushback || 1, this.outlineMaxPixels = c.maxpixels || 0;
              }
              clone(c = new l()) {
                return super.clone.call(this, c), c.fog = this.fog, c.shaderID = this.shaderID, c.wireframe = this.wireframe, c.outlineColor = this.outlineColor, c.outlineWidth = this.outlineWidth, c.outlinePushback = this.outlinePushback, c.outlineMaxPixels = this.outlineMaxPixels, c;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/SphereImposterMaterial.ts": (
          /*!*******************************************************!*\
            !*** ./src/WebGL/materials/SphereImposterMaterial.ts ***!
            \*******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              SphereImposterMaterial: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ./ImposterMaterial */
              "./src/WebGL/materials/ImposterMaterial.ts"
            );
            class a extends r.ImposterMaterial {
              constructor(h) {
                super(h), this.shaderID = "sphereimposter", this.setValues(h);
              }
              clone(h = new a()) {
                return super.clone.call(this, h), h;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/SphereImposterOutlineMaterial.ts": (
          /*!**************************************************************!*\
            !*** ./src/WebGL/materials/SphereImposterOutlineMaterial.ts ***!
            \**************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              SphereImposterOutlineMaterial: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), a = t(
              /*! ./ImposterMaterial */
              "./src/WebGL/materials/ImposterMaterial.ts"
            );
            class l extends a.ImposterMaterial {
              constructor(c) {
                super(c), c = c || {}, this.shaderID = "sphereimposteroutline", this.outlineColor = r.CC.color(c.color || new r.Color(0, 0, 0)), this.outlineWidth = c.width || 0.1, this.outlinePushback = c.pushback || 1, this.outlineMaxPixels = c.maxpixels || 0, this.setValues(c);
              }
              clone(c = new l()) {
                return super.clone.call(this, c), c.outlineColor = this.outlineColor, c.outlineWidth = this.outlineWidth, c.outlinePushback = this.outlinePushback, c.outlineMaxPixels = this.outlineMaxPixels, c;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/SpriteMaterial.ts": (
          /*!***********************************************!*\
            !*** ./src/WebGL/materials/SpriteMaterial.ts ***!
            \***********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              SpriteMaterial: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ../constants/SpriteAlignment */
              "./src/WebGL/constants/SpriteAlignment.ts"
            ), a = t(
              /*! ../core/Texture */
              "./src/WebGL/core/Texture.ts"
            ), l = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), h = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            ), c = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            );
            class d extends c.Material {
              constructor(m) {
                super(), this.color = new l.Color(16777215), this.map = new a.Texture(), this.useScreenCoordinates = !0, this.fog = !1, this.uvOffset = new h.Vector2(0, 0), this.uvScale = new h.Vector2(1, 1), this.depthTest = !this.useScreenCoordinates, this.sizeAttenuation = !this.useScreenCoordinates, this.screenOffset = this.screenOffset, this.scaleByViewPort = !this.sizeAttenuation, this.alignment = r.SpriteAlignment.center.clone(), this.setValues(m), m = m || {}, m.depthTest === void 0 && (this.depthTest = !this.useScreenCoordinates), m.sizeAttenuation === void 0 && (this.sizeAttenuation = !this.useScreenCoordinates), m.scaleByViewPort === void 0 && (this.scaleByViewPort = !this.sizeAttenuation);
              }
              clone(m = new d()) {
                return super.clone.call(this, m), m.color.copy(this.color), m.map = this.map, m.useScreenCoordinates = this.useScreenCoordinates, m.screenOffset = this.screenOffset, m.sizeAttenuation = this.sizeAttenuation, m.scaleByViewport = this.scaleByViewPort, m.alignment.copy(this.alignment), m.uvOffset.copy(this.uvOffset), m;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/StickImposterMaterial.ts": (
          /*!******************************************************!*\
            !*** ./src/WebGL/materials/StickImposterMaterial.ts ***!
            \******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              StickImposterMaterial: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ./ImposterMaterial */
              "./src/WebGL/materials/ImposterMaterial.ts"
            );
            class a extends r.ImposterMaterial {
              constructor(h) {
                super(h), this.shaderID = "stickimposter", this.setValues(h);
              }
              clone(h = new a()) {
                return super.clone.call(this, h), h;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/StickImposterOutlineMaterial.ts": (
          /*!*************************************************************!*\
            !*** ./src/WebGL/materials/StickImposterOutlineMaterial.ts ***!
            \*************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              StickImposterOutlineMaterial: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), a = t(
              /*! ./ImposterMaterial */
              "./src/WebGL/materials/ImposterMaterial.ts"
            );
            class l extends a.ImposterMaterial {
              constructor(c = {}) {
                super(c), this.shaderID = "stickimposteroutline", this.outlineColor = new r.Color(0, 0, 0), this.outlineWidth = 0.1, this.outlinePushback = 1, this.outlineMaxPixels = 0, c.color && (this.outlineColor = r.CC.color(c.color)), c.width && (this.outlineWidth = c.width), c.pushback && (this.outlinePushback = c.pushback), c.maxpixels && (this.outlineMaxPixels = c.maxpixels), this.setValues(c);
              }
              clone(c = new l()) {
                return super.clone.call(this, c), c.outlineColor = this.outlineColor, c.outlineWidth = this.outlineWidth, c.outlinePushback = this.outlinePushback, c.outlineMaxPixels = this.outlineMaxPixels, c;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/VolumetricMaterial.ts": (
          /*!***************************************************!*\
            !*** ./src/WebGL/materials/VolumetricMaterial.ts ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              VolumetricMaterial: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ../constants/Sides */
              "./src/WebGL/constants/Sides.ts"
            ), a = t(
              /*! ../../colors */
              "./src/colors.ts"
            ), l = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            );
            class h extends l.Material {
              constructor(d) {
                super(), this.transparent = !1, this.volumetric = !0, this.color = new a.Color(16777215), this.transferfn = null, this.map = void 0, this.extent = [], this.maxdepth = 100, this.unit = 0, this.texmatrix = null, this.transfermin = -1, this.transfermax = 1, this.subsamples = 5, this.shaderID = "volumetric", this.side = r.FrontSide, this.setValues(d);
              }
              clone(d = new h()) {
                return super.clone.call(this, d), d.transparent = this.transparent, d.volumetric = this.volumetric, d.color = this.color, d.transferfn = this.transferfn, d.map = this.map, d.extent = this.extent, d.maxdepth = this.maxdepth, d.unit = this.unit, d.texmatrix = this.texmatrix, d.transfermin = this.transfermin, d.transfermax = this.transfermax, d.subsamples = this.subsamples, d.shaderID = this.shaderID, d.side = this.side, d;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/materials/index.ts": (
          /*!**************************************!*\
            !*** ./src/WebGL/materials/index.ts ***!
            \**************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              ImposterMaterial: () => (
                /* reexport safe */
                r.ImposterMaterial
              ),
              /* harmony export */
              InstancedMaterial: () => (
                /* reexport safe */
                a.InstancedMaterial
              ),
              /* harmony export */
              LineBasicMaterial: () => (
                /* reexport safe */
                l.LineBasicMaterial
              ),
              /* harmony export */
              Material: () => (
                /* reexport safe */
                h.Material
              ),
              /* harmony export */
              MaterialIdCount: () => (
                /* reexport safe */
                h.MaterialIdCount
              ),
              /* harmony export */
              MeshDoubleLambertMaterial: () => (
                /* reexport safe */
                c.MeshDoubleLambertMaterial
              ),
              /* harmony export */
              MeshLambertMaterial: () => (
                /* reexport safe */
                d.MeshLambertMaterial
              ),
              /* harmony export */
              MeshOutlineMaterial: () => (
                /* reexport safe */
                _.MeshOutlineMaterial
              ),
              /* harmony export */
              SphereImposterMaterial: () => (
                /* reexport safe */
                m.SphereImposterMaterial
              ),
              /* harmony export */
              SphereImposterOutlineMaterial: () => (
                /* reexport safe */
                y.SphereImposterOutlineMaterial
              ),
              /* harmony export */
              SpriteMaterial: () => (
                /* reexport safe */
                x.SpriteMaterial
              ),
              /* harmony export */
              StickImposterMaterial: () => (
                /* reexport safe */
                b.StickImposterMaterial
              ),
              /* harmony export */
              StickImposterOutlineMaterial: () => (
                /* reexport safe */
                A.StickImposterOutlineMaterial
              ),
              /* harmony export */
              VolumetricMaterial: () => (
                /* reexport safe */
                f.VolumetricMaterial
              )
              /* harmony export */
            });
            var r = t(
              /*! ./ImposterMaterial */
              "./src/WebGL/materials/ImposterMaterial.ts"
            ), a = t(
              /*! ./InstancedMaterial */
              "./src/WebGL/materials/InstancedMaterial.ts"
            ), l = t(
              /*! ./LineBasicMaterial */
              "./src/WebGL/materials/LineBasicMaterial.ts"
            ), h = t(
              /*! ./Material */
              "./src/WebGL/materials/Material.ts"
            ), c = t(
              /*! ./MeshDoubleLambertMaterial */
              "./src/WebGL/materials/MeshDoubleLambertMaterial.ts"
            ), d = t(
              /*! ./MeshLambertMaterial */
              "./src/WebGL/materials/MeshLambertMaterial.ts"
            ), _ = t(
              /*! ./MeshOutlineMaterial */
              "./src/WebGL/materials/MeshOutlineMaterial.ts"
            ), m = t(
              /*! ./SphereImposterMaterial */
              "./src/WebGL/materials/SphereImposterMaterial.ts"
            ), y = t(
              /*! ./SphereImposterOutlineMaterial */
              "./src/WebGL/materials/SphereImposterOutlineMaterial.ts"
            ), x = t(
              /*! ./SpriteMaterial */
              "./src/WebGL/materials/SpriteMaterial.ts"
            ), b = t(
              /*! ./StickImposterMaterial */
              "./src/WebGL/materials/StickImposterMaterial.ts"
            ), A = t(
              /*! ./StickImposterOutlineMaterial */
              "./src/WebGL/materials/StickImposterOutlineMaterial.ts"
            ), f = t(
              /*! ./VolumetricMaterial */
              "./src/WebGL/materials/VolumetricMaterial.ts"
            );
          }
        ),
        /***/
        "./src/WebGL/math/Quaternion.ts": (
          /*!**************************************!*\
            !*** ./src/WebGL/math/Quaternion.ts ***!
            \**************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Quaternion: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            class r {
              constructor(l, h, c, d) {
                this.x = l || 0, this.y = h || 0, this.z = c || 0, this.w = d !== void 0 ? d : 1;
              }
              set(l, h, c, d) {
                return this.x = l, this.y = h, this.z = c, this.w = d, this;
              }
              copy(l) {
                return this.x = l.x, this.y = l.y, this.z = l.z, this.w = l.w, this;
              }
              conjugate() {
                return this.x *= -1, this.y *= -1, this.z *= -1, this;
              }
              inverse() {
                return this.conjugate().normalize();
              }
              length() {
                return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
              }
              lengthxyz() {
                return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
              }
              normalize() {
                let l = this.length();
                return l === 0 ? (this.x = 0, this.y = 0, this.z = 0, this.w = 1) : (l = 1 / l, this.x *= l, this.y *= l, this.z *= l, this.w *= l), this;
              }
              multiply(l) {
                return this.multiplyQuaternions(this, l);
              }
              multiplyScalar(l) {
                return this.x *= l, this.y *= l, this.z *= l, this.w *= l, this;
              }
              multiplyQuaternions(l, h) {
                const c = l.x, d = l.y, _ = l.z, m = l.w, y = h.x, x = h.y, b = h.z, A = h.w;
                return this.x = c * A + m * y + d * b - _ * x, this.y = d * A + m * x + _ * y - c * b, this.z = _ * A + m * b + c * x - d * y, this.w = m * A - c * y - d * x - _ * b, this;
              }
              sub(l) {
                return this.x -= l.x, this.y -= l.y, this.z -= l.z, this.w -= l.w, this;
              }
              clone() {
                return new r(this.x, this.y, this.z, this.w);
              }
              setFromEuler(l) {
                const h = Math.cos(l.x / 2), c = Math.cos(l.y / 2), d = Math.cos(l.z / 2), _ = Math.sin(l.x / 2), m = Math.sin(l.y / 2), y = Math.sin(l.z / 2);
                return this.x = _ * c * d + h * m * y, this.y = h * m * d - _ * c * y, this.z = h * c * y + _ * m * d, this.w = h * c * d - _ * m * y, this;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/math/Vector2.ts": (
          /*!***********************************!*\
            !*** ./src/WebGL/math/Vector2.ts ***!
            \***********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Vector2: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            class r {
              constructor(l, h) {
                this.x = l || 0, this.y = h || 0;
              }
              set(l, h) {
                return this.x = l, this.y = h, this;
              }
              subVectors(l, h) {
                return this.x = l.x - h.x, this.y = l.y - h.y, this;
              }
              copy(l) {
                return this.x = l.x, this.y = l.y, this;
              }
              clone() {
                return new r(this.x, this.y);
              }
            }
          }
        ),
        /***/
        "./src/WebGL/math/index.ts": (
          /*!*********************************!*\
            !*** ./src/WebGL/math/index.ts ***!
            \*********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Matrix3: () => (
                /* reexport safe */
                d.Matrix3
              ),
              /* harmony export */
              Matrix4: () => (
                /* reexport safe */
                d.Matrix4
              ),
              /* harmony export */
              Quaternion: () => (
                /* reexport safe */
                r.Quaternion
              ),
              /* harmony export */
              Ray: () => (
                /* reexport safe */
                d.Ray
              ),
              /* harmony export */
              Vector2: () => (
                /* reexport safe */
                a.Vector2
              ),
              /* harmony export */
              Vector3: () => (
                /* reexport safe */
                d.Vector3
              ),
              /* harmony export */
              clamp: () => (
                /* reexport safe */
                l.clamp
              ),
              /* harmony export */
              conversionMatrix3: () => (
                /* reexport safe */
                h.conversionMatrix3
              ),
              /* harmony export */
              degToRad: () => (
                /* reexport safe */
                c.degToRad
              )
              /* harmony export */
            });
            var r = t(
              /*! ./Quaternion */
              "./src/WebGL/math/Quaternion.ts"
            ), a = t(
              /*! ./Vector2 */
              "./src/WebGL/math/Vector2.ts"
            ), l = t(
              /*! ./utils/clamp */
              "./src/WebGL/math/utils/clamp.ts"
            ), h = t(
              /*! ./utils/conversionMatrix3 */
              "./src/WebGL/math/utils/conversionMatrix3.ts"
            ), c = t(
              /*! ./utils/degToRad */
              "./src/WebGL/math/utils/degToRad.ts"
            ), d = t(
              /*! ./math */
              "./src/WebGL/math/math.ts"
            );
          }
        ),
        /***/
        "./src/WebGL/math/math.ts": (
          /*!********************************!*\
            !*** ./src/WebGL/math/math.ts ***!
            \********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Matrix3: () => (
                /* binding */
                x
              ),
              /* harmony export */
              Matrix4: () => (
                /* binding */
                m
              ),
              /* harmony export */
              Ray: () => (
                /* binding */
                b
              ),
              /* harmony export */
              Vector3: () => (
                /* binding */
                y
              )
              /* harmony export */
            });
            var r = t(
              /*! ./utils/degToRad */
              "./src/WebGL/math/utils/degToRad.ts"
            ), a = t(
              /*! ./utils/clamp */
              "./src/WebGL/math/utils/clamp.ts"
            ), l, h, c, d, _;
            class m {
              constructor(f = 1, s = 0, u = 0, p = 0, g = 0, w = 1, o = 0, v = 0, M = 0, E = 0, $ = 1, k = 0, L = 0, z = 0, O = 0, R = 1) {
                typeof f < "u" && typeof f != "number" ? this.elements = new Float32Array(f) : (this.elements = new Float32Array(16), this.elements[0] = f, this.elements[4] = s, this.elements[8] = u, this.elements[12] = p, this.elements[1] = g, this.elements[5] = w, this.elements[9] = o, this.elements[13] = v, this.elements[2] = M, this.elements[6] = E, this.elements[10] = $, this.elements[14] = k, this.elements[3] = L, this.elements[7] = z, this.elements[11] = O, this.elements[15] = R);
              }
              // eslint-disable-next-line no-unused-vars, class-methods-use-this
              makeScale(f, s, u) {
                throw new Error("Method not implemented.");
              }
              set(f, s, u, p, g, w, o, v, M, E, $, k, L, z, O, R) {
                const N = this.elements;
                return N[0] = f, N[4] = s, N[8] = u, N[12] = p, N[1] = g, N[5] = w, N[9] = o, N[13] = v, N[2] = M, N[6] = E, N[10] = $, N[14] = k, N[3] = L, N[7] = z, N[11] = O, N[15] = R, this;
              }
              identity() {
                return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
              }
              copy(f) {
                const s = f.elements;
                return this.set(s[0], s[4], s[8], s[12], s[1], s[5], s[9], s[13], s[2], s[6], s[10], s[14], s[3], s[7], s[11], s[15]), this;
              }
              matrix3FromTopLeft() {
                const f = this.elements;
                return new x(f[0], f[4], f[8], f[1], f[5], f[9], f[2], f[6], f[10]);
              }
              setRotationFromEuler(f, s) {
                const u = this.elements, { x: p, y: g, z: w } = f, o = Math.cos(p), v = Math.sin(p), M = Math.cos(g), E = Math.sin(g), $ = Math.cos(w), k = Math.sin(w);
                if (s === void 0 || s === "XYZ") {
                  const L = o * $, z = o * k, O = v * $, R = v * k;
                  u[0] = M * $, u[4] = -M * k, u[8] = E, u[1] = z + O * E, u[5] = L - R * E, u[9] = -v * M, u[2] = R - L * E, u[6] = O + z * E, u[10] = o * M;
                } else
                  console.error(`Error with matrix4 setRotationFromEuler. Order: ${s}`);
                return this;
              }
              setRotationFromQuaternion(f) {
                const s = this.elements, { x: u, y: p, z: g, w } = f, o = u + u, v = p + p, M = g + g, E = u * o, $ = u * v, k = u * M, L = p * v, z = p * M, O = g * M, R = w * o, N = w * v, W = w * M;
                return s[0] = 1 - (L + O), s[4] = $ - W, s[8] = k + N, s[1] = $ + W, s[5] = 1 - (E + O), s[9] = z - R, s[2] = k - N, s[6] = z + R, s[10] = 1 - (E + L), this;
              }
              multiplyMatrices(f, s) {
                const u = f.elements, p = s.elements, g = this.elements, w = u[0], o = u[4], v = u[8], M = u[12], E = u[1], $ = u[5], k = u[9], L = u[13], z = u[2], O = u[6], R = u[10], N = u[14], W = u[3], B = u[7], P = u[11], G = u[15], H = p[0], U = p[4], j = p[8], re = p[12], ie = p[1], te = p[5], ue = p[9], de = p[13], oe = p[2], J = p[6], Ee = p[10], se = p[14], Ae = p[3], he = p[7], ne = p[11], _e = p[15];
                return g[0] = w * H + o * ie + v * oe + M * Ae, g[4] = w * U + o * te + v * J + M * he, g[8] = w * j + o * ue + v * Ee + M * ne, g[12] = w * re + o * de + v * se + M * _e, g[1] = E * H + $ * ie + k * oe + L * Ae, g[5] = E * U + $ * te + k * J + L * he, g[9] = E * j + $ * ue + k * Ee + L * ne, g[13] = E * re + $ * de + k * se + L * _e, g[2] = z * H + O * ie + R * oe + N * Ae, g[6] = z * U + O * te + R * J + N * he, g[10] = z * j + O * ue + R * Ee + N * ne, g[14] = z * re + O * de + R * se + N * _e, g[3] = W * H + B * ie + P * oe + G * Ae, g[7] = W * U + B * te + P * J + G * he, g[11] = W * j + B * ue + P * Ee + G * ne, g[15] = W * re + B * de + P * se + G * _e, this;
              }
              multiplyScalar(f) {
                const s = this.elements;
                return s[0] *= f, s[4] *= f, s[8] *= f, s[12] *= f, s[1] *= f, s[5] *= f, s[9] *= f, s[13] *= f, s[2] *= f, s[6] *= f, s[10] *= f, s[14] *= f, s[3] *= f, s[7] *= f, s[11] *= f, s[15] *= f, this;
              }
              makeTranslation(f, s, u) {
                return this.set(1, 0, 0, f, 0, 1, 0, s, 0, 0, 1, u, 0, 0, 0, 1), this;
              }
              // snap values close to integers to their integer value
              // useful and identifying identity matrices
              snap(f) {
                const s = Math.pow(10, 4), u = this.elements;
                for (let p = 0; p < 16; p++) {
                  const g = Math.round(u[p]);
                  g === Math.round(u[p] * s) / s && (u[p] = g);
                }
                return this;
              }
              transpose() {
                const f = this.elements;
                let s;
                return s = f[1], f[1] = f[4], f[4] = s, s = f[2], f[2] = f[8], f[8] = s, s = f[6], f[6] = f[9], f[9] = s, s = f[3], f[3] = f[12], f[12] = s, s = f[7], f[7] = f[13], f[13] = s, s = f[11], f[11] = f[14], f[14] = s, this;
              }
              setPosition(f) {
                const s = this.elements;
                return s[12] = f.x, s[13] = f.y, s[14] = f.z, this;
              }
              translate(f) {
                const s = this.elements;
                return s[12] += f.x, s[13] += f.y, s[14] += f.z, this;
              }
              getInverse(f, s) {
                const u = this.elements, p = f.elements, g = p[0], w = p[4], o = p[8], v = p[12], M = p[1], E = p[5], $ = p[9], k = p[13], L = p[2], z = p[6], O = p[10], R = p[14], N = p[3], W = p[7], B = p[11], P = p[15];
                u[0] = $ * R * W - k * O * W + k * z * B - E * R * B - $ * z * P + E * O * P, u[4] = v * O * W - o * R * W - v * z * B + w * R * B + o * z * P - w * O * P, u[8] = o * k * W - v * $ * W + v * E * B - w * k * B - o * E * P + w * $ * P, u[12] = v * $ * z - o * k * z - v * E * O + w * k * O + o * E * R - w * $ * R, u[1] = k * O * N - $ * R * N - k * L * B + M * R * B + $ * L * P - M * O * P, u[5] = o * R * N - v * O * N + v * L * B - g * R * B - o * L * P + g * O * P, u[9] = v * $ * N - o * k * N - v * M * B + g * k * B + o * M * P - g * $ * P, u[13] = o * k * L - v * $ * L + v * M * O - g * k * O - o * M * R + g * $ * R, u[2] = E * R * N - k * z * N + k * L * W - M * R * W - E * L * P + M * z * P, u[6] = v * z * N - w * R * N - v * L * W + g * R * W + w * L * P - g * z * P, u[10] = w * k * N - v * E * N + v * M * W - g * k * W - w * M * P + g * E * P, u[14] = v * E * L - w * k * L - v * M * z + g * k * z + w * M * R - g * E * R, u[3] = $ * z * N - E * O * N - $ * L * W + M * O * W + E * L * B - M * z * B, u[7] = w * O * N - o * z * N + o * L * W - g * O * W - w * L * B + g * z * B, u[11] = o * E * N - w * $ * N - o * M * W + g * $ * W + w * M * B - g * E * B, u[15] = w * $ * L - o * E * L + o * M * z - g * $ * z - w * M * O + g * E * O;
                const G = g * u[0] + M * u[4] + L * u[8] + N * u[12];
                if (G === 0) {
                  const H = "Matrix4.getInverse(): can't invert matrix, determinant is 0";
                  if (s)
                    throw new Error(H);
                  return console.warn(H), this.identity(), this;
                }
                return this.multiplyScalar(1 / G), this;
              }
              isReflected() {
                const f = this.elements, s = f[0], u = f[4], p = f[8], g = f[1], w = f[5], o = f[9], v = f[2], M = f[6], E = f[10];
                return s * w * E + // +aei
                g * M * p + // +bfg
                v * u * o - // +cdh
                v * w * p - // -ceg
                g * u * E - // -bdi
                s * M * o < 0;
              }
              scale(f) {
                const s = this.elements, { x: u } = f, { y: p } = f, { z: g } = f;
                return s[0] *= u, s[4] *= p, s[8] *= g, s[1] *= u, s[5] *= p, s[9] *= g, s[2] *= u, s[6] *= p, s[10] *= g, s[3] *= u, s[7] *= p, s[11] *= g, this;
              }
              getMaxScaleOnAxis() {
                const f = this.elements, s = f[0] * f[0] + f[1] * f[1] + f[2] * f[2], u = f[4] * f[4] + f[5] * f[5] + f[6] * f[6], p = f[8] * f[8] + f[9] * f[9] + f[10] * f[10];
                return Math.sqrt(Math.max(s, Math.max(u, p)));
              }
              makeFrustum(f, s, u, p, g, w) {
                const o = this.elements, v = 2 * g / (s - f), M = 2 * g / (p - u), E = (s + f) / (s - f), $ = (p + u) / (p - u), k = -(w + g) / (w - g), L = -2 * w * g / (w - g);
                return o[0] = v, o[4] = 0, o[8] = E, o[12] = 0, o[1] = 0, o[5] = M, o[9] = $, o[13] = 0, o[2] = 0, o[6] = 0, o[10] = k, o[14] = L, o[3] = 0, o[7] = 0, o[11] = -1, o[15] = 0, this;
              }
              makePerspective(f, s, u, p) {
                const g = u * Math.tan((0, r.degToRad)(f * 0.5)), w = -g, o = w * s, v = g * s;
                return this.makeFrustum(o, v, w, g, u, p);
              }
              makeOrthographic(f, s, u, p, g, w) {
                const o = this.elements, v = 1 / (s - f), M = 1 / (u - p), E = 1 / (w - g), $ = (s + f) * v, k = (u + p) * M, L = (w + g) * E;
                return o[0] = 2 * v, o[4] = 0, o[8] = 0, o[12] = -$, o[1] = 0, o[5] = 2 * M, o[9] = 0, o[13] = -k, o[2] = 0, o[6] = 0, o[10] = -2 * E, o[14] = -L, o[3] = 0, o[7] = 0, o[11] = 0, o[15] = 1, this;
              }
              isEqual(f) {
                const s = f.elements, u = this.elements;
                return u[0] === s[0] && u[4] === s[4] && u[8] === s[8] && u[12] === s[12] && u[1] === s[1] && u[5] === s[5] && u[9] === s[9] && u[13] === s[13] && u[2] === s[2] && u[6] === s[6] && u[10] === s[10] && u[14] === s[14] && u[3] === s[3] && u[7] === s[7] && u[11] === s[11] && u[15] === s[15];
              }
              clone() {
                const f = this.elements;
                return new m(f[0], f[4], f[8], f[12], f[1], f[5], f[9], f[13], f[2], f[6], f[10], f[14], f[3], f[7], f[11], f[15]);
              }
              isIdentity() {
                const f = this.elements;
                return f[0] === 1 && f[4] === 0 && f[8] === 0 && f[12] === 0 && f[1] === 0 && f[5] === 1 && f[9] === 0 && f[13] === 0 && f[2] === 0 && f[6] === 0 && f[10] === 1 && f[14] === 0 && f[3] === 0 && f[7] === 0 && f[11] === 0 && f[15] === 1;
              }
              // return true if elements are with digits of identity
              isNearlyIdentity(f) {
                return this.clone().snap(f).isIdentity();
              }
              getScale(f) {
                const s = this.elements;
                return f = f || new y(), c.set(s[0], s[1], s[2]), d.set(s[4], s[5], s[6]), _.set(s[8], s[9], s[10]), f.x = c.length(), f.y = d.length(), f.z = _.length(), f;
              }
              lookAt(f, s, u) {
                const p = this.elements;
                return _.subVectors(f, s).normalize(), _.length() === 0 && (_.z = 1), c.crossVectors(u, _).normalize(), c.length() === 0 && (_.x += 1e-4, c.crossVectors(u, _).normalize()), d.crossVectors(_, c), p[0] = c.x, p[4] = d.x, p[8] = _.x, p[1] = c.y, p[5] = d.y, p[9] = _.y, p[2] = c.z, p[6] = d.z, p[10] = _.z, this;
              }
              compose(f, s, u) {
                const p = this.elements;
                return l.identity(), l.setRotationFromQuaternion(s), h.makeScale(u.x, u.y, u.z), this.multiplyMatrices(l, h), p[12] = f.x, p[13] = f.y, p[14] = f.z, this;
              }
            }
            l = new m(), h = new m();
            class y {
              constructor(f, s, u) {
                this.x = f || 0, this.y = s || 0, this.z = u || 0, this.atomid = void 0;
              }
              set(f, s, u) {
                return this.x = f, this.y = s, this.z = u, this;
              }
              copy(f) {
                return this.x = f.x, this.y = f.y, this.z = f.z, this;
              }
              add(f) {
                return this.x += f.x, this.y += f.y, this.z += f.z, this;
              }
              addVectors(f, s) {
                return this.x = f.x + s.x, this.y = f.y + s.y, this.z = f.z + s.z, this;
              }
              multiplyVectors(f, s) {
                return this.x = f.x * s.x, this.y = f.y * s.y, this.z = f.z * s.z, this;
              }
              sub(f) {
                return this.x -= f.x, this.y -= f.y, this.z -= f.z, this;
              }
              subVectors(f, s) {
                return this.x = f.x - s.x, this.y = f.y - s.y, this.z = f.z - s.z, this;
              }
              multiplyScalar(f) {
                return this.x *= f, this.y *= f, this.z *= f, this;
              }
              divideScalar(f) {
                return f !== 0 ? (this.x /= f, this.y /= f, this.z /= f) : (this.x = 0, this.y = 0, this.z = 0), this;
              }
              // accumulate maximum
              max(f) {
                return this.x = Math.max(this.x, f.x), this.y = Math.max(this.y, f.y), this.z = Math.max(this.z, f.z), this;
              }
              // accumulate min
              min(f) {
                return this.x = Math.min(this.x, f.x), this.y = Math.min(this.y, f.y), this.z = Math.min(this.z, f.z), this;
              }
              distanceTo(f) {
                return Math.sqrt(this.distanceToSquared(f));
              }
              distanceToSquared(f) {
                const s = this.x - f.x, u = this.y - f.y, p = this.z - f.z;
                return s * s + u * u + p * p;
              }
              applyMatrix3(f) {
                const { x: s } = this, { y: u } = this, { z: p } = this, g = f.elements;
                return this.x = g[0] * s + g[3] * u + g[6] * p, this.y = g[1] * s + g[4] * u + g[7] * p, this.z = g[2] * s + g[5] * u + g[8] * p, this;
              }
              applyMatrix4(f) {
                const { x: s } = this, { y: u } = this, { z: p } = this, g = f.elements;
                return this.x = g[0] * s + g[4] * u + g[8] * p + g[12], this.y = g[1] * s + g[5] * u + g[9] * p + g[13], this.z = g[2] * s + g[6] * u + g[10] * p + g[14], this;
              }
              applyProjection(f) {
                const { x: s } = this, { y: u } = this, { z: p } = this, g = f.elements, w = g[3] * s + g[7] * u + g[11] * p + g[15];
                return this.x = (g[0] * s + g[4] * u + g[8] * p + g[12]) / w, this.y = (g[1] * s + g[5] * u + g[9] * p + g[13]) / w, this.z = (g[2] * s + g[6] * u + g[10] * p + g[14]) / w, this;
              }
              applyQuaternion(f) {
                const { x: s } = this, { y: u } = this, { z: p } = this, g = f.x, w = f.y, o = f.z, v = f.w, M = {};
                M.x = 2 * (u * o - p * w), M.y = 2 * (p * g - s * o), M.z = 2 * (s * w - u * g);
                const E = {};
                return E.x = M.y * o - M.z * w, E.y = M.z * g - M.x * o, E.z = M.x * w - M.y * g, this.x = s + v * M.x + E.x, this.y = u + v * M.y + E.y, this.z = p + v * M.z + E.z, this;
              }
              negate() {
                return this.multiplyScalar(-1);
              }
              dot(f) {
                return this.x * f.x + this.y * f.y + this.z * f.z;
              }
              length() {
                return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
              }
              lengthSq() {
                return this.x * this.x + this.y * this.y + this.z * this.z;
              }
              normalize() {
                return this.divideScalar(this.length());
              }
              cross(f) {
                const { x: s } = this, { y: u } = this, { z: p } = this;
                return this.x = u * f.z - p * f.y, this.y = p * f.x - s * f.z, this.z = s * f.y - u * f.x, this;
              }
              crossVectors(f, s) {
                return this.x = f.y * s.z - f.z * s.y, this.y = f.z * s.x - f.x * s.z, this.z = f.x * s.y - f.y * s.x, this;
              }
              equals(f) {
                return this.x == f.x && this.y == f.y && this.z == f.z;
              }
              getPositionFromMatrix(f) {
                return this.x = f.elements[12], this.y = f.elements[13], this.z = f.elements[14], this;
              }
              setEulerFromRotationMatrix(f, s) {
                const u = f.elements, p = u[0], g = u[4], w = u[8], o = u[5], v = u[9], M = u[6], E = u[10];
                return s === void 0 || s === "XYZ" ? (this.y = Math.asin((0, a.clamp)(w, -1, 1)), Math.abs(w) < 0.99999 ? (this.x = Math.atan2(-v, E), this.z = Math.atan2(-g, p)) : (this.x = Math.atan2(M, o), this.z = 0)) : console.error(`Error with vector's setEulerFromRotationMatrix: Unknown order: ${s}`), this;
              }
              rotateAboutVector(f, s) {
                f.normalize();
                const u = Math.cos(s), p = Math.sin(s), g = this.clone().multiplyScalar(u), w = f.clone().cross(this).multiplyScalar(p), o = f.clone().multiplyScalar(f.clone().dot(this)).multiplyScalar(1 - u), v = g.add(w).add(o);
                return this.x = v.x, this.y = v.y, this.z = v.z, this;
              }
              setFromMatrixPosition(f) {
                const s = f.elements;
                return this.x = s[12], this.y = s[13], this.z = s[14], this;
              }
              // unproject is defined after Matrix4
              transformDirection(f) {
                const { x: s } = this, { y: u } = this, { z: p } = this, g = f.elements;
                return this.x = g[0] * s + g[4] * u + g[8] * p, this.y = g[1] * s + g[5] * u + g[9] * p, this.z = g[2] * s + g[6] * u + g[10] * p, this.normalize();
              }
              clone() {
                return new y(this.x, this.y, this.z);
              }
              unproject(f) {
                const s = l;
                return s.multiplyMatrices(f.matrixWorld, s.getInverse(f.projectionMatrix)), this.applyMatrix4(s);
              }
            }
            c = new y(), d = new y(), _ = new y();
            class x {
              constructor(f = 1, s = 0, u = 0, p = 0, g = 1, w = 0, o = 0, v = 0, M = 1) {
                this.elements = new Float32Array(9), this.set(f, s, u, p, g, w, o, v, M);
              }
              set(f, s, u, p, g, w, o, v, M) {
                const E = this.elements;
                return E[0] = f, E[3] = s, E[6] = u, E[1] = p, E[4] = g, E[7] = w, E[2] = o, E[5] = v, E[8] = M, this;
              }
              identity() {
                return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
              }
              copy(f) {
                const s = f.elements;
                this.set(s[0], s[3], s[6], s[1], s[4], s[7], s[2], s[5], s[8]);
              }
              multiplyScalar(f) {
                const s = this.elements;
                return s[0] *= f, s[3] *= f, s[6] *= f, s[1] *= f, s[4] *= f, s[7] *= f, s[2] *= f, s[5] *= f, s[8] *= f, this;
              }
              getInverse3(f) {
                const s = f.elements, u = this.elements;
                u[0] = s[4] * s[8] - s[5] * s[7], u[3] = s[6] * s[5] - s[3] * s[8], u[6] = s[3] * s[7] - s[6] * s[4], u[1] = s[7] * s[2] - s[1] * s[8], u[4] = s[0] * s[8] - s[6] * s[2], u[7] = s[1] * s[6] - s[0] * s[7], u[2] = s[1] * s[5] - s[2] * s[4], u[5] = s[2] * s[3] - s[0] * s[5], u[8] = s[0] * s[4] - s[1] * s[3];
                const p = s[0] * u[0] + s[3] * u[1] + s[6] * u[2];
                return this.multiplyScalar(1 / p), this;
              }
              getInverse(f, s) {
                const u = f.elements, p = this.elements;
                p[0] = u[10] * u[5] - u[6] * u[9], p[1] = -u[10] * u[1] + u[2] * u[9], p[2] = u[6] * u[1] - u[2] * u[5], p[3] = -u[10] * u[4] + u[6] * u[8], p[4] = u[10] * u[0] - u[2] * u[8], p[5] = -u[6] * u[0] + u[2] * u[4], p[6] = u[9] * u[4] - u[5] * u[8], p[7] = -u[9] * u[0] + u[1] * u[8], p[8] = u[5] * u[0] - u[1] * u[4];
                const g = u[0] * p[0] + u[1] * p[3] + u[2] * p[6];
                if (g === 0) {
                  const w = "Matrix3.getInverse(): can't invert matrix, determinant is 0";
                  if (s)
                    throw new Error(w);
                  return console.warn(w), this.identity(), this;
                }
                return this.multiplyScalar(1 / g), this;
              }
              // https://en.wikipedia.org/wiki/Determinant
              getDeterminant() {
                const f = this.elements;
                return f[0] * f[4] * f[8] + // +aei
                f[1] * f[5] * f[6] + // +bfg
                f[2] * f[3] * f[7] - // +cdh
                f[2] * f[4] * f[6] - // -ceg
                f[1] * f[3] * f[8] - // -bdi
                f[0] * f[5] * f[7];
              }
              transpose() {
                let f;
                const s = this.elements;
                return f = s[1], s[1] = s[3], s[3] = f, f = s[2], s[2] = s[6], s[6] = f, f = s[5], s[5] = s[7], s[7] = f, this;
              }
              clone() {
                const f = this.elements;
                return new x(f[0], f[3], f[6], f[1], f[4], f[7], f[2], f[5], f[8]);
              }
              getMatrix4() {
                const f = this.elements;
                return new m(f[0], f[3], f[6], 0, f[1], f[4], f[7], 0, f[2], f[5], f[8], 0);
              }
            }
            class b {
              constructor(f, s) {
                this.origin = f !== void 0 ? f : new y(), this.direction = s !== void 0 ? s : new y();
              }
              set(f, s) {
                return this.origin.copy(f), this.direction.copy(s), this;
              }
              copy(f) {
                return this.origin.copy(f.origin), this.direction.copy(f.direction), this;
              }
              at(f, s) {
                return (s || new y()).copy(this.direction).multiplyScalar(f).add(this.origin);
              }
              recast(f) {
                const s = c;
                return this.origin.copy(this.at(f, s)), this;
              }
              closestPointToPoint(f, s) {
                const u = s || new y();
                u.subVectors(f, this.origin);
                const p = u.dot(this.direction);
                return u.copy(this.direction).multiplyScalar(p).add(this.origin);
              }
              distanceToPoint(f) {
                const s = c, u = s.subVectors(f, this.origin).dot(this.direction);
                return s.copy(this.direction).multiplyScalar(u).add(this.origin), s.distanceTo(f);
              }
              // eslint-disable-next-line class-methods-use-this
              isIntersectionCylinder() {
              }
              isIntersectionSphere(f) {
                return this.distanceToPoint(f.center) <= f.radius;
              }
              isIntersectionPlane(f) {
                return f.normal.dot(this.direction) !== 0 || f.distanceToPoint(this.origin) === 0;
              }
              distanceToPlane(f) {
                const s = f.normal.dot(this.direction);
                return s === 0 ? f.distanceToPoint(this.origin) === 0 ? 0 : void 0 : -(this.origin.dot(f.normal) + f.constant) / s;
              }
              intersectPlane(f, s) {
                const u = this.distanceToPlane(f);
                if (u !== void 0)
                  return this.at(u, s);
              }
              applyMatrix4(f) {
                return this.direction.add(this.origin).applyMatrix4(f), this.origin.applyMatrix4(f), this.direction.sub(this.origin), this;
              }
              clone() {
                return new b().copy(this);
              }
            }
          }
        ),
        /***/
        "./src/WebGL/math/utils/clamp.ts": (
          /*!***************************************!*\
            !*** ./src/WebGL/math/utils/clamp.ts ***!
            \***************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              clamp: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            function r(a, l, h) {
              return Math.min(Math.max(a, l), h);
            }
          }
        ),
        /***/
        "./src/WebGL/math/utils/conversionMatrix3.ts": (
          /*!***************************************************!*\
            !*** ./src/WebGL/math/utils/conversionMatrix3.ts ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              conversionMatrix3: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/math.ts"
            );
            function a(l, h, c, d, _, m) {
              d = d * Math.PI / 180, _ = _ * Math.PI / 180, m = m * Math.PI / 180;
              const y = (u) => u * u, x = Math.cos(d), b = Math.cos(_), A = Math.cos(m), f = Math.sin(m);
              return new r.Matrix3(l, h * A, c * b, 0, h * f, c * (x - b * A) / f, 0, 0, c * Math.sqrt(1 - y(x) - y(b) - y(A) + 2 * x * b * A) / f);
            }
          }
        ),
        /***/
        "./src/WebGL/math/utils/degToRad.ts": (
          /*!******************************************!*\
            !*** ./src/WebGL/math/utils/degToRad.ts ***!
            \******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              degToRad: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            const r = Math.PI / 180;
            function a(l) {
              return l * r;
            }
          }
        ),
        /***/
        "./src/WebGL/objects/Line.ts": (
          /*!***********************************!*\
            !*** ./src/WebGL/objects/Line.ts ***!
            \***********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Line: () => (
                /* binding */
                h
              ),
              /* harmony export */
              LineStyle: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../materials */
              "./src/WebGL/materials/index.ts"
            ), a = t(
              /*! ../core */
              "./src/WebGL/core/index.ts"
            ), l;
            (function(c) {
              c[c.LineStrip = 0] = "LineStrip", c[c.LinePieces = 1] = "LinePieces";
            })(l || (l = {}));
            class h extends a.Object3D {
              constructor(d, _ = new r.LineBasicMaterial({
                color: Math.random() * 16777215
              }), m = l.LineStrip) {
                super(), this.geometry = d, this.material = _, this.type = m;
              }
              clone(d = new h(this.geometry, this.material, this.type)) {
                return super.clone.call(this, d), d;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/objects/Mesh.ts": (
          /*!***********************************!*\
            !*** ./src/WebGL/objects/Mesh.ts ***!
            \***********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Mesh: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../core */
              "./src/WebGL/core/index.ts"
            );
            class a extends r.Object3D {
              constructor(h, c) {
                super(), this.geometry = h, this.material = c;
              }
              clone(h) {
                return h === void 0 && (h = new a(this.geometry, this.material)), super.clone.call(this, h), h;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/objects/Sprite.ts": (
          /*!*************************************!*\
            !*** ./src/WebGL/objects/Sprite.ts ***!
            \*************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Sprite: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../materials */
              "./src/WebGL/materials/index.ts"
            ), a = t(
              /*! ../core */
              "./src/WebGL/core/index.ts"
            );
            class l extends a.Object3D {
              constructor(c = new r.SpriteMaterial()) {
                super(), this.material = c, this.rotation3d = this.rotation, this.rotation = 0;
              }
              updateMatrix() {
                this.matrix.setPosition(this.position), this.rotation3d.set(0, 0, this.rotation), this.matrix.setRotationFromEuler(this.rotation3d), (this.scale.x !== 1 || this.scale.y !== 1) && this.matrix.scale(this.scale), this.matrixWorldNeedsUpdate = !0;
              }
              clone(c = new l(this.material)) {
                return a.Object3D.prototype.clone.call(this, c), c;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/objects/index.ts": (
          /*!************************************!*\
            !*** ./src/WebGL/objects/index.ts ***!
            \************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Line: () => (
                /* reexport safe */
                r.Line
              ),
              /* harmony export */
              LineStyle: () => (
                /* reexport safe */
                r.LineStyle
              ),
              /* harmony export */
              Mesh: () => (
                /* reexport safe */
                a.Mesh
              ),
              /* harmony export */
              Sprite: () => (
                /* reexport safe */
                l.Sprite
              )
              /* harmony export */
            });
            var r = t(
              /*! ./Line */
              "./src/WebGL/objects/Line.ts"
            ), a = t(
              /*! ./Mesh */
              "./src/WebGL/objects/Mesh.ts"
            ), l = t(
              /*! ./Sprite */
              "./src/WebGL/objects/Sprite.ts"
            );
          }
        ),
        /***/
        "./src/WebGL/shaders/ShaderType.ts": (
          /*!*****************************************!*\
            !*** ./src/WebGL/shaders/ShaderType.ts ***!
            \*****************************************/
          /***/
          (n, e, t) => {
            t.r(e);
          }
        ),
        /***/
        "./src/WebGL/shaders/index.ts": (
          /*!************************************!*\
            !*** ./src/WebGL/shaders/index.ts ***!
            \************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              ShaderLib: () => (
                /* reexport safe */
                r.ShaderLib
              ),
              /* harmony export */
              ShaderUtils: () => (
                /* reexport safe */
                a.ShaderUtils
              ),
              /* harmony export */
              basic: () => (
                /* reexport safe */
                r.basic
              ),
              /* harmony export */
              clone: () => (
                /* reexport safe */
                a.clone
              ),
              /* harmony export */
              instanced: () => (
                /* reexport safe */
                r.instanced
              ),
              /* harmony export */
              lambert: () => (
                /* reexport safe */
                r.lambert
              ),
              /* harmony export */
              lambertdouble: () => (
                /* reexport safe */
                r.lambertdouble
              ),
              /* harmony export */
              outline: () => (
                /* reexport safe */
                r.outline
              ),
              /* harmony export */
              screen: () => (
                /* reexport safe */
                r.screen
              ),
              /* harmony export */
              screenaa: () => (
                /* reexport safe */
                r.screenaa
              ),
              /* harmony export */
              sphereimposter: () => (
                /* reexport safe */
                r.sphereimposter
              ),
              /* harmony export */
              sphereimposteroutline: () => (
                /* reexport safe */
                r.sphereimposteroutline
              ),
              /* harmony export */
              sprite: () => (
                /* reexport safe */
                r.sprite
              ),
              /* harmony export */
              stickimposter: () => (
                /* reexport safe */
                r.stickimposter
              ),
              /* harmony export */
              stickimposteroutline: () => (
                /* reexport safe */
                r.stickimposteroutline
              ),
              /* harmony export */
              volumetric: () => (
                /* reexport safe */
                r.volumetric
              )
              /* harmony export */
            });
            var r = t(
              /*! ./lib */
              "./src/WebGL/shaders/lib/index.ts"
            ), a = t(
              /*! ./utils */
              "./src/WebGL/shaders/utils/index.ts"
            );
            t(
              /*! ./ShaderType */
              "./src/WebGL/shaders/ShaderType.ts"
            );
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/basic/index.ts": (
          /*!**********************************************!*\
            !*** ./src/WebGL/shaders/lib/basic/index.ts ***!
            \**********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              basic: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/basic/uniforms.ts"
            ), a = t(
              /*! ./basic.frag */
              "./src/WebGL/shaders/lib/basic/basic.frag"
            ), l = t(
              /*! ./basic.vert */
              "./src/WebGL/shaders/lib/basic/basic.vert"
            );
            const h = {
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/basic/uniforms.ts": (
          /*!*************************************************!*\
            !*** ./src/WebGL/shaders/lib/basic/uniforms.ts ***!
            \*************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/blur/index.ts": (
          /*!*********************************************!*\
            !*** ./src/WebGL/shaders/lib/blur/index.ts ***!
            \*********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              blur: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/blur/uniforms.ts"
            ), a = t(
              /*! ./blur.frag */
              "./src/WebGL/shaders/lib/blur/blur.frag"
            ), l = t(
              /*! ./blur.vert */
              "./src/WebGL/shaders/lib/blur/blur.vert"
            );
            const h = {
              fragmentShader: a.default,
              vertexShader: l.default,
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/blur/uniforms.ts": (
          /*!************************************************!*\
            !*** ./src/WebGL/shaders/lib/blur/uniforms.ts ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = {};
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/index.ts": (
          /*!****************************************!*\
            !*** ./src/WebGL/shaders/lib/index.ts ***!
            \****************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              ShaderLib: () => (
                /* binding */
                p
              ),
              /* harmony export */
              basic: () => (
                /* reexport safe */
                r.basic
              ),
              /* harmony export */
              instanced: () => (
                /* reexport safe */
                a.instanced
              ),
              /* harmony export */
              lambert: () => (
                /* reexport safe */
                l.lambert
              ),
              /* harmony export */
              lambertdouble: () => (
                /* reexport safe */
                h.lambertdouble
              ),
              /* harmony export */
              outline: () => (
                /* reexport safe */
                c.outline
              ),
              /* harmony export */
              screen: () => (
                /* reexport safe */
                d.screen
              ),
              /* harmony export */
              screenaa: () => (
                /* reexport safe */
                _.screenaa
              ),
              /* harmony export */
              sphereimposter: () => (
                /* reexport safe */
                m.sphereimposter
              ),
              /* harmony export */
              sphereimposteroutline: () => (
                /* reexport safe */
                y.sphereimposteroutline
              ),
              /* harmony export */
              sprite: () => (
                /* reexport safe */
                x.sprite
              ),
              /* harmony export */
              stickimposter: () => (
                /* reexport safe */
                b.stickimposter
              ),
              /* harmony export */
              stickimposteroutline: () => (
                /* reexport safe */
                A.stickimposteroutline
              ),
              /* harmony export */
              volumetric: () => (
                /* reexport safe */
                f.volumetric
              )
              /* harmony export */
            });
            var r = t(
              /*! ./basic */
              "./src/WebGL/shaders/lib/basic/index.ts"
            ), a = t(
              /*! ./instanced */
              "./src/WebGL/shaders/lib/instanced/index.ts"
            ), l = t(
              /*! ./lambert */
              "./src/WebGL/shaders/lib/lambert/index.ts"
            ), h = t(
              /*! ./lambertdouble */
              "./src/WebGL/shaders/lib/lambertdouble/index.ts"
            ), c = t(
              /*! ./outline */
              "./src/WebGL/shaders/lib/outline/index.ts"
            ), d = t(
              /*! ./screen */
              "./src/WebGL/shaders/lib/screen/index.ts"
            ), _ = t(
              /*! ./screenaa */
              "./src/WebGL/shaders/lib/screenaa/index.ts"
            ), m = t(
              /*! ./sphereimposter */
              "./src/WebGL/shaders/lib/sphereimposter/index.ts"
            ), y = t(
              /*! ./sphereimposteroutline */
              "./src/WebGL/shaders/lib/sphereimposteroutline/index.ts"
            ), x = t(
              /*! ./sprite */
              "./src/WebGL/shaders/lib/sprite/index.ts"
            ), b = t(
              /*! ./stickimposter */
              "./src/WebGL/shaders/lib/stickimposter/index.ts"
            ), A = t(
              /*! ./stickimposteroutline */
              "./src/WebGL/shaders/lib/stickimposteroutline/index.ts"
            ), f = t(
              /*! ./volumetric */
              "./src/WebGL/shaders/lib/volumetric/index.ts"
            ), s = t(
              /*! ./ssao */
              "./src/WebGL/shaders/lib/ssao/index.ts"
            ), u = t(
              /*! ./blur */
              "./src/WebGL/shaders/lib/blur/index.ts"
            );
            const p = {
              basic: r.basic,
              blur: u.blur,
              instanced: a.instanced,
              lambert: l.lambert,
              lambertdouble: h.lambertdouble,
              outline: c.outline,
              screen: d.screen,
              screenaa: _.screenaa,
              ssao: s.ssao,
              sphereimposter: m.sphereimposter,
              sphereimposteroutline: y.sphereimposteroutline,
              sprite: x.sprite,
              stickimposter: b.stickimposter,
              stickimposteroutline: A.stickimposteroutline,
              volumetric: f.volumetric
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/instanced/index.ts": (
          /*!**************************************************!*\
            !*** ./src/WebGL/shaders/lib/instanced/index.ts ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              instanced: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/instanced/uniforms.ts"
            ), a = t(
              /*! ./instanced.frag */
              "./src/WebGL/shaders/lib/instanced/instanced.frag"
            ), l = t(
              /*! ./instanced.vert */
              "./src/WebGL/shaders/lib/instanced/instanced.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/instanced/uniforms.ts": (
          /*!*****************************************************!*\
            !*** ./src/WebGL/shaders/lib/instanced/uniforms.ts ***!
            \*****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              directionalLightColor: { type: "fv", value: [] },
              directionalLightDirection: { type: "fv", value: [] }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambert/index.ts": (
          /*!************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambert/index.ts ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              lambert: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/lambert/uniforms.ts"
            ), a = t(
              /*! ./lambert.frag */
              "./src/WebGL/shaders/lib/lambert/lambert.frag"
            ), l = t(
              /*! ./lambert.vert */
              "./src/WebGL/shaders/lib/lambert/lambert.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambert/uniforms.ts": (
          /*!***************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambert/uniforms.ts ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              directionalLightColor: { type: "fv", value: [] },
              directionalLightDirection: { type: "fv", value: [] }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambertdouble/index.ts": (
          /*!******************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambertdouble/index.ts ***!
            \******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              lambertdouble: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/lambertdouble/uniforms.ts"
            ), a = t(
              /*! ./lambertdouble.frag */
              "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.frag"
            ), l = t(
              /*! ./lambertdouble.vert */
              "./src/WebGL/shaders/lib/lambertdouble/lambertdouble.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/lambertdouble/uniforms.ts": (
          /*!*********************************************************!*\
            !*** ./src/WebGL/shaders/lib/lambertdouble/uniforms.ts ***!
            \*********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              directionalLightColor: { type: "fv", value: [] },
              directionalLightDirection: { type: "fv", value: [] }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/outline/index.ts": (
          /*!************************************************!*\
            !*** ./src/WebGL/shaders/lib/outline/index.ts ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              outline: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/outline/uniforms.ts"
            ), a = t(
              /*! ./outline.frag */
              "./src/WebGL/shaders/lib/outline/outline.frag"
            ), l = t(
              /*! ./outline.vert */
              "./src/WebGL/shaders/lib/outline/outline.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/outline/uniforms.ts": (
          /*!***************************************************!*\
            !*** ./src/WebGL/shaders/lib/outline/uniforms.ts ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              outlineColor: { type: "c", value: new r.Color(0, 0, 0) },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              outlineWidth: { type: "f", value: 0.1 },
              outlinePushback: { type: "f", value: 1 },
              outlineMaxPixels: { type: "f", value: 0 }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screen/index.ts": (
          /*!***********************************************!*\
            !*** ./src/WebGL/shaders/lib/screen/index.ts ***!
            \***********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              screen: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/screen/uniforms.ts"
            ), a = t(
              /*! ./screen.frag */
              "./src/WebGL/shaders/lib/screen/screen.frag"
            ), l = t(
              /*! ./screen.vert */
              "./src/WebGL/shaders/lib/screen/screen.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screen/uniforms.ts": (
          /*!**************************************************!*\
            !*** ./src/WebGL/shaders/lib/screen/uniforms.ts ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = {};
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screenaa/index.ts": (
          /*!*************************************************!*\
            !*** ./src/WebGL/shaders/lib/screenaa/index.ts ***!
            \*************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              screenaa: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/screenaa/uniforms.ts"
            ), a = t(
              /*! ./screenaa.frag */
              "./src/WebGL/shaders/lib/screenaa/screenaa.frag"
            ), l = t(
              /*! ./screenaa.vert */
              "./src/WebGL/shaders/lib/screenaa/screenaa.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/screenaa/uniforms.ts": (
          /*!****************************************************!*\
            !*** ./src/WebGL/shaders/lib/screenaa/uniforms.ts ***!
            \****************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = {};
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposter/index.ts": (
          /*!*******************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposter/index.ts ***!
            \*******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              sphereimposter: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/sphereimposter/uniforms.ts"
            ), a = t(
              /*! ./sphereimposter.frag */
              "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.frag"
            ), l = t(
              /*! ./sphereimposter.vert */
              "./src/WebGL/shaders/lib/sphereimposter/sphereimposter.vert"
            );
            const h = {
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposter/uniforms.ts": (
          /*!**********************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposter/uniforms.ts ***!
            \**********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              directionalLightColor: { type: "fv", value: [] },
              directionalLightDirection: { type: "fv", value: [] }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposteroutline/index.ts": (
          /*!**************************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposteroutline/index.ts ***!
            \**************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              sphereimposteroutline: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts"
            ), a = t(
              /*! ./sphereimposteroutline.frag */
              "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.frag"
            ), l = t(
              /*! ./sphereimposteroutline.vert */
              "./src/WebGL/shaders/lib/sphereimposteroutline/sphereimposteroutline.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts": (
          /*!*****************************************************************!*\
            !*** ./src/WebGL/shaders/lib/sphereimposteroutline/uniforms.ts ***!
            \*****************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              outlineColor: { type: "c", value: new r.Color(0, 0, 0) },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              outlineWidth: { type: "f", value: 0.1 },
              outlinePushback: { type: "f", value: 1 },
              outlineMaxPixels: { type: "f", value: 0 }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sprite/index.ts": (
          /*!***********************************************!*\
            !*** ./src/WebGL/shaders/lib/sprite/index.ts ***!
            \***********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              sprite: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/sprite/uniforms.ts"
            ), a = t(
              /*! ./sprite.frag */
              "./src/WebGL/shaders/lib/sprite/sprite.frag"
            ), l = t(
              /*! ./sprite.vert */
              "./src/WebGL/shaders/lib/sprite/sprite.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/sprite/uniforms.ts": (
          /*!**************************************************!*\
            !*** ./src/WebGL/shaders/lib/sprite/uniforms.ts ***!
            \**************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = {};
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/ssao/index.ts": (
          /*!*********************************************!*\
            !*** ./src/WebGL/shaders/lib/ssao/index.ts ***!
            \*********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              ssao: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/ssao/uniforms.ts"
            ), a = t(
              /*! ./ssao.frag */
              "./src/WebGL/shaders/lib/ssao/ssao.frag"
            ), l = t(
              /*! ./ssao.vert */
              "./src/WebGL/shaders/lib/ssao/ssao.vert"
            );
            const h = {
              fragmentShader: a.default,
              vertexShader: l.default,
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/ssao/uniforms.ts": (
          /*!************************************************!*\
            !*** ./src/WebGL/shaders/lib/ssao/uniforms.ts ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = {
              total_strength: { type: "f", value: 1 },
              radius: { type: "f", value: 5 },
              projinv: { type: "mat4", value: [] }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposter/index.ts": (
          /*!******************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposter/index.ts ***!
            \******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              stickimposter: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/stickimposter/uniforms.ts"
            ), a = t(
              /*! ./stickimposterFragmentShader.partial.frag */
              "./src/WebGL/shaders/lib/stickimposter/stickimposterFragmentShader.partial.frag"
            ), l = t(
              /*! ./stickimposter.partial.frag */
              "./src/WebGL/shaders/lib/stickimposter/stickimposter.partial.frag"
            ), h = t(
              /*! ./stickimposter.vert */
              "./src/WebGL/shaders/lib/stickimposter/stickimposter.vert"
            );
            const d = {
              fragmentShader: [a.default, l.default].join(`
`),
              vertexShader: h.default,
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposter/uniforms.ts": (
          /*!*********************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposter/uniforms.ts ***!
            \*********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              directionalLightColor: { type: "fv", value: [] },
              directionalLightDirection: { type: "fv", value: [] }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposteroutline/index.ts": (
          /*!*************************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposteroutline/index.ts ***!
            \*************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              stickimposteroutline: () => (
                /* binding */
                c
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts"
            ), a = t(
              /*! ../stickimposter/stickimposterFragmentShader.partial.frag */
              "./src/WebGL/shaders/lib/stickimposter/stickimposterFragmentShader.partial.frag"
            ), l = t(
              /*! ./stickimposteroutline.vert */
              "./src/WebGL/shaders/lib/stickimposteroutline/stickimposteroutline.vert"
            );
            const c = {
              fragmentShader: a.default + "gl_FragColor = vec4(color,1.0);}",
              vertexShader: l.default,
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts": (
          /*!****************************************************************!*\
            !*** ./src/WebGL/shaders/lib/stickimposteroutline/uniforms.ts ***!
            \****************************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              outlineColor: { type: "c", value: new r.Color(0, 0, 0) },
              outlineWidth: { type: "f", value: 0.1 },
              outlinePushback: { type: "f", value: 1 },
              outlineMaxPixels: { type: "f", value: 0 },
              projinv: { type: "mat4", value: [] }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/volumetric/index.ts": (
          /*!***************************************************!*\
            !*** ./src/WebGL/shaders/lib/volumetric/index.ts ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              volumetric: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./uniforms */
              "./src/WebGL/shaders/lib/volumetric/uniforms.ts"
            ), a = t(
              /*! ./volumetric.frag */
              "./src/WebGL/shaders/lib/volumetric/volumetric.frag"
            ), l = t(
              /*! ./volumetric.vert */
              "./src/WebGL/shaders/lib/volumetric/volumetric.vert"
            );
            const h = {
              fragmentShader: a.default.replace("#define GLSLIFY 1", ""),
              vertexShader: l.default.replace("#define GLSLIFY 1", ""),
              uniforms: r.uniforms
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/lib/volumetric/uniforms.ts": (
          /*!******************************************************!*\
            !*** ./src/WebGL/shaders/lib/volumetric/uniforms.ts ***!
            \******************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              uniforms: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../../colors */
              "./src/colors.ts"
            );
            const a = {
              opacity: { type: "f", value: 1 },
              fogColor: { type: "c", value: new r.Color(1, 1, 1) },
              fogNear: { type: "f", value: 1 },
              fogFar: { type: "f", value: 2e3 },
              data: { type: "i", value: 3 },
              colormap: { type: "i", value: 4 },
              depthmap: { type: "i", value: 5 },
              step: { type: "f", value: 1 },
              maxdepth: { type: "f", value: 100 },
              subsamples: { type: "f", value: 5 },
              textmat: { type: "mat4", value: [] },
              projinv: { type: "mat4", value: [] },
              transfermin: { type: "f", value: -0.2 },
              transfermax: { type: "f", value: 0.2 }
            };
          }
        ),
        /***/
        "./src/WebGL/shaders/utils/clone.ts": (
          /*!******************************************!*\
            !*** ./src/WebGL/shaders/utils/clone.ts ***!
            \******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              clone: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../../colors */
              "./src/colors.ts"
            );
            function a(l) {
              let h = {};
              for (const d in l) {
                h[d] = {}, h[d].type = l[d].type;
                var c = l[d].value;
                c instanceof r.Color ? h[d].value = c.clone() : typeof c == "number" ? h[d].value = c : c instanceof Array ? h[d].value = [] : console.error("Error copying shader uniforms from ShaderLib: unknown type for uniform");
              }
              return h;
            }
          }
        ),
        /***/
        "./src/WebGL/shaders/utils/index.ts": (
          /*!******************************************!*\
            !*** ./src/WebGL/shaders/utils/index.ts ***!
            \******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              ShaderUtils: () => (
                /* binding */
                a
              ),
              /* harmony export */
              clone: () => (
                /* reexport safe */
                r.clone
              )
              /* harmony export */
            });
            var r = t(
              /*! ./clone */
              "./src/WebGL/shaders/utils/clone.ts"
            );
            const a = {
              clone: r.clone
            };
          }
        ),
        /***/
        "./src/WebGL/shapes/Cylinder.ts": (
          /*!**************************************!*\
            !*** ./src/WebGL/shapes/Cylinder.ts ***!
            \**************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Cylinder: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            );
            let a = new r.Vector3();
            class l {
              constructor(c = new r.Vector3(), d = new r.Vector3(), _ = 0) {
                this.c1 = c, this.c2 = d, this.radius = _, this.direction = new r.Vector3().subVectors(this.c2, this.c1).normalize();
              }
              copy(c) {
                return this.c1.copy(c.c1), this.c2.copy(c.c2), this.direction.copy(c.direction), this.radius = c.radius, this;
              }
              lengthSq() {
                return a.subVectors(this.c2, this.c1).lengthSq();
              }
              applyMatrix4(c) {
                return this.direction.add(this.c1).applyMatrix4(c), this.c1.applyMatrix4(c), this.c2.applyMatrix4(c), this.direction.sub(this.c1).normalize(), this.radius = this.radius * c.getMaxScaleOnAxis(), this;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/shapes/Sphere.ts": (
          /*!************************************!*\
            !*** ./src/WebGL/shapes/Sphere.ts ***!
            \************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Sphere: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            );
            class a {
              constructor(h = { x: 0, y: 0, z: 0 }, c = 0) {
                this.center = new r.Vector3(h.x, h.y, h.z), this.radius = c;
              }
              set(h, c) {
                return this.center.copy(h), this.radius = c, this;
              }
              copy(h) {
                return this.center.copy(h.center), this.radius = h.radius, this;
              }
              applyMatrix4(h) {
                return this.center.applyMatrix4(h), this.radius = this.radius * h.getMaxScaleOnAxis(), this;
              }
              translate(h) {
                return this.center.add(h), this;
              }
              equals(h) {
                return h.center.equals(this.center) && h.radius === this.radius;
              }
              clone() {
                return new a().copy(this);
              }
            }
          }
        ),
        /***/
        "./src/WebGL/shapes/Triangle.ts": (
          /*!**************************************!*\
            !*** ./src/WebGL/shapes/Triangle.ts ***!
            \**************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Triangle: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../math */
              "./src/WebGL/math/index.ts"
            );
            const a = new r.Vector3();
            class l {
              constructor(c = new r.Vector3(), d = new r.Vector3(), _ = new r.Vector3()) {
                this.a = c, this.b = d, this.c = _;
              }
              copy(c) {
                return this.a.copy(c.a), this.b.copy(c.b), this.c.copy(c.c), this;
              }
              applyMatrix4(c) {
                return this.a.applyMatrix4(c), this.b.applyMatrix4(c), this.c.applyMatrix4(c), this;
              }
              getNormal() {
                var c = this.a.clone();
                return c.sub(this.b), a.subVectors(this.c, this.b), c.cross(a), c.normalize(), c;
              }
            }
          }
        ),
        /***/
        "./src/WebGL/shapes/index.ts": (
          /*!***********************************!*\
            !*** ./src/WebGL/shapes/index.ts ***!
            \***********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Cylinder: () => (
                /* reexport safe */
                a.Cylinder
              ),
              /* harmony export */
              Sphere: () => (
                /* reexport safe */
                r.Sphere
              ),
              /* harmony export */
              Triangle: () => (
                /* reexport safe */
                l.Triangle
              )
              /* harmony export */
            });
            var r = t(
              /*! ./Sphere */
              "./src/WebGL/shapes/Sphere.ts"
            ), a = t(
              /*! ./Cylinder */
              "./src/WebGL/shapes/Cylinder.ts"
            ), l = t(
              /*! ./Triangle */
              "./src/WebGL/shapes/Triangle.ts"
            );
          }
        ),
        /***/
        "./src/autoload.ts": (
          /*!*************************!*\
            !*** ./src/autoload.ts ***!
            \*************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              autoinit: () => (
                /* binding */
                c
              ),
              /* harmony export */
              autoload: () => (
                /* binding */
                m
              ),
              /* harmony export */
              processing_autoinit: () => (
                /* binding */
                d
              ),
              /* harmony export */
              viewers: () => (
                /* binding */
                _
              )
              /* harmony export */
            });
            var r = t(
              /*! ./GLViewer */
              "./src/GLViewer.ts"
            ), a = t(
              /*! ./ProteinSurface4 */
              "./src/ProteinSurface4.ts"
            ), l = t(
              /*! ./utilities */
              "./src/utilities.ts"
            ), h = t(
              /*! ./colors */
              "./src/colors.ts"
            ), c = !1, d = !1, _ = {};
            function m(y, x) {
              var b, A, f;
              if (document.querySelector(".viewer_3Dmoljs") != null && (c = !0), c) {
                d = !0, y = y ?? null;
                var s = 0;
                document.querySelectorAll(".viewer_3Dmoljs").forEach((u) => {
                  var p = [], g = [], w = "";
                  u.style.position == "static" && (u.style.position = "relative");
                  var o = null;
                  if (f = null, u.dataset.pdb)
                    p.push("https://files.rcsb.org/view/" + u.dataset.pdb + ".pdb"), g.push("pdb");
                  else if (u.dataset.cid)
                    g.push("sdf"), p.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + u.dataset.cid + "/SDF?record_type=3d");
                  else if (u.dataset.href || u.dataset.url) {
                    if (u.dataset.href ? w = u.dataset.href : w = u.dataset.url, p.push(w), f = w.substring(w.lastIndexOf(".") + 1), f == "gz") {
                      let he = w.substring(0, w.lastIndexOf(".")).lastIndexOf(".");
                      f = w.substring(he + 1);
                    }
                    g.push(f);
                    var v = w.substring(w.lastIndexOf("/") + 1, w.lastIndexOf("."));
                    v == "/" && (v = w.substring(w.lastIndexOf("/") + 1)), u.dataset[g[g.length - 1]] = v;
                  }
                  let M = u.dataset;
                  for (b in M)
                    b.substring(0, 3) === "pdb" && b !== "pdb" ? (p.push("https://files.rcsb.org/view/" + M[b] + ".pdb"), g.push("pdb")) : b.substring(0, 4) === "href" && b !== "href" ? (w = M[b], p.push(w), g.push(w.substring(w.lastIndexOf(".") + 1))) : b.substring(0, 3) === "cid" && b !== "cid" && (p.push("https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + M[b] + "/SDF?record_type=3d"), g.push("sdf"));
                  var E = {};
                  u.dataset.options && (E = (0, l.specStringToObject)(u.dataset.options));
                  var $ = h.CC.color(u.dataset.backgroundcolor), k = u.dataset.backgroundalpha;
                  k = k == null ? 1 : parseFloat(k);
                  var L = { line: {} };
                  u.dataset.style && (L = (0, l.specStringToObject)(u.dataset.style));
                  var z = {};
                  u.dataset.select && (z = (0, l.specStringToObject)(u.dataset.select));
                  var O = [], R = [], N = [], W = {}, B = null, P = u.dataset, G = /style(.+)/, H = /surface(.*)/, U = /labelres(.*)/, j = [];
                  for (A in P)
                    Object.prototype.hasOwnProperty.call(P, A) && j.push(A);
                  for (j.sort(), b = 0; b < j.length; b++) {
                    A = j[b];
                    var re = G.exec(A), ie, te, ue;
                    re && (ie = "select" + re[1], te = (0, l.specStringToObject)(P[ie]), ue = (0, l.specStringToObject)(P[A]), O.push([te, ue])), re = H.exec(A), re && (ie = "select" + re[1], te = (0, l.specStringToObject)(P[ie]), ue = (0, l.specStringToObject)(P[A]), R.push([te, ue])), re = U.exec(A), re && (ie = "select" + re[1], te = (0, l.specStringToObject)(P[ie]), ue = (0, l.specStringToObject)(P[A]), N.push([te, ue])), A == "zoomto" && (W = (0, l.specStringToObject)(P[A])), A == "spin" && (B = (0, l.specStringToObject)(P[A]));
                  }
                  var de = function(he) {
                    for (he.setStyle(z, L), o && o.createSelectionAndStyle(z, L), b = 0; b < O.length; b++) {
                      let ne = O[b][0] || {}, _e = O[b][1] || { line: {} };
                      he.setStyle(ne, _e), o && o.createSelectionAndStyle(z, L);
                    }
                    for (b = 0; b < R.length; b++) {
                      let ne = R[b][0] || {}, _e = R[b][1] || {};
                      o ? he.addSurface(a.SurfaceType.VDW, _e, ne, ne).then((Be) => {
                        o.loadSurface("VDW", ne, _e, Be);
                      }) : he.addSurface(a.SurfaceType.VDW, _e, ne, ne);
                    }
                    for (b = 0; b < N.length; b++) {
                      let ne = N[b][0] || {}, _e = N[b][1] || {};
                      he.addResLabels(ne, _e);
                    }
                    he.render(), he.zoomTo(W), B && he.spin(B.axis, B.speed);
                  };
                  let oe = y;
                  try {
                    var J = (0, l.specStringToObject)(u.dataset.config) || {};
                    J.backgroundColor === void 0 && (J.backgroundColor = $), J.backgroundAlpha === void 0 && (J.backgroundAlpha = k), oe == null ? oe = _[u.id || s++] = (0, r.createViewer)(u, J) : (oe.setBackgroundColor($, k), oe.setConfig(J), o && o.initiateUI()), u.dataset.ui && $3Dmol.StateManager && (o = new $3Dmol.StateManager(oe));
                  } catch (he) {
                    console.log(he), u.textContent = "WebGL appears to be disabled.";
                  }
                  if (p.length != 0) {
                    let he = 0, ne = /* @__PURE__ */ ((_e, Le) => function(Be) {
                      w = p[he];
                      var Ue = _e.dataset.type || _e.dataset.datatype || g[he];
                      if (Le.addModel(Be, Ue, E), o) {
                        var He = _e.dataset[g[he]];
                        o.setModelTitle(He);
                      }
                      he += 1, he < p.length ? (0, l.get)(p[he]).then(ne) : (de(Le), _e.dataset.callback && (0, l.makeFunction)(_e.dataset.callback)(Le), d = !1, x && x(Le));
                    })(u, oe);
                    f && f.endsWith("gz") ? (0, l.getbin)(p[0]).then(ne) : (0, l.get)(p[0]).then(ne);
                  } else {
                    if (u.dataset.element) {
                      var Ee = "#" + u.dataset.element, se = document.querySelector(Ee), Ae = se ? se.textContent : "";
                      f = u.dataset.type || u.dataset.datatype, oe.addModel(Ae, f, E);
                    }
                    de(oe), u.dataset.callback && (0, l.makeFunction)(u.dataset.callback)(oe), d = !1, x && x(oe);
                  }
                });
              }
            }
            document.onreadystatechange = () => {
              document.readyState === "complete" && m();
            };
          }
        ),
        /***/
        "./src/colors.ts": (
          /*!***********************!*\
            !*** ./src/colors.ts ***!
            \***********************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CC: () => (
                /* binding */
                a
              ),
              /* harmony export */
              Color: () => (
                /* binding */
                r
              ),
              /* harmony export */
              builtinColorSchemes: () => (
                /* binding */
                y
              ),
              /* harmony export */
              chains: () => (
                /* binding */
                m
              ),
              /* harmony export */
              elementColors: () => (
                /* binding */
                d
              ),
              /* harmony export */
              htmlColors: () => (
                /* binding */
                l
              ),
              /* harmony export */
              residues: () => (
                /* binding */
                _
              ),
              /* harmony export */
              ssColors: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            class r {
              constructor(b, A, f) {
                return this.r = 0, this.g = 0, this.b = 0, arguments.length > 1 && typeof b == "number" ? (this.r = b || 0, this.g = A || 0, this.b = f || 0, this) : this.set(b || 0);
              }
              set(b) {
                return b instanceof r ? b.clone() : (typeof b == "number" ? this.setHex(b) : typeof b == "object" && (this.r = (b == null ? void 0 : b.r) || 0, this.g = (b == null ? void 0 : b.g) || 0, this.b = (b == null ? void 0 : b.b) || 0), this);
              }
              setHex(b) {
                return b = Math.floor(b), this.r = (b >> 16 & 255) / 255, this.g = (b >> 8 & 255) / 255, this.b = (b & 255) / 255, this;
              }
              getHex() {
                var b = Math.round(this.r * 255), A = Math.round(this.g * 255), f = Math.round(this.b * 255);
                return b << 16 | A << 8 | f;
              }
              clone() {
                return new r(this.r, this.g, this.b);
              }
              copy(b) {
                return this.r = b.r, this.g = b.g, this.b = b.b, this;
              }
              //return object that represents color components from 0 to 255
              scaled() {
                var b = {};
                return b.r = Math.round(this.r * 255), b.g = Math.round(this.g * 255), b.b = Math.round(this.b * 255), b.a = 1, b;
              }
            }
            class a {
              static color(b) {
                if (!b)
                  return a.cache[0];
                if (b instanceof r)
                  return b;
                if (typeof b == "number" && typeof a.cache[b] < "u")
                  return a.cache[b];
                if (b && Array.isArray(b))
                  return b.map(a.color);
                let A = a.getHex(b), f = new r(A);
                return a.cache[A] = f, f;
              }
              static getHex(b) {
                var A;
                if (Array.isArray(b))
                  return b.map(a.getHex);
                if (typeof b == "string") {
                  let f = b;
                  if (!isNaN(parseInt(f)))
                    return parseInt(f);
                  if (f = f.trim(), f.length == 4 && f[0] == "#" && (f = "#" + f[1] + f[1] + f[2] + f[2] + f[3] + f[3]), f.length == 7 && f[0] == "#")
                    return parseInt(f.substring(1), 16);
                  let s = a.rgbRegEx.exec(f);
                  if (s) {
                    s[1] != "" && console.log("WARNING: Opacity value in rgba ignored.  Specify separately as opacity attribute.");
                    let u = 0;
                    for (let p = 2; p < 5; p++) {
                      u *= 256;
                      let g = s[p].endsWith("%") ? 255 * parseFloat(s[p]) / 100 : parseFloat(s[p]);
                      u += Math.round(g);
                    }
                    return u;
                  }
                  return ((A = window == null ? void 0 : window.$3Dmol) === null || A === void 0 ? void 0 : A.htmlColors[b.toLowerCase()]) || 0;
                }
                return b;
              }
            }
            a.rgbRegEx = /rgb(a?)\(\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)\s*,\s*([^ ,\)\t]+)/i, a.cache = { 0: new r(0) };
            const l = {
              aliceblue: 15792383,
              antiquewhite: 16444375,
              aqua: 65535,
              aquamarine: 8388564,
              azure: 15794175,
              beige: 16119260,
              bisque: 16770244,
              black: 0,
              blanchedalmond: 16772045,
              blue: 255,
              blueviolet: 9055202,
              brown: 10824234,
              burlywood: 14596231,
              cadetblue: 6266528,
              chartreuse: 8388352,
              chocolate: 13789470,
              coral: 16744272,
              cornflowerblue: 6591981,
              cornsilk: 16775388,
              crimson: 14423100,
              cyan: 65535,
              darkblue: 139,
              darkcyan: 35723,
              darkgoldenrod: 12092939,
              darkgray: 11119017,
              darkgrey: 11119017,
              darkgreen: 25600,
              darkkhaki: 12433259,
              darkmagenta: 9109643,
              darkolivegreen: 5597999,
              darkorange: 16747520,
              darkorchid: 10040012,
              darkred: 9109504,
              darksalmon: 15308410,
              darkseagreen: 9419919,
              darkslateblue: 4734347,
              darkslategray: 3100495,
              darkslategrey: 3100495,
              darkturquoise: 52945,
              darkviolet: 9699539,
              deeppink: 16716947,
              deepskyblue: 49151,
              dimgray: 6908265,
              dimgrey: 6908265,
              dodgerblue: 2003199,
              firebrick: 11674146,
              floralwhite: 16775920,
              forestgreen: 2263842,
              fuchsia: 16711935,
              gainsboro: 14474460,
              ghostwhite: 16316671,
              gold: 16766720,
              goldenrod: 14329120,
              gray: 8421504,
              grey: 8421504,
              green: 32768,
              greenyellow: 11403055,
              honeydew: 15794160,
              hotpink: 16738740,
              indianred: 13458524,
              indigo: 4915330,
              ivory: 16777200,
              khaki: 15787660,
              lavender: 15132410,
              lavenderblush: 16773365,
              lawngreen: 8190976,
              lemonchiffon: 16775885,
              lightblue: 11393254,
              lightcoral: 15761536,
              lightcyan: 14745599,
              lightgoldenrodyellow: 16448210,
              lightgray: 13882323,
              lightgrey: 13882323,
              lightgreen: 9498256,
              lightpink: 16758465,
              lightsalmon: 16752762,
              lightseagreen: 2142890,
              lightskyblue: 8900346,
              lightslategray: 7833753,
              lightslategrey: 7833753,
              lightsteelblue: 11584734,
              lightyellow: 16777184,
              lime: 65280,
              limegreen: 3329330,
              linen: 16445670,
              magenta: 16711935,
              maroon: 8388608,
              mediumaquamarine: 6737322,
              mediumblue: 205,
              mediumorchid: 12211667,
              mediumpurple: 9662683,
              mediumseagreen: 3978097,
              mediumslateblue: 8087790,
              mediumspringgreen: 64154,
              mediumturquoise: 4772300,
              mediumvioletred: 13047173,
              midnightblue: 1644912,
              mintcream: 16121850,
              mistyrose: 16770273,
              moccasin: 16770229,
              navajowhite: 16768685,
              navy: 128,
              oldlace: 16643558,
              olive: 8421376,
              olivedrab: 7048739,
              orange: 16753920,
              orangered: 16729344,
              orchid: 14315734,
              palegoldenrod: 15657130,
              palegreen: 10025880,
              paleturquoise: 11529966,
              palevioletred: 14381203,
              papayawhip: 16773077,
              peachpuff: 16767673,
              peru: 13468991,
              pink: 16761035,
              plum: 14524637,
              powderblue: 11591910,
              purple: 8388736,
              rebeccapurple: 6697881,
              red: 16711680,
              rosybrown: 12357519,
              royalblue: 4286945,
              saddlebrown: 9127187,
              salmon: 16416882,
              sandybrown: 16032864,
              seagreen: 3050327,
              seashell: 16774638,
              sienna: 10506797,
              silver: 12632256,
              skyblue: 8900331,
              slateblue: 6970061,
              slategray: 7372944,
              slategrey: 7372944,
              snow: 16775930,
              springgreen: 65407,
              steelblue: 4620980,
              tan: 13808780,
              teal: 32896,
              thistle: 14204888,
              tomato: 16737095,
              turquoise: 4251856,
              violet: 15631086,
              wheat: 16113331,
              white: 16777215,
              whitesmoke: 16119285,
              yellow: 16776960,
              yellowgreen: 10145074
            }, h = {
              //names are in helix-sheet-coil order
              pyMol: { h: 16711680, s: 16776960, c: 65280 },
              Jmol: { h: 16711808, s: 16762880, c: 16777215 }
            }, c = {
              H: 16777215,
              He: 16761035,
              HE: 16761035,
              Li: 11674146,
              LI: 11674146,
              B: 65280,
              C: 13158600,
              N: 9408511,
              O: 15728640,
              F: 14329120,
              Na: 255,
              NA: 255,
              Mg: 2263842,
              MG: 2263842,
              Al: 8421520,
              AL: 8421520,
              Si: 14329120,
              SI: 14329120,
              P: 16753920,
              S: 16762930,
              Cl: 65280,
              CL: 65280,
              Ca: 8421520,
              CA: 8421520,
              Ti: 8421520,
              TI: 8421520,
              Cr: 8421520,
              CR: 8421520,
              Mn: 8421520,
              MN: 8421520,
              Fe: 16753920,
              FE: 16753920,
              Ni: 10824234,
              NI: 10824234,
              Cu: 10824234,
              CU: 10824234,
              Zn: 10824234,
              ZN: 10824234,
              Br: 10824234,
              BR: 10824234,
              Ag: 8421520,
              AG: 8421520,
              I: 10494192,
              Ba: 16753920,
              BA: 16753920,
              Au: 14329120,
              AU: 14329120
            }, d = {
              defaultColor: 16716947,
              /** Jmol-like element colors*/
              Jmol: {
                H: 16777215,
                He: 14286847,
                HE: 14286847,
                Li: 13402367,
                LI: 13402367,
                Be: 12779264,
                BE: 12779264,
                B: 16758197,
                C: 9474192,
                N: 3166456,
                O: 16715021,
                F: 9494608,
                Ne: 11789301,
                NE: 11789301,
                Na: 11230450,
                NA: 11230450,
                Mg: 9109248,
                MG: 9109248,
                Al: 12560038,
                AL: 12560038,
                Si: 1578e4,
                SI: 1578e4,
                P: 16744448,
                S: 16777008,
                Cl: 2093087,
                CL: 2093087,
                Ar: 8442339,
                AR: 8442339,
                K: 9388244,
                Ca: 4062976,
                CA: 4062976,
                Sc: 15132390,
                SC: 15132390,
                Ti: 12567239,
                TI: 12567239,
                V: 10921643,
                Cr: 9083335,
                CR: 9083335,
                Mn: 10255047,
                MN: 10255047,
                Fe: 14706227,
                FE: 14706227,
                Co: 15765664,
                CO: 15765664,
                Ni: 5296208,
                NI: 5296208,
                Cu: 13140019,
                CU: 13140019,
                Zn: 8224944,
                ZN: 8224944,
                Ga: 12750735,
                GA: 12750735,
                Ge: 6721423,
                GE: 6721423,
                As: 12419299,
                AS: 12419299,
                Se: 16752896,
                SE: 16752896,
                Br: 10889513,
                BR: 10889513,
                Kr: 6076625,
                KR: 6076625,
                Rb: 7351984,
                RB: 7351984,
                Sr: 65280,
                SR: 65280,
                Y: 9764863,
                Zr: 9756896,
                ZR: 9756896,
                Nb: 7586505,
                NB: 7586505,
                Mo: 5551541,
                MO: 5551541,
                Tc: 3907230,
                TC: 3907230,
                Ru: 2396047,
                RU: 2396047,
                Rh: 687500,
                RH: 687500,
                Pd: 27013,
                PD: 27013,
                Ag: 12632256,
                AG: 12632256,
                Cd: 16767375,
                CD: 16767375,
                In: 10909043,
                IN: 10909043,
                Sn: 6717568,
                SN: 6717568,
                Sb: 10380213,
                SB: 10380213,
                Te: 13924864,
                TE: 13924864,
                I: 9699476,
                Xe: 4366e3,
                XE: 4366e3,
                Cs: 5707663,
                CS: 5707663,
                Ba: 51456,
                BA: 51456,
                La: 7394559,
                LA: 7394559,
                Ce: 16777159,
                CE: 16777159,
                Pr: 14286791,
                PR: 14286791,
                Nd: 13107143,
                ND: 13107143,
                Pm: 10747847,
                PM: 10747847,
                Sm: 9437127,
                SM: 9437127,
                Eu: 6422471,
                EU: 6422471,
                Gd: 4587463,
                GD: 4587463,
                Tb: 3211207,
                TB: 3211207,
                Dy: 2097095,
                DY: 2097095,
                Ho: 65436,
                HO: 65436,
                Er: 58997,
                ER: 58997,
                Tm: 54354,
                TM: 54354,
                Yb: 48952,
                YB: 48952,
                Lu: 43812,
                LU: 43812,
                Hf: 5096191,
                HF: 5096191,
                Ta: 5089023,
                TA: 5089023,
                W: 2200790,
                Re: 2522539,
                RE: 2522539,
                Os: 2516630,
                OS: 2516630,
                Ir: 1528967,
                IR: 1528967,
                Pt: 13684960,
                PT: 13684960,
                Au: 16765219,
                AU: 16765219,
                Hg: 12105936,
                HG: 12105936,
                Tl: 10900557,
                TL: 10900557,
                Pb: 5724513,
                PB: 5724513,
                Bi: 10375093,
                BI: 10375093,
                Po: 11230208,
                PO: 11230208,
                At: 7688005,
                AT: 7688005,
                Rn: 4358806,
                RN: 4358806,
                Fr: 4325478,
                FR: 4325478,
                Ra: 32e3,
                RA: 32e3,
                Ac: 7384058,
                AC: 7384058,
                Th: 47871,
                TH: 47871,
                Pa: 41471,
                PA: 41471,
                U: 36863,
                Np: 33023,
                NP: 33023,
                Pu: 27647,
                PU: 27647,
                Am: 5528818,
                AM: 5528818,
                Cm: 7888099,
                CM: 7888099,
                Bk: 9064419,
                BK: 9064419,
                Cf: 10565332,
                CF: 10565332,
                Es: 11739092,
                ES: 11739092,
                Fm: 11739066,
                FM: 11739066,
                Md: 11734438,
                MD: 11734438,
                No: 12389767,
                NO: 12389767,
                Lr: 13041766,
                LR: 13041766,
                Rf: 13369433,
                RF: 13369433,
                Db: 13697103,
                DB: 13697103,
                Sg: 14221381,
                SG: 14221381,
                Bh: 14680120,
                BH: 14680120,
                Hs: 15073326,
                HS: 15073326,
                Mt: 15400998,
                MT: 15400998
              },
              /** rasmol-like element colors */
              rasmol: c,
              defaultColors: Object.assign({}, c),
              greenCarbon: Object.assign(Object.assign({}, c), { C: 65280 }),
              cyanCarbon: Object.assign(Object.assign({}, c), { C: 65535 }),
              magentaCarbon: Object.assign(Object.assign({}, c), { C: 16711935 }),
              yellowCarbon: Object.assign(Object.assign({}, c), { C: 16776960 }),
              whiteCarbon: Object.assign(Object.assign({}, c), { C: 16777215 }),
              orangeCarbon: Object.assign(Object.assign({}, c), { C: 16753920 }),
              purpleCarbon: Object.assign(Object.assign({}, c), { C: 8388736 }),
              blueCarbon: Object.assign(Object.assign({}, c), { C: 255 })
            }, _ = {
              /** @property standard amino acid color scheme*/
              amino: {
                ALA: 13158600,
                ARG: 1334015,
                ASN: 56540,
                ASP: 15075850,
                CYS: 15132160,
                GLN: 56540,
                GLU: 15075850,
                GLY: 15461355,
                HIS: 8553170,
                ILE: 1016335,
                LEU: 1016335,
                LYS: 1334015,
                MET: 15132160,
                PHE: 3289770,
                PRO: 14456450,
                SER: 16422400,
                THR: 16422400,
                TRP: 11819700,
                TYR: 3289770,
                VAL: 1016335,
                ASX: 16738740,
                GLX: 16738740
              },
              /** @property shapely amino acid color scheme*/
              shapely: {
                ALA: 9240460,
                ARG: 124,
                ASN: 16743536,
                ASP: 10485826,
                CYS: 16777072,
                GLN: 16731212,
                GLU: 6684672,
                GLY: 16777215,
                HIS: 7368959,
                ILE: 19456,
                LEU: 4546117,
                LYS: 4671416,
                MET: 12099650,
                PHE: 5459026,
                PRO: 5395026,
                SER: 16740418,
                THR: 12078080,
                TRP: 5195264,
                TYR: 9203788,
                VAL: 16747775,
                ASX: 16711935,
                GLX: 16711935
              },
              /** @property nucleic acid color scheme*/
              nucleic: {
                A: 10526975,
                G: 16740464,
                I: 8454143,
                C: 16747595,
                T: 10551200,
                U: 16744576
              }
            }, m = {
              /** @property chain based standard color scheme */
              atom: {
                A: 12636415,
                B: 11599792,
                C: 16761032,
                D: 16777088,
                E: 16761087,
                F: 11596016,
                G: 16765040,
                H: 15761536,
                I: 16113331,
                J: 49151,
                K: 13458524,
                L: 6737322,
                M: 10145074,
                N: 15631086,
                O: 52945,
                P: 65407,
                Q: 3978097,
                R: 139,
                S: 12433259,
                T: 25600,
                U: 8388608,
                V: 8421376,
                W: 8388736,
                X: 32896,
                Y: 12092939,
                Z: 11674146
              },
              /** @property hetatm color scheme */
              hetatm: {
                A: 9478351,
                B: 8441752,
                C: 13602992,
                D: 13619056,
                E: 13603023,
                F: 8437952,
                G: 13607008,
                H: 12603504,
                I: 12955267,
                J: 42959,
                K: 11881548,
                L: 5682578,
                M: 9090346,
                N: 12481214,
                O: 46753,
                P: 53103,
                Q: 3447649,
                R: 187,
                S: 10854235,
                T: 37888,
                U: 11534336,
                V: 11579392,
                W: 11534512,
                X: 45232,
                Y: 15250963,
                Z: 12726834
              }
            }, y = {
              /** secondary structure pymol */
              ssPyMol: { prop: "ss", map: h.pyMol },
              ssJmol: { prop: "ss", map: h.Jmol },
              Jmol: { prop: "elem", map: d.Jmol },
              amino: { prop: "resn", map: _.amino },
              shapely: { prop: "resn", map: _.shapely },
              nucleic: { prop: "resn", map: _.nucleic },
              chain: { prop: "chain", map: m.atom },
              rasmol: { prop: "elem", map: d.rasmol },
              default: { prop: "elem", map: d.defaultColors },
              greenCarbon: { prop: "elem", map: d.greenCarbon },
              chainHetatm: { prop: "chain", map: m.hetatm },
              cyanCarbon: { prop: "elem", map: d.cyanCarbon },
              magentaCarbon: { prop: "elem", map: d.magentaCarbon },
              purpleCarbon: { prop: "elem", map: d.purpleCarbon },
              whiteCarbon: { prop: "elem", map: d.whiteCarbon },
              orangeCarbon: { prop: "elem", map: d.orangeCarbon },
              yellowCarbon: { prop: "elem", map: d.yellowCarbon },
              blueCarbon: { prop: "elem", map: d.blueCarbon }
            };
          }
        ),
        /***/
        "./src/glcartoon.ts": (
          /*!**************************!*\
            !*** ./src/glcartoon.ts ***!
            \**************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              drawCartoon: () => (
                /* binding */
                z
              ),
              /* harmony export */
              subdivide_spline: () => (
                /* binding */
                m
              )
              /* harmony export */
            });
            var r = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), a = t(
              /*! ./WebGL/shapes */
              "./src/WebGL/shapes/index.ts"
            ), l = t(
              /*! ./WebGL */
              "./src/WebGL/index.ts"
            ), h = t(
              /*! ./Gradient */
              "./src/Gradient.ts"
            ), c = t(
              /*! ./colors */
              "./src/colors.ts"
            ), d = t(
              /*! ./GLDraw */
              "./src/GLDraw.ts"
            ), _ = t(
              /*! ./utilities */
              "./src/utilities.ts"
            );
            function m(O, R) {
              var N = [], W = O;
              W = [], W.push(O[0]);
              var B, P, G, H, U, j, re, ie, te;
              for (B = 1, P = O.length - 1; B < P; B++)
                if (U = O[B], j = O[B + 1], U.smoothen) {
                  var ue = new r.Vector3((U.x + j.x) / 2, (U.y + j.y) / 2, (U.z + j.z) / 2);
                  ue.atom = U.atom, W.push(ue);
                } else
                  W.push(U);
              for (W.push(O[O.length - 1]), B = -1, G = W.length; B <= G - 3; B++)
                if (H = W[B === -1 ? 0 : B], U = W[B + 1], j = W[B + 2], re = W[B === G - 3 ? G - 1 : B + 3], ie = new r.Vector3().subVectors(j, H).multiplyScalar(0.5), te = new r.Vector3().subVectors(re, U).multiplyScalar(0.5), !j.skip)
                  for (var de = 0; de < R; de++) {
                    var oe = 1 / R * de, J = U.x + oe * ie.x + oe * oe * (-3 * U.x + 3 * j.x - 2 * ie.x - te.x) + oe * oe * oe * (2 * U.x - 2 * j.x + ie.x + te.x), Ee = U.y + oe * ie.y + oe * oe * (-3 * U.y + 3 * j.y - 2 * ie.y - te.y) + oe * oe * oe * (2 * U.y - 2 * j.y + ie.y + te.y), se = U.z + oe * ie.z + oe * oe * (-3 * U.z + 3 * j.z - 2 * ie.z - te.z) + oe * oe * oe * (2 * U.z - 2 * j.z + ie.z + te.z), Ae = new r.Vector3(J, Ee, se);
                    de < R / 2 ? Ae.atom = U.atom : Ae.atom = j.atom, N.push(Ae);
                  }
              return N.push(W[W.length - 1]), N;
            }
            const y = 0.5, x = 1.3, b = 0.8, A = 0.4, f = 0.4;
            function s(O, R, N, W) {
              for (var B, P, G, H, U = 0, j = R.length; U < j; U++) {
                H = Math.round(U * (W.length - 1) / j), G = c.CC.color(W[H]);
                var re = O.updateGeoGroup(2), ie = re.vertexArray, te = re.colorArray, ue = re.faceArray;
                B = re.vertices, P = B * 3, ie[P] = R[U].x, ie[P + 1] = R[U].y, ie[P + 2] = R[U].z, ie[P + 3] = N[U].x, ie[P + 4] = N[U].y, ie[P + 5] = N[U].z;
                for (var de = 0; de < 6; ++de)
                  te[P + 3 * de] = G.r, te[P + 1 + 3 * de] = G.g, te[P + 2 + 3 * de] = G.b;
                if (U > 0) {
                  var oe = [B, B + 1, B - 1, B - 2], J = re.faceidx;
                  ue[J] = oe[0], ue[J + 1] = oe[1], ue[J + 2] = oe[3], ue[J + 3] = oe[1], ue[J + 4] = oe[2], ue[J + 5] = oe[3], re.faceidx += 6;
                }
                re.vertices += 2;
              }
            }
            function u(O, R, N, W, B, P, G) {
              var H, U, j, re;
              if (j = R.length, j < 2 || R[0].length < 2)
                return;
              for (H = 0; H < j; H++)
                R[H] = m(R[H], W);
              if (re = R[0].length, !B)
                return s(O, R[0], R[j - 1], N);
              var ie, te, ue, de, oe, J, Ee = [], se = [], Ae = [];
              for (U = 0; U < j; U++)
                Ee.push(0.25 + 1.5 * Math.sqrt((j - 1) * U - Math.pow(U, 2)) / (j - 1)), se.push(0.5), Ae.push(2 * (Math.pow(U / j, 2) - U / j) + 0.6);
              var he = [];
              for (U = 0; U < j * 2 - 1; U++)
                he[U] = [U, U + 1, U + 1 - 2 * j, U - 2 * j];
              he[j * 2 - 1] = [
                U,
                U + 1 - 2 * j,
                U + 1 - 4 * j,
                U - 2 * j
              ];
              var ne, _e, Le, Be, Ue, He, We, Ge, Ne, Pe;
              let Te = O.updateGeoGroup();
              for (H = 0; H < re; H++) {
                let Z = O.groups, ee = !1;
                Te = O.updateGeoGroup(2 * j), Z != O.groups && H > 0 && (H = H - 1, ee = !0), He = Math.round(H * (N.length - 1) / re), Ue = c.CC.color(N[He]), oe = ue, J = de, ue = [], de = [], ie = [], R[0][H].atom !== void 0 && (Be = R[0][H].atom, G === "oval" ? te = Ee : G === "rectangle" ? te = se : G === "parabola" && (te = Ae)), te || (te = se);
                var Me, De;
                for (U = 0; U < j; U++)
                  H < re - 1 ? Me = R[U][H + 1].clone().sub(R[U][H]) : Me = R[U][H - 1].clone().sub(R[U][H]).negate(), U < j - 1 ? De = R[U + 1][H].clone().sub(R[U][H]) : De = R[U - 1][H].clone().sub(R[U][H]).negate(), ie[U] = De.cross(Me).normalize().multiplyScalar(B * te[U]);
                for (U = 0; U < j; U++)
                  ue[U] = R[U][H].clone().add(ie[U].clone().negate());
                for (U = 0; U < j; U++)
                  de[U] = R[U][H].clone().add(ie[U]);
                for (We = Te.vertexArray, Ge = Te.colorArray, Ne = Te.faceArray, ne = Te.vertices, _e = ne * 3, U = 0; U < j; U++)
                  We[_e + 3 * U + 0] = ue[U].x, We[_e + 3 * U + 1] = ue[U].y, We[_e + 3 * U + 2] = ue[U].z;
                for (U = 0; U < j; U++)
                  We[_e + 3 * U + 0 + 3 * j] = de[j - 1 - U].x, We[_e + 3 * U + 1 + 3 * j] = de[j - 1 - U].y, We[_e + 3 * U + 2 + 3 * j] = de[j - 1 - U].z;
                for (U = 0; U < 2 * j; ++U)
                  Ge[_e + 3 * U + 0] = Ue.r, Ge[_e + 3 * U + 1] = Ue.g, Ge[_e + 3 * U + 2] = Ue.b;
                if (H > 0 && !ee) {
                  for (U = 0; U < j * 2; U++)
                    Pe = [
                      ne + he[U][0],
                      ne + he[U][1],
                      ne + he[U][2],
                      ne + he[U][3]
                    ], Le = Te.faceidx, Ne[Le] = Pe[0], Ne[Le + 1] = Pe[1], Ne[Le + 2] = Pe[3], Ne[Le + 3] = Pe[1], Ne[Le + 4] = Pe[2], Ne[Le + 5] = Pe[3], Te.faceidx += 6;
                  if (Be.clickable || Be.hoverable) {
                    var V = [];
                    V.push(new a.Triangle(oe[0], ue[0], ue[j - 1])), V.push(new a.Triangle(oe[0], ue[j - 1], oe[j - 1])), V.push(new a.Triangle(oe[j - 1], ue[j - 1], de[j - 1])), V.push(new a.Triangle(oe[j - 1], de[j - 1], J[j - 1])), V.push(new a.Triangle(de[0], J[0], J[j - 1])), V.push(new a.Triangle(de[j - 1], de[0], J[j - 1])), V.push(new a.Triangle(ue[0], oe[0], J[0])), V.push(new a.Triangle(de[0], ue[0], J[0]));
                    for (U in V)
                      Be.intersectionShape.triangle.push(V[U]);
                  }
                }
                Te.vertices += 2 * j;
              }
              for (We = Te.vertexArray, Ge = Te.colorArray, Ne = Te.faceArray, ne = Te.vertices, _e = ne * 3, Le = Te.faceidx, H = 0; H < j - 1; H++)
                Pe = [H, H + 1, 2 * j - 2 - H, 2 * j - 1 - H], Le = Te.faceidx, Ne[Le] = Pe[0], Ne[Le + 1] = Pe[1], Ne[Le + 2] = Pe[3], Ne[Le + 3] = Pe[1], Ne[Le + 4] = Pe[2], Ne[Le + 5] = Pe[3], Te.faceidx += 6;
              for (H = 0; H < j - 1; H++)
                Pe = [
                  ne - 1 - H,
                  ne - 2 - H,
                  ne - 2 * j + H + 1,
                  ne - 2 * j + H
                ], Le = Te.faceidx, Ne[Le] = Pe[0], Ne[Le + 1] = Pe[1], Ne[Le + 2] = Pe[3], Ne[Le + 3] = Pe[1], Ne[Le + 4] = Pe[2], Ne[Le + 5] = Pe[3], Te.faceidx += 6;
            }
            function p(O, R, N, W, B, P) {
              if (!(R.length < 2)) {
                var G, H;
                if (G = R[0], H = R[R.length - 1], G = m(G, W), H = m(H, W), !B)
                  return s(O, G, H, N);
                var U = [], j, re, ie, te, ue, de = [
                  [0, 2, -6, -8],
                  [-4, -2, 6, 4],
                  [7, -1, -5, 3],
                  [-3, 5, 1, -7]
                ], oe, J, Ee, se, Ae, he, ne, _e, Le, Be, Ue, He, We, Ge, Ne, Pe, Te;
                for (_e = 0, Le = G.length; _e < Le; _e++) {
                  if (Ae = Math.round(_e * (N.length - 1) / Le), se = c.CC.color(N[Ae]), U.push(re = G[_e]), U.push(re), U.push(ie = H[_e]), U.push(ie), _e < Le - 1) {
                    var Me = G[_e + 1].clone().sub(G[_e]), De = H[_e].clone().sub(G[_e]);
                    j = De.cross(Me).normalize().multiplyScalar(B);
                  }
                  for (U.push(te = G[_e].clone().add(j)), U.push(te), U.push(ue = H[_e].clone().add(j)), U.push(ue), re.atom !== void 0 && (he = re.atom), Ge = O.updateGeoGroup(8), Ne = Ge.vertexArray, Pe = Ge.colorArray, Te = Ge.faceArray, oe = Ge.vertices, J = oe * 3, Ne[J] = re.x, Ne[J + 1] = re.y, Ne[J + 2] = re.z, Ne[J + 3] = re.x, Ne[J + 4] = re.y, Ne[J + 5] = re.z, Ne[J + 6] = ie.x, Ne[J + 7] = ie.y, Ne[J + 8] = ie.z, Ne[J + 9] = ie.x, Ne[J + 10] = ie.y, Ne[J + 11] = ie.z, Ne[J + 12] = te.x, Ne[J + 13] = te.y, Ne[J + 14] = te.z, Ne[J + 15] = te.x, Ne[J + 16] = te.y, Ne[J + 17] = te.z, Ne[J + 18] = ue.x, Ne[J + 19] = ue.y, Ne[J + 20] = ue.z, Ne[J + 21] = ue.x, Ne[J + 22] = ue.y, Ne[J + 23] = ue.z, Be = 0; Be < 8; ++Be)
                    Pe[J + 3 * Be] = se.r, Pe[J + 1 + 3 * Be] = se.g, Pe[J + 2 + 3 * Be] = se.b;
                  if (_e > 0) {
                    var V = ne !== void 0 && he !== void 0 && ne.serial !== he.serial;
                    for (Be = 0; Be < 4; Be++) {
                      var Z = [
                        oe + de[Be][0],
                        oe + de[Be][1],
                        oe + de[Be][2],
                        oe + de[Be][3]
                      ];
                      if (Ee = Ge.faceidx, Te[Ee] = Z[0], Te[Ee + 1] = Z[1], Te[Ee + 2] = Z[3], Te[Ee + 3] = Z[1], Te[Ee + 4] = Z[2], Te[Ee + 5] = Z[3], Ge.faceidx += 6, he.clickable || ne.clickable || he.hoverable || ne.hoverable) {
                        var ee = U[Z[3]].clone(), ye = U[Z[0]].clone(), ce = U[Z[2]].clone(), Ie = U[Z[1]].clone();
                        if (ee.atom = U[Z[3]].atom || null, ce.atom = U[Z[2]].atom || null, ye.atom = U[Z[0]].atom || null, Ie.atom = U[Z[1]].atom || null, V) {
                          var ke = ee.clone().add(ye).multiplyScalar(0.5), Y = ce.clone().add(Ie).multiplyScalar(0.5), me = ee.clone().add(Ie).multiplyScalar(0.5);
                          Be % 2 === 0 ? ((ne.clickable || ne.hoverable) && (Ue = new a.Triangle(ke, me, ee), He = new a.Triangle(Y, ce, me), We = new a.Triangle(me, ce, ee), ne.intersectionShape.triangle.push(Ue), ne.intersectionShape.triangle.push(He), ne.intersectionShape.triangle.push(We)), (he.clickable || he.hoverable) && (Ue = new a.Triangle(ye, Ie, me), He = new a.Triangle(Ie, Y, me), We = new a.Triangle(ye, me, ke), he.intersectionShape.triangle.push(Ue), he.intersectionShape.triangle.push(He), he.intersectionShape.triangle.push(We))) : ((he.clickable || he.hoverable) && (Ue = new a.Triangle(ke, me, ee), He = new a.Triangle(Y, ce, me), We = new a.Triangle(me, ce, ee), he.intersectionShape.triangle.push(Ue), he.intersectionShape.triangle.push(He), he.intersectionShape.triangle.push(We)), (ne.clickable || ne.hoverable) && (Ue = new a.Triangle(ye, Ie, me), He = new a.Triangle(Ie, Y, me), We = new a.Triangle(ye, me, ke), ne.intersectionShape.triangle.push(Ue), ne.intersectionShape.triangle.push(He), ne.intersectionShape.triangle.push(We)));
                        } else (he.clickable || he.hoverable) && (Ue = new a.Triangle(ye, Ie, ee), He = new a.Triangle(Ie, ce, ee), he.intersectionShape.triangle.push(Ue), he.intersectionShape.triangle.push(He));
                      }
                    }
                  }
                  Ge.vertices += 8, ne = he;
                }
                var we = U.length - 8;
                for (Ge = O.updateGeoGroup(8), Ne = Ge.vertexArray, Pe = Ge.colorArray, Te = Ge.faceArray, oe = Ge.vertices, J = oe * 3, Ee = Ge.faceidx, _e = 0; _e < 4; _e++) {
                  U.push(U[_e * 2]), U.push(U[we + _e * 2]);
                  var Re = U[_e * 2], pe = U[we + _e * 2];
                  Ne[J + 6 * _e] = Re.x, Ne[J + 1 + 6 * _e] = Re.y, Ne[J + 2 + 6 * _e] = Re.z, Ne[J + 3 + 6 * _e] = pe.x, Ne[J + 4 + 6 * _e] = pe.y, Ne[J + 5 + 6 * _e] = pe.z, Pe[J + 6 * _e] = se.r, Pe[J + 1 + 6 * _e] = se.g, Pe[J + 2 + 6 * _e] = se.b, Pe[J + 3 + 6 * _e] = se.r, Pe[J + 4 + 6 * _e] = se.g, Pe[J + 5 + 6 * _e] = se.b;
                }
                we += 8, Ue = [oe, oe + 2, oe + 6, oe + 4], He = [oe + 1, oe + 5, oe + 7, oe + 3], Te[Ee] = Ue[0], Te[Ee + 1] = Ue[1], Te[Ee + 2] = Ue[3], Te[Ee + 3] = Ue[1], Te[Ee + 4] = Ue[2], Te[Ee + 5] = Ue[3], Te[Ee + 6] = He[0], Te[Ee + 7] = He[1], Te[Ee + 8] = He[3], Te[Ee + 9] = He[1], Te[Ee + 10] = He[2], Te[Ee + 11] = He[3], Ge.faceidx += 12, Ge.vertices += 8;
              }
            }
            function g(O, R, N, W, B, P, G) {
              (!G || G === "default") && (G = "rectangle"), G === "edged" ? p(O, R, N, W, B) : (G === "rectangle" || G === "oval" || G === "parabola") && u(O, R, N, W, B, P, G);
            }
            function w(O) {
              return O && O.elem === "C" && O.atom === "CA";
            }
            function o(O, R) {
              if (O && R && O.chain === R.chain) {
                if (!O.hetflag && !R.hetflag && O.reschain === R.reschain && (O.resi === R.resi || O.resi === R.resi - 1))
                  return !0;
                if (O.resi < R.resi) {
                  var N = O.x - R.x, W = O.y - R.y, B = O.z - R.z, P = N * N + W * W + B * B;
                  if (O.atom == "CA" && R.atom == "CA" && P < 16)
                    return !0;
                  if ((O.atom == "P" || R.atom == "P") && P < 64)
                    return !0;
                }
              }
              return !1;
            }
            function v(O, R, N, W, B) {
              if (!(R == null || R.vertices == 0)) {
                B && (R.initTypedArrays(), R.setUpNormals());
                var P = new l.MeshDoubleLambertMaterial();
                P.vertexColors = l.Coloring.FaceColors, typeof N == "number" && N >= 0 && N < 1 && (P.transparent = !0, P.opacity = N), P.outline = W;
                var G = new l.Mesh(R, P);
                O.add(G);
              }
            }
            function M(O, R, N, W, B, P, G, H, U) {
              var j, re, ie, te, ue, de;
              if (!(!W || !B || !G)) {
                var oe = B.sub(W);
                oe.normalize();
                var J = H[U];
                for (re = U + 1; re < H.length && (J = H[re], J.atom != G.atom); re++)
                  ;
                if (J = J ? new r.Vector3(J.x, J.y, J.z) : new r.Vector3(0, 0, 0), J.sub(W), G.ss === "arrow start") {
                  var Ee = J.clone().multiplyScalar(0.3).cross(B);
                  W.add(Ee);
                  var se = J.clone().cross(oe).normalize();
                  oe.rotateAboutVector(se, 0.43);
                }
                for (G.style.cartoon.ribbon ? j = G.style.cartoon.thickness || A : G.style.cartoon.width ? j = G.style.cartoon.width : G.ss === "c" ? G.atom === "P" ? j = b : j = y : G.ss === "arrow start" ? (j = x, ue = !0) : G.ss === "arrow end" || G.ss === "h" && G.style.cartoon.tubes || G.ss === "tube start" ? j = y : j = x, P != null && oe.dot(P) < 0 && oe.negate(), oe.multiplyScalar(j), re = 0; re < R; re++)
                  ie = -1 + re * 2 / (R - 1), te = new r.Vector3(W.x + ie * oe.x, W.y + ie * oe.y, W.z + ie * oe.z), te.atom = G, G.ss === "s" && (te.smoothen = !0), O[re].push(te);
                if (ue)
                  for (oe.multiplyScalar(2), re = 0; re < R; re++)
                    ie = -1 + re * 2 / (R - 1), te = new r.Vector3(W.x + ie * oe.x, W.y + ie * oe.y, W.z + ie * oe.z), te.atom = G, te.smoothen = !1, te.skip = !0, O[re].push(te);
                return de = G.style.cartoon.style || "default", O.style ? O.style != de && (console.log("Warning: a cartoon chain's strand-style is ambiguous"), O.style = "default") : O.style = de, (G.ss === "arrow start" || G.ss === "arrow end") && (G.ss = "s"), ue;
              }
            }
            const E = {
              C: !0,
              CA: !0,
              O: !0,
              P: !0,
              OP2: !0,
              O2P: !0,
              "O5'": !0,
              "O3'": !0,
              "C5'": !0,
              "C2'": !0,
              "O5*": !0,
              "O3*": !0,
              "C5*": !0,
              "C2*": !0,
              N1: !0,
              N3: !0
            }, $ = { DA: !0, DG: !0, A: !0, G: !0 }, k = { DT: !0, DC: !0, U: !0, C: !0, T: !0 }, L = { DA: !0, DG: !0, A: !0, G: !0, DT: !0, DC: !0, U: !0, C: !0, T: !0 };
            function z(O, R, N, W = 10) {
              let B = W, P = W;
              var G, H, U, j, re, ie, te, ue, de, oe, J, Ee, se, Ae, he, ne, _e, Le, Be = new l.Geometry(!0), Ue = new l.Geometry(!0), He = [], We = [], Ge = 1, Ne = !1, Pe = {};
              for (var Te in h.Gradient.builtinGradients)
                h.Gradient.builtinGradients.hasOwnProperty(Te) && (Pe[Te] = new h.Gradient.builtinGradients[Te](N[1], N[0]));
              var Me = function(X, ze) {
                return N && ze.color === "spectrum" ? ze.colorscheme in Pe ? Pe[ze.colorscheme].valueToHex(X.resi) : Pe.sinebow.valueToHex(X.resi) : (0, _.getColorFromStyle)(X, ze).getHex();
              };
              for (ue = 0; ue < B; ue++)
                We[ue] = [];
              var De = !1, V = !1, Z = [];
              for (ue in R) {
                if (j = R[ue], j.elem === "C" && j.atom === "CA") {
                  var ee = o(U, j);
                  ee && j.ss === "s" ? De = !0 : De && (U && H && U.style.cartoon.arrows && H.style.cartoon.arrows && (U.ss = "arrow end", H.ss = "arrow start"), De = !1), ee && (U.ss === "h" || U.ss == "tube start") && U.style.cartoon.tubes ? !V && U.ss != "tube start" && j.style.cartoon.tubes && (j.ss = "tube start", V = !0) : V && (U.ss === "tube start" ? U.ss = "tube end" : H && H.style.cartoon.tubes && (H.ss = "tube end"), V = !1), H = U, U = j;
                }
                j && j.atom in E && Z.push(j);
              }
              V && U.style.cartoon.tubes && (U.ss = "tube end", V = !1);
              var ye = function(X) {
                We[0].length > 0 && g(Ue, We, He, P, te, Ge, We.style);
                var ze = [], Ve = null;
                if (X) {
                  for (ue = 0; ue < B; ue++)
                    ze[ue] = We[ue][We[ue].length - 1];
                  Ve = He[He.length - 1];
                }
                for (We = [], ue = 0; ue < B; ue++)
                  We[ue] = [];
                if (He = [], X) {
                  for (ue = 0; ue < B; ue++)
                    We[ue].push(ze[ue]);
                  He.push(Ve);
                }
                v(O, Ue, Ge, Ne, !0), v(O, Be, Ge, Ne, !1), Ue = new l.Geometry(!0), Be = new l.Geometry(!0);
              };
              U = void 0;
              for (var ce = 0; ce < Z.length; ce++) {
                j = Z[ce];
                var Ie = j.resn.trim(), ke = Ie in L;
                if (Ge = 1, G = j.style.cartoon, U && U.style.cartoon && (Ge = U.style.cartoon.opacity), U && U.style.cartoon && U.style.cartoon.outline && (Ne = U.style.cartoon.outline), U && U.style.cartoon && (!j.style.cartoon || U.style.cartoon.opacity != j.style.cartoon.opacity) && ye(U.chain == j.chain), G.style === "trace") {
                  if (!j.hetflag) {
                    if (j.elem === "C" && j.atom === "CA" || ke && j.atom === "P" || j.atom === "BB") {
                      if (ie = Me(j, G), (0, _.isNumeric)(G.thickness) ? te = G.thickness : te = A, o(U, j))
                        if (ie == re) {
                          var Y = c.CC.color(ie);
                          d.GLDraw.drawCylinder(Be, U, j, te, Y, 2, 2);
                        } else {
                          var me = new r.Vector3().addVectors(U, j).multiplyScalar(0.5), we = c.CC.color(re), Re = c.CC.color(ie);
                          d.GLDraw.drawCylinder(Be, U, me, te, we, 2, 0), d.GLDraw.drawCylinder(Be, me, j, te, Re, 0, 2);
                        }
                      if ((j.clickable === !0 || j.hoverable) && j.intersectionShape !== void 0) {
                        var pe = new r.Vector3(j.x, j.y, j.z);
                        j.intersectionShape.sphere.push(new a.Sphere(pe, te));
                      }
                      U = j, re = ie;
                    }
                  }
                } else {
                  if (w(j) || ke && (j.atom === "P" || j.atom.indexOf("O5") == 0)) {
                    if (Le)
                      if (j.ss === "tube end")
                        Le = !1, _e = new r.Vector3(j.x, j.y, j.z), d.GLDraw.drawCylinder(Be, ne, _e, 2, c.CC.color(re), 1, 1), j.ss = "h";
                      else if (U.chain != j.chain || U.ss === "tube end")
                        Le = !1, U.ss = "h", _e = new r.Vector3(U.x, U.y, U.z), d.GLDraw.drawCylinder(Be, ne, _e, 2, c.CC.color(re), 1, 1);
                      else
                        continue;
                    if (U && (!o(U, j) || U.ss === "tube start")) {
                      for (U.ss === "tube start" && (Le = !0, ne = new r.Vector3(U.x, U.y, U.z), U.ss = "h"), he && (Ee ? Ae = new r.Vector3().addVectors(U, Ee).multiplyScalar(0.5) : Ae = new r.Vector3(U.x, U.y, U.z), d.GLDraw.drawCylinder(Be, Ae, he, f, c.CC.color(he.color), 0, 2), M(We, B, !0, Ee, se, J, U, Z, ce), He.push(ie), Ae = null, he = null), We[0].length > 0 && g(Ue, We, He, P, te, Ge, We.style), We = [], ue = 0; ue < B; ue++)
                        We[ue] = [];
                      He = [];
                    }
                    if (U === void 0 || U.rescode != j.rescode || U.resi != j.resi) {
                      if (he && U != null) {
                        Ae = new r.Vector3().addVectors(U, j).multiplyScalar(0.5);
                        var $e = Ae.clone().sub(he).multiplyScalar(0.02);
                        Ae.add($e), d.GLDraw.drawCylinder(Be, Ae, he, f, c.CC.color(he.color), 0, 2), Ae = null, he = null;
                      }
                      ie = Me(j, G), He.push(ie), (0, _.isNumeric)(G.thickness) ? te = G.thickness : te = A, U = j, de = new r.Vector3(U.x, U.y, U.z), de.resi = U.resi, re = ie;
                    }
                    (j.clickable === !0 || j.hoverable === !0) && (j.intersectionShape === void 0 || j.intersectionShape.triangle === void 0) && (j.intersectionShape = {
                      sphere: null,
                      cylinder: [],
                      line: [],
                      triangle: []
                    });
                  } else U != null && (w(U) && j.atom === "O" || ke && U.atom === "P" && (j.atom === "OP2" || j.atom === "O2P") || ke && U.atom.indexOf("O5") == 0 && j.atom.indexOf("C5") == 0) ? (oe = new r.Vector3(j.x, j.y, j.z), oe.resi = j.resi, (j.atom === "OP2" || j.atom === "O2P") && (se = new r.Vector3(j.x, j.y, j.z))) : ke && j.atom.indexOf("O3") == 0 ? Ee = new r.Vector3(j.x, j.y, j.z) : (j.atom === "N1" && Ie in $ || j.atom === "N3" && Ie in k) && (he = new r.Vector3(j.x, j.y, j.z), he.color = (0, _.getColorFromStyle)(j, G).getHex());
                  oe && de && oe.resi === de.resi && (M(We, B, !0, de, oe, J, U, Z, ce), J = oe, de = null, oe = null, He.push(ie));
                }
              }
              he && (Ee ? Ae = new r.Vector3().addVectors(U, Ee).multiplyScalar(0.5) : Ae = new r.Vector3(U.x, U.y, U.z), d.GLDraw.drawCylinder(Be, Ae, he, f, c.CC.color(he.color), 0, 2), M(We, B, !0, Ee, se, J, U, Z, ce), He.push(ie)), ye(!1);
            }
          }
        ),
        /***/
        "./src/index.ts": (
          /*!**********************!*\
            !*** ./src/index.ts ***!
            \**********************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CAP: () => (
                /* reexport safe */
                f.CAP
              ),
              /* harmony export */
              CC: () => (
                /* reexport safe */
                a.CC
              ),
              /* harmony export */
              CONTEXTS_PER_VIEWPORT: () => (
                /* reexport safe */
                p.CONTEXTS_PER_VIEWPORT
              ),
              /* harmony export */
              Color: () => (
                /* reexport safe */
                a.Color
              ),
              /* harmony export */
              CustomLinear: () => (
                /* reexport safe */
                r.CustomLinear
              ),
              /* harmony export */
              Cylinder: () => (
                /* reexport safe */
                _.Cylinder
              ),
              /* harmony export */
              GLDraw: () => (
                /* reexport safe */
                f.GLDraw
              ),
              /* harmony export */
              GLModel: () => (
                /* reexport safe */
                u.GLModel
              ),
              /* harmony export */
              GLShape: () => (
                /* reexport safe */
                A.GLShape
              ),
              /* harmony export */
              GLViewer: () => (
                /* reexport safe */
                p.GLViewer
              ),
              /* harmony export */
              GLVolumetricRender: () => (
                /* reexport safe */
                b.GLVolumetricRender
              ),
              /* harmony export */
              Gradient: () => (
                /* reexport safe */
                r.Gradient
              ),
              /* harmony export */
              GradientType: () => (
                /* reexport safe */
                r.GradientType
              ),
              /* harmony export */
              Label: () => (
                /* reexport safe */
                l.Label
              ),
              /* harmony export */
              LabelCount: () => (
                /* reexport safe */
                l.LabelCount
              ),
              /* harmony export */
              MarchingCube: () => (
                /* reexport safe */
                y.MarchingCube
              ),
              /* harmony export */
              MarchingCubeInitializer: () => (
                /* reexport safe */
                y.MarchingCubeInitializer
              ),
              /* harmony export */
              Matrix3: () => (
                /* reexport safe */
                d.Matrix3
              ),
              /* harmony export */
              Matrix4: () => (
                /* reexport safe */
                d.Matrix4
              ),
              /* harmony export */
              Parsers: () => (
                /* reexport safe */
                c.Parsers
              ),
              /* harmony export */
              PausableTimer: () => (
                /* reexport safe */
                m.PausableTimer
              ),
              /* harmony export */
              PointGrid: () => (
                /* reexport safe */
                y.PointGrid
              ),
              /* harmony export */
              ProteinSurface: () => (
                /* reexport safe */
                y.ProteinSurface
              ),
              /* harmony export */
              Quaternion: () => (
                /* reexport safe */
                d.Quaternion
              ),
              /* harmony export */
              ROYGB: () => (
                /* reexport safe */
                r.ROYGB
              ),
              /* harmony export */
              RWB: () => (
                /* reexport safe */
                r.RWB
              ),
              /* harmony export */
              Ray: () => (
                /* reexport safe */
                d.Ray
              ),
              /* harmony export */
              Sinebow: () => (
                /* reexport safe */
                r.Sinebow
              ),
              /* harmony export */
              Sphere: () => (
                /* reexport safe */
                _.Sphere
              ),
              /* harmony export */
              SurfaceType: () => (
                /* reexport safe */
                y.SurfaceType
              ),
              /* harmony export */
              Triangle: () => (
                /* reexport safe */
                _.Triangle
              ),
              /* harmony export */
              Vector2: () => (
                /* reexport safe */
                d.Vector2
              ),
              /* harmony export */
              Vector3: () => (
                /* reexport safe */
                d.Vector3
              ),
              /* harmony export */
              VolumeData: () => (
                /* reexport safe */
                x.VolumeData
              ),
              /* harmony export */
              adjustVolumeStyle: () => (
                /* reexport safe */
                m.adjustVolumeStyle
              ),
              /* harmony export */
              applyPartialCharges: () => (
                /* reexport safe */
                h.applyPartialCharges
              ),
              /* harmony export */
              autoinit: () => (
                /* reexport safe */
                g.autoinit
              ),
              /* harmony export */
              autoload: () => (
                /* reexport safe */
                g.autoload
              ),
              /* harmony export */
              base64ToArray: () => (
                /* reexport safe */
                m.base64ToArray
              ),
              /* harmony export */
              bondLength: () => (
                /* reexport safe */
                c.bondLength
              ),
              /* harmony export */
              builtinColorSchemes: () => (
                /* reexport safe */
                a.builtinColorSchemes
              ),
              /* harmony export */
              builtinGradients: () => (
                /* reexport safe */
                r.builtinGradients
              ),
              /* harmony export */
              chains: () => (
                /* reexport safe */
                a.chains
              ),
              /* harmony export */
              clamp: () => (
                /* reexport safe */
                d.clamp
              ),
              /* harmony export */
              conversionMatrix3: () => (
                /* reexport safe */
                d.conversionMatrix3
              ),
              /* harmony export */
              createStereoViewer: () => (
                /* reexport safe */
                p.createStereoViewer
              ),
              /* harmony export */
              createViewer: () => (
                /* reexport safe */
                p.createViewer
              ),
              /* harmony export */
              createViewerGrid: () => (
                /* reexport safe */
                p.createViewerGrid
              ),
              /* harmony export */
              deepCopy: () => (
                /* reexport safe */
                m.deepCopy
              ),
              /* harmony export */
              degToRad: () => (
                /* reexport safe */
                d.degToRad
              ),
              /* harmony export */
              download: () => (
                /* reexport safe */
                m.download
              ),
              /* harmony export */
              drawCartoon: () => (
                /* reexport safe */
                s.drawCartoon
              ),
              /* harmony export */
              elementColors: () => (
                /* reexport safe */
                a.elementColors
              ),
              /* harmony export */
              extend: () => (
                /* reexport safe */
                m.extend
              ),
              /* harmony export */
              get: () => (
                /* reexport safe */
                m.get
              ),
              /* harmony export */
              getAtomProperty: () => (
                /* reexport safe */
                m.getAtomProperty
              ),
              /* harmony export */
              getColorFromStyle: () => (
                /* reexport safe */
                m.getColorFromStyle
              ),
              /* harmony export */
              getElement: () => (
                /* reexport safe */
                m.getElement
              ),
              /* harmony export */
              getExtent: () => (
                /* reexport safe */
                m.getExtent
              ),
              /* harmony export */
              getGradient: () => (
                /* reexport safe */
                r.getGradient
              ),
              /* harmony export */
              getPropertyRange: () => (
                /* reexport safe */
                m.getPropertyRange
              ),
              /* harmony export */
              getbin: () => (
                /* reexport safe */
                m.getbin
              ),
              /* harmony export */
              htmlColors: () => (
                /* reexport safe */
                a.htmlColors
              ),
              /* harmony export */
              inflateString: () => (
                /* reexport safe */
                m.inflateString
              ),
              /* harmony export */
              isEmptyObject: () => (
                /* reexport safe */
                m.isEmptyObject
              ),
              /* harmony export */
              isNumeric: () => (
                /* reexport safe */
                m.isNumeric
              ),
              /* harmony export */
              makeFunction: () => (
                /* reexport safe */
                m.makeFunction
              ),
              /* harmony export */
              mergeGeos: () => (
                /* reexport safe */
                m.mergeGeos
              ),
              /* harmony export */
              normalizeValue: () => (
                /* reexport safe */
                r.normalizeValue
              ),
              /* harmony export */
              partialCharges: () => (
                /* reexport safe */
                h.partialCharges
              ),
              /* harmony export */
              processing_autoinit: () => (
                /* reexport safe */
                g.processing_autoinit
              ),
              /* harmony export */
              residues: () => (
                /* reexport safe */
                a.residues
              ),
              /* harmony export */
              setBondLength: () => (
                /* reexport safe */
                c.setBondLength
              ),
              /* harmony export */
              setSyncSurface: () => (
                /* reexport safe */
                y.setSyncSurface
              ),
              /* harmony export */
              specStringToObject: () => (
                /* reexport safe */
                m.specStringToObject
              ),
              /* harmony export */
              splitMesh: () => (
                /* reexport safe */
                A.splitMesh
              ),
              /* harmony export */
              ssColors: () => (
                /* reexport safe */
                a.ssColors
              ),
              /* harmony export */
              subdivide_spline: () => (
                /* reexport safe */
                s.subdivide_spline
              ),
              /* harmony export */
              syncSurface: () => (
                /* reexport safe */
                y.syncSurface
              ),
              /* harmony export */
              viewers: () => (
                /* reexport safe */
                g.viewers
              )
              /* harmony export */
            });
            var r = t(
              /*! ./Gradient */
              "./src/Gradient.ts"
            ), a = t(
              /*! ./colors */
              "./src/colors.ts"
            ), l = t(
              /*! ./Label */
              "./src/Label.ts"
            ), h = t(
              /*! ./partialCharges */
              "./src/partialCharges.ts"
            ), c = t(
              /*! ./parsers */
              "./src/parsers/index.ts"
            ), d = t(
              /*! ./WebGL/math */
              "./src/WebGL/math/index.ts"
            ), _ = t(
              /*! ./WebGL/shapes */
              "./src/WebGL/shapes/index.ts"
            ), m = t(
              /*! ./utilities */
              "./src/utilities.ts"
            ), y = t(
              /*! ./ProteinSurface4 */
              "./src/ProteinSurface4.ts"
            ), x = t(
              /*! ./VolumeData */
              "./src/VolumeData.ts"
            ), b = t(
              /*! ./VolumetricRender */
              "./src/VolumetricRender.ts"
            ), A = t(
              /*! ./GLShape */
              "./src/GLShape.ts"
            ), f = t(
              /*! ./GLDraw */
              "./src/GLDraw.ts"
            ), s = t(
              /*! ./glcartoon */
              "./src/glcartoon.ts"
            ), u = t(
              /*! ./GLModel */
              "./src/GLModel.ts"
            ), p = t(
              /*! ./GLViewer */
              "./src/GLViewer.ts"
            ), g = t(
              /*! ./autoload */
              "./src/autoload.ts"
            );
            t(
              /*! ./specs */
              "./src/specs.ts"
            ), window && (window.$3Dmol = e);
          }
        ),
        /***/
        "./src/parsers/BCIF.ts": (
          /*!*****************************!*\
            !*** ./src/parsers/BCIF.ts ***!
            \*****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              BCIF: () => (
                /* binding */
                A
              )
              /* harmony export */
            });
            var r = t(
              /*! ../utilities */
              "./src/utilities.ts"
            ), a = t(
              /*! ./utils/computeSecondaryStructure */
              "./src/parsers/utils/computeSecondaryStructure.ts"
            ), l = t(
              /*! ./utils/processSymmetries */
              "./src/parsers/utils/processSymmetries.ts"
            ), h = t(
              /*! ./cifutils/category */
              "./src/parsers/cifutils/category.ts"
            ), c = t(
              /*! ./utils/assignPDBBonds */
              "./src/parsers/utils/assignPDBBonds.ts"
            ), d = t(
              /*! ../WebGL */
              "./src/WebGL/index.ts"
            ), _ = t(
              /*! ./utils/isEmpty */
              "./src/parsers/utils/isEmpty.ts"
            ), m = t(
              /*! ./src/vendor/mmtf.js */
              "./src/vendor/mmtf.js"
            );
            class y {
              constructor(s) {
                if (this.C = {}, s) {
                  let u = s.getField("comp_id"), p = s.getField("atom_id_1"), g = s.getField("atom_id_2"), w = s.getField("value_order");
                  for (let o = 0; o < u.length; o++) {
                    let v = u[o], M = p[o], E = g[o], $ = w[o], k = 1;
                    $ == "doub" ? k = 2 : $ == "trip" && (k = 3), this.C[v] == null && (this.C[v] = {}), this.C[v][M] == null && (this.C[v][M] = {}), this.C[v][E] == null && (this.C[v][E] = {}), this.C[v][M][E] = k, this.C[v][E][M] = k;
                  }
                }
              }
              //returns bond order, zero if not connected
              order(s, u, p) {
                return this.C[s] !== void 0 && this.C[s][u] !== void 0 && this.C[s][u][p] !== void 0 ? this.C[s][u][p] : 0;
              }
            }
            class x {
              constructor(s) {
                if (this.C = [], s) {
                  let u = s.getField("conn_type_id"), p = s.getField("ptnr1_label_asym_id"), g = s.getField("ptnr1_label_seq_id"), w = s.getField("ptnr1_label_comp_id"), o = s.getField("ptnr1_label_atom_id"), v = s.getField("ptnr2_label_asym_id"), M = s.getField("ptnr2_label_seq_id"), E = s.getField("ptnr2_label_comp_id"), $ = s.getField("ptnr2_label_atom_id"), k = s.getField("pdbx_value_order");
                  for (let L = 0; L < u.length; L++)
                    if (u[L] == "disulf" || u[L] == "covale") {
                      let z = k ? k[L] == "" ? 1 : parseInt(k[L]) : 1;
                      this.C.push([[p[L], g[L], w[L], o[L]], [v[L], M[L], E[L], $[L]], z]);
                    }
                }
              }
            }
            class b {
              constructor() {
                this.R = {};
              }
              add(s) {
                this.R[s.lchain] == null && (this.R[s.lchain] = {}), this.R[s.lchain][s.lresi] == null && (this.R[s.lchain][s.lresi] = {}), this.R[s.lchain][s.lresi][s.lresn] == null && (this.R[s.lchain][s.lresi][s.lresn] = []), this.R[s.lchain][s.lresi][s.lresn].push(s), this.R[s.lchain][s.lresi][s.lresn][s.atom] = s;
              }
              geta([s, u, p, g]) {
                if (this.R[s] !== void 0 && this.R[s][u] !== void 0 && this.R[s][u][p] !== void 0)
                  return this.R[s][u][p][g];
              }
              setBonds(s, u) {
                for (let p in this.R)
                  for (let g in this.R[p])
                    for (let w in this.R[p][g]) {
                      let o = this.R[p][g][w];
                      for (let v = 0; v < o.length; v++)
                        for (let M = v + 1; M < o.length; M++) {
                          let E = o[v], $ = o[M], k = s.order(w, E.atom, $.atom);
                          k > 0 && (E.bonds.push($.index), $.bonds.push(E.index), E.bondOrder.push(k), $.bondOrder.push(k));
                        }
                    }
                for (let p of u.C) {
                  let g = p[0], w = p[1], o = p[2], v = this.geta(g), M = this.geta(w);
                  v != null && M != null && (v.bonds.push(M.index), M.bonds.push(v.index), v.bondOrder.push(o), M.bondOrder.push(o));
                }
              }
            }
            function A(f, s) {
              var u = !s.keepH, p = s.altLoc ? s.altLoc : "A", g = !s.noComputeSecondaryStructure;
              const w = !s.doAssembly, o = s.assignBonds === void 0 ? !0 : s.assignBonds;
              if (typeof f == "string")
                try {
                  f = (0, r.base64ToArray)(f);
                } catch {
                  f = new TextEncoder().encode(f);
                }
              else
                f = new Uint8Array(f);
              var v = m.decodeMsgpack(f);
              v == 31 && (f = (0, r.inflateString)(f, !1), v = m.decodeMsgpack(f));
              var M = [], E = M.modelData = [], $ = v.dataBlocks.length;
              if ($ == 0)
                return M;
              s.multimodel || ($ = 1);
              for (let k = 0; k < $; k++) {
                let L = M.length;
                const z = [];
                E.push({ symmetries: [] }), M.push([]);
                const O = v.dataBlocks[k], R = /* @__PURE__ */ Object.create(null);
                for (const Pe of O.categories)
                  R[Pe.name.substr(1)] = (0, h.Category)(Pe);
                let N = {}, W = R.struct_conf;
                if (W) {
                  let Pe = W.getField("conf_type_id"), Te = W.getField("beg_label_asym_id"), Me = W.getField("beg_label_seq_id"), De = W.getField("end_label_seq_id");
                  for (let V = 0; V < Pe.length; V++)
                    if (Pe[V].startsWith("H")) {
                      let Z = Te[V], ee = Me[V], ye = De[V];
                      Z in N || (N[Z] = {}), N[Z][ee] = "h1";
                      for (let ce = ee + 1; ce < ye; ce++)
                        N[Z][ce] = "h";
                      N[Z][ye] = "h2";
                    }
                }
                let B = R.struct_sheet_range;
                if (B) {
                  let Pe = B.getField("id"), Te = B.getField("beg_label_asym_id"), Me = B.getField("beg_label_seq_id"), De = B.getField("end_label_seq_id");
                  for (let V = 0; V < Pe.length; V++) {
                    let Z = Te[V], ee = Me[V], ye = De[V];
                    Z in N || (N[Z] = {}), N[Z][ee] = "s1";
                    for (let ce = ee + 1; ce < ye; ce++)
                      N[Z][ce] = "s";
                    N[Z][ye] = "s2";
                  }
                }
                let P = R.pdbx_struct_oper_list, G = P.getField("id");
                if (G && !w) {
                  let Pe = P.getField("matrix[1][1]"), Te = P.getField("matrix[1][2]"), Me = P.getField("matrix[1][3]"), De = P.getField("matrix[2][1]"), V = P.getField("matrix[2][2]"), Z = P.getField("matrix[2][3]"), ee = P.getField("matrix[3][1]"), ye = P.getField("matrix[3][2]"), ce = P.getField("matrix[3][3]"), Ie = P.getField("vector[1]"), ke = P.getField("vector[2]"), Y = P.getField("vector[3]");
                  for (let me = 0; me < G.length; me++) {
                    const we = new d.Matrix4(Pe[me], Te[me], Me[me], Ie[me], De[me], V[me], Z[me], ke[me], ee[me], ye[me], ce[me], Y[me]);
                    E[E.length - 1].symmetries.push(we);
                  }
                }
                let H = new y(R.chem_comp_bond), U = new b(), j = new x(R.struct_conn), re = R.atom_site, ie = re.rowCount, te = re.getField("group_PDB"), ue = re.getField("Cartn_x"), de = re.getField("Cartn_y"), oe = re.getField("Cartn_z"), J = re.getField("auth_asym_id"), Ee = re.getField("label_asym_id"), se = re.getField("auth_seq_id"), Ae = re.getField("label_seq_id"), he = re.getField("auth_comp_id"), ne = re.getField("label_comp_id"), _e = re.getField("auth_atom_id"), Le = re.getField("label_atom_id"), Be = re.getField("type_symbol"), Ue = re.getField("B_iso_or_equiv"), He = re.getField("id"), We = re.getField("label_alt_id"), Ge = re.getField("pdbx_PDB_model_num"), Ne = Ge ? Ge[0] : 0;
                for (let Pe = 0; Pe < ie; Pe++) {
                  if (te !== void 0 && te[Pe] === "TER")
                    continue;
                  if (Ge && Ge[Pe] != Ne)
                    if (Ne = Ge[Pe], s.multimodel)
                      s.onemol || (M.push([]), E.push(E[E.length - 1]), Ne = Ge[Pe], U.setBonds(H, j), U = new b());
                    else
                      break;
                  const Te = {};
                  Te.x = ue[Pe], Te.y = de[Pe], Te.z = oe[Pe], Te.chain = J ? J[Pe] : Ee ? Ee[Pe] : void 0, Te.lchain = Ee ? Ee[Pe] : void 0, Te.resi = se ? se[Pe] : Ae ? Ae[Pe] : void 0, Te.lresi = Ae ? Ae[Pe] : void 0, Te.resn = he ? he[Pe].trim() : ne ? ne[Pe].trim() : void 0, Te.lresn = ne ? ne[Pe].trim() : void 0, Te.atom = _e ? _e[Pe].replace(/"/gm, "") : Le ? Le[Pe].replace(/"/gm, "") : void 0, Te.icode = We ? We[Pe] : void 0, Te.altLoc = Te.icode, Te.hetflag = !te || te[Pe] === "HETA" || te[Pe] === "HETATM";
                  let Me = "X";
                  Be && (Me = Be[Pe].replace(/\(?\+?\d+.*/, "")), Te.elem = Me[0].toUpperCase() + Me.substring(1, 2).toLowerCase(), Ue && (Te.b = Ue[Pe]), !(u && Te.elem == "H") && (Te.altLoc != "" && Te.altLoc != p && p != "*" || (Te.bonds = [], Te.ss = "c", Te.serial = He[Pe], Te.model = Ne, Te.bondOrder = [], Te.properties = {}, Te.index = M[M.length - 1].length, z[Te.serial] = [M.length, Te.index], M[M.length - 1].push(Te), U.add(Te)));
                }
                if (U.setBonds(H, j), !(0, _.isEmpty)(N))
                  for (let Pe = L; Pe < M.length; Pe++) {
                    let Te = M[Pe];
                    for (let Me = 0; Me < Te.length; Me++) {
                      const De = Te[Me];
                      if (De !== void 0 && De.lchain in N && De.lresi in N[De.lchain]) {
                        const V = N[De.lchain][De.lresi];
                        De.ss = V[0], V.length > 1 && (V[1] == "1" ? De.ssbegin = !0 : V[1] == "2" && (De.ssend = !0));
                      }
                    }
                  }
                s.multimodel && k < $ - 1 && (s.onemol || (M.push([]), E.push({ symmetries: [] })));
              }
              for (let k = 0; k < M.length; k++)
                o && !(s.duplicateAssemblyAtoms && !s.dontConnectDuplicatedAtoms) && (0, c.assignPDBBonds)(M[k], s), g && (0, a.computeSecondaryStructure)(M[k], s.hbondCutoff), (0, l.processSymmetries)(E[k].symmetries, M[k], s, E[k].cryst), s.duplicateAssemblyAtoms && !s.dontConnectDuplicatedAtoms && o && (0, c.assignPDBBonds)(M[k], s);
              return M;
            }
          }
        ),
        /***/
        "./src/parsers/CDJSON.ts": (
          /*!*******************************!*\
            !*** ./src/parsers/CDJSON.ts ***!
            \*******************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CDJSON: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            function r(a, l) {
              var h = [[]];
              typeof a == "string" && (a = JSON.parse(a));
              for (var c = a.m, d = c[0].a, _ = c[0].b, m = c[0].s, y = l !== void 0 && l.parseStyle !== void 0 ? l.parseStyle : m !== void 0, x = h[h.length - 1].length, b = 0; b < d.length; b++) {
                var A = d[b], f = {};
                f.id = A.i, f.x = A.x, f.y = A.y, f.z = A.z || 0, f.bonds = [], f.bondOrder = [];
                var s = A.l || "C";
                f.elem = s[0].toUpperCase() + s.substring(1).toLowerCase(), f.serial = h[h.length - 1].length, y && (f.style = m[A.s || 0]), h[h.length - 1].push(f);
              }
              for (let u = 0; u < _.length; u++) {
                let p = _[u], g = p.b + x, w = p.e + x, o = p.o || 1, v = h[h.length - 1][g], M = h[h.length - 1][w];
                v.bonds.push(w), v.bondOrder.push(o), M.bonds.push(g), M.bondOrder.push(o);
              }
              return h;
            }
          }
        ),
        /***/
        "./src/parsers/CIF.ts": (
          /*!****************************!*\
            !*** ./src/parsers/CIF.ts ***!
            \****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CIF: () => (
                /* binding */
                d
              )
              /* harmony export */
            });
            var r = t(
              /*! ./utils/computeSecondaryStructure */
              "./src/parsers/utils/computeSecondaryStructure.ts"
            ), a = t(
              /*! ./utils/processSymmetries */
              "./src/parsers/utils/processSymmetries.ts"
            ), l = t(
              /*! ../WebGL */
              "./src/WebGL/index.ts"
            ), h = t(
              /*! ./utils/assignPDBBonds */
              "./src/parsers/utils/assignPDBBonds.ts"
            );
            const c = function(_, m, y, x) {
              return new l.Vector3(m, y, x).applyMatrix3(_);
            };
            function d(_, m = {}) {
              const y = [], x = !m.doAssembly, b = y.modelData = [], A = m.assignBonds === void 0 ? !0 : m.assignBonds;
              function f(o, v) {
                const M = [];
                let E = 0, $ = 0;
                for (; $ < o.length; ) {
                  for (; o.substring($, $ + v.length) !== v && $ < o.length; )
                    if (o[$] === "'") {
                      for ($++; $ < o.length && o[$] !== "'"; )
                        $++;
                      for (; o.substring($, $ + v.length) !== v && $ < o.length; )
                        $++;
                    } else if (o[$] === '"') {
                      for ($++; $ < o.length && o[$] !== '"'; )
                        $++;
                      $++;
                    } else
                      $++;
                  M.push(o.substring(E, $)), E = $ = $ + v.length;
                }
                return M;
              }
              const s = _.split(/\r?\n|\r/), u = [];
              let p = !1;
              for (let o = 0; o < s.length; o++) {
                var g = s[o].split("#")[0];
                if (p ? g[0] === ";" && (p = !1) : g[0] === ";" && (p = !0), p || g !== "") {
                  if (!p && (g = g.trim(), g[0] === "_")) {
                    const v = g.split(/\s/)[0].indexOf(".");
                    if (v > -1) {
                      let M = g.split("");
                      M[v] = "_", g = M.join(""), g = g.substring(0, v) + "_" + g.substring(v + 1);
                    }
                  }
                  u.push(g);
                }
              }
              let w = 0;
              for (; w < u.length; ) {
                for (; !u[w].startsWith("data_") || u[w] === "data_global"; )
                  w++;
                w++;
                const o = {};
                for (; w < u.length && !u[w].startsWith("data_"); )
                  if (u[w][0] === void 0)
                    w++;
                  else if (u[w][0] === "_") {
                    const $ = u[w].split(/\s/)[0].toLowerCase(), k = o[$] = o[$] || [], L = u[w].substring(u[w].indexOf($) + $.length);
                    if (L === "")
                      if (w++, u[w][0] === ";") {
                        let z = u[w].substring(1);
                        for (w++; u[w] !== ";"; )
                          z = z + `
` + u[w], w++;
                        k.push(z);
                      } else
                        k.push(u[w]);
                    else
                      k.push(L.trim());
                    w++;
                  } else if (u[w].substring(0, 5) === "loop_") {
                    w++;
                    const $ = [];
                    for (; u[w] === "" || u[w][0] === "_"; ) {
                      if (u[w] !== "") {
                        let L = u[w].split(/\s/)[0].toLowerCase(), z = o[L] = o[L] || [];
                        $.push(z);
                      }
                      w++;
                    }
                    let k = 0;
                    for (; w < u.length && u[w][0] !== "_" && !u[w].startsWith("loop_") && !u[w].startsWith("data_"); ) {
                      let L = f(u[w], " ");
                      for (let z = 0; z < L.length; z++)
                        L[z] !== "" && ($[k].push(L[z]), k = (k + 1) % $.length);
                      w++;
                    }
                  } else
                    w++;
                b.push({ symmetries: [] }), y.push([]);
                const v = o._atom_site_id !== void 0 ? o._atom_site_id.length : o._atom_site_label.length;
                let M;
                if (o._cell_length_a !== void 0) {
                  const $ = parseFloat(o._cell_length_a), k = parseFloat(o._cell_length_b), L = parseFloat(o._cell_length_c), z = parseFloat(o._cell_angle_alpha) || 90, O = parseFloat(o._cell_angle_beta) || 90, R = parseFloat(o._cell_angle_gamma) || 90;
                  M = (0, l.conversionMatrix3)($, k, L, z, O, R), b[b.length - 1].cryst = {
                    a: $,
                    b: k,
                    c: L,
                    alpha: z,
                    beta: O,
                    gamma: R
                  };
                }
                for (let $ = 0; $ < v; $++) {
                  if (o._atom_site_group_pdb !== void 0 && o._atom_site_group_pdb[$] === "TER")
                    continue;
                  const k = {};
                  if (o._atom_site_cartn_x !== void 0)
                    k.x = parseFloat(o._atom_site_cartn_x[$]), k.y = parseFloat(o._atom_site_cartn_y[$]), k.z = parseFloat(o._atom_site_cartn_z[$]);
                  else {
                    const z = c(M, parseFloat(o._atom_site_fract_x[$]), parseFloat(o._atom_site_fract_y[$]), parseFloat(o._atom_site_fract_z[$]));
                    k.x = z.x, k.y = z.y, k.z = z.z;
                  }
                  k.chain = o._atom_site_auth_asym_id ? o._atom_site_auth_asym_id[$] : o._atom_site_label_asym_id ? o._atom_site_label_asym_id[$] : void 0, k.resi = o._atom_site_auth_seq_id ? parseInt(o._atom_site_auth_seq_id[$]) : o._atom_site_label_seq_id ? o._atom_site_label_seq_id[$] : void 0, k.resn = o._atom_site_auth_comp_id ? o._atom_site_auth_comp_id[$].trim() : o._atom_site_label_comp_id ? o._atom_site_label_comp_id[$].trim() : void 0, k.atom = o._atom_site_auth_atom_id ? o._atom_site_auth_atom_id[$].replace(/"/gm, "") : o._atom_site_label_atom_id ? o._atom_site_label_atom_id[$].replace(/"/gm, "") : void 0, k.hetflag = !o._atom_site_group_pdb || o._atom_site_group_pdb[$] === "HETA" || o._atom_site_group_pdb[$] === "HETATM", o._atom_site_b_iso_or_equiv && (k.b = parseFloat(o._atom_site_b_iso_or_equiv[$]));
                  let L = "X";
                  o._atom_site_type_symbol ? L = o._atom_site_type_symbol[$].replace(/\(?\+?\d+.*/, "") : o._atom_site_label && (L = o._atom_site_label[$].split("_")[0].replace(/\(?\d+.*/, "")), k.elem = L[0].toUpperCase() + L.substring(1, 2).toLowerCase(), k.bonds = [], k.ss = "c", k.serial = $, k.bondOrder = [], k.properties = {}, y[y.length - 1].push(k);
                }
                if (o._pdbx_struct_oper_list_id !== void 0 && !x)
                  for (let $ = 0; $ < o._pdbx_struct_oper_list_id.length; $++) {
                    const k = parseFloat(o["_pdbx_struct_oper_list_matrix[1][1]"][$]), L = parseFloat(o["_pdbx_struct_oper_list_matrix[1][2]"][$]), z = parseFloat(o["_pdbx_struct_oper_list_matrix[1][3]"][$]), O = parseFloat(o["_pdbx_struct_oper_list_vector[1]"][$]), R = parseFloat(o["_pdbx_struct_oper_list_matrix[2][1]"][$]), N = parseFloat(o["_pdbx_struct_oper_list_matrix[2][2]"][$]), W = parseFloat(o["_pdbx_struct_oper_list_matrix[2][3]"][$]), B = parseFloat(o["_pdbx_struct_oper_list_vector[2]"][$]), P = parseFloat(o["_pdbx_struct_oper_list_matrix[3][1]"][$]), G = parseFloat(o["_pdbx_struct_oper_list_matrix[3][2]"][$]), H = parseFloat(o["_pdbx_struct_oper_list_matrix[3][3]"][$]), U = parseFloat(o["_pdbx_struct_oper_list_vector[3]"][$]), j = new l.Matrix4(k, L, z, O, R, N, W, B, P, G, H, U);
                    b[b.length - 1].symmetries.push(j);
                  }
                const E = function($) {
                  const k = $.match("-");
                  $ = $.replace(/[-xyz]/g, "");
                  const L = $.split("/");
                  let z, O;
                  return L[1] === void 0 ? O = 1 : O = parseInt(L[1]), L[0] === "" ? z = 1 : z = parseInt(L[0]), z / O * (k ? -1 : 1);
                };
                if (o._symmetry_equiv_pos_as_xyz !== void 0 && !x)
                  for (let $ = 0; $ < o._symmetry_equiv_pos_as_xyz.length; $++) {
                    const L = o._symmetry_equiv_pos_as_xyz[$].replace(/["' ]/g, "").split(",").map(function(N) {
                      return N.replace(/-/g, "+-");
                    });
                    let z = new l.Matrix4(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1);
                    for (let N = 0; N < 3; N++) {
                      const W = L[N].split("+");
                      for (let B = 0; B < W.length; B++) {
                        const P = W[B];
                        if (P === "")
                          continue;
                        const G = E(P);
                        P.match("x") ? z.elements[N + 0] = G : P.match("y") ? z.elements[N + 4] = G : P.match("z") ? z.elements[N + 8] = G : z.elements[N + 12] = G;
                      }
                    }
                    const O = M.getMatrix4(), R = new l.Matrix4().getInverse(O, !0);
                    z = new l.Matrix4().multiplyMatrices(z, R), z = new l.Matrix4().multiplyMatrices(O, z), b[b.length - 1].symmetries.push(z);
                  }
              }
              for (let o = 0; o < y.length; o++)
                A && !(m.duplicateAssemblyAtoms && !m.dontConnectDuplicatedAtoms) && (0, h.assignPDBBonds)(y[o], m), (0, r.computeSecondaryStructure)(y[o], m.hbondCutoff), (0, a.processSymmetries)(b[o].symmetries, y[o], m, b[o].cryst), m.duplicateAssemblyAtoms && !m.dontConnectDuplicatedAtoms && A && (0, h.assignPDBBonds)(y[o], m);
              return y;
            }
          }
        ),
        /***/
        "./src/parsers/CUBE.ts": (
          /*!*****************************!*\
            !*** ./src/parsers/CUBE.ts ***!
            \*****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              CUBE: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ../WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./utils/assignBonds */
              "./src/parsers/utils/assignBonds.ts"
            ), l = t(
              /*! ./utils/anumToSymbol */
              "./src/parsers/utils/anumToSymbol.ts"
            );
            function h(c, d) {
              d = d || {};
              const _ = [[]];
              let m = c.split(/\r?\n/);
              const y = d.assignBonds === void 0 ? !0 : d.assignBonds;
              if (m.length < 6)
                return _;
              let x = m[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" ");
              const b = Math.abs(parseFloat(x[0]));
              let A = {
                origin: void 0,
                size: void 0,
                unit: void 0,
                matrix4: void 0,
                matrix: void 0
              };
              const f = A.origin = new r.Vector3(parseFloat(x[1]), parseFloat(x[2]), parseFloat(x[3]));
              x = m[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), x = m[3].replace(/^\s+/, "").replace(/\s+/g, " ").split(" ");
              const s = x[0] > 0 ? 0.529177 : 1;
              f.multiplyScalar(s);
              const u = Math.abs(x[0]), p = new r.Vector3(parseFloat(x[1]), parseFloat(x[2]), parseFloat(x[3])).multiplyScalar(s);
              x = m[4].replace(/^\s+/, "").replace(/\s+/g, " ").split(" ");
              const g = Math.abs(x[0]), w = new r.Vector3(parseFloat(x[1]), parseFloat(x[2]), parseFloat(x[3])).multiplyScalar(s);
              x = m[5].replace(/^\s+/, "").replace(/\s+/g, " ").split(" ");
              const o = Math.abs(x[0]), v = new r.Vector3(parseFloat(x[1]), parseFloat(x[2]), parseFloat(x[3])).multiplyScalar(s);
              if (A.size = { x: u, y: g, z: o }, A.unit = new r.Vector3(p.x, w.y, v.z), p.y != 0 || p.z != 0 || w.x != 0 || w.z != 0 || v.x != 0 || v.y != 0) {
                A.matrix4 = new r.Matrix4(p.x, w.x, v.x, 0, p.y, w.y, v.y, 0, p.z, w.z, v.z, 0, 0, 0, 0, 1);
                let O = new r.Matrix4().makeTranslation(f.x, f.y, f.z);
                A.matrix4 = A.matrix4.multiplyMatrices(O, A.matrix4), A.matrix = A.matrix4.matrix3FromTopLeft(), A.origin = new r.Vector3(0, 0, 0), A.unit = new r.Vector3(1, 1, 1);
              }
              _.modelData = [{ cryst: A }], m = m.splice(6, b);
              for (var M = _[_.length - 1].length, E = M + m.length, $ = M; $ < E; ++$) {
                var k = {};
                k.serial = $;
                var L = m[$ - M], z = L.replace(/^\s+/, "").replace(/\s+/g, " ").split(" ");
                k.elem = l.anumToSymbol[z[0]], k.x = parseFloat(z[2]) * s, k.y = parseFloat(z[3]) * s, k.z = parseFloat(z[4]) * s, k.hetflag = !0, k.bonds = [], k.bondOrder = [], k.properties = {}, _[_.length - 1].push(k);
              }
              if (y)
                for (let O = 0; O < _.length; O++)
                  (0, a.assignBonds)(_[O], d);
              return _;
            }
          }
        ),
        /***/
        "./src/parsers/GRO.ts": (
          /*!****************************!*\
            !*** ./src/parsers/GRO.ts ***!
            \****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              GRO: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./utils/assignPDBBonds */
              "./src/parsers/utils/assignPDBBonds.ts"
            ), a = t(
              /*! ./utils/atomNameToElem */
              "./src/parsers/utils/atomNameToElem.ts"
            );
            function l(h, c) {
              const d = [], _ = h.split(/\r?\n|\r/);
              for (; _.length > 0; ) {
                const m = parseInt(_[1]);
                if (_.length < 3 || isNaN(m) || m <= 0 || _.length < m + 3)
                  break;
                const x = [];
                d.push(x);
                let b = 2;
                const A = x.length, f = A + m;
                for (let s = A; s < f; s++) {
                  const u = _[b++], p = {};
                  p.serial = s, p.atom = u.slice(10, 15).trim(), p.elem = (0, a.atomNameToElem)(p.atom, !0), p.x = 10 * parseFloat(u.slice(20, 28)), p.y = 10 * parseFloat(u.slice(28, 36)), p.z = 10 * parseFloat(u.slice(36, 44)), p.resi = parseInt(u.slice(0, 5)), p.resn = u.slice(5, 10).trim(), p.bonds = [], p.bondOrder = [], p.properties = {}, u.length > 44 && (p.dx = 10 * parseFloat(u.slice(44, 52)), p.dy = 10 * parseFloat(u.slice(52, 60)), p.dz = 10 * parseFloat(u.slice(60, 68))), x[s] = p;
                }
                if (_.length <= b + 3) {
                  const u = _[b++].trim().split(/\s+/);
                  if (u.length === 3) {
                    for (let p = 0; p < 3; p++)
                      u[p] = (parseFloat(u[p]) * 10).toString();
                    d.box = u;
                  }
                }
                _.splice(0, ++b);
              }
              for (let m = 0; m < d.length; m++)
                (0, r.assignPDBBonds)(d[m], c);
              return d;
            }
          }
        ),
        /***/
        "./src/parsers/LAMMPSTRJ.ts": (
          /*!**********************************!*\
            !*** ./src/parsers/LAMMPSTRJ.ts ***!
            \**********************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              LAMMPSTRJ: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./utils/assignBonds */
              "./src/parsers/utils/assignBonds.ts"
            );
            const a = {
              id: "serial",
              type: "atom",
              element: "elem",
              q: "charge",
              radius: "radius",
              x: "x",
              xu: "x",
              xs: "x",
              xsu: "x",
              y: "y",
              yu: "y",
              ys: "y",
              ysu: "y",
              z: "z",
              zu: "z",
              zs: "z",
              zsu: "z"
            };
            function l(h, c) {
              const d = [], _ = h.split(/\r?\n|\r/);
              let m = 0, y = 0, x = 0;
              for (; x < _.length - 9; ) {
                for (var b = x; b < _.length; b++)
                  if (_[b].match(/ITEM: NUMBER OF ATOMS/) && (y = parseInt(_[b + 1])), _[b].match(/ITEM: ATOMS/)) {
                    m = b + 1;
                    break;
                  }
                const A = _[m - 1].replace("ITEM: ATOMS ", "").split(" ");
                d.push([]);
                for (let f = m; f < m + y; f++) {
                  const s = {}, u = {}, p = _[f].split(" ");
                  for (let g = 0; g < p.length; g++) {
                    const w = a[A[g]];
                    w !== void 0 && (w === "serial" ? s[w] = parseInt(p[g]) : w === "x" || w === "y" || w === "z" ? s[w] = parseFloat(p[g]) : w === "charge" || w === "radius" ? u[w] = parseFloat(p[g]) : s[w] = p[g]), s.properties = u, s.bonds = [], s.bondOrder = [];
                  }
                  d[d.length - 1][f - m] = s;
                }
                x = m + y - 1;
              }
              if (c.assignBonds)
                for (let A = 0; A < d.length; A++)
                  (0, r.assignBonds)(d[A], c);
              return d;
            }
          }
        ),
        /***/
        "./src/parsers/MMTF.ts": (
          /*!*****************************!*\
            !*** ./src/parsers/MMTF.ts ***!
            \*****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              MMTFparser: () => (
                /* binding */
                y
              )
              /* harmony export */
            });
            var r = t(
              /*! ../utilities */
              "./src/utilities.ts"
            ), a = t(
              /*! ../WebGL */
              "./src/WebGL/index.ts"
            ), l = t(
              /*! ./utils/computeSecondaryStructure */
              "./src/parsers/utils/computeSecondaryStructure.ts"
            ), h = t(
              /*! ./utils/processSymmetries */
              "./src/parsers/utils/processSymmetries.ts"
            ), c = t(
              /*! ./src/vendor/mmtf.js */
              "./src/vendor/mmtf.js"
            ), d = function(x) {
              return String.fromCharCode.apply(null, x).replace(/\0/g, "");
            }, _ = function(x) {
              return x == 0 || x == 2 || x == 4 ? "h" : x == 3 ? "s" : "c";
            };
            let m = /* @__PURE__ */ new Set([
              "D-SACCHARIDE",
              "D-SACCHARIDE 1,4 AND 1,4 LINKING",
              "D-SACCHARIDE 1,4 AND 1,6 LINKING",
              "L-SACCHARIDE",
              "L-SACCHARIDE 1,4 AND 1,4 LINKING",
              "L-SACCHARIDE 1,4 AND 1,6 LINKING",
              "NON-POLYMER",
              "OTHER",
              "PEPTIDE-LIKE",
              "SACCHARIDE"
            ]);
            function y(x, b) {
              var A = !b.keepH, f = b.altLoc ? b.altLoc : "A", s = !!b.noSecondaryStructure, u = !b.noComputeSecondaryStructure, p = !b.doAssembly, g = b.assemblyIndex ? b.assemblyIndex : 0;
              typeof x == "string" ? x = (0, r.base64ToArray)(x) : x = new Uint8Array(x);
              var w = c.decode(x), o = [[]], v = o.modelData = [], M = 0, E = 0, $ = 0, k = w.secStructList, L = w.bFactorList, z = w.altLocList, O = w.occupancyList, R = w.bondAtomList, N = w.bondOrderList, W = w.numModels;
              if (W == 0)
                return o;
              b.multimodel || (W = 1);
              var B, P, G, H, U, j, re = [];
              if (!p && w.bioAssemblyList && w.bioAssemblyList.length > 0) {
                var ie = w.bioAssemblyList[g].transformList;
                for (B = 0, j = ie.length; B < j; B++) {
                  var te = new a.Matrix4(ie[B].matrix);
                  te.transpose(), re.push(te);
                }
              }
              var ue = null;
              if (w.unitCell) {
                var de = w.unitCell;
                ue = { a: de[0], b: de[1], c: de[2], alpha: de[3], beta: de[4], gamma: de[5] };
              }
              let oe = [];
              w.entityList.forEach((be) => {
                be.chainIndexList.forEach((q) => {
                  oe[q] = be.type == "polymer";
                });
              });
              var J = 0;
              for (U = 0; U < W; U++) {
                var Ee = w.chainsPerModel[U], se = o[o.length - 1], Ae = [];
                for (v.push({ symmetries: re, cryst: ue }), B = 0; B < Ee; ++B) {
                  var he = w.groupsPerChain[M], ne = d(w.chainIdList.subarray(M * 4, M * 4 + 4));
                  w.chainNameList && (ne = d(w.chainNameList.subarray(M * 4, M * 4 + 4)));
                  var _e = E, Le = "";
                  for (P = 0; P < he; ++P) {
                    var Be = w.groupList[w.groupTypeList[E]], Ue = Be.atomNameList.length, He = 0, We = !1, Ge = !1;
                    if (k) {
                      He = k[E];
                      var Ne = _(He);
                      (E == 0 || Ne != Le) && (We = !0), Le = Ne;
                      var Pe = E + 1;
                      (Pe >= k.length || _(k[Pe] != Ne)) && (Ge = !0);
                    }
                    var Te = w.groupIdList[E], Me = Be.groupName;
                    let be = Be.chemCompType;
                    var De = $;
                    let q = m.has(be) || !oe[M];
                    for (G = 0; G < Ue; ++G) {
                      var V = Be.elementList[G];
                      if (A && V == "H") {
                        $ += 1;
                        continue;
                      }
                      var Z = "";
                      L && (Z = L[$]);
                      var ee = "";
                      z && z[$] && (ee = String.fromCharCode(z[$]));
                      var ye = "";
                      if (O && (ye = O[$]), ee != "" && ee != f && f != "*") {
                        $ += 1;
                        continue;
                      }
                      var ce = w.atomIdList[$], Ie = Be.atomNameList[G], ke = 0;
                      Be.atomChargeList && (ke = Be.atomChargeList[G]);
                      var Y = w.xCoordList[$], me = w.yCoordList[$], we = w.zCoordList[$];
                      Ae[$] = se.length, se.push({
                        resn: Me,
                        x: Y,
                        y: me,
                        z: we,
                        elem: V,
                        hetflag: q,
                        chain: ne,
                        resi: Te,
                        icode: ee,
                        rescode: Te + (ee != " " ? "^" + ee : ""),
                        // resi
                        // and
                        // icode
                        serial: ce,
                        altLoc: ee,
                        index: $,
                        atom: Ie,
                        bonds: [],
                        ss: _(He),
                        ssbegin: We,
                        ssend: Ge,
                        bondOrder: [],
                        properties: { charge: ke, occupancy: ye },
                        b: Z
                      }), $ += 1;
                    }
                    var Re = Be.bondAtomList;
                    for (G = 0, H = Be.bondOrderList.length; G < H; ++G) {
                      var pe = De + Re[G * 2], $e = De + Re[G * 2 + 1], X = Be.bondOrderList[G], ze = Ae[pe], Ve = Ae[$e], I = se[ze], xe = se[Ve];
                      I && xe && (I.bonds.push(Ve), I.bondOrder.push(X), xe.bonds.push(ze), xe.bondOrder.push(X));
                    }
                    E += 1;
                  }
                  for (E = _e, P = 0; P < he; ++P)
                    E += 1;
                  M += 1;
                }
                if (R)
                  for (let be = J, q = R.length; be < q; be += 2) {
                    let fe = R[be], Ce = R[be + 1], Ze = N ? N[be / 2] : 1;
                    if (fe >= $) {
                      J = be;
                      break;
                    }
                    let Xe = Ae[fe], Ye = Ae[Ce], lt = se[Xe], dt = se[Ye];
                    lt && dt && (lt.bonds.push(Ye), lt.bondOrder.push(Ze), dt.bonds.push(Xe), dt.bondOrder.push(Ze));
                  }
                b.multimodel && (b.onemol || o.push([]));
              }
              if (!p)
                for (let be = 0; be < o.length; be++)
                  (0, h.processSymmetries)(v[be].symmetries, o[be], b, v[be].cryst);
              return u && !s && (0, l.computeSecondaryStructure)(o, b.hbondCutoff), o;
            }
          }
        ),
        /***/
        "./src/parsers/MOL2.ts": (
          /*!*****************************!*\
            !*** ./src/parsers/MOL2.ts ***!
            \*****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              MOL2: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            let r = {
              "C.1": "C",
              C1: "C",
              "C.2": "C",
              C2: "C",
              "C.3": "C",
              C3: "C",
              "C.ar": "C",
              Car: "C",
              "C.cat": "C",
              Ccat: "C",
              "H.spc": "H",
              Hspc: "H",
              "H.t3p": "H",
              Ht3p: "H",
              "N.1": "N",
              N1: "N",
              "N.2": "N",
              N2: "N",
              "N.3": "N",
              N3: "N",
              "N.4": "N",
              N4: "N",
              "N.am": "N",
              Nam: "N",
              "N.ar": "N",
              Nar: "N",
              "N.p13": "N",
              Np13: "N",
              "O.2": "O",
              O2: "O",
              "O.3": "O",
              O3: "O",
              "O.co2": "O",
              Oco2: "O",
              "O.spc": "O",
              Ospc: "O",
              "O.t3p": "O",
              Ot3p: "O",
              "P.3": "P",
              P3: "P",
              "S.2": "S",
              S2: "S",
              "S.3": "S",
              S3: "S",
              "S.o": "S",
              So: "S",
              "S.o2": "S",
              So2: "S"
            };
            function a(l, h) {
              var c = [[]], d = !1;
              typeof h.keepH < "u" && (d = !h.keepH);
              var _ = l.search(/@<TRIPOS>MOLECULE/), m = l.search(/@<TRIPOS>ATOM/);
              if (_ == -1 || m == -1)
                return c;
              for (var y = l.substring(_).split(/\r?\n|\r/); y.length > 0; ) {
                var x = [], b = y[2].replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), A = parseInt(b[0]), f = 0;
                b.length > 1 && (f = parseInt(b[1]));
                var s = 4, u;
                for (u = 3; u < y.length; u++)
                  if (y[u] == "@<TRIPOS>ATOM") {
                    s = u + 1;
                    break;
                  }
                var p = c[c.length - 1].length, g = p + A, w;
                for (u = p; u < g; u++) {
                  w = y[s++], b = w.replace(/^\s+/, "").replace(/\s+/g, " ").split(" ");
                  var o = {}, v = b[5];
                  if (r[v] !== void 0 ? v = r[v] : (v = v.split(".")[0], v = v[0].toUpperCase() + v.substring(1).toLowerCase()), o.atom = b[1], o.elem = v, !(o.elem == "H" && d)) {
                    var M = c[c.length - 1].length, E = parseInt(b[0]);
                    o.serial = E, o.x = parseFloat(b[2]), o.y = parseFloat(b[3]), o.z = parseFloat(b[4]), o.atom = b[5];
                    var $ = parseFloat(b[8]);
                    o.index = M, o.bonds = [], o.bondOrder = [], o.properties = {
                      charge: $,
                      partialCharge: $
                    }, x[E] = M, c[c.length - 1].push(o);
                  }
                }
                for (var k = !1; s < y.length; )
                  if (y[s++] == "@<TRIPOS>BOND") {
                    k = !0;
                    break;
                  }
                if (k && f)
                  for (u = 0; u < f; u++) {
                    w = y[s++], b = w.replace(/^\s+/, "").replace(/\s+/g, " ").split(" ");
                    var L = parseInt(b[1]), z = c[c.length - 1][x[L]], O = parseInt(b[2]), R = c[c.length - 1][x[O]], N = parseInt(b[3]);
                    isNaN(N) && (N = 1), z !== void 0 && R !== void 0 && (z.bonds.push(x[O]), z.bondOrder.push(N), R.bonds.push(x[L]), R.bondOrder.push(N));
                  }
                if (h.multimodel) {
                  h.onemol || c.push([]), y.splice(0, s), l = y.join(`
`);
                  continue;
                } else
                  break;
              }
              return c;
            }
          }
        ),
        /***/
        "./src/parsers/PDB.ts": (
          /*!****************************!*\
            !*** ./src/parsers/PDB.ts ***!
            \****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              PDB: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ./utils/getSinglePDB */
              "./src/parsers/utils/getSinglePDB.ts"
            );
            function a(l, h) {
              h = h || {};
              var c = [], d = {};
              c.modelData = [];
              for (var _ = l.split(/\r?\n|\r/); _.length > 0; ) {
                var m = (0, r.getSinglePDB)(_, h, d), y = m[0], x = m[1];
                if (_ = m[2], y.length != 0) {
                  if (h.multimodel && h.onemol && c.length > 0)
                    for (var b = c[0].length, A = 0; A < y.length; A++) {
                      var f = y[A];
                      f.index = A;
                      for (var s = 0; s < f.bonds.length; s++)
                        f.bonds[s] += b;
                      c[0].push(f);
                    }
                  else
                    c.modelData.push(x), c.push(y);
                  if (!h.multimodel)
                    break;
                }
              }
              return c;
            }
          }
        ),
        /***/
        "./src/parsers/PQR.ts": (
          /*!****************************!*\
            !*** ./src/parsers/PQR.ts ***!
            \****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              PQR: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./utils/assignPDBBonds */
              "./src/parsers/utils/assignPDBBonds.ts"
            ), a = t(
              /*! ./utils/computeSecondaryStructure */
              "./src/parsers/utils/computeSecondaryStructure.ts"
            );
            function l(h, c) {
              var d = [[]], _ = !c.noSecondaryStructure;
              d.modelData = [{ symmetries: [] }];
              var m = [], y = h.split(/\r?\n|\r/), x;
              for (let k = 0; k < y.length; k++) {
                x = y[k].replace(/^\s*/, "");
                var b = x.substring(0, 6);
                if (b.indexOf("END") == 0)
                  if (c.multimodel) {
                    c.onemol || d.push([]);
                    continue;
                  } else
                    break;
                else if (b == "ATOM  " || b == "HETATM") {
                  var A;
                  let L = parseInt(x.substring(6, 11)), z = x.substring(12, 16).replace(/ /g, ""), O = x.substring(17, 20).trim(), R = x.substring(21, 22), N = parseInt(x.substring(22, 26));
                  var f = x.substring(30).trim().split(/\s+/), s = parseFloat(f[0]), u = parseFloat(f[1]), p = parseFloat(f[2]), g = parseFloat(f[3]), w = parseFloat(f[4]), o = z[0];
                  z.length > 1 && z[1].toUpperCase() != z[1] && (o = z.substring(0, 2)), x[0] == "H" ? A = !0 : A = !1, m[L] = d[d.length - 1].length, d[d.length - 1].push({
                    resn: O,
                    x: s,
                    y: u,
                    z: p,
                    elem: o,
                    hetflag: A,
                    chain: R,
                    resi: N,
                    serial: L,
                    atom: z,
                    bonds: [],
                    ss: "c",
                    bondOrder: [],
                    properties: {
                      charge: g,
                      partialCharge: g,
                      radius: w
                    },
                    pdbline: x
                  });
                } else if (b == "CONECT") {
                  var v = parseInt(x.substring(6, 11)), M = d[d.length - 1][m[v]];
                  for (let L = 0; L < 4; L++) {
                    var E = parseInt(x.substring([11, 16, 21, 26][L], [11, 16, 21, 26][L] + 5)), $ = d[d.length - 1][m[E]];
                    M !== void 0 && $ !== void 0 && (M.bonds.push(m[E]), M.bondOrder.push(1));
                  }
                }
              }
              for (let k = 0; k < d.length; k++)
                (0, r.assignPDBBonds)(d[k], c), _ && (0, a.computeSecondaryStructure)(d[k], c.hbondCutoff);
              return d;
            }
          }
        ),
        /***/
        "./src/parsers/PRMTOP.ts": (
          /*!*******************************!*\
            !*** ./src/parsers/PRMTOP.ts ***!
            \*******************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              PRMTOP: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            function r(a) {
              var l = [], h, c = 0, d = a.split(/\r?\n|\r/);
              if (d.length > 0 && d[0].includes("VERSION")) {
                var _ = d.filter(function(s) {
                  return s.includes("POINTERS") || s.includes("ATOM_NAME") || s.includes("CHARGE") || s.includes("RADII") || s.includes("BONDS_INC_HYDROGEN") || s.includes("BONDS_WITHOUT_HYDROGEN");
                }), m = A("POINTERS");
                if (m == -1)
                  return [];
                var y = f(m), x = parseInt(d[m + 1].slice(0, y[1]));
                if (isNaN(x) || x <= 0)
                  return [];
                if (m = A("ATOM_NAME"), m == -1)
                  return [];
                y = f(m);
                var b = y[0];
                for (let s = 0; s < x / y[0]; s++) {
                  s == parseInt(x / y[0]) && (b = x % y[0]);
                  for (let u = 0; u < b; u++) {
                    let p = {}, g = { charge: "", radii: "" };
                    p.serial = c, p.x = 0, p.y = 0, p.z = 0, p.atom = d[m + 1].slice(y[1] * u, y[1] * (u + 1)).trim(), p.elem = d[m + 1].slice(y[1] * u, y[1] * u + 1).trim(), p.properties = g, p.bonds = [], p.bondOrder = [], l.push(p), c++;
                  }
                  m++;
                }
                if (m = A("CHARGE"), m != -1) {
                  y = f(m), c = 0, b = y[0];
                  for (let s = 0; s < x / y[0]; s++) {
                    s == parseInt(x / y[0]) && (b = x % y[0]);
                    for (let u = 0; u < b; u++)
                      l[c].properties.charge = parseFloat(d[m + 1].slice(y[1] * u, y[1] * (u + 1))), c++;
                    m++;
                  }
                }
                if (m = A("RADII"), m != -1) {
                  y = f(m), c = 0, b = y[0];
                  for (let s = 0; s < x / y[0]; s++) {
                    s == parseInt(x / y[0]) && (b = x % y[0]);
                    for (let u = 0; u < b; u++)
                      l[c].properties.radii = parseFloat(d[m + 1].slice(y[1] * u, y[1] * (u + 1))), c++;
                    m++;
                  }
                }
                if (m = A("BONDS_WITHOUT_HYDROGEN"), m != -1)
                  for (y = f(m), c = 0, b = y[0], m = m + 1; !d[m].match(/^%FLAG/); ) {
                    d[m + 1].match(/^%FLAG/) && (b = x % y[0]);
                    for (let s = 0; s < b; s++)
                      c % 3 == 0 ? h = parseInt(d[m].slice(y[1] * s, y[1] * (s + 1)) / 3) : c % 3 == 1 && l[h].bonds.push(parseInt(d[m].slice(y[1] * s, y[1] * (s + 1)) / 3)), c++;
                    m++;
                  }
                if (m = A("BONDS_INC_HYDROGEN"), m != -1)
                  for (y = f(m), c = 0, b = y[0], m = m + 1; !d[m].match(/^%FLAG/); ) {
                    d[m + 1].match(/^%FLAG/) && (b = x % y[0]);
                    for (let s = 0; s < b; s++)
                      c % 3 == 0 ? h = parseInt(d[m].slice(y[1] * s, y[1] * (s + 1)) / 3) : c % 3 == 1 && l[h].bonds.push(parseInt(d[m].slice(y[1] * s, y[1] * (s + 1)) / 3)), c++;
                    m++;
                  }
              } else
                return [];
              function A(s) {
                var u = d.indexOf(_.filter(function(p) {
                  return p.includes(s);
                })[0]);
                if (Number.isInteger(u) && u > 0) {
                  for (; !d[u].includes("FORMAT"); )
                    u++;
                  return u;
                } else
                  return -1;
              }
              function f(s) {
                var u = d[s].match(/\((\d*)\S*/), p = d[s].match(/[a-zA-Z](\d*)\)\s*/);
                return p == null && (p = d[s].match(/[a-zA-Z](\d*)\.\d*\)\s*/)), [u[1], p[1]];
              }
              return [l];
            }
          }
        ),
        /***/
        "./src/parsers/SDF.ts": (
          /*!****************************!*\
            !*** ./src/parsers/SDF.ts ***!
            \****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              SDF: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = function(h, c) {
              var d = [[]], _ = !1;
              for (typeof c.keepH < "u" && (_ = !c.keepH); h.length > 0 && !(h.length < 4); ) {
                var m = parseInt(h[3].substring(0, 3));
                if (isNaN(m) || m <= 0)
                  break;
                var y = parseInt(h[3].substring(3, 6)), x = 4;
                if (h.length < 4 + m + y)
                  break;
                var b = [], A = d[d.length - 1].length, f = A + m, s, u;
                for (s = A; s < f; s++, x++) {
                  u = h[x];
                  var p = {}, g = u.substring(31, 34).replace(/ /g, "");
                  p.atom = p.elem = g[0].toUpperCase() + g.substring(1).toLowerCase(), (p.elem !== "H" || !_) && (p.serial = s, b[s] = d[d.length - 1].length, p.x = parseFloat(u.substring(0, 10)), p.y = parseFloat(u.substring(10, 20)), p.z = parseFloat(u.substring(20, 30)), p.hetflag = !0, p.bonds = [], p.bondOrder = [], p.properties = {}, p.index = d[d.length - 1].length, d[d.length - 1].push(p));
                }
                for (s = 0; s < y; s++, x++) {
                  u = h[x];
                  var w = b[parseInt(u.substring(0, 3)) - 1 + A], o = b[parseInt(u.substring(3, 6)) - 1 + A], v = parseFloat(u.substring(6));
                  typeof w < "u" && typeof o < "u" && (d[d.length - 1][w].bonds.push(o), d[d.length - 1][w].bondOrder.push(v), d[d.length - 1][o].bonds.push(w), d[d.length - 1][o].bondOrder.push(v));
                }
                if (c.multimodel) {
                  for (c.onemol || d.push([]); h[x] !== "$$$$" && x < h.length; )
                    x++;
                  h.splice(0, ++x);
                } else
                  break;
              }
              return d;
            }, a = function(h, c) {
              var d = [[]], _ = !1;
              for (typeof c.keepH < "u" && (_ = !c.keepH); h.length > 0 && !(h.length < 8 || !h[4].startsWith("M  V30 BEGIN CTAB") || !h[5].startsWith("M  V30 COUNTS") || h[5].length < 14); ) {
                var m = h[5].substring(13).match(/\S+/g);
                if (m.length < 2)
                  break;
                var y = parseInt(m[0]);
                if (isNaN(y) || y <= 0)
                  break;
                var x = parseInt(m[1]), b = 7;
                if (h.length < 8 + y + x)
                  break;
                var A = [], f = d[d.length - 1].length, s = f + y, u, p;
                for (u = f; u < s; u++, b++) {
                  p = h[b];
                  var g = p.substring(6).match(/\S+/g);
                  if (g.length > 4) {
                    var w = {}, o = g[1].replace(/ /g, "");
                    w.atom = w.elem = o[0].toUpperCase() + o.substring(1).toLowerCase(), (w.elem !== "H" || !_) && (w.serial = u, A[u] = d[d.length - 1].length, w.x = parseFloat(g[2]), w.y = parseFloat(g[3]), w.z = parseFloat(g[4]), w.hetflag = !0, w.bonds = [], w.bondOrder = [], w.properties = {}, w.index = d[d.length - 1].length, d[d.length - 1].push(w));
                  }
                }
                if (h[b] === "M  V30 END ATOM")
                  b++;
                else
                  break;
                if (x !== 0 && h[b] === "M  V30 BEGIN BOND")
                  b++;
                else
                  break;
                for (u = 0; u < x; u++, b++) {
                  p = h[b];
                  var v = p.substring(6).match(/\S+/g);
                  if (v.length > 3) {
                    var M = A[parseInt(v[2]) - 1 + f], E = A[parseInt(v[3]) - 1 + f], $ = parseFloat(v[1]);
                    typeof M < "u" && typeof E < "u" && (d[d.length - 1][M].bonds.push(E), d[d.length - 1][M].bondOrder.push($), d[d.length - 1][E].bonds.push(M), d[d.length - 1][E].bondOrder.push($));
                  }
                }
                if (c.multimodel) {
                  for (c.onemol || d.push([]); h[b] !== "$$$$" && b < h.length; )
                    b++;
                  h.splice(0, ++b);
                } else
                  break;
              }
              return d;
            };
            function l(h, c) {
              var d = "V2000", _ = h.split(/\r?\n|\r/);
              return _.length > 3 && _[3].length > 38 && (d = _[3].substring(34, 39)), d === "V2000" ? r(_, c) : d === "V3000" ? a(_, c) : [[""]];
            }
          }
        ),
        /***/
        "./src/parsers/VASP.ts": (
          /*!*****************************!*\
            !*** ./src/parsers/VASP.ts ***!
            \*****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              VASP: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./utils/assignBonds */
              "./src/parsers/utils/assignBonds.ts"
            );
            function l(h, c = {}) {
              var d = [[]], _ = {};
              const m = c.assignBonds === void 0 ? !0 : c.assignBonds;
              var y = h.replace(/^\s+/, "").split(/\r?\n/);
              if (y.length < 3)
                return d;
              if (y[1].match(/\d+/))
                _.length = parseFloat(y[1]);
              else
                return console.log("Warning: second line of the vasp structure file must be a number"), d;
              if (_.length < 0)
                return console.log("Warning: Vasp implementation for negative lattice lengths is not yet available"), d;
              _.xVec = new Float32Array(y[2].replace(/^\s+/, "").split(/\s+/)), _.yVec = new Float32Array(y[3].replace(/^\s+/, "").split(/\s+/)), _.zVec = new Float32Array(y[4].replace(/^\s+/, "").split(/\s+/));
              var x = new r.Matrix3(_.xVec[0], _.xVec[1], _.xVec[2], _.yVec[0], _.yVec[1], _.yVec[2], _.zVec[0], _.zVec[1], _.zVec[2]);
              x.multiplyScalar(_.length), d.modelData = [{ symmetries: [], cryst: { matrix: x } }];
              var b = y[5].trim().split(/\s+/), A = new Int16Array(y[6].trim().split(/\s+/)), f = y[7].trim(), s = !1;
              if (f.match(/S/) && (s = !0, f = y[8].trim()), f.toLowerCase()[0] == "c")
                f = "cartesian";
              else if (f.toLowerCase()[0] == "d")
                f = "direct";
              else
                return console.log("Warning: Unknown vasp mode in POSCAR file: mode must be either C(artesian) or D(irect)"), d;
              if (b.length != A.length)
                return console.log("Warning: declaration of atomary species wrong:"), console.log(b), console.log(A), d;
              s ? y.splice(0, 9) : y.splice(0, 8);
              for (var u = 0, p = 0, g = b.length; p < g; p++) {
                for (var w = b[p], o = 0, v = A[p]; o < v; o++) {
                  var M = new Float32Array(y[u + o].trim().split(/\s+/)), E = {};
                  E.elem = w, f == "cartesian" ? (E.x = _.length * M[0], E.y = _.length * M[1], E.z = _.length * M[2]) : (E.x = _.length * (M[0] * _.xVec[0] + M[1] * _.yVec[0] + M[2] * _.zVec[0]), E.y = _.length * (M[0] * _.xVec[1] + M[1] * _.yVec[1] + M[2] * _.zVec[1]), E.z = _.length * (M[0] * _.xVec[2] + M[1] * _.yVec[2] + M[2] * _.zVec[2])), E.bonds = [], E.bondOrder = [], d[0].push(E);
                }
                u += A[p];
              }
              if (m)
                for (let $ = 0; $ < d.length; $++)
                  (0, a.assignBonds)(d[$], c);
              return d;
            }
          }
        ),
        /***/
        "./src/parsers/XYZ.ts": (
          /*!****************************!*\
            !*** ./src/parsers/XYZ.ts ***!
            \****************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              XYZ: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ../WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./utils/assignBonds */
              "./src/parsers/utils/assignBonds.ts"
            );
            function l(h, c) {
              c = c || {};
              for (var d = [[]], _ = c.assignBonds === void 0 ? !0 : c.assignBonds, m = h.split(/\r?\n|\r/); m.length > 0 && !(m.length < 3); ) {
                var y = parseInt(m[0]);
                if (isNaN(y) || y <= 0 || m.length < y + 2)
                  break;
                var x = /Lattice\s*=\s*["\{\}]([^"\{\}]+)["\{\}]\s*/gi, b = x.exec(m[1]);
                if (b != null && b.length > 1) {
                  var A = new Float32Array(b[1].split(/\s+/)), f = new r.Matrix3(A[0], A[3], A[6], A[1], A[4], A[7], A[2], A[5], A[8]);
                  d.modelData = [{ cryst: { matrix: f } }];
                }
                for (var s = 2, u = d[d.length - 1].length, p = u + y, g = u; g < p; g++) {
                  var w = m[s++], o = w.replace(/^\s+/, "").replace(/\s+/g, " ").split(" "), v = {};
                  v.serial = g;
                  var M = o[0];
                  v.atom = v.elem = M[0].toUpperCase() + M.substring(1, 2).toLowerCase(), v.x = parseFloat(o[1]), v.y = parseFloat(o[2]), v.z = parseFloat(o[3]), v.hetflag = !0, v.bonds = [], v.bondOrder = [], v.properties = {}, d[d.length - 1][g] = v, o.length >= 7 && (v.dx = parseFloat(o[4]), v.dy = parseFloat(o[5]), v.dz = parseFloat(o[6]));
                }
                if (c.multimodel)
                  d.push([]), m.splice(0, s);
                else
                  break;
              }
              if (_)
                for (let $ = 0; $ < d.length; $++)
                  (0, a.assignBonds)(d[$], c);
              if (c.onemol) {
                var E = d;
                d = [], d.push(E[0]);
                for (let $ = 1; $ < E.length; $++) {
                  let k = d[0].length;
                  for (let L = 0; L < E[$].length; L++) {
                    let z = E[$][L];
                    for (let O = 0; O < z.bonds.length; O++)
                      z.bonds[O] = z.bonds[O] + k;
                    z.index = d[0].length, z.serial = d[0].length, d[0].push(z);
                  }
                }
              }
              return d;
            }
          }
        ),
        /***/
        "./src/parsers/cifutils/category.ts": (
          /*!******************************************!*\
            !*** ./src/parsers/cifutils/category.ts ***!
            \******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Category: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ./decoder */
              "./src/parsers/cifutils/decoder.ts"
            );
            function a(l) {
              const h = /* @__PURE__ */ Object.create(null), c = /* @__PURE__ */ Object.create(null);
              for (const d of l.columns)
                h[d.name] = d;
              return {
                rowCount: l.rowCount,
                name: l.name.substring(1),
                fieldNames: l.columns.map((d) => d.name),
                getField(d) {
                  const _ = h[d];
                  if (_)
                    return c[d] || (c[d] = (0, r.decode)(_.data)), c[d];
                }
              };
            }
          }
        ),
        /***/
        "./src/parsers/cifutils/decoder.ts": (
          /*!*****************************************!*\
            !*** ./src/parsers/cifutils/decoder.ts ***!
            \*****************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              decode: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./encoding */
              "./src/parsers/cifutils/encoding.ts"
            );
            const a = new Uint16Array(new Uint8Array([18, 52]).buffer)[0] === 13330;
            function l(k, L) {
              const z = new ArrayBuffer(k.length), O = new Uint8Array(z);
              for (let R = 0, N = k.length; R < N; R += L)
                for (let W = 0; W < L; W++)
                  O[R + L - W - 1] = k[R + W];
              return z;
            }
            function h(k) {
              let L = k.data;
              for (let z = k.encoding.length - 1; z >= 0; z--)
                L = c(L, k.encoding[z]);
              return L;
            }
            function c(k, L) {
              switch (L.kind) {
                case "ByteArray":
                  switch (L.type) {
                    case r.Encoding.IntDataType.Uint8:
                      return k;
                    case r.Encoding.IntDataType.Int8:
                      return m(k);
                    case r.Encoding.IntDataType.Int16:
                      return x(k);
                    case r.Encoding.IntDataType.Uint16:
                      return b(k);
                    case r.Encoding.IntDataType.Int32:
                      return A(k);
                    case r.Encoding.IntDataType.Uint32:
                      return f(k);
                    case r.Encoding.FloatDataType.Float32:
                      return s(k);
                    case r.Encoding.FloatDataType.Float64:
                      return u(k);
                    default:
                      throw new Error("unreachable");
                  }
                case "FixedPoint":
                  return p(k, L);
                case "IntervalQuantization":
                  return g(k, L);
                case "RunLength":
                  return w(k, L);
                case "Delta":
                  return o(k, L);
                case "IntegerPacking":
                  return E(k, L);
                case "StringArray":
                  return $(k, L);
              }
            }
            function d(k, L) {
              switch (k) {
                case r.Encoding.IntDataType.Int8:
                  return new Int8Array(L);
                case r.Encoding.IntDataType.Int16:
                  return new Int16Array(L);
                case r.Encoding.IntDataType.Int32:
                  return new Int32Array(L);
                case r.Encoding.IntDataType.Uint8:
                  return new Uint8Array(L);
                case r.Encoding.IntDataType.Uint16:
                  return new Uint16Array(L);
                case r.Encoding.IntDataType.Uint32:
                  return new Uint32Array(L);
                default:
                  return new Int32Array(L);
              }
            }
            function _(k, L) {
              switch (k) {
                case r.Encoding.FloatDataType.Float32:
                  return new Float32Array(L);
                case r.Encoding.FloatDataType.Float64:
                  return new Float64Array(L);
                default:
                  return new Float64Array(L);
              }
            }
            function m(k) {
              return new Int8Array(k.buffer, k.byteOffset);
            }
            function y(k, L, z) {
              return (k.byteOffset != 0 || k.byteLength != k.buffer.byteLength) && (k = new Uint8Array(k)), a ? new z(k.buffer) : new z(l(k, L));
            }
            function x(k) {
              return y(k, 2, Int16Array);
            }
            function b(k) {
              return y(k, 2, Uint16Array);
            }
            function A(k) {
              return y(k, 4, Int32Array);
            }
            function f(k) {
              return y(k, 4, Uint32Array);
            }
            function s(k) {
              return y(k, 4, Float32Array);
            }
            function u(k) {
              return y(k, 8, Float64Array);
            }
            function p(k, L) {
              const z = k.length, O = _(L.srcType, z), R = 1 / L.factor;
              for (let N = 0; N < z; N++)
                O[N] = R * k[N];
              return O;
            }
            function g(k, L) {
              const z = k.length, O = _(L.srcType, z), R = (L.max - L.min) / (L.numSteps - 1), N = L.min;
              for (let W = 0; W < z; W++)
                O[W] = N + R * k[W];
              return O;
            }
            function w(k, L) {
              const z = d(L.srcType, L.srcSize);
              let O = 0;
              for (let R = 0, N = k.length; R < N; R += 2) {
                const W = k[R], B = k[R + 1];
                for (let P = 0; P < B; ++P)
                  z[O++] = W;
              }
              return z;
            }
            function o(k, L) {
              const z = k.length, O = d(L.srcType, z);
              if (!z)
                return k;
              O[0] = k[0] + (L.origin | 0);
              for (let R = 1; R < z; ++R)
                O[R] = k[R] + O[R - 1];
              return O;
            }
            function v(k, L) {
              const z = L.byteCount === 1 ? 127 : 32767, O = -z - 1, R = k.length, N = new Int32Array(L.srcSize);
              let W = 0, B = 0;
              for (; W < R; ) {
                let P = 0, G = k[W];
                for (; G === z || G === O; )
                  P += G, W++, G = k[W];
                P += G, N[B] = P, W++, B++;
              }
              return N;
            }
            function M(k, L) {
              const z = L.byteCount === 1 ? 255 : 65535, O = k.length, R = new Int32Array(L.srcSize);
              let N = 0, W = 0;
              for (; N < O; ) {
                let B = 0, P = k[N];
                for (; P === z; )
                  B += P, N++, P = k[N];
                B += P, R[W] = B, N++, W++;
              }
              return R;
            }
            function E(k, L) {
              return k.length === L.srcSize ? k : L.isUnsigned ? M(k, L) : v(k, L);
            }
            function $(k, L) {
              const z = h({ encoding: L.offsetEncoding, data: L.offsets }), O = h({ encoding: L.dataEncoding, data: k }), R = L.stringData, N = new Array(z.length);
              N[0] = "";
              for (let P = 1, G = z.length; P < G; P++)
                N[P] = R.substring(z[P - 1], z[P]);
              let W = 0;
              const B = new Array(O.length);
              for (let P = 0, G = O.length; P < G; P++)
                B[W++] = N[O[P] + 1];
              return B;
            }
          }
        ),
        /***/
        "./src/parsers/cifutils/encoding.ts": (
          /*!******************************************!*\
            !*** ./src/parsers/cifutils/encoding.ts ***!
            \******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Encoding: () => (
                /* binding */
                a
              ),
              /* harmony export */
              VERSION: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = "0.3.0";
            var a;
            (function(l) {
              (function(d) {
                d[d.Int8 = 1] = "Int8", d[d.Int16 = 2] = "Int16", d[d.Int32 = 3] = "Int32", d[d.Uint8 = 4] = "Uint8", d[d.Uint16 = 5] = "Uint16", d[d.Uint32 = 6] = "Uint32";
              })(l.IntDataType || (l.IntDataType = {})), function(d) {
                d[d.Float32 = 32] = "Float32", d[d.Float64 = 33] = "Float64";
              }(l.FloatDataType || (l.FloatDataType = {}));
              function h(d) {
                let _;
                return d instanceof Int8Array ? _ = l.IntDataType.Int8 : d instanceof Int16Array ? _ = l.IntDataType.Int16 : d instanceof Int32Array ? _ = l.IntDataType.Int32 : d instanceof Uint8Array ? _ = l.IntDataType.Uint8 : d instanceof Uint16Array ? _ = l.IntDataType.Uint16 : d instanceof Uint32Array ? _ = l.IntDataType.Uint32 : d instanceof Float32Array ? _ = l.FloatDataType.Float32 : d instanceof Float64Array ? _ = l.FloatDataType.Float64 : _ = l.IntDataType.Int32, _;
              }
              l.getDataType = h;
              function c(d) {
                if (d instanceof Int8Array || d instanceof Int16Array || d instanceof Int32Array)
                  return !0;
                for (let _ = 0, m = d.length; _ < m; _++)
                  if (_ < 0)
                    return !1;
                return !0;
              }
              l.isSignedIntegerDataType = c;
            })(a || (a = {}));
          }
        ),
        /***/
        "./src/parsers/index.ts": (
          /*!******************************!*\
            !*** ./src/parsers/index.ts ***!
            \******************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Parsers: () => (
                /* binding */
                p
              ),
              /* harmony export */
              bondLength: () => (
                /* reexport safe */
                u.bondLength
              ),
              /* harmony export */
              setBondLength: () => (
                /* reexport safe */
                u.setBondLength
              )
              /* harmony export */
            });
            var r = t(
              /*! ./VASP */
              "./src/parsers/VASP.ts"
            ), a = t(
              /*! ./CUBE */
              "./src/parsers/CUBE.ts"
            ), l = t(
              /*! ./XYZ */
              "./src/parsers/XYZ.ts"
            ), h = t(
              /*! ./SDF */
              "./src/parsers/SDF.ts"
            ), c = t(
              /*! ./CDJSON */
              "./src/parsers/CDJSON.ts"
            ), d = t(
              /*! ./CIF */
              "./src/parsers/CIF.ts"
            ), _ = t(
              /*! ./MOL2 */
              "./src/parsers/MOL2.ts"
            ), m = t(
              /*! ./PDB */
              "./src/parsers/PDB.ts"
            ), y = t(
              /*! ./PQR */
              "./src/parsers/PQR.ts"
            ), x = t(
              /*! ./MMTF */
              "./src/parsers/MMTF.ts"
            ), b = t(
              /*! ./PRMTOP */
              "./src/parsers/PRMTOP.ts"
            ), A = t(
              /*! ./GRO */
              "./src/parsers/GRO.ts"
            ), f = t(
              /*! ./LAMMPSTRJ */
              "./src/parsers/LAMMPSTRJ.ts"
            ), s = t(
              /*! ./BCIF */
              "./src/parsers/BCIF.ts"
            ), u = t(
              /*! ./utils/bondLength */
              "./src/parsers/utils/bondLength.ts"
            );
            const p = {
              vasp: r.VASP,
              VASP: r.VASP,
              cube: a.CUBE,
              CUBE: a.CUBE,
              xyz: l.XYZ,
              XYZ: l.XYZ,
              sdf: h.SDF,
              SDF: h.SDF,
              json: c.CDJSON,
              cdjson: c.CDJSON,
              CDJSON: c.CDJSON,
              mcif: d.CIF,
              cif: d.CIF,
              CIF: d.CIF,
              mol2: _.MOL2,
              MOL2: _.MOL2,
              pdb: m.PDB,
              PDB: m.PDB,
              pdbqt: m.PDB,
              PDBQT: m.PDB,
              pqr: y.PQR,
              PQR: y.PQR,
              mmtf: x.MMTFparser,
              MMTF: x.MMTFparser,
              prmtop: b.PRMTOP,
              PRMTOP: b.PRMTOP,
              gro: A.GRO,
              GRO: A.GRO,
              lammpstrj: f.LAMMPSTRJ,
              LAMMPSTRJ: f.LAMMPSTRJ,
              bcif: s.BCIF,
              BCIF: s.BCIF
            };
          }
        ),
        /***/
        "./src/parsers/utils/anumToSymbol.ts": (
          /*!*******************************************!*\
            !*** ./src/parsers/utils/anumToSymbol.ts ***!
            \*******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              anumToSymbol: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = {
              1: "H",
              2: "He",
              3: "Li",
              4: "Be",
              5: "B",
              6: "C",
              7: "N",
              8: "O",
              9: "F",
              10: "Ne",
              11: "Na",
              12: "Mg",
              13: "Al",
              14: "Si",
              15: "P",
              16: "S",
              17: "Cl",
              18: "Ar",
              19: "K",
              20: "Ca",
              21: "Sc",
              22: "Ti",
              23: "V",
              24: "Cr",
              25: "Mn",
              26: "Fe",
              27: "Co",
              28: "Ni",
              29: "Cu",
              30: "Zn",
              31: "Ga",
              32: "Ge",
              33: "As",
              34: "Se",
              35: "Br",
              36: "Kr",
              37: "Rb",
              38: "Sr",
              39: "Y",
              40: "Zr",
              41: "Nb",
              42: "Mo",
              43: "Tc",
              44: "Ru",
              45: "Rh",
              46: "Pd",
              47: "Ag",
              48: "Cd",
              49: "In",
              50: "Sn",
              51: "Sb",
              52: "Te",
              53: "I",
              54: "Xe",
              55: "Cs",
              56: "Ba",
              71: "Lu",
              72: "Hf",
              73: "Ta",
              74: "W",
              75: "Re",
              76: "Os",
              77: "Ir",
              78: "Pt",
              79: "Au",
              80: "Hg",
              81: "Tl",
              82: "Pb",
              83: "Bi",
              84: "Po",
              85: "At",
              86: "Rn",
              87: "Fr",
              88: "Ra",
              104: "Rf",
              105: "Db",
              106: "Sg",
              107: "Bh",
              108: "Hs",
              109: "Mt",
              110: "Ds",
              111: "Rg",
              112: "Cn",
              113: "Nh",
              114: "Fl",
              115: "Mc",
              116: "Lv",
              117: "Ts",
              118: "Og",
              57: "La",
              58: "Ce",
              59: "Pr",
              60: "Nd",
              61: "Pm",
              62: "Sm",
              63: "Eu",
              64: "Gd",
              65: "Tb",
              66: "Dy",
              67: "Ho",
              68: "Er",
              69: "Tm",
              70: "Yb",
              89: "Ac",
              90: "Th",
              91: "Pa",
              92: "U",
              93: "Np",
              94: "Pu",
              95: "Am",
              96: "Cm",
              97: "Bk",
              98: "Cf",
              99: "Es",
              100: "Fm",
              101: "Md",
              102: "No"
            };
          }
        ),
        /***/
        "./src/parsers/utils/areConnected.ts": (
          /*!*******************************************!*\
            !*** ./src/parsers/utils/areConnected.ts ***!
            \*******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              areConnected: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            var r = t(
              /*! ./bondLength */
              "./src/parsers/utils/bondLength.ts"
            );
            const a = /* @__PURE__ */ new Set(["Na", "K", "Ca", "Mg", "Mn", "Sr"]);
            function l(h, c, d) {
              if (d && d.unboundCations && (a.has(h.elem) || a.has(c.elem)))
                return !1;
              let _ = (0, r.bondLength)(h.elem) + (0, r.bondLength)(c.elem);
              _ += 0.25, _ *= _;
              let m = h.x - c.x;
              if (m *= m, m > _)
                return !1;
              let y = h.y - c.y;
              if (y *= y, y > _)
                return !1;
              let x = h.z - c.z;
              if (x *= x, x > _)
                return !1;
              const b = m + y + x;
              return !(isNaN(b) || b < 0.5 || b > _ || h.altLoc !== c.altLoc && h.altLoc.trim() !== "" && c.altLoc.trim() !== "");
            }
          }
        ),
        /***/
        "./src/parsers/utils/assignBackboneHBonds.ts": (
          /*!***************************************************!*\
            !*** ./src/parsers/utils/assignBackboneHBonds.ts ***!
            \***************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              assignBackboneHBonds: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            function r(a, l) {
              const h = l || 3.2, c = h * h, d = [];
              for (let _ = 0, m = a.length; _ < m; _++) {
                a[_].index = _;
                const y = a[_];
                !y.hetflag && (y.atom === "N" || y.atom === "O") && (d.push(y), y.hbondOther = null, y.hbondDistanceSq = Number.POSITIVE_INFINITY);
              }
              d.sort(function(_, m) {
                return _.z - m.z;
              });
              for (let _ = 0, m = d.length; _ < m; _++) {
                const y = d[_];
                for (let x = _ + 1; x < m; x++) {
                  const b = d[x], A = b.z - y.z;
                  if (A > h)
                    break;
                  if (b.atom == y.atom)
                    continue;
                  const f = Math.abs(b.y - y.y);
                  if (f > h)
                    continue;
                  const s = Math.abs(b.x - y.x);
                  if (s > h)
                    continue;
                  const u = s * s + f * f + A * A;
                  u > c || b.chain == y.chain && Math.abs(b.resi - y.resi) < 4 || (u < y.hbondDistanceSq && (y.hbondOther = b, y.hbondDistanceSq = u), u < b.hbondDistanceSq && (b.hbondOther = y, b.hbondDistanceSq = u));
                }
              }
            }
          }
        ),
        /***/
        "./src/parsers/utils/assignBonds.ts": (
          /*!******************************************!*\
            !*** ./src/parsers/utils/assignBonds.ts ***!
            \******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              assignBonds: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./areConnected */
              "./src/parsers/utils/areConnected.ts"
            );
            const a = [
              { x: 0, y: 0, z: 1 },
              { x: 0, y: 1, z: -1 },
              { x: 0, y: 1, z: 0 },
              { x: 0, y: 1, z: 1 },
              { x: 1, y: -1, z: -1 },
              { x: 1, y: -1, z: 0 },
              { x: 1, y: -1, z: 1 },
              { x: 1, y: 0, z: -1 },
              { x: 1, y: 0, z: 0 },
              { x: 1, y: 0, z: 1 },
              { x: 1, y: 1, z: -1 },
              { x: 1, y: 1, z: 0 },
              { x: 1, y: 1, z: 1 }
            ], l = 4.95;
            function h(c, d) {
              for (let y = 0, x = c.length; y < x; y++)
                c[y].index || (c[y].index = y);
              const _ = {
                x: {
                  y: {
                    z: []
                  }
                }
              };
              for (let y = 0; y < c.length; y++) {
                const x = c[y], b = Math.floor(x.x / l), A = Math.floor(x.y / l), f = Math.floor(x.z / l);
                _[b] || (_[b] = {}), _[b][A] || (_[b][A] = {}), _[b][A][f] || (_[b][A][f] = []), _[b][A][f].push(x);
              }
              function m(y, x) {
                for (let b = 0; b < y.length; b++) {
                  const A = y[b];
                  for (let f = 0; f < x.length; f++) {
                    const s = x[f];
                    if ((0, r.areConnected)(A, s, d)) {
                      const u = A.bonds.indexOf(s.index), p = s.bonds.indexOf(A.index);
                      u === -1 && p === -1 ? (A.bonds.push(s.index), A.bondOrder.push(1), s.bonds.push(A.index), s.bondOrder.push(1)) : u === -1 ? (A.bonds.push(s.index), A.bondOrder.push(s.bondOrder[p])) : p === -1 && (s.bonds.push(A.index), s.bondOrder.push(A.bondOrder[u]));
                    }
                  }
                }
              }
              for (let y in _) {
                const x = parseInt(y);
                for (let b in _[x]) {
                  const A = parseInt(b);
                  for (let f in _[x][A]) {
                    const s = parseInt(f), u = _[x][A][s];
                    for (let p = 0; p < u.length; p++) {
                      const g = u[p];
                      for (let w = p + 1; w < u.length; w++) {
                        const o = u[w];
                        (0, r.areConnected)(g, o, d) && g.bonds.indexOf(o.index) == -1 && (g.bonds.push(o.index), g.bondOrder.push(1), o.bonds.push(g.index), o.bondOrder.push(1));
                      }
                    }
                    for (let p = 0; p < a.length; p++) {
                      const g = a[p];
                      if (!_[x + g.x] || !_[x + g.x][A + g.y] || !_[x + g.x][A + g.y][s + g.z])
                        continue;
                      const w = _[x + g.x][A + g.y][s + g.z];
                      m(u, w);
                    }
                  }
                }
              }
            }
          }
        ),
        /***/
        "./src/parsers/utils/assignPDBBonds.ts": (
          /*!*********************************************!*\
            !*** ./src/parsers/utils/assignPDBBonds.ts ***!
            \*********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              assignPDBBonds: () => (
                /* binding */
                h
              )
              /* harmony export */
            });
            var r = t(
              /*! ./areConnected */
              "./src/parsers/utils/areConnected.ts"
            ), a = t(
              /*! ./assignBonds */
              "./src/parsers/utils/assignBonds.ts"
            ), l = t(
              /*! ./standardResidues */
              "./src/parsers/utils/standardResidues.ts"
            );
            function h(c, d) {
              const _ = [], m = [];
              for (let A = 0, f = c.length; A < f; A++) {
                const s = c[A];
                s.index = A, s.hetflag || !l.standardResidues.has(s.resn) ? m.push(s) : _.push(s);
              }
              (0, a.assignBonds)(m, d), _.sort(function(A, f) {
                return A.chain !== f.chain ? A.chain < f.chain ? -1 : 1 : A.resi - f.resi;
              });
              let y = -1, x = -1, b;
              for (let A = 0, f = _.length; A < f; A++) {
                const s = _[A];
                s.resi !== y && (y = s.resi, b || x++, b = !1), s.reschain = x;
                for (let u = A + 1; u < _.length; u++) {
                  const p = _[u];
                  if (p.chain !== s.chain || p.resi - s.resi > 1)
                    break;
                  (0, r.areConnected)(s, p, d) && (s.bonds.indexOf(p.index) === -1 && (s.bonds.push(p.index), s.bondOrder.push(1), p.bonds.push(s.index), p.bondOrder.push(1)), s.resi !== p.resi && (b = !0));
                }
              }
            }
          }
        ),
        /***/
        "./src/parsers/utils/atomNameToElem.ts": (
          /*!*********************************************!*\
            !*** ./src/parsers/utils/atomNameToElem.ts ***!
            \*********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              atomNameToElem: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ./bondLength */
              "./src/parsers/utils/bondLength.ts"
            );
            function a(l, h) {
              let c = l.replace(/ /g, "");
              return c.length > 0 && c[0] === "H" && c !== "Hg" && c !== "He" && c !== "Hf" && c !== "Hs" && c !== "Ho" && (c = "H"), c.length > 1 && (c = c[0].toUpperCase() + c.substring(1).toLowerCase(), r.bondTable[c] === void 0 ? c = c[0] : h && (c === "Ca" || c === "Cd") && (c = "C")), c;
            }
          }
        ),
        /***/
        "./src/parsers/utils/bondLength.ts": (
          /*!*****************************************!*\
            !*** ./src/parsers/utils/bondLength.ts ***!
            \*****************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              bondLength: () => (
                /* binding */
                a
              ),
              /* harmony export */
              bondTable: () => (
                /* binding */
                r
              ),
              /* harmony export */
              setBondLength: () => (
                /* binding */
                l
              )
              /* harmony export */
            });
            let r = {
              H: 0.37,
              He: 0.32,
              Li: 1.34,
              Be: 0.9,
              B: 0.82,
              C: 0.77,
              N: 0.75,
              O: 0.73,
              F: 0.71,
              Ne: 0.69,
              Na: 1.54,
              Mg: 1.3,
              Al: 1.18,
              Si: 1.11,
              P: 1.06,
              S: 1.02,
              Cl: 0.99,
              Ar: 0.97,
              K: 1.96,
              Ca: 1.74,
              Sc: 1.44,
              Ti: 1.56,
              V: 1.25,
              /* Cr */
              Mn: 1.39,
              Fe: 1.25,
              Co: 1.26,
              Ni: 1.21,
              Cu: 1.38,
              Zn: 1.31,
              Ga: 1.26,
              Ge: 1.22,
              /* As */
              Se: 1.16,
              Br: 1.14,
              Kr: 1.1,
              Rb: 2.11,
              Sr: 1.92,
              Y: 1.62,
              Zr: 1.48,
              Nb: 1.37,
              Mo: 1.45,
              Tc: 1.56,
              Ru: 1.26,
              Rh: 1.35,
              Pd: 1.31,
              Ag: 1.53,
              Cd: 1.48,
              In: 1.44,
              Sn: 1.41,
              Sb: 1.38,
              Te: 1.35,
              I: 1.33,
              Xe: 1.3,
              Cs: 2.25,
              Ba: 1.98,
              Lu: 1.6,
              Hf: 1.5,
              Ta: 1.38,
              W: 1.46,
              Re: 1.59,
              Os: 1.44,
              Ir: 1.37,
              Pt: 1.28,
              Au: 1.44,
              Hg: 1.49,
              Tl: 1.48,
              Pb: 1.47,
              Bi: 1.46,
              /* Po */
              /* At */
              Rn: 1.45
              // None of the bottom row or any of the Lanthanides have bond lengths
            };
            function a(h) {
              return r[h] || 1.6;
            }
            function l(h, c) {
              c < 0 && (c = 0), r[h] = c;
            }
          }
        ),
        /***/
        "./src/parsers/utils/computeSecondaryStructure.ts": (
          /*!********************************************************!*\
            !*** ./src/parsers/utils/computeSecondaryStructure.ts ***!
            \********************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              computeSecondaryStructure: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ./assignBackboneHBonds */
              "./src/parsers/utils/assignBackboneHBonds.ts"
            );
            function a(l, h) {
              (0, r.assignBackboneHBonds)(l, h);
              const c = {};
              let d, _, m, y, x, b;
              for (d = 0, _ = l.length; d < _; d++)
                if (x = l[d], c[x.chain] === void 0 && (c[x.chain] = []), isFinite(x.hbondDistanceSq)) {
                  const A = x.hbondOther;
                  c[A.chain] === void 0 && (c[A.chain] = []), Math.abs(A.resi - x.resi) === 4 && (c[x.chain][x.resi] = "h");
                }
              for (m in c)
                for (y = 1; y < c[m].length - 1; y++) {
                  const A = c[m][y - 1], f = c[m][y + 1];
                  b = c[m][y], A == "h" && A == f && b != A && (c[m][y] = A);
                }
              for (d = 0, _ = l.length; d < _; d++)
                x = l[d], isFinite(x.hbondDistanceSq) && c[x.chain][x.resi] != "h" && x.ss !== "h" && (c[x.chain][x.resi] = "maybesheet");
              for (let A = 0, f = l.length; A < f; A++)
                if (x = l[A], isFinite(x.hbondDistanceSq) && c[x.chain][x.resi] == "maybesheet") {
                  let s = x.hbondOther, u = c[s.chain][s.resi];
                  (u == "maybesheet" || u == "s") && (c[x.chain][x.resi] = "s", c[s.chain][s.resi] = "s");
                }
              for (let A in c) {
                for (let f = 1; f < c[A].length - 1; f++) {
                  const s = c[A][f - 1], u = c[A][f + 1];
                  b = c[A][f], s == "s" && s == u && b != s && (c[A][f] = s);
                }
                for (let f = 0; f < c[A].length; f++) {
                  const s = c[A][f];
                  (s == "h" || s == "s") && c[A][f - 1] != s && c[A][f + 1] != s && delete c[A][f];
                }
              }
              for (d = 0, _ = l.length; d < _; d++)
                x = l[d], b = c[x.chain][x.resi], delete x.hbondOther, delete x.hbondDistanceSq, !(b === void 0 || b === "maybesheet") && (x.ss = b, c[x.chain][x.resi - 1] != b && (x.ssbegin = !0), c[x.chain][x.resi + 1] != b && (x.ssend = !0));
            }
          }
        ),
        /***/
        "./src/parsers/utils/getSinglePDB.ts": (
          /*!*******************************************!*\
            !*** ./src/parsers/utils/getSinglePDB.ts ***!
            \*******************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              getSinglePDB: () => (
                /* binding */
                y
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../WebGL */
              "./src/WebGL/index.ts"
            ), a = t(
              /*! ./atomNameToElem */
              "./src/parsers/utils/atomNameToElem.ts"
            ), l = t(
              /*! ./bondLength */
              "./src/parsers/utils/bondLength.ts"
            ), h = t(
              /*! ./computeSecondaryStructure */
              "./src/parsers/utils/computeSecondaryStructure.ts"
            ), c = t(
              /*! ./isEmpty */
              "./src/parsers/utils/isEmpty.ts"
            ), d = t(
              /*! ./processSymmetries */
              "./src/parsers/utils/processSymmetries.ts"
            ), _ = t(
              /*! ./assignPDBBonds */
              "./src/parsers/utils/assignPDBBonds.ts"
            ), m = t(
              /*! ./validateBonds */
              "./src/parsers/utils/validateBonds.ts"
            );
            function y(x, b, A) {
              const f = [], s = b.assignBonds === void 0 ? !0 : b.assignBonds, u = !b.keepH, p = !!b.noSecondaryStructure, g = !b.noComputeSecondaryStructure, w = !b.doAssembly, o = b.altLoc ? b.altLoc : "A", v = { symmetries: [], cryst: void 0 };
              let M, E = [];
              const $ = [];
              let k;
              const L = {};
              for (let z = 0; z < x.length; z++) {
                k = x[z].replace(/^\s*/, "");
                const O = k.substring(0, 6);
                let R, N, W;
                if (O.indexOf("END") === 0) {
                  if (E = x.slice(z + 1), O === "END")
                    for (const B in A)
                      A.hasOwnProperty(B) && delete A[B];
                  break;
                } else if (O === "ATOM  " || O === "HETATM") {
                  let B, P, G, H, U, j, re, ie, te, ue, de, oe;
                  if (de = k.substring(16, 17), de !== " " && de !== o && o !== "*" || (ue = parseInt(k.substring(6, 11)), M = k.substring(12, 16).replace(/ /g, ""), B = k.substring(17, 20).replace(/ /g, ""), P = k.substring(21, 22), G = parseInt(k.substring(22, 26)), H = k.substring(26, 27), U = parseFloat(k.substring(30, 38)), j = parseFloat(k.substring(38, 46)), re = parseFloat(k.substring(46, 54)), oe = parseFloat(k.substring(60, 68)), te = k.substring(76, 78).replace(/ /g, ""), te === "" || l.bondTable[te] === void 0 ? te = (0, a.atomNameToElem)(k.substring(12, 14), k[0] == "A") : te = te[0].toUpperCase() + te.substring(1).toLowerCase(), te === "H" && u))
                    continue;
                  O[0] == "H" ? ie = !0 : ie = !1, $[ue] = f.length, f.push({
                    resn: B,
                    x: U,
                    y: j,
                    z: re,
                    elem: te,
                    hetflag: ie,
                    altLoc: de,
                    chain: P,
                    resi: G,
                    icode: H,
                    rescode: G + (H !== " " ? "^" + H : ""),
                    // resi
                    // and
                    // icode
                    serial: ue,
                    atom: M,
                    bonds: [],
                    ss: "c",
                    bondOrder: [],
                    properties: {},
                    b: oe,
                    pdbline: k
                  });
                } else if (O === "SHEET ") {
                  R = k.substring(21, 22), N = parseInt(k.substring(22, 26)), W = parseInt(k.substring(33, 37)), R in A || (A[R] = {}), A[R][N] = "s1";
                  for (let B = N + 1; B < W; B++)
                    A[R][B] = "s";
                  A[R][W] = "s2";
                } else if (O === "CONECT") {
                  const B = parseInt(k.substring(6, 11)), P = $[B], G = f[P], H = [11, 16, 21, 26];
                  for (let U = 0; U < 4; U++) {
                    const j = parseInt(k.substring(H[U], H[U] + 5)), re = $[j];
                    let ie = P + ":" + re;
                    const te = f[re];
                    if (G !== void 0 && te !== void 0)
                      if (!L[ie])
                        L[ie] = 1, (G.bonds.length == 0 || G.bonds[G.bonds.length - 1] !== re) && (G.bonds.push(re), G.bondOrder.push(1));
                      else {
                        L[ie] += 1;
                        for (let ue = 0; ue < G.bonds.length; ue++)
                          if (G.bonds[ue] == re) {
                            const de = L[ie];
                            de >= 4 ? G.bondOrder[ue] = 1 : G.bondOrder[ue] = de;
                          }
                      }
                  }
                } else if (O === "HELIX ") {
                  R = k.substring(19, 20), N = parseInt(k.substring(21, 25)), W = parseInt(k.substring(33, 37)), R in A || (A[R] = {}), A[R][N] = "h1";
                  for (let B = N + 1; B < W; B++)
                    A[R][B] = "h";
                  A[R][W] = "h2";
                } else if (!w && O === "REMARK" && k.substring(13, 18) === "BIOMT") {
                  let B, P = new r.Matrix4();
                  for (B = 1; B <= 3; B++)
                    if (k = x[z].replace(/^\s*/, ""), parseInt(k.substring(18, 19)) == B)
                      P.elements[B - 1] = parseFloat(k.substring(23, 33)), P.elements[B - 1 + 4] = parseFloat(k.substring(33, 43)), P.elements[B - 1 + 8] = parseFloat(k.substring(43, 53)), P.elements[B - 1 + 12] = parseFloat(k.substring(53)), z++;
                    else
                      for (; k.substring(13, 18) === "BIOMT"; )
                        z++, k = x[z].replace(/^\s*/, "");
                  P.elements[3] = 0, P.elements[7] = 0, P.elements[11] = 0, P.elements[15] = 1, v.symmetries.push(P), z--;
                } else if (O === "CRYST1") {
                  let B, P, G, H, U, j;
                  B = parseFloat(k.substring(7, 15)), P = parseFloat(k.substring(16, 24)), G = parseFloat(k.substring(25, 33)), H = parseFloat(k.substring(34, 40)), U = parseFloat(k.substring(41, 47)), j = parseFloat(k.substring(48, 54)), v.cryst = {
                    a: B,
                    b: P,
                    c: G,
                    alpha: H,
                    beta: U,
                    gamma: j
                  };
                } else if (O === "ANISOU") {
                  const B = parseInt(k.substring(6, 11)), P = $[B], G = f[P];
                  if (G) {
                    const H = k.substring(30).trim().split(/\s+/), U = {
                      u11: parseInt(H[0]),
                      u22: parseInt(H[1]),
                      u33: parseInt(H[2]),
                      u12: parseInt(H[3]),
                      u13: parseInt(H[4]),
                      u23: parseInt(H[5])
                    };
                    G.uMat = U;
                  }
                }
              }
              if ((0, m.validateBonds)(f, $), s && (0, _.assignPDBBonds)(f, b), w || (0, d.processSymmetries)(v.symmetries, f, b, v.cryst), g && !p && (0, h.computeSecondaryStructure)(f, b.hbondCutoff), !(0, c.isEmpty)(A))
                for (let z = 0; z < f.length; z++) {
                  const O = f[z];
                  if (O !== void 0 && O.chain in A && O.resi in A[O.chain]) {
                    const R = A[O.chain][O.resi];
                    O.ss = R[0], R.length > 1 && (R[1] == "1" ? O.ssbegin = !0 : R[1] == "2" && (O.ssend = !0));
                  }
                }
              return [f, v, E];
            }
          }
        ),
        /***/
        "./src/parsers/utils/isEmpty.ts": (
          /*!**************************************!*\
            !*** ./src/parsers/utils/isEmpty.ts ***!
            \**************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              isEmpty: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            function r(a) {
              for (const l in a)
                return !1;
              return !0;
            }
          }
        ),
        /***/
        "./src/parsers/utils/processSymmetries.ts": (
          /*!************************************************!*\
            !*** ./src/parsers/utils/processSymmetries.ts ***!
            \************************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              processSymmetries: () => (
                /* binding */
                a
              )
              /* harmony export */
            });
            var r = t(
              /*! ../../WebGL */
              "./src/WebGL/index.ts"
            );
            function a(l, h, c, d) {
              const _ = !c.duplicateAssemblyAtoms, m = h.length;
              let y = m, x = -1, b = null, A = null;
              (c.normalizeAssembly || c.wrapAtoms) && d && (b = (0, r.conversionMatrix3)(d.a, d.b, d.c, d.alpha, d.beta, d.gamma), A = new r.Matrix3(), A.getInverse3(b));
              let f = function(p) {
                let g = p.clone().applyMatrix3(A);
                const w = [g.x, g.y, g.z], o = [0, 0, 0];
                for (let M = 0; M < 3; M++) {
                  for (; w[M] < -1e-3; )
                    w[M] += 1, o[M] += 1;
                  for (; w[M] > 1.001; )
                    w[M] -= 1, o[M] -= 1;
                }
                const v = new r.Vector3(o[0], o[1], o[2]);
                return v.applyMatrix3(b), v;
              };
              if (c.normalizeAssembly && d)
                for (let p = 0; p < l.length; p++) {
                  const g = new r.Vector3(0, 0, 0);
                  for (let o = 0; o < m; o++) {
                    const v = new r.Vector3(h[o].x, h[o].y, h[o].z);
                    v.applyMatrix4(l[p]), g.add(v);
                  }
                  g.divideScalar(m);
                  const w = f(g);
                  l[p].isNearlyIdentity() && w.lengthSq() > 1e-3 && (x = p), l[p].translate(w);
                }
              if (_) {
                if (l.length > 1)
                  for (let p = 0; p < h.length; p++) {
                    var s = [];
                    for (let g = 0; g < l.length; g++)
                      if (!l[g].isNearlyIdentity()) {
                        var u = new r.Vector3();
                        u.set(h[p].x, h[p].y, h[p].z), u.applyMatrix4(l[g]), s.push(u);
                      }
                    h[p].symmetries = s;
                  }
              } else {
                for (let p = 0; p < m; p++)
                  h[p].sym = -1;
                for (let p = 0; p < l.length; p++)
                  if (!l[p].isNearlyIdentity() && x != p) {
                    let g = new r.Vector3();
                    for (let w = 0; w < m; w++) {
                      const o = [];
                      for (let M = 0; M < h[w].bonds.length; M++)
                        o.push(h[w].bonds[M] + y);
                      if (g.set(h[w].x, h[w].y, h[w].z), g.applyMatrix4(l[p]), c.wrapAtoms && d) {
                        let M = f(g);
                        g.add(M);
                      }
                      const v = {};
                      for (const M in h[w])
                        v[M] = h[w][M];
                      v.x = g.x, v.y = g.y, v.z = g.z, v.bonds = o, v.sym = p, v.index = h.length, h.push(v);
                    }
                    y = h.length;
                  } else
                    for (let g = 0; g < m; g++)
                      h[g].sym = p;
                if (c.wrapAtoms && d) {
                  let p = new r.Vector3();
                  for (let g = 0; g < m; g++) {
                    p.set(h[g].x, h[g].y, h[g].z);
                    let w = f(p);
                    p.add(w), h[g].x = p.x, h[g].y = p.y, h[g].z = p.z;
                  }
                }
                if (x >= 0) {
                  const p = new r.Vector3();
                  for (let g = 0; g < m; g++)
                    p.set(h[g].x, h[g].y, h[g].z), p.applyMatrix4(l[x]), h[g].x = p.x, h[g].y = p.y, h[g].z = p.z;
                }
                l.length = 0;
              }
            }
          }
        ),
        /***/
        "./src/parsers/utils/standardResidues.ts": (
          /*!***********************************************!*\
            !*** ./src/parsers/utils/standardResidues.ts ***!
            \***********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              standardResidues: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = /* @__PURE__ */ new Set([
              "ABU",
              "ACD",
              "ALA",
              "ALB",
              "ALI",
              "ARG",
              "AR0",
              "ASN",
              "ASP",
              "ASX",
              "BAS",
              "CYS",
              "CYH",
              "CYX",
              "CSS",
              "CSH",
              "GLN",
              "GLU",
              "GLX",
              "GLY",
              "HIS",
              "HIE",
              "HID",
              "HIP",
              "HYP",
              "ILE",
              "ILU",
              "LEU",
              "LYS",
              "MET",
              "PCA",
              "PGA",
              "PHE",
              "PR0",
              "PRO",
              "PRZ",
              "SER",
              "THR",
              "TRP",
              "TYR",
              "VAL",
              "A",
              "1MA",
              "C",
              "5MC",
              "OMC",
              "G",
              "1MG",
              "2MG",
              "M2G",
              "7MG",
              "OMG",
              "YG",
              "I",
              "T",
              "U",
              "+U",
              "H2U",
              "5MU",
              "PSU",
              "ACE",
              "F0R",
              "H2O",
              "HOH",
              "WAT"
            ]);
          }
        ),
        /***/
        "./src/parsers/utils/validateBonds.ts": (
          /*!********************************************!*\
            !*** ./src/parsers/utils/validateBonds.ts ***!
            \********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              validateBonds: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            function r(a, l) {
              for (let h = 0, c = a.length; h < c; h++) {
                const d = a[h];
                for (let _ = 0; _ < d.bonds.length; _++) {
                  const m = d.bonds[_], y = a[m], x = l[d.serial];
                  y && x && y.bonds.indexOf(x) < 0 && (y.bonds.push(x), y.bondOrder.push(d.bondOrder[_]));
                }
              }
            }
          }
        ),
        /***/
        "./src/partialCharges.ts": (
          /*!*******************************!*\
            !*** ./src/partialCharges.ts ***!
            \*******************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              applyPartialCharges: () => (
                /* binding */
                a
              ),
              /* harmony export */
              partialCharges: () => (
                /* binding */
                r
              )
              /* harmony export */
            });
            const r = {
              "ALA:N": -0.15,
              "ALA:CA": 0.1,
              "ALA:CB": 0,
              "ALA:C": 0.6,
              "ALA:O": -0.55,
              "ARG:N": -0.15,
              "ARG:CA": 0.1,
              "ARG:CB": 0,
              "ARG:CG": 0,
              "ARG:CD": 0.1,
              "ARG:NE": -0.1,
              "ARG:CZ": 0.5,
              "ARG:NH1": 0.25,
              "ARG:NH2": 0.25,
              "ARG:C": 0.6,
              "ARG:O": -0.55,
              "ASN:N": -0.15,
              "ASN:CA": 0.1,
              "ASN:CB": 0,
              "ASN:CG": 0.55,
              "ASN:OD1": -0.55,
              "ASN:ND2": 0,
              "ASN:C": 0.6,
              "ASN:O": -0.55,
              "ASP:N": -0.15,
              "ASP:CA": 0.1,
              "ASP:CB": 0,
              "ASP:CG": 0.14,
              "ASP:OD1": -0.57,
              "ASP:OD2": -0.57,
              "ASP:C": 0.6,
              "ASP:O": -0.55,
              "CYS:N": -0.15,
              "CYS:CA": 0.1,
              "CYS:CB": 0.19,
              "CYS:SG": -0.19,
              "CYS:C": 0.6,
              "CYS:O": -0.55,
              "GLN:N": -0.15,
              "GLN:CA": 0.1,
              "GLN:CB": 0,
              "GLN:CG": 0,
              "GLN:CD": 0.55,
              "GLN:OE1": -0.55,
              "GLN:NE2": 0,
              "GLN:C": 0.6,
              "GLN:O": -0.55,
              "GLU:N": -0.15,
              "GLU:CA": 0.1,
              "GLU:CB": 0,
              "GLU:CG": 0,
              "GLU:CD": 0.14,
              "GLU:OE1": -0.57,
              "GLU:OE2": -0.57,
              "GLU:C": 0.6,
              "GLU:O": -0.55,
              "GLY:N": -0.15,
              "GLY:CA": 0.1,
              "GLY:C": 0.6,
              "GLY:O": -0.55,
              "HIS:N": -0.15,
              "HIS:CA": 0.1,
              "HIS:CB": 0,
              "HIS:CG": 0.1,
              "HIS:ND1": -0.1,
              "HIS:CD2": 0.1,
              "HIS:NE2": -0.4,
              "HIS:CE1": 0.3,
              "HIS:C": 0.6,
              "HIS:O": -0.55,
              "ILE:N": -0.15,
              "ILE:CA": 0.1,
              "ILE:CB": 0,
              "ILE:CG2": 0,
              "ILE:CG1": 0,
              "ILE:CD": 0,
              "ILE:C": 0.6,
              "ILE:O": -0.55,
              "LEU:N": -0.15,
              "LEU:CA": 0.1,
              "LEU:CB": 0,
              "LEU:CG": 0,
              "LEU:CD1": 0,
              "LEU:CD2": 0,
              "LEU:C": 0.6,
              "LEU:O": -0.55,
              "LYS:N": -0.15,
              "LYS:CA": 0.1,
              "LYS:CB": 0,
              "LYS:CG": 0,
              "LYS:CD": 0,
              "LYS:CE": 0.25,
              "LYS:NZ": 0.75,
              "LYS:C": 0.6,
              "LYS:O": -0.55,
              "MET:N": -0.15,
              "MET:CA": 0.1,
              "MET:CB": 0,
              "MET:CG": 0.06,
              "MET:SD": -0.12,
              "MET:CE": 0.06,
              "MET:C": 0.6,
              "MET:O": -0.55,
              "PHE:N": -0.15,
              "PHE:CA": 0.1,
              "PHE:CB": 0,
              "PHE:CG": 0,
              "PHE:CD1": 0,
              "PHE:CD2": 0,
              "PHE:CE1": 0,
              "PHE:CE2": 0,
              "PHE:CZ": 0,
              "PHE:C": 0.6,
              "PHE:O": -0.55,
              "PRO:N": -0.25,
              "PRO:CD": 0.1,
              "PRO:CA": 0.1,
              "PRO:CB": 0,
              "PRO:CG": 0,
              "PRO:C": 0.6,
              "PRO:O": -0.55,
              "SER:N": -0.15,
              "SER:CA": 0.1,
              "SER:CB": 0.25,
              "SER:OG": -0.25,
              "SER:C": 0.6,
              "SER:O": -0.55,
              "THR:N": -0.15,
              "THR:CA": 0.1,
              "THR:CB": 0.25,
              "THR:OG1": -0.25,
              "THR:CG2": 0,
              "THR:C": 0.6,
              "THR:O": -0.55,
              "TRP:N": -0.15,
              "TRP:CA": 0.1,
              "TRP:CB": 0,
              "TRP:CG": -0.03,
              "TRP:CD2": 0.1,
              "TRP:CE2": -0.04,
              "TRP:CE3": -0.03,
              "TRP:CD1": 0.06,
              "TRP:NE1": -0.06,
              "TRP:CZ2": 0,
              "TRP:CZ3": 0,
              "TRP:CH2": 0,
              "TRP:C": 0.6,
              "TRP:O": -0.55,
              "TYR:N": -0.15,
              "TYR:CA": 0.1,
              "TYR:CB": 0,
              "TYR:CG": 0,
              "TYR:CD1": 0,
              "TYR:CE1": 0,
              "TYR:CD2": 0,
              "TYR:CE2": 0,
              "TYR:CZ": 0.25,
              "TYR:OH": -0.25,
              "TYR:C": 0.6,
              "TYR:O": -0.55,
              "VAL:N": -0.15,
              "VAL:CA": 0.1,
              "VAL:CB": 0,
              "VAL:CG1": 0,
              "VAL:CG2": 0,
              "VAL:C": 0.6,
              "VAL:O": -0.55
            };
            function a(l, h) {
              if ((!h || typeof l.partialCharge > "u") && l.resn && l.atom) {
                var c = l.resn + ":" + l.atom;
                l.properties.partialCharge = r[c];
              }
            }
          }
        ),
        /***/
        "./src/specs.ts": (
          /*!**********************!*\
            !*** ./src/specs.ts ***!
            \**********************/
          /***/
          (n, e, t) => {
            t.r(e);
          }
        ),
        /***/
        "./src/utilities.ts": (
          /*!**************************!*\
            !*** ./src/utilities.ts ***!
            \**************************/
          /***/
          (__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
            __webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
              /* harmony export */
              PausableTimer: () => (
                /* binding */
                PausableTimer
              ),
              /* harmony export */
              adjustVolumeStyle: () => (
                /* binding */
                adjustVolumeStyle
              ),
              /* harmony export */
              base64ToArray: () => (
                /* binding */
                base64ToArray
              ),
              /* harmony export */
              deepCopy: () => (
                /* binding */
                deepCopy
              ),
              /* harmony export */
              download: () => (
                /* binding */
                download
              ),
              /* harmony export */
              extend: () => (
                /* binding */
                extend
              ),
              /* harmony export */
              get: () => (
                /* binding */
                get
              ),
              /* harmony export */
              getAtomProperty: () => (
                /* binding */
                getAtomProperty
              ),
              /* harmony export */
              getColorFromStyle: () => (
                /* binding */
                getColorFromStyle
              ),
              /* harmony export */
              getElement: () => (
                /* binding */
                getElement
              ),
              /* harmony export */
              getExtent: () => (
                /* binding */
                getExtent
              ),
              /* harmony export */
              getPropertyRange: () => (
                /* binding */
                getPropertyRange
              ),
              /* harmony export */
              getbin: () => (
                /* binding */
                getbin
              ),
              /* harmony export */
              inflateString: () => (
                /* binding */
                inflateString
              ),
              /* harmony export */
              isEmptyObject: () => (
                /* binding */
                isEmptyObject
              ),
              /* harmony export */
              isNumeric: () => (
                /* binding */
                isNumeric
              ),
              /* harmony export */
              makeFunction: () => (
                /* binding */
                makeFunction
              ),
              /* harmony export */
              mergeGeos: () => (
                /* binding */
                mergeGeos
              ),
              /* harmony export */
              specStringToObject: () => (
                /* binding */
                specStringToObject
              )
              /* harmony export */
            });
            var _Gradient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
              /*! ./Gradient */
              "./src/Gradient.ts"
            ), _VolumeData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(
              /*! ./VolumeData */
              "./src/VolumeData.ts"
            ), _colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(
              /*! ./colors */
              "./src/colors.ts"
            ), pako__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(
              /*! pako */
              "./node_modules/pako/dist/pako.esm.mjs"
            );
            function extend(n, e) {
              for (var t in e)
                e.hasOwnProperty(t) && e[t] !== void 0 && (n[t] = e[t]);
              return n;
            }
            function deepCopy(n) {
              let e, t, r;
              if (n == null)
                return {};
              if (typeof n != "object" || n === null)
                return n;
              e = Array.isArray(n) ? [] : {};
              for (r in n)
                t = n[r], e[r] = deepCopy(t);
              return e;
            }
            function isNumeric(n) {
              var e = typeof n;
              return (e === "number" || e === "string") && !isNaN(n - parseFloat(n));
            }
            function isEmptyObject(n) {
              var e;
              for (e in n)
                return !1;
              return !0;
            }
            function makeFunction(callback) {
              return callback && typeof callback == "string" && (callback = eval("(" + callback + ")")), callback && typeof callback != "function" ? (console.warn("Invalid callback provided."), () => {
              }) : callback;
            }
            function adjustVolumeStyle(n) {
              n && (n.volformat && !(n.voldata instanceof _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData) && (n.voldata = new _VolumeData__WEBPACK_IMPORTED_MODULE_1__.VolumeData(n.voldata, n.volformat)), n.volscheme && (n.volscheme = _Gradient__WEBPACK_IMPORTED_MODULE_0__.Gradient.getGradient(n.volscheme)));
            }
            function getExtent(n, e) {
              var t, r, a, l, h, c, d, _, m, y, x = !e;
              if (t = r = a = 9999, l = h = c = -9999, d = _ = m = y = 0, n.length === 0)
                return [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
              for (var b = 0; b < n.length; b++) {
                var A = n[b];
                if (!(typeof A > "u" || !isFinite(A.x) || !isFinite(A.y) || !isFinite(A.z)) && (y++, d += A.x, _ += A.y, m += A.z, t = t < A.x ? t : A.x, r = r < A.y ? r : A.y, a = a < A.z ? a : A.z, l = l > A.x ? l : A.x, h = h > A.y ? h : A.y, c = c > A.z ? c : A.z, A.symmetries && x))
                  for (var f = 0; f < A.symmetries.length; f++)
                    y++, d += A.symmetries[f].x, _ += A.symmetries[f].y, m += A.symmetries[f].z, t = t < A.symmetries[f].x ? t : A.symmetries[f].x, r = r < A.symmetries[f].y ? r : A.symmetries[f].y, a = a < A.symmetries[f].z ? a : A.symmetries[f].z, l = l > A.symmetries[f].x ? l : A.symmetries[f].x, h = h > A.symmetries[f].y ? h : A.symmetries[f].y, c = c > A.symmetries[f].z ? c : A.symmetries[f].z;
              }
              return [
                [t, r, a],
                [l, h, c],
                [d / y, _ / y, m / y]
              ];
            }
            function getPropertyRange(n, e) {
              for (var t = Number.POSITIVE_INFINITY, r = Number.NEGATIVE_INFINITY, a = 0, l = n.length; a < l; a++) {
                var h = n[a], c = getAtomProperty(h, e);
                c != null && (c < t && (t = c), c > r && (r = c));
              }
              return !isFinite(t) && !isFinite(r) ? t = r = 0 : isFinite(t) ? isFinite(r) || (r = t) : t = r, [t, r];
            }
            class PausableTimer {
              constructor(e, t, r) {
                this.total_time_run = 0, this.fn = e, this.arg = r, this.countdown = t, this.start_time = (/* @__PURE__ */ new Date()).getTime(), this.ident = setTimeout(e, t, r);
              }
              cancel() {
                clearTimeout(this.ident);
              }
              pause() {
                clearTimeout(this.ident), this.total_time_run = (/* @__PURE__ */ new Date()).getTime() - this.start_time;
              }
              resume() {
                this.ident = setTimeout(this.fn, Math.max(0, this.countdown - this.total_time_run), this.arg);
              }
            }
            function base64ToArray(n) {
              for (var e = window.atob(n), t = e.length, r = new Uint8Array(t), a = 0; a < t; a++)
                r[a] = e.charCodeAt(a);
              return r;
            }
            function getAtomProperty(n, e) {
              var t = null;
              return n.properties && typeof n.properties[e] < "u" ? t = n.properties[e] : typeof n[e] < "u" && (t = n[e]), t;
            }
            function mergeGeos(n, e) {
              var t = e.geometry;
              t !== void 0 && n.geometryGroups.push(t.geometryGroups[0]);
            }
            function specStringToObject(n) {
              if (typeof n == "object")
                return n;
              if (typeof n > "u" || n == null)
                return n;
              try {
                return JSON.parse(n);
              } catch {
              }
              n = n.replace(/%7E/g, "~");
              var e = function(x) {
                return isNumeric(x) ? Math.floor(parseFloat(x)) == parseInt(x) || x.indexOf(".") >= 0 ? parseFloat(x) : parseInt(x) : x === "true" ? !0 : x === "false" ? !1 : x;
              }, t = {};
              if (n === "all")
                return t;
              for (var r = n.split(";"), a = 0; a < r.length; a++) {
                var l = r[a].split(":"), h = l[0], c = {}, d = l[1];
                if (d)
                  if (d = d.replace(/~/g, "="), d.indexOf("=") !== -1)
                    for (var _ = d.split(","), m = 0; m < _.length; m++) {
                      var y = _[m].split("=", 2);
                      c[y[0]] = e(y[1]);
                    }
                  else d.indexOf(",") !== -1 ? c = d.split(",") : c = e(d);
                t[h] = c;
              }
              return t;
            }
            function checkStatus(n) {
              if (!n.ok)
                throw new Error(`HTTP ${n.status} - ${n.statusText}`);
              return n;
            }
            function get(n, e) {
              var t = fetch(n).then(checkStatus).then((r) => r.text());
              return e ? t.then(e) : t;
            }
            function getbin(n, e, t, r) {
              var a;
              return t == "POST" ? a = fetch(n, { method: "POST", body: r }).then((l) => checkStatus(l)).then((l) => l.arrayBuffer()) : a = fetch(n).then((l) => checkStatus(l)).then((l) => l.arrayBuffer()), e ? a.then(e) : a;
            }
            function download(n, e, t, r) {
              var a = "", l = "", h = "", c = null, d = e.addModel();
              if (n.indexOf(":") < 0 && (n.length == 4 ? n = "pdb:" + n : isNaN(n) ? n = "url:" + n : n = "cid:" + n), n.substring(0, 5) == "mmtf:" && (console.warn("WARNING: MMTF now deprecated.  Reverting to bcif."), n = "bcif:" + n.slice(5)), n.substring(0, 5) === "bcif:")
                n = n.substring(5).toUpperCase(), h = "https://models.rcsb.org/" + n + ".bcif.gz", t && typeof t.noComputeSecondaryStructure > "u" && (t.noComputeSecondaryStructure = !0), c = new Promise(function(m) {
                  getbin(h).then(function(y) {
                    d.addMolData(y, "bcif.gz", t), e.zoomTo(), e.render(), m(d);
                  }, function() {
                    console.error("fetch of " + h + " failed.");
                  });
                });
              else {
                if (n.substring(0, 4) === "pdb:") {
                  if (a = "bcif", t && t.format && (a = t.format), t && typeof t.noComputeSecondaryStructure > "u" && (t.noComputeSecondaryStructure = !0), n = n.substring(4).toUpperCase(), !n.match(/^[1-9][A-Za-z0-9]{3}$/)) {
                    alert("Wrong PDB ID");
                    return;
                  }
                  a == "bcif" ? h = "https://models.rcsb.org/" + n.toUpperCase() + ".bcif.gz" : (l = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = l + n + "." + a);
                } else if (n.substring(0, 4) == "cid:") {
                  if (a = "sdf", n = n.substring(4), !n.match(/^[0-9]+$/)) {
                    alert("Wrong Compound ID");
                    return;
                  }
                  h = "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/" + n + "/SDF?record_type=3d";
                } else n.substring(0, 4) == "url:" && (h = n.substring(4), a = h);
                var _ = function(m) {
                  d.addMolData(m, a, t), e.zoomTo(), e.render();
                };
                c = new Promise(function(m) {
                  a == "bcif" ? getbin(h).then(function(y) {
                    _(y), m(d);
                  }).catch(function() {
                    l = t && t.pdbUri ? t.pdbUri : "https://files.rcsb.org/view/", h = l + n + ".pdb", a = "pdb", console.warn("falling back to pdb format"), get(h).then(function(y) {
                      _(y), m(d);
                    }).catch(function(y) {
                      _(""), m(d), console.error("fetch of " + h + " failed: " + y.statusText);
                    });
                  }) : get(h).then(function(y) {
                    _(y), m(d);
                  }).catch(function(y) {
                    _(""), m(d), console.error("fetch of " + h + " failed: " + y.statusText);
                  });
                });
              }
              return r ? (c.then(function(m) {
                r(m);
              }), d) : c;
            }
            function getColorFromStyle(n, e) {
              let t = e.colorscheme;
              if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t] < "u")
                t = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t];
              else if (typeof t == "string" && t.endsWith("Carbon")) {
                let h = t.substring(0, t.lastIndexOf("Carbon")).toLowerCase();
                if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[h] < "u") {
                  let c = Object.assign({}, _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors.defaultColors);
                  c.C = _colors__WEBPACK_IMPORTED_MODULE_2__.htmlColors[h], _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t] = { prop: "elem", map: c }, t = _colors__WEBPACK_IMPORTED_MODULE_2__.builtinColorSchemes[t];
                }
              }
              let r = n.color;
              if (typeof e.color < "u" && e.color != "spectrum" && (r = e.color), typeof t < "u") {
                let h, c;
                if (typeof _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[t] < "u")
                  t = _colors__WEBPACK_IMPORTED_MODULE_2__.elementColors[t], typeof t[n[t.prop]] < "u" && (r = t.map[n[t.prop]]);
                else if (typeof t[n[t.prop]] < "u")
                  r = t.map[n[t.prop]];
                else if (typeof t.prop < "u" && typeof t.gradient < "u") {
                  h = t.prop;
                  var a = t.gradient;
                  a instanceof _Gradient__WEBPACK_IMPORTED_MODULE_0__.GradientType || (a = (0, _Gradient__WEBPACK_IMPORTED_MODULE_0__.getGradient)(t));
                  let d = a.range() || [-1, 1];
                  c = getAtomProperty(n, h), c != null && (r = a.valueToHex(c, d));
                } else typeof t.prop < "u" && typeof t.map < "u" ? (h = t.prop, c = getAtomProperty(n, h), typeof t.map[c] < "u" && (r = t.map[c])) : typeof e.colorscheme[n.elem] < "u" ? r = e.colorscheme[n.elem] : console.warn("Could not interpret colorscheme " + t);
              } else typeof e.colorfunc < "u" && (r = e.colorfunc(n));
              return _colors__WEBPACK_IMPORTED_MODULE_2__.CC.color(r);
            }
            function getElement(n) {
              let e = n;
              return typeof n == "string" ? e = document.querySelector("#" + n) : typeof n == "object" && n.get && (e = n.get(0)), e;
            }
            function inflateString(n, e = !0) {
              let t;
              return typeof n == "string" ? t = new TextEncoder().encode(n) : t = new Uint8Array(n), (0, pako__WEBPACK_IMPORTED_MODULE_3__.inflate)(t, {
                to: e ? "string" : null
              });
            }
          }
        ),
        /***/
        "./node_modules/upng-js/UPNG.js": (
          /*!**************************************!*\
            !*** ./node_modules/upng-js/UPNG.js ***!
            \**************************************/
          /***/
          (n, e, t) => {
            (function() {
              var r = {}, a;
              n.exports = r, a = t(
                /*! pako */
                "./node_modules/upng-js/node_modules/pako/index.js"
              ), function(l, h) {
                l.toRGBA8 = function(c) {
                  var d = c.width, _ = c.height;
                  if (c.tabs.acTL == null) return [l.toRGBA8.decodeImage(c.data, d, _, c).buffer];
                  var m = [];
                  c.frames[0].data == null && (c.frames[0].data = c.data);
                  for (var y, x = new Uint8Array(d * _ * 4), b = 0; b < c.frames.length; b++) {
                    var A = c.frames[b], f = A.rect.x, s = A.rect.y, u = A.rect.width, p = A.rect.height, g = l.toRGBA8.decodeImage(A.data, u, p, c);
                    if (b == 0 ? y = g : A.blend == 0 ? l._copyTile(g, u, p, y, d, _, f, s, 0) : A.blend == 1 && l._copyTile(g, u, p, y, d, _, f, s, 1), m.push(y.buffer), y = y.slice(0), A.dispose != 0) {
                      if (A.dispose == 1) l._copyTile(x, u, p, y, d, _, f, s, 0);
                      else if (A.dispose == 2) {
                        for (var w = b - 1; c.frames[w].dispose == 2; ) w--;
                        y = new Uint8Array(m[w]).slice(0);
                      }
                    }
                  }
                  return m;
                }, l.toRGBA8.decodeImage = function(c, d, _, m) {
                  var y = d * _, x = l.decode._getBPP(m), b = Math.ceil(d * x / 8), A = new Uint8Array(y * 4), f = new Uint32Array(A.buffer), s = m.ctype, u = m.depth, p = l._bin.readUshort;
                  if (s == 6) {
                    var g = y << 2;
                    if (u == 8) for (var w = 0; w < g; w++)
                      A[w] = c[w];
                    if (u == 16) for (var w = 0; w < g; w++)
                      A[w] = c[w << 1];
                  } else if (s == 2) {
                    var o = m.tabs.tRNS, v = -1, M = -1, E = -1;
                    if (o && (v = o[0], M = o[1], E = o[2]), u == 8) for (var w = 0; w < y; w++) {
                      var $ = w << 2, k = w * 3;
                      A[$] = c[k], A[$ + 1] = c[k + 1], A[$ + 2] = c[k + 2], A[$ + 3] = 255, v != -1 && c[k] == v && c[k + 1] == M && c[k + 2] == E && (A[$ + 3] = 0);
                    }
                    if (u == 16) for (var w = 0; w < y; w++) {
                      var $ = w << 2, k = w * 6;
                      A[$] = c[k], A[$ + 1] = c[k + 2], A[$ + 2] = c[k + 4], A[$ + 3] = 255, v != -1 && p(c, k) == v && p(c, k + 2) == M && p(c, k + 4) == E && (A[$ + 3] = 0);
                    }
                  } else if (s == 3) {
                    var L = m.tabs.PLTE, z = m.tabs.tRNS, O = z ? z.length : 0;
                    if (u == 1) for (var R = 0; R < _; R++)
                      for (var N = R * b, W = R * d, w = 0; w < d; w++) {
                        var $ = W + w << 2, B = c[N + (w >> 3)] >> 7 - ((w & 7) << 0) & 1, P = 3 * B;
                        A[$] = L[P], A[$ + 1] = L[P + 1], A[$ + 2] = L[P + 2], A[$ + 3] = B < O ? z[B] : 255;
                      }
                    if (u == 2) for (var R = 0; R < _; R++)
                      for (var N = R * b, W = R * d, w = 0; w < d; w++) {
                        var $ = W + w << 2, B = c[N + (w >> 2)] >> 6 - ((w & 3) << 1) & 3, P = 3 * B;
                        A[$] = L[P], A[$ + 1] = L[P + 1], A[$ + 2] = L[P + 2], A[$ + 3] = B < O ? z[B] : 255;
                      }
                    if (u == 4) for (var R = 0; R < _; R++)
                      for (var N = R * b, W = R * d, w = 0; w < d; w++) {
                        var $ = W + w << 2, B = c[N + (w >> 1)] >> 4 - ((w & 1) << 2) & 15, P = 3 * B;
                        A[$] = L[P], A[$ + 1] = L[P + 1], A[$ + 2] = L[P + 2], A[$ + 3] = B < O ? z[B] : 255;
                      }
                    if (u == 8) for (var w = 0; w < y; w++) {
                      var $ = w << 2, B = c[w], P = 3 * B;
                      A[$] = L[P], A[$ + 1] = L[P + 1], A[$ + 2] = L[P + 2], A[$ + 3] = B < O ? z[B] : 255;
                    }
                  } else if (s == 4) {
                    if (u == 8) for (var w = 0; w < y; w++) {
                      var $ = w << 2, G = w << 1, H = c[G];
                      A[$] = H, A[$ + 1] = H, A[$ + 2] = H, A[$ + 3] = c[G + 1];
                    }
                    if (u == 16) for (var w = 0; w < y; w++) {
                      var $ = w << 2, G = w << 2, H = c[G];
                      A[$] = H, A[$ + 1] = H, A[$ + 2] = H, A[$ + 3] = c[G + 2];
                    }
                  } else if (s == 0) {
                    var v = m.tabs.tRNS ? m.tabs.tRNS : -1;
                    if (u == 1) for (var w = 0; w < y; w++) {
                      var H = 255 * (c[w >> 3] >> 7 - (w & 7) & 1), U = H == v * 255 ? 0 : 255;
                      f[w] = U << 24 | H << 16 | H << 8 | H;
                    }
                    if (u == 2) for (var w = 0; w < y; w++) {
                      var H = 85 * (c[w >> 2] >> 6 - ((w & 3) << 1) & 3), U = H == v * 85 ? 0 : 255;
                      f[w] = U << 24 | H << 16 | H << 8 | H;
                    }
                    if (u == 4) for (var w = 0; w < y; w++) {
                      var H = 17 * (c[w >> 1] >> 4 - ((w & 1) << 2) & 15), U = H == v * 17 ? 0 : 255;
                      f[w] = U << 24 | H << 16 | H << 8 | H;
                    }
                    if (u == 8) for (var w = 0; w < y; w++) {
                      var H = c[w], U = H == v ? 0 : 255;
                      f[w] = U << 24 | H << 16 | H << 8 | H;
                    }
                    if (u == 16) for (var w = 0; w < y; w++) {
                      var H = c[w << 1], U = p(c, w << 1) == v ? 0 : 255;
                      f[w] = U << 24 | H << 16 | H << 8 | H;
                    }
                  }
                  return A;
                }, l.decode = function(c) {
                  for (var d = new Uint8Array(c), _ = 8, m = l._bin, y = m.readUshort, x = m.readUint, b = { tabs: {}, frames: [] }, A = new Uint8Array(d.length), f = 0, s, u = 0, p = [137, 80, 78, 71, 13, 10, 26, 10], g = 0; g < 8; g++) if (d[g] != p[g]) throw "The input is not a PNG file!";
                  for (; _ < d.length; ) {
                    var w = m.readUint(d, _);
                    _ += 4;
                    var o = m.readASCII(d, _, 4);
                    if (_ += 4, o == "IHDR")
                      l.decode._IHDR(d, _, b);
                    else if (o == "IDAT") {
                      for (var g = 0; g < w; g++) A[f + g] = d[_ + g];
                      f += w;
                    } else if (o == "acTL")
                      b.tabs[o] = { num_frames: x(d, _), num_plays: x(d, _ + 4) }, s = new Uint8Array(d.length);
                    else if (o == "fcTL") {
                      if (u != 0) {
                        var v = b.frames[b.frames.length - 1];
                        v.data = l.decode._decompress(b, s.slice(0, u), v.rect.width, v.rect.height), u = 0;
                      }
                      var M = { x: x(d, _ + 12), y: x(d, _ + 16), width: x(d, _ + 4), height: x(d, _ + 8) }, E = y(d, _ + 22);
                      E = y(d, _ + 20) / (E == 0 ? 100 : E);
                      var $ = { rect: M, delay: Math.round(E * 1e3), dispose: d[_ + 24], blend: d[_ + 25] };
                      b.frames.push($);
                    } else if (o == "fdAT") {
                      for (var g = 0; g < w - 4; g++) s[u + g] = d[_ + g + 4];
                      u += w - 4;
                    } else if (o == "pHYs")
                      b.tabs[o] = [m.readUint(d, _), m.readUint(d, _ + 4), d[_ + 8]];
                    else if (o == "cHRM") {
                      b.tabs[o] = [];
                      for (var g = 0; g < 8; g++) b.tabs[o].push(m.readUint(d, _ + g * 4));
                    } else if (o == "tEXt") {
                      b.tabs[o] == null && (b.tabs[o] = {});
                      var k = m.nextZero(d, _), L = m.readASCII(d, _, k - _), z = m.readASCII(d, k + 1, _ + w - k - 1);
                      b.tabs[o][L] = z;
                    } else if (o == "iTXt") {
                      b.tabs[o] == null && (b.tabs[o] = {});
                      var k = 0, O = _;
                      k = m.nextZero(d, O);
                      var L = m.readASCII(d, O, k - O);
                      O = k + 1, d[O], d[O + 1], O += 2, k = m.nextZero(d, O), m.readASCII(d, O, k - O), O = k + 1, k = m.nextZero(d, O), m.readUTF8(d, O, k - O), O = k + 1;
                      var z = m.readUTF8(d, O, w - (O - _));
                      b.tabs[o][L] = z;
                    } else if (o == "PLTE")
                      b.tabs[o] = m.readBytes(d, _, w);
                    else if (o == "hIST") {
                      var R = b.tabs.PLTE.length / 3;
                      b.tabs[o] = [];
                      for (var g = 0; g < R; g++) b.tabs[o].push(y(d, _ + g * 2));
                    } else if (o == "tRNS")
                      b.ctype == 3 ? b.tabs[o] = m.readBytes(d, _, w) : b.ctype == 0 ? b.tabs[o] = y(d, _) : b.ctype == 2 && (b.tabs[o] = [y(d, _), y(d, _ + 2), y(d, _ + 4)]);
                    else if (o == "gAMA") b.tabs[o] = m.readUint(d, _) / 1e5;
                    else if (o == "sRGB") b.tabs[o] = d[_];
                    else if (o == "bKGD")
                      b.ctype == 0 || b.ctype == 4 ? b.tabs[o] = [y(d, _)] : b.ctype == 2 || b.ctype == 6 ? b.tabs[o] = [y(d, _), y(d, _ + 2), y(d, _ + 4)] : b.ctype == 3 && (b.tabs[o] = d[_]);
                    else if (o == "IEND") {
                      if (u != 0) {
                        var v = b.frames[b.frames.length - 1];
                        v.data = l.decode._decompress(b, s.slice(0, u), v.rect.width, v.rect.height), u = 0;
                      }
                      b.data = l.decode._decompress(b, A, b.width, b.height);
                      break;
                    }
                    _ += w, m.readUint(d, _), _ += 4;
                  }
                  return delete b.compress, delete b.interlace, delete b.filter, b;
                }, l.decode._decompress = function(c, d, _, m) {
                  return c.compress == 0 && (d = l.decode._inflate(d)), c.interlace == 0 ? d = l.decode._filterZero(d, c, 0, _, m) : c.interlace == 1 && (d = l.decode._readInterlace(d, c)), d;
                }, l.decode._inflate = function(c) {
                  return h.inflate(c);
                }, l.decode._readInterlace = function(c, d) {
                  for (var _ = d.width, m = d.height, y = l.decode._getBPP(d), x = y >> 3, b = Math.ceil(_ * y / 8), A = new Uint8Array(m * b), f = 0, s = [0, 0, 4, 0, 2, 0, 1], u = [0, 4, 0, 2, 0, 1, 0], p = [8, 8, 8, 4, 4, 2, 2], g = [8, 8, 4, 4, 2, 2, 1], w = 0; w < 7; ) {
                    for (var o = p[w], v = g[w], M = 0, E = 0, $ = s[w]; $ < m; )
                      $ += o, E++;
                    for (var k = u[w]; k < _; )
                      k += v, M++;
                    var L = Math.ceil(M * y / 8);
                    l.decode._filterZero(c, d, f, M, E);
                    for (var z = 0, O = s[w]; O < m; ) {
                      for (var R = u[w], N = f + z * L << 3; R < _; ) {
                        if (y == 1) {
                          var W = c[N >> 3];
                          W = W >> 7 - (N & 7) & 1, A[O * b + (R >> 3)] |= W << 7 - ((R & 3) << 0);
                        }
                        if (y == 2) {
                          var W = c[N >> 3];
                          W = W >> 6 - (N & 7) & 3, A[O * b + (R >> 2)] |= W << 6 - ((R & 3) << 1);
                        }
                        if (y == 4) {
                          var W = c[N >> 3];
                          W = W >> 4 - (N & 7) & 15, A[O * b + (R >> 1)] |= W << 4 - ((R & 1) << 2);
                        }
                        if (y >= 8)
                          for (var B = O * b + R * x, P = 0; P < x; P++) A[B + P] = c[(N >> 3) + P];
                        N += y, R += v;
                      }
                      z++, O += o;
                    }
                    M * E != 0 && (f += E * (1 + L)), w = w + 1;
                  }
                  return A;
                }, l.decode._getBPP = function(c) {
                  var d = [1, null, 3, 1, 2, null, 4][c.ctype];
                  return d * c.depth;
                }, l.decode._filterZero = function(c, d, _, m, y) {
                  var x = l.decode._getBPP(d), b = Math.ceil(m * x / 8), A = l.decode._paeth;
                  x = Math.ceil(x / 8);
                  for (var f = 0; f < y; f++) {
                    var s = _ + f * b, u = s + f + 1, p = c[u - 1];
                    if (p == 0) for (var g = 0; g < b; g++) c[s + g] = c[u + g];
                    else if (p == 1) {
                      for (var g = 0; g < x; g++) c[s + g] = c[u + g];
                      for (var g = x; g < b; g++) c[s + g] = c[u + g] + c[s + g - x] & 255;
                    } else if (f == 0) {
                      for (var g = 0; g < x; g++) c[s + g] = c[u + g];
                      if (p == 2) for (var g = x; g < b; g++) c[s + g] = c[u + g] & 255;
                      if (p == 3) for (var g = x; g < b; g++) c[s + g] = c[u + g] + (c[s + g - x] >> 1) & 255;
                      if (p == 4) for (var g = x; g < b; g++) c[s + g] = c[u + g] + A(c[s + g - x], 0, 0) & 255;
                    } else {
                      if (p == 2)
                        for (var g = 0; g < b; g++) c[s + g] = c[u + g] + c[s + g - b] & 255;
                      if (p == 3) {
                        for (var g = 0; g < x; g++) c[s + g] = c[u + g] + (c[s + g - b] >> 1) & 255;
                        for (var g = x; g < b; g++) c[s + g] = c[u + g] + (c[s + g - b] + c[s + g - x] >> 1) & 255;
                      }
                      if (p == 4) {
                        for (var g = 0; g < x; g++) c[s + g] = c[u + g] + A(0, c[s + g - b], 0) & 255;
                        for (var g = x; g < b; g++) c[s + g] = c[u + g] + A(c[s + g - x], c[s + g - b], c[s + g - x - b]) & 255;
                      }
                    }
                  }
                  return c;
                }, l.decode._paeth = function(c, d, _) {
                  var m = c + d - _, y = Math.abs(m - c), x = Math.abs(m - d), b = Math.abs(m - _);
                  return y <= x && y <= b ? c : x <= b ? d : _;
                }, l.decode._IHDR = function(c, d, _) {
                  var m = l._bin;
                  _.width = m.readUint(c, d), d += 4, _.height = m.readUint(c, d), d += 4, _.depth = c[d], d++, _.ctype = c[d], d++, _.compress = c[d], d++, _.filter = c[d], d++, _.interlace = c[d], d++;
                }, l._bin = {
                  nextZero: function(c, d) {
                    for (; c[d] != 0; ) d++;
                    return d;
                  },
                  readUshort: function(c, d) {
                    return c[d] << 8 | c[d + 1];
                  },
                  writeUshort: function(c, d, _) {
                    c[d] = _ >> 8 & 255, c[d + 1] = _ & 255;
                  },
                  readUint: function(c, d) {
                    return c[d] * 16777216 + (c[d + 1] << 16 | c[d + 2] << 8 | c[d + 3]);
                  },
                  writeUint: function(c, d, _) {
                    c[d] = _ >> 24 & 255, c[d + 1] = _ >> 16 & 255, c[d + 2] = _ >> 8 & 255, c[d + 3] = _ & 255;
                  },
                  readASCII: function(c, d, _) {
                    for (var m = "", y = 0; y < _; y++) m += String.fromCharCode(c[d + y]);
                    return m;
                  },
                  writeASCII: function(c, d, _) {
                    for (var m = 0; m < _.length; m++) c[d + m] = _.charCodeAt(m);
                  },
                  readBytes: function(c, d, _) {
                    for (var m = [], y = 0; y < _; y++) m.push(c[d + y]);
                    return m;
                  },
                  pad: function(c) {
                    return c.length < 2 ? "0" + c : c;
                  },
                  readUTF8: function(c, d, _) {
                    for (var m = "", y, x = 0; x < _; x++) m += "%" + l._bin.pad(c[d + x].toString(16));
                    try {
                      y = decodeURIComponent(m);
                    } catch {
                      return l._bin.readASCII(c, d, _);
                    }
                    return y;
                  }
                }, l._copyTile = function(c, d, _, m, y, x, b, A, f) {
                  for (var s = Math.min(d, y), u = Math.min(_, x), p = 0, g = 0, w = 0; w < u; w++)
                    for (var o = 0; o < s; o++)
                      if (b >= 0 && A >= 0 ? (p = w * d + o << 2, g = (A + w) * y + b + o << 2) : (p = (-A + w) * d - b + o << 2, g = w * y + o << 2), f == 0)
                        m[g] = c[p], m[g + 1] = c[p + 1], m[g + 2] = c[p + 2], m[g + 3] = c[p + 3];
                      else if (f == 1) {
                        var v = c[p + 3] * 0.00392156862745098, M = c[p] * v, E = c[p + 1] * v, $ = c[p + 2] * v, k = m[g + 3] * (1 / 255), L = m[g] * k, z = m[g + 1] * k, O = m[g + 2] * k, R = 1 - v, N = v + k * R, W = N == 0 ? 0 : 1 / N;
                        m[g + 3] = 255 * N, m[g + 0] = (M + L * R) * W, m[g + 1] = (E + z * R) * W, m[g + 2] = ($ + O * R) * W;
                      } else if (f == 2) {
                        var v = c[p + 3], M = c[p], E = c[p + 1], $ = c[p + 2], k = m[g + 3], L = m[g], z = m[g + 1], O = m[g + 2];
                        v == k && M == L && E == z && $ == O ? (m[g] = 0, m[g + 1] = 0, m[g + 2] = 0, m[g + 3] = 0) : (m[g] = M, m[g + 1] = E, m[g + 2] = $, m[g + 3] = v);
                      } else if (f == 3) {
                        var v = c[p + 3], M = c[p], E = c[p + 1], $ = c[p + 2], k = m[g + 3], L = m[g], z = m[g + 1], O = m[g + 2];
                        if (v == k && M == L && E == z && $ == O) continue;
                        if (v < 220 && k > 20) return !1;
                      }
                  return !0;
                }, l.encode = function(c, d, _, m, y, x) {
                  m == null && (m = 0), x == null && (x = !1);
                  for (var b = new Uint8Array(c[0].byteLength * c.length + 100), A = [137, 80, 78, 71, 13, 10, 26, 10], f = 0; f < 8; f++) b[f] = A[f];
                  var s = 8, u = l._bin, p = l.crc.crc, g = u.writeUint, w = u.writeUshort, o = u.writeASCII, v = l.encode.compressPNG(c, d, _, m, x);
                  g(b, s, 13), s += 4, o(b, s, "IHDR"), s += 4, g(b, s, d), s += 4, g(b, s, _), s += 4, b[s] = v.depth, s++, b[s] = v.ctype, s++, b[s] = 0, s++, b[s] = 0, s++, b[s] = 0, s++, g(b, s, p(b, s - 17, 17)), s += 4, g(b, s, 1), s += 4, o(b, s, "sRGB"), s += 4, b[s] = 1, s++, g(b, s, p(b, s - 5, 5)), s += 4;
                  var M = c.length > 1;
                  if (M && (g(b, s, 8), s += 4, o(b, s, "acTL"), s += 4, g(b, s, c.length), s += 4, g(b, s, 0), s += 4, g(b, s, p(b, s - 12, 12)), s += 4), v.ctype == 3) {
                    var E = v.plte.length;
                    g(b, s, E * 3), s += 4, o(b, s, "PLTE"), s += 4;
                    for (var f = 0; f < E; f++) {
                      var $ = f * 3, k = v.plte[f], L = k & 255, z = k >> 8 & 255, O = k >> 16 & 255;
                      b[s + $ + 0] = L, b[s + $ + 1] = z, b[s + $ + 2] = O;
                    }
                    if (s += E * 3, g(b, s, p(b, s - E * 3 - 4, E * 3 + 4)), s += 4, v.gotAlpha) {
                      g(b, s, E), s += 4, o(b, s, "tRNS"), s += 4;
                      for (var f = 0; f < E; f++) b[s + f] = v.plte[f] >> 24 & 255;
                      s += E, g(b, s, p(b, s - E - 4, E + 4)), s += 4;
                    }
                  }
                  for (var R = 0, N = 0; N < v.frames.length; N++) {
                    var W = v.frames[N];
                    M && (g(b, s, 26), s += 4, o(b, s, "fcTL"), s += 4, g(b, s, R++), s += 4, g(b, s, W.rect.width), s += 4, g(b, s, W.rect.height), s += 4, g(b, s, W.rect.x), s += 4, g(b, s, W.rect.y), s += 4, w(b, s, y[N]), s += 2, w(b, s, 1e3), s += 2, b[s] = W.dispose, s++, b[s] = W.blend, s++, g(b, s, p(b, s - 30, 30)), s += 4);
                    var B = W.cimg, E = B.length;
                    g(b, s, E + (N == 0 ? 0 : 4)), s += 4;
                    var P = s;
                    o(b, s, N == 0 ? "IDAT" : "fdAT"), s += 4, N != 0 && (g(b, s, R++), s += 4);
                    for (var f = 0; f < E; f++) b[s + f] = B[f];
                    s += E, g(b, s, p(b, P, s - P)), s += 4;
                  }
                  return g(b, s, 0), s += 4, o(b, s, "IEND"), s += 4, g(b, s, p(b, s - 4, 4)), s += 4, b.buffer.slice(0, s);
                }, l.encode.compressPNG = function(c, d, _, m, y) {
                  for (var x = l.encode.compress(c, d, _, m, !1, y), b = 0; b < c.length; b++) {
                    var A = x.frames[b];
                    A.rect.width;
                    var f = A.rect.height, s = A.bpl, u = A.bpp, p = new Uint8Array(f * s + f);
                    A.cimg = l.encode._filterZero(A.img, f, u, s, p);
                  }
                  return x;
                }, l.encode.compress = function(c, d, _, m, y, x) {
                  x == null && (x = !1);
                  for (var b = 6, A = 8, f = 4, s = 255, u = 0; u < c.length; u++)
                    for (var p = new Uint8Array(c[u]), g = p.length, w = 0; w < g; w += 4) s &= p[w + 3];
                  var o = s != 255, v = {}, M = [];
                  if (c.length != 0 && (v[0] = 0, M.push(0), m != 0 && m--), m != 0) {
                    var E = l.quantize(c, m, y);
                    c = E.bufs;
                    for (var w = 0; w < E.plte.length; w++) {
                      var $ = E.plte[w].est.rgba;
                      v[$] == null && (v[$] = M.length, M.push($));
                    }
                  } else
                    for (var u = 0; u < c.length; u++)
                      for (var k = new Uint32Array(c[u]), g = k.length, w = 0; w < g; w++) {
                        var $ = k[w];
                        if ((w < d || $ != k[w - 1] && $ != k[w - d]) && v[$] == null && (v[$] = M.length, M.push($), M.length >= 300))
                          break;
                      }
                  var L = o ? y : !1, z = M.length;
                  z <= 256 && x == !1 && (z <= 2 ? A = 1 : z <= 4 ? A = 2 : z <= 16 ? A = 4 : A = 8, y && (A = 8), o = !0);
                  for (var O = [], u = 0; u < c.length; u++) {
                    var R = new Uint8Array(c[u]), N = new Uint32Array(R.buffer), W = 0, B = 0, P = d, G = _, H = 0;
                    if (u != 0 && !L) {
                      for (var U = y || u == 1 || O[O.length - 2].dispose == 2 ? 1 : 2, j = 0, re = 1e9, ie = 0; ie < U; ie++) {
                        for (var he = new Uint8Array(c[u - 1 - ie]), te = new Uint32Array(c[u - 1 - ie]), ue = d, de = _, oe = -1, J = -1, Ee = 0; Ee < _; Ee++) for (var se = 0; se < d; se++) {
                          var w = Ee * d + se;
                          N[w] != te[w] && (se < ue && (ue = se), se > oe && (oe = se), Ee < de && (de = Ee), Ee > J && (J = Ee));
                        }
                        var Ae = oe == -1 ? 1 : (oe - ue + 1) * (J - de + 1);
                        Ae < re && (re = Ae, j = ie, oe == -1 ? (W = B = 0, P = G = 1) : (W = ue, B = de, P = oe - ue + 1, G = J - de + 1));
                      }
                      var he = new Uint8Array(c[u - 1 - j]);
                      j == 1 && (O[O.length - 1].dispose = 2);
                      var ne = new Uint8Array(P * G * 4);
                      new Uint32Array(ne.buffer), l._copyTile(he, d, _, ne, P, G, -W, -B, 0), l._copyTile(R, d, _, ne, P, G, -W, -B, 3) ? (l._copyTile(R, d, _, ne, P, G, -W, -B, 2), H = 1) : (l._copyTile(R, d, _, ne, P, G, -W, -B, 0), H = 0), R = ne, N = new Uint32Array(R.buffer);
                    }
                    var _e = 4 * P;
                    if (z <= 256 && x == !1) {
                      _e = Math.ceil(A * P / 8);
                      for (var ne = new Uint8Array(_e * G), Ee = 0; Ee < G; Ee++) {
                        var w = Ee * _e, Le = Ee * P;
                        if (A == 8) for (var se = 0; se < P; se++) ne[w + se] = v[N[Le + se]];
                        else if (A == 4) for (var se = 0; se < P; se++) ne[w + (se >> 1)] |= v[N[Le + se]] << 4 - (se & 1) * 4;
                        else if (A == 2) for (var se = 0; se < P; se++) ne[w + (se >> 2)] |= v[N[Le + se]] << 6 - (se & 3) * 2;
                        else if (A == 1) for (var se = 0; se < P; se++) ne[w + (se >> 3)] |= v[N[Le + se]] << 7 - (se & 7) * 1;
                      }
                      R = ne, b = 3, f = 1;
                    } else if (o == !1 && c.length == 1) {
                      for (var ne = new Uint8Array(P * G * 3), Be = P * G, w = 0; w < Be; w++) {
                        var Ue = w * 3, He = w * 4;
                        ne[Ue] = R[He], ne[Ue + 1] = R[He + 1], ne[Ue + 2] = R[He + 2];
                      }
                      R = ne, b = 2, f = 3, _e = 3 * P;
                    }
                    O.push({ rect: { x: W, y: B, width: P, height: G }, img: R, bpl: _e, bpp: f, blend: H, dispose: L ? 1 : 0 });
                  }
                  return { ctype: b, depth: A, plte: M, gotAlpha: o, frames: O };
                }, l.encode._filterZero = function(c, d, _, m, y) {
                  for (var x = [], b = 0; b < 5; b++)
                    if (!(d * m > 5e5 && (b == 2 || b == 3 || b == 4))) {
                      for (var A = 0; A < d; A++) l.encode._filterLine(y, c, A, m, _, b);
                      if (x.push(h.deflate(y)), _ == 1) break;
                    }
                  for (var f, s = 1e9, u = 0; u < x.length; u++) x[u].length < s && (f = u, s = x[u].length);
                  return x[f];
                }, l.encode._filterLine = function(c, d, _, m, y, x) {
                  var b = _ * m, A = b + _, f = l.decode._paeth;
                  if (c[A] = x, A++, x == 0) for (var s = 0; s < m; s++) c[A + s] = d[b + s];
                  else if (x == 1) {
                    for (var s = 0; s < y; s++) c[A + s] = d[b + s];
                    for (var s = y; s < m; s++) c[A + s] = d[b + s] - d[b + s - y] + 256 & 255;
                  } else if (_ == 0) {
                    for (var s = 0; s < y; s++) c[A + s] = d[b + s];
                    if (x == 2) for (var s = y; s < m; s++) c[A + s] = d[b + s];
                    if (x == 3) for (var s = y; s < m; s++) c[A + s] = d[b + s] - (d[b + s - y] >> 1) + 256 & 255;
                    if (x == 4) for (var s = y; s < m; s++) c[A + s] = d[b + s] - f(d[b + s - y], 0, 0) + 256 & 255;
                  } else {
                    if (x == 2)
                      for (var s = 0; s < m; s++) c[A + s] = d[b + s] + 256 - d[b + s - m] & 255;
                    if (x == 3) {
                      for (var s = 0; s < y; s++) c[A + s] = d[b + s] + 256 - (d[b + s - m] >> 1) & 255;
                      for (var s = y; s < m; s++) c[A + s] = d[b + s] + 256 - (d[b + s - m] + d[b + s - y] >> 1) & 255;
                    }
                    if (x == 4) {
                      for (var s = 0; s < y; s++) c[A + s] = d[b + s] + 256 - f(0, d[b + s - m], 0) & 255;
                      for (var s = y; s < m; s++) c[A + s] = d[b + s] + 256 - f(d[b + s - y], d[b + s - m], d[b + s - y - m]) & 255;
                    }
                  }
                }, l.crc = {
                  table: function() {
                    for (var c = new Uint32Array(256), d = 0; d < 256; d++) {
                      for (var _ = d, m = 0; m < 8; m++)
                        _ & 1 ? _ = 3988292384 ^ _ >>> 1 : _ = _ >>> 1;
                      c[d] = _;
                    }
                    return c;
                  }(),
                  update: function(c, d, _, m) {
                    for (var y = 0; y < m; y++) c = l.crc.table[(c ^ d[_ + y]) & 255] ^ c >>> 8;
                    return c;
                  },
                  crc: function(c, d, _) {
                    return l.crc.update(4294967295, c, d, _) ^ 4294967295;
                  }
                }, l.quantize = function(c, d, _) {
                  for (var m = [], y = 0, x = 0; x < c.length; x++)
                    m.push(l.encode.alphaMul(new Uint8Array(c[x]), _)), y += c[x].byteLength;
                  for (var b = new Uint8Array(y), A = new Uint32Array(b.buffer), f = 0, x = 0; x < m.length; x++) {
                    for (var s = m[x], u = s.length, p = 0; p < u; p++) b[f + p] = s[p];
                    f += u;
                  }
                  var g = { i0: 0, i1: b.length, bst: null, est: null, tdst: 0, left: null, right: null };
                  g.bst = l.quantize.stats(b, g.i0, g.i1), g.est = l.quantize.estats(g.bst);
                  for (var w = [g]; w.length < d; ) {
                    for (var o = 0, v = 0, x = 0; x < w.length; x++) w[x].est.L > o && (o = w[x].est.L, v = x);
                    if (o < 1e-3) break;
                    var M = w[v], E = l.quantize.splitPixels(b, A, M.i0, M.i1, M.est.e, M.est.eMq255), $ = { i0: M.i0, i1: E, bst: null, est: null, tdst: 0, left: null, right: null };
                    $.bst = l.quantize.stats(b, $.i0, $.i1), $.est = l.quantize.estats($.bst);
                    var k = { i0: E, i1: M.i1, bst: null, est: null, tdst: 0, left: null, right: null };
                    k.bst = { R: [], m: [], N: M.bst.N - $.bst.N };
                    for (var x = 0; x < 16; x++) k.bst.R[x] = M.bst.R[x] - $.bst.R[x];
                    for (var x = 0; x < 4; x++) k.bst.m[x] = M.bst.m[x] - $.bst.m[x];
                    k.est = l.quantize.estats(k.bst), M.left = $, M.right = k, w[v] = $, w.push(k);
                  }
                  w.sort(function(U, j) {
                    return j.bst.N - U.bst.N;
                  });
                  for (var L = 0; L < m.length; L++) {
                    for (var z = l.quantize.planeDst, O = new Uint8Array(m[L].buffer), R = new Uint32Array(m[L].buffer), N = O.length, x = 0; x < N; x += 4) {
                      for (var W = O[x] * 0.00392156862745098, B = O[x + 1] * (1 / 255), P = O[x + 2] * (1 / 255), G = O[x + 3] * (1 / 255), H = g; H.left; ) H = z(H.est, W, B, P, G) <= 0 ? H.left : H.right;
                      R[x >> 2] = H.est.rgba;
                    }
                    m[L] = R.buffer;
                  }
                  return { bufs: m, plte: w };
                }, l.quantize.getNearest = function(c, d, _, m, y) {
                  if (c.left == null)
                    return c.tdst = l.quantize.dist(c.est.q, d, _, m, y), c;
                  var x = l.quantize.planeDst(c.est, d, _, m, y), b = c.left, A = c.right;
                  x > 0 && (b = c.right, A = c.left);
                  var f = l.quantize.getNearest(b, d, _, m, y);
                  if (f.tdst <= x * x) return f;
                  var s = l.quantize.getNearest(A, d, _, m, y);
                  return s.tdst < f.tdst ? s : f;
                }, l.quantize.planeDst = function(c, d, _, m, y) {
                  var x = c.e;
                  return x[0] * d + x[1] * _ + x[2] * m + x[3] * y - c.eMq;
                }, l.quantize.dist = function(c, d, _, m, y) {
                  var x = d - c[0], b = _ - c[1], A = m - c[2], f = y - c[3];
                  return x * x + b * b + A * A + f * f;
                }, l.quantize.splitPixels = function(c, d, _, m, y, x) {
                  var b = l.quantize.vecDot;
                  for (m -= 4; _ < m; ) {
                    for (; b(c, _, y) <= x; ) _ += 4;
                    for (; b(c, m, y) > x; ) m -= 4;
                    if (_ >= m) break;
                    var A = d[_ >> 2];
                    d[_ >> 2] = d[m >> 2], d[m >> 2] = A, _ += 4, m -= 4;
                  }
                  for (; b(c, _, y) > x; ) _ -= 4;
                  return _ + 4;
                }, l.quantize.vecDot = function(c, d, _) {
                  return c[d] * _[0] + c[d + 1] * _[1] + c[d + 2] * _[2] + c[d + 3] * _[3];
                }, l.quantize.stats = function(c, d, _) {
                  for (var m = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], y = [0, 0, 0, 0], x = _ - d >> 2, b = d; b < _; b += 4) {
                    var A = c[b] * 0.00392156862745098, f = c[b + 1] * (1 / 255), s = c[b + 2] * (1 / 255), u = c[b + 3] * (1 / 255);
                    y[0] += A, y[1] += f, y[2] += s, y[3] += u, m[0] += A * A, m[1] += A * f, m[2] += A * s, m[3] += A * u, m[5] += f * f, m[6] += f * s, m[7] += f * u, m[10] += s * s, m[11] += s * u, m[15] += u * u;
                  }
                  return m[4] = m[1], m[8] = m[2], m[12] = m[3], m[9] = m[6], m[13] = m[7], m[14] = m[11], { R: m, m: y, N: x };
                }, l.quantize.estats = function(c) {
                  var d = c.R, _ = c.m, m = c.N, y = _[0], x = _[1], b = _[2], A = _[3], f = m == 0 ? 0 : 1 / m, s = [
                    d[0] - y * y * f,
                    d[1] - y * x * f,
                    d[2] - y * b * f,
                    d[3] - y * A * f,
                    d[4] - x * y * f,
                    d[5] - x * x * f,
                    d[6] - x * b * f,
                    d[7] - x * A * f,
                    d[8] - b * y * f,
                    d[9] - b * x * f,
                    d[10] - b * b * f,
                    d[11] - b * A * f,
                    d[12] - A * y * f,
                    d[13] - A * x * f,
                    d[14] - A * b * f,
                    d[15] - A * A * f
                  ], u = s, p = l.M4, g = [0.5, 0.5, 0.5, 0.5], w = 0, o = 0;
                  if (m != 0)
                    for (var v = 0; v < 10 && (g = p.multVec(u, g), o = Math.sqrt(p.dot(g, g)), g = p.sml(1 / o, g), !(Math.abs(o - w) < 1e-9)); v++)
                      w = o;
                  var M = [y * f, x * f, b * f, A * f], E = p.dot(p.sml(255, M), g), $ = M[3] < 1e-3 ? 0 : 1 / M[3];
                  return {
                    Cov: s,
                    q: M,
                    e: g,
                    L: w,
                    eMq255: E,
                    eMq: p.dot(g, M),
                    rgba: (Math.round(255 * M[3]) << 24 | Math.round(255 * M[2] * $) << 16 | Math.round(255 * M[1] * $) << 8 | Math.round(255 * M[0] * $) << 0) >>> 0
                  };
                }, l.M4 = {
                  multVec: function(c, d) {
                    return [
                      c[0] * d[0] + c[1] * d[1] + c[2] * d[2] + c[3] * d[3],
                      c[4] * d[0] + c[5] * d[1] + c[6] * d[2] + c[7] * d[3],
                      c[8] * d[0] + c[9] * d[1] + c[10] * d[2] + c[11] * d[3],
                      c[12] * d[0] + c[13] * d[1] + c[14] * d[2] + c[15] * d[3]
                    ];
                  },
                  dot: function(c, d) {
                    return c[0] * d[0] + c[1] * d[1] + c[2] * d[2] + c[3] * d[3];
                  },
                  sml: function(c, d) {
                    return [c * d[0], c * d[1], c * d[2], c * d[3]];
                  }
                }, l.encode.alphaMul = function(c, d) {
                  for (var _ = new Uint8Array(c.length), m = c.length >> 2, y = 0; y < m; y++) {
                    var x = y << 2, b = c[x + 3];
                    d && (b = b < 128 ? 0 : 255);
                    var A = b * (1 / 255);
                    _[x + 0] = c[x + 0] * A, _[x + 1] = c[x + 1] * A, _[x + 2] = c[x + 2] * A, _[x + 3] = b;
                  }
                  return _;
                };
              }(r, a);
            })();
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/index.js": (
          /*!*********************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/index.js ***!
            \*********************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ./lib/utils/common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ).assign, a = t(
              /*! ./lib/deflate */
              "./node_modules/upng-js/node_modules/pako/lib/deflate.js"
            ), l = t(
              /*! ./lib/inflate */
              "./node_modules/upng-js/node_modules/pako/lib/inflate.js"
            ), h = t(
              /*! ./lib/zlib/constants */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js"
            ), c = {};
            r(c, a, l, h), n.exports = c;
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/deflate.js": (
          /*!***************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/deflate.js ***!
            \***************************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ./zlib/deflate */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js"
            ), a = t(
              /*! ./utils/common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ), l = t(
              /*! ./utils/strings */
              "./node_modules/upng-js/node_modules/pako/lib/utils/strings.js"
            ), h = t(
              /*! ./zlib/messages */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"
            ), c = t(
              /*! ./zlib/zstream */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js"
            ), d = Object.prototype.toString, _ = 0, m = 4, y = 0, x = 1, b = 2, A = -1, f = 0, s = 8;
            function u(o) {
              if (!(this instanceof u)) return new u(o);
              this.options = a.assign({
                level: A,
                method: s,
                chunkSize: 16384,
                windowBits: 15,
                memLevel: 8,
                strategy: f,
                to: ""
              }, o || {});
              var v = this.options;
              v.raw && v.windowBits > 0 ? v.windowBits = -v.windowBits : v.gzip && v.windowBits > 0 && v.windowBits < 16 && (v.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new c(), this.strm.avail_out = 0;
              var M = r.deflateInit2(
                this.strm,
                v.level,
                v.method,
                v.windowBits,
                v.memLevel,
                v.strategy
              );
              if (M !== y)
                throw new Error(h[M]);
              if (v.header && r.deflateSetHeader(this.strm, v.header), v.dictionary) {
                var E;
                if (typeof v.dictionary == "string" ? E = l.string2buf(v.dictionary) : d.call(v.dictionary) === "[object ArrayBuffer]" ? E = new Uint8Array(v.dictionary) : E = v.dictionary, M = r.deflateSetDictionary(this.strm, E), M !== y)
                  throw new Error(h[M]);
                this._dict_set = !0;
              }
            }
            u.prototype.push = function(o, v) {
              var M = this.strm, E = this.options.chunkSize, $, k;
              if (this.ended)
                return !1;
              k = v === ~~v ? v : v === !0 ? m : _, typeof o == "string" ? M.input = l.string2buf(o) : d.call(o) === "[object ArrayBuffer]" ? M.input = new Uint8Array(o) : M.input = o, M.next_in = 0, M.avail_in = M.input.length;
              do {
                if (M.avail_out === 0 && (M.output = new a.Buf8(E), M.next_out = 0, M.avail_out = E), $ = r.deflate(M, k), $ !== x && $ !== y)
                  return this.onEnd($), this.ended = !0, !1;
                (M.avail_out === 0 || M.avail_in === 0 && (k === m || k === b)) && (this.options.to === "string" ? this.onData(l.buf2binstring(a.shrinkBuf(M.output, M.next_out))) : this.onData(a.shrinkBuf(M.output, M.next_out)));
              } while ((M.avail_in > 0 || M.avail_out === 0) && $ !== x);
              return k === m ? ($ = r.deflateEnd(this.strm), this.onEnd($), this.ended = !0, $ === y) : (k === b && (this.onEnd(y), M.avail_out = 0), !0);
            }, u.prototype.onData = function(o) {
              this.chunks.push(o);
            }, u.prototype.onEnd = function(o) {
              o === y && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = a.flattenChunks(this.chunks)), this.chunks = [], this.err = o, this.msg = this.strm.msg;
            };
            function p(o, v) {
              var M = new u(v);
              if (M.push(o, !0), M.err)
                throw M.msg || h[M.err];
              return M.result;
            }
            function g(o, v) {
              return v = v || {}, v.raw = !0, p(o, v);
            }
            function w(o, v) {
              return v = v || {}, v.gzip = !0, p(o, v);
            }
            e.Deflate = u, e.deflate = p, e.deflateRaw = g, e.gzip = w;
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/inflate.js": (
          /*!***************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/inflate.js ***!
            \***************************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ./zlib/inflate */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js"
            ), a = t(
              /*! ./utils/common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ), l = t(
              /*! ./utils/strings */
              "./node_modules/upng-js/node_modules/pako/lib/utils/strings.js"
            ), h = t(
              /*! ./zlib/constants */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js"
            ), c = t(
              /*! ./zlib/messages */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"
            ), d = t(
              /*! ./zlib/zstream */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js"
            ), _ = t(
              /*! ./zlib/gzheader */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js"
            ), m = Object.prototype.toString;
            function y(A) {
              if (!(this instanceof y)) return new y(A);
              this.options = a.assign({
                chunkSize: 16384,
                windowBits: 0,
                to: ""
              }, A || {});
              var f = this.options;
              f.raw && f.windowBits >= 0 && f.windowBits < 16 && (f.windowBits = -f.windowBits, f.windowBits === 0 && (f.windowBits = -15)), f.windowBits >= 0 && f.windowBits < 16 && !(A && A.windowBits) && (f.windowBits += 32), f.windowBits > 15 && f.windowBits < 48 && (f.windowBits & 15 || (f.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new d(), this.strm.avail_out = 0;
              var s = r.inflateInit2(
                this.strm,
                f.windowBits
              );
              if (s !== h.Z_OK)
                throw new Error(c[s]);
              if (this.header = new _(), r.inflateGetHeader(this.strm, this.header), f.dictionary && (typeof f.dictionary == "string" ? f.dictionary = l.string2buf(f.dictionary) : m.call(f.dictionary) === "[object ArrayBuffer]" && (f.dictionary = new Uint8Array(f.dictionary)), f.raw && (s = r.inflateSetDictionary(this.strm, f.dictionary), s !== h.Z_OK)))
                throw new Error(c[s]);
            }
            y.prototype.push = function(A, f) {
              var s = this.strm, u = this.options.chunkSize, p = this.options.dictionary, g, w, o, v, M, E = !1;
              if (this.ended)
                return !1;
              w = f === ~~f ? f : f === !0 ? h.Z_FINISH : h.Z_NO_FLUSH, typeof A == "string" ? s.input = l.binstring2buf(A) : m.call(A) === "[object ArrayBuffer]" ? s.input = new Uint8Array(A) : s.input = A, s.next_in = 0, s.avail_in = s.input.length;
              do {
                if (s.avail_out === 0 && (s.output = new a.Buf8(u), s.next_out = 0, s.avail_out = u), g = r.inflate(s, h.Z_NO_FLUSH), g === h.Z_NEED_DICT && p && (g = r.inflateSetDictionary(this.strm, p)), g === h.Z_BUF_ERROR && E === !0 && (g = h.Z_OK, E = !1), g !== h.Z_STREAM_END && g !== h.Z_OK)
                  return this.onEnd(g), this.ended = !0, !1;
                s.next_out && (s.avail_out === 0 || g === h.Z_STREAM_END || s.avail_in === 0 && (w === h.Z_FINISH || w === h.Z_SYNC_FLUSH)) && (this.options.to === "string" ? (o = l.utf8border(s.output, s.next_out), v = s.next_out - o, M = l.buf2string(s.output, o), s.next_out = v, s.avail_out = u - v, v && a.arraySet(s.output, s.output, o, v, 0), this.onData(M)) : this.onData(a.shrinkBuf(s.output, s.next_out))), s.avail_in === 0 && s.avail_out === 0 && (E = !0);
              } while ((s.avail_in > 0 || s.avail_out === 0) && g !== h.Z_STREAM_END);
              return g === h.Z_STREAM_END && (w = h.Z_FINISH), w === h.Z_FINISH ? (g = r.inflateEnd(this.strm), this.onEnd(g), this.ended = !0, g === h.Z_OK) : (w === h.Z_SYNC_FLUSH && (this.onEnd(h.Z_OK), s.avail_out = 0), !0);
            }, y.prototype.onData = function(A) {
              this.chunks.push(A);
            }, y.prototype.onEnd = function(A) {
              A === h.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = a.flattenChunks(this.chunks)), this.chunks = [], this.err = A, this.msg = this.strm.msg;
            };
            function x(A, f) {
              var s = new y(f);
              if (s.push(A, !0), s.err)
                throw s.msg || c[s.err];
              return s.result;
            }
            function b(A, f) {
              return f = f || {}, f.raw = !0, x(A, f);
            }
            e.Inflate = y, e.inflate = x, e.inflateRaw = b, e.ungzip = x;
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/utils/common.js": (
          /*!********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/utils/common.js ***!
            \********************************************************************/
          /***/
          (n, e) => {
            var t = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
            function r(h, c) {
              return Object.prototype.hasOwnProperty.call(h, c);
            }
            e.assign = function(h) {
              for (var c = Array.prototype.slice.call(arguments, 1); c.length; ) {
                var d = c.shift();
                if (d) {
                  if (typeof d != "object")
                    throw new TypeError(d + "must be non-object");
                  for (var _ in d)
                    r(d, _) && (h[_] = d[_]);
                }
              }
              return h;
            }, e.shrinkBuf = function(h, c) {
              return h.length === c ? h : h.subarray ? h.subarray(0, c) : (h.length = c, h);
            };
            var a = {
              arraySet: function(h, c, d, _, m) {
                if (c.subarray && h.subarray) {
                  h.set(c.subarray(d, d + _), m);
                  return;
                }
                for (var y = 0; y < _; y++)
                  h[m + y] = c[d + y];
              },
              // Join array of chunks to single array.
              flattenChunks: function(h) {
                var c, d, _, m, y, x;
                for (_ = 0, c = 0, d = h.length; c < d; c++)
                  _ += h[c].length;
                for (x = new Uint8Array(_), m = 0, c = 0, d = h.length; c < d; c++)
                  y = h[c], x.set(y, m), m += y.length;
                return x;
              }
            }, l = {
              arraySet: function(h, c, d, _, m) {
                for (var y = 0; y < _; y++)
                  h[m + y] = c[d + y];
              },
              // Join array of chunks to single array.
              flattenChunks: function(h) {
                return [].concat.apply([], h);
              }
            };
            e.setTyped = function(h) {
              h ? (e.Buf8 = Uint8Array, e.Buf16 = Uint16Array, e.Buf32 = Int32Array, e.assign(e, a)) : (e.Buf8 = Array, e.Buf16 = Array, e.Buf32 = Array, e.assign(e, l));
            }, e.setTyped(t);
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/utils/strings.js": (
          /*!*********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/utils/strings.js ***!
            \*********************************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ./common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ), a = !0, l = !0;
            try {
              String.fromCharCode.apply(null, [0]);
            } catch {
              a = !1;
            }
            try {
              String.fromCharCode.apply(null, new Uint8Array(1));
            } catch {
              l = !1;
            }
            for (var h = new r.Buf8(256), c = 0; c < 256; c++)
              h[c] = c >= 252 ? 6 : c >= 248 ? 5 : c >= 240 ? 4 : c >= 224 ? 3 : c >= 192 ? 2 : 1;
            h[254] = h[254] = 1, e.string2buf = function(_) {
              var m, y, x, b, A, f = _.length, s = 0;
              for (b = 0; b < f; b++)
                y = _.charCodeAt(b), (y & 64512) === 55296 && b + 1 < f && (x = _.charCodeAt(b + 1), (x & 64512) === 56320 && (y = 65536 + (y - 55296 << 10) + (x - 56320), b++)), s += y < 128 ? 1 : y < 2048 ? 2 : y < 65536 ? 3 : 4;
              for (m = new r.Buf8(s), A = 0, b = 0; A < s; b++)
                y = _.charCodeAt(b), (y & 64512) === 55296 && b + 1 < f && (x = _.charCodeAt(b + 1), (x & 64512) === 56320 && (y = 65536 + (y - 55296 << 10) + (x - 56320), b++)), y < 128 ? m[A++] = y : y < 2048 ? (m[A++] = 192 | y >>> 6, m[A++] = 128 | y & 63) : y < 65536 ? (m[A++] = 224 | y >>> 12, m[A++] = 128 | y >>> 6 & 63, m[A++] = 128 | y & 63) : (m[A++] = 240 | y >>> 18, m[A++] = 128 | y >>> 12 & 63, m[A++] = 128 | y >>> 6 & 63, m[A++] = 128 | y & 63);
              return m;
            };
            function d(_, m) {
              if (m < 65534 && (_.subarray && l || !_.subarray && a))
                return String.fromCharCode.apply(null, r.shrinkBuf(_, m));
              for (var y = "", x = 0; x < m; x++)
                y += String.fromCharCode(_[x]);
              return y;
            }
            e.buf2binstring = function(_) {
              return d(_, _.length);
            }, e.binstring2buf = function(_) {
              for (var m = new r.Buf8(_.length), y = 0, x = m.length; y < x; y++)
                m[y] = _.charCodeAt(y);
              return m;
            }, e.buf2string = function(_, m) {
              var y, x, b, A, f = m || _.length, s = new Array(f * 2);
              for (x = 0, y = 0; y < f; ) {
                if (b = _[y++], b < 128) {
                  s[x++] = b;
                  continue;
                }
                if (A = h[b], A > 4) {
                  s[x++] = 65533, y += A - 1;
                  continue;
                }
                for (b &= A === 2 ? 31 : A === 3 ? 15 : 7; A > 1 && y < f; )
                  b = b << 6 | _[y++] & 63, A--;
                if (A > 1) {
                  s[x++] = 65533;
                  continue;
                }
                b < 65536 ? s[x++] = b : (b -= 65536, s[x++] = 55296 | b >> 10 & 1023, s[x++] = 56320 | b & 1023);
              }
              return d(s, x);
            }, e.utf8border = function(_, m) {
              var y;
              for (m = m || _.length, m > _.length && (m = _.length), y = m - 1; y >= 0 && (_[y] & 192) === 128; )
                y--;
              return y < 0 || y === 0 ? m : y + h[_[y]] > m ? y : m;
            };
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js": (
          /*!********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js ***!
            \********************************************************************/
          /***/
          (n) => {
            function e(t, r, a, l) {
              for (var h = t & 65535 | 0, c = t >>> 16 & 65535 | 0, d = 0; a !== 0; ) {
                d = a > 2e3 ? 2e3 : a, a -= d;
                do
                  h = h + r[l++] | 0, c = c + h | 0;
                while (--d);
                h %= 65521, c %= 65521;
              }
              return h | c << 16 | 0;
            }
            n.exports = e;
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js": (
          /*!**********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/constants.js ***!
            \**********************************************************************/
          /***/
          (n) => {
            n.exports = {
              /* Allowed flush values; see deflate() and inflate() below for details */
              Z_NO_FLUSH: 0,
              Z_PARTIAL_FLUSH: 1,
              Z_SYNC_FLUSH: 2,
              Z_FULL_FLUSH: 3,
              Z_FINISH: 4,
              Z_BLOCK: 5,
              Z_TREES: 6,
              /* Return codes for the compression/decompression functions. Negative values
              * are errors, positive values are used for special but normal events.
              */
              Z_OK: 0,
              Z_STREAM_END: 1,
              Z_NEED_DICT: 2,
              Z_ERRNO: -1,
              Z_STREAM_ERROR: -2,
              Z_DATA_ERROR: -3,
              //Z_MEM_ERROR:     -4,
              Z_BUF_ERROR: -5,
              //Z_VERSION_ERROR: -6,
              /* compression levels */
              Z_NO_COMPRESSION: 0,
              Z_BEST_SPEED: 1,
              Z_BEST_COMPRESSION: 9,
              Z_DEFAULT_COMPRESSION: -1,
              Z_FILTERED: 1,
              Z_HUFFMAN_ONLY: 2,
              Z_RLE: 3,
              Z_FIXED: 4,
              Z_DEFAULT_STRATEGY: 0,
              /* Possible values of the data_type field (though see inflate()) */
              Z_BINARY: 0,
              Z_TEXT: 1,
              //Z_ASCII:                1, // = Z_TEXT (deprecated)
              Z_UNKNOWN: 2,
              /* The deflate compression method */
              Z_DEFLATED: 8
              //Z_NULL:                 null // Use -1 or null inline, depending on var type
            };
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js": (
          /*!******************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js ***!
            \******************************************************************/
          /***/
          (n) => {
            function e() {
              for (var a, l = [], h = 0; h < 256; h++) {
                a = h;
                for (var c = 0; c < 8; c++)
                  a = a & 1 ? 3988292384 ^ a >>> 1 : a >>> 1;
                l[h] = a;
              }
              return l;
            }
            var t = e();
            function r(a, l, h, c) {
              var d = t, _ = c + h;
              a ^= -1;
              for (var m = c; m < _; m++)
                a = a >>> 8 ^ d[(a ^ l[m]) & 255];
              return a ^ -1;
            }
            n.exports = r;
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js": (
          /*!********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/deflate.js ***!
            \********************************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ../utils/common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ), a = t(
              /*! ./trees */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js"
            ), l = t(
              /*! ./adler32 */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js"
            ), h = t(
              /*! ./crc32 */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js"
            ), c = t(
              /*! ./messages */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js"
            ), d = 0, _ = 1, m = 3, y = 4, x = 5, b = 0, A = 1, f = -2, s = -3, u = -5, p = -1, g = 1, w = 2, o = 3, v = 4, M = 0, E = 2, $ = 8, k = 9, L = 15, z = 8, O = 29, R = 256, N = R + 1 + O, W = 30, B = 19, P = 2 * N + 1, G = 15, H = 3, U = 258, j = U + H + 1, re = 32, ie = 42, te = 69, ue = 73, de = 91, oe = 103, J = 113, Ee = 666, se = 1, Ae = 2, he = 3, ne = 4, _e = 3;
            function Le(I, xe) {
              return I.msg = c[xe], xe;
            }
            function Be(I) {
              return (I << 1) - (I > 4 ? 9 : 0);
            }
            function Ue(I) {
              for (var xe = I.length; --xe >= 0; )
                I[xe] = 0;
            }
            function He(I) {
              var xe = I.state, be = xe.pending;
              be > I.avail_out && (be = I.avail_out), be !== 0 && (r.arraySet(I.output, xe.pending_buf, xe.pending_out, be, I.next_out), I.next_out += be, xe.pending_out += be, I.total_out += be, I.avail_out -= be, xe.pending -= be, xe.pending === 0 && (xe.pending_out = 0));
            }
            function We(I, xe) {
              a._tr_flush_block(I, I.block_start >= 0 ? I.block_start : -1, I.strstart - I.block_start, xe), I.block_start = I.strstart, He(I.strm);
            }
            function Ge(I, xe) {
              I.pending_buf[I.pending++] = xe;
            }
            function Ne(I, xe) {
              I.pending_buf[I.pending++] = xe >>> 8 & 255, I.pending_buf[I.pending++] = xe & 255;
            }
            function Pe(I, xe, be, q) {
              var fe = I.avail_in;
              return fe > q && (fe = q), fe === 0 ? 0 : (I.avail_in -= fe, r.arraySet(xe, I.input, I.next_in, fe, be), I.state.wrap === 1 ? I.adler = l(I.adler, xe, fe, be) : I.state.wrap === 2 && (I.adler = h(I.adler, xe, fe, be)), I.next_in += fe, I.total_in += fe, fe);
            }
            function Te(I, xe) {
              var be = I.max_chain_length, q = I.strstart, fe, Ce, Ze = I.prev_length, Xe = I.nice_match, Ye = I.strstart > I.w_size - j ? I.strstart - (I.w_size - j) : 0, lt = I.window, dt = I.w_mask, it = I.prev, ot = I.strstart + U, nt = lt[q + Ze - 1], Ct = lt[q + Ze];
              I.prev_length >= I.good_match && (be >>= 2), Xe > I.lookahead && (Xe = I.lookahead);
              do
                if (fe = xe, !(lt[fe + Ze] !== Ct || lt[fe + Ze - 1] !== nt || lt[fe] !== lt[q] || lt[++fe] !== lt[q + 1])) {
                  q += 2, fe++;
                  do
                    ;
                  while (lt[++q] === lt[++fe] && lt[++q] === lt[++fe] && lt[++q] === lt[++fe] && lt[++q] === lt[++fe] && lt[++q] === lt[++fe] && lt[++q] === lt[++fe] && lt[++q] === lt[++fe] && lt[++q] === lt[++fe] && q < ot);
                  if (Ce = U - (ot - q), q = ot - U, Ce > Ze) {
                    if (I.match_start = xe, Ze = Ce, Ce >= Xe)
                      break;
                    nt = lt[q + Ze - 1], Ct = lt[q + Ze];
                  }
                }
              while ((xe = it[xe & dt]) > Ye && --be !== 0);
              return Ze <= I.lookahead ? Ze : I.lookahead;
            }
            function Me(I) {
              var xe = I.w_size, be, q, fe, Ce, Ze;
              do {
                if (Ce = I.window_size - I.lookahead - I.strstart, I.strstart >= xe + (xe - j)) {
                  r.arraySet(I.window, I.window, xe, xe, 0), I.match_start -= xe, I.strstart -= xe, I.block_start -= xe, q = I.hash_size, be = q;
                  do
                    fe = I.head[--be], I.head[be] = fe >= xe ? fe - xe : 0;
                  while (--q);
                  q = xe, be = q;
                  do
                    fe = I.prev[--be], I.prev[be] = fe >= xe ? fe - xe : 0;
                  while (--q);
                  Ce += xe;
                }
                if (I.strm.avail_in === 0)
                  break;
                if (q = Pe(I.strm, I.window, I.strstart + I.lookahead, Ce), I.lookahead += q, I.lookahead + I.insert >= H)
                  for (Ze = I.strstart - I.insert, I.ins_h = I.window[Ze], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[Ze + 1]) & I.hash_mask; I.insert && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[Ze + H - 1]) & I.hash_mask, I.prev[Ze & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = Ze, Ze++, I.insert--, !(I.lookahead + I.insert < H)); )
                    ;
              } while (I.lookahead < j && I.strm.avail_in !== 0);
            }
            function De(I, xe) {
              var be = 65535;
              for (be > I.pending_buf_size - 5 && (be = I.pending_buf_size - 5); ; ) {
                if (I.lookahead <= 1) {
                  if (Me(I), I.lookahead === 0 && xe === d)
                    return se;
                  if (I.lookahead === 0)
                    break;
                }
                I.strstart += I.lookahead, I.lookahead = 0;
                var q = I.block_start + be;
                if ((I.strstart === 0 || I.strstart >= q) && (I.lookahead = I.strstart - q, I.strstart = q, We(I, !1), I.strm.avail_out === 0) || I.strstart - I.block_start >= I.w_size - j && (We(I, !1), I.strm.avail_out === 0))
                  return se;
              }
              return I.insert = 0, xe === y ? (We(I, !0), I.strm.avail_out === 0 ? he : ne) : (I.strstart > I.block_start && (We(I, !1), I.strm.avail_out === 0), se);
            }
            function V(I, xe) {
              for (var be, q; ; ) {
                if (I.lookahead < j) {
                  if (Me(I), I.lookahead < j && xe === d)
                    return se;
                  if (I.lookahead === 0)
                    break;
                }
                if (be = 0, I.lookahead >= H && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, be = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), be !== 0 && I.strstart - be <= I.w_size - j && (I.match_length = Te(I, be)), I.match_length >= H)
                  if (q = a._tr_tally(I, I.strstart - I.match_start, I.match_length - H), I.lookahead -= I.match_length, I.match_length <= I.max_lazy_match && I.lookahead >= H) {
                    I.match_length--;
                    do
                      I.strstart++, I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, be = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart;
                    while (--I.match_length !== 0);
                    I.strstart++;
                  } else
                    I.strstart += I.match_length, I.match_length = 0, I.ins_h = I.window[I.strstart], I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + 1]) & I.hash_mask;
                else
                  q = a._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++;
                if (q && (We(I, !1), I.strm.avail_out === 0))
                  return se;
              }
              return I.insert = I.strstart < H - 1 ? I.strstart : H - 1, xe === y ? (We(I, !0), I.strm.avail_out === 0 ? he : ne) : I.last_lit && (We(I, !1), I.strm.avail_out === 0) ? se : Ae;
            }
            function Z(I, xe) {
              for (var be, q, fe; ; ) {
                if (I.lookahead < j) {
                  if (Me(I), I.lookahead < j && xe === d)
                    return se;
                  if (I.lookahead === 0)
                    break;
                }
                if (be = 0, I.lookahead >= H && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, be = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart), I.prev_length = I.match_length, I.prev_match = I.match_start, I.match_length = H - 1, be !== 0 && I.prev_length < I.max_lazy_match && I.strstart - be <= I.w_size - j && (I.match_length = Te(I, be), I.match_length <= 5 && (I.strategy === g || I.match_length === H && I.strstart - I.match_start > 4096) && (I.match_length = H - 1)), I.prev_length >= H && I.match_length <= I.prev_length) {
                  fe = I.strstart + I.lookahead - H, q = a._tr_tally(I, I.strstart - 1 - I.prev_match, I.prev_length - H), I.lookahead -= I.prev_length - 1, I.prev_length -= 2;
                  do
                    ++I.strstart <= fe && (I.ins_h = (I.ins_h << I.hash_shift ^ I.window[I.strstart + H - 1]) & I.hash_mask, be = I.prev[I.strstart & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = I.strstart);
                  while (--I.prev_length !== 0);
                  if (I.match_available = 0, I.match_length = H - 1, I.strstart++, q && (We(I, !1), I.strm.avail_out === 0))
                    return se;
                } else if (I.match_available) {
                  if (q = a._tr_tally(I, 0, I.window[I.strstart - 1]), q && We(I, !1), I.strstart++, I.lookahead--, I.strm.avail_out === 0)
                    return se;
                } else
                  I.match_available = 1, I.strstart++, I.lookahead--;
              }
              return I.match_available && (q = a._tr_tally(I, 0, I.window[I.strstart - 1]), I.match_available = 0), I.insert = I.strstart < H - 1 ? I.strstart : H - 1, xe === y ? (We(I, !0), I.strm.avail_out === 0 ? he : ne) : I.last_lit && (We(I, !1), I.strm.avail_out === 0) ? se : Ae;
            }
            function ee(I, xe) {
              for (var be, q, fe, Ce, Ze = I.window; ; ) {
                if (I.lookahead <= U) {
                  if (Me(I), I.lookahead <= U && xe === d)
                    return se;
                  if (I.lookahead === 0)
                    break;
                }
                if (I.match_length = 0, I.lookahead >= H && I.strstart > 0 && (fe = I.strstart - 1, q = Ze[fe], q === Ze[++fe] && q === Ze[++fe] && q === Ze[++fe])) {
                  Ce = I.strstart + U;
                  do
                    ;
                  while (q === Ze[++fe] && q === Ze[++fe] && q === Ze[++fe] && q === Ze[++fe] && q === Ze[++fe] && q === Ze[++fe] && q === Ze[++fe] && q === Ze[++fe] && fe < Ce);
                  I.match_length = U - (Ce - fe), I.match_length > I.lookahead && (I.match_length = I.lookahead);
                }
                if (I.match_length >= H ? (be = a._tr_tally(I, 1, I.match_length - H), I.lookahead -= I.match_length, I.strstart += I.match_length, I.match_length = 0) : (be = a._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++), be && (We(I, !1), I.strm.avail_out === 0))
                  return se;
              }
              return I.insert = 0, xe === y ? (We(I, !0), I.strm.avail_out === 0 ? he : ne) : I.last_lit && (We(I, !1), I.strm.avail_out === 0) ? se : Ae;
            }
            function ye(I, xe) {
              for (var be; ; ) {
                if (I.lookahead === 0 && (Me(I), I.lookahead === 0)) {
                  if (xe === d)
                    return se;
                  break;
                }
                if (I.match_length = 0, be = a._tr_tally(I, 0, I.window[I.strstart]), I.lookahead--, I.strstart++, be && (We(I, !1), I.strm.avail_out === 0))
                  return se;
              }
              return I.insert = 0, xe === y ? (We(I, !0), I.strm.avail_out === 0 ? he : ne) : I.last_lit && (We(I, !1), I.strm.avail_out === 0) ? se : Ae;
            }
            function ce(I, xe, be, q, fe) {
              this.good_length = I, this.max_lazy = xe, this.nice_length = be, this.max_chain = q, this.func = fe;
            }
            var Ie;
            Ie = [
              /*      good lazy nice chain */
              new ce(0, 0, 0, 0, De),
              /* 0 store only */
              new ce(4, 4, 8, 4, V),
              /* 1 max speed, no lazy matches */
              new ce(4, 5, 16, 8, V),
              /* 2 */
              new ce(4, 6, 32, 32, V),
              /* 3 */
              new ce(4, 4, 16, 16, Z),
              /* 4 lazy matches */
              new ce(8, 16, 32, 32, Z),
              /* 5 */
              new ce(8, 16, 128, 128, Z),
              /* 6 */
              new ce(8, 32, 128, 256, Z),
              /* 7 */
              new ce(32, 128, 258, 1024, Z),
              /* 8 */
              new ce(32, 258, 258, 4096, Z)
              /* 9 max compression */
            ];
            function ke(I) {
              I.window_size = 2 * I.w_size, Ue(I.head), I.max_lazy_match = Ie[I.level].max_lazy, I.good_match = Ie[I.level].good_length, I.nice_match = Ie[I.level].nice_length, I.max_chain_length = Ie[I.level].max_chain, I.strstart = 0, I.block_start = 0, I.lookahead = 0, I.insert = 0, I.match_length = I.prev_length = H - 1, I.match_available = 0, I.ins_h = 0;
            }
            function Y() {
              this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = $, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new r.Buf16(P * 2), this.dyn_dtree = new r.Buf16((2 * W + 1) * 2), this.bl_tree = new r.Buf16((2 * B + 1) * 2), Ue(this.dyn_ltree), Ue(this.dyn_dtree), Ue(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new r.Buf16(G + 1), this.heap = new r.Buf16(2 * N + 1), Ue(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new r.Buf16(2 * N + 1), Ue(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
            }
            function me(I) {
              var xe;
              return !I || !I.state ? Le(I, f) : (I.total_in = I.total_out = 0, I.data_type = E, xe = I.state, xe.pending = 0, xe.pending_out = 0, xe.wrap < 0 && (xe.wrap = -xe.wrap), xe.status = xe.wrap ? ie : J, I.adler = xe.wrap === 2 ? 0 : 1, xe.last_flush = d, a._tr_init(xe), b);
            }
            function we(I) {
              var xe = me(I);
              return xe === b && ke(I.state), xe;
            }
            function Re(I, xe) {
              return !I || !I.state || I.state.wrap !== 2 ? f : (I.state.gzhead = xe, b);
            }
            function pe(I, xe, be, q, fe, Ce) {
              if (!I)
                return f;
              var Ze = 1;
              if (xe === p && (xe = 6), q < 0 ? (Ze = 0, q = -q) : q > 15 && (Ze = 2, q -= 16), fe < 1 || fe > k || be !== $ || q < 8 || q > 15 || xe < 0 || xe > 9 || Ce < 0 || Ce > v)
                return Le(I, f);
              q === 8 && (q = 9);
              var Xe = new Y();
              return I.state = Xe, Xe.strm = I, Xe.wrap = Ze, Xe.gzhead = null, Xe.w_bits = q, Xe.w_size = 1 << Xe.w_bits, Xe.w_mask = Xe.w_size - 1, Xe.hash_bits = fe + 7, Xe.hash_size = 1 << Xe.hash_bits, Xe.hash_mask = Xe.hash_size - 1, Xe.hash_shift = ~~((Xe.hash_bits + H - 1) / H), Xe.window = new r.Buf8(Xe.w_size * 2), Xe.head = new r.Buf16(Xe.hash_size), Xe.prev = new r.Buf16(Xe.w_size), Xe.lit_bufsize = 1 << fe + 6, Xe.pending_buf_size = Xe.lit_bufsize * 4, Xe.pending_buf = new r.Buf8(Xe.pending_buf_size), Xe.d_buf = 1 * Xe.lit_bufsize, Xe.l_buf = 3 * Xe.lit_bufsize, Xe.level = xe, Xe.strategy = Ce, Xe.method = be, we(I);
            }
            function $e(I, xe) {
              return pe(I, xe, $, L, z, M);
            }
            function X(I, xe) {
              var be, q, fe, Ce;
              if (!I || !I.state || xe > x || xe < 0)
                return I ? Le(I, f) : f;
              if (q = I.state, !I.output || !I.input && I.avail_in !== 0 || q.status === Ee && xe !== y)
                return Le(I, I.avail_out === 0 ? u : f);
              if (q.strm = I, be = q.last_flush, q.last_flush = xe, q.status === ie)
                if (q.wrap === 2)
                  I.adler = 0, Ge(q, 31), Ge(q, 139), Ge(q, 8), q.gzhead ? (Ge(
                    q,
                    (q.gzhead.text ? 1 : 0) + (q.gzhead.hcrc ? 2 : 0) + (q.gzhead.extra ? 4 : 0) + (q.gzhead.name ? 8 : 0) + (q.gzhead.comment ? 16 : 0)
                  ), Ge(q, q.gzhead.time & 255), Ge(q, q.gzhead.time >> 8 & 255), Ge(q, q.gzhead.time >> 16 & 255), Ge(q, q.gzhead.time >> 24 & 255), Ge(q, q.level === 9 ? 2 : q.strategy >= w || q.level < 2 ? 4 : 0), Ge(q, q.gzhead.os & 255), q.gzhead.extra && q.gzhead.extra.length && (Ge(q, q.gzhead.extra.length & 255), Ge(q, q.gzhead.extra.length >> 8 & 255)), q.gzhead.hcrc && (I.adler = h(I.adler, q.pending_buf, q.pending, 0)), q.gzindex = 0, q.status = te) : (Ge(q, 0), Ge(q, 0), Ge(q, 0), Ge(q, 0), Ge(q, 0), Ge(q, q.level === 9 ? 2 : q.strategy >= w || q.level < 2 ? 4 : 0), Ge(q, _e), q.status = J);
                else {
                  var Ze = $ + (q.w_bits - 8 << 4) << 8, Xe = -1;
                  q.strategy >= w || q.level < 2 ? Xe = 0 : q.level < 6 ? Xe = 1 : q.level === 6 ? Xe = 2 : Xe = 3, Ze |= Xe << 6, q.strstart !== 0 && (Ze |= re), Ze += 31 - Ze % 31, q.status = J, Ne(q, Ze), q.strstart !== 0 && (Ne(q, I.adler >>> 16), Ne(q, I.adler & 65535)), I.adler = 1;
                }
              if (q.status === te)
                if (q.gzhead.extra) {
                  for (fe = q.pending; q.gzindex < (q.gzhead.extra.length & 65535) && !(q.pending === q.pending_buf_size && (q.gzhead.hcrc && q.pending > fe && (I.adler = h(I.adler, q.pending_buf, q.pending - fe, fe)), He(I), fe = q.pending, q.pending === q.pending_buf_size)); )
                    Ge(q, q.gzhead.extra[q.gzindex] & 255), q.gzindex++;
                  q.gzhead.hcrc && q.pending > fe && (I.adler = h(I.adler, q.pending_buf, q.pending - fe, fe)), q.gzindex === q.gzhead.extra.length && (q.gzindex = 0, q.status = ue);
                } else
                  q.status = ue;
              if (q.status === ue)
                if (q.gzhead.name) {
                  fe = q.pending;
                  do {
                    if (q.pending === q.pending_buf_size && (q.gzhead.hcrc && q.pending > fe && (I.adler = h(I.adler, q.pending_buf, q.pending - fe, fe)), He(I), fe = q.pending, q.pending === q.pending_buf_size)) {
                      Ce = 1;
                      break;
                    }
                    q.gzindex < q.gzhead.name.length ? Ce = q.gzhead.name.charCodeAt(q.gzindex++) & 255 : Ce = 0, Ge(q, Ce);
                  } while (Ce !== 0);
                  q.gzhead.hcrc && q.pending > fe && (I.adler = h(I.adler, q.pending_buf, q.pending - fe, fe)), Ce === 0 && (q.gzindex = 0, q.status = de);
                } else
                  q.status = de;
              if (q.status === de)
                if (q.gzhead.comment) {
                  fe = q.pending;
                  do {
                    if (q.pending === q.pending_buf_size && (q.gzhead.hcrc && q.pending > fe && (I.adler = h(I.adler, q.pending_buf, q.pending - fe, fe)), He(I), fe = q.pending, q.pending === q.pending_buf_size)) {
                      Ce = 1;
                      break;
                    }
                    q.gzindex < q.gzhead.comment.length ? Ce = q.gzhead.comment.charCodeAt(q.gzindex++) & 255 : Ce = 0, Ge(q, Ce);
                  } while (Ce !== 0);
                  q.gzhead.hcrc && q.pending > fe && (I.adler = h(I.adler, q.pending_buf, q.pending - fe, fe)), Ce === 0 && (q.status = oe);
                } else
                  q.status = oe;
              if (q.status === oe && (q.gzhead.hcrc ? (q.pending + 2 > q.pending_buf_size && He(I), q.pending + 2 <= q.pending_buf_size && (Ge(q, I.adler & 255), Ge(q, I.adler >> 8 & 255), I.adler = 0, q.status = J)) : q.status = J), q.pending !== 0) {
                if (He(I), I.avail_out === 0)
                  return q.last_flush = -1, b;
              } else if (I.avail_in === 0 && Be(xe) <= Be(be) && xe !== y)
                return Le(I, u);
              if (q.status === Ee && I.avail_in !== 0)
                return Le(I, u);
              if (I.avail_in !== 0 || q.lookahead !== 0 || xe !== d && q.status !== Ee) {
                var Ye = q.strategy === w ? ye(q, xe) : q.strategy === o ? ee(q, xe) : Ie[q.level].func(q, xe);
                if ((Ye === he || Ye === ne) && (q.status = Ee), Ye === se || Ye === he)
                  return I.avail_out === 0 && (q.last_flush = -1), b;
                if (Ye === Ae && (xe === _ ? a._tr_align(q) : xe !== x && (a._tr_stored_block(q, 0, 0, !1), xe === m && (Ue(q.head), q.lookahead === 0 && (q.strstart = 0, q.block_start = 0, q.insert = 0))), He(I), I.avail_out === 0))
                  return q.last_flush = -1, b;
              }
              return xe !== y ? b : q.wrap <= 0 ? A : (q.wrap === 2 ? (Ge(q, I.adler & 255), Ge(q, I.adler >> 8 & 255), Ge(q, I.adler >> 16 & 255), Ge(q, I.adler >> 24 & 255), Ge(q, I.total_in & 255), Ge(q, I.total_in >> 8 & 255), Ge(q, I.total_in >> 16 & 255), Ge(q, I.total_in >> 24 & 255)) : (Ne(q, I.adler >>> 16), Ne(q, I.adler & 65535)), He(I), q.wrap > 0 && (q.wrap = -q.wrap), q.pending !== 0 ? b : A);
            }
            function ze(I) {
              var xe;
              return !I || !I.state ? f : (xe = I.state.status, xe !== ie && xe !== te && xe !== ue && xe !== de && xe !== oe && xe !== J && xe !== Ee ? Le(I, f) : (I.state = null, xe === J ? Le(I, s) : b));
            }
            function Ve(I, xe) {
              var be = xe.length, q, fe, Ce, Ze, Xe, Ye, lt, dt;
              if (!I || !I.state || (q = I.state, Ze = q.wrap, Ze === 2 || Ze === 1 && q.status !== ie || q.lookahead))
                return f;
              for (Ze === 1 && (I.adler = l(I.adler, xe, be, 0)), q.wrap = 0, be >= q.w_size && (Ze === 0 && (Ue(q.head), q.strstart = 0, q.block_start = 0, q.insert = 0), dt = new r.Buf8(q.w_size), r.arraySet(dt, xe, be - q.w_size, q.w_size, 0), xe = dt, be = q.w_size), Xe = I.avail_in, Ye = I.next_in, lt = I.input, I.avail_in = be, I.next_in = 0, I.input = xe, Me(q); q.lookahead >= H; ) {
                fe = q.strstart, Ce = q.lookahead - (H - 1);
                do
                  q.ins_h = (q.ins_h << q.hash_shift ^ q.window[fe + H - 1]) & q.hash_mask, q.prev[fe & q.w_mask] = q.head[q.ins_h], q.head[q.ins_h] = fe, fe++;
                while (--Ce);
                q.strstart = fe, q.lookahead = H - 1, Me(q);
              }
              return q.strstart += q.lookahead, q.block_start = q.strstart, q.insert = q.lookahead, q.lookahead = 0, q.match_length = q.prev_length = H - 1, q.match_available = 0, I.next_in = Ye, I.input = lt, I.avail_in = Xe, q.wrap = Ze, b;
            }
            e.deflateInit = $e, e.deflateInit2 = pe, e.deflateReset = we, e.deflateResetKeep = me, e.deflateSetHeader = Re, e.deflate = X, e.deflateEnd = ze, e.deflateSetDictionary = Ve, e.deflateInfo = "pako deflate (from Nodeca project)";
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js": (
          /*!*********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/gzheader.js ***!
            \*********************************************************************/
          /***/
          (n) => {
            function e() {
              this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
            }
            n.exports = e;
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js": (
          /*!********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js ***!
            \********************************************************************/
          /***/
          (n) => {
            var e = 30, t = 12;
            n.exports = function(a, l) {
              var h, c, d, _, m, y, x, b, A, f, s, u, p, g, w, o, v, M, E, $, k, L, z, O, R;
              h = a.state, c = a.next_in, O = a.input, d = c + (a.avail_in - 5), _ = a.next_out, R = a.output, m = _ - (l - a.avail_out), y = _ + (a.avail_out - 257), x = h.dmax, b = h.wsize, A = h.whave, f = h.wnext, s = h.window, u = h.hold, p = h.bits, g = h.lencode, w = h.distcode, o = (1 << h.lenbits) - 1, v = (1 << h.distbits) - 1;
              e:
                do {
                  p < 15 && (u += O[c++] << p, p += 8, u += O[c++] << p, p += 8), M = g[u & o];
                  t:
                    for (; ; ) {
                      if (E = M >>> 24, u >>>= E, p -= E, E = M >>> 16 & 255, E === 0)
                        R[_++] = M & 65535;
                      else if (E & 16) {
                        $ = M & 65535, E &= 15, E && (p < E && (u += O[c++] << p, p += 8), $ += u & (1 << E) - 1, u >>>= E, p -= E), p < 15 && (u += O[c++] << p, p += 8, u += O[c++] << p, p += 8), M = w[u & v];
                        r:
                          for (; ; ) {
                            if (E = M >>> 24, u >>>= E, p -= E, E = M >>> 16 & 255, E & 16) {
                              if (k = M & 65535, E &= 15, p < E && (u += O[c++] << p, p += 8, p < E && (u += O[c++] << p, p += 8)), k += u & (1 << E) - 1, k > x) {
                                a.msg = "invalid distance too far back", h.mode = e;
                                break e;
                              }
                              if (u >>>= E, p -= E, E = _ - m, k > E) {
                                if (E = k - E, E > A && h.sane) {
                                  a.msg = "invalid distance too far back", h.mode = e;
                                  break e;
                                }
                                if (L = 0, z = s, f === 0) {
                                  if (L += b - E, E < $) {
                                    $ -= E;
                                    do
                                      R[_++] = s[L++];
                                    while (--E);
                                    L = _ - k, z = R;
                                  }
                                } else if (f < E) {
                                  if (L += b + f - E, E -= f, E < $) {
                                    $ -= E;
                                    do
                                      R[_++] = s[L++];
                                    while (--E);
                                    if (L = 0, f < $) {
                                      E = f, $ -= E;
                                      do
                                        R[_++] = s[L++];
                                      while (--E);
                                      L = _ - k, z = R;
                                    }
                                  }
                                } else if (L += f - E, E < $) {
                                  $ -= E;
                                  do
                                    R[_++] = s[L++];
                                  while (--E);
                                  L = _ - k, z = R;
                                }
                                for (; $ > 2; )
                                  R[_++] = z[L++], R[_++] = z[L++], R[_++] = z[L++], $ -= 3;
                                $ && (R[_++] = z[L++], $ > 1 && (R[_++] = z[L++]));
                              } else {
                                L = _ - k;
                                do
                                  R[_++] = R[L++], R[_++] = R[L++], R[_++] = R[L++], $ -= 3;
                                while ($ > 2);
                                $ && (R[_++] = R[L++], $ > 1 && (R[_++] = R[L++]));
                              }
                            } else if (E & 64) {
                              a.msg = "invalid distance code", h.mode = e;
                              break e;
                            } else {
                              M = w[(M & 65535) + (u & (1 << E) - 1)];
                              continue r;
                            }
                            break;
                          }
                      } else if (E & 64)
                        if (E & 32) {
                          h.mode = t;
                          break e;
                        } else {
                          a.msg = "invalid literal/length code", h.mode = e;
                          break e;
                        }
                      else {
                        M = g[(M & 65535) + (u & (1 << E) - 1)];
                        continue t;
                      }
                      break;
                    }
                } while (c < d && _ < y);
              $ = p >> 3, c -= $, p -= $ << 3, u &= (1 << p) - 1, a.next_in = c, a.next_out = _, a.avail_in = c < d ? 5 + (d - c) : 5 - (c - d), a.avail_out = _ < y ? 257 + (y - _) : 257 - (_ - y), h.hold = u, h.bits = p;
            };
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js": (
          /*!********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/inflate.js ***!
            \********************************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ../utils/common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ), a = t(
              /*! ./adler32 */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/adler32.js"
            ), l = t(
              /*! ./crc32 */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/crc32.js"
            ), h = t(
              /*! ./inffast */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/inffast.js"
            ), c = t(
              /*! ./inftrees */
              "./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js"
            ), d = 0, _ = 1, m = 2, y = 4, x = 5, b = 6, A = 0, f = 1, s = 2, u = -2, p = -3, g = -4, w = -5, o = 8, v = 1, M = 2, E = 3, $ = 4, k = 5, L = 6, z = 7, O = 8, R = 9, N = 10, W = 11, B = 12, P = 13, G = 14, H = 15, U = 16, j = 17, re = 18, ie = 19, te = 20, ue = 21, de = 22, oe = 23, J = 24, Ee = 25, se = 26, Ae = 27, he = 28, ne = 29, _e = 30, Le = 31, Be = 32, Ue = 852, He = 592, We = 15, Ge = We;
            function Ne(pe) {
              return (pe >>> 24 & 255) + (pe >>> 8 & 65280) + ((pe & 65280) << 8) + ((pe & 255) << 24);
            }
            function Pe() {
              this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new r.Buf16(320), this.work = new r.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
            }
            function Te(pe) {
              var $e;
              return !pe || !pe.state ? u : ($e = pe.state, pe.total_in = pe.total_out = $e.total = 0, pe.msg = "", $e.wrap && (pe.adler = $e.wrap & 1), $e.mode = v, $e.last = 0, $e.havedict = 0, $e.dmax = 32768, $e.head = null, $e.hold = 0, $e.bits = 0, $e.lencode = $e.lendyn = new r.Buf32(Ue), $e.distcode = $e.distdyn = new r.Buf32(He), $e.sane = 1, $e.back = -1, A);
            }
            function Me(pe) {
              var $e;
              return !pe || !pe.state ? u : ($e = pe.state, $e.wsize = 0, $e.whave = 0, $e.wnext = 0, Te(pe));
            }
            function De(pe, $e) {
              var X, ze;
              return !pe || !pe.state || (ze = pe.state, $e < 0 ? (X = 0, $e = -$e) : (X = ($e >> 4) + 1, $e < 48 && ($e &= 15)), $e && ($e < 8 || $e > 15)) ? u : (ze.window !== null && ze.wbits !== $e && (ze.window = null), ze.wrap = X, ze.wbits = $e, Me(pe));
            }
            function V(pe, $e) {
              var X, ze;
              return pe ? (ze = new Pe(), pe.state = ze, ze.window = null, X = De(pe, $e), X !== A && (pe.state = null), X) : u;
            }
            function Z(pe) {
              return V(pe, Ge);
            }
            var ee = !0, ye, ce;
            function Ie(pe) {
              if (ee) {
                var $e;
                for (ye = new r.Buf32(512), ce = new r.Buf32(32), $e = 0; $e < 144; )
                  pe.lens[$e++] = 8;
                for (; $e < 256; )
                  pe.lens[$e++] = 9;
                for (; $e < 280; )
                  pe.lens[$e++] = 7;
                for (; $e < 288; )
                  pe.lens[$e++] = 8;
                for (c(_, pe.lens, 0, 288, ye, 0, pe.work, { bits: 9 }), $e = 0; $e < 32; )
                  pe.lens[$e++] = 5;
                c(m, pe.lens, 0, 32, ce, 0, pe.work, { bits: 5 }), ee = !1;
              }
              pe.lencode = ye, pe.lenbits = 9, pe.distcode = ce, pe.distbits = 5;
            }
            function ke(pe, $e, X, ze) {
              var Ve, I = pe.state;
              return I.window === null && (I.wsize = 1 << I.wbits, I.wnext = 0, I.whave = 0, I.window = new r.Buf8(I.wsize)), ze >= I.wsize ? (r.arraySet(I.window, $e, X - I.wsize, I.wsize, 0), I.wnext = 0, I.whave = I.wsize) : (Ve = I.wsize - I.wnext, Ve > ze && (Ve = ze), r.arraySet(I.window, $e, X - ze, Ve, I.wnext), ze -= Ve, ze ? (r.arraySet(I.window, $e, X - ze, ze, 0), I.wnext = ze, I.whave = I.wsize) : (I.wnext += Ve, I.wnext === I.wsize && (I.wnext = 0), I.whave < I.wsize && (I.whave += Ve))), 0;
            }
            function Y(pe, $e) {
              var X, ze, Ve, I, xe, be, q, fe, Ce, Ze, Xe, Ye, lt, dt, it = 0, ot, nt, Ct, ut, zt, Ut, wt, mt, vt = new r.Buf8(4), Rt, qe, ge = (
                /* permutation of code lengths */
                [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]
              );
              if (!pe || !pe.state || !pe.output || !pe.input && pe.avail_in !== 0)
                return u;
              X = pe.state, X.mode === B && (X.mode = P), xe = pe.next_out, Ve = pe.output, q = pe.avail_out, I = pe.next_in, ze = pe.input, be = pe.avail_in, fe = X.hold, Ce = X.bits, Ze = be, Xe = q, mt = A;
              e:
                for (; ; )
                  switch (X.mode) {
                    case v:
                      if (X.wrap === 0) {
                        X.mode = P;
                        break;
                      }
                      for (; Ce < 16; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      if (X.wrap & 2 && fe === 35615) {
                        X.check = 0, vt[0] = fe & 255, vt[1] = fe >>> 8 & 255, X.check = l(X.check, vt, 2, 0), fe = 0, Ce = 0, X.mode = M;
                        break;
                      }
                      if (X.flags = 0, X.head && (X.head.done = !1), !(X.wrap & 1) || /* check if zlib header allowed */
                      (((fe & 255) << 8) + (fe >> 8)) % 31) {
                        pe.msg = "incorrect header check", X.mode = _e;
                        break;
                      }
                      if ((fe & 15) !== o) {
                        pe.msg = "unknown compression method", X.mode = _e;
                        break;
                      }
                      if (fe >>>= 4, Ce -= 4, wt = (fe & 15) + 8, X.wbits === 0)
                        X.wbits = wt;
                      else if (wt > X.wbits) {
                        pe.msg = "invalid window size", X.mode = _e;
                        break;
                      }
                      X.dmax = 1 << wt, pe.adler = X.check = 1, X.mode = fe & 512 ? N : B, fe = 0, Ce = 0;
                      break;
                    case M:
                      for (; Ce < 16; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      if (X.flags = fe, (X.flags & 255) !== o) {
                        pe.msg = "unknown compression method", X.mode = _e;
                        break;
                      }
                      if (X.flags & 57344) {
                        pe.msg = "unknown header flags set", X.mode = _e;
                        break;
                      }
                      X.head && (X.head.text = fe >> 8 & 1), X.flags & 512 && (vt[0] = fe & 255, vt[1] = fe >>> 8 & 255, X.check = l(X.check, vt, 2, 0)), fe = 0, Ce = 0, X.mode = E;
                    case E:
                      for (; Ce < 32; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      X.head && (X.head.time = fe), X.flags & 512 && (vt[0] = fe & 255, vt[1] = fe >>> 8 & 255, vt[2] = fe >>> 16 & 255, vt[3] = fe >>> 24 & 255, X.check = l(X.check, vt, 4, 0)), fe = 0, Ce = 0, X.mode = $;
                    case $:
                      for (; Ce < 16; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      X.head && (X.head.xflags = fe & 255, X.head.os = fe >> 8), X.flags & 512 && (vt[0] = fe & 255, vt[1] = fe >>> 8 & 255, X.check = l(X.check, vt, 2, 0)), fe = 0, Ce = 0, X.mode = k;
                    case k:
                      if (X.flags & 1024) {
                        for (; Ce < 16; ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        X.length = fe, X.head && (X.head.extra_len = fe), X.flags & 512 && (vt[0] = fe & 255, vt[1] = fe >>> 8 & 255, X.check = l(X.check, vt, 2, 0)), fe = 0, Ce = 0;
                      } else X.head && (X.head.extra = null);
                      X.mode = L;
                    case L:
                      if (X.flags & 1024 && (Ye = X.length, Ye > be && (Ye = be), Ye && (X.head && (wt = X.head.extra_len - X.length, X.head.extra || (X.head.extra = new Array(X.head.extra_len)), r.arraySet(
                        X.head.extra,
                        ze,
                        I,
                        // extra field is limited to 65536 bytes
                        // - no need for additional size check
                        Ye,
                        /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
                        wt
                      )), X.flags & 512 && (X.check = l(X.check, ze, Ye, I)), be -= Ye, I += Ye, X.length -= Ye), X.length))
                        break e;
                      X.length = 0, X.mode = z;
                    case z:
                      if (X.flags & 2048) {
                        if (be === 0)
                          break e;
                        Ye = 0;
                        do
                          wt = ze[I + Ye++], X.head && wt && X.length < 65536 && (X.head.name += String.fromCharCode(wt));
                        while (wt && Ye < be);
                        if (X.flags & 512 && (X.check = l(X.check, ze, Ye, I)), be -= Ye, I += Ye, wt)
                          break e;
                      } else X.head && (X.head.name = null);
                      X.length = 0, X.mode = O;
                    case O:
                      if (X.flags & 4096) {
                        if (be === 0)
                          break e;
                        Ye = 0;
                        do
                          wt = ze[I + Ye++], X.head && wt && X.length < 65536 && (X.head.comment += String.fromCharCode(wt));
                        while (wt && Ye < be);
                        if (X.flags & 512 && (X.check = l(X.check, ze, Ye, I)), be -= Ye, I += Ye, wt)
                          break e;
                      } else X.head && (X.head.comment = null);
                      X.mode = R;
                    case R:
                      if (X.flags & 512) {
                        for (; Ce < 16; ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        if (fe !== (X.check & 65535)) {
                          pe.msg = "header crc mismatch", X.mode = _e;
                          break;
                        }
                        fe = 0, Ce = 0;
                      }
                      X.head && (X.head.hcrc = X.flags >> 9 & 1, X.head.done = !0), pe.adler = X.check = 0, X.mode = B;
                      break;
                    case N:
                      for (; Ce < 32; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      pe.adler = X.check = Ne(fe), fe = 0, Ce = 0, X.mode = W;
                    case W:
                      if (X.havedict === 0)
                        return pe.next_out = xe, pe.avail_out = q, pe.next_in = I, pe.avail_in = be, X.hold = fe, X.bits = Ce, s;
                      pe.adler = X.check = 1, X.mode = B;
                    case B:
                      if ($e === x || $e === b)
                        break e;
                    case P:
                      if (X.last) {
                        fe >>>= Ce & 7, Ce -= Ce & 7, X.mode = Ae;
                        break;
                      }
                      for (; Ce < 3; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      switch (X.last = fe & 1, fe >>>= 1, Ce -= 1, fe & 3) {
                        case 0:
                          X.mode = G;
                          break;
                        case 1:
                          if (Ie(X), X.mode = te, $e === b) {
                            fe >>>= 2, Ce -= 2;
                            break e;
                          }
                          break;
                        case 2:
                          X.mode = j;
                          break;
                        case 3:
                          pe.msg = "invalid block type", X.mode = _e;
                      }
                      fe >>>= 2, Ce -= 2;
                      break;
                    case G:
                      for (fe >>>= Ce & 7, Ce -= Ce & 7; Ce < 32; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      if ((fe & 65535) !== (fe >>> 16 ^ 65535)) {
                        pe.msg = "invalid stored block lengths", X.mode = _e;
                        break;
                      }
                      if (X.length = fe & 65535, fe = 0, Ce = 0, X.mode = H, $e === b)
                        break e;
                    case H:
                      X.mode = U;
                    case U:
                      if (Ye = X.length, Ye) {
                        if (Ye > be && (Ye = be), Ye > q && (Ye = q), Ye === 0)
                          break e;
                        r.arraySet(Ve, ze, I, Ye, xe), be -= Ye, I += Ye, q -= Ye, xe += Ye, X.length -= Ye;
                        break;
                      }
                      X.mode = B;
                      break;
                    case j:
                      for (; Ce < 14; ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      if (X.nlen = (fe & 31) + 257, fe >>>= 5, Ce -= 5, X.ndist = (fe & 31) + 1, fe >>>= 5, Ce -= 5, X.ncode = (fe & 15) + 4, fe >>>= 4, Ce -= 4, X.nlen > 286 || X.ndist > 30) {
                        pe.msg = "too many length or distance symbols", X.mode = _e;
                        break;
                      }
                      X.have = 0, X.mode = re;
                    case re:
                      for (; X.have < X.ncode; ) {
                        for (; Ce < 3; ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        X.lens[ge[X.have++]] = fe & 7, fe >>>= 3, Ce -= 3;
                      }
                      for (; X.have < 19; )
                        X.lens[ge[X.have++]] = 0;
                      if (X.lencode = X.lendyn, X.lenbits = 7, Rt = { bits: X.lenbits }, mt = c(d, X.lens, 0, 19, X.lencode, 0, X.work, Rt), X.lenbits = Rt.bits, mt) {
                        pe.msg = "invalid code lengths set", X.mode = _e;
                        break;
                      }
                      X.have = 0, X.mode = ie;
                    case ie:
                      for (; X.have < X.nlen + X.ndist; ) {
                        for (; it = X.lencode[fe & (1 << X.lenbits) - 1], ot = it >>> 24, nt = it >>> 16 & 255, Ct = it & 65535, !(ot <= Ce); ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        if (Ct < 16)
                          fe >>>= ot, Ce -= ot, X.lens[X.have++] = Ct;
                        else {
                          if (Ct === 16) {
                            for (qe = ot + 2; Ce < qe; ) {
                              if (be === 0)
                                break e;
                              be--, fe += ze[I++] << Ce, Ce += 8;
                            }
                            if (fe >>>= ot, Ce -= ot, X.have === 0) {
                              pe.msg = "invalid bit length repeat", X.mode = _e;
                              break;
                            }
                            wt = X.lens[X.have - 1], Ye = 3 + (fe & 3), fe >>>= 2, Ce -= 2;
                          } else if (Ct === 17) {
                            for (qe = ot + 3; Ce < qe; ) {
                              if (be === 0)
                                break e;
                              be--, fe += ze[I++] << Ce, Ce += 8;
                            }
                            fe >>>= ot, Ce -= ot, wt = 0, Ye = 3 + (fe & 7), fe >>>= 3, Ce -= 3;
                          } else {
                            for (qe = ot + 7; Ce < qe; ) {
                              if (be === 0)
                                break e;
                              be--, fe += ze[I++] << Ce, Ce += 8;
                            }
                            fe >>>= ot, Ce -= ot, wt = 0, Ye = 11 + (fe & 127), fe >>>= 7, Ce -= 7;
                          }
                          if (X.have + Ye > X.nlen + X.ndist) {
                            pe.msg = "invalid bit length repeat", X.mode = _e;
                            break;
                          }
                          for (; Ye--; )
                            X.lens[X.have++] = wt;
                        }
                      }
                      if (X.mode === _e)
                        break;
                      if (X.lens[256] === 0) {
                        pe.msg = "invalid code -- missing end-of-block", X.mode = _e;
                        break;
                      }
                      if (X.lenbits = 9, Rt = { bits: X.lenbits }, mt = c(_, X.lens, 0, X.nlen, X.lencode, 0, X.work, Rt), X.lenbits = Rt.bits, mt) {
                        pe.msg = "invalid literal/lengths set", X.mode = _e;
                        break;
                      }
                      if (X.distbits = 6, X.distcode = X.distdyn, Rt = { bits: X.distbits }, mt = c(m, X.lens, X.nlen, X.ndist, X.distcode, 0, X.work, Rt), X.distbits = Rt.bits, mt) {
                        pe.msg = "invalid distances set", X.mode = _e;
                        break;
                      }
                      if (X.mode = te, $e === b)
                        break e;
                    case te:
                      X.mode = ue;
                    case ue:
                      if (be >= 6 && q >= 258) {
                        pe.next_out = xe, pe.avail_out = q, pe.next_in = I, pe.avail_in = be, X.hold = fe, X.bits = Ce, h(pe, Xe), xe = pe.next_out, Ve = pe.output, q = pe.avail_out, I = pe.next_in, ze = pe.input, be = pe.avail_in, fe = X.hold, Ce = X.bits, X.mode === B && (X.back = -1);
                        break;
                      }
                      for (X.back = 0; it = X.lencode[fe & (1 << X.lenbits) - 1], ot = it >>> 24, nt = it >>> 16 & 255, Ct = it & 65535, !(ot <= Ce); ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      if (nt && !(nt & 240)) {
                        for (ut = ot, zt = nt, Ut = Ct; it = X.lencode[Ut + ((fe & (1 << ut + zt) - 1) >> ut)], ot = it >>> 24, nt = it >>> 16 & 255, Ct = it & 65535, !(ut + ot <= Ce); ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        fe >>>= ut, Ce -= ut, X.back += ut;
                      }
                      if (fe >>>= ot, Ce -= ot, X.back += ot, X.length = Ct, nt === 0) {
                        X.mode = se;
                        break;
                      }
                      if (nt & 32) {
                        X.back = -1, X.mode = B;
                        break;
                      }
                      if (nt & 64) {
                        pe.msg = "invalid literal/length code", X.mode = _e;
                        break;
                      }
                      X.extra = nt & 15, X.mode = de;
                    case de:
                      if (X.extra) {
                        for (qe = X.extra; Ce < qe; ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        X.length += fe & (1 << X.extra) - 1, fe >>>= X.extra, Ce -= X.extra, X.back += X.extra;
                      }
                      X.was = X.length, X.mode = oe;
                    case oe:
                      for (; it = X.distcode[fe & (1 << X.distbits) - 1], ot = it >>> 24, nt = it >>> 16 & 255, Ct = it & 65535, !(ot <= Ce); ) {
                        if (be === 0)
                          break e;
                        be--, fe += ze[I++] << Ce, Ce += 8;
                      }
                      if (!(nt & 240)) {
                        for (ut = ot, zt = nt, Ut = Ct; it = X.distcode[Ut + ((fe & (1 << ut + zt) - 1) >> ut)], ot = it >>> 24, nt = it >>> 16 & 255, Ct = it & 65535, !(ut + ot <= Ce); ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        fe >>>= ut, Ce -= ut, X.back += ut;
                      }
                      if (fe >>>= ot, Ce -= ot, X.back += ot, nt & 64) {
                        pe.msg = "invalid distance code", X.mode = _e;
                        break;
                      }
                      X.offset = Ct, X.extra = nt & 15, X.mode = J;
                    case J:
                      if (X.extra) {
                        for (qe = X.extra; Ce < qe; ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        X.offset += fe & (1 << X.extra) - 1, fe >>>= X.extra, Ce -= X.extra, X.back += X.extra;
                      }
                      if (X.offset > X.dmax) {
                        pe.msg = "invalid distance too far back", X.mode = _e;
                        break;
                      }
                      X.mode = Ee;
                    case Ee:
                      if (q === 0)
                        break e;
                      if (Ye = Xe - q, X.offset > Ye) {
                        if (Ye = X.offset - Ye, Ye > X.whave && X.sane) {
                          pe.msg = "invalid distance too far back", X.mode = _e;
                          break;
                        }
                        Ye > X.wnext ? (Ye -= X.wnext, lt = X.wsize - Ye) : lt = X.wnext - Ye, Ye > X.length && (Ye = X.length), dt = X.window;
                      } else
                        dt = Ve, lt = xe - X.offset, Ye = X.length;
                      Ye > q && (Ye = q), q -= Ye, X.length -= Ye;
                      do
                        Ve[xe++] = dt[lt++];
                      while (--Ye);
                      X.length === 0 && (X.mode = ue);
                      break;
                    case se:
                      if (q === 0)
                        break e;
                      Ve[xe++] = X.length, q--, X.mode = ue;
                      break;
                    case Ae:
                      if (X.wrap) {
                        for (; Ce < 32; ) {
                          if (be === 0)
                            break e;
                          be--, fe |= ze[I++] << Ce, Ce += 8;
                        }
                        if (Xe -= q, pe.total_out += Xe, X.total += Xe, Xe && (pe.adler = X.check = /*UPDATE(state.check, put - _out, _out);*/
                        X.flags ? l(X.check, Ve, Xe, xe - Xe) : a(X.check, Ve, Xe, xe - Xe)), Xe = q, (X.flags ? fe : Ne(fe)) !== X.check) {
                          pe.msg = "incorrect data check", X.mode = _e;
                          break;
                        }
                        fe = 0, Ce = 0;
                      }
                      X.mode = he;
                    case he:
                      if (X.wrap && X.flags) {
                        for (; Ce < 32; ) {
                          if (be === 0)
                            break e;
                          be--, fe += ze[I++] << Ce, Ce += 8;
                        }
                        if (fe !== (X.total & 4294967295)) {
                          pe.msg = "incorrect length check", X.mode = _e;
                          break;
                        }
                        fe = 0, Ce = 0;
                      }
                      X.mode = ne;
                    case ne:
                      mt = f;
                      break e;
                    case _e:
                      mt = p;
                      break e;
                    case Le:
                      return g;
                    case Be:
                    default:
                      return u;
                  }
              return pe.next_out = xe, pe.avail_out = q, pe.next_in = I, pe.avail_in = be, X.hold = fe, X.bits = Ce, (X.wsize || Xe !== pe.avail_out && X.mode < _e && (X.mode < Ae || $e !== y)) && ke(pe, pe.output, pe.next_out, Xe - pe.avail_out), Ze -= pe.avail_in, Xe -= pe.avail_out, pe.total_in += Ze, pe.total_out += Xe, X.total += Xe, X.wrap && Xe && (pe.adler = X.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
              X.flags ? l(X.check, Ve, Xe, pe.next_out - Xe) : a(X.check, Ve, Xe, pe.next_out - Xe)), pe.data_type = X.bits + (X.last ? 64 : 0) + (X.mode === B ? 128 : 0) + (X.mode === te || X.mode === H ? 256 : 0), (Ze === 0 && Xe === 0 || $e === y) && mt === A && (mt = w), mt;
            }
            function me(pe) {
              if (!pe || !pe.state)
                return u;
              var $e = pe.state;
              return $e.window && ($e.window = null), pe.state = null, A;
            }
            function we(pe, $e) {
              var X;
              return !pe || !pe.state || (X = pe.state, !(X.wrap & 2)) ? u : (X.head = $e, $e.done = !1, A);
            }
            function Re(pe, $e) {
              var X = $e.length, ze, Ve, I;
              return !pe || !pe.state || (ze = pe.state, ze.wrap !== 0 && ze.mode !== W) ? u : ze.mode === W && (Ve = 1, Ve = a(Ve, $e, X, 0), Ve !== ze.check) ? p : (I = ke(pe, $e, X, X), I ? (ze.mode = Le, g) : (ze.havedict = 1, A));
            }
            e.inflateReset = Me, e.inflateReset2 = De, e.inflateResetKeep = Te, e.inflateInit = Z, e.inflateInit2 = V, e.inflate = Y, e.inflateEnd = me, e.inflateGetHeader = we, e.inflateSetDictionary = Re, e.inflateInfo = "pako inflate (from Nodeca project)";
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js": (
          /*!*********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/inftrees.js ***!
            \*********************************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ../utils/common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ), a = 15, l = 852, h = 592, c = 0, d = 1, _ = 2, m = [
              /* Length codes 257..285 base */
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              13,
              15,
              17,
              19,
              23,
              27,
              31,
              35,
              43,
              51,
              59,
              67,
              83,
              99,
              115,
              131,
              163,
              195,
              227,
              258,
              0,
              0
            ], y = [
              /* Length codes 257..285 extra */
              16,
              16,
              16,
              16,
              16,
              16,
              16,
              16,
              17,
              17,
              17,
              17,
              18,
              18,
              18,
              18,
              19,
              19,
              19,
              19,
              20,
              20,
              20,
              20,
              21,
              21,
              21,
              21,
              16,
              72,
              78
            ], x = [
              /* Distance codes 0..29 base */
              1,
              2,
              3,
              4,
              5,
              7,
              9,
              13,
              17,
              25,
              33,
              49,
              65,
              97,
              129,
              193,
              257,
              385,
              513,
              769,
              1025,
              1537,
              2049,
              3073,
              4097,
              6145,
              8193,
              12289,
              16385,
              24577,
              0,
              0
            ], b = [
              /* Distance codes 0..29 extra */
              16,
              16,
              16,
              16,
              17,
              17,
              18,
              18,
              19,
              19,
              20,
              20,
              21,
              21,
              22,
              22,
              23,
              23,
              24,
              24,
              25,
              25,
              26,
              26,
              27,
              27,
              28,
              28,
              29,
              29,
              64,
              64
            ];
            n.exports = function(f, s, u, p, g, w, o, v) {
              var M = v.bits, E = 0, $ = 0, k = 0, L = 0, z = 0, O = 0, R = 0, N = 0, W = 0, B = 0, P, G, H, U, j, re = null, ie = 0, te, ue = new r.Buf16(a + 1), de = new r.Buf16(a + 1), oe = null, J = 0, Ee, se, Ae;
              for (E = 0; E <= a; E++)
                ue[E] = 0;
              for ($ = 0; $ < p; $++)
                ue[s[u + $]]++;
              for (z = M, L = a; L >= 1 && ue[L] === 0; L--)
                ;
              if (z > L && (z = L), L === 0)
                return g[w++] = 20971520, g[w++] = 20971520, v.bits = 1, 0;
              for (k = 1; k < L && ue[k] === 0; k++)
                ;
              for (z < k && (z = k), N = 1, E = 1; E <= a; E++)
                if (N <<= 1, N -= ue[E], N < 0)
                  return -1;
              if (N > 0 && (f === c || L !== 1))
                return -1;
              for (de[1] = 0, E = 1; E < a; E++)
                de[E + 1] = de[E] + ue[E];
              for ($ = 0; $ < p; $++)
                s[u + $] !== 0 && (o[de[s[u + $]]++] = $);
              if (f === c ? (re = oe = o, te = 19) : f === d ? (re = m, ie -= 257, oe = y, J -= 257, te = 256) : (re = x, oe = b, te = -1), B = 0, $ = 0, E = k, j = w, O = z, R = 0, H = -1, W = 1 << z, U = W - 1, f === d && W > l || f === _ && W > h)
                return 1;
              for (; ; ) {
                Ee = E - R, o[$] < te ? (se = 0, Ae = o[$]) : o[$] > te ? (se = oe[J + o[$]], Ae = re[ie + o[$]]) : (se = 96, Ae = 0), P = 1 << E - R, G = 1 << O, k = G;
                do
                  G -= P, g[j + (B >> R) + G] = Ee << 24 | se << 16 | Ae | 0;
                while (G !== 0);
                for (P = 1 << E - 1; B & P; )
                  P >>= 1;
                if (P !== 0 ? (B &= P - 1, B += P) : B = 0, $++, --ue[E] === 0) {
                  if (E === L)
                    break;
                  E = s[u + o[$]];
                }
                if (E > z && (B & U) !== H) {
                  for (R === 0 && (R = z), j += k, O = E - R, N = 1 << O; O + R < L && (N -= ue[O + R], !(N <= 0)); )
                    O++, N <<= 1;
                  if (W += 1 << O, f === d && W > l || f === _ && W > h)
                    return 1;
                  H = B & U, g[H] = z << 24 | O << 16 | j - w | 0;
                }
              }
              return B !== 0 && (g[j + B] = E - R << 24 | 4194304 | 0), v.bits = z, 0;
            };
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js": (
          /*!*********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/messages.js ***!
            \*********************************************************************/
          /***/
          (n) => {
            n.exports = {
              2: "need dictionary",
              /* Z_NEED_DICT       2  */
              1: "stream end",
              /* Z_STREAM_END      1  */
              0: "",
              /* Z_OK              0  */
              "-1": "file error",
              /* Z_ERRNO         (-1) */
              "-2": "stream error",
              /* Z_STREAM_ERROR  (-2) */
              "-3": "data error",
              /* Z_DATA_ERROR    (-3) */
              "-4": "insufficient memory",
              /* Z_MEM_ERROR     (-4) */
              "-5": "buffer error",
              /* Z_BUF_ERROR     (-5) */
              "-6": "incompatible version"
              /* Z_VERSION_ERROR (-6) */
            };
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js": (
          /*!******************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/trees.js ***!
            \******************************************************************/
          /***/
          (n, e, t) => {
            var r = t(
              /*! ../utils/common */
              "./node_modules/upng-js/node_modules/pako/lib/utils/common.js"
            ), a = 4, l = 0, h = 1, c = 2;
            function d(Y) {
              for (var me = Y.length; --me >= 0; )
                Y[me] = 0;
            }
            var _ = 0, m = 1, y = 2, x = 3, b = 258, A = 29, f = 256, s = f + 1 + A, u = 30, p = 19, g = 2 * s + 1, w = 15, o = 16, v = 7, M = 256, E = 16, $ = 17, k = 18, L = (
              /* extra bits for each length code */
              [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]
            ), z = (
              /* extra bits for each distance code */
              [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]
            ), O = (
              /* extra bits for each bit length code */
              [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]
            ), R = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], N = 512, W = new Array((s + 2) * 2);
            d(W);
            var B = new Array(u * 2);
            d(B);
            var P = new Array(N);
            d(P);
            var G = new Array(b - x + 1);
            d(G);
            var H = new Array(A);
            d(H);
            var U = new Array(u);
            d(U);
            function j(Y, me, we, Re, pe) {
              this.static_tree = Y, this.extra_bits = me, this.extra_base = we, this.elems = Re, this.max_length = pe, this.has_stree = Y && Y.length;
            }
            var re, ie, te;
            function ue(Y, me) {
              this.dyn_tree = Y, this.max_code = 0, this.stat_desc = me;
            }
            function de(Y) {
              return Y < 256 ? P[Y] : P[256 + (Y >>> 7)];
            }
            function oe(Y, me) {
              Y.pending_buf[Y.pending++] = me & 255, Y.pending_buf[Y.pending++] = me >>> 8 & 255;
            }
            function J(Y, me, we) {
              Y.bi_valid > o - we ? (Y.bi_buf |= me << Y.bi_valid & 65535, oe(Y, Y.bi_buf), Y.bi_buf = me >> o - Y.bi_valid, Y.bi_valid += we - o) : (Y.bi_buf |= me << Y.bi_valid & 65535, Y.bi_valid += we);
            }
            function Ee(Y, me, we) {
              J(
                Y,
                we[me * 2],
                we[me * 2 + 1]
                /*.Len*/
              );
            }
            function se(Y, me) {
              var we = 0;
              do
                we |= Y & 1, Y >>>= 1, we <<= 1;
              while (--me > 0);
              return we >>> 1;
            }
            function Ae(Y) {
              Y.bi_valid === 16 ? (oe(Y, Y.bi_buf), Y.bi_buf = 0, Y.bi_valid = 0) : Y.bi_valid >= 8 && (Y.pending_buf[Y.pending++] = Y.bi_buf & 255, Y.bi_buf >>= 8, Y.bi_valid -= 8);
            }
            function he(Y, me) {
              var we = me.dyn_tree, Re = me.max_code, pe = me.stat_desc.static_tree, $e = me.stat_desc.has_stree, X = me.stat_desc.extra_bits, ze = me.stat_desc.extra_base, Ve = me.stat_desc.max_length, I, xe, be, q, fe, Ce, Ze = 0;
              for (q = 0; q <= w; q++)
                Y.bl_count[q] = 0;
              for (we[Y.heap[Y.heap_max] * 2 + 1] = 0, I = Y.heap_max + 1; I < g; I++)
                xe = Y.heap[I], q = we[we[xe * 2 + 1] * 2 + 1] + 1, q > Ve && (q = Ve, Ze++), we[xe * 2 + 1] = q, !(xe > Re) && (Y.bl_count[q]++, fe = 0, xe >= ze && (fe = X[xe - ze]), Ce = we[xe * 2], Y.opt_len += Ce * (q + fe), $e && (Y.static_len += Ce * (pe[xe * 2 + 1] + fe)));
              if (Ze !== 0) {
                do {
                  for (q = Ve - 1; Y.bl_count[q] === 0; )
                    q--;
                  Y.bl_count[q]--, Y.bl_count[q + 1] += 2, Y.bl_count[Ve]--, Ze -= 2;
                } while (Ze > 0);
                for (q = Ve; q !== 0; q--)
                  for (xe = Y.bl_count[q]; xe !== 0; )
                    be = Y.heap[--I], !(be > Re) && (we[be * 2 + 1] !== q && (Y.opt_len += (q - we[be * 2 + 1]) * we[be * 2], we[be * 2 + 1] = q), xe--);
              }
            }
            function ne(Y, me, we) {
              var Re = new Array(w + 1), pe = 0, $e, X;
              for ($e = 1; $e <= w; $e++)
                Re[$e] = pe = pe + we[$e - 1] << 1;
              for (X = 0; X <= me; X++) {
                var ze = Y[X * 2 + 1];
                ze !== 0 && (Y[X * 2] = se(Re[ze]++, ze));
              }
            }
            function _e() {
              var Y, me, we, Re, pe, $e = new Array(w + 1);
              for (we = 0, Re = 0; Re < A - 1; Re++)
                for (H[Re] = we, Y = 0; Y < 1 << L[Re]; Y++)
                  G[we++] = Re;
              for (G[we - 1] = Re, pe = 0, Re = 0; Re < 16; Re++)
                for (U[Re] = pe, Y = 0; Y < 1 << z[Re]; Y++)
                  P[pe++] = Re;
              for (pe >>= 7; Re < u; Re++)
                for (U[Re] = pe << 7, Y = 0; Y < 1 << z[Re] - 7; Y++)
                  P[256 + pe++] = Re;
              for (me = 0; me <= w; me++)
                $e[me] = 0;
              for (Y = 0; Y <= 143; )
                W[Y * 2 + 1] = 8, Y++, $e[8]++;
              for (; Y <= 255; )
                W[Y * 2 + 1] = 9, Y++, $e[9]++;
              for (; Y <= 279; )
                W[Y * 2 + 1] = 7, Y++, $e[7]++;
              for (; Y <= 287; )
                W[Y * 2 + 1] = 8, Y++, $e[8]++;
              for (ne(W, s + 1, $e), Y = 0; Y < u; Y++)
                B[Y * 2 + 1] = 5, B[Y * 2] = se(Y, 5);
              re = new j(W, L, f + 1, s, w), ie = new j(B, z, 0, u, w), te = new j(new Array(0), O, 0, p, v);
            }
            function Le(Y) {
              var me;
              for (me = 0; me < s; me++)
                Y.dyn_ltree[me * 2] = 0;
              for (me = 0; me < u; me++)
                Y.dyn_dtree[me * 2] = 0;
              for (me = 0; me < p; me++)
                Y.bl_tree[me * 2] = 0;
              Y.dyn_ltree[M * 2] = 1, Y.opt_len = Y.static_len = 0, Y.last_lit = Y.matches = 0;
            }
            function Be(Y) {
              Y.bi_valid > 8 ? oe(Y, Y.bi_buf) : Y.bi_valid > 0 && (Y.pending_buf[Y.pending++] = Y.bi_buf), Y.bi_buf = 0, Y.bi_valid = 0;
            }
            function Ue(Y, me, we, Re) {
              Be(Y), oe(Y, we), oe(Y, ~we), r.arraySet(Y.pending_buf, Y.window, me, we, Y.pending), Y.pending += we;
            }
            function He(Y, me, we, Re) {
              var pe = me * 2, $e = we * 2;
              return Y[pe] < Y[$e] || Y[pe] === Y[$e] && Re[me] <= Re[we];
            }
            function We(Y, me, we) {
              for (var Re = Y.heap[we], pe = we << 1; pe <= Y.heap_len && (pe < Y.heap_len && He(me, Y.heap[pe + 1], Y.heap[pe], Y.depth) && pe++, !He(me, Re, Y.heap[pe], Y.depth)); )
                Y.heap[we] = Y.heap[pe], we = pe, pe <<= 1;
              Y.heap[we] = Re;
            }
            function Ge(Y, me, we) {
              var Re, pe, $e = 0, X, ze;
              if (Y.last_lit !== 0)
                do
                  Re = Y.pending_buf[Y.d_buf + $e * 2] << 8 | Y.pending_buf[Y.d_buf + $e * 2 + 1], pe = Y.pending_buf[Y.l_buf + $e], $e++, Re === 0 ? Ee(Y, pe, me) : (X = G[pe], Ee(Y, X + f + 1, me), ze = L[X], ze !== 0 && (pe -= H[X], J(Y, pe, ze)), Re--, X = de(Re), Ee(Y, X, we), ze = z[X], ze !== 0 && (Re -= U[X], J(Y, Re, ze)));
                while ($e < Y.last_lit);
              Ee(Y, M, me);
            }
            function Ne(Y, me) {
              var we = me.dyn_tree, Re = me.stat_desc.static_tree, pe = me.stat_desc.has_stree, $e = me.stat_desc.elems, X, ze, Ve = -1, I;
              for (Y.heap_len = 0, Y.heap_max = g, X = 0; X < $e; X++)
                we[X * 2] !== 0 ? (Y.heap[++Y.heap_len] = Ve = X, Y.depth[X] = 0) : we[X * 2 + 1] = 0;
              for (; Y.heap_len < 2; )
                I = Y.heap[++Y.heap_len] = Ve < 2 ? ++Ve : 0, we[I * 2] = 1, Y.depth[I] = 0, Y.opt_len--, pe && (Y.static_len -= Re[I * 2 + 1]);
              for (me.max_code = Ve, X = Y.heap_len >> 1; X >= 1; X--)
                We(Y, we, X);
              I = $e;
              do
                X = Y.heap[
                  1
                  /*SMALLEST*/
                ], Y.heap[
                  1
                  /*SMALLEST*/
                ] = Y.heap[Y.heap_len--], We(
                  Y,
                  we,
                  1
                  /*SMALLEST*/
                ), ze = Y.heap[
                  1
                  /*SMALLEST*/
                ], Y.heap[--Y.heap_max] = X, Y.heap[--Y.heap_max] = ze, we[I * 2] = we[X * 2] + we[ze * 2], Y.depth[I] = (Y.depth[X] >= Y.depth[ze] ? Y.depth[X] : Y.depth[ze]) + 1, we[X * 2 + 1] = we[ze * 2 + 1] = I, Y.heap[
                  1
                  /*SMALLEST*/
                ] = I++, We(
                  Y,
                  we,
                  1
                  /*SMALLEST*/
                );
              while (Y.heap_len >= 2);
              Y.heap[--Y.heap_max] = Y.heap[
                1
                /*SMALLEST*/
              ], he(Y, me), ne(we, Ve, Y.bl_count);
            }
            function Pe(Y, me, we) {
              var Re, pe = -1, $e, X = me[0 * 2 + 1], ze = 0, Ve = 7, I = 4;
              for (X === 0 && (Ve = 138, I = 3), me[(we + 1) * 2 + 1] = 65535, Re = 0; Re <= we; Re++)
                $e = X, X = me[(Re + 1) * 2 + 1], !(++ze < Ve && $e === X) && (ze < I ? Y.bl_tree[$e * 2] += ze : $e !== 0 ? ($e !== pe && Y.bl_tree[$e * 2]++, Y.bl_tree[E * 2]++) : ze <= 10 ? Y.bl_tree[$ * 2]++ : Y.bl_tree[k * 2]++, ze = 0, pe = $e, X === 0 ? (Ve = 138, I = 3) : $e === X ? (Ve = 6, I = 3) : (Ve = 7, I = 4));
            }
            function Te(Y, me, we) {
              var Re, pe = -1, $e, X = me[0 * 2 + 1], ze = 0, Ve = 7, I = 4;
              for (X === 0 && (Ve = 138, I = 3), Re = 0; Re <= we; Re++)
                if ($e = X, X = me[(Re + 1) * 2 + 1], !(++ze < Ve && $e === X)) {
                  if (ze < I)
                    do
                      Ee(Y, $e, Y.bl_tree);
                    while (--ze !== 0);
                  else $e !== 0 ? ($e !== pe && (Ee(Y, $e, Y.bl_tree), ze--), Ee(Y, E, Y.bl_tree), J(Y, ze - 3, 2)) : ze <= 10 ? (Ee(Y, $, Y.bl_tree), J(Y, ze - 3, 3)) : (Ee(Y, k, Y.bl_tree), J(Y, ze - 11, 7));
                  ze = 0, pe = $e, X === 0 ? (Ve = 138, I = 3) : $e === X ? (Ve = 6, I = 3) : (Ve = 7, I = 4);
                }
            }
            function Me(Y) {
              var me;
              for (Pe(Y, Y.dyn_ltree, Y.l_desc.max_code), Pe(Y, Y.dyn_dtree, Y.d_desc.max_code), Ne(Y, Y.bl_desc), me = p - 1; me >= 3 && Y.bl_tree[R[me] * 2 + 1] === 0; me--)
                ;
              return Y.opt_len += 3 * (me + 1) + 5 + 5 + 4, me;
            }
            function De(Y, me, we, Re) {
              var pe;
              for (J(Y, me - 257, 5), J(Y, we - 1, 5), J(Y, Re - 4, 4), pe = 0; pe < Re; pe++)
                J(Y, Y.bl_tree[R[pe] * 2 + 1], 3);
              Te(Y, Y.dyn_ltree, me - 1), Te(Y, Y.dyn_dtree, we - 1);
            }
            function V(Y) {
              var me = 4093624447, we;
              for (we = 0; we <= 31; we++, me >>>= 1)
                if (me & 1 && Y.dyn_ltree[we * 2] !== 0)
                  return l;
              if (Y.dyn_ltree[18] !== 0 || Y.dyn_ltree[20] !== 0 || Y.dyn_ltree[26] !== 0)
                return h;
              for (we = 32; we < f; we++)
                if (Y.dyn_ltree[we * 2] !== 0)
                  return h;
              return l;
            }
            var Z = !1;
            function ee(Y) {
              Z || (_e(), Z = !0), Y.l_desc = new ue(Y.dyn_ltree, re), Y.d_desc = new ue(Y.dyn_dtree, ie), Y.bl_desc = new ue(Y.bl_tree, te), Y.bi_buf = 0, Y.bi_valid = 0, Le(Y);
            }
            function ye(Y, me, we, Re) {
              J(Y, (_ << 1) + (Re ? 1 : 0), 3), Ue(Y, me, we);
            }
            function ce(Y) {
              J(Y, m << 1, 3), Ee(Y, M, W), Ae(Y);
            }
            function Ie(Y, me, we, Re) {
              var pe, $e, X = 0;
              Y.level > 0 ? (Y.strm.data_type === c && (Y.strm.data_type = V(Y)), Ne(Y, Y.l_desc), Ne(Y, Y.d_desc), X = Me(Y), pe = Y.opt_len + 3 + 7 >>> 3, $e = Y.static_len + 3 + 7 >>> 3, $e <= pe && (pe = $e)) : pe = $e = we + 5, we + 4 <= pe && me !== -1 ? ye(Y, me, we, Re) : Y.strategy === a || $e === pe ? (J(Y, (m << 1) + (Re ? 1 : 0), 3), Ge(Y, W, B)) : (J(Y, (y << 1) + (Re ? 1 : 0), 3), De(Y, Y.l_desc.max_code + 1, Y.d_desc.max_code + 1, X + 1), Ge(Y, Y.dyn_ltree, Y.dyn_dtree)), Le(Y), Re && Be(Y);
            }
            function ke(Y, me, we) {
              return Y.pending_buf[Y.d_buf + Y.last_lit * 2] = me >>> 8 & 255, Y.pending_buf[Y.d_buf + Y.last_lit * 2 + 1] = me & 255, Y.pending_buf[Y.l_buf + Y.last_lit] = we & 255, Y.last_lit++, me === 0 ? Y.dyn_ltree[we * 2]++ : (Y.matches++, me--, Y.dyn_ltree[(G[we] + f + 1) * 2]++, Y.dyn_dtree[de(me) * 2]++), Y.last_lit === Y.lit_bufsize - 1;
            }
            e._tr_init = ee, e._tr_stored_block = ye, e._tr_flush_block = Ie, e._tr_tally = ke, e._tr_align = ce;
          }
        ),
        /***/
        "./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js": (
          /*!********************************************************************!*\
            !*** ./node_modules/upng-js/node_modules/pako/lib/zlib/zstream.js ***!
            \********************************************************************/
          /***/
          (n) => {
            function e() {
              this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
            }
            n.exports = e;
          }
        ),
        /***/
        "./src/SurfaceWorker.js": (
          /*!******************************!*\
            !*** ./src/SurfaceWorker.js ***!
            \******************************/
          /***/
          () => {
            $3Dmol.workerString = (function() {
              self.onmessage = function(n) {
                var e = n.data, t = e.type;
                if (t < 0)
                  self.atomData = e.atoms, self.volume = e.volume, self.ps = new ProteinSurface();
                else {
                  var r = self.ps;
                  r.initparm(e.expandedExtent, t != 1, self.volume), r.fillvoxels(self.atomData, e.extendedAtoms), r.buildboundary(), (t === 4 || t === 2) && (r.fastdistancemap(), r.boundingatom(!1), r.fillvoxelswaals(self.atomData, e.extendedAtoms)), r.marchingcube(t);
                  var a = r.getFacesAndVertices(e.atomsToShow);
                  self.postMessage(a);
                }
              };
            }).toString().replace(/(^.*?\{|\}$)/g, ""), $3Dmol.workerString += `;
function _classCallCheck() {};`, $3Dmol.workerString += `;
` + $3Dmol.Vector3.toString(), $3Dmol.workerString += `;
` + $3Dmol.MarchingCubeInitializer.toString() + `;

`, $3Dmol.workerString += `;
` + $3Dmol.PointGrid.toString() + `;
`, $3Dmol.workerString += `;
var ProteinSurface = ` + $3Dmol.ProteinSurface.toString() + `;
`, $3Dmol.SurfaceWorker = window.URL ? window.URL.createObjectURL(new Blob([$3Dmol.workerString], { type: "text/javascript" })) : void 0;
          }
        ),
        /***/
        "./src/exporter.js": (
          /*!*************************!*\
            !*** ./src/exporter.js ***!
            \*************************/
          /***/
          (n) => {
            typeof n.exports == "object" && (n.exports = window.$3Dmol);
          }
        ),
        /***/
        "./src/vendor/mmtf.js": (
          /*!****************************!*\
            !*** ./src/vendor/mmtf.js ***!
            \****************************/
          /***/
          function(n, e) {
            (function(t, r) {
              r(e);
            })(this, function(t) {
              function r(V, Z, ee) {
                for (var ye = (V.byteLength, 0), ce = ee.length; ce > ye; ye++) {
                  var Ie = ee.charCodeAt(ye);
                  if (128 > Ie) V.setUint8(Z++, Ie >>> 0 & 127 | 0);
                  else if (2048 > Ie) V.setUint8(Z++, Ie >>> 6 & 31 | 192), V.setUint8(Z++, Ie >>> 0 & 63 | 128);
                  else if (65536 > Ie) V.setUint8(Z++, Ie >>> 12 & 15 | 224), V.setUint8(Z++, Ie >>> 6 & 63 | 128), V.setUint8(Z++, Ie >>> 0 & 63 | 128);
                  else {
                    if (!(1114112 > Ie)) throw new Error("bad codepoint " + Ie);
                    V.setUint8(Z++, Ie >>> 18 & 7 | 240), V.setUint8(Z++, Ie >>> 12 & 63 | 128), V.setUint8(Z++, Ie >>> 6 & 63 | 128), V.setUint8(Z++, Ie >>> 0 & 63 | 128);
                  }
                }
              }
              function a(V) {
                for (var Z = 0, ee = 0, ye = V.length; ye > ee; ee++) {
                  var ce = V.charCodeAt(ee);
                  if (128 > ce) Z += 1;
                  else if (2048 > ce) Z += 2;
                  else if (65536 > ce) Z += 3;
                  else {
                    if (!(1114112 > ce)) throw new Error("bad codepoint " + ce);
                    Z += 4;
                  }
                }
                return Z;
              }
              function l(V, Z, ee) {
                var ye = typeof V;
                if (ye === "string") {
                  var ce = a(V);
                  if (32 > ce) return Z.setUint8(ee, 160 | ce), r(Z, ee + 1, V), 1 + ce;
                  if (256 > ce) return Z.setUint8(ee, 217), Z.setUint8(ee + 1, ce), r(Z, ee + 2, V), 2 + ce;
                  if (65536 > ce) return Z.setUint8(ee, 218), Z.setUint16(ee + 1, ce), r(Z, ee + 3, V), 3 + ce;
                  if (4294967296 > ce) return Z.setUint8(ee, 219), Z.setUint32(ee + 1, ce), r(Z, ee + 5, V), 5 + ce;
                }
                if (V instanceof Uint8Array) {
                  var ce = V.byteLength, Ie = new Uint8Array(Z.buffer);
                  if (256 > ce) return Z.setUint8(ee, 196), Z.setUint8(ee + 1, ce), Ie.set(V, ee + 2), 2 + ce;
                  if (65536 > ce) return Z.setUint8(ee, 197), Z.setUint16(ee + 1, ce), Ie.set(V, ee + 3), 3 + ce;
                  if (4294967296 > ce) return Z.setUint8(ee, 198), Z.setUint32(ee + 1, ce), Ie.set(V, ee + 5), 5 + ce;
                }
                if (ye === "number") {
                  if (!isFinite(V)) throw new Error("Number not finite: " + V);
                  if (Math.floor(V) !== V) return Z.setUint8(ee, 203), Z.setFloat64(ee + 1, V), 9;
                  if (V >= 0) {
                    if (128 > V) return Z.setUint8(ee, V), 1;
                    if (256 > V) return Z.setUint8(ee, 204), Z.setUint8(ee + 1, V), 2;
                    if (65536 > V) return Z.setUint8(ee, 205), Z.setUint16(ee + 1, V), 3;
                    if (4294967296 > V) return Z.setUint8(ee, 206), Z.setUint32(ee + 1, V), 5;
                    throw new Error("Number too big 0x" + V.toString(16));
                  }
                  if (V >= -32) return Z.setInt8(ee, V), 1;
                  if (V >= -128) return Z.setUint8(ee, 208), Z.setInt8(ee + 1, V), 2;
                  if (V >= -32768) return Z.setUint8(ee, 209), Z.setInt16(ee + 1, V), 3;
                  if (V >= -2147483648) return Z.setUint8(ee, 210), Z.setInt32(ee + 1, V), 5;
                  throw new Error("Number too small -0x" + (-V).toString(16).substr(1));
                }
                if (V === null) return Z.setUint8(ee, 192), 1;
                if (ye === "boolean") return Z.setUint8(ee, V ? 195 : 194), 1;
                if (ye === "object") {
                  var ce, me = 0, ke = Array.isArray(V);
                  if (ke) ce = V.length;
                  else {
                    var Y = Object.keys(V);
                    ce = Y.length;
                  }
                  var me;
                  if (16 > ce ? (Z.setUint8(ee, ce | (ke ? 144 : 128)), me = 1) : 65536 > ce ? (Z.setUint8(ee, ke ? 220 : 222), Z.setUint16(ee + 1, ce), me = 3) : 4294967296 > ce && (Z.setUint8(ee, ke ? 221 : 223), Z.setUint32(ee + 1, ce), me = 5), ke) for (var we = 0; ce > we; we++) me += l(V[we], Z, ee + me);
                  else for (var we = 0; ce > we; we++) {
                    var Re = Y[we];
                    me += l(Re, Z, ee + me), me += l(V[Re], Z, ee + me);
                  }
                  return me;
                }
                throw new Error("Unknown type " + ye);
              }
              function h(V) {
                var Z = typeof V;
                if (Z === "string") {
                  var ee = a(V);
                  if (32 > ee) return 1 + ee;
                  if (256 > ee) return 2 + ee;
                  if (65536 > ee) return 3 + ee;
                  if (4294967296 > ee) return 5 + ee;
                }
                if (V instanceof Uint8Array) {
                  var ee = V.byteLength;
                  if (256 > ee) return 2 + ee;
                  if (65536 > ee) return 3 + ee;
                  if (4294967296 > ee) return 5 + ee;
                }
                if (Z === "number") {
                  if (Math.floor(V) !== V) return 9;
                  if (V >= 0) {
                    if (128 > V) return 1;
                    if (256 > V) return 2;
                    if (65536 > V) return 3;
                    if (4294967296 > V) return 5;
                    throw new Error("Number too big 0x" + V.toString(16));
                  }
                  if (V >= -32) return 1;
                  if (V >= -128) return 2;
                  if (V >= -32768) return 3;
                  if (V >= -2147483648) return 5;
                  throw new Error("Number too small -0x" + V.toString(16).substr(1));
                }
                if (Z === "boolean" || V === null) return 1;
                if (Z === "object") {
                  var ee, ye = 0;
                  if (Array.isArray(V)) {
                    ee = V.length;
                    for (var ce = 0; ee > ce; ce++) ye += h(V[ce]);
                  } else {
                    var Ie = Object.keys(V);
                    ee = Ie.length;
                    for (var ce = 0; ee > ce; ce++) {
                      var ke = Ie[ce];
                      ye += h(ke) + h(V[ke]);
                    }
                  }
                  if (16 > ee) return 1 + ye;
                  if (65536 > ee) return 3 + ye;
                  if (4294967296 > ee) return 5 + ye;
                  throw new Error("Array or object too long 0x" + ee.toString(16));
                }
                throw new Error("Unknown type " + Z);
              }
              function c(V) {
                var Z = new ArrayBuffer(h(V)), ee = new DataView(Z);
                return l(V, ee, 0), new Uint8Array(Z);
              }
              function d(V, Z, ee) {
                return Z ? new V(Z.buffer, Z.byteOffset, Z.byteLength / (ee || 1)) : void 0;
              }
              function _(V) {
                return d(DataView, V);
              }
              function m(V) {
                return d(Uint8Array, V);
              }
              function y(V) {
                return d(Int8Array, V);
              }
              function x(V) {
                return d(Int32Array, V, 4);
              }
              function b(V) {
                return d(Float32Array, V, 4);
              }
              function A(V, Z) {
                var ee = V.length / 2;
                Z || (Z = new Int16Array(ee));
                for (var ye = 0, ce = 0; ee > ye; ++ye, ce += 2) Z[ye] = V[ce] << 8 ^ V[ce + 1] << 0;
                return Z;
              }
              function f(V, Z) {
                var ee = V.length;
                Z || (Z = new Uint8Array(2 * ee));
                for (var ye = _(Z), ce = 0; ee > ce; ++ce) ye.setInt16(2 * ce, V[ce]);
                return m(Z);
              }
              function s(V, Z) {
                var ee = V.length / 4;
                Z || (Z = new Int32Array(ee));
                for (var ye = 0, ce = 0; ee > ye; ++ye, ce += 4) Z[ye] = V[ce] << 24 ^ V[ce + 1] << 16 ^ V[ce + 2] << 8 ^ V[ce + 3] << 0;
                return Z;
              }
              function u(V, Z) {
                var ee = V.length;
                Z || (Z = new Uint8Array(4 * ee));
                for (var ye = _(Z), ce = 0; ee > ce; ++ce) ye.setInt32(4 * ce, V[ce]);
                return m(Z);
              }
              function p(V, Z) {
                var ee = V.length;
                Z || (Z = new Float32Array(ee / 4));
                for (var ye = _(Z), ce = _(V), Ie = 0, ke = 0, Y = ee / 4; Y > Ie; ++Ie, ke += 4) ye.setFloat32(ke, ce.getFloat32(ke), !0);
                return Z;
              }
              function g(V, Z, ee) {
                var ye = V.length, ce = 1 / Z;
                ee || (ee = new Float32Array(ye));
                for (var Ie = 0; ye > Ie; ++Ie) ee[Ie] = V[Ie] * ce;
                return ee;
              }
              function w(V, Z, ee) {
                var ye = V.length;
                ee || (ee = new Int32Array(ye));
                for (var ce = 0; ye > ce; ++ce) ee[ce] = Math.round(V[ce] * Z);
                return ee;
              }
              function o(V, Z) {
                var ee, ye;
                if (!Z) {
                  var ce = 0;
                  for (ee = 0, ye = V.length; ye > ee; ee += 2) ce += V[ee + 1];
                  Z = new V.constructor(ce);
                }
                var Ie = 0;
                for (ee = 0, ye = V.length; ye > ee; ee += 2) for (var ke = V[ee], Y = V[ee + 1], me = 0; Y > me; ++me) Z[Ie] = ke, ++Ie;
                return Z;
              }
              function v(V) {
                if (V.length === 0) return new Int32Array();
                var Z, ee, ye = 2;
                for (Z = 1, ee = V.length; ee > Z; ++Z) V[Z - 1] !== V[Z] && (ye += 2);
                var ce = new Int32Array(ye), Ie = 0, ke = 1;
                for (Z = 1, ee = V.length; ee > Z; ++Z) V[Z - 1] !== V[Z] ? (ce[Ie] = V[Z - 1], ce[Ie + 1] = ke, ke = 1, Ie += 2) : ++ke;
                return ce[Ie] = V[V.length - 1], ce[Ie + 1] = ke, ce;
              }
              function M(V, Z) {
                var ee = V.length;
                Z || (Z = new V.constructor(ee)), ee && (Z[0] = V[0]);
                for (var ye = 1; ee > ye; ++ye) Z[ye] = V[ye] + Z[ye - 1];
                return Z;
              }
              function E(V, Z) {
                var ee = V.length;
                Z || (Z = new V.constructor(ee)), Z[0] = V[0];
                for (var ye = 1; ee > ye; ++ye) Z[ye] = V[ye] - V[ye - 1];
                return Z;
              }
              function $(V, Z) {
                var ee, ye, ce = V instanceof Int8Array ? 127 : 32767, Ie = -ce - 1, ke = V.length;
                if (!Z) {
                  var Y = 0;
                  for (ee = 0; ke > ee; ++ee) V[ee] < ce && V[ee] > Ie && ++Y;
                  Z = new Int32Array(Y);
                }
                for (ee = 0, ye = 0; ke > ee; ) {
                  for (var me = 0; V[ee] === ce || V[ee] === Ie; ) me += V[ee], ++ee;
                  me += V[ee], ++ee, Z[ye] = me, ++ye;
                }
                return Z;
              }
              function k(V, Z) {
                var ee, ye = 32767, ce = -ye - 1, Ie = V.length, ke = 0;
                for (ee = 0; Ie > ee; ++ee) {
                  var Y = V[ee];
                  Y === 0 ? ++ke : Y > 0 ? (ke += Math.ceil(Y / ye), Y % ye === 0 && (ke += 1)) : (ke += Math.ceil(Y / ce), Y % ce === 0 && (ke += 1));
                }
                var me = new Int16Array(ke), we = 0;
                for (ee = 0; Ie > ee; ++ee) {
                  var Y = V[ee];
                  if (Y >= 0) for (; Y >= ye; ) me[we] = ye, ++we, Y -= ye;
                  else for (; ce >= Y; ) me[we] = ce, ++we, Y -= ce;
                  me[we] = Y, ++we;
                }
                return me;
              }
              function L(V, Z) {
                return M(o(V), Z);
              }
              function z(V) {
                return v(E(V));
              }
              function O(V, Z, ee) {
                return g(o(V, x(ee)), Z, ee);
              }
              function R(V, Z) {
                return v(w(V, Z));
              }
              function N(V, Z, ee) {
                return g(M(V, x(ee)), Z, ee);
              }
              function W(V, Z, ee) {
                return E(w(V, Z), ee);
              }
              function B(V, Z, ee) {
                return g($(V, x(ee)), Z, ee);
              }
              function P(V, Z, ee) {
                var ye = $(V, x(ee));
                return N(ye, Z, b(ye));
              }
              function G(V, Z, ee) {
                return k(W(V, Z));
              }
              function H(Ie) {
                var Z = _(Ie), ee = Z.getInt32(0), ye = Z.getInt32(4), ce = Ie.subarray(8, 12), Ie = Ie.subarray(12);
                return [ee, Ie, ye, ce];
              }
              function U(V, Z, ee, ye) {
                var ce = new ArrayBuffer(12 + ye.byteLength), Ie = new Uint8Array(ce), ke = new DataView(ce);
                return ke.setInt32(0, V), ke.setInt32(4, Z), ee && Ie.set(ee, 8), Ie.set(ye, 12), Ie;
              }
              function j(V) {
                var Z = V.length, ee = m(V);
                return U(2, Z, void 0, ee);
              }
              function re(V) {
                var Z = V.length, ee = u(V);
                return U(4, Z, void 0, ee);
              }
              function ie(V, Z) {
                var ee = V.length / Z, ye = u([Z]), ce = m(V);
                return U(5, ee, ye, ce);
              }
              function te(V) {
                var Z = V.length, ee = u(v(V));
                return U(6, Z, void 0, ee);
              }
              function ue(V) {
                var Z = V.length, ee = u(z(V));
                return U(8, Z, void 0, ee);
              }
              function de(V, Z) {
                var ee = V.length, ye = u([Z]), ce = u(R(V, Z));
                return U(9, ee, ye, ce);
              }
              function oe(V, Z) {
                var ee = V.length, ye = u([Z]), ce = f(G(V, Z));
                return U(10, ee, ye, ce);
              }
              function J(V) {
                var Z = {};
                return We.forEach(function(ee) {
                  V[ee] !== void 0 && (Z[ee] = V[ee]);
                }), V.bondAtomList && (Z.bondAtomList = re(V.bondAtomList)), V.bondOrderList && (Z.bondOrderList = j(V.bondOrderList)), Z.xCoordList = oe(V.xCoordList, 1e3), Z.yCoordList = oe(V.yCoordList, 1e3), Z.zCoordList = oe(V.zCoordList, 1e3), V.bFactorList && (Z.bFactorList = oe(V.bFactorList, 100)), V.atomIdList && (Z.atomIdList = ue(V.atomIdList)), V.altLocList && (Z.altLocList = te(V.altLocList)), V.occupancyList && (Z.occupancyList = de(V.occupancyList, 100)), Z.groupIdList = ue(V.groupIdList), Z.groupTypeList = re(V.groupTypeList), V.secStructList && (Z.secStructList = j(V.secStructList)), V.insCodeList && (Z.insCodeList = te(V.insCodeList)), V.sequenceIndexList && (Z.sequenceIndexList = ue(V.sequenceIndexList)), Z.chainIdList = ie(V.chainIdList, 4), V.chainNameList && (Z.chainNameList = ie(V.chainNameList, 4)), Z;
              }
              function Ee(V) {
                function Z(me) {
                  for (var we = {}, Re = 0; me > Re; Re++) {
                    var pe = Ie();
                    we[pe] = Ie();
                  }
                  return we;
                }
                function ee(me) {
                  var we = V.subarray(ke, ke + me);
                  return ke += me, we;
                }
                function ye(me) {
                  var we = V.subarray(ke, ke + me);
                  ke += me;
                  var Re = 65535;
                  if (me > Re) {
                    for (var pe = [], $e = 0; $e < we.length; $e += Re) pe.push(String.fromCharCode.apply(null, we.subarray($e, $e + Re)));
                    return pe.join("");
                  }
                  return String.fromCharCode.apply(null, we);
                }
                function ce(me) {
                  for (var we = new Array(me), Re = 0; me > Re; Re++) we[Re] = Ie();
                  return we;
                }
                function Ie() {
                  var me, we, Re = V[ke];
                  if (!(128 & Re)) return ke++, Re;
                  if ((240 & Re) === 128) return we = 15 & Re, ke++, Z(we);
                  if ((240 & Re) === 144) return we = 15 & Re, ke++, ce(we);
                  if ((224 & Re) === 160) return we = 31 & Re, ke++, ye(we);
                  if ((224 & Re) === 224) return me = Y.getInt8(ke), ke++, me;
                  switch (Re) {
                    case 192:
                      return ke++, null;
                    case 194:
                      return ke++, !1;
                    case 195:
                      return ke++, !0;
                    case 196:
                      return we = Y.getUint8(ke + 1), ke += 2, ee(we);
                    case 197:
                      return we = Y.getUint16(ke + 1), ke += 3, ee(we);
                    case 198:
                      return we = Y.getUint32(ke + 1), ke += 5, ee(we);
                    case 202:
                      return me = Y.getFloat32(ke + 1), ke += 5, me;
                    case 203:
                      return me = Y.getFloat64(ke + 1), ke += 9, me;
                    case 204:
                      return me = V[ke + 1], ke += 2, me;
                    case 205:
                      return me = Y.getUint16(ke + 1), ke += 3, me;
                    case 206:
                      return me = Y.getUint32(ke + 1), ke += 5, me;
                    case 208:
                      return me = Y.getInt8(ke + 1), ke += 2, me;
                    case 209:
                      return me = Y.getInt16(ke + 1), ke += 3, me;
                    case 210:
                      return me = Y.getInt32(ke + 1), ke += 5, me;
                    case 217:
                      return we = Y.getUint8(ke + 1), ke += 2, ye(we);
                    case 218:
                      return we = Y.getUint16(ke + 1), ke += 3, ye(we);
                    case 219:
                      return we = Y.getUint32(ke + 1), ke += 5, ye(we);
                    case 220:
                      return we = Y.getUint16(ke + 1), ke += 3, ce(we);
                    case 221:
                      return we = Y.getUint32(ke + 1), ke += 5, ce(we);
                    case 222:
                      return we = Y.getUint16(ke + 1), ke += 3, Z(we);
                    case 223:
                      return we = Y.getUint32(ke + 1), ke += 5, Z(we);
                  }
                  throw new Error("Unknown type 0x" + Re.toString(16));
                }
                var ke = 0, Y = new DataView(V.buffer);
                return Ie();
              }
              function se(V, Z, ee, ye) {
                switch (V) {
                  case 1:
                    return p(Z);
                  case 2:
                    return y(Z);
                  case 3:
                    return A(Z);
                  case 4:
                    return s(Z);
                  case 5:
                    return m(Z);
                  case 6:
                    return o(s(Z), new Uint8Array(ee));
                  case 7:
                    return o(s(Z));
                  case 8:
                    return L(s(Z));
                  case 9:
                    return O(s(Z), s(ye)[0]);
                  case 10:
                    return P(A(Z), s(ye)[0]);
                  case 11:
                    return g(A(Z), s(ye)[0]);
                  case 12:
                    return B(A(Z), s(ye)[0]);
                  case 13:
                    return B(y(Z), s(ye)[0]);
                  case 14:
                    return $(A(Z));
                  case 15:
                    return $(y(Z));
                }
              }
              function Ae(V, Z) {
                Z = Z || {};
                var ee = Z.ignoreFields, ye = {};
                return Ne.forEach(function(ce) {
                  var Ie = ee ? ee.indexOf(ce) !== -1 : !1, ke = V[ce];
                  Ie || ke === void 0 || (ke instanceof Uint8Array ? ye[ce] = se.apply(null, H(ke)) : ye[ce] = ke);
                }), ye;
              }
              function he(V) {
                return String.fromCharCode.apply(null, V).replace(/\0/g, "");
              }
              function ne(V, Z, ee) {
                ee = ee || {};
                var ye, ce, Ie, ke, Y, me, we = ee.firstModelOnly, Re = Z.onModel, pe = Z.onChain, $e = Z.onGroup, X = Z.onAtom, ze = Z.onBond, Ve = 0, I = 0, xe = 0, be = 0, q = 0, fe = -1, Ce = V.chainNameList, Ze = V.secStructList, Xe = V.insCodeList, Ye = V.sequenceIndexList, lt = V.atomIdList, dt = V.bFactorList, it = V.altLocList, ot = V.occupancyList, nt = V.bondAtomList, Ct = V.bondOrderList;
                for (ye = 0, ce = V.chainsPerModel.length; ce > ye && !(we && Ve > 0); ++ye) {
                  var ut = V.chainsPerModel[Ve];
                  for (Re && Re({ chainCount: ut, modelIndex: Ve }), Ie = 0; ut > Ie; ++Ie) {
                    var zt = V.groupsPerChain[I];
                    if (pe) {
                      var Ut = he(V.chainIdList.subarray(4 * I, 4 * I + 4)), wt = null;
                      Ce && (wt = he(Ce.subarray(4 * I, 4 * I + 4))), pe({ groupCount: zt, chainIndex: I, modelIndex: Ve, chainId: Ut, chainName: wt });
                    }
                    for (ke = 0; zt > ke; ++ke) {
                      var mt = V.groupList[V.groupTypeList[xe]], vt = mt.atomNameList.length;
                      if ($e) {
                        var Rt = null;
                        Ze && (Rt = Ze[xe]);
                        var qe = null;
                        V.insCodeList && (qe = String.fromCharCode(Xe[xe]));
                        var ge = null;
                        Ye && (ge = Ye[xe]), $e({ atomCount: vt, groupIndex: xe, chainIndex: I, modelIndex: Ve, groupId: V.groupIdList[xe], groupType: V.groupTypeList[xe], groupName: mt.groupName, singleLetterCode: mt.singleLetterCode, chemCompType: mt.chemCompType, secStruct: Rt, insCode: qe, sequenceIndex: ge });
                      }
                      for (Y = 0; vt > Y; ++Y) {
                        if (X) {
                          var Ke = null;
                          lt && (Ke = lt[be]);
                          var Qe = null;
                          dt && (Qe = dt[be]);
                          var _t = null;
                          it && (_t = String.fromCharCode(it[be]));
                          var Mt = null;
                          ot && (Mt = ot[be]), X({ atomIndex: be, groupIndex: xe, chainIndex: I, modelIndex: Ve, atomId: Ke, element: mt.elementList[Y], atomName: mt.atomNameList[Y], formalCharge: mt.formalChargeList[Y], xCoord: V.xCoordList[be], yCoord: V.yCoordList[be], zCoord: V.zCoordList[be], bFactor: Qe, altLoc: _t, occupancy: Mt });
                        }
                        be += 1;
                      }
                      if (ze) {
                        var St = mt.bondAtomList;
                        for (Y = 0, me = mt.bondOrderList.length; me > Y; ++Y) ze({ atomIndex1: be - vt + St[2 * Y], atomIndex2: be - vt + St[2 * Y + 1], bondOrder: mt.bondOrderList[Y] });
                      }
                      xe += 1;
                    }
                    I += 1;
                  }
                  if (q = fe + 1, fe = be - 1, ze && nt) for (Y = 0, me = nt.length; me > Y; Y += 2) {
                    var It = nt[Y], Pt = nt[Y + 1];
                    (It >= q && fe >= It || Pt >= q && fe >= Pt) && ze({ atomIndex1: It, atomIndex2: Pt, bondOrder: Ct ? Ct[Y / 2] : null });
                  }
                  Ve += 1;
                }
              }
              function _e(V) {
                return c(J(V));
              }
              function Le(V, Z) {
                V instanceof ArrayBuffer && (V = new Uint8Array(V));
                var ee;
                return ee = V instanceof Uint8Array ? Ee(V) : V, Ae(ee, Z);
              }
              function Be(V, Z, ee, ye) {
                function ce() {
                  try {
                    var ke = Le(Ie.response);
                    ee(ke);
                  } catch (Y) {
                    ye(Y);
                  }
                }
                var Ie = new XMLHttpRequest();
                Ie.addEventListener("load", ce, !0), Ie.addEventListener("error", ye, !0), Ie.responseType = "arraybuffer", Ie.open("GET", Z + V.toUpperCase()), Ie.send();
              }
              function Ue(V, Z, ee) {
                Be(V, Me, Z, ee);
              }
              function He(V, Z, ee) {
                Be(V, De, Z, ee);
              }
              var We = ["mmtfVersion", "mmtfProducer", "unitCell", "spaceGroup", "structureId", "title", "depositionDate", "releaseDate", "experimentalMethods", "resolution", "rFree", "rWork", "bioAssemblyList", "ncsOperatorList", "entityList", "groupList", "numBonds", "numAtoms", "numGroups", "numChains", "numModels", "groupsPerChain", "chainsPerModel"], Ge = ["xCoordList", "yCoordList", "zCoordList", "groupIdList", "groupTypeList", "chainIdList", "bFactorList", "atomIdList", "altLocList", "occupancyList", "secStructList", "insCodeList", "sequenceIndexList", "chainNameList", "bondAtomList", "bondOrderList"], Ne = We.concat(Ge), Pe = "v1.0.1", Te = "//mmtf.rcsb.org/v1.0/", Me = Te + "full/", De = Te + "reduced/";
              t.encode = _e, t.decode = Le, t.traverse = ne, t.fetch = Ue, t.fetchReduced = He, t.version = Pe, t.fetchUrl = Me, t.fetchReducedUrl = De, t.encodeMsgpack = c, t.encodeMmtf = J, t.decodeMsgpack = Ee, t.decodeMmtf = Ae;
            });
          }
        ),
        /***/
        "./node_modules/pako/dist/pako.esm.mjs": (
          /*!*********************************************!*\
            !*** ./node_modules/pako/dist/pako.esm.mjs ***!
            \*********************************************/
          /***/
          (n, e, t) => {
            t.r(e), t.d(e, {
              /* harmony export */
              Deflate: () => (
                /* binding */
                xn
              ),
              /* harmony export */
              Inflate: () => (
                /* binding */
                An
              ),
              /* harmony export */
              constants: () => (
                /* binding */
                $n
              ),
              /* harmony export */
              default: () => (
                /* binding */
                ls
              ),
              /* harmony export */
              deflate: () => (
                /* binding */
                wn
              ),
              /* harmony export */
              deflateRaw: () => (
                /* binding */
                En
              ),
              /* harmony export */
              gzip: () => (
                /* binding */
                Sn
              ),
              /* harmony export */
              inflate: () => (
                /* binding */
                Mn
              ),
              /* harmony export */
              inflateRaw: () => (
                /* binding */
                Dn
              ),
              /* harmony export */
              ungzip: () => (
                /* binding */
                Cn
              )
              /* harmony export */
            });
            /*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */
            const r = 4, a = 0, l = 1, h = 2;
            function c(C) {
              let K = C.length;
              for (; --K >= 0; )
                C[K] = 0;
            }
            const d = 0, _ = 1, m = 2, y = 3, x = 258, b = 29, A = 256, f = A + 1 + b, s = 30, u = 19, p = 2 * f + 1, g = 15, w = 16, o = 7, v = 256, M = 16, E = 17, $ = 18, k = (
              /* extra bits for each length code */
              new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0])
            ), L = (
              /* extra bits for each distance code */
              new Uint8Array([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13])
            ), z = (
              /* extra bits for each bit length code */
              new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7])
            ), O = new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), R = 512, N = new Array((f + 2) * 2);
            c(N);
            const W = new Array(s * 2);
            c(W);
            const B = new Array(R);
            c(B);
            const P = new Array(x - y + 1);
            c(P);
            const G = new Array(b);
            c(G);
            const H = new Array(s);
            c(H);
            function U(C, K, F, Q, le) {
              this.static_tree = C, this.extra_bits = K, this.extra_base = F, this.elems = Q, this.max_length = le, this.has_stree = C && C.length;
            }
            let j, re, ie;
            function te(C, K) {
              this.dyn_tree = C, this.max_code = 0, this.stat_desc = K;
            }
            const ue = (C) => C < 256 ? B[C] : B[256 + (C >>> 7)], de = (C, K) => {
              C.pending_buf[C.pending++] = K & 255, C.pending_buf[C.pending++] = K >>> 8 & 255;
            }, oe = (C, K, F) => {
              C.bi_valid > w - F ? (C.bi_buf |= K << C.bi_valid & 65535, de(C, C.bi_buf), C.bi_buf = K >> w - C.bi_valid, C.bi_valid += F - w) : (C.bi_buf |= K << C.bi_valid & 65535, C.bi_valid += F);
            }, J = (C, K, F) => {
              oe(
                C,
                F[K * 2],
                F[K * 2 + 1]
                /*.Len*/
              );
            }, Ee = (C, K) => {
              let F = 0;
              do
                F |= C & 1, C >>>= 1, F <<= 1;
              while (--K > 0);
              return F >>> 1;
            }, se = (C) => {
              C.bi_valid === 16 ? (de(C, C.bi_buf), C.bi_buf = 0, C.bi_valid = 0) : C.bi_valid >= 8 && (C.pending_buf[C.pending++] = C.bi_buf & 255, C.bi_buf >>= 8, C.bi_valid -= 8);
            }, Ae = (C, K) => {
              const F = K.dyn_tree, Q = K.max_code, le = K.stat_desc.static_tree, ae = K.stat_desc.has_stree, Fe = K.stat_desc.extra_bits, Se = K.stat_desc.extra_base, tt = K.stat_desc.max_length;
              let ve, Oe, Et, et, je, at, Bt = 0;
              for (et = 0; et <= g; et++)
                C.bl_count[et] = 0;
              for (F[C.heap[C.heap_max] * 2 + 1] = 0, ve = C.heap_max + 1; ve < p; ve++)
                Oe = C.heap[ve], et = F[F[Oe * 2 + 1] * 2 + 1] + 1, et > tt && (et = tt, Bt++), F[Oe * 2 + 1] = et, !(Oe > Q) && (C.bl_count[et]++, je = 0, Oe >= Se && (je = Fe[Oe - Se]), at = F[Oe * 2], C.opt_len += at * (et + je), ae && (C.static_len += at * (le[Oe * 2 + 1] + je)));
              if (Bt !== 0) {
                do {
                  for (et = tt - 1; C.bl_count[et] === 0; )
                    et--;
                  C.bl_count[et]--, C.bl_count[et + 1] += 2, C.bl_count[tt]--, Bt -= 2;
                } while (Bt > 0);
                for (et = tt; et !== 0; et--)
                  for (Oe = C.bl_count[et]; Oe !== 0; )
                    Et = C.heap[--ve], !(Et > Q) && (F[Et * 2 + 1] !== et && (C.opt_len += (et - F[Et * 2 + 1]) * F[Et * 2], F[Et * 2 + 1] = et), Oe--);
              }
            }, he = (C, K, F) => {
              const Q = new Array(g + 1);
              let le = 0, ae, Fe;
              for (ae = 1; ae <= g; ae++)
                le = le + F[ae - 1] << 1, Q[ae] = le;
              for (Fe = 0; Fe <= K; Fe++) {
                let Se = C[Fe * 2 + 1];
                Se !== 0 && (C[Fe * 2] = Ee(Q[Se]++, Se));
              }
            }, ne = () => {
              let C, K, F, Q, le;
              const ae = new Array(g + 1);
              for (F = 0, Q = 0; Q < b - 1; Q++)
                for (G[Q] = F, C = 0; C < 1 << k[Q]; C++)
                  P[F++] = Q;
              for (P[F - 1] = Q, le = 0, Q = 0; Q < 16; Q++)
                for (H[Q] = le, C = 0; C < 1 << L[Q]; C++)
                  B[le++] = Q;
              for (le >>= 7; Q < s; Q++)
                for (H[Q] = le << 7, C = 0; C < 1 << L[Q] - 7; C++)
                  B[256 + le++] = Q;
              for (K = 0; K <= g; K++)
                ae[K] = 0;
              for (C = 0; C <= 143; )
                N[C * 2 + 1] = 8, C++, ae[8]++;
              for (; C <= 255; )
                N[C * 2 + 1] = 9, C++, ae[9]++;
              for (; C <= 279; )
                N[C * 2 + 1] = 7, C++, ae[7]++;
              for (; C <= 287; )
                N[C * 2 + 1] = 8, C++, ae[8]++;
              for (he(N, f + 1, ae), C = 0; C < s; C++)
                W[C * 2 + 1] = 5, W[C * 2] = Ee(C, 5);
              j = new U(N, k, A + 1, f, g), re = new U(W, L, 0, s, g), ie = new U(new Array(0), z, 0, u, o);
            }, _e = (C) => {
              let K;
              for (K = 0; K < f; K++)
                C.dyn_ltree[K * 2] = 0;
              for (K = 0; K < s; K++)
                C.dyn_dtree[K * 2] = 0;
              for (K = 0; K < u; K++)
                C.bl_tree[K * 2] = 0;
              C.dyn_ltree[v * 2] = 1, C.opt_len = C.static_len = 0, C.sym_next = C.matches = 0;
            }, Le = (C) => {
              C.bi_valid > 8 ? de(C, C.bi_buf) : C.bi_valid > 0 && (C.pending_buf[C.pending++] = C.bi_buf), C.bi_buf = 0, C.bi_valid = 0;
            }, Be = (C, K, F, Q) => {
              const le = K * 2, ae = F * 2;
              return C[le] < C[ae] || C[le] === C[ae] && Q[K] <= Q[F];
            }, Ue = (C, K, F) => {
              const Q = C.heap[F];
              let le = F << 1;
              for (; le <= C.heap_len && (le < C.heap_len && Be(K, C.heap[le + 1], C.heap[le], C.depth) && le++, !Be(K, Q, C.heap[le], C.depth)); )
                C.heap[F] = C.heap[le], F = le, le <<= 1;
              C.heap[F] = Q;
            }, He = (C, K, F) => {
              let Q, le, ae = 0, Fe, Se;
              if (C.sym_next !== 0)
                do
                  Q = C.pending_buf[C.sym_buf + ae++] & 255, Q += (C.pending_buf[C.sym_buf + ae++] & 255) << 8, le = C.pending_buf[C.sym_buf + ae++], Q === 0 ? J(C, le, K) : (Fe = P[le], J(C, Fe + A + 1, K), Se = k[Fe], Se !== 0 && (le -= G[Fe], oe(C, le, Se)), Q--, Fe = ue(Q), J(C, Fe, F), Se = L[Fe], Se !== 0 && (Q -= H[Fe], oe(C, Q, Se)));
                while (ae < C.sym_next);
              J(C, v, K);
            }, We = (C, K) => {
              const F = K.dyn_tree, Q = K.stat_desc.static_tree, le = K.stat_desc.has_stree, ae = K.stat_desc.elems;
              let Fe, Se, tt = -1, ve;
              for (C.heap_len = 0, C.heap_max = p, Fe = 0; Fe < ae; Fe++)
                F[Fe * 2] !== 0 ? (C.heap[++C.heap_len] = tt = Fe, C.depth[Fe] = 0) : F[Fe * 2 + 1] = 0;
              for (; C.heap_len < 2; )
                ve = C.heap[++C.heap_len] = tt < 2 ? ++tt : 0, F[ve * 2] = 1, C.depth[ve] = 0, C.opt_len--, le && (C.static_len -= Q[ve * 2 + 1]);
              for (K.max_code = tt, Fe = C.heap_len >> 1; Fe >= 1; Fe--)
                Ue(C, F, Fe);
              ve = ae;
              do
                Fe = C.heap[
                  1
                  /*SMALLEST*/
                ], C.heap[
                  1
                  /*SMALLEST*/
                ] = C.heap[C.heap_len--], Ue(
                  C,
                  F,
                  1
                  /*SMALLEST*/
                ), Se = C.heap[
                  1
                  /*SMALLEST*/
                ], C.heap[--C.heap_max] = Fe, C.heap[--C.heap_max] = Se, F[ve * 2] = F[Fe * 2] + F[Se * 2], C.depth[ve] = (C.depth[Fe] >= C.depth[Se] ? C.depth[Fe] : C.depth[Se]) + 1, F[Fe * 2 + 1] = F[Se * 2 + 1] = ve, C.heap[
                  1
                  /*SMALLEST*/
                ] = ve++, Ue(
                  C,
                  F,
                  1
                  /*SMALLEST*/
                );
              while (C.heap_len >= 2);
              C.heap[--C.heap_max] = C.heap[
                1
                /*SMALLEST*/
              ], Ae(C, K), he(F, tt, C.bl_count);
            }, Ge = (C, K, F) => {
              let Q, le = -1, ae, Fe = K[0 * 2 + 1], Se = 0, tt = 7, ve = 4;
              for (Fe === 0 && (tt = 138, ve = 3), K[(F + 1) * 2 + 1] = 65535, Q = 0; Q <= F; Q++)
                ae = Fe, Fe = K[(Q + 1) * 2 + 1], !(++Se < tt && ae === Fe) && (Se < ve ? C.bl_tree[ae * 2] += Se : ae !== 0 ? (ae !== le && C.bl_tree[ae * 2]++, C.bl_tree[M * 2]++) : Se <= 10 ? C.bl_tree[E * 2]++ : C.bl_tree[$ * 2]++, Se = 0, le = ae, Fe === 0 ? (tt = 138, ve = 3) : ae === Fe ? (tt = 6, ve = 3) : (tt = 7, ve = 4));
            }, Ne = (C, K, F) => {
              let Q, le = -1, ae, Fe = K[0 * 2 + 1], Se = 0, tt = 7, ve = 4;
              for (Fe === 0 && (tt = 138, ve = 3), Q = 0; Q <= F; Q++)
                if (ae = Fe, Fe = K[(Q + 1) * 2 + 1], !(++Se < tt && ae === Fe)) {
                  if (Se < ve)
                    do
                      J(C, ae, C.bl_tree);
                    while (--Se !== 0);
                  else ae !== 0 ? (ae !== le && (J(C, ae, C.bl_tree), Se--), J(C, M, C.bl_tree), oe(C, Se - 3, 2)) : Se <= 10 ? (J(C, E, C.bl_tree), oe(C, Se - 3, 3)) : (J(C, $, C.bl_tree), oe(C, Se - 11, 7));
                  Se = 0, le = ae, Fe === 0 ? (tt = 138, ve = 3) : ae === Fe ? (tt = 6, ve = 3) : (tt = 7, ve = 4);
                }
            }, Pe = (C) => {
              let K;
              for (Ge(C, C.dyn_ltree, C.l_desc.max_code), Ge(C, C.dyn_dtree, C.d_desc.max_code), We(C, C.bl_desc), K = u - 1; K >= 3 && C.bl_tree[O[K] * 2 + 1] === 0; K--)
                ;
              return C.opt_len += 3 * (K + 1) + 5 + 5 + 4, K;
            }, Te = (C, K, F, Q) => {
              let le;
              for (oe(C, K - 257, 5), oe(C, F - 1, 5), oe(C, Q - 4, 4), le = 0; le < Q; le++)
                oe(C, C.bl_tree[O[le] * 2 + 1], 3);
              Ne(C, C.dyn_ltree, K - 1), Ne(C, C.dyn_dtree, F - 1);
            }, Me = (C) => {
              let K = 4093624447, F;
              for (F = 0; F <= 31; F++, K >>>= 1)
                if (K & 1 && C.dyn_ltree[F * 2] !== 0)
                  return a;
              if (C.dyn_ltree[9 * 2] !== 0 || C.dyn_ltree[10 * 2] !== 0 || C.dyn_ltree[13 * 2] !== 0)
                return l;
              for (F = 32; F < A; F++)
                if (C.dyn_ltree[F * 2] !== 0)
                  return l;
              return a;
            };
            let De = !1;
            const V = (C) => {
              De || (ne(), De = !0), C.l_desc = new te(C.dyn_ltree, j), C.d_desc = new te(C.dyn_dtree, re), C.bl_desc = new te(C.bl_tree, ie), C.bi_buf = 0, C.bi_valid = 0, _e(C);
            }, Z = (C, K, F, Q) => {
              oe(C, (d << 1) + (Q ? 1 : 0), 3), Le(C), de(C, F), de(C, ~F), F && C.pending_buf.set(C.window.subarray(K, K + F), C.pending), C.pending += F;
            }, ee = (C) => {
              oe(C, _ << 1, 3), J(C, v, N), se(C);
            }, ye = (C, K, F, Q) => {
              let le, ae, Fe = 0;
              C.level > 0 ? (C.strm.data_type === h && (C.strm.data_type = Me(C)), We(C, C.l_desc), We(C, C.d_desc), Fe = Pe(C), le = C.opt_len + 3 + 7 >>> 3, ae = C.static_len + 3 + 7 >>> 3, ae <= le && (le = ae)) : le = ae = F + 5, F + 4 <= le && K !== -1 ? Z(C, K, F, Q) : C.strategy === r || ae === le ? (oe(C, (_ << 1) + (Q ? 1 : 0), 3), He(C, N, W)) : (oe(C, (m << 1) + (Q ? 1 : 0), 3), Te(C, C.l_desc.max_code + 1, C.d_desc.max_code + 1, Fe + 1), He(C, C.dyn_ltree, C.dyn_dtree)), _e(C), Q && Le(C);
            }, ce = (C, K, F) => (C.pending_buf[C.sym_buf + C.sym_next++] = K, C.pending_buf[C.sym_buf + C.sym_next++] = K >> 8, C.pending_buf[C.sym_buf + C.sym_next++] = F, K === 0 ? C.dyn_ltree[F * 2]++ : (C.matches++, K--, C.dyn_ltree[(P[F] + A + 1) * 2]++, C.dyn_dtree[ue(K) * 2]++), C.sym_next === C.sym_end);
            var Ie = V, ke = Z, Y = ye, me = ce, we = ee, Re = {
              _tr_init: Ie,
              _tr_stored_block: ke,
              _tr_flush_block: Y,
              _tr_tally: me,
              _tr_align: we
            }, $e = (C, K, F, Q) => {
              let le = C & 65535 | 0, ae = C >>> 16 & 65535 | 0, Fe = 0;
              for (; F !== 0; ) {
                Fe = F > 2e3 ? 2e3 : F, F -= Fe;
                do
                  le = le + K[Q++] | 0, ae = ae + le | 0;
                while (--Fe);
                le %= 65521, ae %= 65521;
              }
              return le | ae << 16 | 0;
            };
            const X = () => {
              let C, K = [];
              for (var F = 0; F < 256; F++) {
                C = F;
                for (var Q = 0; Q < 8; Q++)
                  C = C & 1 ? 3988292384 ^ C >>> 1 : C >>> 1;
                K[F] = C;
              }
              return K;
            }, ze = new Uint32Array(X());
            var I = (C, K, F, Q) => {
              const le = ze, ae = Q + F;
              C ^= -1;
              for (let Fe = Q; Fe < ae; Fe++)
                C = C >>> 8 ^ le[(C ^ K[Fe]) & 255];
              return C ^ -1;
            }, xe = {
              2: "need dictionary",
              /* Z_NEED_DICT       2  */
              1: "stream end",
              /* Z_STREAM_END      1  */
              0: "",
              /* Z_OK              0  */
              "-1": "file error",
              /* Z_ERRNO         (-1) */
              "-2": "stream error",
              /* Z_STREAM_ERROR  (-2) */
              "-3": "data error",
              /* Z_DATA_ERROR    (-3) */
              "-4": "insufficient memory",
              /* Z_MEM_ERROR     (-4) */
              "-5": "buffer error",
              /* Z_BUF_ERROR     (-5) */
              "-6": "incompatible version"
              /* Z_VERSION_ERROR (-6) */
            }, be = {
              /* Allowed flush values; see deflate() and inflate() below for details */
              Z_NO_FLUSH: 0,
              Z_PARTIAL_FLUSH: 1,
              Z_SYNC_FLUSH: 2,
              Z_FULL_FLUSH: 3,
              Z_FINISH: 4,
              Z_BLOCK: 5,
              Z_TREES: 6,
              /* Return codes for the compression/decompression functions. Negative values
              * are errors, positive values are used for special but normal events.
              */
              Z_OK: 0,
              Z_STREAM_END: 1,
              Z_NEED_DICT: 2,
              Z_ERRNO: -1,
              Z_STREAM_ERROR: -2,
              Z_DATA_ERROR: -3,
              Z_MEM_ERROR: -4,
              Z_BUF_ERROR: -5,
              //Z_VERSION_ERROR: -6,
              /* compression levels */
              Z_NO_COMPRESSION: 0,
              Z_BEST_SPEED: 1,
              Z_BEST_COMPRESSION: 9,
              Z_DEFAULT_COMPRESSION: -1,
              Z_FILTERED: 1,
              Z_HUFFMAN_ONLY: 2,
              Z_RLE: 3,
              Z_FIXED: 4,
              Z_DEFAULT_STRATEGY: 0,
              /* Possible values of the data_type field (though see inflate()) */
              Z_BINARY: 0,
              Z_TEXT: 1,
              //Z_ASCII:                1, // = Z_TEXT (deprecated)
              Z_UNKNOWN: 2,
              /* The deflate compression method */
              Z_DEFLATED: 8
              //Z_NULL:                 null // Use -1 or null inline, depending on var type
            };
            const { _tr_init: q, _tr_stored_block: fe, _tr_flush_block: Ce, _tr_tally: Ze, _tr_align: Xe } = Re, {
              Z_NO_FLUSH: Ye,
              Z_PARTIAL_FLUSH: lt,
              Z_FULL_FLUSH: dt,
              Z_FINISH: it,
              Z_BLOCK: ot,
              Z_OK: nt,
              Z_STREAM_END: Ct,
              Z_STREAM_ERROR: ut,
              Z_DATA_ERROR: zt,
              Z_BUF_ERROR: Ut,
              Z_DEFAULT_COMPRESSION: wt,
              Z_FILTERED: mt,
              Z_HUFFMAN_ONLY: vt,
              Z_RLE: Rt,
              Z_FIXED: qe,
              Z_DEFAULT_STRATEGY: ge,
              Z_UNKNOWN: Ke,
              Z_DEFLATED: Qe
            } = be, _t = 9, Mt = 15, St = 8, Zt = 256 + 1 + 29, Tt = 30, mr = 19, nr = 2 * Zt + 1, Or = 15, ft = 3, Qt = 258, Gt = Qt + ft + 1, Nt = 32, ar = 42, zr = 57, Ir = 69, Br = 73, Dr = 91, Rr = 103, sr = 113, vr = 666, Ht = 1, pr = 2, lr = 3, _r = 4, hi = 3, or = (C, K) => (C.msg = xe[K], K), Yr = (C) => C * 2 - (C > 4 ? 9 : 0), tr = (C) => {
              let K = C.length;
              for (; --K >= 0; )
                C[K] = 0;
            }, fi = (C) => {
              let K, F, Q, le = C.w_size;
              K = C.hash_size, Q = K;
              do
                F = C.head[--Q], C.head[Q] = F >= le ? F - le : 0;
              while (--K);
              K = le, Q = K;
              do
                F = C.prev[--Q], C.prev[Q] = F >= le ? F - le : 0;
              while (--K);
            };
            let rr = (C, K, F) => (K << C.hash_shift ^ F) & C.hash_mask;
            const Kt = (C) => {
              const K = C.state;
              let F = K.pending;
              F > C.avail_out && (F = C.avail_out), F !== 0 && (C.output.set(K.pending_buf.subarray(K.pending_out, K.pending_out + F), C.next_out), C.next_out += F, K.pending_out += F, C.total_out += F, C.avail_out -= F, K.pending -= F, K.pending === 0 && (K.pending_out = 0));
            }, Yt = (C, K) => {
              Ce(C, C.block_start >= 0 ? C.block_start : -1, C.strstart - C.block_start, K), C.block_start = C.strstart, Kt(C.strm);
            }, xt = (C, K) => {
              C.pending_buf[C.pending++] = K;
            }, yr = (C, K) => {
              C.pending_buf[C.pending++] = K >>> 8 & 255, C.pending_buf[C.pending++] = K & 255;
            }, Pr = (C, K, F, Q) => {
              let le = C.avail_in;
              return le > Q && (le = Q), le === 0 ? 0 : (C.avail_in -= le, K.set(C.input.subarray(C.next_in, C.next_in + le), F), C.state.wrap === 1 ? C.adler = $e(C.adler, K, le, F) : C.state.wrap === 2 && (C.adler = I(C.adler, K, le, F)), C.next_in += le, C.total_in += le, le);
            }, kt = (C, K) => {
              let F = C.max_chain_length, Q = C.strstart, le, ae, Fe = C.prev_length, Se = C.nice_match;
              const tt = C.strstart > C.w_size - Gt ? C.strstart - (C.w_size - Gt) : 0, ve = C.window, Oe = C.w_mask, Et = C.prev, et = C.strstart + Qt;
              let je = ve[Q + Fe - 1], at = ve[Q + Fe];
              C.prev_length >= C.good_match && (F >>= 2), Se > C.lookahead && (Se = C.lookahead);
              do
                if (le = K, !(ve[le + Fe] !== at || ve[le + Fe - 1] !== je || ve[le] !== ve[Q] || ve[++le] !== ve[Q + 1])) {
                  Q += 2, le++;
                  do
                    ;
                  while (ve[++Q] === ve[++le] && ve[++Q] === ve[++le] && ve[++Q] === ve[++le] && ve[++Q] === ve[++le] && ve[++Q] === ve[++le] && ve[++Q] === ve[++le] && ve[++Q] === ve[++le] && ve[++Q] === ve[++le] && Q < et);
                  if (ae = Qt - (et - Q), Q = et - Qt, ae > Fe) {
                    if (C.match_start = K, Fe = ae, ae >= Se)
                      break;
                    je = ve[Q + Fe - 1], at = ve[Q + Fe];
                  }
                }
              while ((K = Et[K & Oe]) > tt && --F !== 0);
              return Fe <= C.lookahead ? Fe : C.lookahead;
            }, rt = (C) => {
              const K = C.w_size;
              let F, Q, le;
              do {
                if (Q = C.window_size - C.lookahead - C.strstart, C.strstart >= K + (K - Gt) && (C.window.set(C.window.subarray(K, K + K - Q), 0), C.match_start -= K, C.strstart -= K, C.block_start -= K, C.insert > C.strstart && (C.insert = C.strstart), fi(C), Q += K), C.strm.avail_in === 0)
                  break;
                if (F = Pr(C.strm, C.window, C.strstart + C.lookahead, Q), C.lookahead += F, C.lookahead + C.insert >= ft)
                  for (le = C.strstart - C.insert, C.ins_h = C.window[le], C.ins_h = rr(C, C.ins_h, C.window[le + 1]); C.insert && (C.ins_h = rr(C, C.ins_h, C.window[le + ft - 1]), C.prev[le & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = le, le++, C.insert--, !(C.lookahead + C.insert < ft)); )
                    ;
              } while (C.lookahead < Gt && C.strm.avail_in !== 0);
            }, Lt = (C, K) => {
              let F = C.pending_buf_size - 5 > C.w_size ? C.w_size : C.pending_buf_size - 5, Q, le, ae, Fe = 0, Se = C.strm.avail_in;
              do {
                if (Q = 65535, ae = C.bi_valid + 42 >> 3, C.strm.avail_out < ae || (ae = C.strm.avail_out - ae, le = C.strstart - C.block_start, Q > le + C.strm.avail_in && (Q = le + C.strm.avail_in), Q > ae && (Q = ae), Q < F && (Q === 0 && K !== it || K === Ye || Q !== le + C.strm.avail_in)))
                  break;
                Fe = K === it && Q === le + C.strm.avail_in ? 1 : 0, fe(C, 0, 0, Fe), C.pending_buf[C.pending - 4] = Q, C.pending_buf[C.pending - 3] = Q >> 8, C.pending_buf[C.pending - 2] = ~Q, C.pending_buf[C.pending - 1] = ~Q >> 8, Kt(C.strm), le && (le > Q && (le = Q), C.strm.output.set(C.window.subarray(C.block_start, C.block_start + le), C.strm.next_out), C.strm.next_out += le, C.strm.avail_out -= le, C.strm.total_out += le, C.block_start += le, Q -= le), Q && (Pr(C.strm, C.strm.output, C.strm.next_out, Q), C.strm.next_out += Q, C.strm.avail_out -= Q, C.strm.total_out += Q);
              } while (Fe === 0);
              return Se -= C.strm.avail_in, Se && (Se >= C.w_size ? (C.matches = 2, C.window.set(C.strm.input.subarray(C.strm.next_in - C.w_size, C.strm.next_in), 0), C.strstart = C.w_size, C.insert = C.strstart) : (C.window_size - C.strstart <= Se && (C.strstart -= C.w_size, C.window.set(C.window.subarray(C.w_size, C.w_size + C.strstart), 0), C.matches < 2 && C.matches++, C.insert > C.strstart && (C.insert = C.strstart)), C.window.set(C.strm.input.subarray(C.strm.next_in - Se, C.strm.next_in), C.strstart), C.strstart += Se, C.insert += Se > C.w_size - C.insert ? C.w_size - C.insert : Se), C.block_start = C.strstart), C.high_water < C.strstart && (C.high_water = C.strstart), Fe ? _r : K !== Ye && K !== it && C.strm.avail_in === 0 && C.strstart === C.block_start ? pr : (ae = C.window_size - C.strstart, C.strm.avail_in > ae && C.block_start >= C.w_size && (C.block_start -= C.w_size, C.strstart -= C.w_size, C.window.set(C.window.subarray(C.w_size, C.w_size + C.strstart), 0), C.matches < 2 && C.matches++, ae += C.w_size, C.insert > C.strstart && (C.insert = C.strstart)), ae > C.strm.avail_in && (ae = C.strm.avail_in), ae && (Pr(C.strm, C.window, C.strstart, ae), C.strstart += ae, C.insert += ae > C.w_size - C.insert ? C.w_size - C.insert : ae), C.high_water < C.strstart && (C.high_water = C.strstart), ae = C.bi_valid + 42 >> 3, ae = C.pending_buf_size - ae > 65535 ? 65535 : C.pending_buf_size - ae, F = ae > C.w_size ? C.w_size : ae, le = C.strstart - C.block_start, (le >= F || (le || K === it) && K !== Ye && C.strm.avail_in === 0 && le <= ae) && (Q = le > ae ? ae : le, Fe = K === it && C.strm.avail_in === 0 && Q === le ? 1 : 0, fe(C, C.block_start, Q, Fe), C.block_start += Q, Kt(C.strm)), Fe ? lr : Ht);
            }, cr = (C, K) => {
              let F, Q;
              for (; ; ) {
                if (C.lookahead < Gt) {
                  if (rt(C), C.lookahead < Gt && K === Ye)
                    return Ht;
                  if (C.lookahead === 0)
                    break;
                }
                if (F = 0, C.lookahead >= ft && (C.ins_h = rr(C, C.ins_h, C.window[C.strstart + ft - 1]), F = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart), F !== 0 && C.strstart - F <= C.w_size - Gt && (C.match_length = kt(C, F)), C.match_length >= ft)
                  if (Q = Ze(C, C.strstart - C.match_start, C.match_length - ft), C.lookahead -= C.match_length, C.match_length <= C.max_lazy_match && C.lookahead >= ft) {
                    C.match_length--;
                    do
                      C.strstart++, C.ins_h = rr(C, C.ins_h, C.window[C.strstart + ft - 1]), F = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart;
                    while (--C.match_length !== 0);
                    C.strstart++;
                  } else
                    C.strstart += C.match_length, C.match_length = 0, C.ins_h = C.window[C.strstart], C.ins_h = rr(C, C.ins_h, C.window[C.strstart + 1]);
                else
                  Q = Ze(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++;
                if (Q && (Yt(C, !1), C.strm.avail_out === 0))
                  return Ht;
              }
              return C.insert = C.strstart < ft - 1 ? C.strstart : ft - 1, K === it ? (Yt(C, !0), C.strm.avail_out === 0 ? lr : _r) : C.sym_next && (Yt(C, !1), C.strm.avail_out === 0) ? Ht : pr;
            }, Jt = (C, K) => {
              let F, Q, le;
              for (; ; ) {
                if (C.lookahead < Gt) {
                  if (rt(C), C.lookahead < Gt && K === Ye)
                    return Ht;
                  if (C.lookahead === 0)
                    break;
                }
                if (F = 0, C.lookahead >= ft && (C.ins_h = rr(C, C.ins_h, C.window[C.strstart + ft - 1]), F = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart), C.prev_length = C.match_length, C.prev_match = C.match_start, C.match_length = ft - 1, F !== 0 && C.prev_length < C.max_lazy_match && C.strstart - F <= C.w_size - Gt && (C.match_length = kt(C, F), C.match_length <= 5 && (C.strategy === mt || C.match_length === ft && C.strstart - C.match_start > 4096) && (C.match_length = ft - 1)), C.prev_length >= ft && C.match_length <= C.prev_length) {
                  le = C.strstart + C.lookahead - ft, Q = Ze(C, C.strstart - 1 - C.prev_match, C.prev_length - ft), C.lookahead -= C.prev_length - 1, C.prev_length -= 2;
                  do
                    ++C.strstart <= le && (C.ins_h = rr(C, C.ins_h, C.window[C.strstart + ft - 1]), F = C.prev[C.strstart & C.w_mask] = C.head[C.ins_h], C.head[C.ins_h] = C.strstart);
                  while (--C.prev_length !== 0);
                  if (C.match_available = 0, C.match_length = ft - 1, C.strstart++, Q && (Yt(C, !1), C.strm.avail_out === 0))
                    return Ht;
                } else if (C.match_available) {
                  if (Q = Ze(C, 0, C.window[C.strstart - 1]), Q && Yt(C, !1), C.strstart++, C.lookahead--, C.strm.avail_out === 0)
                    return Ht;
                } else
                  C.match_available = 1, C.strstart++, C.lookahead--;
              }
              return C.match_available && (Q = Ze(C, 0, C.window[C.strstart - 1]), C.match_available = 0), C.insert = C.strstart < ft - 1 ? C.strstart : ft - 1, K === it ? (Yt(C, !0), C.strm.avail_out === 0 ? lr : _r) : C.sym_next && (Yt(C, !1), C.strm.avail_out === 0) ? Ht : pr;
            }, Cr = (C, K) => {
              let F, Q, le, ae;
              const Fe = C.window;
              for (; ; ) {
                if (C.lookahead <= Qt) {
                  if (rt(C), C.lookahead <= Qt && K === Ye)
                    return Ht;
                  if (C.lookahead === 0)
                    break;
                }
                if (C.match_length = 0, C.lookahead >= ft && C.strstart > 0 && (le = C.strstart - 1, Q = Fe[le], Q === Fe[++le] && Q === Fe[++le] && Q === Fe[++le])) {
                  ae = C.strstart + Qt;
                  do
                    ;
                  while (Q === Fe[++le] && Q === Fe[++le] && Q === Fe[++le] && Q === Fe[++le] && Q === Fe[++le] && Q === Fe[++le] && Q === Fe[++le] && Q === Fe[++le] && le < ae);
                  C.match_length = Qt - (ae - le), C.match_length > C.lookahead && (C.match_length = C.lookahead);
                }
                if (C.match_length >= ft ? (F = Ze(C, 1, C.match_length - ft), C.lookahead -= C.match_length, C.strstart += C.match_length, C.match_length = 0) : (F = Ze(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++), F && (Yt(C, !1), C.strm.avail_out === 0))
                  return Ht;
              }
              return C.insert = 0, K === it ? (Yt(C, !0), C.strm.avail_out === 0 ? lr : _r) : C.sym_next && (Yt(C, !1), C.strm.avail_out === 0) ? Ht : pr;
            }, gr = (C, K) => {
              let F;
              for (; ; ) {
                if (C.lookahead === 0 && (rt(C), C.lookahead === 0)) {
                  if (K === Ye)
                    return Ht;
                  break;
                }
                if (C.match_length = 0, F = Ze(C, 0, C.window[C.strstart]), C.lookahead--, C.strstart++, F && (Yt(C, !1), C.strm.avail_out === 0))
                  return Ht;
              }
              return C.insert = 0, K === it ? (Yt(C, !0), C.strm.avail_out === 0 ? lr : _r) : C.sym_next && (Yt(C, !1), C.strm.avail_out === 0) ? Ht : pr;
            };
            function Vt(C, K, F, Q, le) {
              this.good_length = C, this.max_lazy = K, this.nice_length = F, this.max_chain = Q, this.func = le;
            }
            const Xt = [
              /*      good lazy nice chain */
              new Vt(0, 0, 0, 0, Lt),
              /* 0 store only */
              new Vt(4, 4, 8, 4, cr),
              /* 1 max speed, no lazy matches */
              new Vt(4, 5, 16, 8, cr),
              /* 2 */
              new Vt(4, 6, 32, 32, cr),
              /* 3 */
              new Vt(4, 4, 16, 16, Jt),
              /* 4 lazy matches */
              new Vt(8, 16, 32, 32, Jt),
              /* 5 */
              new Vt(8, 16, 128, 128, Jt),
              /* 6 */
              new Vt(8, 32, 128, 256, Jt),
              /* 7 */
              new Vt(32, 128, 258, 1024, Jt),
              /* 8 */
              new Vt(32, 258, 258, 4096, Jt)
              /* 9 max compression */
            ], $r = (C) => {
              C.window_size = 2 * C.w_size, tr(C.head), C.max_lazy_match = Xt[C.level].max_lazy, C.good_match = Xt[C.level].good_length, C.nice_match = Xt[C.level].nice_length, C.max_chain_length = Xt[C.level].max_chain, C.strstart = 0, C.block_start = 0, C.lookahead = 0, C.insert = 0, C.match_length = C.prev_length = ft - 1, C.match_available = 0, C.ins_h = 0;
            };
            function Tr() {
              this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = Qe, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new Uint16Array(nr * 2), this.dyn_dtree = new Uint16Array((2 * Tt + 1) * 2), this.bl_tree = new Uint16Array((2 * mr + 1) * 2), tr(this.dyn_ltree), tr(this.dyn_dtree), tr(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new Uint16Array(Or + 1), this.heap = new Uint16Array(2 * Zt + 1), tr(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new Uint16Array(2 * Zt + 1), tr(this.depth), this.sym_buf = 0, this.lit_bufsize = 0, this.sym_next = 0, this.sym_end = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
            }
            const ir = (C) => {
              if (!C)
                return 1;
              const K = C.state;
              return !K || K.strm !== C || K.status !== ar && //#ifdef GZIP
              K.status !== zr && //#endif
              K.status !== Ir && K.status !== Br && K.status !== Dr && K.status !== Rr && K.status !== sr && K.status !== vr ? 1 : 0;
            }, xr = (C) => {
              if (ir(C))
                return or(C, ut);
              C.total_in = C.total_out = 0, C.data_type = Ke;
              const K = C.state;
              return K.pending = 0, K.pending_out = 0, K.wrap < 0 && (K.wrap = -K.wrap), K.status = //#ifdef GZIP
              K.wrap === 2 ? zr : (
                //#endif
                K.wrap ? ar : sr
              ), C.adler = K.wrap === 2 ? 0 : 1, K.last_flush = -2, q(K), nt;
            }, wr = (C) => {
              const K = xr(C);
              return K === nt && $r(C.state), K;
            }, jt = (C, K) => ir(C) || C.state.wrap !== 2 ? ut : (C.state.gzhead = K, nt), er = (C, K, F, Q, le, ae) => {
              if (!C)
                return ut;
              let Fe = 1;
              if (K === wt && (K = 6), Q < 0 ? (Fe = 0, Q = -Q) : Q > 15 && (Fe = 2, Q -= 16), le < 1 || le > _t || F !== Qe || Q < 8 || Q > 15 || K < 0 || K > 9 || ae < 0 || ae > qe || Q === 8 && Fe !== 1)
                return or(C, ut);
              Q === 8 && (Q = 9);
              const Se = new Tr();
              return C.state = Se, Se.strm = C, Se.status = ar, Se.wrap = Fe, Se.gzhead = null, Se.w_bits = Q, Se.w_size = 1 << Se.w_bits, Se.w_mask = Se.w_size - 1, Se.hash_bits = le + 7, Se.hash_size = 1 << Se.hash_bits, Se.hash_mask = Se.hash_size - 1, Se.hash_shift = ~~((Se.hash_bits + ft - 1) / ft), Se.window = new Uint8Array(Se.w_size * 2), Se.head = new Uint16Array(Se.hash_size), Se.prev = new Uint16Array(Se.w_size), Se.lit_bufsize = 1 << le + 6, Se.pending_buf_size = Se.lit_bufsize * 4, Se.pending_buf = new Uint8Array(Se.pending_buf_size), Se.sym_buf = Se.lit_bufsize, Se.sym_end = (Se.lit_bufsize - 1) * 3, Se.level = K, Se.strategy = ae, Se.method = F, wr(C);
            }, Xr = (C, K) => er(C, K, Qe, Mt, St, ge), Zr = (C, K) => {
              if (ir(C) || K > ot || K < 0)
                return C ? or(C, ut) : ut;
              const F = C.state;
              if (!C.output || C.avail_in !== 0 && !C.input || F.status === vr && K !== it)
                return or(C, C.avail_out === 0 ? Ut : ut);
              const Q = F.last_flush;
              if (F.last_flush = K, F.pending !== 0) {
                if (Kt(C), C.avail_out === 0)
                  return F.last_flush = -1, nt;
              } else if (C.avail_in === 0 && Yr(K) <= Yr(Q) && K !== it)
                return or(C, Ut);
              if (F.status === vr && C.avail_in !== 0)
                return or(C, Ut);
              if (F.status === ar && F.wrap === 0 && (F.status = sr), F.status === ar) {
                let le = Qe + (F.w_bits - 8 << 4) << 8, ae = -1;
                if (F.strategy >= vt || F.level < 2 ? ae = 0 : F.level < 6 ? ae = 1 : F.level === 6 ? ae = 2 : ae = 3, le |= ae << 6, F.strstart !== 0 && (le |= Nt), le += 31 - le % 31, yr(F, le), F.strstart !== 0 && (yr(F, C.adler >>> 16), yr(F, C.adler & 65535)), C.adler = 1, F.status = sr, Kt(C), F.pending !== 0)
                  return F.last_flush = -1, nt;
              }
              if (F.status === zr) {
                if (C.adler = 0, xt(F, 31), xt(F, 139), xt(F, 8), F.gzhead)
                  xt(
                    F,
                    (F.gzhead.text ? 1 : 0) + (F.gzhead.hcrc ? 2 : 0) + (F.gzhead.extra ? 4 : 0) + (F.gzhead.name ? 8 : 0) + (F.gzhead.comment ? 16 : 0)
                  ), xt(F, F.gzhead.time & 255), xt(F, F.gzhead.time >> 8 & 255), xt(F, F.gzhead.time >> 16 & 255), xt(F, F.gzhead.time >> 24 & 255), xt(F, F.level === 9 ? 2 : F.strategy >= vt || F.level < 2 ? 4 : 0), xt(F, F.gzhead.os & 255), F.gzhead.extra && F.gzhead.extra.length && (xt(F, F.gzhead.extra.length & 255), xt(F, F.gzhead.extra.length >> 8 & 255)), F.gzhead.hcrc && (C.adler = I(C.adler, F.pending_buf, F.pending, 0)), F.gzindex = 0, F.status = Ir;
                else if (xt(F, 0), xt(F, 0), xt(F, 0), xt(F, 0), xt(F, 0), xt(F, F.level === 9 ? 2 : F.strategy >= vt || F.level < 2 ? 4 : 0), xt(F, hi), F.status = sr, Kt(C), F.pending !== 0)
                  return F.last_flush = -1, nt;
              }
              if (F.status === Ir) {
                if (F.gzhead.extra) {
                  let le = F.pending, ae = (F.gzhead.extra.length & 65535) - F.gzindex;
                  for (; F.pending + ae > F.pending_buf_size; ) {
                    let Se = F.pending_buf_size - F.pending;
                    if (F.pending_buf.set(F.gzhead.extra.subarray(F.gzindex, F.gzindex + Se), F.pending), F.pending = F.pending_buf_size, F.gzhead.hcrc && F.pending > le && (C.adler = I(C.adler, F.pending_buf, F.pending - le, le)), F.gzindex += Se, Kt(C), F.pending !== 0)
                      return F.last_flush = -1, nt;
                    le = 0, ae -= Se;
                  }
                  let Fe = new Uint8Array(F.gzhead.extra);
                  F.pending_buf.set(Fe.subarray(F.gzindex, F.gzindex + ae), F.pending), F.pending += ae, F.gzhead.hcrc && F.pending > le && (C.adler = I(C.adler, F.pending_buf, F.pending - le, le)), F.gzindex = 0;
                }
                F.status = Br;
              }
              if (F.status === Br) {
                if (F.gzhead.name) {
                  let le = F.pending, ae;
                  do {
                    if (F.pending === F.pending_buf_size) {
                      if (F.gzhead.hcrc && F.pending > le && (C.adler = I(C.adler, F.pending_buf, F.pending - le, le)), Kt(C), F.pending !== 0)
                        return F.last_flush = -1, nt;
                      le = 0;
                    }
                    F.gzindex < F.gzhead.name.length ? ae = F.gzhead.name.charCodeAt(F.gzindex++) & 255 : ae = 0, xt(F, ae);
                  } while (ae !== 0);
                  F.gzhead.hcrc && F.pending > le && (C.adler = I(C.adler, F.pending_buf, F.pending - le, le)), F.gzindex = 0;
                }
                F.status = Dr;
              }
              if (F.status === Dr) {
                if (F.gzhead.comment) {
                  let le = F.pending, ae;
                  do {
                    if (F.pending === F.pending_buf_size) {
                      if (F.gzhead.hcrc && F.pending > le && (C.adler = I(C.adler, F.pending_buf, F.pending - le, le)), Kt(C), F.pending !== 0)
                        return F.last_flush = -1, nt;
                      le = 0;
                    }
                    F.gzindex < F.gzhead.comment.length ? ae = F.gzhead.comment.charCodeAt(F.gzindex++) & 255 : ae = 0, xt(F, ae);
                  } while (ae !== 0);
                  F.gzhead.hcrc && F.pending > le && (C.adler = I(C.adler, F.pending_buf, F.pending - le, le));
                }
                F.status = Rr;
              }
              if (F.status === Rr) {
                if (F.gzhead.hcrc) {
                  if (F.pending + 2 > F.pending_buf_size && (Kt(C), F.pending !== 0))
                    return F.last_flush = -1, nt;
                  xt(F, C.adler & 255), xt(F, C.adler >> 8 & 255), C.adler = 0;
                }
                if (F.status = sr, Kt(C), F.pending !== 0)
                  return F.last_flush = -1, nt;
              }
              if (C.avail_in !== 0 || F.lookahead !== 0 || K !== Ye && F.status !== vr) {
                let le = F.level === 0 ? Lt(F, K) : F.strategy === vt ? gr(F, K) : F.strategy === Rt ? Cr(F, K) : Xt[F.level].func(F, K);
                if ((le === lr || le === _r) && (F.status = vr), le === Ht || le === lr)
                  return C.avail_out === 0 && (F.last_flush = -1), nt;
                if (le === pr && (K === lt ? Xe(F) : K !== ot && (fe(F, 0, 0, !1), K === dt && (tr(F.head), F.lookahead === 0 && (F.strstart = 0, F.block_start = 0, F.insert = 0))), Kt(C), C.avail_out === 0))
                  return F.last_flush = -1, nt;
              }
              return K !== it ? nt : F.wrap <= 0 ? Ct : (F.wrap === 2 ? (xt(F, C.adler & 255), xt(F, C.adler >> 8 & 255), xt(F, C.adler >> 16 & 255), xt(F, C.adler >> 24 & 255), xt(F, C.total_in & 255), xt(F, C.total_in >> 8 & 255), xt(F, C.total_in >> 16 & 255), xt(F, C.total_in >> 24 & 255)) : (yr(F, C.adler >>> 16), yr(F, C.adler & 65535)), Kt(C), F.wrap > 0 && (F.wrap = -F.wrap), F.pending !== 0 ? nt : Ct);
            }, qr = (C) => {
              if (ir(C))
                return ut;
              const K = C.state.status;
              return C.state = null, K === sr ? or(C, zt) : nt;
            }, Qr = (C, K) => {
              let F = K.length;
              if (ir(C))
                return ut;
              const Q = C.state, le = Q.wrap;
              if (le === 2 || le === 1 && Q.status !== ar || Q.lookahead)
                return ut;
              if (le === 1 && (C.adler = $e(C.adler, K, F, 0)), Q.wrap = 0, F >= Q.w_size) {
                le === 0 && (tr(Q.head), Q.strstart = 0, Q.block_start = 0, Q.insert = 0);
                let tt = new Uint8Array(Q.w_size);
                tt.set(K.subarray(F - Q.w_size, F), 0), K = tt, F = Q.w_size;
              }
              const ae = C.avail_in, Fe = C.next_in, Se = C.input;
              for (C.avail_in = F, C.next_in = 0, C.input = K, rt(Q); Q.lookahead >= ft; ) {
                let tt = Q.strstart, ve = Q.lookahead - (ft - 1);
                do
                  Q.ins_h = rr(Q, Q.ins_h, Q.window[tt + ft - 1]), Q.prev[tt & Q.w_mask] = Q.head[Q.ins_h], Q.head[Q.ins_h] = tt, tt++;
                while (--ve);
                Q.strstart = tt, Q.lookahead = ft - 1, rt(Q);
              }
              return Q.strstart += Q.lookahead, Q.block_start = Q.strstart, Q.insert = Q.lookahead, Q.lookahead = 0, Q.match_length = Q.prev_length = ft - 1, Q.match_available = 0, C.next_in = Fe, C.input = Se, C.avail_in = ae, Q.wrap = le, nt;
            };
            var kr = Xr, Jr = er, ei = wr, Nr = xr, On = jt, zn = Zr, In = qr, Bn = Qr, Rn = "pako deflate (from Nodeca project)", Ur = {
              deflateInit: kr,
              deflateInit2: Jr,
              deflateReset: ei,
              deflateResetKeep: Nr,
              deflateSetHeader: On,
              deflate: zn,
              deflateEnd: In,
              deflateSetDictionary: Bn,
              deflateInfo: Rn
            };
            const Pn = (C, K) => Object.prototype.hasOwnProperty.call(C, K);
            var Nn = function(C) {
              const K = Array.prototype.slice.call(arguments, 1);
              for (; K.length; ) {
                const F = K.shift();
                if (F) {
                  if (typeof F != "object")
                    throw new TypeError(F + "must be non-object");
                  for (const Q in F)
                    Pn(F, Q) && (C[Q] = F[Q]);
                }
              }
              return C;
            }, Un = (C) => {
              let K = 0;
              for (let Q = 0, le = C.length; Q < le; Q++)
                K += C[Q].length;
              const F = new Uint8Array(K);
              for (let Q = 0, le = 0, ae = C.length; Q < ae; Q++) {
                let Fe = C[Q];
                F.set(Fe, le), le += Fe.length;
              }
              return F;
            }, ti = {
              assign: Nn,
              flattenChunks: Un
            };
            let $i = !0;
            try {
              String.fromCharCode.apply(null, new Uint8Array(1));
            } catch {
              $i = !1;
            }
            const Wr = new Uint8Array(256);
            for (let C = 0; C < 256; C++)
              Wr[C] = C >= 252 ? 6 : C >= 248 ? 5 : C >= 240 ? 4 : C >= 224 ? 3 : C >= 192 ? 2 : 1;
            Wr[254] = Wr[254] = 1;
            var Wn = (C) => {
              if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
                return new TextEncoder().encode(C);
              let K, F, Q, le, ae, Fe = C.length, Se = 0;
              for (le = 0; le < Fe; le++)
                F = C.charCodeAt(le), (F & 64512) === 55296 && le + 1 < Fe && (Q = C.charCodeAt(le + 1), (Q & 64512) === 56320 && (F = 65536 + (F - 55296 << 10) + (Q - 56320), le++)), Se += F < 128 ? 1 : F < 2048 ? 2 : F < 65536 ? 3 : 4;
              for (K = new Uint8Array(Se), ae = 0, le = 0; ae < Se; le++)
                F = C.charCodeAt(le), (F & 64512) === 55296 && le + 1 < Fe && (Q = C.charCodeAt(le + 1), (Q & 64512) === 56320 && (F = 65536 + (F - 55296 << 10) + (Q - 56320), le++)), F < 128 ? K[ae++] = F : F < 2048 ? (K[ae++] = 192 | F >>> 6, K[ae++] = 128 | F & 63) : F < 65536 ? (K[ae++] = 224 | F >>> 12, K[ae++] = 128 | F >>> 6 & 63, K[ae++] = 128 | F & 63) : (K[ae++] = 240 | F >>> 18, K[ae++] = 128 | F >>> 12 & 63, K[ae++] = 128 | F >>> 6 & 63, K[ae++] = 128 | F & 63);
              return K;
            };
            const Gn = (C, K) => {
              if (K < 65534 && C.subarray && $i)
                return String.fromCharCode.apply(null, C.length === K ? C : C.subarray(0, K));
              let F = "";
              for (let Q = 0; Q < K; Q++)
                F += String.fromCharCode(C[Q]);
              return F;
            };
            var Hn = (C, K) => {
              const F = K || C.length;
              if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
                return new TextDecoder().decode(C.subarray(0, K));
              let Q, le;
              const ae = new Array(F * 2);
              for (le = 0, Q = 0; Q < F; ) {
                let Fe = C[Q++];
                if (Fe < 128) {
                  ae[le++] = Fe;
                  continue;
                }
                let Se = Wr[Fe];
                if (Se > 4) {
                  ae[le++] = 65533, Q += Se - 1;
                  continue;
                }
                for (Fe &= Se === 2 ? 31 : Se === 3 ? 15 : 7; Se > 1 && Q < F; )
                  Fe = Fe << 6 | C[Q++] & 63, Se--;
                if (Se > 1) {
                  ae[le++] = 65533;
                  continue;
                }
                Fe < 65536 ? ae[le++] = Fe : (Fe -= 65536, ae[le++] = 55296 | Fe >> 10 & 1023, ae[le++] = 56320 | Fe & 1023);
              }
              return Gn(ae, le);
            }, Vn = (C, K) => {
              K = K || C.length, K > C.length && (K = C.length);
              let F = K - 1;
              for (; F >= 0 && (C[F] & 192) === 128; )
                F--;
              return F < 0 || F === 0 ? K : F + Wr[C[F]] > K ? F : K;
            }, Gr = {
              string2buf: Wn,
              buf2string: Hn,
              utf8border: Vn
            };
            function jn() {
              this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
            }
            var Ti = jn;
            const ki = Object.prototype.toString, {
              Z_NO_FLUSH: Kn,
              Z_SYNC_FLUSH: Yn,
              Z_FULL_FLUSH: Xn,
              Z_FINISH: Zn,
              Z_OK: ri,
              Z_STREAM_END: qn,
              Z_DEFAULT_COMPRESSION: Qn,
              Z_DEFAULT_STRATEGY: Jn,
              Z_DEFLATED: ea
            } = be;
            function Hr(C) {
              this.options = ti.assign({
                level: Qn,
                method: ea,
                chunkSize: 16384,
                windowBits: 15,
                memLevel: 8,
                strategy: Jn
              }, C || {});
              let K = this.options;
              K.raw && K.windowBits > 0 ? K.windowBits = -K.windowBits : K.gzip && K.windowBits > 0 && K.windowBits < 16 && (K.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new Ti(), this.strm.avail_out = 0;
              let F = Ur.deflateInit2(
                this.strm,
                K.level,
                K.method,
                K.windowBits,
                K.memLevel,
                K.strategy
              );
              if (F !== ri)
                throw new Error(xe[F]);
              if (K.header && Ur.deflateSetHeader(this.strm, K.header), K.dictionary) {
                let Q;
                if (typeof K.dictionary == "string" ? Q = Gr.string2buf(K.dictionary) : ki.call(K.dictionary) === "[object ArrayBuffer]" ? Q = new Uint8Array(K.dictionary) : Q = K.dictionary, F = Ur.deflateSetDictionary(this.strm, Q), F !== ri)
                  throw new Error(xe[F]);
                this._dict_set = !0;
              }
            }
            Hr.prototype.push = function(C, K) {
              const F = this.strm, Q = this.options.chunkSize;
              let le, ae;
              if (this.ended)
                return !1;
              for (K === ~~K ? ae = K : ae = K === !0 ? Zn : Kn, typeof C == "string" ? F.input = Gr.string2buf(C) : ki.call(C) === "[object ArrayBuffer]" ? F.input = new Uint8Array(C) : F.input = C, F.next_in = 0, F.avail_in = F.input.length; ; ) {
                if (F.avail_out === 0 && (F.output = new Uint8Array(Q), F.next_out = 0, F.avail_out = Q), (ae === Yn || ae === Xn) && F.avail_out <= 6) {
                  this.onData(F.output.subarray(0, F.next_out)), F.avail_out = 0;
                  continue;
                }
                if (le = Ur.deflate(F, ae), le === qn)
                  return F.next_out > 0 && this.onData(F.output.subarray(0, F.next_out)), le = Ur.deflateEnd(this.strm), this.onEnd(le), this.ended = !0, le === ri;
                if (F.avail_out === 0) {
                  this.onData(F.output);
                  continue;
                }
                if (ae > 0 && F.next_out > 0) {
                  this.onData(F.output.subarray(0, F.next_out)), F.avail_out = 0;
                  continue;
                }
                if (F.avail_in === 0) break;
              }
              return !0;
            }, Hr.prototype.onData = function(C) {
              this.chunks.push(C);
            }, Hr.prototype.onEnd = function(C) {
              C === ri && (this.result = ti.flattenChunks(this.chunks)), this.chunks = [], this.err = C, this.msg = this.strm.msg;
            };
            function mi(C, K) {
              const F = new Hr(K);
              if (F.push(C, !0), F.err)
                throw F.msg || xe[F.err];
              return F.result;
            }
            function ta(C, K) {
              return K = K || {}, K.raw = !0, mi(C, K);
            }
            function ra(C, K) {
              return K = K || {}, K.gzip = !0, mi(C, K);
            }
            var ia = Hr, na = mi, aa = ta, sa = ra, la = be, oa = {
              Deflate: ia,
              deflate: na,
              deflateRaw: aa,
              gzip: sa,
              constants: la
            };
            const ii = 16209, ca = 16191;
            var da = function(K, F) {
              let Q, le, ae, Fe, Se, tt, ve, Oe, Et, et, je, at, Bt, bt, ht, Dt, pt, Je, At, Wt, st, $t, yt, ct;
              const gt = K.state;
              Q = K.next_in, yt = K.input, le = Q + (K.avail_in - 5), ae = K.next_out, ct = K.output, Fe = ae - (F - K.avail_out), Se = ae + (K.avail_out - 257), tt = gt.dmax, ve = gt.wsize, Oe = gt.whave, Et = gt.wnext, et = gt.window, je = gt.hold, at = gt.bits, Bt = gt.lencode, bt = gt.distcode, ht = (1 << gt.lenbits) - 1, Dt = (1 << gt.distbits) - 1;
              e:
                do {
                  at < 15 && (je += yt[Q++] << at, at += 8, je += yt[Q++] << at, at += 8), pt = Bt[je & ht];
                  t:
                    for (; ; ) {
                      if (Je = pt >>> 24, je >>>= Je, at -= Je, Je = pt >>> 16 & 255, Je === 0)
                        ct[ae++] = pt & 65535;
                      else if (Je & 16) {
                        At = pt & 65535, Je &= 15, Je && (at < Je && (je += yt[Q++] << at, at += 8), At += je & (1 << Je) - 1, je >>>= Je, at -= Je), at < 15 && (je += yt[Q++] << at, at += 8, je += yt[Q++] << at, at += 8), pt = bt[je & Dt];
                        r:
                          for (; ; ) {
                            if (Je = pt >>> 24, je >>>= Je, at -= Je, Je = pt >>> 16 & 255, Je & 16) {
                              if (Wt = pt & 65535, Je &= 15, at < Je && (je += yt[Q++] << at, at += 8, at < Je && (je += yt[Q++] << at, at += 8)), Wt += je & (1 << Je) - 1, Wt > tt) {
                                K.msg = "invalid distance too far back", gt.mode = ii;
                                break e;
                              }
                              if (je >>>= Je, at -= Je, Je = ae - Fe, Wt > Je) {
                                if (Je = Wt - Je, Je > Oe && gt.sane) {
                                  K.msg = "invalid distance too far back", gt.mode = ii;
                                  break e;
                                }
                                if (st = 0, $t = et, Et === 0) {
                                  if (st += ve - Je, Je < At) {
                                    At -= Je;
                                    do
                                      ct[ae++] = et[st++];
                                    while (--Je);
                                    st = ae - Wt, $t = ct;
                                  }
                                } else if (Et < Je) {
                                  if (st += ve + Et - Je, Je -= Et, Je < At) {
                                    At -= Je;
                                    do
                                      ct[ae++] = et[st++];
                                    while (--Je);
                                    if (st = 0, Et < At) {
                                      Je = Et, At -= Je;
                                      do
                                        ct[ae++] = et[st++];
                                      while (--Je);
                                      st = ae - Wt, $t = ct;
                                    }
                                  }
                                } else if (st += Et - Je, Je < At) {
                                  At -= Je;
                                  do
                                    ct[ae++] = et[st++];
                                  while (--Je);
                                  st = ae - Wt, $t = ct;
                                }
                                for (; At > 2; )
                                  ct[ae++] = $t[st++], ct[ae++] = $t[st++], ct[ae++] = $t[st++], At -= 3;
                                At && (ct[ae++] = $t[st++], At > 1 && (ct[ae++] = $t[st++]));
                              } else {
                                st = ae - Wt;
                                do
                                  ct[ae++] = ct[st++], ct[ae++] = ct[st++], ct[ae++] = ct[st++], At -= 3;
                                while (At > 2);
                                At && (ct[ae++] = ct[st++], At > 1 && (ct[ae++] = ct[st++]));
                              }
                            } else if (Je & 64) {
                              K.msg = "invalid distance code", gt.mode = ii;
                              break e;
                            } else {
                              pt = bt[(pt & 65535) + (je & (1 << Je) - 1)];
                              continue r;
                            }
                            break;
                          }
                      } else if (Je & 64)
                        if (Je & 32) {
                          gt.mode = ca;
                          break e;
                        } else {
                          K.msg = "invalid literal/length code", gt.mode = ii;
                          break e;
                        }
                      else {
                        pt = Bt[(pt & 65535) + (je & (1 << Je) - 1)];
                        continue t;
                      }
                      break;
                    }
                } while (Q < le && ae < Se);
              At = at >> 3, Q -= At, at -= At << 3, je &= (1 << at) - 1, K.next_in = Q, K.next_out = ae, K.avail_in = Q < le ? 5 + (le - Q) : 5 - (Q - le), K.avail_out = ae < Se ? 257 + (Se - ae) : 257 - (ae - Se), gt.hold = je, gt.bits = at;
            };
            const Lr = 15, Li = 852, Fi = 592, Oi = 0, pi = 1, zi = 2, ua = new Uint16Array([
              /* Length codes 257..285 base */
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              11,
              13,
              15,
              17,
              19,
              23,
              27,
              31,
              35,
              43,
              51,
              59,
              67,
              83,
              99,
              115,
              131,
              163,
              195,
              227,
              258,
              0,
              0
            ]), ha = new Uint8Array([
              /* Length codes 257..285 extra */
              16,
              16,
              16,
              16,
              16,
              16,
              16,
              16,
              17,
              17,
              17,
              17,
              18,
              18,
              18,
              18,
              19,
              19,
              19,
              19,
              20,
              20,
              20,
              20,
              21,
              21,
              21,
              21,
              16,
              72,
              78
            ]), fa = new Uint16Array([
              /* Distance codes 0..29 base */
              1,
              2,
              3,
              4,
              5,
              7,
              9,
              13,
              17,
              25,
              33,
              49,
              65,
              97,
              129,
              193,
              257,
              385,
              513,
              769,
              1025,
              1537,
              2049,
              3073,
              4097,
              6145,
              8193,
              12289,
              16385,
              24577,
              0,
              0
            ]), ma = new Uint8Array([
              /* Distance codes 0..29 extra */
              16,
              16,
              16,
              16,
              17,
              17,
              18,
              18,
              19,
              19,
              20,
              20,
              21,
              21,
              22,
              22,
              23,
              23,
              24,
              24,
              25,
              25,
              26,
              26,
              27,
              27,
              28,
              28,
              29,
              29,
              64,
              64
            ]);
            var Vr = (C, K, F, Q, le, ae, Fe, Se) => {
              const tt = Se.bits;
              let ve = 0, Oe = 0, Et = 0, et = 0, je = 0, at = 0, Bt = 0, bt = 0, ht = 0, Dt = 0, pt, Je, At, Wt, st, $t = null, yt;
              const ct = new Uint16Array(Lr + 1), gt = new Uint16Array(Lr + 1);
              let Ar = null, Tn, ci, di;
              for (ve = 0; ve <= Lr; ve++)
                ct[ve] = 0;
              for (Oe = 0; Oe < Q; Oe++)
                ct[K[F + Oe]]++;
              for (je = tt, et = Lr; et >= 1 && ct[et] === 0; et--)
                ;
              if (je > et && (je = et), et === 0)
                return le[ae++] = 1 << 24 | 64 << 16 | 0, le[ae++] = 1 << 24 | 64 << 16 | 0, Se.bits = 1, 0;
              for (Et = 1; Et < et && ct[Et] === 0; Et++)
                ;
              for (je < Et && (je = Et), bt = 1, ve = 1; ve <= Lr; ve++)
                if (bt <<= 1, bt -= ct[ve], bt < 0)
                  return -1;
              if (bt > 0 && (C === Oi || et !== 1))
                return -1;
              for (gt[1] = 0, ve = 1; ve < Lr; ve++)
                gt[ve + 1] = gt[ve] + ct[ve];
              for (Oe = 0; Oe < Q; Oe++)
                K[F + Oe] !== 0 && (Fe[gt[K[F + Oe]]++] = Oe);
              if (C === Oi ? ($t = Ar = Fe, yt = 20) : C === pi ? ($t = ua, Ar = ha, yt = 257) : ($t = fa, Ar = ma, yt = 0), Dt = 0, Oe = 0, ve = Et, st = ae, at = je, Bt = 0, At = -1, ht = 1 << je, Wt = ht - 1, C === pi && ht > Li || C === zi && ht > Fi)
                return 1;
              for (; ; ) {
                Tn = ve - Bt, Fe[Oe] + 1 < yt ? (ci = 0, di = Fe[Oe]) : Fe[Oe] >= yt ? (ci = Ar[Fe[Oe] - yt], di = $t[Fe[Oe] - yt]) : (ci = 96, di = 0), pt = 1 << ve - Bt, Je = 1 << at, Et = Je;
                do
                  Je -= pt, le[st + (Dt >> Bt) + Je] = Tn << 24 | ci << 16 | di | 0;
                while (Je !== 0);
                for (pt = 1 << ve - 1; Dt & pt; )
                  pt >>= 1;
                if (pt !== 0 ? (Dt &= pt - 1, Dt += pt) : Dt = 0, Oe++, --ct[ve] === 0) {
                  if (ve === et)
                    break;
                  ve = K[F + Fe[Oe]];
                }
                if (ve > je && (Dt & Wt) !== At) {
                  for (Bt === 0 && (Bt = je), st += Et, at = ve - Bt, bt = 1 << at; at + Bt < et && (bt -= ct[at + Bt], !(bt <= 0)); )
                    at++, bt <<= 1;
                  if (ht += 1 << at, C === pi && ht > Li || C === zi && ht > Fi)
                    return 1;
                  At = Dt & Wt, le[At] = je << 24 | at << 16 | st - ae | 0;
                }
              }
              return Dt !== 0 && (le[st + Dt] = ve - Bt << 24 | 64 << 16 | 0), Se.bits = je, 0;
            };
            const pa = 0, Ii = 1, Bi = 2, {
              Z_FINISH: Ri,
              Z_BLOCK: _a,
              Z_TREES: ni,
              Z_OK: Er,
              Z_STREAM_END: ga,
              Z_NEED_DICT: va,
              Z_STREAM_ERROR: qt,
              Z_DATA_ERROR: Pi,
              Z_MEM_ERROR: Ni,
              Z_BUF_ERROR: ba,
              Z_DEFLATED: Ui
            } = be, ai = 16180, Wi = 16181, Gi = 16182, Hi = 16183, Vi = 16184, ji = 16185, Ki = 16186, Yi = 16187, Xi = 16188, Zi = 16189, si = 16190, dr = 16191, gi = 16192, qi = 16193, vi = 16194, Qi = 16195, Ji = 16196, en = 16197, tn = 16198, li = 16199, oi = 16200, rn = 16201, nn = 16202, an = 16203, sn = 16204, ln = 16205, bi = 16206, on = 16207, cn = 16208, Ot = 16209, dn = 16210, un = 16211, ya = 852, xa = 592, wa = 15, hn = (C) => (C >>> 24 & 255) + (C >>> 8 & 65280) + ((C & 65280) << 8) + ((C & 255) << 24);
            function Ea() {
              this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
            }
            const Sr = (C) => {
              if (!C)
                return 1;
              const K = C.state;
              return !K || K.strm !== C || K.mode < ai || K.mode > un ? 1 : 0;
            }, fn = (C) => {
              if (Sr(C))
                return qt;
              const K = C.state;
              return C.total_in = C.total_out = K.total = 0, C.msg = "", K.wrap && (C.adler = K.wrap & 1), K.mode = ai, K.last = 0, K.havedict = 0, K.flags = -1, K.dmax = 32768, K.head = null, K.hold = 0, K.bits = 0, K.lencode = K.lendyn = new Int32Array(ya), K.distcode = K.distdyn = new Int32Array(xa), K.sane = 1, K.back = -1, Er;
            }, mn = (C) => {
              if (Sr(C))
                return qt;
              const K = C.state;
              return K.wsize = 0, K.whave = 0, K.wnext = 0, fn(C);
            }, pn = (C, K) => {
              let F;
              if (Sr(C))
                return qt;
              const Q = C.state;
              return K < 0 ? (F = 0, K = -K) : (F = (K >> 4) + 5, K < 48 && (K &= 15)), K && (K < 8 || K > 15) ? qt : (Q.window !== null && Q.wbits !== K && (Q.window = null), Q.wrap = F, Q.wbits = K, mn(C));
            }, _n = (C, K) => {
              if (!C)
                return qt;
              const F = new Ea();
              C.state = F, F.strm = C, F.window = null, F.mode = ai;
              const Q = pn(C, K);
              return Q !== Er && (C.state = null), Q;
            }, Sa = (C) => _n(C, wa);
            let gn = !0, yi, xi;
            const Aa = (C) => {
              if (gn) {
                yi = new Int32Array(512), xi = new Int32Array(32);
                let K = 0;
                for (; K < 144; )
                  C.lens[K++] = 8;
                for (; K < 256; )
                  C.lens[K++] = 9;
                for (; K < 280; )
                  C.lens[K++] = 7;
                for (; K < 288; )
                  C.lens[K++] = 8;
                for (Vr(Ii, C.lens, 0, 288, yi, 0, C.work, { bits: 9 }), K = 0; K < 32; )
                  C.lens[K++] = 5;
                Vr(Bi, C.lens, 0, 32, xi, 0, C.work, { bits: 5 }), gn = !1;
              }
              C.lencode = yi, C.lenbits = 9, C.distcode = xi, C.distbits = 5;
            }, vn = (C, K, F, Q) => {
              let le;
              const ae = C.state;
              return ae.window === null && (ae.wsize = 1 << ae.wbits, ae.wnext = 0, ae.whave = 0, ae.window = new Uint8Array(ae.wsize)), Q >= ae.wsize ? (ae.window.set(K.subarray(F - ae.wsize, F), 0), ae.wnext = 0, ae.whave = ae.wsize) : (le = ae.wsize - ae.wnext, le > Q && (le = Q), ae.window.set(K.subarray(F - Q, F - Q + le), ae.wnext), Q -= le, Q ? (ae.window.set(K.subarray(F - Q, F), 0), ae.wnext = Q, ae.whave = ae.wsize) : (ae.wnext += le, ae.wnext === ae.wsize && (ae.wnext = 0), ae.whave < ae.wsize && (ae.whave += le))), 0;
            }, Ma = (C, K) => {
              let F, Q, le, ae, Fe, Se, tt, ve, Oe, Et, et, je, at, Bt, bt = 0, ht, Dt, pt, Je, At, Wt, st, $t;
              const yt = new Uint8Array(4);
              let ct, gt;
              const Ar = (
                /* permutation of code lengths */
                new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
              );
              if (Sr(C) || !C.output || !C.input && C.avail_in !== 0)
                return qt;
              F = C.state, F.mode === dr && (F.mode = gi), Fe = C.next_out, le = C.output, tt = C.avail_out, ae = C.next_in, Q = C.input, Se = C.avail_in, ve = F.hold, Oe = F.bits, Et = Se, et = tt, $t = Er;
              e:
                for (; ; )
                  switch (F.mode) {
                    case ai:
                      if (F.wrap === 0) {
                        F.mode = gi;
                        break;
                      }
                      for (; Oe < 16; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      if (F.wrap & 2 && ve === 35615) {
                        F.wbits === 0 && (F.wbits = 15), F.check = 0, yt[0] = ve & 255, yt[1] = ve >>> 8 & 255, F.check = I(F.check, yt, 2, 0), ve = 0, Oe = 0, F.mode = Wi;
                        break;
                      }
                      if (F.head && (F.head.done = !1), !(F.wrap & 1) || /* check if zlib header allowed */
                      (((ve & 255) << 8) + (ve >> 8)) % 31) {
                        C.msg = "incorrect header check", F.mode = Ot;
                        break;
                      }
                      if ((ve & 15) !== Ui) {
                        C.msg = "unknown compression method", F.mode = Ot;
                        break;
                      }
                      if (ve >>>= 4, Oe -= 4, st = (ve & 15) + 8, F.wbits === 0 && (F.wbits = st), st > 15 || st > F.wbits) {
                        C.msg = "invalid window size", F.mode = Ot;
                        break;
                      }
                      F.dmax = 1 << F.wbits, F.flags = 0, C.adler = F.check = 1, F.mode = ve & 512 ? Zi : dr, ve = 0, Oe = 0;
                      break;
                    case Wi:
                      for (; Oe < 16; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      if (F.flags = ve, (F.flags & 255) !== Ui) {
                        C.msg = "unknown compression method", F.mode = Ot;
                        break;
                      }
                      if (F.flags & 57344) {
                        C.msg = "unknown header flags set", F.mode = Ot;
                        break;
                      }
                      F.head && (F.head.text = ve >> 8 & 1), F.flags & 512 && F.wrap & 4 && (yt[0] = ve & 255, yt[1] = ve >>> 8 & 255, F.check = I(F.check, yt, 2, 0)), ve = 0, Oe = 0, F.mode = Gi;
                    case Gi:
                      for (; Oe < 32; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      F.head && (F.head.time = ve), F.flags & 512 && F.wrap & 4 && (yt[0] = ve & 255, yt[1] = ve >>> 8 & 255, yt[2] = ve >>> 16 & 255, yt[3] = ve >>> 24 & 255, F.check = I(F.check, yt, 4, 0)), ve = 0, Oe = 0, F.mode = Hi;
                    case Hi:
                      for (; Oe < 16; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      F.head && (F.head.xflags = ve & 255, F.head.os = ve >> 8), F.flags & 512 && F.wrap & 4 && (yt[0] = ve & 255, yt[1] = ve >>> 8 & 255, F.check = I(F.check, yt, 2, 0)), ve = 0, Oe = 0, F.mode = Vi;
                    case Vi:
                      if (F.flags & 1024) {
                        for (; Oe < 16; ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        F.length = ve, F.head && (F.head.extra_len = ve), F.flags & 512 && F.wrap & 4 && (yt[0] = ve & 255, yt[1] = ve >>> 8 & 255, F.check = I(F.check, yt, 2, 0)), ve = 0, Oe = 0;
                      } else F.head && (F.head.extra = null);
                      F.mode = ji;
                    case ji:
                      if (F.flags & 1024 && (je = F.length, je > Se && (je = Se), je && (F.head && (st = F.head.extra_len - F.length, F.head.extra || (F.head.extra = new Uint8Array(F.head.extra_len)), F.head.extra.set(
                        Q.subarray(
                          ae,
                          // extra field is limited to 65536 bytes
                          // - no need for additional size check
                          ae + je
                        ),
                        /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
                        st
                      )), F.flags & 512 && F.wrap & 4 && (F.check = I(F.check, Q, je, ae)), Se -= je, ae += je, F.length -= je), F.length))
                        break e;
                      F.length = 0, F.mode = Ki;
                    case Ki:
                      if (F.flags & 2048) {
                        if (Se === 0)
                          break e;
                        je = 0;
                        do
                          st = Q[ae + je++], F.head && st && F.length < 65536 && (F.head.name += String.fromCharCode(st));
                        while (st && je < Se);
                        if (F.flags & 512 && F.wrap & 4 && (F.check = I(F.check, Q, je, ae)), Se -= je, ae += je, st)
                          break e;
                      } else F.head && (F.head.name = null);
                      F.length = 0, F.mode = Yi;
                    case Yi:
                      if (F.flags & 4096) {
                        if (Se === 0)
                          break e;
                        je = 0;
                        do
                          st = Q[ae + je++], F.head && st && F.length < 65536 && (F.head.comment += String.fromCharCode(st));
                        while (st && je < Se);
                        if (F.flags & 512 && F.wrap & 4 && (F.check = I(F.check, Q, je, ae)), Se -= je, ae += je, st)
                          break e;
                      } else F.head && (F.head.comment = null);
                      F.mode = Xi;
                    case Xi:
                      if (F.flags & 512) {
                        for (; Oe < 16; ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        if (F.wrap & 4 && ve !== (F.check & 65535)) {
                          C.msg = "header crc mismatch", F.mode = Ot;
                          break;
                        }
                        ve = 0, Oe = 0;
                      }
                      F.head && (F.head.hcrc = F.flags >> 9 & 1, F.head.done = !0), C.adler = F.check = 0, F.mode = dr;
                      break;
                    case Zi:
                      for (; Oe < 32; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      C.adler = F.check = hn(ve), ve = 0, Oe = 0, F.mode = si;
                    case si:
                      if (F.havedict === 0)
                        return C.next_out = Fe, C.avail_out = tt, C.next_in = ae, C.avail_in = Se, F.hold = ve, F.bits = Oe, va;
                      C.adler = F.check = 1, F.mode = dr;
                    case dr:
                      if (K === _a || K === ni)
                        break e;
                    case gi:
                      if (F.last) {
                        ve >>>= Oe & 7, Oe -= Oe & 7, F.mode = bi;
                        break;
                      }
                      for (; Oe < 3; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      switch (F.last = ve & 1, ve >>>= 1, Oe -= 1, ve & 3) {
                        case 0:
                          F.mode = qi;
                          break;
                        case 1:
                          if (Aa(F), F.mode = li, K === ni) {
                            ve >>>= 2, Oe -= 2;
                            break e;
                          }
                          break;
                        case 2:
                          F.mode = Ji;
                          break;
                        case 3:
                          C.msg = "invalid block type", F.mode = Ot;
                      }
                      ve >>>= 2, Oe -= 2;
                      break;
                    case qi:
                      for (ve >>>= Oe & 7, Oe -= Oe & 7; Oe < 32; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      if ((ve & 65535) !== (ve >>> 16 ^ 65535)) {
                        C.msg = "invalid stored block lengths", F.mode = Ot;
                        break;
                      }
                      if (F.length = ve & 65535, ve = 0, Oe = 0, F.mode = vi, K === ni)
                        break e;
                    case vi:
                      F.mode = Qi;
                    case Qi:
                      if (je = F.length, je) {
                        if (je > Se && (je = Se), je > tt && (je = tt), je === 0)
                          break e;
                        le.set(Q.subarray(ae, ae + je), Fe), Se -= je, ae += je, tt -= je, Fe += je, F.length -= je;
                        break;
                      }
                      F.mode = dr;
                      break;
                    case Ji:
                      for (; Oe < 14; ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      if (F.nlen = (ve & 31) + 257, ve >>>= 5, Oe -= 5, F.ndist = (ve & 31) + 1, ve >>>= 5, Oe -= 5, F.ncode = (ve & 15) + 4, ve >>>= 4, Oe -= 4, F.nlen > 286 || F.ndist > 30) {
                        C.msg = "too many length or distance symbols", F.mode = Ot;
                        break;
                      }
                      F.have = 0, F.mode = en;
                    case en:
                      for (; F.have < F.ncode; ) {
                        for (; Oe < 3; ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        F.lens[Ar[F.have++]] = ve & 7, ve >>>= 3, Oe -= 3;
                      }
                      for (; F.have < 19; )
                        F.lens[Ar[F.have++]] = 0;
                      if (F.lencode = F.lendyn, F.lenbits = 7, ct = { bits: F.lenbits }, $t = Vr(pa, F.lens, 0, 19, F.lencode, 0, F.work, ct), F.lenbits = ct.bits, $t) {
                        C.msg = "invalid code lengths set", F.mode = Ot;
                        break;
                      }
                      F.have = 0, F.mode = tn;
                    case tn:
                      for (; F.have < F.nlen + F.ndist; ) {
                        for (; bt = F.lencode[ve & (1 << F.lenbits) - 1], ht = bt >>> 24, Dt = bt >>> 16 & 255, pt = bt & 65535, !(ht <= Oe); ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        if (pt < 16)
                          ve >>>= ht, Oe -= ht, F.lens[F.have++] = pt;
                        else {
                          if (pt === 16) {
                            for (gt = ht + 2; Oe < gt; ) {
                              if (Se === 0)
                                break e;
                              Se--, ve += Q[ae++] << Oe, Oe += 8;
                            }
                            if (ve >>>= ht, Oe -= ht, F.have === 0) {
                              C.msg = "invalid bit length repeat", F.mode = Ot;
                              break;
                            }
                            st = F.lens[F.have - 1], je = 3 + (ve & 3), ve >>>= 2, Oe -= 2;
                          } else if (pt === 17) {
                            for (gt = ht + 3; Oe < gt; ) {
                              if (Se === 0)
                                break e;
                              Se--, ve += Q[ae++] << Oe, Oe += 8;
                            }
                            ve >>>= ht, Oe -= ht, st = 0, je = 3 + (ve & 7), ve >>>= 3, Oe -= 3;
                          } else {
                            for (gt = ht + 7; Oe < gt; ) {
                              if (Se === 0)
                                break e;
                              Se--, ve += Q[ae++] << Oe, Oe += 8;
                            }
                            ve >>>= ht, Oe -= ht, st = 0, je = 11 + (ve & 127), ve >>>= 7, Oe -= 7;
                          }
                          if (F.have + je > F.nlen + F.ndist) {
                            C.msg = "invalid bit length repeat", F.mode = Ot;
                            break;
                          }
                          for (; je--; )
                            F.lens[F.have++] = st;
                        }
                      }
                      if (F.mode === Ot)
                        break;
                      if (F.lens[256] === 0) {
                        C.msg = "invalid code -- missing end-of-block", F.mode = Ot;
                        break;
                      }
                      if (F.lenbits = 9, ct = { bits: F.lenbits }, $t = Vr(Ii, F.lens, 0, F.nlen, F.lencode, 0, F.work, ct), F.lenbits = ct.bits, $t) {
                        C.msg = "invalid literal/lengths set", F.mode = Ot;
                        break;
                      }
                      if (F.distbits = 6, F.distcode = F.distdyn, ct = { bits: F.distbits }, $t = Vr(Bi, F.lens, F.nlen, F.ndist, F.distcode, 0, F.work, ct), F.distbits = ct.bits, $t) {
                        C.msg = "invalid distances set", F.mode = Ot;
                        break;
                      }
                      if (F.mode = li, K === ni)
                        break e;
                    case li:
                      F.mode = oi;
                    case oi:
                      if (Se >= 6 && tt >= 258) {
                        C.next_out = Fe, C.avail_out = tt, C.next_in = ae, C.avail_in = Se, F.hold = ve, F.bits = Oe, da(C, et), Fe = C.next_out, le = C.output, tt = C.avail_out, ae = C.next_in, Q = C.input, Se = C.avail_in, ve = F.hold, Oe = F.bits, F.mode === dr && (F.back = -1);
                        break;
                      }
                      for (F.back = 0; bt = F.lencode[ve & (1 << F.lenbits) - 1], ht = bt >>> 24, Dt = bt >>> 16 & 255, pt = bt & 65535, !(ht <= Oe); ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      if (Dt && !(Dt & 240)) {
                        for (Je = ht, At = Dt, Wt = pt; bt = F.lencode[Wt + ((ve & (1 << Je + At) - 1) >> Je)], ht = bt >>> 24, Dt = bt >>> 16 & 255, pt = bt & 65535, !(Je + ht <= Oe); ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        ve >>>= Je, Oe -= Je, F.back += Je;
                      }
                      if (ve >>>= ht, Oe -= ht, F.back += ht, F.length = pt, Dt === 0) {
                        F.mode = ln;
                        break;
                      }
                      if (Dt & 32) {
                        F.back = -1, F.mode = dr;
                        break;
                      }
                      if (Dt & 64) {
                        C.msg = "invalid literal/length code", F.mode = Ot;
                        break;
                      }
                      F.extra = Dt & 15, F.mode = rn;
                    case rn:
                      if (F.extra) {
                        for (gt = F.extra; Oe < gt; ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        F.length += ve & (1 << F.extra) - 1, ve >>>= F.extra, Oe -= F.extra, F.back += F.extra;
                      }
                      F.was = F.length, F.mode = nn;
                    case nn:
                      for (; bt = F.distcode[ve & (1 << F.distbits) - 1], ht = bt >>> 24, Dt = bt >>> 16 & 255, pt = bt & 65535, !(ht <= Oe); ) {
                        if (Se === 0)
                          break e;
                        Se--, ve += Q[ae++] << Oe, Oe += 8;
                      }
                      if (!(Dt & 240)) {
                        for (Je = ht, At = Dt, Wt = pt; bt = F.distcode[Wt + ((ve & (1 << Je + At) - 1) >> Je)], ht = bt >>> 24, Dt = bt >>> 16 & 255, pt = bt & 65535, !(Je + ht <= Oe); ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        ve >>>= Je, Oe -= Je, F.back += Je;
                      }
                      if (ve >>>= ht, Oe -= ht, F.back += ht, Dt & 64) {
                        C.msg = "invalid distance code", F.mode = Ot;
                        break;
                      }
                      F.offset = pt, F.extra = Dt & 15, F.mode = an;
                    case an:
                      if (F.extra) {
                        for (gt = F.extra; Oe < gt; ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        F.offset += ve & (1 << F.extra) - 1, ve >>>= F.extra, Oe -= F.extra, F.back += F.extra;
                      }
                      if (F.offset > F.dmax) {
                        C.msg = "invalid distance too far back", F.mode = Ot;
                        break;
                      }
                      F.mode = sn;
                    case sn:
                      if (tt === 0)
                        break e;
                      if (je = et - tt, F.offset > je) {
                        if (je = F.offset - je, je > F.whave && F.sane) {
                          C.msg = "invalid distance too far back", F.mode = Ot;
                          break;
                        }
                        je > F.wnext ? (je -= F.wnext, at = F.wsize - je) : at = F.wnext - je, je > F.length && (je = F.length), Bt = F.window;
                      } else
                        Bt = le, at = Fe - F.offset, je = F.length;
                      je > tt && (je = tt), tt -= je, F.length -= je;
                      do
                        le[Fe++] = Bt[at++];
                      while (--je);
                      F.length === 0 && (F.mode = oi);
                      break;
                    case ln:
                      if (tt === 0)
                        break e;
                      le[Fe++] = F.length, tt--, F.mode = oi;
                      break;
                    case bi:
                      if (F.wrap) {
                        for (; Oe < 32; ) {
                          if (Se === 0)
                            break e;
                          Se--, ve |= Q[ae++] << Oe, Oe += 8;
                        }
                        if (et -= tt, C.total_out += et, F.total += et, F.wrap & 4 && et && (C.adler = F.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
                        F.flags ? I(F.check, le, et, Fe - et) : $e(F.check, le, et, Fe - et)), et = tt, F.wrap & 4 && (F.flags ? ve : hn(ve)) !== F.check) {
                          C.msg = "incorrect data check", F.mode = Ot;
                          break;
                        }
                        ve = 0, Oe = 0;
                      }
                      F.mode = on;
                    case on:
                      if (F.wrap && F.flags) {
                        for (; Oe < 32; ) {
                          if (Se === 0)
                            break e;
                          Se--, ve += Q[ae++] << Oe, Oe += 8;
                        }
                        if (F.wrap & 4 && ve !== (F.total & 4294967295)) {
                          C.msg = "incorrect length check", F.mode = Ot;
                          break;
                        }
                        ve = 0, Oe = 0;
                      }
                      F.mode = cn;
                    case cn:
                      $t = ga;
                      break e;
                    case Ot:
                      $t = Pi;
                      break e;
                    case dn:
                      return Ni;
                    case un:
                    default:
                      return qt;
                  }
              return C.next_out = Fe, C.avail_out = tt, C.next_in = ae, C.avail_in = Se, F.hold = ve, F.bits = Oe, (F.wsize || et !== C.avail_out && F.mode < Ot && (F.mode < bi || K !== Ri)) && vn(C, C.output, C.next_out, et - C.avail_out), Et -= C.avail_in, et -= C.avail_out, C.total_in += Et, C.total_out += et, F.total += et, F.wrap & 4 && et && (C.adler = F.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
              F.flags ? I(F.check, le, et, C.next_out - et) : $e(F.check, le, et, C.next_out - et)), C.data_type = F.bits + (F.last ? 64 : 0) + (F.mode === dr ? 128 : 0) + (F.mode === li || F.mode === vi ? 256 : 0), (Et === 0 && et === 0 || K === Ri) && $t === Er && ($t = ba), $t;
            }, Da = (C) => {
              if (Sr(C))
                return qt;
              let K = C.state;
              return K.window && (K.window = null), C.state = null, Er;
            }, Ca = (C, K) => {
              if (Sr(C))
                return qt;
              const F = C.state;
              return F.wrap & 2 ? (F.head = K, K.done = !1, Er) : qt;
            }, $a = (C, K) => {
              const F = K.length;
              let Q, le, ae;
              return Sr(C) || (Q = C.state, Q.wrap !== 0 && Q.mode !== si) ? qt : Q.mode === si && (le = 1, le = $e(le, K, F, 0), le !== Q.check) ? Pi : (ae = vn(C, K, F, F), ae ? (Q.mode = dn, Ni) : (Q.havedict = 1, Er));
            };
            var Ta = mn, ka = pn, La = fn, Fa = Sa, Oa = _n, za = Ma, Ia = Da, Ba = Ca, Ra = $a, Pa = "pako inflate (from Nodeca project)", ur = {
              inflateReset: Ta,
              inflateReset2: ka,
              inflateResetKeep: La,
              inflateInit: Fa,
              inflateInit2: Oa,
              inflate: za,
              inflateEnd: Ia,
              inflateGetHeader: Ba,
              inflateSetDictionary: Ra,
              inflateInfo: Pa
            };
            function Na() {
              this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
            }
            var Ua = Na;
            const bn = Object.prototype.toString, {
              Z_NO_FLUSH: Wa,
              Z_FINISH: Ga,
              Z_OK: jr,
              Z_STREAM_END: wi,
              Z_NEED_DICT: Ei,
              Z_STREAM_ERROR: Ha,
              Z_DATA_ERROR: yn,
              Z_MEM_ERROR: Va
            } = be;
            function Kr(C) {
              this.options = ti.assign({
                chunkSize: 65536,
                windowBits: 15,
                to: ""
              }, C || {});
              const K = this.options;
              K.raw && K.windowBits >= 0 && K.windowBits < 16 && (K.windowBits = -K.windowBits, K.windowBits === 0 && (K.windowBits = -15)), K.windowBits >= 0 && K.windowBits < 16 && !(C && C.windowBits) && (K.windowBits += 32), K.windowBits > 15 && K.windowBits < 48 && (K.windowBits & 15 || (K.windowBits |= 15)), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new Ti(), this.strm.avail_out = 0;
              let F = ur.inflateInit2(
                this.strm,
                K.windowBits
              );
              if (F !== jr)
                throw new Error(xe[F]);
              if (this.header = new Ua(), ur.inflateGetHeader(this.strm, this.header), K.dictionary && (typeof K.dictionary == "string" ? K.dictionary = Gr.string2buf(K.dictionary) : bn.call(K.dictionary) === "[object ArrayBuffer]" && (K.dictionary = new Uint8Array(K.dictionary)), K.raw && (F = ur.inflateSetDictionary(this.strm, K.dictionary), F !== jr)))
                throw new Error(xe[F]);
            }
            Kr.prototype.push = function(C, K) {
              const F = this.strm, Q = this.options.chunkSize, le = this.options.dictionary;
              let ae, Fe, Se;
              if (this.ended) return !1;
              for (K === ~~K ? Fe = K : Fe = K === !0 ? Ga : Wa, bn.call(C) === "[object ArrayBuffer]" ? F.input = new Uint8Array(C) : F.input = C, F.next_in = 0, F.avail_in = F.input.length; ; ) {
                for (F.avail_out === 0 && (F.output = new Uint8Array(Q), F.next_out = 0, F.avail_out = Q), ae = ur.inflate(F, Fe), ae === Ei && le && (ae = ur.inflateSetDictionary(F, le), ae === jr ? ae = ur.inflate(F, Fe) : ae === yn && (ae = Ei)); F.avail_in > 0 && ae === wi && F.state.wrap > 0 && C[F.next_in] !== 0; )
                  ur.inflateReset(F), ae = ur.inflate(F, Fe);
                switch (ae) {
                  case Ha:
                  case yn:
                  case Ei:
                  case Va:
                    return this.onEnd(ae), this.ended = !0, !1;
                }
                if (Se = F.avail_out, F.next_out && (F.avail_out === 0 || ae === wi))
                  if (this.options.to === "string") {
                    let tt = Gr.utf8border(F.output, F.next_out), ve = F.next_out - tt, Oe = Gr.buf2string(F.output, tt);
                    F.next_out = ve, F.avail_out = Q - ve, ve && F.output.set(F.output.subarray(tt, tt + ve), 0), this.onData(Oe);
                  } else
                    this.onData(F.output.length === F.next_out ? F.output : F.output.subarray(0, F.next_out));
                if (!(ae === jr && Se === 0)) {
                  if (ae === wi)
                    return ae = ur.inflateEnd(this.strm), this.onEnd(ae), this.ended = !0, !0;
                  if (F.avail_in === 0) break;
                }
              }
              return !0;
            }, Kr.prototype.onData = function(C) {
              this.chunks.push(C);
            }, Kr.prototype.onEnd = function(C) {
              C === jr && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = ti.flattenChunks(this.chunks)), this.chunks = [], this.err = C, this.msg = this.strm.msg;
            };
            function Si(C, K) {
              const F = new Kr(K);
              if (F.push(C), F.err) throw F.msg || xe[F.err];
              return F.result;
            }
            function ja(C, K) {
              return K = K || {}, K.raw = !0, Si(C, K);
            }
            var Ka = Kr, Ya = Si, Xa = ja, Za = Si, qa = be, Qa = {
              Inflate: Ka,
              inflate: Ya,
              inflateRaw: Xa,
              ungzip: Za,
              constants: qa
            };
            const { Deflate: Ja, deflate: es, deflateRaw: ts, gzip: rs } = oa, { Inflate: is, inflate: ns, inflateRaw: as, ungzip: ss } = Qa;
            var xn = Ja, wn = es, En = ts, Sn = rs, An = is, Mn = ns, Dn = as, Cn = ss, $n = be, ls = {
              Deflate: xn,
              deflate: wn,
              deflateRaw: En,
              gzip: Sn,
              Inflate: An,
              inflate: Mn,
              inflateRaw: Dn,
              ungzip: Cn,
              constants: $n
            };
          }
        )
        /******/
      }, __webpack_module_cache__ = {};
      function __webpack_require__(n) {
        var e = __webpack_module_cache__[n];
        if (e !== void 0)
          return e.exports;
        var t = __webpack_module_cache__[n] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        return __webpack_modules__[n].call(t.exports, t, t.exports, __webpack_require__), t.exports;
      }
      __webpack_require__.n = (n) => {
        var e = n && n.__esModule ? (
          /******/
          () => n.default
        ) : (
          /******/
          () => n
        );
        return __webpack_require__.d(e, { a: e }), e;
      }, __webpack_require__.d = (n, e) => {
        for (var t in e)
          __webpack_require__.o(e, t) && !__webpack_require__.o(n, t) && Object.defineProperty(n, t, { enumerable: !0, get: e[t] });
      }, __webpack_require__.o = (n, e) => Object.prototype.hasOwnProperty.call(n, e), __webpack_require__.r = (n) => {
        typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(n, "__esModule", { value: !0 });
      }, __webpack_require__("./src/index.ts"), __webpack_require__("./src/SurfaceWorker.js");
      var __webpack_exports__ = __webpack_require__("./src/exporter.js");
      return __webpack_exports__;
    })()
  ));
})(_3Dmol$1);
var _3DmolExports = _3Dmol$1.exports;
const _3Dmol = /* @__PURE__ */ getDefaultExportFromCjs(_3DmolExports), mol = /* @__PURE__ */ _mergeNamespaces({
  __proto__: null,
  default: _3Dmol
}, [_3DmolExports]), {
  SvelteComponent: SvelteComponent$b,
  add_render_callback,
  append_hydration: append_hydration$8,
  attr: attr$8,
  binding_callbacks: binding_callbacks$3,
  children: children$8,
  claim_element: claim_element$7,
  claim_space: claim_space$8,
  claim_svg_element: claim_svg_element$3,
  claim_text: claim_text$4,
  create_in_transition,
  destroy_each: destroy_each$2,
  detach: detach$b,
  element: element$7,
  ensure_array_like: ensure_array_like$2,
  get_svelte_dataset: get_svelte_dataset$2,
  init: init$b,
  insert_hydration: insert_hydration$b,
  listen: listen$2,
  noop: noop$7,
  null_to_empty,
  run_all: run_all$2,
  safe_not_equal: safe_not_equal$b,
  select_option,
  select_value,
  set_data: set_data$3,
  set_input_value: set_input_value$1,
  set_style: set_style$4,
  space: space$8,
  svg_element: svg_element$3,
  text: text$4,
  toggle_class: toggle_class$5,
  transition_in: transition_in$7
} = window.__gradio__svelte__internal, { onMount: onMount$2, beforeUpdate } = window.__gradio__svelte__internal;
function get_each_context$2(n, e, t) {
  const r = n.slice();
  return r[58] = e[t], r[59] = e, r[60] = t, r;
}
function get_each_context_1$1(n, e, t) {
  const r = n.slice();
  return r[61] = e[t], r[63] = t, r;
}
function get_each_context_2(n, e, t) {
  const r = n.slice();
  return r[64] = e[t], r[65] = e, r[66] = t, r;
}
function get_each_context_3(n, e, t) {
  const r = n.slice();
  return r[67] = e[t], r;
}
function create_if_block_9$1(n) {
  let e, t, r, a, l = " ", h, c, d, _, m, y, x, b = " ", A, f, s, u, p, g, w, o = " ", v, M, E, $, k, L, z, O = " ", R, N, W, B;
  return {
    c() {
      e = element$7("div"), t = element$7("div"), r = element$7("div"), a = element$7("span"), a.textContent = l, h = element$7("span"), c = text$4("Very high ("), d = text$4(
        /*confidenceLabel*/
        n[2]
      ), _ = text$4(" > 90)"), m = space$8(), y = element$7("div"), x = element$7("span"), x.textContent = b, A = element$7("span"), f = text$4("Confident (90 > "), s = text$4(
        /*confidenceLabel*/
        n[2]
      ), u = text$4(" > 70)"), p = space$8(), g = element$7("div"), w = element$7("span"), w.textContent = o, v = element$7("span"), M = text$4("Low (70 > "), E = text$4(
        /*confidenceLabel*/
        n[2]
      ), $ = text$4(" > 50)"), k = space$8(), L = element$7("div"), z = element$7("span"), z.textContent = O, R = element$7("span"), N = text$4("Very low ("), W = text$4(
        /*confidenceLabel*/
        n[2]
      ), B = text$4(" < 50)"), this.h();
    },
    l(P) {
      e = claim_element$7(P, "DIV", { class: !0 });
      var G = children$8(e);
      t = claim_element$7(G, "DIV", { class: !0 });
      var H = children$8(t);
      r = claim_element$7(H, "DIV", { class: !0 });
      var U = children$8(r);
      a = claim_element$7(U, "SPAN", {
        class: !0,
        style: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(a) !== "svelte-z3k9fb" && (a.textContent = l), h = claim_element$7(U, "SPAN", { class: !0 });
      var j = children$8(h);
      c = claim_text$4(j, "Very high ("), d = claim_text$4(
        j,
        /*confidenceLabel*/
        n[2]
      ), _ = claim_text$4(j, " > 90)"), j.forEach(detach$b), U.forEach(detach$b), m = claim_space$8(H), y = claim_element$7(H, "DIV", { class: !0 });
      var re = children$8(y);
      x = claim_element$7(re, "SPAN", {
        class: !0,
        style: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(x) !== "svelte-sel3h7" && (x.textContent = b), A = claim_element$7(re, "SPAN", { class: !0 });
      var ie = children$8(A);
      f = claim_text$4(ie, "Confident (90 > "), s = claim_text$4(
        ie,
        /*confidenceLabel*/
        n[2]
      ), u = claim_text$4(ie, " > 70)"), ie.forEach(detach$b), re.forEach(detach$b), p = claim_space$8(H), g = claim_element$7(H, "DIV", { class: !0 });
      var te = children$8(g);
      w = claim_element$7(te, "SPAN", {
        class: !0,
        style: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(w) !== "svelte-13r2awx" && (w.textContent = o), v = claim_element$7(te, "SPAN", { class: !0 });
      var ue = children$8(v);
      M = claim_text$4(ue, "Low (70 > "), E = claim_text$4(
        ue,
        /*confidenceLabel*/
        n[2]
      ), $ = claim_text$4(ue, " > 50)"), ue.forEach(detach$b), te.forEach(detach$b), k = claim_space$8(H), L = claim_element$7(H, "DIV", { class: !0 });
      var de = children$8(L);
      z = claim_element$7(de, "SPAN", {
        class: !0,
        style: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(z) !== "svelte-gwtl5e" && (z.textContent = O), R = claim_element$7(de, "SPAN", { class: !0 });
      var oe = children$8(R);
      N = claim_text$4(oe, "Very low ("), W = claim_text$4(
        oe,
        /*confidenceLabel*/
        n[2]
      ), B = claim_text$4(oe, " < 50)"), oe.forEach(detach$b), de.forEach(detach$b), H.forEach(detach$b), G.forEach(detach$b), this.h();
    },
    h() {
      attr$8(a, "class", "w-4 h-4 svelte-1skivl7"), set_style$4(a, "background-color", "rgb(0, 83, 214)"), attr$8(h, "class", "legendlabel svelte-1skivl7"), attr$8(r, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(x, "class", "w-4 h-4 svelte-1skivl7"), set_style$4(x, "background-color", "rgb(101, 203, 243)"), attr$8(A, "class", "legendlabel svelte-1skivl7"), attr$8(y, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(w, "class", "w-4 h-4 svelte-1skivl7"), set_style$4(w, "background-color", "rgb(255, 219, 19)"), attr$8(v, "class", "legendlabel svelte-1skivl7"), attr$8(g, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(z, "class", "w-4 h-4 svelte-1skivl7"), set_style$4(z, "background-color", "rgb(255, 125, 69)"), attr$8(R, "class", "legendlabel svelte-1skivl7"), attr$8(L, "class", "flex space-x-1 py-1 items-center svelte-1skivl7"), attr$8(t, "class", "flex text-sm items-center space-x-2 justify-center svelte-1skivl7"), attr$8(e, "class", "absolute bottom-0 left-0 z-50 p-2 -mb-2 w-full bg-white svelte-1skivl7");
    },
    m(P, G) {
      insert_hydration$b(P, e, G), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(r, a), append_hydration$8(r, h), append_hydration$8(h, c), append_hydration$8(h, d), append_hydration$8(h, _), append_hydration$8(t, m), append_hydration$8(t, y), append_hydration$8(y, x), append_hydration$8(y, A), append_hydration$8(A, f), append_hydration$8(A, s), append_hydration$8(A, u), append_hydration$8(t, p), append_hydration$8(t, g), append_hydration$8(g, w), append_hydration$8(g, v), append_hydration$8(v, M), append_hydration$8(v, E), append_hydration$8(v, $), append_hydration$8(t, k), append_hydration$8(t, L), append_hydration$8(L, z), append_hydration$8(L, R), append_hydration$8(R, N), append_hydration$8(R, W), append_hydration$8(R, B);
    },
    p(P, G) {
      G[0] & /*confidenceLabel*/
      4 && set_data$3(
        d,
        /*confidenceLabel*/
        P[2]
      ), G[0] & /*confidenceLabel*/
      4 && set_data$3(
        s,
        /*confidenceLabel*/
        P[2]
      ), G[0] & /*confidenceLabel*/
      4 && set_data$3(
        E,
        /*confidenceLabel*/
        P[2]
      ), G[0] & /*confidenceLabel*/
      4 && set_data$3(
        W,
        /*confidenceLabel*/
        P[2]
      );
    },
    d(P) {
      P && detach$b(e);
    }
  };
}
function create_if_block_8$1(n) {
  let e, t = '<div class="flex text-sm items-center space-x-2 justify-center svelte-1skivl7"><div class="flex space-x-1 py-1 items-center svelte-1skivl7"><a class="cursor-pointer svelte-1skivl7" href="https://pubmed.ncbi.nlm.nih.gov/7108955/">Kyte &amp; Doolittle hydrophobicity scale:</a></div> <div class="flex space-x-1 py-1 items-center svelte-1skivl7"><span class="w-4 h-4 svelte-1skivl7" style="background-color: #B8860B;"> </span><span class="legendlabel svelte-1skivl7">Hydrophobic</span></div> <div class="flex space-x-1 py-1 items-center svelte-1skivl7"><span class="w-4 h-4 border border-gray-300 svelte-1skivl7" style="background-color: white"> </span><span class="legendlabel svelte-1skivl7">Neutral</span></div> <div class="flex space-x-1 py-1 items-center svelte-1skivl7"><span class="w-4 h-4 svelte-1skivl7" style="background-color: darkcyan;"> </span><span class="legendlabel svelte-1skivl7">Hydrophilic</span></div></div>';
  return {
    c() {
      e = element$7("div"), e.innerHTML = t, this.h();
    },
    l(r) {
      e = claim_element$7(r, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(e) !== "svelte-n84ddp" && (e.innerHTML = t), this.h();
    },
    h() {
      attr$8(e, "class", "absolute bottom-0 left-0 z-50 p-2 mb-2 w-full bg-white svelte-1skivl7");
    },
    m(r, a) {
      insert_hydration$b(r, e, a);
    },
    d(r) {
      r && detach$b(e);
    }
  };
}
function create_if_block_6$1(n) {
  let e;
  function t(l, h) {
    return (
      /*isAnimated*/
      l[10] ? create_else_block$6 : create_if_block_7$1
    );
  }
  let r = t(n), a = r(n);
  return {
    c() {
      e = element$7("div"), a.c(), this.h();
    },
    l(l) {
      e = claim_element$7(l, "DIV", { class: !0 });
      var h = children$8(e);
      a.l(h), h.forEach(detach$b), this.h();
    },
    h() {
      attr$8(e, "class", "absolute z-50 bottom-0 right-0 mr-2 flex divide-x border border-gray-200 mb-2 rounded items-center justify-center svelte-1skivl7");
    },
    m(l, h) {
      insert_hydration$b(l, e, h), a.m(e, null);
    },
    p(l, h) {
      r === (r = t(l)) && a ? a.p(l, h) : (a.d(1), a = r(l), a && (a.c(), a.m(e, null)));
    },
    d(l) {
      l && detach$b(e), a.d();
    }
  };
}
function create_else_block$6(n) {
  let e, t = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-4 h-4 text-gray-500 hover:text-orange-600 cursor-pointer svelte-1skivl7"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z" class="svelte-1skivl7"></path></svg>', r, a;
  return {
    c() {
      e = element$7("button"), e.innerHTML = t, this.h();
    },
    l(l) {
      e = claim_element$7(l, "BUTTON", {
        class: !0,
        title: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(e) !== "svelte-jyx1zx" && (e.innerHTML = t), this.h();
    },
    h() {
      attr$8(e, "class", "p-2 svelte-1skivl7"), attr$8(e, "title", "Pause");
    },
    m(l, h) {
      insert_hydration$b(l, e, h), r || (a = listen$2(
        e,
        "click",
        /*toggleAnimation*/
        n[20]
      ), r = !0);
    },
    p: noop$7,
    d(l) {
      l && detach$b(e), r = !1, a();
    }
  };
}
function create_if_block_7$1(n) {
  let e, t = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-4 h-4 text-gray-500 hover:text-orange-600 cursor-pointer svelte-1skivl7"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z" class="svelte-1skivl7"></path></svg>', r, a;
  return {
    c() {
      e = element$7("button"), e.innerHTML = t, this.h();
    },
    l(l) {
      e = claim_element$7(l, "BUTTON", {
        class: !0,
        title: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(e) !== "svelte-y25go4" && (e.innerHTML = t), this.h();
    },
    h() {
      attr$8(e, "class", "p-2 svelte-1skivl7"), attr$8(e, "title", "Play");
    },
    m(l, h) {
      insert_hydration$b(l, e, h), r || (a = listen$2(
        e,
        "click",
        /*toggleAnimation*/
        n[20]
      ), r = !0);
    },
    p: noop$7,
    d(l) {
      l && detach$b(e), r = !1, a();
    }
  };
}
function create_if_block_2$3(n) {
  let e, t, r, a = "Settings", l, h, c = '<svg aria-hidden="true" class="w-5 h-5 svelte-1skivl7" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" class="svelte-1skivl7"></path></svg> <span class="sr-only svelte-1skivl7">Close menu</span>', d, _, m, y, x, b = "Label atoms on hover", A, f, s, u, p, g, w, o = ensure_array_like$2(Object.keys(
    /*config*/
    n[0]
  )), v = [];
  for (let M = 0; M < o.length; M += 1)
    v[M] = create_each_block_2(get_each_context_2(n, o, M));
  return {
    c() {
      e = element$7("div"), t = element$7("div"), r = element$7("h5"), r.textContent = a, l = space$8(), h = element$7("button"), h.innerHTML = c, d = space$8();
      for (let M = 0; M < v.length; M += 1)
        v[M].c();
      _ = space$8(), m = element$7("div"), y = element$7("div"), x = element$7("label"), x.textContent = b, A = space$8(), f = element$7("label"), s = element$7("input"), u = space$8(), p = element$7("div"), this.h();
    },
    l(M) {
      e = claim_element$7(M, "DIV", {
        id: !0,
        class: !0,
        tabindex: !0,
        "aria-labelledby": !0
      });
      var E = children$8(e);
      t = claim_element$7(E, "DIV", { class: !0 });
      var $ = children$8(t);
      r = claim_element$7($, "H5", {
        id: !0,
        class: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(r) !== "svelte-17gte" && (r.textContent = a), l = claim_space$8($), h = claim_element$7($, "BUTTON", {
        type: !0,
        "data-drawer-hide": !0,
        "aria-controls": !0,
        class: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(h) !== "svelte-1qzp5va" && (h.innerHTML = c), $.forEach(detach$b), d = claim_space$8(E);
      for (let O = 0; O < v.length; O += 1)
        v[O].l(E);
      _ = claim_space$8(E), m = claim_element$7(E, "DIV", { class: !0 });
      var k = children$8(m);
      y = claim_element$7(k, "DIV", { class: !0 });
      var L = children$8(y);
      x = claim_element$7(L, "LABEL", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(x) !== "svelte-1l09ghj" && (x.textContent = b), A = claim_space$8(L), f = claim_element$7(L, "LABEL", { class: !0 });
      var z = children$8(f);
      s = claim_element$7(z, "INPUT", { type: !0, class: !0 }), u = claim_space$8(z), p = claim_element$7(z, "DIV", { class: !0 }), children$8(p).forEach(detach$b), z.forEach(detach$b), L.forEach(detach$b), k.forEach(detach$b), E.forEach(detach$b), this.h();
    },
    h() {
      attr$8(r, "id", "settings-drawer-label"), attr$8(r, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1skivl7"), attr$8(h, "type", "button"), attr$8(h, "data-drawer-hide", "drawer-example"), attr$8(h, "aria-controls", "drawer-example"), attr$8(h, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1skivl7"), attr$8(t, "class", "p-4 svelte-1skivl7"), attr$8(x, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1skivl7"), attr$8(s, "type", "checkbox"), attr$8(s, "class", "sr-only peer svelte-1skivl7"), attr$8(p, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(f, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1skivl7"), attr$8(y, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1skivl7"), attr$8(m, "class", "bg-white svelte-1skivl7"), attr$8(e, "id", "settings-drawer"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 svelte-1skivl7"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "settings-drawer-label");
    },
    m(M, E) {
      insert_hydration$b(M, e, E), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(t, l), append_hydration$8(t, h), append_hydration$8(e, d);
      for (let $ = 0; $ < v.length; $ += 1)
        v[$] && v[$].m(e, null);
      append_hydration$8(e, _), append_hydration$8(e, m), append_hydration$8(m, y), append_hydration$8(y, x), append_hydration$8(y, A), append_hydration$8(y, f), append_hydration$8(f, s), set_input_value$1(
        s,
        /*labelHover*/
        n[5]
      ), append_hydration$8(f, u), append_hydration$8(f, p), g || (w = [
        listen$2(
          h,
          "click",
          /*toggleOffCanvas*/
          n[15]
        ),
        listen$2(
          s,
          "change",
          /*input_change_handler_1*/
          n[26]
        )
      ], g = !0);
    },
    p(M, E) {
      if (E[0] & /*config, settings*/
      8193) {
        o = ensure_array_like$2(Object.keys(
          /*config*/
          M[0]
        ));
        let $;
        for ($ = 0; $ < o.length; $ += 1) {
          const k = get_each_context_2(M, o, $);
          v[$] ? v[$].p(k, E) : (v[$] = create_each_block_2(k), v[$].c(), v[$].m(e, _));
        }
        for (; $ < v.length; $ += 1)
          v[$].d(1);
        v.length = o.length;
      }
      E[0] & /*labelHover*/
      32 && set_input_value$1(
        s,
        /*labelHover*/
        M[5]
      );
    },
    d(M) {
      M && detach$b(e), destroy_each$2(v, M), g = !1, run_all$2(w);
    }
  };
}
function create_if_block_5$1(n) {
  let e, t, r, a, l, h;
  function c() {
    n[23].call(
      t,
      /*setting*/
      n[64]
    );
  }
  return {
    c() {
      e = element$7("label"), t = element$7("input"), r = space$8(), a = element$7("div"), this.h();
    },
    l(d) {
      e = claim_element$7(d, "LABEL", { class: !0 });
      var _ = children$8(e);
      t = claim_element$7(_, "INPUT", { type: !0, class: !0 }), r = claim_space$8(_), a = claim_element$7(_, "DIV", { class: !0 }), children$8(a).forEach(detach$b), _.forEach(detach$b), this.h();
    },
    h() {
      attr$8(t, "type", "checkbox"), t.__value = "", set_input_value$1(t, t.__value), attr$8(t, "class", "sr-only peer svelte-1skivl7"), attr$8(a, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(e, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center justify-center svelte-1skivl7");
    },
    m(d, _) {
      insert_hydration$b(d, e, _), append_hydration$8(e, t), t.checked = /*config*/
      n[0][
        /*setting*/
        n[64]
      ], append_hydration$8(e, r), append_hydration$8(e, a), l || (h = listen$2(t, "change", c), l = !0);
    },
    p(d, _) {
      n = d, _[0] & /*config, settings*/
      8193 && (t.checked = /*config*/
      n[0][
        /*setting*/
        n[64]
      ]);
    },
    d(d) {
      d && detach$b(e), l = !1, h();
    }
  };
}
function create_if_block_4$1(n) {
  let e, t, r, a, l, h, c, d, _ = (
    /*config*/
    n[0][
      /*setting*/
      n[64]
    ] + ""
  ), m, y, x;
  function b() {
    return (
      /*change_handler*/
      n[24](
        /*setting*/
        n[64]
      )
    );
  }
  return {
    c() {
      e = element$7("div"), t = element$7("input"), c = space$8(), d = element$7("span"), m = text$4(_), this.h();
    },
    l(A) {
      e = claim_element$7(A, "DIV", { class: !0 });
      var f = children$8(e);
      t = claim_element$7(f, "INPUT", {
        id: !0,
        type: !0,
        min: !0,
        max: !0,
        step: !0,
        class: !0
      }), c = claim_space$8(f), d = claim_element$7(f, "SPAN", { class: !0 });
      var s = children$8(d);
      m = claim_text$4(s, _), s.forEach(detach$b), f.forEach(detach$b), this.h();
    },
    h() {
      attr$8(t, "id", "medium-range"), attr$8(t, "type", "range"), t.value = r = /*config*/
      n[0][
        /*setting*/
        n[64]
      ], attr$8(t, "min", a = /*settings*/
      n[13][
        /*setting*/
        n[64]
      ].min), attr$8(t, "max", l = /*settings*/
      n[13][
        /*setting*/
        n[64]
      ].max), attr$8(t, "step", h = /*settings*/
      n[13][
        /*setting*/
        n[64]
      ].step), attr$8(t, "class", "w-2/3 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1skivl7"), attr$8(d, "class", "w-1/3 text-center text-sm font-medium text-gray-600 dark:text-gray-400 svelte-1skivl7"), attr$8(e, "class", "flex items-center svelte-1skivl7");
    },
    m(A, f) {
      insert_hydration$b(A, e, f), append_hydration$8(e, t), append_hydration$8(e, c), append_hydration$8(e, d), append_hydration$8(d, m), y || (x = listen$2(t, "change", b), y = !0);
    },
    p(A, f) {
      n = A, f[0] & /*config, settings*/
      8193 && r !== (r = /*config*/
      n[0][
        /*setting*/
        n[64]
      ]) && (t.value = r), f[0] & /*config, settings*/
      8193 && a !== (a = /*settings*/
      n[13][
        /*setting*/
        n[64]
      ].min) && attr$8(t, "min", a), f[0] & /*config, settings*/
      8193 && l !== (l = /*settings*/
      n[13][
        /*setting*/
        n[64]
      ].max) && attr$8(t, "max", l), f[0] & /*config, settings*/
      8193 && h !== (h = /*settings*/
      n[13][
        /*setting*/
        n[64]
      ].step) && attr$8(t, "step", h), f[0] & /*config*/
      1 && _ !== (_ = /*config*/
      n[0][
        /*setting*/
        n[64]
      ] + "") && set_data$3(m, _);
    },
    d(A) {
      A && detach$b(e), y = !1, x();
    }
  };
}
function create_if_block_3$1(n) {
  let e, t, r, a, l, h, c, d, _ = ensure_array_like$2(
    /*settings*/
    n[13][
      /*setting*/
      n[64]
    ].options
  ), m = [];
  for (let x = 0; x < _.length; x += 1)
    m[x] = create_each_block_3(get_each_context_3(n, _, x));
  function y() {
    n[25].call(
      l,
      /*setting*/
      n[64]
    );
  }
  return {
    c() {
      e = element$7("label"), t = text$4("Select style"), a = space$8(), l = element$7("select");
      for (let x = 0; x < m.length; x += 1)
        m[x].c();
      this.h();
    },
    l(x) {
      e = claim_element$7(x, "LABEL", { for: !0, class: !0 });
      var b = children$8(e);
      t = claim_text$4(b, "Select style"), b.forEach(detach$b), a = claim_space$8(x), l = claim_element$7(x, "SELECT", { id: !0, class: !0 });
      var A = children$8(l);
      for (let f = 0; f < m.length; f += 1)
        m[f].l(A);
      A.forEach(detach$b), this.h();
    },
    h() {
      attr$8(e, "for", r = /*setting*/
      n[64]), attr$8(e, "class", "sr-only svelte-1skivl7"), attr$8(l, "id", h = /*setting*/
      n[64]), attr$8(l, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*config*/
      n[0][
        /*setting*/
        n[64]
      ] === void 0 && add_render_callback(y);
    },
    m(x, b) {
      insert_hydration$b(x, e, b), append_hydration$8(e, t), insert_hydration$b(x, a, b), insert_hydration$b(x, l, b);
      for (let A = 0; A < m.length; A += 1)
        m[A] && m[A].m(l, null);
      select_option(
        l,
        /*config*/
        n[0][
          /*setting*/
          n[64]
        ],
        !0
      ), c || (d = listen$2(l, "change", y), c = !0);
    },
    p(x, b) {
      if (n = x, b[0] & /*config, settings*/
      8193 && r !== (r = /*setting*/
      n[64]) && attr$8(e, "for", r), b[0] & /*settings, config*/
      8193) {
        _ = ensure_array_like$2(
          /*settings*/
          n[13][
            /*setting*/
            n[64]
          ].options
        );
        let A;
        for (A = 0; A < _.length; A += 1) {
          const f = get_each_context_3(n, _, A);
          m[A] ? m[A].p(f, b) : (m[A] = create_each_block_3(f), m[A].c(), m[A].m(l, null));
        }
        for (; A < m.length; A += 1)
          m[A].d(1);
        m.length = _.length;
      }
      b[0] & /*config, settings*/
      8193 && h !== (h = /*setting*/
      n[64]) && attr$8(l, "id", h), b[0] & /*config, settings*/
      8193 && select_option(
        l,
        /*config*/
        n[0][
          /*setting*/
          n[64]
        ]
      );
    },
    d(x) {
      x && (detach$b(e), detach$b(a), detach$b(l)), destroy_each$2(m, x), c = !1, d();
    }
  };
}
function create_each_block_3(n) {
  let e, t = (
    /*option*/
    n[67] + ""
  ), r, a, l;
  return {
    c() {
      e = element$7("option"), r = text$4(t), this.h();
    },
    l(h) {
      e = claim_element$7(h, "OPTION", { class: !0 });
      var c = children$8(e);
      r = claim_text$4(c, t), c.forEach(detach$b), this.h();
    },
    h() {
      e.__value = a = /*option*/
      n[67], set_input_value$1(e, e.__value), e.selected = l = /*option*/
      n[67] == /*config*/
      n[0][
        /*setting*/
        n[64]
      ], attr$8(e, "class", "svelte-1skivl7");
    },
    m(h, c) {
      insert_hydration$b(h, e, c), append_hydration$8(e, r);
    },
    p(h, c) {
      c[0] & /*config*/
      1 && t !== (t = /*option*/
      h[67] + "") && set_data$3(r, t), c[0] & /*config, settings*/
      8193 && a !== (a = /*option*/
      h[67]) && (e.__value = a, set_input_value$1(e, e.__value)), c[0] & /*config, settings*/
      8193 && l !== (l = /*option*/
      h[67] == /*config*/
      h[0][
        /*setting*/
        h[64]
      ]) && (e.selected = l);
    },
    d(h) {
      h && detach$b(e);
    }
  };
}
function create_each_block_2(n) {
  let e, t, r, a = (
    /*setting*/
    n[64] + ""
  ), l, h, c, d, _, m = (
    /*settings*/
    n[13][
      /*setting*/
      n[64]
    ].type == "toggle" && create_if_block_5$1(n)
  ), y = (
    /*settings*/
    n[13][
      /*setting*/
      n[64]
    ].type == "range" && create_if_block_4$1(n)
  ), x = (
    /*settings*/
    n[13][
      /*setting*/
      n[64]
    ].type == "select" && create_if_block_3$1(n)
  );
  return {
    c() {
      e = element$7("div"), t = element$7("div"), r = element$7("label"), l = text$4(a), c = space$8(), m && m.c(), d = space$8(), y && y.c(), _ = space$8(), x && x.c(), this.h();
    },
    l(b) {
      e = claim_element$7(b, "DIV", { class: !0 });
      var A = children$8(e);
      t = claim_element$7(A, "DIV", { class: !0 });
      var f = children$8(t);
      r = claim_element$7(f, "LABEL", { for: !0, class: !0 });
      var s = children$8(r);
      l = claim_text$4(s, a), s.forEach(detach$b), c = claim_space$8(f), m && m.l(f), d = claim_space$8(f), y && y.l(f), _ = claim_space$8(f), x && x.l(f), f.forEach(detach$b), A.forEach(detach$b), this.h();
    },
    h() {
      attr$8(r, "for", h = /*setting*/
      n[64]), attr$8(r, "class", "text-sm font-medium text-gray-600 dark:text-gray-400 w-1/2 svelte-1skivl7"), attr$8(t, "class", "flex items-center border-t border-b border-gray-200 bg-white px-4 py-2 space-x-2 svelte-1skivl7"), attr$8(e, "class", "flex flex-col mb-4 divide-y svelte-1skivl7");
    },
    m(b, A) {
      insert_hydration$b(b, e, A), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(r, l), append_hydration$8(t, c), m && m.m(t, null), append_hydration$8(t, d), y && y.m(t, null), append_hydration$8(t, _), x && x.m(t, null);
    },
    p(b, A) {
      A[0] & /*config*/
      1 && a !== (a = /*setting*/
      b[64] + "") && set_data$3(l, a), A[0] & /*config, settings*/
      8193 && h !== (h = /*setting*/
      b[64]) && attr$8(r, "for", h), /*settings*/
      b[13][
        /*setting*/
        b[64]
      ].type == "toggle" ? m ? m.p(b, A) : (m = create_if_block_5$1(b), m.c(), m.m(t, d)) : m && (m.d(1), m = null), /*settings*/
      b[13][
        /*setting*/
        b[64]
      ].type == "range" ? y ? y.p(b, A) : (y = create_if_block_4$1(b), y.c(), y.m(t, _)) : y && (y.d(1), y = null), /*settings*/
      b[13][
        /*setting*/
        b[64]
      ].type == "select" ? x ? x.p(b, A) : (x = create_if_block_3$1(b), x.c(), x.m(t, null)) : x && (x.d(1), x = null);
    },
    d(b) {
      b && detach$b(e), m && m.d(), y && y.d(), x && x.d();
    }
  };
}
function create_if_block$8(n) {
  let e, t, r, a = "Representations", l, h, c = '<svg aria-hidden="true" class="w-5 h-5 svelte-1skivl7" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" class="svelte-1skivl7"></path></svg> <span class="sr-only svelte-1skivl7">Close menu</span>', d, _, m, y = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" class="w-4 h-4 svelte-1skivl7"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" class="svelte-1skivl7"></path></svg> <div class="svelte-1skivl7">Add representation</div>', x, b, A = ensure_array_like$2(
    /*representations*/
    n[1]
  ), f = [];
  for (let s = 0; s < A.length; s += 1)
    f[s] = create_each_block$2(get_each_context$2(n, A, s));
  return {
    c() {
      e = element$7("div"), t = element$7("div"), r = element$7("h5"), r.textContent = a, l = space$8(), h = element$7("button"), h.innerHTML = c, d = space$8();
      for (let s = 0; s < f.length; s += 1)
        f[s].c();
      _ = space$8(), m = element$7("button"), m.innerHTML = y, this.h();
    },
    l(s) {
      e = claim_element$7(s, "DIV", {
        id: !0,
        class: !0,
        tabindex: !0,
        "aria-labelledby": !0
      });
      var u = children$8(e);
      t = claim_element$7(u, "DIV", { class: !0 });
      var p = children$8(t);
      r = claim_element$7(p, "H5", {
        id: !0,
        class: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(r) !== "svelte-1o7jz4z" && (r.textContent = a), l = claim_space$8(p), h = claim_element$7(p, "BUTTON", {
        type: !0,
        "data-drawer-hide": !0,
        "aria-controls": !0,
        class: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(h) !== "svelte-1nfxhie" && (h.innerHTML = c), p.forEach(detach$b), d = claim_space$8(u);
      for (let g = 0; g < f.length; g += 1)
        f[g].l(u);
      _ = claim_space$8(u), m = claim_element$7(u, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(m) !== "svelte-dc168v" && (m.innerHTML = y), u.forEach(detach$b), this.h();
    },
    h() {
      attr$8(r, "id", "drawer-label"), attr$8(r, "class", "inline-flex items-center mb-4 text-base font-semibold text-gray-500 dark:text-gray-400 svelte-1skivl7"), attr$8(h, "type", "button"), attr$8(h, "data-drawer-hide", "drawer-example"), attr$8(h, "aria-controls", "drawer-example"), attr$8(h, "class", "text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 absolute top-2.5 right-2.5 inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white svelte-1skivl7"), attr$8(t, "class", "p-4 svelte-1skivl7"), attr$8(m, "class", "w-full flex text-orange-600 justify-center my-2 text-sm space-x-2 items-center hover:text-gray-600 cursor-pointer svelte-1skivl7"), attr$8(e, "id", "drawer-example"), attr$8(e, "class", "absolute top-0 right-0 z-50 h-full overflow-y-auto transition-transform bg-gray-100 w-80 dark:bg-gray-800 border-l border-gray-200 svelte-1skivl7"), attr$8(e, "tabindex", "-1"), attr$8(e, "aria-labelledby", "drawer-label");
    },
    m(s, u) {
      insert_hydration$b(s, e, u), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(t, l), append_hydration$8(t, h), append_hydration$8(e, d);
      for (let p = 0; p < f.length; p += 1)
        f[p] && f[p].m(e, null);
      append_hydration$8(e, _), append_hydration$8(e, m), x || (b = [
        listen$2(
          h,
          "click",
          /*toggleOffCanvasReps*/
          n[16]
        ),
        listen$2(
          m,
          "click",
          /*insertRep*/
          n[18]
        )
      ], x = !0);
    },
    p(s, u) {
      if (u[0] & /*representations, moldata, resetZoom, deleteRep*/
      655370) {
        A = ensure_array_like$2(
          /*representations*/
          s[1]
        );
        let p;
        for (p = 0; p < A.length; p += 1) {
          const g = get_each_context$2(s, A, p);
          f[p] ? f[p].p(g, u) : (f[p] = create_each_block$2(g), f[p].c(), f[p].m(e, _));
        }
        for (; p < f.length; p += 1)
          f[p].d(1);
        f.length = A.length;
      }
    },
    d(s) {
      s && detach$b(e), destroy_each$2(f, s), x = !1, run_all$2(b);
    }
  };
}
function create_if_block_1$6(n) {
  let e, t, r, a, l, h, c, d, _, m, y, x, b, A = "Select style", f, s, u, p = "Stick", g, w = "Cartoon", o, v = "Surface", M, E, $ = "Sphere", k, L, z, O = "Opacity", R, N, W, B, P, G, H, U, j = "Expand selection", re, ie, te, ue, de, oe, J, Ee = "Å", se, Ae, he, ne, _e = "Full residue", Le, Be, Ue, He, We, Ge, Ne, Pe, Te = "Only sidechain", Me, De, V, Z, ee, ye, ce, Ie, ke, Y, me, we, Re, pe, $e, X, ze, Ve, I, xe, be, q, fe, Ce, Ze, Xe, Ye, lt, dt, it, ot, nt, Ct, ut, zt, Ut, wt, mt, vt, Rt, qe, ge, Ke, Qe, _t, Mt, St, It, Pt, Zt, Tt, mr, nr, Or, ft, Qt, Gt = ensure_array_like$2(
    /*moldata*/
    n[3]
  ), Nt = [];
  for (let kt = 0; kt < Gt.length; kt += 1)
    Nt[kt] = create_each_block_1$1(get_each_context_1$1(n, Gt, kt));
  function ar() {
    n[30].call(
      r,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function zr() {
    n[31].call(
      l,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function Ir() {
    n[32].call(
      d,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function Br() {
    n[33].call(
      m,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function Dr() {
    n[34].call(
      s,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function Rr(...kt) {
    return (
      /*change_handler_1*/
      n[35](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60],
        ...kt
      )
    );
  }
  function sr() {
    n[36].call(
      P,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function vr(...kt) {
    return (
      /*change_handler_2*/
      n[37](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60],
        ...kt
      )
    );
  }
  function Ht() {
    n[38].call(
      de,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function pr() {
    n[39].call(
      Ue,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function lr() {
    n[40].call(
      V,
      /*each_value*/
      n[59],
      /*index*/
      n[60]
    );
  }
  function _r() {
    return (
      /*click_handler_3*/
      n[41](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function hi() {
    return (
      /*click_handler_4*/
      n[42](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function or() {
    return (
      /*click_handler_5*/
      n[43](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function Yr() {
    return (
      /*click_handler_6*/
      n[44](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function tr() {
    return (
      /*click_handler_7*/
      n[45](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function fi() {
    return (
      /*click_handler_8*/
      n[46](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function Ci() {
    return (
      /*click_handler_9*/
      n[47](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function rr() {
    return (
      /*click_handler_10*/
      n[48](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function Kt() {
    return (
      /*click_handler_11*/
      n[49](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function Yt() {
    return (
      /*click_handler_12*/
      n[50](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function xt() {
    return (
      /*click_handler_13*/
      n[51](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function yr() {
    return (
      /*click_handler_14*/
      n[52](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function Pr() {
    return (
      /*click_handler_15*/
      n[53](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  return {
    c() {
      e = element$7("div"), t = element$7("div"), r = element$7("select");
      for (let kt = 0; kt < Nt.length; kt += 1)
        Nt[kt].c();
      a = space$8(), l = element$7("input"), h = space$8(), c = element$7("div"), d = element$7("input"), _ = space$8(), m = element$7("input"), y = space$8(), x = element$7("div"), b = element$7("label"), b.textContent = A, f = space$8(), s = element$7("select"), u = element$7("option"), u.textContent = p, g = element$7("option"), g.textContent = w, o = element$7("option"), o.textContent = v, M = text$4(`$
                        `), E = element$7("option"), E.textContent = $, k = space$8(), L = element$7("div"), z = element$7("div"), z.textContent = O, R = space$8(), N = element$7("input"), B = space$8(), P = element$7("input"), G = space$8(), H = element$7("div"), U = element$7("div"), U.textContent = j, re = space$8(), ie = element$7("input"), ue = space$8(), de = element$7("input"), oe = space$8(), J = element$7("div"), J.textContent = Ee, se = space$8(), Ae = element$7("div"), he = element$7("div"), ne = element$7("span"), ne.textContent = _e, Le = space$8(), Be = element$7("label"), Ue = element$7("input"), He = space$8(), We = element$7("div"), Ge = space$8(), Ne = element$7("div"), Pe = element$7("span"), Pe.textContent = Te, Me = space$8(), De = element$7("label"), V = element$7("input"), Z = space$8(), ee = element$7("div"), ye = space$8(), ce = element$7("div"), Ie = element$7("button"), Y = space$8(), me = element$7("button"), Re = space$8(), pe = element$7("button"), X = space$8(), ze = element$7("button"), I = space$8(), xe = element$7("button"), q = space$8(), fe = element$7("button"), Ze = space$8(), Xe = element$7("button"), lt = space$8(), dt = element$7("div"), it = element$7("button"), ot = text$4("AlphaFold"), Ct = space$8(), ut = element$7("button"), zt = text$4("Hydrophobicity"), wt = space$8(), mt = element$7("button"), vt = text$4("PyMol"), qe = space$8(), ge = element$7("button"), Ke = text$4("Jmol"), _t = space$8(), Mt = element$7("div"), St = element$7("button"), It = text$4("Chain"), Zt = space$8(), Tt = element$7("button"), mr = text$4("Spectrum"), this.h();
    },
    l(kt) {
      e = claim_element$7(kt, "DIV", { class: !0 });
      var rt = children$8(e);
      t = claim_element$7(rt, "DIV", { class: !0 });
      var Lt = children$8(t);
      r = claim_element$7(Lt, "SELECT", { id: !0, class: !0 });
      var cr = children$8(r);
      for (let Nr = 0; Nr < Nt.length; Nr += 1)
        Nt[Nr].l(cr);
      cr.forEach(detach$b), a = claim_space$8(Lt), l = claim_element$7(Lt, "INPUT", {
        type: !0,
        id: !0,
        class: !0,
        placeholder: !0
      }), Lt.forEach(detach$b), h = claim_space$8(rt), c = claim_element$7(rt, "DIV", { class: !0 });
      var Jt = children$8(c);
      d = claim_element$7(Jt, "INPUT", {
        type: !0,
        id: !0,
        class: !0,
        placeholder: !0
      }), _ = claim_space$8(Jt), m = claim_element$7(Jt, "INPUT", {
        type: !0,
        id: !0,
        class: !0,
        placeholder: !0
      }), Jt.forEach(detach$b), y = claim_space$8(rt), x = claim_element$7(rt, "DIV", { class: !0 });
      var Cr = children$8(x);
      b = claim_element$7(Cr, "LABEL", {
        for: !0,
        class: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(b) !== "svelte-wallp4" && (b.textContent = A), f = claim_space$8(Cr), s = claim_element$7(Cr, "SELECT", { id: !0, class: !0 });
      var gr = children$8(s);
      u = claim_element$7(gr, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(u) !== "svelte-sfou62" && (u.textContent = p), g = claim_element$7(gr, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(g) !== "svelte-e05dfq" && (g.textContent = w), o = claim_element$7(gr, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(o) !== "svelte-1nnagnw" && (o.textContent = v), M = claim_text$4(gr, `$
                        `), E = claim_element$7(gr, "OPTION", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(E) !== "svelte-eymsc2" && (E.textContent = $), gr.forEach(detach$b), Cr.forEach(detach$b), k = claim_space$8(rt), L = claim_element$7(rt, "DIV", { class: !0 });
      var Vt = children$8(L);
      z = claim_element$7(Vt, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(z) !== "svelte-17zx4ra" && (z.textContent = O), R = claim_space$8(Vt), N = claim_element$7(Vt, "INPUT", {
        id: !0,
        type: !0,
        min: !0,
        max: !0,
        step: !0,
        class: !0
      }), B = claim_space$8(Vt), P = claim_element$7(Vt, "INPUT", { type: !0, class: !0 }), Vt.forEach(detach$b), G = claim_space$8(rt), H = claim_element$7(rt, "DIV", { class: !0 });
      var Xt = children$8(H);
      U = claim_element$7(Xt, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(U) !== "svelte-1i4r04x" && (U.textContent = j), re = claim_space$8(Xt), ie = claim_element$7(Xt, "INPUT", {
        id: !0,
        type: !0,
        min: !0,
        max: !0,
        step: !0,
        class: !0
      }), ue = claim_space$8(Xt), de = claim_element$7(Xt, "INPUT", { type: !0, class: !0 }), oe = claim_space$8(Xt), J = claim_element$7(Xt, "DIV", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(J) !== "svelte-n73cw5" && (J.textContent = Ee), Xt.forEach(detach$b), se = claim_space$8(rt), Ae = claim_element$7(rt, "DIV", { class: !0 });
      var $r = children$8(Ae);
      he = claim_element$7($r, "DIV", { class: !0 });
      var Tr = children$8(he);
      ne = claim_element$7(Tr, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(ne) !== "svelte-1vt6cv2" && (ne.textContent = _e), Le = claim_space$8(Tr), Be = claim_element$7(Tr, "LABEL", { class: !0 });
      var ir = children$8(Be);
      Ue = claim_element$7(ir, "INPUT", { type: !0, class: !0 }), He = claim_space$8(ir), We = claim_element$7(ir, "DIV", { class: !0 }), children$8(We).forEach(detach$b), ir.forEach(detach$b), Tr.forEach(detach$b), Ge = claim_space$8($r), Ne = claim_element$7($r, "DIV", { class: !0 });
      var xr = children$8(Ne);
      Pe = claim_element$7(xr, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(Pe) !== "svelte-17x7gtg" && (Pe.textContent = Te), Me = claim_space$8(xr), De = claim_element$7(xr, "LABEL", { class: !0 });
      var wr = children$8(De);
      V = claim_element$7(wr, "INPUT", { type: !0, class: !0 }), Z = claim_space$8(wr), ee = claim_element$7(wr, "DIV", { class: !0 }), children$8(ee).forEach(detach$b), wr.forEach(detach$b), xr.forEach(detach$b), $r.forEach(detach$b), ye = claim_space$8(rt), ce = claim_element$7(rt, "DIV", { class: !0 });
      var jt = children$8(ce);
      Ie = claim_element$7(jt, "BUTTON", { class: !0 }), children$8(Ie).forEach(detach$b), Y = claim_space$8(jt), me = claim_element$7(jt, "BUTTON", { class: !0 }), children$8(me).forEach(detach$b), Re = claim_space$8(jt), pe = claim_element$7(jt, "BUTTON", { class: !0 }), children$8(pe).forEach(detach$b), X = claim_space$8(jt), ze = claim_element$7(jt, "BUTTON", { class: !0 }), children$8(ze).forEach(detach$b), I = claim_space$8(jt), xe = claim_element$7(jt, "BUTTON", { class: !0 }), children$8(xe).forEach(detach$b), q = claim_space$8(jt), fe = claim_element$7(jt, "BUTTON", { class: !0 }), children$8(fe).forEach(detach$b), Ze = claim_space$8(jt), Xe = claim_element$7(jt, "BUTTON", { class: !0 }), children$8(Xe).forEach(detach$b), jt.forEach(detach$b), lt = claim_space$8(rt), dt = claim_element$7(rt, "DIV", { class: !0 });
      var er = children$8(dt);
      it = claim_element$7(er, "BUTTON", { class: !0 });
      var Xr = children$8(it);
      ot = claim_text$4(Xr, "AlphaFold"), Xr.forEach(detach$b), Ct = claim_space$8(er), ut = claim_element$7(er, "BUTTON", { class: !0 });
      var Zr = children$8(ut);
      zt = claim_text$4(Zr, "Hydrophobicity"), Zr.forEach(detach$b), wt = claim_space$8(er), mt = claim_element$7(er, "BUTTON", { class: !0 });
      var qr = children$8(mt);
      vt = claim_text$4(qr, "PyMol"), qr.forEach(detach$b), qe = claim_space$8(er), ge = claim_element$7(er, "BUTTON", { class: !0 });
      var Qr = children$8(ge);
      Ke = claim_text$4(Qr, "Jmol"), Qr.forEach(detach$b), er.forEach(detach$b), _t = claim_space$8(rt), Mt = claim_element$7(rt, "DIV", { class: !0 });
      var kr = children$8(Mt);
      St = claim_element$7(kr, "BUTTON", { class: !0 });
      var Jr = children$8(St);
      It = claim_text$4(Jr, "Chain"), Jr.forEach(detach$b), Zt = claim_space$8(kr), Tt = claim_element$7(kr, "BUTTON", { class: !0 });
      var ei = children$8(Tt);
      mr = claim_text$4(ei, "Spectrum"), ei.forEach(detach$b), kr.forEach(detach$b), rt.forEach(detach$b), this.h();
    },
    h() {
      attr$8(r, "id", "style"), attr$8(r, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*rep*/
      n[58].model === void 0 && add_render_callback(ar), attr$8(l, "type", "text"), attr$8(l, "id", "chain"), attr$8(l, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(l, "placeholder", "Chain"), attr$8(t, "class", "p-1 flex space-x-1 svelte-1skivl7"), attr$8(d, "type", "text"), attr$8(d, "id", "chain"), attr$8(d, "class", "w-1/2 bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(d, "placeholder", "Resname"), attr$8(m, "type", "text"), attr$8(m, "id", "residue_range"), attr$8(m, "class", "w-full bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), attr$8(m, "placeholder", "Residue range"), attr$8(c, "class", "p-1 flex space-x-1 svelte-1skivl7"), attr$8(b, "for", "countries"), attr$8(b, "class", "block mb-2 text-sm w-1/3 font-medium text-gray-600 dark:text-white svelte-1skivl7"), u.__value = "stick", set_input_value$1(u, u.__value), attr$8(u, "class", "svelte-1skivl7"), g.__value = "cartoon", set_input_value$1(g, g.__value), attr$8(g, "class", "svelte-1skivl7"), o.__value = "surface", set_input_value$1(o, o.__value), attr$8(o, "class", "svelte-1skivl7"), E.__value = "sphere", set_input_value$1(E, E.__value), attr$8(E, "class", "svelte-1skivl7"), attr$8(s, "id", "style"), attr$8(s, "class", "bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 svelte-1skivl7"), /*rep*/
      n[58].style === void 0 && add_render_callback(Dr), attr$8(x, "class", "p-1 flex space-x-1 items-center svelte-1skivl7"), attr$8(z, "class", " svelte-1skivl7"), attr$8(N, "id", "around"), attr$8(N, "type", "range"), N.value = W = /*rep*/
      n[58].opacity, attr$8(N, "min", "0"), attr$8(N, "max", "1"), attr$8(N, "step", "0.1"), attr$8(N, "class", "h-2 w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1skivl7"), attr$8(P, "type", "text"), attr$8(P, "class", "w-8 svelte-1skivl7"), attr$8(L, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1skivl7"), attr$8(U, "class", " svelte-1skivl7"), attr$8(ie, "id", "around"), attr$8(ie, "type", "range"), ie.value = te = /*rep*/
      n[58].around, attr$8(ie, "min", "0"), attr$8(ie, "max", "10"), attr$8(ie, "step", "0.5"), attr$8(ie, "class", "h-2 w-1/3 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700 svelte-1skivl7"), attr$8(de, "type", "text"), attr$8(de, "class", "w-8 svelte-1skivl7"), attr$8(J, "class", "svelte-1skivl7"), attr$8(H, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1skivl7"), attr$8(ne, "class", "svelte-1skivl7"), attr$8(Ue, "type", "checkbox"), Ue.__value = "", set_input_value$1(Ue, Ue.__value), attr$8(Ue, "class", "sr-only peer svelte-1skivl7"), attr$8(We, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(Be, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1skivl7"), attr$8(he, "class", "flex space-x-1 w-1/2 svelte-1skivl7"), attr$8(Pe, "class", "svelte-1skivl7"), attr$8(V, "type", "checkbox"), V.__value = "", set_input_value$1(V, V.__value), attr$8(V, "class", "sr-only peer svelte-1skivl7"), attr$8(ee, "class", "w-11 h-6 bg-gray-200 rounded-full peer dark:bg-gray-700 peer-focus:ring-4 peer-focus:ring-orange-300 dark:peer-focus:ring-orange-800 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-orange-400 svelte-1skivl7"), attr$8(De, "class", "relative inline-flex items-center mr-5 cursor-pointer text-center svelte-1skivl7"), attr$8(Ne, "class", "flex space-x-1 w-1/2 svelte-1skivl7"), attr$8(Ae, "class", "flex p-1 items-center text-gray-700 space-x-1 text-sm svelte-1skivl7"), attr$8(Ie, "class", ke = null_to_empty(
        /*rep*/
        n[58].color === "orangeCarbon" ? "bg-orange-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-orange-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7"), attr$8(me, "class", we = null_to_empty(
        /*rep*/
        n[58].color === "redCarbon" ? "bg-red-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-red-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7"), attr$8(pe, "class", $e = null_to_empty(
        /*rep*/
        n[58].color === "blackCarbon" ? "bg-black rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-black rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7"), attr$8(ze, "class", Ve = null_to_empty(
        /*rep*/
        n[58].color === "blueCarbon" ? "bg-blue-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-blue-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7"), attr$8(xe, "class", be = null_to_empty(
        /*rep*/
        n[58].color === "grayCarbon" ? "bg-gray-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-gray-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7"), attr$8(fe, "class", Ce = null_to_empty(
        /*rep*/
        n[58].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7"), attr$8(Xe, "class", Ye = null_to_empty(
        /*rep*/
        n[58].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7"), attr$8(ce, "class", "flex space-x-2 mt-2 svelte-1skivl7"), attr$8(it, "class", nt = null_to_empty(
        /*rep*/
        n[58].color === "alphafold" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7"), attr$8(ut, "class", Ut = null_to_empty(
        /*rep*/
        n[58].color === "hydrophobicity" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7"), attr$8(mt, "class", Rt = null_to_empty(
        /*rep*/
        n[58].color === "default" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7"), attr$8(ge, "class", Qe = null_to_empty(
        /*rep*/
        n[58].color === "Jmol" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7"), attr$8(dt, "class", "flex space-x-2 py-2 text-sm svelte-1skivl7"), attr$8(St, "class", Pt = null_to_empty(
        /*rep*/
        n[58].color === "chain" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7"), attr$8(Tt, "class", nr = null_to_empty(
        /*rep*/
        n[58].color === "spectrum" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7"), attr$8(Mt, "class", "flex space-x-2 py-2 text-sm svelte-1skivl7"), attr$8(e, "class", "svelte-1skivl7");
    },
    m(kt, rt) {
      insert_hydration$b(kt, e, rt), append_hydration$8(e, t), append_hydration$8(t, r);
      for (let Lt = 0; Lt < Nt.length; Lt += 1)
        Nt[Lt] && Nt[Lt].m(r, null);
      select_option(
        r,
        /*rep*/
        n[58].model,
        !0
      ), append_hydration$8(t, a), append_hydration$8(t, l), set_input_value$1(
        l,
        /*rep*/
        n[58].chain
      ), append_hydration$8(e, h), append_hydration$8(e, c), append_hydration$8(c, d), set_input_value$1(
        d,
        /*rep*/
        n[58].resname
      ), append_hydration$8(c, _), append_hydration$8(c, m), set_input_value$1(
        m,
        /*rep*/
        n[58].residue_range
      ), append_hydration$8(e, y), append_hydration$8(e, x), append_hydration$8(x, b), append_hydration$8(x, f), append_hydration$8(x, s), append_hydration$8(s, u), append_hydration$8(s, g), append_hydration$8(s, o), append_hydration$8(s, M), append_hydration$8(s, E), select_option(
        s,
        /*rep*/
        n[58].style,
        !0
      ), append_hydration$8(e, k), append_hydration$8(e, L), append_hydration$8(L, z), append_hydration$8(L, R), append_hydration$8(L, N), append_hydration$8(L, B), append_hydration$8(L, P), set_input_value$1(
        P,
        /*rep*/
        n[58].opacity
      ), append_hydration$8(e, G), append_hydration$8(e, H), append_hydration$8(H, U), append_hydration$8(H, re), append_hydration$8(H, ie), append_hydration$8(H, ue), append_hydration$8(H, de), set_input_value$1(
        de,
        /*rep*/
        n[58].around
      ), append_hydration$8(H, oe), append_hydration$8(H, J), append_hydration$8(e, se), append_hydration$8(e, Ae), append_hydration$8(Ae, he), append_hydration$8(he, ne), append_hydration$8(he, Le), append_hydration$8(he, Be), append_hydration$8(Be, Ue), Ue.checked = /*rep*/
      n[58].byres, append_hydration$8(Be, He), append_hydration$8(Be, We), append_hydration$8(Ae, Ge), append_hydration$8(Ae, Ne), append_hydration$8(Ne, Pe), append_hydration$8(Ne, Me), append_hydration$8(Ne, De), append_hydration$8(De, V), V.checked = /*rep*/
      n[58].sidechain, append_hydration$8(De, Z), append_hydration$8(De, ee), append_hydration$8(e, ye), append_hydration$8(e, ce), append_hydration$8(ce, Ie), append_hydration$8(ce, Y), append_hydration$8(ce, me), append_hydration$8(ce, Re), append_hydration$8(ce, pe), append_hydration$8(ce, X), append_hydration$8(ce, ze), append_hydration$8(ce, I), append_hydration$8(ce, xe), append_hydration$8(ce, q), append_hydration$8(ce, fe), append_hydration$8(ce, Ze), append_hydration$8(ce, Xe), append_hydration$8(e, lt), append_hydration$8(e, dt), append_hydration$8(dt, it), append_hydration$8(it, ot), append_hydration$8(dt, Ct), append_hydration$8(dt, ut), append_hydration$8(ut, zt), append_hydration$8(dt, wt), append_hydration$8(dt, mt), append_hydration$8(mt, vt), append_hydration$8(dt, qe), append_hydration$8(dt, ge), append_hydration$8(ge, Ke), append_hydration$8(e, _t), append_hydration$8(e, Mt), append_hydration$8(Mt, St), append_hydration$8(St, It), append_hydration$8(Mt, Zt), append_hydration$8(Mt, Tt), append_hydration$8(Tt, mr), ft || (Qt = [
        listen$2(r, "change", ar),
        listen$2(l, "input", zr),
        listen$2(d, "input", Ir),
        listen$2(m, "input", Br),
        listen$2(s, "change", Dr),
        listen$2(N, "change", Rr),
        listen$2(P, "input", sr),
        listen$2(ie, "change", vr),
        listen$2(de, "input", Ht),
        listen$2(Ue, "change", pr),
        listen$2(V, "change", lr),
        listen$2(Ie, "click", _r),
        listen$2(me, "click", hi),
        listen$2(pe, "click", or),
        listen$2(ze, "click", Yr),
        listen$2(xe, "click", tr),
        listen$2(fe, "click", fi),
        listen$2(Xe, "click", Ci),
        listen$2(it, "click", rr),
        listen$2(ut, "click", Kt),
        listen$2(mt, "click", Yt),
        listen$2(ge, "click", xt),
        listen$2(St, "click", yr),
        listen$2(Tt, "click", Pr)
      ], ft = !0);
    },
    p(kt, rt) {
      if (n = kt, rt[0] & /*moldata*/
      8) {
        Gt = ensure_array_like$2(
          /*moldata*/
          n[3]
        );
        let Lt;
        for (Lt = 0; Lt < Gt.length; Lt += 1) {
          const cr = get_each_context_1$1(n, Gt, Lt);
          Nt[Lt] ? Nt[Lt].p(cr, rt) : (Nt[Lt] = create_each_block_1$1(cr), Nt[Lt].c(), Nt[Lt].m(r, null));
        }
        for (; Lt < Nt.length; Lt += 1)
          Nt[Lt].d(1);
        Nt.length = Gt.length;
      }
      rt[0] & /*representations*/
      2 && select_option(
        r,
        /*rep*/
        n[58].model
      ), rt[0] & /*representations*/
      2 && l.value !== /*rep*/
      n[58].chain && set_input_value$1(
        l,
        /*rep*/
        n[58].chain
      ), rt[0] & /*representations*/
      2 && d.value !== /*rep*/
      n[58].resname && set_input_value$1(
        d,
        /*rep*/
        n[58].resname
      ), rt[0] & /*representations*/
      2 && m.value !== /*rep*/
      n[58].residue_range && set_input_value$1(
        m,
        /*rep*/
        n[58].residue_range
      ), rt[0] & /*representations*/
      2 && select_option(
        s,
        /*rep*/
        n[58].style
      ), rt[0] & /*representations*/
      2 && W !== (W = /*rep*/
      n[58].opacity) && (N.value = W), rt[0] & /*representations*/
      2 && P.value !== /*rep*/
      n[58].opacity && set_input_value$1(
        P,
        /*rep*/
        n[58].opacity
      ), rt[0] & /*representations*/
      2 && te !== (te = /*rep*/
      n[58].around) && (ie.value = te), rt[0] & /*representations*/
      2 && de.value !== /*rep*/
      n[58].around && set_input_value$1(
        de,
        /*rep*/
        n[58].around
      ), rt[0] & /*representations*/
      2 && (Ue.checked = /*rep*/
      n[58].byres), rt[0] & /*representations*/
      2 && (V.checked = /*rep*/
      n[58].sidechain), rt[0] & /*representations*/
      2 && ke !== (ke = null_to_empty(
        /*rep*/
        n[58].color === "orangeCarbon" ? "bg-orange-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-orange-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7") && attr$8(Ie, "class", ke), rt[0] & /*representations*/
      2 && we !== (we = null_to_empty(
        /*rep*/
        n[58].color === "redCarbon" ? "bg-red-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-red-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7") && attr$8(me, "class", we), rt[0] & /*representations*/
      2 && $e !== ($e = null_to_empty(
        /*rep*/
        n[58].color === "blackCarbon" ? "bg-black rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-black rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7") && attr$8(pe, "class", $e), rt[0] & /*representations*/
      2 && Ve !== (Ve = null_to_empty(
        /*rep*/
        n[58].color === "blueCarbon" ? "bg-blue-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-blue-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7") && attr$8(ze, "class", Ve), rt[0] & /*representations*/
      2 && be !== (be = null_to_empty(
        /*rep*/
        n[58].color === "grayCarbon" ? "bg-gray-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-gray-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7") && attr$8(xe, "class", be), rt[0] & /*representations*/
      2 && Ce !== (Ce = null_to_empty(
        /*rep*/
        n[58].color === "greenCarbon" ? "bg-green-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-green-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7") && attr$8(fe, "class", Ce), rt[0] & /*representations*/
      2 && Ye !== (Ye = null_to_empty(
        /*rep*/
        n[58].color === "cyanCarbon" ? "bg-cyan-600 rounded-full w-8 h-8 border-4 border-gray-300  cursor-pointer" : "bg-cyan-600 rounded-full w-8 h-8 border-4 border-white cursor-pointer"
      ) + " svelte-1skivl7") && attr$8(Xe, "class", Ye), rt[0] & /*representations*/
      2 && nt !== (nt = null_to_empty(
        /*rep*/
        n[58].color === "alphafold" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7") && attr$8(it, "class", nt), rt[0] & /*representations*/
      2 && Ut !== (Ut = null_to_empty(
        /*rep*/
        n[58].color === "hydrophobicity" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7") && attr$8(ut, "class", Ut), rt[0] & /*representations*/
      2 && Rt !== (Rt = null_to_empty(
        /*rep*/
        n[58].color === "default" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7") && attr$8(mt, "class", Rt), rt[0] & /*representations*/
      2 && Qe !== (Qe = null_to_empty(
        /*rep*/
        n[58].color === "Jmol" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7") && attr$8(ge, "class", Qe), rt[0] & /*representations*/
      2 && Pt !== (Pt = null_to_empty(
        /*rep*/
        n[58].color === "chain" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7") && attr$8(St, "class", Pt), rt[0] & /*representations*/
      2 && nr !== (nr = null_to_empty(
        /*rep*/
        n[58].color === "spectrum" ? "rounded-lg p-1 border border-gray-400 cursor-pointer bg-gray-200" : "rounded-lg p-1 border border-gray-200 cursor-pointer bg-white"
      ) + " svelte-1skivl7") && attr$8(Tt, "class", nr);
    },
    i(kt) {
      kt && (Or || add_render_callback(() => {
        Or = create_in_transition(e, fade, {}), Or.start();
      }));
    },
    o: noop$7,
    d(kt) {
      kt && detach$b(e), destroy_each$2(Nt, kt), ft = !1, run_all$2(Qt);
    }
  };
}
function create_each_block_1$1(n) {
  let e, t = (
    /*mol*/
    n[61].name + ""
  ), r, a, l;
  return {
    c() {
      e = element$7("option"), r = text$4(t), a = text$4(" #"), l = text$4(
        /*i*/
        n[63]
      ), this.h();
    },
    l(h) {
      e = claim_element$7(h, "OPTION", { class: !0 });
      var c = children$8(e);
      r = claim_text$4(c, t), a = claim_text$4(c, " #"), l = claim_text$4(
        c,
        /*i*/
        n[63]
      ), c.forEach(detach$b), this.h();
    },
    h() {
      e.__value = /*i*/
      n[63], set_input_value$1(e, e.__value), attr$8(e, "class", "svelte-1skivl7");
    },
    m(h, c) {
      insert_hydration$b(h, e, c), append_hydration$8(e, r), append_hydration$8(e, a), append_hydration$8(e, l);
    },
    p(h, c) {
      c[0] & /*moldata*/
      8 && t !== (t = /*mol*/
      h[61].name + "") && set_data$3(r, t);
    },
    d(h) {
      h && detach$b(e);
    }
  };
}
function create_each_block$2(n) {
  let e, t, r, a, l, h, c, d, _, m, y, x, b, A = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 svelte-1skivl7"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" class="svelte-1skivl7"></path></svg>', f, s, u = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-gray-500 hover:text-orange-600 cursor-pointer svelte-1skivl7"><path stroke-linecap="round" stroke-linejoin="round" d="M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" class="svelte-1skivl7"></path></svg>', p, g, w;
  function o() {
    return (
      /*click_handler*/
      n[27](
        /*rep*/
        n[58],
        /*each_value*/
        n[59],
        /*index*/
        n[60]
      )
    );
  }
  function v() {
    return (
      /*click_handler_1*/
      n[28](
        /*index*/
        n[60]
      )
    );
  }
  function M() {
    return (
      /*click_handler_2*/
      n[29](
        /*rep*/
        n[58]
      )
    );
  }
  let E = (
    /*rep*/
    n[58].visible && create_if_block_1$6(n)
  );
  return {
    c() {
      e = element$7("div"), t = element$7("div"), r = element$7("div"), a = element$7("button"), l = svg_element$3("svg"), h = svg_element$3("path"), d = space$8(), _ = element$7("span"), m = text$4("Representation #"), y = text$4(
        /*index*/
        n[60]
      ), x = space$8(), b = element$7("button"), b.innerHTML = A, f = space$8(), s = element$7("button"), s.innerHTML = u, p = space$8(), E && E.c(), this.h();
    },
    l($) {
      e = claim_element$7($, "DIV", { class: !0 });
      var k = children$8(e);
      t = claim_element$7(k, "DIV", { class: !0 });
      var L = children$8(t);
      r = claim_element$7(L, "DIV", { class: !0 });
      var z = children$8(r);
      a = claim_element$7(z, "BUTTON", { class: !0 });
      var O = children$8(a);
      l = claim_svg_element$3(O, "svg", {
        xmlns: !0,
        fill: !0,
        viewBox: !0,
        "stroke-width": !0,
        stroke: !0,
        class: !0
      });
      var R = children$8(l);
      h = claim_svg_element$3(R, "path", {
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        d: !0,
        class: !0
      }), children$8(h).forEach(detach$b), R.forEach(detach$b), d = claim_space$8(O), _ = claim_element$7(O, "SPAN", { class: !0 });
      var N = children$8(_);
      m = claim_text$4(N, "Representation #"), y = claim_text$4(
        N,
        /*index*/
        n[60]
      ), N.forEach(detach$b), O.forEach(detach$b), x = claim_space$8(z), b = claim_element$7(z, "BUTTON", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(b) !== "svelte-1b0ur8n" && (b.innerHTML = A), f = claim_space$8(z), s = claim_element$7(z, "BUTTON", {
        title: !0,
        class: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(s) !== "svelte-jpslxx" && (s.innerHTML = u), z.forEach(detach$b), p = claim_space$8(L), E && E.l(L), L.forEach(detach$b), k.forEach(detach$b), this.h();
    },
    h() {
      attr$8(h, "stroke-linecap", "round"), attr$8(h, "stroke-linejoin", "round"), attr$8(h, "d", "M8.25 4.5l7.5 7.5-7.5 7.5"), attr$8(h, "class", "svelte-1skivl7"), attr$8(l, "xmlns", "http://www.w3.org/2000/svg"), attr$8(l, "fill", "none"), attr$8(l, "viewBox", "0 0 24 24"), attr$8(l, "stroke-width", "1.5"), attr$8(l, "stroke", "currentColor"), attr$8(l, "class", c = null_to_empty(
        /*rep*/
        n[58].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 "
      ) + " svelte-1skivl7"), attr$8(_, "class", "svelte-1skivl7"), attr$8(a, "class", "flex items-center space-x-2 svelte-1skivl7"), attr$8(b, "class", "svelte-1skivl7"), attr$8(s, "title", "zoom to selection"), attr$8(s, "class", "svelte-1skivl7"), attr$8(r, "class", "flex space-x-2 items-center cursor-pointer p-1 svelte-1skivl7"), attr$8(t, "class", " svelte-1skivl7"), attr$8(e, "class", "bg-white border-b border-t border-gray-200 py-4 px-2 svelte-1skivl7");
    },
    m($, k) {
      insert_hydration$b($, e, k), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(r, a), append_hydration$8(a, l), append_hydration$8(l, h), append_hydration$8(a, d), append_hydration$8(a, _), append_hydration$8(_, m), append_hydration$8(_, y), append_hydration$8(r, x), append_hydration$8(r, b), append_hydration$8(r, f), append_hydration$8(r, s), append_hydration$8(t, p), E && E.m(t, null), g || (w = [
        listen$2(a, "click", o),
        listen$2(b, "click", v),
        listen$2(s, "click", M)
      ], g = !0);
    },
    p($, k) {
      n = $, k[0] & /*representations*/
      2 && c !== (c = null_to_empty(
        /*rep*/
        n[58].visible ? "transform rotate-90 w-5 h-5 " : "w-5 h-5 "
      ) + " svelte-1skivl7") && attr$8(l, "class", c), /*rep*/
      n[58].visible ? E ? (E.p(n, k), k[0] & /*representations*/
      2 && transition_in$7(E, 1)) : (E = create_if_block_1$6(n), E.c(), transition_in$7(E, 1), E.m(t, null)) : E && (E.d(1), E = null);
    },
    d($) {
      $ && detach$b(e), E && E.d(), g = !1, run_all$2(w);
    }
  };
}
function create_fragment$b(n) {
  let e, t, r, a, l, h = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4 text-gray-500 hover:text-orange-600 cursor-pointer svelte-1skivl7"><path stroke-linecap="round" stroke-linejoin="round" d="M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" class="svelte-1skivl7"></path></svg>', c, d, _ = '<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5 text-gray-500 hover:text-orange-600 cursor-pointer svelte-1skivl7"><path stroke-linecap="round" stroke-linejoin="round" d="M10.5 6h9.75M10.5 6a1.5 1.5 0 11-3 0m3 0a1.5 1.5 0 10-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 01-3 0m3 0a1.5 1.5 0 00-3 0m-9.75 0h9.75" class="svelte-1skivl7"></path></svg>', m, y, x = '<svg class="w-5 h-5 text-gray-500 hover:text-orange-600 cursor-pointer svelte-1skivl7" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12.0281146,15 L12.5,15 C13.3284271,15 14,15.6715729 14,16.5 L14,20.5 C14,21.3284271 13.3284271,22 12.5,22 L10.5,22 C9.67157288,22 9,21.3284271 9,20.5 L9,16.5 C9,15.6715729 9.67157288,15 10.5,15 L11.0167145,15 C11.1492163,13.8570393 12.0552513,12.9352285 13.2239212,12.8053762 L18.6656473,12.20074 C19.4252963,12.1163346 20,11.4742382 20,10.7099144 L20,8.5 C20,7.67157288 19.3284271,7 18.5,7 C18.2238576,7 18,6.77614237 18,6.5 C18,6.22385763 18.2238576,6 18.5,6 C19.8807119,6 21,7.11928813 21,8.5 L21,10.7099144 C21,11.9837875 20.0421605,13.053948 18.7760788,13.1946238 L13.3343527,13.79926 C12.6731623,13.8727256 12.1520824,14.3686853 12.0281146,15 Z M10.5,16 C10.2238576,16 10,16.2238576 10,16.5 L10,20.5 C10,20.7761424 10.2238576,21 10.5,21 L12.5,21 C12.7761424,21 13,20.7761424 13,20.5 L13,16.5 C13,16.2238576 12.7761424,16 12.5,16 L10.5,16 Z M5.49996942,2.99995128 L16.5,2.99995128 C17.8807119,2.99995128 19,4.11923941 19,5.49995128 L19,7.5 C19,8.88071187 17.8807119,10 16.5,10 L5.49996942,10 C4.11925755,10 2.99996942,8.88071187 2.99996942,7.5 L2.99996942,5.49995128 C2.99996942,4.11923941 4.11925755,2.99995128 5.49996942,2.99995128 Z M5.49996942,3.99995128 C4.6715423,3.99995128 3.99996942,4.67152416 3.99996942,5.49995128 L3.99996942,7.5 C3.99996942,8.32842712 4.6715423,9 5.49996942,9 L16.5,9 C17.3284271,9 18,8.32842712 18,7.5 L18,5.49995128 C18,4.67152416 17.3284271,3.99995128 16.5,3.99995128 L5.49996942,3.99995128 Z" class="svelte-1skivl7"></path></svg>', b, A, f, s, u, p, g = '<svg class="w-4 h-4 text-gray-500 hover:text-orange-600 cursor-pointer fill-current svelte-1skivl7" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0" class="svelte-1skivl7"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round" class="svelte-1skivl7"></g><g id="SVGRepo_iconCarrier" class="svelte-1skivl7"><path d="M12.6 7.6v3.9h-1.1v4.6h-3v-4.6H7.4V7.6c0-.3.3-.6.6-.6h4c.3 0 .6.3.6.6zM10 6.5c.7 0 1.3-.6 1.3-1.3 0-.7-.6-1.3-1.3-1.3-.7 0-1.3.6-1.3 1.3 0 .7.6 1.3 1.3 1.3zm9.6 3.5c0 2.7-.9 4.9-2.7 6.7-1.9 1.9-4.2 2.9-6.9 2.9-2.6 0-4.9-.9-6.8-2.8C1.3 14.9.4 12.7.4 10c0-2.6.9-4.9 2.8-6.8C5.1 1.3 7.3.4 10 .4s5 .9 6.8 2.8c1.9 1.8 2.8 4.1 2.8 6.8zm-1.7 0c0-2.2-.8-4-2.3-5.6C14 2.9 12.2 2.1 10 2.1c-2.2 0-4 .8-5.5 2.3C2.9 6 2.1 7.9 2.1 10c0 2.1.8 4 2.3 5.5s3.4 2.3 5.6 2.3c2.1 0 4-.8 5.6-2.4 1.5-1.4 2.3-3.2 2.3-5.4z" class="svelte-1skivl7"></path></g></svg>', w, o, v = "Cite 3dmol.js as Rego & Koes, doi:10/gb5g5n", M, E, $, k, L, z, O = (
    /*anyColorAlphaFold*/
    n[11] && create_if_block_9$1(n)
  ), R = (
    /*anyColorHydrophobic*/
    n[12] && create_if_block_8$1()
  ), N = (
    /*hasFrames*/
    n[9] && create_if_block_6$1(n)
  ), W = (
    /*showOffCanvas*/
    n[7] && create_if_block_2$3(n)
  ), B = (
    /*showOffCanvasReps*/
    n[8] && create_if_block$8(n)
  );
  return {
    c() {
      e = element$7("div"), t = element$7("div"), r = element$7("div"), a = element$7("div"), l = element$7("button"), l.innerHTML = h, c = space$8(), d = element$7("button"), d.innerHTML = _, m = space$8(), y = element$7("button"), y.innerHTML = x, b = space$8(), O && O.c(), A = space$8(), R && R.c(), f = space$8(), N && N.c(), s = space$8(), u = element$7("div"), p = element$7("button"), p.innerHTML = g, w = space$8(), o = element$7("span"), o.textContent = v, M = space$8(), E = element$7("div"), $ = space$8(), W && W.c(), k = space$8(), B && B.c(), this.h();
    },
    l(P) {
      e = claim_element$7(P, "DIV", { class: !0 });
      var G = children$8(e);
      t = claim_element$7(G, "DIV", { class: !0 });
      var H = children$8(t);
      r = claim_element$7(H, "DIV", { class: !0 });
      var U = children$8(r);
      a = claim_element$7(U, "DIV", { class: !0 });
      var j = children$8(a);
      l = claim_element$7(j, "BUTTON", {
        class: !0,
        title: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(l) !== "svelte-1awoxzz" && (l.innerHTML = h), c = claim_space$8(j), d = claim_element$7(j, "BUTTON", {
        class: !0,
        title: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(d) !== "svelte-18a3afg" && (d.innerHTML = _), m = claim_space$8(j), y = claim_element$7(j, "BUTTON", {
        class: !0,
        title: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(y) !== "svelte-osiom6" && (y.innerHTML = x), j.forEach(detach$b), b = claim_space$8(U), O && O.l(U), A = claim_space$8(U), R && R.l(U), f = claim_space$8(U), N && N.l(U), s = claim_space$8(U), u = claim_element$7(U, "DIV", { class: !0 });
      var re = children$8(u);
      p = claim_element$7(re, "BUTTON", {
        class: !0,
        title: !0,
        "data-svelte-h": !0
      }), get_svelte_dataset$2(p) !== "svelte-1yqhmsc" && (p.innerHTML = g), w = claim_space$8(re), o = claim_element$7(re, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$2(o) !== "svelte-yennc4" && (o.textContent = v), re.forEach(detach$b), M = claim_space$8(U), E = claim_element$7(U, "DIV", { class: !0 }), children$8(E).forEach(detach$b), $ = claim_space$8(U), W && W.l(U), k = claim_space$8(U), B && B.l(U), U.forEach(detach$b), H.forEach(detach$b), G.forEach(detach$b), this.h();
    },
    h() {
      attr$8(l, "class", "p-2 svelte-1skivl7"), attr$8(l, "title", "Reset View"), attr$8(d, "class", "p-2 svelte-1skivl7"), attr$8(d, "title", "Settings"), attr$8(y, "class", "p-2 svelte-1skivl7"), attr$8(y, "title", "Representations"), attr$8(a, "class", "absolute z-50 top-0 right-0 mr-2 flex flex-col divide-y border border-gray-200 mt-2 rounded items-center justify-center bg-white dark:bg-gray-800 svelte-1skivl7"), attr$8(p, "class", "p-1 svelte-1skivl7"), attr$8(p, "title", "How to cite 3Dmol.js"), attr$8(o, "class", "absolute -top-1 left-6 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity svelte-1skivl7"), toggle_class$5(
        o,
        "opacity-100",
        /*showCiteTooltip*/
        n[6]
      ), attr$8(u, "class", "absolute z-50 bottom-0 left-0 ml-2 flex divide-x mb-2 rounded items-center justify-center svelte-1skivl7"), attr$8(E, "class", "viewer w-full h-full z-10 svelte-1skivl7"), attr$8(r, "class", "gr-block gr-box relative w-full overflow-hidden svelte-1skivl7"), attr$8(t, "class", "overflow-hidden flex gap-px w-full h-full flex-wrap svelte-1skivl7"), attr$8(e, "class", "bg-white w-full minh svelte-1skivl7");
    },
    m(P, G) {
      insert_hydration$b(P, e, G), append_hydration$8(e, t), append_hydration$8(t, r), append_hydration$8(r, a), append_hydration$8(a, l), append_hydration$8(a, c), append_hydration$8(a, d), append_hydration$8(a, m), append_hydration$8(a, y), append_hydration$8(r, b), O && O.m(r, null), append_hydration$8(r, A), R && R.m(r, null), append_hydration$8(r, f), N && N.m(r, null), append_hydration$8(r, s), append_hydration$8(r, u), append_hydration$8(u, p), append_hydration$8(u, w), append_hydration$8(u, o), append_hydration$8(r, M), append_hydration$8(r, E), n[22](E), append_hydration$8(r, $), W && W.m(r, null), append_hydration$8(r, k), B && B.m(r, null), L || (z = [
        listen$2(
          l,
          "click",
          /*resetZoom*/
          n[19]
        ),
        listen$2(
          d,
          "click",
          /*toggleOffCanvas*/
          n[15]
        ),
        listen$2(
          y,
          "click",
          /*toggleOffCanvasReps*/
          n[16]
        ),
        listen$2(
          p,
          "click",
          /*toggleCiteTooltip*/
          n[14]
        )
      ], L = !0);
    },
    p(P, G) {
      /*anyColorAlphaFold*/
      P[11] ? O ? O.p(P, G) : (O = create_if_block_9$1(P), O.c(), O.m(r, A)) : O && (O.d(1), O = null), /*anyColorHydrophobic*/
      P[12] ? R || (R = create_if_block_8$1(), R.c(), R.m(r, f)) : R && (R.d(1), R = null), /*hasFrames*/
      P[9] ? N ? N.p(P, G) : (N = create_if_block_6$1(P), N.c(), N.m(r, s)) : N && (N.d(1), N = null), G[0] & /*showCiteTooltip*/
      64 && toggle_class$5(
        o,
        "opacity-100",
        /*showCiteTooltip*/
        P[6]
      ), /*showOffCanvas*/
      P[7] ? W ? W.p(P, G) : (W = create_if_block_2$3(P), W.c(), W.m(r, k)) : W && (W.d(1), W = null), /*showOffCanvasReps*/
      P[8] ? B ? B.p(P, G) : (B = create_if_block$8(P), B.c(), B.m(r, null)) : B && (B.d(1), B = null);
    },
    i: noop$7,
    o: noop$7,
    d(P) {
      P && detach$b(e), O && O.d(), R && R.d(), N && N.d(), n[22](null), W && W.d(), B && B.d(), L = !1, run_all$2(z);
    }
  };
}
function fade(n, { delay: e = 0, duration: t = 50 }) {
  const r = +getComputedStyle(n).opacity;
  return {
    delay: e,
    duration: t,
    css: (a) => `opacity: ${a * r}`
  };
}
function instance$a(n, e, t) {
  let r = mol, a, { confidenceLabel: l = null } = e, { moldata: h = null } = e, c = {
    backgroundColor: {
      type: "select",
      options: ["white", "black", "gray", "lightgray", "beige", "orange"]
    },
    orthographic: { type: "toggle" },
    disableFog: { type: "toggle" }
  }, { config: d = {
    backgroundColor: "white",
    orthographic: !1,
    disableFog: !1
  } } = e, _ = !0, m = !1;
  function y() {
    t(6, m = !m);
  }
  let { representations: x = [] } = e, b = !1, A = !1;
  function f() {
    t(7, b = !b);
  }
  function s() {
    t(8, A = !A);
  }
  function u(Me) {
    x.splice(Me, 1), t(1, x);
  }
  function p() {
    x.push({
      model: 0,
      chain: "",
      resname: "",
      style: "cartoon",
      color: "grayCarbon",
      residue_range: "",
      around: 0,
      byres: !1,
      visible: !0,
      opacity: 1
    }), t(1, x);
  }
  let g = function(Me) {
    return Me.b < 50 ? "OrangeRed" : Me.b < 70 ? "Gold" : Me.b < 90 ? "MediumTurquoise" : "Blue";
  }, w = function(Me) {
    let De = {
      ILE: 4.5,
      VAL: 4.2,
      LEU: 3.8,
      PHE: 2.8,
      CYS: 2.5,
      MET: 1.9,
      ALA: 1.8,
      GLY: -0.4,
      THR: -0.7,
      SER: -0.8,
      TRP: -0.9,
      TYR: -1.3,
      PRO: -1.6,
      HIS: -3.2,
      GLU: -3.5,
      GLN: -3.5,
      ASP: -3.5,
      ASN: -3.5,
      LYS: -3.9,
      ARG: -4.5
    };
    if (Me.resn in De) {
      const V = De[Me.resn], Z = -4.5, ye = (V - Z) / (4.5 - Z), ce = (Ie, ke, Y) => {
        const me = parseInt(Ie.slice(1), 16), we = parseInt(ke.slice(1), 16), Re = Math.round(((we >> 16) - (me >> 16)) * Y + (me >> 16)), pe = Math.round(((we >> 8 & 255) - (me >> 8 & 255)) * Y + (me >> 8 & 255)), $e = Math.round(((we & 255) - (me & 255)) * Y + (me & 255));
        return `#${((1 << 24) + (Re << 16) + (pe << 8) + $e).toString(16).slice(1)}`;
      };
      return ye <= 0.5 ? ce("#008B8B", "#FFFFFF", ye * 2) : ce("#FFFFFF", "#B8860B", (ye - 0.5) * 2);
    } else
      return "#FFFFFF";
  }, o;
  function v(Me) {
    if (Me.type != null)
      o.zoomTo();
    else {
      let De = { model: Me.model };
      Me.chain !== "" && (De.chain = Me.chain), Me.residue_range !== "" && (De.resi = Me.residue_range), Me.resname !== "" && (De.resn = Me.resname), o.zoomTo(De);
    }
  }
  function M(Me) {
    o !== void 0 && (o.setStyle(), o.removeAllSurfaces(), Me.forEach((De) => {
      let V;
      De.color === "alphafold" ? V = { colorfunc: g } : De.color === "hydrophobicity" ? V = { colorfunc: w } : De.color == "spectrum" ? V = { color: "spectrum" } : V = { colorscheme: De.color }, V.opacity = De.opacity;
      let Z = { model: De.model };
      if (De.chain !== "" && (Z.chain = De.chain), De.residue_range !== "" && (Z.resi = De.residue_range), De.resname !== "" && (Z.resn = De.resname), Z.byres = De.byres, De.around !== 0 && (Z.expand = De.around), De.sidechain && (Z = {
        and: [Z, { atom: ["N", "C", "O"], invert: !0 }]
      }), De.style === "surface")
        o.addSurface(r.SurfaceType.VDW, V, Z);
      else
        try {
          o.getModel(Z.model) != null && o.addStyle(Z, { [De.style]: V });
        } catch (ee) {
          console.log(ee);
        }
    }), o.render());
  }
  onMount$2(() => {
    console.log("MolecularViewer Mounted");
    let Me = Object.assign(Object.assign({}, d), { cartoonQuality: 7 });
    t(21, o = r.createViewer(a, Me));
    let De = [];
    x.forEach((V) => {
      De.some((Z) => Z.model === V.model && Z.chain === V.chain && Z.resname === V.resname && Z.style === V.style && Z.color === V.color && Z.residue_range === V.residue_range && Z.around === V.around && Z.byres === V.byres && Z.sidechain === V.sidechain) || De.push(V);
    }), t(1, x = De), h.length > 0 && h.forEach((V) => {
      V.asFrames ? o.addModelsAsFrames(V.data, V.format) : o.addModel(V.data, V.format);
    }), M(x), o.zoomTo(), o.render(), o.zoom(0.9, 100), x.forEach((V) => {
      V.color === "alphafold" && t(11, k = !0), V.color === "hydrophobicity" && t(12, L = !0);
    }), _ && o.setHoverable(
      {},
      !0,
      function(V, Z, ee, ye) {
        if (!V.label) {
          let ce;
          k ? ce = V.resn + ":" + V.resi + ":" + V.atom + " (" + l + " " + V.b + ")" : ce = V.resn + ":" + V.resi + ":" + V.atom, V.label = Z.addLabel(ce, {
            position: V,
            backgroundColor: "#ffffff",
            borderColor: "#dddddd",
            fontColor: "black"
          });
        }
      },
      function(V, Z) {
        V.label && (Z.removeLabel(V.label), delete V.label);
      }
    );
  }), beforeUpdate(() => {
    console.log("beforeUpdate"), console.log(x);
  });
  let E = !1, $ = !1, k = !1, L = !1;
  function z() {
    console.log(o.isAnimated()), $ ? o.pauseAnimate() : o.animate({ loop: "forward", reps: 0 }), o.render(), console.log(o.isAnimated()), t(10, $ = !$);
  }
  function O(Me) {
    binding_callbacks$3[Me ? "unshift" : "push"](() => {
      a = Me, t(4, a);
    });
  }
  function R(Me) {
    d[Me] = this.checked, t(0, d), t(13, c);
  }
  const N = (Me) => {
    t(0, d[Me] = event.target.value, d);
  };
  function W(Me) {
    d[Me] = select_value(this), t(0, d), t(13, c);
  }
  function B() {
    _ = this.value, t(5, _);
  }
  const P = (Me, De, V) => t(1, De[V].visible = !Me.visible, x), G = (Me) => u(Me), H = (Me) => v(Me);
  function U(Me, De) {
    Me[De].model = select_value(this), t(1, x);
  }
  function j(Me, De) {
    Me[De].chain = this.value, t(1, x);
  }
  function re(Me, De) {
    Me[De].resname = this.value, t(1, x);
  }
  function ie(Me, De) {
    Me[De].residue_range = this.value, t(1, x);
  }
  function te(Me, De) {
    Me[De].style = select_value(this), t(1, x);
  }
  const ue = (Me, De, V, Z) => {
    t(1, De[V].opacity = Z.target.value, x);
  };
  function de(Me, De) {
    Me[De].opacity = this.value, t(1, x);
  }
  const oe = (Me, De, V, Z) => {
    t(1, De[V].around = Z.target.value, x);
  };
  function J(Me, De) {
    Me[De].around = this.value, t(1, x);
  }
  function Ee(Me, De) {
    Me[De].byres = this.checked, t(1, x);
  }
  function se(Me, De) {
    Me[De].sidechain = this.checked, t(1, x);
  }
  const Ae = (Me, De, V) => t(1, De[V].color = "orangeCarbon", x), he = (Me, De, V) => t(1, De[V].color = "redCarbon", x), ne = (Me, De, V) => t(1, De[V].color = "blackCarbon", x), _e = (Me, De, V) => t(1, De[V].color = "blueCarbon", x), Le = (Me, De, V) => t(1, De[V].color = "grayCarbon", x), Be = (Me, De, V) => t(1, De[V].color = "greenCarbon", x), Ue = (Me, De, V) => t(1, De[V].color = "cyanCarbon", x), He = (Me, De, V) => t(1, De[V].color = "alphafold", x), We = (Me, De, V) => t(1, De[V].color = "hydrophobicity", x), Ge = (Me, De, V) => t(1, De[V].color = "default", x), Ne = (Me, De, V) => t(1, De[V].color = "Jmol", x), Pe = (Me, De, V) => t(1, De[V].color = "chain", x), Te = (Me, De, V) => t(1, De[V].color = "spectrum", x);
  return n.$$set = (Me) => {
    "confidenceLabel" in Me && t(2, l = Me.confidenceLabel), "moldata" in Me && t(3, h = Me.moldata), "config" in Me && t(0, d = Me.config), "representations" in Me && t(1, x = Me.representations);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*view, config*/
    2097153 && o != null && (o.setBackgroundColor(d.backgroundColor), o.enableFog(!d.disableFog), o.setCameraParameters({ orthographic: d.orthographic })), n.$$.dirty[0] & /*representations*/
    2 && M(x), n.$$.dirty[0] & /*moldata*/
    8 && h.forEach((Me) => {
      Me.asFrames && t(9, E = !0);
    }), n.$$.dirty[0] & /*representations*/
    2 && (t(11, k = !1), x.forEach((Me) => {
      Me.color === "alphafold" && t(11, k = !0);
    })), n.$$.dirty[0] & /*representations*/
    2 && (t(12, L = !1), x.forEach((Me) => {
      Me.color === "hydrophobicity" && t(12, L = !0);
    }));
  }, [
    d,
    x,
    l,
    h,
    a,
    _,
    m,
    b,
    A,
    E,
    $,
    k,
    L,
    c,
    y,
    f,
    s,
    u,
    p,
    v,
    z,
    o,
    O,
    R,
    N,
    W,
    B,
    P,
    G,
    H,
    U,
    j,
    re,
    ie,
    te,
    ue,
    de,
    oe,
    J,
    Ee,
    se,
    Ae,
    he,
    ne,
    _e,
    Le,
    Be,
    Ue,
    He,
    We,
    Ge,
    Ne,
    Pe,
    Te
  ];
}
class MolecularViewer extends SvelteComponent$b {
  constructor(e) {
    super(), init$b(
      this,
      e,
      instance$a,
      create_fragment$b,
      safe_not_equal$b,
      {
        confidenceLabel: 2,
        moldata: 3,
        config: 0,
        representations: 1
      },
      null,
      [-1, -1, -1]
    );
  }
}
const {
  SvelteComponent: SvelteComponent$a,
  bubble: bubble$2,
  check_outros: check_outros$6,
  claim_component: claim_component$6,
  claim_space: claim_space$7,
  create_component: create_component$6,
  destroy_component: destroy_component$6,
  detach: detach$a,
  empty: empty$4,
  group_outros: group_outros$6,
  init: init$a,
  insert_hydration: insert_hydration$a,
  mount_component: mount_component$6,
  safe_not_equal: safe_not_equal$a,
  space: space$7,
  transition_in: transition_in$6,
  transition_out: transition_out$6
} = window.__gradio__svelte__internal;
function create_else_block$5(n) {
  let e, t;
  return e = new Empty({
    props: {
      unpadded_box: !0,
      size: "large",
      $$slots: { default: [create_default_slot$3] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      create_component$6(e.$$.fragment);
    },
    l(r) {
      claim_component$6(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$6(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*$$scope*/
      4096 && (l.$$scope = { dirty: a, ctx: r }), e.$set(l);
    },
    i(r) {
      t || (transition_in$6(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$6(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$6(e, r);
    }
  };
}
function create_if_block$7(n) {
  let e, t, r, a;
  e = new FilePreview({
    props: {
      i18n: (
        /*i18n*/
        n[5]
      ),
      selectable: (
        /*selectable*/
        n[3]
      ),
      value: (
        /*value*/
        n[0]
      ),
      height: (
        /*height*/
        n[4]
      )
    }
  }), e.$on(
    "select",
    /*select_handler*/
    n[11]
  );
  let l = (
    /*moldata*/
    n[9] != null && /*molviewer*/
    n[10] && create_if_block_1$5(n)
  );
  return {
    c() {
      create_component$6(e.$$.fragment), t = space$7(), l && l.c(), r = empty$4();
    },
    l(h) {
      claim_component$6(e.$$.fragment, h), t = claim_space$7(h), l && l.l(h), r = empty$4();
    },
    m(h, c) {
      mount_component$6(e, h, c), insert_hydration$a(h, t, c), l && l.m(h, c), insert_hydration$a(h, r, c), a = !0;
    },
    p(h, c) {
      const d = {};
      c & /*i18n*/
      32 && (d.i18n = /*i18n*/
      h[5]), c & /*selectable*/
      8 && (d.selectable = /*selectable*/
      h[3]), c & /*value*/
      1 && (d.value = /*value*/
      h[0]), c & /*height*/
      16 && (d.height = /*height*/
      h[4]), e.$set(d), /*moldata*/
      h[9] != null && /*molviewer*/
      h[10] ? l ? (l.p(h, c), c & /*moldata, molviewer*/
      1536 && transition_in$6(l, 1)) : (l = create_if_block_1$5(h), l.c(), transition_in$6(l, 1), l.m(r.parentNode, r)) : l && (group_outros$6(), transition_out$6(l, 1, 1, () => {
        l = null;
      }), check_outros$6());
    },
    i(h) {
      a || (transition_in$6(e.$$.fragment, h), transition_in$6(l), a = !0);
    },
    o(h) {
      transition_out$6(e.$$.fragment, h), transition_out$6(l), a = !1;
    },
    d(h) {
      h && (detach$a(t), detach$a(r)), destroy_component$6(e, h), l && l.d(h);
    }
  };
}
function create_default_slot$3(n) {
  let e, t;
  return e = new File$1({}), {
    c() {
      create_component$6(e.$$.fragment);
    },
    l(r) {
      claim_component$6(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$6(e, r, a), t = !0;
    },
    i(r) {
      t || (transition_in$6(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$6(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$6(e, r);
    }
  };
}
function create_if_block_1$5(n) {
  let e, t;
  return e = new MolecularViewer({
    props: {
      moldata: (
        /*moldata*/
        n[9]
      ),
      config: (
        /*config*/
        n[6]
      ),
      confidenceLabel: (
        /*confidenceLabel*/
        n[7]
      ),
      representations: (
        /*representations*/
        n[8]
      )
    }
  }), {
    c() {
      create_component$6(e.$$.fragment);
    },
    l(r) {
      claim_component$6(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$6(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*moldata*/
      512 && (l.moldata = /*moldata*/
      r[9]), a & /*config*/
      64 && (l.config = /*config*/
      r[6]), a & /*confidenceLabel*/
      128 && (l.confidenceLabel = /*confidenceLabel*/
      r[7]), a & /*representations*/
      256 && (l.representations = /*representations*/
      r[8]), e.$set(l);
    },
    i(r) {
      t || (transition_in$6(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$6(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$6(e, r);
    }
  };
}
function create_fragment$a(n) {
  let e, t, r, a, l, h, c;
  e = new BlockLabel({
    props: {
      show_label: (
        /*show_label*/
        n[2]
      ),
      float: (
        /*value*/
        n[0] === null
      ),
      Icon: File$1,
      label: (
        /*label*/
        n[1] || "File"
      )
    }
  });
  const d = [create_if_block$7, create_else_block$5], _ = [];
  function m(y, x) {
    return x & /*value*/
    1 && (r = null), r == null && (r = !!/*value*/
    (y[0] && (!Array.isArray(
      /*value*/
      y[0]
    ) || /*value*/
    y[0].length > 0))), r ? 0 : 1;
  }
  return a = m(n, -1), l = _[a] = d[a](n), {
    c() {
      create_component$6(e.$$.fragment), t = space$7(), l.c(), h = empty$4();
    },
    l(y) {
      claim_component$6(e.$$.fragment, y), t = claim_space$7(y), l.l(y), h = empty$4();
    },
    m(y, x) {
      mount_component$6(e, y, x), insert_hydration$a(y, t, x), _[a].m(y, x), insert_hydration$a(y, h, x), c = !0;
    },
    p(y, [x]) {
      const b = {};
      x & /*show_label*/
      4 && (b.show_label = /*show_label*/
      y[2]), x & /*value*/
      1 && (b.float = /*value*/
      y[0] === null), x & /*label*/
      2 && (b.label = /*label*/
      y[1] || "File"), e.$set(b);
      let A = a;
      a = m(y, x), a === A ? _[a].p(y, x) : (group_outros$6(), transition_out$6(_[A], 1, 1, () => {
        _[A] = null;
      }), check_outros$6(), l = _[a], l ? l.p(y, x) : (l = _[a] = d[a](y), l.c()), transition_in$6(l, 1), l.m(h.parentNode, h));
    },
    i(y) {
      c || (transition_in$6(e.$$.fragment, y), transition_in$6(l), c = !0);
    },
    o(y) {
      transition_out$6(e.$$.fragment, y), transition_out$6(l), c = !1;
    },
    d(y) {
      y && (detach$a(t), detach$a(h)), destroy_component$6(e, y), _[a].d(y);
    }
  };
}
function instance$9(n, e, t) {
  let { value: r = null } = e, { label: a } = e, { show_label: l = !0 } = e, { selectable: h = !1 } = e, { height: c = void 0 } = e, { i18n: d } = e, { config: _ = {} } = e, { confidenceLabel: m = "" } = e, { representations: y = [] } = e, { moldata: x = null } = e, { molviewer: b = !1 } = e;
  function A(f) {
    bubble$2.call(this, n, f);
  }
  return n.$$set = (f) => {
    "value" in f && t(0, r = f.value), "label" in f && t(1, a = f.label), "show_label" in f && t(2, l = f.show_label), "selectable" in f && t(3, h = f.selectable), "height" in f && t(4, c = f.height), "i18n" in f && t(5, d = f.i18n), "config" in f && t(6, _ = f.config), "confidenceLabel" in f && t(7, m = f.confidenceLabel), "representations" in f && t(8, y = f.representations), "moldata" in f && t(9, x = f.moldata), "molviewer" in f && t(10, b = f.molviewer);
  }, [
    r,
    a,
    l,
    h,
    c,
    d,
    _,
    m,
    y,
    x,
    b,
    A
  ];
}
class File_1 extends SvelteComponent$a {
  constructor(e) {
    super(), init$a(this, e, instance$9, create_fragment$a, safe_not_equal$a, {
      value: 0,
      label: 1,
      show_label: 2,
      selectable: 3,
      height: 4,
      i18n: 5,
      config: 6,
      confidenceLabel: 7,
      representations: 8,
      moldata: 9,
      molviewer: 10
    });
  }
}
new Intl.Collator(0, { numeric: 1 }).compare;
async function prepare_files(n, e) {
  return n.map(
    (t) => new FileData({
      path: t.name,
      orig_name: t.name,
      blob: t,
      size: t.size,
      mime_type: t.type,
      is_stream: e
    })
  );
}
class FileData {
  constructor({
    path: e,
    url: t,
    orig_name: r,
    size: a,
    blob: l,
    is_stream: h,
    mime_type: c,
    alt_text: d,
    b64: _
  }) {
    this.meta = { _type: "gradio.FileData" }, this.path = e, this.url = t, this.orig_name = r, this.size = a, this.blob = t ? void 0 : l, this.is_stream = h, this.mime_type = c, this.alt_text = d, this.b64 = _;
  }
}
typeof process < "u" && process.versions && process.versions.node;
var fr;
class TextLineStream extends TransformStream {
  /** Constructs a new instance. */
  constructor(t = { allowCR: !1 }) {
    super({
      transform: (r, a) => {
        for (r = Fr(this, fr) + r; ; ) {
          const l = r.indexOf(`
`), h = t.allowCR ? r.indexOf("\r") : -1;
          if (h !== -1 && h !== r.length - 1 && (l === -1 || l - 1 > h)) {
            a.enqueue(r.slice(0, h)), r = r.slice(h + 1);
            continue;
          }
          if (l === -1)
            break;
          const c = r[l - 1] === "\r" ? l - 1 : l;
          a.enqueue(r.slice(0, c)), r = r.slice(l + 1);
        }
        Ln(this, fr, r);
      },
      flush: (r) => {
        if (Fr(this, fr) === "")
          return;
        const a = t.allowCR && Fr(this, fr).endsWith("\r") ? Fr(this, fr).slice(0, -1) : Fr(this, fr);
        r.enqueue(a);
      }
    });
    Mi(this, fr, "");
  }
}
fr = new WeakMap();
const {
  SvelteComponent: SvelteComponent$9,
  append_hydration: append_hydration$7,
  attr: attr$7,
  children: children$7,
  claim_element: claim_element$6,
  claim_space: claim_space$6,
  claim_text: claim_text$3,
  detach: detach$9,
  element: element$6,
  init: init$9,
  insert_hydration: insert_hydration$9,
  noop: noop$6,
  safe_not_equal: safe_not_equal$9,
  set_data: set_data$2,
  set_style: set_style$3,
  space: space$6,
  text: text$3,
  toggle_class: toggle_class$4
} = window.__gradio__svelte__internal, { onMount: onMount$1, createEventDispatcher: createEventDispatcher$5, onDestroy: onDestroy$1 } = window.__gradio__svelte__internal;
function create_if_block$6(n) {
  let e, t, r, a, l = getProgress(
    /*file_to_display*/
    n[2]
  ) + "", h, c, d, _, m = (
    /*file_to_display*/
    n[2].orig_name + ""
  ), y;
  return {
    c() {
      e = element$6("div"), t = element$6("span"), r = element$6("div"), a = element$6("progress"), h = text$3(l), d = space$6(), _ = element$6("span"), y = text$3(m), this.h();
    },
    l(x) {
      e = claim_element$6(x, "DIV", { class: !0 });
      var b = children$7(e);
      t = claim_element$6(b, "SPAN", {});
      var A = children$7(t);
      r = claim_element$6(A, "DIV", { class: !0 });
      var f = children$7(r);
      a = claim_element$6(f, "PROGRESS", { style: !0, max: !0, class: !0 });
      var s = children$7(a);
      h = claim_text$3(s, l), s.forEach(detach$9), f.forEach(detach$9), A.forEach(detach$9), d = claim_space$6(b), _ = claim_element$6(b, "SPAN", { class: !0 });
      var u = children$7(_);
      y = claim_text$3(u, m), u.forEach(detach$9), b.forEach(detach$9), this.h();
    },
    h() {
      set_style$3(a, "visibility", "hidden"), set_style$3(a, "height", "0"), set_style$3(a, "width", "0"), a.value = c = getProgress(
        /*file_to_display*/
        n[2]
      ), attr$7(a, "max", "100"), attr$7(a, "class", "svelte-cr2edf"), attr$7(r, "class", "progress-bar svelte-cr2edf"), attr$7(_, "class", "file-name svelte-cr2edf"), attr$7(e, "class", "file svelte-cr2edf");
    },
    m(x, b) {
      insert_hydration$9(x, e, b), append_hydration$7(e, t), append_hydration$7(t, r), append_hydration$7(r, a), append_hydration$7(a, h), append_hydration$7(e, d), append_hydration$7(e, _), append_hydration$7(_, y);
    },
    p(x, b) {
      b & /*file_to_display*/
      4 && l !== (l = getProgress(
        /*file_to_display*/
        x[2]
      ) + "") && set_data$2(h, l), b & /*file_to_display*/
      4 && c !== (c = getProgress(
        /*file_to_display*/
        x[2]
      )) && (a.value = c), b & /*file_to_display*/
      4 && m !== (m = /*file_to_display*/
      x[2].orig_name + "") && set_data$2(y, m);
    },
    d(x) {
      x && detach$9(e);
    }
  };
}
function create_fragment$9(n) {
  let e, t, r, a = (
    /*files_with_progress*/
    n[0].length + ""
  ), l, h, c = (
    /*files_with_progress*/
    n[0].length > 1 ? "files" : "file"
  ), d, _, m, y = (
    /*file_to_display*/
    n[2] && create_if_block$6(n)
  );
  return {
    c() {
      e = element$6("div"), t = element$6("span"), r = text$3("Uploading "), l = text$3(a), h = space$6(), d = text$3(c), _ = text$3("..."), m = space$6(), y && y.c(), this.h();
    },
    l(x) {
      e = claim_element$6(x, "DIV", { class: !0 });
      var b = children$7(e);
      t = claim_element$6(b, "SPAN", { class: !0 });
      var A = children$7(t);
      r = claim_text$3(A, "Uploading "), l = claim_text$3(A, a), h = claim_space$6(A), d = claim_text$3(A, c), _ = claim_text$3(A, "..."), A.forEach(detach$9), m = claim_space$6(b), y && y.l(b), b.forEach(detach$9), this.h();
    },
    h() {
      attr$7(t, "class", "uploading svelte-cr2edf"), attr$7(e, "class", "wrap svelte-cr2edf"), toggle_class$4(
        e,
        "progress",
        /*progress*/
        n[1]
      );
    },
    m(x, b) {
      insert_hydration$9(x, e, b), append_hydration$7(e, t), append_hydration$7(t, r), append_hydration$7(t, l), append_hydration$7(t, h), append_hydration$7(t, d), append_hydration$7(t, _), append_hydration$7(e, m), y && y.m(e, null);
    },
    p(x, [b]) {
      b & /*files_with_progress*/
      1 && a !== (a = /*files_with_progress*/
      x[0].length + "") && set_data$2(l, a), b & /*files_with_progress*/
      1 && c !== (c = /*files_with_progress*/
      x[0].length > 1 ? "files" : "file") && set_data$2(d, c), /*file_to_display*/
      x[2] ? y ? y.p(x, b) : (y = create_if_block$6(x), y.c(), y.m(e, null)) : y && (y.d(1), y = null), b & /*progress*/
      2 && toggle_class$4(
        e,
        "progress",
        /*progress*/
        x[1]
      );
    },
    i: noop$6,
    o: noop$6,
    d(x) {
      x && detach$9(e), y && y.d();
    }
  };
}
function getProgress(n) {
  return n.progress * 100 / (n.size || 0) || 0;
}
function calculateTotalProgress(n) {
  let e = 0;
  return n.forEach((t) => {
    e += getProgress(t);
  }), document.documentElement.style.setProperty("--upload-progress-width", (e / n.length).toFixed(2) + "%"), e / n.length;
}
function instance$8(n, e, t) {
  var r = this && this.__awaiter || function(f, s, u, p) {
    function g(w) {
      return w instanceof u ? w : new u(function(o) {
        o(w);
      });
    }
    return new (u || (u = Promise))(function(w, o) {
      function v($) {
        try {
          E(p.next($));
        } catch (k) {
          o(k);
        }
      }
      function M($) {
        try {
          E(p.throw($));
        } catch (k) {
          o(k);
        }
      }
      function E($) {
        $.done ? w($.value) : g($.value).then(v, M);
      }
      E((p = p.apply(f, s || [])).next());
    });
  };
  let { upload_id: a } = e, { root: l } = e, { files: h } = e, { stream_handler: c } = e, d, _ = !1, m, y, x = h.map((f) => Object.assign(Object.assign({}, f), { progress: 0 }));
  const b = createEventDispatcher$5();
  function A(f, s) {
    t(0, x = x.map((u) => (u.orig_name === f && (u.progress += s), u)));
  }
  return onMount$1(() => r(void 0, void 0, void 0, function* () {
    if (d = yield c(new URL(`${l}/gradio_api/upload_progress?upload_id=${a}`)), d == null)
      throw new Error("Event source is not defined");
    d.onmessage = function(f) {
      return r(this, void 0, void 0, function* () {
        const s = JSON.parse(f.data);
        _ || t(1, _ = !0), s.msg === "done" ? (d == null || d.close(), b("done")) : (t(7, m = s), A(s.orig_name, s.chunk_size));
      });
    };
  })), onDestroy$1(() => {
    (d != null || d != null) && d.close();
  }), n.$$set = (f) => {
    "upload_id" in f && t(3, a = f.upload_id), "root" in f && t(4, l = f.root), "files" in f && t(5, h = f.files), "stream_handler" in f && t(6, c = f.stream_handler);
  }, n.$$.update = () => {
    n.$$.dirty & /*files_with_progress*/
    1 && calculateTotalProgress(x), n.$$.dirty & /*current_file_upload, files_with_progress*/
    129 && t(2, y = m || x[0]);
  }, [
    x,
    _,
    y,
    a,
    l,
    h,
    c,
    m
  ];
}
class UploadProgress extends SvelteComponent$9 {
  constructor(e) {
    super(), init$9(this, e, instance$8, create_fragment$9, safe_not_equal$9, {
      upload_id: 3,
      root: 4,
      files: 5,
      stream_handler: 6
    });
  }
}
const {
  SvelteComponent: SvelteComponent$8,
  append_hydration: append_hydration$6,
  attr: attr$6,
  binding_callbacks: binding_callbacks$2,
  bubble: bubble$1,
  check_outros: check_outros$5,
  children: children$6,
  claim_component: claim_component$5,
  claim_element: claim_element$5,
  claim_space: claim_space$5,
  create_component: create_component$5,
  create_slot: create_slot$3,
  destroy_component: destroy_component$5,
  detach: detach$8,
  element: element$5,
  empty: empty$3,
  get_all_dirty_from_scope: get_all_dirty_from_scope$3,
  get_slot_changes: get_slot_changes$3,
  group_outros: group_outros$5,
  init: init$8,
  insert_hydration: insert_hydration$8,
  listen: listen$1,
  mount_component: mount_component$5,
  prevent_default,
  run_all: run_all$1,
  safe_not_equal: safe_not_equal$8,
  set_style: set_style$2,
  space: space$5,
  stop_propagation,
  toggle_class: toggle_class$3,
  transition_in: transition_in$5,
  transition_out: transition_out$5,
  update_slot_base: update_slot_base$3
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$4, tick: tick$3 } = window.__gradio__svelte__internal;
function create_else_block$4(n) {
  let e, t, r, a, l, h, c, d, _, m, y;
  const x = (
    /*#slots*/
    n[27].default
  ), b = create_slot$3(
    x,
    n,
    /*$$scope*/
    n[26],
    null
  );
  return {
    c() {
      e = element$5("button"), b && b.c(), t = space$5(), r = element$5("input"), this.h();
    },
    l(A) {
      e = claim_element$5(A, "BUTTON", { tabindex: !0, class: !0 });
      var f = children$6(e);
      b && b.l(f), t = claim_space$5(f), r = claim_element$5(f, "INPUT", {
        "aria-label": !0,
        "data-testid": !0,
        type: !0,
        accept: !0,
        webkitdirectory: !0,
        mozdirectory: !0,
        class: !0
      }), f.forEach(detach$8), this.h();
    },
    h() {
      attr$6(r, "aria-label", "file upload"), attr$6(r, "data-testid", "file-upload"), attr$6(r, "type", "file"), attr$6(r, "accept", a = /*accept_file_types*/
      n[16] || void 0), r.multiple = l = /*file_count*/
      n[6] === "multiple" || void 0, attr$6(r, "webkitdirectory", h = /*file_count*/
      n[6] === "directory" || void 0), attr$6(r, "mozdirectory", c = /*file_count*/
      n[6] === "directory" || void 0), attr$6(r, "class", "svelte-1mceliw"), attr$6(e, "tabindex", d = /*hidden*/
      n[9] ? -1 : 0), attr$6(e, "class", "svelte-1mceliw"), toggle_class$3(
        e,
        "hidden",
        /*hidden*/
        n[9]
      ), toggle_class$3(
        e,
        "center",
        /*center*/
        n[4]
      ), toggle_class$3(
        e,
        "boundedheight",
        /*boundedheight*/
        n[3]
      ), toggle_class$3(
        e,
        "flex",
        /*flex*/
        n[5]
      ), toggle_class$3(
        e,
        "disable_click",
        /*disable_click*/
        n[7]
      ), set_style$2(e, "height", "100%");
    },
    m(A, f) {
      insert_hydration$8(A, e, f), b && b.m(e, null), append_hydration$6(e, t), append_hydration$6(e, r), n[35](r), _ = !0, m || (y = [
        listen$1(
          r,
          "change",
          /*load_files_from_upload*/
          n[18]
        ),
        listen$1(e, "drag", stop_propagation(prevent_default(
          /*drag_handler*/
          n[28]
        ))),
        listen$1(e, "dragstart", stop_propagation(prevent_default(
          /*dragstart_handler*/
          n[29]
        ))),
        listen$1(e, "dragend", stop_propagation(prevent_default(
          /*dragend_handler*/
          n[30]
        ))),
        listen$1(e, "dragover", stop_propagation(prevent_default(
          /*dragover_handler*/
          n[31]
        ))),
        listen$1(e, "dragenter", stop_propagation(prevent_default(
          /*dragenter_handler*/
          n[32]
        ))),
        listen$1(e, "dragleave", stop_propagation(prevent_default(
          /*dragleave_handler*/
          n[33]
        ))),
        listen$1(e, "drop", stop_propagation(prevent_default(
          /*drop_handler*/
          n[34]
        ))),
        listen$1(
          e,
          "click",
          /*open_file_upload*/
          n[13]
        ),
        listen$1(
          e,
          "drop",
          /*loadFilesFromDrop*/
          n[19]
        ),
        listen$1(
          e,
          "dragenter",
          /*updateDragging*/
          n[17]
        ),
        listen$1(
          e,
          "dragleave",
          /*updateDragging*/
          n[17]
        )
      ], m = !0);
    },
    p(A, f) {
      b && b.p && (!_ || f[0] & /*$$scope*/
      67108864) && update_slot_base$3(
        b,
        x,
        A,
        /*$$scope*/
        A[26],
        _ ? get_slot_changes$3(
          x,
          /*$$scope*/
          A[26],
          f,
          null
        ) : get_all_dirty_from_scope$3(
          /*$$scope*/
          A[26]
        ),
        null
      ), (!_ || f[0] & /*accept_file_types*/
      65536 && a !== (a = /*accept_file_types*/
      A[16] || void 0)) && attr$6(r, "accept", a), (!_ || f[0] & /*file_count*/
      64 && l !== (l = /*file_count*/
      A[6] === "multiple" || void 0)) && (r.multiple = l), (!_ || f[0] & /*file_count*/
      64 && h !== (h = /*file_count*/
      A[6] === "directory" || void 0)) && attr$6(r, "webkitdirectory", h), (!_ || f[0] & /*file_count*/
      64 && c !== (c = /*file_count*/
      A[6] === "directory" || void 0)) && attr$6(r, "mozdirectory", c), (!_ || f[0] & /*hidden*/
      512 && d !== (d = /*hidden*/
      A[9] ? -1 : 0)) && attr$6(e, "tabindex", d), (!_ || f[0] & /*hidden*/
      512) && toggle_class$3(
        e,
        "hidden",
        /*hidden*/
        A[9]
      ), (!_ || f[0] & /*center*/
      16) && toggle_class$3(
        e,
        "center",
        /*center*/
        A[4]
      ), (!_ || f[0] & /*boundedheight*/
      8) && toggle_class$3(
        e,
        "boundedheight",
        /*boundedheight*/
        A[3]
      ), (!_ || f[0] & /*flex*/
      32) && toggle_class$3(
        e,
        "flex",
        /*flex*/
        A[5]
      ), (!_ || f[0] & /*disable_click*/
      128) && toggle_class$3(
        e,
        "disable_click",
        /*disable_click*/
        A[7]
      );
    },
    i(A) {
      _ || (transition_in$5(b, A), _ = !0);
    },
    o(A) {
      transition_out$5(b, A), _ = !1;
    },
    d(A) {
      A && detach$8(e), b && b.d(A), n[35](null), m = !1, run_all$1(y);
    }
  };
}
function create_if_block_1$4(n) {
  let e, t, r = !/*hidden*/
  n[9] && create_if_block_2$2(n);
  return {
    c() {
      r && r.c(), e = empty$3();
    },
    l(a) {
      r && r.l(a), e = empty$3();
    },
    m(a, l) {
      r && r.m(a, l), insert_hydration$8(a, e, l), t = !0;
    },
    p(a, l) {
      /*hidden*/
      a[9] ? r && (group_outros$5(), transition_out$5(r, 1, 1, () => {
        r = null;
      }), check_outros$5()) : r ? (r.p(a, l), l[0] & /*hidden*/
      512 && transition_in$5(r, 1)) : (r = create_if_block_2$2(a), r.c(), transition_in$5(r, 1), r.m(e.parentNode, e));
    },
    i(a) {
      t || (transition_in$5(r), t = !0);
    },
    o(a) {
      transition_out$5(r), t = !1;
    },
    d(a) {
      a && detach$8(e), r && r.d(a);
    }
  };
}
function create_if_block$5(n) {
  let e, t, r, a, l;
  const h = (
    /*#slots*/
    n[27].default
  ), c = create_slot$3(
    h,
    n,
    /*$$scope*/
    n[26],
    null
  );
  return {
    c() {
      e = element$5("button"), c && c.c(), this.h();
    },
    l(d) {
      e = claim_element$5(d, "BUTTON", { tabindex: !0, class: !0 });
      var _ = children$6(e);
      c && c.l(_), _.forEach(detach$8), this.h();
    },
    h() {
      attr$6(e, "tabindex", t = /*hidden*/
      n[9] ? -1 : 0), attr$6(e, "class", "svelte-1mceliw"), toggle_class$3(
        e,
        "hidden",
        /*hidden*/
        n[9]
      ), toggle_class$3(
        e,
        "center",
        /*center*/
        n[4]
      ), toggle_class$3(
        e,
        "boundedheight",
        /*boundedheight*/
        n[3]
      ), toggle_class$3(
        e,
        "flex",
        /*flex*/
        n[5]
      ), set_style$2(e, "height", "100%");
    },
    m(d, _) {
      insert_hydration$8(d, e, _), c && c.m(e, null), r = !0, a || (l = listen$1(
        e,
        "click",
        /*paste_clipboard*/
        n[12]
      ), a = !0);
    },
    p(d, _) {
      c && c.p && (!r || _[0] & /*$$scope*/
      67108864) && update_slot_base$3(
        c,
        h,
        d,
        /*$$scope*/
        d[26],
        r ? get_slot_changes$3(
          h,
          /*$$scope*/
          d[26],
          _,
          null
        ) : get_all_dirty_from_scope$3(
          /*$$scope*/
          d[26]
        ),
        null
      ), (!r || _[0] & /*hidden*/
      512 && t !== (t = /*hidden*/
      d[9] ? -1 : 0)) && attr$6(e, "tabindex", t), (!r || _[0] & /*hidden*/
      512) && toggle_class$3(
        e,
        "hidden",
        /*hidden*/
        d[9]
      ), (!r || _[0] & /*center*/
      16) && toggle_class$3(
        e,
        "center",
        /*center*/
        d[4]
      ), (!r || _[0] & /*boundedheight*/
      8) && toggle_class$3(
        e,
        "boundedheight",
        /*boundedheight*/
        d[3]
      ), (!r || _[0] & /*flex*/
      32) && toggle_class$3(
        e,
        "flex",
        /*flex*/
        d[5]
      );
    },
    i(d) {
      r || (transition_in$5(c, d), r = !0);
    },
    o(d) {
      transition_out$5(c, d), r = !1;
    },
    d(d) {
      d && detach$8(e), c && c.d(d), a = !1, l();
    }
  };
}
function create_if_block_2$2(n) {
  let e, t;
  return e = new UploadProgress({
    props: {
      root: (
        /*root*/
        n[8]
      ),
      upload_id: (
        /*upload_id*/
        n[14]
      ),
      files: (
        /*file_data*/
        n[15]
      ),
      stream_handler: (
        /*stream_handler*/
        n[11]
      )
    }
  }), {
    c() {
      create_component$5(e.$$.fragment);
    },
    l(r) {
      claim_component$5(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$5(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a[0] & /*root*/
      256 && (l.root = /*root*/
      r[8]), a[0] & /*upload_id*/
      16384 && (l.upload_id = /*upload_id*/
      r[14]), a[0] & /*file_data*/
      32768 && (l.files = /*file_data*/
      r[15]), a[0] & /*stream_handler*/
      2048 && (l.stream_handler = /*stream_handler*/
      r[11]), e.$set(l);
    },
    i(r) {
      t || (transition_in$5(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$5(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$5(e, r);
    }
  };
}
function create_fragment$8(n) {
  let e, t, r, a;
  const l = [create_if_block$5, create_if_block_1$4, create_else_block$4], h = [];
  function c(d, _) {
    return (
      /*filetype*/
      d[0] === "clipboard" ? 0 : (
        /*uploading*/
        d[1] && /*show_progress*/
        d[10] ? 1 : 2
      )
    );
  }
  return e = c(n), t = h[e] = l[e](n), {
    c() {
      t.c(), r = empty$3();
    },
    l(d) {
      t.l(d), r = empty$3();
    },
    m(d, _) {
      h[e].m(d, _), insert_hydration$8(d, r, _), a = !0;
    },
    p(d, _) {
      let m = e;
      e = c(d), e === m ? h[e].p(d, _) : (group_outros$5(), transition_out$5(h[m], 1, 1, () => {
        h[m] = null;
      }), check_outros$5(), t = h[e], t ? t.p(d, _) : (t = h[e] = l[e](d), t.c()), transition_in$5(t, 1), t.m(r.parentNode, r));
    },
    i(d) {
      a || (transition_in$5(t), a = !0);
    },
    o(d) {
      transition_out$5(t), a = !1;
    },
    d(d) {
      d && detach$8(r), h[e].d(d);
    }
  };
}
function is_valid_mimetype(n, e, t) {
  if (!n || n === "*" || n === "file/*" || Array.isArray(n) && n.some((a) => a === "*" || a === "file/*"))
    return !0;
  let r;
  if (typeof n == "string")
    r = n.split(",").map((a) => a.trim());
  else if (Array.isArray(n))
    r = n;
  else
    return !1;
  return r.includes(e) || r.some((a) => {
    const [l] = a.split("/").map((h) => h.trim());
    return a.endsWith("/*") && t.startsWith(l + "/");
  });
}
function instance$7(n, e, t) {
  let r, { $$slots: a = {}, $$scope: l } = e;
  var h = this && this.__awaiter || function(se, Ae, he, ne) {
    function _e(Le) {
      return Le instanceof he ? Le : new he(function(Be) {
        Be(Le);
      });
    }
    return new (he || (he = Promise))(function(Le, Be) {
      function Ue(Ge) {
        try {
          We(ne.next(Ge));
        } catch (Ne) {
          Be(Ne);
        }
      }
      function He(Ge) {
        try {
          We(ne.throw(Ge));
        } catch (Ne) {
          Be(Ne);
        }
      }
      function We(Ge) {
        Ge.done ? Le(Ge.value) : _e(Ge.value).then(Ue, He);
      }
      We((ne = ne.apply(se, Ae || [])).next());
    });
  };
  let { filetype: c = null } = e, { dragging: d = !1 } = e, { boundedheight: _ = !0 } = e, { center: m = !0 } = e, { flex: y = !0 } = e, { file_count: x = "single" } = e, { disable_click: b = !1 } = e, { root: A } = e, { hidden: f = !1 } = e, { format: s = "file" } = e, { uploading: u = !1 } = e, { hidden_upload: p = null } = e, { show_progress: g = !0 } = e, { max_file_size: w = null } = e, { upload: o } = e, { stream_handler: v } = e, M, E, $, k = null;
  const L = () => {
    if (typeof navigator < "u") {
      const se = navigator.userAgent.toLowerCase();
      return se.indexOf("iphone") > -1 || se.indexOf("ipad") > -1;
    }
    return !1;
  }, z = createEventDispatcher$4(), O = ["image", "video", "audio", "text", "file"], R = (se) => r && se.startsWith(".") ? (k = !0, se) : r && se.includes("file/*") ? "*" : se.startsWith(".") || se.endsWith("/*") ? se : O.includes(se) ? se + "/*" : "." + se;
  function N() {
    t(20, d = !d);
  }
  function W() {
    navigator.clipboard.read().then((se) => h(this, void 0, void 0, function* () {
      for (let Ae = 0; Ae < se.length; Ae++) {
        const he = se[Ae].types.find((ne) => ne.startsWith("image/"));
        if (he) {
          se[Ae].getType(he).then((ne) => h(this, void 0, void 0, function* () {
            const _e = new File([ne], `clipboard.${he.replace("image/", "")}`);
            yield G([_e]);
          }));
          break;
        }
      }
    }));
  }
  function B() {
    b || p && (t(2, p.value = "", p), p.click());
  }
  function P(se) {
    return h(this, void 0, void 0, function* () {
      yield tick$3(), t(14, M = Math.random().toString(36).substring(2, 15)), t(1, u = !0);
      try {
        const Ae = yield o(se, A, M, w ?? 1 / 0);
        return z("load", x === "single" ? Ae == null ? void 0 : Ae[0] : Ae), t(1, u = !1), Ae || [];
      } catch (Ae) {
        return z("error", Ae.message), t(1, u = !1), [];
      }
    });
  }
  function G(se) {
    return h(this, void 0, void 0, function* () {
      if (!se.length)
        return;
      let Ae = se.map((he) => new File([he], he instanceof File ? he.name : "file", { type: he.type }));
      return r && k && (Ae = Ae.filter((he) => H(he) ? !0 : (z("error", `Invalid file type: ${he.name}. Only ${c} allowed.`), !1)), Ae.length === 0) ? [] : (t(15, E = yield prepare_files(Ae)), yield P(E));
    });
  }
  function H(se) {
    return c ? (Array.isArray(c) ? c : [c]).some((he) => {
      const ne = R(he);
      if (ne.startsWith("."))
        return se.name.toLowerCase().endsWith(ne.toLowerCase());
      if (ne === "*")
        return !0;
      if (ne.endsWith("/*")) {
        const [_e] = ne.split("/");
        return se.type.startsWith(_e + "/");
      }
      return se.type === ne;
    }) : !0;
  }
  function U(se) {
    return h(this, void 0, void 0, function* () {
      const Ae = se.target;
      if (Ae.files)
        if (s != "blob")
          yield G(Array.from(Ae.files));
        else {
          if (x === "single") {
            z("load", Ae.files[0]);
            return;
          }
          z("load", Ae.files);
        }
    });
  }
  function j(se) {
    return h(this, void 0, void 0, function* () {
      var Ae;
      if (t(20, d = !1), !(!((Ae = se.dataTransfer) === null || Ae === void 0) && Ae.files)) return;
      const he = Array.from(se.dataTransfer.files).filter((ne) => {
        const _e = "." + ne.name.split(".").pop();
        return _e && is_valid_mimetype($, _e, ne.type) || (_e && Array.isArray(c) ? c.includes(_e) : _e === c) ? !0 : (z("error", `Invalid file type only ${c} allowed.`), !1);
      });
      if (s != "blob")
        yield G(he);
      else {
        if (x === "single") {
          z("load", he[0]);
          return;
        }
        z("load", he);
      }
    });
  }
  function re(se) {
    bubble$1.call(this, n, se);
  }
  function ie(se) {
    bubble$1.call(this, n, se);
  }
  function te(se) {
    bubble$1.call(this, n, se);
  }
  function ue(se) {
    bubble$1.call(this, n, se);
  }
  function de(se) {
    bubble$1.call(this, n, se);
  }
  function oe(se) {
    bubble$1.call(this, n, se);
  }
  function J(se) {
    bubble$1.call(this, n, se);
  }
  function Ee(se) {
    binding_callbacks$2[se ? "unshift" : "push"](() => {
      p = se, t(2, p);
    });
  }
  return n.$$set = (se) => {
    "filetype" in se && t(0, c = se.filetype), "dragging" in se && t(20, d = se.dragging), "boundedheight" in se && t(3, _ = se.boundedheight), "center" in se && t(4, m = se.center), "flex" in se && t(5, y = se.flex), "file_count" in se && t(6, x = se.file_count), "disable_click" in se && t(7, b = se.disable_click), "root" in se && t(8, A = se.root), "hidden" in se && t(9, f = se.hidden), "format" in se && t(21, s = se.format), "uploading" in se && t(1, u = se.uploading), "hidden_upload" in se && t(2, p = se.hidden_upload), "show_progress" in se && t(10, g = se.show_progress), "max_file_size" in se && t(22, w = se.max_file_size), "upload" in se && t(23, o = se.upload), "stream_handler" in se && t(11, v = se.stream_handler), "$$scope" in se && t(26, l = se.$$scope);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*filetype, ios*/
    33554433 && (c == null ? t(16, $ = null) : typeof c == "string" ? t(16, $ = R(c)) : r && c.includes("file/*") ? t(16, $ = "*") : (t(0, c = c.map(R)), t(16, $ = c.join(", "))));
  }, t(25, r = L()), [
    c,
    u,
    p,
    _,
    m,
    y,
    x,
    b,
    A,
    f,
    g,
    v,
    W,
    B,
    M,
    E,
    $,
    N,
    U,
    j,
    d,
    s,
    w,
    o,
    G,
    r,
    l,
    a,
    re,
    ie,
    te,
    ue,
    de,
    oe,
    J,
    Ee
  ];
}
class Upload extends SvelteComponent$8 {
  constructor(e) {
    super(), init$8(
      this,
      e,
      instance$7,
      create_fragment$8,
      safe_not_equal$8,
      {
        filetype: 0,
        dragging: 20,
        boundedheight: 3,
        center: 4,
        flex: 5,
        file_count: 6,
        disable_click: 7,
        root: 8,
        hidden: 9,
        format: 21,
        uploading: 1,
        hidden_upload: 2,
        show_progress: 10,
        max_file_size: 22,
        upload: 23,
        stream_handler: 11,
        paste_clipboard: 12,
        open_file_upload: 13,
        load_files: 24
      },
      null,
      [-1, -1]
    );
  }
  get paste_clipboard() {
    return this.$$.ctx[12];
  }
  get open_file_upload() {
    return this.$$.ctx[13];
  }
  get load_files() {
    return this.$$.ctx[24];
  }
}
const {
  SvelteComponent: SvelteComponent$7,
  check_outros: check_outros$4,
  claim_component: claim_component$4,
  claim_space: claim_space$4,
  create_component: create_component$4,
  create_slot: create_slot$2,
  destroy_component: destroy_component$4,
  detach: detach$7,
  get_all_dirty_from_scope: get_all_dirty_from_scope$2,
  get_slot_changes: get_slot_changes$2,
  group_outros: group_outros$4,
  init: init$7,
  insert_hydration: insert_hydration$7,
  mount_component: mount_component$4,
  safe_not_equal: safe_not_equal$7,
  space: space$4,
  transition_in: transition_in$4,
  transition_out: transition_out$4,
  update_slot_base: update_slot_base$2
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$3 } = window.__gradio__svelte__internal;
function create_if_block_2$1(n) {
  let e, t;
  return e = new IconButton({
    props: {
      Icon: Edit,
      label: (
        /*i18n*/
        n[3]("common.edit")
      )
    }
  }), e.$on(
    "click",
    /*click_handler*/
    n[6]
  ), {
    c() {
      create_component$4(e.$$.fragment);
    },
    l(r) {
      claim_component$4(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$4(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*i18n*/
      8 && (l.label = /*i18n*/
      r[3]("common.edit")), e.$set(l);
    },
    i(r) {
      t || (transition_in$4(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$4(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$4(e, r);
    }
  };
}
function create_if_block_1$3(n) {
  let e, t;
  return e = new IconButton({
    props: {
      Icon: Undo,
      label: (
        /*i18n*/
        n[3]("common.undo")
      )
    }
  }), e.$on(
    "click",
    /*click_handler_1*/
    n[7]
  ), {
    c() {
      create_component$4(e.$$.fragment);
    },
    l(r) {
      claim_component$4(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$4(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*i18n*/
      8 && (l.label = /*i18n*/
      r[3]("common.undo")), e.$set(l);
    },
    i(r) {
      t || (transition_in$4(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$4(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$4(e, r);
    }
  };
}
function create_if_block$4(n) {
  let e, t;
  return e = new DownloadLink({
    props: {
      href: (
        /*download*/
        n[2]
      ),
      download: !0,
      $$slots: { default: [create_default_slot_1$1] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      create_component$4(e.$$.fragment);
    },
    l(r) {
      claim_component$4(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$4(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*download*/
      4 && (l.href = /*download*/
      r[2]), a & /*$$scope, i18n*/
      520 && (l.$$scope = { dirty: a, ctx: r }), e.$set(l);
    },
    i(r) {
      t || (transition_in$4(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$4(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$4(e, r);
    }
  };
}
function create_default_slot_1$1(n) {
  let e, t;
  return e = new IconButton({
    props: {
      Icon: Download,
      label: (
        /*i18n*/
        n[3]("common.download")
      )
    }
  }), {
    c() {
      create_component$4(e.$$.fragment);
    },
    l(r) {
      claim_component$4(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$4(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*i18n*/
      8 && (l.label = /*i18n*/
      r[3]("common.download")), e.$set(l);
    },
    i(r) {
      t || (transition_in$4(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$4(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$4(e, r);
    }
  };
}
function create_default_slot$2(n) {
  let e, t, r, a, l, h, c = (
    /*editable*/
    n[0] && create_if_block_2$1(n)
  ), d = (
    /*undoable*/
    n[1] && create_if_block_1$3(n)
  ), _ = (
    /*download*/
    n[2] && create_if_block$4(n)
  );
  const m = (
    /*#slots*/
    n[5].default
  ), y = create_slot$2(
    m,
    n,
    /*$$scope*/
    n[9],
    null
  );
  return l = new IconButton({
    props: {
      Icon: Clear,
      label: (
        /*i18n*/
        n[3]("common.clear")
      )
    }
  }), l.$on(
    "click",
    /*click_handler_2*/
    n[8]
  ), {
    c() {
      c && c.c(), e = space$4(), d && d.c(), t = space$4(), _ && _.c(), r = space$4(), y && y.c(), a = space$4(), create_component$4(l.$$.fragment);
    },
    l(x) {
      c && c.l(x), e = claim_space$4(x), d && d.l(x), t = claim_space$4(x), _ && _.l(x), r = claim_space$4(x), y && y.l(x), a = claim_space$4(x), claim_component$4(l.$$.fragment, x);
    },
    m(x, b) {
      c && c.m(x, b), insert_hydration$7(x, e, b), d && d.m(x, b), insert_hydration$7(x, t, b), _ && _.m(x, b), insert_hydration$7(x, r, b), y && y.m(x, b), insert_hydration$7(x, a, b), mount_component$4(l, x, b), h = !0;
    },
    p(x, b) {
      /*editable*/
      x[0] ? c ? (c.p(x, b), b & /*editable*/
      1 && transition_in$4(c, 1)) : (c = create_if_block_2$1(x), c.c(), transition_in$4(c, 1), c.m(e.parentNode, e)) : c && (group_outros$4(), transition_out$4(c, 1, 1, () => {
        c = null;
      }), check_outros$4()), /*undoable*/
      x[1] ? d ? (d.p(x, b), b & /*undoable*/
      2 && transition_in$4(d, 1)) : (d = create_if_block_1$3(x), d.c(), transition_in$4(d, 1), d.m(t.parentNode, t)) : d && (group_outros$4(), transition_out$4(d, 1, 1, () => {
        d = null;
      }), check_outros$4()), /*download*/
      x[2] ? _ ? (_.p(x, b), b & /*download*/
      4 && transition_in$4(_, 1)) : (_ = create_if_block$4(x), _.c(), transition_in$4(_, 1), _.m(r.parentNode, r)) : _ && (group_outros$4(), transition_out$4(_, 1, 1, () => {
        _ = null;
      }), check_outros$4()), y && y.p && (!h || b & /*$$scope*/
      512) && update_slot_base$2(
        y,
        m,
        x,
        /*$$scope*/
        x[9],
        h ? get_slot_changes$2(
          m,
          /*$$scope*/
          x[9],
          b,
          null
        ) : get_all_dirty_from_scope$2(
          /*$$scope*/
          x[9]
        ),
        null
      );
      const A = {};
      b & /*i18n*/
      8 && (A.label = /*i18n*/
      x[3]("common.clear")), l.$set(A);
    },
    i(x) {
      h || (transition_in$4(c), transition_in$4(d), transition_in$4(_), transition_in$4(y, x), transition_in$4(l.$$.fragment, x), h = !0);
    },
    o(x) {
      transition_out$4(c), transition_out$4(d), transition_out$4(_), transition_out$4(y, x), transition_out$4(l.$$.fragment, x), h = !1;
    },
    d(x) {
      x && (detach$7(e), detach$7(t), detach$7(r), detach$7(a)), c && c.d(x), d && d.d(x), _ && _.d(x), y && y.d(x), destroy_component$4(l, x);
    }
  };
}
function create_fragment$7(n) {
  let e, t;
  return e = new IconButtonWrapper({
    props: {
      $$slots: { default: [create_default_slot$2] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      create_component$4(e.$$.fragment);
    },
    l(r) {
      claim_component$4(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$4(e, r, a), t = !0;
    },
    p(r, [a]) {
      const l = {};
      a & /*$$scope, i18n, download, undoable, editable*/
      527 && (l.$$scope = { dirty: a, ctx: r }), e.$set(l);
    },
    i(r) {
      t || (transition_in$4(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$4(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$4(e, r);
    }
  };
}
function instance$6(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e, { editable: l = !1 } = e, { undoable: h = !1 } = e, { download: c = null } = e, { i18n: d } = e;
  const _ = createEventDispatcher$3(), m = () => _("edit"), y = () => _("undo"), x = (b) => {
    _("clear"), b.stopPropagation();
  };
  return n.$$set = (b) => {
    "editable" in b && t(0, l = b.editable), "undoable" in b && t(1, h = b.undoable), "download" in b && t(2, c = b.download), "i18n" in b && t(3, d = b.i18n), "$$scope" in b && t(9, a = b.$$scope);
  }, [
    l,
    h,
    c,
    d,
    _,
    r,
    m,
    y,
    x,
    a
  ];
}
class ModifyUpload extends SvelteComponent$7 {
  constructor(e) {
    super(), init$7(this, e, instance$6, create_fragment$7, safe_not_equal$7, {
      editable: 0,
      undoable: 1,
      download: 2,
      i18n: 3
    });
  }
}
const {
  SvelteComponent: SvelteComponent$6,
  append_hydration: append_hydration$5,
  attr: attr$5,
  children: children$5,
  claim_svg_element: claim_svg_element$2,
  detach: detach$6,
  init: init$6,
  insert_hydration: insert_hydration$6,
  noop: noop$5,
  safe_not_equal: safe_not_equal$6,
  svg_element: svg_element$2
} = window.__gradio__svelte__internal;
function create_fragment$6(n) {
  let e, t, r, a, l, h, c, d, _, m, y, x;
  return {
    c() {
      e = svg_element$2("svg"), t = svg_element$2("defs"), r = svg_element$2("linearGradient"), a = svg_element$2("stop"), l = svg_element$2("stop"), h = svg_element$2("stop"), c = svg_element$2("g"), d = svg_element$2("g"), _ = svg_element$2("path"), m = svg_element$2("animateTransform"), y = svg_element$2("circle"), x = svg_element$2("animateTransform"), this.h();
    },
    l(b) {
      e = claim_svg_element$2(b, "svg", {
        width: !0,
        height: !0,
        viewBox: !0,
        xmlns: !0
      });
      var A = children$5(e);
      t = claim_svg_element$2(A, "defs", {});
      var f = children$5(t);
      r = claim_svg_element$2(f, "linearGradient", {
        x1: !0,
        y1: !0,
        x2: !0,
        y2: !0,
        id: !0
      });
      var s = children$5(r);
      a = claim_svg_element$2(s, "stop", {
        "stop-color": !0,
        "stop-opacity": !0,
        offset: !0
      }), children$5(a).forEach(detach$6), l = claim_svg_element$2(s, "stop", {
        "stop-color": !0,
        "stop-opacity": !0,
        offset: !0
      }), children$5(l).forEach(detach$6), h = claim_svg_element$2(s, "stop", { "stop-color": !0, offset: !0 }), children$5(h).forEach(detach$6), s.forEach(detach$6), f.forEach(detach$6), c = claim_svg_element$2(A, "g", { fill: !0, "fill-rule": !0 });
      var u = children$5(c);
      d = claim_svg_element$2(u, "g", { transform: !0 });
      var p = children$5(d);
      _ = claim_svg_element$2(p, "path", {
        d: !0,
        id: !0,
        stroke: !0,
        "stroke-width": !0
      });
      var g = children$5(_);
      m = claim_svg_element$2(g, "animateTransform", {
        attributeName: !0,
        type: !0,
        from: !0,
        to: !0,
        dur: !0,
        repeatCount: !0
      }), children$5(m).forEach(detach$6), g.forEach(detach$6), y = claim_svg_element$2(p, "circle", { fill: !0, cx: !0, cy: !0, r: !0 });
      var w = children$5(y);
      x = claim_svg_element$2(w, "animateTransform", {
        attributeName: !0,
        type: !0,
        from: !0,
        to: !0,
        dur: !0,
        repeatCount: !0
      }), children$5(x).forEach(detach$6), w.forEach(detach$6), p.forEach(detach$6), u.forEach(detach$6), A.forEach(detach$6), this.h();
    },
    h() {
      attr$5(a, "stop-color", "#FF7C00"), attr$5(a, "stop-opacity", "0"), attr$5(a, "offset", "0%"), attr$5(l, "stop-color", "#FF7C00"), attr$5(l, "stop-opacity", ".631"), attr$5(l, "offset", "63.146%"), attr$5(h, "stop-color", "#FF7C00"), attr$5(h, "offset", "100%"), attr$5(r, "x1", "8.042%"), attr$5(r, "y1", "0%"), attr$5(r, "x2", "65.682%"), attr$5(r, "y2", "23.865%"), attr$5(r, "id", "a"), attr$5(m, "attributeName", "transform"), attr$5(m, "type", "rotate"), attr$5(m, "from", "0 18 18"), attr$5(m, "to", "360 18 18"), attr$5(m, "dur", "0.9s"), attr$5(m, "repeatCount", "indefinite"), attr$5(_, "d", "M36 18c0-9.94-8.06-18-18-18"), attr$5(_, "id", "Oval-2"), attr$5(_, "stroke", "url(#a)"), attr$5(_, "stroke-width", "2"), attr$5(x, "attributeName", "transform"), attr$5(x, "type", "rotate"), attr$5(x, "from", "0 18 18"), attr$5(x, "to", "360 18 18"), attr$5(x, "dur", "0.9s"), attr$5(x, "repeatCount", "indefinite"), attr$5(y, "fill", "#FFf"), attr$5(y, "cx", "36"), attr$5(y, "cy", "18"), attr$5(y, "r", "1"), attr$5(d, "transform", "translate(1 1)"), attr$5(c, "fill", "none"), attr$5(c, "fill-rule", "evenodd"), attr$5(e, "width", "20"), attr$5(e, "height", "20 "), attr$5(e, "viewBox", "0 0 38 38"), attr$5(e, "xmlns", "http://www.w3.org/2000/svg");
    },
    m(b, A) {
      insert_hydration$6(b, e, A), append_hydration$5(e, t), append_hydration$5(t, r), append_hydration$5(r, a), append_hydration$5(r, l), append_hydration$5(r, h), append_hydration$5(e, c), append_hydration$5(c, d), append_hydration$5(d, _), append_hydration$5(_, m), append_hydration$5(d, y), append_hydration$5(y, x);
    },
    p: noop$5,
    i: noop$5,
    o: noop$5,
    d(b) {
      b && detach$6(e);
    }
  };
}
class Loading_spinner extends SvelteComponent$6 {
  constructor(e) {
    super(), init$6(this, e, null, create_fragment$6, safe_not_equal$6, {});
  }
}
const {
  SvelteComponent: SvelteComponent$5,
  append_hydration: append_hydration$4,
  attr: attr$4,
  check_outros: check_outros$3,
  children: children$4,
  claim_component: claim_component$3,
  claim_element: claim_element$4,
  claim_space: claim_space$3,
  create_component: create_component$3,
  destroy_component: destroy_component$3,
  detach: detach$5,
  element: element$4,
  get_svelte_dataset: get_svelte_dataset$1,
  group_outros: group_outros$3,
  init: init$5,
  insert_hydration: insert_hydration$5,
  listen,
  mount_component: mount_component$3,
  noop: noop$4,
  run_all,
  safe_not_equal: safe_not_equal$5,
  set_input_value,
  space: space$3,
  transition_in: transition_in$3,
  transition_out: transition_out$3
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$2, tick: tick$2 } = window.__gradio__svelte__internal;
function create_else_block$3(n) {
  let e, t = "Fetch";
  return {
    c() {
      e = element$4("span"), e.textContent = t;
    },
    l(r) {
      e = claim_element$4(r, "SPAN", { "data-svelte-h": !0 }), get_svelte_dataset$1(e) !== "svelte-1jow5fm" && (e.textContent = t);
    },
    m(r, a) {
      insert_hydration$5(r, e, a);
    },
    i: noop$4,
    o: noop$4,
    d(r) {
      r && detach$5(e);
    }
  };
}
function create_if_block$3(n) {
  let e, t;
  return e = new Loading_spinner({}), {
    c() {
      create_component$3(e.$$.fragment);
    },
    l(r) {
      claim_component$3(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$3(e, r, a), t = !0;
    },
    i(r) {
      t || (transition_in$3(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$3(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$3(e, r);
    }
  };
}
function create_fragment$5(n) {
  let e, t, r, a, l, h, c = "PDB Assym. Unit", d, _ = "PDB BioAssembly", m, y = "AlphaFold DB", x, b = "ESMFold DB", A, f, s, u, p, g, w = "- or -", o, v, M;
  const E = [create_if_block$3, create_else_block$3], $ = [];
  function k(L, z) {
    return (
      /*loading*/
      L[1] ? 0 : 1
    );
  }
  return s = k(n), u = $[s] = E[s](n), {
    c() {
      e = element$4("div"), t = element$4("div"), r = element$4("input"), a = space$3(), l = element$4("select"), h = element$4("option"), h.textContent = c, d = element$4("option"), d.textContent = _, m = element$4("option"), m.textContent = y, x = element$4("option"), x.textContent = b, A = space$3(), f = element$4("button"), u.c(), p = space$3(), g = element$4("span"), g.textContent = w, this.h();
    },
    l(L) {
      e = claim_element$4(L, "DIV", { class: !0 });
      var z = children$4(e);
      t = claim_element$4(z, "DIV", { class: !0 });
      var O = children$4(t);
      r = claim_element$4(O, "INPUT", {
        type: !0,
        placeholder: !0,
        class: !0
      }), a = claim_space$3(O), l = claim_element$4(O, "SELECT", { name: !0, id: !0, class: !0 });
      var R = children$4(l);
      h = claim_element$4(R, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$1(h) !== "svelte-qgpnsj" && (h.textContent = c), d = claim_element$4(R, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$1(d) !== "svelte-q1k5ac" && (d.textContent = _), m = claim_element$4(R, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$1(m) !== "svelte-s0for2" && (m.textContent = y), x = claim_element$4(R, "OPTION", { "data-svelte-h": !0 }), get_svelte_dataset$1(x) !== "svelte-1l46pah" && (x.textContent = b), R.forEach(detach$5), O.forEach(detach$5), A = claim_space$3(z), f = claim_element$4(z, "BUTTON", { class: !0 });
      var N = children$4(f);
      u.l(N), N.forEach(detach$5), z.forEach(detach$5), p = claim_space$3(L), g = claim_element$4(L, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset$1(g) !== "svelte-vmas2q" && (g.textContent = w), this.h();
    },
    h() {
      attr$4(r, "type", "text"), attr$4(
        r,
        "placeholder",
        /*placeholder*/
        n[2]
      ), attr$4(r, "class", "wfull inp svelte-1nnwgsd"), h.__value = "pdb_assym", set_input_value(h, h.__value), d.__value = "pdb_bioass", set_input_value(d, d.__value), m.__value = "af", set_input_value(m, m.__value), x.__value = "esm", set_input_value(x, x.__value), attr$4(l, "name", ""), attr$4(l, "id", ""), attr$4(l, "class", "select svelte-1nnwgsd"), attr$4(t, "class", "flex input wfull svelte-1nnwgsd"), attr$4(f, "class", "btn text-center svelte-1nnwgsd"), attr$4(e, "class", "flex mt-2 svelte-1nnwgsd"), attr$4(g, "class", "or py svelte-1nnwgsd");
    },
    m(L, z) {
      insert_hydration$5(L, e, z), append_hydration$4(e, t), append_hydration$4(t, r), set_input_value(
        r,
        /*textInput*/
        n[3]
      ), append_hydration$4(t, a), append_hydration$4(t, l), append_hydration$4(l, h), append_hydration$4(l, d), append_hydration$4(l, m), append_hydration$4(l, x), append_hydration$4(e, A), append_hydration$4(e, f), $[s].m(f, null), insert_hydration$5(L, p, z), insert_hydration$5(L, g, z), o = !0, v || (M = [
        listen(
          r,
          "input",
          /*input_input_handler*/
          n[9]
        ),
        listen(
          r,
          "keydown",
          /*isEnterPressed*/
          n[6]
        ),
        listen(
          l,
          "change",
          /*handleSelect*/
          n[5]
        ),
        listen(
          f,
          "click",
          /*click_handler*/
          n[10]
        )
      ], v = !0);
    },
    p(L, [z]) {
      (!o || z & /*placeholder*/
      4) && attr$4(
        r,
        "placeholder",
        /*placeholder*/
        L[2]
      ), z & /*textInput*/
      8 && r.value !== /*textInput*/
      L[3] && set_input_value(
        r,
        /*textInput*/
        L[3]
      );
      let O = s;
      s = k(L), s !== O && (group_outros$3(), transition_out$3($[O], 1, 1, () => {
        $[O] = null;
      }), check_outros$3(), u = $[s], u || (u = $[s] = E[s](L), u.c()), transition_in$3(u, 1), u.m(f, null));
    },
    i(L) {
      o || (transition_in$3(u), o = !0);
    },
    o(L) {
      transition_out$3(u), o = !1;
    },
    d(L) {
      L && (detach$5(e), detach$5(p), detach$5(g)), $[s].d(), v = !1, run_all(M);
    }
  };
}
function instance$5(n, e, t) {
  var r = this && this.__awaiter || function(g, w, o, v) {
    function M(E) {
      return E instanceof o ? E : new o(function($) {
        $(E);
      });
    }
    return new (o || (o = Promise))(function(E, $) {
      function k(O) {
        try {
          z(v.next(O));
        } catch (R) {
          $(R);
        }
      }
      function L(O) {
        try {
          z(v.throw(O));
        } catch (R) {
          $(R);
        }
      }
      function z(O) {
        O.done ? E(O.value) : M(O.value).then(k, L);
      }
      z((v = v.apply(g, w || [])).next());
    });
  };
  let a;
  const l = createEventDispatcher$2();
  let { upload: h } = e, { root: c } = e;
  function d(g) {
    return r(this, void 0, void 0, function* () {
      yield tick$2();
      const w = Math.random().toString(36).substring(2, 15);
      a = yield h([g], c, w), l("load", a[0]);
    });
  }
  let _ = !1;
  function m(g, w) {
    return r(this, void 0, void 0, function* () {
      let o = {
        pdb_assym: {
          url: "https://files.rcsb.org/view/",
          ext: ".pdb"
        },
        pdb_bioass: {
          url: "https://files.rcsb.org/view/",
          ext: ".pdb1"
        },
        af: {
          url: "https://alphafold.ebi.ac.uk/files/AF-",
          ext: "-F1-model_v4.pdb"
        },
        esm: {
          url: "https://api.esmatlas.com/fetchPredictedStructure/",
          ext: ".pdb"
        }
      }, v = o[w].url, M = o[w].ext;
      t(1, _ = !0);
      let E = null;
      try {
        E = yield fetch(v + g + M).then((k) => {
          if (t(1, _ = !1), k.status == 200)
            return k.blob();
          l("notfound");
        }).then((k) => new File([k], g + ".pdb", { type: "text/plain" }));
      } catch {
        t(1, _ = !1), l("notfound");
      }
      let $ = new FileData({
        path: g + ".pdb",
        orig_name: g + ".pdb",
        blob: E,
        size: E.size,
        mime_type: E.type,
        is_stream: !1
      });
      yield d($);
    });
  }
  let y = "pdb_assym", x = "", b = "";
  function A(g) {
    t(0, y = g.target.value);
  }
  let f = {
    pdb_assym: "Enter PDB identifier",
    pdb_bioass: "Enter PDB identifier",
    af: "Enter UniProt identifier",
    esm: "Enter MGnify protein identifier"
  };
  function s(g) {
    g.key === "Enter" && m(b, y);
  }
  function u() {
    b = this.value, t(3, b);
  }
  const p = () => m(b, y);
  return n.$$set = (g) => {
    "upload" in g && t(7, h = g.upload), "root" in g && t(8, c = g.root);
  }, n.$$.update = () => {
    n.$$.dirty & /*selectedValue*/
    1 && t(2, x = f[y]);
  }, [
    y,
    _,
    x,
    b,
    m,
    A,
    s,
    h,
    c,
    u,
    p
  ];
}
class FileRetrieval extends SvelteComponent$5 {
  constructor(e) {
    super(), init$5(this, e, instance$5, create_fragment$5, safe_not_equal$5, { upload: 7, root: 8 });
  }
}
const {
  SvelteComponent: SvelteComponent$4,
  add_flush_callback,
  bind,
  binding_callbacks: binding_callbacks$1,
  bubble,
  check_outros: check_outros$2,
  claim_component: claim_component$2,
  claim_space: claim_space$2,
  create_component: create_component$2,
  create_slot: create_slot$1,
  destroy_component: destroy_component$2,
  detach: detach$4,
  empty: empty$2,
  get_all_dirty_from_scope: get_all_dirty_from_scope$1,
  get_slot_changes: get_slot_changes$1,
  group_outros: group_outros$2,
  init: init$4,
  insert_hydration: insert_hydration$4,
  mount_component: mount_component$2,
  safe_not_equal: safe_not_equal$4,
  space: space$2,
  transition_in: transition_in$2,
  transition_out: transition_out$2,
  update_slot_base: update_slot_base$1
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1, tick: tick$1 } = window.__gradio__svelte__internal;
function create_else_block$2(n) {
  let e, t, r, a, l;
  e = new FileRetrieval({
    props: {
      root: (
        /*root*/
        n[6]
      ),
      upload: (
        /*upload*/
        n[10]
      )
    }
  }), e.$on(
    "load",
    /*handle_upload*/
    n[18]
  ), e.$on(
    "notfound",
    /*notfound_handler*/
    n[25]
  );
  function h(d) {
    n[26](d);
  }
  let c = {
    filetype: (
      /*file_types*/
      n[4]
    ),
    file_count: (
      /*file_count*/
      n[3]
    ),
    max_file_size: (
      /*max_file_size*/
      n[9]
    ),
    root: (
      /*root*/
      n[6]
    ),
    stream_handler: (
      /*stream_handler*/
      n[11]
    ),
    upload: (
      /*upload*/
      n[10]
    ),
    $$slots: { default: [create_default_slot$1] },
    $$scope: { ctx: n }
  };
  return (
    /*dragging*/
    n[17] !== void 0 && (c.dragging = /*dragging*/
    n[17]), r = new Upload({ props: c }), binding_callbacks$1.push(() => bind(r, "dragging", h)), r.$on(
      "load",
      /*handle_upload*/
      n[18]
    ), r.$on(
      "error",
      /*error_handler*/
      n[27]
    ), {
      c() {
        create_component$2(e.$$.fragment), t = space$2(), create_component$2(r.$$.fragment);
      },
      l(d) {
        claim_component$2(e.$$.fragment, d), t = claim_space$2(d), claim_component$2(r.$$.fragment, d);
      },
      m(d, _) {
        mount_component$2(e, d, _), insert_hydration$4(d, t, _), mount_component$2(r, d, _), l = !0;
      },
      p(d, _) {
        const m = {};
        _ & /*root*/
        64 && (m.root = /*root*/
        d[6]), _ & /*upload*/
        1024 && (m.upload = /*upload*/
        d[10]), e.$set(m);
        const y = {};
        _ & /*file_types*/
        16 && (y.filetype = /*file_types*/
        d[4]), _ & /*file_count*/
        8 && (y.file_count = /*file_count*/
        d[3]), _ & /*max_file_size*/
        512 && (y.max_file_size = /*max_file_size*/
        d[9]), _ & /*root*/
        64 && (y.root = /*root*/
        d[6]), _ & /*stream_handler*/
        2048 && (y.stream_handler = /*stream_handler*/
        d[11]), _ & /*upload*/
        1024 && (y.upload = /*upload*/
        d[10]), _ & /*$$scope*/
        268435456 && (y.$$scope = { dirty: _, ctx: d }), !a && _ & /*dragging*/
        131072 && (a = !0, y.dragging = /*dragging*/
        d[17], add_flush_callback(() => a = !1)), r.$set(y);
      },
      i(d) {
        l || (transition_in$2(e.$$.fragment, d), transition_in$2(r.$$.fragment, d), l = !0);
      },
      o(d) {
        transition_out$2(e.$$.fragment, d), transition_out$2(r.$$.fragment, d), l = !1;
      },
      d(d) {
        d && detach$4(t), destroy_component$2(e, d), destroy_component$2(r, d);
      }
    }
  );
}
function create_if_block$2(n) {
  let e, t, r, a, l, h;
  e = new ModifyUpload({
    props: { i18n: (
      /*i18n*/
      n[8]
    ), absolute: !0 }
  }), e.$on(
    "clear",
    /*handle_clear*/
    n[19]
  ), r = new FilePreview({
    props: {
      i18n: (
        /*i18n*/
        n[8]
      ),
      selectable: (
        /*selectable*/
        n[5]
      ),
      value: (
        /*value*/
        n[0]
      ),
      height: (
        /*height*/
        n[7]
      )
    }
  }), r.$on(
    "select",
    /*select_handler*/
    n[22]
  ), r.$on(
    "change",
    /*change_handler*/
    n[23]
  ), r.$on(
    "delete",
    /*delete_handler*/
    n[24]
  );
  let c = (
    /*moldata*/
    n[15] != null && /*molviewer*/
    n[16] && create_if_block_1$2(n)
  );
  return {
    c() {
      create_component$2(e.$$.fragment), t = space$2(), create_component$2(r.$$.fragment), a = space$2(), c && c.c(), l = empty$2();
    },
    l(d) {
      claim_component$2(e.$$.fragment, d), t = claim_space$2(d), claim_component$2(r.$$.fragment, d), a = claim_space$2(d), c && c.l(d), l = empty$2();
    },
    m(d, _) {
      mount_component$2(e, d, _), insert_hydration$4(d, t, _), mount_component$2(r, d, _), insert_hydration$4(d, a, _), c && c.m(d, _), insert_hydration$4(d, l, _), h = !0;
    },
    p(d, _) {
      const m = {};
      _ & /*i18n*/
      256 && (m.i18n = /*i18n*/
      d[8]), e.$set(m);
      const y = {};
      _ & /*i18n*/
      256 && (y.i18n = /*i18n*/
      d[8]), _ & /*selectable*/
      32 && (y.selectable = /*selectable*/
      d[5]), _ & /*value*/
      1 && (y.value = /*value*/
      d[0]), _ & /*height*/
      128 && (y.height = /*height*/
      d[7]), r.$set(y), /*moldata*/
      d[15] != null && /*molviewer*/
      d[16] ? c ? (c.p(d, _), _ & /*moldata, molviewer*/
      98304 && transition_in$2(c, 1)) : (c = create_if_block_1$2(d), c.c(), transition_in$2(c, 1), c.m(l.parentNode, l)) : c && (group_outros$2(), transition_out$2(c, 1, 1, () => {
        c = null;
      }), check_outros$2());
    },
    i(d) {
      h || (transition_in$2(e.$$.fragment, d), transition_in$2(r.$$.fragment, d), transition_in$2(c), h = !0);
    },
    o(d) {
      transition_out$2(e.$$.fragment, d), transition_out$2(r.$$.fragment, d), transition_out$2(c), h = !1;
    },
    d(d) {
      d && (detach$4(t), detach$4(a), detach$4(l)), destroy_component$2(e, d), destroy_component$2(r, d), c && c.d(d);
    }
  };
}
function create_default_slot$1(n) {
  let e;
  const t = (
    /*#slots*/
    n[21].default
  ), r = create_slot$1(
    t,
    n,
    /*$$scope*/
    n[28],
    null
  );
  return {
    c() {
      r && r.c();
    },
    l(a) {
      r && r.l(a);
    },
    m(a, l) {
      r && r.m(a, l), e = !0;
    },
    p(a, l) {
      r && r.p && (!e || l & /*$$scope*/
      268435456) && update_slot_base$1(
        r,
        t,
        a,
        /*$$scope*/
        a[28],
        e ? get_slot_changes$1(
          t,
          /*$$scope*/
          a[28],
          l,
          null
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          a[28]
        ),
        null
      );
    },
    i(a) {
      e || (transition_in$2(r, a), e = !0);
    },
    o(a) {
      transition_out$2(r, a), e = !1;
    },
    d(a) {
      r && r.d(a);
    }
  };
}
function create_if_block_1$2(n) {
  let e, t;
  return e = new MolecularViewer({
    props: {
      moldata: (
        /*moldata*/
        n[15]
      ),
      config: (
        /*config*/
        n[12]
      ),
      confidenceLabel: (
        /*confidenceLabel*/
        n[13]
      ),
      representations: (
        /*representations*/
        n[14]
      )
    }
  }), {
    c() {
      create_component$2(e.$$.fragment);
    },
    l(r) {
      claim_component$2(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$2(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a & /*moldata*/
      32768 && (l.moldata = /*moldata*/
      r[15]), a & /*config*/
      4096 && (l.config = /*config*/
      r[12]), a & /*confidenceLabel*/
      8192 && (l.confidenceLabel = /*confidenceLabel*/
      r[13]), a & /*representations*/
      16384 && (l.representations = /*representations*/
      r[14]), e.$set(l);
    },
    i(r) {
      t || (transition_in$2(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$2(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$2(e, r);
    }
  };
}
function create_fragment$4(n) {
  let e, t, r, a, l, h, c;
  e = new BlockLabel({
    props: {
      show_label: (
        /*show_label*/
        n[2]
      ),
      Icon: File$1,
      float: !/*value*/
      n[0],
      label: (
        /*label*/
        n[1] || "File"
      )
    }
  });
  const d = [create_if_block$2, create_else_block$2], _ = [];
  function m(y, x) {
    return x & /*value*/
    1 && (r = null), r == null && (r = !!/*value*/
    (y[0] && (!Array.isArray(
      /*value*/
      y[0]
    ) || /*value*/
    y[0].length > 0))), r ? 0 : 1;
  }
  return a = m(n, -1), l = _[a] = d[a](n), {
    c() {
      create_component$2(e.$$.fragment), t = space$2(), l.c(), h = empty$2();
    },
    l(y) {
      claim_component$2(e.$$.fragment, y), t = claim_space$2(y), l.l(y), h = empty$2();
    },
    m(y, x) {
      mount_component$2(e, y, x), insert_hydration$4(y, t, x), _[a].m(y, x), insert_hydration$4(y, h, x), c = !0;
    },
    p(y, [x]) {
      const b = {};
      x & /*show_label*/
      4 && (b.show_label = /*show_label*/
      y[2]), x & /*value*/
      1 && (b.float = !/*value*/
      y[0]), x & /*label*/
      2 && (b.label = /*label*/
      y[1] || "File"), e.$set(b);
      let A = a;
      a = m(y, x), a === A ? _[a].p(y, x) : (group_outros$2(), transition_out$2(_[A], 1, 1, () => {
        _[A] = null;
      }), check_outros$2(), l = _[a], l ? l.p(y, x) : (l = _[a] = d[a](y), l.c()), transition_in$2(l, 1), l.m(h.parentNode, h));
    },
    i(y) {
      c || (transition_in$2(e.$$.fragment, y), transition_in$2(l), c = !0);
    },
    o(y) {
      transition_out$2(e.$$.fragment, y), transition_out$2(l), c = !1;
    },
    d(y) {
      y && (detach$4(t), detach$4(h)), destroy_component$2(e, y), _[a].d(y);
    }
  };
}
function instance$4(n, e, t) {
  let { $$slots: r = {}, $$scope: a } = e;
  var l = this && this.__awaiter || function(B, P, G, H) {
    function U(j) {
      return j instanceof G ? j : new G(function(re) {
        re(j);
      });
    }
    return new (G || (G = Promise))(function(j, re) {
      function ie(de) {
        try {
          ue(H.next(de));
        } catch (oe) {
          re(oe);
        }
      }
      function te(de) {
        try {
          ue(H.throw(de));
        } catch (oe) {
          re(oe);
        }
      }
      function ue(de) {
        de.done ? j(de.value) : U(de.value).then(ie, te);
      }
      ue((H = H.apply(B, P || [])).next());
    });
  };
  let { value: h } = e, { label: c } = e, { show_label: d = !0 } = e, { file_count: _ = "single" } = e, { file_types: m = null } = e, { selectable: y = !1 } = e, { root: x } = e, { height: b = void 0 } = e, { i18n: A } = e, { max_file_size: f = null } = e, { upload: s } = e, { stream_handler: u } = e, { config: p = {} } = e, { confidenceLabel: g = "" } = e, { representations: w = [] } = e, { moldata: o = null } = e, { molviewer: v = !1 } = e;
  function M(B) {
    return l(this, arguments, void 0, function* ({ detail: P }) {
      t(0, h = P), console.log("upload", P), yield tick$1(), $("change", h), $("upload", P);
    });
  }
  function E() {
    t(0, h = null), oldata = null, $("change", null), $("clear");
  }
  const $ = createEventDispatcher$1();
  let k = !1;
  function L(B) {
    bubble.call(this, n, B);
  }
  function z(B) {
    bubble.call(this, n, B);
  }
  function O(B) {
    bubble.call(this, n, B);
  }
  const R = () => $("notfound");
  function N(B) {
    k = B, t(17, k);
  }
  function W(B) {
    bubble.call(this, n, B);
  }
  return n.$$set = (B) => {
    "value" in B && t(0, h = B.value), "label" in B && t(1, c = B.label), "show_label" in B && t(2, d = B.show_label), "file_count" in B && t(3, _ = B.file_count), "file_types" in B && t(4, m = B.file_types), "selectable" in B && t(5, y = B.selectable), "root" in B && t(6, x = B.root), "height" in B && t(7, b = B.height), "i18n" in B && t(8, A = B.i18n), "max_file_size" in B && t(9, f = B.max_file_size), "upload" in B && t(10, s = B.upload), "stream_handler" in B && t(11, u = B.stream_handler), "config" in B && t(12, p = B.config), "confidenceLabel" in B && t(13, g = B.confidenceLabel), "representations" in B && t(14, w = B.representations), "moldata" in B && t(15, o = B.moldata), "molviewer" in B && t(16, v = B.molviewer), "$$scope" in B && t(28, a = B.$$scope);
  }, n.$$.update = () => {
    n.$$.dirty & /*dragging*/
    131072 && $("drag", k);
  }, [
    h,
    c,
    d,
    _,
    m,
    y,
    x,
    b,
    A,
    f,
    s,
    u,
    p,
    g,
    w,
    o,
    v,
    k,
    M,
    E,
    $,
    r,
    L,
    z,
    O,
    R,
    N,
    W,
    a
  ];
}
class FileUpload extends SvelteComponent$4 {
  constructor(e) {
    super(), init$4(this, e, instance$4, create_fragment$4, safe_not_equal$4, {
      value: 0,
      label: 1,
      show_label: 2,
      file_count: 3,
      file_types: 4,
      selectable: 5,
      root: 6,
      height: 7,
      i18n: 8,
      max_file_size: 9,
      upload: 10,
      stream_handler: 11,
      config: 12,
      confidenceLabel: 13,
      representations: 14,
      moldata: 15,
      molviewer: 16
    });
  }
}
function pretty_si(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;
}
const {
  SvelteComponent: SvelteComponent$3,
  append_hydration: append_hydration$3,
  attr: attr$3,
  children: children$3,
  claim_element: claim_element$3,
  claim_svg_element: claim_svg_element$1,
  component_subscribe,
  detach: detach$3,
  element: element$3,
  init: init$3,
  insert_hydration: insert_hydration$3,
  noop: noop$3,
  safe_not_equal: safe_not_equal$3,
  set_style: set_style$1,
  svg_element: svg_element$1,
  toggle_class: toggle_class$2
} = window.__gradio__svelte__internal, { onMount } = window.__gradio__svelte__internal;
function create_fragment$3(n) {
  let e, t, r, a, l, h, c, d, _, m, y, x;
  return {
    c() {
      e = element$3("div"), t = svg_element$1("svg"), r = svg_element$1("g"), a = svg_element$1("path"), l = svg_element$1("path"), h = svg_element$1("path"), c = svg_element$1("path"), d = svg_element$1("g"), _ = svg_element$1("path"), m = svg_element$1("path"), y = svg_element$1("path"), x = svg_element$1("path"), this.h();
    },
    l(b) {
      e = claim_element$3(b, "DIV", { class: !0 });
      var A = children$3(e);
      t = claim_svg_element$1(A, "svg", {
        viewBox: !0,
        fill: !0,
        xmlns: !0,
        class: !0
      });
      var f = children$3(t);
      r = claim_svg_element$1(f, "g", { style: !0 });
      var s = children$3(r);
      a = claim_svg_element$1(s, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), children$3(a).forEach(detach$3), l = claim_svg_element$1(s, "path", { d: !0, fill: !0, class: !0 }), children$3(l).forEach(detach$3), h = claim_svg_element$1(s, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), children$3(h).forEach(detach$3), c = claim_svg_element$1(s, "path", { d: !0, fill: !0, class: !0 }), children$3(c).forEach(detach$3), s.forEach(detach$3), d = claim_svg_element$1(f, "g", { style: !0 });
      var u = children$3(d);
      _ = claim_svg_element$1(u, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), children$3(_).forEach(detach$3), m = claim_svg_element$1(u, "path", { d: !0, fill: !0, class: !0 }), children$3(m).forEach(detach$3), y = claim_svg_element$1(u, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), children$3(y).forEach(detach$3), x = claim_svg_element$1(u, "path", { d: !0, fill: !0, class: !0 }), children$3(x).forEach(detach$3), u.forEach(detach$3), f.forEach(detach$3), A.forEach(detach$3), this.h();
    },
    h() {
      attr$3(a, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$3(a, "fill", "#FF7C00"), attr$3(a, "fill-opacity", "0.4"), attr$3(a, "class", "svelte-43sxxs"), attr$3(l, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$3(l, "fill", "#FF7C00"), attr$3(l, "class", "svelte-43sxxs"), attr$3(h, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$3(h, "fill", "#FF7C00"), attr$3(h, "fill-opacity", "0.4"), attr$3(h, "class", "svelte-43sxxs"), attr$3(c, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$3(c, "fill", "#FF7C00"), attr$3(c, "class", "svelte-43sxxs"), set_style$1(r, "transform", "translate(" + /*$top*/
      n[1][0] + "px, " + /*$top*/
      n[1][1] + "px)"), attr$3(_, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$3(_, "fill", "#FF7C00"), attr$3(_, "fill-opacity", "0.4"), attr$3(_, "class", "svelte-43sxxs"), attr$3(m, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$3(m, "fill", "#FF7C00"), attr$3(m, "class", "svelte-43sxxs"), attr$3(y, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$3(y, "fill", "#FF7C00"), attr$3(y, "fill-opacity", "0.4"), attr$3(y, "class", "svelte-43sxxs"), attr$3(x, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$3(x, "fill", "#FF7C00"), attr$3(x, "class", "svelte-43sxxs"), set_style$1(d, "transform", "translate(" + /*$bottom*/
      n[2][0] + "px, " + /*$bottom*/
      n[2][1] + "px)"), attr$3(t, "viewBox", "-1200 -1200 3000 3000"), attr$3(t, "fill", "none"), attr$3(t, "xmlns", "http://www.w3.org/2000/svg"), attr$3(t, "class", "svelte-43sxxs"), attr$3(e, "class", "svelte-43sxxs"), toggle_class$2(
        e,
        "margin",
        /*margin*/
        n[0]
      );
    },
    m(b, A) {
      insert_hydration$3(b, e, A), append_hydration$3(e, t), append_hydration$3(t, r), append_hydration$3(r, a), append_hydration$3(r, l), append_hydration$3(r, h), append_hydration$3(r, c), append_hydration$3(t, d), append_hydration$3(d, _), append_hydration$3(d, m), append_hydration$3(d, y), append_hydration$3(d, x);
    },
    p(b, [A]) {
      A & /*$top*/
      2 && set_style$1(r, "transform", "translate(" + /*$top*/
      b[1][0] + "px, " + /*$top*/
      b[1][1] + "px)"), A & /*$bottom*/
      4 && set_style$1(d, "transform", "translate(" + /*$bottom*/
      b[2][0] + "px, " + /*$bottom*/
      b[2][1] + "px)"), A & /*margin*/
      1 && toggle_class$2(
        e,
        "margin",
        /*margin*/
        b[0]
      );
    },
    i: noop$3,
    o: noop$3,
    d(b) {
      b && detach$3(e);
    }
  };
}
function instance$3(n, e, t) {
  let r, a;
  var l = this && this.__awaiter || function(b, A, f, s) {
    function u(p) {
      return p instanceof f ? p : new f(function(g) {
        g(p);
      });
    }
    return new (f || (f = Promise))(function(p, g) {
      function w(M) {
        try {
          v(s.next(M));
        } catch (E) {
          g(E);
        }
      }
      function o(M) {
        try {
          v(s.throw(M));
        } catch (E) {
          g(E);
        }
      }
      function v(M) {
        M.done ? p(M.value) : u(M.value).then(w, o);
      }
      v((s = s.apply(b, A || [])).next());
    });
  };
  let { margin: h = !0 } = e;
  const c = spring([0, 0]);
  component_subscribe(n, c, (b) => t(1, r = b));
  const d = spring([0, 0]);
  component_subscribe(n, d, (b) => t(2, a = b));
  let _;
  function m() {
    return l(this, void 0, void 0, function* () {
      yield Promise.all([c.set([125, 140]), d.set([-125, -140])]), yield Promise.all([c.set([-125, 140]), d.set([125, -140])]), yield Promise.all([c.set([-125, 0]), d.set([125, -0])]), yield Promise.all([c.set([125, 0]), d.set([-125, 0])]);
    });
  }
  function y() {
    return l(this, void 0, void 0, function* () {
      yield m(), _ || y();
    });
  }
  function x() {
    return l(this, void 0, void 0, function* () {
      yield Promise.all([c.set([125, 0]), d.set([-125, 0])]), y();
    });
  }
  return onMount(() => (x(), () => _ = !0)), n.$$set = (b) => {
    "margin" in b && t(0, h = b.margin);
  }, [h, r, a, c, d];
}
class Loader extends SvelteComponent$3 {
  constructor(e) {
    super(), init$3(this, e, instance$3, create_fragment$3, safe_not_equal$3, { margin: 0 });
  }
}
const {
  SvelteComponent: SvelteComponent$2,
  append_hydration: append_hydration$2,
  attr: attr$2,
  binding_callbacks,
  check_outros: check_outros$1,
  children: children$2,
  claim_component: claim_component$1,
  claim_element: claim_element$2,
  claim_space: claim_space$1,
  claim_text: claim_text$2,
  create_component: create_component$1,
  create_slot,
  destroy_component: destroy_component$1,
  destroy_each: destroy_each$1,
  detach: detach$2,
  element: element$2,
  empty: empty$1,
  ensure_array_like: ensure_array_like$1,
  get_all_dirty_from_scope,
  get_slot_changes,
  group_outros: group_outros$1,
  init: init$2,
  insert_hydration: insert_hydration$2,
  mount_component: mount_component$1,
  noop: noop$2,
  safe_not_equal: safe_not_equal$2,
  set_data: set_data$1,
  set_style,
  space: space$1,
  text: text$2,
  toggle_class: toggle_class$1,
  transition_in: transition_in$1,
  transition_out: transition_out$1,
  update_slot_base
} = window.__gradio__svelte__internal, { tick } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, { createEventDispatcher } = window.__gradio__svelte__internal, get_error_slot_changes = (n) => ({}), get_error_slot_context = (n) => ({}), get_additional_loading_text_slot_changes = (n) => ({}), get_additional_loading_text_slot_context = (n) => ({});
function get_each_context$1(n, e, t) {
  const r = n.slice();
  return r[41] = e[t], r[43] = t, r;
}
function get_each_context_1(n, e, t) {
  const r = n.slice();
  return r[41] = e[t], r;
}
function create_if_block_17(n) {
  let e, t, r, a, l = (
    /*i18n*/
    n[1]("common.error") + ""
  ), h, c, d;
  t = new IconButton({
    props: {
      Icon: Clear,
      label: (
        /*i18n*/
        n[1]("common.clear")
      ),
      disabled: !1
    }
  }), t.$on(
    "click",
    /*click_handler*/
    n[32]
  );
  const _ = (
    /*#slots*/
    n[30].error
  ), m = create_slot(
    _,
    n,
    /*$$scope*/
    n[29],
    get_error_slot_context
  );
  return {
    c() {
      e = element$2("div"), create_component$1(t.$$.fragment), r = space$1(), a = element$2("span"), h = text$2(l), c = space$1(), m && m.c(), this.h();
    },
    l(y) {
      e = claim_element$2(y, "DIV", { class: !0 });
      var x = children$2(e);
      claim_component$1(t.$$.fragment, x), x.forEach(detach$2), r = claim_space$1(y), a = claim_element$2(y, "SPAN", { class: !0 });
      var b = children$2(a);
      h = claim_text$2(b, l), b.forEach(detach$2), c = claim_space$1(y), m && m.l(y), this.h();
    },
    h() {
      attr$2(e, "class", "clear-status svelte-17v219f"), attr$2(a, "class", "error svelte-17v219f");
    },
    m(y, x) {
      insert_hydration$2(y, e, x), mount_component$1(t, e, null), insert_hydration$2(y, r, x), insert_hydration$2(y, a, x), append_hydration$2(a, h), insert_hydration$2(y, c, x), m && m.m(y, x), d = !0;
    },
    p(y, x) {
      const b = {};
      x[0] & /*i18n*/
      2 && (b.label = /*i18n*/
      y[1]("common.clear")), t.$set(b), (!d || x[0] & /*i18n*/
      2) && l !== (l = /*i18n*/
      y[1]("common.error") + "") && set_data$1(h, l), m && m.p && (!d || x[0] & /*$$scope*/
      536870912) && update_slot_base(
        m,
        _,
        y,
        /*$$scope*/
        y[29],
        d ? get_slot_changes(
          _,
          /*$$scope*/
          y[29],
          x,
          get_error_slot_changes
        ) : get_all_dirty_from_scope(
          /*$$scope*/
          y[29]
        ),
        get_error_slot_context
      );
    },
    i(y) {
      d || (transition_in$1(t.$$.fragment, y), transition_in$1(m, y), d = !0);
    },
    o(y) {
      transition_out$1(t.$$.fragment, y), transition_out$1(m, y), d = !1;
    },
    d(y) {
      y && (detach$2(e), detach$2(r), detach$2(a), detach$2(c)), destroy_component$1(t), m && m.d(y);
    }
  };
}
function create_if_block$1(n) {
  let e, t, r, a, l, h, c, d, _, m = (
    /*variant*/
    n[8] === "default" && /*show_eta_bar*/
    n[18] && /*show_progress*/
    n[6] === "full" && create_if_block_16(n)
  );
  function y(g, w) {
    if (
      /*progress*/
      g[7]
    ) return create_if_block_11;
    if (
      /*queue_position*/
      g[2] !== null && /*queue_size*/
      g[3] !== void 0 && /*queue_position*/
      g[2] >= 0
    ) return create_if_block_14;
    if (
      /*queue_position*/
      g[2] === 0
    ) return create_if_block_15;
  }
  let x = y(n), b = x && x(n), A = (
    /*timer*/
    n[5] && create_if_block_10(n)
  );
  const f = [create_if_block_2, create_if_block_9], s = [];
  function u(g, w) {
    return (
      /*last_progress_level*/
      g[15] != null ? 0 : (
        /*show_progress*/
        g[6] === "full" ? 1 : -1
      )
    );
  }
  ~(l = u(n)) && (h = s[l] = f[l](n));
  let p = !/*timer*/
  n[5] && create_if_block_1$1(n);
  return {
    c() {
      m && m.c(), e = space$1(), t = element$2("div"), b && b.c(), r = space$1(), A && A.c(), a = space$1(), h && h.c(), c = space$1(), p && p.c(), d = empty$1(), this.h();
    },
    l(g) {
      m && m.l(g), e = claim_space$1(g), t = claim_element$2(g, "DIV", { class: !0 });
      var w = children$2(t);
      b && b.l(w), r = claim_space$1(w), A && A.l(w), w.forEach(detach$2), a = claim_space$1(g), h && h.l(g), c = claim_space$1(g), p && p.l(g), d = empty$1(), this.h();
    },
    h() {
      attr$2(t, "class", "progress-text svelte-17v219f"), toggle_class$1(
        t,
        "meta-text-center",
        /*variant*/
        n[8] === "center"
      ), toggle_class$1(
        t,
        "meta-text",
        /*variant*/
        n[8] === "default"
      );
    },
    m(g, w) {
      m && m.m(g, w), insert_hydration$2(g, e, w), insert_hydration$2(g, t, w), b && b.m(t, null), append_hydration$2(t, r), A && A.m(t, null), insert_hydration$2(g, a, w), ~l && s[l].m(g, w), insert_hydration$2(g, c, w), p && p.m(g, w), insert_hydration$2(g, d, w), _ = !0;
    },
    p(g, w) {
      /*variant*/
      g[8] === "default" && /*show_eta_bar*/
      g[18] && /*show_progress*/
      g[6] === "full" ? m ? m.p(g, w) : (m = create_if_block_16(g), m.c(), m.m(e.parentNode, e)) : m && (m.d(1), m = null), x === (x = y(g)) && b ? b.p(g, w) : (b && b.d(1), b = x && x(g), b && (b.c(), b.m(t, r))), /*timer*/
      g[5] ? A ? A.p(g, w) : (A = create_if_block_10(g), A.c(), A.m(t, null)) : A && (A.d(1), A = null), (!_ || w[0] & /*variant*/
      256) && toggle_class$1(
        t,
        "meta-text-center",
        /*variant*/
        g[8] === "center"
      ), (!_ || w[0] & /*variant*/
      256) && toggle_class$1(
        t,
        "meta-text",
        /*variant*/
        g[8] === "default"
      );
      let o = l;
      l = u(g), l === o ? ~l && s[l].p(g, w) : (h && (group_outros$1(), transition_out$1(s[o], 1, 1, () => {
        s[o] = null;
      }), check_outros$1()), ~l ? (h = s[l], h ? h.p(g, w) : (h = s[l] = f[l](g), h.c()), transition_in$1(h, 1), h.m(c.parentNode, c)) : h = null), /*timer*/
      g[5] ? p && (group_outros$1(), transition_out$1(p, 1, 1, () => {
        p = null;
      }), check_outros$1()) : p ? (p.p(g, w), w[0] & /*timer*/
      32 && transition_in$1(p, 1)) : (p = create_if_block_1$1(g), p.c(), transition_in$1(p, 1), p.m(d.parentNode, d));
    },
    i(g) {
      _ || (transition_in$1(h), transition_in$1(p), _ = !0);
    },
    o(g) {
      transition_out$1(h), transition_out$1(p), _ = !1;
    },
    d(g) {
      g && (detach$2(e), detach$2(t), detach$2(a), detach$2(c), detach$2(d)), m && m.d(g), b && b.d(), A && A.d(), ~l && s[l].d(g), p && p.d(g);
    }
  };
}
function create_if_block_16(n) {
  let e, t = `translateX(${/*eta_level*/
  (n[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      e = element$2("div"), this.h();
    },
    l(r) {
      e = claim_element$2(r, "DIV", { class: !0 }), children$2(e).forEach(detach$2), this.h();
    },
    h() {
      attr$2(e, "class", "eta-bar svelte-17v219f"), set_style(e, "transform", t);
    },
    m(r, a) {
      insert_hydration$2(r, e, a);
    },
    p(r, a) {
      a[0] & /*eta_level*/
      131072 && t !== (t = `translateX(${/*eta_level*/
      (r[17] || 0) * 100 - 100}%)`) && set_style(e, "transform", t);
    },
    d(r) {
      r && detach$2(e);
    }
  };
}
function create_if_block_15(n) {
  let e;
  return {
    c() {
      e = text$2("processing |");
    },
    l(t) {
      e = claim_text$2(t, "processing |");
    },
    m(t, r) {
      insert_hydration$2(t, e, r);
    },
    p: noop$2,
    d(t) {
      t && detach$2(e);
    }
  };
}
function create_if_block_14(n) {
  let e, t = (
    /*queue_position*/
    n[2] + 1 + ""
  ), r, a, l, h;
  return {
    c() {
      e = text$2("queue: "), r = text$2(t), a = text$2("/"), l = text$2(
        /*queue_size*/
        n[3]
      ), h = text$2(" |");
    },
    l(c) {
      e = claim_text$2(c, "queue: "), r = claim_text$2(c, t), a = claim_text$2(c, "/"), l = claim_text$2(
        c,
        /*queue_size*/
        n[3]
      ), h = claim_text$2(c, " |");
    },
    m(c, d) {
      insert_hydration$2(c, e, d), insert_hydration$2(c, r, d), insert_hydration$2(c, a, d), insert_hydration$2(c, l, d), insert_hydration$2(c, h, d);
    },
    p(c, d) {
      d[0] & /*queue_position*/
      4 && t !== (t = /*queue_position*/
      c[2] + 1 + "") && set_data$1(r, t), d[0] & /*queue_size*/
      8 && set_data$1(
        l,
        /*queue_size*/
        c[3]
      );
    },
    d(c) {
      c && (detach$2(e), detach$2(r), detach$2(a), detach$2(l), detach$2(h));
    }
  };
}
function create_if_block_11(n) {
  let e, t = ensure_array_like$1(
    /*progress*/
    n[7]
  ), r = [];
  for (let a = 0; a < t.length; a += 1)
    r[a] = create_each_block_1(get_each_context_1(n, t, a));
  return {
    c() {
      for (let a = 0; a < r.length; a += 1)
        r[a].c();
      e = empty$1();
    },
    l(a) {
      for (let l = 0; l < r.length; l += 1)
        r[l].l(a);
      e = empty$1();
    },
    m(a, l) {
      for (let h = 0; h < r.length; h += 1)
        r[h] && r[h].m(a, l);
      insert_hydration$2(a, e, l);
    },
    p(a, l) {
      if (l[0] & /*progress*/
      128) {
        t = ensure_array_like$1(
          /*progress*/
          a[7]
        );
        let h;
        for (h = 0; h < t.length; h += 1) {
          const c = get_each_context_1(a, t, h);
          r[h] ? r[h].p(c, l) : (r[h] = create_each_block_1(c), r[h].c(), r[h].m(e.parentNode, e));
        }
        for (; h < r.length; h += 1)
          r[h].d(1);
        r.length = t.length;
      }
    },
    d(a) {
      a && detach$2(e), destroy_each$1(r, a);
    }
  };
}
function create_if_block_12(n) {
  let e, t = (
    /*p*/
    n[41].unit + ""
  ), r, a, l = " ", h;
  function c(m, y) {
    return (
      /*p*/
      m[41].length != null ? create_if_block_13 : create_else_block$1
    );
  }
  let d = c(n), _ = d(n);
  return {
    c() {
      _.c(), e = space$1(), r = text$2(t), a = text$2(" | "), h = text$2(l);
    },
    l(m) {
      _.l(m), e = claim_space$1(m), r = claim_text$2(m, t), a = claim_text$2(m, " | "), h = claim_text$2(m, l);
    },
    m(m, y) {
      _.m(m, y), insert_hydration$2(m, e, y), insert_hydration$2(m, r, y), insert_hydration$2(m, a, y), insert_hydration$2(m, h, y);
    },
    p(m, y) {
      d === (d = c(m)) && _ ? _.p(m, y) : (_.d(1), _ = d(m), _ && (_.c(), _.m(e.parentNode, e))), y[0] & /*progress*/
      128 && t !== (t = /*p*/
      m[41].unit + "") && set_data$1(r, t);
    },
    d(m) {
      m && (detach$2(e), detach$2(r), detach$2(a), detach$2(h)), _.d(m);
    }
  };
}
function create_else_block$1(n) {
  let e = pretty_si(
    /*p*/
    n[41].index || 0
  ) + "", t;
  return {
    c() {
      t = text$2(e);
    },
    l(r) {
      t = claim_text$2(r, e);
    },
    m(r, a) {
      insert_hydration$2(r, t, a);
    },
    p(r, a) {
      a[0] & /*progress*/
      128 && e !== (e = pretty_si(
        /*p*/
        r[41].index || 0
      ) + "") && set_data$1(t, e);
    },
    d(r) {
      r && detach$2(t);
    }
  };
}
function create_if_block_13(n) {
  let e = pretty_si(
    /*p*/
    n[41].index || 0
  ) + "", t, r, a = pretty_si(
    /*p*/
    n[41].length
  ) + "", l;
  return {
    c() {
      t = text$2(e), r = text$2("/"), l = text$2(a);
    },
    l(h) {
      t = claim_text$2(h, e), r = claim_text$2(h, "/"), l = claim_text$2(h, a);
    },
    m(h, c) {
      insert_hydration$2(h, t, c), insert_hydration$2(h, r, c), insert_hydration$2(h, l, c);
    },
    p(h, c) {
      c[0] & /*progress*/
      128 && e !== (e = pretty_si(
        /*p*/
        h[41].index || 0
      ) + "") && set_data$1(t, e), c[0] & /*progress*/
      128 && a !== (a = pretty_si(
        /*p*/
        h[41].length
      ) + "") && set_data$1(l, a);
    },
    d(h) {
      h && (detach$2(t), detach$2(r), detach$2(l));
    }
  };
}
function create_each_block_1(n) {
  let e, t = (
    /*p*/
    n[41].index != null && create_if_block_12(n)
  );
  return {
    c() {
      t && t.c(), e = empty$1();
    },
    l(r) {
      t && t.l(r), e = empty$1();
    },
    m(r, a) {
      t && t.m(r, a), insert_hydration$2(r, e, a);
    },
    p(r, a) {
      /*p*/
      r[41].index != null ? t ? t.p(r, a) : (t = create_if_block_12(r), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(r) {
      r && detach$2(e), t && t.d(r);
    }
  };
}
function create_if_block_10(n) {
  let e, t = (
    /*eta*/
    n[0] ? `/${/*formatted_eta*/
    n[19]}` : ""
  ), r, a;
  return {
    c() {
      e = text$2(
        /*formatted_timer*/
        n[20]
      ), r = text$2(t), a = text$2("s");
    },
    l(l) {
      e = claim_text$2(
        l,
        /*formatted_timer*/
        n[20]
      ), r = claim_text$2(l, t), a = claim_text$2(l, "s");
    },
    m(l, h) {
      insert_hydration$2(l, e, h), insert_hydration$2(l, r, h), insert_hydration$2(l, a, h);
    },
    p(l, h) {
      h[0] & /*formatted_timer*/
      1048576 && set_data$1(
        e,
        /*formatted_timer*/
        l[20]
      ), h[0] & /*eta, formatted_eta*/
      524289 && t !== (t = /*eta*/
      l[0] ? `/${/*formatted_eta*/
      l[19]}` : "") && set_data$1(r, t);
    },
    d(l) {
      l && (detach$2(e), detach$2(r), detach$2(a));
    }
  };
}
function create_if_block_9(n) {
  let e, t;
  return e = new Loader({
    props: { margin: (
      /*variant*/
      n[8] === "default"
    ) }
  }), {
    c() {
      create_component$1(e.$$.fragment);
    },
    l(r) {
      claim_component$1(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component$1(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a[0] & /*variant*/
      256 && (l.margin = /*variant*/
      r[8] === "default"), e.$set(l);
    },
    i(r) {
      t || (transition_in$1(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out$1(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component$1(e, r);
    }
  };
}
function create_if_block_2(n) {
  let e, t, r, a, l, h = `${/*last_progress_level*/
  n[15] * 100}%`, c = (
    /*progress*/
    n[7] != null && create_if_block_3(n)
  );
  return {
    c() {
      e = element$2("div"), t = element$2("div"), c && c.c(), r = space$1(), a = element$2("div"), l = element$2("div"), this.h();
    },
    l(d) {
      e = claim_element$2(d, "DIV", { class: !0 });
      var _ = children$2(e);
      t = claim_element$2(_, "DIV", { class: !0 });
      var m = children$2(t);
      c && c.l(m), m.forEach(detach$2), r = claim_space$1(_), a = claim_element$2(_, "DIV", { class: !0 });
      var y = children$2(a);
      l = claim_element$2(y, "DIV", { class: !0 }), children$2(l).forEach(detach$2), y.forEach(detach$2), _.forEach(detach$2), this.h();
    },
    h() {
      attr$2(t, "class", "progress-level-inner svelte-17v219f"), attr$2(l, "class", "progress-bar svelte-17v219f"), set_style(l, "width", h), attr$2(a, "class", "progress-bar-wrap svelte-17v219f"), attr$2(e, "class", "progress-level svelte-17v219f");
    },
    m(d, _) {
      insert_hydration$2(d, e, _), append_hydration$2(e, t), c && c.m(t, null), append_hydration$2(e, r), append_hydration$2(e, a), append_hydration$2(a, l), n[31](l);
    },
    p(d, _) {
      /*progress*/
      d[7] != null ? c ? c.p(d, _) : (c = create_if_block_3(d), c.c(), c.m(t, null)) : c && (c.d(1), c = null), _[0] & /*last_progress_level*/
      32768 && h !== (h = `${/*last_progress_level*/
      d[15] * 100}%`) && set_style(l, "width", h);
    },
    i: noop$2,
    o: noop$2,
    d(d) {
      d && detach$2(e), c && c.d(), n[31](null);
    }
  };
}
function create_if_block_3(n) {
  let e, t = ensure_array_like$1(
    /*progress*/
    n[7]
  ), r = [];
  for (let a = 0; a < t.length; a += 1)
    r[a] = create_each_block$1(get_each_context$1(n, t, a));
  return {
    c() {
      for (let a = 0; a < r.length; a += 1)
        r[a].c();
      e = empty$1();
    },
    l(a) {
      for (let l = 0; l < r.length; l += 1)
        r[l].l(a);
      e = empty$1();
    },
    m(a, l) {
      for (let h = 0; h < r.length; h += 1)
        r[h] && r[h].m(a, l);
      insert_hydration$2(a, e, l);
    },
    p(a, l) {
      if (l[0] & /*progress_level, progress*/
      16512) {
        t = ensure_array_like$1(
          /*progress*/
          a[7]
        );
        let h;
        for (h = 0; h < t.length; h += 1) {
          const c = get_each_context$1(a, t, h);
          r[h] ? r[h].p(c, l) : (r[h] = create_each_block$1(c), r[h].c(), r[h].m(e.parentNode, e));
        }
        for (; h < r.length; h += 1)
          r[h].d(1);
        r.length = t.length;
      }
    },
    d(a) {
      a && detach$2(e), destroy_each$1(r, a);
    }
  };
}
function create_if_block_4(n) {
  let e, t, r, a, l = (
    /*i*/
    n[43] !== 0 && create_if_block_8()
  ), h = (
    /*p*/
    n[41].desc != null && create_if_block_7(n)
  ), c = (
    /*p*/
    n[41].desc != null && /*progress_level*/
    n[14] && /*progress_level*/
    n[14][
      /*i*/
      n[43]
    ] != null && create_if_block_6()
  ), d = (
    /*progress_level*/
    n[14] != null && create_if_block_5(n)
  );
  return {
    c() {
      l && l.c(), e = space$1(), h && h.c(), t = space$1(), c && c.c(), r = space$1(), d && d.c(), a = empty$1();
    },
    l(_) {
      l && l.l(_), e = claim_space$1(_), h && h.l(_), t = claim_space$1(_), c && c.l(_), r = claim_space$1(_), d && d.l(_), a = empty$1();
    },
    m(_, m) {
      l && l.m(_, m), insert_hydration$2(_, e, m), h && h.m(_, m), insert_hydration$2(_, t, m), c && c.m(_, m), insert_hydration$2(_, r, m), d && d.m(_, m), insert_hydration$2(_, a, m);
    },
    p(_, m) {
      /*p*/
      _[41].desc != null ? h ? h.p(_, m) : (h = create_if_block_7(_), h.c(), h.m(t.parentNode, t)) : h && (h.d(1), h = null), /*p*/
      _[41].desc != null && /*progress_level*/
      _[14] && /*progress_level*/
      _[14][
        /*i*/
        _[43]
      ] != null ? c || (c = create_if_block_6(), c.c(), c.m(r.parentNode, r)) : c && (c.d(1), c = null), /*progress_level*/
      _[14] != null ? d ? d.p(_, m) : (d = create_if_block_5(_), d.c(), d.m(a.parentNode, a)) : d && (d.d(1), d = null);
    },
    d(_) {
      _ && (detach$2(e), detach$2(t), detach$2(r), detach$2(a)), l && l.d(_), h && h.d(_), c && c.d(_), d && d.d(_);
    }
  };
}
function create_if_block_8(n) {
  let e;
  return {
    c() {
      e = text$2(" /");
    },
    l(t) {
      e = claim_text$2(t, " /");
    },
    m(t, r) {
      insert_hydration$2(t, e, r);
    },
    d(t) {
      t && detach$2(e);
    }
  };
}
function create_if_block_7(n) {
  let e = (
    /*p*/
    n[41].desc + ""
  ), t;
  return {
    c() {
      t = text$2(e);
    },
    l(r) {
      t = claim_text$2(r, e);
    },
    m(r, a) {
      insert_hydration$2(r, t, a);
    },
    p(r, a) {
      a[0] & /*progress*/
      128 && e !== (e = /*p*/
      r[41].desc + "") && set_data$1(t, e);
    },
    d(r) {
      r && detach$2(t);
    }
  };
}
function create_if_block_6(n) {
  let e;
  return {
    c() {
      e = text$2("-");
    },
    l(t) {
      e = claim_text$2(t, "-");
    },
    m(t, r) {
      insert_hydration$2(t, e, r);
    },
    d(t) {
      t && detach$2(e);
    }
  };
}
function create_if_block_5(n) {
  let e = (100 * /*progress_level*/
  (n[14][
    /*i*/
    n[43]
  ] || 0)).toFixed(1) + "", t, r;
  return {
    c() {
      t = text$2(e), r = text$2("%");
    },
    l(a) {
      t = claim_text$2(a, e), r = claim_text$2(a, "%");
    },
    m(a, l) {
      insert_hydration$2(a, t, l), insert_hydration$2(a, r, l);
    },
    p(a, l) {
      l[0] & /*progress_level*/
      16384 && e !== (e = (100 * /*progress_level*/
      (a[14][
        /*i*/
        a[43]
      ] || 0)).toFixed(1) + "") && set_data$1(t, e);
    },
    d(a) {
      a && (detach$2(t), detach$2(r));
    }
  };
}
function create_each_block$1(n) {
  let e, t = (
    /*p*/
    (n[41].desc != null || /*progress_level*/
    n[14] && /*progress_level*/
    n[14][
      /*i*/
      n[43]
    ] != null) && create_if_block_4(n)
  );
  return {
    c() {
      t && t.c(), e = empty$1();
    },
    l(r) {
      t && t.l(r), e = empty$1();
    },
    m(r, a) {
      t && t.m(r, a), insert_hydration$2(r, e, a);
    },
    p(r, a) {
      /*p*/
      r[41].desc != null || /*progress_level*/
      r[14] && /*progress_level*/
      r[14][
        /*i*/
        r[43]
      ] != null ? t ? t.p(r, a) : (t = create_if_block_4(r), t.c(), t.m(e.parentNode, e)) : t && (t.d(1), t = null);
    },
    d(r) {
      r && detach$2(e), t && t.d(r);
    }
  };
}
function create_if_block_1$1(n) {
  let e, t, r, a;
  const l = (
    /*#slots*/
    n[30]["additional-loading-text"]
  ), h = create_slot(
    l,
    n,
    /*$$scope*/
    n[29],
    get_additional_loading_text_slot_context
  );
  return {
    c() {
      e = element$2("p"), t = text$2(
        /*loading_text*/
        n[9]
      ), r = space$1(), h && h.c(), this.h();
    },
    l(c) {
      e = claim_element$2(c, "P", { class: !0 });
      var d = children$2(e);
      t = claim_text$2(
        d,
        /*loading_text*/
        n[9]
      ), d.forEach(detach$2), r = claim_space$1(c), h && h.l(c), this.h();
    },
    h() {
      attr$2(e, "class", "loading svelte-17v219f");
    },
    m(c, d) {
      insert_hydration$2(c, e, d), append_hydration$2(e, t), insert_hydration$2(c, r, d), h && h.m(c, d), a = !0;
    },
    p(c, d) {
      (!a || d[0] & /*loading_text*/
      512) && set_data$1(
        t,
        /*loading_text*/
        c[9]
      ), h && h.p && (!a || d[0] & /*$$scope*/
      536870912) && update_slot_base(
        h,
        l,
        c,
        /*$$scope*/
        c[29],
        a ? get_slot_changes(
          l,
          /*$$scope*/
          c[29],
          d,
          get_additional_loading_text_slot_changes
        ) : get_all_dirty_from_scope(
          /*$$scope*/
          c[29]
        ),
        get_additional_loading_text_slot_context
      );
    },
    i(c) {
      a || (transition_in$1(h, c), a = !0);
    },
    o(c) {
      transition_out$1(h, c), a = !1;
    },
    d(c) {
      c && (detach$2(e), detach$2(r)), h && h.d(c);
    }
  };
}
function create_fragment$2(n) {
  let e, t, r, a, l;
  const h = [create_if_block$1, create_if_block_17], c = [];
  function d(_, m) {
    return (
      /*status*/
      _[4] === "pending" ? 0 : (
        /*status*/
        _[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(t = d(n)) && (r = c[t] = h[t](n)), {
    c() {
      e = element$2("div"), r && r.c(), this.h();
    },
    l(_) {
      e = claim_element$2(_, "DIV", { class: !0 });
      var m = children$2(e);
      r && r.l(m), m.forEach(detach$2), this.h();
    },
    h() {
      attr$2(e, "class", a = "wrap " + /*variant*/
      n[8] + " " + /*show_progress*/
      n[6] + " svelte-17v219f"), toggle_class$1(e, "hide", !/*status*/
      n[4] || /*status*/
      n[4] === "complete" || /*show_progress*/
      n[6] === "hidden" || /*status*/
      n[4] == "streaming"), toggle_class$1(
        e,
        "translucent",
        /*variant*/
        n[8] === "center" && /*status*/
        (n[4] === "pending" || /*status*/
        n[4] === "error") || /*translucent*/
        n[11] || /*show_progress*/
        n[6] === "minimal"
      ), toggle_class$1(
        e,
        "generating",
        /*status*/
        n[4] === "generating" && /*show_progress*/
        n[6] === "full"
      ), toggle_class$1(
        e,
        "border",
        /*border*/
        n[12]
      ), set_style(
        e,
        "position",
        /*absolute*/
        n[10] ? "absolute" : "static"
      ), set_style(
        e,
        "padding",
        /*absolute*/
        n[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(_, m) {
      insert_hydration$2(_, e, m), ~t && c[t].m(e, null), n[33](e), l = !0;
    },
    p(_, m) {
      let y = t;
      t = d(_), t === y ? ~t && c[t].p(_, m) : (r && (group_outros$1(), transition_out$1(c[y], 1, 1, () => {
        c[y] = null;
      }), check_outros$1()), ~t ? (r = c[t], r ? r.p(_, m) : (r = c[t] = h[t](_), r.c()), transition_in$1(r, 1), r.m(e, null)) : r = null), (!l || m[0] & /*variant, show_progress*/
      320 && a !== (a = "wrap " + /*variant*/
      _[8] + " " + /*show_progress*/
      _[6] + " svelte-17v219f")) && attr$2(e, "class", a), (!l || m[0] & /*variant, show_progress, status, show_progress*/
      336) && toggle_class$1(e, "hide", !/*status*/
      _[4] || /*status*/
      _[4] === "complete" || /*show_progress*/
      _[6] === "hidden" || /*status*/
      _[4] == "streaming"), (!l || m[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && toggle_class$1(
        e,
        "translucent",
        /*variant*/
        _[8] === "center" && /*status*/
        (_[4] === "pending" || /*status*/
        _[4] === "error") || /*translucent*/
        _[11] || /*show_progress*/
        _[6] === "minimal"
      ), (!l || m[0] & /*variant, show_progress, status, show_progress*/
      336) && toggle_class$1(
        e,
        "generating",
        /*status*/
        _[4] === "generating" && /*show_progress*/
        _[6] === "full"
      ), (!l || m[0] & /*variant, show_progress, border*/
      4416) && toggle_class$1(
        e,
        "border",
        /*border*/
        _[12]
      ), m[0] & /*absolute*/
      1024 && set_style(
        e,
        "position",
        /*absolute*/
        _[10] ? "absolute" : "static"
      ), m[0] & /*absolute*/
      1024 && set_style(
        e,
        "padding",
        /*absolute*/
        _[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(_) {
      l || (transition_in$1(r), l = !0);
    },
    o(_) {
      transition_out$1(r), l = !1;
    },
    d(_) {
      _ && detach$2(e), ~t && c[t].d(), n[33](null);
    }
  };
}
var __awaiter = function(n, e, t, r) {
  function a(l) {
    return l instanceof t ? l : new t(function(h) {
      h(l);
    });
  }
  return new (t || (t = Promise))(function(l, h) {
    function c(m) {
      try {
        _(r.next(m));
      } catch (y) {
        h(y);
      }
    }
    function d(m) {
      try {
        _(r.throw(m));
      } catch (y) {
        h(y);
      }
    }
    function _(m) {
      m.done ? l(m.value) : a(m.value).then(c, d);
    }
    _((r = r.apply(n, e || [])).next());
  });
};
let items = [], called = !1;
const is_browser = typeof window < "u", raf = is_browser ? window.requestAnimationFrame : (n) => {
};
function scroll_into_view(n) {
  return __awaiter(this, arguments, void 0, function* (e, t = !0) {
    if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && t !== !0)) {
      if (items.push(e), !called) called = !0;
      else return;
      yield tick(), raf(() => {
        let r = [0, 0];
        for (let a = 0; a < items.length; a++) {
          const h = items[a].getBoundingClientRect();
          (a === 0 || h.top + window.scrollY <= r[0]) && (r[0] = h.top + window.scrollY, r[1] = a);
        }
        window.scrollTo({ top: r[0] - 20, behavior: "smooth" }), called = !1, items = [];
      });
    }
  });
}
function instance$2(n, e, t) {
  let r, { $$slots: a = {}, $$scope: l } = e;
  this && this.__awaiter;
  const h = createEventDispatcher();
  let { i18n: c } = e, { eta: d = null } = e, { queue_position: _ } = e, { queue_size: m } = e, { status: y } = e, { scroll_to_output: x = !1 } = e, { timer: b = !0 } = e, { show_progress: A = "full" } = e, { message: f = null } = e, { progress: s = null } = e, { variant: u = "default" } = e, { loading_text: p = "Loading..." } = e, { absolute: g = !0 } = e, { translucent: w = !1 } = e, { border: o = !1 } = e, { autoscroll: v } = e, M, E = !1, $ = 0, k = 0, L = null, z = null, O = 0, R = null, N, W = null, B = !0;
  const P = () => {
    t(0, d = t(27, L = t(19, U = null))), t(25, $ = performance.now()), t(26, k = 0), E = !0, G();
  };
  function G() {
    raf(() => {
      t(26, k = (performance.now() - $) / 1e3), E && G();
    });
  }
  function H() {
    t(26, k = 0), t(0, d = t(27, L = t(19, U = null))), E && (E = !1);
  }
  onDestroy(() => {
    E && H();
  });
  let U = null;
  function j(te) {
    binding_callbacks[te ? "unshift" : "push"](() => {
      W = te, t(16, W), t(7, s), t(14, R), t(15, N);
    });
  }
  const re = () => {
    h("clear_status");
  };
  function ie(te) {
    binding_callbacks[te ? "unshift" : "push"](() => {
      M = te, t(13, M);
    });
  }
  return n.$$set = (te) => {
    "i18n" in te && t(1, c = te.i18n), "eta" in te && t(0, d = te.eta), "queue_position" in te && t(2, _ = te.queue_position), "queue_size" in te && t(3, m = te.queue_size), "status" in te && t(4, y = te.status), "scroll_to_output" in te && t(22, x = te.scroll_to_output), "timer" in te && t(5, b = te.timer), "show_progress" in te && t(6, A = te.show_progress), "message" in te && t(23, f = te.message), "progress" in te && t(7, s = te.progress), "variant" in te && t(8, u = te.variant), "loading_text" in te && t(9, p = te.loading_text), "absolute" in te && t(10, g = te.absolute), "translucent" in te && t(11, w = te.translucent), "border" in te && t(12, o = te.border), "autoscroll" in te && t(24, v = te.autoscroll), "$$scope" in te && t(29, l = te.$$scope);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    436207617 && (d === null && t(0, d = L), d != null && L !== d && (t(28, z = (performance.now() - $) / 1e3 + d), t(19, U = z.toFixed(1)), t(27, L = d))), n.$$.dirty[0] & /*eta_from_start, timer_diff*/
    335544320 && t(17, O = z === null || z <= 0 || !k ? null : Math.min(k / z, 1)), n.$$.dirty[0] & /*progress*/
    128 && s != null && t(18, B = !1), n.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (s != null ? t(14, R = s.map((te) => {
      if (te.index != null && te.length != null)
        return te.index / te.length;
      if (te.progress != null)
        return te.progress;
    })) : t(14, R = null), R ? (t(15, N = R[R.length - 1]), W && (N === 0 ? t(16, W.style.transition = "0", W) : t(16, W.style.transition = "150ms", W))) : t(15, N = void 0)), n.$$.dirty[0] & /*status*/
    16 && (y === "pending" ? P() : H()), n.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && M && x && (y === "pending" || y === "complete") && scroll_into_view(M, v), n.$$.dirty[0] & /*status, message*/
    8388624, n.$$.dirty[0] & /*timer_diff*/
    67108864 && t(20, r = k.toFixed(1));
  }, [
    d,
    c,
    _,
    m,
    y,
    b,
    A,
    s,
    u,
    p,
    g,
    w,
    o,
    M,
    R,
    N,
    W,
    O,
    B,
    U,
    r,
    h,
    x,
    f,
    v,
    $,
    k,
    L,
    z,
    l,
    a,
    j,
    re,
    ie
  ];
}
class Static extends SvelteComponent$2 {
  constructor(e) {
    super(), init$2(
      this,
      e,
      instance$2,
      create_fragment$2,
      safe_not_equal$2,
      {
        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]
    );
  }
}
const {
  SvelteComponent: SvelteComponent$1,
  append_hydration: append_hydration$1,
  attr: attr$1,
  children: children$1,
  claim_element: claim_element$1,
  claim_text: claim_text$1,
  detach: detach$1,
  element: element$1,
  init: init$1,
  insert_hydration: insert_hydration$1,
  noop: noop$1,
  safe_not_equal: safe_not_equal$1,
  set_data,
  text: text$1,
  toggle_class
} = window.__gradio__svelte__internal;
function create_fragment$1(n) {
  let e, t = (
    /*value*/
    (n[0] ? Array.isArray(
      /*value*/
      n[0]
    ) ? (
      /*value*/
      n[0].join(", ")
    ) : (
      /*value*/
      n[0]
    ) : "") + ""
  ), r;
  return {
    c() {
      e = element$1("div"), r = text$1(t), this.h();
    },
    l(a) {
      e = claim_element$1(a, "DIV", { class: !0 });
      var l = children$1(e);
      r = claim_text$1(l, t), l.forEach(detach$1), this.h();
    },
    h() {
      attr$1(e, "class", "svelte-1hgn91n"), toggle_class(
        e,
        "table",
        /*type*/
        n[1] === "table"
      ), toggle_class(
        e,
        "gallery",
        /*type*/
        n[1] === "gallery"
      ), toggle_class(
        e,
        "selected",
        /*selected*/
        n[2]
      );
    },
    m(a, l) {
      insert_hydration$1(a, e, l), append_hydration$1(e, r);
    },
    p(a, [l]) {
      l & /*value*/
      1 && t !== (t = /*value*/
      (a[0] ? Array.isArray(
        /*value*/
        a[0]
      ) ? (
        /*value*/
        a[0].join(", ")
      ) : (
        /*value*/
        a[0]
      ) : "") + "") && set_data(r, t), l & /*type*/
      2 && toggle_class(
        e,
        "table",
        /*type*/
        a[1] === "table"
      ), l & /*type*/
      2 && toggle_class(
        e,
        "gallery",
        /*type*/
        a[1] === "gallery"
      ), l & /*selected*/
      4 && toggle_class(
        e,
        "selected",
        /*selected*/
        a[2]
      );
    },
    i: noop$1,
    o: noop$1,
    d(a) {
      a && detach$1(e);
    }
  };
}
function instance$1(n, e, t) {
  let { value: r } = e, { type: a } = e, { selected: l = !1 } = e;
  return n.$$set = (h) => {
    "value" in h && t(0, r = h.value), "type" in h && t(1, a = h.type), "selected" in h && t(2, l = h.selected);
  }, [r, a, l];
}
class Example extends SvelteComponent$1 {
  constructor(e) {
    super(), init$1(this, e, instance$1, create_fragment$1, safe_not_equal$1, { value: 0, type: 1, selected: 2 });
  }
}
const {
  SvelteComponent,
  append_hydration,
  assign,
  attr,
  check_outros,
  children,
  claim_component,
  claim_element,
  claim_space,
  claim_svg_element,
  claim_text,
  create_component,
  destroy_component,
  destroy_each,
  detach,
  element,
  empty,
  ensure_array_like,
  flush,
  get_spread_object,
  get_spread_update,
  get_svelte_dataset,
  group_outros,
  init,
  insert_hydration,
  mount_component,
  noop,
  safe_not_equal,
  space,
  svg_element,
  text,
  transition_in,
  transition_out
} = window.__gradio__svelte__internal;
function get_each_context(n, e, t) {
  const r = n.slice();
  return r[43] = e[t], r;
}
function create_else_block(n) {
  let e, t;
  return e = new FileUpload({
    props: {
      upload: (
        /*gradio*/
        n[17].client.upload
      ),
      stream_handler: (
        /*gradio*/
        n[17].client.stream
      ),
      label: (
        /*label*/
        n[7]
      ),
      show_label: (
        /*show_label*/
        n[8]
      ),
      value: (
        /*value*/
        n[0]
      ),
      file_count: (
        /*file_count*/
        n[18]
      ),
      file_types: (
        /*file_types*/
        n[19]
      ),
      selectable: (
        /*_selectable*/
        n[13]
      ),
      root: (
        /*root*/
        n[6]
      ),
      height: (
        /*height*/
        n[9]
      ),
      representations: (
        /*representations*/
        n[23]
      ),
      config: (
        /*config*/
        n[10]
      ),
      confidenceLabel: (
        /*confidenceLabel*/
        n[11]
      ),
      moldata: (
        /*moldata*/
        n[20]
      ),
      molviewer: (
        /*showviewer*/
        n[12]
      ),
      max_file_size: (
        /*gradio*/
        n[17].max_file_size
      ),
      i18n: (
        /*gradio*/
        n[17].i18n
      ),
      $$slots: { default: [create_default_slot_1] },
      $$scope: { ctx: n }
    }
  }), e.$on(
    "change",
    /*change_handler*/
    n[29]
  ), e.$on(
    "drag",
    /*drag_handler*/
    n[30]
  ), e.$on(
    "clear",
    /*clear_handler*/
    n[31]
  ), e.$on(
    "select",
    /*select_handler_1*/
    n[32]
  ), e.$on(
    "notfound",
    /*notfound_handler*/
    n[33]
  ), e.$on(
    "upload",
    /*upload_handler*/
    n[34]
  ), e.$on(
    "error",
    /*error_handler*/
    n[35]
  ), e.$on(
    "delete",
    /*delete_handler*/
    n[36]
  ), {
    c() {
      create_component(e.$$.fragment);
    },
    l(r) {
      claim_component(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a[0] & /*gradio*/
      131072 && (l.upload = /*gradio*/
      r[17].client.upload), a[0] & /*gradio*/
      131072 && (l.stream_handler = /*gradio*/
      r[17].client.stream), a[0] & /*label*/
      128 && (l.label = /*label*/
      r[7]), a[0] & /*show_label*/
      256 && (l.show_label = /*show_label*/
      r[8]), a[0] & /*value*/
      1 && (l.value = /*value*/
      r[0]), a[0] & /*file_count*/
      262144 && (l.file_count = /*file_count*/
      r[18]), a[0] & /*file_types*/
      524288 && (l.file_types = /*file_types*/
      r[19]), a[0] & /*_selectable*/
      8192 && (l.selectable = /*_selectable*/
      r[13]), a[0] & /*root*/
      64 && (l.root = /*root*/
      r[6]), a[0] & /*height*/
      512 && (l.height = /*height*/
      r[9]), a[0] & /*config*/
      1024 && (l.config = /*config*/
      r[10]), a[0] & /*confidenceLabel*/
      2048 && (l.confidenceLabel = /*confidenceLabel*/
      r[11]), a[0] & /*moldata*/
      1048576 && (l.moldata = /*moldata*/
      r[20]), a[0] & /*showviewer*/
      4096 && (l.molviewer = /*showviewer*/
      r[12]), a[0] & /*gradio*/
      131072 && (l.max_file_size = /*gradio*/
      r[17].max_file_size), a[0] & /*gradio*/
      131072 && (l.i18n = /*gradio*/
      r[17].i18n), a[0] & /*gradio*/
      131072 | a[1] & /*$$scope*/
      32768 && (l.$$scope = { dirty: a, ctx: r }), e.$set(l);
    },
    i(r) {
      t || (transition_in(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component(e, r);
    }
  };
}
function create_if_block_1(n) {
  let e, t;
  return e = new File_1({
    props: {
      selectable: (
        /*_selectable*/
        n[13]
      ),
      value: (
        /*value*/
        n[0]
      ),
      label: (
        /*label*/
        n[7]
      ),
      show_label: (
        /*show_label*/
        n[8]
      ),
      height: (
        /*height*/
        n[9]
      ),
      representations: (
        /*representations*/
        n[23]
      ),
      config: (
        /*config*/
        n[10]
      ),
      confidenceLabel: (
        /*confidenceLabel*/
        n[11]
      ),
      moldata: (
        /*moldata*/
        n[20]
      ),
      errors: (
        /*errors*/
        n[22]
      ),
      i18n: (
        /*gradio*/
        n[17].i18n
      ),
      molviewer: (
        /*showviewer*/
        n[12]
      )
    }
  }), e.$on(
    "select",
    /*select_handler*/
    n[28]
  ), {
    c() {
      create_component(e.$$.fragment);
    },
    l(r) {
      claim_component(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a[0] & /*_selectable*/
      8192 && (l.selectable = /*_selectable*/
      r[13]), a[0] & /*value*/
      1 && (l.value = /*value*/
      r[0]), a[0] & /*label*/
      128 && (l.label = /*label*/
      r[7]), a[0] & /*show_label*/
      256 && (l.show_label = /*show_label*/
      r[8]), a[0] & /*height*/
      512 && (l.height = /*height*/
      r[9]), a[0] & /*config*/
      1024 && (l.config = /*config*/
      r[10]), a[0] & /*confidenceLabel*/
      2048 && (l.confidenceLabel = /*confidenceLabel*/
      r[11]), a[0] & /*moldata*/
      1048576 && (l.moldata = /*moldata*/
      r[20]), a[0] & /*gradio*/
      131072 && (l.i18n = /*gradio*/
      r[17].i18n), a[0] & /*showviewer*/
      4096 && (l.molviewer = /*showviewer*/
      r[12]), e.$set(l);
    },
    i(r) {
      t || (transition_in(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component(e, r);
    }
  };
}
function create_default_slot_1(n) {
  let e, t;
  return e = new UploadText({
    props: {
      i18n: (
        /*gradio*/
        n[17].i18n
      ),
      type: "file"
    }
  }), {
    c() {
      create_component(e.$$.fragment);
    },
    l(r) {
      claim_component(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a[0] & /*gradio*/
      131072 && (l.i18n = /*gradio*/
      r[17].i18n), e.$set(l);
    },
    i(r) {
      t || (transition_in(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component(e, r);
    }
  };
}
function create_if_block(n) {
  let e, t, r, a, l, h = "Error in the representations", c, d, _, m = "Couldn't display Molecule. Fix the following problems:", y, x, b = ensure_array_like(
    /*errors*/
    n[22]
  ), A = [];
  for (let f = 0; f < b.length; f += 1)
    A[f] = create_each_block(get_each_context(n, b, f));
  return {
    c() {
      e = element("div"), t = svg_element("svg"), r = svg_element("path"), a = space(), l = element("span"), l.textContent = h, c = space(), d = element("div"), _ = element("span"), _.textContent = m, y = space(), x = element("ul");
      for (let f = 0; f < A.length; f += 1)
        A[f].c();
      this.h();
    },
    l(f) {
      e = claim_element(f, "DIV", { class: !0, role: !0 });
      var s = children(e);
      t = claim_svg_element(s, "svg", {
        class: !0,
        xmlns: !0,
        fill: !0,
        viewBox: !0,
        "stroke-width": !0,
        stroke: !0
      });
      var u = children(t);
      r = claim_svg_element(u, "path", {
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        d: !0
      }), children(r).forEach(detach), u.forEach(detach), a = claim_space(s), l = claim_element(s, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset(l) !== "svelte-jj7i23" && (l.textContent = h), c = claim_space(s), d = claim_element(s, "DIV", {});
      var p = children(d);
      _ = claim_element(p, "SPAN", { class: !0, "data-svelte-h": !0 }), get_svelte_dataset(_) !== "svelte-6hdql9" && (_.textContent = m), y = claim_space(p), x = claim_element(p, "UL", { class: !0 });
      var g = children(x);
      for (let w = 0; w < A.length; w += 1)
        A[w].l(g);
      g.forEach(detach), p.forEach(detach), s.forEach(detach), this.h();
    },
    h() {
      attr(r, "stroke-linecap", "round"), attr(r, "stroke-linejoin", "round"), attr(r, "d", "M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"), attr(t, "class", "flex-shrink-0 inline w-4 h-4 mr-3 mt-[2px]"), attr(t, "xmlns", "http://www.w3.org/2000/svg"), attr(t, "fill", "none"), attr(t, "viewBox", "0 0 24 24"), attr(t, "stroke-width", "1.5"), attr(t, "stroke", "currentColor"), attr(l, "class", "sr-only"), attr(_, "class", "font-medium"), attr(x, "class", "mt-1.5 ml-4 list-disc list-inside"), attr(e, "class", "flex m-2 p-4 mb-4 text-sm text-red-800 rounded-lg bg-red-50 dark:bg-gray-800 dark:text-red-400"), attr(e, "role", "alert");
    },
    m(f, s) {
      insert_hydration(f, e, s), append_hydration(e, t), append_hydration(t, r), append_hydration(e, a), append_hydration(e, l), append_hydration(e, c), append_hydration(e, d), append_hydration(d, _), append_hydration(d, y), append_hydration(d, x);
      for (let u = 0; u < A.length; u += 1)
        A[u] && A[u].m(x, null);
    },
    p(f, s) {
      if (s[0] & /*errors*/
      4194304) {
        b = ensure_array_like(
          /*errors*/
          f[22]
        );
        let u;
        for (u = 0; u < b.length; u += 1) {
          const p = get_each_context(f, b, u);
          A[u] ? A[u].p(p, s) : (A[u] = create_each_block(p), A[u].c(), A[u].m(x, null));
        }
        for (; u < A.length; u += 1)
          A[u].d(1);
        A.length = b.length;
      }
    },
    d(f) {
      f && detach(e), destroy_each(A, f);
    }
  };
}
function create_each_block(n) {
  let e, t = (
    /*error*/
    n[43] + ""
  ), r;
  return {
    c() {
      e = element("li"), r = text(t);
    },
    l(a) {
      e = claim_element(a, "LI", {});
      var l = children(e);
      r = claim_text(l, t), l.forEach(detach);
    },
    m(a, l) {
      insert_hydration(a, e, l), append_hydration(e, r);
    },
    p: noop,
    d(a) {
      a && detach(e);
    }
  };
}
function create_default_slot(n) {
  var A;
  let e, t, r, a, l, h, c;
  const d = [
    {
      autoscroll: (
        /*gradio*/
        n[17].autoscroll
      )
    },
    { i18n: (
      /*gradio*/
      n[17].i18n
    ) },
    /*loading_status*/
    n[1],
    {
      status: (
        /*loading_status*/
        ((A = n[1]) == null ? void 0 : A.status) || "complete"
      )
    }
  ];
  let _ = {};
  for (let f = 0; f < d.length; f += 1)
    _ = assign(_, d[f]);
  e = new Static({ props: _ }), e.$on(
    "clear_status",
    /*clear_status_handler*/
    n[27]
  );
  const m = [create_if_block_1, create_else_block], y = [];
  function x(f, s) {
    return (
      /*interactive*/
      f[5] ? 1 : 0
    );
  }
  r = x(n), a = y[r] = m[r](n);
  let b = (
    /*errors*/
    n[22].length > 0 && /*value*/
    n[0] !== null && create_if_block(n)
  );
  return {
    c() {
      create_component(e.$$.fragment), t = space(), a.c(), l = space(), b && b.c(), h = empty();
    },
    l(f) {
      claim_component(e.$$.fragment, f), t = claim_space(f), a.l(f), l = claim_space(f), b && b.l(f), h = empty();
    },
    m(f, s) {
      mount_component(e, f, s), insert_hydration(f, t, s), y[r].m(f, s), insert_hydration(f, l, s), b && b.m(f, s), insert_hydration(f, h, s), c = !0;
    },
    p(f, s) {
      var g;
      const u = s[0] & /*gradio, loading_status*/
      131074 ? get_spread_update(d, [
        s[0] & /*gradio*/
        131072 && {
          autoscroll: (
            /*gradio*/
            f[17].autoscroll
          )
        },
        s[0] & /*gradio*/
        131072 && { i18n: (
          /*gradio*/
          f[17].i18n
        ) },
        s[0] & /*loading_status*/
        2 && get_spread_object(
          /*loading_status*/
          f[1]
        ),
        s[0] & /*loading_status*/
        2 && {
          status: (
            /*loading_status*/
            ((g = f[1]) == null ? void 0 : g.status) || "complete"
          )
        }
      ]) : {};
      e.$set(u);
      let p = r;
      r = x(f), r === p ? y[r].p(f, s) : (group_outros(), transition_out(y[p], 1, 1, () => {
        y[p] = null;
      }), check_outros(), a = y[r], a ? a.p(f, s) : (a = y[r] = m[r](f), a.c()), transition_in(a, 1), a.m(l.parentNode, l)), /*errors*/
      f[22].length > 0 && /*value*/
      f[0] !== null ? b ? b.p(f, s) : (b = create_if_block(f), b.c(), b.m(h.parentNode, h)) : b && (b.d(1), b = null);
    },
    i(f) {
      c || (transition_in(e.$$.fragment, f), transition_in(a), c = !0);
    },
    o(f) {
      transition_out(e.$$.fragment, f), transition_out(a), c = !1;
    },
    d(f) {
      f && (detach(t), detach(l), detach(h)), destroy_component(e, f), y[r].d(f), b && b.d(f);
    }
  };
}
function create_fragment(n) {
  let e, t;
  return e = new Block({
    props: {
      visible: (
        /*visible*/
        n[4]
      ),
      variant: (
        /*value*/
        n[0] ? "solid" : "dashed"
      ),
      border_mode: (
        /*dragging*/
        n[21] ? "focus" : "base"
      ),
      padding: !1,
      elem_id: (
        /*elem_id*/
        n[2]
      ),
      elem_classes: (
        /*elem_classes*/
        n[3]
      ),
      container: (
        /*container*/
        n[14]
      ),
      scale: (
        /*scale*/
        n[15]
      ),
      min_width: (
        /*min_width*/
        n[16]
      ),
      allow_overflow: !1,
      $$slots: { default: [create_default_slot] },
      $$scope: { ctx: n }
    }
  }), {
    c() {
      create_component(e.$$.fragment);
    },
    l(r) {
      claim_component(e.$$.fragment, r);
    },
    m(r, a) {
      mount_component(e, r, a), t = !0;
    },
    p(r, a) {
      const l = {};
      a[0] & /*visible*/
      16 && (l.visible = /*visible*/
      r[4]), a[0] & /*value*/
      1 && (l.variant = /*value*/
      r[0] ? "solid" : "dashed"), a[0] & /*dragging*/
      2097152 && (l.border_mode = /*dragging*/
      r[21] ? "focus" : "base"), a[0] & /*elem_id*/
      4 && (l.elem_id = /*elem_id*/
      r[2]), a[0] & /*elem_classes*/
      8 && (l.elem_classes = /*elem_classes*/
      r[3]), a[0] & /*container*/
      16384 && (l.container = /*container*/
      r[14]), a[0] & /*scale*/
      32768 && (l.scale = /*scale*/
      r[15]), a[0] & /*min_width*/
      65536 && (l.min_width = /*min_width*/
      r[16]), a[0] & /*value, _selectable, label, show_label, height, config, confidenceLabel, moldata, gradio, showviewer, interactive, file_count, file_types, root, dragging, loading_status*/
      4079587 | a[1] & /*$$scope*/
      32768 && (l.$$scope = { dirty: a, ctx: r }), e.$set(l);
    },
    i(r) {
      t || (transition_in(e.$$.fragment, r), t = !0);
    },
    o(r) {
      transition_out(e.$$.fragment, r), t = !1;
    },
    d(r) {
      destroy_component(e, r);
    }
  };
}
function instance(n, e, t) {
  var r = this && this.__awaiter || function(J, Ee, se, Ae) {
    function he(ne) {
      return ne instanceof se ? ne : new se(function(_e) {
        _e(ne);
      });
    }
    return new (se || (se = Promise))(function(ne, _e) {
      function Le(He) {
        try {
          Ue(Ae.next(He));
        } catch (We) {
          _e(We);
        }
      }
      function Be(He) {
        try {
          Ue(Ae.throw(He));
        } catch (We) {
          _e(We);
        }
      }
      function Ue(He) {
        He.done ? ne(He.value) : he(He.value).then(Le, Be);
      }
      Ue((Ae = Ae.apply(J, Ee || [])).next());
    });
  };
  let { elem_id: a = "" } = e, { elem_classes: l = [] } = e, { visible: h = !0 } = e, { value: c } = e, { interactive: d } = e, { root: _ } = e, { label: m } = e, { show_label: y } = e, { height: x = void 0 } = e, { reps: b = [] } = e, { config: A = {} } = e, { confidenceLabel: f = "" } = e, { showviewer: s = !0 } = e, { _selectable: u = !1 } = e, { loading_status: p } = e, { container: g = !0 } = e, { scale: w = null } = e, { min_width: o = void 0 } = e, { gradio: v } = e, { file_count: M } = e, { file_types: E = ["file"] } = e, $ = c, k = !1, L = {
    model: { type: Number, default: 0 },
    chain: { type: String, default: "" },
    resname: { type: String, default: "" },
    style: {
      type: String,
      default: "cartoon",
      choices: ["cartoon", "stick", "sphere", "surface"]
    },
    color: {
      type: String,
      default: "whiteCarbon",
      choices: [
        "whiteCarbon",
        "orangeCarbon",
        "redCarbon",
        "blackCarbon",
        "blueCarbon",
        "grayCarbon",
        "greenCarbon",
        "cyanCarbon",
        "alphafold",
        "default",
        "Jmol",
        "chain",
        "spectrum"
      ]
    },
    opacity: { type: Number, default: 1 },
    residue_range: { type: String, default: "" },
    around: { type: Number, default: 0 },
    byres: { type: Boolean, default: !1 },
    visible: { type: Boolean, default: !0 }
  }, z = null, O = ["pdb", "sdf", "mol2", "pdb1"];
  function R(J) {
    return r(this, void 0, void 0, function* () {
      return yield (yield fetch(J)).text();
    });
  }
  let N = [];
  function W(J) {
    return r(this, void 0, void 0, function* () {
      if (J == null)
        return [];
      if (Array.isArray(J)) {
        let Ee = [];
        for (const se of J) {
          let Ae = se.orig_name.split(".").pop();
          if (!O.includes(Ae)) {
            N.push(`Invalid file extension for ${se.orig_name}. Expected one of ${O.join(", ")}, got ${Ae}`), t(20, z = null);
            continue;
          }
          Ee.push({
            data: yield R(se.url),
            name: se.orig_name,
            format: Ae,
            asFrames: !1
          });
        }
        t(20, z = Ee);
      } else if (typeof J == "object" && J !== null) {
        let Ee = J.orig_name.split(".").pop();
        if (!O.includes(Ee))
          N.push(`Invalid file extension for ${J.orig_name}. Expected one of ${O.join(", ")}, got ${Ee}`), t(20, z = null);
        else {
          let se = yield R(J.url), Ae = J.orig_name.split(".").pop();
          Ae === "pdb1" && (Ae = "pdb"), t(20, z = [
            {
              data: se,
              name: J.orig_name,
              format: Ae,
              asFrames: !1
            }
          ]);
        }
      } else
        t(20, z = null);
    });
  }
  let B = 0, P = [];
  const G = () => v.dispatch("clear_status", p), H = ({ detail: J }) => v.dispatch("select", J), U = ({ detail: J }) => {
    t(0, c = J);
  }, j = ({ detail: J }) => t(21, k = J), re = () => v.dispatch("clear"), ie = ({ detail: J }) => v.dispatch("select", J), te = () => v.dispatch("error", "identifier not found in database, check spelling"), ue = () => v.dispatch("upload"), de = ({ detail: J }) => {
    t(1, p = p || {}), t(1, p.status = "error", p), v.dispatch("error", J);
  }, oe = ({ detail: J }) => {
    v.dispatch("delete", J);
  };
  return n.$$set = (J) => {
    "elem_id" in J && t(2, a = J.elem_id), "elem_classes" in J && t(3, l = J.elem_classes), "visible" in J && t(4, h = J.visible), "value" in J && t(0, c = J.value), "interactive" in J && t(5, d = J.interactive), "root" in J && t(6, _ = J.root), "label" in J && t(7, m = J.label), "show_label" in J && t(8, y = J.show_label), "height" in J && t(9, x = J.height), "reps" in J && t(24, b = J.reps), "config" in J && t(10, A = J.config), "confidenceLabel" in J && t(11, f = J.confidenceLabel), "showviewer" in J && t(12, s = J.showviewer), "_selectable" in J && t(13, u = J._selectable), "loading_status" in J && t(1, p = J.loading_status), "container" in J && t(14, g = J.container), "scale" in J && t(15, w = J.scale), "min_width" in J && t(16, o = J.min_width), "gradio" in J && t(17, v = J.gradio), "file_count" in J && t(18, M = J.file_count), "file_types" in J && t(19, E = J.file_types);
  }, n.$$.update = () => {
    n.$$.dirty[0] & /*old_value, value, gradio*/
    33685505 && JSON.stringify($) !== JSON.stringify(c) && (v.dispatch("change"), t(25, $ = c), t(20, z = null), W(c)), n.$$.dirty[0] & /*reps, gradio, value*/
    16908289 && JSON.stringify(b) !== JSON.stringify(b) && (v.dispatch("change"), t(25, $ = c), t(20, z = null), W(c)), n.$$.dirty[0] & /*moldata*/
    1048576 && t(26, B = z ? z.length : 0), n.$$.dirty[0] & /*reps, lenMoldata*/
    83886080 && (b.forEach((J) => {
      for (const [Ee, se] of Object.entries(L))
        J[Ee] === void 0 && (J[Ee] = se.default), J[Ee].constructor != se.type && N.push(`Invalid type for ${Ee} in reps. Expected ${se.type}, got ${typeof J[Ee]}`);
    }), b.forEach((J) => {
      J.model <= B && P.push(J);
    })), n.$$.dirty[0] & /*value*/
    1 && W(c);
  }, [
    c,
    p,
    a,
    l,
    h,
    d,
    _,
    m,
    y,
    x,
    A,
    f,
    s,
    u,
    g,
    w,
    o,
    v,
    M,
    E,
    z,
    k,
    N,
    P,
    b,
    $,
    B,
    G,
    H,
    U,
    j,
    re,
    ie,
    te,
    ue,
    de,
    oe
  ];
}
class Index extends SvelteComponent {
  constructor(e) {
    super(), init(
      this,
      e,
      instance,
      create_fragment,
      safe_not_equal,
      {
        elem_id: 2,
        elem_classes: 3,
        visible: 4,
        value: 0,
        interactive: 5,
        root: 6,
        label: 7,
        show_label: 8,
        height: 9,
        reps: 24,
        config: 10,
        confidenceLabel: 11,
        showviewer: 12,
        _selectable: 13,
        loading_status: 1,
        container: 14,
        scale: 15,
        min_width: 16,
        gradio: 17,
        file_count: 18,
        file_types: 19
      },
      null,
      [-1, -1]
    );
  }
  get elem_id() {
    return this.$$.ctx[2];
  }
  set elem_id(e) {
    this.$$set({ elem_id: e }), flush();
  }
  get elem_classes() {
    return this.$$.ctx[3];
  }
  set elem_classes(e) {
    this.$$set({ elem_classes: e }), flush();
  }
  get visible() {
    return this.$$.ctx[4];
  }
  set visible(e) {
    this.$$set({ visible: e }), flush();
  }
  get value() {
    return this.$$.ctx[0];
  }
  set value(e) {
    this.$$set({ value: e }), flush();
  }
  get interactive() {
    return this.$$.ctx[5];
  }
  set interactive(e) {
    this.$$set({ interactive: e }), flush();
  }
  get root() {
    return this.$$.ctx[6];
  }
  set root(e) {
    this.$$set({ root: e }), flush();
  }
  get label() {
    return this.$$.ctx[7];
  }
  set label(e) {
    this.$$set({ label: e }), flush();
  }
  get show_label() {
    return this.$$.ctx[8];
  }
  set show_label(e) {
    this.$$set({ show_label: e }), flush();
  }
  get height() {
    return this.$$.ctx[9];
  }
  set height(e) {
    this.$$set({ height: e }), flush();
  }
  get reps() {
    return this.$$.ctx[24];
  }
  set reps(e) {
    this.$$set({ reps: e }), flush();
  }
  get config() {
    return this.$$.ctx[10];
  }
  set config(e) {
    this.$$set({ config: e }), flush();
  }
  get confidenceLabel() {
    return this.$$.ctx[11];
  }
  set confidenceLabel(e) {
    this.$$set({ confidenceLabel: e }), flush();
  }
  get showviewer() {
    return this.$$.ctx[12];
  }
  set showviewer(e) {
    this.$$set({ showviewer: e }), flush();
  }
  get _selectable() {
    return this.$$.ctx[13];
  }
  set _selectable(e) {
    this.$$set({ _selectable: e }), flush();
  }
  get loading_status() {
    return this.$$.ctx[1];
  }
  set loading_status(e) {
    this.$$set({ loading_status: e }), flush();
  }
  get container() {
    return this.$$.ctx[14];
  }
  set container(e) {
    this.$$set({ container: e }), flush();
  }
  get scale() {
    return this.$$.ctx[15];
  }
  set scale(e) {
    this.$$set({ scale: e }), flush();
  }
  get min_width() {
    return this.$$.ctx[16];
  }
  set min_width(e) {
    this.$$set({ min_width: e }), flush();
  }
  get gradio() {
    return this.$$.ctx[17];
  }
  set gradio(e) {
    this.$$set({ gradio: e }), flush();
  }
  get file_count() {
    return this.$$.ctx[18];
  }
  set file_count(e) {
    this.$$set({ file_count: e }), flush();
  }
  get file_types() {
    return this.$$.ctx[19];
  }
  set file_types(e) {
    this.$$set({ file_types: e }), flush();
  }
}
export {
  Example as BaseExample,
  File_1 as BaseFile,
  FileUpload as BaseFileUpload,
  FilePreview,
  Index as default
};
