const {
  SvelteComponent: Zi,
  append: is,
  attr: Ut,
  detach: $i,
  init: tn,
  insert: en,
  noop: ns,
  safe_not_equal: sn,
  set_style: jt,
  svg_element: Ge
} = window.__gradio__svelte__internal;
function nn(u) {
  let s, i, e, y;
  return {
    c() {
      s = Ge("svg"), i = Ge("g"), e = Ge("path"), y = Ge("path"), Ut(e, "d", "M18,6L6.087,17.913"), jt(e, "fill", "none"), jt(e, "fill-rule", "nonzero"), jt(e, "stroke-width", "2px"), Ut(i, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Ut(y, "d", "M4.364,4.364L19.636,19.636"), jt(y, "fill", "none"), jt(y, "fill-rule", "nonzero"), jt(y, "stroke-width", "2px"), Ut(s, "width", "100%"), Ut(s, "height", "100%"), Ut(s, "viewBox", "0 0 24 24"), Ut(s, "version", "1.1"), Ut(s, "xmlns", "http://www.w3.org/2000/svg"), Ut(s, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Ut(s, "xml:space", "preserve"), Ut(s, "stroke", "currentColor"), jt(s, "fill-rule", "evenodd"), jt(s, "clip-rule", "evenodd"), jt(s, "stroke-linecap", "round"), jt(s, "stroke-linejoin", "round");
    },
    m(v, x) {
      en(v, s, x), is(s, i), is(i, e), is(s, y);
    },
    p: ns,
    i: ns,
    o: ns,
    d(v) {
      v && $i(s);
    }
  };
}
class rn extends Zi {
  constructor(s) {
    super(), tn(this, s, null, nn, sn, {});
  }
}
const {
  SvelteComponent: an,
  append: on,
  attr: Gt,
  detach: ln,
  init: hn,
  insert: cn,
  noop: rs,
  safe_not_equal: dn,
  svg_element: Fs
} = window.__gradio__svelte__internal;
function un(u) {
  let s, i;
  return {
    c() {
      s = Fs("svg"), i = Fs("path"), Gt(i, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), Gt(s, "xmlns", "http://www.w3.org/2000/svg"), Gt(s, "width", "100%"), Gt(s, "height", "100%"), Gt(s, "viewBox", "0 0 24 24"), Gt(s, "fill", "none"), Gt(s, "stroke", "currentColor"), Gt(s, "stroke-width", "1.5"), Gt(s, "stroke-linecap", "round"), Gt(s, "stroke-linejoin", "round"), Gt(s, "class", "feather feather-edit-2");
    },
    m(e, y) {
      cn(e, s, y), on(s, i);
    },
    p: rs,
    i: rs,
    o: rs,
    d(e) {
      e && ln(s);
    }
  };
}
class fn extends an {
  constructor(s) {
    super(), hn(this, s, null, un, dn, {});
  }
}
const {
  SvelteComponent: pn,
  append: Ls,
  attr: Nt,
  detach: gn,
  init: mn,
  insert: bn,
  noop: as,
  safe_not_equal: vn,
  svg_element: os
} = window.__gradio__svelte__internal;
function An(u) {
  let s, i, e;
  return {
    c() {
      s = os("svg"), i = os("path"), e = os("polyline"), Nt(i, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), Nt(e, "points", "13 2 13 9 20 9"), Nt(s, "xmlns", "http://www.w3.org/2000/svg"), Nt(s, "width", "100%"), Nt(s, "height", "100%"), Nt(s, "viewBox", "0 0 24 24"), Nt(s, "fill", "none"), Nt(s, "stroke", "currentColor"), Nt(s, "stroke-width", "1.5"), Nt(s, "stroke-linecap", "round"), Nt(s, "stroke-linejoin", "round"), Nt(s, "class", "feather feather-file");
    },
    m(y, v) {
      bn(y, s, v), Ls(s, i), Ls(s, e);
    },
    p: as,
    i: as,
    o: as,
    d(y) {
      y && gn(s);
    }
  };
}
let yn = class extends pn {
  constructor(s) {
    super(), mn(this, s, null, An, vn, {});
  }
};
const {
  SvelteComponent: wn,
  append: Ps,
  attr: Dt,
  detach: Sn,
  init: _n,
  insert: En,
  noop: ls,
  safe_not_equal: Cn,
  svg_element: hs
} = window.__gradio__svelte__internal;
function Tn(u) {
  let s, i, e;
  return {
    c() {
      s = hs("svg"), i = hs("polyline"), e = hs("path"), Dt(i, "points", "1 4 1 10 7 10"), Dt(e, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), Dt(s, "xmlns", "http://www.w3.org/2000/svg"), Dt(s, "width", "100%"), Dt(s, "height", "100%"), Dt(s, "viewBox", "0 0 24 24"), Dt(s, "fill", "none"), Dt(s, "stroke", "currentColor"), Dt(s, "stroke-width", "2"), Dt(s, "stroke-linecap", "round"), Dt(s, "stroke-linejoin", "round"), Dt(s, "class", "feather feather-rotate-ccw");
    },
    m(y, v) {
      En(y, s, v), Ps(s, i), Ps(s, e);
    },
    p: ls,
    i: ls,
    o: ls,
    d(y) {
      y && Sn(s);
    }
  };
}
class kn extends wn {
  constructor(s) {
    super(), _n(this, s, null, Tn, Cn, {});
  }
}
const {
  SvelteComponent: xn,
  append: cs,
  attr: kt,
  detach: Rn,
  init: Fn,
  insert: Ln,
  noop: ds,
  safe_not_equal: Pn,
  svg_element: Ve
} = window.__gradio__svelte__internal;
function Mn(u) {
  let s, i, e, y;
  return {
    c() {
      s = Ve("svg"), i = Ve("path"), e = Ve("polyline"), y = Ve("line"), kt(i, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), kt(e, "points", "17 8 12 3 7 8"), kt(y, "x1", "12"), kt(y, "y1", "3"), kt(y, "x2", "12"), kt(y, "y2", "15"), kt(s, "xmlns", "http://www.w3.org/2000/svg"), kt(s, "width", "90%"), kt(s, "height", "90%"), kt(s, "viewBox", "0 0 24 24"), kt(s, "fill", "none"), kt(s, "stroke", "currentColor"), kt(s, "stroke-width", "2"), kt(s, "stroke-linecap", "round"), kt(s, "stroke-linejoin", "round"), kt(s, "class", "feather feather-upload");
    },
    m(v, x) {
      Ln(v, s, x), cs(s, i), cs(s, e), cs(s, y);
    },
    p: ds,
    i: ds,
    o: ds,
    d(v) {
      v && Rn(s);
    }
  };
}
let In = class extends xn {
  constructor(s) {
    super(), Fn(this, s, null, Mn, Pn, {});
  }
};
const {
  SvelteComponent: Nn,
  append: Xe,
  attr: us,
  create_component: Dn,
  destroy_component: On,
  detach: Hn,
  element: fs,
  init: Bn,
  insert: zn,
  mount_component: Un,
  safe_not_equal: Gn,
  text: Ms,
  toggle_class: Is,
  transition_in: Vn,
  transition_out: Xn
} = window.__gradio__svelte__internal;
function qn(u) {
  let s, i, e, y, v, x, m;
  return e = new In({}), {
    c() {
      s = fs("div"), i = fs("span"), Dn(e.$$.fragment), y = Ms(`
    Drop PDF
    `), v = fs("span"), v.textContent = "- or -", x = Ms(`
    Click to Upload`), us(i, "class", "icon-wrap svelte-kzcjhc"), Is(
        i,
        "hovered",
        /*hovered*/
        u[0]
      ), us(v, "class", "or svelte-kzcjhc"), us(s, "class", "wrap svelte-kzcjhc");
    },
    m(l, g) {
      zn(l, s, g), Xe(s, i), Un(e, i, null), Xe(s, y), Xe(s, v), Xe(s, x), m = !0;
    },
    p(l, [g]) {
      (!m || g & /*hovered*/
      1) && Is(
        i,
        "hovered",
        /*hovered*/
        l[0]
      );
    },
    i(l) {
      m || (Vn(e.$$.fragment, l), m = !0);
    },
    o(l) {
      Xn(e.$$.fragment, l), m = !1;
    },
    d(l) {
      l && Hn(s), On(e);
    }
  };
}
function jn(u, s, i) {
  let { hovered: e = !1 } = s;
  return u.$$set = (y) => {
    "hovered" in y && i(0, e = y.hovered);
  }, [e];
}
class Yn extends Nn {
  constructor(s) {
    super(), Bn(this, s, jn, qn, Gn, { hovered: 0 });
  }
}
const {
  SvelteComponent: Wn,
  assign: Kn,
  create_slot: Jn,
  detach: Qn,
  element: Zn,
  get_all_dirty_from_scope: $n,
  get_slot_changes: tr,
  get_spread_update: er,
  init: sr,
  insert: ir,
  safe_not_equal: nr,
  set_dynamic_element_data: Ns,
  set_style: Pt,
  toggle_class: se,
  transition_in: Mi,
  transition_out: Ii,
  update_slot_base: rr
} = window.__gradio__svelte__internal;
function ar(u) {
  let s, i, e;
  const y = (
    /*#slots*/
    u[17].default
  ), v = Jn(
    y,
    u,
    /*$$scope*/
    u[16],
    null
  );
  let x = [
    { "data-testid": (
      /*test_id*/
      u[7]
    ) },
    { id: (
      /*elem_id*/
      u[2]
    ) },
    {
      class: i = "block " + /*elem_classes*/
      u[3].join(" ") + " svelte-1t38q2d"
    }
  ], m = {};
  for (let l = 0; l < x.length; l += 1)
    m = Kn(m, x[l]);
  return {
    c() {
      s = Zn(
        /*tag*/
        u[14]
      ), v && v.c(), Ns(
        /*tag*/
        u[14]
      )(s, m), se(
        s,
        "hidden",
        /*visible*/
        u[10] === !1
      ), se(
        s,
        "padded",
        /*padding*/
        u[6]
      ), se(
        s,
        "border_focus",
        /*border_mode*/
        u[5] === "focus"
      ), se(s, "hide-container", !/*explicit_call*/
      u[8] && !/*container*/
      u[9]), Pt(s, "height", typeof /*height*/
      u[0] == "number" ? (
        /*height*/
        u[0] + "px"
      ) : void 0), Pt(s, "width", typeof /*width*/
      u[1] == "number" ? `calc(min(${/*width*/
      u[1]}px, 100%))` : void 0), Pt(
        s,
        "border-style",
        /*variant*/
        u[4]
      ), Pt(
        s,
        "overflow",
        /*allow_overflow*/
        u[11] ? "visible" : "hidden"
      ), Pt(
        s,
        "flex-grow",
        /*scale*/
        u[12]
      ), Pt(s, "min-width", `calc(min(${/*min_width*/
      u[13]}px, 100%))`), Pt(s, "border-width", "var(--block-border-width)");
    },
    m(l, g) {
      ir(l, s, g), v && v.m(s, null), e = !0;
    },
    p(l, g) {
      v && v.p && (!e || g & /*$$scope*/
      65536) && rr(
        v,
        y,
        l,
        /*$$scope*/
        l[16],
        e ? tr(
          y,
          /*$$scope*/
          l[16],
          g,
          null
        ) : $n(
          /*$$scope*/
          l[16]
        ),
        null
      ), Ns(
        /*tag*/
        l[14]
      )(s, m = er(x, [
        (!e || g & /*test_id*/
        128) && { "data-testid": (
          /*test_id*/
          l[7]
        ) },
        (!e || g & /*elem_id*/
        4) && { id: (
          /*elem_id*/
          l[2]
        ) },
        (!e || g & /*elem_classes*/
        8 && i !== (i = "block " + /*elem_classes*/
        l[3].join(" ") + " svelte-1t38q2d")) && { class: i }
      ])), se(
        s,
        "hidden",
        /*visible*/
        l[10] === !1
      ), se(
        s,
        "padded",
        /*padding*/
        l[6]
      ), se(
        s,
        "border_focus",
        /*border_mode*/
        l[5] === "focus"
      ), se(s, "hide-container", !/*explicit_call*/
      l[8] && !/*container*/
      l[9]), g & /*height*/
      1 && Pt(s, "height", typeof /*height*/
      l[0] == "number" ? (
        /*height*/
        l[0] + "px"
      ) : void 0), g & /*width*/
      2 && Pt(s, "width", typeof /*width*/
      l[1] == "number" ? `calc(min(${/*width*/
      l[1]}px, 100%))` : void 0), g & /*variant*/
      16 && Pt(
        s,
        "border-style",
        /*variant*/
        l[4]
      ), g & /*allow_overflow*/
      2048 && Pt(
        s,
        "overflow",
        /*allow_overflow*/
        l[11] ? "visible" : "hidden"
      ), g & /*scale*/
      4096 && Pt(
        s,
        "flex-grow",
        /*scale*/
        l[12]
      ), g & /*min_width*/
      8192 && Pt(s, "min-width", `calc(min(${/*min_width*/
      l[13]}px, 100%))`);
    },
    i(l) {
      e || (Mi(v, l), e = !0);
    },
    o(l) {
      Ii(v, l), e = !1;
    },
    d(l) {
      l && Qn(s), v && v.d(l);
    }
  };
}
function or(u) {
  let s, i = (
    /*tag*/
    u[14] && ar(u)
  );
  return {
    c() {
      i && i.c();
    },
    m(e, y) {
      i && i.m(e, y), s = !0;
    },
    p(e, [y]) {
      /*tag*/
      e[14] && i.p(e, y);
    },
    i(e) {
      s || (Mi(i, e), s = !0);
    },
    o(e) {
      Ii(i, e), s = !1;
    },
    d(e) {
      i && i.d(e);
    }
  };
}
function lr(u, s, i) {
  let { $$slots: e = {}, $$scope: y } = s, { height: v = void 0 } = s, { width: x = void 0 } = s, { elem_id: m = "" } = s, { elem_classes: l = [] } = s, { variant: g = "solid" } = s, { border_mode: h = "base" } = s, { padding: n = !0 } = s, { type: f = "normal" } = s, { test_id: p = void 0 } = s, { explicit_call: C = !1 } = s, { container: r = !0 } = s, { visible: w = !0 } = s, { allow_overflow: t = !0 } = s, { scale: o = null } = s, { min_width: A = 0 } = s, b = f === "fieldset" ? "fieldset" : "div";
  return u.$$set = (R) => {
    "height" in R && i(0, v = R.height), "width" in R && i(1, x = R.width), "elem_id" in R && i(2, m = R.elem_id), "elem_classes" in R && i(3, l = R.elem_classes), "variant" in R && i(4, g = R.variant), "border_mode" in R && i(5, h = R.border_mode), "padding" in R && i(6, n = R.padding), "type" in R && i(15, f = R.type), "test_id" in R && i(7, p = R.test_id), "explicit_call" in R && i(8, C = R.explicit_call), "container" in R && i(9, r = R.container), "visible" in R && i(10, w = R.visible), "allow_overflow" in R && i(11, t = R.allow_overflow), "scale" in R && i(12, o = R.scale), "min_width" in R && i(13, A = R.min_width), "$$scope" in R && i(16, y = R.$$scope);
  }, [
    v,
    x,
    m,
    l,
    g,
    h,
    n,
    p,
    C,
    r,
    w,
    t,
    o,
    A,
    b,
    f,
    y,
    e
  ];
}
class hr extends Wn {
  constructor(s) {
    super(), sr(this, s, lr, or, nr, {
      height: 0,
      width: 1,
      elem_id: 2,
      elem_classes: 3,
      variant: 4,
      border_mode: 5,
      padding: 6,
      type: 15,
      test_id: 7,
      explicit_call: 8,
      container: 9,
      visible: 10,
      allow_overflow: 11,
      scale: 12,
      min_width: 13
    });
  }
}
const {
  SvelteComponent: cr,
  append: ps,
  attr: qe,
  create_component: dr,
  destroy_component: ur,
  detach: fr,
  element: Ds,
  init: pr,
  insert: gr,
  mount_component: mr,
  safe_not_equal: br,
  set_data: vr,
  space: Ar,
  text: yr,
  toggle_class: ie,
  transition_in: wr,
  transition_out: Sr
} = window.__gradio__svelte__internal;
function _r(u) {
  let s, i, e, y, v, x;
  return e = new /*Icon*/
  u[1]({}), {
    c() {
      s = Ds("label"), i = Ds("span"), dr(e.$$.fragment), y = Ar(), v = yr(
        /*label*/
        u[0]
      ), qe(i, "class", "svelte-9gxdi0"), qe(s, "for", ""), qe(s, "data-testid", "block-label"), qe(s, "class", "svelte-9gxdi0"), ie(s, "hide", !/*show_label*/
      u[2]), ie(s, "sr-only", !/*show_label*/
      u[2]), ie(
        s,
        "float",
        /*float*/
        u[4]
      ), ie(
        s,
        "hide-label",
        /*disable*/
        u[3]
      );
    },
    m(m, l) {
      gr(m, s, l), ps(s, i), mr(e, i, null), ps(s, y), ps(s, v), x = !0;
    },
    p(m, [l]) {
      (!x || l & /*label*/
      1) && vr(
        v,
        /*label*/
        m[0]
      ), (!x || l & /*show_label*/
      4) && ie(s, "hide", !/*show_label*/
      m[2]), (!x || l & /*show_label*/
      4) && ie(s, "sr-only", !/*show_label*/
      m[2]), (!x || l & /*float*/
      16) && ie(
        s,
        "float",
        /*float*/
        m[4]
      ), (!x || l & /*disable*/
      8) && ie(
        s,
        "hide-label",
        /*disable*/
        m[3]
      );
    },
    i(m) {
      x || (wr(e.$$.fragment, m), x = !0);
    },
    o(m) {
      Sr(e.$$.fragment, m), x = !1;
    },
    d(m) {
      m && fr(s), ur(e);
    }
  };
}
function Er(u, s, i) {
  let { label: e = null } = s, { Icon: y } = s, { show_label: v = !0 } = s, { disable: x = !1 } = s, { float: m = !0 } = s;
  return u.$$set = (l) => {
    "label" in l && i(0, e = l.label), "Icon" in l && i(1, y = l.Icon), "show_label" in l && i(2, v = l.show_label), "disable" in l && i(3, x = l.disable), "float" in l && i(4, m = l.float);
  }, [e, y, v, x, m];
}
class Cr extends cr {
  constructor(s) {
    super(), pr(this, s, Er, _r, br, {
      label: 0,
      Icon: 1,
      show_label: 2,
      disable: 3,
      float: 4
    });
  }
}
const {
  SvelteComponent: Tr,
  append: ys,
  attr: ge,
  bubble: kr,
  create_component: xr,
  destroy_component: Rr,
  detach: Ni,
  element: ws,
  init: Fr,
  insert: Di,
  listen: Lr,
  mount_component: Pr,
  safe_not_equal: Mr,
  set_data: Ir,
  space: Nr,
  text: Dr,
  toggle_class: ne,
  transition_in: Or,
  transition_out: Hr
} = window.__gradio__svelte__internal;
function Os(u) {
  let s, i;
  return {
    c() {
      s = ws("span"), i = Dr(
        /*label*/
        u[1]
      ), ge(s, "class", "svelte-xtz2g8");
    },
    m(e, y) {
      Di(e, s, y), ys(s, i);
    },
    p(e, y) {
      y & /*label*/
      2 && Ir(
        i,
        /*label*/
        e[1]
      );
    },
    d(e) {
      e && Ni(s);
    }
  };
}
function Br(u) {
  let s, i, e, y, v, x, m, l = (
    /*show_label*/
    u[2] && Os(u)
  );
  return y = new /*Icon*/
  u[0]({}), {
    c() {
      s = ws("button"), l && l.c(), i = Nr(), e = ws("div"), xr(y.$$.fragment), ge(e, "class", "svelte-xtz2g8"), ne(
        e,
        "small",
        /*size*/
        u[4] === "small"
      ), ne(
        e,
        "large",
        /*size*/
        u[4] === "large"
      ), ge(
        s,
        "aria-label",
        /*label*/
        u[1]
      ), ge(
        s,
        "title",
        /*label*/
        u[1]
      ), ge(s, "class", "svelte-xtz2g8"), ne(
        s,
        "pending",
        /*pending*/
        u[3]
      ), ne(
        s,
        "padded",
        /*padded*/
        u[5]
      );
    },
    m(g, h) {
      Di(g, s, h), l && l.m(s, null), ys(s, i), ys(s, e), Pr(y, e, null), v = !0, x || (m = Lr(
        s,
        "click",
        /*click_handler*/
        u[6]
      ), x = !0);
    },
    p(g, [h]) {
      /*show_label*/
      g[2] ? l ? l.p(g, h) : (l = Os(g), l.c(), l.m(s, i)) : l && (l.d(1), l = null), (!v || h & /*size*/
      16) && ne(
        e,
        "small",
        /*size*/
        g[4] === "small"
      ), (!v || h & /*size*/
      16) && ne(
        e,
        "large",
        /*size*/
        g[4] === "large"
      ), (!v || h & /*label*/
      2) && ge(
        s,
        "aria-label",
        /*label*/
        g[1]
      ), (!v || h & /*label*/
      2) && ge(
        s,
        "title",
        /*label*/
        g[1]
      ), (!v || h & /*pending*/
      8) && ne(
        s,
        "pending",
        /*pending*/
        g[3]
      ), (!v || h & /*padded*/
      32) && ne(
        s,
        "padded",
        /*padded*/
        g[5]
      );
    },
    i(g) {
      v || (Or(y.$$.fragment, g), v = !0);
    },
    o(g) {
      Hr(y.$$.fragment, g), v = !1;
    },
    d(g) {
      g && Ni(s), l && l.d(), Rr(y), x = !1, m();
    }
  };
}
function zr(u, s, i) {
  let { Icon: e } = s, { label: y = "" } = s, { show_label: v = !1 } = s, { pending: x = !1 } = s, { size: m = "small" } = s, { padded: l = !0 } = s;
  function g(h) {
    kr.call(this, u, h);
  }
  return u.$$set = (h) => {
    "Icon" in h && i(0, e = h.Icon), "label" in h && i(1, y = h.label), "show_label" in h && i(2, v = h.show_label), "pending" in h && i(3, x = h.pending), "size" in h && i(4, m = h.size), "padded" in h && i(5, l = h.padded);
  }, [e, y, v, x, m, l, g];
}
class Ts extends Tr {
  constructor(s) {
    super(), Fr(this, s, zr, Br, Mr, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5
    });
  }
}
const Ur = [
  { 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 }
], Hs = {
  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"
  }
};
Ur.reduce(
  (u, { color: s, primary: i, secondary: e }) => ({
    ...u,
    [s]: {
      primary: Hs[s][i],
      secondary: Hs[s][e]
    }
  }),
  {}
);
new Intl.Collator(0, { numeric: 1 }).compare;
function Gr(u) {
  try {
    const s = new URL(u);
    return s.protocol === "http:" || s.protocol === "https:";
  } catch {
    return !1;
  }
}
function Vr(u, s, i) {
  return u == null ? i ? `/proxy=${i}file=` : `${s}/file=` : Gr(u) ? u : i ? `/proxy=${i}file=${u}` : `${s}/file=${u}`;
}
const {
  SvelteComponent: Xr,
  append: Oi,
  attr: St,
  bubble: qr,
  check_outros: jr,
  create_slot: Hi,
  detach: He,
  element: ts,
  empty: Yr,
  get_all_dirty_from_scope: Bi,
  get_slot_changes: zi,
  group_outros: Wr,
  init: Kr,
  insert: Be,
  listen: Jr,
  safe_not_equal: Qr,
  set_style: Ft,
  space: Ui,
  src_url_equal: Je,
  toggle_class: _e,
  transition_in: Qe,
  transition_out: Ze,
  update_slot_base: Gi
} = window.__gradio__svelte__internal;
function Zr(u) {
  let s, i, e, y, v, x, m = (
    /*icon*/
    u[7] && Bs(u)
  );
  const l = (
    /*#slots*/
    u[15].default
  ), g = Hi(
    l,
    u,
    /*$$scope*/
    u[14],
    null
  );
  return {
    c() {
      s = ts("button"), m && m.c(), i = Ui(), g && g.c(), St(s, "class", e = /*size*/
      u[4] + " " + /*variant*/
      u[3] + " " + /*elem_classes*/
      u[1].join(" ") + " svelte-8huxfn"), St(
        s,
        "id",
        /*elem_id*/
        u[0]
      ), s.disabled = /*disabled*/
      u[8], _e(s, "hidden", !/*visible*/
      u[2]), Ft(
        s,
        "flex-grow",
        /*scale*/
        u[9]
      ), Ft(
        s,
        "width",
        /*scale*/
        u[9] === 0 ? "fit-content" : null
      ), Ft(s, "min-width", typeof /*min_width*/
      u[10] == "number" ? `calc(min(${/*min_width*/
      u[10]}px, 100%))` : null);
    },
    m(h, n) {
      Be(h, s, n), m && m.m(s, null), Oi(s, i), g && g.m(s, null), y = !0, v || (x = Jr(
        s,
        "click",
        /*click_handler*/
        u[16]
      ), v = !0);
    },
    p(h, n) {
      /*icon*/
      h[7] ? m ? m.p(h, n) : (m = Bs(h), m.c(), m.m(s, i)) : m && (m.d(1), m = null), g && g.p && (!y || n & /*$$scope*/
      16384) && Gi(
        g,
        l,
        h,
        /*$$scope*/
        h[14],
        y ? zi(
          l,
          /*$$scope*/
          h[14],
          n,
          null
        ) : Bi(
          /*$$scope*/
          h[14]
        ),
        null
      ), (!y || n & /*size, variant, elem_classes*/
      26 && e !== (e = /*size*/
      h[4] + " " + /*variant*/
      h[3] + " " + /*elem_classes*/
      h[1].join(" ") + " svelte-8huxfn")) && St(s, "class", e), (!y || n & /*elem_id*/
      1) && St(
        s,
        "id",
        /*elem_id*/
        h[0]
      ), (!y || n & /*disabled*/
      256) && (s.disabled = /*disabled*/
      h[8]), (!y || n & /*size, variant, elem_classes, visible*/
      30) && _e(s, "hidden", !/*visible*/
      h[2]), n & /*scale*/
      512 && Ft(
        s,
        "flex-grow",
        /*scale*/
        h[9]
      ), n & /*scale*/
      512 && Ft(
        s,
        "width",
        /*scale*/
        h[9] === 0 ? "fit-content" : null
      ), n & /*min_width*/
      1024 && Ft(s, "min-width", typeof /*min_width*/
      h[10] == "number" ? `calc(min(${/*min_width*/
      h[10]}px, 100%))` : null);
    },
    i(h) {
      y || (Qe(g, h), y = !0);
    },
    o(h) {
      Ze(g, h), y = !1;
    },
    d(h) {
      h && He(s), m && m.d(), g && g.d(h), v = !1, x();
    }
  };
}
function $r(u) {
  let s, i, e, y, v = (
    /*icon*/
    u[7] && zs(u)
  );
  const x = (
    /*#slots*/
    u[15].default
  ), m = Hi(
    x,
    u,
    /*$$scope*/
    u[14],
    null
  );
  return {
    c() {
      s = ts("a"), v && v.c(), i = Ui(), m && m.c(), St(
        s,
        "href",
        /*link*/
        u[6]
      ), St(s, "rel", "noopener noreferrer"), St(
        s,
        "aria-disabled",
        /*disabled*/
        u[8]
      ), St(s, "class", e = /*size*/
      u[4] + " " + /*variant*/
      u[3] + " " + /*elem_classes*/
      u[1].join(" ") + " svelte-8huxfn"), St(
        s,
        "id",
        /*elem_id*/
        u[0]
      ), _e(s, "hidden", !/*visible*/
      u[2]), _e(
        s,
        "disabled",
        /*disabled*/
        u[8]
      ), Ft(
        s,
        "flex-grow",
        /*scale*/
        u[9]
      ), Ft(
        s,
        "pointer-events",
        /*disabled*/
        u[8] ? "none" : null
      ), Ft(
        s,
        "width",
        /*scale*/
        u[9] === 0 ? "fit-content" : null
      ), Ft(s, "min-width", typeof /*min_width*/
      u[10] == "number" ? `calc(min(${/*min_width*/
      u[10]}px, 100%))` : null);
    },
    m(l, g) {
      Be(l, s, g), v && v.m(s, null), Oi(s, i), m && m.m(s, null), y = !0;
    },
    p(l, g) {
      /*icon*/
      l[7] ? v ? v.p(l, g) : (v = zs(l), v.c(), v.m(s, i)) : v && (v.d(1), v = null), m && m.p && (!y || g & /*$$scope*/
      16384) && Gi(
        m,
        x,
        l,
        /*$$scope*/
        l[14],
        y ? zi(
          x,
          /*$$scope*/
          l[14],
          g,
          null
        ) : Bi(
          /*$$scope*/
          l[14]
        ),
        null
      ), (!y || g & /*link*/
      64) && St(
        s,
        "href",
        /*link*/
        l[6]
      ), (!y || g & /*disabled*/
      256) && St(
        s,
        "aria-disabled",
        /*disabled*/
        l[8]
      ), (!y || g & /*size, variant, elem_classes*/
      26 && e !== (e = /*size*/
      l[4] + " " + /*variant*/
      l[3] + " " + /*elem_classes*/
      l[1].join(" ") + " svelte-8huxfn")) && St(s, "class", e), (!y || g & /*elem_id*/
      1) && St(
        s,
        "id",
        /*elem_id*/
        l[0]
      ), (!y || g & /*size, variant, elem_classes, visible*/
      30) && _e(s, "hidden", !/*visible*/
      l[2]), (!y || g & /*size, variant, elem_classes, disabled*/
      282) && _e(
        s,
        "disabled",
        /*disabled*/
        l[8]
      ), g & /*scale*/
      512 && Ft(
        s,
        "flex-grow",
        /*scale*/
        l[9]
      ), g & /*disabled*/
      256 && Ft(
        s,
        "pointer-events",
        /*disabled*/
        l[8] ? "none" : null
      ), g & /*scale*/
      512 && Ft(
        s,
        "width",
        /*scale*/
        l[9] === 0 ? "fit-content" : null
      ), g & /*min_width*/
      1024 && Ft(s, "min-width", typeof /*min_width*/
      l[10] == "number" ? `calc(min(${/*min_width*/
      l[10]}px, 100%))` : null);
    },
    i(l) {
      y || (Qe(m, l), y = !0);
    },
    o(l) {
      Ze(m, l), y = !1;
    },
    d(l) {
      l && He(s), v && v.d(), m && m.d(l);
    }
  };
}
function Bs(u) {
  let s, i, e;
  return {
    c() {
      s = ts("img"), St(s, "class", "button-icon svelte-8huxfn"), Je(s.src, i = /*icon_path*/
      u[11]) || St(s, "src", i), St(s, "alt", e = `${/*value*/
      u[5]} icon`);
    },
    m(y, v) {
      Be(y, s, v);
    },
    p(y, v) {
      v & /*icon_path*/
      2048 && !Je(s.src, i = /*icon_path*/
      y[11]) && St(s, "src", i), v & /*value*/
      32 && e !== (e = `${/*value*/
      y[5]} icon`) && St(s, "alt", e);
    },
    d(y) {
      y && He(s);
    }
  };
}
function zs(u) {
  let s, i, e;
  return {
    c() {
      s = ts("img"), St(s, "class", "button-icon svelte-8huxfn"), Je(s.src, i = /*icon_path*/
      u[11]) || St(s, "src", i), St(s, "alt", e = `${/*value*/
      u[5]} icon`);
    },
    m(y, v) {
      Be(y, s, v);
    },
    p(y, v) {
      v & /*icon_path*/
      2048 && !Je(s.src, i = /*icon_path*/
      y[11]) && St(s, "src", i), v & /*value*/
      32 && e !== (e = `${/*value*/
      y[5]} icon`) && St(s, "alt", e);
    },
    d(y) {
      y && He(s);
    }
  };
}
function ta(u) {
  let s, i, e, y;
  const v = [$r, Zr], x = [];
  function m(l, g) {
    return (
      /*link*/
      l[6] && /*link*/
      l[6].length > 0 ? 0 : 1
    );
  }
  return s = m(u), i = x[s] = v[s](u), {
    c() {
      i.c(), e = Yr();
    },
    m(l, g) {
      x[s].m(l, g), Be(l, e, g), y = !0;
    },
    p(l, [g]) {
      let h = s;
      s = m(l), s === h ? x[s].p(l, g) : (Wr(), Ze(x[h], 1, 1, () => {
        x[h] = null;
      }), jr(), i = x[s], i ? i.p(l, g) : (i = x[s] = v[s](l), i.c()), Qe(i, 1), i.m(e.parentNode, e));
    },
    i(l) {
      y || (Qe(i), y = !0);
    },
    o(l) {
      Ze(i), y = !1;
    },
    d(l) {
      l && He(e), x[s].d(l);
    }
  };
}
function ea(u, s, i) {
  let e, { $$slots: y = {}, $$scope: v } = s, { elem_id: x = "" } = s, { elem_classes: m = [] } = s, { visible: l = !0 } = s, { variant: g = "secondary" } = s, { size: h = "lg" } = s, { value: n = null } = s, { link: f = null } = s, { icon: p = null } = s, { disabled: C = !1 } = s, { scale: r = null } = s, { min_width: w = void 0 } = s, { root: t = "" } = s, { proxy_url: o = null } = s;
  function A(b) {
    qr.call(this, u, b);
  }
  return u.$$set = (b) => {
    "elem_id" in b && i(0, x = b.elem_id), "elem_classes" in b && i(1, m = b.elem_classes), "visible" in b && i(2, l = b.visible), "variant" in b && i(3, g = b.variant), "size" in b && i(4, h = b.size), "value" in b && i(5, n = b.value), "link" in b && i(6, f = b.link), "icon" in b && i(7, p = b.icon), "disabled" in b && i(8, C = b.disabled), "scale" in b && i(9, r = b.scale), "min_width" in b && i(10, w = b.min_width), "root" in b && i(12, t = b.root), "proxy_url" in b && i(13, o = b.proxy_url), "$$scope" in b && i(14, v = b.$$scope);
  }, u.$$.update = () => {
    u.$$.dirty & /*icon, root, proxy_url*/
    12416 && i(11, e = Vr(p, t, o));
  }, [
    x,
    m,
    l,
    g,
    h,
    n,
    f,
    p,
    C,
    r,
    w,
    e,
    t,
    o,
    v,
    y,
    A
  ];
}
class Us extends Xr {
  constructor(s) {
    super(), Kr(this, s, ea, ta, Qr, {
      elem_id: 0,
      elem_classes: 1,
      visible: 2,
      variant: 3,
      size: 4,
      value: 5,
      link: 6,
      icon: 7,
      disabled: 8,
      scale: 9,
      min_width: 10,
      root: 12,
      proxy_url: 13
    });
  }
}
function Ee(u) {
  let s = ["", "k", "M", "G", "T", "P", "E", "Z"], i = 0;
  for (; u > 1e3 && i < s.length - 1; )
    u /= 1e3, i++;
  let e = s[i];
  return (Number.isInteger(u) ? u : u.toFixed(1)) + e;
}
function Ke() {
}
function sa(u, s) {
  return u != u ? s == s : u !== s || u && typeof u == "object" || typeof u == "function";
}
const Vi = typeof window < "u";
let Gs = Vi ? () => window.performance.now() : () => Date.now(), Xi = Vi ? (u) => requestAnimationFrame(u) : Ke;
const ke = /* @__PURE__ */ new Set();
function qi(u) {
  ke.forEach((s) => {
    s.c(u) || (ke.delete(s), s.f());
  }), ke.size !== 0 && Xi(qi);
}
function ia(u) {
  let s;
  return ke.size === 0 && Xi(qi), {
    promise: new Promise((i) => {
      ke.add(s = { c: u, f: i });
    }),
    abort() {
      ke.delete(s);
    }
  };
}
const Se = [];
function na(u, s = Ke) {
  let i;
  const e = /* @__PURE__ */ new Set();
  function y(m) {
    if (sa(u, m) && (u = m, i)) {
      const l = !Se.length;
      for (const g of e)
        g[1](), Se.push(g, u);
      if (l) {
        for (let g = 0; g < Se.length; g += 2)
          Se[g][0](Se[g + 1]);
        Se.length = 0;
      }
    }
  }
  function v(m) {
    y(m(u));
  }
  function x(m, l = Ke) {
    const g = [m, l];
    return e.add(g), e.size === 1 && (i = s(y, v) || Ke), m(u), () => {
      e.delete(g), e.size === 0 && i && (i(), i = null);
    };
  }
  return { set: y, update: v, subscribe: x };
}
function Vs(u) {
  return Object.prototype.toString.call(u) === "[object Date]";
}
function Ss(u, s, i, e) {
  if (typeof i == "number" || Vs(i)) {
    const y = e - i, v = (i - s) / (u.dt || 1 / 60), x = u.opts.stiffness * y, m = u.opts.damping * v, l = (x - m) * u.inv_mass, g = (v + l) * u.dt;
    return Math.abs(g) < u.opts.precision && Math.abs(y) < u.opts.precision ? e : (u.settled = !1, Vs(i) ? new Date(i.getTime() + g) : i + g);
  } else {
    if (Array.isArray(i))
      return i.map(
        (y, v) => Ss(u, s[v], i[v], e[v])
      );
    if (typeof i == "object") {
      const y = {};
      for (const v in i)
        y[v] = Ss(u, s[v], i[v], e[v]);
      return y;
    } else
      throw new Error(`Cannot spring ${typeof i} values`);
  }
}
function Xs(u, s = {}) {
  const i = na(u), { stiffness: e = 0.15, damping: y = 0.8, precision: v = 0.01 } = s;
  let x, m, l, g = u, h = u, n = 1, f = 0, p = !1;
  function C(w, t = {}) {
    h = w;
    const o = l = {};
    return u == null || t.hard || r.stiffness >= 1 && r.damping >= 1 ? (p = !0, x = Gs(), g = w, i.set(u = h), Promise.resolve()) : (t.soft && (f = 1 / ((t.soft === !0 ? 0.5 : +t.soft) * 60), n = 0), m || (x = Gs(), p = !1, m = ia((A) => {
      if (p)
        return p = !1, m = null, !1;
      n = Math.min(n + f, 1);
      const b = {
        inv_mass: n,
        opts: r,
        settled: !0,
        dt: (A - x) * 60 / 1e3
      }, R = Ss(b, g, u, h);
      return x = A, g = u, i.set(u = R), b.settled && (m = null), !b.settled;
    })), new Promise((A) => {
      m.promise.then(() => {
        o === l && A();
      });
    }));
  }
  const r = {
    set: C,
    update: (w, t) => C(w(h, u), t),
    subscribe: i.subscribe,
    stiffness: e,
    damping: y,
    precision: v
  };
  return r;
}
const {
  SvelteComponent: ra,
  append: Vt,
  attr: At,
  component_subscribe: qs,
  detach: aa,
  element: oa,
  init: la,
  insert: ha,
  noop: js,
  safe_not_equal: ca,
  set_style: je,
  svg_element: Xt,
  toggle_class: Ys
} = window.__gradio__svelte__internal, { onMount: da } = window.__gradio__svelte__internal;
function ua(u) {
  let s, i, e, y, v, x, m, l, g, h, n, f;
  return {
    c() {
      s = oa("div"), i = Xt("svg"), e = Xt("g"), y = Xt("path"), v = Xt("path"), x = Xt("path"), m = Xt("path"), l = Xt("g"), g = Xt("path"), h = Xt("path"), n = Xt("path"), f = Xt("path"), At(y, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), At(y, "fill", "#FF7C00"), At(y, "fill-opacity", "0.4"), At(y, "class", "svelte-43sxxs"), At(v, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), At(v, "fill", "#FF7C00"), At(v, "class", "svelte-43sxxs"), At(x, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), At(x, "fill", "#FF7C00"), At(x, "fill-opacity", "0.4"), At(x, "class", "svelte-43sxxs"), At(m, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), At(m, "fill", "#FF7C00"), At(m, "class", "svelte-43sxxs"), je(e, "transform", "translate(" + /*$top*/
      u[1][0] + "px, " + /*$top*/
      u[1][1] + "px)"), At(g, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), At(g, "fill", "#FF7C00"), At(g, "fill-opacity", "0.4"), At(g, "class", "svelte-43sxxs"), At(h, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), At(h, "fill", "#FF7C00"), At(h, "class", "svelte-43sxxs"), At(n, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), At(n, "fill", "#FF7C00"), At(n, "fill-opacity", "0.4"), At(n, "class", "svelte-43sxxs"), At(f, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), At(f, "fill", "#FF7C00"), At(f, "class", "svelte-43sxxs"), je(l, "transform", "translate(" + /*$bottom*/
      u[2][0] + "px, " + /*$bottom*/
      u[2][1] + "px)"), At(i, "viewBox", "-1200 -1200 3000 3000"), At(i, "fill", "none"), At(i, "xmlns", "http://www.w3.org/2000/svg"), At(i, "class", "svelte-43sxxs"), At(s, "class", "svelte-43sxxs"), Ys(
        s,
        "margin",
        /*margin*/
        u[0]
      );
    },
    m(p, C) {
      ha(p, s, C), Vt(s, i), Vt(i, e), Vt(e, y), Vt(e, v), Vt(e, x), Vt(e, m), Vt(i, l), Vt(l, g), Vt(l, h), Vt(l, n), Vt(l, f);
    },
    p(p, [C]) {
      C & /*$top*/
      2 && je(e, "transform", "translate(" + /*$top*/
      p[1][0] + "px, " + /*$top*/
      p[1][1] + "px)"), C & /*$bottom*/
      4 && je(l, "transform", "translate(" + /*$bottom*/
      p[2][0] + "px, " + /*$bottom*/
      p[2][1] + "px)"), C & /*margin*/
      1 && Ys(
        s,
        "margin",
        /*margin*/
        p[0]
      );
    },
    i: js,
    o: js,
    d(p) {
      p && aa(s);
    }
  };
}
function fa(u, s, i) {
  let e, y;
  var v = this && this.__awaiter || function(p, C, r, w) {
    function t(o) {
      return o instanceof r ? o : new r(function(A) {
        A(o);
      });
    }
    return new (r || (r = Promise))(function(o, A) {
      function b(D) {
        try {
          L(w.next(D));
        } catch (H) {
          A(H);
        }
      }
      function R(D) {
        try {
          L(w.throw(D));
        } catch (H) {
          A(H);
        }
      }
      function L(D) {
        D.done ? o(D.value) : t(D.value).then(b, R);
      }
      L((w = w.apply(p, C || [])).next());
    });
  };
  let { margin: x = !0 } = s;
  const m = Xs([0, 0]);
  qs(u, m, (p) => i(1, e = p));
  const l = Xs([0, 0]);
  qs(u, l, (p) => i(2, y = p));
  let g;
  function h() {
    return v(this, void 0, void 0, function* () {
      yield Promise.all([m.set([125, 140]), l.set([-125, -140])]), yield Promise.all([m.set([-125, 140]), l.set([125, -140])]), yield Promise.all([m.set([-125, 0]), l.set([125, -0])]), yield Promise.all([m.set([125, 0]), l.set([-125, 0])]);
    });
  }
  function n() {
    return v(this, void 0, void 0, function* () {
      yield h(), g || n();
    });
  }
  function f() {
    return v(this, void 0, void 0, function* () {
      yield Promise.all([m.set([125, 0]), l.set([-125, 0])]), n();
    });
  }
  return da(() => (f(), () => g = !0)), u.$$set = (p) => {
    "margin" in p && i(0, x = p.margin);
  }, [x, e, y, m, l];
}
class pa extends ra {
  constructor(s) {
    super(), la(this, s, fa, ua, ca, { margin: 0 });
  }
}
const {
  SvelteComponent: ga,
  append: be,
  attr: Yt,
  binding_callbacks: Ws,
  check_outros: ji,
  create_component: ma,
  create_slot: ba,
  destroy_component: va,
  destroy_each: Yi,
  detach: gt,
  element: Zt,
  empty: Le,
  ensure_array_like: $e,
  get_all_dirty_from_scope: Aa,
  get_slot_changes: ya,
  group_outros: Wi,
  init: wa,
  insert: mt,
  mount_component: Sa,
  noop: _s,
  safe_not_equal: _a,
  set_data: zt,
  set_style: oe,
  space: Wt,
  text: _t,
  toggle_class: Ht,
  transition_in: Re,
  transition_out: Fe,
  update_slot_base: Ea
} = window.__gradio__svelte__internal, { tick: Ca } = window.__gradio__svelte__internal, { onDestroy: Ta } = window.__gradio__svelte__internal, ka = (u) => ({}), Ks = (u) => ({});
function Js(u, s, i) {
  const e = u.slice();
  return e[39] = s[i], e[41] = i, e;
}
function Qs(u, s, i) {
  const e = u.slice();
  return e[39] = s[i], e;
}
function xa(u) {
  let s, i = (
    /*i18n*/
    u[1]("common.error") + ""
  ), e, y, v;
  const x = (
    /*#slots*/
    u[29].error
  ), m = ba(
    x,
    u,
    /*$$scope*/
    u[28],
    Ks
  );
  return {
    c() {
      s = Zt("span"), e = _t(i), y = Wt(), m && m.c(), Yt(s, "class", "error svelte-14miwb5");
    },
    m(l, g) {
      mt(l, s, g), be(s, e), mt(l, y, g), m && m.m(l, g), v = !0;
    },
    p(l, g) {
      (!v || g[0] & /*i18n*/
      2) && i !== (i = /*i18n*/
      l[1]("common.error") + "") && zt(e, i), m && m.p && (!v || g[0] & /*$$scope*/
      268435456) && Ea(
        m,
        x,
        l,
        /*$$scope*/
        l[28],
        v ? ya(
          x,
          /*$$scope*/
          l[28],
          g,
          ka
        ) : Aa(
          /*$$scope*/
          l[28]
        ),
        Ks
      );
    },
    i(l) {
      v || (Re(m, l), v = !0);
    },
    o(l) {
      Fe(m, l), v = !1;
    },
    d(l) {
      l && (gt(s), gt(y)), m && m.d(l);
    }
  };
}
function Ra(u) {
  let s, i, e, y, v, x, m, l, g, h = (
    /*variant*/
    u[8] === "default" && /*show_eta_bar*/
    u[18] && /*show_progress*/
    u[6] === "full" && Zs(u)
  );
  function n(A, b) {
    if (
      /*progress*/
      A[7]
    )
      return Pa;
    if (
      /*queue_position*/
      A[2] !== null && /*queue_size*/
      A[3] !== void 0 && /*queue_position*/
      A[2] >= 0
    )
      return La;
    if (
      /*queue_position*/
      A[2] === 0
    )
      return Fa;
  }
  let f = n(u), p = f && f(u), C = (
    /*timer*/
    u[5] && ei(u)
  );
  const r = [Da, Na], w = [];
  function t(A, b) {
    return (
      /*last_progress_level*/
      A[15] != null ? 0 : (
        /*show_progress*/
        A[6] === "full" ? 1 : -1
      )
    );
  }
  ~(v = t(u)) && (x = w[v] = r[v](u));
  let o = !/*timer*/
  u[5] && li(u);
  return {
    c() {
      h && h.c(), s = Wt(), i = Zt("div"), p && p.c(), e = Wt(), C && C.c(), y = Wt(), x && x.c(), m = Wt(), o && o.c(), l = Le(), Yt(i, "class", "progress-text svelte-14miwb5"), Ht(
        i,
        "meta-text-center",
        /*variant*/
        u[8] === "center"
      ), Ht(
        i,
        "meta-text",
        /*variant*/
        u[8] === "default"
      );
    },
    m(A, b) {
      h && h.m(A, b), mt(A, s, b), mt(A, i, b), p && p.m(i, null), be(i, e), C && C.m(i, null), mt(A, y, b), ~v && w[v].m(A, b), mt(A, m, b), o && o.m(A, b), mt(A, l, b), g = !0;
    },
    p(A, b) {
      /*variant*/
      A[8] === "default" && /*show_eta_bar*/
      A[18] && /*show_progress*/
      A[6] === "full" ? h ? h.p(A, b) : (h = Zs(A), h.c(), h.m(s.parentNode, s)) : h && (h.d(1), h = null), f === (f = n(A)) && p ? p.p(A, b) : (p && p.d(1), p = f && f(A), p && (p.c(), p.m(i, e))), /*timer*/
      A[5] ? C ? C.p(A, b) : (C = ei(A), C.c(), C.m(i, null)) : C && (C.d(1), C = null), (!g || b[0] & /*variant*/
      256) && Ht(
        i,
        "meta-text-center",
        /*variant*/
        A[8] === "center"
      ), (!g || b[0] & /*variant*/
      256) && Ht(
        i,
        "meta-text",
        /*variant*/
        A[8] === "default"
      );
      let R = v;
      v = t(A), v === R ? ~v && w[v].p(A, b) : (x && (Wi(), Fe(w[R], 1, 1, () => {
        w[R] = null;
      }), ji()), ~v ? (x = w[v], x ? x.p(A, b) : (x = w[v] = r[v](A), x.c()), Re(x, 1), x.m(m.parentNode, m)) : x = null), /*timer*/
      A[5] ? o && (o.d(1), o = null) : o ? o.p(A, b) : (o = li(A), o.c(), o.m(l.parentNode, l));
    },
    i(A) {
      g || (Re(x), g = !0);
    },
    o(A) {
      Fe(x), g = !1;
    },
    d(A) {
      A && (gt(s), gt(i), gt(y), gt(m), gt(l)), h && h.d(A), p && p.d(), C && C.d(), ~v && w[v].d(A), o && o.d(A);
    }
  };
}
function Zs(u) {
  let s, i = `translateX(${/*eta_level*/
  (u[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      s = Zt("div"), Yt(s, "class", "eta-bar svelte-14miwb5"), oe(s, "transform", i);
    },
    m(e, y) {
      mt(e, s, y);
    },
    p(e, y) {
      y[0] & /*eta_level*/
      131072 && i !== (i = `translateX(${/*eta_level*/
      (e[17] || 0) * 100 - 100}%)`) && oe(s, "transform", i);
    },
    d(e) {
      e && gt(s);
    }
  };
}
function Fa(u) {
  let s;
  return {
    c() {
      s = _t("processing |");
    },
    m(i, e) {
      mt(i, s, e);
    },
    p: _s,
    d(i) {
      i && gt(s);
    }
  };
}
function La(u) {
  let s, i = (
    /*queue_position*/
    u[2] + 1 + ""
  ), e, y, v, x;
  return {
    c() {
      s = _t("queue: "), e = _t(i), y = _t("/"), v = _t(
        /*queue_size*/
        u[3]
      ), x = _t(" |");
    },
    m(m, l) {
      mt(m, s, l), mt(m, e, l), mt(m, y, l), mt(m, v, l), mt(m, x, l);
    },
    p(m, l) {
      l[0] & /*queue_position*/
      4 && i !== (i = /*queue_position*/
      m[2] + 1 + "") && zt(e, i), l[0] & /*queue_size*/
      8 && zt(
        v,
        /*queue_size*/
        m[3]
      );
    },
    d(m) {
      m && (gt(s), gt(e), gt(y), gt(v), gt(x));
    }
  };
}
function Pa(u) {
  let s, i = $e(
    /*progress*/
    u[7]
  ), e = [];
  for (let y = 0; y < i.length; y += 1)
    e[y] = ti(Qs(u, i, y));
  return {
    c() {
      for (let y = 0; y < e.length; y += 1)
        e[y].c();
      s = Le();
    },
    m(y, v) {
      for (let x = 0; x < e.length; x += 1)
        e[x] && e[x].m(y, v);
      mt(y, s, v);
    },
    p(y, v) {
      if (v[0] & /*progress*/
      128) {
        i = $e(
          /*progress*/
          y[7]
        );
        let x;
        for (x = 0; x < i.length; x += 1) {
          const m = Qs(y, i, x);
          e[x] ? e[x].p(m, v) : (e[x] = ti(m), e[x].c(), e[x].m(s.parentNode, s));
        }
        for (; x < e.length; x += 1)
          e[x].d(1);
        e.length = i.length;
      }
    },
    d(y) {
      y && gt(s), Yi(e, y);
    }
  };
}
function $s(u) {
  let s, i = (
    /*p*/
    u[39].unit + ""
  ), e, y, v = " ", x;
  function m(h, n) {
    return (
      /*p*/
      h[39].length != null ? Ia : Ma
    );
  }
  let l = m(u), g = l(u);
  return {
    c() {
      g.c(), s = Wt(), e = _t(i), y = _t(" | "), x = _t(v);
    },
    m(h, n) {
      g.m(h, n), mt(h, s, n), mt(h, e, n), mt(h, y, n), mt(h, x, n);
    },
    p(h, n) {
      l === (l = m(h)) && g ? g.p(h, n) : (g.d(1), g = l(h), g && (g.c(), g.m(s.parentNode, s))), n[0] & /*progress*/
      128 && i !== (i = /*p*/
      h[39].unit + "") && zt(e, i);
    },
    d(h) {
      h && (gt(s), gt(e), gt(y), gt(x)), g.d(h);
    }
  };
}
function Ma(u) {
  let s = Ee(
    /*p*/
    u[39].index || 0
  ) + "", i;
  return {
    c() {
      i = _t(s);
    },
    m(e, y) {
      mt(e, i, y);
    },
    p(e, y) {
      y[0] & /*progress*/
      128 && s !== (s = Ee(
        /*p*/
        e[39].index || 0
      ) + "") && zt(i, s);
    },
    d(e) {
      e && gt(i);
    }
  };
}
function Ia(u) {
  let s = Ee(
    /*p*/
    u[39].index || 0
  ) + "", i, e, y = Ee(
    /*p*/
    u[39].length
  ) + "", v;
  return {
    c() {
      i = _t(s), e = _t("/"), v = _t(y);
    },
    m(x, m) {
      mt(x, i, m), mt(x, e, m), mt(x, v, m);
    },
    p(x, m) {
      m[0] & /*progress*/
      128 && s !== (s = Ee(
        /*p*/
        x[39].index || 0
      ) + "") && zt(i, s), m[0] & /*progress*/
      128 && y !== (y = Ee(
        /*p*/
        x[39].length
      ) + "") && zt(v, y);
    },
    d(x) {
      x && (gt(i), gt(e), gt(v));
    }
  };
}
function ti(u) {
  let s, i = (
    /*p*/
    u[39].index != null && $s(u)
  );
  return {
    c() {
      i && i.c(), s = Le();
    },
    m(e, y) {
      i && i.m(e, y), mt(e, s, y);
    },
    p(e, y) {
      /*p*/
      e[39].index != null ? i ? i.p(e, y) : (i = $s(e), i.c(), i.m(s.parentNode, s)) : i && (i.d(1), i = null);
    },
    d(e) {
      e && gt(s), i && i.d(e);
    }
  };
}
function ei(u) {
  let s, i = (
    /*eta*/
    u[0] ? `/${/*formatted_eta*/
    u[19]}` : ""
  ), e, y;
  return {
    c() {
      s = _t(
        /*formatted_timer*/
        u[20]
      ), e = _t(i), y = _t("s");
    },
    m(v, x) {
      mt(v, s, x), mt(v, e, x), mt(v, y, x);
    },
    p(v, x) {
      x[0] & /*formatted_timer*/
      1048576 && zt(
        s,
        /*formatted_timer*/
        v[20]
      ), x[0] & /*eta, formatted_eta*/
      524289 && i !== (i = /*eta*/
      v[0] ? `/${/*formatted_eta*/
      v[19]}` : "") && zt(e, i);
    },
    d(v) {
      v && (gt(s), gt(e), gt(y));
    }
  };
}
function Na(u) {
  let s, i;
  return s = new pa({
    props: { margin: (
      /*variant*/
      u[8] === "default"
    ) }
  }), {
    c() {
      ma(s.$$.fragment);
    },
    m(e, y) {
      Sa(s, e, y), i = !0;
    },
    p(e, y) {
      const v = {};
      y[0] & /*variant*/
      256 && (v.margin = /*variant*/
      e[8] === "default"), s.$set(v);
    },
    i(e) {
      i || (Re(s.$$.fragment, e), i = !0);
    },
    o(e) {
      Fe(s.$$.fragment, e), i = !1;
    },
    d(e) {
      va(s, e);
    }
  };
}
function Da(u) {
  let s, i, e, y, v, x = `${/*last_progress_level*/
  u[15] * 100}%`, m = (
    /*progress*/
    u[7] != null && si(u)
  );
  return {
    c() {
      s = Zt("div"), i = Zt("div"), m && m.c(), e = Wt(), y = Zt("div"), v = Zt("div"), Yt(i, "class", "progress-level-inner svelte-14miwb5"), Yt(v, "class", "progress-bar svelte-14miwb5"), oe(v, "width", x), Yt(y, "class", "progress-bar-wrap svelte-14miwb5"), Yt(s, "class", "progress-level svelte-14miwb5");
    },
    m(l, g) {
      mt(l, s, g), be(s, i), m && m.m(i, null), be(s, e), be(s, y), be(y, v), u[30](v);
    },
    p(l, g) {
      /*progress*/
      l[7] != null ? m ? m.p(l, g) : (m = si(l), m.c(), m.m(i, null)) : m && (m.d(1), m = null), g[0] & /*last_progress_level*/
      32768 && x !== (x = `${/*last_progress_level*/
      l[15] * 100}%`) && oe(v, "width", x);
    },
    i: _s,
    o: _s,
    d(l) {
      l && gt(s), m && m.d(), u[30](null);
    }
  };
}
function si(u) {
  let s, i = $e(
    /*progress*/
    u[7]
  ), e = [];
  for (let y = 0; y < i.length; y += 1)
    e[y] = oi(Js(u, i, y));
  return {
    c() {
      for (let y = 0; y < e.length; y += 1)
        e[y].c();
      s = Le();
    },
    m(y, v) {
      for (let x = 0; x < e.length; x += 1)
        e[x] && e[x].m(y, v);
      mt(y, s, v);
    },
    p(y, v) {
      if (v[0] & /*progress_level, progress*/
      16512) {
        i = $e(
          /*progress*/
          y[7]
        );
        let x;
        for (x = 0; x < i.length; x += 1) {
          const m = Js(y, i, x);
          e[x] ? e[x].p(m, v) : (e[x] = oi(m), e[x].c(), e[x].m(s.parentNode, s));
        }
        for (; x < e.length; x += 1)
          e[x].d(1);
        e.length = i.length;
      }
    },
    d(y) {
      y && gt(s), Yi(e, y);
    }
  };
}
function ii(u) {
  let s, i, e, y, v = (
    /*i*/
    u[41] !== 0 && Oa()
  ), x = (
    /*p*/
    u[39].desc != null && ni(u)
  ), m = (
    /*p*/
    u[39].desc != null && /*progress_level*/
    u[14] && /*progress_level*/
    u[14][
      /*i*/
      u[41]
    ] != null && ri()
  ), l = (
    /*progress_level*/
    u[14] != null && ai(u)
  );
  return {
    c() {
      v && v.c(), s = Wt(), x && x.c(), i = Wt(), m && m.c(), e = Wt(), l && l.c(), y = Le();
    },
    m(g, h) {
      v && v.m(g, h), mt(g, s, h), x && x.m(g, h), mt(g, i, h), m && m.m(g, h), mt(g, e, h), l && l.m(g, h), mt(g, y, h);
    },
    p(g, h) {
      /*p*/
      g[39].desc != null ? x ? x.p(g, h) : (x = ni(g), x.c(), x.m(i.parentNode, i)) : x && (x.d(1), x = null), /*p*/
      g[39].desc != null && /*progress_level*/
      g[14] && /*progress_level*/
      g[14][
        /*i*/
        g[41]
      ] != null ? m || (m = ri(), m.c(), m.m(e.parentNode, e)) : m && (m.d(1), m = null), /*progress_level*/
      g[14] != null ? l ? l.p(g, h) : (l = ai(g), l.c(), l.m(y.parentNode, y)) : l && (l.d(1), l = null);
    },
    d(g) {
      g && (gt(s), gt(i), gt(e), gt(y)), v && v.d(g), x && x.d(g), m && m.d(g), l && l.d(g);
    }
  };
}
function Oa(u) {
  let s;
  return {
    c() {
      s = _t(" /");
    },
    m(i, e) {
      mt(i, s, e);
    },
    d(i) {
      i && gt(s);
    }
  };
}
function ni(u) {
  let s = (
    /*p*/
    u[39].desc + ""
  ), i;
  return {
    c() {
      i = _t(s);
    },
    m(e, y) {
      mt(e, i, y);
    },
    p(e, y) {
      y[0] & /*progress*/
      128 && s !== (s = /*p*/
      e[39].desc + "") && zt(i, s);
    },
    d(e) {
      e && gt(i);
    }
  };
}
function ri(u) {
  let s;
  return {
    c() {
      s = _t("-");
    },
    m(i, e) {
      mt(i, s, e);
    },
    d(i) {
      i && gt(s);
    }
  };
}
function ai(u) {
  let s = (100 * /*progress_level*/
  (u[14][
    /*i*/
    u[41]
  ] || 0)).toFixed(1) + "", i, e;
  return {
    c() {
      i = _t(s), e = _t("%");
    },
    m(y, v) {
      mt(y, i, v), mt(y, e, v);
    },
    p(y, v) {
      v[0] & /*progress_level*/
      16384 && s !== (s = (100 * /*progress_level*/
      (y[14][
        /*i*/
        y[41]
      ] || 0)).toFixed(1) + "") && zt(i, s);
    },
    d(y) {
      y && (gt(i), gt(e));
    }
  };
}
function oi(u) {
  let s, i = (
    /*p*/
    (u[39].desc != null || /*progress_level*/
    u[14] && /*progress_level*/
    u[14][
      /*i*/
      u[41]
    ] != null) && ii(u)
  );
  return {
    c() {
      i && i.c(), s = Le();
    },
    m(e, y) {
      i && i.m(e, y), mt(e, s, y);
    },
    p(e, y) {
      /*p*/
      e[39].desc != null || /*progress_level*/
      e[14] && /*progress_level*/
      e[14][
        /*i*/
        e[41]
      ] != null ? i ? i.p(e, y) : (i = ii(e), i.c(), i.m(s.parentNode, s)) : i && (i.d(1), i = null);
    },
    d(e) {
      e && gt(s), i && i.d(e);
    }
  };
}
function li(u) {
  let s, i;
  return {
    c() {
      s = Zt("p"), i = _t(
        /*loading_text*/
        u[9]
      ), Yt(s, "class", "loading svelte-14miwb5");
    },
    m(e, y) {
      mt(e, s, y), be(s, i);
    },
    p(e, y) {
      y[0] & /*loading_text*/
      512 && zt(
        i,
        /*loading_text*/
        e[9]
      );
    },
    d(e) {
      e && gt(s);
    }
  };
}
function Ha(u) {
  let s, i, e, y, v;
  const x = [Ra, xa], m = [];
  function l(g, h) {
    return (
      /*status*/
      g[4] === "pending" ? 0 : (
        /*status*/
        g[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(i = l(u)) && (e = m[i] = x[i](u)), {
    c() {
      s = Zt("div"), e && e.c(), Yt(s, "class", y = "wrap " + /*variant*/
      u[8] + " " + /*show_progress*/
      u[6] + " svelte-14miwb5"), Ht(s, "hide", !/*status*/
      u[4] || /*status*/
      u[4] === "complete" || /*show_progress*/
      u[6] === "hidden"), Ht(
        s,
        "translucent",
        /*variant*/
        u[8] === "center" && /*status*/
        (u[4] === "pending" || /*status*/
        u[4] === "error") || /*translucent*/
        u[11] || /*show_progress*/
        u[6] === "minimal"
      ), Ht(
        s,
        "generating",
        /*status*/
        u[4] === "generating"
      ), Ht(
        s,
        "border",
        /*border*/
        u[12]
      ), oe(
        s,
        "position",
        /*absolute*/
        u[10] ? "absolute" : "static"
      ), oe(
        s,
        "padding",
        /*absolute*/
        u[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(g, h) {
      mt(g, s, h), ~i && m[i].m(s, null), u[31](s), v = !0;
    },
    p(g, h) {
      let n = i;
      i = l(g), i === n ? ~i && m[i].p(g, h) : (e && (Wi(), Fe(m[n], 1, 1, () => {
        m[n] = null;
      }), ji()), ~i ? (e = m[i], e ? e.p(g, h) : (e = m[i] = x[i](g), e.c()), Re(e, 1), e.m(s, null)) : e = null), (!v || h[0] & /*variant, show_progress*/
      320 && y !== (y = "wrap " + /*variant*/
      g[8] + " " + /*show_progress*/
      g[6] + " svelte-14miwb5")) && Yt(s, "class", y), (!v || h[0] & /*variant, show_progress, status, show_progress*/
      336) && Ht(s, "hide", !/*status*/
      g[4] || /*status*/
      g[4] === "complete" || /*show_progress*/
      g[6] === "hidden"), (!v || h[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && Ht(
        s,
        "translucent",
        /*variant*/
        g[8] === "center" && /*status*/
        (g[4] === "pending" || /*status*/
        g[4] === "error") || /*translucent*/
        g[11] || /*show_progress*/
        g[6] === "minimal"
      ), (!v || h[0] & /*variant, show_progress, status*/
      336) && Ht(
        s,
        "generating",
        /*status*/
        g[4] === "generating"
      ), (!v || h[0] & /*variant, show_progress, border*/
      4416) && Ht(
        s,
        "border",
        /*border*/
        g[12]
      ), h[0] & /*absolute*/
      1024 && oe(
        s,
        "position",
        /*absolute*/
        g[10] ? "absolute" : "static"
      ), h[0] & /*absolute*/
      1024 && oe(
        s,
        "padding",
        /*absolute*/
        g[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(g) {
      v || (Re(e), v = !0);
    },
    o(g) {
      Fe(e), v = !1;
    },
    d(g) {
      g && gt(s), ~i && m[i].d(), u[31](null);
    }
  };
}
var Ba = function(u, s, i, e) {
  function y(v) {
    return v instanceof i ? v : new i(function(x) {
      x(v);
    });
  }
  return new (i || (i = Promise))(function(v, x) {
    function m(h) {
      try {
        g(e.next(h));
      } catch (n) {
        x(n);
      }
    }
    function l(h) {
      try {
        g(e.throw(h));
      } catch (n) {
        x(n);
      }
    }
    function g(h) {
      h.done ? v(h.value) : y(h.value).then(m, l);
    }
    g((e = e.apply(u, s || [])).next());
  });
};
let Ye = [], gs = !1;
function za(u) {
  return Ba(this, arguments, void 0, function* (s, i = !0) {
    if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && i !== !0)) {
      if (Ye.push(s), !gs)
        gs = !0;
      else
        return;
      yield Ca(), requestAnimationFrame(() => {
        let e = [0, 0];
        for (let y = 0; y < Ye.length; y++) {
          const x = Ye[y].getBoundingClientRect();
          (y === 0 || x.top + window.scrollY <= e[0]) && (e[0] = x.top + window.scrollY, e[1] = y);
        }
        window.scrollTo({ top: e[0] - 20, behavior: "smooth" }), gs = !1, Ye = [];
      });
    }
  });
}
function Ua(u, s, i) {
  let e, { $$slots: y = {}, $$scope: v } = s;
  this && this.__awaiter;
  let { i18n: x } = s, { eta: m = null } = s, { queue: l = !1 } = s, { queue_position: g } = s, { queue_size: h } = s, { status: n } = s, { scroll_to_output: f = !1 } = s, { timer: p = !0 } = s, { show_progress: C = "full" } = s, { message: r = null } = s, { progress: w = null } = s, { variant: t = "default" } = s, { loading_text: o = "Loading..." } = s, { absolute: A = !0 } = s, { translucent: b = !1 } = s, { border: R = !1 } = s, { autoscroll: L } = s, D, H = !1, X = 0, V = 0, q = null, tt = 0, rt = null, Y, B = null, U = !0;
  const j = () => {
    i(25, X = performance.now()), i(26, V = 0), H = !0, Q();
  };
  function Q() {
    requestAnimationFrame(() => {
      i(26, V = (performance.now() - X) / 1e3), H && Q();
    });
  }
  function J() {
    i(26, V = 0), H && (H = !1);
  }
  Ta(() => {
    H && J();
  });
  let it = null;
  function ht(Z) {
    Ws[Z ? "unshift" : "push"](() => {
      B = Z, i(16, B), i(7, w), i(14, rt), i(15, Y);
    });
  }
  function ot(Z) {
    Ws[Z ? "unshift" : "push"](() => {
      D = Z, i(13, D);
    });
  }
  return u.$$set = (Z) => {
    "i18n" in Z && i(1, x = Z.i18n), "eta" in Z && i(0, m = Z.eta), "queue" in Z && i(21, l = Z.queue), "queue_position" in Z && i(2, g = Z.queue_position), "queue_size" in Z && i(3, h = Z.queue_size), "status" in Z && i(4, n = Z.status), "scroll_to_output" in Z && i(22, f = Z.scroll_to_output), "timer" in Z && i(5, p = Z.timer), "show_progress" in Z && i(6, C = Z.show_progress), "message" in Z && i(23, r = Z.message), "progress" in Z && i(7, w = Z.progress), "variant" in Z && i(8, t = Z.variant), "loading_text" in Z && i(9, o = Z.loading_text), "absolute" in Z && i(10, A = Z.absolute), "translucent" in Z && i(11, b = Z.translucent), "border" in Z && i(12, R = Z.border), "autoscroll" in Z && i(24, L = Z.autoscroll), "$$scope" in Z && i(28, v = Z.$$scope);
  }, u.$$.update = () => {
    u.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
    169869313 && (m === null ? i(0, m = q) : l && i(0, m = (performance.now() - X) / 1e3 + m), m != null && (i(19, it = m.toFixed(1)), i(27, q = m))), u.$$.dirty[0] & /*eta, timer_diff*/
    67108865 && i(17, tt = m === null || m <= 0 || !V ? null : Math.min(V / m, 1)), u.$$.dirty[0] & /*progress*/
    128 && w != null && i(18, U = !1), u.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (w != null ? i(14, rt = w.map((Z) => {
      if (Z.index != null && Z.length != null)
        return Z.index / Z.length;
      if (Z.progress != null)
        return Z.progress;
    })) : i(14, rt = null), rt ? (i(15, Y = rt[rt.length - 1]), B && (Y === 0 ? i(16, B.style.transition = "0", B) : i(16, B.style.transition = "150ms", B))) : i(15, Y = void 0)), u.$$.dirty[0] & /*status*/
    16 && (n === "pending" ? j() : J()), u.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && D && f && (n === "pending" || n === "complete") && za(D, L), u.$$.dirty[0] & /*status, message*/
    8388624, u.$$.dirty[0] & /*timer_diff*/
    67108864 && i(20, e = V.toFixed(1));
  }, [
    m,
    x,
    g,
    h,
    n,
    p,
    C,
    w,
    t,
    o,
    A,
    b,
    R,
    D,
    rt,
    Y,
    B,
    tt,
    U,
    it,
    e,
    l,
    f,
    r,
    L,
    X,
    V,
    q,
    v,
    y,
    ht,
    ot
  ];
}
class Ga extends ga {
  constructor(s) {
    super(), wa(
      this,
      s,
      Ua,
      Ha,
      _a,
      {
        i18n: 1,
        eta: 0,
        queue: 21,
        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]
    );
  }
}
var ms = new Intl.Collator(0, { numeric: 1 }).compare;
function hi(u, s, i) {
  return u = u.split("."), s = s.split("."), ms(u[0], s[0]) || ms(u[1], s[1]) || (s[2] = s.slice(2).join("."), i = /[.-]/.test(u[2] = u.slice(2).join(".")), i == /[.-]/.test(s[2]) ? ms(u[2], s[2]) : i ? -1 : 1);
}
function ae(u, s, i) {
  return s.startsWith("http://") || s.startsWith("https://") ? i ? u : s : u + s;
}
function bs(u) {
  if (u.startsWith("http")) {
    const { protocol: s, host: i } = new URL(u);
    return i.endsWith("hf.space") ? {
      ws_protocol: "wss",
      host: i,
      http_protocol: s
    } : {
      ws_protocol: s === "https:" ? "wss" : "ws",
      http_protocol: s,
      host: i
    };
  } else if (u.startsWith("file:"))
    return {
      ws_protocol: "ws",
      http_protocol: "http:",
      host: "lite.local"
      // Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.
    };
  return {
    ws_protocol: "wss",
    http_protocol: "https:",
    host: u
  };
}
const Ki = /^[^\/]*\/[^\/]*$/, Va = /.*hf\.space\/{0,1}$/;
async function Xa(u, s) {
  const i = {};
  s && (i.Authorization = `Bearer ${s}`);
  const e = u.trim();
  if (Ki.test(e))
    try {
      const y = await fetch(
        `https://huggingface.co/api/spaces/${e}/host`,
        { headers: i }
      );
      if (y.status !== 200)
        throw new Error("Space metadata could not be loaded.");
      const v = (await y.json()).host;
      return {
        space_id: u,
        ...bs(v)
      };
    } catch (y) {
      throw new Error("Space metadata could not be loaded." + y.message);
    }
  if (Va.test(e)) {
    const { ws_protocol: y, http_protocol: v, host: x } = bs(e);
    return {
      space_id: x.replace(".hf.space", ""),
      ws_protocol: y,
      http_protocol: v,
      host: x
    };
  }
  return {
    space_id: !1,
    ...bs(e)
  };
}
function qa(u) {
  let s = {};
  return u.forEach(({ api_name: i }, e) => {
    i && (s[i] = e);
  }), s;
}
const ja = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;
async function ci(u) {
  try {
    const i = (await fetch(
      `https://huggingface.co/api/spaces/${u}/discussions`,
      {
        method: "HEAD"
      }
    )).headers.get("x-error-message");
    return !(i && ja.test(i));
  } catch {
    return !1;
  }
}
function Ce(u, s, i) {
  if (u == null)
    return null;
  if (Array.isArray(u)) {
    const e = [];
    for (const y of u)
      y == null ? e.push(null) : e.push(Ce(y, s, i));
    return e;
  }
  return u.is_stream ? i == null ? new xe({
    ...u,
    url: s + "/stream/" + u.path
  }) : new xe({
    ...u,
    url: "/proxy=" + i + "stream/" + u.path
  }) : new xe({
    ...u,
    url: Wa(u.path, s, i)
  });
}
function Ya(u) {
  try {
    const s = new URL(u);
    return s.protocol === "http:" || s.protocol === "https:";
  } catch {
    return !1;
  }
}
function Wa(u, s, i) {
  return u == null ? i ? `/proxy=${i}file=` : `${s}/file=` : Ya(u) ? u : i ? `/proxy=${i}file=${u}` : `${s}/file=${u}`;
}
async function Ka(u, s, i = $a) {
  let e = (Array.isArray(u) ? u : [u]).map(
    (y) => y.blob
  );
  return await Promise.all(
    await i(s, e).then(
      async (y) => {
        if (y.error)
          throw new Error(y.error);
        return y.files ? y.files.map((v, x) => {
          const m = new xe({ ...u[x], path: v });
          return Ce(m, s, null);
        }) : [];
      }
    )
  );
}
async function Ja(u, s) {
  return u.map(
    (i, e) => new xe({
      path: i.name,
      orig_name: i.name,
      blob: i,
      size: i.size,
      mime_type: i.type,
      is_stream: s
    })
  );
}
class xe {
  constructor({
    path: s,
    url: i,
    orig_name: e,
    size: y,
    blob: v,
    is_stream: x,
    mime_type: m,
    alt_text: l
  }) {
    this.path = s, this.url = i, this.orig_name = e, this.size = y, this.blob = i ? void 0 : v, this.is_stream = x, this.mime_type = m, this.alt_text = l;
  }
}
const Qa = "This application is too busy. Keep trying!", De = "Connection errored out.";
let Ji;
function Za(u, s) {
  return { post_data: i, upload_files: e, client: y, handle_blob: v };
  async function i(x, m, l) {
    const g = { "Content-Type": "application/json" };
    l && (g.Authorization = `Bearer ${l}`);
    try {
      var h = await u(x, {
        method: "POST",
        body: JSON.stringify(m),
        headers: g
      });
    } catch {
      return [{ error: De }, 500];
    }
    return [await h.json(), h.status];
  }
  async function e(x, m, l) {
    const g = {};
    l && (g.Authorization = `Bearer ${l}`);
    const h = 1e3, n = [];
    for (let p = 0; p < m.length; p += h) {
      const C = m.slice(p, p + h), r = new FormData();
      C.forEach((t) => {
        r.append("files", t);
      });
      try {
        var f = await u(`${x}/upload`, {
          method: "POST",
          body: r,
          headers: g
        });
      } catch {
        return { error: De };
      }
      const w = await f.json();
      n.push(...w);
    }
    return { files: n };
  }
  async function y(x, m = { normalise_files: !0 }) {
    return new Promise(async (l) => {
      const { status_callback: g, hf_token: h, normalise_files: n } = m, f = {
        predict: V,
        submit: q,
        view_api: rt,
        component_server: tt
      }, p = n ?? !0;
      if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) {
        const Y = await import("./wrapper-98f94c21-DwfcsYZ5.js");
        Ji = (await import("./__vite-browser-external-DYxpcVy9.js")).Blob, global.WebSocket = Y.WebSocket;
      }
      const { ws_protocol: C, http_protocol: r, host: w, space_id: t } = await Xa(x, h), o = Math.random().toString(36).substring(2), A = {};
      let b, R = {}, L = !1;
      h && t && (L = await eo(t, h));
      async function D(Y) {
        if (b = Y, R = qa(Y?.dependencies || []), b.auth_required)
          return {
            config: b,
            ...f
          };
        try {
          H = await rt(b);
        } catch (B) {
          console.error(`Could not get api details: ${B.message}`);
        }
        return {
          config: b,
          ...f
        };
      }
      let H;
      async function X(Y) {
        if (g && g(Y), Y.status === "running")
          try {
            b = await pi(
              u,
              `${r}//${w}`,
              h
            );
            const B = await D(b);
            l(B);
          } catch (B) {
            console.error(B), g && g({
              status: "error",
              message: "Could not load this space.",
              load_status: "error",
              detail: "NOT_FOUND"
            });
          }
      }
      try {
        b = await pi(
          u,
          `${r}//${w}`,
          h
        );
        const Y = await D(b);
        l(Y);
      } catch (Y) {
        console.error(Y), t ? Cs(
          t,
          Ki.test(t) ? "space_name" : "subdomain",
          X
        ) : g && g({
          status: "error",
          message: "Could not load this space.",
          load_status: "error",
          detail: "NOT_FOUND"
        });
      }
      function V(Y, B, U) {
        let j = !1, Q = !1, J;
        if (typeof Y == "number")
          J = b.dependencies[Y];
        else {
          const it = Y.replace(/^\//, "");
          J = b.dependencies[R[it]];
        }
        if (J.types.continuous)
          throw new Error(
            "Cannot call predict on this function as it may run forever. Use submit instead"
          );
        return new Promise((it, ht) => {
          const ot = q(Y, B, U);
          let Z;
          ot.on("data", (lt) => {
            Q && (ot.destroy(), it(lt)), j = !0, Z = lt;
          }).on("status", (lt) => {
            lt.stage === "error" && ht(lt), lt.stage === "complete" && (Q = !0, j && (ot.destroy(), it(Z)));
          });
        });
      }
      function q(Y, B, U) {
        let j, Q;
        if (typeof Y == "number")
          j = Y, Q = H.unnamed_endpoints[j];
        else {
          const d = Y.replace(/^\//, "");
          j = R[d], Q = H.named_endpoints[Y.trim()];
        }
        if (typeof j != "number")
          throw new Error(
            "There is no endpoint matching that name of fn_index matching that number."
          );
        let J, it, ht = b.protocol ?? "sse";
        const ot = typeof Y == "number" ? "/predict" : Y;
        let Z, lt = null, ct = !1;
        const $ = {};
        let k = "";
        typeof window < "u" && (k = new URLSearchParams(window.location.search).toString()), v(
          `${r}//${ae(w, b.path, !0)}`,
          B,
          Q,
          h
        ).then((d) => {
          if (Z = { data: d || [], event_data: U, fn_index: j }, so(j, b))
            S({
              type: "status",
              endpoint: ot,
              stage: "pending",
              queue: !1,
              fn_index: j,
              time: /* @__PURE__ */ new Date()
            }), i(
              `${r}//${ae(w, b.path, !0)}/run${ot.startsWith("/") ? ot : `/${ot}`}${k ? "?" + k : ""}`,
              {
                ...Z,
                session_hash: o
              },
              h
            ).then(([F, P]) => {
              const M = p ? vs(
                F.data,
                Q,
                b.root,
                b.root_url
              ) : F.data;
              P == 200 ? (S({
                type: "data",
                endpoint: ot,
                fn_index: j,
                data: M,
                time: /* @__PURE__ */ new Date()
              }), S({
                type: "status",
                endpoint: ot,
                fn_index: j,
                stage: "complete",
                eta: F.average_duration,
                queue: !1,
                time: /* @__PURE__ */ new Date()
              })) : S({
                type: "status",
                stage: "error",
                endpoint: ot,
                fn_index: j,
                message: F.error,
                queue: !1,
                time: /* @__PURE__ */ new Date()
              });
            }).catch((F) => {
              S({
                type: "status",
                stage: "error",
                message: F.message,
                endpoint: ot,
                fn_index: j,
                queue: !1,
                time: /* @__PURE__ */ new Date()
              });
            });
          else if (ht == "ws") {
            S({
              type: "status",
              stage: "pending",
              queue: !0,
              endpoint: ot,
              fn_index: j,
              time: /* @__PURE__ */ new Date()
            });
            let F = new URL(`${C}://${ae(
              w,
              b.path,
              !0
            )}
							/queue/join${k ? "?" + k : ""}`);
            L && F.searchParams.set("__sign", L), J = s(F), J.onclose = (P) => {
              P.wasClean || S({
                type: "status",
                stage: "error",
                broken: !0,
                message: De,
                queue: !0,
                endpoint: ot,
                fn_index: j,
                time: /* @__PURE__ */ new Date()
              });
            }, J.onmessage = function(P) {
              const M = JSON.parse(P.data), { type: N, status: G, data: z } = gi(
                M,
                A[j]
              );
              if (N === "update" && G && !ct)
                S({
                  type: "status",
                  endpoint: ot,
                  fn_index: j,
                  time: /* @__PURE__ */ new Date(),
                  ...G
                }), G.stage === "error" && J.close();
              else if (N === "hash") {
                J.send(JSON.stringify({ fn_index: j, session_hash: o }));
                return;
              } else
                N === "data" ? J.send(JSON.stringify({ ...Z, session_hash: o })) : N === "complete" ? ct = G : N === "log" ? S({
                  type: "log",
                  log: z.log,
                  level: z.level,
                  endpoint: ot,
                  fn_index: j
                }) : N === "generating" && S({
                  type: "status",
                  time: /* @__PURE__ */ new Date(),
                  ...G,
                  stage: G?.stage,
                  queue: !0,
                  endpoint: ot,
                  fn_index: j
                });
              z && (S({
                type: "data",
                time: /* @__PURE__ */ new Date(),
                data: p ? vs(
                  z.data,
                  Q,
                  b.root,
                  b.root_url
                ) : z.data,
                endpoint: ot,
                fn_index: j
              }), ct && (S({
                type: "status",
                time: /* @__PURE__ */ new Date(),
                ...ct,
                stage: G?.stage,
                queue: !0,
                endpoint: ot,
                fn_index: j
              }), J.close()));
            }, hi(b.version || "2.0.0", "3.6") < 0 && addEventListener(
              "open",
              () => J.send(JSON.stringify({ hash: o }))
            );
          } else {
            S({
              type: "status",
              stage: "pending",
              queue: !0,
              endpoint: ot,
              fn_index: j,
              time: /* @__PURE__ */ new Date()
            });
            var E = new URLSearchParams({
              fn_index: j.toString(),
              session_hash: o
            }).toString();
            let F = new URL(
              `${r}//${ae(
                w,
                b.path,
                !0
              )}/queue/join?${k ? k + "&" : ""}${E}`
            );
            it = new EventSource(F), it.onmessage = async function(P) {
              const M = JSON.parse(P.data), { type: N, status: G, data: z } = gi(
                M,
                A[j]
              );
              if (N === "update" && G && !ct)
                S({
                  type: "status",
                  endpoint: ot,
                  fn_index: j,
                  time: /* @__PURE__ */ new Date(),
                  ...G
                }), G.stage === "error" && it.close();
              else if (N === "data") {
                lt = M.event_id;
                let [O, I] = await i(
                  `${r}//${ae(
                    w,
                    b.path,
                    !0
                  )}/queue/data`,
                  {
                    ...Z,
                    session_hash: o,
                    event_id: lt
                  },
                  h
                );
                I !== 200 && (S({
                  type: "status",
                  stage: "error",
                  message: De,
                  queue: !0,
                  endpoint: ot,
                  fn_index: j,
                  time: /* @__PURE__ */ new Date()
                }), it.close());
              } else
                N === "complete" ? ct = G : N === "log" ? S({
                  type: "log",
                  log: z.log,
                  level: z.level,
                  endpoint: ot,
                  fn_index: j
                }) : N === "generating" && S({
                  type: "status",
                  time: /* @__PURE__ */ new Date(),
                  ...G,
                  stage: G?.stage,
                  queue: !0,
                  endpoint: ot,
                  fn_index: j
                });
              z && (S({
                type: "data",
                time: /* @__PURE__ */ new Date(),
                data: p ? vs(
                  z.data,
                  Q,
                  b.root,
                  b.root_url
                ) : z.data,
                endpoint: ot,
                fn_index: j
              }), ct && (S({
                type: "status",
                time: /* @__PURE__ */ new Date(),
                ...ct,
                stage: G?.stage,
                queue: !0,
                endpoint: ot,
                fn_index: j
              }), it.close()));
            };
          }
        });
        function S(d) {
          const F = $[d.type] || [];
          F?.forEach((P) => P(d));
        }
        function a(d, E) {
          const F = $, P = F[d] || [];
          return F[d] = P, P?.push(E), { on: a, off: c, cancel: T, destroy: _ };
        }
        function c(d, E) {
          const F = $;
          let P = F[d] || [];
          return P = P?.filter((M) => M !== E), F[d] = P, { on: a, off: c, cancel: T, destroy: _ };
        }
        async function T() {
          const d = {
            stage: "complete",
            queue: !1,
            time: /* @__PURE__ */ new Date()
          };
          ct = d, S({
            ...d,
            type: "status",
            endpoint: ot,
            fn_index: j
          });
          let E = {};
          ht === "ws" ? (J && J.readyState === 0 ? J.addEventListener("open", () => {
            J.close();
          }) : J.close(), E = { fn_index: j, session_hash: o }) : (it.close(), E = { event_id: lt });
          try {
            await u(
              `${r}//${ae(
                w,
                b.path,
                !0
              )}/reset`,
              {
                headers: { "Content-Type": "application/json" },
                method: "POST",
                body: JSON.stringify(E)
              }
            );
          } catch {
            console.warn(
              "The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable."
            );
          }
        }
        function _() {
          for (const d in $)
            $[d].forEach((E) => {
              c(d, E);
            });
        }
        return {
          on: a,
          off: c,
          cancel: T,
          destroy: _
        };
      }
      async function tt(Y, B, U) {
        var j;
        const Q = { "Content-Type": "application/json" };
        h && (Q.Authorization = `Bearer ${h}`);
        let J, it = b.components.find(
          (Z) => Z.id === Y
        );
        (j = it?.props) != null && j.root_url ? J = it.props.root_url : J = `${r}//${ae(
          w,
          b.path,
          !0
        )}/`;
        const ht = await u(
          `${J}component_server/`,
          {
            method: "POST",
            body: JSON.stringify({
              data: U,
              component_id: Y,
              fn_name: B,
              session_hash: o
            }),
            headers: Q
          }
        );
        if (!ht.ok)
          throw new Error(
            "Could not connect to component server: " + ht.statusText
          );
        return await ht.json();
      }
      async function rt(Y) {
        if (H)
          return H;
        const B = { "Content-Type": "application/json" };
        h && (B.Authorization = `Bearer ${h}`);
        let U;
        if (hi(Y.version || "2.0.0", "3.30") < 0 ? U = await u(
          "https://gradio-space-api-fetcher-v2.hf.space/api",
          {
            method: "POST",
            body: JSON.stringify({
              serialize: !1,
              config: JSON.stringify(Y)
            }),
            headers: B
          }
        ) : U = await u(`${Y.root}/info`, {
          headers: B
        }), !U.ok)
          throw new Error(De);
        let j = await U.json();
        return "api" in j && (j = j.api), j.named_endpoints["/predict"] && !j.unnamed_endpoints[0] && (j.unnamed_endpoints[0] = j.named_endpoints["/predict"]), to(j, Y, R);
      }
    });
  }
  async function v(x, m, l, g) {
    const h = await Es(
      m,
      void 0,
      [],
      !0,
      l
    );
    return Promise.all(
      h.map(async ({ path: n, blob: f, type: p }) => {
        if (f) {
          const C = (await e(x, [f], g)).files[0];
          return { path: n, file_url: C, type: p, name: f?.name };
        }
        return { path: n, type: p };
      })
    ).then((n) => (n.forEach(({ path: f, file_url: p, type: C, name: r }) => {
      if (C === "Gallery")
        fi(m, p, f);
      else if (p) {
        const w = new xe({ path: p, orig_name: r });
        fi(m, w, f);
      }
    }), m));
  }
}
const { post_data: rl, upload_files: $a, client: al, handle_blob: ol } = Za(
  fetch,
  (...u) => new WebSocket(...u)
);
function vs(u, s, i, e) {
  return u.map((y, v) => {
    var x, m, l, g;
    return ((m = (x = s?.returns) == null ? void 0 : x[v]) == null ? void 0 : m.component) === "File" ? Ce(y, i, e) : ((g = (l = s?.returns) == null ? void 0 : l[v]) == null ? void 0 : g.component) === "Gallery" ? y.map((h) => Array.isArray(h) ? [Ce(h[0], i, e), h[1]] : [Ce(h, i, e), null]) : typeof y == "object" && y.path ? Ce(y, i, e) : y;
  });
}
function di(u, s, i, e) {
  switch (u.type) {
    case "string":
      return "string";
    case "boolean":
      return "boolean";
    case "number":
      return "number";
  }
  if (i === "JSONSerializable" || i === "StringSerializable")
    return "any";
  if (i === "ListStringSerializable")
    return "string[]";
  if (s === "Image")
    return e === "parameter" ? "Blob | File | Buffer" : "string";
  if (i === "FileSerializable")
    return u?.type === "array" ? e === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : e === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";
  if (i === "GallerySerializable")
    return e === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]";
}
function ui(u, s) {
  return s === "GallerySerializable" ? "array of [file, label] tuples" : s === "ListStringSerializable" ? "array of strings" : s === "FileSerializable" ? "array of files or single file" : u.description;
}
function to(u, s, i) {
  const e = {
    named_endpoints: {},
    unnamed_endpoints: {}
  };
  for (const y in u) {
    const v = u[y];
    for (const x in v) {
      const m = s.dependencies[x] ? x : i[x.replace("/", "")], l = v[x];
      e[y][x] = {}, e[y][x].parameters = {}, e[y][x].returns = {}, e[y][x].type = s.dependencies[m].types, e[y][x].parameters = l.parameters.map(
        ({ label: g, component: h, type: n, serializer: f }) => ({
          label: g,
          component: h,
          type: di(n, h, f, "parameter"),
          description: ui(n, f)
        })
      ), e[y][x].returns = l.returns.map(
        ({ label: g, component: h, type: n, serializer: f }) => ({
          label: g,
          component: h,
          type: di(n, h, f, "return"),
          description: ui(n, f)
        })
      );
    }
  }
  return e;
}
async function eo(u, s) {
  try {
    return (await (await fetch(`https://huggingface.co/api/spaces/${u}/jwt`, {
      headers: {
        Authorization: `Bearer ${s}`
      }
    })).json()).token || !1;
  } catch (i) {
    return console.error(i), !1;
  }
}
function fi(u, s, i) {
  for (; i.length > 1; )
    u = u[i.shift()];
  u[i.shift()] = s;
}
async function Es(u, s = void 0, i = [], e = !1, y = void 0) {
  if (Array.isArray(u)) {
    let v = [];
    return await Promise.all(
      u.map(async (x, m) => {
        var l;
        let g = i.slice();
        g.push(m);
        const h = await Es(
          u[m],
          e ? ((l = y?.parameters[m]) == null ? void 0 : l.component) || void 0 : s,
          g,
          !1,
          y
        );
        v = v.concat(h);
      })
    ), v;
  } else {
    if (globalThis.Buffer && u instanceof globalThis.Buffer)
      return [
        {
          path: i,
          blob: s === "Image" ? !1 : new Ji([u]),
          type: s
        }
      ];
    if (typeof u == "object") {
      let v = [];
      for (let x in u)
        if (u.hasOwnProperty(x)) {
          let m = i.slice();
          m.push(x), v = v.concat(
            await Es(
              u[x],
              void 0,
              m,
              !1,
              y
            )
          );
        }
      return v;
    }
  }
  return [];
}
function so(u, s) {
  var i, e, y, v;
  return !(((e = (i = s?.dependencies) == null ? void 0 : i[u]) == null ? void 0 : e.queue) === null ? s.enable_queue : (v = (y = s?.dependencies) == null ? void 0 : y[u]) != null && v.queue) || !1;
}
async function pi(u, s, i) {
  const e = {};
  if (i && (e.Authorization = `Bearer ${i}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) {
    const y = window.gradio_config.root, v = window.gradio_config;
    return v.root = ae(s, v.root, !1), { ...v, path: y };
  } else if (s) {
    let y = await u(`${s}/config`, {
      headers: e
    });
    if (y.status === 200) {
      const v = await y.json();
      return v.path = v.path ?? "", v.root = s, v;
    }
    throw new Error("Could not get config.");
  }
  throw new Error("No config or app endpoint found");
}
async function Cs(u, s, i) {
  let e = s === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${u}` : `https://huggingface.co/api/spaces/${u}`, y, v;
  try {
    if (y = await fetch(e), v = y.status, v !== 200)
      throw new Error();
    y = await y.json();
  } catch {
    i({
      status: "error",
      load_status: "error",
      message: "Could not get space status",
      detail: "NOT_FOUND"
    });
    return;
  }
  if (!y || v !== 200)
    return;
  const {
    runtime: { stage: x },
    id: m
  } = y;
  switch (x) {
    case "STOPPED":
    case "SLEEPING":
      i({
        status: "sleeping",
        load_status: "pending",
        message: "Space is asleep. Waking it up...",
        detail: x
      }), setTimeout(() => {
        Cs(u, s, i);
      }, 1e3);
      break;
    case "PAUSED":
      i({
        status: "paused",
        load_status: "error",
        message: "This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",
        detail: x,
        discussions_enabled: await ci(m)
      });
      break;
    case "RUNNING":
    case "RUNNING_BUILDING":
      i({
        status: "running",
        load_status: "complete",
        message: "",
        detail: x
      });
      break;
    case "BUILDING":
      i({
        status: "building",
        load_status: "pending",
        message: "Space is building...",
        detail: x
      }), setTimeout(() => {
        Cs(u, s, i);
      }, 1e3);
      break;
    default:
      i({
        status: "space_error",
        load_status: "error",
        message: "This space is experiencing an issue.",
        detail: x,
        discussions_enabled: await ci(m)
      });
      break;
  }
}
function gi(u, s) {
  switch (u.msg) {
    case "send_data":
      return { type: "data" };
    case "send_hash":
      return { type: "hash" };
    case "queue_full":
      return {
        type: "update",
        status: {
          queue: !0,
          message: Qa,
          stage: "error",
          code: u.code,
          success: u.success
        }
      };
    case "estimation":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: s || "pending",
          code: u.code,
          size: u.queue_size,
          position: u.rank,
          eta: u.rank_eta,
          success: u.success
        }
      };
    case "progress":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: "pending",
          code: u.code,
          progress_data: u.progress_data,
          success: u.success
        }
      };
    case "log":
      return { type: "log", data: u };
    case "process_generating":
      return {
        type: "generating",
        status: {
          queue: !0,
          message: u.success ? null : u.output.error,
          stage: u.success ? "generating" : "error",
          code: u.code,
          progress_data: u.progress_data,
          eta: u.average_duration
        },
        data: u.success ? u.output : null
      };
    case "process_completed":
      return "error" in u.output ? {
        type: "update",
        status: {
          queue: !0,
          message: u.output.error,
          stage: "error",
          code: u.code,
          success: u.success
        }
      } : {
        type: "complete",
        status: {
          queue: !0,
          message: u.success ? void 0 : u.output.error,
          stage: u.success ? "complete" : "error",
          code: u.code,
          progress_data: u.progress_data,
          eta: u.output.average_duration
        },
        data: u.success ? u.output : null
      };
    case "process_starts":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: "pending",
          code: u.code,
          size: u.rank,
          position: 0,
          success: u.success
        }
      };
  }
  return { type: "none", status: { stage: "error", queue: !0 } };
}
const {
  SvelteComponent: io,
  append: mi,
  attr: Jt,
  binding_callbacks: no,
  bubble: de,
  create_slot: ro,
  detach: ao,
  element: bi,
  get_all_dirty_from_scope: oo,
  get_slot_changes: lo,
  init: ho,
  insert: co,
  listen: Ot,
  prevent_default: ue,
  run_all: uo,
  safe_not_equal: fo,
  space: po,
  stop_propagation: fe,
  toggle_class: re,
  transition_in: go,
  transition_out: mo,
  update_slot_base: bo
} = window.__gradio__svelte__internal, { createEventDispatcher: vo, tick: Ao, getContext: yo } = window.__gradio__svelte__internal;
function wo(u) {
  let s, i, e, y, v, x, m, l, g;
  const h = (
    /*#slots*/
    u[16].default
  ), n = ro(
    h,
    u,
    /*$$scope*/
    u[15],
    null
  );
  return {
    c() {
      s = bi("button"), n && n.c(), i = po(), e = bi("input"), Jt(e, "type", "file"), Jt(
        e,
        "accept",
        /*filetype*/
        u[0]
      ), e.multiple = y = /*file_count*/
      u[4] === "multiple" || void 0, Jt(e, "webkitdirectory", v = /*file_count*/
      u[4] === "directory" || void 0), Jt(e, "mozdirectory", x = /*file_count*/
      u[4] === "directory" || void 0), Jt(e, "class", "svelte-18dlsnh"), Jt(s, "class", "svelte-18dlsnh"), re(
        s,
        "hidden",
        /*hidden*/
        u[5]
      ), re(
        s,
        "center",
        /*center*/
        u[2]
      ), re(
        s,
        "boundedheight",
        /*boundedheight*/
        u[1]
      ), re(
        s,
        "flex",
        /*flex*/
        u[3]
      );
    },
    m(f, p) {
      co(f, s, p), n && n.m(s, null), mi(s, i), mi(s, e), u[24](e), m = !0, l || (g = [
        Ot(
          e,
          "change",
          /*load_files_from_upload*/
          u[9]
        ),
        Ot(s, "drag", fe(ue(
          /*drag_handler*/
          u[17]
        ))),
        Ot(s, "dragstart", fe(ue(
          /*dragstart_handler*/
          u[18]
        ))),
        Ot(s, "dragend", fe(ue(
          /*dragend_handler*/
          u[19]
        ))),
        Ot(s, "dragover", fe(ue(
          /*dragover_handler*/
          u[20]
        ))),
        Ot(s, "dragenter", fe(ue(
          /*dragenter_handler*/
          u[21]
        ))),
        Ot(s, "dragleave", fe(ue(
          /*dragleave_handler*/
          u[22]
        ))),
        Ot(s, "drop", fe(ue(
          /*drop_handler*/
          u[23]
        ))),
        Ot(
          s,
          "click",
          /*open_file_upload*/
          u[6]
        ),
        Ot(
          s,
          "drop",
          /*loadFilesFromDrop*/
          u[10]
        ),
        Ot(
          s,
          "dragenter",
          /*updateDragging*/
          u[8]
        ),
        Ot(
          s,
          "dragleave",
          /*updateDragging*/
          u[8]
        )
      ], l = !0);
    },
    p(f, [p]) {
      n && n.p && (!m || p & /*$$scope*/
      32768) && bo(
        n,
        h,
        f,
        /*$$scope*/
        f[15],
        m ? lo(
          h,
          /*$$scope*/
          f[15],
          p,
          null
        ) : oo(
          /*$$scope*/
          f[15]
        ),
        null
      ), (!m || p & /*filetype*/
      1) && Jt(
        e,
        "accept",
        /*filetype*/
        f[0]
      ), (!m || p & /*file_count*/
      16 && y !== (y = /*file_count*/
      f[4] === "multiple" || void 0)) && (e.multiple = y), (!m || p & /*file_count*/
      16 && v !== (v = /*file_count*/
      f[4] === "directory" || void 0)) && Jt(e, "webkitdirectory", v), (!m || p & /*file_count*/
      16 && x !== (x = /*file_count*/
      f[4] === "directory" || void 0)) && Jt(e, "mozdirectory", x), (!m || p & /*hidden*/
      32) && re(
        s,
        "hidden",
        /*hidden*/
        f[5]
      ), (!m || p & /*center*/
      4) && re(
        s,
        "center",
        /*center*/
        f[2]
      ), (!m || p & /*boundedheight*/
      2) && re(
        s,
        "boundedheight",
        /*boundedheight*/
        f[1]
      ), (!m || p & /*flex*/
      8) && re(
        s,
        "flex",
        /*flex*/
        f[3]
      );
    },
    i(f) {
      m || (go(n, f), m = !0);
    },
    o(f) {
      mo(n, f), m = !1;
    },
    d(f) {
      f && ao(s), n && n.d(f), u[24](null), l = !1, uo(g);
    }
  };
}
function So(u, s) {
  return !u || u === "*" ? !0 : u.endsWith("/*") ? s.startsWith(u.slice(0, -1)) : u === s;
}
function _o(u, s, i) {
  let { $$slots: e = {}, $$scope: y } = s;
  var v = this && this.__awaiter || function(U, j, Q, J) {
    function it(ht) {
      return ht instanceof Q ? ht : new Q(function(ot) {
        ot(ht);
      });
    }
    return new (Q || (Q = Promise))(function(ht, ot) {
      function Z($) {
        try {
          ct(J.next($));
        } catch (k) {
          ot(k);
        }
      }
      function lt($) {
        try {
          ct(J.throw($));
        } catch (k) {
          ot(k);
        }
      }
      function ct($) {
        $.done ? ht($.value) : it($.value).then(Z, lt);
      }
      ct((J = J.apply(U, j || [])).next());
    });
  };
  let { filetype: x = null } = s, { dragging: m = !1 } = s, { boundedheight: l = !0 } = s, { center: g = !0 } = s, { flex: h = !0 } = s, { file_count: n = "single" } = s, { disable_click: f = !1 } = s, { root: p } = s, { hidden: C = !1 } = s;
  const r = yo("upload_files");
  let w;
  const t = vo();
  function o() {
    i(11, m = !m);
  }
  function A() {
    f || (i(7, w.value = "", w), w.click());
  }
  function b(U) {
    return v(this, void 0, void 0, function* () {
      yield Ao();
      const j = yield Ka(U, p, r);
      return t("load", n === "single" ? j?.[0] : j), j || [];
    });
  }
  function R(U) {
    return v(this, void 0, void 0, function* () {
      if (!U.length)
        return;
      let j = U.map((J) => new File([J], J.name)), Q = yield Ja(j);
      return yield b(Q);
    });
  }
  function L(U) {
    return v(this, void 0, void 0, function* () {
      const j = U.target;
      j.files && (yield R(Array.from(j.files)));
    });
  }
  function D(U) {
    return v(this, void 0, void 0, function* () {
      var j;
      if (i(11, m = !1), !(!((j = U.dataTransfer) === null || j === void 0) && j.files))
        return;
      const Q = Array.from(U.dataTransfer.files).filter((J) => x?.split(",").some((it) => So(it, J.type)) ? !0 : (t("error", `Invalid file type only ${x} allowed.`), !1));
      yield R(Q);
    });
  }
  function H(U) {
    de.call(this, u, U);
  }
  function X(U) {
    de.call(this, u, U);
  }
  function V(U) {
    de.call(this, u, U);
  }
  function q(U) {
    de.call(this, u, U);
  }
  function tt(U) {
    de.call(this, u, U);
  }
  function rt(U) {
    de.call(this, u, U);
  }
  function Y(U) {
    de.call(this, u, U);
  }
  function B(U) {
    no[U ? "unshift" : "push"](() => {
      w = U, i(7, w);
    });
  }
  return u.$$set = (U) => {
    "filetype" in U && i(0, x = U.filetype), "dragging" in U && i(11, m = U.dragging), "boundedheight" in U && i(1, l = U.boundedheight), "center" in U && i(2, g = U.center), "flex" in U && i(3, h = U.flex), "file_count" in U && i(4, n = U.file_count), "disable_click" in U && i(12, f = U.disable_click), "root" in U && i(13, p = U.root), "hidden" in U && i(5, C = U.hidden), "$$scope" in U && i(15, y = U.$$scope);
  }, [
    x,
    l,
    g,
    h,
    n,
    C,
    A,
    w,
    o,
    L,
    D,
    m,
    f,
    p,
    R,
    y,
    e,
    H,
    X,
    V,
    q,
    tt,
    rt,
    Y,
    B
  ];
}
class Eo extends io {
  constructor(s) {
    super(), ho(this, s, _o, wo, fo, {
      filetype: 0,
      dragging: 11,
      boundedheight: 1,
      center: 2,
      flex: 3,
      file_count: 4,
      disable_click: 12,
      root: 13,
      hidden: 5,
      open_file_upload: 6,
      load_files: 14
    });
  }
  get open_file_upload() {
    return this.$$.ctx[6];
  }
  get load_files() {
    return this.$$.ctx[14];
  }
}
const {
  SvelteComponent: Co,
  append: vi,
  attr: To,
  check_outros: Ai,
  create_component: ks,
  destroy_component: xs,
  detach: ko,
  element: xo,
  group_outros: yi,
  init: Ro,
  insert: Fo,
  mount_component: Rs,
  safe_not_equal: Lo,
  set_style: wi,
  space: Si,
  toggle_class: _i,
  transition_in: Qt,
  transition_out: me
} = window.__gradio__svelte__internal, { createEventDispatcher: Po } = window.__gradio__svelte__internal;
function Ei(u) {
  let s, i;
  return s = new Ts({
    props: {
      Icon: fn,
      label: (
        /*i18n*/
        u[3]("common.edit")
      )
    }
  }), s.$on(
    "click",
    /*click_handler*/
    u[5]
  ), {
    c() {
      ks(s.$$.fragment);
    },
    m(e, y) {
      Rs(s, e, y), i = !0;
    },
    p(e, y) {
      const v = {};
      y & /*i18n*/
      8 && (v.label = /*i18n*/
      e[3]("common.edit")), s.$set(v);
    },
    i(e) {
      i || (Qt(s.$$.fragment, e), i = !0);
    },
    o(e) {
      me(s.$$.fragment, e), i = !1;
    },
    d(e) {
      xs(s, e);
    }
  };
}
function Ci(u) {
  let s, i;
  return s = new Ts({
    props: {
      Icon: kn,
      label: (
        /*i18n*/
        u[3]("common.undo")
      )
    }
  }), s.$on(
    "click",
    /*click_handler_1*/
    u[6]
  ), {
    c() {
      ks(s.$$.fragment);
    },
    m(e, y) {
      Rs(s, e, y), i = !0;
    },
    p(e, y) {
      const v = {};
      y & /*i18n*/
      8 && (v.label = /*i18n*/
      e[3]("common.undo")), s.$set(v);
    },
    i(e) {
      i || (Qt(s.$$.fragment, e), i = !0);
    },
    o(e) {
      me(s.$$.fragment, e), i = !1;
    },
    d(e) {
      xs(s, e);
    }
  };
}
function Mo(u) {
  let s, i, e, y, v, x = (
    /*editable*/
    u[0] && Ei(u)
  ), m = (
    /*undoable*/
    u[1] && Ci(u)
  );
  return y = new Ts({
    props: {
      Icon: rn,
      label: (
        /*i18n*/
        u[3]("common.clear")
      )
    }
  }), y.$on(
    "click",
    /*click_handler_2*/
    u[7]
  ), {
    c() {
      s = xo("div"), x && x.c(), i = Si(), m && m.c(), e = Si(), ks(y.$$.fragment), To(s, "class", "svelte-1wj0ocy"), _i(s, "not-absolute", !/*absolute*/
      u[2]), wi(
        s,
        "position",
        /*absolute*/
        u[2] ? "absolute" : "static"
      );
    },
    m(l, g) {
      Fo(l, s, g), x && x.m(s, null), vi(s, i), m && m.m(s, null), vi(s, e), Rs(y, s, null), v = !0;
    },
    p(l, [g]) {
      /*editable*/
      l[0] ? x ? (x.p(l, g), g & /*editable*/
      1 && Qt(x, 1)) : (x = Ei(l), x.c(), Qt(x, 1), x.m(s, i)) : x && (yi(), me(x, 1, 1, () => {
        x = null;
      }), Ai()), /*undoable*/
      l[1] ? m ? (m.p(l, g), g & /*undoable*/
      2 && Qt(m, 1)) : (m = Ci(l), m.c(), Qt(m, 1), m.m(s, e)) : m && (yi(), me(m, 1, 1, () => {
        m = null;
      }), Ai());
      const h = {};
      g & /*i18n*/
      8 && (h.label = /*i18n*/
      l[3]("common.clear")), y.$set(h), (!v || g & /*absolute*/
      4) && _i(s, "not-absolute", !/*absolute*/
      l[2]), g & /*absolute*/
      4 && wi(
        s,
        "position",
        /*absolute*/
        l[2] ? "absolute" : "static"
      );
    },
    i(l) {
      v || (Qt(x), Qt(m), Qt(y.$$.fragment, l), v = !0);
    },
    o(l) {
      me(x), me(m), me(y.$$.fragment, l), v = !1;
    },
    d(l) {
      l && ko(s), x && x.d(), m && m.d(), xs(y);
    }
  };
}
function Io(u, s, i) {
  let { editable: e = !1 } = s, { undoable: y = !1 } = s, { absolute: v = !0 } = s, { i18n: x } = s;
  const m = Po(), l = () => m("edit"), g = () => m("undo"), h = (n) => {
    m("clear"), n.stopPropagation();
  };
  return u.$$set = (n) => {
    "editable" in n && i(0, e = n.editable), "undoable" in n && i(1, y = n.undoable), "absolute" in n && i(2, v = n.absolute), "i18n" in n && i(3, x = n.i18n);
  }, [
    e,
    y,
    v,
    x,
    m,
    l,
    g,
    h
  ];
}
class No extends Co {
  constructor(s) {
    super(), Ro(this, s, Io, Mo, Lo, {
      editable: 0,
      undoable: 1,
      absolute: 2,
      i18n: 3
    });
  }
}
var Do = {
  /***/
  976: (
    /***/
    (u, s, i) => {
      i.d(s, {
        AnnotationLayer: () => (
          /* binding */
          ct
        ),
        FreeTextAnnotationElement: () => (
          /* binding */
          q
        ),
        InkAnnotationElement: () => (
          /* binding */
          Q
        ),
        StampAnnotationElement: () => (
          /* binding */
          Z
        )
      });
      var e = i(292), y = i(419), v = i(792);
      function x($) {
        return Math.floor(Math.max(0, Math.min(1, $)) * 255).toString(16).padStart(2, "0");
      }
      function m($) {
        return Math.max(0, Math.min(255, 255 * $));
      }
      class l {
        static CMYK_G([k, S, a, c]) {
          return ["G", 1 - Math.min(1, 0.3 * k + 0.59 * a + 0.11 * S + c)];
        }
        static G_CMYK([k]) {
          return ["CMYK", 0, 0, 0, 1 - k];
        }
        static G_RGB([k]) {
          return ["RGB", k, k, k];
        }
        static G_rgb([k]) {
          return k = m(k), [k, k, k];
        }
        static G_HTML([k]) {
          const S = x(k);
          return `#${S}${S}${S}`;
        }
        static RGB_G([k, S, a]) {
          return ["G", 0.3 * k + 0.59 * S + 0.11 * a];
        }
        static RGB_rgb(k) {
          return k.map(m);
        }
        static RGB_HTML(k) {
          return `#${k.map(x).join("")}`;
        }
        static T_HTML() {
          return "#00000000";
        }
        static T_rgb() {
          return [null];
        }
        static CMYK_RGB([k, S, a, c]) {
          return ["RGB", 1 - Math.min(1, k + c), 1 - Math.min(1, a + c), 1 - Math.min(1, S + c)];
        }
        static CMYK_rgb([k, S, a, c]) {
          return [m(1 - Math.min(1, k + c)), m(1 - Math.min(1, a + c)), m(1 - Math.min(1, S + c))];
        }
        static CMYK_HTML(k) {
          const S = this.CMYK_RGB(k).slice(1);
          return this.RGB_HTML(S);
        }
        static RGB_CMYK([k, S, a]) {
          const c = 1 - k, T = 1 - S, _ = 1 - a, d = Math.min(c, T, _);
          return ["CMYK", c, T, _, d];
        }
      }
      var g = i(284);
      const h = 1e3, n = 9, f = /* @__PURE__ */ new WeakSet();
      function p($) {
        return {
          width: $[2] - $[0],
          height: $[3] - $[1]
        };
      }
      class C {
        static create(k) {
          switch (k.data.annotationType) {
            case e.AnnotationType.LINK:
              return new w(k);
            case e.AnnotationType.TEXT:
              return new t(k);
            case e.AnnotationType.WIDGET:
              switch (k.data.fieldType) {
                case "Tx":
                  return new A(k);
                case "Btn":
                  return k.data.radioButton ? new L(k) : k.data.checkBox ? new R(k) : new D(k);
                case "Ch":
                  return new H(k);
                case "Sig":
                  return new b(k);
              }
              return new o(k);
            case e.AnnotationType.POPUP:
              return new X(k);
            case e.AnnotationType.FREETEXT:
              return new q(k);
            case e.AnnotationType.LINE:
              return new tt(k);
            case e.AnnotationType.SQUARE:
              return new rt(k);
            case e.AnnotationType.CIRCLE:
              return new Y(k);
            case e.AnnotationType.POLYLINE:
              return new B(k);
            case e.AnnotationType.CARET:
              return new j(k);
            case e.AnnotationType.INK:
              return new Q(k);
            case e.AnnotationType.POLYGON:
              return new U(k);
            case e.AnnotationType.HIGHLIGHT:
              return new J(k);
            case e.AnnotationType.UNDERLINE:
              return new it(k);
            case e.AnnotationType.SQUIGGLY:
              return new ht(k);
            case e.AnnotationType.STRIKEOUT:
              return new ot(k);
            case e.AnnotationType.STAMP:
              return new Z(k);
            case e.AnnotationType.FILEATTACHMENT:
              return new lt(k);
            default:
              return new r(k);
          }
        }
      }
      class r {
        #t = null;
        #e = !1;
        constructor(k, {
          isRenderable: S = !1,
          ignoreBorder: a = !1,
          createQuadrilaterals: c = !1
        } = {}) {
          this.isRenderable = S, this.data = k.data, this.layer = k.layer, this.linkService = k.linkService, this.downloadManager = k.downloadManager, this.imageResourcesPath = k.imageResourcesPath, this.renderForms = k.renderForms, this.svgFactory = k.svgFactory, this.annotationStorage = k.annotationStorage, this.enableScripting = k.enableScripting, this.hasJSActions = k.hasJSActions, this._fieldObjects = k.fieldObjects, this.parent = k.parent, S && (this.container = this._createContainer(a)), c && this._createQuadrilaterals();
        }
        static _hasPopupData({
          titleObj: k,
          contentsObj: S,
          richText: a
        }) {
          return !!(k?.str || S?.str || a?.str);
        }
        get hasPopupData() {
          return r._hasPopupData(this.data);
        }
        updateEdited(k) {
          if (!this.container)
            return;
          this.#t ||= {
            rect: this.data.rect.slice(0)
          };
          const {
            rect: S
          } = k;
          S && this.#s(S);
        }
        resetEdited() {
          this.#t && (this.#s(this.#t.rect), this.#t = null);
        }
        #s(k) {
          const {
            container: {
              style: S
            },
            data: {
              rect: a,
              rotation: c
            },
            parent: {
              viewport: {
                rawDims: {
                  pageWidth: T,
                  pageHeight: _,
                  pageX: d,
                  pageY: E
                }
              }
            }
          } = this;
          a?.splice(0, 4, ...k);
          const {
            width: F,
            height: P
          } = p(k);
          S.left = `${100 * (k[0] - d) / T}%`, S.top = `${100 * (_ - k[3] + E) / _}%`, c === 0 ? (S.width = `${100 * F / T}%`, S.height = `${100 * P / _}%`) : this.setRotation(c);
        }
        _createContainer(k) {
          const {
            data: S,
            parent: {
              page: a,
              viewport: c
            }
          } = this, T = document.createElement("section");
          T.setAttribute("data-annotation-id", S.id), this instanceof o || (T.tabIndex = h);
          const {
            style: _
          } = T;
          if (_.zIndex = this.parent.zIndex++, S.popupRef && T.setAttribute("aria-haspopup", "dialog"), S.alternativeText && (T.title = S.alternativeText), S.noRotate && T.classList.add("norotate"), !S.rect || this instanceof X) {
            const {
              rotation: O
            } = S;
            return !S.hasOwnCanvas && O !== 0 && this.setRotation(O, T), T;
          }
          const {
            width: d,
            height: E
          } = p(S.rect);
          if (!k && S.borderStyle.width > 0) {
            _.borderWidth = `${S.borderStyle.width}px`;
            const O = S.borderStyle.horizontalCornerRadius, I = S.borderStyle.verticalCornerRadius;
            if (O > 0 || I > 0) {
              const st = `calc(${O}px * var(--scale-factor)) / calc(${I}px * var(--scale-factor))`;
              _.borderRadius = st;
            } else if (this instanceof L) {
              const st = `calc(${d}px * var(--scale-factor)) / calc(${E}px * var(--scale-factor))`;
              _.borderRadius = st;
            }
            switch (S.borderStyle.style) {
              case e.AnnotationBorderStyleType.SOLID:
                _.borderStyle = "solid";
                break;
              case e.AnnotationBorderStyleType.DASHED:
                _.borderStyle = "dashed";
                break;
              case e.AnnotationBorderStyleType.BEVELED:
                (0, e.warn)("Unimplemented border style: beveled");
                break;
              case e.AnnotationBorderStyleType.INSET:
                (0, e.warn)("Unimplemented border style: inset");
                break;
              case e.AnnotationBorderStyleType.UNDERLINE:
                _.borderBottomStyle = "solid";
                break;
            }
            const W = S.borderColor || null;
            W ? (this.#e = !0, _.borderColor = e.Util.makeHexColor(W[0] | 0, W[1] | 0, W[2] | 0)) : _.borderWidth = 0;
          }
          const F = e.Util.normalizeRect([S.rect[0], a.view[3] - S.rect[1] + a.view[1], S.rect[2], a.view[3] - S.rect[3] + a.view[1]]), {
            pageWidth: P,
            pageHeight: M,
            pageX: N,
            pageY: G
          } = c.rawDims;
          _.left = `${100 * (F[0] - N) / P}%`, _.top = `${100 * (F[1] - G) / M}%`;
          const {
            rotation: z
          } = S;
          return S.hasOwnCanvas || z === 0 ? (_.width = `${100 * d / P}%`, _.height = `${100 * E / M}%`) : this.setRotation(z, T), T;
        }
        setRotation(k, S = this.container) {
          if (!this.data.rect)
            return;
          const {
            pageWidth: a,
            pageHeight: c
          } = this.parent.viewport.rawDims, {
            width: T,
            height: _
          } = p(this.data.rect);
          let d, E;
          k % 180 === 0 ? (d = 100 * T / a, E = 100 * _ / c) : (d = 100 * _ / a, E = 100 * T / c), S.style.width = `${d}%`, S.style.height = `${E}%`, S.setAttribute("data-main-rotation", (360 - k) % 360);
        }
        get _commonActions() {
          const k = (S, a, c) => {
            const T = c.detail[S], _ = T[0], d = T.slice(1);
            c.target.style[a] = l[`${_}_HTML`](d), this.annotationStorage.setValue(this.data.id, {
              [a]: l[`${_}_rgb`](d)
            });
          };
          return (0, e.shadow)(this, "_commonActions", {
            display: (S) => {
              const {
                display: a
              } = S.detail, c = a % 2 === 1;
              this.container.style.visibility = c ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                noView: c,
                noPrint: a === 1 || a === 2
              });
            },
            print: (S) => {
              this.annotationStorage.setValue(this.data.id, {
                noPrint: !S.detail.print
              });
            },
            hidden: (S) => {
              const {
                hidden: a
              } = S.detail;
              this.container.style.visibility = a ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                noPrint: a,
                noView: a
              });
            },
            focus: (S) => {
              setTimeout(() => S.target.focus({
                preventScroll: !1
              }), 0);
            },
            userName: (S) => {
              S.target.title = S.detail.userName;
            },
            readonly: (S) => {
              S.target.disabled = S.detail.readonly;
            },
            required: (S) => {
              this._setRequired(S.target, S.detail.required);
            },
            bgColor: (S) => {
              k("bgColor", "backgroundColor", S);
            },
            fillColor: (S) => {
              k("fillColor", "backgroundColor", S);
            },
            fgColor: (S) => {
              k("fgColor", "color", S);
            },
            textColor: (S) => {
              k("textColor", "color", S);
            },
            borderColor: (S) => {
              k("borderColor", "borderColor", S);
            },
            strokeColor: (S) => {
              k("strokeColor", "borderColor", S);
            },
            rotation: (S) => {
              const a = S.detail.rotation;
              this.setRotation(a), this.annotationStorage.setValue(this.data.id, {
                rotation: a
              });
            }
          });
        }
        _dispatchEventFromSandbox(k, S) {
          const a = this._commonActions;
          for (const c of Object.keys(S.detail))
            (k[c] || a[c])?.(S);
        }
        _setDefaultPropertiesFromJS(k) {
          if (!this.enableScripting)
            return;
          const S = this.annotationStorage.getRawValue(this.data.id);
          if (!S)
            return;
          const a = this._commonActions;
          for (const [c, T] of Object.entries(S)) {
            const _ = a[c];
            if (_) {
              const d = {
                detail: {
                  [c]: T
                },
                target: k
              };
              _(d), delete S[c];
            }
          }
        }
        _createQuadrilaterals() {
          if (!this.container)
            return;
          const {
            quadPoints: k
          } = this.data;
          if (!k)
            return;
          const [S, a, c, T] = this.data.rect;
          if (k.length === 1) {
            const [, {
              x: O,
              y: I
            }, {
              x: W,
              y: st
            }] = k[0];
            if (c === O && T === I && S === W && a === st)
              return;
          }
          const {
            style: _
          } = this.container;
          let d;
          if (this.#e) {
            const {
              borderColor: O,
              borderWidth: I
            } = _;
            _.borderWidth = 0, d = ["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="${O}" stroke-width="${I}">`], this.container.classList.add("hasBorder");
          }
          const E = c - S, F = T - a, {
            svgFactory: P
          } = this, M = P.createElement("svg");
          M.classList.add("quadrilateralsContainer"), M.setAttribute("width", 0), M.setAttribute("height", 0);
          const N = P.createElement("defs");
          M.append(N);
          const G = P.createElement("clipPath"), z = `clippath_${this.data.id}`;
          G.setAttribute("id", z), G.setAttribute("clipPathUnits", "objectBoundingBox"), N.append(G);
          for (const [, {
            x: O,
            y: I
          }, {
            x: W,
            y: st
          }] of k) {
            const K = P.createElement("rect"), et = (W - S) / E, ut = (T - I) / F, at = (O - W) / E, nt = (I - st) / F;
            K.setAttribute("x", et), K.setAttribute("y", ut), K.setAttribute("width", at), K.setAttribute("height", nt), G.append(K), d?.push(`<rect vector-effect="non-scaling-stroke" x="${et}" y="${ut}" width="${at}" height="${nt}"/>`);
          }
          this.#e && (d.push("</g></svg>')"), _.backgroundImage = d.join("")), this.container.append(M), this.container.style.clipPath = `url(#${z})`;
        }
        _createPopup() {
          const {
            container: k,
            data: S
          } = this;
          k.setAttribute("aria-haspopup", "dialog");
          const a = new X({
            data: {
              color: S.color,
              titleObj: S.titleObj,
              modificationDate: S.modificationDate,
              contentsObj: S.contentsObj,
              richText: S.richText,
              parentRect: S.rect,
              borderStyle: 0,
              id: `popup_${S.id}`,
              rotation: S.rotation
            },
            parent: this.parent,
            elements: [this]
          });
          this.parent.div.append(a.render());
        }
        render() {
          (0, e.unreachable)("Abstract method `AnnotationElement.render` called");
        }
        _getElementsByName(k, S = null) {
          const a = [];
          if (this._fieldObjects) {
            const c = this._fieldObjects[k];
            if (c)
              for (const {
                page: T,
                id: _,
                exportValues: d
              } of c) {
                if (T === -1 || _ === S)
                  continue;
                const E = typeof d == "string" ? d : null, F = document.querySelector(`[data-element-id="${_}"]`);
                if (F && !f.has(F)) {
                  (0, e.warn)(`_getElementsByName - element not allowed: ${_}`);
                  continue;
                }
                a.push({
                  id: _,
                  exportValue: E,
                  domElement: F
                });
              }
            return a;
          }
          for (const c of document.getElementsByName(k)) {
            const {
              exportValue: T
            } = c, _ = c.getAttribute("data-element-id");
            _ !== S && f.has(c) && a.push({
              id: _,
              exportValue: T,
              domElement: c
            });
          }
          return a;
        }
        show() {
          this.container && (this.container.hidden = !1), this.popup?.maybeShow();
        }
        hide() {
          this.container && (this.container.hidden = !0), this.popup?.forceHide();
        }
        getElementsToTriggerPopup() {
          return this.container;
        }
        addHighlightArea() {
          const k = this.getElementsToTriggerPopup();
          if (Array.isArray(k))
            for (const S of k)
              S.classList.add("highlightArea");
          else
            k.classList.add("highlightArea");
        }
        get _isEditable() {
          return !1;
        }
        _editOnDoubleClick() {
          if (!this._isEditable)
            return;
          const {
            annotationEditorType: k,
            data: {
              id: S
            }
          } = this;
          this.container.addEventListener("dblclick", () => {
            this.linkService.eventBus?.dispatch("switchannotationeditormode", {
              source: this,
              mode: k,
              editId: S
            });
          });
        }
      }
      class w extends r {
        constructor(k, S = null) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !!S?.ignoreBorder,
            createQuadrilaterals: !0
          }), this.isTooltipOnly = k.data.isTooltipOnly;
        }
        render() {
          const {
            data: k,
            linkService: S
          } = this, a = document.createElement("a");
          a.setAttribute("data-element-id", k.id);
          let c = !1;
          return k.url ? (S.addLinkAttributes(a, k.url, k.newWindow), c = !0) : k.action ? (this._bindNamedAction(a, k.action), c = !0) : k.attachment ? (this.#e(a, k.attachment, k.attachmentDest), c = !0) : k.setOCGState ? (this.#s(a, k.setOCGState), c = !0) : k.dest ? (this._bindLink(a, k.dest), c = !0) : (k.actions && (k.actions.Action || k.actions["Mouse Up"] || k.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(a, k), c = !0), k.resetForm ? (this._bindResetFormAction(a, k.resetForm), c = !0) : this.isTooltipOnly && !c && (this._bindLink(a, ""), c = !0)), this.container.classList.add("linkAnnotation"), c && this.container.append(a), this.container;
        }
        #t() {
          this.container.setAttribute("data-internal-link", "");
        }
        _bindLink(k, S) {
          k.href = this.linkService.getDestinationHash(S), k.onclick = () => (S && this.linkService.goToDestination(S), !1), (S || S === "") && this.#t();
        }
        _bindNamedAction(k, S) {
          k.href = this.linkService.getAnchorUrl(""), k.onclick = () => (this.linkService.executeNamedAction(S), !1), this.#t();
        }
        #e(k, S, a = null) {
          k.href = this.linkService.getAnchorUrl(""), k.onclick = () => (this.downloadManager?.openOrDownloadData(S.content, S.filename, a), !1), this.#t();
        }
        #s(k, S) {
          k.href = this.linkService.getAnchorUrl(""), k.onclick = () => (this.linkService.executeSetOCGState(S), !1), this.#t();
        }
        _bindJSAction(k, S) {
          k.href = this.linkService.getAnchorUrl("");
          const a = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
          for (const c of Object.keys(S.actions)) {
            const T = a.get(c);
            T && (k[T] = () => (this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: S.id,
                name: c
              }
            }), !1));
          }
          k.onclick || (k.onclick = () => !1), this.#t();
        }
        _bindResetFormAction(k, S) {
          const a = k.onclick;
          if (a || (k.href = this.linkService.getAnchorUrl("")), this.#t(), !this._fieldObjects) {
            (0, e.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), a || (k.onclick = () => !1);
            return;
          }
          k.onclick = () => {
            a?.();
            const {
              fields: c,
              refs: T,
              include: _
            } = S, d = [];
            if (c.length !== 0 || T.length !== 0) {
              const P = new Set(T);
              for (const M of c) {
                const N = this._fieldObjects[M] || [];
                for (const {
                  id: G
                } of N)
                  P.add(G);
              }
              for (const M of Object.values(this._fieldObjects))
                for (const N of M)
                  P.has(N.id) === _ && d.push(N);
            } else
              for (const P of Object.values(this._fieldObjects))
                d.push(...P);
            const E = this.annotationStorage, F = [];
            for (const P of d) {
              const {
                id: M
              } = P;
              switch (F.push(M), P.type) {
                case "text": {
                  const G = P.defaultValue || "";
                  E.setValue(M, {
                    value: G
                  });
                  break;
                }
                case "checkbox":
                case "radiobutton": {
                  const G = P.defaultValue === P.exportValues;
                  E.setValue(M, {
                    value: G
                  });
                  break;
                }
                case "combobox":
                case "listbox": {
                  const G = P.defaultValue || "";
                  E.setValue(M, {
                    value: G
                  });
                  break;
                }
                default:
                  continue;
              }
              const N = document.querySelector(`[data-element-id="${M}"]`);
              if (N) {
                if (!f.has(N)) {
                  (0, e.warn)(`_bindResetFormAction - element not allowed: ${M}`);
                  continue;
                }
              } else
                continue;
              N.dispatchEvent(new Event("resetform"));
            }
            return this.enableScripting && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: "app",
                ids: F,
                name: "ResetForm"
              }
            }), !1;
          };
        }
      }
      class t extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0
          });
        }
        render() {
          this.container.classList.add("textAnnotation");
          const k = document.createElement("img");
          return k.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", k.setAttribute("data-l10n-id", "pdfjs-text-annotation-type"), k.setAttribute("data-l10n-args", JSON.stringify({
            type: this.data.name
          })), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(k), this.container;
        }
      }
      class o extends r {
        render() {
          return this.container;
        }
        showElementAndHideCanvas(k) {
          this.data.hasOwnCanvas && (k.previousSibling?.nodeName === "CANVAS" && (k.previousSibling.hidden = !0), k.hidden = !1);
        }
        _getKeyModifier(k) {
          return e.FeatureTest.platform.isMac ? k.metaKey : k.ctrlKey;
        }
        _setEventListener(k, S, a, c, T) {
          a.includes("mouse") ? k.addEventListener(a, (_) => {
            this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: this.data.id,
                name: c,
                value: T(_),
                shift: _.shiftKey,
                modifier: this._getKeyModifier(_)
              }
            });
          }) : k.addEventListener(a, (_) => {
            if (a === "blur") {
              if (!S.focused || !_.relatedTarget)
                return;
              S.focused = !1;
            } else if (a === "focus") {
              if (S.focused)
                return;
              S.focused = !0;
            }
            T && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: this.data.id,
                name: c,
                value: T(_)
              }
            });
          });
        }
        _setEventListeners(k, S, a, c) {
          for (const [T, _] of a)
            (_ === "Action" || this.data.actions?.[_]) && ((_ === "Focus" || _ === "Blur") && (S ||= {
              focused: !1
            }), this._setEventListener(k, S, T, _, c), _ === "Focus" && !this.data.actions?.Blur ? this._setEventListener(k, S, "blur", "Blur", null) : _ === "Blur" && !this.data.actions?.Focus && this._setEventListener(k, S, "focus", "Focus", null));
        }
        _setBackgroundColor(k) {
          const S = this.data.backgroundColor || null;
          k.style.backgroundColor = S === null ? "transparent" : e.Util.makeHexColor(S[0], S[1], S[2]);
        }
        _setTextStyle(k) {
          const S = ["left", "center", "right"], {
            fontColor: a
          } = this.data.defaultAppearanceData, c = this.data.defaultAppearanceData.fontSize || n, T = k.style;
          let _;
          const d = 2, E = (F) => Math.round(10 * F) / 10;
          if (this.data.multiLine) {
            const F = Math.abs(this.data.rect[3] - this.data.rect[1] - d), P = Math.round(F / (e.LINE_FACTOR * c)) || 1, M = F / P;
            _ = Math.min(c, E(M / e.LINE_FACTOR));
          } else {
            const F = Math.abs(this.data.rect[3] - this.data.rect[1] - d);
            _ = Math.min(c, E(F / e.LINE_FACTOR));
          }
          T.fontSize = `calc(${_}px * var(--scale-factor))`, T.color = e.Util.makeHexColor(a[0], a[1], a[2]), this.data.textAlignment !== null && (T.textAlign = S[this.data.textAlignment]);
        }
        _setRequired(k, S) {
          S ? k.setAttribute("required", !0) : k.removeAttribute("required"), k.setAttribute("aria-required", S);
        }
      }
      class A extends o {
        constructor(k) {
          const S = k.renderForms || k.data.hasOwnCanvas || !k.data.hasAppearance && !!k.data.fieldValue;
          super(k, {
            isRenderable: S
          });
        }
        setPropertyOnSiblings(k, S, a, c) {
          const T = this.annotationStorage;
          for (const _ of this._getElementsByName(k.name, k.id))
            _.domElement && (_.domElement[S] = a), T.setValue(_.id, {
              [c]: a
            });
        }
        render() {
          const k = this.annotationStorage, S = this.data.id;
          this.container.classList.add("textWidgetAnnotation");
          let a = null;
          if (this.renderForms) {
            const c = k.getValue(S, {
              value: this.data.fieldValue
            });
            let T = c.value || "";
            const _ = k.getValue(S, {
              charLimit: this.data.maxLen
            }).charLimit;
            _ && T.length > _ && (T = T.slice(0, _));
            let d = c.formattedValue || this.data.textContent?.join(`
`) || null;
            d && this.data.comb && (d = d.replaceAll(/\s+/g, ""));
            const E = {
              userValue: T,
              formattedValue: d,
              lastCommittedValue: null,
              commitKey: 1,
              focused: !1
            };
            this.data.multiLine ? (a = document.createElement("textarea"), a.textContent = d ?? T, this.data.doNotScroll && (a.style.overflowY = "hidden")) : (a = document.createElement("input"), a.type = "text", a.setAttribute("value", d ?? T), this.data.doNotScroll && (a.style.overflowX = "hidden")), this.data.hasOwnCanvas && (a.hidden = !0), f.add(a), a.setAttribute("data-element-id", S), a.disabled = this.data.readOnly, a.name = this.data.fieldName, a.tabIndex = h, this._setRequired(a, this.data.required), _ && (a.maxLength = _), a.addEventListener("input", (P) => {
              k.setValue(S, {
                value: P.target.value
              }), this.setPropertyOnSiblings(a, "value", P.target.value, "value"), E.formattedValue = null;
            }), a.addEventListener("resetform", (P) => {
              const M = this.data.defaultFieldValue ?? "";
              a.value = E.userValue = M, E.formattedValue = null;
            });
            let F = (P) => {
              const {
                formattedValue: M
              } = E;
              M != null && (P.target.value = M), P.target.scrollLeft = 0;
            };
            if (this.enableScripting && this.hasJSActions) {
              a.addEventListener("focus", (M) => {
                if (E.focused)
                  return;
                const {
                  target: N
                } = M;
                E.userValue && (N.value = E.userValue), E.lastCommittedValue = N.value, E.commitKey = 1, this.data.actions?.Focus || (E.focused = !0);
              }), a.addEventListener("updatefromsandbox", (M) => {
                this.showElementAndHideCanvas(M.target);
                const N = {
                  value(G) {
                    E.userValue = G.detail.value ?? "", k.setValue(S, {
                      value: E.userValue.toString()
                    }), G.target.value = E.userValue;
                  },
                  formattedValue(G) {
                    const {
                      formattedValue: z
                    } = G.detail;
                    E.formattedValue = z, z != null && G.target !== document.activeElement && (G.target.value = z), k.setValue(S, {
                      formattedValue: z
                    });
                  },
                  selRange(G) {
                    G.target.setSelectionRange(...G.detail.selRange);
                  },
                  charLimit: (G) => {
                    const {
                      charLimit: z
                    } = G.detail, {
                      target: O
                    } = G;
                    if (z === 0) {
                      O.removeAttribute("maxLength");
                      return;
                    }
                    O.setAttribute("maxLength", z);
                    let I = E.userValue;
                    !I || I.length <= z || (I = I.slice(0, z), O.value = E.userValue = I, k.setValue(S, {
                      value: I
                    }), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: S,
                        name: "Keystroke",
                        value: I,
                        willCommit: !0,
                        commitKey: 1,
                        selStart: O.selectionStart,
                        selEnd: O.selectionEnd
                      }
                    }));
                  }
                };
                this._dispatchEventFromSandbox(N, M);
              }), a.addEventListener("keydown", (M) => {
                E.commitKey = 1;
                let N = -1;
                if (M.key === "Escape" ? N = 0 : M.key === "Enter" && !this.data.multiLine ? N = 2 : M.key === "Tab" && (E.commitKey = 3), N === -1)
                  return;
                const {
                  value: G
                } = M.target;
                E.lastCommittedValue !== G && (E.lastCommittedValue = G, E.userValue = G, this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: S,
                    name: "Keystroke",
                    value: G,
                    willCommit: !0,
                    commitKey: N,
                    selStart: M.target.selectionStart,
                    selEnd: M.target.selectionEnd
                  }
                }));
              });
              const P = F;
              F = null, a.addEventListener("blur", (M) => {
                if (!E.focused || !M.relatedTarget)
                  return;
                this.data.actions?.Blur || (E.focused = !1);
                const {
                  value: N
                } = M.target;
                E.userValue = N, E.lastCommittedValue !== N && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: S,
                    name: "Keystroke",
                    value: N,
                    willCommit: !0,
                    commitKey: E.commitKey,
                    selStart: M.target.selectionStart,
                    selEnd: M.target.selectionEnd
                  }
                }), P(M);
              }), this.data.actions?.Keystroke && a.addEventListener("beforeinput", (M) => {
                E.lastCommittedValue = null;
                const {
                  data: N,
                  target: G
                } = M, {
                  value: z,
                  selectionStart: O,
                  selectionEnd: I
                } = G;
                let W = O, st = I;
                switch (M.inputType) {
                  case "deleteWordBackward": {
                    const K = z.substring(0, O).match(/\w*[^\w]*$/);
                    K && (W -= K[0].length);
                    break;
                  }
                  case "deleteWordForward": {
                    const K = z.substring(O).match(/^[^\w]*\w*/);
                    K && (st += K[0].length);
                    break;
                  }
                  case "deleteContentBackward":
                    O === I && (W -= 1);
                    break;
                  case "deleteContentForward":
                    O === I && (st += 1);
                    break;
                }
                M.preventDefault(), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: S,
                    name: "Keystroke",
                    value: z,
                    change: N || "",
                    willCommit: !1,
                    selStart: W,
                    selEnd: st
                  }
                });
              }), this._setEventListeners(a, E, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (M) => M.target.value);
            }
            if (F && a.addEventListener("blur", F), this.data.comb) {
              const M = (this.data.rect[2] - this.data.rect[0]) / _;
              a.classList.add("comb"), a.style.letterSpacing = `calc(${M}px * var(--scale-factor) - 1ch)`;
            }
          } else
            a = document.createElement("div"), a.textContent = this.data.fieldValue, a.style.verticalAlign = "middle", a.style.display = "table-cell", this.data.hasOwnCanvas && (a.hidden = !0);
          return this._setTextStyle(a), this._setBackgroundColor(a), this._setDefaultPropertiesFromJS(a), this.container.append(a), this.container;
        }
      }
      class b extends o {
        constructor(k) {
          super(k, {
            isRenderable: !!k.data.hasOwnCanvas
          });
        }
      }
      class R extends o {
        constructor(k) {
          super(k, {
            isRenderable: k.renderForms
          });
        }
        render() {
          const k = this.annotationStorage, S = this.data, a = S.id;
          let c = k.getValue(a, {
            value: S.exportValue === S.fieldValue
          }).value;
          typeof c == "string" && (c = c !== "Off", k.setValue(a, {
            value: c
          })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
          const T = document.createElement("input");
          return f.add(T), T.setAttribute("data-element-id", a), T.disabled = S.readOnly, this._setRequired(T, this.data.required), T.type = "checkbox", T.name = S.fieldName, c && T.setAttribute("checked", !0), T.setAttribute("exportValue", S.exportValue), T.tabIndex = h, T.addEventListener("change", (_) => {
            const {
              name: d,
              checked: E
            } = _.target;
            for (const F of this._getElementsByName(d, a)) {
              const P = E && F.exportValue === S.exportValue;
              F.domElement && (F.domElement.checked = P), k.setValue(F.id, {
                value: P
              });
            }
            k.setValue(a, {
              value: E
            });
          }), T.addEventListener("resetform", (_) => {
            const d = S.defaultFieldValue || "Off";
            _.target.checked = d === S.exportValue;
          }), this.enableScripting && this.hasJSActions && (T.addEventListener("updatefromsandbox", (_) => {
            const d = {
              value(E) {
                E.target.checked = E.detail.value !== "Off", k.setValue(a, {
                  value: E.target.checked
                });
              }
            };
            this._dispatchEventFromSandbox(d, _);
          }), this._setEventListeners(T, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (_) => _.target.checked)), this._setBackgroundColor(T), this._setDefaultPropertiesFromJS(T), this.container.append(T), this.container;
        }
      }
      class L extends o {
        constructor(k) {
          super(k, {
            isRenderable: k.renderForms
          });
        }
        render() {
          this.container.classList.add("buttonWidgetAnnotation", "radioButton");
          const k = this.annotationStorage, S = this.data, a = S.id;
          let c = k.getValue(a, {
            value: S.fieldValue === S.buttonValue
          }).value;
          if (typeof c == "string" && (c = c !== S.buttonValue, k.setValue(a, {
            value: c
          })), c)
            for (const _ of this._getElementsByName(S.fieldName, a))
              k.setValue(_.id, {
                value: !1
              });
          const T = document.createElement("input");
          if (f.add(T), T.setAttribute("data-element-id", a), T.disabled = S.readOnly, this._setRequired(T, this.data.required), T.type = "radio", T.name = S.fieldName, c && T.setAttribute("checked", !0), T.tabIndex = h, T.addEventListener("change", (_) => {
            const {
              name: d,
              checked: E
            } = _.target;
            for (const F of this._getElementsByName(d, a))
              k.setValue(F.id, {
                value: !1
              });
            k.setValue(a, {
              value: E
            });
          }), T.addEventListener("resetform", (_) => {
            const d = S.defaultFieldValue;
            _.target.checked = d != null && d === S.buttonValue;
          }), this.enableScripting && this.hasJSActions) {
            const _ = S.buttonValue;
            T.addEventListener("updatefromsandbox", (d) => {
              const E = {
                value: (F) => {
                  const P = _ === F.detail.value;
                  for (const M of this._getElementsByName(F.target.name)) {
                    const N = P && M.id === a;
                    M.domElement && (M.domElement.checked = N), k.setValue(M.id, {
                      value: N
                    });
                  }
                }
              };
              this._dispatchEventFromSandbox(E, d);
            }), this._setEventListeners(T, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (d) => d.target.checked);
          }
          return this._setBackgroundColor(T), this._setDefaultPropertiesFromJS(T), this.container.append(T), this.container;
        }
      }
      class D extends w {
        constructor(k) {
          super(k, {
            ignoreBorder: k.data.hasAppearance
          });
        }
        render() {
          const k = super.render();
          k.classList.add("buttonWidgetAnnotation", "pushButton");
          const S = k.lastChild;
          return this.enableScripting && this.hasJSActions && S && (this._setDefaultPropertiesFromJS(S), S.addEventListener("updatefromsandbox", (a) => {
            this._dispatchEventFromSandbox({}, a);
          })), k;
        }
      }
      class H extends o {
        constructor(k) {
          super(k, {
            isRenderable: k.renderForms
          });
        }
        render() {
          this.container.classList.add("choiceWidgetAnnotation");
          const k = this.annotationStorage, S = this.data.id, a = k.getValue(S, {
            value: this.data.fieldValue
          }), c = document.createElement("select");
          f.add(c), c.setAttribute("data-element-id", S), c.disabled = this.data.readOnly, this._setRequired(c, this.data.required), c.name = this.data.fieldName, c.tabIndex = h;
          let T = this.data.combo && this.data.options.length > 0;
          this.data.combo || (c.size = this.data.options.length, this.data.multiSelect && (c.multiple = !0)), c.addEventListener("resetform", (P) => {
            const M = this.data.defaultFieldValue;
            for (const N of c.options)
              N.selected = N.value === M;
          });
          for (const P of this.data.options) {
            const M = document.createElement("option");
            M.textContent = P.displayValue, M.value = P.exportValue, a.value.includes(P.exportValue) && (M.setAttribute("selected", !0), T = !1), c.append(M);
          }
          let _ = null;
          if (T) {
            const P = document.createElement("option");
            P.value = " ", P.setAttribute("hidden", !0), P.setAttribute("selected", !0), c.prepend(P), _ = () => {
              P.remove(), c.removeEventListener("input", _), _ = null;
            }, c.addEventListener("input", _);
          }
          const d = (P) => {
            const M = P ? "value" : "textContent", {
              options: N,
              multiple: G
            } = c;
            return G ? Array.prototype.filter.call(N, (z) => z.selected).map((z) => z[M]) : N.selectedIndex === -1 ? null : N[N.selectedIndex][M];
          };
          let E = d(!1);
          const F = (P) => {
            const M = P.target.options;
            return Array.prototype.map.call(M, (N) => ({
              displayValue: N.textContent,
              exportValue: N.value
            }));
          };
          return this.enableScripting && this.hasJSActions ? (c.addEventListener("updatefromsandbox", (P) => {
            const M = {
              value(N) {
                _?.();
                const G = N.detail.value, z = new Set(Array.isArray(G) ? G : [G]);
                for (const O of c.options)
                  O.selected = z.has(O.value);
                k.setValue(S, {
                  value: d(!0)
                }), E = d(!1);
              },
              multipleSelection(N) {
                c.multiple = !0;
              },
              remove(N) {
                const G = c.options, z = N.detail.remove;
                G[z].selected = !1, c.remove(z), G.length > 0 && Array.prototype.findIndex.call(G, (I) => I.selected) === -1 && (G[0].selected = !0), k.setValue(S, {
                  value: d(!0),
                  items: F(N)
                }), E = d(!1);
              },
              clear(N) {
                for (; c.length !== 0; )
                  c.remove(0);
                k.setValue(S, {
                  value: null,
                  items: []
                }), E = d(!1);
              },
              insert(N) {
                const {
                  index: G,
                  displayValue: z,
                  exportValue: O
                } = N.detail.insert, I = c.children[G], W = document.createElement("option");
                W.textContent = z, W.value = O, I ? I.before(W) : c.append(W), k.setValue(S, {
                  value: d(!0),
                  items: F(N)
                }), E = d(!1);
              },
              items(N) {
                const {
                  items: G
                } = N.detail;
                for (; c.length !== 0; )
                  c.remove(0);
                for (const z of G) {
                  const {
                    displayValue: O,
                    exportValue: I
                  } = z, W = document.createElement("option");
                  W.textContent = O, W.value = I, c.append(W);
                }
                c.options.length > 0 && (c.options[0].selected = !0), k.setValue(S, {
                  value: d(!0),
                  items: F(N)
                }), E = d(!1);
              },
              indices(N) {
                const G = new Set(N.detail.indices);
                for (const z of N.target.options)
                  z.selected = G.has(z.index);
                k.setValue(S, {
                  value: d(!0)
                }), E = d(!1);
              },
              editable(N) {
                N.target.disabled = !N.detail.editable;
              }
            };
            this._dispatchEventFromSandbox(M, P);
          }), c.addEventListener("input", (P) => {
            const M = d(!0), N = d(!1);
            k.setValue(S, {
              value: M
            }), P.preventDefault(), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: S,
                name: "Keystroke",
                value: E,
                change: N,
                changeEx: M,
                willCommit: !1,
                commitKey: 1,
                keyDown: !1
              }
            });
          }), this._setEventListeners(c, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (P) => P.target.value)) : c.addEventListener("input", function(P) {
            k.setValue(S, {
              value: d(!0)
            });
          }), this.data.combo && this._setTextStyle(c), this._setBackgroundColor(c), this._setDefaultPropertiesFromJS(c), this.container.append(c), this.container;
        }
      }
      class X extends r {
        constructor(k) {
          const {
            data: S,
            elements: a
          } = k;
          super(k, {
            isRenderable: r._hasPopupData(S)
          }), this.elements = a;
        }
        render() {
          this.container.classList.add("popupAnnotation");
          const k = new V({
            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
          }), S = [];
          for (const a of this.elements)
            a.popup = k, S.push(a.data.id), a.addHighlightArea();
          return this.container.setAttribute("aria-controls", S.map((a) => `${e.AnnotationPrefix}${a}`).join(",")), this.container;
        }
      }
      class V {
        #t = this.#m.bind(this);
        #e = this.#T.bind(this);
        #s = this.#w.bind(this);
        #n = this.#A.bind(this);
        #r = null;
        #i = null;
        #a = null;
        #h = null;
        #l = null;
        #d = null;
        #u = null;
        #c = !1;
        #o = null;
        #p = null;
        #g = null;
        #f = null;
        #v = !1;
        constructor({
          container: k,
          color: S,
          elements: a,
          titleObj: c,
          modificationDate: T,
          contentsObj: _,
          richText: d,
          parent: E,
          rect: F,
          parentRect: P,
          open: M
        }) {
          this.#i = k, this.#f = c, this.#a = _, this.#g = d, this.#d = E, this.#r = S, this.#p = F, this.#u = P, this.#l = a, this.#h = y.PDFDateString.toDateObject(T), this.trigger = a.flatMap((N) => N.getElementsToTriggerPopup());
          for (const N of this.trigger)
            N.addEventListener("click", this.#n), N.addEventListener("mouseenter", this.#s), N.addEventListener("mouseleave", this.#e), N.classList.add("popupTriggerArea");
          for (const N of a)
            N.container?.addEventListener("keydown", this.#t);
          this.#i.hidden = !0, M && this.#A();
        }
        render() {
          if (this.#o)
            return;
          const {
            page: {
              view: k
            },
            viewport: {
              rawDims: {
                pageWidth: S,
                pageHeight: a,
                pageX: c,
                pageY: T
              }
            }
          } = this.#d, _ = this.#o = document.createElement("div");
          if (_.className = "popup", this.#r) {
            const K = _.style.outlineColor = e.Util.makeHexColor(...this.#r);
            CSS.supports("background-color", "color-mix(in srgb, red 30%, white)") ? _.style.backgroundColor = `color-mix(in srgb, ${K} 30%, white)` : _.style.backgroundColor = e.Util.makeHexColor(...this.#r.map((ut) => Math.floor(0.7 * (255 - ut) + ut)));
          }
          const d = document.createElement("span");
          d.className = "header";
          const E = document.createElement("h1");
          if (d.append(E), {
            dir: E.dir,
            str: E.textContent
          } = this.#f, _.append(d), this.#h) {
            const K = document.createElement("span");
            K.classList.add("popupDate"), K.setAttribute("data-l10n-id", "pdfjs-annotation-date-string"), K.setAttribute("data-l10n-args", JSON.stringify({
              date: this.#h.toLocaleDateString(),
              time: this.#h.toLocaleTimeString()
            })), d.append(K);
          }
          const F = this.#a, P = this.#g;
          if (P?.str && (!F?.str || F.str === P.str))
            g.XfaLayer.render({
              xfaHtml: P.html,
              intent: "richText",
              div: _
            }), _.lastChild.classList.add("richText", "popupContent");
          else {
            const K = this._formatContents(F);
            _.append(K);
          }
          let M = !!this.#u, N = M ? this.#u : this.#p;
          for (const K of this.#l)
            if (!N || e.Util.intersect(K.data.rect, N) !== null) {
              N = K.data.rect, M = !0;
              break;
            }
          const G = e.Util.normalizeRect([N[0], k[3] - N[1] + k[1], N[2], k[3] - N[3] + k[1]]), O = M ? N[2] - N[0] + 5 : 0, I = G[0] + O, W = G[1], {
            style: st
          } = this.#i;
          st.left = `${100 * (I - c) / S}%`, st.top = `${100 * (W - T) / a}%`, this.#i.append(_);
        }
        _formatContents({
          str: k,
          dir: S
        }) {
          const a = document.createElement("p");
          a.classList.add("popupContent"), a.dir = S;
          const c = k.split(/(?:\r\n?|\n)/);
          for (let T = 0, _ = c.length; T < _; ++T) {
            const d = c[T];
            a.append(document.createTextNode(d)), T < _ - 1 && a.append(document.createElement("br"));
          }
          return a;
        }
        #m(k) {
          k.altKey || k.shiftKey || k.ctrlKey || k.metaKey || (k.key === "Enter" || k.key === "Escape" && this.#c) && this.#A();
        }
        #A() {
          this.#c = !this.#c, this.#c ? (this.#w(), this.#i.addEventListener("click", this.#n), this.#i.addEventListener("keydown", this.#t)) : (this.#T(), this.#i.removeEventListener("click", this.#n), this.#i.removeEventListener("keydown", this.#t));
        }
        #w() {
          this.#o || this.render(), this.isVisible ? this.#c && this.#i.classList.add("focused") : (this.#i.hidden = !1, this.#i.style.zIndex = parseInt(this.#i.style.zIndex) + 1e3);
        }
        #T() {
          this.#i.classList.remove("focused"), !(this.#c || !this.isVisible) && (this.#i.hidden = !0, this.#i.style.zIndex = parseInt(this.#i.style.zIndex) - 1e3);
        }
        forceHide() {
          this.#v = this.isVisible, this.#v && (this.#i.hidden = !0);
        }
        maybeShow() {
          this.#v && (this.#v = !1, this.#i.hidden = !1);
        }
        get isVisible() {
          return this.#i.hidden === !1;
        }
      }
      class q extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.textContent = k.data.textContent, this.textPosition = k.data.textPosition, this.annotationEditorType = e.AnnotationEditorType.FREETEXT;
        }
        render() {
          if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
            const k = document.createElement("div");
            k.classList.add("annotationTextContent"), k.setAttribute("role", "comment");
            for (const S of this.textContent) {
              const a = document.createElement("span");
              a.textContent = S, k.append(a);
            }
            this.container.append(k);
          }
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
        }
        get _isEditable() {
          return this.data.hasOwnCanvas;
        }
      }
      class tt extends r {
        #t = null;
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("lineAnnotation");
          const k = this.data, {
            width: S,
            height: a
          } = p(k.rect), c = this.svgFactory.create(S, a, !0), T = this.#t = this.svgFactory.createElement("svg:line");
          return T.setAttribute("x1", k.rect[2] - k.lineCoordinates[0]), T.setAttribute("y1", k.rect[3] - k.lineCoordinates[1]), T.setAttribute("x2", k.rect[2] - k.lineCoordinates[2]), T.setAttribute("y2", k.rect[3] - k.lineCoordinates[3]), T.setAttribute("stroke-width", k.borderStyle.width || 1), T.setAttribute("stroke", "transparent"), T.setAttribute("fill", "transparent"), c.append(T), this.container.append(c), !k.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class rt extends r {
        #t = null;
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("squareAnnotation");
          const k = this.data, {
            width: S,
            height: a
          } = p(k.rect), c = this.svgFactory.create(S, a, !0), T = k.borderStyle.width, _ = this.#t = this.svgFactory.createElement("svg:rect");
          return _.setAttribute("x", T / 2), _.setAttribute("y", T / 2), _.setAttribute("width", S - T), _.setAttribute("height", a - T), _.setAttribute("stroke-width", T || 1), _.setAttribute("stroke", "transparent"), _.setAttribute("fill", "transparent"), c.append(_), this.container.append(c), !k.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class Y extends r {
        #t = null;
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("circleAnnotation");
          const k = this.data, {
            width: S,
            height: a
          } = p(k.rect), c = this.svgFactory.create(S, a, !0), T = k.borderStyle.width, _ = this.#t = this.svgFactory.createElement("svg:ellipse");
          return _.setAttribute("cx", S / 2), _.setAttribute("cy", a / 2), _.setAttribute("rx", S / 2 - T / 2), _.setAttribute("ry", a / 2 - T / 2), _.setAttribute("stroke-width", T || 1), _.setAttribute("stroke", "transparent"), _.setAttribute("fill", "transparent"), c.append(_), this.container.append(c), !k.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class B extends r {
        #t = null;
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
        }
        render() {
          this.container.classList.add(this.containerClassName);
          const k = this.data, {
            width: S,
            height: a
          } = p(k.rect), c = this.svgFactory.create(S, a, !0);
          let T = [];
          for (const d of k.vertices) {
            const E = d.x - k.rect[0], F = k.rect[3] - d.y;
            T.push(E + "," + F);
          }
          T = T.join(" ");
          const _ = this.#t = this.svgFactory.createElement(this.svgElementName);
          return _.setAttribute("points", T), _.setAttribute("stroke-width", k.borderStyle.width || 1), _.setAttribute("stroke", "transparent"), _.setAttribute("fill", "transparent"), c.append(_), this.container.append(c), !k.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class U extends B {
        constructor(k) {
          super(k), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
        }
      }
      class j extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
      }
      class Q extends r {
        #t = [];
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = e.AnnotationEditorType.INK;
        }
        render() {
          this.container.classList.add(this.containerClassName);
          const k = this.data, {
            width: S,
            height: a
          } = p(k.rect), c = this.svgFactory.create(S, a, !0);
          for (const T of k.inkLists) {
            let _ = [];
            for (const E of T) {
              const F = E.x - k.rect[0], P = k.rect[3] - E.y;
              _.push(`${F},${P}`);
            }
            _ = _.join(" ");
            const d = this.svgFactory.createElement(this.svgElementName);
            this.#t.push(d), d.setAttribute("points", _), d.setAttribute("stroke-width", k.borderStyle.width || 1), d.setAttribute("stroke", "transparent"), d.setAttribute("fill", "transparent"), !k.popupRef && this.hasPopupData && this._createPopup(), c.append(d);
          }
          return this.container.append(c), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class J extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this.container;
        }
      }
      class it extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
        }
      }
      class ht extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
        }
      }
      class ot extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
        }
      }
      class Z extends r {
        constructor(k) {
          super(k, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          return this.container.classList.add("stampAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
      }
      class lt extends r {
        #t = null;
        constructor(k) {
          super(k, {
            isRenderable: !0
          });
          const {
            filename: S,
            content: a
          } = this.data.file;
          this.filename = (0, y.getFilenameFromUrl)(S, !0), this.content = a, this.linkService.eventBus?.dispatch("fileattachmentannotation", {
            source: this,
            filename: S,
            content: a
          });
        }
        render() {
          this.container.classList.add("fileAttachmentAnnotation");
          const {
            container: k,
            data: S
          } = this;
          let a;
          S.hasAppearance || S.fillAlpha === 0 ? a = document.createElement("div") : (a = document.createElement("img"), a.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(S.name) ? "paperclip" : "pushpin"}.svg`, S.fillAlpha && S.fillAlpha < 1 && (a.style = `filter: opacity(${Math.round(S.fillAlpha * 100)}%);`)), a.addEventListener("dblclick", this.#e.bind(this)), this.#t = a;
          const {
            isMac: c
          } = e.FeatureTest.platform;
          return k.addEventListener("keydown", (T) => {
            T.key === "Enter" && (c ? T.metaKey : T.ctrlKey) && this.#e();
          }), !S.popupRef && this.hasPopupData ? this._createPopup() : a.classList.add("popupTriggerArea"), k.append(a), k;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
        #e() {
          this.downloadManager?.openOrDownloadData(this.content, this.filename);
        }
      }
      class ct {
        #t = null;
        #e = null;
        #s = /* @__PURE__ */ new Map();
        constructor({
          div: k,
          accessibilityManager: S,
          annotationCanvasMap: a,
          annotationEditorUIManager: c,
          page: T,
          viewport: _
        }) {
          this.div = k, this.#t = S, this.#e = a, this.page = T, this.viewport = _, this.zIndex = 0, this._annotationEditorUIManager = c;
        }
        #n(k, S) {
          const a = k.firstChild || k;
          a.id = `${e.AnnotationPrefix}${S}`, this.div.append(k), this.#t?.moveElementInDOM(this.div, k, a, !1);
        }
        async render(k) {
          const {
            annotations: S
          } = k, a = this.div;
          (0, y.setLayerDimensions)(a, this.viewport);
          const c = /* @__PURE__ */ new Map(), T = {
            data: null,
            layer: a,
            linkService: k.linkService,
            downloadManager: k.downloadManager,
            imageResourcesPath: k.imageResourcesPath || "",
            renderForms: k.renderForms !== !1,
            svgFactory: new y.DOMSVGFactory(),
            annotationStorage: k.annotationStorage || new v.AnnotationStorage(),
            enableScripting: k.enableScripting === !0,
            hasJSActions: k.hasJSActions,
            fieldObjects: k.fieldObjects,
            parent: this,
            elements: null
          };
          for (const _ of S) {
            if (_.noHTML)
              continue;
            const d = _.annotationType === e.AnnotationType.POPUP;
            if (d) {
              const P = c.get(_.id);
              if (!P)
                continue;
              T.elements = P;
            } else {
              const {
                width: P,
                height: M
              } = p(_.rect);
              if (P <= 0 || M <= 0)
                continue;
            }
            T.data = _;
            const E = C.create(T);
            if (!E.isRenderable)
              continue;
            if (!d && _.popupRef) {
              const P = c.get(_.popupRef);
              P ? P.push(E) : c.set(_.popupRef, [E]);
            }
            const F = E.render();
            _.hidden && (F.style.visibility = "hidden"), this.#n(F, _.id), E.annotationEditorType > 0 && (this.#s.set(E.data.id, E), this._annotationEditorUIManager?.renderAnnotationElement(E));
          }
          this.#r();
        }
        update({
          viewport: k
        }) {
          const S = this.div;
          this.viewport = k, (0, y.setLayerDimensions)(S, {
            rotation: k.rotation
          }), this.#r(), S.hidden = !1;
        }
        #r() {
          if (!this.#e)
            return;
          const k = this.div;
          for (const [S, a] of this.#e) {
            const c = k.querySelector(`[data-annotation-id="${S}"]`);
            if (!c)
              continue;
            a.className = "annotationContent";
            const {
              firstChild: T
            } = c;
            T ? T.nodeName === "CANVAS" ? T.replaceWith(a) : T.classList.contains("annotationContent") ? T.after(a) : T.before(a) : c.append(a);
          }
          this.#e.clear();
        }
        getEditableAnnotations() {
          return Array.from(this.#s.values());
        }
        getEditableAnnotation(k) {
          return this.#s.get(k);
        }
      }
    }
  ),
  /***/
  792: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        AnnotationStorage: () => (
          /* binding */
          m
        ),
        /* harmony export */
        PrintAnnotationStorage: () => (
          /* binding */
          l
        ),
        /* harmony export */
        SerializableEmpty: () => (
          /* binding */
          x
        )
        /* harmony export */
      });
      var e = i(292), y = i(310), v = i(651);
      const x = Object.freeze({
        map: null,
        hash: "",
        transfer: void 0
      });
      class m {
        #t = !1;
        #e = /* @__PURE__ */ new Map();
        constructor() {
          this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
        }
        getValue(h, n) {
          const f = this.#e.get(h);
          return f === void 0 ? n : Object.assign(n, f);
        }
        getRawValue(h) {
          return this.#e.get(h);
        }
        remove(h) {
          if (this.#e.delete(h), this.#e.size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
            for (const n of this.#e.values())
              if (n instanceof y.AnnotationEditor)
                return;
            this.onAnnotationEditor(null);
          }
        }
        setValue(h, n) {
          const f = this.#e.get(h);
          let p = !1;
          if (f !== void 0)
            for (const [C, r] of Object.entries(n))
              f[C] !== r && (p = !0, f[C] = r);
          else
            p = !0, this.#e.set(h, n);
          p && this.#s(), n instanceof y.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(n.constructor._type);
        }
        has(h) {
          return this.#e.has(h);
        }
        getAll() {
          return this.#e.size > 0 ? (0, e.objectFromMap)(this.#e) : null;
        }
        setAll(h) {
          for (const [n, f] of Object.entries(h))
            this.setValue(n, f);
        }
        get size() {
          return this.#e.size;
        }
        #s() {
          this.#t || (this.#t = !0, typeof this.onSetModified == "function" && this.onSetModified());
        }
        resetModified() {
          this.#t && (this.#t = !1, typeof this.onResetModified == "function" && this.onResetModified());
        }
        get print() {
          return new l(this);
        }
        get serializable() {
          if (this.#e.size === 0)
            return x;
          const h = /* @__PURE__ */ new Map(), n = new v.MurmurHash3_64(), f = [], p = /* @__PURE__ */ Object.create(null);
          let C = !1;
          for (const [r, w] of this.#e) {
            const t = w instanceof y.AnnotationEditor ? w.serialize(!1, p) : w;
            t && (h.set(r, t), n.update(`${r}:${JSON.stringify(t)}`), C ||= !!t.bitmap);
          }
          if (C)
            for (const r of h.values())
              r.bitmap && f.push(r.bitmap);
          return h.size > 0 ? {
            map: h,
            hash: n.hexdigest(),
            transfer: f
          } : x;
        }
        get editorStats() {
          let h = null;
          const n = /* @__PURE__ */ new Map();
          for (const f of this.#e.values()) {
            if (!(f instanceof y.AnnotationEditor))
              continue;
            const p = f.telemetryFinalData;
            if (!p)
              continue;
            const {
              type: C
            } = p;
            n.has(C) || n.set(C, Object.getPrototypeOf(f).constructor), h ||= /* @__PURE__ */ Object.create(null);
            const r = h[C] ||= /* @__PURE__ */ new Map();
            for (const [w, t] of Object.entries(p)) {
              if (w === "type")
                continue;
              let o = r.get(w);
              o || (o = /* @__PURE__ */ new Map(), r.set(w, o));
              const A = o.get(t) ?? 0;
              o.set(t, A + 1);
            }
          }
          for (const [f, p] of n)
            h[f] = p.computeTelemetryFinalData(h[f]);
          return h;
        }
      }
      class l extends m {
        #t;
        constructor(h) {
          super();
          const {
            map: n,
            hash: f,
            transfer: p
          } = h.serializable, C = structuredClone(n, p ? {
            transfer: p
          } : null);
          this.#t = {
            map: C,
            hash: f,
            transfer: p
          };
        }
        get print() {
          (0, e.unreachable)("Should not call PrintAnnotationStorage.print");
        }
        get serializable() {
          return this.#t;
        }
      }
    }
  ),
  /***/
  831: (
    /***/
    (u, s, i) => {
      i.a(u, async (e, y) => {
        try {
          let rt = function(_) {
            if (typeof _ == "string" || _ instanceof URL ? _ = {
              url: _
            } : (_ instanceof ArrayBuffer || ArrayBuffer.isView(_)) && (_ = {
              data: _
            }), typeof _ != "object")
              throw new Error("Invalid parameter in getDocument, need parameter object.");
            if (!_.url && !_.data && !_.range)
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            const d = new Q(), {
              docId: E
            } = d, F = _.url ? B(_.url) : null, P = _.data ? U(_.data) : null, M = _.httpHeaders || null, N = _.withCredentials === !0, G = _.password ?? null, z = _.range instanceof J ? _.range : null, O = Number.isInteger(_.rangeChunkSize) && _.rangeChunkSize > 0 ? _.rangeChunkSize : L;
            let I = _.worker instanceof lt ? _.worker : null;
            const W = _.verbosity, st = typeof _.docBaseUrl == "string" && !(0, m.isDataScheme)(_.docBaseUrl) ? _.docBaseUrl : null, K = typeof _.cMapUrl == "string" ? _.cMapUrl : null, et = _.cMapPacked !== !1, ut = _.CMapReaderFactory || V, at = typeof _.standardFontDataUrl == "string" ? _.standardFontDataUrl : null, nt = _.StandardFontDataFactory || tt, dt = _.stopAtErrors !== !0, ft = Number.isInteger(_.maxImageSize) && _.maxImageSize > -1 ? _.maxImageSize : -1, bt = _.isEvalSupported !== !1, yt = typeof _.isOffscreenCanvasSupported == "boolean" ? _.isOffscreenCanvasSupported : !v.isNodeJS, wt = Number.isInteger(_.canvasMaxAreaInBytes) ? _.canvasMaxAreaInBytes : -1, vt = typeof _.disableFontFace == "boolean" ? _.disableFontFace : v.isNodeJS, qt = _.fontExtraProperties === !0, xt = _.enableXfa === !0, It = _.ownerDocument || globalThis.document, Et = _.disableRange === !0, Rt = _.disableStream === !0, Kt = _.disableAutoFetch === !0, Ae = _.pdfBug === !0, Pe = z ? z.length : _.length ?? NaN, ze = typeof _.useSystemFonts == "boolean" ? _.useSystemFonts : !v.isNodeJS && !vt, ye = typeof _.useWorkerFetch == "boolean" ? _.useWorkerFetch : ut === m.DOMCMapReaderFactory && nt === m.DOMStandardFontDataFactory && K && at && (0, m.isValidFetchUrl)(K, document.baseURI) && (0, m.isValidFetchUrl)(at, document.baseURI), Lt = _.canvasFactory || new X({
              ownerDocument: It
            }), Tt = _.filterFactory || new q({
              docId: E,
              ownerDocument: It
            }), Ue = null;
            (0, v.setVerbosityLevel)(W);
            const Me = {
              canvasFactory: Lt,
              filterFactory: Tt
            };
            if (ye || (Me.cMapReaderFactory = new ut({
              baseUrl: K,
              isCompressed: et
            }), Me.standardFontDataFactory = new nt({
              baseUrl: at
            })), !I) {
              const Ie = {
                verbosity: W,
                port: f.GlobalWorkerOptions.workerPort
              };
              I = Ie.port ? lt.fromPort(Ie) : new lt(Ie), d._worker = I;
            }
            const we = {
              docId: E,
              apiVersion: "4.2.67",
              data: P,
              password: G,
              disableAutoFetch: Kt,
              rangeChunkSize: O,
              length: Pe,
              docBaseUrl: st,
              enableXfa: xt,
              evaluatorOptions: {
                maxImageSize: ft,
                disableFontFace: vt,
                ignoreErrors: dt,
                isEvalSupported: bt,
                isOffscreenCanvasSupported: yt,
                canvasMaxAreaInBytes: wt,
                fontExtraProperties: qt,
                useSystemFonts: ze,
                cMapUrl: ye ? K : null,
                standardFontDataUrl: ye ? at : null
              }
            }, Ct = {
              ignoreErrors: dt,
              disableFontFace: vt,
              fontExtraProperties: qt,
              enableXfa: xt,
              ownerDocument: It,
              disableAutoFetch: Kt,
              pdfBug: Ae,
              styleElement: Ue
            };
            return I.promise.then(function() {
              if (d.destroyed)
                throw new Error("Loading aborted");
              const Ie = Y(I, we), Qi = new Promise(function(es) {
                let Ne;
                z ? Ne = new w.PDFDataTransportStream(z, {
                  disableRange: Et,
                  disableStream: Rt
                }) : P || (Ne = ((ee) => v.isNodeJS ? function() {
                  return typeof fetch < "u" && typeof Response < "u" && "body" in Response.prototype;
                }() && (0, m.isValidFetchUrl)(ee.url) ? new t.PDFFetchStream(ee) : new A.PDFNodeStream(ee) : (0, m.isValidFetchUrl)(ee.url) ? new t.PDFFetchStream(ee) : new o.PDFNetworkStream(ee))({
                  url: F,
                  length: Pe,
                  httpHeaders: M,
                  withCredentials: N,
                  rangeChunkSize: O,
                  disableRange: Et,
                  disableStream: Rt
                })), es(Ne);
              });
              return Promise.all([Ie, Qi]).then(function([es, Ne]) {
                if (d.destroyed)
                  throw new Error("Loading aborted");
                const ss = new p.MessageHandler(E, es, I.port), ee = new ct(ss, d, Ne, Ct, Me);
                d._transport = ee, ss.send("Ready", null);
              });
            }).catch(d._capability.reject), d;
          }, B = function(_) {
            if (_ instanceof URL)
              return _.href;
            try {
              return new URL(_, window.location).href;
            } catch {
              if (v.isNodeJS && typeof _ == "string")
                return _;
            }
            throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
          }, U = function(_) {
            if (v.isNodeJS && typeof Buffer < "u" && _ instanceof Buffer)
              throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
            if (_ instanceof Uint8Array && _.byteLength === _.buffer.byteLength)
              return _;
            if (typeof _ == "string")
              return (0, v.stringToBytes)(_);
            if (_ instanceof ArrayBuffer || ArrayBuffer.isView(_) || typeof _ == "object" && !isNaN(_?.length))
              return new Uint8Array(_);
            throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
          }, j = function(_) {
            return typeof _ == "object" && Number.isInteger(_?.num) && _.num >= 0 && Number.isInteger(_?.gen) && _.gen >= 0;
          };
          i.d(s, {
            /* harmony export */
            PDFDataRangeTransport: () => (
              /* binding */
              J
            ),
            /* harmony export */
            PDFWorker: () => (
              /* binding */
              lt
            ),
            /* harmony export */
            build: () => (
              /* binding */
              T
            ),
            /* harmony export */
            getDocument: () => (
              /* binding */
              rt
            ),
            /* harmony export */
            version: () => (
              /* binding */
              c
            )
            /* harmony export */
          });
          var v = i(292), x = i(792), m = i(419), l = i(10), g = i(573), h = i(923), n = i(814), f = i(164), p = i(178), C = i(62), r = i(626), w = i(585), t = i(94), o = i(457), A = i(786), b = i(50), R = e([g, A]);
          [g, A] = R.then ? (await R)() : R;
          const L = 65536, D = 100, H = 5e3, X = v.isNodeJS ? g.NodeCanvasFactory : m.DOMCanvasFactory, V = v.isNodeJS ? g.NodeCMapReaderFactory : m.DOMCMapReaderFactory, q = v.isNodeJS ? g.NodeFilterFactory : m.DOMFilterFactory, tt = v.isNodeJS ? g.NodeStandardFontDataFactory : m.DOMStandardFontDataFactory;
          async function Y(_, d) {
            if (_.destroyed)
              throw new Error("Worker was destroyed");
            const E = await _.messageHandler.sendWithPromise("GetDocRequest", d, d.data ? [d.data.buffer] : null);
            if (_.destroyed)
              throw new Error("Worker was destroyed");
            return E;
          }
          class Q {
            static #t = 0;
            constructor() {
              this._capability = Promise.withResolvers(), this._transport = null, this._worker = null, this.docId = `d${Q.#t++}`, this.destroyed = !1, this.onPassword = null, this.onProgress = null;
            }
            get promise() {
              return this._capability.promise;
            }
            async destroy() {
              this.destroyed = !0;
              try {
                this._worker?.port && (this._worker._pendingDestroy = !0), await this._transport?.destroy();
              } catch (d) {
                throw this._worker?.port && delete this._worker._pendingDestroy, d;
              }
              this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
            }
          }
          class J {
            constructor(d, E, F = !1, P = null) {
              this.length = d, this.initialData = E, this.progressiveDone = F, this.contentDispositionFilename = P, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._progressiveDoneListeners = [], this._readyCapability = Promise.withResolvers();
            }
            addRangeListener(d) {
              this._rangeListeners.push(d);
            }
            addProgressListener(d) {
              this._progressListeners.push(d);
            }
            addProgressiveReadListener(d) {
              this._progressiveReadListeners.push(d);
            }
            addProgressiveDoneListener(d) {
              this._progressiveDoneListeners.push(d);
            }
            onDataRange(d, E) {
              for (const F of this._rangeListeners)
                F(d, E);
            }
            onDataProgress(d, E) {
              this._readyCapability.promise.then(() => {
                for (const F of this._progressListeners)
                  F(d, E);
              });
            }
            onDataProgressiveRead(d) {
              this._readyCapability.promise.then(() => {
                for (const E of this._progressiveReadListeners)
                  E(d);
              });
            }
            onDataProgressiveDone() {
              this._readyCapability.promise.then(() => {
                for (const d of this._progressiveDoneListeners)
                  d();
              });
            }
            transportReady() {
              this._readyCapability.resolve();
            }
            requestDataRange(d, E) {
              (0, v.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
            abort() {
            }
          }
          class it {
            constructor(d, E) {
              this._pdfInfo = d, this._transport = E;
            }
            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, v.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            get allXfaHtml() {
              return this._transport._htmlForXfa;
            }
            getPage(d) {
              return this._transport.getPage(d);
            }
            getPageIndex(d) {
              return this._transport.getPageIndex(d);
            }
            getDestinations() {
              return this._transport.getDestinations();
            }
            getDestination(d) {
              return this._transport.getDestination(d);
            }
            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({
              intent: d = "display"
            } = {}) {
              const {
                renderingIntent: E
              } = this._transport.getRenderingIntent(d);
              return this._transport.getOptionalContentConfig(E);
            }
            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(d = !1) {
              return this._transport.startCleanup(d || this.isPureXfa);
            }
            destroy() {
              return this.loadingTask.destroy();
            }
            cachedPageNumber(d) {
              return this._transport.cachedPageNumber(d);
            }
            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();
            }
          }
          class ht {
            #t = null;
            #e = !1;
            constructor(d, E, F, P = !1) {
              this._pageIndex = d, this._pageInfo = E, this._transport = F, this._stats = P ? new m.StatTimer() : null, this._pdfBug = P, this.commonObjs = F.commonObjs, this.objs = new k(), 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: d,
              rotation: E = this.rotate,
              offsetX: F = 0,
              offsetY: P = 0,
              dontFlip: M = !1
            } = {}) {
              return new m.PageViewport({
                viewBox: this.view,
                scale: d,
                rotation: E,
                offsetX: F,
                offsetY: P,
                dontFlip: M
              });
            }
            getAnnotations({
              intent: d = "display"
            } = {}) {
              const {
                renderingIntent: E
              } = this._transport.getRenderingIntent(d);
              return this._transport.getAnnotations(this._pageIndex, E);
            }
            getJSActions() {
              return this._transport.getPageJSActions(this._pageIndex);
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get isPureXfa() {
              return (0, v.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            async getXfa() {
              return this._transport._htmlForXfa?.children[this._pageIndex] || null;
            }
            render({
              canvasContext: d,
              viewport: E,
              intent: F = "display",
              annotationMode: P = v.AnnotationMode.ENABLE,
              transform: M = null,
              background: N = null,
              optionalContentConfigPromise: G = null,
              annotationCanvasMap: z = null,
              pageColors: O = null,
              printAnnotationStorage: I = null
            }) {
              this._stats?.time("Overall");
              const W = this._transport.getRenderingIntent(F, P, I), {
                renderingIntent: st,
                cacheKey: K
              } = W;
              this.#e = !1, this.#n(), G ||= this._transport.getOptionalContentConfig(st);
              let et = this._intentStates.get(K);
              et || (et = /* @__PURE__ */ Object.create(null), this._intentStates.set(K, et)), et.streamReaderCancelTimeout && (clearTimeout(et.streamReaderCancelTimeout), et.streamReaderCancelTimeout = null);
              const ut = !!(st & v.RenderingIntentFlag.PRINT);
              et.displayReadyCapability || (et.displayReadyCapability = Promise.withResolvers(), et.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, this._stats?.time("Page Request"), this._pumpOperatorList(W));
              const at = (ft) => {
                et.renderTasks.delete(nt), (this._maybeCleanupAfterRender || ut) && (this.#e = !0), this.#s(!ut), ft ? (nt.capability.reject(ft), this._abortOperatorList({
                  intentState: et,
                  reason: ft instanceof Error ? ft : new Error(ft)
                })) : nt.capability.resolve(), this._stats?.timeEnd("Rendering"), this._stats?.timeEnd("Overall");
              }, nt = new a({
                callback: at,
                params: {
                  canvasContext: d,
                  viewport: E,
                  transform: M,
                  background: N
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                annotationCanvasMap: z,
                operatorList: et.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: this._transport.canvasFactory,
                filterFactory: this._transport.filterFactory,
                useRequestAnimationFrame: !ut,
                pdfBug: this._pdfBug,
                pageColors: O
              });
              (et.renderTasks ||= /* @__PURE__ */ new Set()).add(nt);
              const dt = nt.task;
              return Promise.all([et.displayReadyCapability.promise, G]).then(([ft, bt]) => {
                if (this.destroyed) {
                  at();
                  return;
                }
                if (this._stats?.time("Rendering"), !(bt.renderingIntent & st))
                  throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
                nt.initializeGraphics({
                  transparency: ft,
                  optionalContentConfig: bt
                }), nt.operatorListChanged();
              }).catch(at), dt;
            }
            getOperatorList({
              intent: d = "display",
              annotationMode: E = v.AnnotationMode.ENABLE,
              printAnnotationStorage: F = null
            } = {}) {
              function P() {
                N.operatorList.lastChunk && (N.opListReadCapability.resolve(N.operatorList), N.renderTasks.delete(G));
              }
              const M = this._transport.getRenderingIntent(d, E, F, !0);
              let N = this._intentStates.get(M.cacheKey);
              N || (N = /* @__PURE__ */ Object.create(null), this._intentStates.set(M.cacheKey, N));
              let G;
              return N.opListReadCapability || (G = /* @__PURE__ */ Object.create(null), G.operatorListChanged = P, N.opListReadCapability = Promise.withResolvers(), (N.renderTasks ||= /* @__PURE__ */ new Set()).add(G), N.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, this._stats?.time("Page Request"), this._pumpOperatorList(M)), N.opListReadCapability.promise;
            }
            streamTextContent({
              includeMarkedContent: d = !1,
              disableNormalization: E = !1
            } = {}) {
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                includeMarkedContent: d === !0,
                disableNormalization: E === !0
              }, {
                highWaterMark: 100,
                size(P) {
                  return P.items.length;
                }
              });
            }
            getTextContent(d = {}) {
              if (this._transport._htmlForXfa)
                return this.getXfa().then((F) => b.XfaText.textContent(F));
              const E = this.streamTextContent(d);
              return new Promise(function(F, P) {
                function M() {
                  N.read().then(function({
                    value: z,
                    done: O
                  }) {
                    if (O) {
                      F(G);
                      return;
                    }
                    Object.assign(G.styles, z.styles), G.items.push(...z.items), M();
                  }, P);
                }
                const N = E.getReader(), G = {
                  items: [],
                  styles: /* @__PURE__ */ Object.create(null)
                };
                M();
              });
            }
            getStructTree() {
              return this._transport.getStructTree(this._pageIndex);
            }
            _destroy() {
              this.destroyed = !0;
              const d = [];
              for (const E of this._intentStates.values())
                if (this._abortOperatorList({
                  intentState: E,
                  reason: new Error("Page was destroyed."),
                  force: !0
                }), !E.opListReadCapability)
                  for (const F of E.renderTasks)
                    d.push(F.completed), F.cancel();
              return this.objs.clear(), this.#e = !1, this.#n(), Promise.all(d);
            }
            cleanup(d = !1) {
              this.#e = !0;
              const E = this.#s(!1);
              return d && E && (this._stats &&= new m.StatTimer()), E;
            }
            #s(d = !1) {
              if (this.#n(), !this.#e || this.destroyed)
                return !1;
              if (d)
                return this.#t = setTimeout(() => {
                  this.#t = null, this.#s(!1);
                }, H), !1;
              for (const {
                renderTasks: E,
                operatorList: F
              } of this._intentStates.values())
                if (E.size > 0 || !F.lastChunk)
                  return !1;
              return this._intentStates.clear(), this.objs.clear(), this.#e = !1, !0;
            }
            #n() {
              this.#t && (clearTimeout(this.#t), this.#t = null);
            }
            _startRenderPage(d, E) {
              const F = this._intentStates.get(E);
              F && (this._stats?.timeEnd("Page Request"), F.displayReadyCapability?.resolve(d));
            }
            _renderPageChunk(d, E) {
              for (let F = 0, P = d.length; F < P; F++)
                E.operatorList.fnArray.push(d.fnArray[F]), E.operatorList.argsArray.push(d.argsArray[F]);
              E.operatorList.lastChunk = d.lastChunk, E.operatorList.separateAnnots = d.separateAnnots;
              for (const F of E.renderTasks)
                F.operatorListChanged();
              d.lastChunk && this.#s(!0);
            }
            _pumpOperatorList({
              renderingIntent: d,
              cacheKey: E,
              annotationStorageSerializable: F
            }) {
              const {
                map: P,
                transfer: M
              } = F, G = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: d,
                cacheKey: E,
                annotationStorage: P
              }, M).getReader(), z = this._intentStates.get(E);
              z.streamReader = G;
              const O = () => {
                G.read().then(({
                  value: I,
                  done: W
                }) => {
                  if (W) {
                    z.streamReader = null;
                    return;
                  }
                  this._transport.destroyed || (this._renderPageChunk(I, z), O());
                }, (I) => {
                  if (z.streamReader = null, !this._transport.destroyed) {
                    if (z.operatorList) {
                      z.operatorList.lastChunk = !0;
                      for (const W of z.renderTasks)
                        W.operatorListChanged();
                      this.#s(!0);
                    }
                    if (z.displayReadyCapability)
                      z.displayReadyCapability.reject(I);
                    else if (z.opListReadCapability)
                      z.opListReadCapability.reject(I);
                    else
                      throw I;
                  }
                });
              };
              O();
            }
            _abortOperatorList({
              intentState: d,
              reason: E,
              force: F = !1
            }) {
              if (d.streamReader) {
                if (d.streamReaderCancelTimeout && (clearTimeout(d.streamReaderCancelTimeout), d.streamReaderCancelTimeout = null), !F) {
                  if (d.renderTasks.size > 0)
                    return;
                  if (E instanceof m.RenderingCancelledException) {
                    let P = D;
                    E.extraDelay > 0 && E.extraDelay < 1e3 && (P += E.extraDelay), d.streamReaderCancelTimeout = setTimeout(() => {
                      d.streamReaderCancelTimeout = null, this._abortOperatorList({
                        intentState: d,
                        reason: E,
                        force: !0
                      });
                    }, P);
                    return;
                  }
                }
                if (d.streamReader.cancel(new v.AbortException(E.message)).catch(() => {
                }), d.streamReader = null, !this._transport.destroyed) {
                  for (const [P, M] of this._intentStates)
                    if (M === d) {
                      this._intentStates.delete(P);
                      break;
                    }
                  this.cleanup();
                }
              }
            }
            get stats() {
              return this._stats;
            }
          }
          class ot {
            #t = /* @__PURE__ */ new Set();
            #e = Promise.resolve();
            postMessage(d, E) {
              const F = {
                data: structuredClone(d, E ? {
                  transfer: E
                } : null)
              };
              this.#e.then(() => {
                for (const P of this.#t)
                  P.call(this, F);
              });
            }
            addEventListener(d, E) {
              this.#t.add(E);
            }
            removeEventListener(d, E) {
              this.#t.delete(E);
            }
            terminate() {
              this.#t.clear();
            }
          }
          const Z = {
            isWorkerDisabled: !1,
            fakeWorkerId: 0
          };
          v.isNodeJS && (Z.isWorkerDisabled = !0, f.GlobalWorkerOptions.workerSrc ||= "./pdf.worker.mjs"), Z.isSameOrigin = function(_, d) {
            let E;
            try {
              if (E = new URL(_), !E.origin || E.origin === "null")
                return !1;
            } catch {
              return !1;
            }
            const F = new URL(d, E);
            return E.origin === F.origin;
          }, Z.createCDNWrapper = function(_) {
            const d = `await import("${_}");`;
            return URL.createObjectURL(new Blob([d], {
              type: "text/javascript"
            }));
          };
          class lt {
            static #t;
            constructor({
              name: d = null,
              port: E = null,
              verbosity: F = (0, v.getVerbosityLevel)()
            } = {}) {
              if (this.name = d, this.destroyed = !1, this.verbosity = F, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, E) {
                if (lt.#t?.has(E))
                  throw new Error("Cannot use more than one PDFWorker per port.");
                (lt.#t ||= /* @__PURE__ */ new WeakMap()).set(E, this), this._initializeFromPort(E);
                return;
              }
              this._initialize();
            }
            get promise() {
              return this._readyCapability.promise;
            }
            get port() {
              return this._port;
            }
            get messageHandler() {
              return this._messageHandler;
            }
            _initializeFromPort(d) {
              this._port = d, this._messageHandler = new p.MessageHandler("main", "worker", d), this._messageHandler.on("ready", function() {
              }), this._readyCapability.resolve(), this._messageHandler.send("configure", {
                verbosity: this.verbosity
              });
            }
            _initialize() {
              if (!Z.isWorkerDisabled && !lt.#e) {
                let {
                  workerSrc: d
                } = lt;
                try {
                  Z.isSameOrigin(window.location.href, d) || (d = Z.createCDNWrapper(new URL(d, window.location).href));
                  const E = new Worker(d, {
                    type: "module"
                  }), F = new p.MessageHandler("main", "worker", E), P = () => {
                    E.removeEventListener("error", M), F.destroy(), E.terminate(), this.destroyed ? this._readyCapability.reject(new Error("Worker was destroyed")) : this._setupFakeWorker();
                  }, M = () => {
                    this._webWorker || P();
                  };
                  E.addEventListener("error", M), F.on("test", (G) => {
                    if (E.removeEventListener("error", M), this.destroyed) {
                      P();
                      return;
                    }
                    G ? (this._messageHandler = F, this._port = E, this._webWorker = E, this._readyCapability.resolve(), F.send("configure", {
                      verbosity: this.verbosity
                    })) : (this._setupFakeWorker(), F.destroy(), E.terminate());
                  }), F.on("ready", (G) => {
                    if (E.removeEventListener("error", M), this.destroyed) {
                      P();
                      return;
                    }
                    try {
                      N();
                    } catch {
                      this._setupFakeWorker();
                    }
                  });
                  const N = () => {
                    const G = new Uint8Array();
                    F.send("test", G, [G.buffer]);
                  };
                  N();
                  return;
                } catch {
                  (0, v.info)("The worker has been disabled.");
                }
              }
              this._setupFakeWorker();
            }
            _setupFakeWorker() {
              Z.isWorkerDisabled || ((0, v.warn)("Setting up fake worker."), Z.isWorkerDisabled = !0), lt._setupFakeWorkerGlobal.then((d) => {
                if (this.destroyed) {
                  this._readyCapability.reject(new Error("Worker was destroyed"));
                  return;
                }
                const E = new ot();
                this._port = E;
                const F = `fake${Z.fakeWorkerId++}`, P = new p.MessageHandler(F + "_worker", F, E);
                d.setup(P, E);
                const M = new p.MessageHandler(F, F + "_worker", E);
                this._messageHandler = M, this._readyCapability.resolve(), M.send("configure", {
                  verbosity: this.verbosity
                });
              }).catch((d) => {
                this._readyCapability.reject(new Error(`Setting up fake worker failed: "${d.message}".`));
              });
            }
            destroy() {
              this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), lt.#t?.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
            }
            static fromPort(d) {
              if (!d?.port)
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              const E = this.#t?.get(d.port);
              if (E) {
                if (E._pendingDestroy)
                  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
                return E;
              }
              return new lt(d);
            }
            static get workerSrc() {
              if (f.GlobalWorkerOptions.workerSrc)
                return f.GlobalWorkerOptions.workerSrc;
              throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
            }
            static get #e() {
              try {
                return globalThis.pdfjsWorker?.WorkerMessageHandler || null;
              } catch {
                return null;
              }
            }
            static get _setupFakeWorkerGlobal() {
              const d = async () => this.#e ? this.#e : (await import(
                /*webpackIgnore: true*/
                this.workerSrc
              )).WorkerMessageHandler;
              return (0, v.shadow)(this, "_setupFakeWorkerGlobal", d());
            }
          }
          class ct {
            #t = /* @__PURE__ */ new Map();
            #e = /* @__PURE__ */ new Map();
            #s = /* @__PURE__ */ new Map();
            #n = /* @__PURE__ */ new Map();
            #r = null;
            constructor(d, E, F, P, M) {
              this.messageHandler = d, this.loadingTask = E, this.commonObjs = new k(), this.fontLoader = new l.FontLoader({
                ownerDocument: P.ownerDocument,
                styleElement: P.styleElement
              }), this._params = P, this.canvasFactory = M.canvasFactory, this.filterFactory = M.filterFactory, this.cMapReaderFactory = M.cMapReaderFactory, this.standardFontDataFactory = M.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = F, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
            }
            #i(d, E = null) {
              const F = this.#t.get(d);
              if (F)
                return F;
              const P = this.messageHandler.sendWithPromise(d, E);
              return this.#t.set(d, P), P;
            }
            get annotationStorage() {
              return (0, v.shadow)(this, "annotationStorage", new x.AnnotationStorage());
            }
            getRenderingIntent(d, E = v.AnnotationMode.ENABLE, F = null, P = !1) {
              let M = v.RenderingIntentFlag.DISPLAY, N = x.SerializableEmpty;
              switch (d) {
                case "any":
                  M = v.RenderingIntentFlag.ANY;
                  break;
                case "display":
                  break;
                case "print":
                  M = v.RenderingIntentFlag.PRINT;
                  break;
                default:
                  (0, v.warn)(`getRenderingIntent - invalid intent: ${d}`);
              }
              switch (E) {
                case v.AnnotationMode.DISABLE:
                  M += v.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;
                case v.AnnotationMode.ENABLE:
                  break;
                case v.AnnotationMode.ENABLE_FORMS:
                  M += v.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;
                case v.AnnotationMode.ENABLE_STORAGE:
                  M += v.RenderingIntentFlag.ANNOTATIONS_STORAGE, N = (M & v.RenderingIntentFlag.PRINT && F instanceof x.PrintAnnotationStorage ? F : this.annotationStorage).serializable;
                  break;
                default:
                  (0, v.warn)(`getRenderingIntent - invalid annotationMode: ${E}`);
              }
              return P && (M += v.RenderingIntentFlag.OPLIST), {
                renderingIntent: M,
                cacheKey: `${M}_${N.hash}`,
                annotationStorageSerializable: N
              };
            }
            destroy() {
              if (this.destroyCapability)
                return this.destroyCapability.promise;
              this.destroyed = !0, this.destroyCapability = Promise.withResolvers(), this.#r?.reject(new Error("Worker was destroyed during onPassword callback"));
              const d = [];
              for (const F of this.#e.values())
                d.push(F._destroy());
              this.#e.clear(), this.#s.clear(), this.#n.clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
              const E = this.messageHandler.sendWithPromise("Terminate", null);
              return d.push(E), Promise.all(d).then(() => {
                this.commonObjs.clear(), this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(), (0, n.cleanupTextLayer)(), this._networkStream?.cancelAllRequests(new v.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
              }, this.destroyCapability.reject), this.destroyCapability.promise;
            }
            setupMessageHandler() {
              const {
                messageHandler: d,
                loadingTask: E
              } = this;
              d.on("GetReader", (F, P) => {
                (0, v.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (M) => {
                  this._lastProgress = {
                    loaded: M.loaded,
                    total: M.total
                  };
                }, P.onPull = () => {
                  this._fullReader.read().then(function({
                    value: M,
                    done: N
                  }) {
                    if (N) {
                      P.close();
                      return;
                    }
                    (0, v.assert)(M instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), P.enqueue(new Uint8Array(M), 1, [M]);
                  }).catch((M) => {
                    P.error(M);
                  });
                }, P.onCancel = (M) => {
                  this._fullReader.cancel(M), P.ready.catch((N) => {
                    if (!this.destroyed)
                      throw N;
                  });
                };
              }), d.on("ReaderHeadersReady", (F) => {
                const P = Promise.withResolvers(), M = this._fullReader;
                return M.headersReady.then(() => {
                  (!M.isStreamingSupported || !M.isRangeSupported) && (this._lastProgress && E.onProgress?.(this._lastProgress), M.onProgress = (N) => {
                    E.onProgress?.({
                      loaded: N.loaded,
                      total: N.total
                    });
                  }), P.resolve({
                    isStreamingSupported: M.isStreamingSupported,
                    isRangeSupported: M.isRangeSupported,
                    contentLength: M.contentLength
                  });
                }, P.reject), P.promise;
              }), d.on("GetRangeReader", (F, P) => {
                (0, v.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
                const M = this._networkStream.getRangeReader(F.begin, F.end);
                if (!M) {
                  P.close();
                  return;
                }
                P.onPull = () => {
                  M.read().then(function({
                    value: N,
                    done: G
                  }) {
                    if (G) {
                      P.close();
                      return;
                    }
                    (0, v.assert)(N instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), P.enqueue(new Uint8Array(N), 1, [N]);
                  }).catch((N) => {
                    P.error(N);
                  });
                }, P.onCancel = (N) => {
                  M.cancel(N), P.ready.catch((G) => {
                    if (!this.destroyed)
                      throw G;
                  });
                };
              }), d.on("GetDoc", ({
                pdfInfo: F
              }) => {
                this._numPages = F.numPages, this._htmlForXfa = F.htmlForXfa, delete F.htmlForXfa, E._capability.resolve(new it(F, this));
              }), d.on("DocException", function(F) {
                let P;
                switch (F.name) {
                  case "PasswordException":
                    P = new v.PasswordException(F.message, F.code);
                    break;
                  case "InvalidPDFException":
                    P = new v.InvalidPDFException(F.message);
                    break;
                  case "MissingPDFException":
                    P = new v.MissingPDFException(F.message);
                    break;
                  case "UnexpectedResponseException":
                    P = new v.UnexpectedResponseException(F.message, F.status);
                    break;
                  case "UnknownErrorException":
                    P = new v.UnknownErrorException(F.message, F.details);
                    break;
                  default:
                    (0, v.unreachable)("DocException - expected a valid Error.");
                }
                E._capability.reject(P);
              }), d.on("PasswordRequest", (F) => {
                if (this.#r = Promise.withResolvers(), E.onPassword) {
                  const P = (M) => {
                    M instanceof Error ? this.#r.reject(M) : this.#r.resolve({
                      password: M
                    });
                  };
                  try {
                    E.onPassword(P, F.code);
                  } catch (M) {
                    this.#r.reject(M);
                  }
                } else
                  this.#r.reject(new v.PasswordException(F.message, F.code));
                return this.#r.promise;
              }), d.on("DataLoaded", (F) => {
                E.onProgress?.({
                  loaded: F.length,
                  total: F.length
                }), this.downloadInfoCapability.resolve(F);
              }), d.on("StartRenderPage", (F) => {
                if (this.destroyed)
                  return;
                this.#e.get(F.pageIndex)._startRenderPage(F.transparency, F.cacheKey);
              }), d.on("commonobj", ([F, P, M]) => {
                if (this.destroyed || this.commonObjs.has(F))
                  return null;
                switch (P) {
                  case "Font":
                    const N = this._params;
                    if ("error" in M) {
                      const I = M.error;
                      (0, v.warn)(`Error during font loading: ${I}`), this.commonObjs.resolve(F, I);
                      break;
                    }
                    const G = N.pdfBug && globalThis.FontInspector?.enabled ? (I, W) => globalThis.FontInspector.fontAdded(I, W) : null, z = new l.FontFaceObject(M, {
                      disableFontFace: N.disableFontFace,
                      ignoreErrors: N.ignoreErrors,
                      inspectFont: G
                    });
                    this.fontLoader.bind(z).catch(() => d.sendWithPromise("FontFallback", {
                      id: F
                    })).finally(() => {
                      !N.fontExtraProperties && z.data && (z.data = null), this.commonObjs.resolve(F, z);
                    });
                    break;
                  case "CopyLocalImage":
                    const {
                      imageRef: O
                    } = M;
                    (0, v.assert)(O, "The imageRef must be defined.");
                    for (const I of this.#e.values())
                      for (const [, W] of I.objs)
                        if (W.ref === O)
                          return W.dataLen ? (this.commonObjs.resolve(F, structuredClone(W)), W.dataLen) : null;
                    break;
                  case "FontPath":
                  case "Image":
                  case "Pattern":
                    this.commonObjs.resolve(F, M);
                    break;
                  default:
                    throw new Error(`Got unknown common object type ${P}`);
                }
                return null;
              }), d.on("obj", ([F, P, M, N]) => {
                if (this.destroyed)
                  return;
                const G = this.#e.get(P);
                if (!G.objs.has(F)) {
                  if (G._intentStates.size === 0) {
                    N?.bitmap?.close();
                    return;
                  }
                  switch (M) {
                    case "Image":
                      G.objs.resolve(F, N), N?.dataLen > v.MAX_IMAGE_SIZE_TO_CACHE && (G._maybeCleanupAfterRender = !0);
                      break;
                    case "Pattern":
                      G.objs.resolve(F, N);
                      break;
                    default:
                      throw new Error(`Got unknown object type ${M}`);
                  }
                }
              }), d.on("DocProgress", (F) => {
                this.destroyed || E.onProgress?.({
                  loaded: F.loaded,
                  total: F.total
                });
              }), d.on("FetchBuiltInCMap", (F) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.cMapReaderFactory ? this.cMapReaderFactory.fetch(F) : Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))), d.on("FetchStandardFontData", (F) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.standardFontDataFactory ? this.standardFontDataFactory.fetch(F) : Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")));
            }
            getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
            saveDocument() {
              this.annotationStorage.size <= 0 && (0, v.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
              const {
                map: d,
                transfer: E
              } = this.annotationStorage.serializable;
              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: d,
                filename: this._fullReader?.filename ?? null
              }, E).finally(() => {
                this.annotationStorage.resetModified();
              });
            }
            getPage(d) {
              if (!Number.isInteger(d) || d <= 0 || d > this._numPages)
                return Promise.reject(new Error("Invalid page request."));
              const E = d - 1, F = this.#s.get(E);
              if (F)
                return F;
              const P = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: E
              }).then((M) => {
                if (this.destroyed)
                  throw new Error("Transport destroyed");
                M.refStr && this.#n.set(M.refStr, d);
                const N = new ht(E, M, this, this._params.pdfBug);
                return this.#e.set(E, N), N;
              });
              return this.#s.set(E, P), P;
            }
            getPageIndex(d) {
              return j(d) ? this.messageHandler.sendWithPromise("GetPageIndex", {
                num: d.num,
                gen: d.gen
              }) : Promise.reject(new Error("Invalid pageIndex request."));
            }
            getAnnotations(d, E) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: d,
                intent: E
              });
            }
            getFieldObjects() {
              return this.#i("GetFieldObjects");
            }
            hasJSActions() {
              return this.#i("HasJSActions");
            }
            getCalculationOrderIds() {
              return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
            }
            getDestinations() {
              return this.messageHandler.sendWithPromise("GetDestinations", null);
            }
            getDestination(d) {
              return typeof d != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
                id: d
              });
            }
            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 this.#i("GetDocJSActions");
            }
            getPageJSActions(d) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: d
              });
            }
            getStructTree(d) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: d
              });
            }
            getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
            getOptionalContentConfig(d) {
              return this.#i("GetOptionalContentConfig").then((E) => new r.OptionalContentConfig(E, d));
            }
            getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
            getMetadata() {
              const d = "GetMetadata", E = this.#t.get(d);
              if (E)
                return E;
              const F = this.messageHandler.sendWithPromise(d, null).then((P) => ({
                info: P[0],
                metadata: P[1] ? new C.Metadata(P[1]) : null,
                contentDispositionFilename: this._fullReader?.filename ?? null,
                contentLength: this._fullReader?.contentLength ?? null
              }));
              return this.#t.set(d, F), F;
            }
            getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
            async startCleanup(d = !1) {
              if (!this.destroyed) {
                await this.messageHandler.sendWithPromise("Cleanup", null);
                for (const E of this.#e.values())
                  if (!E.cleanup())
                    throw new Error(`startCleanup: Page ${E.pageNumber} is currently rendering.`);
                this.commonObjs.clear(), d || this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(!0), (0, n.cleanupTextLayer)();
              }
            }
            cachedPageNumber(d) {
              if (!j(d))
                return null;
              const E = d.gen === 0 ? `${d.num}R` : `${d.num}R${d.gen}`;
              return this.#n.get(E) ?? null;
            }
            get loadingParams() {
              const {
                disableAutoFetch: d,
                enableXfa: E
              } = this._params;
              return (0, v.shadow)(this, "loadingParams", {
                disableAutoFetch: d,
                enableXfa: E
              });
            }
          }
          const $ = Symbol("INITIAL_DATA");
          class k {
            #t = /* @__PURE__ */ Object.create(null);
            #e(d) {
              return this.#t[d] ||= {
                ...Promise.withResolvers(),
                data: $
              };
            }
            get(d, E = null) {
              if (E) {
                const P = this.#e(d);
                return P.promise.then(() => E(P.data)), null;
              }
              const F = this.#t[d];
              if (!F || F.data === $)
                throw new Error(`Requesting object that isn't resolved yet ${d}.`);
              return F.data;
            }
            has(d) {
              const E = this.#t[d];
              return !!E && E.data !== $;
            }
            resolve(d, E = null) {
              const F = this.#e(d);
              F.data = E, F.resolve();
            }
            clear() {
              for (const d in this.#t) {
                const {
                  data: E
                } = this.#t[d];
                E?.bitmap?.close();
              }
              this.#t = /* @__PURE__ */ Object.create(null);
            }
            *[Symbol.iterator]() {
              for (const d in this.#t) {
                const {
                  data: E
                } = this.#t[d];
                E !== $ && (yield [d, E]);
              }
            }
          }
          class S {
            #t = null;
            constructor(d) {
              this.#t = d, this.onContinue = null;
            }
            get promise() {
              return this.#t.capability.promise;
            }
            cancel(d = 0) {
              this.#t.cancel(null, d);
            }
            get separateAnnots() {
              const {
                separateAnnots: d
              } = this.#t.operatorList;
              if (!d)
                return !1;
              const {
                annotationCanvasMap: E
              } = this.#t;
              return d.form || d.canvas && E?.size > 0;
            }
          }
          class a {
            static #t = /* @__PURE__ */ new WeakSet();
            constructor({
              callback: d,
              params: E,
              objs: F,
              commonObjs: P,
              annotationCanvasMap: M,
              operatorList: N,
              pageIndex: G,
              canvasFactory: z,
              filterFactory: O,
              useRequestAnimationFrame: I = !1,
              pdfBug: W = !1,
              pageColors: st = null
            }) {
              this.callback = d, this.params = E, this.objs = F, this.commonObjs = P, this.annotationCanvasMap = M, this.operatorListIdx = null, this.operatorList = N, this._pageIndex = G, this.canvasFactory = z, this.filterFactory = O, this._pdfBug = W, this.pageColors = st, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = I === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new S(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 = E.canvasContext.canvas;
            }
            get completed() {
              return this.capability.promise.catch(function() {
              });
            }
            initializeGraphics({
              transparency: d = !1,
              optionalContentConfig: E
            }) {
              if (this.cancelled)
                return;
              if (this._canvas) {
                if (a.#t.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.");
                a.#t.add(this._canvas);
              }
              this._pdfBug && globalThis.StepperManager?.enabled && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
              const {
                canvasContext: F,
                viewport: P,
                transform: M,
                background: N
              } = this.params;
              this.gfx = new h.CanvasGraphics(F, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: E
              }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
                transform: M,
                viewport: P,
                transparency: d,
                background: N
              }), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback?.();
            }
            cancel(d = null, E = 0) {
              this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), a.#t.delete(this._canvas), this.callback(d || new m.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, E));
            }
            operatorListChanged() {
              if (!this.graphicsReady) {
                this.graphicsReadyCallback ||= this._continueBound;
                return;
              }
              this.stepper?.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(), a.#t.delete(this._canvas), this.callback())));
            }
          }
          const c = "4.2.67", T = "49b388101";
          y();
        } catch (L) {
          y(L);
        }
      });
    }
  ),
  /***/
  583: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        BaseCMapReaderFactory: () => (
          /* binding */
          x
        ),
        /* harmony export */
        BaseCanvasFactory: () => (
          /* binding */
          v
        ),
        /* harmony export */
        BaseFilterFactory: () => (
          /* binding */
          y
        ),
        /* harmony export */
        BaseSVGFactory: () => (
          /* binding */
          l
        ),
        /* harmony export */
        BaseStandardFontDataFactory: () => (
          /* binding */
          m
        )
        /* harmony export */
      });
      var e = i(292);
      class y {
        constructor() {
          this.constructor === y && (0, e.unreachable)("Cannot initialize BaseFilterFactory.");
        }
        addFilter(h) {
          return "none";
        }
        addHCMFilter(h, n) {
          return "none";
        }
        addHighlightHCMFilter(h, n, f, p, C) {
          return "none";
        }
        destroy(h = !1) {
        }
      }
      class v {
        constructor() {
          this.constructor === v && (0, e.unreachable)("Cannot initialize BaseCanvasFactory.");
        }
        create(h, n) {
          if (h <= 0 || n <= 0)
            throw new Error("Invalid canvas size");
          const f = this._createCanvas(h, n);
          return {
            canvas: f,
            context: f.getContext("2d")
          };
        }
        reset(h, n, f) {
          if (!h.canvas)
            throw new Error("Canvas is not specified");
          if (n <= 0 || f <= 0)
            throw new Error("Invalid canvas size");
          h.canvas.width = n, h.canvas.height = f;
        }
        destroy(h) {
          if (!h.canvas)
            throw new Error("Canvas is not specified");
          h.canvas.width = 0, h.canvas.height = 0, h.canvas = null, h.context = null;
        }
        _createCanvas(h, n) {
          (0, e.unreachable)("Abstract method `_createCanvas` called.");
        }
      }
      class x {
        constructor({
          baseUrl: h = null,
          isCompressed: n = !0
        }) {
          this.constructor === x && (0, e.unreachable)("Cannot initialize BaseCMapReaderFactory."), this.baseUrl = h, this.isCompressed = n;
        }
        async fetch({
          name: h
        }) {
          if (!this.baseUrl)
            throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');
          if (!h)
            throw new Error("CMap name must be specified.");
          const n = this.baseUrl + h + (this.isCompressed ? ".bcmap" : ""), f = this.isCompressed ? e.CMapCompressionType.BINARY : e.CMapCompressionType.NONE;
          return this._fetchData(n, f).catch((p) => {
            throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${n}`);
          });
        }
        _fetchData(h, n) {
          (0, e.unreachable)("Abstract method `_fetchData` called.");
        }
      }
      class m {
        constructor({
          baseUrl: h = null
        }) {
          this.constructor === m && (0, e.unreachable)("Cannot initialize BaseStandardFontDataFactory."), this.baseUrl = h;
        }
        async fetch({
          filename: h
        }) {
          if (!this.baseUrl)
            throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');
          if (!h)
            throw new Error("Font filename must be specified.");
          const n = `${this.baseUrl}${h}`;
          return this._fetchData(n).catch((f) => {
            throw new Error(`Unable to load font data at: ${n}`);
          });
        }
        _fetchData(h) {
          (0, e.unreachable)("Abstract method `_fetchData` called.");
        }
      }
      class l {
        constructor() {
          this.constructor === l && (0, e.unreachable)("Cannot initialize BaseSVGFactory.");
        }
        create(h, n, f = !1) {
          if (h <= 0 || n <= 0)
            throw new Error("Invalid SVG dimensions");
          const p = this._createSVG("svg:svg");
          return p.setAttribute("version", "1.1"), f || (p.setAttribute("width", `${h}px`), p.setAttribute("height", `${n}px`)), p.setAttribute("preserveAspectRatio", "none"), p.setAttribute("viewBox", `0 0 ${h} ${n}`), p;
        }
        createElement(h) {
          if (typeof h != "string")
            throw new Error("Invalid SVG element type");
          return this._createSVG(h);
        }
        _createSVG(h) {
          (0, e.unreachable)("Abstract method `_createSVG` called.");
        }
      }
    }
  ),
  /***/
  923: (
    /***/
    (u, s, i) => {
      i.d(s, {
        CanvasGraphics: () => (
          /* binding */
          k
        )
      });
      var e = i(292), y = i(419);
      const v = {
        FILL: "Fill",
        STROKE: "Stroke",
        SHADING: "Shading"
      };
      function x(S, a) {
        if (!a)
          return;
        const c = a[2] - a[0], T = a[3] - a[1], _ = new Path2D();
        _.rect(a[0], a[1], c, T), S.clip(_);
      }
      class m {
        constructor() {
          this.constructor === m && (0, e.unreachable)("Cannot initialize BaseShadingPattern.");
        }
        getPattern() {
          (0, e.unreachable)("Abstract method `getPattern` called.");
        }
      }
      class l extends m {
        constructor(a) {
          super(), this._type = a[1], this._bbox = a[2], this._colorStops = a[3], this._p0 = a[4], this._p1 = a[5], this._r0 = a[6], this._r1 = a[7], this.matrix = null;
        }
        _createGradient(a) {
          let c;
          this._type === "axial" ? c = a.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (c = a.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
          for (const T of this._colorStops)
            c.addColorStop(T[0], T[1]);
          return c;
        }
        getPattern(a, c, T, _) {
          let d;
          if (_ === v.STROKE || _ === v.FILL) {
            const E = c.current.getClippedPathBoundingBox(_, (0, y.getCurrentTransform)(a)) || [0, 0, 0, 0], F = Math.ceil(E[2] - E[0]) || 1, P = Math.ceil(E[3] - E[1]) || 1, M = c.cachedCanvases.getCanvas("pattern", F, P, !0), N = M.context;
            N.clearRect(0, 0, N.canvas.width, N.canvas.height), N.beginPath(), N.rect(0, 0, N.canvas.width, N.canvas.height), N.translate(-E[0], -E[1]), T = e.Util.transform(T, [1, 0, 0, 1, E[0], E[1]]), N.transform(...c.baseTransform), this.matrix && N.transform(...this.matrix), x(N, this._bbox), N.fillStyle = this._createGradient(N), N.fill(), d = a.createPattern(M.canvas, "no-repeat");
            const G = new DOMMatrix(T);
            d.setTransform(G);
          } else
            x(a, this._bbox), d = this._createGradient(a);
          return d;
        }
      }
      function g(S, a, c, T, _, d, E, F) {
        const P = a.coords, M = a.colors, N = S.data, G = S.width * 4;
        let z;
        P[c + 1] > P[T + 1] && (z = c, c = T, T = z, z = d, d = E, E = z), P[T + 1] > P[_ + 1] && (z = T, T = _, _ = z, z = E, E = F, F = z), P[c + 1] > P[T + 1] && (z = c, c = T, T = z, z = d, d = E, E = z);
        const O = (P[c] + a.offsetX) * a.scaleX, I = (P[c + 1] + a.offsetY) * a.scaleY, W = (P[T] + a.offsetX) * a.scaleX, st = (P[T + 1] + a.offsetY) * a.scaleY, K = (P[_] + a.offsetX) * a.scaleX, et = (P[_ + 1] + a.offsetY) * a.scaleY;
        if (I >= et)
          return;
        const ut = M[d], at = M[d + 1], nt = M[d + 2], dt = M[E], ft = M[E + 1], bt = M[E + 2], yt = M[F], wt = M[F + 1], vt = M[F + 2], qt = Math.round(I), xt = Math.round(et);
        let It, Et, Rt, Kt, Ae, Pe, ze, ye;
        for (let Lt = qt; Lt <= xt; Lt++) {
          if (Lt < st) {
            const Ct = Lt < I ? 0 : (I - Lt) / (I - st);
            It = O - (O - W) * Ct, Et = ut - (ut - dt) * Ct, Rt = at - (at - ft) * Ct, Kt = nt - (nt - bt) * Ct;
          } else {
            let Ct;
            Lt > et ? Ct = 1 : st === et ? Ct = 0 : Ct = (st - Lt) / (st - et), It = W - (W - K) * Ct, Et = dt - (dt - yt) * Ct, Rt = ft - (ft - wt) * Ct, Kt = bt - (bt - vt) * Ct;
          }
          let Tt;
          Lt < I ? Tt = 0 : Lt > et ? Tt = 1 : Tt = (I - Lt) / (I - et), Ae = O - (O - K) * Tt, Pe = ut - (ut - yt) * Tt, ze = at - (at - wt) * Tt, ye = nt - (nt - vt) * Tt;
          const Ue = Math.round(Math.min(It, Ae)), Me = Math.round(Math.max(It, Ae));
          let we = G * Lt + Ue * 4;
          for (let Ct = Ue; Ct <= Me; Ct++)
            Tt = (It - Ct) / (It - Ae), Tt < 0 ? Tt = 0 : Tt > 1 && (Tt = 1), N[we++] = Et - (Et - Pe) * Tt | 0, N[we++] = Rt - (Rt - ze) * Tt | 0, N[we++] = Kt - (Kt - ye) * Tt | 0, N[we++] = 255;
        }
      }
      function h(S, a, c) {
        const T = a.coords, _ = a.colors;
        let d, E;
        switch (a.type) {
          case "lattice":
            const F = a.verticesPerRow, P = Math.floor(T.length / F) - 1, M = F - 1;
            for (d = 0; d < P; d++) {
              let N = d * F;
              for (let G = 0; G < M; G++, N++)
                g(S, c, T[N], T[N + 1], T[N + F], _[N], _[N + 1], _[N + F]), g(S, c, T[N + F + 1], T[N + 1], T[N + F], _[N + F + 1], _[N + 1], _[N + F]);
            }
            break;
          case "triangles":
            for (d = 0, E = T.length; d < E; d += 3)
              g(S, c, T[d], T[d + 1], T[d + 2], _[d], _[d + 1], _[d + 2]);
            break;
          default:
            throw new Error("illegal figure");
        }
      }
      class n extends m {
        constructor(a) {
          super(), this._coords = a[2], this._colors = a[3], this._figures = a[4], this._bounds = a[5], this._bbox = a[7], this._background = a[8], this.matrix = null;
        }
        _createMeshCanvas(a, c, T) {
          const F = Math.floor(this._bounds[0]), P = Math.floor(this._bounds[1]), M = Math.ceil(this._bounds[2]) - F, N = Math.ceil(this._bounds[3]) - P, G = Math.min(Math.ceil(Math.abs(M * a[0] * 1.1)), 3e3), z = Math.min(Math.ceil(Math.abs(N * a[1] * 1.1)), 3e3), O = M / G, I = N / z, W = {
            coords: this._coords,
            colors: this._colors,
            offsetX: -F,
            offsetY: -P,
            scaleX: 1 / O,
            scaleY: 1 / I
          }, st = G + 2 * 2, K = z + 2 * 2, et = T.getCanvas("mesh", st, K, !1), ut = et.context, at = ut.createImageData(G, z);
          if (c) {
            const dt = at.data;
            for (let ft = 0, bt = dt.length; ft < bt; ft += 4)
              dt[ft] = c[0], dt[ft + 1] = c[1], dt[ft + 2] = c[2], dt[ft + 3] = 255;
          }
          for (const dt of this._figures)
            h(at, dt, W);
          return ut.putImageData(at, 2, 2), {
            canvas: et.canvas,
            offsetX: F - 2 * O,
            offsetY: P - 2 * I,
            scaleX: O,
            scaleY: I
          };
        }
        getPattern(a, c, T, _) {
          x(a, this._bbox);
          let d;
          if (_ === v.SHADING)
            d = e.Util.singularValueDecompose2dScale((0, y.getCurrentTransform)(a));
          else if (d = e.Util.singularValueDecompose2dScale(c.baseTransform), this.matrix) {
            const F = e.Util.singularValueDecompose2dScale(this.matrix);
            d = [d[0] * F[0], d[1] * F[1]];
          }
          const E = this._createMeshCanvas(d, _ === v.SHADING ? null : this._background, c.cachedCanvases);
          return _ !== v.SHADING && (a.setTransform(...c.baseTransform), this.matrix && a.transform(...this.matrix)), a.translate(E.offsetX, E.offsetY), a.scale(E.scaleX, E.scaleY), a.createPattern(E.canvas, "no-repeat");
        }
      }
      class f extends m {
        getPattern() {
          return "hotpink";
        }
      }
      function p(S) {
        switch (S[0]) {
          case "RadialAxial":
            return new l(S);
          case "Mesh":
            return new n(S);
          case "Dummy":
            return new f();
        }
        throw new Error(`Unknown IR type: ${S[0]}`);
      }
      const C = {
        COLORED: 1,
        UNCOLORED: 2
      };
      class r {
        static MAX_PATTERN_SIZE = 3e3;
        constructor(a, c, T, _, d) {
          this.operatorList = a[2], this.matrix = a[3] || [1, 0, 0, 1, 0, 0], this.bbox = a[4], this.xstep = a[5], this.ystep = a[6], this.paintType = a[7], this.tilingType = a[8], this.color = c, this.ctx = T, this.canvasGraphicsFactory = _, this.baseTransform = d;
        }
        createPatternCanvas(a) {
          const c = this.operatorList, T = this.bbox, _ = this.xstep, d = this.ystep, E = this.paintType, F = this.tilingType, P = this.color, M = this.canvasGraphicsFactory;
          (0, e.info)("TilingType: " + F);
          const N = T[0], G = T[1], z = T[2], O = T[3], I = e.Util.singularValueDecompose2dScale(this.matrix), W = e.Util.singularValueDecompose2dScale(this.baseTransform), st = [I[0] * W[0], I[1] * W[1]], K = this.getSizeAndScale(_, this.ctx.canvas.width, st[0]), et = this.getSizeAndScale(d, this.ctx.canvas.height, st[1]), ut = a.cachedCanvases.getCanvas("pattern", K.size, et.size, !0), at = ut.context, nt = M.createCanvasGraphics(at);
          nt.groupLevel = a.groupLevel, this.setFillAndStrokeStyleToContext(nt, E, P);
          let dt = N, ft = G, bt = z, yt = O;
          return N < 0 && (dt = 0, bt += Math.abs(N)), G < 0 && (ft = 0, yt += Math.abs(G)), at.translate(-(K.scale * dt), -(et.scale * ft)), nt.transform(K.scale, 0, 0, et.scale, 0, 0), at.save(), this.clipBbox(nt, dt, ft, bt, yt), nt.baseTransform = (0, y.getCurrentTransform)(nt.ctx), nt.executeOperatorList(c), nt.endDrawing(), {
            canvas: ut.canvas,
            scaleX: K.scale,
            scaleY: et.scale,
            offsetX: dt,
            offsetY: ft
          };
        }
        getSizeAndScale(a, c, T) {
          a = Math.abs(a);
          const _ = Math.max(r.MAX_PATTERN_SIZE, c);
          let d = Math.ceil(a * T);
          return d >= _ ? d = _ : T = d / a, {
            scale: T,
            size: d
          };
        }
        clipBbox(a, c, T, _, d) {
          const E = _ - c, F = d - T;
          a.ctx.rect(c, T, E, F), a.current.updateRectMinMax((0, y.getCurrentTransform)(a.ctx), [c, T, _, d]), a.clip(), a.endPath();
        }
        setFillAndStrokeStyleToContext(a, c, T) {
          const _ = a.ctx, d = a.current;
          switch (c) {
            case C.COLORED:
              const E = this.ctx;
              _.fillStyle = E.fillStyle, _.strokeStyle = E.strokeStyle, d.fillColor = E.fillStyle, d.strokeColor = E.strokeStyle;
              break;
            case C.UNCOLORED:
              const F = e.Util.makeHexColor(T[0], T[1], T[2]);
              _.fillStyle = F, _.strokeStyle = F, d.fillColor = F, d.strokeColor = F;
              break;
            default:
              throw new e.FormatError(`Unsupported paint type: ${c}`);
          }
        }
        getPattern(a, c, T, _) {
          let d = T;
          _ !== v.SHADING && (d = e.Util.transform(d, c.baseTransform), this.matrix && (d = e.Util.transform(d, this.matrix)));
          const E = this.createPatternCanvas(c);
          let F = new DOMMatrix(d);
          F = F.translate(E.offsetX, E.offsetY), F = F.scale(1 / E.scaleX, 1 / E.scaleY);
          const P = a.createPattern(E.canvas, "repeat");
          return P.setTransform(F), P;
        }
      }
      function w({
        src: S,
        srcPos: a = 0,
        dest: c,
        width: T,
        height: _,
        nonBlackColor: d = 4294967295,
        inverseDecode: E = !1
      }) {
        const F = e.FeatureTest.isLittleEndian ? 4278190080 : 255, [P, M] = E ? [d, F] : [F, d], N = T >> 3, G = T & 7, z = S.length;
        c = new Uint32Array(c.buffer);
        let O = 0;
        for (let I = 0; I < _; I++) {
          for (const st = a + N; a < st; a++) {
            const K = a < z ? S[a] : 255;
            c[O++] = K & 128 ? M : P, c[O++] = K & 64 ? M : P, c[O++] = K & 32 ? M : P, c[O++] = K & 16 ? M : P, c[O++] = K & 8 ? M : P, c[O++] = K & 4 ? M : P, c[O++] = K & 2 ? M : P, c[O++] = K & 1 ? M : P;
          }
          if (G === 0)
            continue;
          const W = a < z ? S[a++] : 255;
          for (let st = 0; st < G; st++)
            c[O++] = W & 1 << 7 - st ? M : P;
        }
        return {
          srcPos: a,
          destPos: O
        };
      }
      const t = 16, o = 100, A = 4096, b = 15, R = 10, L = 1e3, D = 16;
      function H(S, a) {
        if (S._removeMirroring)
          throw new Error("Context is already forwarding operations.");
        S.__originalSave = S.save, S.__originalRestore = S.restore, S.__originalRotate = S.rotate, S.__originalScale = S.scale, S.__originalTranslate = S.translate, S.__originalTransform = S.transform, S.__originalSetTransform = S.setTransform, S.__originalResetTransform = S.resetTransform, S.__originalClip = S.clip, S.__originalMoveTo = S.moveTo, S.__originalLineTo = S.lineTo, S.__originalBezierCurveTo = S.bezierCurveTo, S.__originalRect = S.rect, S.__originalClosePath = S.closePath, S.__originalBeginPath = S.beginPath, S._removeMirroring = () => {
          S.save = S.__originalSave, S.restore = S.__originalRestore, S.rotate = S.__originalRotate, S.scale = S.__originalScale, S.translate = S.__originalTranslate, S.transform = S.__originalTransform, S.setTransform = S.__originalSetTransform, S.resetTransform = S.__originalResetTransform, S.clip = S.__originalClip, S.moveTo = S.__originalMoveTo, S.lineTo = S.__originalLineTo, S.bezierCurveTo = S.__originalBezierCurveTo, S.rect = S.__originalRect, S.closePath = S.__originalClosePath, S.beginPath = S.__originalBeginPath, delete S._removeMirroring;
        }, S.save = function() {
          a.save(), this.__originalSave();
        }, S.restore = function() {
          a.restore(), this.__originalRestore();
        }, S.translate = function(T, _) {
          a.translate(T, _), this.__originalTranslate(T, _);
        }, S.scale = function(T, _) {
          a.scale(T, _), this.__originalScale(T, _);
        }, S.transform = function(T, _, d, E, F, P) {
          a.transform(T, _, d, E, F, P), this.__originalTransform(T, _, d, E, F, P);
        }, S.setTransform = function(T, _, d, E, F, P) {
          a.setTransform(T, _, d, E, F, P), this.__originalSetTransform(T, _, d, E, F, P);
        }, S.resetTransform = function() {
          a.resetTransform(), this.__originalResetTransform();
        }, S.rotate = function(T) {
          a.rotate(T), this.__originalRotate(T);
        }, S.clip = function(T) {
          a.clip(T), this.__originalClip(T);
        }, S.moveTo = function(c, T) {
          a.moveTo(c, T), this.__originalMoveTo(c, T);
        }, S.lineTo = function(c, T) {
          a.lineTo(c, T), this.__originalLineTo(c, T);
        }, S.bezierCurveTo = function(c, T, _, d, E, F) {
          a.bezierCurveTo(c, T, _, d, E, F), this.__originalBezierCurveTo(c, T, _, d, E, F);
        }, S.rect = function(c, T, _, d) {
          a.rect(c, T, _, d), this.__originalRect(c, T, _, d);
        }, S.closePath = function() {
          a.closePath(), this.__originalClosePath();
        }, S.beginPath = function() {
          a.beginPath(), this.__originalBeginPath();
        };
      }
      class X {
        constructor(a) {
          this.canvasFactory = a, this.cache = /* @__PURE__ */ Object.create(null);
        }
        getCanvas(a, c, T) {
          let _;
          return this.cache[a] !== void 0 ? (_ = this.cache[a], this.canvasFactory.reset(_, c, T)) : (_ = this.canvasFactory.create(c, T), this.cache[a] = _), _;
        }
        delete(a) {
          delete this.cache[a];
        }
        clear() {
          for (const a in this.cache) {
            const c = this.cache[a];
            this.canvasFactory.destroy(c), delete this.cache[a];
          }
        }
      }
      function V(S, a, c, T, _, d, E, F, P, M) {
        const [N, G, z, O, I, W] = (0, y.getCurrentTransform)(S);
        if (G === 0 && z === 0) {
          const et = E * N + I, ut = Math.round(et), at = F * O + W, nt = Math.round(at), dt = (E + P) * N + I, ft = Math.abs(Math.round(dt) - ut) || 1, bt = (F + M) * O + W, yt = Math.abs(Math.round(bt) - nt) || 1;
          return S.setTransform(Math.sign(N), 0, 0, Math.sign(O), ut, nt), S.drawImage(a, c, T, _, d, 0, 0, ft, yt), S.setTransform(N, G, z, O, I, W), [ft, yt];
        }
        if (N === 0 && O === 0) {
          const et = F * z + I, ut = Math.round(et), at = E * G + W, nt = Math.round(at), dt = (F + M) * z + I, ft = Math.abs(Math.round(dt) - ut) || 1, bt = (E + P) * G + W, yt = Math.abs(Math.round(bt) - nt) || 1;
          return S.setTransform(0, Math.sign(G), Math.sign(z), 0, ut, nt), S.drawImage(a, c, T, _, d, 0, 0, yt, ft), S.setTransform(N, G, z, O, I, W), [yt, ft];
        }
        S.drawImage(a, c, T, _, d, E, F, P, M);
        const st = Math.hypot(N, G), K = Math.hypot(z, O);
        return [st * P, K * M];
      }
      function q(S) {
        const {
          width: a,
          height: c
        } = S;
        if (a > L || c > L)
          return null;
        const T = 1e3, _ = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), d = a + 1;
        let E = new Uint8Array(d * (c + 1)), F, P, M;
        const N = a + 7 & -8;
        let G = new Uint8Array(N * c), z = 0;
        for (const K of S.data) {
          let et = 128;
          for (; et > 0; )
            G[z++] = K & et ? 0 : 255, et >>= 1;
        }
        let O = 0;
        for (z = 0, G[z] !== 0 && (E[0] = 1, ++O), P = 1; P < a; P++)
          G[z] !== G[z + 1] && (E[P] = G[z] ? 2 : 1, ++O), z++;
        for (G[z] !== 0 && (E[P] = 2, ++O), F = 1; F < c; F++) {
          z = F * N, M = F * d, G[z - N] !== G[z] && (E[M] = G[z] ? 1 : 8, ++O);
          let K = (G[z] ? 4 : 0) + (G[z - N] ? 8 : 0);
          for (P = 1; P < a; P++)
            K = (K >> 2) + (G[z + 1] ? 4 : 0) + (G[z - N + 1] ? 8 : 0), _[K] && (E[M + P] = _[K], ++O), z++;
          if (G[z - N] !== G[z] && (E[M + P] = G[z] ? 2 : 4, ++O), O > T)
            return null;
        }
        for (z = N * (c - 1), M = F * d, G[z] !== 0 && (E[M] = 8, ++O), P = 1; P < a; P++)
          G[z] !== G[z + 1] && (E[M + P] = G[z] ? 4 : 8, ++O), z++;
        if (G[z] !== 0 && (E[M + P] = 4, ++O), O > T)
          return null;
        const I = new Int32Array([0, d, -1, 0, -d, 0, 0, 0, 1]), W = new Path2D();
        for (F = 0; O && F <= c; F++) {
          let K = F * d;
          const et = K + a;
          for (; K < et && !E[K]; )
            K++;
          if (K === et)
            continue;
          W.moveTo(K % d, F);
          const ut = K;
          let at = E[K];
          do {
            const nt = I[at];
            do
              K += nt;
            while (!E[K]);
            const dt = E[K];
            dt !== 5 && dt !== 10 ? (at = dt, E[K] = 0) : (at = dt & 51 * at >> 4, E[K] &= at >> 2 | at << 2), W.lineTo(K % d, K / d | 0), E[K] || --O;
          } while (ut !== K);
          --F;
        }
        return G = null, E = null, function(K) {
          K.save(), K.scale(1 / a, -1 / c), K.translate(0, -c), K.fill(W), K.beginPath(), K.restore();
        };
      }
      class tt {
        constructor(a, c) {
          this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = e.IDENTITY_MATRIX, this.textMatrixScale = 1, this.fontMatrix = e.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 = e.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, c]);
        }
        clone() {
          const a = Object.create(this);
          return a.clipBox = this.clipBox.slice(), a;
        }
        setCurrentPoint(a, c) {
          this.x = a, this.y = c;
        }
        updatePathMinMax(a, c, T) {
          [c, T] = e.Util.applyTransform([c, T], a), this.minX = Math.min(this.minX, c), this.minY = Math.min(this.minY, T), this.maxX = Math.max(this.maxX, c), this.maxY = Math.max(this.maxY, T);
        }
        updateRectMinMax(a, c) {
          const T = e.Util.applyTransform(c, a), _ = e.Util.applyTransform(c.slice(2), a), d = e.Util.applyTransform([c[0], c[3]], a), E = e.Util.applyTransform([c[2], c[1]], a);
          this.minX = Math.min(this.minX, T[0], _[0], d[0], E[0]), this.minY = Math.min(this.minY, T[1], _[1], d[1], E[1]), this.maxX = Math.max(this.maxX, T[0], _[0], d[0], E[0]), this.maxY = Math.max(this.maxY, T[1], _[1], d[1], E[1]);
        }
        updateScalingPathMinMax(a, c) {
          e.Util.scaleMinMax(a, c), this.minX = Math.min(this.minX, c[0]), this.minY = Math.min(this.minY, c[1]), this.maxX = Math.max(this.maxX, c[2]), this.maxY = Math.max(this.maxY, c[3]);
        }
        updateCurvePathMinMax(a, c, T, _, d, E, F, P, M, N) {
          const G = e.Util.bezierBoundingBox(c, T, _, d, E, F, P, M, N);
          N || this.updateRectMinMax(a, G);
        }
        getPathBoundingBox(a = v.FILL, c = null) {
          const T = [this.minX, this.minY, this.maxX, this.maxY];
          if (a === v.STROKE) {
            c || (0, e.unreachable)("Stroke bounding box must include transform.");
            const _ = e.Util.singularValueDecompose2dScale(c), d = _[0] * this.lineWidth / 2, E = _[1] * this.lineWidth / 2;
            T[0] -= d, T[1] -= E, T[2] += d, T[3] += E;
          }
          return T;
        }
        updateClipFromPath() {
          const a = e.Util.intersect(this.clipBox, this.getPathBoundingBox());
          this.startNewPathAndClipBox(a || [0, 0, 0, 0]);
        }
        isEmptyClip() {
          return this.minX === 1 / 0;
        }
        startNewPathAndClipBox(a) {
          this.clipBox = a, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
        }
        getClippedPathBoundingBox(a = v.FILL, c = null) {
          return e.Util.intersect(this.clipBox, this.getPathBoundingBox(a, c));
        }
      }
      function rt(S, a) {
        if (typeof ImageData < "u" && a instanceof ImageData) {
          S.putImageData(a, 0, 0);
          return;
        }
        const c = a.height, T = a.width, _ = c % D, d = (c - _) / D, E = _ === 0 ? d : d + 1, F = S.createImageData(T, D);
        let P = 0, M;
        const N = a.data, G = F.data;
        let z, O, I, W;
        if (a.kind === e.ImageKind.GRAYSCALE_1BPP) {
          const st = N.byteLength, K = new Uint32Array(G.buffer, 0, G.byteLength >> 2), et = K.length, ut = T + 7 >> 3, at = 4294967295, nt = e.FeatureTest.isLittleEndian ? 4278190080 : 255;
          for (z = 0; z < E; z++) {
            for (I = z < d ? D : _, M = 0, O = 0; O < I; O++) {
              const dt = st - P;
              let ft = 0;
              const bt = dt > ut ? T : dt * 8 - 7, yt = bt & -8;
              let wt = 0, vt = 0;
              for (; ft < yt; ft += 8)
                vt = N[P++], K[M++] = vt & 128 ? at : nt, K[M++] = vt & 64 ? at : nt, K[M++] = vt & 32 ? at : nt, K[M++] = vt & 16 ? at : nt, K[M++] = vt & 8 ? at : nt, K[M++] = vt & 4 ? at : nt, K[M++] = vt & 2 ? at : nt, K[M++] = vt & 1 ? at : nt;
              for (; ft < bt; ft++)
                wt === 0 && (vt = N[P++], wt = 128), K[M++] = vt & wt ? at : nt, wt >>= 1;
            }
            for (; M < et; )
              K[M++] = 0;
            S.putImageData(F, 0, z * D);
          }
        } else if (a.kind === e.ImageKind.RGBA_32BPP) {
          for (O = 0, W = T * D * 4, z = 0; z < d; z++)
            G.set(N.subarray(P, P + W)), P += W, S.putImageData(F, 0, O), O += D;
          z < E && (W = T * _ * 4, G.set(N.subarray(P, P + W)), S.putImageData(F, 0, O));
        } else if (a.kind === e.ImageKind.RGB_24BPP)
          for (I = D, W = T * I, z = 0; z < E; z++) {
            for (z >= d && (I = _, W = T * I), M = 0, O = W; O--; )
              G[M++] = N[P++], G[M++] = N[P++], G[M++] = N[P++], G[M++] = 255;
            S.putImageData(F, 0, z * D);
          }
        else
          throw new Error(`bad image kind: ${a.kind}`);
      }
      function Y(S, a) {
        if (a.bitmap) {
          S.drawImage(a.bitmap, 0, 0);
          return;
        }
        const c = a.height, T = a.width, _ = c % D, d = (c - _) / D, E = _ === 0 ? d : d + 1, F = S.createImageData(T, D);
        let P = 0;
        const M = a.data, N = F.data;
        for (let G = 0; G < E; G++) {
          const z = G < d ? D : _;
          ({
            srcPos: P
          } = w({
            src: M,
            srcPos: P,
            dest: N,
            width: T,
            height: z,
            nonBlackColor: 0
          })), S.putImageData(F, 0, G * D);
        }
      }
      function B(S, a) {
        const c = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
        for (const T of c)
          S[T] !== void 0 && (a[T] = S[T]);
        S.setLineDash !== void 0 && (a.setLineDash(S.getLineDash()), a.lineDashOffset = S.lineDashOffset);
      }
      function U(S) {
        if (S.strokeStyle = S.fillStyle = "#000000", S.fillRule = "nonzero", S.globalAlpha = 1, S.lineWidth = 1, S.lineCap = "butt", S.lineJoin = "miter", S.miterLimit = 10, S.globalCompositeOperation = "source-over", S.font = "10px sans-serif", S.setLineDash !== void 0 && (S.setLineDash([]), S.lineDashOffset = 0), !e.isNodeJS) {
          const {
            filter: a
          } = S;
          a !== "none" && a !== "" && (S.filter = "none");
        }
      }
      function j(S, a, c, T) {
        const _ = S.length;
        for (let d = 3; d < _; d += 4) {
          const E = S[d];
          if (E === 0)
            S[d - 3] = a, S[d - 2] = c, S[d - 1] = T;
          else if (E < 255) {
            const F = 255 - E;
            S[d - 3] = S[d - 3] * E + a * F >> 8, S[d - 2] = S[d - 2] * E + c * F >> 8, S[d - 1] = S[d - 1] * E + T * F >> 8;
          }
        }
      }
      function Q(S, a, c) {
        const T = S.length, _ = 1 / 255;
        for (let d = 3; d < T; d += 4) {
          const E = c ? c[S[d]] : S[d];
          a[d] = a[d] * E * _ | 0;
        }
      }
      function J(S, a, c) {
        const T = S.length;
        for (let _ = 3; _ < T; _ += 4) {
          const d = S[_ - 3] * 77 + S[_ - 2] * 152 + S[_ - 1] * 28;
          a[_] = c ? a[_] * c[d >> 8] >> 8 : a[_] * d >> 16;
        }
      }
      function it(S, a, c, T, _, d, E, F, P, M, N) {
        const G = !!d, z = G ? d[0] : 0, O = G ? d[1] : 0, I = G ? d[2] : 0, W = _ === "Luminosity" ? J : Q, K = Math.min(T, Math.ceil(1048576 / c));
        for (let et = 0; et < T; et += K) {
          const ut = Math.min(K, T - et), at = S.getImageData(F - M, et + (P - N), c, ut), nt = a.getImageData(F, et + P, c, ut);
          G && j(at.data, z, O, I), W(at.data, nt.data, E), a.putImageData(nt, F, et + P);
        }
      }
      function ht(S, a, c, T) {
        const _ = T[0], d = T[1], E = T[2] - _, F = T[3] - d;
        E === 0 || F === 0 || (it(a.context, c, E, F, a.subtype, a.backdrop, a.transferMap, _, d, a.offsetX, a.offsetY), S.save(), S.globalAlpha = 1, S.globalCompositeOperation = "source-over", S.setTransform(1, 0, 0, 1, 0, 0), S.drawImage(c.canvas, 0, 0), S.restore());
      }
      function ot(S, a) {
        if (a)
          return !0;
        const c = e.Util.singularValueDecompose2dScale(S);
        c[0] = Math.fround(c[0]), c[1] = Math.fround(c[1]);
        const T = Math.fround((globalThis.devicePixelRatio || 1) * y.PixelsPerInch.PDF_TO_CSS_UNITS);
        return c[0] <= T && c[1] <= T;
      }
      const Z = ["butt", "round", "square"], lt = ["miter", "round", "bevel"], ct = {}, $ = {};
      class k {
        constructor(a, c, T, _, d, {
          optionalContentConfig: E,
          markedContentStack: F = null
        }, P, M) {
          this.ctx = a, this.current = new tt(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = c, this.objs = T, this.canvasFactory = _, this.filterFactory = d, 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 = F || [], this.optionalContentConfig = E, this.cachedCanvases = new X(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = P, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = M, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
        }
        getObject(a, c = null) {
          return typeof a == "string" ? a.startsWith("g_") ? this.commonObjs.get(a) : this.objs.get(a) : c;
        }
        beginDrawing({
          transform: a,
          viewport: c,
          transparency: T = !1,
          background: _ = null
        }) {
          const d = this.ctx.canvas.width, E = this.ctx.canvas.height, F = this.ctx.fillStyle;
          if (this.ctx.fillStyle = _ || "#ffffff", this.ctx.fillRect(0, 0, d, E), this.ctx.fillStyle = F, T) {
            const P = this.cachedCanvases.getCanvas("transparent", d, E);
            this.compositeCtx = this.ctx, this.transparentCanvas = P.canvas, this.ctx = P.context, this.ctx.save(), this.ctx.transform(...(0, y.getCurrentTransform)(this.compositeCtx));
          }
          this.ctx.save(), U(this.ctx), a && (this.ctx.transform(...a), this.outputScaleX = a[0], this.outputScaleY = a[0]), this.ctx.transform(...c.transform), this.viewportScale = c.scale, this.baseTransform = (0, y.getCurrentTransform)(this.ctx);
        }
        executeOperatorList(a, c, T, _) {
          const d = a.argsArray, E = a.fnArray;
          let F = c || 0;
          const P = d.length;
          if (P === F)
            return F;
          const M = P - F > R && typeof T == "function", N = M ? Date.now() + b : 0;
          let G = 0;
          const z = this.commonObjs, O = this.objs;
          let I;
          for (; ; ) {
            if (_ !== void 0 && F === _.nextBreakPoint)
              return _.breakIt(F, T), F;
            if (I = E[F], I !== e.OPS.dependency)
              this[I].apply(this, d[F]);
            else
              for (const W of d[F]) {
                const st = W.startsWith("g_") ? z : O;
                if (!st.has(W))
                  return st.get(W, T), F;
              }
            if (F++, F === P)
              return F;
            if (M && ++G > R) {
              if (Date.now() > N)
                return T(), F;
              G = 0;
            }
          }
        }
        #t() {
          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);
        }
        endDrawing() {
          this.#t(), this.cachedCanvases.clear(), this.cachedPatterns.clear();
          for (const a of this._cachedBitmapsMap.values()) {
            for (const c of a.values())
              typeof HTMLCanvasElement < "u" && c instanceof HTMLCanvasElement && (c.width = c.height = 0);
            a.clear();
          }
          this._cachedBitmapsMap.clear(), this.#e();
        }
        #e() {
          if (this.pageColors) {
            const a = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
            if (a !== "none") {
              const c = this.ctx.filter;
              this.ctx.filter = a, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = c;
            }
          }
        }
        _scaleImage(a, c) {
          const T = a.width, _ = a.height;
          let d = Math.max(Math.hypot(c[0], c[1]), 1), E = Math.max(Math.hypot(c[2], c[3]), 1), F = T, P = _, M = "prescale1", N, G;
          for (; d > 2 && F > 1 || E > 2 && P > 1; ) {
            let z = F, O = P;
            d > 2 && F > 1 && (z = F >= 16384 ? Math.floor(F / 2) - 1 || 1 : Math.ceil(F / 2), d /= F / z), E > 2 && P > 1 && (O = P >= 16384 ? Math.floor(P / 2) - 1 || 1 : Math.ceil(P) / 2, E /= P / O), N = this.cachedCanvases.getCanvas(M, z, O), G = N.context, G.clearRect(0, 0, z, O), G.drawImage(a, 0, 0, F, P, 0, 0, z, O), a = N.canvas, F = z, P = O, M = M === "prescale1" ? "prescale2" : "prescale1";
          }
          return {
            img: a,
            paintWidth: F,
            paintHeight: P
          };
        }
        _createMaskCanvas(a) {
          const c = this.ctx, {
            width: T,
            height: _
          } = a, d = this.current.fillColor, E = this.current.patternFill, F = (0, y.getCurrentTransform)(c);
          let P, M, N, G;
          if ((a.bitmap || a.data) && a.count > 1) {
            const bt = a.bitmap || a.data.buffer;
            M = JSON.stringify(E ? F : [F.slice(0, 4), d]), P = this._cachedBitmapsMap.get(bt), P || (P = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(bt, P));
            const yt = P.get(M);
            if (yt && !E) {
              const wt = Math.round(Math.min(F[0], F[2]) + F[4]), vt = Math.round(Math.min(F[1], F[3]) + F[5]);
              return {
                canvas: yt,
                offsetX: wt,
                offsetY: vt
              };
            }
            N = yt;
          }
          N || (G = this.cachedCanvases.getCanvas("maskCanvas", T, _), Y(G.context, a));
          let z = e.Util.transform(F, [1 / T, 0, 0, -1 / _, 0, 0]);
          z = e.Util.transform(z, [1, 0, 0, 1, 0, -_]);
          const [O, I, W, st] = e.Util.getAxialAlignedBoundingBox([0, 0, T, _], z), K = Math.round(W - O) || 1, et = Math.round(st - I) || 1, ut = this.cachedCanvases.getCanvas("fillCanvas", K, et), at = ut.context, nt = O, dt = I;
          at.translate(-nt, -dt), at.transform(...z), N || (N = this._scaleImage(G.canvas, (0, y.getCurrentTransformInverse)(at)), N = N.img, P && E && P.set(M, N)), at.imageSmoothingEnabled = ot((0, y.getCurrentTransform)(at), a.interpolate), V(at, N, 0, 0, N.width, N.height, 0, 0, T, _), at.globalCompositeOperation = "source-in";
          const ft = e.Util.transform((0, y.getCurrentTransformInverse)(at), [1, 0, 0, 1, -nt, -dt]);
          return at.fillStyle = E ? d.getPattern(c, this, ft, v.FILL) : d, at.fillRect(0, 0, T, _), P && !E && (this.cachedCanvases.delete("fillCanvas"), P.set(M, ut.canvas)), {
            canvas: ut.canvas,
            offsetX: Math.round(nt),
            offsetY: Math.round(dt)
          };
        }
        setLineWidth(a) {
          a !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = a, this.ctx.lineWidth = a;
        }
        setLineCap(a) {
          this.ctx.lineCap = Z[a];
        }
        setLineJoin(a) {
          this.ctx.lineJoin = lt[a];
        }
        setMiterLimit(a) {
          this.ctx.miterLimit = a;
        }
        setDash(a, c) {
          const T = this.ctx;
          T.setLineDash !== void 0 && (T.setLineDash(a), T.lineDashOffset = c);
        }
        setRenderingIntent(a) {
        }
        setFlatness(a) {
        }
        setGState(a) {
          for (const [c, T] of a)
            switch (c) {
              case "LW":
                this.setLineWidth(T);
                break;
              case "LC":
                this.setLineCap(T);
                break;
              case "LJ":
                this.setLineJoin(T);
                break;
              case "ML":
                this.setMiterLimit(T);
                break;
              case "D":
                this.setDash(T[0], T[1]);
                break;
              case "RI":
                this.setRenderingIntent(T);
                break;
              case "FL":
                this.setFlatness(T);
                break;
              case "Font":
                this.setFont(T[0], T[1]);
                break;
              case "CA":
                this.current.strokeAlpha = T;
                break;
              case "ca":
                this.current.fillAlpha = T, this.ctx.globalAlpha = T;
                break;
              case "BM":
                this.ctx.globalCompositeOperation = T;
                break;
              case "SMask":
                this.current.activeSMask = T ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
                break;
              case "TR":
                this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(T);
                break;
            }
        }
        get inSMaskMode() {
          return !!this.suspendedCtx;
        }
        checkSMaskState() {
          const a = this.inSMaskMode;
          this.current.activeSMask && !a ? this.beginSMaskMode() : !this.current.activeSMask && a && this.endSMaskMode();
        }
        beginSMaskMode() {
          if (this.inSMaskMode)
            throw new Error("beginSMaskMode called while already in smask mode");
          const a = this.ctx.canvas.width, c = this.ctx.canvas.height, T = "smaskGroupAt" + this.groupLevel, _ = this.cachedCanvases.getCanvas(T, a, c);
          this.suspendedCtx = this.ctx, this.ctx = _.context;
          const d = this.ctx;
          d.setTransform(...(0, y.getCurrentTransform)(this.suspendedCtx)), B(this.suspendedCtx, d), H(d, 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(), B(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
        }
        compose(a) {
          if (!this.current.activeSMask)
            return;
          a ? (a[0] = Math.floor(a[0]), a[1] = Math.floor(a[1]), a[2] = Math.ceil(a[2]), a[3] = Math.ceil(a[3])) : a = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
          const c = this.current.activeSMask, T = this.suspendedCtx;
          ht(T, c, this.ctx, a), 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 ? (B(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
          const a = this.current;
          this.stateStack.push(a), this.current = a.clone();
        }
        restore() {
          this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), B(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null);
        }
        transform(a, c, T, _, d, E) {
          this.ctx.transform(a, c, T, _, d, E), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
        }
        constructPath(a, c, T) {
          const _ = this.ctx, d = this.current;
          let E = d.x, F = d.y, P, M;
          const N = (0, y.getCurrentTransform)(_), G = N[0] === 0 && N[3] === 0 || N[1] === 0 && N[2] === 0, z = G ? T.slice(0) : null;
          for (let O = 0, I = 0, W = a.length; O < W; O++)
            switch (a[O] | 0) {
              case e.OPS.rectangle:
                E = c[I++], F = c[I++];
                const st = c[I++], K = c[I++], et = E + st, ut = F + K;
                _.moveTo(E, F), st === 0 || K === 0 ? _.lineTo(et, ut) : (_.lineTo(et, F), _.lineTo(et, ut), _.lineTo(E, ut)), G || d.updateRectMinMax(N, [E, F, et, ut]), _.closePath();
                break;
              case e.OPS.moveTo:
                E = c[I++], F = c[I++], _.moveTo(E, F), G || d.updatePathMinMax(N, E, F);
                break;
              case e.OPS.lineTo:
                E = c[I++], F = c[I++], _.lineTo(E, F), G || d.updatePathMinMax(N, E, F);
                break;
              case e.OPS.curveTo:
                P = E, M = F, E = c[I + 4], F = c[I + 5], _.bezierCurveTo(c[I], c[I + 1], c[I + 2], c[I + 3], E, F), d.updateCurvePathMinMax(N, P, M, c[I], c[I + 1], c[I + 2], c[I + 3], E, F, z), I += 6;
                break;
              case e.OPS.curveTo2:
                P = E, M = F, _.bezierCurveTo(E, F, c[I], c[I + 1], c[I + 2], c[I + 3]), d.updateCurvePathMinMax(N, P, M, E, F, c[I], c[I + 1], c[I + 2], c[I + 3], z), E = c[I + 2], F = c[I + 3], I += 4;
                break;
              case e.OPS.curveTo3:
                P = E, M = F, E = c[I + 2], F = c[I + 3], _.bezierCurveTo(c[I], c[I + 1], E, F, E, F), d.updateCurvePathMinMax(N, P, M, c[I], c[I + 1], E, F, E, F, z), I += 4;
                break;
              case e.OPS.closePath:
                _.closePath();
                break;
            }
          G && d.updateScalingPathMinMax(N, z), d.setCurrentPoint(E, F);
        }
        closePath() {
          this.ctx.closePath();
        }
        stroke(a = !0) {
          const c = this.ctx, T = this.current.strokeColor;
          c.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof T == "object" && T?.getPattern ? (c.save(), c.strokeStyle = T.getPattern(c, this, (0, y.getCurrentTransformInverse)(c), v.STROKE), this.rescaleAndStroke(!1), c.restore()) : this.rescaleAndStroke(!0)), a && this.consumePath(this.current.getClippedPathBoundingBox()), c.globalAlpha = this.current.fillAlpha;
        }
        closeStroke() {
          this.closePath(), this.stroke();
        }
        fill(a = !0) {
          const c = this.ctx, T = this.current.fillColor, _ = this.current.patternFill;
          let d = !1;
          _ && (c.save(), c.fillStyle = T.getPattern(c, this, (0, y.getCurrentTransformInverse)(c), v.FILL), d = !0);
          const E = this.current.getClippedPathBoundingBox();
          this.contentVisible && E !== null && (this.pendingEOFill ? (c.fill("evenodd"), this.pendingEOFill = !1) : c.fill()), d && c.restore(), a && this.consumePath(E);
        }
        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 = ct;
        }
        eoClip() {
          this.pendingClip = $;
        }
        beginText() {
          this.current.textMatrix = e.IDENTITY_MATRIX, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
        }
        endText() {
          const a = this.pendingTextPaths, c = this.ctx;
          if (a === void 0) {
            c.beginPath();
            return;
          }
          c.save(), c.beginPath();
          for (const T of a)
            c.setTransform(...T.transform), c.translate(T.x, T.y), T.addToPath(c, T.fontSize);
          c.restore(), c.clip(), c.beginPath(), delete this.pendingTextPaths;
        }
        setCharSpacing(a) {
          this.current.charSpacing = a;
        }
        setWordSpacing(a) {
          this.current.wordSpacing = a;
        }
        setHScale(a) {
          this.current.textHScale = a / 100;
        }
        setLeading(a) {
          this.current.leading = -a;
        }
        setFont(a, c) {
          const T = this.commonObjs.get(a), _ = this.current;
          if (!T)
            throw new Error(`Can't find font for ${a}`);
          if (_.fontMatrix = T.fontMatrix || e.FONT_IDENTITY_MATRIX, (_.fontMatrix[0] === 0 || _.fontMatrix[3] === 0) && (0, e.warn)("Invalid font matrix for font " + a), c < 0 ? (c = -c, _.fontDirection = -1) : _.fontDirection = 1, this.current.font = T, this.current.fontSize = c, T.isType3Font)
            return;
          const d = T.loadedName || "sans-serif", E = T.systemFontInfo?.css || `"${d}", ${T.fallbackName}`;
          let F = "normal";
          T.black ? F = "900" : T.bold && (F = "bold");
          const P = T.italic ? "italic" : "normal";
          let M = c;
          c < t ? M = t : c > o && (M = o), this.current.fontSizeScale = c / M, this.ctx.font = `${P} ${F} ${M}px ${E}`;
        }
        setTextRenderingMode(a) {
          this.current.textRenderingMode = a;
        }
        setTextRise(a) {
          this.current.textRise = a;
        }
        moveText(a, c) {
          this.current.x = this.current.lineX += a, this.current.y = this.current.lineY += c;
        }
        setLeadingMoveText(a, c) {
          this.setLeading(-c), this.moveText(a, c);
        }
        setTextMatrix(a, c, T, _, d, E) {
          this.current.textMatrix = [a, c, T, _, d, E], this.current.textMatrixScale = Math.hypot(a, c), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
        }
        nextLine() {
          this.moveText(0, this.current.leading);
        }
        paintChar(a, c, T, _) {
          const d = this.ctx, E = this.current, F = E.font, P = E.textRenderingMode, M = E.fontSize / E.fontSizeScale, N = P & e.TextRenderingMode.FILL_STROKE_MASK, G = !!(P & e.TextRenderingMode.ADD_TO_PATH_FLAG), z = E.patternFill && !F.missingFile;
          let O;
          (F.disableFontFace || G || z) && (O = F.getPathGenerator(this.commonObjs, a)), F.disableFontFace || z ? (d.save(), d.translate(c, T), d.beginPath(), O(d, M), _ && d.setTransform(..._), (N === e.TextRenderingMode.FILL || N === e.TextRenderingMode.FILL_STROKE) && d.fill(), (N === e.TextRenderingMode.STROKE || N === e.TextRenderingMode.FILL_STROKE) && d.stroke(), d.restore()) : ((N === e.TextRenderingMode.FILL || N === e.TextRenderingMode.FILL_STROKE) && d.fillText(a, c, T), (N === e.TextRenderingMode.STROKE || N === e.TextRenderingMode.FILL_STROKE) && d.strokeText(a, c, T)), G && (this.pendingTextPaths ||= []).push({
            transform: (0, y.getCurrentTransform)(d),
            x: c,
            y: T,
            fontSize: M,
            addToPath: O
          });
        }
        get isFontSubpixelAAEnabled() {
          const {
            context: a
          } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
          a.scale(1.5, 1), a.fillText("I", 0, 10);
          const c = a.getImageData(0, 0, 10, 10).data;
          let T = !1;
          for (let _ = 3; _ < c.length; _ += 4)
            if (c[_] > 0 && c[_] < 255) {
              T = !0;
              break;
            }
          return (0, e.shadow)(this, "isFontSubpixelAAEnabled", T);
        }
        showText(a) {
          const c = this.current, T = c.font;
          if (T.isType3Font)
            return this.showType3Text(a);
          const _ = c.fontSize;
          if (_ === 0)
            return;
          const d = this.ctx, E = c.fontSizeScale, F = c.charSpacing, P = c.wordSpacing, M = c.fontDirection, N = c.textHScale * M, G = a.length, z = T.vertical, O = z ? 1 : -1, I = T.defaultVMetrics, W = _ * c.fontMatrix[0], st = c.textRenderingMode === e.TextRenderingMode.FILL && !T.disableFontFace && !c.patternFill;
          d.save(), d.transform(...c.textMatrix), d.translate(c.x, c.y + c.textRise), M > 0 ? d.scale(N, -1) : d.scale(N, 1);
          let K;
          if (c.patternFill) {
            d.save();
            const dt = c.fillColor.getPattern(d, this, (0, y.getCurrentTransformInverse)(d), v.FILL);
            K = (0, y.getCurrentTransform)(d), d.restore(), d.fillStyle = dt;
          }
          let et = c.lineWidth;
          const ut = c.textMatrixScale;
          if (ut === 0 || et === 0) {
            const dt = c.textRenderingMode & e.TextRenderingMode.FILL_STROKE_MASK;
            (dt === e.TextRenderingMode.STROKE || dt === e.TextRenderingMode.FILL_STROKE) && (et = this.getSinglePixelWidth());
          } else
            et /= ut;
          if (E !== 1 && (d.scale(E, E), et /= E), d.lineWidth = et, T.isInvalidPDFjsFont) {
            const dt = [];
            let ft = 0;
            for (const bt of a)
              dt.push(bt.unicode), ft += bt.width;
            d.fillText(dt.join(""), 0, 0), c.x += ft * W * N, d.restore(), this.compose();
            return;
          }
          let at = 0, nt;
          for (nt = 0; nt < G; ++nt) {
            const dt = a[nt];
            if (typeof dt == "number") {
              at += O * dt * _ / 1e3;
              continue;
            }
            let ft = !1;
            const bt = (dt.isSpace ? P : 0) + F, yt = dt.fontChar, wt = dt.accent;
            let vt, qt, xt = dt.width;
            if (z) {
              const Et = dt.vmetric || I, Rt = -(dt.vmetric ? Et[1] : xt * 0.5) * W, Kt = Et[2] * W;
              xt = Et ? -Et[0] : xt, vt = Rt / E, qt = (at + Kt) / E;
            } else
              vt = at / E, qt = 0;
            if (T.remeasure && xt > 0) {
              const Et = d.measureText(yt).width * 1e3 / _ * E;
              if (xt < Et && this.isFontSubpixelAAEnabled) {
                const Rt = xt / Et;
                ft = !0, d.save(), d.scale(Rt, 1), vt /= Rt;
              } else
                xt !== Et && (vt += (xt - Et) / 2e3 * _ / E);
            }
            if (this.contentVisible && (dt.isInFont || T.missingFile)) {
              if (st && !wt)
                d.fillText(yt, vt, qt);
              else if (this.paintChar(yt, vt, qt, K), wt) {
                const Et = vt + _ * wt.offset.x / E, Rt = qt - _ * wt.offset.y / E;
                this.paintChar(wt.fontChar, Et, Rt, K);
              }
            }
            const It = z ? xt * W - bt * M : xt * W + bt * M;
            at += It, ft && d.restore();
          }
          z ? c.y -= at : c.x += at * N, d.restore(), this.compose();
        }
        showType3Text(a) {
          const c = this.ctx, T = this.current, _ = T.font, d = T.fontSize, E = T.fontDirection, F = _.vertical ? 1 : -1, P = T.charSpacing, M = T.wordSpacing, N = T.textHScale * E, G = T.fontMatrix || e.FONT_IDENTITY_MATRIX, z = a.length, O = T.textRenderingMode === e.TextRenderingMode.INVISIBLE;
          let I, W, st, K;
          if (!(O || d === 0)) {
            for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, c.save(), c.transform(...T.textMatrix), c.translate(T.x, T.y), c.scale(N, E), I = 0; I < z; ++I) {
              if (W = a[I], typeof W == "number") {
                K = F * W * d / 1e3, this.ctx.translate(K, 0), T.x += K * N;
                continue;
              }
              const et = (W.isSpace ? M : 0) + P, ut = _.charProcOperatorList[W.operatorListId];
              if (!ut) {
                (0, e.warn)(`Type3 character "${W.operatorListId}" is not available.`);
                continue;
              }
              this.contentVisible && (this.processingType3 = W, this.save(), c.scale(d, d), c.transform(...G), this.executeOperatorList(ut), this.restore()), st = e.Util.applyTransform([W.width, 0], G)[0] * d + et, c.translate(st, 0), T.x += st * N;
            }
            c.restore(), this.processingType3 = null;
          }
        }
        setCharWidth(a, c) {
        }
        setCharWidthAndBounds(a, c, T, _, d, E) {
          this.ctx.rect(T, _, d - T, E - _), this.ctx.clip(), this.endPath();
        }
        getColorN_Pattern(a) {
          let c;
          if (a[0] === "TilingPattern") {
            const T = a[1], _ = this.baseTransform || (0, y.getCurrentTransform)(this.ctx), d = {
              createCanvasGraphics: (E) => new k(E, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: this.optionalContentConfig,
                markedContentStack: this.markedContentStack
              })
            };
            c = new r(a, T, this.ctx, d, _);
          } else
            c = this._getPattern(a[1], a[2]);
          return c;
        }
        setStrokeColorN() {
          this.current.strokeColor = this.getColorN_Pattern(arguments);
        }
        setFillColorN() {
          this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
        }
        setStrokeRGBColor(a, c, T) {
          const _ = e.Util.makeHexColor(a, c, T);
          this.ctx.strokeStyle = _, this.current.strokeColor = _;
        }
        setFillRGBColor(a, c, T) {
          const _ = e.Util.makeHexColor(a, c, T);
          this.ctx.fillStyle = _, this.current.fillColor = _, this.current.patternFill = !1;
        }
        _getPattern(a, c = null) {
          let T;
          return this.cachedPatterns.has(a) ? T = this.cachedPatterns.get(a) : (T = p(this.getObject(a)), this.cachedPatterns.set(a, T)), c && (T.matrix = c), T;
        }
        shadingFill(a) {
          if (!this.contentVisible)
            return;
          const c = this.ctx;
          this.save();
          const T = this._getPattern(a);
          c.fillStyle = T.getPattern(c, this, (0, y.getCurrentTransformInverse)(c), v.SHADING);
          const _ = (0, y.getCurrentTransformInverse)(c);
          if (_) {
            const {
              width: d,
              height: E
            } = c.canvas, [F, P, M, N] = e.Util.getAxialAlignedBoundingBox([0, 0, d, E], _);
            this.ctx.fillRect(F, P, M - F, N - P);
          } else
            this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
          this.compose(this.current.getClippedPathBoundingBox()), this.restore();
        }
        beginInlineImage() {
          (0, e.unreachable)("Should not call beginInlineImage");
        }
        beginImageData() {
          (0, e.unreachable)("Should not call beginImageData");
        }
        paintFormXObjectBegin(a, c) {
          if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(a) && a.length === 6 && this.transform(...a), this.baseTransform = (0, y.getCurrentTransform)(this.ctx), c)) {
            const T = c[2] - c[0], _ = c[3] - c[1];
            this.ctx.rect(c[0], c[1], T, _), this.current.updateRectMinMax((0, y.getCurrentTransform)(this.ctx), c), this.clip(), this.endPath();
          }
        }
        paintFormXObjectEnd() {
          this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
        }
        beginGroup(a) {
          if (!this.contentVisible)
            return;
          this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
          const c = this.ctx;
          a.isolated || (0, e.info)("TODO: Support non-isolated groups."), a.knockout && (0, e.warn)("Knockout groups not supported.");
          const T = (0, y.getCurrentTransform)(c);
          if (a.matrix && c.transform(...a.matrix), !a.bbox)
            throw new Error("Bounding box is required.");
          let _ = e.Util.getAxialAlignedBoundingBox(a.bbox, (0, y.getCurrentTransform)(c));
          const d = [0, 0, c.canvas.width, c.canvas.height];
          _ = e.Util.intersect(_, d) || [0, 0, 0, 0];
          const E = Math.floor(_[0]), F = Math.floor(_[1]);
          let P = Math.max(Math.ceil(_[2]) - E, 1), M = Math.max(Math.ceil(_[3]) - F, 1), N = 1, G = 1;
          P > A && (N = P / A, P = A), M > A && (G = M / A, M = A), this.current.startNewPathAndClipBox([0, 0, P, M]);
          let z = "groupAt" + this.groupLevel;
          a.smask && (z += "_smask_" + this.smaskCounter++ % 2);
          const O = this.cachedCanvases.getCanvas(z, P, M), I = O.context;
          I.scale(1 / N, 1 / G), I.translate(-E, -F), I.transform(...T), a.smask ? this.smaskStack.push({
            canvas: O.canvas,
            context: I,
            offsetX: E,
            offsetY: F,
            scaleX: N,
            scaleY: G,
            subtype: a.smask.subtype,
            backdrop: a.smask.backdrop,
            transferMap: a.smask.transferMap || null,
            startTransformInverse: null
          }) : (c.setTransform(1, 0, 0, 1, 0, 0), c.translate(E, F), c.scale(N, G), c.save()), B(c, I), this.ctx = I, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(c), this.groupLevel++;
        }
        endGroup(a) {
          if (!this.contentVisible)
            return;
          this.groupLevel--;
          const c = this.ctx, T = this.groupStack.pop();
          if (this.ctx = T, this.ctx.imageSmoothingEnabled = !1, a.smask)
            this.tempSMask = this.smaskStack.pop(), this.restore();
          else {
            this.ctx.restore();
            const _ = (0, y.getCurrentTransform)(this.ctx);
            this.restore(), this.ctx.save(), this.ctx.setTransform(..._);
            const d = e.Util.getAxialAlignedBoundingBox([0, 0, c.canvas.width, c.canvas.height], _);
            this.ctx.drawImage(c.canvas, 0, 0), this.ctx.restore(), this.compose(d);
          }
        }
        beginAnnotation(a, c, T, _, d) {
          if (this.#t(), U(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(c) && c.length === 4) {
            const E = c[2] - c[0], F = c[3] - c[1];
            if (d && this.annotationCanvasMap) {
              T = T.slice(), T[4] -= c[0], T[5] -= c[1], c = c.slice(), c[0] = c[1] = 0, c[2] = E, c[3] = F;
              const [P, M] = e.Util.singularValueDecompose2dScale((0, y.getCurrentTransform)(this.ctx)), {
                viewportScale: N
              } = this, G = Math.ceil(E * this.outputScaleX * N), z = Math.ceil(F * this.outputScaleY * N);
              this.annotationCanvas = this.canvasFactory.create(G, z);
              const {
                canvas: O,
                context: I
              } = this.annotationCanvas;
              this.annotationCanvasMap.set(a, O), this.annotationCanvas.savedCtx = this.ctx, this.ctx = I, this.ctx.save(), this.ctx.setTransform(P, 0, 0, -M, 0, F * M), U(this.ctx);
            } else
              U(this.ctx), this.ctx.rect(c[0], c[1], E, F), this.ctx.clip(), this.endPath();
          }
          this.current = new tt(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...T), this.transform(..._);
        }
        endAnnotation() {
          this.annotationCanvas && (this.ctx.restore(), this.#e(), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
        }
        paintImageMaskXObject(a) {
          if (!this.contentVisible)
            return;
          const c = a.count;
          a = this.getObject(a.data, a), a.count = c;
          const T = this.ctx, _ = this.processingType3;
          if (_ && (_.compiled === void 0 && (_.compiled = q(a)), _.compiled)) {
            _.compiled(T);
            return;
          }
          const d = this._createMaskCanvas(a), E = d.canvas;
          T.save(), T.setTransform(1, 0, 0, 1, 0, 0), T.drawImage(E, d.offsetX, d.offsetY), T.restore(), this.compose();
        }
        paintImageMaskXObjectRepeat(a, c, T = 0, _ = 0, d, E) {
          if (!this.contentVisible)
            return;
          a = this.getObject(a.data, a);
          const F = this.ctx;
          F.save();
          const P = (0, y.getCurrentTransform)(F);
          F.transform(c, T, _, d, 0, 0);
          const M = this._createMaskCanvas(a);
          F.setTransform(1, 0, 0, 1, M.offsetX - P[4], M.offsetY - P[5]);
          for (let N = 0, G = E.length; N < G; N += 2) {
            const z = e.Util.transform(P, [c, T, _, d, E[N], E[N + 1]]), [O, I] = e.Util.applyTransform([0, 0], z);
            F.drawImage(M.canvas, O, I);
          }
          F.restore(), this.compose();
        }
        paintImageMaskXObjectGroup(a) {
          if (!this.contentVisible)
            return;
          const c = this.ctx, T = this.current.fillColor, _ = this.current.patternFill;
          for (const d of a) {
            const {
              data: E,
              width: F,
              height: P,
              transform: M
            } = d, N = this.cachedCanvases.getCanvas("maskCanvas", F, P), G = N.context;
            G.save();
            const z = this.getObject(E, d);
            Y(G, z), G.globalCompositeOperation = "source-in", G.fillStyle = _ ? T.getPattern(G, this, (0, y.getCurrentTransformInverse)(c), v.FILL) : T, G.fillRect(0, 0, F, P), G.restore(), c.save(), c.transform(...M), c.scale(1, -1), V(c, N.canvas, 0, 0, F, P, 0, -1, 1, 1), c.restore();
          }
          this.compose();
        }
        paintImageXObject(a) {
          if (!this.contentVisible)
            return;
          const c = this.getObject(a);
          if (!c) {
            (0, e.warn)("Dependent image isn't ready yet");
            return;
          }
          this.paintInlineImageXObject(c);
        }
        paintImageXObjectRepeat(a, c, T, _) {
          if (!this.contentVisible)
            return;
          const d = this.getObject(a);
          if (!d) {
            (0, e.warn)("Dependent image isn't ready yet");
            return;
          }
          const E = d.width, F = d.height, P = [];
          for (let M = 0, N = _.length; M < N; M += 2)
            P.push({
              transform: [c, 0, 0, T, _[M], _[M + 1]],
              x: 0,
              y: 0,
              w: E,
              h: F
            });
          this.paintInlineImageXObjectGroup(d, P);
        }
        applyTransferMapsToCanvas(a) {
          return this.current.transferMaps !== "none" && (a.filter = this.current.transferMaps, a.drawImage(a.canvas, 0, 0), a.filter = "none"), a.canvas;
        }
        applyTransferMapsToBitmap(a) {
          if (this.current.transferMaps === "none")
            return a.bitmap;
          const {
            bitmap: c,
            width: T,
            height: _
          } = a, d = this.cachedCanvases.getCanvas("inlineImage", T, _), E = d.context;
          return E.filter = this.current.transferMaps, E.drawImage(c, 0, 0), E.filter = "none", d.canvas;
        }
        paintInlineImageXObject(a) {
          if (!this.contentVisible)
            return;
          const c = a.width, T = a.height, _ = this.ctx;
          if (this.save(), !e.isNodeJS) {
            const {
              filter: F
            } = _;
            F !== "none" && F !== "" && (_.filter = "none");
          }
          _.scale(1 / c, -1 / T);
          let d;
          if (a.bitmap)
            d = this.applyTransferMapsToBitmap(a);
          else if (typeof HTMLElement == "function" && a instanceof HTMLElement || !a.data)
            d = a;
          else {
            const P = this.cachedCanvases.getCanvas("inlineImage", c, T).context;
            rt(P, a), d = this.applyTransferMapsToCanvas(P);
          }
          const E = this._scaleImage(d, (0, y.getCurrentTransformInverse)(_));
          _.imageSmoothingEnabled = ot((0, y.getCurrentTransform)(_), a.interpolate), V(_, E.img, 0, 0, E.paintWidth, E.paintHeight, 0, -T, c, T), this.compose(), this.restore();
        }
        paintInlineImageXObjectGroup(a, c) {
          if (!this.contentVisible)
            return;
          const T = this.ctx;
          let _;
          if (a.bitmap)
            _ = a.bitmap;
          else {
            const d = a.width, E = a.height, P = this.cachedCanvases.getCanvas("inlineImage", d, E).context;
            rt(P, a), _ = this.applyTransferMapsToCanvas(P);
          }
          for (const d of c)
            T.save(), T.transform(...d.transform), T.scale(1, -1), V(T, _, d.x, d.y, d.w, d.h, 0, -1, 1, 1), T.restore();
          this.compose();
        }
        paintSolidColorImageMask() {
          this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
        }
        markPoint(a) {
        }
        markPointProps(a, c) {
        }
        beginMarkedContent(a) {
          this.markedContentStack.push({
            visible: !0
          });
        }
        beginMarkedContentProps(a, c) {
          a === "OC" ? this.markedContentStack.push({
            visible: this.optionalContentConfig.isVisible(c)
          }) : this.markedContentStack.push({
            visible: !0
          }), this.contentVisible = this.isContentVisible();
        }
        endMarkedContent() {
          this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
        }
        beginCompat() {
        }
        endCompat() {
        }
        consumePath(a) {
          const c = this.current.isEmptyClip();
          this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(a);
          const T = this.ctx;
          this.pendingClip && (c || (this.pendingClip === $ ? T.clip("evenodd") : T.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), T.beginPath();
        }
        getSinglePixelWidth() {
          if (!this._cachedGetSinglePixelWidth) {
            const a = (0, y.getCurrentTransform)(this.ctx);
            if (a[1] === 0 && a[2] === 0)
              this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(a[0]), Math.abs(a[3]));
            else {
              const c = Math.abs(a[0] * a[3] - a[2] * a[1]), T = Math.hypot(a[0], a[2]), _ = Math.hypot(a[1], a[3]);
              this._cachedGetSinglePixelWidth = Math.max(T, _) / c;
            }
          }
          return this._cachedGetSinglePixelWidth;
        }
        getScaleForStroking() {
          if (this._cachedScaleForStroking[0] === -1) {
            const {
              lineWidth: a
            } = this.current, {
              a: c,
              b: T,
              c: _,
              d
            } = this.ctx.getTransform();
            let E, F;
            if (T === 0 && _ === 0) {
              const P = Math.abs(c), M = Math.abs(d);
              if (P === M)
                if (a === 0)
                  E = F = 1 / P;
                else {
                  const N = P * a;
                  E = F = N < 1 ? 1 / N : 1;
                }
              else if (a === 0)
                E = 1 / P, F = 1 / M;
              else {
                const N = P * a, G = M * a;
                E = N < 1 ? 1 / N : 1, F = G < 1 ? 1 / G : 1;
              }
            } else {
              const P = Math.abs(c * d - T * _), M = Math.hypot(c, T), N = Math.hypot(_, d);
              if (a === 0)
                E = N / P, F = M / P;
              else {
                const G = a * P;
                E = N > G ? N / G : 1, F = M > G ? M / G : 1;
              }
            }
            this._cachedScaleForStroking[0] = E, this._cachedScaleForStroking[1] = F;
          }
          return this._cachedScaleForStroking;
        }
        rescaleAndStroke(a) {
          const {
            ctx: c
          } = this, {
            lineWidth: T
          } = this.current, [_, d] = this.getScaleForStroking();
          if (c.lineWidth = T || 1, _ === 1 && d === 1) {
            c.stroke();
            return;
          }
          const E = c.getLineDash();
          if (a && c.save(), c.scale(_, d), E.length > 0) {
            const F = Math.max(_, d);
            c.setLineDash(E.map((P) => P / F)), c.lineDashOffset /= F;
          }
          c.stroke(), a && c.restore();
        }
        isContentVisible() {
          for (let a = this.markedContentStack.length - 1; a >= 0; a--)
            if (!this.markedContentStack[a].visible)
              return !1;
          return !0;
        }
      }
      for (const S in e.OPS)
        k.prototype[S] !== void 0 && (k.prototype[e.OPS[S]] = k.prototype[S]);
    }
  ),
  /***/
  419: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        DOMCMapReaderFactory: () => (
          /* binding */
          h
        ),
        /* harmony export */
        DOMCanvasFactory: () => (
          /* binding */
          l
        ),
        /* harmony export */
        DOMFilterFactory: () => (
          /* binding */
          m
        ),
        /* harmony export */
        DOMSVGFactory: () => (
          /* binding */
          f
        ),
        /* harmony export */
        DOMStandardFontDataFactory: () => (
          /* binding */
          n
        ),
        /* harmony export */
        PDFDateString: () => (
          /* binding */
          D
        ),
        /* harmony export */
        PageViewport: () => (
          /* binding */
          p
        ),
        /* harmony export */
        PixelsPerInch: () => (
          /* binding */
          x
        ),
        /* harmony export */
        RenderingCancelledException: () => (
          /* binding */
          C
        ),
        /* harmony export */
        StatTimer: () => (
          /* binding */
          A
        ),
        /* harmony export */
        fetchData: () => (
          /* binding */
          g
        ),
        /* harmony export */
        getColorValues: () => (
          /* binding */
          V
        ),
        /* harmony export */
        getCurrentTransform: () => (
          /* binding */
          q
        ),
        /* harmony export */
        getCurrentTransformInverse: () => (
          /* binding */
          tt
        ),
        /* harmony export */
        getFilenameFromUrl: () => (
          /* binding */
          t
        ),
        /* harmony export */
        getPdfFilenameFromUrl: () => (
          /* binding */
          o
        ),
        /* harmony export */
        getRGB: () => (
          /* binding */
          X
        ),
        /* harmony export */
        getXfaPageViewport: () => (
          /* binding */
          H
        ),
        /* harmony export */
        isDataScheme: () => (
          /* binding */
          r
        ),
        /* harmony export */
        isPdfFile: () => (
          /* binding */
          w
        ),
        /* harmony export */
        isValidFetchUrl: () => (
          /* binding */
          b
        ),
        /* harmony export */
        noContextMenu: () => (
          /* binding */
          R
        ),
        /* harmony export */
        setLayerDimensions: () => (
          /* binding */
          rt
        )
        /* harmony export */
      });
      var e = i(583), y = i(292);
      const v = "http://www.w3.org/2000/svg";
      class x {
        static CSS = 96;
        static PDF = 72;
        static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
      }
      class m extends e.BaseFilterFactory {
        #t;
        #e;
        #s;
        #n;
        #r;
        #i = 0;
        constructor({
          docId: B,
          ownerDocument: U = globalThis.document
        } = {}) {
          super(), this.#s = B, this.#n = U;
        }
        get #a() {
          return this.#t ||= /* @__PURE__ */ new Map();
        }
        get #h() {
          return this.#r ||= /* @__PURE__ */ new Map();
        }
        get #l() {
          if (!this.#e) {
            const B = this.#n.createElement("div"), {
              style: U
            } = B;
            U.visibility = "hidden", U.contain = "strict", U.width = U.height = 0, U.position = "absolute", U.top = U.left = 0, U.zIndex = -1;
            const j = this.#n.createElementNS(v, "svg");
            j.setAttribute("width", 0), j.setAttribute("height", 0), this.#e = this.#n.createElementNS(v, "defs"), B.append(j), j.append(this.#e), this.#n.body.append(B);
          }
          return this.#e;
        }
        addFilter(B) {
          if (!B)
            return "none";
          let U = this.#a.get(B);
          if (U)
            return U;
          let j, Q, J, it;
          if (B.length === 1) {
            const lt = B[0], ct = new Array(256);
            for (let $ = 0; $ < 256; $++)
              ct[$] = lt[$] / 255;
            it = j = Q = J = ct.join(",");
          } else {
            const [lt, ct, $] = B, k = new Array(256), S = new Array(256), a = new Array(256);
            for (let c = 0; c < 256; c++)
              k[c] = lt[c] / 255, S[c] = ct[c] / 255, a[c] = $[c] / 255;
            j = k.join(","), Q = S.join(","), J = a.join(","), it = `${j}${Q}${J}`;
          }
          if (U = this.#a.get(it), U)
            return this.#a.set(B, U), U;
          const ht = `g_${this.#s}_transfer_map_${this.#i++}`, ot = `url(#${ht})`;
          this.#a.set(B, ot), this.#a.set(it, ot);
          const Z = this.#u(ht);
          return this.#o(j, Q, J, Z), ot;
        }
        addHCMFilter(B, U) {
          const j = `${B}-${U}`, Q = "base";
          let J = this.#h.get(Q);
          if (J?.key === j || (J ? (J.filter?.remove(), J.key = j, J.url = "none", J.filter = null) : (J = {
            key: j,
            url: "none",
            filter: null
          }, this.#h.set(Q, J)), !B || !U))
            return J.url;
          const it = this.#p(B);
          B = y.Util.makeHexColor(...it);
          const ht = this.#p(U);
          if (U = y.Util.makeHexColor(...ht), this.#l.style.color = "", B === "#000000" && U === "#ffffff" || B === U)
            return J.url;
          const ot = new Array(256);
          for (let k = 0; k <= 255; k++) {
            const S = k / 255;
            ot[k] = S <= 0.03928 ? S / 12.92 : ((S + 0.055) / 1.055) ** 2.4;
          }
          const Z = ot.join(","), lt = `g_${this.#s}_hcm_filter`, ct = J.filter = this.#u(lt);
          this.#o(Z, Z, Z, ct), this.#d(ct);
          const $ = (k, S) => {
            const a = it[k] / 255, c = ht[k] / 255, T = new Array(S + 1);
            for (let _ = 0; _ <= S; _++)
              T[_] = a + _ / S * (c - a);
            return T.join(",");
          };
          return this.#o($(0, 5), $(1, 5), $(2, 5), ct), J.url = `url(#${lt})`, J.url;
        }
        addHighlightHCMFilter(B, U, j, Q, J) {
          const it = `${U}-${j}-${Q}-${J}`;
          let ht = this.#h.get(B);
          if (ht?.key === it || (ht ? (ht.filter?.remove(), ht.key = it, ht.url = "none", ht.filter = null) : (ht = {
            key: it,
            url: "none",
            filter: null
          }, this.#h.set(B, ht)), !U || !j))
            return ht.url;
          const [ot, Z] = [U, j].map(this.#p.bind(this));
          let lt = Math.round(0.2126 * ot[0] + 0.7152 * ot[1] + 0.0722 * ot[2]), ct = Math.round(0.2126 * Z[0] + 0.7152 * Z[1] + 0.0722 * Z[2]), [$, k] = [Q, J].map(this.#p.bind(this));
          ct < lt && ([lt, ct, $, k] = [ct, lt, k, $]), this.#l.style.color = "";
          const S = (T, _, d) => {
            const E = new Array(256), F = (ct - lt) / d, P = T / 255, M = (_ - T) / (255 * d);
            let N = 0;
            for (let G = 0; G <= d; G++) {
              const z = Math.round(lt + G * F), O = P + G * M;
              for (let I = N; I <= z; I++)
                E[I] = O;
              N = z + 1;
            }
            for (let G = N; G < 256; G++)
              E[G] = E[N - 1];
            return E.join(",");
          }, a = `g_${this.#s}_hcm_${B}_filter`, c = ht.filter = this.#u(a);
          return this.#d(c), this.#o(S($[0], k[0], 5), S($[1], k[1], 5), S($[2], k[2], 5), c), ht.url = `url(#${a})`, ht.url;
        }
        destroy(B = !1) {
          B && this.#h.size !== 0 || (this.#e && (this.#e.parentNode.parentNode.remove(), this.#e = null), this.#t && (this.#t.clear(), this.#t = null), this.#i = 0);
        }
        #d(B) {
          const U = this.#n.createElementNS(v, "feColorMatrix");
          U.setAttribute("type", "matrix"), U.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"), B.append(U);
        }
        #u(B) {
          const U = this.#n.createElementNS(v, "filter");
          return U.setAttribute("color-interpolation-filters", "sRGB"), U.setAttribute("id", B), this.#l.append(U), U;
        }
        #c(B, U, j) {
          const Q = this.#n.createElementNS(v, U);
          Q.setAttribute("type", "discrete"), Q.setAttribute("tableValues", j), B.append(Q);
        }
        #o(B, U, j, Q) {
          const J = this.#n.createElementNS(v, "feComponentTransfer");
          Q.append(J), this.#c(J, "feFuncR", B), this.#c(J, "feFuncG", U), this.#c(J, "feFuncB", j);
        }
        #p(B) {
          return this.#l.style.color = B, X(getComputedStyle(this.#l).getPropertyValue("color"));
        }
      }
      class l extends e.BaseCanvasFactory {
        constructor({
          ownerDocument: B = globalThis.document
        } = {}) {
          super(), this._document = B;
        }
        _createCanvas(B, U) {
          const j = this._document.createElement("canvas");
          return j.width = B, j.height = U, j;
        }
      }
      async function g(Y, B = "text") {
        if (b(Y, document.baseURI)) {
          const U = await fetch(Y);
          if (!U.ok)
            throw new Error(U.statusText);
          switch (B) {
            case "arraybuffer":
              return U.arrayBuffer();
            case "blob":
              return U.blob();
            case "json":
              return U.json();
          }
          return U.text();
        }
        return new Promise((U, j) => {
          const Q = new XMLHttpRequest();
          Q.open("GET", Y, !0), Q.responseType = B, Q.onreadystatechange = () => {
            if (Q.readyState === XMLHttpRequest.DONE) {
              if (Q.status === 200 || Q.status === 0) {
                switch (B) {
                  case "arraybuffer":
                  case "blob":
                  case "json":
                    U(Q.response);
                    return;
                }
                U(Q.responseText);
                return;
              }
              j(new Error(Q.statusText));
            }
          }, Q.send(null);
        });
      }
      class h extends e.BaseCMapReaderFactory {
        _fetchData(B, U) {
          return g(B, this.isCompressed ? "arraybuffer" : "text").then((j) => ({
            cMapData: j instanceof ArrayBuffer ? new Uint8Array(j) : (0, y.stringToBytes)(j),
            compressionType: U
          }));
        }
      }
      class n extends e.BaseStandardFontDataFactory {
        _fetchData(B) {
          return g(B, "arraybuffer").then((U) => new Uint8Array(U));
        }
      }
      class f extends e.BaseSVGFactory {
        _createSVG(B) {
          return document.createElementNS(v, B);
        }
      }
      class p {
        constructor({
          viewBox: B,
          scale: U,
          rotation: j,
          offsetX: Q = 0,
          offsetY: J = 0,
          dontFlip: it = !1
        }) {
          this.viewBox = B, this.scale = U, this.rotation = j, this.offsetX = Q, this.offsetY = J;
          const ht = (B[2] + B[0]) / 2, ot = (B[3] + B[1]) / 2;
          let Z, lt, ct, $;
          switch (j %= 360, j < 0 && (j += 360), j) {
            case 180:
              Z = -1, lt = 0, ct = 0, $ = 1;
              break;
            case 90:
              Z = 0, lt = 1, ct = 1, $ = 0;
              break;
            case 270:
              Z = 0, lt = -1, ct = -1, $ = 0;
              break;
            case 0:
              Z = 1, lt = 0, ct = 0, $ = -1;
              break;
            default:
              throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
          }
          it && (ct = -ct, $ = -$);
          let k, S, a, c;
          Z === 0 ? (k = Math.abs(ot - B[1]) * U + Q, S = Math.abs(ht - B[0]) * U + J, a = (B[3] - B[1]) * U, c = (B[2] - B[0]) * U) : (k = Math.abs(ht - B[0]) * U + Q, S = Math.abs(ot - B[1]) * U + J, a = (B[2] - B[0]) * U, c = (B[3] - B[1]) * U), this.transform = [Z * U, lt * U, ct * U, $ * U, k - Z * U * ht - ct * U * ot, S - lt * U * ht - $ * U * ot], this.width = a, this.height = c;
        }
        get rawDims() {
          const {
            viewBox: B
          } = this;
          return (0, y.shadow)(this, "rawDims", {
            pageWidth: B[2] - B[0],
            pageHeight: B[3] - B[1],
            pageX: B[0],
            pageY: B[1]
          });
        }
        clone({
          scale: B = this.scale,
          rotation: U = this.rotation,
          offsetX: j = this.offsetX,
          offsetY: Q = this.offsetY,
          dontFlip: J = !1
        } = {}) {
          return new p({
            viewBox: this.viewBox.slice(),
            scale: B,
            rotation: U,
            offsetX: j,
            offsetY: Q,
            dontFlip: J
          });
        }
        convertToViewportPoint(B, U) {
          return y.Util.applyTransform([B, U], this.transform);
        }
        convertToViewportRectangle(B) {
          const U = y.Util.applyTransform([B[0], B[1]], this.transform), j = y.Util.applyTransform([B[2], B[3]], this.transform);
          return [U[0], U[1], j[0], j[1]];
        }
        convertToPdfPoint(B, U) {
          return y.Util.applyInverseTransform([B, U], this.transform);
        }
      }
      class C extends y.BaseException {
        constructor(B, U = 0) {
          super(B, "RenderingCancelledException"), this.extraDelay = U;
        }
      }
      function r(Y) {
        const B = Y.length;
        let U = 0;
        for (; U < B && Y[U].trim() === ""; )
          U++;
        return Y.substring(U, U + 5).toLowerCase() === "data:";
      }
      function w(Y) {
        return typeof Y == "string" && /\.pdf$/i.test(Y);
      }
      function t(Y, B = !1) {
        return B || ([Y] = Y.split(/[#?]/, 1)), Y.substring(Y.lastIndexOf("/") + 1);
      }
      function o(Y, B = "document.pdf") {
        if (typeof Y != "string")
          return B;
        if (r(Y))
          return (0, y.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), B;
        const U = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, j = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, Q = U.exec(Y);
        let J = j.exec(Q[1]) || j.exec(Q[2]) || j.exec(Q[3]);
        if (J && (J = J[0], J.includes("%")))
          try {
            J = j.exec(decodeURIComponent(J))[0];
          } catch {
          }
        return J || B;
      }
      class A {
        started = /* @__PURE__ */ Object.create(null);
        times = [];
        time(B) {
          B in this.started && (0, y.warn)(`Timer is already running for ${B}`), this.started[B] = Date.now();
        }
        timeEnd(B) {
          B in this.started || (0, y.warn)(`Timer has not been started for ${B}`), this.times.push({
            name: B,
            start: this.started[B],
            end: Date.now()
          }), delete this.started[B];
        }
        toString() {
          const B = [];
          let U = 0;
          for (const {
            name: j
          } of this.times)
            U = Math.max(j.length, U);
          for (const {
            name: j,
            start: Q,
            end: J
          } of this.times)
            B.push(`${j.padEnd(U)} ${J - Q}ms
`);
          return B.join("");
        }
      }
      function b(Y, B) {
        try {
          const {
            protocol: U
          } = B ? new URL(Y, B) : new URL(Y);
          return U === "http:" || U === "https:";
        } catch {
          return !1;
        }
      }
      function R(Y) {
        Y.preventDefault();
      }
      let L;
      class D {
        static toDateObject(B) {
          if (!B || typeof B != "string")
            return null;
          L ||= new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");
          const U = L.exec(B);
          if (!U)
            return null;
          const j = parseInt(U[1], 10);
          let Q = parseInt(U[2], 10);
          Q = Q >= 1 && Q <= 12 ? Q - 1 : 0;
          let J = parseInt(U[3], 10);
          J = J >= 1 && J <= 31 ? J : 1;
          let it = parseInt(U[4], 10);
          it = it >= 0 && it <= 23 ? it : 0;
          let ht = parseInt(U[5], 10);
          ht = ht >= 0 && ht <= 59 ? ht : 0;
          let ot = parseInt(U[6], 10);
          ot = ot >= 0 && ot <= 59 ? ot : 0;
          const Z = U[7] || "Z";
          let lt = parseInt(U[8], 10);
          lt = lt >= 0 && lt <= 23 ? lt : 0;
          let ct = parseInt(U[9], 10) || 0;
          return ct = ct >= 0 && ct <= 59 ? ct : 0, Z === "-" ? (it += lt, ht += ct) : Z === "+" && (it -= lt, ht -= ct), new Date(Date.UTC(j, Q, J, it, ht, ot));
        }
      }
      function H(Y, {
        scale: B = 1,
        rotation: U = 0
      }) {
        const {
          width: j,
          height: Q
        } = Y.attributes.style, J = [0, 0, parseInt(j), parseInt(Q)];
        return new p({
          viewBox: J,
          scale: B,
          rotation: U
        });
      }
      function X(Y) {
        if (Y.startsWith("#")) {
          const B = parseInt(Y.slice(1), 16);
          return [(B & 16711680) >> 16, (B & 65280) >> 8, B & 255];
        }
        return Y.startsWith("rgb(") ? Y.slice(4, -1).split(",").map((B) => parseInt(B)) : Y.startsWith("rgba(") ? Y.slice(5, -1).split(",").map((B) => parseInt(B)).slice(0, 3) : ((0, y.warn)(`Not a valid color format: "${Y}"`), [0, 0, 0]);
      }
      function V(Y) {
        const B = document.createElement("span");
        B.style.visibility = "hidden", document.body.append(B);
        for (const U of Y.keys()) {
          B.style.color = U;
          const j = window.getComputedStyle(B).color;
          Y.set(U, X(j));
        }
        B.remove();
      }
      function q(Y) {
        const {
          a: B,
          b: U,
          c: j,
          d: Q,
          e: J,
          f: it
        } = Y.getTransform();
        return [B, U, j, Q, J, it];
      }
      function tt(Y) {
        const {
          a: B,
          b: U,
          c: j,
          d: Q,
          e: J,
          f: it
        } = Y.getTransform().invertSelf();
        return [B, U, j, Q, J, it];
      }
      function rt(Y, B, U = !1, j = !0) {
        if (B instanceof p) {
          const {
            pageWidth: Q,
            pageHeight: J
          } = B.rawDims, {
            style: it
          } = Y, ht = y.FeatureTest.isCSSRoundSupported, ot = `var(--scale-factor) * ${Q}px`, Z = `var(--scale-factor) * ${J}px`, lt = ht ? `round(${ot}, 1px)` : `calc(${ot})`, ct = ht ? `round(${Z}, 1px)` : `calc(${Z})`;
          !U || B.rotation % 180 === 0 ? (it.width = lt, it.height = ct) : (it.width = ct, it.height = lt);
        }
        j && Y.setAttribute("data-main-rotation", B.rotation);
      }
    }
  ),
  /***/
  47: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        DrawLayer: () => (
          /* binding */
          v
        )
        /* harmony export */
      });
      var e = i(419), y = i(292);
      class v {
        #t = null;
        #e = 0;
        #s = /* @__PURE__ */ new Map();
        #n = /* @__PURE__ */ new Map();
        constructor({
          pageIndex: m
        }) {
          this.pageIndex = m;
        }
        setParent(m) {
          if (!this.#t) {
            this.#t = m;
            return;
          }
          if (this.#t !== m) {
            if (this.#s.size > 0)
              for (const l of this.#s.values())
                l.remove(), m.append(l);
            this.#t = m;
          }
        }
        static get _svgFactory() {
          return (0, y.shadow)(this, "_svgFactory", new e.DOMSVGFactory());
        }
        static #r(m, {
          x: l = 0,
          y: g = 0,
          width: h = 1,
          height: n = 1
        } = {}) {
          const {
            style: f
          } = m;
          f.top = `${100 * g}%`, f.left = `${100 * l}%`, f.width = `${100 * h}%`, f.height = `${100 * n}%`;
        }
        #i(m) {
          const l = v._svgFactory.create(1, 1, !0);
          return this.#t.append(l), l.setAttribute("aria-hidden", !0), v.#r(l, m), l;
        }
        #a(m, l) {
          const g = v._svgFactory.createElement("clipPath");
          m.append(g);
          const h = `clip_${l}`;
          g.setAttribute("id", h), g.setAttribute("clipPathUnits", "objectBoundingBox");
          const n = v._svgFactory.createElement("use");
          return g.append(n), n.setAttribute("href", `#${l}`), n.classList.add("clip"), h;
        }
        highlight(m, l, g, h = !1) {
          const n = this.#e++, f = this.#i(m.box);
          f.classList.add("highlight"), m.free && f.classList.add("free");
          const p = v._svgFactory.createElement("defs");
          f.append(p);
          const C = v._svgFactory.createElement("path");
          p.append(C);
          const r = `path_p${this.pageIndex}_${n}`;
          C.setAttribute("id", r), C.setAttribute("d", m.toSVGPath()), h && this.#n.set(n, C);
          const w = this.#a(p, r), t = v._svgFactory.createElement("use");
          return f.append(t), f.setAttribute("fill", l), f.setAttribute("fill-opacity", g), t.setAttribute("href", `#${r}`), this.#s.set(n, f), {
            id: n,
            clipPathId: `url(#${w})`
          };
        }
        highlightOutline(m) {
          const l = this.#e++, g = this.#i(m.box);
          g.classList.add("highlightOutline");
          const h = v._svgFactory.createElement("defs");
          g.append(h);
          const n = v._svgFactory.createElement("path");
          h.append(n);
          const f = `path_p${this.pageIndex}_${l}`;
          n.setAttribute("id", f), n.setAttribute("d", m.toSVGPath()), n.setAttribute("vector-effect", "non-scaling-stroke");
          let p;
          if (m.free) {
            g.classList.add("free");
            const w = v._svgFactory.createElement("mask");
            h.append(w), p = `mask_p${this.pageIndex}_${l}`, w.setAttribute("id", p), w.setAttribute("maskUnits", "objectBoundingBox");
            const t = v._svgFactory.createElement("rect");
            w.append(t), t.setAttribute("width", "1"), t.setAttribute("height", "1"), t.setAttribute("fill", "white");
            const o = v._svgFactory.createElement("use");
            w.append(o), o.setAttribute("href", `#${f}`), o.setAttribute("stroke", "none"), o.setAttribute("fill", "black"), o.setAttribute("fill-rule", "nonzero"), o.classList.add("mask");
          }
          const C = v._svgFactory.createElement("use");
          g.append(C), C.setAttribute("href", `#${f}`), p && C.setAttribute("mask", `url(#${p})`);
          const r = C.cloneNode();
          return g.append(r), C.classList.add("mainOutline"), r.classList.add("secondaryOutline"), this.#s.set(l, g), l;
        }
        finalizeLine(m, l) {
          const g = this.#n.get(m);
          this.#n.delete(m), this.updateBox(m, l.box), g.setAttribute("d", l.toSVGPath());
        }
        updateLine(m, l) {
          this.#s.get(m).firstChild.firstChild.setAttribute("d", l.toSVGPath());
        }
        removeFreeHighlight(m) {
          this.remove(m), this.#n.delete(m);
        }
        updatePath(m, l) {
          this.#n.get(m).setAttribute("d", l.toSVGPath());
        }
        updateBox(m, l) {
          v.#r(this.#s.get(m), l);
        }
        show(m, l) {
          this.#s.get(m).classList.toggle("hidden", !l);
        }
        rotate(m, l) {
          this.#s.get(m).setAttribute("data-main-rotation", l);
        }
        changeColor(m, l) {
          this.#s.get(m).setAttribute("fill", l);
        }
        changeOpacity(m, l) {
          this.#s.get(m).setAttribute("fill-opacity", l);
        }
        addClass(m, l) {
          this.#s.get(m).classList.add(l);
        }
        removeClass(m, l) {
          this.#s.get(m).classList.remove(l);
        }
        remove(m) {
          this.#t !== null && (this.#s.get(m).remove(), this.#s.delete(m));
        }
        destroy() {
          this.#t = null;
          for (const m of this.#s.values())
            m.remove();
          this.#s.clear();
        }
      }
    }
  ),
  /***/
  731: (
    /***/
    (u, s, i) => {
      i.d(s, {
        AnnotationEditorLayer: () => (
          /* binding */
          r
        )
      });
      var e = i(292), y = i(310), v = i(830), x = i(976);
      const m = /\r\n?|\n/g;
      class l extends y.AnnotationEditor {
        #t = this.editorDivBlur.bind(this);
        #e = this.editorDivFocus.bind(this);
        #s = this.editorDivInput.bind(this);
        #n = this.editorDivKeydown.bind(this);
        #r = this.editorDivPaste.bind(this);
        #i;
        #a = "";
        #h = `${this.id}-editor`;
        #l;
        #d = null;
        static _freeTextDefaultContent = "";
        static _internalPadding = 0;
        static _defaultColor = null;
        static _defaultFontSize = 10;
        static get _keyboardManager() {
          const t = l.prototype, o = (R) => R.isEmpty(), A = v.AnnotationEditorUIManager.TRANSLATE_SMALL, b = v.AnnotationEditorUIManager.TRANSLATE_BIG;
          return (0, e.shadow)(this, "_keyboardManager", new v.KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], t.commitOrRemove, {
            bubbles: !0
          }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], t.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], t._translateEmpty, {
            args: [-A, 0],
            checker: o
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t._translateEmpty, {
            args: [-b, 0],
            checker: o
          }], [["ArrowRight", "mac+ArrowRight"], t._translateEmpty, {
            args: [A, 0],
            checker: o
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], t._translateEmpty, {
            args: [b, 0],
            checker: o
          }], [["ArrowUp", "mac+ArrowUp"], t._translateEmpty, {
            args: [0, -A],
            checker: o
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], t._translateEmpty, {
            args: [0, -b],
            checker: o
          }], [["ArrowDown", "mac+ArrowDown"], t._translateEmpty, {
            args: [0, A],
            checker: o
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], t._translateEmpty, {
            args: [0, b],
            checker: o
          }]]));
        }
        static _type = "freetext";
        static _editorType = e.AnnotationEditorType.FREETEXT;
        constructor(t) {
          super({
            ...t,
            name: "freeTextEditor"
          }), this.#i = t.color || l._defaultColor || y.AnnotationEditor._defaultLineColor, this.#l = t.fontSize || l._defaultFontSize;
        }
        static initialize(t, o) {
          y.AnnotationEditor.initialize(t, o, {
            strings: ["pdfjs-free-text-default-content"]
          });
          const A = getComputedStyle(document.documentElement);
          this._internalPadding = parseFloat(A.getPropertyValue("--freetext-padding"));
        }
        static updateDefaultParams(t, o) {
          switch (t) {
            case e.AnnotationEditorParamsType.FREETEXT_SIZE:
              l._defaultFontSize = o;
              break;
            case e.AnnotationEditorParamsType.FREETEXT_COLOR:
              l._defaultColor = o;
              break;
          }
        }
        updateParams(t, o) {
          switch (t) {
            case e.AnnotationEditorParamsType.FREETEXT_SIZE:
              this.#u(o);
              break;
            case e.AnnotationEditorParamsType.FREETEXT_COLOR:
              this.#c(o);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[e.AnnotationEditorParamsType.FREETEXT_SIZE, l._defaultFontSize], [e.AnnotationEditorParamsType.FREETEXT_COLOR, l._defaultColor || y.AnnotationEditor._defaultLineColor]];
        }
        get propertiesToUpdate() {
          return [[e.AnnotationEditorParamsType.FREETEXT_SIZE, this.#l], [e.AnnotationEditorParamsType.FREETEXT_COLOR, this.#i]];
        }
        #u(t) {
          const o = (b) => {
            this.editorDiv.style.fontSize = `calc(${b}px * var(--scale-factor))`, this.translate(0, -(b - this.#l) * this.parentScale), this.#l = b, this.#p();
          }, A = this.#l;
          this.addCommands({
            cmd: o.bind(this, t),
            undo: o.bind(this, A),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: e.AnnotationEditorParamsType.FREETEXT_SIZE,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #c(t) {
          const o = (b) => {
            this.#i = this.editorDiv.style.color = b;
          }, A = this.#i;
          this.addCommands({
            cmd: o.bind(this, t),
            undo: o.bind(this, A),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: e.AnnotationEditorParamsType.FREETEXT_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        _translateEmpty(t, o) {
          this._uiManager.translateSelectedEditors(t, o, !0);
        }
        getInitialTranslation() {
          const t = this.parentScale;
          return [-l._internalPadding * t, -(l._internalPadding + this.#l) * t];
        }
        rebuild() {
          this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
        }
        enableEditMode() {
          this.isInEditMode() || (this.parent.setEditingState(!1), this.parent.updateToolbar(e.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", this.#n), this.editorDiv.addEventListener("focus", this.#e), this.editorDiv.addEventListener("blur", this.#t), this.editorDiv.addEventListener("input", this.#s), this.editorDiv.addEventListener("paste", this.#r));
        }
        disableEditMode() {
          this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", this.#h), this._isDraggable = !0, this.editorDiv.removeEventListener("keydown", this.#n), this.editorDiv.removeEventListener("focus", this.#e), this.editorDiv.removeEventListener("blur", this.#t), this.editorDiv.removeEventListener("input", this.#s), this.editorDiv.removeEventListener("paste", this.#r), this.div.focus({
            preventScroll: !0
          }), this.isEditing = !1, this.parent.div.classList.add("freetextEditing"));
        }
        focusin(t) {
          this._focusEventsAllowed && (super.focusin(t), t.target !== this.editorDiv && this.editorDiv.focus());
        }
        onceAdded() {
          this.width || (this.enableEditMode(), this.editorDiv.focus(), this._initialOptions?.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();
        }
        #o() {
          const t = [];
          this.editorDiv.normalize();
          for (const o of this.editorDiv.childNodes)
            t.push(l.#g(o));
          return t.join(`
`);
        }
        #p() {
          const [t, o] = this.parentDimensions;
          let A;
          if (this.isAttachedToDOM)
            A = this.div.getBoundingClientRect();
          else {
            const {
              currentLayer: b,
              div: R
            } = this, L = R.style.display, D = R.classList.contains("hidden");
            R.classList.remove("hidden"), R.style.display = "hidden", b.div.append(this.div), A = R.getBoundingClientRect(), R.remove(), R.style.display = L, R.classList.toggle("hidden", D);
          }
          this.rotation % 180 === this.parentRotation % 180 ? (this.width = A.width / t, this.height = A.height / o) : (this.width = A.height / t, this.height = A.width / o), this.fixAndSetPosition();
        }
        commit() {
          if (!this.isInEditMode())
            return;
          super.commit(), this.disableEditMode();
          const t = this.#a, o = this.#a = this.#o().trimEnd();
          if (t === o)
            return;
          const A = (b) => {
            if (this.#a = b, !b) {
              this.remove();
              return;
            }
            this.#f(), this._uiManager.rebuild(this), this.#p();
          };
          this.addCommands({
            cmd: () => {
              A(o);
            },
            undo: () => {
              A(t);
            },
            mustExec: !1
          }), this.#p();
        }
        shouldGetKeyboardEvents() {
          return this.isInEditMode();
        }
        enterInEditMode() {
          this.enableEditMode(), this.editorDiv.focus();
        }
        dblclick(t) {
          this.enterInEditMode();
        }
        keydown(t) {
          t.target === this.div && t.key === "Enter" && (this.enterInEditMode(), t.preventDefault());
        }
        editorDivKeydown(t) {
          l._keyboardManager.exec(this, t);
        }
        editorDivFocus(t) {
          this.isEditing = !0;
        }
        editorDivBlur(t) {
          this.isEditing = !1;
        }
        editorDivInput(t) {
          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 t, o;
          this.width && (t = this.x, o = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", this.#h), this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text"), this.enableEditing(), y.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then((b) => this.editorDiv?.setAttribute("default-content", b)), this.editorDiv.contentEditable = !0;
          const {
            style: A
          } = this.editorDiv;
          if (A.fontSize = `calc(${this.#l}px * var(--scale-factor))`, A.color = this.#i, this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), (0, v.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
            const [b, R] = this.parentDimensions;
            if (this.annotationElementId) {
              const {
                position: L
              } = this.#d;
              let [D, H] = this.getInitialTranslation();
              [D, H] = this.pageTranslationToScreen(D, H);
              const [X, V] = this.pageDimensions, [q, tt] = this.pageTranslation;
              let rt, Y;
              switch (this.rotation) {
                case 0:
                  rt = t + (L[0] - q) / X, Y = o + this.height - (L[1] - tt) / V;
                  break;
                case 90:
                  rt = t + (L[0] - q) / X, Y = o - (L[1] - tt) / V, [D, H] = [H, -D];
                  break;
                case 180:
                  rt = t - this.width + (L[0] - q) / X, Y = o - (L[1] - tt) / V, [D, H] = [-D, -H];
                  break;
                case 270:
                  rt = t + (L[0] - q - this.height * V) / X, Y = o + (L[1] - tt - this.width * X) / V, [D, H] = [-H, D];
                  break;
              }
              this.setAt(rt * b, Y * R, D, H);
            } else
              this.setAt(t * b, o * R, this.width * b, this.height * R);
            this.#f(), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
          } else
            this._isDraggable = !1, this.editorDiv.contentEditable = !0;
          return this.div;
        }
        static #g(t) {
          return (t.nodeType === Node.TEXT_NODE ? t.nodeValue : t.innerText).replaceAll(m, "");
        }
        editorDivPaste(t) {
          const o = t.clipboardData || window.clipboardData, {
            types: A
          } = o;
          if (A.length === 1 && A[0] === "text/plain")
            return;
          t.preventDefault();
          const b = l.#m(o.getData("text") || "").replaceAll(m, `
`);
          if (!b)
            return;
          const R = window.getSelection();
          if (!R.rangeCount)
            return;
          this.editorDiv.normalize(), R.deleteFromDocument();
          const L = R.getRangeAt(0);
          if (!b.includes(`
`)) {
            L.insertNode(document.createTextNode(b)), this.editorDiv.normalize(), R.collapseToStart();
            return;
          }
          const {
            startContainer: D,
            startOffset: H
          } = L, X = [], V = [];
          if (D.nodeType === Node.TEXT_NODE) {
            const rt = D.parentElement;
            if (V.push(D.nodeValue.slice(H).replaceAll(m, "")), rt !== this.editorDiv) {
              let Y = X;
              for (const B of this.editorDiv.childNodes) {
                if (B === rt) {
                  Y = V;
                  continue;
                }
                Y.push(l.#g(B));
              }
            }
            X.push(D.nodeValue.slice(0, H).replaceAll(m, ""));
          } else if (D === this.editorDiv) {
            let rt = X, Y = 0;
            for (const B of this.editorDiv.childNodes)
              Y++ === H && (rt = V), rt.push(l.#g(B));
          }
          this.#a = `${X.join(`
`)}${b}${V.join(`
`)}`, this.#f();
          const q = new Range();
          let tt = X.reduce((rt, Y) => rt + Y.length, 0);
          for (const {
            firstChild: rt
          } of this.editorDiv.childNodes)
            if (rt.nodeType === Node.TEXT_NODE) {
              const Y = rt.nodeValue.length;
              if (tt <= Y) {
                q.setStart(rt, tt), q.setEnd(rt, tt);
                break;
              }
              tt -= Y;
            }
          R.removeAllRanges(), R.addRange(q);
        }
        #f() {
          if (this.editorDiv.replaceChildren(), !!this.#a)
            for (const t of this.#a.split(`
`)) {
              const o = document.createElement("div");
              o.append(t ? document.createTextNode(t) : document.createElement("br")), this.editorDiv.append(o);
            }
        }
        #v() {
          return this.#a.replaceAll(" ", " ");
        }
        static #m(t) {
          return t.replaceAll(" ", " ");
        }
        get contentDiv() {
          return this.editorDiv;
        }
        static deserialize(t, o, A) {
          let b = null;
          if (t instanceof x.FreeTextAnnotationElement) {
            const {
              data: {
                defaultAppearanceData: {
                  fontSize: L,
                  fontColor: D
                },
                rect: H,
                rotation: X,
                id: V
              },
              textContent: q,
              textPosition: tt,
              parent: {
                page: {
                  pageNumber: rt
                }
              }
            } = t;
            if (!q || q.length === 0)
              return null;
            b = t = {
              annotationType: e.AnnotationEditorType.FREETEXT,
              color: Array.from(D),
              fontSize: L,
              value: q.join(`
`),
              position: tt,
              pageIndex: rt - 1,
              rect: H.slice(0),
              rotation: X,
              id: V,
              deleted: !1
            };
          }
          const R = super.deserialize(t, o, A);
          return R.#l = t.fontSize, R.#i = e.Util.makeHexColor(...t.color), R.#a = l.#m(t.value), R.annotationElementId = t.id || null, R.#d = b, R;
        }
        serialize(t = !1) {
          if (this.isEmpty())
            return null;
          if (this.deleted)
            return {
              pageIndex: this.pageIndex,
              id: this.annotationElementId,
              deleted: !0
            };
          const o = l._internalPadding * this.parentScale, A = this.getRect(o, o), b = y.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#i), R = {
            annotationType: e.AnnotationEditorType.FREETEXT,
            color: b,
            fontSize: this.#l,
            value: this.#v(),
            pageIndex: this.pageIndex,
            rect: A,
            rotation: this.rotation,
            structTreeParentId: this._structTreeParentId
          };
          return t ? R : this.annotationElementId && !this.#A(R) ? null : (R.id = this.annotationElementId, R);
        }
        #A(t) {
          const {
            value: o,
            fontSize: A,
            color: b,
            pageIndex: R
          } = this.#d;
          return this._hasBeenMoved || t.value !== o || t.fontSize !== A || t.color.some((L, D) => L !== b[D]) || t.pageIndex !== R;
        }
        renderAnnotationElement(t) {
          const o = super.renderAnnotationElement(t);
          if (this.deleted)
            return o;
          const {
            style: A
          } = o;
          A.fontSize = `calc(${this.#l}px * var(--scale-factor))`, A.color = this.#i, o.replaceChildren();
          for (const R of this.#a.split(`
`)) {
            const L = document.createElement("div");
            L.append(R ? document.createTextNode(R) : document.createElement("br")), o.append(L);
          }
          const b = l._internalPadding * this.parentScale;
          return t.updateEdited({
            rect: this.getRect(b, b)
          }), o;
        }
        resetAnnotationElement(t) {
          super.resetAnnotationElement(t), t.resetEdited();
        }
      }
      var g = i(61), h = i(259), n = i(419);
      class f extends y.AnnotationEditor {
        #t = null;
        #e = 0;
        #s;
        #n = null;
        #r = null;
        #i = null;
        #a = null;
        #h = 0;
        #l = null;
        #d = null;
        #u = null;
        #c = !1;
        #o = this.#_.bind(this);
        #p = null;
        #g;
        #f = null;
        #v = "";
        #m;
        #A = "";
        static _defaultColor = null;
        static _defaultOpacity = 1;
        static _defaultThickness = 12;
        static _l10nPromise;
        static _type = "highlight";
        static _editorType = e.AnnotationEditorType.HIGHLIGHT;
        static _freeHighlightId = -1;
        static _freeHighlight = null;
        static _freeHighlightClipId = "";
        static get _keyboardManager() {
          const t = f.prototype;
          return (0, e.shadow)(this, "_keyboardManager", new v.KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], t._moveCaret, {
            args: [0]
          }], [["ArrowRight", "mac+ArrowRight"], t._moveCaret, {
            args: [1]
          }], [["ArrowUp", "mac+ArrowUp"], t._moveCaret, {
            args: [2]
          }], [["ArrowDown", "mac+ArrowDown"], t._moveCaret, {
            args: [3]
          }]]));
        }
        constructor(t) {
          super({
            ...t,
            name: "highlightEditor"
          }), this.color = t.color || f._defaultColor, this.#m = t.thickness || f._defaultThickness, this.#g = t.opacity || f._defaultOpacity, this.#s = t.boxes || null, this.#A = t.methodOfCreation || "", this.#v = t.text || "", this._isDraggable = !1, t.highlightId > -1 ? (this.#c = !0, this.#T(t), this.#b()) : (this.#t = t.anchorNode, this.#e = t.anchorOffset, this.#a = t.focusNode, this.#h = t.focusOffset, this.#w(), this.#b(), this.rotate(this.rotation));
        }
        get telemetryInitialData() {
          return {
            action: "added",
            type: this.#c ? "free_highlight" : "highlight",
            color: this._uiManager.highlightColorNames.get(this.color),
            thickness: this.#m,
            methodOfCreation: this.#A
          };
        }
        get telemetryFinalData() {
          return {
            type: "highlight",
            color: this._uiManager.highlightColorNames.get(this.color)
          };
        }
        static computeTelemetryFinalData(t) {
          return {
            numberOfColors: t.get("color").size
          };
        }
        #w() {
          const t = new g.Outliner(this.#s, 1e-3);
          this.#d = t.getOutlines(), {
            x: this.x,
            y: this.y,
            width: this.width,
            height: this.height
          } = this.#d.box;
          const o = new g.Outliner(this.#s, 25e-4, 1e-3, this._uiManager.direction === "ltr");
          this.#i = o.getOutlines();
          const {
            lastPoint: A
          } = this.#i.box;
          this.#p = [(A[0] - this.x) / this.width, (A[1] - this.y) / this.height];
        }
        #T({
          highlightOutlines: t,
          highlightId: o,
          clipPathId: A
        }) {
          this.#d = t;
          const b = 1.5;
          if (this.#i = t.getNewOutline(this.#m / 2 + b, 25e-4), o >= 0)
            this.#u = o, this.#n = A, this.parent.drawLayer.finalizeLine(o, t), this.#f = this.parent.drawLayer.highlightOutline(this.#i);
          else if (this.parent) {
            const V = this.parent.viewport.rotation;
            this.parent.drawLayer.updateLine(this.#u, t), this.parent.drawLayer.updateBox(this.#u, f.#S(this.#d.box, (V - this.rotation + 360) % 360)), this.parent.drawLayer.updateLine(this.#f, this.#i), this.parent.drawLayer.updateBox(this.#f, f.#S(this.#i.box, V));
          }
          const {
            x: R,
            y: L,
            width: D,
            height: H
          } = t.box;
          switch (this.rotation) {
            case 0:
              this.x = R, this.y = L, this.width = D, this.height = H;
              break;
            case 90: {
              const [V, q] = this.parentDimensions;
              this.x = L, this.y = 1 - R, this.width = D * q / V, this.height = H * V / q;
              break;
            }
            case 180:
              this.x = 1 - R, this.y = 1 - L, this.width = D, this.height = H;
              break;
            case 270: {
              const [V, q] = this.parentDimensions;
              this.x = 1 - L, this.y = R, this.width = D * q / V, this.height = H * V / q;
              break;
            }
          }
          const {
            lastPoint: X
          } = this.#i.box;
          this.#p = [(X[0] - R) / D, (X[1] - L) / H];
        }
        static initialize(t, o) {
          y.AnnotationEditor.initialize(t, o), f._defaultColor ||= o.highlightColors?.values().next().value || "#fff066";
        }
        static updateDefaultParams(t, o) {
          switch (t) {
            case e.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:
              f._defaultColor = o;
              break;
            case e.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
              f._defaultThickness = o;
              break;
          }
        }
        translateInPage(t, o) {
        }
        get toolbarPosition() {
          return this.#p;
        }
        updateParams(t, o) {
          switch (t) {
            case e.AnnotationEditorParamsType.HIGHLIGHT_COLOR:
              this.#k(o);
              break;
            case e.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
              this.#M(o);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[e.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR, f._defaultColor], [e.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, f._defaultThickness]];
        }
        get propertiesToUpdate() {
          return [[e.AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.color || f._defaultColor], [e.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, this.#m || f._defaultThickness], [e.AnnotationEditorParamsType.HIGHLIGHT_FREE, this.#c]];
        }
        #k(t) {
          const o = (b) => {
            this.color = b, this.parent?.drawLayer.changeColor(this.#u, b), this.#r?.updateColor(b);
          }, A = this.color;
          this.addCommands({
            cmd: o.bind(this, t),
            undo: o.bind(this, A),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: e.AnnotationEditorParamsType.HIGHLIGHT_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          }), this._reportTelemetry({
            action: "color_changed",
            color: this._uiManager.highlightColorNames.get(t)
          }, !0);
        }
        #M(t) {
          const o = this.#m, A = (b) => {
            this.#m = b, this.#L(b);
          };
          this.addCommands({
            cmd: A.bind(this, t),
            undo: A.bind(this, o),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: e.AnnotationEditorParamsType.INK_THICKNESS,
            overwriteIfSameType: !0,
            keepUndo: !0
          }), this._reportTelemetry({
            action: "thickness_changed",
            thickness: t
          }, !0);
        }
        async addEditToolbar() {
          const t = await super.addEditToolbar();
          return t ? (this._uiManager.highlightColors && (this.#r = new h.ColorPicker({
            editor: this
          }), t.addColorPicker(this.#r)), t) : null;
        }
        disableEditing() {
          super.disableEditing(), this.div.classList.toggle("disabled", !0);
        }
        enableEditing() {
          super.enableEditing(), this.div.classList.toggle("disabled", !1);
        }
        fixAndSetPosition() {
          return super.fixAndSetPosition(this.#C());
        }
        getBaseTranslation() {
          return [0, 0];
        }
        getRect(t, o) {
          return super.getRect(t, o, this.#C());
        }
        onceAdded() {
          this.parent.addUndoableEditor(this), this.div.focus();
        }
        remove() {
          this.#y(), this._reportTelemetry({
            action: "deleted"
          }), super.remove();
        }
        rebuild() {
          this.parent && (super.rebuild(), this.div !== null && (this.#b(), this.isAttachedToDOM || this.parent.add(this)));
        }
        setParent(t) {
          let o = !1;
          this.parent && !t ? this.#y() : t && (this.#b(t), o = !this.parent && this.div?.classList.contains("selectedEditor")), super.setParent(t), this.show(this._isVisible), o && this.select();
        }
        #L(t) {
          if (!this.#c)
            return;
          this.#T({
            highlightOutlines: this.#d.getNewOutline(t / 2)
          }), this.fixAndSetPosition();
          const [o, A] = this.parentDimensions;
          this.setDims(this.width * o, this.height * A);
        }
        #y() {
          this.#u === null || !this.parent || (this.parent.drawLayer.remove(this.#u), this.#u = null, this.parent.drawLayer.remove(this.#f), this.#f = null);
        }
        #b(t = this.parent) {
          this.#u === null && ({
            id: this.#u,
            clipPathId: this.#n
          } = t.drawLayer.highlight(this.#d, this.color, this.#g), this.#f = t.drawLayer.highlightOutline(this.#i), this.#l && (this.#l.style.clipPath = this.#n));
        }
        static #S({
          x: t,
          y: o,
          width: A,
          height: b
        }, R) {
          switch (R) {
            case 90:
              return {
                x: 1 - o - b,
                y: t,
                width: b,
                height: A
              };
            case 180:
              return {
                x: 1 - t - A,
                y: 1 - o - b,
                width: A,
                height: b
              };
            case 270:
              return {
                x: o,
                y: 1 - t - A,
                width: b,
                height: A
              };
          }
          return {
            x: t,
            y: o,
            width: A,
            height: b
          };
        }
        rotate(t) {
          const {
            drawLayer: o
          } = this.parent;
          let A;
          this.#c ? (t = (t - this.rotation + 360) % 360, A = f.#S(this.#d.box, t)) : A = f.#S(this, t), o.rotate(this.#u, t), o.rotate(this.#f, t), o.updateBox(this.#u, A), o.updateBox(this.#f, f.#S(this.#i.box, t));
        }
        render() {
          if (this.div)
            return this.div;
          const t = super.render();
          this.#v && (t.setAttribute("aria-label", this.#v), t.setAttribute("role", "mark")), this.#c ? t.classList.add("free") : this.div.addEventListener("keydown", this.#o);
          const o = this.#l = document.createElement("div");
          t.append(o), o.setAttribute("aria-hidden", "true"), o.className = "internal", o.style.clipPath = this.#n;
          const [A, b] = this.parentDimensions;
          return this.setDims(this.width * A, this.height * b), (0, v.bindEvents)(this, this.#l, ["pointerover", "pointerleave"]), this.enableEditing(), t;
        }
        pointerover() {
          this.parent.drawLayer.addClass(this.#f, "hovered");
        }
        pointerleave() {
          this.parent.drawLayer.removeClass(this.#f, "hovered");
        }
        #_(t) {
          f._keyboardManager.exec(this, t);
        }
        _moveCaret(t) {
          switch (this.parent.unselect(this), t) {
            case 0:
            case 2:
              this.#x(!0);
              break;
            case 1:
            case 3:
              this.#x(!1);
              break;
          }
        }
        #x(t) {
          if (!this.#t)
            return;
          const o = window.getSelection();
          t ? o.setPosition(this.#t, this.#e) : o.setPosition(this.#a, this.#h);
        }
        select() {
          super.select(), this.#f && (this.parent?.drawLayer.removeClass(this.#f, "hovered"), this.parent?.drawLayer.addClass(this.#f, "selected"));
        }
        unselect() {
          super.unselect(), this.#f && (this.parent?.drawLayer.removeClass(this.#f, "selected"), this.#c || this.#x(!1));
        }
        get _mustFixPosition() {
          return !this.#c;
        }
        show(t = this._isVisible) {
          super.show(t), this.parent && (this.parent.drawLayer.show(this.#u, t), this.parent.drawLayer.show(this.#f, t));
        }
        #C() {
          return this.#c ? this.rotation : 0;
        }
        #P() {
          if (this.#c)
            return null;
          const [t, o] = this.pageDimensions, A = this.#s, b = new Array(A.length * 8);
          let R = 0;
          for (const {
            x: L,
            y: D,
            width: H,
            height: X
          } of A) {
            const V = L * t, q = (1 - D - X) * o;
            b[R] = b[R + 4] = V, b[R + 1] = b[R + 3] = q, b[R + 2] = b[R + 6] = V + H * t, b[R + 5] = b[R + 7] = q + X * o, R += 8;
          }
          return b;
        }
        #R(t) {
          return this.#d.serialize(t, this.#C());
        }
        static startHighlighting(t, o, {
          target: A,
          x: b,
          y: R
        }) {
          const {
            x: L,
            y: D,
            width: H,
            height: X
          } = A.getBoundingClientRect(), V = (Y) => {
            this.#I(t, Y);
          }, q = {
            capture: !0,
            passive: !1
          }, tt = (Y) => {
            Y.preventDefault(), Y.stopPropagation();
          }, rt = (Y) => {
            A.removeEventListener("pointermove", V), window.removeEventListener("blur", rt), window.removeEventListener("pointerup", rt), window.removeEventListener("pointerdown", tt, q), window.removeEventListener("contextmenu", n.noContextMenu), this.#F(t, Y);
          };
          window.addEventListener("blur", rt), window.addEventListener("pointerup", rt), window.addEventListener("pointerdown", tt, q), window.addEventListener("contextmenu", n.noContextMenu), A.addEventListener("pointermove", V), this._freeHighlight = new g.FreeOutliner({
            x: b,
            y: R
          }, [L, D, H, X], t.scale, this._defaultThickness / 2, o, 1e-3), {
            id: this._freeHighlightId,
            clipPathId: this._freeHighlightClipId
          } = t.drawLayer.highlight(this._freeHighlight, this._defaultColor, this._defaultOpacity, !0);
        }
        static #I(t, o) {
          this._freeHighlight.add(o) && t.drawLayer.updatePath(this._freeHighlightId, this._freeHighlight);
        }
        static #F(t, o) {
          this._freeHighlight.isEmpty() ? t.drawLayer.removeFreeHighlight(this._freeHighlightId) : t.createAndAddNewEditor(o, !1, {
            highlightId: this._freeHighlightId,
            highlightOutlines: this._freeHighlight.getOutlines(),
            clipPathId: this._freeHighlightClipId,
            methodOfCreation: "main_toolbar"
          }), this._freeHighlightId = -1, this._freeHighlight = null, this._freeHighlightClipId = "";
        }
        static deserialize(t, o, A) {
          const b = super.deserialize(t, o, A), {
            rect: [R, L, D, H],
            color: X,
            quadPoints: V
          } = t;
          b.color = e.Util.makeHexColor(...X), b.#g = t.opacity;
          const [q, tt] = b.pageDimensions;
          b.width = (D - R) / q, b.height = (H - L) / tt;
          const rt = b.#s = [];
          for (let Y = 0; Y < V.length; Y += 8)
            rt.push({
              x: (V[4] - D) / q,
              y: (H - (1 - V[Y + 5])) / tt,
              width: (V[Y + 2] - V[Y]) / q,
              height: (V[Y + 5] - V[Y + 1]) / tt
            });
          return b.#w(), b;
        }
        serialize(t = !1) {
          if (this.isEmpty() || t)
            return null;
          const o = this.getRect(0, 0), A = y.AnnotationEditor._colorManager.convert(this.color);
          return {
            annotationType: e.AnnotationEditorType.HIGHLIGHT,
            color: A,
            opacity: this.#g,
            thickness: this.#m,
            quadPoints: this.#P(),
            outlines: this.#R(o),
            pageIndex: this.pageIndex,
            rect: o,
            rotation: this.#C(),
            structTreeParentId: this._structTreeParentId
          };
        }
        static canCreateNewEmptyEditor() {
          return !1;
        }
      }
      class p extends y.AnnotationEditor {
        #t = 0;
        #e = 0;
        #s = this.canvasPointermove.bind(this);
        #n = this.canvasPointerleave.bind(this);
        #r = this.canvasPointerup.bind(this);
        #i = this.canvasPointerdown.bind(this);
        #a = null;
        #h = new Path2D();
        #l = !1;
        #d = !1;
        #u = !1;
        #c = null;
        #o = 0;
        #p = 0;
        #g = null;
        static _defaultColor = null;
        static _defaultOpacity = 1;
        static _defaultThickness = 1;
        static _type = "ink";
        static _editorType = e.AnnotationEditorType.INK;
        constructor(t) {
          super({
            ...t,
            name: "inkEditor"
          }), this.color = t.color || null, this.thickness = t.thickness || null, this.opacity = t.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(t, o) {
          y.AnnotationEditor.initialize(t, o);
        }
        static updateDefaultParams(t, o) {
          switch (t) {
            case e.AnnotationEditorParamsType.INK_THICKNESS:
              p._defaultThickness = o;
              break;
            case e.AnnotationEditorParamsType.INK_COLOR:
              p._defaultColor = o;
              break;
            case e.AnnotationEditorParamsType.INK_OPACITY:
              p._defaultOpacity = o / 100;
              break;
          }
        }
        updateParams(t, o) {
          switch (t) {
            case e.AnnotationEditorParamsType.INK_THICKNESS:
              this.#f(o);
              break;
            case e.AnnotationEditorParamsType.INK_COLOR:
              this.#v(o);
              break;
            case e.AnnotationEditorParamsType.INK_OPACITY:
              this.#m(o);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[e.AnnotationEditorParamsType.INK_THICKNESS, p._defaultThickness], [e.AnnotationEditorParamsType.INK_COLOR, p._defaultColor || y.AnnotationEditor._defaultLineColor], [e.AnnotationEditorParamsType.INK_OPACITY, Math.round(p._defaultOpacity * 100)]];
        }
        get propertiesToUpdate() {
          return [[e.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || p._defaultThickness], [e.AnnotationEditorParamsType.INK_COLOR, this.color || p._defaultColor || y.AnnotationEditor._defaultLineColor], [e.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? p._defaultOpacity))]];
        }
        #f(t) {
          const o = (b) => {
            this.thickness = b, this.#D();
          }, A = this.thickness;
          this.addCommands({
            cmd: o.bind(this, t),
            undo: o.bind(this, A),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: e.AnnotationEditorParamsType.INK_THICKNESS,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #v(t) {
          const o = (b) => {
            this.color = b, this.#_();
          }, A = this.color;
          this.addCommands({
            cmd: o.bind(this, t),
            undo: o.bind(this, A),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: e.AnnotationEditorParamsType.INK_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #m(t) {
          const o = (b) => {
            this.opacity = b, this.#_();
          };
          t /= 100;
          const A = this.opacity;
          this.addCommands({
            cmd: o.bind(this, t),
            undo: o.bind(this, A),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: e.AnnotationEditorParamsType.INK_OPACITY,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        rebuild() {
          this.parent && (super.rebuild(), this.div !== null && (this.canvas || (this.#C(), this.#P()), this.isAttachedToDOM || (this.parent.add(this), this.#R()), this.#D()));
        }
        remove() {
          this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, this.#a && (clearTimeout(this.#a), this.#a = null), this.#c.disconnect(), this.#c = null, super.remove());
        }
        setParent(t) {
          !this.parent && t ? this._uiManager.removeShouldRescale(this) : this.parent && t === null && this._uiManager.addShouldRescale(this), super.setParent(t);
        }
        onScaleChanging() {
          const [t, o] = this.parentDimensions, A = this.width * t, b = this.height * o;
          this.setDimensions(A, b);
        }
        enableEditMode() {
          this.#l || this.canvas === null || (super.enableEditMode(), this._isDraggable = !1, this.canvas.addEventListener("pointerdown", this.#i));
        }
        disableEditMode() {
          !this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this._isDraggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown", this.#i));
        }
        onceAdded() {
          this._isDraggable = !this.isEmpty();
        }
        isEmpty() {
          return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
        }
        #A() {
          const {
            parentRotation: t,
            parentDimensions: [o, A]
          } = this;
          switch (t) {
            case 90:
              return [0, A, A, o];
            case 180:
              return [o, A, o, A];
            case 270:
              return [o, 0, A, o];
            default:
              return [0, 0, o, A];
          }
        }
        #w() {
          const {
            ctx: t,
            color: o,
            opacity: A,
            thickness: b,
            parentScale: R,
            scaleFactor: L
          } = this;
          t.lineWidth = b * R / L, t.lineCap = "round", t.lineJoin = "round", t.miterLimit = 10, t.strokeStyle = `${o}${(0, v.opacityToHex)(A)}`;
        }
        #T(t, o) {
          this.canvas.addEventListener("contextmenu", n.noContextMenu), this.canvas.addEventListener("pointerleave", this.#n), this.canvas.addEventListener("pointermove", this.#s), this.canvas.addEventListener("pointerup", this.#r), this.canvas.removeEventListener("pointerdown", this.#i), this.isEditing = !0, this.#u || (this.#u = !0, this.#R(), this.thickness ||= p._defaultThickness, this.color ||= p._defaultColor || y.AnnotationEditor._defaultLineColor, this.opacity ??= p._defaultOpacity), this.currentPath.push([t, o]), this.#d = !1, this.#w(), this.#g = () => {
            this.#y(), this.#g && window.requestAnimationFrame(this.#g);
          }, window.requestAnimationFrame(this.#g);
        }
        #k(t, o) {
          const [A, b] = this.currentPath.at(-1);
          if (this.currentPath.length > 1 && t === A && o === b)
            return;
          const R = this.currentPath;
          let L = this.#h;
          if (R.push([t, o]), this.#d = !0, R.length <= 2) {
            L.moveTo(...R[0]), L.lineTo(t, o);
            return;
          }
          R.length === 3 && (this.#h = L = new Path2D(), L.moveTo(...R[0])), this.#b(L, ...R.at(-3), ...R.at(-2), t, o);
        }
        #M() {
          if (this.currentPath.length === 0)
            return;
          const t = this.currentPath.at(-1);
          this.#h.lineTo(...t);
        }
        #L(t, o) {
          this.#g = null, t = Math.min(Math.max(t, 0), this.canvas.width), o = Math.min(Math.max(o, 0), this.canvas.height), this.#k(t, o), this.#M();
          let A;
          if (this.currentPath.length !== 1)
            A = this.#S();
          else {
            const H = [t, o];
            A = [[H, H.slice(), H.slice(), H]];
          }
          const b = this.#h, R = this.currentPath;
          this.currentPath = [], this.#h = new Path2D();
          const L = () => {
            this.allRawPaths.push(R), this.paths.push(A), this.bezierPath2D.push(b), this._uiManager.rebuild(this);
          }, D = () => {
            this.allRawPaths.pop(), this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (this.#C(), this.#P()), this.#D());
          };
          this.addCommands({
            cmd: L,
            undo: D,
            mustExec: !0
          });
        }
        #y() {
          if (!this.#d)
            return;
          this.#d = !1;
          const t = Math.ceil(this.thickness * this.parentScale), o = this.currentPath.slice(-3), A = o.map((L) => L[0]), b = o.map((L) => L[1]);
          Math.min(...A) - t, Math.max(...A) + t, Math.min(...b) - t, Math.max(...b) + t;
          const {
            ctx: R
          } = this;
          R.save(), R.clearRect(0, 0, this.canvas.width, this.canvas.height);
          for (const L of this.bezierPath2D)
            R.stroke(L);
          R.stroke(this.#h), R.restore();
        }
        #b(t, o, A, b, R, L, D) {
          const H = (o + b) / 2, X = (A + R) / 2, V = (b + L) / 2, q = (R + D) / 2;
          t.bezierCurveTo(H + 2 * (b - H) / 3, X + 2 * (R - X) / 3, V + 2 * (b - V) / 3, q + 2 * (R - q) / 3, V, q);
        }
        #S() {
          const t = this.currentPath;
          if (t.length <= 2)
            return [[t[0], t[0], t.at(-1), t.at(-1)]];
          const o = [];
          let A, [b, R] = t[0];
          for (A = 1; A < t.length - 2; A++) {
            const [tt, rt] = t[A], [Y, B] = t[A + 1], U = (tt + Y) / 2, j = (rt + B) / 2, Q = [b + 2 * (tt - b) / 3, R + 2 * (rt - R) / 3], J = [U + 2 * (tt - U) / 3, j + 2 * (rt - j) / 3];
            o.push([[b, R], Q, J, [U, j]]), [b, R] = [U, j];
          }
          const [L, D] = t[A], [H, X] = t[A + 1], V = [b + 2 * (L - b) / 3, R + 2 * (D - R) / 3], q = [H + 2 * (L - H) / 3, X + 2 * (D - X) / 3];
          return o.push([[b, R], V, q, [H, X]]), o;
        }
        #_() {
          if (this.isEmpty()) {
            this.#F();
            return;
          }
          this.#w();
          const {
            canvas: t,
            ctx: o
          } = this;
          o.setTransform(1, 0, 0, 1, 0, 0), o.clearRect(0, 0, t.width, t.height), this.#F();
          for (const A of this.bezierPath2D)
            o.stroke(A);
        }
        commit() {
          this.#l || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), this.#l = !0, this.div.classList.add("disabled"), this.#D(!0), this.select(), this.parent.addInkEditorIfNeeded(!0), this.moveInDOM(), this.div.focus({
            preventScroll: !0
          }));
        }
        focusin(t) {
          this._focusEventsAllowed && (super.focusin(t), this.enableEditMode());
        }
        canvasPointerdown(t) {
          t.button !== 0 || !this.isInEditMode() || this.#l || (this.setInForeground(), t.preventDefault(), this.div.contains(document.activeElement) || this.div.focus({
            preventScroll: !0
          }), this.#T(t.offsetX, t.offsetY));
        }
        canvasPointermove(t) {
          t.preventDefault(), this.#k(t.offsetX, t.offsetY);
        }
        canvasPointerup(t) {
          t.preventDefault(), this.#x(t);
        }
        canvasPointerleave(t) {
          this.#x(t);
        }
        #x(t) {
          this.canvas.removeEventListener("pointerleave", this.#n), this.canvas.removeEventListener("pointermove", this.#s), this.canvas.removeEventListener("pointerup", this.#r), this.canvas.addEventListener("pointerdown", this.#i), this.#a && clearTimeout(this.#a), this.#a = setTimeout(() => {
            this.#a = null, this.canvas.removeEventListener("contextmenu", n.noContextMenu);
          }, 10), this.#L(t.offsetX, t.offsetY), this.addToAnnotationStorage(), this.setInBackground();
        }
        #C() {
          this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = 0, this.canvas.className = "inkEditorCanvas", this.canvas.setAttribute("data-l10n-id", "pdfjs-ink-canvas"), this.div.append(this.canvas), this.ctx = this.canvas.getContext("2d");
        }
        #P() {
          this.#c = new ResizeObserver((t) => {
            const o = t[0].contentRect;
            o.width && o.height && this.setDimensions(o.width, o.height);
          }), this.#c.observe(this.div);
        }
        get isResizable() {
          return !this.isEmpty() && this.#l;
        }
        render() {
          if (this.div)
            return this.div;
          let t, o;
          this.width && (t = this.x, o = this.y), super.render(), this.div.setAttribute("data-l10n-id", "pdfjs-ink");
          const [A, b, R, L] = this.#A();
          if (this.setAt(A, b, 0, 0), this.setDims(R, L), this.#C(), this.width) {
            const [D, H] = this.parentDimensions;
            this.setAspectRatio(this.width * D, this.height * H), this.setAt(t * D, o * H, this.width * D, this.height * H), this.#u = !0, this.#R(), this.setDims(this.width * D, this.height * H), this.#_(), this.div.classList.add("disabled");
          } else
            this.div.classList.add("editing"), this.enableEditMode();
          return this.#P(), this.div;
        }
        #R() {
          if (!this.#u)
            return;
          const [t, o] = this.parentDimensions;
          this.canvas.width = Math.ceil(this.width * t), this.canvas.height = Math.ceil(this.height * o), this.#F();
        }
        setDimensions(t, o) {
          const A = Math.round(t), b = Math.round(o);
          if (this.#o === A && this.#p === b)
            return;
          this.#o = A, this.#p = b, this.canvas.style.visibility = "hidden";
          const [R, L] = this.parentDimensions;
          this.width = t / R, this.height = o / L, this.fixAndSetPosition(), this.#l && this.#I(t, o), this.#R(), this.#_(), this.canvas.style.visibility = "visible", this.fixDims();
        }
        #I(t, o) {
          const A = this.#B(), b = (t - A) / this.#e, R = (o - A) / this.#t;
          this.scaleFactor = Math.min(b, R);
        }
        #F() {
          const t = this.#B() / 2;
          this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + t, this.translationY * this.scaleFactor + t);
        }
        static #N(t) {
          const o = new Path2D();
          for (let A = 0, b = t.length; A < b; A++) {
            const [R, L, D, H] = t[A];
            A === 0 && o.moveTo(...R), o.bezierCurveTo(L[0], L[1], D[0], D[1], H[0], H[1]);
          }
          return o;
        }
        static #U(t, o, A) {
          const [b, R, L, D] = o;
          switch (A) {
            case 0:
              for (let H = 0, X = t.length; H < X; H += 2)
                t[H] += b, t[H + 1] = D - t[H + 1];
              break;
            case 90:
              for (let H = 0, X = t.length; H < X; H += 2) {
                const V = t[H];
                t[H] = t[H + 1] + b, t[H + 1] = V + R;
              }
              break;
            case 180:
              for (let H = 0, X = t.length; H < X; H += 2)
                t[H] = L - t[H], t[H + 1] += R;
              break;
            case 270:
              for (let H = 0, X = t.length; H < X; H += 2) {
                const V = t[H];
                t[H] = L - t[H + 1], t[H + 1] = D - V;
              }
              break;
            default:
              throw new Error("Invalid rotation");
          }
          return t;
        }
        static #X(t, o, A) {
          const [b, R, L, D] = o;
          switch (A) {
            case 0:
              for (let H = 0, X = t.length; H < X; H += 2)
                t[H] -= b, t[H + 1] = D - t[H + 1];
              break;
            case 90:
              for (let H = 0, X = t.length; H < X; H += 2) {
                const V = t[H];
                t[H] = t[H + 1] - R, t[H + 1] = V - b;
              }
              break;
            case 180:
              for (let H = 0, X = t.length; H < X; H += 2)
                t[H] = L - t[H], t[H + 1] -= R;
              break;
            case 270:
              for (let H = 0, X = t.length; H < X; H += 2) {
                const V = t[H];
                t[H] = D - t[H + 1], t[H + 1] = L - V;
              }
              break;
            default:
              throw new Error("Invalid rotation");
          }
          return t;
        }
        #q(t, o, A, b) {
          const R = [], L = this.thickness / 2, D = t * o + L, H = t * A + L;
          for (const X of this.paths) {
            const V = [], q = [];
            for (let tt = 0, rt = X.length; tt < rt; tt++) {
              const [Y, B, U, j] = X[tt];
              if (Y[0] === j[0] && Y[1] === j[1] && rt === 1) {
                const $ = t * Y[0] + D, k = t * Y[1] + H;
                V.push($, k), q.push($, k);
                break;
              }
              const Q = t * Y[0] + D, J = t * Y[1] + H, it = t * B[0] + D, ht = t * B[1] + H, ot = t * U[0] + D, Z = t * U[1] + H, lt = t * j[0] + D, ct = t * j[1] + H;
              tt === 0 && (V.push(Q, J), q.push(Q, J)), V.push(it, ht, ot, Z, lt, ct), q.push(it, ht), tt === rt - 1 && q.push(lt, ct);
            }
            R.push({
              bezier: p.#U(V, b, this.rotation),
              points: p.#U(q, b, this.rotation)
            });
          }
          return R;
        }
        #G() {
          let t = 1 / 0, o = -1 / 0, A = 1 / 0, b = -1 / 0;
          for (const R of this.paths)
            for (const [L, D, H, X] of R) {
              const V = e.Util.bezierBoundingBox(...L, ...D, ...H, ...X);
              t = Math.min(t, V[0]), A = Math.min(A, V[1]), o = Math.max(o, V[2]), b = Math.max(b, V[3]);
            }
          return [t, A, o, b];
        }
        #B() {
          return this.#l ? Math.ceil(this.thickness * this.parentScale) : 0;
        }
        #D(t = !1) {
          if (this.isEmpty())
            return;
          if (!this.#l) {
            this.#_();
            return;
          }
          const o = this.#G(), A = this.#B();
          this.#e = Math.max(y.AnnotationEditor.MIN_SIZE, o[2] - o[0]), this.#t = Math.max(y.AnnotationEditor.MIN_SIZE, o[3] - o[1]);
          const b = Math.ceil(A + this.#e * this.scaleFactor), R = Math.ceil(A + this.#t * this.scaleFactor), [L, D] = this.parentDimensions;
          this.width = b / L, this.height = R / D, this.setAspectRatio(b, R);
          const H = this.translationX, X = this.translationY;
          this.translationX = -o[0], this.translationY = -o[1], this.#R(), this.#_(), this.#o = b, this.#p = R, this.setDims(b, R);
          const V = t ? A / this.scaleFactor / 2 : 0;
          this.translate(H - this.translationX - V, X - this.translationY - V);
        }
        static deserialize(t, o, A) {
          if (t instanceof x.InkAnnotationElement)
            return null;
          const b = super.deserialize(t, o, A);
          b.thickness = t.thickness, b.color = e.Util.makeHexColor(...t.color), b.opacity = t.opacity;
          const [R, L] = b.pageDimensions, D = b.width * R, H = b.height * L, X = b.parentScale, V = t.thickness / 2;
          b.#l = !0, b.#o = Math.round(D), b.#p = Math.round(H);
          const {
            paths: q,
            rect: tt,
            rotation: rt
          } = t;
          for (let {
            bezier: B
          } of q) {
            B = p.#X(B, tt, rt);
            const U = [];
            b.paths.push(U);
            let j = X * (B[0] - V), Q = X * (B[1] - V);
            for (let it = 2, ht = B.length; it < ht; it += 6) {
              const ot = X * (B[it] - V), Z = X * (B[it + 1] - V), lt = X * (B[it + 2] - V), ct = X * (B[it + 3] - V), $ = X * (B[it + 4] - V), k = X * (B[it + 5] - V);
              U.push([[j, Q], [ot, Z], [lt, ct], [$, k]]), j = $, Q = k;
            }
            const J = this.#N(U);
            b.bezierPath2D.push(J);
          }
          const Y = b.#G();
          return b.#e = Math.max(y.AnnotationEditor.MIN_SIZE, Y[2] - Y[0]), b.#t = Math.max(y.AnnotationEditor.MIN_SIZE, Y[3] - Y[1]), b.#I(D, H), b;
        }
        serialize() {
          if (this.isEmpty())
            return null;
          const t = this.getRect(0, 0), o = y.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
          return {
            annotationType: e.AnnotationEditorType.INK,
            color: o,
            thickness: this.thickness,
            opacity: this.opacity,
            paths: this.#q(this.scaleFactor / this.parentScale, this.translationX, this.translationY, t),
            pageIndex: this.pageIndex,
            rect: t,
            rotation: this.rotation,
            structTreeParentId: this._structTreeParentId
          };
        }
      }
      class C extends y.AnnotationEditor {
        #t = null;
        #e = null;
        #s = null;
        #n = null;
        #r = null;
        #i = "";
        #a = null;
        #h = null;
        #l = null;
        #d = !1;
        #u = !1;
        static _type = "stamp";
        static _editorType = e.AnnotationEditorType.STAMP;
        constructor(t) {
          super({
            ...t,
            name: "stampEditor"
          }), this.#n = t.bitmapUrl, this.#r = t.bitmapFile;
        }
        static initialize(t, o) {
          y.AnnotationEditor.initialize(t, o);
        }
        static get supportedTypes() {
          const t = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
          return (0, e.shadow)(this, "supportedTypes", t.map((o) => `image/${o}`));
        }
        static get supportedTypesStr() {
          return (0, e.shadow)(this, "supportedTypesStr", this.supportedTypes.join(","));
        }
        static isHandlingMimeForPasting(t) {
          return this.supportedTypes.includes(t);
        }
        static paste(t, o) {
          o.pasteEditor(e.AnnotationEditorType.STAMP, {
            bitmapFile: t.getAsFile()
          });
        }
        #c(t, o = !1) {
          if (!t) {
            this.remove();
            return;
          }
          this.#t = t.bitmap, o || (this.#e = t.id, this.#d = t.isSvg), t.file && (this.#i = t.file.name), this.#g();
        }
        #o() {
          this.#s = null, this._uiManager.enableWaiting(!1), this.#a && this.div.focus();
        }
        #p() {
          if (this.#e) {
            this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(this.#e).then((o) => this.#c(o, !0)).finally(() => this.#o());
            return;
          }
          if (this.#n) {
            const o = this.#n;
            this.#n = null, this._uiManager.enableWaiting(!0), this.#s = this._uiManager.imageManager.getFromUrl(o).then((A) => this.#c(A)).finally(() => this.#o());
            return;
          }
          if (this.#r) {
            const o = this.#r;
            this.#r = null, this._uiManager.enableWaiting(!0), this.#s = this._uiManager.imageManager.getFromFile(o).then((A) => this.#c(A)).finally(() => this.#o());
            return;
          }
          const t = document.createElement("input");
          t.type = "file", t.accept = C.supportedTypesStr, this.#s = new Promise((o) => {
            t.addEventListener("change", async () => {
              if (!t.files || t.files.length === 0)
                this.remove();
              else {
                this._uiManager.enableWaiting(!0);
                const A = await this._uiManager.imageManager.getFromFile(t.files[0]);
                this.#c(A);
              }
              o();
            }), t.addEventListener("cancel", () => {
              this.remove(), o();
            });
          }).finally(() => this.#o()), t.click();
        }
        remove() {
          this.#e && (this.#t = null, this._uiManager.imageManager.deleteId(this.#e), this.#a?.remove(), this.#a = null, this.#h?.disconnect(), this.#h = null, this.#l && (clearTimeout(this.#l), this.#l = null)), super.remove();
        }
        rebuild() {
          if (!this.parent) {
            this.#e && this.#p();
            return;
          }
          super.rebuild(), this.div !== null && (this.#e && this.#a === null && this.#p(), this.isAttachedToDOM || this.parent.add(this));
        }
        onceAdded() {
          this._isDraggable = !0, this.div.focus();
        }
        isEmpty() {
          return !(this.#s || this.#t || this.#n || this.#r || this.#e);
        }
        get isResizable() {
          return !0;
        }
        render() {
          if (this.div)
            return this.div;
          let t, o;
          if (this.width && (t = this.x, o = this.y), super.render(), this.div.hidden = !0, this.addAltTextButton(), this.#t ? this.#g() : this.#p(), this.width) {
            const [A, b] = this.parentDimensions;
            this.setAt(t * A, o * b, this.width * A, this.height * b);
          }
          return this.div;
        }
        #g() {
          const {
            div: t
          } = this;
          let {
            width: o,
            height: A
          } = this.#t;
          const [b, R] = this.pageDimensions, L = 0.75;
          if (this.width)
            o = this.width * b, A = this.height * R;
          else if (o > L * b || A > L * R) {
            const V = Math.min(L * b / o, L * R / A);
            o *= V, A *= V;
          }
          const [D, H] = this.parentDimensions;
          this.setDims(o * D / b, A * H / R), this._uiManager.enableWaiting(!1);
          const X = this.#a = document.createElement("canvas");
          t.append(X), t.hidden = !1, this.#m(o, A), this.#w(), this.#u || (this.parent.addUndoableEditor(this), this.#u = !0), this._reportTelemetry({
            action: "inserted_image"
          }), this.#i && X.setAttribute("aria-label", this.#i);
        }
        #f(t, o) {
          const [A, b] = this.parentDimensions;
          this.width = t / A, this.height = o / b, this.setDims(t, o), this._initialOptions?.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, this.#l !== null && clearTimeout(this.#l);
          const R = 200;
          this.#l = setTimeout(() => {
            this.#l = null, this.#m(t, o);
          }, R);
        }
        #v(t, o) {
          const {
            width: A,
            height: b
          } = this.#t;
          let R = A, L = b, D = this.#t;
          for (; R > 2 * t || L > 2 * o; ) {
            const H = R, X = L;
            R > 2 * t && (R = R >= 16384 ? Math.floor(R / 2) - 1 : Math.ceil(R / 2)), L > 2 * o && (L = L >= 16384 ? Math.floor(L / 2) - 1 : Math.ceil(L / 2));
            const V = new OffscreenCanvas(R, L);
            V.getContext("2d").drawImage(D, 0, 0, H, X, 0, 0, R, L), D = V.transferToImageBitmap();
          }
          return D;
        }
        #m(t, o) {
          t = Math.ceil(t), o = Math.ceil(o);
          const A = this.#a;
          if (!A || A.width === t && A.height === o)
            return;
          A.width = t, A.height = o;
          const b = this.#d ? this.#t : this.#v(t, o);
          if (this._uiManager.hasMLManager && !this.hasAltText()) {
            const L = new OffscreenCanvas(t, o);
            L.getContext("2d").drawImage(b, 0, 0, b.width, b.height, 0, 0, t, o), L.convertToBlob().then((H) => {
              const X = new FileReader();
              X.onload = () => {
                const V = X.result;
                this._uiManager.mlGuess({
                  service: "image-to-text",
                  request: {
                    imageData: V
                  }
                }).then((q) => {
                  const tt = q?.output || "";
                  this.parent && tt && !this.hasAltText() && (this.altTextData = {
                    altText: tt,
                    decorative: !1
                  });
                });
              }, X.readAsDataURL(H);
            });
          }
          const R = A.getContext("2d");
          R.filter = this._uiManager.hcmFilter, R.drawImage(b, 0, 0, b.width, b.height, 0, 0, t, o);
        }
        getImageForAltText() {
          return this.#a;
        }
        #A(t) {
          if (t) {
            if (this.#d) {
              const b = this._uiManager.imageManager.getSvgUrl(this.#e);
              if (b)
                return b;
            }
            const o = document.createElement("canvas");
            return {
              width: o.width,
              height: o.height
            } = this.#t, o.getContext("2d").drawImage(this.#t, 0, 0), o.toDataURL();
          }
          if (this.#d) {
            const [o, A] = this.pageDimensions, b = Math.round(this.width * o * n.PixelsPerInch.PDF_TO_CSS_UNITS), R = Math.round(this.height * A * n.PixelsPerInch.PDF_TO_CSS_UNITS), L = new OffscreenCanvas(b, R);
            return L.getContext("2d").drawImage(this.#t, 0, 0, this.#t.width, this.#t.height, 0, 0, b, R), L.transferToImageBitmap();
          }
          return structuredClone(this.#t);
        }
        #w() {
          this.#h = new ResizeObserver((t) => {
            const o = t[0].contentRect;
            o.width && o.height && this.#f(o.width, o.height);
          }), this.#h.observe(this.div);
        }
        static deserialize(t, o, A) {
          if (t instanceof x.StampAnnotationElement)
            return null;
          const b = super.deserialize(t, o, A), {
            rect: R,
            bitmapUrl: L,
            bitmapId: D,
            isSvg: H,
            accessibilityData: X
          } = t;
          D && A.imageManager.isValidId(D) ? b.#e = D : b.#n = L, b.#d = H;
          const [V, q] = b.pageDimensions;
          return b.width = (R[2] - R[0]) / V, b.height = (R[3] - R[1]) / q, X && (b.altTextData = X), b;
        }
        serialize(t = !1, o = null) {
          if (this.isEmpty())
            return null;
          const A = {
            annotationType: e.AnnotationEditorType.STAMP,
            bitmapId: this.#e,
            pageIndex: this.pageIndex,
            rect: this.getRect(0, 0),
            rotation: this.rotation,
            isSvg: this.#d,
            structTreeParentId: this._structTreeParentId
          };
          if (t)
            return A.bitmapUrl = this.#A(!0), A.accessibilityData = this.altTextData, A;
          const {
            decorative: b,
            altText: R
          } = this.altTextData;
          if (!b && R && (A.accessibilityData = {
            type: "Figure",
            alt: R
          }), o === null)
            return A;
          o.stamps ||= /* @__PURE__ */ new Map();
          const L = this.#d ? (A.rect[2] - A.rect[0]) * (A.rect[3] - A.rect[1]) : null;
          if (!o.stamps.has(this.#e))
            o.stamps.set(this.#e, {
              area: L,
              serialized: A
            }), A.bitmap = this.#A(!1);
          else if (this.#d) {
            const D = o.stamps.get(this.#e);
            L > D.area && (D.area = L, D.serialized.bitmap.close(), D.serialized.bitmap = this.#A(!1));
          }
          return A;
        }
      }
      class r {
        #t;
        #e = !1;
        #s = null;
        #n = null;
        #r = null;
        #i = null;
        #a = null;
        #h = /* @__PURE__ */ new Map();
        #l = !1;
        #d = !1;
        #u = !1;
        #c = null;
        #o;
        static _initialized = !1;
        static #p = new Map([l, p, C, f].map((t) => [t._editorType, t]));
        constructor({
          uiManager: t,
          pageIndex: o,
          div: A,
          accessibilityManager: b,
          annotationLayer: R,
          drawLayer: L,
          textLayer: D,
          viewport: H,
          l10n: X
        }) {
          const V = [...r.#p.values()];
          if (!r._initialized) {
            r._initialized = !0;
            for (const q of V)
              q.initialize(X, t);
          }
          t.registerEditorTypes(V), this.#o = t, this.pageIndex = o, this.div = A, this.#t = b, this.#s = R, this.viewport = H, this.#c = D, this.drawLayer = L, this.#o.addLayer(this);
        }
        get isEmpty() {
          return this.#h.size === 0;
        }
        get isInvisible() {
          return this.isEmpty && this.#o.getMode() === e.AnnotationEditorType.NONE;
        }
        updateToolbar(t) {
          this.#o.updateToolbar(t);
        }
        updateMode(t = this.#o.getMode()) {
          switch (this.#A(), t) {
            case e.AnnotationEditorType.NONE:
              this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
              return;
            case e.AnnotationEditorType.INK:
              this.addInkEditorIfNeeded(!1), this.disableTextSelection(), this.togglePointerEvents(!0), this.disableClick();
              break;
            case e.AnnotationEditorType.HIGHLIGHT:
              this.enableTextSelection(), this.togglePointerEvents(!1), this.disableClick();
              break;
            default:
              this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
          }
          this.toggleAnnotationLayerPointerEvents(!1);
          const {
            classList: o
          } = this.div;
          for (const A of r.#p.values())
            o.toggle(`${A._type}Editing`, t === A._editorType);
          this.div.hidden = !1;
        }
        hasTextLayer(t) {
          return t === this.#c?.div;
        }
        addInkEditorIfNeeded(t) {
          if (this.#o.getMode() !== e.AnnotationEditorType.INK)
            return;
          if (!t) {
            for (const A of this.#h.values())
              if (A.isEmpty()) {
                A.setInBackground();
                return;
              }
          }
          this.createAndAddNewEditor({
            offsetX: 0,
            offsetY: 0
          }, !1).setInBackground();
        }
        setEditingState(t) {
          this.#o.setEditingState(t);
        }
        addCommands(t) {
          this.#o.addCommands(t);
        }
        togglePointerEvents(t = !1) {
          this.div.classList.toggle("disabled", !t);
        }
        toggleAnnotationLayerPointerEvents(t = !1) {
          this.#s?.div.classList.toggle("disabled", !t);
        }
        enable() {
          this.div.tabIndex = 0, this.togglePointerEvents(!0);
          const t = /* @__PURE__ */ new Set();
          for (const A of this.#h.values())
            A.enableEditing(), A.show(!0), A.annotationElementId && (this.#o.removeChangedExistingAnnotation(A), t.add(A.annotationElementId));
          if (!this.#s)
            return;
          const o = this.#s.getEditableAnnotations();
          for (const A of o) {
            if (A.hide(), this.#o.isDeletedAnnotationElement(A.data.id) || t.has(A.data.id))
              continue;
            const b = this.deserialize(A);
            b && (this.addOrRebuild(b), b.enableEditing());
          }
        }
        disable() {
          this.#u = !0, this.div.tabIndex = -1, this.togglePointerEvents(!1);
          const t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
          for (const b of this.#h.values())
            if (b.disableEditing(), !!b.annotationElementId) {
              if (b.serialize() !== null) {
                t.set(b.annotationElementId, b);
                continue;
              } else
                o.set(b.annotationElementId, b);
              this.getEditableAnnotation(b.annotationElementId)?.show(), b.remove();
            }
          if (this.#s) {
            const b = this.#s.getEditableAnnotations();
            for (const R of b) {
              const {
                id: L
              } = R.data;
              if (this.#o.isDeletedAnnotationElement(L))
                continue;
              let D = o.get(L);
              if (D) {
                D.resetAnnotationElement(R), D.show(!1), R.show();
                continue;
              }
              D = t.get(L), D && (this.#o.addChangedExistingAnnotation(D), D.renderAnnotationElement(R), D.show(!1)), R.show();
            }
          }
          this.#A(), this.isEmpty && (this.div.hidden = !0);
          const {
            classList: A
          } = this.div;
          for (const b of r.#p.values())
            A.remove(`${b._type}Editing`);
          this.disableTextSelection(), this.toggleAnnotationLayerPointerEvents(!0), this.#u = !1;
        }
        getEditableAnnotation(t) {
          return this.#s?.getEditableAnnotation(t) || null;
        }
        setActiveEditor(t) {
          this.#o.getActive() !== t && this.#o.setActiveEditor(t);
        }
        enableTextSelection() {
          this.div.tabIndex = -1, this.#c?.div && !this.#i && (this.#i = this.#g.bind(this), this.#c.div.addEventListener("pointerdown", this.#i), this.#c.div.classList.add("highlighting"));
        }
        disableTextSelection() {
          this.div.tabIndex = 0, this.#c?.div && this.#i && (this.#c.div.removeEventListener("pointerdown", this.#i), this.#i = null, this.#c.div.classList.remove("highlighting"));
        }
        #g(t) {
          if (this.#o.unselectAll(), t.target === this.#c.div) {
            const {
              isMac: o
            } = e.FeatureTest.platform;
            if (t.button !== 0 || t.ctrlKey && o)
              return;
            this.#o.showAllEditors("highlight", !0, !0), this.#c.div.classList.add("free"), f.startHighlighting(this, this.#o.direction === "ltr", t), this.#c.div.addEventListener("pointerup", () => {
              this.#c.div.classList.remove("free");
            }, {
              once: !0
            }), t.preventDefault();
          }
        }
        enableClick() {
          this.#r || (this.#r = this.pointerdown.bind(this), this.#n = this.pointerup.bind(this), this.div.addEventListener("pointerdown", this.#r), this.div.addEventListener("pointerup", this.#n));
        }
        disableClick() {
          this.#r && (this.div.removeEventListener("pointerdown", this.#r), this.div.removeEventListener("pointerup", this.#n), this.#r = null, this.#n = null);
        }
        attach(t) {
          this.#h.set(t.id, t);
          const {
            annotationElementId: o
          } = t;
          o && this.#o.isDeletedAnnotationElement(o) && this.#o.removeDeletedAnnotationElement(t);
        }
        detach(t) {
          this.#h.delete(t.id), this.#t?.removePointerInTextLayer(t.contentDiv), !this.#u && t.annotationElementId && this.#o.addDeletedAnnotationElement(t);
        }
        remove(t) {
          this.detach(t), this.#o.removeEditor(t), t.div.remove(), t.isAttachedToDOM = !1, this.#d || this.addInkEditorIfNeeded(!1);
        }
        changeParent(t) {
          t.parent !== this && (t.parent && t.annotationElementId && (this.#o.addDeletedAnnotationElement(t.annotationElementId), y.AnnotationEditor.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), t.parent?.detach(t), t.setParent(this), t.div && t.isAttachedToDOM && (t.div.remove(), this.div.append(t.div)));
        }
        add(t) {
          if (!(t.parent === this && t.isAttachedToDOM)) {
            if (this.changeParent(t), this.#o.addEditor(t), this.attach(t), !t.isAttachedToDOM) {
              const o = t.render();
              this.div.append(o), t.isAttachedToDOM = !0;
            }
            t.fixAndSetPosition(), t.onceAdded(), this.#o.addToAnnotationStorage(t), t._reportTelemetry(t.telemetryInitialData);
          }
        }
        moveEditorInDOM(t) {
          if (!t.isAttachedToDOM)
            return;
          const {
            activeElement: o
          } = document;
          t.div.contains(o) && !this.#a && (t._focusEventsAllowed = !1, this.#a = setTimeout(() => {
            this.#a = null, t.div.contains(document.activeElement) ? t._focusEventsAllowed = !0 : (t.div.addEventListener("focusin", () => {
              t._focusEventsAllowed = !0;
            }, {
              once: !0
            }), o.focus());
          }, 0)), t._structTreeParentId = this.#t?.moveElementInDOM(this.div, t.div, t.contentDiv, !0);
        }
        addOrRebuild(t) {
          t.needsToBeRebuilt() ? (t.parent ||= this, t.rebuild(), t.show()) : this.add(t);
        }
        addUndoableEditor(t) {
          const o = () => t._uiManager.rebuild(t), A = () => {
            t.remove();
          };
          this.addCommands({
            cmd: o,
            undo: A,
            mustExec: !1
          });
        }
        getNextId() {
          return this.#o.getId();
        }
        get #f() {
          return r.#p.get(this.#o.getMode());
        }
        #v(t) {
          const o = this.#f;
          return o ? new o.prototype.constructor(t) : null;
        }
        canCreateNewEmptyEditor() {
          return this.#f?.canCreateNewEmptyEditor();
        }
        pasteEditor(t, o) {
          this.#o.updateToolbar(t), this.#o.updateMode(t);
          const {
            offsetX: A,
            offsetY: b
          } = this.#m(), R = this.getNextId(), L = this.#v({
            parent: this,
            id: R,
            x: A,
            y: b,
            uiManager: this.#o,
            isCentered: !0,
            ...o
          });
          L && this.add(L);
        }
        deserialize(t) {
          return r.#p.get(t.annotationType ?? t.annotationEditorType)?.deserialize(t, this, this.#o) || null;
        }
        createAndAddNewEditor(t, o, A = {}) {
          const b = this.getNextId(), R = this.#v({
            parent: this,
            id: b,
            x: t.offsetX,
            y: t.offsetY,
            uiManager: this.#o,
            isCentered: o,
            ...A
          });
          return R && this.add(R), R;
        }
        #m() {
          const {
            x: t,
            y: o,
            width: A,
            height: b
          } = this.div.getBoundingClientRect(), R = Math.max(0, t), L = Math.max(0, o), D = Math.min(window.innerWidth, t + A), H = Math.min(window.innerHeight, o + b), X = (R + D) / 2 - t, V = (L + H) / 2 - o, [q, tt] = this.viewport.rotation % 180 === 0 ? [X, V] : [V, X];
          return {
            offsetX: q,
            offsetY: tt
          };
        }
        addNewEditor() {
          this.createAndAddNewEditor(this.#m(), !0);
        }
        setSelected(t) {
          this.#o.setSelected(t);
        }
        toggleSelected(t) {
          this.#o.toggleSelected(t);
        }
        isSelected(t) {
          return this.#o.isSelected(t);
        }
        unselect(t) {
          this.#o.unselect(t);
        }
        pointerup(t) {
          const {
            isMac: o
          } = e.FeatureTest.platform;
          if (!(t.button !== 0 || t.ctrlKey && o) && t.target === this.div && this.#l) {
            if (this.#l = !1, !this.#e) {
              this.#e = !0;
              return;
            }
            if (this.#o.getMode() === e.AnnotationEditorType.STAMP) {
              this.#o.unselectAll();
              return;
            }
            this.createAndAddNewEditor(t, !1);
          }
        }
        pointerdown(t) {
          if (this.#o.getMode() === e.AnnotationEditorType.HIGHLIGHT && this.enableTextSelection(), this.#l) {
            this.#l = !1;
            return;
          }
          const {
            isMac: o
          } = e.FeatureTest.platform;
          if (t.button !== 0 || t.ctrlKey && o || t.target !== this.div)
            return;
          this.#l = !0;
          const A = this.#o.getActive();
          this.#e = !A || A.isEmpty();
        }
        findNewParent(t, o, A) {
          const b = this.#o.findParent(o, A);
          return b === null || b === this ? !1 : (b.changeParent(t), !0);
        }
        destroy() {
          this.#o.getActive()?.parent === this && (this.#o.commitOrRemove(), this.#o.setActiveEditor(null)), this.#a && (clearTimeout(this.#a), this.#a = null);
          for (const t of this.#h.values())
            this.#t?.removePointerInTextLayer(t.contentDiv), t.setParent(null), t.isAttachedToDOM = !1, t.div.remove();
          this.div = null, this.#h.clear(), this.#o.removeLayer(this);
        }
        #A() {
          this.#d = !0;
          for (const t of this.#h.values())
            t.isEmpty() && t.remove();
          this.#d = !1;
        }
        render({
          viewport: t
        }) {
          this.viewport = t, (0, n.setLayerDimensions)(this.div, t);
          for (const o of this.#o.getEditors(this.pageIndex))
            this.add(o), o.rebuild();
          this.updateMode();
        }
        update({
          viewport: t
        }) {
          this.#o.commitOrRemove(), this.#A();
          const o = this.viewport.rotation, A = t.rotation;
          if (this.viewport = t, (0, n.setLayerDimensions)(this.div, {
            rotation: A
          }), o !== A)
            for (const b of this.#h.values())
              b.rotate(A);
          this.addInkEditorIfNeeded(!1);
        }
        get pageDimensions() {
          const {
            pageWidth: t,
            pageHeight: o
          } = this.viewport.rawDims;
          return [t, o];
        }
        get scale() {
          return this.#o.viewParameters.realScale;
        }
      }
    }
  ),
  /***/
  259: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        ColorPicker: () => (
          /* binding */
          x
        )
        /* harmony export */
      });
      var e = i(292), y = i(830), v = i(419);
      class x {
        #t = this.#g.bind(this);
        #e = this.#v.bind(this);
        #s = null;
        #n = null;
        #r;
        #i = null;
        #a = !1;
        #h = !1;
        #l = null;
        #d;
        #u = null;
        #c;
        static get _keyboardManager() {
          return (0, e.shadow)(this, "_keyboardManager", new y.KeyboardManager([[["Escape", "mac+Escape"], x.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], x.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], x.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], x.prototype._moveToPrevious], [["Home", "mac+Home"], x.prototype._moveToBeginning], [["End", "mac+End"], x.prototype._moveToEnd]]));
        }
        constructor({
          editor: l = null,
          uiManager: g = null
        }) {
          l ? (this.#h = !1, this.#c = e.AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.#l = l) : (this.#h = !0, this.#c = e.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR), this.#u = l?._uiManager || g, this.#d = this.#u._eventBus, this.#r = l?.color || this.#u?.highlightColors.values().next().value || "#FFFF98";
        }
        renderButton() {
          const l = this.#s = document.createElement("button");
          l.className = "colorPicker", l.tabIndex = "0", l.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button"), l.setAttribute("aria-haspopup", !0), l.addEventListener("click", this.#f.bind(this)), l.addEventListener("keydown", this.#t);
          const g = this.#n = document.createElement("span");
          return g.className = "swatch", g.setAttribute("aria-hidden", !0), g.style.backgroundColor = this.#r, l.append(g), l;
        }
        renderMainDropdown() {
          const l = this.#i = this.#o();
          return l.setAttribute("aria-orientation", "horizontal"), l.setAttribute("aria-labelledby", "highlightColorPickerLabel"), l;
        }
        #o() {
          const l = document.createElement("div");
          l.addEventListener("contextmenu", v.noContextMenu), l.className = "dropdown", l.role = "listbox", l.setAttribute("aria-multiselectable", !1), l.setAttribute("aria-orientation", "vertical"), l.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown");
          for (const [g, h] of this.#u.highlightColors) {
            const n = document.createElement("button");
            n.tabIndex = "0", n.role = "option", n.setAttribute("data-color", h), n.title = g, n.setAttribute("data-l10n-id", `pdfjs-editor-colorpicker-${g}`);
            const f = document.createElement("span");
            n.append(f), f.className = "swatch", f.style.backgroundColor = h, n.setAttribute("aria-selected", h === this.#r), n.addEventListener("click", this.#p.bind(this, h)), l.append(n);
          }
          return l.addEventListener("keydown", this.#t), l;
        }
        #p(l, g) {
          g.stopPropagation(), this.#d.dispatch("switchannotationeditorparams", {
            source: this,
            type: this.#c,
            value: l
          });
        }
        _colorSelectFromKeyboard(l) {
          if (l.target === this.#s) {
            this.#f(l);
            return;
          }
          const g = l.target.getAttribute("data-color");
          g && this.#p(g, l);
        }
        _moveToNext(l) {
          if (!this.#m) {
            this.#f(l);
            return;
          }
          if (l.target === this.#s) {
            this.#i.firstChild?.focus();
            return;
          }
          l.target.nextSibling?.focus();
        }
        _moveToPrevious(l) {
          if (l.target === this.#i?.firstChild || l.target === this.#s) {
            this.#m && this._hideDropdownFromKeyboard();
            return;
          }
          this.#m || this.#f(l), l.target.previousSibling?.focus();
        }
        _moveToBeginning(l) {
          if (!this.#m) {
            this.#f(l);
            return;
          }
          this.#i.firstChild?.focus();
        }
        _moveToEnd(l) {
          if (!this.#m) {
            this.#f(l);
            return;
          }
          this.#i.lastChild?.focus();
        }
        #g(l) {
          x._keyboardManager.exec(this, l);
        }
        #f(l) {
          if (this.#m) {
            this.hideDropdown();
            return;
          }
          if (this.#a = l.detail === 0, window.addEventListener("pointerdown", this.#e), this.#i) {
            this.#i.classList.remove("hidden");
            return;
          }
          const g = this.#i = this.#o();
          this.#s.append(g);
        }
        #v(l) {
          this.#i?.contains(l.target) || this.hideDropdown();
        }
        hideDropdown() {
          this.#i?.classList.add("hidden"), window.removeEventListener("pointerdown", this.#e);
        }
        get #m() {
          return this.#i && !this.#i.classList.contains("hidden");
        }
        _hideDropdownFromKeyboard() {
          if (!this.#h) {
            if (!this.#m) {
              this.#l?.unselect();
              return;
            }
            this.hideDropdown(), this.#s.focus({
              preventScroll: !0,
              focusVisible: this.#a
            });
          }
        }
        updateColor(l) {
          if (this.#n && (this.#n.style.backgroundColor = l), !this.#i)
            return;
          const g = this.#u.highlightColors.values();
          for (const h of this.#i.children)
            h.setAttribute("aria-selected", g.next().value === l);
        }
        destroy() {
          this.#s?.remove(), this.#s = null, this.#n = null, this.#i?.remove(), this.#i = null;
        }
      }
    }
  ),
  /***/
  310: (
    /***/
    (u, s, i) => {
      i.d(s, {
        AnnotationEditor: () => (
          /* binding */
          l
        )
      });
      var e = i(830), y = i(292), v = i(419);
      class x {
        #t = "";
        #e = !1;
        #s = null;
        #n = null;
        #r = null;
        #i = !1;
        #a = null;
        static _l10nPromise = null;
        constructor(n) {
          this.#a = n;
        }
        static initialize(n) {
          x._l10nPromise ||= n;
        }
        async render() {
          const n = this.#s = document.createElement("button");
          n.className = "altText";
          const f = await x._l10nPromise.get("pdfjs-editor-alt-text-button-label");
          n.textContent = f, n.setAttribute("aria-label", f), n.tabIndex = "0", n.addEventListener("contextmenu", v.noContextMenu), n.addEventListener("pointerdown", (C) => C.stopPropagation());
          const p = (C) => {
            C.preventDefault(), this.#a._uiManager.editAltText(this.#a);
          };
          return n.addEventListener("click", p, {
            capture: !0
          }), n.addEventListener("keydown", (C) => {
            C.target === n && C.key === "Enter" && (this.#i = !0, p(C));
          }), await this.#h(), n;
        }
        finish() {
          this.#s && (this.#s.focus({
            focusVisible: this.#i
          }), this.#i = !1);
        }
        isEmpty() {
          return !this.#t && !this.#e;
        }
        get data() {
          return {
            altText: this.#t,
            decorative: this.#e
          };
        }
        set data({
          altText: n,
          decorative: f
        }) {
          this.#t === n && this.#e === f || (this.#t = n, this.#e = f, this.#h());
        }
        toggle(n = !1) {
          this.#s && (!n && this.#r && (clearTimeout(this.#r), this.#r = null), this.#s.disabled = !n);
        }
        destroy() {
          this.#s?.remove(), this.#s = null, this.#n = null;
        }
        async #h() {
          const n = this.#s;
          if (!n)
            return;
          if (!this.#t && !this.#e) {
            n.classList.remove("done"), this.#n?.remove();
            return;
          }
          n.classList.add("done"), x._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((C) => {
            n.setAttribute("aria-label", C);
          });
          let f = this.#n;
          if (!f) {
            this.#n = f = document.createElement("span"), f.className = "tooltip", f.setAttribute("role", "tooltip");
            const C = f.id = `alt-text-tooltip-${this.#a.id}`;
            n.setAttribute("aria-describedby", C);
            const r = 100;
            n.addEventListener("mouseenter", () => {
              this.#r = setTimeout(() => {
                this.#r = null, this.#n.classList.add("show"), this.#a._reportTelemetry({
                  action: "alt_text_tooltip"
                });
              }, r);
            }), n.addEventListener("mouseleave", () => {
              this.#r && (clearTimeout(this.#r), this.#r = null), this.#n?.classList.remove("show");
            });
          }
          f.innerText = this.#e ? await x._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip") : this.#t, f.parentNode || n.append(f), this.#a.getImageForAltText()?.setAttribute("aria-describedby", f.id);
        }
      }
      var m = i(362);
      class l {
        #t = null;
        #e = null;
        #s = !1;
        #n = !1;
        #r = null;
        #i = null;
        #a = this.focusin.bind(this);
        #h = this.focusout.bind(this);
        #l = null;
        #d = "";
        #u = !1;
        #c = null;
        #o = !1;
        #p = !1;
        #g = !1;
        #f = null;
        #v = 0;
        #m = 0;
        #A = null;
        _initialOptions = /* @__PURE__ */ Object.create(null);
        _isVisible = !0;
        _uiManager = null;
        _focusEventsAllowed = !0;
        _l10nPromise = null;
        #w = !1;
        #T = l._zIndex++;
        static _borderLineWidth = -1;
        static _colorManager = new e.ColorManager();
        static _zIndex = 1;
        static _telemetryTimeout = 1e3;
        static get _resizerKeyboardManager() {
          const n = l.prototype._resizeWithKeyboard, f = e.AnnotationEditorUIManager.TRANSLATE_SMALL, p = e.AnnotationEditorUIManager.TRANSLATE_BIG;
          return (0, y.shadow)(this, "_resizerKeyboardManager", new e.KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], n, {
            args: [-f, 0]
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], n, {
            args: [-p, 0]
          }], [["ArrowRight", "mac+ArrowRight"], n, {
            args: [f, 0]
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], n, {
            args: [p, 0]
          }], [["ArrowUp", "mac+ArrowUp"], n, {
            args: [0, -f]
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], n, {
            args: [0, -p]
          }], [["ArrowDown", "mac+ArrowDown"], n, {
            args: [0, f]
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], n, {
            args: [0, p]
          }], [["Escape", "mac+Escape"], l.prototype._stopResizingWithKeyboard]]));
        }
        constructor(n) {
          this.constructor === l && (0, y.unreachable)("Cannot initialize AnnotationEditor."), this.parent = n.parent, this.id = n.id, this.width = this.height = null, this.pageIndex = n.parent.pageIndex, this.name = n.name, this.div = null, this._uiManager = n.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = n.isCentered, this._structTreeParentId = null;
          const {
            rotation: f,
            rawDims: {
              pageWidth: p,
              pageHeight: C,
              pageX: r,
              pageY: w
            }
          } = this.parent.viewport;
          this.rotation = f, this.pageRotation = (360 + f - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [p, C], this.pageTranslation = [r, w];
          const [t, o] = this.parentDimensions;
          this.x = n.x / t, this.y = n.y / o, this.isAttachedToDOM = !1, this.deleted = !1;
        }
        get editorType() {
          return Object.getPrototypeOf(this).constructor._type;
        }
        static get _defaultLineColor() {
          return (0, y.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
        }
        static deleteAnnotationElement(n) {
          const f = new g({
            id: n.parent.getNextId(),
            parent: n.parent,
            uiManager: n._uiManager
          });
          f.annotationElementId = n.annotationElementId, f.deleted = !0, f._uiManager.addToAnnotationStorage(f);
        }
        static initialize(n, f, p) {
          if (l._l10nPromise ||= new Map(["pdfjs-editor-alt-text-button-label", "pdfjs-editor-alt-text-edit-button-label", "pdfjs-editor-alt-text-decorative-tooltip", "pdfjs-editor-resizer-label-topLeft", "pdfjs-editor-resizer-label-topMiddle", "pdfjs-editor-resizer-label-topRight", "pdfjs-editor-resizer-label-middleRight", "pdfjs-editor-resizer-label-bottomRight", "pdfjs-editor-resizer-label-bottomMiddle", "pdfjs-editor-resizer-label-bottomLeft", "pdfjs-editor-resizer-label-middleLeft"].map((r) => [r, n.get(r.replaceAll(/([A-Z])/g, (w) => `-${w.toLowerCase()}`))])), p?.strings)
            for (const r of p.strings)
              l._l10nPromise.set(r, n.get(r));
          if (l._borderLineWidth !== -1)
            return;
          const C = getComputedStyle(document.documentElement);
          l._borderLineWidth = parseFloat(C.getPropertyValue("--outline-width")) || 0;
        }
        static updateDefaultParams(n, f) {
        }
        static get defaultPropertiesToUpdate() {
          return [];
        }
        static isHandlingMimeForPasting(n) {
          return !1;
        }
        static paste(n, f) {
          (0, y.unreachable)("Not implemented");
        }
        get propertiesToUpdate() {
          return [];
        }
        get _isDraggable() {
          return this.#w;
        }
        set _isDraggable(n) {
          this.#w = n, this.div?.classList.toggle("draggable", n);
        }
        get isEnterHandled() {
          return !0;
        }
        center() {
          const [n, f] = this.pageDimensions;
          switch (this.parentRotation) {
            case 90:
              this.x -= this.height * f / (n * 2), this.y += this.width * n / (f * 2);
              break;
            case 180:
              this.x += this.width / 2, this.y += this.height / 2;
              break;
            case 270:
              this.x += this.height * f / (n * 2), this.y -= this.width * n / (f * 2);
              break;
            default:
              this.x -= this.width / 2, this.y -= this.height / 2;
              break;
          }
          this.fixAndSetPosition();
        }
        addCommands(n) {
          this._uiManager.addCommands(n);
        }
        get currentLayer() {
          return this._uiManager.currentLayer;
        }
        setInBackground() {
          this.div.style.zIndex = 0;
        }
        setInForeground() {
          this.div.style.zIndex = this.#T;
        }
        setParent(n) {
          n !== null ? (this.pageIndex = n.pageIndex, this.pageDimensions = n.pageDimensions) : this.#N(), this.parent = n;
        }
        focusin(n) {
          this._focusEventsAllowed && (this.#u ? this.#u = !1 : this.parent.setSelected(this));
        }
        focusout(n) {
          !this._focusEventsAllowed || !this.isAttachedToDOM || n.relatedTarget?.closest(`#${this.id}`) || (n.preventDefault(), this.parent?.isMultipleSelection || this.commitOrRemove());
        }
        commitOrRemove() {
          this.isEmpty() ? this.remove() : this.commit();
        }
        commit() {
          this.addToAnnotationStorage();
        }
        addToAnnotationStorage() {
          this._uiManager.addToAnnotationStorage(this);
        }
        setAt(n, f, p, C) {
          const [r, w] = this.parentDimensions;
          [p, C] = this.screenToPageTranslation(p, C), this.x = (n + p) / r, this.y = (f + C) / w, this.fixAndSetPosition();
        }
        #k([n, f], p, C) {
          [p, C] = this.screenToPageTranslation(p, C), this.x += p / n, this.y += C / f, this.fixAndSetPosition();
        }
        translate(n, f) {
          this.#k(this.parentDimensions, n, f);
        }
        translateInPage(n, f) {
          this.#c ||= [this.x, this.y], this.#k(this.pageDimensions, n, f), this.div.scrollIntoView({
            block: "nearest"
          });
        }
        drag(n, f) {
          this.#c ||= [this.x, this.y];
          const [p, C] = this.parentDimensions;
          if (this.x += n / p, this.y += f / C, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
            const {
              x: A,
              y: b
            } = this.div.getBoundingClientRect();
            this.parent.findNewParent(this, A, b) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
          }
          let {
            x: r,
            y: w
          } = this;
          const [t, o] = this.getBaseTranslation();
          r += t, w += o, this.div.style.left = `${(100 * r).toFixed(2)}%`, this.div.style.top = `${(100 * w).toFixed(2)}%`, this.div.scrollIntoView({
            block: "nearest"
          });
        }
        get _hasBeenMoved() {
          return !!this.#c && (this.#c[0] !== this.x || this.#c[1] !== this.y);
        }
        getBaseTranslation() {
          const [n, f] = this.parentDimensions, {
            _borderLineWidth: p
          } = l, C = p / n, r = p / f;
          switch (this.rotation) {
            case 90:
              return [-C, r];
            case 180:
              return [C, r];
            case 270:
              return [C, -r];
            default:
              return [-C, -r];
          }
        }
        get _mustFixPosition() {
          return !0;
        }
        fixAndSetPosition(n = this.rotation) {
          const [f, p] = this.pageDimensions;
          let {
            x: C,
            y: r,
            width: w,
            height: t
          } = this;
          if (w *= f, t *= p, C *= f, r *= p, this._mustFixPosition)
            switch (n) {
              case 0:
                C = Math.max(0, Math.min(f - w, C)), r = Math.max(0, Math.min(p - t, r));
                break;
              case 90:
                C = Math.max(0, Math.min(f - t, C)), r = Math.min(p, Math.max(w, r));
                break;
              case 180:
                C = Math.min(f, Math.max(w, C)), r = Math.min(p, Math.max(t, r));
                break;
              case 270:
                C = Math.min(f, Math.max(t, C)), r = Math.max(0, Math.min(p - w, r));
                break;
            }
          this.x = C /= f, this.y = r /= p;
          const [o, A] = this.getBaseTranslation();
          C += o, r += A;
          const {
            style: b
          } = this.div;
          b.left = `${(100 * C).toFixed(2)}%`, b.top = `${(100 * r).toFixed(2)}%`, this.moveInDOM();
        }
        static #M(n, f, p) {
          switch (p) {
            case 90:
              return [f, -n];
            case 180:
              return [-n, -f];
            case 270:
              return [-f, n];
            default:
              return [n, f];
          }
        }
        screenToPageTranslation(n, f) {
          return l.#M(n, f, this.parentRotation);
        }
        pageTranslationToScreen(n, f) {
          return l.#M(n, f, 360 - this.parentRotation);
        }
        #L(n) {
          switch (n) {
            case 90: {
              const [f, p] = this.pageDimensions;
              return [0, -f / p, p / f, 0];
            }
            case 180:
              return [-1, 0, 0, -1];
            case 270: {
              const [f, p] = this.pageDimensions;
              return [0, f / p, -p / f, 0];
            }
            default:
              return [1, 0, 0, 1];
          }
        }
        get parentScale() {
          return this._uiManager.viewParameters.realScale;
        }
        get parentRotation() {
          return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
        }
        get parentDimensions() {
          const {
            parentScale: n,
            pageDimensions: [f, p]
          } = this, C = f * n, r = p * n;
          return y.FeatureTest.isCSSRoundSupported ? [Math.round(C), Math.round(r)] : [C, r];
        }
        setDims(n, f) {
          const [p, C] = this.parentDimensions;
          this.div.style.width = `${(100 * n / p).toFixed(2)}%`, this.#n || (this.div.style.height = `${(100 * f / C).toFixed(2)}%`);
        }
        fixDims() {
          const {
            style: n
          } = this.div, {
            height: f,
            width: p
          } = n, C = p.endsWith("%"), r = !this.#n && f.endsWith("%");
          if (C && r)
            return;
          const [w, t] = this.parentDimensions;
          C || (n.width = `${(100 * parseFloat(p) / w).toFixed(2)}%`), !this.#n && !r && (n.height = `${(100 * parseFloat(f) / t).toFixed(2)}%`);
        }
        getInitialTranslation() {
          return [0, 0];
        }
        #y() {
          if (this.#r)
            return;
          this.#r = document.createElement("div"), this.#r.classList.add("resizers");
          const n = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"];
          for (const f of n) {
            const p = document.createElement("div");
            this.#r.append(p), p.classList.add("resizer", f), p.setAttribute("data-resizer-name", f), p.addEventListener("pointerdown", this.#b.bind(this, f)), p.addEventListener("contextmenu", v.noContextMenu), p.tabIndex = -1;
          }
          this.div.prepend(this.#r);
        }
        #b(n, f) {
          f.preventDefault();
          const {
            isMac: p
          } = y.FeatureTest.platform;
          if (f.button !== 0 || f.ctrlKey && p)
            return;
          this.#e?.toggle(!1);
          const C = this.#_.bind(this, n), r = this._isDraggable;
          this._isDraggable = !1;
          const w = {
            passive: !0,
            capture: !0
          };
          this.parent.togglePointerEvents(!1), window.addEventListener("pointermove", C, w), window.addEventListener("contextmenu", v.noContextMenu);
          const t = this.x, o = this.y, A = this.width, b = this.height, R = this.parent.div.style.cursor, L = this.div.style.cursor;
          this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(f.target).cursor;
          const D = () => {
            this.parent.togglePointerEvents(!0), this.#e?.toggle(!0), this._isDraggable = r, window.removeEventListener("pointerup", D), window.removeEventListener("blur", D), window.removeEventListener("pointermove", C, w), window.removeEventListener("contextmenu", v.noContextMenu), this.parent.div.style.cursor = R, this.div.style.cursor = L, this.#S(t, o, A, b);
          };
          window.addEventListener("pointerup", D), window.addEventListener("blur", D);
        }
        #S(n, f, p, C) {
          const r = this.x, w = this.y, t = this.width, o = this.height;
          r === n && w === f && t === p && o === C || this.addCommands({
            cmd: () => {
              this.width = t, this.height = o, this.x = r, this.y = w;
              const [A, b] = this.parentDimensions;
              this.setDims(A * t, b * o), this.fixAndSetPosition();
            },
            undo: () => {
              this.width = p, this.height = C, this.x = n, this.y = f;
              const [A, b] = this.parentDimensions;
              this.setDims(A * p, b * C), this.fixAndSetPosition();
            },
            mustExec: !0
          });
        }
        #_(n, f) {
          const [p, C] = this.parentDimensions, r = this.x, w = this.y, t = this.width, o = this.height, A = l.MIN_SIZE / p, b = l.MIN_SIZE / C, R = (k) => Math.round(k * 1e4) / 1e4, L = this.#L(this.rotation), D = (k, S) => [L[0] * k + L[2] * S, L[1] * k + L[3] * S], H = this.#L(360 - this.rotation), X = (k, S) => [H[0] * k + H[2] * S, H[1] * k + H[3] * S];
          let V, q, tt = !1, rt = !1;
          switch (n) {
            case "topLeft":
              tt = !0, V = (k, S) => [0, 0], q = (k, S) => [k, S];
              break;
            case "topMiddle":
              V = (k, S) => [k / 2, 0], q = (k, S) => [k / 2, S];
              break;
            case "topRight":
              tt = !0, V = (k, S) => [k, 0], q = (k, S) => [0, S];
              break;
            case "middleRight":
              rt = !0, V = (k, S) => [k, S / 2], q = (k, S) => [0, S / 2];
              break;
            case "bottomRight":
              tt = !0, V = (k, S) => [k, S], q = (k, S) => [0, 0];
              break;
            case "bottomMiddle":
              V = (k, S) => [k / 2, S], q = (k, S) => [k / 2, 0];
              break;
            case "bottomLeft":
              tt = !0, V = (k, S) => [0, S], q = (k, S) => [k, 0];
              break;
            case "middleLeft":
              rt = !0, V = (k, S) => [0, S / 2], q = (k, S) => [k, S / 2];
              break;
          }
          const Y = V(t, o), B = q(t, o);
          let U = D(...B);
          const j = R(r + U[0]), Q = R(w + U[1]);
          let J = 1, it = 1, [ht, ot] = this.screenToPageTranslation(f.movementX, f.movementY);
          if ([ht, ot] = X(ht / p, ot / C), tt) {
            const k = Math.hypot(t, o);
            J = it = Math.max(Math.min(Math.hypot(B[0] - Y[0] - ht, B[1] - Y[1] - ot) / k, 1 / t, 1 / o), A / t, b / o);
          } else
            rt ? J = Math.max(A, Math.min(1, Math.abs(B[0] - Y[0] - ht))) / t : it = Math.max(b, Math.min(1, Math.abs(B[1] - Y[1] - ot))) / o;
          const Z = R(t * J), lt = R(o * it);
          U = D(...q(Z, lt));
          const ct = j - U[0], $ = Q - U[1];
          this.width = Z, this.height = lt, this.x = ct, this.y = $, this.setDims(p * Z, C * lt), this.fixAndSetPosition();
        }
        altTextFinish() {
          this.#e?.finish();
        }
        async addEditToolbar() {
          return this.#l || this.#p ? this.#l : (this.#l = new m.EditorToolbar(this), this.div.append(this.#l.render()), this.#e && this.#l.addAltTextButton(await this.#e.render()), this.#l);
        }
        removeEditToolbar() {
          this.#l && (this.#l.remove(), this.#l = null, this.#e?.destroy());
        }
        getClientDimensions() {
          return this.div.getBoundingClientRect();
        }
        async addAltTextButton() {
          this.#e || (x.initialize(l._l10nPromise), this.#e = new x(this), await this.addEditToolbar());
        }
        get altTextData() {
          return this.#e?.data;
        }
        set altTextData(n) {
          this.#e && (this.#e.data = n);
        }
        hasAltText() {
          return !this.#e?.isEmpty();
        }
        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.tabIndex = this.#s ? -1 : 0, this._isVisible || this.div.classList.add("hidden"), this.setInForeground(), this.div.addEventListener("focusin", this.#a), this.div.addEventListener("focusout", this.#h);
          const [n, f] = this.parentDimensions;
          this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * f / n).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * n / f).toFixed(2)}%`);
          const [p, C] = this.getInitialTranslation();
          return this.translate(p, C), (0, e.bindEvents)(this, this.div, ["pointerdown"]), this.div;
        }
        pointerdown(n) {
          const {
            isMac: f
          } = y.FeatureTest.platform;
          if (n.button !== 0 || n.ctrlKey && f) {
            n.preventDefault();
            return;
          }
          if (this.#u = !0, this._isDraggable) {
            this.#C(n);
            return;
          }
          this.#x(n);
        }
        #x(n) {
          const {
            isMac: f
          } = y.FeatureTest.platform;
          n.ctrlKey && !f || n.shiftKey || n.metaKey && f ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
        }
        #C(n) {
          const f = this._uiManager.isSelected(this);
          this._uiManager.setUpDragSession();
          let p, C;
          f && (this.div.classList.add("moving"), p = {
            passive: !0,
            capture: !0
          }, this.#v = n.clientX, this.#m = n.clientY, C = (w) => {
            const {
              clientX: t,
              clientY: o
            } = w, [A, b] = this.screenToPageTranslation(t - this.#v, o - this.#m);
            this.#v = t, this.#m = o, this._uiManager.dragSelectedEditors(A, b);
          }, window.addEventListener("pointermove", C, p));
          const r = () => {
            window.removeEventListener("pointerup", r), window.removeEventListener("blur", r), f && (this.div.classList.remove("moving"), window.removeEventListener("pointermove", C, p)), this.#u = !1, this._uiManager.endDragSession() || this.#x(n);
          };
          window.addEventListener("pointerup", r), window.addEventListener("blur", r);
        }
        moveInDOM() {
          this.#f && clearTimeout(this.#f), this.#f = setTimeout(() => {
            this.#f = null, this.parent?.moveEditorInDOM(this);
          }, 0);
        }
        _setParentAndPosition(n, f, p) {
          n.changeParent(this), this.x = f, this.y = p, this.fixAndSetPosition();
        }
        getRect(n, f, p = this.rotation) {
          const C = this.parentScale, [r, w] = this.pageDimensions, [t, o] = this.pageTranslation, A = n / C, b = f / C, R = this.x * r, L = this.y * w, D = this.width * r, H = this.height * w;
          switch (p) {
            case 0:
              return [R + A + t, w - L - b - H + o, R + A + D + t, w - L - b + o];
            case 90:
              return [R + b + t, w - L + A + o, R + b + H + t, w - L + A + D + o];
            case 180:
              return [R - A - D + t, w - L + b + o, R - A + t, w - L + b + H + o];
            case 270:
              return [R - b - H + t, w - L - A - D + o, R - b + t, w - L - A + o];
            default:
              throw new Error("Invalid rotation");
          }
        }
        getRectInCurrentCoords(n, f) {
          const [p, C, r, w] = n, t = r - p, o = w - C;
          switch (this.rotation) {
            case 0:
              return [p, f - w, t, o];
            case 90:
              return [p, f - C, o, t];
            case 180:
              return [r, f - C, t, o];
            case 270:
              return [r, f - w, o, t];
            default:
              throw new Error("Invalid rotation");
          }
        }
        onceAdded() {
        }
        isEmpty() {
          return !1;
        }
        enableEditMode() {
          this.#p = !0;
        }
        disableEditMode() {
          this.#p = !1;
        }
        isInEditMode() {
          return this.#p;
        }
        shouldGetKeyboardEvents() {
          return this.#g;
        }
        needsToBeRebuilt() {
          return this.div && !this.isAttachedToDOM;
        }
        rebuild() {
          this.div?.addEventListener("focusin", this.#a), this.div?.addEventListener("focusout", this.#h);
        }
        rotate(n) {
        }
        serialize(n = !1, f = null) {
          (0, y.unreachable)("An editor must be serializable");
        }
        static deserialize(n, f, p) {
          const C = new this.prototype.constructor({
            parent: f,
            id: f.getNextId(),
            uiManager: p
          });
          C.rotation = n.rotation;
          const [r, w] = C.pageDimensions, [t, o, A, b] = C.getRectInCurrentCoords(n.rect, w);
          return C.x = t / r, C.y = o / w, C.width = A / r, C.height = b / w, C;
        }
        get hasBeenModified() {
          return !!this.annotationElementId && (this.deleted || this.serialize() !== null);
        }
        remove() {
          if (this.div.removeEventListener("focusin", this.#a), this.div.removeEventListener("focusout", this.#h), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), this.#f && (clearTimeout(this.#f), this.#f = null), this.#N(), this.removeEditToolbar(), this.#A) {
            for (const n of this.#A.values())
              clearTimeout(n);
            this.#A = null;
          }
          this.parent = null;
        }
        get isResizable() {
          return !1;
        }
        makeResizable() {
          this.isResizable && (this.#y(), this.#r.classList.remove("hidden"), (0, e.bindEvents)(this, this.div, ["keydown"]));
        }
        get toolbarPosition() {
          return null;
        }
        keydown(n) {
          if (!this.isResizable || n.target !== this.div || n.key !== "Enter")
            return;
          this._uiManager.setSelected(this), this.#i = {
            savedX: this.x,
            savedY: this.y,
            savedWidth: this.width,
            savedHeight: this.height
          };
          const f = this.#r.children;
          if (!this.#t) {
            this.#t = Array.from(f);
            const w = this.#P.bind(this), t = this.#R.bind(this);
            for (const o of this.#t) {
              const A = o.getAttribute("data-resizer-name");
              o.setAttribute("role", "spinbutton"), o.addEventListener("keydown", w), o.addEventListener("blur", t), o.addEventListener("focus", this.#I.bind(this, A)), l._l10nPromise.get(`pdfjs-editor-resizer-label-${A}`).then((b) => o.setAttribute("aria-label", b));
            }
          }
          const p = this.#t[0];
          let C = 0;
          for (const w of f) {
            if (w === p)
              break;
            C++;
          }
          const r = (360 - this.rotation + this.parentRotation) % 360 / 90 * (this.#t.length / 4);
          if (r !== C) {
            if (r < C)
              for (let t = 0; t < C - r; t++)
                this.#r.append(this.#r.firstChild);
            else if (r > C)
              for (let t = 0; t < r - C; t++)
                this.#r.firstChild.before(this.#r.lastChild);
            let w = 0;
            for (const t of f) {
              const A = this.#t[w++].getAttribute("data-resizer-name");
              l._l10nPromise.get(`pdfjs-editor-resizer-label-${A}`).then((b) => t.setAttribute("aria-label", b));
            }
          }
          this.#F(0), this.#g = !0, this.#r.firstChild.focus({
            focusVisible: !0
          }), n.preventDefault(), n.stopImmediatePropagation();
        }
        #P(n) {
          l._resizerKeyboardManager.exec(this, n);
        }
        #R(n) {
          this.#g && n.relatedTarget?.parentNode !== this.#r && this.#N();
        }
        #I(n) {
          this.#d = this.#g ? n : "";
        }
        #F(n) {
          if (this.#t)
            for (const f of this.#t)
              f.tabIndex = n;
        }
        _resizeWithKeyboard(n, f) {
          this.#g && this.#_(this.#d, {
            movementX: n,
            movementY: f
          });
        }
        #N() {
          if (this.#g = !1, this.#F(-1), this.#i) {
            const {
              savedX: n,
              savedY: f,
              savedWidth: p,
              savedHeight: C
            } = this.#i;
            this.#S(n, f, p, C), this.#i = null;
          }
        }
        _stopResizingWithKeyboard() {
          this.#N(), this.div.focus();
        }
        select() {
          if (this.makeResizable(), this.div?.classList.add("selectedEditor"), !this.#l) {
            this.addEditToolbar().then(() => {
              this.div?.classList.contains("selectedEditor") && this.#l?.show();
            });
            return;
          }
          this.#l?.show();
        }
        unselect() {
          this.#r?.classList.add("hidden"), this.div?.classList.remove("selectedEditor"), this.div?.contains(document.activeElement) && this._uiManager.currentLayer.div.focus({
            preventScroll: !0
          }), this.#l?.hide();
        }
        updateParams(n, f) {
        }
        disableEditing() {
        }
        enableEditing() {
        }
        enterInEditMode() {
        }
        getImageForAltText() {
          return null;
        }
        get contentDiv() {
          return this.div;
        }
        get isEditing() {
          return this.#o;
        }
        set isEditing(n) {
          this.#o = n, this.parent && (n ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
        }
        setAspectRatio(n, f) {
          this.#n = !0;
          const p = n / f, {
            style: C
          } = this.div;
          C.aspectRatio = p, C.height = "auto";
        }
        static get MIN_SIZE() {
          return 16;
        }
        static canCreateNewEmptyEditor() {
          return !0;
        }
        get telemetryInitialData() {
          return {
            action: "added"
          };
        }
        get telemetryFinalData() {
          return null;
        }
        _reportTelemetry(n, f = !1) {
          if (f) {
            this.#A ||= /* @__PURE__ */ new Map();
            const {
              action: p
            } = n;
            let C = this.#A.get(p);
            C && clearTimeout(C), C = setTimeout(() => {
              this._reportTelemetry(n), this.#A.delete(p), this.#A.size === 0 && (this.#A = null);
            }, l._telemetryTimeout), this.#A.set(p, C);
            return;
          }
          n.type ||= this.editorType, this._uiManager._eventBus.dispatch("reporttelemetry", {
            source: this,
            details: {
              type: "editing",
              data: n
            }
          });
        }
        show(n = this._isVisible) {
          this.div.classList.toggle("hidden", !n), this._isVisible = n;
        }
        enable() {
          this.div && (this.div.tabIndex = 0), this.#s = !1;
        }
        disable() {
          this.div && (this.div.tabIndex = -1), this.#s = !0;
        }
        renderAnnotationElement(n) {
          let f = n.container.querySelector(".annotationContent");
          if (!f)
            f = document.createElement("div"), f.classList.add("annotationContent", this.editorType), n.container.prepend(f);
          else if (f.nodeName === "CANVAS") {
            const p = f;
            f = document.createElement("div"), f.classList.add("annotationContent", this.editorType), p.before(f);
          }
          return f;
        }
        resetAnnotationElement(n) {
          const {
            firstChild: f
          } = n.container;
          f.nodeName === "DIV" && f.classList.contains("annotationContent") && f.remove();
        }
      }
      class g extends l {
        constructor(n) {
          super(n), this.annotationElementId = n.annotationElementId, this.deleted = !0;
        }
        serialize() {
          return {
            id: this.annotationElementId,
            deleted: !0,
            pageIndex: this.pageIndex
          };
        }
      }
    }
  ),
  /***/
  61: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        FreeOutliner: () => (
          /* binding */
          m
        ),
        /* harmony export */
        Outliner: () => (
          /* binding */
          y
        )
        /* harmony export */
      });
      var e = i(292);
      class y {
        #t;
        #e = [];
        #s = [];
        constructor(h, n = 0, f = 0, p = !0) {
          let C = 1 / 0, r = -1 / 0, w = 1 / 0, t = -1 / 0;
          const A = 10 ** -4;
          for (const {
            x: V,
            y: q,
            width: tt,
            height: rt
          } of h) {
            const Y = Math.floor((V - n) / A) * A, B = Math.ceil((V + tt + n) / A) * A, U = Math.floor((q - n) / A) * A, j = Math.ceil((q + rt + n) / A) * A, Q = [Y, U, j, !0], J = [B, U, j, !1];
            this.#e.push(Q, J), C = Math.min(C, Y), r = Math.max(r, B), w = Math.min(w, U), t = Math.max(t, j);
          }
          const b = r - C + 2 * f, R = t - w + 2 * f, L = C - f, D = w - f, H = this.#e.at(p ? -1 : -2), X = [H[0], H[2]];
          for (const V of this.#e) {
            const [q, tt, rt] = V;
            V[0] = (q - L) / b, V[1] = (tt - D) / R, V[2] = (rt - D) / R;
          }
          this.#t = {
            x: L,
            y: D,
            width: b,
            height: R,
            lastPoint: X
          };
        }
        getOutlines() {
          this.#e.sort((n, f) => n[0] - f[0] || n[1] - f[1] || n[2] - f[2]);
          const h = [];
          for (const n of this.#e)
            n[3] ? (h.push(...this.#h(n)), this.#i(n)) : (this.#a(n), h.push(...this.#h(n)));
          return this.#n(h);
        }
        #n(h) {
          const n = [], f = /* @__PURE__ */ new Set();
          for (const r of h) {
            const [w, t, o] = r;
            n.push([w, t, r], [w, o, r]);
          }
          n.sort((r, w) => r[1] - w[1] || r[0] - w[0]);
          for (let r = 0, w = n.length; r < w; r += 2) {
            const t = n[r][2], o = n[r + 1][2];
            t.push(o), o.push(t), f.add(t), f.add(o);
          }
          const p = [];
          let C;
          for (; f.size > 0; ) {
            const r = f.values().next().value;
            let [w, t, o, A, b] = r;
            f.delete(r);
            let R = w, L = t;
            for (C = [w, o], p.push(C); ; ) {
              let D;
              if (f.has(A))
                D = A;
              else if (f.has(b))
                D = b;
              else
                break;
              f.delete(D), [w, t, o, A, b] = D, R !== w && (C.push(R, L, w, L === t ? t : o), R = w), L = L === t ? o : t;
            }
            C.push(R, L);
          }
          return new x(p, this.#t);
        }
        #r(h) {
          const n = this.#s;
          let f = 0, p = n.length - 1;
          for (; f <= p; ) {
            const C = f + p >> 1, r = n[C][0];
            if (r === h)
              return C;
            r < h ? f = C + 1 : p = C - 1;
          }
          return p + 1;
        }
        #i([, h, n]) {
          const f = this.#r(h);
          this.#s.splice(f, 0, [h, n]);
        }
        #a([, h, n]) {
          const f = this.#r(h);
          for (let p = f; p < this.#s.length; p++) {
            const [C, r] = this.#s[p];
            if (C !== h)
              break;
            if (C === h && r === n) {
              this.#s.splice(p, 1);
              return;
            }
          }
          for (let p = f - 1; p >= 0; p--) {
            const [C, r] = this.#s[p];
            if (C !== h)
              break;
            if (C === h && r === n) {
              this.#s.splice(p, 1);
              return;
            }
          }
        }
        #h(h) {
          const [n, f, p] = h, C = [[n, f, p]], r = this.#r(p);
          for (let w = 0; w < r; w++) {
            const [t, o] = this.#s[w];
            for (let A = 0, b = C.length; A < b; A++) {
              const [, R, L] = C[A];
              if (!(o <= R || L <= t)) {
                if (R >= t) {
                  if (L > o)
                    C[A][1] = o;
                  else {
                    if (b === 1)
                      return [];
                    C.splice(A, 1), A--, b--;
                  }
                  continue;
                }
                C[A][2] = t, L > o && C.push([n, o, L]);
              }
            }
          }
          return C;
        }
      }
      class v {
        toSVGPath() {
          throw new Error("Abstract method `toSVGPath` must be implemented.");
        }
        get box() {
          throw new Error("Abstract getter `box` must be implemented.");
        }
        serialize(h, n) {
          throw new Error("Abstract method `serialize` must be implemented.");
        }
        get free() {
          return this instanceof l;
        }
      }
      class x extends v {
        #t;
        #e;
        constructor(h, n) {
          super(), this.#e = h, this.#t = n;
        }
        toSVGPath() {
          const h = [];
          for (const n of this.#e) {
            let [f, p] = n;
            h.push(`M${f} ${p}`);
            for (let C = 2; C < n.length; C += 2) {
              const r = n[C], w = n[C + 1];
              r === f ? (h.push(`V${w}`), p = w) : w === p && (h.push(`H${r}`), f = r);
            }
            h.push("Z");
          }
          return h.join(" ");
        }
        serialize([h, n, f, p], C) {
          const r = [], w = f - h, t = p - n;
          for (const o of this.#e) {
            const A = new Array(o.length);
            for (let b = 0; b < o.length; b += 2)
              A[b] = h + o[b] * w, A[b + 1] = p - o[b + 1] * t;
            r.push(A);
          }
          return r;
        }
        get box() {
          return this.#t;
        }
      }
      class m {
        #t;
        #e = [];
        #s;
        #n;
        #r = [];
        #i = new Float64Array(18);
        #a;
        #h;
        #l;
        #d;
        #u;
        #c;
        #o = [];
        static #p = 8;
        static #g = 2;
        static #f = m.#p + m.#g;
        constructor({
          x: h,
          y: n
        }, f, p, C, r, w = 0) {
          this.#t = f, this.#c = C * p, this.#n = r, this.#i.set([NaN, NaN, NaN, NaN, h, n], 6), this.#s = w, this.#d = m.#p * p, this.#l = m.#f * p, this.#u = p, this.#o.push(h, n);
        }
        get free() {
          return !0;
        }
        isEmpty() {
          return isNaN(this.#i[8]);
        }
        #v() {
          const h = this.#i.subarray(4, 6), n = this.#i.subarray(16, 18), [f, p, C, r] = this.#t;
          return [(this.#a + (h[0] - n[0]) / 2 - f) / C, (this.#h + (h[1] - n[1]) / 2 - p) / r, (this.#a + (n[0] - h[0]) / 2 - f) / C, (this.#h + (n[1] - h[1]) / 2 - p) / r];
        }
        add({
          x: h,
          y: n
        }) {
          this.#a = h, this.#h = n;
          const [f, p, C, r] = this.#t;
          let [w, t, o, A] = this.#i.subarray(8, 12);
          const b = h - o, R = n - A, L = Math.hypot(b, R);
          if (L < this.#l)
            return !1;
          const D = L - this.#d, H = D / L, X = H * b, V = H * R;
          let q = w, tt = t;
          w = o, t = A, o += X, A += V, this.#o?.push(h, n);
          const rt = -V / D, Y = X / D, B = rt * this.#c, U = Y * this.#c;
          return this.#i.set(this.#i.subarray(2, 8), 0), this.#i.set([o + B, A + U], 4), this.#i.set(this.#i.subarray(14, 18), 12), this.#i.set([o - B, A - U], 16), isNaN(this.#i[6]) ? (this.#r.length === 0 && (this.#i.set([w + B, t + U], 2), this.#r.push(NaN, NaN, NaN, NaN, (w + B - f) / C, (t + U - p) / r), this.#i.set([w - B, t - U], 14), this.#e.push(NaN, NaN, NaN, NaN, (w - B - f) / C, (t - U - p) / r)), this.#i.set([q, tt, w, t, o, A], 6), !this.isEmpty()) : (this.#i.set([q, tt, w, t, o, A], 6), Math.abs(Math.atan2(tt - t, q - w) - Math.atan2(V, X)) < Math.PI / 2 ? ([w, t, o, A] = this.#i.subarray(2, 6), this.#r.push(NaN, NaN, NaN, NaN, ((w + o) / 2 - f) / C, ((t + A) / 2 - p) / r), [w, t, q, tt] = this.#i.subarray(14, 18), this.#e.push(NaN, NaN, NaN, NaN, ((q + w) / 2 - f) / C, ((tt + t) / 2 - p) / r), !0) : ([q, tt, w, t, o, A] = this.#i.subarray(0, 6), this.#r.push(((q + 5 * w) / 6 - f) / C, ((tt + 5 * t) / 6 - p) / r, ((5 * w + o) / 6 - f) / C, ((5 * t + A) / 6 - p) / r, ((w + o) / 2 - f) / C, ((t + A) / 2 - p) / r), [o, A, w, t, q, tt] = this.#i.subarray(12, 18), this.#e.push(((q + 5 * w) / 6 - f) / C, ((tt + 5 * t) / 6 - p) / r, ((5 * w + o) / 6 - f) / C, ((5 * t + A) / 6 - p) / r, ((w + o) / 2 - f) / C, ((t + A) / 2 - p) / r), !0));
        }
        toSVGPath() {
          if (this.isEmpty())
            return "";
          const h = this.#r, n = this.#e, f = this.#i.subarray(4, 6), p = this.#i.subarray(16, 18), [C, r, w, t] = this.#t, [o, A, b, R] = this.#v();
          if (isNaN(this.#i[6]) && !this.isEmpty())
            return `M${(this.#i[2] - C) / w} ${(this.#i[3] - r) / t} L${(this.#i[4] - C) / w} ${(this.#i[5] - r) / t} L${o} ${A} L${b} ${R} L${(this.#i[16] - C) / w} ${(this.#i[17] - r) / t} L${(this.#i[14] - C) / w} ${(this.#i[15] - r) / t} Z`;
          const L = [];
          L.push(`M${h[4]} ${h[5]}`);
          for (let D = 6; D < h.length; D += 6)
            isNaN(h[D]) ? L.push(`L${h[D + 4]} ${h[D + 5]}`) : L.push(`C${h[D]} ${h[D + 1]} ${h[D + 2]} ${h[D + 3]} ${h[D + 4]} ${h[D + 5]}`);
          L.push(`L${(f[0] - C) / w} ${(f[1] - r) / t} L${o} ${A} L${b} ${R} L${(p[0] - C) / w} ${(p[1] - r) / t}`);
          for (let D = n.length - 6; D >= 6; D -= 6)
            isNaN(n[D]) ? L.push(`L${n[D + 4]} ${n[D + 5]}`) : L.push(`C${n[D]} ${n[D + 1]} ${n[D + 2]} ${n[D + 3]} ${n[D + 4]} ${n[D + 5]}`);
          return L.push(`L${n[4]} ${n[5]} Z`), L.join(" ");
        }
        getOutlines() {
          const h = this.#r, n = this.#e, f = this.#i, p = f.subarray(4, 6), C = f.subarray(16, 18), [r, w, t, o] = this.#t, A = new Float64Array((this.#o?.length ?? 0) + 2);
          for (let V = 0, q = A.length - 2; V < q; V += 2)
            A[V] = (this.#o[V] - r) / t, A[V + 1] = (this.#o[V + 1] - w) / o;
          A[A.length - 2] = (this.#a - r) / t, A[A.length - 1] = (this.#h - w) / o;
          const [b, R, L, D] = this.#v();
          if (isNaN(f[6]) && !this.isEmpty()) {
            const V = new Float64Array(36);
            return V.set([NaN, NaN, NaN, NaN, (f[2] - r) / t, (f[3] - w) / o, NaN, NaN, NaN, NaN, (f[4] - r) / t, (f[5] - w) / o, NaN, NaN, NaN, NaN, b, R, NaN, NaN, NaN, NaN, L, D, NaN, NaN, NaN, NaN, (f[16] - r) / t, (f[17] - w) / o, NaN, NaN, NaN, NaN, (f[14] - r) / t, (f[15] - w) / o], 0), new l(V, A, this.#t, this.#u, this.#s, this.#n);
          }
          const H = new Float64Array(this.#r.length + 24 + this.#e.length);
          let X = h.length;
          for (let V = 0; V < X; V += 2) {
            if (isNaN(h[V])) {
              H[V] = H[V + 1] = NaN;
              continue;
            }
            H[V] = h[V], H[V + 1] = h[V + 1];
          }
          H.set([NaN, NaN, NaN, NaN, (p[0] - r) / t, (p[1] - w) / o, NaN, NaN, NaN, NaN, b, R, NaN, NaN, NaN, NaN, L, D, NaN, NaN, NaN, NaN, (C[0] - r) / t, (C[1] - w) / o], X), X += 24;
          for (let V = n.length - 6; V >= 6; V -= 6)
            for (let q = 0; q < 6; q += 2) {
              if (isNaN(n[V + q])) {
                H[X] = H[X + 1] = NaN, X += 2;
                continue;
              }
              H[X] = n[V + q], H[X + 1] = n[V + q + 1], X += 2;
            }
          return H.set([NaN, NaN, NaN, NaN, n[4], n[5]], X), new l(H, A, this.#t, this.#u, this.#s, this.#n);
        }
      }
      class l extends v {
        #t;
        #e = null;
        #s;
        #n;
        #r;
        #i;
        #a;
        constructor(h, n, f, p, C, r) {
          super(), this.#a = h, this.#r = n, this.#t = f, this.#i = p, this.#s = C, this.#n = r, this.#d(r);
          const {
            x: w,
            y: t,
            width: o,
            height: A
          } = this.#e;
          for (let b = 0, R = h.length; b < R; b += 2)
            h[b] = (h[b] - w) / o, h[b + 1] = (h[b + 1] - t) / A;
          for (let b = 0, R = n.length; b < R; b += 2)
            n[b] = (n[b] - w) / o, n[b + 1] = (n[b + 1] - t) / A;
        }
        toSVGPath() {
          const h = [`M${this.#a[4]} ${this.#a[5]}`];
          for (let n = 6, f = this.#a.length; n < f; n += 6) {
            if (isNaN(this.#a[n])) {
              h.push(`L${this.#a[n + 4]} ${this.#a[n + 5]}`);
              continue;
            }
            h.push(`C${this.#a[n]} ${this.#a[n + 1]} ${this.#a[n + 2]} ${this.#a[n + 3]} ${this.#a[n + 4]} ${this.#a[n + 5]}`);
          }
          return h.push("Z"), h.join(" ");
        }
        serialize([h, n, f, p], C) {
          const r = f - h, w = p - n;
          let t, o;
          switch (C) {
            case 0:
              t = this.#h(this.#a, h, p, r, -w), o = this.#h(this.#r, h, p, r, -w);
              break;
            case 90:
              t = this.#l(this.#a, h, n, r, w), o = this.#l(this.#r, h, n, r, w);
              break;
            case 180:
              t = this.#h(this.#a, f, n, -r, w), o = this.#h(this.#r, f, n, -r, w);
              break;
            case 270:
              t = this.#l(this.#a, f, p, -r, -w), o = this.#l(this.#r, f, p, -r, -w);
              break;
          }
          return {
            outline: Array.from(t),
            points: [Array.from(o)]
          };
        }
        #h(h, n, f, p, C) {
          const r = new Float64Array(h.length);
          for (let w = 0, t = h.length; w < t; w += 2)
            r[w] = n + h[w] * p, r[w + 1] = f + h[w + 1] * C;
          return r;
        }
        #l(h, n, f, p, C) {
          const r = new Float64Array(h.length);
          for (let w = 0, t = h.length; w < t; w += 2)
            r[w] = n + h[w + 1] * p, r[w + 1] = f + h[w] * C;
          return r;
        }
        #d(h) {
          const n = this.#a;
          let f = n[4], p = n[5], C = f, r = p, w = f, t = p, o = f, A = p;
          const b = h ? Math.max : Math.min;
          for (let X = 6, V = n.length; X < V; X += 6) {
            if (isNaN(n[X]))
              C = Math.min(C, n[X + 4]), r = Math.min(r, n[X + 5]), w = Math.max(w, n[X + 4]), t = Math.max(t, n[X + 5]), A < n[X + 5] ? (o = n[X + 4], A = n[X + 5]) : A === n[X + 5] && (o = b(o, n[X + 4]));
            else {
              const q = e.Util.bezierBoundingBox(f, p, ...n.slice(X, X + 6));
              C = Math.min(C, q[0]), r = Math.min(r, q[1]), w = Math.max(w, q[2]), t = Math.max(t, q[3]), A < q[3] ? (o = q[2], A = q[3]) : A === q[3] && (o = b(o, q[2]));
            }
            f = n[X + 4], p = n[X + 5];
          }
          const R = C - this.#s, L = r - this.#s, D = w - C + 2 * this.#s, H = t - r + 2 * this.#s;
          this.#e = {
            x: R,
            y: L,
            width: D,
            height: H,
            lastPoint: [o, A]
          };
        }
        get box() {
          return this.#e;
        }
        getNewOutline(h, n) {
          const {
            x: f,
            y: p,
            width: C,
            height: r
          } = this.#e, [w, t, o, A] = this.#t, b = C * o, R = r * A, L = f * o + w, D = p * A + t, H = new m({
            x: this.#r[0] * b + L,
            y: this.#r[1] * R + D
          }, this.#t, this.#i, h, this.#n, n ?? this.#s);
          for (let X = 2; X < this.#r.length; X += 2)
            H.add({
              x: this.#r[X] * b + L,
              y: this.#r[X + 1] * R + D
            });
          return H.getOutlines();
        }
      }
    }
  ),
  /***/
  362: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        EditorToolbar: () => (
          /* binding */
          y
        ),
        /* harmony export */
        HighlightToolbar: () => (
          /* binding */
          v
        )
        /* harmony export */
      });
      var e = i(419);
      class y {
        #t = null;
        #e = null;
        #s;
        #n = null;
        constructor(m) {
          this.#s = m;
        }
        render() {
          const m = this.#t = document.createElement("div");
          m.className = "editToolbar", m.setAttribute("role", "toolbar"), m.addEventListener("contextmenu", e.noContextMenu), m.addEventListener("pointerdown", y.#r);
          const l = this.#n = document.createElement("div");
          l.className = "buttons", m.append(l);
          const g = this.#s.toolbarPosition;
          if (g) {
            const {
              style: h
            } = m, n = this.#s._uiManager.direction === "ltr" ? 1 - g[0] : g[0];
            h.insetInlineEnd = `${100 * n}%`, h.top = `calc(${100 * g[1]}% + var(--editor-toolbar-vert-offset))`;
          }
          return this.#l(), m;
        }
        static #r(m) {
          m.stopPropagation();
        }
        #i(m) {
          this.#s._focusEventsAllowed = !1, m.preventDefault(), m.stopPropagation();
        }
        #a(m) {
          this.#s._focusEventsAllowed = !0, m.preventDefault(), m.stopPropagation();
        }
        #h(m) {
          m.addEventListener("focusin", this.#i.bind(this), {
            capture: !0
          }), m.addEventListener("focusout", this.#a.bind(this), {
            capture: !0
          }), m.addEventListener("contextmenu", e.noContextMenu);
        }
        hide() {
          this.#t.classList.add("hidden"), this.#e?.hideDropdown();
        }
        show() {
          this.#t.classList.remove("hidden");
        }
        #l() {
          const m = document.createElement("button");
          m.className = "delete", m.tabIndex = 0, m.setAttribute("data-l10n-id", `pdfjs-editor-remove-${this.#s.editorType}-button`), this.#h(m), m.addEventListener("click", (l) => {
            this.#s._uiManager.delete();
          }), this.#n.append(m);
        }
        get #d() {
          const m = document.createElement("div");
          return m.className = "divider", m;
        }
        addAltTextButton(m) {
          this.#h(m), this.#n.prepend(m, this.#d);
        }
        addColorPicker(m) {
          this.#e = m;
          const l = m.renderButton();
          this.#h(l), this.#n.prepend(l, this.#d);
        }
        remove() {
          this.#t.remove(), this.#e?.destroy(), this.#e = null;
        }
      }
      class v {
        #t = null;
        #e = null;
        #s;
        constructor(m) {
          this.#s = m;
        }
        #n() {
          const m = this.#e = document.createElement("div");
          m.className = "editToolbar", m.setAttribute("role", "toolbar"), m.addEventListener("contextmenu", e.noContextMenu);
          const l = this.#t = document.createElement("div");
          return l.className = "buttons", m.append(l), this.#i(), m;
        }
        #r(m, l) {
          let g = 0, h = 0;
          for (const n of m) {
            const f = n.y + n.height;
            if (f < g)
              continue;
            const p = n.x + (l ? n.width : 0);
            if (f > g) {
              h = p, g = f;
              continue;
            }
            l ? p > h && (h = p) : p < h && (h = p);
          }
          return [l ? 1 - h : h, g];
        }
        show(m, l, g) {
          const [h, n] = this.#r(l, g), {
            style: f
          } = this.#e ||= this.#n();
          m.append(this.#e), f.insetInlineEnd = `${100 * h}%`, f.top = `calc(${100 * n}% + var(--editor-toolbar-vert-offset))`;
        }
        hide() {
          this.#e.remove();
        }
        #i() {
          const m = document.createElement("button");
          m.className = "highlightButton", m.tabIndex = 0, m.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button1");
          const l = document.createElement("span");
          m.append(l), l.className = "visuallyHidden", l.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label"), m.addEventListener("contextmenu", e.noContextMenu), m.addEventListener("click", () => {
            this.#s.highlightSelection("floating_button");
          }), this.#t.append(m);
        }
      }
    }
  ),
  /***/
  830: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        AnnotationEditorUIManager: () => (
          /* binding */
          p
        ),
        /* harmony export */
        ColorManager: () => (
          /* binding */
          f
        ),
        /* harmony export */
        KeyboardManager: () => (
          /* binding */
          n
        ),
        /* harmony export */
        bindEvents: () => (
          /* binding */
          x
        ),
        /* harmony export */
        opacityToHex: () => (
          /* binding */
          m
        )
        /* harmony export */
      });
      var e = i(292), y = i(419), v = i(362);
      function x(C, r, w) {
        for (const t of w)
          r.addEventListener(t, C[t].bind(C));
      }
      function m(C) {
        return Math.round(Math.min(255, Math.max(1, 255 * C))).toString(16).padStart(2, "0");
      }
      class l {
        #t = 0;
        constructor() {
        }
        get id() {
          return `${e.AnnotationEditorPrefix}${this.#t++}`;
        }
      }
      class g {
        #t = (0, e.getUuid)();
        #e = 0;
        #s = null;
        static get _isSVGFittingCanvas() {
          const r = '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>', t = new OffscreenCanvas(1, 3).getContext("2d"), o = new Image();
          o.src = r;
          const A = o.decode().then(() => (t.drawImage(o, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(t.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
          return (0, e.shadow)(this, "_isSVGFittingCanvas", A);
        }
        async #n(r, w) {
          this.#s ||= /* @__PURE__ */ new Map();
          let t = this.#s.get(r);
          if (t === null)
            return null;
          if (t?.bitmap)
            return t.refCounter += 1, t;
          try {
            t ||= {
              bitmap: null,
              id: `image_${this.#t}_${this.#e++}`,
              refCounter: 0,
              isSvg: !1
            };
            let o;
            if (typeof w == "string" ? (t.url = w, o = await (0, y.fetchData)(w, "blob")) : o = t.file = w, o.type === "image/svg+xml") {
              const A = g._isSVGFittingCanvas, b = new FileReader(), R = new Image(), L = new Promise((D, H) => {
                R.onload = () => {
                  t.bitmap = R, t.isSvg = !0, D();
                }, b.onload = async () => {
                  const X = t.svgUrl = b.result;
                  R.src = await A ? `${X}#svgView(preserveAspectRatio(none))` : X;
                }, R.onerror = b.onerror = H;
              });
              b.readAsDataURL(o), await L;
            } else
              t.bitmap = await createImageBitmap(o);
            t.refCounter = 1;
          } catch (o) {
            console.error(o), t = null;
          }
          return this.#s.set(r, t), t && this.#s.set(t.id, t), t;
        }
        async getFromFile(r) {
          const {
            lastModified: w,
            name: t,
            size: o,
            type: A
          } = r;
          return this.#n(`${w}_${t}_${o}_${A}`, r);
        }
        async getFromUrl(r) {
          return this.#n(r, r);
        }
        async getFromId(r) {
          this.#s ||= /* @__PURE__ */ new Map();
          const w = this.#s.get(r);
          return w ? w.bitmap ? (w.refCounter += 1, w) : w.file ? this.getFromFile(w.file) : this.getFromUrl(w.url) : null;
        }
        getSvgUrl(r) {
          const w = this.#s.get(r);
          return w?.isSvg ? w.svgUrl : null;
        }
        deleteId(r) {
          this.#s ||= /* @__PURE__ */ new Map();
          const w = this.#s.get(r);
          w && (w.refCounter -= 1, w.refCounter === 0 && (w.bitmap = null));
        }
        isValidId(r) {
          return r.startsWith(`image_${this.#t}_`);
        }
      }
      class h {
        #t = [];
        #e = !1;
        #s;
        #n = -1;
        constructor(r = 128) {
          this.#s = r;
        }
        add({
          cmd: r,
          undo: w,
          post: t,
          mustExec: o,
          type: A = NaN,
          overwriteIfSameType: b = !1,
          keepUndo: R = !1
        }) {
          if (o && r(), this.#e)
            return;
          const L = {
            cmd: r,
            undo: w,
            post: t,
            type: A
          };
          if (this.#n === -1) {
            this.#t.length > 0 && (this.#t.length = 0), this.#n = 0, this.#t.push(L);
            return;
          }
          if (b && this.#t[this.#n].type === A) {
            R && (L.undo = this.#t[this.#n].undo), this.#t[this.#n] = L;
            return;
          }
          const D = this.#n + 1;
          D === this.#s ? this.#t.splice(0, 1) : (this.#n = D, D < this.#t.length && this.#t.splice(D)), this.#t.push(L);
        }
        undo() {
          if (this.#n === -1)
            return;
          this.#e = !0;
          const {
            undo: r,
            post: w
          } = this.#t[this.#n];
          r(), w?.(), this.#e = !1, this.#n -= 1;
        }
        redo() {
          if (this.#n < this.#t.length - 1) {
            this.#n += 1, this.#e = !0;
            const {
              cmd: r,
              post: w
            } = this.#t[this.#n];
            r(), w?.(), this.#e = !1;
          }
        }
        hasSomethingToUndo() {
          return this.#n !== -1;
        }
        hasSomethingToRedo() {
          return this.#n < this.#t.length - 1;
        }
        destroy() {
          this.#t = null;
        }
      }
      class n {
        constructor(r) {
          this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
          const {
            isMac: w
          } = e.FeatureTest.platform;
          for (const [t, o, A = {}] of r)
            for (const b of t) {
              const R = b.startsWith("mac+");
              w && R ? (this.callbacks.set(b.slice(4), {
                callback: o,
                options: A
              }), this.allKeys.add(b.split("+").at(-1))) : !w && !R && (this.callbacks.set(b, {
                callback: o,
                options: A
              }), this.allKeys.add(b.split("+").at(-1)));
            }
        }
        #t(r) {
          r.altKey && this.buffer.push("alt"), r.ctrlKey && this.buffer.push("ctrl"), r.metaKey && this.buffer.push("meta"), r.shiftKey && this.buffer.push("shift"), this.buffer.push(r.key);
          const w = this.buffer.join("+");
          return this.buffer.length = 0, w;
        }
        exec(r, w) {
          if (!this.allKeys.has(w.key))
            return;
          const t = this.callbacks.get(this.#t(w));
          if (!t)
            return;
          const {
            callback: o,
            options: {
              bubbles: A = !1,
              args: b = [],
              checker: R = null
            }
          } = t;
          R && !R(r, w) || (o.bind(r, ...b, w)(), A || (w.stopPropagation(), w.preventDefault()));
        }
      }
      class f {
        static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
        get _colors() {
          const r = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
          return (0, y.getColorValues)(r), (0, e.shadow)(this, "_colors", r);
        }
        convert(r) {
          const w = (0, y.getRGB)(r);
          if (!window.matchMedia("(forced-colors: active)").matches)
            return w;
          for (const [t, o] of this._colors)
            if (o.every((A, b) => A === w[b]))
              return f._colorsMapping.get(t);
          return w;
        }
        getHexCode(r) {
          const w = this._colors.get(r);
          return w ? e.Util.makeHexColor(...w) : r;
        }
      }
      class p {
        #t = null;
        #e = /* @__PURE__ */ new Map();
        #s = /* @__PURE__ */ new Map();
        #n = null;
        #r = null;
        #i = null;
        #a = new h();
        #h = 0;
        #l = /* @__PURE__ */ new Set();
        #d = null;
        #u = null;
        #c = /* @__PURE__ */ new Set();
        #o = !1;
        #p = null;
        #g = null;
        #f = null;
        #v = !1;
        #m = null;
        #A = new l();
        #w = !1;
        #T = !1;
        #k = null;
        #M = null;
        #L = null;
        #y = e.AnnotationEditorType.NONE;
        #b = /* @__PURE__ */ new Set();
        #S = null;
        #_ = null;
        #x = null;
        #C = this.blur.bind(this);
        #P = this.focus.bind(this);
        #R = this.copy.bind(this);
        #I = this.cut.bind(this);
        #F = this.paste.bind(this);
        #N = this.keydown.bind(this);
        #U = this.keyup.bind(this);
        #X = this.onEditingAction.bind(this);
        #q = this.onPageChanging.bind(this);
        #G = this.onScaleChanging.bind(this);
        #B = this.#rt.bind(this);
        #D = this.onRotationChanging.bind(this);
        #K = {
          isEditing: !1,
          isEmpty: !0,
          hasSomethingToUndo: !1,
          hasSomethingToRedo: !1,
          hasSelectedEditor: !1,
          hasSelectedText: !1
        };
        #V = [0, 0];
        #O = null;
        #z = null;
        #J = null;
        static TRANSLATE_SMALL = 1;
        static TRANSLATE_BIG = 10;
        static get _keyboardManager() {
          const r = p.prototype, w = (b) => b.#z.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && b.hasSomethingToControl(), t = (b, {
            target: R
          }) => {
            if (R instanceof HTMLInputElement) {
              const {
                type: L
              } = R;
              return L !== "text" && L !== "number";
            }
            return !0;
          }, o = this.TRANSLATE_SMALL, A = this.TRANSLATE_BIG;
          return (0, e.shadow)(this, "_keyboardManager", new n([[["ctrl+a", "mac+meta+a"], r.selectAll, {
            checker: t
          }], [["ctrl+z", "mac+meta+z"], r.undo, {
            checker: t
          }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], r.redo, {
            checker: t
          }], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], r.delete, {
            checker: t
          }], [["Enter", "mac+Enter"], r.addNewEditorFromKeyboard, {
            checker: (b, {
              target: R
            }) => !(R instanceof HTMLButtonElement) && b.#z.contains(R) && !b.isEnterHandled
          }], [[" ", "mac+ "], r.addNewEditorFromKeyboard, {
            checker: (b, {
              target: R
            }) => !(R instanceof HTMLButtonElement) && b.#z.contains(document.activeElement)
          }], [["Escape", "mac+Escape"], r.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], r.translateSelectedEditors, {
            args: [-o, 0],
            checker: w
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], r.translateSelectedEditors, {
            args: [-A, 0],
            checker: w
          }], [["ArrowRight", "mac+ArrowRight"], r.translateSelectedEditors, {
            args: [o, 0],
            checker: w
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], r.translateSelectedEditors, {
            args: [A, 0],
            checker: w
          }], [["ArrowUp", "mac+ArrowUp"], r.translateSelectedEditors, {
            args: [0, -o],
            checker: w
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], r.translateSelectedEditors, {
            args: [0, -A],
            checker: w
          }], [["ArrowDown", "mac+ArrowDown"], r.translateSelectedEditors, {
            args: [0, o],
            checker: w
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], r.translateSelectedEditors, {
            args: [0, A],
            checker: w
          }]]));
        }
        constructor(r, w, t, o, A, b, R, L, D) {
          this.#z = r, this.#J = w, this.#n = t, this._eventBus = o, this._eventBus._on("editingaction", this.#X), this._eventBus._on("pagechanging", this.#q), this._eventBus._on("scalechanging", this.#G), this._eventBus._on("rotationchanging", this.#D), this.#at(), this.#Z(), this.#r = A.annotationStorage, this.#p = A.filterFactory, this.#_ = b, this.#f = R || null, this.#o = L, this.#L = D || null, this.viewParameters = {
            realScale: y.PixelsPerInch.PDF_TO_CSS_UNITS,
            rotation: 0
          }, this.isShiftKeyDown = !1;
        }
        destroy() {
          this.#$(), this.#Q(), this._eventBus._off("editingaction", this.#X), this._eventBus._off("pagechanging", this.#q), this._eventBus._off("scalechanging", this.#G), this._eventBus._off("rotationchanging", this.#D);
          for (const r of this.#s.values())
            r.destroy();
          this.#s.clear(), this.#e.clear(), this.#c.clear(), this.#t = null, this.#b.clear(), this.#a.destroy(), this.#n?.destroy(), this.#m?.hide(), this.#m = null, this.#g && (clearTimeout(this.#g), this.#g = null), this.#O && (clearTimeout(this.#O), this.#O = null), this.#ot();
        }
        async mlGuess(r) {
          return this.#L?.guess(r) || null;
        }
        get hasMLManager() {
          return !!this.#L;
        }
        get hcmFilter() {
          return (0, e.shadow)(this, "hcmFilter", this.#_ ? this.#p.addHCMFilter(this.#_.foreground, this.#_.background) : "none");
        }
        get direction() {
          return (0, e.shadow)(this, "direction", getComputedStyle(this.#z).direction);
        }
        get highlightColors() {
          return (0, e.shadow)(this, "highlightColors", this.#f ? new Map(this.#f.split(",").map((r) => r.split("=").map((w) => w.trim()))) : null);
        }
        get highlightColorNames() {
          return (0, e.shadow)(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, (r) => r.reverse())) : null);
        }
        setMainHighlightColorPicker(r) {
          this.#M = r;
        }
        editAltText(r) {
          this.#n?.editAltText(this, r);
        }
        onPageChanging({
          pageNumber: r
        }) {
          this.#h = r - 1;
        }
        focusMainContainer() {
          this.#z.focus();
        }
        findParent(r, w) {
          for (const t of this.#s.values()) {
            const {
              x: o,
              y: A,
              width: b,
              height: R
            } = t.div.getBoundingClientRect();
            if (r >= o && r <= o + b && w >= A && w <= A + R)
              return t;
          }
          return null;
        }
        disableUserSelect(r = !1) {
          this.#J.classList.toggle("noUserSelect", r);
        }
        addShouldRescale(r) {
          this.#c.add(r);
        }
        removeShouldRescale(r) {
          this.#c.delete(r);
        }
        onScaleChanging({
          scale: r
        }) {
          this.commitOrRemove(), this.viewParameters.realScale = r * y.PixelsPerInch.PDF_TO_CSS_UNITS;
          for (const w of this.#c)
            w.onScaleChanging();
        }
        onRotationChanging({
          pagesRotation: r
        }) {
          this.commitOrRemove(), this.viewParameters.rotation = r;
        }
        #Y({
          anchorNode: r
        }) {
          return r.nodeType === Node.TEXT_NODE ? r.parentElement : r;
        }
        highlightSelection(r = "") {
          const w = document.getSelection();
          if (!w || w.isCollapsed)
            return;
          const {
            anchorNode: t,
            anchorOffset: o,
            focusNode: A,
            focusOffset: b
          } = w, R = w.toString(), D = this.#Y(w).closest(".textLayer"), H = this.getSelectionBoxes(D);
          if (H) {
            w.empty(), this.#y === e.AnnotationEditorType.NONE && (this._eventBus.dispatch("showannotationeditorui", {
              source: this,
              mode: e.AnnotationEditorType.HIGHLIGHT
            }), this.showAllEditors("highlight", !0, !0));
            for (const X of this.#s.values())
              if (X.hasTextLayer(D)) {
                X.createAndAddNewEditor({
                  x: 0,
                  y: 0
                }, !1, {
                  methodOfCreation: r,
                  boxes: H,
                  anchorNode: t,
                  anchorOffset: o,
                  focusNode: A,
                  focusOffset: b,
                  text: R
                });
                break;
              }
          }
        }
        #nt() {
          const r = document.getSelection();
          if (!r || r.isCollapsed)
            return;
          const t = this.#Y(r).closest(".textLayer"), o = this.getSelectionBoxes(t);
          o && (this.#m ||= new v.HighlightToolbar(this), this.#m.show(t, o, this.direction === "ltr"));
        }
        addToAnnotationStorage(r) {
          !r.isEmpty() && this.#r && !this.#r.has(r.id) && this.#r.setValue(r.id, r);
        }
        #rt() {
          const r = document.getSelection();
          if (!r || r.isCollapsed) {
            this.#S && (this.#m?.hide(), this.#S = null, this.#E({
              hasSelectedText: !1
            }));
            return;
          }
          const {
            anchorNode: w
          } = r;
          if (w === this.#S)
            return;
          if (!this.#Y(r).closest(".textLayer")) {
            this.#S && (this.#m?.hide(), this.#S = null, this.#E({
              hasSelectedText: !1
            }));
            return;
          }
          if (this.#m?.hide(), this.#S = w, this.#E({
            hasSelectedText: !0
          }), !(this.#y !== e.AnnotationEditorType.HIGHLIGHT && this.#y !== e.AnnotationEditorType.NONE) && (this.#y === e.AnnotationEditorType.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#v = this.isShiftKeyDown, !this.isShiftKeyDown)) {
            const A = (b) => {
              b.type === "pointerup" && b.button !== 0 || (window.removeEventListener("pointerup", A), window.removeEventListener("blur", A), b.type === "pointerup" && this.#W("main_toolbar"));
            };
            window.addEventListener("pointerup", A), window.addEventListener("blur", A);
          }
        }
        #W(r = "") {
          this.#y === e.AnnotationEditorType.HIGHLIGHT ? this.highlightSelection(r) : this.#o && this.#nt();
        }
        #at() {
          document.addEventListener("selectionchange", this.#B);
        }
        #ot() {
          document.removeEventListener("selectionchange", this.#B);
        }
        #lt() {
          window.addEventListener("focus", this.#P), window.addEventListener("blur", this.#C);
        }
        #Q() {
          window.removeEventListener("focus", this.#P), window.removeEventListener("blur", this.#C);
        }
        blur() {
          if (this.isShiftKeyDown = !1, this.#v && (this.#v = !1, this.#W("main_toolbar")), !this.hasSelection)
            return;
          const {
            activeElement: r
          } = document;
          for (const w of this.#b)
            if (w.div.contains(r)) {
              this.#k = [w, r], w._focusEventsAllowed = !1;
              break;
            }
        }
        focus() {
          if (!this.#k)
            return;
          const [r, w] = this.#k;
          this.#k = null, w.addEventListener("focusin", () => {
            r._focusEventsAllowed = !0;
          }, {
            once: !0
          }), w.focus();
        }
        #Z() {
          window.addEventListener("keydown", this.#N), window.addEventListener("keyup", this.#U);
        }
        #$() {
          window.removeEventListener("keydown", this.#N), window.removeEventListener("keyup", this.#U);
        }
        #tt() {
          document.addEventListener("copy", this.#R), document.addEventListener("cut", this.#I), document.addEventListener("paste", this.#F);
        }
        #et() {
          document.removeEventListener("copy", this.#R), document.removeEventListener("cut", this.#I), document.removeEventListener("paste", this.#F);
        }
        addEditListeners() {
          this.#Z(), this.#tt();
        }
        removeEditListeners() {
          this.#$(), this.#et();
        }
        copy(r) {
          if (r.preventDefault(), this.#t?.commitOrRemove(), !this.hasSelection)
            return;
          const w = [];
          for (const t of this.#b) {
            const o = t.serialize(!0);
            o && w.push(o);
          }
          w.length !== 0 && r.clipboardData.setData("application/pdfjs", JSON.stringify(w));
        }
        cut(r) {
          this.copy(r), this.delete();
        }
        paste(r) {
          r.preventDefault();
          const {
            clipboardData: w
          } = r;
          for (const A of w.items)
            for (const b of this.#u)
              if (b.isHandlingMimeForPasting(A.type)) {
                b.paste(A, this.currentLayer);
                return;
              }
          let t = w.getData("application/pdfjs");
          if (!t)
            return;
          try {
            t = JSON.parse(t);
          } catch (A) {
            (0, e.warn)(`paste: "${A.message}".`);
            return;
          }
          if (!Array.isArray(t))
            return;
          this.unselectAll();
          const o = this.currentLayer;
          try {
            const A = [];
            for (const L of t) {
              const D = o.deserialize(L);
              if (!D)
                return;
              A.push(D);
            }
            const b = () => {
              for (const L of A)
                this.#st(L);
              this.#it(A);
            }, R = () => {
              for (const L of A)
                L.remove();
            };
            this.addCommands({
              cmd: b,
              undo: R,
              mustExec: !0
            });
          } catch (A) {
            (0, e.warn)(`paste: "${A.message}".`);
          }
        }
        keydown(r) {
          !this.isShiftKeyDown && r.key === "Shift" && (this.isShiftKeyDown = !0), this.#y !== e.AnnotationEditorType.NONE && !this.isEditorHandlingKeyboard && p._keyboardManager.exec(this, r);
        }
        keyup(r) {
          this.isShiftKeyDown && r.key === "Shift" && (this.isShiftKeyDown = !1, this.#v && (this.#v = !1, this.#W("main_toolbar")));
        }
        onEditingAction({
          name: r
        }) {
          switch (r) {
            case "undo":
            case "redo":
            case "delete":
            case "selectAll":
              this[r]();
              break;
            case "highlightSelection":
              this.highlightSelection("context_menu");
              break;
          }
        }
        #E(r) {
          Object.entries(r).some(([t, o]) => this.#K[t] !== o) && (this._eventBus.dispatch("annotationeditorstateschanged", {
            source: this,
            details: Object.assign(this.#K, r)
          }), this.#y === e.AnnotationEditorType.HIGHLIGHT && r.hasSelectedEditor === !1 && this.#H([[e.AnnotationEditorParamsType.HIGHLIGHT_FREE, !0]]));
        }
        #H(r) {
          this._eventBus.dispatch("annotationeditorparamschanged", {
            source: this,
            details: r
          });
        }
        setEditingState(r) {
          r ? (this.#lt(), this.#tt(), this.#E({
            isEditing: this.#y !== e.AnnotationEditorType.NONE,
            isEmpty: this.#j(),
            hasSomethingToUndo: this.#a.hasSomethingToUndo(),
            hasSomethingToRedo: this.#a.hasSomethingToRedo(),
            hasSelectedEditor: !1
          })) : (this.#Q(), this.#et(), this.#E({
            isEditing: !1
          }), this.disableUserSelect(!1));
        }
        registerEditorTypes(r) {
          if (!this.#u) {
            this.#u = r;
            for (const w of this.#u)
              this.#H(w.defaultPropertiesToUpdate);
          }
        }
        getId() {
          return this.#A.id;
        }
        get currentLayer() {
          return this.#s.get(this.#h);
        }
        getLayer(r) {
          return this.#s.get(r);
        }
        get currentPageIndex() {
          return this.#h;
        }
        addLayer(r) {
          this.#s.set(r.pageIndex, r), this.#w ? r.enable() : r.disable();
        }
        removeLayer(r) {
          this.#s.delete(r.pageIndex);
        }
        updateMode(r, w = null, t = !1) {
          if (this.#y !== r) {
            if (this.#y = r, r === e.AnnotationEditorType.NONE) {
              this.setEditingState(!1), this.#ct();
              return;
            }
            this.setEditingState(!0), this.#ht(), this.unselectAll();
            for (const o of this.#s.values())
              o.updateMode(r);
            if (!w && t) {
              this.addNewEditorFromKeyboard();
              return;
            }
            if (w) {
              for (const o of this.#e.values())
                if (o.annotationElementId === w) {
                  this.setSelected(o), o.enterInEditMode();
                  break;
                }
            }
          }
        }
        addNewEditorFromKeyboard() {
          this.currentLayer.canCreateNewEmptyEditor() && this.currentLayer.addNewEditor();
        }
        updateToolbar(r) {
          r !== this.#y && this._eventBus.dispatch("switchannotationeditormode", {
            source: this,
            mode: r
          });
        }
        updateParams(r, w) {
          if (this.#u) {
            switch (r) {
              case e.AnnotationEditorParamsType.CREATE:
                this.currentLayer.addNewEditor();
                return;
              case e.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:
                this.#M?.updateColor(w);
                break;
              case e.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:
                this._eventBus.dispatch("reporttelemetry", {
                  source: this,
                  details: {
                    type: "editing",
                    data: {
                      type: "highlight",
                      action: "toggle_visibility"
                    }
                  }
                }), (this.#x ||= /* @__PURE__ */ new Map()).set(r, w), this.showAllEditors("highlight", w);
                break;
            }
            for (const t of this.#b)
              t.updateParams(r, w);
            for (const t of this.#u)
              t.updateDefaultParams(r, w);
          }
        }
        showAllEditors(r, w, t = !1) {
          for (const A of this.#e.values())
            A.editorType === r && A.show(w);
          (this.#x?.get(e.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ?? !0) !== w && this.#H([[e.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, w]]);
        }
        enableWaiting(r = !1) {
          if (this.#T !== r) {
            this.#T = r;
            for (const w of this.#s.values())
              r ? w.disableClick() : w.enableClick(), w.div.classList.toggle("waiting", r);
          }
        }
        #ht() {
          if (!this.#w) {
            this.#w = !0;
            for (const r of this.#s.values())
              r.enable();
            for (const r of this.#e.values())
              r.enable();
          }
        }
        #ct() {
          if (this.unselectAll(), this.#w) {
            this.#w = !1;
            for (const r of this.#s.values())
              r.disable();
            for (const r of this.#e.values())
              r.disable();
          }
        }
        getEditors(r) {
          const w = [];
          for (const t of this.#e.values())
            t.pageIndex === r && w.push(t);
          return w;
        }
        getEditor(r) {
          return this.#e.get(r);
        }
        addEditor(r) {
          this.#e.set(r.id, r);
        }
        removeEditor(r) {
          r.div.contains(document.activeElement) && (this.#g && clearTimeout(this.#g), this.#g = setTimeout(() => {
            this.focusMainContainer(), this.#g = null;
          }, 0)), this.#e.delete(r.id), this.unselect(r), (!r.annotationElementId || !this.#l.has(r.annotationElementId)) && this.#r?.remove(r.id);
        }
        addDeletedAnnotationElement(r) {
          this.#l.add(r.annotationElementId), this.addChangedExistingAnnotation(r), r.deleted = !0;
        }
        isDeletedAnnotationElement(r) {
          return this.#l.has(r);
        }
        removeDeletedAnnotationElement(r) {
          this.#l.delete(r.annotationElementId), this.removeChangedExistingAnnotation(r), r.deleted = !1;
        }
        #st(r) {
          const w = this.#s.get(r.pageIndex);
          w ? w.addOrRebuild(r) : (this.addEditor(r), this.addToAnnotationStorage(r));
        }
        setActiveEditor(r) {
          this.#t !== r && (this.#t = r, r && this.#H(r.propertiesToUpdate));
        }
        get #dt() {
          let r = null;
          for (r of this.#b)
            ;
          return r;
        }
        updateUI(r) {
          this.#dt === r && this.#H(r.propertiesToUpdate);
        }
        toggleSelected(r) {
          if (this.#b.has(r)) {
            this.#b.delete(r), r.unselect(), this.#E({
              hasSelectedEditor: this.hasSelection
            });
            return;
          }
          this.#b.add(r), r.select(), this.#H(r.propertiesToUpdate), this.#E({
            hasSelectedEditor: !0
          });
        }
        setSelected(r) {
          for (const w of this.#b)
            w !== r && w.unselect();
          this.#b.clear(), this.#b.add(r), r.select(), this.#H(r.propertiesToUpdate), this.#E({
            hasSelectedEditor: !0
          });
        }
        isSelected(r) {
          return this.#b.has(r);
        }
        get firstSelectedEditor() {
          return this.#b.values().next().value;
        }
        unselect(r) {
          r.unselect(), this.#b.delete(r), this.#E({
            hasSelectedEditor: this.hasSelection
          });
        }
        get hasSelection() {
          return this.#b.size !== 0;
        }
        get isEnterHandled() {
          return this.#b.size === 1 && this.firstSelectedEditor.isEnterHandled;
        }
        undo() {
          this.#a.undo(), this.#E({
            hasSomethingToUndo: this.#a.hasSomethingToUndo(),
            hasSomethingToRedo: !0,
            isEmpty: this.#j()
          });
        }
        redo() {
          this.#a.redo(), this.#E({
            hasSomethingToUndo: !0,
            hasSomethingToRedo: this.#a.hasSomethingToRedo(),
            isEmpty: this.#j()
          });
        }
        addCommands(r) {
          this.#a.add(r), this.#E({
            hasSomethingToUndo: !0,
            hasSomethingToRedo: !1,
            isEmpty: this.#j()
          });
        }
        #j() {
          if (this.#e.size === 0)
            return !0;
          if (this.#e.size === 1)
            for (const r of this.#e.values())
              return r.isEmpty();
          return !1;
        }
        delete() {
          if (this.commitOrRemove(), !this.hasSelection)
            return;
          const r = [...this.#b], w = () => {
            for (const o of r)
              o.remove();
          }, t = () => {
            for (const o of r)
              this.#st(o);
          };
          this.addCommands({
            cmd: w,
            undo: t,
            mustExec: !0
          });
        }
        commitOrRemove() {
          this.#t?.commitOrRemove();
        }
        hasSomethingToControl() {
          return this.#t || this.hasSelection;
        }
        #it(r) {
          for (const w of this.#b)
            w.unselect();
          this.#b.clear();
          for (const w of r)
            w.isEmpty() || (this.#b.add(w), w.select());
          this.#E({
            hasSelectedEditor: this.hasSelection
          });
        }
        selectAll() {
          for (const r of this.#b)
            r.commit();
          this.#it(this.#e.values());
        }
        unselectAll() {
          if (!(this.#t && (this.#t.commitOrRemove(), this.#y !== e.AnnotationEditorType.NONE)) && this.hasSelection) {
            for (const r of this.#b)
              r.unselect();
            this.#b.clear(), this.#E({
              hasSelectedEditor: !1
            });
          }
        }
        translateSelectedEditors(r, w, t = !1) {
          if (t || this.commitOrRemove(), !this.hasSelection)
            return;
          this.#V[0] += r, this.#V[1] += w;
          const [o, A] = this.#V, b = [...this.#b], R = 1e3;
          this.#O && clearTimeout(this.#O), this.#O = setTimeout(() => {
            this.#O = null, this.#V[0] = this.#V[1] = 0, this.addCommands({
              cmd: () => {
                for (const L of b)
                  this.#e.has(L.id) && L.translateInPage(o, A);
              },
              undo: () => {
                for (const L of b)
                  this.#e.has(L.id) && L.translateInPage(-o, -A);
              },
              mustExec: !1
            });
          }, R);
          for (const L of b)
            L.translateInPage(r, w);
        }
        setUpDragSession() {
          if (this.hasSelection) {
            this.disableUserSelect(!0), this.#d = /* @__PURE__ */ new Map();
            for (const r of this.#b)
              this.#d.set(r, {
                savedX: r.x,
                savedY: r.y,
                savedPageIndex: r.pageIndex,
                newX: 0,
                newY: 0,
                newPageIndex: -1
              });
          }
        }
        endDragSession() {
          if (!this.#d)
            return !1;
          this.disableUserSelect(!1);
          const r = this.#d;
          this.#d = null;
          let w = !1;
          for (const [{
            x: o,
            y: A,
            pageIndex: b
          }, R] of r)
            R.newX = o, R.newY = A, R.newPageIndex = b, w ||= o !== R.savedX || A !== R.savedY || b !== R.savedPageIndex;
          if (!w)
            return !1;
          const t = (o, A, b, R) => {
            if (this.#e.has(o.id)) {
              const L = this.#s.get(R);
              L ? o._setParentAndPosition(L, A, b) : (o.pageIndex = R, o.x = A, o.y = b);
            }
          };
          return this.addCommands({
            cmd: () => {
              for (const [o, {
                newX: A,
                newY: b,
                newPageIndex: R
              }] of r)
                t(o, A, b, R);
            },
            undo: () => {
              for (const [o, {
                savedX: A,
                savedY: b,
                savedPageIndex: R
              }] of r)
                t(o, A, b, R);
            },
            mustExec: !0
          }), !0;
        }
        dragSelectedEditors(r, w) {
          if (this.#d)
            for (const t of this.#d.keys())
              t.drag(r, w);
        }
        rebuild(r) {
          if (r.parent === null) {
            const w = this.getLayer(r.pageIndex);
            w ? (w.changeParent(r), w.addOrRebuild(r)) : (this.addEditor(r), this.addToAnnotationStorage(r), r.rebuild());
          } else
            r.parent.addOrRebuild(r);
        }
        get isEditorHandlingKeyboard() {
          return this.getActive()?.shouldGetKeyboardEvents() || this.#b.size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents();
        }
        isActive(r) {
          return this.#t === r;
        }
        getActive() {
          return this.#t;
        }
        getMode() {
          return this.#y;
        }
        get imageManager() {
          return (0, e.shadow)(this, "imageManager", new g());
        }
        getSelectionBoxes(r) {
          if (!r)
            return null;
          const w = document.getSelection();
          for (let D = 0, H = w.rangeCount; D < H; D++)
            if (!r.contains(w.getRangeAt(D).commonAncestorContainer))
              return null;
          const {
            x: t,
            y: o,
            width: A,
            height: b
          } = r.getBoundingClientRect();
          let R;
          switch (r.getAttribute("data-main-rotation")) {
            case "90":
              R = (D, H, X, V) => ({
                x: (H - o) / b,
                y: 1 - (D + X - t) / A,
                width: V / b,
                height: X / A
              });
              break;
            case "180":
              R = (D, H, X, V) => ({
                x: 1 - (D + X - t) / A,
                y: 1 - (H + V - o) / b,
                width: X / A,
                height: V / b
              });
              break;
            case "270":
              R = (D, H, X, V) => ({
                x: 1 - (H + V - o) / b,
                y: (D - t) / A,
                width: V / b,
                height: X / A
              });
              break;
            default:
              R = (D, H, X, V) => ({
                x: (D - t) / A,
                y: (H - o) / b,
                width: X / A,
                height: V / b
              });
              break;
          }
          const L = [];
          for (let D = 0, H = w.rangeCount; D < H; D++) {
            const X = w.getRangeAt(D);
            if (!X.collapsed)
              for (const {
                x: V,
                y: q,
                width: tt,
                height: rt
              } of X.getClientRects())
                tt === 0 || rt === 0 || L.push(R(V, q, tt, rt));
          }
          return L.length === 0 ? null : L;
        }
        addChangedExistingAnnotation({
          annotationElementId: r,
          id: w
        }) {
          (this.#i ||= /* @__PURE__ */ new Map()).set(r, w);
        }
        removeChangedExistingAnnotation({
          annotationElementId: r
        }) {
          this.#i?.delete(r);
        }
        renderAnnotationElement(r) {
          const w = this.#i?.get(r.data.id);
          if (!w)
            return;
          const t = this.#r.getRawValue(w);
          t && (this.#y === e.AnnotationEditorType.NONE && !t.hasBeenModified || t.renderAnnotationElement(r));
        }
      }
    }
  ),
  /***/
  94: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        PDFFetchStream: () => (
          /* binding */
          l
        )
        /* harmony export */
      });
      var e = i(292), y = i(490);
      function v(n, f, p) {
        return {
          method: "GET",
          headers: n,
          signal: p.signal,
          mode: "cors",
          credentials: f ? "include" : "same-origin",
          redirect: "follow"
        };
      }
      function x(n) {
        const f = new Headers();
        for (const p in n) {
          const C = n[p];
          C !== void 0 && f.append(p, C);
        }
        return f;
      }
      function m(n) {
        return n instanceof Uint8Array ? n.buffer : n instanceof ArrayBuffer ? n : ((0, e.warn)(`getArrayBuffer - unexpected data format: ${n}`), new Uint8Array(n).buffer);
      }
      class l {
        constructor(f) {
          this.source = f, this.isHttp = /^https?:/i.test(f.url), this.httpHeaders = this.isHttp && f.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
        }
        get _progressiveDataLength() {
          return this._fullRequestReader?._loaded ?? 0;
        }
        getFullReader() {
          return (0, e.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new g(this), this._fullRequestReader;
        }
        getRangeReader(f, p) {
          if (p <= this._progressiveDataLength)
            return null;
          const C = new h(this, f, p);
          return this._rangeRequestReaders.push(C), C;
        }
        cancelAllRequests(f) {
          this._fullRequestReader?.cancel(f);
          for (const p of this._rangeRequestReaders.slice(0))
            p.cancel(f);
        }
      }
      class g {
        constructor(f) {
          this._stream = f, this._reader = null, this._loaded = 0, this._filename = null;
          const p = f.source;
          this._withCredentials = p.withCredentials || !1, this._contentLength = p.length, this._headersCapability = Promise.withResolvers(), this._disableRange = p.disableRange || !1, this._rangeChunkSize = p.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !p.disableStream, this._isRangeSupported = !p.disableRange, this._headers = x(this._stream.httpHeaders);
          const C = p.url;
          fetch(C, v(this._headers, this._withCredentials, this._abortController)).then((r) => {
            if (!(0, y.validateResponseStatus)(r.status))
              throw (0, y.createResponseStatusError)(r.status, C);
            this._reader = r.body.getReader(), this._headersCapability.resolve();
            const w = (A) => r.headers.get(A), {
              allowRangeRequests: t,
              suggestedLength: o
            } = (0, y.validateRangeRequestCapabilities)({
              getResponseHeader: w,
              isHttp: this._stream.isHttp,
              rangeChunkSize: this._rangeChunkSize,
              disableRange: this._disableRange
            });
            this._isRangeSupported = t, this._contentLength = o || this._contentLength, this._filename = (0, y.extractFilenameFromHeader)(w), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new e.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() {
          await this._headersCapability.promise;
          const {
            value: f,
            done: p
          } = await this._reader.read();
          return p ? {
            value: f,
            done: p
          } : (this._loaded += f.byteLength, this.onProgress?.({
            loaded: this._loaded,
            total: this._contentLength
          }), {
            value: m(f),
            done: !1
          });
        }
        cancel(f) {
          this._reader?.cancel(f), this._abortController.abort();
        }
      }
      class h {
        constructor(f, p, C) {
          this._stream = f, this._reader = null, this._loaded = 0;
          const r = f.source;
          this._withCredentials = r.withCredentials || !1, this._readCapability = Promise.withResolvers(), this._isStreamingSupported = !r.disableStream, this._abortController = new AbortController(), this._headers = x(this._stream.httpHeaders), this._headers.append("Range", `bytes=${p}-${C - 1}`);
          const w = r.url;
          fetch(w, v(this._headers, this._withCredentials, this._abortController)).then((t) => {
            if (!(0, y.validateResponseStatus)(t.status))
              throw (0, y.createResponseStatusError)(t.status, w);
            this._readCapability.resolve(), this._reader = t.body.getReader();
          }).catch(this._readCapability.reject), this.onProgress = null;
        }
        get isStreamingSupported() {
          return this._isStreamingSupported;
        }
        async read() {
          await this._readCapability.promise;
          const {
            value: f,
            done: p
          } = await this._reader.read();
          return p ? {
            value: f,
            done: p
          } : (this._loaded += f.byteLength, this.onProgress?.({
            loaded: this._loaded
          }), {
            value: m(f),
            done: !1
          });
        }
        cancel(f) {
          this._reader?.cancel(f), this._abortController.abort();
        }
      }
    }
  ),
  /***/
  10: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        FontFaceObject: () => (
          /* binding */
          v
        ),
        /* harmony export */
        FontLoader: () => (
          /* binding */
          y
        )
        /* harmony export */
      });
      var e = i(292);
      class y {
        #t = /* @__PURE__ */ new Set();
        constructor({
          ownerDocument: m = globalThis.document,
          styleElement: l = null
        }) {
          this._document = m, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
        }
        addNativeFontFace(m) {
          this.nativeFontFaces.add(m), this._document.fonts.add(m);
        }
        removeNativeFontFace(m) {
          this.nativeFontFaces.delete(m), this._document.fonts.delete(m);
        }
        insertRule(m) {
          this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
          const l = this.styleElement.sheet;
          l.insertRule(m, l.cssRules.length);
        }
        clear() {
          for (const m of this.nativeFontFaces)
            this._document.fonts.delete(m);
          this.nativeFontFaces.clear(), this.#t.clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
        }
        async loadSystemFont({
          systemFontInfo: m,
          _inspectFont: l
        }) {
          if (!(!m || this.#t.has(m.loadedName))) {
            if ((0, e.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
              const {
                loadedName: g,
                src: h,
                style: n
              } = m, f = new FontFace(g, h, n);
              this.addNativeFontFace(f);
              try {
                await f.load(), this.#t.add(g), l?.(m);
              } catch {
                (0, e.warn)(`Cannot load system font: ${m.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(f);
              }
              return;
            }
            (0, e.unreachable)("Not implemented: loadSystemFont without the Font Loading API.");
          }
        }
        async bind(m) {
          if (m.attached || m.missingFile && !m.systemFontInfo)
            return;
          if (m.attached = !0, m.systemFontInfo) {
            await this.loadSystemFont(m);
            return;
          }
          if (this.isFontLoadingAPISupported) {
            const g = m.createNativeFontFace();
            if (g) {
              this.addNativeFontFace(g);
              try {
                await g.loaded;
              } catch (h) {
                throw (0, e.warn)(`Failed to load font '${g.family}': '${h}'.`), m.disableFontFace = !0, h;
              }
            }
            return;
          }
          const l = m.createFontFaceRule();
          if (l) {
            if (this.insertRule(l), this.isSyncFontLoadingSupported)
              return;
            await new Promise((g) => {
              const h = this._queueLoadingCallback(g);
              this._prepareFontLoadEvent(m, h);
            });
          }
        }
        get isFontLoadingAPISupported() {
          const m = !!this._document?.fonts;
          return (0, e.shadow)(this, "isFontLoadingAPISupported", m);
        }
        get isSyncFontLoadingSupported() {
          let m = !1;
          return (e.isNodeJS || typeof navigator < "u" && typeof navigator?.userAgent == "string" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (m = !0), (0, e.shadow)(this, "isSyncFontLoadingSupported", m);
        }
        _queueLoadingCallback(m) {
          function l() {
            for ((0, e.assert)(!h.done, "completeRequest() cannot be called twice."), h.done = !0; g.length > 0 && g[0].done; ) {
              const n = g.shift();
              setTimeout(n.callback, 0);
            }
          }
          const {
            loadingRequests: g
          } = this, h = {
            done: !1,
            complete: l,
            callback: m
          };
          return g.push(h), h;
        }
        get _loadTestFont() {
          const m = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
          return (0, e.shadow)(this, "_loadTestFont", m);
        }
        _prepareFontLoadEvent(m, l) {
          function g(V, q) {
            return V.charCodeAt(q) << 24 | V.charCodeAt(q + 1) << 16 | V.charCodeAt(q + 2) << 8 | V.charCodeAt(q + 3) & 255;
          }
          function h(V, q, tt, rt) {
            const Y = V.substring(0, q), B = V.substring(q + tt);
            return Y + rt + B;
          }
          let n, f;
          const p = this._document.createElement("canvas");
          p.width = 1, p.height = 1;
          const C = p.getContext("2d");
          let r = 0;
          function w(V, q) {
            if (++r > 30) {
              (0, e.warn)("Load test font never loaded."), q();
              return;
            }
            if (C.font = "30px " + V, C.fillText(".", 0, 20), C.getImageData(0, 0, 1, 1).data[3] > 0) {
              q();
              return;
            }
            setTimeout(w.bind(null, V, q));
          }
          const t = `lt${Date.now()}${this.loadTestFontId++}`;
          let o = this._loadTestFont;
          o = h(o, 976, t.length, t);
          const b = 16, R = 1482184792;
          let L = g(o, b);
          for (n = 0, f = t.length - 3; n < f; n += 4)
            L = L - R + g(t, n) | 0;
          n < t.length && (L = L - R + g(t + "XXX", n) | 0), o = h(o, b, 4, (0, e.string32)(L));
          const D = `url(data:font/opentype;base64,${btoa(o)});`, H = `@font-face {font-family:"${t}";src:${D}}`;
          this.insertRule(H);
          const X = this._document.createElement("div");
          X.style.visibility = "hidden", X.style.width = X.style.height = "10px", X.style.position = "absolute", X.style.top = X.style.left = "0px";
          for (const V of [m.loadedName, t]) {
            const q = this._document.createElement("span");
            q.textContent = "Hi", q.style.fontFamily = V, X.append(q);
          }
          this._document.body.append(X), w(t, () => {
            X.remove(), l.complete();
          });
        }
      }
      class v {
        constructor(m, {
          disableFontFace: l = !1,
          ignoreErrors: g = !1,
          inspectFont: h = null
        }) {
          this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
          for (const n in m)
            this[n] = m[n];
          this.disableFontFace = l === !0, this.ignoreErrors = g === !0, this._inspectFont = h;
        }
        createNativeFontFace() {
          if (!this.data || this.disableFontFace)
            return null;
          let m;
          if (!this.cssFontInfo)
            m = new FontFace(this.loadedName, this.data, {});
          else {
            const l = {
              weight: this.cssFontInfo.fontWeight
            };
            this.cssFontInfo.italicAngle && (l.style = `oblique ${this.cssFontInfo.italicAngle}deg`), m = new FontFace(this.cssFontInfo.fontFamily, this.data, l);
          }
          return this._inspectFont?.(this), m;
        }
        createFontFaceRule() {
          if (!this.data || this.disableFontFace)
            return null;
          const m = (0, e.bytesToString)(this.data), l = `url(data:${this.mimetype};base64,${btoa(m)});`;
          let g;
          if (!this.cssFontInfo)
            g = `@font-face {font-family:"${this.loadedName}";src:${l}}`;
          else {
            let h = `font-weight: ${this.cssFontInfo.fontWeight};`;
            this.cssFontInfo.italicAngle && (h += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), g = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${h}src:${l}}`;
          }
          return this._inspectFont?.(this, l), g;
        }
        getPathGenerator(m, l) {
          if (this.compiledGlyphs[l] !== void 0)
            return this.compiledGlyphs[l];
          let g;
          try {
            g = m.get(this.loadedName + "_path_" + l);
          } catch (n) {
            if (!this.ignoreErrors)
              throw n;
            (0, e.warn)(`getPathGenerator - ignoring character: "${n}".`);
          }
          if (!Array.isArray(g) || g.length === 0)
            return this.compiledGlyphs[l] = function(n, f) {
            };
          const h = [];
          for (let n = 0, f = g.length; n < f; )
            switch (g[n++]) {
              case e.FontRenderOps.BEZIER_CURVE_TO:
                {
                  const [p, C, r, w, t, o] = g.slice(n, n + 6);
                  h.push((A) => A.bezierCurveTo(p, C, r, w, t, o)), n += 6;
                }
                break;
              case e.FontRenderOps.MOVE_TO:
                {
                  const [p, C] = g.slice(n, n + 2);
                  h.push((r) => r.moveTo(p, C)), n += 2;
                }
                break;
              case e.FontRenderOps.LINE_TO:
                {
                  const [p, C] = g.slice(n, n + 2);
                  h.push((r) => r.lineTo(p, C)), n += 2;
                }
                break;
              case e.FontRenderOps.QUADRATIC_CURVE_TO:
                {
                  const [p, C, r, w] = g.slice(n, n + 4);
                  h.push((t) => t.quadraticCurveTo(p, C, r, w)), n += 4;
                }
                break;
              case e.FontRenderOps.RESTORE:
                h.push((p) => p.restore());
                break;
              case e.FontRenderOps.SAVE:
                h.push((p) => p.save());
                break;
              case e.FontRenderOps.SCALE:
                (0, e.assert)(h.length === 2, "Scale command is only valid at the third position.");
                break;
              case e.FontRenderOps.TRANSFORM:
                {
                  const [p, C, r, w, t, o] = g.slice(n, n + 6);
                  h.push((A) => A.transform(p, C, r, w, t, o)), n += 6;
                }
                break;
              case e.FontRenderOps.TRANSLATE:
                {
                  const [p, C] = g.slice(n, n + 2);
                  h.push((r) => r.translate(p, C)), n += 2;
                }
                break;
            }
          return this.compiledGlyphs[l] = function(f, p) {
            h[0](f), h[1](f), f.scale(p, -p);
            for (let C = 2, r = h.length; C < r; C++)
              h[C](f);
          };
        }
      }
    }
  ),
  /***/
  62: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        Metadata: () => (
          /* binding */
          y
        )
        /* harmony export */
      });
      var e = i(292);
      class y {
        #t;
        #e;
        constructor({
          parsedData: x,
          rawData: m
        }) {
          this.#t = x, this.#e = m;
        }
        getRaw() {
          return this.#e;
        }
        get(x) {
          return this.#t.get(x) ?? null;
        }
        getAll() {
          return (0, e.objectFromMap)(this.#t);
        }
        has(x) {
          return this.#t.has(x);
        }
      }
    }
  ),
  /***/
  457: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        PDFNetworkStream: () => (
          /* binding */
          g
        )
        /* harmony export */
      });
      var e = i(292), y = i(490);
      const v = 200, x = 206;
      function m(f) {
        const p = f.response;
        return typeof p != "string" ? p : (0, e.stringToBytes)(p).buffer;
      }
      class l {
        constructor(p, C = {}) {
          this.url = p, this.isHttp = /^https?:/i.test(p), this.httpHeaders = this.isHttp && C.httpHeaders || /* @__PURE__ */ Object.create(null), this.withCredentials = C.withCredentials || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
        }
        requestRange(p, C, r) {
          const w = {
            begin: p,
            end: C
          };
          for (const t in r)
            w[t] = r[t];
          return this.request(w);
        }
        requestFull(p) {
          return this.request(p);
        }
        request(p) {
          const C = new XMLHttpRequest(), r = this.currXhrId++, w = this.pendingRequests[r] = {
            xhr: C
          };
          C.open("GET", this.url), C.withCredentials = this.withCredentials;
          for (const t in this.httpHeaders) {
            const o = this.httpHeaders[t];
            o !== void 0 && C.setRequestHeader(t, o);
          }
          return this.isHttp && "begin" in p && "end" in p ? (C.setRequestHeader("Range", `bytes=${p.begin}-${p.end - 1}`), w.expectedStatus = x) : w.expectedStatus = v, C.responseType = "arraybuffer", p.onError && (C.onerror = function(t) {
            p.onError(C.status);
          }), C.onreadystatechange = this.onStateChange.bind(this, r), C.onprogress = this.onProgress.bind(this, r), w.onHeadersReceived = p.onHeadersReceived, w.onDone = p.onDone, w.onError = p.onError, w.onProgress = p.onProgress, C.send(null), r;
        }
        onProgress(p, C) {
          const r = this.pendingRequests[p];
          r && r.onProgress?.(C);
        }
        onStateChange(p, C) {
          const r = this.pendingRequests[p];
          if (!r)
            return;
          const w = r.xhr;
          if (w.readyState >= 2 && r.onHeadersReceived && (r.onHeadersReceived(), delete r.onHeadersReceived), w.readyState !== 4 || !(p in this.pendingRequests))
            return;
          if (delete this.pendingRequests[p], w.status === 0 && this.isHttp) {
            r.onError?.(w.status);
            return;
          }
          const t = w.status || v;
          if (!(t === v && r.expectedStatus === x) && t !== r.expectedStatus) {
            r.onError?.(w.status);
            return;
          }
          const A = m(w);
          if (t === x) {
            const b = w.getResponseHeader("Content-Range"), R = /bytes (\d+)-(\d+)\/(\d+)/.exec(b);
            r.onDone({
              begin: parseInt(R[1], 10),
              chunk: A
            });
          } else
            A ? r.onDone({
              begin: 0,
              chunk: A
            }) : r.onError?.(w.status);
        }
        getRequestXhr(p) {
          return this.pendingRequests[p].xhr;
        }
        isPendingRequest(p) {
          return p in this.pendingRequests;
        }
        abortRequest(p) {
          const C = this.pendingRequests[p].xhr;
          delete this.pendingRequests[p], C.abort();
        }
      }
      class g {
        constructor(p) {
          this._source = p, this._manager = new l(p.url, {
            httpHeaders: p.httpHeaders,
            withCredentials: p.withCredentials
          }), this._rangeChunkSize = p.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
        }
        _onRangeRequestReaderClosed(p) {
          const C = this._rangeRequestReaders.indexOf(p);
          C >= 0 && this._rangeRequestReaders.splice(C, 1);
        }
        getFullReader() {
          return (0, e.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new h(this._manager, this._source), this._fullRequestReader;
        }
        getRangeReader(p, C) {
          const r = new n(this._manager, p, C);
          return r.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(r), r;
        }
        cancelAllRequests(p) {
          this._fullRequestReader?.cancel(p);
          for (const C of this._rangeRequestReaders.slice(0))
            C.cancel(p);
        }
      }
      class h {
        constructor(p, C) {
          this._manager = p;
          const r = {
            onHeadersReceived: this._onHeadersReceived.bind(this),
            onDone: this._onDone.bind(this),
            onError: this._onError.bind(this),
            onProgress: this._onProgress.bind(this)
          };
          this._url = C.url, this._fullRequestId = p.requestFull(r), this._headersReceivedCapability = Promise.withResolvers(), this._disableRange = C.disableRange || !1, this._contentLength = C.length, this._rangeChunkSize = C.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 p = this._fullRequestId, C = this._manager.getRequestXhr(p), r = (o) => C.getResponseHeader(o), {
            allowRangeRequests: w,
            suggestedLength: t
          } = (0, y.validateRangeRequestCapabilities)({
            getResponseHeader: r,
            isHttp: this._manager.isHttp,
            rangeChunkSize: this._rangeChunkSize,
            disableRange: this._disableRange
          });
          w && (this._isRangeSupported = !0), this._contentLength = t || this._contentLength, this._filename = (0, y.extractFilenameFromHeader)(r), this._isRangeSupported && this._manager.abortRequest(p), this._headersReceivedCapability.resolve();
        }
        _onDone(p) {
          if (p && (this._requests.length > 0 ? this._requests.shift().resolve({
            value: p.chunk,
            done: !1
          }) : this._cachedChunks.push(p.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
            for (const C of this._requests)
              C.resolve({
                value: void 0,
                done: !0
              });
            this._requests.length = 0;
          }
        }
        _onError(p) {
          this._storedError = (0, y.createResponseStatusError)(p, this._url), this._headersReceivedCapability.reject(this._storedError);
          for (const C of this._requests)
            C.reject(this._storedError);
          this._requests.length = 0, this._cachedChunks.length = 0;
        }
        _onProgress(p) {
          this.onProgress?.({
            loaded: p.loaded,
            total: p.lengthComputable ? p.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 p = Promise.withResolvers();
          return this._requests.push(p), p.promise;
        }
        cancel(p) {
          this._done = !0, this._headersReceivedCapability.reject(p);
          for (const C of this._requests)
            C.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
        }
      }
      class n {
        constructor(p, C, r) {
          this._manager = p;
          const w = {
            onDone: this._onDone.bind(this),
            onError: this._onError.bind(this),
            onProgress: this._onProgress.bind(this)
          };
          this._url = p.url, this._requestId = p.requestRange(C, r, w), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
        }
        _close() {
          this.onClosed?.(this);
        }
        _onDone(p) {
          const C = p.chunk;
          this._requests.length > 0 ? this._requests.shift().resolve({
            value: C,
            done: !1
          }) : this._queuedChunk = C, this._done = !0;
          for (const r of this._requests)
            r.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._close();
        }
        _onError(p) {
          this._storedError = (0, y.createResponseStatusError)(p, this._url);
          for (const C of this._requests)
            C.reject(this._storedError);
          this._requests.length = 0, this._queuedChunk = null;
        }
        _onProgress(p) {
          this.isStreamingSupported || this.onProgress?.({
            loaded: p.loaded
          });
        }
        get isStreamingSupported() {
          return !1;
        }
        async read() {
          if (this._storedError)
            throw this._storedError;
          if (this._queuedChunk !== null) {
            const C = this._queuedChunk;
            return this._queuedChunk = null, {
              value: C,
              done: !1
            };
          }
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const p = Promise.withResolvers();
          return this._requests.push(p), p.promise;
        }
        cancel(p) {
          this._done = !0;
          for (const C of this._requests)
            C.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
        }
      }
    }
  ),
  /***/
  490: (
    /***/
    (u, s, i) => {
      i.d(s, {
        createResponseStatusError: () => (
          /* binding */
          l
        ),
        extractFilenameFromHeader: () => (
          /* binding */
          m
        ),
        validateRangeRequestCapabilities: () => (
          /* binding */
          x
        ),
        validateResponseStatus: () => (
          /* binding */
          g
        )
      });
      var e = i(292);
      function y(h) {
        let n = !0, f = p("filename\\*", "i").exec(h);
        if (f) {
          f = f[1];
          let b = t(f);
          return b = unescape(b), b = o(b), b = A(b), r(b);
        }
        if (f = w(h), f) {
          const b = A(f);
          return r(b);
        }
        if (f = p("filename", "i").exec(h), f) {
          f = f[1];
          let b = t(f);
          return b = A(b), r(b);
        }
        function p(b, R) {
          return new RegExp("(?:^|;)\\s*" + b + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', R);
        }
        function C(b, R) {
          if (b) {
            if (!/^[\x00-\xFF]+$/.test(R))
              return R;
            try {
              const L = new TextDecoder(b, {
                fatal: !0
              }), D = (0, e.stringToBytes)(R);
              R = L.decode(D), n = !1;
            } catch {
            }
          }
          return R;
        }
        function r(b) {
          return n && /[\x80-\xff]/.test(b) && (b = C("utf-8", b), n && (b = C("iso-8859-1", b))), b;
        }
        function w(b) {
          const R = [];
          let L;
          const D = p("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
          for (; (L = D.exec(b)) !== null; ) {
            let [, X, V, q] = L;
            if (X = parseInt(X, 10), X in R) {
              if (X === 0)
                break;
              continue;
            }
            R[X] = [V, q];
          }
          const H = [];
          for (let X = 0; X < R.length && X in R; ++X) {
            let [V, q] = R[X];
            q = t(q), V && (q = unescape(q), X === 0 && (q = o(q))), H.push(q);
          }
          return H.join("");
        }
        function t(b) {
          if (b.startsWith('"')) {
            const R = b.slice(1).split('\\"');
            for (let L = 0; L < R.length; ++L) {
              const D = R[L].indexOf('"');
              D !== -1 && (R[L] = R[L].slice(0, D), R.length = L + 1), R[L] = R[L].replaceAll(/\\(.)/g, "$1");
            }
            b = R.join('"');
          }
          return b;
        }
        function o(b) {
          const R = b.indexOf("'");
          if (R === -1)
            return b;
          const L = b.slice(0, R), H = b.slice(R + 1).replace(/^[^']*'/, "");
          return C(L, H);
        }
        function A(b) {
          return !b.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(b) ? b : b.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(R, L, D, H) {
            if (D === "q" || D === "Q")
              return H = H.replaceAll("_", " "), H = H.replaceAll(/=([0-9a-fA-F]{2})/g, function(X, V) {
                return String.fromCharCode(parseInt(V, 16));
              }), C(L, H);
            try {
              H = atob(H);
            } catch {
            }
            return C(L, H);
          });
        }
        return "";
      }
      var v = i(419);
      function x({
        getResponseHeader: h,
        isHttp: n,
        rangeChunkSize: f,
        disableRange: p
      }) {
        const C = {
          allowRangeRequests: !1,
          suggestedLength: void 0
        }, r = parseInt(h("Content-Length"), 10);
        return !Number.isInteger(r) || (C.suggestedLength = r, r <= 2 * f) || p || !n || h("Accept-Ranges") !== "bytes" || (h("Content-Encoding") || "identity") !== "identity" || (C.allowRangeRequests = !0), C;
      }
      function m(h) {
        const n = h("Content-Disposition");
        if (n) {
          let f = y(n);
          if (f.includes("%"))
            try {
              f = decodeURIComponent(f);
            } catch {
            }
          if ((0, v.isPdfFile)(f))
            return f;
        }
        return null;
      }
      function l(h, n) {
        return h === 404 || h === 0 && n.startsWith("file:") ? new e.MissingPDFException('Missing PDF "' + n + '".') : new e.UnexpectedResponseException(`Unexpected server response (${h}) while retrieving PDF "${n}".`, h);
      }
      function g(h) {
        return h === 200 || h === 206;
      }
    }
  ),
  /***/
  786: (
    /***/
    (u, s, i) => {
      i.a(u, async (e, y) => {
        try {
          let f = function(R) {
            const L = h.parse(R);
            return L.protocol === "file:" || L.host ? L : /^[a-z]:[/\\]/i.test(R) ? h.parse(`file:///${R}`) : (L.host || (L.protocol = "file:"), L);
          }, w = function(R, L) {
            return {
              protocol: R.protocol,
              auth: R.auth,
              host: R.hostname,
              port: R.port,
              path: R.path,
              method: "GET",
              headers: L
            };
          };
          i.d(s, {
            /* harmony export */
            PDFNodeStream: () => (
              /* binding */
              p
            )
            /* harmony export */
          });
          var v = i(292), x = i(490);
          let m, l, g, h;
          v.isNodeJS && (m = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), l = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), g = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), h = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ));
          const n = /^file:\/\/\/[a-zA-Z]:\//;
          class p {
            constructor(L) {
              this.source = L, this.url = f(L.url), this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:", this.isFsUrl = this.url.protocol === "file:", this.httpHeaders = this.isHttp && L.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              return this._fullRequestReader?._loaded ?? 0;
            }
            getFullReader() {
              return (0, v.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = this.isFsUrl ? new A(this) : new t(this), this._fullRequestReader;
            }
            getRangeReader(L, D) {
              if (D <= this._progressiveDataLength)
                return null;
              const H = this.isFsUrl ? new b(this, L, D) : new o(this, L, D);
              return this._rangeRequestReaders.push(H), H;
            }
            cancelAllRequests(L) {
              this._fullRequestReader?.cancel(L);
              for (const D of this._rangeRequestReaders.slice(0))
                D.cancel(L);
            }
          }
          class C {
            constructor(L) {
              this._url = L.url, this._done = !1, this._storedError = null, this.onProgress = null;
              const D = L.source;
              this._contentLength = D.length, this._loaded = 0, this._filename = null, this._disableRange = D.disableRange || !1, this._rangeChunkSize = D.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !D.disableStream, this._isRangeSupported = !D.disableRange, this._readableStream = null, this._readCapability = Promise.withResolvers(), this._headersCapability = Promise.withResolvers();
            }
            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() {
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const L = this._readableStream.read();
              return L === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += L.length, this.onProgress?.({
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: new Uint8Array(L).buffer,
                done: !1
              });
            }
            cancel(L) {
              if (!this._readableStream) {
                this._error(L);
                return;
              }
              this._readableStream.destroy(L);
            }
            _error(L) {
              this._storedError = L, this._readCapability.resolve();
            }
            _setReadableStream(L) {
              this._readableStream = L, L.on("readable", () => {
                this._readCapability.resolve();
              }), L.on("end", () => {
                L.destroy(), this._done = !0, this._readCapability.resolve();
              }), L.on("error", (D) => {
                this._error(D);
              }), !this._isStreamingSupported && this._isRangeSupported && this._error(new v.AbortException("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class r {
            constructor(L) {
              this._url = L.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
              const D = L.source;
              this._isStreamingSupported = !D.disableStream;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const L = this._readableStream.read();
              return L === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += L.length, this.onProgress?.({
                loaded: this._loaded
              }), {
                value: new Uint8Array(L).buffer,
                done: !1
              });
            }
            cancel(L) {
              if (!this._readableStream) {
                this._error(L);
                return;
              }
              this._readableStream.destroy(L);
            }
            _error(L) {
              this._storedError = L, this._readCapability.resolve();
            }
            _setReadableStream(L) {
              this._readableStream = L, L.on("readable", () => {
                this._readCapability.resolve();
              }), L.on("end", () => {
                L.destroy(), this._done = !0, this._readCapability.resolve();
              }), L.on("error", (D) => {
                this._error(D);
              }), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class t extends C {
            constructor(L) {
              super(L);
              const D = (H) => {
                if (H.statusCode === 404) {
                  const tt = new v.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = tt, this._headersCapability.reject(tt);
                  return;
                }
                this._headersCapability.resolve(), this._setReadableStream(H);
                const X = (tt) => this._readableStream.headers[tt.toLowerCase()], {
                  allowRangeRequests: V,
                  suggestedLength: q
                } = (0, x.validateRangeRequestCapabilities)({
                  getResponseHeader: X,
                  isHttp: L.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = V, this._contentLength = q || this._contentLength, this._filename = (0, x.extractFilenameFromHeader)(X);
              };
              this._request = null, this._url.protocol === "http:" ? this._request = l.request(w(this._url, L.httpHeaders), D) : this._request = g.request(w(this._url, L.httpHeaders), D), this._request.on("error", (H) => {
                this._storedError = H, this._headersCapability.reject(H);
              }), this._request.end();
            }
          }
          class o extends r {
            constructor(L, D, H) {
              super(L), this._httpHeaders = {};
              for (const V in L.httpHeaders) {
                const q = L.httpHeaders[V];
                q !== void 0 && (this._httpHeaders[V] = q);
              }
              this._httpHeaders.Range = `bytes=${D}-${H - 1}`;
              const X = (V) => {
                if (V.statusCode === 404) {
                  const q = new v.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = q;
                  return;
                }
                this._setReadableStream(V);
              };
              this._request = null, this._url.protocol === "http:" ? this._request = l.request(w(this._url, this._httpHeaders), X) : this._request = g.request(w(this._url, this._httpHeaders), X), this._request.on("error", (V) => {
                this._storedError = V;
              }), this._request.end();
            }
          }
          class A extends C {
            constructor(L) {
              super(L);
              let D = decodeURIComponent(this._url.path);
              n.test(this._url.href) && (D = D.replace(/^\//, "")), m.promises.lstat(D).then((H) => {
                this._contentLength = H.size, this._setReadableStream(m.createReadStream(D)), this._headersCapability.resolve();
              }, (H) => {
                H.code === "ENOENT" && (H = new v.MissingPDFException(`Missing PDF "${D}".`)), this._storedError = H, this._headersCapability.reject(H);
              });
            }
          }
          class b extends r {
            constructor(L, D, H) {
              super(L);
              let X = decodeURIComponent(this._url.path);
              n.test(this._url.href) && (X = X.replace(/^\//, "")), this._setReadableStream(m.createReadStream(X, {
                start: D,
                end: H - 1
              }));
            }
          }
          y();
        } catch (m) {
          y(m);
        }
      }, 1);
    }
  ),
  /***/
  573: (
    /***/
    (u, s, i) => {
      i.a(u, async (e, y) => {
        try {
          i.d(s, {
            /* harmony export */
            NodeCMapReaderFactory: () => (
              /* binding */
              p
            ),
            /* harmony export */
            NodeCanvasFactory: () => (
              /* binding */
              f
            ),
            /* harmony export */
            NodeFilterFactory: () => (
              /* binding */
              n
            ),
            /* harmony export */
            NodeStandardFontDataFactory: () => (
              /* binding */
              C
            )
            /* harmony export */
          });
          var v = i(583), x = i(292);
          let m, l, g;
          if (x.isNodeJS) {
            m = await import(
              /*webpackIgnore: true*/
              "./__vite-browser-external-DYxpcVy9.js"
            );
            try {
              l = await import(
                /*webpackIgnore: true*/
                "./__vite-browser-external-DYxpcVy9.js"
              );
            } catch {
            }
            try {
              g = await import(
                /*webpackIgnore: true*/
                "./index-V38oYatP.js"
              );
            } catch {
            }
          }
          const h = function(r) {
            return m.promises.readFile(r).then((w) => new Uint8Array(w));
          };
          class n extends v.BaseFilterFactory {
          }
          class f extends v.BaseCanvasFactory {
            _createCanvas(w, t) {
              return l.createCanvas(w, t);
            }
          }
          class p extends v.BaseCMapReaderFactory {
            _fetchData(w, t) {
              return h(w).then((o) => ({
                cMapData: o,
                compressionType: t
              }));
            }
          }
          class C extends v.BaseStandardFontDataFactory {
            _fetchData(w) {
              return h(w);
            }
          }
          y();
        } catch (m) {
          y(m);
        }
      }, 1);
    }
  ),
  /***/
  626: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        OptionalContentConfig: () => (
          /* binding */
          m
        )
        /* harmony export */
      });
      var e = i(292), y = i(651);
      const v = Symbol("INTERNAL");
      class x {
        #t = !1;
        #e = !1;
        #s = !1;
        #n = !0;
        constructor(g, {
          name: h,
          intent: n,
          usage: f
        }) {
          this.#t = !!(g & e.RenderingIntentFlag.DISPLAY), this.#e = !!(g & e.RenderingIntentFlag.PRINT), this.name = h, this.intent = n, this.usage = f;
        }
        get visible() {
          if (this.#s)
            return this.#n;
          if (!this.#n)
            return !1;
          const {
            print: g,
            view: h
          } = this.usage;
          return this.#t ? h?.viewState !== "OFF" : this.#e ? g?.printState !== "OFF" : !0;
        }
        _setVisible(g, h, n = !1) {
          g !== v && (0, e.unreachable)("Internal method `_setVisible` called."), this.#s = n, this.#n = h;
        }
      }
      class m {
        #t = null;
        #e = /* @__PURE__ */ new Map();
        #s = null;
        #n = null;
        constructor(g, h = e.RenderingIntentFlag.DISPLAY) {
          if (this.renderingIntent = h, this.name = null, this.creator = null, g !== null) {
            this.name = g.name, this.creator = g.creator, this.#n = g.order;
            for (const n of g.groups)
              this.#e.set(n.id, new x(h, n));
            if (g.baseState === "OFF")
              for (const n of this.#e.values())
                n._setVisible(v, !1);
            for (const n of g.on)
              this.#e.get(n)._setVisible(v, !0);
            for (const n of g.off)
              this.#e.get(n)._setVisible(v, !1);
            this.#s = this.getHash();
          }
        }
        #r(g) {
          const h = g.length;
          if (h < 2)
            return !0;
          const n = g[0];
          for (let f = 1; f < h; f++) {
            const p = g[f];
            let C;
            if (Array.isArray(p))
              C = this.#r(p);
            else if (this.#e.has(p))
              C = this.#e.get(p).visible;
            else
              return (0, e.warn)(`Optional content group not found: ${p}`), !0;
            switch (n) {
              case "And":
                if (!C)
                  return !1;
                break;
              case "Or":
                if (C)
                  return !0;
                break;
              case "Not":
                return !C;
              default:
                return !0;
            }
          }
          return n === "And";
        }
        isVisible(g) {
          if (this.#e.size === 0)
            return !0;
          if (!g)
            return (0, e.info)("Optional content group not defined."), !0;
          if (g.type === "OCG")
            return this.#e.has(g.id) ? this.#e.get(g.id).visible : ((0, e.warn)(`Optional content group not found: ${g.id}`), !0);
          if (g.type === "OCMD") {
            if (g.expression)
              return this.#r(g.expression);
            if (!g.policy || g.policy === "AnyOn") {
              for (const h of g.ids) {
                if (!this.#e.has(h))
                  return (0, e.warn)(`Optional content group not found: ${h}`), !0;
                if (this.#e.get(h).visible)
                  return !0;
              }
              return !1;
            } else if (g.policy === "AllOn") {
              for (const h of g.ids) {
                if (!this.#e.has(h))
                  return (0, e.warn)(`Optional content group not found: ${h}`), !0;
                if (!this.#e.get(h).visible)
                  return !1;
              }
              return !0;
            } else if (g.policy === "AnyOff") {
              for (const h of g.ids) {
                if (!this.#e.has(h))
                  return (0, e.warn)(`Optional content group not found: ${h}`), !0;
                if (!this.#e.get(h).visible)
                  return !0;
              }
              return !1;
            } else if (g.policy === "AllOff") {
              for (const h of g.ids) {
                if (!this.#e.has(h))
                  return (0, e.warn)(`Optional content group not found: ${h}`), !0;
                if (this.#e.get(h).visible)
                  return !1;
              }
              return !0;
            }
            return (0, e.warn)(`Unknown optional content policy ${g.policy}.`), !0;
          }
          return (0, e.warn)(`Unknown group type ${g.type}.`), !0;
        }
        setVisibility(g, h = !0) {
          const n = this.#e.get(g);
          if (!n) {
            (0, e.warn)(`Optional content group not found: ${g}`);
            return;
          }
          n._setVisible(v, !!h, !0), this.#t = null;
        }
        setOCGState({
          state: g,
          preserveRB: h
        }) {
          let n;
          for (const f of g) {
            switch (f) {
              case "ON":
              case "OFF":
              case "Toggle":
                n = f;
                continue;
            }
            const p = this.#e.get(f);
            if (p)
              switch (n) {
                case "ON":
                  p._setVisible(v, !0);
                  break;
                case "OFF":
                  p._setVisible(v, !1);
                  break;
                case "Toggle":
                  p._setVisible(v, !p.visible);
                  break;
              }
          }
          this.#t = null;
        }
        get hasInitialVisibility() {
          return this.#s === null || this.getHash() === this.#s;
        }
        getOrder() {
          return this.#e.size ? this.#n ? this.#n.slice() : [...this.#e.keys()] : null;
        }
        getGroups() {
          return this.#e.size > 0 ? (0, e.objectFromMap)(this.#e) : null;
        }
        getGroup(g) {
          return this.#e.get(g) || null;
        }
        getHash() {
          if (this.#t !== null)
            return this.#t;
          const g = new y.MurmurHash3_64();
          for (const [h, n] of this.#e)
            g.update(`${h}:${n.visible}`);
          return this.#t = g.hexdigest();
        }
      }
    }
  ),
  /***/
  814: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        cleanupTextLayer: () => (
          /* binding */
          n
        ),
        /* harmony export */
        renderTextLayer: () => (
          /* binding */
          t
        ),
        /* harmony export */
        updateTextLayer: () => (
          /* binding */
          o
        )
        /* harmony export */
      });
      var e = i(292), y = i(419);
      const v = 1e5, x = 30, m = 0.8, l = /* @__PURE__ */ new Map();
      let g = null;
      function h() {
        if (!g) {
          const A = document.createElement("canvas");
          A.className = "hiddenCanvasElement", document.body.append(A), g = A.getContext("2d", {
            alpha: !1
          });
        }
        return g;
      }
      function n() {
        g?.canvas.remove(), g = null;
      }
      function f(A) {
        const b = l.get(A);
        if (b)
          return b;
        const R = h(), L = R.font;
        R.canvas.width = R.canvas.height = x, R.font = `${x}px ${A}`;
        const D = R.measureText("");
        let H = D.fontBoundingBoxAscent, X = Math.abs(D.fontBoundingBoxDescent);
        if (H) {
          const q = H / (H + X);
          return l.set(A, q), R.canvas.width = R.canvas.height = 0, R.font = L, q;
        }
        R.strokeStyle = "red", R.clearRect(0, 0, x, x), R.strokeText("g", 0, 0);
        let V = R.getImageData(0, 0, x, x).data;
        X = 0;
        for (let q = V.length - 1 - 3; q >= 0; q -= 4)
          if (V[q] > 0) {
            X = Math.ceil(q / 4 / x);
            break;
          }
        R.clearRect(0, 0, x, x), R.strokeText("A", 0, x), V = R.getImageData(0, 0, x, x).data, H = 0;
        for (let q = 0, tt = V.length; q < tt; q += 4)
          if (V[q] > 0) {
            H = x - Math.floor(q / 4 / x);
            break;
          }
        if (R.canvas.width = R.canvas.height = 0, R.font = L, H) {
          const q = H / (H + X);
          return l.set(A, q), q;
        }
        return l.set(A, m), m;
      }
      function p(A, b, R) {
        const L = document.createElement("span"), D = {
          angle: 0,
          canvasWidth: 0,
          hasText: b.str !== "",
          hasEOL: b.hasEOL,
          fontSize: 0
        };
        A._textDivs.push(L);
        const H = e.Util.transform(A._transform, b.transform);
        let X = Math.atan2(H[1], H[0]);
        const V = R[b.fontName];
        V.vertical && (X += Math.PI / 2);
        const q = A._fontInspectorEnabled && V.fontSubstitution || V.fontFamily, tt = Math.hypot(H[2], H[3]), rt = tt * f(q);
        let Y, B;
        X === 0 ? (Y = H[4], B = H[5] - rt) : (Y = H[4] + rt * Math.sin(X), B = H[5] - rt * Math.cos(X));
        const U = "calc(var(--scale-factor)*", j = L.style;
        A._container === A._rootContainer ? (j.left = `${(100 * Y / A._pageWidth).toFixed(2)}%`, j.top = `${(100 * B / A._pageHeight).toFixed(2)}%`) : (j.left = `${U}${Y.toFixed(2)}px)`, j.top = `${U}${B.toFixed(2)}px)`), j.fontSize = `${U}${tt.toFixed(2)}px)`, j.fontFamily = q, D.fontSize = tt, L.setAttribute("role", "presentation"), L.textContent = b.str, L.dir = b.dir, A._fontInspectorEnabled && (L.dataset.fontName = V.fontSubstitutionLoadedName || b.fontName), X !== 0 && (D.angle = X * (180 / Math.PI));
        let Q = !1;
        if (b.str.length > 1)
          Q = !0;
        else if (b.str !== " " && b.transform[0] !== b.transform[3]) {
          const J = Math.abs(b.transform[0]), it = Math.abs(b.transform[3]);
          J !== it && Math.max(J, it) / Math.min(J, it) > 1.5 && (Q = !0);
        }
        Q && (D.canvasWidth = V.vertical ? b.height : b.width), A._textDivProperties.set(L, D), A._isReadableStream && A._layoutText(L);
      }
      function C(A) {
        const {
          div: b,
          scale: R,
          properties: L,
          ctx: D,
          prevFontSize: H,
          prevFontFamily: X
        } = A, {
          style: V
        } = b;
        let q = "";
        if (L.canvasWidth !== 0 && L.hasText) {
          const {
            fontFamily: tt
          } = V, {
            canvasWidth: rt,
            fontSize: Y
          } = L;
          (H !== Y || X !== tt) && (D.font = `${Y * R}px ${tt}`, A.prevFontSize = Y, A.prevFontFamily = tt);
          const {
            width: B
          } = D.measureText(b.textContent);
          B > 0 && (q = `scaleX(${rt * R / B})`);
        }
        L.angle !== 0 && (q = `rotate(${L.angle}deg) ${q}`), q.length > 0 && (V.transform = q);
      }
      function r(A) {
        if (A._canceled)
          return;
        const b = A._textDivs, R = A._capability;
        if (b.length > v) {
          R.resolve();
          return;
        }
        if (!A._isReadableStream)
          for (const D of b)
            A._layoutText(D);
        R.resolve();
      }
      class w {
        constructor({
          textContentSource: b,
          container: R,
          viewport: L,
          textDivs: D,
          textDivProperties: H,
          textContentItemsStr: X
        }) {
          this._textContentSource = b, this._isReadableStream = b instanceof ReadableStream, this._container = this._rootContainer = R, this._textDivs = D || [], this._textContentItemsStr = X || [], this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled, this._reader = null, this._textDivProperties = H || /* @__PURE__ */ new WeakMap(), this._canceled = !1, this._capability = Promise.withResolvers(), this._layoutTextParams = {
            prevFontSize: null,
            prevFontFamily: null,
            div: null,
            scale: L.scale * (globalThis.devicePixelRatio || 1),
            properties: null,
            ctx: h()
          };
          const {
            pageWidth: V,
            pageHeight: q,
            pageX: tt,
            pageY: rt
          } = L.rawDims;
          this._transform = [1, 0, 0, -1, -tt, rt + q], this._pageWidth = V, this._pageHeight = q, (0, y.setLayerDimensions)(R, L), this._capability.promise.finally(() => {
            this._layoutTextParams = null;
          }).catch(() => {
          });
        }
        get promise() {
          return this._capability.promise;
        }
        cancel() {
          this._canceled = !0, this._reader && (this._reader.cancel(new e.AbortException("TextLayer task cancelled.")).catch(() => {
          }), this._reader = null), this._capability.reject(new e.AbortException("TextLayer task cancelled."));
        }
        _processItems(b, R) {
          for (const L of b) {
            if (L.str === void 0) {
              if (L.type === "beginMarkedContentProps" || L.type === "beginMarkedContent") {
                const D = this._container;
                this._container = document.createElement("span"), this._container.classList.add("markedContent"), L.id !== null && this._container.setAttribute("id", `${L.id}`), D.append(this._container);
              } else
                L.type === "endMarkedContent" && (this._container = this._container.parentNode);
              continue;
            }
            this._textContentItemsStr.push(L.str), p(this, L, R);
          }
        }
        _layoutText(b) {
          const R = this._layoutTextParams.properties = this._textDivProperties.get(b);
          if (this._layoutTextParams.div = b, C(this._layoutTextParams), R.hasText && this._container.append(b), R.hasEOL) {
            const L = document.createElement("br");
            L.setAttribute("role", "presentation"), this._container.append(L);
          }
        }
        _render() {
          const {
            promise: b,
            resolve: R,
            reject: L
          } = Promise.withResolvers();
          let D = /* @__PURE__ */ Object.create(null);
          if (this._isReadableStream) {
            const H = () => {
              this._reader.read().then(({
                value: X,
                done: V
              }) => {
                if (V) {
                  R();
                  return;
                }
                Object.assign(D, X.styles), this._processItems(X.items, D), H();
              }, L);
            };
            this._reader = this._textContentSource.getReader(), H();
          } else if (this._textContentSource) {
            const {
              items: H,
              styles: X
            } = this._textContentSource;
            this._processItems(H, X), R();
          } else
            throw new Error('No "textContentSource" parameter specified.');
          b.then(() => {
            D = null, r(this);
          }, this._capability.reject);
        }
      }
      function t(A) {
        const b = new w(A);
        return b._render(), b;
      }
      function o({
        container: A,
        viewport: b,
        textDivs: R,
        textDivProperties: L,
        mustRotate: D = !0,
        mustRescale: H = !0
      }) {
        if (D && (0, y.setLayerDimensions)(A, {
          rotation: b.rotation
        }), H) {
          const X = h(), q = {
            prevFontSize: null,
            prevFontFamily: null,
            div: null,
            scale: b.scale * (globalThis.devicePixelRatio || 1),
            properties: null,
            ctx: X
          };
          for (const tt of R)
            q.properties = L.get(tt), q.div = tt, C(q);
        }
      }
    }
  ),
  /***/
  585: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        PDFDataTransportStream: () => (
          /* binding */
          v
        )
        /* harmony export */
      });
      var e = i(292), y = i(419);
      class v {
        constructor(g, {
          disableRange: h = !1,
          disableStream: n = !1
        }) {
          (0, e.assert)(g, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
          const {
            length: f,
            initialData: p,
            progressiveDone: C,
            contentDispositionFilename: r
          } = g;
          if (this._queuedChunks = [], this._progressiveDone = C, this._contentDispositionFilename = r, p?.length > 0) {
            const w = p instanceof Uint8Array && p.byteLength === p.buffer.byteLength ? p.buffer : new Uint8Array(p).buffer;
            this._queuedChunks.push(w);
          }
          this._pdfDataRangeTransport = g, this._isStreamingSupported = !n, this._isRangeSupported = !h, this._contentLength = f, this._fullRequestReader = null, this._rangeReaders = [], g.addRangeListener((w, t) => {
            this._onReceiveData({
              begin: w,
              chunk: t
            });
          }), g.addProgressListener((w, t) => {
            this._onProgress({
              loaded: w,
              total: t
            });
          }), g.addProgressiveReadListener((w) => {
            this._onReceiveData({
              chunk: w
            });
          }), g.addProgressiveDoneListener(() => {
            this._onProgressiveDone();
          }), g.transportReady();
        }
        _onReceiveData({
          begin: g,
          chunk: h
        }) {
          const n = h instanceof Uint8Array && h.byteLength === h.buffer.byteLength ? h.buffer : new Uint8Array(h).buffer;
          if (g === void 0)
            this._fullRequestReader ? this._fullRequestReader._enqueue(n) : this._queuedChunks.push(n);
          else {
            const f = this._rangeReaders.some(function(p) {
              return p._begin !== g ? !1 : (p._enqueue(n), !0);
            });
            (0, e.assert)(f, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
          }
        }
        get _progressiveDataLength() {
          return this._fullRequestReader?._loaded ?? 0;
        }
        _onProgress(g) {
          g.total === void 0 ? this._rangeReaders[0]?.onProgress?.({
            loaded: g.loaded
          }) : this._fullRequestReader?.onProgress?.({
            loaded: g.loaded,
            total: g.total
          });
        }
        _onProgressiveDone() {
          this._fullRequestReader?.progressiveDone(), this._progressiveDone = !0;
        }
        _removeRangeReader(g) {
          const h = this._rangeReaders.indexOf(g);
          h >= 0 && this._rangeReaders.splice(h, 1);
        }
        getFullReader() {
          (0, e.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
          const g = this._queuedChunks;
          return this._queuedChunks = null, new x(this, g, this._progressiveDone, this._contentDispositionFilename);
        }
        getRangeReader(g, h) {
          if (h <= this._progressiveDataLength)
            return null;
          const n = new m(this, g, h);
          return this._pdfDataRangeTransport.requestDataRange(g, h), this._rangeReaders.push(n), n;
        }
        cancelAllRequests(g) {
          this._fullRequestReader?.cancel(g);
          for (const h of this._rangeReaders.slice(0))
            h.cancel(g);
          this._pdfDataRangeTransport.abort();
        }
      }
      class x {
        constructor(g, h, n = !1, f = null) {
          this._stream = g, this._done = n || !1, this._filename = (0, y.isPdfFile)(f) ? f : null, this._queuedChunks = h || [], this._loaded = 0;
          for (const p of this._queuedChunks)
            this._loaded += p.byteLength;
          this._requests = [], this._headersReady = Promise.resolve(), g._fullRequestReader = this, this.onProgress = null;
        }
        _enqueue(g) {
          this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
            value: g,
            done: !1
          }) : this._queuedChunks.push(g), this._loaded += g.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 g = Promise.withResolvers();
          return this._requests.push(g), g.promise;
        }
        cancel(g) {
          this._done = !0;
          for (const h of this._requests)
            h.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0;
        }
        progressiveDone() {
          this._done || (this._done = !0);
        }
      }
      class m {
        constructor(g, h, n) {
          this._stream = g, this._begin = h, this._end = n, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
        }
        _enqueue(g) {
          if (!this._done) {
            if (this._requests.length === 0)
              this._queuedChunk = g;
            else {
              this._requests.shift().resolve({
                value: g,
                done: !1
              });
              for (const n of this._requests)
                n.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 h = this._queuedChunk;
            return this._queuedChunk = null, {
              value: h,
              done: !1
            };
          }
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const g = Promise.withResolvers();
          return this._requests.push(g), g.promise;
        }
        cancel(g) {
          this._done = !0;
          for (const h of this._requests)
            h.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._stream._removeRangeReader(this);
        }
      }
    }
  ),
  /***/
  164: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        GlobalWorkerOptions: () => (
          /* binding */
          e
        )
        /* harmony export */
      });
      class e {
        static #t = null;
        static #e = "";
        static get workerPort() {
          return this.#t;
        }
        static set workerPort(v) {
          if (!(typeof Worker < "u" && v instanceof Worker) && v !== null)
            throw new Error("Invalid `workerPort` type.");
          this.#t = v;
        }
        static get workerSrc() {
          return this.#e;
        }
        static set workerSrc(v) {
          if (typeof v != "string")
            throw new Error("Invalid `workerSrc` type.");
          this.#e = v;
        }
      }
    }
  ),
  /***/
  284: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        XfaLayer: () => (
          /* binding */
          y
        )
        /* harmony export */
      });
      var e = i(50);
      class y {
        static setupStorage(x, m, l, g, h) {
          const n = g.getValue(m, {
            value: null
          });
          switch (l.name) {
            case "textarea":
              if (n.value !== null && (x.textContent = n.value), h === "print")
                break;
              x.addEventListener("input", (f) => {
                g.setValue(m, {
                  value: f.target.value
                });
              });
              break;
            case "input":
              if (l.attributes.type === "radio" || l.attributes.type === "checkbox") {
                if (n.value === l.attributes.xfaOn ? x.setAttribute("checked", !0) : n.value === l.attributes.xfaOff && x.removeAttribute("checked"), h === "print")
                  break;
                x.addEventListener("change", (f) => {
                  g.setValue(m, {
                    value: f.target.checked ? f.target.getAttribute("xfaOn") : f.target.getAttribute("xfaOff")
                  });
                });
              } else {
                if (n.value !== null && x.setAttribute("value", n.value), h === "print")
                  break;
                x.addEventListener("input", (f) => {
                  g.setValue(m, {
                    value: f.target.value
                  });
                });
              }
              break;
            case "select":
              if (n.value !== null) {
                x.setAttribute("value", n.value);
                for (const f of l.children)
                  f.attributes.value === n.value ? f.attributes.selected = !0 : f.attributes.hasOwnProperty("selected") && delete f.attributes.selected;
              }
              x.addEventListener("input", (f) => {
                const p = f.target.options, C = p.selectedIndex === -1 ? "" : p[p.selectedIndex].value;
                g.setValue(m, {
                  value: C
                });
              });
              break;
          }
        }
        static setAttributes({
          html: x,
          element: m,
          storage: l = null,
          intent: g,
          linkService: h
        }) {
          const {
            attributes: n
          } = m, f = x instanceof HTMLAnchorElement;
          n.type === "radio" && (n.name = `${n.name}-${g}`);
          for (const [p, C] of Object.entries(n))
            if (C != null)
              switch (p) {
                case "class":
                  C.length && x.setAttribute(p, C.join(" "));
                  break;
                case "dataId":
                  break;
                case "id":
                  x.setAttribute("data-element-id", C);
                  break;
                case "style":
                  Object.assign(x.style, C);
                  break;
                case "textContent":
                  x.textContent = C;
                  break;
                default:
                  (!f || p !== "href" && p !== "newWindow") && x.setAttribute(p, C);
              }
          f && h.addLinkAttributes(x, n.href, n.newWindow), l && n.dataId && this.setupStorage(x, n.dataId, m, l);
        }
        static render(x) {
          const m = x.annotationStorage, l = x.linkService, g = x.xfaHtml, h = x.intent || "display", n = document.createElement(g.name);
          g.attributes && this.setAttributes({
            html: n,
            element: g,
            intent: h,
            linkService: l
          });
          const f = h !== "richText", p = x.div;
          if (p.append(n), x.viewport) {
            const w = `matrix(${x.viewport.transform.join(",")})`;
            p.style.transform = w;
          }
          f && p.setAttribute("class", "xfaLayer xfaFont");
          const C = [];
          if (g.children.length === 0) {
            if (g.value) {
              const w = document.createTextNode(g.value);
              n.append(w), f && e.XfaText.shouldBuildText(g.name) && C.push(w);
            }
            return {
              textDivs: C
            };
          }
          const r = [[g, -1, n]];
          for (; r.length > 0; ) {
            const [w, t, o] = r.at(-1);
            if (t + 1 === w.children.length) {
              r.pop();
              continue;
            }
            const A = w.children[++r.at(-1)[1]];
            if (A === null)
              continue;
            const {
              name: b
            } = A;
            if (b === "#text") {
              const L = document.createTextNode(A.value);
              C.push(L), o.append(L);
              continue;
            }
            const R = A?.attributes?.xmlns ? document.createElementNS(A.attributes.xmlns, b) : document.createElement(b);
            if (o.append(R), A.attributes && this.setAttributes({
              html: R,
              element: A,
              storage: m,
              intent: h,
              linkService: l
            }), A.children?.length > 0)
              r.push([A, -1, R]);
            else if (A.value) {
              const L = document.createTextNode(A.value);
              f && e.XfaText.shouldBuildText(b) && C.push(L), R.append(L);
            }
          }
          for (const w of p.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
            w.setAttribute("readOnly", !0);
          return {
            textDivs: C
          };
        }
        static update(x) {
          const m = `matrix(${x.viewport.transform.join(",")})`;
          x.div.style.transform = m, x.div.hidden = !1;
        }
      }
    }
  ),
  /***/
  50: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        XfaText: () => (
          /* binding */
          e
        )
        /* harmony export */
      });
      class e {
        static textContent(v) {
          const x = [], m = {
            items: x,
            styles: /* @__PURE__ */ Object.create(null)
          };
          function l(g) {
            if (!g)
              return;
            let h = null;
            const n = g.name;
            if (n === "#text")
              h = g.value;
            else if (e.shouldBuildText(n))
              g?.attributes?.textContent ? h = g.attributes.textContent : g.value && (h = g.value);
            else
              return;
            if (h !== null && x.push({
              str: h
            }), !!g.children)
              for (const f of g.children)
                l(f);
          }
          return l(v), m;
        }
        static shouldBuildText(v) {
          return !(v === "textarea" || v === "input" || v === "option" || v === "select");
        }
      }
    }
  ),
  /***/
  228: (
    /***/
    (u, s, i) => {
      i.a(u, async (e, y) => {
        try {
          i.d(s, {
            /* harmony export */
            AbortException: () => (
              /* reexport safe */
              v.AbortException
            ),
            /* harmony export */
            AnnotationEditorLayer: () => (
              /* reexport safe */
              g.AnnotationEditorLayer
            ),
            /* harmony export */
            AnnotationEditorParamsType: () => (
              /* reexport safe */
              v.AnnotationEditorParamsType
            ),
            /* harmony export */
            AnnotationEditorType: () => (
              /* reexport safe */
              v.AnnotationEditorType
            ),
            /* harmony export */
            AnnotationEditorUIManager: () => (
              /* reexport safe */
              h.AnnotationEditorUIManager
            ),
            /* harmony export */
            AnnotationLayer: () => (
              /* reexport safe */
              n.AnnotationLayer
            ),
            /* harmony export */
            AnnotationMode: () => (
              /* reexport safe */
              v.AnnotationMode
            ),
            /* harmony export */
            CMapCompressionType: () => (
              /* reexport safe */
              v.CMapCompressionType
            ),
            /* harmony export */
            ColorPicker: () => (
              /* reexport safe */
              f.ColorPicker
            ),
            /* harmony export */
            DOMSVGFactory: () => (
              /* reexport safe */
              m.DOMSVGFactory
            ),
            /* harmony export */
            DrawLayer: () => (
              /* reexport safe */
              p.DrawLayer
            ),
            /* harmony export */
            FeatureTest: () => (
              /* reexport safe */
              v.FeatureTest
            ),
            /* harmony export */
            GlobalWorkerOptions: () => (
              /* reexport safe */
              C.GlobalWorkerOptions
            ),
            /* harmony export */
            ImageKind: () => (
              /* reexport safe */
              v.ImageKind
            ),
            /* harmony export */
            InvalidPDFException: () => (
              /* reexport safe */
              v.InvalidPDFException
            ),
            /* harmony export */
            MissingPDFException: () => (
              /* reexport safe */
              v.MissingPDFException
            ),
            /* harmony export */
            OPS: () => (
              /* reexport safe */
              v.OPS
            ),
            /* harmony export */
            Outliner: () => (
              /* reexport safe */
              r.Outliner
            ),
            /* harmony export */
            PDFDataRangeTransport: () => (
              /* reexport safe */
              x.PDFDataRangeTransport
            ),
            /* harmony export */
            PDFDateString: () => (
              /* reexport safe */
              m.PDFDateString
            ),
            /* harmony export */
            PDFWorker: () => (
              /* reexport safe */
              x.PDFWorker
            ),
            /* harmony export */
            PasswordResponses: () => (
              /* reexport safe */
              v.PasswordResponses
            ),
            /* harmony export */
            PermissionFlag: () => (
              /* reexport safe */
              v.PermissionFlag
            ),
            /* harmony export */
            PixelsPerInch: () => (
              /* reexport safe */
              m.PixelsPerInch
            ),
            /* harmony export */
            RenderingCancelledException: () => (
              /* reexport safe */
              m.RenderingCancelledException
            ),
            /* harmony export */
            UnexpectedResponseException: () => (
              /* reexport safe */
              v.UnexpectedResponseException
            ),
            /* harmony export */
            Util: () => (
              /* reexport safe */
              v.Util
            ),
            /* harmony export */
            VerbosityLevel: () => (
              /* reexport safe */
              v.VerbosityLevel
            ),
            /* harmony export */
            XfaLayer: () => (
              /* reexport safe */
              w.XfaLayer
            ),
            /* harmony export */
            build: () => (
              /* reexport safe */
              x.build
            ),
            /* harmony export */
            createValidAbsoluteUrl: () => (
              /* reexport safe */
              v.createValidAbsoluteUrl
            ),
            /* harmony export */
            fetchData: () => (
              /* reexport safe */
              m.fetchData
            ),
            /* harmony export */
            getDocument: () => (
              /* reexport safe */
              x.getDocument
            ),
            /* harmony export */
            getFilenameFromUrl: () => (
              /* reexport safe */
              m.getFilenameFromUrl
            ),
            /* harmony export */
            getPdfFilenameFromUrl: () => (
              /* reexport safe */
              m.getPdfFilenameFromUrl
            ),
            /* harmony export */
            getXfaPageViewport: () => (
              /* reexport safe */
              m.getXfaPageViewport
            ),
            /* harmony export */
            isDataScheme: () => (
              /* reexport safe */
              m.isDataScheme
            ),
            /* harmony export */
            isPdfFile: () => (
              /* reexport safe */
              m.isPdfFile
            ),
            /* harmony export */
            noContextMenu: () => (
              /* reexport safe */
              m.noContextMenu
            ),
            /* harmony export */
            normalizeUnicode: () => (
              /* reexport safe */
              v.normalizeUnicode
            ),
            /* harmony export */
            renderTextLayer: () => (
              /* reexport safe */
              l.renderTextLayer
            ),
            /* harmony export */
            setLayerDimensions: () => (
              /* reexport safe */
              m.setLayerDimensions
            ),
            /* harmony export */
            shadow: () => (
              /* reexport safe */
              v.shadow
            ),
            /* harmony export */
            updateTextLayer: () => (
              /* reexport safe */
              l.updateTextLayer
            ),
            /* harmony export */
            version: () => (
              /* reexport safe */
              x.version
            )
            /* harmony export */
          });
          var v = i(292), x = i(831), m = i(419), l = i(814), g = i(731), h = i(830), n = i(976), f = i(259), p = i(47), C = i(164), r = i(61), w = i(284), t = e([x]);
          x = (t.then ? (await t)() : t)[0];
          const o = "4.2.67", A = "49b388101";
          y();
        } catch (o) {
          y(o);
        }
      });
    }
  ),
  /***/
  178: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        MessageHandler: () => (
          /* binding */
          m
        )
        /* harmony export */
      });
      var e = i(292);
      const y = {
        UNKNOWN: 0,
        DATA: 1,
        ERROR: 2
      }, v = {
        UNKNOWN: 0,
        CANCEL: 1,
        CANCEL_COMPLETE: 2,
        CLOSE: 3,
        ENQUEUE: 4,
        ERROR: 5,
        PULL: 6,
        PULL_COMPLETE: 7,
        START_COMPLETE: 8
      };
      function x(l) {
        switch (l instanceof Error || typeof l == "object" && l !== null || (0, e.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), l.name) {
          case "AbortException":
            return new e.AbortException(l.message);
          case "MissingPDFException":
            return new e.MissingPDFException(l.message);
          case "PasswordException":
            return new e.PasswordException(l.message, l.code);
          case "UnexpectedResponseException":
            return new e.UnexpectedResponseException(l.message, l.status);
          case "UnknownErrorException":
            return new e.UnknownErrorException(l.message, l.details);
          default:
            return new e.UnknownErrorException(l.message, l.toString());
        }
      }
      class m {
        constructor(g, h, n) {
          this.sourceName = g, this.targetName = h, this.comObj = n, 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 = (f) => {
            const p = f.data;
            if (p.targetName !== this.sourceName)
              return;
            if (p.stream) {
              this.#e(p);
              return;
            }
            if (p.callback) {
              const r = p.callbackId, w = this.callbackCapabilities[r];
              if (!w)
                throw new Error(`Cannot resolve callback ${r}`);
              if (delete this.callbackCapabilities[r], p.callback === y.DATA)
                w.resolve(p.data);
              else if (p.callback === y.ERROR)
                w.reject(x(p.reason));
              else
                throw new Error("Unexpected callback case");
              return;
            }
            const C = this.actionHandler[p.action];
            if (!C)
              throw new Error(`Unknown action from worker: ${p.action}`);
            if (p.callbackId) {
              const r = this.sourceName, w = p.sourceName;
              new Promise(function(t) {
                t(C(p.data));
              }).then(function(t) {
                n.postMessage({
                  sourceName: r,
                  targetName: w,
                  callback: y.DATA,
                  callbackId: p.callbackId,
                  data: t
                });
              }, function(t) {
                n.postMessage({
                  sourceName: r,
                  targetName: w,
                  callback: y.ERROR,
                  callbackId: p.callbackId,
                  reason: x(t)
                });
              });
              return;
            }
            if (p.streamId) {
              this.#t(p);
              return;
            }
            C(p.data);
          }, n.addEventListener("message", this._onComObjOnMessage);
        }
        on(g, h) {
          const n = this.actionHandler;
          if (n[g])
            throw new Error(`There is already an actionName called "${g}"`);
          n[g] = h;
        }
        send(g, h, n) {
          this.comObj.postMessage({
            sourceName: this.sourceName,
            targetName: this.targetName,
            action: g,
            data: h
          }, n);
        }
        sendWithPromise(g, h, n) {
          const f = this.callbackId++, p = Promise.withResolvers();
          this.callbackCapabilities[f] = p;
          try {
            this.comObj.postMessage({
              sourceName: this.sourceName,
              targetName: this.targetName,
              action: g,
              callbackId: f,
              data: h
            }, n);
          } catch (C) {
            p.reject(C);
          }
          return p.promise;
        }
        sendWithStream(g, h, n, f) {
          const p = this.streamId++, C = this.sourceName, r = this.targetName, w = this.comObj;
          return new ReadableStream({
            start: (t) => {
              const o = Promise.withResolvers();
              return this.streamControllers[p] = {
                controller: t,
                startCall: o,
                pullCall: null,
                cancelCall: null,
                isClosed: !1
              }, w.postMessage({
                sourceName: C,
                targetName: r,
                action: g,
                streamId: p,
                data: h,
                desiredSize: t.desiredSize
              }, f), o.promise;
            },
            pull: (t) => {
              const o = Promise.withResolvers();
              return this.streamControllers[p].pullCall = o, w.postMessage({
                sourceName: C,
                targetName: r,
                stream: v.PULL,
                streamId: p,
                desiredSize: t.desiredSize
              }), o.promise;
            },
            cancel: (t) => {
              (0, e.assert)(t instanceof Error, "cancel must have a valid reason");
              const o = Promise.withResolvers();
              return this.streamControllers[p].cancelCall = o, this.streamControllers[p].isClosed = !0, w.postMessage({
                sourceName: C,
                targetName: r,
                stream: v.CANCEL,
                streamId: p,
                reason: x(t)
              }), o.promise;
            }
          }, n);
        }
        #t(g) {
          const h = g.streamId, n = this.sourceName, f = g.sourceName, p = this.comObj, C = this, r = this.actionHandler[g.action], w = {
            enqueue(t, o = 1, A) {
              if (this.isCancelled)
                return;
              const b = this.desiredSize;
              this.desiredSize -= o, b > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), p.postMessage({
                sourceName: n,
                targetName: f,
                stream: v.ENQUEUE,
                streamId: h,
                chunk: t
              }, A);
            },
            close() {
              this.isCancelled || (this.isCancelled = !0, p.postMessage({
                sourceName: n,
                targetName: f,
                stream: v.CLOSE,
                streamId: h
              }), delete C.streamSinks[h]);
            },
            error(t) {
              (0, e.assert)(t instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, p.postMessage({
                sourceName: n,
                targetName: f,
                stream: v.ERROR,
                streamId: h,
                reason: x(t)
              }));
            },
            sinkCapability: Promise.withResolvers(),
            onPull: null,
            onCancel: null,
            isCancelled: !1,
            desiredSize: g.desiredSize,
            ready: null
          };
          w.sinkCapability.resolve(), w.ready = w.sinkCapability.promise, this.streamSinks[h] = w, new Promise(function(t) {
            t(r(g.data, w));
          }).then(function() {
            p.postMessage({
              sourceName: n,
              targetName: f,
              stream: v.START_COMPLETE,
              streamId: h,
              success: !0
            });
          }, function(t) {
            p.postMessage({
              sourceName: n,
              targetName: f,
              stream: v.START_COMPLETE,
              streamId: h,
              reason: x(t)
            });
          });
        }
        #e(g) {
          const h = g.streamId, n = this.sourceName, f = g.sourceName, p = this.comObj, C = this.streamControllers[h], r = this.streamSinks[h];
          switch (g.stream) {
            case v.START_COMPLETE:
              g.success ? C.startCall.resolve() : C.startCall.reject(x(g.reason));
              break;
            case v.PULL_COMPLETE:
              g.success ? C.pullCall.resolve() : C.pullCall.reject(x(g.reason));
              break;
            case v.PULL:
              if (!r) {
                p.postMessage({
                  sourceName: n,
                  targetName: f,
                  stream: v.PULL_COMPLETE,
                  streamId: h,
                  success: !0
                });
                break;
              }
              r.desiredSize <= 0 && g.desiredSize > 0 && r.sinkCapability.resolve(), r.desiredSize = g.desiredSize, new Promise(function(w) {
                w(r.onPull?.());
              }).then(function() {
                p.postMessage({
                  sourceName: n,
                  targetName: f,
                  stream: v.PULL_COMPLETE,
                  streamId: h,
                  success: !0
                });
              }, function(w) {
                p.postMessage({
                  sourceName: n,
                  targetName: f,
                  stream: v.PULL_COMPLETE,
                  streamId: h,
                  reason: x(w)
                });
              });
              break;
            case v.ENQUEUE:
              if ((0, e.assert)(C, "enqueue should have stream controller"), C.isClosed)
                break;
              C.controller.enqueue(g.chunk);
              break;
            case v.CLOSE:
              if ((0, e.assert)(C, "close should have stream controller"), C.isClosed)
                break;
              C.isClosed = !0, C.controller.close(), this.#s(C, h);
              break;
            case v.ERROR:
              (0, e.assert)(C, "error should have stream controller"), C.controller.error(x(g.reason)), this.#s(C, h);
              break;
            case v.CANCEL_COMPLETE:
              g.success ? C.cancelCall.resolve() : C.cancelCall.reject(x(g.reason)), this.#s(C, h);
              break;
            case v.CANCEL:
              if (!r)
                break;
              new Promise(function(w) {
                w(r.onCancel?.(x(g.reason)));
              }).then(function() {
                p.postMessage({
                  sourceName: n,
                  targetName: f,
                  stream: v.CANCEL_COMPLETE,
                  streamId: h,
                  success: !0
                });
              }, function(w) {
                p.postMessage({
                  sourceName: n,
                  targetName: f,
                  stream: v.CANCEL_COMPLETE,
                  streamId: h,
                  reason: x(w)
                });
              }), r.sinkCapability.reject(x(g.reason)), r.isCancelled = !0, delete this.streamSinks[h];
              break;
            default:
              throw new Error("Unexpected stream case");
          }
        }
        async #s(g, h) {
          await Promise.allSettled([g.startCall?.promise, g.pullCall?.promise, g.cancelCall?.promise]), delete this.streamControllers[h];
        }
        destroy() {
          this.comObj.removeEventListener("message", this._onComObjOnMessage);
        }
      }
    }
  ),
  /***/
  651: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        MurmurHash3_64: () => (
          /* binding */
          x
        )
        /* harmony export */
      });
      const e = 3285377520, y = 4294901760, v = 65535;
      class x {
        constructor(l) {
          this.h1 = l ? l & 4294967295 : e, this.h2 = l ? l & 4294967295 : e;
        }
        update(l) {
          let g, h;
          if (typeof l == "string") {
            g = new Uint8Array(l.length * 2), h = 0;
            for (let L = 0, D = l.length; L < D; L++) {
              const H = l.charCodeAt(L);
              H <= 255 ? g[h++] = H : (g[h++] = H >>> 8, g[h++] = H & 255);
            }
          } else if (ArrayBuffer.isView(l))
            g = l.slice(), h = g.byteLength;
          else
            throw new Error("Invalid data format, must be a string or TypedArray.");
          const n = h >> 2, f = h - n * 4, p = new Uint32Array(g.buffer, 0, n);
          let C = 0, r = 0, w = this.h1, t = this.h2;
          const o = 3432918353, A = 461845907, b = o & v, R = A & v;
          for (let L = 0; L < n; L++)
            L & 1 ? (C = p[L], C = C * o & y | C * b & v, C = C << 15 | C >>> 17, C = C * A & y | C * R & v, w ^= C, w = w << 13 | w >>> 19, w = w * 5 + 3864292196) : (r = p[L], r = r * o & y | r * b & v, r = r << 15 | r >>> 17, r = r * A & y | r * R & v, t ^= r, t = t << 13 | t >>> 19, t = t * 5 + 3864292196);
          switch (C = 0, f) {
            case 3:
              C ^= g[n * 4 + 2] << 16;
            case 2:
              C ^= g[n * 4 + 1] << 8;
            case 1:
              C ^= g[n * 4], C = C * o & y | C * b & v, C = C << 15 | C >>> 17, C = C * A & y | C * R & v, n & 1 ? w ^= C : t ^= C;
          }
          this.h1 = w, this.h2 = t;
        }
        hexdigest() {
          let l = this.h1, g = this.h2;
          return l ^= g >>> 1, l = l * 3981806797 & y | l * 36045 & v, g = g * 4283543511 & y | ((g << 16 | l >>> 16) * 2950163797 & y) >>> 16, l ^= g >>> 1, l = l * 444984403 & y | l * 60499 & v, g = g * 3301882366 & y | ((g << 16 | l >>> 16) * 3120437893 & y) >>> 16, l ^= g >>> 1, (l >>> 0).toString(16).padStart(8, "0") + (g >>> 0).toString(16).padStart(8, "0");
        }
      }
    }
  ),
  /***/
  292: (
    /***/
    (u, s, i) => {
      i.d(s, {
        /* harmony export */
        AbortException: () => (
          /* binding */
          Z
        ),
        /* harmony export */
        AnnotationBorderStyleType: () => (
          /* binding */
          t
        ),
        /* harmony export */
        AnnotationEditorParamsType: () => (
          /* binding */
          f
        ),
        /* harmony export */
        AnnotationEditorPrefix: () => (
          /* binding */
          h
        ),
        /* harmony export */
        AnnotationEditorType: () => (
          /* binding */
          n
        ),
        /* harmony export */
        AnnotationMode: () => (
          /* binding */
          g
        ),
        /* harmony export */
        AnnotationPrefix: () => (
          /* binding */
          N
        ),
        /* harmony export */
        AnnotationType: () => (
          /* binding */
          w
        ),
        /* harmony export */
        BaseException: () => (
          /* binding */
          U
        ),
        /* harmony export */
        CMapCompressionType: () => (
          /* binding */
          A
        ),
        /* harmony export */
        FONT_IDENTITY_MATRIX: () => (
          /* binding */
          v
        ),
        /* harmony export */
        FeatureTest: () => (
          /* binding */
          c
        ),
        /* harmony export */
        FontRenderOps: () => (
          /* binding */
          G
        ),
        /* harmony export */
        FormatError: () => (
          /* binding */
          ot
        ),
        /* harmony export */
        IDENTITY_MATRIX: () => (
          /* binding */
          y
        ),
        /* harmony export */
        ImageKind: () => (
          /* binding */
          r
        ),
        /* harmony export */
        InvalidPDFException: () => (
          /* binding */
          J
        ),
        /* harmony export */
        LINE_FACTOR: () => (
          /* binding */
          m
        ),
        /* harmony export */
        MAX_IMAGE_SIZE_TO_CACHE: () => (
          /* binding */
          x
        ),
        /* harmony export */
        MissingPDFException: () => (
          /* binding */
          it
        ),
        /* harmony export */
        OPS: () => (
          /* binding */
          b
        ),
        /* harmony export */
        PasswordException: () => (
          /* binding */
          j
        ),
        /* harmony export */
        PasswordResponses: () => (
          /* binding */
          R
        ),
        /* harmony export */
        PermissionFlag: () => (
          /* binding */
          p
        ),
        /* harmony export */
        RenderingIntentFlag: () => (
          /* binding */
          l
        ),
        /* harmony export */
        TextRenderingMode: () => (
          /* binding */
          C
        ),
        /* harmony export */
        UnexpectedResponseException: () => (
          /* binding */
          ht
        ),
        /* harmony export */
        UnknownErrorException: () => (
          /* binding */
          Q
        ),
        /* harmony export */
        Util: () => (
          /* binding */
          _
        ),
        /* harmony export */
        VerbosityLevel: () => (
          /* binding */
          o
        ),
        /* harmony export */
        assert: () => (
          /* binding */
          tt
        ),
        /* harmony export */
        bytesToString: () => (
          /* binding */
          lt
        ),
        /* harmony export */
        createValidAbsoluteUrl: () => (
          /* binding */
          Y
        ),
        /* harmony export */
        getUuid: () => (
          /* binding */
          M
        ),
        /* harmony export */
        getVerbosityLevel: () => (
          /* binding */
          H
        ),
        /* harmony export */
        info: () => (
          /* binding */
          X
        ),
        /* harmony export */
        isNodeJS: () => (
          /* binding */
          e
        ),
        /* harmony export */
        normalizeUnicode: () => (
          /* binding */
          P
        ),
        /* harmony export */
        objectFromMap: () => (
          /* binding */
          k
        ),
        /* harmony export */
        setVerbosityLevel: () => (
          /* binding */
          D
        ),
        /* harmony export */
        shadow: () => (
          /* binding */
          B
        ),
        /* harmony export */
        string32: () => (
          /* binding */
          $
        ),
        /* harmony export */
        stringToBytes: () => (
          /* binding */
          ct
        ),
        /* harmony export */
        unreachable: () => (
          /* binding */
          q
        ),
        /* harmony export */
        warn: () => (
          /* binding */
          V
        )
        /* harmony export */
      });
      const e = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), y = [1, 0, 0, 1, 0, 0], v = [1e-3, 0, 0, 1e-3, 0, 0], x = 1e7, m = 1.35, l = {
        ANY: 1,
        DISPLAY: 2,
        PRINT: 4,
        SAVE: 8,
        ANNOTATIONS_FORMS: 16,
        ANNOTATIONS_STORAGE: 32,
        ANNOTATIONS_DISABLE: 64,
        OPLIST: 256
      }, g = {
        DISABLE: 0,
        ENABLE: 1,
        ENABLE_FORMS: 2,
        ENABLE_STORAGE: 3
      }, h = "pdfjs_internal_editor_", n = {
        DISABLE: -1,
        NONE: 0,
        FREETEXT: 3,
        HIGHLIGHT: 9,
        STAMP: 13,
        INK: 15
      }, f = {
        RESIZE: 1,
        CREATE: 2,
        FREETEXT_SIZE: 11,
        FREETEXT_COLOR: 12,
        FREETEXT_OPACITY: 13,
        INK_COLOR: 21,
        INK_THICKNESS: 22,
        INK_OPACITY: 23,
        HIGHLIGHT_COLOR: 31,
        HIGHLIGHT_DEFAULT_COLOR: 32,
        HIGHLIGHT_THICKNESS: 33,
        HIGHLIGHT_FREE: 34,
        HIGHLIGHT_SHOW_ALL: 35
      }, p = {
        PRINT: 4,
        MODIFY_CONTENTS: 8,
        COPY: 16,
        MODIFY_ANNOTATIONS: 32,
        FILL_INTERACTIVE_FORMS: 256,
        COPY_FOR_ACCESSIBILITY: 512,
        ASSEMBLE: 1024,
        PRINT_HIGH_QUALITY: 2048
      }, C = {
        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
      }, r = {
        GRAYSCALE_1BPP: 1,
        RGB_24BPP: 2,
        RGBA_32BPP: 3
      }, w = {
        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
      }, t = {
        SOLID: 1,
        DASHED: 2,
        BEVELED: 3,
        INSET: 4,
        UNDERLINE: 5
      }, o = {
        ERRORS: 0,
        WARNINGS: 1,
        INFOS: 5
      }, A = {
        NONE: 0,
        BINARY: 1
      }, 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
      }, R = {
        NEED_PASSWORD: 1,
        INCORRECT_PASSWORD: 2
      };
      let L = o.WARNINGS;
      function D(z) {
        Number.isInteger(z) && (L = z);
      }
      function H() {
        return L;
      }
      function X(z) {
        L >= o.INFOS && console.log(`Info: ${z}`);
      }
      function V(z) {
        L >= o.WARNINGS && console.log(`Warning: ${z}`);
      }
      function q(z) {
        throw new Error(z);
      }
      function tt(z, O) {
        z || q(O);
      }
      function rt(z) {
        switch (z?.protocol) {
          case "http:":
          case "https:":
          case "ftp:":
          case "mailto:":
          case "tel:":
            return !0;
          default:
            return !1;
        }
      }
      function Y(z, O = null, I = null) {
        if (!z)
          return null;
        try {
          if (I && typeof z == "string" && (I.addDefaultProtocol && z.startsWith("www.") && z.match(/\./g)?.length >= 2 && (z = `http://${z}`), I.tryConvertEncoding))
            try {
              z = d(z);
            } catch {
            }
          const W = O ? new URL(z, O) : new URL(z);
          if (rt(W))
            return W;
        } catch {
        }
        return null;
      }
      function B(z, O, I, W = !1) {
        return Object.defineProperty(z, O, {
          value: I,
          enumerable: !W,
          configurable: !0,
          writable: !1
        }), I;
      }
      const U = function() {
        function O(I, W) {
          this.constructor === O && q("Cannot initialize BaseException."), this.message = I, this.name = W;
        }
        return O.prototype = new Error(), O.constructor = O, O;
      }();
      class j extends U {
        constructor(O, I) {
          super(O, "PasswordException"), this.code = I;
        }
      }
      class Q extends U {
        constructor(O, I) {
          super(O, "UnknownErrorException"), this.details = I;
        }
      }
      class J extends U {
        constructor(O) {
          super(O, "InvalidPDFException");
        }
      }
      class it extends U {
        constructor(O) {
          super(O, "MissingPDFException");
        }
      }
      class ht extends U {
        constructor(O, I) {
          super(O, "UnexpectedResponseException"), this.status = I;
        }
      }
      class ot extends U {
        constructor(O) {
          super(O, "FormatError");
        }
      }
      class Z extends U {
        constructor(O) {
          super(O, "AbortException");
        }
      }
      function lt(z) {
        (typeof z != "object" || z?.length === void 0) && q("Invalid argument for bytesToString");
        const O = z.length, I = 8192;
        if (O < I)
          return String.fromCharCode.apply(null, z);
        const W = [];
        for (let st = 0; st < O; st += I) {
          const K = Math.min(st + I, O), et = z.subarray(st, K);
          W.push(String.fromCharCode.apply(null, et));
        }
        return W.join("");
      }
      function ct(z) {
        typeof z != "string" && q("Invalid argument for stringToBytes");
        const O = z.length, I = new Uint8Array(O);
        for (let W = 0; W < O; ++W)
          I[W] = z.charCodeAt(W) & 255;
        return I;
      }
      function $(z) {
        return String.fromCharCode(z >> 24 & 255, z >> 16 & 255, z >> 8 & 255, z & 255);
      }
      function k(z) {
        const O = /* @__PURE__ */ Object.create(null);
        for (const [I, W] of z)
          O[I] = W;
        return O;
      }
      function S() {
        const z = new Uint8Array(4);
        return z[0] = 1, new Uint32Array(z.buffer, 0, 1)[0] === 1;
      }
      function a() {
        try {
          return new Function(""), !0;
        } catch {
          return !1;
        }
      }
      class c {
        static get isLittleEndian() {
          return B(this, "isLittleEndian", S());
        }
        static get isEvalSupported() {
          return B(this, "isEvalSupported", a());
        }
        static get isOffscreenCanvasSupported() {
          return B(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
        }
        static get platform() {
          return typeof navigator < "u" && typeof navigator?.platform == "string" ? B(this, "platform", {
            isMac: navigator.platform.includes("Mac")
          }) : B(this, "platform", {
            isMac: !1
          });
        }
        static get isCSSRoundSupported() {
          return B(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
        }
      }
      const T = Array.from(Array(256).keys(), (z) => z.toString(16).padStart(2, "0"));
      class _ {
        static makeHexColor(O, I, W) {
          return `#${T[O]}${T[I]}${T[W]}`;
        }
        static scaleMinMax(O, I) {
          let W;
          O[0] ? (O[0] < 0 && (W = I[0], I[0] = I[2], I[2] = W), I[0] *= O[0], I[2] *= O[0], O[3] < 0 && (W = I[1], I[1] = I[3], I[3] = W), I[1] *= O[3], I[3] *= O[3]) : (W = I[0], I[0] = I[1], I[1] = W, W = I[2], I[2] = I[3], I[3] = W, O[1] < 0 && (W = I[1], I[1] = I[3], I[3] = W), I[1] *= O[1], I[3] *= O[1], O[2] < 0 && (W = I[0], I[0] = I[2], I[2] = W), I[0] *= O[2], I[2] *= O[2]), I[0] += O[4], I[1] += O[5], I[2] += O[4], I[3] += O[5];
        }
        static transform(O, I) {
          return [O[0] * I[0] + O[2] * I[1], O[1] * I[0] + O[3] * I[1], O[0] * I[2] + O[2] * I[3], O[1] * I[2] + O[3] * I[3], O[0] * I[4] + O[2] * I[5] + O[4], O[1] * I[4] + O[3] * I[5] + O[5]];
        }
        static applyTransform(O, I) {
          const W = O[0] * I[0] + O[1] * I[2] + I[4], st = O[0] * I[1] + O[1] * I[3] + I[5];
          return [W, st];
        }
        static applyInverseTransform(O, I) {
          const W = I[0] * I[3] - I[1] * I[2], st = (O[0] * I[3] - O[1] * I[2] + I[2] * I[5] - I[4] * I[3]) / W, K = (-O[0] * I[1] + O[1] * I[0] + I[4] * I[1] - I[5] * I[0]) / W;
          return [st, K];
        }
        static getAxialAlignedBoundingBox(O, I) {
          const W = this.applyTransform(O, I), st = this.applyTransform(O.slice(2, 4), I), K = this.applyTransform([O[0], O[3]], I), et = this.applyTransform([O[2], O[1]], I);
          return [Math.min(W[0], st[0], K[0], et[0]), Math.min(W[1], st[1], K[1], et[1]), Math.max(W[0], st[0], K[0], et[0]), Math.max(W[1], st[1], K[1], et[1])];
        }
        static inverseTransform(O) {
          const I = O[0] * O[3] - O[1] * O[2];
          return [O[3] / I, -O[1] / I, -O[2] / I, O[0] / I, (O[2] * O[5] - O[4] * O[3]) / I, (O[4] * O[1] - O[5] * O[0]) / I];
        }
        static singularValueDecompose2dScale(O) {
          const I = [O[0], O[2], O[1], O[3]], W = O[0] * I[0] + O[1] * I[2], st = O[0] * I[1] + O[1] * I[3], K = O[2] * I[0] + O[3] * I[2], et = O[2] * I[1] + O[3] * I[3], ut = (W + et) / 2, at = Math.sqrt((W + et) ** 2 - 4 * (W * et - K * st)) / 2, nt = ut + at || 1, dt = ut - at || 1;
          return [Math.sqrt(nt), Math.sqrt(dt)];
        }
        static normalizeRect(O) {
          const I = O.slice(0);
          return O[0] > O[2] && (I[0] = O[2], I[2] = O[0]), O[1] > O[3] && (I[1] = O[3], I[3] = O[1]), I;
        }
        static intersect(O, I) {
          const W = Math.max(Math.min(O[0], O[2]), Math.min(I[0], I[2])), st = Math.min(Math.max(O[0], O[2]), Math.max(I[0], I[2]));
          if (W > st)
            return null;
          const K = Math.max(Math.min(O[1], O[3]), Math.min(I[1], I[3])), et = Math.min(Math.max(O[1], O[3]), Math.max(I[1], I[3]));
          return K > et ? null : [W, K, st, et];
        }
        static #t(O, I, W, st, K, et, ut, at, nt, dt) {
          if (nt <= 0 || nt >= 1)
            return;
          const ft = 1 - nt, bt = nt * nt, yt = bt * nt, wt = ft * (ft * (ft * O + 3 * nt * I) + 3 * bt * W) + yt * st, vt = ft * (ft * (ft * K + 3 * nt * et) + 3 * bt * ut) + yt * at;
          dt[0] = Math.min(dt[0], wt), dt[1] = Math.min(dt[1], vt), dt[2] = Math.max(dt[2], wt), dt[3] = Math.max(dt[3], vt);
        }
        static #e(O, I, W, st, K, et, ut, at, nt, dt, ft, bt) {
          if (Math.abs(nt) < 1e-12) {
            Math.abs(dt) >= 1e-12 && this.#t(O, I, W, st, K, et, ut, at, -ft / dt, bt);
            return;
          }
          const yt = dt ** 2 - 4 * ft * nt;
          if (yt < 0)
            return;
          const wt = Math.sqrt(yt), vt = 2 * nt;
          this.#t(O, I, W, st, K, et, ut, at, (-dt + wt) / vt, bt), this.#t(O, I, W, st, K, et, ut, at, (-dt - wt) / vt, bt);
        }
        static bezierBoundingBox(O, I, W, st, K, et, ut, at, nt) {
          return nt ? (nt[0] = Math.min(nt[0], O, ut), nt[1] = Math.min(nt[1], I, at), nt[2] = Math.max(nt[2], O, ut), nt[3] = Math.max(nt[3], I, at)) : nt = [Math.min(O, ut), Math.min(I, at), Math.max(O, ut), Math.max(I, at)], this.#e(O, W, K, ut, I, st, et, at, 3 * (-O + 3 * (W - K) + ut), 6 * (O - 2 * W + K), 3 * (W - O), nt), this.#e(O, W, K, ut, I, st, et, at, 3 * (-I + 3 * (st - et) + at), 6 * (I - 2 * st + et), 3 * (st - I), nt), nt;
        }
      }
      function d(z) {
        return decodeURIComponent(escape(z));
      }
      let E = null, F = null;
      function P(z) {
        return E || (E = /([\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, F = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), z.replaceAll(E, (O, I, W) => I ? I.normalize("NFKC") : F.get(W));
      }
      function M() {
        if (typeof crypto < "u" && typeof crypto?.randomUUID == "function")
          return crypto.randomUUID();
        const z = new Uint8Array(32);
        if (typeof crypto < "u" && typeof crypto?.getRandomValues == "function")
          crypto.getRandomValues(z);
        else
          for (let O = 0; O < 32; O++)
            z[O] = Math.floor(Math.random() * 255);
        return lt(z);
      }
      const N = "pdfjs_internal_id_", G = {
        BEZIER_CURVE_TO: 0,
        MOVE_TO: 1,
        LINE_TO: 2,
        QUADRATIC_CURVE_TO: 3,
        RESTORE: 4,
        SAVE: 5,
        SCALE: 6,
        TRANSFORM: 7,
        TRANSLATE: 8
      };
    }
  )
  /******/
}, Ti = {};
function ve(u) {
  var s = Ti[u];
  if (s !== void 0)
    return s.exports;
  var i = Ti[u] = {
    /******/
    // no module.id needed
    /******/
    // no module.loaded needed
    /******/
    exports: {}
    /******/
  };
  return Do[u](i, i.exports, ve), i.exports;
}
(() => {
  var u = typeof Symbol == "function" ? Symbol("webpack queues") : "__webpack_queues__", s = typeof Symbol == "function" ? Symbol("webpack exports") : "__webpack_exports__", i = typeof Symbol == "function" ? Symbol("webpack error") : "__webpack_error__", e = (v) => {
    v && v.d < 1 && (v.d = 1, v.forEach((x) => x.r--), v.forEach((x) => x.r-- ? x.r++ : x()));
  }, y = (v) => v.map((x) => {
    if (x !== null && typeof x == "object") {
      if (x[u])
        return x;
      if (x.then) {
        var m = [];
        m.d = 0, x.then((h) => {
          l[s] = h, e(m);
        }, (h) => {
          l[i] = h, e(m);
        });
        var l = {};
        return l[u] = (h) => h(m), l;
      }
    }
    var g = {};
    return g[u] = (h) => {
    }, g[s] = x, g;
  });
  ve.a = (v, x, m) => {
    var l;
    m && ((l = []).d = -1);
    var g = /* @__PURE__ */ new Set(), h = v.exports, n, f, p, C = new Promise((r, w) => {
      p = w, f = r;
    });
    C[s] = h, C[u] = (r) => (l && r(l), g.forEach(r), C.catch((w) => {
    })), v.exports = C, x((r) => {
      n = y(r);
      var w, t = () => n.map((A) => {
        if (A[i])
          throw A[i];
        return A[s];
      }), o = new Promise((A) => {
        w = () => A(t), w.r = 0;
        var b = (R) => R !== l && !g.has(R) && (g.add(R), R && !R.d && (w.r++, R.push(w)));
        n.map((R) => R[u](b));
      });
      return w.r ? o : t();
    }, (r) => (r ? p(C[i] = r) : f(h), e(l))), l && l.d < 0 && (l.d = 0);
  };
})();
ve.d = (u, s) => {
  for (var i in s)
    ve.o(s, i) && !ve.o(u, i) && Object.defineProperty(u, i, { enumerable: !0, get: s[i] });
};
ve.o = (u, s) => Object.prototype.hasOwnProperty.call(u, s);
var pt = ve(228);
pt = globalThis.pdfjsLib = await (globalThis.pdfjsLibPromise = pt);
pt.AbortException;
pt.AnnotationEditorLayer;
pt.AnnotationEditorParamsType;
pt.AnnotationEditorType;
pt.AnnotationEditorUIManager;
pt.AnnotationLayer;
pt.AnnotationMode;
pt.CMapCompressionType;
pt.ColorPicker;
pt.DOMSVGFactory;
pt.DrawLayer;
pt.FeatureTest;
var Oo = pt.GlobalWorkerOptions;
pt.ImageKind;
pt.InvalidPDFException;
pt.MissingPDFException;
pt.OPS;
pt.Outliner;
pt.PDFDataRangeTransport;
pt.PDFDateString;
pt.PDFWorker;
pt.PasswordResponses;
pt.PermissionFlag;
pt.PixelsPerInch;
pt.RenderingCancelledException;
pt.UnexpectedResponseException;
pt.Util;
pt.VerbosityLevel;
pt.XfaLayer;
pt.build;
pt.createValidAbsoluteUrl;
pt.fetchData;
var Ho = pt.getDocument;
pt.getFilenameFromUrl;
pt.getPdfFilenameFromUrl;
pt.getXfaPageViewport;
pt.isDataScheme;
pt.isPdfFile;
pt.noContextMenu;
pt.normalizeUnicode;
pt.renderTextLayer;
pt.setLayerDimensions;
pt.shadow;
pt.updateTextLayer;
pt.version;
const {
  SvelteComponent: Bo,
  append: pe,
  assign: zo,
  attr: As,
  binding_callbacks: Uo,
  check_outros: ki,
  create_component: le,
  destroy_component: he,
  detach: $t,
  element: We,
  empty: Go,
  get_spread_object: Vo,
  get_spread_update: Xo,
  group_outros: xi,
  init: qo,
  insert: te,
  mount_component: ce,
  safe_not_equal: jo,
  set_data: Ri,
  set_style: Fi,
  space: Te,
  text: Oe,
  transition_in: Mt,
  transition_out: Bt
} = window.__gradio__svelte__internal, { tick: Li } = window.__gradio__svelte__internal;
function Pi(u) {
  let s, i;
  const e = [
    {
      autoscroll: (
        /*gradio*/
        u[11].autoscroll
      )
    },
    { i18n: (
      /*gradio*/
      u[11].i18n
    ) },
    /*loading_status*/
    u[10]
  ];
  let y = {};
  for (let v = 0; v < e.length; v += 1)
    y = zo(y, e[v]);
  return s = new Ga({ props: y }), {
    c() {
      le(s.$$.fragment);
    },
    m(v, x) {
      ce(s, v, x), i = !0;
    },
    p(v, x) {
      const m = x & /*gradio, loading_status*/
      3072 ? Xo(e, [
        x & /*gradio*/
        2048 && {
          autoscroll: (
            /*gradio*/
            v[11].autoscroll
          )
        },
        x & /*gradio*/
        2048 && { i18n: (
          /*gradio*/
          v[11].i18n
        ) },
        x & /*loading_status*/
        1024 && Vo(
          /*loading_status*/
          v[10]
        )
      ]) : {};
      s.$set(m);
    },
    i(v) {
      i || (Mt(s.$$.fragment, v), i = !0);
    },
    o(v) {
      Bt(s.$$.fragment, v), i = !1;
    },
    d(v) {
      he(s, v);
    }
  };
}
function Yo(u) {
  let s, i;
  return s = new Eo({
    props: {
      filetype: "application/pdf",
      file_count: "single",
      root: (
        /*root*/
        u[7]
      ),
      $$slots: { default: [Ko] },
      $$scope: { ctx: u }
    }
  }), s.$on(
    "load",
    /*handle_upload*/
    u[17]
  ), {
    c() {
      le(s.$$.fragment);
    },
    m(e, y) {
      ce(s, e, y), i = !0;
    },
    p(e, y) {
      const v = {};
      y & /*root*/
      128 && (v.root = /*root*/
      e[7]), y & /*$$scope*/
      536870912 && (v.$$scope = { dirty: y, ctx: e }), s.$set(v);
    },
    i(e) {
      i || (Mt(s.$$.fragment, e), i = !0);
    },
    o(e) {
      Bt(s.$$.fragment, e), i = !1;
    },
    d(e) {
      he(s, e);
    }
  };
}
function Wo(u) {
  let s, i, e, y, v, x, m, l, g, h, n, f, p, C, r;
  return s = new No({
    props: {
      i18n: (
        /*gradio*/
        u[11].i18n
      ),
      absolute: !0
    }
  }), s.$on(
    "clear",
    /*handle_clear*/
    u[16]
  ), m = new Us({
    props: {
      $$slots: { default: [Jo] },
      $$scope: { ctx: u }
    }
  }), m.$on(
    "click",
    /*prev_page*/
    u[19]
  ), C = new Us({
    props: {
      $$slots: { default: [Qo] },
      $$scope: { ctx: u }
    }
  }), C.$on(
    "click",
    /*next_page*/
    u[18]
  ), {
    c() {
      le(s.$$.fragment), i = Te(), e = We("div"), y = We("canvas"), v = Te(), x = We("div"), le(m.$$.fragment), l = Te(), g = We("span"), h = Oe(
        /*currentPage*/
        u[15]
      ), n = Oe(" / "), f = Oe(
        /*numPages*/
        u[13]
      ), p = Te(), le(C.$$.fragment), As(e, "class", "pdf-canvas svelte-qxsbof"), Fi(
        e,
        "height",
        /*height*/
        u[1] + "px"
      ), As(g, "class", "page-count svelte-qxsbof"), As(x, "class", "button-row svelte-qxsbof");
    },
    m(w, t) {
      ce(s, w, t), te(w, i, t), te(w, e, t), pe(e, y), u[23](y), te(w, v, t), te(w, x, t), ce(m, x, null), pe(x, l), pe(x, g), pe(g, h), pe(g, n), pe(g, f), pe(x, p), ce(C, x, null), r = !0;
    },
    p(w, t) {
      const o = {};
      t & /*gradio*/
      2048 && (o.i18n = /*gradio*/
      w[11].i18n), s.$set(o), (!r || t & /*height*/
      2) && Fi(
        e,
        "height",
        /*height*/
        w[1] + "px"
      );
      const A = {};
      t & /*$$scope*/
      536870912 && (A.$$scope = { dirty: t, ctx: w }), m.$set(A), (!r || t & /*currentPage*/
      32768) && Ri(
        h,
        /*currentPage*/
        w[15]
      ), (!r || t & /*numPages*/
      8192) && Ri(
        f,
        /*numPages*/
        w[13]
      );
      const b = {};
      t & /*$$scope*/
      536870912 && (b.$$scope = { dirty: t, ctx: w }), C.$set(b);
    },
    i(w) {
      r || (Mt(s.$$.fragment, w), Mt(m.$$.fragment, w), Mt(C.$$.fragment, w), r = !0);
    },
    o(w) {
      Bt(s.$$.fragment, w), Bt(m.$$.fragment, w), Bt(C.$$.fragment, w), r = !1;
    },
    d(w) {
      w && ($t(i), $t(e), $t(v), $t(x)), he(s, w), u[23](null), he(m), he(C);
    }
  };
}
function Ko(u) {
  let s, i;
  return s = new Yn({}), {
    c() {
      le(s.$$.fragment);
    },
    m(e, y) {
      ce(s, e, y), i = !0;
    },
    i(e) {
      i || (Mt(s.$$.fragment, e), i = !0);
    },
    o(e) {
      Bt(s.$$.fragment, e), i = !1;
    },
    d(e) {
      he(s, e);
    }
  };
}
function Jo(u) {
  let s;
  return {
    c() {
      s = Oe("⬅️");
    },
    m(i, e) {
      te(i, s, e);
    },
    d(i) {
      i && $t(s);
    }
  };
}
function Qo(u) {
  let s;
  return {
    c() {
      s = Oe("➡️");
    },
    m(i, e) {
      te(i, s, e);
    },
    d(i) {
      i && $t(s);
    }
  };
}
function Zo(u) {
  let s, i, e, y, v, x, m, l = (
    /*loading_status*/
    u[10] && Pi(u)
  );
  i = new Cr({
    props: {
      show_label: (
        /*label*/
        u[8] !== null
      ),
      Icon: yn,
      float: (
        /*value*/
        u[0] === null
      ),
      label: (
        /*label*/
        u[8] || "File"
      )
    }
  });
  const g = [Wo, Yo], h = [];
  function n(f, p) {
    return (
      /*_value*/
      f[12] ? 0 : 1
    );
  }
  return y = n(u), v = h[y] = g[y](u), {
    c() {
      l && l.c(), s = Te(), le(i.$$.fragment), e = Te(), v.c(), x = Go();
    },
    m(f, p) {
      l && l.m(f, p), te(f, s, p), ce(i, f, p), te(f, e, p), h[y].m(f, p), te(f, x, p), m = !0;
    },
    p(f, p) {
      /*loading_status*/
      f[10] ? l ? (l.p(f, p), p & /*loading_status*/
      1024 && Mt(l, 1)) : (l = Pi(f), l.c(), Mt(l, 1), l.m(s.parentNode, s)) : l && (xi(), Bt(l, 1, 1, () => {
        l = null;
      }), ki());
      const C = {};
      p & /*label*/
      256 && (C.show_label = /*label*/
      f[8] !== null), p & /*value*/
      1 && (C.float = /*value*/
      f[0] === null), p & /*label*/
      256 && (C.label = /*label*/
      f[8] || "File"), i.$set(C);
      let r = y;
      y = n(f), y === r ? h[y].p(f, p) : (xi(), Bt(h[r], 1, 1, () => {
        h[r] = null;
      }), ki(), v = h[y], v ? v.p(f, p) : (v = h[y] = g[y](f), v.c()), Mt(v, 1), v.m(x.parentNode, x));
    },
    i(f) {
      m || (Mt(l), Mt(i.$$.fragment, f), Mt(v), m = !0);
    },
    o(f) {
      Bt(l), Bt(i.$$.fragment, f), Bt(v), m = !1;
    },
    d(f) {
      f && ($t(s), $t(e), $t(x)), l && l.d(f), he(i, f), h[y].d(f);
    }
  };
}
function $o(u) {
  let s, i;
  return s = new hr({
    props: {
      visible: (
        /*visible*/
        u[4]
      ),
      elem_id: (
        /*elem_id*/
        u[2]
      ),
      elem_classes: (
        /*elem_classes*/
        u[3]
      ),
      container: (
        /*container*/
        u[5]
      ),
      scale: (
        /*scale*/
        u[6]
      ),
      min_width: (
        /*min_width*/
        u[9]
      ),
      $$slots: { default: [Zo] },
      $$scope: { ctx: u }
    }
  }), {
    c() {
      le(s.$$.fragment);
    },
    m(e, y) {
      ce(s, e, y), i = !0;
    },
    p(e, [y]) {
      const v = {};
      y & /*visible*/
      16 && (v.visible = /*visible*/
      e[4]), y & /*elem_id*/
      4 && (v.elem_id = /*elem_id*/
      e[2]), y & /*elem_classes*/
      8 && (v.elem_classes = /*elem_classes*/
      e[3]), y & /*container*/
      32 && (v.container = /*container*/
      e[5]), y & /*scale*/
      64 && (v.scale = /*scale*/
      e[6]), y & /*min_width*/
      512 && (v.min_width = /*min_width*/
      e[9]), y & /*$$scope, numPages, currentPage, height, canvasRef, gradio, _value, root, label, value, loading_status*/
      536935811 && (v.$$scope = { dirty: y, ctx: e }), s.$set(v);
    },
    i(e) {
      i || (Mt(s.$$.fragment, e), i = !0);
    },
    o(e) {
      Bt(s.$$.fragment, e), i = !1;
    },
    d(e) {
      he(s, e);
    }
  };
}
function tl(u, s, i) {
  return u;
}
function el(u, s, i) {
  let e;
  var y = this && this.__awaiter || function(B, U, j, Q) {
    function J(it) {
      return it instanceof j ? it : new j(function(ht) {
        ht(it);
      });
    }
    return new (j || (j = Promise))(function(it, ht) {
      function ot(ct) {
        try {
          lt(Q.next(ct));
        } catch ($) {
          ht($);
        }
      }
      function Z(ct) {
        try {
          lt(Q.throw(ct));
        } catch ($) {
          ht($);
        }
      }
      function lt(ct) {
        ct.done ? it(ct.value) : J(ct.value).then(ot, Z);
      }
      lt((Q = Q.apply(B, U || [])).next());
    });
  };
  let { elem_id: v = "" } = s, { elem_classes: x = [] } = s, { visible: m = !0 } = s, { value: l = null } = s, { container: g = !0 } = s, { scale: h = null } = s, { root: n } = s, { height: f = 500 } = s, { starting_page: p } = s, { label: C } = s, { proxy_url: r } = s, { min_width: w = void 0 } = s, { loading_status: t } = s, { gradio: o } = s;
  Oo.workerSrc = "https://cdn.jsdelivr.net/gh/freddyaboulton/gradio-pdf@main/pdf.worker.min.mjs";
  let A = l, b = A, R, L = 1, D;
  function H() {
    return y(this, void 0, void 0, function* () {
      i(12, A = null), yield Li(), o.dispatch("change");
    });
  }
  function X(B) {
    return y(this, arguments, void 0, function* ({ detail: U }) {
      i(0, l = U), yield Li(), o.dispatch("change"), o.dispatch("upload");
    });
  }
  function V(B) {
    return y(this, void 0, void 0, function* () {
      R = yield Ho(B.url).promise, i(13, L = R.numPages), i(15, e = Math.min(Math.max(p, 1), L)), q(e);
    });
  }
  function q(B) {
    R.getPage(B).then((U) => {
      const j = D.getContext("2d");
      j.clearRect(0, 0, D.width, D.height);
      let Q = U.getViewport({ scale: 1 }), J = f / Q.height;
      Q = U.getViewport({ scale: J });
      const it = { canvasContext: j, viewport: Q };
      i(14, D.width = Q.width, D), i(14, D.height = Q.height, D), U.render(it);
    });
  }
  function tt() {
    e >= L || (i(15, e++, e), q(e));
  }
  function rt() {
    e != 1 && (i(15, e--, e), q(e));
  }
  function Y(B) {
    Uo[B ? "unshift" : "push"](() => {
      D = B, i(14, D);
    });
  }
  return u.$$set = (B) => {
    "elem_id" in B && i(2, v = B.elem_id), "elem_classes" in B && i(3, x = B.elem_classes), "visible" in B && i(4, m = B.visible), "value" in B && i(0, l = B.value), "container" in B && i(5, g = B.container), "scale" in B && i(6, h = B.scale), "root" in B && i(7, n = B.root), "height" in B && i(1, f = B.height), "starting_page" in B && i(20, p = B.starting_page), "label" in B && i(8, C = B.label), "proxy_url" in B && i(21, r = B.proxy_url), "min_width" in B && i(9, w = B.min_width), "loading_status" in B && i(10, t = B.loading_status), "gradio" in B && i(11, o = B.gradio);
  }, u.$$.update = () => {
    u.$$.dirty & /*starting_page, numPages*/
    1056768 && i(15, e = Math.min(Math.max(p, 1), L)), u.$$.dirty & /*height*/
    2 && i(1, f = f || 500), u.$$.dirty & /*value, root, proxy_url*/
    2097281 && i(12, A = tl(l)), u.$$.dirty & /*old_value, _value, gradio*/
    4200448 && JSON.stringify(b) != JSON.stringify(A) && (A && V(A), i(22, b = A), o.dispatch("change"));
  }, [
    l,
    f,
    v,
    x,
    m,
    g,
    h,
    n,
    C,
    w,
    t,
    o,
    A,
    L,
    D,
    e,
    H,
    X,
    tt,
    rt,
    p,
    r,
    b,
    Y
  ];
}
class ll extends Bo {
  constructor(s) {
    super(), qo(this, s, el, $o, jo, {
      elem_id: 2,
      elem_classes: 3,
      visible: 4,
      value: 0,
      container: 5,
      scale: 6,
      root: 7,
      height: 1,
      starting_page: 20,
      label: 8,
      proxy_url: 21,
      min_width: 9,
      loading_status: 10,
      gradio: 11
    });
  }
}
export {
  ll as default
};
