var oi = Object.defineProperty;
var kn = (r) => {
  throw TypeError(r);
};
var li = (r, e, n) => e in r ? oi(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n;
var qe = (r, e, n) => li(r, typeof e != "symbol" ? e + "" : e, n), Ut = (r, e, n) => e.has(r) || kn("Cannot " + n);
var c = (r, e, n) => (Ut(r, e, "read from private field"), n ? n.call(r) : e.get(r)), le = (r, e, n) => e.has(r) ? kn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, n), he = (r, e, n, t) => (Ut(r, e, "write to private field"), t ? t.call(r, n) : e.set(r, n), n), Z = (r, e, n) => (Ut(r, e, "access private method"), n);
var bt = (r, e, n, t) => ({
  set _(i) {
    he(r, e, i, n);
  },
  get _() {
    return c(r, e, t);
  }
});
const {
  SvelteComponent: SvelteComponent$b,
  assign: assign$2,
  create_slot: create_slot$3,
  detach: detach$b,
  element: element$8,
  get_all_dirty_from_scope: get_all_dirty_from_scope$3,
  get_slot_changes: get_slot_changes$3,
  get_spread_update: get_spread_update$2,
  init: init$b,
  insert: insert$b,
  safe_not_equal: safe_not_equal$c,
  set_dynamic_element_data,
  set_style: set_style$6,
  toggle_class: toggle_class$6,
  transition_in: transition_in$8,
  transition_out: transition_out$8,
  update_slot_base: update_slot_base$3
} = window.__gradio__svelte__internal;
function create_dynamic_element(r) {
  let e, n, t;
  const i = (
    /*#slots*/
    r[18].default
  ), a = create_slot$3(
    i,
    r,
    /*$$scope*/
    r[17],
    null
  );
  let s = [
    { "data-testid": (
      /*test_id*/
      r[7]
    ) },
    { id: (
      /*elem_id*/
      r[2]
    ) },
    {
      class: n = "block " + /*elem_classes*/
      r[3].join(" ") + " svelte-nl1om8"
    }
  ], h = {};
  for (let u = 0; u < s.length; u += 1)
    h = assign$2(h, s[u]);
  return {
    c() {
      e = element$8(
        /*tag*/
        r[14]
      ), a && a.c(), set_dynamic_element_data(
        /*tag*/
        r[14]
      )(e, h), toggle_class$6(
        e,
        "hidden",
        /*visible*/
        r[10] === !1
      ), toggle_class$6(
        e,
        "padded",
        /*padding*/
        r[6]
      ), toggle_class$6(
        e,
        "border_focus",
        /*border_mode*/
        r[5] === "focus"
      ), toggle_class$6(
        e,
        "border_contrast",
        /*border_mode*/
        r[5] === "contrast"
      ), toggle_class$6(e, "hide-container", !/*explicit_call*/
      r[8] && !/*container*/
      r[9]), set_style$6(
        e,
        "height",
        /*get_dimension*/
        r[15](
          /*height*/
          r[0]
        )
      ), set_style$6(e, "width", typeof /*width*/
      r[1] == "number" ? `calc(min(${/*width*/
      r[1]}px, 100%))` : (
        /*get_dimension*/
        r[15](
          /*width*/
          r[1]
        )
      )), set_style$6(
        e,
        "border-style",
        /*variant*/
        r[4]
      ), set_style$6(
        e,
        "overflow",
        /*allow_overflow*/
        r[11] ? "visible" : "hidden"
      ), set_style$6(
        e,
        "flex-grow",
        /*scale*/
        r[12]
      ), set_style$6(e, "min-width", `calc(min(${/*min_width*/
      r[13]}px, 100%))`), set_style$6(e, "border-width", "var(--block-border-width)");
    },
    m(u, l) {
      insert$b(u, e, l), a && a.m(e, null), t = !0;
    },
    p(u, l) {
      a && a.p && (!t || l & /*$$scope*/
      131072) && update_slot_base$3(
        a,
        i,
        u,
        /*$$scope*/
        u[17],
        t ? get_slot_changes$3(
          i,
          /*$$scope*/
          u[17],
          l,
          null
        ) : get_all_dirty_from_scope$3(
          /*$$scope*/
          u[17]
        ),
        null
      ), set_dynamic_element_data(
        /*tag*/
        u[14]
      )(e, h = get_spread_update$2(s, [
        (!t || l & /*test_id*/
        128) && { "data-testid": (
          /*test_id*/
          u[7]
        ) },
        (!t || l & /*elem_id*/
        4) && { id: (
          /*elem_id*/
          u[2]
        ) },
        (!t || l & /*elem_classes*/
        8 && n !== (n = "block " + /*elem_classes*/
        u[3].join(" ") + " svelte-nl1om8")) && { class: n }
      ])), toggle_class$6(
        e,
        "hidden",
        /*visible*/
        u[10] === !1
      ), toggle_class$6(
        e,
        "padded",
        /*padding*/
        u[6]
      ), toggle_class$6(
        e,
        "border_focus",
        /*border_mode*/
        u[5] === "focus"
      ), toggle_class$6(
        e,
        "border_contrast",
        /*border_mode*/
        u[5] === "contrast"
      ), toggle_class$6(e, "hide-container", !/*explicit_call*/
      u[8] && !/*container*/
      u[9]), l & /*height*/
      1 && set_style$6(
        e,
        "height",
        /*get_dimension*/
        u[15](
          /*height*/
          u[0]
        )
      ), l & /*width*/
      2 && set_style$6(e, "width", typeof /*width*/
      u[1] == "number" ? `calc(min(${/*width*/
      u[1]}px, 100%))` : (
        /*get_dimension*/
        u[15](
          /*width*/
          u[1]
        )
      )), l & /*variant*/
      16 && set_style$6(
        e,
        "border-style",
        /*variant*/
        u[4]
      ), l & /*allow_overflow*/
      2048 && set_style$6(
        e,
        "overflow",
        /*allow_overflow*/
        u[11] ? "visible" : "hidden"
      ), l & /*scale*/
      4096 && set_style$6(
        e,
        "flex-grow",
        /*scale*/
        u[12]
      ), l & /*min_width*/
      8192 && set_style$6(e, "min-width", `calc(min(${/*min_width*/
      u[13]}px, 100%))`);
    },
    i(u) {
      t || (transition_in$8(a, u), t = !0);
    },
    o(u) {
      transition_out$8(a, u), t = !1;
    },
    d(u) {
      u && detach$b(e), a && a.d(u);
    }
  };
}
function create_fragment$b(r) {
  let e, n = (
    /*tag*/
    r[14] && create_dynamic_element(r)
  );
  return {
    c() {
      n && n.c();
    },
    m(t, i) {
      n && n.m(t, i), e = !0;
    },
    p(t, [i]) {
      /*tag*/
      t[14] && n.p(t, i);
    },
    i(t) {
      e || (transition_in$8(n, t), e = !0);
    },
    o(t) {
      transition_out$8(n, t), e = !1;
    },
    d(t) {
      n && n.d(t);
    }
  };
}
function instance$9(r, e, n) {
  let { $$slots: t = {}, $$scope: i } = e, { height: a = void 0 } = e, { width: s = void 0 } = e, { elem_id: h = "" } = e, { elem_classes: u = [] } = e, { variant: l = "solid" } = e, { border_mode: o = "base" } = e, { padding: w = !0 } = e, { type: x = "normal" } = e, { test_id: C = void 0 } = e, { explicit_call: S = !1 } = e, { container: T = !0 } = e, { visible: D = !0 } = e, { allow_overflow: F = !0 } = e, { scale: f = null } = e, { min_width: E = 0 } = e, v = x === "fieldset" ? "fieldset" : "div";
  const p = (d) => {
    if (d !== void 0) {
      if (typeof d == "number")
        return d + "px";
      if (typeof d == "string")
        return d;
    }
  };
  return r.$$set = (d) => {
    "height" in d && n(0, a = d.height), "width" in d && n(1, s = d.width), "elem_id" in d && n(2, h = d.elem_id), "elem_classes" in d && n(3, u = d.elem_classes), "variant" in d && n(4, l = d.variant), "border_mode" in d && n(5, o = d.border_mode), "padding" in d && n(6, w = d.padding), "type" in d && n(16, x = d.type), "test_id" in d && n(7, C = d.test_id), "explicit_call" in d && n(8, S = d.explicit_call), "container" in d && n(9, T = d.container), "visible" in d && n(10, D = d.visible), "allow_overflow" in d && n(11, F = d.allow_overflow), "scale" in d && n(12, f = d.scale), "min_width" in d && n(13, E = d.min_width), "$$scope" in d && n(17, i = d.$$scope);
  }, [
    a,
    s,
    h,
    u,
    l,
    o,
    w,
    C,
    S,
    T,
    D,
    F,
    f,
    E,
    v,
    p,
    x,
    i,
    t
  ];
}
class Block extends SvelteComponent$b {
  constructor(e) {
    super(), init$b(this, e, instance$9, create_fragment$b, safe_not_equal$c, {
      height: 0,
      width: 1,
      elem_id: 2,
      elem_classes: 3,
      variant: 4,
      border_mode: 5,
      padding: 6,
      type: 16,
      test_id: 7,
      explicit_call: 8,
      container: 9,
      visible: 10,
      allow_overflow: 11,
      scale: 12,
      min_width: 13
    });
  }
}
const {
  SvelteComponent: SvelteComponent$a,
  append: append$8,
  attr: attr$8,
  create_component: create_component$5,
  destroy_component: destroy_component$5,
  detach: detach$a,
  element: element$7,
  init: init$a,
  insert: insert$a,
  mount_component: mount_component$5,
  safe_not_equal: safe_not_equal$b,
  set_data: set_data$4,
  space: space$5,
  text: text$5,
  toggle_class: toggle_class$5,
  transition_in: transition_in$7,
  transition_out: transition_out$7
} = window.__gradio__svelte__internal;
function create_fragment$a(r) {
  let e, n, t, i, a, s;
  return t = new /*Icon*/
  r[1]({}), {
    c() {
      e = element$7("label"), n = element$7("span"), create_component$5(t.$$.fragment), i = space$5(), a = text$5(
        /*label*/
        r[0]
      ), attr$8(n, "class", "svelte-9gxdi0"), attr$8(e, "for", ""), attr$8(e, "data-testid", "block-label"), attr$8(e, "class", "svelte-9gxdi0"), toggle_class$5(e, "hide", !/*show_label*/
      r[2]), toggle_class$5(e, "sr-only", !/*show_label*/
      r[2]), toggle_class$5(
        e,
        "float",
        /*float*/
        r[4]
      ), toggle_class$5(
        e,
        "hide-label",
        /*disable*/
        r[3]
      );
    },
    m(h, u) {
      insert$a(h, e, u), append$8(e, n), mount_component$5(t, n, null), append$8(e, i), append$8(e, a), s = !0;
    },
    p(h, [u]) {
      (!s || u & /*label*/
      1) && set_data$4(
        a,
        /*label*/
        h[0]
      ), (!s || u & /*show_label*/
      4) && toggle_class$5(e, "hide", !/*show_label*/
      h[2]), (!s || u & /*show_label*/
      4) && toggle_class$5(e, "sr-only", !/*show_label*/
      h[2]), (!s || u & /*float*/
      16) && toggle_class$5(
        e,
        "float",
        /*float*/
        h[4]
      ), (!s || u & /*disable*/
      8) && toggle_class$5(
        e,
        "hide-label",
        /*disable*/
        h[3]
      );
    },
    i(h) {
      s || (transition_in$7(t.$$.fragment, h), s = !0);
    },
    o(h) {
      transition_out$7(t.$$.fragment, h), s = !1;
    },
    d(h) {
      h && detach$a(e), destroy_component$5(t);
    }
  };
}
function instance$8(r, e, n) {
  let { label: t = null } = e, { Icon: i } = e, { show_label: a = !0 } = e, { disable: s = !1 } = e, { float: h = !0 } = e;
  return r.$$set = (u) => {
    "label" in u && n(0, t = u.label), "Icon" in u && n(1, i = u.Icon), "show_label" in u && n(2, a = u.show_label), "disable" in u && n(3, s = u.disable), "float" in u && n(4, h = u.float);
  }, [t, i, a, s, h];
}
class BlockLabel extends SvelteComponent$a {
  constructor(e) {
    super(), init$a(this, e, instance$8, create_fragment$a, safe_not_equal$b, {
      label: 0,
      Icon: 1,
      show_label: 2,
      disable: 3,
      float: 4
    });
  }
}
const {
  SvelteComponent: SvelteComponent$9,
  append: append$7,
  attr: attr$7,
  bubble: bubble$1,
  create_component: create_component$4,
  destroy_component: destroy_component$4,
  detach: detach$9,
  element: element$6,
  init: init$9,
  insert: insert$9,
  listen: listen$3,
  mount_component: mount_component$4,
  safe_not_equal: safe_not_equal$a,
  set_data: set_data$3,
  set_style: set_style$5,
  space: space$4,
  text: text$4,
  toggle_class: toggle_class$4,
  transition_in: transition_in$6,
  transition_out: transition_out$6
} = window.__gradio__svelte__internal;
function create_if_block$5(r) {
  let e, n;
  return {
    c() {
      e = element$6("span"), n = text$4(
        /*label*/
        r[1]
      ), attr$7(e, "class", "svelte-1lrphxw");
    },
    m(t, i) {
      insert$9(t, e, i), append$7(e, n);
    },
    p(t, i) {
      i & /*label*/
      2 && set_data$3(
        n,
        /*label*/
        t[1]
      );
    },
    d(t) {
      t && detach$9(e);
    }
  };
}
function create_fragment$9(r) {
  let e, n, t, i, a, s, h, u = (
    /*show_label*/
    r[2] && create_if_block$5(r)
  );
  return i = new /*Icon*/
  r[0]({}), {
    c() {
      e = element$6("button"), u && u.c(), n = space$4(), t = element$6("div"), create_component$4(i.$$.fragment), attr$7(t, "class", "svelte-1lrphxw"), toggle_class$4(
        t,
        "small",
        /*size*/
        r[4] === "small"
      ), toggle_class$4(
        t,
        "large",
        /*size*/
        r[4] === "large"
      ), toggle_class$4(
        t,
        "medium",
        /*size*/
        r[4] === "medium"
      ), e.disabled = /*disabled*/
      r[7], attr$7(
        e,
        "aria-label",
        /*label*/
        r[1]
      ), attr$7(
        e,
        "aria-haspopup",
        /*hasPopup*/
        r[8]
      ), attr$7(
        e,
        "title",
        /*label*/
        r[1]
      ), attr$7(e, "class", "svelte-1lrphxw"), toggle_class$4(
        e,
        "pending",
        /*pending*/
        r[3]
      ), toggle_class$4(
        e,
        "padded",
        /*padded*/
        r[5]
      ), toggle_class$4(
        e,
        "highlight",
        /*highlight*/
        r[6]
      ), toggle_class$4(
        e,
        "transparent",
        /*transparent*/
        r[9]
      ), set_style$5(e, "color", !/*disabled*/
      r[7] && /*_color*/
      r[12] ? (
        /*_color*/
        r[12]
      ) : "var(--block-label-text-color)"), set_style$5(e, "--bg-color", /*disabled*/
      r[7] ? "auto" : (
        /*background*/
        r[10]
      )), set_style$5(
        e,
        "margin-left",
        /*offset*/
        r[11] + "px"
      );
    },
    m(l, o) {
      insert$9(l, e, o), u && u.m(e, null), append$7(e, n), append$7(e, t), mount_component$4(i, t, null), a = !0, s || (h = listen$3(
        e,
        "click",
        /*click_handler*/
        r[14]
      ), s = !0);
    },
    p(l, [o]) {
      /*show_label*/
      l[2] ? u ? u.p(l, o) : (u = create_if_block$5(l), u.c(), u.m(e, n)) : u && (u.d(1), u = null), (!a || o & /*size*/
      16) && toggle_class$4(
        t,
        "small",
        /*size*/
        l[4] === "small"
      ), (!a || o & /*size*/
      16) && toggle_class$4(
        t,
        "large",
        /*size*/
        l[4] === "large"
      ), (!a || o & /*size*/
      16) && toggle_class$4(
        t,
        "medium",
        /*size*/
        l[4] === "medium"
      ), (!a || o & /*disabled*/
      128) && (e.disabled = /*disabled*/
      l[7]), (!a || o & /*label*/
      2) && attr$7(
        e,
        "aria-label",
        /*label*/
        l[1]
      ), (!a || o & /*hasPopup*/
      256) && attr$7(
        e,
        "aria-haspopup",
        /*hasPopup*/
        l[8]
      ), (!a || o & /*label*/
      2) && attr$7(
        e,
        "title",
        /*label*/
        l[1]
      ), (!a || o & /*pending*/
      8) && toggle_class$4(
        e,
        "pending",
        /*pending*/
        l[3]
      ), (!a || o & /*padded*/
      32) && toggle_class$4(
        e,
        "padded",
        /*padded*/
        l[5]
      ), (!a || o & /*highlight*/
      64) && toggle_class$4(
        e,
        "highlight",
        /*highlight*/
        l[6]
      ), (!a || o & /*transparent*/
      512) && toggle_class$4(
        e,
        "transparent",
        /*transparent*/
        l[9]
      ), o & /*disabled, _color*/
      4224 && set_style$5(e, "color", !/*disabled*/
      l[7] && /*_color*/
      l[12] ? (
        /*_color*/
        l[12]
      ) : "var(--block-label-text-color)"), o & /*disabled, background*/
      1152 && set_style$5(e, "--bg-color", /*disabled*/
      l[7] ? "auto" : (
        /*background*/
        l[10]
      )), o & /*offset*/
      2048 && set_style$5(
        e,
        "margin-left",
        /*offset*/
        l[11] + "px"
      );
    },
    i(l) {
      a || (transition_in$6(i.$$.fragment, l), a = !0);
    },
    o(l) {
      transition_out$6(i.$$.fragment, l), a = !1;
    },
    d(l) {
      l && detach$9(e), u && u.d(), destroy_component$4(i), s = !1, h();
    }
  };
}
function instance$7(r, e, n) {
  let t, { Icon: i } = e, { label: a = "" } = e, { show_label: s = !1 } = e, { pending: h = !1 } = e, { size: u = "small" } = e, { padded: l = !0 } = e, { highlight: o = !1 } = e, { disabled: w = !1 } = e, { hasPopup: x = !1 } = e, { color: C = "var(--block-label-text-color)" } = e, { transparent: S = !1 } = e, { background: T = "var(--background-fill-primary)" } = e, { offset: D = 0 } = e;
  function F(f) {
    bubble$1.call(this, r, f);
  }
  return r.$$set = (f) => {
    "Icon" in f && n(0, i = f.Icon), "label" in f && n(1, a = f.label), "show_label" in f && n(2, s = f.show_label), "pending" in f && n(3, h = f.pending), "size" in f && n(4, u = f.size), "padded" in f && n(5, l = f.padded), "highlight" in f && n(6, o = f.highlight), "disabled" in f && n(7, w = f.disabled), "hasPopup" in f && n(8, x = f.hasPopup), "color" in f && n(13, C = f.color), "transparent" in f && n(9, S = f.transparent), "background" in f && n(10, T = f.background), "offset" in f && n(11, D = f.offset);
  }, r.$$.update = () => {
    r.$$.dirty & /*highlight, color*/
    8256 && n(12, t = o ? "var(--color-accent)" : C);
  }, [
    i,
    a,
    s,
    h,
    u,
    l,
    o,
    w,
    x,
    S,
    T,
    D,
    t,
    C,
    F
  ];
}
class IconButton extends SvelteComponent$9 {
  constructor(e) {
    super(), init$9(this, e, instance$7, create_fragment$9, safe_not_equal$a, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5,
      highlight: 6,
      disabled: 7,
      hasPopup: 8,
      color: 13,
      transparent: 9,
      background: 10,
      offset: 11
    });
  }
}
const {
  SvelteComponent: SvelteComponent$8,
  append: append$6,
  attr: attr$6,
  binding_callbacks: binding_callbacks$2,
  create_slot: create_slot$2,
  detach: detach$8,
  element: element$5,
  get_all_dirty_from_scope: get_all_dirty_from_scope$2,
  get_slot_changes: get_slot_changes$2,
  init: init$8,
  insert: insert$8,
  safe_not_equal: safe_not_equal$9,
  toggle_class: toggle_class$3,
  transition_in: transition_in$5,
  transition_out: transition_out$5,
  update_slot_base: update_slot_base$2
} = window.__gradio__svelte__internal;
function create_fragment$8(r) {
  let e, n, t;
  const i = (
    /*#slots*/
    r[5].default
  ), a = create_slot$2(
    i,
    r,
    /*$$scope*/
    r[4],
    null
  );
  return {
    c() {
      e = element$5("div"), n = element$5("div"), a && a.c(), attr$6(n, "class", "icon svelte-3w3rth"), attr$6(e, "class", "empty svelte-3w3rth"), attr$6(e, "aria-label", "Empty value"), toggle_class$3(
        e,
        "small",
        /*size*/
        r[0] === "small"
      ), toggle_class$3(
        e,
        "large",
        /*size*/
        r[0] === "large"
      ), toggle_class$3(
        e,
        "unpadded_box",
        /*unpadded_box*/
        r[1]
      ), toggle_class$3(
        e,
        "small_parent",
        /*parent_height*/
        r[3]
      );
    },
    m(s, h) {
      insert$8(s, e, h), append$6(e, n), a && a.m(n, null), r[6](e), t = !0;
    },
    p(s, [h]) {
      a && a.p && (!t || h & /*$$scope*/
      16) && update_slot_base$2(
        a,
        i,
        s,
        /*$$scope*/
        s[4],
        t ? get_slot_changes$2(
          i,
          /*$$scope*/
          s[4],
          h,
          null
        ) : get_all_dirty_from_scope$2(
          /*$$scope*/
          s[4]
        ),
        null
      ), (!t || h & /*size*/
      1) && toggle_class$3(
        e,
        "small",
        /*size*/
        s[0] === "small"
      ), (!t || h & /*size*/
      1) && toggle_class$3(
        e,
        "large",
        /*size*/
        s[0] === "large"
      ), (!t || h & /*unpadded_box*/
      2) && toggle_class$3(
        e,
        "unpadded_box",
        /*unpadded_box*/
        s[1]
      ), (!t || h & /*parent_height*/
      8) && toggle_class$3(
        e,
        "small_parent",
        /*parent_height*/
        s[3]
      );
    },
    i(s) {
      t || (transition_in$5(a, s), t = !0);
    },
    o(s) {
      transition_out$5(a, s), t = !1;
    },
    d(s) {
      s && detach$8(e), a && a.d(s), r[6](null);
    }
  };
}
function instance$6(r, e, n) {
  let t, { $$slots: i = {}, $$scope: a } = e, { size: s = "small" } = e, { unpadded_box: h = !1 } = e, u;
  function l(w) {
    var x;
    if (!w) return !1;
    const { height: C } = w.getBoundingClientRect(), { height: S } = ((x = w.parentElement) === null || x === void 0 ? void 0 : x.getBoundingClientRect()) || { height: C };
    return C > S + 2;
  }
  function o(w) {
    binding_callbacks$2[w ? "unshift" : "push"](() => {
      u = w, n(2, u);
    });
  }
  return r.$$set = (w) => {
    "size" in w && n(0, s = w.size), "unpadded_box" in w && n(1, h = w.unpadded_box), "$$scope" in w && n(4, a = w.$$scope);
  }, r.$$.update = () => {
    r.$$.dirty & /*el*/
    4 && n(3, t = l(u));
  }, [s, h, u, t, a, i, o];
}
class Empty extends SvelteComponent$8 {
  constructor(e) {
    super(), init$8(this, e, instance$6, create_fragment$8, safe_not_equal$9, { size: 0, unpadded_box: 1 });
  }
}
const {
  SvelteComponent: SvelteComponent$7,
  append: append$5,
  attr: attr$5,
  detach: detach$7,
  init: init$7,
  insert: insert$7,
  noop: noop$6,
  safe_not_equal: safe_not_equal$8,
  set_style: set_style$4,
  svg_element: svg_element$2
} = window.__gradio__svelte__internal;
function create_fragment$7(r) {
  let e, n, t, i;
  return {
    c() {
      e = svg_element$2("svg"), n = svg_element$2("g"), t = svg_element$2("path"), i = svg_element$2("path"), attr$5(t, "d", "M18,6L6.087,17.913"), set_style$4(t, "fill", "none"), set_style$4(t, "fill-rule", "nonzero"), set_style$4(t, "stroke-width", "2px"), attr$5(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$5(i, "d", "M4.364,4.364L19.636,19.636"), set_style$4(i, "fill", "none"), set_style$4(i, "fill-rule", "nonzero"), set_style$4(i, "stroke-width", "2px"), attr$5(e, "width", "100%"), attr$5(e, "height", "100%"), attr$5(e, "viewBox", "0 0 24 24"), attr$5(e, "version", "1.1"), attr$5(e, "xmlns", "http://www.w3.org/2000/svg"), attr$5(e, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$5(e, "xml:space", "preserve"), attr$5(e, "stroke", "currentColor"), set_style$4(e, "fill-rule", "evenodd"), set_style$4(e, "clip-rule", "evenodd"), set_style$4(e, "stroke-linecap", "round"), set_style$4(e, "stroke-linejoin", "round");
    },
    m(a, s) {
      insert$7(a, e, s), append$5(e, n), append$5(n, t), append$5(e, i);
    },
    p: noop$6,
    i: noop$6,
    o: noop$6,
    d(a) {
      a && detach$7(e);
    }
  };
}
class Clear extends SvelteComponent$7 {
  constructor(e) {
    super(), init$7(this, e, null, create_fragment$7, safe_not_equal$8, {});
  }
}
const {
  SvelteComponent: SvelteComponent$6,
  append: append$4,
  attr: attr$4,
  detach: detach$6,
  init: init$6,
  insert: insert$6,
  noop: noop$5,
  safe_not_equal: safe_not_equal$7,
  svg_element: svg_element$1
} = window.__gradio__svelte__internal;
function create_fragment$6(r) {
  let e, n, t;
  return {
    c() {
      e = svg_element$1("svg"), n = svg_element$1("path"), t = svg_element$1("polyline"), attr$4(n, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$4(t, "points", "13 2 13 9 20 9"), attr$4(e, "xmlns", "http://www.w3.org/2000/svg"), attr$4(e, "width", "100%"), attr$4(e, "height", "100%"), attr$4(e, "viewBox", "0 0 24 24"), attr$4(e, "fill", "none"), attr$4(e, "stroke", "currentColor"), attr$4(e, "stroke-width", "1.5"), attr$4(e, "stroke-linecap", "round"), attr$4(e, "stroke-linejoin", "round"), attr$4(e, "class", "feather feather-file");
    },
    m(i, a) {
      insert$6(i, e, a), append$4(e, n), append$4(e, t);
    },
    p: noop$5,
    i: noop$5,
    o: noop$5,
    d(i) {
      i && detach$6(e);
    }
  };
}
class File extends SvelteComponent$6 {
  constructor(e) {
    super(), init$6(this, e, null, create_fragment$6, safe_not_equal$7, {});
  }
}
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((r, { color: e, primary: n, secondary: t }) => ({
  ...r,
  [e]: {
    primary: tw_colors[e][n],
    secondary: tw_colors[e][t]
  }
}), {});
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(r) {
  _defaults = r;
}
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 = (r) => escapeReplacements[r];
function escape$1(r, e) {
  if (e) {
    if (escapeTest.test(r))
      return r.replace(escapeReplace, getEscapeReplacement);
  } else if (escapeTestNoEncode.test(r))
    return r.replace(escapeReplaceNoEncode, getEscapeReplacement);
  return r;
}
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function unescape$1(r) {
  return r.replace(unescapeTest, (e, n) => (n = n.toLowerCase(), n === "colon" ? ":" : n.charAt(0) === "#" ? n.charAt(1) === "x" ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)) : ""));
}
const caret = /(^|[^\[])\^/g;
function edit(r, e) {
  let n = typeof r == "string" ? r : r.source;
  e = e || "";
  const t = {
    replace: (i, a) => {
      let s = typeof a == "string" ? a : a.source;
      return s = s.replace(caret, "$1"), n = n.replace(i, s), t;
    },
    getRegex: () => new RegExp(n, e)
  };
  return t;
}
function cleanUrl(r) {
  try {
    r = encodeURI(r).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return r;
}
const noopTest = { exec: () => null };
function splitCells(r, e) {
  const n = r.replace(/\|/g, (a, s, h) => {
    let u = !1, l = s;
    for (; --l >= 0 && h[l] === "\\"; )
      u = !u;
    return u ? "|" : " |";
  }), t = n.split(/ \|/);
  let i = 0;
  if (t[0].trim() || t.shift(), t.length > 0 && !t[t.length - 1].trim() && t.pop(), e)
    if (t.length > e)
      t.splice(e);
    else
      for (; t.length < e; )
        t.push("");
  for (; i < t.length; i++)
    t[i] = t[i].trim().replace(/\\\|/g, "|");
  return t;
}
function rtrim(r, e, n) {
  const t = r.length;
  if (t === 0)
    return "";
  let i = 0;
  for (; i < t; ) {
    const a = r.charAt(t - i - 1);
    if (a === e && !n)
      i++;
    else if (a !== e && n)
      i++;
    else
      break;
  }
  return r.slice(0, t - i);
}
function findClosingBracket(r, e) {
  if (r.indexOf(e[1]) === -1)
    return -1;
  let n = 0;
  for (let t = 0; t < r.length; t++)
    if (r[t] === "\\")
      t++;
    else if (r[t] === e[0])
      n++;
    else if (r[t] === e[1] && (n--, n < 0))
      return t;
  return -1;
}
function outputLink(r, e, n, t) {
  const i = e.href, a = e.title ? escape$1(e.title) : null, s = r[1].replace(/\\([\[\]])/g, "$1");
  if (r[0].charAt(0) !== "!") {
    t.state.inLink = !0;
    const h = {
      type: "link",
      raw: n,
      href: i,
      title: a,
      text: s,
      tokens: t.inlineTokens(s)
    };
    return t.state.inLink = !1, h;
  }
  return {
    type: "image",
    raw: n,
    href: i,
    title: a,
    text: escape$1(s)
  };
}
function indentCodeCompensation(r, e) {
  const n = r.match(/^(\s+)(?:```)/);
  if (n === null)
    return e;
  const t = n[1];
  return e.split(`
`).map((i) => {
    const a = i.match(/^\s+/);
    if (a === null)
      return i;
    const [s] = a;
    return s.length >= t.length ? i.slice(t.length) : i;
  }).join(`
`);
}
class _Tokenizer {
  // set by the lexer
  constructor(e) {
    qe(this, "options");
    qe(this, "rules");
    // set by the lexer
    qe(this, "lexer");
    this.options = e || _defaults;
  }
  space(e) {
    const n = this.rules.block.newline.exec(e);
    if (n && n[0].length > 0)
      return {
        type: "space",
        raw: n[0]
      };
  }
  code(e) {
    const n = this.rules.block.code.exec(e);
    if (n) {
      const t = n[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: n[0],
        codeBlockStyle: "indented",
        text: this.options.pedantic ? t : rtrim(t, `
`)
      };
    }
  }
  fences(e) {
    const n = this.rules.block.fences.exec(e);
    if (n) {
      const t = n[0], i = indentCodeCompensation(t, n[3] || "");
      return {
        type: "code",
        raw: t,
        lang: n[2] ? n[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : n[2],
        text: i
      };
    }
  }
  heading(e) {
    const n = this.rules.block.heading.exec(e);
    if (n) {
      let t = n[2].trim();
      if (/#$/.test(t)) {
        const i = rtrim(t, "#");
        (this.options.pedantic || !i || / $/.test(i)) && (t = i.trim());
      }
      return {
        type: "heading",
        raw: n[0],
        depth: n[1].length,
        text: t,
        tokens: this.lexer.inline(t)
      };
    }
  }
  hr(e) {
    const n = this.rules.block.hr.exec(e);
    if (n)
      return {
        type: "hr",
        raw: n[0]
      };
  }
  blockquote(e) {
    const n = this.rules.block.blockquote.exec(e);
    if (n) {
      let t = n[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
    $1`);
      t = rtrim(t.replace(/^ *>[ \t]?/gm, ""), `
`);
      const i = this.lexer.state.top;
      this.lexer.state.top = !0;
      const a = this.lexer.blockTokens(t);
      return this.lexer.state.top = i, {
        type: "blockquote",
        raw: n[0],
        tokens: a,
        text: t
      };
    }
  }
  list(e) {
    let n = this.rules.block.list.exec(e);
    if (n) {
      let t = n[1].trim();
      const i = t.length > 1, a = {
        type: "list",
        raw: "",
        ordered: i,
        start: i ? +t.slice(0, -1) : "",
        loose: !1,
        items: []
      };
      t = i ? `\\d{1,9}\\${t.slice(-1)}` : `\\${t}`, this.options.pedantic && (t = i ? t : "[*+-]");
      const s = new RegExp(`^( {0,3}${t})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let h = "", u = "", l = !1;
      for (; e; ) {
        let o = !1;
        if (!(n = s.exec(e)) || this.rules.block.hr.test(e))
          break;
        h = n[0], e = e.substring(h.length);
        let w = n[2].split(`
`, 1)[0].replace(/^\t+/, (F) => " ".repeat(3 * F.length)), x = e.split(`
`, 1)[0], C = 0;
        this.options.pedantic ? (C = 2, u = w.trimStart()) : (C = n[2].search(/[^ ]/), C = C > 4 ? 1 : C, u = w.slice(C), C += n[1].length);
        let S = !1;
        if (!w && /^ *$/.test(x) && (h += x + `
`, e = e.substring(x.length + 1), o = !0), !o) {
          const F = new RegExp(`^ {0,${Math.min(3, C - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), f = new RegExp(`^ {0,${Math.min(3, C - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), E = new RegExp(`^ {0,${Math.min(3, C - 1)}}(?:\`\`\`|~~~)`), v = new RegExp(`^ {0,${Math.min(3, C - 1)}}#`);
          for (; e; ) {
            const p = e.split(`
`, 1)[0];
            if (x = p, this.options.pedantic && (x = x.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), E.test(x) || v.test(x) || F.test(x) || f.test(e))
              break;
            if (x.search(/[^ ]/) >= C || !x.trim())
              u += `
` + x.slice(C);
            else {
              if (S || w.search(/[^ ]/) >= 4 || E.test(w) || v.test(w) || f.test(w))
                break;
              u += `
` + x;
            }
            !S && !x.trim() && (S = !0), h += p + `
`, e = e.substring(p.length + 1), w = x.slice(C);
          }
        }
        a.loose || (l ? a.loose = !0 : /\n *\n *$/.test(h) && (l = !0));
        let T = null, D;
        this.options.gfm && (T = /^\[[ xX]\] /.exec(u), T && (D = T[0] !== "[ ] ", u = u.replace(/^\[[ xX]\] +/, ""))), a.items.push({
          type: "list_item",
          raw: h,
          task: !!T,
          checked: D,
          loose: !1,
          text: u,
          tokens: []
        }), a.raw += h;
      }
      a.items[a.items.length - 1].raw = h.trimEnd(), a.items[a.items.length - 1].text = u.trimEnd(), a.raw = a.raw.trimEnd();
      for (let o = 0; o < a.items.length; o++)
        if (this.lexer.state.top = !1, a.items[o].tokens = this.lexer.blockTokens(a.items[o].text, []), !a.loose) {
          const w = a.items[o].tokens.filter((C) => C.type === "space"), x = w.length > 0 && w.some((C) => /\n.*\n/.test(C.raw));
          a.loose = x;
        }
      if (a.loose)
        for (let o = 0; o < a.items.length; o++)
          a.items[o].loose = !0;
      return a;
    }
  }
  html(e) {
    const n = this.rules.block.html.exec(e);
    if (n)
      return {
        type: "html",
        block: !0,
        raw: n[0],
        pre: n[1] === "pre" || n[1] === "script" || n[1] === "style",
        text: n[0]
      };
  }
  def(e) {
    const n = this.rules.block.def.exec(e);
    if (n) {
      const t = n[1].toLowerCase().replace(/\s+/g, " "), i = n[2] ? n[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", a = n[3] ? n[3].substring(1, n[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : n[3];
      return {
        type: "def",
        tag: t,
        raw: n[0],
        href: i,
        title: a
      };
    }
  }
  table(e) {
    const n = this.rules.block.table.exec(e);
    if (!n || !/[:|]/.test(n[2]))
      return;
    const t = splitCells(n[1]), i = n[2].replace(/^\||\| *$/g, "").split("|"), a = n[3] && n[3].trim() ? n[3].replace(/\n[ \t]*$/, "").split(`
`) : [], s = {
      type: "table",
      raw: n[0],
      header: [],
      align: [],
      rows: []
    };
    if (t.length === i.length) {
      for (const h of i)
        /^ *-+: *$/.test(h) ? s.align.push("right") : /^ *:-+: *$/.test(h) ? s.align.push("center") : /^ *:-+ *$/.test(h) ? s.align.push("left") : s.align.push(null);
      for (const h of t)
        s.header.push({
          text: h,
          tokens: this.lexer.inline(h)
        });
      for (const h of a)
        s.rows.push(splitCells(h, s.header.length).map((u) => ({
          text: u,
          tokens: this.lexer.inline(u)
        })));
      return s;
    }
  }
  lheading(e) {
    const n = this.rules.block.lheading.exec(e);
    if (n)
      return {
        type: "heading",
        raw: n[0],
        depth: n[2].charAt(0) === "=" ? 1 : 2,
        text: n[1],
        tokens: this.lexer.inline(n[1])
      };
  }
  paragraph(e) {
    const n = this.rules.block.paragraph.exec(e);
    if (n) {
      const t = n[1].charAt(n[1].length - 1) === `
` ? n[1].slice(0, -1) : n[1];
      return {
        type: "paragraph",
        raw: n[0],
        text: t,
        tokens: this.lexer.inline(t)
      };
    }
  }
  text(e) {
    const n = this.rules.block.text.exec(e);
    if (n)
      return {
        type: "text",
        raw: n[0],
        text: n[0],
        tokens: this.lexer.inline(n[0])
      };
  }
  escape(e) {
    const n = this.rules.inline.escape.exec(e);
    if (n)
      return {
        type: "escape",
        raw: n[0],
        text: escape$1(n[1])
      };
  }
  tag(e) {
    const n = this.rules.inline.tag.exec(e);
    if (n)
      return !this.lexer.state.inLink && /^<a /i.test(n[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(n[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(n[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0]) && (this.lexer.state.inRawBlock = !1), {
        type: "html",
        raw: n[0],
        inLink: this.lexer.state.inLink,
        inRawBlock: this.lexer.state.inRawBlock,
        block: !1,
        text: n[0]
      };
  }
  link(e) {
    const n = this.rules.inline.link.exec(e);
    if (n) {
      const t = n[2].trim();
      if (!this.options.pedantic && /^</.test(t)) {
        if (!/>$/.test(t))
          return;
        const s = rtrim(t.slice(0, -1), "\\");
        if ((t.length - s.length) % 2 === 0)
          return;
      } else {
        const s = findClosingBracket(n[2], "()");
        if (s > -1) {
          const u = (n[0].indexOf("!") === 0 ? 5 : 4) + n[1].length + s;
          n[2] = n[2].substring(0, s), n[0] = n[0].substring(0, u).trim(), n[3] = "";
        }
      }
      let i = n[2], a = "";
      if (this.options.pedantic) {
        const s = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);
        s && (i = s[1], a = s[3]);
      } else
        a = n[3] ? n[3].slice(1, -1) : "";
      return i = i.trim(), /^</.test(i) && (this.options.pedantic && !/>$/.test(t) ? i = i.slice(1) : i = i.slice(1, -1)), outputLink(n, {
        href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
        title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
      }, n[0], this.lexer);
    }
  }
  reflink(e, n) {
    let t;
    if ((t = this.rules.inline.reflink.exec(e)) || (t = this.rules.inline.nolink.exec(e))) {
      const i = (t[2] || t[1]).replace(/\s+/g, " "), a = n[i.toLowerCase()];
      if (!a) {
        const s = t[0].charAt(0);
        return {
          type: "text",
          raw: s,
          text: s
        };
      }
      return outputLink(t, a, t[0], this.lexer);
    }
  }
  emStrong(e, n, t = "") {
    let i = this.rules.inline.emStrongLDelim.exec(e);
    if (!i || i[3] && t.match(/[\p{L}\p{N}]/u))
      return;
    if (!(i[1] || i[2] || "") || !t || this.rules.inline.punctuation.exec(t)) {
      const s = [...i[0]].length - 1;
      let h, u, l = s, o = 0;
      const w = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (w.lastIndex = 0, n = n.slice(-1 * e.length + s); (i = w.exec(n)) != null; ) {
        if (h = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !h)
          continue;
        if (u = [...h].length, i[3] || i[4]) {
          l += u;
          continue;
        } else if ((i[5] || i[6]) && s % 3 && !((s + u) % 3)) {
          o += u;
          continue;
        }
        if (l -= u, l > 0)
          continue;
        u = Math.min(u, u + l + o);
        const x = [...i[0]][0].length, C = e.slice(0, s + i.index + x + u);
        if (Math.min(s, u) % 2) {
          const T = C.slice(1, -1);
          return {
            type: "em",
            raw: C,
            text: T,
            tokens: this.lexer.inlineTokens(T)
          };
        }
        const S = C.slice(2, -2);
        return {
          type: "strong",
          raw: C,
          text: S,
          tokens: this.lexer.inlineTokens(S)
        };
      }
    }
  }
  codespan(e) {
    const n = this.rules.inline.code.exec(e);
    if (n) {
      let t = n[2].replace(/\n/g, " ");
      const i = /[^ ]/.test(t), a = /^ /.test(t) && / $/.test(t);
      return i && a && (t = t.substring(1, t.length - 1)), t = escape$1(t, !0), {
        type: "codespan",
        raw: n[0],
        text: t
      };
    }
  }
  br(e) {
    const n = this.rules.inline.br.exec(e);
    if (n)
      return {
        type: "br",
        raw: n[0]
      };
  }
  del(e) {
    const n = this.rules.inline.del.exec(e);
    if (n)
      return {
        type: "del",
        raw: n[0],
        text: n[2],
        tokens: this.lexer.inlineTokens(n[2])
      };
  }
  autolink(e) {
    const n = this.rules.inline.autolink.exec(e);
    if (n) {
      let t, i;
      return n[2] === "@" ? (t = escape$1(n[1]), i = "mailto:" + t) : (t = escape$1(n[1]), i = t), {
        type: "link",
        raw: n[0],
        text: t,
        href: i,
        tokens: [
          {
            type: "text",
            raw: t,
            text: t
          }
        ]
      };
    }
  }
  url(e) {
    var t;
    let n;
    if (n = this.rules.inline.url.exec(e)) {
      let i, a;
      if (n[2] === "@")
        i = escape$1(n[0]), a = "mailto:" + i;
      else {
        let s;
        do
          s = n[0], n[0] = ((t = this.rules.inline._backpedal.exec(n[0])) == null ? void 0 : t[0]) ?? "";
        while (s !== n[0]);
        i = escape$1(n[0]), n[1] === "www." ? a = "http://" + n[0] : a = n[0];
      }
      return {
        type: "link",
        raw: n[0],
        text: i,
        href: a,
        tokens: [
          {
            type: "text",
            raw: i,
            text: i
          }
        ]
      };
    }
  }
  inlineText(e) {
    const n = this.rules.inline.text.exec(e);
    if (n) {
      let t;
      return this.lexer.state.inRawBlock ? t = n[0] : t = escape$1(n[0]), {
        type: "text",
        raw: n[0],
        text: t
      };
    }
  }
}
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$2 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, 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: escape$2,
  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$2).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) {
    qe(this, "tokens");
    qe(this, "options");
    qe(this, "state");
    qe(this, "tokenizer");
    qe(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 n = {
      block: block.normal,
      inline: inline.normal
    };
    this.options.pedantic ? (n.block = block.pedantic, n.inline = inline.pedantic) : this.options.gfm && (n.block = block.gfm, this.options.breaks ? n.inline = inline.breaks : n.inline = inline.gfm), this.tokenizer.rules = n;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block,
      inline
    };
  }
  /**
   * Static Lex Method
   */
  static lex(e, n) {
    return new _Lexer(n).lex(e);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(e, n) {
    return new _Lexer(n).inlineTokens(e);
  }
  /**
   * Preprocessing
   */
  lex(e) {
    e = e.replace(/\r\n|\r/g, `
`), this.blockTokens(e, this.tokens);
    for (let n = 0; n < this.inlineQueue.length; n++) {
      const t = this.inlineQueue[n];
      this.inlineTokens(t.src, t.tokens);
    }
    return this.inlineQueue = [], this.tokens;
  }
  blockTokens(e, n = []) {
    this.options.pedantic ? e = e.replace(/\t/g, "    ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (h, u, l) => u + "    ".repeat(l.length));
    let t, i, a, s;
    for (; e; )
      if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((h) => (t = h.call({ lexer: this }, e, n)) ? (e = e.substring(t.raw.length), n.push(t), !0) : !1))) {
        if (t = this.tokenizer.space(e)) {
          e = e.substring(t.raw.length), t.raw.length === 1 && n.length > 0 ? n[n.length - 1].raw += `
` : n.push(t);
          continue;
        }
        if (t = this.tokenizer.code(e)) {
          e = e.substring(t.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
` + t.raw, i.text += `
` + t.text, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(t);
          continue;
        }
        if (t = this.tokenizer.fences(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.heading(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.hr(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.blockquote(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.list(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.html(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.def(e)) {
          e = e.substring(t.raw.length), i = n[n.length - 1], i && (i.type === "paragraph" || i.type === "text") ? (i.raw += `
` + t.raw, i.text += `
` + t.raw, this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : this.tokens.links[t.tag] || (this.tokens.links[t.tag] = {
            href: t.href,
            title: t.title
          });
          continue;
        }
        if (t = this.tokenizer.table(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.lheading(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (a = e, this.options.extensions && this.options.extensions.startBlock) {
          let h = 1 / 0;
          const u = e.slice(1);
          let l;
          this.options.extensions.startBlock.forEach((o) => {
            l = o.call({ lexer: this }, u), typeof l == "number" && l >= 0 && (h = Math.min(h, l));
          }), h < 1 / 0 && h >= 0 && (a = e.substring(0, h + 1));
        }
        if (this.state.top && (t = this.tokenizer.paragraph(a))) {
          i = n[n.length - 1], s && i.type === "paragraph" ? (i.raw += `
` + t.raw, i.text += `
` + t.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(t), s = a.length !== e.length, e = e.substring(t.raw.length);
          continue;
        }
        if (t = this.tokenizer.text(e)) {
          e = e.substring(t.raw.length), i = n[n.length - 1], i && i.type === "text" ? (i.raw += `
` + t.raw, i.text += `
` + t.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = i.text) : n.push(t);
          continue;
        }
        if (e) {
          const h = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(h);
            break;
          } else
            throw new Error(h);
        }
      }
    return this.state.top = !0, n;
  }
  inline(e, n = []) {
    return this.inlineQueue.push({ src: e, tokens: n }), n;
  }
  /**
   * Lexing/Compiling
   */
  inlineTokens(e, n = []) {
    let t, i, a, s = e, h, u, l;
    if (this.tokens.links) {
      const o = Object.keys(this.tokens.links);
      if (o.length > 0)
        for (; (h = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; )
          o.includes(h[0].slice(h[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, h.index) + "[" + "a".repeat(h[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (h = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; )
      s = s.slice(0, h.index) + "[" + "a".repeat(h[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (h = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; )
      s = s.slice(0, h.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; e; )
      if (u || (l = ""), u = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((o) => (t = o.call({ lexer: this }, e, n)) ? (e = e.substring(t.raw.length), n.push(t), !0) : !1))) {
        if (t = this.tokenizer.escape(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.tag(e)) {
          e = e.substring(t.raw.length), i = n[n.length - 1], i && t.type === "text" && i.type === "text" ? (i.raw += t.raw, i.text += t.text) : n.push(t);
          continue;
        }
        if (t = this.tokenizer.link(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.reflink(e, this.tokens.links)) {
          e = e.substring(t.raw.length), i = n[n.length - 1], i && t.type === "text" && i.type === "text" ? (i.raw += t.raw, i.text += t.text) : n.push(t);
          continue;
        }
        if (t = this.tokenizer.emStrong(e, s, l)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.codespan(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.br(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.del(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (t = this.tokenizer.autolink(e)) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (!this.state.inLink && (t = this.tokenizer.url(e))) {
          e = e.substring(t.raw.length), n.push(t);
          continue;
        }
        if (a = e, this.options.extensions && this.options.extensions.startInline) {
          let o = 1 / 0;
          const w = e.slice(1);
          let x;
          this.options.extensions.startInline.forEach((C) => {
            x = C.call({ lexer: this }, w), typeof x == "number" && x >= 0 && (o = Math.min(o, x));
          }), o < 1 / 0 && o >= 0 && (a = e.substring(0, o + 1));
        }
        if (t = this.tokenizer.inlineText(a)) {
          e = e.substring(t.raw.length), t.raw.slice(-1) !== "_" && (l = t.raw.slice(-1)), u = !0, i = n[n.length - 1], i && i.type === "text" ? (i.raw += t.raw, i.text += t.text) : n.push(t);
          continue;
        }
        if (e) {
          const o = "Infinite loop on byte: " + e.charCodeAt(0);
          if (this.options.silent) {
            console.error(o);
            break;
          } else
            throw new Error(o);
        }
      }
    return n;
  }
}
class _Renderer {
  constructor(e) {
    qe(this, "options");
    this.options = e || _defaults;
  }
  code(e, n, t) {
    var a;
    const i = (a = (n || "").match(/^\S*/)) == null ? void 0 : a[0];
    return e = e.replace(/\n$/, "") + `
`, i ? '<pre><code class="language-' + escape$1(i) + '">' + (t ? e : escape$1(e, !0)) + `</code></pre>
` : "<pre><code>" + (t ? e : escape$1(e, !0)) + `</code></pre>
`;
  }
  blockquote(e) {
    return `<blockquote>
${e}</blockquote>
`;
  }
  html(e, n) {
    return e;
  }
  heading(e, n, t) {
    return `<h${n}>${e}</h${n}>
`;
  }
  hr() {
    return `<hr>
`;
  }
  list(e, n, t) {
    const i = n ? "ol" : "ul", a = n && t !== 1 ? ' start="' + t + '"' : "";
    return "<" + i + a + `>
` + e + "</" + i + `>
`;
  }
  listitem(e, n, t) {
    return `<li>${e}</li>
`;
  }
  checkbox(e) {
    return "<input " + (e ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph(e) {
    return `<p>${e}</p>
`;
  }
  table(e, n) {
    return n && (n = `<tbody>${n}</tbody>`), `<table>
<thead>
` + e + `</thead>
` + n + `</table>
`;
  }
  tablerow(e) {
    return `<tr>
${e}</tr>
`;
  }
  tablecell(e, n) {
    const t = n.header ? "th" : "td";
    return (n.align ? `<${t} align="${n.align}">` : `<${t}>`) + e + `</${t}>
`;
  }
  /**
   * 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, n, t) {
    const i = cleanUrl(e);
    if (i === null)
      return t;
    e = i;
    let a = '<a href="' + e + '"';
    return n && (a += ' title="' + n + '"'), a += ">" + t + "</a>", a;
  }
  image(e, n, t) {
    const i = cleanUrl(e);
    if (i === null)
      return t;
    e = i;
    let a = `<img src="${e}" alt="${t}"`;
    return n && (a += ` title="${n}"`), a += ">", a;
  }
  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, n, t) {
    return "" + t;
  }
  image(e, n, t) {
    return "" + t;
  }
  br() {
    return "";
  }
}
class _Parser {
  constructor(e) {
    qe(this, "options");
    qe(this, "renderer");
    qe(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, n) {
    return new _Parser(n).parse(e);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(e, n) {
    return new _Parser(n).parseInline(e);
  }
  /**
   * Parse Loop
   */
  parse(e, n = !0) {
    let t = "";
    for (let i = 0; i < e.length; i++) {
      const a = e[i];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[a.type]) {
        const s = a, h = this.options.extensions.renderers[s.type].call({ parser: this }, s);
        if (h !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(s.type)) {
          t += h || "";
          continue;
        }
      }
      switch (a.type) {
        case "space":
          continue;
        case "hr": {
          t += this.renderer.hr();
          continue;
        }
        case "heading": {
          const s = a;
          t += this.renderer.heading(this.parseInline(s.tokens), s.depth, unescape$1(this.parseInline(s.tokens, this.textRenderer)));
          continue;
        }
        case "code": {
          const s = a;
          t += this.renderer.code(s.text, s.lang, !!s.escaped);
          continue;
        }
        case "table": {
          const s = a;
          let h = "", u = "";
          for (let o = 0; o < s.header.length; o++)
            u += this.renderer.tablecell(this.parseInline(s.header[o].tokens), { header: !0, align: s.align[o] });
          h += this.renderer.tablerow(u);
          let l = "";
          for (let o = 0; o < s.rows.length; o++) {
            const w = s.rows[o];
            u = "";
            for (let x = 0; x < w.length; x++)
              u += this.renderer.tablecell(this.parseInline(w[x].tokens), { header: !1, align: s.align[x] });
            l += this.renderer.tablerow(u);
          }
          t += this.renderer.table(h, l);
          continue;
        }
        case "blockquote": {
          const s = a, h = this.parse(s.tokens);
          t += this.renderer.blockquote(h);
          continue;
        }
        case "list": {
          const s = a, h = s.ordered, u = s.start, l = s.loose;
          let o = "";
          for (let w = 0; w < s.items.length; w++) {
            const x = s.items[w], C = x.checked, S = x.task;
            let T = "";
            if (x.task) {
              const D = this.renderer.checkbox(!!C);
              l ? x.tokens.length > 0 && x.tokens[0].type === "paragraph" ? (x.tokens[0].text = D + " " + 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 = D + " " + x.tokens[0].tokens[0].text)) : x.tokens.unshift({
                type: "text",
                text: D + " "
              }) : T += D + " ";
            }
            T += this.parse(x.tokens, l), o += this.renderer.listitem(T, S, !!C);
          }
          t += this.renderer.list(o, h, u);
          continue;
        }
        case "html": {
          const s = a;
          t += this.renderer.html(s.text, s.block);
          continue;
        }
        case "paragraph": {
          const s = a;
          t += this.renderer.paragraph(this.parseInline(s.tokens));
          continue;
        }
        case "text": {
          let s = a, h = s.tokens ? this.parseInline(s.tokens) : s.text;
          for (; i + 1 < e.length && e[i + 1].type === "text"; )
            s = e[++i], h += `
` + (s.tokens ? this.parseInline(s.tokens) : s.text);
          t += n ? this.renderer.paragraph(h) : h;
          continue;
        }
        default: {
          const s = 'Token with "' + a.type + '" type was not found.';
          if (this.options.silent)
            return console.error(s), "";
          throw new Error(s);
        }
      }
    }
    return t;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(e, n) {
    n = n || this.renderer;
    let t = "";
    for (let i = 0; i < e.length; i++) {
      const a = e[i];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[a.type]) {
        const s = this.options.extensions.renderers[a.type].call({ parser: this }, a);
        if (s !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(a.type)) {
          t += s || "";
          continue;
        }
      }
      switch (a.type) {
        case "escape": {
          const s = a;
          t += n.text(s.text);
          break;
        }
        case "html": {
          const s = a;
          t += n.html(s.text);
          break;
        }
        case "link": {
          const s = a;
          t += n.link(s.href, s.title, this.parseInline(s.tokens, n));
          break;
        }
        case "image": {
          const s = a;
          t += n.image(s.href, s.title, s.text);
          break;
        }
        case "strong": {
          const s = a;
          t += n.strong(this.parseInline(s.tokens, n));
          break;
        }
        case "em": {
          const s = a;
          t += n.em(this.parseInline(s.tokens, n));
          break;
        }
        case "codespan": {
          const s = a;
          t += n.codespan(s.text);
          break;
        }
        case "br": {
          t += n.br();
          break;
        }
        case "del": {
          const s = a;
          t += n.del(this.parseInline(s.tokens, n));
          break;
        }
        case "text": {
          const s = a;
          t += n.text(s.text);
          break;
        }
        default: {
          const s = 'Token with "' + a.type + '" type was not found.';
          if (this.options.silent)
            return console.error(s), "";
          throw new Error(s);
        }
      }
    }
    return t;
  }
}
class _Hooks {
  constructor(e) {
    qe(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;
  }
}
qe(_Hooks, "passThroughHooks", /* @__PURE__ */ new Set([
  "preprocess",
  "postprocess",
  "processAllTokens"
]));
var ht, zt, Dn;
class Marked {
  constructor(...e) {
    le(this, ht);
    qe(this, "defaults", _getDefaults());
    qe(this, "options", this.setOptions);
    qe(this, "parse", Z(this, ht, zt).call(this, _Lexer.lex, _Parser.parse));
    qe(this, "parseInline", Z(this, ht, zt).call(this, _Lexer.lexInline, _Parser.parseInline));
    qe(this, "Parser", _Parser);
    qe(this, "Renderer", _Renderer);
    qe(this, "TextRenderer", _TextRenderer);
    qe(this, "Lexer", _Lexer);
    qe(this, "Tokenizer", _Tokenizer);
    qe(this, "Hooks", _Hooks);
    this.use(...e);
  }
  /**
   * Run callback for every token
   */
  walkTokens(e, n) {
    var i, a;
    let t = [];
    for (const s of e)
      switch (t = t.concat(n.call(this, s)), s.type) {
        case "table": {
          const h = s;
          for (const u of h.header)
            t = t.concat(this.walkTokens(u.tokens, n));
          for (const u of h.rows)
            for (const l of u)
              t = t.concat(this.walkTokens(l.tokens, n));
          break;
        }
        case "list": {
          const h = s;
          t = t.concat(this.walkTokens(h.items, n));
          break;
        }
        default: {
          const h = s;
          (a = (i = this.defaults.extensions) == null ? void 0 : i.childTokens) != null && a[h.type] ? this.defaults.extensions.childTokens[h.type].forEach((u) => {
            const l = h[u].flat(1 / 0);
            t = t.concat(this.walkTokens(l, n));
          }) : h.tokens && (t = t.concat(this.walkTokens(h.tokens, n)));
        }
      }
    return t;
  }
  use(...e) {
    const n = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return e.forEach((t) => {
      const i = { ...t };
      if (i.async = this.defaults.async || i.async || !1, t.extensions && (t.extensions.forEach((a) => {
        if (!a.name)
          throw new Error("extension name required");
        if ("renderer" in a) {
          const s = n.renderers[a.name];
          s ? n.renderers[a.name] = function(...h) {
            let u = a.renderer.apply(this, h);
            return u === !1 && (u = s.apply(this, h)), u;
          } : n.renderers[a.name] = a.renderer;
        }
        if ("tokenizer" in a) {
          if (!a.level || a.level !== "block" && a.level !== "inline")
            throw new Error("extension level must be 'block' or 'inline'");
          const s = n[a.level];
          s ? s.unshift(a.tokenizer) : n[a.level] = [a.tokenizer], a.start && (a.level === "block" ? n.startBlock ? n.startBlock.push(a.start) : n.startBlock = [a.start] : a.level === "inline" && (n.startInline ? n.startInline.push(a.start) : n.startInline = [a.start]));
        }
        "childTokens" in a && a.childTokens && (n.childTokens[a.name] = a.childTokens);
      }), i.extensions = n), t.renderer) {
        const a = this.defaults.renderer || new _Renderer(this.defaults);
        for (const s in t.renderer) {
          if (!(s in a))
            throw new Error(`renderer '${s}' does not exist`);
          if (s === "options")
            continue;
          const h = s, u = t.renderer[h], l = a[h];
          a[h] = (...o) => {
            let w = u.apply(a, o);
            return w === !1 && (w = l.apply(a, o)), w || "";
          };
        }
        i.renderer = a;
      }
      if (t.tokenizer) {
        const a = this.defaults.tokenizer || new _Tokenizer(this.defaults);
        for (const s in t.tokenizer) {
          if (!(s in a))
            throw new Error(`tokenizer '${s}' does not exist`);
          if (["options", "rules", "lexer"].includes(s))
            continue;
          const h = s, u = t.tokenizer[h], l = a[h];
          a[h] = (...o) => {
            let w = u.apply(a, o);
            return w === !1 && (w = l.apply(a, o)), w;
          };
        }
        i.tokenizer = a;
      }
      if (t.hooks) {
        const a = this.defaults.hooks || new _Hooks();
        for (const s in t.hooks) {
          if (!(s in a))
            throw new Error(`hook '${s}' does not exist`);
          if (s === "options")
            continue;
          const h = s, u = t.hooks[h], l = a[h];
          _Hooks.passThroughHooks.has(s) ? a[h] = (o) => {
            if (this.defaults.async)
              return Promise.resolve(u.call(a, o)).then((x) => l.call(a, x));
            const w = u.call(a, o);
            return l.call(a, w);
          } : a[h] = (...o) => {
            let w = u.apply(a, o);
            return w === !1 && (w = l.apply(a, o)), w;
          };
        }
        i.hooks = a;
      }
      if (t.walkTokens) {
        const a = this.defaults.walkTokens, s = t.walkTokens;
        i.walkTokens = function(h) {
          let u = [];
          return u.push(s.call(this, h)), a && (u = u.concat(a.call(this, h))), u;
        };
      }
      this.defaults = { ...this.defaults, ...i };
    }), this;
  }
  setOptions(e) {
    return this.defaults = { ...this.defaults, ...e }, this;
  }
  lexer(e, n) {
    return _Lexer.lex(e, n ?? this.defaults);
  }
  parser(e, n) {
    return _Parser.parse(e, n ?? this.defaults);
  }
}
ht = new WeakSet(), zt = function(e, n) {
  return (t, i) => {
    const a = { ...i }, s = { ...this.defaults, ...a };
    this.defaults.async === !0 && a.async === !1 && (s.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), s.async = !0);
    const h = Z(this, ht, Dn).call(this, !!s.silent, !!s.async);
    if (typeof t > "u" || t === null)
      return h(new Error("marked(): input parameter is undefined or null"));
    if (typeof t != "string")
      return h(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(t) + ", string expected"));
    if (s.hooks && (s.hooks.options = s), s.async)
      return Promise.resolve(s.hooks ? s.hooks.preprocess(t) : t).then((u) => e(u, s)).then((u) => s.hooks ? s.hooks.processAllTokens(u) : u).then((u) => s.walkTokens ? Promise.all(this.walkTokens(u, s.walkTokens)).then(() => u) : u).then((u) => n(u, s)).then((u) => s.hooks ? s.hooks.postprocess(u) : u).catch(h);
    try {
      s.hooks && (t = s.hooks.preprocess(t));
      let u = e(t, s);
      s.hooks && (u = s.hooks.processAllTokens(u)), s.walkTokens && this.walkTokens(u, s.walkTokens);
      let l = n(u, s);
      return s.hooks && (l = s.hooks.postprocess(l)), l;
    } catch (u) {
      return h(u);
    }
  };
}, Dn = function(e, n) {
  return (t) => {
    if (t.message += `
Please report this to https://github.com/markedjs/marked.`, e) {
      const i = "<p>An error occurred:</p><pre>" + escape$1(t.message + "", !0) + "</pre>";
      return n ? Promise.resolve(i) : i;
    }
    if (n)
      return Promise.reject(t);
    throw t;
  };
};
const markedInstance = new Marked();
function marked(r, e) {
  return markedInstance.parse(r, e);
}
marked.options = marked.setOptions = function(r) {
  return markedInstance.setOptions(r), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked;
};
marked.getDefaults = _getDefaults;
marked.defaults = _defaults;
marked.use = function(...r) {
  return markedInstance.use(...r), marked.defaults = markedInstance.defaults, changeDefaults(marked.defaults), marked;
};
marked.walkTokens = function(r, e) {
  return markedInstance.walkTokens(r, 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, n) {
    const t = this;
    let i = slug(e, n === !0);
    const a = i;
    for (; own.call(t.occurrences, i); )
      t.occurrences[a]++, i = a + "-" + t.occurrences[a];
    return t.occurrences[i] = 0, i;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function slug(r, e) {
  return typeof r != "string" ? "" : (e || (r = r.toLowerCase()), r.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 getAugmentedNamespace(r) {
  if (r.__esModule) return r;
  var e = r.default;
  if (typeof e == "function") {
    var n = function t() {
      return this instanceof t ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
    };
    n.prototype = e.prototype;
  } else n = {};
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(r).forEach(function(t) {
    var i = Object.getOwnPropertyDescriptor(r, t);
    Object.defineProperty(n, t, i.get ? i : {
      enumerable: !0,
      get: function() {
        return r[t];
      }
    });
  }), n;
}
var prism = { exports: {} };
(function(r) {
  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 n = function(t) {
    var i = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, a = 0, s = {}, h = {
      /**
       * 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: t.Prism && t.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: t.Prism && t.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 f(E) {
          return E instanceof u ? new u(E.type, f(E.content), E.alias) : Array.isArray(E) ? E.map(f) : E.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(f) {
          return Object.prototype.toString.call(f).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(f) {
          return f.__id || Object.defineProperty(f, "__id", { value: ++a }), f.__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 f(E, v) {
          v = v || {};
          var p, d;
          switch (h.util.type(E)) {
            case "Object":
              if (d = h.util.objId(E), v[d])
                return v[d];
              p = /** @type {Record<string, any>} */
              {}, v[d] = p;
              for (var g in E)
                E.hasOwnProperty(g) && (p[g] = f(E[g], v));
              return (
                /** @type {any} */
                p
              );
            case "Array":
              return d = h.util.objId(E), v[d] ? v[d] : (p = [], v[d] = p, /** @type {Array} */
              /** @type {any} */
              E.forEach(function(m, y) {
                p[y] = f(m, v);
              }), /** @type {any} */
              p);
            default:
              return E;
          }
        },
        /**
         * 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(f) {
          for (; f; ) {
            var E = i.exec(f.className);
            if (E)
              return E[1].toLowerCase();
            f = f.parentElement;
          }
          return "none";
        },
        /**
         * Sets the Prism `language-xxxx` class of the given element.
         *
         * @param {Element} element
         * @param {string} language
         * @returns {void}
         */
        setLanguage: function(f, E) {
          f.className = f.className.replace(RegExp(i, "gi"), ""), f.classList.add("language-" + E);
        },
        /**
         * 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 (p) {
            var f = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(p.stack) || [])[1];
            if (f) {
              var E = document.getElementsByTagName("script");
              for (var v in E)
                if (E[v].src == f)
                  return E[v];
            }
            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(f, E, v) {
          for (var p = "no-" + E; f; ) {
            var d = f.classList;
            if (d.contains(E))
              return !0;
            if (d.contains(p))
              return !1;
            f = f.parentElement;
          }
          return !!v;
        }
      },
      /**
       * 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: s,
        plaintext: s,
        text: s,
        txt: s,
        /**
         * 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(f, E) {
          var v = h.util.clone(h.languages[f]);
          for (var p in E)
            v[p] = E[p];
          return v;
        },
        /**
         * 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(f, E, v, p) {
          p = p || /** @type {any} */
          h.languages;
          var d = p[f], g = {};
          for (var m in d)
            if (d.hasOwnProperty(m)) {
              if (m == E)
                for (var y in v)
                  v.hasOwnProperty(y) && (g[y] = v[y]);
              v.hasOwnProperty(m) || (g[m] = d[m]);
            }
          var L = p[f];
          return p[f] = g, h.languages.DFS(h.languages, function(b, P) {
            P === L && b != f && (this[b] = g);
          }), g;
        },
        // Traverse a language definition with Depth First Search
        DFS: function f(E, v, p, d) {
          d = d || {};
          var g = h.util.objId;
          for (var m in E)
            if (E.hasOwnProperty(m)) {
              v.call(E, m, E[m], p || m);
              var y = E[m], L = h.util.type(y);
              L === "Object" && !d[g(y)] ? (d[g(y)] = !0, f(y, v, null, d)) : L === "Array" && !d[g(y)] && (d[g(y)] = !0, f(y, v, m, d));
            }
        }
      },
      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(f, E) {
        h.highlightAllUnder(document, f, E);
      },
      /**
       * 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(f, E, v) {
        var p = {
          callback: v,
          container: f,
          selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
        };
        h.hooks.run("before-highlightall", p), p.elements = Array.prototype.slice.apply(p.container.querySelectorAll(p.selector)), h.hooks.run("before-all-elements-highlight", p);
        for (var d = 0, g; g = p.elements[d++]; )
          h.highlightElement(g, E === !0, p.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(f, E, v) {
        var p = h.util.getLanguage(f), d = h.languages[p];
        h.util.setLanguage(f, p);
        var g = f.parentElement;
        g && g.nodeName.toLowerCase() === "pre" && h.util.setLanguage(g, p);
        var m = f.textContent, y = {
          element: f,
          language: p,
          grammar: d,
          code: m
        };
        function L(P) {
          y.highlightedCode = P, h.hooks.run("before-insert", y), y.element.innerHTML = y.highlightedCode, h.hooks.run("after-highlight", y), h.hooks.run("complete", y), v && v.call(y.element);
        }
        if (h.hooks.run("before-sanity-check", y), g = y.element.parentElement, g && g.nodeName.toLowerCase() === "pre" && !g.hasAttribute("tabindex") && g.setAttribute("tabindex", "0"), !y.code) {
          h.hooks.run("complete", y), v && v.call(y.element);
          return;
        }
        if (h.hooks.run("before-highlight", y), !y.grammar) {
          L(h.util.encode(y.code));
          return;
        }
        if (E && t.Worker) {
          var b = new Worker(h.filename);
          b.onmessage = function(P) {
            L(P.data);
          }, b.postMessage(JSON.stringify({
            language: y.language,
            code: y.code,
            immediateClose: !0
          }));
        } else
          L(h.highlight(y.code, y.grammar, y.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(f, E, v) {
        var p = {
          code: f,
          grammar: E,
          language: v
        };
        if (h.hooks.run("before-tokenize", p), !p.grammar)
          throw new Error('The language "' + p.language + '" has no grammar.');
        return p.tokens = h.tokenize(p.code, p.grammar), h.hooks.run("after-tokenize", p), u.stringify(h.util.encode(p.tokens), p.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(f, E) {
        var v = E.rest;
        if (v) {
          for (var p in v)
            E[p] = v[p];
          delete E.rest;
        }
        var d = new w();
        return x(d, d.head, f), o(f, d, E, d.head, 0), S(d);
      },
      /**
       * @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(f, E) {
          var v = h.hooks.all;
          v[f] = v[f] || [], v[f].push(E);
        },
        /**
         * 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(f, E) {
          var v = h.hooks.all[f];
          if (!(!v || !v.length))
            for (var p = 0, d; d = v[p++]; )
              d(E);
        }
      },
      Token: u
    };
    t.Prism = h;
    function u(f, E, v, p) {
      this.type = f, this.content = E, this.alias = v, this.length = (p || "").length | 0;
    }
    u.stringify = function f(E, v) {
      if (typeof E == "string")
        return E;
      if (Array.isArray(E)) {
        var p = "";
        return E.forEach(function(L) {
          p += f(L, v);
        }), p;
      }
      var d = {
        type: E.type,
        content: f(E.content, v),
        tag: "span",
        classes: ["token", E.type],
        attributes: {},
        language: v
      }, g = E.alias;
      g && (Array.isArray(g) ? Array.prototype.push.apply(d.classes, g) : d.classes.push(g)), h.hooks.run("wrap", d);
      var m = "";
      for (var y in d.attributes)
        m += " " + y + '="' + (d.attributes[y] || "").replace(/"/g, "&quot;") + '"';
      return "<" + d.tag + ' class="' + d.classes.join(" ") + '"' + m + ">" + d.content + "</" + d.tag + ">";
    };
    function l(f, E, v, p) {
      f.lastIndex = E;
      var d = f.exec(v);
      if (d && p && d[1]) {
        var g = d[1].length;
        d.index += g, d[0] = d[0].slice(g);
      }
      return d;
    }
    function o(f, E, v, p, d, g) {
      for (var m in v)
        if (!(!v.hasOwnProperty(m) || !v[m])) {
          var y = v[m];
          y = Array.isArray(y) ? y : [y];
          for (var L = 0; L < y.length; ++L) {
            if (g && g.cause == m + "," + L)
              return;
            var b = y[L], P = b.inside, j = !!b.lookbehind, re = !!b.greedy, X = b.alias;
            if (re && !b.pattern.global) {
              var Q = b.pattern.toString().match(/[imsuy]*$/)[0];
              b.pattern = RegExp(b.pattern.source, Q + "g");
            }
            for (var q = b.pattern || b, ie = p.next, O = d; ie !== E.tail && !(g && O >= g.reach); O += ie.value.length, ie = ie.next) {
              var G = ie.value;
              if (E.length > f.length)
                return;
              if (!(G instanceof u)) {
                var K = 1, M;
                if (re) {
                  if (M = l(q, O, f, j), !M || M.index >= f.length)
                    break;
                  var N = M.index, _ = M.index + M[0].length, A = O;
                  for (A += ie.value.length; N >= A; )
                    ie = ie.next, A += ie.value.length;
                  if (A -= ie.value.length, O = A, ie.value instanceof u)
                    continue;
                  for (var k = ie; k !== E.tail && (A < _ || typeof k.value == "string"); k = k.next)
                    K++, A += k.value.length;
                  K--, G = f.slice(O, A), M.index -= O;
                } else if (M = l(q, 0, G, j), !M)
                  continue;
                var N = M.index, $ = M[0], z = G.slice(0, N), B = G.slice(N + $.length), Y = O + G.length;
                g && Y > g.reach && (g.reach = Y);
                var ce = ie.prev;
                z && (ce = x(E, ce, z), O += z.length), C(E, ce, K);
                var de = new u(m, P ? h.tokenize($, P) : $, X, $);
                if (ie = x(E, ce, de), B && x(E, ie, B), K > 1) {
                  var me = {
                    cause: m + "," + L,
                    reach: Y
                  };
                  o(f, E, v, ie.prev, O, me), g && me.reach > g.reach && (g.reach = me.reach);
                }
              }
            }
          }
        }
    }
    function w() {
      var f = { value: null, prev: null, next: null }, E = { value: null, prev: f, next: null };
      f.next = E, this.head = f, this.tail = E, this.length = 0;
    }
    function x(f, E, v) {
      var p = E.next, d = { value: v, prev: E, next: p };
      return E.next = d, p.prev = d, f.length++, d;
    }
    function C(f, E, v) {
      for (var p = E.next, d = 0; d < v && p !== f.tail; d++)
        p = p.next;
      E.next = p, p.prev = E, f.length -= d;
    }
    function S(f) {
      for (var E = [], v = f.head.next; v !== f.tail; )
        E.push(v.value), v = v.next;
      return E;
    }
    if (!t.document)
      return t.addEventListener && (h.disableWorkerMessageHandler || t.addEventListener("message", function(f) {
        var E = JSON.parse(f.data), v = E.language, p = E.code, d = E.immediateClose;
        t.postMessage(h.highlight(p, h.languages[v], v)), d && t.close();
      }, !1)), h;
    var T = h.util.currentScript();
    T && (h.filename = T.src, T.hasAttribute("data-manual") && (h.manual = !0));
    function D() {
      h.manual || h.highlightAll();
    }
    if (!h.manual) {
      var F = document.readyState;
      F === "loading" || F === "interactive" && T && T.defer ? document.addEventListener("DOMContentLoaded", D) : window.requestAnimationFrame ? window.requestAnimationFrame(D) : window.setTimeout(D, 16);
    }
    return h;
  }(e);
  r.exports && (r.exports = n), typeof commonjsGlobal < "u" && (commonjsGlobal.Prism = n), n.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
    ]
  }, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(t) {
    t.type === "entity" && (t.attributes.title = t.content.replace(/&amp;/, "&"));
  }), Object.defineProperty(n.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(i, a) {
      var s = {};
      s["language-" + a] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: n.languages[a]
      }, s.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var h = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: s
        }
      };
      h["language-" + a] = {
        pattern: /[\s\S]+/,
        inside: n.languages[a]
      };
      var u = {};
      u[i] = {
        pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
          return i;
        }), "i"),
        lookbehind: !0,
        greedy: !0,
        inside: h
      }, n.languages.insertBefore("markup", "cdata", u);
    }
  }), Object.defineProperty(n.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(t, i) {
      n.languages.markup.tag.inside["special-attr"].push({
        pattern: RegExp(
          /(^|["'\s])/.source + "(?:" + t + ")" + /\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: [i, "language-" + i],
                inside: n.languages[i]
              },
              punctuation: [
                {
                  pattern: /^=/,
                  alias: "attr-equals"
                },
                /"|'/
              ]
            }
          }
        }
      });
    }
  }), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(t) {
    var i = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
    t.languages.css = {
      comment: /\/\*[\s\S]*?\*\//,
      atrule: {
        pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + i.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\\((?:" + i.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
        greedy: !0,
        inside: {
          function: /^url/i,
          punctuation: /^\(|\)$/,
          string: {
            pattern: RegExp("^" + i.source + "$"),
            alias: "url"
          }
        }
      },
      selector: {
        pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + i.source + ")*(?=\\s*\\{)"),
        lookbehind: !0
      },
      string: {
        pattern: i,
        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: /[(){};:,]/
    }, t.languages.css.atrule.inside.rest = t.languages.css;
    var a = t.languages.markup;
    a && (a.tag.addInlined("style", "css"), a.tag.addAttribute("style", "css"));
  }(n), n.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: /[{}[\];(),.:]/
  }, n.languages.javascript = n.languages.extend("clike", {
    "class-name": [
      n.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}|\?\?=?|\?\.?|[~:]/
  }), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.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: n.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: n.languages.javascript
      },
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
        lookbehind: !0,
        inside: n.languages.javascript
      },
      {
        pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
        lookbehind: !0,
        inside: n.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: n.languages.javascript
      }
    ],
    constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  }), n.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: n.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"
    }
  }), n.languages.insertBefore("javascript", "operator", {
    "literal-property": {
      pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
      lookbehind: !0,
      alias: "property"
    }
  }), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.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"
  )), n.languages.js = n.languages.javascript, function() {
    if (typeof n > "u" || typeof document > "u")
      return;
    Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
    var t = "Loading…", i = function(T, D) {
      return "✖ Error " + T + " while fetching file: " + D;
    }, a = "✖ Error: File does not exist or is empty", s = {
      js: "javascript",
      py: "python",
      rb: "ruby",
      ps1: "powershell",
      psm1: "powershell",
      sh: "bash",
      bat: "batch",
      h: "c",
      tex: "latex"
    }, h = "data-src-status", u = "loading", l = "loaded", o = "failed", w = "pre[data-src]:not([" + h + '="' + l + '"]):not([' + h + '="' + u + '"])';
    function x(T, D, F) {
      var f = new XMLHttpRequest();
      f.open("GET", T, !0), f.onreadystatechange = function() {
        f.readyState == 4 && (f.status < 400 && f.responseText ? D(f.responseText) : f.status >= 400 ? F(i(f.status, f.statusText)) : F(a));
      }, f.send(null);
    }
    function C(T) {
      var D = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(T || "");
      if (D) {
        var F = Number(D[1]), f = D[2], E = D[3];
        return f ? E ? [F, Number(E)] : [F, void 0] : [F, F];
      }
    }
    n.hooks.add("before-highlightall", function(T) {
      T.selector += ", " + w;
    }), n.hooks.add("before-sanity-check", function(T) {
      var D = (
        /** @type {HTMLPreElement} */
        T.element
      );
      if (D.matches(w)) {
        T.code = "", D.setAttribute(h, u);
        var F = D.appendChild(document.createElement("CODE"));
        F.textContent = t;
        var f = D.getAttribute("data-src"), E = T.language;
        if (E === "none") {
          var v = (/\.(\w+)$/.exec(f) || [, "none"])[1];
          E = s[v] || v;
        }
        n.util.setLanguage(F, E), n.util.setLanguage(D, E);
        var p = n.plugins.autoloader;
        p && p.loadLanguages(E), x(
          f,
          function(d) {
            D.setAttribute(h, l);
            var g = C(D.getAttribute("data-range"));
            if (g) {
              var m = d.split(/\r\n?|\n/g), y = g[0], L = g[1] == null ? m.length : g[1];
              y < 0 && (y += m.length), y = Math.max(0, Math.min(y - 1, m.length)), L < 0 && (L += m.length), L = Math.max(0, Math.min(L, m.length)), d = m.slice(y, L).join(`
`), D.hasAttribute("data-start") || D.setAttribute("data-start", String(y + 1));
            }
            F.textContent = d, n.highlightElement(F);
          },
          function(d) {
            D.setAttribute(h, o), F.textContent = d;
          }
        );
      }
    }), n.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(D) {
        for (var F = (D || document).querySelectorAll(w), f = 0, E; E = F[f++]; )
          n.highlightElement(E);
      }
    };
    var S = !1;
    n.fileHighlight = function() {
      S || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), S = !0), n.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(r) {
  var e = /\\(?:[^a-z()[\]]|[a-z*]+)/i, n = {
    "equation-command": {
      pattern: e,
      alias: "regex"
    }
  };
  r.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: n,
        alias: "string"
      },
      {
        pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
        lookbehind: !0,
        inside: n,
        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: /[[\]{}&]/
  }, r.languages.tex = r.languages.latex, r.languages.context = r.languages.latex;
})(Prism);
(function(r) {
  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", n = {
    pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
    lookbehind: !0,
    alias: "punctuation",
    // this looks reasonably well in all themes
    inside: null
    // see below
  }, t = {
    bash: n,
    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})/
  };
  r.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: t
      },
      // 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: n
        }
      },
      // “Normal” string
      {
        // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
        pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
        lookbehind: !0,
        greedy: !0,
        inside: t
      },
      {
        // 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: t.entity
        }
      }
    ],
    environment: {
      pattern: RegExp("\\$?" + e),
      alias: "constant"
    },
    variable: t.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
    }
  }, n.inside = r.languages.bash;
  for (var i = [
    "comment",
    "function-name",
    "for-or-select",
    "assign-left",
    "parameter",
    "string",
    "environment",
    "function",
    "keyword",
    "builtin",
    "boolean",
    "file-descriptor",
    "operator",
    "punctuation",
    "number"
  ], a = t.variable[1].inside, s = 0; s < i.length; s++)
    a[i[s]] = r.languages.bash[i[s]];
  r.languages.sh = r.languages.bash, r.languages.shell = r.languages.bash;
})(Prism);
new BananaSlug();
const prettyBytes = (r) => {
  let e = ["B", "KB", "MB", "GB", "PB"], n = 0;
  for (; r > 1024; )
    r /= 1024, n++;
  let t = e[n];
  return r.toFixed(1) + "&nbsp;" + t;
}, { setContext, getContext } = window.__gradio__svelte__internal, WORKER_PROXY_CONTEXT_KEY = "WORKER_PROXY_CONTEXT_KEY";
function getWorkerProxyContext() {
  return getContext(WORKER_PROXY_CONTEXT_KEY);
}
function is_self_host(r) {
  return r.host === window.location.host || r.host === "localhost:7860" || r.host === "127.0.0.1:7860" || // Ref: https://github.com/gradio-app/gradio/blob/v3.32.0/js/app/src/Index.svelte#L194
  r.host === "lite.local";
}
function getHeaderValue(r, e) {
  const n = e.toLowerCase();
  for (const [t, i] of Object.entries(r))
    if (t.toLowerCase() === n)
      return i;
}
function should_proxy_wasm_src(r) {
  if (r == null)
    return !1;
  const e = new URL(r, window.location.href);
  return !(!is_self_host(e) || e.protocol !== "http:" && e.protocol !== "https:");
}
const {
  SvelteComponent: SvelteComponent$5,
  assign: assign$1,
  check_outros: check_outros$4,
  compute_rest_props,
  create_slot: create_slot$1,
  detach: detach$5,
  element: element$4,
  empty: empty$2,
  exclude_internal_props,
  get_all_dirty_from_scope: get_all_dirty_from_scope$1,
  get_slot_changes: get_slot_changes$1,
  get_spread_update: get_spread_update$1,
  group_outros: group_outros$4,
  init: init$5,
  insert: insert$5,
  listen: listen$2,
  prevent_default,
  safe_not_equal: safe_not_equal$6,
  set_attributes,
  transition_in: transition_in$4,
  transition_out: transition_out$4,
  update_slot_base: update_slot_base$1
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$2 } = window.__gradio__svelte__internal;
function create_else_block_1(r) {
  let e, n, t, i, a;
  const s = (
    /*#slots*/
    r[8].default
  ), h = create_slot$1(
    s,
    r,
    /*$$scope*/
    r[7],
    null
  );
  let u = [
    { href: (
      /*href*/
      r[0]
    ) },
    {
      target: n = typeof window < "u" && window.__is_colab__ ? "_blank" : null
    },
    { rel: "noopener noreferrer" },
    { download: (
      /*download*/
      r[1]
    ) },
    /*$$restProps*/
    r[6]
  ], l = {};
  for (let o = 0; o < u.length; o += 1)
    l = assign$1(l, u[o]);
  return {
    c() {
      e = element$4("a"), h && h.c(), set_attributes(e, l);
    },
    m(o, w) {
      insert$5(o, e, w), h && h.m(e, null), t = !0, i || (a = listen$2(
        e,
        "click",
        /*dispatch*/
        r[3].bind(null, "click")
      ), i = !0);
    },
    p(o, w) {
      h && h.p && (!t || w & /*$$scope*/
      128) && update_slot_base$1(
        h,
        s,
        o,
        /*$$scope*/
        o[7],
        t ? get_slot_changes$1(
          s,
          /*$$scope*/
          o[7],
          w,
          null
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          o[7]
        ),
        null
      ), set_attributes(e, l = get_spread_update$1(u, [
        (!t || w & /*href*/
        1) && { href: (
          /*href*/
          o[0]
        ) },
        { target: n },
        { rel: "noopener noreferrer" },
        (!t || w & /*download*/
        2) && { download: (
          /*download*/
          o[1]
        ) },
        w & /*$$restProps*/
        64 && /*$$restProps*/
        o[6]
      ]));
    },
    i(o) {
      t || (transition_in$4(h, o), t = !0);
    },
    o(o) {
      transition_out$4(h, o), t = !1;
    },
    d(o) {
      o && detach$5(e), h && h.d(o), i = !1, a();
    }
  };
}
function create_if_block$4(r) {
  let e, n, t, i;
  const a = [create_if_block_1$3, create_else_block$3], s = [];
  function h(u, l) {
    return (
      /*is_downloading*/
      u[2] ? 0 : 1
    );
  }
  return e = h(r), n = s[e] = a[e](r), {
    c() {
      n.c(), t = empty$2();
    },
    m(u, l) {
      s[e].m(u, l), insert$5(u, t, l), i = !0;
    },
    p(u, l) {
      let o = e;
      e = h(u), e === o ? s[e].p(u, l) : (group_outros$4(), transition_out$4(s[o], 1, 1, () => {
        s[o] = null;
      }), check_outros$4(), n = s[e], n ? n.p(u, l) : (n = s[e] = a[e](u), n.c()), transition_in$4(n, 1), n.m(t.parentNode, t));
    },
    i(u) {
      i || (transition_in$4(n), i = !0);
    },
    o(u) {
      transition_out$4(n), i = !1;
    },
    d(u) {
      u && detach$5(t), s[e].d(u);
    }
  };
}
function create_else_block$3(r) {
  let e, n, t, i;
  const a = (
    /*#slots*/
    r[8].default
  ), s = create_slot$1(
    a,
    r,
    /*$$scope*/
    r[7],
    null
  );
  let h = [
    /*$$restProps*/
    r[6],
    { href: (
      /*href*/
      r[0]
    ) }
  ], u = {};
  for (let l = 0; l < h.length; l += 1)
    u = assign$1(u, h[l]);
  return {
    c() {
      e = element$4("a"), s && s.c(), set_attributes(e, u);
    },
    m(l, o) {
      insert$5(l, e, o), s && s.m(e, null), n = !0, t || (i = listen$2(e, "click", prevent_default(
        /*wasm_click_handler*/
        r[5]
      )), t = !0);
    },
    p(l, o) {
      s && s.p && (!n || o & /*$$scope*/
      128) && update_slot_base$1(
        s,
        a,
        l,
        /*$$scope*/
        l[7],
        n ? get_slot_changes$1(
          a,
          /*$$scope*/
          l[7],
          o,
          null
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          l[7]
        ),
        null
      ), set_attributes(e, u = get_spread_update$1(h, [
        o & /*$$restProps*/
        64 && /*$$restProps*/
        l[6],
        (!n || o & /*href*/
        1) && { href: (
          /*href*/
          l[0]
        ) }
      ]));
    },
    i(l) {
      n || (transition_in$4(s, l), n = !0);
    },
    o(l) {
      transition_out$4(s, l), n = !1;
    },
    d(l) {
      l && detach$5(e), s && s.d(l), t = !1, i();
    }
  };
}
function create_if_block_1$3(r) {
  let e;
  const n = (
    /*#slots*/
    r[8].default
  ), t = create_slot$1(
    n,
    r,
    /*$$scope*/
    r[7],
    null
  );
  return {
    c() {
      t && t.c();
    },
    m(i, a) {
      t && t.m(i, a), e = !0;
    },
    p(i, a) {
      t && t.p && (!e || a & /*$$scope*/
      128) && update_slot_base$1(
        t,
        n,
        i,
        /*$$scope*/
        i[7],
        e ? get_slot_changes$1(
          n,
          /*$$scope*/
          i[7],
          a,
          null
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          i[7]
        ),
        null
      );
    },
    i(i) {
      e || (transition_in$4(t, i), e = !0);
    },
    o(i) {
      transition_out$4(t, i), e = !1;
    },
    d(i) {
      t && t.d(i);
    }
  };
}
function create_fragment$5(r) {
  let e, n, t, i, a;
  const s = [create_if_block$4, create_else_block_1], h = [];
  function u(l, o) {
    return o & /*href*/
    1 && (e = null), e == null && (e = !!/*worker_proxy*/
    (l[4] && should_proxy_wasm_src(
      /*href*/
      l[0]
    ))), e ? 0 : 1;
  }
  return n = u(r, -1), t = h[n] = s[n](r), {
    c() {
      t.c(), i = empty$2();
    },
    m(l, o) {
      h[n].m(l, o), insert$5(l, i, o), a = !0;
    },
    p(l, [o]) {
      let w = n;
      n = u(l, o), n === w ? h[n].p(l, o) : (group_outros$4(), transition_out$4(h[w], 1, 1, () => {
        h[w] = null;
      }), check_outros$4(), t = h[n], t ? t.p(l, o) : (t = h[n] = s[n](l), t.c()), transition_in$4(t, 1), t.m(i.parentNode, i));
    },
    i(l) {
      a || (transition_in$4(t), a = !0);
    },
    o(l) {
      transition_out$4(t), a = !1;
    },
    d(l) {
      l && detach$5(i), h[n].d(l);
    }
  };
}
function instance$5(r, e, n) {
  const t = ["href", "download"];
  let i = compute_rest_props(e, t), { $$slots: a = {}, $$scope: s } = e;
  var h = this && this.__awaiter || function(S, T, D, F) {
    function f(E) {
      return E instanceof D ? E : new D(function(v) {
        v(E);
      });
    }
    return new (D || (D = Promise))(function(E, v) {
      function p(m) {
        try {
          g(F.next(m));
        } catch (y) {
          v(y);
        }
      }
      function d(m) {
        try {
          g(F.throw(m));
        } catch (y) {
          v(y);
        }
      }
      function g(m) {
        m.done ? E(m.value) : f(m.value).then(p, d);
      }
      g((F = F.apply(S, T || [])).next());
    });
  };
  let { href: u = void 0 } = e, { download: l } = e;
  const o = createEventDispatcher$2();
  let w = !1;
  const x = getWorkerProxyContext();
  function C() {
    return h(this, void 0, void 0, function* () {
      if (w)
        return;
      if (o("click"), u == null)
        throw new Error("href is not defined.");
      if (x == null)
        throw new Error("Wasm worker proxy is not available.");
      const T = new URL(u, window.location.href).pathname;
      n(2, w = !0), x.httpRequest({
        method: "GET",
        path: T,
        headers: {},
        query_string: ""
      }).then((D) => {
        if (D.status !== 200)
          throw new Error(`Failed to get file ${T} from the Wasm worker.`);
        const F = new Blob(
          [D.body],
          {
            type: getHeaderValue(D.headers, "content-type")
          }
        ), f = URL.createObjectURL(F), E = document.createElement("a");
        E.href = f, E.download = l, E.click(), URL.revokeObjectURL(f);
      }).finally(() => {
        n(2, w = !1);
      });
    });
  }
  return r.$$set = (S) => {
    e = assign$1(assign$1({}, e), exclude_internal_props(S)), n(6, i = compute_rest_props(e, t)), "href" in S && n(0, u = S.href), "download" in S && n(1, l = S.download), "$$scope" in S && n(7, s = S.$$scope);
  }, [
    u,
    l,
    w,
    o,
    x,
    C,
    i,
    s,
    a
  ];
}
class DownloadLink extends SvelteComponent$5 {
  constructor(e) {
    super(), init$5(this, e, instance$5, create_fragment$5, safe_not_equal$6, { href: 0, download: 1 });
  }
}
const {
  HtmlTag,
  SvelteComponent: SvelteComponent$4,
  append: append$3,
  attr: attr$3,
  check_outros: check_outros$3,
  create_component: create_component$3,
  destroy_component: destroy_component$3,
  detach: detach$4,
  element: element$3,
  ensure_array_like: ensure_array_like$1,
  group_outros: group_outros$3,
  init: init$4,
  insert: insert$4,
  listen: listen$1,
  mount_component: mount_component$3,
  noop: noop$4,
  outro_and_destroy_block,
  run_all,
  safe_not_equal: safe_not_equal$5,
  set_data: set_data$2,
  set_style: set_style$3,
  space: space$3,
  text: text$3,
  toggle_class: toggle_class$2,
  transition_in: transition_in$3,
  transition_out: transition_out$3,
  update_keyed_each
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1 } = window.__gradio__svelte__internal;
function get_each_context$1(r, e, n) {
  const t = r.slice();
  return t[11] = e[n], t[13] = n, t;
}
function create_else_block$2(r) {
  let e = (
    /*i18n*/
    r[2]("file.uploading") + ""
  ), n;
  return {
    c() {
      n = text$3(e);
    },
    m(t, i) {
      insert$4(t, n, i);
    },
    p(t, i) {
      i & /*i18n*/
      4 && e !== (e = /*i18n*/
      t[2]("file.uploading") + "") && set_data$2(n, e);
    },
    i: noop$4,
    o: noop$4,
    d(t) {
      t && detach$4(n);
    }
  };
}
function create_if_block_1$2(r) {
  let e, n;
  return e = new DownloadLink({
    props: {
      href: (
        /*file*/
        r[11].url
      ),
      download: window.__is_colab__ ? null : (
        /*file*/
        r[11].orig_name
      ),
      $$slots: { default: [create_default_slot$2] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      create_component$3(e.$$.fragment);
    },
    m(t, i) {
      mount_component$3(e, t, i), n = !0;
    },
    p(t, i) {
      const a = {};
      i & /*normalized_files*/
      8 && (a.href = /*file*/
      t[11].url), i & /*normalized_files*/
      8 && (a.download = window.__is_colab__ ? null : (
        /*file*/
        t[11].orig_name
      )), i & /*$$scope, normalized_files*/
      16392 && (a.$$scope = { dirty: i, ctx: t }), e.$set(a);
    },
    i(t) {
      n || (transition_in$3(e.$$.fragment, t), n = !0);
    },
    o(t) {
      transition_out$3(e.$$.fragment, t), n = !1;
    },
    d(t) {
      destroy_component$3(e, t);
    }
  };
}
function create_default_slot$2(r) {
  let e, n = (
    /*file*/
    (r[11].size != null ? prettyBytes(
      /*file*/
      r[11].size
    ) : "(size unknown)") + ""
  ), t;
  return {
    c() {
      e = new HtmlTag(!1), t = text$3(" ⇣"), e.a = t;
    },
    m(i, a) {
      e.m(n, i, a), insert$4(i, t, a);
    },
    p(i, a) {
      a & /*normalized_files*/
      8 && n !== (n = /*file*/
      (i[11].size != null ? prettyBytes(
        /*file*/
        i[11].size
      ) : "(size unknown)") + "") && e.p(n);
    },
    d(i) {
      i && (e.d(), detach$4(t));
    }
  };
}
function create_if_block$3(r) {
  let e, n, t, i;
  function a() {
    return (
      /*click_handler*/
      r[7](
        /*i*/
        r[13]
      )
    );
  }
  function s(...h) {
    return (
      /*keydown_handler*/
      r[8](
        /*i*/
        r[13],
        ...h
      )
    );
  }
  return {
    c() {
      e = element$3("td"), n = element$3("button"), n.textContent = "×", attr$3(n, "class", "label-clear-button svelte-1g4vug2"), attr$3(n, "aria-label", "Remove this file"), attr$3(e, "class", "svelte-1g4vug2");
    },
    m(h, u) {
      insert$4(h, e, u), append$3(e, n), t || (i = [
        listen$1(n, "click", a),
        listen$1(n, "keydown", s)
      ], t = !0);
    },
    p(h, u) {
      r = h;
    },
    d(h) {
      h && detach$4(e), t = !1, run_all(i);
    }
  };
}
function create_each_block$1(r, e) {
  let n, t, i, a = (
    /*file*/
    e[11].filename_stem + ""
  ), s, h, u, l = (
    /*file*/
    e[11].filename_ext + ""
  ), o, w, x, C, S, T, D, F, f, E, v;
  const p = [create_if_block_1$2, create_else_block$2], d = [];
  function g(L, b) {
    return (
      /*file*/
      L[11].url ? 0 : 1
    );
  }
  S = g(e), T = d[S] = p[S](e);
  let m = (
    /*normalized_files*/
    e[3].length > 1 && create_if_block$3(e)
  );
  function y(...L) {
    return (
      /*click_handler_1*/
      e[9](
        /*i*/
        e[13],
        ...L
      )
    );
  }
  return {
    key: r,
    first: null,
    c() {
      n = element$3("tr"), t = element$3("td"), i = element$3("span"), s = text$3(a), h = space$3(), u = element$3("span"), o = text$3(l), x = space$3(), C = element$3("td"), T.c(), D = space$3(), m && m.c(), F = space$3(), attr$3(i, "class", "stem svelte-1g4vug2"), attr$3(u, "class", "ext svelte-1g4vug2"), attr$3(t, "class", "filename svelte-1g4vug2"), attr$3(t, "aria-label", w = /*file*/
      e[11].orig_name), attr$3(C, "class", "download svelte-1g4vug2"), attr$3(n, "class", "file svelte-1g4vug2"), toggle_class$2(
        n,
        "selectable",
        /*selectable*/
        e[0]
      ), this.first = n;
    },
    m(L, b) {
      insert$4(L, n, b), append$3(n, t), append$3(t, i), append$3(i, s), append$3(t, h), append$3(t, u), append$3(u, o), append$3(n, x), append$3(n, C), d[S].m(C, null), append$3(n, D), m && m.m(n, null), append$3(n, F), f = !0, E || (v = listen$1(n, "click", y), E = !0);
    },
    p(L, b) {
      e = L, (!f || b & /*normalized_files*/
      8) && a !== (a = /*file*/
      e[11].filename_stem + "") && set_data$2(s, a), (!f || b & /*normalized_files*/
      8) && l !== (l = /*file*/
      e[11].filename_ext + "") && set_data$2(o, l), (!f || b & /*normalized_files*/
      8 && w !== (w = /*file*/
      e[11].orig_name)) && attr$3(t, "aria-label", w);
      let P = S;
      S = g(e), S === P ? d[S].p(e, b) : (group_outros$3(), transition_out$3(d[P], 1, 1, () => {
        d[P] = null;
      }), check_outros$3(), T = d[S], T ? T.p(e, b) : (T = d[S] = p[S](e), T.c()), transition_in$3(T, 1), T.m(C, null)), /*normalized_files*/
      e[3].length > 1 ? m ? m.p(e, b) : (m = create_if_block$3(e), m.c(), m.m(n, F)) : m && (m.d(1), m = null), (!f || b & /*selectable*/
      1) && toggle_class$2(
        n,
        "selectable",
        /*selectable*/
        e[0]
      );
    },
    i(L) {
      f || (transition_in$3(T), f = !0);
    },
    o(L) {
      transition_out$3(T), f = !1;
    },
    d(L) {
      L && detach$4(n), d[S].d(), m && m.d(), E = !1, v();
    }
  };
}
function create_fragment$4(r) {
  let e, n, t, i = [], a = /* @__PURE__ */ new Map(), s, h = ensure_array_like$1(
    /*normalized_files*/
    r[3]
  );
  const u = (l) => (
    /*file*/
    l[11]
  );
  for (let l = 0; l < h.length; l += 1) {
    let o = get_each_context$1(r, h, l), w = u(o);
    a.set(w, i[l] = create_each_block$1(w, o));
  }
  return {
    c() {
      e = element$3("div"), n = element$3("table"), t = element$3("tbody");
      for (let l = 0; l < i.length; l += 1)
        i[l].c();
      attr$3(t, "class", "svelte-1g4vug2"), attr$3(n, "class", "file-preview svelte-1g4vug2"), attr$3(e, "class", "file-preview-holder svelte-1g4vug2"), set_style$3(e, "max-height", typeof /*height*/
      r[1] === void 0 ? "auto" : (
        /*height*/
        r[1] + "px"
      ));
    },
    m(l, o) {
      insert$4(l, e, o), append$3(e, n), append$3(n, t);
      for (let w = 0; w < i.length; w += 1)
        i[w] && i[w].m(t, null);
      s = !0;
    },
    p(l, [o]) {
      o & /*selectable, handle_row_click, normalized_files, remove_file, window, i18n*/
      61 && (h = ensure_array_like$1(
        /*normalized_files*/
        l[3]
      ), group_outros$3(), i = update_keyed_each(i, o, u, 1, l, h, a, t, outro_and_destroy_block, create_each_block$1, null, get_each_context$1), check_outros$3()), (!s || o & /*height*/
      2) && set_style$3(e, "max-height", typeof /*height*/
      l[1] === void 0 ? "auto" : (
        /*height*/
        l[1] + "px"
      ));
    },
    i(l) {
      if (!s) {
        for (let o = 0; o < h.length; o += 1)
          transition_in$3(i[o]);
        s = !0;
      }
    },
    o(l) {
      for (let o = 0; o < i.length; o += 1)
        transition_out$3(i[o]);
      s = !1;
    },
    d(l) {
      l && detach$4(e);
      for (let o = 0; o < i.length; o += 1)
        i[o].d();
    }
  };
}
function split_filename(r) {
  const e = r.lastIndexOf(".");
  return e === -1 ? [r, ""] : [r.slice(0, e), r.slice(e)];
}
function instance$4(r, e, n) {
  let t;
  const i = createEventDispatcher$1();
  let { value: a } = e, { selectable: s = !1 } = e, { height: h = void 0 } = e, { i18n: u } = e;
  function l(S, T) {
    const D = S.currentTarget;
    (S.target === D || // Only select if the click is on the row itself
    D && D.firstElementChild && S.composedPath().includes(D.firstElementChild)) && i("select", {
      value: t[T].orig_name,
      index: T
    });
  }
  function o(S) {
    const T = t.splice(S, 1);
    n(3, t = [...t]), n(6, a = t), i("delete", T[0]), i("change", t);
  }
  const w = (S) => {
    o(S);
  }, x = (S, T) => {
    T.key === "Enter" && o(S);
  }, C = (S, T) => {
    l(T, S);
  };
  return r.$$set = (S) => {
    "value" in S && n(6, a = S.value), "selectable" in S && n(0, s = S.selectable), "height" in S && n(1, h = S.height), "i18n" in S && n(2, u = S.i18n);
  }, r.$$.update = () => {
    r.$$.dirty & /*value*/
    64 && n(3, t = (Array.isArray(a) ? a : [a]).map((S) => {
      var T;
      const [D, F] = split_filename((T = S.orig_name) !== null && T !== void 0 ? T : "");
      return Object.assign(Object.assign({}, S), { filename_stem: D, filename_ext: F });
    }));
  }, [
    s,
    h,
    u,
    t,
    l,
    o,
    a,
    w,
    x,
    C
  ];
}
class FilePreview extends SvelteComponent$4 {
  constructor(e) {
    super(), init$4(this, e, instance$4, create_fragment$4, safe_not_equal$5, {
      value: 6,
      selectable: 0,
      height: 1,
      i18n: 2
    });
  }
}
const {
  SvelteComponent: SvelteComponent$3,
  bubble,
  check_outros: check_outros$2,
  create_component: create_component$2,
  destroy_component: destroy_component$2,
  detach: detach$3,
  empty: empty$1,
  group_outros: group_outros$2,
  init: init$3,
  insert: insert$3,
  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
} = window.__gradio__svelte__internal;
function create_else_block$1(r) {
  let e, n;
  return e = new Empty({
    props: {
      unpadded_box: !0,
      size: "large",
      $$slots: { default: [create_default_slot$1] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      create_component$2(e.$$.fragment);
    },
    m(t, i) {
      mount_component$2(e, t, i), n = !0;
    },
    p(t, i) {
      const a = {};
      i & /*$$scope*/
      128 && (a.$$scope = { dirty: i, ctx: t }), e.$set(a);
    },
    i(t) {
      n || (transition_in$2(e.$$.fragment, t), n = !0);
    },
    o(t) {
      transition_out$2(e.$$.fragment, t), n = !1;
    },
    d(t) {
      destroy_component$2(e, t);
    }
  };
}
function create_if_block$2(r) {
  let e, n;
  return e = new FilePreview({
    props: {
      i18n: (
        /*i18n*/
        r[5]
      ),
      selectable: (
        /*selectable*/
        r[3]
      ),
      value: (
        /*value*/
        r[0]
      ),
      height: (
        /*height*/
        r[4]
      )
    }
  }), e.$on(
    "select",
    /*select_handler*/
    r[6]
  ), {
    c() {
      create_component$2(e.$$.fragment);
    },
    m(t, i) {
      mount_component$2(e, t, i), n = !0;
    },
    p(t, i) {
      const a = {};
      i & /*i18n*/
      32 && (a.i18n = /*i18n*/
      t[5]), i & /*selectable*/
      8 && (a.selectable = /*selectable*/
      t[3]), i & /*value*/
      1 && (a.value = /*value*/
      t[0]), i & /*height*/
      16 && (a.height = /*height*/
      t[4]), e.$set(a);
    },
    i(t) {
      n || (transition_in$2(e.$$.fragment, t), n = !0);
    },
    o(t) {
      transition_out$2(e.$$.fragment, t), n = !1;
    },
    d(t) {
      destroy_component$2(e, t);
    }
  };
}
function create_default_slot$1(r) {
  let e, n;
  return e = new File({}), {
    c() {
      create_component$2(e.$$.fragment);
    },
    m(t, i) {
      mount_component$2(e, t, i), n = !0;
    },
    i(t) {
      n || (transition_in$2(e.$$.fragment, t), n = !0);
    },
    o(t) {
      transition_out$2(e.$$.fragment, t), n = !1;
    },
    d(t) {
      destroy_component$2(e, t);
    }
  };
}
function create_fragment$3(r) {
  let e, n, t, i, a, s, h;
  e = new BlockLabel({
    props: {
      show_label: (
        /*show_label*/
        r[2]
      ),
      float: (
        /*value*/
        r[0] === null
      ),
      Icon: File,
      label: (
        /*label*/
        r[1] || "File"
      )
    }
  });
  const u = [create_if_block$2, create_else_block$1], l = [];
  function o(w, x) {
    return x & /*value*/
    1 && (t = null), t == null && (t = !!/*value*/
    (w[0] && (!Array.isArray(
      /*value*/
      w[0]
    ) || /*value*/
    w[0].length > 0))), t ? 0 : 1;
  }
  return i = o(r, -1), a = l[i] = u[i](r), {
    c() {
      create_component$2(e.$$.fragment), n = space$2(), a.c(), s = empty$1();
    },
    m(w, x) {
      mount_component$2(e, w, x), insert$3(w, n, x), l[i].m(w, x), insert$3(w, s, x), h = !0;
    },
    p(w, [x]) {
      const C = {};
      x & /*show_label*/
      4 && (C.show_label = /*show_label*/
      w[2]), x & /*value*/
      1 && (C.float = /*value*/
      w[0] === null), x & /*label*/
      2 && (C.label = /*label*/
      w[1] || "File"), e.$set(C);
      let S = i;
      i = o(w, x), i === S ? l[i].p(w, x) : (group_outros$2(), transition_out$2(l[S], 1, 1, () => {
        l[S] = null;
      }), check_outros$2(), a = l[i], a ? a.p(w, x) : (a = l[i] = u[i](w), a.c()), transition_in$2(a, 1), a.m(s.parentNode, s));
    },
    i(w) {
      h || (transition_in$2(e.$$.fragment, w), transition_in$2(a), h = !0);
    },
    o(w) {
      transition_out$2(e.$$.fragment, w), transition_out$2(a), h = !1;
    },
    d(w) {
      w && (detach$3(n), detach$3(s)), destroy_component$2(e, w), l[i].d(w);
    }
  };
}
function instance$3(r, e, n) {
  let { value: t = null } = e, { label: i } = e, { show_label: a = !0 } = e, { selectable: s = !1 } = e, { height: h = void 0 } = e, { i18n: u } = e;
  function l(o) {
    bubble.call(this, r, o);
  }
  return r.$$set = (o) => {
    "value" in o && n(0, t = o.value), "label" in o && n(1, i = o.label), "show_label" in o && n(2, a = o.show_label), "selectable" in o && n(3, s = o.selectable), "height" in o && n(4, h = o.height), "i18n" in o && n(5, u = o.i18n);
  }, [t, i, a, s, h, u, l];
}
class File_1 extends SvelteComponent$3 {
  constructor(e) {
    super(), init$3(this, e, instance$3, create_fragment$3, safe_not_equal$4, {
      value: 0,
      label: 1,
      show_label: 2,
      selectable: 3,
      height: 4,
      i18n: 5
    });
  }
}
var __defProp = Object.defineProperty, __defNormalProp = (r, e, n) => e in r ? __defProp(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n, __publicField = (r, e, n) => (__defNormalProp(r, typeof e != "symbol" ? e + "" : e, n), n), __accessCheck = (r, e, n) => {
  if (!e.has(r))
    throw TypeError("Cannot " + n);
}, __privateGet = (r, e, n) => (__accessCheck(r, e, "read from private field"), n ? n.call(r) : e.get(r)), __privateAdd = (r, e, n) => {
  if (e.has(r))
    throw TypeError("Cannot add the same private member more than once");
  e instanceof WeakSet ? e.add(r) : e.set(r, n);
}, __privateSet = (r, e, n, t) => (__accessCheck(r, e, "write to private field"), e.set(r, n), n), _currentLine;
new Intl.Collator(0, { numeric: 1 }).compare;
class FileData {
  constructor({
    path: e,
    url: n,
    orig_name: t,
    size: i,
    blob: a,
    is_stream: s,
    mime_type: h,
    alt_text: u
  }) {
    __publicField(this, "path"), __publicField(this, "url"), __publicField(this, "orig_name"), __publicField(this, "size"), __publicField(this, "blob"), __publicField(this, "is_stream"), __publicField(this, "mime_type"), __publicField(this, "alt_text"), __publicField(this, "meta", { _type: "gradio.FileData" }), this.path = e, this.url = n, this.orig_name = t, this.size = i, this.blob = n ? void 0 : a, this.is_stream = s, this.mime_type = h, this.alt_text = u;
  }
}
typeof process < "u" && process.versions && process.versions.node;
class TextLineStream extends TransformStream {
  /** Constructs a new instance. */
  constructor(e = { allowCR: !1 }) {
    super({
      transform: (n, t) => {
        for (n = __privateGet(this, _currentLine) + n; ; ) {
          const i = n.indexOf(`
`), a = e.allowCR ? n.indexOf("\r") : -1;
          if (a !== -1 && a !== n.length - 1 && (i === -1 || i - 1 > a)) {
            t.enqueue(n.slice(0, a)), n = n.slice(a + 1);
            continue;
          }
          if (i === -1)
            break;
          const s = n[i - 1] === "\r" ? i - 1 : i;
          t.enqueue(n.slice(0, s)), n = n.slice(i + 1);
        }
        __privateSet(this, _currentLine, n);
      },
      flush: (n) => {
        if (__privateGet(this, _currentLine) === "")
          return;
        const t = e.allowCR && __privateGet(this, _currentLine).endsWith("\r") ? __privateGet(this, _currentLine).slice(0, -1) : __privateGet(this, _currentLine);
        n.enqueue(t);
      }
    }), __privateAdd(this, _currentLine, "");
  }
}
_currentLine = /* @__PURE__ */ new WeakMap();
function commonjsRequire(r) {
  throw new Error('Could not dynamically require "' + r + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var pdf = { exports: {} };
const require$$5$1 = {}, __viteBrowserExternal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: require$$5$1
}, Symbol.toStringTag, { value: "Module" })), require$$5 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal);
(function(module, exports) {
  (function(e, n) {
    module.exports = e.pdfjsLib = n();
  })(globalThis, () => (
    /******/
    (() => {
      var __webpack_modules__ = [
        ,
        /* 1 */
        /***/
        (r, e) => {
          var Je;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.VerbosityLevel = e.Util = e.UnknownErrorException = e.UnexpectedResponseException = e.TextRenderingMode = e.RenderingIntentFlag = e.PromiseCapability = e.PermissionFlag = e.PasswordResponses = e.PasswordException = e.PageActionEventType = e.OPS = e.MissingPDFException = e.MAX_IMAGE_SIZE_TO_CACHE = e.LINE_FACTOR = e.LINE_DESCENT_FACTOR = e.InvalidPDFException = e.ImageKind = e.IDENTITY_MATRIX = e.FormatError = e.FeatureTest = e.FONT_IDENTITY_MATRIX = e.DocumentActionEventType = e.CMapCompressionType = e.BaseException = e.BASELINE_FACTOR = e.AnnotationType = e.AnnotationReplyType = e.AnnotationPrefix = e.AnnotationMode = e.AnnotationFlag = e.AnnotationFieldFlag = e.AnnotationEditorType = e.AnnotationEditorPrefix = e.AnnotationEditorParamsType = e.AnnotationBorderStyleType = e.AnnotationActionEventType = e.AbortException = void 0, e.assert = O, e.bytesToString = ce, e.createValidAbsoluteUrl = K, e.getModificationDate = ke, e.getUuid = Ue, e.getVerbosityLevel = X, e.info = Q, e.isArrayBuffer = ee, e.isArrayEqual = Fe, e.isNodeJS = void 0, e.normalizeUnicode = Me, e.objectFromMap = _e, e.objectSize = Ae, e.setVerbosityLevel = re, e.shadow = M, e.string32 = me, e.stringToBytes = de, e.stringToPDFString = be, e.stringToUTF8String = we, e.unreachable = ie, e.utf8StringToString = Ee, e.warn = q;
          const n = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
          e.isNodeJS = n;
          const t = [1, 0, 0, 1, 0, 0];
          e.IDENTITY_MATRIX = t;
          const i = [1e-3, 0, 0, 1e-3, 0, 0];
          e.FONT_IDENTITY_MATRIX = i;
          const a = 1e7;
          e.MAX_IMAGE_SIZE_TO_CACHE = a;
          const s = 1.35;
          e.LINE_FACTOR = s;
          const h = 0.35;
          e.LINE_DESCENT_FACTOR = h;
          const u = h / s;
          e.BASELINE_FACTOR = u;
          const l = {
            ANY: 1,
            DISPLAY: 2,
            PRINT: 4,
            SAVE: 8,
            ANNOTATIONS_FORMS: 16,
            ANNOTATIONS_STORAGE: 32,
            ANNOTATIONS_DISABLE: 64,
            OPLIST: 256
          };
          e.RenderingIntentFlag = l;
          const o = {
            DISABLE: 0,
            ENABLE: 1,
            ENABLE_FORMS: 2,
            ENABLE_STORAGE: 3
          };
          e.AnnotationMode = o;
          const w = "pdfjs_internal_editor_";
          e.AnnotationEditorPrefix = w;
          const x = {
            DISABLE: -1,
            NONE: 0,
            FREETEXT: 3,
            STAMP: 13,
            INK: 15
          };
          e.AnnotationEditorType = x;
          const C = {
            RESIZE: 1,
            CREATE: 2,
            FREETEXT_SIZE: 11,
            FREETEXT_COLOR: 12,
            FREETEXT_OPACITY: 13,
            INK_COLOR: 21,
            INK_THICKNESS: 22,
            INK_OPACITY: 23
          };
          e.AnnotationEditorParamsType = C;
          const S = {
            PRINT: 4,
            MODIFY_CONTENTS: 8,
            COPY: 16,
            MODIFY_ANNOTATIONS: 32,
            FILL_INTERACTIVE_FORMS: 256,
            COPY_FOR_ACCESSIBILITY: 512,
            ASSEMBLE: 1024,
            PRINT_HIGH_QUALITY: 2048
          };
          e.PermissionFlag = S;
          const T = {
            FILL: 0,
            STROKE: 1,
            FILL_STROKE: 2,
            INVISIBLE: 3,
            FILL_ADD_TO_PATH: 4,
            STROKE_ADD_TO_PATH: 5,
            FILL_STROKE_ADD_TO_PATH: 6,
            ADD_TO_PATH: 7,
            FILL_STROKE_MASK: 3,
            ADD_TO_PATH_FLAG: 4
          };
          e.TextRenderingMode = T;
          const D = {
            GRAYSCALE_1BPP: 1,
            RGB_24BPP: 2,
            RGBA_32BPP: 3
          };
          e.ImageKind = D;
          const F = {
            TEXT: 1,
            LINK: 2,
            FREETEXT: 3,
            LINE: 4,
            SQUARE: 5,
            CIRCLE: 6,
            POLYGON: 7,
            POLYLINE: 8,
            HIGHLIGHT: 9,
            UNDERLINE: 10,
            SQUIGGLY: 11,
            STRIKEOUT: 12,
            STAMP: 13,
            CARET: 14,
            INK: 15,
            POPUP: 16,
            FILEATTACHMENT: 17,
            SOUND: 18,
            MOVIE: 19,
            WIDGET: 20,
            SCREEN: 21,
            PRINTERMARK: 22,
            TRAPNET: 23,
            WATERMARK: 24,
            THREED: 25,
            REDACT: 26
          };
          e.AnnotationType = F;
          const f = {
            GROUP: "Group",
            REPLY: "R"
          };
          e.AnnotationReplyType = f;
          const E = {
            INVISIBLE: 1,
            HIDDEN: 2,
            PRINT: 4,
            NOZOOM: 8,
            NOROTATE: 16,
            NOVIEW: 32,
            READONLY: 64,
            LOCKED: 128,
            TOGGLENOVIEW: 256,
            LOCKEDCONTENTS: 512
          };
          e.AnnotationFlag = E;
          const v = {
            READONLY: 1,
            REQUIRED: 2,
            NOEXPORT: 4,
            MULTILINE: 4096,
            PASSWORD: 8192,
            NOTOGGLETOOFF: 16384,
            RADIO: 32768,
            PUSHBUTTON: 65536,
            COMBO: 131072,
            EDIT: 262144,
            SORT: 524288,
            FILESELECT: 1048576,
            MULTISELECT: 2097152,
            DONOTSPELLCHECK: 4194304,
            DONOTSCROLL: 8388608,
            COMB: 16777216,
            RICHTEXT: 33554432,
            RADIOSINUNISON: 33554432,
            COMMITONSELCHANGE: 67108864
          };
          e.AnnotationFieldFlag = v;
          const p = {
            SOLID: 1,
            DASHED: 2,
            BEVELED: 3,
            INSET: 4,
            UNDERLINE: 5
          };
          e.AnnotationBorderStyleType = p;
          const d = {
            E: "Mouse Enter",
            X: "Mouse Exit",
            D: "Mouse Down",
            U: "Mouse Up",
            Fo: "Focus",
            Bl: "Blur",
            PO: "PageOpen",
            PC: "PageClose",
            PV: "PageVisible",
            PI: "PageInvisible",
            K: "Keystroke",
            F: "Format",
            V: "Validate",
            C: "Calculate"
          };
          e.AnnotationActionEventType = d;
          const g = {
            WC: "WillClose",
            WS: "WillSave",
            DS: "DidSave",
            WP: "WillPrint",
            DP: "DidPrint"
          };
          e.DocumentActionEventType = g;
          const m = {
            O: "PageOpen",
            C: "PageClose"
          };
          e.PageActionEventType = m;
          const y = {
            ERRORS: 0,
            WARNINGS: 1,
            INFOS: 5
          };
          e.VerbosityLevel = y;
          const L = {
            NONE: 0,
            BINARY: 1
          };
          e.CMapCompressionType = L;
          const b = {
            dependency: 1,
            setLineWidth: 2,
            setLineCap: 3,
            setLineJoin: 4,
            setMiterLimit: 5,
            setDash: 6,
            setRenderingIntent: 7,
            setFlatness: 8,
            setGState: 9,
            save: 10,
            restore: 11,
            transform: 12,
            moveTo: 13,
            lineTo: 14,
            curveTo: 15,
            curveTo2: 16,
            curveTo3: 17,
            closePath: 18,
            rectangle: 19,
            stroke: 20,
            closeStroke: 21,
            fill: 22,
            eoFill: 23,
            fillStroke: 24,
            eoFillStroke: 25,
            closeFillStroke: 26,
            closeEOFillStroke: 27,
            endPath: 28,
            clip: 29,
            eoClip: 30,
            beginText: 31,
            endText: 32,
            setCharSpacing: 33,
            setWordSpacing: 34,
            setHScale: 35,
            setLeading: 36,
            setFont: 37,
            setTextRenderingMode: 38,
            setTextRise: 39,
            moveText: 40,
            setLeadingMoveText: 41,
            setTextMatrix: 42,
            nextLine: 43,
            showText: 44,
            showSpacedText: 45,
            nextLineShowText: 46,
            nextLineSetSpacingShowText: 47,
            setCharWidth: 48,
            setCharWidthAndBounds: 49,
            setStrokeColorSpace: 50,
            setFillColorSpace: 51,
            setStrokeColor: 52,
            setStrokeColorN: 53,
            setFillColor: 54,
            setFillColorN: 55,
            setStrokeGray: 56,
            setFillGray: 57,
            setStrokeRGBColor: 58,
            setFillRGBColor: 59,
            setStrokeCMYKColor: 60,
            setFillCMYKColor: 61,
            shadingFill: 62,
            beginInlineImage: 63,
            beginImageData: 64,
            endInlineImage: 65,
            paintXObject: 66,
            markPoint: 67,
            markPointProps: 68,
            beginMarkedContent: 69,
            beginMarkedContentProps: 70,
            endMarkedContent: 71,
            beginCompat: 72,
            endCompat: 73,
            paintFormXObjectBegin: 74,
            paintFormXObjectEnd: 75,
            beginGroup: 76,
            endGroup: 77,
            beginAnnotation: 80,
            endAnnotation: 81,
            paintImageMaskXObject: 83,
            paintImageMaskXObjectGroup: 84,
            paintImageXObject: 85,
            paintInlineImageXObject: 86,
            paintInlineImageXObjectGroup: 87,
            paintImageXObjectRepeat: 88,
            paintImageMaskXObjectRepeat: 89,
            paintSolidColorImageMask: 90,
            constructPath: 91
          };
          e.OPS = b;
          const P = {
            NEED_PASSWORD: 1,
            INCORRECT_PASSWORD: 2
          };
          e.PasswordResponses = P;
          let j = y.WARNINGS;
          function re(ye) {
            Number.isInteger(ye) && (j = ye);
          }
          function X() {
            return j;
          }
          function Q(ye) {
            j >= y.INFOS && console.log(`Info: ${ye}`);
          }
          function q(ye) {
            j >= y.WARNINGS && console.log(`Warning: ${ye}`);
          }
          function ie(ye) {
            throw new Error(ye);
          }
          function O(ye, oe) {
            ye || ie(oe);
          }
          function G(ye) {
            switch (ye == null ? void 0 : ye.protocol) {
              case "http:":
              case "https:":
              case "ftp:":
              case "mailto:":
              case "tel:":
                return !0;
              default:
                return !1;
            }
          }
          function K(ye, oe = null, ue = null) {
            if (!ye)
              return null;
            try {
              if (ue && typeof ye == "string") {
                if (ue.addDefaultProtocol && ye.startsWith("www.")) {
                  const Xe = ye.match(/\./g);
                  (Xe == null ? void 0 : Xe.length) >= 2 && (ye = `http://${ye}`);
                }
                if (ue.tryConvertEncoding)
                  try {
                    ye = we(ye);
                  } catch {
                  }
              }
              const Pe = oe ? new URL(ye, oe) : new URL(ye);
              if (G(Pe))
                return Pe;
            } catch {
            }
            return null;
          }
          function M(ye, oe, ue, Pe = !1) {
            return Object.defineProperty(ye, oe, {
              value: ue,
              enumerable: !Pe,
              configurable: !0,
              writable: !1
            }), ue;
          }
          const _ = function() {
            function oe(ue, Pe) {
              this.constructor === oe && ie("Cannot initialize BaseException."), this.message = ue, this.name = Pe;
            }
            return oe.prototype = new Error(), oe.constructor = oe, oe;
          }();
          e.BaseException = _;
          class A extends _ {
            constructor(oe, ue) {
              super(oe, "PasswordException"), this.code = ue;
            }
          }
          e.PasswordException = A;
          class k extends _ {
            constructor(oe, ue) {
              super(oe, "UnknownErrorException"), this.details = ue;
            }
          }
          e.UnknownErrorException = k;
          class N extends _ {
            constructor(oe) {
              super(oe, "InvalidPDFException");
            }
          }
          e.InvalidPDFException = N;
          class $ extends _ {
            constructor(oe) {
              super(oe, "MissingPDFException");
            }
          }
          e.MissingPDFException = $;
          class z extends _ {
            constructor(oe, ue) {
              super(oe, "UnexpectedResponseException"), this.status = ue;
            }
          }
          e.UnexpectedResponseException = z;
          class B extends _ {
            constructor(oe) {
              super(oe, "FormatError");
            }
          }
          e.FormatError = B;
          class Y extends _ {
            constructor(oe) {
              super(oe, "AbortException");
            }
          }
          e.AbortException = Y;
          function ce(ye) {
            (typeof ye != "object" || (ye == null ? void 0 : ye.length) === void 0) && ie("Invalid argument for bytesToString");
            const oe = ye.length, ue = 8192;
            if (oe < ue)
              return String.fromCharCode.apply(null, ye);
            const Pe = [];
            for (let Xe = 0; Xe < oe; Xe += ue) {
              const Ke = Math.min(Xe + ue, oe), W = ye.subarray(Xe, Ke);
              Pe.push(String.fromCharCode.apply(null, W));
            }
            return Pe.join("");
          }
          function de(ye) {
            typeof ye != "string" && ie("Invalid argument for stringToBytes");
            const oe = ye.length, ue = new Uint8Array(oe);
            for (let Pe = 0; Pe < oe; ++Pe)
              ue[Pe] = ye.charCodeAt(Pe) & 255;
            return ue;
          }
          function me(ye) {
            return String.fromCharCode(ye >> 24 & 255, ye >> 16 & 255, ye >> 8 & 255, ye & 255);
          }
          function Ae(ye) {
            return Object.keys(ye).length;
          }
          function _e(ye) {
            const oe = /* @__PURE__ */ Object.create(null);
            for (const [ue, Pe] of ye)
              oe[ue] = Pe;
            return oe;
          }
          function te() {
            const ye = new Uint8Array(4);
            return ye[0] = 1, new Uint32Array(ye.buffer, 0, 1)[0] === 1;
          }
          function se() {
            try {
              return new Function(""), !0;
            } catch {
              return !1;
            }
          }
          class R {
            static get isLittleEndian() {
              return M(this, "isLittleEndian", te());
            }
            static get isEvalSupported() {
              return M(this, "isEvalSupported", se());
            }
            static get isOffscreenCanvasSupported() {
              return M(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
            }
            static get platform() {
              return typeof navigator > "u" ? M(this, "platform", {
                isWin: !1,
                isMac: !1
              }) : M(this, "platform", {
                isWin: navigator.platform.includes("Win"),
                isMac: navigator.platform.includes("Mac")
              });
            }
            static get isCSSRoundSupported() {
              var oe, ue;
              return M(this, "isCSSRoundSupported", (ue = (oe = globalThis.CSS) == null ? void 0 : oe.supports) == null ? void 0 : ue.call(oe, "width: round(1.5px, 1px)"));
            }
          }
          e.FeatureTest = R;
          const H = [...Array(256).keys()].map((ye) => ye.toString(16).padStart(2, "0"));
          class J {
            static makeHexColor(oe, ue, Pe) {
              return `#${H[oe]}${H[ue]}${H[Pe]}`;
            }
            static scaleMinMax(oe, ue) {
              let Pe;
              oe[0] ? (oe[0] < 0 && (Pe = ue[0], ue[0] = ue[1], ue[1] = Pe), ue[0] *= oe[0], ue[1] *= oe[0], oe[3] < 0 && (Pe = ue[2], ue[2] = ue[3], ue[3] = Pe), ue[2] *= oe[3], ue[3] *= oe[3]) : (Pe = ue[0], ue[0] = ue[2], ue[2] = Pe, Pe = ue[1], ue[1] = ue[3], ue[3] = Pe, oe[1] < 0 && (Pe = ue[2], ue[2] = ue[3], ue[3] = Pe), ue[2] *= oe[1], ue[3] *= oe[1], oe[2] < 0 && (Pe = ue[0], ue[0] = ue[1], ue[1] = Pe), ue[0] *= oe[2], ue[1] *= oe[2]), ue[0] += oe[4], ue[1] += oe[4], ue[2] += oe[5], ue[3] += oe[5];
            }
            static transform(oe, ue) {
              return [oe[0] * ue[0] + oe[2] * ue[1], oe[1] * ue[0] + oe[3] * ue[1], oe[0] * ue[2] + oe[2] * ue[3], oe[1] * ue[2] + oe[3] * ue[3], oe[0] * ue[4] + oe[2] * ue[5] + oe[4], oe[1] * ue[4] + oe[3] * ue[5] + oe[5]];
            }
            static applyTransform(oe, ue) {
              const Pe = oe[0] * ue[0] + oe[1] * ue[2] + ue[4], Xe = oe[0] * ue[1] + oe[1] * ue[3] + ue[5];
              return [Pe, Xe];
            }
            static applyInverseTransform(oe, ue) {
              const Pe = ue[0] * ue[3] - ue[1] * ue[2], Xe = (oe[0] * ue[3] - oe[1] * ue[2] + ue[2] * ue[5] - ue[4] * ue[3]) / Pe, Ke = (-oe[0] * ue[1] + oe[1] * ue[0] + ue[4] * ue[1] - ue[5] * ue[0]) / Pe;
              return [Xe, Ke];
            }
            static getAxialAlignedBoundingBox(oe, ue) {
              const Pe = this.applyTransform(oe, ue), Xe = this.applyTransform(oe.slice(2, 4), ue), Ke = this.applyTransform([oe[0], oe[3]], ue), W = this.applyTransform([oe[2], oe[1]], ue);
              return [Math.min(Pe[0], Xe[0], Ke[0], W[0]), Math.min(Pe[1], Xe[1], Ke[1], W[1]), Math.max(Pe[0], Xe[0], Ke[0], W[0]), Math.max(Pe[1], Xe[1], Ke[1], W[1])];
            }
            static inverseTransform(oe) {
              const ue = oe[0] * oe[3] - oe[1] * oe[2];
              return [oe[3] / ue, -oe[1] / ue, -oe[2] / ue, oe[0] / ue, (oe[2] * oe[5] - oe[4] * oe[3]) / ue, (oe[4] * oe[1] - oe[5] * oe[0]) / ue];
            }
            static singularValueDecompose2dScale(oe) {
              const ue = [oe[0], oe[2], oe[1], oe[3]], Pe = oe[0] * ue[0] + oe[1] * ue[2], Xe = oe[0] * ue[1] + oe[1] * ue[3], Ke = oe[2] * ue[0] + oe[3] * ue[2], W = oe[2] * ue[1] + oe[3] * ue[3], pe = (Pe + W) / 2, De = Math.sqrt((Pe + W) ** 2 - 4 * (Pe * W - Ke * Xe)) / 2, $e = pe + De || 1, Be = pe - De || 1;
              return [Math.sqrt($e), Math.sqrt(Be)];
            }
            static normalizeRect(oe) {
              const ue = oe.slice(0);
              return oe[0] > oe[2] && (ue[0] = oe[2], ue[2] = oe[0]), oe[1] > oe[3] && (ue[1] = oe[3], ue[3] = oe[1]), ue;
            }
            static intersect(oe, ue) {
              const Pe = Math.max(Math.min(oe[0], oe[2]), Math.min(ue[0], ue[2])), Xe = Math.min(Math.max(oe[0], oe[2]), Math.max(ue[0], ue[2]));
              if (Pe > Xe)
                return null;
              const Ke = Math.max(Math.min(oe[1], oe[3]), Math.min(ue[1], ue[3])), W = Math.min(Math.max(oe[1], oe[3]), Math.max(ue[1], ue[3]));
              return Ke > W ? null : [Pe, Ke, Xe, W];
            }
            static bezierBoundingBox(oe, ue, Pe, Xe, Ke, W, pe, De) {
              const $e = [], Be = [[], []];
              let xe, U, I, V, fe, ge, ve, Se;
              for (let Ge = 0; Ge < 2; ++Ge) {
                if (Ge === 0 ? (U = 6 * oe - 12 * Pe + 6 * Ke, xe = -3 * oe + 9 * Pe - 9 * Ke + 3 * pe, I = 3 * Pe - 3 * oe) : (U = 6 * ue - 12 * Xe + 6 * W, xe = -3 * ue + 9 * Xe - 9 * W + 3 * De, I = 3 * Xe - 3 * ue), Math.abs(xe) < 1e-12) {
                  if (Math.abs(U) < 1e-12)
                    continue;
                  V = -I / U, 0 < V && V < 1 && $e.push(V);
                  continue;
                }
                ve = U * U - 4 * I * xe, Se = Math.sqrt(ve), !(ve < 0) && (fe = (-U + Se) / (2 * xe), 0 < fe && fe < 1 && $e.push(fe), ge = (-U - Se) / (2 * xe), 0 < ge && ge < 1 && $e.push(ge));
              }
              let Le = $e.length, Ie;
              const Ce = Le;
              for (; Le--; )
                V = $e[Le], Ie = 1 - V, Be[0][Le] = Ie * Ie * Ie * oe + 3 * Ie * Ie * V * Pe + 3 * Ie * V * V * Ke + V * V * V * pe, Be[1][Le] = Ie * Ie * Ie * ue + 3 * Ie * Ie * V * Xe + 3 * Ie * V * V * W + V * V * V * De;
              return Be[0][Ce] = oe, Be[1][Ce] = ue, Be[0][Ce + 1] = pe, Be[1][Ce + 1] = De, Be[0].length = Be[1].length = Ce + 2, [Math.min(...Be[0]), Math.min(...Be[1]), Math.max(...Be[0]), Math.max(...Be[1])];
            }
          }
          e.Util = J;
          const ae = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
          function be(ye) {
            if (ye[0] >= "ï") {
              let ue;
              if (ye[0] === "þ" && ye[1] === "ÿ" ? ue = "utf-16be" : ye[0] === "ÿ" && ye[1] === "þ" ? ue = "utf-16le" : ye[0] === "ï" && ye[1] === "»" && ye[2] === "¿" && (ue = "utf-8"), ue)
                try {
                  const Pe = new TextDecoder(ue, {
                    fatal: !0
                  }), Xe = de(ye);
                  return Pe.decode(Xe);
                } catch (Pe) {
                  q(`stringToPDFString: "${Pe}".`);
                }
            }
            const oe = [];
            for (let ue = 0, Pe = ye.length; ue < Pe; ue++) {
              const Xe = ae[ye.charCodeAt(ue)];
              oe.push(Xe ? String.fromCharCode(Xe) : ye.charAt(ue));
            }
            return oe.join("");
          }
          function we(ye) {
            return decodeURIComponent(escape(ye));
          }
          function Ee(ye) {
            return unescape(encodeURIComponent(ye));
          }
          function ee(ye) {
            return typeof ye == "object" && (ye == null ? void 0 : ye.byteLength) !== void 0;
          }
          function Fe(ye, oe) {
            if (ye.length !== oe.length)
              return !1;
            for (let ue = 0, Pe = ye.length; ue < Pe; ue++)
              if (ye[ue] !== oe[ue])
                return !1;
            return !0;
          }
          function ke(ye = /* @__PURE__ */ new Date()) {
            return [ye.getUTCFullYear().toString(), (ye.getUTCMonth() + 1).toString().padStart(2, "0"), ye.getUTCDate().toString().padStart(2, "0"), ye.getUTCHours().toString().padStart(2, "0"), ye.getUTCMinutes().toString().padStart(2, "0"), ye.getUTCSeconds().toString().padStart(2, "0")].join("");
          }
          class We {
            constructor() {
              le(this, Je, !1);
              this.promise = new Promise((oe, ue) => {
                this.resolve = (Pe) => {
                  he(this, Je, !0), oe(Pe);
                }, this.reject = (Pe) => {
                  he(this, Je, !0), ue(Pe);
                };
              });
            }
            get settled() {
              return c(this, Je);
            }
          }
          Je = new WeakMap(), e.PromiseCapability = We;
          let He = null, Ze = null;
          function Me(ye) {
            return He || (He = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, Ze = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), ye.replaceAll(He, (oe, ue, Pe) => ue ? ue.normalize("NFKC") : Ze.get(Pe));
          }
          function Ue() {
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.randomUUID) == "function")
              return crypto.randomUUID();
            const ye = new Uint8Array(32);
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.getRandomValues) == "function")
              crypto.getRandomValues(ye);
            else
              for (let oe = 0; oe < 32; oe++)
                ye[oe] = Math.floor(Math.random() * 255);
            return ce(ye);
          }
          const Ye = "pdfjs_internal_id_";
          e.AnnotationPrefix = Ye;
        },
        /* 2 */
        /***/
        (__unused_webpack_module, exports, __w_pdfjs_require__) => {
          var r, n, t, i, dt, Dt, h, u, l, o, w, x, C, S, T, Ft, F, f, Ht, v, p;
          Object.defineProperty(exports, "__esModule", {
            value: !0
          }), exports.RenderTask = exports.PDFWorkerUtil = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultFilterFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0, Object.defineProperty(exports, "SVGGraphics", {
            enumerable: !0,
            get: function() {
              return _displaySvg.SVGGraphics;
            }
          }), exports.build = void 0, exports.getDocument = getDocument, exports.version = void 0;
          var _util = __w_pdfjs_require__(1), _annotation_storage = __w_pdfjs_require__(3), _display_utils = __w_pdfjs_require__(6), _font_loader = __w_pdfjs_require__(9), _displayNode_utils = __w_pdfjs_require__(10), _canvas = __w_pdfjs_require__(11), _worker_options = __w_pdfjs_require__(14), _message_handler = __w_pdfjs_require__(15), _metadata = __w_pdfjs_require__(16), _optional_content_config = __w_pdfjs_require__(17), _transport_stream = __w_pdfjs_require__(18), _displayFetch_stream = __w_pdfjs_require__(19), _displayNetwork = __w_pdfjs_require__(22), _displayNode_stream = __w_pdfjs_require__(23), _displaySvg = __w_pdfjs_require__(24), _xfa_text = __w_pdfjs_require__(25);
          const DEFAULT_RANGE_CHUNK_SIZE = 65536, RENDERING_CANCELLED_TIMEOUT = 100, DELAYED_CLEANUP_TIMEOUT = 5e3, DefaultCanvasFactory = _util.isNodeJS ? _displayNode_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory;
          exports.DefaultCanvasFactory = DefaultCanvasFactory;
          const DefaultCMapReaderFactory = _util.isNodeJS ? _displayNode_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory;
          exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory;
          const DefaultFilterFactory = _util.isNodeJS ? _displayNode_utils.NodeFilterFactory : _display_utils.DOMFilterFactory;
          exports.DefaultFilterFactory = DefaultFilterFactory;
          const DefaultStandardFontDataFactory = _util.isNodeJS ? _displayNode_utils.NodeStandardFontDataFactory : _display_utils.DOMStandardFontDataFactory;
          exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory;
          function getDocument(g) {
            if (typeof g == "string" || g instanceof URL ? g = {
              url: g
            } : (0, _util.isArrayBuffer)(g) && (g = {
              data: g
            }), typeof g != "object")
              throw new Error("Invalid parameter in getDocument, need parameter object.");
            if (!g.url && !g.data && !g.range)
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            const m = new PDFDocumentLoadingTask(), {
              docId: y
            } = m, L = g.url ? getUrlProp(g.url) : null, b = g.data ? getDataProp(g.data) : null, P = g.httpHeaders || null, j = g.withCredentials === !0, re = g.password ?? null, X = g.range instanceof PDFDataRangeTransport ? g.range : null, Q = Number.isInteger(g.rangeChunkSize) && g.rangeChunkSize > 0 ? g.rangeChunkSize : DEFAULT_RANGE_CHUNK_SIZE;
            let q = g.worker instanceof PDFWorker ? g.worker : null;
            const ie = g.verbosity, O = typeof g.docBaseUrl == "string" && !(0, _display_utils.isDataScheme)(g.docBaseUrl) ? g.docBaseUrl : null, G = typeof g.cMapUrl == "string" ? g.cMapUrl : null, K = g.cMapPacked !== !1, M = g.CMapReaderFactory || DefaultCMapReaderFactory, _ = typeof g.standardFontDataUrl == "string" ? g.standardFontDataUrl : null, A = g.StandardFontDataFactory || DefaultStandardFontDataFactory, k = g.stopAtErrors !== !0, N = Number.isInteger(g.maxImageSize) && g.maxImageSize > -1 ? g.maxImageSize : -1, $ = g.isEvalSupported !== !1, z = typeof g.isOffscreenCanvasSupported == "boolean" ? g.isOffscreenCanvasSupported : !_util.isNodeJS, B = Number.isInteger(g.canvasMaxAreaInBytes) ? g.canvasMaxAreaInBytes : -1, Y = typeof g.disableFontFace == "boolean" ? g.disableFontFace : _util.isNodeJS, ce = g.fontExtraProperties === !0, de = g.enableXfa === !0, me = g.ownerDocument || globalThis.document, Ae = g.disableRange === !0, _e = g.disableStream === !0, te = g.disableAutoFetch === !0, se = g.pdfBug === !0, R = X ? X.length : g.length ?? NaN, H = typeof g.useSystemFonts == "boolean" ? g.useSystemFonts : !_util.isNodeJS && !Y, J = typeof g.useWorkerFetch == "boolean" ? g.useWorkerFetch : M === _display_utils.DOMCMapReaderFactory && A === _display_utils.DOMStandardFontDataFactory && G && _ && (0, _display_utils.isValidFetchUrl)(G, document.baseURI) && (0, _display_utils.isValidFetchUrl)(_, document.baseURI), ae = g.canvasFactory || new DefaultCanvasFactory({
              ownerDocument: me
            }), be = g.filterFactory || new DefaultFilterFactory({
              docId: y,
              ownerDocument: me
            }), we = null;
            (0, _util.setVerbosityLevel)(ie);
            const Ee = {
              canvasFactory: ae,
              filterFactory: be
            };
            if (J || (Ee.cMapReaderFactory = new M({
              baseUrl: G,
              isCompressed: K
            }), Ee.standardFontDataFactory = new A({
              baseUrl: _
            })), !q) {
              const ke = {
                verbosity: ie,
                port: _worker_options.GlobalWorkerOptions.workerPort
              };
              q = ke.port ? PDFWorker.fromPort(ke) : new PDFWorker(ke), m._worker = q;
            }
            const ee = {
              docId: y,
              apiVersion: "3.11.174",
              data: b,
              password: re,
              disableAutoFetch: te,
              rangeChunkSize: Q,
              length: R,
              docBaseUrl: O,
              enableXfa: de,
              evaluatorOptions: {
                maxImageSize: N,
                disableFontFace: Y,
                ignoreErrors: k,
                isEvalSupported: $,
                isOffscreenCanvasSupported: z,
                canvasMaxAreaInBytes: B,
                fontExtraProperties: ce,
                useSystemFonts: H,
                cMapUrl: J ? G : null,
                standardFontDataUrl: J ? _ : null
              }
            }, Fe = {
              ignoreErrors: k,
              isEvalSupported: $,
              disableFontFace: Y,
              fontExtraProperties: ce,
              enableXfa: de,
              ownerDocument: me,
              disableAutoFetch: te,
              pdfBug: se,
              styleElement: we
            };
            return q.promise.then(function() {
              if (m.destroyed)
                throw new Error("Loading aborted");
              const ke = _fetchDocument(q, ee), We = new Promise(function(He) {
                let Ze;
                X ? Ze = new _transport_stream.PDFDataTransportStream({
                  length: R,
                  initialData: X.initialData,
                  progressiveDone: X.progressiveDone,
                  contentDispositionFilename: X.contentDispositionFilename,
                  disableRange: Ae,
                  disableStream: _e
                }, X) : b || (Ze = ((Ue) => _util.isNodeJS ? new _displayNode_stream.PDFNodeStream(Ue) : (0, _display_utils.isValidFetchUrl)(Ue.url) ? new _displayFetch_stream.PDFFetchStream(Ue) : new _displayNetwork.PDFNetworkStream(Ue))({
                  url: L,
                  length: R,
                  httpHeaders: P,
                  withCredentials: j,
                  rangeChunkSize: Q,
                  disableRange: Ae,
                  disableStream: _e
                })), He(Ze);
              });
              return Promise.all([ke, We]).then(function([He, Ze]) {
                if (m.destroyed)
                  throw new Error("Loading aborted");
                const Me = new _message_handler.MessageHandler(y, He, q.port), Ue = new WorkerTransport(Me, m, Ze, Fe, Ee);
                m._transport = Ue, Me.send("Ready", null);
              });
            }).catch(m._capability.reject), m;
          }
          async function _fetchDocument(g, m) {
            if (g.destroyed)
              throw new Error("Worker was destroyed");
            const y = await g.messageHandler.sendWithPromise("GetDocRequest", m, m.data ? [m.data.buffer] : null);
            if (g.destroyed)
              throw new Error("Worker was destroyed");
            return y;
          }
          function getUrlProp(g) {
            if (g instanceof URL)
              return g.href;
            try {
              return new URL(g, window.location).href;
            } catch {
              if (_util.isNodeJS && typeof g == "string")
                return g;
            }
            throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
          }
          function getDataProp(g) {
            if (_util.isNodeJS && typeof Buffer < "u" && g instanceof Buffer)
              throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
            if (g instanceof Uint8Array && g.byteLength === g.buffer.byteLength)
              return g;
            if (typeof g == "string")
              return (0, _util.stringToBytes)(g);
            if (typeof g == "object" && !isNaN(g == null ? void 0 : g.length) || (0, _util.isArrayBuffer)(g))
              return new Uint8Array(g);
            throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
          }
          const e = class e {
            constructor() {
              this._capability = new _util.PromiseCapability(), this._transport = null, this._worker = null, this.docId = `d${bt(e, r)._++}`, this.destroyed = !1, this.onPassword = null, this.onProgress = null;
            }
            get promise() {
              return this._capability.promise;
            }
            async destroy() {
              var m, y, L;
              this.destroyed = !0;
              try {
                (m = this._worker) != null && m.port && (this._worker._pendingDestroy = !0), await ((y = this._transport) == null ? void 0 : y.destroy());
              } catch (b) {
                throw (L = this._worker) != null && L.port && delete this._worker._pendingDestroy, b;
              }
              this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
            }
          };
          r = new WeakMap(), le(e, r, 0);
          let PDFDocumentLoadingTask = e;
          exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;
          class PDFDataRangeTransport {
            constructor(m, y, L = !1, b = null) {
              this.length = m, this.initialData = y, this.progressiveDone = L, this.contentDispositionFilename = b, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._progressiveDoneListeners = [], this._readyCapability = new _util.PromiseCapability();
            }
            addRangeListener(m) {
              this._rangeListeners.push(m);
            }
            addProgressListener(m) {
              this._progressListeners.push(m);
            }
            addProgressiveReadListener(m) {
              this._progressiveReadListeners.push(m);
            }
            addProgressiveDoneListener(m) {
              this._progressiveDoneListeners.push(m);
            }
            onDataRange(m, y) {
              for (const L of this._rangeListeners)
                L(m, y);
            }
            onDataProgress(m, y) {
              this._readyCapability.promise.then(() => {
                for (const L of this._progressListeners)
                  L(m, y);
              });
            }
            onDataProgressiveRead(m) {
              this._readyCapability.promise.then(() => {
                for (const y of this._progressiveReadListeners)
                  y(m);
              });
            }
            onDataProgressiveDone() {
              this._readyCapability.promise.then(() => {
                for (const m of this._progressiveDoneListeners)
                  m();
              });
            }
            transportReady() {
              this._readyCapability.resolve();
            }
            requestDataRange(m, y) {
              (0, _util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
            abort() {
            }
          }
          exports.PDFDataRangeTransport = PDFDataRangeTransport;
          class PDFDocumentProxy {
            constructor(m, y) {
              this._pdfInfo = m, this._transport = y, Object.defineProperty(this, "getJavaScript", {
                value: () => ((0, _display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."), this.getJSActions().then((L) => {
                  if (!L)
                    return L;
                  const b = [];
                  for (const P in L)
                    b.push(...L[P]);
                  return b;
                }))
              });
            }
            get annotationStorage() {
              return this._transport.annotationStorage;
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get numPages() {
              return this._pdfInfo.numPages;
            }
            get fingerprints() {
              return this._pdfInfo.fingerprints;
            }
            get isPureXfa() {
              return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            get allXfaHtml() {
              return this._transport._htmlForXfa;
            }
            getPage(m) {
              return this._transport.getPage(m);
            }
            getPageIndex(m) {
              return this._transport.getPageIndex(m);
            }
            getDestinations() {
              return this._transport.getDestinations();
            }
            getDestination(m) {
              return this._transport.getDestination(m);
            }
            getPageLabels() {
              return this._transport.getPageLabels();
            }
            getPageLayout() {
              return this._transport.getPageLayout();
            }
            getPageMode() {
              return this._transport.getPageMode();
            }
            getViewerPreferences() {
              return this._transport.getViewerPreferences();
            }
            getOpenAction() {
              return this._transport.getOpenAction();
            }
            getAttachments() {
              return this._transport.getAttachments();
            }
            getJSActions() {
              return this._transport.getDocJSActions();
            }
            getOutline() {
              return this._transport.getOutline();
            }
            getOptionalContentConfig() {
              return this._transport.getOptionalContentConfig();
            }
            getPermissions() {
              return this._transport.getPermissions();
            }
            getMetadata() {
              return this._transport.getMetadata();
            }
            getMarkInfo() {
              return this._transport.getMarkInfo();
            }
            getData() {
              return this._transport.getData();
            }
            saveDocument() {
              return this._transport.saveDocument();
            }
            getDownloadInfo() {
              return this._transport.downloadInfoCapability.promise;
            }
            cleanup(m = !1) {
              return this._transport.startCleanup(m || this.isPureXfa);
            }
            destroy() {
              return this.loadingTask.destroy();
            }
            get loadingParams() {
              return this._transport.loadingParams;
            }
            get loadingTask() {
              return this._transport.loadingTask;
            }
            getFieldObjects() {
              return this._transport.getFieldObjects();
            }
            hasJSActions() {
              return this._transport.hasJSActions();
            }
            getCalculationOrderIds() {
              return this._transport.getCalculationOrderIds();
            }
          }
          exports.PDFDocumentProxy = PDFDocumentProxy;
          class PDFPageProxy {
            constructor(m, y, L, b = !1) {
              le(this, i);
              le(this, n, null);
              le(this, t, !1);
              this._pageIndex = m, this._pageInfo = y, this._transport = L, this._stats = b ? new _display_utils.StatTimer() : null, this._pdfBug = b, this.commonObjs = L.commonObjs, this.objs = new PDFObjects(), this._maybeCleanupAfterRender = !1, this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1;
            }
            get pageNumber() {
              return this._pageIndex + 1;
            }
            get rotate() {
              return this._pageInfo.rotate;
            }
            get ref() {
              return this._pageInfo.ref;
            }
            get userUnit() {
              return this._pageInfo.userUnit;
            }
            get view() {
              return this._pageInfo.view;
            }
            getViewport({
              scale: m,
              rotation: y = this.rotate,
              offsetX: L = 0,
              offsetY: b = 0,
              dontFlip: P = !1
            } = {}) {
              return new _display_utils.PageViewport({
                viewBox: this.view,
                scale: m,
                rotation: y,
                offsetX: L,
                offsetY: b,
                dontFlip: P
              });
            }
            getAnnotations({
              intent: m = "display"
            } = {}) {
              const y = this._transport.getRenderingIntent(m);
              return this._transport.getAnnotations(this._pageIndex, y.renderingIntent);
            }
            getJSActions() {
              return this._transport.getPageJSActions(this._pageIndex);
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get isPureXfa() {
              return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            async getXfa() {
              var m;
              return ((m = this._transport._htmlForXfa) == null ? void 0 : m.children[this._pageIndex]) || null;
            }
            render({
              canvasContext: m,
              viewport: y,
              intent: L = "display",
              annotationMode: b = _util.AnnotationMode.ENABLE,
              transform: P = null,
              background: j = null,
              optionalContentConfigPromise: re = null,
              annotationCanvasMap: X = null,
              pageColors: Q = null,
              printAnnotationStorage: q = null
            }) {
              var A, k;
              (A = this._stats) == null || A.time("Overall");
              const ie = this._transport.getRenderingIntent(L, b, q);
              he(this, t, !1), Z(this, i, Dt).call(this), re || (re = this._transport.getOptionalContentConfig());
              let O = this._intentStates.get(ie.cacheKey);
              O || (O = /* @__PURE__ */ Object.create(null), this._intentStates.set(ie.cacheKey, O)), O.streamReaderCancelTimeout && (clearTimeout(O.streamReaderCancelTimeout), O.streamReaderCancelTimeout = null);
              const G = !!(ie.renderingIntent & _util.RenderingIntentFlag.PRINT);
              O.displayReadyCapability || (O.displayReadyCapability = new _util.PromiseCapability(), O.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (k = this._stats) == null || k.time("Page Request"), this._pumpOperatorList(ie));
              const K = (N) => {
                var $, z;
                O.renderTasks.delete(M), (this._maybeCleanupAfterRender || G) && he(this, t, !0), Z(this, i, dt).call(this, !G), N ? (M.capability.reject(N), this._abortOperatorList({
                  intentState: O,
                  reason: N instanceof Error ? N : new Error(N)
                })) : M.capability.resolve(), ($ = this._stats) == null || $.timeEnd("Rendering"), (z = this._stats) == null || z.timeEnd("Overall");
              }, M = new InternalRenderTask({
                callback: K,
                params: {
                  canvasContext: m,
                  viewport: y,
                  transform: P,
                  background: j
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                annotationCanvasMap: X,
                operatorList: O.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: this._transport.canvasFactory,
                filterFactory: this._transport.filterFactory,
                useRequestAnimationFrame: !G,
                pdfBug: this._pdfBug,
                pageColors: Q
              });
              (O.renderTasks || (O.renderTasks = /* @__PURE__ */ new Set())).add(M);
              const _ = M.task;
              return Promise.all([O.displayReadyCapability.promise, re]).then(([N, $]) => {
                var z;
                if (this.destroyed) {
                  K();
                  return;
                }
                (z = this._stats) == null || z.time("Rendering"), M.initializeGraphics({
                  transparency: N,
                  optionalContentConfig: $
                }), M.operatorListChanged();
              }).catch(K), _;
            }
            getOperatorList({
              intent: m = "display",
              annotationMode: y = _util.AnnotationMode.ENABLE,
              printAnnotationStorage: L = null
            } = {}) {
              var X;
              function b() {
                j.operatorList.lastChunk && (j.opListReadCapability.resolve(j.operatorList), j.renderTasks.delete(re));
              }
              const P = this._transport.getRenderingIntent(m, y, L, !0);
              let j = this._intentStates.get(P.cacheKey);
              j || (j = /* @__PURE__ */ Object.create(null), this._intentStates.set(P.cacheKey, j));
              let re;
              return j.opListReadCapability || (re = /* @__PURE__ */ Object.create(null), re.operatorListChanged = b, j.opListReadCapability = new _util.PromiseCapability(), (j.renderTasks || (j.renderTasks = /* @__PURE__ */ new Set())).add(re), j.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (X = this._stats) == null || X.time("Page Request"), this._pumpOperatorList(P)), j.opListReadCapability.promise;
            }
            streamTextContent({
              includeMarkedContent: m = !1,
              disableNormalization: y = !1
            } = {}) {
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                includeMarkedContent: m === !0,
                disableNormalization: y === !0
              }, {
                highWaterMark: 100,
                size(b) {
                  return b.items.length;
                }
              });
            }
            getTextContent(m = {}) {
              if (this._transport._htmlForXfa)
                return this.getXfa().then((L) => _xfa_text.XfaText.textContent(L));
              const y = this.streamTextContent(m);
              return new Promise(function(L, b) {
                function P() {
                  j.read().then(function({
                    value: X,
                    done: Q
                  }) {
                    if (Q) {
                      L(re);
                      return;
                    }
                    Object.assign(re.styles, X.styles), re.items.push(...X.items), P();
                  }, b);
                }
                const j = y.getReader(), re = {
                  items: [],
                  styles: /* @__PURE__ */ Object.create(null)
                };
                P();
              });
            }
            getStructTree() {
              return this._transport.getStructTree(this._pageIndex);
            }
            _destroy() {
              this.destroyed = !0;
              const m = [];
              for (const y of this._intentStates.values())
                if (this._abortOperatorList({
                  intentState: y,
                  reason: new Error("Page was destroyed."),
                  force: !0
                }), !y.opListReadCapability)
                  for (const L of y.renderTasks)
                    m.push(L.completed), L.cancel();
              return this.objs.clear(), he(this, t, !1), Z(this, i, Dt).call(this), Promise.all(m);
            }
            cleanup(m = !1) {
              he(this, t, !0);
              const y = Z(this, i, dt).call(this, !1);
              return m && y && this._stats && (this._stats = new _display_utils.StatTimer()), y;
            }
            _startRenderPage(m, y) {
              var b, P;
              const L = this._intentStates.get(y);
              L && ((b = this._stats) == null || b.timeEnd("Page Request"), (P = L.displayReadyCapability) == null || P.resolve(m));
            }
            _renderPageChunk(m, y) {
              for (let L = 0, b = m.length; L < b; L++)
                y.operatorList.fnArray.push(m.fnArray[L]), y.operatorList.argsArray.push(m.argsArray[L]);
              y.operatorList.lastChunk = m.lastChunk, y.operatorList.separateAnnots = m.separateAnnots;
              for (const L of y.renderTasks)
                L.operatorListChanged();
              m.lastChunk && Z(this, i, dt).call(this, !0);
            }
            _pumpOperatorList({
              renderingIntent: m,
              cacheKey: y,
              annotationStorageSerializable: L
            }) {
              const {
                map: b,
                transfers: P
              } = L, re = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: m,
                cacheKey: y,
                annotationStorage: b
              }, P).getReader(), X = this._intentStates.get(y);
              X.streamReader = re;
              const Q = () => {
                re.read().then(({
                  value: q,
                  done: ie
                }) => {
                  if (ie) {
                    X.streamReader = null;
                    return;
                  }
                  this._transport.destroyed || (this._renderPageChunk(q, X), Q());
                }, (q) => {
                  if (X.streamReader = null, !this._transport.destroyed) {
                    if (X.operatorList) {
                      X.operatorList.lastChunk = !0;
                      for (const ie of X.renderTasks)
                        ie.operatorListChanged();
                      Z(this, i, dt).call(this, !0);
                    }
                    if (X.displayReadyCapability)
                      X.displayReadyCapability.reject(q);
                    else if (X.opListReadCapability)
                      X.opListReadCapability.reject(q);
                    else
                      throw q;
                  }
                });
              };
              Q();
            }
            _abortOperatorList({
              intentState: m,
              reason: y,
              force: L = !1
            }) {
              if (m.streamReader) {
                if (m.streamReaderCancelTimeout && (clearTimeout(m.streamReaderCancelTimeout), m.streamReaderCancelTimeout = null), !L) {
                  if (m.renderTasks.size > 0)
                    return;
                  if (y instanceof _display_utils.RenderingCancelledException) {
                    let b = RENDERING_CANCELLED_TIMEOUT;
                    y.extraDelay > 0 && y.extraDelay < 1e3 && (b += y.extraDelay), m.streamReaderCancelTimeout = setTimeout(() => {
                      m.streamReaderCancelTimeout = null, this._abortOperatorList({
                        intentState: m,
                        reason: y,
                        force: !0
                      });
                    }, b);
                    return;
                  }
                }
                if (m.streamReader.cancel(new _util.AbortException(y.message)).catch(() => {
                }), m.streamReader = null, !this._transport.destroyed) {
                  for (const [b, P] of this._intentStates)
                    if (P === m) {
                      this._intentStates.delete(b);
                      break;
                    }
                  this.cleanup();
                }
              }
            }
            get stats() {
              return this._stats;
            }
          }
          n = new WeakMap(), t = new WeakMap(), i = new WeakSet(), dt = function(m = !1) {
            if (Z(this, i, Dt).call(this), !c(this, t) || this.destroyed)
              return !1;
            if (m)
              return he(this, n, setTimeout(() => {
                he(this, n, null), Z(this, i, dt).call(this, !1);
              }, DELAYED_CLEANUP_TIMEOUT)), !1;
            for (const {
              renderTasks: y,
              operatorList: L
            } of this._intentStates.values())
              if (y.size > 0 || !L.lastChunk)
                return !1;
            return this._intentStates.clear(), this.objs.clear(), he(this, t, !1), !0;
          }, Dt = function() {
            c(this, n) && (clearTimeout(c(this, n)), he(this, n, null));
          }, exports.PDFPageProxy = PDFPageProxy;
          class LoopbackPort {
            constructor() {
              le(this, h, /* @__PURE__ */ new Set());
              le(this, u, Promise.resolve());
            }
            postMessage(m, y) {
              const L = {
                data: structuredClone(m, y ? {
                  transfer: y
                } : null)
              };
              c(this, u).then(() => {
                for (const b of c(this, h))
                  b.call(this, L);
              });
            }
            addEventListener(m, y) {
              c(this, h).add(y);
            }
            removeEventListener(m, y) {
              c(this, h).delete(y);
            }
            terminate() {
              c(this, h).clear();
            }
          }
          h = new WeakMap(), u = new WeakMap(), exports.LoopbackPort = LoopbackPort;
          const PDFWorkerUtil = {
            isWorkerDisabled: !1,
            fallbackWorkerSrc: null,
            fakeWorkerId: 0
          };
          exports.PDFWorkerUtil = PDFWorkerUtil;
          {
            if (_util.isNodeJS && typeof commonjsRequire == "function")
              PDFWorkerUtil.isWorkerDisabled = !0, PDFWorkerUtil.fallbackWorkerSrc = "./pdf.worker.js";
            else if (typeof document == "object") {
              const g = (l = document == null ? void 0 : document.currentScript) == null ? void 0 : l.src;
              g && (PDFWorkerUtil.fallbackWorkerSrc = g.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2"));
            }
            PDFWorkerUtil.isSameOrigin = function(g, m) {
              let y;
              try {
                if (y = new URL(g), !y.origin || y.origin === "null")
                  return !1;
              } catch {
                return !1;
              }
              const L = new URL(m, y);
              return y.origin === L.origin;
            }, PDFWorkerUtil.createCDNWrapper = function(g) {
              const m = `importScripts("${g}");`;
              return URL.createObjectURL(new Blob([m]));
            };
          }
          const _PDFWorker = class _PDFWorker {
            constructor({
              name: g = null,
              port: m = null,
              verbosity: y = (0, _util.getVerbosityLevel)()
            } = {}) {
              var L;
              if (this.name = g, this.destroyed = !1, this.verbosity = y, this._readyCapability = new _util.PromiseCapability(), this._port = null, this._webWorker = null, this._messageHandler = null, m) {
                if ((L = c(_PDFWorker, o)) != null && L.has(m))
                  throw new Error("Cannot use more than one PDFWorker per port.");
                (c(_PDFWorker, o) || he(_PDFWorker, o, /* @__PURE__ */ new WeakMap())).set(m, this), this._initializeFromPort(m);
                return;
              }
              this._initialize();
            }
            get promise() {
              return this._readyCapability.promise;
            }
            get port() {
              return this._port;
            }
            get messageHandler() {
              return this._messageHandler;
            }
            _initializeFromPort(g) {
              this._port = g, this._messageHandler = new _message_handler.MessageHandler("main", "worker", g), this._messageHandler.on("ready", function() {
              }), this._readyCapability.resolve(), this._messageHandler.send("configure", {
                verbosity: this.verbosity
              });
            }
            _initialize() {
              if (!PDFWorkerUtil.isWorkerDisabled && !_PDFWorker._mainThreadWorkerMessageHandler) {
                let {
                  workerSrc: g
                } = _PDFWorker;
                try {
                  PDFWorkerUtil.isSameOrigin(window.location.href, g) || (g = PDFWorkerUtil.createCDNWrapper(new URL(g, window.location).href));
                  const m = new Worker(g), y = new _message_handler.MessageHandler("main", "worker", m), L = () => {
                    m.removeEventListener("error", b), y.destroy(), m.terminate(), this.destroyed ? this._readyCapability.reject(new Error("Worker was destroyed")) : this._setupFakeWorker();
                  }, b = () => {
                    this._webWorker || L();
                  };
                  m.addEventListener("error", b), y.on("test", (j) => {
                    if (m.removeEventListener("error", b), this.destroyed) {
                      L();
                      return;
                    }
                    j ? (this._messageHandler = y, this._port = m, this._webWorker = m, this._readyCapability.resolve(), y.send("configure", {
                      verbosity: this.verbosity
                    })) : (this._setupFakeWorker(), y.destroy(), m.terminate());
                  }), y.on("ready", (j) => {
                    if (m.removeEventListener("error", b), this.destroyed) {
                      L();
                      return;
                    }
                    try {
                      P();
                    } catch {
                      this._setupFakeWorker();
                    }
                  });
                  const P = () => {
                    const j = new Uint8Array();
                    y.send("test", j, [j.buffer]);
                  };
                  P();
                  return;
                } catch {
                  (0, _util.info)("The worker has been disabled.");
                }
              }
              this._setupFakeWorker();
            }
            _setupFakeWorker() {
              PDFWorkerUtil.isWorkerDisabled || ((0, _util.warn)("Setting up fake worker."), PDFWorkerUtil.isWorkerDisabled = !0), _PDFWorker._setupFakeWorkerGlobal.then((g) => {
                if (this.destroyed) {
                  this._readyCapability.reject(new Error("Worker was destroyed"));
                  return;
                }
                const m = new LoopbackPort();
                this._port = m;
                const y = `fake${PDFWorkerUtil.fakeWorkerId++}`, L = new _message_handler.MessageHandler(y + "_worker", y, m);
                g.setup(L, m);
                const b = new _message_handler.MessageHandler(y, y + "_worker", m);
                this._messageHandler = b, this._readyCapability.resolve(), b.send("configure", {
                  verbosity: this.verbosity
                });
              }).catch((g) => {
                this._readyCapability.reject(new Error(`Setting up fake worker failed: "${g.message}".`));
              });
            }
            destroy() {
              var g;
              this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), (g = c(_PDFWorker, o)) == null || g.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
            }
            static fromPort(g) {
              var y;
              if (!(g != null && g.port))
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              const m = (y = c(this, o)) == null ? void 0 : y.get(g.port);
              if (m) {
                if (m._pendingDestroy)
                  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
                return m;
              }
              return new _PDFWorker(g);
            }
            static get workerSrc() {
              if (_worker_options.GlobalWorkerOptions.workerSrc)
                return _worker_options.GlobalWorkerOptions.workerSrc;
              if (PDFWorkerUtil.fallbackWorkerSrc !== null)
                return _util.isNodeJS || (0, _display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'), PDFWorkerUtil.fallbackWorkerSrc;
              throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
            }
            static get _mainThreadWorkerMessageHandler() {
              var g;
              try {
                return ((g = globalThis.pdfjsWorker) == null ? void 0 : g.WorkerMessageHandler) || null;
              } catch {
                return null;
              }
            }
            static get _setupFakeWorkerGlobal() {
              const loader = async () => {
                const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;
                if (mainWorkerMessageHandler)
                  return mainWorkerMessageHandler;
                if (_util.isNodeJS && typeof commonjsRequire == "function") {
                  const worker = eval("require")(this.workerSrc);
                  return worker.WorkerMessageHandler;
                }
                return await (0, _display_utils.loadScript)(this.workerSrc), window.pdfjsWorker.WorkerMessageHandler;
              };
              return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader());
            }
          };
          o = new WeakMap(), le(_PDFWorker, o);
          let PDFWorker = _PDFWorker;
          exports.PDFWorker = PDFWorker;
          class WorkerTransport {
            constructor(m, y, L, b, P) {
              le(this, T);
              le(this, w, /* @__PURE__ */ new Map());
              le(this, x, /* @__PURE__ */ new Map());
              le(this, C, /* @__PURE__ */ new Map());
              le(this, S, null);
              this.messageHandler = m, this.loadingTask = y, this.commonObjs = new PDFObjects(), this.fontLoader = new _font_loader.FontLoader({
                ownerDocument: b.ownerDocument,
                styleElement: b.styleElement
              }), this._params = b, this.canvasFactory = P.canvasFactory, this.filterFactory = P.filterFactory, this.cMapReaderFactory = P.cMapReaderFactory, this.standardFontDataFactory = P.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = L, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = new _util.PromiseCapability(), this.setupMessageHandler();
            }
            get annotationStorage() {
              return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage());
            }
            getRenderingIntent(m, y = _util.AnnotationMode.ENABLE, L = null, b = !1) {
              let P = _util.RenderingIntentFlag.DISPLAY, j = _annotation_storage.SerializableEmpty;
              switch (m) {
                case "any":
                  P = _util.RenderingIntentFlag.ANY;
                  break;
                case "display":
                  break;
                case "print":
                  P = _util.RenderingIntentFlag.PRINT;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid intent: ${m}`);
              }
              switch (y) {
                case _util.AnnotationMode.DISABLE:
                  P += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;
                case _util.AnnotationMode.ENABLE:
                  break;
                case _util.AnnotationMode.ENABLE_FORMS:
                  P += _util.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;
                case _util.AnnotationMode.ENABLE_STORAGE:
                  P += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE, j = (P & _util.RenderingIntentFlag.PRINT && L instanceof _annotation_storage.PrintAnnotationStorage ? L : this.annotationStorage).serializable;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid annotationMode: ${y}`);
              }
              return b && (P += _util.RenderingIntentFlag.OPLIST), {
                renderingIntent: P,
                cacheKey: `${P}_${j.hash}`,
                annotationStorageSerializable: j
              };
            }
            destroy() {
              var L;
              if (this.destroyCapability)
                return this.destroyCapability.promise;
              this.destroyed = !0, this.destroyCapability = new _util.PromiseCapability(), (L = c(this, S)) == null || L.reject(new Error("Worker was destroyed during onPassword callback"));
              const m = [];
              for (const b of c(this, x).values())
                m.push(b._destroy());
              c(this, x).clear(), c(this, C).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
              const y = this.messageHandler.sendWithPromise("Terminate", null);
              return m.push(y), Promise.all(m).then(() => {
                var b;
                this.commonObjs.clear(), this.fontLoader.clear(), c(this, w).clear(), this.filterFactory.destroy(), (b = this._networkStream) == null || b.cancelAllRequests(new _util.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
              }, this.destroyCapability.reject), this.destroyCapability.promise;
            }
            setupMessageHandler() {
              const {
                messageHandler: m,
                loadingTask: y
              } = this;
              m.on("GetReader", (L, b) => {
                (0, _util.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (P) => {
                  this._lastProgress = {
                    loaded: P.loaded,
                    total: P.total
                  };
                }, b.onPull = () => {
                  this._fullReader.read().then(function({
                    value: P,
                    done: j
                  }) {
                    if (j) {
                      b.close();
                      return;
                    }
                    (0, _util.assert)(P instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), b.enqueue(new Uint8Array(P), 1, [P]);
                  }).catch((P) => {
                    b.error(P);
                  });
                }, b.onCancel = (P) => {
                  this._fullReader.cancel(P), b.ready.catch((j) => {
                    if (!this.destroyed)
                      throw j;
                  });
                };
              }), m.on("ReaderHeadersReady", (L) => {
                const b = new _util.PromiseCapability(), P = this._fullReader;
                return P.headersReady.then(() => {
                  var j;
                  (!P.isStreamingSupported || !P.isRangeSupported) && (this._lastProgress && ((j = y.onProgress) == null || j.call(y, this._lastProgress)), P.onProgress = (re) => {
                    var X;
                    (X = y.onProgress) == null || X.call(y, {
                      loaded: re.loaded,
                      total: re.total
                    });
                  }), b.resolve({
                    isStreamingSupported: P.isStreamingSupported,
                    isRangeSupported: P.isRangeSupported,
                    contentLength: P.contentLength
                  });
                }, b.reject), b.promise;
              }), m.on("GetRangeReader", (L, b) => {
                (0, _util.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
                const P = this._networkStream.getRangeReader(L.begin, L.end);
                if (!P) {
                  b.close();
                  return;
                }
                b.onPull = () => {
                  P.read().then(function({
                    value: j,
                    done: re
                  }) {
                    if (re) {
                      b.close();
                      return;
                    }
                    (0, _util.assert)(j instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), b.enqueue(new Uint8Array(j), 1, [j]);
                  }).catch((j) => {
                    b.error(j);
                  });
                }, b.onCancel = (j) => {
                  P.cancel(j), b.ready.catch((re) => {
                    if (!this.destroyed)
                      throw re;
                  });
                };
              }), m.on("GetDoc", ({
                pdfInfo: L
              }) => {
                this._numPages = L.numPages, this._htmlForXfa = L.htmlForXfa, delete L.htmlForXfa, y._capability.resolve(new PDFDocumentProxy(L, this));
              }), m.on("DocException", function(L) {
                let b;
                switch (L.name) {
                  case "PasswordException":
                    b = new _util.PasswordException(L.message, L.code);
                    break;
                  case "InvalidPDFException":
                    b = new _util.InvalidPDFException(L.message);
                    break;
                  case "MissingPDFException":
                    b = new _util.MissingPDFException(L.message);
                    break;
                  case "UnexpectedResponseException":
                    b = new _util.UnexpectedResponseException(L.message, L.status);
                    break;
                  case "UnknownErrorException":
                    b = new _util.UnknownErrorException(L.message, L.details);
                    break;
                  default:
                    (0, _util.unreachable)("DocException - expected a valid Error.");
                }
                y._capability.reject(b);
              }), m.on("PasswordRequest", (L) => {
                if (he(this, S, new _util.PromiseCapability()), y.onPassword) {
                  const b = (P) => {
                    P instanceof Error ? c(this, S).reject(P) : c(this, S).resolve({
                      password: P
                    });
                  };
                  try {
                    y.onPassword(b, L.code);
                  } catch (P) {
                    c(this, S).reject(P);
                  }
                } else
                  c(this, S).reject(new _util.PasswordException(L.message, L.code));
                return c(this, S).promise;
              }), m.on("DataLoaded", (L) => {
                var b;
                (b = y.onProgress) == null || b.call(y, {
                  loaded: L.length,
                  total: L.length
                }), this.downloadInfoCapability.resolve(L);
              }), m.on("StartRenderPage", (L) => {
                if (this.destroyed)
                  return;
                c(this, x).get(L.pageIndex)._startRenderPage(L.transparency, L.cacheKey);
              }), m.on("commonobj", ([L, b, P]) => {
                var j;
                if (!this.destroyed && !this.commonObjs.has(L))
                  switch (b) {
                    case "Font":
                      const re = this._params;
                      if ("error" in P) {
                        const q = P.error;
                        (0, _util.warn)(`Error during font loading: ${q}`), this.commonObjs.resolve(L, q);
                        break;
                      }
                      const X = re.pdfBug && ((j = globalThis.FontInspector) != null && j.enabled) ? (q, ie) => globalThis.FontInspector.fontAdded(q, ie) : null, Q = new _font_loader.FontFaceObject(P, {
                        isEvalSupported: re.isEvalSupported,
                        disableFontFace: re.disableFontFace,
                        ignoreErrors: re.ignoreErrors,
                        inspectFont: X
                      });
                      this.fontLoader.bind(Q).catch((q) => m.sendWithPromise("FontFallback", {
                        id: L
                      })).finally(() => {
                        !re.fontExtraProperties && Q.data && (Q.data = null), this.commonObjs.resolve(L, Q);
                      });
                      break;
                    case "FontPath":
                    case "Image":
                    case "Pattern":
                      this.commonObjs.resolve(L, P);
                      break;
                    default:
                      throw new Error(`Got unknown common object type ${b}`);
                  }
              }), m.on("obj", ([L, b, P, j]) => {
                var X;
                if (this.destroyed)
                  return;
                const re = c(this, x).get(b);
                if (!re.objs.has(L))
                  switch (P) {
                    case "Image":
                      if (re.objs.resolve(L, j), j) {
                        let Q;
                        if (j.bitmap) {
                          const {
                            width: q,
                            height: ie
                          } = j;
                          Q = q * ie * 4;
                        } else
                          Q = ((X = j.data) == null ? void 0 : X.length) || 0;
                        Q > _util.MAX_IMAGE_SIZE_TO_CACHE && (re._maybeCleanupAfterRender = !0);
                      }
                      break;
                    case "Pattern":
                      re.objs.resolve(L, j);
                      break;
                    default:
                      throw new Error(`Got unknown object type ${P}`);
                  }
              }), m.on("DocProgress", (L) => {
                var b;
                this.destroyed || (b = y.onProgress) == null || b.call(y, {
                  loaded: L.loaded,
                  total: L.total
                });
              }), m.on("FetchBuiltInCMap", (L) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.cMapReaderFactory ? this.cMapReaderFactory.fetch(L) : Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))), m.on("FetchStandardFontData", (L) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.standardFontDataFactory ? this.standardFontDataFactory.fetch(L) : Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")));
            }
            getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
            saveDocument() {
              var L;
              this.annotationStorage.size <= 0 && (0, _util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
              const {
                map: m,
                transfers: y
              } = this.annotationStorage.serializable;
              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: m,
                filename: ((L = this._fullReader) == null ? void 0 : L.filename) ?? null
              }, y).finally(() => {
                this.annotationStorage.resetModified();
              });
            }
            getPage(m) {
              if (!Number.isInteger(m) || m <= 0 || m > this._numPages)
                return Promise.reject(new Error("Invalid page request."));
              const y = m - 1, L = c(this, C).get(y);
              if (L)
                return L;
              const b = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: y
              }).then((P) => {
                if (this.destroyed)
                  throw new Error("Transport destroyed");
                const j = new PDFPageProxy(y, P, this, this._params.pdfBug);
                return c(this, x).set(y, j), j;
              });
              return c(this, C).set(y, b), b;
            }
            getPageIndex(m) {
              return typeof m != "object" || m === null || !Number.isInteger(m.num) || m.num < 0 || !Number.isInteger(m.gen) || m.gen < 0 ? Promise.reject(new Error("Invalid pageIndex request.")) : this.messageHandler.sendWithPromise("GetPageIndex", {
                num: m.num,
                gen: m.gen
              });
            }
            getAnnotations(m, y) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: m,
                intent: y
              });
            }
            getFieldObjects() {
              return Z(this, T, Ft).call(this, "GetFieldObjects");
            }
            hasJSActions() {
              return Z(this, T, Ft).call(this, "HasJSActions");
            }
            getCalculationOrderIds() {
              return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
            }
            getDestinations() {
              return this.messageHandler.sendWithPromise("GetDestinations", null);
            }
            getDestination(m) {
              return typeof m != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
                id: m
              });
            }
            getPageLabels() {
              return this.messageHandler.sendWithPromise("GetPageLabels", null);
            }
            getPageLayout() {
              return this.messageHandler.sendWithPromise("GetPageLayout", null);
            }
            getPageMode() {
              return this.messageHandler.sendWithPromise("GetPageMode", null);
            }
            getViewerPreferences() {
              return this.messageHandler.sendWithPromise("GetViewerPreferences", null);
            }
            getOpenAction() {
              return this.messageHandler.sendWithPromise("GetOpenAction", null);
            }
            getAttachments() {
              return this.messageHandler.sendWithPromise("GetAttachments", null);
            }
            getDocJSActions() {
              return Z(this, T, Ft).call(this, "GetDocJSActions");
            }
            getPageJSActions(m) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: m
              });
            }
            getStructTree(m) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: m
              });
            }
            getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
            getOptionalContentConfig() {
              return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then((m) => new _optional_content_config.OptionalContentConfig(m));
            }
            getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
            getMetadata() {
              const m = "GetMetadata", y = c(this, w).get(m);
              if (y)
                return y;
              const L = this.messageHandler.sendWithPromise(m, null).then((b) => {
                var P, j;
                return {
                  info: b[0],
                  metadata: b[1] ? new _metadata.Metadata(b[1]) : null,
                  contentDispositionFilename: ((P = this._fullReader) == null ? void 0 : P.filename) ?? null,
                  contentLength: ((j = this._fullReader) == null ? void 0 : j.contentLength) ?? null
                };
              });
              return c(this, w).set(m, L), L;
            }
            getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
            async startCleanup(m = !1) {
              if (!this.destroyed) {
                await this.messageHandler.sendWithPromise("Cleanup", null);
                for (const y of c(this, x).values())
                  if (!y.cleanup())
                    throw new Error(`startCleanup: Page ${y.pageNumber} is currently rendering.`);
                this.commonObjs.clear(), m || this.fontLoader.clear(), c(this, w).clear(), this.filterFactory.destroy(!0);
              }
            }
            get loadingParams() {
              const {
                disableAutoFetch: m,
                enableXfa: y
              } = this._params;
              return (0, _util.shadow)(this, "loadingParams", {
                disableAutoFetch: m,
                enableXfa: y
              });
            }
          }
          w = new WeakMap(), x = new WeakMap(), C = new WeakMap(), S = new WeakMap(), T = new WeakSet(), Ft = function(m, y = null) {
            const L = c(this, w).get(m);
            if (L)
              return L;
            const b = this.messageHandler.sendWithPromise(m, y);
            return c(this, w).set(m, b), b;
          };
          class PDFObjects {
            constructor() {
              le(this, f);
              le(this, F, /* @__PURE__ */ Object.create(null));
            }
            get(m, y = null) {
              if (y) {
                const b = Z(this, f, Ht).call(this, m);
                return b.capability.promise.then(() => y(b.data)), null;
              }
              const L = c(this, F)[m];
              if (!(L != null && L.capability.settled))
                throw new Error(`Requesting object that isn't resolved yet ${m}.`);
              return L.data;
            }
            has(m) {
              const y = c(this, F)[m];
              return (y == null ? void 0 : y.capability.settled) || !1;
            }
            resolve(m, y = null) {
              const L = Z(this, f, Ht).call(this, m);
              L.data = y, L.capability.resolve();
            }
            clear() {
              var m;
              for (const y in c(this, F)) {
                const {
                  data: L
                } = c(this, F)[y];
                (m = L == null ? void 0 : L.bitmap) == null || m.close();
              }
              he(this, F, /* @__PURE__ */ Object.create(null));
            }
          }
          F = new WeakMap(), f = new WeakSet(), Ht = function(m) {
            var y;
            return (y = c(this, F))[m] || (y[m] = {
              capability: new _util.PromiseCapability(),
              data: null
            });
          };
          class RenderTask {
            constructor(m) {
              le(this, v, null);
              he(this, v, m), this.onContinue = null;
            }
            get promise() {
              return c(this, v).capability.promise;
            }
            cancel(m = 0) {
              c(this, v).cancel(null, m);
            }
            get separateAnnots() {
              const {
                separateAnnots: m
              } = c(this, v).operatorList;
              if (!m)
                return !1;
              const {
                annotationCanvasMap: y
              } = c(this, v);
              return m.form || m.canvas && (y == null ? void 0 : y.size) > 0;
            }
          }
          v = new WeakMap(), exports.RenderTask = RenderTask;
          const d = class d {
            constructor({
              callback: m,
              params: y,
              objs: L,
              commonObjs: b,
              annotationCanvasMap: P,
              operatorList: j,
              pageIndex: re,
              canvasFactory: X,
              filterFactory: Q,
              useRequestAnimationFrame: q = !1,
              pdfBug: ie = !1,
              pageColors: O = null
            }) {
              this.callback = m, this.params = y, this.objs = L, this.commonObjs = b, this.annotationCanvasMap = P, this.operatorListIdx = null, this.operatorList = j, this._pageIndex = re, this.canvasFactory = X, this.filterFactory = Q, this._pdfBug = ie, this.pageColors = O, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = q === !0 && typeof window < "u", this.cancelled = !1, this.capability = new _util.PromiseCapability(), this.task = new RenderTask(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = y.canvasContext.canvas;
            }
            get completed() {
              return this.capability.promise.catch(function() {
              });
            }
            initializeGraphics({
              transparency: m = !1,
              optionalContentConfig: y
            }) {
              var re, X;
              if (this.cancelled)
                return;
              if (this._canvas) {
                if (c(d, p).has(this._canvas))
                  throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");
                c(d, p).add(this._canvas);
              }
              this._pdfBug && ((re = globalThis.StepperManager) != null && re.enabled) && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
              const {
                canvasContext: L,
                viewport: b,
                transform: P,
                background: j
              } = this.params;
              this.gfx = new _canvas.CanvasGraphics(L, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: y
              }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
                transform: P,
                viewport: b,
                transparency: m,
                background: j
              }), this.operatorListIdx = 0, this.graphicsReady = !0, (X = this.graphicsReadyCallback) == null || X.call(this);
            }
            cancel(m = null, y = 0) {
              var L;
              this.running = !1, this.cancelled = !0, (L = this.gfx) == null || L.endDrawing(), c(d, p).delete(this._canvas), this.callback(m || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, y));
            }
            operatorListChanged() {
              var m;
              if (!this.graphicsReady) {
                this.graphicsReadyCallback || (this.graphicsReadyCallback = this._continueBound);
                return;
              }
              (m = this.stepper) == null || m.updateOperatorList(this.operatorList), !this.running && this._continue();
            }
            _continue() {
              this.running = !0, !this.cancelled && (this.task.onContinue ? this.task.onContinue(this._scheduleNextBound) : this._scheduleNext());
            }
            _scheduleNext() {
              this._useRequestAnimationFrame ? window.requestAnimationFrame(() => {
                this._nextBound().catch(this._cancelBound);
              }) : Promise.resolve().then(this._nextBound).catch(this._cancelBound);
            }
            async _next() {
              this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), c(d, p).delete(this._canvas), this.callback())));
            }
          };
          p = new WeakMap(), le(d, p, /* @__PURE__ */ new WeakSet());
          let InternalRenderTask = d;
          const version = "3.11.174";
          exports.version = version;
          const build = "ce8716743";
          exports.build = build;
        },
        /* 3 */
        /***/
        (r, e, n) => {
          var l, o, w, Fn, C;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.SerializableEmpty = e.PrintAnnotationStorage = e.AnnotationStorage = void 0;
          var t = n(1), i = n(4), a = n(8);
          const s = Object.freeze({
            map: null,
            hash: "",
            transfers: void 0
          });
          e.SerializableEmpty = s;
          class h {
            constructor() {
              le(this, w);
              le(this, l, !1);
              le(this, o, /* @__PURE__ */ new Map());
              this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
            }
            getValue(T, D) {
              const F = c(this, o).get(T);
              return F === void 0 ? D : Object.assign(D, F);
            }
            getRawValue(T) {
              return c(this, o).get(T);
            }
            remove(T) {
              if (c(this, o).delete(T), c(this, o).size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
                for (const D of c(this, o).values())
                  if (D instanceof i.AnnotationEditor)
                    return;
                this.onAnnotationEditor(null);
              }
            }
            setValue(T, D) {
              const F = c(this, o).get(T);
              let f = !1;
              if (F !== void 0)
                for (const [E, v] of Object.entries(D))
                  F[E] !== v && (f = !0, F[E] = v);
              else
                f = !0, c(this, o).set(T, D);
              f && Z(this, w, Fn).call(this), D instanceof i.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(D.constructor._type);
            }
            has(T) {
              return c(this, o).has(T);
            }
            getAll() {
              return c(this, o).size > 0 ? (0, t.objectFromMap)(c(this, o)) : null;
            }
            setAll(T) {
              for (const [D, F] of Object.entries(T))
                this.setValue(D, F);
            }
            get size() {
              return c(this, o).size;
            }
            resetModified() {
              c(this, l) && (he(this, l, !1), typeof this.onResetModified == "function" && this.onResetModified());
            }
            get print() {
              return new u(this);
            }
            get serializable() {
              if (c(this, o).size === 0)
                return s;
              const T = /* @__PURE__ */ new Map(), D = new a.MurmurHash3_64(), F = [], f = /* @__PURE__ */ Object.create(null);
              let E = !1;
              for (const [v, p] of c(this, o)) {
                const d = p instanceof i.AnnotationEditor ? p.serialize(!1, f) : p;
                d && (T.set(v, d), D.update(`${v}:${JSON.stringify(d)}`), E || (E = !!d.bitmap));
              }
              if (E)
                for (const v of T.values())
                  v.bitmap && F.push(v.bitmap);
              return T.size > 0 ? {
                map: T,
                hash: D.hexdigest(),
                transfers: F
              } : s;
            }
          }
          l = new WeakMap(), o = new WeakMap(), w = new WeakSet(), Fn = function() {
            c(this, l) || (he(this, l, !0), typeof this.onSetModified == "function" && this.onSetModified());
          }, e.AnnotationStorage = h;
          class u extends h {
            constructor(D) {
              super();
              le(this, C);
              const {
                map: F,
                hash: f,
                transfers: E
              } = D.serializable, v = structuredClone(F, E ? {
                transfer: E
              } : null);
              he(this, C, {
                map: v,
                hash: f,
                transfers: E
              });
            }
            get print() {
              (0, t.unreachable)("Should not call PrintAnnotationStorage.print");
            }
            get serializable() {
              return c(this, C);
            }
          }
          C = new WeakMap(), e.PrintAnnotationStorage = u;
        },
        /* 4 */
        /***/
        (r, e, n) => {
          var u, l, o, w, x, C, S, T, D, F, f, E, v, p, d, jt, Wt, y, Gt, qt, Cn, Tn, xn, Xt, Pn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.AnnotationEditor = void 0;
          var t = n(5), i = n(1), a = n(6);
          const q = class q {
            constructor(O) {
              le(this, d);
              le(this, u, "");
              le(this, l, !1);
              le(this, o, null);
              le(this, w, null);
              le(this, x, null);
              le(this, C, !1);
              le(this, S, null);
              le(this, T, this.focusin.bind(this));
              le(this, D, this.focusout.bind(this));
              le(this, F, !1);
              le(this, f, !1);
              le(this, E, !1);
              qe(this, "_initialOptions", /* @__PURE__ */ Object.create(null));
              qe(this, "_uiManager", null);
              qe(this, "_focusEventsAllowed", !0);
              qe(this, "_l10nPromise", null);
              le(this, v, !1);
              le(this, p, q._zIndex++);
              this.constructor === q && (0, i.unreachable)("Cannot initialize AnnotationEditor."), this.parent = O.parent, this.id = O.id, this.width = this.height = null, this.pageIndex = O.parent.pageIndex, this.name = O.name, this.div = null, this._uiManager = O.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = O.isCentered, this._structTreeParentId = null;
              const {
                rotation: G,
                rawDims: {
                  pageWidth: K,
                  pageHeight: M,
                  pageX: _,
                  pageY: A
                }
              } = this.parent.viewport;
              this.rotation = G, this.pageRotation = (360 + G - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [K, M], this.pageTranslation = [_, A];
              const [k, N] = this.parentDimensions;
              this.x = O.x / k, this.y = O.y / N, this.isAttachedToDOM = !1, this.deleted = !1;
            }
            get editorType() {
              return Object.getPrototypeOf(this).constructor._type;
            }
            static get _defaultLineColor() {
              return (0, i.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
            }
            static deleteAnnotationElement(O) {
              const G = new h({
                id: O.parent.getNextId(),
                parent: O.parent,
                uiManager: O._uiManager
              });
              G.annotationElementId = O.annotationElementId, G.deleted = !0, G._uiManager.addToAnnotationStorage(G);
            }
            static initialize(O, G = null) {
              if (q._l10nPromise || (q._l10nPromise = new Map(["editor_alt_text_button_label", "editor_alt_text_edit_button_label", "editor_alt_text_decorative_tooltip"].map((M) => [M, O.get(M)]))), G != null && G.strings)
                for (const M of G.strings)
                  q._l10nPromise.set(M, O.get(M));
              if (q._borderLineWidth !== -1)
                return;
              const K = getComputedStyle(document.documentElement);
              q._borderLineWidth = parseFloat(K.getPropertyValue("--outline-width")) || 0;
            }
            static updateDefaultParams(O, G) {
            }
            static get defaultPropertiesToUpdate() {
              return [];
            }
            static isHandlingMimeForPasting(O) {
              return !1;
            }
            static paste(O, G) {
              (0, i.unreachable)("Not implemented");
            }
            get propertiesToUpdate() {
              return [];
            }
            get _isDraggable() {
              return c(this, v);
            }
            set _isDraggable(O) {
              var G;
              he(this, v, O), (G = this.div) == null || G.classList.toggle("draggable", O);
            }
            center() {
              const [O, G] = this.pageDimensions;
              switch (this.parentRotation) {
                case 90:
                  this.x -= this.height * G / (O * 2), this.y += this.width * O / (G * 2);
                  break;
                case 180:
                  this.x += this.width / 2, this.y += this.height / 2;
                  break;
                case 270:
                  this.x += this.height * G / (O * 2), this.y -= this.width * O / (G * 2);
                  break;
                default:
                  this.x -= this.width / 2, this.y -= this.height / 2;
                  break;
              }
              this.fixAndSetPosition();
            }
            addCommands(O) {
              this._uiManager.addCommands(O);
            }
            get currentLayer() {
              return this._uiManager.currentLayer;
            }
            setInBackground() {
              this.div.style.zIndex = 0;
            }
            setInForeground() {
              this.div.style.zIndex = c(this, p);
            }
            setParent(O) {
              O !== null && (this.pageIndex = O.pageIndex, this.pageDimensions = O.pageDimensions), this.parent = O;
            }
            focusin(O) {
              this._focusEventsAllowed && (c(this, F) ? he(this, F, !1) : this.parent.setSelected(this));
            }
            focusout(O) {
              var K;
              if (!this._focusEventsAllowed || !this.isAttachedToDOM)
                return;
              const G = O.relatedTarget;
              G != null && G.closest(`#${this.id}`) || (O.preventDefault(), (K = this.parent) != null && K.isMultipleSelection || this.commitOrRemove());
            }
            commitOrRemove() {
              this.isEmpty() ? this.remove() : this.commit();
            }
            commit() {
              this.addToAnnotationStorage();
            }
            addToAnnotationStorage() {
              this._uiManager.addToAnnotationStorage(this);
            }
            setAt(O, G, K, M) {
              const [_, A] = this.parentDimensions;
              [K, M] = this.screenToPageTranslation(K, M), this.x = (O + K) / _, this.y = (G + M) / A, this.fixAndSetPosition();
            }
            translate(O, G) {
              Z(this, d, jt).call(this, this.parentDimensions, O, G);
            }
            translateInPage(O, G) {
              Z(this, d, jt).call(this, this.pageDimensions, O, G), this.div.scrollIntoView({
                block: "nearest"
              });
            }
            drag(O, G) {
              const [K, M] = this.parentDimensions;
              if (this.x += O / K, this.y += G / M, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
                const {
                  x: $,
                  y: z
                } = this.div.getBoundingClientRect();
                this.parent.findNewParent(this, $, z) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
              }
              let {
                x: _,
                y: A
              } = this;
              const [k, N] = Z(this, d, Wt).call(this);
              _ += k, A += N, this.div.style.left = `${(100 * _).toFixed(2)}%`, this.div.style.top = `${(100 * A).toFixed(2)}%`, this.div.scrollIntoView({
                block: "nearest"
              });
            }
            fixAndSetPosition() {
              const [O, G] = this.pageDimensions;
              let {
                x: K,
                y: M,
                width: _,
                height: A
              } = this;
              switch (_ *= O, A *= G, K *= O, M *= G, this.rotation) {
                case 0:
                  K = Math.max(0, Math.min(O - _, K)), M = Math.max(0, Math.min(G - A, M));
                  break;
                case 90:
                  K = Math.max(0, Math.min(O - A, K)), M = Math.min(G, Math.max(_, M));
                  break;
                case 180:
                  K = Math.min(O, Math.max(_, K)), M = Math.min(G, Math.max(A, M));
                  break;
                case 270:
                  K = Math.min(O, Math.max(A, K)), M = Math.max(0, Math.min(G - _, M));
                  break;
              }
              this.x = K /= O, this.y = M /= G;
              const [k, N] = Z(this, d, Wt).call(this);
              K += k, M += N;
              const {
                style: $
              } = this.div;
              $.left = `${(100 * K).toFixed(2)}%`, $.top = `${(100 * M).toFixed(2)}%`, this.moveInDOM();
            }
            screenToPageTranslation(O, G) {
              var K;
              return Z(K = q, y, Gt).call(K, O, G, this.parentRotation);
            }
            pageTranslationToScreen(O, G) {
              var K;
              return Z(K = q, y, Gt).call(K, O, G, 360 - this.parentRotation);
            }
            get parentScale() {
              return this._uiManager.viewParameters.realScale;
            }
            get parentRotation() {
              return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
            }
            get parentDimensions() {
              const {
                parentScale: O,
                pageDimensions: [G, K]
              } = this, M = G * O, _ = K * O;
              return i.FeatureTest.isCSSRoundSupported ? [Math.round(M), Math.round(_)] : [M, _];
            }
            setDims(O, G) {
              var _;
              const [K, M] = this.parentDimensions;
              this.div.style.width = `${(100 * O / K).toFixed(2)}%`, c(this, C) || (this.div.style.height = `${(100 * G / M).toFixed(2)}%`), (_ = c(this, o)) == null || _.classList.toggle("small", O < q.SMALL_EDITOR_SIZE || G < q.SMALL_EDITOR_SIZE);
            }
            fixDims() {
              const {
                style: O
              } = this.div, {
                height: G,
                width: K
              } = O, M = K.endsWith("%"), _ = !c(this, C) && G.endsWith("%");
              if (M && _)
                return;
              const [A, k] = this.parentDimensions;
              M || (O.width = `${(100 * parseFloat(K) / A).toFixed(2)}%`), !c(this, C) && !_ && (O.height = `${(100 * parseFloat(G) / k).toFixed(2)}%`);
            }
            getInitialTranslation() {
              return [0, 0];
            }
            async addAltTextButton() {
              if (c(this, o))
                return;
              const O = he(this, o, document.createElement("button"));
              O.className = "altText";
              const G = await q._l10nPromise.get("editor_alt_text_button_label");
              O.textContent = G, O.setAttribute("aria-label", G), O.tabIndex = "0", O.addEventListener("contextmenu", a.noContextMenu), O.addEventListener("pointerdown", (K) => K.stopPropagation()), O.addEventListener("click", (K) => {
                K.preventDefault(), this._uiManager.editAltText(this);
              }, {
                capture: !0
              }), O.addEventListener("keydown", (K) => {
                K.target === O && K.key === "Enter" && (K.preventDefault(), this._uiManager.editAltText(this));
              }), Z(this, d, Xt).call(this), this.div.append(O), q.SMALL_EDITOR_SIZE || (q.SMALL_EDITOR_SIZE = Math.min(128, Math.round(O.getBoundingClientRect().width * 1.4)));
            }
            getClientDimensions() {
              return this.div.getBoundingClientRect();
            }
            get altTextData() {
              return {
                altText: c(this, u),
                decorative: c(this, l)
              };
            }
            set altTextData({
              altText: O,
              decorative: G
            }) {
              c(this, u) === O && c(this, l) === G || (he(this, u, O), he(this, l, G), Z(this, d, Xt).call(this));
            }
            render() {
              this.div = document.createElement("div"), this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), this.div.className = this.name, this.div.setAttribute("id", this.id), this.div.setAttribute("tabIndex", 0), this.setInForeground(), this.div.addEventListener("focusin", c(this, T)), this.div.addEventListener("focusout", c(this, D));
              const [O, G] = this.parentDimensions;
              this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * G / O).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * O / G).toFixed(2)}%`);
              const [K, M] = this.getInitialTranslation();
              return this.translate(K, M), (0, t.bindEvents)(this, this.div, ["pointerdown"]), this.div;
            }
            pointerdown(O) {
              const {
                isMac: G
              } = i.FeatureTest.platform;
              if (O.button !== 0 || O.ctrlKey && G) {
                O.preventDefault();
                return;
              }
              he(this, F, !0), Z(this, d, Pn).call(this, O);
            }
            moveInDOM() {
              var O;
              (O = this.parent) == null || O.moveEditorInDOM(this);
            }
            _setParentAndPosition(O, G, K) {
              O.changeParent(this), this.x = G, this.y = K, this.fixAndSetPosition();
            }
            getRect(O, G) {
              const K = this.parentScale, [M, _] = this.pageDimensions, [A, k] = this.pageTranslation, N = O / K, $ = G / K, z = this.x * M, B = this.y * _, Y = this.width * M, ce = this.height * _;
              switch (this.rotation) {
                case 0:
                  return [z + N + A, _ - B - $ - ce + k, z + N + Y + A, _ - B - $ + k];
                case 90:
                  return [z + $ + A, _ - B + N + k, z + $ + ce + A, _ - B + N + Y + k];
                case 180:
                  return [z - N - Y + A, _ - B + $ + k, z - N + A, _ - B + $ + ce + k];
                case 270:
                  return [z - $ - ce + A, _ - B - N - Y + k, z - $ + A, _ - B - N + k];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            getRectInCurrentCoords(O, G) {
              const [K, M, _, A] = O, k = _ - K, N = A - M;
              switch (this.rotation) {
                case 0:
                  return [K, G - A, k, N];
                case 90:
                  return [K, G - M, N, k];
                case 180:
                  return [_, G - M, k, N];
                case 270:
                  return [_, G - A, N, k];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            onceAdded() {
            }
            isEmpty() {
              return !1;
            }
            enableEditMode() {
              he(this, E, !0);
            }
            disableEditMode() {
              he(this, E, !1);
            }
            isInEditMode() {
              return c(this, E);
            }
            shouldGetKeyboardEvents() {
              return !1;
            }
            needsToBeRebuilt() {
              return this.div && !this.isAttachedToDOM;
            }
            rebuild() {
              var O, G;
              (O = this.div) == null || O.addEventListener("focusin", c(this, T)), (G = this.div) == null || G.addEventListener("focusout", c(this, D));
            }
            serialize(O = !1, G = null) {
              (0, i.unreachable)("An editor must be serializable");
            }
            static deserialize(O, G, K) {
              const M = new this.prototype.constructor({
                parent: G,
                id: G.getNextId(),
                uiManager: K
              });
              M.rotation = O.rotation;
              const [_, A] = M.pageDimensions, [k, N, $, z] = M.getRectInCurrentCoords(O.rect, A);
              return M.x = k / _, M.y = N / A, M.width = $ / _, M.height = z / A, M;
            }
            remove() {
              var O;
              this.div.removeEventListener("focusin", c(this, T)), this.div.removeEventListener("focusout", c(this, D)), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), (O = c(this, o)) == null || O.remove(), he(this, o, null), he(this, w, null);
            }
            get isResizable() {
              return !1;
            }
            makeResizable() {
              this.isResizable && (Z(this, d, Cn).call(this), c(this, S).classList.remove("hidden"));
            }
            select() {
              var O;
              this.makeResizable(), (O = this.div) == null || O.classList.add("selectedEditor");
            }
            unselect() {
              var O, G, K;
              (O = c(this, S)) == null || O.classList.add("hidden"), (G = this.div) == null || G.classList.remove("selectedEditor"), (K = this.div) != null && K.contains(document.activeElement) && this._uiManager.currentLayer.div.focus();
            }
            updateParams(O, G) {
            }
            disableEditing() {
              c(this, o) && (c(this, o).hidden = !0);
            }
            enableEditing() {
              c(this, o) && (c(this, o).hidden = !1);
            }
            enterInEditMode() {
            }
            get contentDiv() {
              return this.div;
            }
            get isEditing() {
              return c(this, f);
            }
            set isEditing(O) {
              he(this, f, O), this.parent && (O ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
            }
            setAspectRatio(O, G) {
              he(this, C, !0);
              const K = O / G, {
                style: M
              } = this.div;
              M.aspectRatio = K, M.height = "auto";
            }
            static get MIN_SIZE() {
              return 16;
            }
          };
          u = new WeakMap(), l = new WeakMap(), o = new WeakMap(), w = new WeakMap(), x = new WeakMap(), C = new WeakMap(), S = new WeakMap(), T = new WeakMap(), D = new WeakMap(), F = new WeakMap(), f = new WeakMap(), E = new WeakMap(), v = new WeakMap(), p = new WeakMap(), d = new WeakSet(), jt = function([O, G], K, M) {
            [K, M] = this.screenToPageTranslation(K, M), this.x += K / O, this.y += M / G, this.fixAndSetPosition();
          }, Wt = function() {
            const [O, G] = this.parentDimensions, {
              _borderLineWidth: K
            } = q, M = K / O, _ = K / G;
            switch (this.rotation) {
              case 90:
                return [-M, _];
              case 180:
                return [M, _];
              case 270:
                return [M, -_];
              default:
                return [-M, -_];
            }
          }, y = new WeakSet(), Gt = function(O, G, K) {
            switch (K) {
              case 90:
                return [G, -O];
              case 180:
                return [-O, -G];
              case 270:
                return [-G, O];
              default:
                return [O, G];
            }
          }, qt = function(O) {
            switch (O) {
              case 90: {
                const [G, K] = this.pageDimensions;
                return [0, -G / K, K / G, 0];
              }
              case 180:
                return [-1, 0, 0, -1];
              case 270: {
                const [G, K] = this.pageDimensions;
                return [0, G / K, -K / G, 0];
              }
              default:
                return [1, 0, 0, 1];
            }
          }, Cn = function() {
            if (c(this, S))
              return;
            he(this, S, document.createElement("div")), c(this, S).classList.add("resizers");
            const O = ["topLeft", "topRight", "bottomRight", "bottomLeft"];
            this._willKeepAspectRatio || O.push("topMiddle", "middleRight", "bottomMiddle", "middleLeft");
            for (const G of O) {
              const K = document.createElement("div");
              c(this, S).append(K), K.classList.add("resizer", G), K.addEventListener("pointerdown", Z(this, d, Tn).bind(this, G)), K.addEventListener("contextmenu", a.noContextMenu);
            }
            this.div.prepend(c(this, S));
          }, Tn = function(O, G) {
            G.preventDefault();
            const {
              isMac: K
            } = i.FeatureTest.platform;
            if (G.button !== 0 || G.ctrlKey && K)
              return;
            const M = Z(this, d, xn).bind(this, O), _ = this._isDraggable;
            this._isDraggable = !1;
            const A = {
              passive: !0,
              capture: !0
            };
            window.addEventListener("pointermove", M, A);
            const k = this.x, N = this.y, $ = this.width, z = this.height, B = this.parent.div.style.cursor, Y = this.div.style.cursor;
            this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(G.target).cursor;
            const ce = () => {
              this._isDraggable = _, window.removeEventListener("pointerup", ce), window.removeEventListener("blur", ce), window.removeEventListener("pointermove", M, A), this.parent.div.style.cursor = B, this.div.style.cursor = Y;
              const de = this.x, me = this.y, Ae = this.width, _e = this.height;
              de === k && me === N && Ae === $ && _e === z || this.addCommands({
                cmd: () => {
                  this.width = Ae, this.height = _e, this.x = de, this.y = me;
                  const [te, se] = this.parentDimensions;
                  this.setDims(te * Ae, se * _e), this.fixAndSetPosition();
                },
                undo: () => {
                  this.width = $, this.height = z, this.x = k, this.y = N;
                  const [te, se] = this.parentDimensions;
                  this.setDims(te * $, se * z), this.fixAndSetPosition();
                },
                mustExec: !0
              });
            };
            window.addEventListener("pointerup", ce), window.addEventListener("blur", ce);
          }, xn = function(O, G) {
            const [K, M] = this.parentDimensions, _ = this.x, A = this.y, k = this.width, N = this.height, $ = q.MIN_SIZE / K, z = q.MIN_SIZE / M, B = (Me) => Math.round(Me * 1e4) / 1e4, Y = Z(this, d, qt).call(this, this.rotation), ce = (Me, Ue) => [Y[0] * Me + Y[2] * Ue, Y[1] * Me + Y[3] * Ue], de = Z(this, d, qt).call(this, 360 - this.rotation), me = (Me, Ue) => [de[0] * Me + de[2] * Ue, de[1] * Me + de[3] * Ue];
            let Ae, _e, te = !1, se = !1;
            switch (O) {
              case "topLeft":
                te = !0, Ae = (Me, Ue) => [0, 0], _e = (Me, Ue) => [Me, Ue];
                break;
              case "topMiddle":
                Ae = (Me, Ue) => [Me / 2, 0], _e = (Me, Ue) => [Me / 2, Ue];
                break;
              case "topRight":
                te = !0, Ae = (Me, Ue) => [Me, 0], _e = (Me, Ue) => [0, Ue];
                break;
              case "middleRight":
                se = !0, Ae = (Me, Ue) => [Me, Ue / 2], _e = (Me, Ue) => [0, Ue / 2];
                break;
              case "bottomRight":
                te = !0, Ae = (Me, Ue) => [Me, Ue], _e = (Me, Ue) => [0, 0];
                break;
              case "bottomMiddle":
                Ae = (Me, Ue) => [Me / 2, Ue], _e = (Me, Ue) => [Me / 2, 0];
                break;
              case "bottomLeft":
                te = !0, Ae = (Me, Ue) => [0, Ue], _e = (Me, Ue) => [Me, 0];
                break;
              case "middleLeft":
                se = !0, Ae = (Me, Ue) => [0, Ue / 2], _e = (Me, Ue) => [Me, Ue / 2];
                break;
            }
            const R = Ae(k, N), H = _e(k, N);
            let J = ce(...H);
            const ae = B(_ + J[0]), be = B(A + J[1]);
            let we = 1, Ee = 1, [ee, Fe] = this.screenToPageTranslation(G.movementX, G.movementY);
            if ([ee, Fe] = me(ee / K, Fe / M), te) {
              const Me = Math.hypot(k, N);
              we = Ee = Math.max(Math.min(Math.hypot(H[0] - R[0] - ee, H[1] - R[1] - Fe) / Me, 1 / k, 1 / N), $ / k, z / N);
            } else se ? we = Math.max($, Math.min(1, Math.abs(H[0] - R[0] - ee))) / k : Ee = Math.max(z, Math.min(1, Math.abs(H[1] - R[1] - Fe))) / N;
            const ke = B(k * we), We = B(N * Ee);
            J = ce(..._e(ke, We));
            const He = ae - J[0], Ze = be - J[1];
            this.width = ke, this.height = We, this.x = He, this.y = Ze, this.setDims(K * ke, M * We), this.fixAndSetPosition();
          }, Xt = async function() {
            var K;
            const O = c(this, o);
            if (!O)
              return;
            if (!c(this, u) && !c(this, l)) {
              O.classList.remove("done"), (K = c(this, w)) == null || K.remove();
              return;
            }
            q._l10nPromise.get("editor_alt_text_edit_button_label").then((M) => {
              O.setAttribute("aria-label", M);
            });
            let G = c(this, w);
            if (!G) {
              he(this, w, G = document.createElement("span")), G.className = "tooltip", G.setAttribute("role", "tooltip");
              const M = G.id = `alt-text-tooltip-${this.id}`;
              O.setAttribute("aria-describedby", M);
              const _ = 100;
              O.addEventListener("mouseenter", () => {
                he(this, x, setTimeout(() => {
                  he(this, x, null), c(this, w).classList.add("show"), this._uiManager._eventBus.dispatch("reporttelemetry", {
                    source: this,
                    details: {
                      type: "editing",
                      subtype: this.editorType,
                      data: {
                        action: "alt_text_tooltip"
                      }
                    }
                  });
                }, _));
              }), O.addEventListener("mouseleave", () => {
                var A;
                clearTimeout(c(this, x)), he(this, x, null), (A = c(this, w)) == null || A.classList.remove("show");
              });
            }
            O.classList.add("done"), G.innerText = c(this, l) ? await q._l10nPromise.get("editor_alt_text_decorative_tooltip") : c(this, u), G.parentNode || O.append(G);
          }, Pn = function(O) {
            if (!this._isDraggable)
              return;
            const G = this._uiManager.isSelected(this);
            this._uiManager.setUpDragSession();
            let K, M;
            G && (K = {
              passive: !0,
              capture: !0
            }, M = (A) => {
              const [k, N] = this.screenToPageTranslation(A.movementX, A.movementY);
              this._uiManager.dragSelectedEditors(k, N);
            }, window.addEventListener("pointermove", M, K));
            const _ = () => {
              if (window.removeEventListener("pointerup", _), window.removeEventListener("blur", _), G && window.removeEventListener("pointermove", M, K), he(this, F, !1), !this._uiManager.endDragSession()) {
                const {
                  isMac: A
                } = i.FeatureTest.platform;
                O.ctrlKey && !A || O.shiftKey || O.metaKey && A ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
              }
            };
            window.addEventListener("pointerup", _), window.addEventListener("blur", _);
          }, le(q, y), qe(q, "_borderLineWidth", -1), qe(q, "_colorManager", new t.ColorManager()), qe(q, "_zIndex", 1), qe(q, "SMALL_EDITOR_SIZE", 0);
          let s = q;
          e.AnnotationEditor = s;
          class h extends s {
            constructor(O) {
              super(O), this.annotationElementId = O.annotationElementId, this.deleted = !0;
            }
            serialize() {
              return {
                id: this.annotationElementId,
                deleted: !0,
                pageIndex: this.pageIndex
              };
            }
          }
        },
        /* 5 */
        /***/
        (r, e, n) => {
          var C, S, T, D, F, Vt, v, p, d, g, m, Rn, b, P, j, re, X, Q, q, ie, O, G, K, M, _, A, k, N, $, z, B, Y, ce, de, me, Ae, _e, te, se, R, H, J, ae, be, we, Ee, ee, Mn, Yt, Kt, Ct, Zt, Jt, ot, At, Ln, In, Qt, yt, en;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.KeyboardManager = e.CommandManager = e.ColorManager = e.AnnotationEditorUIManager = void 0, e.bindEvents = a, e.opacityToHex = s;
          var t = n(1), i = n(6);
          function a(Ke, W, pe) {
            for (const De of pe)
              W.addEventListener(De, Ke[De].bind(Ke));
          }
          function s(Ke) {
            return Math.round(Math.min(255, Math.max(1, 255 * Ke))).toString(16).padStart(2, "0");
          }
          class h {
            constructor() {
              le(this, C, 0);
            }
            getId() {
              return `${t.AnnotationEditorPrefix}${bt(this, C)._++}`;
            }
          }
          C = new WeakMap();
          const E = class E {
            constructor() {
              le(this, F);
              le(this, S, (0, t.getUuid)());
              le(this, T, 0);
              le(this, D, null);
            }
            static get _isSVGFittingCanvas() {
              const W = 'data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>', De = new OffscreenCanvas(1, 3).getContext("2d"), $e = new Image();
              $e.src = W;
              const Be = $e.decode().then(() => (De.drawImage($e, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(De.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
              return (0, t.shadow)(this, "_isSVGFittingCanvas", Be);
            }
            async getFromFile(W) {
              const {
                lastModified: pe,
                name: De,
                size: $e,
                type: Be
              } = W;
              return Z(this, F, Vt).call(this, `${pe}_${De}_${$e}_${Be}`, W);
            }
            async getFromUrl(W) {
              return Z(this, F, Vt).call(this, W, W);
            }
            async getFromId(W) {
              c(this, D) || he(this, D, /* @__PURE__ */ new Map());
              const pe = c(this, D).get(W);
              return pe ? pe.bitmap ? (pe.refCounter += 1, pe) : pe.file ? this.getFromFile(pe.file) : this.getFromUrl(pe.url) : null;
            }
            getSvgUrl(W) {
              const pe = c(this, D).get(W);
              return pe != null && pe.isSvg ? pe.svgUrl : null;
            }
            deleteId(W) {
              c(this, D) || he(this, D, /* @__PURE__ */ new Map());
              const pe = c(this, D).get(W);
              pe && (pe.refCounter -= 1, pe.refCounter === 0 && (pe.bitmap = null));
            }
            isValidId(W) {
              return W.startsWith(`image_${c(this, S)}_`);
            }
          };
          S = new WeakMap(), T = new WeakMap(), D = new WeakMap(), F = new WeakSet(), Vt = async function(W, pe) {
            c(this, D) || he(this, D, /* @__PURE__ */ new Map());
            let De = c(this, D).get(W);
            if (De === null)
              return null;
            if (De != null && De.bitmap)
              return De.refCounter += 1, De;
            try {
              De || (De = {
                bitmap: null,
                id: `image_${c(this, S)}_${bt(this, T)._++}`,
                refCounter: 0,
                isSvg: !1
              });
              let $e;
              if (typeof pe == "string") {
                De.url = pe;
                const Be = await fetch(pe);
                if (!Be.ok)
                  throw new Error(Be.statusText);
                $e = await Be.blob();
              } else
                $e = De.file = pe;
              if ($e.type === "image/svg+xml") {
                const Be = E._isSVGFittingCanvas, xe = new FileReader(), U = new Image(), I = new Promise((V, fe) => {
                  U.onload = () => {
                    De.bitmap = U, De.isSvg = !0, V();
                  }, xe.onload = async () => {
                    const ge = De.svgUrl = xe.result;
                    U.src = await Be ? `${ge}#svgView(preserveAspectRatio(none))` : ge;
                  }, U.onerror = xe.onerror = fe;
                });
                xe.readAsDataURL($e), await I;
              } else
                De.bitmap = await createImageBitmap($e);
              De.refCounter = 1;
            } catch ($e) {
              console.error($e), De = null;
            }
            return c(this, D).set(W, De), De && c(this, D).set(De.id, De), De;
          };
          let u = E;
          class l {
            constructor(W = 128) {
              le(this, v, []);
              le(this, p, !1);
              le(this, d);
              le(this, g, -1);
              he(this, d, W);
            }
            add({
              cmd: W,
              undo: pe,
              mustExec: De,
              type: $e = NaN,
              overwriteIfSameType: Be = !1,
              keepUndo: xe = !1
            }) {
              if (De && W(), c(this, p))
                return;
              const U = {
                cmd: W,
                undo: pe,
                type: $e
              };
              if (c(this, g) === -1) {
                c(this, v).length > 0 && (c(this, v).length = 0), he(this, g, 0), c(this, v).push(U);
                return;
              }
              if (Be && c(this, v)[c(this, g)].type === $e) {
                xe && (U.undo = c(this, v)[c(this, g)].undo), c(this, v)[c(this, g)] = U;
                return;
              }
              const I = c(this, g) + 1;
              I === c(this, d) ? c(this, v).splice(0, 1) : (he(this, g, I), I < c(this, v).length && c(this, v).splice(I)), c(this, v).push(U);
            }
            undo() {
              c(this, g) !== -1 && (he(this, p, !0), c(this, v)[c(this, g)].undo(), he(this, p, !1), he(this, g, c(this, g) - 1));
            }
            redo() {
              c(this, g) < c(this, v).length - 1 && (he(this, g, c(this, g) + 1), he(this, p, !0), c(this, v)[c(this, g)].cmd(), he(this, p, !1));
            }
            hasSomethingToUndo() {
              return c(this, g) !== -1;
            }
            hasSomethingToRedo() {
              return c(this, g) < c(this, v).length - 1;
            }
            destroy() {
              he(this, v, null);
            }
          }
          v = new WeakMap(), p = new WeakMap(), d = new WeakMap(), g = new WeakMap(), e.CommandManager = l;
          class o {
            constructor(W) {
              le(this, m);
              this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
              const {
                isMac: pe
              } = t.FeatureTest.platform;
              for (const [De, $e, Be = {}] of W)
                for (const xe of De) {
                  const U = xe.startsWith("mac+");
                  pe && U ? (this.callbacks.set(xe.slice(4), {
                    callback: $e,
                    options: Be
                  }), this.allKeys.add(xe.split("+").at(-1))) : !pe && !U && (this.callbacks.set(xe, {
                    callback: $e,
                    options: Be
                  }), this.allKeys.add(xe.split("+").at(-1)));
                }
            }
            exec(W, pe) {
              if (!this.allKeys.has(pe.key))
                return;
              const De = this.callbacks.get(Z(this, m, Rn).call(this, pe));
              if (!De)
                return;
              const {
                callback: $e,
                options: {
                  bubbles: Be = !1,
                  args: xe = [],
                  checker: U = null
                }
              } = De;
              U && !U(W, pe) || ($e.bind(W, ...xe)(), Be || (pe.stopPropagation(), pe.preventDefault()));
            }
          }
          m = new WeakSet(), Rn = function(W) {
            W.altKey && this.buffer.push("alt"), W.ctrlKey && this.buffer.push("ctrl"), W.metaKey && this.buffer.push("meta"), W.shiftKey && this.buffer.push("shift"), this.buffer.push(W.key);
            const pe = this.buffer.join("+");
            return this.buffer.length = 0, pe;
          }, e.KeyboardManager = o;
          const L = class L {
            get _colors() {
              const W = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
              return (0, i.getColorValues)(W), (0, t.shadow)(this, "_colors", W);
            }
            convert(W) {
              const pe = (0, i.getRGB)(W);
              if (!window.matchMedia("(forced-colors: active)").matches)
                return pe;
              for (const [De, $e] of this._colors)
                if ($e.every((Be, xe) => Be === pe[xe]))
                  return L._colorsMapping.get(De);
              return pe;
            }
            getHexCode(W) {
              const pe = this._colors.get(W);
              return pe ? t.Util.makeHexColor(...pe) : W;
            }
          };
          qe(L, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
          let w = L;
          e.ColorManager = w;
          const Xe = class Xe {
            constructor(W, pe, De, $e, Be, xe) {
              le(this, ee);
              le(this, b, null);
              le(this, P, /* @__PURE__ */ new Map());
              le(this, j, /* @__PURE__ */ new Map());
              le(this, re, null);
              le(this, X, null);
              le(this, Q, new l());
              le(this, q, 0);
              le(this, ie, /* @__PURE__ */ new Set());
              le(this, O, null);
              le(this, G, null);
              le(this, K, /* @__PURE__ */ new Set());
              le(this, M, null);
              le(this, _, new h());
              le(this, A, !1);
              le(this, k, !1);
              le(this, N, null);
              le(this, $, t.AnnotationEditorType.NONE);
              le(this, z, /* @__PURE__ */ new Set());
              le(this, B, null);
              le(this, Y, this.blur.bind(this));
              le(this, ce, this.focus.bind(this));
              le(this, de, this.copy.bind(this));
              le(this, me, this.cut.bind(this));
              le(this, Ae, this.paste.bind(this));
              le(this, _e, this.keydown.bind(this));
              le(this, te, this.onEditingAction.bind(this));
              le(this, se, this.onPageChanging.bind(this));
              le(this, R, this.onScaleChanging.bind(this));
              le(this, H, this.onRotationChanging.bind(this));
              le(this, J, {
                isEditing: !1,
                isEmpty: !0,
                hasSomethingToUndo: !1,
                hasSomethingToRedo: !1,
                hasSelectedEditor: !1
              });
              le(this, ae, [0, 0]);
              le(this, be, null);
              le(this, we, null);
              le(this, Ee, null);
              he(this, we, W), he(this, Ee, pe), he(this, re, De), this._eventBus = $e, this._eventBus._on("editingaction", c(this, te)), this._eventBus._on("pagechanging", c(this, se)), this._eventBus._on("scalechanging", c(this, R)), this._eventBus._on("rotationchanging", c(this, H)), he(this, X, Be.annotationStorage), he(this, M, Be.filterFactory), he(this, B, xe), this.viewParameters = {
                realScale: i.PixelsPerInch.PDF_TO_CSS_UNITS,
                rotation: 0
              };
            }
            static get _keyboardManager() {
              const W = Xe.prototype, pe = (Be) => {
                const {
                  activeElement: xe
                } = document;
                return xe && c(Be, we).contains(xe) && Be.hasSomethingToControl();
              }, De = this.TRANSLATE_SMALL, $e = this.TRANSLATE_BIG;
              return (0, t.shadow)(this, "_keyboardManager", new o([[["ctrl+a", "mac+meta+a"], W.selectAll], [["ctrl+z", "mac+meta+z"], W.undo], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], W.redo], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], W.delete], [["Escape", "mac+Escape"], W.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], W.translateSelectedEditors, {
                args: [-De, 0],
                checker: pe
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], W.translateSelectedEditors, {
                args: [-$e, 0],
                checker: pe
              }], [["ArrowRight", "mac+ArrowRight"], W.translateSelectedEditors, {
                args: [De, 0],
                checker: pe
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], W.translateSelectedEditors, {
                args: [$e, 0],
                checker: pe
              }], [["ArrowUp", "mac+ArrowUp"], W.translateSelectedEditors, {
                args: [0, -De],
                checker: pe
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], W.translateSelectedEditors, {
                args: [0, -$e],
                checker: pe
              }], [["ArrowDown", "mac+ArrowDown"], W.translateSelectedEditors, {
                args: [0, De],
                checker: pe
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], W.translateSelectedEditors, {
                args: [0, $e],
                checker: pe
              }]]));
            }
            destroy() {
              Z(this, ee, Ct).call(this), Z(this, ee, Yt).call(this), this._eventBus._off("editingaction", c(this, te)), this._eventBus._off("pagechanging", c(this, se)), this._eventBus._off("scalechanging", c(this, R)), this._eventBus._off("rotationchanging", c(this, H));
              for (const W of c(this, j).values())
                W.destroy();
              c(this, j).clear(), c(this, P).clear(), c(this, K).clear(), he(this, b, null), c(this, z).clear(), c(this, Q).destroy(), c(this, re).destroy();
            }
            get hcmFilter() {
              return (0, t.shadow)(this, "hcmFilter", c(this, B) ? c(this, M).addHCMFilter(c(this, B).foreground, c(this, B).background) : "none");
            }
            get direction() {
              return (0, t.shadow)(this, "direction", getComputedStyle(c(this, we)).direction);
            }
            editAltText(W) {
              var pe;
              (pe = c(this, re)) == null || pe.editAltText(this, W);
            }
            onPageChanging({
              pageNumber: W
            }) {
              he(this, q, W - 1);
            }
            focusMainContainer() {
              c(this, we).focus();
            }
            findParent(W, pe) {
              for (const De of c(this, j).values()) {
                const {
                  x: $e,
                  y: Be,
                  width: xe,
                  height: U
                } = De.div.getBoundingClientRect();
                if (W >= $e && W <= $e + xe && pe >= Be && pe <= Be + U)
                  return De;
              }
              return null;
            }
            disableUserSelect(W = !1) {
              c(this, Ee).classList.toggle("noUserSelect", W);
            }
            addShouldRescale(W) {
              c(this, K).add(W);
            }
            removeShouldRescale(W) {
              c(this, K).delete(W);
            }
            onScaleChanging({
              scale: W
            }) {
              this.commitOrRemove(), this.viewParameters.realScale = W * i.PixelsPerInch.PDF_TO_CSS_UNITS;
              for (const pe of c(this, K))
                pe.onScaleChanging();
            }
            onRotationChanging({
              pagesRotation: W
            }) {
              this.commitOrRemove(), this.viewParameters.rotation = W;
            }
            addToAnnotationStorage(W) {
              !W.isEmpty() && c(this, X) && !c(this, X).has(W.id) && c(this, X).setValue(W.id, W);
            }
            blur() {
              if (!this.hasSelection)
                return;
              const {
                activeElement: W
              } = document;
              for (const pe of c(this, z))
                if (pe.div.contains(W)) {
                  he(this, N, [pe, W]), pe._focusEventsAllowed = !1;
                  break;
                }
            }
            focus() {
              if (!c(this, N))
                return;
              const [W, pe] = c(this, N);
              he(this, N, null), pe.addEventListener("focusin", () => {
                W._focusEventsAllowed = !0;
              }, {
                once: !0
              }), pe.focus();
            }
            addEditListeners() {
              Z(this, ee, Kt).call(this), Z(this, ee, Zt).call(this);
            }
            removeEditListeners() {
              Z(this, ee, Ct).call(this), Z(this, ee, Jt).call(this);
            }
            copy(W) {
              var De;
              if (W.preventDefault(), (De = c(this, b)) == null || De.commitOrRemove(), !this.hasSelection)
                return;
              const pe = [];
              for (const $e of c(this, z)) {
                const Be = $e.serialize(!0);
                Be && pe.push(Be);
              }
              pe.length !== 0 && W.clipboardData.setData("application/pdfjs", JSON.stringify(pe));
            }
            cut(W) {
              this.copy(W), this.delete();
            }
            paste(W) {
              W.preventDefault();
              const {
                clipboardData: pe
              } = W;
              for (const Be of pe.items)
                for (const xe of c(this, G))
                  if (xe.isHandlingMimeForPasting(Be.type)) {
                    xe.paste(Be, this.currentLayer);
                    return;
                  }
              let De = pe.getData("application/pdfjs");
              if (!De)
                return;
              try {
                De = JSON.parse(De);
              } catch (Be) {
                (0, t.warn)(`paste: "${Be.message}".`);
                return;
              }
              if (!Array.isArray(De))
                return;
              this.unselectAll();
              const $e = this.currentLayer;
              try {
                const Be = [];
                for (const I of De) {
                  const V = $e.deserialize(I);
                  if (!V)
                    return;
                  Be.push(V);
                }
                const xe = () => {
                  for (const I of Be)
                    Z(this, ee, Qt).call(this, I);
                  Z(this, ee, en).call(this, Be);
                }, U = () => {
                  for (const I of Be)
                    I.remove();
                };
                this.addCommands({
                  cmd: xe,
                  undo: U,
                  mustExec: !0
                });
              } catch (Be) {
                (0, t.warn)(`paste: "${Be.message}".`);
              }
            }
            keydown(W) {
              var pe;
              (pe = this.getActive()) != null && pe.shouldGetKeyboardEvents() || Xe._keyboardManager.exec(this, W);
            }
            onEditingAction(W) {
              ["undo", "redo", "delete", "selectAll"].includes(W.name) && this[W.name]();
            }
            setEditingState(W) {
              W ? (Z(this, ee, Mn).call(this), Z(this, ee, Kt).call(this), Z(this, ee, Zt).call(this), Z(this, ee, ot).call(this, {
                isEditing: c(this, $) !== t.AnnotationEditorType.NONE,
                isEmpty: Z(this, ee, yt).call(this),
                hasSomethingToUndo: c(this, Q).hasSomethingToUndo(),
                hasSomethingToRedo: c(this, Q).hasSomethingToRedo(),
                hasSelectedEditor: !1
              })) : (Z(this, ee, Yt).call(this), Z(this, ee, Ct).call(this), Z(this, ee, Jt).call(this), Z(this, ee, ot).call(this, {
                isEditing: !1
              }), this.disableUserSelect(!1));
            }
            registerEditorTypes(W) {
              if (!c(this, G)) {
                he(this, G, W);
                for (const pe of c(this, G))
                  Z(this, ee, At).call(this, pe.defaultPropertiesToUpdate);
              }
            }
            getId() {
              return c(this, _).getId();
            }
            get currentLayer() {
              return c(this, j).get(c(this, q));
            }
            getLayer(W) {
              return c(this, j).get(W);
            }
            get currentPageIndex() {
              return c(this, q);
            }
            addLayer(W) {
              c(this, j).set(W.pageIndex, W), c(this, A) ? W.enable() : W.disable();
            }
            removeLayer(W) {
              c(this, j).delete(W.pageIndex);
            }
            updateMode(W, pe = null) {
              if (c(this, $) !== W) {
                if (he(this, $, W), W === t.AnnotationEditorType.NONE) {
                  this.setEditingState(!1), Z(this, ee, In).call(this);
                  return;
                }
                this.setEditingState(!0), Z(this, ee, Ln).call(this), this.unselectAll();
                for (const De of c(this, j).values())
                  De.updateMode(W);
                if (pe) {
                  for (const De of c(this, P).values())
                    if (De.annotationElementId === pe) {
                      this.setSelected(De), De.enterInEditMode();
                      break;
                    }
                }
              }
            }
            updateToolbar(W) {
              W !== c(this, $) && this._eventBus.dispatch("switchannotationeditormode", {
                source: this,
                mode: W
              });
            }
            updateParams(W, pe) {
              if (c(this, G)) {
                if (W === t.AnnotationEditorParamsType.CREATE) {
                  this.currentLayer.addNewEditor(W);
                  return;
                }
                for (const De of c(this, z))
                  De.updateParams(W, pe);
                for (const De of c(this, G))
                  De.updateDefaultParams(W, pe);
              }
            }
            enableWaiting(W = !1) {
              if (c(this, k) !== W) {
                he(this, k, W);
                for (const pe of c(this, j).values())
                  W ? pe.disableClick() : pe.enableClick(), pe.div.classList.toggle("waiting", W);
              }
            }
            getEditors(W) {
              const pe = [];
              for (const De of c(this, P).values())
                De.pageIndex === W && pe.push(De);
              return pe;
            }
            getEditor(W) {
              return c(this, P).get(W);
            }
            addEditor(W) {
              c(this, P).set(W.id, W);
            }
            removeEditor(W) {
              var pe;
              c(this, P).delete(W.id), this.unselect(W), (!W.annotationElementId || !c(this, ie).has(W.annotationElementId)) && ((pe = c(this, X)) == null || pe.remove(W.id));
            }
            addDeletedAnnotationElement(W) {
              c(this, ie).add(W.annotationElementId), W.deleted = !0;
            }
            isDeletedAnnotationElement(W) {
              return c(this, ie).has(W);
            }
            removeDeletedAnnotationElement(W) {
              c(this, ie).delete(W.annotationElementId), W.deleted = !1;
            }
            setActiveEditor(W) {
              c(this, b) !== W && (he(this, b, W), W && Z(this, ee, At).call(this, W.propertiesToUpdate));
            }
            toggleSelected(W) {
              if (c(this, z).has(W)) {
                c(this, z).delete(W), W.unselect(), Z(this, ee, ot).call(this, {
                  hasSelectedEditor: this.hasSelection
                });
                return;
              }
              c(this, z).add(W), W.select(), Z(this, ee, At).call(this, W.propertiesToUpdate), Z(this, ee, ot).call(this, {
                hasSelectedEditor: !0
              });
            }
            setSelected(W) {
              for (const pe of c(this, z))
                pe !== W && pe.unselect();
              c(this, z).clear(), c(this, z).add(W), W.select(), Z(this, ee, At).call(this, W.propertiesToUpdate), Z(this, ee, ot).call(this, {
                hasSelectedEditor: !0
              });
            }
            isSelected(W) {
              return c(this, z).has(W);
            }
            unselect(W) {
              W.unselect(), c(this, z).delete(W), Z(this, ee, ot).call(this, {
                hasSelectedEditor: this.hasSelection
              });
            }
            get hasSelection() {
              return c(this, z).size !== 0;
            }
            undo() {
              c(this, Q).undo(), Z(this, ee, ot).call(this, {
                hasSomethingToUndo: c(this, Q).hasSomethingToUndo(),
                hasSomethingToRedo: !0,
                isEmpty: Z(this, ee, yt).call(this)
              });
            }
            redo() {
              c(this, Q).redo(), Z(this, ee, ot).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: c(this, Q).hasSomethingToRedo(),
                isEmpty: Z(this, ee, yt).call(this)
              });
            }
            addCommands(W) {
              c(this, Q).add(W), Z(this, ee, ot).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: !1,
                isEmpty: Z(this, ee, yt).call(this)
              });
            }
            delete() {
              if (this.commitOrRemove(), !this.hasSelection)
                return;
              const W = [...c(this, z)], pe = () => {
                for (const $e of W)
                  $e.remove();
              }, De = () => {
                for (const $e of W)
                  Z(this, ee, Qt).call(this, $e);
              };
              this.addCommands({
                cmd: pe,
                undo: De,
                mustExec: !0
              });
            }
            commitOrRemove() {
              var W;
              (W = c(this, b)) == null || W.commitOrRemove();
            }
            hasSomethingToControl() {
              return c(this, b) || this.hasSelection;
            }
            selectAll() {
              for (const W of c(this, z))
                W.commit();
              Z(this, ee, en).call(this, c(this, P).values());
            }
            unselectAll() {
              if (c(this, b)) {
                c(this, b).commitOrRemove();
                return;
              }
              if (this.hasSelection) {
                for (const W of c(this, z))
                  W.unselect();
                c(this, z).clear(), Z(this, ee, ot).call(this, {
                  hasSelectedEditor: !1
                });
              }
            }
            translateSelectedEditors(W, pe, De = !1) {
              if (De || this.commitOrRemove(), !this.hasSelection)
                return;
              c(this, ae)[0] += W, c(this, ae)[1] += pe;
              const [$e, Be] = c(this, ae), xe = [...c(this, z)], U = 1e3;
              c(this, be) && clearTimeout(c(this, be)), he(this, be, setTimeout(() => {
                he(this, be, null), c(this, ae)[0] = c(this, ae)[1] = 0, this.addCommands({
                  cmd: () => {
                    for (const I of xe)
                      c(this, P).has(I.id) && I.translateInPage($e, Be);
                  },
                  undo: () => {
                    for (const I of xe)
                      c(this, P).has(I.id) && I.translateInPage(-$e, -Be);
                  },
                  mustExec: !1
                });
              }, U));
              for (const I of xe)
                I.translateInPage(W, pe);
            }
            setUpDragSession() {
              if (this.hasSelection) {
                this.disableUserSelect(!0), he(this, O, /* @__PURE__ */ new Map());
                for (const W of c(this, z))
                  c(this, O).set(W, {
                    savedX: W.x,
                    savedY: W.y,
                    savedPageIndex: W.pageIndex,
                    newX: 0,
                    newY: 0,
                    newPageIndex: -1
                  });
              }
            }
            endDragSession() {
              if (!c(this, O))
                return !1;
              this.disableUserSelect(!1);
              const W = c(this, O);
              he(this, O, null);
              let pe = !1;
              for (const [{
                x: $e,
                y: Be,
                pageIndex: xe
              }, U] of W)
                U.newX = $e, U.newY = Be, U.newPageIndex = xe, pe || (pe = $e !== U.savedX || Be !== U.savedY || xe !== U.savedPageIndex);
              if (!pe)
                return !1;
              const De = ($e, Be, xe, U) => {
                if (c(this, P).has($e.id)) {
                  const I = c(this, j).get(U);
                  I ? $e._setParentAndPosition(I, Be, xe) : ($e.pageIndex = U, $e.x = Be, $e.y = xe);
                }
              };
              return this.addCommands({
                cmd: () => {
                  for (const [$e, {
                    newX: Be,
                    newY: xe,
                    newPageIndex: U
                  }] of W)
                    De($e, Be, xe, U);
                },
                undo: () => {
                  for (const [$e, {
                    savedX: Be,
                    savedY: xe,
                    savedPageIndex: U
                  }] of W)
                    De($e, Be, xe, U);
                },
                mustExec: !0
              }), !0;
            }
            dragSelectedEditors(W, pe) {
              if (c(this, O))
                for (const De of c(this, O).keys())
                  De.drag(W, pe);
            }
            rebuild(W) {
              if (W.parent === null) {
                const pe = this.getLayer(W.pageIndex);
                pe ? (pe.changeParent(W), pe.addOrRebuild(W)) : (this.addEditor(W), this.addToAnnotationStorage(W), W.rebuild());
              } else
                W.parent.addOrRebuild(W);
            }
            isActive(W) {
              return c(this, b) === W;
            }
            getActive() {
              return c(this, b);
            }
            getMode() {
              return c(this, $);
            }
            get imageManager() {
              return (0, t.shadow)(this, "imageManager", new u());
            }
          };
          b = new WeakMap(), P = new WeakMap(), j = new WeakMap(), re = new WeakMap(), X = new WeakMap(), Q = new WeakMap(), q = new WeakMap(), ie = new WeakMap(), O = new WeakMap(), G = new WeakMap(), K = new WeakMap(), M = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), k = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), z = new WeakMap(), B = new WeakMap(), Y = new WeakMap(), ce = new WeakMap(), de = new WeakMap(), me = new WeakMap(), Ae = new WeakMap(), _e = new WeakMap(), te = new WeakMap(), se = new WeakMap(), R = new WeakMap(), H = new WeakMap(), J = new WeakMap(), ae = new WeakMap(), be = new WeakMap(), we = new WeakMap(), Ee = new WeakMap(), ee = new WeakSet(), Mn = function() {
            window.addEventListener("focus", c(this, ce)), window.addEventListener("blur", c(this, Y));
          }, Yt = function() {
            window.removeEventListener("focus", c(this, ce)), window.removeEventListener("blur", c(this, Y));
          }, Kt = function() {
            window.addEventListener("keydown", c(this, _e), {
              capture: !0
            });
          }, Ct = function() {
            window.removeEventListener("keydown", c(this, _e), {
              capture: !0
            });
          }, Zt = function() {
            document.addEventListener("copy", c(this, de)), document.addEventListener("cut", c(this, me)), document.addEventListener("paste", c(this, Ae));
          }, Jt = function() {
            document.removeEventListener("copy", c(this, de)), document.removeEventListener("cut", c(this, me)), document.removeEventListener("paste", c(this, Ae));
          }, ot = function(W) {
            Object.entries(W).some(([De, $e]) => c(this, J)[De] !== $e) && this._eventBus.dispatch("annotationeditorstateschanged", {
              source: this,
              details: Object.assign(c(this, J), W)
            });
          }, At = function(W) {
            this._eventBus.dispatch("annotationeditorparamschanged", {
              source: this,
              details: W
            });
          }, Ln = function() {
            if (!c(this, A)) {
              he(this, A, !0);
              for (const W of c(this, j).values())
                W.enable();
            }
          }, In = function() {
            if (this.unselectAll(), c(this, A)) {
              he(this, A, !1);
              for (const W of c(this, j).values())
                W.disable();
            }
          }, Qt = function(W) {
            const pe = c(this, j).get(W.pageIndex);
            pe ? pe.addOrRebuild(W) : this.addEditor(W);
          }, yt = function() {
            if (c(this, P).size === 0)
              return !0;
            if (c(this, P).size === 1)
              for (const W of c(this, P).values())
                return W.isEmpty();
            return !1;
          }, en = function(W) {
            c(this, z).clear();
            for (const pe of W)
              pe.isEmpty() || (c(this, z).add(pe), pe.select());
            Z(this, ee, ot).call(this, {
              hasSelectedEditor: !0
            });
          }, qe(Xe, "TRANSLATE_SMALL", 1), qe(Xe, "TRANSLATE_BIG", 10);
          let x = Xe;
          e.AnnotationEditorUIManager = x;
        },
        /* 6 */
        /***/
        (r, e, n) => {
          var q, ie, O, G, K, M, _, A, k, N, $, z, ft, pt, tn, Tt, xt, Et, vt;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.StatTimer = e.RenderingCancelledException = e.PixelsPerInch = e.PageViewport = e.PDFDateString = e.DOMStandardFontDataFactory = e.DOMSVGFactory = e.DOMFilterFactory = e.DOMCanvasFactory = e.DOMCMapReaderFactory = void 0, e.deprecated = g, e.getColorValues = P, e.getCurrentTransform = j, e.getCurrentTransformInverse = re, e.getFilenameFromUrl = F, e.getPdfFilenameFromUrl = f, e.getRGB = b, e.getXfaPageViewport = L, e.isDataScheme = T, e.isPdfFile = D, e.isValidFetchUrl = v, e.loadScript = d, e.noContextMenu = p, e.setLayerDimensions = X;
          var t = n(7), i = n(1);
          const a = "http://www.w3.org/2000/svg", Q = class Q {
          };
          qe(Q, "CSS", 96), qe(Q, "PDF", 72), qe(Q, "PDF_TO_CSS_UNITS", Q.CSS / Q.PDF);
          let s = Q;
          e.PixelsPerInch = s;
          class h extends t.BaseFilterFactory {
            constructor({
              docId: R,
              ownerDocument: H = globalThis.document
            } = {}) {
              super();
              le(this, z);
              le(this, q);
              le(this, ie);
              le(this, O);
              le(this, G);
              le(this, K);
              le(this, M);
              le(this, _);
              le(this, A);
              le(this, k);
              le(this, N);
              le(this, $, 0);
              he(this, O, R), he(this, G, H);
            }
            addFilter(R) {
              if (!R)
                return "none";
              let H = c(this, z, ft).get(R);
              if (H)
                return H;
              let J, ae, be, we;
              if (R.length === 1) {
                const ke = R[0], We = new Array(256);
                for (let He = 0; He < 256; He++)
                  We[He] = ke[He] / 255;
                we = J = ae = be = We.join(",");
              } else {
                const [ke, We, He] = R, Ze = new Array(256), Me = new Array(256), Ue = new Array(256);
                for (let Ye = 0; Ye < 256; Ye++)
                  Ze[Ye] = ke[Ye] / 255, Me[Ye] = We[Ye] / 255, Ue[Ye] = He[Ye] / 255;
                J = Ze.join(","), ae = Me.join(","), be = Ue.join(","), we = `${J}${ae}${be}`;
              }
              if (H = c(this, z, ft).get(we), H)
                return c(this, z, ft).set(R, H), H;
              const Ee = `g_${c(this, O)}_transfer_map_${bt(this, $)._++}`, ee = `url(#${Ee})`;
              c(this, z, ft).set(R, ee), c(this, z, ft).set(we, ee);
              const Fe = Z(this, z, Tt).call(this, Ee);
              return Z(this, z, Et).call(this, J, ae, be, Fe), ee;
            }
            addHCMFilter(R, H) {
              var We;
              const J = `${R}-${H}`;
              if (c(this, M) === J)
                return c(this, _);
              if (he(this, M, J), he(this, _, "none"), (We = c(this, K)) == null || We.remove(), !R || !H)
                return c(this, _);
              const ae = Z(this, z, vt).call(this, R);
              R = i.Util.makeHexColor(...ae);
              const be = Z(this, z, vt).call(this, H);
              if (H = i.Util.makeHexColor(...be), c(this, z, pt).style.color = "", R === "#000000" && H === "#ffffff" || R === H)
                return c(this, _);
              const we = new Array(256);
              for (let He = 0; He <= 255; He++) {
                const Ze = He / 255;
                we[He] = Ze <= 0.03928 ? Ze / 12.92 : ((Ze + 0.055) / 1.055) ** 2.4;
              }
              const Ee = we.join(","), ee = `g_${c(this, O)}_hcm_filter`, Fe = he(this, A, Z(this, z, Tt).call(this, ee));
              Z(this, z, Et).call(this, Ee, Ee, Ee, Fe), Z(this, z, tn).call(this, Fe);
              const ke = (He, Ze) => {
                const Me = ae[He] / 255, Ue = be[He] / 255, Ye = new Array(Ze + 1);
                for (let Je = 0; Je <= Ze; Je++)
                  Ye[Je] = Me + Je / Ze * (Ue - Me);
                return Ye.join(",");
              };
              return Z(this, z, Et).call(this, ke(0, 5), ke(1, 5), ke(2, 5), Fe), he(this, _, `url(#${ee})`), c(this, _);
            }
            addHighlightHCMFilter(R, H, J, ae) {
              var Ue;
              const be = `${R}-${H}-${J}-${ae}`;
              if (c(this, k) === be)
                return c(this, N);
              if (he(this, k, be), he(this, N, "none"), (Ue = c(this, A)) == null || Ue.remove(), !R || !H)
                return c(this, N);
              const [we, Ee] = [R, H].map(Z(this, z, vt).bind(this));
              let ee = Math.round(0.2126 * we[0] + 0.7152 * we[1] + 0.0722 * we[2]), Fe = Math.round(0.2126 * Ee[0] + 0.7152 * Ee[1] + 0.0722 * Ee[2]), [ke, We] = [J, ae].map(Z(this, z, vt).bind(this));
              Fe < ee && ([ee, Fe, ke, We] = [Fe, ee, We, ke]), c(this, z, pt).style.color = "";
              const He = (Ye, Je, ye) => {
                const oe = new Array(256), ue = (Fe - ee) / ye, Pe = Ye / 255, Xe = (Je - Ye) / (255 * ye);
                let Ke = 0;
                for (let W = 0; W <= ye; W++) {
                  const pe = Math.round(ee + W * ue), De = Pe + W * Xe;
                  for (let $e = Ke; $e <= pe; $e++)
                    oe[$e] = De;
                  Ke = pe + 1;
                }
                for (let W = Ke; W < 256; W++)
                  oe[W] = oe[Ke - 1];
                return oe.join(",");
              }, Ze = `g_${c(this, O)}_hcm_highlight_filter`, Me = he(this, A, Z(this, z, Tt).call(this, Ze));
              return Z(this, z, tn).call(this, Me), Z(this, z, Et).call(this, He(ke[0], We[0], 5), He(ke[1], We[1], 5), He(ke[2], We[2], 5), Me), he(this, N, `url(#${Ze})`), c(this, N);
            }
            destroy(R = !1) {
              R && (c(this, _) || c(this, N)) || (c(this, ie) && (c(this, ie).parentNode.parentNode.remove(), he(this, ie, null)), c(this, q) && (c(this, q).clear(), he(this, q, null)), he(this, $, 0));
            }
          }
          q = new WeakMap(), ie = new WeakMap(), O = new WeakMap(), G = new WeakMap(), K = new WeakMap(), M = new WeakMap(), _ = new WeakMap(), A = new WeakMap(), k = new WeakMap(), N = new WeakMap(), $ = new WeakMap(), z = new WeakSet(), ft = function() {
            return c(this, q) || he(this, q, /* @__PURE__ */ new Map());
          }, pt = function() {
            if (!c(this, ie)) {
              const R = c(this, G).createElement("div"), {
                style: H
              } = R;
              H.visibility = "hidden", H.contain = "strict", H.width = H.height = 0, H.position = "absolute", H.top = H.left = 0, H.zIndex = -1;
              const J = c(this, G).createElementNS(a, "svg");
              J.setAttribute("width", 0), J.setAttribute("height", 0), he(this, ie, c(this, G).createElementNS(a, "defs")), R.append(J), J.append(c(this, ie)), c(this, G).body.append(R);
            }
            return c(this, ie);
          }, tn = function(R) {
            const H = c(this, G).createElementNS(a, "feColorMatrix");
            H.setAttribute("type", "matrix"), H.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"), R.append(H);
          }, Tt = function(R) {
            const H = c(this, G).createElementNS(a, "filter");
            return H.setAttribute("color-interpolation-filters", "sRGB"), H.setAttribute("id", R), c(this, z, pt).append(H), H;
          }, xt = function(R, H, J) {
            const ae = c(this, G).createElementNS(a, H);
            ae.setAttribute("type", "discrete"), ae.setAttribute("tableValues", J), R.append(ae);
          }, Et = function(R, H, J, ae) {
            const be = c(this, G).createElementNS(a, "feComponentTransfer");
            ae.append(be), Z(this, z, xt).call(this, be, "feFuncR", R), Z(this, z, xt).call(this, be, "feFuncG", H), Z(this, z, xt).call(this, be, "feFuncB", J);
          }, vt = function(R) {
            return c(this, z, pt).style.color = R, b(getComputedStyle(c(this, z, pt)).getPropertyValue("color"));
          }, e.DOMFilterFactory = h;
          class u extends t.BaseCanvasFactory {
            constructor({
              ownerDocument: se = globalThis.document
            } = {}) {
              super(), this._document = se;
            }
            _createCanvas(se, R) {
              const H = this._document.createElement("canvas");
              return H.width = se, H.height = R, H;
            }
          }
          e.DOMCanvasFactory = u;
          async function l(te, se = !1) {
            if (v(te, document.baseURI)) {
              const R = await fetch(te);
              if (!R.ok)
                throw new Error(R.statusText);
              return se ? new Uint8Array(await R.arrayBuffer()) : (0, i.stringToBytes)(await R.text());
            }
            return new Promise((R, H) => {
              const J = new XMLHttpRequest();
              J.open("GET", te, !0), se && (J.responseType = "arraybuffer"), J.onreadystatechange = () => {
                if (J.readyState === XMLHttpRequest.DONE) {
                  if (J.status === 200 || J.status === 0) {
                    let ae;
                    if (se && J.response ? ae = new Uint8Array(J.response) : !se && J.responseText && (ae = (0, i.stringToBytes)(J.responseText)), ae) {
                      R(ae);
                      return;
                    }
                  }
                  H(new Error(J.statusText));
                }
              }, J.send(null);
            });
          }
          class o extends t.BaseCMapReaderFactory {
            _fetchData(se, R) {
              return l(se, this.isCompressed).then((H) => ({
                cMapData: H,
                compressionType: R
              }));
            }
          }
          e.DOMCMapReaderFactory = o;
          class w extends t.BaseStandardFontDataFactory {
            _fetchData(se) {
              return l(se, !0);
            }
          }
          e.DOMStandardFontDataFactory = w;
          class x extends t.BaseSVGFactory {
            _createSVG(se) {
              return document.createElementNS(a, se);
            }
          }
          e.DOMSVGFactory = x;
          class C {
            constructor({
              viewBox: se,
              scale: R,
              rotation: H,
              offsetX: J = 0,
              offsetY: ae = 0,
              dontFlip: be = !1
            }) {
              this.viewBox = se, this.scale = R, this.rotation = H, this.offsetX = J, this.offsetY = ae;
              const we = (se[2] + se[0]) / 2, Ee = (se[3] + se[1]) / 2;
              let ee, Fe, ke, We;
              switch (H %= 360, H < 0 && (H += 360), H) {
                case 180:
                  ee = -1, Fe = 0, ke = 0, We = 1;
                  break;
                case 90:
                  ee = 0, Fe = 1, ke = 1, We = 0;
                  break;
                case 270:
                  ee = 0, Fe = -1, ke = -1, We = 0;
                  break;
                case 0:
                  ee = 1, Fe = 0, ke = 0, We = -1;
                  break;
                default:
                  throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
              }
              be && (ke = -ke, We = -We);
              let He, Ze, Me, Ue;
              ee === 0 ? (He = Math.abs(Ee - se[1]) * R + J, Ze = Math.abs(we - se[0]) * R + ae, Me = (se[3] - se[1]) * R, Ue = (se[2] - se[0]) * R) : (He = Math.abs(we - se[0]) * R + J, Ze = Math.abs(Ee - se[1]) * R + ae, Me = (se[2] - se[0]) * R, Ue = (se[3] - se[1]) * R), this.transform = [ee * R, Fe * R, ke * R, We * R, He - ee * R * we - ke * R * Ee, Ze - Fe * R * we - We * R * Ee], this.width = Me, this.height = Ue;
            }
            get rawDims() {
              const {
                viewBox: se
              } = this;
              return (0, i.shadow)(this, "rawDims", {
                pageWidth: se[2] - se[0],
                pageHeight: se[3] - se[1],
                pageX: se[0],
                pageY: se[1]
              });
            }
            clone({
              scale: se = this.scale,
              rotation: R = this.rotation,
              offsetX: H = this.offsetX,
              offsetY: J = this.offsetY,
              dontFlip: ae = !1
            } = {}) {
              return new C({
                viewBox: this.viewBox.slice(),
                scale: se,
                rotation: R,
                offsetX: H,
                offsetY: J,
                dontFlip: ae
              });
            }
            convertToViewportPoint(se, R) {
              return i.Util.applyTransform([se, R], this.transform);
            }
            convertToViewportRectangle(se) {
              const R = i.Util.applyTransform([se[0], se[1]], this.transform), H = i.Util.applyTransform([se[2], se[3]], this.transform);
              return [R[0], R[1], H[0], H[1]];
            }
            convertToPdfPoint(se, R) {
              return i.Util.applyInverseTransform([se, R], this.transform);
            }
          }
          e.PageViewport = C;
          class S extends i.BaseException {
            constructor(se, R = 0) {
              super(se, "RenderingCancelledException"), this.extraDelay = R;
            }
          }
          e.RenderingCancelledException = S;
          function T(te) {
            const se = te.length;
            let R = 0;
            for (; R < se && te[R].trim() === ""; )
              R++;
            return te.substring(R, R + 5).toLowerCase() === "data:";
          }
          function D(te) {
            return typeof te == "string" && /\.pdf$/i.test(te);
          }
          function F(te, se = !1) {
            return se || ([te] = te.split(/[#?]/, 1)), te.substring(te.lastIndexOf("/") + 1);
          }
          function f(te, se = "document.pdf") {
            if (typeof te != "string")
              return se;
            if (T(te))
              return (0, i.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), se;
            const R = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, H = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, J = R.exec(te);
            let ae = H.exec(J[1]) || H.exec(J[2]) || H.exec(J[3]);
            if (ae && (ae = ae[0], ae.includes("%")))
              try {
                ae = H.exec(decodeURIComponent(ae))[0];
              } catch {
              }
            return ae || se;
          }
          class E {
            constructor() {
              qe(this, "started", /* @__PURE__ */ Object.create(null));
              qe(this, "times", []);
            }
            time(se) {
              se in this.started && (0, i.warn)(`Timer is already running for ${se}`), this.started[se] = Date.now();
            }
            timeEnd(se) {
              se in this.started || (0, i.warn)(`Timer has not been started for ${se}`), this.times.push({
                name: se,
                start: this.started[se],
                end: Date.now()
              }), delete this.started[se];
            }
            toString() {
              const se = [];
              let R = 0;
              for (const {
                name: H
              } of this.times)
                R = Math.max(H.length, R);
              for (const {
                name: H,
                start: J,
                end: ae
              } of this.times)
                se.push(`${H.padEnd(R)} ${ae - J}ms
`);
              return se.join("");
            }
          }
          e.StatTimer = E;
          function v(te, se) {
            try {
              const {
                protocol: R
              } = se ? new URL(te, se) : new URL(te);
              return R === "http:" || R === "https:";
            } catch {
              return !1;
            }
          }
          function p(te) {
            te.preventDefault();
          }
          function d(te, se = !1) {
            return new Promise((R, H) => {
              const J = document.createElement("script");
              J.src = te, J.onload = function(ae) {
                se && J.remove(), R(ae);
              }, J.onerror = function() {
                H(new Error(`Cannot load script at: ${J.src}`));
              }, (document.head || document.documentElement).append(J);
            });
          }
          function g(te) {
            console.log("Deprecated API usage: " + te);
          }
          let m;
          class y {
            static toDateObject(se) {
              if (!se || typeof se != "string")
                return null;
              m || (m = new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));
              const R = m.exec(se);
              if (!R)
                return null;
              const H = parseInt(R[1], 10);
              let J = parseInt(R[2], 10);
              J = J >= 1 && J <= 12 ? J - 1 : 0;
              let ae = parseInt(R[3], 10);
              ae = ae >= 1 && ae <= 31 ? ae : 1;
              let be = parseInt(R[4], 10);
              be = be >= 0 && be <= 23 ? be : 0;
              let we = parseInt(R[5], 10);
              we = we >= 0 && we <= 59 ? we : 0;
              let Ee = parseInt(R[6], 10);
              Ee = Ee >= 0 && Ee <= 59 ? Ee : 0;
              const ee = R[7] || "Z";
              let Fe = parseInt(R[8], 10);
              Fe = Fe >= 0 && Fe <= 23 ? Fe : 0;
              let ke = parseInt(R[9], 10) || 0;
              return ke = ke >= 0 && ke <= 59 ? ke : 0, ee === "-" ? (be += Fe, we += ke) : ee === "+" && (be -= Fe, we -= ke), new Date(Date.UTC(H, J, ae, be, we, Ee));
            }
          }
          e.PDFDateString = y;
          function L(te, {
            scale: se = 1,
            rotation: R = 0
          }) {
            const {
              width: H,
              height: J
            } = te.attributes.style, ae = [0, 0, parseInt(H), parseInt(J)];
            return new C({
              viewBox: ae,
              scale: se,
              rotation: R
            });
          }
          function b(te) {
            if (te.startsWith("#")) {
              const se = parseInt(te.slice(1), 16);
              return [(se & 16711680) >> 16, (se & 65280) >> 8, se & 255];
            }
            return te.startsWith("rgb(") ? te.slice(4, -1).split(",").map((se) => parseInt(se)) : te.startsWith("rgba(") ? te.slice(5, -1).split(",").map((se) => parseInt(se)).slice(0, 3) : ((0, i.warn)(`Not a valid color format: "${te}"`), [0, 0, 0]);
          }
          function P(te) {
            const se = document.createElement("span");
            se.style.visibility = "hidden", document.body.append(se);
            for (const R of te.keys()) {
              se.style.color = R;
              const H = window.getComputedStyle(se).color;
              te.set(R, b(H));
            }
            se.remove();
          }
          function j(te) {
            const {
              a: se,
              b: R,
              c: H,
              d: J,
              e: ae,
              f: be
            } = te.getTransform();
            return [se, R, H, J, ae, be];
          }
          function re(te) {
            const {
              a: se,
              b: R,
              c: H,
              d: J,
              e: ae,
              f: be
            } = te.getTransform().invertSelf();
            return [se, R, H, J, ae, be];
          }
          function X(te, se, R = !1, H = !0) {
            if (se instanceof C) {
              const {
                pageWidth: J,
                pageHeight: ae
              } = se.rawDims, {
                style: be
              } = te, we = i.FeatureTest.isCSSRoundSupported, Ee = `var(--scale-factor) * ${J}px`, ee = `var(--scale-factor) * ${ae}px`, Fe = we ? `round(${Ee}, 1px)` : `calc(${Ee})`, ke = we ? `round(${ee}, 1px)` : `calc(${ee})`;
              !R || se.rotation % 180 === 0 ? (be.width = Fe, be.height = ke) : (be.width = ke, be.height = Fe);
            }
            H && te.setAttribute("data-main-rotation", se.rotation);
          }
        },
        /* 7 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.BaseStandardFontDataFactory = e.BaseSVGFactory = e.BaseFilterFactory = e.BaseCanvasFactory = e.BaseCMapReaderFactory = void 0;
          var t = n(1);
          class i {
            constructor() {
              this.constructor === i && (0, t.unreachable)("Cannot initialize BaseFilterFactory.");
            }
            addFilter(o) {
              return "none";
            }
            addHCMFilter(o, w) {
              return "none";
            }
            addHighlightHCMFilter(o, w, x, C) {
              return "none";
            }
            destroy(o = !1) {
            }
          }
          e.BaseFilterFactory = i;
          class a {
            constructor() {
              this.constructor === a && (0, t.unreachable)("Cannot initialize BaseCanvasFactory.");
            }
            create(o, w) {
              if (o <= 0 || w <= 0)
                throw new Error("Invalid canvas size");
              const x = this._createCanvas(o, w);
              return {
                canvas: x,
                context: x.getContext("2d")
              };
            }
            reset(o, w, x) {
              if (!o.canvas)
                throw new Error("Canvas is not specified");
              if (w <= 0 || x <= 0)
                throw new Error("Invalid canvas size");
              o.canvas.width = w, o.canvas.height = x;
            }
            destroy(o) {
              if (!o.canvas)
                throw new Error("Canvas is not specified");
              o.canvas.width = 0, o.canvas.height = 0, o.canvas = null, o.context = null;
            }
            _createCanvas(o, w) {
              (0, t.unreachable)("Abstract method `_createCanvas` called.");
            }
          }
          e.BaseCanvasFactory = a;
          class s {
            constructor({
              baseUrl: o = null,
              isCompressed: w = !0
            }) {
              this.constructor === s && (0, t.unreachable)("Cannot initialize BaseCMapReaderFactory."), this.baseUrl = o, this.isCompressed = w;
            }
            async fetch({
              name: o
            }) {
              if (!this.baseUrl)
                throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');
              if (!o)
                throw new Error("CMap name must be specified.");
              const w = this.baseUrl + o + (this.isCompressed ? ".bcmap" : ""), x = this.isCompressed ? t.CMapCompressionType.BINARY : t.CMapCompressionType.NONE;
              return this._fetchData(w, x).catch((C) => {
                throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${w}`);
              });
            }
            _fetchData(o, w) {
              (0, t.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          e.BaseCMapReaderFactory = s;
          class h {
            constructor({
              baseUrl: o = null
            }) {
              this.constructor === h && (0, t.unreachable)("Cannot initialize BaseStandardFontDataFactory."), this.baseUrl = o;
            }
            async fetch({
              filename: o
            }) {
              if (!this.baseUrl)
                throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');
              if (!o)
                throw new Error("Font filename must be specified.");
              const w = `${this.baseUrl}${o}`;
              return this._fetchData(w).catch((x) => {
                throw new Error(`Unable to load font data at: ${w}`);
              });
            }
            _fetchData(o) {
              (0, t.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          e.BaseStandardFontDataFactory = h;
          class u {
            constructor() {
              this.constructor === u && (0, t.unreachable)("Cannot initialize BaseSVGFactory.");
            }
            create(o, w, x = !1) {
              if (o <= 0 || w <= 0)
                throw new Error("Invalid SVG dimensions");
              const C = this._createSVG("svg:svg");
              return C.setAttribute("version", "1.1"), x || (C.setAttribute("width", `${o}px`), C.setAttribute("height", `${w}px`)), C.setAttribute("preserveAspectRatio", "none"), C.setAttribute("viewBox", `0 0 ${o} ${w}`), C;
            }
            createElement(o) {
              if (typeof o != "string")
                throw new Error("Invalid SVG element type");
              return this._createSVG(o);
            }
            _createSVG(o) {
              (0, t.unreachable)("Abstract method `_createSVG` called.");
            }
          }
          e.BaseSVGFactory = u;
        },
        /* 8 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.MurmurHash3_64 = void 0;
          var t = n(1);
          const i = 3285377520, a = 4294901760, s = 65535;
          class h {
            constructor(l) {
              this.h1 = l ? l & 4294967295 : i, this.h2 = l ? l & 4294967295 : i;
            }
            update(l) {
              let o, w;
              if (typeof l == "string") {
                o = new Uint8Array(l.length * 2), w = 0;
                for (let g = 0, m = l.length; g < m; g++) {
                  const y = l.charCodeAt(g);
                  y <= 255 ? o[w++] = y : (o[w++] = y >>> 8, o[w++] = y & 255);
                }
              } else if ((0, t.isArrayBuffer)(l))
                o = l.slice(), w = o.byteLength;
              else
                throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");
              const x = w >> 2, C = w - x * 4, S = new Uint32Array(o.buffer, 0, x);
              let T = 0, D = 0, F = this.h1, f = this.h2;
              const E = 3432918353, v = 461845907, p = E & s, d = v & s;
              for (let g = 0; g < x; g++)
                g & 1 ? (T = S[g], T = T * E & a | T * p & s, T = T << 15 | T >>> 17, T = T * v & a | T * d & s, F ^= T, F = F << 13 | F >>> 19, F = F * 5 + 3864292196) : (D = S[g], D = D * E & a | D * p & s, D = D << 15 | D >>> 17, D = D * v & a | D * d & s, f ^= D, f = f << 13 | f >>> 19, f = f * 5 + 3864292196);
              switch (T = 0, C) {
                case 3:
                  T ^= o[x * 4 + 2] << 16;
                case 2:
                  T ^= o[x * 4 + 1] << 8;
                case 1:
                  T ^= o[x * 4], T = T * E & a | T * p & s, T = T << 15 | T >>> 17, T = T * v & a | T * d & s, x & 1 ? F ^= T : f ^= T;
              }
              this.h1 = F, this.h2 = f;
            }
            hexdigest() {
              let l = this.h1, o = this.h2;
              return l ^= o >>> 1, l = l * 3981806797 & a | l * 36045 & s, o = o * 4283543511 & a | ((o << 16 | l >>> 16) * 2950163797 & a) >>> 16, l ^= o >>> 1, l = l * 444984403 & a | l * 60499 & s, o = o * 3301882366 & a | ((o << 16 | l >>> 16) * 3120437893 & a) >>> 16, l ^= o >>> 1, (l >>> 0).toString(16).padStart(8, "0") + (o >>> 0).toString(16).padStart(8, "0");
            }
          }
          e.MurmurHash3_64 = h;
        },
        /* 9 */
        /***/
        (r, e, n) => {
          var s;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.FontLoader = e.FontFaceObject = void 0;
          var t = n(1);
          class i {
            constructor({
              ownerDocument: u = globalThis.document,
              styleElement: l = null
            }) {
              le(this, s, /* @__PURE__ */ new Set());
              this._document = u, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
            }
            addNativeFontFace(u) {
              this.nativeFontFaces.add(u), this._document.fonts.add(u);
            }
            removeNativeFontFace(u) {
              this.nativeFontFaces.delete(u), this._document.fonts.delete(u);
            }
            insertRule(u) {
              this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
              const l = this.styleElement.sheet;
              l.insertRule(u, l.cssRules.length);
            }
            clear() {
              for (const u of this.nativeFontFaces)
                this._document.fonts.delete(u);
              this.nativeFontFaces.clear(), c(this, s).clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
            }
            async loadSystemFont(u) {
              if (!(!u || c(this, s).has(u.loadedName))) {
                if ((0, t.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
                  const {
                    loadedName: l,
                    src: o,
                    style: w
                  } = u, x = new FontFace(l, o, w);
                  this.addNativeFontFace(x);
                  try {
                    await x.load(), c(this, s).add(l);
                  } catch {
                    (0, t.warn)(`Cannot load system font: ${u.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(x);
                  }
                  return;
                }
                (0, t.unreachable)("Not implemented: loadSystemFont without the Font Loading API.");
              }
            }
            async bind(u) {
              if (u.attached || u.missingFile && !u.systemFontInfo)
                return;
              if (u.attached = !0, u.systemFontInfo) {
                await this.loadSystemFont(u.systemFontInfo);
                return;
              }
              if (this.isFontLoadingAPISupported) {
                const o = u.createNativeFontFace();
                if (o) {
                  this.addNativeFontFace(o);
                  try {
                    await o.loaded;
                  } catch (w) {
                    throw (0, t.warn)(`Failed to load font '${o.family}': '${w}'.`), u.disableFontFace = !0, w;
                  }
                }
                return;
              }
              const l = u.createFontFaceRule();
              if (l) {
                if (this.insertRule(l), this.isSyncFontLoadingSupported)
                  return;
                await new Promise((o) => {
                  const w = this._queueLoadingCallback(o);
                  this._prepareFontLoadEvent(u, w);
                });
              }
            }
            get isFontLoadingAPISupported() {
              var l;
              const u = !!((l = this._document) != null && l.fonts);
              return (0, t.shadow)(this, "isFontLoadingAPISupported", u);
            }
            get isSyncFontLoadingSupported() {
              let u = !1;
              return (t.isNodeJS || typeof navigator < "u" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (u = !0), (0, t.shadow)(this, "isSyncFontLoadingSupported", u);
            }
            _queueLoadingCallback(u) {
              function l() {
                for ((0, t.assert)(!w.done, "completeRequest() cannot be called twice."), w.done = !0; o.length > 0 && o[0].done; ) {
                  const x = o.shift();
                  setTimeout(x.callback, 0);
                }
              }
              const {
                loadingRequests: o
              } = this, w = {
                done: !1,
                complete: l,
                callback: u
              };
              return o.push(w), w;
            }
            get _loadTestFont() {
              const u = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
              return (0, t.shadow)(this, "_loadTestFont", u);
            }
            _prepareFontLoadEvent(u, l) {
              function o(b, P) {
                return b.charCodeAt(P) << 24 | b.charCodeAt(P + 1) << 16 | b.charCodeAt(P + 2) << 8 | b.charCodeAt(P + 3) & 255;
              }
              function w(b, P, j, re) {
                const X = b.substring(0, P), Q = b.substring(P + j);
                return X + re + Q;
              }
              let x, C;
              const S = this._document.createElement("canvas");
              S.width = 1, S.height = 1;
              const T = S.getContext("2d");
              let D = 0;
              function F(b, P) {
                if (++D > 30) {
                  (0, t.warn)("Load test font never loaded."), P();
                  return;
                }
                if (T.font = "30px " + b, T.fillText(".", 0, 20), T.getImageData(0, 0, 1, 1).data[3] > 0) {
                  P();
                  return;
                }
                setTimeout(F.bind(null, b, P));
              }
              const f = `lt${Date.now()}${this.loadTestFontId++}`;
              let E = this._loadTestFont;
              E = w(E, 976, f.length, f);
              const p = 16, d = 1482184792;
              let g = o(E, p);
              for (x = 0, C = f.length - 3; x < C; x += 4)
                g = g - d + o(f, x) | 0;
              x < f.length && (g = g - d + o(f + "XXX", x) | 0), E = w(E, p, 4, (0, t.string32)(g));
              const m = `url(data:font/opentype;base64,${btoa(E)});`, y = `@font-face {font-family:"${f}";src:${m}}`;
              this.insertRule(y);
              const L = this._document.createElement("div");
              L.style.visibility = "hidden", L.style.width = L.style.height = "10px", L.style.position = "absolute", L.style.top = L.style.left = "0px";
              for (const b of [u.loadedName, f]) {
                const P = this._document.createElement("span");
                P.textContent = "Hi", P.style.fontFamily = b, L.append(P);
              }
              this._document.body.append(L), F(f, () => {
                L.remove(), l.complete();
              });
            }
          }
          s = new WeakMap(), e.FontLoader = i;
          class a {
            constructor(u, {
              isEvalSupported: l = !0,
              disableFontFace: o = !1,
              ignoreErrors: w = !1,
              inspectFont: x = null
            }) {
              this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
              for (const C in u)
                this[C] = u[C];
              this.isEvalSupported = l !== !1, this.disableFontFace = o === !0, this.ignoreErrors = w === !0, this._inspectFont = x;
            }
            createNativeFontFace() {
              var l;
              if (!this.data || this.disableFontFace)
                return null;
              let u;
              if (!this.cssFontInfo)
                u = new FontFace(this.loadedName, this.data, {});
              else {
                const o = {
                  weight: this.cssFontInfo.fontWeight
                };
                this.cssFontInfo.italicAngle && (o.style = `oblique ${this.cssFontInfo.italicAngle}deg`), u = new FontFace(this.cssFontInfo.fontFamily, this.data, o);
              }
              return (l = this._inspectFont) == null || l.call(this, this), u;
            }
            createFontFaceRule() {
              var w;
              if (!this.data || this.disableFontFace)
                return null;
              const u = (0, t.bytesToString)(this.data), l = `url(data:${this.mimetype};base64,${btoa(u)});`;
              let o;
              if (!this.cssFontInfo)
                o = `@font-face {font-family:"${this.loadedName}";src:${l}}`;
              else {
                let x = `font-weight: ${this.cssFontInfo.fontWeight};`;
                this.cssFontInfo.italicAngle && (x += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), o = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${x}src:${l}}`;
              }
              return (w = this._inspectFont) == null || w.call(this, this, l), o;
            }
            getPathGenerator(u, l) {
              if (this.compiledGlyphs[l] !== void 0)
                return this.compiledGlyphs[l];
              let o;
              try {
                o = u.get(this.loadedName + "_path_" + l);
              } catch (w) {
                if (!this.ignoreErrors)
                  throw w;
                return (0, t.warn)(`getPathGenerator - ignoring character: "${w}".`), this.compiledGlyphs[l] = function(x, C) {
                };
              }
              if (this.isEvalSupported && t.FeatureTest.isEvalSupported) {
                const w = [];
                for (const x of o) {
                  const C = x.args !== void 0 ? x.args.join(",") : "";
                  w.push("c.", x.cmd, "(", C, `);
`);
                }
                return this.compiledGlyphs[l] = new Function("c", "size", w.join(""));
              }
              return this.compiledGlyphs[l] = function(w, x) {
                for (const C of o)
                  C.cmd === "scale" && (C.args = [x, -x]), w[C.cmd].apply(w, C.args);
              };
            }
          }
          e.FontFaceObject = a;
        },
        /* 10 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.NodeStandardFontDataFactory = e.NodeFilterFactory = e.NodeCanvasFactory = e.NodeCMapReaderFactory = void 0;
          var t = n(7);
          n(1);
          const i = function(l) {
            return new Promise((o, w) => {
              require$$5.readFile(l, (C, S) => {
                if (C || !S) {
                  w(new Error(C));
                  return;
                }
                o(new Uint8Array(S));
              });
            });
          };
          class a extends t.BaseFilterFactory {
          }
          e.NodeFilterFactory = a;
          class s extends t.BaseCanvasFactory {
            _createCanvas(o, w) {
              return require$$5.createCanvas(o, w);
            }
          }
          e.NodeCanvasFactory = s;
          class h extends t.BaseCMapReaderFactory {
            _fetchData(o, w) {
              return i(o).then((x) => ({
                cMapData: x,
                compressionType: w
              }));
            }
          }
          e.NodeCMapReaderFactory = h;
          class u extends t.BaseStandardFontDataFactory {
            _fetchData(o) {
              return i(o);
            }
          }
          e.NodeStandardFontDataFactory = u;
        },
        /* 11 */
        /***/
        (r, e, n) => {
          var ie, nn, sn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.CanvasGraphics = void 0;
          var t = n(1), i = n(6), a = n(12), s = n(13);
          const h = 16, u = 100, l = 4096, o = 15, w = 10, x = 1e3, C = 16;
          function S(M, _) {
            if (M._removeMirroring)
              throw new Error("Context is already forwarding operations.");
            M.__originalSave = M.save, M.__originalRestore = M.restore, M.__originalRotate = M.rotate, M.__originalScale = M.scale, M.__originalTranslate = M.translate, M.__originalTransform = M.transform, M.__originalSetTransform = M.setTransform, M.__originalResetTransform = M.resetTransform, M.__originalClip = M.clip, M.__originalMoveTo = M.moveTo, M.__originalLineTo = M.lineTo, M.__originalBezierCurveTo = M.bezierCurveTo, M.__originalRect = M.rect, M.__originalClosePath = M.closePath, M.__originalBeginPath = M.beginPath, M._removeMirroring = () => {
              M.save = M.__originalSave, M.restore = M.__originalRestore, M.rotate = M.__originalRotate, M.scale = M.__originalScale, M.translate = M.__originalTranslate, M.transform = M.__originalTransform, M.setTransform = M.__originalSetTransform, M.resetTransform = M.__originalResetTransform, M.clip = M.__originalClip, M.moveTo = M.__originalMoveTo, M.lineTo = M.__originalLineTo, M.bezierCurveTo = M.__originalBezierCurveTo, M.rect = M.__originalRect, M.closePath = M.__originalClosePath, M.beginPath = M.__originalBeginPath, delete M._removeMirroring;
            }, M.save = function() {
              _.save(), this.__originalSave();
            }, M.restore = function() {
              _.restore(), this.__originalRestore();
            }, M.translate = function(k, N) {
              _.translate(k, N), this.__originalTranslate(k, N);
            }, M.scale = function(k, N) {
              _.scale(k, N), this.__originalScale(k, N);
            }, M.transform = function(k, N, $, z, B, Y) {
              _.transform(k, N, $, z, B, Y), this.__originalTransform(k, N, $, z, B, Y);
            }, M.setTransform = function(k, N, $, z, B, Y) {
              _.setTransform(k, N, $, z, B, Y), this.__originalSetTransform(k, N, $, z, B, Y);
            }, M.resetTransform = function() {
              _.resetTransform(), this.__originalResetTransform();
            }, M.rotate = function(k) {
              _.rotate(k), this.__originalRotate(k);
            }, M.clip = function(k) {
              _.clip(k), this.__originalClip(k);
            }, M.moveTo = function(A, k) {
              _.moveTo(A, k), this.__originalMoveTo(A, k);
            }, M.lineTo = function(A, k) {
              _.lineTo(A, k), this.__originalLineTo(A, k);
            }, M.bezierCurveTo = function(A, k, N, $, z, B) {
              _.bezierCurveTo(A, k, N, $, z, B), this.__originalBezierCurveTo(A, k, N, $, z, B);
            }, M.rect = function(A, k, N, $) {
              _.rect(A, k, N, $), this.__originalRect(A, k, N, $);
            }, M.closePath = function() {
              _.closePath(), this.__originalClosePath();
            }, M.beginPath = function() {
              _.beginPath(), this.__originalBeginPath();
            };
          }
          class T {
            constructor(_) {
              this.canvasFactory = _, this.cache = /* @__PURE__ */ Object.create(null);
            }
            getCanvas(_, A, k) {
              let N;
              return this.cache[_] !== void 0 ? (N = this.cache[_], this.canvasFactory.reset(N, A, k)) : (N = this.canvasFactory.create(A, k), this.cache[_] = N), N;
            }
            delete(_) {
              delete this.cache[_];
            }
            clear() {
              for (const _ in this.cache) {
                const A = this.cache[_];
                this.canvasFactory.destroy(A), delete this.cache[_];
              }
            }
          }
          function D(M, _, A, k, N, $, z, B, Y, ce) {
            const [de, me, Ae, _e, te, se] = (0, i.getCurrentTransform)(M);
            if (me === 0 && Ae === 0) {
              const J = z * de + te, ae = Math.round(J), be = B * _e + se, we = Math.round(be), Ee = (z + Y) * de + te, ee = Math.abs(Math.round(Ee) - ae) || 1, Fe = (B + ce) * _e + se, ke = Math.abs(Math.round(Fe) - we) || 1;
              return M.setTransform(Math.sign(de), 0, 0, Math.sign(_e), ae, we), M.drawImage(_, A, k, N, $, 0, 0, ee, ke), M.setTransform(de, me, Ae, _e, te, se), [ee, ke];
            }
            if (de === 0 && _e === 0) {
              const J = B * Ae + te, ae = Math.round(J), be = z * me + se, we = Math.round(be), Ee = (B + ce) * Ae + te, ee = Math.abs(Math.round(Ee) - ae) || 1, Fe = (z + Y) * me + se, ke = Math.abs(Math.round(Fe) - we) || 1;
              return M.setTransform(0, Math.sign(me), Math.sign(Ae), 0, ae, we), M.drawImage(_, A, k, N, $, 0, 0, ke, ee), M.setTransform(de, me, Ae, _e, te, se), [ke, ee];
            }
            M.drawImage(_, A, k, N, $, z, B, Y, ce);
            const R = Math.hypot(de, me), H = Math.hypot(Ae, _e);
            return [R * Y, H * ce];
          }
          function F(M) {
            const {
              width: _,
              height: A
            } = M;
            if (_ > x || A > x)
              return null;
            const k = 1e3, N = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), $ = _ + 1;
            let z = new Uint8Array($ * (A + 1)), B, Y, ce;
            const de = _ + 7 & -8;
            let me = new Uint8Array(de * A), Ae = 0;
            for (const H of M.data) {
              let J = 128;
              for (; J > 0; )
                me[Ae++] = H & J ? 0 : 255, J >>= 1;
            }
            let _e = 0;
            for (Ae = 0, me[Ae] !== 0 && (z[0] = 1, ++_e), Y = 1; Y < _; Y++)
              me[Ae] !== me[Ae + 1] && (z[Y] = me[Ae] ? 2 : 1, ++_e), Ae++;
            for (me[Ae] !== 0 && (z[Y] = 2, ++_e), B = 1; B < A; B++) {
              Ae = B * de, ce = B * $, me[Ae - de] !== me[Ae] && (z[ce] = me[Ae] ? 1 : 8, ++_e);
              let H = (me[Ae] ? 4 : 0) + (me[Ae - de] ? 8 : 0);
              for (Y = 1; Y < _; Y++)
                H = (H >> 2) + (me[Ae + 1] ? 4 : 0) + (me[Ae - de + 1] ? 8 : 0), N[H] && (z[ce + Y] = N[H], ++_e), Ae++;
              if (me[Ae - de] !== me[Ae] && (z[ce + Y] = me[Ae] ? 2 : 4, ++_e), _e > k)
                return null;
            }
            for (Ae = de * (A - 1), ce = B * $, me[Ae] !== 0 && (z[ce] = 8, ++_e), Y = 1; Y < _; Y++)
              me[Ae] !== me[Ae + 1] && (z[ce + Y] = me[Ae] ? 4 : 8, ++_e), Ae++;
            if (me[Ae] !== 0 && (z[ce + Y] = 4, ++_e), _e > k)
              return null;
            const te = new Int32Array([0, $, -1, 0, -$, 0, 0, 0, 1]), se = new Path2D();
            for (B = 0; _e && B <= A; B++) {
              let H = B * $;
              const J = H + _;
              for (; H < J && !z[H]; )
                H++;
              if (H === J)
                continue;
              se.moveTo(H % $, B);
              const ae = H;
              let be = z[H];
              do {
                const we = te[be];
                do
                  H += we;
                while (!z[H]);
                const Ee = z[H];
                Ee !== 5 && Ee !== 10 ? (be = Ee, z[H] = 0) : (be = Ee & 51 * be >> 4, z[H] &= be >> 2 | be << 2), se.lineTo(H % $, H / $ | 0), z[H] || --_e;
              } while (ae !== H);
              --B;
            }
            return me = null, z = null, function(H) {
              H.save(), H.scale(1 / _, -1 / A), H.translate(0, -A), H.fill(se), H.beginPath(), H.restore();
            };
          }
          class f {
            constructor(_, A) {
              this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = t.IDENTITY_MATRIX, this.textMatrixScale = 1, this.fontMatrix = t.FONT_IDENTITY_MATRIX, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode = t.TextRenderingMode.FILL, this.textRise = 0, this.fillColor = "#000000", this.strokeColor = "#000000", this.patternFill = !1, this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.activeSMask = null, this.transferMaps = "none", this.startNewPathAndClipBox([0, 0, _, A]);
            }
            clone() {
              const _ = Object.create(this);
              return _.clipBox = this.clipBox.slice(), _;
            }
            setCurrentPoint(_, A) {
              this.x = _, this.y = A;
            }
            updatePathMinMax(_, A, k) {
              [A, k] = t.Util.applyTransform([A, k], _), this.minX = Math.min(this.minX, A), this.minY = Math.min(this.minY, k), this.maxX = Math.max(this.maxX, A), this.maxY = Math.max(this.maxY, k);
            }
            updateRectMinMax(_, A) {
              const k = t.Util.applyTransform(A, _), N = t.Util.applyTransform(A.slice(2), _);
              this.minX = Math.min(this.minX, k[0], N[0]), this.minY = Math.min(this.minY, k[1], N[1]), this.maxX = Math.max(this.maxX, k[0], N[0]), this.maxY = Math.max(this.maxY, k[1], N[1]);
            }
            updateScalingPathMinMax(_, A) {
              t.Util.scaleMinMax(_, A), this.minX = Math.min(this.minX, A[0]), this.maxX = Math.max(this.maxX, A[1]), this.minY = Math.min(this.minY, A[2]), this.maxY = Math.max(this.maxY, A[3]);
            }
            updateCurvePathMinMax(_, A, k, N, $, z, B, Y, ce, de) {
              const me = t.Util.bezierBoundingBox(A, k, N, $, z, B, Y, ce);
              if (de) {
                de[0] = Math.min(de[0], me[0], me[2]), de[1] = Math.max(de[1], me[0], me[2]), de[2] = Math.min(de[2], me[1], me[3]), de[3] = Math.max(de[3], me[1], me[3]);
                return;
              }
              this.updateRectMinMax(_, me);
            }
            getPathBoundingBox(_ = a.PathType.FILL, A = null) {
              const k = [this.minX, this.minY, this.maxX, this.maxY];
              if (_ === a.PathType.STROKE) {
                A || (0, t.unreachable)("Stroke bounding box must include transform.");
                const N = t.Util.singularValueDecompose2dScale(A), $ = N[0] * this.lineWidth / 2, z = N[1] * this.lineWidth / 2;
                k[0] -= $, k[1] -= z, k[2] += $, k[3] += z;
              }
              return k;
            }
            updateClipFromPath() {
              const _ = t.Util.intersect(this.clipBox, this.getPathBoundingBox());
              this.startNewPathAndClipBox(_ || [0, 0, 0, 0]);
            }
            isEmptyClip() {
              return this.minX === 1 / 0;
            }
            startNewPathAndClipBox(_) {
              this.clipBox = _, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
            }
            getClippedPathBoundingBox(_ = a.PathType.FILL, A = null) {
              return t.Util.intersect(this.clipBox, this.getPathBoundingBox(_, A));
            }
          }
          function E(M, _) {
            if (typeof ImageData < "u" && _ instanceof ImageData) {
              M.putImageData(_, 0, 0);
              return;
            }
            const A = _.height, k = _.width, N = A % C, $ = (A - N) / C, z = N === 0 ? $ : $ + 1, B = M.createImageData(k, C);
            let Y = 0, ce;
            const de = _.data, me = B.data;
            let Ae, _e, te, se;
            if (_.kind === t.ImageKind.GRAYSCALE_1BPP) {
              const R = de.byteLength, H = new Uint32Array(me.buffer, 0, me.byteLength >> 2), J = H.length, ae = k + 7 >> 3, be = 4294967295, we = t.FeatureTest.isLittleEndian ? 4278190080 : 255;
              for (Ae = 0; Ae < z; Ae++) {
                for (te = Ae < $ ? C : N, ce = 0, _e = 0; _e < te; _e++) {
                  const Ee = R - Y;
                  let ee = 0;
                  const Fe = Ee > ae ? k : Ee * 8 - 7, ke = Fe & -8;
                  let We = 0, He = 0;
                  for (; ee < ke; ee += 8)
                    He = de[Y++], H[ce++] = He & 128 ? be : we, H[ce++] = He & 64 ? be : we, H[ce++] = He & 32 ? be : we, H[ce++] = He & 16 ? be : we, H[ce++] = He & 8 ? be : we, H[ce++] = He & 4 ? be : we, H[ce++] = He & 2 ? be : we, H[ce++] = He & 1 ? be : we;
                  for (; ee < Fe; ee++)
                    We === 0 && (He = de[Y++], We = 128), H[ce++] = He & We ? be : we, We >>= 1;
                }
                for (; ce < J; )
                  H[ce++] = 0;
                M.putImageData(B, 0, Ae * C);
              }
            } else if (_.kind === t.ImageKind.RGBA_32BPP) {
              for (_e = 0, se = k * C * 4, Ae = 0; Ae < $; Ae++)
                me.set(de.subarray(Y, Y + se)), Y += se, M.putImageData(B, 0, _e), _e += C;
              Ae < z && (se = k * N * 4, me.set(de.subarray(Y, Y + se)), M.putImageData(B, 0, _e));
            } else if (_.kind === t.ImageKind.RGB_24BPP)
              for (te = C, se = k * te, Ae = 0; Ae < z; Ae++) {
                for (Ae >= $ && (te = N, se = k * te), ce = 0, _e = se; _e--; )
                  me[ce++] = de[Y++], me[ce++] = de[Y++], me[ce++] = de[Y++], me[ce++] = 255;
                M.putImageData(B, 0, Ae * C);
              }
            else
              throw new Error(`bad image kind: ${_.kind}`);
          }
          function v(M, _) {
            if (_.bitmap) {
              M.drawImage(_.bitmap, 0, 0);
              return;
            }
            const A = _.height, k = _.width, N = A % C, $ = (A - N) / C, z = N === 0 ? $ : $ + 1, B = M.createImageData(k, C);
            let Y = 0;
            const ce = _.data, de = B.data;
            for (let me = 0; me < z; me++) {
              const Ae = me < $ ? C : N;
              ({
                srcPos: Y
              } = (0, s.convertBlackAndWhiteToRGBA)({
                src: ce,
                srcPos: Y,
                dest: de,
                width: k,
                height: Ae,
                nonBlackColor: 0
              })), M.putImageData(B, 0, me * C);
            }
          }
          function p(M, _) {
            const A = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
            for (const k of A)
              M[k] !== void 0 && (_[k] = M[k]);
            M.setLineDash !== void 0 && (_.setLineDash(M.getLineDash()), _.lineDashOffset = M.lineDashOffset);
          }
          function d(M) {
            if (M.strokeStyle = M.fillStyle = "#000000", M.fillRule = "nonzero", M.globalAlpha = 1, M.lineWidth = 1, M.lineCap = "butt", M.lineJoin = "miter", M.miterLimit = 10, M.globalCompositeOperation = "source-over", M.font = "10px sans-serif", M.setLineDash !== void 0 && (M.setLineDash([]), M.lineDashOffset = 0), !t.isNodeJS) {
              const {
                filter: _
              } = M;
              _ !== "none" && _ !== "" && (M.filter = "none");
            }
          }
          function g(M, _, A, k) {
            const N = M.length;
            for (let $ = 3; $ < N; $ += 4) {
              const z = M[$];
              if (z === 0)
                M[$ - 3] = _, M[$ - 2] = A, M[$ - 1] = k;
              else if (z < 255) {
                const B = 255 - z;
                M[$ - 3] = M[$ - 3] * z + _ * B >> 8, M[$ - 2] = M[$ - 2] * z + A * B >> 8, M[$ - 1] = M[$ - 1] * z + k * B >> 8;
              }
            }
          }
          function m(M, _, A) {
            const k = M.length, N = 1 / 255;
            for (let $ = 3; $ < k; $ += 4) {
              const z = A ? A[M[$]] : M[$];
              _[$] = _[$] * z * N | 0;
            }
          }
          function y(M, _, A) {
            const k = M.length;
            for (let N = 3; N < k; N += 4) {
              const $ = M[N - 3] * 77 + M[N - 2] * 152 + M[N - 1] * 28;
              _[N] = A ? _[N] * A[$ >> 8] >> 8 : _[N] * $ >> 16;
            }
          }
          function L(M, _, A, k, N, $, z, B, Y, ce, de) {
            const me = !!$, Ae = me ? $[0] : 0, _e = me ? $[1] : 0, te = me ? $[2] : 0, se = N === "Luminosity" ? y : m, H = Math.min(k, Math.ceil(1048576 / A));
            for (let J = 0; J < k; J += H) {
              const ae = Math.min(H, k - J), be = M.getImageData(B - ce, J + (Y - de), A, ae), we = _.getImageData(B, J + Y, A, ae);
              me && g(be.data, Ae, _e, te), se(be.data, we.data, z), _.putImageData(we, B, J + Y);
            }
          }
          function b(M, _, A, k) {
            const N = k[0], $ = k[1], z = k[2] - N, B = k[3] - $;
            z === 0 || B === 0 || (L(_.context, A, z, B, _.subtype, _.backdrop, _.transferMap, N, $, _.offsetX, _.offsetY), M.save(), M.globalAlpha = 1, M.globalCompositeOperation = "source-over", M.setTransform(1, 0, 0, 1, 0, 0), M.drawImage(A.canvas, 0, 0), M.restore());
          }
          function P(M, _) {
            const A = t.Util.singularValueDecompose2dScale(M);
            A[0] = Math.fround(A[0]), A[1] = Math.fround(A[1]);
            const k = Math.fround((globalThis.devicePixelRatio || 1) * i.PixelsPerInch.PDF_TO_CSS_UNITS);
            return _ !== void 0 ? _ : A[0] <= k || A[1] <= k;
          }
          const j = ["butt", "round", "square"], re = ["miter", "round", "bevel"], X = {}, Q = {}, K = class K {
            constructor(_, A, k, N, $, {
              optionalContentConfig: z,
              markedContentStack: B = null
            }, Y, ce) {
              le(this, ie);
              this.ctx = _, this.current = new f(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = A, this.objs = k, this.canvasFactory = N, this.filterFactory = $, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = B || [], this.optionalContentConfig = z, this.cachedCanvases = new T(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = Y, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = ce, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
            }
            getObject(_, A = null) {
              return typeof _ == "string" ? _.startsWith("g_") ? this.commonObjs.get(_) : this.objs.get(_) : A;
            }
            beginDrawing({
              transform: _,
              viewport: A,
              transparency: k = !1,
              background: N = null
            }) {
              const $ = this.ctx.canvas.width, z = this.ctx.canvas.height, B = this.ctx.fillStyle;
              if (this.ctx.fillStyle = N || "#ffffff", this.ctx.fillRect(0, 0, $, z), this.ctx.fillStyle = B, k) {
                const Y = this.cachedCanvases.getCanvas("transparent", $, z);
                this.compositeCtx = this.ctx, this.transparentCanvas = Y.canvas, this.ctx = Y.context, this.ctx.save(), this.ctx.transform(...(0, i.getCurrentTransform)(this.compositeCtx));
              }
              this.ctx.save(), d(this.ctx), _ && (this.ctx.transform(..._), this.outputScaleX = _[0], this.outputScaleY = _[0]), this.ctx.transform(...A.transform), this.viewportScale = A.scale, this.baseTransform = (0, i.getCurrentTransform)(this.ctx);
            }
            executeOperatorList(_, A, k, N) {
              const $ = _.argsArray, z = _.fnArray;
              let B = A || 0;
              const Y = $.length;
              if (Y === B)
                return B;
              const ce = Y - B > w && typeof k == "function", de = ce ? Date.now() + o : 0;
              let me = 0;
              const Ae = this.commonObjs, _e = this.objs;
              let te;
              for (; ; ) {
                if (N !== void 0 && B === N.nextBreakPoint)
                  return N.breakIt(B, k), B;
                if (te = z[B], te !== t.OPS.dependency)
                  this[te].apply(this, $[B]);
                else
                  for (const se of $[B]) {
                    const R = se.startsWith("g_") ? Ae : _e;
                    if (!R.has(se))
                      return R.get(se, k), B;
                  }
                if (B++, B === Y)
                  return B;
                if (ce && ++me > w) {
                  if (Date.now() > de)
                    return k(), B;
                  me = 0;
                }
              }
            }
            endDrawing() {
              Z(this, ie, nn).call(this), this.cachedCanvases.clear(), this.cachedPatterns.clear();
              for (const _ of this._cachedBitmapsMap.values()) {
                for (const A of _.values())
                  typeof HTMLCanvasElement < "u" && A instanceof HTMLCanvasElement && (A.width = A.height = 0);
                _.clear();
              }
              this._cachedBitmapsMap.clear(), Z(this, ie, sn).call(this);
            }
            _scaleImage(_, A) {
              const k = _.width, N = _.height;
              let $ = Math.max(Math.hypot(A[0], A[1]), 1), z = Math.max(Math.hypot(A[2], A[3]), 1), B = k, Y = N, ce = "prescale1", de, me;
              for (; $ > 2 && B > 1 || z > 2 && Y > 1; ) {
                let Ae = B, _e = Y;
                $ > 2 && B > 1 && (Ae = B >= 16384 ? Math.floor(B / 2) - 1 || 1 : Math.ceil(B / 2), $ /= B / Ae), z > 2 && Y > 1 && (_e = Y >= 16384 ? Math.floor(Y / 2) - 1 || 1 : Math.ceil(Y) / 2, z /= Y / _e), de = this.cachedCanvases.getCanvas(ce, Ae, _e), me = de.context, me.clearRect(0, 0, Ae, _e), me.drawImage(_, 0, 0, B, Y, 0, 0, Ae, _e), _ = de.canvas, B = Ae, Y = _e, ce = ce === "prescale1" ? "prescale2" : "prescale1";
              }
              return {
                img: _,
                paintWidth: B,
                paintHeight: Y
              };
            }
            _createMaskCanvas(_) {
              const A = this.ctx, {
                width: k,
                height: N
              } = _, $ = this.current.fillColor, z = this.current.patternFill, B = (0, i.getCurrentTransform)(A);
              let Y, ce, de, me;
              if ((_.bitmap || _.data) && _.count > 1) {
                const ee = _.bitmap || _.data.buffer;
                ce = JSON.stringify(z ? B : [B.slice(0, 4), $]), Y = this._cachedBitmapsMap.get(ee), Y || (Y = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(ee, Y));
                const Fe = Y.get(ce);
                if (Fe && !z) {
                  const ke = Math.round(Math.min(B[0], B[2]) + B[4]), We = Math.round(Math.min(B[1], B[3]) + B[5]);
                  return {
                    canvas: Fe,
                    offsetX: ke,
                    offsetY: We
                  };
                }
                de = Fe;
              }
              de || (me = this.cachedCanvases.getCanvas("maskCanvas", k, N), v(me.context, _));
              let Ae = t.Util.transform(B, [1 / k, 0, 0, -1 / N, 0, 0]);
              Ae = t.Util.transform(Ae, [1, 0, 0, 1, 0, -N]);
              const _e = t.Util.applyTransform([0, 0], Ae), te = t.Util.applyTransform([k, N], Ae), se = t.Util.normalizeRect([_e[0], _e[1], te[0], te[1]]), R = Math.round(se[2] - se[0]) || 1, H = Math.round(se[3] - se[1]) || 1, J = this.cachedCanvases.getCanvas("fillCanvas", R, H), ae = J.context, be = Math.min(_e[0], te[0]), we = Math.min(_e[1], te[1]);
              ae.translate(-be, -we), ae.transform(...Ae), de || (de = this._scaleImage(me.canvas, (0, i.getCurrentTransformInverse)(ae)), de = de.img, Y && z && Y.set(ce, de)), ae.imageSmoothingEnabled = P((0, i.getCurrentTransform)(ae), _.interpolate), D(ae, de, 0, 0, de.width, de.height, 0, 0, k, N), ae.globalCompositeOperation = "source-in";
              const Ee = t.Util.transform((0, i.getCurrentTransformInverse)(ae), [1, 0, 0, 1, -be, -we]);
              return ae.fillStyle = z ? $.getPattern(A, this, Ee, a.PathType.FILL) : $, ae.fillRect(0, 0, k, N), Y && !z && (this.cachedCanvases.delete("fillCanvas"), Y.set(ce, J.canvas)), {
                canvas: J.canvas,
                offsetX: Math.round(be),
                offsetY: Math.round(we)
              };
            }
            setLineWidth(_) {
              _ !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = _, this.ctx.lineWidth = _;
            }
            setLineCap(_) {
              this.ctx.lineCap = j[_];
            }
            setLineJoin(_) {
              this.ctx.lineJoin = re[_];
            }
            setMiterLimit(_) {
              this.ctx.miterLimit = _;
            }
            setDash(_, A) {
              const k = this.ctx;
              k.setLineDash !== void 0 && (k.setLineDash(_), k.lineDashOffset = A);
            }
            setRenderingIntent(_) {
            }
            setFlatness(_) {
            }
            setGState(_) {
              for (const [A, k] of _)
                switch (A) {
                  case "LW":
                    this.setLineWidth(k);
                    break;
                  case "LC":
                    this.setLineCap(k);
                    break;
                  case "LJ":
                    this.setLineJoin(k);
                    break;
                  case "ML":
                    this.setMiterLimit(k);
                    break;
                  case "D":
                    this.setDash(k[0], k[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent(k);
                    break;
                  case "FL":
                    this.setFlatness(k);
                    break;
                  case "Font":
                    this.setFont(k[0], k[1]);
                    break;
                  case "CA":
                    this.current.strokeAlpha = k;
                    break;
                  case "ca":
                    this.current.fillAlpha = k, this.ctx.globalAlpha = k;
                    break;
                  case "BM":
                    this.ctx.globalCompositeOperation = k;
                    break;
                  case "SMask":
                    this.current.activeSMask = k ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
                    break;
                  case "TR":
                    this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(k);
                    break;
                }
            }
            get inSMaskMode() {
              return !!this.suspendedCtx;
            }
            checkSMaskState() {
              const _ = this.inSMaskMode;
              this.current.activeSMask && !_ ? this.beginSMaskMode() : !this.current.activeSMask && _ && this.endSMaskMode();
            }
            beginSMaskMode() {
              if (this.inSMaskMode)
                throw new Error("beginSMaskMode called while already in smask mode");
              const _ = this.ctx.canvas.width, A = this.ctx.canvas.height, k = "smaskGroupAt" + this.groupLevel, N = this.cachedCanvases.getCanvas(k, _, A);
              this.suspendedCtx = this.ctx, this.ctx = N.context;
              const $ = this.ctx;
              $.setTransform(...(0, i.getCurrentTransform)(this.suspendedCtx)), p(this.suspendedCtx, $), S($, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
            }
            endSMaskMode() {
              if (!this.inSMaskMode)
                throw new Error("endSMaskMode called while not in smask mode");
              this.ctx._removeMirroring(), p(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
            }
            compose(_) {
              if (!this.current.activeSMask)
                return;
              _ ? (_[0] = Math.floor(_[0]), _[1] = Math.floor(_[1]), _[2] = Math.ceil(_[2]), _[3] = Math.ceil(_[3])) : _ = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
              const A = this.current.activeSMask, k = this.suspendedCtx;
              b(k, A, this.ctx, _), this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height), this.ctx.restore();
            }
            save() {
              this.inSMaskMode ? (p(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
              const _ = this.current;
              this.stateStack.push(_), this.current = _.clone();
            }
            restore() {
              this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), p(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null);
            }
            transform(_, A, k, N, $, z) {
              this.ctx.transform(_, A, k, N, $, z), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
            }
            constructPath(_, A, k) {
              const N = this.ctx, $ = this.current;
              let z = $.x, B = $.y, Y, ce;
              const de = (0, i.getCurrentTransform)(N), me = de[0] === 0 && de[3] === 0 || de[1] === 0 && de[2] === 0, Ae = me ? k.slice(0) : null;
              for (let _e = 0, te = 0, se = _.length; _e < se; _e++)
                switch (_[_e] | 0) {
                  case t.OPS.rectangle:
                    z = A[te++], B = A[te++];
                    const R = A[te++], H = A[te++], J = z + R, ae = B + H;
                    N.moveTo(z, B), R === 0 || H === 0 ? N.lineTo(J, ae) : (N.lineTo(J, B), N.lineTo(J, ae), N.lineTo(z, ae)), me || $.updateRectMinMax(de, [z, B, J, ae]), N.closePath();
                    break;
                  case t.OPS.moveTo:
                    z = A[te++], B = A[te++], N.moveTo(z, B), me || $.updatePathMinMax(de, z, B);
                    break;
                  case t.OPS.lineTo:
                    z = A[te++], B = A[te++], N.lineTo(z, B), me || $.updatePathMinMax(de, z, B);
                    break;
                  case t.OPS.curveTo:
                    Y = z, ce = B, z = A[te + 4], B = A[te + 5], N.bezierCurveTo(A[te], A[te + 1], A[te + 2], A[te + 3], z, B), $.updateCurvePathMinMax(de, Y, ce, A[te], A[te + 1], A[te + 2], A[te + 3], z, B, Ae), te += 6;
                    break;
                  case t.OPS.curveTo2:
                    Y = z, ce = B, N.bezierCurveTo(z, B, A[te], A[te + 1], A[te + 2], A[te + 3]), $.updateCurvePathMinMax(de, Y, ce, z, B, A[te], A[te + 1], A[te + 2], A[te + 3], Ae), z = A[te + 2], B = A[te + 3], te += 4;
                    break;
                  case t.OPS.curveTo3:
                    Y = z, ce = B, z = A[te + 2], B = A[te + 3], N.bezierCurveTo(A[te], A[te + 1], z, B, z, B), $.updateCurvePathMinMax(de, Y, ce, A[te], A[te + 1], z, B, z, B, Ae), te += 4;
                    break;
                  case t.OPS.closePath:
                    N.closePath();
                    break;
                }
              me && $.updateScalingPathMinMax(de, Ae), $.setCurrentPoint(z, B);
            }
            closePath() {
              this.ctx.closePath();
            }
            stroke(_ = !0) {
              const A = this.ctx, k = this.current.strokeColor;
              A.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof k == "object" && (k != null && k.getPattern) ? (A.save(), A.strokeStyle = k.getPattern(A, this, (0, i.getCurrentTransformInverse)(A), a.PathType.STROKE), this.rescaleAndStroke(!1), A.restore()) : this.rescaleAndStroke(!0)), _ && this.consumePath(this.current.getClippedPathBoundingBox()), A.globalAlpha = this.current.fillAlpha;
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            fill(_ = !0) {
              const A = this.ctx, k = this.current.fillColor, N = this.current.patternFill;
              let $ = !1;
              N && (A.save(), A.fillStyle = k.getPattern(A, this, (0, i.getCurrentTransformInverse)(A), a.PathType.FILL), $ = !0);
              const z = this.current.getClippedPathBoundingBox();
              this.contentVisible && z !== null && (this.pendingEOFill ? (A.fill("evenodd"), this.pendingEOFill = !1) : A.fill()), $ && A.restore(), _ && this.consumePath(z);
            }
            eoFill() {
              this.pendingEOFill = !0, this.fill();
            }
            fillStroke() {
              this.fill(!1), this.stroke(!1), this.consumePath();
            }
            eoFillStroke() {
              this.pendingEOFill = !0, this.fillStroke();
            }
            closeFillStroke() {
              this.closePath(), this.fillStroke();
            }
            closeEOFillStroke() {
              this.pendingEOFill = !0, this.closePath(), this.fillStroke();
            }
            endPath() {
              this.consumePath();
            }
            clip() {
              this.pendingClip = X;
            }
            eoClip() {
              this.pendingClip = Q;
            }
            beginText() {
              this.current.textMatrix = t.IDENTITY_MATRIX, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
            }
            endText() {
              const _ = this.pendingTextPaths, A = this.ctx;
              if (_ === void 0) {
                A.beginPath();
                return;
              }
              A.save(), A.beginPath();
              for (const k of _)
                A.setTransform(...k.transform), A.translate(k.x, k.y), k.addToPath(A, k.fontSize);
              A.restore(), A.clip(), A.beginPath(), delete this.pendingTextPaths;
            }
            setCharSpacing(_) {
              this.current.charSpacing = _;
            }
            setWordSpacing(_) {
              this.current.wordSpacing = _;
            }
            setHScale(_) {
              this.current.textHScale = _ / 100;
            }
            setLeading(_) {
              this.current.leading = -_;
            }
            setFont(_, A) {
              var de;
              const k = this.commonObjs.get(_), N = this.current;
              if (!k)
                throw new Error(`Can't find font for ${_}`);
              if (N.fontMatrix = k.fontMatrix || t.FONT_IDENTITY_MATRIX, (N.fontMatrix[0] === 0 || N.fontMatrix[3] === 0) && (0, t.warn)("Invalid font matrix for font " + _), A < 0 ? (A = -A, N.fontDirection = -1) : N.fontDirection = 1, this.current.font = k, this.current.fontSize = A, k.isType3Font)
                return;
              const $ = k.loadedName || "sans-serif", z = ((de = k.systemFontInfo) == null ? void 0 : de.css) || `"${$}", ${k.fallbackName}`;
              let B = "normal";
              k.black ? B = "900" : k.bold && (B = "bold");
              const Y = k.italic ? "italic" : "normal";
              let ce = A;
              A < h ? ce = h : A > u && (ce = u), this.current.fontSizeScale = A / ce, this.ctx.font = `${Y} ${B} ${ce}px ${z}`;
            }
            setTextRenderingMode(_) {
              this.current.textRenderingMode = _;
            }
            setTextRise(_) {
              this.current.textRise = _;
            }
            moveText(_, A) {
              this.current.x = this.current.lineX += _, this.current.y = this.current.lineY += A;
            }
            setLeadingMoveText(_, A) {
              this.setLeading(-A), this.moveText(_, A);
            }
            setTextMatrix(_, A, k, N, $, z) {
              this.current.textMatrix = [_, A, k, N, $, z], this.current.textMatrixScale = Math.hypot(_, A), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            paintChar(_, A, k, N) {
              const $ = this.ctx, z = this.current, B = z.font, Y = z.textRenderingMode, ce = z.fontSize / z.fontSizeScale, de = Y & t.TextRenderingMode.FILL_STROKE_MASK, me = !!(Y & t.TextRenderingMode.ADD_TO_PATH_FLAG), Ae = z.patternFill && !B.missingFile;
              let _e;
              (B.disableFontFace || me || Ae) && (_e = B.getPathGenerator(this.commonObjs, _)), B.disableFontFace || Ae ? ($.save(), $.translate(A, k), $.beginPath(), _e($, ce), N && $.setTransform(...N), (de === t.TextRenderingMode.FILL || de === t.TextRenderingMode.FILL_STROKE) && $.fill(), (de === t.TextRenderingMode.STROKE || de === t.TextRenderingMode.FILL_STROKE) && $.stroke(), $.restore()) : ((de === t.TextRenderingMode.FILL || de === t.TextRenderingMode.FILL_STROKE) && $.fillText(_, A, k), (de === t.TextRenderingMode.STROKE || de === t.TextRenderingMode.FILL_STROKE) && $.strokeText(_, A, k)), me && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
                transform: (0, i.getCurrentTransform)($),
                x: A,
                y: k,
                fontSize: ce,
                addToPath: _e
              });
            }
            get isFontSubpixelAAEnabled() {
              const {
                context: _
              } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
              _.scale(1.5, 1), _.fillText("I", 0, 10);
              const A = _.getImageData(0, 0, 10, 10).data;
              let k = !1;
              for (let N = 3; N < A.length; N += 4)
                if (A[N] > 0 && A[N] < 255) {
                  k = !0;
                  break;
                }
              return (0, t.shadow)(this, "isFontSubpixelAAEnabled", k);
            }
            showText(_) {
              const A = this.current, k = A.font;
              if (k.isType3Font)
                return this.showType3Text(_);
              const N = A.fontSize;
              if (N === 0)
                return;
              const $ = this.ctx, z = A.fontSizeScale, B = A.charSpacing, Y = A.wordSpacing, ce = A.fontDirection, de = A.textHScale * ce, me = _.length, Ae = k.vertical, _e = Ae ? 1 : -1, te = k.defaultVMetrics, se = N * A.fontMatrix[0], R = A.textRenderingMode === t.TextRenderingMode.FILL && !k.disableFontFace && !A.patternFill;
              $.save(), $.transform(...A.textMatrix), $.translate(A.x, A.y + A.textRise), ce > 0 ? $.scale(de, -1) : $.scale(de, 1);
              let H;
              if (A.patternFill) {
                $.save();
                const Ee = A.fillColor.getPattern($, this, (0, i.getCurrentTransformInverse)($), a.PathType.FILL);
                H = (0, i.getCurrentTransform)($), $.restore(), $.fillStyle = Ee;
              }
              let J = A.lineWidth;
              const ae = A.textMatrixScale;
              if (ae === 0 || J === 0) {
                const Ee = A.textRenderingMode & t.TextRenderingMode.FILL_STROKE_MASK;
                (Ee === t.TextRenderingMode.STROKE || Ee === t.TextRenderingMode.FILL_STROKE) && (J = this.getSinglePixelWidth());
              } else
                J /= ae;
              if (z !== 1 && ($.scale(z, z), J /= z), $.lineWidth = J, k.isInvalidPDFjsFont) {
                const Ee = [];
                let ee = 0;
                for (const Fe of _)
                  Ee.push(Fe.unicode), ee += Fe.width;
                $.fillText(Ee.join(""), 0, 0), A.x += ee * se * de, $.restore(), this.compose();
                return;
              }
              let be = 0, we;
              for (we = 0; we < me; ++we) {
                const Ee = _[we];
                if (typeof Ee == "number") {
                  be += _e * Ee * N / 1e3;
                  continue;
                }
                let ee = !1;
                const Fe = (Ee.isSpace ? Y : 0) + B, ke = Ee.fontChar, We = Ee.accent;
                let He, Ze, Me = Ee.width;
                if (Ae) {
                  const Ye = Ee.vmetric || te, Je = -(Ee.vmetric ? Ye[1] : Me * 0.5) * se, ye = Ye[2] * se;
                  Me = Ye ? -Ye[0] : Me, He = Je / z, Ze = (be + ye) / z;
                } else
                  He = be / z, Ze = 0;
                if (k.remeasure && Me > 0) {
                  const Ye = $.measureText(ke).width * 1e3 / N * z;
                  if (Me < Ye && this.isFontSubpixelAAEnabled) {
                    const Je = Me / Ye;
                    ee = !0, $.save(), $.scale(Je, 1), He /= Je;
                  } else Me !== Ye && (He += (Me - Ye) / 2e3 * N / z);
                }
                if (this.contentVisible && (Ee.isInFont || k.missingFile)) {
                  if (R && !We)
                    $.fillText(ke, He, Ze);
                  else if (this.paintChar(ke, He, Ze, H), We) {
                    const Ye = He + N * We.offset.x / z, Je = Ze - N * We.offset.y / z;
                    this.paintChar(We.fontChar, Ye, Je, H);
                  }
                }
                const Ue = Ae ? Me * se - Fe * ce : Me * se + Fe * ce;
                be += Ue, ee && $.restore();
              }
              Ae ? A.y -= be : A.x += be * de, $.restore(), this.compose();
            }
            showType3Text(_) {
              const A = this.ctx, k = this.current, N = k.font, $ = k.fontSize, z = k.fontDirection, B = N.vertical ? 1 : -1, Y = k.charSpacing, ce = k.wordSpacing, de = k.textHScale * z, me = k.fontMatrix || t.FONT_IDENTITY_MATRIX, Ae = _.length, _e = k.textRenderingMode === t.TextRenderingMode.INVISIBLE;
              let te, se, R, H;
              if (!(_e || $ === 0)) {
                for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, A.save(), A.transform(...k.textMatrix), A.translate(k.x, k.y), A.scale(de, z), te = 0; te < Ae; ++te) {
                  if (se = _[te], typeof se == "number") {
                    H = B * se * $ / 1e3, this.ctx.translate(H, 0), k.x += H * de;
                    continue;
                  }
                  const J = (se.isSpace ? ce : 0) + Y, ae = N.charProcOperatorList[se.operatorListId];
                  if (!ae) {
                    (0, t.warn)(`Type3 character "${se.operatorListId}" is not available.`);
                    continue;
                  }
                  this.contentVisible && (this.processingType3 = se, this.save(), A.scale($, $), A.transform(...me), this.executeOperatorList(ae), this.restore()), R = t.Util.applyTransform([se.width, 0], me)[0] * $ + J, A.translate(R, 0), k.x += R * de;
                }
                A.restore(), this.processingType3 = null;
              }
            }
            setCharWidth(_, A) {
            }
            setCharWidthAndBounds(_, A, k, N, $, z) {
              this.ctx.rect(k, N, $ - k, z - N), this.ctx.clip(), this.endPath();
            }
            getColorN_Pattern(_) {
              let A;
              if (_[0] === "TilingPattern") {
                const k = _[1], N = this.baseTransform || (0, i.getCurrentTransform)(this.ctx), $ = {
                  createCanvasGraphics: (z) => new K(z, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                    optionalContentConfig: this.optionalContentConfig,
                    markedContentStack: this.markedContentStack
                  })
                };
                A = new a.TilingPattern(_, k, this.ctx, $, N);
              } else
                A = this._getPattern(_[1], _[2]);
              return A;
            }
            setStrokeColorN() {
              this.current.strokeColor = this.getColorN_Pattern(arguments);
            }
            setFillColorN() {
              this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
            }
            setStrokeRGBColor(_, A, k) {
              const N = t.Util.makeHexColor(_, A, k);
              this.ctx.strokeStyle = N, this.current.strokeColor = N;
            }
            setFillRGBColor(_, A, k) {
              const N = t.Util.makeHexColor(_, A, k);
              this.ctx.fillStyle = N, this.current.fillColor = N, this.current.patternFill = !1;
            }
            _getPattern(_, A = null) {
              let k;
              return this.cachedPatterns.has(_) ? k = this.cachedPatterns.get(_) : (k = (0, a.getShadingPattern)(this.getObject(_)), this.cachedPatterns.set(_, k)), A && (k.matrix = A), k;
            }
            shadingFill(_) {
              if (!this.contentVisible)
                return;
              const A = this.ctx;
              this.save();
              const k = this._getPattern(_);
              A.fillStyle = k.getPattern(A, this, (0, i.getCurrentTransformInverse)(A), a.PathType.SHADING);
              const N = (0, i.getCurrentTransformInverse)(A);
              if (N) {
                const {
                  width: $,
                  height: z
                } = A.canvas, [B, Y, ce, de] = t.Util.getAxialAlignedBoundingBox([0, 0, $, z], N);
                this.ctx.fillRect(B, Y, ce - B, de - Y);
              } else
                this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
              this.compose(this.current.getClippedPathBoundingBox()), this.restore();
            }
            beginInlineImage() {
              (0, t.unreachable)("Should not call beginInlineImage");
            }
            beginImageData() {
              (0, t.unreachable)("Should not call beginImageData");
            }
            paintFormXObjectBegin(_, A) {
              if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(_) && _.length === 6 && this.transform(..._), this.baseTransform = (0, i.getCurrentTransform)(this.ctx), A)) {
                const k = A[2] - A[0], N = A[3] - A[1];
                this.ctx.rect(A[0], A[1], k, N), this.current.updateRectMinMax((0, i.getCurrentTransform)(this.ctx), A), this.clip(), this.endPath();
              }
            }
            paintFormXObjectEnd() {
              this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
            }
            beginGroup(_) {
              if (!this.contentVisible)
                return;
              this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
              const A = this.ctx;
              _.isolated || (0, t.info)("TODO: Support non-isolated groups."), _.knockout && (0, t.warn)("Knockout groups not supported.");
              const k = (0, i.getCurrentTransform)(A);
              if (_.matrix && A.transform(..._.matrix), !_.bbox)
                throw new Error("Bounding box is required.");
              let N = t.Util.getAxialAlignedBoundingBox(_.bbox, (0, i.getCurrentTransform)(A));
              const $ = [0, 0, A.canvas.width, A.canvas.height];
              N = t.Util.intersect(N, $) || [0, 0, 0, 0];
              const z = Math.floor(N[0]), B = Math.floor(N[1]);
              let Y = Math.max(Math.ceil(N[2]) - z, 1), ce = Math.max(Math.ceil(N[3]) - B, 1), de = 1, me = 1;
              Y > l && (de = Y / l, Y = l), ce > l && (me = ce / l, ce = l), this.current.startNewPathAndClipBox([0, 0, Y, ce]);
              let Ae = "groupAt" + this.groupLevel;
              _.smask && (Ae += "_smask_" + this.smaskCounter++ % 2);
              const _e = this.cachedCanvases.getCanvas(Ae, Y, ce), te = _e.context;
              te.scale(1 / de, 1 / me), te.translate(-z, -B), te.transform(...k), _.smask ? this.smaskStack.push({
                canvas: _e.canvas,
                context: te,
                offsetX: z,
                offsetY: B,
                scaleX: de,
                scaleY: me,
                subtype: _.smask.subtype,
                backdrop: _.smask.backdrop,
                transferMap: _.smask.transferMap || null,
                startTransformInverse: null
              }) : (A.setTransform(1, 0, 0, 1, 0, 0), A.translate(z, B), A.scale(de, me), A.save()), p(A, te), this.ctx = te, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(A), this.groupLevel++;
            }
            endGroup(_) {
              if (!this.contentVisible)
                return;
              this.groupLevel--;
              const A = this.ctx, k = this.groupStack.pop();
              if (this.ctx = k, this.ctx.imageSmoothingEnabled = !1, _.smask)
                this.tempSMask = this.smaskStack.pop(), this.restore();
              else {
                this.ctx.restore();
                const N = (0, i.getCurrentTransform)(this.ctx);
                this.restore(), this.ctx.save(), this.ctx.setTransform(...N);
                const $ = t.Util.getAxialAlignedBoundingBox([0, 0, A.canvas.width, A.canvas.height], N);
                this.ctx.drawImage(A.canvas, 0, 0), this.ctx.restore(), this.compose($);
              }
            }
            beginAnnotation(_, A, k, N, $) {
              if (Z(this, ie, nn).call(this), d(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(A) && A.length === 4) {
                const z = A[2] - A[0], B = A[3] - A[1];
                if ($ && this.annotationCanvasMap) {
                  k = k.slice(), k[4] -= A[0], k[5] -= A[1], A = A.slice(), A[0] = A[1] = 0, A[2] = z, A[3] = B;
                  const [Y, ce] = t.Util.singularValueDecompose2dScale((0, i.getCurrentTransform)(this.ctx)), {
                    viewportScale: de
                  } = this, me = Math.ceil(z * this.outputScaleX * de), Ae = Math.ceil(B * this.outputScaleY * de);
                  this.annotationCanvas = this.canvasFactory.create(me, Ae);
                  const {
                    canvas: _e,
                    context: te
                  } = this.annotationCanvas;
                  this.annotationCanvasMap.set(_, _e), this.annotationCanvas.savedCtx = this.ctx, this.ctx = te, this.ctx.save(), this.ctx.setTransform(Y, 0, 0, -ce, 0, B * ce), d(this.ctx);
                } else
                  d(this.ctx), this.ctx.rect(A[0], A[1], z, B), this.ctx.clip(), this.endPath();
              }
              this.current = new f(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...k), this.transform(...N);
            }
            endAnnotation() {
              this.annotationCanvas && (this.ctx.restore(), Z(this, ie, sn).call(this), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
            }
            paintImageMaskXObject(_) {
              if (!this.contentVisible)
                return;
              const A = _.count;
              _ = this.getObject(_.data, _), _.count = A;
              const k = this.ctx, N = this.processingType3;
              if (N && (N.compiled === void 0 && (N.compiled = F(_)), N.compiled)) {
                N.compiled(k);
                return;
              }
              const $ = this._createMaskCanvas(_), z = $.canvas;
              k.save(), k.setTransform(1, 0, 0, 1, 0, 0), k.drawImage(z, $.offsetX, $.offsetY), k.restore(), this.compose();
            }
            paintImageMaskXObjectRepeat(_, A, k = 0, N = 0, $, z) {
              if (!this.contentVisible)
                return;
              _ = this.getObject(_.data, _);
              const B = this.ctx;
              B.save();
              const Y = (0, i.getCurrentTransform)(B);
              B.transform(A, k, N, $, 0, 0);
              const ce = this._createMaskCanvas(_);
              B.setTransform(1, 0, 0, 1, ce.offsetX - Y[4], ce.offsetY - Y[5]);
              for (let de = 0, me = z.length; de < me; de += 2) {
                const Ae = t.Util.transform(Y, [A, k, N, $, z[de], z[de + 1]]), [_e, te] = t.Util.applyTransform([0, 0], Ae);
                B.drawImage(ce.canvas, _e, te);
              }
              B.restore(), this.compose();
            }
            paintImageMaskXObjectGroup(_) {
              if (!this.contentVisible)
                return;
              const A = this.ctx, k = this.current.fillColor, N = this.current.patternFill;
              for (const $ of _) {
                const {
                  data: z,
                  width: B,
                  height: Y,
                  transform: ce
                } = $, de = this.cachedCanvases.getCanvas("maskCanvas", B, Y), me = de.context;
                me.save();
                const Ae = this.getObject(z, $);
                v(me, Ae), me.globalCompositeOperation = "source-in", me.fillStyle = N ? k.getPattern(me, this, (0, i.getCurrentTransformInverse)(A), a.PathType.FILL) : k, me.fillRect(0, 0, B, Y), me.restore(), A.save(), A.transform(...ce), A.scale(1, -1), D(A, de.canvas, 0, 0, B, Y, 0, -1, 1, 1), A.restore();
              }
              this.compose();
            }
            paintImageXObject(_) {
              if (!this.contentVisible)
                return;
              const A = this.getObject(_);
              if (!A) {
                (0, t.warn)("Dependent image isn't ready yet");
                return;
              }
              this.paintInlineImageXObject(A);
            }
            paintImageXObjectRepeat(_, A, k, N) {
              if (!this.contentVisible)
                return;
              const $ = this.getObject(_);
              if (!$) {
                (0, t.warn)("Dependent image isn't ready yet");
                return;
              }
              const z = $.width, B = $.height, Y = [];
              for (let ce = 0, de = N.length; ce < de; ce += 2)
                Y.push({
                  transform: [A, 0, 0, k, N[ce], N[ce + 1]],
                  x: 0,
                  y: 0,
                  w: z,
                  h: B
                });
              this.paintInlineImageXObjectGroup($, Y);
            }
            applyTransferMapsToCanvas(_) {
              return this.current.transferMaps !== "none" && (_.filter = this.current.transferMaps, _.drawImage(_.canvas, 0, 0), _.filter = "none"), _.canvas;
            }
            applyTransferMapsToBitmap(_) {
              if (this.current.transferMaps === "none")
                return _.bitmap;
              const {
                bitmap: A,
                width: k,
                height: N
              } = _, $ = this.cachedCanvases.getCanvas("inlineImage", k, N), z = $.context;
              return z.filter = this.current.transferMaps, z.drawImage(A, 0, 0), z.filter = "none", $.canvas;
            }
            paintInlineImageXObject(_) {
              if (!this.contentVisible)
                return;
              const A = _.width, k = _.height, N = this.ctx;
              if (this.save(), !t.isNodeJS) {
                const {
                  filter: B
                } = N;
                B !== "none" && B !== "" && (N.filter = "none");
              }
              N.scale(1 / A, -1 / k);
              let $;
              if (_.bitmap)
                $ = this.applyTransferMapsToBitmap(_);
              else if (typeof HTMLElement == "function" && _ instanceof HTMLElement || !_.data)
                $ = _;
              else {
                const Y = this.cachedCanvases.getCanvas("inlineImage", A, k).context;
                E(Y, _), $ = this.applyTransferMapsToCanvas(Y);
              }
              const z = this._scaleImage($, (0, i.getCurrentTransformInverse)(N));
              N.imageSmoothingEnabled = P((0, i.getCurrentTransform)(N), _.interpolate), D(N, z.img, 0, 0, z.paintWidth, z.paintHeight, 0, -k, A, k), this.compose(), this.restore();
            }
            paintInlineImageXObjectGroup(_, A) {
              if (!this.contentVisible)
                return;
              const k = this.ctx;
              let N;
              if (_.bitmap)
                N = _.bitmap;
              else {
                const $ = _.width, z = _.height, Y = this.cachedCanvases.getCanvas("inlineImage", $, z).context;
                E(Y, _), N = this.applyTransferMapsToCanvas(Y);
              }
              for (const $ of A)
                k.save(), k.transform(...$.transform), k.scale(1, -1), D(k, N, $.x, $.y, $.w, $.h, 0, -1, 1, 1), k.restore();
              this.compose();
            }
            paintSolidColorImageMask() {
              this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
            }
            markPoint(_) {
            }
            markPointProps(_, A) {
            }
            beginMarkedContent(_) {
              this.markedContentStack.push({
                visible: !0
              });
            }
            beginMarkedContentProps(_, A) {
              _ === "OC" ? this.markedContentStack.push({
                visible: this.optionalContentConfig.isVisible(A)
              }) : this.markedContentStack.push({
                visible: !0
              }), this.contentVisible = this.isContentVisible();
            }
            endMarkedContent() {
              this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
            }
            beginCompat() {
            }
            endCompat() {
            }
            consumePath(_) {
              const A = this.current.isEmptyClip();
              this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(_);
              const k = this.ctx;
              this.pendingClip && (A || (this.pendingClip === Q ? k.clip("evenodd") : k.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), k.beginPath();
            }
            getSinglePixelWidth() {
              if (!this._cachedGetSinglePixelWidth) {
                const _ = (0, i.getCurrentTransform)(this.ctx);
                if (_[1] === 0 && _[2] === 0)
                  this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(_[0]), Math.abs(_[3]));
                else {
                  const A = Math.abs(_[0] * _[3] - _[2] * _[1]), k = Math.hypot(_[0], _[2]), N = Math.hypot(_[1], _[3]);
                  this._cachedGetSinglePixelWidth = Math.max(k, N) / A;
                }
              }
              return this._cachedGetSinglePixelWidth;
            }
            getScaleForStroking() {
              if (this._cachedScaleForStroking[0] === -1) {
                const {
                  lineWidth: _
                } = this.current, {
                  a: A,
                  b: k,
                  c: N,
                  d: $
                } = this.ctx.getTransform();
                let z, B;
                if (k === 0 && N === 0) {
                  const Y = Math.abs(A), ce = Math.abs($);
                  if (Y === ce)
                    if (_ === 0)
                      z = B = 1 / Y;
                    else {
                      const de = Y * _;
                      z = B = de < 1 ? 1 / de : 1;
                    }
                  else if (_ === 0)
                    z = 1 / Y, B = 1 / ce;
                  else {
                    const de = Y * _, me = ce * _;
                    z = de < 1 ? 1 / de : 1, B = me < 1 ? 1 / me : 1;
                  }
                } else {
                  const Y = Math.abs(A * $ - k * N), ce = Math.hypot(A, k), de = Math.hypot(N, $);
                  if (_ === 0)
                    z = de / Y, B = ce / Y;
                  else {
                    const me = _ * Y;
                    z = de > me ? de / me : 1, B = ce > me ? ce / me : 1;
                  }
                }
                this._cachedScaleForStroking[0] = z, this._cachedScaleForStroking[1] = B;
              }
              return this._cachedScaleForStroking;
            }
            rescaleAndStroke(_) {
              const {
                ctx: A
              } = this, {
                lineWidth: k
              } = this.current, [N, $] = this.getScaleForStroking();
              if (A.lineWidth = k || 1, N === 1 && $ === 1) {
                A.stroke();
                return;
              }
              const z = A.getLineDash();
              if (_ && A.save(), A.scale(N, $), z.length > 0) {
                const B = Math.max(N, $);
                A.setLineDash(z.map((Y) => Y / B)), A.lineDashOffset /= B;
              }
              A.stroke(), _ && A.restore();
            }
            isContentVisible() {
              for (let _ = this.markedContentStack.length - 1; _ >= 0; _--)
                if (!this.markedContentStack[_].visible)
                  return !1;
              return !0;
            }
          };
          ie = new WeakSet(), nn = function() {
            for (; this.stateStack.length || this.inSMaskMode; )
              this.restore();
            this.ctx.restore(), this.transparentCanvas && (this.ctx = this.compositeCtx, this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.drawImage(this.transparentCanvas, 0, 0), this.ctx.restore(), this.transparentCanvas = null);
          }, sn = function() {
            if (this.pageColors) {
              const _ = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
              if (_ !== "none") {
                const A = this.ctx.filter;
                this.ctx.filter = _, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = A;
              }
            }
          };
          let q = K;
          e.CanvasGraphics = q;
          for (const M in t.OPS)
            q.prototype[M] !== void 0 && (q.prototype[t.OPS[M]] = q.prototype[M]);
        },
        /* 12 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.TilingPattern = e.PathType = void 0, e.getShadingPattern = C;
          var t = n(1), i = n(6);
          const a = {
            FILL: "Fill",
            STROKE: "Stroke",
            SHADING: "Shading"
          };
          e.PathType = a;
          function s(F, f) {
            if (!f)
              return;
            const E = f[2] - f[0], v = f[3] - f[1], p = new Path2D();
            p.rect(f[0], f[1], E, v), F.clip(p);
          }
          class h {
            constructor() {
              this.constructor === h && (0, t.unreachable)("Cannot initialize BaseShadingPattern.");
            }
            getPattern() {
              (0, t.unreachable)("Abstract method `getPattern` called.");
            }
          }
          class u extends h {
            constructor(f) {
              super(), this._type = f[1], this._bbox = f[2], this._colorStops = f[3], this._p0 = f[4], this._p1 = f[5], this._r0 = f[6], this._r1 = f[7], this.matrix = null;
            }
            _createGradient(f) {
              let E;
              this._type === "axial" ? E = f.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (E = f.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
              for (const v of this._colorStops)
                E.addColorStop(v[0], v[1]);
              return E;
            }
            getPattern(f, E, v, p) {
              let d;
              if (p === a.STROKE || p === a.FILL) {
                const g = E.current.getClippedPathBoundingBox(p, (0, i.getCurrentTransform)(f)) || [0, 0, 0, 0], m = Math.ceil(g[2] - g[0]) || 1, y = Math.ceil(g[3] - g[1]) || 1, L = E.cachedCanvases.getCanvas("pattern", m, y, !0), b = L.context;
                b.clearRect(0, 0, b.canvas.width, b.canvas.height), b.beginPath(), b.rect(0, 0, b.canvas.width, b.canvas.height), b.translate(-g[0], -g[1]), v = t.Util.transform(v, [1, 0, 0, 1, g[0], g[1]]), b.transform(...E.baseTransform), this.matrix && b.transform(...this.matrix), s(b, this._bbox), b.fillStyle = this._createGradient(b), b.fill(), d = f.createPattern(L.canvas, "no-repeat");
                const P = new DOMMatrix(v);
                d.setTransform(P);
              } else
                s(f, this._bbox), d = this._createGradient(f);
              return d;
            }
          }
          function l(F, f, E, v, p, d, g, m) {
            const y = f.coords, L = f.colors, b = F.data, P = F.width * 4;
            let j;
            y[E + 1] > y[v + 1] && (j = E, E = v, v = j, j = d, d = g, g = j), y[v + 1] > y[p + 1] && (j = v, v = p, p = j, j = g, g = m, m = j), y[E + 1] > y[v + 1] && (j = E, E = v, v = j, j = d, d = g, g = j);
            const re = (y[E] + f.offsetX) * f.scaleX, X = (y[E + 1] + f.offsetY) * f.scaleY, Q = (y[v] + f.offsetX) * f.scaleX, q = (y[v + 1] + f.offsetY) * f.scaleY, ie = (y[p] + f.offsetX) * f.scaleX, O = (y[p + 1] + f.offsetY) * f.scaleY;
            if (X >= O)
              return;
            const G = L[d], K = L[d + 1], M = L[d + 2], _ = L[g], A = L[g + 1], k = L[g + 2], N = L[m], $ = L[m + 1], z = L[m + 2], B = Math.round(X), Y = Math.round(O);
            let ce, de, me, Ae, _e, te, se, R;
            for (let H = B; H <= Y; H++) {
              if (H < q) {
                const Ee = H < X ? 0 : (X - H) / (X - q);
                ce = re - (re - Q) * Ee, de = G - (G - _) * Ee, me = K - (K - A) * Ee, Ae = M - (M - k) * Ee;
              } else {
                let Ee;
                H > O ? Ee = 1 : q === O ? Ee = 0 : Ee = (q - H) / (q - O), ce = Q - (Q - ie) * Ee, de = _ - (_ - N) * Ee, me = A - (A - $) * Ee, Ae = k - (k - z) * Ee;
              }
              let J;
              H < X ? J = 0 : H > O ? J = 1 : J = (X - H) / (X - O), _e = re - (re - ie) * J, te = G - (G - N) * J, se = K - (K - $) * J, R = M - (M - z) * J;
              const ae = Math.round(Math.min(ce, _e)), be = Math.round(Math.max(ce, _e));
              let we = P * H + ae * 4;
              for (let Ee = ae; Ee <= be; Ee++)
                J = (ce - Ee) / (ce - _e), J < 0 ? J = 0 : J > 1 && (J = 1), b[we++] = de - (de - te) * J | 0, b[we++] = me - (me - se) * J | 0, b[we++] = Ae - (Ae - R) * J | 0, b[we++] = 255;
            }
          }
          function o(F, f, E) {
            const v = f.coords, p = f.colors;
            let d, g;
            switch (f.type) {
              case "lattice":
                const m = f.verticesPerRow, y = Math.floor(v.length / m) - 1, L = m - 1;
                for (d = 0; d < y; d++) {
                  let b = d * m;
                  for (let P = 0; P < L; P++, b++)
                    l(F, E, v[b], v[b + 1], v[b + m], p[b], p[b + 1], p[b + m]), l(F, E, v[b + m + 1], v[b + 1], v[b + m], p[b + m + 1], p[b + 1], p[b + m]);
                }
                break;
              case "triangles":
                for (d = 0, g = v.length; d < g; d += 3)
                  l(F, E, v[d], v[d + 1], v[d + 2], p[d], p[d + 1], p[d + 2]);
                break;
              default:
                throw new Error("illegal figure");
            }
          }
          class w extends h {
            constructor(f) {
              super(), this._coords = f[2], this._colors = f[3], this._figures = f[4], this._bounds = f[5], this._bbox = f[7], this._background = f[8], this.matrix = null;
            }
            _createMeshCanvas(f, E, v) {
              const m = Math.floor(this._bounds[0]), y = Math.floor(this._bounds[1]), L = Math.ceil(this._bounds[2]) - m, b = Math.ceil(this._bounds[3]) - y, P = Math.min(Math.ceil(Math.abs(L * f[0] * 1.1)), 3e3), j = Math.min(Math.ceil(Math.abs(b * f[1] * 1.1)), 3e3), re = L / P, X = b / j, Q = {
                coords: this._coords,
                colors: this._colors,
                offsetX: -m,
                offsetY: -y,
                scaleX: 1 / re,
                scaleY: 1 / X
              }, q = P + 2 * 2, ie = j + 2 * 2, O = v.getCanvas("mesh", q, ie, !1), G = O.context, K = G.createImageData(P, j);
              if (E) {
                const _ = K.data;
                for (let A = 0, k = _.length; A < k; A += 4)
                  _[A] = E[0], _[A + 1] = E[1], _[A + 2] = E[2], _[A + 3] = 255;
              }
              for (const _ of this._figures)
                o(K, _, Q);
              return G.putImageData(K, 2, 2), {
                canvas: O.canvas,
                offsetX: m - 2 * re,
                offsetY: y - 2 * X,
                scaleX: re,
                scaleY: X
              };
            }
            getPattern(f, E, v, p) {
              s(f, this._bbox);
              let d;
              if (p === a.SHADING)
                d = t.Util.singularValueDecompose2dScale((0, i.getCurrentTransform)(f));
              else if (d = t.Util.singularValueDecompose2dScale(E.baseTransform), this.matrix) {
                const m = t.Util.singularValueDecompose2dScale(this.matrix);
                d = [d[0] * m[0], d[1] * m[1]];
              }
              const g = this._createMeshCanvas(d, p === a.SHADING ? null : this._background, E.cachedCanvases);
              return p !== a.SHADING && (f.setTransform(...E.baseTransform), this.matrix && f.transform(...this.matrix)), f.translate(g.offsetX, g.offsetY), f.scale(g.scaleX, g.scaleY), f.createPattern(g.canvas, "no-repeat");
            }
          }
          class x extends h {
            getPattern() {
              return "hotpink";
            }
          }
          function C(F) {
            switch (F[0]) {
              case "RadialAxial":
                return new u(F);
              case "Mesh":
                return new w(F);
              case "Dummy":
                return new x();
            }
            throw new Error(`Unknown IR type: ${F[0]}`);
          }
          const S = {
            COLORED: 1,
            UNCOLORED: 2
          }, D = class D {
            constructor(f, E, v, p, d) {
              this.operatorList = f[2], this.matrix = f[3] || [1, 0, 0, 1, 0, 0], this.bbox = f[4], this.xstep = f[5], this.ystep = f[6], this.paintType = f[7], this.tilingType = f[8], this.color = E, this.ctx = v, this.canvasGraphicsFactory = p, this.baseTransform = d;
            }
            createPatternCanvas(f) {
              const E = this.operatorList, v = this.bbox, p = this.xstep, d = this.ystep, g = this.paintType, m = this.tilingType, y = this.color, L = this.canvasGraphicsFactory;
              (0, t.info)("TilingType: " + m);
              const b = v[0], P = v[1], j = v[2], re = v[3], X = t.Util.singularValueDecompose2dScale(this.matrix), Q = t.Util.singularValueDecompose2dScale(this.baseTransform), q = [X[0] * Q[0], X[1] * Q[1]], ie = this.getSizeAndScale(p, this.ctx.canvas.width, q[0]), O = this.getSizeAndScale(d, this.ctx.canvas.height, q[1]), G = f.cachedCanvases.getCanvas("pattern", ie.size, O.size, !0), K = G.context, M = L.createCanvasGraphics(K);
              M.groupLevel = f.groupLevel, this.setFillAndStrokeStyleToContext(M, g, y);
              let _ = b, A = P, k = j, N = re;
              return b < 0 && (_ = 0, k += Math.abs(b)), P < 0 && (A = 0, N += Math.abs(P)), K.translate(-(ie.scale * _), -(O.scale * A)), M.transform(ie.scale, 0, 0, O.scale, 0, 0), K.save(), this.clipBbox(M, _, A, k, N), M.baseTransform = (0, i.getCurrentTransform)(M.ctx), M.executeOperatorList(E), M.endDrawing(), {
                canvas: G.canvas,
                scaleX: ie.scale,
                scaleY: O.scale,
                offsetX: _,
                offsetY: A
              };
            }
            getSizeAndScale(f, E, v) {
              f = Math.abs(f);
              const p = Math.max(D.MAX_PATTERN_SIZE, E);
              let d = Math.ceil(f * v);
              return d >= p ? d = p : v = d / f, {
                scale: v,
                size: d
              };
            }
            clipBbox(f, E, v, p, d) {
              const g = p - E, m = d - v;
              f.ctx.rect(E, v, g, m), f.current.updateRectMinMax((0, i.getCurrentTransform)(f.ctx), [E, v, p, d]), f.clip(), f.endPath();
            }
            setFillAndStrokeStyleToContext(f, E, v) {
              const p = f.ctx, d = f.current;
              switch (E) {
                case S.COLORED:
                  const g = this.ctx;
                  p.fillStyle = g.fillStyle, p.strokeStyle = g.strokeStyle, d.fillColor = g.fillStyle, d.strokeColor = g.strokeStyle;
                  break;
                case S.UNCOLORED:
                  const m = t.Util.makeHexColor(v[0], v[1], v[2]);
                  p.fillStyle = m, p.strokeStyle = m, d.fillColor = m, d.strokeColor = m;
                  break;
                default:
                  throw new t.FormatError(`Unsupported paint type: ${E}`);
              }
            }
            getPattern(f, E, v, p) {
              let d = v;
              p !== a.SHADING && (d = t.Util.transform(d, E.baseTransform), this.matrix && (d = t.Util.transform(d, this.matrix)));
              const g = this.createPatternCanvas(E);
              let m = new DOMMatrix(d);
              m = m.translate(g.offsetX, g.offsetY), m = m.scale(1 / g.scaleX, 1 / g.scaleY);
              const y = f.createPattern(g.canvas, "repeat");
              return y.setTransform(m), y;
            }
          };
          qe(D, "MAX_PATTERN_SIZE", 3e3);
          let T = D;
          e.TilingPattern = T;
        },
        /* 13 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.convertBlackAndWhiteToRGBA = a, e.convertToRGBA = i, e.grayToRGBA = h;
          var t = n(1);
          function i(u) {
            switch (u.kind) {
              case t.ImageKind.GRAYSCALE_1BPP:
                return a(u);
              case t.ImageKind.RGB_24BPP:
                return s(u);
            }
            return null;
          }
          function a({
            src: u,
            srcPos: l = 0,
            dest: o,
            width: w,
            height: x,
            nonBlackColor: C = 4294967295,
            inverseDecode: S = !1
          }) {
            const T = t.FeatureTest.isLittleEndian ? 4278190080 : 255, [D, F] = S ? [C, T] : [T, C], f = w >> 3, E = w & 7, v = u.length;
            o = new Uint32Array(o.buffer);
            let p = 0;
            for (let d = 0; d < x; d++) {
              for (const m = l + f; l < m; l++) {
                const y = l < v ? u[l] : 255;
                o[p++] = y & 128 ? F : D, o[p++] = y & 64 ? F : D, o[p++] = y & 32 ? F : D, o[p++] = y & 16 ? F : D, o[p++] = y & 8 ? F : D, o[p++] = y & 4 ? F : D, o[p++] = y & 2 ? F : D, o[p++] = y & 1 ? F : D;
              }
              if (E === 0)
                continue;
              const g = l < v ? u[l++] : 255;
              for (let m = 0; m < E; m++)
                o[p++] = g & 1 << 7 - m ? F : D;
            }
            return {
              srcPos: l,
              destPos: p
            };
          }
          function s({
            src: u,
            srcPos: l = 0,
            dest: o,
            destPos: w = 0,
            width: x,
            height: C
          }) {
            let S = 0;
            const T = u.length >> 2, D = new Uint32Array(u.buffer, l, T);
            if (t.FeatureTest.isLittleEndian) {
              for (; S < T - 2; S += 3, w += 4) {
                const F = D[S], f = D[S + 1], E = D[S + 2];
                o[w] = F | 4278190080, o[w + 1] = F >>> 24 | f << 8 | 4278190080, o[w + 2] = f >>> 16 | E << 16 | 4278190080, o[w + 3] = E >>> 8 | 4278190080;
              }
              for (let F = S * 4, f = u.length; F < f; F += 3)
                o[w++] = u[F] | u[F + 1] << 8 | u[F + 2] << 16 | 4278190080;
            } else {
              for (; S < T - 2; S += 3, w += 4) {
                const F = D[S], f = D[S + 1], E = D[S + 2];
                o[w] = F | 255, o[w + 1] = F << 24 | f >>> 8 | 255, o[w + 2] = f << 16 | E >>> 16 | 255, o[w + 3] = E << 8 | 255;
              }
              for (let F = S * 4, f = u.length; F < f; F += 3)
                o[w++] = u[F] << 24 | u[F + 1] << 16 | u[F + 2] << 8 | 255;
            }
            return {
              srcPos: l,
              destPos: w
            };
          }
          function h(u, l) {
            if (t.FeatureTest.isLittleEndian)
              for (let o = 0, w = u.length; o < w; o++)
                l[o] = u[o] * 65793 | 4278190080;
            else
              for (let o = 0, w = u.length; o < w; o++)
                l[o] = u[o] * 16843008 | 255;
          }
        },
        /* 14 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.GlobalWorkerOptions = void 0;
          const n = /* @__PURE__ */ Object.create(null);
          e.GlobalWorkerOptions = n, n.workerPort = null, n.workerSrc = "";
        },
        /* 15 */
        /***/
        (r, e, n) => {
          var u, On, Nn, Pt;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.MessageHandler = void 0;
          var t = n(1);
          const i = {
            UNKNOWN: 0,
            DATA: 1,
            ERROR: 2
          }, a = {
            UNKNOWN: 0,
            CANCEL: 1,
            CANCEL_COMPLETE: 2,
            CLOSE: 3,
            ENQUEUE: 4,
            ERROR: 5,
            PULL: 6,
            PULL_COMPLETE: 7,
            START_COMPLETE: 8
          };
          function s(x) {
            switch (x instanceof Error || typeof x == "object" && x !== null || (0, t.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), x.name) {
              case "AbortException":
                return new t.AbortException(x.message);
              case "MissingPDFException":
                return new t.MissingPDFException(x.message);
              case "PasswordException":
                return new t.PasswordException(x.message, x.code);
              case "UnexpectedResponseException":
                return new t.UnexpectedResponseException(x.message, x.status);
              case "UnknownErrorException":
                return new t.UnknownErrorException(x.message, x.details);
              default:
                return new t.UnknownErrorException(x.message, x.toString());
            }
          }
          class h {
            constructor(C, S, T) {
              le(this, u);
              this.sourceName = C, this.targetName = S, this.comObj = T, this.callbackId = 1, this.streamId = 1, this.streamSinks = /* @__PURE__ */ Object.create(null), this.streamControllers = /* @__PURE__ */ Object.create(null), this.callbackCapabilities = /* @__PURE__ */ Object.create(null), this.actionHandler = /* @__PURE__ */ Object.create(null), this._onComObjOnMessage = (D) => {
                const F = D.data;
                if (F.targetName !== this.sourceName)
                  return;
                if (F.stream) {
                  Z(this, u, Nn).call(this, F);
                  return;
                }
                if (F.callback) {
                  const E = F.callbackId, v = this.callbackCapabilities[E];
                  if (!v)
                    throw new Error(`Cannot resolve callback ${E}`);
                  if (delete this.callbackCapabilities[E], F.callback === i.DATA)
                    v.resolve(F.data);
                  else if (F.callback === i.ERROR)
                    v.reject(s(F.reason));
                  else
                    throw new Error("Unexpected callback case");
                  return;
                }
                const f = this.actionHandler[F.action];
                if (!f)
                  throw new Error(`Unknown action from worker: ${F.action}`);
                if (F.callbackId) {
                  const E = this.sourceName, v = F.sourceName;
                  new Promise(function(p) {
                    p(f(F.data));
                  }).then(function(p) {
                    T.postMessage({
                      sourceName: E,
                      targetName: v,
                      callback: i.DATA,
                      callbackId: F.callbackId,
                      data: p
                    });
                  }, function(p) {
                    T.postMessage({
                      sourceName: E,
                      targetName: v,
                      callback: i.ERROR,
                      callbackId: F.callbackId,
                      reason: s(p)
                    });
                  });
                  return;
                }
                if (F.streamId) {
                  Z(this, u, On).call(this, F);
                  return;
                }
                f(F.data);
              }, T.addEventListener("message", this._onComObjOnMessage);
            }
            on(C, S) {
              const T = this.actionHandler;
              if (T[C])
                throw new Error(`There is already an actionName called "${C}"`);
              T[C] = S;
            }
            send(C, S, T) {
              this.comObj.postMessage({
                sourceName: this.sourceName,
                targetName: this.targetName,
                action: C,
                data: S
              }, T);
            }
            sendWithPromise(C, S, T) {
              const D = this.callbackId++, F = new t.PromiseCapability();
              this.callbackCapabilities[D] = F;
              try {
                this.comObj.postMessage({
                  sourceName: this.sourceName,
                  targetName: this.targetName,
                  action: C,
                  callbackId: D,
                  data: S
                }, T);
              } catch (f) {
                F.reject(f);
              }
              return F.promise;
            }
            sendWithStream(C, S, T, D) {
              const F = this.streamId++, f = this.sourceName, E = this.targetName, v = this.comObj;
              return new ReadableStream({
                start: (p) => {
                  const d = new t.PromiseCapability();
                  return this.streamControllers[F] = {
                    controller: p,
                    startCall: d,
                    pullCall: null,
                    cancelCall: null,
                    isClosed: !1
                  }, v.postMessage({
                    sourceName: f,
                    targetName: E,
                    action: C,
                    streamId: F,
                    data: S,
                    desiredSize: p.desiredSize
                  }, D), d.promise;
                },
                pull: (p) => {
                  const d = new t.PromiseCapability();
                  return this.streamControllers[F].pullCall = d, v.postMessage({
                    sourceName: f,
                    targetName: E,
                    stream: a.PULL,
                    streamId: F,
                    desiredSize: p.desiredSize
                  }), d.promise;
                },
                cancel: (p) => {
                  (0, t.assert)(p instanceof Error, "cancel must have a valid reason");
                  const d = new t.PromiseCapability();
                  return this.streamControllers[F].cancelCall = d, this.streamControllers[F].isClosed = !0, v.postMessage({
                    sourceName: f,
                    targetName: E,
                    stream: a.CANCEL,
                    streamId: F,
                    reason: s(p)
                  }), d.promise;
                }
              }, T);
            }
            destroy() {
              this.comObj.removeEventListener("message", this._onComObjOnMessage);
            }
          }
          u = new WeakSet(), On = function(C) {
            const S = C.streamId, T = this.sourceName, D = C.sourceName, F = this.comObj, f = this, E = this.actionHandler[C.action], v = {
              enqueue(p, d = 1, g) {
                if (this.isCancelled)
                  return;
                const m = this.desiredSize;
                this.desiredSize -= d, m > 0 && this.desiredSize <= 0 && (this.sinkCapability = new t.PromiseCapability(), this.ready = this.sinkCapability.promise), F.postMessage({
                  sourceName: T,
                  targetName: D,
                  stream: a.ENQUEUE,
                  streamId: S,
                  chunk: p
                }, g);
              },
              close() {
                this.isCancelled || (this.isCancelled = !0, F.postMessage({
                  sourceName: T,
                  targetName: D,
                  stream: a.CLOSE,
                  streamId: S
                }), delete f.streamSinks[S]);
              },
              error(p) {
                (0, t.assert)(p instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, F.postMessage({
                  sourceName: T,
                  targetName: D,
                  stream: a.ERROR,
                  streamId: S,
                  reason: s(p)
                }));
              },
              sinkCapability: new t.PromiseCapability(),
              onPull: null,
              onCancel: null,
              isCancelled: !1,
              desiredSize: C.desiredSize,
              ready: null
            };
            v.sinkCapability.resolve(), v.ready = v.sinkCapability.promise, this.streamSinks[S] = v, new Promise(function(p) {
              p(E(C.data, v));
            }).then(function() {
              F.postMessage({
                sourceName: T,
                targetName: D,
                stream: a.START_COMPLETE,
                streamId: S,
                success: !0
              });
            }, function(p) {
              F.postMessage({
                sourceName: T,
                targetName: D,
                stream: a.START_COMPLETE,
                streamId: S,
                reason: s(p)
              });
            });
          }, Nn = function(C) {
            const S = C.streamId, T = this.sourceName, D = C.sourceName, F = this.comObj, f = this.streamControllers[S], E = this.streamSinks[S];
            switch (C.stream) {
              case a.START_COMPLETE:
                C.success ? f.startCall.resolve() : f.startCall.reject(s(C.reason));
                break;
              case a.PULL_COMPLETE:
                C.success ? f.pullCall.resolve() : f.pullCall.reject(s(C.reason));
                break;
              case a.PULL:
                if (!E) {
                  F.postMessage({
                    sourceName: T,
                    targetName: D,
                    stream: a.PULL_COMPLETE,
                    streamId: S,
                    success: !0
                  });
                  break;
                }
                E.desiredSize <= 0 && C.desiredSize > 0 && E.sinkCapability.resolve(), E.desiredSize = C.desiredSize, new Promise(function(v) {
                  var p;
                  v((p = E.onPull) == null ? void 0 : p.call(E));
                }).then(function() {
                  F.postMessage({
                    sourceName: T,
                    targetName: D,
                    stream: a.PULL_COMPLETE,
                    streamId: S,
                    success: !0
                  });
                }, function(v) {
                  F.postMessage({
                    sourceName: T,
                    targetName: D,
                    stream: a.PULL_COMPLETE,
                    streamId: S,
                    reason: s(v)
                  });
                });
                break;
              case a.ENQUEUE:
                if ((0, t.assert)(f, "enqueue should have stream controller"), f.isClosed)
                  break;
                f.controller.enqueue(C.chunk);
                break;
              case a.CLOSE:
                if ((0, t.assert)(f, "close should have stream controller"), f.isClosed)
                  break;
                f.isClosed = !0, f.controller.close(), Z(this, u, Pt).call(this, f, S);
                break;
              case a.ERROR:
                (0, t.assert)(f, "error should have stream controller"), f.controller.error(s(C.reason)), Z(this, u, Pt).call(this, f, S);
                break;
              case a.CANCEL_COMPLETE:
                C.success ? f.cancelCall.resolve() : f.cancelCall.reject(s(C.reason)), Z(this, u, Pt).call(this, f, S);
                break;
              case a.CANCEL:
                if (!E)
                  break;
                new Promise(function(v) {
                  var p;
                  v((p = E.onCancel) == null ? void 0 : p.call(E, s(C.reason)));
                }).then(function() {
                  F.postMessage({
                    sourceName: T,
                    targetName: D,
                    stream: a.CANCEL_COMPLETE,
                    streamId: S,
                    success: !0
                  });
                }, function(v) {
                  F.postMessage({
                    sourceName: T,
                    targetName: D,
                    stream: a.CANCEL_COMPLETE,
                    streamId: S,
                    reason: s(v)
                  });
                }), E.sinkCapability.reject(s(C.reason)), E.isCancelled = !0, delete this.streamSinks[S];
                break;
              default:
                throw new Error("Unexpected stream case");
            }
          }, Pt = async function(C, S) {
            var T, D, F;
            await Promise.allSettled([(T = C.startCall) == null ? void 0 : T.promise, (D = C.pullCall) == null ? void 0 : D.promise, (F = C.cancelCall) == null ? void 0 : F.promise]), delete this.streamControllers[S];
          }, e.MessageHandler = h;
        },
        /* 16 */
        /***/
        (r, e, n) => {
          var a, s;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.Metadata = void 0;
          var t = n(1);
          class i {
            constructor({
              parsedData: u,
              rawData: l
            }) {
              le(this, a);
              le(this, s);
              he(this, a, u), he(this, s, l);
            }
            getRaw() {
              return c(this, s);
            }
            get(u) {
              return c(this, a).get(u) ?? null;
            }
            getAll() {
              return (0, t.objectFromMap)(c(this, a));
            }
            has(u) {
              return c(this, a).has(u);
            }
          }
          a = new WeakMap(), s = new WeakMap(), e.Metadata = i;
        },
        /* 17 */
        /***/
        (r, e, n) => {
          var u, l, o, w, x, C, rn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.OptionalContentConfig = void 0;
          var t = n(1), i = n(8);
          const a = Symbol("INTERNAL");
          class s {
            constructor(D, F) {
              le(this, u, !0);
              this.name = D, this.intent = F;
            }
            get visible() {
              return c(this, u);
            }
            _setVisible(D, F) {
              D !== a && (0, t.unreachable)("Internal method `_setVisible` called."), he(this, u, F);
            }
          }
          u = new WeakMap();
          class h {
            constructor(D) {
              le(this, C);
              le(this, l, null);
              le(this, o, /* @__PURE__ */ new Map());
              le(this, w, null);
              le(this, x, null);
              if (this.name = null, this.creator = null, D !== null) {
                this.name = D.name, this.creator = D.creator, he(this, x, D.order);
                for (const F of D.groups)
                  c(this, o).set(F.id, new s(F.name, F.intent));
                if (D.baseState === "OFF")
                  for (const F of c(this, o).values())
                    F._setVisible(a, !1);
                for (const F of D.on)
                  c(this, o).get(F)._setVisible(a, !0);
                for (const F of D.off)
                  c(this, o).get(F)._setVisible(a, !1);
                he(this, w, this.getHash());
              }
            }
            isVisible(D) {
              if (c(this, o).size === 0)
                return !0;
              if (!D)
                return (0, t.warn)("Optional content group not defined."), !0;
              if (D.type === "OCG")
                return c(this, o).has(D.id) ? c(this, o).get(D.id).visible : ((0, t.warn)(`Optional content group not found: ${D.id}`), !0);
              if (D.type === "OCMD") {
                if (D.expression)
                  return Z(this, C, rn).call(this, D.expression);
                if (!D.policy || D.policy === "AnyOn") {
                  for (const F of D.ids) {
                    if (!c(this, o).has(F))
                      return (0, t.warn)(`Optional content group not found: ${F}`), !0;
                    if (c(this, o).get(F).visible)
                      return !0;
                  }
                  return !1;
                } else if (D.policy === "AllOn") {
                  for (const F of D.ids) {
                    if (!c(this, o).has(F))
                      return (0, t.warn)(`Optional content group not found: ${F}`), !0;
                    if (!c(this, o).get(F).visible)
                      return !1;
                  }
                  return !0;
                } else if (D.policy === "AnyOff") {
                  for (const F of D.ids) {
                    if (!c(this, o).has(F))
                      return (0, t.warn)(`Optional content group not found: ${F}`), !0;
                    if (!c(this, o).get(F).visible)
                      return !0;
                  }
                  return !1;
                } else if (D.policy === "AllOff") {
                  for (const F of D.ids) {
                    if (!c(this, o).has(F))
                      return (0, t.warn)(`Optional content group not found: ${F}`), !0;
                    if (c(this, o).get(F).visible)
                      return !1;
                  }
                  return !0;
                }
                return (0, t.warn)(`Unknown optional content policy ${D.policy}.`), !0;
              }
              return (0, t.warn)(`Unknown group type ${D.type}.`), !0;
            }
            setVisibility(D, F = !0) {
              if (!c(this, o).has(D)) {
                (0, t.warn)(`Optional content group not found: ${D}`);
                return;
              }
              c(this, o).get(D)._setVisible(a, !!F), he(this, l, null);
            }
            get hasInitialVisibility() {
              return c(this, w) === null || this.getHash() === c(this, w);
            }
            getOrder() {
              return c(this, o).size ? c(this, x) ? c(this, x).slice() : [...c(this, o).keys()] : null;
            }
            getGroups() {
              return c(this, o).size > 0 ? (0, t.objectFromMap)(c(this, o)) : null;
            }
            getGroup(D) {
              return c(this, o).get(D) || null;
            }
            getHash() {
              if (c(this, l) !== null)
                return c(this, l);
              const D = new i.MurmurHash3_64();
              for (const [F, f] of c(this, o))
                D.update(`${F}:${f.visible}`);
              return he(this, l, D.hexdigest());
            }
          }
          l = new WeakMap(), o = new WeakMap(), w = new WeakMap(), x = new WeakMap(), C = new WeakSet(), rn = function(D) {
            const F = D.length;
            if (F < 2)
              return !0;
            const f = D[0];
            for (let E = 1; E < F; E++) {
              const v = D[E];
              let p;
              if (Array.isArray(v))
                p = Z(this, C, rn).call(this, v);
              else if (c(this, o).has(v))
                p = c(this, o).get(v).visible;
              else
                return (0, t.warn)(`Optional content group not found: ${v}`), !0;
              switch (f) {
                case "And":
                  if (!p)
                    return !1;
                  break;
                case "Or":
                  if (p)
                    return !0;
                  break;
                case "Not":
                  return !p;
                default:
                  return !0;
              }
            }
            return f === "And";
          }, e.OptionalContentConfig = h;
        },
        /* 18 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFDataTransportStream = void 0;
          var t = n(1), i = n(6);
          class a {
            constructor({
              length: l,
              initialData: o,
              progressiveDone: w = !1,
              contentDispositionFilename: x = null,
              disableRange: C = !1,
              disableStream: S = !1
            }, T) {
              if ((0, t.assert)(T, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'), this._queuedChunks = [], this._progressiveDone = w, this._contentDispositionFilename = x, (o == null ? void 0 : o.length) > 0) {
                const D = o instanceof Uint8Array && o.byteLength === o.buffer.byteLength ? o.buffer : new Uint8Array(o).buffer;
                this._queuedChunks.push(D);
              }
              this._pdfDataRangeTransport = T, this._isStreamingSupported = !S, this._isRangeSupported = !C, this._contentLength = l, this._fullRequestReader = null, this._rangeReaders = [], this._pdfDataRangeTransport.addRangeListener((D, F) => {
                this._onReceiveData({
                  begin: D,
                  chunk: F
                });
              }), this._pdfDataRangeTransport.addProgressListener((D, F) => {
                this._onProgress({
                  loaded: D,
                  total: F
                });
              }), this._pdfDataRangeTransport.addProgressiveReadListener((D) => {
                this._onReceiveData({
                  chunk: D
                });
              }), this._pdfDataRangeTransport.addProgressiveDoneListener(() => {
                this._onProgressiveDone();
              }), this._pdfDataRangeTransport.transportReady();
            }
            _onReceiveData({
              begin: l,
              chunk: o
            }) {
              const w = o instanceof Uint8Array && o.byteLength === o.buffer.byteLength ? o.buffer : new Uint8Array(o).buffer;
              if (l === void 0)
                this._fullRequestReader ? this._fullRequestReader._enqueue(w) : this._queuedChunks.push(w);
              else {
                const x = this._rangeReaders.some(function(C) {
                  return C._begin !== l ? !1 : (C._enqueue(w), !0);
                });
                (0, t.assert)(x, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
              }
            }
            get _progressiveDataLength() {
              var l;
              return ((l = this._fullRequestReader) == null ? void 0 : l._loaded) ?? 0;
            }
            _onProgress(l) {
              var o, w, x, C;
              l.total === void 0 ? (w = (o = this._rangeReaders[0]) == null ? void 0 : o.onProgress) == null || w.call(o, {
                loaded: l.loaded
              }) : (C = (x = this._fullRequestReader) == null ? void 0 : x.onProgress) == null || C.call(x, {
                loaded: l.loaded,
                total: l.total
              });
            }
            _onProgressiveDone() {
              var l;
              (l = this._fullRequestReader) == null || l.progressiveDone(), this._progressiveDone = !0;
            }
            _removeRangeReader(l) {
              const o = this._rangeReaders.indexOf(l);
              o >= 0 && this._rangeReaders.splice(o, 1);
            }
            getFullReader() {
              (0, t.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
              const l = this._queuedChunks;
              return this._queuedChunks = null, new s(this, l, this._progressiveDone, this._contentDispositionFilename);
            }
            getRangeReader(l, o) {
              if (o <= this._progressiveDataLength)
                return null;
              const w = new h(this, l, o);
              return this._pdfDataRangeTransport.requestDataRange(l, o), this._rangeReaders.push(w), w;
            }
            cancelAllRequests(l) {
              var o;
              (o = this._fullRequestReader) == null || o.cancel(l);
              for (const w of this._rangeReaders.slice(0))
                w.cancel(l);
              this._pdfDataRangeTransport.abort();
            }
          }
          e.PDFDataTransportStream = a;
          class s {
            constructor(l, o, w = !1, x = null) {
              this._stream = l, this._done = w || !1, this._filename = (0, i.isPdfFile)(x) ? x : null, this._queuedChunks = o || [], this._loaded = 0;
              for (const C of this._queuedChunks)
                this._loaded += C.byteLength;
              this._requests = [], this._headersReady = Promise.resolve(), l._fullRequestReader = this, this.onProgress = null;
            }
            _enqueue(l) {
              this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
                value: l,
                done: !1
              }) : this._queuedChunks.push(l), this._loaded += l.byteLength);
            }
            get headersReady() {
              return this._headersReady;
            }
            get filename() {
              return this._filename;
            }
            get isRangeSupported() {
              return this._stream._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._stream._isStreamingSupported;
            }
            get contentLength() {
              return this._stream._contentLength;
            }
            async read() {
              if (this._queuedChunks.length > 0)
                return {
                  value: this._queuedChunks.shift(),
                  done: !1
                };
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const l = new t.PromiseCapability();
              return this._requests.push(l), l.promise;
            }
            cancel(l) {
              this._done = !0;
              for (const o of this._requests)
                o.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0;
            }
            progressiveDone() {
              this._done || (this._done = !0);
            }
          }
          class h {
            constructor(l, o, w) {
              this._stream = l, this._begin = o, this._end = w, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
            }
            _enqueue(l) {
              if (!this._done) {
                if (this._requests.length === 0)
                  this._queuedChunk = l;
                else {
                  this._requests.shift().resolve({
                    value: l,
                    done: !1
                  });
                  for (const w of this._requests)
                    w.resolve({
                      value: void 0,
                      done: !0
                    });
                  this._requests.length = 0;
                }
                this._done = !0, this._stream._removeRangeReader(this);
              }
            }
            get isStreamingSupported() {
              return !1;
            }
            async read() {
              if (this._queuedChunk) {
                const o = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: o,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const l = new t.PromiseCapability();
              return this._requests.push(l), l.promise;
            }
            cancel(l) {
              this._done = !0;
              for (const o of this._requests)
                o.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._stream._removeRangeReader(this);
            }
          }
        },
        /* 19 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFFetchStream = void 0;
          var t = n(1), i = n(20);
          function a(w, x, C) {
            return {
              method: "GET",
              headers: w,
              signal: C.signal,
              mode: "cors",
              credentials: x ? "include" : "same-origin",
              redirect: "follow"
            };
          }
          function s(w) {
            const x = new Headers();
            for (const C in w) {
              const S = w[C];
              S !== void 0 && x.append(C, S);
            }
            return x;
          }
          function h(w) {
            return w instanceof Uint8Array ? w.buffer : w instanceof ArrayBuffer ? w : ((0, t.warn)(`getArrayBuffer - unexpected data format: ${w}`), new Uint8Array(w).buffer);
          }
          class u {
            constructor(x) {
              this.source = x, this.isHttp = /^https?:/i.test(x.url), this.httpHeaders = this.isHttp && x.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var x;
              return ((x = this._fullRequestReader) == null ? void 0 : x._loaded) ?? 0;
            }
            getFullReader() {
              return (0, t.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new l(this), this._fullRequestReader;
            }
            getRangeReader(x, C) {
              if (C <= this._progressiveDataLength)
                return null;
              const S = new o(this, x, C);
              return this._rangeRequestReaders.push(S), S;
            }
            cancelAllRequests(x) {
              var C;
              (C = this._fullRequestReader) == null || C.cancel(x);
              for (const S of this._rangeRequestReaders.slice(0))
                S.cancel(x);
            }
          }
          e.PDFFetchStream = u;
          class l {
            constructor(x) {
              this._stream = x, this._reader = null, this._loaded = 0, this._filename = null;
              const C = x.source;
              this._withCredentials = C.withCredentials || !1, this._contentLength = C.length, this._headersCapability = new t.PromiseCapability(), this._disableRange = C.disableRange || !1, this._rangeChunkSize = C.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !C.disableStream, this._isRangeSupported = !C.disableRange, this._headers = s(this._stream.httpHeaders);
              const S = C.url;
              fetch(S, a(this._headers, this._withCredentials, this._abortController)).then((T) => {
                if (!(0, i.validateResponseStatus)(T.status))
                  throw (0, i.createResponseStatusError)(T.status, S);
                this._reader = T.body.getReader(), this._headersCapability.resolve();
                const D = (E) => T.headers.get(E), {
                  allowRangeRequests: F,
                  suggestedLength: f
                } = (0, i.validateRangeRequestCapabilities)({
                  getResponseHeader: D,
                  isHttp: this._stream.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = F, this._contentLength = f || this._contentLength, this._filename = (0, i.extractFilenameFromHeader)(D), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new t.AbortException("Streaming is disabled."));
              }).catch(this._headersCapability.reject), this.onProgress = null;
            }
            get headersReady() {
              return this._headersCapability.promise;
            }
            get filename() {
              return this._filename;
            }
            get contentLength() {
              return this._contentLength;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var S;
              await this._headersCapability.promise;
              const {
                value: x,
                done: C
              } = await this._reader.read();
              return C ? {
                value: x,
                done: C
              } : (this._loaded += x.byteLength, (S = this.onProgress) == null || S.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: h(x),
                done: !1
              });
            }
            cancel(x) {
              var C;
              (C = this._reader) == null || C.cancel(x), this._abortController.abort();
            }
          }
          class o {
            constructor(x, C, S) {
              this._stream = x, this._reader = null, this._loaded = 0;
              const T = x.source;
              this._withCredentials = T.withCredentials || !1, this._readCapability = new t.PromiseCapability(), this._isStreamingSupported = !T.disableStream, this._abortController = new AbortController(), this._headers = s(this._stream.httpHeaders), this._headers.append("Range", `bytes=${C}-${S - 1}`);
              const D = T.url;
              fetch(D, a(this._headers, this._withCredentials, this._abortController)).then((F) => {
                if (!(0, i.validateResponseStatus)(F.status))
                  throw (0, i.createResponseStatusError)(F.status, D);
                this._readCapability.resolve(), this._reader = F.body.getReader();
              }).catch(this._readCapability.reject), this.onProgress = null;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var S;
              await this._readCapability.promise;
              const {
                value: x,
                done: C
              } = await this._reader.read();
              return C ? {
                value: x,
                done: C
              } : (this._loaded += x.byteLength, (S = this.onProgress) == null || S.call(this, {
                loaded: this._loaded
              }), {
                value: h(x),
                done: !1
              });
            }
            cancel(x) {
              var C;
              (C = this._reader) == null || C.cancel(x), this._abortController.abort();
            }
          }
        },
        /* 20 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.createResponseStatusError = u, e.extractFilenameFromHeader = h, e.validateRangeRequestCapabilities = s, e.validateResponseStatus = l;
          var t = n(1), i = n(21), a = n(6);
          function s({
            getResponseHeader: o,
            isHttp: w,
            rangeChunkSize: x,
            disableRange: C
          }) {
            const S = {
              allowRangeRequests: !1,
              suggestedLength: void 0
            }, T = parseInt(o("Content-Length"), 10);
            return !Number.isInteger(T) || (S.suggestedLength = T, T <= 2 * x) || C || !w || o("Accept-Ranges") !== "bytes" || (o("Content-Encoding") || "identity") !== "identity" || (S.allowRangeRequests = !0), S;
          }
          function h(o) {
            const w = o("Content-Disposition");
            if (w) {
              let x = (0, i.getFilenameFromContentDispositionHeader)(w);
              if (x.includes("%"))
                try {
                  x = decodeURIComponent(x);
                } catch {
                }
              if ((0, a.isPdfFile)(x))
                return x;
            }
            return null;
          }
          function u(o, w) {
            return o === 404 || o === 0 && w.startsWith("file:") ? new t.MissingPDFException('Missing PDF "' + w + '".') : new t.UnexpectedResponseException(`Unexpected server response (${o}) while retrieving PDF "${w}".`, o);
          }
          function l(o) {
            return o === 200 || o === 206;
          }
        },
        /* 21 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.getFilenameFromContentDispositionHeader = i;
          var t = n(1);
          function i(a) {
            let s = !0, h = u("filename\\*", "i").exec(a);
            if (h) {
              h = h[1];
              let T = x(h);
              return T = unescape(T), T = C(T), T = S(T), o(T);
            }
            if (h = w(a), h) {
              const T = S(h);
              return o(T);
            }
            if (h = u("filename", "i").exec(a), h) {
              h = h[1];
              let T = x(h);
              return T = S(T), o(T);
            }
            function u(T, D) {
              return new RegExp("(?:^|;)\\s*" + T + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', D);
            }
            function l(T, D) {
              if (T) {
                if (!/^[\x00-\xFF]+$/.test(D))
                  return D;
                try {
                  const F = new TextDecoder(T, {
                    fatal: !0
                  }), f = (0, t.stringToBytes)(D);
                  D = F.decode(f), s = !1;
                } catch {
                }
              }
              return D;
            }
            function o(T) {
              return s && /[\x80-\xff]/.test(T) && (T = l("utf-8", T), s && (T = l("iso-8859-1", T))), T;
            }
            function w(T) {
              const D = [];
              let F;
              const f = u("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
              for (; (F = f.exec(T)) !== null; ) {
                let [, v, p, d] = F;
                if (v = parseInt(v, 10), v in D) {
                  if (v === 0)
                    break;
                  continue;
                }
                D[v] = [p, d];
              }
              const E = [];
              for (let v = 0; v < D.length && v in D; ++v) {
                let [p, d] = D[v];
                d = x(d), p && (d = unescape(d), v === 0 && (d = C(d))), E.push(d);
              }
              return E.join("");
            }
            function x(T) {
              if (T.startsWith('"')) {
                const D = T.slice(1).split('\\"');
                for (let F = 0; F < D.length; ++F) {
                  const f = D[F].indexOf('"');
                  f !== -1 && (D[F] = D[F].slice(0, f), D.length = F + 1), D[F] = D[F].replaceAll(/\\(.)/g, "$1");
                }
                T = D.join('"');
              }
              return T;
            }
            function C(T) {
              const D = T.indexOf("'");
              if (D === -1)
                return T;
              const F = T.slice(0, D), E = T.slice(D + 1).replace(/^[^']*'/, "");
              return l(F, E);
            }
            function S(T) {
              return !T.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(T) ? T : T.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(D, F, f, E) {
                if (f === "q" || f === "Q")
                  return E = E.replaceAll("_", " "), E = E.replaceAll(/=([0-9a-fA-F]{2})/g, function(v, p) {
                    return String.fromCharCode(parseInt(p, 16));
                  }), l(F, E);
                try {
                  E = atob(E);
                } catch {
                }
                return l(F, E);
              });
            }
            return "";
          }
        },
        /* 22 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFNetworkStream = void 0;
          var t = n(1), i = n(20);
          const a = 200, s = 206;
          function h(x) {
            const C = x.response;
            return typeof C != "string" ? C : (0, t.stringToBytes)(C).buffer;
          }
          class u {
            constructor(C, S = {}) {
              this.url = C, this.isHttp = /^https?:/i.test(C), this.httpHeaders = this.isHttp && S.httpHeaders || /* @__PURE__ */ Object.create(null), this.withCredentials = S.withCredentials || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
            }
            requestRange(C, S, T) {
              const D = {
                begin: C,
                end: S
              };
              for (const F in T)
                D[F] = T[F];
              return this.request(D);
            }
            requestFull(C) {
              return this.request(C);
            }
            request(C) {
              const S = new XMLHttpRequest(), T = this.currXhrId++, D = this.pendingRequests[T] = {
                xhr: S
              };
              S.open("GET", this.url), S.withCredentials = this.withCredentials;
              for (const F in this.httpHeaders) {
                const f = this.httpHeaders[F];
                f !== void 0 && S.setRequestHeader(F, f);
              }
              return this.isHttp && "begin" in C && "end" in C ? (S.setRequestHeader("Range", `bytes=${C.begin}-${C.end - 1}`), D.expectedStatus = s) : D.expectedStatus = a, S.responseType = "arraybuffer", C.onError && (S.onerror = function(F) {
                C.onError(S.status);
              }), S.onreadystatechange = this.onStateChange.bind(this, T), S.onprogress = this.onProgress.bind(this, T), D.onHeadersReceived = C.onHeadersReceived, D.onDone = C.onDone, D.onError = C.onError, D.onProgress = C.onProgress, S.send(null), T;
            }
            onProgress(C, S) {
              var D;
              const T = this.pendingRequests[C];
              T && ((D = T.onProgress) == null || D.call(T, S));
            }
            onStateChange(C, S) {
              var v, p, d;
              const T = this.pendingRequests[C];
              if (!T)
                return;
              const D = T.xhr;
              if (D.readyState >= 2 && T.onHeadersReceived && (T.onHeadersReceived(), delete T.onHeadersReceived), D.readyState !== 4 || !(C in this.pendingRequests))
                return;
              if (delete this.pendingRequests[C], D.status === 0 && this.isHttp) {
                (v = T.onError) == null || v.call(T, D.status);
                return;
              }
              const F = D.status || a;
              if (!(F === a && T.expectedStatus === s) && F !== T.expectedStatus) {
                (p = T.onError) == null || p.call(T, D.status);
                return;
              }
              const E = h(D);
              if (F === s) {
                const g = D.getResponseHeader("Content-Range"), m = /bytes (\d+)-(\d+)\/(\d+)/.exec(g);
                T.onDone({
                  begin: parseInt(m[1], 10),
                  chunk: E
                });
              } else E ? T.onDone({
                begin: 0,
                chunk: E
              }) : (d = T.onError) == null || d.call(T, D.status);
            }
            getRequestXhr(C) {
              return this.pendingRequests[C].xhr;
            }
            isPendingRequest(C) {
              return C in this.pendingRequests;
            }
            abortRequest(C) {
              const S = this.pendingRequests[C].xhr;
              delete this.pendingRequests[C], S.abort();
            }
          }
          class l {
            constructor(C) {
              this._source = C, this._manager = new u(C.url, {
                httpHeaders: C.httpHeaders,
                withCredentials: C.withCredentials
              }), this._rangeChunkSize = C.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            _onRangeRequestReaderClosed(C) {
              const S = this._rangeRequestReaders.indexOf(C);
              S >= 0 && this._rangeRequestReaders.splice(S, 1);
            }
            getFullReader() {
              return (0, t.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new o(this._manager, this._source), this._fullRequestReader;
            }
            getRangeReader(C, S) {
              const T = new w(this._manager, C, S);
              return T.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(T), T;
            }
            cancelAllRequests(C) {
              var S;
              (S = this._fullRequestReader) == null || S.cancel(C);
              for (const T of this._rangeRequestReaders.slice(0))
                T.cancel(C);
            }
          }
          e.PDFNetworkStream = l;
          class o {
            constructor(C, S) {
              this._manager = C;
              const T = {
                onHeadersReceived: this._onHeadersReceived.bind(this),
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = S.url, this._fullRequestId = C.requestFull(T), this._headersReceivedCapability = new t.PromiseCapability(), this._disableRange = S.disableRange || !1, this._contentLength = S.length, this._rangeChunkSize = S.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !1, this._isRangeSupported = !1, this._cachedChunks = [], this._requests = [], this._done = !1, this._storedError = void 0, this._filename = null, this.onProgress = null;
            }
            _onHeadersReceived() {
              const C = this._fullRequestId, S = this._manager.getRequestXhr(C), T = (f) => S.getResponseHeader(f), {
                allowRangeRequests: D,
                suggestedLength: F
              } = (0, i.validateRangeRequestCapabilities)({
                getResponseHeader: T,
                isHttp: this._manager.isHttp,
                rangeChunkSize: this._rangeChunkSize,
                disableRange: this._disableRange
              });
              D && (this._isRangeSupported = !0), this._contentLength = F || this._contentLength, this._filename = (0, i.extractFilenameFromHeader)(T), this._isRangeSupported && this._manager.abortRequest(C), this._headersReceivedCapability.resolve();
            }
            _onDone(C) {
              if (C && (this._requests.length > 0 ? this._requests.shift().resolve({
                value: C.chunk,
                done: !1
              }) : this._cachedChunks.push(C.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
                for (const S of this._requests)
                  S.resolve({
                    value: void 0,
                    done: !0
                  });
                this._requests.length = 0;
              }
            }
            _onError(C) {
              this._storedError = (0, i.createResponseStatusError)(C, this._url), this._headersReceivedCapability.reject(this._storedError);
              for (const S of this._requests)
                S.reject(this._storedError);
              this._requests.length = 0, this._cachedChunks.length = 0;
            }
            _onProgress(C) {
              var S;
              (S = this.onProgress) == null || S.call(this, {
                loaded: C.loaded,
                total: C.lengthComputable ? C.total : this._contentLength
              });
            }
            get filename() {
              return this._filename;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            get contentLength() {
              return this._contentLength;
            }
            get headersReady() {
              return this._headersReceivedCapability.promise;
            }
            async read() {
              if (this._storedError)
                throw this._storedError;
              if (this._cachedChunks.length > 0)
                return {
                  value: this._cachedChunks.shift(),
                  done: !1
                };
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const C = new t.PromiseCapability();
              return this._requests.push(C), C.promise;
            }
            cancel(C) {
              this._done = !0, this._headersReceivedCapability.reject(C);
              for (const S of this._requests)
                S.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
            }
          }
          class w {
            constructor(C, S, T) {
              this._manager = C;
              const D = {
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = C.url, this._requestId = C.requestRange(S, T, D), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
            }
            _close() {
              var C;
              (C = this.onClosed) == null || C.call(this, this);
            }
            _onDone(C) {
              const S = C.chunk;
              this._requests.length > 0 ? this._requests.shift().resolve({
                value: S,
                done: !1
              }) : this._queuedChunk = S, this._done = !0;
              for (const T of this._requests)
                T.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._close();
            }
            _onError(C) {
              this._storedError = (0, i.createResponseStatusError)(C, this._url);
              for (const S of this._requests)
                S.reject(this._storedError);
              this._requests.length = 0, this._queuedChunk = null;
            }
            _onProgress(C) {
              var S;
              this.isStreamingSupported || (S = this.onProgress) == null || S.call(this, {
                loaded: C.loaded
              });
            }
            get isStreamingSupported() {
              return !1;
            }
            async read() {
              if (this._storedError)
                throw this._storedError;
              if (this._queuedChunk !== null) {
                const S = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: S,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const C = new t.PromiseCapability();
              return this._requests.push(C), C.promise;
            }
            cancel(C) {
              this._done = !0;
              for (const S of this._requests)
                S.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
            }
          }
        },
        /* 23 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.PDFNodeStream = void 0;
          var t = n(1), i = n(20);
          const a = /^file:\/\/\/[a-zA-Z]:\//;
          function s(T) {
            const D = require$$5, F = D.parse(T);
            return F.protocol === "file:" || F.host ? F : /^[a-z]:[/\\]/i.test(T) ? D.parse(`file:///${T}`) : (F.host || (F.protocol = "file:"), F);
          }
          class h {
            constructor(D) {
              this.source = D, this.url = s(D.url), this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:", this.isFsUrl = this.url.protocol === "file:", this.httpHeaders = this.isHttp && D.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var D;
              return ((D = this._fullRequestReader) == null ? void 0 : D._loaded) ?? 0;
            }
            getFullReader() {
              return (0, t.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = this.isFsUrl ? new C(this) : new w(this), this._fullRequestReader;
            }
            getRangeReader(D, F) {
              if (F <= this._progressiveDataLength)
                return null;
              const f = this.isFsUrl ? new S(this, D, F) : new x(this, D, F);
              return this._rangeRequestReaders.push(f), f;
            }
            cancelAllRequests(D) {
              var F;
              (F = this._fullRequestReader) == null || F.cancel(D);
              for (const f of this._rangeRequestReaders.slice(0))
                f.cancel(D);
            }
          }
          e.PDFNodeStream = h;
          class u {
            constructor(D) {
              this._url = D.url, this._done = !1, this._storedError = null, this.onProgress = null;
              const F = D.source;
              this._contentLength = F.length, this._loaded = 0, this._filename = null, this._disableRange = F.disableRange || !1, this._rangeChunkSize = F.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !F.disableStream, this._isRangeSupported = !F.disableRange, this._readableStream = null, this._readCapability = new t.PromiseCapability(), this._headersCapability = new t.PromiseCapability();
            }
            get headersReady() {
              return this._headersCapability.promise;
            }
            get filename() {
              return this._filename;
            }
            get contentLength() {
              return this._contentLength;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var f;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const D = this._readableStream.read();
              return D === null ? (this._readCapability = new t.PromiseCapability(), this.read()) : (this._loaded += D.length, (f = this.onProgress) == null || f.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: new Uint8Array(D).buffer,
                done: !1
              });
            }
            cancel(D) {
              if (!this._readableStream) {
                this._error(D);
                return;
              }
              this._readableStream.destroy(D);
            }
            _error(D) {
              this._storedError = D, this._readCapability.resolve();
            }
            _setReadableStream(D) {
              this._readableStream = D, D.on("readable", () => {
                this._readCapability.resolve();
              }), D.on("end", () => {
                D.destroy(), this._done = !0, this._readCapability.resolve();
              }), D.on("error", (F) => {
                this._error(F);
              }), !this._isStreamingSupported && this._isRangeSupported && this._error(new t.AbortException("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class l {
            constructor(D) {
              this._url = D.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = new t.PromiseCapability();
              const F = D.source;
              this._isStreamingSupported = !F.disableStream;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var f;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const D = this._readableStream.read();
              return D === null ? (this._readCapability = new t.PromiseCapability(), this.read()) : (this._loaded += D.length, (f = this.onProgress) == null || f.call(this, {
                loaded: this._loaded
              }), {
                value: new Uint8Array(D).buffer,
                done: !1
              });
            }
            cancel(D) {
              if (!this._readableStream) {
                this._error(D);
                return;
              }
              this._readableStream.destroy(D);
            }
            _error(D) {
              this._storedError = D, this._readCapability.resolve();
            }
            _setReadableStream(D) {
              this._readableStream = D, D.on("readable", () => {
                this._readCapability.resolve();
              }), D.on("end", () => {
                D.destroy(), this._done = !0, this._readCapability.resolve();
              }), D.on("error", (F) => {
                this._error(F);
              }), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          function o(T, D) {
            return {
              protocol: T.protocol,
              auth: T.auth,
              host: T.hostname,
              port: T.port,
              path: T.path,
              method: "GET",
              headers: D
            };
          }
          class w extends u {
            constructor(D) {
              super(D);
              const F = (f) => {
                if (f.statusCode === 404) {
                  const d = new t.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = d, this._headersCapability.reject(d);
                  return;
                }
                this._headersCapability.resolve(), this._setReadableStream(f);
                const E = (d) => this._readableStream.headers[d.toLowerCase()], {
                  allowRangeRequests: v,
                  suggestedLength: p
                } = (0, i.validateRangeRequestCapabilities)({
                  getResponseHeader: E,
                  isHttp: D.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = v, this._contentLength = p || this._contentLength, this._filename = (0, i.extractFilenameFromHeader)(E);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const f = require$$5;
                this._request = f.request(o(this._url, D.httpHeaders), F);
              } else {
                const f = require$$5;
                this._request = f.request(o(this._url, D.httpHeaders), F);
              }
              this._request.on("error", (f) => {
                this._storedError = f, this._headersCapability.reject(f);
              }), this._request.end();
            }
          }
          class x extends l {
            constructor(D, F, f) {
              super(D), this._httpHeaders = {};
              for (const v in D.httpHeaders) {
                const p = D.httpHeaders[v];
                p !== void 0 && (this._httpHeaders[v] = p);
              }
              this._httpHeaders.Range = `bytes=${F}-${f - 1}`;
              const E = (v) => {
                if (v.statusCode === 404) {
                  const p = new t.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = p;
                  return;
                }
                this._setReadableStream(v);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const v = require$$5;
                this._request = v.request(o(this._url, this._httpHeaders), E);
              } else {
                const v = require$$5;
                this._request = v.request(o(this._url, this._httpHeaders), E);
              }
              this._request.on("error", (v) => {
                this._storedError = v;
              }), this._request.end();
            }
          }
          class C extends u {
            constructor(D) {
              super(D);
              let F = decodeURIComponent(this._url.path);
              a.test(this._url.href) && (F = F.replace(/^\//, ""));
              const f = require$$5;
              f.lstat(F, (E, v) => {
                if (E) {
                  E.code === "ENOENT" && (E = new t.MissingPDFException(`Missing PDF "${F}".`)), this._storedError = E, this._headersCapability.reject(E);
                  return;
                }
                this._contentLength = v.size, this._setReadableStream(f.createReadStream(F)), this._headersCapability.resolve();
              });
            }
          }
          class S extends l {
            constructor(D, F, f) {
              super(D);
              let E = decodeURIComponent(this._url.path);
              a.test(this._url.href) && (E = E.replace(/^\//, ""));
              const v = require$$5;
              this._setReadableStream(v.createReadStream(E, {
                start: F,
                end: f - 1
              }));
            }
          }
        },
        /* 24 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.SVGGraphics = void 0;
          var t = n(6), i = n(1);
          const a = {
            fontStyle: "normal",
            fontWeight: "normal",
            fillColor: "#000000"
          }, s = "http://www.w3.org/XML/1998/namespace", h = "http://www.w3.org/1999/xlink", u = ["butt", "round", "square"], l = ["miter", "round", "bevel"], o = function(v, p = "", d = !1) {
            if (URL.createObjectURL && typeof Blob < "u" && !d)
              return URL.createObjectURL(new Blob([v], {
                type: p
              }));
            const g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            let m = `data:${p};base64,`;
            for (let y = 0, L = v.length; y < L; y += 3) {
              const b = v[y] & 255, P = v[y + 1] & 255, j = v[y + 2] & 255, re = b >> 2, X = (b & 3) << 4 | P >> 4, Q = y + 1 < L ? (P & 15) << 2 | j >> 6 : 64, q = y + 2 < L ? j & 63 : 64;
              m += g[re] + g[X] + g[Q] + g[q];
            }
            return m;
          }, w = function() {
            const v = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), p = 12, d = new Int32Array(256);
            for (let j = 0; j < 256; j++) {
              let re = j;
              for (let X = 0; X < 8; X++)
                re = re & 1 ? 3988292384 ^ re >> 1 & 2147483647 : re >> 1 & 2147483647;
              d[j] = re;
            }
            function g(j, re, X) {
              let Q = -1;
              for (let q = re; q < X; q++) {
                const ie = (Q ^ j[q]) & 255, O = d[ie];
                Q = Q >>> 8 ^ O;
              }
              return Q ^ -1;
            }
            function m(j, re, X, Q) {
              let q = Q;
              const ie = re.length;
              X[q] = ie >> 24 & 255, X[q + 1] = ie >> 16 & 255, X[q + 2] = ie >> 8 & 255, X[q + 3] = ie & 255, q += 4, X[q] = j.charCodeAt(0) & 255, X[q + 1] = j.charCodeAt(1) & 255, X[q + 2] = j.charCodeAt(2) & 255, X[q + 3] = j.charCodeAt(3) & 255, q += 4, X.set(re, q), q += re.length;
              const O = g(X, Q + 4, q);
              X[q] = O >> 24 & 255, X[q + 1] = O >> 16 & 255, X[q + 2] = O >> 8 & 255, X[q + 3] = O & 255;
            }
            function y(j, re, X) {
              let Q = 1, q = 0;
              for (let ie = re; ie < X; ++ie)
                Q = (Q + (j[ie] & 255)) % 65521, q = (q + Q) % 65521;
              return q << 16 | Q;
            }
            function L(j) {
              if (!i.isNodeJS)
                return b(j);
              try {
                const re = parseInt(process.versions.node) >= 8 ? j : Buffer.from(j), X = require$$5.deflateSync(re, {
                  level: 9
                });
                return X instanceof Uint8Array ? X : new Uint8Array(X);
              } catch (re) {
                (0, i.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + re);
              }
              return b(j);
            }
            function b(j) {
              let re = j.length;
              const X = 65535, Q = Math.ceil(re / X), q = new Uint8Array(2 + re + Q * 5 + 4);
              let ie = 0;
              q[ie++] = 120, q[ie++] = 156;
              let O = 0;
              for (; re > X; )
                q[ie++] = 0, q[ie++] = 255, q[ie++] = 255, q[ie++] = 0, q[ie++] = 0, q.set(j.subarray(O, O + X), ie), ie += X, O += X, re -= X;
              q[ie++] = 1, q[ie++] = re & 255, q[ie++] = re >> 8 & 255, q[ie++] = ~re & 65535 & 255, q[ie++] = (~re & 65535) >> 8 & 255, q.set(j.subarray(O), ie), ie += j.length - O;
              const G = y(j, 0, j.length);
              return q[ie++] = G >> 24 & 255, q[ie++] = G >> 16 & 255, q[ie++] = G >> 8 & 255, q[ie++] = G & 255, q;
            }
            function P(j, re, X, Q) {
              const q = j.width, ie = j.height;
              let O, G, K;
              const M = j.data;
              switch (re) {
                case i.ImageKind.GRAYSCALE_1BPP:
                  G = 0, O = 1, K = q + 7 >> 3;
                  break;
                case i.ImageKind.RGB_24BPP:
                  G = 2, O = 8, K = q * 3;
                  break;
                case i.ImageKind.RGBA_32BPP:
                  G = 6, O = 8, K = q * 4;
                  break;
                default:
                  throw new Error("invalid format");
              }
              const _ = new Uint8Array((1 + K) * ie);
              let A = 0, k = 0;
              for (let ce = 0; ce < ie; ++ce)
                _[A++] = 0, _.set(M.subarray(k, k + K), A), k += K, A += K;
              if (re === i.ImageKind.GRAYSCALE_1BPP && Q) {
                A = 0;
                for (let ce = 0; ce < ie; ce++) {
                  A++;
                  for (let de = 0; de < K; de++)
                    _[A++] ^= 255;
                }
              }
              const N = new Uint8Array([q >> 24 & 255, q >> 16 & 255, q >> 8 & 255, q & 255, ie >> 24 & 255, ie >> 16 & 255, ie >> 8 & 255, ie & 255, O, G, 0, 0, 0]), $ = L(_), z = v.length + p * 3 + N.length + $.length, B = new Uint8Array(z);
              let Y = 0;
              return B.set(v, Y), Y += v.length, m("IHDR", N, B, Y), Y += p + N.length, m("IDATA", $, B, Y), Y += p + $.length, m("IEND", new Uint8Array(0), B, Y), o(B, "image/png", X);
            }
            return function(re, X, Q) {
              const q = re.kind === void 0 ? i.ImageKind.GRAYSCALE_1BPP : re.kind;
              return P(re, q, X, Q);
            };
          }();
          class x {
            constructor() {
              this.fontSizeScale = 1, this.fontWeight = a.fontWeight, this.fontSize = 0, this.textMatrix = i.IDENTITY_MATRIX, this.fontMatrix = i.FONT_IDENTITY_MATRIX, this.leading = 0, this.textRenderingMode = i.TextRenderingMode.FILL, this.textMatrixScale = 1, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRise = 0, this.fillColor = a.fillColor, this.strokeColor = "#000000", this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.lineJoin = "", this.lineCap = "", this.miterLimit = 0, this.dashArray = [], this.dashPhase = 0, this.dependencies = [], this.activeClipUrl = null, this.clipGroup = null, this.maskId = "";
            }
            clone() {
              return Object.create(this);
            }
            setCurrentPoint(p, d) {
              this.x = p, this.y = d;
            }
          }
          function C(v) {
            let p = [];
            const d = [];
            for (const g of v) {
              if (g.fn === "save") {
                p.push({
                  fnId: 92,
                  fn: "group",
                  items: []
                }), d.push(p), p = p.at(-1).items;
                continue;
              }
              g.fn === "restore" ? p = d.pop() : p.push(g);
            }
            return p;
          }
          function S(v) {
            if (Number.isInteger(v))
              return v.toString();
            const p = v.toFixed(10);
            let d = p.length - 1;
            if (p[d] !== "0")
              return p;
            do
              d--;
            while (p[d] === "0");
            return p.substring(0, p[d] === "." ? d : d + 1);
          }
          function T(v) {
            if (v[4] === 0 && v[5] === 0) {
              if (v[1] === 0 && v[2] === 0)
                return v[0] === 1 && v[3] === 1 ? "" : `scale(${S(v[0])} ${S(v[3])})`;
              if (v[0] === v[3] && v[1] === -v[2]) {
                const p = Math.acos(v[0]) * 180 / Math.PI;
                return `rotate(${S(p)})`;
              }
            } else if (v[0] === 1 && v[1] === 0 && v[2] === 0 && v[3] === 1)
              return `translate(${S(v[4])} ${S(v[5])})`;
            return `matrix(${S(v[0])} ${S(v[1])} ${S(v[2])} ${S(v[3])} ${S(v[4])} ${S(v[5])})`;
          }
          let D = 0, F = 0, f = 0;
          class E {
            constructor(p, d, g = !1) {
              (0, t.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."), this.svgFactory = new t.DOMSVGFactory(), this.current = new x(), this.transformMatrix = i.IDENTITY_MATRIX, this.transformStack = [], this.extraStack = [], this.commonObjs = p, this.objs = d, this.pendingClip = null, this.pendingEOFill = !1, this.embedFonts = !1, this.embeddedFonts = /* @__PURE__ */ Object.create(null), this.cssStyle = null, this.forceDataSchema = !!g, this._operatorIdMapping = [];
              for (const m in i.OPS)
                this._operatorIdMapping[i.OPS[m]] = m;
            }
            getObject(p, d = null) {
              return typeof p == "string" ? p.startsWith("g_") ? this.commonObjs.get(p) : this.objs.get(p) : d;
            }
            save() {
              this.transformStack.push(this.transformMatrix);
              const p = this.current;
              this.extraStack.push(p), this.current = p.clone();
            }
            restore() {
              this.transformMatrix = this.transformStack.pop(), this.current = this.extraStack.pop(), this.pendingClip = null, this.tgrp = null;
            }
            group(p) {
              this.save(), this.executeOpTree(p), this.restore();
            }
            loadDependencies(p) {
              const d = p.fnArray, g = p.argsArray;
              for (let m = 0, y = d.length; m < y; m++)
                if (d[m] === i.OPS.dependency)
                  for (const L of g[m]) {
                    const b = L.startsWith("g_") ? this.commonObjs : this.objs, P = new Promise((j) => {
                      b.get(L, j);
                    });
                    this.current.dependencies.push(P);
                  }
              return Promise.all(this.current.dependencies);
            }
            transform(p, d, g, m, y, L) {
              const b = [p, d, g, m, y, L];
              this.transformMatrix = i.Util.transform(this.transformMatrix, b), this.tgrp = null;
            }
            getSVG(p, d) {
              this.viewport = d;
              const g = this._initialize(d);
              return this.loadDependencies(p).then(() => (this.transformMatrix = i.IDENTITY_MATRIX, this.executeOpTree(this.convertOpList(p)), g));
            }
            convertOpList(p) {
              const d = this._operatorIdMapping, g = p.argsArray, m = p.fnArray, y = [];
              for (let L = 0, b = m.length; L < b; L++) {
                const P = m[L];
                y.push({
                  fnId: P,
                  fn: d[P],
                  args: g[L]
                });
              }
              return C(y);
            }
            executeOpTree(p) {
              for (const d of p) {
                const g = d.fn, m = d.fnId, y = d.args;
                switch (m | 0) {
                  case i.OPS.beginText:
                    this.beginText();
                    break;
                  case i.OPS.dependency:
                    break;
                  case i.OPS.setLeading:
                    this.setLeading(y);
                    break;
                  case i.OPS.setLeadingMoveText:
                    this.setLeadingMoveText(y[0], y[1]);
                    break;
                  case i.OPS.setFont:
                    this.setFont(y);
                    break;
                  case i.OPS.showText:
                    this.showText(y[0]);
                    break;
                  case i.OPS.showSpacedText:
                    this.showText(y[0]);
                    break;
                  case i.OPS.endText:
                    this.endText();
                    break;
                  case i.OPS.moveText:
                    this.moveText(y[0], y[1]);
                    break;
                  case i.OPS.setCharSpacing:
                    this.setCharSpacing(y[0]);
                    break;
                  case i.OPS.setWordSpacing:
                    this.setWordSpacing(y[0]);
                    break;
                  case i.OPS.setHScale:
                    this.setHScale(y[0]);
                    break;
                  case i.OPS.setTextMatrix:
                    this.setTextMatrix(y[0], y[1], y[2], y[3], y[4], y[5]);
                    break;
                  case i.OPS.setTextRise:
                    this.setTextRise(y[0]);
                    break;
                  case i.OPS.setTextRenderingMode:
                    this.setTextRenderingMode(y[0]);
                    break;
                  case i.OPS.setLineWidth:
                    this.setLineWidth(y[0]);
                    break;
                  case i.OPS.setLineJoin:
                    this.setLineJoin(y[0]);
                    break;
                  case i.OPS.setLineCap:
                    this.setLineCap(y[0]);
                    break;
                  case i.OPS.setMiterLimit:
                    this.setMiterLimit(y[0]);
                    break;
                  case i.OPS.setFillRGBColor:
                    this.setFillRGBColor(y[0], y[1], y[2]);
                    break;
                  case i.OPS.setStrokeRGBColor:
                    this.setStrokeRGBColor(y[0], y[1], y[2]);
                    break;
                  case i.OPS.setStrokeColorN:
                    this.setStrokeColorN(y);
                    break;
                  case i.OPS.setFillColorN:
                    this.setFillColorN(y);
                    break;
                  case i.OPS.shadingFill:
                    this.shadingFill(y[0]);
                    break;
                  case i.OPS.setDash:
                    this.setDash(y[0], y[1]);
                    break;
                  case i.OPS.setRenderingIntent:
                    this.setRenderingIntent(y[0]);
                    break;
                  case i.OPS.setFlatness:
                    this.setFlatness(y[0]);
                    break;
                  case i.OPS.setGState:
                    this.setGState(y[0]);
                    break;
                  case i.OPS.fill:
                    this.fill();
                    break;
                  case i.OPS.eoFill:
                    this.eoFill();
                    break;
                  case i.OPS.stroke:
                    this.stroke();
                    break;
                  case i.OPS.fillStroke:
                    this.fillStroke();
                    break;
                  case i.OPS.eoFillStroke:
                    this.eoFillStroke();
                    break;
                  case i.OPS.clip:
                    this.clip("nonzero");
                    break;
                  case i.OPS.eoClip:
                    this.clip("evenodd");
                    break;
                  case i.OPS.paintSolidColorImageMask:
                    this.paintSolidColorImageMask();
                    break;
                  case i.OPS.paintImageXObject:
                    this.paintImageXObject(y[0]);
                    break;
                  case i.OPS.paintInlineImageXObject:
                    this.paintInlineImageXObject(y[0]);
                    break;
                  case i.OPS.paintImageMaskXObject:
                    this.paintImageMaskXObject(y[0]);
                    break;
                  case i.OPS.paintFormXObjectBegin:
                    this.paintFormXObjectBegin(y[0], y[1]);
                    break;
                  case i.OPS.paintFormXObjectEnd:
                    this.paintFormXObjectEnd();
                    break;
                  case i.OPS.closePath:
                    this.closePath();
                    break;
                  case i.OPS.closeStroke:
                    this.closeStroke();
                    break;
                  case i.OPS.closeFillStroke:
                    this.closeFillStroke();
                    break;
                  case i.OPS.closeEOFillStroke:
                    this.closeEOFillStroke();
                    break;
                  case i.OPS.nextLine:
                    this.nextLine();
                    break;
                  case i.OPS.transform:
                    this.transform(y[0], y[1], y[2], y[3], y[4], y[5]);
                    break;
                  case i.OPS.constructPath:
                    this.constructPath(y[0], y[1]);
                    break;
                  case i.OPS.endPath:
                    this.endPath();
                    break;
                  case 92:
                    this.group(d.items);
                    break;
                  default:
                    (0, i.warn)(`Unimplemented operator ${g}`);
                    break;
                }
              }
            }
            setWordSpacing(p) {
              this.current.wordSpacing = p;
            }
            setCharSpacing(p) {
              this.current.charSpacing = p;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            setTextMatrix(p, d, g, m, y, L) {
              const b = this.current;
              b.textMatrix = b.lineMatrix = [p, d, g, m, y, L], b.textMatrixScale = Math.hypot(p, d), b.x = b.lineX = 0, b.y = b.lineY = 0, b.xcoords = [], b.ycoords = [], b.tspan = this.svgFactory.createElement("svg:tspan"), b.tspan.setAttributeNS(null, "font-family", b.fontFamily), b.tspan.setAttributeNS(null, "font-size", `${S(b.fontSize)}px`), b.tspan.setAttributeNS(null, "y", S(-b.y)), b.txtElement = this.svgFactory.createElement("svg:text"), b.txtElement.append(b.tspan);
            }
            beginText() {
              const p = this.current;
              p.x = p.lineX = 0, p.y = p.lineY = 0, p.textMatrix = i.IDENTITY_MATRIX, p.lineMatrix = i.IDENTITY_MATRIX, p.textMatrixScale = 1, p.tspan = this.svgFactory.createElement("svg:tspan"), p.txtElement = this.svgFactory.createElement("svg:text"), p.txtgrp = this.svgFactory.createElement("svg:g"), p.xcoords = [], p.ycoords = [];
            }
            moveText(p, d) {
              const g = this.current;
              g.x = g.lineX += p, g.y = g.lineY += d, g.xcoords = [], g.ycoords = [], g.tspan = this.svgFactory.createElement("svg:tspan"), g.tspan.setAttributeNS(null, "font-family", g.fontFamily), g.tspan.setAttributeNS(null, "font-size", `${S(g.fontSize)}px`), g.tspan.setAttributeNS(null, "y", S(-g.y));
            }
            showText(p) {
              const d = this.current, g = d.font, m = d.fontSize;
              if (m === 0)
                return;
              const y = d.fontSizeScale, L = d.charSpacing, b = d.wordSpacing, P = d.fontDirection, j = d.textHScale * P, re = g.vertical, X = re ? 1 : -1, Q = g.defaultVMetrics, q = m * d.fontMatrix[0];
              let ie = 0;
              for (const K of p) {
                if (K === null) {
                  ie += P * b;
                  continue;
                } else if (typeof K == "number") {
                  ie += X * K * m / 1e3;
                  continue;
                }
                const M = (K.isSpace ? b : 0) + L, _ = K.fontChar;
                let A, k, N = K.width;
                if (re) {
                  let z;
                  const B = K.vmetric || Q;
                  z = K.vmetric ? B[1] : N * 0.5, z = -z * q;
                  const Y = B[2] * q;
                  N = B ? -B[0] : N, A = z / y, k = (ie + Y) / y;
                } else
                  A = ie / y, k = 0;
                (K.isInFont || g.missingFile) && (d.xcoords.push(d.x + A), re && d.ycoords.push(-d.y + k), d.tspan.textContent += _);
                const $ = re ? N * q - M * P : N * q + M * P;
                ie += $;
              }
              d.tspan.setAttributeNS(null, "x", d.xcoords.map(S).join(" ")), re ? d.tspan.setAttributeNS(null, "y", d.ycoords.map(S).join(" ")) : d.tspan.setAttributeNS(null, "y", S(-d.y)), re ? d.y -= ie : d.x += ie * j, d.tspan.setAttributeNS(null, "font-family", d.fontFamily), d.tspan.setAttributeNS(null, "font-size", `${S(d.fontSize)}px`), d.fontStyle !== a.fontStyle && d.tspan.setAttributeNS(null, "font-style", d.fontStyle), d.fontWeight !== a.fontWeight && d.tspan.setAttributeNS(null, "font-weight", d.fontWeight);
              const O = d.textRenderingMode & i.TextRenderingMode.FILL_STROKE_MASK;
              if (O === i.TextRenderingMode.FILL || O === i.TextRenderingMode.FILL_STROKE ? (d.fillColor !== a.fillColor && d.tspan.setAttributeNS(null, "fill", d.fillColor), d.fillAlpha < 1 && d.tspan.setAttributeNS(null, "fill-opacity", d.fillAlpha)) : d.textRenderingMode === i.TextRenderingMode.ADD_TO_PATH ? d.tspan.setAttributeNS(null, "fill", "transparent") : d.tspan.setAttributeNS(null, "fill", "none"), O === i.TextRenderingMode.STROKE || O === i.TextRenderingMode.FILL_STROKE) {
                const K = 1 / (d.textMatrixScale || 1);
                this._setStrokeAttributes(d.tspan, K);
              }
              let G = d.textMatrix;
              d.textRise !== 0 && (G = G.slice(), G[5] += d.textRise), d.txtElement.setAttributeNS(null, "transform", `${T(G)} scale(${S(j)}, -1)`), d.txtElement.setAttributeNS(s, "xml:space", "preserve"), d.txtElement.append(d.tspan), d.txtgrp.append(d.txtElement), this._ensureTransformGroup().append(d.txtElement);
            }
            setLeadingMoveText(p, d) {
              this.setLeading(-d), this.moveText(p, d);
            }
            addFontStyle(p) {
              if (!p.data)
                throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');
              this.cssStyle || (this.cssStyle = this.svgFactory.createElement("svg:style"), this.cssStyle.setAttributeNS(null, "type", "text/css"), this.defs.append(this.cssStyle));
              const d = o(p.data, p.mimetype, this.forceDataSchema);
              this.cssStyle.textContent += `@font-face { font-family: "${p.loadedName}"; src: url(${d}); }
`;
            }
            setFont(p) {
              const d = this.current, g = this.commonObjs.get(p[0]);
              let m = p[1];
              d.font = g, this.embedFonts && !g.missingFile && !this.embeddedFonts[g.loadedName] && (this.addFontStyle(g), this.embeddedFonts[g.loadedName] = g), d.fontMatrix = g.fontMatrix || i.FONT_IDENTITY_MATRIX;
              let y = "normal";
              g.black ? y = "900" : g.bold && (y = "bold");
              const L = g.italic ? "italic" : "normal";
              m < 0 ? (m = -m, d.fontDirection = -1) : d.fontDirection = 1, d.fontSize = m, d.fontFamily = g.loadedName, d.fontWeight = y, d.fontStyle = L, d.tspan = this.svgFactory.createElement("svg:tspan"), d.tspan.setAttributeNS(null, "y", S(-d.y)), d.xcoords = [], d.ycoords = [];
            }
            endText() {
              var d;
              const p = this.current;
              p.textRenderingMode & i.TextRenderingMode.ADD_TO_PATH_FLAG && ((d = p.txtElement) != null && d.hasChildNodes()) && (p.element = p.txtElement, this.clip("nonzero"), this.endPath());
            }
            setLineWidth(p) {
              p > 0 && (this.current.lineWidth = p);
            }
            setLineCap(p) {
              this.current.lineCap = u[p];
            }
            setLineJoin(p) {
              this.current.lineJoin = l[p];
            }
            setMiterLimit(p) {
              this.current.miterLimit = p;
            }
            setStrokeAlpha(p) {
              this.current.strokeAlpha = p;
            }
            setStrokeRGBColor(p, d, g) {
              this.current.strokeColor = i.Util.makeHexColor(p, d, g);
            }
            setFillAlpha(p) {
              this.current.fillAlpha = p;
            }
            setFillRGBColor(p, d, g) {
              this.current.fillColor = i.Util.makeHexColor(p, d, g), this.current.tspan = this.svgFactory.createElement("svg:tspan"), this.current.xcoords = [], this.current.ycoords = [];
            }
            setStrokeColorN(p) {
              this.current.strokeColor = this._makeColorN_Pattern(p);
            }
            setFillColorN(p) {
              this.current.fillColor = this._makeColorN_Pattern(p);
            }
            shadingFill(p) {
              const {
                width: d,
                height: g
              } = this.viewport, m = i.Util.inverseTransform(this.transformMatrix), [y, L, b, P] = i.Util.getAxialAlignedBoundingBox([0, 0, d, g], m), j = this.svgFactory.createElement("svg:rect");
              j.setAttributeNS(null, "x", y), j.setAttributeNS(null, "y", L), j.setAttributeNS(null, "width", b - y), j.setAttributeNS(null, "height", P - L), j.setAttributeNS(null, "fill", this._makeShadingPattern(p)), this.current.fillAlpha < 1 && j.setAttributeNS(null, "fill-opacity", this.current.fillAlpha), this._ensureTransformGroup().append(j);
            }
            _makeColorN_Pattern(p) {
              return p[0] === "TilingPattern" ? this._makeTilingPattern(p) : this._makeShadingPattern(p);
            }
            _makeTilingPattern(p) {
              const d = p[1], g = p[2], m = p[3] || i.IDENTITY_MATRIX, [y, L, b, P] = p[4], j = p[5], re = p[6], X = p[7], Q = `shading${f++}`, [q, ie, O, G] = i.Util.normalizeRect([...i.Util.applyTransform([y, L], m), ...i.Util.applyTransform([b, P], m)]), [K, M] = i.Util.singularValueDecompose2dScale(m), _ = j * K, A = re * M, k = this.svgFactory.createElement("svg:pattern");
              k.setAttributeNS(null, "id", Q), k.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), k.setAttributeNS(null, "width", _), k.setAttributeNS(null, "height", A), k.setAttributeNS(null, "x", `${q}`), k.setAttributeNS(null, "y", `${ie}`);
              const N = this.svg, $ = this.transformMatrix, z = this.current.fillColor, B = this.current.strokeColor, Y = this.svgFactory.create(O - q, G - ie);
              if (this.svg = Y, this.transformMatrix = m, X === 2) {
                const ce = i.Util.makeHexColor(...d);
                this.current.fillColor = ce, this.current.strokeColor = ce;
              }
              return this.executeOpTree(this.convertOpList(g)), this.svg = N, this.transformMatrix = $, this.current.fillColor = z, this.current.strokeColor = B, k.append(Y.childNodes[0]), this.defs.append(k), `url(#${Q})`;
            }
            _makeShadingPattern(p) {
              switch (typeof p == "string" && (p = this.objs.get(p)), p[0]) {
                case "RadialAxial":
                  const d = `shading${f++}`, g = p[3];
                  let m;
                  switch (p[1]) {
                    case "axial":
                      const y = p[4], L = p[5];
                      m = this.svgFactory.createElement("svg:linearGradient"), m.setAttributeNS(null, "id", d), m.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), m.setAttributeNS(null, "x1", y[0]), m.setAttributeNS(null, "y1", y[1]), m.setAttributeNS(null, "x2", L[0]), m.setAttributeNS(null, "y2", L[1]);
                      break;
                    case "radial":
                      const b = p[4], P = p[5], j = p[6], re = p[7];
                      m = this.svgFactory.createElement("svg:radialGradient"), m.setAttributeNS(null, "id", d), m.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), m.setAttributeNS(null, "cx", P[0]), m.setAttributeNS(null, "cy", P[1]), m.setAttributeNS(null, "r", re), m.setAttributeNS(null, "fx", b[0]), m.setAttributeNS(null, "fy", b[1]), m.setAttributeNS(null, "fr", j);
                      break;
                    default:
                      throw new Error(`Unknown RadialAxial type: ${p[1]}`);
                  }
                  for (const y of g) {
                    const L = this.svgFactory.createElement("svg:stop");
                    L.setAttributeNS(null, "offset", y[0]), L.setAttributeNS(null, "stop-color", y[1]), m.append(L);
                  }
                  return this.defs.append(m), `url(#${d})`;
                case "Mesh":
                  return (0, i.warn)("Unimplemented pattern Mesh"), null;
                case "Dummy":
                  return "hotpink";
                default:
                  throw new Error(`Unknown IR type: ${p[0]}`);
              }
            }
            setDash(p, d) {
              this.current.dashArray = p, this.current.dashPhase = d;
            }
            constructPath(p, d) {
              const g = this.current;
              let m = g.x, y = g.y, L = [], b = 0;
              for (const P of p)
                switch (P | 0) {
                  case i.OPS.rectangle:
                    m = d[b++], y = d[b++];
                    const j = d[b++], re = d[b++], X = m + j, Q = y + re;
                    L.push("M", S(m), S(y), "L", S(X), S(y), "L", S(X), S(Q), "L", S(m), S(Q), "Z");
                    break;
                  case i.OPS.moveTo:
                    m = d[b++], y = d[b++], L.push("M", S(m), S(y));
                    break;
                  case i.OPS.lineTo:
                    m = d[b++], y = d[b++], L.push("L", S(m), S(y));
                    break;
                  case i.OPS.curveTo:
                    m = d[b + 4], y = d[b + 5], L.push("C", S(d[b]), S(d[b + 1]), S(d[b + 2]), S(d[b + 3]), S(m), S(y)), b += 6;
                    break;
                  case i.OPS.curveTo2:
                    L.push("C", S(m), S(y), S(d[b]), S(d[b + 1]), S(d[b + 2]), S(d[b + 3])), m = d[b + 2], y = d[b + 3], b += 4;
                    break;
                  case i.OPS.curveTo3:
                    m = d[b + 2], y = d[b + 3], L.push("C", S(d[b]), S(d[b + 1]), S(m), S(y), S(m), S(y)), b += 4;
                    break;
                  case i.OPS.closePath:
                    L.push("Z");
                    break;
                }
              L = L.join(" "), g.path && p.length > 0 && p[0] !== i.OPS.rectangle && p[0] !== i.OPS.moveTo ? L = g.path.getAttributeNS(null, "d") + L : (g.path = this.svgFactory.createElement("svg:path"), this._ensureTransformGroup().append(g.path)), g.path.setAttributeNS(null, "d", L), g.path.setAttributeNS(null, "fill", "none"), g.element = g.path, g.setCurrentPoint(m, y);
            }
            endPath() {
              const p = this.current;
              if (p.path = null, !this.pendingClip)
                return;
              if (!p.element) {
                this.pendingClip = null;
                return;
              }
              const d = `clippath${D++}`, g = this.svgFactory.createElement("svg:clipPath");
              g.setAttributeNS(null, "id", d), g.setAttributeNS(null, "transform", T(this.transformMatrix));
              const m = p.element.cloneNode(!0);
              if (this.pendingClip === "evenodd" ? m.setAttributeNS(null, "clip-rule", "evenodd") : m.setAttributeNS(null, "clip-rule", "nonzero"), this.pendingClip = null, g.append(m), this.defs.append(g), p.activeClipUrl) {
                p.clipGroup = null;
                for (const y of this.extraStack)
                  y.clipGroup = null;
                g.setAttributeNS(null, "clip-path", p.activeClipUrl);
              }
              p.activeClipUrl = `url(#${d})`, this.tgrp = null;
            }
            clip(p) {
              this.pendingClip = p;
            }
            closePath() {
              const p = this.current;
              if (p.path) {
                const d = `${p.path.getAttributeNS(null, "d")}Z`;
                p.path.setAttributeNS(null, "d", d);
              }
            }
            setLeading(p) {
              this.current.leading = -p;
            }
            setTextRise(p) {
              this.current.textRise = p;
            }
            setTextRenderingMode(p) {
              this.current.textRenderingMode = p;
            }
            setHScale(p) {
              this.current.textHScale = p / 100;
            }
            setRenderingIntent(p) {
            }
            setFlatness(p) {
            }
            setGState(p) {
              for (const [d, g] of p)
                switch (d) {
                  case "LW":
                    this.setLineWidth(g);
                    break;
                  case "LC":
                    this.setLineCap(g);
                    break;
                  case "LJ":
                    this.setLineJoin(g);
                    break;
                  case "ML":
                    this.setMiterLimit(g);
                    break;
                  case "D":
                    this.setDash(g[0], g[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent(g);
                    break;
                  case "FL":
                    this.setFlatness(g);
                    break;
                  case "Font":
                    this.setFont(g);
                    break;
                  case "CA":
                    this.setStrokeAlpha(g);
                    break;
                  case "ca":
                    this.setFillAlpha(g);
                    break;
                  default:
                    (0, i.warn)(`Unimplemented graphic state operator ${d}`);
                    break;
                }
            }
            fill() {
              const p = this.current;
              p.element && (p.element.setAttributeNS(null, "fill", p.fillColor), p.element.setAttributeNS(null, "fill-opacity", p.fillAlpha), this.endPath());
            }
            stroke() {
              const p = this.current;
              p.element && (this._setStrokeAttributes(p.element), p.element.setAttributeNS(null, "fill", "none"), this.endPath());
            }
            _setStrokeAttributes(p, d = 1) {
              const g = this.current;
              let m = g.dashArray;
              d !== 1 && m.length > 0 && (m = m.map(function(y) {
                return d * y;
              })), p.setAttributeNS(null, "stroke", g.strokeColor), p.setAttributeNS(null, "stroke-opacity", g.strokeAlpha), p.setAttributeNS(null, "stroke-miterlimit", S(g.miterLimit)), p.setAttributeNS(null, "stroke-linecap", g.lineCap), p.setAttributeNS(null, "stroke-linejoin", g.lineJoin), p.setAttributeNS(null, "stroke-width", S(d * g.lineWidth) + "px"), p.setAttributeNS(null, "stroke-dasharray", m.map(S).join(" ")), p.setAttributeNS(null, "stroke-dashoffset", S(d * g.dashPhase) + "px");
            }
            eoFill() {
              var p;
              (p = this.current.element) == null || p.setAttributeNS(null, "fill-rule", "evenodd"), this.fill();
            }
            fillStroke() {
              this.stroke(), this.fill();
            }
            eoFillStroke() {
              var p;
              (p = this.current.element) == null || p.setAttributeNS(null, "fill-rule", "evenodd"), this.fillStroke();
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            closeFillStroke() {
              this.closePath(), this.fillStroke();
            }
            closeEOFillStroke() {
              this.closePath(), this.eoFillStroke();
            }
            paintSolidColorImageMask() {
              const p = this.svgFactory.createElement("svg:rect");
              p.setAttributeNS(null, "x", "0"), p.setAttributeNS(null, "y", "0"), p.setAttributeNS(null, "width", "1px"), p.setAttributeNS(null, "height", "1px"), p.setAttributeNS(null, "fill", this.current.fillColor), this._ensureTransformGroup().append(p);
            }
            paintImageXObject(p) {
              const d = this.getObject(p);
              if (!d) {
                (0, i.warn)(`Dependent image with object ID ${p} is not ready yet`);
                return;
              }
              this.paintInlineImageXObject(d);
            }
            paintInlineImageXObject(p, d) {
              const g = p.width, m = p.height, y = w(p, this.forceDataSchema, !!d), L = this.svgFactory.createElement("svg:rect");
              L.setAttributeNS(null, "x", "0"), L.setAttributeNS(null, "y", "0"), L.setAttributeNS(null, "width", S(g)), L.setAttributeNS(null, "height", S(m)), this.current.element = L, this.clip("nonzero");
              const b = this.svgFactory.createElement("svg:image");
              b.setAttributeNS(h, "xlink:href", y), b.setAttributeNS(null, "x", "0"), b.setAttributeNS(null, "y", S(-m)), b.setAttributeNS(null, "width", S(g) + "px"), b.setAttributeNS(null, "height", S(m) + "px"), b.setAttributeNS(null, "transform", `scale(${S(1 / g)} ${S(-1 / m)})`), d ? d.append(b) : this._ensureTransformGroup().append(b);
            }
            paintImageMaskXObject(p) {
              const d = this.getObject(p.data, p);
              if (d.bitmap) {
                (0, i.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");
                return;
              }
              const g = this.current, m = d.width, y = d.height, L = g.fillColor;
              g.maskId = `mask${F++}`;
              const b = this.svgFactory.createElement("svg:mask");
              b.setAttributeNS(null, "id", g.maskId);
              const P = this.svgFactory.createElement("svg:rect");
              P.setAttributeNS(null, "x", "0"), P.setAttributeNS(null, "y", "0"), P.setAttributeNS(null, "width", S(m)), P.setAttributeNS(null, "height", S(y)), P.setAttributeNS(null, "fill", L), P.setAttributeNS(null, "mask", `url(#${g.maskId})`), this.defs.append(b), this._ensureTransformGroup().append(P), this.paintInlineImageXObject(d, b);
            }
            paintFormXObjectBegin(p, d) {
              if (Array.isArray(p) && p.length === 6 && this.transform(p[0], p[1], p[2], p[3], p[4], p[5]), d) {
                const g = d[2] - d[0], m = d[3] - d[1], y = this.svgFactory.createElement("svg:rect");
                y.setAttributeNS(null, "x", d[0]), y.setAttributeNS(null, "y", d[1]), y.setAttributeNS(null, "width", S(g)), y.setAttributeNS(null, "height", S(m)), this.current.element = y, this.clip("nonzero"), this.endPath();
              }
            }
            paintFormXObjectEnd() {
            }
            _initialize(p) {
              const d = this.svgFactory.create(p.width, p.height), g = this.svgFactory.createElement("svg:defs");
              d.append(g), this.defs = g;
              const m = this.svgFactory.createElement("svg:g");
              return m.setAttributeNS(null, "transform", T(p.transform)), d.append(m), this.svg = m, d;
            }
            _ensureClipGroup() {
              if (!this.current.clipGroup) {
                const p = this.svgFactory.createElement("svg:g");
                p.setAttributeNS(null, "clip-path", this.current.activeClipUrl), this.svg.append(p), this.current.clipGroup = p;
              }
              return this.current.clipGroup;
            }
            _ensureTransformGroup() {
              return this.tgrp || (this.tgrp = this.svgFactory.createElement("svg:g"), this.tgrp.setAttributeNS(null, "transform", T(this.transformMatrix)), this.current.activeClipUrl ? this._ensureClipGroup().append(this.tgrp) : this.svg.append(this.tgrp)), this.tgrp;
            }
          }
          e.SVGGraphics = E;
        },
        /* 25 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.XfaText = void 0;
          class n {
            static textContent(i) {
              const a = [], s = {
                items: a,
                styles: /* @__PURE__ */ Object.create(null)
              };
              function h(u) {
                var w;
                if (!u)
                  return;
                let l = null;
                const o = u.name;
                if (o === "#text")
                  l = u.value;
                else if (n.shouldBuildText(o))
                  (w = u == null ? void 0 : u.attributes) != null && w.textContent ? l = u.attributes.textContent : u.value && (l = u.value);
                else return;
                if (l !== null && a.push({
                  str: l
                }), !!u.children)
                  for (const x of u.children)
                    h(x);
              }
              return h(i), s;
            }
            static shouldBuildText(i) {
              return !(i === "textarea" || i === "input" || i === "option" || i === "select");
            }
          }
          e.XfaText = n;
        },
        /* 26 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.TextLayerRenderTask = void 0, e.renderTextLayer = T, e.updateTextLayer = D;
          var t = n(1), i = n(6);
          const a = 1e5, s = 30, h = 0.8, u = /* @__PURE__ */ new Map();
          function l(F, f) {
            let E;
            if (f && t.FeatureTest.isOffscreenCanvasSupported)
              E = new OffscreenCanvas(F, F).getContext("2d", {
                alpha: !1
              });
            else {
              const v = document.createElement("canvas");
              v.width = v.height = F, E = v.getContext("2d", {
                alpha: !1
              });
            }
            return E;
          }
          function o(F, f) {
            const E = u.get(F);
            if (E)
              return E;
            const v = l(s, f);
            v.font = `${s}px ${F}`;
            const p = v.measureText("");
            let d = p.fontBoundingBoxAscent, g = Math.abs(p.fontBoundingBoxDescent);
            if (d) {
              const y = d / (d + g);
              return u.set(F, y), v.canvas.width = v.canvas.height = 0, y;
            }
            v.strokeStyle = "red", v.clearRect(0, 0, s, s), v.strokeText("g", 0, 0);
            let m = v.getImageData(0, 0, s, s).data;
            g = 0;
            for (let y = m.length - 1 - 3; y >= 0; y -= 4)
              if (m[y] > 0) {
                g = Math.ceil(y / 4 / s);
                break;
              }
            v.clearRect(0, 0, s, s), v.strokeText("A", 0, s), m = v.getImageData(0, 0, s, s).data, d = 0;
            for (let y = 0, L = m.length; y < L; y += 4)
              if (m[y] > 0) {
                d = s - Math.floor(y / 4 / s);
                break;
              }
            if (v.canvas.width = v.canvas.height = 0, d) {
              const y = d / (d + g);
              return u.set(F, y), y;
            }
            return u.set(F, h), h;
          }
          function w(F, f, E) {
            const v = document.createElement("span"), p = {
              angle: 0,
              canvasWidth: 0,
              hasText: f.str !== "",
              hasEOL: f.hasEOL,
              fontSize: 0
            };
            F._textDivs.push(v);
            const d = t.Util.transform(F._transform, f.transform);
            let g = Math.atan2(d[1], d[0]);
            const m = E[f.fontName];
            m.vertical && (g += Math.PI / 2);
            const y = Math.hypot(d[2], d[3]), L = y * o(m.fontFamily, F._isOffscreenCanvasSupported);
            let b, P;
            g === 0 ? (b = d[4], P = d[5] - L) : (b = d[4] + L * Math.sin(g), P = d[5] - L * Math.cos(g));
            const j = "calc(var(--scale-factor)*", re = v.style;
            F._container === F._rootContainer ? (re.left = `${(100 * b / F._pageWidth).toFixed(2)}%`, re.top = `${(100 * P / F._pageHeight).toFixed(2)}%`) : (re.left = `${j}${b.toFixed(2)}px)`, re.top = `${j}${P.toFixed(2)}px)`), re.fontSize = `${j}${y.toFixed(2)}px)`, re.fontFamily = m.fontFamily, p.fontSize = y, v.setAttribute("role", "presentation"), v.textContent = f.str, v.dir = f.dir, F._fontInspectorEnabled && (v.dataset.fontName = f.fontName), g !== 0 && (p.angle = g * (180 / Math.PI));
            let X = !1;
            if (f.str.length > 1)
              X = !0;
            else if (f.str !== " " && f.transform[0] !== f.transform[3]) {
              const Q = Math.abs(f.transform[0]), q = Math.abs(f.transform[3]);
              Q !== q && Math.max(Q, q) / Math.min(Q, q) > 1.5 && (X = !0);
            }
            X && (p.canvasWidth = m.vertical ? f.height : f.width), F._textDivProperties.set(v, p), F._isReadableStream && F._layoutText(v);
          }
          function x(F) {
            const {
              div: f,
              scale: E,
              properties: v,
              ctx: p,
              prevFontSize: d,
              prevFontFamily: g
            } = F, {
              style: m
            } = f;
            let y = "";
            if (v.canvasWidth !== 0 && v.hasText) {
              const {
                fontFamily: L
              } = m, {
                canvasWidth: b,
                fontSize: P
              } = v;
              (d !== P || g !== L) && (p.font = `${P * E}px ${L}`, F.prevFontSize = P, F.prevFontFamily = L);
              const {
                width: j
              } = p.measureText(f.textContent);
              j > 0 && (y = `scaleX(${b * E / j})`);
            }
            v.angle !== 0 && (y = `rotate(${v.angle}deg) ${y}`), y.length > 0 && (m.transform = y);
          }
          function C(F) {
            if (F._canceled)
              return;
            const f = F._textDivs, E = F._capability;
            if (f.length > a) {
              E.resolve();
              return;
            }
            if (!F._isReadableStream)
              for (const p of f)
                F._layoutText(p);
            E.resolve();
          }
          class S {
            constructor({
              textContentSource: f,
              container: E,
              viewport: v,
              textDivs: p,
              textDivProperties: d,
              textContentItemsStr: g,
              isOffscreenCanvasSupported: m
            }) {
              var j;
              this._textContentSource = f, this._isReadableStream = f instanceof ReadableStream, this._container = this._rootContainer = E, this._textDivs = p || [], this._textContentItemsStr = g || [], this._isOffscreenCanvasSupported = m, this._fontInspectorEnabled = !!((j = globalThis.FontInspector) != null && j.enabled), this._reader = null, this._textDivProperties = d || /* @__PURE__ */ new WeakMap(), this._canceled = !1, this._capability = new t.PromiseCapability(), this._layoutTextParams = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: v.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: l(0, m)
              };
              const {
                pageWidth: y,
                pageHeight: L,
                pageX: b,
                pageY: P
              } = v.rawDims;
              this._transform = [1, 0, 0, -1, -b, P + L], this._pageWidth = y, this._pageHeight = L, (0, i.setLayerDimensions)(E, v), this._capability.promise.finally(() => {
                this._layoutTextParams = null;
              }).catch(() => {
              });
            }
            get promise() {
              return this._capability.promise;
            }
            cancel() {
              this._canceled = !0, this._reader && (this._reader.cancel(new t.AbortException("TextLayer task cancelled.")).catch(() => {
              }), this._reader = null), this._capability.reject(new t.AbortException("TextLayer task cancelled."));
            }
            _processItems(f, E) {
              for (const v of f) {
                if (v.str === void 0) {
                  if (v.type === "beginMarkedContentProps" || v.type === "beginMarkedContent") {
                    const p = this._container;
                    this._container = document.createElement("span"), this._container.classList.add("markedContent"), v.id !== null && this._container.setAttribute("id", `${v.id}`), p.append(this._container);
                  } else v.type === "endMarkedContent" && (this._container = this._container.parentNode);
                  continue;
                }
                this._textContentItemsStr.push(v.str), w(this, v, E);
              }
            }
            _layoutText(f) {
              const E = this._layoutTextParams.properties = this._textDivProperties.get(f);
              if (this._layoutTextParams.div = f, x(this._layoutTextParams), E.hasText && this._container.append(f), E.hasEOL) {
                const v = document.createElement("br");
                v.setAttribute("role", "presentation"), this._container.append(v);
              }
            }
            _render() {
              const f = new t.PromiseCapability();
              let E = /* @__PURE__ */ Object.create(null);
              if (this._isReadableStream) {
                const v = () => {
                  this._reader.read().then(({
                    value: p,
                    done: d
                  }) => {
                    if (d) {
                      f.resolve();
                      return;
                    }
                    Object.assign(E, p.styles), this._processItems(p.items, E), v();
                  }, f.reject);
                };
                this._reader = this._textContentSource.getReader(), v();
              } else if (this._textContentSource) {
                const {
                  items: v,
                  styles: p
                } = this._textContentSource;
                this._processItems(v, p), f.resolve();
              } else
                throw new Error('No "textContentSource" parameter specified.');
              f.promise.then(() => {
                E = null, C(this);
              }, this._capability.reject);
            }
          }
          e.TextLayerRenderTask = S;
          function T(F) {
            !F.textContentSource && (F.textContent || F.textContentStream) && ((0, i.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."), F.textContentSource = F.textContent || F.textContentStream);
            const {
              container: f,
              viewport: E
            } = F, v = getComputedStyle(f), p = v.getPropertyValue("visibility"), d = parseFloat(v.getPropertyValue("--scale-factor"));
            p === "visible" && (!d || Math.abs(d - E.scale) > 1e-5) && console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");
            const g = new S(F);
            return g._render(), g;
          }
          function D({
            container: F,
            viewport: f,
            textDivs: E,
            textDivProperties: v,
            isOffscreenCanvasSupported: p,
            mustRotate: d = !0,
            mustRescale: g = !0
          }) {
            if (d && (0, i.setLayerDimensions)(F, {
              rotation: f.rotation
            }), g) {
              const m = l(0, p), L = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: f.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: m
              };
              for (const b of E)
                L.properties = v.get(b), L.div = b, x(L);
            }
          }
        },
        /* 27 */
        /***/
        (r, e, n) => {
          var o, w, x, C, S, T, D, F, f, E, v, an, Rt, on, ln;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.AnnotationEditorLayer = void 0;
          var t = n(1), i = n(4), a = n(28), s = n(33), h = n(6), u = n(34);
          const y = class y {
            constructor({
              uiManager: b,
              pageIndex: P,
              div: j,
              accessibilityManager: re,
              annotationLayer: X,
              viewport: Q,
              l10n: q
            }) {
              le(this, v);
              le(this, o);
              le(this, w, !1);
              le(this, x, null);
              le(this, C, this.pointerup.bind(this));
              le(this, S, this.pointerdown.bind(this));
              le(this, T, /* @__PURE__ */ new Map());
              le(this, D, !1);
              le(this, F, !1);
              le(this, f, !1);
              le(this, E);
              const ie = [a.FreeTextEditor, s.InkEditor, u.StampEditor];
              if (!y._initialized) {
                y._initialized = !0;
                for (const O of ie)
                  O.initialize(q);
              }
              b.registerEditorTypes(ie), he(this, E, b), this.pageIndex = P, this.div = j, he(this, o, re), he(this, x, X), this.viewport = Q, c(this, E).addLayer(this);
            }
            get isEmpty() {
              return c(this, T).size === 0;
            }
            updateToolbar(b) {
              c(this, E).updateToolbar(b);
            }
            updateMode(b = c(this, E).getMode()) {
              Z(this, v, ln).call(this), b === t.AnnotationEditorType.INK ? (this.addInkEditorIfNeeded(!1), this.disableClick()) : this.enableClick(), b !== t.AnnotationEditorType.NONE && (this.div.classList.toggle("freeTextEditing", b === t.AnnotationEditorType.FREETEXT), this.div.classList.toggle("inkEditing", b === t.AnnotationEditorType.INK), this.div.classList.toggle("stampEditing", b === t.AnnotationEditorType.STAMP), this.div.hidden = !1);
            }
            addInkEditorIfNeeded(b) {
              if (!b && c(this, E).getMode() !== t.AnnotationEditorType.INK)
                return;
              if (!b) {
                for (const j of c(this, T).values())
                  if (j.isEmpty()) {
                    j.setInBackground();
                    return;
                  }
              }
              Z(this, v, Rt).call(this, {
                offsetX: 0,
                offsetY: 0
              }, !1).setInBackground();
            }
            setEditingState(b) {
              c(this, E).setEditingState(b);
            }
            addCommands(b) {
              c(this, E).addCommands(b);
            }
            enable() {
              this.div.style.pointerEvents = "auto";
              const b = /* @__PURE__ */ new Set();
              for (const j of c(this, T).values())
                j.enableEditing(), j.annotationElementId && b.add(j.annotationElementId);
              if (!c(this, x))
                return;
              const P = c(this, x).getEditableAnnotations();
              for (const j of P) {
                if (j.hide(), c(this, E).isDeletedAnnotationElement(j.data.id) || b.has(j.data.id))
                  continue;
                const re = this.deserialize(j);
                re && (this.addOrRebuild(re), re.enableEditing());
              }
            }
            disable() {
              var P;
              he(this, f, !0), this.div.style.pointerEvents = "none";
              const b = /* @__PURE__ */ new Set();
              for (const j of c(this, T).values()) {
                if (j.disableEditing(), !j.annotationElementId || j.serialize() !== null) {
                  b.add(j.annotationElementId);
                  continue;
                }
                (P = this.getEditableAnnotation(j.annotationElementId)) == null || P.show(), j.remove();
              }
              if (c(this, x)) {
                const j = c(this, x).getEditableAnnotations();
                for (const re of j) {
                  const {
                    id: X
                  } = re.data;
                  b.has(X) || c(this, E).isDeletedAnnotationElement(X) || re.show();
                }
              }
              Z(this, v, ln).call(this), this.isEmpty && (this.div.hidden = !0), he(this, f, !1);
            }
            getEditableAnnotation(b) {
              var P;
              return ((P = c(this, x)) == null ? void 0 : P.getEditableAnnotation(b)) || null;
            }
            setActiveEditor(b) {
              c(this, E).getActive() !== b && c(this, E).setActiveEditor(b);
            }
            enableClick() {
              this.div.addEventListener("pointerdown", c(this, S)), this.div.addEventListener("pointerup", c(this, C));
            }
            disableClick() {
              this.div.removeEventListener("pointerdown", c(this, S)), this.div.removeEventListener("pointerup", c(this, C));
            }
            attach(b) {
              c(this, T).set(b.id, b);
              const {
                annotationElementId: P
              } = b;
              P && c(this, E).isDeletedAnnotationElement(P) && c(this, E).removeDeletedAnnotationElement(b);
            }
            detach(b) {
              var P;
              c(this, T).delete(b.id), (P = c(this, o)) == null || P.removePointerInTextLayer(b.contentDiv), !c(this, f) && b.annotationElementId && c(this, E).addDeletedAnnotationElement(b);
            }
            remove(b) {
              this.detach(b), c(this, E).removeEditor(b), b.div.contains(document.activeElement) && setTimeout(() => {
                c(this, E).focusMainContainer();
              }, 0), b.div.remove(), b.isAttachedToDOM = !1, c(this, F) || this.addInkEditorIfNeeded(!1);
            }
            changeParent(b) {
              var P;
              b.parent !== this && (b.annotationElementId && (c(this, E).addDeletedAnnotationElement(b.annotationElementId), i.AnnotationEditor.deleteAnnotationElement(b), b.annotationElementId = null), this.attach(b), (P = b.parent) == null || P.detach(b), b.setParent(this), b.div && b.isAttachedToDOM && (b.div.remove(), this.div.append(b.div)));
            }
            add(b) {
              if (this.changeParent(b), c(this, E).addEditor(b), this.attach(b), !b.isAttachedToDOM) {
                const P = b.render();
                this.div.append(P), b.isAttachedToDOM = !0;
              }
              b.fixAndSetPosition(), b.onceAdded(), c(this, E).addToAnnotationStorage(b);
            }
            moveEditorInDOM(b) {
              var j;
              if (!b.isAttachedToDOM)
                return;
              const {
                activeElement: P
              } = document;
              b.div.contains(P) && (b._focusEventsAllowed = !1, setTimeout(() => {
                b.div.contains(document.activeElement) ? b._focusEventsAllowed = !0 : (b.div.addEventListener("focusin", () => {
                  b._focusEventsAllowed = !0;
                }, {
                  once: !0
                }), P.focus());
              }, 0)), b._structTreeParentId = (j = c(this, o)) == null ? void 0 : j.moveElementInDOM(this.div, b.div, b.contentDiv, !0);
            }
            addOrRebuild(b) {
              b.needsToBeRebuilt() ? b.rebuild() : this.add(b);
            }
            addUndoableEditor(b) {
              const P = () => b._uiManager.rebuild(b), j = () => {
                b.remove();
              };
              this.addCommands({
                cmd: P,
                undo: j,
                mustExec: !1
              });
            }
            getNextId() {
              return c(this, E).getId();
            }
            pasteEditor(b, P) {
              c(this, E).updateToolbar(b), c(this, E).updateMode(b);
              const {
                offsetX: j,
                offsetY: re
              } = Z(this, v, on).call(this), X = this.getNextId(), Q = Z(this, v, an).call(this, {
                parent: this,
                id: X,
                x: j,
                y: re,
                uiManager: c(this, E),
                isCentered: !0,
                ...P
              });
              Q && this.add(Q);
            }
            deserialize(b) {
              switch (b.annotationType ?? b.annotationEditorType) {
                case t.AnnotationEditorType.FREETEXT:
                  return a.FreeTextEditor.deserialize(b, this, c(this, E));
                case t.AnnotationEditorType.INK:
                  return s.InkEditor.deserialize(b, this, c(this, E));
                case t.AnnotationEditorType.STAMP:
                  return u.StampEditor.deserialize(b, this, c(this, E));
              }
              return null;
            }
            addNewEditor() {
              Z(this, v, Rt).call(this, Z(this, v, on).call(this), !0);
            }
            setSelected(b) {
              c(this, E).setSelected(b);
            }
            toggleSelected(b) {
              c(this, E).toggleSelected(b);
            }
            isSelected(b) {
              return c(this, E).isSelected(b);
            }
            unselect(b) {
              c(this, E).unselect(b);
            }
            pointerup(b) {
              const {
                isMac: P
              } = t.FeatureTest.platform;
              if (!(b.button !== 0 || b.ctrlKey && P) && b.target === this.div && c(this, D)) {
                if (he(this, D, !1), !c(this, w)) {
                  he(this, w, !0);
                  return;
                }
                if (c(this, E).getMode() === t.AnnotationEditorType.STAMP) {
                  c(this, E).unselectAll();
                  return;
                }
                Z(this, v, Rt).call(this, b, !1);
              }
            }
            pointerdown(b) {
              if (c(this, D)) {
                he(this, D, !1);
                return;
              }
              const {
                isMac: P
              } = t.FeatureTest.platform;
              if (b.button !== 0 || b.ctrlKey && P || b.target !== this.div)
                return;
              he(this, D, !0);
              const j = c(this, E).getActive();
              he(this, w, !j || j.isEmpty());
            }
            findNewParent(b, P, j) {
              const re = c(this, E).findParent(P, j);
              return re === null || re === this ? !1 : (re.changeParent(b), !0);
            }
            destroy() {
              var b, P;
              ((b = c(this, E).getActive()) == null ? void 0 : b.parent) === this && (c(this, E).commitOrRemove(), c(this, E).setActiveEditor(null));
              for (const j of c(this, T).values())
                (P = c(this, o)) == null || P.removePointerInTextLayer(j.contentDiv), j.setParent(null), j.isAttachedToDOM = !1, j.div.remove();
              this.div = null, c(this, T).clear(), c(this, E).removeLayer(this);
            }
            render({
              viewport: b
            }) {
              this.viewport = b, (0, h.setLayerDimensions)(this.div, b);
              for (const P of c(this, E).getEditors(this.pageIndex))
                this.add(P);
              this.updateMode();
            }
            update({
              viewport: b
            }) {
              c(this, E).commitOrRemove(), this.viewport = b, (0, h.setLayerDimensions)(this.div, {
                rotation: b.rotation
              }), this.updateMode();
            }
            get pageDimensions() {
              const {
                pageWidth: b,
                pageHeight: P
              } = this.viewport.rawDims;
              return [b, P];
            }
          };
          o = new WeakMap(), w = new WeakMap(), x = new WeakMap(), C = new WeakMap(), S = new WeakMap(), T = new WeakMap(), D = new WeakMap(), F = new WeakMap(), f = new WeakMap(), E = new WeakMap(), v = new WeakSet(), an = function(b) {
            switch (c(this, E).getMode()) {
              case t.AnnotationEditorType.FREETEXT:
                return new a.FreeTextEditor(b);
              case t.AnnotationEditorType.INK:
                return new s.InkEditor(b);
              case t.AnnotationEditorType.STAMP:
                return new u.StampEditor(b);
            }
            return null;
          }, Rt = function(b, P) {
            const j = this.getNextId(), re = Z(this, v, an).call(this, {
              parent: this,
              id: j,
              x: b.offsetX,
              y: b.offsetY,
              uiManager: c(this, E),
              isCentered: P
            });
            return re && this.add(re), re;
          }, on = function() {
            const {
              x: b,
              y: P,
              width: j,
              height: re
            } = this.div.getBoundingClientRect(), X = Math.max(0, b), Q = Math.max(0, P), q = Math.min(window.innerWidth, b + j), ie = Math.min(window.innerHeight, P + re), O = (X + q) / 2 - b, G = (Q + ie) / 2 - P, [K, M] = this.viewport.rotation % 180 === 0 ? [O, G] : [G, O];
            return {
              offsetX: K,
              offsetY: M
            };
          }, ln = function() {
            he(this, F, !0);
            for (const b of c(this, T).values())
              b.isEmpty() && b.remove();
            he(this, F, !1);
          }, qe(y, "_initialized", !1);
          let l = y;
          e.AnnotationEditorLayer = l;
        },
        /* 28 */
        /***/
        (r, e, n) => {
          var u, l, o, w, x, C, S, T, D, F, $n, Bn, Un, wt, cn, zn, un;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.FreeTextEditor = void 0;
          var t = n(1), i = n(5), a = n(4), s = n(29);
          const y = class y extends a.AnnotationEditor {
            constructor(P) {
              super({
                ...P,
                name: "freeTextEditor"
              });
              le(this, F);
              le(this, u, this.editorDivBlur.bind(this));
              le(this, l, this.editorDivFocus.bind(this));
              le(this, o, this.editorDivInput.bind(this));
              le(this, w, this.editorDivKeydown.bind(this));
              le(this, x);
              le(this, C, "");
              le(this, S, `${this.id}-editor`);
              le(this, T);
              le(this, D, null);
              he(this, x, P.color || y._defaultColor || a.AnnotationEditor._defaultLineColor), he(this, T, P.fontSize || y._defaultFontSize);
            }
            static get _keyboardManager() {
              const P = y.prototype, j = (Q) => Q.isEmpty(), re = i.AnnotationEditorUIManager.TRANSLATE_SMALL, X = i.AnnotationEditorUIManager.TRANSLATE_BIG;
              return (0, t.shadow)(this, "_keyboardManager", new i.KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], P.commitOrRemove, {
                bubbles: !0
              }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], P.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], P._translateEmpty, {
                args: [-re, 0],
                checker: j
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], P._translateEmpty, {
                args: [-X, 0],
                checker: j
              }], [["ArrowRight", "mac+ArrowRight"], P._translateEmpty, {
                args: [re, 0],
                checker: j
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], P._translateEmpty, {
                args: [X, 0],
                checker: j
              }], [["ArrowUp", "mac+ArrowUp"], P._translateEmpty, {
                args: [0, -re],
                checker: j
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], P._translateEmpty, {
                args: [0, -X],
                checker: j
              }], [["ArrowDown", "mac+ArrowDown"], P._translateEmpty, {
                args: [0, re],
                checker: j
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], P._translateEmpty, {
                args: [0, X],
                checker: j
              }]]));
            }
            static initialize(P) {
              a.AnnotationEditor.initialize(P, {
                strings: ["free_text2_default_content", "editor_free_text2_aria_label"]
              });
              const j = getComputedStyle(document.documentElement);
              this._internalPadding = parseFloat(j.getPropertyValue("--freetext-padding"));
            }
            static updateDefaultParams(P, j) {
              switch (P) {
                case t.AnnotationEditorParamsType.FREETEXT_SIZE:
                  y._defaultFontSize = j;
                  break;
                case t.AnnotationEditorParamsType.FREETEXT_COLOR:
                  y._defaultColor = j;
                  break;
              }
            }
            updateParams(P, j) {
              switch (P) {
                case t.AnnotationEditorParamsType.FREETEXT_SIZE:
                  Z(this, F, $n).call(this, j);
                  break;
                case t.AnnotationEditorParamsType.FREETEXT_COLOR:
                  Z(this, F, Bn).call(this, j);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[t.AnnotationEditorParamsType.FREETEXT_SIZE, y._defaultFontSize], [t.AnnotationEditorParamsType.FREETEXT_COLOR, y._defaultColor || a.AnnotationEditor._defaultLineColor]];
            }
            get propertiesToUpdate() {
              return [[t.AnnotationEditorParamsType.FREETEXT_SIZE, c(this, T)], [t.AnnotationEditorParamsType.FREETEXT_COLOR, c(this, x)]];
            }
            _translateEmpty(P, j) {
              this._uiManager.translateSelectedEditors(P, j, !0);
            }
            getInitialTranslation() {
              const P = this.parentScale;
              return [-y._internalPadding * P, -(y._internalPadding + c(this, T)) * P];
            }
            rebuild() {
              this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
            }
            enableEditMode() {
              this.isInEditMode() || (this.parent.setEditingState(!1), this.parent.updateToolbar(t.AnnotationEditorType.FREETEXT), super.enableEditMode(), this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), this.editorDiv.addEventListener("keydown", c(this, w)), this.editorDiv.addEventListener("focus", c(this, l)), this.editorDiv.addEventListener("blur", c(this, u)), this.editorDiv.addEventListener("input", c(this, o)));
            }
            disableEditMode() {
              this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", c(this, S)), this._isDraggable = !0, this.editorDiv.removeEventListener("keydown", c(this, w)), this.editorDiv.removeEventListener("focus", c(this, l)), this.editorDiv.removeEventListener("blur", c(this, u)), this.editorDiv.removeEventListener("input", c(this, o)), this.div.focus({
                preventScroll: !0
              }), this.isEditing = !1, this.parent.div.classList.add("freeTextEditing"));
            }
            focusin(P) {
              this._focusEventsAllowed && (super.focusin(P), P.target !== this.editorDiv && this.editorDiv.focus());
            }
            onceAdded() {
              var P;
              if (this.width) {
                Z(this, F, un).call(this);
                return;
              }
              this.enableEditMode(), this.editorDiv.focus(), (P = this._initialOptions) != null && P.isCentered && this.center(), this._initialOptions = null;
            }
            isEmpty() {
              return !this.editorDiv || this.editorDiv.innerText.trim() === "";
            }
            remove() {
              this.isEditing = !1, this.parent && (this.parent.setEditingState(!0), this.parent.div.classList.add("freeTextEditing")), super.remove();
            }
            commit() {
              if (!this.isInEditMode())
                return;
              super.commit(), this.disableEditMode();
              const P = c(this, C), j = he(this, C, Z(this, F, Un).call(this).trimEnd());
              if (P === j)
                return;
              const re = (X) => {
                if (he(this, C, X), !X) {
                  this.remove();
                  return;
                }
                Z(this, F, cn).call(this), this._uiManager.rebuild(this), Z(this, F, wt).call(this);
              };
              this.addCommands({
                cmd: () => {
                  re(j);
                },
                undo: () => {
                  re(P);
                },
                mustExec: !1
              }), Z(this, F, wt).call(this);
            }
            shouldGetKeyboardEvents() {
              return this.isInEditMode();
            }
            enterInEditMode() {
              this.enableEditMode(), this.editorDiv.focus();
            }
            dblclick(P) {
              this.enterInEditMode();
            }
            keydown(P) {
              P.target === this.div && P.key === "Enter" && (this.enterInEditMode(), P.preventDefault());
            }
            editorDivKeydown(P) {
              y._keyboardManager.exec(this, P);
            }
            editorDivFocus(P) {
              this.isEditing = !0;
            }
            editorDivBlur(P) {
              this.isEditing = !1;
            }
            editorDivInput(P) {
              this.parent.div.classList.toggle("freeTextEditing", this.isEmpty());
            }
            disableEditing() {
              this.editorDiv.setAttribute("role", "comment"), this.editorDiv.removeAttribute("aria-multiline");
            }
            enableEditing() {
              this.editorDiv.setAttribute("role", "textbox"), this.editorDiv.setAttribute("aria-multiline", !0);
            }
            render() {
              if (this.div)
                return this.div;
              let P, j;
              this.width && (P = this.x, j = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", c(this, S)), this.enableEditing(), a.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((X) => {
                var Q;
                return (Q = this.editorDiv) == null ? void 0 : Q.setAttribute("aria-label", X);
              }), a.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((X) => {
                var Q;
                return (Q = this.editorDiv) == null ? void 0 : Q.setAttribute("default-content", X);
              }), this.editorDiv.contentEditable = !0;
              const {
                style: re
              } = this.editorDiv;
              if (re.fontSize = `calc(${c(this, T)}px * var(--scale-factor))`, re.color = c(this, x), this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), (0, i.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
                const [X, Q] = this.parentDimensions;
                if (this.annotationElementId) {
                  const {
                    position: q
                  } = c(this, D);
                  let [ie, O] = this.getInitialTranslation();
                  [ie, O] = this.pageTranslationToScreen(ie, O);
                  const [G, K] = this.pageDimensions, [M, _] = this.pageTranslation;
                  let A, k;
                  switch (this.rotation) {
                    case 0:
                      A = P + (q[0] - M) / G, k = j + this.height - (q[1] - _) / K;
                      break;
                    case 90:
                      A = P + (q[0] - M) / G, k = j - (q[1] - _) / K, [ie, O] = [O, -ie];
                      break;
                    case 180:
                      A = P - this.width + (q[0] - M) / G, k = j - (q[1] - _) / K, [ie, O] = [-ie, -O];
                      break;
                    case 270:
                      A = P + (q[0] - M - this.height * K) / G, k = j + (q[1] - _ - this.width * G) / K, [ie, O] = [-O, ie];
                      break;
                  }
                  this.setAt(A * X, k * Q, ie, O);
                } else
                  this.setAt(P * X, j * Q, this.width * X, this.height * Q);
                Z(this, F, cn).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
              } else
                this._isDraggable = !1, this.editorDiv.contentEditable = !0;
              return this.div;
            }
            get contentDiv() {
              return this.editorDiv;
            }
            static deserialize(P, j, re) {
              let X = null;
              if (P instanceof s.FreeTextAnnotationElement) {
                const {
                  data: {
                    defaultAppearanceData: {
                      fontSize: q,
                      fontColor: ie
                    },
                    rect: O,
                    rotation: G,
                    id: K
                  },
                  textContent: M,
                  textPosition: _,
                  parent: {
                    page: {
                      pageNumber: A
                    }
                  }
                } = P;
                if (!M || M.length === 0)
                  return null;
                X = P = {
                  annotationType: t.AnnotationEditorType.FREETEXT,
                  color: Array.from(ie),
                  fontSize: q,
                  value: M.join(`
`),
                  position: _,
                  pageIndex: A - 1,
                  rect: O,
                  rotation: G,
                  id: K,
                  deleted: !1
                };
              }
              const Q = super.deserialize(P, j, re);
              return he(Q, T, P.fontSize), he(Q, x, t.Util.makeHexColor(...P.color)), he(Q, C, P.value), Q.annotationElementId = P.id || null, he(Q, D, X), Q;
            }
            serialize(P = !1) {
              if (this.isEmpty())
                return null;
              if (this.deleted)
                return {
                  pageIndex: this.pageIndex,
                  id: this.annotationElementId,
                  deleted: !0
                };
              const j = y._internalPadding * this.parentScale, re = this.getRect(j, j), X = a.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : c(this, x)), Q = {
                annotationType: t.AnnotationEditorType.FREETEXT,
                color: X,
                fontSize: c(this, T),
                value: c(this, C),
                pageIndex: this.pageIndex,
                rect: re,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
              return P ? Q : this.annotationElementId && !Z(this, F, zn).call(this, Q) ? null : (Q.id = this.annotationElementId, Q);
            }
          };
          u = new WeakMap(), l = new WeakMap(), o = new WeakMap(), w = new WeakMap(), x = new WeakMap(), C = new WeakMap(), S = new WeakMap(), T = new WeakMap(), D = new WeakMap(), F = new WeakSet(), $n = function(P) {
            const j = (X) => {
              this.editorDiv.style.fontSize = `calc(${X}px * var(--scale-factor))`, this.translate(0, -(X - c(this, T)) * this.parentScale), he(this, T, X), Z(this, F, wt).call(this);
            }, re = c(this, T);
            this.addCommands({
              cmd: () => {
                j(P);
              },
              undo: () => {
                j(re);
              },
              mustExec: !0,
              type: t.AnnotationEditorParamsType.FREETEXT_SIZE,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Bn = function(P) {
            const j = c(this, x);
            this.addCommands({
              cmd: () => {
                he(this, x, this.editorDiv.style.color = P);
              },
              undo: () => {
                he(this, x, this.editorDiv.style.color = j);
              },
              mustExec: !0,
              type: t.AnnotationEditorParamsType.FREETEXT_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Un = function() {
            const P = this.editorDiv.getElementsByTagName("div");
            if (P.length === 0)
              return this.editorDiv.innerText;
            const j = [];
            for (const re of P)
              j.push(re.innerText.replace(/\r\n?|\n/, ""));
            return j.join(`
`);
          }, wt = function() {
            const [P, j] = this.parentDimensions;
            let re;
            if (this.isAttachedToDOM)
              re = this.div.getBoundingClientRect();
            else {
              const {
                currentLayer: X,
                div: Q
              } = this, q = Q.style.display;
              Q.style.display = "hidden", X.div.append(this.div), re = Q.getBoundingClientRect(), Q.remove(), Q.style.display = q;
            }
            this.rotation % 180 === this.parentRotation % 180 ? (this.width = re.width / P, this.height = re.height / j) : (this.width = re.height / P, this.height = re.width / j), this.fixAndSetPosition();
          }, cn = function() {
            if (this.editorDiv.replaceChildren(), !!c(this, C))
              for (const P of c(this, C).split(`
`)) {
                const j = document.createElement("div");
                j.append(P ? document.createTextNode(P) : document.createElement("br")), this.editorDiv.append(j);
              }
          }, zn = function(P) {
            const {
              value: j,
              fontSize: re,
              color: X,
              rect: Q,
              pageIndex: q
            } = c(this, D);
            return P.value !== j || P.fontSize !== re || P.rect.some((ie, O) => Math.abs(ie - Q[O]) >= 1) || P.color.some((ie, O) => ie !== X[O]) || P.pageIndex !== q;
          }, un = function(P = !1) {
            if (!this.annotationElementId)
              return;
            if (Z(this, F, wt).call(this), !P && (this.width === 0 || this.height === 0)) {
              setTimeout(() => Z(this, F, un).call(this, !0), 0);
              return;
            }
            const j = y._internalPadding * this.parentScale;
            c(this, D).rect = this.getRect(j, j);
          }, qe(y, "_freeTextDefaultContent", ""), qe(y, "_internalPadding", 0), qe(y, "_defaultColor", null), qe(y, "_defaultFontSize", 10), qe(y, "_type", "freetext");
          let h = y;
          e.FreeTextEditor = h;
        },
        /* 29 */
        /***/
        (r, e, n) => {
          var k, $, ut, Hn, Y, ce, de, me, Ae, _e, te, se, R, H, J, ae, be, we, Ee, ee, Fe, ke, jn, Mt, hn, dn, Ue, Ye, Je, ye, oe, ue, Pe, fn, Ke, W, pe, De, Wn, pn;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.StampAnnotationElement = e.InkAnnotationElement = e.FreeTextAnnotationElement = e.AnnotationLayer = void 0;
          var t = n(1), i = n(6), a = n(3), s = n(30), h = n(31), u = n(32);
          const l = 1e3, o = 9, w = /* @__PURE__ */ new WeakSet();
          function x(xe) {
            return {
              width: xe[2] - xe[0],
              height: xe[3] - xe[1]
            };
          }
          class C {
            static create(U) {
              switch (U.data.annotationType) {
                case t.AnnotationType.LINK:
                  return new T(U);
                case t.AnnotationType.TEXT:
                  return new D(U);
                case t.AnnotationType.WIDGET:
                  switch (U.data.fieldType) {
                    case "Tx":
                      return new f(U);
                    case "Btn":
                      return U.data.radioButton ? new p(U) : U.data.checkBox ? new v(U) : new d(U);
                    case "Ch":
                      return new g(U);
                    case "Sig":
                      return new E(U);
                  }
                  return new F(U);
                case t.AnnotationType.POPUP:
                  return new m(U);
                case t.AnnotationType.FREETEXT:
                  return new L(U);
                case t.AnnotationType.LINE:
                  return new b(U);
                case t.AnnotationType.SQUARE:
                  return new P(U);
                case t.AnnotationType.CIRCLE:
                  return new j(U);
                case t.AnnotationType.POLYLINE:
                  return new re(U);
                case t.AnnotationType.CARET:
                  return new Q(U);
                case t.AnnotationType.INK:
                  return new q(U);
                case t.AnnotationType.POLYGON:
                  return new X(U);
                case t.AnnotationType.HIGHLIGHT:
                  return new ie(U);
                case t.AnnotationType.UNDERLINE:
                  return new O(U);
                case t.AnnotationType.SQUIGGLY:
                  return new G(U);
                case t.AnnotationType.STRIKEOUT:
                  return new K(U);
                case t.AnnotationType.STAMP:
                  return new M(U);
                case t.AnnotationType.FILEATTACHMENT:
                  return new _(U);
                default:
                  return new S(U);
              }
            }
          }
          const N = class N {
            constructor(U, {
              isRenderable: I = !1,
              ignoreBorder: V = !1,
              createQuadrilaterals: fe = !1
            } = {}) {
              le(this, k, !1);
              this.isRenderable = I, this.data = U.data, this.layer = U.layer, this.linkService = U.linkService, this.downloadManager = U.downloadManager, this.imageResourcesPath = U.imageResourcesPath, this.renderForms = U.renderForms, this.svgFactory = U.svgFactory, this.annotationStorage = U.annotationStorage, this.enableScripting = U.enableScripting, this.hasJSActions = U.hasJSActions, this._fieldObjects = U.fieldObjects, this.parent = U.parent, I && (this.container = this._createContainer(V)), fe && this._createQuadrilaterals();
            }
            static _hasPopupData({
              titleObj: U,
              contentsObj: I,
              richText: V
            }) {
              return !!(U != null && U.str || I != null && I.str || V != null && V.str);
            }
            get hasPopupData() {
              return N._hasPopupData(this.data);
            }
            _createContainer(U) {
              const {
                data: I,
                parent: {
                  page: V,
                  viewport: fe
                }
              } = this, ge = document.createElement("section");
              ge.setAttribute("data-annotation-id", I.id), this instanceof F || (ge.tabIndex = l), ge.style.zIndex = this.parent.zIndex++, this.data.popupRef && ge.setAttribute("aria-haspopup", "dialog"), I.noRotate && ge.classList.add("norotate");
              const {
                pageWidth: ve,
                pageHeight: Se,
                pageX: Le,
                pageY: Ie
              } = fe.rawDims;
              if (!I.rect || this instanceof m) {
                const {
                  rotation: je
                } = I;
                return !I.hasOwnCanvas && je !== 0 && this.setRotation(je, ge), ge;
              }
              const {
                width: Ce,
                height: Ge
              } = x(I.rect), Oe = t.Util.normalizeRect([I.rect[0], V.view[3] - I.rect[1] + V.view[1], I.rect[2], V.view[3] - I.rect[3] + V.view[1]]);
              if (!U && I.borderStyle.width > 0) {
                ge.style.borderWidth = `${I.borderStyle.width}px`;
                const je = I.borderStyle.horizontalCornerRadius, Ve = I.borderStyle.verticalCornerRadius;
                if (je > 0 || Ve > 0) {
                  const et = `calc(${je}px * var(--scale-factor)) / calc(${Ve}px * var(--scale-factor))`;
                  ge.style.borderRadius = et;
                } else if (this instanceof p) {
                  const et = `calc(${Ce}px * var(--scale-factor)) / calc(${Ge}px * var(--scale-factor))`;
                  ge.style.borderRadius = et;
                }
                switch (I.borderStyle.style) {
                  case t.AnnotationBorderStyleType.SOLID:
                    ge.style.borderStyle = "solid";
                    break;
                  case t.AnnotationBorderStyleType.DASHED:
                    ge.style.borderStyle = "dashed";
                    break;
                  case t.AnnotationBorderStyleType.BEVELED:
                    (0, t.warn)("Unimplemented border style: beveled");
                    break;
                  case t.AnnotationBorderStyleType.INSET:
                    (0, t.warn)("Unimplemented border style: inset");
                    break;
                  case t.AnnotationBorderStyleType.UNDERLINE:
                    ge.style.borderBottomStyle = "solid";
                    break;
                }
                const Qe = I.borderColor || null;
                Qe ? (he(this, k, !0), ge.style.borderColor = t.Util.makeHexColor(Qe[0] | 0, Qe[1] | 0, Qe[2] | 0)) : ge.style.borderWidth = 0;
              }
              ge.style.left = `${100 * (Oe[0] - Le) / ve}%`, ge.style.top = `${100 * (Oe[1] - Ie) / Se}%`;
              const {
                rotation: Re
              } = I;
              return I.hasOwnCanvas || Re === 0 ? (ge.style.width = `${100 * Ce / ve}%`, ge.style.height = `${100 * Ge / Se}%`) : this.setRotation(Re, ge), ge;
            }
            setRotation(U, I = this.container) {
              if (!this.data.rect)
                return;
              const {
                pageWidth: V,
                pageHeight: fe
              } = this.parent.viewport.rawDims, {
                width: ge,
                height: ve
              } = x(this.data.rect);
              let Se, Le;
              U % 180 === 0 ? (Se = 100 * ge / V, Le = 100 * ve / fe) : (Se = 100 * ve / V, Le = 100 * ge / fe), I.style.width = `${Se}%`, I.style.height = `${Le}%`, I.setAttribute("data-main-rotation", (360 - U) % 360);
            }
            get _commonActions() {
              const U = (I, V, fe) => {
                const ge = fe.detail[I], ve = ge[0], Se = ge.slice(1);
                fe.target.style[V] = s.ColorConverters[`${ve}_HTML`](Se), this.annotationStorage.setValue(this.data.id, {
                  [V]: s.ColorConverters[`${ve}_rgb`](Se)
                });
              };
              return (0, t.shadow)(this, "_commonActions", {
                display: (I) => {
                  const {
                    display: V
                  } = I.detail, fe = V % 2 === 1;
                  this.container.style.visibility = fe ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noView: fe,
                    noPrint: V === 1 || V === 2
                  });
                },
                print: (I) => {
                  this.annotationStorage.setValue(this.data.id, {
                    noPrint: !I.detail.print
                  });
                },
                hidden: (I) => {
                  const {
                    hidden: V
                  } = I.detail;
                  this.container.style.visibility = V ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noPrint: V,
                    noView: V
                  });
                },
                focus: (I) => {
                  setTimeout(() => I.target.focus({
                    preventScroll: !1
                  }), 0);
                },
                userName: (I) => {
                  I.target.title = I.detail.userName;
                },
                readonly: (I) => {
                  I.target.disabled = I.detail.readonly;
                },
                required: (I) => {
                  this._setRequired(I.target, I.detail.required);
                },
                bgColor: (I) => {
                  U("bgColor", "backgroundColor", I);
                },
                fillColor: (I) => {
                  U("fillColor", "backgroundColor", I);
                },
                fgColor: (I) => {
                  U("fgColor", "color", I);
                },
                textColor: (I) => {
                  U("textColor", "color", I);
                },
                borderColor: (I) => {
                  U("borderColor", "borderColor", I);
                },
                strokeColor: (I) => {
                  U("strokeColor", "borderColor", I);
                },
                rotation: (I) => {
                  const V = I.detail.rotation;
                  this.setRotation(V), this.annotationStorage.setValue(this.data.id, {
                    rotation: V
                  });
                }
              });
            }
            _dispatchEventFromSandbox(U, I) {
              const V = this._commonActions;
              for (const fe of Object.keys(I.detail)) {
                const ge = U[fe] || V[fe];
                ge == null || ge(I);
              }
            }
            _setDefaultPropertiesFromJS(U) {
              if (!this.enableScripting)
                return;
              const I = this.annotationStorage.getRawValue(this.data.id);
              if (!I)
                return;
              const V = this._commonActions;
              for (const [fe, ge] of Object.entries(I)) {
                const ve = V[fe];
                if (ve) {
                  const Se = {
                    detail: {
                      [fe]: ge
                    },
                    target: U
                  };
                  ve(Se), delete I[fe];
                }
              }
            }
            _createQuadrilaterals() {
              if (!this.container)
                return;
              const {
                quadPoints: U
              } = this.data;
              if (!U)
                return;
              const [I, V, fe, ge] = this.data.rect;
              if (U.length === 1) {
                const [, {
                  x: Ve,
                  y: Qe
                }, {
                  x: et,
                  y: nt
                }] = U[0];
                if (fe === Ve && ge === Qe && I === et && V === nt)
                  return;
              }
              const {
                style: ve
              } = this.container;
              let Se;
              if (c(this, k)) {
                const {
                  borderColor: Ve,
                  borderWidth: Qe
                } = ve;
                ve.borderWidth = 0, Se = ["url('data:image/svg+xml;utf8,", '<svg xmlns="http://www.w3.org/2000/svg"', ' preserveAspectRatio="none" viewBox="0 0 1 1">', `<g fill="transparent" stroke="${Ve}" stroke-width="${Qe}">`], this.container.classList.add("hasBorder");
              }
              const Le = fe - I, Ie = ge - V, {
                svgFactory: Ce
              } = this, Ge = Ce.createElement("svg");
              Ge.classList.add("quadrilateralsContainer"), Ge.setAttribute("width", 0), Ge.setAttribute("height", 0);
              const Oe = Ce.createElement("defs");
              Ge.append(Oe);
              const Re = Ce.createElement("clipPath"), je = `clippath_${this.data.id}`;
              Re.setAttribute("id", je), Re.setAttribute("clipPathUnits", "objectBoundingBox"), Oe.append(Re);
              for (const [, {
                x: Ve,
                y: Qe
              }, {
                x: et,
                y: nt
              }] of U) {
                const Ne = Ce.createElement("rect"), ne = (et - I) / Le, Te = (ge - Qe) / Ie, ze = (Ve - et) / Le, tt = (Qe - nt) / Ie;
                Ne.setAttribute("x", ne), Ne.setAttribute("y", Te), Ne.setAttribute("width", ze), Ne.setAttribute("height", tt), Re.append(Ne), Se == null || Se.push(`<rect vector-effect="non-scaling-stroke" x="${ne}" y="${Te}" width="${ze}" height="${tt}"/>`);
              }
              c(this, k) && (Se.push("</g></svg>')"), ve.backgroundImage = Se.join("")), this.container.append(Ge), this.container.style.clipPath = `url(#${je})`;
            }
            _createPopup() {
              const {
                container: U,
                data: I
              } = this;
              U.setAttribute("aria-haspopup", "dialog");
              const V = new m({
                data: {
                  color: I.color,
                  titleObj: I.titleObj,
                  modificationDate: I.modificationDate,
                  contentsObj: I.contentsObj,
                  richText: I.richText,
                  parentRect: I.rect,
                  borderStyle: 0,
                  id: `popup_${I.id}`,
                  rotation: I.rotation
                },
                parent: this.parent,
                elements: [this]
              });
              this.parent.div.append(V.render());
            }
            render() {
              (0, t.unreachable)("Abstract method `AnnotationElement.render` called");
            }
            _getElementsByName(U, I = null) {
              const V = [];
              if (this._fieldObjects) {
                const fe = this._fieldObjects[U];
                if (fe)
                  for (const {
                    page: ge,
                    id: ve,
                    exportValues: Se
                  } of fe) {
                    if (ge === -1 || ve === I)
                      continue;
                    const Le = typeof Se == "string" ? Se : null, Ie = document.querySelector(`[data-element-id="${ve}"]`);
                    if (Ie && !w.has(Ie)) {
                      (0, t.warn)(`_getElementsByName - element not allowed: ${ve}`);
                      continue;
                    }
                    V.push({
                      id: ve,
                      exportValue: Le,
                      domElement: Ie
                    });
                  }
                return V;
              }
              for (const fe of document.getElementsByName(U)) {
                const {
                  exportValue: ge
                } = fe, ve = fe.getAttribute("data-element-id");
                ve !== I && w.has(fe) && V.push({
                  id: ve,
                  exportValue: ge,
                  domElement: fe
                });
              }
              return V;
            }
            show() {
              var U;
              this.container && (this.container.hidden = !1), (U = this.popup) == null || U.maybeShow();
            }
            hide() {
              var U;
              this.container && (this.container.hidden = !0), (U = this.popup) == null || U.forceHide();
            }
            getElementsToTriggerPopup() {
              return this.container;
            }
            addHighlightArea() {
              const U = this.getElementsToTriggerPopup();
              if (Array.isArray(U))
                for (const I of U)
                  I.classList.add("highlightArea");
              else
                U.classList.add("highlightArea");
            }
            _editOnDoubleClick() {
              const {
                annotationEditorType: U,
                data: {
                  id: I
                }
              } = this;
              this.container.addEventListener("dblclick", () => {
                var V;
                (V = this.linkService.eventBus) == null || V.dispatch("switchannotationeditormode", {
                  source: this,
                  mode: U,
                  editId: I
                });
              });
            }
          };
          k = new WeakMap();
          let S = N;
          class T extends S {
            constructor(I, V = null) {
              super(I, {
                isRenderable: !0,
                ignoreBorder: !!(V != null && V.ignoreBorder),
                createQuadrilaterals: !0
              });
              le(this, $);
              this.isTooltipOnly = I.data.isTooltipOnly;
            }
            render() {
              const {
                data: I,
                linkService: V
              } = this, fe = document.createElement("a");
              fe.setAttribute("data-element-id", I.id);
              let ge = !1;
              return I.url ? (V.addLinkAttributes(fe, I.url, I.newWindow), ge = !0) : I.action ? (this._bindNamedAction(fe, I.action), ge = !0) : I.attachment ? (this._bindAttachment(fe, I.attachment), ge = !0) : I.setOCGState ? (Z(this, $, Hn).call(this, fe, I.setOCGState), ge = !0) : I.dest ? (this._bindLink(fe, I.dest), ge = !0) : (I.actions && (I.actions.Action || I.actions["Mouse Up"] || I.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(fe, I), ge = !0), I.resetForm ? (this._bindResetFormAction(fe, I.resetForm), ge = !0) : this.isTooltipOnly && !ge && (this._bindLink(fe, ""), ge = !0)), this.container.classList.add("linkAnnotation"), ge && this.container.append(fe), this.container;
            }
            _bindLink(I, V) {
              I.href = this.linkService.getDestinationHash(V), I.onclick = () => (V && this.linkService.goToDestination(V), !1), (V || V === "") && Z(this, $, ut).call(this);
            }
            _bindNamedAction(I, V) {
              I.href = this.linkService.getAnchorUrl(""), I.onclick = () => (this.linkService.executeNamedAction(V), !1), Z(this, $, ut).call(this);
            }
            _bindAttachment(I, V) {
              I.href = this.linkService.getAnchorUrl(""), I.onclick = () => {
                var fe;
                return (fe = this.downloadManager) == null || fe.openOrDownloadData(this.container, V.content, V.filename), !1;
              }, Z(this, $, ut).call(this);
            }
            _bindJSAction(I, V) {
              I.href = this.linkService.getAnchorUrl("");
              const fe = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
              for (const ge of Object.keys(V.actions)) {
                const ve = fe.get(ge);
                ve && (I[ve] = () => {
                  var Se;
                  return (Se = this.linkService.eventBus) == null || Se.dispatch("dispatcheventinsandbox", {
                    source: this,
                    detail: {
                      id: V.id,
                      name: ge
                    }
                  }), !1;
                });
              }
              I.onclick || (I.onclick = () => !1), Z(this, $, ut).call(this);
            }
            _bindResetFormAction(I, V) {
              const fe = I.onclick;
              if (fe || (I.href = this.linkService.getAnchorUrl("")), Z(this, $, ut).call(this), !this._fieldObjects) {
                (0, t.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), fe || (I.onclick = () => !1);
                return;
              }
              I.onclick = () => {
                var Ge;
                fe == null || fe();
                const {
                  fields: ge,
                  refs: ve,
                  include: Se
                } = V, Le = [];
                if (ge.length !== 0 || ve.length !== 0) {
                  const Oe = new Set(ve);
                  for (const Re of ge) {
                    const je = this._fieldObjects[Re] || [];
                    for (const {
                      id: Ve
                    } of je)
                      Oe.add(Ve);
                  }
                  for (const Re of Object.values(this._fieldObjects))
                    for (const je of Re)
                      Oe.has(je.id) === Se && Le.push(je);
                } else
                  for (const Oe of Object.values(this._fieldObjects))
                    Le.push(...Oe);
                const Ie = this.annotationStorage, Ce = [];
                for (const Oe of Le) {
                  const {
                    id: Re
                  } = Oe;
                  switch (Ce.push(Re), Oe.type) {
                    case "text": {
                      const Ve = Oe.defaultValue || "";
                      Ie.setValue(Re, {
                        value: Ve
                      });
                      break;
                    }
                    case "checkbox":
                    case "radiobutton": {
                      const Ve = Oe.defaultValue === Oe.exportValues;
                      Ie.setValue(Re, {
                        value: Ve
                      });
                      break;
                    }
                    case "combobox":
                    case "listbox": {
                      const Ve = Oe.defaultValue || "";
                      Ie.setValue(Re, {
                        value: Ve
                      });
                      break;
                    }
                    default:
                      continue;
                  }
                  const je = document.querySelector(`[data-element-id="${Re}"]`);
                  if (je) {
                    if (!w.has(je)) {
                      (0, t.warn)(`_bindResetFormAction - element not allowed: ${Re}`);
                      continue;
                    }
                  } else continue;
                  je.dispatchEvent(new Event("resetform"));
                }
                return this.enableScripting && ((Ge = this.linkService.eventBus) == null || Ge.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: "app",
                    ids: Ce,
                    name: "ResetForm"
                  }
                })), !1;
              };
            }
          }
          $ = new WeakSet(), ut = function() {
            this.container.setAttribute("data-internal-link", "");
          }, Hn = function(I, V) {
            I.href = this.linkService.getAnchorUrl(""), I.onclick = () => (this.linkService.executeSetOCGState(V), !1), Z(this, $, ut).call(this);
          };
          class D extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0
              });
            }
            render() {
              this.container.classList.add("textAnnotation");
              const U = document.createElement("img");
              return U.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", U.alt = "[{{type}} Annotation]", U.dataset.l10nId = "text_annotation_type", U.dataset.l10nArgs = JSON.stringify({
                type: this.data.name
              }), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(U), this.container;
            }
          }
          class F extends S {
            render() {
              return this.data.alternativeText && (this.container.title = this.data.alternativeText), this.container;
            }
            showElementAndHideCanvas(U) {
              var I;
              this.data.hasOwnCanvas && (((I = U.previousSibling) == null ? void 0 : I.nodeName) === "CANVAS" && (U.previousSibling.hidden = !0), U.hidden = !1);
            }
            _getKeyModifier(U) {
              const {
                isWin: I,
                isMac: V
              } = t.FeatureTest.platform;
              return I && U.ctrlKey || V && U.metaKey;
            }
            _setEventListener(U, I, V, fe, ge) {
              V.includes("mouse") ? U.addEventListener(V, (ve) => {
                var Se;
                (Se = this.linkService.eventBus) == null || Se.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: fe,
                    value: ge(ve),
                    shift: ve.shiftKey,
                    modifier: this._getKeyModifier(ve)
                  }
                });
              }) : U.addEventListener(V, (ve) => {
                var Se;
                if (V === "blur") {
                  if (!I.focused || !ve.relatedTarget)
                    return;
                  I.focused = !1;
                } else if (V === "focus") {
                  if (I.focused)
                    return;
                  I.focused = !0;
                }
                ge && ((Se = this.linkService.eventBus) == null || Se.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: fe,
                    value: ge(ve)
                  }
                }));
              });
            }
            _setEventListeners(U, I, V, fe) {
              var ge, ve, Se;
              for (const [Le, Ie] of V)
                (Ie === "Action" || (ge = this.data.actions) != null && ge[Ie]) && ((Ie === "Focus" || Ie === "Blur") && (I || (I = {
                  focused: !1
                })), this._setEventListener(U, I, Le, Ie, fe), Ie === "Focus" && !((ve = this.data.actions) != null && ve.Blur) ? this._setEventListener(U, I, "blur", "Blur", null) : Ie === "Blur" && !((Se = this.data.actions) != null && Se.Focus) && this._setEventListener(U, I, "focus", "Focus", null));
            }
            _setBackgroundColor(U) {
              const I = this.data.backgroundColor || null;
              U.style.backgroundColor = I === null ? "transparent" : t.Util.makeHexColor(I[0], I[1], I[2]);
            }
            _setTextStyle(U) {
              const I = ["left", "center", "right"], {
                fontColor: V
              } = this.data.defaultAppearanceData, fe = this.data.defaultAppearanceData.fontSize || o, ge = U.style;
              let ve;
              const Se = 2, Le = (Ie) => Math.round(10 * Ie) / 10;
              if (this.data.multiLine) {
                const Ie = Math.abs(this.data.rect[3] - this.data.rect[1] - Se), Ce = Math.round(Ie / (t.LINE_FACTOR * fe)) || 1, Ge = Ie / Ce;
                ve = Math.min(fe, Le(Ge / t.LINE_FACTOR));
              } else {
                const Ie = Math.abs(this.data.rect[3] - this.data.rect[1] - Se);
                ve = Math.min(fe, Le(Ie / t.LINE_FACTOR));
              }
              ge.fontSize = `calc(${ve}px * var(--scale-factor))`, ge.color = t.Util.makeHexColor(V[0], V[1], V[2]), this.data.textAlignment !== null && (ge.textAlign = I[this.data.textAlignment]);
            }
            _setRequired(U, I) {
              I ? U.setAttribute("required", !0) : U.removeAttribute("required"), U.setAttribute("aria-required", I);
            }
          }
          class f extends F {
            constructor(U) {
              const I = U.renderForms || !U.data.hasAppearance && !!U.data.fieldValue;
              super(U, {
                isRenderable: I
              });
            }
            setPropertyOnSiblings(U, I, V, fe) {
              const ge = this.annotationStorage;
              for (const ve of this._getElementsByName(U.name, U.id))
                ve.domElement && (ve.domElement[I] = V), ge.setValue(ve.id, {
                  [fe]: V
                });
            }
            render() {
              var fe, ge;
              const U = this.annotationStorage, I = this.data.id;
              this.container.classList.add("textWidgetAnnotation");
              let V = null;
              if (this.renderForms) {
                const ve = U.getValue(I, {
                  value: this.data.fieldValue
                });
                let Se = ve.value || "";
                const Le = U.getValue(I, {
                  charLimit: this.data.maxLen
                }).charLimit;
                Le && Se.length > Le && (Se = Se.slice(0, Le));
                let Ie = ve.formattedValue || ((fe = this.data.textContent) == null ? void 0 : fe.join(`
`)) || null;
                Ie && this.data.comb && (Ie = Ie.replaceAll(/\s+/g, ""));
                const Ce = {
                  userValue: Se,
                  formattedValue: Ie,
                  lastCommittedValue: null,
                  commitKey: 1,
                  focused: !1
                };
                this.data.multiLine ? (V = document.createElement("textarea"), V.textContent = Ie ?? Se, this.data.doNotScroll && (V.style.overflowY = "hidden")) : (V = document.createElement("input"), V.type = "text", V.setAttribute("value", Ie ?? Se), this.data.doNotScroll && (V.style.overflowX = "hidden")), this.data.hasOwnCanvas && (V.hidden = !0), w.add(V), V.setAttribute("data-element-id", I), V.disabled = this.data.readOnly, V.name = this.data.fieldName, V.tabIndex = l, this._setRequired(V, this.data.required), Le && (V.maxLength = Le), V.addEventListener("input", (Oe) => {
                  U.setValue(I, {
                    value: Oe.target.value
                  }), this.setPropertyOnSiblings(V, "value", Oe.target.value, "value"), Ce.formattedValue = null;
                }), V.addEventListener("resetform", (Oe) => {
                  const Re = this.data.defaultFieldValue ?? "";
                  V.value = Ce.userValue = Re, Ce.formattedValue = null;
                });
                let Ge = (Oe) => {
                  const {
                    formattedValue: Re
                  } = Ce;
                  Re != null && (Oe.target.value = Re), Oe.target.scrollLeft = 0;
                };
                if (this.enableScripting && this.hasJSActions) {
                  V.addEventListener("focus", (Re) => {
                    if (Ce.focused)
                      return;
                    const {
                      target: je
                    } = Re;
                    Ce.userValue && (je.value = Ce.userValue), Ce.lastCommittedValue = je.value, Ce.commitKey = 1, Ce.focused = !0;
                  }), V.addEventListener("updatefromsandbox", (Re) => {
                    this.showElementAndHideCanvas(Re.target);
                    const je = {
                      value(Ve) {
                        Ce.userValue = Ve.detail.value ?? "", U.setValue(I, {
                          value: Ce.userValue.toString()
                        }), Ve.target.value = Ce.userValue;
                      },
                      formattedValue(Ve) {
                        const {
                          formattedValue: Qe
                        } = Ve.detail;
                        Ce.formattedValue = Qe, Qe != null && Ve.target !== document.activeElement && (Ve.target.value = Qe), U.setValue(I, {
                          formattedValue: Qe
                        });
                      },
                      selRange(Ve) {
                        Ve.target.setSelectionRange(...Ve.detail.selRange);
                      },
                      charLimit: (Ve) => {
                        var Ne;
                        const {
                          charLimit: Qe
                        } = Ve.detail, {
                          target: et
                        } = Ve;
                        if (Qe === 0) {
                          et.removeAttribute("maxLength");
                          return;
                        }
                        et.setAttribute("maxLength", Qe);
                        let nt = Ce.userValue;
                        !nt || nt.length <= Qe || (nt = nt.slice(0, Qe), et.value = Ce.userValue = nt, U.setValue(I, {
                          value: nt
                        }), (Ne = this.linkService.eventBus) == null || Ne.dispatch("dispatcheventinsandbox", {
                          source: this,
                          detail: {
                            id: I,
                            name: "Keystroke",
                            value: nt,
                            willCommit: !0,
                            commitKey: 1,
                            selStart: et.selectionStart,
                            selEnd: et.selectionEnd
                          }
                        }));
                      }
                    };
                    this._dispatchEventFromSandbox(je, Re);
                  }), V.addEventListener("keydown", (Re) => {
                    var Qe;
                    Ce.commitKey = 1;
                    let je = -1;
                    if (Re.key === "Escape" ? je = 0 : Re.key === "Enter" && !this.data.multiLine ? je = 2 : Re.key === "Tab" && (Ce.commitKey = 3), je === -1)
                      return;
                    const {
                      value: Ve
                    } = Re.target;
                    Ce.lastCommittedValue !== Ve && (Ce.lastCommittedValue = Ve, Ce.userValue = Ve, (Qe = this.linkService.eventBus) == null || Qe.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: I,
                        name: "Keystroke",
                        value: Ve,
                        willCommit: !0,
                        commitKey: je,
                        selStart: Re.target.selectionStart,
                        selEnd: Re.target.selectionEnd
                      }
                    }));
                  });
                  const Oe = Ge;
                  Ge = null, V.addEventListener("blur", (Re) => {
                    var Ve;
                    if (!Ce.focused || !Re.relatedTarget)
                      return;
                    Ce.focused = !1;
                    const {
                      value: je
                    } = Re.target;
                    Ce.userValue = je, Ce.lastCommittedValue !== je && ((Ve = this.linkService.eventBus) == null || Ve.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: I,
                        name: "Keystroke",
                        value: je,
                        willCommit: !0,
                        commitKey: Ce.commitKey,
                        selStart: Re.target.selectionStart,
                        selEnd: Re.target.selectionEnd
                      }
                    })), Oe(Re);
                  }), (ge = this.data.actions) != null && ge.Keystroke && V.addEventListener("beforeinput", (Re) => {
                    var Te;
                    Ce.lastCommittedValue = null;
                    const {
                      data: je,
                      target: Ve
                    } = Re, {
                      value: Qe,
                      selectionStart: et,
                      selectionEnd: nt
                    } = Ve;
                    let Ne = et, ne = nt;
                    switch (Re.inputType) {
                      case "deleteWordBackward": {
                        const ze = Qe.substring(0, et).match(/\w*[^\w]*$/);
                        ze && (Ne -= ze[0].length);
                        break;
                      }
                      case "deleteWordForward": {
                        const ze = Qe.substring(et).match(/^[^\w]*\w*/);
                        ze && (ne += ze[0].length);
                        break;
                      }
                      case "deleteContentBackward":
                        et === nt && (Ne -= 1);
                        break;
                      case "deleteContentForward":
                        et === nt && (ne += 1);
                        break;
                    }
                    Re.preventDefault(), (Te = this.linkService.eventBus) == null || Te.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: I,
                        name: "Keystroke",
                        value: Qe,
                        change: je || "",
                        willCommit: !1,
                        selStart: Ne,
                        selEnd: ne
                      }
                    });
                  }), this._setEventListeners(V, Ce, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Re) => Re.target.value);
                }
                if (Ge && V.addEventListener("blur", Ge), this.data.comb) {
                  const Re = (this.data.rect[2] - this.data.rect[0]) / Le;
                  V.classList.add("comb"), V.style.letterSpacing = `calc(${Re}px * var(--scale-factor) - 1ch)`;
                }
              } else
                V = document.createElement("div"), V.textContent = this.data.fieldValue, V.style.verticalAlign = "middle", V.style.display = "table-cell";
              return this._setTextStyle(V), this._setBackgroundColor(V), this._setDefaultPropertiesFromJS(V), this.container.append(V), this.container;
            }
          }
          class E extends F {
            constructor(U) {
              super(U, {
                isRenderable: !!U.data.hasOwnCanvas
              });
            }
          }
          class v extends F {
            constructor(U) {
              super(U, {
                isRenderable: U.renderForms
              });
            }
            render() {
              const U = this.annotationStorage, I = this.data, V = I.id;
              let fe = U.getValue(V, {
                value: I.exportValue === I.fieldValue
              }).value;
              typeof fe == "string" && (fe = fe !== "Off", U.setValue(V, {
                value: fe
              })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
              const ge = document.createElement("input");
              return w.add(ge), ge.setAttribute("data-element-id", V), ge.disabled = I.readOnly, this._setRequired(ge, this.data.required), ge.type = "checkbox", ge.name = I.fieldName, fe && ge.setAttribute("checked", !0), ge.setAttribute("exportValue", I.exportValue), ge.tabIndex = l, ge.addEventListener("change", (ve) => {
                const {
                  name: Se,
                  checked: Le
                } = ve.target;
                for (const Ie of this._getElementsByName(Se, V)) {
                  const Ce = Le && Ie.exportValue === I.exportValue;
                  Ie.domElement && (Ie.domElement.checked = Ce), U.setValue(Ie.id, {
                    value: Ce
                  });
                }
                U.setValue(V, {
                  value: Le
                });
              }), ge.addEventListener("resetform", (ve) => {
                const Se = I.defaultFieldValue || "Off";
                ve.target.checked = Se === I.exportValue;
              }), this.enableScripting && this.hasJSActions && (ge.addEventListener("updatefromsandbox", (ve) => {
                const Se = {
                  value(Le) {
                    Le.target.checked = Le.detail.value !== "Off", U.setValue(V, {
                      value: Le.target.checked
                    });
                  }
                };
                this._dispatchEventFromSandbox(Se, ve);
              }), this._setEventListeners(ge, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (ve) => ve.target.checked)), this._setBackgroundColor(ge), this._setDefaultPropertiesFromJS(ge), this.container.append(ge), this.container;
            }
          }
          class p extends F {
            constructor(U) {
              super(U, {
                isRenderable: U.renderForms
              });
            }
            render() {
              this.container.classList.add("buttonWidgetAnnotation", "radioButton");
              const U = this.annotationStorage, I = this.data, V = I.id;
              let fe = U.getValue(V, {
                value: I.fieldValue === I.buttonValue
              }).value;
              typeof fe == "string" && (fe = fe !== I.buttonValue, U.setValue(V, {
                value: fe
              }));
              const ge = document.createElement("input");
              if (w.add(ge), ge.setAttribute("data-element-id", V), ge.disabled = I.readOnly, this._setRequired(ge, this.data.required), ge.type = "radio", ge.name = I.fieldName, fe && ge.setAttribute("checked", !0), ge.tabIndex = l, ge.addEventListener("change", (ve) => {
                const {
                  name: Se,
                  checked: Le
                } = ve.target;
                for (const Ie of this._getElementsByName(Se, V))
                  U.setValue(Ie.id, {
                    value: !1
                  });
                U.setValue(V, {
                  value: Le
                });
              }), ge.addEventListener("resetform", (ve) => {
                const Se = I.defaultFieldValue;
                ve.target.checked = Se != null && Se === I.buttonValue;
              }), this.enableScripting && this.hasJSActions) {
                const ve = I.buttonValue;
                ge.addEventListener("updatefromsandbox", (Se) => {
                  const Le = {
                    value: (Ie) => {
                      const Ce = ve === Ie.detail.value;
                      for (const Ge of this._getElementsByName(Ie.target.name)) {
                        const Oe = Ce && Ge.id === V;
                        Ge.domElement && (Ge.domElement.checked = Oe), U.setValue(Ge.id, {
                          value: Oe
                        });
                      }
                    }
                  };
                  this._dispatchEventFromSandbox(Le, Se);
                }), this._setEventListeners(ge, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Se) => Se.target.checked);
              }
              return this._setBackgroundColor(ge), this._setDefaultPropertiesFromJS(ge), this.container.append(ge), this.container;
            }
          }
          class d extends T {
            constructor(U) {
              super(U, {
                ignoreBorder: U.data.hasAppearance
              });
            }
            render() {
              const U = super.render();
              U.classList.add("buttonWidgetAnnotation", "pushButton"), this.data.alternativeText && (U.title = this.data.alternativeText);
              const I = U.lastChild;
              return this.enableScripting && this.hasJSActions && I && (this._setDefaultPropertiesFromJS(I), I.addEventListener("updatefromsandbox", (V) => {
                this._dispatchEventFromSandbox({}, V);
              })), U;
            }
          }
          class g extends F {
            constructor(U) {
              super(U, {
                isRenderable: U.renderForms
              });
            }
            render() {
              this.container.classList.add("choiceWidgetAnnotation");
              const U = this.annotationStorage, I = this.data.id, V = U.getValue(I, {
                value: this.data.fieldValue
              }), fe = document.createElement("select");
              w.add(fe), fe.setAttribute("data-element-id", I), fe.disabled = this.data.readOnly, this._setRequired(fe, this.data.required), fe.name = this.data.fieldName, fe.tabIndex = l;
              let ge = this.data.combo && this.data.options.length > 0;
              this.data.combo || (fe.size = this.data.options.length, this.data.multiSelect && (fe.multiple = !0)), fe.addEventListener("resetform", (Ce) => {
                const Ge = this.data.defaultFieldValue;
                for (const Oe of fe.options)
                  Oe.selected = Oe.value === Ge;
              });
              for (const Ce of this.data.options) {
                const Ge = document.createElement("option");
                Ge.textContent = Ce.displayValue, Ge.value = Ce.exportValue, V.value.includes(Ce.exportValue) && (Ge.setAttribute("selected", !0), ge = !1), fe.append(Ge);
              }
              let ve = null;
              if (ge) {
                const Ce = document.createElement("option");
                Ce.value = " ", Ce.setAttribute("hidden", !0), Ce.setAttribute("selected", !0), fe.prepend(Ce), ve = () => {
                  Ce.remove(), fe.removeEventListener("input", ve), ve = null;
                }, fe.addEventListener("input", ve);
              }
              const Se = (Ce) => {
                const Ge = Ce ? "value" : "textContent", {
                  options: Oe,
                  multiple: Re
                } = fe;
                return Re ? Array.prototype.filter.call(Oe, (je) => je.selected).map((je) => je[Ge]) : Oe.selectedIndex === -1 ? null : Oe[Oe.selectedIndex][Ge];
              };
              let Le = Se(!1);
              const Ie = (Ce) => {
                const Ge = Ce.target.options;
                return Array.prototype.map.call(Ge, (Oe) => ({
                  displayValue: Oe.textContent,
                  exportValue: Oe.value
                }));
              };
              return this.enableScripting && this.hasJSActions ? (fe.addEventListener("updatefromsandbox", (Ce) => {
                const Ge = {
                  value(Oe) {
                    ve == null || ve();
                    const Re = Oe.detail.value, je = new Set(Array.isArray(Re) ? Re : [Re]);
                    for (const Ve of fe.options)
                      Ve.selected = je.has(Ve.value);
                    U.setValue(I, {
                      value: Se(!0)
                    }), Le = Se(!1);
                  },
                  multipleSelection(Oe) {
                    fe.multiple = !0;
                  },
                  remove(Oe) {
                    const Re = fe.options, je = Oe.detail.remove;
                    Re[je].selected = !1, fe.remove(je), Re.length > 0 && Array.prototype.findIndex.call(Re, (Qe) => Qe.selected) === -1 && (Re[0].selected = !0), U.setValue(I, {
                      value: Se(!0),
                      items: Ie(Oe)
                    }), Le = Se(!1);
                  },
                  clear(Oe) {
                    for (; fe.length !== 0; )
                      fe.remove(0);
                    U.setValue(I, {
                      value: null,
                      items: []
                    }), Le = Se(!1);
                  },
                  insert(Oe) {
                    const {
                      index: Re,
                      displayValue: je,
                      exportValue: Ve
                    } = Oe.detail.insert, Qe = fe.children[Re], et = document.createElement("option");
                    et.textContent = je, et.value = Ve, Qe ? Qe.before(et) : fe.append(et), U.setValue(I, {
                      value: Se(!0),
                      items: Ie(Oe)
                    }), Le = Se(!1);
                  },
                  items(Oe) {
                    const {
                      items: Re
                    } = Oe.detail;
                    for (; fe.length !== 0; )
                      fe.remove(0);
                    for (const je of Re) {
                      const {
                        displayValue: Ve,
                        exportValue: Qe
                      } = je, et = document.createElement("option");
                      et.textContent = Ve, et.value = Qe, fe.append(et);
                    }
                    fe.options.length > 0 && (fe.options[0].selected = !0), U.setValue(I, {
                      value: Se(!0),
                      items: Ie(Oe)
                    }), Le = Se(!1);
                  },
                  indices(Oe) {
                    const Re = new Set(Oe.detail.indices);
                    for (const je of Oe.target.options)
                      je.selected = Re.has(je.index);
                    U.setValue(I, {
                      value: Se(!0)
                    }), Le = Se(!1);
                  },
                  editable(Oe) {
                    Oe.target.disabled = !Oe.detail.editable;
                  }
                };
                this._dispatchEventFromSandbox(Ge, Ce);
              }), fe.addEventListener("input", (Ce) => {
                var Oe;
                const Ge = Se(!0);
                U.setValue(I, {
                  value: Ge
                }), Ce.preventDefault(), (Oe = this.linkService.eventBus) == null || Oe.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: I,
                    name: "Keystroke",
                    value: Le,
                    changeEx: Ge,
                    willCommit: !1,
                    commitKey: 1,
                    keyDown: !1
                  }
                });
              }), this._setEventListeners(fe, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (Ce) => Ce.target.value)) : fe.addEventListener("input", function(Ce) {
                U.setValue(I, {
                  value: Se(!0)
                });
              }), this.data.combo && this._setTextStyle(fe), this._setBackgroundColor(fe), this._setDefaultPropertiesFromJS(fe), this.container.append(fe), this.container;
            }
          }
          class m extends S {
            constructor(U) {
              const {
                data: I,
                elements: V
              } = U;
              super(U, {
                isRenderable: S._hasPopupData(I)
              }), this.elements = V;
            }
            render() {
              this.container.classList.add("popupAnnotation");
              const U = new y({
                container: this.container,
                color: this.data.color,
                titleObj: this.data.titleObj,
                modificationDate: this.data.modificationDate,
                contentsObj: this.data.contentsObj,
                richText: this.data.richText,
                rect: this.data.rect,
                parentRect: this.data.parentRect || null,
                parent: this.parent,
                elements: this.elements,
                open: this.data.open
              }), I = [];
              for (const V of this.elements)
                V.popup = U, I.push(V.data.id), V.addHighlightArea();
              return this.container.setAttribute("aria-controls", I.map((V) => `${t.AnnotationPrefix}${V}`).join(",")), this.container;
            }
          }
          class y {
            constructor({
              container: U,
              color: I,
              elements: V,
              titleObj: fe,
              modificationDate: ge,
              contentsObj: ve,
              richText: Se,
              parent: Le,
              rect: Ie,
              parentRect: Ce,
              open: Ge
            }) {
              le(this, ke);
              le(this, Y, null);
              le(this, ce, Z(this, ke, jn).bind(this));
              le(this, de, Z(this, ke, dn).bind(this));
              le(this, me, Z(this, ke, hn).bind(this));
              le(this, Ae, Z(this, ke, Mt).bind(this));
              le(this, _e, null);
              le(this, te, null);
              le(this, se, null);
              le(this, R, null);
              le(this, H, null);
              le(this, J, null);
              le(this, ae, !1);
              le(this, be, null);
              le(this, we, null);
              le(this, Ee, null);
              le(this, ee, null);
              le(this, Fe, !1);
              var Re;
              he(this, te, U), he(this, ee, fe), he(this, se, ve), he(this, Ee, Se), he(this, H, Le), he(this, _e, I), he(this, we, Ie), he(this, J, Ce), he(this, R, V);
              const Oe = i.PDFDateString.toDateObject(ge);
              Oe && he(this, Y, Le.l10n.get("annotation_date_string", {
                date: Oe.toLocaleDateString(),
                time: Oe.toLocaleTimeString()
              })), this.trigger = V.flatMap((je) => je.getElementsToTriggerPopup());
              for (const je of this.trigger)
                je.addEventListener("click", c(this, Ae)), je.addEventListener("mouseenter", c(this, me)), je.addEventListener("mouseleave", c(this, de)), je.classList.add("popupTriggerArea");
              for (const je of V)
                (Re = je.container) == null || Re.addEventListener("keydown", c(this, ce));
              c(this, te).hidden = !0, Ge && Z(this, ke, Mt).call(this);
            }
            render() {
              if (c(this, be))
                return;
              const {
                page: {
                  view: U
                },
                viewport: {
                  rawDims: {
                    pageWidth: I,
                    pageHeight: V,
                    pageX: fe,
                    pageY: ge
                  }
                }
              } = c(this, H), ve = he(this, be, document.createElement("div"));
              if (ve.className = "popup", c(this, _e)) {
                const Ne = ve.style.outlineColor = t.Util.makeHexColor(...c(this, _e));
                CSS.supports("background-color", "color-mix(in srgb, red 30%, white)") ? ve.style.backgroundColor = `color-mix(in srgb, ${Ne} 30%, white)` : ve.style.backgroundColor = t.Util.makeHexColor(...c(this, _e).map((Te) => Math.floor(0.7 * (255 - Te) + Te)));
              }
              const Se = document.createElement("span");
              Se.className = "header";
              const Le = document.createElement("h1");
              if (Se.append(Le), {
                dir: Le.dir,
                str: Le.textContent
              } = c(this, ee), ve.append(Se), c(this, Y)) {
                const Ne = document.createElement("span");
                Ne.classList.add("popupDate"), c(this, Y).then((ne) => {
                  Ne.textContent = ne;
                }), Se.append(Ne);
              }
              const Ie = c(this, se), Ce = c(this, Ee);
              if (Ce != null && Ce.str && (!(Ie != null && Ie.str) || Ie.str === Ce.str))
                u.XfaLayer.render({
                  xfaHtml: Ce.html,
                  intent: "richText",
                  div: ve
                }), ve.lastChild.classList.add("richText", "popupContent");
              else {
                const Ne = this._formatContents(Ie);
                ve.append(Ne);
              }
              let Ge = !!c(this, J), Oe = Ge ? c(this, J) : c(this, we);
              for (const Ne of c(this, R))
                if (!Oe || t.Util.intersect(Ne.data.rect, Oe) !== null) {
                  Oe = Ne.data.rect, Ge = !0;
                  break;
                }
              const Re = t.Util.normalizeRect([Oe[0], U[3] - Oe[1] + U[1], Oe[2], U[3] - Oe[3] + U[1]]), Ve = Ge ? Oe[2] - Oe[0] + 5 : 0, Qe = Re[0] + Ve, et = Re[1], {
                style: nt
              } = c(this, te);
              nt.left = `${100 * (Qe - fe) / I}%`, nt.top = `${100 * (et - ge) / V}%`, c(this, te).append(ve);
            }
            _formatContents({
              str: U,
              dir: I
            }) {
              const V = document.createElement("p");
              V.classList.add("popupContent"), V.dir = I;
              const fe = U.split(/(?:\r\n?|\n)/);
              for (let ge = 0, ve = fe.length; ge < ve; ++ge) {
                const Se = fe[ge];
                V.append(document.createTextNode(Se)), ge < ve - 1 && V.append(document.createElement("br"));
              }
              return V;
            }
            forceHide() {
              he(this, Fe, this.isVisible), c(this, Fe) && (c(this, te).hidden = !0);
            }
            maybeShow() {
              c(this, Fe) && (he(this, Fe, !1), c(this, te).hidden = !1);
            }
            get isVisible() {
              return c(this, te).hidden === !1;
            }
          }
          Y = new WeakMap(), ce = new WeakMap(), de = new WeakMap(), me = new WeakMap(), Ae = new WeakMap(), _e = new WeakMap(), te = new WeakMap(), se = new WeakMap(), R = new WeakMap(), H = new WeakMap(), J = new WeakMap(), ae = new WeakMap(), be = new WeakMap(), we = new WeakMap(), Ee = new WeakMap(), ee = new WeakMap(), Fe = new WeakMap(), ke = new WeakSet(), jn = function(U) {
            U.altKey || U.shiftKey || U.ctrlKey || U.metaKey || (U.key === "Enter" || U.key === "Escape" && c(this, ae)) && Z(this, ke, Mt).call(this);
          }, Mt = function() {
            he(this, ae, !c(this, ae)), c(this, ae) ? (Z(this, ke, hn).call(this), c(this, te).addEventListener("click", c(this, Ae)), c(this, te).addEventListener("keydown", c(this, ce))) : (Z(this, ke, dn).call(this), c(this, te).removeEventListener("click", c(this, Ae)), c(this, te).removeEventListener("keydown", c(this, ce)));
          }, hn = function() {
            c(this, be) || this.render(), this.isVisible ? c(this, ae) && c(this, te).classList.add("focused") : (c(this, te).hidden = !1, c(this, te).style.zIndex = parseInt(c(this, te).style.zIndex) + 1e3);
          }, dn = function() {
            c(this, te).classList.remove("focused"), !(c(this, ae) || !this.isVisible) && (c(this, te).hidden = !0, c(this, te).style.zIndex = parseInt(c(this, te).style.zIndex) - 1e3);
          };
          class L extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0,
                ignoreBorder: !0
              }), this.textContent = U.data.textContent, this.textPosition = U.data.textPosition, this.annotationEditorType = t.AnnotationEditorType.FREETEXT;
            }
            render() {
              if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
                const U = document.createElement("div");
                U.classList.add("annotationTextContent"), U.setAttribute("role", "comment");
                for (const I of this.textContent) {
                  const V = document.createElement("span");
                  V.textContent = I, U.append(V);
                }
                this.container.append(U);
              }
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
            }
          }
          e.FreeTextAnnotationElement = L;
          class b extends S {
            constructor(I) {
              super(I, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              le(this, Ue, null);
            }
            render() {
              this.container.classList.add("lineAnnotation");
              const I = this.data, {
                width: V,
                height: fe
              } = x(I.rect), ge = this.svgFactory.create(V, fe, !0), ve = he(this, Ue, this.svgFactory.createElement("svg:line"));
              return ve.setAttribute("x1", I.rect[2] - I.lineCoordinates[0]), ve.setAttribute("y1", I.rect[3] - I.lineCoordinates[1]), ve.setAttribute("x2", I.rect[2] - I.lineCoordinates[2]), ve.setAttribute("y2", I.rect[3] - I.lineCoordinates[3]), ve.setAttribute("stroke-width", I.borderStyle.width || 1), ve.setAttribute("stroke", "transparent"), ve.setAttribute("fill", "transparent"), ge.append(ve), this.container.append(ge), !I.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return c(this, Ue);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Ue = new WeakMap();
          class P extends S {
            constructor(I) {
              super(I, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              le(this, Ye, null);
            }
            render() {
              this.container.classList.add("squareAnnotation");
              const I = this.data, {
                width: V,
                height: fe
              } = x(I.rect), ge = this.svgFactory.create(V, fe, !0), ve = I.borderStyle.width, Se = he(this, Ye, this.svgFactory.createElement("svg:rect"));
              return Se.setAttribute("x", ve / 2), Se.setAttribute("y", ve / 2), Se.setAttribute("width", V - ve), Se.setAttribute("height", fe - ve), Se.setAttribute("stroke-width", ve || 1), Se.setAttribute("stroke", "transparent"), Se.setAttribute("fill", "transparent"), ge.append(Se), this.container.append(ge), !I.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return c(this, Ye);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Ye = new WeakMap();
          class j extends S {
            constructor(I) {
              super(I, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              le(this, Je, null);
            }
            render() {
              this.container.classList.add("circleAnnotation");
              const I = this.data, {
                width: V,
                height: fe
              } = x(I.rect), ge = this.svgFactory.create(V, fe, !0), ve = I.borderStyle.width, Se = he(this, Je, this.svgFactory.createElement("svg:ellipse"));
              return Se.setAttribute("cx", V / 2), Se.setAttribute("cy", fe / 2), Se.setAttribute("rx", V / 2 - ve / 2), Se.setAttribute("ry", fe / 2 - ve / 2), Se.setAttribute("stroke-width", ve || 1), Se.setAttribute("stroke", "transparent"), Se.setAttribute("fill", "transparent"), ge.append(Se), this.container.append(ge), !I.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return c(this, Je);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Je = new WeakMap();
          class re extends S {
            constructor(I) {
              super(I, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              le(this, ye, null);
              this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const I = this.data, {
                width: V,
                height: fe
              } = x(I.rect), ge = this.svgFactory.create(V, fe, !0);
              let ve = [];
              for (const Le of I.vertices) {
                const Ie = Le.x - I.rect[0], Ce = I.rect[3] - Le.y;
                ve.push(Ie + "," + Ce);
              }
              ve = ve.join(" ");
              const Se = he(this, ye, this.svgFactory.createElement(this.svgElementName));
              return Se.setAttribute("points", ve), Se.setAttribute("stroke-width", I.borderStyle.width || 1), Se.setAttribute("stroke", "transparent"), Se.setAttribute("fill", "transparent"), ge.append(Se), this.container.append(ge), !I.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return c(this, ye);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          ye = new WeakMap();
          class X extends re {
            constructor(U) {
              super(U), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
            }
          }
          class Q extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          class q extends S {
            constructor(I) {
              super(I, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              le(this, oe, []);
              this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = t.AnnotationEditorType.INK;
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const I = this.data, {
                width: V,
                height: fe
              } = x(I.rect), ge = this.svgFactory.create(V, fe, !0);
              for (const ve of I.inkLists) {
                let Se = [];
                for (const Ie of ve) {
                  const Ce = Ie.x - I.rect[0], Ge = I.rect[3] - Ie.y;
                  Se.push(`${Ce},${Ge}`);
                }
                Se = Se.join(" ");
                const Le = this.svgFactory.createElement(this.svgElementName);
                c(this, oe).push(Le), Le.setAttribute("points", Se), Le.setAttribute("stroke-width", I.borderStyle.width || 1), Le.setAttribute("stroke", "transparent"), Le.setAttribute("fill", "transparent"), !I.popupRef && this.hasPopupData && this._createPopup(), ge.append(Le);
              }
              return this.container.append(ge), this.container;
            }
            getElementsToTriggerPopup() {
              return c(this, oe);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          oe = new WeakMap(), e.InkAnnotationElement = q;
          class ie extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this.container;
            }
          }
          class O extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
            }
          }
          class G extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
            }
          }
          class K extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
            }
          }
          class M extends S {
            constructor(U) {
              super(U, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("stampAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          e.StampAnnotationElement = M;
          class _ extends S {
            constructor(I) {
              var ge;
              super(I, {
                isRenderable: !0
              });
              le(this, Pe);
              le(this, ue, null);
              const {
                filename: V,
                content: fe
              } = this.data.file;
              this.filename = (0, i.getFilenameFromUrl)(V, !0), this.content = fe, (ge = this.linkService.eventBus) == null || ge.dispatch("fileattachmentannotation", {
                source: this,
                filename: V,
                content: fe
              });
            }
            render() {
              this.container.classList.add("fileAttachmentAnnotation");
              const {
                container: I,
                data: V
              } = this;
              let fe;
              V.hasAppearance || V.fillAlpha === 0 ? fe = document.createElement("div") : (fe = document.createElement("img"), fe.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(V.name) ? "paperclip" : "pushpin"}.svg`, V.fillAlpha && V.fillAlpha < 1 && (fe.style = `filter: opacity(${Math.round(V.fillAlpha * 100)}%);`)), fe.addEventListener("dblclick", Z(this, Pe, fn).bind(this)), he(this, ue, fe);
              const {
                isMac: ge
              } = t.FeatureTest.platform;
              return I.addEventListener("keydown", (ve) => {
                ve.key === "Enter" && (ge ? ve.metaKey : ve.ctrlKey) && Z(this, Pe, fn).call(this);
              }), !V.popupRef && this.hasPopupData ? this._createPopup() : fe.classList.add("popupTriggerArea"), I.append(fe), I;
            }
            getElementsToTriggerPopup() {
              return c(this, ue);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          ue = new WeakMap(), Pe = new WeakSet(), fn = function() {
            var I;
            (I = this.downloadManager) == null || I.openOrDownloadData(this.container, this.content, this.filename);
          };
          class A {
            constructor({
              div: U,
              accessibilityManager: I,
              annotationCanvasMap: V,
              l10n: fe,
              page: ge,
              viewport: ve
            }) {
              le(this, De);
              le(this, Ke, null);
              le(this, W, null);
              le(this, pe, /* @__PURE__ */ new Map());
              this.div = U, he(this, Ke, I), he(this, W, V), this.l10n = fe, this.page = ge, this.viewport = ve, this.zIndex = 0, this.l10n || (this.l10n = h.NullL10n);
            }
            async render(U) {
              const {
                annotations: I
              } = U, V = this.div;
              (0, i.setLayerDimensions)(V, this.viewport);
              const fe = /* @__PURE__ */ new Map(), ge = {
                data: null,
                layer: V,
                linkService: U.linkService,
                downloadManager: U.downloadManager,
                imageResourcesPath: U.imageResourcesPath || "",
                renderForms: U.renderForms !== !1,
                svgFactory: new i.DOMSVGFactory(),
                annotationStorage: U.annotationStorage || new a.AnnotationStorage(),
                enableScripting: U.enableScripting === !0,
                hasJSActions: U.hasJSActions,
                fieldObjects: U.fieldObjects,
                parent: this,
                elements: null
              };
              for (const ve of I) {
                if (ve.noHTML)
                  continue;
                const Se = ve.annotationType === t.AnnotationType.POPUP;
                if (Se) {
                  const Ce = fe.get(ve.id);
                  if (!Ce)
                    continue;
                  ge.elements = Ce;
                } else {
                  const {
                    width: Ce,
                    height: Ge
                  } = x(ve.rect);
                  if (Ce <= 0 || Ge <= 0)
                    continue;
                }
                ge.data = ve;
                const Le = C.create(ge);
                if (!Le.isRenderable)
                  continue;
                if (!Se && ve.popupRef) {
                  const Ce = fe.get(ve.popupRef);
                  Ce ? Ce.push(Le) : fe.set(ve.popupRef, [Le]);
                }
                Le.annotationEditorType > 0 && c(this, pe).set(Le.data.id, Le);
                const Ie = Le.render();
                ve.hidden && (Ie.style.visibility = "hidden"), Z(this, De, Wn).call(this, Ie, ve.id);
              }
              Z(this, De, pn).call(this), await this.l10n.translate(V);
            }
            update({
              viewport: U
            }) {
              const I = this.div;
              this.viewport = U, (0, i.setLayerDimensions)(I, {
                rotation: U.rotation
              }), Z(this, De, pn).call(this), I.hidden = !1;
            }
            getEditableAnnotations() {
              return Array.from(c(this, pe).values());
            }
            getEditableAnnotation(U) {
              return c(this, pe).get(U);
            }
          }
          Ke = new WeakMap(), W = new WeakMap(), pe = new WeakMap(), De = new WeakSet(), Wn = function(U, I) {
            var fe;
            const V = U.firstChild || U;
            V.id = `${t.AnnotationPrefix}${I}`, this.div.append(U), (fe = c(this, Ke)) == null || fe.moveElementInDOM(this.div, U, V, !1);
          }, pn = function() {
            if (!c(this, W))
              return;
            const U = this.div;
            for (const [I, V] of c(this, W)) {
              const fe = U.querySelector(`[data-annotation-id="${I}"]`);
              if (!fe)
                continue;
              const {
                firstChild: ge
              } = fe;
              ge ? ge.nodeName === "CANVAS" ? ge.replaceWith(V) : ge.before(V) : fe.append(V);
            }
            c(this, W).clear();
          }, e.AnnotationLayer = A;
        },
        /* 30 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.ColorConverters = void 0;
          function n(a) {
            return Math.floor(Math.max(0, Math.min(1, a)) * 255).toString(16).padStart(2, "0");
          }
          function t(a) {
            return Math.max(0, Math.min(255, 255 * a));
          }
          class i {
            static CMYK_G([s, h, u, l]) {
              return ["G", 1 - Math.min(1, 0.3 * s + 0.59 * u + 0.11 * h + l)];
            }
            static G_CMYK([s]) {
              return ["CMYK", 0, 0, 0, 1 - s];
            }
            static G_RGB([s]) {
              return ["RGB", s, s, s];
            }
            static G_rgb([s]) {
              return s = t(s), [s, s, s];
            }
            static G_HTML([s]) {
              const h = n(s);
              return `#${h}${h}${h}`;
            }
            static RGB_G([s, h, u]) {
              return ["G", 0.3 * s + 0.59 * h + 0.11 * u];
            }
            static RGB_rgb(s) {
              return s.map(t);
            }
            static RGB_HTML(s) {
              return `#${s.map(n).join("")}`;
            }
            static T_HTML() {
              return "#00000000";
            }
            static T_rgb() {
              return [null];
            }
            static CMYK_RGB([s, h, u, l]) {
              return ["RGB", 1 - Math.min(1, s + l), 1 - Math.min(1, u + l), 1 - Math.min(1, h + l)];
            }
            static CMYK_rgb([s, h, u, l]) {
              return [t(1 - Math.min(1, s + l)), t(1 - Math.min(1, u + l)), t(1 - Math.min(1, h + l))];
            }
            static CMYK_HTML(s) {
              const h = this.CMYK_RGB(s).slice(1);
              return this.RGB_HTML(h);
            }
            static RGB_CMYK([s, h, u]) {
              const l = 1 - s, o = 1 - h, w = 1 - u, x = Math.min(l, o, w);
              return ["CMYK", l, o, w, x];
            }
          }
          e.ColorConverters = i;
        },
        /* 31 */
        /***/
        (r, e) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.NullL10n = void 0, e.getL10nFallback = t;
          const n = {
            of_pages: "of {{pagesCount}}",
            page_of_pages: "({{pageNumber}} of {{pagesCount}})",
            document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
            document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
            document_properties_date_string: "{{date}}, {{time}}",
            document_properties_page_size_unit_inches: "in",
            document_properties_page_size_unit_millimeters: "mm",
            document_properties_page_size_orientation_portrait: "portrait",
            document_properties_page_size_orientation_landscape: "landscape",
            document_properties_page_size_name_a3: "A3",
            document_properties_page_size_name_a4: "A4",
            document_properties_page_size_name_letter: "Letter",
            document_properties_page_size_name_legal: "Legal",
            document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
            document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
            document_properties_linearized_yes: "Yes",
            document_properties_linearized_no: "No",
            additional_layers: "Additional Layers",
            page_landmark: "Page {{page}}",
            thumb_page_title: "Page {{page}}",
            thumb_page_canvas: "Thumbnail of Page {{page}}",
            find_reached_top: "Reached top of document, continued from bottom",
            find_reached_bottom: "Reached end of document, continued from top",
            "find_match_count[one]": "{{current}} of {{total}} match",
            "find_match_count[other]": "{{current}} of {{total}} matches",
            "find_match_count_limit[one]": "More than {{limit}} match",
            "find_match_count_limit[other]": "More than {{limit}} matches",
            find_not_found: "Phrase not found",
            page_scale_width: "Page Width",
            page_scale_fit: "Page Fit",
            page_scale_auto: "Automatic Zoom",
            page_scale_actual: "Actual Size",
            page_scale_percent: "{{scale}}%",
            loading_error: "An error occurred while loading the PDF.",
            invalid_file_error: "Invalid or corrupted PDF file.",
            missing_file_error: "Missing PDF file.",
            unexpected_response_error: "Unexpected server response.",
            rendering_error: "An error occurred while rendering the page.",
            annotation_date_string: "{{date}}, {{time}}",
            printing_not_supported: "Warning: Printing is not fully supported by this browser.",
            printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
            web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.",
            free_text2_default_content: "Start typing…",
            editor_free_text2_aria_label: "Text Editor",
            editor_ink2_aria_label: "Draw Editor",
            editor_ink_canvas_aria_label: "User-created image",
            editor_alt_text_button_label: "Alt text",
            editor_alt_text_edit_button_label: "Edit alt text",
            editor_alt_text_decorative_tooltip: "Marked as decorative"
          };
          n.print_progress_percent = "{{progress}}%";
          function t(s, h) {
            switch (s) {
              case "find_match_count":
                s = `find_match_count[${h.total === 1 ? "one" : "other"}]`;
                break;
              case "find_match_count_limit":
                s = `find_match_count_limit[${h.limit === 1 ? "one" : "other"}]`;
                break;
            }
            return n[s] || "";
          }
          function i(s, h) {
            return h ? s.replaceAll(/\{\{\s*(\w+)\s*\}\}/g, (u, l) => l in h ? h[l] : "{{" + l + "}}") : s;
          }
          const a = {
            async getLanguage() {
              return "en-us";
            },
            async getDirection() {
              return "ltr";
            },
            async get(s, h = null, u = t(s, h)) {
              return i(u, h);
            },
            async translate(s) {
            }
          };
          e.NullL10n = a;
        },
        /* 32 */
        /***/
        (r, e, n) => {
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.XfaLayer = void 0;
          var t = n(25);
          class i {
            static setupStorage(s, h, u, l, o) {
              const w = l.getValue(h, {
                value: null
              });
              switch (u.name) {
                case "textarea":
                  if (w.value !== null && (s.textContent = w.value), o === "print")
                    break;
                  s.addEventListener("input", (x) => {
                    l.setValue(h, {
                      value: x.target.value
                    });
                  });
                  break;
                case "input":
                  if (u.attributes.type === "radio" || u.attributes.type === "checkbox") {
                    if (w.value === u.attributes.xfaOn ? s.setAttribute("checked", !0) : w.value === u.attributes.xfaOff && s.removeAttribute("checked"), o === "print")
                      break;
                    s.addEventListener("change", (x) => {
                      l.setValue(h, {
                        value: x.target.checked ? x.target.getAttribute("xfaOn") : x.target.getAttribute("xfaOff")
                      });
                    });
                  } else {
                    if (w.value !== null && s.setAttribute("value", w.value), o === "print")
                      break;
                    s.addEventListener("input", (x) => {
                      l.setValue(h, {
                        value: x.target.value
                      });
                    });
                  }
                  break;
                case "select":
                  if (w.value !== null) {
                    s.setAttribute("value", w.value);
                    for (const x of u.children)
                      x.attributes.value === w.value ? x.attributes.selected = !0 : x.attributes.hasOwnProperty("selected") && delete x.attributes.selected;
                  }
                  s.addEventListener("input", (x) => {
                    const C = x.target.options, S = C.selectedIndex === -1 ? "" : C[C.selectedIndex].value;
                    l.setValue(h, {
                      value: S
                    });
                  });
                  break;
              }
            }
            static setAttributes({
              html: s,
              element: h,
              storage: u = null,
              intent: l,
              linkService: o
            }) {
              const {
                attributes: w
              } = h, x = s instanceof HTMLAnchorElement;
              w.type === "radio" && (w.name = `${w.name}-${l}`);
              for (const [C, S] of Object.entries(w))
                if (S != null)
                  switch (C) {
                    case "class":
                      S.length && s.setAttribute(C, S.join(" "));
                      break;
                    case "dataId":
                      break;
                    case "id":
                      s.setAttribute("data-element-id", S);
                      break;
                    case "style":
                      Object.assign(s.style, S);
                      break;
                    case "textContent":
                      s.textContent = S;
                      break;
                    default:
                      (!x || C !== "href" && C !== "newWindow") && s.setAttribute(C, S);
                  }
              x && o.addLinkAttributes(s, w.href, w.newWindow), u && w.dataId && this.setupStorage(s, w.dataId, h, u);
            }
            static render(s) {
              var T;
              const h = s.annotationStorage, u = s.linkService, l = s.xfaHtml, o = s.intent || "display", w = document.createElement(l.name);
              l.attributes && this.setAttributes({
                html: w,
                element: l,
                intent: o,
                linkService: u
              });
              const x = [[l, -1, w]], C = s.div;
              if (C.append(w), s.viewport) {
                const D = `matrix(${s.viewport.transform.join(",")})`;
                C.style.transform = D;
              }
              o !== "richText" && C.setAttribute("class", "xfaLayer xfaFont");
              const S = [];
              for (; x.length > 0; ) {
                const [D, F, f] = x.at(-1);
                if (F + 1 === D.children.length) {
                  x.pop();
                  continue;
                }
                const E = D.children[++x.at(-1)[1]];
                if (E === null)
                  continue;
                const {
                  name: v
                } = E;
                if (v === "#text") {
                  const d = document.createTextNode(E.value);
                  S.push(d), f.append(d);
                  continue;
                }
                const p = (T = E == null ? void 0 : E.attributes) != null && T.xmlns ? document.createElementNS(E.attributes.xmlns, v) : document.createElement(v);
                if (f.append(p), E.attributes && this.setAttributes({
                  html: p,
                  element: E,
                  storage: h,
                  intent: o,
                  linkService: u
                }), E.children && E.children.length > 0)
                  x.push([E, -1, p]);
                else if (E.value) {
                  const d = document.createTextNode(E.value);
                  t.XfaText.shouldBuildText(v) && S.push(d), p.append(d);
                }
              }
              for (const D of C.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
                D.setAttribute("readOnly", !0);
              return {
                textDivs: S
              };
            }
            static update(s) {
              const h = `matrix(${s.viewport.transform.join(",")})`;
              s.div.style.transform = h, s.div.hidden = !1;
            }
          }
          e.XfaLayer = i;
        },
        /* 33 */
        /***/
        (r, e, n) => {
          var l, o, w, x, C, S, T, D, F, f, E, v, p, d, g, Gn, qn, Xn, Vn, gn, Yn, mn, Kn, Zn, Jn, Qn, ei, ct, _n, Lt, It, gt, bn, Ot, $, ti, An, ni, ii, yn, Nt, mt;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.InkEditor = void 0;
          var t = n(1), i = n(4), a = n(29), s = n(6), h = n(5);
          const _e = class _e extends i.AnnotationEditor {
            constructor(R) {
              super({
                ...R,
                name: "inkEditor"
              });
              le(this, g);
              le(this, l, 0);
              le(this, o, 0);
              le(this, w, this.canvasPointermove.bind(this));
              le(this, x, this.canvasPointerleave.bind(this));
              le(this, C, this.canvasPointerup.bind(this));
              le(this, S, this.canvasPointerdown.bind(this));
              le(this, T, new Path2D());
              le(this, D, !1);
              le(this, F, !1);
              le(this, f, !1);
              le(this, E, null);
              le(this, v, 0);
              le(this, p, 0);
              le(this, d, null);
              this.color = R.color || null, this.thickness = R.thickness || null, this.opacity = R.opacity || null, this.paths = [], this.bezierPath2D = [], this.allRawPaths = [], this.currentPath = [], this.scaleFactor = 1, this.translationX = this.translationY = 0, this.x = 0, this.y = 0, this._willKeepAspectRatio = !0;
            }
            static initialize(R) {
              i.AnnotationEditor.initialize(R, {
                strings: ["editor_ink_canvas_aria_label", "editor_ink2_aria_label"]
              });
            }
            static updateDefaultParams(R, H) {
              switch (R) {
                case t.AnnotationEditorParamsType.INK_THICKNESS:
                  _e._defaultThickness = H;
                  break;
                case t.AnnotationEditorParamsType.INK_COLOR:
                  _e._defaultColor = H;
                  break;
                case t.AnnotationEditorParamsType.INK_OPACITY:
                  _e._defaultOpacity = H / 100;
                  break;
              }
            }
            updateParams(R, H) {
              switch (R) {
                case t.AnnotationEditorParamsType.INK_THICKNESS:
                  Z(this, g, Gn).call(this, H);
                  break;
                case t.AnnotationEditorParamsType.INK_COLOR:
                  Z(this, g, qn).call(this, H);
                  break;
                case t.AnnotationEditorParamsType.INK_OPACITY:
                  Z(this, g, Xn).call(this, H);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[t.AnnotationEditorParamsType.INK_THICKNESS, _e._defaultThickness], [t.AnnotationEditorParamsType.INK_COLOR, _e._defaultColor || i.AnnotationEditor._defaultLineColor], [t.AnnotationEditorParamsType.INK_OPACITY, Math.round(_e._defaultOpacity * 100)]];
            }
            get propertiesToUpdate() {
              return [[t.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || _e._defaultThickness], [t.AnnotationEditorParamsType.INK_COLOR, this.color || _e._defaultColor || i.AnnotationEditor._defaultLineColor], [t.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? _e._defaultOpacity))]];
            }
            rebuild() {
              this.parent && (super.rebuild(), this.div !== null && (this.canvas || (Z(this, g, Lt).call(this), Z(this, g, It).call(this)), this.isAttachedToDOM || (this.parent.add(this), Z(this, g, gt).call(this)), Z(this, g, mt).call(this)));
            }
            remove() {
              this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, c(this, E).disconnect(), he(this, E, null), super.remove());
            }
            setParent(R) {
              !this.parent && R ? this._uiManager.removeShouldRescale(this) : this.parent && R === null && this._uiManager.addShouldRescale(this), super.setParent(R);
            }
            onScaleChanging() {
              const [R, H] = this.parentDimensions, J = this.width * R, ae = this.height * H;
              this.setDimensions(J, ae);
            }
            enableEditMode() {
              c(this, D) || this.canvas === null || (super.enableEditMode(), this._isDraggable = !1, this.canvas.addEventListener("pointerdown", c(this, S)));
            }
            disableEditMode() {
              !this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this._isDraggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown", c(this, S)));
            }
            onceAdded() {
              this._isDraggable = !this.isEmpty();
            }
            isEmpty() {
              return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
            }
            commit() {
              c(this, D) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), he(this, D, !0), this.div.classList.add("disabled"), Z(this, g, mt).call(this, !0), this.makeResizable(), this.parent.addInkEditorIfNeeded(!0), this.moveInDOM(), this.div.focus({
                preventScroll: !0
              }));
            }
            focusin(R) {
              this._focusEventsAllowed && (super.focusin(R), this.enableEditMode());
            }
            canvasPointerdown(R) {
              R.button !== 0 || !this.isInEditMode() || c(this, D) || (this.setInForeground(), R.preventDefault(), R.type !== "mouse" && this.div.focus(), Z(this, g, Yn).call(this, R.offsetX, R.offsetY));
            }
            canvasPointermove(R) {
              R.preventDefault(), Z(this, g, mn).call(this, R.offsetX, R.offsetY);
            }
            canvasPointerup(R) {
              R.preventDefault(), Z(this, g, _n).call(this, R);
            }
            canvasPointerleave(R) {
              Z(this, g, _n).call(this, R);
            }
            get isResizable() {
              return !this.isEmpty() && c(this, D);
            }
            render() {
              if (this.div)
                return this.div;
              let R, H;
              this.width && (R = this.x, H = this.y), super.render(), i.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((Ee) => {
                var ee;
                return (ee = this.div) == null ? void 0 : ee.setAttribute("aria-label", Ee);
              });
              const [J, ae, be, we] = Z(this, g, Vn).call(this);
              if (this.setAt(J, ae, 0, 0), this.setDims(be, we), Z(this, g, Lt).call(this), this.width) {
                const [Ee, ee] = this.parentDimensions;
                this.setAspectRatio(this.width * Ee, this.height * ee), this.setAt(R * Ee, H * ee, this.width * Ee, this.height * ee), he(this, f, !0), Z(this, g, gt).call(this), this.setDims(this.width * Ee, this.height * ee), Z(this, g, ct).call(this), this.div.classList.add("disabled");
              } else
                this.div.classList.add("editing"), this.enableEditMode();
              return Z(this, g, It).call(this), this.div;
            }
            setDimensions(R, H) {
              const J = Math.round(R), ae = Math.round(H);
              if (c(this, v) === J && c(this, p) === ae)
                return;
              he(this, v, J), he(this, p, ae), this.canvas.style.visibility = "hidden";
              const [be, we] = this.parentDimensions;
              this.width = R / be, this.height = H / we, this.fixAndSetPosition(), c(this, D) && Z(this, g, bn).call(this, R, H), Z(this, g, gt).call(this), Z(this, g, ct).call(this), this.canvas.style.visibility = "visible", this.fixDims();
            }
            static deserialize(R, H, J) {
              var Ue, Ye, Je;
              if (R instanceof a.InkAnnotationElement)
                return null;
              const ae = super.deserialize(R, H, J);
              ae.thickness = R.thickness, ae.color = t.Util.makeHexColor(...R.color), ae.opacity = R.opacity;
              const [be, we] = ae.pageDimensions, Ee = ae.width * be, ee = ae.height * we, Fe = ae.parentScale, ke = R.thickness / 2;
              he(ae, D, !0), he(ae, v, Math.round(Ee)), he(ae, p, Math.round(ee));
              const {
                paths: We,
                rect: He,
                rotation: Ze
              } = R;
              for (let {
                bezier: ye
              } of We) {
                ye = Z(Ue = _e, $, ni).call(Ue, ye, He, Ze);
                const oe = [];
                ae.paths.push(oe);
                let ue = Fe * (ye[0] - ke), Pe = Fe * (ye[1] - ke);
                for (let Ke = 2, W = ye.length; Ke < W; Ke += 6) {
                  const pe = Fe * (ye[Ke] - ke), De = Fe * (ye[Ke + 1] - ke), $e = Fe * (ye[Ke + 2] - ke), Be = Fe * (ye[Ke + 3] - ke), xe = Fe * (ye[Ke + 4] - ke), U = Fe * (ye[Ke + 5] - ke);
                  oe.push([[ue, Pe], [pe, De], [$e, Be], [xe, U]]), ue = xe, Pe = U;
                }
                const Xe = Z(this, $, ti).call(this, oe);
                ae.bezierPath2D.push(Xe);
              }
              const Me = Z(Ye = ae, g, yn).call(Ye);
              return he(ae, o, Math.max(i.AnnotationEditor.MIN_SIZE, Me[2] - Me[0])), he(ae, l, Math.max(i.AnnotationEditor.MIN_SIZE, Me[3] - Me[1])), Z(Je = ae, g, bn).call(Je, Ee, ee), ae;
            }
            serialize() {
              if (this.isEmpty())
                return null;
              const R = this.getRect(0, 0), H = i.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
              return {
                annotationType: t.AnnotationEditorType.INK,
                color: H,
                thickness: this.thickness,
                opacity: this.opacity,
                paths: Z(this, g, ii).call(this, this.scaleFactor / this.parentScale, this.translationX, this.translationY, R),
                pageIndex: this.pageIndex,
                rect: R,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
            }
          };
          l = new WeakMap(), o = new WeakMap(), w = new WeakMap(), x = new WeakMap(), C = new WeakMap(), S = new WeakMap(), T = new WeakMap(), D = new WeakMap(), F = new WeakMap(), f = new WeakMap(), E = new WeakMap(), v = new WeakMap(), p = new WeakMap(), d = new WeakMap(), g = new WeakSet(), Gn = function(R) {
            const H = this.thickness;
            this.addCommands({
              cmd: () => {
                this.thickness = R, Z(this, g, mt).call(this);
              },
              undo: () => {
                this.thickness = H, Z(this, g, mt).call(this);
              },
              mustExec: !0,
              type: t.AnnotationEditorParamsType.INK_THICKNESS,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, qn = function(R) {
            const H = this.color;
            this.addCommands({
              cmd: () => {
                this.color = R, Z(this, g, ct).call(this);
              },
              undo: () => {
                this.color = H, Z(this, g, ct).call(this);
              },
              mustExec: !0,
              type: t.AnnotationEditorParamsType.INK_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Xn = function(R) {
            R /= 100;
            const H = this.opacity;
            this.addCommands({
              cmd: () => {
                this.opacity = R, Z(this, g, ct).call(this);
              },
              undo: () => {
                this.opacity = H, Z(this, g, ct).call(this);
              },
              mustExec: !0,
              type: t.AnnotationEditorParamsType.INK_OPACITY,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Vn = function() {
            const {
              parentRotation: R,
              parentDimensions: [H, J]
            } = this;
            switch (R) {
              case 90:
                return [0, J, J, H];
              case 180:
                return [H, J, H, J];
              case 270:
                return [H, 0, J, H];
              default:
                return [0, 0, H, J];
            }
          }, gn = function() {
            const {
              ctx: R,
              color: H,
              opacity: J,
              thickness: ae,
              parentScale: be,
              scaleFactor: we
            } = this;
            R.lineWidth = ae * be / we, R.lineCap = "round", R.lineJoin = "round", R.miterLimit = 10, R.strokeStyle = `${H}${(0, h.opacityToHex)(J)}`;
          }, Yn = function(R, H) {
            this.canvas.addEventListener("contextmenu", s.noContextMenu), this.canvas.addEventListener("pointerleave", c(this, x)), this.canvas.addEventListener("pointermove", c(this, w)), this.canvas.addEventListener("pointerup", c(this, C)), this.canvas.removeEventListener("pointerdown", c(this, S)), this.isEditing = !0, c(this, f) || (he(this, f, !0), Z(this, g, gt).call(this), this.thickness || (this.thickness = _e._defaultThickness), this.color || (this.color = _e._defaultColor || i.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = _e._defaultOpacity)), this.currentPath.push([R, H]), he(this, F, !1), Z(this, g, gn).call(this), he(this, d, () => {
              Z(this, g, Jn).call(this), c(this, d) && window.requestAnimationFrame(c(this, d));
            }), window.requestAnimationFrame(c(this, d));
          }, mn = function(R, H) {
            const [J, ae] = this.currentPath.at(-1);
            if (this.currentPath.length > 1 && R === J && H === ae)
              return;
            const be = this.currentPath;
            let we = c(this, T);
            if (be.push([R, H]), he(this, F, !0), be.length <= 2) {
              we.moveTo(...be[0]), we.lineTo(R, H);
              return;
            }
            be.length === 3 && (he(this, T, we = new Path2D()), we.moveTo(...be[0])), Z(this, g, Qn).call(this, we, ...be.at(-3), ...be.at(-2), R, H);
          }, Kn = function() {
            if (this.currentPath.length === 0)
              return;
            const R = this.currentPath.at(-1);
            c(this, T).lineTo(...R);
          }, Zn = function(R, H) {
            he(this, d, null), R = Math.min(Math.max(R, 0), this.canvas.width), H = Math.min(Math.max(H, 0), this.canvas.height), Z(this, g, mn).call(this, R, H), Z(this, g, Kn).call(this);
            let J;
            if (this.currentPath.length !== 1)
              J = Z(this, g, ei).call(this);
            else {
              const ee = [R, H];
              J = [[ee, ee.slice(), ee.slice(), ee]];
            }
            const ae = c(this, T), be = this.currentPath;
            this.currentPath = [], he(this, T, new Path2D());
            const we = () => {
              this.allRawPaths.push(be), this.paths.push(J), this.bezierPath2D.push(ae), this.rebuild();
            }, Ee = () => {
              this.allRawPaths.pop(), this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (Z(this, g, Lt).call(this), Z(this, g, It).call(this)), Z(this, g, mt).call(this));
            };
            this.addCommands({
              cmd: we,
              undo: Ee,
              mustExec: !0
            });
          }, Jn = function() {
            if (!c(this, F))
              return;
            he(this, F, !1);
            const R = Math.ceil(this.thickness * this.parentScale), H = this.currentPath.slice(-3), J = H.map((we) => we[0]), ae = H.map((we) => we[1]);
            Math.min(...J) - R, Math.max(...J) + R, Math.min(...ae) - R, Math.max(...ae) + R;
            const {
              ctx: be
            } = this;
            be.save(), be.clearRect(0, 0, this.canvas.width, this.canvas.height);
            for (const we of this.bezierPath2D)
              be.stroke(we);
            be.stroke(c(this, T)), be.restore();
          }, Qn = function(R, H, J, ae, be, we, Ee) {
            const ee = (H + ae) / 2, Fe = (J + be) / 2, ke = (ae + we) / 2, We = (be + Ee) / 2;
            R.bezierCurveTo(ee + 2 * (ae - ee) / 3, Fe + 2 * (be - Fe) / 3, ke + 2 * (ae - ke) / 3, We + 2 * (be - We) / 3, ke, We);
          }, ei = function() {
            const R = this.currentPath;
            if (R.length <= 2)
              return [[R[0], R[0], R.at(-1), R.at(-1)]];
            const H = [];
            let J, [ae, be] = R[0];
            for (J = 1; J < R.length - 2; J++) {
              const [He, Ze] = R[J], [Me, Ue] = R[J + 1], Ye = (He + Me) / 2, Je = (Ze + Ue) / 2, ye = [ae + 2 * (He - ae) / 3, be + 2 * (Ze - be) / 3], oe = [Ye + 2 * (He - Ye) / 3, Je + 2 * (Ze - Je) / 3];
              H.push([[ae, be], ye, oe, [Ye, Je]]), [ae, be] = [Ye, Je];
            }
            const [we, Ee] = R[J], [ee, Fe] = R[J + 1], ke = [ae + 2 * (we - ae) / 3, be + 2 * (Ee - be) / 3], We = [ee + 2 * (we - ee) / 3, Fe + 2 * (Ee - Fe) / 3];
            return H.push([[ae, be], ke, We, [ee, Fe]]), H;
          }, ct = function() {
            if (this.isEmpty()) {
              Z(this, g, Ot).call(this);
              return;
            }
            Z(this, g, gn).call(this);
            const {
              canvas: R,
              ctx: H
            } = this;
            H.setTransform(1, 0, 0, 1, 0, 0), H.clearRect(0, 0, R.width, R.height), Z(this, g, Ot).call(this);
            for (const J of this.bezierPath2D)
              H.stroke(J);
          }, _n = function(R) {
            this.canvas.removeEventListener("pointerleave", c(this, x)), this.canvas.removeEventListener("pointermove", c(this, w)), this.canvas.removeEventListener("pointerup", c(this, C)), this.canvas.addEventListener("pointerdown", c(this, S)), setTimeout(() => {
              this.canvas.removeEventListener("contextmenu", s.noContextMenu);
            }, 10), Z(this, g, Zn).call(this, R.offsetX, R.offsetY), this.addToAnnotationStorage(), this.setInBackground();
          }, Lt = function() {
            this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = 0, this.canvas.className = "inkEditorCanvas", i.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((R) => {
              var H;
              return (H = this.canvas) == null ? void 0 : H.setAttribute("aria-label", R);
            }), this.div.append(this.canvas), this.ctx = this.canvas.getContext("2d");
          }, It = function() {
            he(this, E, new ResizeObserver((R) => {
              const H = R[0].contentRect;
              H.width && H.height && this.setDimensions(H.width, H.height);
            })), c(this, E).observe(this.div);
          }, gt = function() {
            if (!c(this, f))
              return;
            const [R, H] = this.parentDimensions;
            this.canvas.width = Math.ceil(this.width * R), this.canvas.height = Math.ceil(this.height * H), Z(this, g, Ot).call(this);
          }, bn = function(R, H) {
            const J = Z(this, g, Nt).call(this), ae = (R - J) / c(this, o), be = (H - J) / c(this, l);
            this.scaleFactor = Math.min(ae, be);
          }, Ot = function() {
            const R = Z(this, g, Nt).call(this) / 2;
            this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + R, this.translationY * this.scaleFactor + R);
          }, $ = new WeakSet(), ti = function(R) {
            const H = new Path2D();
            for (let J = 0, ae = R.length; J < ae; J++) {
              const [be, we, Ee, ee] = R[J];
              J === 0 && H.moveTo(...be), H.bezierCurveTo(we[0], we[1], Ee[0], Ee[1], ee[0], ee[1]);
            }
            return H;
          }, An = function(R, H, J) {
            const [ae, be, we, Ee] = H;
            switch (J) {
              case 0:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2)
                  R[ee] += ae, R[ee + 1] = Ee - R[ee + 1];
                break;
              case 90:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2) {
                  const ke = R[ee];
                  R[ee] = R[ee + 1] + ae, R[ee + 1] = ke + be;
                }
                break;
              case 180:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2)
                  R[ee] = we - R[ee], R[ee + 1] += be;
                break;
              case 270:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2) {
                  const ke = R[ee];
                  R[ee] = we - R[ee + 1], R[ee + 1] = Ee - ke;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return R;
          }, ni = function(R, H, J) {
            const [ae, be, we, Ee] = H;
            switch (J) {
              case 0:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2)
                  R[ee] -= ae, R[ee + 1] = Ee - R[ee + 1];
                break;
              case 90:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2) {
                  const ke = R[ee];
                  R[ee] = R[ee + 1] - be, R[ee + 1] = ke - ae;
                }
                break;
              case 180:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2)
                  R[ee] = we - R[ee], R[ee + 1] -= be;
                break;
              case 270:
                for (let ee = 0, Fe = R.length; ee < Fe; ee += 2) {
                  const ke = R[ee];
                  R[ee] = Ee - R[ee + 1], R[ee + 1] = we - ke;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return R;
          }, ii = function(R, H, J, ae) {
            var Fe, ke;
            const be = [], we = this.thickness / 2, Ee = R * H + we, ee = R * J + we;
            for (const We of this.paths) {
              const He = [], Ze = [];
              for (let Me = 0, Ue = We.length; Me < Ue; Me++) {
                const [Ye, Je, ye, oe] = We[Me], ue = R * Ye[0] + Ee, Pe = R * Ye[1] + ee, Xe = R * Je[0] + Ee, Ke = R * Je[1] + ee, W = R * ye[0] + Ee, pe = R * ye[1] + ee, De = R * oe[0] + Ee, $e = R * oe[1] + ee;
                Me === 0 && (He.push(ue, Pe), Ze.push(ue, Pe)), He.push(Xe, Ke, W, pe, De, $e), Ze.push(Xe, Ke), Me === Ue - 1 && Ze.push(De, $e);
              }
              be.push({
                bezier: Z(Fe = _e, $, An).call(Fe, He, ae, this.rotation),
                points: Z(ke = _e, $, An).call(ke, Ze, ae, this.rotation)
              });
            }
            return be;
          }, yn = function() {
            let R = 1 / 0, H = -1 / 0, J = 1 / 0, ae = -1 / 0;
            for (const be of this.paths)
              for (const [we, Ee, ee, Fe] of be) {
                const ke = t.Util.bezierBoundingBox(...we, ...Ee, ...ee, ...Fe);
                R = Math.min(R, ke[0]), J = Math.min(J, ke[1]), H = Math.max(H, ke[2]), ae = Math.max(ae, ke[3]);
              }
            return [R, J, H, ae];
          }, Nt = function() {
            return c(this, D) ? Math.ceil(this.thickness * this.parentScale) : 0;
          }, mt = function(R = !1) {
            if (this.isEmpty())
              return;
            if (!c(this, D)) {
              Z(this, g, ct).call(this);
              return;
            }
            const H = Z(this, g, yn).call(this), J = Z(this, g, Nt).call(this);
            he(this, o, Math.max(i.AnnotationEditor.MIN_SIZE, H[2] - H[0])), he(this, l, Math.max(i.AnnotationEditor.MIN_SIZE, H[3] - H[1]));
            const ae = Math.ceil(J + c(this, o) * this.scaleFactor), be = Math.ceil(J + c(this, l) * this.scaleFactor), [we, Ee] = this.parentDimensions;
            this.width = ae / we, this.height = be / Ee, this.setAspectRatio(ae, be);
            const ee = this.translationX, Fe = this.translationY;
            this.translationX = -H[0], this.translationY = -H[1], Z(this, g, gt).call(this), Z(this, g, ct).call(this), he(this, v, ae), he(this, p, be), this.setDims(ae, be);
            const ke = R ? J / this.scaleFactor / 2 : 0;
            this.translate(ee - this.translationX - ke, Fe - this.translationY - ke);
          }, le(_e, $), qe(_e, "_defaultColor", null), qe(_e, "_defaultOpacity", 1), qe(_e, "_defaultThickness", 1), qe(_e, "_type", "ink");
          let u = _e;
          e.InkEditor = u;
        },
        /* 34 */
        /***/
        (r, e, n) => {
          var u, l, o, w, x, C, S, T, D, F, f, St, kt, $t, En, si, ri, vn, Bt, ai;
          Object.defineProperty(e, "__esModule", {
            value: !0
          }), e.StampEditor = void 0;
          var t = n(1), i = n(4), a = n(6), s = n(29);
          const P = class P extends i.AnnotationEditor {
            constructor(X) {
              super({
                ...X,
                name: "stampEditor"
              });
              le(this, f);
              le(this, u, null);
              le(this, l, null);
              le(this, o, null);
              le(this, w, null);
              le(this, x, null);
              le(this, C, null);
              le(this, S, null);
              le(this, T, null);
              le(this, D, !1);
              le(this, F, !1);
              he(this, w, X.bitmapUrl), he(this, x, X.bitmapFile);
            }
            static initialize(X) {
              i.AnnotationEditor.initialize(X);
            }
            static get supportedTypes() {
              const X = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
              return (0, t.shadow)(this, "supportedTypes", X.map((Q) => `image/${Q}`));
            }
            static get supportedTypesStr() {
              return (0, t.shadow)(this, "supportedTypesStr", this.supportedTypes.join(","));
            }
            static isHandlingMimeForPasting(X) {
              return this.supportedTypes.includes(X);
            }
            static paste(X, Q) {
              Q.pasteEditor(t.AnnotationEditorType.STAMP, {
                bitmapFile: X.getAsFile()
              });
            }
            remove() {
              var X, Q;
              c(this, l) && (he(this, u, null), this._uiManager.imageManager.deleteId(c(this, l)), (X = c(this, C)) == null || X.remove(), he(this, C, null), (Q = c(this, S)) == null || Q.disconnect(), he(this, S, null)), super.remove();
            }
            rebuild() {
              if (!this.parent) {
                c(this, l) && Z(this, f, $t).call(this);
                return;
              }
              super.rebuild(), this.div !== null && (c(this, l) && Z(this, f, $t).call(this), this.isAttachedToDOM || this.parent.add(this));
            }
            onceAdded() {
              this._isDraggable = !0, this.div.focus();
            }
            isEmpty() {
              return !(c(this, o) || c(this, u) || c(this, w) || c(this, x));
            }
            get isResizable() {
              return !0;
            }
            render() {
              if (this.div)
                return this.div;
              let X, Q;
              if (this.width && (X = this.x, Q = this.y), super.render(), this.div.hidden = !0, c(this, u) ? Z(this, f, En).call(this) : Z(this, f, $t).call(this), this.width) {
                const [q, ie] = this.parentDimensions;
                this.setAt(X * q, Q * ie, this.width * q, this.height * ie);
              }
              return this.div;
            }
            static deserialize(X, Q, q) {
              if (X instanceof s.StampAnnotationElement)
                return null;
              const ie = super.deserialize(X, Q, q), {
                rect: O,
                bitmapUrl: G,
                bitmapId: K,
                isSvg: M,
                accessibilityData: _
              } = X;
              K && q.imageManager.isValidId(K) ? he(ie, l, K) : he(ie, w, G), he(ie, D, M);
              const [A, k] = ie.pageDimensions;
              return ie.width = (O[2] - O[0]) / A, ie.height = (O[3] - O[1]) / k, _ && (ie.altTextData = _), ie;
            }
            serialize(X = !1, Q = null) {
              if (this.isEmpty())
                return null;
              const q = {
                annotationType: t.AnnotationEditorType.STAMP,
                bitmapId: c(this, l),
                pageIndex: this.pageIndex,
                rect: this.getRect(0, 0),
                rotation: this.rotation,
                isSvg: c(this, D),
                structTreeParentId: this._structTreeParentId
              };
              if (X)
                return q.bitmapUrl = Z(this, f, Bt).call(this, !0), q.accessibilityData = this.altTextData, q;
              const {
                decorative: ie,
                altText: O
              } = this.altTextData;
              if (!ie && O && (q.accessibilityData = {
                type: "Figure",
                alt: O
              }), Q === null)
                return q;
              Q.stamps || (Q.stamps = /* @__PURE__ */ new Map());
              const G = c(this, D) ? (q.rect[2] - q.rect[0]) * (q.rect[3] - q.rect[1]) : null;
              if (!Q.stamps.has(c(this, l)))
                Q.stamps.set(c(this, l), {
                  area: G,
                  serialized: q
                }), q.bitmap = Z(this, f, Bt).call(this, !1);
              else if (c(this, D)) {
                const K = Q.stamps.get(c(this, l));
                G > K.area && (K.area = G, K.serialized.bitmap.close(), K.serialized.bitmap = Z(this, f, Bt).call(this, !1));
              }
              return q;
            }
          };
          u = new WeakMap(), l = new WeakMap(), o = new WeakMap(), w = new WeakMap(), x = new WeakMap(), C = new WeakMap(), S = new WeakMap(), T = new WeakMap(), D = new WeakMap(), F = new WeakMap(), f = new WeakSet(), St = function(X, Q = !1) {
            if (!X) {
              this.remove();
              return;
            }
            he(this, u, X.bitmap), Q || (he(this, l, X.id), he(this, D, X.isSvg)), Z(this, f, En).call(this);
          }, kt = function() {
            he(this, o, null), this._uiManager.enableWaiting(!1), c(this, C) && this.div.focus();
          }, $t = function() {
            if (c(this, l)) {
              this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(c(this, l)).then((Q) => Z(this, f, St).call(this, Q, !0)).finally(() => Z(this, f, kt).call(this));
              return;
            }
            if (c(this, w)) {
              const Q = c(this, w);
              he(this, w, null), this._uiManager.enableWaiting(!0), he(this, o, this._uiManager.imageManager.getFromUrl(Q).then((q) => Z(this, f, St).call(this, q)).finally(() => Z(this, f, kt).call(this)));
              return;
            }
            if (c(this, x)) {
              const Q = c(this, x);
              he(this, x, null), this._uiManager.enableWaiting(!0), he(this, o, this._uiManager.imageManager.getFromFile(Q).then((q) => Z(this, f, St).call(this, q)).finally(() => Z(this, f, kt).call(this)));
              return;
            }
            const X = document.createElement("input");
            X.type = "file", X.accept = P.supportedTypesStr, he(this, o, new Promise((Q) => {
              X.addEventListener("change", async () => {
                if (!X.files || X.files.length === 0)
                  this.remove();
                else {
                  this._uiManager.enableWaiting(!0);
                  const q = await this._uiManager.imageManager.getFromFile(X.files[0]);
                  Z(this, f, St).call(this, q);
                }
                Q();
              }), X.addEventListener("cancel", () => {
                this.remove(), Q();
              });
            }).finally(() => Z(this, f, kt).call(this))), X.click();
          }, En = function() {
            const {
              div: X
            } = this;
            let {
              width: Q,
              height: q
            } = c(this, u);
            const [ie, O] = this.pageDimensions, G = 0.75;
            if (this.width)
              Q = this.width * ie, q = this.height * O;
            else if (Q > G * ie || q > G * O) {
              const A = Math.min(G * ie / Q, G * O / q);
              Q *= A, q *= A;
            }
            const [K, M] = this.parentDimensions;
            this.setDims(Q * K / ie, q * M / O), this._uiManager.enableWaiting(!1);
            const _ = he(this, C, document.createElement("canvas"));
            X.append(_), X.hidden = !1, Z(this, f, vn).call(this, Q, q), Z(this, f, ai).call(this), c(this, F) || (this.parent.addUndoableEditor(this), he(this, F, !0)), this._uiManager._eventBus.dispatch("reporttelemetry", {
              source: this,
              details: {
                type: "editing",
                subtype: this.editorType,
                data: {
                  action: "inserted_image"
                }
              }
            }), this.addAltTextButton();
          }, si = function(X, Q) {
            var G;
            const [q, ie] = this.parentDimensions;
            this.width = X / q, this.height = Q / ie, this.setDims(X, Q), (G = this._initialOptions) != null && G.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, c(this, T) !== null && clearTimeout(c(this, T)), he(this, T, setTimeout(() => {
              he(this, T, null), Z(this, f, vn).call(this, X, Q);
            }, 200));
          }, ri = function(X, Q) {
            const {
              width: q,
              height: ie
            } = c(this, u);
            let O = q, G = ie, K = c(this, u);
            for (; O > 2 * X || G > 2 * Q; ) {
              const M = O, _ = G;
              O > 2 * X && (O = O >= 16384 ? Math.floor(O / 2) - 1 : Math.ceil(O / 2)), G > 2 * Q && (G = G >= 16384 ? Math.floor(G / 2) - 1 : Math.ceil(G / 2));
              const A = new OffscreenCanvas(O, G);
              A.getContext("2d").drawImage(K, 0, 0, M, _, 0, 0, O, G), K = A.transferToImageBitmap();
            }
            return K;
          }, vn = function(X, Q) {
            X = Math.ceil(X), Q = Math.ceil(Q);
            const q = c(this, C);
            if (!q || q.width === X && q.height === Q)
              return;
            q.width = X, q.height = Q;
            const ie = c(this, D) ? c(this, u) : Z(this, f, ri).call(this, X, Q), O = q.getContext("2d");
            O.filter = this._uiManager.hcmFilter, O.drawImage(ie, 0, 0, ie.width, ie.height, 0, 0, X, Q);
          }, Bt = function(X) {
            if (X) {
              if (c(this, D)) {
                const ie = this._uiManager.imageManager.getSvgUrl(c(this, l));
                if (ie)
                  return ie;
              }
              const Q = document.createElement("canvas");
              return {
                width: Q.width,
                height: Q.height
              } = c(this, u), Q.getContext("2d").drawImage(c(this, u), 0, 0), Q.toDataURL();
            }
            if (c(this, D)) {
              const [Q, q] = this.pageDimensions, ie = Math.round(this.width * Q * a.PixelsPerInch.PDF_TO_CSS_UNITS), O = Math.round(this.height * q * a.PixelsPerInch.PDF_TO_CSS_UNITS), G = new OffscreenCanvas(ie, O);
              return G.getContext("2d").drawImage(c(this, u), 0, 0, c(this, u).width, c(this, u).height, 0, 0, ie, O), G.transferToImageBitmap();
            }
            return structuredClone(c(this, u));
          }, ai = function() {
            he(this, S, new ResizeObserver((X) => {
              const Q = X[0].contentRect;
              Q.width && Q.height && Z(this, f, si).call(this, Q.width, Q.height);
            })), c(this, S).observe(this.div);
          }, qe(P, "_type", "stamp");
          let h = P;
          e.StampEditor = h;
        }
        /******/
      ], __webpack_module_cache__ = {};
      function __w_pdfjs_require__(r) {
        var e = __webpack_module_cache__[r];
        if (e !== void 0)
          return e.exports;
        var n = __webpack_module_cache__[r] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        return __webpack_modules__[r](n, n.exports, __w_pdfjs_require__), n.exports;
      }
      var __webpack_exports__ = {};
      return (() => {
        var r = __webpack_exports__;
        Object.defineProperty(r, "__esModule", {
          value: !0
        }), Object.defineProperty(r, "AbortException", {
          enumerable: !0,
          get: function() {
            return e.AbortException;
          }
        }), Object.defineProperty(r, "AnnotationEditorLayer", {
          enumerable: !0,
          get: function() {
            return a.AnnotationEditorLayer;
          }
        }), Object.defineProperty(r, "AnnotationEditorParamsType", {
          enumerable: !0,
          get: function() {
            return e.AnnotationEditorParamsType;
          }
        }), Object.defineProperty(r, "AnnotationEditorType", {
          enumerable: !0,
          get: function() {
            return e.AnnotationEditorType;
          }
        }), Object.defineProperty(r, "AnnotationEditorUIManager", {
          enumerable: !0,
          get: function() {
            return s.AnnotationEditorUIManager;
          }
        }), Object.defineProperty(r, "AnnotationLayer", {
          enumerable: !0,
          get: function() {
            return h.AnnotationLayer;
          }
        }), Object.defineProperty(r, "AnnotationMode", {
          enumerable: !0,
          get: function() {
            return e.AnnotationMode;
          }
        }), Object.defineProperty(r, "CMapCompressionType", {
          enumerable: !0,
          get: function() {
            return e.CMapCompressionType;
          }
        }), Object.defineProperty(r, "DOMSVGFactory", {
          enumerable: !0,
          get: function() {
            return t.DOMSVGFactory;
          }
        }), Object.defineProperty(r, "FeatureTest", {
          enumerable: !0,
          get: function() {
            return e.FeatureTest;
          }
        }), Object.defineProperty(r, "GlobalWorkerOptions", {
          enumerable: !0,
          get: function() {
            return u.GlobalWorkerOptions;
          }
        }), Object.defineProperty(r, "ImageKind", {
          enumerable: !0,
          get: function() {
            return e.ImageKind;
          }
        }), Object.defineProperty(r, "InvalidPDFException", {
          enumerable: !0,
          get: function() {
            return e.InvalidPDFException;
          }
        }), Object.defineProperty(r, "MissingPDFException", {
          enumerable: !0,
          get: function() {
            return e.MissingPDFException;
          }
        }), Object.defineProperty(r, "OPS", {
          enumerable: !0,
          get: function() {
            return e.OPS;
          }
        }), Object.defineProperty(r, "PDFDataRangeTransport", {
          enumerable: !0,
          get: function() {
            return n.PDFDataRangeTransport;
          }
        }), Object.defineProperty(r, "PDFDateString", {
          enumerable: !0,
          get: function() {
            return t.PDFDateString;
          }
        }), Object.defineProperty(r, "PDFWorker", {
          enumerable: !0,
          get: function() {
            return n.PDFWorker;
          }
        }), Object.defineProperty(r, "PasswordResponses", {
          enumerable: !0,
          get: function() {
            return e.PasswordResponses;
          }
        }), Object.defineProperty(r, "PermissionFlag", {
          enumerable: !0,
          get: function() {
            return e.PermissionFlag;
          }
        }), Object.defineProperty(r, "PixelsPerInch", {
          enumerable: !0,
          get: function() {
            return t.PixelsPerInch;
          }
        }), Object.defineProperty(r, "PromiseCapability", {
          enumerable: !0,
          get: function() {
            return e.PromiseCapability;
          }
        }), Object.defineProperty(r, "RenderingCancelledException", {
          enumerable: !0,
          get: function() {
            return t.RenderingCancelledException;
          }
        }), Object.defineProperty(r, "SVGGraphics", {
          enumerable: !0,
          get: function() {
            return n.SVGGraphics;
          }
        }), Object.defineProperty(r, "UnexpectedResponseException", {
          enumerable: !0,
          get: function() {
            return e.UnexpectedResponseException;
          }
        }), Object.defineProperty(r, "Util", {
          enumerable: !0,
          get: function() {
            return e.Util;
          }
        }), Object.defineProperty(r, "VerbosityLevel", {
          enumerable: !0,
          get: function() {
            return e.VerbosityLevel;
          }
        }), Object.defineProperty(r, "XfaLayer", {
          enumerable: !0,
          get: function() {
            return l.XfaLayer;
          }
        }), Object.defineProperty(r, "build", {
          enumerable: !0,
          get: function() {
            return n.build;
          }
        }), Object.defineProperty(r, "createValidAbsoluteUrl", {
          enumerable: !0,
          get: function() {
            return e.createValidAbsoluteUrl;
          }
        }), Object.defineProperty(r, "getDocument", {
          enumerable: !0,
          get: function() {
            return n.getDocument;
          }
        }), Object.defineProperty(r, "getFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return t.getFilenameFromUrl;
          }
        }), Object.defineProperty(r, "getPdfFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return t.getPdfFilenameFromUrl;
          }
        }), Object.defineProperty(r, "getXfaPageViewport", {
          enumerable: !0,
          get: function() {
            return t.getXfaPageViewport;
          }
        }), Object.defineProperty(r, "isDataScheme", {
          enumerable: !0,
          get: function() {
            return t.isDataScheme;
          }
        }), Object.defineProperty(r, "isPdfFile", {
          enumerable: !0,
          get: function() {
            return t.isPdfFile;
          }
        }), Object.defineProperty(r, "loadScript", {
          enumerable: !0,
          get: function() {
            return t.loadScript;
          }
        }), Object.defineProperty(r, "noContextMenu", {
          enumerable: !0,
          get: function() {
            return t.noContextMenu;
          }
        }), Object.defineProperty(r, "normalizeUnicode", {
          enumerable: !0,
          get: function() {
            return e.normalizeUnicode;
          }
        }), Object.defineProperty(r, "renderTextLayer", {
          enumerable: !0,
          get: function() {
            return i.renderTextLayer;
          }
        }), Object.defineProperty(r, "setLayerDimensions", {
          enumerable: !0,
          get: function() {
            return t.setLayerDimensions;
          }
        }), Object.defineProperty(r, "shadow", {
          enumerable: !0,
          get: function() {
            return e.shadow;
          }
        }), Object.defineProperty(r, "updateTextLayer", {
          enumerable: !0,
          get: function() {
            return i.updateTextLayer;
          }
        }), Object.defineProperty(r, "version", {
          enumerable: !0,
          get: function() {
            return n.version;
          }
        });
        var e = __w_pdfjs_require__(1), n = __w_pdfjs_require__(2), t = __w_pdfjs_require__(6), i = __w_pdfjs_require__(26), a = __w_pdfjs_require__(27), s = __w_pdfjs_require__(5), h = __w_pdfjs_require__(29), u = __w_pdfjs_require__(14), l = __w_pdfjs_require__(32);
      })(), __webpack_exports__;
    })()
  ));
})(pdf);
var pdfExports = pdf.exports;
function pretty_si(r) {
  let e = ["", "k", "M", "G", "T", "P", "E", "Z"], n = 0;
  for (; r > 1e3 && n < e.length - 1; )
    r /= 1e3, n++;
  let t = e[n];
  return (Number.isInteger(r) ? r : r.toFixed(1)) + t;
}
function noop$3() {
}
function safe_not_equal$3(r, e) {
  return r != r ? e == e : r !== e || r && typeof r == "object" || typeof r == "function";
}
const is_client = typeof window < "u";
let now = is_client ? () => window.performance.now() : () => Date.now(), raf = is_client ? (r) => requestAnimationFrame(r) : noop$3;
const tasks = /* @__PURE__ */ new Set();
function run_tasks(r) {
  tasks.forEach((e) => {
    e.c(r) || (tasks.delete(e), e.f());
  }), tasks.size !== 0 && raf(run_tasks);
}
function loop(r) {
  let e;
  return tasks.size === 0 && raf(run_tasks), {
    promise: new Promise((n) => {
      tasks.add(e = { c: r, f: n });
    }),
    abort() {
      tasks.delete(e);
    }
  };
}
const subscriber_queue = [];
function writable(r, e = noop$3) {
  let n;
  const t = /* @__PURE__ */ new Set();
  function i(h) {
    if (safe_not_equal$3(r, h) && (r = h, n)) {
      const u = !subscriber_queue.length;
      for (const l of t)
        l[1](), subscriber_queue.push(l, r);
      if (u) {
        for (let l = 0; l < subscriber_queue.length; l += 2)
          subscriber_queue[l][0](subscriber_queue[l + 1]);
        subscriber_queue.length = 0;
      }
    }
  }
  function a(h) {
    i(h(r));
  }
  function s(h, u = noop$3) {
    const l = [h, u];
    return t.add(l), t.size === 1 && (n = e(i, a) || noop$3), h(r), () => {
      t.delete(l), t.size === 0 && n && (n(), n = null);
    };
  }
  return { set: i, update: a, subscribe: s };
}
function is_date(r) {
  return Object.prototype.toString.call(r) === "[object Date]";
}
function tick_spring(r, e, n, t) {
  if (typeof n == "number" || is_date(n)) {
    const i = t - n, a = (n - e) / (r.dt || 1 / 60), s = r.opts.stiffness * i, h = r.opts.damping * a, u = (s - h) * r.inv_mass, l = (a + u) * r.dt;
    return Math.abs(l) < r.opts.precision && Math.abs(i) < r.opts.precision ? t : (r.settled = !1, is_date(n) ? new Date(n.getTime() + l) : n + l);
  } else {
    if (Array.isArray(n))
      return n.map(
        (i, a) => tick_spring(r, e[a], n[a], t[a])
      );
    if (typeof n == "object") {
      const i = {};
      for (const a in n)
        i[a] = tick_spring(r, e[a], n[a], t[a]);
      return i;
    } else
      throw new Error(`Cannot spring ${typeof n} values`);
  }
}
function spring(r, e = {}) {
  const n = writable(r), { stiffness: t = 0.15, damping: i = 0.8, precision: a = 0.01 } = e;
  let s, h, u, l = r, o = r, w = 1, x = 0, C = !1;
  function S(D, F = {}) {
    o = D;
    const f = u = {};
    return r == null || F.hard || T.stiffness >= 1 && T.damping >= 1 ? (C = !0, s = now(), l = D, n.set(r = o), Promise.resolve()) : (F.soft && (x = 1 / ((F.soft === !0 ? 0.5 : +F.soft) * 60), w = 0), h || (s = now(), C = !1, h = loop((E) => {
      if (C)
        return C = !1, h = null, !1;
      w = Math.min(w + x, 1);
      const v = {
        inv_mass: w,
        opts: T,
        settled: !0,
        dt: (E - s) * 60 / 1e3
      }, p = tick_spring(v, l, r, o);
      return s = E, l = r, n.set(r = p), v.settled && (h = null), !v.settled;
    })), new Promise((E) => {
      h.promise.then(() => {
        f === u && E();
      });
    }));
  }
  const T = {
    set: S,
    update: (D, F) => S(D(o, r), F),
    subscribe: n.subscribe,
    stiffness: t,
    damping: i,
    precision: a
  };
  return T;
}
const {
  SvelteComponent: SvelteComponent$2,
  append: append$2,
  attr: attr$2,
  component_subscribe,
  detach: detach$2,
  element: element$2,
  init: init$2,
  insert: insert$2,
  noop: noop$2,
  safe_not_equal: safe_not_equal$2,
  set_style: set_style$2,
  svg_element,
  toggle_class: toggle_class$1
} = window.__gradio__svelte__internal, { onMount } = window.__gradio__svelte__internal;
function create_fragment$2(r) {
  let e, n, t, i, a, s, h, u, l, o, w, x;
  return {
    c() {
      e = element$2("div"), n = svg_element("svg"), t = svg_element("g"), i = svg_element("path"), a = svg_element("path"), s = svg_element("path"), h = svg_element("path"), u = svg_element("g"), l = svg_element("path"), o = svg_element("path"), w = svg_element("path"), x = svg_element("path"), attr$2(i, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$2(i, "fill", "#FF7C00"), attr$2(i, "fill-opacity", "0.4"), attr$2(i, "class", "svelte-43sxxs"), attr$2(a, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$2(a, "fill", "#FF7C00"), attr$2(a, "class", "svelte-43sxxs"), attr$2(s, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$2(s, "fill", "#FF7C00"), attr$2(s, "fill-opacity", "0.4"), attr$2(s, "class", "svelte-43sxxs"), attr$2(h, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$2(h, "fill", "#FF7C00"), attr$2(h, "class", "svelte-43sxxs"), set_style$2(t, "transform", "translate(" + /*$top*/
      r[1][0] + "px, " + /*$top*/
      r[1][1] + "px)"), attr$2(l, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$2(l, "fill", "#FF7C00"), attr$2(l, "fill-opacity", "0.4"), attr$2(l, "class", "svelte-43sxxs"), attr$2(o, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$2(o, "fill", "#FF7C00"), attr$2(o, "class", "svelte-43sxxs"), attr$2(w, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$2(w, "fill", "#FF7C00"), attr$2(w, "fill-opacity", "0.4"), attr$2(w, "class", "svelte-43sxxs"), attr$2(x, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$2(x, "fill", "#FF7C00"), attr$2(x, "class", "svelte-43sxxs"), set_style$2(u, "transform", "translate(" + /*$bottom*/
      r[2][0] + "px, " + /*$bottom*/
      r[2][1] + "px)"), attr$2(n, "viewBox", "-1200 -1200 3000 3000"), attr$2(n, "fill", "none"), attr$2(n, "xmlns", "http://www.w3.org/2000/svg"), attr$2(n, "class", "svelte-43sxxs"), attr$2(e, "class", "svelte-43sxxs"), toggle_class$1(
        e,
        "margin",
        /*margin*/
        r[0]
      );
    },
    m(C, S) {
      insert$2(C, e, S), append$2(e, n), append$2(n, t), append$2(t, i), append$2(t, a), append$2(t, s), append$2(t, h), append$2(n, u), append$2(u, l), append$2(u, o), append$2(u, w), append$2(u, x);
    },
    p(C, [S]) {
      S & /*$top*/
      2 && set_style$2(t, "transform", "translate(" + /*$top*/
      C[1][0] + "px, " + /*$top*/
      C[1][1] + "px)"), S & /*$bottom*/
      4 && set_style$2(u, "transform", "translate(" + /*$bottom*/
      C[2][0] + "px, " + /*$bottom*/
      C[2][1] + "px)"), S & /*margin*/
      1 && toggle_class$1(
        e,
        "margin",
        /*margin*/
        C[0]
      );
    },
    i: noop$2,
    o: noop$2,
    d(C) {
      C && detach$2(e);
    }
  };
}
function instance$2(r, e, n) {
  let t, i;
  var a = this && this.__awaiter || function(C, S, T, D) {
    function F(f) {
      return f instanceof T ? f : new T(function(E) {
        E(f);
      });
    }
    return new (T || (T = Promise))(function(f, E) {
      function v(g) {
        try {
          d(D.next(g));
        } catch (m) {
          E(m);
        }
      }
      function p(g) {
        try {
          d(D.throw(g));
        } catch (m) {
          E(m);
        }
      }
      function d(g) {
        g.done ? f(g.value) : F(g.value).then(v, p);
      }
      d((D = D.apply(C, S || [])).next());
    });
  };
  let { margin: s = !0 } = e;
  const h = spring([0, 0]);
  component_subscribe(r, h, (C) => n(1, t = C));
  const u = spring([0, 0]);
  component_subscribe(r, u, (C) => n(2, i = C));
  let l;
  function o() {
    return a(this, void 0, void 0, function* () {
      yield Promise.all([h.set([125, 140]), u.set([-125, -140])]), yield Promise.all([h.set([-125, 140]), u.set([125, -140])]), yield Promise.all([h.set([-125, 0]), u.set([125, -0])]), yield Promise.all([h.set([125, 0]), u.set([-125, 0])]);
    });
  }
  function w() {
    return a(this, void 0, void 0, function* () {
      yield o(), l || w();
    });
  }
  function x() {
    return a(this, void 0, void 0, function* () {
      yield Promise.all([h.set([125, 0]), u.set([-125, 0])]), w();
    });
  }
  return onMount(() => (x(), () => l = !0)), r.$$set = (C) => {
    "margin" in C && n(0, s = C.margin);
  }, [s, t, i, h, u];
}
class Loader extends SvelteComponent$2 {
  constructor(e) {
    super(), init$2(this, e, instance$2, create_fragment$2, safe_not_equal$2, { margin: 0 });
  }
}
const {
  SvelteComponent: SvelteComponent$1,
  append: append$1,
  attr: attr$1,
  binding_callbacks: binding_callbacks$1,
  check_outros: check_outros$1,
  create_component: create_component$1,
  create_slot,
  destroy_component: destroy_component$1,
  destroy_each,
  detach: detach$1,
  element: element$1,
  empty,
  ensure_array_like,
  get_all_dirty_from_scope,
  get_slot_changes,
  group_outros: group_outros$1,
  init: init$1,
  insert: insert$1,
  mount_component: mount_component$1,
  noop: noop$1,
  safe_not_equal: safe_not_equal$1,
  set_data: set_data$1,
  set_style: set_style$1,
  space: space$1,
  text: text$2,
  toggle_class,
  transition_in: transition_in$1,
  transition_out: transition_out$1,
  update_slot_base
} = window.__gradio__svelte__internal, { tick: tick$1 } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, { createEventDispatcher } = window.__gradio__svelte__internal, get_error_slot_changes = (r) => ({}), get_error_slot_context = (r) => ({}), get_additional_loading_text_slot_changes = (r) => ({}), get_additional_loading_text_slot_context = (r) => ({});
function get_each_context(r, e, n) {
  const t = r.slice();
  return t[41] = e[n], t[43] = n, t;
}
function get_each_context_1(r, e, n) {
  const t = r.slice();
  return t[41] = e[n], t;
}
function create_if_block_17(r) {
  let e, n, t, i, a = (
    /*i18n*/
    r[1]("common.error") + ""
  ), s, h, u;
  n = new IconButton({
    props: {
      Icon: Clear,
      label: (
        /*i18n*/
        r[1]("common.clear")
      ),
      disabled: !1
    }
  }), n.$on(
    "click",
    /*click_handler*/
    r[32]
  );
  const l = (
    /*#slots*/
    r[30].error
  ), o = create_slot(
    l,
    r,
    /*$$scope*/
    r[29],
    get_error_slot_context
  );
  return {
    c() {
      e = element$1("div"), create_component$1(n.$$.fragment), t = space$1(), i = element$1("span"), s = text$2(a), h = space$1(), o && o.c(), attr$1(e, "class", "clear-status svelte-v0wucf"), attr$1(i, "class", "error svelte-v0wucf");
    },
    m(w, x) {
      insert$1(w, e, x), mount_component$1(n, e, null), insert$1(w, t, x), insert$1(w, i, x), append$1(i, s), insert$1(w, h, x), o && o.m(w, x), u = !0;
    },
    p(w, x) {
      const C = {};
      x[0] & /*i18n*/
      2 && (C.label = /*i18n*/
      w[1]("common.clear")), n.$set(C), (!u || x[0] & /*i18n*/
      2) && a !== (a = /*i18n*/
      w[1]("common.error") + "") && set_data$1(s, a), o && o.p && (!u || x[0] & /*$$scope*/
      536870912) && update_slot_base(
        o,
        l,
        w,
        /*$$scope*/
        w[29],
        u ? get_slot_changes(
          l,
          /*$$scope*/
          w[29],
          x,
          get_error_slot_changes
        ) : get_all_dirty_from_scope(
          /*$$scope*/
          w[29]
        ),
        get_error_slot_context
      );
    },
    i(w) {
      u || (transition_in$1(n.$$.fragment, w), transition_in$1(o, w), u = !0);
    },
    o(w) {
      transition_out$1(n.$$.fragment, w), transition_out$1(o, w), u = !1;
    },
    d(w) {
      w && (detach$1(e), detach$1(t), detach$1(i), detach$1(h)), destroy_component$1(n), o && o.d(w);
    }
  };
}
function create_if_block$1(r) {
  let e, n, t, i, a, s, h, u, l, o = (
    /*variant*/
    r[8] === "default" && /*show_eta_bar*/
    r[18] && /*show_progress*/
    r[6] === "full" && create_if_block_16(r)
  );
  function w(E, v) {
    if (
      /*progress*/
      E[7]
    ) return create_if_block_11;
    if (
      /*queue_position*/
      E[2] !== null && /*queue_size*/
      E[3] !== void 0 && /*queue_position*/
      E[2] >= 0
    ) return create_if_block_14;
    if (
      /*queue_position*/
      E[2] === 0
    ) return create_if_block_15;
  }
  let x = w(r), C = x && x(r), S = (
    /*timer*/
    r[5] && create_if_block_10(r)
  );
  const T = [create_if_block_2$1, create_if_block_9], D = [];
  function F(E, v) {
    return (
      /*last_progress_level*/
      E[15] != null ? 0 : (
        /*show_progress*/
        E[6] === "full" ? 1 : -1
      )
    );
  }
  ~(a = F(r)) && (s = D[a] = T[a](r));
  let f = !/*timer*/
  r[5] && create_if_block_1$1(r);
  return {
    c() {
      o && o.c(), e = space$1(), n = element$1("div"), C && C.c(), t = space$1(), S && S.c(), i = space$1(), s && s.c(), h = space$1(), f && f.c(), u = empty(), attr$1(n, "class", "progress-text svelte-v0wucf"), toggle_class(
        n,
        "meta-text-center",
        /*variant*/
        r[8] === "center"
      ), toggle_class(
        n,
        "meta-text",
        /*variant*/
        r[8] === "default"
      );
    },
    m(E, v) {
      o && o.m(E, v), insert$1(E, e, v), insert$1(E, n, v), C && C.m(n, null), append$1(n, t), S && S.m(n, null), insert$1(E, i, v), ~a && D[a].m(E, v), insert$1(E, h, v), f && f.m(E, v), insert$1(E, u, v), l = !0;
    },
    p(E, v) {
      /*variant*/
      E[8] === "default" && /*show_eta_bar*/
      E[18] && /*show_progress*/
      E[6] === "full" ? o ? o.p(E, v) : (o = create_if_block_16(E), o.c(), o.m(e.parentNode, e)) : o && (o.d(1), o = null), x === (x = w(E)) && C ? C.p(E, v) : (C && C.d(1), C = x && x(E), C && (C.c(), C.m(n, t))), /*timer*/
      E[5] ? S ? S.p(E, v) : (S = create_if_block_10(E), S.c(), S.m(n, null)) : S && (S.d(1), S = null), (!l || v[0] & /*variant*/
      256) && toggle_class(
        n,
        "meta-text-center",
        /*variant*/
        E[8] === "center"
      ), (!l || v[0] & /*variant*/
      256) && toggle_class(
        n,
        "meta-text",
        /*variant*/
        E[8] === "default"
      );
      let p = a;
      a = F(E), a === p ? ~a && D[a].p(E, v) : (s && (group_outros$1(), transition_out$1(D[p], 1, 1, () => {
        D[p] = null;
      }), check_outros$1()), ~a ? (s = D[a], s ? s.p(E, v) : (s = D[a] = T[a](E), s.c()), transition_in$1(s, 1), s.m(h.parentNode, h)) : s = null), /*timer*/
      E[5] ? f && (group_outros$1(), transition_out$1(f, 1, 1, () => {
        f = null;
      }), check_outros$1()) : f ? (f.p(E, v), v[0] & /*timer*/
      32 && transition_in$1(f, 1)) : (f = create_if_block_1$1(E), f.c(), transition_in$1(f, 1), f.m(u.parentNode, u));
    },
    i(E) {
      l || (transition_in$1(s), transition_in$1(f), l = !0);
    },
    o(E) {
      transition_out$1(s), transition_out$1(f), l = !1;
    },
    d(E) {
      E && (detach$1(e), detach$1(n), detach$1(i), detach$1(h), detach$1(u)), o && o.d(E), C && C.d(), S && S.d(), ~a && D[a].d(E), f && f.d(E);
    }
  };
}
function create_if_block_16(r) {
  let e, n = `translateX(${/*eta_level*/
  (r[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      e = element$1("div"), attr$1(e, "class", "eta-bar svelte-v0wucf"), set_style$1(e, "transform", n);
    },
    m(t, i) {
      insert$1(t, e, i);
    },
    p(t, i) {
      i[0] & /*eta_level*/
      131072 && n !== (n = `translateX(${/*eta_level*/
      (t[17] || 0) * 100 - 100}%)`) && set_style$1(e, "transform", n);
    },
    d(t) {
      t && detach$1(e);
    }
  };
}
function create_if_block_15(r) {
  let e;
  return {
    c() {
      e = text$2("processing |");
    },
    m(n, t) {
      insert$1(n, e, t);
    },
    p: noop$1,
    d(n) {
      n && detach$1(e);
    }
  };
}
function create_if_block_14(r) {
  let e, n = (
    /*queue_position*/
    r[2] + 1 + ""
  ), t, i, a, s;
  return {
    c() {
      e = text$2("queue: "), t = text$2(n), i = text$2("/"), a = text$2(
        /*queue_size*/
        r[3]
      ), s = text$2(" |");
    },
    m(h, u) {
      insert$1(h, e, u), insert$1(h, t, u), insert$1(h, i, u), insert$1(h, a, u), insert$1(h, s, u);
    },
    p(h, u) {
      u[0] & /*queue_position*/
      4 && n !== (n = /*queue_position*/
      h[2] + 1 + "") && set_data$1(t, n), u[0] & /*queue_size*/
      8 && set_data$1(
        a,
        /*queue_size*/
        h[3]
      );
    },
    d(h) {
      h && (detach$1(e), detach$1(t), detach$1(i), detach$1(a), detach$1(s));
    }
  };
}
function create_if_block_11(r) {
  let e, n = ensure_array_like(
    /*progress*/
    r[7]
  ), t = [];
  for (let i = 0; i < n.length; i += 1)
    t[i] = create_each_block_1(get_each_context_1(r, n, i));
  return {
    c() {
      for (let i = 0; i < t.length; i += 1)
        t[i].c();
      e = empty();
    },
    m(i, a) {
      for (let s = 0; s < t.length; s += 1)
        t[s] && t[s].m(i, a);
      insert$1(i, e, a);
    },
    p(i, a) {
      if (a[0] & /*progress*/
      128) {
        n = ensure_array_like(
          /*progress*/
          i[7]
        );
        let s;
        for (s = 0; s < n.length; s += 1) {
          const h = get_each_context_1(i, n, s);
          t[s] ? t[s].p(h, a) : (t[s] = create_each_block_1(h), t[s].c(), t[s].m(e.parentNode, e));
        }
        for (; s < t.length; s += 1)
          t[s].d(1);
        t.length = n.length;
      }
    },
    d(i) {
      i && detach$1(e), destroy_each(t, i);
    }
  };
}
function create_if_block_12(r) {
  let e, n = (
    /*p*/
    r[41].unit + ""
  ), t, i, a = " ", s;
  function h(o, w) {
    return (
      /*p*/
      o[41].length != null ? create_if_block_13 : create_else_block
    );
  }
  let u = h(r), l = u(r);
  return {
    c() {
      l.c(), e = space$1(), t = text$2(n), i = text$2(" | "), s = text$2(a);
    },
    m(o, w) {
      l.m(o, w), insert$1(o, e, w), insert$1(o, t, w), insert$1(o, i, w), insert$1(o, s, w);
    },
    p(o, w) {
      u === (u = h(o)) && l ? l.p(o, w) : (l.d(1), l = u(o), l && (l.c(), l.m(e.parentNode, e))), w[0] & /*progress*/
      128 && n !== (n = /*p*/
      o[41].unit + "") && set_data$1(t, n);
    },
    d(o) {
      o && (detach$1(e), detach$1(t), detach$1(i), detach$1(s)), l.d(o);
    }
  };
}
function create_else_block(r) {
  let e = pretty_si(
    /*p*/
    r[41].index || 0
  ) + "", n;
  return {
    c() {
      n = text$2(e);
    },
    m(t, i) {
      insert$1(t, n, i);
    },
    p(t, i) {
      i[0] & /*progress*/
      128 && e !== (e = pretty_si(
        /*p*/
        t[41].index || 0
      ) + "") && set_data$1(n, e);
    },
    d(t) {
      t && detach$1(n);
    }
  };
}
function create_if_block_13(r) {
  let e = pretty_si(
    /*p*/
    r[41].index || 0
  ) + "", n, t, i = pretty_si(
    /*p*/
    r[41].length
  ) + "", a;
  return {
    c() {
      n = text$2(e), t = text$2("/"), a = text$2(i);
    },
    m(s, h) {
      insert$1(s, n, h), insert$1(s, t, h), insert$1(s, a, h);
    },
    p(s, h) {
      h[0] & /*progress*/
      128 && e !== (e = pretty_si(
        /*p*/
        s[41].index || 0
      ) + "") && set_data$1(n, e), h[0] & /*progress*/
      128 && i !== (i = pretty_si(
        /*p*/
        s[41].length
      ) + "") && set_data$1(a, i);
    },
    d(s) {
      s && (detach$1(n), detach$1(t), detach$1(a));
    }
  };
}
function create_each_block_1(r) {
  let e, n = (
    /*p*/
    r[41].index != null && create_if_block_12(r)
  );
  return {
    c() {
      n && n.c(), e = empty();
    },
    m(t, i) {
      n && n.m(t, i), insert$1(t, e, i);
    },
    p(t, i) {
      /*p*/
      t[41].index != null ? n ? n.p(t, i) : (n = create_if_block_12(t), n.c(), n.m(e.parentNode, e)) : n && (n.d(1), n = null);
    },
    d(t) {
      t && detach$1(e), n && n.d(t);
    }
  };
}
function create_if_block_10(r) {
  let e, n = (
    /*eta*/
    r[0] ? `/${/*formatted_eta*/
    r[19]}` : ""
  ), t, i;
  return {
    c() {
      e = text$2(
        /*formatted_timer*/
        r[20]
      ), t = text$2(n), i = text$2("s");
    },
    m(a, s) {
      insert$1(a, e, s), insert$1(a, t, s), insert$1(a, i, s);
    },
    p(a, s) {
      s[0] & /*formatted_timer*/
      1048576 && set_data$1(
        e,
        /*formatted_timer*/
        a[20]
      ), s[0] & /*eta, formatted_eta*/
      524289 && n !== (n = /*eta*/
      a[0] ? `/${/*formatted_eta*/
      a[19]}` : "") && set_data$1(t, n);
    },
    d(a) {
      a && (detach$1(e), detach$1(t), detach$1(i));
    }
  };
}
function create_if_block_9(r) {
  let e, n;
  return e = new Loader({
    props: { margin: (
      /*variant*/
      r[8] === "default"
    ) }
  }), {
    c() {
      create_component$1(e.$$.fragment);
    },
    m(t, i) {
      mount_component$1(e, t, i), n = !0;
    },
    p(t, i) {
      const a = {};
      i[0] & /*variant*/
      256 && (a.margin = /*variant*/
      t[8] === "default"), e.$set(a);
    },
    i(t) {
      n || (transition_in$1(e.$$.fragment, t), n = !0);
    },
    o(t) {
      transition_out$1(e.$$.fragment, t), n = !1;
    },
    d(t) {
      destroy_component$1(e, t);
    }
  };
}
function create_if_block_2$1(r) {
  let e, n, t, i, a, s = `${/*last_progress_level*/
  r[15] * 100}%`, h = (
    /*progress*/
    r[7] != null && create_if_block_3$1(r)
  );
  return {
    c() {
      e = element$1("div"), n = element$1("div"), h && h.c(), t = space$1(), i = element$1("div"), a = element$1("div"), attr$1(n, "class", "progress-level-inner svelte-v0wucf"), attr$1(a, "class", "progress-bar svelte-v0wucf"), set_style$1(a, "width", s), attr$1(i, "class", "progress-bar-wrap svelte-v0wucf"), attr$1(e, "class", "progress-level svelte-v0wucf");
    },
    m(u, l) {
      insert$1(u, e, l), append$1(e, n), h && h.m(n, null), append$1(e, t), append$1(e, i), append$1(i, a), r[31](a);
    },
    p(u, l) {
      /*progress*/
      u[7] != null ? h ? h.p(u, l) : (h = create_if_block_3$1(u), h.c(), h.m(n, null)) : h && (h.d(1), h = null), l[0] & /*last_progress_level*/
      32768 && s !== (s = `${/*last_progress_level*/
      u[15] * 100}%`) && set_style$1(a, "width", s);
    },
    i: noop$1,
    o: noop$1,
    d(u) {
      u && detach$1(e), h && h.d(), r[31](null);
    }
  };
}
function create_if_block_3$1(r) {
  let e, n = ensure_array_like(
    /*progress*/
    r[7]
  ), t = [];
  for (let i = 0; i < n.length; i += 1)
    t[i] = create_each_block(get_each_context(r, n, i));
  return {
    c() {
      for (let i = 0; i < t.length; i += 1)
        t[i].c();
      e = empty();
    },
    m(i, a) {
      for (let s = 0; s < t.length; s += 1)
        t[s] && t[s].m(i, a);
      insert$1(i, e, a);
    },
    p(i, a) {
      if (a[0] & /*progress_level, progress*/
      16512) {
        n = ensure_array_like(
          /*progress*/
          i[7]
        );
        let s;
        for (s = 0; s < n.length; s += 1) {
          const h = get_each_context(i, n, s);
          t[s] ? t[s].p(h, a) : (t[s] = create_each_block(h), t[s].c(), t[s].m(e.parentNode, e));
        }
        for (; s < t.length; s += 1)
          t[s].d(1);
        t.length = n.length;
      }
    },
    d(i) {
      i && detach$1(e), destroy_each(t, i);
    }
  };
}
function create_if_block_4$1(r) {
  let e, n, t, i, a = (
    /*i*/
    r[43] !== 0 && create_if_block_8()
  ), s = (
    /*p*/
    r[41].desc != null && create_if_block_7(r)
  ), h = (
    /*p*/
    r[41].desc != null && /*progress_level*/
    r[14] && /*progress_level*/
    r[14][
      /*i*/
      r[43]
    ] != null && create_if_block_6()
  ), u = (
    /*progress_level*/
    r[14] != null && create_if_block_5(r)
  );
  return {
    c() {
      a && a.c(), e = space$1(), s && s.c(), n = space$1(), h && h.c(), t = space$1(), u && u.c(), i = empty();
    },
    m(l, o) {
      a && a.m(l, o), insert$1(l, e, o), s && s.m(l, o), insert$1(l, n, o), h && h.m(l, o), insert$1(l, t, o), u && u.m(l, o), insert$1(l, i, o);
    },
    p(l, o) {
      /*p*/
      l[41].desc != null ? s ? s.p(l, o) : (s = create_if_block_7(l), s.c(), s.m(n.parentNode, n)) : s && (s.d(1), s = null), /*p*/
      l[41].desc != null && /*progress_level*/
      l[14] && /*progress_level*/
      l[14][
        /*i*/
        l[43]
      ] != null ? h || (h = create_if_block_6(), h.c(), h.m(t.parentNode, t)) : h && (h.d(1), h = null), /*progress_level*/
      l[14] != null ? u ? u.p(l, o) : (u = create_if_block_5(l), u.c(), u.m(i.parentNode, i)) : u && (u.d(1), u = null);
    },
    d(l) {
      l && (detach$1(e), detach$1(n), detach$1(t), detach$1(i)), a && a.d(l), s && s.d(l), h && h.d(l), u && u.d(l);
    }
  };
}
function create_if_block_8(r) {
  let e;
  return {
    c() {
      e = text$2(" /");
    },
    m(n, t) {
      insert$1(n, e, t);
    },
    d(n) {
      n && detach$1(e);
    }
  };
}
function create_if_block_7(r) {
  let e = (
    /*p*/
    r[41].desc + ""
  ), n;
  return {
    c() {
      n = text$2(e);
    },
    m(t, i) {
      insert$1(t, n, i);
    },
    p(t, i) {
      i[0] & /*progress*/
      128 && e !== (e = /*p*/
      t[41].desc + "") && set_data$1(n, e);
    },
    d(t) {
      t && detach$1(n);
    }
  };
}
function create_if_block_6(r) {
  let e;
  return {
    c() {
      e = text$2("-");
    },
    m(n, t) {
      insert$1(n, e, t);
    },
    d(n) {
      n && detach$1(e);
    }
  };
}
function create_if_block_5(r) {
  let e = (100 * /*progress_level*/
  (r[14][
    /*i*/
    r[43]
  ] || 0)).toFixed(1) + "", n, t;
  return {
    c() {
      n = text$2(e), t = text$2("%");
    },
    m(i, a) {
      insert$1(i, n, a), insert$1(i, t, a);
    },
    p(i, a) {
      a[0] & /*progress_level*/
      16384 && e !== (e = (100 * /*progress_level*/
      (i[14][
        /*i*/
        i[43]
      ] || 0)).toFixed(1) + "") && set_data$1(n, e);
    },
    d(i) {
      i && (detach$1(n), detach$1(t));
    }
  };
}
function create_each_block(r) {
  let e, n = (
    /*p*/
    (r[41].desc != null || /*progress_level*/
    r[14] && /*progress_level*/
    r[14][
      /*i*/
      r[43]
    ] != null) && create_if_block_4$1(r)
  );
  return {
    c() {
      n && n.c(), e = empty();
    },
    m(t, i) {
      n && n.m(t, i), insert$1(t, e, i);
    },
    p(t, i) {
      /*p*/
      t[41].desc != null || /*progress_level*/
      t[14] && /*progress_level*/
      t[14][
        /*i*/
        t[43]
      ] != null ? n ? n.p(t, i) : (n = create_if_block_4$1(t), n.c(), n.m(e.parentNode, e)) : n && (n.d(1), n = null);
    },
    d(t) {
      t && detach$1(e), n && n.d(t);
    }
  };
}
function create_if_block_1$1(r) {
  let e, n, t, i;
  const a = (
    /*#slots*/
    r[30]["additional-loading-text"]
  ), s = create_slot(
    a,
    r,
    /*$$scope*/
    r[29],
    get_additional_loading_text_slot_context
  );
  return {
    c() {
      e = element$1("p"), n = text$2(
        /*loading_text*/
        r[9]
      ), t = space$1(), s && s.c(), attr$1(e, "class", "loading svelte-v0wucf");
    },
    m(h, u) {
      insert$1(h, e, u), append$1(e, n), insert$1(h, t, u), s && s.m(h, u), i = !0;
    },
    p(h, u) {
      (!i || u[0] & /*loading_text*/
      512) && set_data$1(
        n,
        /*loading_text*/
        h[9]
      ), s && s.p && (!i || u[0] & /*$$scope*/
      536870912) && update_slot_base(
        s,
        a,
        h,
        /*$$scope*/
        h[29],
        i ? get_slot_changes(
          a,
          /*$$scope*/
          h[29],
          u,
          get_additional_loading_text_slot_changes
        ) : get_all_dirty_from_scope(
          /*$$scope*/
          h[29]
        ),
        get_additional_loading_text_slot_context
      );
    },
    i(h) {
      i || (transition_in$1(s, h), i = !0);
    },
    o(h) {
      transition_out$1(s, h), i = !1;
    },
    d(h) {
      h && (detach$1(e), detach$1(t)), s && s.d(h);
    }
  };
}
function create_fragment$1(r) {
  let e, n, t, i, a;
  const s = [create_if_block$1, create_if_block_17], h = [];
  function u(l, o) {
    return (
      /*status*/
      l[4] === "pending" ? 0 : (
        /*status*/
        l[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(n = u(r)) && (t = h[n] = s[n](r)), {
    c() {
      e = element$1("div"), t && t.c(), attr$1(e, "class", i = "wrap " + /*variant*/
      r[8] + " " + /*show_progress*/
      r[6] + " svelte-v0wucf"), toggle_class(e, "hide", !/*status*/
      r[4] || /*status*/
      r[4] === "complete" || /*show_progress*/
      r[6] === "hidden"), toggle_class(
        e,
        "translucent",
        /*variant*/
        r[8] === "center" && /*status*/
        (r[4] === "pending" || /*status*/
        r[4] === "error") || /*translucent*/
        r[11] || /*show_progress*/
        r[6] === "minimal"
      ), toggle_class(
        e,
        "generating",
        /*status*/
        r[4] === "generating" && /*show_progress*/
        r[6] === "full"
      ), toggle_class(
        e,
        "border",
        /*border*/
        r[12]
      ), set_style$1(
        e,
        "position",
        /*absolute*/
        r[10] ? "absolute" : "static"
      ), set_style$1(
        e,
        "padding",
        /*absolute*/
        r[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(l, o) {
      insert$1(l, e, o), ~n && h[n].m(e, null), r[33](e), a = !0;
    },
    p(l, o) {
      let w = n;
      n = u(l), n === w ? ~n && h[n].p(l, o) : (t && (group_outros$1(), transition_out$1(h[w], 1, 1, () => {
        h[w] = null;
      }), check_outros$1()), ~n ? (t = h[n], t ? t.p(l, o) : (t = h[n] = s[n](l), t.c()), transition_in$1(t, 1), t.m(e, null)) : t = null), (!a || o[0] & /*variant, show_progress*/
      320 && i !== (i = "wrap " + /*variant*/
      l[8] + " " + /*show_progress*/
      l[6] + " svelte-v0wucf")) && attr$1(e, "class", i), (!a || o[0] & /*variant, show_progress, status, show_progress*/
      336) && toggle_class(e, "hide", !/*status*/
      l[4] || /*status*/
      l[4] === "complete" || /*show_progress*/
      l[6] === "hidden"), (!a || o[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && toggle_class(
        e,
        "translucent",
        /*variant*/
        l[8] === "center" && /*status*/
        (l[4] === "pending" || /*status*/
        l[4] === "error") || /*translucent*/
        l[11] || /*show_progress*/
        l[6] === "minimal"
      ), (!a || o[0] & /*variant, show_progress, status, show_progress*/
      336) && toggle_class(
        e,
        "generating",
        /*status*/
        l[4] === "generating" && /*show_progress*/
        l[6] === "full"
      ), (!a || o[0] & /*variant, show_progress, border*/
      4416) && toggle_class(
        e,
        "border",
        /*border*/
        l[12]
      ), o[0] & /*absolute*/
      1024 && set_style$1(
        e,
        "position",
        /*absolute*/
        l[10] ? "absolute" : "static"
      ), o[0] & /*absolute*/
      1024 && set_style$1(
        e,
        "padding",
        /*absolute*/
        l[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(l) {
      a || (transition_in$1(t), a = !0);
    },
    o(l) {
      transition_out$1(t), a = !1;
    },
    d(l) {
      l && detach$1(e), ~n && h[n].d(), r[33](null);
    }
  };
}
var __awaiter = function(r, e, n, t) {
  function i(a) {
    return a instanceof n ? a : new n(function(s) {
      s(a);
    });
  }
  return new (n || (n = Promise))(function(a, s) {
    function h(o) {
      try {
        l(t.next(o));
      } catch (w) {
        s(w);
      }
    }
    function u(o) {
      try {
        l(t.throw(o));
      } catch (w) {
        s(w);
      }
    }
    function l(o) {
      o.done ? a(o.value) : i(o.value).then(h, u);
    }
    l((t = t.apply(r, e || [])).next());
  });
};
let items = [], called = !1;
function scroll_into_view(r) {
  return __awaiter(this, arguments, void 0, function* (e, n = !0) {
    if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && n !== !0)) {
      if (items.push(e), !called) called = !0;
      else return;
      yield tick$1(), requestAnimationFrame(() => {
        let t = [0, 0];
        for (let i = 0; i < items.length; i++) {
          const s = items[i].getBoundingClientRect();
          (i === 0 || s.top + window.scrollY <= t[0]) && (t[0] = s.top + window.scrollY, t[1] = i);
        }
        window.scrollTo({ top: t[0] - 20, behavior: "smooth" }), called = !1, items = [];
      });
    }
  });
}
function instance$1(r, e, n) {
  let t, { $$slots: i = {}, $$scope: a } = e;
  this && this.__awaiter;
  const s = createEventDispatcher();
  let { i18n: h } = e, { eta: u = null } = e, { queue_position: l } = e, { queue_size: o } = e, { status: w } = e, { scroll_to_output: x = !1 } = e, { timer: C = !0 } = e, { show_progress: S = "full" } = e, { message: T = null } = e, { progress: D = null } = e, { variant: F = "default" } = e, { loading_text: f = "Loading..." } = e, { absolute: E = !0 } = e, { translucent: v = !1 } = e, { border: p = !1 } = e, { autoscroll: d } = e, g, m = !1, y = 0, L = 0, b = null, P = null, j = 0, re = null, X, Q = null, q = !0;
  const ie = () => {
    n(0, u = n(27, b = n(19, K = null))), n(25, y = performance.now()), n(26, L = 0), m = !0, O();
  };
  function O() {
    requestAnimationFrame(() => {
      n(26, L = (performance.now() - y) / 1e3), m && O();
    });
  }
  function G() {
    n(26, L = 0), n(0, u = n(27, b = n(19, K = null))), m && (m = !1);
  }
  onDestroy(() => {
    m && G();
  });
  let K = null;
  function M(k) {
    binding_callbacks$1[k ? "unshift" : "push"](() => {
      Q = k, n(16, Q), n(7, D), n(14, re), n(15, X);
    });
  }
  const _ = () => {
    s("clear_status");
  };
  function A(k) {
    binding_callbacks$1[k ? "unshift" : "push"](() => {
      g = k, n(13, g);
    });
  }
  return r.$$set = (k) => {
    "i18n" in k && n(1, h = k.i18n), "eta" in k && n(0, u = k.eta), "queue_position" in k && n(2, l = k.queue_position), "queue_size" in k && n(3, o = k.queue_size), "status" in k && n(4, w = k.status), "scroll_to_output" in k && n(22, x = k.scroll_to_output), "timer" in k && n(5, C = k.timer), "show_progress" in k && n(6, S = k.show_progress), "message" in k && n(23, T = k.message), "progress" in k && n(7, D = k.progress), "variant" in k && n(8, F = k.variant), "loading_text" in k && n(9, f = k.loading_text), "absolute" in k && n(10, E = k.absolute), "translucent" in k && n(11, v = k.translucent), "border" in k && n(12, p = k.border), "autoscroll" in k && n(24, d = k.autoscroll), "$$scope" in k && n(29, a = k.$$scope);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    436207617 && (u === null && n(0, u = b), u != null && b !== u && (n(28, P = (performance.now() - y) / 1e3 + u), n(19, K = P.toFixed(1)), n(27, b = u))), r.$$.dirty[0] & /*eta_from_start, timer_diff*/
    335544320 && n(17, j = P === null || P <= 0 || !L ? null : Math.min(L / P, 1)), r.$$.dirty[0] & /*progress*/
    128 && D != null && n(18, q = !1), r.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (D != null ? n(14, re = D.map((k) => {
      if (k.index != null && k.length != null)
        return k.index / k.length;
      if (k.progress != null)
        return k.progress;
    })) : n(14, re = null), re ? (n(15, X = re[re.length - 1]), Q && (X === 0 ? n(16, Q.style.transition = "0", Q) : n(16, Q.style.transition = "150ms", Q))) : n(15, X = void 0)), r.$$.dirty[0] & /*status*/
    16 && (w === "pending" ? ie() : G()), r.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && g && x && (w === "pending" || w === "complete") && scroll_into_view(g, d), r.$$.dirty[0] & /*status, message*/
    8388624, r.$$.dirty[0] & /*timer_diff*/
    67108864 && n(20, t = L.toFixed(1));
  }, [
    u,
    h,
    l,
    o,
    w,
    C,
    S,
    D,
    F,
    f,
    E,
    v,
    p,
    g,
    re,
    X,
    Q,
    j,
    q,
    K,
    t,
    s,
    x,
    T,
    d,
    y,
    L,
    b,
    P,
    a,
    i,
    M,
    _,
    A
  ];
}
class Static extends SvelteComponent$1 {
  constructor(e) {
    super(), init$1(
      this,
      e,
      instance$1,
      create_fragment$1,
      safe_not_equal$1,
      {
        i18n: 1,
        eta: 0,
        queue_position: 2,
        queue_size: 3,
        status: 4,
        scroll_to_output: 22,
        timer: 5,
        show_progress: 6,
        message: 23,
        progress: 7,
        variant: 8,
        loading_text: 9,
        absolute: 10,
        translucent: 11,
        border: 12,
        autoscroll: 24
      },
      null,
      [-1, -1]
    );
  }
}
/*! @license DOMPurify 3.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, n, t) {
  return e.apply(n, t);
});
construct || (construct = function(e, n) {
  return new e(...n);
});
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(r) {
  return function(e) {
    for (var n = arguments.length, t = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
      t[i - 1] = arguments[i];
    return apply(r, e, t);
  };
}
function unconstruct(r) {
  return function() {
    for (var e = arguments.length, n = new Array(e), t = 0; t < e; t++)
      n[t] = arguments[t];
    return construct(r, n);
  };
}
function addToSet(r, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
  setPrototypeOf && setPrototypeOf(r, null);
  let t = e.length;
  for (; t--; ) {
    let i = e[t];
    if (typeof i == "string") {
      const a = n(i);
      a !== i && (isFrozen(e) || (e[t] = a), i = a);
    }
    r[i] = !0;
  }
  return r;
}
function cleanArray(r) {
  for (let e = 0; e < r.length; e++)
    objectHasOwnProperty(r, e) || (r[e] = null);
  return r;
}
function clone(r) {
  const e = create(null);
  for (const [n, t] of entries(r))
    objectHasOwnProperty(r, n) && (Array.isArray(t) ? e[n] = cleanArray(t) : t && typeof t == "object" && t.constructor === Object ? e[n] = clone(t) : e[n] = t);
  return e;
}
function lookupGetter(r, e) {
  for (; r !== null; ) {
    const t = getOwnPropertyDescriptor(r, e);
    if (t) {
      if (t.get)
        return unapply(t.get);
      if (typeof t.value == "function")
        return unapply(t.value);
    }
    r = getPrototypeOf(r);
  }
  function n() {
    return null;
  }
  return n;
}
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$1 = 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 r() {
  return typeof window > "u" ? null : window;
}, _createTrustedTypesPolicy = function r(e, n) {
  if (typeof e != "object" || typeof e.createPolicy != "function")
    return null;
  let t = null;
  const i = "data-tt-policy-suffix";
  n && n.hasAttribute(i) && (t = n.getAttribute(i));
  const a = "dompurify" + (t ? "#" + t : "");
  try {
    return e.createPolicy(a, {
      createHTML(s) {
        return s;
      },
      createScriptURL(s) {
        return s;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + a + " could not be created."), null;
  }
};
function createDOMPurify() {
  let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
  const e = (Ne) => createDOMPurify(Ne);
  if (e.version = "3.1.7", e.removed = [], !r || !r.document || r.document.nodeType !== NODE_TYPE.document)
    return e.isSupported = !1, e;
  let {
    document: n
  } = r;
  const t = n, i = t.currentScript, {
    DocumentFragment: a,
    HTMLTemplateElement: s,
    Node: h,
    Element: u,
    NodeFilter: l,
    NamedNodeMap: o = r.NamedNodeMap || r.MozNamedAttrMap,
    HTMLFormElement: w,
    DOMParser: x,
    trustedTypes: C
  } = r, S = u.prototype, T = lookupGetter(S, "cloneNode"), D = lookupGetter(S, "remove"), F = lookupGetter(S, "nextSibling"), f = lookupGetter(S, "childNodes"), E = lookupGetter(S, "parentNode");
  if (typeof s == "function") {
    const Ne = n.createElement("template");
    Ne.content && Ne.content.ownerDocument && (n = Ne.content.ownerDocument);
  }
  let v, p = "";
  const {
    implementation: d,
    createNodeIterator: g,
    createDocumentFragment: m,
    getElementsByTagName: y
  } = n, {
    importNode: L
  } = t;
  let b = {};
  e.isSupported = typeof entries == "function" && typeof E == "function" && d && d.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: P,
    ERB_EXPR: j,
    TMPLIT_EXPR: re,
    DATA_ATTR: X,
    ARIA_ATTR: Q,
    IS_SCRIPT_OR_DATA: q,
    ATTR_WHITESPACE: ie,
    CUSTOM_ELEMENT: O
  } = EXPRESSIONS;
  let {
    IS_ALLOWED_URI: G
  } = EXPRESSIONS, K = null;
  const M = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text$1]);
  let _ = null;
  const A = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
  let k = 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
    }
  })), N = null, $ = null, z = !0, B = !0, Y = !1, ce = !0, de = !1, me = !0, Ae = !1, _e = !1, te = !1, se = !1, R = !1, H = !1, J = !0, ae = !1;
  const be = "user-content-";
  let we = !0, Ee = !1, ee = {}, Fe = null;
  const ke = 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 We = null;
  const He = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
  let Ze = null;
  const Me = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Ue = "http://www.w3.org/1998/Math/MathML", Ye = "http://www.w3.org/2000/svg", Je = "http://www.w3.org/1999/xhtml";
  let ye = Je, oe = !1, ue = null;
  const Pe = addToSet({}, [Ue, Ye, Je], stringToString);
  let Xe = null;
  const Ke = ["application/xhtml+xml", "text/html"], W = "text/html";
  let pe = null, De = null;
  const $e = n.createElement("form"), Be = function(ne) {
    return ne instanceof RegExp || ne instanceof Function;
  }, xe = function() {
    let ne = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(De && De === ne)) {
      if ((!ne || typeof ne != "object") && (ne = {}), ne = clone(ne), Xe = // eslint-disable-next-line unicorn/prefer-includes
      Ke.indexOf(ne.PARSER_MEDIA_TYPE) === -1 ? W : ne.PARSER_MEDIA_TYPE, pe = Xe === "application/xhtml+xml" ? stringToString : stringToLowerCase, K = objectHasOwnProperty(ne, "ALLOWED_TAGS") ? addToSet({}, ne.ALLOWED_TAGS, pe) : M, _ = objectHasOwnProperty(ne, "ALLOWED_ATTR") ? addToSet({}, ne.ALLOWED_ATTR, pe) : A, ue = objectHasOwnProperty(ne, "ALLOWED_NAMESPACES") ? addToSet({}, ne.ALLOWED_NAMESPACES, stringToString) : Pe, Ze = objectHasOwnProperty(ne, "ADD_URI_SAFE_ATTR") ? addToSet(
        clone(Me),
        // eslint-disable-line indent
        ne.ADD_URI_SAFE_ATTR,
        // eslint-disable-line indent
        pe
        // eslint-disable-line indent
      ) : Me, We = objectHasOwnProperty(ne, "ADD_DATA_URI_TAGS") ? addToSet(
        clone(He),
        // eslint-disable-line indent
        ne.ADD_DATA_URI_TAGS,
        // eslint-disable-line indent
        pe
        // eslint-disable-line indent
      ) : He, Fe = objectHasOwnProperty(ne, "FORBID_CONTENTS") ? addToSet({}, ne.FORBID_CONTENTS, pe) : ke, N = objectHasOwnProperty(ne, "FORBID_TAGS") ? addToSet({}, ne.FORBID_TAGS, pe) : {}, $ = objectHasOwnProperty(ne, "FORBID_ATTR") ? addToSet({}, ne.FORBID_ATTR, pe) : {}, ee = objectHasOwnProperty(ne, "USE_PROFILES") ? ne.USE_PROFILES : !1, z = ne.ALLOW_ARIA_ATTR !== !1, B = ne.ALLOW_DATA_ATTR !== !1, Y = ne.ALLOW_UNKNOWN_PROTOCOLS || !1, ce = ne.ALLOW_SELF_CLOSE_IN_ATTR !== !1, de = ne.SAFE_FOR_TEMPLATES || !1, me = ne.SAFE_FOR_XML !== !1, Ae = ne.WHOLE_DOCUMENT || !1, se = ne.RETURN_DOM || !1, R = ne.RETURN_DOM_FRAGMENT || !1, H = ne.RETURN_TRUSTED_TYPE || !1, te = ne.FORCE_BODY || !1, J = ne.SANITIZE_DOM !== !1, ae = ne.SANITIZE_NAMED_PROPS || !1, we = ne.KEEP_CONTENT !== !1, Ee = ne.IN_PLACE || !1, G = ne.ALLOWED_URI_REGEXP || IS_ALLOWED_URI, ye = ne.NAMESPACE || Je, k = ne.CUSTOM_ELEMENT_HANDLING || {}, ne.CUSTOM_ELEMENT_HANDLING && Be(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (k.tagNameCheck = ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck), ne.CUSTOM_ELEMENT_HANDLING && Be(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (k.attributeNameCheck = ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), ne.CUSTOM_ELEMENT_HANDLING && typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (k.allowCustomizedBuiltInElements = ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), de && (B = !1), R && (se = !0), ee && (K = addToSet({}, text$1), _ = [], ee.html === !0 && (addToSet(K, html$1), addToSet(_, html)), ee.svg === !0 && (addToSet(K, svg$1), addToSet(_, svg), addToSet(_, xml)), ee.svgFilters === !0 && (addToSet(K, svgFilters), addToSet(_, svg), addToSet(_, xml)), ee.mathMl === !0 && (addToSet(K, mathMl$1), addToSet(_, mathMl), addToSet(_, xml))), ne.ADD_TAGS && (K === M && (K = clone(K)), addToSet(K, ne.ADD_TAGS, pe)), ne.ADD_ATTR && (_ === A && (_ = clone(_)), addToSet(_, ne.ADD_ATTR, pe)), ne.ADD_URI_SAFE_ATTR && addToSet(Ze, ne.ADD_URI_SAFE_ATTR, pe), ne.FORBID_CONTENTS && (Fe === ke && (Fe = clone(Fe)), addToSet(Fe, ne.FORBID_CONTENTS, pe)), we && (K["#text"] = !0), Ae && addToSet(K, ["html", "head", "body"]), K.table && (addToSet(K, ["tbody"]), delete N.tbody), ne.TRUSTED_TYPES_POLICY) {
        if (typeof ne.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof ne.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        v = ne.TRUSTED_TYPES_POLICY, p = v.createHTML("");
      } else
        v === void 0 && (v = _createTrustedTypesPolicy(C, i)), v !== null && typeof p == "string" && (p = v.createHTML(""));
      freeze && freeze(ne), De = ne;
    }
  }, U = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]), I = addToSet({}, ["annotation-xml"]), V = addToSet({}, ["title", "style", "font", "a", "script"]), fe = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]), ge = addToSet({}, [...mathMl$1, ...mathMlDisallowed]), ve = function(ne) {
    let Te = E(ne);
    (!Te || !Te.tagName) && (Te = {
      namespaceURI: ye,
      tagName: "template"
    });
    const ze = stringToLowerCase(ne.tagName), tt = stringToLowerCase(Te.tagName);
    return ue[ne.namespaceURI] ? ne.namespaceURI === Ye ? Te.namespaceURI === Je ? ze === "svg" : Te.namespaceURI === Ue ? ze === "svg" && (tt === "annotation-xml" || U[tt]) : !!fe[ze] : ne.namespaceURI === Ue ? Te.namespaceURI === Je ? ze === "math" : Te.namespaceURI === Ye ? ze === "math" && I[tt] : !!ge[ze] : ne.namespaceURI === Je ? Te.namespaceURI === Ye && !I[tt] || Te.namespaceURI === Ue && !U[tt] ? !1 : !ge[ze] && (V[ze] || !fe[ze]) : !!(Xe === "application/xhtml+xml" && ue[ne.namespaceURI]) : !1;
  }, Se = function(ne) {
    arrayPush(e.removed, {
      element: ne
    });
    try {
      E(ne).removeChild(ne);
    } catch {
      D(ne);
    }
  }, Le = function(ne, Te) {
    try {
      arrayPush(e.removed, {
        attribute: Te.getAttributeNode(ne),
        from: Te
      });
    } catch {
      arrayPush(e.removed, {
        attribute: null,
        from: Te
      });
    }
    if (Te.removeAttribute(ne), ne === "is" && !_[ne])
      if (se || R)
        try {
          Se(Te);
        } catch {
        }
      else
        try {
          Te.setAttribute(ne, "");
        } catch {
        }
  }, Ie = function(ne) {
    let Te = null, ze = null;
    if (te)
      ne = "<remove></remove>" + ne;
    else {
      const it = stringMatch(ne, /^[\r\n\t ]+/);
      ze = it && it[0];
    }
    Xe === "application/xhtml+xml" && ye === Je && (ne = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + ne + "</body></html>");
    const tt = v ? v.createHTML(ne) : ne;
    if (ye === Je)
      try {
        Te = new x().parseFromString(tt, Xe);
      } catch {
      }
    if (!Te || !Te.documentElement) {
      Te = d.createDocument(ye, "template", null);
      try {
        Te.documentElement.innerHTML = oe ? p : tt;
      } catch {
      }
    }
    const st = Te.body || Te.documentElement;
    return ne && ze && st.insertBefore(n.createTextNode(ze), st.childNodes[0] || null), ye === Je ? y.call(Te, Ae ? "html" : "body")[0] : Ae ? Te.documentElement : st;
  }, Ce = function(ne) {
    return g.call(
      ne.ownerDocument || ne,
      ne,
      // eslint-disable-next-line no-bitwise
      l.SHOW_ELEMENT | l.SHOW_COMMENT | l.SHOW_TEXT | l.SHOW_PROCESSING_INSTRUCTION | l.SHOW_CDATA_SECTION,
      null
    );
  }, Ge = function(ne) {
    return ne instanceof w && (typeof ne.nodeName != "string" || typeof ne.textContent != "string" || typeof ne.removeChild != "function" || !(ne.attributes instanceof o) || typeof ne.removeAttribute != "function" || typeof ne.setAttribute != "function" || typeof ne.namespaceURI != "string" || typeof ne.insertBefore != "function" || typeof ne.hasChildNodes != "function");
  }, Oe = function(ne) {
    return typeof h == "function" && ne instanceof h;
  }, Re = function(ne, Te, ze) {
    b[ne] && arrayForEach(b[ne], (tt) => {
      tt.call(e, Te, ze, De);
    });
  }, je = function(ne) {
    let Te = null;
    if (Re("beforeSanitizeElements", ne, null), Ge(ne))
      return Se(ne), !0;
    const ze = pe(ne.nodeName);
    if (Re("uponSanitizeElement", ne, {
      tagName: ze,
      allowedTags: K
    }), ne.hasChildNodes() && !Oe(ne.firstElementChild) && regExpTest(/<[/\w]/g, ne.innerHTML) && regExpTest(/<[/\w]/g, ne.textContent) || ne.nodeType === NODE_TYPE.progressingInstruction || me && ne.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, ne.data))
      return Se(ne), !0;
    if (!K[ze] || N[ze]) {
      if (!N[ze] && Qe(ze) && (k.tagNameCheck instanceof RegExp && regExpTest(k.tagNameCheck, ze) || k.tagNameCheck instanceof Function && k.tagNameCheck(ze)))
        return !1;
      if (we && !Fe[ze]) {
        const tt = E(ne) || ne.parentNode, st = f(ne) || ne.childNodes;
        if (st && tt) {
          const it = st.length;
          for (let at = it - 1; at >= 0; --at) {
            const lt = T(st[at], !0);
            lt.__removalCount = (ne.__removalCount || 0) + 1, tt.insertBefore(lt, F(ne));
          }
        }
      }
      return Se(ne), !0;
    }
    return ne instanceof u && !ve(ne) || (ze === "noscript" || ze === "noembed" || ze === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, ne.innerHTML) ? (Se(ne), !0) : (de && ne.nodeType === NODE_TYPE.text && (Te = ne.textContent, arrayForEach([P, j, re], (tt) => {
      Te = stringReplace(Te, tt, " ");
    }), ne.textContent !== Te && (arrayPush(e.removed, {
      element: ne.cloneNode()
    }), ne.textContent = Te)), Re("afterSanitizeElements", ne, null), !1);
  }, Ve = function(ne, Te, ze) {
    if (J && (Te === "id" || Te === "name") && (ze in n || ze in $e))
      return !1;
    if (!(B && !$[Te] && regExpTest(X, Te))) {
      if (!(z && regExpTest(Q, Te))) {
        if (!_[Te] || $[Te]) {
          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
            !(Qe(ne) && (k.tagNameCheck instanceof RegExp && regExpTest(k.tagNameCheck, ne) || k.tagNameCheck instanceof Function && k.tagNameCheck(ne)) && (k.attributeNameCheck instanceof RegExp && regExpTest(k.attributeNameCheck, Te) || k.attributeNameCheck instanceof Function && k.attributeNameCheck(Te)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            Te === "is" && k.allowCustomizedBuiltInElements && (k.tagNameCheck instanceof RegExp && regExpTest(k.tagNameCheck, ze) || k.tagNameCheck instanceof Function && k.tagNameCheck(ze)))
          ) return !1;
        } else if (!Ze[Te]) {
          if (!regExpTest(G, stringReplace(ze, ie, ""))) {
            if (!((Te === "src" || Te === "xlink:href" || Te === "href") && ne !== "script" && stringIndexOf(ze, "data:") === 0 && We[ne])) {
              if (!(Y && !regExpTest(q, stringReplace(ze, ie, "")))) {
                if (ze)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, Qe = function(ne) {
    return ne !== "annotation-xml" && stringMatch(ne, O);
  }, et = function(ne) {
    Re("beforeSanitizeAttributes", ne, null);
    const {
      attributes: Te
    } = ne;
    if (!Te)
      return;
    const ze = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: _
    };
    let tt = Te.length;
    for (; tt--; ) {
      const st = Te[tt], {
        name: it,
        namespaceURI: at,
        value: lt
      } = st, _t = pe(it);
      let rt = it === "value" ? lt : stringTrim(lt);
      if (ze.attrName = _t, ze.attrValue = rt, ze.keepAttr = !0, ze.forceKeepAttr = void 0, Re("uponSanitizeAttribute", ne, ze), rt = ze.attrValue, ze.forceKeepAttr || (Le(it, ne), !ze.keepAttr))
        continue;
      if (!ce && regExpTest(/\/>/i, rt)) {
        Le(it, ne);
        continue;
      }
      de && arrayForEach([P, j, re], (Sn) => {
        rt = stringReplace(rt, Sn, " ");
      });
      const wn = pe(ne.nodeName);
      if (Ve(wn, _t, rt)) {
        if (ae && (_t === "id" || _t === "name") && (Le(it, ne), rt = be + rt), me && regExpTest(/((--!?|])>)|<\/(style|title)/i, rt)) {
          Le(it, ne);
          continue;
        }
        if (v && typeof C == "object" && typeof C.getAttributeType == "function" && !at)
          switch (C.getAttributeType(wn, _t)) {
            case "TrustedHTML": {
              rt = v.createHTML(rt);
              break;
            }
            case "TrustedScriptURL": {
              rt = v.createScriptURL(rt);
              break;
            }
          }
        try {
          at ? ne.setAttributeNS(at, it, rt) : ne.setAttribute(it, rt), Ge(ne) ? Se(ne) : arrayPop(e.removed);
        } catch {
        }
      }
    }
    Re("afterSanitizeAttributes", ne, null);
  }, nt = function Ne(ne) {
    let Te = null;
    const ze = Ce(ne);
    for (Re("beforeSanitizeShadowDOM", ne, null); Te = ze.nextNode(); )
      Re("uponSanitizeShadowNode", Te, null), !je(Te) && (Te.content instanceof a && Ne(Te.content), et(Te));
    Re("afterSanitizeShadowDOM", ne, null);
  };
  return e.sanitize = function(Ne) {
    let ne = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Te = null, ze = null, tt = null, st = null;
    if (oe = !Ne, oe && (Ne = "<!-->"), typeof Ne != "string" && !Oe(Ne))
      if (typeof Ne.toString == "function") {
        if (Ne = Ne.toString(), typeof Ne != "string")
          throw typeErrorCreate("dirty is not a string, aborting");
      } else
        throw typeErrorCreate("toString is not a function");
    if (!e.isSupported)
      return Ne;
    if (_e || xe(ne), e.removed = [], typeof Ne == "string" && (Ee = !1), Ee) {
      if (Ne.nodeName) {
        const lt = pe(Ne.nodeName);
        if (!K[lt] || N[lt])
          throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (Ne instanceof h)
      Te = Ie("<!---->"), ze = Te.ownerDocument.importNode(Ne, !0), ze.nodeType === NODE_TYPE.element && ze.nodeName === "BODY" || ze.nodeName === "HTML" ? Te = ze : Te.appendChild(ze);
    else {
      if (!se && !de && !Ae && // eslint-disable-next-line unicorn/prefer-includes
      Ne.indexOf("<") === -1)
        return v && H ? v.createHTML(Ne) : Ne;
      if (Te = Ie(Ne), !Te)
        return se ? null : H ? p : "";
    }
    Te && te && Se(Te.firstChild);
    const it = Ce(Ee ? Ne : Te);
    for (; tt = it.nextNode(); )
      je(tt) || (tt.content instanceof a && nt(tt.content), et(tt));
    if (Ee)
      return Ne;
    if (se) {
      if (R)
        for (st = m.call(Te.ownerDocument); Te.firstChild; )
          st.appendChild(Te.firstChild);
      else
        st = Te;
      return (_.shadowroot || _.shadowrootmode) && (st = L.call(t, st, !0)), st;
    }
    let at = Ae ? Te.outerHTML : Te.innerHTML;
    return Ae && K["!doctype"] && Te.ownerDocument && Te.ownerDocument.doctype && Te.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, Te.ownerDocument.doctype.name) && (at = "<!DOCTYPE " + Te.ownerDocument.doctype.name + `>
` + at), de && arrayForEach([P, j, re], (lt) => {
      at = stringReplace(at, lt, " ");
    }), v && H ? v.createHTML(at) : at;
  }, e.setConfig = function() {
    let Ne = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    xe(Ne), _e = !0;
  }, e.clearConfig = function() {
    De = null, _e = !1;
  }, e.isValidAttribute = function(Ne, ne, Te) {
    De || xe({});
    const ze = pe(Ne), tt = pe(ne);
    return Ve(ze, tt, Te);
  }, e.addHook = function(Ne, ne) {
    typeof ne == "function" && (b[Ne] = b[Ne] || [], arrayPush(b[Ne], ne));
  }, e.removeHook = function(Ne) {
    if (b[Ne])
      return arrayPop(b[Ne]);
  }, e.removeHooks = function(Ne) {
    b[Ne] && (b[Ne] = []);
  }, e.removeAllHooks = function() {
    b = {};
  }, e;
}
createDOMPurify();
const {
  SvelteComponent,
  append,
  assign,
  attr,
  binding_callbacks,
  check_outros,
  create_component,
  destroy_component,
  detach,
  element,
  flush,
  get_spread_object,
  get_spread_update,
  group_outros,
  init,
  insert,
  listen,
  mount_component,
  noop,
  safe_not_equal,
  set_data,
  set_style,
  space,
  text,
  transition_in,
  transition_out
} = window.__gradio__svelte__internal, { tick } = window.__gradio__svelte__internal;
function create_if_block_4(r) {
  let e, n;
  const t = [
    {
      autoscroll: (
        /*gradio*/
        r[10].autoscroll
      )
    },
    { i18n: (
      /*gradio*/
      r[10].i18n
    ) },
    /*loading_status*/
    r[6]
  ];
  let i = {};
  for (let a = 0; a < t.length; a += 1)
    i = assign(i, t[a]);
  return e = new Static({ props: i }), {
    c() {
      create_component(e.$$.fragment);
    },
    m(a, s) {
      mount_component(e, a, s), n = !0;
    },
    p(a, s) {
      const h = s[0] & /*gradio, loading_status*/
      1088 ? get_spread_update(t, [
        s[0] & /*gradio*/
        1024 && {
          autoscroll: (
            /*gradio*/
            a[10].autoscroll
          )
        },
        s[0] & /*gradio*/
        1024 && { i18n: (
          /*gradio*/
          a[10].i18n
        ) },
        s[0] & /*loading_status*/
        64 && get_spread_object(
          /*loading_status*/
          a[6]
        )
      ]) : {};
      e.$set(h);
    },
    i(a) {
      n || (transition_in(e.$$.fragment, a), n = !0);
    },
    o(a) {
      transition_out(e.$$.fragment, a), n = !1;
    },
    d(a) {
      destroy_component(e, a);
    }
  };
}
function create_if_block_3(r) {
  let e, n, t;
  return {
    c() {
      e = element("button"), e.innerHTML = '<svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><polygon points="12.4,3.8 5.6,9 12.4,14.2" stroke_linejoin="round" stroke_linecap="round"></polygon></svg>', attr(e, "class", "left-arrow");
    },
    m(i, a) {
      insert(i, e, a), n || (t = listen(
        e,
        "click",
        /*previous_file*/
        r[14]
      ), n = !0);
    },
    p: noop,
    d(i) {
      i && detach(e), n = !1, t();
    }
  };
}
function create_if_block_2(r) {
  let e, n, t = (
    /*value*/
    r[4].orig_name + ""
  ), i, a;
  return {
    c() {
      e = element("span"), n = text("   "), i = text(t), a = text("   "), attr(e, "class", "file-name");
    },
    m(s, h) {
      insert(s, e, h), append(e, n), append(e, i), append(e, a);
    },
    p(s, h) {
      h[0] & /*value*/
      16 && t !== (t = /*value*/
      s[4].orig_name + "") && set_data(i, t);
    },
    d(s) {
      s && detach(e);
    }
  };
}
function create_if_block_1(r) {
  let e, n, t = (
    /*value*/
    r[4][
      /*n*/
      r[0]
    ].orig_name + ""
  ), i, a;
  return {
    c() {
      e = element("span"), n = text("   "), i = text(t), a = text("   "), attr(e, "class", "file-name");
    },
    m(s, h) {
      insert(s, e, h), append(e, n), append(e, i), append(e, a);
    },
    p(s, h) {
      h[0] & /*value, n*/
      17 && t !== (t = /*value*/
      s[4][
        /*n*/
        s[0]
      ].orig_name + "") && set_data(i, t);
    },
    d(s) {
      s && detach(e);
    }
  };
}
function create_if_block(r) {
  let e, n, t;
  return {
    c() {
      e = element("button"), e.innerHTML = '<svg width="18" height="18" viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg"><polygon points="5.6,3.8 12.4,9 5.6,14.2" stroke_linejoin="round" stroke_linecap="round"></polygon></svg>', attr(e, "class", "right-arrow");
    },
    m(i, a) {
      insert(i, e, a), n || (t = listen(
        e,
        "click",
        /*next_file*/
        r[13]
      ), n = !0);
    },
    p: noop,
    d(i) {
      i && detach(e), n = !1, t();
    }
  };
}
function create_default_slot(r) {
  let e, n, t, i, a, s, h, u, l, o = Array.isArray(
    /*value*/
    r[4]
  ) && /*value*/
  r[4].length > 1, w, x, C, S = Array.isArray(
    /*value*/
    r[4]
  ) && /*value*/
  r[4].length > 1, T, D, F, f = (
    /*loading_status*/
    r[6] && create_if_block_4(r)
  );
  n = new BlockLabel({
    props: {
      show_label: !1,
      Icon: File_1,
      float: 1,
      label: null
    }
  });
  let E = o && create_if_block_3(r);
  function v(m, y) {
    if (y[0] & /*value*/
    16 && (x = null), x == null && (x = !!(Array.isArray(
      /*value*/
      m[4]
    ) && /*value*/
    m[4].length > 0)), x) return create_if_block_1;
    if (typeof /*value*/
    m[4] == "string") return create_if_block_2;
  }
  let p = v(r, [-1, -1]), d = p && p(r), g = S && create_if_block(r);
  return {
    c() {
      f && f.c(), e = space(), create_component(n.$$.fragment), t = space(), i = element("div"), a = element("div"), a.innerHTML = "<span>·</span><span>·</span><span>·</span>", s = space(), h = element("div"), u = space(), l = element("div"), E && E.c(), w = space(), d && d.c(), C = space(), g && g.c(), T = space(), D = element("style"), D.textContent = `:root {
			--neo-blue: rgb(0, 162, 223);
			--neo-white: rgb(255, 255, 255);
			--neo-black: rgb(5, 5, 5);
			--neo-dark-grey: rgb(64, 64, 64);
            --neo-light-grey: rgb(212,212,212);
		}
		.viewer-container {
			position: relative;
			overflow: hidden;
			height: 100%;
			width: 100%;
			display: flex;
			flex-direction: column;
		}
		.viewer {
			display: flex;
			flex-direction: column;
			width: 100%;
			height: 100%;
			overflow: auto;
		}
		.error-message {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			text-align: center;
		}
		.viewer canvas {
			margin: .1vh 0;
		}
		.button-row {
			display: flex;
			flex-direction: row;
			width: 100%;
			justify-content: center;
			align-items: center;
		}
		.file-name {
			max-width: 90%;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
		.viewer-blinker {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			color: var(--neo-blue);
			animation: blinker 1.5s cubic-bezier(.5, 0, 1, 1) infinite alternate;
			font-size: 3em;
		}
		.viewer-blinker span {
			opacity: 0;
			animation-name: blinker;
			animation-duration: 1.5s;
			animation-timing-function: cubic-bezier(.5, 0, 1, 1);
			animation-iteration-count: infinite;
		}
		.viewer-blinker span:nth-child(1) {
			animation-delay: 0s;
		}
		.viewer-blinker span:nth-child(2) {
			animation-delay: .5s; /* Délai pour le deuxième point */
		}
		.viewer-blinker span:nth-child(3) {
			animation-delay: 1s; /* Délai pour le troisième point */
		}
		@keyframes blinker {  
			0%, 100% { opacity: 0; }
			50% { opacity: 1; }
		}
		.left-arrow {
			mask-image: var(--left-arrow);
			webkit-mask-image: var(--left-arrow);
			width: 18px;
			height: 18px;
		}
		.right-arrow {
			mask: var(--right-arrow);
			webkit-mask: var(--right-arrow);
		}
		.left-arrow polygon, .right-arrow polygon {
			fill: var(--neo-light-grey);
			stroke: var(--neo-light-grey);
			stroke-width: 1.5;
		}
		.dark .left-arrow polygon, .dark .right-arrow polygon {
		stroke: var(--neo-dark-grey);
		fill: var(--neo-dark-grey);
		stroke-width: 1.5;
		}`, attr(a, "class", "viewer-blinker"), set_style(a, "display", "none"), attr(h, "class", "viewer"), attr(l, "class", "button-row"), attr(i, "class", "viewer-container");
    },
    m(m, y) {
      f && f.m(m, y), insert(m, e, y), mount_component(n, m, y), insert(m, t, y), insert(m, i, y), append(i, a), r[27](a), append(i, s), append(i, h), r[28](h), append(i, u), append(i, l), E && E.m(l, null), append(l, w), d && d.m(l, null), append(l, C), g && g.m(l, null), insert(m, T, y), insert(m, D, y), F = !0;
    },
    p(m, y) {
      /*loading_status*/
      m[6] ? f ? (f.p(m, y), y[0] & /*loading_status*/
      64 && transition_in(f, 1)) : (f = create_if_block_4(m), f.c(), transition_in(f, 1), f.m(e.parentNode, e)) : f && (group_outros(), transition_out(f, 1, 1, () => {
        f = null;
      }), check_outros()), y[0] & /*value*/
      16 && (o = Array.isArray(
        /*value*/
        m[4]
      ) && /*value*/
      m[4].length > 1), o ? E ? E.p(m, y) : (E = create_if_block_3(m), E.c(), E.m(l, w)) : E && (E.d(1), E = null), p === (p = v(m, y)) && d ? d.p(m, y) : (d && d.d(1), d = p && p(m), d && (d.c(), d.m(l, C))), y[0] & /*value*/
      16 && (S = Array.isArray(
        /*value*/
        m[4]
      ) && /*value*/
      m[4].length > 1), S ? g ? g.p(m, y) : (g = create_if_block(m), g.c(), g.m(l, null)) : g && (g.d(1), g = null);
    },
    i(m) {
      F || (transition_in(f), transition_in(n.$$.fragment, m), F = !0);
    },
    o(m) {
      transition_out(f), transition_out(n.$$.fragment, m), F = !1;
    },
    d(m) {
      m && (detach(e), detach(t), detach(i), detach(T), detach(D)), f && f.d(m), destroy_component(n, m), r[27](null), r[28](null), E && E.d(), d && d.d(), g && g.d();
    }
  };
}
function create_fragment(r) {
  let e, n;
  return e = new Block({
    props: {
      visible: (
        /*visible*/
        r[3]
      ),
      elem_id: (
        /*elem_id*/
        r[1]
      ),
      elem_classes: (
        /*elem_classes*/
        r[2]
      ),
      container: (
        /*container*/
        r[7]
      ),
      scale: (
        /*scale*/
        r[8]
      ),
      min_width: (
        /*min_width*/
        r[9]
      ),
      height: (
        /*height*/
        r[5]
      ),
      $$slots: { default: [create_default_slot] },
      $$scope: { ctx: r }
    }
  }), {
    c() {
      create_component(e.$$.fragment);
    },
    m(t, i) {
      mount_component(e, t, i), n = !0;
    },
    p(t, i) {
      const a = {};
      i[0] & /*visible*/
      8 && (a.visible = /*visible*/
      t[3]), i[0] & /*elem_id*/
      2 && (a.elem_id = /*elem_id*/
      t[1]), i[0] & /*elem_classes*/
      4 && (a.elem_classes = /*elem_classes*/
      t[2]), i[0] & /*container*/
      128 && (a.container = /*container*/
      t[7]), i[0] & /*scale*/
      256 && (a.scale = /*scale*/
      t[8]), i[0] & /*min_width*/
      512 && (a.min_width = /*min_width*/
      t[9]), i[0] & /*height*/
      32 && (a.height = /*height*/
      t[5]), i[0] & /*value, n, viewer, blinking, gradio, loading_status*/
      7249 | i[1] & /*$$scope*/
      4096 && (a.$$scope = { dirty: i, ctx: t }), e.$set(a);
    },
    i(t) {
      n || (transition_in(e.$$.fragment, t), n = !0);
    },
    o(t) {
      transition_out(e.$$.fragment, t), n = !1;
    },
    d(t) {
      destroy_component(e, t);
    }
  };
}
function addUrl(r, e) {
  return r && (r.url = e + "/file=" + r.path), r;
}
function instance(r, e, n) {
  var t = this && this.__awaiter || function(B, Y, ce, de) {
    function me(Ae) {
      return Ae instanceof ce ? Ae : new ce(function(_e) {
        _e(Ae);
      });
    }
    return new (ce || (ce = Promise))(function(Ae, _e) {
      function te(H) {
        try {
          R(de.next(H));
        } catch (J) {
          _e(J);
        }
      }
      function se(H) {
        try {
          R(de.throw(H));
        } catch (J) {
          _e(J);
        }
      }
      function R(H) {
        H.done ? Ae(H.value) : me(H.value).then(te, se);
      }
      R((de = de.apply(B, Y || [])).next());
    });
  };
  pdfExports.GlobalWorkerOptions.workerSrc = "https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.worker.min.js";
  let { elem_id: i = "" } = e, { elem_classes: a = [] } = e, { visible: s = !0 } = e, { value: h } = e, { n: u } = e, { libre_office: l } = e, { ms_files: o } = e, { max_size: w } = e, { interface_language: x = "fr" } = e, { interactive: C = !1 } = e, { root: S } = e, { label: T = null } = e, { show_label: D = !1 } = e, { height: F } = e, { _selectable: f = !1 } = e, { loading_status: E } = e, { container: v = !0 } = e, { scale: p = null } = e, { min_width: d = void 0 } = e, { gradio: g } = e, m, y = null, L = new AbortController(), b, P;
  function j(B, Y) {
    let ce;
    return Array.isArray(B) && B.length > 0 ? ce = B[Y] : B instanceof FileData && (ce = B), ce;
  }
  const re = [".html", ".svg"], X = [".png", ".jpg", ".jpeg"], Q = [".md", ".txt", ".csv"], q = [".docx", ".pptx", ".xlsx", ".doc", ".ppt", ".xls"], ie = [
    ".py",
    ".js",
    ".css",
    ".json",
    ".yaml",
    ".yml",
    ".xml",
    ".sh",
    ".bash",
    ".log",
    ".ts",
    ".tsx",
    ".js",
    ".jsx",
    ".cpp"
  ];
  function O() {
    return t(this, void 0, void 0, function* () {
      console.log("Show empty"), L.abort(), n(26, L = new AbortController()), yield tick(), n(11, b.style.display = "none", b), n(12, P.innerHTML = "", P);
    });
  }
  function G(B) {
    return t(this, void 0, void 0, function* () {
      console.log("Show error"), n(26, L = new AbortController()), yield tick(), n(11, b.style.display = "none", b), n(12, P.innerHTML = "", P);
      let Y;
      B == "format" ? Y = x.startsWith("fr") ? "Format non pris en charge" : "Unsupported format" : B == "size" && (Y = x.startsWith("fr") ? "Fichier trop lourd pour être affiché" : "File too heavy to be displayed"), n(12, P.innerHTML = `<div class="error-message">${Y}</div>`, P);
    });
  }
  function K(B) {
    return t(this, void 0, void 0, function* () {
      console.log("Get doc en cours"), n(26, L = new AbortController()), yield tick(), n(12, P.innerHTML = "", P), n(11, b.style.display = "block", b);
      const ce = yield pdfExports.getDocument(B.url).promise;
      console.log("PDF loaded");
      const de = document.createDocumentFragment(), me = (_e) => t(this, void 0, void 0, function* () {
        const te = yield ce.getPage(_e);
        console.log(`Page ${_e} loaded`);
        const R = te.getViewport({ scale: 1.5 }), H = document.createElement("canvas");
        H.height = R.height, H.width = R.width, de.appendChild(H);
        const ae = { canvasContext: H.getContext("2d"), viewport: R };
        te.render(ae), console.log(`Page ${_e} rendered`);
      }), Ae = [];
      for (let _e = 1; _e <= ce.numPages; _e++)
        Ae.push(me(_e));
      yield Promise.all(Ae), P.appendChild(de), n(11, b.style.display = "none", b);
    });
  }
  function M(B) {
    return t(this, void 0, void 0, function* () {
      n(26, L = new AbortController()), yield tick(), n(12, P.innerHTML = "", P), n(11, b.style.display = "block", b);
      try {
        const Y = yield fetch(B.url);
        if (!Y.ok)
          throw new Error(`HTTP error! status: ${Y.status}`);
        const ce = yield Y.text(), de = document.createElement("iframe");
        de.style.width = "100%", de.style.height = "100%", de.srcdoc = ce, P.appendChild(de);
      } catch (Y) {
        console.error("Error fetching HTML content:", Y);
      }
      n(11, b.style.display = "none", b);
    });
  }
  function _(B) {
    return t(this, void 0, void 0, function* () {
      n(26, L = new AbortController()), yield tick(), n(12, P.innerHTML = "", P), n(11, b.style.display = "block", b);
      try {
        const Y = yield fetch(B.url);
        if (!Y.ok)
          throw new Error(`HTTP error! status: ${Y.status}`);
        const ce = yield Y.blob(), de = URL.createObjectURL(ce), me = document.createElement("img");
        me.style.width = "100%", me.src = de, P.appendChild(me);
      } catch (Y) {
        console.error("Error fetching image content:", Y);
      }
      n(11, b.style.display = "none", b);
    });
  }
  function A(B) {
    return t(this, void 0, void 0, function* () {
      n(26, L = new AbortController()), yield tick(), n(12, P.innerHTML = "", P), n(11, b.style.display = "block", b);
      try {
        const Y = yield fetch(B.url);
        if (!Y.ok)
          throw new Error(`HTTP error! status: ${Y.status}`);
        let ce = yield Y.text();
        const de = B.path.match(/\.(\w+)$/);
        if (de) {
          const me = de[1];
          console.log(me), ie.includes(`.${me}`) && (ce = `\`\`\`${me}
${ce}
\`\`\``);
        }
        new Markdown({
          target: P,
          props: { value: ce }
        });
      } catch (Y) {
        console.error("Error fetching Markdown content:", Y);
      }
      n(11, b.style.display = "none", b);
    });
  }
  function k() {
    return t(this, void 0, void 0, function* () {
      yield tick(), n(11, b.style.display = "none", b), Array.isArray(h) && h.length > 1 ? n(0, u = (u + 1) % h.length) : n(0, u = u + 1);
    });
  }
  function N() {
    return t(this, void 0, void 0, function* () {
      yield tick(), n(11, b.style.display = "none", b), n(0, u = (u - 1 + h.length) % h.length), console.log(u);
    });
  }
  function $(B) {
    binding_callbacks[B ? "unshift" : "push"](() => {
      b = B, n(11, b);
    });
  }
  function z(B) {
    binding_callbacks[B ? "unshift" : "push"](() => {
      P = B, n(12, P);
    });
  }
  return r.$$set = (B) => {
    "elem_id" in B && n(1, i = B.elem_id), "elem_classes" in B && n(2, a = B.elem_classes), "visible" in B && n(3, s = B.visible), "value" in B && n(4, h = B.value), "n" in B && n(0, u = B.n), "libre_office" in B && n(15, l = B.libre_office), "ms_files" in B && n(16, o = B.ms_files), "max_size" in B && n(17, w = B.max_size), "interface_language" in B && n(18, x = B.interface_language), "interactive" in B && n(19, C = B.interactive), "root" in B && n(20, S = B.root), "label" in B && n(21, T = B.label), "show_label" in B && n(22, D = B.show_label), "height" in B && n(5, F = B.height), "_selectable" in B && n(23, f = B._selectable), "loading_status" in B && n(6, E = B.loading_status), "container" in B && n(7, v = B.container), "scale" in B && n(8, p = B.scale), "min_width" in B && n(9, d = B.min_width), "gradio" in B && n(10, g = B.gradio);
  }, r.$$.update = () => {
    r.$$.dirty[0] & /*value, n, old_file, abortController, gradio, root, file, max_size, libre_office*/
    118653969 && (h && (!Array.isArray(h) || h.length > 0) ? (console.log("Value changed"), console.log(j(h, u).orig_name), h && JSON.stringify(j(h, u)) !== JSON.stringify(y) && (L.abort(), g.dispatch("change"), n(25, y = j(h, u)), n(24, m = addUrl(j(h, u), S)), console.log(m), m.size > w ? (console.log("Fichier trop lourd"), G("size")) : m.path.endsWith("pdf") || l && q.some((B) => m.path.endsWith(B)) ? (console.log("PDF ou MS"), K(m)) : re.some((B) => m.path.endsWith(B)) ? (console.log("HTML"), M(m)) : X.some((B) => m.path.endsWith(B)) ? (console.log("Image"), _(m)) : Q.some((B) => m.path.endsWith(B)) || ie.some((B) => m.path.endsWith(B)) ? (console.log("Markdown"), A(m)) : (console.log("Autre"), G("format")))) : (O(), n(25, y = null)));
  }, [
    u,
    i,
    a,
    s,
    h,
    F,
    E,
    v,
    p,
    d,
    g,
    b,
    P,
    k,
    N,
    l,
    o,
    w,
    x,
    C,
    S,
    T,
    D,
    f,
    m,
    y,
    L,
    $,
    z
  ];
}
class Index extends SvelteComponent {
  constructor(e) {
    super(), init(
      this,
      e,
      instance,
      create_fragment,
      safe_not_equal,
      {
        elem_id: 1,
        elem_classes: 2,
        visible: 3,
        value: 4,
        n: 0,
        libre_office: 15,
        ms_files: 16,
        max_size: 17,
        interface_language: 18,
        interactive: 19,
        root: 20,
        label: 21,
        show_label: 22,
        height: 5,
        _selectable: 23,
        loading_status: 6,
        container: 7,
        scale: 8,
        min_width: 9,
        gradio: 10
      },
      null,
      [-1, -1]
    );
  }
  get elem_id() {
    return this.$$.ctx[1];
  }
  set elem_id(e) {
    this.$$set({ elem_id: e }), flush();
  }
  get elem_classes() {
    return this.$$.ctx[2];
  }
  set elem_classes(e) {
    this.$$set({ elem_classes: e }), flush();
  }
  get visible() {
    return this.$$.ctx[3];
  }
  set visible(e) {
    this.$$set({ visible: e }), flush();
  }
  get value() {
    return this.$$.ctx[4];
  }
  set value(e) {
    this.$$set({ value: e }), flush();
  }
  get n() {
    return this.$$.ctx[0];
  }
  set n(e) {
    this.$$set({ n: e }), flush();
  }
  get libre_office() {
    return this.$$.ctx[15];
  }
  set libre_office(e) {
    this.$$set({ libre_office: e }), flush();
  }
  get ms_files() {
    return this.$$.ctx[16];
  }
  set ms_files(e) {
    this.$$set({ ms_files: e }), flush();
  }
  get max_size() {
    return this.$$.ctx[17];
  }
  set max_size(e) {
    this.$$set({ max_size: e }), flush();
  }
  get interface_language() {
    return this.$$.ctx[18];
  }
  set interface_language(e) {
    this.$$set({ interface_language: e }), flush();
  }
  get interactive() {
    return this.$$.ctx[19];
  }
  set interactive(e) {
    this.$$set({ interactive: e }), flush();
  }
  get root() {
    return this.$$.ctx[20];
  }
  set root(e) {
    this.$$set({ root: e }), flush();
  }
  get label() {
    return this.$$.ctx[21];
  }
  set label(e) {
    this.$$set({ label: e }), flush();
  }
  get show_label() {
    return this.$$.ctx[22];
  }
  set show_label(e) {
    this.$$set({ show_label: e }), flush();
  }
  get height() {
    return this.$$.ctx[5];
  }
  set height(e) {
    this.$$set({ height: e }), flush();
  }
  get _selectable() {
    return this.$$.ctx[23];
  }
  set _selectable(e) {
    this.$$set({ _selectable: e }), flush();
  }
  get loading_status() {
    return this.$$.ctx[6];
  }
  set loading_status(e) {
    this.$$set({ loading_status: e }), flush();
  }
  get container() {
    return this.$$.ctx[7];
  }
  set container(e) {
    this.$$set({ container: e }), flush();
  }
  get scale() {
    return this.$$.ctx[8];
  }
  set scale(e) {
    this.$$set({ scale: e }), flush();
  }
  get min_width() {
    return this.$$.ctx[9];
  }
  set min_width(e) {
    this.$$set({ min_width: e }), flush();
  }
  get gradio() {
    return this.$$.ctx[10];
  }
  set gradio(e) {
    this.$$set({ gradio: e }), flush();
  }
}
export {
  Index as default
};
