var Yt = {
  /***/
  976: (
    /***/
    (at, W, V) => {
      V.d(W, {
        AnnotationLayer: () => (
          /* binding */
          ut
        ),
        FreeTextAnnotationElement: () => (
          /* binding */
          z
        ),
        InkAnnotationElement: () => (
          /* binding */
          et
        ),
        StampAnnotationElement: () => (
          /* binding */
          dt
        )
      });
      var y = V(292), B = V(419), N = V(792);
      function U(st) {
        return Math.floor(Math.max(0, Math.min(1, st)) * 255).toString(16).padStart(2, "0");
      }
      function P(st) {
        return Math.max(0, Math.min(255, 255 * st));
      }
      class C {
        static CMYK_G([m, c, e, n]) {
          return ["G", 1 - Math.min(1, 0.3 * m + 0.59 * e + 0.11 * c + n)];
        }
        static G_CMYK([m]) {
          return ["CMYK", 0, 0, 0, 1 - m];
        }
        static G_RGB([m]) {
          return ["RGB", m, m, m];
        }
        static G_rgb([m]) {
          return m = P(m), [m, m, m];
        }
        static G_HTML([m]) {
          const c = U(m);
          return `#${c}${c}${c}`;
        }
        static RGB_G([m, c, e]) {
          return ["G", 0.3 * m + 0.59 * c + 0.11 * e];
        }
        static RGB_rgb(m) {
          return m.map(P);
        }
        static RGB_HTML(m) {
          return `#${m.map(U).join("")}`;
        }
        static T_HTML() {
          return "#00000000";
        }
        static T_rgb() {
          return [null];
        }
        static CMYK_RGB([m, c, e, n]) {
          return ["RGB", 1 - Math.min(1, m + n), 1 - Math.min(1, e + n), 1 - Math.min(1, c + n)];
        }
        static CMYK_rgb([m, c, e, n]) {
          return [P(1 - Math.min(1, m + n)), P(1 - Math.min(1, e + n)), P(1 - Math.min(1, c + n))];
        }
        static CMYK_HTML(m) {
          const c = this.CMYK_RGB(m).slice(1);
          return this.RGB_HTML(c);
        }
        static RGB_CMYK([m, c, e]) {
          const n = 1 - m, f = 1 - c, h = 1 - e, a = Math.min(n, f, h);
          return ["CMYK", n, f, h, a];
        }
      }
      var E = V(284);
      const v = 1e3, r = 9, d = /* @__PURE__ */ new WeakSet();
      function o(st) {
        return {
          width: st[2] - st[0],
          height: st[3] - st[1]
        };
      }
      class b {
        static create(m) {
          switch (m.data.annotationType) {
            case y.AnnotationType.LINK:
              return new g(m);
            case y.AnnotationType.TEXT:
              return new t(m);
            case y.AnnotationType.WIDGET:
              switch (m.data.fieldType) {
                case "Tx":
                  return new l(m);
                case "Btn":
                  return m.data.radioButton ? new S(m) : m.data.checkBox ? new w(m) : new L(m);
                case "Ch":
                  return new M(m);
                case "Sig":
                  return new p(m);
              }
              return new i(m);
            case y.AnnotationType.POPUP:
              return new _(m);
            case y.AnnotationType.FREETEXT:
              return new z(m);
            case y.AnnotationType.LINE:
              return new K(m);
            case y.AnnotationType.SQUARE:
              return new nt(m);
            case y.AnnotationType.CIRCLE:
              return new j(m);
            case y.AnnotationType.POLYLINE:
              return new H(m);
            case y.AnnotationType.CARET:
              return new Y(m);
            case y.AnnotationType.INK:
              return new et(m);
            case y.AnnotationType.POLYGON:
              return new G(m);
            case y.AnnotationType.HIGHLIGHT:
              return new tt(m);
            case y.AnnotationType.UNDERLINE:
              return new ot(m);
            case y.AnnotationType.SQUIGGLY:
              return new ct(m);
            case y.AnnotationType.STRIKEOUT:
              return new pt(m);
            case y.AnnotationType.STAMP:
              return new dt(m);
            case y.AnnotationType.FILEATTACHMENT:
              return new ht(m);
            default:
              return new s(m);
          }
        }
      }
      class s {
        #t = null;
        #e = !1;
        constructor(m, {
          isRenderable: c = !1,
          ignoreBorder: e = !1,
          createQuadrilaterals: n = !1
        } = {}) {
          this.isRenderable = c, this.data = m.data, this.layer = m.layer, this.linkService = m.linkService, this.downloadManager = m.downloadManager, this.imageResourcesPath = m.imageResourcesPath, this.renderForms = m.renderForms, this.svgFactory = m.svgFactory, this.annotationStorage = m.annotationStorage, this.enableScripting = m.enableScripting, this.hasJSActions = m.hasJSActions, this._fieldObjects = m.fieldObjects, this.parent = m.parent, c && (this.container = this._createContainer(e)), n && this._createQuadrilaterals();
        }
        static _hasPopupData({
          titleObj: m,
          contentsObj: c,
          richText: e
        }) {
          return !!(m?.str || c?.str || e?.str);
        }
        get hasPopupData() {
          return s._hasPopupData(this.data);
        }
        updateEdited(m) {
          if (!this.container)
            return;
          this.#t ||= {
            rect: this.data.rect.slice(0)
          };
          const {
            rect: c
          } = m;
          c && this.#s(c);
        }
        resetEdited() {
          this.#t && (this.#s(this.#t.rect), this.#t = null);
        }
        #s(m) {
          const {
            container: {
              style: c
            },
            data: {
              rect: e,
              rotation: n
            },
            parent: {
              viewport: {
                rawDims: {
                  pageWidth: f,
                  pageHeight: h,
                  pageX: a,
                  pageY: u
                }
              }
            }
          } = this;
          e?.splice(0, 4, ...m);
          const {
            width: A,
            height: x
          } = o(m);
          c.left = `${100 * (m[0] - a) / f}%`, c.top = `${100 * (h - m[3] + u) / h}%`, n === 0 ? (c.width = `${100 * A / f}%`, c.height = `${100 * x / h}%`) : this.setRotation(n);
        }
        _createContainer(m) {
          const {
            data: c,
            parent: {
              page: e,
              viewport: n
            }
          } = this, f = document.createElement("section");
          f.setAttribute("data-annotation-id", c.id), this instanceof i || (f.tabIndex = v);
          const {
            style: h
          } = f;
          if (h.zIndex = this.parent.zIndex++, c.popupRef && f.setAttribute("aria-haspopup", "dialog"), c.alternativeText && (f.title = c.alternativeText), c.noRotate && f.classList.add("norotate"), !c.rect || this instanceof _) {
            const {
              rotation: F
            } = c;
            return !c.hasOwnCanvas && F !== 0 && this.setRotation(F, f), f;
          }
          const {
            width: a,
            height: u
          } = o(c.rect);
          if (!m && c.borderStyle.width > 0) {
            h.borderWidth = `${c.borderStyle.width}px`;
            const F = c.borderStyle.horizontalCornerRadius, T = c.borderStyle.verticalCornerRadius;
            if (F > 0 || T > 0) {
              const Q = `calc(${F}px * var(--scale-factor)) / calc(${T}px * var(--scale-factor))`;
              h.borderRadius = Q;
            } else if (this instanceof S) {
              const Q = `calc(${a}px * var(--scale-factor)) / calc(${u}px * var(--scale-factor))`;
              h.borderRadius = Q;
            }
            switch (c.borderStyle.style) {
              case y.AnnotationBorderStyleType.SOLID:
                h.borderStyle = "solid";
                break;
              case y.AnnotationBorderStyleType.DASHED:
                h.borderStyle = "dashed";
                break;
              case y.AnnotationBorderStyleType.BEVELED:
                (0, y.warn)("Unimplemented border style: beveled");
                break;
              case y.AnnotationBorderStyleType.INSET:
                (0, y.warn)("Unimplemented border style: inset");
                break;
              case y.AnnotationBorderStyleType.UNDERLINE:
                h.borderBottomStyle = "solid";
                break;
            }
            const X = c.borderColor || null;
            X ? (this.#e = !0, h.borderColor = y.Util.makeHexColor(X[0] | 0, X[1] | 0, X[2] | 0)) : h.borderWidth = 0;
          }
          const A = y.Util.normalizeRect([c.rect[0], e.view[3] - c.rect[1] + e.view[1], c.rect[2], e.view[3] - c.rect[3] + e.view[1]]), {
            pageWidth: x,
            pageHeight: R,
            pageX: k,
            pageY: D
          } = n.rawDims;
          h.left = `${100 * (A[0] - k) / x}%`, h.top = `${100 * (A[1] - D) / R}%`;
          const {
            rotation: I
          } = c;
          return c.hasOwnCanvas || I === 0 ? (h.width = `${100 * a / x}%`, h.height = `${100 * u / R}%`) : this.setRotation(I, f), f;
        }
        setRotation(m, c = this.container) {
          if (!this.data.rect)
            return;
          const {
            pageWidth: e,
            pageHeight: n
          } = this.parent.viewport.rawDims, {
            width: f,
            height: h
          } = o(this.data.rect);
          let a, u;
          m % 180 === 0 ? (a = 100 * f / e, u = 100 * h / n) : (a = 100 * h / e, u = 100 * f / n), c.style.width = `${a}%`, c.style.height = `${u}%`, c.setAttribute("data-main-rotation", (360 - m) % 360);
        }
        get _commonActions() {
          const m = (c, e, n) => {
            const f = n.detail[c], h = f[0], a = f.slice(1);
            n.target.style[e] = C[`${h}_HTML`](a), this.annotationStorage.setValue(this.data.id, {
              [e]: C[`${h}_rgb`](a)
            });
          };
          return (0, y.shadow)(this, "_commonActions", {
            display: (c) => {
              const {
                display: e
              } = c.detail, n = e % 2 === 1;
              this.container.style.visibility = n ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                noView: n,
                noPrint: e === 1 || e === 2
              });
            },
            print: (c) => {
              this.annotationStorage.setValue(this.data.id, {
                noPrint: !c.detail.print
              });
            },
            hidden: (c) => {
              const {
                hidden: e
              } = c.detail;
              this.container.style.visibility = e ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                noPrint: e,
                noView: e
              });
            },
            focus: (c) => {
              setTimeout(() => c.target.focus({
                preventScroll: !1
              }), 0);
            },
            userName: (c) => {
              c.target.title = c.detail.userName;
            },
            readonly: (c) => {
              c.target.disabled = c.detail.readonly;
            },
            required: (c) => {
              this._setRequired(c.target, c.detail.required);
            },
            bgColor: (c) => {
              m("bgColor", "backgroundColor", c);
            },
            fillColor: (c) => {
              m("fillColor", "backgroundColor", c);
            },
            fgColor: (c) => {
              m("fgColor", "color", c);
            },
            textColor: (c) => {
              m("textColor", "color", c);
            },
            borderColor: (c) => {
              m("borderColor", "borderColor", c);
            },
            strokeColor: (c) => {
              m("strokeColor", "borderColor", c);
            },
            rotation: (c) => {
              const e = c.detail.rotation;
              this.setRotation(e), this.annotationStorage.setValue(this.data.id, {
                rotation: e
              });
            }
          });
        }
        _dispatchEventFromSandbox(m, c) {
          const e = this._commonActions;
          for (const n of Object.keys(c.detail))
            (m[n] || e[n])?.(c);
        }
        _setDefaultPropertiesFromJS(m) {
          if (!this.enableScripting)
            return;
          const c = this.annotationStorage.getRawValue(this.data.id);
          if (!c)
            return;
          const e = this._commonActions;
          for (const [n, f] of Object.entries(c)) {
            const h = e[n];
            if (h) {
              const a = {
                detail: {
                  [n]: f
                },
                target: m
              };
              h(a), delete c[n];
            }
          }
        }
        _createQuadrilaterals() {
          if (!this.container)
            return;
          const {
            quadPoints: m
          } = this.data;
          if (!m)
            return;
          const [c, e, n, f] = this.data.rect;
          if (m.length === 1) {
            const [, {
              x: F,
              y: T
            }, {
              x: X,
              y: Q
            }] = m[0];
            if (n === F && f === T && c === X && e === Q)
              return;
          }
          const {
            style: h
          } = this.container;
          let a;
          if (this.#e) {
            const {
              borderColor: F,
              borderWidth: T
            } = h;
            h.borderWidth = 0, a = ["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="${F}" stroke-width="${T}">`], this.container.classList.add("hasBorder");
          }
          const u = n - c, A = f - e, {
            svgFactory: x
          } = this, R = x.createElement("svg");
          R.classList.add("quadrilateralsContainer"), R.setAttribute("width", 0), R.setAttribute("height", 0);
          const k = x.createElement("defs");
          R.append(k);
          const D = x.createElement("clipPath"), I = `clippath_${this.data.id}`;
          D.setAttribute("id", I), D.setAttribute("clipPathUnits", "objectBoundingBox"), k.append(D);
          for (const [, {
            x: F,
            y: T
          }, {
            x: X,
            y: Q
          }] of m) {
            const $ = x.createElement("rect"), q = (X - c) / u, rt = (f - T) / A, Z = (F - X) / u, J = (T - Q) / A;
            $.setAttribute("x", q), $.setAttribute("y", rt), $.setAttribute("width", Z), $.setAttribute("height", J), D.append($), a?.push(`<rect vector-effect="non-scaling-stroke" x="${q}" y="${rt}" width="${Z}" height="${J}"/>`);
          }
          this.#e && (a.push("</g></svg>')"), h.backgroundImage = a.join("")), this.container.append(R), this.container.style.clipPath = `url(#${I})`;
        }
        _createPopup() {
          const {
            container: m,
            data: c
          } = this;
          m.setAttribute("aria-haspopup", "dialog");
          const e = new _({
            data: {
              color: c.color,
              titleObj: c.titleObj,
              modificationDate: c.modificationDate,
              contentsObj: c.contentsObj,
              richText: c.richText,
              parentRect: c.rect,
              borderStyle: 0,
              id: `popup_${c.id}`,
              rotation: c.rotation
            },
            parent: this.parent,
            elements: [this]
          });
          this.parent.div.append(e.render());
        }
        render() {
          (0, y.unreachable)("Abstract method `AnnotationElement.render` called");
        }
        _getElementsByName(m, c = null) {
          const e = [];
          if (this._fieldObjects) {
            const n = this._fieldObjects[m];
            if (n)
              for (const {
                page: f,
                id: h,
                exportValues: a
              } of n) {
                if (f === -1 || h === c)
                  continue;
                const u = typeof a == "string" ? a : null, A = document.querySelector(`[data-element-id="${h}"]`);
                if (A && !d.has(A)) {
                  (0, y.warn)(`_getElementsByName - element not allowed: ${h}`);
                  continue;
                }
                e.push({
                  id: h,
                  exportValue: u,
                  domElement: A
                });
              }
            return e;
          }
          for (const n of document.getElementsByName(m)) {
            const {
              exportValue: f
            } = n, h = n.getAttribute("data-element-id");
            h !== c && d.has(n) && e.push({
              id: h,
              exportValue: f,
              domElement: n
            });
          }
          return e;
        }
        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 m = this.getElementsToTriggerPopup();
          if (Array.isArray(m))
            for (const c of m)
              c.classList.add("highlightArea");
          else
            m.classList.add("highlightArea");
        }
        get _isEditable() {
          return !1;
        }
        _editOnDoubleClick() {
          if (!this._isEditable)
            return;
          const {
            annotationEditorType: m,
            data: {
              id: c
            }
          } = this;
          this.container.addEventListener("dblclick", () => {
            this.linkService.eventBus?.dispatch("switchannotationeditormode", {
              source: this,
              mode: m,
              editId: c
            });
          });
        }
      }
      class g extends s {
        constructor(m, c = null) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !!c?.ignoreBorder,
            createQuadrilaterals: !0
          }), this.isTooltipOnly = m.data.isTooltipOnly;
        }
        render() {
          const {
            data: m,
            linkService: c
          } = this, e = document.createElement("a");
          e.setAttribute("data-element-id", m.id);
          let n = !1;
          return m.url ? (c.addLinkAttributes(e, m.url, m.newWindow), n = !0) : m.action ? (this._bindNamedAction(e, m.action), n = !0) : m.attachment ? (this.#e(e, m.attachment, m.attachmentDest), n = !0) : m.setOCGState ? (this.#s(e, m.setOCGState), n = !0) : m.dest ? (this._bindLink(e, m.dest), n = !0) : (m.actions && (m.actions.Action || m.actions["Mouse Up"] || m.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(e, m), n = !0), m.resetForm ? (this._bindResetFormAction(e, m.resetForm), n = !0) : this.isTooltipOnly && !n && (this._bindLink(e, ""), n = !0)), this.container.classList.add("linkAnnotation"), n && this.container.append(e), this.container;
        }
        #t() {
          this.container.setAttribute("data-internal-link", "");
        }
        _bindLink(m, c) {
          m.href = this.linkService.getDestinationHash(c), m.onclick = () => (c && this.linkService.goToDestination(c), !1), (c || c === "") && this.#t();
        }
        _bindNamedAction(m, c) {
          m.href = this.linkService.getAnchorUrl(""), m.onclick = () => (this.linkService.executeNamedAction(c), !1), this.#t();
        }
        #e(m, c, e = null) {
          m.href = this.linkService.getAnchorUrl(""), m.onclick = () => (this.downloadManager?.openOrDownloadData(c.content, c.filename, e), !1), this.#t();
        }
        #s(m, c) {
          m.href = this.linkService.getAnchorUrl(""), m.onclick = () => (this.linkService.executeSetOCGState(c), !1), this.#t();
        }
        _bindJSAction(m, c) {
          m.href = this.linkService.getAnchorUrl("");
          const e = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
          for (const n of Object.keys(c.actions)) {
            const f = e.get(n);
            f && (m[f] = () => (this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: c.id,
                name: n
              }
            }), !1));
          }
          m.onclick || (m.onclick = () => !1), this.#t();
        }
        _bindResetFormAction(m, c) {
          const e = m.onclick;
          if (e || (m.href = this.linkService.getAnchorUrl("")), this.#t(), !this._fieldObjects) {
            (0, y.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), e || (m.onclick = () => !1);
            return;
          }
          m.onclick = () => {
            e?.();
            const {
              fields: n,
              refs: f,
              include: h
            } = c, a = [];
            if (n.length !== 0 || f.length !== 0) {
              const x = new Set(f);
              for (const R of n) {
                const k = this._fieldObjects[R] || [];
                for (const {
                  id: D
                } of k)
                  x.add(D);
              }
              for (const R of Object.values(this._fieldObjects))
                for (const k of R)
                  x.has(k.id) === h && a.push(k);
            } else
              for (const x of Object.values(this._fieldObjects))
                a.push(...x);
            const u = this.annotationStorage, A = [];
            for (const x of a) {
              const {
                id: R
              } = x;
              switch (A.push(R), x.type) {
                case "text": {
                  const D = x.defaultValue || "";
                  u.setValue(R, {
                    value: D
                  });
                  break;
                }
                case "checkbox":
                case "radiobutton": {
                  const D = x.defaultValue === x.exportValues;
                  u.setValue(R, {
                    value: D
                  });
                  break;
                }
                case "combobox":
                case "listbox": {
                  const D = x.defaultValue || "";
                  u.setValue(R, {
                    value: D
                  });
                  break;
                }
                default:
                  continue;
              }
              const k = document.querySelector(`[data-element-id="${R}"]`);
              if (k) {
                if (!d.has(k)) {
                  (0, y.warn)(`_bindResetFormAction - element not allowed: ${R}`);
                  continue;
                }
              } else
                continue;
              k.dispatchEvent(new Event("resetform"));
            }
            return this.enableScripting && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: "app",
                ids: A,
                name: "ResetForm"
              }
            }), !1;
          };
        }
      }
      class t extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0
          });
        }
        render() {
          this.container.classList.add("textAnnotation");
          const m = document.createElement("img");
          return m.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", m.setAttribute("data-l10n-id", "pdfjs-text-annotation-type"), m.setAttribute("data-l10n-args", JSON.stringify({
            type: this.data.name
          })), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(m), this.container;
        }
      }
      class i extends s {
        render() {
          return this.container;
        }
        showElementAndHideCanvas(m) {
          this.data.hasOwnCanvas && (m.previousSibling?.nodeName === "CANVAS" && (m.previousSibling.hidden = !0), m.hidden = !1);
        }
        _getKeyModifier(m) {
          return y.FeatureTest.platform.isMac ? m.metaKey : m.ctrlKey;
        }
        _setEventListener(m, c, e, n, f) {
          e.includes("mouse") ? m.addEventListener(e, (h) => {
            this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: this.data.id,
                name: n,
                value: f(h),
                shift: h.shiftKey,
                modifier: this._getKeyModifier(h)
              }
            });
          }) : m.addEventListener(e, (h) => {
            if (e === "blur") {
              if (!c.focused || !h.relatedTarget)
                return;
              c.focused = !1;
            } else if (e === "focus") {
              if (c.focused)
                return;
              c.focused = !0;
            }
            f && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: this.data.id,
                name: n,
                value: f(h)
              }
            });
          });
        }
        _setEventListeners(m, c, e, n) {
          for (const [f, h] of e)
            (h === "Action" || this.data.actions?.[h]) && ((h === "Focus" || h === "Blur") && (c ||= {
              focused: !1
            }), this._setEventListener(m, c, f, h, n), h === "Focus" && !this.data.actions?.Blur ? this._setEventListener(m, c, "blur", "Blur", null) : h === "Blur" && !this.data.actions?.Focus && this._setEventListener(m, c, "focus", "Focus", null));
        }
        _setBackgroundColor(m) {
          const c = this.data.backgroundColor || null;
          m.style.backgroundColor = c === null ? "transparent" : y.Util.makeHexColor(c[0], c[1], c[2]);
        }
        _setTextStyle(m) {
          const c = ["left", "center", "right"], {
            fontColor: e
          } = this.data.defaultAppearanceData, n = this.data.defaultAppearanceData.fontSize || r, f = m.style;
          let h;
          const a = 2, u = (A) => Math.round(10 * A) / 10;
          if (this.data.multiLine) {
            const A = Math.abs(this.data.rect[3] - this.data.rect[1] - a), x = Math.round(A / (y.LINE_FACTOR * n)) || 1, R = A / x;
            h = Math.min(n, u(R / y.LINE_FACTOR));
          } else {
            const A = Math.abs(this.data.rect[3] - this.data.rect[1] - a);
            h = Math.min(n, u(A / y.LINE_FACTOR));
          }
          f.fontSize = `calc(${h}px * var(--scale-factor))`, f.color = y.Util.makeHexColor(e[0], e[1], e[2]), this.data.textAlignment !== null && (f.textAlign = c[this.data.textAlignment]);
        }
        _setRequired(m, c) {
          c ? m.setAttribute("required", !0) : m.removeAttribute("required"), m.setAttribute("aria-required", c);
        }
      }
      class l extends i {
        constructor(m) {
          const c = m.renderForms || m.data.hasOwnCanvas || !m.data.hasAppearance && !!m.data.fieldValue;
          super(m, {
            isRenderable: c
          });
        }
        setPropertyOnSiblings(m, c, e, n) {
          const f = this.annotationStorage;
          for (const h of this._getElementsByName(m.name, m.id))
            h.domElement && (h.domElement[c] = e), f.setValue(h.id, {
              [n]: e
            });
        }
        render() {
          const m = this.annotationStorage, c = this.data.id;
          this.container.classList.add("textWidgetAnnotation");
          let e = null;
          if (this.renderForms) {
            const n = m.getValue(c, {
              value: this.data.fieldValue
            });
            let f = n.value || "";
            const h = m.getValue(c, {
              charLimit: this.data.maxLen
            }).charLimit;
            h && f.length > h && (f = f.slice(0, h));
            let a = n.formattedValue || this.data.textContent?.join(`
`) || null;
            a && this.data.comb && (a = a.replaceAll(/\s+/g, ""));
            const u = {
              userValue: f,
              formattedValue: a,
              lastCommittedValue: null,
              commitKey: 1,
              focused: !1
            };
            this.data.multiLine ? (e = document.createElement("textarea"), e.textContent = a ?? f, this.data.doNotScroll && (e.style.overflowY = "hidden")) : (e = document.createElement("input"), e.type = "text", e.setAttribute("value", a ?? f), this.data.doNotScroll && (e.style.overflowX = "hidden")), this.data.hasOwnCanvas && (e.hidden = !0), d.add(e), e.setAttribute("data-element-id", c), e.disabled = this.data.readOnly, e.name = this.data.fieldName, e.tabIndex = v, this._setRequired(e, this.data.required), h && (e.maxLength = h), e.addEventListener("input", (x) => {
              m.setValue(c, {
                value: x.target.value
              }), this.setPropertyOnSiblings(e, "value", x.target.value, "value"), u.formattedValue = null;
            }), e.addEventListener("resetform", (x) => {
              const R = this.data.defaultFieldValue ?? "";
              e.value = u.userValue = R, u.formattedValue = null;
            });
            let A = (x) => {
              const {
                formattedValue: R
              } = u;
              R != null && (x.target.value = R), x.target.scrollLeft = 0;
            };
            if (this.enableScripting && this.hasJSActions) {
              e.addEventListener("focus", (R) => {
                if (u.focused)
                  return;
                const {
                  target: k
                } = R;
                u.userValue && (k.value = u.userValue), u.lastCommittedValue = k.value, u.commitKey = 1, this.data.actions?.Focus || (u.focused = !0);
              }), e.addEventListener("updatefromsandbox", (R) => {
                this.showElementAndHideCanvas(R.target);
                const k = {
                  value(D) {
                    u.userValue = D.detail.value ?? "", m.setValue(c, {
                      value: u.userValue.toString()
                    }), D.target.value = u.userValue;
                  },
                  formattedValue(D) {
                    const {
                      formattedValue: I
                    } = D.detail;
                    u.formattedValue = I, I != null && D.target !== document.activeElement && (D.target.value = I), m.setValue(c, {
                      formattedValue: I
                    });
                  },
                  selRange(D) {
                    D.target.setSelectionRange(...D.detail.selRange);
                  },
                  charLimit: (D) => {
                    const {
                      charLimit: I
                    } = D.detail, {
                      target: F
                    } = D;
                    if (I === 0) {
                      F.removeAttribute("maxLength");
                      return;
                    }
                    F.setAttribute("maxLength", I);
                    let T = u.userValue;
                    !T || T.length <= I || (T = T.slice(0, I), F.value = u.userValue = T, m.setValue(c, {
                      value: T
                    }), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: c,
                        name: "Keystroke",
                        value: T,
                        willCommit: !0,
                        commitKey: 1,
                        selStart: F.selectionStart,
                        selEnd: F.selectionEnd
                      }
                    }));
                  }
                };
                this._dispatchEventFromSandbox(k, R);
              }), e.addEventListener("keydown", (R) => {
                u.commitKey = 1;
                let k = -1;
                if (R.key === "Escape" ? k = 0 : R.key === "Enter" && !this.data.multiLine ? k = 2 : R.key === "Tab" && (u.commitKey = 3), k === -1)
                  return;
                const {
                  value: D
                } = R.target;
                u.lastCommittedValue !== D && (u.lastCommittedValue = D, u.userValue = D, this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: c,
                    name: "Keystroke",
                    value: D,
                    willCommit: !0,
                    commitKey: k,
                    selStart: R.target.selectionStart,
                    selEnd: R.target.selectionEnd
                  }
                }));
              });
              const x = A;
              A = null, e.addEventListener("blur", (R) => {
                if (!u.focused || !R.relatedTarget)
                  return;
                this.data.actions?.Blur || (u.focused = !1);
                const {
                  value: k
                } = R.target;
                u.userValue = k, u.lastCommittedValue !== k && this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: c,
                    name: "Keystroke",
                    value: k,
                    willCommit: !0,
                    commitKey: u.commitKey,
                    selStart: R.target.selectionStart,
                    selEnd: R.target.selectionEnd
                  }
                }), x(R);
              }), this.data.actions?.Keystroke && e.addEventListener("beforeinput", (R) => {
                u.lastCommittedValue = null;
                const {
                  data: k,
                  target: D
                } = R, {
                  value: I,
                  selectionStart: F,
                  selectionEnd: T
                } = D;
                let X = F, Q = T;
                switch (R.inputType) {
                  case "deleteWordBackward": {
                    const $ = I.substring(0, F).match(/\w*[^\w]*$/);
                    $ && (X -= $[0].length);
                    break;
                  }
                  case "deleteWordForward": {
                    const $ = I.substring(F).match(/^[^\w]*\w*/);
                    $ && (Q += $[0].length);
                    break;
                  }
                  case "deleteContentBackward":
                    F === T && (X -= 1);
                    break;
                  case "deleteContentForward":
                    F === T && (Q += 1);
                    break;
                }
                R.preventDefault(), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: c,
                    name: "Keystroke",
                    value: I,
                    change: k || "",
                    willCommit: !1,
                    selStart: X,
                    selEnd: Q
                  }
                });
              }), this._setEventListeners(e, u, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (R) => R.target.value);
            }
            if (A && e.addEventListener("blur", A), this.data.comb) {
              const R = (this.data.rect[2] - this.data.rect[0]) / h;
              e.classList.add("comb"), e.style.letterSpacing = `calc(${R}px * var(--scale-factor) - 1ch)`;
            }
          } else
            e = document.createElement("div"), e.textContent = this.data.fieldValue, e.style.verticalAlign = "middle", e.style.display = "table-cell", this.data.hasOwnCanvas && (e.hidden = !0);
          return this._setTextStyle(e), this._setBackgroundColor(e), this._setDefaultPropertiesFromJS(e), this.container.append(e), this.container;
        }
      }
      class p extends i {
        constructor(m) {
          super(m, {
            isRenderable: !!m.data.hasOwnCanvas
          });
        }
      }
      class w extends i {
        constructor(m) {
          super(m, {
            isRenderable: m.renderForms
          });
        }
        render() {
          const m = this.annotationStorage, c = this.data, e = c.id;
          let n = m.getValue(e, {
            value: c.exportValue === c.fieldValue
          }).value;
          typeof n == "string" && (n = n !== "Off", m.setValue(e, {
            value: n
          })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
          const f = document.createElement("input");
          return d.add(f), f.setAttribute("data-element-id", e), f.disabled = c.readOnly, this._setRequired(f, this.data.required), f.type = "checkbox", f.name = c.fieldName, n && f.setAttribute("checked", !0), f.setAttribute("exportValue", c.exportValue), f.tabIndex = v, f.addEventListener("change", (h) => {
            const {
              name: a,
              checked: u
            } = h.target;
            for (const A of this._getElementsByName(a, e)) {
              const x = u && A.exportValue === c.exportValue;
              A.domElement && (A.domElement.checked = x), m.setValue(A.id, {
                value: x
              });
            }
            m.setValue(e, {
              value: u
            });
          }), f.addEventListener("resetform", (h) => {
            const a = c.defaultFieldValue || "Off";
            h.target.checked = a === c.exportValue;
          }), this.enableScripting && this.hasJSActions && (f.addEventListener("updatefromsandbox", (h) => {
            const a = {
              value(u) {
                u.target.checked = u.detail.value !== "Off", m.setValue(e, {
                  value: u.target.checked
                });
              }
            };
            this._dispatchEventFromSandbox(a, h);
          }), this._setEventListeners(f, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (h) => h.target.checked)), this._setBackgroundColor(f), this._setDefaultPropertiesFromJS(f), this.container.append(f), this.container;
        }
      }
      class S extends i {
        constructor(m) {
          super(m, {
            isRenderable: m.renderForms
          });
        }
        render() {
          this.container.classList.add("buttonWidgetAnnotation", "radioButton");
          const m = this.annotationStorage, c = this.data, e = c.id;
          let n = m.getValue(e, {
            value: c.fieldValue === c.buttonValue
          }).value;
          if (typeof n == "string" && (n = n !== c.buttonValue, m.setValue(e, {
            value: n
          })), n)
            for (const h of this._getElementsByName(c.fieldName, e))
              m.setValue(h.id, {
                value: !1
              });
          const f = document.createElement("input");
          if (d.add(f), f.setAttribute("data-element-id", e), f.disabled = c.readOnly, this._setRequired(f, this.data.required), f.type = "radio", f.name = c.fieldName, n && f.setAttribute("checked", !0), f.tabIndex = v, f.addEventListener("change", (h) => {
            const {
              name: a,
              checked: u
            } = h.target;
            for (const A of this._getElementsByName(a, e))
              m.setValue(A.id, {
                value: !1
              });
            m.setValue(e, {
              value: u
            });
          }), f.addEventListener("resetform", (h) => {
            const a = c.defaultFieldValue;
            h.target.checked = a != null && a === c.buttonValue;
          }), this.enableScripting && this.hasJSActions) {
            const h = c.buttonValue;
            f.addEventListener("updatefromsandbox", (a) => {
              const u = {
                value: (A) => {
                  const x = h === A.detail.value;
                  for (const R of this._getElementsByName(A.target.name)) {
                    const k = x && R.id === e;
                    R.domElement && (R.domElement.checked = k), m.setValue(R.id, {
                      value: k
                    });
                  }
                }
              };
              this._dispatchEventFromSandbox(u, a);
            }), this._setEventListeners(f, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (a) => a.target.checked);
          }
          return this._setBackgroundColor(f), this._setDefaultPropertiesFromJS(f), this.container.append(f), this.container;
        }
      }
      class L extends g {
        constructor(m) {
          super(m, {
            ignoreBorder: m.data.hasAppearance
          });
        }
        render() {
          const m = super.render();
          m.classList.add("buttonWidgetAnnotation", "pushButton");
          const c = m.lastChild;
          return this.enableScripting && this.hasJSActions && c && (this._setDefaultPropertiesFromJS(c), c.addEventListener("updatefromsandbox", (e) => {
            this._dispatchEventFromSandbox({}, e);
          })), m;
        }
      }
      class M extends i {
        constructor(m) {
          super(m, {
            isRenderable: m.renderForms
          });
        }
        render() {
          this.container.classList.add("choiceWidgetAnnotation");
          const m = this.annotationStorage, c = this.data.id, e = m.getValue(c, {
            value: this.data.fieldValue
          }), n = document.createElement("select");
          d.add(n), n.setAttribute("data-element-id", c), n.disabled = this.data.readOnly, this._setRequired(n, this.data.required), n.name = this.data.fieldName, n.tabIndex = v;
          let f = this.data.combo && this.data.options.length > 0;
          this.data.combo || (n.size = this.data.options.length, this.data.multiSelect && (n.multiple = !0)), n.addEventListener("resetform", (x) => {
            const R = this.data.defaultFieldValue;
            for (const k of n.options)
              k.selected = k.value === R;
          });
          for (const x of this.data.options) {
            const R = document.createElement("option");
            R.textContent = x.displayValue, R.value = x.exportValue, e.value.includes(x.exportValue) && (R.setAttribute("selected", !0), f = !1), n.append(R);
          }
          let h = null;
          if (f) {
            const x = document.createElement("option");
            x.value = " ", x.setAttribute("hidden", !0), x.setAttribute("selected", !0), n.prepend(x), h = () => {
              x.remove(), n.removeEventListener("input", h), h = null;
            }, n.addEventListener("input", h);
          }
          const a = (x) => {
            const R = x ? "value" : "textContent", {
              options: k,
              multiple: D
            } = n;
            return D ? Array.prototype.filter.call(k, (I) => I.selected).map((I) => I[R]) : k.selectedIndex === -1 ? null : k[k.selectedIndex][R];
          };
          let u = a(!1);
          const A = (x) => {
            const R = x.target.options;
            return Array.prototype.map.call(R, (k) => ({
              displayValue: k.textContent,
              exportValue: k.value
            }));
          };
          return this.enableScripting && this.hasJSActions ? (n.addEventListener("updatefromsandbox", (x) => {
            const R = {
              value(k) {
                h?.();
                const D = k.detail.value, I = new Set(Array.isArray(D) ? D : [D]);
                for (const F of n.options)
                  F.selected = I.has(F.value);
                m.setValue(c, {
                  value: a(!0)
                }), u = a(!1);
              },
              multipleSelection(k) {
                n.multiple = !0;
              },
              remove(k) {
                const D = n.options, I = k.detail.remove;
                D[I].selected = !1, n.remove(I), D.length > 0 && Array.prototype.findIndex.call(D, (T) => T.selected) === -1 && (D[0].selected = !0), m.setValue(c, {
                  value: a(!0),
                  items: A(k)
                }), u = a(!1);
              },
              clear(k) {
                for (; n.length !== 0; )
                  n.remove(0);
                m.setValue(c, {
                  value: null,
                  items: []
                }), u = a(!1);
              },
              insert(k) {
                const {
                  index: D,
                  displayValue: I,
                  exportValue: F
                } = k.detail.insert, T = n.children[D], X = document.createElement("option");
                X.textContent = I, X.value = F, T ? T.before(X) : n.append(X), m.setValue(c, {
                  value: a(!0),
                  items: A(k)
                }), u = a(!1);
              },
              items(k) {
                const {
                  items: D
                } = k.detail;
                for (; n.length !== 0; )
                  n.remove(0);
                for (const I of D) {
                  const {
                    displayValue: F,
                    exportValue: T
                  } = I, X = document.createElement("option");
                  X.textContent = F, X.value = T, n.append(X);
                }
                n.options.length > 0 && (n.options[0].selected = !0), m.setValue(c, {
                  value: a(!0),
                  items: A(k)
                }), u = a(!1);
              },
              indices(k) {
                const D = new Set(k.detail.indices);
                for (const I of k.target.options)
                  I.selected = D.has(I.index);
                m.setValue(c, {
                  value: a(!0)
                }), u = a(!1);
              },
              editable(k) {
                k.target.disabled = !k.detail.editable;
              }
            };
            this._dispatchEventFromSandbox(R, x);
          }), n.addEventListener("input", (x) => {
            const R = a(!0), k = a(!1);
            m.setValue(c, {
              value: R
            }), x.preventDefault(), this.linkService.eventBus?.dispatch("dispatcheventinsandbox", {
              source: this,
              detail: {
                id: c,
                name: "Keystroke",
                value: u,
                change: k,
                changeEx: R,
                willCommit: !1,
                commitKey: 1,
                keyDown: !1
              }
            });
          }), this._setEventListeners(n, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (x) => x.target.value)) : n.addEventListener("input", function(x) {
            m.setValue(c, {
              value: a(!0)
            });
          }), this.data.combo && this._setTextStyle(n), this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
        }
      }
      class _ extends s {
        constructor(m) {
          const {
            data: c,
            elements: e
          } = m;
          super(m, {
            isRenderable: s._hasPopupData(c)
          }), this.elements = e;
        }
        render() {
          this.container.classList.add("popupAnnotation");
          const m = new O({
            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
          }), c = [];
          for (const e of this.elements)
            e.popup = m, c.push(e.data.id), e.addHighlightArea();
          return this.container.setAttribute("aria-controls", c.map((e) => `${y.AnnotationPrefix}${e}`).join(",")), this.container;
        }
      }
      class O {
        #t = this.#m.bind(this);
        #e = this.#C.bind(this);
        #s = this.#w.bind(this);
        #n = this.#v.bind(this);
        #r = null;
        #i = null;
        #a = null;
        #l = null;
        #h = null;
        #d = null;
        #u = null;
        #c = !1;
        #o = null;
        #p = null;
        #g = null;
        #f = null;
        #A = !1;
        constructor({
          container: m,
          color: c,
          elements: e,
          titleObj: n,
          modificationDate: f,
          contentsObj: h,
          richText: a,
          parent: u,
          rect: A,
          parentRect: x,
          open: R
        }) {
          this.#i = m, this.#f = n, this.#a = h, this.#g = a, this.#d = u, this.#r = c, this.#p = A, this.#u = x, this.#h = e, this.#l = B.PDFDateString.toDateObject(f), this.trigger = e.flatMap((k) => k.getElementsToTriggerPopup());
          for (const k of this.trigger)
            k.addEventListener("click", this.#n), k.addEventListener("mouseenter", this.#s), k.addEventListener("mouseleave", this.#e), k.classList.add("popupTriggerArea");
          for (const k of e)
            k.container?.addEventListener("keydown", this.#t);
          this.#i.hidden = !0, R && this.#v();
        }
        render() {
          if (this.#o)
            return;
          const {
            page: {
              view: m
            },
            viewport: {
              rawDims: {
                pageWidth: c,
                pageHeight: e,
                pageX: n,
                pageY: f
              }
            }
          } = this.#d, h = this.#o = document.createElement("div");
          if (h.className = "popup", this.#r) {
            const $ = h.style.outlineColor = y.Util.makeHexColor(...this.#r);
            CSS.supports("background-color", "color-mix(in srgb, red 30%, white)") ? h.style.backgroundColor = `color-mix(in srgb, ${$} 30%, white)` : h.style.backgroundColor = y.Util.makeHexColor(...this.#r.map((rt) => Math.floor(0.7 * (255 - rt) + rt)));
          }
          const a = document.createElement("span");
          a.className = "header";
          const u = document.createElement("h1");
          if (a.append(u), {
            dir: u.dir,
            str: u.textContent
          } = this.#f, h.append(a), this.#l) {
            const $ = document.createElement("span");
            $.classList.add("popupDate"), $.setAttribute("data-l10n-id", "pdfjs-annotation-date-string"), $.setAttribute("data-l10n-args", JSON.stringify({
              date: this.#l.toLocaleDateString(),
              time: this.#l.toLocaleTimeString()
            })), a.append($);
          }
          const A = this.#a, x = this.#g;
          if (x?.str && (!A?.str || A.str === x.str))
            E.XfaLayer.render({
              xfaHtml: x.html,
              intent: "richText",
              div: h
            }), h.lastChild.classList.add("richText", "popupContent");
          else {
            const $ = this._formatContents(A);
            h.append($);
          }
          let R = !!this.#u, k = R ? this.#u : this.#p;
          for (const $ of this.#h)
            if (!k || y.Util.intersect($.data.rect, k) !== null) {
              k = $.data.rect, R = !0;
              break;
            }
          const D = y.Util.normalizeRect([k[0], m[3] - k[1] + m[1], k[2], m[3] - k[3] + m[1]]), F = R ? k[2] - k[0] + 5 : 0, T = D[0] + F, X = D[1], {
            style: Q
          } = this.#i;
          Q.left = `${100 * (T - n) / c}%`, Q.top = `${100 * (X - f) / e}%`, this.#i.append(h);
        }
        _formatContents({
          str: m,
          dir: c
        }) {
          const e = document.createElement("p");
          e.classList.add("popupContent"), e.dir = c;
          const n = m.split(/(?:\r\n?|\n)/);
          for (let f = 0, h = n.length; f < h; ++f) {
            const a = n[f];
            e.append(document.createTextNode(a)), f < h - 1 && e.append(document.createElement("br"));
          }
          return e;
        }
        #m(m) {
          m.altKey || m.shiftKey || m.ctrlKey || m.metaKey || (m.key === "Enter" || m.key === "Escape" && this.#c) && this.#v();
        }
        #v() {
          this.#c = !this.#c, this.#c ? (this.#w(), this.#i.addEventListener("click", this.#n), this.#i.addEventListener("keydown", this.#t)) : (this.#C(), 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);
        }
        #C() {
          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.#A = this.isVisible, this.#A && (this.#i.hidden = !0);
        }
        maybeShow() {
          this.#A && (this.#A = !1, this.#i.hidden = !1);
        }
        get isVisible() {
          return this.#i.hidden === !1;
        }
      }
      class z extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.textContent = m.data.textContent, this.textPosition = m.data.textPosition, this.annotationEditorType = y.AnnotationEditorType.FREETEXT;
        }
        render() {
          if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
            const m = document.createElement("div");
            m.classList.add("annotationTextContent"), m.setAttribute("role", "comment");
            for (const c of this.textContent) {
              const e = document.createElement("span");
              e.textContent = c, m.append(e);
            }
            this.container.append(m);
          }
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
        }
        get _isEditable() {
          return this.data.hasOwnCanvas;
        }
      }
      class K extends s {
        #t = null;
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("lineAnnotation");
          const m = this.data, {
            width: c,
            height: e
          } = o(m.rect), n = this.svgFactory.create(c, e, !0), f = this.#t = this.svgFactory.createElement("svg:line");
          return f.setAttribute("x1", m.rect[2] - m.lineCoordinates[0]), f.setAttribute("y1", m.rect[3] - m.lineCoordinates[1]), f.setAttribute("x2", m.rect[2] - m.lineCoordinates[2]), f.setAttribute("y2", m.rect[3] - m.lineCoordinates[3]), f.setAttribute("stroke-width", m.borderStyle.width || 1), f.setAttribute("stroke", "transparent"), f.setAttribute("fill", "transparent"), n.append(f), this.container.append(n), !m.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class nt extends s {
        #t = null;
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("squareAnnotation");
          const m = this.data, {
            width: c,
            height: e
          } = o(m.rect), n = this.svgFactory.create(c, e, !0), f = m.borderStyle.width, h = this.#t = this.svgFactory.createElement("svg:rect");
          return h.setAttribute("x", f / 2), h.setAttribute("y", f / 2), h.setAttribute("width", c - f), h.setAttribute("height", e - f), h.setAttribute("stroke-width", f || 1), h.setAttribute("stroke", "transparent"), h.setAttribute("fill", "transparent"), n.append(h), this.container.append(n), !m.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class j extends s {
        #t = null;
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          this.container.classList.add("circleAnnotation");
          const m = this.data, {
            width: c,
            height: e
          } = o(m.rect), n = this.svgFactory.create(c, e, !0), f = m.borderStyle.width, h = this.#t = this.svgFactory.createElement("svg:ellipse");
          return h.setAttribute("cx", c / 2), h.setAttribute("cy", e / 2), h.setAttribute("rx", c / 2 - f / 2), h.setAttribute("ry", e / 2 - f / 2), h.setAttribute("stroke-width", f || 1), h.setAttribute("stroke", "transparent"), h.setAttribute("fill", "transparent"), n.append(h), this.container.append(n), !m.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class H extends s {
        #t = null;
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
        }
        render() {
          this.container.classList.add(this.containerClassName);
          const m = this.data, {
            width: c,
            height: e
          } = o(m.rect), n = this.svgFactory.create(c, e, !0);
          let f = [];
          for (const a of m.vertices) {
            const u = a.x - m.rect[0], A = m.rect[3] - a.y;
            f.push(u + "," + A);
          }
          f = f.join(" ");
          const h = this.#t = this.svgFactory.createElement(this.svgElementName);
          return h.setAttribute("points", f), h.setAttribute("stroke-width", m.borderStyle.width || 1), h.setAttribute("stroke", "transparent"), h.setAttribute("fill", "transparent"), n.append(h), this.container.append(n), !m.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class G extends H {
        constructor(m) {
          super(m), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
        }
      }
      class Y extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
      }
      class et extends s {
        #t = [];
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          }), this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = y.AnnotationEditorType.INK;
        }
        render() {
          this.container.classList.add(this.containerClassName);
          const m = this.data, {
            width: c,
            height: e
          } = o(m.rect), n = this.svgFactory.create(c, e, !0);
          for (const f of m.inkLists) {
            let h = [];
            for (const u of f) {
              const A = u.x - m.rect[0], x = m.rect[3] - u.y;
              h.push(`${A},${x}`);
            }
            h = h.join(" ");
            const a = this.svgFactory.createElement(this.svgElementName);
            this.#t.push(a), a.setAttribute("points", h), a.setAttribute("stroke-width", m.borderStyle.width || 1), a.setAttribute("stroke", "transparent"), a.setAttribute("fill", "transparent"), !m.popupRef && this.hasPopupData && this._createPopup(), n.append(a);
          }
          return this.container.append(n), this.container;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
      }
      class tt extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this.container;
        }
      }
      class ot extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
        }
      }
      class ct extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
        }
      }
      class pt extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0,
            createQuadrilaterals: !0
          });
        }
        render() {
          return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
        }
      }
      class dt extends s {
        constructor(m) {
          super(m, {
            isRenderable: !0,
            ignoreBorder: !0
          });
        }
        render() {
          return this.container.classList.add("stampAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
        }
      }
      class ht extends s {
        #t = null;
        constructor(m) {
          super(m, {
            isRenderable: !0
          });
          const {
            filename: c,
            content: e
          } = this.data.file;
          this.filename = (0, B.getFilenameFromUrl)(c, !0), this.content = e, this.linkService.eventBus?.dispatch("fileattachmentannotation", {
            source: this,
            filename: c,
            content: e
          });
        }
        render() {
          this.container.classList.add("fileAttachmentAnnotation");
          const {
            container: m,
            data: c
          } = this;
          let e;
          c.hasAppearance || c.fillAlpha === 0 ? e = document.createElement("div") : (e = document.createElement("img"), e.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(c.name) ? "paperclip" : "pushpin"}.svg`, c.fillAlpha && c.fillAlpha < 1 && (e.style = `filter: opacity(${Math.round(c.fillAlpha * 100)}%);`)), e.addEventListener("dblclick", this.#e.bind(this)), this.#t = e;
          const {
            isMac: n
          } = y.FeatureTest.platform;
          return m.addEventListener("keydown", (f) => {
            f.key === "Enter" && (n ? f.metaKey : f.ctrlKey) && this.#e();
          }), !c.popupRef && this.hasPopupData ? this._createPopup() : e.classList.add("popupTriggerArea"), m.append(e), m;
        }
        getElementsToTriggerPopup() {
          return this.#t;
        }
        addHighlightArea() {
          this.container.classList.add("highlightArea");
        }
        #e() {
          this.downloadManager?.openOrDownloadData(this.content, this.filename);
        }
      }
      class ut {
        #t = null;
        #e = null;
        #s = /* @__PURE__ */ new Map();
        constructor({
          div: m,
          accessibilityManager: c,
          annotationCanvasMap: e,
          annotationEditorUIManager: n,
          page: f,
          viewport: h
        }) {
          this.div = m, this.#t = c, this.#e = e, this.page = f, this.viewport = h, this.zIndex = 0, this._annotationEditorUIManager = n;
        }
        #n(m, c) {
          const e = m.firstChild || m;
          e.id = `${y.AnnotationPrefix}${c}`, this.div.append(m), this.#t?.moveElementInDOM(this.div, m, e, !1);
        }
        async render(m) {
          const {
            annotations: c
          } = m, e = this.div;
          (0, B.setLayerDimensions)(e, this.viewport);
          const n = /* @__PURE__ */ new Map(), f = {
            data: null,
            layer: e,
            linkService: m.linkService,
            downloadManager: m.downloadManager,
            imageResourcesPath: m.imageResourcesPath || "",
            renderForms: m.renderForms !== !1,
            svgFactory: new B.DOMSVGFactory(),
            annotationStorage: m.annotationStorage || new N.AnnotationStorage(),
            enableScripting: m.enableScripting === !0,
            hasJSActions: m.hasJSActions,
            fieldObjects: m.fieldObjects,
            parent: this,
            elements: null
          };
          for (const h of c) {
            if (h.noHTML)
              continue;
            const a = h.annotationType === y.AnnotationType.POPUP;
            if (a) {
              const x = n.get(h.id);
              if (!x)
                continue;
              f.elements = x;
            } else {
              const {
                width: x,
                height: R
              } = o(h.rect);
              if (x <= 0 || R <= 0)
                continue;
            }
            f.data = h;
            const u = b.create(f);
            if (!u.isRenderable)
              continue;
            if (!a && h.popupRef) {
              const x = n.get(h.popupRef);
              x ? x.push(u) : n.set(h.popupRef, [u]);
            }
            const A = u.render();
            h.hidden && (A.style.visibility = "hidden"), this.#n(A, h.id), u.annotationEditorType > 0 && (this.#s.set(u.data.id, u), this._annotationEditorUIManager?.renderAnnotationElement(u));
          }
          this.#r();
        }
        update({
          viewport: m
        }) {
          const c = this.div;
          this.viewport = m, (0, B.setLayerDimensions)(c, {
            rotation: m.rotation
          }), this.#r(), c.hidden = !1;
        }
        #r() {
          if (!this.#e)
            return;
          const m = this.div;
          for (const [c, e] of this.#e) {
            const n = m.querySelector(`[data-annotation-id="${c}"]`);
            if (!n)
              continue;
            e.className = "annotationContent";
            const {
              firstChild: f
            } = n;
            f ? f.nodeName === "CANVAS" ? f.replaceWith(e) : f.classList.contains("annotationContent") ? f.after(e) : f.before(e) : n.append(e);
          }
          this.#e.clear();
        }
        getEditableAnnotations() {
          return Array.from(this.#s.values());
        }
        getEditableAnnotation(m) {
          return this.#s.get(m);
        }
      }
    }
  ),
  /***/
  792: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        AnnotationStorage: () => (
          /* binding */
          P
        ),
        /* harmony export */
        PrintAnnotationStorage: () => (
          /* binding */
          C
        ),
        /* harmony export */
        SerializableEmpty: () => (
          /* binding */
          U
        )
        /* harmony export */
      });
      var y = V(292), B = V(310), N = V(651);
      const U = Object.freeze({
        map: null,
        hash: "",
        transfer: void 0
      });
      class P {
        #t = !1;
        #e = /* @__PURE__ */ new Map();
        constructor() {
          this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
        }
        getValue(v, r) {
          const d = this.#e.get(v);
          return d === void 0 ? r : Object.assign(r, d);
        }
        getRawValue(v) {
          return this.#e.get(v);
        }
        remove(v) {
          if (this.#e.delete(v), this.#e.size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
            for (const r of this.#e.values())
              if (r instanceof B.AnnotationEditor)
                return;
            this.onAnnotationEditor(null);
          }
        }
        setValue(v, r) {
          const d = this.#e.get(v);
          let o = !1;
          if (d !== void 0)
            for (const [b, s] of Object.entries(r))
              d[b] !== s && (o = !0, d[b] = s);
          else
            o = !0, this.#e.set(v, r);
          o && this.#s(), r instanceof B.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(r.constructor._type);
        }
        has(v) {
          return this.#e.has(v);
        }
        getAll() {
          return this.#e.size > 0 ? (0, y.objectFromMap)(this.#e) : null;
        }
        setAll(v) {
          for (const [r, d] of Object.entries(v))
            this.setValue(r, d);
        }
        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 C(this);
        }
        get serializable() {
          if (this.#e.size === 0)
            return U;
          const v = /* @__PURE__ */ new Map(), r = new N.MurmurHash3_64(), d = [], o = /* @__PURE__ */ Object.create(null);
          let b = !1;
          for (const [s, g] of this.#e) {
            const t = g instanceof B.AnnotationEditor ? g.serialize(!1, o) : g;
            t && (v.set(s, t), r.update(`${s}:${JSON.stringify(t)}`), b ||= !!t.bitmap);
          }
          if (b)
            for (const s of v.values())
              s.bitmap && d.push(s.bitmap);
          return v.size > 0 ? {
            map: v,
            hash: r.hexdigest(),
            transfer: d
          } : U;
        }
        get editorStats() {
          let v = null;
          const r = /* @__PURE__ */ new Map();
          for (const d of this.#e.values()) {
            if (!(d instanceof B.AnnotationEditor))
              continue;
            const o = d.telemetryFinalData;
            if (!o)
              continue;
            const {
              type: b
            } = o;
            r.has(b) || r.set(b, Object.getPrototypeOf(d).constructor), v ||= /* @__PURE__ */ Object.create(null);
            const s = v[b] ||= /* @__PURE__ */ new Map();
            for (const [g, t] of Object.entries(o)) {
              if (g === "type")
                continue;
              let i = s.get(g);
              i || (i = /* @__PURE__ */ new Map(), s.set(g, i));
              const l = i.get(t) ?? 0;
              i.set(t, l + 1);
            }
          }
          for (const [d, o] of r)
            v[d] = o.computeTelemetryFinalData(v[d]);
          return v;
        }
      }
      class C extends P {
        #t;
        constructor(v) {
          super();
          const {
            map: r,
            hash: d,
            transfer: o
          } = v.serializable, b = structuredClone(r, o ? {
            transfer: o
          } : null);
          this.#t = {
            map: b,
            hash: d,
            transfer: o
          };
        }
        get print() {
          (0, y.unreachable)("Should not call PrintAnnotationStorage.print");
        }
        get serializable() {
          return this.#t;
        }
      }
    }
  ),
  /***/
  831: (
    /***/
    (at, W, V) => {
      V.a(at, async (y, B) => {
        try {
          let nt = function(h) {
            if (typeof h == "string" || h instanceof URL ? h = {
              url: h
            } : (h instanceof ArrayBuffer || ArrayBuffer.isView(h)) && (h = {
              data: h
            }), typeof h != "object")
              throw new Error("Invalid parameter in getDocument, need parameter object.");
            if (!h.url && !h.data && !h.range)
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            const a = new et(), {
              docId: u
            } = a, A = h.url ? H(h.url) : null, x = h.data ? G(h.data) : null, R = h.httpHeaders || null, k = h.withCredentials === !0, D = h.password ?? null, I = h.range instanceof tt ? h.range : null, F = Number.isInteger(h.rangeChunkSize) && h.rangeChunkSize > 0 ? h.rangeChunkSize : S;
            let T = h.worker instanceof ht ? h.worker : null;
            const X = h.verbosity, Q = typeof h.docBaseUrl == "string" && !(0, P.isDataScheme)(h.docBaseUrl) ? h.docBaseUrl : null, $ = typeof h.cMapUrl == "string" ? h.cMapUrl : null, q = h.cMapPacked !== !1, rt = h.CMapReaderFactory || O, Z = typeof h.standardFontDataUrl == "string" ? h.standardFontDataUrl : null, J = h.StandardFontDataFactory || K, it = h.stopAtErrors !== !0, lt = Number.isInteger(h.maxImageSize) && h.maxImageSize > -1 ? h.maxImageSize : -1, gt = h.isEvalSupported !== !1, bt = typeof h.isOffscreenCanvasSupported == "boolean" ? h.isOffscreenCanvasSupported : !N.isNodeJS, At = Number.isInteger(h.canvasMaxAreaInBytes) ? h.canvasMaxAreaInBytes : -1, mt = typeof h.disableFontFace == "boolean" ? h.disableFontFace : N.isNodeJS, Ct = h.fontExtraProperties === !0, St = h.enableXfa === !0, Tt = h.ownerDocument || globalThis.document, vt = h.disableRange === !0, Et = h.disableStream === !0, Rt = h.disableAutoFetch === !0, Lt = h.pdfBug === !0, Nt = I ? I.length : h.length ?? NaN, Ht = typeof h.useSystemFonts == "boolean" ? h.useSystemFonts : !N.isNodeJS && !mt, Pt = typeof h.useWorkerFetch == "boolean" ? h.useWorkerFetch : rt === P.DOMCMapReaderFactory && J === P.DOMStandardFontDataFactory && $ && Z && (0, P.isValidFetchUrl)($, document.baseURI) && (0, P.isValidFetchUrl)(Z, document.baseURI), xt = h.canvasFactory || new _({
              ownerDocument: Tt
            }), wt = h.filterFactory || new z({
              docId: u,
              ownerDocument: Tt
            }), Bt = null;
            (0, N.setVerbosityLevel)(X);
            const Dt = {
              canvasFactory: xt,
              filterFactory: wt
            };
            if (Pt || (Dt.cMapReaderFactory = new rt({
              baseUrl: $,
              isCompressed: q
            }), Dt.standardFontDataFactory = new J({
              baseUrl: Z
            })), !T) {
              const Ot = {
                verbosity: X,
                port: d.GlobalWorkerOptions.workerPort
              };
              T = Ot.port ? ht.fromPort(Ot) : new ht(Ot), a._worker = T;
            }
            const Mt = {
              docId: u,
              apiVersion: "4.2.67",
              data: x,
              password: D,
              disableAutoFetch: Rt,
              rangeChunkSize: F,
              length: Nt,
              docBaseUrl: Q,
              enableXfa: St,
              evaluatorOptions: {
                maxImageSize: lt,
                disableFontFace: mt,
                ignoreErrors: it,
                isEvalSupported: gt,
                isOffscreenCanvasSupported: bt,
                canvasMaxAreaInBytes: At,
                fontExtraProperties: Ct,
                useSystemFonts: Ht,
                cMapUrl: Pt ? $ : null,
                standardFontDataUrl: Pt ? Z : null
              }
            }, yt = {
              ignoreErrors: it,
              disableFontFace: mt,
              fontExtraProperties: Ct,
              enableXfa: St,
              ownerDocument: Tt,
              disableAutoFetch: Rt,
              pdfBug: Lt,
              styleElement: Bt
            };
            return T.promise.then(function() {
              if (a.destroyed)
                throw new Error("Loading aborted");
              const Ot = j(T, Mt), jt = new Promise(function(Gt) {
                let _t;
                I ? _t = new g.PDFDataTransportStream(I, {
                  disableRange: vt,
                  disableStream: Et
                }) : x || (_t = ((kt) => N.isNodeJS ? function() {
                  return typeof fetch < "u" && typeof Response < "u" && "body" in Response.prototype;
                }() && (0, P.isValidFetchUrl)(kt.url) ? new t.PDFFetchStream(kt) : new l.PDFNodeStream(kt) : (0, P.isValidFetchUrl)(kt.url) ? new t.PDFFetchStream(kt) : new i.PDFNetworkStream(kt))({
                  url: A,
                  length: Nt,
                  httpHeaders: R,
                  withCredentials: k,
                  rangeChunkSize: F,
                  disableRange: vt,
                  disableStream: Et
                })), Gt(_t);
              });
              return Promise.all([Ot, jt]).then(function([Gt, _t]) {
                if (a.destroyed)
                  throw new Error("Loading aborted");
                const Vt = new o.MessageHandler(u, Gt, T.port), kt = new ut(Vt, a, _t, yt, Dt);
                a._transport = kt, Vt.send("Ready", null);
              });
            }).catch(a._capability.reject), a;
          }, H = function(h) {
            if (h instanceof URL)
              return h.href;
            try {
              return new URL(h, window.location).href;
            } catch {
              if (N.isNodeJS && typeof h == "string")
                return h;
            }
            throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
          }, G = function(h) {
            if (N.isNodeJS && typeof Buffer < "u" && h instanceof Buffer)
              throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
            if (h instanceof Uint8Array && h.byteLength === h.buffer.byteLength)
              return h;
            if (typeof h == "string")
              return (0, N.stringToBytes)(h);
            if (h instanceof ArrayBuffer || ArrayBuffer.isView(h) || typeof h == "object" && !isNaN(h?.length))
              return new Uint8Array(h);
            throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
          }, Y = function(h) {
            return typeof h == "object" && Number.isInteger(h?.num) && h.num >= 0 && Number.isInteger(h?.gen) && h.gen >= 0;
          };
          V.d(W, {
            /* harmony export */
            PDFDataRangeTransport: () => (
              /* binding */
              tt
            ),
            /* harmony export */
            PDFWorker: () => (
              /* binding */
              ht
            ),
            /* harmony export */
            build: () => (
              /* binding */
              f
            ),
            /* harmony export */
            getDocument: () => (
              /* binding */
              nt
            ),
            /* harmony export */
            version: () => (
              /* binding */
              n
            )
            /* harmony export */
          });
          var N = V(292), U = V(792), P = V(419), C = V(10), E = V(573), v = V(923), r = V(814), d = V(164), o = V(178), b = V(62), s = V(626), g = V(585), t = V(94), i = V(457), l = V(786), p = V(50), w = y([E, l]);
          [E, l] = w.then ? (await w)() : w;
          const S = 65536, L = 100, M = 5e3, _ = N.isNodeJS ? E.NodeCanvasFactory : P.DOMCanvasFactory, O = N.isNodeJS ? E.NodeCMapReaderFactory : P.DOMCMapReaderFactory, z = N.isNodeJS ? E.NodeFilterFactory : P.DOMFilterFactory, K = N.isNodeJS ? E.NodeStandardFontDataFactory : P.DOMStandardFontDataFactory;
          async function j(h, a) {
            if (h.destroyed)
              throw new Error("Worker was destroyed");
            const u = await h.messageHandler.sendWithPromise("GetDocRequest", a, a.data ? [a.data.buffer] : null);
            if (h.destroyed)
              throw new Error("Worker was destroyed");
            return u;
          }
          class et {
            static #t = 0;
            constructor() {
              this._capability = Promise.withResolvers(), this._transport = null, this._worker = null, this.docId = `d${et.#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 (a) {
                throw this._worker?.port && delete this._worker._pendingDestroy, a;
              }
              this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
            }
          }
          class tt {
            constructor(a, u, A = !1, x = null) {
              this.length = a, this.initialData = u, this.progressiveDone = A, this.contentDispositionFilename = x, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._progressiveDoneListeners = [], this._readyCapability = Promise.withResolvers();
            }
            addRangeListener(a) {
              this._rangeListeners.push(a);
            }
            addProgressListener(a) {
              this._progressListeners.push(a);
            }
            addProgressiveReadListener(a) {
              this._progressiveReadListeners.push(a);
            }
            addProgressiveDoneListener(a) {
              this._progressiveDoneListeners.push(a);
            }
            onDataRange(a, u) {
              for (const A of this._rangeListeners)
                A(a, u);
            }
            onDataProgress(a, u) {
              this._readyCapability.promise.then(() => {
                for (const A of this._progressListeners)
                  A(a, u);
              });
            }
            onDataProgressiveRead(a) {
              this._readyCapability.promise.then(() => {
                for (const u of this._progressiveReadListeners)
                  u(a);
              });
            }
            onDataProgressiveDone() {
              this._readyCapability.promise.then(() => {
                for (const a of this._progressiveDoneListeners)
                  a();
              });
            }
            transportReady() {
              this._readyCapability.resolve();
            }
            requestDataRange(a, u) {
              (0, N.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
            abort() {
            }
          }
          class ot {
            constructor(a, u) {
              this._pdfInfo = a, this._transport = u;
            }
            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, N.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            get allXfaHtml() {
              return this._transport._htmlForXfa;
            }
            getPage(a) {
              return this._transport.getPage(a);
            }
            getPageIndex(a) {
              return this._transport.getPageIndex(a);
            }
            getDestinations() {
              return this._transport.getDestinations();
            }
            getDestination(a) {
              return this._transport.getDestination(a);
            }
            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: a = "display"
            } = {}) {
              const {
                renderingIntent: u
              } = this._transport.getRenderingIntent(a);
              return this._transport.getOptionalContentConfig(u);
            }
            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(a = !1) {
              return this._transport.startCleanup(a || this.isPureXfa);
            }
            destroy() {
              return this.loadingTask.destroy();
            }
            cachedPageNumber(a) {
              return this._transport.cachedPageNumber(a);
            }
            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 ct {
            #t = null;
            #e = !1;
            constructor(a, u, A, x = !1) {
              this._pageIndex = a, this._pageInfo = u, this._transport = A, this._stats = x ? new P.StatTimer() : null, this._pdfBug = x, this.commonObjs = A.commonObjs, this.objs = new m(), 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: a,
              rotation: u = this.rotate,
              offsetX: A = 0,
              offsetY: x = 0,
              dontFlip: R = !1
            } = {}) {
              return new P.PageViewport({
                viewBox: this.view,
                scale: a,
                rotation: u,
                offsetX: A,
                offsetY: x,
                dontFlip: R
              });
            }
            getAnnotations({
              intent: a = "display"
            } = {}) {
              const {
                renderingIntent: u
              } = this._transport.getRenderingIntent(a);
              return this._transport.getAnnotations(this._pageIndex, u);
            }
            getJSActions() {
              return this._transport.getPageJSActions(this._pageIndex);
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get isPureXfa() {
              return (0, N.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            async getXfa() {
              return this._transport._htmlForXfa?.children[this._pageIndex] || null;
            }
            render({
              canvasContext: a,
              viewport: u,
              intent: A = "display",
              annotationMode: x = N.AnnotationMode.ENABLE,
              transform: R = null,
              background: k = null,
              optionalContentConfigPromise: D = null,
              annotationCanvasMap: I = null,
              pageColors: F = null,
              printAnnotationStorage: T = null
            }) {
              this._stats?.time("Overall");
              const X = this._transport.getRenderingIntent(A, x, T), {
                renderingIntent: Q,
                cacheKey: $
              } = X;
              this.#e = !1, this.#n(), D ||= this._transport.getOptionalContentConfig(Q);
              let q = this._intentStates.get($);
              q || (q = /* @__PURE__ */ Object.create(null), this._intentStates.set($, q)), q.streamReaderCancelTimeout && (clearTimeout(q.streamReaderCancelTimeout), q.streamReaderCancelTimeout = null);
              const rt = !!(Q & N.RenderingIntentFlag.PRINT);
              q.displayReadyCapability || (q.displayReadyCapability = Promise.withResolvers(), q.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, this._stats?.time("Page Request"), this._pumpOperatorList(X));
              const Z = (lt) => {
                q.renderTasks.delete(J), (this._maybeCleanupAfterRender || rt) && (this.#e = !0), this.#s(!rt), lt ? (J.capability.reject(lt), this._abortOperatorList({
                  intentState: q,
                  reason: lt instanceof Error ? lt : new Error(lt)
                })) : J.capability.resolve(), this._stats?.timeEnd("Rendering"), this._stats?.timeEnd("Overall");
              }, J = new e({
                callback: Z,
                params: {
                  canvasContext: a,
                  viewport: u,
                  transform: R,
                  background: k
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                annotationCanvasMap: I,
                operatorList: q.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: this._transport.canvasFactory,
                filterFactory: this._transport.filterFactory,
                useRequestAnimationFrame: !rt,
                pdfBug: this._pdfBug,
                pageColors: F
              });
              (q.renderTasks ||= /* @__PURE__ */ new Set()).add(J);
              const it = J.task;
              return Promise.all([q.displayReadyCapability.promise, D]).then(([lt, gt]) => {
                if (this.destroyed) {
                  Z();
                  return;
                }
                if (this._stats?.time("Rendering"), !(gt.renderingIntent & Q))
                  throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
                J.initializeGraphics({
                  transparency: lt,
                  optionalContentConfig: gt
                }), J.operatorListChanged();
              }).catch(Z), it;
            }
            getOperatorList({
              intent: a = "display",
              annotationMode: u = N.AnnotationMode.ENABLE,
              printAnnotationStorage: A = null
            } = {}) {
              function x() {
                k.operatorList.lastChunk && (k.opListReadCapability.resolve(k.operatorList), k.renderTasks.delete(D));
              }
              const R = this._transport.getRenderingIntent(a, u, A, !0);
              let k = this._intentStates.get(R.cacheKey);
              k || (k = /* @__PURE__ */ Object.create(null), this._intentStates.set(R.cacheKey, k));
              let D;
              return k.opListReadCapability || (D = /* @__PURE__ */ Object.create(null), D.operatorListChanged = x, k.opListReadCapability = Promise.withResolvers(), (k.renderTasks ||= /* @__PURE__ */ new Set()).add(D), k.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, this._stats?.time("Page Request"), this._pumpOperatorList(R)), k.opListReadCapability.promise;
            }
            streamTextContent({
              includeMarkedContent: a = !1,
              disableNormalization: u = !1
            } = {}) {
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                includeMarkedContent: a === !0,
                disableNormalization: u === !0
              }, {
                highWaterMark: 100,
                size(x) {
                  return x.items.length;
                }
              });
            }
            getTextContent(a = {}) {
              if (this._transport._htmlForXfa)
                return this.getXfa().then((A) => p.XfaText.textContent(A));
              const u = this.streamTextContent(a);
              return new Promise(function(A, x) {
                function R() {
                  k.read().then(function({
                    value: I,
                    done: F
                  }) {
                    if (F) {
                      A(D);
                      return;
                    }
                    Object.assign(D.styles, I.styles), D.items.push(...I.items), R();
                  }, x);
                }
                const k = u.getReader(), D = {
                  items: [],
                  styles: /* @__PURE__ */ Object.create(null)
                };
                R();
              });
            }
            getStructTree() {
              return this._transport.getStructTree(this._pageIndex);
            }
            _destroy() {
              this.destroyed = !0;
              const a = [];
              for (const u of this._intentStates.values())
                if (this._abortOperatorList({
                  intentState: u,
                  reason: new Error("Page was destroyed."),
                  force: !0
                }), !u.opListReadCapability)
                  for (const A of u.renderTasks)
                    a.push(A.completed), A.cancel();
              return this.objs.clear(), this.#e = !1, this.#n(), Promise.all(a);
            }
            cleanup(a = !1) {
              this.#e = !0;
              const u = this.#s(!1);
              return a && u && (this._stats &&= new P.StatTimer()), u;
            }
            #s(a = !1) {
              if (this.#n(), !this.#e || this.destroyed)
                return !1;
              if (a)
                return this.#t = setTimeout(() => {
                  this.#t = null, this.#s(!1);
                }, M), !1;
              for (const {
                renderTasks: u,
                operatorList: A
              } of this._intentStates.values())
                if (u.size > 0 || !A.lastChunk)
                  return !1;
              return this._intentStates.clear(), this.objs.clear(), this.#e = !1, !0;
            }
            #n() {
              this.#t && (clearTimeout(this.#t), this.#t = null);
            }
            _startRenderPage(a, u) {
              const A = this._intentStates.get(u);
              A && (this._stats?.timeEnd("Page Request"), A.displayReadyCapability?.resolve(a));
            }
            _renderPageChunk(a, u) {
              for (let A = 0, x = a.length; A < x; A++)
                u.operatorList.fnArray.push(a.fnArray[A]), u.operatorList.argsArray.push(a.argsArray[A]);
              u.operatorList.lastChunk = a.lastChunk, u.operatorList.separateAnnots = a.separateAnnots;
              for (const A of u.renderTasks)
                A.operatorListChanged();
              a.lastChunk && this.#s(!0);
            }
            _pumpOperatorList({
              renderingIntent: a,
              cacheKey: u,
              annotationStorageSerializable: A
            }) {
              const {
                map: x,
                transfer: R
              } = A, D = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: a,
                cacheKey: u,
                annotationStorage: x
              }, R).getReader(), I = this._intentStates.get(u);
              I.streamReader = D;
              const F = () => {
                D.read().then(({
                  value: T,
                  done: X
                }) => {
                  if (X) {
                    I.streamReader = null;
                    return;
                  }
                  this._transport.destroyed || (this._renderPageChunk(T, I), F());
                }, (T) => {
                  if (I.streamReader = null, !this._transport.destroyed) {
                    if (I.operatorList) {
                      I.operatorList.lastChunk = !0;
                      for (const X of I.renderTasks)
                        X.operatorListChanged();
                      this.#s(!0);
                    }
                    if (I.displayReadyCapability)
                      I.displayReadyCapability.reject(T);
                    else if (I.opListReadCapability)
                      I.opListReadCapability.reject(T);
                    else
                      throw T;
                  }
                });
              };
              F();
            }
            _abortOperatorList({
              intentState: a,
              reason: u,
              force: A = !1
            }) {
              if (a.streamReader) {
                if (a.streamReaderCancelTimeout && (clearTimeout(a.streamReaderCancelTimeout), a.streamReaderCancelTimeout = null), !A) {
                  if (a.renderTasks.size > 0)
                    return;
                  if (u instanceof P.RenderingCancelledException) {
                    let x = L;
                    u.extraDelay > 0 && u.extraDelay < 1e3 && (x += u.extraDelay), a.streamReaderCancelTimeout = setTimeout(() => {
                      a.streamReaderCancelTimeout = null, this._abortOperatorList({
                        intentState: a,
                        reason: u,
                        force: !0
                      });
                    }, x);
                    return;
                  }
                }
                if (a.streamReader.cancel(new N.AbortException(u.message)).catch(() => {
                }), a.streamReader = null, !this._transport.destroyed) {
                  for (const [x, R] of this._intentStates)
                    if (R === a) {
                      this._intentStates.delete(x);
                      break;
                    }
                  this.cleanup();
                }
              }
            }
            get stats() {
              return this._stats;
            }
          }
          class pt {
            #t = /* @__PURE__ */ new Set();
            #e = Promise.resolve();
            postMessage(a, u) {
              const A = {
                data: structuredClone(a, u ? {
                  transfer: u
                } : null)
              };
              this.#e.then(() => {
                for (const x of this.#t)
                  x.call(this, A);
              });
            }
            addEventListener(a, u) {
              this.#t.add(u);
            }
            removeEventListener(a, u) {
              this.#t.delete(u);
            }
            terminate() {
              this.#t.clear();
            }
          }
          const dt = {
            isWorkerDisabled: !1,
            fakeWorkerId: 0
          };
          N.isNodeJS && (dt.isWorkerDisabled = !0, d.GlobalWorkerOptions.workerSrc ||= "./pdf.worker.mjs"), dt.isSameOrigin = function(h, a) {
            let u;
            try {
              if (u = new URL(h), !u.origin || u.origin === "null")
                return !1;
            } catch {
              return !1;
            }
            const A = new URL(a, u);
            return u.origin === A.origin;
          }, dt.createCDNWrapper = function(h) {
            const a = `await import("${h}");`;
            return URL.createObjectURL(new Blob([a], {
              type: "text/javascript"
            }));
          };
          class ht {
            static #t;
            constructor({
              name: a = null,
              port: u = null,
              verbosity: A = (0, N.getVerbosityLevel)()
            } = {}) {
              if (this.name = a, this.destroyed = !1, this.verbosity = A, this._readyCapability = Promise.withResolvers(), this._port = null, this._webWorker = null, this._messageHandler = null, u) {
                if (ht.#t?.has(u))
                  throw new Error("Cannot use more than one PDFWorker per port.");
                (ht.#t ||= /* @__PURE__ */ new WeakMap()).set(u, this), this._initializeFromPort(u);
                return;
              }
              this._initialize();
            }
            get promise() {
              return this._readyCapability.promise;
            }
            get port() {
              return this._port;
            }
            get messageHandler() {
              return this._messageHandler;
            }
            _initializeFromPort(a) {
              this._port = a, this._messageHandler = new o.MessageHandler("main", "worker", a), this._messageHandler.on("ready", function() {
              }), this._readyCapability.resolve(), this._messageHandler.send("configure", {
                verbosity: this.verbosity
              });
            }
            _initialize() {
              if (!dt.isWorkerDisabled && !ht.#e) {
                let {
                  workerSrc: a
                } = ht;
                try {
                  dt.isSameOrigin(window.location.href, a) || (a = dt.createCDNWrapper(new URL(a, window.location).href));
                  const u = new Worker(a, {
                    type: "module"
                  }), A = new o.MessageHandler("main", "worker", u), x = () => {
                    u.removeEventListener("error", R), A.destroy(), u.terminate(), this.destroyed ? this._readyCapability.reject(new Error("Worker was destroyed")) : this._setupFakeWorker();
                  }, R = () => {
                    this._webWorker || x();
                  };
                  u.addEventListener("error", R), A.on("test", (D) => {
                    if (u.removeEventListener("error", R), this.destroyed) {
                      x();
                      return;
                    }
                    D ? (this._messageHandler = A, this._port = u, this._webWorker = u, this._readyCapability.resolve(), A.send("configure", {
                      verbosity: this.verbosity
                    })) : (this._setupFakeWorker(), A.destroy(), u.terminate());
                  }), A.on("ready", (D) => {
                    if (u.removeEventListener("error", R), this.destroyed) {
                      x();
                      return;
                    }
                    try {
                      k();
                    } catch {
                      this._setupFakeWorker();
                    }
                  });
                  const k = () => {
                    const D = new Uint8Array();
                    A.send("test", D, [D.buffer]);
                  };
                  k();
                  return;
                } catch {
                  (0, N.info)("The worker has been disabled.");
                }
              }
              this._setupFakeWorker();
            }
            _setupFakeWorker() {
              dt.isWorkerDisabled || ((0, N.warn)("Setting up fake worker."), dt.isWorkerDisabled = !0), ht._setupFakeWorkerGlobal.then((a) => {
                if (this.destroyed) {
                  this._readyCapability.reject(new Error("Worker was destroyed"));
                  return;
                }
                const u = new pt();
                this._port = u;
                const A = `fake${dt.fakeWorkerId++}`, x = new o.MessageHandler(A + "_worker", A, u);
                a.setup(x, u);
                const R = new o.MessageHandler(A, A + "_worker", u);
                this._messageHandler = R, this._readyCapability.resolve(), R.send("configure", {
                  verbosity: this.verbosity
                });
              }).catch((a) => {
                this._readyCapability.reject(new Error(`Setting up fake worker failed: "${a.message}".`));
              });
            }
            destroy() {
              this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), ht.#t?.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
            }
            static fromPort(a) {
              if (!a?.port)
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              const u = this.#t?.get(a.port);
              if (u) {
                if (u._pendingDestroy)
                  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
                return u;
              }
              return new ht(a);
            }
            static get workerSrc() {
              if (d.GlobalWorkerOptions.workerSrc)
                return d.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 a = async () => this.#e ? this.#e : (await import(
                /*webpackIgnore: true*/
                this.workerSrc
              )).WorkerMessageHandler;
              return (0, N.shadow)(this, "_setupFakeWorkerGlobal", a());
            }
          }
          class ut {
            #t = /* @__PURE__ */ new Map();
            #e = /* @__PURE__ */ new Map();
            #s = /* @__PURE__ */ new Map();
            #n = /* @__PURE__ */ new Map();
            #r = null;
            constructor(a, u, A, x, R) {
              this.messageHandler = a, this.loadingTask = u, this.commonObjs = new m(), this.fontLoader = new C.FontLoader({
                ownerDocument: x.ownerDocument,
                styleElement: x.styleElement
              }), this._params = x, this.canvasFactory = R.canvasFactory, this.filterFactory = R.filterFactory, this.cMapReaderFactory = R.cMapReaderFactory, this.standardFontDataFactory = R.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = A, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
            }
            #i(a, u = null) {
              const A = this.#t.get(a);
              if (A)
                return A;
              const x = this.messageHandler.sendWithPromise(a, u);
              return this.#t.set(a, x), x;
            }
            get annotationStorage() {
              return (0, N.shadow)(this, "annotationStorage", new U.AnnotationStorage());
            }
            getRenderingIntent(a, u = N.AnnotationMode.ENABLE, A = null, x = !1) {
              let R = N.RenderingIntentFlag.DISPLAY, k = U.SerializableEmpty;
              switch (a) {
                case "any":
                  R = N.RenderingIntentFlag.ANY;
                  break;
                case "display":
                  break;
                case "print":
                  R = N.RenderingIntentFlag.PRINT;
                  break;
                default:
                  (0, N.warn)(`getRenderingIntent - invalid intent: ${a}`);
              }
              switch (u) {
                case N.AnnotationMode.DISABLE:
                  R += N.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;
                case N.AnnotationMode.ENABLE:
                  break;
                case N.AnnotationMode.ENABLE_FORMS:
                  R += N.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;
                case N.AnnotationMode.ENABLE_STORAGE:
                  R += N.RenderingIntentFlag.ANNOTATIONS_STORAGE, k = (R & N.RenderingIntentFlag.PRINT && A instanceof U.PrintAnnotationStorage ? A : this.annotationStorage).serializable;
                  break;
                default:
                  (0, N.warn)(`getRenderingIntent - invalid annotationMode: ${u}`);
              }
              return x && (R += N.RenderingIntentFlag.OPLIST), {
                renderingIntent: R,
                cacheKey: `${R}_${k.hash}`,
                annotationStorageSerializable: k
              };
            }
            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 a = [];
              for (const A of this.#e.values())
                a.push(A._destroy());
              this.#e.clear(), this.#s.clear(), this.#n.clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
              const u = this.messageHandler.sendWithPromise("Terminate", null);
              return a.push(u), Promise.all(a).then(() => {
                this.commonObjs.clear(), this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(), (0, r.cleanupTextLayer)(), this._networkStream?.cancelAllRequests(new N.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
              }, this.destroyCapability.reject), this.destroyCapability.promise;
            }
            setupMessageHandler() {
              const {
                messageHandler: a,
                loadingTask: u
              } = this;
              a.on("GetReader", (A, x) => {
                (0, N.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (R) => {
                  this._lastProgress = {
                    loaded: R.loaded,
                    total: R.total
                  };
                }, x.onPull = () => {
                  this._fullReader.read().then(function({
                    value: R,
                    done: k
                  }) {
                    if (k) {
                      x.close();
                      return;
                    }
                    (0, N.assert)(R instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), x.enqueue(new Uint8Array(R), 1, [R]);
                  }).catch((R) => {
                    x.error(R);
                  });
                }, x.onCancel = (R) => {
                  this._fullReader.cancel(R), x.ready.catch((k) => {
                    if (!this.destroyed)
                      throw k;
                  });
                };
              }), a.on("ReaderHeadersReady", (A) => {
                const x = Promise.withResolvers(), R = this._fullReader;
                return R.headersReady.then(() => {
                  (!R.isStreamingSupported || !R.isRangeSupported) && (this._lastProgress && u.onProgress?.(this._lastProgress), R.onProgress = (k) => {
                    u.onProgress?.({
                      loaded: k.loaded,
                      total: k.total
                    });
                  }), x.resolve({
                    isStreamingSupported: R.isStreamingSupported,
                    isRangeSupported: R.isRangeSupported,
                    contentLength: R.contentLength
                  });
                }, x.reject), x.promise;
              }), a.on("GetRangeReader", (A, x) => {
                (0, N.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
                const R = this._networkStream.getRangeReader(A.begin, A.end);
                if (!R) {
                  x.close();
                  return;
                }
                x.onPull = () => {
                  R.read().then(function({
                    value: k,
                    done: D
                  }) {
                    if (D) {
                      x.close();
                      return;
                    }
                    (0, N.assert)(k instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), x.enqueue(new Uint8Array(k), 1, [k]);
                  }).catch((k) => {
                    x.error(k);
                  });
                }, x.onCancel = (k) => {
                  R.cancel(k), x.ready.catch((D) => {
                    if (!this.destroyed)
                      throw D;
                  });
                };
              }), a.on("GetDoc", ({
                pdfInfo: A
              }) => {
                this._numPages = A.numPages, this._htmlForXfa = A.htmlForXfa, delete A.htmlForXfa, u._capability.resolve(new ot(A, this));
              }), a.on("DocException", function(A) {
                let x;
                switch (A.name) {
                  case "PasswordException":
                    x = new N.PasswordException(A.message, A.code);
                    break;
                  case "InvalidPDFException":
                    x = new N.InvalidPDFException(A.message);
                    break;
                  case "MissingPDFException":
                    x = new N.MissingPDFException(A.message);
                    break;
                  case "UnexpectedResponseException":
                    x = new N.UnexpectedResponseException(A.message, A.status);
                    break;
                  case "UnknownErrorException":
                    x = new N.UnknownErrorException(A.message, A.details);
                    break;
                  default:
                    (0, N.unreachable)("DocException - expected a valid Error.");
                }
                u._capability.reject(x);
              }), a.on("PasswordRequest", (A) => {
                if (this.#r = Promise.withResolvers(), u.onPassword) {
                  const x = (R) => {
                    R instanceof Error ? this.#r.reject(R) : this.#r.resolve({
                      password: R
                    });
                  };
                  try {
                    u.onPassword(x, A.code);
                  } catch (R) {
                    this.#r.reject(R);
                  }
                } else
                  this.#r.reject(new N.PasswordException(A.message, A.code));
                return this.#r.promise;
              }), a.on("DataLoaded", (A) => {
                u.onProgress?.({
                  loaded: A.length,
                  total: A.length
                }), this.downloadInfoCapability.resolve(A);
              }), a.on("StartRenderPage", (A) => {
                if (this.destroyed)
                  return;
                this.#e.get(A.pageIndex)._startRenderPage(A.transparency, A.cacheKey);
              }), a.on("commonobj", ([A, x, R]) => {
                if (this.destroyed || this.commonObjs.has(A))
                  return null;
                switch (x) {
                  case "Font":
                    const k = this._params;
                    if ("error" in R) {
                      const T = R.error;
                      (0, N.warn)(`Error during font loading: ${T}`), this.commonObjs.resolve(A, T);
                      break;
                    }
                    const D = k.pdfBug && globalThis.FontInspector?.enabled ? (T, X) => globalThis.FontInspector.fontAdded(T, X) : null, I = new C.FontFaceObject(R, {
                      disableFontFace: k.disableFontFace,
                      ignoreErrors: k.ignoreErrors,
                      inspectFont: D
                    });
                    this.fontLoader.bind(I).catch(() => a.sendWithPromise("FontFallback", {
                      id: A
                    })).finally(() => {
                      !k.fontExtraProperties && I.data && (I.data = null), this.commonObjs.resolve(A, I);
                    });
                    break;
                  case "CopyLocalImage":
                    const {
                      imageRef: F
                    } = R;
                    (0, N.assert)(F, "The imageRef must be defined.");
                    for (const T of this.#e.values())
                      for (const [, X] of T.objs)
                        if (X.ref === F)
                          return X.dataLen ? (this.commonObjs.resolve(A, structuredClone(X)), X.dataLen) : null;
                    break;
                  case "FontPath":
                  case "Image":
                  case "Pattern":
                    this.commonObjs.resolve(A, R);
                    break;
                  default:
                    throw new Error(`Got unknown common object type ${x}`);
                }
                return null;
              }), a.on("obj", ([A, x, R, k]) => {
                if (this.destroyed)
                  return;
                const D = this.#e.get(x);
                if (!D.objs.has(A)) {
                  if (D._intentStates.size === 0) {
                    k?.bitmap?.close();
                    return;
                  }
                  switch (R) {
                    case "Image":
                      D.objs.resolve(A, k), k?.dataLen > N.MAX_IMAGE_SIZE_TO_CACHE && (D._maybeCleanupAfterRender = !0);
                      break;
                    case "Pattern":
                      D.objs.resolve(A, k);
                      break;
                    default:
                      throw new Error(`Got unknown object type ${R}`);
                  }
                }
              }), a.on("DocProgress", (A) => {
                this.destroyed || u.onProgress?.({
                  loaded: A.loaded,
                  total: A.total
                });
              }), a.on("FetchBuiltInCMap", (A) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.cMapReaderFactory ? this.cMapReaderFactory.fetch(A) : Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))), a.on("FetchStandardFontData", (A) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.standardFontDataFactory ? this.standardFontDataFactory.fetch(A) : Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")));
            }
            getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
            saveDocument() {
              this.annotationStorage.size <= 0 && (0, N.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
              const {
                map: a,
                transfer: u
              } = this.annotationStorage.serializable;
              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: a,
                filename: this._fullReader?.filename ?? null
              }, u).finally(() => {
                this.annotationStorage.resetModified();
              });
            }
            getPage(a) {
              if (!Number.isInteger(a) || a <= 0 || a > this._numPages)
                return Promise.reject(new Error("Invalid page request."));
              const u = a - 1, A = this.#s.get(u);
              if (A)
                return A;
              const x = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: u
              }).then((R) => {
                if (this.destroyed)
                  throw new Error("Transport destroyed");
                R.refStr && this.#n.set(R.refStr, a);
                const k = new ct(u, R, this, this._params.pdfBug);
                return this.#e.set(u, k), k;
              });
              return this.#s.set(u, x), x;
            }
            getPageIndex(a) {
              return Y(a) ? this.messageHandler.sendWithPromise("GetPageIndex", {
                num: a.num,
                gen: a.gen
              }) : Promise.reject(new Error("Invalid pageIndex request."));
            }
            getAnnotations(a, u) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: a,
                intent: u
              });
            }
            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(a) {
              return typeof a != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
                id: a
              });
            }
            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(a) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: a
              });
            }
            getStructTree(a) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: a
              });
            }
            getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
            getOptionalContentConfig(a) {
              return this.#i("GetOptionalContentConfig").then((u) => new s.OptionalContentConfig(u, a));
            }
            getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
            getMetadata() {
              const a = "GetMetadata", u = this.#t.get(a);
              if (u)
                return u;
              const A = this.messageHandler.sendWithPromise(a, null).then((x) => ({
                info: x[0],
                metadata: x[1] ? new b.Metadata(x[1]) : null,
                contentDispositionFilename: this._fullReader?.filename ?? null,
                contentLength: this._fullReader?.contentLength ?? null
              }));
              return this.#t.set(a, A), A;
            }
            getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
            async startCleanup(a = !1) {
              if (!this.destroyed) {
                await this.messageHandler.sendWithPromise("Cleanup", null);
                for (const u of this.#e.values())
                  if (!u.cleanup())
                    throw new Error(`startCleanup: Page ${u.pageNumber} is currently rendering.`);
                this.commonObjs.clear(), a || this.fontLoader.clear(), this.#t.clear(), this.filterFactory.destroy(!0), (0, r.cleanupTextLayer)();
              }
            }
            cachedPageNumber(a) {
              if (!Y(a))
                return null;
              const u = a.gen === 0 ? `${a.num}R` : `${a.num}R${a.gen}`;
              return this.#n.get(u) ?? null;
            }
            get loadingParams() {
              const {
                disableAutoFetch: a,
                enableXfa: u
              } = this._params;
              return (0, N.shadow)(this, "loadingParams", {
                disableAutoFetch: a,
                enableXfa: u
              });
            }
          }
          const st = Symbol("INITIAL_DATA");
          class m {
            #t = /* @__PURE__ */ Object.create(null);
            #e(a) {
              return this.#t[a] ||= {
                ...Promise.withResolvers(),
                data: st
              };
            }
            get(a, u = null) {
              if (u) {
                const x = this.#e(a);
                return x.promise.then(() => u(x.data)), null;
              }
              const A = this.#t[a];
              if (!A || A.data === st)
                throw new Error(`Requesting object that isn't resolved yet ${a}.`);
              return A.data;
            }
            has(a) {
              const u = this.#t[a];
              return !!u && u.data !== st;
            }
            resolve(a, u = null) {
              const A = this.#e(a);
              A.data = u, A.resolve();
            }
            clear() {
              for (const a in this.#t) {
                const {
                  data: u
                } = this.#t[a];
                u?.bitmap?.close();
              }
              this.#t = /* @__PURE__ */ Object.create(null);
            }
            *[Symbol.iterator]() {
              for (const a in this.#t) {
                const {
                  data: u
                } = this.#t[a];
                u !== st && (yield [a, u]);
              }
            }
          }
          class c {
            #t = null;
            constructor(a) {
              this.#t = a, this.onContinue = null;
            }
            get promise() {
              return this.#t.capability.promise;
            }
            cancel(a = 0) {
              this.#t.cancel(null, a);
            }
            get separateAnnots() {
              const {
                separateAnnots: a
              } = this.#t.operatorList;
              if (!a)
                return !1;
              const {
                annotationCanvasMap: u
              } = this.#t;
              return a.form || a.canvas && u?.size > 0;
            }
          }
          class e {
            static #t = /* @__PURE__ */ new WeakSet();
            constructor({
              callback: a,
              params: u,
              objs: A,
              commonObjs: x,
              annotationCanvasMap: R,
              operatorList: k,
              pageIndex: D,
              canvasFactory: I,
              filterFactory: F,
              useRequestAnimationFrame: T = !1,
              pdfBug: X = !1,
              pageColors: Q = null
            }) {
              this.callback = a, this.params = u, this.objs = A, this.commonObjs = x, this.annotationCanvasMap = R, this.operatorListIdx = null, this.operatorList = k, this._pageIndex = D, this.canvasFactory = I, this.filterFactory = F, this._pdfBug = X, this.pageColors = Q, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = T === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new c(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 = u.canvasContext.canvas;
            }
            get completed() {
              return this.capability.promise.catch(function() {
              });
            }
            initializeGraphics({
              transparency: a = !1,
              optionalContentConfig: u
            }) {
              if (this.cancelled)
                return;
              if (this._canvas) {
                if (e.#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.");
                e.#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: A,
                viewport: x,
                transform: R,
                background: k
              } = this.params;
              this.gfx = new v.CanvasGraphics(A, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: u
              }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
                transform: R,
                viewport: x,
                transparency: a,
                background: k
              }), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback?.();
            }
            cancel(a = null, u = 0) {
              this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), e.#t.delete(this._canvas), this.callback(a || new P.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, u));
            }
            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(), e.#t.delete(this._canvas), this.callback())));
            }
          }
          const n = "4.2.67", f = "49b388101";
          B();
        } catch (S) {
          B(S);
        }
      });
    }
  ),
  /***/
  583: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        BaseCMapReaderFactory: () => (
          /* binding */
          U
        ),
        /* harmony export */
        BaseCanvasFactory: () => (
          /* binding */
          N
        ),
        /* harmony export */
        BaseFilterFactory: () => (
          /* binding */
          B
        ),
        /* harmony export */
        BaseSVGFactory: () => (
          /* binding */
          C
        ),
        /* harmony export */
        BaseStandardFontDataFactory: () => (
          /* binding */
          P
        )
        /* harmony export */
      });
      var y = V(292);
      class B {
        constructor() {
          this.constructor === B && (0, y.unreachable)("Cannot initialize BaseFilterFactory.");
        }
        addFilter(v) {
          return "none";
        }
        addHCMFilter(v, r) {
          return "none";
        }
        addHighlightHCMFilter(v, r, d, o, b) {
          return "none";
        }
        destroy(v = !1) {
        }
      }
      class N {
        constructor() {
          this.constructor === N && (0, y.unreachable)("Cannot initialize BaseCanvasFactory.");
        }
        create(v, r) {
          if (v <= 0 || r <= 0)
            throw new Error("Invalid canvas size");
          const d = this._createCanvas(v, r);
          return {
            canvas: d,
            context: d.getContext("2d")
          };
        }
        reset(v, r, d) {
          if (!v.canvas)
            throw new Error("Canvas is not specified");
          if (r <= 0 || d <= 0)
            throw new Error("Invalid canvas size");
          v.canvas.width = r, v.canvas.height = d;
        }
        destroy(v) {
          if (!v.canvas)
            throw new Error("Canvas is not specified");
          v.canvas.width = 0, v.canvas.height = 0, v.canvas = null, v.context = null;
        }
        _createCanvas(v, r) {
          (0, y.unreachable)("Abstract method `_createCanvas` called.");
        }
      }
      class U {
        constructor({
          baseUrl: v = null,
          isCompressed: r = !0
        }) {
          this.constructor === U && (0, y.unreachable)("Cannot initialize BaseCMapReaderFactory."), this.baseUrl = v, this.isCompressed = r;
        }
        async fetch({
          name: v
        }) {
          if (!this.baseUrl)
            throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');
          if (!v)
            throw new Error("CMap name must be specified.");
          const r = this.baseUrl + v + (this.isCompressed ? ".bcmap" : ""), d = this.isCompressed ? y.CMapCompressionType.BINARY : y.CMapCompressionType.NONE;
          return this._fetchData(r, d).catch((o) => {
            throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${r}`);
          });
        }
        _fetchData(v, r) {
          (0, y.unreachable)("Abstract method `_fetchData` called.");
        }
      }
      class P {
        constructor({
          baseUrl: v = null
        }) {
          this.constructor === P && (0, y.unreachable)("Cannot initialize BaseStandardFontDataFactory."), this.baseUrl = v;
        }
        async fetch({
          filename: v
        }) {
          if (!this.baseUrl)
            throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');
          if (!v)
            throw new Error("Font filename must be specified.");
          const r = `${this.baseUrl}${v}`;
          return this._fetchData(r).catch((d) => {
            throw new Error(`Unable to load font data at: ${r}`);
          });
        }
        _fetchData(v) {
          (0, y.unreachable)("Abstract method `_fetchData` called.");
        }
      }
      class C {
        constructor() {
          this.constructor === C && (0, y.unreachable)("Cannot initialize BaseSVGFactory.");
        }
        create(v, r, d = !1) {
          if (v <= 0 || r <= 0)
            throw new Error("Invalid SVG dimensions");
          const o = this._createSVG("svg:svg");
          return o.setAttribute("version", "1.1"), d || (o.setAttribute("width", `${v}px`), o.setAttribute("height", `${r}px`)), o.setAttribute("preserveAspectRatio", "none"), o.setAttribute("viewBox", `0 0 ${v} ${r}`), o;
        }
        createElement(v) {
          if (typeof v != "string")
            throw new Error("Invalid SVG element type");
          return this._createSVG(v);
        }
        _createSVG(v) {
          (0, y.unreachable)("Abstract method `_createSVG` called.");
        }
      }
    }
  ),
  /***/
  923: (
    /***/
    (at, W, V) => {
      V.d(W, {
        CanvasGraphics: () => (
          /* binding */
          m
        )
      });
      var y = V(292), B = V(419);
      const N = {
        FILL: "Fill",
        STROKE: "Stroke",
        SHADING: "Shading"
      };
      function U(c, e) {
        if (!e)
          return;
        const n = e[2] - e[0], f = e[3] - e[1], h = new Path2D();
        h.rect(e[0], e[1], n, f), c.clip(h);
      }
      class P {
        constructor() {
          this.constructor === P && (0, y.unreachable)("Cannot initialize BaseShadingPattern.");
        }
        getPattern() {
          (0, y.unreachable)("Abstract method `getPattern` called.");
        }
      }
      class C extends P {
        constructor(e) {
          super(), this._type = e[1], this._bbox = e[2], this._colorStops = e[3], this._p0 = e[4], this._p1 = e[5], this._r0 = e[6], this._r1 = e[7], this.matrix = null;
        }
        _createGradient(e) {
          let n;
          this._type === "axial" ? n = e.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (n = e.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
          for (const f of this._colorStops)
            n.addColorStop(f[0], f[1]);
          return n;
        }
        getPattern(e, n, f, h) {
          let a;
          if (h === N.STROKE || h === N.FILL) {
            const u = n.current.getClippedPathBoundingBox(h, (0, B.getCurrentTransform)(e)) || [0, 0, 0, 0], A = Math.ceil(u[2] - u[0]) || 1, x = Math.ceil(u[3] - u[1]) || 1, R = n.cachedCanvases.getCanvas("pattern", A, x, !0), k = R.context;
            k.clearRect(0, 0, k.canvas.width, k.canvas.height), k.beginPath(), k.rect(0, 0, k.canvas.width, k.canvas.height), k.translate(-u[0], -u[1]), f = y.Util.transform(f, [1, 0, 0, 1, u[0], u[1]]), k.transform(...n.baseTransform), this.matrix && k.transform(...this.matrix), U(k, this._bbox), k.fillStyle = this._createGradient(k), k.fill(), a = e.createPattern(R.canvas, "no-repeat");
            const D = new DOMMatrix(f);
            a.setTransform(D);
          } else
            U(e, this._bbox), a = this._createGradient(e);
          return a;
        }
      }
      function E(c, e, n, f, h, a, u, A) {
        const x = e.coords, R = e.colors, k = c.data, D = c.width * 4;
        let I;
        x[n + 1] > x[f + 1] && (I = n, n = f, f = I, I = a, a = u, u = I), x[f + 1] > x[h + 1] && (I = f, f = h, h = I, I = u, u = A, A = I), x[n + 1] > x[f + 1] && (I = n, n = f, f = I, I = a, a = u, u = I);
        const F = (x[n] + e.offsetX) * e.scaleX, T = (x[n + 1] + e.offsetY) * e.scaleY, X = (x[f] + e.offsetX) * e.scaleX, Q = (x[f + 1] + e.offsetY) * e.scaleY, $ = (x[h] + e.offsetX) * e.scaleX, q = (x[h + 1] + e.offsetY) * e.scaleY;
        if (T >= q)
          return;
        const rt = R[a], Z = R[a + 1], J = R[a + 2], it = R[u], lt = R[u + 1], gt = R[u + 2], bt = R[A], At = R[A + 1], mt = R[A + 2], Ct = Math.round(T), St = Math.round(q);
        let Tt, vt, Et, Rt, Lt, Nt, Ht, Pt;
        for (let xt = Ct; xt <= St; xt++) {
          if (xt < Q) {
            const yt = xt < T ? 0 : (T - xt) / (T - Q);
            Tt = F - (F - X) * yt, vt = rt - (rt - it) * yt, Et = Z - (Z - lt) * yt, Rt = J - (J - gt) * yt;
          } else {
            let yt;
            xt > q ? yt = 1 : Q === q ? yt = 0 : yt = (Q - xt) / (Q - q), Tt = X - (X - $) * yt, vt = it - (it - bt) * yt, Et = lt - (lt - At) * yt, Rt = gt - (gt - mt) * yt;
          }
          let wt;
          xt < T ? wt = 0 : xt > q ? wt = 1 : wt = (T - xt) / (T - q), Lt = F - (F - $) * wt, Nt = rt - (rt - bt) * wt, Ht = Z - (Z - At) * wt, Pt = J - (J - mt) * wt;
          const Bt = Math.round(Math.min(Tt, Lt)), Dt = Math.round(Math.max(Tt, Lt));
          let Mt = D * xt + Bt * 4;
          for (let yt = Bt; yt <= Dt; yt++)
            wt = (Tt - yt) / (Tt - Lt), wt < 0 ? wt = 0 : wt > 1 && (wt = 1), k[Mt++] = vt - (vt - Nt) * wt | 0, k[Mt++] = Et - (Et - Ht) * wt | 0, k[Mt++] = Rt - (Rt - Pt) * wt | 0, k[Mt++] = 255;
        }
      }
      function v(c, e, n) {
        const f = e.coords, h = e.colors;
        let a, u;
        switch (e.type) {
          case "lattice":
            const A = e.verticesPerRow, x = Math.floor(f.length / A) - 1, R = A - 1;
            for (a = 0; a < x; a++) {
              let k = a * A;
              for (let D = 0; D < R; D++, k++)
                E(c, n, f[k], f[k + 1], f[k + A], h[k], h[k + 1], h[k + A]), E(c, n, f[k + A + 1], f[k + 1], f[k + A], h[k + A + 1], h[k + 1], h[k + A]);
            }
            break;
          case "triangles":
            for (a = 0, u = f.length; a < u; a += 3)
              E(c, n, f[a], f[a + 1], f[a + 2], h[a], h[a + 1], h[a + 2]);
            break;
          default:
            throw new Error("illegal figure");
        }
      }
      class r extends P {
        constructor(e) {
          super(), this._coords = e[2], this._colors = e[3], this._figures = e[4], this._bounds = e[5], this._bbox = e[7], this._background = e[8], this.matrix = null;
        }
        _createMeshCanvas(e, n, f) {
          const A = Math.floor(this._bounds[0]), x = Math.floor(this._bounds[1]), R = Math.ceil(this._bounds[2]) - A, k = Math.ceil(this._bounds[3]) - x, D = Math.min(Math.ceil(Math.abs(R * e[0] * 1.1)), 3e3), I = Math.min(Math.ceil(Math.abs(k * e[1] * 1.1)), 3e3), F = R / D, T = k / I, X = {
            coords: this._coords,
            colors: this._colors,
            offsetX: -A,
            offsetY: -x,
            scaleX: 1 / F,
            scaleY: 1 / T
          }, Q = D + 2 * 2, $ = I + 2 * 2, q = f.getCanvas("mesh", Q, $, !1), rt = q.context, Z = rt.createImageData(D, I);
          if (n) {
            const it = Z.data;
            for (let lt = 0, gt = it.length; lt < gt; lt += 4)
              it[lt] = n[0], it[lt + 1] = n[1], it[lt + 2] = n[2], it[lt + 3] = 255;
          }
          for (const it of this._figures)
            v(Z, it, X);
          return rt.putImageData(Z, 2, 2), {
            canvas: q.canvas,
            offsetX: A - 2 * F,
            offsetY: x - 2 * T,
            scaleX: F,
            scaleY: T
          };
        }
        getPattern(e, n, f, h) {
          U(e, this._bbox);
          let a;
          if (h === N.SHADING)
            a = y.Util.singularValueDecompose2dScale((0, B.getCurrentTransform)(e));
          else if (a = y.Util.singularValueDecompose2dScale(n.baseTransform), this.matrix) {
            const A = y.Util.singularValueDecompose2dScale(this.matrix);
            a = [a[0] * A[0], a[1] * A[1]];
          }
          const u = this._createMeshCanvas(a, h === N.SHADING ? null : this._background, n.cachedCanvases);
          return h !== N.SHADING && (e.setTransform(...n.baseTransform), this.matrix && e.transform(...this.matrix)), e.translate(u.offsetX, u.offsetY), e.scale(u.scaleX, u.scaleY), e.createPattern(u.canvas, "no-repeat");
        }
      }
      class d extends P {
        getPattern() {
          return "hotpink";
        }
      }
      function o(c) {
        switch (c[0]) {
          case "RadialAxial":
            return new C(c);
          case "Mesh":
            return new r(c);
          case "Dummy":
            return new d();
        }
        throw new Error(`Unknown IR type: ${c[0]}`);
      }
      const b = {
        COLORED: 1,
        UNCOLORED: 2
      };
      class s {
        static MAX_PATTERN_SIZE = 3e3;
        constructor(e, n, f, h, a) {
          this.operatorList = e[2], this.matrix = e[3] || [1, 0, 0, 1, 0, 0], this.bbox = e[4], this.xstep = e[5], this.ystep = e[6], this.paintType = e[7], this.tilingType = e[8], this.color = n, this.ctx = f, this.canvasGraphicsFactory = h, this.baseTransform = a;
        }
        createPatternCanvas(e) {
          const n = this.operatorList, f = this.bbox, h = this.xstep, a = this.ystep, u = this.paintType, A = this.tilingType, x = this.color, R = this.canvasGraphicsFactory;
          (0, y.info)("TilingType: " + A);
          const k = f[0], D = f[1], I = f[2], F = f[3], T = y.Util.singularValueDecompose2dScale(this.matrix), X = y.Util.singularValueDecompose2dScale(this.baseTransform), Q = [T[0] * X[0], T[1] * X[1]], $ = this.getSizeAndScale(h, this.ctx.canvas.width, Q[0]), q = this.getSizeAndScale(a, this.ctx.canvas.height, Q[1]), rt = e.cachedCanvases.getCanvas("pattern", $.size, q.size, !0), Z = rt.context, J = R.createCanvasGraphics(Z);
          J.groupLevel = e.groupLevel, this.setFillAndStrokeStyleToContext(J, u, x);
          let it = k, lt = D, gt = I, bt = F;
          return k < 0 && (it = 0, gt += Math.abs(k)), D < 0 && (lt = 0, bt += Math.abs(D)), Z.translate(-($.scale * it), -(q.scale * lt)), J.transform($.scale, 0, 0, q.scale, 0, 0), Z.save(), this.clipBbox(J, it, lt, gt, bt), J.baseTransform = (0, B.getCurrentTransform)(J.ctx), J.executeOperatorList(n), J.endDrawing(), {
            canvas: rt.canvas,
            scaleX: $.scale,
            scaleY: q.scale,
            offsetX: it,
            offsetY: lt
          };
        }
        getSizeAndScale(e, n, f) {
          e = Math.abs(e);
          const h = Math.max(s.MAX_PATTERN_SIZE, n);
          let a = Math.ceil(e * f);
          return a >= h ? a = h : f = a / e, {
            scale: f,
            size: a
          };
        }
        clipBbox(e, n, f, h, a) {
          const u = h - n, A = a - f;
          e.ctx.rect(n, f, u, A), e.current.updateRectMinMax((0, B.getCurrentTransform)(e.ctx), [n, f, h, a]), e.clip(), e.endPath();
        }
        setFillAndStrokeStyleToContext(e, n, f) {
          const h = e.ctx, a = e.current;
          switch (n) {
            case b.COLORED:
              const u = this.ctx;
              h.fillStyle = u.fillStyle, h.strokeStyle = u.strokeStyle, a.fillColor = u.fillStyle, a.strokeColor = u.strokeStyle;
              break;
            case b.UNCOLORED:
              const A = y.Util.makeHexColor(f[0], f[1], f[2]);
              h.fillStyle = A, h.strokeStyle = A, a.fillColor = A, a.strokeColor = A;
              break;
            default:
              throw new y.FormatError(`Unsupported paint type: ${n}`);
          }
        }
        getPattern(e, n, f, h) {
          let a = f;
          h !== N.SHADING && (a = y.Util.transform(a, n.baseTransform), this.matrix && (a = y.Util.transform(a, this.matrix)));
          const u = this.createPatternCanvas(n);
          let A = new DOMMatrix(a);
          A = A.translate(u.offsetX, u.offsetY), A = A.scale(1 / u.scaleX, 1 / u.scaleY);
          const x = e.createPattern(u.canvas, "repeat");
          return x.setTransform(A), x;
        }
      }
      function g({
        src: c,
        srcPos: e = 0,
        dest: n,
        width: f,
        height: h,
        nonBlackColor: a = 4294967295,
        inverseDecode: u = !1
      }) {
        const A = y.FeatureTest.isLittleEndian ? 4278190080 : 255, [x, R] = u ? [a, A] : [A, a], k = f >> 3, D = f & 7, I = c.length;
        n = new Uint32Array(n.buffer);
        let F = 0;
        for (let T = 0; T < h; T++) {
          for (const Q = e + k; e < Q; e++) {
            const $ = e < I ? c[e] : 255;
            n[F++] = $ & 128 ? R : x, n[F++] = $ & 64 ? R : x, n[F++] = $ & 32 ? R : x, n[F++] = $ & 16 ? R : x, n[F++] = $ & 8 ? R : x, n[F++] = $ & 4 ? R : x, n[F++] = $ & 2 ? R : x, n[F++] = $ & 1 ? R : x;
          }
          if (D === 0)
            continue;
          const X = e < I ? c[e++] : 255;
          for (let Q = 0; Q < D; Q++)
            n[F++] = X & 1 << 7 - Q ? R : x;
        }
        return {
          srcPos: e,
          destPos: F
        };
      }
      const t = 16, i = 100, l = 4096, p = 15, w = 10, S = 1e3, L = 16;
      function M(c, e) {
        if (c._removeMirroring)
          throw new Error("Context is already forwarding operations.");
        c.__originalSave = c.save, c.__originalRestore = c.restore, c.__originalRotate = c.rotate, c.__originalScale = c.scale, c.__originalTranslate = c.translate, c.__originalTransform = c.transform, c.__originalSetTransform = c.setTransform, c.__originalResetTransform = c.resetTransform, c.__originalClip = c.clip, c.__originalMoveTo = c.moveTo, c.__originalLineTo = c.lineTo, c.__originalBezierCurveTo = c.bezierCurveTo, c.__originalRect = c.rect, c.__originalClosePath = c.closePath, c.__originalBeginPath = c.beginPath, c._removeMirroring = () => {
          c.save = c.__originalSave, c.restore = c.__originalRestore, c.rotate = c.__originalRotate, c.scale = c.__originalScale, c.translate = c.__originalTranslate, c.transform = c.__originalTransform, c.setTransform = c.__originalSetTransform, c.resetTransform = c.__originalResetTransform, c.clip = c.__originalClip, c.moveTo = c.__originalMoveTo, c.lineTo = c.__originalLineTo, c.bezierCurveTo = c.__originalBezierCurveTo, c.rect = c.__originalRect, c.closePath = c.__originalClosePath, c.beginPath = c.__originalBeginPath, delete c._removeMirroring;
        }, c.save = function() {
          e.save(), this.__originalSave();
        }, c.restore = function() {
          e.restore(), this.__originalRestore();
        }, c.translate = function(f, h) {
          e.translate(f, h), this.__originalTranslate(f, h);
        }, c.scale = function(f, h) {
          e.scale(f, h), this.__originalScale(f, h);
        }, c.transform = function(f, h, a, u, A, x) {
          e.transform(f, h, a, u, A, x), this.__originalTransform(f, h, a, u, A, x);
        }, c.setTransform = function(f, h, a, u, A, x) {
          e.setTransform(f, h, a, u, A, x), this.__originalSetTransform(f, h, a, u, A, x);
        }, c.resetTransform = function() {
          e.resetTransform(), this.__originalResetTransform();
        }, c.rotate = function(f) {
          e.rotate(f), this.__originalRotate(f);
        }, c.clip = function(f) {
          e.clip(f), this.__originalClip(f);
        }, c.moveTo = function(n, f) {
          e.moveTo(n, f), this.__originalMoveTo(n, f);
        }, c.lineTo = function(n, f) {
          e.lineTo(n, f), this.__originalLineTo(n, f);
        }, c.bezierCurveTo = function(n, f, h, a, u, A) {
          e.bezierCurveTo(n, f, h, a, u, A), this.__originalBezierCurveTo(n, f, h, a, u, A);
        }, c.rect = function(n, f, h, a) {
          e.rect(n, f, h, a), this.__originalRect(n, f, h, a);
        }, c.closePath = function() {
          e.closePath(), this.__originalClosePath();
        }, c.beginPath = function() {
          e.beginPath(), this.__originalBeginPath();
        };
      }
      class _ {
        constructor(e) {
          this.canvasFactory = e, this.cache = /* @__PURE__ */ Object.create(null);
        }
        getCanvas(e, n, f) {
          let h;
          return this.cache[e] !== void 0 ? (h = this.cache[e], this.canvasFactory.reset(h, n, f)) : (h = this.canvasFactory.create(n, f), this.cache[e] = h), h;
        }
        delete(e) {
          delete this.cache[e];
        }
        clear() {
          for (const e in this.cache) {
            const n = this.cache[e];
            this.canvasFactory.destroy(n), delete this.cache[e];
          }
        }
      }
      function O(c, e, n, f, h, a, u, A, x, R) {
        const [k, D, I, F, T, X] = (0, B.getCurrentTransform)(c);
        if (D === 0 && I === 0) {
          const q = u * k + T, rt = Math.round(q), Z = A * F + X, J = Math.round(Z), it = (u + x) * k + T, lt = Math.abs(Math.round(it) - rt) || 1, gt = (A + R) * F + X, bt = Math.abs(Math.round(gt) - J) || 1;
          return c.setTransform(Math.sign(k), 0, 0, Math.sign(F), rt, J), c.drawImage(e, n, f, h, a, 0, 0, lt, bt), c.setTransform(k, D, I, F, T, X), [lt, bt];
        }
        if (k === 0 && F === 0) {
          const q = A * I + T, rt = Math.round(q), Z = u * D + X, J = Math.round(Z), it = (A + R) * I + T, lt = Math.abs(Math.round(it) - rt) || 1, gt = (u + x) * D + X, bt = Math.abs(Math.round(gt) - J) || 1;
          return c.setTransform(0, Math.sign(D), Math.sign(I), 0, rt, J), c.drawImage(e, n, f, h, a, 0, 0, bt, lt), c.setTransform(k, D, I, F, T, X), [bt, lt];
        }
        c.drawImage(e, n, f, h, a, u, A, x, R);
        const Q = Math.hypot(k, D), $ = Math.hypot(I, F);
        return [Q * x, $ * R];
      }
      function z(c) {
        const {
          width: e,
          height: n
        } = c;
        if (e > S || n > S)
          return null;
        const f = 1e3, h = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), a = e + 1;
        let u = new Uint8Array(a * (n + 1)), A, x, R;
        const k = e + 7 & -8;
        let D = new Uint8Array(k * n), I = 0;
        for (const $ of c.data) {
          let q = 128;
          for (; q > 0; )
            D[I++] = $ & q ? 0 : 255, q >>= 1;
        }
        let F = 0;
        for (I = 0, D[I] !== 0 && (u[0] = 1, ++F), x = 1; x < e; x++)
          D[I] !== D[I + 1] && (u[x] = D[I] ? 2 : 1, ++F), I++;
        for (D[I] !== 0 && (u[x] = 2, ++F), A = 1; A < n; A++) {
          I = A * k, R = A * a, D[I - k] !== D[I] && (u[R] = D[I] ? 1 : 8, ++F);
          let $ = (D[I] ? 4 : 0) + (D[I - k] ? 8 : 0);
          for (x = 1; x < e; x++)
            $ = ($ >> 2) + (D[I + 1] ? 4 : 0) + (D[I - k + 1] ? 8 : 0), h[$] && (u[R + x] = h[$], ++F), I++;
          if (D[I - k] !== D[I] && (u[R + x] = D[I] ? 2 : 4, ++F), F > f)
            return null;
        }
        for (I = k * (n - 1), R = A * a, D[I] !== 0 && (u[R] = 8, ++F), x = 1; x < e; x++)
          D[I] !== D[I + 1] && (u[R + x] = D[I] ? 4 : 8, ++F), I++;
        if (D[I] !== 0 && (u[R + x] = 4, ++F), F > f)
          return null;
        const T = new Int32Array([0, a, -1, 0, -a, 0, 0, 0, 1]), X = new Path2D();
        for (A = 0; F && A <= n; A++) {
          let $ = A * a;
          const q = $ + e;
          for (; $ < q && !u[$]; )
            $++;
          if ($ === q)
            continue;
          X.moveTo($ % a, A);
          const rt = $;
          let Z = u[$];
          do {
            const J = T[Z];
            do
              $ += J;
            while (!u[$]);
            const it = u[$];
            it !== 5 && it !== 10 ? (Z = it, u[$] = 0) : (Z = it & 51 * Z >> 4, u[$] &= Z >> 2 | Z << 2), X.lineTo($ % a, $ / a | 0), u[$] || --F;
          } while (rt !== $);
          --A;
        }
        return D = null, u = null, function($) {
          $.save(), $.scale(1 / e, -1 / n), $.translate(0, -n), $.fill(X), $.beginPath(), $.restore();
        };
      }
      class K {
        constructor(e, n) {
          this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = y.IDENTITY_MATRIX, this.textMatrixScale = 1, this.fontMatrix = y.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 = y.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, e, n]);
        }
        clone() {
          const e = Object.create(this);
          return e.clipBox = this.clipBox.slice(), e;
        }
        setCurrentPoint(e, n) {
          this.x = e, this.y = n;
        }
        updatePathMinMax(e, n, f) {
          [n, f] = y.Util.applyTransform([n, f], e), this.minX = Math.min(this.minX, n), this.minY = Math.min(this.minY, f), this.maxX = Math.max(this.maxX, n), this.maxY = Math.max(this.maxY, f);
        }
        updateRectMinMax(e, n) {
          const f = y.Util.applyTransform(n, e), h = y.Util.applyTransform(n.slice(2), e), a = y.Util.applyTransform([n[0], n[3]], e), u = y.Util.applyTransform([n[2], n[1]], e);
          this.minX = Math.min(this.minX, f[0], h[0], a[0], u[0]), this.minY = Math.min(this.minY, f[1], h[1], a[1], u[1]), this.maxX = Math.max(this.maxX, f[0], h[0], a[0], u[0]), this.maxY = Math.max(this.maxY, f[1], h[1], a[1], u[1]);
        }
        updateScalingPathMinMax(e, n) {
          y.Util.scaleMinMax(e, n), this.minX = Math.min(this.minX, n[0]), this.minY = Math.min(this.minY, n[1]), this.maxX = Math.max(this.maxX, n[2]), this.maxY = Math.max(this.maxY, n[3]);
        }
        updateCurvePathMinMax(e, n, f, h, a, u, A, x, R, k) {
          const D = y.Util.bezierBoundingBox(n, f, h, a, u, A, x, R, k);
          k || this.updateRectMinMax(e, D);
        }
        getPathBoundingBox(e = N.FILL, n = null) {
          const f = [this.minX, this.minY, this.maxX, this.maxY];
          if (e === N.STROKE) {
            n || (0, y.unreachable)("Stroke bounding box must include transform.");
            const h = y.Util.singularValueDecompose2dScale(n), a = h[0] * this.lineWidth / 2, u = h[1] * this.lineWidth / 2;
            f[0] -= a, f[1] -= u, f[2] += a, f[3] += u;
          }
          return f;
        }
        updateClipFromPath() {
          const e = y.Util.intersect(this.clipBox, this.getPathBoundingBox());
          this.startNewPathAndClipBox(e || [0, 0, 0, 0]);
        }
        isEmptyClip() {
          return this.minX === 1 / 0;
        }
        startNewPathAndClipBox(e) {
          this.clipBox = e, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
        }
        getClippedPathBoundingBox(e = N.FILL, n = null) {
          return y.Util.intersect(this.clipBox, this.getPathBoundingBox(e, n));
        }
      }
      function nt(c, e) {
        if (typeof ImageData < "u" && e instanceof ImageData) {
          c.putImageData(e, 0, 0);
          return;
        }
        const n = e.height, f = e.width, h = n % L, a = (n - h) / L, u = h === 0 ? a : a + 1, A = c.createImageData(f, L);
        let x = 0, R;
        const k = e.data, D = A.data;
        let I, F, T, X;
        if (e.kind === y.ImageKind.GRAYSCALE_1BPP) {
          const Q = k.byteLength, $ = new Uint32Array(D.buffer, 0, D.byteLength >> 2), q = $.length, rt = f + 7 >> 3, Z = 4294967295, J = y.FeatureTest.isLittleEndian ? 4278190080 : 255;
          for (I = 0; I < u; I++) {
            for (T = I < a ? L : h, R = 0, F = 0; F < T; F++) {
              const it = Q - x;
              let lt = 0;
              const gt = it > rt ? f : it * 8 - 7, bt = gt & -8;
              let At = 0, mt = 0;
              for (; lt < bt; lt += 8)
                mt = k[x++], $[R++] = mt & 128 ? Z : J, $[R++] = mt & 64 ? Z : J, $[R++] = mt & 32 ? Z : J, $[R++] = mt & 16 ? Z : J, $[R++] = mt & 8 ? Z : J, $[R++] = mt & 4 ? Z : J, $[R++] = mt & 2 ? Z : J, $[R++] = mt & 1 ? Z : J;
              for (; lt < gt; lt++)
                At === 0 && (mt = k[x++], At = 128), $[R++] = mt & At ? Z : J, At >>= 1;
            }
            for (; R < q; )
              $[R++] = 0;
            c.putImageData(A, 0, I * L);
          }
        } else if (e.kind === y.ImageKind.RGBA_32BPP) {
          for (F = 0, X = f * L * 4, I = 0; I < a; I++)
            D.set(k.subarray(x, x + X)), x += X, c.putImageData(A, 0, F), F += L;
          I < u && (X = f * h * 4, D.set(k.subarray(x, x + X)), c.putImageData(A, 0, F));
        } else if (e.kind === y.ImageKind.RGB_24BPP)
          for (T = L, X = f * T, I = 0; I < u; I++) {
            for (I >= a && (T = h, X = f * T), R = 0, F = X; F--; )
              D[R++] = k[x++], D[R++] = k[x++], D[R++] = k[x++], D[R++] = 255;
            c.putImageData(A, 0, I * L);
          }
        else
          throw new Error(`bad image kind: ${e.kind}`);
      }
      function j(c, e) {
        if (e.bitmap) {
          c.drawImage(e.bitmap, 0, 0);
          return;
        }
        const n = e.height, f = e.width, h = n % L, a = (n - h) / L, u = h === 0 ? a : a + 1, A = c.createImageData(f, L);
        let x = 0;
        const R = e.data, k = A.data;
        for (let D = 0; D < u; D++) {
          const I = D < a ? L : h;
          ({
            srcPos: x
          } = g({
            src: R,
            srcPos: x,
            dest: k,
            width: f,
            height: I,
            nonBlackColor: 0
          })), c.putImageData(A, 0, D * L);
        }
      }
      function H(c, e) {
        const n = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
        for (const f of n)
          c[f] !== void 0 && (e[f] = c[f]);
        c.setLineDash !== void 0 && (e.setLineDash(c.getLineDash()), e.lineDashOffset = c.lineDashOffset);
      }
      function G(c) {
        if (c.strokeStyle = c.fillStyle = "#000000", c.fillRule = "nonzero", c.globalAlpha = 1, c.lineWidth = 1, c.lineCap = "butt", c.lineJoin = "miter", c.miterLimit = 10, c.globalCompositeOperation = "source-over", c.font = "10px sans-serif", c.setLineDash !== void 0 && (c.setLineDash([]), c.lineDashOffset = 0), !y.isNodeJS) {
          const {
            filter: e
          } = c;
          e !== "none" && e !== "" && (c.filter = "none");
        }
      }
      function Y(c, e, n, f) {
        const h = c.length;
        for (let a = 3; a < h; a += 4) {
          const u = c[a];
          if (u === 0)
            c[a - 3] = e, c[a - 2] = n, c[a - 1] = f;
          else if (u < 255) {
            const A = 255 - u;
            c[a - 3] = c[a - 3] * u + e * A >> 8, c[a - 2] = c[a - 2] * u + n * A >> 8, c[a - 1] = c[a - 1] * u + f * A >> 8;
          }
        }
      }
      function et(c, e, n) {
        const f = c.length, h = 1 / 255;
        for (let a = 3; a < f; a += 4) {
          const u = n ? n[c[a]] : c[a];
          e[a] = e[a] * u * h | 0;
        }
      }
      function tt(c, e, n) {
        const f = c.length;
        for (let h = 3; h < f; h += 4) {
          const a = c[h - 3] * 77 + c[h - 2] * 152 + c[h - 1] * 28;
          e[h] = n ? e[h] * n[a >> 8] >> 8 : e[h] * a >> 16;
        }
      }
      function ot(c, e, n, f, h, a, u, A, x, R, k) {
        const D = !!a, I = D ? a[0] : 0, F = D ? a[1] : 0, T = D ? a[2] : 0, X = h === "Luminosity" ? tt : et, $ = Math.min(f, Math.ceil(1048576 / n));
        for (let q = 0; q < f; q += $) {
          const rt = Math.min($, f - q), Z = c.getImageData(A - R, q + (x - k), n, rt), J = e.getImageData(A, q + x, n, rt);
          D && Y(Z.data, I, F, T), X(Z.data, J.data, u), e.putImageData(J, A, q + x);
        }
      }
      function ct(c, e, n, f) {
        const h = f[0], a = f[1], u = f[2] - h, A = f[3] - a;
        u === 0 || A === 0 || (ot(e.context, n, u, A, e.subtype, e.backdrop, e.transferMap, h, a, e.offsetX, e.offsetY), c.save(), c.globalAlpha = 1, c.globalCompositeOperation = "source-over", c.setTransform(1, 0, 0, 1, 0, 0), c.drawImage(n.canvas, 0, 0), c.restore());
      }
      function pt(c, e) {
        if (e)
          return !0;
        const n = y.Util.singularValueDecompose2dScale(c);
        n[0] = Math.fround(n[0]), n[1] = Math.fround(n[1]);
        const f = Math.fround((globalThis.devicePixelRatio || 1) * B.PixelsPerInch.PDF_TO_CSS_UNITS);
        return n[0] <= f && n[1] <= f;
      }
      const dt = ["butt", "round", "square"], ht = ["miter", "round", "bevel"], ut = {}, st = {};
      class m {
        constructor(e, n, f, h, a, {
          optionalContentConfig: u,
          markedContentStack: A = null
        }, x, R) {
          this.ctx = e, this.current = new K(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = n, this.objs = f, this.canvasFactory = h, this.filterFactory = a, 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 = A || [], this.optionalContentConfig = u, this.cachedCanvases = new _(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = x, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = R, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
        }
        getObject(e, n = null) {
          return typeof e == "string" ? e.startsWith("g_") ? this.commonObjs.get(e) : this.objs.get(e) : n;
        }
        beginDrawing({
          transform: e,
          viewport: n,
          transparency: f = !1,
          background: h = null
        }) {
          const a = this.ctx.canvas.width, u = this.ctx.canvas.height, A = this.ctx.fillStyle;
          if (this.ctx.fillStyle = h || "#ffffff", this.ctx.fillRect(0, 0, a, u), this.ctx.fillStyle = A, f) {
            const x = this.cachedCanvases.getCanvas("transparent", a, u);
            this.compositeCtx = this.ctx, this.transparentCanvas = x.canvas, this.ctx = x.context, this.ctx.save(), this.ctx.transform(...(0, B.getCurrentTransform)(this.compositeCtx));
          }
          this.ctx.save(), G(this.ctx), e && (this.ctx.transform(...e), this.outputScaleX = e[0], this.outputScaleY = e[0]), this.ctx.transform(...n.transform), this.viewportScale = n.scale, this.baseTransform = (0, B.getCurrentTransform)(this.ctx);
        }
        executeOperatorList(e, n, f, h) {
          const a = e.argsArray, u = e.fnArray;
          let A = n || 0;
          const x = a.length;
          if (x === A)
            return A;
          const R = x - A > w && typeof f == "function", k = R ? Date.now() + p : 0;
          let D = 0;
          const I = this.commonObjs, F = this.objs;
          let T;
          for (; ; ) {
            if (h !== void 0 && A === h.nextBreakPoint)
              return h.breakIt(A, f), A;
            if (T = u[A], T !== y.OPS.dependency)
              this[T].apply(this, a[A]);
            else
              for (const X of a[A]) {
                const Q = X.startsWith("g_") ? I : F;
                if (!Q.has(X))
                  return Q.get(X, f), A;
              }
            if (A++, A === x)
              return A;
            if (R && ++D > w) {
              if (Date.now() > k)
                return f(), A;
              D = 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 e of this._cachedBitmapsMap.values()) {
            for (const n of e.values())
              typeof HTMLCanvasElement < "u" && n instanceof HTMLCanvasElement && (n.width = n.height = 0);
            e.clear();
          }
          this._cachedBitmapsMap.clear(), this.#e();
        }
        #e() {
          if (this.pageColors) {
            const e = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
            if (e !== "none") {
              const n = this.ctx.filter;
              this.ctx.filter = e, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = n;
            }
          }
        }
        _scaleImage(e, n) {
          const f = e.width, h = e.height;
          let a = Math.max(Math.hypot(n[0], n[1]), 1), u = Math.max(Math.hypot(n[2], n[3]), 1), A = f, x = h, R = "prescale1", k, D;
          for (; a > 2 && A > 1 || u > 2 && x > 1; ) {
            let I = A, F = x;
            a > 2 && A > 1 && (I = A >= 16384 ? Math.floor(A / 2) - 1 || 1 : Math.ceil(A / 2), a /= A / I), u > 2 && x > 1 && (F = x >= 16384 ? Math.floor(x / 2) - 1 || 1 : Math.ceil(x) / 2, u /= x / F), k = this.cachedCanvases.getCanvas(R, I, F), D = k.context, D.clearRect(0, 0, I, F), D.drawImage(e, 0, 0, A, x, 0, 0, I, F), e = k.canvas, A = I, x = F, R = R === "prescale1" ? "prescale2" : "prescale1";
          }
          return {
            img: e,
            paintWidth: A,
            paintHeight: x
          };
        }
        _createMaskCanvas(e) {
          const n = this.ctx, {
            width: f,
            height: h
          } = e, a = this.current.fillColor, u = this.current.patternFill, A = (0, B.getCurrentTransform)(n);
          let x, R, k, D;
          if ((e.bitmap || e.data) && e.count > 1) {
            const gt = e.bitmap || e.data.buffer;
            R = JSON.stringify(u ? A : [A.slice(0, 4), a]), x = this._cachedBitmapsMap.get(gt), x || (x = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(gt, x));
            const bt = x.get(R);
            if (bt && !u) {
              const At = Math.round(Math.min(A[0], A[2]) + A[4]), mt = Math.round(Math.min(A[1], A[3]) + A[5]);
              return {
                canvas: bt,
                offsetX: At,
                offsetY: mt
              };
            }
            k = bt;
          }
          k || (D = this.cachedCanvases.getCanvas("maskCanvas", f, h), j(D.context, e));
          let I = y.Util.transform(A, [1 / f, 0, 0, -1 / h, 0, 0]);
          I = y.Util.transform(I, [1, 0, 0, 1, 0, -h]);
          const [F, T, X, Q] = y.Util.getAxialAlignedBoundingBox([0, 0, f, h], I), $ = Math.round(X - F) || 1, q = Math.round(Q - T) || 1, rt = this.cachedCanvases.getCanvas("fillCanvas", $, q), Z = rt.context, J = F, it = T;
          Z.translate(-J, -it), Z.transform(...I), k || (k = this._scaleImage(D.canvas, (0, B.getCurrentTransformInverse)(Z)), k = k.img, x && u && x.set(R, k)), Z.imageSmoothingEnabled = pt((0, B.getCurrentTransform)(Z), e.interpolate), O(Z, k, 0, 0, k.width, k.height, 0, 0, f, h), Z.globalCompositeOperation = "source-in";
          const lt = y.Util.transform((0, B.getCurrentTransformInverse)(Z), [1, 0, 0, 1, -J, -it]);
          return Z.fillStyle = u ? a.getPattern(n, this, lt, N.FILL) : a, Z.fillRect(0, 0, f, h), x && !u && (this.cachedCanvases.delete("fillCanvas"), x.set(R, rt.canvas)), {
            canvas: rt.canvas,
            offsetX: Math.round(J),
            offsetY: Math.round(it)
          };
        }
        setLineWidth(e) {
          e !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = e, this.ctx.lineWidth = e;
        }
        setLineCap(e) {
          this.ctx.lineCap = dt[e];
        }
        setLineJoin(e) {
          this.ctx.lineJoin = ht[e];
        }
        setMiterLimit(e) {
          this.ctx.miterLimit = e;
        }
        setDash(e, n) {
          const f = this.ctx;
          f.setLineDash !== void 0 && (f.setLineDash(e), f.lineDashOffset = n);
        }
        setRenderingIntent(e) {
        }
        setFlatness(e) {
        }
        setGState(e) {
          for (const [n, f] of e)
            switch (n) {
              case "LW":
                this.setLineWidth(f);
                break;
              case "LC":
                this.setLineCap(f);
                break;
              case "LJ":
                this.setLineJoin(f);
                break;
              case "ML":
                this.setMiterLimit(f);
                break;
              case "D":
                this.setDash(f[0], f[1]);
                break;
              case "RI":
                this.setRenderingIntent(f);
                break;
              case "FL":
                this.setFlatness(f);
                break;
              case "Font":
                this.setFont(f[0], f[1]);
                break;
              case "CA":
                this.current.strokeAlpha = f;
                break;
              case "ca":
                this.current.fillAlpha = f, this.ctx.globalAlpha = f;
                break;
              case "BM":
                this.ctx.globalCompositeOperation = f;
                break;
              case "SMask":
                this.current.activeSMask = f ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
                break;
              case "TR":
                this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(f);
                break;
            }
        }
        get inSMaskMode() {
          return !!this.suspendedCtx;
        }
        checkSMaskState() {
          const e = this.inSMaskMode;
          this.current.activeSMask && !e ? this.beginSMaskMode() : !this.current.activeSMask && e && this.endSMaskMode();
        }
        beginSMaskMode() {
          if (this.inSMaskMode)
            throw new Error("beginSMaskMode called while already in smask mode");
          const e = this.ctx.canvas.width, n = this.ctx.canvas.height, f = "smaskGroupAt" + this.groupLevel, h = this.cachedCanvases.getCanvas(f, e, n);
          this.suspendedCtx = this.ctx, this.ctx = h.context;
          const a = this.ctx;
          a.setTransform(...(0, B.getCurrentTransform)(this.suspendedCtx)), H(this.suspendedCtx, a), M(a, 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(), H(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
        }
        compose(e) {
          if (!this.current.activeSMask)
            return;
          e ? (e[0] = Math.floor(e[0]), e[1] = Math.floor(e[1]), e[2] = Math.ceil(e[2]), e[3] = Math.ceil(e[3])) : e = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
          const n = this.current.activeSMask, f = this.suspendedCtx;
          ct(f, n, this.ctx, e), 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 ? (H(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
          const e = this.current;
          this.stateStack.push(e), this.current = e.clone();
        }
        restore() {
          this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), H(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null);
        }
        transform(e, n, f, h, a, u) {
          this.ctx.transform(e, n, f, h, a, u), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
        }
        constructPath(e, n, f) {
          const h = this.ctx, a = this.current;
          let u = a.x, A = a.y, x, R;
          const k = (0, B.getCurrentTransform)(h), D = k[0] === 0 && k[3] === 0 || k[1] === 0 && k[2] === 0, I = D ? f.slice(0) : null;
          for (let F = 0, T = 0, X = e.length; F < X; F++)
            switch (e[F] | 0) {
              case y.OPS.rectangle:
                u = n[T++], A = n[T++];
                const Q = n[T++], $ = n[T++], q = u + Q, rt = A + $;
                h.moveTo(u, A), Q === 0 || $ === 0 ? h.lineTo(q, rt) : (h.lineTo(q, A), h.lineTo(q, rt), h.lineTo(u, rt)), D || a.updateRectMinMax(k, [u, A, q, rt]), h.closePath();
                break;
              case y.OPS.moveTo:
                u = n[T++], A = n[T++], h.moveTo(u, A), D || a.updatePathMinMax(k, u, A);
                break;
              case y.OPS.lineTo:
                u = n[T++], A = n[T++], h.lineTo(u, A), D || a.updatePathMinMax(k, u, A);
                break;
              case y.OPS.curveTo:
                x = u, R = A, u = n[T + 4], A = n[T + 5], h.bezierCurveTo(n[T], n[T + 1], n[T + 2], n[T + 3], u, A), a.updateCurvePathMinMax(k, x, R, n[T], n[T + 1], n[T + 2], n[T + 3], u, A, I), T += 6;
                break;
              case y.OPS.curveTo2:
                x = u, R = A, h.bezierCurveTo(u, A, n[T], n[T + 1], n[T + 2], n[T + 3]), a.updateCurvePathMinMax(k, x, R, u, A, n[T], n[T + 1], n[T + 2], n[T + 3], I), u = n[T + 2], A = n[T + 3], T += 4;
                break;
              case y.OPS.curveTo3:
                x = u, R = A, u = n[T + 2], A = n[T + 3], h.bezierCurveTo(n[T], n[T + 1], u, A, u, A), a.updateCurvePathMinMax(k, x, R, n[T], n[T + 1], u, A, u, A, I), T += 4;
                break;
              case y.OPS.closePath:
                h.closePath();
                break;
            }
          D && a.updateScalingPathMinMax(k, I), a.setCurrentPoint(u, A);
        }
        closePath() {
          this.ctx.closePath();
        }
        stroke(e = !0) {
          const n = this.ctx, f = this.current.strokeColor;
          n.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof f == "object" && f?.getPattern ? (n.save(), n.strokeStyle = f.getPattern(n, this, (0, B.getCurrentTransformInverse)(n), N.STROKE), this.rescaleAndStroke(!1), n.restore()) : this.rescaleAndStroke(!0)), e && this.consumePath(this.current.getClippedPathBoundingBox()), n.globalAlpha = this.current.fillAlpha;
        }
        closeStroke() {
          this.closePath(), this.stroke();
        }
        fill(e = !0) {
          const n = this.ctx, f = this.current.fillColor, h = this.current.patternFill;
          let a = !1;
          h && (n.save(), n.fillStyle = f.getPattern(n, this, (0, B.getCurrentTransformInverse)(n), N.FILL), a = !0);
          const u = this.current.getClippedPathBoundingBox();
          this.contentVisible && u !== null && (this.pendingEOFill ? (n.fill("evenodd"), this.pendingEOFill = !1) : n.fill()), a && n.restore(), e && this.consumePath(u);
        }
        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 = ut;
        }
        eoClip() {
          this.pendingClip = st;
        }
        beginText() {
          this.current.textMatrix = y.IDENTITY_MATRIX, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
        }
        endText() {
          const e = this.pendingTextPaths, n = this.ctx;
          if (e === void 0) {
            n.beginPath();
            return;
          }
          n.save(), n.beginPath();
          for (const f of e)
            n.setTransform(...f.transform), n.translate(f.x, f.y), f.addToPath(n, f.fontSize);
          n.restore(), n.clip(), n.beginPath(), delete this.pendingTextPaths;
        }
        setCharSpacing(e) {
          this.current.charSpacing = e;
        }
        setWordSpacing(e) {
          this.current.wordSpacing = e;
        }
        setHScale(e) {
          this.current.textHScale = e / 100;
        }
        setLeading(e) {
          this.current.leading = -e;
        }
        setFont(e, n) {
          const f = this.commonObjs.get(e), h = this.current;
          if (!f)
            throw new Error(`Can't find font for ${e}`);
          if (h.fontMatrix = f.fontMatrix || y.FONT_IDENTITY_MATRIX, (h.fontMatrix[0] === 0 || h.fontMatrix[3] === 0) && (0, y.warn)("Invalid font matrix for font " + e), n < 0 ? (n = -n, h.fontDirection = -1) : h.fontDirection = 1, this.current.font = f, this.current.fontSize = n, f.isType3Font)
            return;
          const a = f.loadedName || "sans-serif", u = f.systemFontInfo?.css || `"${a}", ${f.fallbackName}`;
          let A = "normal";
          f.black ? A = "900" : f.bold && (A = "bold");
          const x = f.italic ? "italic" : "normal";
          let R = n;
          n < t ? R = t : n > i && (R = i), this.current.fontSizeScale = n / R, this.ctx.font = `${x} ${A} ${R}px ${u}`;
        }
        setTextRenderingMode(e) {
          this.current.textRenderingMode = e;
        }
        setTextRise(e) {
          this.current.textRise = e;
        }
        moveText(e, n) {
          this.current.x = this.current.lineX += e, this.current.y = this.current.lineY += n;
        }
        setLeadingMoveText(e, n) {
          this.setLeading(-n), this.moveText(e, n);
        }
        setTextMatrix(e, n, f, h, a, u) {
          this.current.textMatrix = [e, n, f, h, a, u], this.current.textMatrixScale = Math.hypot(e, n), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
        }
        nextLine() {
          this.moveText(0, this.current.leading);
        }
        paintChar(e, n, f, h) {
          const a = this.ctx, u = this.current, A = u.font, x = u.textRenderingMode, R = u.fontSize / u.fontSizeScale, k = x & y.TextRenderingMode.FILL_STROKE_MASK, D = !!(x & y.TextRenderingMode.ADD_TO_PATH_FLAG), I = u.patternFill && !A.missingFile;
          let F;
          (A.disableFontFace || D || I) && (F = A.getPathGenerator(this.commonObjs, e)), A.disableFontFace || I ? (a.save(), a.translate(n, f), a.beginPath(), F(a, R), h && a.setTransform(...h), (k === y.TextRenderingMode.FILL || k === y.TextRenderingMode.FILL_STROKE) && a.fill(), (k === y.TextRenderingMode.STROKE || k === y.TextRenderingMode.FILL_STROKE) && a.stroke(), a.restore()) : ((k === y.TextRenderingMode.FILL || k === y.TextRenderingMode.FILL_STROKE) && a.fillText(e, n, f), (k === y.TextRenderingMode.STROKE || k === y.TextRenderingMode.FILL_STROKE) && a.strokeText(e, n, f)), D && (this.pendingTextPaths ||= []).push({
            transform: (0, B.getCurrentTransform)(a),
            x: n,
            y: f,
            fontSize: R,
            addToPath: F
          });
        }
        get isFontSubpixelAAEnabled() {
          const {
            context: e
          } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
          e.scale(1.5, 1), e.fillText("I", 0, 10);
          const n = e.getImageData(0, 0, 10, 10).data;
          let f = !1;
          for (let h = 3; h < n.length; h += 4)
            if (n[h] > 0 && n[h] < 255) {
              f = !0;
              break;
            }
          return (0, y.shadow)(this, "isFontSubpixelAAEnabled", f);
        }
        showText(e) {
          const n = this.current, f = n.font;
          if (f.isType3Font)
            return this.showType3Text(e);
          const h = n.fontSize;
          if (h === 0)
            return;
          const a = this.ctx, u = n.fontSizeScale, A = n.charSpacing, x = n.wordSpacing, R = n.fontDirection, k = n.textHScale * R, D = e.length, I = f.vertical, F = I ? 1 : -1, T = f.defaultVMetrics, X = h * n.fontMatrix[0], Q = n.textRenderingMode === y.TextRenderingMode.FILL && !f.disableFontFace && !n.patternFill;
          a.save(), a.transform(...n.textMatrix), a.translate(n.x, n.y + n.textRise), R > 0 ? a.scale(k, -1) : a.scale(k, 1);
          let $;
          if (n.patternFill) {
            a.save();
            const it = n.fillColor.getPattern(a, this, (0, B.getCurrentTransformInverse)(a), N.FILL);
            $ = (0, B.getCurrentTransform)(a), a.restore(), a.fillStyle = it;
          }
          let q = n.lineWidth;
          const rt = n.textMatrixScale;
          if (rt === 0 || q === 0) {
            const it = n.textRenderingMode & y.TextRenderingMode.FILL_STROKE_MASK;
            (it === y.TextRenderingMode.STROKE || it === y.TextRenderingMode.FILL_STROKE) && (q = this.getSinglePixelWidth());
          } else
            q /= rt;
          if (u !== 1 && (a.scale(u, u), q /= u), a.lineWidth = q, f.isInvalidPDFjsFont) {
            const it = [];
            let lt = 0;
            for (const gt of e)
              it.push(gt.unicode), lt += gt.width;
            a.fillText(it.join(""), 0, 0), n.x += lt * X * k, a.restore(), this.compose();
            return;
          }
          let Z = 0, J;
          for (J = 0; J < D; ++J) {
            const it = e[J];
            if (typeof it == "number") {
              Z += F * it * h / 1e3;
              continue;
            }
            let lt = !1;
            const gt = (it.isSpace ? x : 0) + A, bt = it.fontChar, At = it.accent;
            let mt, Ct, St = it.width;
            if (I) {
              const vt = it.vmetric || T, Et = -(it.vmetric ? vt[1] : St * 0.5) * X, Rt = vt[2] * X;
              St = vt ? -vt[0] : St, mt = Et / u, Ct = (Z + Rt) / u;
            } else
              mt = Z / u, Ct = 0;
            if (f.remeasure && St > 0) {
              const vt = a.measureText(bt).width * 1e3 / h * u;
              if (St < vt && this.isFontSubpixelAAEnabled) {
                const Et = St / vt;
                lt = !0, a.save(), a.scale(Et, 1), mt /= Et;
              } else
                St !== vt && (mt += (St - vt) / 2e3 * h / u);
            }
            if (this.contentVisible && (it.isInFont || f.missingFile)) {
              if (Q && !At)
                a.fillText(bt, mt, Ct);
              else if (this.paintChar(bt, mt, Ct, $), At) {
                const vt = mt + h * At.offset.x / u, Et = Ct - h * At.offset.y / u;
                this.paintChar(At.fontChar, vt, Et, $);
              }
            }
            const Tt = I ? St * X - gt * R : St * X + gt * R;
            Z += Tt, lt && a.restore();
          }
          I ? n.y -= Z : n.x += Z * k, a.restore(), this.compose();
        }
        showType3Text(e) {
          const n = this.ctx, f = this.current, h = f.font, a = f.fontSize, u = f.fontDirection, A = h.vertical ? 1 : -1, x = f.charSpacing, R = f.wordSpacing, k = f.textHScale * u, D = f.fontMatrix || y.FONT_IDENTITY_MATRIX, I = e.length, F = f.textRenderingMode === y.TextRenderingMode.INVISIBLE;
          let T, X, Q, $;
          if (!(F || a === 0)) {
            for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, n.save(), n.transform(...f.textMatrix), n.translate(f.x, f.y), n.scale(k, u), T = 0; T < I; ++T) {
              if (X = e[T], typeof X == "number") {
                $ = A * X * a / 1e3, this.ctx.translate($, 0), f.x += $ * k;
                continue;
              }
              const q = (X.isSpace ? R : 0) + x, rt = h.charProcOperatorList[X.operatorListId];
              if (!rt) {
                (0, y.warn)(`Type3 character "${X.operatorListId}" is not available.`);
                continue;
              }
              this.contentVisible && (this.processingType3 = X, this.save(), n.scale(a, a), n.transform(...D), this.executeOperatorList(rt), this.restore()), Q = y.Util.applyTransform([X.width, 0], D)[0] * a + q, n.translate(Q, 0), f.x += Q * k;
            }
            n.restore(), this.processingType3 = null;
          }
        }
        setCharWidth(e, n) {
        }
        setCharWidthAndBounds(e, n, f, h, a, u) {
          this.ctx.rect(f, h, a - f, u - h), this.ctx.clip(), this.endPath();
        }
        getColorN_Pattern(e) {
          let n;
          if (e[0] === "TilingPattern") {
            const f = e[1], h = this.baseTransform || (0, B.getCurrentTransform)(this.ctx), a = {
              createCanvasGraphics: (u) => new m(u, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: this.optionalContentConfig,
                markedContentStack: this.markedContentStack
              })
            };
            n = new s(e, f, this.ctx, a, h);
          } else
            n = this._getPattern(e[1], e[2]);
          return n;
        }
        setStrokeColorN() {
          this.current.strokeColor = this.getColorN_Pattern(arguments);
        }
        setFillColorN() {
          this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
        }
        setStrokeRGBColor(e, n, f) {
          const h = y.Util.makeHexColor(e, n, f);
          this.ctx.strokeStyle = h, this.current.strokeColor = h;
        }
        setFillRGBColor(e, n, f) {
          const h = y.Util.makeHexColor(e, n, f);
          this.ctx.fillStyle = h, this.current.fillColor = h, this.current.patternFill = !1;
        }
        _getPattern(e, n = null) {
          let f;
          return this.cachedPatterns.has(e) ? f = this.cachedPatterns.get(e) : (f = o(this.getObject(e)), this.cachedPatterns.set(e, f)), n && (f.matrix = n), f;
        }
        shadingFill(e) {
          if (!this.contentVisible)
            return;
          const n = this.ctx;
          this.save();
          const f = this._getPattern(e);
          n.fillStyle = f.getPattern(n, this, (0, B.getCurrentTransformInverse)(n), N.SHADING);
          const h = (0, B.getCurrentTransformInverse)(n);
          if (h) {
            const {
              width: a,
              height: u
            } = n.canvas, [A, x, R, k] = y.Util.getAxialAlignedBoundingBox([0, 0, a, u], h);
            this.ctx.fillRect(A, x, R - A, k - x);
          } else
            this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
          this.compose(this.current.getClippedPathBoundingBox()), this.restore();
        }
        beginInlineImage() {
          (0, y.unreachable)("Should not call beginInlineImage");
        }
        beginImageData() {
          (0, y.unreachable)("Should not call beginImageData");
        }
        paintFormXObjectBegin(e, n) {
          if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(e) && e.length === 6 && this.transform(...e), this.baseTransform = (0, B.getCurrentTransform)(this.ctx), n)) {
            const f = n[2] - n[0], h = n[3] - n[1];
            this.ctx.rect(n[0], n[1], f, h), this.current.updateRectMinMax((0, B.getCurrentTransform)(this.ctx), n), this.clip(), this.endPath();
          }
        }
        paintFormXObjectEnd() {
          this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
        }
        beginGroup(e) {
          if (!this.contentVisible)
            return;
          this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
          const n = this.ctx;
          e.isolated || (0, y.info)("TODO: Support non-isolated groups."), e.knockout && (0, y.warn)("Knockout groups not supported.");
          const f = (0, B.getCurrentTransform)(n);
          if (e.matrix && n.transform(...e.matrix), !e.bbox)
            throw new Error("Bounding box is required.");
          let h = y.Util.getAxialAlignedBoundingBox(e.bbox, (0, B.getCurrentTransform)(n));
          const a = [0, 0, n.canvas.width, n.canvas.height];
          h = y.Util.intersect(h, a) || [0, 0, 0, 0];
          const u = Math.floor(h[0]), A = Math.floor(h[1]);
          let x = Math.max(Math.ceil(h[2]) - u, 1), R = Math.max(Math.ceil(h[3]) - A, 1), k = 1, D = 1;
          x > l && (k = x / l, x = l), R > l && (D = R / l, R = l), this.current.startNewPathAndClipBox([0, 0, x, R]);
          let I = "groupAt" + this.groupLevel;
          e.smask && (I += "_smask_" + this.smaskCounter++ % 2);
          const F = this.cachedCanvases.getCanvas(I, x, R), T = F.context;
          T.scale(1 / k, 1 / D), T.translate(-u, -A), T.transform(...f), e.smask ? this.smaskStack.push({
            canvas: F.canvas,
            context: T,
            offsetX: u,
            offsetY: A,
            scaleX: k,
            scaleY: D,
            subtype: e.smask.subtype,
            backdrop: e.smask.backdrop,
            transferMap: e.smask.transferMap || null,
            startTransformInverse: null
          }) : (n.setTransform(1, 0, 0, 1, 0, 0), n.translate(u, A), n.scale(k, D), n.save()), H(n, T), this.ctx = T, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(n), this.groupLevel++;
        }
        endGroup(e) {
          if (!this.contentVisible)
            return;
          this.groupLevel--;
          const n = this.ctx, f = this.groupStack.pop();
          if (this.ctx = f, this.ctx.imageSmoothingEnabled = !1, e.smask)
            this.tempSMask = this.smaskStack.pop(), this.restore();
          else {
            this.ctx.restore();
            const h = (0, B.getCurrentTransform)(this.ctx);
            this.restore(), this.ctx.save(), this.ctx.setTransform(...h);
            const a = y.Util.getAxialAlignedBoundingBox([0, 0, n.canvas.width, n.canvas.height], h);
            this.ctx.drawImage(n.canvas, 0, 0), this.ctx.restore(), this.compose(a);
          }
        }
        beginAnnotation(e, n, f, h, a) {
          if (this.#t(), G(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(n) && n.length === 4) {
            const u = n[2] - n[0], A = n[3] - n[1];
            if (a && this.annotationCanvasMap) {
              f = f.slice(), f[4] -= n[0], f[5] -= n[1], n = n.slice(), n[0] = n[1] = 0, n[2] = u, n[3] = A;
              const [x, R] = y.Util.singularValueDecompose2dScale((0, B.getCurrentTransform)(this.ctx)), {
                viewportScale: k
              } = this, D = Math.ceil(u * this.outputScaleX * k), I = Math.ceil(A * this.outputScaleY * k);
              this.annotationCanvas = this.canvasFactory.create(D, I);
              const {
                canvas: F,
                context: T
              } = this.annotationCanvas;
              this.annotationCanvasMap.set(e, F), this.annotationCanvas.savedCtx = this.ctx, this.ctx = T, this.ctx.save(), this.ctx.setTransform(x, 0, 0, -R, 0, A * R), G(this.ctx);
            } else
              G(this.ctx), this.ctx.rect(n[0], n[1], u, A), this.ctx.clip(), this.endPath();
          }
          this.current = new K(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...f), this.transform(...h);
        }
        endAnnotation() {
          this.annotationCanvas && (this.ctx.restore(), this.#e(), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
        }
        paintImageMaskXObject(e) {
          if (!this.contentVisible)
            return;
          const n = e.count;
          e = this.getObject(e.data, e), e.count = n;
          const f = this.ctx, h = this.processingType3;
          if (h && (h.compiled === void 0 && (h.compiled = z(e)), h.compiled)) {
            h.compiled(f);
            return;
          }
          const a = this._createMaskCanvas(e), u = a.canvas;
          f.save(), f.setTransform(1, 0, 0, 1, 0, 0), f.drawImage(u, a.offsetX, a.offsetY), f.restore(), this.compose();
        }
        paintImageMaskXObjectRepeat(e, n, f = 0, h = 0, a, u) {
          if (!this.contentVisible)
            return;
          e = this.getObject(e.data, e);
          const A = this.ctx;
          A.save();
          const x = (0, B.getCurrentTransform)(A);
          A.transform(n, f, h, a, 0, 0);
          const R = this._createMaskCanvas(e);
          A.setTransform(1, 0, 0, 1, R.offsetX - x[4], R.offsetY - x[5]);
          for (let k = 0, D = u.length; k < D; k += 2) {
            const I = y.Util.transform(x, [n, f, h, a, u[k], u[k + 1]]), [F, T] = y.Util.applyTransform([0, 0], I);
            A.drawImage(R.canvas, F, T);
          }
          A.restore(), this.compose();
        }
        paintImageMaskXObjectGroup(e) {
          if (!this.contentVisible)
            return;
          const n = this.ctx, f = this.current.fillColor, h = this.current.patternFill;
          for (const a of e) {
            const {
              data: u,
              width: A,
              height: x,
              transform: R
            } = a, k = this.cachedCanvases.getCanvas("maskCanvas", A, x), D = k.context;
            D.save();
            const I = this.getObject(u, a);
            j(D, I), D.globalCompositeOperation = "source-in", D.fillStyle = h ? f.getPattern(D, this, (0, B.getCurrentTransformInverse)(n), N.FILL) : f, D.fillRect(0, 0, A, x), D.restore(), n.save(), n.transform(...R), n.scale(1, -1), O(n, k.canvas, 0, 0, A, x, 0, -1, 1, 1), n.restore();
          }
          this.compose();
        }
        paintImageXObject(e) {
          if (!this.contentVisible)
            return;
          const n = this.getObject(e);
          if (!n) {
            (0, y.warn)("Dependent image isn't ready yet");
            return;
          }
          this.paintInlineImageXObject(n);
        }
        paintImageXObjectRepeat(e, n, f, h) {
          if (!this.contentVisible)
            return;
          const a = this.getObject(e);
          if (!a) {
            (0, y.warn)("Dependent image isn't ready yet");
            return;
          }
          const u = a.width, A = a.height, x = [];
          for (let R = 0, k = h.length; R < k; R += 2)
            x.push({
              transform: [n, 0, 0, f, h[R], h[R + 1]],
              x: 0,
              y: 0,
              w: u,
              h: A
            });
          this.paintInlineImageXObjectGroup(a, x);
        }
        applyTransferMapsToCanvas(e) {
          return this.current.transferMaps !== "none" && (e.filter = this.current.transferMaps, e.drawImage(e.canvas, 0, 0), e.filter = "none"), e.canvas;
        }
        applyTransferMapsToBitmap(e) {
          if (this.current.transferMaps === "none")
            return e.bitmap;
          const {
            bitmap: n,
            width: f,
            height: h
          } = e, a = this.cachedCanvases.getCanvas("inlineImage", f, h), u = a.context;
          return u.filter = this.current.transferMaps, u.drawImage(n, 0, 0), u.filter = "none", a.canvas;
        }
        paintInlineImageXObject(e) {
          if (!this.contentVisible)
            return;
          const n = e.width, f = e.height, h = this.ctx;
          if (this.save(), !y.isNodeJS) {
            const {
              filter: A
            } = h;
            A !== "none" && A !== "" && (h.filter = "none");
          }
          h.scale(1 / n, -1 / f);
          let a;
          if (e.bitmap)
            a = this.applyTransferMapsToBitmap(e);
          else if (typeof HTMLElement == "function" && e instanceof HTMLElement || !e.data)
            a = e;
          else {
            const x = this.cachedCanvases.getCanvas("inlineImage", n, f).context;
            nt(x, e), a = this.applyTransferMapsToCanvas(x);
          }
          const u = this._scaleImage(a, (0, B.getCurrentTransformInverse)(h));
          h.imageSmoothingEnabled = pt((0, B.getCurrentTransform)(h), e.interpolate), O(h, u.img, 0, 0, u.paintWidth, u.paintHeight, 0, -f, n, f), this.compose(), this.restore();
        }
        paintInlineImageXObjectGroup(e, n) {
          if (!this.contentVisible)
            return;
          const f = this.ctx;
          let h;
          if (e.bitmap)
            h = e.bitmap;
          else {
            const a = e.width, u = e.height, x = this.cachedCanvases.getCanvas("inlineImage", a, u).context;
            nt(x, e), h = this.applyTransferMapsToCanvas(x);
          }
          for (const a of n)
            f.save(), f.transform(...a.transform), f.scale(1, -1), O(f, h, a.x, a.y, a.w, a.h, 0, -1, 1, 1), f.restore();
          this.compose();
        }
        paintSolidColorImageMask() {
          this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
        }
        markPoint(e) {
        }
        markPointProps(e, n) {
        }
        beginMarkedContent(e) {
          this.markedContentStack.push({
            visible: !0
          });
        }
        beginMarkedContentProps(e, n) {
          e === "OC" ? this.markedContentStack.push({
            visible: this.optionalContentConfig.isVisible(n)
          }) : this.markedContentStack.push({
            visible: !0
          }), this.contentVisible = this.isContentVisible();
        }
        endMarkedContent() {
          this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
        }
        beginCompat() {
        }
        endCompat() {
        }
        consumePath(e) {
          const n = this.current.isEmptyClip();
          this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(e);
          const f = this.ctx;
          this.pendingClip && (n || (this.pendingClip === st ? f.clip("evenodd") : f.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), f.beginPath();
        }
        getSinglePixelWidth() {
          if (!this._cachedGetSinglePixelWidth) {
            const e = (0, B.getCurrentTransform)(this.ctx);
            if (e[1] === 0 && e[2] === 0)
              this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(e[0]), Math.abs(e[3]));
            else {
              const n = Math.abs(e[0] * e[3] - e[2] * e[1]), f = Math.hypot(e[0], e[2]), h = Math.hypot(e[1], e[3]);
              this._cachedGetSinglePixelWidth = Math.max(f, h) / n;
            }
          }
          return this._cachedGetSinglePixelWidth;
        }
        getScaleForStroking() {
          if (this._cachedScaleForStroking[0] === -1) {
            const {
              lineWidth: e
            } = this.current, {
              a: n,
              b: f,
              c: h,
              d: a
            } = this.ctx.getTransform();
            let u, A;
            if (f === 0 && h === 0) {
              const x = Math.abs(n), R = Math.abs(a);
              if (x === R)
                if (e === 0)
                  u = A = 1 / x;
                else {
                  const k = x * e;
                  u = A = k < 1 ? 1 / k : 1;
                }
              else if (e === 0)
                u = 1 / x, A = 1 / R;
              else {
                const k = x * e, D = R * e;
                u = k < 1 ? 1 / k : 1, A = D < 1 ? 1 / D : 1;
              }
            } else {
              const x = Math.abs(n * a - f * h), R = Math.hypot(n, f), k = Math.hypot(h, a);
              if (e === 0)
                u = k / x, A = R / x;
              else {
                const D = e * x;
                u = k > D ? k / D : 1, A = R > D ? R / D : 1;
              }
            }
            this._cachedScaleForStroking[0] = u, this._cachedScaleForStroking[1] = A;
          }
          return this._cachedScaleForStroking;
        }
        rescaleAndStroke(e) {
          const {
            ctx: n
          } = this, {
            lineWidth: f
          } = this.current, [h, a] = this.getScaleForStroking();
          if (n.lineWidth = f || 1, h === 1 && a === 1) {
            n.stroke();
            return;
          }
          const u = n.getLineDash();
          if (e && n.save(), n.scale(h, a), u.length > 0) {
            const A = Math.max(h, a);
            n.setLineDash(u.map((x) => x / A)), n.lineDashOffset /= A;
          }
          n.stroke(), e && n.restore();
        }
        isContentVisible() {
          for (let e = this.markedContentStack.length - 1; e >= 0; e--)
            if (!this.markedContentStack[e].visible)
              return !1;
          return !0;
        }
      }
      for (const c in y.OPS)
        m.prototype[c] !== void 0 && (m.prototype[y.OPS[c]] = m.prototype[c]);
    }
  ),
  /***/
  419: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        DOMCMapReaderFactory: () => (
          /* binding */
          v
        ),
        /* harmony export */
        DOMCanvasFactory: () => (
          /* binding */
          C
        ),
        /* harmony export */
        DOMFilterFactory: () => (
          /* binding */
          P
        ),
        /* harmony export */
        DOMSVGFactory: () => (
          /* binding */
          d
        ),
        /* harmony export */
        DOMStandardFontDataFactory: () => (
          /* binding */
          r
        ),
        /* harmony export */
        PDFDateString: () => (
          /* binding */
          L
        ),
        /* harmony export */
        PageViewport: () => (
          /* binding */
          o
        ),
        /* harmony export */
        PixelsPerInch: () => (
          /* binding */
          U
        ),
        /* harmony export */
        RenderingCancelledException: () => (
          /* binding */
          b
        ),
        /* harmony export */
        StatTimer: () => (
          /* binding */
          l
        ),
        /* harmony export */
        fetchData: () => (
          /* binding */
          E
        ),
        /* harmony export */
        getColorValues: () => (
          /* binding */
          O
        ),
        /* harmony export */
        getCurrentTransform: () => (
          /* binding */
          z
        ),
        /* harmony export */
        getCurrentTransformInverse: () => (
          /* binding */
          K
        ),
        /* harmony export */
        getFilenameFromUrl: () => (
          /* binding */
          t
        ),
        /* harmony export */
        getPdfFilenameFromUrl: () => (
          /* binding */
          i
        ),
        /* harmony export */
        getRGB: () => (
          /* binding */
          _
        ),
        /* harmony export */
        getXfaPageViewport: () => (
          /* binding */
          M
        ),
        /* harmony export */
        isDataScheme: () => (
          /* binding */
          s
        ),
        /* harmony export */
        isPdfFile: () => (
          /* binding */
          g
        ),
        /* harmony export */
        isValidFetchUrl: () => (
          /* binding */
          p
        ),
        /* harmony export */
        noContextMenu: () => (
          /* binding */
          w
        ),
        /* harmony export */
        setLayerDimensions: () => (
          /* binding */
          nt
        )
        /* harmony export */
      });
      var y = V(583), B = V(292);
      const N = "http://www.w3.org/2000/svg";
      class U {
        static CSS = 96;
        static PDF = 72;
        static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
      }
      class P extends y.BaseFilterFactory {
        #t;
        #e;
        #s;
        #n;
        #r;
        #i = 0;
        constructor({
          docId: H,
          ownerDocument: G = globalThis.document
        } = {}) {
          super(), this.#s = H, this.#n = G;
        }
        get #a() {
          return this.#t ||= /* @__PURE__ */ new Map();
        }
        get #l() {
          return this.#r ||= /* @__PURE__ */ new Map();
        }
        get #h() {
          if (!this.#e) {
            const H = this.#n.createElement("div"), {
              style: G
            } = H;
            G.visibility = "hidden", G.contain = "strict", G.width = G.height = 0, G.position = "absolute", G.top = G.left = 0, G.zIndex = -1;
            const Y = this.#n.createElementNS(N, "svg");
            Y.setAttribute("width", 0), Y.setAttribute("height", 0), this.#e = this.#n.createElementNS(N, "defs"), H.append(Y), Y.append(this.#e), this.#n.body.append(H);
          }
          return this.#e;
        }
        addFilter(H) {
          if (!H)
            return "none";
          let G = this.#a.get(H);
          if (G)
            return G;
          let Y, et, tt, ot;
          if (H.length === 1) {
            const ht = H[0], ut = new Array(256);
            for (let st = 0; st < 256; st++)
              ut[st] = ht[st] / 255;
            ot = Y = et = tt = ut.join(",");
          } else {
            const [ht, ut, st] = H, m = new Array(256), c = new Array(256), e = new Array(256);
            for (let n = 0; n < 256; n++)
              m[n] = ht[n] / 255, c[n] = ut[n] / 255, e[n] = st[n] / 255;
            Y = m.join(","), et = c.join(","), tt = e.join(","), ot = `${Y}${et}${tt}`;
          }
          if (G = this.#a.get(ot), G)
            return this.#a.set(H, G), G;
          const ct = `g_${this.#s}_transfer_map_${this.#i++}`, pt = `url(#${ct})`;
          this.#a.set(H, pt), this.#a.set(ot, pt);
          const dt = this.#u(ct);
          return this.#o(Y, et, tt, dt), pt;
        }
        addHCMFilter(H, G) {
          const Y = `${H}-${G}`, et = "base";
          let tt = this.#l.get(et);
          if (tt?.key === Y || (tt ? (tt.filter?.remove(), tt.key = Y, tt.url = "none", tt.filter = null) : (tt = {
            key: Y,
            url: "none",
            filter: null
          }, this.#l.set(et, tt)), !H || !G))
            return tt.url;
          const ot = this.#p(H);
          H = B.Util.makeHexColor(...ot);
          const ct = this.#p(G);
          if (G = B.Util.makeHexColor(...ct), this.#h.style.color = "", H === "#000000" && G === "#ffffff" || H === G)
            return tt.url;
          const pt = new Array(256);
          for (let m = 0; m <= 255; m++) {
            const c = m / 255;
            pt[m] = c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
          }
          const dt = pt.join(","), ht = `g_${this.#s}_hcm_filter`, ut = tt.filter = this.#u(ht);
          this.#o(dt, dt, dt, ut), this.#d(ut);
          const st = (m, c) => {
            const e = ot[m] / 255, n = ct[m] / 255, f = new Array(c + 1);
            for (let h = 0; h <= c; h++)
              f[h] = e + h / c * (n - e);
            return f.join(",");
          };
          return this.#o(st(0, 5), st(1, 5), st(2, 5), ut), tt.url = `url(#${ht})`, tt.url;
        }
        addHighlightHCMFilter(H, G, Y, et, tt) {
          const ot = `${G}-${Y}-${et}-${tt}`;
          let ct = this.#l.get(H);
          if (ct?.key === ot || (ct ? (ct.filter?.remove(), ct.key = ot, ct.url = "none", ct.filter = null) : (ct = {
            key: ot,
            url: "none",
            filter: null
          }, this.#l.set(H, ct)), !G || !Y))
            return ct.url;
          const [pt, dt] = [G, Y].map(this.#p.bind(this));
          let ht = Math.round(0.2126 * pt[0] + 0.7152 * pt[1] + 0.0722 * pt[2]), ut = Math.round(0.2126 * dt[0] + 0.7152 * dt[1] + 0.0722 * dt[2]), [st, m] = [et, tt].map(this.#p.bind(this));
          ut < ht && ([ht, ut, st, m] = [ut, ht, m, st]), this.#h.style.color = "";
          const c = (f, h, a) => {
            const u = new Array(256), A = (ut - ht) / a, x = f / 255, R = (h - f) / (255 * a);
            let k = 0;
            for (let D = 0; D <= a; D++) {
              const I = Math.round(ht + D * A), F = x + D * R;
              for (let T = k; T <= I; T++)
                u[T] = F;
              k = I + 1;
            }
            for (let D = k; D < 256; D++)
              u[D] = u[k - 1];
            return u.join(",");
          }, e = `g_${this.#s}_hcm_${H}_filter`, n = ct.filter = this.#u(e);
          return this.#d(n), this.#o(c(st[0], m[0], 5), c(st[1], m[1], 5), c(st[2], m[2], 5), n), ct.url = `url(#${e})`, ct.url;
        }
        destroy(H = !1) {
          H && this.#l.size !== 0 || (this.#e && (this.#e.parentNode.parentNode.remove(), this.#e = null), this.#t && (this.#t.clear(), this.#t = null), this.#i = 0);
        }
        #d(H) {
          const G = this.#n.createElementNS(N, "feColorMatrix");
          G.setAttribute("type", "matrix"), G.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"), H.append(G);
        }
        #u(H) {
          const G = this.#n.createElementNS(N, "filter");
          return G.setAttribute("color-interpolation-filters", "sRGB"), G.setAttribute("id", H), this.#h.append(G), G;
        }
        #c(H, G, Y) {
          const et = this.#n.createElementNS(N, G);
          et.setAttribute("type", "discrete"), et.setAttribute("tableValues", Y), H.append(et);
        }
        #o(H, G, Y, et) {
          const tt = this.#n.createElementNS(N, "feComponentTransfer");
          et.append(tt), this.#c(tt, "feFuncR", H), this.#c(tt, "feFuncG", G), this.#c(tt, "feFuncB", Y);
        }
        #p(H) {
          return this.#h.style.color = H, _(getComputedStyle(this.#h).getPropertyValue("color"));
        }
      }
      class C extends y.BaseCanvasFactory {
        constructor({
          ownerDocument: H = globalThis.document
        } = {}) {
          super(), this._document = H;
        }
        _createCanvas(H, G) {
          const Y = this._document.createElement("canvas");
          return Y.width = H, Y.height = G, Y;
        }
      }
      async function E(j, H = "text") {
        if (p(j, document.baseURI)) {
          const G = await fetch(j);
          if (!G.ok)
            throw new Error(G.statusText);
          switch (H) {
            case "arraybuffer":
              return G.arrayBuffer();
            case "blob":
              return G.blob();
            case "json":
              return G.json();
          }
          return G.text();
        }
        return new Promise((G, Y) => {
          const et = new XMLHttpRequest();
          et.open("GET", j, !0), et.responseType = H, et.onreadystatechange = () => {
            if (et.readyState === XMLHttpRequest.DONE) {
              if (et.status === 200 || et.status === 0) {
                switch (H) {
                  case "arraybuffer":
                  case "blob":
                  case "json":
                    G(et.response);
                    return;
                }
                G(et.responseText);
                return;
              }
              Y(new Error(et.statusText));
            }
          }, et.send(null);
        });
      }
      class v extends y.BaseCMapReaderFactory {
        _fetchData(H, G) {
          return E(H, this.isCompressed ? "arraybuffer" : "text").then((Y) => ({
            cMapData: Y instanceof ArrayBuffer ? new Uint8Array(Y) : (0, B.stringToBytes)(Y),
            compressionType: G
          }));
        }
      }
      class r extends y.BaseStandardFontDataFactory {
        _fetchData(H) {
          return E(H, "arraybuffer").then((G) => new Uint8Array(G));
        }
      }
      class d extends y.BaseSVGFactory {
        _createSVG(H) {
          return document.createElementNS(N, H);
        }
      }
      class o {
        constructor({
          viewBox: H,
          scale: G,
          rotation: Y,
          offsetX: et = 0,
          offsetY: tt = 0,
          dontFlip: ot = !1
        }) {
          this.viewBox = H, this.scale = G, this.rotation = Y, this.offsetX = et, this.offsetY = tt;
          const ct = (H[2] + H[0]) / 2, pt = (H[3] + H[1]) / 2;
          let dt, ht, ut, st;
          switch (Y %= 360, Y < 0 && (Y += 360), Y) {
            case 180:
              dt = -1, ht = 0, ut = 0, st = 1;
              break;
            case 90:
              dt = 0, ht = 1, ut = 1, st = 0;
              break;
            case 270:
              dt = 0, ht = -1, ut = -1, st = 0;
              break;
            case 0:
              dt = 1, ht = 0, ut = 0, st = -1;
              break;
            default:
              throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
          }
          ot && (ut = -ut, st = -st);
          let m, c, e, n;
          dt === 0 ? (m = Math.abs(pt - H[1]) * G + et, c = Math.abs(ct - H[0]) * G + tt, e = (H[3] - H[1]) * G, n = (H[2] - H[0]) * G) : (m = Math.abs(ct - H[0]) * G + et, c = Math.abs(pt - H[1]) * G + tt, e = (H[2] - H[0]) * G, n = (H[3] - H[1]) * G), this.transform = [dt * G, ht * G, ut * G, st * G, m - dt * G * ct - ut * G * pt, c - ht * G * ct - st * G * pt], this.width = e, this.height = n;
        }
        get rawDims() {
          const {
            viewBox: H
          } = this;
          return (0, B.shadow)(this, "rawDims", {
            pageWidth: H[2] - H[0],
            pageHeight: H[3] - H[1],
            pageX: H[0],
            pageY: H[1]
          });
        }
        clone({
          scale: H = this.scale,
          rotation: G = this.rotation,
          offsetX: Y = this.offsetX,
          offsetY: et = this.offsetY,
          dontFlip: tt = !1
        } = {}) {
          return new o({
            viewBox: this.viewBox.slice(),
            scale: H,
            rotation: G,
            offsetX: Y,
            offsetY: et,
            dontFlip: tt
          });
        }
        convertToViewportPoint(H, G) {
          return B.Util.applyTransform([H, G], this.transform);
        }
        convertToViewportRectangle(H) {
          const G = B.Util.applyTransform([H[0], H[1]], this.transform), Y = B.Util.applyTransform([H[2], H[3]], this.transform);
          return [G[0], G[1], Y[0], Y[1]];
        }
        convertToPdfPoint(H, G) {
          return B.Util.applyInverseTransform([H, G], this.transform);
        }
      }
      class b extends B.BaseException {
        constructor(H, G = 0) {
          super(H, "RenderingCancelledException"), this.extraDelay = G;
        }
      }
      function s(j) {
        const H = j.length;
        let G = 0;
        for (; G < H && j[G].trim() === ""; )
          G++;
        return j.substring(G, G + 5).toLowerCase() === "data:";
      }
      function g(j) {
        return typeof j == "string" && /\.pdf$/i.test(j);
      }
      function t(j, H = !1) {
        return H || ([j] = j.split(/[#?]/, 1)), j.substring(j.lastIndexOf("/") + 1);
      }
      function i(j, H = "document.pdf") {
        if (typeof j != "string")
          return H;
        if (s(j))
          return (0, B.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), H;
        const G = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, Y = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, et = G.exec(j);
        let tt = Y.exec(et[1]) || Y.exec(et[2]) || Y.exec(et[3]);
        if (tt && (tt = tt[0], tt.includes("%")))
          try {
            tt = Y.exec(decodeURIComponent(tt))[0];
          } catch {
          }
        return tt || H;
      }
      class l {
        started = /* @__PURE__ */ Object.create(null);
        times = [];
        time(H) {
          H in this.started && (0, B.warn)(`Timer is already running for ${H}`), this.started[H] = Date.now();
        }
        timeEnd(H) {
          H in this.started || (0, B.warn)(`Timer has not been started for ${H}`), this.times.push({
            name: H,
            start: this.started[H],
            end: Date.now()
          }), delete this.started[H];
        }
        toString() {
          const H = [];
          let G = 0;
          for (const {
            name: Y
          } of this.times)
            G = Math.max(Y.length, G);
          for (const {
            name: Y,
            start: et,
            end: tt
          } of this.times)
            H.push(`${Y.padEnd(G)} ${tt - et}ms
`);
          return H.join("");
        }
      }
      function p(j, H) {
        try {
          const {
            protocol: G
          } = H ? new URL(j, H) : new URL(j);
          return G === "http:" || G === "https:";
        } catch {
          return !1;
        }
      }
      function w(j) {
        j.preventDefault();
      }
      let S;
      class L {
        static toDateObject(H) {
          if (!H || typeof H != "string")
            return null;
          S ||= new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");
          const G = S.exec(H);
          if (!G)
            return null;
          const Y = parseInt(G[1], 10);
          let et = parseInt(G[2], 10);
          et = et >= 1 && et <= 12 ? et - 1 : 0;
          let tt = parseInt(G[3], 10);
          tt = tt >= 1 && tt <= 31 ? tt : 1;
          let ot = parseInt(G[4], 10);
          ot = ot >= 0 && ot <= 23 ? ot : 0;
          let ct = parseInt(G[5], 10);
          ct = ct >= 0 && ct <= 59 ? ct : 0;
          let pt = parseInt(G[6], 10);
          pt = pt >= 0 && pt <= 59 ? pt : 0;
          const dt = G[7] || "Z";
          let ht = parseInt(G[8], 10);
          ht = ht >= 0 && ht <= 23 ? ht : 0;
          let ut = parseInt(G[9], 10) || 0;
          return ut = ut >= 0 && ut <= 59 ? ut : 0, dt === "-" ? (ot += ht, ct += ut) : dt === "+" && (ot -= ht, ct -= ut), new Date(Date.UTC(Y, et, tt, ot, ct, pt));
        }
      }
      function M(j, {
        scale: H = 1,
        rotation: G = 0
      }) {
        const {
          width: Y,
          height: et
        } = j.attributes.style, tt = [0, 0, parseInt(Y), parseInt(et)];
        return new o({
          viewBox: tt,
          scale: H,
          rotation: G
        });
      }
      function _(j) {
        if (j.startsWith("#")) {
          const H = parseInt(j.slice(1), 16);
          return [(H & 16711680) >> 16, (H & 65280) >> 8, H & 255];
        }
        return j.startsWith("rgb(") ? j.slice(4, -1).split(",").map((H) => parseInt(H)) : j.startsWith("rgba(") ? j.slice(5, -1).split(",").map((H) => parseInt(H)).slice(0, 3) : ((0, B.warn)(`Not a valid color format: "${j}"`), [0, 0, 0]);
      }
      function O(j) {
        const H = document.createElement("span");
        H.style.visibility = "hidden", document.body.append(H);
        for (const G of j.keys()) {
          H.style.color = G;
          const Y = window.getComputedStyle(H).color;
          j.set(G, _(Y));
        }
        H.remove();
      }
      function z(j) {
        const {
          a: H,
          b: G,
          c: Y,
          d: et,
          e: tt,
          f: ot
        } = j.getTransform();
        return [H, G, Y, et, tt, ot];
      }
      function K(j) {
        const {
          a: H,
          b: G,
          c: Y,
          d: et,
          e: tt,
          f: ot
        } = j.getTransform().invertSelf();
        return [H, G, Y, et, tt, ot];
      }
      function nt(j, H, G = !1, Y = !0) {
        if (H instanceof o) {
          const {
            pageWidth: et,
            pageHeight: tt
          } = H.rawDims, {
            style: ot
          } = j, ct = B.FeatureTest.isCSSRoundSupported, pt = `var(--scale-factor) * ${et}px`, dt = `var(--scale-factor) * ${tt}px`, ht = ct ? `round(${pt}, 1px)` : `calc(${pt})`, ut = ct ? `round(${dt}, 1px)` : `calc(${dt})`;
          !G || H.rotation % 180 === 0 ? (ot.width = ht, ot.height = ut) : (ot.width = ut, ot.height = ht);
        }
        Y && j.setAttribute("data-main-rotation", H.rotation);
      }
    }
  ),
  /***/
  47: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        DrawLayer: () => (
          /* binding */
          N
        )
        /* harmony export */
      });
      var y = V(419), B = V(292);
      class N {
        #t = null;
        #e = 0;
        #s = /* @__PURE__ */ new Map();
        #n = /* @__PURE__ */ new Map();
        constructor({
          pageIndex: P
        }) {
          this.pageIndex = P;
        }
        setParent(P) {
          if (!this.#t) {
            this.#t = P;
            return;
          }
          if (this.#t !== P) {
            if (this.#s.size > 0)
              for (const C of this.#s.values())
                C.remove(), P.append(C);
            this.#t = P;
          }
        }
        static get _svgFactory() {
          return (0, B.shadow)(this, "_svgFactory", new y.DOMSVGFactory());
        }
        static #r(P, {
          x: C = 0,
          y: E = 0,
          width: v = 1,
          height: r = 1
        } = {}) {
          const {
            style: d
          } = P;
          d.top = `${100 * E}%`, d.left = `${100 * C}%`, d.width = `${100 * v}%`, d.height = `${100 * r}%`;
        }
        #i(P) {
          const C = N._svgFactory.create(1, 1, !0);
          return this.#t.append(C), C.setAttribute("aria-hidden", !0), N.#r(C, P), C;
        }
        #a(P, C) {
          const E = N._svgFactory.createElement("clipPath");
          P.append(E);
          const v = `clip_${C}`;
          E.setAttribute("id", v), E.setAttribute("clipPathUnits", "objectBoundingBox");
          const r = N._svgFactory.createElement("use");
          return E.append(r), r.setAttribute("href", `#${C}`), r.classList.add("clip"), v;
        }
        highlight(P, C, E, v = !1) {
          const r = this.#e++, d = this.#i(P.box);
          d.classList.add("highlight"), P.free && d.classList.add("free");
          const o = N._svgFactory.createElement("defs");
          d.append(o);
          const b = N._svgFactory.createElement("path");
          o.append(b);
          const s = `path_p${this.pageIndex}_${r}`;
          b.setAttribute("id", s), b.setAttribute("d", P.toSVGPath()), v && this.#n.set(r, b);
          const g = this.#a(o, s), t = N._svgFactory.createElement("use");
          return d.append(t), d.setAttribute("fill", C), d.setAttribute("fill-opacity", E), t.setAttribute("href", `#${s}`), this.#s.set(r, d), {
            id: r,
            clipPathId: `url(#${g})`
          };
        }
        highlightOutline(P) {
          const C = this.#e++, E = this.#i(P.box);
          E.classList.add("highlightOutline");
          const v = N._svgFactory.createElement("defs");
          E.append(v);
          const r = N._svgFactory.createElement("path");
          v.append(r);
          const d = `path_p${this.pageIndex}_${C}`;
          r.setAttribute("id", d), r.setAttribute("d", P.toSVGPath()), r.setAttribute("vector-effect", "non-scaling-stroke");
          let o;
          if (P.free) {
            E.classList.add("free");
            const g = N._svgFactory.createElement("mask");
            v.append(g), o = `mask_p${this.pageIndex}_${C}`, g.setAttribute("id", o), g.setAttribute("maskUnits", "objectBoundingBox");
            const t = N._svgFactory.createElement("rect");
            g.append(t), t.setAttribute("width", "1"), t.setAttribute("height", "1"), t.setAttribute("fill", "white");
            const i = N._svgFactory.createElement("use");
            g.append(i), i.setAttribute("href", `#${d}`), i.setAttribute("stroke", "none"), i.setAttribute("fill", "black"), i.setAttribute("fill-rule", "nonzero"), i.classList.add("mask");
          }
          const b = N._svgFactory.createElement("use");
          E.append(b), b.setAttribute("href", `#${d}`), o && b.setAttribute("mask", `url(#${o})`);
          const s = b.cloneNode();
          return E.append(s), b.classList.add("mainOutline"), s.classList.add("secondaryOutline"), this.#s.set(C, E), C;
        }
        finalizeLine(P, C) {
          const E = this.#n.get(P);
          this.#n.delete(P), this.updateBox(P, C.box), E.setAttribute("d", C.toSVGPath());
        }
        updateLine(P, C) {
          this.#s.get(P).firstChild.firstChild.setAttribute("d", C.toSVGPath());
        }
        removeFreeHighlight(P) {
          this.remove(P), this.#n.delete(P);
        }
        updatePath(P, C) {
          this.#n.get(P).setAttribute("d", C.toSVGPath());
        }
        updateBox(P, C) {
          N.#r(this.#s.get(P), C);
        }
        show(P, C) {
          this.#s.get(P).classList.toggle("hidden", !C);
        }
        rotate(P, C) {
          this.#s.get(P).setAttribute("data-main-rotation", C);
        }
        changeColor(P, C) {
          this.#s.get(P).setAttribute("fill", C);
        }
        changeOpacity(P, C) {
          this.#s.get(P).setAttribute("fill-opacity", C);
        }
        addClass(P, C) {
          this.#s.get(P).classList.add(C);
        }
        removeClass(P, C) {
          this.#s.get(P).classList.remove(C);
        }
        remove(P) {
          this.#t !== null && (this.#s.get(P).remove(), this.#s.delete(P));
        }
        destroy() {
          this.#t = null;
          for (const P of this.#s.values())
            P.remove();
          this.#s.clear();
        }
      }
    }
  ),
  /***/
  731: (
    /***/
    (at, W, V) => {
      V.d(W, {
        AnnotationEditorLayer: () => (
          /* binding */
          s
        )
      });
      var y = V(292), B = V(310), N = V(830), U = V(976);
      const P = /\r\n?|\n/g;
      class C extends B.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 = "";
        #l = `${this.id}-editor`;
        #h;
        #d = null;
        static _freeTextDefaultContent = "";
        static _internalPadding = 0;
        static _defaultColor = null;
        static _defaultFontSize = 10;
        static get _keyboardManager() {
          const t = C.prototype, i = (w) => w.isEmpty(), l = N.AnnotationEditorUIManager.TRANSLATE_SMALL, p = N.AnnotationEditorUIManager.TRANSLATE_BIG;
          return (0, y.shadow)(this, "_keyboardManager", new N.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: [-l, 0],
            checker: i
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t._translateEmpty, {
            args: [-p, 0],
            checker: i
          }], [["ArrowRight", "mac+ArrowRight"], t._translateEmpty, {
            args: [l, 0],
            checker: i
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], t._translateEmpty, {
            args: [p, 0],
            checker: i
          }], [["ArrowUp", "mac+ArrowUp"], t._translateEmpty, {
            args: [0, -l],
            checker: i
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], t._translateEmpty, {
            args: [0, -p],
            checker: i
          }], [["ArrowDown", "mac+ArrowDown"], t._translateEmpty, {
            args: [0, l],
            checker: i
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], t._translateEmpty, {
            args: [0, p],
            checker: i
          }]]));
        }
        static _type = "freetext";
        static _editorType = y.AnnotationEditorType.FREETEXT;
        constructor(t) {
          super({
            ...t,
            name: "freeTextEditor"
          }), this.#i = t.color || C._defaultColor || B.AnnotationEditor._defaultLineColor, this.#h = t.fontSize || C._defaultFontSize;
        }
        static initialize(t, i) {
          B.AnnotationEditor.initialize(t, i, {
            strings: ["pdfjs-free-text-default-content"]
          });
          const l = getComputedStyle(document.documentElement);
          this._internalPadding = parseFloat(l.getPropertyValue("--freetext-padding"));
        }
        static updateDefaultParams(t, i) {
          switch (t) {
            case y.AnnotationEditorParamsType.FREETEXT_SIZE:
              C._defaultFontSize = i;
              break;
            case y.AnnotationEditorParamsType.FREETEXT_COLOR:
              C._defaultColor = i;
              break;
          }
        }
        updateParams(t, i) {
          switch (t) {
            case y.AnnotationEditorParamsType.FREETEXT_SIZE:
              this.#u(i);
              break;
            case y.AnnotationEditorParamsType.FREETEXT_COLOR:
              this.#c(i);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[y.AnnotationEditorParamsType.FREETEXT_SIZE, C._defaultFontSize], [y.AnnotationEditorParamsType.FREETEXT_COLOR, C._defaultColor || B.AnnotationEditor._defaultLineColor]];
        }
        get propertiesToUpdate() {
          return [[y.AnnotationEditorParamsType.FREETEXT_SIZE, this.#h], [y.AnnotationEditorParamsType.FREETEXT_COLOR, this.#i]];
        }
        #u(t) {
          const i = (p) => {
            this.editorDiv.style.fontSize = `calc(${p}px * var(--scale-factor))`, this.translate(0, -(p - this.#h) * this.parentScale), this.#h = p, this.#p();
          }, l = this.#h;
          this.addCommands({
            cmd: i.bind(this, t),
            undo: i.bind(this, l),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: y.AnnotationEditorParamsType.FREETEXT_SIZE,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #c(t) {
          const i = (p) => {
            this.#i = this.editorDiv.style.color = p;
          }, l = this.#i;
          this.addCommands({
            cmd: i.bind(this, t),
            undo: i.bind(this, l),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: y.AnnotationEditorParamsType.FREETEXT_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        _translateEmpty(t, i) {
          this._uiManager.translateSelectedEditors(t, i, !0);
        }
        getInitialTranslation() {
          const t = this.parentScale;
          return [-C._internalPadding * t, -(C._internalPadding + this.#h) * 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(y.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.#l), 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 i of this.editorDiv.childNodes)
            t.push(C.#g(i));
          return t.join(`
`);
        }
        #p() {
          const [t, i] = this.parentDimensions;
          let l;
          if (this.isAttachedToDOM)
            l = this.div.getBoundingClientRect();
          else {
            const {
              currentLayer: p,
              div: w
            } = this, S = w.style.display, L = w.classList.contains("hidden");
            w.classList.remove("hidden"), w.style.display = "hidden", p.div.append(this.div), l = w.getBoundingClientRect(), w.remove(), w.style.display = S, w.classList.toggle("hidden", L);
          }
          this.rotation % 180 === this.parentRotation % 180 ? (this.width = l.width / t, this.height = l.height / i) : (this.width = l.height / t, this.height = l.width / i), this.fixAndSetPosition();
        }
        commit() {
          if (!this.isInEditMode())
            return;
          super.commit(), this.disableEditMode();
          const t = this.#a, i = this.#a = this.#o().trimEnd();
          if (t === i)
            return;
          const l = (p) => {
            if (this.#a = p, !p) {
              this.remove();
              return;
            }
            this.#f(), this._uiManager.rebuild(this), this.#p();
          };
          this.addCommands({
            cmd: () => {
              l(i);
            },
            undo: () => {
              l(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) {
          C._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, i;
          this.width && (t = this.x, i = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", this.#l), this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text"), this.enableEditing(), B.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then((p) => this.editorDiv?.setAttribute("default-content", p)), this.editorDiv.contentEditable = !0;
          const {
            style: l
          } = this.editorDiv;
          if (l.fontSize = `calc(${this.#h}px * var(--scale-factor))`, l.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, N.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
            const [p, w] = this.parentDimensions;
            if (this.annotationElementId) {
              const {
                position: S
              } = this.#d;
              let [L, M] = this.getInitialTranslation();
              [L, M] = this.pageTranslationToScreen(L, M);
              const [_, O] = this.pageDimensions, [z, K] = this.pageTranslation;
              let nt, j;
              switch (this.rotation) {
                case 0:
                  nt = t + (S[0] - z) / _, j = i + this.height - (S[1] - K) / O;
                  break;
                case 90:
                  nt = t + (S[0] - z) / _, j = i - (S[1] - K) / O, [L, M] = [M, -L];
                  break;
                case 180:
                  nt = t - this.width + (S[0] - z) / _, j = i - (S[1] - K) / O, [L, M] = [-L, -M];
                  break;
                case 270:
                  nt = t + (S[0] - z - this.height * O) / _, j = i + (S[1] - K - this.width * _) / O, [L, M] = [-M, L];
                  break;
              }
              this.setAt(nt * p, j * w, L, M);
            } else
              this.setAt(t * p, i * w, this.width * p, this.height * w);
            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(P, "");
        }
        editorDivPaste(t) {
          const i = t.clipboardData || window.clipboardData, {
            types: l
          } = i;
          if (l.length === 1 && l[0] === "text/plain")
            return;
          t.preventDefault();
          const p = C.#m(i.getData("text") || "").replaceAll(P, `
`);
          if (!p)
            return;
          const w = window.getSelection();
          if (!w.rangeCount)
            return;
          this.editorDiv.normalize(), w.deleteFromDocument();
          const S = w.getRangeAt(0);
          if (!p.includes(`
`)) {
            S.insertNode(document.createTextNode(p)), this.editorDiv.normalize(), w.collapseToStart();
            return;
          }
          const {
            startContainer: L,
            startOffset: M
          } = S, _ = [], O = [];
          if (L.nodeType === Node.TEXT_NODE) {
            const nt = L.parentElement;
            if (O.push(L.nodeValue.slice(M).replaceAll(P, "")), nt !== this.editorDiv) {
              let j = _;
              for (const H of this.editorDiv.childNodes) {
                if (H === nt) {
                  j = O;
                  continue;
                }
                j.push(C.#g(H));
              }
            }
            _.push(L.nodeValue.slice(0, M).replaceAll(P, ""));
          } else if (L === this.editorDiv) {
            let nt = _, j = 0;
            for (const H of this.editorDiv.childNodes)
              j++ === M && (nt = O), nt.push(C.#g(H));
          }
          this.#a = `${_.join(`
`)}${p}${O.join(`
`)}`, this.#f();
          const z = new Range();
          let K = _.reduce((nt, j) => nt + j.length, 0);
          for (const {
            firstChild: nt
          } of this.editorDiv.childNodes)
            if (nt.nodeType === Node.TEXT_NODE) {
              const j = nt.nodeValue.length;
              if (K <= j) {
                z.setStart(nt, K), z.setEnd(nt, K);
                break;
              }
              K -= j;
            }
          w.removeAllRanges(), w.addRange(z);
        }
        #f() {
          if (this.editorDiv.replaceChildren(), !!this.#a)
            for (const t of this.#a.split(`
`)) {
              const i = document.createElement("div");
              i.append(t ? document.createTextNode(t) : document.createElement("br")), this.editorDiv.append(i);
            }
        }
        #A() {
          return this.#a.replaceAll(" ", " ");
        }
        static #m(t) {
          return t.replaceAll(" ", " ");
        }
        get contentDiv() {
          return this.editorDiv;
        }
        static deserialize(t, i, l) {
          let p = null;
          if (t instanceof U.FreeTextAnnotationElement) {
            const {
              data: {
                defaultAppearanceData: {
                  fontSize: S,
                  fontColor: L
                },
                rect: M,
                rotation: _,
                id: O
              },
              textContent: z,
              textPosition: K,
              parent: {
                page: {
                  pageNumber: nt
                }
              }
            } = t;
            if (!z || z.length === 0)
              return null;
            p = t = {
              annotationType: y.AnnotationEditorType.FREETEXT,
              color: Array.from(L),
              fontSize: S,
              value: z.join(`
`),
              position: K,
              pageIndex: nt - 1,
              rect: M.slice(0),
              rotation: _,
              id: O,
              deleted: !1
            };
          }
          const w = super.deserialize(t, i, l);
          return w.#h = t.fontSize, w.#i = y.Util.makeHexColor(...t.color), w.#a = C.#m(t.value), w.annotationElementId = t.id || null, w.#d = p, w;
        }
        serialize(t = !1) {
          if (this.isEmpty())
            return null;
          if (this.deleted)
            return {
              pageIndex: this.pageIndex,
              id: this.annotationElementId,
              deleted: !0
            };
          const i = C._internalPadding * this.parentScale, l = this.getRect(i, i), p = B.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#i), w = {
            annotationType: y.AnnotationEditorType.FREETEXT,
            color: p,
            fontSize: this.#h,
            value: this.#A(),
            pageIndex: this.pageIndex,
            rect: l,
            rotation: this.rotation,
            structTreeParentId: this._structTreeParentId
          };
          return t ? w : this.annotationElementId && !this.#v(w) ? null : (w.id = this.annotationElementId, w);
        }
        #v(t) {
          const {
            value: i,
            fontSize: l,
            color: p,
            pageIndex: w
          } = this.#d;
          return this._hasBeenMoved || t.value !== i || t.fontSize !== l || t.color.some((S, L) => S !== p[L]) || t.pageIndex !== w;
        }
        renderAnnotationElement(t) {
          const i = super.renderAnnotationElement(t);
          if (this.deleted)
            return i;
          const {
            style: l
          } = i;
          l.fontSize = `calc(${this.#h}px * var(--scale-factor))`, l.color = this.#i, i.replaceChildren();
          for (const w of this.#a.split(`
`)) {
            const S = document.createElement("div");
            S.append(w ? document.createTextNode(w) : document.createElement("br")), i.append(S);
          }
          const p = C._internalPadding * this.parentScale;
          return t.updateEdited({
            rect: this.getRect(p, p)
          }), i;
        }
        resetAnnotationElement(t) {
          super.resetAnnotationElement(t), t.resetEdited();
        }
      }
      var E = V(61), v = V(259), r = V(419);
      class d extends B.AnnotationEditor {
        #t = null;
        #e = 0;
        #s;
        #n = null;
        #r = null;
        #i = null;
        #a = null;
        #l = 0;
        #h = null;
        #d = null;
        #u = null;
        #c = !1;
        #o = this.#E.bind(this);
        #p = null;
        #g;
        #f = null;
        #A = "";
        #m;
        #v = "";
        static _defaultColor = null;
        static _defaultOpacity = 1;
        static _defaultThickness = 12;
        static _l10nPromise;
        static _type = "highlight";
        static _editorType = y.AnnotationEditorType.HIGHLIGHT;
        static _freeHighlightId = -1;
        static _freeHighlight = null;
        static _freeHighlightClipId = "";
        static get _keyboardManager() {
          const t = d.prototype;
          return (0, y.shadow)(this, "_keyboardManager", new N.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 || d._defaultColor, this.#m = t.thickness || d._defaultThickness, this.#g = t.opacity || d._defaultOpacity, this.#s = t.boxes || null, this.#v = t.methodOfCreation || "", this.#A = t.text || "", this._isDraggable = !1, t.highlightId > -1 ? (this.#c = !0, this.#C(t), this.#b()) : (this.#t = t.anchorNode, this.#e = t.anchorOffset, this.#a = t.focusNode, this.#l = 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.#v
          };
        }
        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 E.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 i = new E.Outliner(this.#s, 25e-4, 1e-3, this._uiManager.direction === "ltr");
          this.#i = i.getOutlines();
          const {
            lastPoint: l
          } = this.#i.box;
          this.#p = [(l[0] - this.x) / this.width, (l[1] - this.y) / this.height];
        }
        #C({
          highlightOutlines: t,
          highlightId: i,
          clipPathId: l
        }) {
          this.#d = t;
          const p = 1.5;
          if (this.#i = t.getNewOutline(this.#m / 2 + p, 25e-4), i >= 0)
            this.#u = i, this.#n = l, this.parent.drawLayer.finalizeLine(i, t), this.#f = this.parent.drawLayer.highlightOutline(this.#i);
          else if (this.parent) {
            const O = this.parent.viewport.rotation;
            this.parent.drawLayer.updateLine(this.#u, t), this.parent.drawLayer.updateBox(this.#u, d.#S(this.#d.box, (O - this.rotation + 360) % 360)), this.parent.drawLayer.updateLine(this.#f, this.#i), this.parent.drawLayer.updateBox(this.#f, d.#S(this.#i.box, O));
          }
          const {
            x: w,
            y: S,
            width: L,
            height: M
          } = t.box;
          switch (this.rotation) {
            case 0:
              this.x = w, this.y = S, this.width = L, this.height = M;
              break;
            case 90: {
              const [O, z] = this.parentDimensions;
              this.x = S, this.y = 1 - w, this.width = L * z / O, this.height = M * O / z;
              break;
            }
            case 180:
              this.x = 1 - w, this.y = 1 - S, this.width = L, this.height = M;
              break;
            case 270: {
              const [O, z] = this.parentDimensions;
              this.x = 1 - S, this.y = w, this.width = L * z / O, this.height = M * O / z;
              break;
            }
          }
          const {
            lastPoint: _
          } = this.#i.box;
          this.#p = [(_[0] - w) / L, (_[1] - S) / M];
        }
        static initialize(t, i) {
          B.AnnotationEditor.initialize(t, i), d._defaultColor ||= i.highlightColors?.values().next().value || "#fff066";
        }
        static updateDefaultParams(t, i) {
          switch (t) {
            case y.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:
              d._defaultColor = i;
              break;
            case y.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
              d._defaultThickness = i;
              break;
          }
        }
        translateInPage(t, i) {
        }
        get toolbarPosition() {
          return this.#p;
        }
        updateParams(t, i) {
          switch (t) {
            case y.AnnotationEditorParamsType.HIGHLIGHT_COLOR:
              this.#R(i);
              break;
            case y.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS:
              this.#I(i);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[y.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR, d._defaultColor], [y.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, d._defaultThickness]];
        }
        get propertiesToUpdate() {
          return [[y.AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.color || d._defaultColor], [y.AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, this.#m || d._defaultThickness], [y.AnnotationEditorParamsType.HIGHLIGHT_FREE, this.#c]];
        }
        #R(t) {
          const i = (p) => {
            this.color = p, this.parent?.drawLayer.changeColor(this.#u, p), this.#r?.updateColor(p);
          }, l = this.color;
          this.addCommands({
            cmd: i.bind(this, t),
            undo: i.bind(this, l),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: y.AnnotationEditorParamsType.HIGHLIGHT_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          }), this._reportTelemetry({
            action: "color_changed",
            color: this._uiManager.highlightColorNames.get(t)
          }, !0);
        }
        #I(t) {
          const i = this.#m, l = (p) => {
            this.#m = p, this.#P(p);
          };
          this.addCommands({
            cmd: l.bind(this, t),
            undo: l.bind(this, i),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: y.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 v.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.#T());
        }
        getBaseTranslation() {
          return [0, 0];
        }
        getRect(t, i) {
          return super.getRect(t, i, this.#T());
        }
        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 i = !1;
          this.parent && !t ? this.#y() : t && (this.#b(t), i = !this.parent && this.div?.classList.contains("selectedEditor")), super.setParent(t), this.show(this._isVisible), i && this.select();
        }
        #P(t) {
          if (!this.#c)
            return;
          this.#C({
            highlightOutlines: this.#d.getNewOutline(t / 2)
          }), this.fixAndSetPosition();
          const [i, l] = this.parentDimensions;
          this.setDims(this.width * i, this.height * l);
        }
        #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.#h && (this.#h.style.clipPath = this.#n));
        }
        static #S({
          x: t,
          y: i,
          width: l,
          height: p
        }, w) {
          switch (w) {
            case 90:
              return {
                x: 1 - i - p,
                y: t,
                width: p,
                height: l
              };
            case 180:
              return {
                x: 1 - t - l,
                y: 1 - i - p,
                width: l,
                height: p
              };
            case 270:
              return {
                x: i,
                y: 1 - t - l,
                width: p,
                height: l
              };
          }
          return {
            x: t,
            y: i,
            width: l,
            height: p
          };
        }
        rotate(t) {
          const {
            drawLayer: i
          } = this.parent;
          let l;
          this.#c ? (t = (t - this.rotation + 360) % 360, l = d.#S(this.#d.box, t)) : l = d.#S(this, t), i.rotate(this.#u, t), i.rotate(this.#f, t), i.updateBox(this.#u, l), i.updateBox(this.#f, d.#S(this.#i.box, t));
        }
        render() {
          if (this.div)
            return this.div;
          const t = super.render();
          this.#A && (t.setAttribute("aria-label", this.#A), t.setAttribute("role", "mark")), this.#c ? t.classList.add("free") : this.div.addEventListener("keydown", this.#o);
          const i = this.#h = document.createElement("div");
          t.append(i), i.setAttribute("aria-hidden", "true"), i.className = "internal", i.style.clipPath = this.#n;
          const [l, p] = this.parentDimensions;
          return this.setDims(this.width * l, this.height * p), (0, N.bindEvents)(this, this.#h, ["pointerover", "pointerleave"]), this.enableEditing(), t;
        }
        pointerover() {
          this.parent.drawLayer.addClass(this.#f, "hovered");
        }
        pointerleave() {
          this.parent.drawLayer.removeClass(this.#f, "hovered");
        }
        #E(t) {
          d._keyboardManager.exec(this, t);
        }
        _moveCaret(t) {
          switch (this.parent.unselect(this), t) {
            case 0:
            case 2:
              this.#k(!0);
              break;
            case 1:
            case 3:
              this.#k(!1);
              break;
          }
        }
        #k(t) {
          if (!this.#t)
            return;
          const i = window.getSelection();
          t ? i.setPosition(this.#t, this.#e) : i.setPosition(this.#a, this.#l);
        }
        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.#k(!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));
        }
        #T() {
          return this.#c ? this.rotation : 0;
        }
        #M() {
          if (this.#c)
            return null;
          const [t, i] = this.pageDimensions, l = this.#s, p = new Array(l.length * 8);
          let w = 0;
          for (const {
            x: S,
            y: L,
            width: M,
            height: _
          } of l) {
            const O = S * t, z = (1 - L - _) * i;
            p[w] = p[w + 4] = O, p[w + 1] = p[w + 3] = z, p[w + 2] = p[w + 6] = O + M * t, p[w + 5] = p[w + 7] = z + _ * i, w += 8;
          }
          return p;
        }
        #F(t) {
          return this.#d.serialize(t, this.#T());
        }
        static startHighlighting(t, i, {
          target: l,
          x: p,
          y: w
        }) {
          const {
            x: S,
            y: L,
            width: M,
            height: _
          } = l.getBoundingClientRect(), O = (j) => {
            this.#N(t, j);
          }, z = {
            capture: !0,
            passive: !1
          }, K = (j) => {
            j.preventDefault(), j.stopPropagation();
          }, nt = (j) => {
            l.removeEventListener("pointermove", O), window.removeEventListener("blur", nt), window.removeEventListener("pointerup", nt), window.removeEventListener("pointerdown", K, z), window.removeEventListener("contextmenu", r.noContextMenu), this.#L(t, j);
          };
          window.addEventListener("blur", nt), window.addEventListener("pointerup", nt), window.addEventListener("pointerdown", K, z), window.addEventListener("contextmenu", r.noContextMenu), l.addEventListener("pointermove", O), this._freeHighlight = new E.FreeOutliner({
            x: p,
            y: w
          }, [S, L, M, _], t.scale, this._defaultThickness / 2, i, 1e-3), {
            id: this._freeHighlightId,
            clipPathId: this._freeHighlightClipId
          } = t.drawLayer.highlight(this._freeHighlight, this._defaultColor, this._defaultOpacity, !0);
        }
        static #N(t, i) {
          this._freeHighlight.add(i) && t.drawLayer.updatePath(this._freeHighlightId, this._freeHighlight);
        }
        static #L(t, i) {
          this._freeHighlight.isEmpty() ? t.drawLayer.removeFreeHighlight(this._freeHighlightId) : t.createAndAddNewEditor(i, !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, i, l) {
          const p = super.deserialize(t, i, l), {
            rect: [w, S, L, M],
            color: _,
            quadPoints: O
          } = t;
          p.color = y.Util.makeHexColor(..._), p.#g = t.opacity;
          const [z, K] = p.pageDimensions;
          p.width = (L - w) / z, p.height = (M - S) / K;
          const nt = p.#s = [];
          for (let j = 0; j < O.length; j += 8)
            nt.push({
              x: (O[4] - L) / z,
              y: (M - (1 - O[j + 5])) / K,
              width: (O[j + 2] - O[j]) / z,
              height: (O[j + 5] - O[j + 1]) / K
            });
          return p.#w(), p;
        }
        serialize(t = !1) {
          if (this.isEmpty() || t)
            return null;
          const i = this.getRect(0, 0), l = B.AnnotationEditor._colorManager.convert(this.color);
          return {
            annotationType: y.AnnotationEditorType.HIGHLIGHT,
            color: l,
            opacity: this.#g,
            thickness: this.#m,
            quadPoints: this.#M(),
            outlines: this.#F(i),
            pageIndex: this.pageIndex,
            rect: i,
            rotation: this.#T(),
            structTreeParentId: this._structTreeParentId
          };
        }
        static canCreateNewEmptyEditor() {
          return !1;
        }
      }
      class o extends B.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;
        #l = new Path2D();
        #h = !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 = y.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, i) {
          B.AnnotationEditor.initialize(t, i);
        }
        static updateDefaultParams(t, i) {
          switch (t) {
            case y.AnnotationEditorParamsType.INK_THICKNESS:
              o._defaultThickness = i;
              break;
            case y.AnnotationEditorParamsType.INK_COLOR:
              o._defaultColor = i;
              break;
            case y.AnnotationEditorParamsType.INK_OPACITY:
              o._defaultOpacity = i / 100;
              break;
          }
        }
        updateParams(t, i) {
          switch (t) {
            case y.AnnotationEditorParamsType.INK_THICKNESS:
              this.#f(i);
              break;
            case y.AnnotationEditorParamsType.INK_COLOR:
              this.#A(i);
              break;
            case y.AnnotationEditorParamsType.INK_OPACITY:
              this.#m(i);
              break;
          }
        }
        static get defaultPropertiesToUpdate() {
          return [[y.AnnotationEditorParamsType.INK_THICKNESS, o._defaultThickness], [y.AnnotationEditorParamsType.INK_COLOR, o._defaultColor || B.AnnotationEditor._defaultLineColor], [y.AnnotationEditorParamsType.INK_OPACITY, Math.round(o._defaultOpacity * 100)]];
        }
        get propertiesToUpdate() {
          return [[y.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || o._defaultThickness], [y.AnnotationEditorParamsType.INK_COLOR, this.color || o._defaultColor || B.AnnotationEditor._defaultLineColor], [y.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? o._defaultOpacity))]];
        }
        #f(t) {
          const i = (p) => {
            this.thickness = p, this.#O();
          }, l = this.thickness;
          this.addCommands({
            cmd: i.bind(this, t),
            undo: i.bind(this, l),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: y.AnnotationEditorParamsType.INK_THICKNESS,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #A(t) {
          const i = (p) => {
            this.color = p, this.#E();
          }, l = this.color;
          this.addCommands({
            cmd: i.bind(this, t),
            undo: i.bind(this, l),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: y.AnnotationEditorParamsType.INK_COLOR,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        #m(t) {
          const i = (p) => {
            this.opacity = p, this.#E();
          };
          t /= 100;
          const l = this.opacity;
          this.addCommands({
            cmd: i.bind(this, t),
            undo: i.bind(this, l),
            post: this._uiManager.updateUI.bind(this._uiManager, this),
            mustExec: !0,
            type: y.AnnotationEditorParamsType.INK_OPACITY,
            overwriteIfSameType: !0,
            keepUndo: !0
          });
        }
        rebuild() {
          this.parent && (super.rebuild(), this.div !== null && (this.canvas || (this.#T(), this.#M()), this.isAttachedToDOM || (this.parent.add(this), this.#F()), this.#O()));
        }
        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, i] = this.parentDimensions, l = this.width * t, p = this.height * i;
          this.setDimensions(l, p);
        }
        enableEditMode() {
          this.#h || 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;
        }
        #v() {
          const {
            parentRotation: t,
            parentDimensions: [i, l]
          } = this;
          switch (t) {
            case 90:
              return [0, l, l, i];
            case 180:
              return [i, l, i, l];
            case 270:
              return [i, 0, l, i];
            default:
              return [0, 0, i, l];
          }
        }
        #w() {
          const {
            ctx: t,
            color: i,
            opacity: l,
            thickness: p,
            parentScale: w,
            scaleFactor: S
          } = this;
          t.lineWidth = p * w / S, t.lineCap = "round", t.lineJoin = "round", t.miterLimit = 10, t.strokeStyle = `${i}${(0, N.opacityToHex)(l)}`;
        }
        #C(t, i) {
          this.canvas.addEventListener("contextmenu", r.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.#F(), this.thickness ||= o._defaultThickness, this.color ||= o._defaultColor || B.AnnotationEditor._defaultLineColor, this.opacity ??= o._defaultOpacity), this.currentPath.push([t, i]), this.#d = !1, this.#w(), this.#g = () => {
            this.#y(), this.#g && window.requestAnimationFrame(this.#g);
          }, window.requestAnimationFrame(this.#g);
        }
        #R(t, i) {
          const [l, p] = this.currentPath.at(-1);
          if (this.currentPath.length > 1 && t === l && i === p)
            return;
          const w = this.currentPath;
          let S = this.#l;
          if (w.push([t, i]), this.#d = !0, w.length <= 2) {
            S.moveTo(...w[0]), S.lineTo(t, i);
            return;
          }
          w.length === 3 && (this.#l = S = new Path2D(), S.moveTo(...w[0])), this.#b(S, ...w.at(-3), ...w.at(-2), t, i);
        }
        #I() {
          if (this.currentPath.length === 0)
            return;
          const t = this.currentPath.at(-1);
          this.#l.lineTo(...t);
        }
        #P(t, i) {
          this.#g = null, t = Math.min(Math.max(t, 0), this.canvas.width), i = Math.min(Math.max(i, 0), this.canvas.height), this.#R(t, i), this.#I();
          let l;
          if (this.currentPath.length !== 1)
            l = this.#S();
          else {
            const M = [t, i];
            l = [[M, M.slice(), M.slice(), M]];
          }
          const p = this.#l, w = this.currentPath;
          this.currentPath = [], this.#l = new Path2D();
          const S = () => {
            this.allRawPaths.push(w), this.paths.push(l), this.bezierPath2D.push(p), this._uiManager.rebuild(this);
          }, L = () => {
            this.allRawPaths.pop(), this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (this.#T(), this.#M()), this.#O());
          };
          this.addCommands({
            cmd: S,
            undo: L,
            mustExec: !0
          });
        }
        #y() {
          if (!this.#d)
            return;
          this.#d = !1;
          const t = Math.ceil(this.thickness * this.parentScale), i = this.currentPath.slice(-3), l = i.map((S) => S[0]), p = i.map((S) => S[1]);
          Math.min(...l) - t, Math.max(...l) + t, Math.min(...p) - t, Math.max(...p) + t;
          const {
            ctx: w
          } = this;
          w.save(), w.clearRect(0, 0, this.canvas.width, this.canvas.height);
          for (const S of this.bezierPath2D)
            w.stroke(S);
          w.stroke(this.#l), w.restore();
        }
        #b(t, i, l, p, w, S, L) {
          const M = (i + p) / 2, _ = (l + w) / 2, O = (p + S) / 2, z = (w + L) / 2;
          t.bezierCurveTo(M + 2 * (p - M) / 3, _ + 2 * (w - _) / 3, O + 2 * (p - O) / 3, z + 2 * (w - z) / 3, O, z);
        }
        #S() {
          const t = this.currentPath;
          if (t.length <= 2)
            return [[t[0], t[0], t.at(-1), t.at(-1)]];
          const i = [];
          let l, [p, w] = t[0];
          for (l = 1; l < t.length - 2; l++) {
            const [K, nt] = t[l], [j, H] = t[l + 1], G = (K + j) / 2, Y = (nt + H) / 2, et = [p + 2 * (K - p) / 3, w + 2 * (nt - w) / 3], tt = [G + 2 * (K - G) / 3, Y + 2 * (nt - Y) / 3];
            i.push([[p, w], et, tt, [G, Y]]), [p, w] = [G, Y];
          }
          const [S, L] = t[l], [M, _] = t[l + 1], O = [p + 2 * (S - p) / 3, w + 2 * (L - w) / 3], z = [M + 2 * (S - M) / 3, _ + 2 * (L - _) / 3];
          return i.push([[p, w], O, z, [M, _]]), i;
        }
        #E() {
          if (this.isEmpty()) {
            this.#L();
            return;
          }
          this.#w();
          const {
            canvas: t,
            ctx: i
          } = this;
          i.setTransform(1, 0, 0, 1, 0, 0), i.clearRect(0, 0, t.width, t.height), this.#L();
          for (const l of this.bezierPath2D)
            i.stroke(l);
        }
        commit() {
          this.#h || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), this.#h = !0, this.div.classList.add("disabled"), this.#O(!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.#h || (this.setInForeground(), t.preventDefault(), this.div.contains(document.activeElement) || this.div.focus({
            preventScroll: !0
          }), this.#C(t.offsetX, t.offsetY));
        }
        canvasPointermove(t) {
          t.preventDefault(), this.#R(t.offsetX, t.offsetY);
        }
        canvasPointerup(t) {
          t.preventDefault(), this.#k(t);
        }
        canvasPointerleave(t) {
          this.#k(t);
        }
        #k(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", r.noContextMenu);
          }, 10), this.#P(t.offsetX, t.offsetY), this.addToAnnotationStorage(), this.setInBackground();
        }
        #T() {
          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");
        }
        #M() {
          this.#c = new ResizeObserver((t) => {
            const i = t[0].contentRect;
            i.width && i.height && this.setDimensions(i.width, i.height);
          }), this.#c.observe(this.div);
        }
        get isResizable() {
          return !this.isEmpty() && this.#h;
        }
        render() {
          if (this.div)
            return this.div;
          let t, i;
          this.width && (t = this.x, i = this.y), super.render(), this.div.setAttribute("data-l10n-id", "pdfjs-ink");
          const [l, p, w, S] = this.#v();
          if (this.setAt(l, p, 0, 0), this.setDims(w, S), this.#T(), this.width) {
            const [L, M] = this.parentDimensions;
            this.setAspectRatio(this.width * L, this.height * M), this.setAt(t * L, i * M, this.width * L, this.height * M), this.#u = !0, this.#F(), this.setDims(this.width * L, this.height * M), this.#E(), this.div.classList.add("disabled");
          } else
            this.div.classList.add("editing"), this.enableEditMode();
          return this.#M(), this.div;
        }
        #F() {
          if (!this.#u)
            return;
          const [t, i] = this.parentDimensions;
          this.canvas.width = Math.ceil(this.width * t), this.canvas.height = Math.ceil(this.height * i), this.#L();
        }
        setDimensions(t, i) {
          const l = Math.round(t), p = Math.round(i);
          if (this.#o === l && this.#p === p)
            return;
          this.#o = l, this.#p = p, this.canvas.style.visibility = "hidden";
          const [w, S] = this.parentDimensions;
          this.width = t / w, this.height = i / S, this.fixAndSetPosition(), this.#h && this.#N(t, i), this.#F(), this.#E(), this.canvas.style.visibility = "visible", this.fixDims();
        }
        #N(t, i) {
          const l = this.#B(), p = (t - l) / this.#e, w = (i - l) / this.#t;
          this.scaleFactor = Math.min(p, w);
        }
        #L() {
          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 #D(t) {
          const i = new Path2D();
          for (let l = 0, p = t.length; l < p; l++) {
            const [w, S, L, M] = t[l];
            l === 0 && i.moveTo(...w), i.bezierCurveTo(S[0], S[1], L[0], L[1], M[0], M[1]);
          }
          return i;
        }
        static #G(t, i, l) {
          const [p, w, S, L] = i;
          switch (l) {
            case 0:
              for (let M = 0, _ = t.length; M < _; M += 2)
                t[M] += p, t[M + 1] = L - t[M + 1];
              break;
            case 90:
              for (let M = 0, _ = t.length; M < _; M += 2) {
                const O = t[M];
                t[M] = t[M + 1] + p, t[M + 1] = O + w;
              }
              break;
            case 180:
              for (let M = 0, _ = t.length; M < _; M += 2)
                t[M] = S - t[M], t[M + 1] += w;
              break;
            case 270:
              for (let M = 0, _ = t.length; M < _; M += 2) {
                const O = t[M];
                t[M] = S - t[M + 1], t[M + 1] = L - O;
              }
              break;
            default:
              throw new Error("Invalid rotation");
          }
          return t;
        }
        static #X(t, i, l) {
          const [p, w, S, L] = i;
          switch (l) {
            case 0:
              for (let M = 0, _ = t.length; M < _; M += 2)
                t[M] -= p, t[M + 1] = L - t[M + 1];
              break;
            case 90:
              for (let M = 0, _ = t.length; M < _; M += 2) {
                const O = t[M];
                t[M] = t[M + 1] - w, t[M + 1] = O - p;
              }
              break;
            case 180:
              for (let M = 0, _ = t.length; M < _; M += 2)
                t[M] = S - t[M], t[M + 1] -= w;
              break;
            case 270:
              for (let M = 0, _ = t.length; M < _; M += 2) {
                const O = t[M];
                t[M] = L - t[M + 1], t[M + 1] = S - O;
              }
              break;
            default:
              throw new Error("Invalid rotation");
          }
          return t;
        }
        #$(t, i, l, p) {
          const w = [], S = this.thickness / 2, L = t * i + S, M = t * l + S;
          for (const _ of this.paths) {
            const O = [], z = [];
            for (let K = 0, nt = _.length; K < nt; K++) {
              const [j, H, G, Y] = _[K];
              if (j[0] === Y[0] && j[1] === Y[1] && nt === 1) {
                const st = t * j[0] + L, m = t * j[1] + M;
                O.push(st, m), z.push(st, m);
                break;
              }
              const et = t * j[0] + L, tt = t * j[1] + M, ot = t * H[0] + L, ct = t * H[1] + M, pt = t * G[0] + L, dt = t * G[1] + M, ht = t * Y[0] + L, ut = t * Y[1] + M;
              K === 0 && (O.push(et, tt), z.push(et, tt)), O.push(ot, ct, pt, dt, ht, ut), z.push(ot, ct), K === nt - 1 && z.push(ht, ut);
            }
            w.push({
              bezier: o.#G(O, p, this.rotation),
              points: o.#G(z, p, this.rotation)
            });
          }
          return w;
        }
        #V() {
          let t = 1 / 0, i = -1 / 0, l = 1 / 0, p = -1 / 0;
          for (const w of this.paths)
            for (const [S, L, M, _] of w) {
              const O = y.Util.bezierBoundingBox(...S, ...L, ...M, ..._);
              t = Math.min(t, O[0]), l = Math.min(l, O[1]), i = Math.max(i, O[2]), p = Math.max(p, O[3]);
            }
          return [t, l, i, p];
        }
        #B() {
          return this.#h ? Math.ceil(this.thickness * this.parentScale) : 0;
        }
        #O(t = !1) {
          if (this.isEmpty())
            return;
          if (!this.#h) {
            this.#E();
            return;
          }
          const i = this.#V(), l = this.#B();
          this.#e = Math.max(B.AnnotationEditor.MIN_SIZE, i[2] - i[0]), this.#t = Math.max(B.AnnotationEditor.MIN_SIZE, i[3] - i[1]);
          const p = Math.ceil(l + this.#e * this.scaleFactor), w = Math.ceil(l + this.#t * this.scaleFactor), [S, L] = this.parentDimensions;
          this.width = p / S, this.height = w / L, this.setAspectRatio(p, w);
          const M = this.translationX, _ = this.translationY;
          this.translationX = -i[0], this.translationY = -i[1], this.#F(), this.#E(), this.#o = p, this.#p = w, this.setDims(p, w);
          const O = t ? l / this.scaleFactor / 2 : 0;
          this.translate(M - this.translationX - O, _ - this.translationY - O);
        }
        static deserialize(t, i, l) {
          if (t instanceof U.InkAnnotationElement)
            return null;
          const p = super.deserialize(t, i, l);
          p.thickness = t.thickness, p.color = y.Util.makeHexColor(...t.color), p.opacity = t.opacity;
          const [w, S] = p.pageDimensions, L = p.width * w, M = p.height * S, _ = p.parentScale, O = t.thickness / 2;
          p.#h = !0, p.#o = Math.round(L), p.#p = Math.round(M);
          const {
            paths: z,
            rect: K,
            rotation: nt
          } = t;
          for (let {
            bezier: H
          } of z) {
            H = o.#X(H, K, nt);
            const G = [];
            p.paths.push(G);
            let Y = _ * (H[0] - O), et = _ * (H[1] - O);
            for (let ot = 2, ct = H.length; ot < ct; ot += 6) {
              const pt = _ * (H[ot] - O), dt = _ * (H[ot + 1] - O), ht = _ * (H[ot + 2] - O), ut = _ * (H[ot + 3] - O), st = _ * (H[ot + 4] - O), m = _ * (H[ot + 5] - O);
              G.push([[Y, et], [pt, dt], [ht, ut], [st, m]]), Y = st, et = m;
            }
            const tt = this.#D(G);
            p.bezierPath2D.push(tt);
          }
          const j = p.#V();
          return p.#e = Math.max(B.AnnotationEditor.MIN_SIZE, j[2] - j[0]), p.#t = Math.max(B.AnnotationEditor.MIN_SIZE, j[3] - j[1]), p.#N(L, M), p;
        }
        serialize() {
          if (this.isEmpty())
            return null;
          const t = this.getRect(0, 0), i = B.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
          return {
            annotationType: y.AnnotationEditorType.INK,
            color: i,
            thickness: this.thickness,
            opacity: this.opacity,
            paths: this.#$(this.scaleFactor / this.parentScale, this.translationX, this.translationY, t),
            pageIndex: this.pageIndex,
            rect: t,
            rotation: this.rotation,
            structTreeParentId: this._structTreeParentId
          };
        }
      }
      class b extends B.AnnotationEditor {
        #t = null;
        #e = null;
        #s = null;
        #n = null;
        #r = null;
        #i = "";
        #a = null;
        #l = null;
        #h = null;
        #d = !1;
        #u = !1;
        static _type = "stamp";
        static _editorType = y.AnnotationEditorType.STAMP;
        constructor(t) {
          super({
            ...t,
            name: "stampEditor"
          }), this.#n = t.bitmapUrl, this.#r = t.bitmapFile;
        }
        static initialize(t, i) {
          B.AnnotationEditor.initialize(t, i);
        }
        static get supportedTypes() {
          const t = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
          return (0, y.shadow)(this, "supportedTypes", t.map((i) => `image/${i}`));
        }
        static get supportedTypesStr() {
          return (0, y.shadow)(this, "supportedTypesStr", this.supportedTypes.join(","));
        }
        static isHandlingMimeForPasting(t) {
          return this.supportedTypes.includes(t);
        }
        static paste(t, i) {
          i.pasteEditor(y.AnnotationEditorType.STAMP, {
            bitmapFile: t.getAsFile()
          });
        }
        #c(t, i = !1) {
          if (!t) {
            this.remove();
            return;
          }
          this.#t = t.bitmap, i || (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((i) => this.#c(i, !0)).finally(() => this.#o());
            return;
          }
          if (this.#n) {
            const i = this.#n;
            this.#n = null, this._uiManager.enableWaiting(!0), this.#s = this._uiManager.imageManager.getFromUrl(i).then((l) => this.#c(l)).finally(() => this.#o());
            return;
          }
          if (this.#r) {
            const i = this.#r;
            this.#r = null, this._uiManager.enableWaiting(!0), this.#s = this._uiManager.imageManager.getFromFile(i).then((l) => this.#c(l)).finally(() => this.#o());
            return;
          }
          const t = document.createElement("input");
          t.type = "file", t.accept = b.supportedTypesStr, this.#s = new Promise((i) => {
            t.addEventListener("change", async () => {
              if (!t.files || t.files.length === 0)
                this.remove();
              else {
                this._uiManager.enableWaiting(!0);
                const l = await this._uiManager.imageManager.getFromFile(t.files[0]);
                this.#c(l);
              }
              i();
            }), t.addEventListener("cancel", () => {
              this.remove(), i();
            });
          }).finally(() => this.#o()), t.click();
        }
        remove() {
          this.#e && (this.#t = null, this._uiManager.imageManager.deleteId(this.#e), this.#a?.remove(), this.#a = null, this.#l?.disconnect(), this.#l = null, this.#h && (clearTimeout(this.#h), this.#h = 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, i;
          if (this.width && (t = this.x, i = this.y), super.render(), this.div.hidden = !0, this.addAltTextButton(), this.#t ? this.#g() : this.#p(), this.width) {
            const [l, p] = this.parentDimensions;
            this.setAt(t * l, i * p, this.width * l, this.height * p);
          }
          return this.div;
        }
        #g() {
          const {
            div: t
          } = this;
          let {
            width: i,
            height: l
          } = this.#t;
          const [p, w] = this.pageDimensions, S = 0.75;
          if (this.width)
            i = this.width * p, l = this.height * w;
          else if (i > S * p || l > S * w) {
            const O = Math.min(S * p / i, S * w / l);
            i *= O, l *= O;
          }
          const [L, M] = this.parentDimensions;
          this.setDims(i * L / p, l * M / w), this._uiManager.enableWaiting(!1);
          const _ = this.#a = document.createElement("canvas");
          t.append(_), t.hidden = !1, this.#m(i, l), this.#w(), this.#u || (this.parent.addUndoableEditor(this), this.#u = !0), this._reportTelemetry({
            action: "inserted_image"
          }), this.#i && _.setAttribute("aria-label", this.#i);
        }
        #f(t, i) {
          const [l, p] = this.parentDimensions;
          this.width = t / l, this.height = i / p, this.setDims(t, i), this._initialOptions?.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, this.#h !== null && clearTimeout(this.#h);
          const w = 200;
          this.#h = setTimeout(() => {
            this.#h = null, this.#m(t, i);
          }, w);
        }
        #A(t, i) {
          const {
            width: l,
            height: p
          } = this.#t;
          let w = l, S = p, L = this.#t;
          for (; w > 2 * t || S > 2 * i; ) {
            const M = w, _ = S;
            w > 2 * t && (w = w >= 16384 ? Math.floor(w / 2) - 1 : Math.ceil(w / 2)), S > 2 * i && (S = S >= 16384 ? Math.floor(S / 2) - 1 : Math.ceil(S / 2));
            const O = new OffscreenCanvas(w, S);
            O.getContext("2d").drawImage(L, 0, 0, M, _, 0, 0, w, S), L = O.transferToImageBitmap();
          }
          return L;
        }
        #m(t, i) {
          t = Math.ceil(t), i = Math.ceil(i);
          const l = this.#a;
          if (!l || l.width === t && l.height === i)
            return;
          l.width = t, l.height = i;
          const p = this.#d ? this.#t : this.#A(t, i);
          if (this._uiManager.hasMLManager && !this.hasAltText()) {
            const S = new OffscreenCanvas(t, i);
            S.getContext("2d").drawImage(p, 0, 0, p.width, p.height, 0, 0, t, i), S.convertToBlob().then((M) => {
              const _ = new FileReader();
              _.onload = () => {
                const O = _.result;
                this._uiManager.mlGuess({
                  service: "image-to-text",
                  request: {
                    imageData: O
                  }
                }).then((z) => {
                  const K = z?.output || "";
                  this.parent && K && !this.hasAltText() && (this.altTextData = {
                    altText: K,
                    decorative: !1
                  });
                });
              }, _.readAsDataURL(M);
            });
          }
          const w = l.getContext("2d");
          w.filter = this._uiManager.hcmFilter, w.drawImage(p, 0, 0, p.width, p.height, 0, 0, t, i);
        }
        getImageForAltText() {
          return this.#a;
        }
        #v(t) {
          if (t) {
            if (this.#d) {
              const p = this._uiManager.imageManager.getSvgUrl(this.#e);
              if (p)
                return p;
            }
            const i = document.createElement("canvas");
            return {
              width: i.width,
              height: i.height
            } = this.#t, i.getContext("2d").drawImage(this.#t, 0, 0), i.toDataURL();
          }
          if (this.#d) {
            const [i, l] = this.pageDimensions, p = Math.round(this.width * i * r.PixelsPerInch.PDF_TO_CSS_UNITS), w = Math.round(this.height * l * r.PixelsPerInch.PDF_TO_CSS_UNITS), S = new OffscreenCanvas(p, w);
            return S.getContext("2d").drawImage(this.#t, 0, 0, this.#t.width, this.#t.height, 0, 0, p, w), S.transferToImageBitmap();
          }
          return structuredClone(this.#t);
        }
        #w() {
          this.#l = new ResizeObserver((t) => {
            const i = t[0].contentRect;
            i.width && i.height && this.#f(i.width, i.height);
          }), this.#l.observe(this.div);
        }
        static deserialize(t, i, l) {
          if (t instanceof U.StampAnnotationElement)
            return null;
          const p = super.deserialize(t, i, l), {
            rect: w,
            bitmapUrl: S,
            bitmapId: L,
            isSvg: M,
            accessibilityData: _
          } = t;
          L && l.imageManager.isValidId(L) ? p.#e = L : p.#n = S, p.#d = M;
          const [O, z] = p.pageDimensions;
          return p.width = (w[2] - w[0]) / O, p.height = (w[3] - w[1]) / z, _ && (p.altTextData = _), p;
        }
        serialize(t = !1, i = null) {
          if (this.isEmpty())
            return null;
          const l = {
            annotationType: y.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 l.bitmapUrl = this.#v(!0), l.accessibilityData = this.altTextData, l;
          const {
            decorative: p,
            altText: w
          } = this.altTextData;
          if (!p && w && (l.accessibilityData = {
            type: "Figure",
            alt: w
          }), i === null)
            return l;
          i.stamps ||= /* @__PURE__ */ new Map();
          const S = this.#d ? (l.rect[2] - l.rect[0]) * (l.rect[3] - l.rect[1]) : null;
          if (!i.stamps.has(this.#e))
            i.stamps.set(this.#e, {
              area: S,
              serialized: l
            }), l.bitmap = this.#v(!1);
          else if (this.#d) {
            const L = i.stamps.get(this.#e);
            S > L.area && (L.area = S, L.serialized.bitmap.close(), L.serialized.bitmap = this.#v(!1));
          }
          return l;
        }
      }
      class s {
        #t;
        #e = !1;
        #s = null;
        #n = null;
        #r = null;
        #i = null;
        #a = null;
        #l = /* @__PURE__ */ new Map();
        #h = !1;
        #d = !1;
        #u = !1;
        #c = null;
        #o;
        static _initialized = !1;
        static #p = new Map([C, o, b, d].map((t) => [t._editorType, t]));
        constructor({
          uiManager: t,
          pageIndex: i,
          div: l,
          accessibilityManager: p,
          annotationLayer: w,
          drawLayer: S,
          textLayer: L,
          viewport: M,
          l10n: _
        }) {
          const O = [...s.#p.values()];
          if (!s._initialized) {
            s._initialized = !0;
            for (const z of O)
              z.initialize(_, t);
          }
          t.registerEditorTypes(O), this.#o = t, this.pageIndex = i, this.div = l, this.#t = p, this.#s = w, this.viewport = M, this.#c = L, this.drawLayer = S, this.#o.addLayer(this);
        }
        get isEmpty() {
          return this.#l.size === 0;
        }
        get isInvisible() {
          return this.isEmpty && this.#o.getMode() === y.AnnotationEditorType.NONE;
        }
        updateToolbar(t) {
          this.#o.updateToolbar(t);
        }
        updateMode(t = this.#o.getMode()) {
          switch (this.#v(), t) {
            case y.AnnotationEditorType.NONE:
              this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
              return;
            case y.AnnotationEditorType.INK:
              this.addInkEditorIfNeeded(!1), this.disableTextSelection(), this.togglePointerEvents(!0), this.disableClick();
              break;
            case y.AnnotationEditorType.HIGHLIGHT:
              this.enableTextSelection(), this.togglePointerEvents(!1), this.disableClick();
              break;
            default:
              this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
          }
          this.toggleAnnotationLayerPointerEvents(!1);
          const {
            classList: i
          } = this.div;
          for (const l of s.#p.values())
            i.toggle(`${l._type}Editing`, t === l._editorType);
          this.div.hidden = !1;
        }
        hasTextLayer(t) {
          return t === this.#c?.div;
        }
        addInkEditorIfNeeded(t) {
          if (this.#o.getMode() !== y.AnnotationEditorType.INK)
            return;
          if (!t) {
            for (const l of this.#l.values())
              if (l.isEmpty()) {
                l.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 l of this.#l.values())
            l.enableEditing(), l.show(!0), l.annotationElementId && (this.#o.removeChangedExistingAnnotation(l), t.add(l.annotationElementId));
          if (!this.#s)
            return;
          const i = this.#s.getEditableAnnotations();
          for (const l of i) {
            if (l.hide(), this.#o.isDeletedAnnotationElement(l.data.id) || t.has(l.data.id))
              continue;
            const p = this.deserialize(l);
            p && (this.addOrRebuild(p), p.enableEditing());
          }
        }
        disable() {
          this.#u = !0, this.div.tabIndex = -1, this.togglePointerEvents(!1);
          const t = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
          for (const p of this.#l.values())
            if (p.disableEditing(), !!p.annotationElementId) {
              if (p.serialize() !== null) {
                t.set(p.annotationElementId, p);
                continue;
              } else
                i.set(p.annotationElementId, p);
              this.getEditableAnnotation(p.annotationElementId)?.show(), p.remove();
            }
          if (this.#s) {
            const p = this.#s.getEditableAnnotations();
            for (const w of p) {
              const {
                id: S
              } = w.data;
              if (this.#o.isDeletedAnnotationElement(S))
                continue;
              let L = i.get(S);
              if (L) {
                L.resetAnnotationElement(w), L.show(!1), w.show();
                continue;
              }
              L = t.get(S), L && (this.#o.addChangedExistingAnnotation(L), L.renderAnnotationElement(w), L.show(!1)), w.show();
            }
          }
          this.#v(), this.isEmpty && (this.div.hidden = !0);
          const {
            classList: l
          } = this.div;
          for (const p of s.#p.values())
            l.remove(`${p._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: i
            } = y.FeatureTest.platform;
            if (t.button !== 0 || t.ctrlKey && i)
              return;
            this.#o.showAllEditors("highlight", !0, !0), this.#c.div.classList.add("free"), d.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.#l.set(t.id, t);
          const {
            annotationElementId: i
          } = t;
          i && this.#o.isDeletedAnnotationElement(i) && this.#o.removeDeletedAnnotationElement(t);
        }
        detach(t) {
          this.#l.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), B.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 i = t.render();
              this.div.append(i), t.isAttachedToDOM = !0;
            }
            t.fixAndSetPosition(), t.onceAdded(), this.#o.addToAnnotationStorage(t), t._reportTelemetry(t.telemetryInitialData);
          }
        }
        moveEditorInDOM(t) {
          if (!t.isAttachedToDOM)
            return;
          const {
            activeElement: i
          } = document;
          t.div.contains(i) && !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
            }), i.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 i = () => t._uiManager.rebuild(t), l = () => {
            t.remove();
          };
          this.addCommands({
            cmd: i,
            undo: l,
            mustExec: !1
          });
        }
        getNextId() {
          return this.#o.getId();
        }
        get #f() {
          return s.#p.get(this.#o.getMode());
        }
        #A(t) {
          const i = this.#f;
          return i ? new i.prototype.constructor(t) : null;
        }
        canCreateNewEmptyEditor() {
          return this.#f?.canCreateNewEmptyEditor();
        }
        pasteEditor(t, i) {
          this.#o.updateToolbar(t), this.#o.updateMode(t);
          const {
            offsetX: l,
            offsetY: p
          } = this.#m(), w = this.getNextId(), S = this.#A({
            parent: this,
            id: w,
            x: l,
            y: p,
            uiManager: this.#o,
            isCentered: !0,
            ...i
          });
          S && this.add(S);
        }
        deserialize(t) {
          return s.#p.get(t.annotationType ?? t.annotationEditorType)?.deserialize(t, this, this.#o) || null;
        }
        createAndAddNewEditor(t, i, l = {}) {
          const p = this.getNextId(), w = this.#A({
            parent: this,
            id: p,
            x: t.offsetX,
            y: t.offsetY,
            uiManager: this.#o,
            isCentered: i,
            ...l
          });
          return w && this.add(w), w;
        }
        #m() {
          const {
            x: t,
            y: i,
            width: l,
            height: p
          } = this.div.getBoundingClientRect(), w = Math.max(0, t), S = Math.max(0, i), L = Math.min(window.innerWidth, t + l), M = Math.min(window.innerHeight, i + p), _ = (w + L) / 2 - t, O = (S + M) / 2 - i, [z, K] = this.viewport.rotation % 180 === 0 ? [_, O] : [O, _];
          return {
            offsetX: z,
            offsetY: K
          };
        }
        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: i
          } = y.FeatureTest.platform;
          if (!(t.button !== 0 || t.ctrlKey && i) && t.target === this.div && this.#h) {
            if (this.#h = !1, !this.#e) {
              this.#e = !0;
              return;
            }
            if (this.#o.getMode() === y.AnnotationEditorType.STAMP) {
              this.#o.unselectAll();
              return;
            }
            this.createAndAddNewEditor(t, !1);
          }
        }
        pointerdown(t) {
          if (this.#o.getMode() === y.AnnotationEditorType.HIGHLIGHT && this.enableTextSelection(), this.#h) {
            this.#h = !1;
            return;
          }
          const {
            isMac: i
          } = y.FeatureTest.platform;
          if (t.button !== 0 || t.ctrlKey && i || t.target !== this.div)
            return;
          this.#h = !0;
          const l = this.#o.getActive();
          this.#e = !l || l.isEmpty();
        }
        findNewParent(t, i, l) {
          const p = this.#o.findParent(i, l);
          return p === null || p === this ? !1 : (p.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.#l.values())
            this.#t?.removePointerInTextLayer(t.contentDiv), t.setParent(null), t.isAttachedToDOM = !1, t.div.remove();
          this.div = null, this.#l.clear(), this.#o.removeLayer(this);
        }
        #v() {
          this.#d = !0;
          for (const t of this.#l.values())
            t.isEmpty() && t.remove();
          this.#d = !1;
        }
        render({
          viewport: t
        }) {
          this.viewport = t, (0, r.setLayerDimensions)(this.div, t);
          for (const i of this.#o.getEditors(this.pageIndex))
            this.add(i), i.rebuild();
          this.updateMode();
        }
        update({
          viewport: t
        }) {
          this.#o.commitOrRemove(), this.#v();
          const i = this.viewport.rotation, l = t.rotation;
          if (this.viewport = t, (0, r.setLayerDimensions)(this.div, {
            rotation: l
          }), i !== l)
            for (const p of this.#l.values())
              p.rotate(l);
          this.addInkEditorIfNeeded(!1);
        }
        get pageDimensions() {
          const {
            pageWidth: t,
            pageHeight: i
          } = this.viewport.rawDims;
          return [t, i];
        }
        get scale() {
          return this.#o.viewParameters.realScale;
        }
      }
    }
  ),
  /***/
  259: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        ColorPicker: () => (
          /* binding */
          U
        )
        /* harmony export */
      });
      var y = V(292), B = V(830), N = V(419);
      class U {
        #t = this.#g.bind(this);
        #e = this.#A.bind(this);
        #s = null;
        #n = null;
        #r;
        #i = null;
        #a = !1;
        #l = !1;
        #h = null;
        #d;
        #u = null;
        #c;
        static get _keyboardManager() {
          return (0, y.shadow)(this, "_keyboardManager", new B.KeyboardManager([[["Escape", "mac+Escape"], U.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], U.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], U.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], U.prototype._moveToPrevious], [["Home", "mac+Home"], U.prototype._moveToBeginning], [["End", "mac+End"], U.prototype._moveToEnd]]));
        }
        constructor({
          editor: C = null,
          uiManager: E = null
        }) {
          C ? (this.#l = !1, this.#c = y.AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.#h = C) : (this.#l = !0, this.#c = y.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR), this.#u = C?._uiManager || E, this.#d = this.#u._eventBus, this.#r = C?.color || this.#u?.highlightColors.values().next().value || "#FFFF98";
        }
        renderButton() {
          const C = this.#s = document.createElement("button");
          C.className = "colorPicker", C.tabIndex = "0", C.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button"), C.setAttribute("aria-haspopup", !0), C.addEventListener("click", this.#f.bind(this)), C.addEventListener("keydown", this.#t);
          const E = this.#n = document.createElement("span");
          return E.className = "swatch", E.setAttribute("aria-hidden", !0), E.style.backgroundColor = this.#r, C.append(E), C;
        }
        renderMainDropdown() {
          const C = this.#i = this.#o();
          return C.setAttribute("aria-orientation", "horizontal"), C.setAttribute("aria-labelledby", "highlightColorPickerLabel"), C;
        }
        #o() {
          const C = document.createElement("div");
          C.addEventListener("contextmenu", N.noContextMenu), C.className = "dropdown", C.role = "listbox", C.setAttribute("aria-multiselectable", !1), C.setAttribute("aria-orientation", "vertical"), C.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown");
          for (const [E, v] of this.#u.highlightColors) {
            const r = document.createElement("button");
            r.tabIndex = "0", r.role = "option", r.setAttribute("data-color", v), r.title = E, r.setAttribute("data-l10n-id", `pdfjs-editor-colorpicker-${E}`);
            const d = document.createElement("span");
            r.append(d), d.className = "swatch", d.style.backgroundColor = v, r.setAttribute("aria-selected", v === this.#r), r.addEventListener("click", this.#p.bind(this, v)), C.append(r);
          }
          return C.addEventListener("keydown", this.#t), C;
        }
        #p(C, E) {
          E.stopPropagation(), this.#d.dispatch("switchannotationeditorparams", {
            source: this,
            type: this.#c,
            value: C
          });
        }
        _colorSelectFromKeyboard(C) {
          if (C.target === this.#s) {
            this.#f(C);
            return;
          }
          const E = C.target.getAttribute("data-color");
          E && this.#p(E, C);
        }
        _moveToNext(C) {
          if (!this.#m) {
            this.#f(C);
            return;
          }
          if (C.target === this.#s) {
            this.#i.firstChild?.focus();
            return;
          }
          C.target.nextSibling?.focus();
        }
        _moveToPrevious(C) {
          if (C.target === this.#i?.firstChild || C.target === this.#s) {
            this.#m && this._hideDropdownFromKeyboard();
            return;
          }
          this.#m || this.#f(C), C.target.previousSibling?.focus();
        }
        _moveToBeginning(C) {
          if (!this.#m) {
            this.#f(C);
            return;
          }
          this.#i.firstChild?.focus();
        }
        _moveToEnd(C) {
          if (!this.#m) {
            this.#f(C);
            return;
          }
          this.#i.lastChild?.focus();
        }
        #g(C) {
          U._keyboardManager.exec(this, C);
        }
        #f(C) {
          if (this.#m) {
            this.hideDropdown();
            return;
          }
          if (this.#a = C.detail === 0, window.addEventListener("pointerdown", this.#e), this.#i) {
            this.#i.classList.remove("hidden");
            return;
          }
          const E = this.#i = this.#o();
          this.#s.append(E);
        }
        #A(C) {
          this.#i?.contains(C.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.#l) {
            if (!this.#m) {
              this.#h?.unselect();
              return;
            }
            this.hideDropdown(), this.#s.focus({
              preventScroll: !0,
              focusVisible: this.#a
            });
          }
        }
        updateColor(C) {
          if (this.#n && (this.#n.style.backgroundColor = C), !this.#i)
            return;
          const E = this.#u.highlightColors.values();
          for (const v of this.#i.children)
            v.setAttribute("aria-selected", E.next().value === C);
        }
        destroy() {
          this.#s?.remove(), this.#s = null, this.#n = null, this.#i?.remove(), this.#i = null;
        }
      }
    }
  ),
  /***/
  310: (
    /***/
    (at, W, V) => {
      V.d(W, {
        AnnotationEditor: () => (
          /* binding */
          C
        )
      });
      var y = V(830), B = V(292), N = V(419);
      class U {
        #t = "";
        #e = !1;
        #s = null;
        #n = null;
        #r = null;
        #i = !1;
        #a = null;
        static _l10nPromise = null;
        constructor(r) {
          this.#a = r;
        }
        static initialize(r) {
          U._l10nPromise ||= r;
        }
        async render() {
          const r = this.#s = document.createElement("button");
          r.className = "altText";
          const d = await U._l10nPromise.get("pdfjs-editor-alt-text-button-label");
          r.textContent = d, r.setAttribute("aria-label", d), r.tabIndex = "0", r.addEventListener("contextmenu", N.noContextMenu), r.addEventListener("pointerdown", (b) => b.stopPropagation());
          const o = (b) => {
            b.preventDefault(), this.#a._uiManager.editAltText(this.#a);
          };
          return r.addEventListener("click", o, {
            capture: !0
          }), r.addEventListener("keydown", (b) => {
            b.target === r && b.key === "Enter" && (this.#i = !0, o(b));
          }), await this.#l(), r;
        }
        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: r,
          decorative: d
        }) {
          this.#t === r && this.#e === d || (this.#t = r, this.#e = d, this.#l());
        }
        toggle(r = !1) {
          this.#s && (!r && this.#r && (clearTimeout(this.#r), this.#r = null), this.#s.disabled = !r);
        }
        destroy() {
          this.#s?.remove(), this.#s = null, this.#n = null;
        }
        async #l() {
          const r = this.#s;
          if (!r)
            return;
          if (!this.#t && !this.#e) {
            r.classList.remove("done"), this.#n?.remove();
            return;
          }
          r.classList.add("done"), U._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then((b) => {
            r.setAttribute("aria-label", b);
          });
          let d = this.#n;
          if (!d) {
            this.#n = d = document.createElement("span"), d.className = "tooltip", d.setAttribute("role", "tooltip");
            const b = d.id = `alt-text-tooltip-${this.#a.id}`;
            r.setAttribute("aria-describedby", b);
            const s = 100;
            r.addEventListener("mouseenter", () => {
              this.#r = setTimeout(() => {
                this.#r = null, this.#n.classList.add("show"), this.#a._reportTelemetry({
                  action: "alt_text_tooltip"
                });
              }, s);
            }), r.addEventListener("mouseleave", () => {
              this.#r && (clearTimeout(this.#r), this.#r = null), this.#n?.classList.remove("show");
            });
          }
          d.innerText = this.#e ? await U._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip") : this.#t, d.parentNode || r.append(d), this.#a.getImageForAltText()?.setAttribute("aria-describedby", d.id);
        }
      }
      var P = V(362);
      class C {
        #t = null;
        #e = null;
        #s = !1;
        #n = !1;
        #r = null;
        #i = null;
        #a = this.focusin.bind(this);
        #l = this.focusout.bind(this);
        #h = null;
        #d = "";
        #u = !1;
        #c = null;
        #o = !1;
        #p = !1;
        #g = !1;
        #f = null;
        #A = 0;
        #m = 0;
        #v = null;
        _initialOptions = /* @__PURE__ */ Object.create(null);
        _isVisible = !0;
        _uiManager = null;
        _focusEventsAllowed = !0;
        _l10nPromise = null;
        #w = !1;
        #C = C._zIndex++;
        static _borderLineWidth = -1;
        static _colorManager = new y.ColorManager();
        static _zIndex = 1;
        static _telemetryTimeout = 1e3;
        static get _resizerKeyboardManager() {
          const r = C.prototype._resizeWithKeyboard, d = y.AnnotationEditorUIManager.TRANSLATE_SMALL, o = y.AnnotationEditorUIManager.TRANSLATE_BIG;
          return (0, B.shadow)(this, "_resizerKeyboardManager", new y.KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], r, {
            args: [-d, 0]
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], r, {
            args: [-o, 0]
          }], [["ArrowRight", "mac+ArrowRight"], r, {
            args: [d, 0]
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], r, {
            args: [o, 0]
          }], [["ArrowUp", "mac+ArrowUp"], r, {
            args: [0, -d]
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], r, {
            args: [0, -o]
          }], [["ArrowDown", "mac+ArrowDown"], r, {
            args: [0, d]
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], r, {
            args: [0, o]
          }], [["Escape", "mac+Escape"], C.prototype._stopResizingWithKeyboard]]));
        }
        constructor(r) {
          this.constructor === C && (0, B.unreachable)("Cannot initialize AnnotationEditor."), this.parent = r.parent, this.id = r.id, this.width = this.height = null, this.pageIndex = r.parent.pageIndex, this.name = r.name, this.div = null, this._uiManager = r.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = r.isCentered, this._structTreeParentId = null;
          const {
            rotation: d,
            rawDims: {
              pageWidth: o,
              pageHeight: b,
              pageX: s,
              pageY: g
            }
          } = this.parent.viewport;
          this.rotation = d, this.pageRotation = (360 + d - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [o, b], this.pageTranslation = [s, g];
          const [t, i] = this.parentDimensions;
          this.x = r.x / t, this.y = r.y / i, this.isAttachedToDOM = !1, this.deleted = !1;
        }
        get editorType() {
          return Object.getPrototypeOf(this).constructor._type;
        }
        static get _defaultLineColor() {
          return (0, B.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
        }
        static deleteAnnotationElement(r) {
          const d = new E({
            id: r.parent.getNextId(),
            parent: r.parent,
            uiManager: r._uiManager
          });
          d.annotationElementId = r.annotationElementId, d.deleted = !0, d._uiManager.addToAnnotationStorage(d);
        }
        static initialize(r, d, o) {
          if (C._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((s) => [s, r.get(s.replaceAll(/([A-Z])/g, (g) => `-${g.toLowerCase()}`))])), o?.strings)
            for (const s of o.strings)
              C._l10nPromise.set(s, r.get(s));
          if (C._borderLineWidth !== -1)
            return;
          const b = getComputedStyle(document.documentElement);
          C._borderLineWidth = parseFloat(b.getPropertyValue("--outline-width")) || 0;
        }
        static updateDefaultParams(r, d) {
        }
        static get defaultPropertiesToUpdate() {
          return [];
        }
        static isHandlingMimeForPasting(r) {
          return !1;
        }
        static paste(r, d) {
          (0, B.unreachable)("Not implemented");
        }
        get propertiesToUpdate() {
          return [];
        }
        get _isDraggable() {
          return this.#w;
        }
        set _isDraggable(r) {
          this.#w = r, this.div?.classList.toggle("draggable", r);
        }
        get isEnterHandled() {
          return !0;
        }
        center() {
          const [r, d] = this.pageDimensions;
          switch (this.parentRotation) {
            case 90:
              this.x -= this.height * d / (r * 2), this.y += this.width * r / (d * 2);
              break;
            case 180:
              this.x += this.width / 2, this.y += this.height / 2;
              break;
            case 270:
              this.x += this.height * d / (r * 2), this.y -= this.width * r / (d * 2);
              break;
            default:
              this.x -= this.width / 2, this.y -= this.height / 2;
              break;
          }
          this.fixAndSetPosition();
        }
        addCommands(r) {
          this._uiManager.addCommands(r);
        }
        get currentLayer() {
          return this._uiManager.currentLayer;
        }
        setInBackground() {
          this.div.style.zIndex = 0;
        }
        setInForeground() {
          this.div.style.zIndex = this.#C;
        }
        setParent(r) {
          r !== null ? (this.pageIndex = r.pageIndex, this.pageDimensions = r.pageDimensions) : this.#D(), this.parent = r;
        }
        focusin(r) {
          this._focusEventsAllowed && (this.#u ? this.#u = !1 : this.parent.setSelected(this));
        }
        focusout(r) {
          !this._focusEventsAllowed || !this.isAttachedToDOM || r.relatedTarget?.closest(`#${this.id}`) || (r.preventDefault(), this.parent?.isMultipleSelection || this.commitOrRemove());
        }
        commitOrRemove() {
          this.isEmpty() ? this.remove() : this.commit();
        }
        commit() {
          this.addToAnnotationStorage();
        }
        addToAnnotationStorage() {
          this._uiManager.addToAnnotationStorage(this);
        }
        setAt(r, d, o, b) {
          const [s, g] = this.parentDimensions;
          [o, b] = this.screenToPageTranslation(o, b), this.x = (r + o) / s, this.y = (d + b) / g, this.fixAndSetPosition();
        }
        #R([r, d], o, b) {
          [o, b] = this.screenToPageTranslation(o, b), this.x += o / r, this.y += b / d, this.fixAndSetPosition();
        }
        translate(r, d) {
          this.#R(this.parentDimensions, r, d);
        }
        translateInPage(r, d) {
          this.#c ||= [this.x, this.y], this.#R(this.pageDimensions, r, d), this.div.scrollIntoView({
            block: "nearest"
          });
        }
        drag(r, d) {
          this.#c ||= [this.x, this.y];
          const [o, b] = this.parentDimensions;
          if (this.x += r / o, this.y += d / b, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
            const {
              x: l,
              y: p
            } = this.div.getBoundingClientRect();
            this.parent.findNewParent(this, l, p) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
          }
          let {
            x: s,
            y: g
          } = this;
          const [t, i] = this.getBaseTranslation();
          s += t, g += i, this.div.style.left = `${(100 * s).toFixed(2)}%`, this.div.style.top = `${(100 * g).toFixed(2)}%`, this.div.scrollIntoView({
            block: "nearest"
          });
        }
        get _hasBeenMoved() {
          return !!this.#c && (this.#c[0] !== this.x || this.#c[1] !== this.y);
        }
        getBaseTranslation() {
          const [r, d] = this.parentDimensions, {
            _borderLineWidth: o
          } = C, b = o / r, s = o / d;
          switch (this.rotation) {
            case 90:
              return [-b, s];
            case 180:
              return [b, s];
            case 270:
              return [b, -s];
            default:
              return [-b, -s];
          }
        }
        get _mustFixPosition() {
          return !0;
        }
        fixAndSetPosition(r = this.rotation) {
          const [d, o] = this.pageDimensions;
          let {
            x: b,
            y: s,
            width: g,
            height: t
          } = this;
          if (g *= d, t *= o, b *= d, s *= o, this._mustFixPosition)
            switch (r) {
              case 0:
                b = Math.max(0, Math.min(d - g, b)), s = Math.max(0, Math.min(o - t, s));
                break;
              case 90:
                b = Math.max(0, Math.min(d - t, b)), s = Math.min(o, Math.max(g, s));
                break;
              case 180:
                b = Math.min(d, Math.max(g, b)), s = Math.min(o, Math.max(t, s));
                break;
              case 270:
                b = Math.min(d, Math.max(t, b)), s = Math.max(0, Math.min(o - g, s));
                break;
            }
          this.x = b /= d, this.y = s /= o;
          const [i, l] = this.getBaseTranslation();
          b += i, s += l;
          const {
            style: p
          } = this.div;
          p.left = `${(100 * b).toFixed(2)}%`, p.top = `${(100 * s).toFixed(2)}%`, this.moveInDOM();
        }
        static #I(r, d, o) {
          switch (o) {
            case 90:
              return [d, -r];
            case 180:
              return [-r, -d];
            case 270:
              return [-d, r];
            default:
              return [r, d];
          }
        }
        screenToPageTranslation(r, d) {
          return C.#I(r, d, this.parentRotation);
        }
        pageTranslationToScreen(r, d) {
          return C.#I(r, d, 360 - this.parentRotation);
        }
        #P(r) {
          switch (r) {
            case 90: {
              const [d, o] = this.pageDimensions;
              return [0, -d / o, o / d, 0];
            }
            case 180:
              return [-1, 0, 0, -1];
            case 270: {
              const [d, o] = this.pageDimensions;
              return [0, d / o, -o / d, 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: r,
            pageDimensions: [d, o]
          } = this, b = d * r, s = o * r;
          return B.FeatureTest.isCSSRoundSupported ? [Math.round(b), Math.round(s)] : [b, s];
        }
        setDims(r, d) {
          const [o, b] = this.parentDimensions;
          this.div.style.width = `${(100 * r / o).toFixed(2)}%`, this.#n || (this.div.style.height = `${(100 * d / b).toFixed(2)}%`);
        }
        fixDims() {
          const {
            style: r
          } = this.div, {
            height: d,
            width: o
          } = r, b = o.endsWith("%"), s = !this.#n && d.endsWith("%");
          if (b && s)
            return;
          const [g, t] = this.parentDimensions;
          b || (r.width = `${(100 * parseFloat(o) / g).toFixed(2)}%`), !this.#n && !s && (r.height = `${(100 * parseFloat(d) / t).toFixed(2)}%`);
        }
        getInitialTranslation() {
          return [0, 0];
        }
        #y() {
          if (this.#r)
            return;
          this.#r = document.createElement("div"), this.#r.classList.add("resizers");
          const r = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"];
          for (const d of r) {
            const o = document.createElement("div");
            this.#r.append(o), o.classList.add("resizer", d), o.setAttribute("data-resizer-name", d), o.addEventListener("pointerdown", this.#b.bind(this, d)), o.addEventListener("contextmenu", N.noContextMenu), o.tabIndex = -1;
          }
          this.div.prepend(this.#r);
        }
        #b(r, d) {
          d.preventDefault();
          const {
            isMac: o
          } = B.FeatureTest.platform;
          if (d.button !== 0 || d.ctrlKey && o)
            return;
          this.#e?.toggle(!1);
          const b = this.#E.bind(this, r), s = this._isDraggable;
          this._isDraggable = !1;
          const g = {
            passive: !0,
            capture: !0
          };
          this.parent.togglePointerEvents(!1), window.addEventListener("pointermove", b, g), window.addEventListener("contextmenu", N.noContextMenu);
          const t = this.x, i = this.y, l = this.width, p = this.height, w = this.parent.div.style.cursor, S = this.div.style.cursor;
          this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(d.target).cursor;
          const L = () => {
            this.parent.togglePointerEvents(!0), this.#e?.toggle(!0), this._isDraggable = s, window.removeEventListener("pointerup", L), window.removeEventListener("blur", L), window.removeEventListener("pointermove", b, g), window.removeEventListener("contextmenu", N.noContextMenu), this.parent.div.style.cursor = w, this.div.style.cursor = S, this.#S(t, i, l, p);
          };
          window.addEventListener("pointerup", L), window.addEventListener("blur", L);
        }
        #S(r, d, o, b) {
          const s = this.x, g = this.y, t = this.width, i = this.height;
          s === r && g === d && t === o && i === b || this.addCommands({
            cmd: () => {
              this.width = t, this.height = i, this.x = s, this.y = g;
              const [l, p] = this.parentDimensions;
              this.setDims(l * t, p * i), this.fixAndSetPosition();
            },
            undo: () => {
              this.width = o, this.height = b, this.x = r, this.y = d;
              const [l, p] = this.parentDimensions;
              this.setDims(l * o, p * b), this.fixAndSetPosition();
            },
            mustExec: !0
          });
        }
        #E(r, d) {
          const [o, b] = this.parentDimensions, s = this.x, g = this.y, t = this.width, i = this.height, l = C.MIN_SIZE / o, p = C.MIN_SIZE / b, w = (m) => Math.round(m * 1e4) / 1e4, S = this.#P(this.rotation), L = (m, c) => [S[0] * m + S[2] * c, S[1] * m + S[3] * c], M = this.#P(360 - this.rotation), _ = (m, c) => [M[0] * m + M[2] * c, M[1] * m + M[3] * c];
          let O, z, K = !1, nt = !1;
          switch (r) {
            case "topLeft":
              K = !0, O = (m, c) => [0, 0], z = (m, c) => [m, c];
              break;
            case "topMiddle":
              O = (m, c) => [m / 2, 0], z = (m, c) => [m / 2, c];
              break;
            case "topRight":
              K = !0, O = (m, c) => [m, 0], z = (m, c) => [0, c];
              break;
            case "middleRight":
              nt = !0, O = (m, c) => [m, c / 2], z = (m, c) => [0, c / 2];
              break;
            case "bottomRight":
              K = !0, O = (m, c) => [m, c], z = (m, c) => [0, 0];
              break;
            case "bottomMiddle":
              O = (m, c) => [m / 2, c], z = (m, c) => [m / 2, 0];
              break;
            case "bottomLeft":
              K = !0, O = (m, c) => [0, c], z = (m, c) => [m, 0];
              break;
            case "middleLeft":
              nt = !0, O = (m, c) => [0, c / 2], z = (m, c) => [m, c / 2];
              break;
          }
          const j = O(t, i), H = z(t, i);
          let G = L(...H);
          const Y = w(s + G[0]), et = w(g + G[1]);
          let tt = 1, ot = 1, [ct, pt] = this.screenToPageTranslation(d.movementX, d.movementY);
          if ([ct, pt] = _(ct / o, pt / b), K) {
            const m = Math.hypot(t, i);
            tt = ot = Math.max(Math.min(Math.hypot(H[0] - j[0] - ct, H[1] - j[1] - pt) / m, 1 / t, 1 / i), l / t, p / i);
          } else
            nt ? tt = Math.max(l, Math.min(1, Math.abs(H[0] - j[0] - ct))) / t : ot = Math.max(p, Math.min(1, Math.abs(H[1] - j[1] - pt))) / i;
          const dt = w(t * tt), ht = w(i * ot);
          G = L(...z(dt, ht));
          const ut = Y - G[0], st = et - G[1];
          this.width = dt, this.height = ht, this.x = ut, this.y = st, this.setDims(o * dt, b * ht), this.fixAndSetPosition();
        }
        altTextFinish() {
          this.#e?.finish();
        }
        async addEditToolbar() {
          return this.#h || this.#p ? this.#h : (this.#h = new P.EditorToolbar(this), this.div.append(this.#h.render()), this.#e && this.#h.addAltTextButton(await this.#e.render()), this.#h);
        }
        removeEditToolbar() {
          this.#h && (this.#h.remove(), this.#h = null, this.#e?.destroy());
        }
        getClientDimensions() {
          return this.div.getBoundingClientRect();
        }
        async addAltTextButton() {
          this.#e || (U.initialize(C._l10nPromise), this.#e = new U(this), await this.addEditToolbar());
        }
        get altTextData() {
          return this.#e?.data;
        }
        set altTextData(r) {
          this.#e && (this.#e.data = r);
        }
        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.#l);
          const [r, d] = this.parentDimensions;
          this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * d / r).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * r / d).toFixed(2)}%`);
          const [o, b] = this.getInitialTranslation();
          return this.translate(o, b), (0, y.bindEvents)(this, this.div, ["pointerdown"]), this.div;
        }
        pointerdown(r) {
          const {
            isMac: d
          } = B.FeatureTest.platform;
          if (r.button !== 0 || r.ctrlKey && d) {
            r.preventDefault();
            return;
          }
          if (this.#u = !0, this._isDraggable) {
            this.#T(r);
            return;
          }
          this.#k(r);
        }
        #k(r) {
          const {
            isMac: d
          } = B.FeatureTest.platform;
          r.ctrlKey && !d || r.shiftKey || r.metaKey && d ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
        }
        #T(r) {
          const d = this._uiManager.isSelected(this);
          this._uiManager.setUpDragSession();
          let o, b;
          d && (this.div.classList.add("moving"), o = {
            passive: !0,
            capture: !0
          }, this.#A = r.clientX, this.#m = r.clientY, b = (g) => {
            const {
              clientX: t,
              clientY: i
            } = g, [l, p] = this.screenToPageTranslation(t - this.#A, i - this.#m);
            this.#A = t, this.#m = i, this._uiManager.dragSelectedEditors(l, p);
          }, window.addEventListener("pointermove", b, o));
          const s = () => {
            window.removeEventListener("pointerup", s), window.removeEventListener("blur", s), d && (this.div.classList.remove("moving"), window.removeEventListener("pointermove", b, o)), this.#u = !1, this._uiManager.endDragSession() || this.#k(r);
          };
          window.addEventListener("pointerup", s), window.addEventListener("blur", s);
        }
        moveInDOM() {
          this.#f && clearTimeout(this.#f), this.#f = setTimeout(() => {
            this.#f = null, this.parent?.moveEditorInDOM(this);
          }, 0);
        }
        _setParentAndPosition(r, d, o) {
          r.changeParent(this), this.x = d, this.y = o, this.fixAndSetPosition();
        }
        getRect(r, d, o = this.rotation) {
          const b = this.parentScale, [s, g] = this.pageDimensions, [t, i] = this.pageTranslation, l = r / b, p = d / b, w = this.x * s, S = this.y * g, L = this.width * s, M = this.height * g;
          switch (o) {
            case 0:
              return [w + l + t, g - S - p - M + i, w + l + L + t, g - S - p + i];
            case 90:
              return [w + p + t, g - S + l + i, w + p + M + t, g - S + l + L + i];
            case 180:
              return [w - l - L + t, g - S + p + i, w - l + t, g - S + p + M + i];
            case 270:
              return [w - p - M + t, g - S - l - L + i, w - p + t, g - S - l + i];
            default:
              throw new Error("Invalid rotation");
          }
        }
        getRectInCurrentCoords(r, d) {
          const [o, b, s, g] = r, t = s - o, i = g - b;
          switch (this.rotation) {
            case 0:
              return [o, d - g, t, i];
            case 90:
              return [o, d - b, i, t];
            case 180:
              return [s, d - b, t, i];
            case 270:
              return [s, d - g, i, 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.#l);
        }
        rotate(r) {
        }
        serialize(r = !1, d = null) {
          (0, B.unreachable)("An editor must be serializable");
        }
        static deserialize(r, d, o) {
          const b = new this.prototype.constructor({
            parent: d,
            id: d.getNextId(),
            uiManager: o
          });
          b.rotation = r.rotation;
          const [s, g] = b.pageDimensions, [t, i, l, p] = b.getRectInCurrentCoords(r.rect, g);
          return b.x = t / s, b.y = i / g, b.width = l / s, b.height = p / g, b;
        }
        get hasBeenModified() {
          return !!this.annotationElementId && (this.deleted || this.serialize() !== null);
        }
        remove() {
          if (this.div.removeEventListener("focusin", this.#a), this.div.removeEventListener("focusout", this.#l), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), this.#f && (clearTimeout(this.#f), this.#f = null), this.#D(), this.removeEditToolbar(), this.#v) {
            for (const r of this.#v.values())
              clearTimeout(r);
            this.#v = null;
          }
          this.parent = null;
        }
        get isResizable() {
          return !1;
        }
        makeResizable() {
          this.isResizable && (this.#y(), this.#r.classList.remove("hidden"), (0, y.bindEvents)(this, this.div, ["keydown"]));
        }
        get toolbarPosition() {
          return null;
        }
        keydown(r) {
          if (!this.isResizable || r.target !== this.div || r.key !== "Enter")
            return;
          this._uiManager.setSelected(this), this.#i = {
            savedX: this.x,
            savedY: this.y,
            savedWidth: this.width,
            savedHeight: this.height
          };
          const d = this.#r.children;
          if (!this.#t) {
            this.#t = Array.from(d);
            const g = this.#M.bind(this), t = this.#F.bind(this);
            for (const i of this.#t) {
              const l = i.getAttribute("data-resizer-name");
              i.setAttribute("role", "spinbutton"), i.addEventListener("keydown", g), i.addEventListener("blur", t), i.addEventListener("focus", this.#N.bind(this, l)), C._l10nPromise.get(`pdfjs-editor-resizer-label-${l}`).then((p) => i.setAttribute("aria-label", p));
            }
          }
          const o = this.#t[0];
          let b = 0;
          for (const g of d) {
            if (g === o)
              break;
            b++;
          }
          const s = (360 - this.rotation + this.parentRotation) % 360 / 90 * (this.#t.length / 4);
          if (s !== b) {
            if (s < b)
              for (let t = 0; t < b - s; t++)
                this.#r.append(this.#r.firstChild);
            else if (s > b)
              for (let t = 0; t < s - b; t++)
                this.#r.firstChild.before(this.#r.lastChild);
            let g = 0;
            for (const t of d) {
              const l = this.#t[g++].getAttribute("data-resizer-name");
              C._l10nPromise.get(`pdfjs-editor-resizer-label-${l}`).then((p) => t.setAttribute("aria-label", p));
            }
          }
          this.#L(0), this.#g = !0, this.#r.firstChild.focus({
            focusVisible: !0
          }), r.preventDefault(), r.stopImmediatePropagation();
        }
        #M(r) {
          C._resizerKeyboardManager.exec(this, r);
        }
        #F(r) {
          this.#g && r.relatedTarget?.parentNode !== this.#r && this.#D();
        }
        #N(r) {
          this.#d = this.#g ? r : "";
        }
        #L(r) {
          if (this.#t)
            for (const d of this.#t)
              d.tabIndex = r;
        }
        _resizeWithKeyboard(r, d) {
          this.#g && this.#E(this.#d, {
            movementX: r,
            movementY: d
          });
        }
        #D() {
          if (this.#g = !1, this.#L(-1), this.#i) {
            const {
              savedX: r,
              savedY: d,
              savedWidth: o,
              savedHeight: b
            } = this.#i;
            this.#S(r, d, o, b), this.#i = null;
          }
        }
        _stopResizingWithKeyboard() {
          this.#D(), this.div.focus();
        }
        select() {
          if (this.makeResizable(), this.div?.classList.add("selectedEditor"), !this.#h) {
            this.addEditToolbar().then(() => {
              this.div?.classList.contains("selectedEditor") && this.#h?.show();
            });
            return;
          }
          this.#h?.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.#h?.hide();
        }
        updateParams(r, d) {
        }
        disableEditing() {
        }
        enableEditing() {
        }
        enterInEditMode() {
        }
        getImageForAltText() {
          return null;
        }
        get contentDiv() {
          return this.div;
        }
        get isEditing() {
          return this.#o;
        }
        set isEditing(r) {
          this.#o = r, this.parent && (r ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
        }
        setAspectRatio(r, d) {
          this.#n = !0;
          const o = r / d, {
            style: b
          } = this.div;
          b.aspectRatio = o, b.height = "auto";
        }
        static get MIN_SIZE() {
          return 16;
        }
        static canCreateNewEmptyEditor() {
          return !0;
        }
        get telemetryInitialData() {
          return {
            action: "added"
          };
        }
        get telemetryFinalData() {
          return null;
        }
        _reportTelemetry(r, d = !1) {
          if (d) {
            this.#v ||= /* @__PURE__ */ new Map();
            const {
              action: o
            } = r;
            let b = this.#v.get(o);
            b && clearTimeout(b), b = setTimeout(() => {
              this._reportTelemetry(r), this.#v.delete(o), this.#v.size === 0 && (this.#v = null);
            }, C._telemetryTimeout), this.#v.set(o, b);
            return;
          }
          r.type ||= this.editorType, this._uiManager._eventBus.dispatch("reporttelemetry", {
            source: this,
            details: {
              type: "editing",
              data: r
            }
          });
        }
        show(r = this._isVisible) {
          this.div.classList.toggle("hidden", !r), this._isVisible = r;
        }
        enable() {
          this.div && (this.div.tabIndex = 0), this.#s = !1;
        }
        disable() {
          this.div && (this.div.tabIndex = -1), this.#s = !0;
        }
        renderAnnotationElement(r) {
          let d = r.container.querySelector(".annotationContent");
          if (!d)
            d = document.createElement("div"), d.classList.add("annotationContent", this.editorType), r.container.prepend(d);
          else if (d.nodeName === "CANVAS") {
            const o = d;
            d = document.createElement("div"), d.classList.add("annotationContent", this.editorType), o.before(d);
          }
          return d;
        }
        resetAnnotationElement(r) {
          const {
            firstChild: d
          } = r.container;
          d.nodeName === "DIV" && d.classList.contains("annotationContent") && d.remove();
        }
      }
      class E extends C {
        constructor(r) {
          super(r), this.annotationElementId = r.annotationElementId, this.deleted = !0;
        }
        serialize() {
          return {
            id: this.annotationElementId,
            deleted: !0,
            pageIndex: this.pageIndex
          };
        }
      }
    }
  ),
  /***/
  61: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        FreeOutliner: () => (
          /* binding */
          P
        ),
        /* harmony export */
        Outliner: () => (
          /* binding */
          B
        )
        /* harmony export */
      });
      var y = V(292);
      class B {
        #t;
        #e = [];
        #s = [];
        constructor(v, r = 0, d = 0, o = !0) {
          let b = 1 / 0, s = -1 / 0, g = 1 / 0, t = -1 / 0;
          const l = 10 ** -4;
          for (const {
            x: O,
            y: z,
            width: K,
            height: nt
          } of v) {
            const j = Math.floor((O - r) / l) * l, H = Math.ceil((O + K + r) / l) * l, G = Math.floor((z - r) / l) * l, Y = Math.ceil((z + nt + r) / l) * l, et = [j, G, Y, !0], tt = [H, G, Y, !1];
            this.#e.push(et, tt), b = Math.min(b, j), s = Math.max(s, H), g = Math.min(g, G), t = Math.max(t, Y);
          }
          const p = s - b + 2 * d, w = t - g + 2 * d, S = b - d, L = g - d, M = this.#e.at(o ? -1 : -2), _ = [M[0], M[2]];
          for (const O of this.#e) {
            const [z, K, nt] = O;
            O[0] = (z - S) / p, O[1] = (K - L) / w, O[2] = (nt - L) / w;
          }
          this.#t = {
            x: S,
            y: L,
            width: p,
            height: w,
            lastPoint: _
          };
        }
        getOutlines() {
          this.#e.sort((r, d) => r[0] - d[0] || r[1] - d[1] || r[2] - d[2]);
          const v = [];
          for (const r of this.#e)
            r[3] ? (v.push(...this.#l(r)), this.#i(r)) : (this.#a(r), v.push(...this.#l(r)));
          return this.#n(v);
        }
        #n(v) {
          const r = [], d = /* @__PURE__ */ new Set();
          for (const s of v) {
            const [g, t, i] = s;
            r.push([g, t, s], [g, i, s]);
          }
          r.sort((s, g) => s[1] - g[1] || s[0] - g[0]);
          for (let s = 0, g = r.length; s < g; s += 2) {
            const t = r[s][2], i = r[s + 1][2];
            t.push(i), i.push(t), d.add(t), d.add(i);
          }
          const o = [];
          let b;
          for (; d.size > 0; ) {
            const s = d.values().next().value;
            let [g, t, i, l, p] = s;
            d.delete(s);
            let w = g, S = t;
            for (b = [g, i], o.push(b); ; ) {
              let L;
              if (d.has(l))
                L = l;
              else if (d.has(p))
                L = p;
              else
                break;
              d.delete(L), [g, t, i, l, p] = L, w !== g && (b.push(w, S, g, S === t ? t : i), w = g), S = S === t ? i : t;
            }
            b.push(w, S);
          }
          return new U(o, this.#t);
        }
        #r(v) {
          const r = this.#s;
          let d = 0, o = r.length - 1;
          for (; d <= o; ) {
            const b = d + o >> 1, s = r[b][0];
            if (s === v)
              return b;
            s < v ? d = b + 1 : o = b - 1;
          }
          return o + 1;
        }
        #i([, v, r]) {
          const d = this.#r(v);
          this.#s.splice(d, 0, [v, r]);
        }
        #a([, v, r]) {
          const d = this.#r(v);
          for (let o = d; o < this.#s.length; o++) {
            const [b, s] = this.#s[o];
            if (b !== v)
              break;
            if (b === v && s === r) {
              this.#s.splice(o, 1);
              return;
            }
          }
          for (let o = d - 1; o >= 0; o--) {
            const [b, s] = this.#s[o];
            if (b !== v)
              break;
            if (b === v && s === r) {
              this.#s.splice(o, 1);
              return;
            }
          }
        }
        #l(v) {
          const [r, d, o] = v, b = [[r, d, o]], s = this.#r(o);
          for (let g = 0; g < s; g++) {
            const [t, i] = this.#s[g];
            for (let l = 0, p = b.length; l < p; l++) {
              const [, w, S] = b[l];
              if (!(i <= w || S <= t)) {
                if (w >= t) {
                  if (S > i)
                    b[l][1] = i;
                  else {
                    if (p === 1)
                      return [];
                    b.splice(l, 1), l--, p--;
                  }
                  continue;
                }
                b[l][2] = t, S > i && b.push([r, i, S]);
              }
            }
          }
          return b;
        }
      }
      class N {
        toSVGPath() {
          throw new Error("Abstract method `toSVGPath` must be implemented.");
        }
        get box() {
          throw new Error("Abstract getter `box` must be implemented.");
        }
        serialize(v, r) {
          throw new Error("Abstract method `serialize` must be implemented.");
        }
        get free() {
          return this instanceof C;
        }
      }
      class U extends N {
        #t;
        #e;
        constructor(v, r) {
          super(), this.#e = v, this.#t = r;
        }
        toSVGPath() {
          const v = [];
          for (const r of this.#e) {
            let [d, o] = r;
            v.push(`M${d} ${o}`);
            for (let b = 2; b < r.length; b += 2) {
              const s = r[b], g = r[b + 1];
              s === d ? (v.push(`V${g}`), o = g) : g === o && (v.push(`H${s}`), d = s);
            }
            v.push("Z");
          }
          return v.join(" ");
        }
        serialize([v, r, d, o], b) {
          const s = [], g = d - v, t = o - r;
          for (const i of this.#e) {
            const l = new Array(i.length);
            for (let p = 0; p < i.length; p += 2)
              l[p] = v + i[p] * g, l[p + 1] = o - i[p + 1] * t;
            s.push(l);
          }
          return s;
        }
        get box() {
          return this.#t;
        }
      }
      class P {
        #t;
        #e = [];
        #s;
        #n;
        #r = [];
        #i = new Float64Array(18);
        #a;
        #l;
        #h;
        #d;
        #u;
        #c;
        #o = [];
        static #p = 8;
        static #g = 2;
        static #f = P.#p + P.#g;
        constructor({
          x: v,
          y: r
        }, d, o, b, s, g = 0) {
          this.#t = d, this.#c = b * o, this.#n = s, this.#i.set([NaN, NaN, NaN, NaN, v, r], 6), this.#s = g, this.#d = P.#p * o, this.#h = P.#f * o, this.#u = o, this.#o.push(v, r);
        }
        get free() {
          return !0;
        }
        isEmpty() {
          return isNaN(this.#i[8]);
        }
        #A() {
          const v = this.#i.subarray(4, 6), r = this.#i.subarray(16, 18), [d, o, b, s] = this.#t;
          return [(this.#a + (v[0] - r[0]) / 2 - d) / b, (this.#l + (v[1] - r[1]) / 2 - o) / s, (this.#a + (r[0] - v[0]) / 2 - d) / b, (this.#l + (r[1] - v[1]) / 2 - o) / s];
        }
        add({
          x: v,
          y: r
        }) {
          this.#a = v, this.#l = r;
          const [d, o, b, s] = this.#t;
          let [g, t, i, l] = this.#i.subarray(8, 12);
          const p = v - i, w = r - l, S = Math.hypot(p, w);
          if (S < this.#h)
            return !1;
          const L = S - this.#d, M = L / S, _ = M * p, O = M * w;
          let z = g, K = t;
          g = i, t = l, i += _, l += O, this.#o?.push(v, r);
          const nt = -O / L, j = _ / L, H = nt * this.#c, G = j * this.#c;
          return this.#i.set(this.#i.subarray(2, 8), 0), this.#i.set([i + H, l + G], 4), this.#i.set(this.#i.subarray(14, 18), 12), this.#i.set([i - H, l - G], 16), isNaN(this.#i[6]) ? (this.#r.length === 0 && (this.#i.set([g + H, t + G], 2), this.#r.push(NaN, NaN, NaN, NaN, (g + H - d) / b, (t + G - o) / s), this.#i.set([g - H, t - G], 14), this.#e.push(NaN, NaN, NaN, NaN, (g - H - d) / b, (t - G - o) / s)), this.#i.set([z, K, g, t, i, l], 6), !this.isEmpty()) : (this.#i.set([z, K, g, t, i, l], 6), Math.abs(Math.atan2(K - t, z - g) - Math.atan2(O, _)) < Math.PI / 2 ? ([g, t, i, l] = this.#i.subarray(2, 6), this.#r.push(NaN, NaN, NaN, NaN, ((g + i) / 2 - d) / b, ((t + l) / 2 - o) / s), [g, t, z, K] = this.#i.subarray(14, 18), this.#e.push(NaN, NaN, NaN, NaN, ((z + g) / 2 - d) / b, ((K + t) / 2 - o) / s), !0) : ([z, K, g, t, i, l] = this.#i.subarray(0, 6), this.#r.push(((z + 5 * g) / 6 - d) / b, ((K + 5 * t) / 6 - o) / s, ((5 * g + i) / 6 - d) / b, ((5 * t + l) / 6 - o) / s, ((g + i) / 2 - d) / b, ((t + l) / 2 - o) / s), [i, l, g, t, z, K] = this.#i.subarray(12, 18), this.#e.push(((z + 5 * g) / 6 - d) / b, ((K + 5 * t) / 6 - o) / s, ((5 * g + i) / 6 - d) / b, ((5 * t + l) / 6 - o) / s, ((g + i) / 2 - d) / b, ((t + l) / 2 - o) / s), !0));
        }
        toSVGPath() {
          if (this.isEmpty())
            return "";
          const v = this.#r, r = this.#e, d = this.#i.subarray(4, 6), o = this.#i.subarray(16, 18), [b, s, g, t] = this.#t, [i, l, p, w] = this.#A();
          if (isNaN(this.#i[6]) && !this.isEmpty())
            return `M${(this.#i[2] - b) / g} ${(this.#i[3] - s) / t} L${(this.#i[4] - b) / g} ${(this.#i[5] - s) / t} L${i} ${l} L${p} ${w} L${(this.#i[16] - b) / g} ${(this.#i[17] - s) / t} L${(this.#i[14] - b) / g} ${(this.#i[15] - s) / t} Z`;
          const S = [];
          S.push(`M${v[4]} ${v[5]}`);
          for (let L = 6; L < v.length; L += 6)
            isNaN(v[L]) ? S.push(`L${v[L + 4]} ${v[L + 5]}`) : S.push(`C${v[L]} ${v[L + 1]} ${v[L + 2]} ${v[L + 3]} ${v[L + 4]} ${v[L + 5]}`);
          S.push(`L${(d[0] - b) / g} ${(d[1] - s) / t} L${i} ${l} L${p} ${w} L${(o[0] - b) / g} ${(o[1] - s) / t}`);
          for (let L = r.length - 6; L >= 6; L -= 6)
            isNaN(r[L]) ? S.push(`L${r[L + 4]} ${r[L + 5]}`) : S.push(`C${r[L]} ${r[L + 1]} ${r[L + 2]} ${r[L + 3]} ${r[L + 4]} ${r[L + 5]}`);
          return S.push(`L${r[4]} ${r[5]} Z`), S.join(" ");
        }
        getOutlines() {
          const v = this.#r, r = this.#e, d = this.#i, o = d.subarray(4, 6), b = d.subarray(16, 18), [s, g, t, i] = this.#t, l = new Float64Array((this.#o?.length ?? 0) + 2);
          for (let O = 0, z = l.length - 2; O < z; O += 2)
            l[O] = (this.#o[O] - s) / t, l[O + 1] = (this.#o[O + 1] - g) / i;
          l[l.length - 2] = (this.#a - s) / t, l[l.length - 1] = (this.#l - g) / i;
          const [p, w, S, L] = this.#A();
          if (isNaN(d[6]) && !this.isEmpty()) {
            const O = new Float64Array(36);
            return O.set([NaN, NaN, NaN, NaN, (d[2] - s) / t, (d[3] - g) / i, NaN, NaN, NaN, NaN, (d[4] - s) / t, (d[5] - g) / i, NaN, NaN, NaN, NaN, p, w, NaN, NaN, NaN, NaN, S, L, NaN, NaN, NaN, NaN, (d[16] - s) / t, (d[17] - g) / i, NaN, NaN, NaN, NaN, (d[14] - s) / t, (d[15] - g) / i], 0), new C(O, l, this.#t, this.#u, this.#s, this.#n);
          }
          const M = new Float64Array(this.#r.length + 24 + this.#e.length);
          let _ = v.length;
          for (let O = 0; O < _; O += 2) {
            if (isNaN(v[O])) {
              M[O] = M[O + 1] = NaN;
              continue;
            }
            M[O] = v[O], M[O + 1] = v[O + 1];
          }
          M.set([NaN, NaN, NaN, NaN, (o[0] - s) / t, (o[1] - g) / i, NaN, NaN, NaN, NaN, p, w, NaN, NaN, NaN, NaN, S, L, NaN, NaN, NaN, NaN, (b[0] - s) / t, (b[1] - g) / i], _), _ += 24;
          for (let O = r.length - 6; O >= 6; O -= 6)
            for (let z = 0; z < 6; z += 2) {
              if (isNaN(r[O + z])) {
                M[_] = M[_ + 1] = NaN, _ += 2;
                continue;
              }
              M[_] = r[O + z], M[_ + 1] = r[O + z + 1], _ += 2;
            }
          return M.set([NaN, NaN, NaN, NaN, r[4], r[5]], _), new C(M, l, this.#t, this.#u, this.#s, this.#n);
        }
      }
      class C extends N {
        #t;
        #e = null;
        #s;
        #n;
        #r;
        #i;
        #a;
        constructor(v, r, d, o, b, s) {
          super(), this.#a = v, this.#r = r, this.#t = d, this.#i = o, this.#s = b, this.#n = s, this.#d(s);
          const {
            x: g,
            y: t,
            width: i,
            height: l
          } = this.#e;
          for (let p = 0, w = v.length; p < w; p += 2)
            v[p] = (v[p] - g) / i, v[p + 1] = (v[p + 1] - t) / l;
          for (let p = 0, w = r.length; p < w; p += 2)
            r[p] = (r[p] - g) / i, r[p + 1] = (r[p + 1] - t) / l;
        }
        toSVGPath() {
          const v = [`M${this.#a[4]} ${this.#a[5]}`];
          for (let r = 6, d = this.#a.length; r < d; r += 6) {
            if (isNaN(this.#a[r])) {
              v.push(`L${this.#a[r + 4]} ${this.#a[r + 5]}`);
              continue;
            }
            v.push(`C${this.#a[r]} ${this.#a[r + 1]} ${this.#a[r + 2]} ${this.#a[r + 3]} ${this.#a[r + 4]} ${this.#a[r + 5]}`);
          }
          return v.push("Z"), v.join(" ");
        }
        serialize([v, r, d, o], b) {
          const s = d - v, g = o - r;
          let t, i;
          switch (b) {
            case 0:
              t = this.#l(this.#a, v, o, s, -g), i = this.#l(this.#r, v, o, s, -g);
              break;
            case 90:
              t = this.#h(this.#a, v, r, s, g), i = this.#h(this.#r, v, r, s, g);
              break;
            case 180:
              t = this.#l(this.#a, d, r, -s, g), i = this.#l(this.#r, d, r, -s, g);
              break;
            case 270:
              t = this.#h(this.#a, d, o, -s, -g), i = this.#h(this.#r, d, o, -s, -g);
              break;
          }
          return {
            outline: Array.from(t),
            points: [Array.from(i)]
          };
        }
        #l(v, r, d, o, b) {
          const s = new Float64Array(v.length);
          for (let g = 0, t = v.length; g < t; g += 2)
            s[g] = r + v[g] * o, s[g + 1] = d + v[g + 1] * b;
          return s;
        }
        #h(v, r, d, o, b) {
          const s = new Float64Array(v.length);
          for (let g = 0, t = v.length; g < t; g += 2)
            s[g] = r + v[g + 1] * o, s[g + 1] = d + v[g] * b;
          return s;
        }
        #d(v) {
          const r = this.#a;
          let d = r[4], o = r[5], b = d, s = o, g = d, t = o, i = d, l = o;
          const p = v ? Math.max : Math.min;
          for (let _ = 6, O = r.length; _ < O; _ += 6) {
            if (isNaN(r[_]))
              b = Math.min(b, r[_ + 4]), s = Math.min(s, r[_ + 5]), g = Math.max(g, r[_ + 4]), t = Math.max(t, r[_ + 5]), l < r[_ + 5] ? (i = r[_ + 4], l = r[_ + 5]) : l === r[_ + 5] && (i = p(i, r[_ + 4]));
            else {
              const z = y.Util.bezierBoundingBox(d, o, ...r.slice(_, _ + 6));
              b = Math.min(b, z[0]), s = Math.min(s, z[1]), g = Math.max(g, z[2]), t = Math.max(t, z[3]), l < z[3] ? (i = z[2], l = z[3]) : l === z[3] && (i = p(i, z[2]));
            }
            d = r[_ + 4], o = r[_ + 5];
          }
          const w = b - this.#s, S = s - this.#s, L = g - b + 2 * this.#s, M = t - s + 2 * this.#s;
          this.#e = {
            x: w,
            y: S,
            width: L,
            height: M,
            lastPoint: [i, l]
          };
        }
        get box() {
          return this.#e;
        }
        getNewOutline(v, r) {
          const {
            x: d,
            y: o,
            width: b,
            height: s
          } = this.#e, [g, t, i, l] = this.#t, p = b * i, w = s * l, S = d * i + g, L = o * l + t, M = new P({
            x: this.#r[0] * p + S,
            y: this.#r[1] * w + L
          }, this.#t, this.#i, v, this.#n, r ?? this.#s);
          for (let _ = 2; _ < this.#r.length; _ += 2)
            M.add({
              x: this.#r[_] * p + S,
              y: this.#r[_ + 1] * w + L
            });
          return M.getOutlines();
        }
      }
    }
  ),
  /***/
  362: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        EditorToolbar: () => (
          /* binding */
          B
        ),
        /* harmony export */
        HighlightToolbar: () => (
          /* binding */
          N
        )
        /* harmony export */
      });
      var y = V(419);
      class B {
        #t = null;
        #e = null;
        #s;
        #n = null;
        constructor(P) {
          this.#s = P;
        }
        render() {
          const P = this.#t = document.createElement("div");
          P.className = "editToolbar", P.setAttribute("role", "toolbar"), P.addEventListener("contextmenu", y.noContextMenu), P.addEventListener("pointerdown", B.#r);
          const C = this.#n = document.createElement("div");
          C.className = "buttons", P.append(C);
          const E = this.#s.toolbarPosition;
          if (E) {
            const {
              style: v
            } = P, r = this.#s._uiManager.direction === "ltr" ? 1 - E[0] : E[0];
            v.insetInlineEnd = `${100 * r}%`, v.top = `calc(${100 * E[1]}% + var(--editor-toolbar-vert-offset))`;
          }
          return this.#h(), P;
        }
        static #r(P) {
          P.stopPropagation();
        }
        #i(P) {
          this.#s._focusEventsAllowed = !1, P.preventDefault(), P.stopPropagation();
        }
        #a(P) {
          this.#s._focusEventsAllowed = !0, P.preventDefault(), P.stopPropagation();
        }
        #l(P) {
          P.addEventListener("focusin", this.#i.bind(this), {
            capture: !0
          }), P.addEventListener("focusout", this.#a.bind(this), {
            capture: !0
          }), P.addEventListener("contextmenu", y.noContextMenu);
        }
        hide() {
          this.#t.classList.add("hidden"), this.#e?.hideDropdown();
        }
        show() {
          this.#t.classList.remove("hidden");
        }
        #h() {
          const P = document.createElement("button");
          P.className = "delete", P.tabIndex = 0, P.setAttribute("data-l10n-id", `pdfjs-editor-remove-${this.#s.editorType}-button`), this.#l(P), P.addEventListener("click", (C) => {
            this.#s._uiManager.delete();
          }), this.#n.append(P);
        }
        get #d() {
          const P = document.createElement("div");
          return P.className = "divider", P;
        }
        addAltTextButton(P) {
          this.#l(P), this.#n.prepend(P, this.#d);
        }
        addColorPicker(P) {
          this.#e = P;
          const C = P.renderButton();
          this.#l(C), this.#n.prepend(C, this.#d);
        }
        remove() {
          this.#t.remove(), this.#e?.destroy(), this.#e = null;
        }
      }
      class N {
        #t = null;
        #e = null;
        #s;
        constructor(P) {
          this.#s = P;
        }
        #n() {
          const P = this.#e = document.createElement("div");
          P.className = "editToolbar", P.setAttribute("role", "toolbar"), P.addEventListener("contextmenu", y.noContextMenu);
          const C = this.#t = document.createElement("div");
          return C.className = "buttons", P.append(C), this.#i(), P;
        }
        #r(P, C) {
          let E = 0, v = 0;
          for (const r of P) {
            const d = r.y + r.height;
            if (d < E)
              continue;
            const o = r.x + (C ? r.width : 0);
            if (d > E) {
              v = o, E = d;
              continue;
            }
            C ? o > v && (v = o) : o < v && (v = o);
          }
          return [C ? 1 - v : v, E];
        }
        show(P, C, E) {
          const [v, r] = this.#r(C, E), {
            style: d
          } = this.#e ||= this.#n();
          P.append(this.#e), d.insetInlineEnd = `${100 * v}%`, d.top = `calc(${100 * r}% + var(--editor-toolbar-vert-offset))`;
        }
        hide() {
          this.#e.remove();
        }
        #i() {
          const P = document.createElement("button");
          P.className = "highlightButton", P.tabIndex = 0, P.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button1");
          const C = document.createElement("span");
          P.append(C), C.className = "visuallyHidden", C.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label"), P.addEventListener("contextmenu", y.noContextMenu), P.addEventListener("click", () => {
            this.#s.highlightSelection("floating_button");
          }), this.#t.append(P);
        }
      }
    }
  ),
  /***/
  830: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        AnnotationEditorUIManager: () => (
          /* binding */
          o
        ),
        /* harmony export */
        ColorManager: () => (
          /* binding */
          d
        ),
        /* harmony export */
        KeyboardManager: () => (
          /* binding */
          r
        ),
        /* harmony export */
        bindEvents: () => (
          /* binding */
          U
        ),
        /* harmony export */
        opacityToHex: () => (
          /* binding */
          P
        )
        /* harmony export */
      });
      var y = V(292), B = V(419), N = V(362);
      function U(b, s, g) {
        for (const t of g)
          s.addEventListener(t, b[t].bind(b));
      }
      function P(b) {
        return Math.round(Math.min(255, Math.max(1, 255 * b))).toString(16).padStart(2, "0");
      }
      class C {
        #t = 0;
        constructor() {
        }
        get id() {
          return `${y.AnnotationEditorPrefix}${this.#t++}`;
        }
      }
      class E {
        #t = (0, y.getUuid)();
        #e = 0;
        #s = null;
        static get _isSVGFittingCanvas() {
          const s = '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"), i = new Image();
          i.src = s;
          const l = i.decode().then(() => (t.drawImage(i, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(t.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
          return (0, y.shadow)(this, "_isSVGFittingCanvas", l);
        }
        async #n(s, g) {
          this.#s ||= /* @__PURE__ */ new Map();
          let t = this.#s.get(s);
          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 i;
            if (typeof g == "string" ? (t.url = g, i = await (0, B.fetchData)(g, "blob")) : i = t.file = g, i.type === "image/svg+xml") {
              const l = E._isSVGFittingCanvas, p = new FileReader(), w = new Image(), S = new Promise((L, M) => {
                w.onload = () => {
                  t.bitmap = w, t.isSvg = !0, L();
                }, p.onload = async () => {
                  const _ = t.svgUrl = p.result;
                  w.src = await l ? `${_}#svgView(preserveAspectRatio(none))` : _;
                }, w.onerror = p.onerror = M;
              });
              p.readAsDataURL(i), await S;
            } else
              t.bitmap = await createImageBitmap(i);
            t.refCounter = 1;
          } catch (i) {
            console.error(i), t = null;
          }
          return this.#s.set(s, t), t && this.#s.set(t.id, t), t;
        }
        async getFromFile(s) {
          const {
            lastModified: g,
            name: t,
            size: i,
            type: l
          } = s;
          return this.#n(`${g}_${t}_${i}_${l}`, s);
        }
        async getFromUrl(s) {
          return this.#n(s, s);
        }
        async getFromId(s) {
          this.#s ||= /* @__PURE__ */ new Map();
          const g = this.#s.get(s);
          return g ? g.bitmap ? (g.refCounter += 1, g) : g.file ? this.getFromFile(g.file) : this.getFromUrl(g.url) : null;
        }
        getSvgUrl(s) {
          const g = this.#s.get(s);
          return g?.isSvg ? g.svgUrl : null;
        }
        deleteId(s) {
          this.#s ||= /* @__PURE__ */ new Map();
          const g = this.#s.get(s);
          g && (g.refCounter -= 1, g.refCounter === 0 && (g.bitmap = null));
        }
        isValidId(s) {
          return s.startsWith(`image_${this.#t}_`);
        }
      }
      class v {
        #t = [];
        #e = !1;
        #s;
        #n = -1;
        constructor(s = 128) {
          this.#s = s;
        }
        add({
          cmd: s,
          undo: g,
          post: t,
          mustExec: i,
          type: l = NaN,
          overwriteIfSameType: p = !1,
          keepUndo: w = !1
        }) {
          if (i && s(), this.#e)
            return;
          const S = {
            cmd: s,
            undo: g,
            post: t,
            type: l
          };
          if (this.#n === -1) {
            this.#t.length > 0 && (this.#t.length = 0), this.#n = 0, this.#t.push(S);
            return;
          }
          if (p && this.#t[this.#n].type === l) {
            w && (S.undo = this.#t[this.#n].undo), this.#t[this.#n] = S;
            return;
          }
          const L = this.#n + 1;
          L === this.#s ? this.#t.splice(0, 1) : (this.#n = L, L < this.#t.length && this.#t.splice(L)), this.#t.push(S);
        }
        undo() {
          if (this.#n === -1)
            return;
          this.#e = !0;
          const {
            undo: s,
            post: g
          } = this.#t[this.#n];
          s(), g?.(), this.#e = !1, this.#n -= 1;
        }
        redo() {
          if (this.#n < this.#t.length - 1) {
            this.#n += 1, this.#e = !0;
            const {
              cmd: s,
              post: g
            } = this.#t[this.#n];
            s(), g?.(), this.#e = !1;
          }
        }
        hasSomethingToUndo() {
          return this.#n !== -1;
        }
        hasSomethingToRedo() {
          return this.#n < this.#t.length - 1;
        }
        destroy() {
          this.#t = null;
        }
      }
      class r {
        constructor(s) {
          this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
          const {
            isMac: g
          } = y.FeatureTest.platform;
          for (const [t, i, l = {}] of s)
            for (const p of t) {
              const w = p.startsWith("mac+");
              g && w ? (this.callbacks.set(p.slice(4), {
                callback: i,
                options: l
              }), this.allKeys.add(p.split("+").at(-1))) : !g && !w && (this.callbacks.set(p, {
                callback: i,
                options: l
              }), this.allKeys.add(p.split("+").at(-1)));
            }
        }
        #t(s) {
          s.altKey && this.buffer.push("alt"), s.ctrlKey && this.buffer.push("ctrl"), s.metaKey && this.buffer.push("meta"), s.shiftKey && this.buffer.push("shift"), this.buffer.push(s.key);
          const g = this.buffer.join("+");
          return this.buffer.length = 0, g;
        }
        exec(s, g) {
          if (!this.allKeys.has(g.key))
            return;
          const t = this.callbacks.get(this.#t(g));
          if (!t)
            return;
          const {
            callback: i,
            options: {
              bubbles: l = !1,
              args: p = [],
              checker: w = null
            }
          } = t;
          w && !w(s, g) || (i.bind(s, ...p, g)(), l || (g.stopPropagation(), g.preventDefault()));
        }
      }
      class d {
        static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
        get _colors() {
          const s = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
          return (0, B.getColorValues)(s), (0, y.shadow)(this, "_colors", s);
        }
        convert(s) {
          const g = (0, B.getRGB)(s);
          if (!window.matchMedia("(forced-colors: active)").matches)
            return g;
          for (const [t, i] of this._colors)
            if (i.every((l, p) => l === g[p]))
              return d._colorsMapping.get(t);
          return g;
        }
        getHexCode(s) {
          const g = this._colors.get(s);
          return g ? y.Util.makeHexColor(...g) : s;
        }
      }
      class o {
        #t = null;
        #e = /* @__PURE__ */ new Map();
        #s = /* @__PURE__ */ new Map();
        #n = null;
        #r = null;
        #i = null;
        #a = new v();
        #l = 0;
        #h = /* @__PURE__ */ new Set();
        #d = null;
        #u = null;
        #c = /* @__PURE__ */ new Set();
        #o = !1;
        #p = null;
        #g = null;
        #f = null;
        #A = !1;
        #m = null;
        #v = new C();
        #w = !1;
        #C = !1;
        #R = null;
        #I = null;
        #P = null;
        #y = y.AnnotationEditorType.NONE;
        #b = /* @__PURE__ */ new Set();
        #S = null;
        #E = null;
        #k = null;
        #T = this.blur.bind(this);
        #M = this.focus.bind(this);
        #F = this.copy.bind(this);
        #N = this.cut.bind(this);
        #L = this.paste.bind(this);
        #D = this.keydown.bind(this);
        #G = this.keyup.bind(this);
        #X = this.onEditingAction.bind(this);
        #$ = this.onPageChanging.bind(this);
        #V = this.onScaleChanging.bind(this);
        #B = this.#rt.bind(this);
        #O = this.onRotationChanging.bind(this);
        #q = {
          isEditing: !1,
          isEmpty: !0,
          hasSomethingToUndo: !1,
          hasSomethingToRedo: !1,
          hasSelectedEditor: !1,
          hasSelectedText: !1
        };
        #U = [0, 0];
        #_ = null;
        #z = null;
        #K = null;
        static TRANSLATE_SMALL = 1;
        static TRANSLATE_BIG = 10;
        static get _keyboardManager() {
          const s = o.prototype, g = (p) => p.#z.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && p.hasSomethingToControl(), t = (p, {
            target: w
          }) => {
            if (w instanceof HTMLInputElement) {
              const {
                type: S
              } = w;
              return S !== "text" && S !== "number";
            }
            return !0;
          }, i = this.TRANSLATE_SMALL, l = this.TRANSLATE_BIG;
          return (0, y.shadow)(this, "_keyboardManager", new r([[["ctrl+a", "mac+meta+a"], s.selectAll, {
            checker: t
          }], [["ctrl+z", "mac+meta+z"], s.undo, {
            checker: t
          }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], s.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"], s.delete, {
            checker: t
          }], [["Enter", "mac+Enter"], s.addNewEditorFromKeyboard, {
            checker: (p, {
              target: w
            }) => !(w instanceof HTMLButtonElement) && p.#z.contains(w) && !p.isEnterHandled
          }], [[" ", "mac+ "], s.addNewEditorFromKeyboard, {
            checker: (p, {
              target: w
            }) => !(w instanceof HTMLButtonElement) && p.#z.contains(document.activeElement)
          }], [["Escape", "mac+Escape"], s.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], s.translateSelectedEditors, {
            args: [-i, 0],
            checker: g
          }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], s.translateSelectedEditors, {
            args: [-l, 0],
            checker: g
          }], [["ArrowRight", "mac+ArrowRight"], s.translateSelectedEditors, {
            args: [i, 0],
            checker: g
          }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], s.translateSelectedEditors, {
            args: [l, 0],
            checker: g
          }], [["ArrowUp", "mac+ArrowUp"], s.translateSelectedEditors, {
            args: [0, -i],
            checker: g
          }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], s.translateSelectedEditors, {
            args: [0, -l],
            checker: g
          }], [["ArrowDown", "mac+ArrowDown"], s.translateSelectedEditors, {
            args: [0, i],
            checker: g
          }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], s.translateSelectedEditors, {
            args: [0, l],
            checker: g
          }]]));
        }
        constructor(s, g, t, i, l, p, w, S, L) {
          this.#z = s, this.#K = g, this.#n = t, this._eventBus = i, this._eventBus._on("editingaction", this.#X), this._eventBus._on("pagechanging", this.#$), this._eventBus._on("scalechanging", this.#V), this._eventBus._on("rotationchanging", this.#O), this.#at(), this.#J(), this.#r = l.annotationStorage, this.#p = l.filterFactory, this.#E = p, this.#f = w || null, this.#o = S, this.#P = L || null, this.viewParameters = {
            realScale: B.PixelsPerInch.PDF_TO_CSS_UNITS,
            rotation: 0
          }, this.isShiftKeyDown = !1;
        }
        destroy() {
          this.#Z(), this.#Q(), this._eventBus._off("editingaction", this.#X), this._eventBus._off("pagechanging", this.#$), this._eventBus._off("scalechanging", this.#V), this._eventBus._off("rotationchanging", this.#O);
          for (const s of this.#s.values())
            s.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.#_ && (clearTimeout(this.#_), this.#_ = null), this.#ot();
        }
        async mlGuess(s) {
          return this.#P?.guess(s) || null;
        }
        get hasMLManager() {
          return !!this.#P;
        }
        get hcmFilter() {
          return (0, y.shadow)(this, "hcmFilter", this.#E ? this.#p.addHCMFilter(this.#E.foreground, this.#E.background) : "none");
        }
        get direction() {
          return (0, y.shadow)(this, "direction", getComputedStyle(this.#z).direction);
        }
        get highlightColors() {
          return (0, y.shadow)(this, "highlightColors", this.#f ? new Map(this.#f.split(",").map((s) => s.split("=").map((g) => g.trim()))) : null);
        }
        get highlightColorNames() {
          return (0, y.shadow)(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, (s) => s.reverse())) : null);
        }
        setMainHighlightColorPicker(s) {
          this.#I = s;
        }
        editAltText(s) {
          this.#n?.editAltText(this, s);
        }
        onPageChanging({
          pageNumber: s
        }) {
          this.#l = s - 1;
        }
        focusMainContainer() {
          this.#z.focus();
        }
        findParent(s, g) {
          for (const t of this.#s.values()) {
            const {
              x: i,
              y: l,
              width: p,
              height: w
            } = t.div.getBoundingClientRect();
            if (s >= i && s <= i + p && g >= l && g <= l + w)
              return t;
          }
          return null;
        }
        disableUserSelect(s = !1) {
          this.#K.classList.toggle("noUserSelect", s);
        }
        addShouldRescale(s) {
          this.#c.add(s);
        }
        removeShouldRescale(s) {
          this.#c.delete(s);
        }
        onScaleChanging({
          scale: s
        }) {
          this.commitOrRemove(), this.viewParameters.realScale = s * B.PixelsPerInch.PDF_TO_CSS_UNITS;
          for (const g of this.#c)
            g.onScaleChanging();
        }
        onRotationChanging({
          pagesRotation: s
        }) {
          this.commitOrRemove(), this.viewParameters.rotation = s;
        }
        #Y({
          anchorNode: s
        }) {
          return s.nodeType === Node.TEXT_NODE ? s.parentElement : s;
        }
        highlightSelection(s = "") {
          const g = document.getSelection();
          if (!g || g.isCollapsed)
            return;
          const {
            anchorNode: t,
            anchorOffset: i,
            focusNode: l,
            focusOffset: p
          } = g, w = g.toString(), L = this.#Y(g).closest(".textLayer"), M = this.getSelectionBoxes(L);
          if (M) {
            g.empty(), this.#y === y.AnnotationEditorType.NONE && (this._eventBus.dispatch("showannotationeditorui", {
              source: this,
              mode: y.AnnotationEditorType.HIGHLIGHT
            }), this.showAllEditors("highlight", !0, !0));
            for (const _ of this.#s.values())
              if (_.hasTextLayer(L)) {
                _.createAndAddNewEditor({
                  x: 0,
                  y: 0
                }, !1, {
                  methodOfCreation: s,
                  boxes: M,
                  anchorNode: t,
                  anchorOffset: i,
                  focusNode: l,
                  focusOffset: p,
                  text: w
                });
                break;
              }
          }
        }
        #nt() {
          const s = document.getSelection();
          if (!s || s.isCollapsed)
            return;
          const t = this.#Y(s).closest(".textLayer"), i = this.getSelectionBoxes(t);
          i && (this.#m ||= new N.HighlightToolbar(this), this.#m.show(t, i, this.direction === "ltr"));
        }
        addToAnnotationStorage(s) {
          !s.isEmpty() && this.#r && !this.#r.has(s.id) && this.#r.setValue(s.id, s);
        }
        #rt() {
          const s = document.getSelection();
          if (!s || s.isCollapsed) {
            this.#S && (this.#m?.hide(), this.#S = null, this.#x({
              hasSelectedText: !1
            }));
            return;
          }
          const {
            anchorNode: g
          } = s;
          if (g === this.#S)
            return;
          if (!this.#Y(s).closest(".textLayer")) {
            this.#S && (this.#m?.hide(), this.#S = null, this.#x({
              hasSelectedText: !1
            }));
            return;
          }
          if (this.#m?.hide(), this.#S = g, this.#x({
            hasSelectedText: !0
          }), !(this.#y !== y.AnnotationEditorType.HIGHLIGHT && this.#y !== y.AnnotationEditorType.NONE) && (this.#y === y.AnnotationEditorType.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#A = this.isShiftKeyDown, !this.isShiftKeyDown)) {
            const l = (p) => {
              p.type === "pointerup" && p.button !== 0 || (window.removeEventListener("pointerup", l), window.removeEventListener("blur", l), p.type === "pointerup" && this.#W("main_toolbar"));
            };
            window.addEventListener("pointerup", l), window.addEventListener("blur", l);
          }
        }
        #W(s = "") {
          this.#y === y.AnnotationEditorType.HIGHLIGHT ? this.highlightSelection(s) : this.#o && this.#nt();
        }
        #at() {
          document.addEventListener("selectionchange", this.#B);
        }
        #ot() {
          document.removeEventListener("selectionchange", this.#B);
        }
        #ht() {
          window.addEventListener("focus", this.#M), window.addEventListener("blur", this.#T);
        }
        #Q() {
          window.removeEventListener("focus", this.#M), window.removeEventListener("blur", this.#T);
        }
        blur() {
          if (this.isShiftKeyDown = !1, this.#A && (this.#A = !1, this.#W("main_toolbar")), !this.hasSelection)
            return;
          const {
            activeElement: s
          } = document;
          for (const g of this.#b)
            if (g.div.contains(s)) {
              this.#R = [g, s], g._focusEventsAllowed = !1;
              break;
            }
        }
        focus() {
          if (!this.#R)
            return;
          const [s, g] = this.#R;
          this.#R = null, g.addEventListener("focusin", () => {
            s._focusEventsAllowed = !0;
          }, {
            once: !0
          }), g.focus();
        }
        #J() {
          window.addEventListener("keydown", this.#D), window.addEventListener("keyup", this.#G);
        }
        #Z() {
          window.removeEventListener("keydown", this.#D), window.removeEventListener("keyup", this.#G);
        }
        #tt() {
          document.addEventListener("copy", this.#F), document.addEventListener("cut", this.#N), document.addEventListener("paste", this.#L);
        }
        #et() {
          document.removeEventListener("copy", this.#F), document.removeEventListener("cut", this.#N), document.removeEventListener("paste", this.#L);
        }
        addEditListeners() {
          this.#J(), this.#tt();
        }
        removeEditListeners() {
          this.#Z(), this.#et();
        }
        copy(s) {
          if (s.preventDefault(), this.#t?.commitOrRemove(), !this.hasSelection)
            return;
          const g = [];
          for (const t of this.#b) {
            const i = t.serialize(!0);
            i && g.push(i);
          }
          g.length !== 0 && s.clipboardData.setData("application/pdfjs", JSON.stringify(g));
        }
        cut(s) {
          this.copy(s), this.delete();
        }
        paste(s) {
          s.preventDefault();
          const {
            clipboardData: g
          } = s;
          for (const l of g.items)
            for (const p of this.#u)
              if (p.isHandlingMimeForPasting(l.type)) {
                p.paste(l, this.currentLayer);
                return;
              }
          let t = g.getData("application/pdfjs");
          if (!t)
            return;
          try {
            t = JSON.parse(t);
          } catch (l) {
            (0, y.warn)(`paste: "${l.message}".`);
            return;
          }
          if (!Array.isArray(t))
            return;
          this.unselectAll();
          const i = this.currentLayer;
          try {
            const l = [];
            for (const S of t) {
              const L = i.deserialize(S);
              if (!L)
                return;
              l.push(L);
            }
            const p = () => {
              for (const S of l)
                this.#st(S);
              this.#it(l);
            }, w = () => {
              for (const S of l)
                S.remove();
            };
            this.addCommands({
              cmd: p,
              undo: w,
              mustExec: !0
            });
          } catch (l) {
            (0, y.warn)(`paste: "${l.message}".`);
          }
        }
        keydown(s) {
          !this.isShiftKeyDown && s.key === "Shift" && (this.isShiftKeyDown = !0), this.#y !== y.AnnotationEditorType.NONE && !this.isEditorHandlingKeyboard && o._keyboardManager.exec(this, s);
        }
        keyup(s) {
          this.isShiftKeyDown && s.key === "Shift" && (this.isShiftKeyDown = !1, this.#A && (this.#A = !1, this.#W("main_toolbar")));
        }
        onEditingAction({
          name: s
        }) {
          switch (s) {
            case "undo":
            case "redo":
            case "delete":
            case "selectAll":
              this[s]();
              break;
            case "highlightSelection":
              this.highlightSelection("context_menu");
              break;
          }
        }
        #x(s) {
          Object.entries(s).some(([t, i]) => this.#q[t] !== i) && (this._eventBus.dispatch("annotationeditorstateschanged", {
            source: this,
            details: Object.assign(this.#q, s)
          }), this.#y === y.AnnotationEditorType.HIGHLIGHT && s.hasSelectedEditor === !1 && this.#H([[y.AnnotationEditorParamsType.HIGHLIGHT_FREE, !0]]));
        }
        #H(s) {
          this._eventBus.dispatch("annotationeditorparamschanged", {
            source: this,
            details: s
          });
        }
        setEditingState(s) {
          s ? (this.#ht(), this.#tt(), this.#x({
            isEditing: this.#y !== y.AnnotationEditorType.NONE,
            isEmpty: this.#j(),
            hasSomethingToUndo: this.#a.hasSomethingToUndo(),
            hasSomethingToRedo: this.#a.hasSomethingToRedo(),
            hasSelectedEditor: !1
          })) : (this.#Q(), this.#et(), this.#x({
            isEditing: !1
          }), this.disableUserSelect(!1));
        }
        registerEditorTypes(s) {
          if (!this.#u) {
            this.#u = s;
            for (const g of this.#u)
              this.#H(g.defaultPropertiesToUpdate);
          }
        }
        getId() {
          return this.#v.id;
        }
        get currentLayer() {
          return this.#s.get(this.#l);
        }
        getLayer(s) {
          return this.#s.get(s);
        }
        get currentPageIndex() {
          return this.#l;
        }
        addLayer(s) {
          this.#s.set(s.pageIndex, s), this.#w ? s.enable() : s.disable();
        }
        removeLayer(s) {
          this.#s.delete(s.pageIndex);
        }
        updateMode(s, g = null, t = !1) {
          if (this.#y !== s) {
            if (this.#y = s, s === y.AnnotationEditorType.NONE) {
              this.setEditingState(!1), this.#ct();
              return;
            }
            this.setEditingState(!0), this.#lt(), this.unselectAll();
            for (const i of this.#s.values())
              i.updateMode(s);
            if (!g && t) {
              this.addNewEditorFromKeyboard();
              return;
            }
            if (g) {
              for (const i of this.#e.values())
                if (i.annotationElementId === g) {
                  this.setSelected(i), i.enterInEditMode();
                  break;
                }
            }
          }
        }
        addNewEditorFromKeyboard() {
          this.currentLayer.canCreateNewEmptyEditor() && this.currentLayer.addNewEditor();
        }
        updateToolbar(s) {
          s !== this.#y && this._eventBus.dispatch("switchannotationeditormode", {
            source: this,
            mode: s
          });
        }
        updateParams(s, g) {
          if (this.#u) {
            switch (s) {
              case y.AnnotationEditorParamsType.CREATE:
                this.currentLayer.addNewEditor();
                return;
              case y.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:
                this.#I?.updateColor(g);
                break;
              case y.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL:
                this._eventBus.dispatch("reporttelemetry", {
                  source: this,
                  details: {
                    type: "editing",
                    data: {
                      type: "highlight",
                      action: "toggle_visibility"
                    }
                  }
                }), (this.#k ||= /* @__PURE__ */ new Map()).set(s, g), this.showAllEditors("highlight", g);
                break;
            }
            for (const t of this.#b)
              t.updateParams(s, g);
            for (const t of this.#u)
              t.updateDefaultParams(s, g);
          }
        }
        showAllEditors(s, g, t = !1) {
          for (const l of this.#e.values())
            l.editorType === s && l.show(g);
          (this.#k?.get(y.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ?? !0) !== g && this.#H([[y.AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, g]]);
        }
        enableWaiting(s = !1) {
          if (this.#C !== s) {
            this.#C = s;
            for (const g of this.#s.values())
              s ? g.disableClick() : g.enableClick(), g.div.classList.toggle("waiting", s);
          }
        }
        #lt() {
          if (!this.#w) {
            this.#w = !0;
            for (const s of this.#s.values())
              s.enable();
            for (const s of this.#e.values())
              s.enable();
          }
        }
        #ct() {
          if (this.unselectAll(), this.#w) {
            this.#w = !1;
            for (const s of this.#s.values())
              s.disable();
            for (const s of this.#e.values())
              s.disable();
          }
        }
        getEditors(s) {
          const g = [];
          for (const t of this.#e.values())
            t.pageIndex === s && g.push(t);
          return g;
        }
        getEditor(s) {
          return this.#e.get(s);
        }
        addEditor(s) {
          this.#e.set(s.id, s);
        }
        removeEditor(s) {
          s.div.contains(document.activeElement) && (this.#g && clearTimeout(this.#g), this.#g = setTimeout(() => {
            this.focusMainContainer(), this.#g = null;
          }, 0)), this.#e.delete(s.id), this.unselect(s), (!s.annotationElementId || !this.#h.has(s.annotationElementId)) && this.#r?.remove(s.id);
        }
        addDeletedAnnotationElement(s) {
          this.#h.add(s.annotationElementId), this.addChangedExistingAnnotation(s), s.deleted = !0;
        }
        isDeletedAnnotationElement(s) {
          return this.#h.has(s);
        }
        removeDeletedAnnotationElement(s) {
          this.#h.delete(s.annotationElementId), this.removeChangedExistingAnnotation(s), s.deleted = !1;
        }
        #st(s) {
          const g = this.#s.get(s.pageIndex);
          g ? g.addOrRebuild(s) : (this.addEditor(s), this.addToAnnotationStorage(s));
        }
        setActiveEditor(s) {
          this.#t !== s && (this.#t = s, s && this.#H(s.propertiesToUpdate));
        }
        get #dt() {
          let s = null;
          for (s of this.#b)
            ;
          return s;
        }
        updateUI(s) {
          this.#dt === s && this.#H(s.propertiesToUpdate);
        }
        toggleSelected(s) {
          if (this.#b.has(s)) {
            this.#b.delete(s), s.unselect(), this.#x({
              hasSelectedEditor: this.hasSelection
            });
            return;
          }
          this.#b.add(s), s.select(), this.#H(s.propertiesToUpdate), this.#x({
            hasSelectedEditor: !0
          });
        }
        setSelected(s) {
          for (const g of this.#b)
            g !== s && g.unselect();
          this.#b.clear(), this.#b.add(s), s.select(), this.#H(s.propertiesToUpdate), this.#x({
            hasSelectedEditor: !0
          });
        }
        isSelected(s) {
          return this.#b.has(s);
        }
        get firstSelectedEditor() {
          return this.#b.values().next().value;
        }
        unselect(s) {
          s.unselect(), this.#b.delete(s), this.#x({
            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.#x({
            hasSomethingToUndo: this.#a.hasSomethingToUndo(),
            hasSomethingToRedo: !0,
            isEmpty: this.#j()
          });
        }
        redo() {
          this.#a.redo(), this.#x({
            hasSomethingToUndo: !0,
            hasSomethingToRedo: this.#a.hasSomethingToRedo(),
            isEmpty: this.#j()
          });
        }
        addCommands(s) {
          this.#a.add(s), this.#x({
            hasSomethingToUndo: !0,
            hasSomethingToRedo: !1,
            isEmpty: this.#j()
          });
        }
        #j() {
          if (this.#e.size === 0)
            return !0;
          if (this.#e.size === 1)
            for (const s of this.#e.values())
              return s.isEmpty();
          return !1;
        }
        delete() {
          if (this.commitOrRemove(), !this.hasSelection)
            return;
          const s = [...this.#b], g = () => {
            for (const i of s)
              i.remove();
          }, t = () => {
            for (const i of s)
              this.#st(i);
          };
          this.addCommands({
            cmd: g,
            undo: t,
            mustExec: !0
          });
        }
        commitOrRemove() {
          this.#t?.commitOrRemove();
        }
        hasSomethingToControl() {
          return this.#t || this.hasSelection;
        }
        #it(s) {
          for (const g of this.#b)
            g.unselect();
          this.#b.clear();
          for (const g of s)
            g.isEmpty() || (this.#b.add(g), g.select());
          this.#x({
            hasSelectedEditor: this.hasSelection
          });
        }
        selectAll() {
          for (const s of this.#b)
            s.commit();
          this.#it(this.#e.values());
        }
        unselectAll() {
          if (!(this.#t && (this.#t.commitOrRemove(), this.#y !== y.AnnotationEditorType.NONE)) && this.hasSelection) {
            for (const s of this.#b)
              s.unselect();
            this.#b.clear(), this.#x({
              hasSelectedEditor: !1
            });
          }
        }
        translateSelectedEditors(s, g, t = !1) {
          if (t || this.commitOrRemove(), !this.hasSelection)
            return;
          this.#U[0] += s, this.#U[1] += g;
          const [i, l] = this.#U, p = [...this.#b], w = 1e3;
          this.#_ && clearTimeout(this.#_), this.#_ = setTimeout(() => {
            this.#_ = null, this.#U[0] = this.#U[1] = 0, this.addCommands({
              cmd: () => {
                for (const S of p)
                  this.#e.has(S.id) && S.translateInPage(i, l);
              },
              undo: () => {
                for (const S of p)
                  this.#e.has(S.id) && S.translateInPage(-i, -l);
              },
              mustExec: !1
            });
          }, w);
          for (const S of p)
            S.translateInPage(s, g);
        }
        setUpDragSession() {
          if (this.hasSelection) {
            this.disableUserSelect(!0), this.#d = /* @__PURE__ */ new Map();
            for (const s of this.#b)
              this.#d.set(s, {
                savedX: s.x,
                savedY: s.y,
                savedPageIndex: s.pageIndex,
                newX: 0,
                newY: 0,
                newPageIndex: -1
              });
          }
        }
        endDragSession() {
          if (!this.#d)
            return !1;
          this.disableUserSelect(!1);
          const s = this.#d;
          this.#d = null;
          let g = !1;
          for (const [{
            x: i,
            y: l,
            pageIndex: p
          }, w] of s)
            w.newX = i, w.newY = l, w.newPageIndex = p, g ||= i !== w.savedX || l !== w.savedY || p !== w.savedPageIndex;
          if (!g)
            return !1;
          const t = (i, l, p, w) => {
            if (this.#e.has(i.id)) {
              const S = this.#s.get(w);
              S ? i._setParentAndPosition(S, l, p) : (i.pageIndex = w, i.x = l, i.y = p);
            }
          };
          return this.addCommands({
            cmd: () => {
              for (const [i, {
                newX: l,
                newY: p,
                newPageIndex: w
              }] of s)
                t(i, l, p, w);
            },
            undo: () => {
              for (const [i, {
                savedX: l,
                savedY: p,
                savedPageIndex: w
              }] of s)
                t(i, l, p, w);
            },
            mustExec: !0
          }), !0;
        }
        dragSelectedEditors(s, g) {
          if (this.#d)
            for (const t of this.#d.keys())
              t.drag(s, g);
        }
        rebuild(s) {
          if (s.parent === null) {
            const g = this.getLayer(s.pageIndex);
            g ? (g.changeParent(s), g.addOrRebuild(s)) : (this.addEditor(s), this.addToAnnotationStorage(s), s.rebuild());
          } else
            s.parent.addOrRebuild(s);
        }
        get isEditorHandlingKeyboard() {
          return this.getActive()?.shouldGetKeyboardEvents() || this.#b.size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents();
        }
        isActive(s) {
          return this.#t === s;
        }
        getActive() {
          return this.#t;
        }
        getMode() {
          return this.#y;
        }
        get imageManager() {
          return (0, y.shadow)(this, "imageManager", new E());
        }
        getSelectionBoxes(s) {
          if (!s)
            return null;
          const g = document.getSelection();
          for (let L = 0, M = g.rangeCount; L < M; L++)
            if (!s.contains(g.getRangeAt(L).commonAncestorContainer))
              return null;
          const {
            x: t,
            y: i,
            width: l,
            height: p
          } = s.getBoundingClientRect();
          let w;
          switch (s.getAttribute("data-main-rotation")) {
            case "90":
              w = (L, M, _, O) => ({
                x: (M - i) / p,
                y: 1 - (L + _ - t) / l,
                width: O / p,
                height: _ / l
              });
              break;
            case "180":
              w = (L, M, _, O) => ({
                x: 1 - (L + _ - t) / l,
                y: 1 - (M + O - i) / p,
                width: _ / l,
                height: O / p
              });
              break;
            case "270":
              w = (L, M, _, O) => ({
                x: 1 - (M + O - i) / p,
                y: (L - t) / l,
                width: O / p,
                height: _ / l
              });
              break;
            default:
              w = (L, M, _, O) => ({
                x: (L - t) / l,
                y: (M - i) / p,
                width: _ / l,
                height: O / p
              });
              break;
          }
          const S = [];
          for (let L = 0, M = g.rangeCount; L < M; L++) {
            const _ = g.getRangeAt(L);
            if (!_.collapsed)
              for (const {
                x: O,
                y: z,
                width: K,
                height: nt
              } of _.getClientRects())
                K === 0 || nt === 0 || S.push(w(O, z, K, nt));
          }
          return S.length === 0 ? null : S;
        }
        addChangedExistingAnnotation({
          annotationElementId: s,
          id: g
        }) {
          (this.#i ||= /* @__PURE__ */ new Map()).set(s, g);
        }
        removeChangedExistingAnnotation({
          annotationElementId: s
        }) {
          this.#i?.delete(s);
        }
        renderAnnotationElement(s) {
          const g = this.#i?.get(s.data.id);
          if (!g)
            return;
          const t = this.#r.getRawValue(g);
          t && (this.#y === y.AnnotationEditorType.NONE && !t.hasBeenModified || t.renderAnnotationElement(s));
        }
      }
    }
  ),
  /***/
  94: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        PDFFetchStream: () => (
          /* binding */
          C
        )
        /* harmony export */
      });
      var y = V(292), B = V(490);
      function N(r, d, o) {
        return {
          method: "GET",
          headers: r,
          signal: o.signal,
          mode: "cors",
          credentials: d ? "include" : "same-origin",
          redirect: "follow"
        };
      }
      function U(r) {
        const d = new Headers();
        for (const o in r) {
          const b = r[o];
          b !== void 0 && d.append(o, b);
        }
        return d;
      }
      function P(r) {
        return r instanceof Uint8Array ? r.buffer : r instanceof ArrayBuffer ? r : ((0, y.warn)(`getArrayBuffer - unexpected data format: ${r}`), new Uint8Array(r).buffer);
      }
      class C {
        constructor(d) {
          this.source = d, this.isHttp = /^https?:/i.test(d.url), this.httpHeaders = this.isHttp && d.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
        }
        get _progressiveDataLength() {
          return this._fullRequestReader?._loaded ?? 0;
        }
        getFullReader() {
          return (0, y.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new E(this), this._fullRequestReader;
        }
        getRangeReader(d, o) {
          if (o <= this._progressiveDataLength)
            return null;
          const b = new v(this, d, o);
          return this._rangeRequestReaders.push(b), b;
        }
        cancelAllRequests(d) {
          this._fullRequestReader?.cancel(d);
          for (const o of this._rangeRequestReaders.slice(0))
            o.cancel(d);
        }
      }
      class E {
        constructor(d) {
          this._stream = d, this._reader = null, this._loaded = 0, this._filename = null;
          const o = d.source;
          this._withCredentials = o.withCredentials || !1, this._contentLength = o.length, this._headersCapability = Promise.withResolvers(), this._disableRange = o.disableRange || !1, this._rangeChunkSize = o.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !o.disableStream, this._isRangeSupported = !o.disableRange, this._headers = U(this._stream.httpHeaders);
          const b = o.url;
          fetch(b, N(this._headers, this._withCredentials, this._abortController)).then((s) => {
            if (!(0, B.validateResponseStatus)(s.status))
              throw (0, B.createResponseStatusError)(s.status, b);
            this._reader = s.body.getReader(), this._headersCapability.resolve();
            const g = (l) => s.headers.get(l), {
              allowRangeRequests: t,
              suggestedLength: i
            } = (0, B.validateRangeRequestCapabilities)({
              getResponseHeader: g,
              isHttp: this._stream.isHttp,
              rangeChunkSize: this._rangeChunkSize,
              disableRange: this._disableRange
            });
            this._isRangeSupported = t, this._contentLength = i || this._contentLength, this._filename = (0, B.extractFilenameFromHeader)(g), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new y.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: d,
            done: o
          } = await this._reader.read();
          return o ? {
            value: d,
            done: o
          } : (this._loaded += d.byteLength, this.onProgress?.({
            loaded: this._loaded,
            total: this._contentLength
          }), {
            value: P(d),
            done: !1
          });
        }
        cancel(d) {
          this._reader?.cancel(d), this._abortController.abort();
        }
      }
      class v {
        constructor(d, o, b) {
          this._stream = d, this._reader = null, this._loaded = 0;
          const s = d.source;
          this._withCredentials = s.withCredentials || !1, this._readCapability = Promise.withResolvers(), this._isStreamingSupported = !s.disableStream, this._abortController = new AbortController(), this._headers = U(this._stream.httpHeaders), this._headers.append("Range", `bytes=${o}-${b - 1}`);
          const g = s.url;
          fetch(g, N(this._headers, this._withCredentials, this._abortController)).then((t) => {
            if (!(0, B.validateResponseStatus)(t.status))
              throw (0, B.createResponseStatusError)(t.status, g);
            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: d,
            done: o
          } = await this._reader.read();
          return o ? {
            value: d,
            done: o
          } : (this._loaded += d.byteLength, this.onProgress?.({
            loaded: this._loaded
          }), {
            value: P(d),
            done: !1
          });
        }
        cancel(d) {
          this._reader?.cancel(d), this._abortController.abort();
        }
      }
    }
  ),
  /***/
  10: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        FontFaceObject: () => (
          /* binding */
          N
        ),
        /* harmony export */
        FontLoader: () => (
          /* binding */
          B
        )
        /* harmony export */
      });
      var y = V(292);
      class B {
        #t = /* @__PURE__ */ new Set();
        constructor({
          ownerDocument: P = globalThis.document,
          styleElement: C = null
        }) {
          this._document = P, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
        }
        addNativeFontFace(P) {
          this.nativeFontFaces.add(P), this._document.fonts.add(P);
        }
        removeNativeFontFace(P) {
          this.nativeFontFaces.delete(P), this._document.fonts.delete(P);
        }
        insertRule(P) {
          this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
          const C = this.styleElement.sheet;
          C.insertRule(P, C.cssRules.length);
        }
        clear() {
          for (const P of this.nativeFontFaces)
            this._document.fonts.delete(P);
          this.nativeFontFaces.clear(), this.#t.clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
        }
        async loadSystemFont({
          systemFontInfo: P,
          _inspectFont: C
        }) {
          if (!(!P || this.#t.has(P.loadedName))) {
            if ((0, y.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
              const {
                loadedName: E,
                src: v,
                style: r
              } = P, d = new FontFace(E, v, r);
              this.addNativeFontFace(d);
              try {
                await d.load(), this.#t.add(E), C?.(P);
              } catch {
                (0, y.warn)(`Cannot load system font: ${P.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(d);
              }
              return;
            }
            (0, y.unreachable)("Not implemented: loadSystemFont without the Font Loading API.");
          }
        }
        async bind(P) {
          if (P.attached || P.missingFile && !P.systemFontInfo)
            return;
          if (P.attached = !0, P.systemFontInfo) {
            await this.loadSystemFont(P);
            return;
          }
          if (this.isFontLoadingAPISupported) {
            const E = P.createNativeFontFace();
            if (E) {
              this.addNativeFontFace(E);
              try {
                await E.loaded;
              } catch (v) {
                throw (0, y.warn)(`Failed to load font '${E.family}': '${v}'.`), P.disableFontFace = !0, v;
              }
            }
            return;
          }
          const C = P.createFontFaceRule();
          if (C) {
            if (this.insertRule(C), this.isSyncFontLoadingSupported)
              return;
            await new Promise((E) => {
              const v = this._queueLoadingCallback(E);
              this._prepareFontLoadEvent(P, v);
            });
          }
        }
        get isFontLoadingAPISupported() {
          const P = !!this._document?.fonts;
          return (0, y.shadow)(this, "isFontLoadingAPISupported", P);
        }
        get isSyncFontLoadingSupported() {
          let P = !1;
          return (y.isNodeJS || typeof navigator < "u" && typeof navigator?.userAgent == "string" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (P = !0), (0, y.shadow)(this, "isSyncFontLoadingSupported", P);
        }
        _queueLoadingCallback(P) {
          function C() {
            for ((0, y.assert)(!v.done, "completeRequest() cannot be called twice."), v.done = !0; E.length > 0 && E[0].done; ) {
              const r = E.shift();
              setTimeout(r.callback, 0);
            }
          }
          const {
            loadingRequests: E
          } = this, v = {
            done: !1,
            complete: C,
            callback: P
          };
          return E.push(v), v;
        }
        get _loadTestFont() {
          const P = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
          return (0, y.shadow)(this, "_loadTestFont", P);
        }
        _prepareFontLoadEvent(P, C) {
          function E(O, z) {
            return O.charCodeAt(z) << 24 | O.charCodeAt(z + 1) << 16 | O.charCodeAt(z + 2) << 8 | O.charCodeAt(z + 3) & 255;
          }
          function v(O, z, K, nt) {
            const j = O.substring(0, z), H = O.substring(z + K);
            return j + nt + H;
          }
          let r, d;
          const o = this._document.createElement("canvas");
          o.width = 1, o.height = 1;
          const b = o.getContext("2d");
          let s = 0;
          function g(O, z) {
            if (++s > 30) {
              (0, y.warn)("Load test font never loaded."), z();
              return;
            }
            if (b.font = "30px " + O, b.fillText(".", 0, 20), b.getImageData(0, 0, 1, 1).data[3] > 0) {
              z();
              return;
            }
            setTimeout(g.bind(null, O, z));
          }
          const t = `lt${Date.now()}${this.loadTestFontId++}`;
          let i = this._loadTestFont;
          i = v(i, 976, t.length, t);
          const p = 16, w = 1482184792;
          let S = E(i, p);
          for (r = 0, d = t.length - 3; r < d; r += 4)
            S = S - w + E(t, r) | 0;
          r < t.length && (S = S - w + E(t + "XXX", r) | 0), i = v(i, p, 4, (0, y.string32)(S));
          const L = `url(data:font/opentype;base64,${btoa(i)});`, M = `@font-face {font-family:"${t}";src:${L}}`;
          this.insertRule(M);
          const _ = this._document.createElement("div");
          _.style.visibility = "hidden", _.style.width = _.style.height = "10px", _.style.position = "absolute", _.style.top = _.style.left = "0px";
          for (const O of [P.loadedName, t]) {
            const z = this._document.createElement("span");
            z.textContent = "Hi", z.style.fontFamily = O, _.append(z);
          }
          this._document.body.append(_), g(t, () => {
            _.remove(), C.complete();
          });
        }
      }
      class N {
        constructor(P, {
          disableFontFace: C = !1,
          ignoreErrors: E = !1,
          inspectFont: v = null
        }) {
          this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
          for (const r in P)
            this[r] = P[r];
          this.disableFontFace = C === !0, this.ignoreErrors = E === !0, this._inspectFont = v;
        }
        createNativeFontFace() {
          if (!this.data || this.disableFontFace)
            return null;
          let P;
          if (!this.cssFontInfo)
            P = new FontFace(this.loadedName, this.data, {});
          else {
            const C = {
              weight: this.cssFontInfo.fontWeight
            };
            this.cssFontInfo.italicAngle && (C.style = `oblique ${this.cssFontInfo.italicAngle}deg`), P = new FontFace(this.cssFontInfo.fontFamily, this.data, C);
          }
          return this._inspectFont?.(this), P;
        }
        createFontFaceRule() {
          if (!this.data || this.disableFontFace)
            return null;
          const P = (0, y.bytesToString)(this.data), C = `url(data:${this.mimetype};base64,${btoa(P)});`;
          let E;
          if (!this.cssFontInfo)
            E = `@font-face {font-family:"${this.loadedName}";src:${C}}`;
          else {
            let v = `font-weight: ${this.cssFontInfo.fontWeight};`;
            this.cssFontInfo.italicAngle && (v += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), E = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${v}src:${C}}`;
          }
          return this._inspectFont?.(this, C), E;
        }
        getPathGenerator(P, C) {
          if (this.compiledGlyphs[C] !== void 0)
            return this.compiledGlyphs[C];
          let E;
          try {
            E = P.get(this.loadedName + "_path_" + C);
          } catch (r) {
            if (!this.ignoreErrors)
              throw r;
            (0, y.warn)(`getPathGenerator - ignoring character: "${r}".`);
          }
          if (!Array.isArray(E) || E.length === 0)
            return this.compiledGlyphs[C] = function(r, d) {
            };
          const v = [];
          for (let r = 0, d = E.length; r < d; )
            switch (E[r++]) {
              case y.FontRenderOps.BEZIER_CURVE_TO:
                {
                  const [o, b, s, g, t, i] = E.slice(r, r + 6);
                  v.push((l) => l.bezierCurveTo(o, b, s, g, t, i)), r += 6;
                }
                break;
              case y.FontRenderOps.MOVE_TO:
                {
                  const [o, b] = E.slice(r, r + 2);
                  v.push((s) => s.moveTo(o, b)), r += 2;
                }
                break;
              case y.FontRenderOps.LINE_TO:
                {
                  const [o, b] = E.slice(r, r + 2);
                  v.push((s) => s.lineTo(o, b)), r += 2;
                }
                break;
              case y.FontRenderOps.QUADRATIC_CURVE_TO:
                {
                  const [o, b, s, g] = E.slice(r, r + 4);
                  v.push((t) => t.quadraticCurveTo(o, b, s, g)), r += 4;
                }
                break;
              case y.FontRenderOps.RESTORE:
                v.push((o) => o.restore());
                break;
              case y.FontRenderOps.SAVE:
                v.push((o) => o.save());
                break;
              case y.FontRenderOps.SCALE:
                (0, y.assert)(v.length === 2, "Scale command is only valid at the third position.");
                break;
              case y.FontRenderOps.TRANSFORM:
                {
                  const [o, b, s, g, t, i] = E.slice(r, r + 6);
                  v.push((l) => l.transform(o, b, s, g, t, i)), r += 6;
                }
                break;
              case y.FontRenderOps.TRANSLATE:
                {
                  const [o, b] = E.slice(r, r + 2);
                  v.push((s) => s.translate(o, b)), r += 2;
                }
                break;
            }
          return this.compiledGlyphs[C] = function(d, o) {
            v[0](d), v[1](d), d.scale(o, -o);
            for (let b = 2, s = v.length; b < s; b++)
              v[b](d);
          };
        }
      }
    }
  ),
  /***/
  62: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        Metadata: () => (
          /* binding */
          B
        )
        /* harmony export */
      });
      var y = V(292);
      class B {
        #t;
        #e;
        constructor({
          parsedData: U,
          rawData: P
        }) {
          this.#t = U, this.#e = P;
        }
        getRaw() {
          return this.#e;
        }
        get(U) {
          return this.#t.get(U) ?? null;
        }
        getAll() {
          return (0, y.objectFromMap)(this.#t);
        }
        has(U) {
          return this.#t.has(U);
        }
      }
    }
  ),
  /***/
  457: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        PDFNetworkStream: () => (
          /* binding */
          E
        )
        /* harmony export */
      });
      var y = V(292), B = V(490);
      const N = 200, U = 206;
      function P(d) {
        const o = d.response;
        return typeof o != "string" ? o : (0, y.stringToBytes)(o).buffer;
      }
      class C {
        constructor(o, b = {}) {
          this.url = o, this.isHttp = /^https?:/i.test(o), this.httpHeaders = this.isHttp && b.httpHeaders || /* @__PURE__ */ Object.create(null), this.withCredentials = b.withCredentials || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
        }
        requestRange(o, b, s) {
          const g = {
            begin: o,
            end: b
          };
          for (const t in s)
            g[t] = s[t];
          return this.request(g);
        }
        requestFull(o) {
          return this.request(o);
        }
        request(o) {
          const b = new XMLHttpRequest(), s = this.currXhrId++, g = this.pendingRequests[s] = {
            xhr: b
          };
          b.open("GET", this.url), b.withCredentials = this.withCredentials;
          for (const t in this.httpHeaders) {
            const i = this.httpHeaders[t];
            i !== void 0 && b.setRequestHeader(t, i);
          }
          return this.isHttp && "begin" in o && "end" in o ? (b.setRequestHeader("Range", `bytes=${o.begin}-${o.end - 1}`), g.expectedStatus = U) : g.expectedStatus = N, b.responseType = "arraybuffer", o.onError && (b.onerror = function(t) {
            o.onError(b.status);
          }), b.onreadystatechange = this.onStateChange.bind(this, s), b.onprogress = this.onProgress.bind(this, s), g.onHeadersReceived = o.onHeadersReceived, g.onDone = o.onDone, g.onError = o.onError, g.onProgress = o.onProgress, b.send(null), s;
        }
        onProgress(o, b) {
          const s = this.pendingRequests[o];
          s && s.onProgress?.(b);
        }
        onStateChange(o, b) {
          const s = this.pendingRequests[o];
          if (!s)
            return;
          const g = s.xhr;
          if (g.readyState >= 2 && s.onHeadersReceived && (s.onHeadersReceived(), delete s.onHeadersReceived), g.readyState !== 4 || !(o in this.pendingRequests))
            return;
          if (delete this.pendingRequests[o], g.status === 0 && this.isHttp) {
            s.onError?.(g.status);
            return;
          }
          const t = g.status || N;
          if (!(t === N && s.expectedStatus === U) && t !== s.expectedStatus) {
            s.onError?.(g.status);
            return;
          }
          const l = P(g);
          if (t === U) {
            const p = g.getResponseHeader("Content-Range"), w = /bytes (\d+)-(\d+)\/(\d+)/.exec(p);
            s.onDone({
              begin: parseInt(w[1], 10),
              chunk: l
            });
          } else
            l ? s.onDone({
              begin: 0,
              chunk: l
            }) : s.onError?.(g.status);
        }
        getRequestXhr(o) {
          return this.pendingRequests[o].xhr;
        }
        isPendingRequest(o) {
          return o in this.pendingRequests;
        }
        abortRequest(o) {
          const b = this.pendingRequests[o].xhr;
          delete this.pendingRequests[o], b.abort();
        }
      }
      class E {
        constructor(o) {
          this._source = o, this._manager = new C(o.url, {
            httpHeaders: o.httpHeaders,
            withCredentials: o.withCredentials
          }), this._rangeChunkSize = o.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
        }
        _onRangeRequestReaderClosed(o) {
          const b = this._rangeRequestReaders.indexOf(o);
          b >= 0 && this._rangeRequestReaders.splice(b, 1);
        }
        getFullReader() {
          return (0, y.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new v(this._manager, this._source), this._fullRequestReader;
        }
        getRangeReader(o, b) {
          const s = new r(this._manager, o, b);
          return s.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(s), s;
        }
        cancelAllRequests(o) {
          this._fullRequestReader?.cancel(o);
          for (const b of this._rangeRequestReaders.slice(0))
            b.cancel(o);
        }
      }
      class v {
        constructor(o, b) {
          this._manager = o;
          const s = {
            onHeadersReceived: this._onHeadersReceived.bind(this),
            onDone: this._onDone.bind(this),
            onError: this._onError.bind(this),
            onProgress: this._onProgress.bind(this)
          };
          this._url = b.url, this._fullRequestId = o.requestFull(s), this._headersReceivedCapability = Promise.withResolvers(), this._disableRange = b.disableRange || !1, this._contentLength = b.length, this._rangeChunkSize = b.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 o = this._fullRequestId, b = this._manager.getRequestXhr(o), s = (i) => b.getResponseHeader(i), {
            allowRangeRequests: g,
            suggestedLength: t
          } = (0, B.validateRangeRequestCapabilities)({
            getResponseHeader: s,
            isHttp: this._manager.isHttp,
            rangeChunkSize: this._rangeChunkSize,
            disableRange: this._disableRange
          });
          g && (this._isRangeSupported = !0), this._contentLength = t || this._contentLength, this._filename = (0, B.extractFilenameFromHeader)(s), this._isRangeSupported && this._manager.abortRequest(o), this._headersReceivedCapability.resolve();
        }
        _onDone(o) {
          if (o && (this._requests.length > 0 ? this._requests.shift().resolve({
            value: o.chunk,
            done: !1
          }) : this._cachedChunks.push(o.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
            for (const b of this._requests)
              b.resolve({
                value: void 0,
                done: !0
              });
            this._requests.length = 0;
          }
        }
        _onError(o) {
          this._storedError = (0, B.createResponseStatusError)(o, this._url), this._headersReceivedCapability.reject(this._storedError);
          for (const b of this._requests)
            b.reject(this._storedError);
          this._requests.length = 0, this._cachedChunks.length = 0;
        }
        _onProgress(o) {
          this.onProgress?.({
            loaded: o.loaded,
            total: o.lengthComputable ? o.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 o = Promise.withResolvers();
          return this._requests.push(o), o.promise;
        }
        cancel(o) {
          this._done = !0, this._headersReceivedCapability.reject(o);
          for (const b of this._requests)
            b.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
        }
      }
      class r {
        constructor(o, b, s) {
          this._manager = o;
          const g = {
            onDone: this._onDone.bind(this),
            onError: this._onError.bind(this),
            onProgress: this._onProgress.bind(this)
          };
          this._url = o.url, this._requestId = o.requestRange(b, s, g), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
        }
        _close() {
          this.onClosed?.(this);
        }
        _onDone(o) {
          const b = o.chunk;
          this._requests.length > 0 ? this._requests.shift().resolve({
            value: b,
            done: !1
          }) : this._queuedChunk = b, this._done = !0;
          for (const s of this._requests)
            s.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._close();
        }
        _onError(o) {
          this._storedError = (0, B.createResponseStatusError)(o, this._url);
          for (const b of this._requests)
            b.reject(this._storedError);
          this._requests.length = 0, this._queuedChunk = null;
        }
        _onProgress(o) {
          this.isStreamingSupported || this.onProgress?.({
            loaded: o.loaded
          });
        }
        get isStreamingSupported() {
          return !1;
        }
        async read() {
          if (this._storedError)
            throw this._storedError;
          if (this._queuedChunk !== null) {
            const b = this._queuedChunk;
            return this._queuedChunk = null, {
              value: b,
              done: !1
            };
          }
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const o = Promise.withResolvers();
          return this._requests.push(o), o.promise;
        }
        cancel(o) {
          this._done = !0;
          for (const b of this._requests)
            b.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
        }
      }
    }
  ),
  /***/
  490: (
    /***/
    (at, W, V) => {
      V.d(W, {
        createResponseStatusError: () => (
          /* binding */
          C
        ),
        extractFilenameFromHeader: () => (
          /* binding */
          P
        ),
        validateRangeRequestCapabilities: () => (
          /* binding */
          U
        ),
        validateResponseStatus: () => (
          /* binding */
          E
        )
      });
      var y = V(292);
      function B(v) {
        let r = !0, d = o("filename\\*", "i").exec(v);
        if (d) {
          d = d[1];
          let p = t(d);
          return p = unescape(p), p = i(p), p = l(p), s(p);
        }
        if (d = g(v), d) {
          const p = l(d);
          return s(p);
        }
        if (d = o("filename", "i").exec(v), d) {
          d = d[1];
          let p = t(d);
          return p = l(p), s(p);
        }
        function o(p, w) {
          return new RegExp("(?:^|;)\\s*" + p + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', w);
        }
        function b(p, w) {
          if (p) {
            if (!/^[\x00-\xFF]+$/.test(w))
              return w;
            try {
              const S = new TextDecoder(p, {
                fatal: !0
              }), L = (0, y.stringToBytes)(w);
              w = S.decode(L), r = !1;
            } catch {
            }
          }
          return w;
        }
        function s(p) {
          return r && /[\x80-\xff]/.test(p) && (p = b("utf-8", p), r && (p = b("iso-8859-1", p))), p;
        }
        function g(p) {
          const w = [];
          let S;
          const L = o("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
          for (; (S = L.exec(p)) !== null; ) {
            let [, _, O, z] = S;
            if (_ = parseInt(_, 10), _ in w) {
              if (_ === 0)
                break;
              continue;
            }
            w[_] = [O, z];
          }
          const M = [];
          for (let _ = 0; _ < w.length && _ in w; ++_) {
            let [O, z] = w[_];
            z = t(z), O && (z = unescape(z), _ === 0 && (z = i(z))), M.push(z);
          }
          return M.join("");
        }
        function t(p) {
          if (p.startsWith('"')) {
            const w = p.slice(1).split('\\"');
            for (let S = 0; S < w.length; ++S) {
              const L = w[S].indexOf('"');
              L !== -1 && (w[S] = w[S].slice(0, L), w.length = S + 1), w[S] = w[S].replaceAll(/\\(.)/g, "$1");
            }
            p = w.join('"');
          }
          return p;
        }
        function i(p) {
          const w = p.indexOf("'");
          if (w === -1)
            return p;
          const S = p.slice(0, w), M = p.slice(w + 1).replace(/^[^']*'/, "");
          return b(S, M);
        }
        function l(p) {
          return !p.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(p) ? p : p.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(w, S, L, M) {
            if (L === "q" || L === "Q")
              return M = M.replaceAll("_", " "), M = M.replaceAll(/=([0-9a-fA-F]{2})/g, function(_, O) {
                return String.fromCharCode(parseInt(O, 16));
              }), b(S, M);
            try {
              M = atob(M);
            } catch {
            }
            return b(S, M);
          });
        }
        return "";
      }
      var N = V(419);
      function U({
        getResponseHeader: v,
        isHttp: r,
        rangeChunkSize: d,
        disableRange: o
      }) {
        const b = {
          allowRangeRequests: !1,
          suggestedLength: void 0
        }, s = parseInt(v("Content-Length"), 10);
        return !Number.isInteger(s) || (b.suggestedLength = s, s <= 2 * d) || o || !r || v("Accept-Ranges") !== "bytes" || (v("Content-Encoding") || "identity") !== "identity" || (b.allowRangeRequests = !0), b;
      }
      function P(v) {
        const r = v("Content-Disposition");
        if (r) {
          let d = B(r);
          if (d.includes("%"))
            try {
              d = decodeURIComponent(d);
            } catch {
            }
          if ((0, N.isPdfFile)(d))
            return d;
        }
        return null;
      }
      function C(v, r) {
        return v === 404 || v === 0 && r.startsWith("file:") ? new y.MissingPDFException('Missing PDF "' + r + '".') : new y.UnexpectedResponseException(`Unexpected server response (${v}) while retrieving PDF "${r}".`, v);
      }
      function E(v) {
        return v === 200 || v === 206;
      }
    }
  ),
  /***/
  786: (
    /***/
    (at, W, V) => {
      V.a(at, async (y, B) => {
        try {
          let d = function(w) {
            const S = v.parse(w);
            return S.protocol === "file:" || S.host ? S : /^[a-z]:[/\\]/i.test(w) ? v.parse(`file:///${w}`) : (S.host || (S.protocol = "file:"), S);
          }, g = function(w, S) {
            return {
              protocol: w.protocol,
              auth: w.auth,
              host: w.hostname,
              port: w.port,
              path: w.path,
              method: "GET",
              headers: S
            };
          };
          V.d(W, {
            /* harmony export */
            PDFNodeStream: () => (
              /* binding */
              o
            )
            /* harmony export */
          });
          var N = V(292), U = V(490);
          let P, C, E, v;
          N.isNodeJS && (P = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), C = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), E = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ), v = await import(
            /*webpackIgnore: true*/
            "./__vite-browser-external-DYxpcVy9.js"
          ));
          const r = /^file:\/\/\/[a-zA-Z]:\//;
          class o {
            constructor(S) {
              this.source = S, this.url = d(S.url), this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:", this.isFsUrl = this.url.protocol === "file:", this.httpHeaders = this.isHttp && S.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              return this._fullRequestReader?._loaded ?? 0;
            }
            getFullReader() {
              return (0, N.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = this.isFsUrl ? new l(this) : new t(this), this._fullRequestReader;
            }
            getRangeReader(S, L) {
              if (L <= this._progressiveDataLength)
                return null;
              const M = this.isFsUrl ? new p(this, S, L) : new i(this, S, L);
              return this._rangeRequestReaders.push(M), M;
            }
            cancelAllRequests(S) {
              this._fullRequestReader?.cancel(S);
              for (const L of this._rangeRequestReaders.slice(0))
                L.cancel(S);
            }
          }
          class b {
            constructor(S) {
              this._url = S.url, this._done = !1, this._storedError = null, this.onProgress = null;
              const L = S.source;
              this._contentLength = L.length, this._loaded = 0, this._filename = null, this._disableRange = L.disableRange || !1, this._rangeChunkSize = L.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !L.disableStream, this._isRangeSupported = !L.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 S = this._readableStream.read();
              return S === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += S.length, this.onProgress?.({
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: new Uint8Array(S).buffer,
                done: !1
              });
            }
            cancel(S) {
              if (!this._readableStream) {
                this._error(S);
                return;
              }
              this._readableStream.destroy(S);
            }
            _error(S) {
              this._storedError = S, this._readCapability.resolve();
            }
            _setReadableStream(S) {
              this._readableStream = S, S.on("readable", () => {
                this._readCapability.resolve();
              }), S.on("end", () => {
                S.destroy(), this._done = !0, this._readCapability.resolve();
              }), S.on("error", (L) => {
                this._error(L);
              }), !this._isStreamingSupported && this._isRangeSupported && this._error(new N.AbortException("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class s {
            constructor(S) {
              this._url = S.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
              const L = S.source;
              this._isStreamingSupported = !L.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 S = this._readableStream.read();
              return S === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += S.length, this.onProgress?.({
                loaded: this._loaded
              }), {
                value: new Uint8Array(S).buffer,
                done: !1
              });
            }
            cancel(S) {
              if (!this._readableStream) {
                this._error(S);
                return;
              }
              this._readableStream.destroy(S);
            }
            _error(S) {
              this._storedError = S, this._readCapability.resolve();
            }
            _setReadableStream(S) {
              this._readableStream = S, S.on("readable", () => {
                this._readCapability.resolve();
              }), S.on("end", () => {
                S.destroy(), this._done = !0, this._readCapability.resolve();
              }), S.on("error", (L) => {
                this._error(L);
              }), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class t extends b {
            constructor(S) {
              super(S);
              const L = (M) => {
                if (M.statusCode === 404) {
                  const K = new N.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = K, this._headersCapability.reject(K);
                  return;
                }
                this._headersCapability.resolve(), this._setReadableStream(M);
                const _ = (K) => this._readableStream.headers[K.toLowerCase()], {
                  allowRangeRequests: O,
                  suggestedLength: z
                } = (0, U.validateRangeRequestCapabilities)({
                  getResponseHeader: _,
                  isHttp: S.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = O, this._contentLength = z || this._contentLength, this._filename = (0, U.extractFilenameFromHeader)(_);
              };
              this._request = null, this._url.protocol === "http:" ? this._request = C.request(g(this._url, S.httpHeaders), L) : this._request = E.request(g(this._url, S.httpHeaders), L), this._request.on("error", (M) => {
                this._storedError = M, this._headersCapability.reject(M);
              }), this._request.end();
            }
          }
          class i extends s {
            constructor(S, L, M) {
              super(S), this._httpHeaders = {};
              for (const O in S.httpHeaders) {
                const z = S.httpHeaders[O];
                z !== void 0 && (this._httpHeaders[O] = z);
              }
              this._httpHeaders.Range = `bytes=${L}-${M - 1}`;
              const _ = (O) => {
                if (O.statusCode === 404) {
                  const z = new N.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = z;
                  return;
                }
                this._setReadableStream(O);
              };
              this._request = null, this._url.protocol === "http:" ? this._request = C.request(g(this._url, this._httpHeaders), _) : this._request = E.request(g(this._url, this._httpHeaders), _), this._request.on("error", (O) => {
                this._storedError = O;
              }), this._request.end();
            }
          }
          class l extends b {
            constructor(S) {
              super(S);
              let L = decodeURIComponent(this._url.path);
              r.test(this._url.href) && (L = L.replace(/^\//, "")), P.promises.lstat(L).then((M) => {
                this._contentLength = M.size, this._setReadableStream(P.createReadStream(L)), this._headersCapability.resolve();
              }, (M) => {
                M.code === "ENOENT" && (M = new N.MissingPDFException(`Missing PDF "${L}".`)), this._storedError = M, this._headersCapability.reject(M);
              });
            }
          }
          class p extends s {
            constructor(S, L, M) {
              super(S);
              let _ = decodeURIComponent(this._url.path);
              r.test(this._url.href) && (_ = _.replace(/^\//, "")), this._setReadableStream(P.createReadStream(_, {
                start: L,
                end: M - 1
              }));
            }
          }
          B();
        } catch (P) {
          B(P);
        }
      }, 1);
    }
  ),
  /***/
  573: (
    /***/
    (at, W, V) => {
      V.a(at, async (y, B) => {
        try {
          V.d(W, {
            /* harmony export */
            NodeCMapReaderFactory: () => (
              /* binding */
              o
            ),
            /* harmony export */
            NodeCanvasFactory: () => (
              /* binding */
              d
            ),
            /* harmony export */
            NodeFilterFactory: () => (
              /* binding */
              r
            ),
            /* harmony export */
            NodeStandardFontDataFactory: () => (
              /* binding */
              b
            )
            /* harmony export */
          });
          var N = V(583), U = V(292);
          let P, C, E;
          if (U.isNodeJS) {
            P = await import(
              /*webpackIgnore: true*/
              "./__vite-browser-external-DYxpcVy9.js"
            );
            try {
              C = await import(
                /*webpackIgnore: true*/
                "./__vite-browser-external-DYxpcVy9.js"
              );
            } catch {
            }
            try {
              E = await import(
                /*webpackIgnore: true*/
                "./index-V38oYatP.js"
              );
            } catch {
            }
          }
          const v = function(s) {
            return P.promises.readFile(s).then((g) => new Uint8Array(g));
          };
          class r extends N.BaseFilterFactory {
          }
          class d extends N.BaseCanvasFactory {
            _createCanvas(g, t) {
              return C.createCanvas(g, t);
            }
          }
          class o extends N.BaseCMapReaderFactory {
            _fetchData(g, t) {
              return v(g).then((i) => ({
                cMapData: i,
                compressionType: t
              }));
            }
          }
          class b extends N.BaseStandardFontDataFactory {
            _fetchData(g) {
              return v(g);
            }
          }
          B();
        } catch (P) {
          B(P);
        }
      }, 1);
    }
  ),
  /***/
  626: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        OptionalContentConfig: () => (
          /* binding */
          P
        )
        /* harmony export */
      });
      var y = V(292), B = V(651);
      const N = Symbol("INTERNAL");
      class U {
        #t = !1;
        #e = !1;
        #s = !1;
        #n = !0;
        constructor(E, {
          name: v,
          intent: r,
          usage: d
        }) {
          this.#t = !!(E & y.RenderingIntentFlag.DISPLAY), this.#e = !!(E & y.RenderingIntentFlag.PRINT), this.name = v, this.intent = r, this.usage = d;
        }
        get visible() {
          if (this.#s)
            return this.#n;
          if (!this.#n)
            return !1;
          const {
            print: E,
            view: v
          } = this.usage;
          return this.#t ? v?.viewState !== "OFF" : this.#e ? E?.printState !== "OFF" : !0;
        }
        _setVisible(E, v, r = !1) {
          E !== N && (0, y.unreachable)("Internal method `_setVisible` called."), this.#s = r, this.#n = v;
        }
      }
      class P {
        #t = null;
        #e = /* @__PURE__ */ new Map();
        #s = null;
        #n = null;
        constructor(E, v = y.RenderingIntentFlag.DISPLAY) {
          if (this.renderingIntent = v, this.name = null, this.creator = null, E !== null) {
            this.name = E.name, this.creator = E.creator, this.#n = E.order;
            for (const r of E.groups)
              this.#e.set(r.id, new U(v, r));
            if (E.baseState === "OFF")
              for (const r of this.#e.values())
                r._setVisible(N, !1);
            for (const r of E.on)
              this.#e.get(r)._setVisible(N, !0);
            for (const r of E.off)
              this.#e.get(r)._setVisible(N, !1);
            this.#s = this.getHash();
          }
        }
        #r(E) {
          const v = E.length;
          if (v < 2)
            return !0;
          const r = E[0];
          for (let d = 1; d < v; d++) {
            const o = E[d];
            let b;
            if (Array.isArray(o))
              b = this.#r(o);
            else if (this.#e.has(o))
              b = this.#e.get(o).visible;
            else
              return (0, y.warn)(`Optional content group not found: ${o}`), !0;
            switch (r) {
              case "And":
                if (!b)
                  return !1;
                break;
              case "Or":
                if (b)
                  return !0;
                break;
              case "Not":
                return !b;
              default:
                return !0;
            }
          }
          return r === "And";
        }
        isVisible(E) {
          if (this.#e.size === 0)
            return !0;
          if (!E)
            return (0, y.info)("Optional content group not defined."), !0;
          if (E.type === "OCG")
            return this.#e.has(E.id) ? this.#e.get(E.id).visible : ((0, y.warn)(`Optional content group not found: ${E.id}`), !0);
          if (E.type === "OCMD") {
            if (E.expression)
              return this.#r(E.expression);
            if (!E.policy || E.policy === "AnyOn") {
              for (const v of E.ids) {
                if (!this.#e.has(v))
                  return (0, y.warn)(`Optional content group not found: ${v}`), !0;
                if (this.#e.get(v).visible)
                  return !0;
              }
              return !1;
            } else if (E.policy === "AllOn") {
              for (const v of E.ids) {
                if (!this.#e.has(v))
                  return (0, y.warn)(`Optional content group not found: ${v}`), !0;
                if (!this.#e.get(v).visible)
                  return !1;
              }
              return !0;
            } else if (E.policy === "AnyOff") {
              for (const v of E.ids) {
                if (!this.#e.has(v))
                  return (0, y.warn)(`Optional content group not found: ${v}`), !0;
                if (!this.#e.get(v).visible)
                  return !0;
              }
              return !1;
            } else if (E.policy === "AllOff") {
              for (const v of E.ids) {
                if (!this.#e.has(v))
                  return (0, y.warn)(`Optional content group not found: ${v}`), !0;
                if (this.#e.get(v).visible)
                  return !1;
              }
              return !0;
            }
            return (0, y.warn)(`Unknown optional content policy ${E.policy}.`), !0;
          }
          return (0, y.warn)(`Unknown group type ${E.type}.`), !0;
        }
        setVisibility(E, v = !0) {
          const r = this.#e.get(E);
          if (!r) {
            (0, y.warn)(`Optional content group not found: ${E}`);
            return;
          }
          r._setVisible(N, !!v, !0), this.#t = null;
        }
        setOCGState({
          state: E,
          preserveRB: v
        }) {
          let r;
          for (const d of E) {
            switch (d) {
              case "ON":
              case "OFF":
              case "Toggle":
                r = d;
                continue;
            }
            const o = this.#e.get(d);
            if (o)
              switch (r) {
                case "ON":
                  o._setVisible(N, !0);
                  break;
                case "OFF":
                  o._setVisible(N, !1);
                  break;
                case "Toggle":
                  o._setVisible(N, !o.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, y.objectFromMap)(this.#e) : null;
        }
        getGroup(E) {
          return this.#e.get(E) || null;
        }
        getHash() {
          if (this.#t !== null)
            return this.#t;
          const E = new B.MurmurHash3_64();
          for (const [v, r] of this.#e)
            E.update(`${v}:${r.visible}`);
          return this.#t = E.hexdigest();
        }
      }
    }
  ),
  /***/
  814: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        cleanupTextLayer: () => (
          /* binding */
          r
        ),
        /* harmony export */
        renderTextLayer: () => (
          /* binding */
          t
        ),
        /* harmony export */
        updateTextLayer: () => (
          /* binding */
          i
        )
        /* harmony export */
      });
      var y = V(292), B = V(419);
      const N = 1e5, U = 30, P = 0.8, C = /* @__PURE__ */ new Map();
      let E = null;
      function v() {
        if (!E) {
          const l = document.createElement("canvas");
          l.className = "hiddenCanvasElement", document.body.append(l), E = l.getContext("2d", {
            alpha: !1
          });
        }
        return E;
      }
      function r() {
        E?.canvas.remove(), E = null;
      }
      function d(l) {
        const p = C.get(l);
        if (p)
          return p;
        const w = v(), S = w.font;
        w.canvas.width = w.canvas.height = U, w.font = `${U}px ${l}`;
        const L = w.measureText("");
        let M = L.fontBoundingBoxAscent, _ = Math.abs(L.fontBoundingBoxDescent);
        if (M) {
          const z = M / (M + _);
          return C.set(l, z), w.canvas.width = w.canvas.height = 0, w.font = S, z;
        }
        w.strokeStyle = "red", w.clearRect(0, 0, U, U), w.strokeText("g", 0, 0);
        let O = w.getImageData(0, 0, U, U).data;
        _ = 0;
        for (let z = O.length - 1 - 3; z >= 0; z -= 4)
          if (O[z] > 0) {
            _ = Math.ceil(z / 4 / U);
            break;
          }
        w.clearRect(0, 0, U, U), w.strokeText("A", 0, U), O = w.getImageData(0, 0, U, U).data, M = 0;
        for (let z = 0, K = O.length; z < K; z += 4)
          if (O[z] > 0) {
            M = U - Math.floor(z / 4 / U);
            break;
          }
        if (w.canvas.width = w.canvas.height = 0, w.font = S, M) {
          const z = M / (M + _);
          return C.set(l, z), z;
        }
        return C.set(l, P), P;
      }
      function o(l, p, w) {
        const S = document.createElement("span"), L = {
          angle: 0,
          canvasWidth: 0,
          hasText: p.str !== "",
          hasEOL: p.hasEOL,
          fontSize: 0
        };
        l._textDivs.push(S);
        const M = y.Util.transform(l._transform, p.transform);
        let _ = Math.atan2(M[1], M[0]);
        const O = w[p.fontName];
        O.vertical && (_ += Math.PI / 2);
        const z = l._fontInspectorEnabled && O.fontSubstitution || O.fontFamily, K = Math.hypot(M[2], M[3]), nt = K * d(z);
        let j, H;
        _ === 0 ? (j = M[4], H = M[5] - nt) : (j = M[4] + nt * Math.sin(_), H = M[5] - nt * Math.cos(_));
        const G = "calc(var(--scale-factor)*", Y = S.style;
        l._container === l._rootContainer ? (Y.left = `${(100 * j / l._pageWidth).toFixed(2)}%`, Y.top = `${(100 * H / l._pageHeight).toFixed(2)}%`) : (Y.left = `${G}${j.toFixed(2)}px)`, Y.top = `${G}${H.toFixed(2)}px)`), Y.fontSize = `${G}${K.toFixed(2)}px)`, Y.fontFamily = z, L.fontSize = K, S.setAttribute("role", "presentation"), S.textContent = p.str, S.dir = p.dir, l._fontInspectorEnabled && (S.dataset.fontName = O.fontSubstitutionLoadedName || p.fontName), _ !== 0 && (L.angle = _ * (180 / Math.PI));
        let et = !1;
        if (p.str.length > 1)
          et = !0;
        else if (p.str !== " " && p.transform[0] !== p.transform[3]) {
          const tt = Math.abs(p.transform[0]), ot = Math.abs(p.transform[3]);
          tt !== ot && Math.max(tt, ot) / Math.min(tt, ot) > 1.5 && (et = !0);
        }
        et && (L.canvasWidth = O.vertical ? p.height : p.width), l._textDivProperties.set(S, L), l._isReadableStream && l._layoutText(S);
      }
      function b(l) {
        const {
          div: p,
          scale: w,
          properties: S,
          ctx: L,
          prevFontSize: M,
          prevFontFamily: _
        } = l, {
          style: O
        } = p;
        let z = "";
        if (S.canvasWidth !== 0 && S.hasText) {
          const {
            fontFamily: K
          } = O, {
            canvasWidth: nt,
            fontSize: j
          } = S;
          (M !== j || _ !== K) && (L.font = `${j * w}px ${K}`, l.prevFontSize = j, l.prevFontFamily = K);
          const {
            width: H
          } = L.measureText(p.textContent);
          H > 0 && (z = `scaleX(${nt * w / H})`);
        }
        S.angle !== 0 && (z = `rotate(${S.angle}deg) ${z}`), z.length > 0 && (O.transform = z);
      }
      function s(l) {
        if (l._canceled)
          return;
        const p = l._textDivs, w = l._capability;
        if (p.length > N) {
          w.resolve();
          return;
        }
        if (!l._isReadableStream)
          for (const L of p)
            l._layoutText(L);
        w.resolve();
      }
      class g {
        constructor({
          textContentSource: p,
          container: w,
          viewport: S,
          textDivs: L,
          textDivProperties: M,
          textContentItemsStr: _
        }) {
          this._textContentSource = p, this._isReadableStream = p instanceof ReadableStream, this._container = this._rootContainer = w, this._textDivs = L || [], this._textContentItemsStr = _ || [], this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled, this._reader = null, this._textDivProperties = M || /* @__PURE__ */ new WeakMap(), this._canceled = !1, this._capability = Promise.withResolvers(), this._layoutTextParams = {
            prevFontSize: null,
            prevFontFamily: null,
            div: null,
            scale: S.scale * (globalThis.devicePixelRatio || 1),
            properties: null,
            ctx: v()
          };
          const {
            pageWidth: O,
            pageHeight: z,
            pageX: K,
            pageY: nt
          } = S.rawDims;
          this._transform = [1, 0, 0, -1, -K, nt + z], this._pageWidth = O, this._pageHeight = z, (0, B.setLayerDimensions)(w, S), this._capability.promise.finally(() => {
            this._layoutTextParams = null;
          }).catch(() => {
          });
        }
        get promise() {
          return this._capability.promise;
        }
        cancel() {
          this._canceled = !0, this._reader && (this._reader.cancel(new y.AbortException("TextLayer task cancelled.")).catch(() => {
          }), this._reader = null), this._capability.reject(new y.AbortException("TextLayer task cancelled."));
        }
        _processItems(p, w) {
          for (const S of p) {
            if (S.str === void 0) {
              if (S.type === "beginMarkedContentProps" || S.type === "beginMarkedContent") {
                const L = this._container;
                this._container = document.createElement("span"), this._container.classList.add("markedContent"), S.id !== null && this._container.setAttribute("id", `${S.id}`), L.append(this._container);
              } else
                S.type === "endMarkedContent" && (this._container = this._container.parentNode);
              continue;
            }
            this._textContentItemsStr.push(S.str), o(this, S, w);
          }
        }
        _layoutText(p) {
          const w = this._layoutTextParams.properties = this._textDivProperties.get(p);
          if (this._layoutTextParams.div = p, b(this._layoutTextParams), w.hasText && this._container.append(p), w.hasEOL) {
            const S = document.createElement("br");
            S.setAttribute("role", "presentation"), this._container.append(S);
          }
        }
        _render() {
          const {
            promise: p,
            resolve: w,
            reject: S
          } = Promise.withResolvers();
          let L = /* @__PURE__ */ Object.create(null);
          if (this._isReadableStream) {
            const M = () => {
              this._reader.read().then(({
                value: _,
                done: O
              }) => {
                if (O) {
                  w();
                  return;
                }
                Object.assign(L, _.styles), this._processItems(_.items, L), M();
              }, S);
            };
            this._reader = this._textContentSource.getReader(), M();
          } else if (this._textContentSource) {
            const {
              items: M,
              styles: _
            } = this._textContentSource;
            this._processItems(M, _), w();
          } else
            throw new Error('No "textContentSource" parameter specified.');
          p.then(() => {
            L = null, s(this);
          }, this._capability.reject);
        }
      }
      function t(l) {
        const p = new g(l);
        return p._render(), p;
      }
      function i({
        container: l,
        viewport: p,
        textDivs: w,
        textDivProperties: S,
        mustRotate: L = !0,
        mustRescale: M = !0
      }) {
        if (L && (0, B.setLayerDimensions)(l, {
          rotation: p.rotation
        }), M) {
          const _ = v(), z = {
            prevFontSize: null,
            prevFontFamily: null,
            div: null,
            scale: p.scale * (globalThis.devicePixelRatio || 1),
            properties: null,
            ctx: _
          };
          for (const K of w)
            z.properties = S.get(K), z.div = K, b(z);
        }
      }
    }
  ),
  /***/
  585: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        PDFDataTransportStream: () => (
          /* binding */
          N
        )
        /* harmony export */
      });
      var y = V(292), B = V(419);
      class N {
        constructor(E, {
          disableRange: v = !1,
          disableStream: r = !1
        }) {
          (0, y.assert)(E, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
          const {
            length: d,
            initialData: o,
            progressiveDone: b,
            contentDispositionFilename: s
          } = E;
          if (this._queuedChunks = [], this._progressiveDone = b, this._contentDispositionFilename = s, o?.length > 0) {
            const g = o instanceof Uint8Array && o.byteLength === o.buffer.byteLength ? o.buffer : new Uint8Array(o).buffer;
            this._queuedChunks.push(g);
          }
          this._pdfDataRangeTransport = E, this._isStreamingSupported = !r, this._isRangeSupported = !v, this._contentLength = d, this._fullRequestReader = null, this._rangeReaders = [], E.addRangeListener((g, t) => {
            this._onReceiveData({
              begin: g,
              chunk: t
            });
          }), E.addProgressListener((g, t) => {
            this._onProgress({
              loaded: g,
              total: t
            });
          }), E.addProgressiveReadListener((g) => {
            this._onReceiveData({
              chunk: g
            });
          }), E.addProgressiveDoneListener(() => {
            this._onProgressiveDone();
          }), E.transportReady();
        }
        _onReceiveData({
          begin: E,
          chunk: v
        }) {
          const r = v instanceof Uint8Array && v.byteLength === v.buffer.byteLength ? v.buffer : new Uint8Array(v).buffer;
          if (E === void 0)
            this._fullRequestReader ? this._fullRequestReader._enqueue(r) : this._queuedChunks.push(r);
          else {
            const d = this._rangeReaders.some(function(o) {
              return o._begin !== E ? !1 : (o._enqueue(r), !0);
            });
            (0, y.assert)(d, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
          }
        }
        get _progressiveDataLength() {
          return this._fullRequestReader?._loaded ?? 0;
        }
        _onProgress(E) {
          E.total === void 0 ? this._rangeReaders[0]?.onProgress?.({
            loaded: E.loaded
          }) : this._fullRequestReader?.onProgress?.({
            loaded: E.loaded,
            total: E.total
          });
        }
        _onProgressiveDone() {
          this._fullRequestReader?.progressiveDone(), this._progressiveDone = !0;
        }
        _removeRangeReader(E) {
          const v = this._rangeReaders.indexOf(E);
          v >= 0 && this._rangeReaders.splice(v, 1);
        }
        getFullReader() {
          (0, y.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
          const E = this._queuedChunks;
          return this._queuedChunks = null, new U(this, E, this._progressiveDone, this._contentDispositionFilename);
        }
        getRangeReader(E, v) {
          if (v <= this._progressiveDataLength)
            return null;
          const r = new P(this, E, v);
          return this._pdfDataRangeTransport.requestDataRange(E, v), this._rangeReaders.push(r), r;
        }
        cancelAllRequests(E) {
          this._fullRequestReader?.cancel(E);
          for (const v of this._rangeReaders.slice(0))
            v.cancel(E);
          this._pdfDataRangeTransport.abort();
        }
      }
      class U {
        constructor(E, v, r = !1, d = null) {
          this._stream = E, this._done = r || !1, this._filename = (0, B.isPdfFile)(d) ? d : null, this._queuedChunks = v || [], this._loaded = 0;
          for (const o of this._queuedChunks)
            this._loaded += o.byteLength;
          this._requests = [], this._headersReady = Promise.resolve(), E._fullRequestReader = this, this.onProgress = null;
        }
        _enqueue(E) {
          this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
            value: E,
            done: !1
          }) : this._queuedChunks.push(E), this._loaded += E.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 E = Promise.withResolvers();
          return this._requests.push(E), E.promise;
        }
        cancel(E) {
          this._done = !0;
          for (const v of this._requests)
            v.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0;
        }
        progressiveDone() {
          this._done || (this._done = !0);
        }
      }
      class P {
        constructor(E, v, r) {
          this._stream = E, this._begin = v, this._end = r, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
        }
        _enqueue(E) {
          if (!this._done) {
            if (this._requests.length === 0)
              this._queuedChunk = E;
            else {
              this._requests.shift().resolve({
                value: E,
                done: !1
              });
              for (const r of this._requests)
                r.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 v = this._queuedChunk;
            return this._queuedChunk = null, {
              value: v,
              done: !1
            };
          }
          if (this._done)
            return {
              value: void 0,
              done: !0
            };
          const E = Promise.withResolvers();
          return this._requests.push(E), E.promise;
        }
        cancel(E) {
          this._done = !0;
          for (const v of this._requests)
            v.resolve({
              value: void 0,
              done: !0
            });
          this._requests.length = 0, this._stream._removeRangeReader(this);
        }
      }
    }
  ),
  /***/
  164: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        GlobalWorkerOptions: () => (
          /* binding */
          y
        )
        /* harmony export */
      });
      class y {
        static #t = null;
        static #e = "";
        static get workerPort() {
          return this.#t;
        }
        static set workerPort(N) {
          if (!(typeof Worker < "u" && N instanceof Worker) && N !== null)
            throw new Error("Invalid `workerPort` type.");
          this.#t = N;
        }
        static get workerSrc() {
          return this.#e;
        }
        static set workerSrc(N) {
          if (typeof N != "string")
            throw new Error("Invalid `workerSrc` type.");
          this.#e = N;
        }
      }
    }
  ),
  /***/
  284: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        XfaLayer: () => (
          /* binding */
          B
        )
        /* harmony export */
      });
      var y = V(50);
      class B {
        static setupStorage(U, P, C, E, v) {
          const r = E.getValue(P, {
            value: null
          });
          switch (C.name) {
            case "textarea":
              if (r.value !== null && (U.textContent = r.value), v === "print")
                break;
              U.addEventListener("input", (d) => {
                E.setValue(P, {
                  value: d.target.value
                });
              });
              break;
            case "input":
              if (C.attributes.type === "radio" || C.attributes.type === "checkbox") {
                if (r.value === C.attributes.xfaOn ? U.setAttribute("checked", !0) : r.value === C.attributes.xfaOff && U.removeAttribute("checked"), v === "print")
                  break;
                U.addEventListener("change", (d) => {
                  E.setValue(P, {
                    value: d.target.checked ? d.target.getAttribute("xfaOn") : d.target.getAttribute("xfaOff")
                  });
                });
              } else {
                if (r.value !== null && U.setAttribute("value", r.value), v === "print")
                  break;
                U.addEventListener("input", (d) => {
                  E.setValue(P, {
                    value: d.target.value
                  });
                });
              }
              break;
            case "select":
              if (r.value !== null) {
                U.setAttribute("value", r.value);
                for (const d of C.children)
                  d.attributes.value === r.value ? d.attributes.selected = !0 : d.attributes.hasOwnProperty("selected") && delete d.attributes.selected;
              }
              U.addEventListener("input", (d) => {
                const o = d.target.options, b = o.selectedIndex === -1 ? "" : o[o.selectedIndex].value;
                E.setValue(P, {
                  value: b
                });
              });
              break;
          }
        }
        static setAttributes({
          html: U,
          element: P,
          storage: C = null,
          intent: E,
          linkService: v
        }) {
          const {
            attributes: r
          } = P, d = U instanceof HTMLAnchorElement;
          r.type === "radio" && (r.name = `${r.name}-${E}`);
          for (const [o, b] of Object.entries(r))
            if (b != null)
              switch (o) {
                case "class":
                  b.length && U.setAttribute(o, b.join(" "));
                  break;
                case "dataId":
                  break;
                case "id":
                  U.setAttribute("data-element-id", b);
                  break;
                case "style":
                  Object.assign(U.style, b);
                  break;
                case "textContent":
                  U.textContent = b;
                  break;
                default:
                  (!d || o !== "href" && o !== "newWindow") && U.setAttribute(o, b);
              }
          d && v.addLinkAttributes(U, r.href, r.newWindow), C && r.dataId && this.setupStorage(U, r.dataId, P, C);
        }
        static render(U) {
          const P = U.annotationStorage, C = U.linkService, E = U.xfaHtml, v = U.intent || "display", r = document.createElement(E.name);
          E.attributes && this.setAttributes({
            html: r,
            element: E,
            intent: v,
            linkService: C
          });
          const d = v !== "richText", o = U.div;
          if (o.append(r), U.viewport) {
            const g = `matrix(${U.viewport.transform.join(",")})`;
            o.style.transform = g;
          }
          d && o.setAttribute("class", "xfaLayer xfaFont");
          const b = [];
          if (E.children.length === 0) {
            if (E.value) {
              const g = document.createTextNode(E.value);
              r.append(g), d && y.XfaText.shouldBuildText(E.name) && b.push(g);
            }
            return {
              textDivs: b
            };
          }
          const s = [[E, -1, r]];
          for (; s.length > 0; ) {
            const [g, t, i] = s.at(-1);
            if (t + 1 === g.children.length) {
              s.pop();
              continue;
            }
            const l = g.children[++s.at(-1)[1]];
            if (l === null)
              continue;
            const {
              name: p
            } = l;
            if (p === "#text") {
              const S = document.createTextNode(l.value);
              b.push(S), i.append(S);
              continue;
            }
            const w = l?.attributes?.xmlns ? document.createElementNS(l.attributes.xmlns, p) : document.createElement(p);
            if (i.append(w), l.attributes && this.setAttributes({
              html: w,
              element: l,
              storage: P,
              intent: v,
              linkService: C
            }), l.children?.length > 0)
              s.push([l, -1, w]);
            else if (l.value) {
              const S = document.createTextNode(l.value);
              d && y.XfaText.shouldBuildText(p) && b.push(S), w.append(S);
            }
          }
          for (const g of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
            g.setAttribute("readOnly", !0);
          return {
            textDivs: b
          };
        }
        static update(U) {
          const P = `matrix(${U.viewport.transform.join(",")})`;
          U.div.style.transform = P, U.div.hidden = !1;
        }
      }
    }
  ),
  /***/
  50: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        XfaText: () => (
          /* binding */
          y
        )
        /* harmony export */
      });
      class y {
        static textContent(N) {
          const U = [], P = {
            items: U,
            styles: /* @__PURE__ */ Object.create(null)
          };
          function C(E) {
            if (!E)
              return;
            let v = null;
            const r = E.name;
            if (r === "#text")
              v = E.value;
            else if (y.shouldBuildText(r))
              E?.attributes?.textContent ? v = E.attributes.textContent : E.value && (v = E.value);
            else
              return;
            if (v !== null && U.push({
              str: v
            }), !!E.children)
              for (const d of E.children)
                C(d);
          }
          return C(N), P;
        }
        static shouldBuildText(N) {
          return !(N === "textarea" || N === "input" || N === "option" || N === "select");
        }
      }
    }
  ),
  /***/
  228: (
    /***/
    (at, W, V) => {
      V.a(at, async (y, B) => {
        try {
          V.d(W, {
            /* harmony export */
            AbortException: () => (
              /* reexport safe */
              N.AbortException
            ),
            /* harmony export */
            AnnotationEditorLayer: () => (
              /* reexport safe */
              E.AnnotationEditorLayer
            ),
            /* harmony export */
            AnnotationEditorParamsType: () => (
              /* reexport safe */
              N.AnnotationEditorParamsType
            ),
            /* harmony export */
            AnnotationEditorType: () => (
              /* reexport safe */
              N.AnnotationEditorType
            ),
            /* harmony export */
            AnnotationEditorUIManager: () => (
              /* reexport safe */
              v.AnnotationEditorUIManager
            ),
            /* harmony export */
            AnnotationLayer: () => (
              /* reexport safe */
              r.AnnotationLayer
            ),
            /* harmony export */
            AnnotationMode: () => (
              /* reexport safe */
              N.AnnotationMode
            ),
            /* harmony export */
            CMapCompressionType: () => (
              /* reexport safe */
              N.CMapCompressionType
            ),
            /* harmony export */
            ColorPicker: () => (
              /* reexport safe */
              d.ColorPicker
            ),
            /* harmony export */
            DOMSVGFactory: () => (
              /* reexport safe */
              P.DOMSVGFactory
            ),
            /* harmony export */
            DrawLayer: () => (
              /* reexport safe */
              o.DrawLayer
            ),
            /* harmony export */
            FeatureTest: () => (
              /* reexport safe */
              N.FeatureTest
            ),
            /* harmony export */
            GlobalWorkerOptions: () => (
              /* reexport safe */
              b.GlobalWorkerOptions
            ),
            /* harmony export */
            ImageKind: () => (
              /* reexport safe */
              N.ImageKind
            ),
            /* harmony export */
            InvalidPDFException: () => (
              /* reexport safe */
              N.InvalidPDFException
            ),
            /* harmony export */
            MissingPDFException: () => (
              /* reexport safe */
              N.MissingPDFException
            ),
            /* harmony export */
            OPS: () => (
              /* reexport safe */
              N.OPS
            ),
            /* harmony export */
            Outliner: () => (
              /* reexport safe */
              s.Outliner
            ),
            /* harmony export */
            PDFDataRangeTransport: () => (
              /* reexport safe */
              U.PDFDataRangeTransport
            ),
            /* harmony export */
            PDFDateString: () => (
              /* reexport safe */
              P.PDFDateString
            ),
            /* harmony export */
            PDFWorker: () => (
              /* reexport safe */
              U.PDFWorker
            ),
            /* harmony export */
            PasswordResponses: () => (
              /* reexport safe */
              N.PasswordResponses
            ),
            /* harmony export */
            PermissionFlag: () => (
              /* reexport safe */
              N.PermissionFlag
            ),
            /* harmony export */
            PixelsPerInch: () => (
              /* reexport safe */
              P.PixelsPerInch
            ),
            /* harmony export */
            RenderingCancelledException: () => (
              /* reexport safe */
              P.RenderingCancelledException
            ),
            /* harmony export */
            UnexpectedResponseException: () => (
              /* reexport safe */
              N.UnexpectedResponseException
            ),
            /* harmony export */
            Util: () => (
              /* reexport safe */
              N.Util
            ),
            /* harmony export */
            VerbosityLevel: () => (
              /* reexport safe */
              N.VerbosityLevel
            ),
            /* harmony export */
            XfaLayer: () => (
              /* reexport safe */
              g.XfaLayer
            ),
            /* harmony export */
            build: () => (
              /* reexport safe */
              U.build
            ),
            /* harmony export */
            createValidAbsoluteUrl: () => (
              /* reexport safe */
              N.createValidAbsoluteUrl
            ),
            /* harmony export */
            fetchData: () => (
              /* reexport safe */
              P.fetchData
            ),
            /* harmony export */
            getDocument: () => (
              /* reexport safe */
              U.getDocument
            ),
            /* harmony export */
            getFilenameFromUrl: () => (
              /* reexport safe */
              P.getFilenameFromUrl
            ),
            /* harmony export */
            getPdfFilenameFromUrl: () => (
              /* reexport safe */
              P.getPdfFilenameFromUrl
            ),
            /* harmony export */
            getXfaPageViewport: () => (
              /* reexport safe */
              P.getXfaPageViewport
            ),
            /* harmony export */
            isDataScheme: () => (
              /* reexport safe */
              P.isDataScheme
            ),
            /* harmony export */
            isPdfFile: () => (
              /* reexport safe */
              P.isPdfFile
            ),
            /* harmony export */
            noContextMenu: () => (
              /* reexport safe */
              P.noContextMenu
            ),
            /* harmony export */
            normalizeUnicode: () => (
              /* reexport safe */
              N.normalizeUnicode
            ),
            /* harmony export */
            renderTextLayer: () => (
              /* reexport safe */
              C.renderTextLayer
            ),
            /* harmony export */
            setLayerDimensions: () => (
              /* reexport safe */
              P.setLayerDimensions
            ),
            /* harmony export */
            shadow: () => (
              /* reexport safe */
              N.shadow
            ),
            /* harmony export */
            updateTextLayer: () => (
              /* reexport safe */
              C.updateTextLayer
            ),
            /* harmony export */
            version: () => (
              /* reexport safe */
              U.version
            )
            /* harmony export */
          });
          var N = V(292), U = V(831), P = V(419), C = V(814), E = V(731), v = V(830), r = V(976), d = V(259), o = V(47), b = V(164), s = V(61), g = V(284), t = y([U]);
          U = (t.then ? (await t)() : t)[0];
          const i = "4.2.67", l = "49b388101";
          B();
        } catch (i) {
          B(i);
        }
      });
    }
  ),
  /***/
  178: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        MessageHandler: () => (
          /* binding */
          P
        )
        /* harmony export */
      });
      var y = V(292);
      const B = {
        UNKNOWN: 0,
        DATA: 1,
        ERROR: 2
      }, N = {
        UNKNOWN: 0,
        CANCEL: 1,
        CANCEL_COMPLETE: 2,
        CLOSE: 3,
        ENQUEUE: 4,
        ERROR: 5,
        PULL: 6,
        PULL_COMPLETE: 7,
        START_COMPLETE: 8
      };
      function U(C) {
        switch (C instanceof Error || typeof C == "object" && C !== null || (0, y.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), C.name) {
          case "AbortException":
            return new y.AbortException(C.message);
          case "MissingPDFException":
            return new y.MissingPDFException(C.message);
          case "PasswordException":
            return new y.PasswordException(C.message, C.code);
          case "UnexpectedResponseException":
            return new y.UnexpectedResponseException(C.message, C.status);
          case "UnknownErrorException":
            return new y.UnknownErrorException(C.message, C.details);
          default:
            return new y.UnknownErrorException(C.message, C.toString());
        }
      }
      class P {
        constructor(E, v, r) {
          this.sourceName = E, this.targetName = v, this.comObj = r, this.callbackId = 1, this.streamId = 1, this.streamSinks = /* @__PURE__ */ Object.create(null), this.streamControllers = /* @__PURE__ */ Object.create(null), this.callbackCapabilities = /* @__PURE__ */ Object.create(null), this.actionHandler = /* @__PURE__ */ Object.create(null), this._onComObjOnMessage = (d) => {
            const o = d.data;
            if (o.targetName !== this.sourceName)
              return;
            if (o.stream) {
              this.#e(o);
              return;
            }
            if (o.callback) {
              const s = o.callbackId, g = this.callbackCapabilities[s];
              if (!g)
                throw new Error(`Cannot resolve callback ${s}`);
              if (delete this.callbackCapabilities[s], o.callback === B.DATA)
                g.resolve(o.data);
              else if (o.callback === B.ERROR)
                g.reject(U(o.reason));
              else
                throw new Error("Unexpected callback case");
              return;
            }
            const b = this.actionHandler[o.action];
            if (!b)
              throw new Error(`Unknown action from worker: ${o.action}`);
            if (o.callbackId) {
              const s = this.sourceName, g = o.sourceName;
              new Promise(function(t) {
                t(b(o.data));
              }).then(function(t) {
                r.postMessage({
                  sourceName: s,
                  targetName: g,
                  callback: B.DATA,
                  callbackId: o.callbackId,
                  data: t
                });
              }, function(t) {
                r.postMessage({
                  sourceName: s,
                  targetName: g,
                  callback: B.ERROR,
                  callbackId: o.callbackId,
                  reason: U(t)
                });
              });
              return;
            }
            if (o.streamId) {
              this.#t(o);
              return;
            }
            b(o.data);
          }, r.addEventListener("message", this._onComObjOnMessage);
        }
        on(E, v) {
          const r = this.actionHandler;
          if (r[E])
            throw new Error(`There is already an actionName called "${E}"`);
          r[E] = v;
        }
        send(E, v, r) {
          this.comObj.postMessage({
            sourceName: this.sourceName,
            targetName: this.targetName,
            action: E,
            data: v
          }, r);
        }
        sendWithPromise(E, v, r) {
          const d = this.callbackId++, o = Promise.withResolvers();
          this.callbackCapabilities[d] = o;
          try {
            this.comObj.postMessage({
              sourceName: this.sourceName,
              targetName: this.targetName,
              action: E,
              callbackId: d,
              data: v
            }, r);
          } catch (b) {
            o.reject(b);
          }
          return o.promise;
        }
        sendWithStream(E, v, r, d) {
          const o = this.streamId++, b = this.sourceName, s = this.targetName, g = this.comObj;
          return new ReadableStream({
            start: (t) => {
              const i = Promise.withResolvers();
              return this.streamControllers[o] = {
                controller: t,
                startCall: i,
                pullCall: null,
                cancelCall: null,
                isClosed: !1
              }, g.postMessage({
                sourceName: b,
                targetName: s,
                action: E,
                streamId: o,
                data: v,
                desiredSize: t.desiredSize
              }, d), i.promise;
            },
            pull: (t) => {
              const i = Promise.withResolvers();
              return this.streamControllers[o].pullCall = i, g.postMessage({
                sourceName: b,
                targetName: s,
                stream: N.PULL,
                streamId: o,
                desiredSize: t.desiredSize
              }), i.promise;
            },
            cancel: (t) => {
              (0, y.assert)(t instanceof Error, "cancel must have a valid reason");
              const i = Promise.withResolvers();
              return this.streamControllers[o].cancelCall = i, this.streamControllers[o].isClosed = !0, g.postMessage({
                sourceName: b,
                targetName: s,
                stream: N.CANCEL,
                streamId: o,
                reason: U(t)
              }), i.promise;
            }
          }, r);
        }
        #t(E) {
          const v = E.streamId, r = this.sourceName, d = E.sourceName, o = this.comObj, b = this, s = this.actionHandler[E.action], g = {
            enqueue(t, i = 1, l) {
              if (this.isCancelled)
                return;
              const p = this.desiredSize;
              this.desiredSize -= i, p > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), o.postMessage({
                sourceName: r,
                targetName: d,
                stream: N.ENQUEUE,
                streamId: v,
                chunk: t
              }, l);
            },
            close() {
              this.isCancelled || (this.isCancelled = !0, o.postMessage({
                sourceName: r,
                targetName: d,
                stream: N.CLOSE,
                streamId: v
              }), delete b.streamSinks[v]);
            },
            error(t) {
              (0, y.assert)(t instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, o.postMessage({
                sourceName: r,
                targetName: d,
                stream: N.ERROR,
                streamId: v,
                reason: U(t)
              }));
            },
            sinkCapability: Promise.withResolvers(),
            onPull: null,
            onCancel: null,
            isCancelled: !1,
            desiredSize: E.desiredSize,
            ready: null
          };
          g.sinkCapability.resolve(), g.ready = g.sinkCapability.promise, this.streamSinks[v] = g, new Promise(function(t) {
            t(s(E.data, g));
          }).then(function() {
            o.postMessage({
              sourceName: r,
              targetName: d,
              stream: N.START_COMPLETE,
              streamId: v,
              success: !0
            });
          }, function(t) {
            o.postMessage({
              sourceName: r,
              targetName: d,
              stream: N.START_COMPLETE,
              streamId: v,
              reason: U(t)
            });
          });
        }
        #e(E) {
          const v = E.streamId, r = this.sourceName, d = E.sourceName, o = this.comObj, b = this.streamControllers[v], s = this.streamSinks[v];
          switch (E.stream) {
            case N.START_COMPLETE:
              E.success ? b.startCall.resolve() : b.startCall.reject(U(E.reason));
              break;
            case N.PULL_COMPLETE:
              E.success ? b.pullCall.resolve() : b.pullCall.reject(U(E.reason));
              break;
            case N.PULL:
              if (!s) {
                o.postMessage({
                  sourceName: r,
                  targetName: d,
                  stream: N.PULL_COMPLETE,
                  streamId: v,
                  success: !0
                });
                break;
              }
              s.desiredSize <= 0 && E.desiredSize > 0 && s.sinkCapability.resolve(), s.desiredSize = E.desiredSize, new Promise(function(g) {
                g(s.onPull?.());
              }).then(function() {
                o.postMessage({
                  sourceName: r,
                  targetName: d,
                  stream: N.PULL_COMPLETE,
                  streamId: v,
                  success: !0
                });
              }, function(g) {
                o.postMessage({
                  sourceName: r,
                  targetName: d,
                  stream: N.PULL_COMPLETE,
                  streamId: v,
                  reason: U(g)
                });
              });
              break;
            case N.ENQUEUE:
              if ((0, y.assert)(b, "enqueue should have stream controller"), b.isClosed)
                break;
              b.controller.enqueue(E.chunk);
              break;
            case N.CLOSE:
              if ((0, y.assert)(b, "close should have stream controller"), b.isClosed)
                break;
              b.isClosed = !0, b.controller.close(), this.#s(b, v);
              break;
            case N.ERROR:
              (0, y.assert)(b, "error should have stream controller"), b.controller.error(U(E.reason)), this.#s(b, v);
              break;
            case N.CANCEL_COMPLETE:
              E.success ? b.cancelCall.resolve() : b.cancelCall.reject(U(E.reason)), this.#s(b, v);
              break;
            case N.CANCEL:
              if (!s)
                break;
              new Promise(function(g) {
                g(s.onCancel?.(U(E.reason)));
              }).then(function() {
                o.postMessage({
                  sourceName: r,
                  targetName: d,
                  stream: N.CANCEL_COMPLETE,
                  streamId: v,
                  success: !0
                });
              }, function(g) {
                o.postMessage({
                  sourceName: r,
                  targetName: d,
                  stream: N.CANCEL_COMPLETE,
                  streamId: v,
                  reason: U(g)
                });
              }), s.sinkCapability.reject(U(E.reason)), s.isCancelled = !0, delete this.streamSinks[v];
              break;
            default:
              throw new Error("Unexpected stream case");
          }
        }
        async #s(E, v) {
          await Promise.allSettled([E.startCall?.promise, E.pullCall?.promise, E.cancelCall?.promise]), delete this.streamControllers[v];
        }
        destroy() {
          this.comObj.removeEventListener("message", this._onComObjOnMessage);
        }
      }
    }
  ),
  /***/
  651: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        MurmurHash3_64: () => (
          /* binding */
          U
        )
        /* harmony export */
      });
      const y = 3285377520, B = 4294901760, N = 65535;
      class U {
        constructor(C) {
          this.h1 = C ? C & 4294967295 : y, this.h2 = C ? C & 4294967295 : y;
        }
        update(C) {
          let E, v;
          if (typeof C == "string") {
            E = new Uint8Array(C.length * 2), v = 0;
            for (let S = 0, L = C.length; S < L; S++) {
              const M = C.charCodeAt(S);
              M <= 255 ? E[v++] = M : (E[v++] = M >>> 8, E[v++] = M & 255);
            }
          } else if (ArrayBuffer.isView(C))
            E = C.slice(), v = E.byteLength;
          else
            throw new Error("Invalid data format, must be a string or TypedArray.");
          const r = v >> 2, d = v - r * 4, o = new Uint32Array(E.buffer, 0, r);
          let b = 0, s = 0, g = this.h1, t = this.h2;
          const i = 3432918353, l = 461845907, p = i & N, w = l & N;
          for (let S = 0; S < r; S++)
            S & 1 ? (b = o[S], b = b * i & B | b * p & N, b = b << 15 | b >>> 17, b = b * l & B | b * w & N, g ^= b, g = g << 13 | g >>> 19, g = g * 5 + 3864292196) : (s = o[S], s = s * i & B | s * p & N, s = s << 15 | s >>> 17, s = s * l & B | s * w & N, t ^= s, t = t << 13 | t >>> 19, t = t * 5 + 3864292196);
          switch (b = 0, d) {
            case 3:
              b ^= E[r * 4 + 2] << 16;
            case 2:
              b ^= E[r * 4 + 1] << 8;
            case 1:
              b ^= E[r * 4], b = b * i & B | b * p & N, b = b << 15 | b >>> 17, b = b * l & B | b * w & N, r & 1 ? g ^= b : t ^= b;
          }
          this.h1 = g, this.h2 = t;
        }
        hexdigest() {
          let C = this.h1, E = this.h2;
          return C ^= E >>> 1, C = C * 3981806797 & B | C * 36045 & N, E = E * 4283543511 & B | ((E << 16 | C >>> 16) * 2950163797 & B) >>> 16, C ^= E >>> 1, C = C * 444984403 & B | C * 60499 & N, E = E * 3301882366 & B | ((E << 16 | C >>> 16) * 3120437893 & B) >>> 16, C ^= E >>> 1, (C >>> 0).toString(16).padStart(8, "0") + (E >>> 0).toString(16).padStart(8, "0");
        }
      }
    }
  ),
  /***/
  292: (
    /***/
    (at, W, V) => {
      V.d(W, {
        /* harmony export */
        AbortException: () => (
          /* binding */
          dt
        ),
        /* harmony export */
        AnnotationBorderStyleType: () => (
          /* binding */
          t
        ),
        /* harmony export */
        AnnotationEditorParamsType: () => (
          /* binding */
          d
        ),
        /* harmony export */
        AnnotationEditorPrefix: () => (
          /* binding */
          v
        ),
        /* harmony export */
        AnnotationEditorType: () => (
          /* binding */
          r
        ),
        /* harmony export */
        AnnotationMode: () => (
          /* binding */
          E
        ),
        /* harmony export */
        AnnotationPrefix: () => (
          /* binding */
          k
        ),
        /* harmony export */
        AnnotationType: () => (
          /* binding */
          g
        ),
        /* harmony export */
        BaseException: () => (
          /* binding */
          G
        ),
        /* harmony export */
        CMapCompressionType: () => (
          /* binding */
          l
        ),
        /* harmony export */
        FONT_IDENTITY_MATRIX: () => (
          /* binding */
          N
        ),
        /* harmony export */
        FeatureTest: () => (
          /* binding */
          n
        ),
        /* harmony export */
        FontRenderOps: () => (
          /* binding */
          D
        ),
        /* harmony export */
        FormatError: () => (
          /* binding */
          pt
        ),
        /* harmony export */
        IDENTITY_MATRIX: () => (
          /* binding */
          B
        ),
        /* harmony export */
        ImageKind: () => (
          /* binding */
          s
        ),
        /* harmony export */
        InvalidPDFException: () => (
          /* binding */
          tt
        ),
        /* harmony export */
        LINE_FACTOR: () => (
          /* binding */
          P
        ),
        /* harmony export */
        MAX_IMAGE_SIZE_TO_CACHE: () => (
          /* binding */
          U
        ),
        /* harmony export */
        MissingPDFException: () => (
          /* binding */
          ot
        ),
        /* harmony export */
        OPS: () => (
          /* binding */
          p
        ),
        /* harmony export */
        PasswordException: () => (
          /* binding */
          Y
        ),
        /* harmony export */
        PasswordResponses: () => (
          /* binding */
          w
        ),
        /* harmony export */
        PermissionFlag: () => (
          /* binding */
          o
        ),
        /* harmony export */
        RenderingIntentFlag: () => (
          /* binding */
          C
        ),
        /* harmony export */
        TextRenderingMode: () => (
          /* binding */
          b
        ),
        /* harmony export */
        UnexpectedResponseException: () => (
          /* binding */
          ct
        ),
        /* harmony export */
        UnknownErrorException: () => (
          /* binding */
          et
        ),
        /* harmony export */
        Util: () => (
          /* binding */
          h
        ),
        /* harmony export */
        VerbosityLevel: () => (
          /* binding */
          i
        ),
        /* harmony export */
        assert: () => (
          /* binding */
          K
        ),
        /* harmony export */
        bytesToString: () => (
          /* binding */
          ht
        ),
        /* harmony export */
        createValidAbsoluteUrl: () => (
          /* binding */
          j
        ),
        /* harmony export */
        getUuid: () => (
          /* binding */
          R
        ),
        /* harmony export */
        getVerbosityLevel: () => (
          /* binding */
          M
        ),
        /* harmony export */
        info: () => (
          /* binding */
          _
        ),
        /* harmony export */
        isNodeJS: () => (
          /* binding */
          y
        ),
        /* harmony export */
        normalizeUnicode: () => (
          /* binding */
          x
        ),
        /* harmony export */
        objectFromMap: () => (
          /* binding */
          m
        ),
        /* harmony export */
        setVerbosityLevel: () => (
          /* binding */
          L
        ),
        /* harmony export */
        shadow: () => (
          /* binding */
          H
        ),
        /* harmony export */
        string32: () => (
          /* binding */
          st
        ),
        /* harmony export */
        stringToBytes: () => (
          /* binding */
          ut
        ),
        /* harmony export */
        unreachable: () => (
          /* binding */
          z
        ),
        /* harmony export */
        warn: () => (
          /* binding */
          O
        )
        /* harmony export */
      });
      const y = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), B = [1, 0, 0, 1, 0, 0], N = [1e-3, 0, 0, 1e-3, 0, 0], U = 1e7, P = 1.35, C = {
        ANY: 1,
        DISPLAY: 2,
        PRINT: 4,
        SAVE: 8,
        ANNOTATIONS_FORMS: 16,
        ANNOTATIONS_STORAGE: 32,
        ANNOTATIONS_DISABLE: 64,
        OPLIST: 256
      }, E = {
        DISABLE: 0,
        ENABLE: 1,
        ENABLE_FORMS: 2,
        ENABLE_STORAGE: 3
      }, v = "pdfjs_internal_editor_", r = {
        DISABLE: -1,
        NONE: 0,
        FREETEXT: 3,
        HIGHLIGHT: 9,
        STAMP: 13,
        INK: 15
      }, d = {
        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
      }, o = {
        PRINT: 4,
        MODIFY_CONTENTS: 8,
        COPY: 16,
        MODIFY_ANNOTATIONS: 32,
        FILL_INTERACTIVE_FORMS: 256,
        COPY_FOR_ACCESSIBILITY: 512,
        ASSEMBLE: 1024,
        PRINT_HIGH_QUALITY: 2048
      }, b = {
        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
      }, s = {
        GRAYSCALE_1BPP: 1,
        RGB_24BPP: 2,
        RGBA_32BPP: 3
      }, g = {
        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
      }, i = {
        ERRORS: 0,
        WARNINGS: 1,
        INFOS: 5
      }, l = {
        NONE: 0,
        BINARY: 1
      }, p = {
        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
      }, w = {
        NEED_PASSWORD: 1,
        INCORRECT_PASSWORD: 2
      };
      let S = i.WARNINGS;
      function L(I) {
        Number.isInteger(I) && (S = I);
      }
      function M() {
        return S;
      }
      function _(I) {
        S >= i.INFOS && console.log(`Info: ${I}`);
      }
      function O(I) {
        S >= i.WARNINGS && console.log(`Warning: ${I}`);
      }
      function z(I) {
        throw new Error(I);
      }
      function K(I, F) {
        I || z(F);
      }
      function nt(I) {
        switch (I?.protocol) {
          case "http:":
          case "https:":
          case "ftp:":
          case "mailto:":
          case "tel:":
            return !0;
          default:
            return !1;
        }
      }
      function j(I, F = null, T = null) {
        if (!I)
          return null;
        try {
          if (T && typeof I == "string" && (T.addDefaultProtocol && I.startsWith("www.") && I.match(/\./g)?.length >= 2 && (I = `http://${I}`), T.tryConvertEncoding))
            try {
              I = a(I);
            } catch {
            }
          const X = F ? new URL(I, F) : new URL(I);
          if (nt(X))
            return X;
        } catch {
        }
        return null;
      }
      function H(I, F, T, X = !1) {
        return Object.defineProperty(I, F, {
          value: T,
          enumerable: !X,
          configurable: !0,
          writable: !1
        }), T;
      }
      const G = function() {
        function F(T, X) {
          this.constructor === F && z("Cannot initialize BaseException."), this.message = T, this.name = X;
        }
        return F.prototype = new Error(), F.constructor = F, F;
      }();
      class Y extends G {
        constructor(F, T) {
          super(F, "PasswordException"), this.code = T;
        }
      }
      class et extends G {
        constructor(F, T) {
          super(F, "UnknownErrorException"), this.details = T;
        }
      }
      class tt extends G {
        constructor(F) {
          super(F, "InvalidPDFException");
        }
      }
      class ot extends G {
        constructor(F) {
          super(F, "MissingPDFException");
        }
      }
      class ct extends G {
        constructor(F, T) {
          super(F, "UnexpectedResponseException"), this.status = T;
        }
      }
      class pt extends G {
        constructor(F) {
          super(F, "FormatError");
        }
      }
      class dt extends G {
        constructor(F) {
          super(F, "AbortException");
        }
      }
      function ht(I) {
        (typeof I != "object" || I?.length === void 0) && z("Invalid argument for bytesToString");
        const F = I.length, T = 8192;
        if (F < T)
          return String.fromCharCode.apply(null, I);
        const X = [];
        for (let Q = 0; Q < F; Q += T) {
          const $ = Math.min(Q + T, F), q = I.subarray(Q, $);
          X.push(String.fromCharCode.apply(null, q));
        }
        return X.join("");
      }
      function ut(I) {
        typeof I != "string" && z("Invalid argument for stringToBytes");
        const F = I.length, T = new Uint8Array(F);
        for (let X = 0; X < F; ++X)
          T[X] = I.charCodeAt(X) & 255;
        return T;
      }
      function st(I) {
        return String.fromCharCode(I >> 24 & 255, I >> 16 & 255, I >> 8 & 255, I & 255);
      }
      function m(I) {
        const F = /* @__PURE__ */ Object.create(null);
        for (const [T, X] of I)
          F[T] = X;
        return F;
      }
      function c() {
        const I = new Uint8Array(4);
        return I[0] = 1, new Uint32Array(I.buffer, 0, 1)[0] === 1;
      }
      function e() {
        try {
          return new Function(""), !0;
        } catch {
          return !1;
        }
      }
      class n {
        static get isLittleEndian() {
          return H(this, "isLittleEndian", c());
        }
        static get isEvalSupported() {
          return H(this, "isEvalSupported", e());
        }
        static get isOffscreenCanvasSupported() {
          return H(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
        }
        static get platform() {
          return typeof navigator < "u" && typeof navigator?.platform == "string" ? H(this, "platform", {
            isMac: navigator.platform.includes("Mac")
          }) : H(this, "platform", {
            isMac: !1
          });
        }
        static get isCSSRoundSupported() {
          return H(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)"));
        }
      }
      const f = Array.from(Array(256).keys(), (I) => I.toString(16).padStart(2, "0"));
      class h {
        static makeHexColor(F, T, X) {
          return `#${f[F]}${f[T]}${f[X]}`;
        }
        static scaleMinMax(F, T) {
          let X;
          F[0] ? (F[0] < 0 && (X = T[0], T[0] = T[2], T[2] = X), T[0] *= F[0], T[2] *= F[0], F[3] < 0 && (X = T[1], T[1] = T[3], T[3] = X), T[1] *= F[3], T[3] *= F[3]) : (X = T[0], T[0] = T[1], T[1] = X, X = T[2], T[2] = T[3], T[3] = X, F[1] < 0 && (X = T[1], T[1] = T[3], T[3] = X), T[1] *= F[1], T[3] *= F[1], F[2] < 0 && (X = T[0], T[0] = T[2], T[2] = X), T[0] *= F[2], T[2] *= F[2]), T[0] += F[4], T[1] += F[5], T[2] += F[4], T[3] += F[5];
        }
        static transform(F, T) {
          return [F[0] * T[0] + F[2] * T[1], F[1] * T[0] + F[3] * T[1], F[0] * T[2] + F[2] * T[3], F[1] * T[2] + F[3] * T[3], F[0] * T[4] + F[2] * T[5] + F[4], F[1] * T[4] + F[3] * T[5] + F[5]];
        }
        static applyTransform(F, T) {
          const X = F[0] * T[0] + F[1] * T[2] + T[4], Q = F[0] * T[1] + F[1] * T[3] + T[5];
          return [X, Q];
        }
        static applyInverseTransform(F, T) {
          const X = T[0] * T[3] - T[1] * T[2], Q = (F[0] * T[3] - F[1] * T[2] + T[2] * T[5] - T[4] * T[3]) / X, $ = (-F[0] * T[1] + F[1] * T[0] + T[4] * T[1] - T[5] * T[0]) / X;
          return [Q, $];
        }
        static getAxialAlignedBoundingBox(F, T) {
          const X = this.applyTransform(F, T), Q = this.applyTransform(F.slice(2, 4), T), $ = this.applyTransform([F[0], F[3]], T), q = this.applyTransform([F[2], F[1]], T);
          return [Math.min(X[0], Q[0], $[0], q[0]), Math.min(X[1], Q[1], $[1], q[1]), Math.max(X[0], Q[0], $[0], q[0]), Math.max(X[1], Q[1], $[1], q[1])];
        }
        static inverseTransform(F) {
          const T = F[0] * F[3] - F[1] * F[2];
          return [F[3] / T, -F[1] / T, -F[2] / T, F[0] / T, (F[2] * F[5] - F[4] * F[3]) / T, (F[4] * F[1] - F[5] * F[0]) / T];
        }
        static singularValueDecompose2dScale(F) {
          const T = [F[0], F[2], F[1], F[3]], X = F[0] * T[0] + F[1] * T[2], Q = F[0] * T[1] + F[1] * T[3], $ = F[2] * T[0] + F[3] * T[2], q = F[2] * T[1] + F[3] * T[3], rt = (X + q) / 2, Z = Math.sqrt((X + q) ** 2 - 4 * (X * q - $ * Q)) / 2, J = rt + Z || 1, it = rt - Z || 1;
          return [Math.sqrt(J), Math.sqrt(it)];
        }
        static normalizeRect(F) {
          const T = F.slice(0);
          return F[0] > F[2] && (T[0] = F[2], T[2] = F[0]), F[1] > F[3] && (T[1] = F[3], T[3] = F[1]), T;
        }
        static intersect(F, T) {
          const X = Math.max(Math.min(F[0], F[2]), Math.min(T[0], T[2])), Q = Math.min(Math.max(F[0], F[2]), Math.max(T[0], T[2]));
          if (X > Q)
            return null;
          const $ = Math.max(Math.min(F[1], F[3]), Math.min(T[1], T[3])), q = Math.min(Math.max(F[1], F[3]), Math.max(T[1], T[3]));
          return $ > q ? null : [X, $, Q, q];
        }
        static #t(F, T, X, Q, $, q, rt, Z, J, it) {
          if (J <= 0 || J >= 1)
            return;
          const lt = 1 - J, gt = J * J, bt = gt * J, At = lt * (lt * (lt * F + 3 * J * T) + 3 * gt * X) + bt * Q, mt = lt * (lt * (lt * $ + 3 * J * q) + 3 * gt * rt) + bt * Z;
          it[0] = Math.min(it[0], At), it[1] = Math.min(it[1], mt), it[2] = Math.max(it[2], At), it[3] = Math.max(it[3], mt);
        }
        static #e(F, T, X, Q, $, q, rt, Z, J, it, lt, gt) {
          if (Math.abs(J) < 1e-12) {
            Math.abs(it) >= 1e-12 && this.#t(F, T, X, Q, $, q, rt, Z, -lt / it, gt);
            return;
          }
          const bt = it ** 2 - 4 * lt * J;
          if (bt < 0)
            return;
          const At = Math.sqrt(bt), mt = 2 * J;
          this.#t(F, T, X, Q, $, q, rt, Z, (-it + At) / mt, gt), this.#t(F, T, X, Q, $, q, rt, Z, (-it - At) / mt, gt);
        }
        static bezierBoundingBox(F, T, X, Q, $, q, rt, Z, J) {
          return J ? (J[0] = Math.min(J[0], F, rt), J[1] = Math.min(J[1], T, Z), J[2] = Math.max(J[2], F, rt), J[3] = Math.max(J[3], T, Z)) : J = [Math.min(F, rt), Math.min(T, Z), Math.max(F, rt), Math.max(T, Z)], this.#e(F, X, $, rt, T, Q, q, Z, 3 * (-F + 3 * (X - $) + rt), 6 * (F - 2 * X + $), 3 * (X - F), J), this.#e(F, X, $, rt, T, Q, q, Z, 3 * (-T + 3 * (Q - q) + Z), 6 * (T - 2 * Q + q), 3 * (Q - T), J), J;
        }
      }
      function a(I) {
        return decodeURIComponent(escape(I));
      }
      let u = null, A = null;
      function x(I) {
        return u || (u = /([\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, A = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), I.replaceAll(u, (F, T, X) => T ? T.normalize("NFKC") : A.get(X));
      }
      function R() {
        if (typeof crypto < "u" && typeof crypto?.randomUUID == "function")
          return crypto.randomUUID();
        const I = new Uint8Array(32);
        if (typeof crypto < "u" && typeof crypto?.getRandomValues == "function")
          crypto.getRandomValues(I);
        else
          for (let F = 0; F < 32; F++)
            I[F] = Math.floor(Math.random() * 255);
        return ht(I);
      }
      const k = "pdfjs_internal_id_", D = {
        BEZIER_CURVE_TO: 0,
        MOVE_TO: 1,
        LINE_TO: 2,
        QUADRATIC_CURVE_TO: 3,
        RESTORE: 4,
        SAVE: 5,
        SCALE: 6,
        TRANSFORM: 7,
        TRANSLATE: 8
      };
    }
  )
  /******/
}, Ut = {};
function Ft(at) {
  var W = Ut[at];
  if (W !== void 0)
    return W.exports;
  var V = Ut[at] = {
    /******/
    // no module.id needed
    /******/
    // no module.loaded needed
    /******/
    exports: {}
    /******/
  };
  return Yt[at](V, V.exports, Ft), V.exports;
}
(() => {
  var at = typeof Symbol == "function" ? Symbol("webpack queues") : "__webpack_queues__", W = typeof Symbol == "function" ? Symbol("webpack exports") : "__webpack_exports__", V = typeof Symbol == "function" ? Symbol("webpack error") : "__webpack_error__", y = (N) => {
    N && N.d < 1 && (N.d = 1, N.forEach((U) => U.r--), N.forEach((U) => U.r-- ? U.r++ : U()));
  }, B = (N) => N.map((U) => {
    if (U !== null && typeof U == "object") {
      if (U[at])
        return U;
      if (U.then) {
        var P = [];
        P.d = 0, U.then((v) => {
          C[W] = v, y(P);
        }, (v) => {
          C[V] = v, y(P);
        });
        var C = {};
        return C[at] = (v) => v(P), C;
      }
    }
    var E = {};
    return E[at] = (v) => {
    }, E[W] = U, E;
  });
  Ft.a = (N, U, P) => {
    var C;
    P && ((C = []).d = -1);
    var E = /* @__PURE__ */ new Set(), v = N.exports, r, d, o, b = new Promise((s, g) => {
      o = g, d = s;
    });
    b[W] = v, b[at] = (s) => (C && s(C), E.forEach(s), b.catch((g) => {
    })), N.exports = b, U((s) => {
      r = B(s);
      var g, t = () => r.map((l) => {
        if (l[V])
          throw l[V];
        return l[W];
      }), i = new Promise((l) => {
        g = () => l(t), g.r = 0;
        var p = (w) => w !== C && !E.has(w) && (E.add(w), w && !w.d && (g.r++, w.push(g)));
        r.map((w) => w[at](p));
      });
      return g.r ? i : t();
    }, (s) => (s ? o(b[V] = s) : d(v), y(C))), C && C.d < 0 && (C.d = 0);
  };
})();
Ft.d = (at, W) => {
  for (var V in W)
    Ft.o(W, V) && !Ft.o(at, V) && Object.defineProperty(at, V, { enumerable: !0, get: W[V] });
};
Ft.o = (at, W) => Object.prototype.hasOwnProperty.call(at, W);
var ft = Ft(228);
ft = globalThis.pdfjsLib = await (globalThis.pdfjsLibPromise = ft);
ft.AbortException;
ft.AnnotationEditorLayer;
ft.AnnotationEditorParamsType;
ft.AnnotationEditorType;
ft.AnnotationEditorUIManager;
ft.AnnotationLayer;
ft.AnnotationMode;
ft.CMapCompressionType;
ft.ColorPicker;
ft.DOMSVGFactory;
ft.DrawLayer;
ft.FeatureTest;
var Wt = ft.GlobalWorkerOptions;
ft.ImageKind;
ft.InvalidPDFException;
ft.MissingPDFException;
ft.OPS;
ft.Outliner;
ft.PDFDataRangeTransport;
ft.PDFDateString;
ft.PDFWorker;
ft.PasswordResponses;
ft.PermissionFlag;
ft.PixelsPerInch;
ft.RenderingCancelledException;
ft.UnexpectedResponseException;
ft.Util;
ft.VerbosityLevel;
ft.XfaLayer;
ft.build;
ft.createValidAbsoluteUrl;
ft.fetchData;
var qt = ft.getDocument;
ft.getFilenameFromUrl;
ft.getPdfFilenameFromUrl;
ft.getXfaPageViewport;
ft.isDataScheme;
ft.isPdfFile;
ft.noContextMenu;
ft.normalizeUnicode;
ft.renderTextLayer;
ft.setLayerDimensions;
ft.shadow;
ft.updateTextLayer;
ft.version;
const {
  SvelteComponent: Kt,
  append: Qt,
  attr: Jt,
  binding_callbacks: Zt,
  detach: te,
  element: Xt,
  init: ee,
  insert: se,
  noop: $t,
  safe_not_equal: ie,
  set_style: zt,
  toggle_class: It
} = window.__gradio__svelte__internal;
function ne(at) {
  let W, V;
  return {
    c() {
      W = Xt("div"), V = Xt("canvas"), zt(W, "justify-content", "center"), zt(W, "align-items", "center"), zt(W, "display", "flex"), zt(W, "flex-direction", "column"), Jt(W, "class", "svelte-1gecy8w"), It(
        W,
        "table",
        /*type*/
        at[0] === "table"
      ), It(
        W,
        "gallery",
        /*type*/
        at[0] === "gallery"
      ), It(
        W,
        "selected",
        /*selected*/
        at[1]
      );
    },
    m(y, B) {
      se(y, W, B), Qt(W, V), at[5](V);
    },
    p(y, [B]) {
      B & /*type*/
      1 && It(
        W,
        "table",
        /*type*/
        y[0] === "table"
      ), B & /*type*/
      1 && It(
        W,
        "gallery",
        /*type*/
        y[0] === "gallery"
      ), B & /*selected*/
      2 && It(
        W,
        "selected",
        /*selected*/
        y[1]
      );
    },
    i: $t,
    o: $t,
    d(y) {
      y && te(W), at[5](null);
    }
  };
}
function re(at, W, V) {
  var y = this && this.__awaiter || function(o, b, s, g) {
    function t(i) {
      return i instanceof s ? i : new s(function(l) {
        l(i);
      });
    }
    return new (s || (s = Promise))(function(i, l) {
      function p(L) {
        try {
          S(g.next(L));
        } catch (M) {
          l(M);
        }
      }
      function w(L) {
        try {
          S(g.throw(L));
        } catch (M) {
          l(M);
        }
      }
      function S(L) {
        L.done ? i(L.value) : t(L.value).then(p, w);
      }
      S((g = g.apply(o, b || [])).next());
    });
  };
  let { value: B } = W, { samples_dir: N } = W, { type: U } = W, { selected: P = !1 } = W;
  Wt.workerSrc = "https://cdn.jsdelivr.net/gh/freddyaboulton/gradio-pdf@main/pdf.worker.min.mjs";
  let C, E;
  function v(o) {
    return y(this, void 0, void 0, function* () {
      C = yield qt(o).promise, r();
    });
  }
  function r() {
    C.getPage(1).then((o) => {
      const b = E.getContext("2d");
      b.clearRect(0, 0, E.width, E.height);
      const s = o.getViewport({ scale: 0.2 }), g = { canvasContext: b, viewport: s };
      V(2, E.width = s.width, E), V(2, E.height = s.height, E), o.render(g);
    });
  }
  function d(o) {
    Zt[o ? "unshift" : "push"](() => {
      E = o, V(2, E);
    });
  }
  return at.$$set = (o) => {
    "value" in o && V(3, B = o.value), "samples_dir" in o && V(4, N = o.samples_dir), "type" in o && V(0, U = o.type), "selected" in o && V(1, P = o.selected);
  }, at.$$.update = () => {
    at.$$.dirty & /*samples_dir, value*/
    24 && v(N + B);
  }, [U, P, E, B, N, d];
}
class oe extends Kt {
  constructor(W) {
    super(), ee(this, W, re, ne, ie, {
      value: 3,
      samples_dir: 4,
      type: 0,
      selected: 1
    });
  }
}
export {
  oe as default
};
