var Ek = Object.defineProperty;
var d8 = (s) => {
  throw TypeError(s);
};
var Mk = (s, t, e) => t in s ? Ek(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
var ht = (s, t, e) => Mk(s, typeof t != "symbol" ? t + "" : t, e), hm = (s, t, e) => t.has(s) || d8("Cannot " + e);
var g = (s, t, e) => (hm(s, t, "read from private field"), e ? e.call(s) : t.get(s)), _ = (s, t, e) => t.has(s) ? d8("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, e), S = (s, t, e, i) => (hm(s, t, "write to private field"), i ? i.call(s, e) : t.set(s, e), e), C = (s, t, e) => (hm(s, t, "access private method"), e);
var Qs = (s, t, e, i) => ({
  set _(n) {
    S(s, t, n, e);
  },
  get _() {
    return g(s, t, i);
  }
});
const oi = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), h5 = [1e-3, 0, 0, 1e-3, 0, 0], um = 1.35, Wi = {
  ANY: 1,
  DISPLAY: 2,
  PRINT: 4,
  ANNOTATIONS_FORMS: 16,
  ANNOTATIONS_STORAGE: 32,
  ANNOTATIONS_DISABLE: 64,
  IS_EDITING: 128,
  OPLIST: 256
}, Pr = {
  DISABLE: 0,
  ENABLE: 1,
  ENABLE_FORMS: 2,
  ENABLE_STORAGE: 3
}, Fk = "pdfjs_internal_editor_", Ht = {
  DISABLE: -1,
  NONE: 0,
  FREETEXT: 3,
  HIGHLIGHT: 9,
  STAMP: 13,
  INK: 15,
  SIGNATURE: 101
}, ae = {
  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,
  DRAW_STEP: 41
}, dy = {
  PRINT: 4,
  MODIFY_CONTENTS: 8,
  COPY: 16,
  MODIFY_ANNOTATIONS: 32,
  FILL_INTERACTIVE_FORMS: 256,
  COPY_FOR_ACCESSIBILITY: 512,
  ASSEMBLE: 1024,
  PRINT_HIGH_QUALITY: 2048
}, js = {
  FILL: 0,
  STROKE: 1,
  FILL_STROKE: 2,
  INVISIBLE: 3,
  FILL_STROKE_MASK: 3,
  ADD_TO_PATH_FLAG: 4
}, Ld = {
  GRAYSCALE_1BPP: 1,
  RGB_24BPP: 2,
  RGBA_32BPP: 3
}, Xe = {
  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
}, Eh = {
  SOLID: 1,
  DASHED: 2,
  BEVELED: 3,
  INSET: 4,
  UNDERLINE: 5
}, g2 = {
  ERRORS: 0,
  WARNINGS: 1,
  INFOS: 5
}, Jd = {
  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,
  setStrokeTransparent: 92,
  setFillTransparent: 93,
  rawFillPath: 94
}, D2 = {
  moveTo: 0,
  lineTo: 1,
  curveTo: 2,
  closePath: 3
}, fy = {
  NEED_PASSWORD: 1,
  INCORRECT_PASSWORD: 2
};
let O9 = g2.WARNINGS;
function Rk(s) {
  Number.isInteger(s) && (O9 = s);
}
function Pk() {
  return O9;
}
function U9(s) {
  O9 >= g2.INFOS && console.log(`Info: ${s}`);
}
function zt(s) {
  O9 >= g2.WARNINGS && console.log(`Warning: ${s}`);
}
function Ae(s) {
  throw new Error(s);
}
function is(s, t) {
  s || Ae(t);
}
function Dk(s) {
  switch (s == null ? void 0 : s.protocol) {
    case "http:":
    case "https:":
    case "ftp:":
    case "mailto:":
    case "tel:":
      return !0;
    default:
      return !1;
  }
}
function X6(s, t = null, e = null) {
  if (!s)
    return null;
  if (e && typeof s == "string") {
    if (e.addDefaultProtocol && s.startsWith("www.")) {
      const n = s.match(/\./g);
      (n == null ? void 0 : n.length) >= 2 && (s = `http://${s}`);
    }
    if (e.tryConvertEncoding)
      try {
        s = Uk(s);
      } catch {
      }
  }
  const i = t ? URL.parse(s, t) : URL.parse(s);
  return Dk(i) ? i : null;
}
function K6(s, t, e = !1) {
  const i = URL.parse(s);
  return i ? (i.hash = t, i.href) : e && X6(s, "http://example.com") ? s.split("#", 1)[0] + `${t ? `#${t}` : ""}` : "";
}
function ne(s, t, e, i = !1) {
  return Object.defineProperty(s, t, {
    value: e,
    enumerable: !i,
    configurable: !0,
    writable: !1
  }), e;
}
const ph = function() {
  function t(e, i) {
    this.message = e, this.name = i;
  }
  return t.prototype = new Error(), t.constructor = t, t;
}();
let f8 = class extends ph {
  constructor(t, e) {
    super(t, "PasswordException"), this.code = e;
  }
}, dm = class extends ph {
  constructor(t, e) {
    super(t, "UnknownErrorException"), this.details = e;
  }
}, lp = class extends ph {
  constructor(t) {
    super(t, "InvalidPDFException");
  }
}, Zd = class extends ph {
  constructor(t, e, i) {
    super(t, "ResponseException"), this.status = e, this.missing = i;
  }
}, Nk = class extends ph {
  constructor(t) {
    super(t, "FormatError");
  }
}, Gr = class extends ph {
  constructor(t) {
    super(t, "AbortException");
  }
};
function gy(s) {
  (typeof s != "object" || (s == null ? void 0 : s.length) === void 0) && Ae("Invalid argument for bytesToString");
  const t = s.length, e = 8192;
  if (t < e)
    return String.fromCharCode.apply(null, s);
  const i = [];
  for (let n = 0; n < t; n += e) {
    const a = Math.min(n + e, t), r = s.subarray(n, a);
    i.push(String.fromCharCode.apply(null, r));
  }
  return i.join("");
}
function p2(s) {
  typeof s != "string" && Ae("Invalid argument for stringToBytes");
  const t = s.length, e = new Uint8Array(t);
  for (let i = 0; i < t; ++i)
    e[i] = s.charCodeAt(i) & 255;
  return e;
}
function Bk(s) {
  return String.fromCharCode(s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, s & 255);
}
function Lk() {
  const s = new Uint8Array(4);
  return s[0] = 1, new Uint32Array(s.buffer, 0, 1)[0] === 1;
}
function Ok() {
  try {
    return new Function(""), !0;
  } catch {
    return !1;
  }
}
class ks {
  static get isLittleEndian() {
    return ne(this, "isLittleEndian", Lk());
  }
  static get isEvalSupported() {
    return ne(this, "isEvalSupported", Ok());
  }
  static get isOffscreenCanvasSupported() {
    return ne(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
  }
  static get isImageDecoderSupported() {
    return ne(this, "isImageDecoderSupported", typeof ImageDecoder < "u");
  }
  static get platform() {
    const {
      platform: t,
      userAgent: e
    } = navigator;
    return ne(this, "platform", {
      isAndroid: e.includes("Android"),
      isLinux: t.includes("Linux"),
      isMac: t.includes("Mac"),
      isWindows: t.includes("Win"),
      isFirefox: e.includes("Firefox")
    });
  }
  static get isCSSRoundSupported() {
    var t, e;
    return ne(this, "isCSSRoundSupported", (e = (t = globalThis.CSS) == null ? void 0 : t.supports) == null ? void 0 : e.call(t, "width: round(1.5px, 1px)"));
  }
}
const fm = Array.from(Array(256).keys(), (s) => s.toString(16).padStart(2, "0"));
var Hr, c5, cg, u5;
let Dt = (c5 = class {
  static makeHexColor(t, e, i) {
    return `#${fm[t]}${fm[e]}${fm[i]}`;
  }
  static scaleMinMax(t, e) {
    let i;
    t[0] ? (t[0] < 0 && (i = e[0], e[0] = e[2], e[2] = i), e[0] *= t[0], e[2] *= t[0], t[3] < 0 && (i = e[1], e[1] = e[3], e[3] = i), e[1] *= t[3], e[3] *= t[3]) : (i = e[0], e[0] = e[1], e[1] = i, i = e[2], e[2] = e[3], e[3] = i, t[1] < 0 && (i = e[1], e[1] = e[3], e[3] = i), e[1] *= t[1], e[3] *= t[1], t[2] < 0 && (i = e[0], e[0] = e[2], e[2] = i), e[0] *= t[2], e[2] *= t[2]), e[0] += t[4], e[1] += t[5], e[2] += t[4], e[3] += t[5];
  }
  static transform(t, e) {
    return [t[0] * e[0] + t[2] * e[1], t[1] * e[0] + t[3] * e[1], t[0] * e[2] + t[2] * e[3], t[1] * e[2] + t[3] * e[3], t[0] * e[4] + t[2] * e[5] + t[4], t[1] * e[4] + t[3] * e[5] + t[5]];
  }
  static applyTransform(t, e, i = 0) {
    const n = t[i], a = t[i + 1];
    t[i] = n * e[0] + a * e[2] + e[4], t[i + 1] = n * e[1] + a * e[3] + e[5];
  }
  static applyTransformToBezier(t, e, i = 0) {
    const n = e[0], a = e[1], r = e[2], o = e[3], l = e[4], c = e[5];
    for (let h = 0; h < 6; h += 2) {
      const u = t[i + h], f = t[i + h + 1];
      t[i + h] = u * n + f * r + l, t[i + h + 1] = u * a + f * o + c;
    }
  }
  static applyInverseTransform(t, e) {
    const i = t[0], n = t[1], a = e[0] * e[3] - e[1] * e[2];
    t[0] = (i * e[3] - n * e[2] + e[2] * e[5] - e[4] * e[3]) / a, t[1] = (-i * e[1] + n * e[0] + e[4] * e[1] - e[5] * e[0]) / a;
  }
  static axialAlignedBoundingBox(t, e, i) {
    const n = e[0], a = e[1], r = e[2], o = e[3], l = e[4], c = e[5], h = t[0], u = t[1], f = t[2], d = t[3];
    let p = n * h + l, m = p, b = n * f + l, y = b, v = o * u + c, w = v, A = o * d + c, x = A;
    if (a !== 0 || r !== 0) {
      const k = a * h, I = a * f, T = r * u, E = r * d;
      p += T, y += T, b += E, m += E, v += k, x += k, A += I, w += I;
    }
    i[0] = Math.min(i[0], p, b, m, y), i[1] = Math.min(i[1], v, A, w, x), i[2] = Math.max(i[2], p, b, m, y), i[3] = Math.max(i[3], v, A, w, x);
  }
  static inverseTransform(t) {
    const e = t[0] * t[3] - t[1] * t[2];
    return [t[3] / e, -t[1] / e, -t[2] / e, t[0] / e, (t[2] * t[5] - t[4] * t[3]) / e, (t[4] * t[1] - t[5] * t[0]) / e];
  }
  static singularValueDecompose2dScale(t, e) {
    const i = t[0], n = t[1], a = t[2], r = t[3], o = i ** 2 + n ** 2, l = i * a + n * r, c = a ** 2 + r ** 2, h = (o + c) / 2, u = Math.sqrt(h ** 2 - (o * c - l ** 2));
    e[0] = Math.sqrt(h + u || 1), e[1] = Math.sqrt(h - u || 1);
  }
  static normalizeRect(t) {
    const e = t.slice(0);
    return t[0] > t[2] && (e[0] = t[2], e[2] = t[0]), t[1] > t[3] && (e[1] = t[3], e[3] = t[1]), e;
  }
  static intersect(t, e) {
    const i = Math.max(Math.min(t[0], t[2]), Math.min(e[0], e[2])), n = Math.min(Math.max(t[0], t[2]), Math.max(e[0], e[2]));
    if (i > n)
      return null;
    const a = Math.max(Math.min(t[1], t[3]), Math.min(e[1], e[3])), r = Math.min(Math.max(t[1], t[3]), Math.max(e[1], e[3]));
    return a > r ? null : [i, a, n, r];
  }
  static pointBoundingBox(t, e, i) {
    i[0] = Math.min(i[0], t), i[1] = Math.min(i[1], e), i[2] = Math.max(i[2], t), i[3] = Math.max(i[3], e);
  }
  static rectBoundingBox(t, e, i, n, a) {
    a[0] = Math.min(a[0], t, i), a[1] = Math.min(a[1], e, n), a[2] = Math.max(a[2], t, i), a[3] = Math.max(a[3], e, n);
  }
  static bezierBoundingBox(t, e, i, n, a, r, o, l, c) {
    c[0] = Math.min(c[0], t, o), c[1] = Math.min(c[1], e, l), c[2] = Math.max(c[2], t, o), c[3] = Math.max(c[3], e, l), C(this, Hr, u5).call(this, t, i, a, o, e, n, r, l, 3 * (-t + 3 * (i - a) + o), 6 * (t - 2 * i + a), 3 * (i - t), c), C(this, Hr, u5).call(this, t, i, a, o, e, n, r, l, 3 * (-e + 3 * (n - r) + l), 6 * (e - 2 * n + r), 3 * (n - e), c);
  }
}, Hr = new WeakSet(), cg = function(t, e, i, n, a, r, o, l, c, h) {
  if (c <= 0 || c >= 1)
    return;
  const u = 1 - c, f = c * c, d = f * c, p = u * (u * (u * t + 3 * c * e) + 3 * f * i) + d * n, m = u * (u * (u * a + 3 * c * r) + 3 * f * o) + d * l;
  h[0] = Math.min(h[0], p), h[1] = Math.min(h[1], m), h[2] = Math.max(h[2], p), h[3] = Math.max(h[3], m);
}, u5 = function(t, e, i, n, a, r, o, l, c, h, u, f) {
  if (Math.abs(c) < 1e-12) {
    Math.abs(h) >= 1e-12 && C(this, Hr, cg).call(this, t, e, i, n, a, r, o, l, -u / h, f);
    return;
  }
  const d = h ** 2 - 4 * u * c;
  if (d < 0)
    return;
  const p = Math.sqrt(d), m = 2 * c;
  C(this, Hr, cg).call(this, t, e, i, n, a, r, o, l, (-h + p) / m, f), C(this, Hr, cg).call(this, t, e, i, n, a, r, o, l, (-h - p) / m, f);
}, _(c5, Hr), c5);
function Uk(s) {
  return decodeURIComponent(escape(s));
}
let gm = null, g8 = null;
function py(s) {
  return gm || (gm = /([\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, g8 = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), s.replaceAll(gm, (t, e, i) => e ? e.normalize("NFKC") : g8.get(i));
}
function Y6() {
  if (typeof crypto.randomUUID == "function")
    return crypto.randomUUID();
  const s = new Uint8Array(32);
  return crypto.getRandomValues(s), gy(s);
}
const J6 = "pdfjs_internal_id_";
function qk(s, t, e) {
  if (!Array.isArray(e) || e.length < 2)
    return !1;
  const [i, n, ...a] = e;
  if (!s(i) && !Number.isInteger(i) || !t(n))
    return !1;
  const r = a.length;
  let o = !0;
  switch (n.name) {
    case "XYZ":
      if (r < 2 || r > 3)
        return !1;
      break;
    case "Fit":
    case "FitB":
      return r === 0;
    case "FitH":
    case "FitBH":
    case "FitV":
    case "FitBV":
      if (r > 1)
        return !1;
      break;
    case "FitR":
      if (r !== 4)
        return !1;
      o = !1;
      break;
    default:
      return !1;
  }
  for (const l of a)
    if (!(typeof l == "number" || o && l === null))
      return !1;
  return !0;
}
function Ws(s, t, e) {
  return Math.min(Math.max(s, t), e);
}
function my(s) {
  return Uint8Array.prototype.toBase64 ? s.toBase64() : btoa(gy(s));
}
function jk(s) {
  return Uint8Array.fromBase64 ? Uint8Array.fromBase64(s) : p2(atob(s));
}
typeof Promise.try != "function" && (Promise.try = function(s, ...t) {
  return new Promise((e) => {
    e(s(...t));
  });
});
typeof Math.sumPrecise != "function" && (Math.sumPrecise = function(s) {
  return s.reduce((t, e) => t + e, 0);
});
const Ka = "http://www.w3.org/2000/svg", Ol = class Ol {
};
ht(Ol, "CSS", 96), ht(Ol, "PDF", 72), ht(Ol, "PDF_TO_CSS_UNITS", Ol.CSS / Ol.PDF);
let Vr = Ol;
async function U1(s, t = "text") {
  if (ld(s, document.baseURI)) {
    const e = await fetch(s);
    if (!e.ok)
      throw new Error(e.statusText);
    switch (t) {
      case "arraybuffer":
        return e.arrayBuffer();
      case "blob":
        return e.blob();
      case "json":
        return e.json();
    }
    return e.text();
  }
  return new Promise((e, i) => {
    const n = new XMLHttpRequest();
    n.open("GET", s, !0), n.responseType = t, n.onreadystatechange = () => {
      if (n.readyState === XMLHttpRequest.DONE) {
        if (n.status === 200 || n.status === 0) {
          switch (t) {
            case "arraybuffer":
            case "blob":
            case "json":
              e(n.response);
              return;
          }
          e(n.responseText);
          return;
        }
        i(new Error(n.statusText));
      }
    }, n.send(null);
  });
}
class m2 {
  constructor({
    viewBox: t,
    userUnit: e,
    scale: i,
    rotation: n,
    offsetX: a = 0,
    offsetY: r = 0,
    dontFlip: o = !1
  }) {
    this.viewBox = t, this.userUnit = e, this.scale = i, this.rotation = n, this.offsetX = a, this.offsetY = r, i *= e;
    const l = (t[2] + t[0]) / 2, c = (t[3] + t[1]) / 2;
    let h, u, f, d;
    switch (n %= 360, n < 0 && (n += 360), n) {
      case 180:
        h = -1, u = 0, f = 0, d = 1;
        break;
      case 90:
        h = 0, u = 1, f = 1, d = 0;
        break;
      case 270:
        h = 0, u = -1, f = -1, d = 0;
        break;
      case 0:
        h = 1, u = 0, f = 0, d = -1;
        break;
      default:
        throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
    }
    o && (f = -f, d = -d);
    let p, m, b, y;
    h === 0 ? (p = Math.abs(c - t[1]) * i + a, m = Math.abs(l - t[0]) * i + r, b = (t[3] - t[1]) * i, y = (t[2] - t[0]) * i) : (p = Math.abs(l - t[0]) * i + a, m = Math.abs(c - t[1]) * i + r, b = (t[2] - t[0]) * i, y = (t[3] - t[1]) * i), this.transform = [h * i, u * i, f * i, d * i, p - h * i * l - f * i * c, m - u * i * l - d * i * c], this.width = b, this.height = y;
  }
  get rawDims() {
    const t = this.viewBox;
    return ne(this, "rawDims", {
      pageWidth: t[2] - t[0],
      pageHeight: t[3] - t[1],
      pageX: t[0],
      pageY: t[1]
    });
  }
  clone({
    scale: t = this.scale,
    rotation: e = this.rotation,
    offsetX: i = this.offsetX,
    offsetY: n = this.offsetY,
    dontFlip: a = !1
  } = {}) {
    return new m2({
      viewBox: this.viewBox.slice(),
      userUnit: this.userUnit,
      scale: t,
      rotation: e,
      offsetX: i,
      offsetY: n,
      dontFlip: a
    });
  }
  convertToViewportPoint(t, e) {
    const i = [t, e];
    return Dt.applyTransform(i, this.transform), i;
  }
  convertToViewportRectangle(t) {
    const e = [t[0], t[1]];
    Dt.applyTransform(e, this.transform);
    const i = [t[2], t[3]];
    return Dt.applyTransform(i, this.transform), [e[0], e[1], i[0], i[1]];
  }
  convertToPdfPoint(t, e) {
    const i = [t, e];
    return Dt.applyInverseTransform(i, this.transform), i;
  }
}
class q9 extends ph {
  constructor(t, e = 0) {
    super(t, "RenderingCancelledException"), this.extraDelay = e;
  }
}
function b2(s) {
  const t = s.length;
  let e = 0;
  for (; e < t && s[e].trim() === ""; )
    e++;
  return s.substring(e, e + 5).toLowerCase() === "data:";
}
function j9(s) {
  return typeof s == "string" && /\.pdf$/i.test(s);
}
function by(s) {
  return [s] = s.split(/[#?]/, 1), s.substring(s.lastIndexOf("/") + 1);
}
function yy(s, t = "document.pdf") {
  if (typeof s != "string")
    return t;
  if (b2(s))
    return zt('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), t;
  const e = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, i = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, n = e.exec(s);
  let a = i.exec(n[1]) || i.exec(n[2]) || i.exec(n[3]);
  if (a && (a = a[0], a.includes("%")))
    try {
      a = i.exec(decodeURIComponent(a))[0];
    } catch {
    }
  return a || t;
}
class p8 {
  constructor() {
    ht(this, "started", /* @__PURE__ */ Object.create(null));
    ht(this, "times", []);
  }
  time(t) {
    t in this.started && zt(`Timer is already running for ${t}`), this.started[t] = Date.now();
  }
  timeEnd(t) {
    t in this.started || zt(`Timer has not been started for ${t}`), this.times.push({
      name: t,
      start: this.started[t],
      end: Date.now()
    }), delete this.started[t];
  }
  toString() {
    const t = [];
    let e = 0;
    for (const {
      name: i
    } of this.times)
      e = Math.max(i.length, e);
    for (const {
      name: i,
      start: n,
      end: a
    } of this.times)
      t.push(`${i.padEnd(e)} ${a - n}ms
`);
    return t.join("");
  }
}
function ld(s, t) {
  const e = t ? URL.parse(s, t) : URL.parse(s);
  return (e == null ? void 0 : e.protocol) === "http:" || (e == null ? void 0 : e.protocol) === "https:";
}
function En(s) {
  s.preventDefault();
}
function Ze(s) {
  s.preventDefault(), s.stopPropagation();
}
function Hk(s) {
  console.log("Deprecated API usage: " + s);
}
var x0;
class H9 {
  static toDateObject(t) {
    if (!t || typeof t != "string")
      return null;
    g(this, x0) || S(this, x0, new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));
    const e = g(this, x0).exec(t);
    if (!e)
      return null;
    const i = parseInt(e[1], 10);
    let n = parseInt(e[2], 10);
    n = n >= 1 && n <= 12 ? n - 1 : 0;
    let a = parseInt(e[3], 10);
    a = a >= 1 && a <= 31 ? a : 1;
    let r = parseInt(e[4], 10);
    r = r >= 0 && r <= 23 ? r : 0;
    let o = parseInt(e[5], 10);
    o = o >= 0 && o <= 59 ? o : 0;
    let l = parseInt(e[6], 10);
    l = l >= 0 && l <= 59 ? l : 0;
    const c = e[7] || "Z";
    let h = parseInt(e[8], 10);
    h = h >= 0 && h <= 23 ? h : 0;
    let u = parseInt(e[9], 10) || 0;
    return u = u >= 0 && u <= 59 ? u : 0, c === "-" ? (r += h, o += u) : c === "+" && (r -= h, o -= u), new Date(Date.UTC(i, n, a, r, o, l));
  }
}
x0 = new WeakMap(), _(H9, x0);
function wy(s, {
  scale: t = 1,
  rotation: e = 0
}) {
  const {
    width: i,
    height: n
  } = s.attributes.style, a = [0, 0, parseInt(i), parseInt(n)];
  return new m2({
    viewBox: a,
    userUnit: 1,
    scale: t,
    rotation: e
  });
}
function Z6(s) {
  if (s.startsWith("#")) {
    const t = parseInt(s.slice(1), 16);
    return [(t & 16711680) >> 16, (t & 65280) >> 8, t & 255];
  }
  return s.startsWith("rgb(") ? s.slice(4, -1).split(",").map((t) => parseInt(t)) : s.startsWith("rgba(") ? s.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (zt(`Not a valid color format: "${s}"`), [0, 0, 0]);
}
function $k(s) {
  const t = document.createElement("span");
  t.style.visibility = "hidden", t.style.colorScheme = "only light", document.body.append(t);
  for (const e of s.keys()) {
    t.style.color = e;
    const i = window.getComputedStyle(t).color;
    s.set(e, Z6(i));
  }
  t.remove();
}
function je(s) {
  const {
    a: t,
    b: e,
    c: i,
    d: n,
    e: a,
    f: r
  } = s.getTransform();
  return [t, e, i, n, a, r];
}
function ua(s) {
  const {
    a: t,
    b: e,
    c: i,
    d: n,
    e: a,
    f: r
  } = s.getTransform().invertSelf();
  return [t, e, i, n, a, r];
}
function rl(s, t, e = !1, i = !0) {
  if (t instanceof m2) {
    const {
      pageWidth: n,
      pageHeight: a
    } = t.rawDims, {
      style: r
    } = s, o = ks.isCSSRoundSupported, l = `var(--total-scale-factor) * ${n}px`, c = `var(--total-scale-factor) * ${a}px`, h = o ? `round(down, ${l}, var(--scale-round-x))` : `calc(${l})`, u = o ? `round(down, ${c}, var(--scale-round-y))` : `calc(${c})`;
    !e || t.rotation % 180 === 0 ? (r.width = h, r.height = u) : (r.width = u, r.height = h);
  }
  i && s.setAttribute("data-main-rotation", t.rotation);
}
class na {
  constructor() {
    const {
      pixelRatio: t
    } = na;
    this.sx = t, this.sy = t;
  }
  get scaled() {
    return this.sx !== 1 || this.sy !== 1;
  }
  get symmetric() {
    return this.sx === this.sy;
  }
  limitCanvas(t, e, i, n, a = -1) {
    let r = 1 / 0, o = 1 / 0, l = 1 / 0;
    i = na.capPixels(i, a), i > 0 && (r = Math.sqrt(i / (t * e))), n !== -1 && (o = n / t, l = n / e);
    const c = Math.min(r, o, l);
    return this.sx > c || this.sy > c ? (this.sx = c, this.sy = c, !0) : !1;
  }
  static get pixelRatio() {
    return globalThis.devicePixelRatio || 1;
  }
  static capPixels(t, e) {
    if (e >= 0) {
      const i = Math.ceil(window.screen.availWidth * window.screen.availHeight * this.pixelRatio ** 2 * (1 + e / 100));
      return t > 0 ? Math.min(t, i) : i;
    }
    return t;
  }
}
const cp = ["image/apng", "image/avif", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg+xml", "image/webp", "image/x-icon"];
var uo, $l, on, fo, k0, cu, S0, r9, vy, Os, Ay, xy, cd, ky, hg;
const Za = class Za {
  constructor(t) {
    _(this, Os);
    _(this, uo, null);
    _(this, $l, null);
    _(this, on);
    _(this, fo, null);
    _(this, k0, null);
    _(this, cu, null);
    S(this, on, t), g(Za, S0) || S(Za, S0, Object.freeze({
      freetext: "pdfjs-editor-remove-freetext-button",
      highlight: "pdfjs-editor-remove-highlight-button",
      ink: "pdfjs-editor-remove-ink-button",
      stamp: "pdfjs-editor-remove-stamp-button",
      signature: "pdfjs-editor-remove-signature-button"
    }));
  }
  render() {
    const t = S(this, uo, document.createElement("div"));
    t.classList.add("editToolbar", "hidden"), t.setAttribute("role", "toolbar");
    const e = g(this, on)._uiManager._signal;
    t.addEventListener("contextmenu", En, {
      signal: e
    }), t.addEventListener("pointerdown", C(Za, r9, vy), {
      signal: e
    });
    const i = S(this, fo, document.createElement("div"));
    i.className = "buttons", t.append(i);
    const n = g(this, on).toolbarPosition;
    if (n) {
      const {
        style: a
      } = t, r = g(this, on)._uiManager.direction === "ltr" ? 1 - n[0] : n[0];
      a.insetInlineEnd = `${100 * r}%`, a.top = `calc(${100 * n[1]}% + var(--editor-toolbar-vert-offset))`;
    }
    return C(this, Os, ky).call(this), t;
  }
  get div() {
    return g(this, uo);
  }
  hide() {
    var t;
    g(this, uo).classList.add("hidden"), (t = g(this, $l)) == null || t.hideDropdown();
  }
  show() {
    var t;
    g(this, uo).classList.remove("hidden"), (t = g(this, k0)) == null || t.shown();
  }
  async addAltText(t) {
    const e = await t.render();
    C(this, Os, cd).call(this, e), g(this, fo).prepend(e, g(this, Os, hg)), S(this, k0, t);
  }
  addColorPicker(t) {
    S(this, $l, t);
    const e = t.renderButton();
    C(this, Os, cd).call(this, e), g(this, fo).prepend(e, g(this, Os, hg));
  }
  async addEditSignatureButton(t) {
    const e = S(this, cu, await t.renderEditButton(g(this, on)));
    C(this, Os, cd).call(this, e), g(this, fo).prepend(e, g(this, Os, hg));
  }
  updateEditSignatureButton(t) {
    g(this, cu) && (g(this, cu).title = t);
  }
  remove() {
    var t;
    g(this, uo).remove(), (t = g(this, $l)) == null || t.destroy(), S(this, $l, null);
  }
};
uo = new WeakMap(), $l = new WeakMap(), on = new WeakMap(), fo = new WeakMap(), k0 = new WeakMap(), cu = new WeakMap(), S0 = new WeakMap(), r9 = new WeakSet(), vy = function(t) {
  t.stopPropagation();
}, Os = new WeakSet(), Ay = function(t) {
  g(this, on)._focusEventsAllowed = !1, Ze(t);
}, xy = function(t) {
  g(this, on)._focusEventsAllowed = !0, Ze(t);
}, cd = function(t) {
  const e = g(this, on)._uiManager._signal;
  t.addEventListener("focusin", C(this, Os, Ay).bind(this), {
    capture: !0,
    signal: e
  }), t.addEventListener("focusout", C(this, Os, xy).bind(this), {
    capture: !0,
    signal: e
  }), t.addEventListener("contextmenu", En, {
    signal: e
  });
}, ky = function() {
  const {
    editorType: t,
    _uiManager: e
  } = g(this, on), i = document.createElement("button");
  i.className = "delete", i.tabIndex = 0, i.setAttribute("data-l10n-id", g(Za, S0)[t]), C(this, Os, cd).call(this, i), i.addEventListener("click", (n) => {
    e.delete();
  }, {
    signal: e._signal
  }), g(this, fo).append(i);
}, hg = function() {
  const t = document.createElement("div");
  return t.className = "divider", t;
}, _(Za, r9), _(Za, S0, null);
let d5 = Za;
var C0, zl, Gl, hl, Sy, Cy, Iy;
class zk {
  constructor(t) {
    _(this, hl);
    _(this, C0, null);
    _(this, zl, null);
    _(this, Gl);
    S(this, Gl, t);
  }
  show(t, e, i) {
    const [n, a] = C(this, hl, Cy).call(this, e, i), {
      style: r
    } = g(this, zl) || S(this, zl, C(this, hl, Sy).call(this));
    t.append(g(this, zl)), r.insetInlineEnd = `${100 * n}%`, r.top = `calc(${100 * a}% + var(--editor-toolbar-vert-offset))`;
  }
  hide() {
    g(this, zl).remove();
  }
}
C0 = new WeakMap(), zl = new WeakMap(), Gl = new WeakMap(), hl = new WeakSet(), Sy = function() {
  const t = S(this, zl, document.createElement("div"));
  t.className = "editToolbar", t.setAttribute("role", "toolbar"), t.addEventListener("contextmenu", En, {
    signal: g(this, Gl)._signal
  });
  const e = S(this, C0, document.createElement("div"));
  return e.className = "buttons", t.append(e), C(this, hl, Iy).call(this), t;
}, Cy = function(t, e) {
  let i = 0, n = 0;
  for (const a of t) {
    const r = a.y + a.height;
    if (r < i)
      continue;
    const o = a.x + (e ? a.width : 0);
    if (r > i) {
      n = o, i = r;
      continue;
    }
    e ? o > n && (n = o) : o < n && (n = o);
  }
  return [e ? 1 - n : n, i];
}, Iy = function() {
  const t = document.createElement("button");
  t.className = "highlightButton", t.tabIndex = 0, t.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button1");
  const e = document.createElement("span");
  t.append(e), e.className = "visuallyHidden", e.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label");
  const i = g(this, Gl)._signal;
  t.addEventListener("contextmenu", En, {
    signal: i
  }), t.addEventListener("click", () => {
    g(this, Gl).highlightSelection("floating_button");
  }, {
    signal: i
  }), g(this, C0).append(t);
};
function _y(s, t, e) {
  for (const i of e)
    t.addEventListener(i, s[i].bind(s));
}
var o9;
class Gk {
  constructor() {
    _(this, o9, 0);
  }
  get id() {
    return `${Fk}${Qs(this, o9)._++}`;
  }
}
o9 = new WeakMap();
var hu, I0, $s, uu, ug;
const e8 = class e8 {
  constructor() {
    _(this, uu);
    _(this, hu, Y6());
    _(this, I0, 0);
    _(this, $s, null);
  }
  static get _isSVGFittingCanvas() {
    const t = '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>', i = new OffscreenCanvas(1, 3).getContext("2d", {
      willReadFrequently: !0
    }), n = new Image();
    n.src = t;
    const a = n.decode().then(() => (i.drawImage(n, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(i.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
    return ne(this, "_isSVGFittingCanvas", a);
  }
  async getFromFile(t) {
    const {
      lastModified: e,
      name: i,
      size: n,
      type: a
    } = t;
    return C(this, uu, ug).call(this, `${e}_${i}_${n}_${a}`, t);
  }
  async getFromUrl(t) {
    return C(this, uu, ug).call(this, t, t);
  }
  async getFromBlob(t, e) {
    const i = await e;
    return C(this, uu, ug).call(this, t, i);
  }
  async getFromId(t) {
    g(this, $s) || S(this, $s, /* @__PURE__ */ new Map());
    const e = g(this, $s).get(t);
    if (!e)
      return null;
    if (e.bitmap)
      return e.refCounter += 1, e;
    if (e.file)
      return this.getFromFile(e.file);
    if (e.blobPromise) {
      const {
        blobPromise: i
      } = e;
      return delete e.blobPromise, this.getFromBlob(e.id, i);
    }
    return this.getFromUrl(e.url);
  }
  getFromCanvas(t, e) {
    g(this, $s) || S(this, $s, /* @__PURE__ */ new Map());
    let i = g(this, $s).get(t);
    if (i != null && i.bitmap)
      return i.refCounter += 1, i;
    const n = new OffscreenCanvas(e.width, e.height);
    return n.getContext("2d").drawImage(e, 0, 0), i = {
      bitmap: n.transferToImageBitmap(),
      id: `image_${g(this, hu)}_${Qs(this, I0)._++}`,
      refCounter: 1,
      isSvg: !1
    }, g(this, $s).set(t, i), g(this, $s).set(i.id, i), i;
  }
  getSvgUrl(t) {
    const e = g(this, $s).get(t);
    return e != null && e.isSvg ? e.svgUrl : null;
  }
  deleteId(t) {
    var n;
    g(this, $s) || S(this, $s, /* @__PURE__ */ new Map());
    const e = g(this, $s).get(t);
    if (!e || (e.refCounter -= 1, e.refCounter !== 0))
      return;
    const {
      bitmap: i
    } = e;
    if (!e.url && !e.file) {
      const a = new OffscreenCanvas(i.width, i.height);
      a.getContext("bitmaprenderer").transferFromImageBitmap(i), e.blobPromise = a.convertToBlob();
    }
    (n = i.close) == null || n.call(i), e.bitmap = null;
  }
  isValidId(t) {
    return t.startsWith(`image_${g(this, hu)}_`);
  }
};
hu = new WeakMap(), I0 = new WeakMap(), $s = new WeakMap(), uu = new WeakSet(), ug = async function(t, e) {
  g(this, $s) || S(this, $s, /* @__PURE__ */ new Map());
  let i = g(this, $s).get(t);
  if (i === null)
    return null;
  if (i != null && i.bitmap)
    return i.refCounter += 1, i;
  try {
    i || (i = {
      bitmap: null,
      id: `image_${g(this, hu)}_${Qs(this, I0)._++}`,
      refCounter: 0,
      isSvg: !1
    });
    let n;
    if (typeof e == "string" ? (i.url = e, n = await U1(e, "blob")) : e instanceof File ? n = i.file = e : e instanceof Blob && (n = e), n.type === "image/svg+xml") {
      const a = e8._isSVGFittingCanvas, r = new FileReader(), o = new Image(), l = new Promise((c, h) => {
        o.onload = () => {
          i.bitmap = o, i.isSvg = !0, c();
        }, r.onload = async () => {
          const u = i.svgUrl = r.result;
          o.src = await a ? `${u}#svgView(preserveAspectRatio(none))` : u;
        }, o.onerror = r.onerror = h;
      });
      r.readAsDataURL(n), await l;
    } else
      i.bitmap = await createImageBitmap(n);
    i.refCounter = 1;
  } catch (n) {
    zt(n), i = null;
  }
  return g(this, $s).set(t, i), i && g(this, $s).set(i.id, i), i;
};
let f5 = e8;
var Ke, go, _0, qe;
class Vk {
  constructor(t = 128) {
    _(this, Ke, []);
    _(this, go, !1);
    _(this, _0);
    _(this, qe, -1);
    S(this, _0, t);
  }
  add({
    cmd: t,
    undo: e,
    post: i,
    mustExec: n,
    type: a = NaN,
    overwriteIfSameType: r = !1,
    keepUndo: o = !1
  }) {
    if (n && t(), g(this, go))
      return;
    const l = {
      cmd: t,
      undo: e,
      post: i,
      type: a
    };
    if (g(this, qe) === -1) {
      g(this, Ke).length > 0 && (g(this, Ke).length = 0), S(this, qe, 0), g(this, Ke).push(l);
      return;
    }
    if (r && g(this, Ke)[g(this, qe)].type === a) {
      o && (l.undo = g(this, Ke)[g(this, qe)].undo), g(this, Ke)[g(this, qe)] = l;
      return;
    }
    const c = g(this, qe) + 1;
    c === g(this, _0) ? g(this, Ke).splice(0, 1) : (S(this, qe, c), c < g(this, Ke).length && g(this, Ke).splice(c)), g(this, Ke).push(l);
  }
  undo() {
    if (g(this, qe) === -1)
      return;
    S(this, go, !0);
    const {
      undo: t,
      post: e
    } = g(this, Ke)[g(this, qe)];
    t(), e == null || e(), S(this, go, !1), S(this, qe, g(this, qe) - 1);
  }
  redo() {
    if (g(this, qe) < g(this, Ke).length - 1) {
      S(this, qe, g(this, qe) + 1), S(this, go, !0);
      const {
        cmd: t,
        post: e
      } = g(this, Ke)[g(this, qe)];
      t(), e == null || e(), S(this, go, !1);
    }
  }
  hasSomethingToUndo() {
    return g(this, qe) !== -1;
  }
  hasSomethingToRedo() {
    return g(this, qe) < g(this, Ke).length - 1;
  }
  cleanType(t) {
    if (g(this, qe) !== -1) {
      for (let e = g(this, qe); e >= 0; e--)
        if (g(this, Ke)[e].type !== t) {
          g(this, Ke).splice(e + 1, g(this, qe) - e), S(this, qe, e);
          return;
        }
      g(this, Ke).length = 0, S(this, qe, -1);
    }
  }
  destroy() {
    S(this, Ke, null);
  }
}
Ke = new WeakMap(), go = new WeakMap(), _0 = new WeakMap(), qe = new WeakMap();
var l9, Ty;
class y2 {
  constructor(t) {
    _(this, l9);
    this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
    const {
      isMac: e
    } = ks.platform;
    for (const [i, n, a = {}] of t)
      for (const r of i) {
        const o = r.startsWith("mac+");
        e && o ? (this.callbacks.set(r.slice(4), {
          callback: n,
          options: a
        }), this.allKeys.add(r.split("+").at(-1))) : !e && !o && (this.callbacks.set(r, {
          callback: n,
          options: a
        }), this.allKeys.add(r.split("+").at(-1)));
      }
  }
  exec(t, e) {
    if (!this.allKeys.has(e.key))
      return;
    const i = this.callbacks.get(C(this, l9, Ty).call(this, e));
    if (!i)
      return;
    const {
      callback: n,
      options: {
        bubbles: a = !1,
        args: r = [],
        checker: o = null
      }
    } = i;
    o && !o(t, e) || (n.bind(t, ...r, e)(), a || Ze(e));
  }
}
l9 = new WeakSet(), Ty = function(t) {
  t.altKey && this.buffer.push("alt"), t.ctrlKey && this.buffer.push("ctrl"), t.metaKey && this.buffer.push("meta"), t.shiftKey && this.buffer.push("shift"), this.buffer.push(t.key);
  const e = this.buffer.join("+");
  return this.buffer.length = 0, e;
};
const c9 = class c9 {
  get _colors() {
    const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
    return $k(t), ne(this, "_colors", t);
  }
  convert(t) {
    const e = Z6(t);
    if (!window.matchMedia("(forced-colors: active)").matches)
      return e;
    for (const [i, n] of this._colors)
      if (n.every((a, r) => a === e[r]))
        return c9._colorsMapping.get(i);
    return e;
  }
  getHexCode(t) {
    const e = this._colors.get(t);
    return e ? Dt.makeHexColor(...e) : t;
  }
};
ht(c9, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
let g5 = c9;
var du, Di, hs, Ss, fu, nr, gu, ln, po, mo, pu, Vl, ba, Ln, Wl, T0, E0, mu, M0, ya, bo, bu, yo, wa, h9, wo, F0, vo, Xl, Kl, Ao, R0, gs, ye, ar, xo, Yl, P0, D0, ko, va, rr, N0, cn, St, dg, p5, Ey, My, fg, Fy, Ry, Py, m5, Dy, b5, y5, Ny, ei, Ya, By, Ly, w5, Oy, hd, v5;
const Kh = class Kh {
  constructor(t, e, i, n, a, r, o, l, c, h, u, f, d, p) {
    _(this, St);
    _(this, du, new AbortController());
    _(this, Di, null);
    _(this, hs, /* @__PURE__ */ new Map());
    _(this, Ss, /* @__PURE__ */ new Map());
    _(this, fu, null);
    _(this, nr, null);
    _(this, gu, null);
    _(this, ln, new Vk());
    _(this, po, null);
    _(this, mo, null);
    _(this, pu, 0);
    _(this, Vl, /* @__PURE__ */ new Set());
    _(this, ba, null);
    _(this, Ln, null);
    _(this, Wl, /* @__PURE__ */ new Set());
    ht(this, "_editorUndoBar", null);
    _(this, T0, !1);
    _(this, E0, !1);
    _(this, mu, !1);
    _(this, M0, null);
    _(this, ya, null);
    _(this, bo, null);
    _(this, bu, null);
    _(this, yo, !1);
    _(this, wa, null);
    _(this, h9, new Gk());
    _(this, wo, !1);
    _(this, F0, !1);
    _(this, vo, null);
    _(this, Xl, null);
    _(this, Kl, null);
    _(this, Ao, null);
    _(this, R0, null);
    _(this, gs, Ht.NONE);
    _(this, ye, /* @__PURE__ */ new Set());
    _(this, ar, null);
    _(this, xo, null);
    _(this, Yl, null);
    _(this, P0, null);
    _(this, D0, {
      isEditing: !1,
      isEmpty: !0,
      hasSomethingToUndo: !1,
      hasSomethingToRedo: !1,
      hasSelectedEditor: !1,
      hasSelectedText: !1
    });
    _(this, ko, [0, 0]);
    _(this, va, null);
    _(this, rr, null);
    _(this, N0, null);
    _(this, cn, null);
    const m = this._signal = g(this, du).signal;
    S(this, rr, t), S(this, N0, e), S(this, fu, i), S(this, xo, n), this._eventBus = a, a._on("editingaction", this.onEditingAction.bind(this), {
      signal: m
    }), a._on("pagechanging", this.onPageChanging.bind(this), {
      signal: m
    }), a._on("scalechanging", this.onScaleChanging.bind(this), {
      signal: m
    }), a._on("rotationchanging", this.onRotationChanging.bind(this), {
      signal: m
    }), a._on("setpreference", this.onSetPreference.bind(this), {
      signal: m
    }), a._on("switchannotationeditorparams", (b) => this.updateParams(b.type, b.value), {
      signal: m
    }), C(this, St, Fy).call(this), C(this, St, Ny).call(this), C(this, St, m5).call(this), S(this, nr, r.annotationStorage), S(this, M0, r.filterFactory), S(this, Yl, o), S(this, bu, l || null), S(this, T0, c), S(this, E0, h), S(this, mu, u), S(this, R0, f || null), this.viewParameters = {
      realScale: Vr.PDF_TO_CSS_UNITS,
      rotation: 0
    }, this.isShiftKeyDown = !1, this._editorUndoBar = d || null, this._supportsPinchToZoom = p !== !1;
  }
  static get _keyboardManager() {
    const t = Kh.prototype, e = (r) => g(r, rr).contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && r.hasSomethingToControl(), i = (r, {
      target: o
    }) => {
      if (o instanceof HTMLInputElement) {
        const {
          type: l
        } = o;
        return l !== "text" && l !== "number";
      }
      return !0;
    }, n = this.TRANSLATE_SMALL, a = this.TRANSLATE_BIG;
    return ne(this, "_keyboardManager", new y2([[["ctrl+a", "mac+meta+a"], t.selectAll, {
      checker: i
    }], [["ctrl+z", "mac+meta+z"], t.undo, {
      checker: i
    }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], t.redo, {
      checker: i
    }], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], t.delete, {
      checker: i
    }], [["Enter", "mac+Enter"], t.addNewEditorFromKeyboard, {
      checker: (r, {
        target: o
      }) => !(o instanceof HTMLButtonElement) && g(r, rr).contains(o) && !r.isEnterHandled
    }], [[" ", "mac+ "], t.addNewEditorFromKeyboard, {
      checker: (r, {
        target: o
      }) => !(o instanceof HTMLButtonElement) && g(r, rr).contains(document.activeElement)
    }], [["Escape", "mac+Escape"], t.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], t.translateSelectedEditors, {
      args: [-n, 0],
      checker: e
    }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t.translateSelectedEditors, {
      args: [-a, 0],
      checker: e
    }], [["ArrowRight", "mac+ArrowRight"], t.translateSelectedEditors, {
      args: [n, 0],
      checker: e
    }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], t.translateSelectedEditors, {
      args: [a, 0],
      checker: e
    }], [["ArrowUp", "mac+ArrowUp"], t.translateSelectedEditors, {
      args: [0, -n],
      checker: e
    }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], t.translateSelectedEditors, {
      args: [0, -a],
      checker: e
    }], [["ArrowDown", "mac+ArrowDown"], t.translateSelectedEditors, {
      args: [0, n],
      checker: e
    }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], t.translateSelectedEditors, {
      args: [0, a],
      checker: e
    }]]));
  }
  destroy() {
    var t, e, i, n, a, r, o, l;
    (t = g(this, cn)) == null || t.resolve(), S(this, cn, null), (e = g(this, du)) == null || e.abort(), S(this, du, null), this._signal = null;
    for (const c of g(this, Ss).values())
      c.destroy();
    g(this, Ss).clear(), g(this, hs).clear(), g(this, Wl).clear(), (i = g(this, Ao)) == null || i.clear(), S(this, Di, null), g(this, ye).clear(), g(this, ln).destroy(), (n = g(this, fu)) == null || n.destroy(), (a = g(this, xo)) == null || a.destroy(), (r = g(this, wa)) == null || r.hide(), S(this, wa, null), (o = g(this, Kl)) == null || o.destroy(), S(this, Kl, null), g(this, ya) && (clearTimeout(g(this, ya)), S(this, ya, null)), g(this, va) && (clearTimeout(g(this, va)), S(this, va, null)), (l = this._editorUndoBar) == null || l.destroy();
  }
  combinedSignal(t) {
    return AbortSignal.any([this._signal, t.signal]);
  }
  get mlManager() {
    return g(this, R0);
  }
  get useNewAltTextFlow() {
    return g(this, E0);
  }
  get useNewAltTextWhenAddingImage() {
    return g(this, mu);
  }
  get hcmFilter() {
    return ne(this, "hcmFilter", g(this, Yl) ? g(this, M0).addHCMFilter(g(this, Yl).foreground, g(this, Yl).background) : "none");
  }
  get direction() {
    return ne(this, "direction", getComputedStyle(g(this, rr)).direction);
  }
  get highlightColors() {
    return ne(this, "highlightColors", g(this, bu) ? new Map(g(this, bu).split(",").map((t) => t.split("=").map((e) => e.trim()))) : null);
  }
  get highlightColorNames() {
    return ne(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, (t) => t.reverse())) : null);
  }
  setCurrentDrawingSession(t) {
    t ? (this.unselectAll(), this.disableUserSelect(!0)) : this.disableUserSelect(!1), S(this, mo, t);
  }
  setMainHighlightColorPicker(t) {
    S(this, Kl, t);
  }
  editAltText(t, e = !1) {
    var i;
    (i = g(this, fu)) == null || i.editAltText(this, t, e);
  }
  getSignature(t) {
    var e;
    (e = g(this, xo)) == null || e.getSignature({
      uiManager: this,
      editor: t
    });
  }
  get signatureManager() {
    return g(this, xo);
  }
  switchToMode(t, e) {
    this._eventBus.on("annotationeditormodechanged", e, {
      once: !0,
      signal: this._signal
    }), this._eventBus.dispatch("showannotationeditorui", {
      source: this,
      mode: t
    });
  }
  setPreference(t, e) {
    this._eventBus.dispatch("setpreference", {
      source: this,
      name: t,
      value: e
    });
  }
  onSetPreference({
    name: t,
    value: e
  }) {
    switch (t) {
      case "enableNewAltTextWhenAddingImage":
        S(this, mu, e);
        break;
    }
  }
  onPageChanging({
    pageNumber: t
  }) {
    S(this, pu, t - 1);
  }
  focusMainContainer() {
    g(this, rr).focus();
  }
  findParent(t, e) {
    for (const i of g(this, Ss).values()) {
      const {
        x: n,
        y: a,
        width: r,
        height: o
      } = i.div.getBoundingClientRect();
      if (t >= n && t <= n + r && e >= a && e <= a + o)
        return i;
    }
    return null;
  }
  disableUserSelect(t = !1) {
    g(this, N0).classList.toggle("noUserSelect", t);
  }
  addShouldRescale(t) {
    g(this, Wl).add(t);
  }
  removeShouldRescale(t) {
    g(this, Wl).delete(t);
  }
  onScaleChanging({
    scale: t
  }) {
    var e;
    this.commitOrRemove(), this.viewParameters.realScale = t * Vr.PDF_TO_CSS_UNITS;
    for (const i of g(this, Wl))
      i.onScaleChanging();
    (e = g(this, mo)) == null || e.onScaleChanging();
  }
  onRotationChanging({
    pagesRotation: t
  }) {
    this.commitOrRemove(), this.viewParameters.rotation = t;
  }
  highlightSelection(t = "") {
    const e = document.getSelection();
    if (!e || e.isCollapsed)
      return;
    const {
      anchorNode: i,
      anchorOffset: n,
      focusNode: a,
      focusOffset: r
    } = e, o = e.toString(), c = C(this, St, dg).call(this, e).closest(".textLayer"), h = this.getSelectionBoxes(c);
    if (!h)
      return;
    e.empty();
    const u = C(this, St, p5).call(this, c), f = g(this, gs) === Ht.NONE, d = () => {
      u == null || u.createAndAddNewEditor({
        x: 0,
        y: 0
      }, !1, {
        methodOfCreation: t,
        boxes: h,
        anchorNode: i,
        anchorOffset: n,
        focusNode: a,
        focusOffset: r,
        text: o
      }), f && this.showAllEditors("highlight", !0, !0);
    };
    if (f) {
      this.switchToMode(Ht.HIGHLIGHT, d);
      return;
    }
    d();
  }
  addToAnnotationStorage(t) {
    !t.isEmpty() && g(this, nr) && !g(this, nr).has(t.id) && g(this, nr).setValue(t.id, t);
  }
  blur() {
    if (this.isShiftKeyDown = !1, g(this, yo) && (S(this, yo, !1), C(this, St, fg).call(this, "main_toolbar")), !this.hasSelection)
      return;
    const {
      activeElement: t
    } = document;
    for (const e of g(this, ye))
      if (e.div.contains(t)) {
        S(this, Xl, [e, t]), e._focusEventsAllowed = !1;
        break;
      }
  }
  focus() {
    if (!g(this, Xl))
      return;
    const [t, e] = g(this, Xl);
    S(this, Xl, null), e.addEventListener("focusin", () => {
      t._focusEventsAllowed = !0;
    }, {
      once: !0,
      signal: this._signal
    }), e.focus();
  }
  addEditListeners() {
    C(this, St, m5).call(this), C(this, St, b5).call(this);
  }
  removeEditListeners() {
    C(this, St, Dy).call(this), C(this, St, y5).call(this);
  }
  dragOver(t) {
    for (const {
      type: e
    } of t.dataTransfer.items)
      for (const i of g(this, Ln))
        if (i.isHandlingMimeForPasting(e)) {
          t.dataTransfer.dropEffect = "copy", t.preventDefault();
          return;
        }
  }
  drop(t) {
    for (const e of t.dataTransfer.items)
      for (const i of g(this, Ln))
        if (i.isHandlingMimeForPasting(e.type)) {
          i.paste(e, this.currentLayer), t.preventDefault();
          return;
        }
  }
  copy(t) {
    var i;
    if (t.preventDefault(), (i = g(this, Di)) == null || i.commitOrRemove(), !this.hasSelection)
      return;
    const e = [];
    for (const n of g(this, ye)) {
      const a = n.serialize(!0);
      a && e.push(a);
    }
    e.length !== 0 && t.clipboardData.setData("application/pdfjs", JSON.stringify(e));
  }
  cut(t) {
    this.copy(t), this.delete();
  }
  async paste(t) {
    t.preventDefault();
    const {
      clipboardData: e
    } = t;
    for (const a of e.items)
      for (const r of g(this, Ln))
        if (r.isHandlingMimeForPasting(a.type)) {
          r.paste(a, this.currentLayer);
          return;
        }
    let i = e.getData("application/pdfjs");
    if (!i)
      return;
    try {
      i = JSON.parse(i);
    } catch (a) {
      zt(`paste: "${a.message}".`);
      return;
    }
    if (!Array.isArray(i))
      return;
    this.unselectAll();
    const n = this.currentLayer;
    try {
      const a = [];
      for (const l of i) {
        const c = await n.deserialize(l);
        if (!c)
          return;
        a.push(c);
      }
      const r = () => {
        for (const l of a)
          C(this, St, w5).call(this, l);
        C(this, St, v5).call(this, a);
      }, o = () => {
        for (const l of a)
          l.remove();
      };
      this.addCommands({
        cmd: r,
        undo: o,
        mustExec: !0
      });
    } catch (a) {
      zt(`paste: "${a.message}".`);
    }
  }
  keydown(t) {
    !this.isShiftKeyDown && t.key === "Shift" && (this.isShiftKeyDown = !0), g(this, gs) !== Ht.NONE && !this.isEditorHandlingKeyboard && Kh._keyboardManager.exec(this, t);
  }
  keyup(t) {
    this.isShiftKeyDown && t.key === "Shift" && (this.isShiftKeyDown = !1, g(this, yo) && (S(this, yo, !1), C(this, St, fg).call(this, "main_toolbar")));
  }
  onEditingAction({
    name: t
  }) {
    switch (t) {
      case "undo":
      case "redo":
      case "delete":
      case "selectAll":
        this[t]();
        break;
      case "highlightSelection":
        this.highlightSelection("context_menu");
        break;
    }
  }
  setEditingState(t) {
    t ? (C(this, St, Ry).call(this), C(this, St, b5).call(this), C(this, St, ei).call(this, {
      isEditing: g(this, gs) !== Ht.NONE,
      isEmpty: C(this, St, hd).call(this),
      hasSomethingToUndo: g(this, ln).hasSomethingToUndo(),
      hasSomethingToRedo: g(this, ln).hasSomethingToRedo(),
      hasSelectedEditor: !1
    })) : (C(this, St, Py).call(this), C(this, St, y5).call(this), C(this, St, ei).call(this, {
      isEditing: !1
    }), this.disableUserSelect(!1));
  }
  registerEditorTypes(t) {
    if (!g(this, Ln)) {
      S(this, Ln, t);
      for (const e of g(this, Ln))
        C(this, St, Ya).call(this, e.defaultPropertiesToUpdate);
    }
  }
  getId() {
    return g(this, h9).id;
  }
  get currentLayer() {
    return g(this, Ss).get(g(this, pu));
  }
  getLayer(t) {
    return g(this, Ss).get(t);
  }
  get currentPageIndex() {
    return g(this, pu);
  }
  addLayer(t) {
    g(this, Ss).set(t.pageIndex, t), g(this, wo) ? t.enable() : t.disable();
  }
  removeLayer(t) {
    g(this, Ss).delete(t.pageIndex);
  }
  async updateMode(t, e = null, i = !1) {
    var n, a, r;
    if (g(this, gs) !== t && !(g(this, cn) && (await g(this, cn).promise, !g(this, cn)))) {
      if (S(this, cn, Promise.withResolvers()), (n = g(this, mo)) == null || n.commitOrRemove(), S(this, gs, t), t === Ht.NONE) {
        this.setEditingState(!1), C(this, St, Ly).call(this), (a = this._editorUndoBar) == null || a.hide(), g(this, cn).resolve();
        return;
      }
      t === Ht.SIGNATURE && await ((r = g(this, xo)) == null ? void 0 : r.loadSignatures()), this.setEditingState(!0), await C(this, St, By).call(this), this.unselectAll();
      for (const o of g(this, Ss).values())
        o.updateMode(t);
      if (!e) {
        i && this.addNewEditorFromKeyboard(), g(this, cn).resolve();
        return;
      }
      for (const o of g(this, hs).values())
        o.annotationElementId === e || o.id === e ? (this.setSelected(o), o.enterInEditMode()) : o.unselect();
      g(this, cn).resolve();
    }
  }
  addNewEditorFromKeyboard() {
    this.currentLayer.canCreateNewEmptyEditor() && this.currentLayer.addNewEditor();
  }
  updateToolbar(t) {
    t.mode !== g(this, gs) && this._eventBus.dispatch("switchannotationeditormode", {
      source: this,
      ...t
    });
  }
  updateParams(t, e) {
    var i;
    if (g(this, Ln)) {
      switch (t) {
        case ae.CREATE:
          this.currentLayer.addNewEditor(e);
          return;
        case ae.HIGHLIGHT_DEFAULT_COLOR:
          (i = g(this, Kl)) == null || i.updateColor(e);
          break;
        case ae.HIGHLIGHT_SHOW_ALL:
          this._eventBus.dispatch("reporttelemetry", {
            source: this,
            details: {
              type: "editing",
              data: {
                type: "highlight",
                action: "toggle_visibility"
              }
            }
          }), (g(this, P0) || S(this, P0, /* @__PURE__ */ new Map())).set(t, e), this.showAllEditors("highlight", e);
          break;
      }
      for (const n of g(this, ye))
        n.updateParams(t, e);
      for (const n of g(this, Ln))
        n.updateDefaultParams(t, e);
    }
  }
  showAllEditors(t, e, i = !1) {
    var a;
    for (const r of g(this, hs).values())
      r.editorType === t && r.show(e);
    (((a = g(this, P0)) == null ? void 0 : a.get(ae.HIGHLIGHT_SHOW_ALL)) ?? !0) !== e && C(this, St, Ya).call(this, [[ae.HIGHLIGHT_SHOW_ALL, e]]);
  }
  enableWaiting(t = !1) {
    if (g(this, F0) !== t) {
      S(this, F0, t);
      for (const e of g(this, Ss).values())
        t ? e.disableClick() : e.enableClick(), e.div.classList.toggle("waiting", t);
    }
  }
  getEditors(t) {
    const e = [];
    for (const i of g(this, hs).values())
      i.pageIndex === t && e.push(i);
    return e;
  }
  getEditor(t) {
    return g(this, hs).get(t);
  }
  addEditor(t) {
    g(this, hs).set(t.id, t);
  }
  removeEditor(t) {
    var e, i;
    t.div.contains(document.activeElement) && (g(this, ya) && clearTimeout(g(this, ya)), S(this, ya, setTimeout(() => {
      this.focusMainContainer(), S(this, ya, null);
    }, 0))), g(this, hs).delete(t.id), t.annotationElementId && ((e = g(this, Ao)) == null || e.delete(t.annotationElementId)), this.unselect(t), (!t.annotationElementId || !g(this, Vl).has(t.annotationElementId)) && ((i = g(this, nr)) == null || i.remove(t.id));
  }
  addDeletedAnnotationElement(t) {
    g(this, Vl).add(t.annotationElementId), this.addChangedExistingAnnotation(t), t.deleted = !0;
  }
  isDeletedAnnotationElement(t) {
    return g(this, Vl).has(t);
  }
  removeDeletedAnnotationElement(t) {
    g(this, Vl).delete(t.annotationElementId), this.removeChangedExistingAnnotation(t), t.deleted = !1;
  }
  setActiveEditor(t) {
    g(this, Di) !== t && (S(this, Di, t), t && C(this, St, Ya).call(this, t.propertiesToUpdate));
  }
  updateUI(t) {
    g(this, St, Oy) === t && C(this, St, Ya).call(this, t.propertiesToUpdate);
  }
  updateUIForDefaultProperties(t) {
    C(this, St, Ya).call(this, t.defaultPropertiesToUpdate);
  }
  toggleSelected(t) {
    if (g(this, ye).has(t)) {
      g(this, ye).delete(t), t.unselect(), C(this, St, ei).call(this, {
        hasSelectedEditor: this.hasSelection
      });
      return;
    }
    g(this, ye).add(t), t.select(), C(this, St, Ya).call(this, t.propertiesToUpdate), C(this, St, ei).call(this, {
      hasSelectedEditor: !0
    });
  }
  setSelected(t) {
    var e;
    (e = g(this, mo)) == null || e.commitOrRemove();
    for (const i of g(this, ye))
      i !== t && i.unselect();
    g(this, ye).clear(), g(this, ye).add(t), t.select(), C(this, St, Ya).call(this, t.propertiesToUpdate), C(this, St, ei).call(this, {
      hasSelectedEditor: !0
    });
  }
  isSelected(t) {
    return g(this, ye).has(t);
  }
  get firstSelectedEditor() {
    return g(this, ye).values().next().value;
  }
  unselect(t) {
    t.unselect(), g(this, ye).delete(t), C(this, St, ei).call(this, {
      hasSelectedEditor: this.hasSelection
    });
  }
  get hasSelection() {
    return g(this, ye).size !== 0;
  }
  get isEnterHandled() {
    return g(this, ye).size === 1 && this.firstSelectedEditor.isEnterHandled;
  }
  undo() {
    var t;
    g(this, ln).undo(), C(this, St, ei).call(this, {
      hasSomethingToUndo: g(this, ln).hasSomethingToUndo(),
      hasSomethingToRedo: !0,
      isEmpty: C(this, St, hd).call(this)
    }), (t = this._editorUndoBar) == null || t.hide();
  }
  redo() {
    g(this, ln).redo(), C(this, St, ei).call(this, {
      hasSomethingToUndo: !0,
      hasSomethingToRedo: g(this, ln).hasSomethingToRedo(),
      isEmpty: C(this, St, hd).call(this)
    });
  }
  addCommands(t) {
    g(this, ln).add(t), C(this, St, ei).call(this, {
      hasSomethingToUndo: !0,
      hasSomethingToRedo: !1,
      isEmpty: C(this, St, hd).call(this)
    });
  }
  cleanUndoStack(t) {
    g(this, ln).cleanType(t);
  }
  delete() {
    var a;
    this.commitOrRemove();
    const t = (a = this.currentLayer) == null ? void 0 : a.endDrawingSession(!0);
    if (!this.hasSelection && !t)
      return;
    const e = t ? [t] : [...g(this, ye)], i = () => {
      var r;
      (r = this._editorUndoBar) == null || r.show(n, e.length === 1 ? e[0].editorType : e.length);
      for (const o of e)
        o.remove();
    }, n = () => {
      for (const r of e)
        C(this, St, w5).call(this, r);
    };
    this.addCommands({
      cmd: i,
      undo: n,
      mustExec: !0
    });
  }
  commitOrRemove() {
    var t;
    (t = g(this, Di)) == null || t.commitOrRemove();
  }
  hasSomethingToControl() {
    return g(this, Di) || this.hasSelection;
  }
  selectAll() {
    for (const t of g(this, ye))
      t.commit();
    C(this, St, v5).call(this, g(this, hs).values());
  }
  unselectAll() {
    var t;
    if (!(g(this, Di) && (g(this, Di).commitOrRemove(), g(this, gs) !== Ht.NONE)) && !((t = g(this, mo)) != null && t.commitOrRemove()) && this.hasSelection) {
      for (const e of g(this, ye))
        e.unselect();
      g(this, ye).clear(), C(this, St, ei).call(this, {
        hasSelectedEditor: !1
      });
    }
  }
  translateSelectedEditors(t, e, i = !1) {
    if (i || this.commitOrRemove(), !this.hasSelection)
      return;
    g(this, ko)[0] += t, g(this, ko)[1] += e;
    const [n, a] = g(this, ko), r = [...g(this, ye)], o = 1e3;
    g(this, va) && clearTimeout(g(this, va)), S(this, va, setTimeout(() => {
      S(this, va, null), g(this, ko)[0] = g(this, ko)[1] = 0, this.addCommands({
        cmd: () => {
          for (const l of r)
            g(this, hs).has(l.id) && (l.translateInPage(n, a), l.translationDone());
        },
        undo: () => {
          for (const l of r)
            g(this, hs).has(l.id) && (l.translateInPage(-n, -a), l.translationDone());
        },
        mustExec: !1
      });
    }, o));
    for (const l of r)
      l.translateInPage(t, e), l.translationDone();
  }
  setUpDragSession() {
    if (this.hasSelection) {
      this.disableUserSelect(!0), S(this, ba, /* @__PURE__ */ new Map());
      for (const t of g(this, ye))
        g(this, ba).set(t, {
          savedX: t.x,
          savedY: t.y,
          savedPageIndex: t.pageIndex,
          newX: 0,
          newY: 0,
          newPageIndex: -1
        });
    }
  }
  endDragSession() {
    if (!g(this, ba))
      return !1;
    this.disableUserSelect(!1);
    const t = g(this, ba);
    S(this, ba, null);
    let e = !1;
    for (const [{
      x: n,
      y: a,
      pageIndex: r
    }, o] of t)
      o.newX = n, o.newY = a, o.newPageIndex = r, e || (e = n !== o.savedX || a !== o.savedY || r !== o.savedPageIndex);
    if (!e)
      return !1;
    const i = (n, a, r, o) => {
      if (g(this, hs).has(n.id)) {
        const l = g(this, Ss).get(o);
        l ? n._setParentAndPosition(l, a, r) : (n.pageIndex = o, n.x = a, n.y = r);
      }
    };
    return this.addCommands({
      cmd: () => {
        for (const [n, {
          newX: a,
          newY: r,
          newPageIndex: o
        }] of t)
          i(n, a, r, o);
      },
      undo: () => {
        for (const [n, {
          savedX: a,
          savedY: r,
          savedPageIndex: o
        }] of t)
          i(n, a, r, o);
      },
      mustExec: !0
    }), !0;
  }
  dragSelectedEditors(t, e) {
    if (g(this, ba))
      for (const i of g(this, ba).keys())
        i.drag(t, e);
  }
  rebuild(t) {
    if (t.parent === null) {
      const e = this.getLayer(t.pageIndex);
      e ? (e.changeParent(t), e.addOrRebuild(t)) : (this.addEditor(t), this.addToAnnotationStorage(t), t.rebuild());
    } else
      t.parent.addOrRebuild(t);
  }
  get isEditorHandlingKeyboard() {
    var t;
    return ((t = this.getActive()) == null ? void 0 : t.shouldGetKeyboardEvents()) || g(this, ye).size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents();
  }
  isActive(t) {
    return g(this, Di) === t;
  }
  getActive() {
    return g(this, Di);
  }
  getMode() {
    return g(this, gs);
  }
  get imageManager() {
    return ne(this, "imageManager", new f5());
  }
  getSelectionBoxes(t) {
    if (!t)
      return null;
    const e = document.getSelection();
    for (let c = 0, h = e.rangeCount; c < h; c++)
      if (!t.contains(e.getRangeAt(c).commonAncestorContainer))
        return null;
    const {
      x: i,
      y: n,
      width: a,
      height: r
    } = t.getBoundingClientRect();
    let o;
    switch (t.getAttribute("data-main-rotation")) {
      case "90":
        o = (c, h, u, f) => ({
          x: (h - n) / r,
          y: 1 - (c + u - i) / a,
          width: f / r,
          height: u / a
        });
        break;
      case "180":
        o = (c, h, u, f) => ({
          x: 1 - (c + u - i) / a,
          y: 1 - (h + f - n) / r,
          width: u / a,
          height: f / r
        });
        break;
      case "270":
        o = (c, h, u, f) => ({
          x: 1 - (h + f - n) / r,
          y: (c - i) / a,
          width: f / r,
          height: u / a
        });
        break;
      default:
        o = (c, h, u, f) => ({
          x: (c - i) / a,
          y: (h - n) / r,
          width: u / a,
          height: f / r
        });
        break;
    }
    const l = [];
    for (let c = 0, h = e.rangeCount; c < h; c++) {
      const u = e.getRangeAt(c);
      if (!u.collapsed)
        for (const {
          x: f,
          y: d,
          width: p,
          height: m
        } of u.getClientRects())
          p === 0 || m === 0 || l.push(o(f, d, p, m));
    }
    return l.length === 0 ? null : l;
  }
  addChangedExistingAnnotation({
    annotationElementId: t,
    id: e
  }) {
    (g(this, gu) || S(this, gu, /* @__PURE__ */ new Map())).set(t, e);
  }
  removeChangedExistingAnnotation({
    annotationElementId: t
  }) {
    var e;
    (e = g(this, gu)) == null || e.delete(t);
  }
  renderAnnotationElement(t) {
    var n;
    const e = (n = g(this, gu)) == null ? void 0 : n.get(t.data.id);
    if (!e)
      return;
    const i = g(this, nr).getRawValue(e);
    i && (g(this, gs) === Ht.NONE && !i.hasBeenModified || i.renderAnnotationElement(t));
  }
  setMissingCanvas(t, e, i) {
    var a;
    const n = (a = g(this, Ao)) == null ? void 0 : a.get(t);
    n && (n.setCanvas(e, i), g(this, Ao).delete(t));
  }
  addMissingCanvas(t, e) {
    (g(this, Ao) || S(this, Ao, /* @__PURE__ */ new Map())).set(t, e);
  }
};
du = new WeakMap(), Di = new WeakMap(), hs = new WeakMap(), Ss = new WeakMap(), fu = new WeakMap(), nr = new WeakMap(), gu = new WeakMap(), ln = new WeakMap(), po = new WeakMap(), mo = new WeakMap(), pu = new WeakMap(), Vl = new WeakMap(), ba = new WeakMap(), Ln = new WeakMap(), Wl = new WeakMap(), T0 = new WeakMap(), E0 = new WeakMap(), mu = new WeakMap(), M0 = new WeakMap(), ya = new WeakMap(), bo = new WeakMap(), bu = new WeakMap(), yo = new WeakMap(), wa = new WeakMap(), h9 = new WeakMap(), wo = new WeakMap(), F0 = new WeakMap(), vo = new WeakMap(), Xl = new WeakMap(), Kl = new WeakMap(), Ao = new WeakMap(), R0 = new WeakMap(), gs = new WeakMap(), ye = new WeakMap(), ar = new WeakMap(), xo = new WeakMap(), Yl = new WeakMap(), P0 = new WeakMap(), D0 = new WeakMap(), ko = new WeakMap(), va = new WeakMap(), rr = new WeakMap(), N0 = new WeakMap(), cn = new WeakMap(), St = new WeakSet(), dg = function({
  anchorNode: t
}) {
  return t.nodeType === Node.TEXT_NODE ? t.parentElement : t;
}, p5 = function(t) {
  const {
    currentLayer: e
  } = this;
  if (e.hasTextLayer(t))
    return e;
  for (const i of g(this, Ss).values())
    if (i.hasTextLayer(t))
      return i;
  return null;
}, Ey = function() {
  const t = document.getSelection();
  if (!t || t.isCollapsed)
    return;
  const i = C(this, St, dg).call(this, t).closest(".textLayer"), n = this.getSelectionBoxes(i);
  n && (g(this, wa) || S(this, wa, new zk(this)), g(this, wa).show(i, n, this.direction === "ltr"));
}, My = function() {
  var a, r, o;
  const t = document.getSelection();
  if (!t || t.isCollapsed) {
    g(this, ar) && ((a = g(this, wa)) == null || a.hide(), S(this, ar, null), C(this, St, ei).call(this, {
      hasSelectedText: !1
    }));
    return;
  }
  const {
    anchorNode: e
  } = t;
  if (e === g(this, ar))
    return;
  const n = C(this, St, dg).call(this, t).closest(".textLayer");
  if (!n) {
    g(this, ar) && ((r = g(this, wa)) == null || r.hide(), S(this, ar, null), C(this, St, ei).call(this, {
      hasSelectedText: !1
    }));
    return;
  }
  if ((o = g(this, wa)) == null || o.hide(), S(this, ar, e), C(this, St, ei).call(this, {
    hasSelectedText: !0
  }), !(g(this, gs) !== Ht.HIGHLIGHT && g(this, gs) !== Ht.NONE) && (g(this, gs) === Ht.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), S(this, yo, this.isShiftKeyDown), !this.isShiftKeyDown)) {
    const l = g(this, gs) === Ht.HIGHLIGHT ? C(this, St, p5).call(this, n) : null;
    l == null || l.toggleDrawing();
    const c = new AbortController(), h = this.combinedSignal(c), u = (f) => {
      f.type === "pointerup" && f.button !== 0 || (c.abort(), l == null || l.toggleDrawing(!0), f.type === "pointerup" && C(this, St, fg).call(this, "main_toolbar"));
    };
    window.addEventListener("pointerup", u, {
      signal: h
    }), window.addEventListener("blur", u, {
      signal: h
    });
  }
}, fg = function(t = "") {
  g(this, gs) === Ht.HIGHLIGHT ? this.highlightSelection(t) : g(this, T0) && C(this, St, Ey).call(this);
}, Fy = function() {
  document.addEventListener("selectionchange", C(this, St, My).bind(this), {
    signal: this._signal
  });
}, Ry = function() {
  if (g(this, bo))
    return;
  S(this, bo, new AbortController());
  const t = this.combinedSignal(g(this, bo));
  window.addEventListener("focus", this.focus.bind(this), {
    signal: t
  }), window.addEventListener("blur", this.blur.bind(this), {
    signal: t
  });
}, Py = function() {
  var t;
  (t = g(this, bo)) == null || t.abort(), S(this, bo, null);
}, m5 = function() {
  if (g(this, vo))
    return;
  S(this, vo, new AbortController());
  const t = this.combinedSignal(g(this, vo));
  window.addEventListener("keydown", this.keydown.bind(this), {
    signal: t
  }), window.addEventListener("keyup", this.keyup.bind(this), {
    signal: t
  });
}, Dy = function() {
  var t;
  (t = g(this, vo)) == null || t.abort(), S(this, vo, null);
}, b5 = function() {
  if (g(this, po))
    return;
  S(this, po, new AbortController());
  const t = this.combinedSignal(g(this, po));
  document.addEventListener("copy", this.copy.bind(this), {
    signal: t
  }), document.addEventListener("cut", this.cut.bind(this), {
    signal: t
  }), document.addEventListener("paste", this.paste.bind(this), {
    signal: t
  });
}, y5 = function() {
  var t;
  (t = g(this, po)) == null || t.abort(), S(this, po, null);
}, Ny = function() {
  const t = this._signal;
  document.addEventListener("dragover", this.dragOver.bind(this), {
    signal: t
  }), document.addEventListener("drop", this.drop.bind(this), {
    signal: t
  });
}, ei = function(t) {
  Object.entries(t).some(([i, n]) => g(this, D0)[i] !== n) && (this._eventBus.dispatch("annotationeditorstateschanged", {
    source: this,
    details: Object.assign(g(this, D0), t)
  }), g(this, gs) === Ht.HIGHLIGHT && t.hasSelectedEditor === !1 && C(this, St, Ya).call(this, [[ae.HIGHLIGHT_FREE, !0]]));
}, Ya = function(t) {
  this._eventBus.dispatch("annotationeditorparamschanged", {
    source: this,
    details: t
  });
}, By = async function() {
  if (!g(this, wo)) {
    S(this, wo, !0);
    const t = [];
    for (const e of g(this, Ss).values())
      t.push(e.enable());
    await Promise.all(t);
    for (const e of g(this, hs).values())
      e.enable();
  }
}, Ly = function() {
  if (this.unselectAll(), g(this, wo)) {
    S(this, wo, !1);
    for (const t of g(this, Ss).values())
      t.disable();
    for (const t of g(this, hs).values())
      t.disable();
  }
}, w5 = function(t) {
  const e = g(this, Ss).get(t.pageIndex);
  e ? e.addOrRebuild(t) : (this.addEditor(t), this.addToAnnotationStorage(t));
}, Oy = function() {
  let t = null;
  for (t of g(this, ye))
    ;
  return t;
}, hd = function() {
  if (g(this, hs).size === 0)
    return !0;
  if (g(this, hs).size === 1)
    for (const t of g(this, hs).values())
      return t.isEmpty();
  return !1;
}, v5 = function(t) {
  for (const e of g(this, ye))
    e.unselect();
  g(this, ye).clear();
  for (const e of t)
    e.isEmpty() || (g(this, ye).add(e), e.select());
  C(this, St, ei).call(this, {
    hasSelectedEditor: this.hasSelection
  });
}, ht(Kh, "TRANSLATE_SMALL", 1), ht(Kh, "TRANSLATE_BIG", 10);
let ol = Kh;
var ps, Aa, On, yu, xa, Ni, wu, ka, yi, or, Jl, Sa, So, ea, ud, gg;
const ii = class ii {
  constructor(t) {
    _(this, ea);
    _(this, ps, null);
    _(this, Aa, !1);
    _(this, On, null);
    _(this, yu, null);
    _(this, xa, null);
    _(this, Ni, null);
    _(this, wu, !1);
    _(this, ka, null);
    _(this, yi, null);
    _(this, or, null);
    _(this, Jl, null);
    _(this, Sa, !1);
    S(this, yi, t), S(this, Sa, t._uiManager.useNewAltTextFlow), g(ii, So) || S(ii, So, Object.freeze({
      added: "pdfjs-editor-new-alt-text-added-button",
      "added-label": "pdfjs-editor-new-alt-text-added-button-label",
      missing: "pdfjs-editor-new-alt-text-missing-button",
      "missing-label": "pdfjs-editor-new-alt-text-missing-button-label",
      review: "pdfjs-editor-new-alt-text-to-review-button",
      "review-label": "pdfjs-editor-new-alt-text-to-review-button-label"
    }));
  }
  static initialize(t) {
    ii._l10n ?? (ii._l10n = t);
  }
  async render() {
    const t = S(this, On, document.createElement("button"));
    t.className = "altText", t.tabIndex = "0";
    const e = S(this, yu, document.createElement("span"));
    t.append(e), g(this, Sa) ? (t.classList.add("new"), t.setAttribute("data-l10n-id", g(ii, So).missing), e.setAttribute("data-l10n-id", g(ii, So)["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
    const i = g(this, yi)._uiManager._signal;
    t.addEventListener("contextmenu", En, {
      signal: i
    }), t.addEventListener("pointerdown", (a) => a.stopPropagation(), {
      signal: i
    });
    const n = (a) => {
      a.preventDefault(), g(this, yi)._uiManager.editAltText(g(this, yi)), g(this, Sa) && g(this, yi)._reportTelemetry({
        action: "pdfjs.image.alt_text.image_status_label_clicked",
        data: {
          label: g(this, ea, ud)
        }
      });
    };
    return t.addEventListener("click", n, {
      capture: !0,
      signal: i
    }), t.addEventListener("keydown", (a) => {
      a.target === t && a.key === "Enter" && (S(this, wu, !0), n(a));
    }, {
      signal: i
    }), await C(this, ea, gg).call(this), t;
  }
  finish() {
    g(this, On) && (g(this, On).focus({
      focusVisible: g(this, wu)
    }), S(this, wu, !1));
  }
  isEmpty() {
    return g(this, Sa) ? g(this, ps) === null : !g(this, ps) && !g(this, Aa);
  }
  hasData() {
    return g(this, Sa) ? g(this, ps) !== null || !!g(this, or) : this.isEmpty();
  }
  get guessedText() {
    return g(this, or);
  }
  async setGuessedText(t) {
    g(this, ps) === null && (S(this, or, t), S(this, Jl, await ii._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer", {
      generatedAltText: t
    })), C(this, ea, gg).call(this));
  }
  toggleAltTextBadge(t = !1) {
    var e;
    if (!g(this, Sa) || g(this, ps)) {
      (e = g(this, ka)) == null || e.remove(), S(this, ka, null);
      return;
    }
    if (!g(this, ka)) {
      const i = S(this, ka, document.createElement("div"));
      i.className = "noAltTextBadge", g(this, yi).div.append(i);
    }
    g(this, ka).classList.toggle("hidden", !t);
  }
  serialize(t) {
    let e = g(this, ps);
    return !t && g(this, or) === e && (e = g(this, Jl)), {
      altText: e,
      decorative: g(this, Aa),
      guessedText: g(this, or),
      textWithDisclaimer: g(this, Jl)
    };
  }
  get data() {
    return {
      altText: g(this, ps),
      decorative: g(this, Aa)
    };
  }
  set data({
    altText: t,
    decorative: e,
    guessedText: i,
    textWithDisclaimer: n,
    cancel: a = !1
  }) {
    i && (S(this, or, i), S(this, Jl, n)), !(g(this, ps) === t && g(this, Aa) === e) && (a || (S(this, ps, t), S(this, Aa, e)), C(this, ea, gg).call(this));
  }
  toggle(t = !1) {
    g(this, On) && (!t && g(this, Ni) && (clearTimeout(g(this, Ni)), S(this, Ni, null)), g(this, On).disabled = !t);
  }
  shown() {
    g(this, yi)._reportTelemetry({
      action: "pdfjs.image.alt_text.image_status_label_displayed",
      data: {
        label: g(this, ea, ud)
      }
    });
  }
  destroy() {
    var t, e;
    (t = g(this, On)) == null || t.remove(), S(this, On, null), S(this, yu, null), S(this, xa, null), (e = g(this, ka)) == null || e.remove(), S(this, ka, null);
  }
};
ps = new WeakMap(), Aa = new WeakMap(), On = new WeakMap(), yu = new WeakMap(), xa = new WeakMap(), Ni = new WeakMap(), wu = new WeakMap(), ka = new WeakMap(), yi = new WeakMap(), or = new WeakMap(), Jl = new WeakMap(), Sa = new WeakMap(), So = new WeakMap(), ea = new WeakSet(), ud = function() {
  return g(this, ps) && "added" || g(this, ps) === null && this.guessedText && "review" || "missing";
}, gg = async function() {
  var n, a, r;
  const t = g(this, On);
  if (!t)
    return;
  if (g(this, Sa)) {
    if (t.classList.toggle("done", !!g(this, ps)), t.setAttribute("data-l10n-id", g(ii, So)[g(this, ea, ud)]), (n = g(this, yu)) == null || n.setAttribute("data-l10n-id", g(ii, So)[`${g(this, ea, ud)}-label`]), !g(this, ps)) {
      (a = g(this, xa)) == null || a.remove();
      return;
    }
  } else {
    if (!g(this, ps) && !g(this, Aa)) {
      t.classList.remove("done"), (r = g(this, xa)) == null || r.remove();
      return;
    }
    t.classList.add("done"), t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-edit-button");
  }
  let e = g(this, xa);
  if (!e) {
    S(this, xa, e = document.createElement("span")), e.className = "tooltip", e.setAttribute("role", "tooltip"), e.id = `alt-text-tooltip-${g(this, yi).id}`;
    const o = 100, l = g(this, yi)._uiManager._signal;
    l.addEventListener("abort", () => {
      clearTimeout(g(this, Ni)), S(this, Ni, null);
    }, {
      once: !0
    }), t.addEventListener("mouseenter", () => {
      S(this, Ni, setTimeout(() => {
        S(this, Ni, null), g(this, xa).classList.add("show"), g(this, yi)._reportTelemetry({
          action: "alt_text_tooltip"
        });
      }, o));
    }, {
      signal: l
    }), t.addEventListener("mouseleave", () => {
      var c;
      g(this, Ni) && (clearTimeout(g(this, Ni)), S(this, Ni, null)), (c = g(this, xa)) == null || c.classList.remove("show");
    }, {
      signal: l
    });
  }
  g(this, Aa) ? e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-decorative-tooltip") : (e.removeAttribute("data-l10n-id"), e.textContent = g(this, ps)), e.parentNode || t.append(e);
  const i = g(this, yi).getElementForAltText();
  i == null || i.setAttribute("aria-describedby", e.id);
}, _(ii, So, null), ht(ii, "_l10n", null);
let hp = ii;
var vu, Zl, B0, L0, O0, U0, q0, lr, Ql, cr, tc, hr, ul, Uy, qy, jy;
const s8 = class s8 {
  constructor({
    container: t,
    isPinchingDisabled: e = null,
    isPinchingStopped: i = null,
    onPinchStart: n = null,
    onPinching: a = null,
    onPinchEnd: r = null,
    signal: o
  }) {
    _(this, ul);
    _(this, vu);
    _(this, Zl, !1);
    _(this, B0, null);
    _(this, L0);
    _(this, O0);
    _(this, U0);
    _(this, q0);
    _(this, lr, null);
    _(this, Ql);
    _(this, cr, null);
    _(this, tc);
    _(this, hr, null);
    S(this, vu, t), S(this, B0, i), S(this, L0, e), S(this, O0, n), S(this, U0, a), S(this, q0, r), S(this, tc, new AbortController()), S(this, Ql, AbortSignal.any([o, g(this, tc).signal])), t.addEventListener("touchstart", C(this, ul, Uy).bind(this), {
      passive: !1,
      signal: g(this, Ql)
    });
  }
  get MIN_TOUCH_DISTANCE_TO_PINCH() {
    return 35 / na.pixelRatio;
  }
  destroy() {
    var t, e;
    (t = g(this, tc)) == null || t.abort(), S(this, tc, null), (e = g(this, lr)) == null || e.abort(), S(this, lr, null);
  }
};
vu = new WeakMap(), Zl = new WeakMap(), B0 = new WeakMap(), L0 = new WeakMap(), O0 = new WeakMap(), U0 = new WeakMap(), q0 = new WeakMap(), lr = new WeakMap(), Ql = new WeakMap(), cr = new WeakMap(), tc = new WeakMap(), hr = new WeakMap(), ul = new WeakSet(), Uy = function(t) {
  var n, a, r;
  if ((n = g(this, L0)) != null && n.call(this))
    return;
  if (t.touches.length === 1) {
    if (g(this, lr))
      return;
    const o = S(this, lr, new AbortController()), l = AbortSignal.any([g(this, Ql), o.signal]), c = g(this, vu), h = {
      capture: !0,
      signal: l,
      passive: !1
    }, u = (f) => {
      var d;
      f.pointerType === "touch" && ((d = g(this, lr)) == null || d.abort(), S(this, lr, null));
    };
    c.addEventListener("pointerdown", (f) => {
      f.pointerType === "touch" && (Ze(f), u(f));
    }, h), c.addEventListener("pointerup", u, h), c.addEventListener("pointercancel", u, h);
    return;
  }
  if (!g(this, hr)) {
    S(this, hr, new AbortController());
    const o = AbortSignal.any([g(this, Ql), g(this, hr).signal]), l = g(this, vu), c = {
      signal: o,
      capture: !1,
      passive: !1
    };
    l.addEventListener("touchmove", C(this, ul, qy).bind(this), c);
    const h = C(this, ul, jy).bind(this);
    l.addEventListener("touchend", h, c), l.addEventListener("touchcancel", h, c), c.capture = !0, l.addEventListener("pointerdown", Ze, c), l.addEventListener("pointermove", Ze, c), l.addEventListener("pointercancel", Ze, c), l.addEventListener("pointerup", Ze, c), (a = g(this, O0)) == null || a.call(this);
  }
  if (Ze(t), t.touches.length !== 2 || (r = g(this, B0)) != null && r.call(this)) {
    S(this, cr, null);
    return;
  }
  let [e, i] = t.touches;
  e.identifier > i.identifier && ([e, i] = [i, e]), S(this, cr, {
    touch0X: e.screenX,
    touch0Y: e.screenY,
    touch1X: i.screenX,
    touch1Y: i.screenY
  });
}, qy = function(t) {
  var A;
  if (!g(this, cr) || t.touches.length !== 2)
    return;
  Ze(t);
  let [e, i] = t.touches;
  e.identifier > i.identifier && ([e, i] = [i, e]);
  const {
    screenX: n,
    screenY: a
  } = e, {
    screenX: r,
    screenY: o
  } = i, l = g(this, cr), {
    touch0X: c,
    touch0Y: h,
    touch1X: u,
    touch1Y: f
  } = l, d = u - c, p = f - h, m = r - n, b = o - a, y = Math.hypot(m, b) || 1, v = Math.hypot(d, p) || 1;
  if (!g(this, Zl) && Math.abs(v - y) <= s8.MIN_TOUCH_DISTANCE_TO_PINCH)
    return;
  if (l.touch0X = n, l.touch0Y = a, l.touch1X = r, l.touch1Y = o, !g(this, Zl)) {
    S(this, Zl, !0);
    return;
  }
  const w = [(n + r) / 2, (a + o) / 2];
  (A = g(this, U0)) == null || A.call(this, w, v, y);
}, jy = function(t) {
  var e;
  t.touches.length >= 2 || (g(this, hr) && (g(this, hr).abort(), S(this, hr, null), (e = g(this, q0)) == null || e.call(this)), g(this, cr) && (Ze(t), S(this, cr, null), S(this, Zl, !1)));
};
let Qd = s8;
var ec, Un, _e, Au, Co, j0, sc, Cs, ic, ur, Io, H0, nc, Bi, $0, ac, dr, Ca, xu, ku, hn, rc, z0, u9, Lt, A5, G0, x5, pg, Hy, $y, k5, mg, S5, zy, Gy, Vy, C5, Wy, I5, Xy, Ky, Yy, _5, dd;
const Yt = class Yt {
  constructor(t) {
    _(this, Lt);
    _(this, ec, null);
    _(this, Un, null);
    _(this, _e, null);
    _(this, Au, !1);
    _(this, Co, null);
    _(this, j0, "");
    _(this, sc, !1);
    _(this, Cs, null);
    _(this, ic, null);
    _(this, ur, null);
    _(this, Io, null);
    _(this, H0, "");
    _(this, nc, !1);
    _(this, Bi, null);
    _(this, $0, !1);
    _(this, ac, !1);
    _(this, dr, !1);
    _(this, Ca, null);
    _(this, xu, 0);
    _(this, ku, 0);
    _(this, hn, null);
    _(this, rc, null);
    ht(this, "isSelected", !1);
    ht(this, "_isCopy", !1);
    ht(this, "_editToolbar", null);
    ht(this, "_initialOptions", /* @__PURE__ */ Object.create(null));
    ht(this, "_initialData", null);
    ht(this, "_isVisible", !0);
    ht(this, "_uiManager", null);
    ht(this, "_focusEventsAllowed", !0);
    _(this, z0, !1);
    _(this, u9, Yt._zIndex++);
    this.parent = t.parent, this.id = t.id, this.width = this.height = null, this.pageIndex = t.parent.pageIndex, this.name = t.name, this.div = null, this._uiManager = t.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = t.isCentered, this._structTreeParentId = null;
    const {
      rotation: e,
      rawDims: {
        pageWidth: i,
        pageHeight: n,
        pageX: a,
        pageY: r
      }
    } = this.parent.viewport;
    this.rotation = e, this.pageRotation = (360 + e - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [i, n], this.pageTranslation = [a, r];
    const [o, l] = this.parentDimensions;
    this.x = t.x / o, this.y = t.y / l, this.isAttachedToDOM = !1, this.deleted = !1;
  }
  static get _resizerKeyboardManager() {
    const t = Yt.prototype._resizeWithKeyboard, e = ol.TRANSLATE_SMALL, i = ol.TRANSLATE_BIG;
    return ne(this, "_resizerKeyboardManager", new y2([[["ArrowLeft", "mac+ArrowLeft"], t, {
      args: [-e, 0]
    }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t, {
      args: [-i, 0]
    }], [["ArrowRight", "mac+ArrowRight"], t, {
      args: [e, 0]
    }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], t, {
      args: [i, 0]
    }], [["ArrowUp", "mac+ArrowUp"], t, {
      args: [0, -e]
    }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], t, {
      args: [0, -i]
    }], [["ArrowDown", "mac+ArrowDown"], t, {
      args: [0, e]
    }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], t, {
      args: [0, i]
    }], [["Escape", "mac+Escape"], Yt.prototype._stopResizingWithKeyboard]]));
  }
  get editorType() {
    return Object.getPrototypeOf(this).constructor._type;
  }
  static get isDrawer() {
    return !1;
  }
  static get _defaultLineColor() {
    return ne(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
  }
  static deleteAnnotationElement(t) {
    const e = new Wk({
      id: t.parent.getNextId(),
      parent: t.parent,
      uiManager: t._uiManager
    });
    e.annotationElementId = t.annotationElementId, e.deleted = !0, e._uiManager.addToAnnotationStorage(e);
  }
  static initialize(t, e) {
    if (Yt._l10n ?? (Yt._l10n = t), Yt._l10nResizer || (Yt._l10nResizer = Object.freeze({
      topLeft: "pdfjs-editor-resizer-top-left",
      topMiddle: "pdfjs-editor-resizer-top-middle",
      topRight: "pdfjs-editor-resizer-top-right",
      middleRight: "pdfjs-editor-resizer-middle-right",
      bottomRight: "pdfjs-editor-resizer-bottom-right",
      bottomMiddle: "pdfjs-editor-resizer-bottom-middle",
      bottomLeft: "pdfjs-editor-resizer-bottom-left",
      middleLeft: "pdfjs-editor-resizer-middle-left"
    })), Yt._borderLineWidth !== -1)
      return;
    const i = getComputedStyle(document.documentElement);
    Yt._borderLineWidth = parseFloat(i.getPropertyValue("--outline-width")) || 0;
  }
  static updateDefaultParams(t, e) {
  }
  static get defaultPropertiesToUpdate() {
    return [];
  }
  static isHandlingMimeForPasting(t) {
    return !1;
  }
  static paste(t, e) {
    Ae("Not implemented");
  }
  get propertiesToUpdate() {
    return [];
  }
  get _isDraggable() {
    return g(this, z0);
  }
  set _isDraggable(t) {
    var e;
    S(this, z0, t), (e = this.div) == null || e.classList.toggle("draggable", t);
  }
  get isEnterHandled() {
    return !0;
  }
  center() {
    const [t, e] = this.pageDimensions;
    switch (this.parentRotation) {
      case 90:
        this.x -= this.height * e / (t * 2), this.y += this.width * t / (e * 2);
        break;
      case 180:
        this.x += this.width / 2, this.y += this.height / 2;
        break;
      case 270:
        this.x += this.height * e / (t * 2), this.y -= this.width * t / (e * 2);
        break;
      default:
        this.x -= this.width / 2, this.y -= this.height / 2;
        break;
    }
    this.fixAndSetPosition();
  }
  addCommands(t) {
    this._uiManager.addCommands(t);
  }
  get currentLayer() {
    return this._uiManager.currentLayer;
  }
  setInBackground() {
    this.div.style.zIndex = 0;
  }
  setInForeground() {
    this.div.style.zIndex = g(this, u9);
  }
  setParent(t) {
    t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : C(this, Lt, dd).call(this), this.parent = t;
  }
  focusin(t) {
    this._focusEventsAllowed && (g(this, nc) ? S(this, nc, !1) : this.parent.setSelected(this));
  }
  focusout(t) {
    var i;
    if (!this._focusEventsAllowed || !this.isAttachedToDOM)
      return;
    const e = t.relatedTarget;
    e != null && e.closest(`#${this.id}`) || (t.preventDefault(), (i = this.parent) != null && i.isMultipleSelection || this.commitOrRemove());
  }
  commitOrRemove() {
    this.isEmpty() ? this.remove() : this.commit();
  }
  commit() {
    this.addToAnnotationStorage();
  }
  addToAnnotationStorage() {
    this._uiManager.addToAnnotationStorage(this);
  }
  setAt(t, e, i, n) {
    const [a, r] = this.parentDimensions;
    [i, n] = this.screenToPageTranslation(i, n), this.x = (t + i) / a, this.y = (e + n) / r, this.fixAndSetPosition();
  }
  _moveAfterPaste(t, e) {
    const [i, n] = this.parentDimensions;
    this.setAt(t * i, e * n, this.width * i, this.height * n), this._onTranslated();
  }
  translate(t, e) {
    C(this, Lt, A5).call(this, this.parentDimensions, t, e);
  }
  translateInPage(t, e) {
    g(this, Bi) || S(this, Bi, [this.x, this.y, this.width, this.height]), C(this, Lt, A5).call(this, this.pageDimensions, t, e), this.div.scrollIntoView({
      block: "nearest"
    });
  }
  translationDone() {
    this._onTranslated(this.x, this.y);
  }
  drag(t, e) {
    g(this, Bi) || S(this, Bi, [this.x, this.y, this.width, this.height]);
    const {
      div: i,
      parentDimensions: [n, a]
    } = this;
    if (this.x += t / n, this.y += e / a, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
      const {
        x: u,
        y: f
      } = this.div.getBoundingClientRect();
      this.parent.findNewParent(this, u, f) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
    }
    let {
      x: r,
      y: o
    } = this;
    const [l, c] = this.getBaseTranslation();
    r += l, o += c;
    const {
      style: h
    } = i;
    h.left = `${(100 * r).toFixed(2)}%`, h.top = `${(100 * o).toFixed(2)}%`, this._onTranslating(r, o), i.scrollIntoView({
      block: "nearest"
    });
  }
  _onTranslating(t, e) {
  }
  _onTranslated(t, e) {
  }
  get _hasBeenMoved() {
    return !!g(this, Bi) && (g(this, Bi)[0] !== this.x || g(this, Bi)[1] !== this.y);
  }
  get _hasBeenResized() {
    return !!g(this, Bi) && (g(this, Bi)[2] !== this.width || g(this, Bi)[3] !== this.height);
  }
  getBaseTranslation() {
    const [t, e] = this.parentDimensions, {
      _borderLineWidth: i
    } = Yt, n = i / t, a = i / e;
    switch (this.rotation) {
      case 90:
        return [-n, a];
      case 180:
        return [n, a];
      case 270:
        return [n, -a];
      default:
        return [-n, -a];
    }
  }
  get _mustFixPosition() {
    return !0;
  }
  fixAndSetPosition(t = this.rotation) {
    const {
      div: {
        style: e
      },
      pageDimensions: [i, n]
    } = this;
    let {
      x: a,
      y: r,
      width: o,
      height: l
    } = this;
    if (o *= i, l *= n, a *= i, r *= n, this._mustFixPosition)
      switch (t) {
        case 0:
          a = Ws(a, 0, i - o), r = Ws(r, 0, n - l);
          break;
        case 90:
          a = Ws(a, 0, i - l), r = Ws(r, o, n);
          break;
        case 180:
          a = Ws(a, o, i), r = Ws(r, l, n);
          break;
        case 270:
          a = Ws(a, l, i), r = Ws(r, 0, n - o);
          break;
      }
    this.x = a /= i, this.y = r /= n;
    const [c, h] = this.getBaseTranslation();
    a += c, r += h, e.left = `${(100 * a).toFixed(2)}%`, e.top = `${(100 * r).toFixed(2)}%`, this.moveInDOM();
  }
  screenToPageTranslation(t, e) {
    var i;
    return C(i = Yt, G0, x5).call(i, t, e, this.parentRotation);
  }
  pageTranslationToScreen(t, e) {
    var i;
    return C(i = Yt, G0, x5).call(i, t, e, 360 - this.parentRotation);
  }
  get parentScale() {
    return this._uiManager.viewParameters.realScale;
  }
  get parentRotation() {
    return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
  }
  get parentDimensions() {
    const {
      parentScale: t,
      pageDimensions: [e, i]
    } = this;
    return [e * t, i * t];
  }
  setDims(t, e) {
    const [i, n] = this.parentDimensions, {
      style: a
    } = this.div;
    a.width = `${(100 * t / i).toFixed(2)}%`, g(this, sc) || (a.height = `${(100 * e / n).toFixed(2)}%`);
  }
  fixDims() {
    const {
      style: t
    } = this.div, {
      height: e,
      width: i
    } = t, n = i.endsWith("%"), a = !g(this, sc) && e.endsWith("%");
    if (n && a)
      return;
    const [r, o] = this.parentDimensions;
    n || (t.width = `${(100 * parseFloat(i) / r).toFixed(2)}%`), !g(this, sc) && !a && (t.height = `${(100 * parseFloat(e) / o).toFixed(2)}%`);
  }
  getInitialTranslation() {
    return [0, 0];
  }
  _onResized() {
  }
  static _round(t) {
    return Math.round(t * 1e4) / 1e4;
  }
  _onResizing() {
  }
  altTextFinish() {
    var t;
    (t = g(this, _e)) == null || t.finish();
  }
  async addEditToolbar() {
    return this._editToolbar || g(this, ac) ? this._editToolbar : (this._editToolbar = new d5(this), this.div.append(this._editToolbar.render()), g(this, _e) && await this._editToolbar.addAltText(g(this, _e)), this._editToolbar);
  }
  removeEditToolbar() {
    var t;
    this._editToolbar && (this._editToolbar.remove(), this._editToolbar = null, (t = g(this, _e)) == null || t.destroy());
  }
  addContainer(t) {
    var i;
    const e = (i = this._editToolbar) == null ? void 0 : i.div;
    e ? e.before(t) : this.div.append(t);
  }
  getClientDimensions() {
    return this.div.getBoundingClientRect();
  }
  async addAltTextButton() {
    g(this, _e) || (hp.initialize(Yt._l10n), S(this, _e, new hp(this)), g(this, ec) && (g(this, _e).data = g(this, ec), S(this, ec, null)), await this.addEditToolbar());
  }
  get altTextData() {
    var t;
    return (t = g(this, _e)) == null ? void 0 : t.data;
  }
  set altTextData(t) {
    g(this, _e) && (g(this, _e).data = t);
  }
  get guessedAltText() {
    var t;
    return (t = g(this, _e)) == null ? void 0 : t.guessedText;
  }
  async setGuessedAltText(t) {
    var e;
    await ((e = g(this, _e)) == null ? void 0 : e.setGuessedText(t));
  }
  serializeAltText(t) {
    var e;
    return (e = g(this, _e)) == null ? void 0 : e.serialize(t);
  }
  hasAltText() {
    return !!g(this, _e) && !g(this, _e).isEmpty();
  }
  hasAltTextData() {
    var t;
    return ((t = g(this, _e)) == null ? void 0 : t.hasData()) ?? !1;
  }
  render() {
    var r;
    const t = this.div = document.createElement("div");
    t.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), t.className = this.name, t.setAttribute("id", this.id), t.tabIndex = g(this, Au) ? -1 : 0, t.setAttribute("role", "application"), this.defaultL10nId && t.setAttribute("data-l10n-id", this.defaultL10nId), this._isVisible || t.classList.add("hidden"), this.setInForeground(), C(this, Lt, I5).call(this);
    const [e, i] = this.parentDimensions;
    this.parentRotation % 180 !== 0 && (t.style.maxWidth = `${(100 * i / e).toFixed(2)}%`, t.style.maxHeight = `${(100 * e / i).toFixed(2)}%`);
    const [n, a] = this.getInitialTranslation();
    return this.translate(n, a), _y(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (g(this, rc) || S(this, rc, new Qd({
      container: t,
      isPinchingDisabled: () => !this.isSelected,
      onPinchStart: C(this, Lt, zy).bind(this),
      onPinching: C(this, Lt, Gy).bind(this),
      onPinchEnd: C(this, Lt, Vy).bind(this),
      signal: this._uiManager._signal
    }))), (r = this._uiManager._editorUndoBar) == null || r.hide(), t;
  }
  pointerdown(t) {
    const {
      isMac: e
    } = ks.platform;
    if (t.button !== 0 || t.ctrlKey && e) {
      t.preventDefault();
      return;
    }
    if (S(this, nc, !0), this._isDraggable) {
      C(this, Lt, Wy).call(this, t);
      return;
    }
    C(this, Lt, C5).call(this, t);
  }
  _onStartDragging() {
  }
  _onStopDragging() {
  }
  moveInDOM() {
    g(this, Ca) && clearTimeout(g(this, Ca)), S(this, Ca, setTimeout(() => {
      var t;
      S(this, Ca, null), (t = this.parent) == null || t.moveEditorInDOM(this);
    }, 0));
  }
  _setParentAndPosition(t, e, i) {
    t.changeParent(this), this.x = e, this.y = i, this.fixAndSetPosition(), this._onTranslated();
  }
  getRect(t, e, i = this.rotation) {
    const n = this.parentScale, [a, r] = this.pageDimensions, [o, l] = this.pageTranslation, c = t / n, h = e / n, u = this.x * a, f = this.y * r, d = this.width * a, p = this.height * r;
    switch (i) {
      case 0:
        return [u + c + o, r - f - h - p + l, u + c + d + o, r - f - h + l];
      case 90:
        return [u + h + o, r - f + c + l, u + h + p + o, r - f + c + d + l];
      case 180:
        return [u - c - d + o, r - f + h + l, u - c + o, r - f + h + p + l];
      case 270:
        return [u - h - p + o, r - f - c - d + l, u - h + o, r - f - c + l];
      default:
        throw new Error("Invalid rotation");
    }
  }
  getRectInCurrentCoords(t, e) {
    const [i, n, a, r] = t, o = a - i, l = r - n;
    switch (this.rotation) {
      case 0:
        return [i, e - r, o, l];
      case 90:
        return [i, e - n, l, o];
      case 180:
        return [a, e - n, o, l];
      case 270:
        return [a, e - r, l, o];
      default:
        throw new Error("Invalid rotation");
    }
  }
  onceAdded(t) {
  }
  isEmpty() {
    return !1;
  }
  enableEditMode() {
    return this.isInEditMode() ? !1 : (this.parent.setEditingState(!1), S(this, ac, !0), !0);
  }
  disableEditMode() {
    return this.isInEditMode() ? (this.parent.setEditingState(!0), S(this, ac, !1), !0) : !1;
  }
  isInEditMode() {
    return g(this, ac);
  }
  shouldGetKeyboardEvents() {
    return g(this, dr);
  }
  needsToBeRebuilt() {
    return this.div && !this.isAttachedToDOM;
  }
  get isOnScreen() {
    const {
      top: t,
      left: e,
      bottom: i,
      right: n
    } = this.getClientDimensions(), {
      innerHeight: a,
      innerWidth: r
    } = window;
    return e < r && n > 0 && t < a && i > 0;
  }
  rebuild() {
    C(this, Lt, I5).call(this);
  }
  rotate(t) {
  }
  resize() {
  }
  serializeDeleted() {
    var t;
    return {
      id: this.annotationElementId,
      deleted: !0,
      pageIndex: this.pageIndex,
      popupRef: ((t = this._initialData) == null ? void 0 : t.popupRef) || ""
    };
  }
  serialize(t = !1, e = null) {
    Ae("An editor must be serializable");
  }
  static async deserialize(t, e, i) {
    const n = new this.prototype.constructor({
      parent: e,
      id: e.getNextId(),
      uiManager: i
    });
    n.rotation = t.rotation, S(n, ec, t.accessibilityData), n._isCopy = t.isCopy || !1;
    const [a, r] = n.pageDimensions, [o, l, c, h] = n.getRectInCurrentCoords(t.rect, r);
    return n.x = o / a, n.y = l / r, n.width = c / a, n.height = h / r, n;
  }
  get hasBeenModified() {
    return !!this.annotationElementId && (this.deleted || this.serialize() !== null);
  }
  remove() {
    var t, e;
    if ((t = g(this, Io)) == null || t.abort(), S(this, Io, null), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), g(this, Ca) && (clearTimeout(g(this, Ca)), S(this, Ca, null)), C(this, Lt, dd).call(this), this.removeEditToolbar(), g(this, hn)) {
      for (const i of g(this, hn).values())
        clearTimeout(i);
      S(this, hn, null);
    }
    this.parent = null, (e = g(this, rc)) == null || e.destroy(), S(this, rc, null);
  }
  get isResizable() {
    return !1;
  }
  makeResizable() {
    this.isResizable && (C(this, Lt, Hy).call(this), g(this, Cs).classList.remove("hidden"));
  }
  get toolbarPosition() {
    return null;
  }
  keydown(t) {
    if (!this.isResizable || t.target !== this.div || t.key !== "Enter")
      return;
    this._uiManager.setSelected(this), S(this, ur, {
      savedX: this.x,
      savedY: this.y,
      savedWidth: this.width,
      savedHeight: this.height
    });
    const e = g(this, Cs).children;
    if (!g(this, Un)) {
      S(this, Un, Array.from(e));
      const r = C(this, Lt, Xy).bind(this), o = C(this, Lt, Ky).bind(this), l = this._uiManager._signal;
      for (const c of g(this, Un)) {
        const h = c.getAttribute("data-resizer-name");
        c.setAttribute("role", "spinbutton"), c.addEventListener("keydown", r, {
          signal: l
        }), c.addEventListener("blur", o, {
          signal: l
        }), c.addEventListener("focus", C(this, Lt, Yy).bind(this, h), {
          signal: l
        }), c.setAttribute("data-l10n-id", Yt._l10nResizer[h]);
      }
    }
    const i = g(this, Un)[0];
    let n = 0;
    for (const r of e) {
      if (r === i)
        break;
      n++;
    }
    const a = (360 - this.rotation + this.parentRotation) % 360 / 90 * (g(this, Un).length / 4);
    if (a !== n) {
      if (a < n)
        for (let o = 0; o < n - a; o++)
          g(this, Cs).append(g(this, Cs).firstChild);
      else if (a > n)
        for (let o = 0; o < a - n; o++)
          g(this, Cs).firstChild.before(g(this, Cs).lastChild);
      let r = 0;
      for (const o of e) {
        const c = g(this, Un)[r++].getAttribute("data-resizer-name");
        o.setAttribute("data-l10n-id", Yt._l10nResizer[c]);
      }
    }
    C(this, Lt, _5).call(this, 0), S(this, dr, !0), g(this, Cs).firstChild.focus({
      focusVisible: !0
    }), t.preventDefault(), t.stopImmediatePropagation();
  }
  _resizeWithKeyboard(t, e) {
    g(this, dr) && C(this, Lt, S5).call(this, g(this, H0), {
      deltaX: t,
      deltaY: e,
      fromKeyboard: !0
    });
  }
  _stopResizingWithKeyboard() {
    C(this, Lt, dd).call(this), this.div.focus();
  }
  select() {
    var t, e, i;
    if (!(this.isSelected && this._editToolbar)) {
      if (this.isSelected = !0, this.makeResizable(), (t = this.div) == null || t.classList.add("selectedEditor"), !this._editToolbar) {
        this.addEditToolbar().then(() => {
          var n, a;
          (n = this.div) != null && n.classList.contains("selectedEditor") && ((a = this._editToolbar) == null || a.show());
        });
        return;
      }
      (e = this._editToolbar) == null || e.show(), (i = g(this, _e)) == null || i.toggleAltTextBadge(!1);
    }
  }
  unselect() {
    var t, e, i, n, a;
    this.isSelected && (this.isSelected = !1, (t = g(this, Cs)) == null || t.classList.add("hidden"), (e = this.div) == null || e.classList.remove("selectedEditor"), (i = this.div) != null && i.contains(document.activeElement) && this._uiManager.currentLayer.div.focus({
      preventScroll: !0
    }), (n = this._editToolbar) == null || n.hide(), (a = g(this, _e)) == null || a.toggleAltTextBadge(!0));
  }
  updateParams(t, e) {
  }
  disableEditing() {
  }
  enableEditing() {
  }
  get canChangeContent() {
    return !1;
  }
  enterInEditMode() {
    this.canChangeContent && (this.enableEditMode(), this.div.focus());
  }
  dblclick(t) {
    this.enterInEditMode(), this.parent.updateToolbar({
      mode: this.constructor._editorType,
      editId: this.id
    });
  }
  getElementForAltText() {
    return this.div;
  }
  get contentDiv() {
    return this.div;
  }
  get isEditing() {
    return g(this, $0);
  }
  set isEditing(t) {
    S(this, $0, t), this.parent && (t ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
  }
  setAspectRatio(t, e) {
    S(this, sc, !0);
    const i = t / e, {
      style: n
    } = this.div;
    n.aspectRatio = i, n.height = "auto";
  }
  static get MIN_SIZE() {
    return 16;
  }
  static canCreateNewEmptyEditor() {
    return !0;
  }
  get telemetryInitialData() {
    return {
      action: "added"
    };
  }
  get telemetryFinalData() {
    return null;
  }
  _reportTelemetry(t, e = !1) {
    if (e) {
      g(this, hn) || S(this, hn, /* @__PURE__ */ new Map());
      const {
        action: i
      } = t;
      let n = g(this, hn).get(i);
      n && clearTimeout(n), n = setTimeout(() => {
        this._reportTelemetry(t), g(this, hn).delete(i), g(this, hn).size === 0 && S(this, hn, null);
      }, Yt._telemetryTimeout), g(this, hn).set(i, n);
      return;
    }
    t.type || (t.type = this.editorType), this._uiManager._eventBus.dispatch("reporttelemetry", {
      source: this,
      details: {
        type: "editing",
        data: t
      }
    });
  }
  show(t = this._isVisible) {
    this.div.classList.toggle("hidden", !t), this._isVisible = t;
  }
  enable() {
    this.div && (this.div.tabIndex = 0), S(this, Au, !1);
  }
  disable() {
    this.div && (this.div.tabIndex = -1), S(this, Au, !0);
  }
  renderAnnotationElement(t) {
    let e = t.container.querySelector(".annotationContent");
    if (!e)
      e = document.createElement("div"), e.classList.add("annotationContent", this.editorType), t.container.prepend(e);
    else if (e.nodeName === "CANVAS") {
      const i = e;
      e = document.createElement("div"), e.classList.add("annotationContent", this.editorType), i.before(e);
    }
    return e;
  }
  resetAnnotationElement(t) {
    const {
      firstChild: e
    } = t.container;
    (e == null ? void 0 : e.nodeName) === "DIV" && e.classList.contains("annotationContent") && e.remove();
  }
};
ec = new WeakMap(), Un = new WeakMap(), _e = new WeakMap(), Au = new WeakMap(), Co = new WeakMap(), j0 = new WeakMap(), sc = new WeakMap(), Cs = new WeakMap(), ic = new WeakMap(), ur = new WeakMap(), Io = new WeakMap(), H0 = new WeakMap(), nc = new WeakMap(), Bi = new WeakMap(), $0 = new WeakMap(), ac = new WeakMap(), dr = new WeakMap(), Ca = new WeakMap(), xu = new WeakMap(), ku = new WeakMap(), hn = new WeakMap(), rc = new WeakMap(), z0 = new WeakMap(), u9 = new WeakMap(), Lt = new WeakSet(), A5 = function([t, e], i, n) {
  [i, n] = this.screenToPageTranslation(i, n), this.x += i / t, this.y += n / e, this._onTranslating(this.x, this.y), this.fixAndSetPosition();
}, G0 = new WeakSet(), x5 = function(t, e, i) {
  switch (i) {
    case 90:
      return [e, -t];
    case 180:
      return [-t, -e];
    case 270:
      return [-e, t];
    default:
      return [t, e];
  }
}, pg = function(t) {
  switch (t) {
    case 90: {
      const [e, i] = this.pageDimensions;
      return [0, -e / i, i / e, 0];
    }
    case 180:
      return [-1, 0, 0, -1];
    case 270: {
      const [e, i] = this.pageDimensions;
      return [0, e / i, -i / e, 0];
    }
    default:
      return [1, 0, 0, 1];
  }
}, Hy = function() {
  if (g(this, Cs))
    return;
  S(this, Cs, document.createElement("div")), g(this, Cs).classList.add("resizers");
  const t = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"], e = this._uiManager._signal;
  for (const i of t) {
    const n = document.createElement("div");
    g(this, Cs).append(n), n.classList.add("resizer", i), n.setAttribute("data-resizer-name", i), n.addEventListener("pointerdown", C(this, Lt, $y).bind(this, i), {
      signal: e
    }), n.addEventListener("contextmenu", En, {
      signal: e
    }), n.tabIndex = -1;
  }
  this.div.prepend(g(this, Cs));
}, $y = function(t, e) {
  var h;
  e.preventDefault();
  const {
    isMac: i
  } = ks.platform;
  if (e.button !== 0 || e.ctrlKey && i)
    return;
  (h = g(this, _e)) == null || h.toggle(!1);
  const n = this._isDraggable;
  this._isDraggable = !1, S(this, ic, [e.screenX, e.screenY]);
  const a = new AbortController(), r = this._uiManager.combinedSignal(a);
  this.parent.togglePointerEvents(!1), window.addEventListener("pointermove", C(this, Lt, S5).bind(this, t), {
    passive: !0,
    capture: !0,
    signal: r
  }), window.addEventListener("touchmove", Ze, {
    passive: !1,
    signal: r
  }), window.addEventListener("contextmenu", En, {
    signal: r
  }), S(this, ur, {
    savedX: this.x,
    savedY: this.y,
    savedWidth: this.width,
    savedHeight: this.height
  });
  const o = this.parent.div.style.cursor, l = this.div.style.cursor;
  this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(e.target).cursor;
  const c = () => {
    var u;
    a.abort(), this.parent.togglePointerEvents(!0), (u = g(this, _e)) == null || u.toggle(!0), this._isDraggable = n, this.parent.div.style.cursor = o, this.div.style.cursor = l, C(this, Lt, mg).call(this);
  };
  window.addEventListener("pointerup", c, {
    signal: r
  }), window.addEventListener("blur", c, {
    signal: r
  });
}, k5 = function(t, e, i, n) {
  this.width = i, this.height = n, this.x = t, this.y = e;
  const [a, r] = this.parentDimensions;
  this.setDims(a * i, r * n), this.fixAndSetPosition(), this._onResized();
}, mg = function() {
  if (!g(this, ur))
    return;
  const {
    savedX: t,
    savedY: e,
    savedWidth: i,
    savedHeight: n
  } = g(this, ur);
  S(this, ur, null);
  const a = this.x, r = this.y, o = this.width, l = this.height;
  a === t && r === e && o === i && l === n || this.addCommands({
    cmd: C(this, Lt, k5).bind(this, a, r, o, l),
    undo: C(this, Lt, k5).bind(this, t, e, i, n),
    mustExec: !0
  });
}, S5 = function(t, e) {
  const [i, n] = this.parentDimensions, a = this.x, r = this.y, o = this.width, l = this.height, c = Yt.MIN_SIZE / i, h = Yt.MIN_SIZE / n, u = C(this, Lt, pg).call(this, this.rotation), f = (H, P) => [u[0] * H + u[2] * P, u[1] * H + u[3] * P], d = C(this, Lt, pg).call(this, 360 - this.rotation), p = (H, P) => [d[0] * H + d[2] * P, d[1] * H + d[3] * P];
  let m, b, y = !1, v = !1;
  switch (t) {
    case "topLeft":
      y = !0, m = (H, P) => [0, 0], b = (H, P) => [H, P];
      break;
    case "topMiddle":
      m = (H, P) => [H / 2, 0], b = (H, P) => [H / 2, P];
      break;
    case "topRight":
      y = !0, m = (H, P) => [H, 0], b = (H, P) => [0, P];
      break;
    case "middleRight":
      v = !0, m = (H, P) => [H, P / 2], b = (H, P) => [0, P / 2];
      break;
    case "bottomRight":
      y = !0, m = (H, P) => [H, P], b = (H, P) => [0, 0];
      break;
    case "bottomMiddle":
      m = (H, P) => [H / 2, P], b = (H, P) => [H / 2, 0];
      break;
    case "bottomLeft":
      y = !0, m = (H, P) => [0, P], b = (H, P) => [H, 0];
      break;
    case "middleLeft":
      v = !0, m = (H, P) => [0, P / 2], b = (H, P) => [H, P / 2];
      break;
  }
  const w = m(o, l), A = b(o, l);
  let x = f(...A);
  const k = Yt._round(a + x[0]), I = Yt._round(r + x[1]);
  let T = 1, E = 1, M, F;
  if (e.fromKeyboard)
    ({
      deltaX: M,
      deltaY: F
    } = e);
  else {
    const {
      screenX: H,
      screenY: P
    } = e, [G, N] = g(this, ic);
    [M, F] = this.screenToPageTranslation(H - G, P - N), g(this, ic)[0] = H, g(this, ic)[1] = P;
  }
  if ([M, F] = p(M / i, F / n), y) {
    const H = Math.hypot(o, l);
    T = E = Math.max(Math.min(Math.hypot(A[0] - w[0] - M, A[1] - w[1] - F) / H, 1 / o, 1 / l), c / o, h / l);
  } else v ? T = Ws(Math.abs(A[0] - w[0] - M), c, 1) / o : E = Ws(Math.abs(A[1] - w[1] - F), h, 1) / l;
  const L = Yt._round(o * T), Y = Yt._round(l * E);
  x = f(...b(L, Y));
  const B = k - x[0], et = I - x[1];
  g(this, Bi) || S(this, Bi, [this.x, this.y, this.width, this.height]), this.width = L, this.height = Y, this.x = B, this.y = et, this.setDims(i * L, n * Y), this.fixAndSetPosition(), this._onResizing();
}, zy = function() {
  var t;
  S(this, ur, {
    savedX: this.x,
    savedY: this.y,
    savedWidth: this.width,
    savedHeight: this.height
  }), (t = g(this, _e)) == null || t.toggle(!1), this.parent.togglePointerEvents(!1);
}, Gy = function(t, e, i) {
  let a = 0.7 * (i / e) + 1 - 0.7;
  if (a === 1)
    return;
  const r = C(this, Lt, pg).call(this, this.rotation), o = (k, I) => [r[0] * k + r[2] * I, r[1] * k + r[3] * I], [l, c] = this.parentDimensions, h = this.x, u = this.y, f = this.width, d = this.height, p = Yt.MIN_SIZE / l, m = Yt.MIN_SIZE / c;
  a = Math.max(Math.min(a, 1 / f, 1 / d), p / f, m / d);
  const b = Yt._round(f * a), y = Yt._round(d * a);
  if (b === f && y === d)
    return;
  g(this, Bi) || S(this, Bi, [h, u, f, d]);
  const v = o(f / 2, d / 2), w = Yt._round(h + v[0]), A = Yt._round(u + v[1]), x = o(b / 2, y / 2);
  this.x = w - x[0], this.y = A - x[1], this.width = b, this.height = y, this.setDims(l * b, c * y), this.fixAndSetPosition(), this._onResizing();
}, Vy = function() {
  var t;
  (t = g(this, _e)) == null || t.toggle(!0), this.parent.togglePointerEvents(!0), C(this, Lt, mg).call(this);
}, C5 = function(t) {
  const {
    isMac: e
  } = ks.platform;
  t.ctrlKey && !e || t.shiftKey || t.metaKey && e ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
}, Wy = function(t) {
  const {
    isSelected: e
  } = this;
  this._uiManager.setUpDragSession();
  let i = !1;
  const n = new AbortController(), a = this._uiManager.combinedSignal(n), r = {
    capture: !0,
    passive: !1,
    signal: a
  }, o = (c) => {
    n.abort(), S(this, Co, null), S(this, nc, !1), this._uiManager.endDragSession() || C(this, Lt, C5).call(this, c), i && this._onStopDragging();
  };
  e && (S(this, xu, t.clientX), S(this, ku, t.clientY), S(this, Co, t.pointerId), S(this, j0, t.pointerType), window.addEventListener("pointermove", (c) => {
    i || (i = !0, this._onStartDragging());
    const {
      clientX: h,
      clientY: u,
      pointerId: f
    } = c;
    if (f !== g(this, Co)) {
      Ze(c);
      return;
    }
    const [d, p] = this.screenToPageTranslation(h - g(this, xu), u - g(this, ku));
    S(this, xu, h), S(this, ku, u), this._uiManager.dragSelectedEditors(d, p);
  }, r), window.addEventListener("touchmove", Ze, r), window.addEventListener("pointerdown", (c) => {
    c.pointerType === g(this, j0) && (g(this, rc) || c.isPrimary) && o(c), Ze(c);
  }, r));
  const l = (c) => {
    if (!g(this, Co) || g(this, Co) === c.pointerId) {
      o(c);
      return;
    }
    Ze(c);
  };
  window.addEventListener("pointerup", l, {
    signal: a
  }), window.addEventListener("blur", l, {
    signal: a
  });
}, I5 = function() {
  if (g(this, Io) || !this.div)
    return;
  S(this, Io, new AbortController());
  const t = this._uiManager.combinedSignal(g(this, Io));
  this.div.addEventListener("focusin", this.focusin.bind(this), {
    signal: t
  }), this.div.addEventListener("focusout", this.focusout.bind(this), {
    signal: t
  });
}, Xy = function(t) {
  Yt._resizerKeyboardManager.exec(this, t);
}, Ky = function(t) {
  var e;
  g(this, dr) && ((e = t.relatedTarget) == null ? void 0 : e.parentNode) !== g(this, Cs) && C(this, Lt, dd).call(this);
}, Yy = function(t) {
  S(this, H0, g(this, dr) ? t : "");
}, _5 = function(t) {
  if (g(this, Un))
    for (const e of g(this, Un))
      e.tabIndex = t;
}, dd = function() {
  S(this, dr, !1), C(this, Lt, _5).call(this, -1), C(this, Lt, mg).call(this);
}, _(Yt, G0), ht(Yt, "_l10n", null), ht(Yt, "_l10nResizer", null), ht(Yt, "_borderLineWidth", -1), ht(Yt, "_colorManager", new g5()), ht(Yt, "_zIndex", 1), ht(Yt, "_telemetryTimeout", 1e3);
let Ie = Yt;
class Wk extends Ie {
  constructor(t) {
    super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
  }
  serialize() {
    return this.serializeDeleted();
  }
}
const m8 = 3285377520, nn = 4294901760, da = 65535;
let Jy = class {
  constructor(t) {
    this.h1 = t ? t & 4294967295 : m8, this.h2 = t ? t & 4294967295 : m8;
  }
  update(t) {
    let e, i;
    if (typeof t == "string") {
      e = new Uint8Array(t.length * 2), i = 0;
      for (let m = 0, b = t.length; m < b; m++) {
        const y = t.charCodeAt(m);
        y <= 255 ? e[i++] = y : (e[i++] = y >>> 8, e[i++] = y & 255);
      }
    } else if (ArrayBuffer.isView(t))
      e = t.slice(), i = e.byteLength;
    else
      throw new Error("Invalid data format, must be a string or TypedArray.");
    const n = i >> 2, a = i - n * 4, r = new Uint32Array(e.buffer, 0, n);
    let o = 0, l = 0, c = this.h1, h = this.h2;
    const u = 3432918353, f = 461845907, d = u & da, p = f & da;
    for (let m = 0; m < n; m++)
      m & 1 ? (o = r[m], o = o * u & nn | o * d & da, o = o << 15 | o >>> 17, o = o * f & nn | o * p & da, c ^= o, c = c << 13 | c >>> 19, c = c * 5 + 3864292196) : (l = r[m], l = l * u & nn | l * d & da, l = l << 15 | l >>> 17, l = l * f & nn | l * p & da, h ^= l, h = h << 13 | h >>> 19, h = h * 5 + 3864292196);
    switch (o = 0, a) {
      case 3:
        o ^= e[n * 4 + 2] << 16;
      case 2:
        o ^= e[n * 4 + 1] << 8;
      case 1:
        o ^= e[n * 4], o = o * u & nn | o * d & da, o = o << 15 | o >>> 17, o = o * f & nn | o * p & da, n & 1 ? c ^= o : h ^= o;
    }
    this.h1 = c, this.h2 = h;
  }
  hexdigest() {
    let t = this.h1, e = this.h2;
    return t ^= e >>> 1, t = t * 3981806797 & nn | t * 36045 & da, e = e * 4283543511 & nn | ((e << 16 | t >>> 16) * 2950163797 & nn) >>> 16, t ^= e >>> 1, t = t * 444984403 & nn | t * 60499 & da, e = e * 3301882366 & nn | ((e << 16 | t >>> 16) * 3120437893 & nn) >>> 16, t ^= e >>> 1, (t >>> 0).toString(16).padStart(8, "0") + (e >>> 0).toString(16).padStart(8, "0");
  }
};
const T5 = Object.freeze({
  map: null,
  hash: "",
  transfer: void 0
});
var oc, lc, Is, d9, Zy;
class Q6 {
  constructor() {
    _(this, d9);
    _(this, oc, !1);
    _(this, lc, null);
    _(this, Is, /* @__PURE__ */ new Map());
    this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
  }
  getValue(t, e) {
    const i = g(this, Is).get(t);
    return i === void 0 ? e : Object.assign(e, i);
  }
  getRawValue(t) {
    return g(this, Is).get(t);
  }
  remove(t) {
    if (g(this, Is).delete(t), g(this, Is).size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
      for (const e of g(this, Is).values())
        if (e instanceof Ie)
          return;
      this.onAnnotationEditor(null);
    }
  }
  setValue(t, e) {
    const i = g(this, Is).get(t);
    let n = !1;
    if (i !== void 0)
      for (const [a, r] of Object.entries(e))
        i[a] !== r && (n = !0, i[a] = r);
    else
      n = !0, g(this, Is).set(t, e);
    n && C(this, d9, Zy).call(this), e instanceof Ie && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(e.constructor._type);
  }
  has(t) {
    return g(this, Is).has(t);
  }
  get size() {
    return g(this, Is).size;
  }
  resetModified() {
    g(this, oc) && (S(this, oc, !1), typeof this.onResetModified == "function" && this.onResetModified());
  }
  get print() {
    return new Qy(this);
  }
  get serializable() {
    if (g(this, Is).size === 0)
      return T5;
    const t = /* @__PURE__ */ new Map(), e = new Jy(), i = [], n = /* @__PURE__ */ Object.create(null);
    let a = !1;
    for (const [r, o] of g(this, Is)) {
      const l = o instanceof Ie ? o.serialize(!1, n) : o;
      l && (t.set(r, l), e.update(`${r}:${JSON.stringify(l)}`), a || (a = !!l.bitmap));
    }
    if (a)
      for (const r of t.values())
        r.bitmap && i.push(r.bitmap);
    return t.size > 0 ? {
      map: t,
      hash: e.hexdigest(),
      transfer: i
    } : T5;
  }
  get editorStats() {
    let t = null;
    const e = /* @__PURE__ */ new Map();
    for (const i of g(this, Is).values()) {
      if (!(i instanceof Ie))
        continue;
      const n = i.telemetryFinalData;
      if (!n)
        continue;
      const {
        type: a
      } = n;
      e.has(a) || e.set(a, Object.getPrototypeOf(i).constructor), t || (t = /* @__PURE__ */ Object.create(null));
      const r = t[a] || (t[a] = /* @__PURE__ */ new Map());
      for (const [o, l] of Object.entries(n)) {
        if (o === "type")
          continue;
        let c = r.get(o);
        c || (c = /* @__PURE__ */ new Map(), r.set(o, c));
        const h = c.get(l) ?? 0;
        c.set(l, h + 1);
      }
    }
    for (const [i, n] of e)
      t[i] = n.computeTelemetryFinalData(t[i]);
    return t;
  }
  resetModifiedIds() {
    S(this, lc, null);
  }
  get modifiedIds() {
    if (g(this, lc))
      return g(this, lc);
    const t = [];
    for (const e of g(this, Is).values())
      !(e instanceof Ie) || !e.annotationElementId || !e.serialize() || t.push(e.annotationElementId);
    return S(this, lc, {
      ids: new Set(t),
      hash: t.join(",")
    });
  }
  [Symbol.iterator]() {
    return g(this, Is).entries();
  }
}
oc = new WeakMap(), lc = new WeakMap(), Is = new WeakMap(), d9 = new WeakSet(), Zy = function() {
  g(this, oc) || (S(this, oc, !0), typeof this.onSetModified == "function" && this.onSetModified());
};
var V0;
class Qy extends Q6 {
  constructor(e) {
    super();
    _(this, V0);
    const {
      map: i,
      hash: n,
      transfer: a
    } = e.serializable, r = structuredClone(i, a ? {
      transfer: a
    } : null);
    S(this, V0, {
      map: r,
      hash: n,
      transfer: a
    });
  }
  get print() {
    Ae("Should not call PrintAnnotationStorage.print");
  }
  get serializable() {
    return g(this, V0);
  }
  get modifiedIds() {
    return ne(this, "modifiedIds", {
      ids: /* @__PURE__ */ new Set(),
      hash: ""
    });
  }
}
V0 = new WeakMap();
var Su;
class Xk {
  constructor({
    ownerDocument: t = globalThis.document,
    styleElement: e = null
  }) {
    _(this, Su, /* @__PURE__ */ new Set());
    this._document = t, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
  }
  addNativeFontFace(t) {
    this.nativeFontFaces.add(t), this._document.fonts.add(t);
  }
  removeNativeFontFace(t) {
    this.nativeFontFaces.delete(t), this._document.fonts.delete(t);
  }
  insertRule(t) {
    this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
    const e = this.styleElement.sheet;
    e.insertRule(t, e.cssRules.length);
  }
  clear() {
    for (const t of this.nativeFontFaces)
      this._document.fonts.delete(t);
    this.nativeFontFaces.clear(), g(this, Su).clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
  }
  async loadSystemFont({
    systemFontInfo: t,
    disableFontFace: e,
    _inspectFont: i
  }) {
    if (!(!t || g(this, Su).has(t.loadedName))) {
      if (is(!e, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
        const {
          loadedName: n,
          src: a,
          style: r
        } = t, o = new FontFace(n, a, r);
        this.addNativeFontFace(o);
        try {
          await o.load(), g(this, Su).add(n), i == null || i(t);
        } catch {
          zt(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(o);
        }
        return;
      }
      Ae("Not implemented: loadSystemFont without the Font Loading API.");
    }
  }
  async bind(t) {
    if (t.attached || t.missingFile && !t.systemFontInfo)
      return;
    if (t.attached = !0, t.systemFontInfo) {
      await this.loadSystemFont(t);
      return;
    }
    if (this.isFontLoadingAPISupported) {
      const i = t.createNativeFontFace();
      if (i) {
        this.addNativeFontFace(i);
        try {
          await i.loaded;
        } catch (n) {
          throw zt(`Failed to load font '${i.family}': '${n}'.`), t.disableFontFace = !0, n;
        }
      }
      return;
    }
    const e = t.createFontFaceRule();
    if (e) {
      if (this.insertRule(e), this.isSyncFontLoadingSupported)
        return;
      await new Promise((i) => {
        const n = this._queueLoadingCallback(i);
        this._prepareFontLoadEvent(t, n);
      });
    }
  }
  get isFontLoadingAPISupported() {
    var e;
    const t = !!((e = this._document) != null && e.fonts);
    return ne(this, "isFontLoadingAPISupported", t);
  }
  get isSyncFontLoadingSupported() {
    return ne(this, "isSyncFontLoadingSupported", oi || ks.platform.isFirefox);
  }
  _queueLoadingCallback(t) {
    function e() {
      for (is(!n.done, "completeRequest() cannot be called twice."), n.done = !0; i.length > 0 && i[0].done; ) {
        const a = i.shift();
        setTimeout(a.callback, 0);
      }
    }
    const {
      loadingRequests: i
    } = this, n = {
      done: !1,
      complete: e,
      callback: t
    };
    return i.push(n), n;
  }
  get _loadTestFont() {
    const t = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
    return ne(this, "_loadTestFont", t);
  }
  _prepareFontLoadEvent(t, e) {
    function i(A, x) {
      return A.charCodeAt(x) << 24 | A.charCodeAt(x + 1) << 16 | A.charCodeAt(x + 2) << 8 | A.charCodeAt(x + 3) & 255;
    }
    function n(A, x, k, I) {
      const T = A.substring(0, x), E = A.substring(x + k);
      return T + I + E;
    }
    let a, r;
    const o = this._document.createElement("canvas");
    o.width = 1, o.height = 1;
    const l = o.getContext("2d");
    let c = 0;
    function h(A, x) {
      if (++c > 30) {
        zt("Load test font never loaded."), x();
        return;
      }
      if (l.font = "30px " + A, l.fillText(".", 0, 20), l.getImageData(0, 0, 1, 1).data[3] > 0) {
        x();
        return;
      }
      setTimeout(h.bind(null, A, x));
    }
    const u = `lt${Date.now()}${this.loadTestFontId++}`;
    let f = this._loadTestFont;
    f = n(f, 976, u.length, u);
    const p = 16, m = 1482184792;
    let b = i(f, p);
    for (a = 0, r = u.length - 3; a < r; a += 4)
      b = b - m + i(u, a) | 0;
    a < u.length && (b = b - m + i(u + "XXX", a) | 0), f = n(f, p, 4, Bk(b));
    const y = `url(data:font/opentype;base64,${btoa(f)});`, v = `@font-face {font-family:"${u}";src:${y}}`;
    this.insertRule(v);
    const w = this._document.createElement("div");
    w.style.visibility = "hidden", w.style.width = w.style.height = "10px", w.style.position = "absolute", w.style.top = w.style.left = "0px";
    for (const A of [t.loadedName, u]) {
      const x = this._document.createElement("span");
      x.textContent = "Hi", x.style.fontFamily = A, w.append(x);
    }
    this._document.body.append(w), h(u, () => {
      w.remove(), e.complete();
    });
  }
}
Su = new WeakMap();
class Kk {
  constructor(t, e = null) {
    this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
    for (const i in t)
      this[i] = t[i];
    this._inspectFont = e;
  }
  createNativeFontFace() {
    var e;
    if (!this.data || this.disableFontFace)
      return null;
    let t;
    if (!this.cssFontInfo)
      t = new FontFace(this.loadedName, this.data, {});
    else {
      const i = {
        weight: this.cssFontInfo.fontWeight
      };
      this.cssFontInfo.italicAngle && (i.style = `oblique ${this.cssFontInfo.italicAngle}deg`), t = new FontFace(this.cssFontInfo.fontFamily, this.data, i);
    }
    return (e = this._inspectFont) == null || e.call(this, this), t;
  }
  createFontFaceRule() {
    var i;
    if (!this.data || this.disableFontFace)
      return null;
    const t = `url(data:${this.mimetype};base64,${my(this.data)});`;
    let e;
    if (!this.cssFontInfo)
      e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
    else {
      let n = `font-weight: ${this.cssFontInfo.fontWeight};`;
      this.cssFontInfo.italicAngle && (n += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), e = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${n}src:${t}}`;
    }
    return (i = this._inspectFont) == null || i.call(this, this, t), e;
  }
  getPathGenerator(t, e) {
    if (this.compiledGlyphs[e] !== void 0)
      return this.compiledGlyphs[e];
    const i = this.loadedName + "_path_" + e;
    let n;
    try {
      n = t.get(i);
    } catch (r) {
      zt(`getPathGenerator - ignoring character: "${r}".`);
    }
    const a = new Path2D(n || "");
    return this.fontExtraProperties || t.delete(i), this.compiledGlyphs[e] = a;
  }
}
function Yk(s) {
  if (s instanceof URL)
    return s.href;
  if (typeof s == "string") {
    if (oi)
      return s;
    const t = URL.parse(s, window.location);
    if (t)
      return t.href;
  }
  throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
}
function Jk(s) {
  if (oi && typeof Buffer < "u" && s instanceof Buffer)
    throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
  if (s instanceof Uint8Array && s.byteLength === s.buffer.byteLength)
    return s;
  if (typeof s == "string")
    return p2(s);
  if (s instanceof ArrayBuffer || ArrayBuffer.isView(s) || typeof s == "object" && !isNaN(s == null ? void 0 : s.length))
    return new Uint8Array(s);
  throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
}
function N2(s) {
  if (typeof s != "string")
    return null;
  if (s.endsWith("/"))
    return s;
  throw new Error(`Invalid factory url: "${s}" must include trailing slash.`);
}
const E5 = (s) => typeof s == "object" && Number.isInteger(s == null ? void 0 : s.num) && s.num >= 0 && Number.isInteger(s == null ? void 0 : s.gen) && s.gen >= 0, Zk = (s) => typeof s == "object" && typeof (s == null ? void 0 : s.name) == "string", tw = qk.bind(null, E5, Zk);
var fr, f9;
class Qk {
  constructor() {
    _(this, fr, /* @__PURE__ */ new Map());
    _(this, f9, Promise.resolve());
  }
  postMessage(t, e) {
    const i = {
      data: structuredClone(t, e ? {
        transfer: e
      } : null)
    };
    g(this, f9).then(() => {
      for (const [n] of g(this, fr))
        n.call(this, i);
    });
  }
  addEventListener(t, e, i = null) {
    let n = null;
    if ((i == null ? void 0 : i.signal) instanceof AbortSignal) {
      const {
        signal: a
      } = i;
      if (a.aborted) {
        zt("LoopbackPort - cannot use an `aborted` signal.");
        return;
      }
      const r = () => this.removeEventListener(t, e);
      n = () => a.removeEventListener("abort", r), a.addEventListener("abort", r);
    }
    g(this, fr).set(e, n);
  }
  removeEventListener(t, e) {
    const i = g(this, fr).get(e);
    i == null || i(), g(this, fr).delete(e);
  }
  terminate() {
    for (const [, t] of g(this, fr))
      t == null || t();
    g(this, fr).clear();
  }
}
fr = new WeakMap(), f9 = new WeakMap();
const B2 = {
  DATA: 1,
  ERROR: 2
}, ss = {
  CANCEL: 1,
  CANCEL_COMPLETE: 2,
  CLOSE: 3,
  ENQUEUE: 4,
  ERROR: 5,
  PULL: 6,
  PULL_COMPLETE: 7,
  START_COMPLETE: 8
};
function b8() {
}
function mi(s) {
  if (s instanceof Gr || s instanceof lp || s instanceof f8 || s instanceof Zd || s instanceof dm)
    return s;
  switch (s instanceof Error || typeof s == "object" && s !== null || Ae('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), s.name) {
    case "AbortException":
      return new Gr(s.message);
    case "InvalidPDFException":
      return new lp(s.message);
    case "PasswordException":
      return new f8(s.message, s.code);
    case "ResponseException":
      return new Zd(s.message, s.status, s.missing);
    case "UnknownErrorException":
      return new dm(s.message, s.details);
  }
  return new dm(s.message, s.toString());
}
var Cu, _n, ew, sw, iw, bg, hy;
let fd = (hy = class {
  constructor(t, e, i) {
    _(this, _n);
    _(this, Cu, new AbortController());
    this.sourceName = t, this.targetName = e, this.comObj = i, 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), i.addEventListener("message", C(this, _n, ew).bind(this), {
      signal: g(this, Cu).signal
    });
  }
  on(t, e) {
    const i = this.actionHandler;
    if (i[t])
      throw new Error(`There is already an actionName called "${t}"`);
    i[t] = e;
  }
  send(t, e, i) {
    this.comObj.postMessage({
      sourceName: this.sourceName,
      targetName: this.targetName,
      action: t,
      data: e
    }, i);
  }
  sendWithPromise(t, e, i) {
    const n = this.callbackId++, a = Promise.withResolvers();
    this.callbackCapabilities[n] = a;
    try {
      this.comObj.postMessage({
        sourceName: this.sourceName,
        targetName: this.targetName,
        action: t,
        callbackId: n,
        data: e
      }, i);
    } catch (r) {
      a.reject(r);
    }
    return a.promise;
  }
  sendWithStream(t, e, i, n) {
    const a = this.streamId++, r = this.sourceName, o = this.targetName, l = this.comObj;
    return new ReadableStream({
      start: (c) => {
        const h = Promise.withResolvers();
        return this.streamControllers[a] = {
          controller: c,
          startCall: h,
          pullCall: null,
          cancelCall: null,
          isClosed: !1
        }, l.postMessage({
          sourceName: r,
          targetName: o,
          action: t,
          streamId: a,
          data: e,
          desiredSize: c.desiredSize
        }, n), h.promise;
      },
      pull: (c) => {
        const h = Promise.withResolvers();
        return this.streamControllers[a].pullCall = h, l.postMessage({
          sourceName: r,
          targetName: o,
          stream: ss.PULL,
          streamId: a,
          desiredSize: c.desiredSize
        }), h.promise;
      },
      cancel: (c) => {
        is(c instanceof Error, "cancel must have a valid reason");
        const h = Promise.withResolvers();
        return this.streamControllers[a].cancelCall = h, this.streamControllers[a].isClosed = !0, l.postMessage({
          sourceName: r,
          targetName: o,
          stream: ss.CANCEL,
          streamId: a,
          reason: mi(c)
        }), h.promise;
      }
    }, i);
  }
  destroy() {
    var t;
    (t = g(this, Cu)) == null || t.abort(), S(this, Cu, null);
  }
}, Cu = new WeakMap(), _n = new WeakSet(), ew = function({
  data: t
}) {
  if (t.targetName !== this.sourceName)
    return;
  if (t.stream) {
    C(this, _n, iw).call(this, t);
    return;
  }
  if (t.callback) {
    const i = t.callbackId, n = this.callbackCapabilities[i];
    if (!n)
      throw new Error(`Cannot resolve callback ${i}`);
    if (delete this.callbackCapabilities[i], t.callback === B2.DATA)
      n.resolve(t.data);
    else if (t.callback === B2.ERROR)
      n.reject(mi(t.reason));
    else
      throw new Error("Unexpected callback case");
    return;
  }
  const e = this.actionHandler[t.action];
  if (!e)
    throw new Error(`Unknown action from worker: ${t.action}`);
  if (t.callbackId) {
    const i = this.sourceName, n = t.sourceName, a = this.comObj;
    Promise.try(e, t.data).then(function(r) {
      a.postMessage({
        sourceName: i,
        targetName: n,
        callback: B2.DATA,
        callbackId: t.callbackId,
        data: r
      });
    }, function(r) {
      a.postMessage({
        sourceName: i,
        targetName: n,
        callback: B2.ERROR,
        callbackId: t.callbackId,
        reason: mi(r)
      });
    });
    return;
  }
  if (t.streamId) {
    C(this, _n, sw).call(this, t);
    return;
  }
  e(t.data);
}, sw = function(t) {
  const e = t.streamId, i = this.sourceName, n = t.sourceName, a = this.comObj, r = this, o = this.actionHandler[t.action], l = {
    enqueue(c, h = 1, u) {
      if (this.isCancelled)
        return;
      const f = this.desiredSize;
      this.desiredSize -= h, f > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), a.postMessage({
        sourceName: i,
        targetName: n,
        stream: ss.ENQUEUE,
        streamId: e,
        chunk: c
      }, u);
    },
    close() {
      this.isCancelled || (this.isCancelled = !0, a.postMessage({
        sourceName: i,
        targetName: n,
        stream: ss.CLOSE,
        streamId: e
      }), delete r.streamSinks[e]);
    },
    error(c) {
      is(c instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, a.postMessage({
        sourceName: i,
        targetName: n,
        stream: ss.ERROR,
        streamId: e,
        reason: mi(c)
      }));
    },
    sinkCapability: Promise.withResolvers(),
    onPull: null,
    onCancel: null,
    isCancelled: !1,
    desiredSize: t.desiredSize,
    ready: null
  };
  l.sinkCapability.resolve(), l.ready = l.sinkCapability.promise, this.streamSinks[e] = l, Promise.try(o, t.data, l).then(function() {
    a.postMessage({
      sourceName: i,
      targetName: n,
      stream: ss.START_COMPLETE,
      streamId: e,
      success: !0
    });
  }, function(c) {
    a.postMessage({
      sourceName: i,
      targetName: n,
      stream: ss.START_COMPLETE,
      streamId: e,
      reason: mi(c)
    });
  });
}, iw = function(t) {
  const e = t.streamId, i = this.sourceName, n = t.sourceName, a = this.comObj, r = this.streamControllers[e], o = this.streamSinks[e];
  switch (t.stream) {
    case ss.START_COMPLETE:
      t.success ? r.startCall.resolve() : r.startCall.reject(mi(t.reason));
      break;
    case ss.PULL_COMPLETE:
      t.success ? r.pullCall.resolve() : r.pullCall.reject(mi(t.reason));
      break;
    case ss.PULL:
      if (!o) {
        a.postMessage({
          sourceName: i,
          targetName: n,
          stream: ss.PULL_COMPLETE,
          streamId: e,
          success: !0
        });
        break;
      }
      o.desiredSize <= 0 && t.desiredSize > 0 && o.sinkCapability.resolve(), o.desiredSize = t.desiredSize, Promise.try(o.onPull || b8).then(function() {
        a.postMessage({
          sourceName: i,
          targetName: n,
          stream: ss.PULL_COMPLETE,
          streamId: e,
          success: !0
        });
      }, function(c) {
        a.postMessage({
          sourceName: i,
          targetName: n,
          stream: ss.PULL_COMPLETE,
          streamId: e,
          reason: mi(c)
        });
      });
      break;
    case ss.ENQUEUE:
      if (is(r, "enqueue should have stream controller"), r.isClosed)
        break;
      r.controller.enqueue(t.chunk);
      break;
    case ss.CLOSE:
      if (is(r, "close should have stream controller"), r.isClosed)
        break;
      r.isClosed = !0, r.controller.close(), C(this, _n, bg).call(this, r, e);
      break;
    case ss.ERROR:
      is(r, "error should have stream controller"), r.controller.error(mi(t.reason)), C(this, _n, bg).call(this, r, e);
      break;
    case ss.CANCEL_COMPLETE:
      t.success ? r.cancelCall.resolve() : r.cancelCall.reject(mi(t.reason)), C(this, _n, bg).call(this, r, e);
      break;
    case ss.CANCEL:
      if (!o)
        break;
      const l = mi(t.reason);
      Promise.try(o.onCancel || b8, l).then(function() {
        a.postMessage({
          sourceName: i,
          targetName: n,
          stream: ss.CANCEL_COMPLETE,
          streamId: e,
          success: !0
        });
      }, function(c) {
        a.postMessage({
          sourceName: i,
          targetName: n,
          stream: ss.CANCEL_COMPLETE,
          streamId: e,
          reason: mi(c)
        });
      }), o.sinkCapability.reject(l), o.isCancelled = !0, delete this.streamSinks[e];
      break;
    default:
      throw new Error("Unexpected stream case");
  }
}, bg = async function(t, e) {
  var i, n, a;
  await Promise.allSettled([(i = t.startCall) == null ? void 0 : i.promise, (n = t.pullCall) == null ? void 0 : n.promise, (a = t.cancelCall) == null ? void 0 : a.promise]), delete this.streamControllers[e];
}, hy);
var W0;
class nw {
  constructor({
    enableHWA: t = !1
  }) {
    _(this, W0, !1);
    S(this, W0, t);
  }
  create(t, e) {
    if (t <= 0 || e <= 0)
      throw new Error("Invalid canvas size");
    const i = this._createCanvas(t, e);
    return {
      canvas: i,
      context: i.getContext("2d", {
        willReadFrequently: !g(this, W0)
      })
    };
  }
  reset(t, e, i) {
    if (!t.canvas)
      throw new Error("Canvas is not specified");
    if (e <= 0 || i <= 0)
      throw new Error("Invalid canvas size");
    t.canvas.width = e, t.canvas.height = i;
  }
  destroy(t) {
    if (!t.canvas)
      throw new Error("Canvas is not specified");
    t.canvas.width = 0, t.canvas.height = 0, t.canvas = null, t.context = null;
  }
  _createCanvas(t, e) {
    Ae("Abstract method `_createCanvas` called.");
  }
}
W0 = new WeakMap();
class tS extends nw {
  constructor({
    ownerDocument: t = globalThis.document,
    enableHWA: e = !1
  }) {
    super({
      enableHWA: e
    }), this._document = t;
  }
  _createCanvas(t, e) {
    const i = this._document.createElement("canvas");
    return i.width = t, i.height = e, i;
  }
}
class aw {
  constructor({
    baseUrl: t = null,
    isCompressed: e = !0
  }) {
    this.baseUrl = t, this.isCompressed = e;
  }
  async fetch({
    name: t
  }) {
    if (!this.baseUrl)
      throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");
    if (!t)
      throw new Error("CMap name must be specified.");
    const e = this.baseUrl + t + (this.isCompressed ? ".bcmap" : "");
    return this._fetch(e).then((i) => ({
      cMapData: i,
      isCompressed: this.isCompressed
    })).catch((i) => {
      throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${e}`);
    });
  }
  async _fetch(t) {
    Ae("Abstract method `_fetch` called.");
  }
}
class y8 extends aw {
  async _fetch(t) {
    const e = await U1(t, this.isCompressed ? "arraybuffer" : "text");
    return e instanceof ArrayBuffer ? new Uint8Array(e) : p2(e);
  }
}
class rw {
  addFilter(t) {
    return "none";
  }
  addHCMFilter(t, e) {
    return "none";
  }
  addAlphaFilter(t) {
    return "none";
  }
  addLuminosityFilter(t) {
    return "none";
  }
  addHighlightHCMFilter(t, e, i, n, a) {
    return "none";
  }
  destroy(t = !1) {
  }
}
var cc, Iu, gr, pr, zs, hc, uc, It, Hs, gd, Mh, yg, Fh, ow, M5, Rh, pd, md, F5, bd;
class eS extends rw {
  constructor({
    docId: e,
    ownerDocument: i = globalThis.document
  }) {
    super();
    _(this, It);
    _(this, cc);
    _(this, Iu);
    _(this, gr);
    _(this, pr);
    _(this, zs);
    _(this, hc);
    _(this, uc, 0);
    S(this, pr, e), S(this, zs, i);
  }
  addFilter(e) {
    if (!e)
      return "none";
    let i = g(this, It, Hs).get(e);
    if (i)
      return i;
    const [n, a, r] = C(this, It, yg).call(this, e), o = e.length === 1 ? n : `${n}${a}${r}`;
    if (i = g(this, It, Hs).get(o), i)
      return g(this, It, Hs).set(e, i), i;
    const l = `g_${g(this, pr)}_transfer_map_${Qs(this, uc)._++}`, c = C(this, It, Fh).call(this, l);
    g(this, It, Hs).set(e, c), g(this, It, Hs).set(o, c);
    const h = C(this, It, Rh).call(this, l);
    return C(this, It, md).call(this, n, a, r, h), c;
  }
  addHCMFilter(e, i) {
    var p;
    const n = `${e}-${i}`, a = "base";
    let r = g(this, It, gd).get(a);
    if ((r == null ? void 0 : r.key) === n || (r ? ((p = r.filter) == null || p.remove(), r.key = n, r.url = "none", r.filter = null) : (r = {
      key: n,
      url: "none",
      filter: null
    }, g(this, It, gd).set(a, r)), !e || !i))
      return r.url;
    const o = C(this, It, bd).call(this, e);
    e = Dt.makeHexColor(...o);
    const l = C(this, It, bd).call(this, i);
    if (i = Dt.makeHexColor(...l), g(this, It, Mh).style.color = "", e === "#000000" && i === "#ffffff" || e === i)
      return r.url;
    const c = new Array(256);
    for (let m = 0; m <= 255; m++) {
      const b = m / 255;
      c[m] = b <= 0.03928 ? b / 12.92 : ((b + 0.055) / 1.055) ** 2.4;
    }
    const h = c.join(","), u = `g_${g(this, pr)}_hcm_filter`, f = r.filter = C(this, It, Rh).call(this, u);
    C(this, It, md).call(this, h, h, h, f), C(this, It, M5).call(this, f);
    const d = (m, b) => {
      const y = o[m] / 255, v = l[m] / 255, w = new Array(b + 1);
      for (let A = 0; A <= b; A++)
        w[A] = y + A / b * (v - y);
      return w.join(",");
    };
    return C(this, It, md).call(this, d(0, 5), d(1, 5), d(2, 5), f), r.url = C(this, It, Fh).call(this, u), r.url;
  }
  addAlphaFilter(e) {
    let i = g(this, It, Hs).get(e);
    if (i)
      return i;
    const [n] = C(this, It, yg).call(this, [e]), a = `alpha_${n}`;
    if (i = g(this, It, Hs).get(a), i)
      return g(this, It, Hs).set(e, i), i;
    const r = `g_${g(this, pr)}_alpha_map_${Qs(this, uc)._++}`, o = C(this, It, Fh).call(this, r);
    g(this, It, Hs).set(e, o), g(this, It, Hs).set(a, o);
    const l = C(this, It, Rh).call(this, r);
    return C(this, It, F5).call(this, n, l), o;
  }
  addLuminosityFilter(e) {
    let i = g(this, It, Hs).get(e || "luminosity");
    if (i)
      return i;
    let n, a;
    if (e ? ([n] = C(this, It, yg).call(this, [e]), a = `luminosity_${n}`) : a = "luminosity", i = g(this, It, Hs).get(a), i)
      return g(this, It, Hs).set(e, i), i;
    const r = `g_${g(this, pr)}_luminosity_map_${Qs(this, uc)._++}`, o = C(this, It, Fh).call(this, r);
    g(this, It, Hs).set(e, o), g(this, It, Hs).set(a, o);
    const l = C(this, It, Rh).call(this, r);
    return C(this, It, ow).call(this, l), e && C(this, It, F5).call(this, n, l), o;
  }
  addHighlightHCMFilter(e, i, n, a, r) {
    var v;
    const o = `${i}-${n}-${a}-${r}`;
    let l = g(this, It, gd).get(e);
    if ((l == null ? void 0 : l.key) === o || (l ? ((v = l.filter) == null || v.remove(), l.key = o, l.url = "none", l.filter = null) : (l = {
      key: o,
      url: "none",
      filter: null
    }, g(this, It, gd).set(e, l)), !i || !n))
      return l.url;
    const [c, h] = [i, n].map(C(this, It, bd).bind(this));
    let u = Math.round(0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]), f = Math.round(0.2126 * h[0] + 0.7152 * h[1] + 0.0722 * h[2]), [d, p] = [a, r].map(C(this, It, bd).bind(this));
    f < u && ([u, f, d, p] = [f, u, p, d]), g(this, It, Mh).style.color = "";
    const m = (w, A, x) => {
      const k = new Array(256), I = (f - u) / x, T = w / 255, E = (A - w) / (255 * x);
      let M = 0;
      for (let F = 0; F <= x; F++) {
        const L = Math.round(u + F * I), Y = T + F * E;
        for (let B = M; B <= L; B++)
          k[B] = Y;
        M = L + 1;
      }
      for (let F = M; F < 256; F++)
        k[F] = k[M - 1];
      return k.join(",");
    }, b = `g_${g(this, pr)}_hcm_${e}_filter`, y = l.filter = C(this, It, Rh).call(this, b);
    return C(this, It, M5).call(this, y), C(this, It, md).call(this, m(d[0], p[0], 5), m(d[1], p[1], 5), m(d[2], p[2], 5), y), l.url = C(this, It, Fh).call(this, b), l.url;
  }
  destroy(e = !1) {
    var i, n, a, r;
    e && ((i = g(this, hc)) != null && i.size) || ((n = g(this, gr)) == null || n.parentNode.parentNode.remove(), S(this, gr, null), (a = g(this, Iu)) == null || a.clear(), S(this, Iu, null), (r = g(this, hc)) == null || r.clear(), S(this, hc, null), S(this, uc, 0));
  }
}
cc = new WeakMap(), Iu = new WeakMap(), gr = new WeakMap(), pr = new WeakMap(), zs = new WeakMap(), hc = new WeakMap(), uc = new WeakMap(), It = new WeakSet(), Hs = function() {
  return g(this, Iu) || S(this, Iu, /* @__PURE__ */ new Map());
}, gd = function() {
  return g(this, hc) || S(this, hc, /* @__PURE__ */ new Map());
}, Mh = function() {
  if (!g(this, gr)) {
    const e = g(this, zs).createElement("div"), {
      style: i
    } = e;
    i.visibility = "hidden", i.contain = "strict", i.width = i.height = 0, i.position = "absolute", i.top = i.left = 0, i.zIndex = -1;
    const n = g(this, zs).createElementNS(Ka, "svg");
    n.setAttribute("width", 0), n.setAttribute("height", 0), S(this, gr, g(this, zs).createElementNS(Ka, "defs")), e.append(n), n.append(g(this, gr)), g(this, zs).body.append(e);
  }
  return g(this, gr);
}, yg = function(e) {
  if (e.length === 1) {
    const c = e[0], h = new Array(256);
    for (let f = 0; f < 256; f++)
      h[f] = c[f] / 255;
    const u = h.join(",");
    return [u, u, u];
  }
  const [i, n, a] = e, r = new Array(256), o = new Array(256), l = new Array(256);
  for (let c = 0; c < 256; c++)
    r[c] = i[c] / 255, o[c] = n[c] / 255, l[c] = a[c] / 255;
  return [r.join(","), o.join(","), l.join(",")];
}, Fh = function(e) {
  if (g(this, cc) === void 0) {
    S(this, cc, "");
    const i = g(this, zs).URL;
    i !== g(this, zs).baseURI && (b2(i) ? zt('#createUrl: ignore "data:"-URL for performance reasons.') : S(this, cc, K6(i, "")));
  }
  return `url(${g(this, cc)}#${e})`;
}, ow = function(e) {
  const i = g(this, zs).createElementNS(Ka, "feColorMatrix");
  i.setAttribute("type", "matrix"), i.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"), e.append(i);
}, M5 = function(e) {
  const i = g(this, zs).createElementNS(Ka, "feColorMatrix");
  i.setAttribute("type", "matrix"), i.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"), e.append(i);
}, Rh = function(e) {
  const i = g(this, zs).createElementNS(Ka, "filter");
  return i.setAttribute("color-interpolation-filters", "sRGB"), i.setAttribute("id", e), g(this, It, Mh).append(i), i;
}, pd = function(e, i, n) {
  const a = g(this, zs).createElementNS(Ka, i);
  a.setAttribute("type", "discrete"), a.setAttribute("tableValues", n), e.append(a);
}, md = function(e, i, n, a) {
  const r = g(this, zs).createElementNS(Ka, "feComponentTransfer");
  a.append(r), C(this, It, pd).call(this, r, "feFuncR", e), C(this, It, pd).call(this, r, "feFuncG", i), C(this, It, pd).call(this, r, "feFuncB", n);
}, F5 = function(e, i) {
  const n = g(this, zs).createElementNS(Ka, "feComponentTransfer");
  i.append(n), C(this, It, pd).call(this, n, "feFuncA", e);
}, bd = function(e) {
  return g(this, It, Mh).style.color = e, Z6(getComputedStyle(g(this, It, Mh)).getPropertyValue("color"));
};
class lw {
  constructor({
    baseUrl: t = null
  }) {
    this.baseUrl = t;
  }
  async fetch({
    filename: t
  }) {
    if (!this.baseUrl)
      throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");
    if (!t)
      throw new Error("Font filename must be specified.");
    const e = `${this.baseUrl}${t}`;
    return this._fetch(e).catch((i) => {
      throw new Error(`Unable to load font data at: ${e}`);
    });
  }
  async _fetch(t) {
    Ae("Abstract method `_fetch` called.");
  }
}
class w8 extends lw {
  async _fetch(t) {
    const e = await U1(t, "arraybuffer");
    return new Uint8Array(e);
  }
}
class cw {
  constructor({
    baseUrl: t = null
  }) {
    this.baseUrl = t;
  }
  async fetch({
    filename: t
  }) {
    if (!this.baseUrl)
      throw new Error("Ensure that the `wasmUrl` API parameter is provided.");
    if (!t)
      throw new Error("Wasm filename must be specified.");
    const e = `${this.baseUrl}${t}`;
    return this._fetch(e).catch((i) => {
      throw new Error(`Unable to load wasm data at: ${e}`);
    });
  }
  async _fetch(t) {
    Ae("Abstract method `_fetch` called.");
  }
}
class v8 extends cw {
  async _fetch(t) {
    const e = await U1(t, "arraybuffer");
    return new Uint8Array(e);
  }
}
oi && zt("Please use the `legacy` build in Node.js environments.");
async function t7(s) {
  const e = await process.getBuiltinModule("fs").promises.readFile(s);
  return new Uint8Array(e);
}
class sS extends rw {
}
class iS extends nw {
  _createCanvas(t, e) {
    return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
  }
}
class nS extends aw {
  async _fetch(t) {
    return t7(t);
  }
}
class aS extends lw {
  async _fetch(t) {
    return t7(t);
  }
}
class rS extends cw {
  async _fetch(t) {
    return t7(t);
  }
}
const Rs = {
  FILL: "Fill",
  STROKE: "Stroke",
  SHADING: "Shading"
};
function R5(s, t) {
  if (!t)
    return;
  const e = t[2] - t[0], i = t[3] - t[1], n = new Path2D();
  n.rect(t[0], t[1], e, i), s.clip(n);
}
class e7 {
  isModifyingCurrentTransform() {
    return !1;
  }
  getPattern() {
    Ae("Abstract method `getPattern` called.");
  }
}
class oS extends e7 {
  constructor(t) {
    super(), this._type = t[1], this._bbox = t[2], this._colorStops = t[3], this._p0 = t[4], this._p1 = t[5], this._r0 = t[6], this._r1 = t[7], this.matrix = null;
  }
  _createGradient(t) {
    let e;
    this._type === "axial" ? e = t.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (e = t.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
    for (const i of this._colorStops)
      e.addColorStop(i[0], i[1]);
    return e;
  }
  getPattern(t, e, i, n) {
    let a;
    if (n === Rs.STROKE || n === Rs.FILL) {
      const r = e.current.getClippedPathBoundingBox(n, je(t)) || [0, 0, 0, 0], o = Math.ceil(r[2] - r[0]) || 1, l = Math.ceil(r[3] - r[1]) || 1, c = e.cachedCanvases.getCanvas("pattern", o, l), h = c.context;
      h.clearRect(0, 0, h.canvas.width, h.canvas.height), h.beginPath(), h.rect(0, 0, h.canvas.width, h.canvas.height), h.translate(-r[0], -r[1]), i = Dt.transform(i, [1, 0, 0, 1, r[0], r[1]]), h.transform(...e.baseTransform), this.matrix && h.transform(...this.matrix), R5(h, this._bbox), h.fillStyle = this._createGradient(h), h.fill(), a = t.createPattern(c.canvas, "no-repeat");
      const u = new DOMMatrix(i);
      a.setTransform(u);
    } else
      R5(t, this._bbox), a = this._createGradient(t);
    return a;
  }
}
function pm(s, t, e, i, n, a, r, o) {
  const l = t.coords, c = t.colors, h = s.data, u = s.width * 4;
  let f;
  l[e + 1] > l[i + 1] && (f = e, e = i, i = f, f = a, a = r, r = f), l[i + 1] > l[n + 1] && (f = i, i = n, n = f, f = r, r = o, o = f), l[e + 1] > l[i + 1] && (f = e, e = i, i = f, f = a, a = r, r = f);
  const d = (l[e] + t.offsetX) * t.scaleX, p = (l[e + 1] + t.offsetY) * t.scaleY, m = (l[i] + t.offsetX) * t.scaleX, b = (l[i + 1] + t.offsetY) * t.scaleY, y = (l[n] + t.offsetX) * t.scaleX, v = (l[n + 1] + t.offsetY) * t.scaleY;
  if (p >= v)
    return;
  const w = c[a], A = c[a + 1], x = c[a + 2], k = c[r], I = c[r + 1], T = c[r + 2], E = c[o], M = c[o + 1], F = c[o + 2], L = Math.round(p), Y = Math.round(v);
  let B, et, H, P, G, N, j, V;
  for (let X = L; X <= Y; X++) {
    if (X < b) {
      const $ = X < p ? 0 : (p - X) / (p - b);
      B = d - (d - m) * $, et = w - (w - k) * $, H = A - (A - I) * $, P = x - (x - T) * $;
    } else {
      let $;
      X > v ? $ = 1 : b === v ? $ = 0 : $ = (b - X) / (b - v), B = m - (m - y) * $, et = k - (k - E) * $, H = I - (I - M) * $, P = T - (T - F) * $;
    }
    let z;
    X < p ? z = 0 : X > v ? z = 1 : z = (p - X) / (p - v), G = d - (d - y) * z, N = w - (w - E) * z, j = A - (A - M) * z, V = x - (x - F) * z;
    const K = Math.round(Math.min(B, G)), W = Math.round(Math.max(B, G));
    let rt = u * X + K * 4;
    for (let $ = K; $ <= W; $++)
      z = (B - $) / (B - G), z < 0 ? z = 0 : z > 1 && (z = 1), h[rt++] = et - (et - N) * z | 0, h[rt++] = H - (H - j) * z | 0, h[rt++] = P - (P - V) * z | 0, h[rt++] = 255;
  }
}
function lS(s, t, e) {
  const i = t.coords, n = t.colors;
  let a, r;
  switch (t.type) {
    case "lattice":
      const o = t.verticesPerRow, l = Math.floor(i.length / o) - 1, c = o - 1;
      for (a = 0; a < l; a++) {
        let h = a * o;
        for (let u = 0; u < c; u++, h++)
          pm(s, e, i[h], i[h + 1], i[h + o], n[h], n[h + 1], n[h + o]), pm(s, e, i[h + o + 1], i[h + 1], i[h + o], n[h + o + 1], n[h + 1], n[h + o]);
      }
      break;
    case "triangles":
      for (a = 0, r = i.length; a < r; a += 3)
        pm(s, e, i[a], i[a + 1], i[a + 2], n[a], n[a + 1], n[a + 2]);
      break;
    default:
      throw new Error("illegal figure");
  }
}
class cS extends e7 {
  constructor(t) {
    super(), this._coords = t[2], this._colors = t[3], this._figures = t[4], this._bounds = t[5], this._bbox = t[6], this._background = t[7], this.matrix = null;
  }
  _createMeshCanvas(t, e, i) {
    const o = Math.floor(this._bounds[0]), l = Math.floor(this._bounds[1]), c = Math.ceil(this._bounds[2]) - o, h = Math.ceil(this._bounds[3]) - l, u = Math.min(Math.ceil(Math.abs(c * t[0] * 1.1)), 3e3), f = Math.min(Math.ceil(Math.abs(h * t[1] * 1.1)), 3e3), d = c / u, p = h / f, m = {
      coords: this._coords,
      colors: this._colors,
      offsetX: -o,
      offsetY: -l,
      scaleX: 1 / d,
      scaleY: 1 / p
    }, b = u + 2 * 2, y = f + 2 * 2, v = i.getCanvas("mesh", b, y), w = v.context, A = w.createImageData(u, f);
    if (e) {
      const k = A.data;
      for (let I = 0, T = k.length; I < T; I += 4)
        k[I] = e[0], k[I + 1] = e[1], k[I + 2] = e[2], k[I + 3] = 255;
    }
    for (const k of this._figures)
      lS(A, k, m);
    return w.putImageData(A, 2, 2), {
      canvas: v.canvas,
      offsetX: o - 2 * d,
      offsetY: l - 2 * p,
      scaleX: d,
      scaleY: p
    };
  }
  isModifyingCurrentTransform() {
    return !0;
  }
  getPattern(t, e, i, n) {
    R5(t, this._bbox);
    const a = new Float32Array(2);
    if (n === Rs.SHADING)
      Dt.singularValueDecompose2dScale(je(t), a);
    else if (this.matrix) {
      Dt.singularValueDecompose2dScale(this.matrix, a);
      const [o, l] = a;
      Dt.singularValueDecompose2dScale(e.baseTransform, a), a[0] *= o, a[1] *= l;
    } else
      Dt.singularValueDecompose2dScale(e.baseTransform, a);
    const r = this._createMeshCanvas(a, n === Rs.SHADING ? null : this._background, e.cachedCanvases);
    return n !== Rs.SHADING && (t.setTransform(...e.baseTransform), this.matrix && t.transform(...this.matrix)), t.translate(r.offsetX, r.offsetY), t.scale(r.scaleX, r.scaleY), t.createPattern(r.canvas, "no-repeat");
  }
}
class hS extends e7 {
  getPattern() {
    return "hotpink";
  }
}
function uS(s) {
  switch (s[0]) {
    case "RadialAxial":
      return new oS(s);
    case "Mesh":
      return new cS(s);
    case "Dummy":
      return new hS();
  }
  throw new Error(`Unknown IR type: ${s[0]}`);
}
const A8 = {
  COLORED: 1,
  UNCOLORED: 2
}, g9 = class g9 {
  constructor(t, e, i, n) {
    this.color = t[1], this.operatorList = t[2], this.matrix = t[3], this.bbox = t[4], this.xstep = t[5], this.ystep = t[6], this.paintType = t[7], this.tilingType = t[8], this.ctx = e, this.canvasGraphicsFactory = i, this.baseTransform = n;
  }
  createPatternCanvas(t) {
    const {
      bbox: e,
      operatorList: i,
      paintType: n,
      tilingType: a,
      color: r,
      canvasGraphicsFactory: o
    } = this;
    let {
      xstep: l,
      ystep: c
    } = this;
    l = Math.abs(l), c = Math.abs(c), U9("TilingType: " + a);
    const h = e[0], u = e[1], f = e[2], d = e[3], p = f - h, m = d - u, b = new Float32Array(2);
    Dt.singularValueDecompose2dScale(this.matrix, b);
    const [y, v] = b;
    Dt.singularValueDecompose2dScale(this.baseTransform, b);
    const w = y * b[0], A = v * b[1];
    let x = p, k = m, I = !1, T = !1;
    const E = Math.ceil(l * w), M = Math.ceil(c * A), F = Math.ceil(p * w), L = Math.ceil(m * A);
    E >= F ? x = l : I = !0, M >= L ? k = c : T = !0;
    const Y = this.getSizeAndScale(x, this.ctx.canvas.width, w), B = this.getSizeAndScale(k, this.ctx.canvas.height, A), et = t.cachedCanvases.getCanvas("pattern", Y.size, B.size), H = et.context, P = o.createCanvasGraphics(H);
    if (P.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(P, n, r), H.translate(-Y.scale * h, -B.scale * u), P.transform(Y.scale, 0, 0, B.scale, 0, 0), H.save(), this.clipBbox(P, h, u, f, d), P.baseTransform = je(P.ctx), P.executeOperatorList(i), P.endDrawing(), H.restore(), I || T) {
      const G = et.canvas;
      I && (x = l), T && (k = c);
      const N = this.getSizeAndScale(x, this.ctx.canvas.width, w), j = this.getSizeAndScale(k, this.ctx.canvas.height, A), V = N.size, X = j.size, z = t.cachedCanvases.getCanvas("pattern-workaround", V, X), K = z.context, W = I ? Math.floor(p / l) : 0, rt = T ? Math.floor(m / c) : 0;
      for (let $ = 0; $ <= W; $++)
        for (let nt = 0; nt <= rt; nt++)
          K.drawImage(G, V * $, X * nt, V, X, 0, 0, V, X);
      return {
        canvas: z.canvas,
        scaleX: N.scale,
        scaleY: j.scale,
        offsetX: h,
        offsetY: u
      };
    }
    return {
      canvas: et.canvas,
      scaleX: Y.scale,
      scaleY: B.scale,
      offsetX: h,
      offsetY: u
    };
  }
  getSizeAndScale(t, e, i) {
    const n = Math.max(g9.MAX_PATTERN_SIZE, e);
    let a = Math.ceil(t * i);
    return a >= n ? a = n : i = a / t, {
      scale: i,
      size: a
    };
  }
  clipBbox(t, e, i, n, a) {
    const r = n - e, o = a - i;
    t.ctx.rect(e, i, r, o), Dt.axialAlignedBoundingBox([e, i, n, a], je(t.ctx), t.current.minMax), t.clip(), t.endPath();
  }
  setFillAndStrokeStyleToContext(t, e, i) {
    const n = t.ctx, a = t.current;
    switch (e) {
      case A8.COLORED:
        const {
          fillStyle: r,
          strokeStyle: o
        } = this.ctx;
        n.fillStyle = a.fillColor = r, n.strokeStyle = a.strokeColor = o;
        break;
      case A8.UNCOLORED:
        n.fillStyle = n.strokeStyle = i, a.fillColor = a.strokeColor = i;
        break;
      default:
        throw new Nk(`Unsupported paint type: ${e}`);
    }
  }
  isModifyingCurrentTransform() {
    return !1;
  }
  getPattern(t, e, i, n) {
    let a = i;
    n !== Rs.SHADING && (a = Dt.transform(a, e.baseTransform), this.matrix && (a = Dt.transform(a, this.matrix)));
    const r = this.createPatternCanvas(e);
    let o = new DOMMatrix(a);
    o = o.translate(r.offsetX, r.offsetY), o = o.scale(1 / r.scaleX, 1 / r.scaleY);
    const l = t.createPattern(r.canvas, "repeat");
    return l.setTransform(o), l;
  }
};
ht(g9, "MAX_PATTERN_SIZE", 3e3);
let P5 = g9;
function dS({
  src: s,
  srcPos: t = 0,
  dest: e,
  width: i,
  height: n,
  nonBlackColor: a = 4294967295,
  inverseDecode: r = !1
}) {
  const o = ks.isLittleEndian ? 4278190080 : 255, [l, c] = r ? [a, o] : [o, a], h = i >> 3, u = i & 7, f = s.length;
  e = new Uint32Array(e.buffer);
  let d = 0;
  for (let p = 0; p < n; p++) {
    for (const b = t + h; t < b; t++) {
      const y = t < f ? s[t] : 255;
      e[d++] = y & 128 ? c : l, e[d++] = y & 64 ? c : l, e[d++] = y & 32 ? c : l, e[d++] = y & 16 ? c : l, e[d++] = y & 8 ? c : l, e[d++] = y & 4 ? c : l, e[d++] = y & 2 ? c : l, e[d++] = y & 1 ? c : l;
    }
    if (u === 0)
      continue;
    const m = t < f ? s[t++] : 255;
    for (let b = 0; b < u; b++)
      e[d++] = m & 1 << 7 - b ? c : l;
  }
  return {
    srcPos: t,
    destPos: d
  };
}
const x8 = 16, k8 = 100, fS = 15, S8 = 10, Ai = 16, mm = new DOMMatrix(), Xi = new Float32Array(2), $h = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]);
function gS(s, t) {
  if (s._removeMirroring)
    throw new Error("Context is already forwarding operations.");
  s.__originalSave = s.save, s.__originalRestore = s.restore, s.__originalRotate = s.rotate, s.__originalScale = s.scale, s.__originalTranslate = s.translate, s.__originalTransform = s.transform, s.__originalSetTransform = s.setTransform, s.__originalResetTransform = s.resetTransform, s.__originalClip = s.clip, s.__originalMoveTo = s.moveTo, s.__originalLineTo = s.lineTo, s.__originalBezierCurveTo = s.bezierCurveTo, s.__originalRect = s.rect, s.__originalClosePath = s.closePath, s.__originalBeginPath = s.beginPath, s._removeMirroring = () => {
    s.save = s.__originalSave, s.restore = s.__originalRestore, s.rotate = s.__originalRotate, s.scale = s.__originalScale, s.translate = s.__originalTranslate, s.transform = s.__originalTransform, s.setTransform = s.__originalSetTransform, s.resetTransform = s.__originalResetTransform, s.clip = s.__originalClip, s.moveTo = s.__originalMoveTo, s.lineTo = s.__originalLineTo, s.bezierCurveTo = s.__originalBezierCurveTo, s.rect = s.__originalRect, s.closePath = s.__originalClosePath, s.beginPath = s.__originalBeginPath, delete s._removeMirroring;
  }, s.save = function() {
    t.save(), this.__originalSave();
  }, s.restore = function() {
    t.restore(), this.__originalRestore();
  }, s.translate = function(e, i) {
    t.translate(e, i), this.__originalTranslate(e, i);
  }, s.scale = function(e, i) {
    t.scale(e, i), this.__originalScale(e, i);
  }, s.transform = function(e, i, n, a, r, o) {
    t.transform(e, i, n, a, r, o), this.__originalTransform(e, i, n, a, r, o);
  }, s.setTransform = function(e, i, n, a, r, o) {
    t.setTransform(e, i, n, a, r, o), this.__originalSetTransform(e, i, n, a, r, o);
  }, s.resetTransform = function() {
    t.resetTransform(), this.__originalResetTransform();
  }, s.rotate = function(e) {
    t.rotate(e), this.__originalRotate(e);
  }, s.clip = function(e) {
    t.clip(e), this.__originalClip(e);
  }, s.moveTo = function(e, i) {
    t.moveTo(e, i), this.__originalMoveTo(e, i);
  }, s.lineTo = function(e, i) {
    t.lineTo(e, i), this.__originalLineTo(e, i);
  }, s.bezierCurveTo = function(e, i, n, a, r, o) {
    t.bezierCurveTo(e, i, n, a, r, o), this.__originalBezierCurveTo(e, i, n, a, r, o);
  }, s.rect = function(e, i, n, a) {
    t.rect(e, i, n, a), this.__originalRect(e, i, n, a);
  }, s.closePath = function() {
    t.closePath(), this.__originalClosePath();
  }, s.beginPath = function() {
    t.beginPath(), this.__originalBeginPath();
  };
}
class pS {
  constructor(t) {
    this.canvasFactory = t, this.cache = /* @__PURE__ */ Object.create(null);
  }
  getCanvas(t, e, i) {
    let n;
    return this.cache[t] !== void 0 ? (n = this.cache[t], this.canvasFactory.reset(n, e, i)) : (n = this.canvasFactory.create(e, i), this.cache[t] = n), n;
  }
  delete(t) {
    delete this.cache[t];
  }
  clear() {
    for (const t in this.cache) {
      const e = this.cache[t];
      this.canvasFactory.destroy(e), delete this.cache[t];
    }
  }
}
function L2(s, t, e, i, n, a, r, o, l, c) {
  const [h, u, f, d, p, m] = je(s);
  if (u === 0 && f === 0) {
    const v = r * h + p, w = Math.round(v), A = o * d + m, x = Math.round(A), k = (r + l) * h + p, I = Math.abs(Math.round(k) - w) || 1, T = (o + c) * d + m, E = Math.abs(Math.round(T) - x) || 1;
    return s.setTransform(Math.sign(h), 0, 0, Math.sign(d), w, x), s.drawImage(t, e, i, n, a, 0, 0, I, E), s.setTransform(h, u, f, d, p, m), [I, E];
  }
  if (h === 0 && d === 0) {
    const v = o * f + p, w = Math.round(v), A = r * u + m, x = Math.round(A), k = (o + c) * f + p, I = Math.abs(Math.round(k) - w) || 1, T = (r + l) * u + m, E = Math.abs(Math.round(T) - x) || 1;
    return s.setTransform(0, Math.sign(u), Math.sign(f), 0, w, x), s.drawImage(t, e, i, n, a, 0, 0, E, I), s.setTransform(h, u, f, d, p, m), [E, I];
  }
  s.drawImage(t, e, i, n, a, r, o, l, c);
  const b = Math.hypot(h, u), y = Math.hypot(f, d);
  return [b * l, y * c];
}
class C8 {
  constructor(t, e) {
    ht(this, "alphaIsShape", !1);
    ht(this, "fontSize", 0);
    ht(this, "fontSizeScale", 1);
    ht(this, "textMatrix", null);
    ht(this, "textMatrixScale", 1);
    ht(this, "fontMatrix", h5);
    ht(this, "leading", 0);
    ht(this, "x", 0);
    ht(this, "y", 0);
    ht(this, "lineX", 0);
    ht(this, "lineY", 0);
    ht(this, "charSpacing", 0);
    ht(this, "wordSpacing", 0);
    ht(this, "textHScale", 1);
    ht(this, "textRenderingMode", js.FILL);
    ht(this, "textRise", 0);
    ht(this, "fillColor", "#000000");
    ht(this, "strokeColor", "#000000");
    ht(this, "patternFill", !1);
    ht(this, "patternStroke", !1);
    ht(this, "fillAlpha", 1);
    ht(this, "strokeAlpha", 1);
    ht(this, "lineWidth", 1);
    ht(this, "activeSMask", null);
    ht(this, "transferMaps", "none");
    this.clipBox = new Float32Array([0, 0, t, e]), this.minMax = $h.slice();
  }
  clone() {
    const t = Object.create(this);
    return t.clipBox = this.clipBox.slice(), t.minMax = this.minMax.slice(), t;
  }
  getPathBoundingBox(t = Rs.FILL, e = null) {
    const i = this.minMax.slice();
    if (t === Rs.STROKE) {
      e || Ae("Stroke bounding box must include transform."), Dt.singularValueDecompose2dScale(e, Xi);
      const n = Xi[0] * this.lineWidth / 2, a = Xi[1] * this.lineWidth / 2;
      i[0] -= n, i[1] -= a, i[2] += n, i[3] += a;
    }
    return i;
  }
  updateClipFromPath() {
    const t = Dt.intersect(this.clipBox, this.getPathBoundingBox());
    this.startNewPathAndClipBox(t || [0, 0, 0, 0]);
  }
  isEmptyClip() {
    return this.minMax[0] === 1 / 0;
  }
  startNewPathAndClipBox(t) {
    this.clipBox.set(t, 0), this.minMax.set($h, 0);
  }
  getClippedPathBoundingBox(t = Rs.FILL, e = null) {
    return Dt.intersect(this.clipBox, this.getPathBoundingBox(t, e));
  }
}
function I8(s, t) {
  if (t instanceof ImageData) {
    s.putImageData(t, 0, 0);
    return;
  }
  const e = t.height, i = t.width, n = e % Ai, a = (e - n) / Ai, r = n === 0 ? a : a + 1, o = s.createImageData(i, Ai);
  let l = 0, c;
  const h = t.data, u = o.data;
  let f, d, p, m;
  if (t.kind === Ld.GRAYSCALE_1BPP) {
    const b = h.byteLength, y = new Uint32Array(u.buffer, 0, u.byteLength >> 2), v = y.length, w = i + 7 >> 3, A = 4294967295, x = ks.isLittleEndian ? 4278190080 : 255;
    for (f = 0; f < r; f++) {
      for (p = f < a ? Ai : n, c = 0, d = 0; d < p; d++) {
        const k = b - l;
        let I = 0;
        const T = k > w ? i : k * 8 - 7, E = T & -8;
        let M = 0, F = 0;
        for (; I < E; I += 8)
          F = h[l++], y[c++] = F & 128 ? A : x, y[c++] = F & 64 ? A : x, y[c++] = F & 32 ? A : x, y[c++] = F & 16 ? A : x, y[c++] = F & 8 ? A : x, y[c++] = F & 4 ? A : x, y[c++] = F & 2 ? A : x, y[c++] = F & 1 ? A : x;
        for (; I < T; I++)
          M === 0 && (F = h[l++], M = 128), y[c++] = F & M ? A : x, M >>= 1;
      }
      for (; c < v; )
        y[c++] = 0;
      s.putImageData(o, 0, f * Ai);
    }
  } else if (t.kind === Ld.RGBA_32BPP) {
    for (d = 0, m = i * Ai * 4, f = 0; f < a; f++)
      u.set(h.subarray(l, l + m)), l += m, s.putImageData(o, 0, d), d += Ai;
    f < r && (m = i * n * 4, u.set(h.subarray(l, l + m)), s.putImageData(o, 0, d));
  } else if (t.kind === Ld.RGB_24BPP)
    for (p = Ai, m = i * p, f = 0; f < r; f++) {
      for (f >= a && (p = n, m = i * p), c = 0, d = m; d--; )
        u[c++] = h[l++], u[c++] = h[l++], u[c++] = h[l++], u[c++] = 255;
      s.putImageData(o, 0, f * Ai);
    }
  else
    throw new Error(`bad image kind: ${t.kind}`);
}
function _8(s, t) {
  if (t.bitmap) {
    s.drawImage(t.bitmap, 0, 0);
    return;
  }
  const e = t.height, i = t.width, n = e % Ai, a = (e - n) / Ai, r = n === 0 ? a : a + 1, o = s.createImageData(i, Ai);
  let l = 0;
  const c = t.data, h = o.data;
  for (let u = 0; u < r; u++) {
    const f = u < a ? Ai : n;
    ({
      srcPos: l
    } = dS({
      src: c,
      srcPos: l,
      dest: h,
      width: i,
      height: f,
      nonBlackColor: 0
    })), s.putImageData(o, 0, u * Ai);
  }
}
function $1(s, t) {
  const e = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
  for (const i of e)
    s[i] !== void 0 && (t[i] = s[i]);
  s.setLineDash !== void 0 && (t.setLineDash(s.getLineDash()), t.lineDashOffset = s.lineDashOffset);
}
function O2(s) {
  s.strokeStyle = s.fillStyle = "#000000", s.fillRule = "nonzero", s.globalAlpha = 1, s.lineWidth = 1, s.lineCap = "butt", s.lineJoin = "miter", s.miterLimit = 10, s.globalCompositeOperation = "source-over", s.font = "10px sans-serif", s.setLineDash !== void 0 && (s.setLineDash([]), s.lineDashOffset = 0);
  const {
    filter: t
  } = s;
  t !== "none" && t !== "" && (s.filter = "none");
}
function T8(s, t) {
  if (t)
    return !0;
  Dt.singularValueDecompose2dScale(s, Xi);
  const e = Math.fround(na.pixelRatio * Vr.PDF_TO_CSS_UNITS);
  return Xi[0] <= e && Xi[1] <= e;
}
const mS = ["butt", "round", "square"], bS = ["miter", "round", "bevel"], yS = {}, E8 = {};
var oa, D5, N5, B5;
const i8 = class i8 {
  constructor(t, e, i, n, a, {
    optionalContentConfig: r,
    markedContentStack: o = null
  }, l, c) {
    _(this, oa);
    this.ctx = t, this.current = new C8(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = i, this.canvasFactory = n, this.filterFactory = a, this.groupStack = [], this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = r, this.cachedCanvases = new pS(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = l, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = c, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
  }
  getObject(t, e = null) {
    return typeof t == "string" ? t.startsWith("g_") ? this.commonObjs.get(t) : this.objs.get(t) : e;
  }
  beginDrawing({
    transform: t,
    viewport: e,
    transparency: i = !1,
    background: n = null
  }) {
    const a = this.ctx.canvas.width, r = this.ctx.canvas.height, o = this.ctx.fillStyle;
    if (this.ctx.fillStyle = n || "#ffffff", this.ctx.fillRect(0, 0, a, r), this.ctx.fillStyle = o, i) {
      const l = this.cachedCanvases.getCanvas("transparent", a, r);
      this.compositeCtx = this.ctx, this.transparentCanvas = l.canvas, this.ctx = l.context, this.ctx.save(), this.ctx.transform(...je(this.compositeCtx));
    }
    this.ctx.save(), O2(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform = je(this.ctx);
  }
  executeOperatorList(t, e, i, n) {
    const a = t.argsArray, r = t.fnArray;
    let o = e || 0;
    const l = a.length;
    if (l === o)
      return o;
    const c = l - o > S8 && typeof i == "function", h = c ? Date.now() + fS : 0;
    let u = 0;
    const f = this.commonObjs, d = this.objs;
    let p;
    for (; ; ) {
      if (n !== void 0 && o === n.nextBreakPoint)
        return n.breakIt(o, i), o;
      if (p = r[o], p !== Jd.dependency)
        this[p].apply(this, a[o]);
      else
        for (const m of a[o]) {
          const b = m.startsWith("g_") ? f : d;
          if (!b.has(m))
            return b.get(m, i), o;
        }
      if (o++, o === l)
        return o;
      if (c && ++u > S8) {
        if (Date.now() > h)
          return i(), o;
        u = 0;
      }
    }
  }
  endDrawing() {
    C(this, oa, D5).call(this), this.cachedCanvases.clear(), this.cachedPatterns.clear();
    for (const t of this._cachedBitmapsMap.values()) {
      for (const e of t.values())
        typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement && (e.width = e.height = 0);
      t.clear();
    }
    this._cachedBitmapsMap.clear(), C(this, oa, N5).call(this);
  }
  _scaleImage(t, e) {
    const i = t.width ?? t.displayWidth, n = t.height ?? t.displayHeight;
    let a = Math.max(Math.hypot(e[0], e[1]), 1), r = Math.max(Math.hypot(e[2], e[3]), 1), o = i, l = n, c = "prescale1", h, u;
    for (; a > 2 && o > 1 || r > 2 && l > 1; ) {
      let f = o, d = l;
      a > 2 && o > 1 && (f = o >= 16384 ? Math.floor(o / 2) - 1 || 1 : Math.ceil(o / 2), a /= o / f), r > 2 && l > 1 && (d = l >= 16384 ? Math.floor(l / 2) - 1 || 1 : Math.ceil(l) / 2, r /= l / d), h = this.cachedCanvases.getCanvas(c, f, d), u = h.context, u.clearRect(0, 0, f, d), u.drawImage(t, 0, 0, o, l, 0, 0, f, d), t = h.canvas, o = f, l = d, c = c === "prescale1" ? "prescale2" : "prescale1";
    }
    return {
      img: t,
      paintWidth: o,
      paintHeight: l
    };
  }
  _createMaskCanvas(t) {
    const e = this.ctx, {
      width: i,
      height: n
    } = t, a = this.current.fillColor, r = this.current.patternFill, o = je(e);
    let l, c, h, u;
    if ((t.bitmap || t.data) && t.count > 1) {
      const E = t.bitmap || t.data.buffer;
      c = JSON.stringify(r ? o : [o.slice(0, 4), a]), l = this._cachedBitmapsMap.get(E), l || (l = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(E, l));
      const M = l.get(c);
      if (M && !r) {
        const F = Math.round(Math.min(o[0], o[2]) + o[4]), L = Math.round(Math.min(o[1], o[3]) + o[5]);
        return {
          canvas: M,
          offsetX: F,
          offsetY: L
        };
      }
      h = M;
    }
    h || (u = this.cachedCanvases.getCanvas("maskCanvas", i, n), _8(u.context, t));
    let f = Dt.transform(o, [1 / i, 0, 0, -1 / n, 0, 0]);
    f = Dt.transform(f, [1, 0, 0, 1, 0, -n]);
    const d = $h.slice();
    Dt.axialAlignedBoundingBox([0, 0, i, n], f, d);
    const [p, m, b, y] = d, v = Math.round(b - p) || 1, w = Math.round(y - m) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", v, w), x = A.context, k = p, I = m;
    x.translate(-k, -I), x.transform(...f), h || (h = this._scaleImage(u.canvas, ua(x)), h = h.img, l && r && l.set(c, h)), x.imageSmoothingEnabled = T8(je(x), t.interpolate), L2(x, h, 0, 0, h.width, h.height, 0, 0, i, n), x.globalCompositeOperation = "source-in";
    const T = Dt.transform(ua(x), [1, 0, 0, 1, -k, -I]);
    return x.fillStyle = r ? a.getPattern(e, this, T, Rs.FILL) : a, x.fillRect(0, 0, i, n), l && !r && (this.cachedCanvases.delete("fillCanvas"), l.set(c, A.canvas)), {
      canvas: A.canvas,
      offsetX: Math.round(k),
      offsetY: Math.round(I)
    };
  }
  setLineWidth(t) {
    t !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = t, this.ctx.lineWidth = t;
  }
  setLineCap(t) {
    this.ctx.lineCap = mS[t];
  }
  setLineJoin(t) {
    this.ctx.lineJoin = bS[t];
  }
  setMiterLimit(t) {
    this.ctx.miterLimit = t;
  }
  setDash(t, e) {
    const i = this.ctx;
    i.setLineDash !== void 0 && (i.setLineDash(t), i.lineDashOffset = e);
  }
  setRenderingIntent(t) {
  }
  setFlatness(t) {
  }
  setGState(t) {
    for (const [e, i] of t)
      switch (e) {
        case "LW":
          this.setLineWidth(i);
          break;
        case "LC":
          this.setLineCap(i);
          break;
        case "LJ":
          this.setLineJoin(i);
          break;
        case "ML":
          this.setMiterLimit(i);
          break;
        case "D":
          this.setDash(i[0], i[1]);
          break;
        case "RI":
          this.setRenderingIntent(i);
          break;
        case "FL":
          this.setFlatness(i);
          break;
        case "Font":
          this.setFont(i[0], i[1]);
          break;
        case "CA":
          this.current.strokeAlpha = i;
          break;
        case "ca":
          this.ctx.globalAlpha = this.current.fillAlpha = i;
          break;
        case "BM":
          this.ctx.globalCompositeOperation = i;
          break;
        case "SMask":
          this.current.activeSMask = i ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
          break;
        case "TR":
          this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(i);
          break;
      }
  }
  get inSMaskMode() {
    return !!this.suspendedCtx;
  }
  checkSMaskState() {
    const t = this.inSMaskMode;
    this.current.activeSMask && !t ? this.beginSMaskMode() : !this.current.activeSMask && t && this.endSMaskMode();
  }
  beginSMaskMode() {
    if (this.inSMaskMode)
      throw new Error("beginSMaskMode called while already in smask mode");
    const t = this.ctx.canvas.width, e = this.ctx.canvas.height, i = "smaskGroupAt" + this.groupLevel, n = this.cachedCanvases.getCanvas(i, t, e);
    this.suspendedCtx = this.ctx;
    const a = this.ctx = n.context;
    a.setTransform(this.suspendedCtx.getTransform()), $1(this.suspendedCtx, a), gS(a, this.suspendedCtx), this.setGState([["BM", "source-over"]]);
  }
  endSMaskMode() {
    if (!this.inSMaskMode)
      throw new Error("endSMaskMode called while not in smask mode");
    this.ctx._removeMirroring(), $1(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
  }
  compose(t) {
    if (!this.current.activeSMask)
      return;
    t ? (t[0] = Math.floor(t[0]), t[1] = Math.floor(t[1]), t[2] = Math.ceil(t[2]), t[3] = Math.ceil(t[3])) : t = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
    const e = this.current.activeSMask, i = this.suspendedCtx;
    this.composeSMask(i, e, this.ctx, t), 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();
  }
  composeSMask(t, e, i, n) {
    const a = n[0], r = n[1], o = n[2] - a, l = n[3] - r;
    o === 0 || l === 0 || (this.genericComposeSMask(e.context, i, o, l, e.subtype, e.backdrop, e.transferMap, a, r, e.offsetX, e.offsetY), t.save(), t.globalAlpha = 1, t.globalCompositeOperation = "source-over", t.setTransform(1, 0, 0, 1, 0, 0), t.drawImage(i.canvas, 0, 0), t.restore());
  }
  genericComposeSMask(t, e, i, n, a, r, o, l, c, h, u) {
    let f = t.canvas, d = l - h, p = c - u;
    if (r)
      if (d < 0 || p < 0 || d + i > f.width || p + n > f.height) {
        const b = this.cachedCanvases.getCanvas("maskExtension", i, n), y = b.context;
        y.drawImage(f, -d, -p), y.globalCompositeOperation = "destination-atop", y.fillStyle = r, y.fillRect(0, 0, i, n), y.globalCompositeOperation = "source-over", f = b.canvas, d = p = 0;
      } else {
        t.save(), t.globalAlpha = 1, t.setTransform(1, 0, 0, 1, 0, 0);
        const b = new Path2D();
        b.rect(d, p, i, n), t.clip(b), t.globalCompositeOperation = "destination-atop", t.fillStyle = r, t.fillRect(d, p, i, n), t.restore();
      }
    e.save(), e.globalAlpha = 1, e.setTransform(1, 0, 0, 1, 0, 0), a === "Alpha" && o ? e.filter = this.filterFactory.addAlphaFilter(o) : a === "Luminosity" && (e.filter = this.filterFactory.addLuminosityFilter(o));
    const m = new Path2D();
    m.rect(l, c, i, n), e.clip(m), e.globalCompositeOperation = "destination-in", e.drawImage(f, d, p, i, n, l, c, i, n), e.restore();
  }
  save() {
    this.inSMaskMode && $1(this.ctx, this.suspendedCtx), this.ctx.save();
    const t = this.current;
    this.stateStack.push(t), this.current = t.clone();
  }
  restore() {
    if (this.stateStack.length === 0) {
      this.inSMaskMode && this.endSMaskMode();
      return;
    }
    this.current = this.stateStack.pop(), this.ctx.restore(), this.inSMaskMode && $1(this.suspendedCtx, this.ctx), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
  }
  transform(t, e, i, n, a, r) {
    this.ctx.transform(t, e, i, n, a, r), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
  }
  constructPath(t, e, i) {
    let [n] = e;
    if (!i) {
      n || (n = e[0] = new Path2D()), this[t](n);
      return;
    }
    if (!(n instanceof Path2D)) {
      const a = e[0] = new Path2D();
      for (let r = 0, o = n.length; r < o; )
        switch (n[r++]) {
          case D2.moveTo:
            a.moveTo(n[r++], n[r++]);
            break;
          case D2.lineTo:
            a.lineTo(n[r++], n[r++]);
            break;
          case D2.curveTo:
            a.bezierCurveTo(n[r++], n[r++], n[r++], n[r++], n[r++], n[r++]);
            break;
          case D2.closePath:
            a.closePath();
            break;
          default:
            zt(`Unrecognized drawing path operator: ${n[r - 1]}`);
            break;
        }
      n = a;
    }
    Dt.axialAlignedBoundingBox(i, je(this.ctx), this.current.minMax), this[t](n);
  }
  closePath() {
    this.ctx.closePath();
  }
  stroke(t, e = !0) {
    const i = this.ctx, n = this.current.strokeColor;
    if (i.globalAlpha = this.current.strokeAlpha, this.contentVisible)
      if (typeof n == "object" && (n != null && n.getPattern)) {
        const a = n.isModifyingCurrentTransform() ? i.getTransform() : null;
        if (i.save(), i.strokeStyle = n.getPattern(i, this, ua(i), Rs.STROKE), a) {
          const r = new Path2D();
          r.addPath(t, i.getTransform().invertSelf().multiplySelf(a)), t = r;
        }
        this.rescaleAndStroke(t, !1), i.restore();
      } else
        this.rescaleAndStroke(t, !0);
    e && this.consumePath(t, this.current.getClippedPathBoundingBox(Rs.STROKE, je(this.ctx))), i.globalAlpha = this.current.fillAlpha;
  }
  closeStroke(t) {
    this.stroke(t);
  }
  fill(t, e = !0) {
    const i = this.ctx, n = this.current.fillColor, a = this.current.patternFill;
    let r = !1;
    if (a) {
      const l = n.isModifyingCurrentTransform() ? i.getTransform() : null;
      if (i.save(), i.fillStyle = n.getPattern(i, this, ua(i), Rs.FILL), l) {
        const c = new Path2D();
        c.addPath(t, i.getTransform().invertSelf().multiplySelf(l)), t = c;
      }
      r = !0;
    }
    const o = this.current.getClippedPathBoundingBox();
    this.contentVisible && o !== null && (this.pendingEOFill ? (i.fill(t, "evenodd"), this.pendingEOFill = !1) : i.fill(t)), r && i.restore(), e && this.consumePath(t, o);
  }
  eoFill(t) {
    this.pendingEOFill = !0, this.fill(t);
  }
  fillStroke(t) {
    this.fill(t, !1), this.stroke(t, !1), this.consumePath(t);
  }
  eoFillStroke(t) {
    this.pendingEOFill = !0, this.fillStroke(t);
  }
  closeFillStroke(t) {
    this.fillStroke(t);
  }
  closeEOFillStroke(t) {
    this.pendingEOFill = !0, this.fillStroke(t);
  }
  endPath(t) {
    this.consumePath(t);
  }
  rawFillPath(t) {
    this.ctx.fill(t);
  }
  clip() {
    this.pendingClip = yS;
  }
  eoClip() {
    this.pendingClip = E8;
  }
  beginText() {
    this.current.textMatrix = null, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
  }
  endText() {
    const t = this.pendingTextPaths, e = this.ctx;
    if (t === void 0)
      return;
    const i = new Path2D(), n = e.getTransform().invertSelf();
    for (const {
      transform: a,
      x: r,
      y: o,
      fontSize: l,
      path: c
    } of t)
      i.addPath(c, new DOMMatrix(a).preMultiplySelf(n).translate(r, o).scale(l, -l));
    e.clip(i), delete this.pendingTextPaths;
  }
  setCharSpacing(t) {
    this.current.charSpacing = t;
  }
  setWordSpacing(t) {
    this.current.wordSpacing = t;
  }
  setHScale(t) {
    this.current.textHScale = t / 100;
  }
  setLeading(t) {
    this.current.leading = -t;
  }
  setFont(t, e) {
    var h;
    const i = this.commonObjs.get(t), n = this.current;
    if (!i)
      throw new Error(`Can't find font for ${t}`);
    if (n.fontMatrix = i.fontMatrix || h5, (n.fontMatrix[0] === 0 || n.fontMatrix[3] === 0) && zt("Invalid font matrix for font " + t), e < 0 ? (e = -e, n.fontDirection = -1) : n.fontDirection = 1, this.current.font = i, this.current.fontSize = e, i.isType3Font)
      return;
    const a = i.loadedName || "sans-serif", r = ((h = i.systemFontInfo) == null ? void 0 : h.css) || `"${a}", ${i.fallbackName}`;
    let o = "normal";
    i.black ? o = "900" : i.bold && (o = "bold");
    const l = i.italic ? "italic" : "normal";
    let c = e;
    e < x8 ? c = x8 : e > k8 && (c = k8), this.current.fontSizeScale = e / c, this.ctx.font = `${l} ${o} ${c}px ${r}`;
  }
  setTextRenderingMode(t) {
    this.current.textRenderingMode = t;
  }
  setTextRise(t) {
    this.current.textRise = t;
  }
  moveText(t, e) {
    this.current.x = this.current.lineX += t, this.current.y = this.current.lineY += e;
  }
  setLeadingMoveText(t, e) {
    this.setLeading(-e), this.moveText(t, e);
  }
  setTextMatrix(t) {
    const {
      current: e
    } = this;
    e.textMatrix = t, e.textMatrixScale = Math.hypot(t[0], t[1]), e.x = e.lineX = 0, e.y = e.lineY = 0;
  }
  nextLine() {
    this.moveText(0, this.current.leading);
  }
  paintChar(t, e, i, n, a) {
    const r = this.ctx, o = this.current, l = o.font, c = o.textRenderingMode, h = o.fontSize / o.fontSizeScale, u = c & js.FILL_STROKE_MASK, f = !!(c & js.ADD_TO_PATH_FLAG), d = o.patternFill && !l.missingFile, p = o.patternStroke && !l.missingFile;
    let m;
    if ((l.disableFontFace || f || d || p) && (m = l.getPathGenerator(this.commonObjs, t)), l.disableFontFace || d || p) {
      r.save(), r.translate(e, i), r.scale(h, -h);
      let b;
      if ((u === js.FILL || u === js.FILL_STROKE) && (n ? (b = r.getTransform(), r.setTransform(...n), r.fill(C(this, oa, B5).call(this, m, b, n))) : r.fill(m)), u === js.STROKE || u === js.FILL_STROKE)
        if (a) {
          b || (b = r.getTransform()), r.setTransform(...a);
          const {
            a: y,
            b: v,
            c: w,
            d: A
          } = b, x = Dt.inverseTransform(a), k = Dt.transform([y, v, w, A, 0, 0], x);
          Dt.singularValueDecompose2dScale(k, Xi), r.lineWidth *= Math.max(Xi[0], Xi[1]) / h, r.stroke(C(this, oa, B5).call(this, m, b, a));
        } else
          r.lineWidth /= h, r.stroke(m);
      r.restore();
    } else
      (u === js.FILL || u === js.FILL_STROKE) && r.fillText(t, e, i), (u === js.STROKE || u === js.FILL_STROKE) && r.strokeText(t, e, i);
    f && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
      transform: je(r),
      x: e,
      y: i,
      fontSize: h,
      path: m
    });
  }
  get isFontSubpixelAAEnabled() {
    const {
      context: t
    } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
    t.scale(1.5, 1), t.fillText("I", 0, 10);
    const e = t.getImageData(0, 0, 10, 10).data;
    let i = !1;
    for (let n = 3; n < e.length; n += 4)
      if (e[n] > 0 && e[n] < 255) {
        i = !0;
        break;
      }
    return ne(this, "isFontSubpixelAAEnabled", i);
  }
  showText(t) {
    const e = this.current, i = e.font;
    if (i.isType3Font)
      return this.showType3Text(t);
    const n = e.fontSize;
    if (n === 0)
      return;
    const a = this.ctx, r = e.fontSizeScale, o = e.charSpacing, l = e.wordSpacing, c = e.fontDirection, h = e.textHScale * c, u = t.length, f = i.vertical, d = f ? 1 : -1, p = i.defaultVMetrics, m = n * e.fontMatrix[0], b = e.textRenderingMode === js.FILL && !i.disableFontFace && !e.patternFill;
    a.save(), e.textMatrix && a.transform(...e.textMatrix), a.translate(e.x, e.y + e.textRise), c > 0 ? a.scale(h, -1) : a.scale(h, 1);
    let y, v;
    if (e.patternFill) {
      a.save();
      const I = e.fillColor.getPattern(a, this, ua(a), Rs.FILL);
      y = je(a), a.restore(), a.fillStyle = I;
    }
    if (e.patternStroke) {
      a.save();
      const I = e.strokeColor.getPattern(a, this, ua(a), Rs.STROKE);
      v = je(a), a.restore(), a.strokeStyle = I;
    }
    let w = e.lineWidth;
    const A = e.textMatrixScale;
    if (A === 0 || w === 0) {
      const I = e.textRenderingMode & js.FILL_STROKE_MASK;
      (I === js.STROKE || I === js.FILL_STROKE) && (w = this.getSinglePixelWidth());
    } else
      w /= A;
    if (r !== 1 && (a.scale(r, r), w /= r), a.lineWidth = w, i.isInvalidPDFjsFont) {
      const I = [];
      let T = 0;
      for (const E of t)
        I.push(E.unicode), T += E.width;
      a.fillText(I.join(""), 0, 0), e.x += T * m * h, a.restore(), this.compose();
      return;
    }
    let x = 0, k;
    for (k = 0; k < u; ++k) {
      const I = t[k];
      if (typeof I == "number") {
        x += d * I * n / 1e3;
        continue;
      }
      let T = !1;
      const E = (I.isSpace ? l : 0) + o, M = I.fontChar, F = I.accent;
      let L, Y, B = I.width;
      if (f) {
        const H = I.vmetric || p, P = -(I.vmetric ? H[1] : B * 0.5) * m, G = H[2] * m;
        B = H ? -H[0] : B, L = P / r, Y = (x + G) / r;
      } else
        L = x / r, Y = 0;
      if (i.remeasure && B > 0) {
        const H = a.measureText(M).width * 1e3 / n * r;
        if (B < H && this.isFontSubpixelAAEnabled) {
          const P = B / H;
          T = !0, a.save(), a.scale(P, 1), L /= P;
        } else B !== H && (L += (B - H) / 2e3 * n / r);
      }
      if (this.contentVisible && (I.isInFont || i.missingFile)) {
        if (b && !F)
          a.fillText(M, L, Y);
        else if (this.paintChar(M, L, Y, y, v), F) {
          const H = L + n * F.offset.x / r, P = Y - n * F.offset.y / r;
          this.paintChar(F.fontChar, H, P, y, v);
        }
      }
      const et = f ? B * m - E * c : B * m + E * c;
      x += et, T && a.restore();
    }
    f ? e.y -= x : e.x += x * h, a.restore(), this.compose();
  }
  showType3Text(t) {
    const e = this.ctx, i = this.current, n = i.font, a = i.fontSize, r = i.fontDirection, o = n.vertical ? 1 : -1, l = i.charSpacing, c = i.wordSpacing, h = i.textHScale * r, u = i.fontMatrix || h5, f = t.length, d = i.textRenderingMode === js.INVISIBLE;
    let p, m, b, y;
    if (!(d || a === 0)) {
      for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, e.save(), i.textMatrix && e.transform(...i.textMatrix), e.translate(i.x, i.y + i.textRise), e.scale(h, r), p = 0; p < f; ++p) {
        if (m = t[p], typeof m == "number") {
          y = o * m * a / 1e3, this.ctx.translate(y, 0), i.x += y * h;
          continue;
        }
        const v = (m.isSpace ? c : 0) + l, w = n.charProcOperatorList[m.operatorListId];
        w ? this.contentVisible && (this.save(), e.scale(a, a), e.transform(...u), this.executeOperatorList(w), this.restore()) : zt(`Type3 character "${m.operatorListId}" is not available.`);
        const A = [m.width, 0];
        Dt.applyTransform(A, u), b = A[0] * a + v, e.translate(b, 0), i.x += b * h;
      }
      e.restore();
    }
  }
  setCharWidth(t, e) {
  }
  setCharWidthAndBounds(t, e, i, n, a, r) {
    const o = new Path2D();
    o.rect(i, n, a - i, r - n), this.ctx.clip(o), this.endPath();
  }
  getColorN_Pattern(t) {
    let e;
    if (t[0] === "TilingPattern") {
      const i = this.baseTransform || je(this.ctx), n = {
        createCanvasGraphics: (a) => new i8(a, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
          optionalContentConfig: this.optionalContentConfig,
          markedContentStack: this.markedContentStack
        })
      };
      e = new P5(t, this.ctx, n, i);
    } else
      e = this._getPattern(t[1], t[2]);
    return e;
  }
  setStrokeColorN() {
    this.current.strokeColor = this.getColorN_Pattern(arguments), this.current.patternStroke = !0;
  }
  setFillColorN() {
    this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
  }
  setStrokeRGBColor(t) {
    this.ctx.strokeStyle = this.current.strokeColor = t, this.current.patternStroke = !1;
  }
  setStrokeTransparent() {
    this.ctx.strokeStyle = this.current.strokeColor = "transparent", this.current.patternStroke = !1;
  }
  setFillRGBColor(t) {
    this.ctx.fillStyle = this.current.fillColor = t, this.current.patternFill = !1;
  }
  setFillTransparent() {
    this.ctx.fillStyle = this.current.fillColor = "transparent", this.current.patternFill = !1;
  }
  _getPattern(t, e = null) {
    let i;
    return this.cachedPatterns.has(t) ? i = this.cachedPatterns.get(t) : (i = uS(this.getObject(t)), this.cachedPatterns.set(t, i)), e && (i.matrix = e), i;
  }
  shadingFill(t) {
    if (!this.contentVisible)
      return;
    const e = this.ctx;
    this.save();
    const i = this._getPattern(t);
    e.fillStyle = i.getPattern(e, this, ua(e), Rs.SHADING);
    const n = ua(e);
    if (n) {
      const {
        width: a,
        height: r
      } = e.canvas, o = $h.slice();
      Dt.axialAlignedBoundingBox([0, 0, a, r], n, o);
      const [l, c, h, u] = o;
      this.ctx.fillRect(l, c, h - l, u - c);
    } else
      this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
    this.compose(this.current.getClippedPathBoundingBox()), this.restore();
  }
  beginInlineImage() {
    Ae("Should not call beginInlineImage");
  }
  beginImageData() {
    Ae("Should not call beginImageData");
  }
  paintFormXObjectBegin(t, e) {
    if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), t && this.transform(...t), this.baseTransform = je(this.ctx), e)) {
      Dt.axialAlignedBoundingBox(e, this.baseTransform, this.current.minMax);
      const [i, n, a, r] = e, o = new Path2D();
      o.rect(i, n, a - i, r - n), this.ctx.clip(o), this.endPath();
    }
  }
  paintFormXObjectEnd() {
    this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
  }
  beginGroup(t) {
    if (!this.contentVisible)
      return;
    this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
    const e = this.ctx;
    t.isolated || U9("TODO: Support non-isolated groups."), t.knockout && zt("Knockout groups not supported.");
    const i = je(e);
    if (t.matrix && e.transform(...t.matrix), !t.bbox)
      throw new Error("Bounding box is required.");
    let n = $h.slice();
    Dt.axialAlignedBoundingBox(t.bbox, je(e), n);
    const a = [0, 0, e.canvas.width, e.canvas.height];
    n = Dt.intersect(n, a) || [0, 0, 0, 0];
    const r = Math.floor(n[0]), o = Math.floor(n[1]), l = Math.max(Math.ceil(n[2]) - r, 1), c = Math.max(Math.ceil(n[3]) - o, 1);
    this.current.startNewPathAndClipBox([0, 0, l, c]);
    let h = "groupAt" + this.groupLevel;
    t.smask && (h += "_smask_" + this.smaskCounter++ % 2);
    const u = this.cachedCanvases.getCanvas(h, l, c), f = u.context;
    f.translate(-r, -o), f.transform(...i);
    let d = new Path2D();
    const [p, m, b, y] = t.bbox;
    if (d.rect(p, m, b - p, y - m), t.matrix) {
      const v = new Path2D();
      v.addPath(d, new DOMMatrix(t.matrix)), d = v;
    }
    f.clip(d), t.smask ? this.smaskStack.push({
      canvas: u.canvas,
      context: f,
      offsetX: r,
      offsetY: o,
      subtype: t.smask.subtype,
      backdrop: t.smask.backdrop,
      transferMap: t.smask.transferMap || null,
      startTransformInverse: null
    }) : (e.setTransform(1, 0, 0, 1, 0, 0), e.translate(r, o), e.save()), $1(e, f), this.ctx = f, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(e), this.groupLevel++;
  }
  endGroup(t) {
    if (!this.contentVisible)
      return;
    this.groupLevel--;
    const e = this.ctx, i = this.groupStack.pop();
    if (this.ctx = i, this.ctx.imageSmoothingEnabled = !1, t.smask)
      this.tempSMask = this.smaskStack.pop(), this.restore();
    else {
      this.ctx.restore();
      const n = je(this.ctx);
      this.restore(), this.ctx.save(), this.ctx.setTransform(...n);
      const a = $h.slice();
      Dt.axialAlignedBoundingBox([0, 0, e.canvas.width, e.canvas.height], n, a), this.ctx.drawImage(e.canvas, 0, 0), this.ctx.restore(), this.compose(a);
    }
  }
  beginAnnotation(t, e, i, n, a) {
    if (C(this, oa, D5).call(this), O2(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), e) {
      const r = e[2] - e[0], o = e[3] - e[1];
      if (a && this.annotationCanvasMap) {
        i = i.slice(), i[4] -= e[0], i[5] -= e[1], e = e.slice(), e[0] = e[1] = 0, e[2] = r, e[3] = o, Dt.singularValueDecompose2dScale(je(this.ctx), Xi);
        const {
          viewportScale: l
        } = this, c = Math.ceil(r * this.outputScaleX * l), h = Math.ceil(o * this.outputScaleY * l);
        this.annotationCanvas = this.canvasFactory.create(c, h);
        const {
          canvas: u,
          context: f
        } = this.annotationCanvas;
        this.annotationCanvasMap.set(t, u), this.annotationCanvas.savedCtx = this.ctx, this.ctx = f, this.ctx.save(), this.ctx.setTransform(Xi[0], 0, 0, -Xi[1], 0, o * Xi[1]), O2(this.ctx);
      } else {
        O2(this.ctx), this.endPath();
        const l = new Path2D();
        l.rect(e[0], e[1], r, o), this.ctx.clip(l);
      }
    }
    this.current = new C8(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...i), this.transform(...n);
  }
  endAnnotation() {
    this.annotationCanvas && (this.ctx.restore(), C(this, oa, N5).call(this), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
  }
  paintImageMaskXObject(t) {
    if (!this.contentVisible)
      return;
    const e = t.count;
    t = this.getObject(t.data, t), t.count = e;
    const i = this.ctx, n = this._createMaskCanvas(t), a = n.canvas;
    i.save(), i.setTransform(1, 0, 0, 1, 0, 0), i.drawImage(a, n.offsetX, n.offsetY), i.restore(), this.compose();
  }
  paintImageMaskXObjectRepeat(t, e, i = 0, n = 0, a, r) {
    if (!this.contentVisible)
      return;
    t = this.getObject(t.data, t);
    const o = this.ctx;
    o.save();
    const l = je(o);
    o.transform(e, i, n, a, 0, 0);
    const c = this._createMaskCanvas(t);
    o.setTransform(1, 0, 0, 1, c.offsetX - l[4], c.offsetY - l[5]);
    for (let h = 0, u = r.length; h < u; h += 2) {
      const f = Dt.transform(l, [e, i, n, a, r[h], r[h + 1]]);
      o.drawImage(c.canvas, f[4], f[5]);
    }
    o.restore(), this.compose();
  }
  paintImageMaskXObjectGroup(t) {
    if (!this.contentVisible)
      return;
    const e = this.ctx, i = this.current.fillColor, n = this.current.patternFill;
    for (const a of t) {
      const {
        data: r,
        width: o,
        height: l,
        transform: c
      } = a, h = this.cachedCanvases.getCanvas("maskCanvas", o, l), u = h.context;
      u.save();
      const f = this.getObject(r, a);
      _8(u, f), u.globalCompositeOperation = "source-in", u.fillStyle = n ? i.getPattern(u, this, ua(e), Rs.FILL) : i, u.fillRect(0, 0, o, l), u.restore(), e.save(), e.transform(...c), e.scale(1, -1), L2(e, h.canvas, 0, 0, o, l, 0, -1, 1, 1), e.restore();
    }
    this.compose();
  }
  paintImageXObject(t) {
    if (!this.contentVisible)
      return;
    const e = this.getObject(t);
    if (!e) {
      zt("Dependent image isn't ready yet");
      return;
    }
    this.paintInlineImageXObject(e);
  }
  paintImageXObjectRepeat(t, e, i, n) {
    if (!this.contentVisible)
      return;
    const a = this.getObject(t);
    if (!a) {
      zt("Dependent image isn't ready yet");
      return;
    }
    const r = a.width, o = a.height, l = [];
    for (let c = 0, h = n.length; c < h; c += 2)
      l.push({
        transform: [e, 0, 0, i, n[c], n[c + 1]],
        x: 0,
        y: 0,
        w: r,
        h: o
      });
    this.paintInlineImageXObjectGroup(a, l);
  }
  applyTransferMapsToCanvas(t) {
    return this.current.transferMaps !== "none" && (t.filter = this.current.transferMaps, t.drawImage(t.canvas, 0, 0), t.filter = "none"), t.canvas;
  }
  applyTransferMapsToBitmap(t) {
    if (this.current.transferMaps === "none")
      return t.bitmap;
    const {
      bitmap: e,
      width: i,
      height: n
    } = t, a = this.cachedCanvases.getCanvas("inlineImage", i, n), r = a.context;
    return r.filter = this.current.transferMaps, r.drawImage(e, 0, 0), r.filter = "none", a.canvas;
  }
  paintInlineImageXObject(t) {
    if (!this.contentVisible)
      return;
    const e = t.width, i = t.height, n = this.ctx;
    this.save();
    const {
      filter: a
    } = n;
    a !== "none" && a !== "" && (n.filter = "none"), n.scale(1 / e, -1 / i);
    let r;
    if (t.bitmap)
      r = this.applyTransferMapsToBitmap(t);
    else if (typeof HTMLElement == "function" && t instanceof HTMLElement || !t.data)
      r = t;
    else {
      const c = this.cachedCanvases.getCanvas("inlineImage", e, i).context;
      I8(c, t), r = this.applyTransferMapsToCanvas(c);
    }
    const o = this._scaleImage(r, ua(n));
    n.imageSmoothingEnabled = T8(je(n), t.interpolate), L2(n, o.img, 0, 0, o.paintWidth, o.paintHeight, 0, -i, e, i), this.compose(), this.restore();
  }
  paintInlineImageXObjectGroup(t, e) {
    if (!this.contentVisible)
      return;
    const i = this.ctx;
    let n;
    if (t.bitmap)
      n = t.bitmap;
    else {
      const a = t.width, r = t.height, l = this.cachedCanvases.getCanvas("inlineImage", a, r).context;
      I8(l, t), n = this.applyTransferMapsToCanvas(l);
    }
    for (const a of e)
      i.save(), i.transform(...a.transform), i.scale(1, -1), L2(i, n, a.x, a.y, a.w, a.h, 0, -1, 1, 1), i.restore();
    this.compose();
  }
  paintSolidColorImageMask() {
    this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
  }
  markPoint(t) {
  }
  markPointProps(t, e) {
  }
  beginMarkedContent(t) {
    this.markedContentStack.push({
      visible: !0
    });
  }
  beginMarkedContentProps(t, e) {
    t === "OC" ? this.markedContentStack.push({
      visible: this.optionalContentConfig.isVisible(e)
    }) : this.markedContentStack.push({
      visible: !0
    }), this.contentVisible = this.isContentVisible();
  }
  endMarkedContent() {
    this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
  }
  beginCompat() {
  }
  endCompat() {
  }
  consumePath(t, e) {
    const i = this.current.isEmptyClip();
    this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(e);
    const n = this.ctx;
    this.pendingClip && (i || (this.pendingClip === E8 ? n.clip(t, "evenodd") : n.clip(t)), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox);
  }
  getSinglePixelWidth() {
    if (!this._cachedGetSinglePixelWidth) {
      const t = je(this.ctx);
      if (t[1] === 0 && t[2] === 0)
        this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(t[0]), Math.abs(t[3]));
      else {
        const e = Math.abs(t[0] * t[3] - t[2] * t[1]), i = Math.hypot(t[0], t[2]), n = Math.hypot(t[1], t[3]);
        this._cachedGetSinglePixelWidth = Math.max(i, n) / e;
      }
    }
    return this._cachedGetSinglePixelWidth;
  }
  getScaleForStroking() {
    if (this._cachedScaleForStroking[0] === -1) {
      const {
        lineWidth: t
      } = this.current, {
        a: e,
        b: i,
        c: n,
        d: a
      } = this.ctx.getTransform();
      let r, o;
      if (i === 0 && n === 0) {
        const l = Math.abs(e), c = Math.abs(a);
        if (l === c)
          if (t === 0)
            r = o = 1 / l;
          else {
            const h = l * t;
            r = o = h < 1 ? 1 / h : 1;
          }
        else if (t === 0)
          r = 1 / l, o = 1 / c;
        else {
          const h = l * t, u = c * t;
          r = h < 1 ? 1 / h : 1, o = u < 1 ? 1 / u : 1;
        }
      } else {
        const l = Math.abs(e * a - i * n), c = Math.hypot(e, i), h = Math.hypot(n, a);
        if (t === 0)
          r = h / l, o = c / l;
        else {
          const u = t * l;
          r = h > u ? h / u : 1, o = c > u ? c / u : 1;
        }
      }
      this._cachedScaleForStroking[0] = r, this._cachedScaleForStroking[1] = o;
    }
    return this._cachedScaleForStroking;
  }
  rescaleAndStroke(t, e) {
    const {
      ctx: i,
      current: {
        lineWidth: n
      }
    } = this, [a, r] = this.getScaleForStroking();
    if (a === r) {
      i.lineWidth = (n || 1) * a, i.stroke(t);
      return;
    }
    const o = i.getLineDash();
    e && i.save(), i.scale(a, r), mm.a = 1 / a, mm.d = 1 / r;
    const l = new Path2D();
    if (l.addPath(t, mm), o.length > 0) {
      const c = Math.max(a, r);
      i.setLineDash(o.map((h) => h / c)), i.lineDashOffset /= c;
    }
    i.lineWidth = n || 1, i.stroke(l), e && i.restore();
  }
  isContentVisible() {
    for (let t = this.markedContentStack.length - 1; t >= 0; t--)
      if (!this.markedContentStack[t].visible)
        return !1;
    return !0;
  }
};
oa = new WeakSet(), D5 = function() {
  for (; this.stateStack.length || this.inSMaskMode; )
    this.restore();
  this.current.activeSMask = null, 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);
}, N5 = function() {
  if (this.pageColors) {
    const t = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
    if (t !== "none") {
      const e = this.ctx.filter;
      this.ctx.filter = t, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = e;
    }
  }
}, B5 = function(t, e, i) {
  const n = new Path2D();
  return n.addPath(t, new DOMMatrix(i).invertSelf().multiplySelf(e)), n;
};
let eu = i8;
for (const s in Jd)
  eu.prototype[s] !== void 0 && (eu.prototype[Jd[s]] = eu.prototype[s]);
var X0, K0;
class wn {
  static get workerPort() {
    return g(this, X0);
  }
  static set workerPort(t) {
    if (!(typeof Worker < "u" && t instanceof Worker) && t !== null)
      throw new Error("Invalid `workerPort` type.");
    S(this, X0, t);
  }
  static get workerSrc() {
    return g(this, K0);
  }
  static set workerSrc(t) {
    if (typeof t != "string")
      throw new Error("Invalid `workerSrc` type.");
    S(this, K0, t);
  }
}
X0 = new WeakMap(), K0 = new WeakMap(), _(wn, X0, null), _(wn, K0, "");
var _u, Y0;
class wS {
  constructor({
    parsedData: t,
    rawData: e
  }) {
    _(this, _u);
    _(this, Y0);
    S(this, _u, t), S(this, Y0, e);
  }
  getRaw() {
    return g(this, Y0);
  }
  get(t) {
    return g(this, _u).get(t) ?? null;
  }
  [Symbol.iterator]() {
    return g(this, _u).entries();
  }
}
_u = new WeakMap(), Y0 = new WeakMap();
const Ph = Symbol("INTERNAL");
var J0, Z0, Q0, Tu;
class vS {
  constructor(t, {
    name: e,
    intent: i,
    usage: n,
    rbGroups: a
  }) {
    _(this, J0, !1);
    _(this, Z0, !1);
    _(this, Q0, !1);
    _(this, Tu, !0);
    S(this, J0, !!(t & Wi.DISPLAY)), S(this, Z0, !!(t & Wi.PRINT)), this.name = e, this.intent = i, this.usage = n, this.rbGroups = a;
  }
  get visible() {
    if (g(this, Q0))
      return g(this, Tu);
    if (!g(this, Tu))
      return !1;
    const {
      print: t,
      view: e
    } = this.usage;
    return g(this, J0) ? (e == null ? void 0 : e.viewState) !== "OFF" : g(this, Z0) ? (t == null ? void 0 : t.printState) !== "OFF" : !0;
  }
  _setVisible(t, e, i = !1) {
    t !== Ph && Ae("Internal method `_setVisible` called."), S(this, Q0, i), S(this, Tu, e);
  }
}
J0 = new WeakMap(), Z0 = new WeakMap(), Q0 = new WeakMap(), Tu = new WeakMap();
var _o, we, Eu, Mu, tf, L5;
class AS {
  constructor(t, e = Wi.DISPLAY) {
    _(this, tf);
    _(this, _o, null);
    _(this, we, /* @__PURE__ */ new Map());
    _(this, Eu, null);
    _(this, Mu, null);
    if (this.renderingIntent = e, this.name = null, this.creator = null, t !== null) {
      this.name = t.name, this.creator = t.creator, S(this, Mu, t.order);
      for (const i of t.groups)
        g(this, we).set(i.id, new vS(e, i));
      if (t.baseState === "OFF")
        for (const i of g(this, we).values())
          i._setVisible(Ph, !1);
      for (const i of t.on)
        g(this, we).get(i)._setVisible(Ph, !0);
      for (const i of t.off)
        g(this, we).get(i)._setVisible(Ph, !1);
      S(this, Eu, this.getHash());
    }
  }
  isVisible(t) {
    if (g(this, we).size === 0)
      return !0;
    if (!t)
      return U9("Optional content group not defined."), !0;
    if (t.type === "OCG")
      return g(this, we).has(t.id) ? g(this, we).get(t.id).visible : (zt(`Optional content group not found: ${t.id}`), !0);
    if (t.type === "OCMD") {
      if (t.expression)
        return C(this, tf, L5).call(this, t.expression);
      if (!t.policy || t.policy === "AnyOn") {
        for (const e of t.ids) {
          if (!g(this, we).has(e))
            return zt(`Optional content group not found: ${e}`), !0;
          if (g(this, we).get(e).visible)
            return !0;
        }
        return !1;
      } else if (t.policy === "AllOn") {
        for (const e of t.ids) {
          if (!g(this, we).has(e))
            return zt(`Optional content group not found: ${e}`), !0;
          if (!g(this, we).get(e).visible)
            return !1;
        }
        return !0;
      } else if (t.policy === "AnyOff") {
        for (const e of t.ids) {
          if (!g(this, we).has(e))
            return zt(`Optional content group not found: ${e}`), !0;
          if (!g(this, we).get(e).visible)
            return !0;
        }
        return !1;
      } else if (t.policy === "AllOff") {
        for (const e of t.ids) {
          if (!g(this, we).has(e))
            return zt(`Optional content group not found: ${e}`), !0;
          if (g(this, we).get(e).visible)
            return !1;
        }
        return !0;
      }
      return zt(`Unknown optional content policy ${t.policy}.`), !0;
    }
    return zt(`Unknown group type ${t.type}.`), !0;
  }
  setVisibility(t, e = !0, i = !0) {
    var a;
    const n = g(this, we).get(t);
    if (!n) {
      zt(`Optional content group not found: ${t}`);
      return;
    }
    if (i && e && n.rbGroups.length)
      for (const r of n.rbGroups)
        for (const o of r)
          o !== t && ((a = g(this, we).get(o)) == null || a._setVisible(Ph, !1, !0));
    n._setVisible(Ph, !!e, !0), S(this, _o, null);
  }
  setOCGState({
    state: t,
    preserveRB: e
  }) {
    let i;
    for (const n of t) {
      switch (n) {
        case "ON":
        case "OFF":
        case "Toggle":
          i = n;
          continue;
      }
      const a = g(this, we).get(n);
      if (a)
        switch (i) {
          case "ON":
            this.setVisibility(n, !0, e);
            break;
          case "OFF":
            this.setVisibility(n, !1, e);
            break;
          case "Toggle":
            this.setVisibility(n, !a.visible, e);
            break;
        }
    }
    S(this, _o, null);
  }
  get hasInitialVisibility() {
    return g(this, Eu) === null || this.getHash() === g(this, Eu);
  }
  getOrder() {
    return g(this, we).size ? g(this, Mu) ? g(this, Mu).slice() : [...g(this, we).keys()] : null;
  }
  getGroup(t) {
    return g(this, we).get(t) || null;
  }
  getHash() {
    if (g(this, _o) !== null)
      return g(this, _o);
    const t = new Jy();
    for (const [e, i] of g(this, we))
      t.update(`${e}:${i.visible}`);
    return S(this, _o, t.hexdigest());
  }
  [Symbol.iterator]() {
    return g(this, we).entries();
  }
}
_o = new WeakMap(), we = new WeakMap(), Eu = new WeakMap(), Mu = new WeakMap(), tf = new WeakSet(), L5 = function(t) {
  const e = t.length;
  if (e < 2)
    return !0;
  const i = t[0];
  for (let n = 1; n < e; n++) {
    const a = t[n];
    let r;
    if (Array.isArray(a))
      r = C(this, tf, L5).call(this, a);
    else if (g(this, we).has(a))
      r = g(this, we).get(a).visible;
    else
      return zt(`Optional content group not found: ${a}`), !0;
    switch (i) {
      case "And":
        if (!r)
          return !1;
        break;
      case "Or":
        if (r)
          return !0;
        break;
      case "Not":
        return !r;
      default:
        return !0;
    }
  }
  return i === "And";
};
class xS {
  constructor(t, {
    disableRange: e = !1,
    disableStream: i = !1
  }) {
    is(t, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
    const {
      length: n,
      initialData: a,
      progressiveDone: r,
      contentDispositionFilename: o
    } = t;
    if (this._queuedChunks = [], this._progressiveDone = r, this._contentDispositionFilename = o, (a == null ? void 0 : a.length) > 0) {
      const l = a instanceof Uint8Array && a.byteLength === a.buffer.byteLength ? a.buffer : new Uint8Array(a).buffer;
      this._queuedChunks.push(l);
    }
    this._pdfDataRangeTransport = t, this._isStreamingSupported = !i, this._isRangeSupported = !e, this._contentLength = n, this._fullRequestReader = null, this._rangeReaders = [], t.addRangeListener((l, c) => {
      this._onReceiveData({
        begin: l,
        chunk: c
      });
    }), t.addProgressListener((l, c) => {
      this._onProgress({
        loaded: l,
        total: c
      });
    }), t.addProgressiveReadListener((l) => {
      this._onReceiveData({
        chunk: l
      });
    }), t.addProgressiveDoneListener(() => {
      this._onProgressiveDone();
    }), t.transportReady();
  }
  _onReceiveData({
    begin: t,
    chunk: e
  }) {
    const i = e instanceof Uint8Array && e.byteLength === e.buffer.byteLength ? e.buffer : new Uint8Array(e).buffer;
    if (t === void 0)
      this._fullRequestReader ? this._fullRequestReader._enqueue(i) : this._queuedChunks.push(i);
    else {
      const n = this._rangeReaders.some(function(a) {
        return a._begin !== t ? !1 : (a._enqueue(i), !0);
      });
      is(n, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
    }
  }
  get _progressiveDataLength() {
    var t;
    return ((t = this._fullRequestReader) == null ? void 0 : t._loaded) ?? 0;
  }
  _onProgress(t) {
    var e, i, n, a;
    t.total === void 0 ? (i = (e = this._rangeReaders[0]) == null ? void 0 : e.onProgress) == null || i.call(e, {
      loaded: t.loaded
    }) : (a = (n = this._fullRequestReader) == null ? void 0 : n.onProgress) == null || a.call(n, {
      loaded: t.loaded,
      total: t.total
    });
  }
  _onProgressiveDone() {
    var t;
    (t = this._fullRequestReader) == null || t.progressiveDone(), this._progressiveDone = !0;
  }
  _removeRangeReader(t) {
    const e = this._rangeReaders.indexOf(t);
    e >= 0 && this._rangeReaders.splice(e, 1);
  }
  getFullReader() {
    is(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
    const t = this._queuedChunks;
    return this._queuedChunks = null, new kS(this, t, this._progressiveDone, this._contentDispositionFilename);
  }
  getRangeReader(t, e) {
    if (e <= this._progressiveDataLength)
      return null;
    const i = new SS(this, t, e);
    return this._pdfDataRangeTransport.requestDataRange(t, e), this._rangeReaders.push(i), i;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const i of this._rangeReaders.slice(0))
      i.cancel(t);
    this._pdfDataRangeTransport.abort();
  }
}
class kS {
  constructor(t, e, i = !1, n = null) {
    this._stream = t, this._done = i || !1, this._filename = j9(n) ? n : null, this._queuedChunks = e || [], this._loaded = 0;
    for (const a of this._queuedChunks)
      this._loaded += a.byteLength;
    this._requests = [], this._headersReady = Promise.resolve(), t._fullRequestReader = this, this.onProgress = null;
  }
  _enqueue(t) {
    this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
      value: t,
      done: !1
    }) : this._queuedChunks.push(t), this._loaded += t.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 t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0;
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0;
  }
  progressiveDone() {
    this._done || (this._done = !0);
  }
}
class SS {
  constructor(t, e, i) {
    this._stream = t, this._begin = e, this._end = i, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
  }
  _enqueue(t) {
    if (!this._done) {
      if (this._requests.length === 0)
        this._queuedChunk = t;
      else {
        this._requests.shift().resolve({
          value: t,
          done: !1
        });
        for (const i of this._requests)
          i.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 e = this._queuedChunk;
      return this._queuedChunk = null, {
        value: e,
        done: !1
      };
    }
    if (this._done)
      return {
        value: void 0,
        done: !0
      };
    const t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0;
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._stream._removeRangeReader(this);
  }
}
function CS(s) {
  let t = !0, e = i("filename\\*", "i").exec(s);
  if (e) {
    e = e[1];
    let h = o(e);
    return h = unescape(h), h = l(h), h = c(h), a(h);
  }
  if (e = r(s), e) {
    const h = c(e);
    return a(h);
  }
  if (e = i("filename", "i").exec(s), e) {
    e = e[1];
    let h = o(e);
    return h = c(h), a(h);
  }
  function i(h, u) {
    return new RegExp("(?:^|;)\\s*" + h + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', u);
  }
  function n(h, u) {
    if (h) {
      if (!/^[\x00-\xFF]+$/.test(u))
        return u;
      try {
        const f = new TextDecoder(h, {
          fatal: !0
        }), d = p2(u);
        u = f.decode(d), t = !1;
      } catch {
      }
    }
    return u;
  }
  function a(h) {
    return t && /[\x80-\xff]/.test(h) && (h = n("utf-8", h), t && (h = n("iso-8859-1", h))), h;
  }
  function r(h) {
    const u = [];
    let f;
    const d = i("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
    for (; (f = d.exec(h)) !== null; ) {
      let [, m, b, y] = f;
      if (m = parseInt(m, 10), m in u) {
        if (m === 0)
          break;
        continue;
      }
      u[m] = [b, y];
    }
    const p = [];
    for (let m = 0; m < u.length && m in u; ++m) {
      let [b, y] = u[m];
      y = o(y), b && (y = unescape(y), m === 0 && (y = l(y))), p.push(y);
    }
    return p.join("");
  }
  function o(h) {
    if (h.startsWith('"')) {
      const u = h.slice(1).split('\\"');
      for (let f = 0; f < u.length; ++f) {
        const d = u[f].indexOf('"');
        d !== -1 && (u[f] = u[f].slice(0, d), u.length = f + 1), u[f] = u[f].replaceAll(/\\(.)/g, "$1");
      }
      h = u.join('"');
    }
    return h;
  }
  function l(h) {
    const u = h.indexOf("'");
    if (u === -1)
      return h;
    const f = h.slice(0, u), p = h.slice(u + 1).replace(/^[^']*'/, "");
    return n(f, p);
  }
  function c(h) {
    return !h.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(h) ? h : h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(u, f, d, p) {
      if (d === "q" || d === "Q")
        return p = p.replaceAll("_", " "), p = p.replaceAll(/=([0-9a-fA-F]{2})/g, function(m, b) {
          return String.fromCharCode(parseInt(b, 16));
        }), n(f, p);
      try {
        p = atob(p);
      } catch {
      }
      return n(f, p);
    });
  }
  return "";
}
function hw(s, t) {
  const e = new Headers();
  if (!s || !t || typeof t != "object")
    return e;
  for (const i in t) {
    const n = t[i];
    n !== void 0 && e.append(i, n);
  }
  return e;
}
function $9(s) {
  var t;
  return ((t = URL.parse(s)) == null ? void 0 : t.origin) ?? null;
}
function uw({
  responseHeaders: s,
  isHttp: t,
  rangeChunkSize: e,
  disableRange: i
}) {
  const n = {
    allowRangeRequests: !1,
    suggestedLength: void 0
  }, a = parseInt(s.get("Content-Length"), 10);
  return !Number.isInteger(a) || (n.suggestedLength = a, a <= 2 * e) || i || !t || s.get("Accept-Ranges") !== "bytes" || (s.get("Content-Encoding") || "identity") !== "identity" || (n.allowRangeRequests = !0), n;
}
function dw(s) {
  const t = s.get("Content-Disposition");
  if (t) {
    let e = CS(t);
    if (e.includes("%"))
      try {
        e = decodeURIComponent(e);
      } catch {
      }
    if (j9(e))
      return e;
  }
  return null;
}
function w2(s, t) {
  return new Zd(`Unexpected server response (${s}) while retrieving PDF "${t}".`, s, s === 404 || s === 0 && t.startsWith("file:"));
}
function fw(s) {
  return s === 200 || s === 206;
}
function gw(s, t, e) {
  return {
    method: "GET",
    headers: s,
    signal: e.signal,
    mode: "cors",
    credentials: t ? "include" : "same-origin",
    redirect: "follow"
  };
}
function pw(s) {
  return s instanceof Uint8Array ? s.buffer : s instanceof ArrayBuffer ? s : (zt(`getArrayBuffer - unexpected data format: ${s}`), new Uint8Array(s).buffer);
}
class IS {
  constructor(t) {
    ht(this, "_responseOrigin", null);
    this.source = t, this.isHttp = /^https?:/i.test(t.url), this.headers = hw(this.isHttp, t.httpHeaders), this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  get _progressiveDataLength() {
    var t;
    return ((t = this._fullRequestReader) == null ? void 0 : t._loaded) ?? 0;
  }
  getFullReader() {
    return is(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new _S(this), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    if (e <= this._progressiveDataLength)
      return null;
    const i = new TS(this, t, e);
    return this._rangeRequestReaders.push(i), i;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const i of this._rangeRequestReaders.slice(0))
      i.cancel(t);
  }
}
class _S {
  constructor(t) {
    this._stream = t, this._reader = null, this._loaded = 0, this._filename = null;
    const e = t.source;
    this._withCredentials = e.withCredentials || !1, this._contentLength = e.length, this._headersCapability = Promise.withResolvers(), this._disableRange = e.disableRange || !1, this._rangeChunkSize = e.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !e.disableStream, this._isRangeSupported = !e.disableRange;
    const i = new Headers(t.headers), n = e.url;
    fetch(n, gw(i, this._withCredentials, this._abortController)).then((a) => {
      if (t._responseOrigin = $9(a.url), !fw(a.status))
        throw w2(a.status, n);
      this._reader = a.body.getReader(), this._headersCapability.resolve();
      const r = a.headers, {
        allowRangeRequests: o,
        suggestedLength: l
      } = uw({
        responseHeaders: r,
        isHttp: t.isHttp,
        rangeChunkSize: this._rangeChunkSize,
        disableRange: this._disableRange
      });
      this._isRangeSupported = o, this._contentLength = l || this._contentLength, this._filename = dw(r), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new Gr("Streaming is disabled."));
    }).catch(this._headersCapability.reject), this.onProgress = null;
  }
  get headersReady() {
    return this._headersCapability.promise;
  }
  get filename() {
    return this._filename;
  }
  get contentLength() {
    return this._contentLength;
  }
  get isRangeSupported() {
    return this._isRangeSupported;
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  async read() {
    var i;
    await this._headersCapability.promise;
    const {
      value: t,
      done: e
    } = await this._reader.read();
    return e ? {
      value: t,
      done: e
    } : (this._loaded += t.byteLength, (i = this.onProgress) == null || i.call(this, {
      loaded: this._loaded,
      total: this._contentLength
    }), {
      value: pw(t),
      done: !1
    });
  }
  cancel(t) {
    var e;
    (e = this._reader) == null || e.cancel(t), this._abortController.abort();
  }
}
class TS {
  constructor(t, e, i) {
    this._stream = t, this._reader = null, this._loaded = 0;
    const n = t.source;
    this._withCredentials = n.withCredentials || !1, this._readCapability = Promise.withResolvers(), this._isStreamingSupported = !n.disableStream, this._abortController = new AbortController();
    const a = new Headers(t.headers);
    a.append("Range", `bytes=${e}-${i - 1}`);
    const r = n.url;
    fetch(r, gw(a, this._withCredentials, this._abortController)).then((o) => {
      const l = $9(o.url);
      if (l !== t._responseOrigin)
        throw new Error(`Expected range response-origin "${l}" to match "${t._responseOrigin}".`);
      if (!fw(o.status))
        throw w2(o.status, r);
      this._readCapability.resolve(), this._reader = o.body.getReader();
    }).catch(this._readCapability.reject), this.onProgress = null;
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  async read() {
    var i;
    await this._readCapability.promise;
    const {
      value: t,
      done: e
    } = await this._reader.read();
    return e ? {
      value: t,
      done: e
    } : (this._loaded += t.byteLength, (i = this.onProgress) == null || i.call(this, {
      loaded: this._loaded
    }), {
      value: pw(t),
      done: !1
    });
  }
  cancel(t) {
    var e;
    (e = this._reader) == null || e.cancel(t), this._abortController.abort();
  }
}
const bm = 200, ym = 206;
function ES(s) {
  const t = s.response;
  return typeof t != "string" ? t : p2(t).buffer;
}
class MS {
  constructor({
    url: t,
    httpHeaders: e,
    withCredentials: i
  }) {
    ht(this, "_responseOrigin", null);
    this.url = t, this.isHttp = /^https?:/i.test(t), this.headers = hw(this.isHttp, e), this.withCredentials = i || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
  }
  request(t) {
    const e = new XMLHttpRequest(), i = this.currXhrId++, n = this.pendingRequests[i] = {
      xhr: e
    };
    e.open("GET", this.url), e.withCredentials = this.withCredentials;
    for (const [a, r] of this.headers)
      e.setRequestHeader(a, r);
    return this.isHttp && "begin" in t && "end" in t ? (e.setRequestHeader("Range", `bytes=${t.begin}-${t.end - 1}`), n.expectedStatus = ym) : n.expectedStatus = bm, e.responseType = "arraybuffer", is(t.onError, "Expected `onError` callback to be provided."), e.onerror = () => {
      t.onError(e.status);
    }, e.onreadystatechange = this.onStateChange.bind(this, i), e.onprogress = this.onProgress.bind(this, i), n.onHeadersReceived = t.onHeadersReceived, n.onDone = t.onDone, n.onError = t.onError, n.onProgress = t.onProgress, e.send(null), i;
  }
  onProgress(t, e) {
    var n;
    const i = this.pendingRequests[t];
    i && ((n = i.onProgress) == null || n.call(i, e));
  }
  onStateChange(t, e) {
    const i = this.pendingRequests[t];
    if (!i)
      return;
    const n = i.xhr;
    if (n.readyState >= 2 && i.onHeadersReceived && (i.onHeadersReceived(), delete i.onHeadersReceived), n.readyState !== 4 || !(t in this.pendingRequests))
      return;
    if (delete this.pendingRequests[t], n.status === 0 && this.isHttp) {
      i.onError(n.status);
      return;
    }
    const a = n.status || bm;
    if (!(a === bm && i.expectedStatus === ym) && a !== i.expectedStatus) {
      i.onError(n.status);
      return;
    }
    const o = ES(n);
    if (a === ym) {
      const l = n.getResponseHeader("Content-Range"), c = /bytes (\d+)-(\d+)\/(\d+)/.exec(l);
      c ? i.onDone({
        begin: parseInt(c[1], 10),
        chunk: o
      }) : (zt('Missing or invalid "Content-Range" header.'), i.onError(0));
    } else o ? i.onDone({
      begin: 0,
      chunk: o
    }) : i.onError(n.status);
  }
  getRequestXhr(t) {
    return this.pendingRequests[t].xhr;
  }
  isPendingRequest(t) {
    return t in this.pendingRequests;
  }
  abortRequest(t) {
    const e = this.pendingRequests[t].xhr;
    delete this.pendingRequests[t], e.abort();
  }
}
class FS {
  constructor(t) {
    this._source = t, this._manager = new MS(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  _onRangeRequestReaderClosed(t) {
    const e = this._rangeRequestReaders.indexOf(t);
    e >= 0 && this._rangeRequestReaders.splice(e, 1);
  }
  getFullReader() {
    return is(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new RS(this._manager, this._source), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    const i = new PS(this._manager, t, e);
    return i.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(i), i;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const i of this._rangeRequestReaders.slice(0))
      i.cancel(t);
  }
}
class RS {
  constructor(t, e) {
    this._manager = t, this._url = e.url, this._fullRequestId = t.request({
      onHeadersReceived: this._onHeadersReceived.bind(this),
      onDone: this._onDone.bind(this),
      onError: this._onError.bind(this),
      onProgress: this._onProgress.bind(this)
    }), this._headersCapability = Promise.withResolvers(), this._disableRange = e.disableRange || !1, this._contentLength = e.length, this._rangeChunkSize = e.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 t = this._fullRequestId, e = this._manager.getRequestXhr(t);
    this._manager._responseOrigin = $9(e.responseURL);
    const i = e.getAllResponseHeaders(), n = new Headers(i ? i.trimStart().replace(/[^\S ]+$/, "").split(/[\r\n]+/).map((o) => {
      const [l, ...c] = o.split(": ");
      return [l, c.join(": ")];
    }) : []), {
      allowRangeRequests: a,
      suggestedLength: r
    } = uw({
      responseHeaders: n,
      isHttp: this._manager.isHttp,
      rangeChunkSize: this._rangeChunkSize,
      disableRange: this._disableRange
    });
    a && (this._isRangeSupported = !0), this._contentLength = r || this._contentLength, this._filename = dw(n), this._isRangeSupported && this._manager.abortRequest(t), this._headersCapability.resolve();
  }
  _onDone(t) {
    if (t && (this._requests.length > 0 ? this._requests.shift().resolve({
      value: t.chunk,
      done: !1
    }) : this._cachedChunks.push(t.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
      for (const e of this._requests)
        e.resolve({
          value: void 0,
          done: !0
        });
      this._requests.length = 0;
    }
  }
  _onError(t) {
    this._storedError = w2(t, this._url), this._headersCapability.reject(this._storedError);
    for (const e of this._requests)
      e.reject(this._storedError);
    this._requests.length = 0, this._cachedChunks.length = 0;
  }
  _onProgress(t) {
    var e;
    (e = this.onProgress) == null || e.call(this, {
      loaded: t.loaded,
      total: t.lengthComputable ? t.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._headersCapability.promise;
  }
  async read() {
    if (await this._headersCapability.promise, 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 t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0, this._headersCapability.reject(t);
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
  }
}
class PS {
  constructor(t, e, i) {
    this._manager = t, this._url = t.url, this._requestId = t.request({
      begin: e,
      end: i,
      onHeadersReceived: this._onHeadersReceived.bind(this),
      onDone: this._onDone.bind(this),
      onError: this._onError.bind(this),
      onProgress: this._onProgress.bind(this)
    }), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
  }
  _onHeadersReceived() {
    var e;
    const t = $9((e = this._manager.getRequestXhr(this._requestId)) == null ? void 0 : e.responseURL);
    t !== this._manager._responseOrigin && (this._storedError = new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`), this._onError(0));
  }
  _close() {
    var t;
    (t = this.onClosed) == null || t.call(this, this);
  }
  _onDone(t) {
    const e = t.chunk;
    this._requests.length > 0 ? this._requests.shift().resolve({
      value: e,
      done: !1
    }) : this._queuedChunk = e, this._done = !0;
    for (const i of this._requests)
      i.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._close();
  }
  _onError(t) {
    this._storedError ?? (this._storedError = w2(t, this._url));
    for (const e of this._requests)
      e.reject(this._storedError);
    this._requests.length = 0, this._queuedChunk = null;
  }
  _onProgress(t) {
    var e;
    this.isStreamingSupported || (e = this.onProgress) == null || e.call(this, {
      loaded: t.loaded
    });
  }
  get isStreamingSupported() {
    return !1;
  }
  async read() {
    if (this._storedError)
      throw this._storedError;
    if (this._queuedChunk !== null) {
      const e = this._queuedChunk;
      return this._queuedChunk = null, {
        value: e,
        done: !1
      };
    }
    if (this._done)
      return {
        value: void 0,
        done: !0
      };
    const t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0;
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
  }
}
const DS = /^[a-z][a-z0-9\-+.]+:/i;
function NS(s) {
  if (DS.test(s))
    return new URL(s);
  const t = process.getBuiltinModule("url");
  return new URL(t.pathToFileURL(s));
}
class BS {
  constructor(t) {
    this.source = t, this.url = NS(t.url), is(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  get _progressiveDataLength() {
    var t;
    return ((t = this._fullRequestReader) == null ? void 0 : t._loaded) ?? 0;
  }
  getFullReader() {
    return is(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new LS(this), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    if (e <= this._progressiveDataLength)
      return null;
    const i = new OS(this, t, e);
    return this._rangeRequestReaders.push(i), i;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const i of this._rangeRequestReaders.slice(0))
      i.cancel(t);
  }
}
class LS {
  constructor(t) {
    this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null;
    const e = t.source;
    this._contentLength = e.length, this._loaded = 0, this._filename = null, this._disableRange = e.disableRange || !1, this._rangeChunkSize = e.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !e.disableStream, this._isRangeSupported = !e.disableRange, this._readableStream = null, this._readCapability = Promise.withResolvers(), this._headersCapability = Promise.withResolvers();
    const i = process.getBuiltinModule("fs");
    i.promises.lstat(this._url).then((n) => {
      this._contentLength = n.size, this._setReadableStream(i.createReadStream(this._url)), this._headersCapability.resolve();
    }, (n) => {
      n.code === "ENOENT" && (n = w2(0, this._url.href)), this._storedError = n, this._headersCapability.reject(n);
    });
  }
  get headersReady() {
    return this._headersCapability.promise;
  }
  get filename() {
    return this._filename;
  }
  get contentLength() {
    return this._contentLength;
  }
  get isRangeSupported() {
    return this._isRangeSupported;
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  async read() {
    var i;
    if (await this._readCapability.promise, this._done)
      return {
        value: void 0,
        done: !0
      };
    if (this._storedError)
      throw this._storedError;
    const t = this._readableStream.read();
    return t === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += t.length, (i = this.onProgress) == null || i.call(this, {
      loaded: this._loaded,
      total: this._contentLength
    }), {
      value: new Uint8Array(t).buffer,
      done: !1
    });
  }
  cancel(t) {
    if (!this._readableStream) {
      this._error(t);
      return;
    }
    this._readableStream.destroy(t);
  }
  _error(t) {
    this._storedError = t, this._readCapability.resolve();
  }
  _setReadableStream(t) {
    this._readableStream = t, t.on("readable", () => {
      this._readCapability.resolve();
    }), t.on("end", () => {
      t.destroy(), this._done = !0, this._readCapability.resolve();
    }), t.on("error", (e) => {
      this._error(e);
    }), !this._isStreamingSupported && this._isRangeSupported && this._error(new Gr("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
  }
}
class OS {
  constructor(t, e, i) {
    this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
    const n = t.source;
    this._isStreamingSupported = !n.disableStream;
    const a = process.getBuiltinModule("fs");
    this._setReadableStream(a.createReadStream(this._url, {
      start: e,
      end: i - 1
    }));
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  async read() {
    var i;
    if (await this._readCapability.promise, this._done)
      return {
        value: void 0,
        done: !0
      };
    if (this._storedError)
      throw this._storedError;
    const t = this._readableStream.read();
    return t === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += t.length, (i = this.onProgress) == null || i.call(this, {
      loaded: this._loaded
    }), {
      value: new Uint8Array(t).buffer,
      done: !1
    });
  }
  cancel(t) {
    if (!this._readableStream) {
      this._error(t);
      return;
    }
    this._readableStream.destroy(t);
  }
  _error(t) {
    this._storedError = t, this._readCapability.resolve();
  }
  _setReadableStream(t) {
    this._readableStream = t, t.on("readable", () => {
      this._readCapability.resolve();
    }), t.on("end", () => {
      t.destroy(), this._done = !0, this._readCapability.resolve();
    }), t.on("error", (e) => {
      this._error(e);
    }), this._storedError && this._readableStream.destroy(this._storedError);
  }
}
const z1 = Symbol("INITIAL_DATA");
var Li, ef, O5;
class mw {
  constructor() {
    _(this, ef);
    _(this, Li, /* @__PURE__ */ Object.create(null));
  }
  get(t, e = null) {
    if (e) {
      const n = C(this, ef, O5).call(this, t);
      return n.promise.then(() => e(n.data)), null;
    }
    const i = g(this, Li)[t];
    if (!i || i.data === z1)
      throw new Error(`Requesting object that isn't resolved yet ${t}.`);
    return i.data;
  }
  has(t) {
    const e = g(this, Li)[t];
    return !!e && e.data !== z1;
  }
  delete(t) {
    const e = g(this, Li)[t];
    return !e || e.data === z1 ? !1 : (delete g(this, Li)[t], !0);
  }
  resolve(t, e = null) {
    const i = C(this, ef, O5).call(this, t);
    i.data = e, i.resolve();
  }
  clear() {
    var t;
    for (const e in g(this, Li)) {
      const {
        data: i
      } = g(this, Li)[e];
      (t = i == null ? void 0 : i.bitmap) == null || t.close();
    }
    S(this, Li, /* @__PURE__ */ Object.create(null));
  }
  *[Symbol.iterator]() {
    for (const t in g(this, Li)) {
      const {
        data: e
      } = g(this, Li)[t];
      e !== z1 && (yield [t, e]);
    }
  }
}
Li = new WeakMap(), ef = new WeakSet(), O5 = function(t) {
  var e;
  return (e = g(this, Li))[t] || (e[t] = {
    ...Promise.withResolvers(),
    data: z1
  });
};
const US = 1e5, M8 = 30;
var uy, To, wi, sf, nf, dc, mr, af, rf, fc, Fu, Ru, Eo, Pu, of, Du, gc, lf, cf, Nu, pc, hf, Mo, Bu, Jr, bw, yw, U5, tn, wg, q5, ww, vw;
const ls = class ls {
  constructor({
    textContentSource: t,
    container: e,
    viewport: i
  }) {
    _(this, Jr);
    _(this, To, Promise.withResolvers());
    _(this, wi, null);
    _(this, sf, !1);
    _(this, nf, !!((uy = globalThis.FontInspector) != null && uy.enabled));
    _(this, dc, null);
    _(this, mr, null);
    _(this, af, 0);
    _(this, rf, 0);
    _(this, fc, null);
    _(this, Fu, null);
    _(this, Ru, 0);
    _(this, Eo, 0);
    _(this, Pu, /* @__PURE__ */ Object.create(null));
    _(this, of, []);
    _(this, Du, null);
    _(this, gc, []);
    _(this, lf, /* @__PURE__ */ new WeakMap());
    _(this, cf, null);
    var l;
    if (t instanceof ReadableStream)
      S(this, Du, t);
    else if (typeof t == "object")
      S(this, Du, new ReadableStream({
        start(c) {
          c.enqueue(t), c.close();
        }
      }));
    else
      throw new Error('No "textContentSource" parameter specified.');
    S(this, wi, S(this, Fu, e)), S(this, Eo, i.scale * na.pixelRatio), S(this, Ru, i.rotation), S(this, mr, {
      div: null,
      properties: null,
      ctx: null
    });
    const {
      pageWidth: n,
      pageHeight: a,
      pageX: r,
      pageY: o
    } = i.rawDims;
    S(this, cf, [1, 0, 0, -1, -r, o + a]), S(this, rf, n), S(this, af, a), C(l = ls, tn, ww).call(l), rl(e, i), g(this, To).promise.finally(() => {
      g(ls, Bu).delete(this), S(this, mr, null), S(this, Pu, null);
    }).catch(() => {
    });
  }
  static get fontFamilyMap() {
    const {
      isWindows: t,
      isFirefox: e
    } = ks.platform;
    return ne(this, "fontFamilyMap", /* @__PURE__ */ new Map([["sans-serif", `${t && e ? "Calibri, " : ""}sans-serif`], ["monospace", `${t && e ? "Lucida Console, " : ""}monospace`]]));
  }
  render() {
    const t = () => {
      g(this, fc).read().then(({
        value: e,
        done: i
      }) => {
        if (i) {
          g(this, To).resolve();
          return;
        }
        g(this, dc) ?? S(this, dc, e.lang), Object.assign(g(this, Pu), e.styles), C(this, Jr, bw).call(this, e.items), t();
      }, g(this, To).reject);
    };
    return S(this, fc, g(this, Du).getReader()), g(ls, Bu).add(this), t(), g(this, To).promise;
  }
  update({
    viewport: t,
    onBefore: e = null
  }) {
    var a;
    const i = t.scale * na.pixelRatio, n = t.rotation;
    if (n !== g(this, Ru) && (e == null || e(), S(this, Ru, n), rl(g(this, Fu), {
      rotation: n
    })), i !== g(this, Eo)) {
      e == null || e(), S(this, Eo, i);
      const r = {
        div: null,
        properties: null,
        ctx: C(a = ls, tn, wg).call(a, g(this, dc))
      };
      for (const o of g(this, gc))
        r.properties = g(this, lf).get(o), r.div = o, C(this, Jr, U5).call(this, r);
    }
  }
  cancel() {
    var e;
    const t = new Gr("TextLayer task cancelled.");
    (e = g(this, fc)) == null || e.cancel(t).catch(() => {
    }), S(this, fc, null), g(this, To).reject(t);
  }
  get textDivs() {
    return g(this, gc);
  }
  get textContentItemsStr() {
    return g(this, of);
  }
  static cleanup() {
    if (!(g(this, Bu).size > 0)) {
      g(this, Nu).clear();
      for (const {
        canvas: t
      } of g(this, pc).values())
        t.remove();
      g(this, pc).clear();
    }
  }
};
To = new WeakMap(), wi = new WeakMap(), sf = new WeakMap(), nf = new WeakMap(), dc = new WeakMap(), mr = new WeakMap(), af = new WeakMap(), rf = new WeakMap(), fc = new WeakMap(), Fu = new WeakMap(), Ru = new WeakMap(), Eo = new WeakMap(), Pu = new WeakMap(), of = new WeakMap(), Du = new WeakMap(), gc = new WeakMap(), lf = new WeakMap(), cf = new WeakMap(), Nu = new WeakMap(), pc = new WeakMap(), hf = new WeakMap(), Mo = new WeakMap(), Bu = new WeakMap(), Jr = new WeakSet(), bw = function(t) {
  var n, a;
  if (g(this, sf))
    return;
  (a = g(this, mr)).ctx ?? (a.ctx = C(n = ls, tn, wg).call(n, g(this, dc)));
  const e = g(this, gc), i = g(this, of);
  for (const r of t) {
    if (e.length > US) {
      zt("Ignoring additional textDivs for performance reasons."), S(this, sf, !0);
      return;
    }
    if (r.str === void 0) {
      if (r.type === "beginMarkedContentProps" || r.type === "beginMarkedContent") {
        const o = g(this, wi);
        S(this, wi, document.createElement("span")), g(this, wi).classList.add("markedContent"), r.id !== null && g(this, wi).setAttribute("id", `${r.id}`), o.append(g(this, wi));
      } else r.type === "endMarkedContent" && S(this, wi, g(this, wi).parentNode);
      continue;
    }
    i.push(r.str), C(this, Jr, yw).call(this, r);
  }
}, yw = function(t) {
  var m;
  const e = document.createElement("span"), i = {
    angle: 0,
    canvasWidth: 0,
    hasText: t.str !== "",
    hasEOL: t.hasEOL,
    fontSize: 0
  };
  g(this, gc).push(e);
  const n = Dt.transform(g(this, cf), t.transform);
  let a = Math.atan2(n[1], n[0]);
  const r = g(this, Pu)[t.fontName];
  r.vertical && (a += Math.PI / 2);
  let o = g(this, nf) && r.fontSubstitution || r.fontFamily;
  o = ls.fontFamilyMap.get(o) || o;
  const l = Math.hypot(n[2], n[3]), c = l * C(m = ls, tn, vw).call(m, o, r, g(this, dc));
  let h, u;
  a === 0 ? (h = n[4], u = n[5] - c) : (h = n[4] + c * Math.sin(a), u = n[5] - c * Math.cos(a));
  const f = "calc(var(--total-scale-factor) *", d = e.style;
  g(this, wi) === g(this, Fu) ? (d.left = `${(100 * h / g(this, rf)).toFixed(2)}%`, d.top = `${(100 * u / g(this, af)).toFixed(2)}%`) : (d.left = `${f}${h.toFixed(2)}px)`, d.top = `${f}${u.toFixed(2)}px)`), d.fontSize = `${f}${(g(ls, Mo) * l).toFixed(2)}px)`, d.fontFamily = o, i.fontSize = l, e.setAttribute("role", "presentation"), e.textContent = t.str, e.dir = t.dir, g(this, nf) && (e.dataset.fontName = r.fontSubstitutionLoadedName || t.fontName), a !== 0 && (i.angle = a * (180 / Math.PI));
  let p = !1;
  if (t.str.length > 1)
    p = !0;
  else if (t.str !== " " && t.transform[0] !== t.transform[3]) {
    const b = Math.abs(t.transform[0]), y = Math.abs(t.transform[3]);
    b !== y && Math.max(b, y) / Math.min(b, y) > 1.5 && (p = !0);
  }
  if (p && (i.canvasWidth = r.vertical ? t.height : t.width), g(this, lf).set(e, i), g(this, mr).div = e, g(this, mr).properties = i, C(this, Jr, U5).call(this, g(this, mr)), i.hasText && g(this, wi).append(e), i.hasEOL) {
    const b = document.createElement("br");
    b.setAttribute("role", "presentation"), g(this, wi).append(b);
  }
}, U5 = function(t) {
  var o;
  const {
    div: e,
    properties: i,
    ctx: n
  } = t, {
    style: a
  } = e;
  let r = "";
  if (g(ls, Mo) > 1 && (r = `scale(${1 / g(ls, Mo)})`), i.canvasWidth !== 0 && i.hasText) {
    const {
      fontFamily: l
    } = a, {
      canvasWidth: c,
      fontSize: h
    } = i;
    C(o = ls, tn, q5).call(o, n, h * g(this, Eo), l);
    const {
      width: u
    } = n.measureText(e.textContent);
    u > 0 && (r = `scaleX(${c * g(this, Eo) / u}) ${r}`);
  }
  i.angle !== 0 && (r = `rotate(${i.angle}deg) ${r}`), r.length > 0 && (a.transform = r);
}, tn = new WeakSet(), wg = function(t = null) {
  let e = g(this, pc).get(t || (t = ""));
  if (!e) {
    const i = document.createElement("canvas");
    i.className = "hiddenCanvasElement", i.lang = t, document.body.append(i), e = i.getContext("2d", {
      alpha: !1,
      willReadFrequently: !0
    }), g(this, pc).set(t, e), g(this, hf).set(e, {
      size: 0,
      family: ""
    });
  }
  return e;
}, q5 = function(t, e, i) {
  const n = g(this, hf).get(t);
  e === n.size && i === n.family || (t.font = `${e}px ${i}`, n.size = e, n.family = i);
}, ww = function() {
  if (g(this, Mo) !== null)
    return;
  const t = document.createElement("div");
  t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), S(this, Mo, t.getBoundingClientRect().height), t.remove();
}, vw = function(t, e, i) {
  const n = g(this, Nu).get(t);
  if (n)
    return n;
  const a = C(this, tn, wg).call(this, i);
  a.canvas.width = a.canvas.height = M8, C(this, tn, q5).call(this, a, M8, t);
  const r = a.measureText(""), o = r.fontBoundingBoxAscent, l = Math.abs(r.fontBoundingBoxDescent);
  a.canvas.width = a.canvas.height = 0;
  let c = 0.8;
  return o ? c = o / (o + l) : (ks.platform.isFirefox && zt("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), e.ascent ? c = e.ascent : e.descent && (c = 1 + e.descent)), g(this, Nu).set(t, c), c;
}, _(ls, tn), _(ls, Nu, /* @__PURE__ */ new Map()), _(ls, pc, /* @__PURE__ */ new Map()), _(ls, hf, /* @__PURE__ */ new WeakMap()), _(ls, Mo, null), _(ls, Bu, /* @__PURE__ */ new Set());
let S1 = ls;
class t0 {
  static textContent(t) {
    const e = [], i = {
      items: e,
      styles: /* @__PURE__ */ Object.create(null)
    };
    function n(a) {
      var l;
      if (!a)
        return;
      let r = null;
      const o = a.name;
      if (o === "#text")
        r = a.value;
      else if (t0.shouldBuildText(o))
        (l = a == null ? void 0 : a.attributes) != null && l.textContent ? r = a.attributes.textContent : a.value && (r = a.value);
      else return;
      if (r !== null && e.push({
        str: r
      }), !!a.children)
        for (const c of a.children)
          n(c);
    }
    return n(t), i;
  }
  static shouldBuildText(t) {
    return !(t === "textarea" || t === "input" || t === "option" || t === "select");
  }
}
const qS = 100;
function z9(s = {}) {
  typeof s == "string" || s instanceof URL ? s = {
    url: s
  } : (s instanceof ArrayBuffer || ArrayBuffer.isView(s)) && (s = {
    data: s
  });
  const t = new j5(), {
    docId: e
  } = t, i = s.url ? Yk(s.url) : null, n = s.data ? Jk(s.data) : null, a = s.httpHeaders || null, r = s.withCredentials === !0, o = s.password ?? null, l = s.range instanceof s7 ? s.range : null, c = Number.isInteger(s.rangeChunkSize) && s.rangeChunkSize > 0 ? s.rangeChunkSize : 2 ** 16;
  let h = s.worker instanceof C1 ? s.worker : null;
  const u = s.verbosity, f = typeof s.docBaseUrl == "string" && !b2(s.docBaseUrl) ? s.docBaseUrl : null, d = N2(s.cMapUrl), p = s.cMapPacked !== !1, m = s.CMapReaderFactory || (oi ? nS : y8), b = N2(s.iccUrl), y = N2(s.standardFontDataUrl), v = s.StandardFontDataFactory || (oi ? aS : w8), w = N2(s.wasmUrl), A = s.WasmFactory || (oi ? rS : v8), x = s.stopAtErrors !== !0, k = Number.isInteger(s.maxImageSize) && s.maxImageSize > -1 ? s.maxImageSize : -1, I = s.isEvalSupported !== !1, T = typeof s.isOffscreenCanvasSupported == "boolean" ? s.isOffscreenCanvasSupported : !oi, E = typeof s.isImageDecoderSupported == "boolean" ? s.isImageDecoderSupported : !oi && (ks.platform.isFirefox || !globalThis.chrome), M = Number.isInteger(s.canvasMaxAreaInBytes) ? s.canvasMaxAreaInBytes : -1, F = typeof s.disableFontFace == "boolean" ? s.disableFontFace : oi, L = s.fontExtraProperties === !0, Y = s.enableXfa === !0, B = s.ownerDocument || globalThis.document, et = s.disableRange === !0, H = s.disableStream === !0, P = s.disableAutoFetch === !0, G = s.pdfBug === !0, N = s.CanvasFactory || (oi ? iS : tS), j = s.FilterFactory || (oi ? sS : eS), V = s.enableHWA === !0, X = s.useWasm !== !1, z = l ? l.length : s.length ?? NaN, K = typeof s.useSystemFonts == "boolean" ? s.useSystemFonts : !oi && !F, W = typeof s.useWorkerFetch == "boolean" ? s.useWorkerFetch : !!(m === y8 && v === w8 && A === v8 && d && y && w && ld(d, document.baseURI) && ld(y, document.baseURI) && ld(w, document.baseURI)), rt = null;
  Rk(u);
  const $ = {
    canvasFactory: new N({
      ownerDocument: B,
      enableHWA: V
    }),
    filterFactory: new j({
      docId: e,
      ownerDocument: B
    }),
    cMapReaderFactory: W ? null : new m({
      baseUrl: d,
      isCompressed: p
    }),
    standardFontDataFactory: W ? null : new v({
      baseUrl: y
    }),
    wasmFactory: W ? null : new A({
      baseUrl: w
    })
  };
  h || (h = C1.create({
    verbosity: u,
    port: wn.workerPort
  }), t._worker = h);
  const nt = {
    docId: e,
    apiVersion: "5.3.31",
    data: n,
    password: o,
    disableAutoFetch: P,
    rangeChunkSize: c,
    length: z,
    docBaseUrl: f,
    enableXfa: Y,
    evaluatorOptions: {
      maxImageSize: k,
      disableFontFace: F,
      ignoreErrors: x,
      isEvalSupported: I,
      isOffscreenCanvasSupported: T,
      isImageDecoderSupported: E,
      canvasMaxAreaInBytes: M,
      fontExtraProperties: L,
      useSystemFonts: K,
      useWasm: X,
      useWorkerFetch: W,
      cMapUrl: d,
      iccUrl: b,
      standardFontDataUrl: y,
      wasmUrl: w
    }
  }, wt = {
    ownerDocument: B,
    pdfBug: G,
    styleElement: rt,
    loadingParams: {
      disableAutoFetch: P,
      enableXfa: Y
    }
  };
  return h.promise.then(function() {
    if (t.destroyed)
      throw new Error("Loading aborted");
    if (h.destroyed)
      throw new Error("Worker was destroyed");
    const O = h.messageHandler.sendWithPromise("GetDocRequest", nt, n ? [n.buffer] : null);
    let U;
    if (l)
      U = new xS(l, {
        disableRange: et,
        disableStream: H
      });
    else if (!n) {
      if (!i)
        throw new Error("getDocument - no `url` parameter provided.");
      const Q = ld(i) ? IS : oi ? BS : FS;
      U = new Q({
        url: i,
        length: z,
        httpHeaders: a,
        withCredentials: r,
        rangeChunkSize: c,
        disableRange: et,
        disableStream: H
      });
    }
    return O.then((Q) => {
      if (t.destroyed)
        throw new Error("Loading aborted");
      if (h.destroyed)
        throw new Error("Worker was destroyed");
      const lt = new fd(e, Q, h.port), pt = new $S(lt, t, U, wt, $);
      t._transport = pt, lt.send("Ready", null);
    });
  }).catch(t._capability.reject), t;
}
var p9;
const m9 = class m9 {
  constructor() {
    ht(this, "_capability", Promise.withResolvers());
    ht(this, "_transport", null);
    ht(this, "_worker", null);
    ht(this, "docId", `d${Qs(m9, p9)._++}`);
    ht(this, "destroyed", !1);
    ht(this, "onPassword", null);
    ht(this, "onProgress", null);
  }
  get promise() {
    return this._capability.promise;
  }
  async destroy() {
    var t, e, i, n;
    this.destroyed = !0;
    try {
      (t = this._worker) != null && t.port && (this._worker._pendingDestroy = !0), await ((e = this._transport) == null ? void 0 : e.destroy());
    } catch (a) {
      throw (i = this._worker) != null && i.port && delete this._worker._pendingDestroy, a;
    }
    this._transport = null, (n = this._worker) == null || n.destroy(), this._worker = null;
  }
  async getData() {
    return this._transport.getData();
  }
};
p9 = new WeakMap(), _(m9, p9, 0);
let j5 = m9;
var mc, uf, df, ff, gf;
class s7 {
  constructor(t, e, i = !1, n = null) {
    _(this, mc, Promise.withResolvers());
    _(this, uf, []);
    _(this, df, []);
    _(this, ff, []);
    _(this, gf, []);
    this.length = t, this.initialData = e, this.progressiveDone = i, this.contentDispositionFilename = n;
  }
  addRangeListener(t) {
    g(this, gf).push(t);
  }
  addProgressListener(t) {
    g(this, ff).push(t);
  }
  addProgressiveReadListener(t) {
    g(this, df).push(t);
  }
  addProgressiveDoneListener(t) {
    g(this, uf).push(t);
  }
  onDataRange(t, e) {
    for (const i of g(this, gf))
      i(t, e);
  }
  onDataProgress(t, e) {
    g(this, mc).promise.then(() => {
      for (const i of g(this, ff))
        i(t, e);
    });
  }
  onDataProgressiveRead(t) {
    g(this, mc).promise.then(() => {
      for (const e of g(this, df))
        e(t);
    });
  }
  onDataProgressiveDone() {
    g(this, mc).promise.then(() => {
      for (const t of g(this, uf))
        t();
    });
  }
  transportReady() {
    g(this, mc).resolve();
  }
  requestDataRange(t, e) {
    Ae("Abstract method PDFDataRangeTransport.requestDataRange");
  }
  abort() {
  }
}
mc = new WeakMap(), uf = new WeakMap(), df = new WeakMap(), ff = new WeakMap(), gf = new WeakMap();
class jS {
  constructor(t, e) {
    this._pdfInfo = t, this._transport = e;
  }
  get annotationStorage() {
    return this._transport.annotationStorage;
  }
  get canvasFactory() {
    return this._transport.canvasFactory;
  }
  get filterFactory() {
    return this._transport.filterFactory;
  }
  get numPages() {
    return this._pdfInfo.numPages;
  }
  get fingerprints() {
    return this._pdfInfo.fingerprints;
  }
  get isPureXfa() {
    return ne(this, "isPureXfa", !!this._transport._htmlForXfa);
  }
  get allXfaHtml() {
    return this._transport._htmlForXfa;
  }
  getPage(t) {
    return this._transport.getPage(t);
  }
  getPageIndex(t) {
    return this._transport.getPageIndex(t);
  }
  getDestinations() {
    return this._transport.getDestinations();
  }
  getDestination(t) {
    return this._transport.getDestination(t);
  }
  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: t = "display"
  } = {}) {
    const {
      renderingIntent: e
    } = this._transport.getRenderingIntent(t);
    return this._transport.getOptionalContentConfig(e);
  }
  getPermissions() {
    return this._transport.getPermissions();
  }
  getMetadata() {
    return this._transport.getMetadata();
  }
  getMarkInfo() {
    return this._transport.getMarkInfo();
  }
  getData() {
    return this._transport.getData();
  }
  saveDocument() {
    return this._transport.saveDocument();
  }
  getDownloadInfo() {
    return this._transport.downloadInfoCapability.promise;
  }
  cleanup(t = !1) {
    return this._transport.startCleanup(t || this.isPureXfa);
  }
  destroy() {
    return this.loadingTask.destroy();
  }
  cachedPageNumber(t) {
    return this._transport.cachedPageNumber(t);
  }
  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();
  }
}
var br, bc, yd;
class HS {
  constructor(t, e, i, n = !1) {
    _(this, bc);
    _(this, br, !1);
    this._pageIndex = t, this._pageInfo = e, this._transport = i, this._stats = n ? new p8() : null, this._pdfBug = n, this.commonObjs = i.commonObjs, this.objs = new mw(), 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: t,
    rotation: e = this.rotate,
    offsetX: i = 0,
    offsetY: n = 0,
    dontFlip: a = !1
  } = {}) {
    return new m2({
      viewBox: this.view,
      userUnit: this.userUnit,
      scale: t,
      rotation: e,
      offsetX: i,
      offsetY: n,
      dontFlip: a
    });
  }
  getAnnotations({
    intent: t = "display"
  } = {}) {
    const {
      renderingIntent: e
    } = this._transport.getRenderingIntent(t);
    return this._transport.getAnnotations(this._pageIndex, e);
  }
  getJSActions() {
    return this._transport.getPageJSActions(this._pageIndex);
  }
  get filterFactory() {
    return this._transport.filterFactory;
  }
  get isPureXfa() {
    return ne(this, "isPureXfa", !!this._transport._htmlForXfa);
  }
  async getXfa() {
    var t;
    return ((t = this._transport._htmlForXfa) == null ? void 0 : t.children[this._pageIndex]) || null;
  }
  render({
    canvasContext: t,
    viewport: e,
    intent: i = "display",
    annotationMode: n = Pr.ENABLE,
    transform: a = null,
    background: r = null,
    optionalContentConfigPromise: o = null,
    annotationCanvasMap: l = null,
    pageColors: c = null,
    printAnnotationStorage: h = null,
    isEditing: u = !1
  }) {
    var A, x;
    (A = this._stats) == null || A.time("Overall");
    const f = this._transport.getRenderingIntent(i, n, h, u), {
      renderingIntent: d,
      cacheKey: p
    } = f;
    S(this, br, !1), o || (o = this._transport.getOptionalContentConfig(d));
    let m = this._intentStates.get(p);
    m || (m = /* @__PURE__ */ Object.create(null), this._intentStates.set(p, m)), m.streamReaderCancelTimeout && (clearTimeout(m.streamReaderCancelTimeout), m.streamReaderCancelTimeout = null);
    const b = !!(d & Wi.PRINT);
    m.displayReadyCapability || (m.displayReadyCapability = Promise.withResolvers(), m.operatorList = {
      fnArray: [],
      argsArray: [],
      lastChunk: !1,
      separateAnnots: null
    }, (x = this._stats) == null || x.time("Page Request"), this._pumpOperatorList(f));
    const y = (k) => {
      var I;
      m.renderTasks.delete(v), b && S(this, br, !0), C(this, bc, yd).call(this), k ? (v.capability.reject(k), this._abortOperatorList({
        intentState: m,
        reason: k instanceof Error ? k : new Error(k)
      })) : v.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), (I = globalThis.Stats) != null && I.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
    }, v = new H5({
      callback: y,
      params: {
        canvasContext: t,
        viewport: e,
        transform: a,
        background: r
      },
      objs: this.objs,
      commonObjs: this.commonObjs,
      annotationCanvasMap: l,
      operatorList: m.operatorList,
      pageIndex: this._pageIndex,
      canvasFactory: this._transport.canvasFactory,
      filterFactory: this._transport.filterFactory,
      useRequestAnimationFrame: !b,
      pdfBug: this._pdfBug,
      pageColors: c
    });
    (m.renderTasks || (m.renderTasks = /* @__PURE__ */ new Set())).add(v);
    const w = v.task;
    return Promise.all([m.displayReadyCapability.promise, o]).then(([k, I]) => {
      var T;
      if (this.destroyed) {
        y();
        return;
      }
      if ((T = this._stats) == null || T.time("Rendering"), !(I.renderingIntent & d))
        throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
      v.initializeGraphics({
        transparency: k,
        optionalContentConfig: I
      }), v.operatorListChanged();
    }).catch(y), w;
  }
  getOperatorList({
    intent: t = "display",
    annotationMode: e = Pr.ENABLE,
    printAnnotationStorage: i = null,
    isEditing: n = !1
  } = {}) {
    var c;
    function a() {
      o.operatorList.lastChunk && (o.opListReadCapability.resolve(o.operatorList), o.renderTasks.delete(l));
    }
    const r = this._transport.getRenderingIntent(t, e, i, n, !0);
    let o = this._intentStates.get(r.cacheKey);
    o || (o = /* @__PURE__ */ Object.create(null), this._intentStates.set(r.cacheKey, o));
    let l;
    return o.opListReadCapability || (l = /* @__PURE__ */ Object.create(null), l.operatorListChanged = a, o.opListReadCapability = Promise.withResolvers(), (o.renderTasks || (o.renderTasks = /* @__PURE__ */ new Set())).add(l), o.operatorList = {
      fnArray: [],
      argsArray: [],
      lastChunk: !1,
      separateAnnots: null
    }, (c = this._stats) == null || c.time("Page Request"), this._pumpOperatorList(r)), o.opListReadCapability.promise;
  }
  streamTextContent({
    includeMarkedContent: t = !1,
    disableNormalization: e = !1
  } = {}) {
    return this._transport.messageHandler.sendWithStream("GetTextContent", {
      pageIndex: this._pageIndex,
      includeMarkedContent: t === !0,
      disableNormalization: e === !0
    }, {
      highWaterMark: 100,
      size(n) {
        return n.items.length;
      }
    });
  }
  getTextContent(t = {}) {
    if (this._transport._htmlForXfa)
      return this.getXfa().then((i) => t0.textContent(i));
    const e = this.streamTextContent(t);
    return new Promise(function(i, n) {
      function a() {
        r.read().then(function({
          value: l,
          done: c
        }) {
          if (c) {
            i(o);
            return;
          }
          o.lang ?? (o.lang = l.lang), Object.assign(o.styles, l.styles), o.items.push(...l.items), a();
        }, n);
      }
      const r = e.getReader(), o = {
        items: [],
        styles: /* @__PURE__ */ Object.create(null),
        lang: null
      };
      a();
    });
  }
  getStructTree() {
    return this._transport.getStructTree(this._pageIndex);
  }
  _destroy() {
    this.destroyed = !0;
    const t = [];
    for (const e of this._intentStates.values())
      if (this._abortOperatorList({
        intentState: e,
        reason: new Error("Page was destroyed."),
        force: !0
      }), !e.opListReadCapability)
        for (const i of e.renderTasks)
          t.push(i.completed), i.cancel();
    return this.objs.clear(), S(this, br, !1), Promise.all(t);
  }
  cleanup(t = !1) {
    S(this, br, !0);
    const e = C(this, bc, yd).call(this);
    return t && e && this._stats && (this._stats = new p8()), e;
  }
  _startRenderPage(t, e) {
    var n, a;
    const i = this._intentStates.get(e);
    i && ((n = this._stats) == null || n.timeEnd("Page Request"), (a = i.displayReadyCapability) == null || a.resolve(t));
  }
  _renderPageChunk(t, e) {
    for (let i = 0, n = t.length; i < n; i++)
      e.operatorList.fnArray.push(t.fnArray[i]), e.operatorList.argsArray.push(t.argsArray[i]);
    e.operatorList.lastChunk = t.lastChunk, e.operatorList.separateAnnots = t.separateAnnots;
    for (const i of e.renderTasks)
      i.operatorListChanged();
    t.lastChunk && C(this, bc, yd).call(this);
  }
  _pumpOperatorList({
    renderingIntent: t,
    cacheKey: e,
    annotationStorageSerializable: i,
    modifiedIds: n
  }) {
    const {
      map: a,
      transfer: r
    } = i, l = this._transport.messageHandler.sendWithStream("GetOperatorList", {
      pageIndex: this._pageIndex,
      intent: t,
      cacheKey: e,
      annotationStorage: a,
      modifiedIds: n
    }, r).getReader(), c = this._intentStates.get(e);
    c.streamReader = l;
    const h = () => {
      l.read().then(({
        value: u,
        done: f
      }) => {
        if (f) {
          c.streamReader = null;
          return;
        }
        this._transport.destroyed || (this._renderPageChunk(u, c), h());
      }, (u) => {
        if (c.streamReader = null, !this._transport.destroyed) {
          if (c.operatorList) {
            c.operatorList.lastChunk = !0;
            for (const f of c.renderTasks)
              f.operatorListChanged();
            C(this, bc, yd).call(this);
          }
          if (c.displayReadyCapability)
            c.displayReadyCapability.reject(u);
          else if (c.opListReadCapability)
            c.opListReadCapability.reject(u);
          else
            throw u;
        }
      });
    };
    h();
  }
  _abortOperatorList({
    intentState: t,
    reason: e,
    force: i = !1
  }) {
    if (t.streamReader) {
      if (t.streamReaderCancelTimeout && (clearTimeout(t.streamReaderCancelTimeout), t.streamReaderCancelTimeout = null), !i) {
        if (t.renderTasks.size > 0)
          return;
        if (e instanceof q9) {
          let n = qS;
          e.extraDelay > 0 && e.extraDelay < 1e3 && (n += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
            t.streamReaderCancelTimeout = null, this._abortOperatorList({
              intentState: t,
              reason: e,
              force: !0
            });
          }, n);
          return;
        }
      }
      if (t.streamReader.cancel(new Gr(e.message)).catch(() => {
      }), t.streamReader = null, !this._transport.destroyed) {
        for (const [n, a] of this._intentStates)
          if (a === t) {
            this._intentStates.delete(n);
            break;
          }
        this.cleanup();
      }
    }
  }
  get stats() {
    return this._stats;
  }
}
br = new WeakMap(), bc = new WeakSet(), yd = function() {
  if (!g(this, br) || this.destroyed)
    return !1;
  for (const {
    renderTasks: t,
    operatorList: e
  } of this._intentStates.values())
    if (t.size > 0 || !e.lastChunk)
      return !1;
  return this._intentStates.clear(), this.objs.clear(), S(this, br, !1), !0;
};
var Fo, qn, yr, yc, b9, wc, vc, hi, vg, Aw, xw, wd, Lu, Ag;
const Me = class Me {
  constructor({
    name: t = null,
    port: e = null,
    verbosity: i = Pk()
  } = {}) {
    _(this, hi);
    _(this, Fo, Promise.withResolvers());
    _(this, qn, null);
    _(this, yr, null);
    _(this, yc, null);
    if (this.name = t, this.destroyed = !1, this.verbosity = i, e) {
      if (g(Me, vc).has(e))
        throw new Error("Cannot use more than one PDFWorker per port.");
      g(Me, vc).set(e, this), C(this, hi, Aw).call(this, e);
    } else
      C(this, hi, xw).call(this);
  }
  get promise() {
    return g(this, Fo).promise;
  }
  get port() {
    return g(this, yr);
  }
  get messageHandler() {
    return g(this, qn);
  }
  destroy() {
    var t, e;
    this.destroyed = !0, (t = g(this, yc)) == null || t.terminate(), S(this, yc, null), g(Me, vc).delete(g(this, yr)), S(this, yr, null), (e = g(this, qn)) == null || e.destroy(), S(this, qn, null);
  }
  static create(t) {
    const e = g(this, vc).get(t == null ? void 0 : t.port);
    if (e) {
      if (e._pendingDestroy)
        throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
      return e;
    }
    return new Me(t);
  }
  static get workerSrc() {
    if (wn.workerSrc)
      return wn.workerSrc;
    throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
  }
  static get _setupFakeWorkerGlobal() {
    return ne(this, "_setupFakeWorkerGlobal", (async () => g(this, Lu, Ag) ? g(this, Lu, Ag) : (await import(
      /*webpackIgnore: true*/
      /*@vite-ignore*/
      this.workerSrc
    )).WorkerMessageHandler)());
  }
};
Fo = new WeakMap(), qn = new WeakMap(), yr = new WeakMap(), yc = new WeakMap(), b9 = new WeakMap(), wc = new WeakMap(), vc = new WeakMap(), hi = new WeakSet(), vg = function() {
  g(this, Fo).resolve(), g(this, qn).send("configure", {
    verbosity: this.verbosity
  });
}, Aw = function(t) {
  S(this, yr, t), S(this, qn, new fd("main", "worker", t)), g(this, qn).on("ready", () => {
  }), C(this, hi, vg).call(this);
}, xw = function() {
  if (g(Me, wc) || g(Me, Lu, Ag)) {
    C(this, hi, wd).call(this);
    return;
  }
  let {
    workerSrc: t
  } = Me;
  try {
    Me._isSameOrigin(window.location, t) || (t = Me._createCDNWrapper(new URL(t, window.location).href));
    const e = new Worker(t, {
      type: "module"
    }), i = new fd("main", "worker", e), n = () => {
      a.abort(), i.destroy(), e.terminate(), this.destroyed ? g(this, Fo).reject(new Error("Worker was destroyed")) : C(this, hi, wd).call(this);
    }, a = new AbortController();
    e.addEventListener("error", () => {
      g(this, yc) || n();
    }, {
      signal: a.signal
    }), i.on("test", (o) => {
      if (a.abort(), this.destroyed || !o) {
        n();
        return;
      }
      S(this, qn, i), S(this, yr, e), S(this, yc, e), C(this, hi, vg).call(this);
    }), i.on("ready", (o) => {
      if (a.abort(), this.destroyed) {
        n();
        return;
      }
      try {
        r();
      } catch {
        C(this, hi, wd).call(this);
      }
    });
    const r = () => {
      const o = new Uint8Array();
      i.send("test", o, [o.buffer]);
    };
    r();
    return;
  } catch {
    U9("The worker has been disabled.");
  }
  C(this, hi, wd).call(this);
}, wd = function() {
  g(Me, wc) || (zt("Setting up fake worker."), S(Me, wc, !0)), Me._setupFakeWorkerGlobal.then((t) => {
    if (this.destroyed) {
      g(this, Fo).reject(new Error("Worker was destroyed"));
      return;
    }
    const e = new Qk();
    S(this, yr, e);
    const i = `fake${Qs(Me, b9)._++}`, n = new fd(i + "_worker", i, e);
    t.setup(n, e), S(this, qn, new fd(i, i + "_worker", e)), C(this, hi, vg).call(this);
  }).catch((t) => {
    g(this, Fo).reject(new Error(`Setting up fake worker failed: "${t.message}".`));
  });
}, Lu = new WeakSet(), Ag = function() {
  var t;
  try {
    return ((t = globalThis.pdfjsWorker) == null ? void 0 : t.WorkerMessageHandler) || null;
  } catch {
    return null;
  }
}, _(Me, Lu), _(Me, b9, 0), _(Me, wc, !1), _(Me, vc, /* @__PURE__ */ new WeakMap()), oi && (S(Me, wc, !0), wn.workerSrc || (wn.workerSrc = "./pdf.worker.mjs")), Me._isSameOrigin = (t, e) => {
  const i = URL.parse(t);
  if (!(i != null && i.origin) || i.origin === "null")
    return !1;
  const n = new URL(e, i);
  return i.origin === n.origin;
}, Me._createCDNWrapper = (t) => {
  const e = `await import("${t}");`;
  return URL.createObjectURL(new Blob([e], {
    type: "text/javascript"
  }));
}, Me.fromPort = (t) => {
  if (Hk("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."), !(t != null && t.port))
    throw new Error("PDFWorker.fromPort - invalid method signature.");
  return Me.create(t);
};
let C1 = Me;
var wr, Ia, Ou, Uu, vr, Ac, vd;
class $S {
  constructor(t, e, i, n, a) {
    _(this, Ac);
    _(this, wr, /* @__PURE__ */ new Map());
    _(this, Ia, /* @__PURE__ */ new Map());
    _(this, Ou, /* @__PURE__ */ new Map());
    _(this, Uu, /* @__PURE__ */ new Map());
    _(this, vr, null);
    this.messageHandler = t, this.loadingTask = e, this.commonObjs = new mw(), this.fontLoader = new Xk({
      ownerDocument: n.ownerDocument,
      styleElement: n.styleElement
    }), this.loadingParams = n.loadingParams, this._params = n, this.canvasFactory = a.canvasFactory, this.filterFactory = a.filterFactory, this.cMapReaderFactory = a.cMapReaderFactory, this.standardFontDataFactory = a.standardFontDataFactory, this.wasmFactory = a.wasmFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = i, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
  }
  get annotationStorage() {
    return ne(this, "annotationStorage", new Q6());
  }
  getRenderingIntent(t, e = Pr.ENABLE, i = null, n = !1, a = !1) {
    let r = Wi.DISPLAY, o = T5;
    switch (t) {
      case "any":
        r = Wi.ANY;
        break;
      case "display":
        break;
      case "print":
        r = Wi.PRINT;
        break;
      default:
        zt(`getRenderingIntent - invalid intent: ${t}`);
    }
    const l = r & Wi.PRINT && i instanceof Qy ? i : this.annotationStorage;
    switch (e) {
      case Pr.DISABLE:
        r += Wi.ANNOTATIONS_DISABLE;
        break;
      case Pr.ENABLE:
        break;
      case Pr.ENABLE_FORMS:
        r += Wi.ANNOTATIONS_FORMS;
        break;
      case Pr.ENABLE_STORAGE:
        r += Wi.ANNOTATIONS_STORAGE, o = l.serializable;
        break;
      default:
        zt(`getRenderingIntent - invalid annotationMode: ${e}`);
    }
    n && (r += Wi.IS_EDITING), a && (r += Wi.OPLIST);
    const {
      ids: c,
      hash: h
    } = l.modifiedIds, u = [r, o.hash, h];
    return {
      renderingIntent: r,
      cacheKey: u.join("_"),
      annotationStorageSerializable: o,
      modifiedIds: c
    };
  }
  destroy() {
    var i;
    if (this.destroyCapability)
      return this.destroyCapability.promise;
    this.destroyed = !0, this.destroyCapability = Promise.withResolvers(), (i = g(this, vr)) == null || i.reject(new Error("Worker was destroyed during onPassword callback"));
    const t = [];
    for (const n of g(this, Ia).values())
      t.push(n._destroy());
    g(this, Ia).clear(), g(this, Ou).clear(), g(this, Uu).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
    const e = this.messageHandler.sendWithPromise("Terminate", null);
    return t.push(e), Promise.all(t).then(() => {
      var n, a;
      this.commonObjs.clear(), this.fontLoader.clear(), g(this, wr).clear(), this.filterFactory.destroy(), S1.cleanup(), (n = this._networkStream) == null || n.cancelAllRequests(new Gr("Worker was terminated.")), (a = this.messageHandler) == null || a.destroy(), this.messageHandler = null, this.destroyCapability.resolve();
    }, this.destroyCapability.reject), this.destroyCapability.promise;
  }
  setupMessageHandler() {
    const {
      messageHandler: t,
      loadingTask: e
    } = this;
    t.on("GetReader", (i, n) => {
      is(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (a) => {
        this._lastProgress = {
          loaded: a.loaded,
          total: a.total
        };
      }, n.onPull = () => {
        this._fullReader.read().then(function({
          value: a,
          done: r
        }) {
          if (r) {
            n.close();
            return;
          }
          is(a instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), n.enqueue(new Uint8Array(a), 1, [a]);
        }).catch((a) => {
          n.error(a);
        });
      }, n.onCancel = (a) => {
        this._fullReader.cancel(a), n.ready.catch((r) => {
          if (!this.destroyed)
            throw r;
        });
      };
    }), t.on("ReaderHeadersReady", async (i) => {
      var o;
      await this._fullReader.headersReady;
      const {
        isStreamingSupported: n,
        isRangeSupported: a,
        contentLength: r
      } = this._fullReader;
      return (!n || !a) && (this._lastProgress && ((o = e.onProgress) == null || o.call(e, this._lastProgress)), this._fullReader.onProgress = (l) => {
        var c;
        (c = e.onProgress) == null || c.call(e, {
          loaded: l.loaded,
          total: l.total
        });
      }), {
        isStreamingSupported: n,
        isRangeSupported: a,
        contentLength: r
      };
    }), t.on("GetRangeReader", (i, n) => {
      is(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
      const a = this._networkStream.getRangeReader(i.begin, i.end);
      if (!a) {
        n.close();
        return;
      }
      n.onPull = () => {
        a.read().then(function({
          value: r,
          done: o
        }) {
          if (o) {
            n.close();
            return;
          }
          is(r instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), n.enqueue(new Uint8Array(r), 1, [r]);
        }).catch((r) => {
          n.error(r);
        });
      }, n.onCancel = (r) => {
        a.cancel(r), n.ready.catch((o) => {
          if (!this.destroyed)
            throw o;
        });
      };
    }), t.on("GetDoc", ({
      pdfInfo: i
    }) => {
      this._numPages = i.numPages, this._htmlForXfa = i.htmlForXfa, delete i.htmlForXfa, e._capability.resolve(new jS(i, this));
    }), t.on("DocException", (i) => {
      e._capability.reject(mi(i));
    }), t.on("PasswordRequest", (i) => {
      S(this, vr, Promise.withResolvers());
      try {
        if (!e.onPassword)
          throw mi(i);
        const n = (a) => {
          a instanceof Error ? g(this, vr).reject(a) : g(this, vr).resolve({
            password: a
          });
        };
        e.onPassword(n, i.code);
      } catch (n) {
        g(this, vr).reject(n);
      }
      return g(this, vr).promise;
    }), t.on("DataLoaded", (i) => {
      var n;
      (n = e.onProgress) == null || n.call(e, {
        loaded: i.length,
        total: i.length
      }), this.downloadInfoCapability.resolve(i);
    }), t.on("StartRenderPage", (i) => {
      if (this.destroyed)
        return;
      g(this, Ia).get(i.pageIndex)._startRenderPage(i.transparency, i.cacheKey);
    }), t.on("commonobj", ([i, n, a]) => {
      var r;
      if (this.destroyed || this.commonObjs.has(i))
        return null;
      switch (n) {
        case "Font":
          if ("error" in a) {
            const h = a.error;
            zt(`Error during font loading: ${h}`), this.commonObjs.resolve(i, h);
            break;
          }
          const o = this._params.pdfBug && ((r = globalThis.FontInspector) != null && r.enabled) ? (h, u) => globalThis.FontInspector.fontAdded(h, u) : null, l = new Kk(a, o);
          this.fontLoader.bind(l).catch(() => t.sendWithPromise("FontFallback", {
            id: i
          })).finally(() => {
            !l.fontExtraProperties && l.data && (l.data = null), this.commonObjs.resolve(i, l);
          });
          break;
        case "CopyLocalImage":
          const {
            imageRef: c
          } = a;
          is(c, "The imageRef must be defined.");
          for (const h of g(this, Ia).values())
            for (const [, u] of h.objs)
              if ((u == null ? void 0 : u.ref) === c)
                return u.dataLen ? (this.commonObjs.resolve(i, structuredClone(u)), u.dataLen) : null;
          break;
        case "FontPath":
        case "Image":
        case "Pattern":
          this.commonObjs.resolve(i, a);
          break;
        default:
          throw new Error(`Got unknown common object type ${n}`);
      }
      return null;
    }), t.on("obj", ([i, n, a, r]) => {
      var l;
      if (this.destroyed)
        return;
      const o = g(this, Ia).get(n);
      if (!o.objs.has(i)) {
        if (o._intentStates.size === 0) {
          (l = r == null ? void 0 : r.bitmap) == null || l.close();
          return;
        }
        switch (a) {
          case "Image":
          case "Pattern":
            o.objs.resolve(i, r);
            break;
          default:
            throw new Error(`Got unknown object type ${a}`);
        }
      }
    }), t.on("DocProgress", (i) => {
      var n;
      this.destroyed || (n = e.onProgress) == null || n.call(e, {
        loaded: i.loaded,
        total: i.total
      });
    }), t.on("FetchBinaryData", async (i) => {
      if (this.destroyed)
        throw new Error("Worker was destroyed.");
      const n = this[i.type];
      if (!n)
        throw new Error(`${i.type} not initialized, see the \`useWorkerFetch\` parameter.`);
      return n.fetch(i);
    });
  }
  getData() {
    return this.messageHandler.sendWithPromise("GetData", null);
  }
  saveDocument() {
    var i;
    this.annotationStorage.size <= 0 && zt("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
    const {
      map: t,
      transfer: e
    } = this.annotationStorage.serializable;
    return this.messageHandler.sendWithPromise("SaveDocument", {
      isPureXfa: !!this._htmlForXfa,
      numPages: this._numPages,
      annotationStorage: t,
      filename: ((i = this._fullReader) == null ? void 0 : i.filename) ?? null
    }, e).finally(() => {
      this.annotationStorage.resetModified();
    });
  }
  getPage(t) {
    if (!Number.isInteger(t) || t <= 0 || t > this._numPages)
      return Promise.reject(new Error("Invalid page request."));
    const e = t - 1, i = g(this, Ou).get(e);
    if (i)
      return i;
    const n = this.messageHandler.sendWithPromise("GetPage", {
      pageIndex: e
    }).then((a) => {
      if (this.destroyed)
        throw new Error("Transport destroyed");
      a.refStr && g(this, Uu).set(a.refStr, t);
      const r = new HS(e, a, this, this._params.pdfBug);
      return g(this, Ia).set(e, r), r;
    });
    return g(this, Ou).set(e, n), n;
  }
  getPageIndex(t) {
    return E5(t) ? this.messageHandler.sendWithPromise("GetPageIndex", {
      num: t.num,
      gen: t.gen
    }) : Promise.reject(new Error("Invalid pageIndex request."));
  }
  getAnnotations(t, e) {
    return this.messageHandler.sendWithPromise("GetAnnotations", {
      pageIndex: t,
      intent: e
    });
  }
  getFieldObjects() {
    return C(this, Ac, vd).call(this, "GetFieldObjects");
  }
  hasJSActions() {
    return C(this, Ac, vd).call(this, "HasJSActions");
  }
  getCalculationOrderIds() {
    return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
  }
  getDestinations() {
    return this.messageHandler.sendWithPromise("GetDestinations", null);
  }
  getDestination(t) {
    return typeof t != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
      id: t
    });
  }
  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 C(this, Ac, vd).call(this, "GetDocJSActions");
  }
  getPageJSActions(t) {
    return this.messageHandler.sendWithPromise("GetPageJSActions", {
      pageIndex: t
    });
  }
  getStructTree(t) {
    return this.messageHandler.sendWithPromise("GetStructTree", {
      pageIndex: t
    });
  }
  getOutline() {
    return this.messageHandler.sendWithPromise("GetOutline", null);
  }
  getOptionalContentConfig(t) {
    return C(this, Ac, vd).call(this, "GetOptionalContentConfig").then((e) => new AS(e, t));
  }
  getPermissions() {
    return this.messageHandler.sendWithPromise("GetPermissions", null);
  }
  getMetadata() {
    const t = "GetMetadata", e = g(this, wr).get(t);
    if (e)
      return e;
    const i = this.messageHandler.sendWithPromise(t, null).then((n) => {
      var a, r;
      return {
        info: n[0],
        metadata: n[1] ? new wS(n[1]) : null,
        contentDispositionFilename: ((a = this._fullReader) == null ? void 0 : a.filename) ?? null,
        contentLength: ((r = this._fullReader) == null ? void 0 : r.contentLength) ?? null
      };
    });
    return g(this, wr).set(t, i), i;
  }
  getMarkInfo() {
    return this.messageHandler.sendWithPromise("GetMarkInfo", null);
  }
  async startCleanup(t = !1) {
    if (!this.destroyed) {
      await this.messageHandler.sendWithPromise("Cleanup", null);
      for (const e of g(this, Ia).values())
        if (!e.cleanup())
          throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);
      this.commonObjs.clear(), t || this.fontLoader.clear(), g(this, wr).clear(), this.filterFactory.destroy(!0), S1.cleanup();
    }
  }
  cachedPageNumber(t) {
    if (!E5(t))
      return null;
    const e = t.gen === 0 ? `${t.num}R` : `${t.num}R${t.gen}`;
    return g(this, Uu).get(e) ?? null;
  }
}
wr = new WeakMap(), Ia = new WeakMap(), Ou = new WeakMap(), Uu = new WeakMap(), vr = new WeakMap(), Ac = new WeakSet(), vd = function(t, e = null) {
  const i = g(this, wr).get(t);
  if (i)
    return i;
  const n = this.messageHandler.sendWithPromise(t, e);
  return g(this, wr).set(t, n), n;
};
var Ro;
class zS {
  constructor(t) {
    _(this, Ro, null);
    ht(this, "onContinue", null);
    ht(this, "onError", null);
    S(this, Ro, t);
  }
  get promise() {
    return g(this, Ro).capability.promise;
  }
  cancel(t = 0) {
    g(this, Ro).cancel(null, t);
  }
  get separateAnnots() {
    const {
      separateAnnots: t
    } = g(this, Ro).operatorList;
    if (!t)
      return !1;
    const {
      annotationCanvasMap: e
    } = g(this, Ro);
    return t.form || t.canvas && (e == null ? void 0 : e.size) > 0;
  }
}
Ro = new WeakMap();
var Po, xc;
const Ul = class Ul {
  constructor({
    callback: t,
    params: e,
    objs: i,
    commonObjs: n,
    annotationCanvasMap: a,
    operatorList: r,
    pageIndex: o,
    canvasFactory: l,
    filterFactory: c,
    useRequestAnimationFrame: h = !1,
    pdfBug: u = !1,
    pageColors: f = null
  }) {
    _(this, Po, null);
    this.callback = t, this.params = e, this.objs = i, this.commonObjs = n, this.annotationCanvasMap = a, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = o, this.canvasFactory = l, this.filterFactory = c, this._pdfBug = u, this.pageColors = f, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = h === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new zS(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvasContext.canvas;
  }
  get completed() {
    return this.capability.promise.catch(function() {
    });
  }
  initializeGraphics({
    transparency: t = !1,
    optionalContentConfig: e
  }) {
    var o, l;
    if (this.cancelled)
      return;
    if (this._canvas) {
      if (g(Ul, xc).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.");
      g(Ul, xc).add(this._canvas);
    }
    this._pdfBug && ((o = globalThis.StepperManager) != null && o.enabled) && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
    const {
      canvasContext: i,
      viewport: n,
      transform: a,
      background: r
    } = this.params;
    this.gfx = new eu(i, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
      optionalContentConfig: e
    }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
      transform: a,
      viewport: n,
      transparency: t,
      background: r
    }), this.operatorListIdx = 0, this.graphicsReady = !0, (l = this.graphicsReadyCallback) == null || l.call(this);
  }
  cancel(t = null, e = 0) {
    var i, n, a;
    this.running = !1, this.cancelled = !0, (i = this.gfx) == null || i.endDrawing(), g(this, Po) && (window.cancelAnimationFrame(g(this, Po)), S(this, Po, null)), g(Ul, xc).delete(this._canvas), t || (t = new q9(`Rendering cancelled, page ${this._pageIndex + 1}`, e)), this.callback(t), (a = (n = this.task).onError) == null || a.call(n, t);
  }
  operatorListChanged() {
    var t;
    if (!this.graphicsReady) {
      this.graphicsReadyCallback || (this.graphicsReadyCallback = this._continueBound);
      return;
    }
    (t = this.stepper) == null || t.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 ? S(this, Po, window.requestAnimationFrame(() => {
      S(this, Po, null), 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(), g(Ul, xc).delete(this._canvas), this.callback())));
  }
};
Po = new WeakMap(), xc = new WeakMap(), _(Ul, xc, /* @__PURE__ */ new WeakSet());
let H5 = Ul;
const kw = "5.3.31", Sw = "47ad820d9";
function F8(s) {
  return Math.floor(Math.max(0, Math.min(1, s)) * 255).toString(16).padStart(2, "0");
}
function G1(s) {
  return Math.max(0, Math.min(255, 255 * s));
}
class R8 {
  static CMYK_G([t, e, i, n]) {
    return ["G", 1 - Math.min(1, 0.3 * t + 0.59 * i + 0.11 * e + n)];
  }
  static G_CMYK([t]) {
    return ["CMYK", 0, 0, 0, 1 - t];
  }
  static G_RGB([t]) {
    return ["RGB", t, t, t];
  }
  static G_rgb([t]) {
    return t = G1(t), [t, t, t];
  }
  static G_HTML([t]) {
    const e = F8(t);
    return `#${e}${e}${e}`;
  }
  static RGB_G([t, e, i]) {
    return ["G", 0.3 * t + 0.59 * e + 0.11 * i];
  }
  static RGB_rgb(t) {
    return t.map(G1);
  }
  static RGB_HTML(t) {
    return `#${t.map(F8).join("")}`;
  }
  static T_HTML() {
    return "#00000000";
  }
  static T_rgb() {
    return [null];
  }
  static CMYK_RGB([t, e, i, n]) {
    return ["RGB", 1 - Math.min(1, t + n), 1 - Math.min(1, i + n), 1 - Math.min(1, e + n)];
  }
  static CMYK_rgb([t, e, i, n]) {
    return [G1(1 - Math.min(1, t + n)), G1(1 - Math.min(1, i + n)), G1(1 - Math.min(1, e + n))];
  }
  static CMYK_HTML(t) {
    const e = this.CMYK_RGB(t).slice(1);
    return this.RGB_HTML(e);
  }
  static RGB_CMYK([t, e, i]) {
    const n = 1 - t, a = 1 - e, r = 1 - i, o = Math.min(n, a, r);
    return ["CMYK", n, a, r, o];
  }
}
class GS {
  create(t, e, i = !1) {
    if (t <= 0 || e <= 0)
      throw new Error("Invalid SVG dimensions");
    const n = this._createSVG("svg:svg");
    return n.setAttribute("version", "1.1"), i || (n.setAttribute("width", `${t}px`), n.setAttribute("height", `${e}px`)), n.setAttribute("preserveAspectRatio", "none"), n.setAttribute("viewBox", `0 0 ${t} ${e}`), n;
  }
  createElement(t) {
    if (typeof t != "string")
      throw new Error("Invalid SVG element type");
    return this._createSVG(t);
  }
  _createSVG(t) {
    Ae("Abstract method `_createSVG` called.");
  }
}
class e0 extends GS {
  _createSVG(t) {
    return document.createElementNS(Ka, t);
  }
}
class i7 {
  static setupStorage(t, e, i, n, a) {
    const r = n.getValue(e, {
      value: null
    });
    switch (i.name) {
      case "textarea":
        if (r.value !== null && (t.textContent = r.value), a === "print")
          break;
        t.addEventListener("input", (o) => {
          n.setValue(e, {
            value: o.target.value
          });
        });
        break;
      case "input":
        if (i.attributes.type === "radio" || i.attributes.type === "checkbox") {
          if (r.value === i.attributes.xfaOn ? t.setAttribute("checked", !0) : r.value === i.attributes.xfaOff && t.removeAttribute("checked"), a === "print")
            break;
          t.addEventListener("change", (o) => {
            n.setValue(e, {
              value: o.target.checked ? o.target.getAttribute("xfaOn") : o.target.getAttribute("xfaOff")
            });
          });
        } else {
          if (r.value !== null && t.setAttribute("value", r.value), a === "print")
            break;
          t.addEventListener("input", (o) => {
            n.setValue(e, {
              value: o.target.value
            });
          });
        }
        break;
      case "select":
        if (r.value !== null) {
          t.setAttribute("value", r.value);
          for (const o of i.children)
            o.attributes.value === r.value ? o.attributes.selected = !0 : o.attributes.hasOwnProperty("selected") && delete o.attributes.selected;
        }
        t.addEventListener("input", (o) => {
          const l = o.target.options, c = l.selectedIndex === -1 ? "" : l[l.selectedIndex].value;
          n.setValue(e, {
            value: c
          });
        });
        break;
    }
  }
  static setAttributes({
    html: t,
    element: e,
    storage: i = null,
    intent: n,
    linkService: a
  }) {
    const {
      attributes: r
    } = e, o = t instanceof HTMLAnchorElement;
    r.type === "radio" && (r.name = `${r.name}-${n}`);
    for (const [l, c] of Object.entries(r))
      if (c != null)
        switch (l) {
          case "class":
            c.length && t.setAttribute(l, c.join(" "));
            break;
          case "dataId":
            break;
          case "id":
            t.setAttribute("data-element-id", c);
            break;
          case "style":
            Object.assign(t.style, c);
            break;
          case "textContent":
            t.textContent = c;
            break;
          default:
            (!o || l !== "href" && l !== "newWindow") && t.setAttribute(l, c);
        }
    o && a.addLinkAttributes(t, r.href, r.newWindow), i && r.dataId && this.setupStorage(t, r.dataId, e, i);
  }
  static render(t) {
    var u, f;
    const e = t.annotationStorage, i = t.linkService, n = t.xfaHtml, a = t.intent || "display", r = document.createElement(n.name);
    n.attributes && this.setAttributes({
      html: r,
      element: n,
      intent: a,
      linkService: i
    });
    const o = a !== "richText", l = t.div;
    if (l.append(r), t.viewport) {
      const d = `matrix(${t.viewport.transform.join(",")})`;
      l.style.transform = d;
    }
    o && l.setAttribute("class", "xfaLayer xfaFont");
    const c = [];
    if (n.children.length === 0) {
      if (n.value) {
        const d = document.createTextNode(n.value);
        r.append(d), o && t0.shouldBuildText(n.name) && c.push(d);
      }
      return {
        textDivs: c
      };
    }
    const h = [[n, -1, r]];
    for (; h.length > 0; ) {
      const [d, p, m] = h.at(-1);
      if (p + 1 === d.children.length) {
        h.pop();
        continue;
      }
      const b = d.children[++h.at(-1)[1]];
      if (b === null)
        continue;
      const {
        name: y
      } = b;
      if (y === "#text") {
        const w = document.createTextNode(b.value);
        c.push(w), m.append(w);
        continue;
      }
      const v = (u = b == null ? void 0 : b.attributes) != null && u.xmlns ? document.createElementNS(b.attributes.xmlns, y) : document.createElement(y);
      if (m.append(v), b.attributes && this.setAttributes({
        html: v,
        element: b,
        storage: e,
        intent: a,
        linkService: i
      }), ((f = b.children) == null ? void 0 : f.length) > 0)
        h.push([b, -1, v]);
      else if (b.value) {
        const w = document.createTextNode(b.value);
        o && t0.shouldBuildText(y) && c.push(w), v.append(w);
      }
    }
    for (const d of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
      d.setAttribute("readOnly", !0);
    return {
      textDivs: c
    };
  }
  static update(t) {
    const e = `matrix(${t.viewport.transform.join(",")})`;
    t.div.style.transform = e, t.div.hidden = !1;
  }
}
const v2 = 1e3, VS = 9, oh = /* @__PURE__ */ new WeakSet();
class P8 {
  static create(t) {
    switch (t.data.annotationType) {
      case Xe.LINK:
        return new Cw(t);
      case Xe.TEXT:
        return new WS(t);
      case Xe.WIDGET:
        switch (t.data.fieldType) {
          case "Tx":
            return new XS(t);
          case "Btn":
            return t.data.radioButton ? new Tw(t) : t.data.checkBox ? new YS(t) : new JS(t);
          case "Ch":
            return new ZS(t);
          case "Sig":
            return new KS(t);
        }
        return new mh(t);
      case Xe.POPUP:
        return new z5(t);
      case Xe.FREETEXT:
        return new Pw(t);
      case Xe.LINE:
        return new tC(t);
      case Xe.SQUARE:
        return new eC(t);
      case Xe.CIRCLE:
        return new sC(t);
      case Xe.POLYLINE:
        return new Dw(t);
      case Xe.CARET:
        return new nC(t);
      case Xe.INK:
        return new n7(t);
      case Xe.POLYGON:
        return new iC(t);
      case Xe.HIGHLIGHT:
        return new Nw(t);
      case Xe.UNDERLINE:
        return new aC(t);
      case Xe.SQUIGGLY:
        return new rC(t);
      case Xe.STRIKEOUT:
        return new oC(t);
      case Xe.STAMP:
        return new Bw(t);
      case Xe.FILEATTACHMENT:
        return new lC(t);
      default:
        return new ts(t);
    }
  }
}
var kc, qu, ju, pf, $5;
const n8 = class n8 {
  constructor(t, {
    isRenderable: e = !1,
    ignoreBorder: i = !1,
    createQuadrilaterals: n = !1
  } = {}) {
    _(this, pf);
    _(this, kc, null);
    _(this, qu, !1);
    _(this, ju, null);
    this.isRenderable = e, this.data = t.data, this.layer = t.layer, this.linkService = t.linkService, this.downloadManager = t.downloadManager, this.imageResourcesPath = t.imageResourcesPath, this.renderForms = t.renderForms, this.svgFactory = t.svgFactory, this.annotationStorage = t.annotationStorage, this.enableScripting = t.enableScripting, this.hasJSActions = t.hasJSActions, this._fieldObjects = t.fieldObjects, this.parent = t.parent, e && (this.container = this._createContainer(i)), n && this._createQuadrilaterals();
  }
  static _hasPopupData({
    titleObj: t,
    contentsObj: e,
    richText: i
  }) {
    return !!(t != null && t.str || e != null && e.str || i != null && i.str);
  }
  get _isEditable() {
    return this.data.isEditable;
  }
  get hasPopupData() {
    return n8._hasPopupData(this.data);
  }
  updateEdited(t) {
    var i;
    if (!this.container)
      return;
    g(this, kc) || S(this, kc, {
      rect: this.data.rect.slice(0)
    });
    const {
      rect: e
    } = t;
    e && C(this, pf, $5).call(this, e), (i = g(this, ju)) == null || i.popup.updateEdited(t);
  }
  resetEdited() {
    var t;
    g(this, kc) && (C(this, pf, $5).call(this, g(this, kc).rect), (t = g(this, ju)) == null || t.popup.resetEdited(), S(this, kc, null));
  }
  _createContainer(t) {
    const {
      data: e,
      parent: {
        page: i,
        viewport: n
      }
    } = this, a = document.createElement("section");
    a.setAttribute("data-annotation-id", e.id), this instanceof mh || (a.tabIndex = v2);
    const {
      style: r
    } = a;
    if (r.zIndex = this.parent.zIndex++, e.alternativeText && (a.title = e.alternativeText), e.noRotate && a.classList.add("norotate"), !e.rect || this instanceof z5) {
      const {
        rotation: m
      } = e;
      return !e.hasOwnCanvas && m !== 0 && this.setRotation(m, a), a;
    }
    const {
      width: o,
      height: l
    } = this;
    if (!t && e.borderStyle.width > 0) {
      r.borderWidth = `${e.borderStyle.width}px`;
      const m = e.borderStyle.horizontalCornerRadius, b = e.borderStyle.verticalCornerRadius;
      if (m > 0 || b > 0) {
        const v = `calc(${m}px * var(--total-scale-factor)) / calc(${b}px * var(--total-scale-factor))`;
        r.borderRadius = v;
      } else if (this instanceof Tw) {
        const v = `calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;
        r.borderRadius = v;
      }
      switch (e.borderStyle.style) {
        case Eh.SOLID:
          r.borderStyle = "solid";
          break;
        case Eh.DASHED:
          r.borderStyle = "dashed";
          break;
        case Eh.BEVELED:
          zt("Unimplemented border style: beveled");
          break;
        case Eh.INSET:
          zt("Unimplemented border style: inset");
          break;
        case Eh.UNDERLINE:
          r.borderBottomStyle = "solid";
          break;
      }
      const y = e.borderColor || null;
      y ? (S(this, qu, !0), r.borderColor = Dt.makeHexColor(y[0] | 0, y[1] | 0, y[2] | 0)) : r.borderWidth = 0;
    }
    const c = Dt.normalizeRect([e.rect[0], i.view[3] - e.rect[1] + i.view[1], e.rect[2], i.view[3] - e.rect[3] + i.view[1]]), {
      pageWidth: h,
      pageHeight: u,
      pageX: f,
      pageY: d
    } = n.rawDims;
    r.left = `${100 * (c[0] - f) / h}%`, r.top = `${100 * (c[1] - d) / u}%`;
    const {
      rotation: p
    } = e;
    return e.hasOwnCanvas || p === 0 ? (r.width = `${100 * o / h}%`, r.height = `${100 * l / u}%`) : this.setRotation(p, a), a;
  }
  setRotation(t, e = this.container) {
    if (!this.data.rect)
      return;
    const {
      pageWidth: i,
      pageHeight: n
    } = this.parent.viewport.rawDims;
    let {
      width: a,
      height: r
    } = this;
    t % 180 !== 0 && ([a, r] = [r, a]), e.style.width = `${100 * a / i}%`, e.style.height = `${100 * r / n}%`, e.setAttribute("data-main-rotation", (360 - t) % 360);
  }
  get _commonActions() {
    const t = (e, i, n) => {
      const a = n.detail[e], r = a[0], o = a.slice(1);
      n.target.style[i] = R8[`${r}_HTML`](o), this.annotationStorage.setValue(this.data.id, {
        [i]: R8[`${r}_rgb`](o)
      });
    };
    return ne(this, "_commonActions", {
      display: (e) => {
        const {
          display: i
        } = e.detail, n = i % 2 === 1;
        this.container.style.visibility = n ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
          noView: n,
          noPrint: i === 1 || i === 2
        });
      },
      print: (e) => {
        this.annotationStorage.setValue(this.data.id, {
          noPrint: !e.detail.print
        });
      },
      hidden: (e) => {
        const {
          hidden: i
        } = e.detail;
        this.container.style.visibility = i ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
          noPrint: i,
          noView: i
        });
      },
      focus: (e) => {
        setTimeout(() => e.target.focus({
          preventScroll: !1
        }), 0);
      },
      userName: (e) => {
        e.target.title = e.detail.userName;
      },
      readonly: (e) => {
        e.target.disabled = e.detail.readonly;
      },
      required: (e) => {
        this._setRequired(e.target, e.detail.required);
      },
      bgColor: (e) => {
        t("bgColor", "backgroundColor", e);
      },
      fillColor: (e) => {
        t("fillColor", "backgroundColor", e);
      },
      fgColor: (e) => {
        t("fgColor", "color", e);
      },
      textColor: (e) => {
        t("textColor", "color", e);
      },
      borderColor: (e) => {
        t("borderColor", "borderColor", e);
      },
      strokeColor: (e) => {
        t("strokeColor", "borderColor", e);
      },
      rotation: (e) => {
        const i = e.detail.rotation;
        this.setRotation(i), this.annotationStorage.setValue(this.data.id, {
          rotation: i
        });
      }
    });
  }
  _dispatchEventFromSandbox(t, e) {
    const i = this._commonActions;
    for (const n of Object.keys(e.detail)) {
      const a = t[n] || i[n];
      a == null || a(e);
    }
  }
  _setDefaultPropertiesFromJS(t) {
    if (!this.enableScripting)
      return;
    const e = this.annotationStorage.getRawValue(this.data.id);
    if (!e)
      return;
    const i = this._commonActions;
    for (const [n, a] of Object.entries(e)) {
      const r = i[n];
      if (r) {
        const o = {
          detail: {
            [n]: a
          },
          target: t
        };
        r(o), delete e[n];
      }
    }
  }
  _createQuadrilaterals() {
    if (!this.container)
      return;
    const {
      quadPoints: t
    } = this.data;
    if (!t)
      return;
    const [e, i, n, a] = this.data.rect.map((m) => Math.fround(m));
    if (t.length === 8) {
      const [m, b, y, v] = t.subarray(2, 6);
      if (n === m && a === b && e === y && i === v)
        return;
    }
    const {
      style: r
    } = this.container;
    let o;
    if (g(this, qu)) {
      const {
        borderColor: m,
        borderWidth: b
      } = r;
      r.borderWidth = 0, o = ["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="${m}" stroke-width="${b}">`], this.container.classList.add("hasBorder");
    }
    const l = n - e, c = a - i, {
      svgFactory: h
    } = this, u = h.createElement("svg");
    u.classList.add("quadrilateralsContainer"), u.setAttribute("width", 0), u.setAttribute("height", 0);
    const f = h.createElement("defs");
    u.append(f);
    const d = h.createElement("clipPath"), p = `clippath_${this.data.id}`;
    d.setAttribute("id", p), d.setAttribute("clipPathUnits", "objectBoundingBox"), f.append(d);
    for (let m = 2, b = t.length; m < b; m += 8) {
      const y = t[m], v = t[m + 1], w = t[m + 2], A = t[m + 3], x = h.createElement("rect"), k = (w - e) / l, I = (a - v) / c, T = (y - w) / l, E = (v - A) / c;
      x.setAttribute("x", k), x.setAttribute("y", I), x.setAttribute("width", T), x.setAttribute("height", E), d.append(x), o == null || o.push(`<rect vector-effect="non-scaling-stroke" x="${k}" y="${I}" width="${T}" height="${E}"/>`);
    }
    g(this, qu) && (o.push("</g></svg>')"), r.backgroundImage = o.join("")), this.container.append(u), this.container.style.clipPath = `url(#${p})`;
  }
  _createPopup() {
    const {
      data: t
    } = this, e = S(this, ju, new z5({
      data: {
        color: t.color,
        titleObj: t.titleObj,
        modificationDate: t.modificationDate,
        contentsObj: t.contentsObj,
        richText: t.richText,
        parentRect: t.rect,
        borderStyle: 0,
        id: `popup_${t.id}`,
        rotation: t.rotation
      },
      parent: this.parent,
      elements: [this]
    }));
    this.parent.div.append(e.render());
  }
  render() {
    Ae("Abstract method `AnnotationElement.render` called");
  }
  _getElementsByName(t, e = null) {
    const i = [];
    if (this._fieldObjects) {
      const n = this._fieldObjects[t];
      if (n)
        for (const {
          page: a,
          id: r,
          exportValues: o
        } of n) {
          if (a === -1 || r === e)
            continue;
          const l = typeof o == "string" ? o : null, c = document.querySelector(`[data-element-id="${r}"]`);
          if (c && !oh.has(c)) {
            zt(`_getElementsByName - element not allowed: ${r}`);
            continue;
          }
          i.push({
            id: r,
            exportValue: l,
            domElement: c
          });
        }
      return i;
    }
    for (const n of document.getElementsByName(t)) {
      const {
        exportValue: a
      } = n, r = n.getAttribute("data-element-id");
      r !== e && oh.has(n) && i.push({
        id: r,
        exportValue: a,
        domElement: n
      });
    }
    return i;
  }
  show() {
    var t;
    this.container && (this.container.hidden = !1), (t = this.popup) == null || t.maybeShow();
  }
  hide() {
    var t;
    this.container && (this.container.hidden = !0), (t = this.popup) == null || t.forceHide();
  }
  getElementsToTriggerPopup() {
    return this.container;
  }
  addHighlightArea() {
    const t = this.getElementsToTriggerPopup();
    if (Array.isArray(t))
      for (const e of t)
        e.classList.add("highlightArea");
    else
      t.classList.add("highlightArea");
  }
  _editOnDoubleClick() {
    if (!this._isEditable)
      return;
    const {
      annotationEditorType: t,
      data: {
        id: e
      }
    } = this;
    this.container.addEventListener("dblclick", () => {
      var i;
      (i = this.linkService.eventBus) == null || i.dispatch("switchannotationeditormode", {
        source: this,
        mode: t,
        editId: e
      });
    });
  }
  get width() {
    return this.data.rect[2] - this.data.rect[0];
  }
  get height() {
    return this.data.rect[3] - this.data.rect[1];
  }
};
kc = new WeakMap(), qu = new WeakMap(), ju = new WeakMap(), pf = new WeakSet(), $5 = function(t) {
  const {
    container: {
      style: e
    },
    data: {
      rect: i,
      rotation: n
    },
    parent: {
      viewport: {
        rawDims: {
          pageWidth: a,
          pageHeight: r,
          pageX: o,
          pageY: l
        }
      }
    }
  } = this;
  i == null || i.splice(0, 4, ...t), e.left = `${100 * (t[0] - o) / a}%`, e.top = `${100 * (r - t[3] + l) / r}%`, n === 0 ? (e.width = `${100 * (t[2] - t[0]) / a}%`, e.height = `${100 * (t[3] - t[1]) / r}%`) : this.setRotation(n);
};
let ts = n8;
var Ji, xl, Iw, _w;
class Cw extends ts {
  constructor(e, i = null) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !!(i != null && i.ignoreBorder),
      createQuadrilaterals: !0
    });
    _(this, Ji);
    this.isTooltipOnly = e.data.isTooltipOnly;
  }
  render() {
    const {
      data: e,
      linkService: i
    } = this, n = document.createElement("a");
    n.setAttribute("data-element-id", e.id);
    let a = !1;
    return e.url ? (i.addLinkAttributes(n, e.url, e.newWindow), a = !0) : e.action ? (this._bindNamedAction(n, e.action), a = !0) : e.attachment ? (C(this, Ji, Iw).call(this, n, e.attachment, e.attachmentDest), a = !0) : e.setOCGState ? (C(this, Ji, _w).call(this, n, e.setOCGState), a = !0) : e.dest ? (this._bindLink(n, e.dest), a = !0) : (e.actions && (e.actions.Action || e.actions["Mouse Up"] || e.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(n, e), a = !0), e.resetForm ? (this._bindResetFormAction(n, e.resetForm), a = !0) : this.isTooltipOnly && !a && (this._bindLink(n, ""), a = !0)), this.container.classList.add("linkAnnotation"), a && this.container.append(n), this.container;
  }
  _bindLink(e, i) {
    e.href = this.linkService.getDestinationHash(i), e.onclick = () => (i && this.linkService.goToDestination(i), !1), (i || i === "") && C(this, Ji, xl).call(this);
  }
  _bindNamedAction(e, i) {
    e.href = this.linkService.getAnchorUrl(""), e.onclick = () => (this.linkService.executeNamedAction(i), !1), C(this, Ji, xl).call(this);
  }
  _bindJSAction(e, i) {
    e.href = this.linkService.getAnchorUrl("");
    const n = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
    for (const a of Object.keys(i.actions)) {
      const r = n.get(a);
      r && (e[r] = () => {
        var o;
        return (o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
          source: this,
          detail: {
            id: i.id,
            name: a
          }
        }), !1;
      });
    }
    e.onclick || (e.onclick = () => !1), C(this, Ji, xl).call(this);
  }
  _bindResetFormAction(e, i) {
    const n = e.onclick;
    if (n || (e.href = this.linkService.getAnchorUrl("")), C(this, Ji, xl).call(this), !this._fieldObjects) {
      zt('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), n || (e.onclick = () => !1);
      return;
    }
    e.onclick = () => {
      var u;
      n == null || n();
      const {
        fields: a,
        refs: r,
        include: o
      } = i, l = [];
      if (a.length !== 0 || r.length !== 0) {
        const f = new Set(r);
        for (const d of a) {
          const p = this._fieldObjects[d] || [];
          for (const {
            id: m
          } of p)
            f.add(m);
        }
        for (const d of Object.values(this._fieldObjects))
          for (const p of d)
            f.has(p.id) === o && l.push(p);
      } else
        for (const f of Object.values(this._fieldObjects))
          l.push(...f);
      const c = this.annotationStorage, h = [];
      for (const f of l) {
        const {
          id: d
        } = f;
        switch (h.push(d), f.type) {
          case "text": {
            const m = f.defaultValue || "";
            c.setValue(d, {
              value: m
            });
            break;
          }
          case "checkbox":
          case "radiobutton": {
            const m = f.defaultValue === f.exportValues;
            c.setValue(d, {
              value: m
            });
            break;
          }
          case "combobox":
          case "listbox": {
            const m = f.defaultValue || "";
            c.setValue(d, {
              value: m
            });
            break;
          }
          default:
            continue;
        }
        const p = document.querySelector(`[data-element-id="${d}"]`);
        if (p) {
          if (!oh.has(p)) {
            zt(`_bindResetFormAction - element not allowed: ${d}`);
            continue;
          }
        } else continue;
        p.dispatchEvent(new Event("resetform"));
      }
      return this.enableScripting && ((u = this.linkService.eventBus) == null || u.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: "app",
          ids: h,
          name: "ResetForm"
        }
      })), !1;
    };
  }
}
Ji = new WeakSet(), xl = function() {
  this.container.setAttribute("data-internal-link", "");
}, Iw = function(e, i, n = null) {
  e.href = this.linkService.getAnchorUrl(""), i.description && (e.title = i.description), e.onclick = () => {
    var a;
    return (a = this.downloadManager) == null || a.openOrDownloadData(i.content, i.filename, n), !1;
  }, C(this, Ji, xl).call(this);
}, _w = function(e, i) {
  e.href = this.linkService.getAnchorUrl(""), e.onclick = () => (this.linkService.executeSetOCGState(i), !1), C(this, Ji, xl).call(this);
};
class WS extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0
    });
  }
  render() {
    this.container.classList.add("textAnnotation");
    const t = document.createElement("img");
    return t.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", t.setAttribute("data-l10n-id", "pdfjs-text-annotation-type"), t.setAttribute("data-l10n-args", JSON.stringify({
      type: this.data.name
    })), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(t), this.container;
  }
}
class mh extends ts {
  render() {
    return this.container;
  }
  showElementAndHideCanvas(t) {
    var e;
    this.data.hasOwnCanvas && (((e = t.previousSibling) == null ? void 0 : e.nodeName) === "CANVAS" && (t.previousSibling.hidden = !0), t.hidden = !1);
  }
  _getKeyModifier(t) {
    return ks.platform.isMac ? t.metaKey : t.ctrlKey;
  }
  _setEventListener(t, e, i, n, a) {
    i.includes("mouse") ? t.addEventListener(i, (r) => {
      var o;
      (o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: this.data.id,
          name: n,
          value: a(r),
          shift: r.shiftKey,
          modifier: this._getKeyModifier(r)
        }
      });
    }) : t.addEventListener(i, (r) => {
      var o;
      if (i === "blur") {
        if (!e.focused || !r.relatedTarget)
          return;
        e.focused = !1;
      } else if (i === "focus") {
        if (e.focused)
          return;
        e.focused = !0;
      }
      a && ((o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: this.data.id,
          name: n,
          value: a(r)
        }
      }));
    });
  }
  _setEventListeners(t, e, i, n) {
    var a, r, o;
    for (const [l, c] of i)
      (c === "Action" || (a = this.data.actions) != null && a[c]) && ((c === "Focus" || c === "Blur") && (e || (e = {
        focused: !1
      })), this._setEventListener(t, e, l, c, n), c === "Focus" && !((r = this.data.actions) != null && r.Blur) ? this._setEventListener(t, e, "blur", "Blur", null) : c === "Blur" && !((o = this.data.actions) != null && o.Focus) && this._setEventListener(t, e, "focus", "Focus", null));
  }
  _setBackgroundColor(t) {
    const e = this.data.backgroundColor || null;
    t.style.backgroundColor = e === null ? "transparent" : Dt.makeHexColor(e[0], e[1], e[2]);
  }
  _setTextStyle(t) {
    const e = ["left", "center", "right"], {
      fontColor: i
    } = this.data.defaultAppearanceData, n = this.data.defaultAppearanceData.fontSize || VS, a = t.style;
    let r;
    const o = 2, l = (c) => Math.round(10 * c) / 10;
    if (this.data.multiLine) {
      const c = Math.abs(this.data.rect[3] - this.data.rect[1] - o), h = Math.round(c / (um * n)) || 1, u = c / h;
      r = Math.min(n, l(u / um));
    } else {
      const c = Math.abs(this.data.rect[3] - this.data.rect[1] - o);
      r = Math.min(n, l(c / um));
    }
    a.fontSize = `calc(${r}px * var(--total-scale-factor))`, a.color = Dt.makeHexColor(i[0], i[1], i[2]), this.data.textAlignment !== null && (a.textAlign = e[this.data.textAlignment]);
  }
  _setRequired(t, e) {
    e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
  }
}
class XS extends mh {
  constructor(t) {
    const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
    super(t, {
      isRenderable: e
    });
  }
  setPropertyOnSiblings(t, e, i, n) {
    const a = this.annotationStorage;
    for (const r of this._getElementsByName(t.name, t.id))
      r.domElement && (r.domElement[e] = i), a.setValue(r.id, {
        [n]: i
      });
  }
  render() {
    var n, a;
    const t = this.annotationStorage, e = this.data.id;
    this.container.classList.add("textWidgetAnnotation");
    let i = null;
    if (this.renderForms) {
      const r = t.getValue(e, {
        value: this.data.fieldValue
      });
      let o = r.value || "";
      const l = t.getValue(e, {
        charLimit: this.data.maxLen
      }).charLimit;
      l && o.length > l && (o = o.slice(0, l));
      let c = r.formattedValue || ((n = this.data.textContent) == null ? void 0 : n.join(`
`)) || null;
      c && this.data.comb && (c = c.replaceAll(/\s+/g, ""));
      const h = {
        userValue: o,
        formattedValue: c,
        lastCommittedValue: null,
        commitKey: 1,
        focused: !1
      };
      this.data.multiLine ? (i = document.createElement("textarea"), i.textContent = c ?? o, this.data.doNotScroll && (i.style.overflowY = "hidden")) : (i = document.createElement("input"), i.type = this.data.password ? "password" : "text", i.setAttribute("value", c ?? o), this.data.doNotScroll && (i.style.overflowX = "hidden")), this.data.hasOwnCanvas && (i.hidden = !0), oh.add(i), i.setAttribute("data-element-id", e), i.disabled = this.data.readOnly, i.name = this.data.fieldName, i.tabIndex = v2, this._setRequired(i, this.data.required), l && (i.maxLength = l), i.addEventListener("input", (f) => {
        t.setValue(e, {
          value: f.target.value
        }), this.setPropertyOnSiblings(i, "value", f.target.value, "value"), h.formattedValue = null;
      }), i.addEventListener("resetform", (f) => {
        const d = this.data.defaultFieldValue ?? "";
        i.value = h.userValue = d, h.formattedValue = null;
      });
      let u = (f) => {
        const {
          formattedValue: d
        } = h;
        d != null && (f.target.value = d), f.target.scrollLeft = 0;
      };
      if (this.enableScripting && this.hasJSActions) {
        i.addEventListener("focus", (d) => {
          var m;
          if (h.focused)
            return;
          const {
            target: p
          } = d;
          h.userValue && (p.value = h.userValue), h.lastCommittedValue = p.value, h.commitKey = 1, (m = this.data.actions) != null && m.Focus || (h.focused = !0);
        }), i.addEventListener("updatefromsandbox", (d) => {
          this.showElementAndHideCanvas(d.target);
          const p = {
            value(m) {
              h.userValue = m.detail.value ?? "", t.setValue(e, {
                value: h.userValue.toString()
              }), m.target.value = h.userValue;
            },
            formattedValue(m) {
              const {
                formattedValue: b
              } = m.detail;
              h.formattedValue = b, b != null && m.target !== document.activeElement && (m.target.value = b), t.setValue(e, {
                formattedValue: b
              });
            },
            selRange(m) {
              m.target.setSelectionRange(...m.detail.selRange);
            },
            charLimit: (m) => {
              var w;
              const {
                charLimit: b
              } = m.detail, {
                target: y
              } = m;
              if (b === 0) {
                y.removeAttribute("maxLength");
                return;
              }
              y.setAttribute("maxLength", b);
              let v = h.userValue;
              !v || v.length <= b || (v = v.slice(0, b), y.value = h.userValue = v, t.setValue(e, {
                value: v
              }), (w = this.linkService.eventBus) == null || w.dispatch("dispatcheventinsandbox", {
                source: this,
                detail: {
                  id: e,
                  name: "Keystroke",
                  value: v,
                  willCommit: !0,
                  commitKey: 1,
                  selStart: y.selectionStart,
                  selEnd: y.selectionEnd
                }
              }));
            }
          };
          this._dispatchEventFromSandbox(p, d);
        }), i.addEventListener("keydown", (d) => {
          var b;
          h.commitKey = 1;
          let p = -1;
          if (d.key === "Escape" ? p = 0 : d.key === "Enter" && !this.data.multiLine ? p = 2 : d.key === "Tab" && (h.commitKey = 3), p === -1)
            return;
          const {
            value: m
          } = d.target;
          h.lastCommittedValue !== m && (h.lastCommittedValue = m, h.userValue = m, (b = this.linkService.eventBus) == null || b.dispatch("dispatcheventinsandbox", {
            source: this,
            detail: {
              id: e,
              name: "Keystroke",
              value: m,
              willCommit: !0,
              commitKey: p,
              selStart: d.target.selectionStart,
              selEnd: d.target.selectionEnd
            }
          }));
        });
        const f = u;
        u = null, i.addEventListener("blur", (d) => {
          var m, b;
          if (!h.focused || !d.relatedTarget)
            return;
          (m = this.data.actions) != null && m.Blur || (h.focused = !1);
          const {
            value: p
          } = d.target;
          h.userValue = p, h.lastCommittedValue !== p && ((b = this.linkService.eventBus) == null || b.dispatch("dispatcheventinsandbox", {
            source: this,
            detail: {
              id: e,
              name: "Keystroke",
              value: p,
              willCommit: !0,
              commitKey: h.commitKey,
              selStart: d.target.selectionStart,
              selEnd: d.target.selectionEnd
            }
          })), f(d);
        }), (a = this.data.actions) != null && a.Keystroke && i.addEventListener("beforeinput", (d) => {
          var x;
          h.lastCommittedValue = null;
          const {
            data: p,
            target: m
          } = d, {
            value: b,
            selectionStart: y,
            selectionEnd: v
          } = m;
          let w = y, A = v;
          switch (d.inputType) {
            case "deleteWordBackward": {
              const k = b.substring(0, y).match(/\w*[^\w]*$/);
              k && (w -= k[0].length);
              break;
            }
            case "deleteWordForward": {
              const k = b.substring(y).match(/^[^\w]*\w*/);
              k && (A += k[0].length);
              break;
            }
            case "deleteContentBackward":
              y === v && (w -= 1);
              break;
            case "deleteContentForward":
              y === v && (A += 1);
              break;
          }
          d.preventDefault(), (x = this.linkService.eventBus) == null || x.dispatch("dispatcheventinsandbox", {
            source: this,
            detail: {
              id: e,
              name: "Keystroke",
              value: b,
              change: p || "",
              willCommit: !1,
              selStart: w,
              selEnd: A
            }
          });
        }), this._setEventListeners(i, h, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (d) => d.target.value);
      }
      if (u && i.addEventListener("blur", u), this.data.comb) {
        const d = (this.data.rect[2] - this.data.rect[0]) / l;
        i.classList.add("comb"), i.style.letterSpacing = `calc(${d}px * var(--total-scale-factor) - 1ch)`;
      }
    } else
      i = document.createElement("div"), i.textContent = this.data.fieldValue, i.style.verticalAlign = "middle", i.style.display = "table-cell", this.data.hasOwnCanvas && (i.hidden = !0);
    return this._setTextStyle(i), this._setBackgroundColor(i), this._setDefaultPropertiesFromJS(i), this.container.append(i), this.container;
  }
}
class KS extends mh {
  constructor(t) {
    super(t, {
      isRenderable: !!t.data.hasOwnCanvas
    });
  }
}
class YS extends mh {
  constructor(t) {
    super(t, {
      isRenderable: t.renderForms
    });
  }
  render() {
    const t = this.annotationStorage, e = this.data, i = e.id;
    let n = t.getValue(i, {
      value: e.exportValue === e.fieldValue
    }).value;
    typeof n == "string" && (n = n !== "Off", t.setValue(i, {
      value: n
    })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
    const a = document.createElement("input");
    return oh.add(a), a.setAttribute("data-element-id", i), a.disabled = e.readOnly, this._setRequired(a, this.data.required), a.type = "checkbox", a.name = e.fieldName, n && a.setAttribute("checked", !0), a.setAttribute("exportValue", e.exportValue), a.tabIndex = v2, a.addEventListener("change", (r) => {
      const {
        name: o,
        checked: l
      } = r.target;
      for (const c of this._getElementsByName(o, i)) {
        const h = l && c.exportValue === e.exportValue;
        c.domElement && (c.domElement.checked = h), t.setValue(c.id, {
          value: h
        });
      }
      t.setValue(i, {
        value: l
      });
    }), a.addEventListener("resetform", (r) => {
      const o = e.defaultFieldValue || "Off";
      r.target.checked = o === e.exportValue;
    }), this.enableScripting && this.hasJSActions && (a.addEventListener("updatefromsandbox", (r) => {
      const o = {
        value(l) {
          l.target.checked = l.detail.value !== "Off", t.setValue(i, {
            value: l.target.checked
          });
        }
      };
      this._dispatchEventFromSandbox(o, r);
    }), this._setEventListeners(a, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (r) => r.target.checked)), this._setBackgroundColor(a), this._setDefaultPropertiesFromJS(a), this.container.append(a), this.container;
  }
}
class Tw extends mh {
  constructor(t) {
    super(t, {
      isRenderable: t.renderForms
    });
  }
  render() {
    this.container.classList.add("buttonWidgetAnnotation", "radioButton");
    const t = this.annotationStorage, e = this.data, i = e.id;
    let n = t.getValue(i, {
      value: e.fieldValue === e.buttonValue
    }).value;
    if (typeof n == "string" && (n = n !== e.buttonValue, t.setValue(i, {
      value: n
    })), n)
      for (const r of this._getElementsByName(e.fieldName, i))
        t.setValue(r.id, {
          value: !1
        });
    const a = document.createElement("input");
    if (oh.add(a), a.setAttribute("data-element-id", i), a.disabled = e.readOnly, this._setRequired(a, this.data.required), a.type = "radio", a.name = e.fieldName, n && a.setAttribute("checked", !0), a.tabIndex = v2, a.addEventListener("change", (r) => {
      const {
        name: o,
        checked: l
      } = r.target;
      for (const c of this._getElementsByName(o, i))
        t.setValue(c.id, {
          value: !1
        });
      t.setValue(i, {
        value: l
      });
    }), a.addEventListener("resetform", (r) => {
      const o = e.defaultFieldValue;
      r.target.checked = o != null && o === e.buttonValue;
    }), this.enableScripting && this.hasJSActions) {
      const r = e.buttonValue;
      a.addEventListener("updatefromsandbox", (o) => {
        const l = {
          value: (c) => {
            const h = r === c.detail.value;
            for (const u of this._getElementsByName(c.target.name)) {
              const f = h && u.id === i;
              u.domElement && (u.domElement.checked = f), t.setValue(u.id, {
                value: f
              });
            }
          }
        };
        this._dispatchEventFromSandbox(l, o);
      }), this._setEventListeners(a, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (o) => o.target.checked);
    }
    return this._setBackgroundColor(a), this._setDefaultPropertiesFromJS(a), this.container.append(a), this.container;
  }
}
class JS extends Cw {
  constructor(t) {
    super(t, {
      ignoreBorder: t.data.hasAppearance
    });
  }
  render() {
    const t = super.render();
    t.classList.add("buttonWidgetAnnotation", "pushButton");
    const e = t.lastChild;
    return this.enableScripting && this.hasJSActions && e && (this._setDefaultPropertiesFromJS(e), e.addEventListener("updatefromsandbox", (i) => {
      this._dispatchEventFromSandbox({}, i);
    })), t;
  }
}
class ZS extends mh {
  constructor(t) {
    super(t, {
      isRenderable: t.renderForms
    });
  }
  render() {
    this.container.classList.add("choiceWidgetAnnotation");
    const t = this.annotationStorage, e = this.data.id, i = t.getValue(e, {
      value: this.data.fieldValue
    }), n = document.createElement("select");
    oh.add(n), n.setAttribute("data-element-id", e), n.disabled = this.data.readOnly, this._setRequired(n, this.data.required), n.name = this.data.fieldName, n.tabIndex = v2;
    let a = 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", (h) => {
      const u = this.data.defaultFieldValue;
      for (const f of n.options)
        f.selected = f.value === u;
    });
    for (const h of this.data.options) {
      const u = document.createElement("option");
      u.textContent = h.displayValue, u.value = h.exportValue, i.value.includes(h.exportValue) && (u.setAttribute("selected", !0), a = !1), n.append(u);
    }
    let r = null;
    if (a) {
      const h = document.createElement("option");
      h.value = " ", h.setAttribute("hidden", !0), h.setAttribute("selected", !0), n.prepend(h), r = () => {
        h.remove(), n.removeEventListener("input", r), r = null;
      }, n.addEventListener("input", r);
    }
    const o = (h) => {
      const u = h ? "value" : "textContent", {
        options: f,
        multiple: d
      } = n;
      return d ? Array.prototype.filter.call(f, (p) => p.selected).map((p) => p[u]) : f.selectedIndex === -1 ? null : f[f.selectedIndex][u];
    };
    let l = o(!1);
    const c = (h) => {
      const u = h.target.options;
      return Array.prototype.map.call(u, (f) => ({
        displayValue: f.textContent,
        exportValue: f.value
      }));
    };
    return this.enableScripting && this.hasJSActions ? (n.addEventListener("updatefromsandbox", (h) => {
      const u = {
        value(f) {
          r == null || r();
          const d = f.detail.value, p = new Set(Array.isArray(d) ? d : [d]);
          for (const m of n.options)
            m.selected = p.has(m.value);
          t.setValue(e, {
            value: o(!0)
          }), l = o(!1);
        },
        multipleSelection(f) {
          n.multiple = !0;
        },
        remove(f) {
          const d = n.options, p = f.detail.remove;
          d[p].selected = !1, n.remove(p), d.length > 0 && Array.prototype.findIndex.call(d, (b) => b.selected) === -1 && (d[0].selected = !0), t.setValue(e, {
            value: o(!0),
            items: c(f)
          }), l = o(!1);
        },
        clear(f) {
          for (; n.length !== 0; )
            n.remove(0);
          t.setValue(e, {
            value: null,
            items: []
          }), l = o(!1);
        },
        insert(f) {
          const {
            index: d,
            displayValue: p,
            exportValue: m
          } = f.detail.insert, b = n.children[d], y = document.createElement("option");
          y.textContent = p, y.value = m, b ? b.before(y) : n.append(y), t.setValue(e, {
            value: o(!0),
            items: c(f)
          }), l = o(!1);
        },
        items(f) {
          const {
            items: d
          } = f.detail;
          for (; n.length !== 0; )
            n.remove(0);
          for (const p of d) {
            const {
              displayValue: m,
              exportValue: b
            } = p, y = document.createElement("option");
            y.textContent = m, y.value = b, n.append(y);
          }
          n.options.length > 0 && (n.options[0].selected = !0), t.setValue(e, {
            value: o(!0),
            items: c(f)
          }), l = o(!1);
        },
        indices(f) {
          const d = new Set(f.detail.indices);
          for (const p of f.target.options)
            p.selected = d.has(p.index);
          t.setValue(e, {
            value: o(!0)
          }), l = o(!1);
        },
        editable(f) {
          f.target.disabled = !f.detail.editable;
        }
      };
      this._dispatchEventFromSandbox(u, h);
    }), n.addEventListener("input", (h) => {
      var d;
      const u = o(!0), f = o(!1);
      t.setValue(e, {
        value: u
      }), h.preventDefault(), (d = this.linkService.eventBus) == null || d.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: e,
          name: "Keystroke",
          value: l,
          change: f,
          changeEx: u,
          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"]], (h) => h.target.value)) : n.addEventListener("input", function(h) {
      t.setValue(e, {
        value: o(!0)
      });
    }), this.data.combo && this._setTextStyle(n), this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
  }
}
class z5 extends ts {
  constructor(t) {
    const {
      data: e,
      elements: i
    } = t;
    super(t, {
      isRenderable: ts._hasPopupData(e)
    }), this.elements = i, this.popup = null;
  }
  render() {
    this.container.classList.add("popupAnnotation");
    const t = this.popup = new QS({
      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
    }), e = [];
    for (const i of this.elements)
      i.popup = t, i.container.ariaHasPopup = "dialog", e.push(i.data.id), i.addHighlightArea();
    return this.container.setAttribute("aria-controls", e.map((i) => `${J6}${i}`).join(",")), this.container;
  }
}
var Hu, y9, w9, $u, zu, $e, Ar, Gu, mf, bf, Vu, xr, jn, kr, yf, Sr, wf, Sc, Cc, xe, xg, G5, Ew, Mw, Fw, Rw, kg, Sg, V5;
class QS {
  constructor({
    container: t,
    color: e,
    elements: i,
    titleObj: n,
    modificationDate: a,
    contentsObj: r,
    richText: o,
    parent: l,
    rect: c,
    parentRect: h,
    open: u
  }) {
    _(this, xe);
    _(this, Hu, C(this, xe, Fw).bind(this));
    _(this, y9, C(this, xe, V5).bind(this));
    _(this, w9, C(this, xe, Sg).bind(this));
    _(this, $u, C(this, xe, kg).bind(this));
    _(this, zu, null);
    _(this, $e, null);
    _(this, Ar, null);
    _(this, Gu, null);
    _(this, mf, null);
    _(this, bf, null);
    _(this, Vu, null);
    _(this, xr, !1);
    _(this, jn, null);
    _(this, kr, null);
    _(this, yf, null);
    _(this, Sr, null);
    _(this, wf, null);
    _(this, Sc, null);
    _(this, Cc, !1);
    var f;
    S(this, $e, t), S(this, wf, n), S(this, Ar, r), S(this, Sr, o), S(this, bf, l), S(this, zu, e), S(this, yf, c), S(this, Vu, h), S(this, mf, i), S(this, Gu, H9.toDateObject(a)), this.trigger = i.flatMap((d) => d.getElementsToTriggerPopup());
    for (const d of this.trigger)
      d.addEventListener("click", g(this, $u)), d.addEventListener("mouseenter", g(this, w9)), d.addEventListener("mouseleave", g(this, y9)), d.classList.add("popupTriggerArea");
    for (const d of i)
      (f = d.container) == null || f.addEventListener("keydown", g(this, Hu));
    g(this, $e).hidden = !0, u && C(this, xe, kg).call(this);
  }
  render() {
    if (g(this, jn))
      return;
    const t = S(this, jn, document.createElement("div"));
    if (t.className = "popup", g(this, zu)) {
      const a = t.style.outlineColor = Dt.makeHexColor(...g(this, zu));
      t.style.backgroundColor = `color-mix(in srgb, ${a} 30%, white)`;
    }
    const e = document.createElement("span");
    e.className = "header";
    const i = document.createElement("h1");
    if (e.append(i), {
      dir: i.dir,
      str: i.textContent
    } = g(this, wf), t.append(e), g(this, Gu)) {
      const a = document.createElement("span");
      a.classList.add("popupDate"), a.setAttribute("data-l10n-id", "pdfjs-annotation-date-time-string"), a.setAttribute("data-l10n-args", JSON.stringify({
        dateObj: g(this, Gu).valueOf()
      })), e.append(a);
    }
    const n = g(this, xe, xg);
    if (n)
      i7.render({
        xfaHtml: n,
        intent: "richText",
        div: t
      }), t.lastChild.classList.add("richText", "popupContent");
    else {
      const a = this._formatContents(g(this, Ar));
      t.append(a);
    }
    g(this, $e).append(t);
  }
  _formatContents({
    str: t,
    dir: e
  }) {
    const i = document.createElement("p");
    i.classList.add("popupContent"), i.dir = e;
    const n = t.split(/(?:\r\n?|\n)/);
    for (let a = 0, r = n.length; a < r; ++a) {
      const o = n[a];
      i.append(document.createTextNode(o)), a < r - 1 && i.append(document.createElement("br"));
    }
    return i;
  }
  updateEdited({
    rect: t,
    popupContent: e
  }) {
    var i;
    g(this, Sc) || S(this, Sc, {
      contentsObj: g(this, Ar),
      richText: g(this, Sr)
    }), t && S(this, kr, null), e && (S(this, Sr, C(this, xe, Mw).call(this, e)), S(this, Ar, null)), (i = g(this, jn)) == null || i.remove(), S(this, jn, null);
  }
  resetEdited() {
    var t;
    g(this, Sc) && ({
      contentsObj: Qs(this, Ar)._,
      richText: Qs(this, Sr)._
    } = g(this, Sc), S(this, Sc, null), (t = g(this, jn)) == null || t.remove(), S(this, jn, null), S(this, kr, null));
  }
  forceHide() {
    S(this, Cc, this.isVisible), g(this, Cc) && (g(this, $e).hidden = !0);
  }
  maybeShow() {
    g(this, Cc) && (g(this, jn) || C(this, xe, Sg).call(this), S(this, Cc, !1), g(this, $e).hidden = !1);
  }
  get isVisible() {
    return g(this, $e).hidden === !1;
  }
}
Hu = new WeakMap(), y9 = new WeakMap(), w9 = new WeakMap(), $u = new WeakMap(), zu = new WeakMap(), $e = new WeakMap(), Ar = new WeakMap(), Gu = new WeakMap(), mf = new WeakMap(), bf = new WeakMap(), Vu = new WeakMap(), xr = new WeakMap(), jn = new WeakMap(), kr = new WeakMap(), yf = new WeakMap(), Sr = new WeakMap(), wf = new WeakMap(), Sc = new WeakMap(), Cc = new WeakMap(), xe = new WeakSet(), xg = function() {
  const t = g(this, Sr), e = g(this, Ar);
  return t != null && t.str && (!(e != null && e.str) || e.str === t.str) && g(this, Sr).html || null;
}, G5 = function() {
  var t, e, i;
  return ((i = (e = (t = g(this, xe, xg)) == null ? void 0 : t.attributes) == null ? void 0 : e.style) == null ? void 0 : i.fontSize) || 0;
}, Ew = function() {
  var t, e, i;
  return ((i = (e = (t = g(this, xe, xg)) == null ? void 0 : t.attributes) == null ? void 0 : e.style) == null ? void 0 : i.color) || null;
}, Mw = function(t) {
  const e = [], i = {
    str: t,
    html: {
      name: "div",
      attributes: {
        dir: "auto"
      },
      children: [{
        name: "p",
        children: e
      }]
    }
  }, n = {
    style: {
      color: g(this, xe, Ew),
      fontSize: g(this, xe, G5) ? `calc(${g(this, xe, G5)}px * var(--total-scale-factor))` : ""
    }
  };
  for (const a of t.split(`
`))
    e.push({
      name: "span",
      value: a,
      attributes: n
    });
  return i;
}, Fw = function(t) {
  t.altKey || t.shiftKey || t.ctrlKey || t.metaKey || (t.key === "Enter" || t.key === "Escape" && g(this, xr)) && C(this, xe, kg).call(this);
}, Rw = function() {
  if (g(this, kr) !== null)
    return;
  const {
    page: {
      view: t
    },
    viewport: {
      rawDims: {
        pageWidth: e,
        pageHeight: i,
        pageX: n,
        pageY: a
      }
    }
  } = g(this, bf);
  let r = !!g(this, Vu), o = r ? g(this, Vu) : g(this, yf);
  for (const p of g(this, mf))
    if (!o || Dt.intersect(p.data.rect, o) !== null) {
      o = p.data.rect, r = !0;
      break;
    }
  const l = Dt.normalizeRect([o[0], t[3] - o[1] + t[1], o[2], t[3] - o[3] + t[1]]), h = r ? o[2] - o[0] + 5 : 0, u = l[0] + h, f = l[1];
  S(this, kr, [100 * (u - n) / e, 100 * (f - a) / i]);
  const {
    style: d
  } = g(this, $e);
  d.left = `${g(this, kr)[0]}%`, d.top = `${g(this, kr)[1]}%`;
}, kg = function() {
  S(this, xr, !g(this, xr)), g(this, xr) ? (C(this, xe, Sg).call(this), g(this, $e).addEventListener("click", g(this, $u)), g(this, $e).addEventListener("keydown", g(this, Hu))) : (C(this, xe, V5).call(this), g(this, $e).removeEventListener("click", g(this, $u)), g(this, $e).removeEventListener("keydown", g(this, Hu)));
}, Sg = function() {
  g(this, jn) || this.render(), this.isVisible ? g(this, xr) && g(this, $e).classList.add("focused") : (C(this, xe, Rw).call(this), g(this, $e).hidden = !1, g(this, $e).style.zIndex = parseInt(g(this, $e).style.zIndex) + 1e3);
}, V5 = function() {
  g(this, $e).classList.remove("focused"), !(g(this, xr) || !this.isVisible) && (g(this, $e).hidden = !0, g(this, $e).style.zIndex = parseInt(g(this, $e).style.zIndex) - 1e3);
};
class Pw extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0
    }), this.textContent = t.data.textContent, this.textPosition = t.data.textPosition, this.annotationEditorType = Ht.FREETEXT;
  }
  render() {
    if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
      const t = document.createElement("div");
      t.classList.add("annotationTextContent"), t.setAttribute("role", "comment");
      for (const e of this.textContent) {
        const i = document.createElement("span");
        i.textContent = e, t.append(i);
      }
      this.container.append(t);
    }
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
  }
}
var vf;
class tC extends ts {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    _(this, vf, null);
  }
  render() {
    this.container.classList.add("lineAnnotation");
    const {
      data: e,
      width: i,
      height: n
    } = this, a = this.svgFactory.create(i, n, !0), r = S(this, vf, this.svgFactory.createElement("svg:line"));
    return r.setAttribute("x1", e.rect[2] - e.lineCoordinates[0]), r.setAttribute("y1", e.rect[3] - e.lineCoordinates[1]), r.setAttribute("x2", e.rect[2] - e.lineCoordinates[2]), r.setAttribute("y2", e.rect[3] - e.lineCoordinates[3]), r.setAttribute("stroke-width", e.borderStyle.width || 1), r.setAttribute("stroke", "transparent"), r.setAttribute("fill", "transparent"), a.append(r), this.container.append(a), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return g(this, vf);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
vf = new WeakMap();
var Af;
class eC extends ts {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    _(this, Af, null);
  }
  render() {
    this.container.classList.add("squareAnnotation");
    const {
      data: e,
      width: i,
      height: n
    } = this, a = this.svgFactory.create(i, n, !0), r = e.borderStyle.width, o = S(this, Af, this.svgFactory.createElement("svg:rect"));
    return o.setAttribute("x", r / 2), o.setAttribute("y", r / 2), o.setAttribute("width", i - r), o.setAttribute("height", n - r), o.setAttribute("stroke-width", r || 1), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "transparent"), a.append(o), this.container.append(a), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return g(this, Af);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
Af = new WeakMap();
var xf;
class sC extends ts {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    _(this, xf, null);
  }
  render() {
    this.container.classList.add("circleAnnotation");
    const {
      data: e,
      width: i,
      height: n
    } = this, a = this.svgFactory.create(i, n, !0), r = e.borderStyle.width, o = S(this, xf, this.svgFactory.createElement("svg:ellipse"));
    return o.setAttribute("cx", i / 2), o.setAttribute("cy", n / 2), o.setAttribute("rx", i / 2 - r / 2), o.setAttribute("ry", n / 2 - r / 2), o.setAttribute("stroke-width", r || 1), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "transparent"), a.append(o), this.container.append(a), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return g(this, xf);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
xf = new WeakMap();
var kf;
class Dw extends ts {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    _(this, kf, null);
    this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
  }
  render() {
    this.container.classList.add(this.containerClassName);
    const {
      data: {
        rect: e,
        vertices: i,
        borderStyle: n,
        popupRef: a
      },
      width: r,
      height: o
    } = this;
    if (!i)
      return this.container;
    const l = this.svgFactory.create(r, o, !0);
    let c = [];
    for (let u = 0, f = i.length; u < f; u += 2) {
      const d = i[u] - e[0], p = e[3] - i[u + 1];
      c.push(`${d},${p}`);
    }
    c = c.join(" ");
    const h = S(this, kf, this.svgFactory.createElement(this.svgElementName));
    return h.setAttribute("points", c), h.setAttribute("stroke-width", n.width || 1), h.setAttribute("stroke", "transparent"), h.setAttribute("fill", "transparent"), l.append(h), this.container.append(l), !a && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return g(this, kf);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
kf = new WeakMap();
class iC extends Dw {
  constructor(t) {
    super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
  }
}
class nC extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0
    });
  }
  render() {
    return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
}
var Sf, Ic, Cf, W5;
class n7 extends ts {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    _(this, Cf);
    _(this, Sf, null);
    _(this, Ic, []);
    this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = this.data.it === "InkHighlight" ? Ht.HIGHLIGHT : Ht.INK;
  }
  render() {
    this.container.classList.add(this.containerClassName);
    const {
      data: {
        rect: e,
        rotation: i,
        inkLists: n,
        borderStyle: a,
        popupRef: r
      }
    } = this, {
      transform: o,
      width: l,
      height: c
    } = C(this, Cf, W5).call(this, i, e), h = this.svgFactory.create(l, c, !0), u = S(this, Sf, this.svgFactory.createElement("svg:g"));
    h.append(u), u.setAttribute("stroke-width", a.width || 1), u.setAttribute("stroke-linecap", "round"), u.setAttribute("stroke-linejoin", "round"), u.setAttribute("stroke-miterlimit", 10), u.setAttribute("stroke", "transparent"), u.setAttribute("fill", "transparent"), u.setAttribute("transform", o);
    for (let f = 0, d = n.length; f < d; f++) {
      const p = this.svgFactory.createElement(this.svgElementName);
      g(this, Ic).push(p), p.setAttribute("points", n[f].join(",")), u.append(p);
    }
    return !r && this.hasPopupData && this._createPopup(), this.container.append(h), this._editOnDoubleClick(), this.container;
  }
  updateEdited(e) {
    super.updateEdited(e);
    const {
      thickness: i,
      points: n,
      rect: a
    } = e, r = g(this, Sf);
    if (i >= 0 && r.setAttribute("stroke-width", i || 1), n)
      for (let o = 0, l = g(this, Ic).length; o < l; o++)
        g(this, Ic)[o].setAttribute("points", n[o].join(","));
    if (a) {
      const {
        transform: o,
        width: l,
        height: c
      } = C(this, Cf, W5).call(this, this.data.rotation, a);
      r.parentElement.setAttribute("viewBox", `0 0 ${l} ${c}`), r.setAttribute("transform", o);
    }
  }
  getElementsToTriggerPopup() {
    return g(this, Ic);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
Sf = new WeakMap(), Ic = new WeakMap(), Cf = new WeakSet(), W5 = function(e, i) {
  switch (e) {
    case 90:
      return {
        transform: `rotate(90) translate(${-i[0]},${i[1]}) scale(1,-1)`,
        width: i[3] - i[1],
        height: i[2] - i[0]
      };
    case 180:
      return {
        transform: `rotate(180) translate(${-i[2]},${i[1]}) scale(1,-1)`,
        width: i[2] - i[0],
        height: i[3] - i[1]
      };
    case 270:
      return {
        transform: `rotate(270) translate(${-i[2]},${i[3]}) scale(1,-1)`,
        width: i[3] - i[1],
        height: i[2] - i[0]
      };
    default:
      return {
        transform: `translate(${-i[0]},${i[3]}) scale(1,-1)`,
        width: i[2] - i[0],
        height: i[3] - i[1]
      };
  }
};
class Nw extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    }), this.annotationEditorType = Ht.HIGHLIGHT;
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this._editOnDoubleClick(), this.container;
  }
}
class aC extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    });
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
  }
}
class rC extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    });
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
  }
}
class oC extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    });
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
  }
}
class Bw extends ts {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0
    }), this.annotationEditorType = Ht.STAMP;
  }
  render() {
    return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
  }
}
var If, _f, X5;
class lC extends ts {
  constructor(e) {
    var n;
    super(e, {
      isRenderable: !0
    });
    _(this, _f);
    _(this, If, null);
    const {
      file: i
    } = this.data;
    this.filename = i.filename, this.content = i.content, (n = this.linkService.eventBus) == null || n.dispatch("fileattachmentannotation", {
      source: this,
      ...i
    });
  }
  render() {
    this.container.classList.add("fileAttachmentAnnotation");
    const {
      container: e,
      data: i
    } = this;
    let n;
    i.hasAppearance || i.fillAlpha === 0 ? n = document.createElement("div") : (n = document.createElement("img"), n.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(i.name) ? "paperclip" : "pushpin"}.svg`, i.fillAlpha && i.fillAlpha < 1 && (n.style = `filter: opacity(${Math.round(i.fillAlpha * 100)}%);`)), n.addEventListener("dblclick", C(this, _f, X5).bind(this)), S(this, If, n);
    const {
      isMac: a
    } = ks.platform;
    return e.addEventListener("keydown", (r) => {
      r.key === "Enter" && (a ? r.metaKey : r.ctrlKey) && C(this, _f, X5).call(this);
    }), !i.popupRef && this.hasPopupData ? this._createPopup() : n.classList.add("popupTriggerArea"), e.append(n), e;
  }
  getElementsToTriggerPopup() {
    return g(this, If);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
If = new WeakMap(), _f = new WeakSet(), X5 = function() {
  var e;
  (e = this.downloadManager) == null || e.openOrDownloadData(this.content, this.filename);
};
var Tf, _c, Do, Ef, dl, K5, Y5;
const a8 = class a8 {
  constructor({
    div: t,
    accessibilityManager: e,
    annotationCanvasMap: i,
    annotationEditorUIManager: n,
    page: a,
    viewport: r,
    structTreeLayer: o
  }) {
    _(this, dl);
    _(this, Tf, null);
    _(this, _c, null);
    _(this, Do, /* @__PURE__ */ new Map());
    _(this, Ef, null);
    this.div = t, S(this, Tf, e), S(this, _c, i), S(this, Ef, o || null), this.page = a, this.viewport = r, this.zIndex = 0, this._annotationEditorUIManager = n;
  }
  hasEditableAnnotations() {
    return g(this, Do).size > 0;
  }
  async render(t) {
    var r;
    const {
      annotations: e
    } = t, i = this.div;
    rl(i, this.viewport);
    const n = /* @__PURE__ */ new Map(), a = {
      data: null,
      layer: i,
      linkService: t.linkService,
      downloadManager: t.downloadManager,
      imageResourcesPath: t.imageResourcesPath || "",
      renderForms: t.renderForms !== !1,
      svgFactory: new e0(),
      annotationStorage: t.annotationStorage || new Q6(),
      enableScripting: t.enableScripting === !0,
      hasJSActions: t.hasJSActions,
      fieldObjects: t.fieldObjects,
      parent: this,
      elements: null
    };
    for (const o of e) {
      if (o.noHTML)
        continue;
      const l = o.annotationType === Xe.POPUP;
      if (l) {
        const u = n.get(o.id);
        if (!u)
          continue;
        a.elements = u;
      } else if (o.rect[2] === o.rect[0] || o.rect[3] === o.rect[1])
        continue;
      a.data = o;
      const c = P8.create(a);
      if (!c.isRenderable)
        continue;
      if (!l && o.popupRef) {
        const u = n.get(o.popupRef);
        u ? u.push(c) : n.set(o.popupRef, [c]);
      }
      const h = c.render();
      o.hidden && (h.style.visibility = "hidden"), await C(this, dl, K5).call(this, h, o.id), c._isEditable && (g(this, Do).set(c.data.id, c), (r = this._annotationEditorUIManager) == null || r.renderAnnotationElement(c));
    }
    C(this, dl, Y5).call(this);
  }
  async addLinkAnnotations(t, e) {
    const i = {
      data: null,
      layer: this.div,
      linkService: e,
      svgFactory: new e0(),
      parent: this
    };
    for (const n of t) {
      n.borderStyle || (n.borderStyle = a8._defaultBorderStyle), i.data = n;
      const a = P8.create(i);
      if (!a.isRenderable)
        continue;
      const r = a.render();
      await C(this, dl, K5).call(this, r, n.id);
    }
  }
  update({
    viewport: t
  }) {
    const e = this.div;
    this.viewport = t, rl(e, {
      rotation: t.rotation
    }), C(this, dl, Y5).call(this), e.hidden = !1;
  }
  getEditableAnnotations() {
    return Array.from(g(this, Do).values());
  }
  getEditableAnnotation(t) {
    return g(this, Do).get(t);
  }
  static get _defaultBorderStyle() {
    return ne(this, "_defaultBorderStyle", Object.freeze({
      width: 1,
      rawWidth: 1,
      style: Eh.SOLID,
      dashArray: [3],
      horizontalCornerRadius: 0,
      verticalCornerRadius: 0
    }));
  }
};
Tf = new WeakMap(), _c = new WeakMap(), Do = new WeakMap(), Ef = new WeakMap(), dl = new WeakSet(), K5 = async function(t, e) {
  var r, o;
  const i = t.firstChild || t, n = i.id = `${J6}${e}`, a = await ((r = g(this, Ef)) == null ? void 0 : r.getAriaAttributes(n));
  if (a)
    for (const [l, c] of a)
      i.setAttribute(l, c);
  this.div.append(t), (o = g(this, Tf)) == null || o.moveElementInDOM(this.div, t, i, !1);
}, Y5 = function() {
  var e;
  if (!g(this, _c))
    return;
  const t = this.div;
  for (const [i, n] of g(this, _c)) {
    const a = t.querySelector(`[data-annotation-id="${i}"]`);
    if (!a)
      continue;
    n.className = "annotationContent";
    const {
      firstChild: r
    } = a;
    r ? r.nodeName === "CANVAS" ? r.replaceWith(n) : r.classList.contains("annotationContent") ? r.after(n) : r.before(n) : a.append(n);
    const o = g(this, Do).get(i);
    o && (o._hasNoCanvas ? ((e = this._annotationEditorUIManager) == null || e.setMissingCanvas(i, a.id, n), o._hasNoCanvas = !1) : o.canvas = n);
  }
  g(this, _c).clear();
};
let up = a8;
const U2 = /\r\n?|\n/g;
var Hn, Oi, Mf, Tc, Ui, as, Lw, Ow, Uw, Cg, $r, Ig, _g, qw, Z5, jw;
const Se = class Se extends Ie {
  constructor(e) {
    super({
      ...e,
      name: "freeTextEditor"
    });
    _(this, as);
    _(this, Hn);
    _(this, Oi, "");
    _(this, Mf, `${this.id}-editor`);
    _(this, Tc, null);
    _(this, Ui);
    S(this, Hn, e.color || Se._defaultColor || Ie._defaultLineColor), S(this, Ui, e.fontSize || Se._defaultFontSize);
  }
  static get _keyboardManager() {
    const e = Se.prototype, i = (r) => r.isEmpty(), n = ol.TRANSLATE_SMALL, a = ol.TRANSLATE_BIG;
    return ne(this, "_keyboardManager", new y2([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], e.commitOrRemove, {
      bubbles: !0
    }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], e.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], e._translateEmpty, {
      args: [-n, 0],
      checker: i
    }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], e._translateEmpty, {
      args: [-a, 0],
      checker: i
    }], [["ArrowRight", "mac+ArrowRight"], e._translateEmpty, {
      args: [n, 0],
      checker: i
    }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], e._translateEmpty, {
      args: [a, 0],
      checker: i
    }], [["ArrowUp", "mac+ArrowUp"], e._translateEmpty, {
      args: [0, -n],
      checker: i
    }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], e._translateEmpty, {
      args: [0, -a],
      checker: i
    }], [["ArrowDown", "mac+ArrowDown"], e._translateEmpty, {
      args: [0, n],
      checker: i
    }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], e._translateEmpty, {
      args: [0, a],
      checker: i
    }]]));
  }
  static initialize(e, i) {
    Ie.initialize(e, i);
    const n = getComputedStyle(document.documentElement);
    this._internalPadding = parseFloat(n.getPropertyValue("--freetext-padding"));
  }
  static updateDefaultParams(e, i) {
    switch (e) {
      case ae.FREETEXT_SIZE:
        Se._defaultFontSize = i;
        break;
      case ae.FREETEXT_COLOR:
        Se._defaultColor = i;
        break;
    }
  }
  updateParams(e, i) {
    switch (e) {
      case ae.FREETEXT_SIZE:
        C(this, as, Lw).call(this, i);
        break;
      case ae.FREETEXT_COLOR:
        C(this, as, Ow).call(this, i);
        break;
    }
  }
  static get defaultPropertiesToUpdate() {
    return [[ae.FREETEXT_SIZE, Se._defaultFontSize], [ae.FREETEXT_COLOR, Se._defaultColor || Ie._defaultLineColor]];
  }
  get propertiesToUpdate() {
    return [[ae.FREETEXT_SIZE, g(this, Ui)], [ae.FREETEXT_COLOR, g(this, Hn)]];
  }
  _translateEmpty(e, i) {
    this._uiManager.translateSelectedEditors(e, i, !0);
  }
  getInitialTranslation() {
    const e = this.parentScale;
    return [-Se._internalPadding * e, -(Se._internalPadding + g(this, Ui)) * e];
  }
  rebuild() {
    this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
  }
  enableEditMode() {
    if (!super.enableEditMode())
      return !1;
    this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), S(this, Tc, new AbortController());
    const e = this._uiManager.combinedSignal(g(this, Tc));
    return this.editorDiv.addEventListener("keydown", this.editorDivKeydown.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("focus", this.editorDivFocus.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("blur", this.editorDivBlur.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("input", this.editorDivInput.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("paste", this.editorDivPaste.bind(this), {
      signal: e
    }), !0;
  }
  disableEditMode() {
    var e;
    return super.disableEditMode() ? (this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", g(this, Mf)), this._isDraggable = !0, (e = g(this, Tc)) == null || e.abort(), S(this, Tc, null), this.div.focus({
      preventScroll: !0
    }), this.isEditing = !1, this.parent.div.classList.add("freetextEditing"), !0) : !1;
  }
  focusin(e) {
    this._focusEventsAllowed && (super.focusin(e), e.target !== this.editorDiv && this.editorDiv.focus());
  }
  onceAdded(e) {
    var i;
    this.width || (this.enableEditMode(), e && this.editorDiv.focus(), (i = this._initialOptions) != null && i.isCentered && this.center(), this._initialOptions = null);
  }
  isEmpty() {
    return !this.editorDiv || this.editorDiv.innerText.trim() === "";
  }
  remove() {
    this.isEditing = !1, this.parent && (this.parent.setEditingState(!0), this.parent.div.classList.add("freetextEditing")), super.remove();
  }
  commit() {
    if (!this.isInEditMode())
      return;
    super.commit(), this.disableEditMode();
    const e = g(this, Oi), i = S(this, Oi, C(this, as, Uw).call(this).trimEnd());
    if (e === i)
      return;
    const n = (a) => {
      if (S(this, Oi, a), !a) {
        this.remove();
        return;
      }
      C(this, as, _g).call(this), this._uiManager.rebuild(this), C(this, as, Cg).call(this);
    };
    this.addCommands({
      cmd: () => {
        n(i);
      },
      undo: () => {
        n(e);
      },
      mustExec: !1
    }), C(this, as, Cg).call(this);
  }
  shouldGetKeyboardEvents() {
    return this.isInEditMode();
  }
  enterInEditMode() {
    this.enableEditMode(), this.editorDiv.focus();
  }
  keydown(e) {
    e.target === this.div && e.key === "Enter" && (this.enterInEditMode(), e.preventDefault());
  }
  editorDivKeydown(e) {
    Se._keyboardManager.exec(this, e);
  }
  editorDivFocus(e) {
    this.isEditing = !0;
  }
  editorDivBlur(e) {
    this.isEditing = !1;
  }
  editorDivInput(e) {
    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);
  }
  get canChangeContent() {
    return !0;
  }
  render() {
    if (this.div)
      return this.div;
    let e, i;
    (this._isCopy || this.annotationElementId) && (e = this.x, i = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", g(this, Mf)), this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text2"), this.editorDiv.setAttribute("data-l10n-attrs", "default-content"), this.enableEditing(), this.editorDiv.contentEditable = !0;
    const {
      style: n
    } = this.editorDiv;
    if (n.fontSize = `calc(${g(this, Ui)}px * var(--total-scale-factor))`, n.color = g(this, Hn), this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), this._isCopy || this.annotationElementId) {
      const [a, r] = this.parentDimensions;
      if (this.annotationElementId) {
        const {
          position: o
        } = this._initialData;
        let [l, c] = this.getInitialTranslation();
        [l, c] = this.pageTranslationToScreen(l, c);
        const [h, u] = this.pageDimensions, [f, d] = this.pageTranslation;
        let p, m;
        switch (this.rotation) {
          case 0:
            p = e + (o[0] - f) / h, m = i + this.height - (o[1] - d) / u;
            break;
          case 90:
            p = e + (o[0] - f) / h, m = i - (o[1] - d) / u, [l, c] = [c, -l];
            break;
          case 180:
            p = e - this.width + (o[0] - f) / h, m = i - (o[1] - d) / u, [l, c] = [-l, -c];
            break;
          case 270:
            p = e + (o[0] - f - this.height * u) / h, m = i + (o[1] - d - this.width * h) / u, [l, c] = [-c, l];
            break;
        }
        this.setAt(p * a, m * r, l, c);
      } else
        this._moveAfterPaste(e, i);
      C(this, as, _g).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
    } else
      this._isDraggable = !1, this.editorDiv.contentEditable = !0;
    return this.div;
  }
  editorDivPaste(e) {
    var p, m, b;
    const i = e.clipboardData || window.clipboardData, {
      types: n
    } = i;
    if (n.length === 1 && n[0] === "text/plain")
      return;
    e.preventDefault();
    const a = C(p = Se, $r, Z5).call(p, i.getData("text") || "").replaceAll(U2, `
`);
    if (!a)
      return;
    const r = window.getSelection();
    if (!r.rangeCount)
      return;
    this.editorDiv.normalize(), r.deleteFromDocument();
    const o = r.getRangeAt(0);
    if (!a.includes(`
`)) {
      o.insertNode(document.createTextNode(a)), this.editorDiv.normalize(), r.collapseToStart();
      return;
    }
    const {
      startContainer: l,
      startOffset: c
    } = o, h = [], u = [];
    if (l.nodeType === Node.TEXT_NODE) {
      const y = l.parentElement;
      if (u.push(l.nodeValue.slice(c).replaceAll(U2, "")), y !== this.editorDiv) {
        let v = h;
        for (const w of this.editorDiv.childNodes) {
          if (w === y) {
            v = u;
            continue;
          }
          v.push(C(m = Se, $r, Ig).call(m, w));
        }
      }
      h.push(l.nodeValue.slice(0, c).replaceAll(U2, ""));
    } else if (l === this.editorDiv) {
      let y = h, v = 0;
      for (const w of this.editorDiv.childNodes)
        v++ === c && (y = u), y.push(C(b = Se, $r, Ig).call(b, w));
    }
    S(this, Oi, `${h.join(`
`)}${a}${u.join(`
`)}`), C(this, as, _g).call(this);
    const f = new Range();
    let d = Math.sumPrecise(h.map((y) => y.length));
    for (const {
      firstChild: y
    } of this.editorDiv.childNodes)
      if (y.nodeType === Node.TEXT_NODE) {
        const v = y.nodeValue.length;
        if (d <= v) {
          f.setStart(y, d), f.setEnd(y, d);
          break;
        }
        d -= v;
      }
    r.removeAllRanges(), r.addRange(f);
  }
  get contentDiv() {
    return this.editorDiv;
  }
  static async deserialize(e, i, n) {
    var o;
    let a = null;
    if (e instanceof Pw) {
      const {
        data: {
          defaultAppearanceData: {
            fontSize: l,
            fontColor: c
          },
          rect: h,
          rotation: u,
          id: f,
          popupRef: d
        },
        textContent: p,
        textPosition: m,
        parent: {
          page: {
            pageNumber: b
          }
        }
      } = e;
      if (!p || p.length === 0)
        return null;
      a = e = {
        annotationType: Ht.FREETEXT,
        color: Array.from(c),
        fontSize: l,
        value: p.join(`
`),
        position: m,
        pageIndex: b - 1,
        rect: h.slice(0),
        rotation: u,
        id: f,
        deleted: !1,
        popupRef: d
      };
    }
    const r = await super.deserialize(e, i, n);
    return S(r, Ui, e.fontSize), S(r, Hn, Dt.makeHexColor(...e.color)), S(r, Oi, C(o = Se, $r, Z5).call(o, e.value)), r.annotationElementId = e.id || null, r._initialData = a, r;
  }
  serialize(e = !1) {
    if (this.isEmpty())
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const i = Se._internalPadding * this.parentScale, n = this.getRect(i, i), a = Ie._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : g(this, Hn)), r = {
      annotationType: Ht.FREETEXT,
      color: a,
      fontSize: g(this, Ui),
      value: C(this, as, qw).call(this),
      pageIndex: this.pageIndex,
      rect: n,
      rotation: this.rotation,
      structTreeParentId: this._structTreeParentId
    };
    return e ? (r.isCopy = !0, r) : this.annotationElementId && !C(this, as, jw).call(this, r) ? null : (r.id = this.annotationElementId, r);
  }
  renderAnnotationElement(e) {
    const i = super.renderAnnotationElement(e);
    if (this.deleted)
      return i;
    const {
      style: n
    } = i;
    n.fontSize = `calc(${g(this, Ui)}px * var(--total-scale-factor))`, n.color = g(this, Hn), i.replaceChildren();
    for (const r of g(this, Oi).split(`
`)) {
      const o = document.createElement("div");
      o.append(r ? document.createTextNode(r) : document.createElement("br")), i.append(o);
    }
    const a = Se._internalPadding * this.parentScale;
    return e.updateEdited({
      rect: this.getRect(a, a),
      popupContent: g(this, Oi)
    }), i;
  }
  resetAnnotationElement(e) {
    super.resetAnnotationElement(e), e.resetEdited();
  }
};
Hn = new WeakMap(), Oi = new WeakMap(), Mf = new WeakMap(), Tc = new WeakMap(), Ui = new WeakMap(), as = new WeakSet(), Lw = function(e) {
  const i = (a) => {
    this.editorDiv.style.fontSize = `calc(${a}px * var(--total-scale-factor))`, this.translate(0, -(a - g(this, Ui)) * this.parentScale), S(this, Ui, a), C(this, as, Cg).call(this);
  }, n = g(this, Ui);
  this.addCommands({
    cmd: i.bind(this, e),
    undo: i.bind(this, n),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: ae.FREETEXT_SIZE,
    overwriteIfSameType: !0,
    keepUndo: !0
  });
}, Ow = function(e) {
  const i = (a) => {
    S(this, Hn, this.editorDiv.style.color = a);
  }, n = g(this, Hn);
  this.addCommands({
    cmd: i.bind(this, e),
    undo: i.bind(this, n),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: ae.FREETEXT_COLOR,
    overwriteIfSameType: !0,
    keepUndo: !0
  });
}, Uw = function() {
  var n;
  const e = [];
  this.editorDiv.normalize();
  let i = null;
  for (const a of this.editorDiv.childNodes)
    (i == null ? void 0 : i.nodeType) === Node.TEXT_NODE && a.nodeName === "BR" || (e.push(C(n = Se, $r, Ig).call(n, a)), i = a);
  return e.join(`
`);
}, Cg = function() {
  const [e, i] = this.parentDimensions;
  let n;
  if (this.isAttachedToDOM)
    n = this.div.getBoundingClientRect();
  else {
    const {
      currentLayer: a,
      div: r
    } = this, o = r.style.display, l = r.classList.contains("hidden");
    r.classList.remove("hidden"), r.style.display = "hidden", a.div.append(this.div), n = r.getBoundingClientRect(), r.remove(), r.style.display = o, r.classList.toggle("hidden", l);
  }
  this.rotation % 180 === this.parentRotation % 180 ? (this.width = n.width / e, this.height = n.height / i) : (this.width = n.height / e, this.height = n.width / i), this.fixAndSetPosition();
}, $r = new WeakSet(), Ig = function(e) {
  return (e.nodeType === Node.TEXT_NODE ? e.nodeValue : e.innerText).replaceAll(U2, "");
}, _g = function() {
  if (this.editorDiv.replaceChildren(), !!g(this, Oi))
    for (const e of g(this, Oi).split(`
`)) {
      const i = document.createElement("div");
      i.append(e ? document.createTextNode(e) : document.createElement("br")), this.editorDiv.append(i);
    }
}, qw = function() {
  return g(this, Oi).replaceAll(" ", " ");
}, Z5 = function(e) {
  return e.replaceAll(" ", " ");
}, jw = function(e) {
  const {
    value: i,
    fontSize: n,
    color: a,
    pageIndex: r
  } = this._initialData;
  return this._hasBeenMoved || e.value !== i || e.fontSize !== n || e.color.some((o, l) => o !== a[l]) || e.pageIndex !== r;
}, _(Se, $r), ht(Se, "_freeTextDefaultContent", ""), ht(Se, "_internalPadding", 0), ht(Se, "_defaultColor", null), ht(Se, "_defaultFontSize", 10), ht(Se, "_type", "freetext"), ht(Se, "_editorType", Ht.FREETEXT);
let J5 = Se;
class _t {
  toSVGPath() {
    Ae("Abstract method `toSVGPath` must be implemented.");
  }
  get box() {
    Ae("Abstract getter `box` must be implemented.");
  }
  serialize(t, e) {
    Ae("Abstract method `serialize` must be implemented.");
  }
  static _rescale(t, e, i, n, a, r) {
    r || (r = new Float32Array(t.length));
    for (let o = 0, l = t.length; o < l; o += 2)
      r[o] = e + t[o] * n, r[o + 1] = i + t[o + 1] * a;
    return r;
  }
  static _rescaleAndSwap(t, e, i, n, a, r) {
    r || (r = new Float32Array(t.length));
    for (let o = 0, l = t.length; o < l; o += 2)
      r[o] = e + t[o + 1] * n, r[o + 1] = i + t[o] * a;
    return r;
  }
  static _translate(t, e, i, n) {
    n || (n = new Float32Array(t.length));
    for (let a = 0, r = t.length; a < r; a += 2)
      n[a] = e + t[a], n[a + 1] = i + t[a + 1];
    return n;
  }
  static svgRound(t) {
    return Math.round(t * 1e4);
  }
  static _normalizePoint(t, e, i, n, a) {
    switch (a) {
      case 90:
        return [1 - e / i, t / n];
      case 180:
        return [1 - t / i, 1 - e / n];
      case 270:
        return [e / i, 1 - t / n];
      default:
        return [t / i, e / n];
    }
  }
  static _normalizePagePoint(t, e, i) {
    switch (i) {
      case 90:
        return [1 - e, t];
      case 180:
        return [1 - t, 1 - e];
      case 270:
        return [e, 1 - t];
      default:
        return [t, e];
    }
  }
  static createBezierPoints(t, e, i, n, a, r) {
    return [(t + 5 * i) / 6, (e + 5 * n) / 6, (5 * i + a) / 6, (5 * n + r) / 6, (i + a) / 2, (n + r) / 2];
  }
}
ht(_t, "PRECISION", 1e-4);
var qi, $n, Wu, Xu, _a, Qt, Ec, Mc, Ff, Rf, Ku, Yu, No, Pf, v9, A9, fs, Ad, Hw, $w, zw, Gw, Vw, Ww;
const Qa = class Qa {
  constructor({
    x: t,
    y: e
  }, i, n, a, r, o = 0) {
    _(this, fs);
    _(this, qi);
    _(this, $n, []);
    _(this, Wu);
    _(this, Xu);
    _(this, _a, []);
    _(this, Qt, new Float32Array(18));
    _(this, Ec);
    _(this, Mc);
    _(this, Ff);
    _(this, Rf);
    _(this, Ku);
    _(this, Yu);
    _(this, No, []);
    S(this, qi, i), S(this, Yu, a * n), S(this, Xu, r), g(this, Qt).set([NaN, NaN, NaN, NaN, t, e], 6), S(this, Wu, o), S(this, Rf, g(Qa, Pf) * n), S(this, Ff, g(Qa, A9) * n), S(this, Ku, n), g(this, No).push(t, e);
  }
  isEmpty() {
    return isNaN(g(this, Qt)[8]);
  }
  add({
    x: t,
    y: e
  }) {
    var E;
    S(this, Ec, t), S(this, Mc, e);
    const [i, n, a, r] = g(this, qi);
    let [o, l, c, h] = g(this, Qt).subarray(8, 12);
    const u = t - c, f = e - h, d = Math.hypot(u, f);
    if (d < g(this, Ff))
      return !1;
    const p = d - g(this, Rf), m = p / d, b = m * u, y = m * f;
    let v = o, w = l;
    o = c, l = h, c += b, h += y, (E = g(this, No)) == null || E.push(t, e);
    const A = -y / p, x = b / p, k = A * g(this, Yu), I = x * g(this, Yu);
    return g(this, Qt).set(g(this, Qt).subarray(2, 8), 0), g(this, Qt).set([c + k, h + I], 4), g(this, Qt).set(g(this, Qt).subarray(14, 18), 12), g(this, Qt).set([c - k, h - I], 16), isNaN(g(this, Qt)[6]) ? (g(this, _a).length === 0 && (g(this, Qt).set([o + k, l + I], 2), g(this, _a).push(NaN, NaN, NaN, NaN, (o + k - i) / a, (l + I - n) / r), g(this, Qt).set([o - k, l - I], 14), g(this, $n).push(NaN, NaN, NaN, NaN, (o - k - i) / a, (l - I - n) / r)), g(this, Qt).set([v, w, o, l, c, h], 6), !this.isEmpty()) : (g(this, Qt).set([v, w, o, l, c, h], 6), Math.abs(Math.atan2(w - l, v - o) - Math.atan2(y, b)) < Math.PI / 2 ? ([o, l, c, h] = g(this, Qt).subarray(2, 6), g(this, _a).push(NaN, NaN, NaN, NaN, ((o + c) / 2 - i) / a, ((l + h) / 2 - n) / r), [o, l, v, w] = g(this, Qt).subarray(14, 18), g(this, $n).push(NaN, NaN, NaN, NaN, ((v + o) / 2 - i) / a, ((w + l) / 2 - n) / r), !0) : ([v, w, o, l, c, h] = g(this, Qt).subarray(0, 6), g(this, _a).push(((v + 5 * o) / 6 - i) / a, ((w + 5 * l) / 6 - n) / r, ((5 * o + c) / 6 - i) / a, ((5 * l + h) / 6 - n) / r, ((o + c) / 2 - i) / a, ((l + h) / 2 - n) / r), [c, h, o, l, v, w] = g(this, Qt).subarray(12, 18), g(this, $n).push(((v + 5 * o) / 6 - i) / a, ((w + 5 * l) / 6 - n) / r, ((5 * o + c) / 6 - i) / a, ((5 * l + h) / 6 - n) / r, ((o + c) / 2 - i) / a, ((l + h) / 2 - n) / r), !0));
  }
  toSVGPath() {
    if (this.isEmpty())
      return "";
    const t = g(this, _a), e = g(this, $n);
    if (isNaN(g(this, Qt)[6]) && !this.isEmpty())
      return C(this, fs, Hw).call(this);
    const i = [];
    i.push(`M${t[4]} ${t[5]}`);
    for (let n = 6; n < t.length; n += 6)
      isNaN(t[n]) ? i.push(`L${t[n + 4]} ${t[n + 5]}`) : i.push(`C${t[n]} ${t[n + 1]} ${t[n + 2]} ${t[n + 3]} ${t[n + 4]} ${t[n + 5]}`);
    C(this, fs, zw).call(this, i);
    for (let n = e.length - 6; n >= 6; n -= 6)
      isNaN(e[n]) ? i.push(`L${e[n + 4]} ${e[n + 5]}`) : i.push(`C${e[n]} ${e[n + 1]} ${e[n + 2]} ${e[n + 3]} ${e[n + 4]} ${e[n + 5]}`);
    return C(this, fs, $w).call(this, i), i.join(" ");
  }
  newFreeDrawOutline(t, e, i, n, a, r) {
    return new Xw(t, e, i, n, a, r);
  }
  getOutlines() {
    var u;
    const t = g(this, _a), e = g(this, $n), i = g(this, Qt), [n, a, r, o] = g(this, qi), l = new Float32Array((((u = g(this, No)) == null ? void 0 : u.length) ?? 0) + 2);
    for (let f = 0, d = l.length - 2; f < d; f += 2)
      l[f] = (g(this, No)[f] - n) / r, l[f + 1] = (g(this, No)[f + 1] - a) / o;
    if (l[l.length - 2] = (g(this, Ec) - n) / r, l[l.length - 1] = (g(this, Mc) - a) / o, isNaN(i[6]) && !this.isEmpty())
      return C(this, fs, Gw).call(this, l);
    const c = new Float32Array(g(this, _a).length + 24 + g(this, $n).length);
    let h = t.length;
    for (let f = 0; f < h; f += 2) {
      if (isNaN(t[f])) {
        c[f] = c[f + 1] = NaN;
        continue;
      }
      c[f] = t[f], c[f + 1] = t[f + 1];
    }
    h = C(this, fs, Ww).call(this, c, h);
    for (let f = e.length - 6; f >= 6; f -= 6)
      for (let d = 0; d < 6; d += 2) {
        if (isNaN(e[f + d])) {
          c[h] = c[h + 1] = NaN, h += 2;
          continue;
        }
        c[h] = e[f + d], c[h + 1] = e[f + d + 1], h += 2;
      }
    return C(this, fs, Vw).call(this, c, h), this.newFreeDrawOutline(c, l, g(this, qi), g(this, Ku), g(this, Wu), g(this, Xu));
  }
};
qi = new WeakMap(), $n = new WeakMap(), Wu = new WeakMap(), Xu = new WeakMap(), _a = new WeakMap(), Qt = new WeakMap(), Ec = new WeakMap(), Mc = new WeakMap(), Ff = new WeakMap(), Rf = new WeakMap(), Ku = new WeakMap(), Yu = new WeakMap(), No = new WeakMap(), Pf = new WeakMap(), v9 = new WeakMap(), A9 = new WeakMap(), fs = new WeakSet(), Ad = function() {
  const t = g(this, Qt).subarray(4, 6), e = g(this, Qt).subarray(16, 18), [i, n, a, r] = g(this, qi);
  return [(g(this, Ec) + (t[0] - e[0]) / 2 - i) / a, (g(this, Mc) + (t[1] - e[1]) / 2 - n) / r, (g(this, Ec) + (e[0] - t[0]) / 2 - i) / a, (g(this, Mc) + (e[1] - t[1]) / 2 - n) / r];
}, Hw = function() {
  const [t, e, i, n] = g(this, qi), [a, r, o, l] = C(this, fs, Ad).call(this);
  return `M${(g(this, Qt)[2] - t) / i} ${(g(this, Qt)[3] - e) / n} L${(g(this, Qt)[4] - t) / i} ${(g(this, Qt)[5] - e) / n} L${a} ${r} L${o} ${l} L${(g(this, Qt)[16] - t) / i} ${(g(this, Qt)[17] - e) / n} L${(g(this, Qt)[14] - t) / i} ${(g(this, Qt)[15] - e) / n} Z`;
}, $w = function(t) {
  const e = g(this, $n);
  t.push(`L${e[4]} ${e[5]} Z`);
}, zw = function(t) {
  const [e, i, n, a] = g(this, qi), r = g(this, Qt).subarray(4, 6), o = g(this, Qt).subarray(16, 18), [l, c, h, u] = C(this, fs, Ad).call(this);
  t.push(`L${(r[0] - e) / n} ${(r[1] - i) / a} L${l} ${c} L${h} ${u} L${(o[0] - e) / n} ${(o[1] - i) / a}`);
}, Gw = function(t) {
  const e = g(this, Qt), [i, n, a, r] = g(this, qi), [o, l, c, h] = C(this, fs, Ad).call(this), u = new Float32Array(36);
  return u.set([NaN, NaN, NaN, NaN, (e[2] - i) / a, (e[3] - n) / r, NaN, NaN, NaN, NaN, (e[4] - i) / a, (e[5] - n) / r, NaN, NaN, NaN, NaN, o, l, NaN, NaN, NaN, NaN, c, h, NaN, NaN, NaN, NaN, (e[16] - i) / a, (e[17] - n) / r, NaN, NaN, NaN, NaN, (e[14] - i) / a, (e[15] - n) / r], 0), this.newFreeDrawOutline(u, t, g(this, qi), g(this, Ku), g(this, Wu), g(this, Xu));
}, Vw = function(t, e) {
  const i = g(this, $n);
  return t.set([NaN, NaN, NaN, NaN, i[4], i[5]], e), e += 6;
}, Ww = function(t, e) {
  const i = g(this, Qt).subarray(4, 6), n = g(this, Qt).subarray(16, 18), [a, r, o, l] = g(this, qi), [c, h, u, f] = C(this, fs, Ad).call(this);
  return t.set([NaN, NaN, NaN, NaN, (i[0] - a) / o, (i[1] - r) / l, NaN, NaN, NaN, NaN, c, h, NaN, NaN, NaN, NaN, u, f, NaN, NaN, NaN, NaN, (n[0] - a) / o, (n[1] - r) / l], e), e += 24;
}, _(Qa, Pf, 8), _(Qa, v9, 2), _(Qa, A9, g(Qa, Pf) + g(Qa, v9));
let dp = Qa;
var Ju, Fc, Cr, Df, ji, Nf, Ye, x9, Kw;
class Xw extends _t {
  constructor(e, i, n, a, r, o) {
    super();
    _(this, x9);
    _(this, Ju);
    _(this, Fc, new Float32Array(4));
    _(this, Cr);
    _(this, Df);
    _(this, ji);
    _(this, Nf);
    _(this, Ye);
    S(this, Ye, e), S(this, ji, i), S(this, Ju, n), S(this, Nf, a), S(this, Cr, r), S(this, Df, o), this.lastPoint = [NaN, NaN], C(this, x9, Kw).call(this, o);
    const [l, c, h, u] = g(this, Fc);
    for (let f = 0, d = e.length; f < d; f += 2)
      e[f] = (e[f] - l) / h, e[f + 1] = (e[f + 1] - c) / u;
    for (let f = 0, d = i.length; f < d; f += 2)
      i[f] = (i[f] - l) / h, i[f + 1] = (i[f + 1] - c) / u;
  }
  toSVGPath() {
    const e = [`M${g(this, Ye)[4]} ${g(this, Ye)[5]}`];
    for (let i = 6, n = g(this, Ye).length; i < n; i += 6) {
      if (isNaN(g(this, Ye)[i])) {
        e.push(`L${g(this, Ye)[i + 4]} ${g(this, Ye)[i + 5]}`);
        continue;
      }
      e.push(`C${g(this, Ye)[i]} ${g(this, Ye)[i + 1]} ${g(this, Ye)[i + 2]} ${g(this, Ye)[i + 3]} ${g(this, Ye)[i + 4]} ${g(this, Ye)[i + 5]}`);
    }
    return e.push("Z"), e.join(" ");
  }
  serialize([e, i, n, a], r) {
    const o = n - e, l = a - i;
    let c, h;
    switch (r) {
      case 0:
        c = _t._rescale(g(this, Ye), e, a, o, -l), h = _t._rescale(g(this, ji), e, a, o, -l);
        break;
      case 90:
        c = _t._rescaleAndSwap(g(this, Ye), e, i, o, l), h = _t._rescaleAndSwap(g(this, ji), e, i, o, l);
        break;
      case 180:
        c = _t._rescale(g(this, Ye), n, i, -o, l), h = _t._rescale(g(this, ji), n, i, -o, l);
        break;
      case 270:
        c = _t._rescaleAndSwap(g(this, Ye), n, a, -o, -l), h = _t._rescaleAndSwap(g(this, ji), n, a, -o, -l);
        break;
    }
    return {
      outline: Array.from(c),
      points: [Array.from(h)]
    };
  }
  get box() {
    return g(this, Fc);
  }
  newOutliner(e, i, n, a, r, o = 0) {
    return new dp(e, i, n, a, r, o);
  }
  getNewOutline(e, i) {
    const [n, a, r, o] = g(this, Fc), [l, c, h, u] = g(this, Ju), f = r * h, d = o * u, p = n * h + l, m = a * u + c, b = this.newOutliner({
      x: g(this, ji)[0] * f + p,
      y: g(this, ji)[1] * d + m
    }, g(this, Ju), g(this, Nf), e, g(this, Df), i ?? g(this, Cr));
    for (let y = 2; y < g(this, ji).length; y += 2)
      b.add({
        x: g(this, ji)[y] * f + p,
        y: g(this, ji)[y + 1] * d + m
      });
    return b.getOutlines();
  }
}
Ju = new WeakMap(), Fc = new WeakMap(), Cr = new WeakMap(), Df = new WeakMap(), ji = new WeakMap(), Nf = new WeakMap(), Ye = new WeakMap(), x9 = new WeakSet(), Kw = function(e) {
  const i = g(this, Ye);
  let n = i[4], a = i[5];
  const r = [n, a, n, a];
  let o = n, l = a;
  const c = e ? Math.max : Math.min;
  for (let u = 6, f = i.length; u < f; u += 6) {
    const d = i[u + 4], p = i[u + 5];
    if (isNaN(i[u]))
      Dt.pointBoundingBox(d, p, r), l < p ? (o = d, l = p) : l === p && (o = c(o, d));
    else {
      const m = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
      Dt.bezierBoundingBox(n, a, ...i.slice(u, u + 6), m), Dt.rectBoundingBox(...m, r), l < m[3] ? (o = m[2], l = m[3]) : l === m[3] && (o = c(o, m[2]));
    }
    n = d, a = p;
  }
  const h = g(this, Fc);
  h[0] = r[0] - g(this, Cr), h[1] = r[1] - g(this, Cr), h[2] = r[2] - r[0] + 2 * g(this, Cr), h[3] = r[3] - r[1] + 2 * g(this, Cr), this.lastPoint = [o, l];
};
var Bf, Lf, Bo, zn, ui, Yw, Tg, Jw, Zw, t3;
class Q5 {
  constructor(t, e = 0, i = 0, n = !0) {
    _(this, ui);
    _(this, Bf);
    _(this, Lf);
    _(this, Bo, []);
    _(this, zn, []);
    const a = [1 / 0, 1 / 0, -1 / 0, -1 / 0], r = 10 ** -4;
    for (const {
      x: d,
      y: p,
      width: m,
      height: b
    } of t) {
      const y = Math.floor((d - e) / r) * r, v = Math.ceil((d + m + e) / r) * r, w = Math.floor((p - e) / r) * r, A = Math.ceil((p + b + e) / r) * r, x = [y, w, A, !0], k = [v, w, A, !1];
      g(this, Bo).push(x, k), Dt.rectBoundingBox(y, w, v, A, a);
    }
    const o = a[2] - a[0] + 2 * i, l = a[3] - a[1] + 2 * i, c = a[0] - i, h = a[1] - i, u = g(this, Bo).at(n ? -1 : -2), f = [u[0], u[2]];
    for (const d of g(this, Bo)) {
      const [p, m, b] = d;
      d[0] = (p - c) / o, d[1] = (m - h) / l, d[2] = (b - h) / l;
    }
    S(this, Bf, new Float32Array([c, h, o, l])), S(this, Lf, f);
  }
  getOutlines() {
    g(this, Bo).sort((e, i) => e[0] - i[0] || e[1] - i[1] || e[2] - i[2]);
    const t = [];
    for (const e of g(this, Bo))
      e[3] ? (t.push(...C(this, ui, t3).call(this, e)), C(this, ui, Jw).call(this, e)) : (C(this, ui, Zw).call(this, e), t.push(...C(this, ui, t3).call(this, e)));
    return C(this, ui, Yw).call(this, t);
  }
}
Bf = new WeakMap(), Lf = new WeakMap(), Bo = new WeakMap(), zn = new WeakMap(), ui = new WeakSet(), Yw = function(t) {
  const e = [], i = /* @__PURE__ */ new Set();
  for (const r of t) {
    const [o, l, c] = r;
    e.push([o, l, r], [o, c, r]);
  }
  e.sort((r, o) => r[1] - o[1] || r[0] - o[0]);
  for (let r = 0, o = e.length; r < o; r += 2) {
    const l = e[r][2], c = e[r + 1][2];
    l.push(c), c.push(l), i.add(l), i.add(c);
  }
  const n = [];
  let a;
  for (; i.size > 0; ) {
    const r = i.values().next().value;
    let [o, l, c, h, u] = r;
    i.delete(r);
    let f = o, d = l;
    for (a = [o, c], n.push(a); ; ) {
      let p;
      if (i.has(h))
        p = h;
      else if (i.has(u))
        p = u;
      else
        break;
      i.delete(p), [o, l, c, h, u] = p, f !== o && (a.push(f, d, o, d === l ? l : c), f = o), d = d === l ? c : l;
    }
    a.push(f, d);
  }
  return new cC(n, g(this, Bf), g(this, Lf));
}, Tg = function(t) {
  const e = g(this, zn);
  let i = 0, n = e.length - 1;
  for (; i <= n; ) {
    const a = i + n >> 1, r = e[a][0];
    if (r === t)
      return a;
    r < t ? i = a + 1 : n = a - 1;
  }
  return n + 1;
}, Jw = function([, t, e]) {
  const i = C(this, ui, Tg).call(this, t);
  g(this, zn).splice(i, 0, [t, e]);
}, Zw = function([, t, e]) {
  const i = C(this, ui, Tg).call(this, t);
  for (let n = i; n < g(this, zn).length; n++) {
    const [a, r] = g(this, zn)[n];
    if (a !== t)
      break;
    if (a === t && r === e) {
      g(this, zn).splice(n, 1);
      return;
    }
  }
  for (let n = i - 1; n >= 0; n--) {
    const [a, r] = g(this, zn)[n];
    if (a !== t)
      break;
    if (a === t && r === e) {
      g(this, zn).splice(n, 1);
      return;
    }
  }
}, t3 = function(t) {
  const [e, i, n] = t, a = [[e, i, n]], r = C(this, ui, Tg).call(this, n);
  for (let o = 0; o < r; o++) {
    const [l, c] = g(this, zn)[o];
    for (let h = 0, u = a.length; h < u; h++) {
      const [, f, d] = a[h];
      if (!(c <= f || d <= l)) {
        if (f >= l) {
          if (d > c)
            a[h][1] = c;
          else {
            if (u === 1)
              return [];
            a.splice(h, 1), h--, u--;
          }
          continue;
        }
        a[h][2] = l, d > c && a.push([e, c, d]);
      }
    }
  }
  return a;
};
var Of, Zu;
class cC extends _t {
  constructor(e, i, n) {
    super();
    _(this, Of);
    _(this, Zu);
    S(this, Zu, e), S(this, Of, i), this.lastPoint = n;
  }
  toSVGPath() {
    const e = [];
    for (const i of g(this, Zu)) {
      let [n, a] = i;
      e.push(`M${n} ${a}`);
      for (let r = 2; r < i.length; r += 2) {
        const o = i[r], l = i[r + 1];
        o === n ? (e.push(`V${l}`), a = l) : l === a && (e.push(`H${o}`), n = o);
      }
      e.push("Z");
    }
    return e.join(" ");
  }
  serialize([e, i, n, a], r) {
    const o = [], l = n - e, c = a - i;
    for (const h of g(this, Zu)) {
      const u = new Array(h.length);
      for (let f = 0; f < h.length; f += 2)
        u[f] = e + h[f] * l, u[f + 1] = a - h[f + 1] * c;
      o.push(u);
    }
    return o;
  }
  get box() {
    return g(this, Of);
  }
  get classNamesForOutlining() {
    return ["highlightOutline"];
  }
}
Of = new WeakMap(), Zu = new WeakMap();
class e3 extends dp {
  newFreeDrawOutline(t, e, i, n, a, r) {
    return new hC(t, e, i, n, a, r);
  }
}
class hC extends Xw {
  newOutliner(t, e, i, n, a, r = 0) {
    return new e3(t, e, i, n, a, r);
  }
}
var Gn, Rc, Qu, us, Uf, t1, qf, jf, Lo, Vn, e1, Hf, ve, s3, i3, n3, kl, Qw, so;
const bi = class bi {
  constructor({
    editor: t = null,
    uiManager: e = null
  }) {
    _(this, ve);
    _(this, Gn, null);
    _(this, Rc, null);
    _(this, Qu);
    _(this, us, null);
    _(this, Uf, !1);
    _(this, t1, !1);
    _(this, qf, null);
    _(this, jf);
    _(this, Lo, null);
    _(this, Vn, null);
    _(this, e1);
    var i;
    t ? (S(this, t1, !1), S(this, e1, ae.HIGHLIGHT_COLOR), S(this, qf, t)) : (S(this, t1, !0), S(this, e1, ae.HIGHLIGHT_DEFAULT_COLOR)), S(this, Vn, (t == null ? void 0 : t._uiManager) || e), S(this, jf, g(this, Vn)._eventBus), S(this, Qu, (t == null ? void 0 : t.color) || ((i = g(this, Vn)) == null ? void 0 : i.highlightColors.values().next().value) || "#FFFF98"), g(bi, Hf) || S(bi, Hf, Object.freeze({
      blue: "pdfjs-editor-colorpicker-blue",
      green: "pdfjs-editor-colorpicker-green",
      pink: "pdfjs-editor-colorpicker-pink",
      red: "pdfjs-editor-colorpicker-red",
      yellow: "pdfjs-editor-colorpicker-yellow"
    }));
  }
  static get _keyboardManager() {
    return ne(this, "_keyboardManager", new y2([[["Escape", "mac+Escape"], bi.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], bi.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], bi.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], bi.prototype._moveToPrevious], [["Home", "mac+Home"], bi.prototype._moveToBeginning], [["End", "mac+End"], bi.prototype._moveToEnd]]));
  }
  renderButton() {
    const t = S(this, Gn, document.createElement("button"));
    t.className = "colorPicker", t.tabIndex = "0", t.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button"), t.setAttribute("aria-haspopup", !0);
    const e = g(this, Vn)._signal;
    t.addEventListener("click", C(this, ve, kl).bind(this), {
      signal: e
    }), t.addEventListener("keydown", C(this, ve, n3).bind(this), {
      signal: e
    });
    const i = S(this, Rc, document.createElement("span"));
    return i.className = "swatch", i.setAttribute("aria-hidden", !0), i.style.backgroundColor = g(this, Qu), t.append(i), t;
  }
  renderMainDropdown() {
    const t = S(this, us, C(this, ve, s3).call(this));
    return t.setAttribute("aria-orientation", "horizontal"), t.setAttribute("aria-labelledby", "highlightColorPickerLabel"), t;
  }
  _colorSelectFromKeyboard(t) {
    if (t.target === g(this, Gn)) {
      C(this, ve, kl).call(this, t);
      return;
    }
    const e = t.target.getAttribute("data-color");
    e && C(this, ve, i3).call(this, e, t);
  }
  _moveToNext(t) {
    var e, i;
    if (!g(this, ve, so)) {
      C(this, ve, kl).call(this, t);
      return;
    }
    if (t.target === g(this, Gn)) {
      (e = g(this, us).firstChild) == null || e.focus();
      return;
    }
    (i = t.target.nextSibling) == null || i.focus();
  }
  _moveToPrevious(t) {
    var e, i;
    if (t.target === ((e = g(this, us)) == null ? void 0 : e.firstChild) || t.target === g(this, Gn)) {
      g(this, ve, so) && this._hideDropdownFromKeyboard();
      return;
    }
    g(this, ve, so) || C(this, ve, kl).call(this, t), (i = t.target.previousSibling) == null || i.focus();
  }
  _moveToBeginning(t) {
    var e;
    if (!g(this, ve, so)) {
      C(this, ve, kl).call(this, t);
      return;
    }
    (e = g(this, us).firstChild) == null || e.focus();
  }
  _moveToEnd(t) {
    var e;
    if (!g(this, ve, so)) {
      C(this, ve, kl).call(this, t);
      return;
    }
    (e = g(this, us).lastChild) == null || e.focus();
  }
  hideDropdown() {
    var t, e;
    (t = g(this, us)) == null || t.classList.add("hidden"), (e = g(this, Lo)) == null || e.abort(), S(this, Lo, null);
  }
  _hideDropdownFromKeyboard() {
    var t;
    if (!g(this, t1)) {
      if (!g(this, ve, so)) {
        (t = g(this, qf)) == null || t.unselect();
        return;
      }
      this.hideDropdown(), g(this, Gn).focus({
        preventScroll: !0,
        focusVisible: g(this, Uf)
      });
    }
  }
  updateColor(t) {
    if (g(this, Rc) && (g(this, Rc).style.backgroundColor = t), !g(this, us))
      return;
    const e = g(this, Vn).highlightColors.values();
    for (const i of g(this, us).children)
      i.setAttribute("aria-selected", e.next().value === t);
  }
  destroy() {
    var t, e;
    (t = g(this, Gn)) == null || t.remove(), S(this, Gn, null), S(this, Rc, null), (e = g(this, us)) == null || e.remove(), S(this, us, null);
  }
};
Gn = new WeakMap(), Rc = new WeakMap(), Qu = new WeakMap(), us = new WeakMap(), Uf = new WeakMap(), t1 = new WeakMap(), qf = new WeakMap(), jf = new WeakMap(), Lo = new WeakMap(), Vn = new WeakMap(), e1 = new WeakMap(), Hf = new WeakMap(), ve = new WeakSet(), s3 = function() {
  const t = document.createElement("div"), e = g(this, Vn)._signal;
  t.addEventListener("contextmenu", En, {
    signal: e
  }), t.className = "dropdown", t.role = "listbox", t.setAttribute("aria-multiselectable", !1), t.setAttribute("aria-orientation", "vertical"), t.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown");
  for (const [i, n] of g(this, Vn).highlightColors) {
    const a = document.createElement("button");
    a.tabIndex = "0", a.role = "option", a.setAttribute("data-color", n), a.title = i, a.setAttribute("data-l10n-id", g(bi, Hf)[i]);
    const r = document.createElement("span");
    a.append(r), r.className = "swatch", r.style.backgroundColor = n, a.setAttribute("aria-selected", n === g(this, Qu)), a.addEventListener("click", C(this, ve, i3).bind(this, n), {
      signal: e
    }), t.append(a);
  }
  return t.addEventListener("keydown", C(this, ve, n3).bind(this), {
    signal: e
  }), t;
}, i3 = function(t, e) {
  e.stopPropagation(), g(this, jf).dispatch("switchannotationeditorparams", {
    source: this,
    type: g(this, e1),
    value: t
  });
}, n3 = function(t) {
  bi._keyboardManager.exec(this, t);
}, kl = function(t) {
  if (g(this, ve, so)) {
    this.hideDropdown();
    return;
  }
  if (S(this, Uf, t.detail === 0), g(this, Lo) || (S(this, Lo, new AbortController()), window.addEventListener("pointerdown", C(this, ve, Qw).bind(this), {
    signal: g(this, Vn).combinedSignal(g(this, Lo))
  })), g(this, us)) {
    g(this, us).classList.remove("hidden");
    return;
  }
  const e = S(this, us, C(this, ve, s3).call(this));
  g(this, Gn).append(e);
}, Qw = function(t) {
  var e;
  (e = g(this, us)) != null && e.contains(t.target) || this.hideDropdown();
}, so = function() {
  return g(this, us) && !g(this, us).classList.contains("hidden");
}, _(bi, Hf, null);
let s0 = bi;
var s1, $f, Ir, Pc, i1, vi, zf, Gf, Dc, un, Hi, _s, n1, _r, Gs, a1, dn, Vf, Xt, a3, Eg, tv, ev, sv, r3, Sl, In, Dh, iv, Mg, xd, nv, av, rv, ov, lv;
const pe = class pe extends Ie {
  constructor(e) {
    super({
      ...e,
      name: "highlightEditor"
    });
    _(this, Xt);
    _(this, s1, null);
    _(this, $f, 0);
    _(this, Ir);
    _(this, Pc, null);
    _(this, i1, null);
    _(this, vi, null);
    _(this, zf, null);
    _(this, Gf, 0);
    _(this, Dc, null);
    _(this, un, null);
    _(this, Hi, null);
    _(this, _s, !1);
    _(this, n1, null);
    _(this, _r);
    _(this, Gs, null);
    _(this, a1, "");
    _(this, dn);
    _(this, Vf, "");
    this.color = e.color || pe._defaultColor, S(this, dn, e.thickness || pe._defaultThickness), S(this, _r, e.opacity || pe._defaultOpacity), S(this, Ir, e.boxes || null), S(this, Vf, e.methodOfCreation || ""), S(this, a1, e.text || ""), this._isDraggable = !1, this.defaultL10nId = "pdfjs-editor-highlight-editor", e.highlightId > -1 ? (S(this, _s, !0), C(this, Xt, Eg).call(this, e), C(this, Xt, Sl).call(this)) : g(this, Ir) && (S(this, s1, e.anchorNode), S(this, $f, e.anchorOffset), S(this, zf, e.focusNode), S(this, Gf, e.focusOffset), C(this, Xt, a3).call(this), C(this, Xt, Sl).call(this), this.rotate(this.rotation));
  }
  static get _keyboardManager() {
    const e = pe.prototype;
    return ne(this, "_keyboardManager", new y2([[["ArrowLeft", "mac+ArrowLeft"], e._moveCaret, {
      args: [0]
    }], [["ArrowRight", "mac+ArrowRight"], e._moveCaret, {
      args: [1]
    }], [["ArrowUp", "mac+ArrowUp"], e._moveCaret, {
      args: [2]
    }], [["ArrowDown", "mac+ArrowDown"], e._moveCaret, {
      args: [3]
    }]]));
  }
  get telemetryInitialData() {
    return {
      action: "added",
      type: g(this, _s) ? "free_highlight" : "highlight",
      color: this._uiManager.highlightColorNames.get(this.color),
      thickness: g(this, dn),
      methodOfCreation: g(this, Vf)
    };
  }
  get telemetryFinalData() {
    return {
      type: "highlight",
      color: this._uiManager.highlightColorNames.get(this.color)
    };
  }
  static computeTelemetryFinalData(e) {
    return {
      numberOfColors: e.get("color").size
    };
  }
  static initialize(e, i) {
    var n;
    Ie.initialize(e, i), pe._defaultColor || (pe._defaultColor = ((n = i.highlightColors) == null ? void 0 : n.values().next().value) || "#fff066");
  }
  static updateDefaultParams(e, i) {
    switch (e) {
      case ae.HIGHLIGHT_DEFAULT_COLOR:
        pe._defaultColor = i;
        break;
      case ae.HIGHLIGHT_THICKNESS:
        pe._defaultThickness = i;
        break;
    }
  }
  translateInPage(e, i) {
  }
  get toolbarPosition() {
    return g(this, n1);
  }
  updateParams(e, i) {
    switch (e) {
      case ae.HIGHLIGHT_COLOR:
        C(this, Xt, tv).call(this, i);
        break;
      case ae.HIGHLIGHT_THICKNESS:
        C(this, Xt, ev).call(this, i);
        break;
    }
  }
  static get defaultPropertiesToUpdate() {
    return [[ae.HIGHLIGHT_DEFAULT_COLOR, pe._defaultColor], [ae.HIGHLIGHT_THICKNESS, pe._defaultThickness]];
  }
  get propertiesToUpdate() {
    return [[ae.HIGHLIGHT_COLOR, this.color || pe._defaultColor], [ae.HIGHLIGHT_THICKNESS, g(this, dn) || pe._defaultThickness], [ae.HIGHLIGHT_FREE, g(this, _s)]];
  }
  async addEditToolbar() {
    const e = await super.addEditToolbar();
    return e ? (this._uiManager.highlightColors && (S(this, i1, new s0({
      editor: this
    })), e.addColorPicker(g(this, i1))), e) : null;
  }
  disableEditing() {
    super.disableEditing(), this.div.classList.toggle("disabled", !0);
  }
  enableEditing() {
    super.enableEditing(), this.div.classList.toggle("disabled", !1);
  }
  fixAndSetPosition() {
    return super.fixAndSetPosition(C(this, Xt, xd).call(this));
  }
  getBaseTranslation() {
    return [0, 0];
  }
  getRect(e, i) {
    return super.getRect(e, i, C(this, Xt, xd).call(this));
  }
  onceAdded(e) {
    this.annotationElementId || this.parent.addUndoableEditor(this), e && this.div.focus();
  }
  remove() {
    C(this, Xt, r3).call(this), this._reportTelemetry({
      action: "deleted"
    }), super.remove();
  }
  rebuild() {
    this.parent && (super.rebuild(), this.div !== null && (C(this, Xt, Sl).call(this), this.isAttachedToDOM || this.parent.add(this)));
  }
  setParent(e) {
    var n;
    let i = !1;
    this.parent && !e ? C(this, Xt, r3).call(this) : e && (C(this, Xt, Sl).call(this, e), i = !this.parent && ((n = this.div) == null ? void 0 : n.classList.contains("selectedEditor"))), super.setParent(e), this.show(this._isVisible), i && this.select();
  }
  rotate(e) {
    var a, r, o;
    const {
      drawLayer: i
    } = this.parent;
    let n;
    g(this, _s) ? (e = (e - this.rotation + 360) % 360, n = C(a = pe, In, Dh).call(a, g(this, un).box, e)) : n = C(r = pe, In, Dh).call(r, [this.x, this.y, this.width, this.height], e), i.updateProperties(g(this, Hi), {
      bbox: n,
      root: {
        "data-main-rotation": e
      }
    }), i.updateProperties(g(this, Gs), {
      bbox: C(o = pe, In, Dh).call(o, g(this, vi).box, e),
      root: {
        "data-main-rotation": e
      }
    });
  }
  render() {
    if (this.div)
      return this.div;
    const e = super.render();
    g(this, a1) && (e.setAttribute("aria-label", g(this, a1)), e.setAttribute("role", "mark")), g(this, _s) ? e.classList.add("free") : this.div.addEventListener("keydown", C(this, Xt, iv).bind(this), {
      signal: this._uiManager._signal
    });
    const i = S(this, Dc, document.createElement("div"));
    e.append(i), i.setAttribute("aria-hidden", "true"), i.className = "internal", i.style.clipPath = g(this, Pc);
    const [n, a] = this.parentDimensions;
    return this.setDims(this.width * n, this.height * a), _y(this, g(this, Dc), ["pointerover", "pointerleave"]), this.enableEditing(), e;
  }
  pointerover() {
    var e;
    this.isSelected || (e = this.parent) == null || e.drawLayer.updateProperties(g(this, Gs), {
      rootClass: {
        hovered: !0
      }
    });
  }
  pointerleave() {
    var e;
    this.isSelected || (e = this.parent) == null || e.drawLayer.updateProperties(g(this, Gs), {
      rootClass: {
        hovered: !1
      }
    });
  }
  _moveCaret(e) {
    switch (this.parent.unselect(this), e) {
      case 0:
      case 2:
        C(this, Xt, Mg).call(this, !0);
        break;
      case 1:
      case 3:
        C(this, Xt, Mg).call(this, !1);
        break;
    }
  }
  select() {
    var e;
    super.select(), g(this, Gs) && ((e = this.parent) == null || e.drawLayer.updateProperties(g(this, Gs), {
      rootClass: {
        hovered: !1,
        selected: !0
      }
    }));
  }
  unselect() {
    var e;
    super.unselect(), g(this, Gs) && ((e = this.parent) == null || e.drawLayer.updateProperties(g(this, Gs), {
      rootClass: {
        selected: !1
      }
    }), g(this, _s) || C(this, Xt, Mg).call(this, !1));
  }
  get _mustFixPosition() {
    return !g(this, _s);
  }
  show(e = this._isVisible) {
    super.show(e), this.parent && (this.parent.drawLayer.updateProperties(g(this, Hi), {
      rootClass: {
        hidden: !e
      }
    }), this.parent.drawLayer.updateProperties(g(this, Gs), {
      rootClass: {
        hidden: !e
      }
    }));
  }
  static startHighlighting(e, i, {
    target: n,
    x: a,
    y: r
  }) {
    const {
      x: o,
      y: l,
      width: c,
      height: h
    } = n.getBoundingClientRect(), u = new AbortController(), f = e.combinedSignal(u), d = (p) => {
      u.abort(), C(this, In, ov).call(this, e, p);
    };
    window.addEventListener("blur", d, {
      signal: f
    }), window.addEventListener("pointerup", d, {
      signal: f
    }), window.addEventListener("pointerdown", Ze, {
      capture: !0,
      passive: !1,
      signal: f
    }), window.addEventListener("contextmenu", En, {
      signal: f
    }), n.addEventListener("pointermove", C(this, In, rv).bind(this, e), {
      signal: f
    }), this._freeHighlight = new e3({
      x: a,
      y: r
    }, [o, l, c, h], e.scale, this._defaultThickness / 2, i, 1e-3), {
      id: this._freeHighlightId,
      clipPathId: this._freeHighlightClipId
    } = e.drawLayer.draw({
      bbox: [0, 0, 1, 1],
      root: {
        viewBox: "0 0 1 1",
        fill: this._defaultColor,
        "fill-opacity": this._defaultOpacity
      },
      rootClass: {
        highlight: !0,
        free: !0
      },
      path: {
        d: this._freeHighlight.toSVGPath()
      }
    }, !0, !0);
  }
  static async deserialize(e, i, n) {
    var m, b, y, v;
    let a = null;
    if (e instanceof Nw) {
      const {
        data: {
          quadPoints: w,
          rect: A,
          rotation: x,
          id: k,
          color: I,
          opacity: T,
          popupRef: E
        },
        parent: {
          page: {
            pageNumber: M
          }
        }
      } = e;
      a = e = {
        annotationType: Ht.HIGHLIGHT,
        color: Array.from(I),
        opacity: T,
        quadPoints: w,
        boxes: null,
        pageIndex: M - 1,
        rect: A.slice(0),
        rotation: x,
        id: k,
        deleted: !1,
        popupRef: E
      };
    } else if (e instanceof n7) {
      const {
        data: {
          inkLists: w,
          rect: A,
          rotation: x,
          id: k,
          color: I,
          borderStyle: {
            rawWidth: T
          },
          popupRef: E
        },
        parent: {
          page: {
            pageNumber: M
          }
        }
      } = e;
      a = e = {
        annotationType: Ht.HIGHLIGHT,
        color: Array.from(I),
        thickness: T,
        inkLists: w,
        boxes: null,
        pageIndex: M - 1,
        rect: A.slice(0),
        rotation: x,
        id: k,
        deleted: !1,
        popupRef: E
      };
    }
    const {
      color: r,
      quadPoints: o,
      inkLists: l,
      opacity: c
    } = e, h = await super.deserialize(e, i, n);
    h.color = Dt.makeHexColor(...r), S(h, _r, c || 1), l && S(h, dn, e.thickness), h.annotationElementId = e.id || null, h._initialData = a;
    const [u, f] = h.pageDimensions, [d, p] = h.pageTranslation;
    if (o) {
      const w = S(h, Ir, []);
      for (let A = 0; A < o.length; A += 8)
        w.push({
          x: (o[A] - d) / u,
          y: 1 - (o[A + 1] - p) / f,
          width: (o[A + 2] - o[A]) / u,
          height: (o[A + 1] - o[A + 5]) / f
        });
      C(m = h, Xt, a3).call(m), C(b = h, Xt, Sl).call(b), h.rotate(h.rotation);
    } else if (l) {
      S(h, _s, !0);
      const w = l[0], A = {
        x: w[0] - d,
        y: f - (w[1] - p)
      }, x = new e3(A, [0, 0, u, f], 1, g(h, dn) / 2, !0, 1e-3);
      for (let T = 0, E = w.length; T < E; T += 2)
        A.x = w[T] - d, A.y = f - (w[T + 1] - p), x.add(A);
      const {
        id: k,
        clipPathId: I
      } = i.drawLayer.draw({
        bbox: [0, 0, 1, 1],
        root: {
          viewBox: "0 0 1 1",
          fill: h.color,
          "fill-opacity": h._defaultOpacity
        },
        rootClass: {
          highlight: !0,
          free: !0
        },
        path: {
          d: x.toSVGPath()
        }
      }, !0, !0);
      C(y = h, Xt, Eg).call(y, {
        highlightOutlines: x.getOutlines(),
        highlightId: k,
        clipPathId: I
      }), C(v = h, Xt, Sl).call(v), h.rotate(h.parentRotation);
    }
    return h;
  }
  serialize(e = !1) {
    if (this.isEmpty() || e)
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const i = this.getRect(0, 0), n = Ie._colorManager.convert(this.color), a = {
      annotationType: Ht.HIGHLIGHT,
      color: n,
      opacity: g(this, _r),
      thickness: g(this, dn),
      quadPoints: C(this, Xt, nv).call(this),
      outlines: C(this, Xt, av).call(this, i),
      pageIndex: this.pageIndex,
      rect: i,
      rotation: C(this, Xt, xd).call(this),
      structTreeParentId: this._structTreeParentId
    };
    return this.annotationElementId && !C(this, Xt, lv).call(this, a) ? null : (a.id = this.annotationElementId, a);
  }
  renderAnnotationElement(e) {
    return e.updateEdited({
      rect: this.getRect(0, 0)
    }), null;
  }
  static canCreateNewEmptyEditor() {
    return !1;
  }
};
s1 = new WeakMap(), $f = new WeakMap(), Ir = new WeakMap(), Pc = new WeakMap(), i1 = new WeakMap(), vi = new WeakMap(), zf = new WeakMap(), Gf = new WeakMap(), Dc = new WeakMap(), un = new WeakMap(), Hi = new WeakMap(), _s = new WeakMap(), n1 = new WeakMap(), _r = new WeakMap(), Gs = new WeakMap(), a1 = new WeakMap(), dn = new WeakMap(), Vf = new WeakMap(), Xt = new WeakSet(), a3 = function() {
  const e = new Q5(g(this, Ir), 1e-3);
  S(this, un, e.getOutlines()), [this.x, this.y, this.width, this.height] = g(this, un).box;
  const i = new Q5(g(this, Ir), 25e-4, 1e-3, this._uiManager.direction === "ltr");
  S(this, vi, i.getOutlines());
  const {
    lastPoint: n
  } = g(this, vi);
  S(this, n1, [(n[0] - this.x) / this.width, (n[1] - this.y) / this.height]);
}, Eg = function({
  highlightOutlines: e,
  highlightId: i,
  clipPathId: n
}) {
  var u, f;
  if (S(this, un, e), S(this, vi, e.getNewOutline(g(this, dn) / 2 + 1.5, 25e-4)), i >= 0)
    S(this, Hi, i), S(this, Pc, n), this.parent.drawLayer.finalizeDraw(i, {
      bbox: e.box,
      path: {
        d: e.toSVGPath()
      }
    }), S(this, Gs, this.parent.drawLayer.drawOutline({
      rootClass: {
        highlightOutline: !0,
        free: !0
      },
      bbox: g(this, vi).box,
      path: {
        d: g(this, vi).toSVGPath()
      }
    }, !0));
  else if (this.parent) {
    const d = this.parent.viewport.rotation;
    this.parent.drawLayer.updateProperties(g(this, Hi), {
      bbox: C(u = pe, In, Dh).call(u, g(this, un).box, (d - this.rotation + 360) % 360),
      path: {
        d: e.toSVGPath()
      }
    }), this.parent.drawLayer.updateProperties(g(this, Gs), {
      bbox: C(f = pe, In, Dh).call(f, g(this, vi).box, d),
      path: {
        d: g(this, vi).toSVGPath()
      }
    });
  }
  const [r, o, l, c] = e.box;
  switch (this.rotation) {
    case 0:
      this.x = r, this.y = o, this.width = l, this.height = c;
      break;
    case 90: {
      const [d, p] = this.parentDimensions;
      this.x = o, this.y = 1 - r, this.width = l * p / d, this.height = c * d / p;
      break;
    }
    case 180:
      this.x = 1 - r, this.y = 1 - o, this.width = l, this.height = c;
      break;
    case 270: {
      const [d, p] = this.parentDimensions;
      this.x = 1 - o, this.y = r, this.width = l * p / d, this.height = c * d / p;
      break;
    }
  }
  const {
    lastPoint: h
  } = g(this, vi);
  S(this, n1, [(h[0] - r) / l, (h[1] - o) / c]);
}, tv = function(e) {
  const i = (r, o) => {
    var l, c;
    this.color = r, S(this, _r, o), (l = this.parent) == null || l.drawLayer.updateProperties(g(this, Hi), {
      root: {
        fill: r,
        "fill-opacity": o
      }
    }), (c = g(this, i1)) == null || c.updateColor(r);
  }, n = this.color, a = g(this, _r);
  this.addCommands({
    cmd: i.bind(this, e, pe._defaultOpacity),
    undo: i.bind(this, n, a),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: ae.HIGHLIGHT_COLOR,
    overwriteIfSameType: !0,
    keepUndo: !0
  }), this._reportTelemetry({
    action: "color_changed",
    color: this._uiManager.highlightColorNames.get(e)
  }, !0);
}, ev = function(e) {
  const i = g(this, dn), n = (a) => {
    S(this, dn, a), C(this, Xt, sv).call(this, a);
  };
  this.addCommands({
    cmd: n.bind(this, e),
    undo: n.bind(this, i),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: ae.INK_THICKNESS,
    overwriteIfSameType: !0,
    keepUndo: !0
  }), this._reportTelemetry({
    action: "thickness_changed",
    thickness: e
  }, !0);
}, sv = function(e) {
  if (!g(this, _s))
    return;
  C(this, Xt, Eg).call(this, {
    highlightOutlines: g(this, un).getNewOutline(e / 2)
  }), this.fixAndSetPosition();
  const [i, n] = this.parentDimensions;
  this.setDims(this.width * i, this.height * n);
}, r3 = function() {
  g(this, Hi) === null || !this.parent || (this.parent.drawLayer.remove(g(this, Hi)), S(this, Hi, null), this.parent.drawLayer.remove(g(this, Gs)), S(this, Gs, null));
}, Sl = function(e = this.parent) {
  g(this, Hi) === null && ({
    id: Qs(this, Hi)._,
    clipPathId: Qs(this, Pc)._
  } = e.drawLayer.draw({
    bbox: g(this, un).box,
    root: {
      viewBox: "0 0 1 1",
      fill: this.color,
      "fill-opacity": g(this, _r)
    },
    rootClass: {
      highlight: !0,
      free: g(this, _s)
    },
    path: {
      d: g(this, un).toSVGPath()
    }
  }, !1, !0), S(this, Gs, e.drawLayer.drawOutline({
    rootClass: {
      highlightOutline: !0,
      free: g(this, _s)
    },
    bbox: g(this, vi).box,
    path: {
      d: g(this, vi).toSVGPath()
    }
  }, g(this, _s))), g(this, Dc) && (g(this, Dc).style.clipPath = g(this, Pc)));
}, In = new WeakSet(), Dh = function([e, i, n, a], r) {
  switch (r) {
    case 90:
      return [1 - i - a, e, a, n];
    case 180:
      return [1 - e - n, 1 - i - a, n, a];
    case 270:
      return [i, 1 - e - n, a, n];
  }
  return [e, i, n, a];
}, iv = function(e) {
  pe._keyboardManager.exec(this, e);
}, Mg = function(e) {
  if (!g(this, s1))
    return;
  const i = window.getSelection();
  e ? i.setPosition(g(this, s1), g(this, $f)) : i.setPosition(g(this, zf), g(this, Gf));
}, xd = function() {
  return g(this, _s) ? this.rotation : 0;
}, nv = function() {
  if (g(this, _s))
    return null;
  const [e, i] = this.pageDimensions, [n, a] = this.pageTranslation, r = g(this, Ir), o = new Float32Array(r.length * 8);
  let l = 0;
  for (const {
    x: c,
    y: h,
    width: u,
    height: f
  } of r) {
    const d = c * e + n, p = (1 - h) * i + a;
    o[l] = o[l + 4] = d, o[l + 1] = o[l + 3] = p, o[l + 2] = o[l + 6] = d + u * e, o[l + 5] = o[l + 7] = p - f * i, l += 8;
  }
  return o;
}, av = function(e) {
  return g(this, un).serialize(e, C(this, Xt, xd).call(this));
}, rv = function(e, i) {
  this._freeHighlight.add(i) && e.drawLayer.updateProperties(this._freeHighlightId, {
    path: {
      d: this._freeHighlight.toSVGPath()
    }
  });
}, ov = function(e, i) {
  this._freeHighlight.isEmpty() ? e.drawLayer.remove(this._freeHighlightId) : e.createAndAddNewEditor(i, !1, {
    highlightId: this._freeHighlightId,
    highlightOutlines: this._freeHighlight.getOutlines(),
    clipPathId: this._freeHighlightClipId,
    methodOfCreation: "main_toolbar"
  }), this._freeHighlightId = -1, this._freeHighlight = null, this._freeHighlightClipId = "";
}, lv = function(e) {
  const {
    color: i
  } = this._initialData;
  return e.color.some((n, a) => n !== i[a]);
}, _(pe, In), ht(pe, "_defaultColor", null), ht(pe, "_defaultOpacity", 1), ht(pe, "_defaultThickness", 12), ht(pe, "_type", "highlight"), ht(pe, "_editorType", Ht.HIGHLIGHT), ht(pe, "_freeHighlightId", -1), ht(pe, "_freeHighlight", null), ht(pe, "_freeHighlightClipId", "");
let fp = pe;
var Nc;
class cv {
  constructor() {
    _(this, Nc, /* @__PURE__ */ Object.create(null));
  }
  updateProperty(t, e) {
    this[t] = e, this.updateSVGProperty(t, e);
  }
  updateProperties(t) {
    if (t)
      for (const [e, i] of Object.entries(t))
        e.startsWith("_") || this.updateProperty(e, i);
  }
  updateSVGProperty(t, e) {
    g(this, Nc)[t] = e;
  }
  toSVGProperties() {
    const t = g(this, Nc);
    return S(this, Nc, /* @__PURE__ */ Object.create(null)), {
      root: t
    };
  }
  reset() {
    S(this, Nc, /* @__PURE__ */ Object.create(null));
  }
  updateAll(t = this) {
    this.updateProperties(t);
  }
  clone() {
    Ae("Not implemented");
  }
}
Nc = new WeakMap();
var $i, r1, ms, Bc, Lc, Oo, Uo, qo, Oc, ue, o3, l3, c3, kd, hv, Fg, Sd, Nh;
const Et = class Et extends Ie {
  constructor(e) {
    super(e);
    _(this, ue);
    _(this, $i, null);
    _(this, r1);
    ht(this, "_drawId", null);
    S(this, r1, e.mustBeCommitted || !1), this._addOutlines(e);
  }
  _addOutlines(e) {
    e.drawOutlines && (C(this, ue, o3).call(this, e), C(this, ue, kd).call(this));
  }
  static _mergeSVGProperties(e, i) {
    const n = new Set(Object.keys(e));
    for (const [a, r] of Object.entries(i))
      n.has(a) ? Object.assign(e[a], r) : e[a] = r;
    return e;
  }
  static getDefaultDrawingOptions(e) {
    Ae("Not implemented");
  }
  static get typesMap() {
    Ae("Not implemented");
  }
  static get isDrawer() {
    return !0;
  }
  static get supportMultipleDrawings() {
    return !1;
  }
  static updateDefaultParams(e, i) {
    const n = this.typesMap.get(e);
    n && this._defaultDrawingOptions.updateProperty(n, i), this._currentParent && (g(Et, ms).updateProperty(n, i), this._currentParent.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()));
  }
  updateParams(e, i) {
    const n = this.constructor.typesMap.get(e);
    n && this._updateProperty(e, n, i);
  }
  static get defaultPropertiesToUpdate() {
    const e = [], i = this._defaultDrawingOptions;
    for (const [n, a] of this.typesMap)
      e.push([n, i[a]]);
    return e;
  }
  get propertiesToUpdate() {
    const e = [], {
      _drawingOptions: i
    } = this;
    for (const [n, a] of this.constructor.typesMap)
      e.push([n, i[a]]);
    return e;
  }
  _updateProperty(e, i, n) {
    const a = this._drawingOptions, r = a[i], o = (l) => {
      var h;
      a.updateProperty(i, l);
      const c = g(this, $i).updateProperty(i, l);
      c && C(this, ue, Sd).call(this, c), (h = this.parent) == null || h.drawLayer.updateProperties(this._drawId, a.toSVGProperties());
    };
    this.addCommands({
      cmd: o.bind(this, n),
      undo: o.bind(this, r),
      post: this._uiManager.updateUI.bind(this._uiManager, this),
      mustExec: !0,
      type: e,
      overwriteIfSameType: !0,
      keepUndo: !0
    });
  }
  _onResizing() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, Et._mergeSVGProperties(g(this, $i).getPathResizingSVGProperties(C(this, ue, Fg).call(this)), {
      bbox: C(this, ue, Nh).call(this)
    }));
  }
  _onResized() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, Et._mergeSVGProperties(g(this, $i).getPathResizedSVGProperties(C(this, ue, Fg).call(this)), {
      bbox: C(this, ue, Nh).call(this)
    }));
  }
  _onTranslating(e, i) {
    var n;
    (n = this.parent) == null || n.drawLayer.updateProperties(this._drawId, {
      bbox: C(this, ue, Nh).call(this)
    });
  }
  _onTranslated() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, Et._mergeSVGProperties(g(this, $i).getPathTranslatedSVGProperties(C(this, ue, Fg).call(this), this.parentDimensions), {
      bbox: C(this, ue, Nh).call(this)
    }));
  }
  _onStartDragging() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, {
      rootClass: {
        moving: !0
      }
    });
  }
  _onStopDragging() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, {
      rootClass: {
        moving: !1
      }
    });
  }
  commit() {
    super.commit(), this.disableEditMode(), this.disableEditing();
  }
  disableEditing() {
    super.disableEditing(), this.div.classList.toggle("disabled", !0);
  }
  enableEditing() {
    super.enableEditing(), this.div.classList.toggle("disabled", !1);
  }
  getBaseTranslation() {
    return [0, 0];
  }
  get isResizable() {
    return !0;
  }
  onceAdded(e) {
    this.annotationElementId || this.parent.addUndoableEditor(this), this._isDraggable = !0, g(this, r1) && (S(this, r1, !1), this.commit(), this.parent.setSelected(this), e && this.isOnScreen && this.div.focus());
  }
  remove() {
    C(this, ue, c3).call(this), super.remove();
  }
  rebuild() {
    this.parent && (super.rebuild(), this.div !== null && (C(this, ue, kd).call(this), C(this, ue, Sd).call(this, g(this, $i).box), this.isAttachedToDOM || this.parent.add(this)));
  }
  setParent(e) {
    var n;
    let i = !1;
    this.parent && !e ? (this._uiManager.removeShouldRescale(this), C(this, ue, c3).call(this)) : e && (this._uiManager.addShouldRescale(this), C(this, ue, kd).call(this, e), i = !this.parent && ((n = this.div) == null ? void 0 : n.classList.contains("selectedEditor"))), super.setParent(e), i && this.select();
  }
  rotate() {
    this.parent && this.parent.drawLayer.updateProperties(this._drawId, Et._mergeSVGProperties({
      bbox: C(this, ue, Nh).call(this)
    }, g(this, $i).updateRotation((this.parentRotation - this.rotation + 360) % 360)));
  }
  onScaleChanging() {
    this.parent && C(this, ue, Sd).call(this, g(this, $i).updateParentDimensions(this.parentDimensions, this.parent.scale));
  }
  static onScaleChangingWhenDrawing() {
  }
  render() {
    if (this.div)
      return this.div;
    let e, i;
    this._isCopy && (e = this.x, i = this.y);
    const n = super.render();
    n.classList.add("draw");
    const a = document.createElement("div");
    n.append(a), a.setAttribute("aria-hidden", "true"), a.className = "internal";
    const [r, o] = this.parentDimensions;
    return this.setDims(this.width * r, this.height * o), this._uiManager.addShouldRescale(this), this.disableEditing(), this._isCopy && this._moveAfterPaste(e, i), n;
  }
  static createDrawerInstance(e, i, n, a, r) {
    Ae("Not implemented");
  }
  static startDrawing(e, i, n, a) {
    var b;
    const {
      target: r,
      offsetX: o,
      offsetY: l,
      pointerId: c,
      pointerType: h
    } = a;
    if (g(Et, Uo) && g(Et, Uo) !== h)
      return;
    const {
      viewport: {
        rotation: u
      }
    } = e, {
      width: f,
      height: d
    } = r.getBoundingClientRect(), p = S(Et, Bc, new AbortController()), m = e.combinedSignal(p);
    if (g(Et, Oo) || S(Et, Oo, c), g(Et, Uo) ?? S(Et, Uo, h), window.addEventListener("pointerup", (y) => {
      var v;
      g(Et, Oo) === y.pointerId ? this._endDraw(y) : (v = g(Et, qo)) == null || v.delete(y.pointerId);
    }, {
      signal: m
    }), window.addEventListener("pointercancel", (y) => {
      var v;
      g(Et, Oo) === y.pointerId ? this._currentParent.endDrawingSession() : (v = g(Et, qo)) == null || v.delete(y.pointerId);
    }, {
      signal: m
    }), window.addEventListener("pointerdown", (y) => {
      g(Et, Uo) === y.pointerType && ((g(Et, qo) || S(Et, qo, /* @__PURE__ */ new Set())).add(y.pointerId), g(Et, ms).isCancellable() && (g(Et, ms).removeLastElement(), g(Et, ms).isEmpty() ? this._currentParent.endDrawingSession(!0) : this._endDraw(null)));
    }, {
      capture: !0,
      passive: !1,
      signal: m
    }), window.addEventListener("contextmenu", En, {
      signal: m
    }), r.addEventListener("pointermove", this._drawMove.bind(this), {
      signal: m
    }), r.addEventListener("touchmove", (y) => {
      y.timeStamp === g(Et, Oc) && Ze(y);
    }, {
      signal: m
    }), e.toggleDrawing(), (b = i._editorUndoBar) == null || b.hide(), g(Et, ms)) {
      e.drawLayer.updateProperties(this._currentDrawId, g(Et, ms).startNew(o, l, f, d, u));
      return;
    }
    i.updateUIForDefaultProperties(this), S(Et, ms, this.createDrawerInstance(o, l, f, d, u)), S(Et, Lc, this.getDefaultDrawingOptions()), this._currentParent = e, {
      id: this._currentDrawId
    } = e.drawLayer.draw(this._mergeSVGProperties(g(Et, Lc).toSVGProperties(), g(Et, ms).defaultSVGProperties), !0, !1);
  }
  static _drawMove(e) {
    var r;
    if (S(Et, Oc, -1), !g(Et, ms))
      return;
    const {
      offsetX: i,
      offsetY: n,
      pointerId: a
    } = e;
    if (g(Et, Oo) === a) {
      if (((r = g(Et, qo)) == null ? void 0 : r.size) >= 1) {
        this._endDraw(e);
        return;
      }
      this._currentParent.drawLayer.updateProperties(this._currentDrawId, g(Et, ms).add(i, n)), S(Et, Oc, e.timeStamp), Ze(e);
    }
  }
  static _cleanup(e) {
    e && (this._currentDrawId = -1, this._currentParent = null, S(Et, ms, null), S(Et, Lc, null), S(Et, Uo, null), S(Et, Oc, NaN)), g(Et, Bc) && (g(Et, Bc).abort(), S(Et, Bc, null), S(Et, Oo, NaN), S(Et, qo, null));
  }
  static _endDraw(e) {
    const i = this._currentParent;
    if (i) {
      if (i.toggleDrawing(!0), this._cleanup(!1), (e == null ? void 0 : e.target) === i.div && i.drawLayer.updateProperties(this._currentDrawId, g(Et, ms).end(e.offsetX, e.offsetY)), this.supportMultipleDrawings) {
        const n = g(Et, ms), a = this._currentDrawId, r = n.getLastElement();
        i.addCommands({
          cmd: () => {
            i.drawLayer.updateProperties(a, n.setLastElement(r));
          },
          undo: () => {
            i.drawLayer.updateProperties(a, n.removeLastElement());
          },
          mustExec: !1,
          type: ae.DRAW_STEP
        });
        return;
      }
      this.endDrawing(!1);
    }
  }
  static endDrawing(e) {
    const i = this._currentParent;
    if (!i)
      return null;
    if (i.toggleDrawing(!0), i.cleanUndoStack(ae.DRAW_STEP), !g(Et, ms).isEmpty()) {
      const {
        pageDimensions: [n, a],
        scale: r
      } = i, o = i.createAndAddNewEditor({
        offsetX: 0,
        offsetY: 0
      }, !1, {
        drawId: this._currentDrawId,
        drawOutlines: g(Et, ms).getOutlines(n * r, a * r, r, this._INNER_MARGIN),
        drawingOptions: g(Et, Lc),
        mustBeCommitted: !e
      });
      return this._cleanup(!0), o;
    }
    return i.drawLayer.remove(this._currentDrawId), this._cleanup(!0), null;
  }
  createDrawingOptions(e) {
  }
  static deserializeDraw(e, i, n, a, r, o) {
    Ae("Not implemented");
  }
  static async deserialize(e, i, n) {
    var u, f;
    const {
      rawDims: {
        pageWidth: a,
        pageHeight: r,
        pageX: o,
        pageY: l
      }
    } = i.viewport, c = this.deserializeDraw(o, l, a, r, this._INNER_MARGIN, e), h = await super.deserialize(e, i, n);
    return h.createDrawingOptions(e), C(u = h, ue, o3).call(u, {
      drawOutlines: c
    }), C(f = h, ue, kd).call(f), h.onScaleChanging(), h.rotate(), h;
  }
  serializeDraw(e) {
    const [i, n] = this.pageTranslation, [a, r] = this.pageDimensions;
    return g(this, $i).serialize([i, n, a, r], e);
  }
  renderAnnotationElement(e) {
    return e.updateEdited({
      rect: this.getRect(0, 0)
    }), null;
  }
  static canCreateNewEmptyEditor() {
    return !1;
  }
};
$i = new WeakMap(), r1 = new WeakMap(), ms = new WeakMap(), Bc = new WeakMap(), Lc = new WeakMap(), Oo = new WeakMap(), Uo = new WeakMap(), qo = new WeakMap(), Oc = new WeakMap(), ue = new WeakSet(), o3 = function({
  drawOutlines: e,
  drawId: i,
  drawingOptions: n
}) {
  S(this, $i, e), this._drawingOptions || (this._drawingOptions = n), i >= 0 ? (this._drawId = i, this.parent.drawLayer.finalizeDraw(i, e.defaultProperties)) : this._drawId = C(this, ue, l3).call(this, e, this.parent), C(this, ue, Sd).call(this, e.box);
}, l3 = function(e, i) {
  const {
    id: n
  } = i.drawLayer.draw(Et._mergeSVGProperties(this._drawingOptions.toSVGProperties(), e.defaultSVGProperties), !1, !1);
  return n;
}, c3 = function() {
  this._drawId === null || !this.parent || (this.parent.drawLayer.remove(this._drawId), this._drawId = null, this._drawingOptions.reset());
}, kd = function(e = this.parent) {
  if (!(this._drawId !== null && this.parent === e)) {
    if (this._drawId !== null) {
      this.parent.drawLayer.updateParent(this._drawId, e.drawLayer);
      return;
    }
    this._drawingOptions.updateAll(), this._drawId = C(this, ue, l3).call(this, g(this, $i), e);
  }
}, hv = function([e, i, n, a]) {
  const {
    parentDimensions: [r, o],
    rotation: l
  } = this;
  switch (l) {
    case 90:
      return [i, 1 - e, n * (o / r), a * (r / o)];
    case 180:
      return [1 - e, 1 - i, n, a];
    case 270:
      return [1 - i, e, n * (o / r), a * (r / o)];
    default:
      return [e, i, n, a];
  }
}, Fg = function() {
  const {
    x: e,
    y: i,
    width: n,
    height: a,
    parentDimensions: [r, o],
    rotation: l
  } = this;
  switch (l) {
    case 90:
      return [1 - i, e, n * (r / o), a * (o / r)];
    case 180:
      return [1 - e, 1 - i, n, a];
    case 270:
      return [i, 1 - e, n * (r / o), a * (o / r)];
    default:
      return [e, i, n, a];
  }
}, Sd = function(e) {
  if ([this.x, this.y, this.width, this.height] = C(this, ue, hv).call(this, e), this.div) {
    this.fixAndSetPosition();
    const [i, n] = this.parentDimensions;
    this.setDims(this.width * i, this.height * n);
  }
  this._onResized();
}, Nh = function() {
  const {
    x: e,
    y: i,
    width: n,
    height: a,
    rotation: r,
    parentRotation: o,
    parentDimensions: [l, c]
  } = this;
  switch ((r * 4 + o) / 90) {
    case 1:
      return [1 - i - a, e, a, n];
    case 2:
      return [1 - e - n, 1 - i - a, n, a];
    case 3:
      return [i, 1 - e - n, a, n];
    case 4:
      return [e, i - n * (l / c), a * (c / l), n * (l / c)];
    case 5:
      return [1 - i, e, n * (l / c), a * (c / l)];
    case 6:
      return [1 - e - a * (c / l), 1 - i, a * (c / l), n * (l / c)];
    case 7:
      return [i - n * (l / c), 1 - e - a * (c / l), n * (l / c), a * (c / l)];
    case 8:
      return [e - n, i - a, n, a];
    case 9:
      return [1 - i, e - n, a, n];
    case 10:
      return [1 - e, 1 - i, n, a];
    case 11:
      return [i - a, 1 - e, a, n];
    case 12:
      return [e - a * (c / l), i, a * (c / l), n * (l / c)];
    case 13:
      return [1 - i - n * (l / c), e - a * (c / l), n * (l / c), a * (c / l)];
    case 14:
      return [1 - e, 1 - i - n * (l / c), a * (c / l), n * (l / c)];
    case 15:
      return [i, 1 - e, n * (l / c), a * (c / l)];
    default:
      return [e, i, n, a];
  }
}, ht(Et, "_currentDrawId", -1), ht(Et, "_currentParent", null), _(Et, ms, null), _(Et, Bc, null), _(Et, Lc, null), _(Et, Oo, NaN), _(Et, Uo, null), _(Et, qo, null), _(Et, Oc, NaN), ht(Et, "_INNER_MARGIN", 3);
let gp = Et;
var Ta, bs, ys, Uc, o1, ni, Ts, fn, qc, jc, Hc, l1, Rg;
class uC {
  constructor(t, e, i, n, a, r) {
    _(this, l1);
    _(this, Ta, new Float64Array(6));
    _(this, bs);
    _(this, ys);
    _(this, Uc);
    _(this, o1);
    _(this, ni);
    _(this, Ts, "");
    _(this, fn, 0);
    _(this, qc, new A2());
    _(this, jc);
    _(this, Hc);
    S(this, jc, i), S(this, Hc, n), S(this, Uc, a), S(this, o1, r), [t, e] = C(this, l1, Rg).call(this, t, e);
    const o = S(this, bs, [NaN, NaN, NaN, NaN, t, e]);
    S(this, ni, [t, e]), S(this, ys, [{
      line: o,
      points: g(this, ni)
    }]), g(this, Ta).set(o, 0);
  }
  updateProperty(t, e) {
    t === "stroke-width" && S(this, o1, e);
  }
  isEmpty() {
    return !g(this, ys) || g(this, ys).length === 0;
  }
  isCancellable() {
    return g(this, ni).length <= 10;
  }
  add(t, e) {
    [t, e] = C(this, l1, Rg).call(this, t, e);
    const [i, n, a, r] = g(this, Ta).subarray(2, 6), o = t - a, l = e - r;
    return Math.hypot(g(this, jc) * o, g(this, Hc) * l) <= 2 ? null : (g(this, ni).push(t, e), isNaN(i) ? (g(this, Ta).set([a, r, t, e], 2), g(this, bs).push(NaN, NaN, NaN, NaN, t, e), {
      path: {
        d: this.toSVGPath()
      }
    }) : (isNaN(g(this, Ta)[0]) && g(this, bs).splice(6, 6), g(this, Ta).set([i, n, a, r, t, e], 0), g(this, bs).push(..._t.createBezierPoints(i, n, a, r, t, e)), {
      path: {
        d: this.toSVGPath()
      }
    }));
  }
  end(t, e) {
    const i = this.add(t, e);
    return i || (g(this, ni).length === 2 ? {
      path: {
        d: this.toSVGPath()
      }
    } : null);
  }
  startNew(t, e, i, n, a) {
    S(this, jc, i), S(this, Hc, n), S(this, Uc, a), [t, e] = C(this, l1, Rg).call(this, t, e);
    const r = S(this, bs, [NaN, NaN, NaN, NaN, t, e]);
    S(this, ni, [t, e]);
    const o = g(this, ys).at(-1);
    return o && (o.line = new Float32Array(o.line), o.points = new Float32Array(o.points)), g(this, ys).push({
      line: r,
      points: g(this, ni)
    }), g(this, Ta).set(r, 0), S(this, fn, 0), this.toSVGPath(), null;
  }
  getLastElement() {
    return g(this, ys).at(-1);
  }
  setLastElement(t) {
    return g(this, ys) ? (g(this, ys).push(t), S(this, bs, t.line), S(this, ni, t.points), S(this, fn, 0), {
      path: {
        d: this.toSVGPath()
      }
    }) : g(this, qc).setLastElement(t);
  }
  removeLastElement() {
    if (!g(this, ys))
      return g(this, qc).removeLastElement();
    g(this, ys).pop(), S(this, Ts, "");
    for (let t = 0, e = g(this, ys).length; t < e; t++) {
      const {
        line: i,
        points: n
      } = g(this, ys)[t];
      S(this, bs, i), S(this, ni, n), S(this, fn, 0), this.toSVGPath();
    }
    return {
      path: {
        d: g(this, Ts)
      }
    };
  }
  toSVGPath() {
    const t = _t.svgRound(g(this, bs)[4]), e = _t.svgRound(g(this, bs)[5]);
    if (g(this, ni).length === 2)
      return S(this, Ts, `${g(this, Ts)} M ${t} ${e} Z`), g(this, Ts);
    if (g(this, ni).length <= 6) {
      const n = g(this, Ts).lastIndexOf("M");
      S(this, Ts, `${g(this, Ts).slice(0, n)} M ${t} ${e}`), S(this, fn, 6);
    }
    if (g(this, ni).length === 4) {
      const n = _t.svgRound(g(this, bs)[10]), a = _t.svgRound(g(this, bs)[11]);
      return S(this, Ts, `${g(this, Ts)} L ${n} ${a}`), S(this, fn, 12), g(this, Ts);
    }
    const i = [];
    g(this, fn) === 0 && (i.push(`M ${t} ${e}`), S(this, fn, 6));
    for (let n = g(this, fn), a = g(this, bs).length; n < a; n += 6) {
      const [r, o, l, c, h, u] = g(this, bs).slice(n, n + 6).map(_t.svgRound);
      i.push(`C${r} ${o} ${l} ${c} ${h} ${u}`);
    }
    return S(this, Ts, g(this, Ts) + i.join(" ")), S(this, fn, g(this, bs).length), g(this, Ts);
  }
  getOutlines(t, e, i, n) {
    const a = g(this, ys).at(-1);
    return a.line = new Float32Array(a.line), a.points = new Float32Array(a.points), g(this, qc).build(g(this, ys), t, e, i, g(this, Uc), g(this, o1), n), S(this, Ta, null), S(this, bs, null), S(this, ys, null), S(this, Ts, null), g(this, qc);
  }
  get defaultSVGProperties() {
    return {
      root: {
        viewBox: "0 0 10000 10000"
      },
      rootClass: {
        draw: !0
      },
      bbox: [0, 0, 1, 1]
    };
  }
}
Ta = new WeakMap(), bs = new WeakMap(), ys = new WeakMap(), Uc = new WeakMap(), o1 = new WeakMap(), ni = new WeakMap(), Ts = new WeakMap(), fn = new WeakMap(), qc = new WeakMap(), jc = new WeakMap(), Hc = new WeakMap(), l1 = new WeakSet(), Rg = function(t, e) {
  return _t._normalizePoint(t, e, g(this, jc), g(this, Hc), g(this, Uc));
};
var ai, Wf, Xf, zi, Ea, Ma, c1, h1, $c, Ds, Ja, uv, dv, fv;
class A2 extends _t {
  constructor() {
    super(...arguments);
    _(this, Ds);
    _(this, ai);
    _(this, Wf, 0);
    _(this, Xf);
    _(this, zi);
    _(this, Ea);
    _(this, Ma);
    _(this, c1);
    _(this, h1);
    _(this, $c);
  }
  build(e, i, n, a, r, o, l) {
    S(this, Ea, i), S(this, Ma, n), S(this, c1, a), S(this, h1, r), S(this, $c, o), S(this, Xf, l ?? 0), S(this, zi, e), C(this, Ds, dv).call(this);
  }
  get thickness() {
    return g(this, $c);
  }
  setLastElement(e) {
    return g(this, zi).push(e), {
      path: {
        d: this.toSVGPath()
      }
    };
  }
  removeLastElement() {
    return g(this, zi).pop(), {
      path: {
        d: this.toSVGPath()
      }
    };
  }
  toSVGPath() {
    const e = [];
    for (const {
      line: i
    } of g(this, zi)) {
      if (e.push(`M${_t.svgRound(i[4])} ${_t.svgRound(i[5])}`), i.length === 6) {
        e.push("Z");
        continue;
      }
      if (i.length === 12 && isNaN(i[6])) {
        e.push(`L${_t.svgRound(i[10])} ${_t.svgRound(i[11])}`);
        continue;
      }
      for (let n = 6, a = i.length; n < a; n += 6) {
        const [r, o, l, c, h, u] = i.subarray(n, n + 6).map(_t.svgRound);
        e.push(`C${r} ${o} ${l} ${c} ${h} ${u}`);
      }
    }
    return e.join("");
  }
  serialize([e, i, n, a], r) {
    const o = [], l = [], [c, h, u, f] = C(this, Ds, uv).call(this);
    let d, p, m, b, y, v, w, A, x;
    switch (g(this, h1)) {
      case 0:
        x = _t._rescale, d = e, p = i + a, m = n, b = -a, y = e + c * n, v = i + (1 - h - f) * a, w = e + (c + u) * n, A = i + (1 - h) * a;
        break;
      case 90:
        x = _t._rescaleAndSwap, d = e, p = i, m = n, b = a, y = e + h * n, v = i + c * a, w = e + (h + f) * n, A = i + (c + u) * a;
        break;
      case 180:
        x = _t._rescale, d = e + n, p = i, m = -n, b = a, y = e + (1 - c - u) * n, v = i + h * a, w = e + (1 - c) * n, A = i + (h + f) * a;
        break;
      case 270:
        x = _t._rescaleAndSwap, d = e + n, p = i + a, m = -n, b = -a, y = e + (1 - h - f) * n, v = i + (1 - c - u) * a, w = e + (1 - h) * n, A = i + (1 - c) * a;
        break;
    }
    for (const {
      line: k,
      points: I
    } of g(this, zi))
      o.push(x(k, d, p, m, b, r ? new Array(k.length) : null)), l.push(x(I, d, p, m, b, r ? new Array(I.length) : null));
    return {
      lines: o,
      points: l,
      rect: [y, v, w, A]
    };
  }
  static deserialize(e, i, n, a, r, {
    paths: {
      lines: o,
      points: l
    },
    rotation: c,
    thickness: h
  }) {
    const u = [];
    let f, d, p, m, b;
    switch (c) {
      case 0:
        b = _t._rescale, f = -e / n, d = i / a + 1, p = 1 / n, m = -1 / a;
        break;
      case 90:
        b = _t._rescaleAndSwap, f = -i / a, d = -e / n, p = 1 / a, m = 1 / n;
        break;
      case 180:
        b = _t._rescale, f = e / n + 1, d = -i / a, p = -1 / n, m = 1 / a;
        break;
      case 270:
        b = _t._rescaleAndSwap, f = i / a + 1, d = e / n + 1, p = -1 / a, m = -1 / n;
        break;
    }
    if (!o) {
      o = [];
      for (const v of l) {
        const w = v.length;
        if (w === 2) {
          o.push(new Float32Array([NaN, NaN, NaN, NaN, v[0], v[1]]));
          continue;
        }
        if (w === 4) {
          o.push(new Float32Array([NaN, NaN, NaN, NaN, v[0], v[1], NaN, NaN, NaN, NaN, v[2], v[3]]));
          continue;
        }
        const A = new Float32Array(3 * (w - 2));
        o.push(A);
        let [x, k, I, T] = v.subarray(0, 4);
        A.set([NaN, NaN, NaN, NaN, x, k], 0);
        for (let E = 4; E < w; E += 2) {
          const M = v[E], F = v[E + 1];
          A.set(_t.createBezierPoints(x, k, I, T, M, F), (E - 2) * 3), [x, k, I, T] = [I, T, M, F];
        }
      }
    }
    for (let v = 0, w = o.length; v < w; v++)
      u.push({
        line: b(o[v].map((A) => A ?? NaN), f, d, p, m),
        points: b(l[v].map((A) => A ?? NaN), f, d, p, m)
      });
    const y = new this.prototype.constructor();
    return y.build(u, n, a, 1, c, h, r), y;
  }
  get box() {
    return g(this, ai);
  }
  updateProperty(e, i) {
    return e === "stroke-width" ? C(this, Ds, fv).call(this, i) : null;
  }
  updateParentDimensions([e, i], n) {
    const [a, r] = C(this, Ds, Ja).call(this);
    S(this, Ea, e), S(this, Ma, i), S(this, c1, n);
    const [o, l] = C(this, Ds, Ja).call(this), c = o - a, h = l - r, u = g(this, ai);
    return u[0] -= c, u[1] -= h, u[2] += 2 * c, u[3] += 2 * h, u;
  }
  updateRotation(e) {
    return S(this, Wf, e), {
      path: {
        transform: this.rotationTransform
      }
    };
  }
  get viewBox() {
    return g(this, ai).map(_t.svgRound).join(" ");
  }
  get defaultProperties() {
    const [e, i] = g(this, ai);
    return {
      root: {
        viewBox: this.viewBox
      },
      path: {
        "transform-origin": `${_t.svgRound(e)} ${_t.svgRound(i)}`
      }
    };
  }
  get rotationTransform() {
    const [, , e, i] = g(this, ai);
    let n = 0, a = 0, r = 0, o = 0, l = 0, c = 0;
    switch (g(this, Wf)) {
      case 90:
        a = i / e, r = -e / i, l = e;
        break;
      case 180:
        n = -1, o = -1, l = e, c = i;
        break;
      case 270:
        a = -i / e, r = e / i, c = i;
        break;
      default:
        return "";
    }
    return `matrix(${n} ${a} ${r} ${o} ${_t.svgRound(l)} ${_t.svgRound(c)})`;
  }
  getPathResizingSVGProperties([e, i, n, a]) {
    const [r, o] = C(this, Ds, Ja).call(this), [l, c, h, u] = g(this, ai);
    if (Math.abs(h - r) <= _t.PRECISION || Math.abs(u - o) <= _t.PRECISION) {
      const b = e + n / 2 - (l + h / 2), y = i + a / 2 - (c + u / 2);
      return {
        path: {
          "transform-origin": `${_t.svgRound(e)} ${_t.svgRound(i)}`,
          transform: `${this.rotationTransform} translate(${b} ${y})`
        }
      };
    }
    const f = (n - 2 * r) / (h - 2 * r), d = (a - 2 * o) / (u - 2 * o), p = h / n, m = u / a;
    return {
      path: {
        "transform-origin": `${_t.svgRound(l)} ${_t.svgRound(c)}`,
        transform: `${this.rotationTransform} scale(${p} ${m}) translate(${_t.svgRound(r)} ${_t.svgRound(o)}) scale(${f} ${d}) translate(${_t.svgRound(-r)} ${_t.svgRound(-o)})`
      }
    };
  }
  getPathResizedSVGProperties([e, i, n, a]) {
    const [r, o] = C(this, Ds, Ja).call(this), l = g(this, ai), [c, h, u, f] = l;
    if (l[0] = e, l[1] = i, l[2] = n, l[3] = a, Math.abs(u - r) <= _t.PRECISION || Math.abs(f - o) <= _t.PRECISION) {
      const y = e + n / 2 - (c + u / 2), v = i + a / 2 - (h + f / 2);
      for (const {
        line: w,
        points: A
      } of g(this, zi))
        _t._translate(w, y, v, w), _t._translate(A, y, v, A);
      return {
        root: {
          viewBox: this.viewBox
        },
        path: {
          "transform-origin": `${_t.svgRound(e)} ${_t.svgRound(i)}`,
          transform: this.rotationTransform || null,
          d: this.toSVGPath()
        }
      };
    }
    const d = (n - 2 * r) / (u - 2 * r), p = (a - 2 * o) / (f - 2 * o), m = -d * (c + r) + e + r, b = -p * (h + o) + i + o;
    if (d !== 1 || p !== 1 || m !== 0 || b !== 0)
      for (const {
        line: y,
        points: v
      } of g(this, zi))
        _t._rescale(y, m, b, d, p, y), _t._rescale(v, m, b, d, p, v);
    return {
      root: {
        viewBox: this.viewBox
      },
      path: {
        "transform-origin": `${_t.svgRound(e)} ${_t.svgRound(i)}`,
        transform: this.rotationTransform || null,
        d: this.toSVGPath()
      }
    };
  }
  getPathTranslatedSVGProperties([e, i], n) {
    const [a, r] = n, o = g(this, ai), l = e - o[0], c = i - o[1];
    if (g(this, Ea) === a && g(this, Ma) === r)
      for (const {
        line: h,
        points: u
      } of g(this, zi))
        _t._translate(h, l, c, h), _t._translate(u, l, c, u);
    else {
      const h = g(this, Ea) / a, u = g(this, Ma) / r;
      S(this, Ea, a), S(this, Ma, r);
      for (const {
        line: f,
        points: d
      } of g(this, zi))
        _t._rescale(f, l, c, h, u, f), _t._rescale(d, l, c, h, u, d);
      o[2] *= h, o[3] *= u;
    }
    return o[0] = e, o[1] = i, {
      root: {
        viewBox: this.viewBox
      },
      path: {
        d: this.toSVGPath(),
        "transform-origin": `${_t.svgRound(e)} ${_t.svgRound(i)}`
      }
    };
  }
  get defaultSVGProperties() {
    const e = g(this, ai);
    return {
      root: {
        viewBox: this.viewBox
      },
      rootClass: {
        draw: !0
      },
      path: {
        d: this.toSVGPath(),
        "transform-origin": `${_t.svgRound(e[0])} ${_t.svgRound(e[1])}`,
        transform: this.rotationTransform || null
      },
      bbox: e
    };
  }
}
ai = new WeakMap(), Wf = new WeakMap(), Xf = new WeakMap(), zi = new WeakMap(), Ea = new WeakMap(), Ma = new WeakMap(), c1 = new WeakMap(), h1 = new WeakMap(), $c = new WeakMap(), Ds = new WeakSet(), Ja = function(e = g(this, $c)) {
  const i = g(this, Xf) + e / 2 * g(this, c1);
  return g(this, h1) % 180 === 0 ? [i / g(this, Ea), i / g(this, Ma)] : [i / g(this, Ma), i / g(this, Ea)];
}, uv = function() {
  const [e, i, n, a] = g(this, ai), [r, o] = C(this, Ds, Ja).call(this, 0);
  return [e + r, i + o, n - 2 * r, a - 2 * o];
}, dv = function() {
  const e = S(this, ai, new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]));
  for (const {
    line: a
  } of g(this, zi)) {
    if (a.length <= 12) {
      for (let l = 4, c = a.length; l < c; l += 6)
        Dt.pointBoundingBox(a[l], a[l + 1], e);
      continue;
    }
    let r = a[4], o = a[5];
    for (let l = 6, c = a.length; l < c; l += 6) {
      const [h, u, f, d, p, m] = a.subarray(l, l + 6);
      Dt.bezierBoundingBox(r, o, h, u, f, d, p, m, e), r = p, o = m;
    }
  }
  const [i, n] = C(this, Ds, Ja).call(this);
  e[0] = Ws(e[0] - i, 0, 1), e[1] = Ws(e[1] - n, 0, 1), e[2] = Ws(e[2] + i, 0, 1), e[3] = Ws(e[3] + n, 0, 1), e[2] -= e[0], e[3] -= e[1];
}, fv = function(e) {
  const [i, n] = C(this, Ds, Ja).call(this);
  S(this, $c, e);
  const [a, r] = C(this, Ds, Ja).call(this), [o, l] = [a - i, r - n], c = g(this, ai);
  return c[0] -= o, c[1] -= l, c[2] += 2 * o, c[3] += 2 * l, c;
};
class G9 extends cv {
  constructor(t) {
    super(), this._viewParameters = t, super.updateProperties({
      fill: "none",
      stroke: Ie._defaultLineColor,
      "stroke-opacity": 1,
      "stroke-width": 1,
      "stroke-linecap": "round",
      "stroke-linejoin": "round",
      "stroke-miterlimit": 10
    });
  }
  updateSVGProperty(t, e) {
    t === "stroke-width" && (e ?? (e = this["stroke-width"]), e *= this._viewParameters.realScale), super.updateSVGProperty(t, e);
  }
  clone() {
    const t = new G9(this._viewParameters);
    return t.updateAll(this), t;
  }
}
var k9, gv;
const Yh = class Yh extends gp {
  constructor(e) {
    super({
      ...e,
      name: "inkEditor"
    });
    _(this, k9);
    this._willKeepAspectRatio = !0, this.defaultL10nId = "pdfjs-editor-ink-editor";
  }
  static initialize(e, i) {
    Ie.initialize(e, i), this._defaultDrawingOptions = new G9(i.viewParameters);
  }
  static getDefaultDrawingOptions(e) {
    const i = this._defaultDrawingOptions.clone();
    return i.updateProperties(e), i;
  }
  static get supportMultipleDrawings() {
    return !0;
  }
  static get typesMap() {
    return ne(this, "typesMap", /* @__PURE__ */ new Map([[ae.INK_THICKNESS, "stroke-width"], [ae.INK_COLOR, "stroke"], [ae.INK_OPACITY, "stroke-opacity"]]));
  }
  static createDrawerInstance(e, i, n, a, r) {
    return new uC(e, i, n, a, r, this._defaultDrawingOptions["stroke-width"]);
  }
  static deserializeDraw(e, i, n, a, r, o) {
    return A2.deserialize(e, i, n, a, r, o);
  }
  static async deserialize(e, i, n) {
    let a = null;
    if (e instanceof n7) {
      const {
        data: {
          inkLists: o,
          rect: l,
          rotation: c,
          id: h,
          color: u,
          opacity: f,
          borderStyle: {
            rawWidth: d
          },
          popupRef: p
        },
        parent: {
          page: {
            pageNumber: m
          }
        }
      } = e;
      a = e = {
        annotationType: Ht.INK,
        color: Array.from(u),
        thickness: d,
        opacity: f,
        paths: {
          points: o
        },
        boxes: null,
        pageIndex: m - 1,
        rect: l.slice(0),
        rotation: c,
        id: h,
        deleted: !1,
        popupRef: p
      };
    }
    const r = await super.deserialize(e, i, n);
    return r.annotationElementId = e.id || null, r._initialData = a, r;
  }
  onScaleChanging() {
    if (!this.parent)
      return;
    super.onScaleChanging();
    const {
      _drawId: e,
      _drawingOptions: i,
      parent: n
    } = this;
    i.updateSVGProperty("stroke-width"), n.drawLayer.updateProperties(e, i.toSVGProperties());
  }
  static onScaleChangingWhenDrawing() {
    const e = this._currentParent;
    e && (super.onScaleChangingWhenDrawing(), this._defaultDrawingOptions.updateSVGProperty("stroke-width"), e.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()));
  }
  createDrawingOptions({
    color: e,
    thickness: i,
    opacity: n
  }) {
    this._drawingOptions = Yh.getDefaultDrawingOptions({
      stroke: Dt.makeHexColor(...e),
      "stroke-width": i,
      "stroke-opacity": n
    });
  }
  serialize(e = !1) {
    if (this.isEmpty())
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const {
      lines: i,
      points: n,
      rect: a
    } = this.serializeDraw(e), {
      _drawingOptions: {
        stroke: r,
        "stroke-opacity": o,
        "stroke-width": l
      }
    } = this, c = {
      annotationType: Ht.INK,
      color: Ie._colorManager.convert(r),
      opacity: o,
      thickness: l,
      paths: {
        lines: i,
        points: n
      },
      pageIndex: this.pageIndex,
      rect: a,
      rotation: this.rotation,
      structTreeParentId: this._structTreeParentId
    };
    return e ? (c.isCopy = !0, c) : this.annotationElementId && !C(this, k9, gv).call(this, c) ? null : (c.id = this.annotationElementId, c);
  }
  renderAnnotationElement(e) {
    const {
      points: i,
      rect: n
    } = this.serializeDraw(!1);
    return e.updateEdited({
      rect: n,
      thickness: this._drawingOptions["stroke-width"],
      points: i
    }), null;
  }
};
k9 = new WeakSet(), gv = function(e) {
  const {
    color: i,
    thickness: n,
    opacity: a,
    pageIndex: r
  } = this._initialData;
  return this._hasBeenMoved || this._hasBeenResized || e.color.some((o, l) => o !== i[l]) || e.thickness !== n || e.opacity !== a || e.pageIndex !== r;
}, ht(Yh, "_type", "ink"), ht(Yh, "_editorType", Ht.INK), ht(Yh, "_defaultDrawingOptions", null);
let h3 = Yh;
class u3 extends A2 {
  toSVGPath() {
    let t = super.toSVGPath();
    return t.endsWith("Z") || (t += "Z"), t;
  }
}
const q2 = 8, V1 = 3;
var zc, be, d3, Wn, pv, mv, f3, Pg, bv, yv, wv, g3, p3, vv;
class Oa {
  static extractContoursFromText(t, {
    fontFamily: e,
    fontStyle: i,
    fontWeight: n
  }, a, r, o, l) {
    let c = new OffscreenCanvas(1, 1), h = c.getContext("2d", {
      alpha: !1
    });
    const u = 200, f = h.font = `${i} ${n} ${u}px ${e}`, {
      actualBoundingBoxLeft: d,
      actualBoundingBoxRight: p,
      actualBoundingBoxAscent: m,
      actualBoundingBoxDescent: b,
      fontBoundingBoxAscent: y,
      fontBoundingBoxDescent: v,
      width: w
    } = h.measureText(t), A = 1.5, x = Math.ceil(Math.max(Math.abs(d) + Math.abs(p) || 0, w) * A), k = Math.ceil(Math.max(Math.abs(m) + Math.abs(b) || u, Math.abs(y) + Math.abs(v) || u) * A);
    c = new OffscreenCanvas(x, k), h = c.getContext("2d", {
      alpha: !0,
      willReadFrequently: !0
    }), h.font = f, h.filter = "grayscale(1)", h.fillStyle = "white", h.fillRect(0, 0, x, k), h.fillStyle = "black", h.fillText(t, x * (A - 1) / 2, k * (3 - A) / 2);
    const I = C(this, be, g3).call(this, h.getImageData(0, 0, x, k).data), T = C(this, be, wv).call(this, I), E = C(this, be, p3).call(this, T), M = C(this, be, f3).call(this, I, x, k, E);
    return this.processDrawnLines({
      lines: {
        curves: M,
        width: x,
        height: k
      },
      pageWidth: a,
      pageHeight: r,
      rotation: o,
      innerMargin: l,
      mustSmooth: !0,
      areContours: !0
    });
  }
  static process(t, e, i, n, a) {
    const [r, o, l] = C(this, be, vv).call(this, t), [c, h] = C(this, be, yv).call(this, r, o, l, Math.hypot(o, l) * g(this, zc).sigmaSFactor, g(this, zc).sigmaR, g(this, zc).kernelSize), u = C(this, be, p3).call(this, h), f = C(this, be, f3).call(this, c, o, l, u);
    return this.processDrawnLines({
      lines: {
        curves: f,
        width: o,
        height: l
      },
      pageWidth: e,
      pageHeight: i,
      rotation: n,
      innerMargin: a,
      mustSmooth: !0,
      areContours: !0
    });
  }
  static processDrawnLines({
    lines: t,
    pageWidth: e,
    pageHeight: i,
    rotation: n,
    innerMargin: a,
    mustSmooth: r,
    areContours: o
  }) {
    n % 180 !== 0 && ([e, i] = [i, e]);
    const {
      curves: l,
      width: c,
      height: h
    } = t, u = t.thickness ?? 0, f = [], d = Math.min(e / c, i / h), p = d / e, m = d / i, b = [];
    for (const {
      points: v
    } of l) {
      const w = r ? C(this, be, bv).call(this, v) : v;
      if (!w)
        continue;
      b.push(w);
      const A = w.length, x = new Float32Array(A), k = new Float32Array(3 * (A === 2 ? 2 : A - 2));
      if (f.push({
        line: k,
        points: x
      }), A === 2) {
        x[0] = w[0] * p, x[1] = w[1] * m, k.set([NaN, NaN, NaN, NaN, x[0], x[1]], 0);
        continue;
      }
      let [I, T, E, M] = w;
      I *= p, T *= m, E *= p, M *= m, x.set([I, T, E, M], 0), k.set([NaN, NaN, NaN, NaN, I, T], 0);
      for (let F = 4; F < A; F += 2) {
        const L = x[F] = w[F] * p, Y = x[F + 1] = w[F + 1] * m;
        k.set(_t.createBezierPoints(I, T, E, M, L, Y), (F - 2) * 3), [I, T, E, M] = [E, M, L, Y];
      }
    }
    if (f.length === 0)
      return null;
    const y = o ? new u3() : new A2();
    return y.build(f, e, i, 1, n, o ? 0 : u, a), {
      outline: y,
      newCurves: b,
      areContours: o,
      thickness: u,
      width: c,
      height: h
    };
  }
  static async compressSignature({
    outlines: t,
    areContours: e,
    thickness: i,
    width: n,
    height: a
  }) {
    let r = 1 / 0, o = -1 / 0, l = 0;
    for (const w of t) {
      l += w.length;
      for (let A = 2, x = w.length; A < x; A++) {
        const k = w[A] - w[A - 2];
        r = Math.min(r, k), o = Math.max(o, k);
      }
    }
    let c;
    r >= -128 && o <= 127 ? c = Int8Array : r >= -32768 && o <= 32767 ? c = Int16Array : c = Int32Array;
    const h = t.length, u = q2 + V1 * h, f = new Uint32Array(u);
    let d = 0;
    f[d++] = u * Uint32Array.BYTES_PER_ELEMENT + (l - 2 * h) * c.BYTES_PER_ELEMENT, f[d++] = 0, f[d++] = n, f[d++] = a, f[d++] = e ? 0 : 1, f[d++] = Math.max(0, Math.floor(i ?? 0)), f[d++] = h, f[d++] = c.BYTES_PER_ELEMENT;
    for (const w of t)
      f[d++] = w.length - 2, f[d++] = w[0], f[d++] = w[1];
    const p = new CompressionStream("deflate-raw"), m = p.writable.getWriter();
    await m.ready, m.write(f);
    const b = c.prototype.constructor;
    for (const w of t) {
      const A = new b(w.length - 2);
      for (let x = 2, k = w.length; x < k; x++)
        A[x - 2] = w[x] - w[x - 2];
      m.write(A);
    }
    m.close();
    const y = await new Response(p.readable).arrayBuffer(), v = new Uint8Array(y);
    return my(v);
  }
  static async decompressSignature(t) {
    try {
      const e = jk(t), {
        readable: i,
        writable: n
      } = new DecompressionStream("deflate-raw"), a = n.getWriter();
      await a.ready, a.write(e).then(async () => {
        await a.ready, await a.close();
      }).catch(() => {
      });
      let r = null, o = 0;
      for await (const w of i)
        r || (r = new Uint8Array(new Uint32Array(w.buffer, 0, 4)[0])), r.set(w, o), o += w.length;
      const l = new Uint32Array(r.buffer, 0, r.length >> 2), c = l[1];
      if (c !== 0)
        throw new Error(`Invalid version: ${c}`);
      const h = l[2], u = l[3], f = l[4] === 0, d = l[5], p = l[6], m = l[7], b = [], y = (q2 + V1 * p) * Uint32Array.BYTES_PER_ELEMENT;
      let v;
      switch (m) {
        case Int8Array.BYTES_PER_ELEMENT:
          v = new Int8Array(r.buffer, y);
          break;
        case Int16Array.BYTES_PER_ELEMENT:
          v = new Int16Array(r.buffer, y);
          break;
        case Int32Array.BYTES_PER_ELEMENT:
          v = new Int32Array(r.buffer, y);
          break;
      }
      o = 0;
      for (let w = 0; w < p; w++) {
        const A = l[V1 * w + q2], x = new Float32Array(A + 2);
        b.push(x);
        for (let k = 0; k < V1 - 1; k++)
          x[k] = l[V1 * w + q2 + k + 1];
        for (let k = 0; k < A; k++)
          x[k + 2] = x[k] + v[o++];
      }
      return {
        areContours: f,
        thickness: d,
        outlines: b,
        width: h,
        height: u
      };
    } catch (e) {
      return zt(`decompressSignature: ${e}`), null;
    }
  }
}
zc = new WeakMap(), be = new WeakSet(), d3 = function(t, e, i, n) {
  return i -= t, n -= e, i === 0 ? n > 0 ? 0 : 4 : i === 1 ? n + 6 : 2 - n;
}, Wn = new WeakMap(), pv = function(t, e, i, n, a, r, o) {
  const l = C(this, be, d3).call(this, i, n, a, r);
  for (let c = 0; c < 8; c++) {
    const h = (-c + l - o + 16) % 8, u = g(this, Wn)[2 * h], f = g(this, Wn)[2 * h + 1];
    if (t[(i + u) * e + (n + f)] !== 0)
      return h;
  }
  return -1;
}, mv = function(t, e, i, n, a, r, o) {
  const l = C(this, be, d3).call(this, i, n, a, r);
  for (let c = 0; c < 8; c++) {
    const h = (c + l + o + 16) % 8, u = g(this, Wn)[2 * h], f = g(this, Wn)[2 * h + 1];
    if (t[(i + u) * e + (n + f)] !== 0)
      return h;
  }
  return -1;
}, f3 = function(t, e, i, n) {
  const a = t.length, r = new Int32Array(a);
  for (let h = 0; h < a; h++)
    r[h] = t[h] <= n ? 1 : 0;
  for (let h = 1; h < i - 1; h++)
    r[h * e] = r[h * e + e - 1] = 0;
  for (let h = 0; h < e; h++)
    r[h] = r[e * i - 1 - h] = 0;
  let o = 1, l;
  const c = [];
  for (let h = 1; h < i - 1; h++) {
    l = 1;
    for (let u = 1; u < e - 1; u++) {
      const f = h * e + u, d = r[f];
      if (d === 0)
        continue;
      let p = h, m = u;
      if (d === 1 && r[f - 1] === 0)
        o += 1, m -= 1;
      else if (d >= 1 && r[f + 1] === 0)
        o += 1, m += 1, d > 1 && (l = d);
      else {
        d !== 1 && (l = Math.abs(d));
        continue;
      }
      const b = [u, h], y = m === u + 1, v = {
        isHole: y,
        points: b,
        id: o,
        parent: 0
      };
      c.push(v);
      let w;
      for (const F of c)
        if (F.id === l) {
          w = F;
          break;
        }
      w ? w.isHole ? v.parent = y ? w.parent : l : v.parent = y ? l : w.parent : v.parent = y ? l : 0;
      const A = C(this, be, pv).call(this, r, e, h, u, p, m, 0);
      if (A === -1) {
        r[f] = -o, r[f] !== 1 && (l = Math.abs(r[f]));
        continue;
      }
      let x = g(this, Wn)[2 * A], k = g(this, Wn)[2 * A + 1];
      const I = h + x, T = u + k;
      p = I, m = T;
      let E = h, M = u;
      for (; ; ) {
        const F = C(this, be, mv).call(this, r, e, E, M, p, m, 1);
        x = g(this, Wn)[2 * F], k = g(this, Wn)[2 * F + 1];
        const L = E + x, Y = M + k;
        b.push(Y, L);
        const B = E * e + M;
        if (r[B + 1] === 0 ? r[B] = -o : r[B] === 1 && (r[B] = o), L === h && Y === u && E === I && M === T) {
          r[f] !== 1 && (l = Math.abs(r[f]));
          break;
        } else
          p = E, m = M, E = L, M = Y;
      }
    }
  }
  return c;
}, Pg = function(t, e, i, n) {
  if (i - e <= 4) {
    for (let I = e; I < i - 2; I += 2)
      n.push(t[I], t[I + 1]);
    return;
  }
  const a = t[e], r = t[e + 1], o = t[i - 4] - a, l = t[i - 3] - r, c = Math.hypot(o, l), h = o / c, u = l / c, f = h * r - u * a, d = l / o, p = 1 / c, m = Math.atan(d), b = Math.cos(m), y = Math.sin(m), v = p * (Math.abs(b) + Math.abs(y)), w = p * (1 - v + v ** 2), A = Math.max(Math.atan(Math.abs(y + b) * w), Math.atan(Math.abs(y - b) * w));
  let x = 0, k = e;
  for (let I = e + 2; I < i - 2; I += 2) {
    const T = Math.abs(f - h * t[I + 1] + u * t[I]);
    T > x && (k = I, x = T);
  }
  x > (c * A) ** 2 ? (C(this, be, Pg).call(this, t, e, k + 2, n), C(this, be, Pg).call(this, t, k, i, n)) : n.push(a, r);
}, bv = function(t) {
  const e = [], i = t.length;
  return C(this, be, Pg).call(this, t, 0, i, e), e.push(t[i - 2], t[i - 1]), e.length <= 4 ? null : e;
}, yv = function(t, e, i, n, a, r) {
  const o = new Float32Array(r ** 2), l = -2 * n ** 2, c = r >> 1;
  for (let m = 0; m < r; m++) {
    const b = (m - c) ** 2;
    for (let y = 0; y < r; y++)
      o[m * r + y] = Math.exp((b + (y - c) ** 2) / l);
  }
  const h = new Float32Array(256), u = -2 * a ** 2;
  for (let m = 0; m < 256; m++)
    h[m] = Math.exp(m ** 2 / u);
  const f = t.length, d = new Uint8Array(f), p = new Uint32Array(256);
  for (let m = 0; m < i; m++)
    for (let b = 0; b < e; b++) {
      const y = m * e + b, v = t[y];
      let w = 0, A = 0;
      for (let k = 0; k < r; k++) {
        const I = m + k - c;
        if (!(I < 0 || I >= i))
          for (let T = 0; T < r; T++) {
            const E = b + T - c;
            if (E < 0 || E >= e)
              continue;
            const M = t[I * e + E], F = o[k * r + T] * h[Math.abs(M - v)];
            w += M * F, A += F;
          }
      }
      const x = d[y] = Math.round(w / A);
      p[x]++;
    }
  return [d, p];
}, wv = function(t) {
  const e = new Uint32Array(256);
  for (const i of t)
    e[i]++;
  return e;
}, g3 = function(t) {
  const e = t.length, i = new Uint8ClampedArray(e >> 2);
  let n = -1 / 0, a = 1 / 0;
  for (let o = 0, l = i.length; o < l; o++) {
    if (t[(o << 2) + 3] === 0) {
      n = i[o] = 255;
      continue;
    }
    const h = i[o] = t[o << 2];
    h > n && (n = h), h < a && (a = h);
  }
  const r = 255 / (n - a);
  for (let o = 0; o < e; o++)
    i[o] = (i[o] - a) * r;
  return i;
}, p3 = function(t) {
  let e, i = -1 / 0, n = -1 / 0;
  const a = t.findIndex((l) => l !== 0);
  let r = a, o = a;
  for (e = a; e < 256; e++) {
    const l = t[e];
    l > i && (e - r > n && (n = e - r, o = e - 1), i = l, r = e);
  }
  for (e = o - 1; e >= 0 && !(t[e] > t[e + 1]); e--)
    ;
  return e;
}, vv = function(t) {
  const e = t, {
    width: i,
    height: n
  } = t, {
    maxDim: a
  } = g(this, zc);
  let r = i, o = n;
  if (i > a || n > a) {
    let f = i, d = n, p = Math.log2(Math.max(i, n) / a);
    const m = Math.floor(p);
    p = p === m ? m - 1 : m;
    for (let y = 0; y < p; y++) {
      r = Math.ceil(f / 2), o = Math.ceil(d / 2);
      const v = new OffscreenCanvas(r, o);
      v.getContext("2d").drawImage(t, 0, 0, f, d, 0, 0, r, o), f = r, d = o, t !== e && t.close(), t = v.transferToImageBitmap();
    }
    const b = Math.min(a / r, a / o);
    r = Math.round(r * b), o = Math.round(o * b);
  }
  const c = new OffscreenCanvas(r, o).getContext("2d", {
    willReadFrequently: !0
  });
  c.filter = "grayscale(1)", c.drawImage(t, 0, 0, t.width, t.height, 0, 0, r, o);
  const h = c.getImageData(0, 0, r, o).data;
  return [C(this, be, g3).call(this, h), r, o];
}, _(Oa, be), _(Oa, zc, {
  maxDim: 512,
  sigmaSFactor: 0.02,
  sigmaR: 25,
  kernelSize: 16
}), _(Oa, Wn, new Int32Array([0, 1, -1, 1, -1, 0, -1, -1, 0, -1, 1, -1, 1, 0, 1, 1]));
class a7 extends cv {
  constructor() {
    super(), super.updateProperties({
      fill: Ie._defaultLineColor,
      "stroke-width": 0
    });
  }
  clone() {
    const t = new a7();
    return t.updateAll(this), t;
  }
}
class r7 extends G9 {
  constructor(t) {
    super(t), super.updateProperties({
      stroke: Ie._defaultLineColor,
      "stroke-width": 1
    });
  }
  clone() {
    const t = new r7(this._viewParameters);
    return t.updateAll(this), t;
  }
}
var jo, Gi, Ho, $o;
const Pi = class Pi extends gp {
  constructor(e) {
    super({
      ...e,
      mustBeCommitted: !0,
      name: "signatureEditor"
    });
    _(this, jo, !1);
    _(this, Gi, null);
    _(this, Ho, null);
    _(this, $o, null);
    this._willKeepAspectRatio = !0, S(this, Ho, e.signatureData || null), S(this, Gi, null), this.defaultL10nId = "pdfjs-editor-signature-editor1";
  }
  static initialize(e, i) {
    Ie.initialize(e, i), this._defaultDrawingOptions = new a7(), this._defaultDrawnSignatureOptions = new r7(i.viewParameters);
  }
  static getDefaultDrawingOptions(e) {
    const i = this._defaultDrawingOptions.clone();
    return i.updateProperties(e), i;
  }
  static get supportMultipleDrawings() {
    return !1;
  }
  static get typesMap() {
    return ne(this, "typesMap", /* @__PURE__ */ new Map());
  }
  static get isDrawer() {
    return !1;
  }
  get telemetryFinalData() {
    return {
      type: "signature",
      hasDescription: !!g(this, Gi)
    };
  }
  static computeTelemetryFinalData(e) {
    const i = e.get("hasDescription");
    return {
      hasAltText: i.get(!0) ?? 0,
      hasNoAltText: i.get(!1) ?? 0
    };
  }
  get isResizable() {
    return !0;
  }
  onScaleChanging() {
    this._drawId !== null && super.onScaleChanging();
  }
  render() {
    if (this.div)
      return this.div;
    let e, i;
    const {
      _isCopy: n
    } = this;
    if (n && (this._isCopy = !1, e = this.x, i = this.y), super.render(), this._drawId === null)
      if (g(this, Ho)) {
        const {
          lines: a,
          mustSmooth: r,
          areContours: o,
          description: l,
          uuid: c,
          heightInPage: h
        } = g(this, Ho), {
          rawDims: {
            pageWidth: u,
            pageHeight: f
          },
          rotation: d
        } = this.parent.viewport, p = Oa.processDrawnLines({
          lines: a,
          pageWidth: u,
          pageHeight: f,
          rotation: d,
          innerMargin: Pi._INNER_MARGIN,
          mustSmooth: r,
          areContours: o
        });
        this.addSignature(p, h, l, c);
      } else
        this.div.setAttribute("data-l10n-args", JSON.stringify({
          description: ""
        })), this.div.hidden = !0, this._uiManager.getSignature(this);
    return n && (this._isCopy = !0, this._moveAfterPaste(e, i)), this.div;
  }
  setUuid(e) {
    S(this, $o, e), this.addEditToolbar();
  }
  getUuid() {
    return g(this, $o);
  }
  get description() {
    return g(this, Gi);
  }
  set description(e) {
    S(this, Gi, e), super.addEditToolbar().then((i) => {
      i == null || i.updateEditSignatureButton(e);
    });
  }
  getSignaturePreview() {
    const {
      newCurves: e,
      areContours: i,
      thickness: n,
      width: a,
      height: r
    } = g(this, Ho), o = Math.max(a, r), l = Oa.processDrawnLines({
      lines: {
        curves: e.map((c) => ({
          points: c
        })),
        thickness: n,
        width: a,
        height: r
      },
      pageWidth: o,
      pageHeight: o,
      rotation: 0,
      innerMargin: 0,
      mustSmooth: !1,
      areContours: i
    });
    return {
      areContours: i,
      outline: l.outline
    };
  }
  async addEditToolbar() {
    const e = await super.addEditToolbar();
    return e ? (this._uiManager.signatureManager && g(this, Gi) !== null && (await e.addEditSignatureButton(this._uiManager.signatureManager, g(this, $o), g(this, Gi)), e.show()), e) : null;
  }
  addSignature(e, i, n, a) {
    const {
      x: r,
      y: o
    } = this, {
      outline: l
    } = S(this, Ho, e);
    S(this, jo, l instanceof u3), S(this, Gi, n), this.div.setAttribute("data-l10n-args", JSON.stringify({
      description: n
    }));
    let c;
    g(this, jo) ? c = Pi.getDefaultDrawingOptions() : (c = Pi._defaultDrawnSignatureOptions.clone(), c.updateProperties({
      "stroke-width": l.thickness
    })), this._addOutlines({
      drawOutlines: l,
      drawingOptions: c
    });
    const [h, u] = this.parentDimensions, [, f] = this.pageDimensions;
    let d = i / f;
    d = d >= 1 ? 0.5 : d, this.width *= d / this.height, this.width >= 1 && (d *= 0.9 / this.width, this.width = 0.9), this.height = d, this.setDims(h * this.width, u * this.height), this.x = r, this.y = o, this.center(), this._onResized(), this.onScaleChanging(), this.rotate(), this._uiManager.addToAnnotationStorage(this), this.setUuid(a), this._reportTelemetry({
      action: "pdfjs.signature.inserted",
      data: {
        hasBeenSaved: !!a,
        hasDescription: !!n
      }
    }), this.div.hidden = !1;
  }
  getFromImage(e) {
    const {
      rawDims: {
        pageWidth: i,
        pageHeight: n
      },
      rotation: a
    } = this.parent.viewport;
    return Oa.process(e, i, n, a, Pi._INNER_MARGIN);
  }
  getFromText(e, i) {
    const {
      rawDims: {
        pageWidth: n,
        pageHeight: a
      },
      rotation: r
    } = this.parent.viewport;
    return Oa.extractContoursFromText(e, i, n, a, r, Pi._INNER_MARGIN);
  }
  getDrawnSignature(e) {
    const {
      rawDims: {
        pageWidth: i,
        pageHeight: n
      },
      rotation: a
    } = this.parent.viewport;
    return Oa.processDrawnLines({
      lines: e,
      pageWidth: i,
      pageHeight: n,
      rotation: a,
      innerMargin: Pi._INNER_MARGIN,
      mustSmooth: !1,
      areContours: !1
    });
  }
  createDrawingOptions({
    areContours: e,
    thickness: i
  }) {
    e ? this._drawingOptions = Pi.getDefaultDrawingOptions() : (this._drawingOptions = Pi._defaultDrawnSignatureOptions.clone(), this._drawingOptions.updateProperties({
      "stroke-width": i
    }));
  }
  serialize(e = !1) {
    if (this.isEmpty())
      return null;
    const {
      lines: i,
      points: n,
      rect: a
    } = this.serializeDraw(e), {
      _drawingOptions: {
        "stroke-width": r
      }
    } = this, o = {
      annotationType: Ht.SIGNATURE,
      isSignature: !0,
      areContours: g(this, jo),
      color: [0, 0, 0],
      thickness: g(this, jo) ? 0 : r,
      pageIndex: this.pageIndex,
      rect: a,
      rotation: this.rotation,
      structTreeParentId: this._structTreeParentId
    };
    return e ? (o.paths = {
      lines: i,
      points: n
    }, o.uuid = g(this, $o), o.isCopy = !0) : o.lines = i, g(this, Gi) && (o.accessibilityData = {
      type: "Figure",
      alt: g(this, Gi)
    }), o;
  }
  static deserializeDraw(e, i, n, a, r, o) {
    return o.areContours ? u3.deserialize(e, i, n, a, r, o) : A2.deserialize(e, i, n, a, r, o);
  }
  static async deserialize(e, i, n) {
    var r;
    const a = await super.deserialize(e, i, n);
    return S(a, jo, e.areContours), S(a, Gi, ((r = e.accessibilityData) == null ? void 0 : r.alt) || ""), S(a, $o, e.uuid), a;
  }
};
jo = new WeakMap(), Gi = new WeakMap(), Ho = new WeakMap(), $o = new WeakMap(), ht(Pi, "_type", "signature"), ht(Pi, "_editorType", Ht.SIGNATURE), ht(Pi, "_defaultDrawingOptions", null);
let m3 = Pi;
var Re, ws, zo, Tr, Go, u1, Er, Gc, Fa, Vi, d1, de, Cd, Id, Dg, Ng, Bg, y3, Lg, Av;
class b3 extends Ie {
  constructor(e) {
    super({
      ...e,
      name: "stampEditor"
    });
    _(this, de);
    _(this, Re, null);
    _(this, ws, null);
    _(this, zo, null);
    _(this, Tr, null);
    _(this, Go, null);
    _(this, u1, "");
    _(this, Er, null);
    _(this, Gc, !1);
    _(this, Fa, null);
    _(this, Vi, !1);
    _(this, d1, !1);
    S(this, Tr, e.bitmapUrl), S(this, Go, e.bitmapFile), this.defaultL10nId = "pdfjs-editor-stamp-editor";
  }
  static initialize(e, i) {
    Ie.initialize(e, i);
  }
  static isHandlingMimeForPasting(e) {
    return cp.includes(e);
  }
  static paste(e, i) {
    i.pasteEditor({
      mode: Ht.STAMP
    }, {
      bitmapFile: e.getAsFile()
    });
  }
  altTextFinish() {
    this._uiManager.useNewAltTextFlow && (this.div.hidden = !1), super.altTextFinish();
  }
  get telemetryFinalData() {
    var e;
    return {
      type: "stamp",
      hasAltText: !!((e = this.altTextData) != null && e.altText)
    };
  }
  static computeTelemetryFinalData(e) {
    const i = e.get("hasAltText");
    return {
      hasAltText: i.get(!0) ?? 0,
      hasNoAltText: i.get(!1) ?? 0
    };
  }
  async mlGuessAltText(e = null, i = !0) {
    if (this.hasAltTextData())
      return null;
    const {
      mlManager: n
    } = this._uiManager;
    if (!n)
      throw new Error("No ML.");
    if (!await n.isEnabledFor("altText"))
      throw new Error("ML isn't enabled for alt text.");
    const {
      data: a,
      width: r,
      height: o
    } = e || this.copyCanvas(null, null, !0).imageData, l = await n.guess({
      name: "altText",
      request: {
        data: a,
        width: r,
        height: o,
        channels: a.length / (r * o)
      }
    });
    if (!l)
      throw new Error("No response from the AI service.");
    if (l.error)
      throw new Error("Error from the AI service.");
    if (l.cancel)
      return null;
    if (!l.output)
      throw new Error("No valid response from the AI service.");
    const c = l.output;
    return await this.setGuessedAltText(c), i && !this.hasAltTextData() && (this.altTextData = {
      alt: c,
      decorative: !1
    }), c;
  }
  remove() {
    var e;
    g(this, ws) && (S(this, Re, null), this._uiManager.imageManager.deleteId(g(this, ws)), (e = g(this, Er)) == null || e.remove(), S(this, Er, null), g(this, Fa) && (clearTimeout(g(this, Fa)), S(this, Fa, null))), super.remove();
  }
  rebuild() {
    if (!this.parent) {
      g(this, ws) && C(this, de, Dg).call(this);
      return;
    }
    super.rebuild(), this.div !== null && (g(this, ws) && g(this, Er) === null && C(this, de, Dg).call(this), this.isAttachedToDOM || this.parent.add(this));
  }
  onceAdded(e) {
    this._isDraggable = !0, e && this.div.focus();
  }
  isEmpty() {
    return !(g(this, zo) || g(this, Re) || g(this, Tr) || g(this, Go) || g(this, ws) || g(this, Gc));
  }
  get isResizable() {
    return !0;
  }
  render() {
    if (this.div)
      return this.div;
    let e, i;
    return this._isCopy && (e = this.x, i = this.y), super.render(), this.div.hidden = !0, this.addAltTextButton(), g(this, Gc) || (g(this, Re) ? C(this, de, Ng).call(this) : C(this, de, Dg).call(this)), this._isCopy && this._moveAfterPaste(e, i), this._uiManager.addShouldRescale(this), this.div;
  }
  setCanvas(e, i) {
    const {
      id: n,
      bitmap: a
    } = this._uiManager.imageManager.getFromCanvas(e, i);
    i.remove(), n && this._uiManager.imageManager.isValidId(n) && (S(this, ws, n), a && S(this, Re, a), S(this, Gc, !1), C(this, de, Ng).call(this));
  }
  _onResized() {
    this.onScaleChanging();
  }
  onScaleChanging() {
    if (!this.parent)
      return;
    g(this, Fa) !== null && clearTimeout(g(this, Fa)), S(this, Fa, setTimeout(() => {
      S(this, Fa, null), C(this, de, y3).call(this);
    }, 200));
  }
  copyCanvas(e, i, n = !1) {
    var d;
    e || (e = 224);
    const {
      width: a,
      height: r
    } = g(this, Re), o = new na();
    let l = g(this, Re), c = a, h = r, u = null;
    if (i) {
      if (a > i || r > i) {
        const T = Math.min(i / a, i / r);
        c = Math.floor(a * T), h = Math.floor(r * T);
      }
      u = document.createElement("canvas");
      const p = u.width = Math.ceil(c * o.sx), m = u.height = Math.ceil(h * o.sy);
      g(this, Vi) || (l = C(this, de, Bg).call(this, p, m));
      const b = u.getContext("2d");
      b.filter = this._uiManager.hcmFilter;
      let y = "white", v = "#cfcfd8";
      this._uiManager.hcmFilter !== "none" ? v = "black" : (d = window.matchMedia) != null && d.call(window, "(prefers-color-scheme: dark)").matches && (y = "#8f8f9d", v = "#42414d");
      const w = 15, A = w * o.sx, x = w * o.sy, k = new OffscreenCanvas(A * 2, x * 2), I = k.getContext("2d");
      I.fillStyle = y, I.fillRect(0, 0, A * 2, x * 2), I.fillStyle = v, I.fillRect(0, 0, A, x), I.fillRect(A, x, A, x), b.fillStyle = b.createPattern(k, "repeat"), b.fillRect(0, 0, p, m), b.drawImage(l, 0, 0, l.width, l.height, 0, 0, p, m);
    }
    let f = null;
    if (n) {
      let p, m;
      if (o.symmetric && l.width < e && l.height < e)
        p = l.width, m = l.height;
      else if (l = g(this, Re), a > e || r > e) {
        const v = Math.min(e / a, e / r);
        p = Math.floor(a * v), m = Math.floor(r * v), g(this, Vi) || (l = C(this, de, Bg).call(this, p, m));
      }
      const y = new OffscreenCanvas(p, m).getContext("2d", {
        willReadFrequently: !0
      });
      y.drawImage(l, 0, 0, l.width, l.height, 0, 0, p, m), f = {
        width: p,
        height: m,
        data: y.getImageData(0, 0, p, m).data
      };
    }
    return {
      canvas: u,
      width: c,
      height: h,
      imageData: f
    };
  }
  static async deserialize(e, i, n) {
    var b;
    let a = null, r = !1;
    if (e instanceof Bw) {
      const {
        data: {
          rect: y,
          rotation: v,
          id: w,
          structParent: A,
          popupRef: x
        },
        container: k,
        parent: {
          page: {
            pageNumber: I
          }
        },
        canvas: T
      } = e;
      let E, M;
      T ? (delete e.canvas, {
        id: E,
        bitmap: M
      } = n.imageManager.getFromCanvas(k.id, T), T.remove()) : (r = !0, e._hasNoCanvas = !0);
      const F = ((b = await i._structTree.getAriaAttributes(`${J6}${w}`)) == null ? void 0 : b.get("aria-label")) || "";
      a = e = {
        annotationType: Ht.STAMP,
        bitmapId: E,
        bitmap: M,
        pageIndex: I - 1,
        rect: y.slice(0),
        rotation: v,
        id: w,
        deleted: !1,
        accessibilityData: {
          decorative: !1,
          altText: F
        },
        isSvg: !1,
        structParent: A,
        popupRef: x
      };
    }
    const o = await super.deserialize(e, i, n), {
      rect: l,
      bitmap: c,
      bitmapUrl: h,
      bitmapId: u,
      isSvg: f,
      accessibilityData: d
    } = e;
    r ? (n.addMissingCanvas(e.id, o), S(o, Gc, !0)) : u && n.imageManager.isValidId(u) ? (S(o, ws, u), c && S(o, Re, c)) : S(o, Tr, h), S(o, Vi, f);
    const [p, m] = o.pageDimensions;
    return o.width = (l[2] - l[0]) / p, o.height = (l[3] - l[1]) / m, o.annotationElementId = e.id || null, d && (o.altTextData = d), o._initialData = a, S(o, d1, !!a), o;
  }
  serialize(e = !1, i = null) {
    if (this.isEmpty())
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const n = {
      annotationType: Ht.STAMP,
      bitmapId: g(this, ws),
      pageIndex: this.pageIndex,
      rect: this.getRect(0, 0),
      rotation: this.rotation,
      isSvg: g(this, Vi),
      structTreeParentId: this._structTreeParentId
    };
    if (e)
      return n.bitmapUrl = C(this, de, Lg).call(this, !0), n.accessibilityData = this.serializeAltText(!0), n.isCopy = !0, n;
    const {
      decorative: a,
      altText: r
    } = this.serializeAltText(!1);
    if (!a && r && (n.accessibilityData = {
      type: "Figure",
      alt: r
    }), this.annotationElementId) {
      const l = C(this, de, Av).call(this, n);
      if (l.isSame)
        return null;
      l.isSameAltText ? delete n.accessibilityData : n.accessibilityData.structParent = this._initialData.structParent ?? -1;
    }
    if (n.id = this.annotationElementId, i === null)
      return n;
    i.stamps || (i.stamps = /* @__PURE__ */ new Map());
    const o = g(this, Vi) ? (n.rect[2] - n.rect[0]) * (n.rect[3] - n.rect[1]) : null;
    if (!i.stamps.has(g(this, ws)))
      i.stamps.set(g(this, ws), {
        area: o,
        serialized: n
      }), n.bitmap = C(this, de, Lg).call(this, !1);
    else if (g(this, Vi)) {
      const l = i.stamps.get(g(this, ws));
      o > l.area && (l.area = o, l.serialized.bitmap.close(), l.serialized.bitmap = C(this, de, Lg).call(this, !1));
    }
    return n;
  }
  renderAnnotationElement(e) {
    return e.updateEdited({
      rect: this.getRect(0, 0)
    }), null;
  }
}
Re = new WeakMap(), ws = new WeakMap(), zo = new WeakMap(), Tr = new WeakMap(), Go = new WeakMap(), u1 = new WeakMap(), Er = new WeakMap(), Gc = new WeakMap(), Fa = new WeakMap(), Vi = new WeakMap(), d1 = new WeakMap(), de = new WeakSet(), Cd = function(e, i = !1) {
  if (!e) {
    this.remove();
    return;
  }
  S(this, Re, e.bitmap), i || (S(this, ws, e.id), S(this, Vi, e.isSvg)), e.file && S(this, u1, e.file.name), C(this, de, Ng).call(this);
}, Id = function() {
  if (S(this, zo, null), this._uiManager.enableWaiting(!1), !!g(this, Er)) {
    if (this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && g(this, Re)) {
      this._editToolbar.hide(), this._uiManager.editAltText(this, !0);
      return;
    }
    if (!this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && g(this, Re)) {
      this._reportTelemetry({
        action: "pdfjs.image.image_added",
        data: {
          alt_text_modal: !1,
          alt_text_type: "empty"
        }
      });
      try {
        this.mlGuessAltText();
      } catch {
      }
    }
    this.div.focus();
  }
}, Dg = function() {
  if (g(this, ws)) {
    this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(g(this, ws)).then((n) => C(this, de, Cd).call(this, n, !0)).finally(() => C(this, de, Id).call(this));
    return;
  }
  if (g(this, Tr)) {
    const n = g(this, Tr);
    S(this, Tr, null), this._uiManager.enableWaiting(!0), S(this, zo, this._uiManager.imageManager.getFromUrl(n).then((a) => C(this, de, Cd).call(this, a)).finally(() => C(this, de, Id).call(this)));
    return;
  }
  if (g(this, Go)) {
    const n = g(this, Go);
    S(this, Go, null), this._uiManager.enableWaiting(!0), S(this, zo, this._uiManager.imageManager.getFromFile(n).then((a) => C(this, de, Cd).call(this, a)).finally(() => C(this, de, Id).call(this)));
    return;
  }
  const e = document.createElement("input");
  e.type = "file", e.accept = cp.join(",");
  const i = this._uiManager._signal;
  S(this, zo, new Promise((n) => {
    e.addEventListener("change", async () => {
      if (!e.files || e.files.length === 0)
        this.remove();
      else {
        this._uiManager.enableWaiting(!0);
        const a = await this._uiManager.imageManager.getFromFile(e.files[0]);
        this._reportTelemetry({
          action: "pdfjs.image.image_selected",
          data: {
            alt_text_modal: this._uiManager.useNewAltTextFlow
          }
        }), C(this, de, Cd).call(this, a);
      }
      n();
    }, {
      signal: i
    }), e.addEventListener("cancel", () => {
      this.remove(), n();
    }, {
      signal: i
    });
  }).finally(() => C(this, de, Id).call(this))), e.click();
}, Ng = function() {
  var u;
  const {
    div: e
  } = this;
  let {
    width: i,
    height: n
  } = g(this, Re);
  const [a, r] = this.pageDimensions, o = 0.75;
  if (this.width)
    i = this.width * a, n = this.height * r;
  else if (i > o * a || n > o * r) {
    const f = Math.min(o * a / i, o * r / n);
    i *= f, n *= f;
  }
  const [l, c] = this.parentDimensions;
  this.setDims(i * l / a, n * c / r), this._uiManager.enableWaiting(!1);
  const h = S(this, Er, document.createElement("canvas"));
  h.setAttribute("role", "img"), this.addContainer(h), this.width = i / a, this.height = n / r, (u = this._initialOptions) != null && u.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, (!this._uiManager.useNewAltTextWhenAddingImage || !this._uiManager.useNewAltTextFlow || this.annotationElementId) && (e.hidden = !1), C(this, de, y3).call(this), g(this, d1) || (this.parent.addUndoableEditor(this), S(this, d1, !0)), this._reportTelemetry({
    action: "inserted_image"
  }), g(this, u1) && this.div.setAttribute("aria-description", g(this, u1));
}, Bg = function(e, i) {
  const {
    width: n,
    height: a
  } = g(this, Re);
  let r = n, o = a, l = g(this, Re);
  for (; r > 2 * e || o > 2 * i; ) {
    const c = r, h = o;
    r > 2 * e && (r = r >= 16384 ? Math.floor(r / 2) - 1 : Math.ceil(r / 2)), o > 2 * i && (o = o >= 16384 ? Math.floor(o / 2) - 1 : Math.ceil(o / 2));
    const u = new OffscreenCanvas(r, o);
    u.getContext("2d").drawImage(l, 0, 0, c, h, 0, 0, r, o), l = u.transferToImageBitmap();
  }
  return l;
}, y3 = function() {
  const [e, i] = this.parentDimensions, {
    width: n,
    height: a
  } = this, r = new na(), o = Math.ceil(n * e * r.sx), l = Math.ceil(a * i * r.sy), c = g(this, Er);
  if (!c || c.width === o && c.height === l)
    return;
  c.width = o, c.height = l;
  const h = g(this, Vi) ? g(this, Re) : C(this, de, Bg).call(this, o, l), u = c.getContext("2d");
  u.filter = this._uiManager.hcmFilter, u.drawImage(h, 0, 0, h.width, h.height, 0, 0, o, l);
}, Lg = function(e) {
  if (e) {
    if (g(this, Vi)) {
      const a = this._uiManager.imageManager.getSvgUrl(g(this, ws));
      if (a)
        return a;
    }
    const i = document.createElement("canvas");
    return {
      width: i.width,
      height: i.height
    } = g(this, Re), i.getContext("2d").drawImage(g(this, Re), 0, 0), i.toDataURL();
  }
  if (g(this, Vi)) {
    const [i, n] = this.pageDimensions, a = Math.round(this.width * i * Vr.PDF_TO_CSS_UNITS), r = Math.round(this.height * n * Vr.PDF_TO_CSS_UNITS), o = new OffscreenCanvas(a, r);
    return o.getContext("2d").drawImage(g(this, Re), 0, 0, g(this, Re).width, g(this, Re).height, 0, 0, a, r), o.transferToImageBitmap();
  }
  return structuredClone(g(this, Re));
}, Av = function(e) {
  var o;
  const {
    pageIndex: i,
    accessibilityData: {
      altText: n
    }
  } = this._initialData, a = e.pageIndex === i, r = (((o = e.accessibilityData) == null ? void 0 : o.alt) || "") === n;
  return {
    isSame: !this._hasBeenMoved && !this._hasBeenResized && a && r,
    isSameAltText: r
  };
}, ht(b3, "_type", "stamp"), ht(b3, "_editorType", Ht.STAMP);
var Vc, f1, Ra, Vo, Mr, gn, Wo, g1, Wc, Xn, Fr, Vs, Rr, Ft, Xo, De, xv, ga, w3, v3, Og;
const Dn = class Dn {
  constructor({
    uiManager: t,
    pageIndex: e,
    div: i,
    structTreeLayer: n,
    accessibilityManager: a,
    annotationLayer: r,
    drawLayer: o,
    textLayer: l,
    viewport: c,
    l10n: h
  }) {
    _(this, De);
    _(this, Vc);
    _(this, f1, !1);
    _(this, Ra, null);
    _(this, Vo, null);
    _(this, Mr, null);
    _(this, gn, /* @__PURE__ */ new Map());
    _(this, Wo, !1);
    _(this, g1, !1);
    _(this, Wc, !1);
    _(this, Xn, null);
    _(this, Fr, null);
    _(this, Vs, null);
    _(this, Rr, null);
    _(this, Ft);
    const u = [...g(Dn, Xo).values()];
    if (!Dn._initialized) {
      Dn._initialized = !0;
      for (const f of u)
        f.initialize(h, t);
    }
    t.registerEditorTypes(u), S(this, Ft, t), this.pageIndex = e, this.div = i, S(this, Vc, a), S(this, Ra, r), this.viewport = c, S(this, Vs, l), this.drawLayer = o, this._structTree = n, g(this, Ft).addLayer(this);
  }
  get isEmpty() {
    return g(this, gn).size === 0;
  }
  get isInvisible() {
    return this.isEmpty && g(this, Ft).getMode() === Ht.NONE;
  }
  updateToolbar(t) {
    g(this, Ft).updateToolbar(t);
  }
  updateMode(t = g(this, Ft).getMode()) {
    switch (C(this, De, Og).call(this), t) {
      case Ht.NONE:
        this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
        return;
      case Ht.INK:
        this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
        break;
      case Ht.HIGHLIGHT:
        this.enableTextSelection(), this.togglePointerEvents(!1), this.disableClick();
        break;
      default:
        this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
    }
    this.toggleAnnotationLayerPointerEvents(!1);
    const {
      classList: e
    } = this.div;
    for (const i of g(Dn, Xo).values())
      e.toggle(`${i._type}Editing`, t === i._editorType);
    this.div.hidden = !1;
  }
  hasTextLayer(t) {
    var e;
    return t === ((e = g(this, Vs)) == null ? void 0 : e.div);
  }
  setEditingState(t) {
    g(this, Ft).setEditingState(t);
  }
  addCommands(t) {
    g(this, Ft).addCommands(t);
  }
  cleanUndoStack(t) {
    g(this, Ft).cleanUndoStack(t);
  }
  toggleDrawing(t = !1) {
    this.div.classList.toggle("drawing", !t);
  }
  togglePointerEvents(t = !1) {
    this.div.classList.toggle("disabled", !t);
  }
  toggleAnnotationLayerPointerEvents(t = !1) {
    var e;
    (e = g(this, Ra)) == null || e.div.classList.toggle("disabled", !t);
  }
  async enable() {
    S(this, Wc, !0), this.div.tabIndex = 0, this.togglePointerEvents(!0);
    const t = /* @__PURE__ */ new Set();
    for (const i of g(this, gn).values())
      i.enableEditing(), i.show(!0), i.annotationElementId && (g(this, Ft).removeChangedExistingAnnotation(i), t.add(i.annotationElementId));
    if (!g(this, Ra)) {
      S(this, Wc, !1);
      return;
    }
    const e = g(this, Ra).getEditableAnnotations();
    for (const i of e) {
      if (i.hide(), g(this, Ft).isDeletedAnnotationElement(i.data.id) || t.has(i.data.id))
        continue;
      const n = await this.deserialize(i);
      n && (this.addOrRebuild(n), n.enableEditing());
    }
    S(this, Wc, !1);
  }
  disable() {
    var n;
    S(this, g1, !0), this.div.tabIndex = -1, this.togglePointerEvents(!1);
    const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
    for (const a of g(this, gn).values())
      if (a.disableEditing(), !!a.annotationElementId) {
        if (a.serialize() !== null) {
          t.set(a.annotationElementId, a);
          continue;
        } else
          e.set(a.annotationElementId, a);
        (n = this.getEditableAnnotation(a.annotationElementId)) == null || n.show(), a.remove();
      }
    if (g(this, Ra)) {
      const a = g(this, Ra).getEditableAnnotations();
      for (const r of a) {
        const {
          id: o
        } = r.data;
        if (g(this, Ft).isDeletedAnnotationElement(o))
          continue;
        let l = e.get(o);
        if (l) {
          l.resetAnnotationElement(r), l.show(!1), r.show();
          continue;
        }
        l = t.get(o), l && (g(this, Ft).addChangedExistingAnnotation(l), l.renderAnnotationElement(r) && l.show(!1)), r.show();
      }
    }
    C(this, De, Og).call(this), this.isEmpty && (this.div.hidden = !0);
    const {
      classList: i
    } = this.div;
    for (const a of g(Dn, Xo).values())
      i.remove(`${a._type}Editing`);
    this.disableTextSelection(), this.toggleAnnotationLayerPointerEvents(!0), S(this, g1, !1);
  }
  getEditableAnnotation(t) {
    var e;
    return ((e = g(this, Ra)) == null ? void 0 : e.getEditableAnnotation(t)) || null;
  }
  setActiveEditor(t) {
    g(this, Ft).getActive() !== t && g(this, Ft).setActiveEditor(t);
  }
  enableTextSelection() {
    var t;
    if (this.div.tabIndex = -1, (t = g(this, Vs)) != null && t.div && !g(this, Rr)) {
      S(this, Rr, new AbortController());
      const e = g(this, Ft).combinedSignal(g(this, Rr));
      g(this, Vs).div.addEventListener("pointerdown", C(this, De, xv).bind(this), {
        signal: e
      }), g(this, Vs).div.classList.add("highlighting");
    }
  }
  disableTextSelection() {
    var t;
    this.div.tabIndex = 0, (t = g(this, Vs)) != null && t.div && g(this, Rr) && (g(this, Rr).abort(), S(this, Rr, null), g(this, Vs).div.classList.remove("highlighting"));
  }
  enableClick() {
    if (g(this, Vo))
      return;
    S(this, Vo, new AbortController());
    const t = g(this, Ft).combinedSignal(g(this, Vo));
    this.div.addEventListener("pointerdown", this.pointerdown.bind(this), {
      signal: t
    });
    const e = this.pointerup.bind(this);
    this.div.addEventListener("pointerup", e, {
      signal: t
    }), this.div.addEventListener("pointercancel", e, {
      signal: t
    });
  }
  disableClick() {
    var t;
    (t = g(this, Vo)) == null || t.abort(), S(this, Vo, null);
  }
  attach(t) {
    g(this, gn).set(t.id, t);
    const {
      annotationElementId: e
    } = t;
    e && g(this, Ft).isDeletedAnnotationElement(e) && g(this, Ft).removeDeletedAnnotationElement(t);
  }
  detach(t) {
    var e;
    g(this, gn).delete(t.id), (e = g(this, Vc)) == null || e.removePointerInTextLayer(t.contentDiv), !g(this, g1) && t.annotationElementId && g(this, Ft).addDeletedAnnotationElement(t);
  }
  remove(t) {
    this.detach(t), g(this, Ft).removeEditor(t), t.div.remove(), t.isAttachedToDOM = !1;
  }
  changeParent(t) {
    var e;
    t.parent !== this && (t.parent && t.annotationElementId && (g(this, Ft).addDeletedAnnotationElement(t.annotationElementId), Ie.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), (e = t.parent) == null || e.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), g(this, Ft).addEditor(t), this.attach(t), !t.isAttachedToDOM) {
        const e = t.render();
        this.div.append(e), t.isAttachedToDOM = !0;
      }
      t.fixAndSetPosition(), t.onceAdded(!g(this, Wc)), g(this, Ft).addToAnnotationStorage(t), t._reportTelemetry(t.telemetryInitialData);
    }
  }
  moveEditorInDOM(t) {
    var i;
    if (!t.isAttachedToDOM)
      return;
    const {
      activeElement: e
    } = document;
    t.div.contains(e) && !g(this, Mr) && (t._focusEventsAllowed = !1, S(this, Mr, setTimeout(() => {
      S(this, Mr, null), t.div.contains(document.activeElement) ? t._focusEventsAllowed = !0 : (t.div.addEventListener("focusin", () => {
        t._focusEventsAllowed = !0;
      }, {
        once: !0,
        signal: g(this, Ft)._signal
      }), e.focus());
    }, 0))), t._structTreeParentId = (i = g(this, Vc)) == null ? void 0 : i.moveElementInDOM(this.div, t.div, t.contentDiv, !0);
  }
  addOrRebuild(t) {
    t.needsToBeRebuilt() ? (t.parent || (t.parent = this), t.rebuild(), t.show()) : this.add(t);
  }
  addUndoableEditor(t) {
    const e = () => t._uiManager.rebuild(t), i = () => {
      t.remove();
    };
    this.addCommands({
      cmd: e,
      undo: i,
      mustExec: !1
    });
  }
  getNextId() {
    return g(this, Ft).getId();
  }
  combinedSignal(t) {
    return g(this, Ft).combinedSignal(t);
  }
  canCreateNewEmptyEditor() {
    var t;
    return (t = g(this, De, ga)) == null ? void 0 : t.canCreateNewEmptyEditor();
  }
  async pasteEditor(t, e) {
    this.updateToolbar(t), await g(this, Ft).updateMode(t.mode);
    const {
      offsetX: i,
      offsetY: n
    } = C(this, De, v3).call(this), a = this.getNextId(), r = C(this, De, w3).call(this, {
      parent: this,
      id: a,
      x: i,
      y: n,
      uiManager: g(this, Ft),
      isCentered: !0,
      ...e
    });
    r && this.add(r);
  }
  async deserialize(t) {
    var e;
    return await ((e = g(Dn, Xo).get(t.annotationType ?? t.annotationEditorType)) == null ? void 0 : e.deserialize(t, this, g(this, Ft))) || null;
  }
  createAndAddNewEditor(t, e, i = {}) {
    const n = this.getNextId(), a = C(this, De, w3).call(this, {
      parent: this,
      id: n,
      x: t.offsetX,
      y: t.offsetY,
      uiManager: g(this, Ft),
      isCentered: e,
      ...i
    });
    return a && this.add(a), a;
  }
  addNewEditor(t = {}) {
    this.createAndAddNewEditor(C(this, De, v3).call(this), !0, t);
  }
  setSelected(t) {
    g(this, Ft).setSelected(t);
  }
  toggleSelected(t) {
    g(this, Ft).toggleSelected(t);
  }
  unselect(t) {
    g(this, Ft).unselect(t);
  }
  pointerup(t) {
    var n;
    const {
      isMac: e
    } = ks.platform;
    if (t.button !== 0 || t.ctrlKey && e || t.target !== this.div || !g(this, Wo) || (S(this, Wo, !1), (n = g(this, De, ga)) != null && n.isDrawer && g(this, De, ga).supportMultipleDrawings))
      return;
    if (!g(this, f1)) {
      S(this, f1, !0);
      return;
    }
    const i = g(this, Ft).getMode();
    if (i === Ht.STAMP || i === Ht.SIGNATURE) {
      g(this, Ft).unselectAll();
      return;
    }
    this.createAndAddNewEditor(t, !1);
  }
  pointerdown(t) {
    var n;
    if (g(this, Ft).getMode() === Ht.HIGHLIGHT && this.enableTextSelection(), g(this, Wo)) {
      S(this, Wo, !1);
      return;
    }
    const {
      isMac: e
    } = ks.platform;
    if (t.button !== 0 || t.ctrlKey && e || t.target !== this.div)
      return;
    if (S(this, Wo, !0), (n = g(this, De, ga)) != null && n.isDrawer) {
      this.startDrawingSession(t);
      return;
    }
    const i = g(this, Ft).getActive();
    S(this, f1, !i || i.isEmpty());
  }
  startDrawingSession(t) {
    if (this.div.focus({
      preventScroll: !0
    }), g(this, Xn)) {
      g(this, De, ga).startDrawing(this, g(this, Ft), !1, t);
      return;
    }
    g(this, Ft).setCurrentDrawingSession(this), S(this, Xn, new AbortController());
    const e = g(this, Ft).combinedSignal(g(this, Xn));
    this.div.addEventListener("blur", ({
      relatedTarget: i
    }) => {
      i && !this.div.contains(i) && (S(this, Fr, null), this.commitOrRemove());
    }, {
      signal: e
    }), g(this, De, ga).startDrawing(this, g(this, Ft), !1, t);
  }
  pause(t) {
    if (t) {
      const {
        activeElement: e
      } = document;
      this.div.contains(e) && S(this, Fr, e);
      return;
    }
    g(this, Fr) && setTimeout(() => {
      var e;
      (e = g(this, Fr)) == null || e.focus(), S(this, Fr, null);
    }, 0);
  }
  endDrawingSession(t = !1) {
    return g(this, Xn) ? (g(this, Ft).setCurrentDrawingSession(null), g(this, Xn).abort(), S(this, Xn, null), S(this, Fr, null), g(this, De, ga).endDrawing(t)) : null;
  }
  findNewParent(t, e, i) {
    const n = g(this, Ft).findParent(e, i);
    return n === null || n === this ? !1 : (n.changeParent(t), !0);
  }
  commitOrRemove() {
    return g(this, Xn) ? (this.endDrawingSession(), !0) : !1;
  }
  onScaleChanging() {
    g(this, Xn) && g(this, De, ga).onScaleChangingWhenDrawing(this);
  }
  destroy() {
    var t, e;
    this.commitOrRemove(), ((t = g(this, Ft).getActive()) == null ? void 0 : t.parent) === this && (g(this, Ft).commitOrRemove(), g(this, Ft).setActiveEditor(null)), g(this, Mr) && (clearTimeout(g(this, Mr)), S(this, Mr, null));
    for (const i of g(this, gn).values())
      (e = g(this, Vc)) == null || e.removePointerInTextLayer(i.contentDiv), i.setParent(null), i.isAttachedToDOM = !1, i.div.remove();
    this.div = null, g(this, gn).clear(), g(this, Ft).removeLayer(this);
  }
  render({
    viewport: t
  }) {
    this.viewport = t, rl(this.div, t);
    for (const e of g(this, Ft).getEditors(this.pageIndex))
      this.add(e), e.rebuild();
    this.updateMode();
  }
  update({
    viewport: t
  }) {
    g(this, Ft).commitOrRemove(), C(this, De, Og).call(this);
    const e = this.viewport.rotation, i = t.rotation;
    if (this.viewport = t, rl(this.div, {
      rotation: i
    }), e !== i)
      for (const n of g(this, gn).values())
        n.rotate(i);
  }
  get pageDimensions() {
    const {
      pageWidth: t,
      pageHeight: e
    } = this.viewport.rawDims;
    return [t, e];
  }
  get scale() {
    return g(this, Ft).viewParameters.realScale;
  }
};
Vc = new WeakMap(), f1 = new WeakMap(), Ra = new WeakMap(), Vo = new WeakMap(), Mr = new WeakMap(), gn = new WeakMap(), Wo = new WeakMap(), g1 = new WeakMap(), Wc = new WeakMap(), Xn = new WeakMap(), Fr = new WeakMap(), Vs = new WeakMap(), Rr = new WeakMap(), Ft = new WeakMap(), Xo = new WeakMap(), De = new WeakSet(), xv = function(t) {
  g(this, Ft).unselectAll();
  const {
    target: e
  } = t;
  if (e === g(this, Vs).div || (e.getAttribute("role") === "img" || e.classList.contains("endOfContent")) && g(this, Vs).div.contains(e)) {
    const {
      isMac: i
    } = ks.platform;
    if (t.button !== 0 || t.ctrlKey && i)
      return;
    g(this, Ft).showAllEditors("highlight", !0, !0), g(this, Vs).div.classList.add("free"), this.toggleDrawing(), fp.startHighlighting(this, g(this, Ft).direction === "ltr", {
      target: g(this, Vs).div,
      x: t.x,
      y: t.y
    }), g(this, Vs).div.addEventListener("pointerup", () => {
      g(this, Vs).div.classList.remove("free"), this.toggleDrawing(!0);
    }, {
      once: !0,
      signal: g(this, Ft)._signal
    }), t.preventDefault();
  }
}, ga = function() {
  return g(Dn, Xo).get(g(this, Ft).getMode());
}, w3 = function(t) {
  const e = g(this, De, ga);
  return e ? new e.prototype.constructor(t) : null;
}, v3 = function() {
  const {
    x: t,
    y: e,
    width: i,
    height: n
  } = this.div.getBoundingClientRect(), a = Math.max(0, t), r = Math.max(0, e), o = Math.min(window.innerWidth, t + i), l = Math.min(window.innerHeight, e + n), c = (a + o) / 2 - t, h = (r + l) / 2 - e, [u, f] = this.viewport.rotation % 180 === 0 ? [c, h] : [h, c];
  return {
    offsetX: u,
    offsetY: f
  };
}, Og = function() {
  for (const t of g(this, gn).values())
    t.isEmpty() && t.remove();
}, ht(Dn, "_initialized", !1), _(Dn, Xo, new Map([J5, h3, b3, fp, m3].map((t) => [t._editorType, t])));
let pp = Dn;
var Kn, ri, Xc, Kf, S9, kv, Va, A3, Sv, x3;
const cs = class cs {
  constructor({
    pageIndex: t
  }) {
    _(this, Va);
    _(this, Kn, null);
    _(this, ri, /* @__PURE__ */ new Map());
    _(this, Xc, /* @__PURE__ */ new Map());
    this.pageIndex = t;
  }
  setParent(t) {
    if (!g(this, Kn)) {
      S(this, Kn, t);
      return;
    }
    if (g(this, Kn) !== t) {
      if (g(this, ri).size > 0)
        for (const e of g(this, ri).values())
          e.remove(), t.append(e);
      S(this, Kn, t);
    }
  }
  static get _svgFactory() {
    return ne(this, "_svgFactory", new e0());
  }
  draw(t, e = !1, i = !1) {
    const n = Qs(cs, Kf)._++, a = C(this, Va, A3).call(this), r = cs._svgFactory.createElement("defs");
    a.append(r);
    const o = cs._svgFactory.createElement("path");
    r.append(o);
    const l = `path_p${this.pageIndex}_${n}`;
    o.setAttribute("id", l), o.setAttribute("vector-effect", "non-scaling-stroke"), e && g(this, Xc).set(n, o);
    const c = i ? C(this, Va, Sv).call(this, r, l) : null, h = cs._svgFactory.createElement("use");
    return a.append(h), h.setAttribute("href", `#${l}`), this.updateProperties(a, t), g(this, ri).set(n, a), {
      id: n,
      clipPathId: `url(#${c})`
    };
  }
  drawOutline(t, e) {
    const i = Qs(cs, Kf)._++, n = C(this, Va, A3).call(this), a = cs._svgFactory.createElement("defs");
    n.append(a);
    const r = cs._svgFactory.createElement("path");
    a.append(r);
    const o = `path_p${this.pageIndex}_${i}`;
    r.setAttribute("id", o), r.setAttribute("vector-effect", "non-scaling-stroke");
    let l;
    if (e) {
      const u = cs._svgFactory.createElement("mask");
      a.append(u), l = `mask_p${this.pageIndex}_${i}`, u.setAttribute("id", l), u.setAttribute("maskUnits", "objectBoundingBox");
      const f = cs._svgFactory.createElement("rect");
      u.append(f), f.setAttribute("width", "1"), f.setAttribute("height", "1"), f.setAttribute("fill", "white");
      const d = cs._svgFactory.createElement("use");
      u.append(d), d.setAttribute("href", `#${o}`), d.setAttribute("stroke", "none"), d.setAttribute("fill", "black"), d.setAttribute("fill-rule", "nonzero"), d.classList.add("mask");
    }
    const c = cs._svgFactory.createElement("use");
    n.append(c), c.setAttribute("href", `#${o}`), l && c.setAttribute("mask", `url(#${l})`);
    const h = c.cloneNode();
    return n.append(h), c.classList.add("mainOutline"), h.classList.add("secondaryOutline"), this.updateProperties(n, t), g(this, ri).set(i, n), i;
  }
  finalizeDraw(t, e) {
    g(this, Xc).delete(t), this.updateProperties(t, e);
  }
  updateProperties(t, e) {
    var l;
    if (!e)
      return;
    const {
      root: i,
      bbox: n,
      rootClass: a,
      path: r
    } = e, o = typeof t == "number" ? g(this, ri).get(t) : t;
    if (o) {
      if (i && C(this, Va, x3).call(this, o, i), n && C(l = cs, S9, kv).call(l, o, n), a) {
        const {
          classList: c
        } = o;
        for (const [h, u] of Object.entries(a))
          c.toggle(h, u);
      }
      if (r) {
        const h = o.firstChild.firstChild;
        C(this, Va, x3).call(this, h, r);
      }
    }
  }
  updateParent(t, e) {
    if (e === this)
      return;
    const i = g(this, ri).get(t);
    i && (g(e, Kn).append(i), g(this, ri).delete(t), g(e, ri).set(t, i));
  }
  remove(t) {
    g(this, Xc).delete(t), g(this, Kn) !== null && (g(this, ri).get(t).remove(), g(this, ri).delete(t));
  }
  destroy() {
    S(this, Kn, null);
    for (const t of g(this, ri).values())
      t.remove();
    g(this, ri).clear(), g(this, Xc).clear();
  }
};
Kn = new WeakMap(), ri = new WeakMap(), Xc = new WeakMap(), Kf = new WeakMap(), S9 = new WeakSet(), kv = function(t, [e, i, n, a]) {
  const {
    style: r
  } = t;
  r.top = `${100 * i}%`, r.left = `${100 * e}%`, r.width = `${100 * n}%`, r.height = `${100 * a}%`;
}, Va = new WeakSet(), A3 = function() {
  const t = cs._svgFactory.create(1, 1, !0);
  return g(this, Kn).append(t), t.setAttribute("aria-hidden", !0), t;
}, Sv = function(t, e) {
  const i = cs._svgFactory.createElement("clipPath");
  t.append(i);
  const n = `clip_${e}`;
  i.setAttribute("id", n), i.setAttribute("clipPathUnits", "objectBoundingBox");
  const a = cs._svgFactory.createElement("use");
  return i.append(a), a.setAttribute("href", `#${e}`), a.classList.add("clip"), n;
}, x3 = function(t, e) {
  for (const [i, n] of Object.entries(e))
    n === null ? t.removeAttribute(i) : t.setAttribute(i, n);
}, _(cs, S9), _(cs, Kf, 0);
let mp = cs;
globalThis._pdfjsTestingUtils = {
  HighlightOutliner: Q5
};
globalThis.pdfjsLib = {
  AbortException: Gr,
  AnnotationEditorLayer: pp,
  AnnotationEditorParamsType: ae,
  AnnotationEditorType: Ht,
  AnnotationEditorUIManager: ol,
  AnnotationLayer: up,
  AnnotationMode: Pr,
  AnnotationType: Xe,
  build: Sw,
  ColorPicker: s0,
  createValidAbsoluteUrl: X6,
  DOMSVGFactory: e0,
  DrawLayer: mp,
  FeatureTest: ks,
  fetchData: U1,
  getDocument: z9,
  getFilenameFromUrl: by,
  getPdfFilenameFromUrl: yy,
  getUuid: Y6,
  getXfaPageViewport: wy,
  GlobalWorkerOptions: wn,
  ImageKind: Ld,
  InvalidPDFException: lp,
  isDataScheme: b2,
  isPdfFile: j9,
  isValidExplicitDest: tw,
  MathClamp: Ws,
  noContextMenu: En,
  normalizeUnicode: py,
  OPS: Jd,
  OutputScale: na,
  PasswordResponses: fy,
  PDFDataRangeTransport: s7,
  PDFDateString: H9,
  PDFWorker: C1,
  PermissionFlag: dy,
  PixelsPerInch: Vr,
  RenderingCancelledException: q9,
  ResponseException: Zd,
  setLayerDimensions: rl,
  shadow: ne,
  SignatureExtractor: Oa,
  stopEvent: Ze,
  SupportedImageMimeTypes: cp,
  TextLayer: S1,
  TouchManager: Qd,
  updateUrlHash: K6,
  Util: Dt,
  VerbosityLevel: g2,
  version: kw,
  XfaLayer: i7
};
const Cv = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  AbortException: Gr,
  AnnotationEditorLayer: pp,
  AnnotationEditorParamsType: ae,
  AnnotationEditorType: Ht,
  AnnotationEditorUIManager: ol,
  AnnotationLayer: up,
  AnnotationMode: Pr,
  AnnotationType: Xe,
  ColorPicker: s0,
  DOMSVGFactory: e0,
  DrawLayer: mp,
  FeatureTest: ks,
  GlobalWorkerOptions: wn,
  ImageKind: Ld,
  InvalidPDFException: lp,
  MathClamp: Ws,
  OPS: Jd,
  OutputScale: na,
  PDFDataRangeTransport: s7,
  PDFDateString: H9,
  PDFWorker: C1,
  PasswordResponses: fy,
  PermissionFlag: dy,
  PixelsPerInch: Vr,
  RenderingCancelledException: q9,
  ResponseException: Zd,
  SignatureExtractor: Oa,
  SupportedImageMimeTypes: cp,
  TextLayer: S1,
  TouchManager: Qd,
  Util: Dt,
  VerbosityLevel: g2,
  XfaLayer: i7,
  build: Sw,
  createValidAbsoluteUrl: X6,
  fetchData: U1,
  getDocument: z9,
  getFilenameFromUrl: by,
  getPdfFilenameFromUrl: yy,
  getUuid: Y6,
  getXfaPageViewport: wy,
  isDataScheme: b2,
  isPdfFile: j9,
  isValidExplicitDest: tw,
  noContextMenu: En,
  normalizeUnicode: py,
  setLayerDimensions: rl,
  shadow: ne,
  stopEvent: Ze,
  updateUrlHash: K6,
  version: kw
}, Symbol.toStringTag, { value: "Module" })), dC = !(typeof process != "object" || process + "" != "[object process]" || process.versions.nw || process.versions.electron && process.type && process.type !== "browser"), Qc = [1e-3, 0, 0, 1e-3, 0, 0], th = 1.35, D8 = 0.35, N8 = 0.25925925925925924, B8 = 1, bp = 2, L8 = 4, O8 = 8, Iv = 16, fC = 64, gC = 128, pC = 256, _v = "pdfjs_internal_editor_", U8 = 3, q8 = 9, j8 = 13, H8 = 15, $8 = 101, z8 = { PRINT: 4, MODIFY_CONTENTS: 8, COPY: 16, MODIFY_ANNOTATIONS: 32, FILL_INTERACTIVE_FORMS: 256, COPY_FOR_ACCESSIBILITY: 512, ASSEMBLE: 1024, PRINT_HIGH_QUALITY: 2048 }, mC = 0, bC = 4, yp = 1, Od = 2, sr = 3, yC = 1, wC = 2, vC = 3, AC = 4, xC = 5, kC = 6, SC = 7, CC = 8, IC = 9, _C = 10, TC = 11, EC = 12, MC = 13, FC = 14, RC = 15, PC = 16, DC = 17, NC = 20, Tv = "Group", BC = "R", j2 = 1, Dl = 2, vh = 4, LC = 16, Ud = 32, OC = 128, UC = 512, qC = 1, jC = 2, HC = 4096, $C = 8192, zC = 32768, GC = 65536, VC = 131072, WC = 1048576, XC = 2097152, KC = 8388608, YC = 16777216, G8 = 1, JC = 2, ZC = 3, QC = 4, tI = 5, Ev = { E: "Mouse Enter", X: "Mouse Exit", D: "Mouse Down", U: "Mouse Up", Fo: "Focus", Bl: "Blur", PO: "PageOpen", PC: "PageClose", PV: "PageVisible", PI: "PageInvisible", K: "Keystroke", F: "Format", V: "Validate", C: "Calculate" }, eI = { WC: "WillClose", WS: "WillSave", DS: "DidSave", WP: "WillPrint", DP: "DidPrint" }, sI = { O: "PageOpen", C: "PageClose" }, Mv = 1, k3 = 5, iI = 1, Fv = 2, nI = 3, aI = 4, rI = 5, oI = 6, Rv = 7, lI = 8, Hl = 9, aa = 10, Ci = 11, Wr = 12, wp = 13, S3 = 14, C3 = 15, I3 = 16, _3 = 17, T3 = 18, E3 = 19, o7 = 20, vp = 21, M3 = 22, Pv = 23, l7 = 24, c7 = 25, Ap = 26, xp = 27, F3 = 28, cI = 29, hI = 30, kp = 31, Sp = 32, R3 = 33, P3 = 34, Dv = 35, Nv = 36, il = 37, Bv = 38, Lv = 39, Ov = 40, Uv = 41, lh = 42, Ug = 43, Dr = 44, Cp = 45, Ip = 46, _p = 47, qv = 48, D3 = 49, h7 = 50, V9 = 51, u7 = 52, Tp = 53, W9 = 54, Ep = 55, d7 = 56, x2 = 57, no = 58, Da = 59, f7 = 60, k2 = 61, Mp = 62, uI = 63, dI = 64, jv = 65, N3 = 66, Hv = 67, $v = 68, zv = 69, Na = 70, I1 = 71, Gv = 72, Vv = 73, Wv = 74, fI = 75, gI = 76, pI = 77, Xv = 80, Kv = 81, _1 = 83, mI = 84, B3 = 85, Fp = 86, Yv = 87, bI = 88, yI = 89, wI = 90, eh = 91, vI = 92, AI = 93, xI = 94, _d = 0, Cl = 1, qg = 2, H2 = 3, kI = 1, SI = 2;
let X9 = Mv;
function CI() {
  return X9;
}
function qt(s) {
  X9 >= k3 && console.log(`Info: ${s}`);
}
function D(s) {
  X9 >= Mv && console.log(`Warning: ${s}`);
}
function Wt(s) {
  throw new Error(s);
}
function As(s, t) {
  s || Wt(t);
}
function Rp(s, t = null, e = null) {
  if (!s) return null;
  if (e && typeof s == "string") {
    if (e.addDefaultProtocol && s.startsWith("www.")) {
      const n = s.match(/\./g);
      (n == null ? void 0 : n.length) >= 2 && (s = `http://${s}`);
    }
    if (e.tryConvertEncoding) try {
      s = a0(s);
    } catch {
    }
  }
  const i = t ? URL.parse(s, t) : URL.parse(s);
  return function(a) {
    switch (a == null ? void 0 : a.protocol) {
      case "http:":
      case "https:":
      case "ftp:":
      case "mailto:":
      case "tel:":
        return !0;
      default:
        return !1;
    }
  }(i) ? i : null;
}
function gt(s, t, e, i = !1) {
  return Object.defineProperty(s, t, { value: e, enumerable: !i, configurable: !0, writable: !1 }), e;
}
const gi = function() {
  function t(e, i) {
    this.message = e, this.name = i;
  }
  return t.prototype = new Error(), t.constructor = t, t;
}();
class i0 extends gi {
  constructor(t, e) {
    super(t, "PasswordException"), this.code = e;
  }
}
class wm extends gi {
  constructor(t, e) {
    super(t, "UnknownErrorException"), this.details = e;
  }
}
class n0 extends gi {
  constructor(t) {
    super(t, "InvalidPDFException");
  }
}
class V8 extends gi {
  constructor(t, e, i) {
    super(t, "ResponseException"), this.status = e, this.missing = i;
  }
}
class st extends gi {
  constructor(t) {
    super(t, "FormatError");
  }
}
class Es extends gi {
  constructor(t) {
    super(t, "AbortException");
  }
}
function Si(s) {
  typeof s == "object" && (s == null ? void 0 : s.length) !== void 0 || Wt("Invalid argument for bytesToString");
  const t = s.length, e = 8192;
  if (t < e) return String.fromCharCode.apply(null, s);
  const i = [];
  for (let n = 0; n < t; n += e) {
    const a = Math.min(n + e, t), r = s.subarray(n, a);
    i.push(String.fromCharCode.apply(null, r));
  }
  return i.join("");
}
function Ns(s) {
  typeof s != "string" && Wt("Invalid argument for stringToBytes");
  const t = s.length, e = new Uint8Array(t);
  for (let i = 0; i < t; ++i) e[i] = 255 & s.charCodeAt(i);
  return e;
}
function Fs(s) {
  return String.fromCharCode(s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, 255 & s);
}
function g7(s) {
  return Object.keys(s).length;
}
class Ii {
  static get isLittleEndian() {
    return gt(this, "isLittleEndian", function() {
      const e = new Uint8Array(4);
      return e[0] = 1, new Uint32Array(e.buffer, 0, 1)[0] === 1;
    }());
  }
  static get isEvalSupported() {
    return gt(this, "isEvalSupported", function() {
      try {
        return new Function(""), !0;
      } catch {
        return !1;
      }
    }());
  }
  static get isOffscreenCanvasSupported() {
    return gt(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
  }
  static get isImageDecoderSupported() {
    return gt(this, "isImageDecoderSupported", typeof ImageDecoder < "u");
  }
  static get platform() {
    const { platform: t, userAgent: e } = navigator;
    return gt(this, "platform", { isAndroid: e.includes("Android"), isLinux: t.includes("Linux"), isMac: t.includes("Mac"), isWindows: t.includes("Win"), isFirefox: e.includes("Firefox") });
  }
  static get isCSSRoundSupported() {
    var t, e;
    return gt(this, "isCSSRoundSupported", (e = (t = globalThis.CSS) == null ? void 0 : t.supports) == null ? void 0 : e.call(t, "width: round(1.5px, 1px)"));
  }
}
const su = Array.from(Array(256).keys(), (s) => s.toString(16).padStart(2, "0"));
var zr, jg, L3;
class se {
  static makeHexColor(t, e, i) {
    return `#${su[t]}${su[e]}${su[i]}`;
  }
  static scaleMinMax(t, e) {
    let i;
    t[0] ? (t[0] < 0 && (i = e[0], e[0] = e[2], e[2] = i), e[0] *= t[0], e[2] *= t[0], t[3] < 0 && (i = e[1], e[1] = e[3], e[3] = i), e[1] *= t[3], e[3] *= t[3]) : (i = e[0], e[0] = e[1], e[1] = i, i = e[2], e[2] = e[3], e[3] = i, t[1] < 0 && (i = e[1], e[1] = e[3], e[3] = i), e[1] *= t[1], e[3] *= t[1], t[2] < 0 && (i = e[0], e[0] = e[2], e[2] = i), e[0] *= t[2], e[2] *= t[2]), e[0] += t[4], e[1] += t[5], e[2] += t[4], e[3] += t[5];
  }
  static transform(t, e) {
    return [t[0] * e[0] + t[2] * e[1], t[1] * e[0] + t[3] * e[1], t[0] * e[2] + t[2] * e[3], t[1] * e[2] + t[3] * e[3], t[0] * e[4] + t[2] * e[5] + t[4], t[1] * e[4] + t[3] * e[5] + t[5]];
  }
  static applyTransform(t, e, i = 0) {
    const n = t[i], a = t[i + 1];
    t[i] = n * e[0] + a * e[2] + e[4], t[i + 1] = n * e[1] + a * e[3] + e[5];
  }
  static applyTransformToBezier(t, e, i = 0) {
    const n = e[0], a = e[1], r = e[2], o = e[3], l = e[4], c = e[5];
    for (let h = 0; h < 6; h += 2) {
      const u = t[i + h], f = t[i + h + 1];
      t[i + h] = u * n + f * r + l, t[i + h + 1] = u * a + f * o + c;
    }
  }
  static applyInverseTransform(t, e) {
    const i = t[0], n = t[1], a = e[0] * e[3] - e[1] * e[2];
    t[0] = (i * e[3] - n * e[2] + e[2] * e[5] - e[4] * e[3]) / a, t[1] = (-i * e[1] + n * e[0] + e[4] * e[1] - e[5] * e[0]) / a;
  }
  static axialAlignedBoundingBox(t, e, i) {
    const n = e[0], a = e[1], r = e[2], o = e[3], l = e[4], c = e[5], h = t[0], u = t[1], f = t[2], d = t[3];
    let p = n * h + l, m = p, b = n * f + l, y = b, v = o * u + c, w = v, A = o * d + c, x = A;
    if (a !== 0 || r !== 0) {
      const k = a * h, I = a * f, T = r * u, E = r * d;
      p += T, y += T, b += E, m += E, v += k, x += k, A += I, w += I;
    }
    i[0] = Math.min(i[0], p, b, m, y), i[1] = Math.min(i[1], v, A, w, x), i[2] = Math.max(i[2], p, b, m, y), i[3] = Math.max(i[3], v, A, w, x);
  }
  static inverseTransform(t) {
    const e = t[0] * t[3] - t[1] * t[2];
    return [t[3] / e, -t[1] / e, -t[2] / e, t[0] / e, (t[2] * t[5] - t[4] * t[3]) / e, (t[4] * t[1] - t[5] * t[0]) / e];
  }
  static singularValueDecompose2dScale(t, e) {
    const i = t[0], n = t[1], a = t[2], r = t[3], o = i ** 2 + n ** 2, l = i * a + n * r, c = a ** 2 + r ** 2, h = (o + c) / 2, u = Math.sqrt(h ** 2 - (o * c - l ** 2));
    e[0] = Math.sqrt(h + u || 1), e[1] = Math.sqrt(h - u || 1);
  }
  static normalizeRect(t) {
    const e = t.slice(0);
    return t[0] > t[2] && (e[0] = t[2], e[2] = t[0]), t[1] > t[3] && (e[1] = t[3], e[3] = t[1]), e;
  }
  static intersect(t, e) {
    const i = Math.max(Math.min(t[0], t[2]), Math.min(e[0], e[2])), n = Math.min(Math.max(t[0], t[2]), Math.max(e[0], e[2]));
    if (i > n) return null;
    const a = Math.max(Math.min(t[1], t[3]), Math.min(e[1], e[3])), r = Math.min(Math.max(t[1], t[3]), Math.max(e[1], e[3]));
    return a > r ? null : [i, a, n, r];
  }
  static pointBoundingBox(t, e, i) {
    i[0] = Math.min(i[0], t), i[1] = Math.min(i[1], e), i[2] = Math.max(i[2], t), i[3] = Math.max(i[3], e);
  }
  static rectBoundingBox(t, e, i, n, a) {
    a[0] = Math.min(a[0], t, i), a[1] = Math.min(a[1], e, n), a[2] = Math.max(a[2], t, i), a[3] = Math.max(a[3], e, n);
  }
  static bezierBoundingBox(t, e, i, n, a, r, o, l, c) {
    c[0] = Math.min(c[0], t, o), c[1] = Math.min(c[1], e, l), c[2] = Math.max(c[2], t, o), c[3] = Math.max(c[3], e, l), C(this, zr, L3).call(this, t, i, a, o, e, n, r, l, 3 * (3 * (i - a) - t + o), 6 * (t - 2 * i + a), 3 * (i - t), c), C(this, zr, L3).call(this, t, i, a, o, e, n, r, l, 3 * (3 * (n - r) - e + l), 6 * (e - 2 * n + r), 3 * (n - e), c);
  }
}
zr = new WeakSet(), jg = function(t, e, i, n, a, r, o, l, c, h) {
  if (c <= 0 || c >= 1) return;
  const u = 1 - c, f = c * c, d = f * c, p = u * (u * (u * t + 3 * c * e) + 3 * f * i) + d * n, m = u * (u * (u * a + 3 * c * r) + 3 * f * o) + d * l;
  h[0] = Math.min(h[0], p), h[1] = Math.min(h[1], m), h[2] = Math.max(h[2], p), h[3] = Math.max(h[3], m);
}, L3 = function(t, e, i, n, a, r, o, l, c, h, u, f) {
  if (Math.abs(c) < 1e-12) {
    Math.abs(h) >= 1e-12 && C(this, zr, jg).call(this, t, e, i, n, a, r, o, l, -u / h, f);
    return;
  }
  const d = h ** 2 - 4 * u * c;
  if (d < 0) return;
  const p = Math.sqrt(d), m = 2 * c;
  C(this, zr, jg).call(this, t, e, i, n, a, r, o, l, (-h + p) / m, f), C(this, zr, jg).call(this, t, e, i, n, a, r, o, l, (-h - p) / m, f);
}, _(se, zr);
const II = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
function Jt(s, t = !1) {
  if (s[0] >= "ï") {
    let i;
    if (s[0] === "þ" && s[1] === "ÿ" ? (i = "utf-16be", s.length % 2 == 1 && (s = s.slice(0, -1))) : s[0] === "ÿ" && s[1] === "þ" ? (i = "utf-16le", s.length % 2 == 1 && (s = s.slice(0, -1))) : s[0] === "ï" && s[1] === "»" && s[2] === "¿" && (i = "utf-8"), i) try {
      const n = new TextDecoder(i, { fatal: !0 }), a = Ns(s), r = n.decode(a);
      return t || !r.includes("\x1B") ? r : r.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, "");
    } catch (n) {
      D(`stringToPDFString: "${n}".`);
    }
  }
  const e = [];
  for (let i = 0, n = s.length; i < n; i++) {
    const a = s.charCodeAt(i);
    if (!t && a === 27) {
      for (; ++i < n && s.charCodeAt(i) !== 27; ) ;
      continue;
    }
    const r = II[a];
    e.push(r ? String.fromCharCode(r) : s.charAt(i));
  }
  return e.join("");
}
function a0(s) {
  return decodeURIComponent(escape(s));
}
function O3(s) {
  return unescape(encodeURIComponent(s));
}
function r0(s, t) {
  if (s.length !== t.length) return !1;
  for (let e = 0, i = s.length; e < i; e++) if (s[e] !== t[e]) return !1;
  return !0;
}
function Xr(s = /* @__PURE__ */ new Date()) {
  return [s.getUTCFullYear().toString(), (s.getUTCMonth() + 1).toString().padStart(2, "0"), s.getUTCDate().toString().padStart(2, "0"), s.getUTCHours().toString().padStart(2, "0"), s.getUTCMinutes().toString().padStart(2, "0"), s.getUTCSeconds().toString().padStart(2, "0")].join("");
}
let vm = null, W8 = null;
function Bs(s, t, e) {
  return Math.min(Math.max(s, t), e);
}
function X8(s) {
  return Uint8Array.prototype.toHex ? s.toHex() : Array.from(s, (t) => su[t]).join("");
}
typeof Promise.try != "function" && (Promise.try = function(s, ...t) {
  return new Promise((e) => {
    e(s(...t));
  });
});
typeof Math.sumPrecise != "function" && (Math.sumPrecise = function(s) {
  return s.reduce((t, e) => t + e, 0);
});
const _I = Symbol("CIRCULAR_REF"), vs = Symbol("EOF");
let Hg = /* @__PURE__ */ Object.create(null), $g = /* @__PURE__ */ Object.create(null), Bh = /* @__PURE__ */ Object.create(null);
class Z {
  constructor(t) {
    this.name = t;
  }
  static get(t) {
    return $g[t] || ($g[t] = new Z(t));
  }
}
class Je {
  constructor(t) {
    this.cmd = t;
  }
  static get(t) {
    return Hg[t] || (Hg[t] = new Je(t));
  }
}
const Jv = function() {
  return Jv;
};
class q {
  constructor(t = null) {
    this._map = /* @__PURE__ */ new Map(), this.xref = t, this.objId = null, this.suppressEncryption = !1, this.__nonSerializable__ = Jv;
  }
  assignXref(t) {
    this.xref = t;
  }
  get size() {
    return this._map.size;
  }
  get(t, e, i) {
    let n = this._map.get(t);
    return n === void 0 && e !== void 0 && (n = this._map.get(e), n === void 0 && i !== void 0 && (n = this._map.get(i))), n instanceof yt && this.xref ? this.xref.fetch(n, this.suppressEncryption) : n;
  }
  async getAsync(t, e, i) {
    let n = this._map.get(t);
    return n === void 0 && e !== void 0 && (n = this._map.get(e), n === void 0 && i !== void 0 && (n = this._map.get(i))), n instanceof yt && this.xref ? this.xref.fetchAsync(n, this.suppressEncryption) : n;
  }
  getArray(t, e, i) {
    let n = this._map.get(t);
    if (n === void 0 && e !== void 0 && (n = this._map.get(e), n === void 0 && i !== void 0 && (n = this._map.get(i))), n instanceof yt && this.xref && (n = this.xref.fetch(n, this.suppressEncryption)), Array.isArray(n)) {
      n = n.slice();
      for (let a = 0, r = n.length; a < r; a++) n[a] instanceof yt && this.xref && (n[a] = this.xref.fetch(n[a], this.suppressEncryption));
    }
    return n;
  }
  getRaw(t) {
    return this._map.get(t);
  }
  getKeys() {
    return [...this._map.keys()];
  }
  getRawValues() {
    return [...this._map.values()];
  }
  set(t, e) {
    this._map.set(t, e);
  }
  has(t) {
    return this._map.has(t);
  }
  *[Symbol.iterator]() {
    for (const [t, e] of this._map) yield [t, e instanceof yt && this.xref ? this.xref.fetch(e, this.suppressEncryption) : e];
  }
  static get empty() {
    const t = new q(null);
    return t.set = (e, i) => {
      Wt("Should not call `set` on the empty dictionary.");
    }, gt(this, "empty", t);
  }
  static merge({ xref: t, dictArray: e, mergeSubDicts: i = !1 }) {
    const n = new q(t), a = /* @__PURE__ */ new Map();
    for (const r of e) if (r instanceof q) for (const [o, l] of r._map) {
      let c = a.get(o);
      if (c === void 0)
        c = [], a.set(o, c);
      else if (!(i && l instanceof q)) continue;
      c.push(l);
    }
    for (const [r, o] of a) {
      if (o.length === 1 || !(o[0] instanceof q)) {
        n._map.set(r, o[0]);
        continue;
      }
      const l = new q(t);
      for (const c of o) for (const [h, u] of c._map) l._map.has(h) || l._map.set(h, u);
      l.size > 0 && n._map.set(r, l);
    }
    return a.clear(), n.size > 0 ? n : q.empty;
  }
  clone() {
    const t = new q(this.xref);
    for (const e of this.getKeys()) t.set(e, this.getRaw(e));
    return t;
  }
  delete(t) {
    delete this._map[t];
  }
}
class yt {
  constructor(t, e) {
    this.num = t, this.gen = e;
  }
  toString() {
    return this.gen === 0 ? `${this.num}R` : `${this.num}R${this.gen}`;
  }
  static fromString(t) {
    const e = Bh[t];
    if (e) return e;
    const i = /^(\d+)R(\d*)$/.exec(t);
    return i && i[1] !== "0" ? Bh[t] = new yt(parseInt(i[1]), i[2] ? parseInt(i[2]) : 0) : null;
  }
  static get(t, e) {
    const i = e === 0 ? `${t}R` : `${t}R${e}`;
    return Bh[i] || (Bh[i] = new yt(t, e));
  }
}
class Qe {
  constructor(t = null) {
    this._set = new Set(t == null ? void 0 : t._set);
  }
  has(t) {
    return this._set.has(t.toString());
  }
  put(t) {
    this._set.add(t.toString());
  }
  remove(t) {
    this._set.delete(t.toString());
  }
  [Symbol.iterator]() {
    return this._set.values();
  }
  clear() {
    this._set.clear();
  }
}
class xi {
  constructor() {
    this._map = /* @__PURE__ */ new Map();
  }
  get size() {
    return this._map.size;
  }
  get(t) {
    return this._map.get(t.toString());
  }
  has(t) {
    return this._map.has(t.toString());
  }
  put(t, e) {
    this._map.set(t.toString(), e);
  }
  putAlias(t, e) {
    this._map.set(t.toString(), this.get(e));
  }
  [Symbol.iterator]() {
    return this._map.values();
  }
  clear() {
    this._map.clear();
  }
  *values() {
    yield* this._map.values();
  }
  *items() {
    for (const [t, e] of this._map) yield [yt.fromString(t), e];
  }
}
function He(s, t) {
  return s instanceof Z && (t === void 0 || s.name === t);
}
function ds(s, t) {
  return s instanceof Je && (t === void 0 || s.cmd === t);
}
function Zv(s, t) {
  return s instanceof q && (t === void 0 || He(s.get("Type"), t));
}
function Pp(s, t) {
  return s.num === t.num && s.gen === t.gen;
}
class Ot {
  get length() {
    Wt("Abstract getter `length` accessed");
  }
  get isEmpty() {
    Wt("Abstract getter `isEmpty` accessed");
  }
  get isDataLoaded() {
    return gt(this, "isDataLoaded", !0);
  }
  getByte() {
    Wt("Abstract method `getByte` called");
  }
  getBytes(t) {
    Wt("Abstract method `getBytes` called");
  }
  async getImageData(t, e) {
    return this.getBytes(t, e);
  }
  async asyncGetBytes() {
    Wt("Abstract method `asyncGetBytes` called");
  }
  get isAsync() {
    return !1;
  }
  get isAsyncDecoder() {
    return !1;
  }
  get canAsyncDecodeImageFromBuffer() {
    return !1;
  }
  async getTransferableImage() {
    return null;
  }
  peekByte() {
    const t = this.getByte();
    return t !== -1 && this.pos--, t;
  }
  peekBytes(t) {
    const e = this.getBytes(t);
    return this.pos -= e.length, e;
  }
  getUint16() {
    const t = this.getByte(), e = this.getByte();
    return t === -1 || e === -1 ? -1 : (t << 8) + e;
  }
  getInt32() {
    return (this.getByte() << 24) + (this.getByte() << 16) + (this.getByte() << 8) + this.getByte();
  }
  getByteRange(t, e) {
    Wt("Abstract method `getByteRange` called");
  }
  getString(t) {
    return Si(this.getBytes(t));
  }
  skip(t) {
    this.pos += t || 1;
  }
  reset() {
    Wt("Abstract method `reset` called");
  }
  moveStart() {
    Wt("Abstract method `moveStart` called");
  }
  makeSubStream(t, e, i = null) {
    Wt("Abstract method `makeSubStream` called");
  }
  getBaseStreams() {
    return null;
  }
}
const Qv = /^[1-9]\.\d$/, U3 = 2 ** 31 - 1, ia = [1, 0, 0, 1, 0, 0], q3 = ["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"], j3 = ["ExtGState", "Font", "Properties", "XObject"];
function Ee(s) {
  let t;
  return function() {
    return s && (t = /* @__PURE__ */ Object.create(null), s(t), s = null), t;
  };
}
class ke extends gi {
  constructor(t, e) {
    super(`Missing data [${t}, ${e})`, "MissingDataException"), this.begin = t, this.end = e;
  }
}
class H3 extends gi {
  constructor(t) {
    super(t, "ParserEOFException");
  }
}
class Zo extends gi {
  constructor(t) {
    super(t, "XRefEntryException");
  }
}
class iu extends gi {
  constructor(t) {
    super(t, "XRefParseException");
  }
}
function tA(s) {
  const t = s.length;
  if (t === 0) return new Uint8Array(0);
  if (t === 1) return new Uint8Array(s[0]);
  let e = 0;
  for (let a = 0; a < t; a++) e += s[a].byteLength;
  const i = new Uint8Array(e);
  let n = 0;
  for (let a = 0; a < t; a++) {
    const r = new Uint8Array(s[a]);
    i.set(r, n), n += r.byteLength;
  }
  return i;
}
async function $3(s) {
  const t = await fetch(s);
  if (!t.ok) throw new Error(`Failed to fetch file "${s}" with "${t.statusText}".`);
  return new Uint8Array(await t.arrayBuffer());
}
function vn({ dict: s, key: t, getArray: e = !1, stopWhenFound: i = !0 }) {
  let n;
  const a = new Qe();
  for (; s instanceof q && (!s.objId || !a.has(s.objId)); ) {
    s.objId && a.put(s.objId);
    const r = e ? s.getArray(t) : s.get(t);
    if (r !== void 0) {
      if (i) return r;
      (n || (n = [])).push(r);
    }
    s = s.get("Parent");
  }
  return n;
}
const Am = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"];
function TI(s, t = !1) {
  As(Number.isInteger(s) && s > 0, "The number should be a positive integer.");
  const e = "M".repeat(s / 1e3 | 0) + Am[s % 1e3 / 100 | 0] + Am[10 + (s % 100 / 10 | 0)] + Am[20 + s % 10];
  return t ? e.toLowerCase() : e;
}
function xm(s) {
  return s > 0 ? Math.ceil(Math.log2(s)) : 0;
}
function pa(s, t) {
  return s[t] << 24 >> 24;
}
function Nr(s, t) {
  return (s[t] << 24 | s[t + 1] << 16) >> 16;
}
function $t(s, t) {
  return s[t] << 8 | s[t + 1];
}
function he(s, t) {
  return (s[t] << 24 | s[t + 1] << 16 | s[t + 2] << 8 | s[t + 3]) >>> 0;
}
function Qi(s) {
  return s === 32 || s === 9 || s === 13 || s === 10;
}
function ci(s, t) {
  return Array.isArray(s) ? (t === null || s.length === t) && s.every((e) => typeof e == "number") : ArrayBuffer.isView(s) && !(s instanceof BigInt64Array || s instanceof BigUint64Array) && (t === null || s.length === t);
}
function Qo(s, t) {
  return ci(s, 6) ? s : t;
}
function z3(s, t) {
  return ci(s, 4) ? s : t;
}
function Kr(s, t) {
  return ci(s, 4) ? se.normalizeRect(s) : t;
}
function eA(s) {
  const t = /(.+)\[(\d+)\]$/;
  return s.split(".").map((e) => {
    const i = e.match(t);
    return i ? { name: i[1], pos: parseInt(i[2], 10) } : { name: e, pos: 0 };
  });
}
function p7(s) {
  const t = [];
  let e = 0;
  for (let i = 0, n = s.length; i < n; i++) {
    const a = s.charCodeAt(i);
    (a < 33 || a > 126 || a === 35 || a === 40 || a === 41 || a === 60 || a === 62 || a === 91 || a === 93 || a === 123 || a === 125 || a === 47 || a === 37) && (e < i && t.push(s.substring(e, i)), t.push(`#${a.toString(16)}`), e = i + 1);
  }
  return t.length === 0 ? s : (e < s.length && t.push(s.substring(e, s.length)), t.join(""));
}
function T1(s) {
  return s.replaceAll(/([()\\\n\r])/g, (t) => t === `
` ? "\\n" : t === "\r" ? "\\r" : `\\${t}`);
}
function Dp(s, t, e, i) {
  if (!s) return;
  let n = null;
  if (s instanceof yt) {
    if (i.has(s)) return;
    n = s, i.put(n), s = t.fetch(s);
  }
  if (Array.isArray(s)) for (const a of s) Dp(a, t, e, i);
  else if (s instanceof q) {
    if (He(s.get("S"), "JavaScript")) {
      const a = s.get("JS");
      let r;
      a instanceof Ot ? r = a.getString() : typeof a == "string" && (r = a), r && (r = Jt(r, !0).replaceAll("\0", "")), r && e.push(r);
    }
    Dp(s.getRaw("Next"), t, e, i);
  }
  n && i.remove(n);
}
function K9(s, t, e) {
  const i = /* @__PURE__ */ Object.create(null), n = vn({ dict: t, key: "AA", stopWhenFound: !1 });
  if (n) for (let a = n.length - 1; a >= 0; a--) {
    const r = n[a];
    if (r instanceof q) for (const o of r.getKeys()) {
      const l = e[o];
      if (!l) continue;
      const c = [];
      Dp(r.getRaw(o), s, c, new Qe()), c.length > 0 && (i[l] = c);
    }
  }
  if (t.has("A")) {
    const a = [];
    Dp(t.get("A"), s, a, new Qe()), a.length > 0 && (i.Action = a);
  }
  return g7(i) > 0 ? i : null;
}
const EI = { 60: "&lt;", 62: "&gt;", 38: "&amp;", 34: "&quot;", 39: "&apos;" };
function* MI(s) {
  for (let t = 0, e = s.length; t < e; t++) {
    const i = s.codePointAt(t);
    i > 55295 && (i < 57344 || i > 65533) && t++, yield i;
  }
}
function nu(s) {
  const t = [];
  let e = 0;
  for (let i = 0, n = s.length; i < n; i++) {
    const a = s.codePointAt(i);
    if (32 <= a && a <= 126) {
      const r = EI[a];
      r && (e < i && t.push(s.substring(e, i)), t.push(r), e = i + 1);
    } else
      e < i && t.push(s.substring(e, i)), t.push(`&#x${a.toString(16).toUpperCase()};`), a > 55295 && (a < 57344 || a > 65533) && i++, e = i + 1;
  }
  return t.length === 0 ? s : (e < s.length && t.push(s.substring(e, s.length)), t.join(""));
}
function G3(s, t = !1) {
  const e = /^("|').*("|')$/.exec(s);
  if (e && e[1] === e[2]) {
    if (new RegExp(`[^\\\\]${e[1]}`).test(s.slice(1, -1)))
      return t && D(`FontFamily contains unescaped ${e[1]}: ${s}.`), !1;
  } else for (const i of s.split(/[ \t]+/)) if (/^(\d|(-(\d|-)))/.test(i) || !/^[\w-\\]+$/.test(i))
    return t && D(`FontFamily contains invalid <custom-ident>: ${s}.`), !1;
  return !0;
}
function FI(s) {
  const t = /* @__PURE__ */ new Set(["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "normal", "bold", "bolder", "lighter"]), { fontFamily: e, fontWeight: i, italicAngle: n } = s;
  if (!G3(e, !0)) return !1;
  const a = i ? i.toString() : "";
  s.fontWeight = t.has(a) ? a : "400";
  const r = parseFloat(n);
  return s.italicAngle = isNaN(r) || r < -90 || r > 90 ? "14" : n.toString(), !0;
}
function sA(s) {
  const t = new RegExp("^\\s*(" + ["app.launchURL", "window.open", "xfa.host.gotoURL"].join("|").replaceAll(".", "\\.") + `)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`, "i").exec(s);
  return t != null && t[2] ? { url: t[2], newWindow: t[1] === "app.launchURL" && t[3] === "true" } : null;
}
function Vt(s) {
  if (Number.isInteger(s)) return s.toString();
  const t = Math.round(100 * s);
  return t % 100 == 0 ? (t / 100).toString() : t % 10 == 0 ? s.toFixed(1) : s.toFixed(2);
}
function iA(s) {
  if (!s) return null;
  const t = /* @__PURE__ */ new Map();
  for (const [e, i] of s) {
    if (!e.startsWith(_v)) continue;
    let n = t.get(i.pageIndex);
    n || (n = [], t.set(i.pageIndex, n)), n.push(i);
  }
  return t.size > 0 ? t : null;
}
function An(s) {
  return function(e) {
    return /^[\x00-\x7F]*$/.test(e);
  }(s) ? s : nA(s, !0);
}
function RI(s) {
  const t = [];
  for (let e = 0, i = s.length; e < i; e++) {
    const n = s.charCodeAt(e);
    t.push(su[n >> 8 & 255], su[255 & n]);
  }
  return t.join("");
}
function nA(s, t = !1) {
  const e = [];
  t && e.push("þÿ");
  for (let i = 0, n = s.length; i < n; i++) {
    const a = s.charCodeAt(i);
    e.push(String.fromCharCode(a >> 8 & 255), String.fromCharCode(255 & a));
  }
  return e.join("");
}
function Np(s, t, e) {
  switch (s) {
    case 90:
      return [0, 1, -1, 0, t, 0];
    case 180:
      return [-1, 0, 0, -1, t, e];
    case 270:
      return [0, -1, 1, 0, 0, e];
    default:
      throw new Error("Invalid rotation");
  }
}
function K8(s) {
  return Math.ceil(Math.ceil(Math.log2(1 + s)) / 8);
}
var Yf;
class Ce {
  static get _memoryArray() {
    const t = g(this, Yf);
    return t != null && t.byteLength ? t : S(this, Yf, new Uint8Array(this._memory.buffer));
  }
}
Yf = new WeakMap(), _(Ce, Yf, null), ht(Ce, "_memory", null), ht(Ce, "_mustAddAlpha", !1), ht(Ce, "_destBuffer", null), ht(Ce, "_destOffset", 0), ht(Ce, "_destLength", 0), ht(Ce, "_cssColor", ""), ht(Ce, "_makeHexColor", null);
let li;
const aA = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
  throw Error("TextDecoder not available");
} };
typeof TextDecoder < "u" && aA.decode();
let Td = null;
function rA() {
  return Td !== null && Td.byteLength !== 0 || (Td = new Uint8Array(li.memory.buffer)), Td;
}
let V3 = 0;
function Y8(s, t) {
  const e = t(1 * s.length, 1) >>> 0;
  return rA().set(s, e / 1), V3 = s.length, e;
}
const km = Object.freeze({ RGB8: 0, 0: "RGB8", RGBA8: 1, 1: "RGBA8", BGRA8: 2, 2: "BGRA8", Gray8: 3, 3: "Gray8", GrayA8: 4, 4: "GrayA8", CMYK: 5, 5: "CMYK" }), PI = Object.freeze({ Perceptual: 0, 0: "Perceptual", RelativeColorimetric: 1, 1: "RelativeColorimetric", Saturation: 2, 2: "Saturation", AbsoluteColorimetric: 3, 3: "AbsoluteColorimetric" });
function DI() {
  const s = { wbg: {} };
  return s.wbg.__wbg_copyresult_b08ee7d273f295dd = function(t, e) {
    (function(n, a) {
      const { _mustAddAlpha: r, _destBuffer: o, _destOffset: l, _destLength: c, _memoryArray: h } = Ce;
      if (a !== c) if (r) for (let u = n, f = n + a, d = l; u < f; u += 3, d += 4)
        o[d] = h[u], o[d + 1] = h[u + 1], o[d + 2] = h[u + 2], o[d + 3] = 255;
      else for (let u = n, f = n + a, d = l; u < f; u += 3, d += 4)
        o[d] = h[u], o[d + 1] = h[u + 1], o[d + 2] = h[u + 2];
      else o.set(h.subarray(n, n + a), l);
    })(t >>> 0, e >>> 0);
  }, s.wbg.__wbg_copyrgb_d60ce17bb05d9b67 = function(t) {
    (function(i) {
      const { _destBuffer: n, _destOffset: a, _memoryArray: r } = Ce;
      n[a] = r[i], n[a + 1] = r[i + 1], n[a + 2] = r[i + 2];
    })(t >>> 0);
  }, s.wbg.__wbg_makecssRGB_893bf0cd9fdb302d = function(t) {
    (function(i) {
      const { _memoryArray: n } = Ce;
      Ce._cssColor = Ce._makeHexColor(n[i], n[i + 1], n[i + 2]);
    })(t >>> 0);
  }, s.wbg.__wbindgen_init_externref_table = function() {
    const t = li.__wbindgen_export_0, e = t.grow(4);
    t.set(0, void 0), t.set(e + 0, void 0), t.set(e + 1, null), t.set(e + 2, !0), t.set(e + 3, !1);
  }, s.wbg.__wbindgen_throw = function(t, e) {
    throw new Error(function(n, a) {
      return n >>>= 0, aA.decode(rA().subarray(n, n + a));
    }(t, e));
  }, s;
}
function NI(s, t) {
  return li = s.exports, Td = null, li.__wbindgen_start(), li;
}
var C9;
const Kd = class Kd {
  constructor(t, e) {
    this.name = t, this.numComps = e;
  }
  getRgb(t, e, i = new Uint8ClampedArray(3)) {
    return this.getRgbItem(t, e, i, 0), i;
  }
  getRgbHex(t, e) {
    const i = this.getRgb(t, e, g(Kd, C9));
    return se.makeHexColor(i[0], i[1], i[2]);
  }
  getRgbItem(t, e, i, n) {
    Wt("Should not call ColorSpace.getRgbItem");
  }
  getRgbBuffer(t, e, i, n, a, r, o) {
    Wt("Should not call ColorSpace.getRgbBuffer");
  }
  getOutputLength(t, e) {
    Wt("Should not call ColorSpace.getOutputLength");
  }
  isPassthrough(t) {
    return !1;
  }
  isDefaultDecode(t, e) {
    return Kd.isDefaultDecode(t, this.numComps);
  }
  fillRgb(t, e, i, n, a, r, o, l, c) {
    const h = e * i;
    let u = null;
    const f = 1 << o, d = i !== a || e !== n;
    if (this.isPassthrough(o)) u = l;
    else if (this.numComps === 1 && h > f && this.name !== "DeviceGray" && this.name !== "DeviceRGB") {
      const p = o <= 8 ? new Uint8Array(f) : new Uint16Array(f);
      for (let b = 0; b < f; b++) p[b] = b;
      const m = new Uint8ClampedArray(3 * f);
      if (this.getRgbBuffer(p, 0, f, m, 0, o, 0), d) {
        u = new Uint8Array(3 * h);
        let b = 0;
        for (let y = 0; y < h; ++y) {
          const v = 3 * l[y];
          u[b++] = m[v], u[b++] = m[v + 1], u[b++] = m[v + 2];
        }
      } else {
        let b = 0;
        for (let y = 0; y < h; ++y) {
          const v = 3 * l[y];
          t[b++] = m[v], t[b++] = m[v + 1], t[b++] = m[v + 2], b += c;
        }
      }
    } else d ? (u = new Uint8ClampedArray(3 * h), this.getRgbBuffer(l, 0, h, u, 0, o, 0)) : this.getRgbBuffer(l, 0, n * r, t, 0, o, c);
    if (u) if (d) (function(m, b, y, v, w, A, x) {
      x = x !== 1 ? 0 : x;
      const k = y / w, I = v / A;
      let T, E = 0;
      const M = new Uint16Array(w), F = 3 * y;
      for (let L = 0; L < w; L++) M[L] = 3 * Math.floor(L * k);
      for (let L = 0; L < A; L++) {
        const Y = Math.floor(L * I) * F;
        for (let B = 0; B < w; B++)
          T = Y + M[B], b[E++] = m[T++], b[E++] = m[T++], b[E++] = m[T++], E += x;
      }
    })(u, t, e, i, n, a, c);
    else {
      let p = 0, m = 0;
      for (let b = 0, y = n * r; b < y; b++)
        t[p++] = u[m++], t[p++] = u[m++], t[p++] = u[m++], p += c;
    }
  }
  get usesZeroToOneRange() {
    return gt(this, "usesZeroToOneRange", !0);
  }
  static isDefaultDecode(t, e) {
    if (!Array.isArray(t)) return !0;
    if (2 * e !== t.length)
      return D("The decode map is not the correct length"), !0;
    for (let i = 0, n = t.length; i < n; i += 2) if (t[i] !== 0 || t[i + 1] !== 1) return !1;
    return !0;
  }
};
C9 = new WeakMap(), _(Kd, C9, new Uint8ClampedArray(3));
let Us = Kd;
class BI extends Us {
  constructor(t, e, i) {
    super("Alternate", t), this.base = e, this.tintFn = i, this.tmpBuf = new Float32Array(e.numComps);
  }
  getRgbItem(t, e, i, n) {
    const a = this.tmpBuf;
    this.tintFn(t, e, a, 0), this.base.getRgbItem(a, 0, i, n);
  }
  getRgbBuffer(t, e, i, n, a, r, o) {
    const l = this.tintFn, c = this.base, h = 1 / ((1 << r) - 1), u = c.numComps, f = c.usesZeroToOneRange, d = (c.isPassthrough(8) || !f) && o === 0;
    let p = d ? a : 0;
    const m = d ? n : new Uint8ClampedArray(u * i), b = this.numComps, y = new Float32Array(b), v = new Float32Array(u);
    let w, A;
    for (w = 0; w < i; w++) {
      for (A = 0; A < b; A++) y[A] = t[e++] * h;
      if (l(y, 0, v, 0), f) for (A = 0; A < u; A++) m[p++] = 255 * v[A];
      else
        c.getRgbItem(v, 0, m, p), p += u;
    }
    d || c.getRgbBuffer(m, 0, i, n, a, 8, o);
  }
  getOutputLength(t, e) {
    return this.base.getOutputLength(t * this.base.numComps / this.numComps, e);
  }
}
class J8 extends Us {
  constructor(t) {
    super("Pattern", null), this.base = t;
  }
  isDefaultDecode(t, e) {
    Wt("Should not call PatternCS.isDefaultDecode");
  }
}
class LI extends Us {
  constructor(t, e, i) {
    super("Indexed", 1), this.base = t, this.highVal = e;
    const n = t.numComps * (e + 1);
    if (this.lookup = new Uint8Array(n), i instanceof Ot) {
      const a = i.getBytes(n);
      this.lookup.set(a);
    } else {
      if (typeof i != "string") throw new st(`IndexedCS - unrecognized lookup table: ${i}`);
      for (let a = 0; a < n; ++a) this.lookup[a] = 255 & i.charCodeAt(a);
    }
  }
  getRgbItem(t, e, i, n) {
    const { base: a, highVal: r, lookup: o } = this, l = Bs(Math.round(t[e]), 0, r) * a.numComps;
    a.getRgbBuffer(o, l, 1, i, n, 8, 0);
  }
  getRgbBuffer(t, e, i, n, a, r, o) {
    const { base: l, highVal: c, lookup: h } = this, { numComps: u } = l, f = l.getOutputLength(u, o);
    for (let d = 0; d < i; ++d) {
      const p = Bs(Math.round(t[e++]), 0, c) * u;
      l.getRgbBuffer(h, p, 1, n, a, 8, o), a += f;
    }
  }
  getOutputLength(t, e) {
    return this.base.getOutputLength(t * this.base.numComps, e);
  }
  isDefaultDecode(t, e) {
    return Array.isArray(t) ? t.length !== 2 ? (D("Decode map length is not correct"), !0) : !Number.isInteger(e) || e < 1 ? (D("Bits per component is not correct"), !0) : t[0] === 0 && t[1] === (1 << e) - 1 : !0;
  }
}
class OI extends Us {
  constructor() {
    super("DeviceGray", 1);
  }
  getRgbItem(t, e, i, n) {
    const a = 255 * t[e];
    i[n] = i[n + 1] = i[n + 2] = a;
  }
  getRgbBuffer(t, e, i, n, a, r, o) {
    const l = 255 / ((1 << r) - 1);
    let c = e, h = a;
    for (let u = 0; u < i; ++u) {
      const f = l * t[c++];
      n[h++] = f, n[h++] = f, n[h++] = f, h += o;
    }
  }
  getOutputLength(t, e) {
    return t * (3 + e);
  }
}
class UI extends Us {
  constructor() {
    super("DeviceRGB", 3);
  }
  getRgbItem(t, e, i, n) {
    i[n] = 255 * t[e], i[n + 1] = 255 * t[e + 1], i[n + 2] = 255 * t[e + 2];
  }
  getRgbBuffer(t, e, i, n, a, r, o) {
    if (r === 8 && o === 0) {
      n.set(t.subarray(e, e + 3 * i), a);
      return;
    }
    const l = 255 / ((1 << r) - 1);
    let c = e, h = a;
    for (let u = 0; u < i; ++u)
      n[h++] = l * t[c++], n[h++] = l * t[c++], n[h++] = l * t[c++], h += o;
  }
  getOutputLength(t, e) {
    return t * (3 + e) / 3 | 0;
  }
  isPassthrough(t) {
    return t === 8;
  }
}
class qI extends Us {
  constructor() {
    super("DeviceRGBA", 4);
  }
  getOutputLength(t, e) {
    return 4 * t;
  }
  isPassthrough(t) {
    return t === 8;
  }
  fillRgb(t, e, i, n, a, r, o, l, c) {
    i !== a || e !== n ? function(u, f, d, p, m, b, y) {
      const v = d / m, w = p / b;
      let A = 0;
      const x = new Uint16Array(m);
      if (y === 1) {
        for (let E = 0; E < m; E++) x[E] = Math.floor(E * v);
        const k = new Uint32Array(u.buffer), I = new Uint32Array(f.buffer), T = Ii.isLittleEndian ? 16777215 : 4294967040;
        for (let E = 0; E < b; E++) {
          const M = k.subarray(Math.floor(E * w) * d);
          for (let F = 0; F < m; F++) I[A++] |= M[x[F]] & T;
        }
      } else {
        const I = d * 4;
        for (let T = 0; T < m; T++) x[T] = Math.floor(T * v) * 4;
        for (let T = 0; T < b; T++) {
          const E = u.subarray(Math.floor(T * w) * I);
          for (let M = 0; M < m; M++) {
            const F = x[M];
            f[A++] = E[F], f[A++] = E[F + 1], f[A++] = E[F + 2];
          }
        }
      }
    }(l, t, e, i, n, a, c) : function(u, f, d) {
      if (d === 1) {
        const p = new Uint32Array(u.buffer), m = new Uint32Array(f.buffer), b = Ii.isLittleEndian ? 16777215 : 4294967040;
        for (let y = 0, v = p.length; y < v; y++) m[y] |= p[y] & b;
      } else {
        let p = 0;
        for (let m = 0, b = u.length; m < b; m += 4)
          f[p++] = u[m], f[p++] = u[m + 1], f[p++] = u[m + 2];
      }
    }(l, t, c);
  }
}
var Jf, W3;
class oA extends Us {
  constructor() {
    super("DeviceCMYK", 4);
    _(this, Jf);
  }
  getRgbItem(e, i, n, a) {
    C(this, Jf, W3).call(this, e, i, 1, n, a);
  }
  getRgbBuffer(e, i, n, a, r, o, l) {
    const c = 1 / ((1 << o) - 1);
    for (let h = 0; h < n; h++)
      C(this, Jf, W3).call(this, e, i, c, a, r), i += 4, r += 3 + l;
  }
  getOutputLength(e, i) {
    return e / 4 * (3 + i) | 0;
  }
}
Jf = new WeakSet(), W3 = function(e, i, n, a, r) {
  const o = e[i] * n, l = e[i + 1] * n, c = e[i + 2] * n, h = e[i + 3] * n;
  a[r] = 255 + o * (-4.387332384609988 * o + 54.48615194189176 * l + 18.82290502165302 * c + 212.25662451639585 * h - 285.2331026137004) + l * (1.7149763477362134 * l - 5.6096736904047315 * c + -17.873870861415444 * h - 5.497006427196366) + c * (-2.5217340131683033 * c - 21.248923337353073 * h + 17.5119270841813) + h * (-21.86122147463605 * h - 189.48180835922747), a[r + 1] = 255 + o * (8.841041422036149 * o + 60.118027045597366 * l + 6.871425592049007 * c + 31.159100130055922 * h - 79.2970844816548) + l * (-15.310361306967817 * l + 17.575251261109482 * c + 131.35250912493976 * h - 190.9453302588951) + c * (4.444339102852739 * c + 9.8632861493405 * h - 24.86741582555878) + h * (-20.737325471181034 * h - 187.80453709719578), a[r + 2] = 255 + o * (0.8842522430003296 * o + 8.078677503112928 * l + 30.89978309703729 * c - 0.23883238689178934 * h - 14.183576799673286) + l * (10.49593273432072 * l + 63.02378494754052 * c + 50.606957656360734 * h - 112.23884253719248) + c * (0.03296041114873217 * c + 115.60384449646641 * h - 193.58209356861505) + h * (-22.33816807309886 * h - 180.12613974708367);
};
var Zf, X3;
class jI extends Us {
  constructor(e, i, n) {
    super("CalGray", 1);
    _(this, Zf);
    if (!e) throw new st("WhitePoint missing - required for color space CalGray");
    if ([this.XW, this.YW, this.ZW] = e, [this.XB, this.YB, this.ZB] = i || [0, 0, 0], this.G = n || 1, this.XW < 0 || this.ZW < 0 || this.YW !== 1) throw new st(`Invalid WhitePoint components for ${this.name}, no fallback available`);
    (this.XB < 0 || this.YB < 0 || this.ZB < 0) && (qt(`Invalid BlackPoint for ${this.name}, falling back to default.`), this.XB = this.YB = this.ZB = 0), this.XB === 0 && this.YB === 0 && this.ZB === 0 || D(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`), this.G < 1 && (qt(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`), this.G = 1);
  }
  getRgbItem(e, i, n, a) {
    C(this, Zf, X3).call(this, e, i, n, a, 1);
  }
  getRgbBuffer(e, i, n, a, r, o, l) {
    const c = 1 / ((1 << o) - 1);
    for (let h = 0; h < n; ++h)
      C(this, Zf, X3).call(this, e, i, a, r, c), i += 1, r += 3 + l;
  }
  getOutputLength(e, i) {
    return e * (3 + i);
  }
}
Zf = new WeakSet(), X3 = function(e, i, n, a, r) {
  const o = (e[i] * r) ** this.G, l = this.YW * o, c = Math.max(295.8 * l ** 0.3333333333333333 - 40.8, 0);
  n[a] = c, n[a + 1] = c, n[a + 2] = c;
};
var Qf, t2, I9, _9, e2, p1, s2, T9, me, Lh, lA, cA, zg, Oh, hA, uA, dA, Y3;
const Fe = class Fe extends Us {
  constructor(e, i, n, a) {
    super("CalRGB", 3);
    _(this, me);
    if (!e) throw new st("WhitePoint missing - required for color space CalRGB");
    const [r, o, l] = this.whitePoint = e, [c, h, u] = this.blackPoint = i || new Float32Array(3);
    if ([this.GR, this.GG, this.GB] = n || new Float32Array([1, 1, 1]), [this.MXA, this.MYA, this.MZA, this.MXB, this.MYB, this.MZB, this.MXC, this.MYC, this.MZC] = a || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]), r < 0 || l < 0 || o !== 1) throw new st(`Invalid WhitePoint components for ${this.name}, no fallback available`);
    (c < 0 || h < 0 || u < 0) && (qt(`Invalid BlackPoint for ${this.name} [${c}, ${h}, ${u}], falling back to default.`), this.blackPoint = new Float32Array(3)), (this.GR < 0 || this.GG < 0 || this.GB < 0) && (qt(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`), this.GR = this.GG = this.GB = 1);
  }
  getRgbItem(e, i, n, a) {
    C(this, me, Y3).call(this, e, i, n, a, 1);
  }
  getRgbBuffer(e, i, n, a, r, o, l) {
    const c = 1 / ((1 << o) - 1);
    for (let h = 0; h < n; ++h)
      C(this, me, Y3).call(this, e, i, a, r, c), i += 3, r += 3 + l;
  }
  getOutputLength(e, i) {
    return e * (3 + i) / 3 | 0;
  }
};
Qf = new WeakMap(), t2 = new WeakMap(), I9 = new WeakMap(), _9 = new WeakMap(), e2 = new WeakMap(), p1 = new WeakMap(), s2 = new WeakMap(), T9 = new WeakMap(), me = new WeakSet(), Lh = function(e, i, n) {
  n[0] = e[0] * i[0] + e[1] * i[1] + e[2] * i[2], n[1] = e[3] * i[0] + e[4] * i[1] + e[5] * i[2], n[2] = e[6] * i[0] + e[7] * i[1] + e[8] * i[2];
}, lA = function(e, i, n) {
  n[0] = 1 * i[0] / e[0], n[1] = 1 * i[1] / e[1], n[2] = 1 * i[2] / e[2];
}, cA = function(e, i, n) {
  n[0] = 0.95047 * i[0] / e[0], n[1] = 1 * i[1] / e[1], n[2] = 1.08883 * i[2] / e[2];
}, zg = function(e) {
  return e <= 31308e-7 ? Bs(12.92 * e, 0, 1) : e >= 0.99554525 ? 1 : Bs(1.055 * e ** (1 / 2.4) - 0.055, 0, 1);
}, Oh = function(e) {
  return e < 0 ? -C(this, me, Oh).call(this, -e) : e > 8 ? ((e + 16) / 116) ** 3 : e * g(Fe, T9);
}, hA = function(e, i, n) {
  if (e[0] === 0 && e[1] === 0 && e[2] === 0) {
    n[0] = i[0], n[1] = i[1], n[2] = i[2];
    return;
  }
  const a = C(this, me, Oh).call(this, 0), r = (1 - a) / (1 - C(this, me, Oh).call(this, e[0])), o = 1 - r, l = (1 - a) / (1 - C(this, me, Oh).call(this, e[1])), c = 1 - l, h = (1 - a) / (1 - C(this, me, Oh).call(this, e[2])), u = 1 - h;
  n[0] = i[0] * r + o, n[1] = i[1] * l + c, n[2] = i[2] * h + u;
}, uA = function(e, i, n) {
  if (e[0] === 1 && e[2] === 1) {
    n[0] = i[0], n[1] = i[1], n[2] = i[2];
    return;
  }
  const a = n;
  C(this, me, Lh).call(this, g(Fe, Qf), i, a);
  const r = g(Fe, e2);
  C(this, me, lA).call(this, e, a, r), C(this, me, Lh).call(this, g(Fe, t2), r, n);
}, dA = function(e, i, n) {
  const a = n;
  C(this, me, Lh).call(this, g(Fe, Qf), i, a);
  const r = g(Fe, e2);
  C(this, me, cA).call(this, e, a, r), C(this, me, Lh).call(this, g(Fe, t2), r, n);
}, Y3 = function(e, i, n, a, r) {
  const o = Bs(e[i] * r, 0, 1), l = Bs(e[i + 1] * r, 0, 1), c = Bs(e[i + 2] * r, 0, 1), h = o === 1 ? 1 : o ** this.GR, u = l === 1 ? 1 : l ** this.GG, f = c === 1 ? 1 : c ** this.GB, d = this.MXA * h + this.MXB * u + this.MXC * f, p = this.MYA * h + this.MYB * u + this.MYC * f, m = this.MZA * h + this.MZB * u + this.MZC * f, b = g(Fe, p1);
  b[0] = d, b[1] = p, b[2] = m;
  const y = g(Fe, s2);
  C(this, me, uA).call(this, this.whitePoint, b, y);
  const v = g(Fe, p1);
  C(this, me, hA).call(this, this.blackPoint, y, v);
  const w = g(Fe, s2);
  C(this, me, dA).call(this, g(Fe, _9), v, w);
  const A = g(Fe, p1);
  C(this, me, Lh).call(this, g(Fe, I9), w, A), n[a] = 255 * C(this, me, zg).call(this, A[0]), n[a + 1] = 255 * C(this, me, zg).call(this, A[1]), n[a + 2] = 255 * C(this, me, zg).call(this, A[2]);
}, _(Fe, Qf, new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296])), _(Fe, t2, new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -85287e-7, 0.0400428, 0.9684867])), _(Fe, I9, new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.969266, 1.8760108, 0.041556, 0.0556434, -0.2040259, 1.0572252])), _(Fe, _9, new Float32Array([1, 1, 1])), _(Fe, e2, new Float32Array(3)), _(Fe, p1, new Float32Array(3)), _(Fe, s2, new Float32Array(3)), _(Fe, T9, (24 / 116) ** 3 / 8);
let K3 = Fe;
var en, Gg, Vg, J3;
class HI extends Us {
  constructor(e, i, n) {
    super("Lab", 3);
    _(this, en);
    if (!e) throw new st("WhitePoint missing - required for color space Lab");
    if ([this.XW, this.YW, this.ZW] = e, [this.amin, this.amax, this.bmin, this.bmax] = n || [-100, 100, -100, 100], [this.XB, this.YB, this.ZB] = i || [0, 0, 0], this.XW < 0 || this.ZW < 0 || this.YW !== 1) throw new st("Invalid WhitePoint components, no fallback available");
    (this.XB < 0 || this.YB < 0 || this.ZB < 0) && (qt("Invalid BlackPoint, falling back to default"), this.XB = this.YB = this.ZB = 0), (this.amin > this.amax || this.bmin > this.bmax) && (qt("Invalid Range, falling back to defaults"), this.amin = -100, this.amax = 100, this.bmin = -100, this.bmax = 100);
  }
  getRgbItem(e, i, n, a) {
    C(this, en, J3).call(this, e, i, !1, n, a);
  }
  getRgbBuffer(e, i, n, a, r, o, l) {
    const c = (1 << o) - 1;
    for (let h = 0; h < n; h++)
      C(this, en, J3).call(this, e, i, c, a, r), i += 3, r += 3 + l;
  }
  getOutputLength(e, i) {
    return e * (3 + i) / 3 | 0;
  }
  isDefaultDecode(e, i) {
    return !0;
  }
  get usesZeroToOneRange() {
    return gt(this, "usesZeroToOneRange", !1);
  }
}
en = new WeakSet(), Gg = function(e) {
  return e >= 6 / 29 ? e ** 3 : 108 / 841 * (e - 4 / 29);
}, Vg = function(e, i, n, a) {
  return n + e * (a - n) / i;
}, J3 = function(e, i, n, a, r) {
  let o = e[i], l = e[i + 1], c = e[i + 2];
  n !== !1 && (o = C(this, en, Vg).call(this, o, n, 0, 100), l = C(this, en, Vg).call(this, l, n, this.amin, this.amax), c = C(this, en, Vg).call(this, c, n, this.bmin, this.bmax)), l > this.amax ? l = this.amax : l < this.amin && (l = this.amin), c > this.bmax ? c = this.bmax : c < this.bmin && (c = this.bmin);
  const h = (o + 16) / 116, u = h + l / 500, f = h - c / 200, d = this.XW * C(this, en, Gg).call(this, u), p = this.YW * C(this, en, Gg).call(this, h), m = this.ZW * C(this, en, Gg).call(this, f);
  let b, y, v;
  this.ZW < 1 ? (b = 3.1339 * d + -1.617 * p + -0.4906 * m, y = -0.9785 * d + 1.916 * p + 0.0333 * m, v = 0.072 * d + -0.229 * p + 1.4057 * m) : (b = 3.2406 * d + -1.5372 * p + -0.4986 * m, y = -0.9689 * d + 1.8758 * p + 0.0415 * m, v = 0.0557 * d + -0.204 * p + 1.057 * m), a[r] = 255 * Math.sqrt(b), a[r + 1] = 255 * Math.sqrt(y), a[r + 2] = 255 * Math.sqrt(v);
};
function fA(s) {
  const t = new XMLHttpRequest();
  return t.open("GET", s, !1), t.responseType = "arraybuffer", t.send(null), t.response;
}
var Pa, Ko, m1, b1, E9;
const ql = class ql extends Us {
  constructor(e, i, n) {
    if (!ql.isUsable) throw new Error("No ICC color space support");
    super(i, n);
    _(this, Pa);
    _(this, Ko);
    let a;
    switch (n) {
      case 1:
        a = km.Gray8, S(this, Ko, (r, o, l) => function(h, u, f) {
          li.qcms_convert_one(h, u, f);
        }(g(this, Pa), 255 * r[o], l));
        break;
      case 3:
        a = km.RGB8, S(this, Ko, (r, o, l) => function(h, u, f, d, p) {
          li.qcms_convert_three(h, u, f, d, p);
        }(g(this, Pa), 255 * r[o], 255 * r[o + 1], 255 * r[o + 2], l));
        break;
      case 4:
        a = km.CMYK, S(this, Ko, (r, o, l) => function(h, u, f, d, p, m) {
          li.qcms_convert_four(h, u, f, d, p, m);
        }(g(this, Pa), 255 * r[o], 255 * r[o + 1], 255 * r[o + 2], 255 * r[o + 3], l));
        break;
      default:
        throw new Error(`Unsupported number of components: ${n}`);
    }
    if (S(this, Pa, function(o, l, c) {
      const h = Y8(o, li.__wbindgen_malloc), u = V3;
      return li.qcms_transformer_from_memory(h, u, l, c) >>> 0;
    }(e, a, PI.Perceptual)), !g(this, Pa)) throw new Error("Failed to create ICC color space");
    g(ql, E9).register(this, g(this, Pa));
  }
  getRgbHex(e, i) {
    return g(this, Ko).call(this, e, i, !0), Ce._cssColor;
  }
  getRgbItem(e, i, n, a) {
    Ce._destBuffer = n, Ce._destOffset = a, Ce._destLength = 3, g(this, Ko).call(this, e, i, !1), Ce._destBuffer = null;
  }
  getRgbBuffer(e, i, n, a, r, o, l) {
    if (e = e.subarray(i, i + n * this.numComps), o !== 8) {
      const c = 255 / ((1 << o) - 1);
      for (let h = 0, u = e.length; h < u; h++) e[h] *= c;
    }
    Ce._mustAddAlpha = l && a.buffer === e.buffer, Ce._destBuffer = a, Ce._destOffset = r, Ce._destLength = n * (3 + l), function(h, u) {
      const f = Y8(u, li.__wbindgen_malloc), d = V3;
      li.qcms_convert_array(h, f, d);
    }(g(this, Pa), e), Ce._mustAddAlpha = !1, Ce._destBuffer = null;
  }
  getOutputLength(e, i) {
    return e / this.numComps * (3 + i) | 0;
  }
  static setOptions({ useWasm: e, useWorkerFetch: i, wasmUrl: n }) {
    i ? (S(this, m1, e), S(this, b1, n)) : S(this, m1, !1);
  }
  static get isUsable() {
    let e = !1;
    if (g(this, m1)) if (g(this, b1)) try {
      this._module = function(n) {
        if (li !== void 0) return li;
        n !== void 0 && (Object.getPrototypeOf(n) === Object.prototype ? { module: n } = n : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
        const a = DI();
        return n instanceof WebAssembly.Module || (n = new WebAssembly.Module(n)), NI(new WebAssembly.Instance(n, a), n);
      }({ module: fA(`${g(this, b1)}qcms_bg.wasm`) }), e = !!this._module, Ce._memory = this._module.memory, Ce._makeHexColor = se.makeHexColor;
    } catch (i) {
      D(`ICCBased color space: "${i}".`);
    }
    else D("No ICC color space support due to missing `wasmUrl` API option");
    return gt(this, "isUsable", e);
  }
};
Pa = new WeakMap(), Ko = new WeakMap(), m1 = new WeakMap(), b1 = new WeakMap(), E9 = new WeakMap(), _(ql, m1, !0), _(ql, b1, null), _(ql, E9, new FinalizationRegistry((e) => {
  (function(n) {
    li.qcms_drop_transformer(n);
  })(e);
}));
let ch = ql;
var y1;
const M9 = class M9 extends ch {
  constructor() {
    super(new Uint8Array(fA(`${g(M9, y1)}CGATS001Compat-v2-micro.icc`)), "DeviceCMYK", 4);
  }
  static setOptions({ iccUrl: t }) {
    S(this, y1, t);
  }
  static get isUsable() {
    let t = !1;
    return ch.isUsable && (g(this, y1) ? t = !0 : D("No CMYK ICC profile support due to missing `iccUrl` API option")), gt(this, "isUsable", t);
  }
};
y1 = new WeakMap(), _(M9, y1);
let o0 = M9;
class Le extends Ot {
  constructor(t, e, i, n) {
    super(), this.bytes = t instanceof Uint8Array ? t : new Uint8Array(t), this.start = e || 0, this.pos = this.start, this.end = e + i || this.bytes.length, this.dict = n;
  }
  get length() {
    return this.end - this.start;
  }
  get isEmpty() {
    return this.length === 0;
  }
  getByte() {
    return this.pos >= this.end ? -1 : this.bytes[this.pos++];
  }
  getBytes(t) {
    const e = this.bytes, i = this.pos, n = this.end;
    if (!t) return e.subarray(i, n);
    let a = i + t;
    return a > n && (a = n), this.pos = a, e.subarray(i, a);
  }
  getByteRange(t, e) {
    return t < 0 && (t = 0), e > this.end && (e = this.end), this.bytes.subarray(t, e);
  }
  reset() {
    this.pos = this.start;
  }
  moveStart() {
    this.start = this.pos;
  }
  makeSubStream(t, e, i = null) {
    return new Le(this.bytes.buffer, t, e, i);
  }
}
class di extends Le {
  constructor(t) {
    super(Ns(t));
  }
}
class Z3 extends Le {
  constructor() {
    super(new Uint8Array(0));
  }
}
class $I extends Le {
  constructor(t, e, i) {
    super(new Uint8Array(t), 0, t, null), this.chunkSize = e, this._loadedChunks = /* @__PURE__ */ new Set(), this.numChunks = Math.ceil(t / e), this.manager = i, this.progressiveDataLength = 0, this.lastSuccessfulEnsureByteChunk = -1;
  }
  getMissingChunks() {
    const t = [];
    for (let e = 0, i = this.numChunks; e < i; ++e) this._loadedChunks.has(e) || t.push(e);
    return t;
  }
  get numChunksLoaded() {
    return this._loadedChunks.size;
  }
  get isDataLoaded() {
    return this.numChunksLoaded === this.numChunks;
  }
  onReceiveData(t, e) {
    const i = this.chunkSize;
    if (t % i != 0) throw new Error(`Bad begin offset: ${t}`);
    const n = t + e.byteLength;
    if (n % i != 0 && n !== this.bytes.length) throw new Error(`Bad end offset: ${n}`);
    this.bytes.set(new Uint8Array(e), t);
    const a = Math.floor(t / i), r = Math.floor((n - 1) / i) + 1;
    for (let o = a; o < r; ++o) this._loadedChunks.add(o);
  }
  onReceiveProgressiveData(t) {
    let e = this.progressiveDataLength;
    const i = Math.floor(e / this.chunkSize);
    this.bytes.set(new Uint8Array(t), e), e += t.byteLength, this.progressiveDataLength = e;
    const n = e >= this.end ? this.numChunks : Math.floor(e / this.chunkSize);
    for (let a = i; a < n; ++a) this._loadedChunks.add(a);
  }
  ensureByte(t) {
    if (t < this.progressiveDataLength) return;
    const e = Math.floor(t / this.chunkSize);
    if (!(e > this.numChunks) && e !== this.lastSuccessfulEnsureByteChunk) {
      if (!this._loadedChunks.has(e)) throw new ke(t, t + 1);
      this.lastSuccessfulEnsureByteChunk = e;
    }
  }
  ensureRange(t, e) {
    if (t >= e || e <= this.progressiveDataLength) return;
    const i = Math.floor(t / this.chunkSize);
    if (i > this.numChunks) return;
    const n = Math.min(Math.floor((e - 1) / this.chunkSize) + 1, this.numChunks);
    for (let a = i; a < n; ++a) if (!this._loadedChunks.has(a)) throw new ke(t, e);
  }
  nextEmptyChunk(t) {
    const e = this.numChunks;
    for (let i = 0; i < e; ++i) {
      const n = (t + i) % e;
      if (!this._loadedChunks.has(n)) return n;
    }
    return null;
  }
  hasChunk(t) {
    return this._loadedChunks.has(t);
  }
  getByte() {
    const t = this.pos;
    return t >= this.end ? -1 : (t >= this.progressiveDataLength && this.ensureByte(t), this.bytes[this.pos++]);
  }
  getBytes(t) {
    const e = this.bytes, i = this.pos, n = this.end;
    if (!t)
      return n > this.progressiveDataLength && this.ensureRange(i, n), e.subarray(i, n);
    let a = i + t;
    return a > n && (a = n), a > this.progressiveDataLength && this.ensureRange(i, a), this.pos = a, e.subarray(i, a);
  }
  getByteRange(t, e) {
    return t < 0 && (t = 0), e > this.end && (e = this.end), e > this.progressiveDataLength && this.ensureRange(t, e), this.bytes.subarray(t, e);
  }
  makeSubStream(t, e, i = null) {
    e ? t + e > this.progressiveDataLength && this.ensureRange(t, t + e) : t >= this.progressiveDataLength && this.ensureByte(t);
    function n() {
    }
    n.prototype = Object.create(this), n.prototype.getMissingChunks = function() {
      const r = this.chunkSize, o = Math.floor(this.start / r), l = Math.floor((this.end - 1) / r) + 1, c = [];
      for (let h = o; h < l; ++h) this._loadedChunks.has(h) || c.push(h);
      return c;
    }, Object.defineProperty(n.prototype, "isDataLoaded", { get() {
      return this.numChunksLoaded === this.numChunks || this.getMissingChunks().length === 0;
    }, configurable: !0 });
    const a = new n();
    return a.pos = a.start = t, a.end = t + e || this.end, a.dict = i, a;
  }
  getBaseStreams() {
    return [this];
  }
}
class zI {
  constructor(t, e) {
    this.length = e.length, this.chunkSize = e.rangeChunkSize, this.stream = new $I(this.length, this.chunkSize, this), this.pdfNetworkStream = t, this.disableAutoFetch = e.disableAutoFetch, this.msgHandler = e.msgHandler, this.currRequestId = 0, this._chunksNeededByRequest = /* @__PURE__ */ new Map(), this._requestsByChunk = /* @__PURE__ */ new Map(), this._promisesByRequest = /* @__PURE__ */ new Map(), this.progressiveDataLength = 0, this.aborted = !1, this._loadedStreamCapability = Promise.withResolvers();
  }
  sendRequest(t, e) {
    const i = this.pdfNetworkStream.getRangeReader(t, e);
    i.isStreamingSupported || (i.onProgress = this.onProgress.bind(this));
    let n = [], a = 0;
    return new Promise((r, o) => {
      const l = ({ value: c, done: h }) => {
        try {
          if (h) {
            const u = tA(n);
            n = null, r(u);
            return;
          }
          a += c.byteLength, i.isStreamingSupported && this.onProgress({ loaded: a }), n.push(c), i.read().then(l, o);
        } catch (u) {
          o(u);
        }
      };
      i.read().then(l, o);
    }).then((r) => {
      this.aborted || this.onReceiveData({ chunk: r, begin: t });
    });
  }
  requestAllChunks(t = !1) {
    if (!t) {
      const e = this.stream.getMissingChunks();
      this._requestChunks(e);
    }
    return this._loadedStreamCapability.promise;
  }
  _requestChunks(t) {
    const e = this.currRequestId++, i = /* @__PURE__ */ new Set();
    this._chunksNeededByRequest.set(e, i);
    for (const r of t) this.stream.hasChunk(r) || i.add(r);
    if (i.size === 0) return Promise.resolve();
    const n = Promise.withResolvers();
    this._promisesByRequest.set(e, n);
    const a = [];
    for (const r of i) {
      let o = this._requestsByChunk.get(r);
      o || (o = [], this._requestsByChunk.set(r, o), a.push(r)), o.push(e);
    }
    if (a.length > 0) {
      const r = this.groupChunks(a);
      for (const o of r) {
        const l = o.beginChunk * this.chunkSize, c = Math.min(o.endChunk * this.chunkSize, this.length);
        this.sendRequest(l, c).catch(n.reject);
      }
    }
    return n.promise.catch((r) => {
      if (!this.aborted) throw r;
    });
  }
  getStream() {
    return this.stream;
  }
  requestRange(t, e) {
    e = Math.min(e, this.length);
    const i = this.getBeginChunk(t), n = this.getEndChunk(e), a = [];
    for (let r = i; r < n; ++r) a.push(r);
    return this._requestChunks(a);
  }
  requestRanges(t = []) {
    const e = [];
    for (const i of t) {
      const n = this.getBeginChunk(i.begin), a = this.getEndChunk(i.end);
      for (let r = n; r < a; ++r) e.includes(r) || e.push(r);
    }
    return e.sort((i, n) => i - n), this._requestChunks(e);
  }
  groupChunks(t) {
    const e = [];
    let i = -1, n = -1;
    for (let a = 0, r = t.length; a < r; ++a) {
      const o = t[a];
      i < 0 && (i = o), n >= 0 && n + 1 !== o && (e.push({ beginChunk: i, endChunk: n + 1 }), i = o), a + 1 === t.length && e.push({ beginChunk: i, endChunk: o + 1 }), n = o;
    }
    return e;
  }
  onProgress(t) {
    this.msgHandler.send("DocProgress", { loaded: this.stream.numChunksLoaded * this.chunkSize + t.loaded, total: this.length });
  }
  onReceiveData(t) {
    const e = t.chunk, i = t.begin === void 0, n = i ? this.progressiveDataLength : t.begin, a = n + e.byteLength, r = Math.floor(n / this.chunkSize), o = a < this.length ? Math.floor(a / this.chunkSize) : Math.ceil(a / this.chunkSize);
    i ? (this.stream.onReceiveProgressiveData(e), this.progressiveDataLength = a) : this.stream.onReceiveData(n, e), this.stream.isDataLoaded && this._loadedStreamCapability.resolve(this.stream);
    const l = [];
    for (let c = r; c < o; ++c) {
      const h = this._requestsByChunk.get(c);
      if (h) {
        this._requestsByChunk.delete(c);
        for (const u of h) {
          const f = this._chunksNeededByRequest.get(u);
          f.has(c) && f.delete(c), f.size > 0 || l.push(u);
        }
      }
    }
    if (!this.disableAutoFetch && this._requestsByChunk.size === 0) {
      let c;
      if (this.stream.numChunksLoaded === 1) {
        const h = this.stream.numChunks - 1;
        this.stream.hasChunk(h) || (c = h);
      } else c = this.stream.nextEmptyChunk(o);
      Number.isInteger(c) && this._requestChunks([c]);
    }
    for (const c of l) {
      const h = this._promisesByRequest.get(c);
      this._promisesByRequest.delete(c), h.resolve();
    }
    this.msgHandler.send("DocProgress", { loaded: this.stream.numChunksLoaded * this.chunkSize, total: this.length });
  }
  onError(t) {
    this._loadedStreamCapability.reject(t);
  }
  getBeginChunk(t) {
    return Math.floor(t / this.chunkSize);
  }
  getEndChunk(t) {
    return Math.floor((t - 1) / this.chunkSize) + 1;
  }
  abort(t) {
    var e;
    this.aborted = !0, (e = this.pdfNetworkStream) == null || e.cancelAllRequests(t);
    for (const i of this._promisesByRequest.values()) i.reject(t);
  }
}
function gA(s) {
  switch (s.kind) {
    case yp:
      return Q3(s);
    case Od:
      return function({ src: e, srcPos: i = 0, dest: n, destPos: a = 0, width: r, height: o }) {
        let l = 0;
        const c = r * o * 3, h = c >> 2, u = new Uint32Array(e.buffer, i, h);
        if (Ii.isLittleEndian) {
          for (; l < h - 2; l += 3, a += 4) {
            const f = u[l], d = u[l + 1], p = u[l + 2];
            n[a] = 4278190080 | f, n[a + 1] = f >>> 24 | d << 8 | 4278190080, n[a + 2] = d >>> 16 | p << 16 | 4278190080, n[a + 3] = p >>> 8 | 4278190080;
          }
          for (let f = 4 * l, d = i + c; f < d; f += 3) n[a++] = e[f] | e[f + 1] << 8 | e[f + 2] << 16 | 4278190080;
        } else {
          for (; l < h - 2; l += 3, a += 4) {
            const f = u[l], d = u[l + 1], p = u[l + 2];
            n[a] = 255 | f, n[a + 1] = f << 24 | d >>> 8 | 255, n[a + 2] = d << 16 | p >>> 16 | 255, n[a + 3] = p << 8 | 255;
          }
          for (let f = 4 * l, d = i + c; f < d; f += 3) n[a++] = e[f] << 24 | e[f + 1] << 16 | e[f + 2] << 8 | 255;
        }
        return { srcPos: i + c, destPos: a };
      }(s);
  }
  return null;
}
function Q3({ src: s, srcPos: t = 0, dest: e, width: i, height: n, nonBlackColor: a = 4294967295, inverseDecode: r = !1 }) {
  const o = Ii.isLittleEndian ? 4278190080 : 255, [l, c] = r ? [a, o] : [o, a], h = i >> 3, u = 7 & i, f = s.length;
  e = new Uint32Array(e.buffer);
  let d = 0;
  for (let p = 0; p < n; p++) {
    for (const b = t + h; t < b; t++) {
      const y = t < f ? s[t] : 255;
      e[d++] = 128 & y ? c : l, e[d++] = 64 & y ? c : l, e[d++] = 32 & y ? c : l, e[d++] = 16 & y ? c : l, e[d++] = 8 & y ? c : l, e[d++] = 4 & y ? c : l, e[d++] = 2 & y ? c : l, e[d++] = 1 & y ? c : l;
    }
    if (u === 0) continue;
    const m = t < f ? s[t++] : 255;
    for (let b = 0; b < u; b++) e[d++] = m & 1 << 7 - b ? c : l;
  }
  return { srcPos: t, destPos: d };
}
var pn, i2, F9, pA;
const lo = class lo {
  constructor(t, e) {
    _(this, F9);
    this._imgData = t, this._isMask = e;
  }
  static get canUseImageDecoder() {
    return gt(this, "canUseImageDecoder", g(this, i2) ? ImageDecoder.isTypeSupported("image/bmp") : Promise.resolve(!1));
  }
  static needsToBeResized(t, e) {
    if (t <= g(this, pn) && e <= g(this, pn)) return !1;
    const { MAX_DIM: i } = this;
    if (t > i || e > i) return !0;
    const n = t * e;
    return this._hasMaxArea ? n > this.MAX_AREA : n < g(this, pn) ** 2 ? !1 : this._areGoodDims(t, e) ? (S(this, pn, Math.max(g(this, pn), Math.floor(Math.sqrt(t * e)))), !1) : (S(this, pn, this._guessMax(g(this, pn), i, 128, 0)), n > (this.MAX_AREA = g(this, pn) ** 2));
  }
  static getReducePowerForJPX(t, e, i) {
    const n = t * e, a = 2 ** 30 / (4 * i);
    if (!this.needsToBeResized(t, e)) return n > a ? Math.ceil(Math.log2(n / a)) : 0;
    const { MAX_DIM: r, MAX_AREA: o } = this, l = Math.max(t / r, e / r, Math.sqrt(n / Math.min(a, o)));
    return Math.ceil(Math.log2(l));
  }
  static get MAX_DIM() {
    return gt(this, "MAX_DIM", this._guessMax(2048, 65537, 0, 1));
  }
  static get MAX_AREA() {
    return this._hasMaxArea = !0, gt(this, "MAX_AREA", this._guessMax(g(this, pn), this.MAX_DIM, 128, 0) ** 2);
  }
  static set MAX_AREA(t) {
    t >= 0 && (this._hasMaxArea = !0, gt(this, "MAX_AREA", t));
  }
  static setOptions({ canvasMaxAreaInBytes: t = -1, isImageDecoderSupported: e = !1 }) {
    this._hasMaxArea || (this.MAX_AREA = t >> 2), S(this, i2, e);
  }
  static _areGoodDims(t, e) {
    try {
      const i = new OffscreenCanvas(t, e), n = i.getContext("2d");
      n.fillRect(0, 0, 1, 1);
      const a = n.getImageData(0, 0, 1, 1).data[3];
      return i.width = i.height = 1, a !== 0;
    } catch {
      return !1;
    }
  }
  static _guessMax(t, e, i, n) {
    for (; t + i + 1 < e; ) {
      const a = Math.floor((t + e) / 2), r = n || a;
      this._areGoodDims(a, r) ? t = a : e = a;
    }
    return t;
  }
  static async createImage(t, e = !1) {
    return new lo(t, e)._createImage();
  }
  async _createImage() {
    const { _imgData: t } = this, { width: e, height: i } = t;
    if (e * i * 4 > U3) {
      const v = C(this, F9, pA).call(this);
      if (v) return v;
    }
    const n = this._encodeBMP();
    let a, r;
    await lo.canUseImageDecoder ? (a = new ImageDecoder({ data: n, type: "image/bmp", preferAnimation: !1, transfer: [n.buffer] }), r = a.decode().catch((v) => (D(`BMP image decoding failed: ${v}`), createImageBitmap(new Blob([this._encodeBMP().buffer], { type: "image/bmp" })))).finally(() => {
      a.close();
    })) : r = createImageBitmap(new Blob([n.buffer], { type: "image/bmp" }));
    const { MAX_AREA: o, MAX_DIM: l } = lo, c = Math.max(e / l, i / l, Math.sqrt(e * i / o)), h = Math.max(c, 2), u = Math.round(10 * (c + 1.25)) / 10 / h, f = Math.floor(Math.log2(u)), d = new Array(f + 2).fill(2);
    d[0] = h, d.splice(-1, 1, u / (1 << f));
    let p = e, m = i;
    const b = await r;
    let y = b.image || b;
    for (const v of d) {
      const w = p, A = m;
      p = Math.floor(p / v) - 1, m = Math.floor(m / v) - 1;
      const x = new OffscreenCanvas(p, m);
      x.getContext("2d").drawImage(y, 0, 0, w, A, 0, 0, p, m), y.close(), y = x.transferToImageBitmap();
    }
    return t.data = null, t.bitmap = y, t.width = p, t.height = m, t;
  }
  _encodeBMP() {
    const { width: t, height: e, kind: i } = this._imgData;
    let n, a = this._imgData.data, r = new Uint8Array(0), o = r, l = 0;
    switch (i) {
      case yp: {
        n = 1, r = new Uint8Array(this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255]);
        const m = t + 7 >> 3, b = m + 3 & -4;
        if (m !== b) {
          const y = new Uint8Array(b * e);
          let v = 0;
          for (let w = 0, A = e * m; w < A; w += m, v += b) y.set(a.subarray(w, w + m), v);
          a = y;
        }
        break;
      }
      case Od:
        if (n = 24, 3 & t) {
          const m = 3 * t, b = m + 3 & -4, y = b - m, v = new Uint8Array(b * e);
          let w = 0;
          for (let A = 0, x = e * m; A < x; A += m) {
            const k = a.subarray(A, A + m);
            for (let I = 0; I < m; I += 3)
              v[w++] = k[I + 2], v[w++] = k[I + 1], v[w++] = k[I];
            w += y;
          }
          a = v;
        } else for (let m = 0, b = a.length; m < b; m += 3) {
          const y = a[m];
          a[m] = a[m + 2], a[m + 2] = y;
        }
        break;
      case sr:
        n = 32, l = 3, o = new Uint8Array(68);
        const p = new DataView(o.buffer);
        Ii.isLittleEndian ? (p.setUint32(0, 255, !0), p.setUint32(4, 65280, !0), p.setUint32(8, 16711680, !0), p.setUint32(12, 4278190080, !0)) : (p.setUint32(0, 4278190080, !0), p.setUint32(4, 16711680, !0), p.setUint32(8, 65280, !0), p.setUint32(12, 255, !0));
        break;
      default:
        throw new Error("invalid format");
    }
    let c = 0;
    const h = 40 + o.length, u = 14 + h + r.length + a.length, f = new Uint8Array(u), d = new DataView(f.buffer);
    return d.setUint16(c, 19778, !0), c += 2, d.setUint32(c, u, !0), c += 4, d.setUint32(c, 0, !0), c += 4, d.setUint32(c, 14 + h + r.length, !0), c += 4, d.setUint32(c, h, !0), c += 4, d.setInt32(c, t, !0), c += 4, d.setInt32(c, -e, !0), c += 4, d.setUint16(c, 1, !0), c += 2, d.setUint16(c, n, !0), c += 2, d.setUint32(c, l, !0), c += 4, d.setUint32(c, 0, !0), c += 4, d.setInt32(c, 0, !0), c += 4, d.setInt32(c, 0, !0), c += 4, d.setUint32(c, r.length / 4, !0), c += 4, d.setUint32(c, 0, !0), c += 4, f.set(o, c), c += o.length, f.set(r, c), c += r.length, f.set(a, c), f;
  }
};
pn = new WeakMap(), i2 = new WeakMap(), F9 = new WeakSet(), pA = function() {
  const { _imgData: t } = this, { data: e, width: i, height: n, kind: a } = t, r = i * n * 4, o = Math.ceil(Math.log2(r / U3)), l = i >> o, c = n >> o;
  let h, u = n;
  try {
    h = new Uint8Array(r);
  } catch {
    let w = Math.floor(Math.log2(r + 1));
    for (; ; ) try {
      h = new Uint8Array(2 ** w - 1);
      break;
    } catch {
      w -= 1;
    }
    u = Math.floor((2 ** w - 1) / (4 * i));
    const A = i * u * 4;
    A < h.length && (h = new Uint8Array(A));
  }
  const f = new Uint32Array(h.buffer), d = new Uint32Array(l * c);
  let p = 0, m = 0;
  const b = Math.ceil(n / u), y = n % u == 0 ? n : n % u;
  for (let w = 0; w < b; w++) {
    const A = w < b - 1 ? u : y;
    ({ srcPos: p } = gA({ kind: a, src: e, dest: f, width: i, height: A, inverseDecode: this._isMask, srcPos: p }));
    for (let x = 0, k = A >> o; x < k; x++) {
      const I = f.subarray((x << o) * i);
      for (let T = 0; T < l; T++) d[m++] = I[T << o];
    }
  }
  if (lo.needsToBeResized(l, c))
    return t.data = d, t.width = l, t.height = c, t.kind = sr, null;
  const v = new OffscreenCanvas(l, c);
  return v.getContext("2d", { willReadFrequently: !0 }).putImageData(new ImageData(new Uint8ClampedArray(d.buffer), l, c), 0, 0), t.data = null, t.bitmap = v.transferToImageBitmap(), t.width = l, t.height = c, t;
}, _(lo, pn, 2048), _(lo, i2, Ii.isImageDecoderSupported);
let Bn = lo;
const GI = new Uint8Array(0);
class fi extends Ot {
  constructor(t) {
    if (super(), this._rawMinBufferLength = t || 0, this.pos = 0, this.bufferLength = 0, this.eof = !1, this.buffer = GI, this.minBufferLength = 512, t) for (; this.minBufferLength < t; ) this.minBufferLength *= 2;
  }
  get isEmpty() {
    for (; !this.eof && this.bufferLength === 0; ) this.readBlock();
    return this.bufferLength === 0;
  }
  ensureBuffer(t) {
    const e = this.buffer;
    if (t <= e.byteLength) return e;
    let i = this.minBufferLength;
    for (; i < t; ) i *= 2;
    const n = new Uint8Array(i);
    return n.set(e), this.buffer = n;
  }
  getByte() {
    const t = this.pos;
    for (; this.bufferLength <= t; ) {
      if (this.eof) return -1;
      this.readBlock();
    }
    return this.buffer[this.pos++];
  }
  getBytes(t, e = null) {
    const i = this.pos;
    let n;
    if (t) {
      for (this.ensureBuffer(i + t), n = i + t; !this.eof && this.bufferLength < n; ) this.readBlock(e);
      const a = this.bufferLength;
      n > a && (n = a);
    } else {
      for (; !this.eof; ) this.readBlock(e);
      n = this.bufferLength;
    }
    return this.pos = n, this.buffer.subarray(i, n);
  }
  async getImageData(t, e) {
    if (!this.canAsyncDecodeImageFromBuffer) return this.isAsyncDecoder ? this.decodeImage(null, e) : this.getBytes(t, e);
    const i = await this.stream.asyncGetBytes();
    return this.decodeImage(i, e);
  }
  reset() {
    this.pos = 0;
  }
  makeSubStream(t, e, i = null) {
    if (e === void 0) for (; !this.eof; ) this.readBlock();
    else {
      const n = t + e;
      for (; this.bufferLength <= n && !this.eof; ) this.readBlock();
    }
    return new Le(this.buffer, t, e, i);
  }
  getBaseStreams() {
    return this.str ? this.str.getBaseStreams() : null;
  }
}
class VI extends fi {
  constructor(t, e = null) {
    t = t.filter((n) => n instanceof Ot);
    let i = 0;
    for (const n of t) i += n instanceof fi ? n._rawMinBufferLength : n.length;
    super(i), this.streams = t, this._onError = e;
  }
  readBlock() {
    var r;
    const t = this.streams;
    if (t.length === 0) {
      this.eof = !0;
      return;
    }
    const e = t.shift();
    let i;
    try {
      i = e.getBytes();
    } catch (o) {
      if (this._onError) {
        this._onError(o, (r = e.dict) == null ? void 0 : r.objId);
        return;
      }
      throw o;
    }
    const n = this.bufferLength, a = n + i.length;
    this.ensureBuffer(a).set(i, n), this.bufferLength = a;
  }
  getBaseStreams() {
    const t = [];
    for (const e of this.streams) {
      const i = e.getBaseStreams();
      i && t.push(...i);
    }
    return t.length > 0 ? t : null;
  }
}
var sa, Ed, Wg;
class te {
  static parse({ cs: t, xref: e, resources: i = null, pdfFunctionFactory: n, globalColorSpaceCache: a, localColorSpaceCache: r, asyncIfNotCached: o = !1 }) {
    const l = { xref: e, resources: i, pdfFunctionFactory: n, globalColorSpaceCache: a, localColorSpaceCache: r };
    let c, h, u;
    if (t instanceof yt) {
      h = t;
      const f = a.getByRef(h) || r.getByRef(h);
      if (f) return f;
      t = e.fetch(t);
    }
    if (t instanceof Z) {
      c = t.name;
      const f = r.getByName(c);
      if (f) return f;
    }
    try {
      u = C(this, sa, Wg).call(this, t, l);
    } catch (f) {
      if (o && !(f instanceof ke)) return Promise.reject(f);
      throw f;
    }
    return (c || h) && (r.set(c, h, u), h && a.set(null, h, u)), o ? Promise.resolve(u) : u;
  }
  static get gray() {
    return gt(this, "gray", new OI());
  }
  static get rgb() {
    return gt(this, "rgb", new UI());
  }
  static get rgba() {
    return gt(this, "rgba", new qI());
  }
  static get cmyk() {
    if (o0.isUsable) try {
      return gt(this, "cmyk", new o0());
    } catch {
      D("CMYK fallback: DeviceCMYK");
    }
    return gt(this, "cmyk", new oA());
  }
}
sa = new WeakSet(), Ed = function(t, e) {
  const { globalColorSpaceCache: i } = e;
  let n;
  if (t instanceof yt) {
    n = t;
    const r = i.getByRef(n);
    if (r) return r;
  }
  const a = C(this, sa, Wg).call(this, t, e);
  return n && i.set(null, n, a), a;
}, Wg = function(t, e) {
  const { xref: i, resources: n, pdfFunctionFactory: a, globalColorSpaceCache: r } = e;
  if ((t = i.fetchIfRef(t)) instanceof Z) switch (t.name) {
    case "G":
    case "DeviceGray":
      return this.gray;
    case "RGB":
    case "DeviceRGB":
      return this.rgb;
    case "DeviceRGBA":
      return this.rgba;
    case "CMYK":
    case "DeviceCMYK":
      return this.cmyk;
    case "Pattern":
      return new J8(null);
    default:
      if (n instanceof q) {
        const o = n.get("ColorSpace");
        if (o instanceof q) {
          const l = o.get(t.name);
          if (l) {
            if (l instanceof Z) return C(this, sa, Wg).call(this, l, e);
            t = l;
            break;
          }
        }
      }
      return D(`Unrecognized ColorSpace: ${t.name}`), this.gray;
  }
  if (Array.isArray(t)) {
    const o = i.fetchIfRef(t[0]).name;
    let l, c, h, u, f, d;
    switch (o) {
      case "G":
      case "DeviceGray":
        return this.gray;
      case "RGB":
      case "DeviceRGB":
        return this.rgb;
      case "CMYK":
      case "DeviceCMYK":
        return this.cmyk;
      case "CalGray":
        return l = i.fetchIfRef(t[1]), u = l.getArray("WhitePoint"), f = l.getArray("BlackPoint"), d = l.get("Gamma"), new jI(u, f, d);
      case "CalRGB":
        l = i.fetchIfRef(t[1]), u = l.getArray("WhitePoint"), f = l.getArray("BlackPoint"), d = l.getArray("Gamma");
        const p = l.getArray("Matrix");
        return new K3(u, f, d, p);
      case "ICCBased":
        const m = t[1] instanceof yt;
        if (m) {
          const T = r.getByRef(t[1]);
          if (T) return T;
        }
        const b = i.fetchIfRef(t[1]), y = b.dict;
        if (c = y.get("N"), ch.isUsable) try {
          const T = new ch(b.getBytes(), "ICCBased", c);
          return m && r.set(null, t[1], T), T;
        } catch (T) {
          if (T instanceof ke) throw T;
          D(`ICCBased color space (${t[1]}): "${T}".`);
        }
        const v = y.getRaw("Alternate");
        if (v) {
          const T = C(this, sa, Ed).call(this, v, e);
          if (T.numComps === c) return T;
          D("ICCBased color space: Ignoring incorrect /Alternate entry.");
        }
        if (c === 1) return this.gray;
        if (c === 3) return this.rgb;
        if (c === 4) return this.cmyk;
        break;
      case "Pattern":
        return h = t[1] || null, h && (h = C(this, sa, Ed).call(this, h, e)), new J8(h);
      case "I":
      case "Indexed":
        h = C(this, sa, Ed).call(this, t[1], e);
        const w = Bs(i.fetchIfRef(t[2]), 0, 255), A = i.fetchIfRef(t[3]);
        return new LI(h, w, A);
      case "Separation":
      case "DeviceN":
        const x = i.fetchIfRef(t[1]);
        c = Array.isArray(x) ? x.length : 1, h = C(this, sa, Ed).call(this, t[2], e);
        const k = a.create(t[3]);
        return new BI(c, h, k);
      case "Lab":
        l = i.fetchIfRef(t[1]), u = l.getArray("WhitePoint"), f = l.getArray("BlackPoint");
        const I = l.getArray("Range");
        return new HI(u, f, I);
      default:
        return D(`Unimplemented ColorSpace object: ${o}`), this.gray;
    }
  }
  return D(`Unrecognized ColorSpace object: ${t}`), this.gray;
}, _(te, sa);
class mn extends gi {
  constructor(t) {
    super(t, "JpegError");
  }
}
class t6 extends gi {
  constructor(t, e) {
    super(t, "DNLMarkerError"), this.scanLines = e;
  }
}
class mA extends gi {
  constructor(t) {
    super(t, "EOIMarkerError");
  }
}
const qd = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]), $2 = 4017, z2 = 799, G2 = 3406, V2 = 2276, W2 = 1567, X2 = 3784, Ah = 5793, K2 = 2896;
function WI(s, t) {
  let e, i, n = 0, a = 16;
  for (; a > 0 && !s[a - 1]; ) a--;
  const r = [{ children: [], index: 0 }];
  let o, l = r[0];
  for (e = 0; e < a; e++) {
    for (i = 0; i < s[e]; i++) {
      for (l = r.pop(), l.children[l.index] = t[n]; l.index > 0; ) l = r.pop();
      for (l.index++, r.push(l); r.length <= e; )
        r.push(o = { children: [], index: 0 }), l.children[l.index] = o.children, l = o;
      n++;
    }
    e + 1 < a && (r.push(o = { children: [], index: 0 }), l.children[l.index] = o.children, l = o);
  }
  return r[0].children;
}
function e6(s, t, e) {
  return 64 * ((s.blocksPerLine + 1) * t + e);
}
function XI(s, t, e, i, n, a, r, o, l, c = !1) {
  const h = e.mcusPerLine, u = e.progressive, f = t;
  let d = 0, p = 0;
  function m() {
    if (p > 0)
      return p--, d >> p & 1;
    if (d = s[t++], d === 255) {
      const V = s[t++];
      if (V) {
        if (V === 220 && c) {
          const X = $t(s, t += 2);
          if (t += 2, X > 0 && X !== e.scanLines) throw new t6("Found DNL marker (0xFFDC) while parsing scan data", X);
        } else if (V === 217) {
          if (c) {
            const X = k * (e.precision === 8 ? 8 : 0);
            if (X > 0 && Math.round(e.scanLines / X) >= 5) throw new t6("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter", X);
          }
          throw new mA("Found EOI marker (0xFFD9) while parsing scan data");
        }
        throw new mn(`unexpected marker ${(d << 8 | V).toString(16)}`);
      }
    }
    return p = 7, d >>> 7;
  }
  function b(V) {
    let X = V;
    for (; ; ) {
      switch (X = X[m()], typeof X) {
        case "number":
          return X;
        case "object":
          continue;
      }
      throw new mn("invalid huffman sequence");
    }
  }
  function y(V) {
    let X = 0;
    for (; V > 0; )
      X = X << 1 | m(), V--;
    return X;
  }
  function v(V) {
    if (V === 1) return m() === 1 ? 1 : -1;
    const X = y(V);
    return X >= 1 << V - 1 ? X : X + (-1 << V) + 1;
  }
  let w = 0, A, x = 0, k = 0;
  function I(V, X, z, K, W) {
    const rt = z % h;
    k = (z / h | 0) * V.v + K;
    const $ = rt * V.h + W;
    X(V, e6(V, k, $));
  }
  function T(V, X, z) {
    k = z / V.blocksPerLine | 0;
    const K = z % V.blocksPerLine;
    X(V, e6(V, k, K));
  }
  const E = i.length;
  let M, F, L, Y, B, et;
  et = u ? a === 0 ? o === 0 ? function(X, z) {
    const K = b(X.huffmanTableDC), W = K === 0 ? 0 : v(K) << l;
    X.blockData[z] = X.pred += W;
  } : function(X, z) {
    X.blockData[z] |= m() << l;
  } : o === 0 ? function(X, z) {
    if (w > 0) {
      w--;
      return;
    }
    let K = a;
    const W = r;
    for (; K <= W; ) {
      const rt = b(X.huffmanTableAC), $ = 15 & rt, nt = rt >> 4;
      if ($ === 0) {
        if (nt < 15) {
          w = y(nt) + (1 << nt) - 1;
          break;
        }
        K += 16;
        continue;
      }
      K += nt;
      const wt = qd[K];
      X.blockData[z + wt] = v($) * (1 << l), K++;
    }
  } : function(X, z) {
    let K = a;
    const W = r;
    let rt, $, nt = 0;
    for (; K <= W; ) {
      const wt = z + qd[K], O = X.blockData[wt] < 0 ? -1 : 1;
      switch (x) {
        case 0:
          if ($ = b(X.huffmanTableAC), rt = 15 & $, nt = $ >> 4, rt === 0) nt < 15 ? (w = y(nt) + (1 << nt), x = 4) : (nt = 16, x = 1);
          else {
            if (rt !== 1) throw new mn("invalid ACn encoding");
            A = v(rt), x = nt ? 2 : 3;
          }
          continue;
        case 1:
        case 2:
          X.blockData[wt] ? X.blockData[wt] += O * (m() << l) : (nt--, nt === 0 && (x = x === 2 ? 3 : 0));
          break;
        case 3:
          X.blockData[wt] ? X.blockData[wt] += O * (m() << l) : (X.blockData[wt] = A << l, x = 0);
          break;
        case 4:
          X.blockData[wt] && (X.blockData[wt] += O * (m() << l));
      }
      K++;
    }
    x === 4 && (w--, w === 0 && (x = 0));
  } : function(X, z) {
    const K = b(X.huffmanTableDC), W = K === 0 ? 0 : v(K);
    X.blockData[z] = X.pred += W;
    let rt = 1;
    for (; rt < 64; ) {
      const $ = b(X.huffmanTableAC), nt = 15 & $, wt = $ >> 4;
      if (nt === 0) {
        if (wt < 15) break;
        rt += 16;
        continue;
      }
      rt += wt;
      const O = qd[rt];
      X.blockData[z + O] = v(nt), rt++;
    }
  };
  let H, P = 0;
  const G = E === 1 ? i[0].blocksPerLine * i[0].blocksPerColumn : h * e.mcusPerColumn;
  let N, j;
  for (; P <= G; ) {
    const V = n ? Math.min(G - P, n) : G;
    if (V > 0) {
      for (F = 0; F < E; F++) i[F].pred = 0;
      if (w = 0, E === 1)
        for (M = i[0], B = 0; B < V; B++)
          T(M, et, P), P++;
      else for (B = 0; B < V; B++) {
        for (F = 0; F < E; F++)
          for (M = i[F], N = M.h, j = M.v, L = 0; L < j; L++) for (Y = 0; Y < N; Y++) I(M, et, P, L, Y);
        P++;
      }
    }
    if (p = 0, H = Y9(s, t), !H || (H.invalid && (D(`decodeScan - ${V > 0 ? "unexpected" : "excessive"} MCU data, current marker is: ${H.invalid}`), t = H.offset), !(H.marker >= 65488 && H.marker <= 65495))) break;
    t += 2;
  }
  return t - f;
}
function KI(s, t, e) {
  const i = s.quantizationTable, n = s.blockData;
  let a, r, o, l, c, h, u, f, d, p, m, b, y, v, w, A, x;
  if (!i) throw new mn("missing required Quantization Table.");
  for (let k = 0; k < 64; k += 8)
    d = n[t + k], p = n[t + k + 1], m = n[t + k + 2], b = n[t + k + 3], y = n[t + k + 4], v = n[t + k + 5], w = n[t + k + 6], A = n[t + k + 7], d *= i[k], p | m | b | y | v | w | A ? (p *= i[k + 1], m *= i[k + 2], b *= i[k + 3], y *= i[k + 4], v *= i[k + 5], w *= i[k + 6], A *= i[k + 7], a = Ah * d + 128 >> 8, r = Ah * y + 128 >> 8, o = m, l = w, c = K2 * (p - A) + 128 >> 8, f = K2 * (p + A) + 128 >> 8, h = b << 4, u = v << 4, a = a + r + 1 >> 1, r = a - r, x = o * X2 + l * W2 + 128 >> 8, o = o * W2 - l * X2 + 128 >> 8, l = x, c = c + u + 1 >> 1, u = c - u, f = f + h + 1 >> 1, h = f - h, a = a + l + 1 >> 1, l = a - l, r = r + o + 1 >> 1, o = r - o, x = c * V2 + f * G2 + 2048 >> 12, c = c * G2 - f * V2 + 2048 >> 12, f = x, x = h * z2 + u * $2 + 2048 >> 12, h = h * $2 - u * z2 + 2048 >> 12, u = x, e[k] = a + f, e[k + 7] = a - f, e[k + 1] = r + u, e[k + 6] = r - u, e[k + 2] = o + h, e[k + 5] = o - h, e[k + 3] = l + c, e[k + 4] = l - c) : (x = Ah * d + 512 >> 10, e[k] = x, e[k + 1] = x, e[k + 2] = x, e[k + 3] = x, e[k + 4] = x, e[k + 5] = x, e[k + 6] = x, e[k + 7] = x);
  for (let k = 0; k < 8; ++k)
    d = e[k], p = e[k + 8], m = e[k + 16], b = e[k + 24], y = e[k + 32], v = e[k + 40], w = e[k + 48], A = e[k + 56], p | m | b | y | v | w | A ? (a = Ah * d + 2048 >> 12, r = Ah * y + 2048 >> 12, o = m, l = w, c = K2 * (p - A) + 2048 >> 12, f = K2 * (p + A) + 2048 >> 12, h = b, u = v, a = 4112 + (a + r + 1 >> 1), r = a - r, x = o * X2 + l * W2 + 2048 >> 12, o = o * W2 - l * X2 + 2048 >> 12, l = x, c = c + u + 1 >> 1, u = c - u, f = f + h + 1 >> 1, h = f - h, a = a + l + 1 >> 1, l = a - l, r = r + o + 1 >> 1, o = r - o, x = c * V2 + f * G2 + 2048 >> 12, c = c * G2 - f * V2 + 2048 >> 12, f = x, x = h * z2 + u * $2 + 2048 >> 12, h = h * $2 - u * z2 + 2048 >> 12, u = x, d = a + f, A = a - f, p = r + u, w = r - u, m = o + h, v = o - h, b = l + c, y = l - c, d < 16 ? d = 0 : d >= 4080 ? d = 255 : d >>= 4, p < 16 ? p = 0 : p >= 4080 ? p = 255 : p >>= 4, m < 16 ? m = 0 : m >= 4080 ? m = 255 : m >>= 4, b < 16 ? b = 0 : b >= 4080 ? b = 255 : b >>= 4, y < 16 ? y = 0 : y >= 4080 ? y = 255 : y >>= 4, v < 16 ? v = 0 : v >= 4080 ? v = 255 : v >>= 4, w < 16 ? w = 0 : w >= 4080 ? w = 255 : w >>= 4, A < 16 ? A = 0 : A >= 4080 ? A = 255 : A >>= 4, n[t + k] = d, n[t + k + 8] = p, n[t + k + 16] = m, n[t + k + 24] = b, n[t + k + 32] = y, n[t + k + 40] = v, n[t + k + 48] = w, n[t + k + 56] = A) : (x = Ah * d + 8192 >> 14, x = x < -2040 ? 0 : x >= 2024 ? 255 : x + 2056 >> 4, n[t + k] = x, n[t + k + 8] = x, n[t + k + 16] = x, n[t + k + 24] = x, n[t + k + 32] = x, n[t + k + 40] = x, n[t + k + 48] = x, n[t + k + 56] = x);
}
function YI(s, t) {
  const e = t.blocksPerLine, i = t.blocksPerColumn, n = new Int16Array(64);
  for (let a = 0; a < i; a++) for (let r = 0; r < e; r++)
    KI(t, e6(t, a, r), n);
  return t.blockData;
}
function Y9(s, t, e = t) {
  const i = s.length - 1;
  let n = e < t ? e : t;
  if (t >= i) return null;
  const a = $t(s, t);
  if (a >= 65472 && a <= 65534) return { invalid: null, marker: a, offset: t };
  let r = $t(s, n);
  for (; !(r >= 65472 && r <= 65534); ) {
    if (++n >= i) return null;
    r = $t(s, n);
  }
  return { invalid: a.toString(16), marker: r, offset: n };
}
function JI(s) {
  const t = Math.ceil(s.samplesPerLine / 8 / s.maxH), e = Math.ceil(s.scanLines / 8 / s.maxV);
  for (const i of s.components) {
    const n = Math.ceil(Math.ceil(s.samplesPerLine / 8) * i.h / s.maxH), a = Math.ceil(Math.ceil(s.scanLines / 8) * i.v / s.maxV), r = t * i.h, o = 64 * (e * i.v) * (r + 1);
    i.blockData = new Int16Array(o), i.blocksPerLine = n, i.blocksPerColumn = a;
  }
  s.mcusPerLine = t, s.mcusPerColumn = e;
}
function Z8(s, t) {
  const e = $t(s, t);
  let i = (t += 2) + e - 2;
  const n = Y9(s, i, t);
  n != null && n.invalid && (D("readDataBlock - incorrect length, current marker is: " + n.invalid), i = n.offset);
  const a = s.subarray(t, i);
  return { appData: a, oldOffset: t, newOffset: t + a.length };
}
function ZI(s, t) {
  const e = $t(s, t), i = (t += 2) + e - 2, n = Y9(s, i, t);
  return n != null && n.invalid ? n.offset : i;
}
class Q8 {
  constructor({ decodeTransform: t = null, colorTransform: e = -1 } = {}) {
    this._decodeTransform = t, this._colorTransform = e;
  }
  static canUseImageDecoder(t, e = -1) {
    let i = null, n = 0, a = null, r = $t(t, n);
    if (n += 2, r !== 65496) throw new mn("SOI not found");
    r = $t(t, n), n += 2;
    t: for (; r !== 65497; ) {
      switch (r) {
        case 65505:
          const { appData: o, oldOffset: l, newOffset: c } = Z8(t, n);
          if (n = c, o[0] === 69 && o[1] === 120 && o[2] === 105 && o[3] === 102 && o[4] === 0 && o[5] === 0) {
            if (i) throw new mn("Duplicate EXIF-blocks found.");
            i = { exifStart: l + 6, exifEnd: c };
          }
          r = $t(t, n), n += 2;
          continue;
        case 65472:
        case 65473:
        case 65474:
          a = t[n + 7];
          break t;
        case 65535:
          t[n] !== 255 && n--;
      }
      n = ZI(t, n), r = $t(t, n), n += 2;
    }
    return a === 4 || a === 3 && e === 0 ? null : i || {};
  }
  parse(t, { dnlScanLines: e = null } = {}) {
    let i, n, a = 0, r = null, o = null, l = 0;
    const c = [], h = [], u = [];
    let f = $t(t, a);
    if (a += 2, f !== 65496) throw new mn("SOI not found");
    f = $t(t, a), a += 2;
    t: for (; f !== 65497; ) {
      let d, p, m;
      switch (f) {
        case 65504:
        case 65505:
        case 65506:
        case 65507:
        case 65508:
        case 65509:
        case 65510:
        case 65511:
        case 65512:
        case 65513:
        case 65514:
        case 65515:
        case 65516:
        case 65517:
        case 65518:
        case 65519:
        case 65534:
          const { appData: b, newOffset: y } = Z8(t, a);
          a = y, f === 65504 && b[0] === 74 && b[1] === 70 && b[2] === 73 && b[3] === 70 && b[4] === 0 && (r = { version: { major: b[5], minor: b[6] }, densityUnits: b[7], xDensity: b[8] << 8 | b[9], yDensity: b[10] << 8 | b[11], thumbWidth: b[12], thumbHeight: b[13], thumbData: b.subarray(14, 14 + 3 * b[12] * b[13]) }), f === 65518 && b[0] === 65 && b[1] === 100 && b[2] === 111 && b[3] === 98 && b[4] === 101 && (o = { version: b[5] << 8 | b[6], flags0: b[7] << 8 | b[8], flags1: b[9] << 8 | b[10], transformCode: b[11] });
          break;
        case 65499:
          const v = $t(t, a);
          a += 2;
          const w = v + a - 2;
          let A;
          for (; a < w; ) {
            const P = t[a++], G = new Uint16Array(64);
            if (P >> 4) {
              if (P >> 4 != 1) throw new mn("DQT - invalid table spec");
              for (p = 0; p < 64; p++)
                A = qd[p], G[A] = $t(t, a), a += 2;
            } else for (p = 0; p < 64; p++)
              A = qd[p], G[A] = t[a++];
            c[15 & P] = G;
          }
          break;
        case 65472:
        case 65473:
        case 65474:
          if (i) throw new mn("Only single frame JPEGs supported");
          a += 2, i = {}, i.extended = f === 65473, i.progressive = f === 65474, i.precision = t[a++];
          const x = $t(t, a);
          a += 2, i.scanLines = e || x, i.samplesPerLine = $t(t, a), a += 2, i.components = [], i.componentIds = {};
          const k = t[a++];
          let I = 0, T = 0;
          for (d = 0; d < k; d++) {
            const P = t[a], G = t[a + 1] >> 4, N = 15 & t[a + 1];
            I < G && (I = G), T < N && (T = N);
            const j = t[a + 2];
            m = i.components.push({ h: G, v: N, quantizationId: j, quantizationTable: null }), i.componentIds[P] = m - 1, a += 3;
          }
          i.maxH = I, i.maxV = T, JI(i);
          break;
        case 65476:
          const E = $t(t, a);
          for (a += 2, d = 2; d < E; ) {
            const P = t[a++], G = new Uint8Array(16);
            let N = 0;
            for (p = 0; p < 16; p++, a++) N += G[p] = t[a];
            const j = new Uint8Array(N);
            for (p = 0; p < N; p++, a++) j[p] = t[a];
            d += 17 + N, (P >> 4 ? h : u)[15 & P] = WI(G, j);
          }
          break;
        case 65501:
          a += 2, n = $t(t, a), a += 2;
          break;
        case 65498:
          const M = ++l == 1 && !e;
          a += 2;
          const F = t[a++], L = [];
          for (d = 0; d < F; d++) {
            const P = t[a++], G = i.componentIds[P], N = i.components[G];
            N.index = P;
            const j = t[a++];
            N.huffmanTableDC = u[j >> 4], N.huffmanTableAC = h[15 & j], L.push(N);
          }
          const Y = t[a++], B = t[a++], et = t[a++];
          try {
            a += XI(t, a, i, L, n, Y, B, et >> 4, 15 & et, M);
          } catch (P) {
            if (P instanceof t6)
              return D(`${P.message} -- attempting to re-parse the JPEG image.`), this.parse(t, { dnlScanLines: P.scanLines });
            if (P instanceof mA) {
              D(`${P.message} -- ignoring the rest of the image data.`);
              break t;
            }
            throw P;
          }
          break;
        case 65500:
          a += 4;
          break;
        case 65535:
          t[a] !== 255 && a--;
          break;
        default:
          const H = Y9(t, a - 2, a - 3);
          if (H != null && H.invalid) {
            D("JpegImage.parse - unexpected data, current marker is: " + H.invalid), a = H.offset;
            break;
          }
          if (!H || a >= t.length - 1) {
            D("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");
            break t;
          }
          throw new mn("JpegImage.parse - unknown marker: " + f.toString(16));
      }
      f = $t(t, a), a += 2;
    }
    if (!i) throw new mn("JpegImage.parse - no frame data found.");
    this.width = i.samplesPerLine, this.height = i.scanLines, this.jfif = r, this.adobe = o, this.components = [];
    for (const d of i.components) {
      const p = c[d.quantizationId];
      p && (d.quantizationTable = p), this.components.push({ index: d.index, output: YI(0, d), scaleX: d.h / i.maxH, scaleY: d.v / i.maxV, blocksPerLine: d.blocksPerLine, blocksPerColumn: d.blocksPerColumn });
    }
    this.numComponents = this.components.length;
  }
  _getLinearizedBlockData(t, e, i = !1) {
    const n = this.width / t, a = this.height / e;
    let r, o, l, c, h, u, f, d, p, m, b, y = 0;
    const v = this.components.length, w = t * e * v, A = new Uint8ClampedArray(w), x = new Uint32Array(t), k = 4294967288;
    let I;
    for (f = 0; f < v; f++) {
      if (r = this.components[f], o = r.scaleX * n, l = r.scaleY * a, y = f, b = r.output, c = r.blocksPerLine + 1 << 3, o !== I) {
        for (h = 0; h < t; h++)
          d = 0 | h * o, x[h] = (d & k) << 3 | 7 & d;
        I = o;
      }
      for (u = 0; u < e; u++)
        for (d = 0 | u * l, m = c * (d & k) | (7 & d) << 3, h = 0; h < t; h++)
          A[y] = b[m + x[h]], y += v;
    }
    let T = this._decodeTransform;
    if (i || v !== 4 || T || (T = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255])), T) for (f = 0; f < w; ) for (d = 0, p = 0; d < v; d++, f++, p += 2) A[f] = (A[f] * T[p] >> 8) + T[p + 1];
    return A;
  }
  get _isColorConversionNeeded() {
    return this.adobe ? !!this.adobe.transformCode : this.numComponents === 3 ? this._colorTransform !== 0 && (this.components[0].index !== 82 || this.components[1].index !== 71 || this.components[2].index !== 66) : this._colorTransform === 1;
  }
  _convertYccToRgb(t) {
    let e, i, n;
    for (let a = 0, r = t.length; a < r; a += 3)
      e = t[a], i = t[a + 1], n = t[a + 2], t[a] = e - 179.456 + 1.402 * n, t[a + 1] = e + 135.459 - 0.344 * i - 0.714 * n, t[a + 2] = e - 226.816 + 1.772 * i;
    return t;
  }
  _convertYccToRgba(t, e) {
    for (let i = 0, n = 0, a = t.length; i < a; i += 3, n += 4) {
      const r = t[i], o = t[i + 1], l = t[i + 2];
      e[n] = r - 179.456 + 1.402 * l, e[n + 1] = r + 135.459 - 0.344 * o - 0.714 * l, e[n + 2] = r - 226.816 + 1.772 * o, e[n + 3] = 255;
    }
    return e;
  }
  _convertYcckToRgb(t) {
    return this._convertYcckToCmyk(t), this._convertCmykToRgb(t);
  }
  _convertYcckToRgba(t) {
    return this._convertYcckToCmyk(t), this._convertCmykToRgba(t);
  }
  _convertYcckToCmyk(t) {
    let e, i, n;
    for (let a = 0, r = t.length; a < r; a += 4)
      e = t[a], i = t[a + 1], n = t[a + 2], t[a] = 434.456 - e - 1.402 * n, t[a + 1] = 119.541 - e + 0.344 * i + 0.714 * n, t[a + 2] = 481.816 - e - 1.772 * i;
    return t;
  }
  _convertCmykToRgb(t) {
    const e = t.length / 4;
    return te.cmyk.getRgbBuffer(t, 0, e, t, 0, 8, 0), t.subarray(0, 3 * e);
  }
  _convertCmykToRgba(t) {
    if (te.cmyk.getRgbBuffer(t, 0, t.length / 4, t, 0, 8, 1), te.cmyk instanceof oA) for (let e = 3, i = t.length; e < i; e += 4) t[e] = 255;
    return t;
  }
  getData({ width: t, height: e, forceRGBA: i = !1, forceRGB: n = !1, isSourcePDF: a = !1 }) {
    if (this.numComponents > 4) throw new mn("Unsupported color mode");
    const r = this._getLinearizedBlockData(t, e, a);
    if (this.numComponents === 1 && (i || n)) {
      const o = r.length * (i ? 4 : 3), l = new Uint8ClampedArray(o);
      let c = 0;
      if (i) (function(u, f) {
        if (Ii.isLittleEndian) for (let d = 0, p = u.length; d < p; d++) f[d] = 65793 * u[d] | 4278190080;
        else for (let d = 0, p = u.length; d < p; d++) f[d] = 16843008 * u[d] | 255;
      })(r, new Uint32Array(l.buffer));
      else for (const h of r)
        l[c++] = h, l[c++] = h, l[c++] = h;
      return l;
    }
    if (this.numComponents === 3 && this._isColorConversionNeeded) {
      if (i) {
        const o = new Uint8ClampedArray(r.length / 3 * 4);
        return this._convertYccToRgba(r, o);
      }
      return this._convertYccToRgb(r);
    }
    if (this.numComponents === 4) {
      if (this._isColorConversionNeeded) return i ? this._convertYcckToRgba(r) : n ? this._convertYcckToRgb(r) : this._convertYcckToCmyk(r);
      if (i) return this._convertCmykToRgba(r);
      if (n) return this._convertCmykToRgb(r);
    }
    return r;
  }
}
var n2, a2, s6;
const R9 = class R9 extends fi {
  constructor(e, i, n) {
    super(i);
    _(this, a2);
    this.stream = e, this.dict = e.dict, this.maybeLength = i, this.params = n;
  }
  static get canUseImageDecoder() {
    return gt(this, "canUseImageDecoder", g(this, n2) ? ImageDecoder.isTypeSupported("image/jpeg") : Promise.resolve(!1));
  }
  static setOptions({ isImageDecoderSupported: e = !1 }) {
    S(this, n2, e);
  }
  get bytes() {
    return gt(this, "bytes", this.stream.getBytes(this.maybeLength));
  }
  ensureBuffer(e) {
  }
  readBlock() {
    this.decodeImage();
  }
  get jpegOptions() {
    const e = { decodeTransform: void 0, colorTransform: void 0 }, i = this.dict.getArray("D", "Decode");
    if ((this.forceRGBA || this.forceRGB) && Array.isArray(i)) {
      const n = this.dict.get("BPC", "BitsPerComponent") || 8, a = i.length, r = new Int32Array(a);
      let o = !1;
      const l = (1 << n) - 1;
      for (let c = 0; c < a; c += 2)
        r[c] = 256 * (i[c + 1] - i[c]) | 0, r[c + 1] = i[c] * l | 0, r[c] === 256 && r[c + 1] === 0 || (o = !0);
      o && (e.decodeTransform = r);
    }
    if (this.params instanceof q) {
      const n = this.params.get("ColorTransform");
      Number.isInteger(n) && (e.colorTransform = n);
    }
    return gt(this, "jpegOptions", e);
  }
  decodeImage(e) {
    if (this.eof) return this.buffer;
    e = C(this, a2, s6).call(this, e || this.bytes);
    const i = new Q8(this.jpegOptions);
    i.parse(e);
    const n = i.getData({ width: this.drawWidth, height: this.drawHeight, forceRGBA: this.forceRGBA, forceRGB: this.forceRGB, isSourcePDF: !0 });
    return this.buffer = n, this.bufferLength = n.length, this.eof = !0, this.buffer;
  }
  get canAsyncDecodeImageFromBuffer() {
    return this.stream.isAsync;
  }
  async getTransferableImage() {
    if (!await R9.canUseImageDecoder) return null;
    const e = this.jpegOptions;
    if (e.decodeTransform) return null;
    let i;
    try {
      const n = this.canAsyncDecodeImageFromBuffer && await this.stream.asyncGetBytes() || this.bytes;
      if (!n) return null;
      let a = C(this, a2, s6).call(this, n);
      const r = Q8.canUseImageDecoder(a, e.colorTransform);
      return r ? (r.exifStart && (a = a.slice(), a.fill(0, r.exifStart, r.exifEnd)), i = new ImageDecoder({ data: a, type: "image/jpeg", preferAnimation: !1 }), (await i.decode()).image) : null;
    } catch (n) {
      return D(`getTransferableImage - failed: "${n}".`), null;
    } finally {
      i == null || i.close();
    }
  }
};
n2 = new WeakMap(), a2 = new WeakSet(), s6 = function(e) {
  for (let i = 0, n = e.length - 1; i < n; i++) if (e[i] === 255 && e[i + 1] === 216) {
    i > 0 && (e = e.subarray(i));
    break;
  }
  return e;
}, _(R9, n2, Ii.isImageDecoderSupported);
let E1 = R9;
var QI = async function(s = {}) {
  var t, e, i = s, n = new Promise((O, U) => {
    t = O, e = U;
  }), a = "./this.program", r = (O, U) => {
    throw U;
  }, o = import.meta.url;
  try {
    new URL(".", o).href;
  } catch {
  }
  var l, c, h, u, f, d, p = console.log.bind(console), m = console.error.bind(console), b = !1;
  function y() {
    var O = l.buffer;
    h = new Int8Array(O), u = new Uint8Array(O), f = new Int32Array(O), d = new Uint32Array(O), new BigInt64Array(O), new BigUint64Array(O);
  }
  var v = 0, w = null;
  class A {
    constructor(U) {
      ht(this, "name", "ExitStatus");
      this.message = `Program terminated with exit(${U})`, this.status = U;
    }
  }
  var x = (O) => {
    for (; O.length > 0; ) O.shift()(i);
  }, k = [], I = (O) => k.push(O), T = [], E = (O) => T.push(O), M = !0, F = 0, L = {}, Y = (O) => {
    if (O instanceof A || O == "unwind") return c;
    r(0, O);
  }, B = () => M || F > 0, et = (O) => {
    var U;
    c = O, B() || ((U = i.onExit) == null || U.call(i, O), b = !0), r(0, new A(O));
  }, H = (O, U) => {
    c = O, et(O);
  }, P = (O) => {
    if (!b) try {
      O(), (() => {
        if (!B()) try {
          H(c);
        } catch (U) {
          Y(U);
        }
      })();
    } catch (U) {
      Y(U);
    }
  }, G = (O) => {
    var U = (O - l.buffer.byteLength + 65535) / 65536 | 0;
    try {
      return l.grow(U), y(), 1;
    } catch {
    }
  }, N = {}, j = () => {
    if (!j.strings) {
      var O = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: a || "./this.program" };
      for (var U in N) N[U] === void 0 ? delete O[U] : O[U] = N[U];
      var Q = [];
      for (var U in O) Q.push(`${U}=${O[U]}`);
      j.strings = Q;
    }
    return j.strings;
  }, V = (O) => {
    for (var U = 0, Q = 0; Q < O.length; ++Q) {
      var lt = O.charCodeAt(Q);
      lt <= 127 ? U++ : lt <= 2047 ? U += 2 : lt >= 55296 && lt <= 57343 ? (U += 4, ++Q) : U += 3;
    }
    return U;
  }, X = [null, [], []], z = typeof TextDecoder < "u" ? new TextDecoder() : void 0, K = (O, U = 0, Q = NaN) => {
    for (var lt = U + Q, pt = U; O[pt] && !(pt >= lt); ) ++pt;
    if (pt - U > 16 && O.buffer && z) return z.decode(O.subarray(U, pt));
    for (var ft = ""; U < pt; ) {
      var dt = O[U++];
      if (128 & dt) {
        var ut = 63 & O[U++];
        if ((224 & dt) != 192) {
          var ct = 63 & O[U++];
          if ((dt = (240 & dt) == 224 ? (15 & dt) << 12 | ut << 6 | ct : (7 & dt) << 18 | ut << 12 | ct << 6 | 63 & O[U++]) < 65536) ft += String.fromCharCode(dt);
          else {
            var Tt = dt - 65536;
            ft += String.fromCharCode(55296 | Tt >> 10, 56320 | 1023 & Tt);
          }
        } else ft += String.fromCharCode((31 & dt) << 6 | ut);
      } else ft += String.fromCharCode(dt);
    }
    return ft;
  }, W = (O, U) => {
    var Q = X[O];
    U === 0 || U === 10 ? ((O === 1 ? p : m)(K(Q)), Q.length = 0) : Q.push(U);
  }, rt = (O, U) => O ? K(u, O, U) : "";
  i.noExitRuntime && (M = i.noExitRuntime), i.print && (p = i.print), i.printErr && (m = i.printErr), i.wasmBinary && i.wasmBinary, i.arguments && i.arguments, i.thisProgram && (a = i.thisProgram), i.writeArrayToMemory = (O, U) => {
    h.set(O, U);
  };
  var $ = { l: () => function(U) {
    var lt;
    (lt = i.onAbort) == null || lt.call(i, U), m(U = "Aborted(" + U + ")"), b = !0, U += ". Build with -sASSERTIONS for more info.";
    var Q = new WebAssembly.RuntimeError(U);
    throw e(Q), Q;
  }(""), k: () => {
    M = !1, F = 0;
  }, m: (O, U) => {
    if (L[O] && (clearTimeout(L[O].id), delete L[O]), !U) return 0;
    var Q = setTimeout(() => {
      delete L[O], P(() => wt(O, performance.now()));
    }, U);
    return L[O] = { id: Q, timeout_ms: U }, 0;
  }, g: function(U, Q) {
    U >>= 2;
    const lt = i.imageData = new Uint8ClampedArray(Q), pt = f.subarray(U, U + Q);
    lt.set(pt);
  }, f: function(U, Q, lt, pt) {
    U >>= 2, Q >>= 2, lt >>= 2;
    const ft = i.imageData = new Uint8ClampedArray(3 * pt), dt = f.subarray(U, U + pt), ut = f.subarray(Q, Q + pt), ct = f.subarray(lt, lt + pt);
    for (let Tt = 0; Tt < pt; Tt++)
      ft[3 * Tt] = dt[Tt], ft[3 * Tt + 1] = ut[Tt], ft[3 * Tt + 2] = ct[Tt];
  }, e: function(U, Q, lt, pt, ft) {
    U >>= 2, Q >>= 2, lt >>= 2, pt >>= 2;
    const dt = i.imageData = new Uint8ClampedArray(4 * ft), ut = f.subarray(U, U + ft), ct = f.subarray(Q, Q + ft), Tt = f.subarray(lt, lt + ft), Bt = f.subarray(pt, pt + ft);
    for (let vt = 0; vt < ft; vt++)
      dt[4 * vt] = ut[vt], dt[4 * vt + 1] = ct[vt], dt[4 * vt + 2] = Tt[vt], dt[4 * vt + 3] = Bt[vt];
  }, n: (O) => {
    var U, Q, lt = u.length, pt = 2147483648;
    if ((O >>>= 0) > pt) return !1;
    for (var ft = 1; ft <= 4; ft *= 2) {
      var dt = lt * (1 + 0.2 / ft);
      dt = Math.min(dt, O + 100663296);
      var ut = Math.min(pt, (U = Math.max(O, dt), Q = 65536, Math.ceil(U / Q) * Q));
      if (G(ut)) return !0;
    }
    return !1;
  }, p: (O, U) => {
    var Q = 0, lt = 0;
    for (var pt of j()) {
      var ft = U + Q;
      d[O + lt >> 2] = ft, Q += ((dt, ut, ct, Tt) => {
        for (var Bt = ct, vt = ct + Tt - 1, xt = 0; xt < dt.length; ++xt) {
          var kt = dt.charCodeAt(xt);
          if (kt >= 55296 && kt <= 57343 && (kt = 65536 + ((1023 & kt) << 10) | 1023 & dt.charCodeAt(++xt)), kt <= 127) {
            if (ct >= vt) break;
            ut[ct++] = kt;
          } else if (kt <= 2047) {
            if (ct + 1 >= vt) break;
            ut[ct++] = 192 | kt >> 6, ut[ct++] = 128 | 63 & kt;
          } else if (kt <= 65535) {
            if (ct + 2 >= vt) break;
            ut[ct++] = 224 | kt >> 12, ut[ct++] = 128 | kt >> 6 & 63, ut[ct++] = 128 | 63 & kt;
          } else {
            if (ct + 3 >= vt) break;
            ut[ct++] = 240 | kt >> 18, ut[ct++] = 128 | kt >> 12 & 63, ut[ct++] = 128 | kt >> 6 & 63, ut[ct++] = 128 | 63 & kt;
          }
        }
        return ut[ct] = 0, ct - Bt;
      })(pt, u, ft, 1 / 0) + 1, lt += 4;
    }
    return 0;
  }, q: (O, U) => {
    var Q = j();
    d[O >> 2] = Q.length;
    var lt = 0;
    for (var pt of Q) lt += V(pt) + 1;
    return d[U >> 2] = lt, 0;
  }, b: (O) => 52, o: function(U, Q, lt, pt) {
    return 70;
  }, c: (O, U, Q, lt) => {
    for (var pt = 0, ft = 0; ft < Q; ft++) {
      var dt = d[U >> 2], ut = d[U + 4 >> 2];
      U += 8;
      for (var ct = 0; ct < ut; ct++) W(O, u[dt + ct]);
      pt += ut;
    }
    return d[lt >> 2] = pt, 0;
  }, r: function(U, Q) {
    U >>= 2;
    const lt = i.imageData = new Uint8ClampedArray(4 * Q), pt = f.subarray(U, U + Q);
    for (let ft = 0; ft < Q; ft++)
      lt[4 * ft] = lt[4 * ft + 1] = lt[4 * ft + 2] = pt[ft], lt[4 * ft + 3] = 255;
  }, i: function(U, Q, lt) {
    U >>= 2, Q >>= 2;
    const pt = i.imageData = new Uint8ClampedArray(4 * lt), ft = f.subarray(U, U + lt), dt = f.subarray(Q, Q + lt);
    for (let ut = 0; ut < lt; ut++)
      pt[4 * ut] = pt[4 * ut + 1] = pt[4 * ut + 2] = ft[ut], pt[4 * ut + 3] = dt[ut];
  }, d: function(U) {
    const Q = rt(U);
    (i.warn || console.warn)(`OpenJPEG: ${Q}`);
  }, j: et, h: function(U, Q, lt, pt) {
    U >>= 2, Q >>= 2, lt >>= 2;
    const ft = i.imageData = new Uint8ClampedArray(4 * pt), dt = f.subarray(U, U + pt), ut = f.subarray(Q, Q + pt), ct = f.subarray(lt, lt + pt);
    for (let Tt = 0; Tt < pt; Tt++)
      ft[4 * Tt] = dt[Tt], ft[4 * Tt + 1] = ut[Tt], ft[4 * Tt + 2] = ct[Tt], ft[4 * Tt + 3] = 255;
  }, a: function(U) {
    const Q = rt(U);
    i.errorMessages ? i.errorMessages += `
` + Q : i.errorMessages = Q;
  } }, nt = await async function() {
    function U(lt, pt) {
      return nt = lt.exports, l = nt.s, y(), function(dt) {
        var ct;
        if (v--, (ct = i.monitorRunDependencies) == null || ct.call(i, v), v == 0 && w) {
          var ut = w;
          w = null, ut();
        }
      }(), nt;
    }
    (function(pt) {
      var ft;
      v++, (ft = i.monitorRunDependencies) == null || ft.call(i, v);
    })();
    var Q = /* @__PURE__ */ function() {
      return { a: $ };
    }();
    return new Promise((lt, pt) => {
      i.instantiateWasm(Q, (ft, dt) => {
        lt(U(ft));
      });
    });
  }(), wt = (nt.t, i._malloc = nt.u, i._free = nt.v, i._jp2_decode = nt.w, nt.x);
  return function() {
    if (i.preInit)
      for (typeof i.preInit == "function" && (i.preInit = [i.preInit]); i.preInit.length > 0; ) i.preInit.shift()();
  }(), function O() {
    v > 0 ? w = O : (function() {
      if (i.preRun)
        for (typeof i.preRun == "function" && (i.preRun = [i.preRun]); i.preRun.length; ) E(i.preRun.shift());
      x(T);
    }(), v > 0 ? w = O : i.setStatus ? (i.setStatus("Running..."), setTimeout(() => {
      setTimeout(() => i.setStatus(""), 1), U();
    }, 1)) : U());
    function U() {
      var Q;
      i.calledRun = !0, b || (function() {
        nt.t();
      }(), t(i), (Q = i.onRuntimeInitialized) == null || Q.call(i), function() {
        if (i.postRun)
          for (typeof i.postRun == "function" && (i.postRun = [i.postRun]); i.postRun.length; ) I(i.postRun.shift());
        x(k);
      }());
    }
  }(), n;
};
const t_ = QI;
class Y2 extends gi {
  constructor(t) {
    super(t, "JpxError");
  }
}
var Kc, w1, Yc, r2, o2, v1, fh, i6, bA;
class Yn {
  static setOptions({ handler: t, useWasm: e, useWorkerFetch: i, wasmUrl: n }) {
    S(this, r2, e), S(this, o2, i), S(this, v1, n), i || S(this, w1, t);
  }
  static async decode(t, { numComponents: e = 4, isIndexedColormap: i = !1, smaskInData: n = !1, reducePower: a = 0 } = {}) {
    if (!g(this, Yc)) {
      const { promise: l, resolve: c } = Promise.withResolvers(), h = [l];
      g(this, r2) ? h.push(t_({ warn: D, instantiateWasm: C(this, fh, bA).bind(this, c) })) : C(this, fh, i6).call(this, c), S(this, Yc, Promise.race(h));
    }
    const r = await g(this, Yc);
    if (!r) throw new Y2("OpenJPEG failed to initialize");
    let o;
    try {
      const l = t.length;
      if (o = r._malloc(l), r.writeArrayToMemory(t, o), r._jp2_decode(o, l, e > 0 ? e : 0, !!i, !!n, a)) {
        const { errorMessages: h } = r;
        throw h ? (delete r.errorMessages, new Y2(h)) : new Y2("Unknown error");
      }
      const { imageData: c } = r;
      return r.imageData = null, c;
    } finally {
      o && r._free(o);
    }
  }
  static cleanup() {
    S(this, Yc, null);
  }
  static parseImageProperties(t) {
    let e = t.getByte();
    for (; e >= 0; ) {
      const i = e;
      if (e = t.getByte(), (i << 8 | e) === 65361) {
        t.skip(4);
        const n = t.getInt32() >>> 0, a = t.getInt32() >>> 0, r = t.getInt32() >>> 0, o = t.getInt32() >>> 0;
        return t.skip(16), { width: n - r, height: a - o, bitsPerComponent: 8, componentsCount: t.getUint16() };
      }
    }
    throw new Y2("No size marker found in JPX stream");
  }
}
Kc = new WeakMap(), w1 = new WeakMap(), Yc = new WeakMap(), r2 = new WeakMap(), o2 = new WeakMap(), v1 = new WeakMap(), fh = new WeakSet(), i6 = async function(t) {
  const e = `${g(this, v1)}openjpeg_nowasm_fallback.js`;
  let i = null;
  try {
    i = (await import(
      /*webpackIgnore: true*/
      /*@vite-ignore*/
      e
    )).default();
  } catch (n) {
    D(`JpxImage#getJsModule: ${n}`);
  }
  t(i);
}, bA = async function(t, e, i) {
  const n = "openjpeg.wasm";
  try {
    return g(this, Kc) || (g(this, o2) ? S(this, Kc, await $3(`${g(this, v1)}${n}`)) : S(this, Kc, await g(this, w1).sendWithPromise("FetchBinaryData", { type: "wasmFactory", filename: n }))), i((await WebAssembly.instantiate(g(this, Kc), e)).instance);
  } catch (a) {
    return D(`JpxImage#instantiateWasm: ${a}`), C(this, fh, i6).call(this, t), null;
  } finally {
    S(this, w1, null);
  }
}, _(Yn, fh), _(Yn, Kc, null), _(Yn, w1, null), _(Yn, Yc, null), _(Yn, r2, !0), _(Yn, o2, !0), _(Yn, v1, null);
function S2(s, t, e, i, n) {
  let a = s;
  for (let r = 0, o = t.length - 1; r < o; r++) {
    const l = t[r];
    a = a[l] || (a[l] = []);
  }
  a[t.at(-1)] = { checkFn: e, iterateFn: i, processFn: n };
}
const hh = [];
S2(hh, [aa, Wr, Fp, Ci], null, function(t, e) {
  const i = t.fnArray, n = (e - (t.iCurr - 3)) % 4;
  switch (n) {
    case 0:
      return i[e] === aa;
    case 1:
      return i[e] === Wr;
    case 2:
      return i[e] === Fp;
    case 3:
      return i[e] === Ci;
  }
  throw new Error(`iterateInlineImageGroup - invalid pos: ${n}`);
}, function(t, e) {
  const i = t.fnArray, n = t.argsArray, a = t.iCurr, r = a - 3, o = a - 2, l = a - 1, c = Math.min(Math.floor((e - r) / 4), 200);
  if (c < 10) return e - (e - r) % 4;
  let h = 0;
  const u = [];
  let f = 0, d = 1, p = 1;
  for (let A = 0; A < c; A++) {
    const x = n[o + (A << 2)], k = n[l + (A << 2)][0];
    d + k.width > 1e3 && (h = Math.max(h, d), p += f + 2, d = 0, f = 0), u.push({ transform: x, x: d, y: p, w: k.width, h: k.height }), d += k.width + 2, f = Math.max(f, k.height);
  }
  const m = Math.max(h, d) + 1, b = p + f + 1, y = new Uint8Array(m * b * 4), v = m << 2;
  for (let A = 0; A < c; A++) {
    const x = n[l + (A << 2)][0].data, k = u[A].w << 2;
    let I = 0, T = u[A].x + u[A].y * m << 2;
    y.set(x.subarray(0, k), T - v);
    for (let E = 0, M = u[A].h; E < M; E++)
      y.set(x.subarray(I, I + k), T), I += k, T += v;
    for (y.set(x.subarray(I - k, I), T); T >= 0; )
      x[T - 4] = x[T], x[T - 3] = x[T + 1], x[T - 2] = x[T + 2], x[T - 1] = x[T + 3], x[T + k] = x[T + k - 4], x[T + k + 1] = x[T + k - 3], x[T + k + 2] = x[T + k - 2], x[T + k + 3] = x[T + k - 1], T -= v;
  }
  const w = { width: m, height: b };
  if (t.isOffscreenCanvasSupported) {
    const A = new OffscreenCanvas(m, b);
    A.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(y.buffer), m, b), 0, 0), w.bitmap = A.transferToImageBitmap(), w.data = null;
  } else
    w.kind = sr, w.data = y;
  return i.splice(r, 4 * c, Yv), n.splice(r, 4 * c, [w, u]), r + 1;
});
S2(hh, [aa, Wr, _1, Ci], null, function(t, e) {
  const i = t.fnArray, n = (e - (t.iCurr - 3)) % 4;
  switch (n) {
    case 0:
      return i[e] === aa;
    case 1:
      return i[e] === Wr;
    case 2:
      return i[e] === _1;
    case 3:
      return i[e] === Ci;
  }
  throw new Error(`iterateImageMaskGroup - invalid pos: ${n}`);
}, function(t, e) {
  const i = t.fnArray, n = t.argsArray, a = t.iCurr, r = a - 3, o = a - 2, l = a - 1;
  let c = Math.floor((e - r) / 4);
  if (c < 10) return e - (e - r) % 4;
  let h, u, f = !1;
  const d = n[l][0], p = n[o][0], m = n[o][1], b = n[o][2], y = n[o][3];
  if (m === b) {
    f = !0, h = o + 4;
    let v = l + 4;
    for (let w = 1; w < c; w++, h += 4, v += 4)
      if (u = n[h], n[v][0] !== d || u[0] !== p || u[1] !== m || u[2] !== b || u[3] !== y) {
        w < 10 ? f = !1 : c = w;
        break;
      }
  }
  if (f) {
    c = Math.min(c, 1e3);
    const v = new Float32Array(2 * c);
    h = o;
    for (let w = 0; w < c; w++, h += 4)
      u = n[h], v[w << 1] = u[4], v[1 + (w << 1)] = u[5];
    i.splice(r, 4 * c, yI), n.splice(r, 4 * c, [d, p, m, b, y, v]);
  } else {
    c = Math.min(c, 100);
    const v = [];
    for (let w = 0; w < c; w++) {
      u = n[o + (w << 2)];
      const A = n[l + (w << 2)][0];
      v.push({ data: A.data, width: A.width, height: A.height, interpolate: A.interpolate, count: A.count, transform: u });
    }
    i.splice(r, 4 * c, mI), n.splice(r, 4 * c, [v]);
  }
  return r + 1;
});
S2(hh, [aa, Wr, B3, Ci], function(s) {
  const t = s.argsArray, e = s.iCurr - 2;
  return t[e][1] === 0 && t[e][2] === 0;
}, function(t, e) {
  const i = t.fnArray, n = t.argsArray, a = (e - (t.iCurr - 3)) % 4;
  switch (a) {
    case 0:
      return i[e] === aa;
    case 1:
      if (i[e] !== Wr) return !1;
      const r = t.iCurr - 2, o = n[r][0], l = n[r][3];
      return n[e][0] === o && n[e][1] === 0 && n[e][2] === 0 && n[e][3] === l;
    case 2:
      if (i[e] !== B3) return !1;
      const c = n[t.iCurr - 1][0];
      return n[e][0] === c;
    case 3:
      return i[e] === Ci;
  }
  throw new Error(`iterateImageGroup - invalid pos: ${a}`);
}, function(s, t) {
  const e = s.fnArray, i = s.argsArray, n = s.iCurr, a = n - 3, r = n - 2, o = i[n - 1][0], l = i[r][0], c = i[r][3], h = Math.min(Math.floor((t - a) / 4), 1e3);
  if (h < 3) return t - (t - a) % 4;
  const u = new Float32Array(2 * h);
  let f = r;
  for (let p = 0; p < h; p++, f += 4) {
    const m = i[f];
    u[p << 1] = m[4], u[1 + (p << 1)] = m[5];
  }
  const d = [o, l, c, u];
  return e.splice(a, 4 * h, bI), i.splice(a, 4 * h, d), a + 1;
});
S2(hh, [kp, il, lh, Dr, Sp], null, function(t, e) {
  const i = t.fnArray, n = t.argsArray, a = (e - (t.iCurr - 4)) % 5;
  switch (a) {
    case 0:
      return i[e] === kp;
    case 1:
      return i[e] === il;
    case 2:
      return i[e] === lh;
    case 3:
      if (i[e] !== Dr) return !1;
      const r = t.iCurr - 3, o = n[r][0], l = n[r][1];
      return n[e][0] === o && n[e][1] === l;
    case 4:
      return i[e] === Sp;
  }
  throw new Error(`iterateShowTextGroup - invalid pos: ${a}`);
}, function(s, t) {
  const e = s.fnArray, i = s.argsArray, n = s.iCurr, a = n - 4, r = n - 3, o = n - 2, l = n - 1, c = n, h = i[r][0], u = i[r][1];
  let f = Math.min(Math.floor((t - a) / 5), 1e3);
  if (f < 3) return t - (t - a) % 5;
  let d = a;
  a >= 4 && e[a - 4] === e[r] && e[a - 3] === e[o] && e[a - 2] === e[l] && e[a - 1] === e[c] && i[a - 4][0] === h && i[a - 4][1] === u && (f++, d -= 5);
  let p = d + 4;
  for (let m = 1; m < f; m++)
    e.splice(p, 3), i.splice(p, 3), p += 2;
  return p + 1;
});
S2(hh, [aa, Wr, eh, Ci], (s) => {
  const t = s.argsArray, e = t[s.iCurr - 1][0];
  if (e !== o7 && e !== vp && e !== l7 && e !== c7 && e !== Ap && e !== xp) return !0;
  const i = t[s.iCurr - 2];
  return i[0] === 1 && i[1] === 0 && i[2] === 0 && i[3] === 1;
}, () => !1, (s, t) => {
  const { fnArray: e, argsArray: i } = s, n = s.iCurr, a = n - 3, r = n - 2, o = i[n - 1], l = i[r], [, [c], h] = o;
  if (h) {
    se.scaleMinMax(l, h);
    for (let u = 0, f = c.length; u < f; ) switch (c[u++]) {
      case _d:
      case Cl:
        se.applyTransform(c, l, u), u += 2;
        break;
      case qg:
        se.applyTransformToBezier(c, l, u), u += 6;
    }
  }
  return e.splice(a, 4, eh), i.splice(a, 4, o), a + 1;
});
class yA {
  constructor(t) {
    this.queue = t;
  }
  _optimize() {
  }
  push(t, e) {
    this.queue.fnArray.push(t), this.queue.argsArray.push(e), this._optimize();
  }
  flush() {
  }
  reset() {
  }
}
class e_ extends yA {
  constructor(t) {
    super(t), this.state = null, this.context = { iCurr: 0, fnArray: t.fnArray, argsArray: t.argsArray, isOffscreenCanvasSupported: Ys.isOffscreenCanvasSupported }, this.match = null, this.lastProcessed = 0;
  }
  _optimize() {
    const t = this.queue.fnArray;
    let e = this.lastProcessed, i = t.length, n = this.state, a = this.match;
    if (!n && !a && e + 1 === i && !hh[t[e]]) {
      this.lastProcessed = i;
      return;
    }
    const r = this.context;
    for (; e < i; ) {
      if (a) {
        if ((0, a.iterateFn)(r, e)) {
          e++;
          continue;
        }
        if (e = (0, a.processFn)(r, e + 1), i = t.length, a = null, n = null, e >= i) break;
      }
      n = (n || hh)[t[e]], n && !Array.isArray(n) ? (r.iCurr = e, e++, (!n.checkFn || (0, n.checkFn)(r)) && (a = n), n = null) : e++;
    }
    this.state = n, this.match = a, this.lastProcessed = e;
  }
  flush() {
    for (; this.match; ) {
      const t = this.queue.fnArray.length;
      this.lastProcessed = (0, this.match.processFn)(this.context, t), this.match = null, this.state = null, this._optimize();
    }
  }
  reset() {
    this.state = null, this.match = null, this.lastProcessed = 0;
  }
}
const tr = class tr {
  constructor(t = 0, e) {
    this._streamSink = e, this.fnArray = [], this.argsArray = [], this.optimizer = !e || t & pC ? new yA(this) : new e_(this), this.dependencies = /* @__PURE__ */ new Set(), this._totalLength = 0, this.weight = 0, this._resolved = e ? null : Promise.resolve();
  }
  static setOptions({ isOffscreenCanvasSupported: t }) {
    this.isOffscreenCanvasSupported = t;
  }
  get length() {
    return this.argsArray.length;
  }
  get ready() {
    return this._resolved || this._streamSink.ready;
  }
  get totalLength() {
    return this._totalLength + this.length;
  }
  addOp(t, e) {
    this.optimizer.push(t, e), this.weight++, this._streamSink && (this.weight >= tr.CHUNK_SIZE || this.weight >= tr.CHUNK_SIZE_ABOUT && (t === Ci || t === Sp)) && this.flush();
  }
  addImageOps(t, e, i, n = !1) {
    n && (this.addOp(aa), this.addOp(Hl, [[["SMask", !1]]])), i !== void 0 && this.addOp(Na, ["OC", i]), this.addOp(t, e), i !== void 0 && this.addOp(I1, []), n && this.addOp(Ci);
  }
  addDependency(t) {
    this.dependencies.has(t) || (this.dependencies.add(t), this.addOp(iI, [t]));
  }
  addDependencies(t) {
    for (const e of t) this.addDependency(e);
  }
  addOpList(t) {
    if (t instanceof tr) {
      for (const e of t.dependencies) this.dependencies.add(e);
      for (let e = 0, i = t.length; e < i; e++) this.addOp(t.fnArray[e], t.argsArray[e]);
    } else D('addOpList - ignoring invalid "opList" parameter.');
  }
  getIR() {
    return { fnArray: this.fnArray, argsArray: this.argsArray, length: this.length };
  }
  get _transfers() {
    const t = [], { fnArray: e, argsArray: i, length: n } = this;
    for (let a = 0; a < n; a++) switch (e[a]) {
      case Fp:
      case Yv:
      case _1: {
        const { bitmap: l, data: c } = i[a][0];
        (l || c != null && c.buffer) && t.push(l || c.buffer);
        break;
      }
      case eh: {
        const [, [l], c] = i[a];
        l && t.push(l.buffer, c.buffer);
        break;
      }
      case Wv:
        const [r, o] = i[a];
        r && t.push(r.buffer), o && t.push(o.buffer);
        break;
      case lh:
        t.push(i[a][0].buffer);
    }
    return t;
  }
  flush(t = !1, e = null) {
    this.optimizer.flush();
    const i = this.length;
    this._totalLength += i, this._streamSink.enqueue({ fnArray: this.fnArray, argsArray: this.argsArray, lastChunk: t, separateAnnots: e, length: i }, 1, this._transfers), this.dependencies.clear(), this.fnArray.length = 0, this.argsArray.length = 0, this.weight = 0, this.optimizer.reset();
  }
};
ht(tr, "CHUNK_SIZE", 1e3), ht(tr, "CHUNK_SIZE_ABOUT", tr.CHUNK_SIZE - 5), ht(tr, "isOffscreenCanvasSupported", !1);
let Ys = tr;
function qs(s, t) {
  let e = 0;
  for (let i = 0; i <= t; i++) e = e << 8 | s[i];
  return e >>> 0;
}
function J2(s, t) {
  return t === 1 ? String.fromCharCode(s[0], s[1]) : t === 3 ? String.fromCharCode(s[0], s[1], s[2], s[3]) : String.fromCharCode(...s.subarray(0, t + 1));
}
function ti(s, t, e) {
  let i = 0;
  for (let n = e; n >= 0; n--)
    i += s[n] + t[n], s[n] = 255 & i, i >>= 8;
}
function gl(s, t) {
  let e = 1;
  for (let i = t; i >= 0 && e > 0; i--)
    e += s[i], s[i] = 255 & e, e >>= 8;
}
const xh = 16;
class s_ {
  constructor(t) {
    this.buffer = t, this.pos = 0, this.end = t.length, this.tmpBuf = new Uint8Array(19);
  }
  readByte() {
    return this.pos >= this.end ? -1 : this.buffer[this.pos++];
  }
  readNumber() {
    let t, e = 0;
    do {
      const i = this.readByte();
      if (i < 0) throw new st("unexpected EOF in bcmap");
      t = !(128 & i), e = e << 7 | 127 & i;
    } while (!t);
    return e;
  }
  readSigned() {
    const t = this.readNumber();
    return 1 & t ? ~(t >>> 1) : t >>> 1;
  }
  readHex(t, e) {
    t.set(this.buffer.subarray(this.pos, this.pos + e + 1)), this.pos += e + 1;
  }
  readHexNumber(t, e) {
    let i;
    const n = this.tmpBuf;
    let a = 0;
    do {
      const c = this.readByte();
      if (c < 0) throw new st("unexpected EOF in bcmap");
      i = !(128 & c), n[a++] = 127 & c;
    } while (!i);
    let r = e, o = 0, l = 0;
    for (; r >= 0; ) {
      for (; l < 8 && n.length > 0; )
        o |= n[--a] << l, l += 7;
      t[r] = 255 & o, r--, o >>= 8, l -= 8;
    }
  }
  readHexSigned(t, e) {
    this.readHexNumber(t, e);
    const i = 1 & t[e] ? 255 : 0;
    let n = 0;
    for (let a = 0; a <= e; a++)
      n = (1 & n) << 8 | t[a], t[a] = n >> 1 ^ i;
  }
  readString() {
    const t = this.readNumber(), e = new Array(t);
    for (let i = 0; i < t; i++) e[i] = this.readNumber();
    return String.fromCharCode(...e);
  }
}
class i_ {
  async process(t, e, i) {
    const n = new s_(t), a = n.readByte();
    e.vertical = !!(1 & a);
    let r = null;
    const o = new Uint8Array(xh), l = new Uint8Array(xh), c = new Uint8Array(xh), h = new Uint8Array(xh), u = new Uint8Array(xh);
    let f, d;
    for (; (d = n.readByte()) >= 0; ) {
      const p = d >> 5;
      if (p === 7) {
        switch (31 & d) {
          case 0:
            n.readString();
            break;
          case 1:
            r = n.readString();
        }
        continue;
      }
      const m = !!(16 & d), b = 15 & d;
      if (b + 1 > xh) throw new Error("BinaryCMapReader.process: Invalid dataSize.");
      const y = 1, v = n.readNumber();
      switch (p) {
        case 0:
          n.readHex(o, b), n.readHexNumber(l, b), ti(l, o, b), e.addCodespaceRange(b + 1, qs(o, b), qs(l, b));
          for (let w = 1; w < v; w++)
            gl(l, b), n.readHexNumber(o, b), ti(o, l, b), n.readHexNumber(l, b), ti(l, o, b), e.addCodespaceRange(b + 1, qs(o, b), qs(l, b));
          break;
        case 1:
          n.readHex(o, b), n.readHexNumber(l, b), ti(l, o, b), n.readNumber();
          for (let w = 1; w < v; w++)
            gl(l, b), n.readHexNumber(o, b), ti(o, l, b), n.readHexNumber(l, b), ti(l, o, b), n.readNumber();
          break;
        case 2:
          n.readHex(c, b), f = n.readNumber(), e.mapOne(qs(c, b), f);
          for (let w = 1; w < v; w++)
            gl(c, b), m || (n.readHexNumber(u, b), ti(c, u, b)), f = n.readSigned() + (f + 1), e.mapOne(qs(c, b), f);
          break;
        case 3:
          n.readHex(o, b), n.readHexNumber(l, b), ti(l, o, b), f = n.readNumber(), e.mapCidRange(qs(o, b), qs(l, b), f);
          for (let w = 1; w < v; w++)
            gl(l, b), m ? o.set(l) : (n.readHexNumber(o, b), ti(o, l, b)), n.readHexNumber(l, b), ti(l, o, b), f = n.readNumber(), e.mapCidRange(qs(o, b), qs(l, b), f);
          break;
        case 4:
          n.readHex(c, y), n.readHex(h, b), e.mapOne(qs(c, y), J2(h, b));
          for (let w = 1; w < v; w++)
            gl(c, y), m || (n.readHexNumber(u, y), ti(c, u, y)), gl(h, b), n.readHexSigned(u, b), ti(h, u, b), e.mapOne(qs(c, y), J2(h, b));
          break;
        case 5:
          n.readHex(o, y), n.readHexNumber(l, y), ti(l, o, y), n.readHex(h, b), e.mapBfRange(qs(o, y), qs(l, y), J2(h, b));
          for (let w = 1; w < v; w++)
            gl(l, y), m ? o.set(l) : (n.readHexNumber(o, y), ti(o, l, y)), n.readHexNumber(l, y), ti(l, o, y), n.readHex(h, b), e.mapBfRange(qs(o, y), qs(l, y), J2(h, b));
          break;
        default:
          throw new Error(`BinaryCMapReader.process - unknown type: ${p}`);
      }
    }
    return r ? i(r) : e;
  }
}
class n_ extends fi {
  constructor(t, e) {
    e && (e *= 0.8), super(e), this.str = t, this.dict = t.dict, this.input = new Uint8Array(5);
  }
  readBlock() {
    const t = this.str;
    let e = t.getByte();
    for (; Qi(e); ) e = t.getByte();
    if (e === -1 || e === 126) {
      this.eof = !0;
      return;
    }
    const i = this.bufferLength;
    let n, a;
    if (e === 122) {
      for (n = this.ensureBuffer(i + 4), a = 0; a < 4; ++a) n[i + a] = 0;
      this.bufferLength += 4;
    } else {
      const r = this.input;
      for (r[0] = e, a = 1; a < 5; ++a) {
        for (e = t.getByte(); Qi(e); ) e = t.getByte();
        if (r[a] = e, e === -1 || e === 126) break;
      }
      if (n = this.ensureBuffer(i + a - 1), this.bufferLength += a - 1, a < 5) {
        for (; a < 5; ++a) r[a] = 117;
        this.eof = !0;
      }
      let o = 0;
      for (a = 0; a < 5; ++a) o = 85 * o + (r[a] - 33);
      for (a = 3; a >= 0; --a)
        n[i + a] = 255 & o, o >>= 8;
    }
  }
}
class a_ extends fi {
  constructor(t, e) {
    e && (e *= 0.5), super(e), this.str = t, this.dict = t.dict, this.firstDigit = -1;
  }
  readBlock() {
    const t = this.str.getBytes(8e3);
    if (!t.length) {
      this.eof = !0;
      return;
    }
    const e = t.length + 1 >> 1, i = this.ensureBuffer(this.bufferLength + e);
    let n = this.bufferLength, a = this.firstDigit;
    for (const r of t) {
      let o;
      if (r >= 48 && r <= 57) o = 15 & r;
      else {
        if (!(r >= 65 && r <= 70 || r >= 97 && r <= 102)) {
          if (r === 62) {
            this.eof = !0;
            break;
          }
          continue;
        }
        o = 9 + (15 & r);
      }
      a < 0 ? a = o : (i[n++] = a << 4 | o, a = -1);
    }
    a >= 0 && this.eof && (i[n++] = a << 4, a = -1), this.firstDigit = a, this.bufferLength = n;
  }
}
const Wa = -1, t4 = [[-1, -1], [-1, -1], [7, 8], [7, 7], [6, 6], [6, 6], [6, 5], [6, 5], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2]], e4 = [[-1, -1], [12, -2], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]], s4 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]], i4 = [[-1, -1], [-1, -1], [12, -2], [12, -2], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]], n4 = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]], a4 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]];
class wA {
  constructor(t, e = {}) {
    if (typeof (t == null ? void 0 : t.next) != "function") throw new Error('CCITTFaxDecoder - invalid "source" parameter.');
    this.source = t, this.eof = !1, this.encoding = e.K || 0, this.eoline = e.EndOfLine || !1, this.byteAlign = e.EncodedByteAlign || !1, this.columns = e.Columns || 1728, this.rows = e.Rows || 0, this.eoblock = e.EndOfBlock ?? !0, this.black = e.BlackIs1 || !1, this.codingLine = new Uint32Array(this.columns + 1), this.refLine = new Uint32Array(this.columns + 2), this.codingLine[0] = this.columns, this.codingPos = 0, this.row = 0, this.nextLine2D = this.encoding < 0, this.inputBits = 0, this.inputBuf = 0, this.outputBits = 0, this.rowsDone = !1;
    let i;
    for (; (i = this._lookBits(12)) === 0; ) this._eatBits(1);
    i === 1 && this._eatBits(12), this.encoding > 0 && (this.nextLine2D = !this._lookBits(1), this._eatBits(1));
  }
  readNextChar() {
    if (this.eof) return -1;
    const t = this.refLine, e = this.codingLine, i = this.columns;
    let n, a, r, o, l;
    if (this.outputBits === 0) {
      if (this.rowsDone && (this.eof = !0), this.eof) return -1;
      this.err = !1;
      let c, h, u;
      if (this.nextLine2D) {
        for (o = 0; e[o] < i; ++o) t[o] = e[o];
        for (t[o++] = i, t[o] = i, e[0] = 0, this.codingPos = 0, n = 0, a = 0; e[this.codingPos] < i; )
          switch (c = this._getTwoDimCode(), c) {
            case 0:
              this._addPixels(t[n + 1], a), t[n + 1] < i && (n += 2);
              break;
            case 1:
              if (c = h = 0, a) {
                do
                  c += u = this._getBlackCode();
                while (u >= 64);
                do
                  h += u = this._getWhiteCode();
                while (u >= 64);
              } else {
                do
                  c += u = this._getWhiteCode();
                while (u >= 64);
                do
                  h += u = this._getBlackCode();
                while (u >= 64);
              }
              for (this._addPixels(e[this.codingPos] + c, a), e[this.codingPos] < i && this._addPixels(e[this.codingPos] + h, 1 ^ a); t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case 7:
              if (this._addPixels(t[n] + 3, a), a ^= 1, e[this.codingPos] < i)
                for (++n; t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case 5:
              if (this._addPixels(t[n] + 2, a), a ^= 1, e[this.codingPos] < i)
                for (++n; t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case 3:
              if (this._addPixels(t[n] + 1, a), a ^= 1, e[this.codingPos] < i)
                for (++n; t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case 2:
              if (this._addPixels(t[n], a), a ^= 1, e[this.codingPos] < i)
                for (++n; t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case 8:
              if (this._addPixelsNeg(t[n] - 3, a), a ^= 1, e[this.codingPos] < i)
                for (n > 0 ? --n : ++n; t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case 6:
              if (this._addPixelsNeg(t[n] - 2, a), a ^= 1, e[this.codingPos] < i)
                for (n > 0 ? --n : ++n; t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case 4:
              if (this._addPixelsNeg(t[n] - 1, a), a ^= 1, e[this.codingPos] < i)
                for (n > 0 ? --n : ++n; t[n] <= e[this.codingPos] && t[n] < i; ) n += 2;
              break;
            case Wa:
              this._addPixels(i, 0), this.eof = !0;
              break;
            default:
              qt("bad 2d code"), this._addPixels(i, 0), this.err = !0;
          }
      } else
        for (e[0] = 0, this.codingPos = 0, a = 0; e[this.codingPos] < i; ) {
          if (c = 0, a) do
            c += u = this._getBlackCode();
          while (u >= 64);
          else do
            c += u = this._getWhiteCode();
          while (u >= 64);
          this._addPixels(e[this.codingPos] + c, a), a ^= 1;
        }
      let f = !1;
      if (this.byteAlign && (this.inputBits &= -8), this.eoblock || this.row !== this.rows - 1) {
        if (c = this._lookBits(12), this.eoline) for (; c !== Wa && c !== 1; )
          this._eatBits(1), c = this._lookBits(12);
        else for (; c === 0; )
          this._eatBits(1), c = this._lookBits(12);
        c === 1 ? (this._eatBits(12), f = !0) : c === Wa && (this.eof = !0);
      } else this.rowsDone = !0;
      if (!this.eof && this.encoding > 0 && !this.rowsDone && (this.nextLine2D = !this._lookBits(1), this._eatBits(1)), this.eoblock && f && this.byteAlign) {
        if (c = this._lookBits(12), c === 1) {
          if (this._eatBits(12), this.encoding > 0 && (this._lookBits(1), this._eatBits(1)), this.encoding >= 0) for (o = 0; o < 4; ++o)
            c = this._lookBits(12), c !== 1 && qt("bad rtc code: " + c), this._eatBits(12), this.encoding > 0 && (this._lookBits(1), this._eatBits(1));
          this.eof = !0;
        }
      } else if (this.err && this.eoline) {
        for (; ; ) {
          if (c = this._lookBits(13), c === Wa)
            return this.eof = !0, -1;
          if (c >> 1 == 1) break;
          this._eatBits(1);
        }
        this._eatBits(12), this.encoding > 0 && (this._eatBits(1), this.nextLine2D = !(1 & c));
      }
      this.outputBits = e[0] > 0 ? e[this.codingPos = 0] : e[this.codingPos = 1], this.row++;
    }
    if (this.outputBits >= 8)
      l = 1 & this.codingPos ? 0 : 255, this.outputBits -= 8, this.outputBits === 0 && e[this.codingPos] < i && (this.codingPos++, this.outputBits = e[this.codingPos] - e[this.codingPos - 1]);
    else {
      r = 8, l = 0;
      do {
        if (typeof this.outputBits != "number") throw new st('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');
        this.outputBits > r ? (l <<= r, 1 & this.codingPos || (l |= 255 >> 8 - r), this.outputBits -= r, r = 0) : (l <<= this.outputBits, 1 & this.codingPos || (l |= 255 >> 8 - this.outputBits), r -= this.outputBits, this.outputBits = 0, e[this.codingPos] < i ? (this.codingPos++, this.outputBits = e[this.codingPos] - e[this.codingPos - 1]) : r > 0 && (l <<= r, r = 0));
      } while (r);
    }
    return this.black && (l ^= 255), l;
  }
  _addPixels(t, e) {
    const i = this.codingLine;
    let n = this.codingPos;
    t > i[n] && (t > this.columns && (qt("row is wrong length"), this.err = !0, t = this.columns), 1 & n ^ e && ++n, i[n] = t), this.codingPos = n;
  }
  _addPixelsNeg(t, e) {
    const i = this.codingLine;
    let n = this.codingPos;
    if (t > i[n])
      t > this.columns && (qt("row is wrong length"), this.err = !0, t = this.columns), 1 & n ^ e && ++n, i[n] = t;
    else if (t < i[n]) {
      for (t < 0 && (qt("invalid code"), this.err = !0, t = 0); n > 0 && t < i[n - 1]; ) --n;
      i[n] = t;
    }
    this.codingPos = n;
  }
  _findTableCode(t, e, i, n) {
    const a = n || 0;
    for (let r = t; r <= e; ++r) {
      let o = this._lookBits(r);
      if (o === Wa) return [!0, 1, !1];
      if (r < e && (o <<= e - r), !a || o >= a) {
        const l = i[o - a];
        if (l[0] === r)
          return this._eatBits(r), [!0, l[1], !0];
      }
    }
    return [!1, 0, !1];
  }
  _getTwoDimCode() {
    let t, e = 0;
    if (this.eoblock) {
      if (e = this._lookBits(7), t = t4[e], (t == null ? void 0 : t[0]) > 0)
        return this._eatBits(t[0]), t[1];
    } else {
      const i = this._findTableCode(1, 7, t4);
      if (i[0] && i[2]) return i[1];
    }
    return qt("Bad two dim code"), Wa;
  }
  _getWhiteCode() {
    let t, e = 0;
    if (this.eoblock) {
      if (e = this._lookBits(12), e === Wa) return 1;
      if (t = e >> 5 ? s4[e >> 3] : e4[e], t[0] > 0)
        return this._eatBits(t[0]), t[1];
    } else {
      let i = this._findTableCode(1, 9, s4);
      if (i[0] || (i = this._findTableCode(11, 12, e4), i[0])) return i[1];
    }
    return qt("bad white code"), this._eatBits(1), 1;
  }
  _getBlackCode() {
    let t, e;
    if (this.eoblock) {
      if (t = this._lookBits(13), t === Wa) return 1;
      if (e = t >> 7 ? !(t >> 9) && t >> 7 ? n4[(t >> 1) - 64] : a4[t >> 7] : i4[t], e[0] > 0)
        return this._eatBits(e[0]), e[1];
    } else {
      let i = this._findTableCode(2, 6, a4);
      if (i[0] || (i = this._findTableCode(7, 12, n4, 64), i[0]) || (i = this._findTableCode(10, 13, i4), i[0])) return i[1];
    }
    return qt("bad black code"), this._eatBits(1), 1;
  }
  _lookBits(t) {
    let e;
    for (; this.inputBits < t; ) {
      if ((e = this.source.next()) === -1) return this.inputBits === 0 ? Wa : this.inputBuf << t - this.inputBits & 65535 >> 16 - t;
      this.inputBuf = this.inputBuf << 8 | e, this.inputBits += 8;
    }
    return this.inputBuf >> this.inputBits - t & 65535 >> 16 - t;
  }
  _eatBits(t) {
    (this.inputBits -= t) < 0 && (this.inputBits = 0);
  }
}
class r_ extends fi {
  constructor(t, e, i) {
    super(e), this.str = t, this.dict = t.dict, i instanceof q || (i = q.empty);
    const n = { next: () => t.getByte() };
    this.ccittFaxDecoder = new wA(n, { K: i.get("K"), EndOfLine: i.get("EndOfLine"), EncodedByteAlign: i.get("EncodedByteAlign"), Columns: i.get("Columns"), Rows: i.get("Rows"), EndOfBlock: i.get("EndOfBlock"), BlackIs1: i.get("BlackIs1") });
  }
  readBlock() {
    for (; !this.eof; ) {
      const t = this.ccittFaxDecoder.readNextChar();
      if (t === -1) {
        this.eof = !0;
        return;
      }
      this.ensureBuffer(this.bufferLength + 1), this.buffer[this.bufferLength++] = t;
    }
  }
}
const r4 = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), o_ = new Int32Array([3, 4, 5, 6, 7, 8, 9, 10, 65547, 65549, 65551, 65553, 131091, 131095, 131099, 131103, 196643, 196651, 196659, 196667, 262211, 262227, 262243, 262259, 327811, 327843, 327875, 327907, 258, 258, 258]), l_ = new Int32Array([1, 2, 3, 4, 65541, 65543, 131081, 131085, 196625, 196633, 262177, 262193, 327745, 327777, 393345, 393409, 459009, 459137, 524801, 525057, 590849, 591361, 657409, 658433, 724993, 727041, 794625, 798721, 868353, 876545]), c_ = [new Int32Array([459008, 524368, 524304, 524568, 459024, 524400, 524336, 590016, 459016, 524384, 524320, 589984, 524288, 524416, 524352, 590048, 459012, 524376, 524312, 589968, 459028, 524408, 524344, 590032, 459020, 524392, 524328, 59e4, 524296, 524424, 524360, 590064, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590024, 459018, 524388, 524324, 589992, 524292, 524420, 524356, 590056, 459014, 524380, 524316, 589976, 459030, 524412, 524348, 590040, 459022, 524396, 524332, 590008, 524300, 524428, 524364, 590072, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590020, 459017, 524386, 524322, 589988, 524290, 524418, 524354, 590052, 459013, 524378, 524314, 589972, 459029, 524410, 524346, 590036, 459021, 524394, 524330, 590004, 524298, 524426, 524362, 590068, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590028, 459019, 524390, 524326, 589996, 524294, 524422, 524358, 590060, 459015, 524382, 524318, 589980, 459031, 524414, 524350, 590044, 459023, 524398, 524334, 590012, 524302, 524430, 524366, 590076, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590018, 459016, 524385, 524321, 589986, 524289, 524417, 524353, 590050, 459012, 524377, 524313, 589970, 459028, 524409, 524345, 590034, 459020, 524393, 524329, 590002, 524297, 524425, 524361, 590066, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590026, 459018, 524389, 524325, 589994, 524293, 524421, 524357, 590058, 459014, 524381, 524317, 589978, 459030, 524413, 524349, 590042, 459022, 524397, 524333, 590010, 524301, 524429, 524365, 590074, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590022, 459017, 524387, 524323, 589990, 524291, 524419, 524355, 590054, 459013, 524379, 524315, 589974, 459029, 524411, 524347, 590038, 459021, 524395, 524331, 590006, 524299, 524427, 524363, 590070, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590030, 459019, 524391, 524327, 589998, 524295, 524423, 524359, 590062, 459015, 524383, 524319, 589982, 459031, 524415, 524351, 590046, 459023, 524399, 524335, 590014, 524303, 524431, 524367, 590078, 459008, 524368, 524304, 524568, 459024, 524400, 524336, 590017, 459016, 524384, 524320, 589985, 524288, 524416, 524352, 590049, 459012, 524376, 524312, 589969, 459028, 524408, 524344, 590033, 459020, 524392, 524328, 590001, 524296, 524424, 524360, 590065, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590025, 459018, 524388, 524324, 589993, 524292, 524420, 524356, 590057, 459014, 524380, 524316, 589977, 459030, 524412, 524348, 590041, 459022, 524396, 524332, 590009, 524300, 524428, 524364, 590073, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590021, 459017, 524386, 524322, 589989, 524290, 524418, 524354, 590053, 459013, 524378, 524314, 589973, 459029, 524410, 524346, 590037, 459021, 524394, 524330, 590005, 524298, 524426, 524362, 590069, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590029, 459019, 524390, 524326, 589997, 524294, 524422, 524358, 590061, 459015, 524382, 524318, 589981, 459031, 524414, 524350, 590045, 459023, 524398, 524334, 590013, 524302, 524430, 524366, 590077, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590019, 459016, 524385, 524321, 589987, 524289, 524417, 524353, 590051, 459012, 524377, 524313, 589971, 459028, 524409, 524345, 590035, 459020, 524393, 524329, 590003, 524297, 524425, 524361, 590067, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590027, 459018, 524389, 524325, 589995, 524293, 524421, 524357, 590059, 459014, 524381, 524317, 589979, 459030, 524413, 524349, 590043, 459022, 524397, 524333, 590011, 524301, 524429, 524365, 590075, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590023, 459017, 524387, 524323, 589991, 524291, 524419, 524355, 590055, 459013, 524379, 524315, 589975, 459029, 524411, 524347, 590039, 459021, 524395, 524331, 590007, 524299, 524427, 524363, 590071, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590031, 459019, 524391, 524327, 589999, 524295, 524423, 524359, 590063, 459015, 524383, 524319, 589983, 459031, 524415, 524351, 590047, 459023, 524399, 524335, 590015, 524303, 524431, 524367, 590079]), 9], h_ = [new Int32Array([327680, 327696, 327688, 327704, 327684, 327700, 327692, 327708, 327682, 327698, 327690, 327706, 327686, 327702, 327694, 0, 327681, 327697, 327689, 327705, 327685, 327701, 327693, 327709, 327683, 327699, 327691, 327707, 327687, 327703, 327695, 0]), 5];
var Yo, Uh;
class o4 extends fi {
  constructor(e, i) {
    super(i);
    _(this, Yo);
    this.str = e, this.dict = e.dict;
    const n = e.getByte(), a = e.getByte();
    if (n === -1 || a === -1) throw new st(`Invalid header in flate stream: ${n}, ${a}`);
    if ((15 & n) != 8) throw new st(`Unknown compression method in flate stream: ${n}, ${a}`);
    if (((n << 8) + a) % 31 != 0) throw new st(`Bad FCHECK in flate stream: ${n}, ${a}`);
    if (32 & a) throw new st(`FDICT bit set in flate stream: ${n}, ${a}`);
    this.codeSize = 0, this.codeBuf = 0;
  }
  async getImageData(e, i) {
    const n = await this.asyncGetBytes();
    return n ? n.length <= e ? n : n.subarray(0, e) : this.getBytes(e);
  }
  async asyncGetBytes() {
    this.str.reset();
    const e = this.str.getBytes();
    try {
      const { readable: i, writable: n } = new DecompressionStream("deflate"), a = n.getWriter();
      await a.ready, a.write(e).then(async () => {
        await a.ready, await a.close();
      }).catch(() => {
      });
      const r = [];
      let o = 0;
      for await (const h of i)
        r.push(h), o += h.byteLength;
      const l = new Uint8Array(o);
      let c = 0;
      for (const h of r)
        l.set(h, c), c += h.byteLength;
      return l;
    } catch {
      return this.str = new Le(e, 2, e.length, this.str.dict), this.reset(), null;
    }
  }
  get isAsync() {
    return !0;
  }
  getBits(e) {
    const i = this.str;
    let n, a = this.codeSize, r = this.codeBuf;
    for (; a < e; ) {
      if ((n = i.getByte()) === -1) throw new st("Bad encoding in flate stream");
      r |= n << a, a += 8;
    }
    return n = r & (1 << e) - 1, this.codeBuf = r >> e, this.codeSize = a -= e, n;
  }
  getCode(e) {
    const i = this.str, n = e[0], a = e[1];
    let r, o = this.codeSize, l = this.codeBuf;
    for (; o < a && (r = i.getByte()) !== -1; )
      l |= r << o, o += 8;
    const c = n[l & (1 << a) - 1], h = c >> 16, u = 65535 & c;
    if (h < 1 || o < h) throw new st("Bad encoding in flate stream");
    return this.codeBuf = l >> h, this.codeSize = o - h, u;
  }
  generateHuffmanTable(e) {
    const i = e.length;
    let n, a = 0;
    for (n = 0; n < i; ++n) e[n] > a && (a = e[n]);
    const r = 1 << a, o = new Int32Array(r);
    for (let l = 1, c = 0, h = 2; l <= a; ++l, c <<= 1, h <<= 1) for (let u = 0; u < i; ++u) if (e[u] === l) {
      let f = 0, d = c;
      for (n = 0; n < l; ++n)
        f = f << 1 | 1 & d, d >>= 1;
      for (n = f; n < r; n += h) o[n] = l << 16 | u;
      ++c;
    }
    return [o, a];
  }
  readBlock() {
    let e, i, n;
    const a = this.str;
    try {
      i = this.getBits(3);
    } catch (h) {
      C(this, Yo, Uh).call(this, h.message);
      return;
    }
    if (1 & i && (this.eof = !0), i >>= 1, i === 0) {
      let h;
      if ((h = a.getByte()) === -1) {
        C(this, Yo, Uh).call(this, "Bad block header in flate stream");
        return;
      }
      let u = h;
      if ((h = a.getByte()) === -1) {
        C(this, Yo, Uh).call(this, "Bad block header in flate stream");
        return;
      }
      if (u |= h << 8, (h = a.getByte()) === -1) {
        C(this, Yo, Uh).call(this, "Bad block header in flate stream");
        return;
      }
      let f = h;
      if ((h = a.getByte()) === -1) {
        C(this, Yo, Uh).call(this, "Bad block header in flate stream");
        return;
      }
      if (f |= h << 8, f !== (65535 & ~u) && (u !== 0 || f !== 0)) throw new st("Bad uncompressed block length in flate stream");
      this.codeBuf = 0, this.codeSize = 0;
      const d = this.bufferLength, p = d + u;
      if (e = this.ensureBuffer(p), this.bufferLength = p, u === 0) a.peekByte() === -1 && (this.eof = !0);
      else {
        const m = a.getBytes(u);
        e.set(m, d), m.length < u && (this.eof = !0);
      }
      return;
    }
    let r, o;
    if (i === 1)
      r = c_, o = h_;
    else {
      if (i !== 2) throw new st("Unknown block type in flate stream");
      {
        const h = this.getBits(5) + 257, u = this.getBits(5) + 1, f = this.getBits(4) + 4, d = new Uint8Array(r4.length);
        let p;
        for (p = 0; p < f; ++p) d[r4[p]] = this.getBits(3);
        const m = this.generateHuffmanTable(d);
        n = 0, p = 0;
        const b = h + u, y = new Uint8Array(b);
        let v, w, A;
        for (; p < b; ) {
          const x = this.getCode(m);
          if (x === 16)
            v = 2, w = 3, A = n;
          else if (x === 17)
            v = 3, w = 3, A = n = 0;
          else {
            if (x !== 18) {
              y[p++] = n = x;
              continue;
            }
            v = 7, w = 11, A = n = 0;
          }
          let k = this.getBits(v) + w;
          for (; k-- > 0; ) y[p++] = A;
        }
        r = this.generateHuffmanTable(y.subarray(0, h)), o = this.generateHuffmanTable(y.subarray(h, b));
      }
    }
    e = this.buffer;
    let l = e ? e.length : 0, c = this.bufferLength;
    for (; ; ) {
      let h = this.getCode(r);
      if (h < 256) {
        c + 1 >= l && (e = this.ensureBuffer(c + 1), l = e.length), e[c++] = h;
        continue;
      }
      if (h === 256) {
        this.bufferLength = c;
        return;
      }
      h -= 257, h = o_[h];
      let u = h >> 16;
      u > 0 && (u = this.getBits(u)), n = (65535 & h) + u, h = this.getCode(o), h = l_[h], u = h >> 16, u > 0 && (u = this.getBits(u));
      const f = (65535 & h) + u;
      c + n >= l && (e = this.ensureBuffer(c + n), l = e.length);
      for (let d = 0; d < n; ++d, ++c) e[c] = e[c - f];
    }
  }
}
Yo = new WeakSet(), Uh = function(e) {
  qt(e), this.eof = !0;
};
const u_ = [{ qe: 22017, nmps: 1, nlps: 1, switchFlag: 1 }, { qe: 13313, nmps: 2, nlps: 6, switchFlag: 0 }, { qe: 6145, nmps: 3, nlps: 9, switchFlag: 0 }, { qe: 2753, nmps: 4, nlps: 12, switchFlag: 0 }, { qe: 1313, nmps: 5, nlps: 29, switchFlag: 0 }, { qe: 545, nmps: 38, nlps: 33, switchFlag: 0 }, { qe: 22017, nmps: 7, nlps: 6, switchFlag: 1 }, { qe: 21505, nmps: 8, nlps: 14, switchFlag: 0 }, { qe: 18433, nmps: 9, nlps: 14, switchFlag: 0 }, { qe: 14337, nmps: 10, nlps: 14, switchFlag: 0 }, { qe: 12289, nmps: 11, nlps: 17, switchFlag: 0 }, { qe: 9217, nmps: 12, nlps: 18, switchFlag: 0 }, { qe: 7169, nmps: 13, nlps: 20, switchFlag: 0 }, { qe: 5633, nmps: 29, nlps: 21, switchFlag: 0 }, { qe: 22017, nmps: 15, nlps: 14, switchFlag: 1 }, { qe: 21505, nmps: 16, nlps: 14, switchFlag: 0 }, { qe: 20737, nmps: 17, nlps: 15, switchFlag: 0 }, { qe: 18433, nmps: 18, nlps: 16, switchFlag: 0 }, { qe: 14337, nmps: 19, nlps: 17, switchFlag: 0 }, { qe: 13313, nmps: 20, nlps: 18, switchFlag: 0 }, { qe: 12289, nmps: 21, nlps: 19, switchFlag: 0 }, { qe: 10241, nmps: 22, nlps: 19, switchFlag: 0 }, { qe: 9217, nmps: 23, nlps: 20, switchFlag: 0 }, { qe: 8705, nmps: 24, nlps: 21, switchFlag: 0 }, { qe: 7169, nmps: 25, nlps: 22, switchFlag: 0 }, { qe: 6145, nmps: 26, nlps: 23, switchFlag: 0 }, { qe: 5633, nmps: 27, nlps: 24, switchFlag: 0 }, { qe: 5121, nmps: 28, nlps: 25, switchFlag: 0 }, { qe: 4609, nmps: 29, nlps: 26, switchFlag: 0 }, { qe: 4353, nmps: 30, nlps: 27, switchFlag: 0 }, { qe: 2753, nmps: 31, nlps: 28, switchFlag: 0 }, { qe: 2497, nmps: 32, nlps: 29, switchFlag: 0 }, { qe: 2209, nmps: 33, nlps: 30, switchFlag: 0 }, { qe: 1313, nmps: 34, nlps: 31, switchFlag: 0 }, { qe: 1089, nmps: 35, nlps: 32, switchFlag: 0 }, { qe: 673, nmps: 36, nlps: 33, switchFlag: 0 }, { qe: 545, nmps: 37, nlps: 34, switchFlag: 0 }, { qe: 321, nmps: 38, nlps: 35, switchFlag: 0 }, { qe: 273, nmps: 39, nlps: 36, switchFlag: 0 }, { qe: 133, nmps: 40, nlps: 37, switchFlag: 0 }, { qe: 73, nmps: 41, nlps: 38, switchFlag: 0 }, { qe: 37, nmps: 42, nlps: 39, switchFlag: 0 }, { qe: 21, nmps: 43, nlps: 40, switchFlag: 0 }, { qe: 9, nmps: 44, nlps: 41, switchFlag: 0 }, { qe: 5, nmps: 45, nlps: 42, switchFlag: 0 }, { qe: 1, nmps: 45, nlps: 43, switchFlag: 0 }, { qe: 22017, nmps: 46, nlps: 46, switchFlag: 0 }];
class d_ {
  constructor(t, e, i) {
    this.data = t, this.bp = e, this.dataEnd = i, this.chigh = t[e], this.clow = 0, this.byteIn(), this.chigh = this.chigh << 7 & 65535 | this.clow >> 9 & 127, this.clow = this.clow << 7 & 65535, this.ct -= 7, this.a = 32768;
  }
  byteIn() {
    const t = this.data;
    let e = this.bp;
    t[e] === 255 ? t[e + 1] > 143 ? (this.clow += 65280, this.ct = 8) : (e++, this.clow += t[e] << 9, this.ct = 7, this.bp = e) : (e++, this.clow += e < this.dataEnd ? t[e] << 8 : 65280, this.ct = 8, this.bp = e), this.clow > 65535 && (this.chigh += this.clow >> 16, this.clow &= 65535);
  }
  readBit(t, e) {
    let i = t[e] >> 1, n = 1 & t[e];
    const a = u_[i], r = a.qe;
    let o, l = this.a - r;
    if (this.chigh < r) l < r ? (l = r, o = n, i = a.nmps) : (l = r, o = 1 ^ n, a.switchFlag === 1 && (n = o), i = a.nlps);
    else {
      if (this.chigh -= r, 32768 & l)
        return this.a = l, n;
      l < r ? (o = 1 ^ n, a.switchFlag === 1 && (n = o), i = a.nlps) : (o = n, i = a.nmps);
    }
    do
      this.ct === 0 && this.byteIn(), l <<= 1, this.chigh = this.chigh << 1 & 65535 | this.clow >> 15 & 1, this.clow = this.clow << 1 & 65535, this.ct--;
    while (!(32768 & l));
    return this.a = l, t[e] = i << 1 | n, o;
  }
}
class Pe extends gi {
  constructor(t) {
    super(t, "Jbig2Error");
  }
}
class f_ {
  getContexts(t) {
    return t in this ? this[t] : this[t] = new Int8Array(65536);
  }
}
class W1 {
  constructor(t, e, i) {
    this.data = t, this.start = e, this.end = i;
  }
  get decoder() {
    return gt(this, "decoder", new d_(this.data, this.start, this.end));
  }
  get contextCache() {
    return gt(this, "contextCache", new f_());
  }
}
function Xs(s, t, e) {
  const i = s.getContexts(t);
  let n = 1;
  function a(c) {
    let h = 0;
    for (let u = 0; u < c; u++) {
      const f = e.readBit(i, n);
      n = n < 256 ? n << 1 | f : 511 & (n << 1 | f) | 256, h = h << 1 | f;
    }
    return h >>> 0;
  }
  const r = a(1), o = a(1) ? a(1) ? a(1) ? a(1) ? a(1) ? a(32) + 4436 : a(12) + 340 : a(8) + 84 : a(6) + 20 : a(4) + 4 : a(2);
  let l;
  return r === 0 ? l = o : o > 0 && (l = -o), l >= -2147483648 && l <= U3 ? l : null;
}
function vA(s, t, e) {
  const i = s.getContexts("IAID");
  let n = 1;
  for (let a = 0; a < e; a++)
    n = n << 1 | t.readBit(i, n);
  return e < 31 ? n & (1 << e) - 1 : 2147483647 & n;
}
const l4 = ["SymbolDictionary", null, null, null, "IntermediateTextRegion", null, "ImmediateTextRegion", "ImmediateLosslessTextRegion", null, null, null, null, null, null, null, null, "PatternDictionary", null, null, null, "IntermediateHalftoneRegion", null, "ImmediateHalftoneRegion", "ImmediateLosslessHalftoneRegion", null, null, null, null, null, null, null, null, null, null, null, null, "IntermediateGenericRegion", null, "ImmediateGenericRegion", "ImmediateLosslessGenericRegion", "IntermediateGenericRefinementRegion", null, "ImmediateGenericRefinementRegion", "ImmediateLosslessGenericRefinementRegion", null, null, null, null, "PageInformation", "EndOfPage", "EndOfStripe", "EndOfFile", "Profiles", "Tables", null, null, null, null, null, null, null, null, "Extension"], g_ = [[{ x: -1, y: -2 }, { x: 0, y: -2 }, { x: 1, y: -2 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: 2, y: -1 }, { x: -4, y: 0 }, { x: -3, y: 0 }, { x: -2, y: 0 }, { x: -1, y: 0 }], [{ x: -1, y: -2 }, { x: 0, y: -2 }, { x: 1, y: -2 }, { x: 2, y: -2 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: 2, y: -1 }, { x: -3, y: 0 }, { x: -2, y: 0 }, { x: -1, y: 0 }], [{ x: -1, y: -2 }, { x: 0, y: -2 }, { x: 1, y: -2 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: -2, y: 0 }, { x: -1, y: 0 }], [{ x: -3, y: -1 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: -4, y: 0 }, { x: -3, y: 0 }, { x: -2, y: 0 }, { x: -1, y: 0 }]], c4 = [{ coding: [{ x: 0, y: -1 }, { x: 1, y: -1 }, { x: -1, y: 0 }], reference: [{ x: 0, y: -1 }, { x: 1, y: -1 }, { x: -1, y: 0 }, { x: 0, y: 0 }, { x: 1, y: 0 }, { x: -1, y: 1 }, { x: 0, y: 1 }, { x: 1, y: 1 }] }, { coding: [{ x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: -1, y: 0 }], reference: [{ x: 0, y: -1 }, { x: -1, y: 0 }, { x: 0, y: 0 }, { x: 1, y: 0 }, { x: 0, y: 1 }, { x: 1, y: 1 }] }], p_ = [39717, 1941, 229, 405];
function Z2(s, t, e, i, n, a, r, o) {
  if (s)
    return n6(new Md(o.data, o.start, o.end), t, e, !1);
  if (i === 0 && !n && r.length === 4 && r[0].x === 3 && r[0].y === -1 && r[1].x === -3 && r[1].y === -1 && r[2].x === 2 && r[2].y === -2 && r[3].x === -2 && r[3].y === -2) return function(z, K, W) {
    const rt = W.decoder, $ = W.contextCache.getContexts("GB"), nt = [];
    let wt, O, U, Q, lt, pt, ft;
    for (O = 0; O < K; O++)
      for (lt = nt[O] = new Uint8Array(z), pt = O < 1 ? lt : nt[O - 1], ft = O < 2 ? lt : nt[O - 2], wt = ft[0] << 13 | ft[1] << 12 | ft[2] << 11 | pt[0] << 7 | pt[1] << 6 | pt[2] << 5 | pt[3] << 4, U = 0; U < z; U++)
        lt[U] = Q = rt.readBit($, wt), wt = (31735 & wt) << 1 | (U + 3 < z ? ft[U + 3] << 11 : 0) | (U + 4 < z ? pt[U + 4] << 4 : 0) | Q;
    return nt;
  }(t, e, o);
  const l = g_[i].concat(r);
  l.sort((X, z) => X.y - z.y || X.x - z.x);
  const c = l.length, h = new Int8Array(c), u = new Int8Array(c), f = [];
  let d, p, m = 0, b = 0, y = 0, v = 0;
  for (p = 0; p < c; p++)
    h[p] = l[p].x, u[p] = l[p].y, b = Math.min(b, l[p].x), y = Math.max(y, l[p].x), v = Math.min(v, l[p].y), p < c - 1 && l[p].y === l[p + 1].y && l[p].x === l[p + 1].x - 1 ? m |= 1 << c - 1 - p : f.push(p);
  const w = f.length, A = new Int8Array(w), x = new Int8Array(w), k = new Uint16Array(w);
  for (d = 0; d < w; d++)
    p = f[d], A[d] = l[p].x, x[d] = l[p].y, k[d] = 1 << c - 1 - p;
  const I = -b, T = -v, E = t - y, M = p_[i];
  let F = new Uint8Array(t);
  const L = [], Y = o.decoder, B = o.contextCache.getContexts("GB");
  let et, H, P, G, N, j = 0, V = 0;
  for (let X = 0; X < e; X++) {
    if (n && (j ^= Y.readBit(B, M), j)) {
      L.push(F);
      continue;
    }
    for (F = new Uint8Array(F), L.push(F), et = 0; et < t; et++) {
      if (et >= I && et < E && X >= T)
        for (V = V << 1 & m, p = 0; p < w; p++)
          H = X + x[p], P = et + A[p], G = L[H][P], G && (G = k[p], V |= G);
      else
        for (V = 0, N = c - 1, p = 0; p < c; p++, N--)
          P = et + h[p], P >= 0 && P < t && (H = X + u[p], H >= 0 && (G = L[H][P], G && (V |= G << N)));
      const z = Y.readBit(B, V);
      F[et] = z;
    }
  }
  return L;
}
function AA(s, t, e, i, n, a, r, o, l) {
  let c = c4[e].coding;
  e === 0 && (c = c.concat([o[0]]));
  const h = c.length, u = new Int32Array(h), f = new Int32Array(h);
  let d;
  for (d = 0; d < h; d++)
    u[d] = c[d].x, f[d] = c[d].y;
  let p = c4[e].reference;
  e === 0 && (p = p.concat([o[1]]));
  const m = p.length, b = new Int32Array(m), y = new Int32Array(m);
  for (d = 0; d < m; d++)
    b[d] = p[d].x, y[d] = p[d].y;
  const v = i[0].length, w = i.length, A = [], x = l.decoder, k = l.contextCache.getContexts("GR");
  for (let I = 0; I < t; I++) {
    const T = new Uint8Array(s);
    A.push(T);
    for (let E = 0; E < s; E++) {
      let M, F, L = 0;
      for (d = 0; d < h; d++)
        M = I + f[d], F = E + u[d], M < 0 || F < 0 || F >= s ? L <<= 1 : L = L << 1 | A[M][F];
      for (d = 0; d < m; d++)
        M = I + y[d] - a, F = E + b[d] - n, M < 0 || M >= w || F < 0 || F >= v ? L <<= 1 : L = L << 1 | i[M][F];
      const Y = x.readBit(k, L);
      T[E] = Y;
    }
  }
  return A;
}
function h4(s, t, e, i, n, a, r, o, l, c, h, u, f, d, p, m, b, y, v) {
  if (s && t) throw new Pe("refinement with Huffman is not supported");
  const w = [];
  let A, x;
  for (A = 0; A < i; A++)
    x = new Uint8Array(e), n && x.fill(n), w.push(x);
  const k = b.decoder, I = b.contextCache;
  let T = s ? -d.tableDeltaT.decode(v) : -Xs(I, "IADT", k), E = 0;
  for (A = 0; A < a; ) {
    T += s ? d.tableDeltaT.decode(v) : Xs(I, "IADT", k), E += s ? d.tableFirstS.decode(v) : Xs(I, "IAFS", k);
    let M = E;
    for (; ; ) {
      let F = 0;
      r > 1 && (F = s ? v.readBits(y) : Xs(I, "IAIT", k));
      const L = r * T + F, Y = s ? d.symbolIDTable.decode(v) : vA(I, k, l), B = t && (s ? v.readBit() : Xs(I, "IARI", k));
      let et = o[Y], H = et[0].length, P = et.length;
      if (B) {
        const W = Xs(I, "IARDW", k), rt = Xs(I, "IARDH", k);
        H += W, P += rt, et = AA(H, P, p, et, (W >> 1) + Xs(I, "IARDX", k), (rt >> 1) + Xs(I, "IARDY", k), !1, m, b);
      }
      let G = 0;
      c ? 1 & u ? G = P - 1 : M += P - 1 : u > 1 ? M += H - 1 : G = H - 1;
      const N = L - (1 & u ? 0 : P - 1), j = M - (2 & u ? H - 1 : 0);
      let V, X, z;
      if (c) for (V = 0; V < P; V++) {
        if (x = w[j + V], !x) continue;
        z = et[V];
        const W = Math.min(e - N, H);
        switch (f) {
          case 0:
            for (X = 0; X < W; X++) x[N + X] |= z[X];
            break;
          case 2:
            for (X = 0; X < W; X++) x[N + X] ^= z[X];
            break;
          default:
            throw new Pe(`operator ${f} is not supported`);
        }
      }
      else for (X = 0; X < P; X++)
        if (x = w[N + X], x)
          switch (z = et[X], f) {
            case 0:
              for (V = 0; V < H; V++) x[j + V] |= z[V];
              break;
            case 2:
              for (V = 0; V < H; V++) x[j + V] ^= z[V];
              break;
            default:
              throw new Pe(`operator ${f} is not supported`);
          }
      A++;
      const K = s ? d.tableDeltaS.decode(v) : Xs(I, "IADS", k);
      if (K === null) break;
      M += G + K + h;
    }
  }
  return w;
}
function m_(s, t) {
  const e = {};
  e.number = he(s, t);
  const i = s[t + 4], n = 63 & i;
  if (!l4[n]) throw new Pe("invalid segment type: " + n);
  e.type = n, e.typeName = l4[n], e.deferredNonRetain = !!(128 & i);
  const a = !!(64 & i), r = s[t + 5];
  let o = r >> 5 & 7;
  const l = [31 & r];
  let c = t + 6;
  if (r === 7) {
    o = 536870911 & he(s, c - 1), c += 3;
    let p = o + 7 >> 3;
    for (l[0] = s[c++]; --p > 0; ) l.push(s[c++]);
  } else if (r === 5 || r === 6) throw new Pe("invalid referred-to flags");
  e.retainBits = l;
  let h = 4;
  e.number <= 256 ? h = 1 : e.number <= 65536 && (h = 2);
  const u = [];
  let f, d;
  for (f = 0; f < o; f++) {
    let p;
    p = h === 1 ? s[c] : h === 2 ? $t(s, c) : he(s, c), u.push(p), c += h;
  }
  if (e.referredTo = u, a ? (e.pageAssociation = he(s, c), c += 4) : e.pageAssociation = s[c++], e.length = he(s, c), c += 4, e.length === 4294967295) {
    if (n !== 38) throw new Pe("invalid unknown segment length");
    {
      const p = Xg(s, c), m = !!(1 & s[c + Kg]), b = 6, y = new Uint8Array(b);
      for (m || (y[0] = 255, y[1] = 172), y[2] = p.height >>> 24 & 255, y[3] = p.height >> 16 & 255, y[4] = p.height >> 8 & 255, y[5] = 255 & p.height, f = c, d = s.length; f < d; f++) {
        let v = 0;
        for (; v < b && y[v] === s[f + v]; ) v++;
        if (v === b) {
          e.length = f + b;
          break;
        }
      }
      if (e.length === 4294967295) throw new Pe("segment end was not found");
    }
  }
  return e.headerEnd = c, e;
}
function b_(s, t, e, i) {
  const n = [];
  let a = e;
  for (; a < i; ) {
    const r = m_(t, a);
    a = r.headerEnd;
    const o = { header: r, data: t };
    if (s.randomAccess || (o.start = a, a += r.length, o.end = a), n.push(o), r.type === 51) break;
  }
  if (s.randomAccess) for (let r = 0, o = n.length; r < o; r++)
    n[r].start = a, a += n[r].header.length, n[r].end = a;
  return n;
}
function Xg(s, t) {
  return { width: he(s, t), height: he(s, t + 4), x: he(s, t + 8), y: he(s, t + 12), combinationOperator: 7 & s[t + 16] };
}
const Kg = 17;
function y_(s, t) {
  const e = s.header, i = s.data, n = s.end;
  let a, r, o, l, c = s.start;
  switch (e.type) {
    case 0:
      const u = {}, f = $t(i, c);
      if (u.huffman = !!(1 & f), u.refinement = !!(2 & f), u.huffmanDHSelector = f >> 2 & 3, u.huffmanDWSelector = f >> 4 & 3, u.bitmapSizeSelector = f >> 6 & 1, u.aggregationInstancesSelector = f >> 7 & 1, u.bitmapCodingContextUsed = !!(256 & f), u.bitmapCodingContextRetained = !!(512 & f), u.template = f >> 10 & 3, u.refinementTemplate = f >> 12 & 1, c += 2, !u.huffman) {
        for (l = u.template === 0 ? 4 : 1, r = [], o = 0; o < l; o++)
          r.push({ x: pa(i, c), y: pa(i, c + 1) }), c += 2;
        u.at = r;
      }
      if (u.refinement && !u.refinementTemplate) {
        for (r = [], o = 0; o < 2; o++)
          r.push({ x: pa(i, c), y: pa(i, c + 1) }), c += 2;
        u.refinementAt = r;
      }
      u.numberOfExportedSymbols = he(i, c), c += 4, u.numberOfNewSymbols = he(i, c), c += 4, a = [u, e.number, e.referredTo, i, c, n];
      break;
    case 6:
    case 7:
      const d = {};
      d.info = Xg(i, c), c += Kg;
      const p = $t(i, c);
      if (c += 2, d.huffman = !!(1 & p), d.refinement = !!(2 & p), d.logStripSize = p >> 2 & 3, d.stripSize = 1 << d.logStripSize, d.referenceCorner = p >> 4 & 3, d.transposed = !!(64 & p), d.combinationOperator = p >> 7 & 3, d.defaultPixelValue = p >> 9 & 1, d.dsOffset = p << 17 >> 27, d.refinementTemplate = p >> 15 & 1, d.huffman) {
        const I = $t(i, c);
        c += 2, d.huffmanFS = 3 & I, d.huffmanDS = I >> 2 & 3, d.huffmanDT = I >> 4 & 3, d.huffmanRefinementDW = I >> 6 & 3, d.huffmanRefinementDH = I >> 8 & 3, d.huffmanRefinementDX = I >> 10 & 3, d.huffmanRefinementDY = I >> 12 & 3, d.huffmanRefinementSizeSelector = !!(16384 & I);
      }
      if (d.refinement && !d.refinementTemplate) {
        for (r = [], o = 0; o < 2; o++)
          r.push({ x: pa(i, c), y: pa(i, c + 1) }), c += 2;
        d.refinementAt = r;
      }
      d.numberOfSymbolInstances = he(i, c), c += 4, a = [d, e.referredTo, i, c, n];
      break;
    case 16:
      const m = {}, b = i[c++];
      m.mmr = !!(1 & b), m.template = b >> 1 & 3, m.patternWidth = i[c++], m.patternHeight = i[c++], m.maxPatternIndex = he(i, c), c += 4, a = [m, e.number, i, c, n];
      break;
    case 22:
    case 23:
      const y = {};
      y.info = Xg(i, c), c += Kg;
      const v = i[c++];
      y.mmr = !!(1 & v), y.template = v >> 1 & 3, y.enableSkip = !!(8 & v), y.combinationOperator = v >> 4 & 7, y.defaultPixelValue = v >> 7 & 1, y.gridWidth = he(i, c), c += 4, y.gridHeight = he(i, c), c += 4, y.gridOffsetX = 4294967295 & he(i, c), c += 4, y.gridOffsetY = 4294967295 & he(i, c), c += 4, y.gridVectorX = $t(i, c), c += 2, y.gridVectorY = $t(i, c), c += 2, a = [y, e.referredTo, i, c, n];
      break;
    case 38:
    case 39:
      const w = {};
      w.info = Xg(i, c), c += Kg;
      const A = i[c++];
      if (w.mmr = !!(1 & A), w.template = A >> 1 & 3, w.prediction = !!(8 & A), !w.mmr) {
        for (l = w.template === 0 ? 4 : 1, r = [], o = 0; o < l; o++)
          r.push({ x: pa(i, c), y: pa(i, c + 1) }), c += 2;
        w.at = r;
      }
      a = [w, i, c, n];
      break;
    case 48:
      const x = { width: he(i, c), height: he(i, c + 4), resolutionX: he(i, c + 8), resolutionY: he(i, c + 12) };
      x.height === 4294967295 && delete x.height;
      const k = i[c + 16];
      $t(i, c + 17), x.lossless = !!(1 & k), x.refinement = !!(2 & k), x.defaultPixelValue = k >> 2 & 1, x.combinationOperator = k >> 3 & 3, x.requiresBuffer = !!(32 & k), x.combinationOperatorOverride = !!(64 & k), a = [x];
      break;
    case 49:
    case 50:
    case 51:
    case 62:
      break;
    case 53:
      a = [e.number, i, c, n];
      break;
    default:
      throw new Pe(`segment type ${e.typeName}(${e.type}) is not implemented`);
  }
  const h = "on" + e.typeName;
  h in t && t[h].apply(t, a);
}
function w_(s, t) {
  for (let e = 0, i = s.length; e < i; e++) y_(s[e], t);
}
class v_ {
  onPageInformation(t) {
    this.currentPageInfo = t;
    const e = t.width + 7 >> 3, i = new Uint8ClampedArray(e * t.height);
    t.defaultPixelValue && i.fill(255), this.buffer = i;
  }
  drawBitmap(t, e) {
    const i = this.currentPageInfo, n = t.width, a = t.height, r = i.width + 7 >> 3, o = i.combinationOperatorOverride ? t.combinationOperator : i.combinationOperator, l = this.buffer, c = 128 >> (7 & t.x);
    let h, u, f, d, p = t.y * r + (t.x >> 3);
    switch (o) {
      case 0:
        for (h = 0; h < a; h++) {
          for (f = c, d = p, u = 0; u < n; u++)
            e[h][u] && (l[d] |= f), f >>= 1, f || (f = 128, d++);
          p += r;
        }
        break;
      case 2:
        for (h = 0; h < a; h++) {
          for (f = c, d = p, u = 0; u < n; u++)
            e[h][u] && (l[d] ^= f), f >>= 1, f || (f = 128, d++);
          p += r;
        }
        break;
      default:
        throw new Pe(`operator ${o} is not supported`);
    }
  }
  onImmediateGenericRegion(t, e, i, n) {
    const a = t.info, r = new W1(e, i, n), o = Z2(t.mmr, a.width, a.height, t.template, t.prediction, null, t.at, r);
    this.drawBitmap(a, o);
  }
  onImmediateLosslessGenericRegion() {
    this.onImmediateGenericRegion(...arguments);
  }
  onSymbolDictionary(t, e, i, n, a, r) {
    let o, l;
    t.huffman && (o = function(d, p, m) {
      let b, y, v, w, A = 0;
      switch (d.huffmanDHSelector) {
        case 0:
        case 1:
          b = Zr(d.huffmanDHSelector + 4);
          break;
        case 3:
          b = pl(A, p, m), A++;
          break;
        default:
          throw new Pe("invalid Huffman DH selector");
      }
      switch (d.huffmanDWSelector) {
        case 0:
        case 1:
          y = Zr(d.huffmanDWSelector + 2);
          break;
        case 3:
          y = pl(A, p, m), A++;
          break;
        default:
          throw new Pe("invalid Huffman DW selector");
      }
      return d.bitmapSizeSelector ? (v = pl(A, p, m), A++) : v = Zr(1), w = d.aggregationInstancesSelector ? pl(A, p, m) : Zr(1), { tableDeltaHeight: b, tableDeltaWidth: y, tableBitmapSize: v, tableAggregateInstances: w };
    }(t, i, this.customTables), l = new Md(n, a, r));
    let c = this.symbols;
    c || (this.symbols = c = {});
    const h = [];
    for (const f of i) {
      const d = c[f];
      d && h.push(...d);
    }
    const u = new W1(n, a, r);
    c[e] = function(d, p, m, b, y, v, w, A, x, k, I, T) {
      if (d && p) throw new Pe("symbol refinement with Huffman is not supported");
      const E = [];
      let M = 0, F = xm(m.length + b);
      const L = I.decoder, Y = I.contextCache;
      let B, et;
      for (d && (B = Zr(1), et = [], F = Math.max(F, 1)); E.length < b; ) {
        M += d ? v.tableDeltaHeight.decode(T) : Xs(Y, "IADH", L);
        let X = 0, z = 0;
        const K = d ? et.length : 0;
        for (; ; ) {
          const W = d ? v.tableDeltaWidth.decode(T) : Xs(Y, "IADW", L);
          if (W === null) break;
          X += W, z += X;
          let rt;
          if (p) {
            const $ = Xs(Y, "IAAI", L);
            if ($ > 1) rt = h4(d, p, X, M, 0, $, 1, m.concat(E), F, 0, 0, 1, 0, v, x, k, I, 0, T);
            else {
              const nt = vA(Y, L, F), wt = Xs(Y, "IARDX", L), O = Xs(Y, "IARDY", L);
              rt = AA(X, M, x, nt < m.length ? m[nt] : E[nt - m.length], wt, O, !1, k, I);
            }
            E.push(rt);
          } else d ? et.push(X) : (rt = Z2(!1, X, M, w, !1, null, A, I), E.push(rt));
        }
        if (d && !p) {
          const W = v.tableBitmapSize.decode(T);
          T.byteAlign();
          let rt;
          if (W === 0) rt = A_(T, z, M);
          else {
            const nt = T.end, wt = T.position + W;
            T.end = wt, rt = n6(T, z, M, !1), T.end = nt, T.position = wt;
          }
          const $ = et.length;
          if (K === $ - 1) E.push(rt);
          else {
            let nt, wt, O, U, Q, lt = 0;
            for (nt = K; nt < $; nt++) {
              for (U = et[nt], O = lt + U, Q = [], wt = 0; wt < M; wt++) Q.push(rt[wt].subarray(lt, O));
              E.push(Q), lt = O;
            }
          }
        }
      }
      const H = [], P = [];
      let G, N, j = !1;
      const V = m.length + b;
      for (; P.length < V; ) {
        let X = d ? B.decode(T) : Xs(Y, "IAEX", L);
        for (; X--; ) P.push(j);
        j = !j;
      }
      for (G = 0, N = m.length; G < N; G++) P[G] && H.push(m[G]);
      for (let X = 0; X < b; G++, X++) P[G] && H.push(E[X]);
      return H;
    }(t.huffman, t.refinement, h, t.numberOfNewSymbols, t.numberOfExportedSymbols, o, t.template, t.at, t.refinementTemplate, t.refinementAt, u, l);
  }
  onImmediateTextRegion(t, e, i, n, a) {
    const r = t.info;
    let o, l;
    const c = this.symbols, h = [];
    for (const p of e) {
      const m = c[p];
      m && h.push(...m);
    }
    const u = xm(h.length);
    t.huffman && (l = new Md(i, n, a), o = function(m, b, y, v, w) {
      const A = [];
      for (let F = 0; F <= 34; F++) {
        const L = w.readBits(4);
        A.push(new io([F, L, 0, 0]));
      }
      const x = new Yg(A, !1);
      A.length = 0;
      for (let F = 0; F < v; ) {
        const L = x.decode(w);
        if (L >= 32) {
          let Y, B, et;
          switch (L) {
            case 32:
              if (F === 0) throw new Pe("no previous value in symbol ID table");
              B = w.readBits(2) + 3, Y = A[F - 1].prefixLength;
              break;
            case 33:
              B = w.readBits(3) + 3, Y = 0;
              break;
            case 34:
              B = w.readBits(7) + 11, Y = 0;
              break;
            default:
              throw new Pe("invalid code length in symbol ID table");
          }
          for (et = 0; et < B; et++)
            A.push(new io([F, Y, 0, 0])), F++;
        } else
          A.push(new io([F, L, 0, 0])), F++;
      }
      w.byteAlign();
      const k = new Yg(A, !1);
      let I, T, E, M = 0;
      switch (m.huffmanFS) {
        case 0:
        case 1:
          I = Zr(m.huffmanFS + 6);
          break;
        case 3:
          I = pl(M, b, y), M++;
          break;
        default:
          throw new Pe("invalid Huffman FS selector");
      }
      switch (m.huffmanDS) {
        case 0:
        case 1:
        case 2:
          T = Zr(m.huffmanDS + 8);
          break;
        case 3:
          T = pl(M, b, y), M++;
          break;
        default:
          throw new Pe("invalid Huffman DS selector");
      }
      switch (m.huffmanDT) {
        case 0:
        case 1:
        case 2:
          E = Zr(m.huffmanDT + 11);
          break;
        case 3:
          E = pl(M, b, y), M++;
          break;
        default:
          throw new Pe("invalid Huffman DT selector");
      }
      if (m.refinement) throw new Pe("refinement with Huffman is not supported");
      return { symbolIDTable: k, tableFirstS: I, tableDeltaS: T, tableDeltaT: E };
    }(t, e, this.customTables, h.length, l));
    const f = new W1(i, n, a), d = h4(t.huffman, t.refinement, r.width, r.height, t.defaultPixelValue, t.numberOfSymbolInstances, t.stripSize, h, u, t.transposed, t.dsOffset, t.referenceCorner, t.combinationOperator, o, t.refinementTemplate, t.refinementAt, f, t.logStripSize, l);
    this.drawBitmap(r, d);
  }
  onImmediateLosslessTextRegion() {
    this.onImmediateTextRegion(...arguments);
  }
  onPatternDictionary(t, e, i, n, a) {
    let r = this.patterns;
    r || (this.patterns = r = {});
    const o = new W1(i, n, a);
    r[e] = function(c, h, u, f, d, p) {
      const m = [];
      c || (m.push({ x: -h, y: 0 }), d === 0 && m.push({ x: -3, y: -1 }, { x: 2, y: -2 }, { x: -2, y: -2 }));
      const b = Z2(c, (f + 1) * h, u, d, !1, null, m, p), y = [];
      for (let v = 0; v <= f; v++) {
        const w = [], A = h * v, x = A + h;
        for (let k = 0; k < u; k++) w.push(b[k].subarray(A, x));
        y.push(w);
      }
      return y;
    }(t.mmr, t.patternWidth, t.patternHeight, t.maxPatternIndex, t.template, o);
  }
  onImmediateHalftoneRegion(t, e, i, n, a) {
    const r = this.patterns[e[0]], o = t.info, l = new W1(i, n, a), c = function(u, f, d, p, m, b, y, v, w, A, x, k, I, T, E) {
      if (y) throw new Pe("skip is not supported");
      if (v !== 0) throw new Pe(`operator "${v}" is not supported in halftone region`);
      const M = [];
      let F, L, Y;
      for (F = 0; F < m; F++)
        Y = new Uint8Array(p), b && Y.fill(b), M.push(Y);
      const B = f.length, et = f[0], H = et[0].length, P = et.length, G = xm(B), N = [];
      u || (N.push({ x: d <= 1 ? 3 : 2, y: -1 }), d === 0 && N.push({ x: -3, y: -1 }, { x: 2, y: -2 }, { x: -2, y: -2 }));
      const j = [];
      let V, X, z, K, W, rt, $, nt, wt, O, U;
      for (u && (V = new Md(E.data, E.start, E.end)), F = G - 1; F >= 0; F--)
        X = u ? n6(V, w, A, !0) : Z2(!1, w, A, d, !1, null, N, E), j[F] = X;
      for (z = 0; z < A; z++) for (K = 0; K < w; K++) {
        for (W = 0, rt = 0, L = G - 1; L >= 0; L--)
          W ^= j[L][z][K], rt |= W << L;
        if ($ = f[rt], nt = x + z * T + K * I >> 8, wt = k + z * I - K * T >> 8, nt >= 0 && nt + H <= p && wt >= 0 && wt + P <= m) for (F = 0; F < P; F++)
          for (U = M[wt + F], O = $[F], L = 0; L < H; L++) U[nt + L] |= O[L];
        else {
          let Q, lt;
          for (F = 0; F < P; F++)
            if (lt = wt + F, !(lt < 0 || lt >= m))
              for (U = M[lt], O = $[F], L = 0; L < H; L++)
                Q = nt + L, Q >= 0 && Q < p && (U[Q] |= O[L]);
        }
      }
      return M;
    }(t.mmr, r, t.template, o.width, o.height, t.defaultPixelValue, t.enableSkip, t.combinationOperator, t.gridWidth, t.gridHeight, t.gridOffsetX, t.gridOffsetY, t.gridVectorX, t.gridVectorY, l);
    this.drawBitmap(o, c);
  }
  onImmediateLosslessHalftoneRegion() {
    this.onImmediateHalftoneRegion(...arguments);
  }
  onTables(t, e, i, n) {
    let a = this.customTables;
    a || (this.customTables = a = {}), a[t] = function(o, l, c) {
      const h = o[l], u = 4294967295 & he(o, l + 1), f = 4294967295 & he(o, l + 5), d = new Md(o, l + 9, c), p = 1 + (h >> 1 & 7), m = 1 + (h >> 4 & 7), b = [];
      let y, v, w = u;
      do
        y = d.readBits(p), v = d.readBits(m), b.push(new io([w, y, v, 0])), w += 1 << v;
      while (w < f);
      return y = d.readBits(p), b.push(new io([u - 1, y, 32, 0, "lower"])), y = d.readBits(p), b.push(new io([f, y, 32, 0])), 1 & h && (y = d.readBits(p), b.push(new io([y, 0]))), new Yg(b, !1);
    }(e, i, n);
  }
}
class io {
  constructor(t) {
    t.length === 2 ? (this.isOOB = !0, this.rangeLow = 0, this.prefixLength = t[0], this.rangeLength = 0, this.prefixCode = t[1], this.isLowerRange = !1) : (this.isOOB = !1, this.rangeLow = t[0], this.prefixLength = t[1], this.rangeLength = t[2], this.prefixCode = t[3], this.isLowerRange = t[4] === "lower");
  }
}
class Bp {
  constructor(t) {
    this.children = [], t ? (this.isLeaf = !0, this.rangeLength = t.rangeLength, this.rangeLow = t.rangeLow, this.isLowerRange = t.isLowerRange, this.isOOB = t.isOOB) : this.isLeaf = !1;
  }
  buildTree(t, e) {
    const i = t.prefixCode >> e & 1;
    if (e <= 0) this.children[i] = new Bp(t);
    else {
      let n = this.children[i];
      n || (this.children[i] = n = new Bp(null)), n.buildTree(t, e - 1);
    }
  }
  decodeNode(t) {
    if (this.isLeaf) {
      if (this.isOOB) return null;
      const i = t.readBits(this.rangeLength);
      return this.rangeLow + (this.isLowerRange ? -i : i);
    }
    const e = this.children[t.readBit()];
    if (!e) throw new Pe("invalid Huffman data");
    return e.decodeNode(t);
  }
}
class Yg {
  constructor(t, e) {
    e || this.assignPrefixCodes(t), this.rootNode = new Bp(null);
    for (let i = 0, n = t.length; i < n; i++) {
      const a = t[i];
      a.prefixLength > 0 && this.rootNode.buildTree(a, a.prefixLength - 1);
    }
  }
  decode(t) {
    return this.rootNode.decodeNode(t);
  }
  assignPrefixCodes(t) {
    const e = t.length;
    let i = 0;
    for (let h = 0; h < e; h++) i = Math.max(i, t[h].prefixLength);
    const n = new Uint32Array(i + 1);
    for (let h = 0; h < e; h++) n[t[h].prefixLength]++;
    let a, r, o, l = 1, c = 0;
    for (n[0] = 0; l <= i; ) {
      for (c = c + n[l - 1] << 1, a = c, r = 0; r < e; )
        o = t[r], o.prefixLength === l && (o.prefixCode = a, a++), r++;
      l++;
    }
  }
}
const u4 = {};
function Zr(s) {
  let t, e = u4[s];
  if (e) return e;
  switch (s) {
    case 1:
      t = [[0, 1, 4, 0], [16, 2, 8, 2], [272, 3, 16, 6], [65808, 3, 32, 7]];
      break;
    case 2:
      t = [[0, 1, 0, 0], [1, 2, 0, 2], [2, 3, 0, 6], [3, 4, 3, 14], [11, 5, 6, 30], [75, 6, 32, 62], [6, 63]];
      break;
    case 3:
      t = [[-256, 8, 8, 254], [0, 1, 0, 0], [1, 2, 0, 2], [2, 3, 0, 6], [3, 4, 3, 14], [11, 5, 6, 30], [-257, 8, 32, 255, "lower"], [75, 7, 32, 126], [6, 62]];
      break;
    case 4:
      t = [[1, 1, 0, 0], [2, 2, 0, 2], [3, 3, 0, 6], [4, 4, 3, 14], [12, 5, 6, 30], [76, 5, 32, 31]];
      break;
    case 5:
      t = [[-255, 7, 8, 126], [1, 1, 0, 0], [2, 2, 0, 2], [3, 3, 0, 6], [4, 4, 3, 14], [12, 5, 6, 30], [-256, 7, 32, 127, "lower"], [76, 6, 32, 62]];
      break;
    case 6:
      t = [[-2048, 5, 10, 28], [-1024, 4, 9, 8], [-512, 4, 8, 9], [-256, 4, 7, 10], [-128, 5, 6, 29], [-64, 5, 5, 30], [-32, 4, 5, 11], [0, 2, 7, 0], [128, 3, 7, 2], [256, 3, 8, 3], [512, 4, 9, 12], [1024, 4, 10, 13], [-2049, 6, 32, 62, "lower"], [2048, 6, 32, 63]];
      break;
    case 7:
      t = [[-1024, 4, 9, 8], [-512, 3, 8, 0], [-256, 4, 7, 9], [-128, 5, 6, 26], [-64, 5, 5, 27], [-32, 4, 5, 10], [0, 4, 5, 11], [32, 5, 5, 28], [64, 5, 6, 29], [128, 4, 7, 12], [256, 3, 8, 1], [512, 3, 9, 2], [1024, 3, 10, 3], [-1025, 5, 32, 30, "lower"], [2048, 5, 32, 31]];
      break;
    case 8:
      t = [[-15, 8, 3, 252], [-7, 9, 1, 508], [-5, 8, 1, 253], [-3, 9, 0, 509], [-2, 7, 0, 124], [-1, 4, 0, 10], [0, 2, 1, 0], [2, 5, 0, 26], [3, 6, 0, 58], [4, 3, 4, 4], [20, 6, 1, 59], [22, 4, 4, 11], [38, 4, 5, 12], [70, 5, 6, 27], [134, 5, 7, 28], [262, 6, 7, 60], [390, 7, 8, 125], [646, 6, 10, 61], [-16, 9, 32, 510, "lower"], [1670, 9, 32, 511], [2, 1]];
      break;
    case 9:
      t = [[-31, 8, 4, 252], [-15, 9, 2, 508], [-11, 8, 2, 253], [-7, 9, 1, 509], [-5, 7, 1, 124], [-3, 4, 1, 10], [-1, 3, 1, 2], [1, 3, 1, 3], [3, 5, 1, 26], [5, 6, 1, 58], [7, 3, 5, 4], [39, 6, 2, 59], [43, 4, 5, 11], [75, 4, 6, 12], [139, 5, 7, 27], [267, 5, 8, 28], [523, 6, 8, 60], [779, 7, 9, 125], [1291, 6, 11, 61], [-32, 9, 32, 510, "lower"], [3339, 9, 32, 511], [2, 0]];
      break;
    case 10:
      t = [[-21, 7, 4, 122], [-5, 8, 0, 252], [-4, 7, 0, 123], [-3, 5, 0, 24], [-2, 2, 2, 0], [2, 5, 0, 25], [3, 6, 0, 54], [4, 7, 0, 124], [5, 8, 0, 253], [6, 2, 6, 1], [70, 5, 5, 26], [102, 6, 5, 55], [134, 6, 6, 56], [198, 6, 7, 57], [326, 6, 8, 58], [582, 6, 9, 59], [1094, 6, 10, 60], [2118, 7, 11, 125], [-22, 8, 32, 254, "lower"], [4166, 8, 32, 255], [2, 2]];
      break;
    case 11:
      t = [[1, 1, 0, 0], [2, 2, 1, 2], [4, 4, 0, 12], [5, 4, 1, 13], [7, 5, 1, 28], [9, 5, 2, 29], [13, 6, 2, 60], [17, 7, 2, 122], [21, 7, 3, 123], [29, 7, 4, 124], [45, 7, 5, 125], [77, 7, 6, 126], [141, 7, 32, 127]];
      break;
    case 12:
      t = [[1, 1, 0, 0], [2, 2, 0, 2], [3, 3, 1, 6], [5, 5, 0, 28], [6, 5, 1, 29], [8, 6, 1, 60], [10, 7, 0, 122], [11, 7, 1, 123], [13, 7, 2, 124], [17, 7, 3, 125], [25, 7, 4, 126], [41, 8, 5, 254], [73, 8, 32, 255]];
      break;
    case 13:
      t = [[1, 1, 0, 0], [2, 3, 0, 4], [3, 4, 0, 12], [4, 5, 0, 28], [5, 4, 1, 13], [7, 3, 3, 5], [15, 6, 1, 58], [17, 6, 2, 59], [21, 6, 3, 60], [29, 6, 4, 61], [45, 6, 5, 62], [77, 7, 6, 126], [141, 7, 32, 127]];
      break;
    case 14:
      t = [[-2, 3, 0, 4], [-1, 3, 0, 5], [0, 1, 0, 0], [1, 3, 0, 6], [2, 3, 0, 7]];
      break;
    case 15:
      t = [[-24, 7, 4, 124], [-8, 6, 2, 60], [-4, 5, 1, 28], [-2, 4, 0, 12], [-1, 3, 0, 4], [0, 1, 0, 0], [1, 3, 0, 5], [2, 4, 0, 13], [3, 5, 1, 29], [5, 6, 2, 61], [9, 7, 4, 125], [-25, 7, 32, 126, "lower"], [25, 7, 32, 127]];
      break;
    default:
      throw new Pe(`standard table B.${s} does not exist`);
  }
  for (let i = 0, n = t.length; i < n; i++) t[i] = new io(t[i]);
  return e = new Yg(t, !0), u4[s] = e, e;
}
class Md {
  constructor(t, e, i) {
    this.data = t, this.start = e, this.end = i, this.position = e, this.shift = -1, this.currentByte = 0;
  }
  readBit() {
    if (this.shift < 0) {
      if (this.position >= this.end) throw new Pe("end of data while reading bit");
      this.currentByte = this.data[this.position++], this.shift = 7;
    }
    const t = this.currentByte >> this.shift & 1;
    return this.shift--, t;
  }
  readBits(t) {
    let e, i = 0;
    for (e = t - 1; e >= 0; e--) i |= this.readBit() << e;
    return i;
  }
  byteAlign() {
    this.shift = -1;
  }
  next() {
    return this.position >= this.end ? -1 : this.data[this.position++];
  }
}
function pl(s, t, e) {
  let i = 0;
  for (let n = 0, a = t.length; n < a; n++) {
    const r = e[t[n]];
    if (r) {
      if (s === i) return r;
      i++;
    }
  }
  throw new Pe("can't find custom Huffman table");
}
function A_(s, t, e) {
  const i = [];
  for (let n = 0; n < e; n++) {
    const a = new Uint8Array(t);
    i.push(a);
    for (let r = 0; r < t; r++) a[r] = s.readBit();
    s.byteAlign();
  }
  return i;
}
function n6(s, t, e, i) {
  const n = new wA(s, { K: -1, Columns: t, Rows: e, BlackIs1: !0, EndOfBlock: i }), a = [];
  let r, o = !1;
  for (let l = 0; l < e; l++) {
    const c = new Uint8Array(t);
    a.push(c);
    let h = -1;
    for (let u = 0; u < t; u++)
      h < 0 && (r = n.readNextChar(), r === -1 && (r = 0, o = !0), h = 7), c[u] = r >> h & 1, h--;
  }
  if (i && !o)
    for (let c = 0; c < 5 && n.readNextChar() !== -1; c++) ;
  return a;
}
class x_ {
  parseChunks(t) {
    return function(i) {
      const n = new v_();
      for (let a = 0, r = i.length; a < r; a++) {
        const o = i[a];
        w_(b_({}, o.data, o.start, o.end), n);
      }
      return n.buffer;
    }(t);
  }
  parse(t) {
    throw new Error("Not implemented: Jbig2Image.parse");
  }
}
class k_ extends fi {
  constructor(t, e, i) {
    super(e), this.stream = t, this.dict = t.dict, this.maybeLength = e, this.params = i;
  }
  get bytes() {
    return gt(this, "bytes", this.stream.getBytes(this.maybeLength));
  }
  ensureBuffer(t) {
  }
  readBlock() {
    this.decodeImage();
  }
  decodeImage(t) {
    if (this.eof) return this.buffer;
    t || (t = this.bytes);
    const e = new x_(), i = [];
    if (this.params instanceof q) {
      const r = this.params.get("JBIG2Globals");
      if (r instanceof Ot) {
        const o = r.getBytes();
        i.push({ data: o, start: 0, end: o.length });
      }
    }
    i.push({ data: t, start: 0, end: t.length });
    const n = e.parseChunks(i), a = n.length;
    for (let r = 0; r < a; r++) n[r] ^= 255;
    return this.buffer = n, this.bufferLength = a, this.eof = !0, this.buffer;
  }
  get canAsyncDecodeImageFromBuffer() {
    return this.stream.isAsync;
  }
}
class S_ extends fi {
  constructor(t, e, i) {
    super(e), this.stream = t, this.dict = t.dict, this.maybeLength = e, this.params = i;
  }
  get bytes() {
    return gt(this, "bytes", this.stream.getBytes(this.maybeLength));
  }
  ensureBuffer(t) {
  }
  readBlock(t) {
    Wt("JpxStream.readBlock");
  }
  get isAsyncDecoder() {
    return !0;
  }
  async decodeImage(t, e) {
    return this.eof ? this.buffer : (t || (t = this.bytes), this.buffer = await Yn.decode(t, e), this.bufferLength = this.buffer.length, this.eof = !0, this.buffer);
  }
  get canAsyncDecodeImageFromBuffer() {
    return this.stream.isAsync;
  }
}
class d4 extends fi {
  constructor(t, e, i) {
    super(e), this.str = t, this.dict = t.dict, this.cachedData = 0, this.bitsCached = 0;
    const n = 4096, a = { earlyChange: i, codeLength: 9, nextCode: 258, dictionaryValues: new Uint8Array(n), dictionaryLengths: new Uint16Array(n), dictionaryPrevCodes: new Uint16Array(n), currentSequence: new Uint8Array(n), currentSequenceLength: 0 };
    for (let r = 0; r < 256; ++r)
      a.dictionaryValues[r] = r, a.dictionaryLengths[r] = 1;
    this.lzwState = a;
  }
  readBits(t) {
    let e = this.bitsCached, i = this.cachedData;
    for (; e < t; ) {
      const n = this.str.getByte();
      if (n === -1)
        return this.eof = !0, null;
      i = i << 8 | n, e += 8;
    }
    return this.bitsCached = e -= t, this.cachedData = i, this.lastCode = null, i >>> e & (1 << t) - 1;
  }
  readBlock() {
    let t, e, i, n = 1024;
    const a = this.lzwState;
    if (!a) return;
    const r = a.earlyChange;
    let o = a.nextCode;
    const l = a.dictionaryValues, c = a.dictionaryLengths, h = a.dictionaryPrevCodes;
    let u = a.codeLength, f = a.prevCode;
    const d = a.currentSequence;
    let p = a.currentSequenceLength, m = 0, b = this.bufferLength, y = this.ensureBuffer(this.bufferLength + n);
    for (t = 0; t < 512; t++) {
      const v = this.readBits(u), w = p > 0;
      if (v < 256)
        d[0] = v, p = 1;
      else {
        if (!(v >= 258)) {
          if (v === 256) {
            u = 9, o = 258, p = 0;
            continue;
          }
          this.eof = !0, delete this.lzwState;
          break;
        }
        if (v < o)
          for (p = c[v], e = p - 1, i = v; e >= 0; e--)
            d[e] = l[i], i = h[i];
        else d[p++] = d[0];
      }
      if (w && (h[o] = f, c[o] = c[f] + 1, l[o] = d[0], o++, u = o + r & o + r - 1 ? u : 0 | Math.min(Math.log(o + r) / 0.6931471805599453 + 1, 12)), f = v, m += p, n < m) {
        do
          n += 512;
        while (n < m);
        y = this.ensureBuffer(this.bufferLength + n);
      }
      for (e = 0; e < p; e++) y[b++] = d[e];
    }
    a.nextCode = o, a.codeLength = u, a.prevCode = f, a.currentSequenceLength = p, this.bufferLength = b;
  }
}
class f4 extends fi {
  constructor(t, e, i) {
    if (super(e), !(i instanceof q)) return t;
    const n = this.predictor = i.get("Predictor") || 1;
    if (n <= 1) return t;
    if (n !== 2 && (n < 10 || n > 15)) throw new st(`Unsupported predictor: ${n}`);
    this.readBlock = n === 2 ? this.readBlockTiff : this.readBlockPng, this.str = t, this.dict = t.dict;
    const a = this.colors = i.get("Colors") || 1, r = this.bits = i.get("BPC", "BitsPerComponent") || 8, o = this.columns = i.get("Columns") || 1;
    return this.pixBytes = a * r + 7 >> 3, this.rowBytes = o * a * r + 7 >> 3, this;
  }
  readBlockTiff() {
    const t = this.rowBytes, e = this.bufferLength, i = this.ensureBuffer(e + t), n = this.bits, a = this.colors, r = this.str.getBytes(t);
    if (this.eof = !r.length, this.eof) return;
    let o, l = 0, c = 0, h = 0, u = 0, f = e;
    if (n === 1 && a === 1) for (o = 0; o < t; ++o) {
      let d = r[o] ^ l;
      d ^= d >> 1, d ^= d >> 2, d ^= d >> 4, l = (1 & d) << 7, i[f++] = d;
    }
    else if (n === 8) {
      for (o = 0; o < a; ++o) i[f++] = r[o];
      for (; o < t; ++o)
        i[f] = i[f - a] + r[o], f++;
    } else if (n === 16) {
      const d = 2 * a;
      for (o = 0; o < d; ++o) i[f++] = r[o];
      for (; o < t; o += 2) {
        const p = ((255 & r[o]) << 8) + (255 & r[o + 1]) + ((255 & i[f - d]) << 8) + (255 & i[f - d + 1]);
        i[f++] = p >> 8 & 255, i[f++] = 255 & p;
      }
    } else {
      const d = new Uint8Array(a + 1), p = (1 << n) - 1;
      let m = 0, b = e;
      const y = this.columns;
      for (o = 0; o < y; ++o) for (let v = 0; v < a; ++v)
        h < n && (l = l << 8 | 255 & r[m++], h += 8), d[v] = d[v] + (l >> h - n) & p, h -= n, c = c << n | d[v], u += n, u >= 8 && (i[b++] = c >> u - 8 & 255, u -= 8);
      u > 0 && (i[b++] = (c << 8 - u) + (l & (1 << 8 - u) - 1));
    }
    this.bufferLength += t;
  }
  readBlockPng() {
    const t = this.rowBytes, e = this.pixBytes, i = this.str.getByte(), n = this.str.getBytes(t);
    if (this.eof = !n.length, this.eof) return;
    const a = this.bufferLength, r = this.ensureBuffer(a + t);
    let o = r.subarray(a - t, a);
    o.length === 0 && (o = new Uint8Array(t));
    let l, c, h, u = a;
    switch (i) {
      case 0:
        for (l = 0; l < t; ++l) r[u++] = n[l];
        break;
      case 1:
        for (l = 0; l < e; ++l) r[u++] = n[l];
        for (; l < t; ++l)
          r[u] = r[u - e] + n[l] & 255, u++;
        break;
      case 2:
        for (l = 0; l < t; ++l) r[u++] = o[l] + n[l] & 255;
        break;
      case 3:
        for (l = 0; l < e; ++l) r[u++] = (o[l] >> 1) + n[l];
        for (; l < t; ++l)
          r[u] = (o[l] + r[u - e] >> 1) + n[l] & 255, u++;
        break;
      case 4:
        for (l = 0; l < e; ++l)
          c = o[l], h = n[l], r[u++] = c + h;
        for (; l < t; ++l) {
          c = o[l];
          const f = o[l - e], d = r[u - e], p = d + c - f;
          let m = p - d;
          m < 0 && (m = -m);
          let b = p - c;
          b < 0 && (b = -b);
          let y = p - f;
          y < 0 && (y = -y), h = n[l], r[u++] = m <= b && m <= y ? d + h : b <= y ? c + h : f + h;
        }
        break;
      default:
        throw new st(`Unsupported predictor: ${i}`);
    }
    this.bufferLength += t;
  }
}
class C_ extends fi {
  constructor(t, e) {
    super(e), this.str = t, this.dict = t.dict;
  }
  readBlock() {
    const t = this.str.getBytes(2);
    if (!t || t.length < 2 || t[0] === 128) {
      this.eof = !0;
      return;
    }
    let e, i = this.bufferLength, n = t[0];
    if (n < 128) {
      if (e = this.ensureBuffer(i + n + 1), e[i++] = t[1], n > 0) {
        const a = this.str.getBytes(n);
        e.set(a, i), i += n;
      }
    } else
      n = 257 - n, e = this.ensureBuffer(i + n + 1), e.fill(t[1], i, i + n), i += n;
    this.bufferLength = i;
  }
}
var P9, xA;
class ao {
  constructor({ lexer: t, xref: e, allowStreams: i = !1, recoveryMode: n = !1 }) {
    _(this, P9);
    this.lexer = t, this.xref = e, this.allowStreams = i, this.recoveryMode = n, this.imageCache = /* @__PURE__ */ Object.create(null), this._imageId = 0, this.refill();
  }
  refill() {
    this.buf1 = this.lexer.getObj(), this.buf2 = this.lexer.getObj();
  }
  shift() {
    this.buf2 instanceof Je && this.buf2.cmd === "ID" ? (this.buf1 = this.buf2, this.buf2 = null) : (this.buf1 = this.buf2, this.buf2 = this.lexer.getObj());
  }
  tryShift() {
    try {
      return this.shift(), !0;
    } catch (t) {
      if (t instanceof ke) throw t;
      return !1;
    }
  }
  getObj(t = null) {
    const e = this.buf1;
    if (this.shift(), e instanceof Je) switch (e.cmd) {
      case "BI":
        return this.makeInlineImage(t);
      case "[":
        const i = [];
        for (; !ds(this.buf1, "]") && this.buf1 !== vs; ) i.push(this.getObj(t));
        if (this.buf1 === vs) {
          if (this.recoveryMode) return i;
          throw new H3("End of file inside array.");
        }
        return this.shift(), i;
      case "<<":
        const n = new q(this.xref);
        for (; !ds(this.buf1, ">>") && this.buf1 !== vs; ) {
          if (!(this.buf1 instanceof Z)) {
            qt("Malformed dictionary: key must be a name object"), this.shift();
            continue;
          }
          const a = this.buf1.name;
          if (this.shift(), this.buf1 === vs) break;
          n.set(a, this.getObj(t));
        }
        if (this.buf1 === vs) {
          if (this.recoveryMode) return n;
          throw new H3("End of file inside dictionary.");
        }
        return ds(this.buf2, "stream") ? this.allowStreams ? this.makeStream(n, t) : n : (this.shift(), n);
      default:
        return e;
    }
    if (Number.isInteger(e)) {
      if (Number.isInteger(this.buf1) && ds(this.buf2, "R")) {
        const i = yt.get(e, this.buf1);
        return this.shift(), this.shift(), i;
      }
      return e;
    }
    return typeof e == "string" && t ? t.decryptString(e) : e;
  }
  findDefaultInlineStreamEnd(t) {
    const { knownCommands: e } = this.lexer, i = t.pos;
    let n, a, r = 0;
    for (; (n = t.getByte()) !== -1; ) if (r === 0) r = n === 69 ? 1 : 0;
    else if (r === 1) r = n === 73 ? 2 : 0;
    else if (n === 32 || n === 10 || n === 13) {
      a = t.pos;
      const l = t.peekBytes(15), c = l.length;
      if (c === 0) break;
      for (let f = 0; f < c; f++)
        if (n = l[f], (n !== 0 || l[f + 1] === 0) && n !== 10 && n !== 13 && (n < 32 || n > 127)) {
          r = 0;
          break;
        }
      if (r !== 2) continue;
      if (!e) {
        D("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");
        continue;
      }
      const h = new Zn(new Le(t.peekBytes(75)), e);
      h._hexStringWarn = () => {
      };
      let u = 0;
      for (; ; ) {
        const f = h.getObj();
        if (f === vs) {
          r = 0;
          break;
        }
        if (f instanceof Je) {
          const d = e[f.cmd];
          if (!d) {
            r = 0;
            break;
          }
          if (d.variableArgs ? u <= d.numArgs : u === d.numArgs) break;
          u = 0;
        } else u++;
      }
      if (r === 2) break;
    } else r = 0;
    n === -1 && (D("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"), a && (D('... trying to recover by using the last "EI" occurrence.'), t.skip(-(t.pos - a))));
    let o = 4;
    return t.skip(-o), n = t.peekByte(), t.skip(o), Qi(n) || o--, t.pos - o - i;
  }
  findDCTDecodeInlineStreamEnd(t) {
    const e = t.pos;
    let i, n, a = !1;
    for (; (i = t.getByte()) !== -1; ) if (i === 255) {
      switch (t.getByte()) {
        case 0:
          break;
        case 255:
          t.skip(-1);
          break;
        case 217:
          a = !0;
          break;
        case 192:
        case 193:
        case 194:
        case 195:
        case 197:
        case 198:
        case 199:
        case 201:
        case 202:
        case 203:
        case 205:
        case 206:
        case 207:
        case 196:
        case 204:
        case 218:
        case 219:
        case 220:
        case 221:
        case 222:
        case 223:
        case 224:
        case 225:
        case 226:
        case 227:
        case 228:
        case 229:
        case 230:
        case 231:
        case 232:
        case 233:
        case 234:
        case 235:
        case 236:
        case 237:
        case 238:
        case 239:
        case 254:
          n = t.getUint16(), n > 2 ? t.skip(n - 2) : t.skip(-2);
      }
      if (a) break;
    }
    const r = t.pos - e;
    return i === -1 ? (D("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."), t.skip(-r), this.findDefaultInlineStreamEnd(t)) : (this.inlineStreamSkipEI(t), r);
  }
  findASCII85DecodeInlineStreamEnd(t) {
    const e = t.pos;
    let i;
    for (; (i = t.getByte()) !== -1; ) if (i === 126) {
      const a = t.pos;
      for (i = t.peekByte(); Qi(i); )
        t.skip(), i = t.peekByte();
      if (i === 62) {
        t.skip();
        break;
      }
      if (t.pos > a) {
        const r = t.peekBytes(2);
        if (r[0] === 69 && r[1] === 73) break;
      }
    }
    const n = t.pos - e;
    return i === -1 ? (D("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."), t.skip(-n), this.findDefaultInlineStreamEnd(t)) : (this.inlineStreamSkipEI(t), n);
  }
  findASCIIHexDecodeInlineStreamEnd(t) {
    const e = t.pos;
    let i;
    for (; (i = t.getByte()) !== -1 && i !== 62; ) ;
    const n = t.pos - e;
    return i === -1 ? (D("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."), t.skip(-n), this.findDefaultInlineStreamEnd(t)) : (this.inlineStreamSkipEI(t), n);
  }
  inlineStreamSkipEI(t) {
    let e, i = 0;
    for (; (e = t.getByte()) !== -1; ) if (i === 0) i = e === 69 ? 1 : 0;
    else if (i === 1) i = e === 73 ? 2 : 0;
    else if (i === 2) break;
  }
  makeInlineImage(t) {
    const e = this.lexer, i = e.stream, n = /* @__PURE__ */ Object.create(null);
    let a;
    for (; !ds(this.buf1, "ID") && this.buf1 !== vs; ) {
      if (!(this.buf1 instanceof Z)) throw new st("Dictionary key must be a name object");
      const d = this.buf1.name;
      if (this.shift(), this.buf1 === vs) break;
      n[d] = this.getObj(t);
    }
    e.beginInlineImagePos !== -1 && (a = i.pos - e.beginInlineImagePos);
    const r = this.xref.fetchIfRef(n.F || n.Filter);
    let o;
    if (r instanceof Z) o = r.name;
    else if (Array.isArray(r)) {
      const d = this.xref.fetchIfRef(r[0]);
      d instanceof Z && (o = d.name);
    }
    const l = i.pos;
    let c, h;
    switch (o) {
      case "DCT":
      case "DCTDecode":
        c = this.findDCTDecodeInlineStreamEnd(i);
        break;
      case "A85":
      case "ASCII85Decode":
        c = this.findASCII85DecodeInlineStreamEnd(i);
        break;
      case "AHx":
      case "ASCIIHexDecode":
        c = this.findASCIIHexDecodeInlineStreamEnd(i);
        break;
      default:
        c = this.findDefaultInlineStreamEnd(i);
    }
    if (c < 1e3 && a > 0) {
      const d = i.pos;
      i.pos = e.beginInlineImagePos, h = function(b) {
        const y = [], v = b.length;
        let w = 0;
        for (; w < v - 1; ) y.push(b[w++] << 8 | b[w++]);
        return w < v && y.push(b[w]), v + "_" + String.fromCharCode.apply(null, y);
      }(i.getBytes(a + c)), i.pos = d;
      const p = this.imageCache[h];
      if (p !== void 0)
        return this.buf2 = Je.get("EI"), this.shift(), p.reset(), p;
    }
    const u = new q(this.xref);
    for (const d in n) u.set(d, n[d]);
    let f = i.makeSubStream(l, c, u);
    return t && (f = t.createStream(f, c)), f = this.filter(f, u, c), f.dict = u, h !== void 0 && (f.cacheKey = "inline_img_" + ++this._imageId, this.imageCache[h] = f), this.buf2 = Je.get("EI"), this.shift(), f;
  }
  makeStream(t, e) {
    const i = this.lexer;
    let n = i.stream;
    i.skipToNextLine();
    const a = n.pos - 1;
    let r = t.get("Length");
    if (Number.isInteger(r) || (qt(`Bad length "${r && r.toString()}" in stream.`), r = 0), n.pos = a + r, i.nextChar(), this.tryShift() && ds(this.buf2, "endstream")) this.shift();
    else {
      if (r = C(this, P9, xA).call(this, a), r < 0) throw new st("Missing endstream command.");
      i.nextChar(), this.shift(), this.shift();
    }
    return this.shift(), n = n.makeSubStream(a, r, t), e && (n = e.createStream(n, r)), n = this.filter(n, t, r), n.dict = t, n;
  }
  filter(t, e, i) {
    let n = e.get("F", "Filter"), a = e.get("DP", "DecodeParms");
    if (n instanceof Z)
      return Array.isArray(a) && D("/DecodeParms should not be an Array, when /Filter is a Name."), this.makeFilter(t, n.name, i, a);
    let r = i;
    if (Array.isArray(n)) {
      const o = n, l = a;
      for (let c = 0, h = o.length; c < h; ++c) {
        if (n = this.xref.fetchIfRef(o[c]), !(n instanceof Z)) throw new st(`Bad filter name "${n}"`);
        a = null, Array.isArray(l) && c in l && (a = this.xref.fetchIfRef(l[c])), t = this.makeFilter(t, n.name, r, a), r = null;
      }
    }
    return t;
  }
  makeFilter(t, e, i, n) {
    if (i === 0)
      return D(`Empty "${e}" stream.`), new Z3();
    try {
      switch (e) {
        case "Fl":
        case "FlateDecode":
          return n ? new f4(new o4(t, i), i, n) : new o4(t, i);
        case "LZW":
        case "LZWDecode":
          let a = 1;
          return n ? (n.has("EarlyChange") && (a = n.get("EarlyChange")), new f4(new d4(t, i, a), i, n)) : new d4(t, i, a);
        case "DCT":
        case "DCTDecode":
          return new E1(t, i, n);
        case "JPX":
        case "JPXDecode":
          return new S_(t, i, n);
        case "A85":
        case "ASCII85Decode":
          return new n_(t, i);
        case "AHx":
        case "ASCIIHexDecode":
          return new a_(t, i);
        case "CCF":
        case "CCITTFaxDecode":
          return new r_(t, i, n);
        case "RL":
        case "RunLengthDecode":
          return new C_(t, i);
        case "JBIG2Decode":
          return new k_(t, i, n);
      }
      return D(`Filter "${e}" is not supported.`), t;
    } catch (a) {
      if (a instanceof ke) throw a;
      return D(`Invalid stream: "${a}"`), new Z3();
    }
  }
}
P9 = new WeakSet(), xA = function(t) {
  const { stream: e } = this.lexer;
  e.pos = t;
  const i = new Uint8Array([101, 110, 100]), n = i.length, a = [new Uint8Array([115, 116, 114, 101, 97, 109]), new Uint8Array([115, 116, 101, 97, 109]), new Uint8Array([115, 116, 114, 101, 97])], r = 9 - n;
  for (; e.pos < e.end; ) {
    const o = e.peekBytes(2048), l = o.length - 9;
    if (l <= 0) break;
    let c = 0;
    for (; c < l; ) {
      let h = 0;
      for (; h < n && o[c + h] === i[h]; ) h++;
      if (h >= n) {
        let u = !1;
        for (const f of a) {
          const d = f.length;
          let p = 0;
          for (; p < d && o[c + h + p] === f[p]; ) p++;
          if (p >= r) {
            u = !0;
            break;
          }
          if (p >= d) {
            Qi(o[c + h + p]) && (qt(`Found "${Si([...i, ...f])}" when searching for endstream command.`), u = !0);
            break;
          }
        }
        if (u)
          return e.pos += c, e.pos - t;
      }
      c++;
    }
    e.pos += l;
  }
  return -1;
};
const kh = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
function Sm(s) {
  return s >= 48 && s <= 57 ? 15 & s : s >= 65 && s <= 70 || s >= 97 && s <= 102 ? 9 + (15 & s) : -1;
}
class Zn {
  constructor(t, e = null) {
    this.stream = t, this.nextChar(), this.strBuf = [], this.knownCommands = e, this._hexStringNumWarn = 0, this.beginInlineImagePos = -1;
  }
  nextChar() {
    return this.currentChar = this.stream.getByte();
  }
  peekChar() {
    return this.stream.peekByte();
  }
  getNumber() {
    let t = this.currentChar, e = !1, i = 0, n = 1;
    if (t === 45 ? (n = -1, t = this.nextChar(), t === 45 && (t = this.nextChar())) : t === 43 && (t = this.nextChar()), t === 10 || t === 13) do
      t = this.nextChar();
    while (t === 10 || t === 13);
    if (t === 46 && (i = 10, t = this.nextChar()), t < 48 || t > 57) {
      const l = `Invalid number: ${String.fromCharCode(t)} (charCode ${t})`;
      if (Qi(t) || t === 40 || t === 60 || t === -1)
        return qt(`Lexer.getNumber - "${l}".`), 0;
      throw new st(l);
    }
    let a = t - 48, r = 0, o = 1;
    for (; (t = this.nextChar()) >= 0; ) if (t >= 48 && t <= 57) {
      const l = t - 48;
      e ? r = 10 * r + l : (i !== 0 && (i *= 10), a = 10 * a + l);
    } else if (t === 46) {
      if (i !== 0) break;
      i = 1;
    } else if (t === 45) D("Badly formatted number: minus sign in the middle");
    else {
      if (t !== 69 && t !== 101) break;
      if (t = this.peekChar(), t === 43 || t === 45)
        o = t === 45 ? -1 : 1, this.nextChar();
      else if (t < 48 || t > 57) break;
      e = !0;
    }
    return i !== 0 && (a /= i), e && (a *= 10 ** (o * r)), n * a;
  }
  getString() {
    let t = 1, e = !1;
    const i = this.strBuf;
    i.length = 0;
    let n = this.nextChar();
    for (; ; ) {
      let a = !1;
      switch (0 | n) {
        case -1:
          D("Unterminated string"), e = !0;
          break;
        case 40:
          ++t, i.push("(");
          break;
        case 41:
          --t == 0 ? (this.nextChar(), e = !0) : i.push(")");
          break;
        case 92:
          switch (n = this.nextChar(), n) {
            case -1:
              D("Unterminated string"), e = !0;
              break;
            case 110:
              i.push(`
`);
              break;
            case 114:
              i.push("\r");
              break;
            case 116:
              i.push("	");
              break;
            case 98:
              i.push("\b");
              break;
            case 102:
              i.push("\f");
              break;
            case 92:
            case 40:
            case 41:
              i.push(String.fromCharCode(n));
              break;
            case 48:
            case 49:
            case 50:
            case 51:
            case 52:
            case 53:
            case 54:
            case 55:
              let r = 15 & n;
              n = this.nextChar(), a = !0, n >= 48 && n <= 55 && (r = (r << 3) + (15 & n), n = this.nextChar(), n >= 48 && n <= 55 && (a = !1, r = (r << 3) + (15 & n))), i.push(String.fromCharCode(r));
              break;
            case 13:
              this.peekChar() === 10 && this.nextChar();
              break;
            case 10:
              break;
            default:
              i.push(String.fromCharCode(n));
          }
          break;
        default:
          i.push(String.fromCharCode(n));
      }
      if (e) break;
      a || (n = this.nextChar());
    }
    return i.join("");
  }
  getName() {
    let t, e;
    const i = this.strBuf;
    for (i.length = 0; (t = this.nextChar()) >= 0 && !kh[t]; ) if (t === 35) {
      if (t = this.nextChar(), kh[t]) {
        D("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."), i.push("#");
        break;
      }
      const n = Sm(t);
      if (n !== -1) {
        e = t, t = this.nextChar();
        const a = Sm(t);
        if (a === -1) {
          if (D(`Lexer_getName: Illegal digit (${String.fromCharCode(t)}) in hexadecimal number.`), i.push("#", String.fromCharCode(e)), kh[t]) break;
          i.push(String.fromCharCode(t));
          continue;
        }
        i.push(String.fromCharCode(n << 4 | a));
      } else i.push("#", String.fromCharCode(t));
    } else i.push(String.fromCharCode(t));
    return i.length > 127 && D(`Name token is longer than allowed by the spec: ${i.length}`), Z.get(i.join(""));
  }
  _hexStringWarn(t) {
    this._hexStringNumWarn++ != 5 ? this._hexStringNumWarn > 5 || D(`getHexString - ignoring invalid character: ${t}`) : D("getHexString - ignoring additional invalid characters.");
  }
  getHexString() {
    const t = this.strBuf;
    t.length = 0;
    let e = this.currentChar, i = -1, n = -1;
    for (this._hexStringNumWarn = 0; ; ) {
      if (e < 0) {
        D("Unterminated hex string");
        break;
      }
      if (e === 62) {
        this.nextChar();
        break;
      }
      kh[e] !== 1 ? (n = Sm(e), n === -1 ? this._hexStringWarn(e) : i === -1 ? i = n : (t.push(String.fromCharCode(i << 4 | n)), i = -1), e = this.nextChar()) : e = this.nextChar();
    }
    return i !== -1 && t.push(String.fromCharCode(i << 4)), t.join("");
  }
  getObj() {
    let t = !1, e = this.currentChar;
    for (; ; ) {
      if (e < 0) return vs;
      if (t) e !== 10 && e !== 13 || (t = !1);
      else if (e === 37) t = !0;
      else if (kh[e] !== 1) break;
      e = this.nextChar();
    }
    switch (0 | e) {
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 43:
      case 45:
      case 46:
        return this.getNumber();
      case 40:
        return this.getString();
      case 47:
        return this.getName();
      case 91:
        return this.nextChar(), Je.get("[");
      case 93:
        return this.nextChar(), Je.get("]");
      case 60:
        return e = this.nextChar(), e === 60 ? (this.nextChar(), Je.get("<<")) : this.getHexString();
      case 62:
        return e = this.nextChar(), e === 62 ? (this.nextChar(), Je.get(">>")) : Je.get(">");
      case 123:
        return this.nextChar(), Je.get("{");
      case 125:
        return this.nextChar(), Je.get("}");
      case 41:
        throw this.nextChar(), new st(`Illegal character: ${e}`);
    }
    let i = String.fromCharCode(e);
    if (e < 32 || e > 127) {
      const r = this.peekChar();
      if (r >= 32 && r <= 127)
        return this.nextChar(), Je.get(i);
    }
    const n = this.knownCommands;
    let a = (n == null ? void 0 : n[i]) !== void 0;
    for (; (e = this.nextChar()) >= 0 && !kh[e]; ) {
      const r = i + String.fromCharCode(e);
      if (a && n[r] === void 0) break;
      if (i.length === 128) throw new st(`Command token too long: ${i.length}`);
      i = r, a = (n == null ? void 0 : n[i]) !== void 0;
    }
    return i === "true" ? !0 : i === "false" ? !1 : i === "null" ? null : (i === "BI" && (this.beginInlineImagePos = this.stream.pos), Je.get(i));
  }
  skipToNextLine() {
    let t = this.currentChar;
    for (; t >= 0; ) {
      if (t === 13) {
        t = this.nextChar(), t === 10 && this.nextChar();
        break;
      }
      if (t === 10) {
        this.nextChar();
        break;
      }
      t = this.nextChar();
    }
  }
}
class I_ {
  static create(t) {
    function e(h, u, f = !1) {
      const d = h.get(u);
      if (Number.isInteger(d) && (f ? d >= 0 : d > 0)) return d;
      throw new Error(`The "${u}" parameter in the linearization dictionary is invalid.`);
    }
    const i = new ao({ lexer: new Zn(t), xref: null }), n = i.getObj(), a = i.getObj(), r = i.getObj(), o = i.getObj();
    let l, c;
    if (!(Number.isInteger(n) && Number.isInteger(a) && ds(r, "obj") && o instanceof q && typeof (l = o.get("Linearized")) == "number" && l > 0)) return null;
    if ((c = e(o, "L")) !== t.length) throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');
    return { length: c, hints: function(u) {
      const f = u.get("H");
      let d;
      if (Array.isArray(f) && ((d = f.length) === 2 || d === 4)) {
        for (let p = 0; p < d; p++) {
          const m = f[p];
          if (!(Number.isInteger(m) && m > 0)) throw new Error(`Hint (${p}) in the linearization dictionary is invalid.`);
        }
        return f;
      }
      throw new Error("Hint array in the linearization dictionary is invalid.");
    }(o), objectNumberFirst: e(o, "O"), endFirst: e(o, "E"), numPages: e(o, "N"), mainXRefEntriesOffset: e(o, "T"), pageFirst: o.has("P") ? e(o, "P", !0) : 0 };
  }
}
const __ = ["Adobe-GB1-UCS2", "Adobe-CNS1-UCS2", "Adobe-Japan1-UCS2", "Adobe-Korea1-UCS2", "78-EUC-H", "78-EUC-V", "78-H", "78-RKSJ-H", "78-RKSJ-V", "78-V", "78ms-RKSJ-H", "78ms-RKSJ-V", "83pv-RKSJ-H", "90ms-RKSJ-H", "90ms-RKSJ-V", "90msp-RKSJ-H", "90msp-RKSJ-V", "90pv-RKSJ-H", "90pv-RKSJ-V", "Add-H", "Add-RKSJ-H", "Add-RKSJ-V", "Add-V", "Adobe-CNS1-0", "Adobe-CNS1-1", "Adobe-CNS1-2", "Adobe-CNS1-3", "Adobe-CNS1-4", "Adobe-CNS1-5", "Adobe-CNS1-6", "Adobe-GB1-0", "Adobe-GB1-1", "Adobe-GB1-2", "Adobe-GB1-3", "Adobe-GB1-4", "Adobe-GB1-5", "Adobe-Japan1-0", "Adobe-Japan1-1", "Adobe-Japan1-2", "Adobe-Japan1-3", "Adobe-Japan1-4", "Adobe-Japan1-5", "Adobe-Japan1-6", "Adobe-Korea1-0", "Adobe-Korea1-1", "Adobe-Korea1-2", "B5-H", "B5-V", "B5pc-H", "B5pc-V", "CNS-EUC-H", "CNS-EUC-V", "CNS1-H", "CNS1-V", "CNS2-H", "CNS2-V", "ETHK-B5-H", "ETHK-B5-V", "ETen-B5-H", "ETen-B5-V", "ETenms-B5-H", "ETenms-B5-V", "EUC-H", "EUC-V", "Ext-H", "Ext-RKSJ-H", "Ext-RKSJ-V", "Ext-V", "GB-EUC-H", "GB-EUC-V", "GB-H", "GB-V", "GBK-EUC-H", "GBK-EUC-V", "GBK2K-H", "GBK2K-V", "GBKp-EUC-H", "GBKp-EUC-V", "GBT-EUC-H", "GBT-EUC-V", "GBT-H", "GBT-V", "GBTpc-EUC-H", "GBTpc-EUC-V", "GBpc-EUC-H", "GBpc-EUC-V", "H", "HKdla-B5-H", "HKdla-B5-V", "HKdlb-B5-H", "HKdlb-B5-V", "HKgccs-B5-H", "HKgccs-B5-V", "HKm314-B5-H", "HKm314-B5-V", "HKm471-B5-H", "HKm471-B5-V", "HKscs-B5-H", "HKscs-B5-V", "Hankaku", "Hiragana", "KSC-EUC-H", "KSC-EUC-V", "KSC-H", "KSC-Johab-H", "KSC-Johab-V", "KSC-V", "KSCms-UHC-H", "KSCms-UHC-HW-H", "KSCms-UHC-HW-V", "KSCms-UHC-V", "KSCpc-EUC-H", "KSCpc-EUC-V", "Katakana", "NWP-H", "NWP-V", "RKSJ-H", "RKSJ-V", "Roman", "UniCNS-UCS2-H", "UniCNS-UCS2-V", "UniCNS-UTF16-H", "UniCNS-UTF16-V", "UniCNS-UTF32-H", "UniCNS-UTF32-V", "UniCNS-UTF8-H", "UniCNS-UTF8-V", "UniGB-UCS2-H", "UniGB-UCS2-V", "UniGB-UTF16-H", "UniGB-UTF16-V", "UniGB-UTF32-H", "UniGB-UTF32-V", "UniGB-UTF8-H", "UniGB-UTF8-V", "UniJIS-UCS2-H", "UniJIS-UCS2-HW-H", "UniJIS-UCS2-HW-V", "UniJIS-UCS2-V", "UniJIS-UTF16-H", "UniJIS-UTF16-V", "UniJIS-UTF32-H", "UniJIS-UTF32-V", "UniJIS-UTF8-H", "UniJIS-UTF8-V", "UniJIS2004-UTF16-H", "UniJIS2004-UTF16-V", "UniJIS2004-UTF32-H", "UniJIS2004-UTF32-V", "UniJIS2004-UTF8-H", "UniJIS2004-UTF8-V", "UniJISPro-UCS2-HW-V", "UniJISPro-UCS2-V", "UniJISPro-UTF8-V", "UniJISX0213-UTF32-H", "UniJISX0213-UTF32-V", "UniJISX02132004-UTF32-H", "UniJISX02132004-UTF32-V", "UniKS-UCS2-H", "UniKS-UCS2-V", "UniKS-UTF16-H", "UniKS-UTF16-V", "UniKS-UTF32-H", "UniKS-UTF32-V", "UniKS-UTF8-H", "UniKS-UTF8-V", "V", "WP-Symbol"], Cm = 2 ** 24 - 1;
class m7 {
  constructor(t = !1) {
    this.codespaceRanges = [[], [], [], []], this.numCodespaceRanges = 0, this._map = [], this.name = "", this.vertical = !1, this.useCMap = null, this.builtInCMap = t;
  }
  addCodespaceRange(t, e, i) {
    this.codespaceRanges[t - 1].push(e, i), this.numCodespaceRanges++;
  }
  mapCidRange(t, e, i) {
    if (e - t > Cm) throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");
    for (; t <= e; ) this._map[t++] = i++;
  }
  mapBfRange(t, e, i) {
    if (e - t > Cm) throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");
    const n = i.length - 1;
    for (; t <= e; ) {
      this._map[t++] = i;
      const a = i.charCodeAt(n) + 1;
      a > 255 ? i = i.substring(0, n - 1) + String.fromCharCode(i.charCodeAt(n - 1) + 1) + "\0" : i = i.substring(0, n) + String.fromCharCode(a);
    }
  }
  mapBfRangeToArray(t, e, i) {
    if (e - t > Cm) throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");
    const n = i.length;
    let a = 0;
    for (; t <= e && a < n; )
      this._map[t] = i[a++], ++t;
  }
  mapOne(t, e) {
    this._map[t] = e;
  }
  lookup(t) {
    return this._map[t];
  }
  contains(t) {
    return this._map[t] !== void 0;
  }
  forEach(t) {
    const e = this._map, i = e.length;
    if (i <= 65536) for (let n = 0; n < i; n++) e[n] !== void 0 && t(n, e[n]);
    else for (const n in e) t(n, e[n]);
  }
  charCodeOf(t) {
    const e = this._map;
    if (e.length <= 65536) return e.indexOf(t);
    for (const i in e) if (e[i] === t) return 0 | i;
    return -1;
  }
  getMap() {
    return this._map;
  }
  readCharCode(t, e, i) {
    let n = 0;
    const a = this.codespaceRanges;
    for (let r = 0, o = a.length; r < o; r++) {
      n = (n << 8 | t.charCodeAt(e + r)) >>> 0;
      const l = a[r];
      for (let c = 0, h = l.length; c < h; ) {
        const u = l[c++], f = l[c++];
        if (n >= u && n <= f) {
          i.charcode = n, i.length = r + 1;
          return;
        }
      }
    }
    i.charcode = 0, i.length = 1;
  }
  getCharCodeLength(t) {
    const e = this.codespaceRanges;
    for (let i = 0, n = e.length; i < n; i++) {
      const a = e[i];
      for (let r = 0, o = a.length; r < o; ) {
        const l = a[r++], c = a[r++];
        if (t >= l && t <= c) return i + 1;
      }
    }
    return 1;
  }
  get length() {
    return this._map.length;
  }
  get isIdentityCMap() {
    if (this.name !== "Identity-H" && this.name !== "Identity-V" || this._map.length !== 65536) return !1;
    for (let t = 0; t < 65536; t++) if (this._map[t] !== t) return !1;
    return !0;
  }
}
class au extends m7 {
  constructor(t, e) {
    super(), this.vertical = t, this.addCodespaceRange(e, 0, 65535);
  }
  mapCidRange(t, e, i) {
    Wt("should not call mapCidRange");
  }
  mapBfRange(t, e, i) {
    Wt("should not call mapBfRange");
  }
  mapBfRangeToArray(t, e, i) {
    Wt("should not call mapBfRangeToArray");
  }
  mapOne(t, e) {
    Wt("should not call mapCidOne");
  }
  lookup(t) {
    return Number.isInteger(t) && t <= 65535 ? t : void 0;
  }
  contains(t) {
    return Number.isInteger(t) && t <= 65535;
  }
  forEach(t) {
    for (let e = 0; e <= 65535; e++) t(e, e);
  }
  charCodeOf(t) {
    return Number.isInteger(t) && t <= 65535 ? t : -1;
  }
  getMap() {
    const t = new Array(65536);
    for (let e = 0; e <= 65535; e++) t[e] = e;
    return t;
  }
  get length() {
    return 65536;
  }
  get isIdentityCMap() {
    Wt("should not access .isIdentityCMap");
  }
}
function ll(s) {
  let t = 0;
  for (let e = 0; e < s.length; e++) t = t << 8 | s.charCodeAt(e);
  return t >>> 0;
}
function uh(s) {
  if (typeof s != "string") throw new st("Malformed CMap: expected string.");
}
function kA(s) {
  if (!Number.isInteger(s)) throw new st("Malformed CMap: expected int.");
}
function T_(s, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === vs) break;
    if (ds(e, "endbfchar")) return;
    uh(e);
    const i = ll(e);
    e = t.getObj(), uh(e);
    const n = e;
    s.mapOne(i, n);
  }
}
function E_(s, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === vs) break;
    if (ds(e, "endbfrange")) return;
    uh(e);
    const i = ll(e);
    e = t.getObj(), uh(e);
    const n = ll(e);
    if (e = t.getObj(), Number.isInteger(e) || typeof e == "string") {
      const a = Number.isInteger(e) ? String.fromCharCode(e) : e;
      s.mapBfRange(i, n, a);
    } else {
      if (!ds(e, "[")) break;
      {
        e = t.getObj();
        const a = [];
        for (; !ds(e, "]") && e !== vs; )
          a.push(e), e = t.getObj();
        s.mapBfRangeToArray(i, n, a);
      }
    }
  }
  throw new st("Invalid bf range.");
}
function M_(s, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === vs) break;
    if (ds(e, "endcidchar")) return;
    uh(e);
    const i = ll(e);
    e = t.getObj(), kA(e);
    const n = e;
    s.mapOne(i, n);
  }
}
function F_(s, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === vs) break;
    if (ds(e, "endcidrange")) return;
    uh(e);
    const i = ll(e);
    e = t.getObj(), uh(e);
    const n = ll(e);
    e = t.getObj(), kA(e);
    const a = e;
    s.mapCidRange(i, n, a);
  }
}
function R_(s, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === vs) break;
    if (ds(e, "endcodespacerange")) return;
    if (typeof e != "string") break;
    const i = ll(e);
    if (e = t.getObj(), typeof e != "string") break;
    const n = ll(e);
    s.addCodespaceRange(e.length, i, n);
  }
  throw new st("Invalid codespace range.");
}
function P_(s, t) {
  const e = t.getObj();
  Number.isInteger(e) && (s.vertical = !!e);
}
function D_(s, t) {
  const e = t.getObj();
  e instanceof Z && (s.name = e.name);
}
async function SA(s, t, e, i) {
  let n, a;
  t: for (; ; ) try {
    const r = t.getObj();
    if (r === vs) break;
    if (r instanceof Z)
      r.name === "WMode" ? P_(s, t) : r.name === "CMapName" && D_(s, t), n = r;
    else if (r instanceof Je) switch (r.cmd) {
      case "endcmap":
        break t;
      case "usecmap":
        n instanceof Z && (a = n.name);
        break;
      case "begincodespacerange":
        R_(s, t);
        break;
      case "beginbfchar":
        T_(s, t);
        break;
      case "begincidchar":
        M_(s, t);
        break;
      case "beginbfrange":
        E_(s, t);
        break;
      case "begincidrange":
        F_(s, t);
    }
  } catch (r) {
    if (r instanceof ke) throw r;
    D("Invalid cMap data: " + r);
    continue;
  }
  return !i && a && (i = a), i ? CA(s, e, i) : s;
}
async function CA(s, t, e) {
  if (s.useCMap = await a6(e, t), s.numCodespaceRanges === 0) {
    const i = s.useCMap.codespaceRanges;
    for (let n = 0; n < i.length; n++) s.codespaceRanges[n] = i[n].slice();
    s.numCodespaceRanges = s.useCMap.numCodespaceRanges;
  }
  return s.useCMap.forEach(function(i, n) {
    s.contains(i) || s.mapOne(i, n);
  }), s;
}
async function a6(s, t) {
  if (s === "Identity-H") return new au(!1, 2);
  if (s === "Identity-V") return new au(!0, 2);
  if (!__.includes(s)) throw new Error("Unknown CMap name: " + s);
  if (!t) throw new Error("Built-in CMap parameters are not provided.");
  const { cMapData: e, isCompressed: i } = await t(s), n = new m7(!0);
  if (i) return new i_().process(e, n, (r) => CA(n, t, r));
  const a = new Zn(new Le(e));
  return SA(n, a, t, null);
}
class Q2 {
  static async create({ encoding: t, fetchBuiltInCMap: e, useCMap: i }) {
    if (t instanceof Z) return a6(t.name, e);
    if (t instanceof Ot) {
      const n = await SA(new m7(), new Zn(t), e, i);
      return n.isIdentityCMap ? a6(n.name, e) : n;
    }
    throw new Error("Encoding required.");
  }
}
const IA = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"], N_ = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "", "threequartersemdash", "", "questionsmall", "", "", "", "", "Ethsmall", "", "", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "", "", "", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hypheninferior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "asuperior", "centsuperior", "", "", "", "", "Aacutesmall", "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall", "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall", "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall", "", "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall", "", "centinferior", "twoinferior", "", "Dieresissmall", "", "Caronsmall", "osuperior", "fiveinferior", "", "commainferior", "periodinferior", "Yacutesmall", "", "dollarinferior", "", "", "Thornsmall", "", "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall", "questiondownsmall", "oneinferior", "Lslashsmall", "", "", "", "", "", "", "Cedillasmall", "", "", "", "", "", "OEsmall", "figuredash", "hyphensuperior", "", "", "", "", "exclamdownsmall", "", "Ydieresissmall", "", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "ninesuperior", "zerosuperior", "", "esuperior", "rsuperior", "tsuperior", "", "", "isuperior", "ssuperior", "dsuperior", "", "", "", "", "", "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior", "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", "", "", "", ""], b7 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "space", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron"], Ur = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls", "", "", "", ""], l0 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"], y7 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""], w7 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""];
function c0(s) {
  switch (s) {
    case "WinAnsiEncoding":
      return l0;
    case "StandardEncoding":
      return Ur;
    case "MacRomanEncoding":
      return b7;
    case "SymbolSetEncoding":
      return y7;
    case "ZapfDingbatsEncoding":
      return w7;
    case "ExpertEncoding":
      return IA;
    case "MacExpertEncoding":
      return N_;
    default:
      return null;
  }
}
const ma = Ee(function(s) {
  s.A = 65, s.AE = 198, s.AEacute = 508, s.AEmacron = 482, s.AEsmall = 63462, s.Aacute = 193, s.Aacutesmall = 63457, s.Abreve = 258, s.Abreveacute = 7854, s.Abrevecyrillic = 1232, s.Abrevedotbelow = 7862, s.Abrevegrave = 7856, s.Abrevehookabove = 7858, s.Abrevetilde = 7860, s.Acaron = 461, s.Acircle = 9398, s.Acircumflex = 194, s.Acircumflexacute = 7844, s.Acircumflexdotbelow = 7852, s.Acircumflexgrave = 7846, s.Acircumflexhookabove = 7848, s.Acircumflexsmall = 63458, s.Acircumflextilde = 7850, s.Acute = 63177, s.Acutesmall = 63412, s.Acyrillic = 1040, s.Adblgrave = 512, s.Adieresis = 196, s.Adieresiscyrillic = 1234, s.Adieresismacron = 478, s.Adieresissmall = 63460, s.Adotbelow = 7840, s.Adotmacron = 480, s.Agrave = 192, s.Agravesmall = 63456, s.Ahookabove = 7842, s.Aiecyrillic = 1236, s.Ainvertedbreve = 514, s.Alpha = 913, s.Alphatonos = 902, s.Amacron = 256, s.Amonospace = 65313, s.Aogonek = 260, s.Aring = 197, s.Aringacute = 506, s.Aringbelow = 7680, s.Aringsmall = 63461, s.Asmall = 63329, s.Atilde = 195, s.Atildesmall = 63459, s.Aybarmenian = 1329, s.B = 66, s.Bcircle = 9399, s.Bdotaccent = 7682, s.Bdotbelow = 7684, s.Becyrillic = 1041, s.Benarmenian = 1330, s.Beta = 914, s.Bhook = 385, s.Blinebelow = 7686, s.Bmonospace = 65314, s.Brevesmall = 63220, s.Bsmall = 63330, s.Btopbar = 386, s.C = 67, s.Caarmenian = 1342, s.Cacute = 262, s.Caron = 63178, s.Caronsmall = 63221, s.Ccaron = 268, s.Ccedilla = 199, s.Ccedillaacute = 7688, s.Ccedillasmall = 63463, s.Ccircle = 9400, s.Ccircumflex = 264, s.Cdot = 266, s.Cdotaccent = 266, s.Cedillasmall = 63416, s.Chaarmenian = 1353, s.Cheabkhasiancyrillic = 1212, s.Checyrillic = 1063, s.Chedescenderabkhasiancyrillic = 1214, s.Chedescendercyrillic = 1206, s.Chedieresiscyrillic = 1268, s.Cheharmenian = 1347, s.Chekhakassiancyrillic = 1227, s.Cheverticalstrokecyrillic = 1208, s.Chi = 935, s.Chook = 391, s.Circumflexsmall = 63222, s.Cmonospace = 65315, s.Coarmenian = 1361, s.Csmall = 63331, s.D = 68, s.DZ = 497, s.DZcaron = 452, s.Daarmenian = 1332, s.Dafrican = 393, s.Dcaron = 270, s.Dcedilla = 7696, s.Dcircle = 9401, s.Dcircumflexbelow = 7698, s.Dcroat = 272, s.Ddotaccent = 7690, s.Ddotbelow = 7692, s.Decyrillic = 1044, s.Deicoptic = 1006, s.Delta = 8710, s.Deltagreek = 916, s.Dhook = 394, s.Dieresis = 63179, s.DieresisAcute = 63180, s.DieresisGrave = 63181, s.Dieresissmall = 63400, s.Digammagreek = 988, s.Djecyrillic = 1026, s.Dlinebelow = 7694, s.Dmonospace = 65316, s.Dotaccentsmall = 63223, s.Dslash = 272, s.Dsmall = 63332, s.Dtopbar = 395, s.Dz = 498, s.Dzcaron = 453, s.Dzeabkhasiancyrillic = 1248, s.Dzecyrillic = 1029, s.Dzhecyrillic = 1039, s.E = 69, s.Eacute = 201, s.Eacutesmall = 63465, s.Ebreve = 276, s.Ecaron = 282, s.Ecedillabreve = 7708, s.Echarmenian = 1333, s.Ecircle = 9402, s.Ecircumflex = 202, s.Ecircumflexacute = 7870, s.Ecircumflexbelow = 7704, s.Ecircumflexdotbelow = 7878, s.Ecircumflexgrave = 7872, s.Ecircumflexhookabove = 7874, s.Ecircumflexsmall = 63466, s.Ecircumflextilde = 7876, s.Ecyrillic = 1028, s.Edblgrave = 516, s.Edieresis = 203, s.Edieresissmall = 63467, s.Edot = 278, s.Edotaccent = 278, s.Edotbelow = 7864, s.Efcyrillic = 1060, s.Egrave = 200, s.Egravesmall = 63464, s.Eharmenian = 1335, s.Ehookabove = 7866, s.Eightroman = 8551, s.Einvertedbreve = 518, s.Eiotifiedcyrillic = 1124, s.Elcyrillic = 1051, s.Elevenroman = 8554, s.Emacron = 274, s.Emacronacute = 7702, s.Emacrongrave = 7700, s.Emcyrillic = 1052, s.Emonospace = 65317, s.Encyrillic = 1053, s.Endescendercyrillic = 1186, s.Eng = 330, s.Enghecyrillic = 1188, s.Enhookcyrillic = 1223, s.Eogonek = 280, s.Eopen = 400, s.Epsilon = 917, s.Epsilontonos = 904, s.Ercyrillic = 1056, s.Ereversed = 398, s.Ereversedcyrillic = 1069, s.Escyrillic = 1057, s.Esdescendercyrillic = 1194, s.Esh = 425, s.Esmall = 63333, s.Eta = 919, s.Etarmenian = 1336, s.Etatonos = 905, s.Eth = 208, s.Ethsmall = 63472, s.Etilde = 7868, s.Etildebelow = 7706, s.Euro = 8364, s.Ezh = 439, s.Ezhcaron = 494, s.Ezhreversed = 440, s.F = 70, s.Fcircle = 9403, s.Fdotaccent = 7710, s.Feharmenian = 1366, s.Feicoptic = 996, s.Fhook = 401, s.Fitacyrillic = 1138, s.Fiveroman = 8548, s.Fmonospace = 65318, s.Fourroman = 8547, s.Fsmall = 63334, s.G = 71, s.GBsquare = 13191, s.Gacute = 500, s.Gamma = 915, s.Gammaafrican = 404, s.Gangiacoptic = 1002, s.Gbreve = 286, s.Gcaron = 486, s.Gcedilla = 290, s.Gcircle = 9404, s.Gcircumflex = 284, s.Gcommaaccent = 290, s.Gdot = 288, s.Gdotaccent = 288, s.Gecyrillic = 1043, s.Ghadarmenian = 1346, s.Ghemiddlehookcyrillic = 1172, s.Ghestrokecyrillic = 1170, s.Gheupturncyrillic = 1168, s.Ghook = 403, s.Gimarmenian = 1331, s.Gjecyrillic = 1027, s.Gmacron = 7712, s.Gmonospace = 65319, s.Grave = 63182, s.Gravesmall = 63328, s.Gsmall = 63335, s.Gsmallhook = 667, s.Gstroke = 484, s.H = 72, s.H18533 = 9679, s.H18543 = 9642, s.H18551 = 9643, s.H22073 = 9633, s.HPsquare = 13259, s.Haabkhasiancyrillic = 1192, s.Hadescendercyrillic = 1202, s.Hardsigncyrillic = 1066, s.Hbar = 294, s.Hbrevebelow = 7722, s.Hcedilla = 7720, s.Hcircle = 9405, s.Hcircumflex = 292, s.Hdieresis = 7718, s.Hdotaccent = 7714, s.Hdotbelow = 7716, s.Hmonospace = 65320, s.Hoarmenian = 1344, s.Horicoptic = 1e3, s.Hsmall = 63336, s.Hungarumlaut = 63183, s.Hungarumlautsmall = 63224, s.Hzsquare = 13200, s.I = 73, s.IAcyrillic = 1071, s.IJ = 306, s.IUcyrillic = 1070, s.Iacute = 205, s.Iacutesmall = 63469, s.Ibreve = 300, s.Icaron = 463, s.Icircle = 9406, s.Icircumflex = 206, s.Icircumflexsmall = 63470, s.Icyrillic = 1030, s.Idblgrave = 520, s.Idieresis = 207, s.Idieresisacute = 7726, s.Idieresiscyrillic = 1252, s.Idieresissmall = 63471, s.Idot = 304, s.Idotaccent = 304, s.Idotbelow = 7882, s.Iebrevecyrillic = 1238, s.Iecyrillic = 1045, s.Ifraktur = 8465, s.Igrave = 204, s.Igravesmall = 63468, s.Ihookabove = 7880, s.Iicyrillic = 1048, s.Iinvertedbreve = 522, s.Iishortcyrillic = 1049, s.Imacron = 298, s.Imacroncyrillic = 1250, s.Imonospace = 65321, s.Iniarmenian = 1339, s.Iocyrillic = 1025, s.Iogonek = 302, s.Iota = 921, s.Iotaafrican = 406, s.Iotadieresis = 938, s.Iotatonos = 906, s.Ismall = 63337, s.Istroke = 407, s.Itilde = 296, s.Itildebelow = 7724, s.Izhitsacyrillic = 1140, s.Izhitsadblgravecyrillic = 1142, s.J = 74, s.Jaarmenian = 1345, s.Jcircle = 9407, s.Jcircumflex = 308, s.Jecyrillic = 1032, s.Jheharmenian = 1355, s.Jmonospace = 65322, s.Jsmall = 63338, s.K = 75, s.KBsquare = 13189, s.KKsquare = 13261, s.Kabashkircyrillic = 1184, s.Kacute = 7728, s.Kacyrillic = 1050, s.Kadescendercyrillic = 1178, s.Kahookcyrillic = 1219, s.Kappa = 922, s.Kastrokecyrillic = 1182, s.Kaverticalstrokecyrillic = 1180, s.Kcaron = 488, s.Kcedilla = 310, s.Kcircle = 9408, s.Kcommaaccent = 310, s.Kdotbelow = 7730, s.Keharmenian = 1364, s.Kenarmenian = 1343, s.Khacyrillic = 1061, s.Kheicoptic = 998, s.Khook = 408, s.Kjecyrillic = 1036, s.Klinebelow = 7732, s.Kmonospace = 65323, s.Koppacyrillic = 1152, s.Koppagreek = 990, s.Ksicyrillic = 1134, s.Ksmall = 63339, s.L = 76, s.LJ = 455, s.LL = 63167, s.Lacute = 313, s.Lambda = 923, s.Lcaron = 317, s.Lcedilla = 315, s.Lcircle = 9409, s.Lcircumflexbelow = 7740, s.Lcommaaccent = 315, s.Ldot = 319, s.Ldotaccent = 319, s.Ldotbelow = 7734, s.Ldotbelowmacron = 7736, s.Liwnarmenian = 1340, s.Lj = 456, s.Ljecyrillic = 1033, s.Llinebelow = 7738, s.Lmonospace = 65324, s.Lslash = 321, s.Lslashsmall = 63225, s.Lsmall = 63340, s.M = 77, s.MBsquare = 13190, s.Macron = 63184, s.Macronsmall = 63407, s.Macute = 7742, s.Mcircle = 9410, s.Mdotaccent = 7744, s.Mdotbelow = 7746, s.Menarmenian = 1348, s.Mmonospace = 65325, s.Msmall = 63341, s.Mturned = 412, s.Mu = 924, s.N = 78, s.NJ = 458, s.Nacute = 323, s.Ncaron = 327, s.Ncedilla = 325, s.Ncircle = 9411, s.Ncircumflexbelow = 7754, s.Ncommaaccent = 325, s.Ndotaccent = 7748, s.Ndotbelow = 7750, s.Nhookleft = 413, s.Nineroman = 8552, s.Nj = 459, s.Njecyrillic = 1034, s.Nlinebelow = 7752, s.Nmonospace = 65326, s.Nowarmenian = 1350, s.Nsmall = 63342, s.Ntilde = 209, s.Ntildesmall = 63473, s.Nu = 925, s.O = 79, s.OE = 338, s.OEsmall = 63226, s.Oacute = 211, s.Oacutesmall = 63475, s.Obarredcyrillic = 1256, s.Obarreddieresiscyrillic = 1258, s.Obreve = 334, s.Ocaron = 465, s.Ocenteredtilde = 415, s.Ocircle = 9412, s.Ocircumflex = 212, s.Ocircumflexacute = 7888, s.Ocircumflexdotbelow = 7896, s.Ocircumflexgrave = 7890, s.Ocircumflexhookabove = 7892, s.Ocircumflexsmall = 63476, s.Ocircumflextilde = 7894, s.Ocyrillic = 1054, s.Odblacute = 336, s.Odblgrave = 524, s.Odieresis = 214, s.Odieresiscyrillic = 1254, s.Odieresissmall = 63478, s.Odotbelow = 7884, s.Ogoneksmall = 63227, s.Ograve = 210, s.Ogravesmall = 63474, s.Oharmenian = 1365, s.Ohm = 8486, s.Ohookabove = 7886, s.Ohorn = 416, s.Ohornacute = 7898, s.Ohorndotbelow = 7906, s.Ohorngrave = 7900, s.Ohornhookabove = 7902, s.Ohorntilde = 7904, s.Ohungarumlaut = 336, s.Oi = 418, s.Oinvertedbreve = 526, s.Omacron = 332, s.Omacronacute = 7762, s.Omacrongrave = 7760, s.Omega = 8486, s.Omegacyrillic = 1120, s.Omegagreek = 937, s.Omegaroundcyrillic = 1146, s.Omegatitlocyrillic = 1148, s.Omegatonos = 911, s.Omicron = 927, s.Omicrontonos = 908, s.Omonospace = 65327, s.Oneroman = 8544, s.Oogonek = 490, s.Oogonekmacron = 492, s.Oopen = 390, s.Oslash = 216, s.Oslashacute = 510, s.Oslashsmall = 63480, s.Osmall = 63343, s.Ostrokeacute = 510, s.Otcyrillic = 1150, s.Otilde = 213, s.Otildeacute = 7756, s.Otildedieresis = 7758, s.Otildesmall = 63477, s.P = 80, s.Pacute = 7764, s.Pcircle = 9413, s.Pdotaccent = 7766, s.Pecyrillic = 1055, s.Peharmenian = 1354, s.Pemiddlehookcyrillic = 1190, s.Phi = 934, s.Phook = 420, s.Pi = 928, s.Piwrarmenian = 1363, s.Pmonospace = 65328, s.Psi = 936, s.Psicyrillic = 1136, s.Psmall = 63344, s.Q = 81, s.Qcircle = 9414, s.Qmonospace = 65329, s.Qsmall = 63345, s.R = 82, s.Raarmenian = 1356, s.Racute = 340, s.Rcaron = 344, s.Rcedilla = 342, s.Rcircle = 9415, s.Rcommaaccent = 342, s.Rdblgrave = 528, s.Rdotaccent = 7768, s.Rdotbelow = 7770, s.Rdotbelowmacron = 7772, s.Reharmenian = 1360, s.Rfraktur = 8476, s.Rho = 929, s.Ringsmall = 63228, s.Rinvertedbreve = 530, s.Rlinebelow = 7774, s.Rmonospace = 65330, s.Rsmall = 63346, s.Rsmallinverted = 641, s.Rsmallinvertedsuperior = 694, s.S = 83, s.SF010000 = 9484, s.SF020000 = 9492, s.SF030000 = 9488, s.SF040000 = 9496, s.SF050000 = 9532, s.SF060000 = 9516, s.SF070000 = 9524, s.SF080000 = 9500, s.SF090000 = 9508, s.SF100000 = 9472, s.SF110000 = 9474, s.SF190000 = 9569, s.SF200000 = 9570, s.SF210000 = 9558, s.SF220000 = 9557, s.SF230000 = 9571, s.SF240000 = 9553, s.SF250000 = 9559, s.SF260000 = 9565, s.SF270000 = 9564, s.SF280000 = 9563, s.SF360000 = 9566, s.SF370000 = 9567, s.SF380000 = 9562, s.SF390000 = 9556, s.SF400000 = 9577, s.SF410000 = 9574, s.SF420000 = 9568, s.SF430000 = 9552, s.SF440000 = 9580, s.SF450000 = 9575, s.SF460000 = 9576, s.SF470000 = 9572, s.SF480000 = 9573, s.SF490000 = 9561, s.SF500000 = 9560, s.SF510000 = 9554, s.SF520000 = 9555, s.SF530000 = 9579, s.SF540000 = 9578, s.Sacute = 346, s.Sacutedotaccent = 7780, s.Sampigreek = 992, s.Scaron = 352, s.Scarondotaccent = 7782, s.Scaronsmall = 63229, s.Scedilla = 350, s.Schwa = 399, s.Schwacyrillic = 1240, s.Schwadieresiscyrillic = 1242, s.Scircle = 9416, s.Scircumflex = 348, s.Scommaaccent = 536, s.Sdotaccent = 7776, s.Sdotbelow = 7778, s.Sdotbelowdotaccent = 7784, s.Seharmenian = 1357, s.Sevenroman = 8550, s.Shaarmenian = 1351, s.Shacyrillic = 1064, s.Shchacyrillic = 1065, s.Sheicoptic = 994, s.Shhacyrillic = 1210, s.Shimacoptic = 1004, s.Sigma = 931, s.Sixroman = 8549, s.Smonospace = 65331, s.Softsigncyrillic = 1068, s.Ssmall = 63347, s.Stigmagreek = 986, s.T = 84, s.Tau = 932, s.Tbar = 358, s.Tcaron = 356, s.Tcedilla = 354, s.Tcircle = 9417, s.Tcircumflexbelow = 7792, s.Tcommaaccent = 354, s.Tdotaccent = 7786, s.Tdotbelow = 7788, s.Tecyrillic = 1058, s.Tedescendercyrillic = 1196, s.Tenroman = 8553, s.Tetsecyrillic = 1204, s.Theta = 920, s.Thook = 428, s.Thorn = 222, s.Thornsmall = 63486, s.Threeroman = 8546, s.Tildesmall = 63230, s.Tiwnarmenian = 1359, s.Tlinebelow = 7790, s.Tmonospace = 65332, s.Toarmenian = 1337, s.Tonefive = 444, s.Tonesix = 388, s.Tonetwo = 423, s.Tretroflexhook = 430, s.Tsecyrillic = 1062, s.Tshecyrillic = 1035, s.Tsmall = 63348, s.Twelveroman = 8555, s.Tworoman = 8545, s.U = 85, s.Uacute = 218, s.Uacutesmall = 63482, s.Ubreve = 364, s.Ucaron = 467, s.Ucircle = 9418, s.Ucircumflex = 219, s.Ucircumflexbelow = 7798, s.Ucircumflexsmall = 63483, s.Ucyrillic = 1059, s.Udblacute = 368, s.Udblgrave = 532, s.Udieresis = 220, s.Udieresisacute = 471, s.Udieresisbelow = 7794, s.Udieresiscaron = 473, s.Udieresiscyrillic = 1264, s.Udieresisgrave = 475, s.Udieresismacron = 469, s.Udieresissmall = 63484, s.Udotbelow = 7908, s.Ugrave = 217, s.Ugravesmall = 63481, s.Uhookabove = 7910, s.Uhorn = 431, s.Uhornacute = 7912, s.Uhorndotbelow = 7920, s.Uhorngrave = 7914, s.Uhornhookabove = 7916, s.Uhorntilde = 7918, s.Uhungarumlaut = 368, s.Uhungarumlautcyrillic = 1266, s.Uinvertedbreve = 534, s.Ukcyrillic = 1144, s.Umacron = 362, s.Umacroncyrillic = 1262, s.Umacrondieresis = 7802, s.Umonospace = 65333, s.Uogonek = 370, s.Upsilon = 933, s.Upsilon1 = 978, s.Upsilonacutehooksymbolgreek = 979, s.Upsilonafrican = 433, s.Upsilondieresis = 939, s.Upsilondieresishooksymbolgreek = 980, s.Upsilonhooksymbol = 978, s.Upsilontonos = 910, s.Uring = 366, s.Ushortcyrillic = 1038, s.Usmall = 63349, s.Ustraightcyrillic = 1198, s.Ustraightstrokecyrillic = 1200, s.Utilde = 360, s.Utildeacute = 7800, s.Utildebelow = 7796, s.V = 86, s.Vcircle = 9419, s.Vdotbelow = 7806, s.Vecyrillic = 1042, s.Vewarmenian = 1358, s.Vhook = 434, s.Vmonospace = 65334, s.Voarmenian = 1352, s.Vsmall = 63350, s.Vtilde = 7804, s.W = 87, s.Wacute = 7810, s.Wcircle = 9420, s.Wcircumflex = 372, s.Wdieresis = 7812, s.Wdotaccent = 7814, s.Wdotbelow = 7816, s.Wgrave = 7808, s.Wmonospace = 65335, s.Wsmall = 63351, s.X = 88, s.Xcircle = 9421, s.Xdieresis = 7820, s.Xdotaccent = 7818, s.Xeharmenian = 1341, s.Xi = 926, s.Xmonospace = 65336, s.Xsmall = 63352, s.Y = 89, s.Yacute = 221, s.Yacutesmall = 63485, s.Yatcyrillic = 1122, s.Ycircle = 9422, s.Ycircumflex = 374, s.Ydieresis = 376, s.Ydieresissmall = 63487, s.Ydotaccent = 7822, s.Ydotbelow = 7924, s.Yericyrillic = 1067, s.Yerudieresiscyrillic = 1272, s.Ygrave = 7922, s.Yhook = 435, s.Yhookabove = 7926, s.Yiarmenian = 1349, s.Yicyrillic = 1031, s.Yiwnarmenian = 1362, s.Ymonospace = 65337, s.Ysmall = 63353, s.Ytilde = 7928, s.Yusbigcyrillic = 1130, s.Yusbigiotifiedcyrillic = 1132, s.Yuslittlecyrillic = 1126, s.Yuslittleiotifiedcyrillic = 1128, s.Z = 90, s.Zaarmenian = 1334, s.Zacute = 377, s.Zcaron = 381, s.Zcaronsmall = 63231, s.Zcircle = 9423, s.Zcircumflex = 7824, s.Zdot = 379, s.Zdotaccent = 379, s.Zdotbelow = 7826, s.Zecyrillic = 1047, s.Zedescendercyrillic = 1176, s.Zedieresiscyrillic = 1246, s.Zeta = 918, s.Zhearmenian = 1338, s.Zhebrevecyrillic = 1217, s.Zhecyrillic = 1046, s.Zhedescendercyrillic = 1174, s.Zhedieresiscyrillic = 1244, s.Zlinebelow = 7828, s.Zmonospace = 65338, s.Zsmall = 63354, s.Zstroke = 437, s.a = 97, s.aabengali = 2438, s.aacute = 225, s.aadeva = 2310, s.aagujarati = 2694, s.aagurmukhi = 2566, s.aamatragurmukhi = 2622, s.aarusquare = 13059, s.aavowelsignbengali = 2494, s.aavowelsigndeva = 2366, s.aavowelsigngujarati = 2750, s.abbreviationmarkarmenian = 1375, s.abbreviationsigndeva = 2416, s.abengali = 2437, s.abopomofo = 12570, s.abreve = 259, s.abreveacute = 7855, s.abrevecyrillic = 1233, s.abrevedotbelow = 7863, s.abrevegrave = 7857, s.abrevehookabove = 7859, s.abrevetilde = 7861, s.acaron = 462, s.acircle = 9424, s.acircumflex = 226, s.acircumflexacute = 7845, s.acircumflexdotbelow = 7853, s.acircumflexgrave = 7847, s.acircumflexhookabove = 7849, s.acircumflextilde = 7851, s.acute = 180, s.acutebelowcmb = 791, s.acutecmb = 769, s.acutecomb = 769, s.acutedeva = 2388, s.acutelowmod = 719, s.acutetonecmb = 833, s.acyrillic = 1072, s.adblgrave = 513, s.addakgurmukhi = 2673, s.adeva = 2309, s.adieresis = 228, s.adieresiscyrillic = 1235, s.adieresismacron = 479, s.adotbelow = 7841, s.adotmacron = 481, s.ae = 230, s.aeacute = 509, s.aekorean = 12624, s.aemacron = 483, s.afii00208 = 8213, s.afii08941 = 8356, s.afii10017 = 1040, s.afii10018 = 1041, s.afii10019 = 1042, s.afii10020 = 1043, s.afii10021 = 1044, s.afii10022 = 1045, s.afii10023 = 1025, s.afii10024 = 1046, s.afii10025 = 1047, s.afii10026 = 1048, s.afii10027 = 1049, s.afii10028 = 1050, s.afii10029 = 1051, s.afii10030 = 1052, s.afii10031 = 1053, s.afii10032 = 1054, s.afii10033 = 1055, s.afii10034 = 1056, s.afii10035 = 1057, s.afii10036 = 1058, s.afii10037 = 1059, s.afii10038 = 1060, s.afii10039 = 1061, s.afii10040 = 1062, s.afii10041 = 1063, s.afii10042 = 1064, s.afii10043 = 1065, s.afii10044 = 1066, s.afii10045 = 1067, s.afii10046 = 1068, s.afii10047 = 1069, s.afii10048 = 1070, s.afii10049 = 1071, s.afii10050 = 1168, s.afii10051 = 1026, s.afii10052 = 1027, s.afii10053 = 1028, s.afii10054 = 1029, s.afii10055 = 1030, s.afii10056 = 1031, s.afii10057 = 1032, s.afii10058 = 1033, s.afii10059 = 1034, s.afii10060 = 1035, s.afii10061 = 1036, s.afii10062 = 1038, s.afii10063 = 63172, s.afii10064 = 63173, s.afii10065 = 1072, s.afii10066 = 1073, s.afii10067 = 1074, s.afii10068 = 1075, s.afii10069 = 1076, s.afii10070 = 1077, s.afii10071 = 1105, s.afii10072 = 1078, s.afii10073 = 1079, s.afii10074 = 1080, s.afii10075 = 1081, s.afii10076 = 1082, s.afii10077 = 1083, s.afii10078 = 1084, s.afii10079 = 1085, s.afii10080 = 1086, s.afii10081 = 1087, s.afii10082 = 1088, s.afii10083 = 1089, s.afii10084 = 1090, s.afii10085 = 1091, s.afii10086 = 1092, s.afii10087 = 1093, s.afii10088 = 1094, s.afii10089 = 1095, s.afii10090 = 1096, s.afii10091 = 1097, s.afii10092 = 1098, s.afii10093 = 1099, s.afii10094 = 1100, s.afii10095 = 1101, s.afii10096 = 1102, s.afii10097 = 1103, s.afii10098 = 1169, s.afii10099 = 1106, s.afii10100 = 1107, s.afii10101 = 1108, s.afii10102 = 1109, s.afii10103 = 1110, s.afii10104 = 1111, s.afii10105 = 1112, s.afii10106 = 1113, s.afii10107 = 1114, s.afii10108 = 1115, s.afii10109 = 1116, s.afii10110 = 1118, s.afii10145 = 1039, s.afii10146 = 1122, s.afii10147 = 1138, s.afii10148 = 1140, s.afii10192 = 63174, s.afii10193 = 1119, s.afii10194 = 1123, s.afii10195 = 1139, s.afii10196 = 1141, s.afii10831 = 63175, s.afii10832 = 63176, s.afii10846 = 1241, s.afii299 = 8206, s.afii300 = 8207, s.afii301 = 8205, s.afii57381 = 1642, s.afii57388 = 1548, s.afii57392 = 1632, s.afii57393 = 1633, s.afii57394 = 1634, s.afii57395 = 1635, s.afii57396 = 1636, s.afii57397 = 1637, s.afii57398 = 1638, s.afii57399 = 1639, s.afii57400 = 1640, s.afii57401 = 1641, s.afii57403 = 1563, s.afii57407 = 1567, s.afii57409 = 1569, s.afii57410 = 1570, s.afii57411 = 1571, s.afii57412 = 1572, s.afii57413 = 1573, s.afii57414 = 1574, s.afii57415 = 1575, s.afii57416 = 1576, s.afii57417 = 1577, s.afii57418 = 1578, s.afii57419 = 1579, s.afii57420 = 1580, s.afii57421 = 1581, s.afii57422 = 1582, s.afii57423 = 1583, s.afii57424 = 1584, s.afii57425 = 1585, s.afii57426 = 1586, s.afii57427 = 1587, s.afii57428 = 1588, s.afii57429 = 1589, s.afii57430 = 1590, s.afii57431 = 1591, s.afii57432 = 1592, s.afii57433 = 1593, s.afii57434 = 1594, s.afii57440 = 1600, s.afii57441 = 1601, s.afii57442 = 1602, s.afii57443 = 1603, s.afii57444 = 1604, s.afii57445 = 1605, s.afii57446 = 1606, s.afii57448 = 1608, s.afii57449 = 1609, s.afii57450 = 1610, s.afii57451 = 1611, s.afii57452 = 1612, s.afii57453 = 1613, s.afii57454 = 1614, s.afii57455 = 1615, s.afii57456 = 1616, s.afii57457 = 1617, s.afii57458 = 1618, s.afii57470 = 1607, s.afii57505 = 1700, s.afii57506 = 1662, s.afii57507 = 1670, s.afii57508 = 1688, s.afii57509 = 1711, s.afii57511 = 1657, s.afii57512 = 1672, s.afii57513 = 1681, s.afii57514 = 1722, s.afii57519 = 1746, s.afii57534 = 1749, s.afii57636 = 8362, s.afii57645 = 1470, s.afii57658 = 1475, s.afii57664 = 1488, s.afii57665 = 1489, s.afii57666 = 1490, s.afii57667 = 1491, s.afii57668 = 1492, s.afii57669 = 1493, s.afii57670 = 1494, s.afii57671 = 1495, s.afii57672 = 1496, s.afii57673 = 1497, s.afii57674 = 1498, s.afii57675 = 1499, s.afii57676 = 1500, s.afii57677 = 1501, s.afii57678 = 1502, s.afii57679 = 1503, s.afii57680 = 1504, s.afii57681 = 1505, s.afii57682 = 1506, s.afii57683 = 1507, s.afii57684 = 1508, s.afii57685 = 1509, s.afii57686 = 1510, s.afii57687 = 1511, s.afii57688 = 1512, s.afii57689 = 1513, s.afii57690 = 1514, s.afii57694 = 64298, s.afii57695 = 64299, s.afii57700 = 64331, s.afii57705 = 64287, s.afii57716 = 1520, s.afii57717 = 1521, s.afii57718 = 1522, s.afii57723 = 64309, s.afii57793 = 1460, s.afii57794 = 1461, s.afii57795 = 1462, s.afii57796 = 1467, s.afii57797 = 1464, s.afii57798 = 1463, s.afii57799 = 1456, s.afii57800 = 1458, s.afii57801 = 1457, s.afii57802 = 1459, s.afii57803 = 1474, s.afii57804 = 1473, s.afii57806 = 1465, s.afii57807 = 1468, s.afii57839 = 1469, s.afii57841 = 1471, s.afii57842 = 1472, s.afii57929 = 700, s.afii61248 = 8453, s.afii61289 = 8467, s.afii61352 = 8470, s.afii61573 = 8236, s.afii61574 = 8237, s.afii61575 = 8238, s.afii61664 = 8204, s.afii63167 = 1645, s.afii64937 = 701, s.agrave = 224, s.agujarati = 2693, s.agurmukhi = 2565, s.ahiragana = 12354, s.ahookabove = 7843, s.aibengali = 2448, s.aibopomofo = 12574, s.aideva = 2320, s.aiecyrillic = 1237, s.aigujarati = 2704, s.aigurmukhi = 2576, s.aimatragurmukhi = 2632, s.ainarabic = 1593, s.ainfinalarabic = 65226, s.aininitialarabic = 65227, s.ainmedialarabic = 65228, s.ainvertedbreve = 515, s.aivowelsignbengali = 2504, s.aivowelsigndeva = 2376, s.aivowelsigngujarati = 2760, s.akatakana = 12450, s.akatakanahalfwidth = 65393, s.akorean = 12623, s.alef = 1488, s.alefarabic = 1575, s.alefdageshhebrew = 64304, s.aleffinalarabic = 65166, s.alefhamzaabovearabic = 1571, s.alefhamzaabovefinalarabic = 65156, s.alefhamzabelowarabic = 1573, s.alefhamzabelowfinalarabic = 65160, s.alefhebrew = 1488, s.aleflamedhebrew = 64335, s.alefmaddaabovearabic = 1570, s.alefmaddaabovefinalarabic = 65154, s.alefmaksuraarabic = 1609, s.alefmaksurafinalarabic = 65264, s.alefmaksurainitialarabic = 65267, s.alefmaksuramedialarabic = 65268, s.alefpatahhebrew = 64302, s.alefqamatshebrew = 64303, s.aleph = 8501, s.allequal = 8780, s.alpha = 945, s.alphatonos = 940, s.amacron = 257, s.amonospace = 65345, s.ampersand = 38, s.ampersandmonospace = 65286, s.ampersandsmall = 63270, s.amsquare = 13250, s.anbopomofo = 12578, s.angbopomofo = 12580, s.angbracketleft = 12296, s.angbracketright = 12297, s.angkhankhuthai = 3674, s.angle = 8736, s.anglebracketleft = 12296, s.anglebracketleftvertical = 65087, s.anglebracketright = 12297, s.anglebracketrightvertical = 65088, s.angleleft = 9001, s.angleright = 9002, s.angstrom = 8491, s.anoteleia = 903, s.anudattadeva = 2386, s.anusvarabengali = 2434, s.anusvaradeva = 2306, s.anusvaragujarati = 2690, s.aogonek = 261, s.apaatosquare = 13056, s.aparen = 9372, s.apostrophearmenian = 1370, s.apostrophemod = 700, s.apple = 63743, s.approaches = 8784, s.approxequal = 8776, s.approxequalorimage = 8786, s.approximatelyequal = 8773, s.araeaekorean = 12686, s.araeakorean = 12685, s.arc = 8978, s.arighthalfring = 7834, s.aring = 229, s.aringacute = 507, s.aringbelow = 7681, s.arrowboth = 8596, s.arrowdashdown = 8675, s.arrowdashleft = 8672, s.arrowdashright = 8674, s.arrowdashup = 8673, s.arrowdblboth = 8660, s.arrowdbldown = 8659, s.arrowdblleft = 8656, s.arrowdblright = 8658, s.arrowdblup = 8657, s.arrowdown = 8595, s.arrowdownleft = 8601, s.arrowdownright = 8600, s.arrowdownwhite = 8681, s.arrowheaddownmod = 709, s.arrowheadleftmod = 706, s.arrowheadrightmod = 707, s.arrowheadupmod = 708, s.arrowhorizex = 63719, s.arrowleft = 8592, s.arrowleftdbl = 8656, s.arrowleftdblstroke = 8653, s.arrowleftoverright = 8646, s.arrowleftwhite = 8678, s.arrowright = 8594, s.arrowrightdblstroke = 8655, s.arrowrightheavy = 10142, s.arrowrightoverleft = 8644, s.arrowrightwhite = 8680, s.arrowtableft = 8676, s.arrowtabright = 8677, s.arrowup = 8593, s.arrowupdn = 8597, s.arrowupdnbse = 8616, s.arrowupdownbase = 8616, s.arrowupleft = 8598, s.arrowupleftofdown = 8645, s.arrowupright = 8599, s.arrowupwhite = 8679, s.arrowvertex = 63718, s.asciicircum = 94, s.asciicircummonospace = 65342, s.asciitilde = 126, s.asciitildemonospace = 65374, s.ascript = 593, s.ascriptturned = 594, s.asmallhiragana = 12353, s.asmallkatakana = 12449, s.asmallkatakanahalfwidth = 65383, s.asterisk = 42, s.asteriskaltonearabic = 1645, s.asteriskarabic = 1645, s.asteriskmath = 8727, s.asteriskmonospace = 65290, s.asterisksmall = 65121, s.asterism = 8258, s.asuperior = 63209, s.asymptoticallyequal = 8771, s.at = 64, s.atilde = 227, s.atmonospace = 65312, s.atsmall = 65131, s.aturned = 592, s.aubengali = 2452, s.aubopomofo = 12576, s.audeva = 2324, s.augujarati = 2708, s.augurmukhi = 2580, s.aulengthmarkbengali = 2519, s.aumatragurmukhi = 2636, s.auvowelsignbengali = 2508, s.auvowelsigndeva = 2380, s.auvowelsigngujarati = 2764, s.avagrahadeva = 2365, s.aybarmenian = 1377, s.ayin = 1506, s.ayinaltonehebrew = 64288, s.ayinhebrew = 1506, s.b = 98, s.babengali = 2476, s.backslash = 92, s.backslashmonospace = 65340, s.badeva = 2348, s.bagujarati = 2732, s.bagurmukhi = 2604, s.bahiragana = 12400, s.bahtthai = 3647, s.bakatakana = 12496, s.bar = 124, s.barmonospace = 65372, s.bbopomofo = 12549, s.bcircle = 9425, s.bdotaccent = 7683, s.bdotbelow = 7685, s.beamedsixteenthnotes = 9836, s.because = 8757, s.becyrillic = 1073, s.beharabic = 1576, s.behfinalarabic = 65168, s.behinitialarabic = 65169, s.behiragana = 12409, s.behmedialarabic = 65170, s.behmeeminitialarabic = 64671, s.behmeemisolatedarabic = 64520, s.behnoonfinalarabic = 64621, s.bekatakana = 12505, s.benarmenian = 1378, s.bet = 1489, s.beta = 946, s.betasymbolgreek = 976, s.betdagesh = 64305, s.betdageshhebrew = 64305, s.bethebrew = 1489, s.betrafehebrew = 64332, s.bhabengali = 2477, s.bhadeva = 2349, s.bhagujarati = 2733, s.bhagurmukhi = 2605, s.bhook = 595, s.bihiragana = 12403, s.bikatakana = 12499, s.bilabialclick = 664, s.bindigurmukhi = 2562, s.birusquare = 13105, s.blackcircle = 9679, s.blackdiamond = 9670, s.blackdownpointingtriangle = 9660, s.blackleftpointingpointer = 9668, s.blackleftpointingtriangle = 9664, s.blacklenticularbracketleft = 12304, s.blacklenticularbracketleftvertical = 65083, s.blacklenticularbracketright = 12305, s.blacklenticularbracketrightvertical = 65084, s.blacklowerlefttriangle = 9699, s.blacklowerrighttriangle = 9698, s.blackrectangle = 9644, s.blackrightpointingpointer = 9658, s.blackrightpointingtriangle = 9654, s.blacksmallsquare = 9642, s.blacksmilingface = 9787, s.blacksquare = 9632, s.blackstar = 9733, s.blackupperlefttriangle = 9700, s.blackupperrighttriangle = 9701, s.blackuppointingsmalltriangle = 9652, s.blackuppointingtriangle = 9650, s.blank = 9251, s.blinebelow = 7687, s.block = 9608, s.bmonospace = 65346, s.bobaimaithai = 3610, s.bohiragana = 12412, s.bokatakana = 12508, s.bparen = 9373, s.bqsquare = 13251, s.braceex = 63732, s.braceleft = 123, s.braceleftbt = 63731, s.braceleftmid = 63730, s.braceleftmonospace = 65371, s.braceleftsmall = 65115, s.bracelefttp = 63729, s.braceleftvertical = 65079, s.braceright = 125, s.bracerightbt = 63742, s.bracerightmid = 63741, s.bracerightmonospace = 65373, s.bracerightsmall = 65116, s.bracerighttp = 63740, s.bracerightvertical = 65080, s.bracketleft = 91, s.bracketleftbt = 63728, s.bracketleftex = 63727, s.bracketleftmonospace = 65339, s.bracketlefttp = 63726, s.bracketright = 93, s.bracketrightbt = 63739, s.bracketrightex = 63738, s.bracketrightmonospace = 65341, s.bracketrighttp = 63737, s.breve = 728, s.brevebelowcmb = 814, s.brevecmb = 774, s.breveinvertedbelowcmb = 815, s.breveinvertedcmb = 785, s.breveinverteddoublecmb = 865, s.bridgebelowcmb = 810, s.bridgeinvertedbelowcmb = 826, s.brokenbar = 166, s.bstroke = 384, s.bsuperior = 63210, s.btopbar = 387, s.buhiragana = 12406, s.bukatakana = 12502, s.bullet = 8226, s.bulletinverse = 9688, s.bulletoperator = 8729, s.bullseye = 9678, s.c = 99, s.caarmenian = 1390, s.cabengali = 2458, s.cacute = 263, s.cadeva = 2330, s.cagujarati = 2714, s.cagurmukhi = 2586, s.calsquare = 13192, s.candrabindubengali = 2433, s.candrabinducmb = 784, s.candrabindudeva = 2305, s.candrabindugujarati = 2689, s.capslock = 8682, s.careof = 8453, s.caron = 711, s.caronbelowcmb = 812, s.caroncmb = 780, s.carriagereturn = 8629, s.cbopomofo = 12568, s.ccaron = 269, s.ccedilla = 231, s.ccedillaacute = 7689, s.ccircle = 9426, s.ccircumflex = 265, s.ccurl = 597, s.cdot = 267, s.cdotaccent = 267, s.cdsquare = 13253, s.cedilla = 184, s.cedillacmb = 807, s.cent = 162, s.centigrade = 8451, s.centinferior = 63199, s.centmonospace = 65504, s.centoldstyle = 63394, s.centsuperior = 63200, s.chaarmenian = 1401, s.chabengali = 2459, s.chadeva = 2331, s.chagujarati = 2715, s.chagurmukhi = 2587, s.chbopomofo = 12564, s.cheabkhasiancyrillic = 1213, s.checkmark = 10003, s.checyrillic = 1095, s.chedescenderabkhasiancyrillic = 1215, s.chedescendercyrillic = 1207, s.chedieresiscyrillic = 1269, s.cheharmenian = 1395, s.chekhakassiancyrillic = 1228, s.cheverticalstrokecyrillic = 1209, s.chi = 967, s.chieuchacirclekorean = 12919, s.chieuchaparenkorean = 12823, s.chieuchcirclekorean = 12905, s.chieuchkorean = 12618, s.chieuchparenkorean = 12809, s.chochangthai = 3594, s.chochanthai = 3592, s.chochingthai = 3593, s.chochoethai = 3596, s.chook = 392, s.cieucacirclekorean = 12918, s.cieucaparenkorean = 12822, s.cieuccirclekorean = 12904, s.cieuckorean = 12616, s.cieucparenkorean = 12808, s.cieucuparenkorean = 12828, s.circle = 9675, s.circlecopyrt = 169, s.circlemultiply = 8855, s.circleot = 8857, s.circleplus = 8853, s.circlepostalmark = 12342, s.circlewithlefthalfblack = 9680, s.circlewithrighthalfblack = 9681, s.circumflex = 710, s.circumflexbelowcmb = 813, s.circumflexcmb = 770, s.clear = 8999, s.clickalveolar = 450, s.clickdental = 448, s.clicklateral = 449, s.clickretroflex = 451, s.club = 9827, s.clubsuitblack = 9827, s.clubsuitwhite = 9831, s.cmcubedsquare = 13220, s.cmonospace = 65347, s.cmsquaredsquare = 13216, s.coarmenian = 1409, s.colon = 58, s.colonmonetary = 8353, s.colonmonospace = 65306, s.colonsign = 8353, s.colonsmall = 65109, s.colontriangularhalfmod = 721, s.colontriangularmod = 720, s.comma = 44, s.commaabovecmb = 787, s.commaaboverightcmb = 789, s.commaaccent = 63171, s.commaarabic = 1548, s.commaarmenian = 1373, s.commainferior = 63201, s.commamonospace = 65292, s.commareversedabovecmb = 788, s.commareversedmod = 701, s.commasmall = 65104, s.commasuperior = 63202, s.commaturnedabovecmb = 786, s.commaturnedmod = 699, s.compass = 9788, s.congruent = 8773, s.contourintegral = 8750, s.control = 8963, s.controlACK = 6, s.controlBEL = 7, s.controlBS = 8, s.controlCAN = 24, s.controlCR = 13, s.controlDC1 = 17, s.controlDC2 = 18, s.controlDC3 = 19, s.controlDC4 = 20, s.controlDEL = 127, s.controlDLE = 16, s.controlEM = 25, s.controlENQ = 5, s.controlEOT = 4, s.controlESC = 27, s.controlETB = 23, s.controlETX = 3, s.controlFF = 12, s.controlFS = 28, s.controlGS = 29, s.controlHT = 9, s.controlLF = 10, s.controlNAK = 21, s.controlNULL = 0, s.controlRS = 30, s.controlSI = 15, s.controlSO = 14, s.controlSOT = 2, s.controlSTX = 1, s.controlSUB = 26, s.controlSYN = 22, s.controlUS = 31, s.controlVT = 11, s.copyright = 169, s.copyrightsans = 63721, s.copyrightserif = 63193, s.cornerbracketleft = 12300, s.cornerbracketlefthalfwidth = 65378, s.cornerbracketleftvertical = 65089, s.cornerbracketright = 12301, s.cornerbracketrighthalfwidth = 65379, s.cornerbracketrightvertical = 65090, s.corporationsquare = 13183, s.cosquare = 13255, s.coverkgsquare = 13254, s.cparen = 9374, s.cruzeiro = 8354, s.cstretched = 663, s.curlyand = 8911, s.curlyor = 8910, s.currency = 164, s.cyrBreve = 63185, s.cyrFlex = 63186, s.cyrbreve = 63188, s.cyrflex = 63189, s.d = 100, s.daarmenian = 1380, s.dabengali = 2470, s.dadarabic = 1590, s.dadeva = 2342, s.dadfinalarabic = 65214, s.dadinitialarabic = 65215, s.dadmedialarabic = 65216, s.dagesh = 1468, s.dageshhebrew = 1468, s.dagger = 8224, s.daggerdbl = 8225, s.dagujarati = 2726, s.dagurmukhi = 2598, s.dahiragana = 12384, s.dakatakana = 12480, s.dalarabic = 1583, s.dalet = 1491, s.daletdagesh = 64307, s.daletdageshhebrew = 64307, s.dalethebrew = 1491, s.dalfinalarabic = 65194, s.dammaarabic = 1615, s.dammalowarabic = 1615, s.dammatanaltonearabic = 1612, s.dammatanarabic = 1612, s.danda = 2404, s.dargahebrew = 1447, s.dargalefthebrew = 1447, s.dasiapneumatacyrilliccmb = 1157, s.dblGrave = 63187, s.dblanglebracketleft = 12298, s.dblanglebracketleftvertical = 65085, s.dblanglebracketright = 12299, s.dblanglebracketrightvertical = 65086, s.dblarchinvertedbelowcmb = 811, s.dblarrowleft = 8660, s.dblarrowright = 8658, s.dbldanda = 2405, s.dblgrave = 63190, s.dblgravecmb = 783, s.dblintegral = 8748, s.dbllowline = 8215, s.dbllowlinecmb = 819, s.dbloverlinecmb = 831, s.dblprimemod = 698, s.dblverticalbar = 8214, s.dblverticallineabovecmb = 782, s.dbopomofo = 12553, s.dbsquare = 13256, s.dcaron = 271, s.dcedilla = 7697, s.dcircle = 9427, s.dcircumflexbelow = 7699, s.dcroat = 273, s.ddabengali = 2465, s.ddadeva = 2337, s.ddagujarati = 2721, s.ddagurmukhi = 2593, s.ddalarabic = 1672, s.ddalfinalarabic = 64393, s.dddhadeva = 2396, s.ddhabengali = 2466, s.ddhadeva = 2338, s.ddhagujarati = 2722, s.ddhagurmukhi = 2594, s.ddotaccent = 7691, s.ddotbelow = 7693, s.decimalseparatorarabic = 1643, s.decimalseparatorpersian = 1643, s.decyrillic = 1076, s.degree = 176, s.dehihebrew = 1453, s.dehiragana = 12391, s.deicoptic = 1007, s.dekatakana = 12487, s.deleteleft = 9003, s.deleteright = 8998, s.delta = 948, s.deltaturned = 397, s.denominatorminusonenumeratorbengali = 2552, s.dezh = 676, s.dhabengali = 2471, s.dhadeva = 2343, s.dhagujarati = 2727, s.dhagurmukhi = 2599, s.dhook = 599, s.dialytikatonos = 901, s.dialytikatonoscmb = 836, s.diamond = 9830, s.diamondsuitwhite = 9826, s.dieresis = 168, s.dieresisacute = 63191, s.dieresisbelowcmb = 804, s.dieresiscmb = 776, s.dieresisgrave = 63192, s.dieresistonos = 901, s.dihiragana = 12386, s.dikatakana = 12482, s.dittomark = 12291, s.divide = 247, s.divides = 8739, s.divisionslash = 8725, s.djecyrillic = 1106, s.dkshade = 9619, s.dlinebelow = 7695, s.dlsquare = 13207, s.dmacron = 273, s.dmonospace = 65348, s.dnblock = 9604, s.dochadathai = 3598, s.dodekthai = 3604, s.dohiragana = 12393, s.dokatakana = 12489, s.dollar = 36, s.dollarinferior = 63203, s.dollarmonospace = 65284, s.dollaroldstyle = 63268, s.dollarsmall = 65129, s.dollarsuperior = 63204, s.dong = 8363, s.dorusquare = 13094, s.dotaccent = 729, s.dotaccentcmb = 775, s.dotbelowcmb = 803, s.dotbelowcomb = 803, s.dotkatakana = 12539, s.dotlessi = 305, s.dotlessj = 63166, s.dotlessjstrokehook = 644, s.dotmath = 8901, s.dottedcircle = 9676, s.doubleyodpatah = 64287, s.doubleyodpatahhebrew = 64287, s.downtackbelowcmb = 798, s.downtackmod = 725, s.dparen = 9375, s.dsuperior = 63211, s.dtail = 598, s.dtopbar = 396, s.duhiragana = 12389, s.dukatakana = 12485, s.dz = 499, s.dzaltone = 675, s.dzcaron = 454, s.dzcurl = 677, s.dzeabkhasiancyrillic = 1249, s.dzecyrillic = 1109, s.dzhecyrillic = 1119, s.e = 101, s.eacute = 233, s.earth = 9793, s.ebengali = 2447, s.ebopomofo = 12572, s.ebreve = 277, s.ecandradeva = 2317, s.ecandragujarati = 2701, s.ecandravowelsigndeva = 2373, s.ecandravowelsigngujarati = 2757, s.ecaron = 283, s.ecedillabreve = 7709, s.echarmenian = 1381, s.echyiwnarmenian = 1415, s.ecircle = 9428, s.ecircumflex = 234, s.ecircumflexacute = 7871, s.ecircumflexbelow = 7705, s.ecircumflexdotbelow = 7879, s.ecircumflexgrave = 7873, s.ecircumflexhookabove = 7875, s.ecircumflextilde = 7877, s.ecyrillic = 1108, s.edblgrave = 517, s.edeva = 2319, s.edieresis = 235, s.edot = 279, s.edotaccent = 279, s.edotbelow = 7865, s.eegurmukhi = 2575, s.eematragurmukhi = 2631, s.efcyrillic = 1092, s.egrave = 232, s.egujarati = 2703, s.eharmenian = 1383, s.ehbopomofo = 12573, s.ehiragana = 12360, s.ehookabove = 7867, s.eibopomofo = 12575, s.eight = 56, s.eightarabic = 1640, s.eightbengali = 2542, s.eightcircle = 9319, s.eightcircleinversesansserif = 10129, s.eightdeva = 2414, s.eighteencircle = 9329, s.eighteenparen = 9349, s.eighteenperiod = 9369, s.eightgujarati = 2798, s.eightgurmukhi = 2670, s.eighthackarabic = 1640, s.eighthangzhou = 12328, s.eighthnotebeamed = 9835, s.eightideographicparen = 12839, s.eightinferior = 8328, s.eightmonospace = 65304, s.eightoldstyle = 63288, s.eightparen = 9339, s.eightperiod = 9359, s.eightpersian = 1784, s.eightroman = 8567, s.eightsuperior = 8312, s.eightthai = 3672, s.einvertedbreve = 519, s.eiotifiedcyrillic = 1125, s.ekatakana = 12456, s.ekatakanahalfwidth = 65396, s.ekonkargurmukhi = 2676, s.ekorean = 12628, s.elcyrillic = 1083, s.element = 8712, s.elevencircle = 9322, s.elevenparen = 9342, s.elevenperiod = 9362, s.elevenroman = 8570, s.ellipsis = 8230, s.ellipsisvertical = 8942, s.emacron = 275, s.emacronacute = 7703, s.emacrongrave = 7701, s.emcyrillic = 1084, s.emdash = 8212, s.emdashvertical = 65073, s.emonospace = 65349, s.emphasismarkarmenian = 1371, s.emptyset = 8709, s.enbopomofo = 12579, s.encyrillic = 1085, s.endash = 8211, s.endashvertical = 65074, s.endescendercyrillic = 1187, s.eng = 331, s.engbopomofo = 12581, s.enghecyrillic = 1189, s.enhookcyrillic = 1224, s.enspace = 8194, s.eogonek = 281, s.eokorean = 12627, s.eopen = 603, s.eopenclosed = 666, s.eopenreversed = 604, s.eopenreversedclosed = 606, s.eopenreversedhook = 605, s.eparen = 9376, s.epsilon = 949, s.epsilontonos = 941, s.equal = 61, s.equalmonospace = 65309, s.equalsmall = 65126, s.equalsuperior = 8316, s.equivalence = 8801, s.erbopomofo = 12582, s.ercyrillic = 1088, s.ereversed = 600, s.ereversedcyrillic = 1101, s.escyrillic = 1089, s.esdescendercyrillic = 1195, s.esh = 643, s.eshcurl = 646, s.eshortdeva = 2318, s.eshortvowelsigndeva = 2374, s.eshreversedloop = 426, s.eshsquatreversed = 645, s.esmallhiragana = 12359, s.esmallkatakana = 12455, s.esmallkatakanahalfwidth = 65386, s.estimated = 8494, s.esuperior = 63212, s.eta = 951, s.etarmenian = 1384, s.etatonos = 942, s.eth = 240, s.etilde = 7869, s.etildebelow = 7707, s.etnahtafoukhhebrew = 1425, s.etnahtafoukhlefthebrew = 1425, s.etnahtahebrew = 1425, s.etnahtalefthebrew = 1425, s.eturned = 477, s.eukorean = 12641, s.euro = 8364, s.evowelsignbengali = 2503, s.evowelsigndeva = 2375, s.evowelsigngujarati = 2759, s.exclam = 33, s.exclamarmenian = 1372, s.exclamdbl = 8252, s.exclamdown = 161, s.exclamdownsmall = 63393, s.exclammonospace = 65281, s.exclamsmall = 63265, s.existential = 8707, s.ezh = 658, s.ezhcaron = 495, s.ezhcurl = 659, s.ezhreversed = 441, s.ezhtail = 442, s.f = 102, s.fadeva = 2398, s.fagurmukhi = 2654, s.fahrenheit = 8457, s.fathaarabic = 1614, s.fathalowarabic = 1614, s.fathatanarabic = 1611, s.fbopomofo = 12552, s.fcircle = 9429, s.fdotaccent = 7711, s.feharabic = 1601, s.feharmenian = 1414, s.fehfinalarabic = 65234, s.fehinitialarabic = 65235, s.fehmedialarabic = 65236, s.feicoptic = 997, s.female = 9792, s.ff = 64256, s.f_f = 64256, s.ffi = 64259, s.f_f_i = 64259, s.ffl = 64260, s.f_f_l = 64260, s.fi = 64257, s.f_i = 64257, s.fifteencircle = 9326, s.fifteenparen = 9346, s.fifteenperiod = 9366, s.figuredash = 8210, s.filledbox = 9632, s.filledrect = 9644, s.finalkaf = 1498, s.finalkafdagesh = 64314, s.finalkafdageshhebrew = 64314, s.finalkafhebrew = 1498, s.finalmem = 1501, s.finalmemhebrew = 1501, s.finalnun = 1503, s.finalnunhebrew = 1503, s.finalpe = 1507, s.finalpehebrew = 1507, s.finaltsadi = 1509, s.finaltsadihebrew = 1509, s.firsttonechinese = 713, s.fisheye = 9673, s.fitacyrillic = 1139, s.five = 53, s.fivearabic = 1637, s.fivebengali = 2539, s.fivecircle = 9316, s.fivecircleinversesansserif = 10126, s.fivedeva = 2411, s.fiveeighths = 8541, s.fivegujarati = 2795, s.fivegurmukhi = 2667, s.fivehackarabic = 1637, s.fivehangzhou = 12325, s.fiveideographicparen = 12836, s.fiveinferior = 8325, s.fivemonospace = 65301, s.fiveoldstyle = 63285, s.fiveparen = 9336, s.fiveperiod = 9356, s.fivepersian = 1781, s.fiveroman = 8564, s.fivesuperior = 8309, s.fivethai = 3669, s.fl = 64258, s.f_l = 64258, s.florin = 402, s.fmonospace = 65350, s.fmsquare = 13209, s.fofanthai = 3615, s.fofathai = 3613, s.fongmanthai = 3663, s.forall = 8704, s.four = 52, s.fourarabic = 1636, s.fourbengali = 2538, s.fourcircle = 9315, s.fourcircleinversesansserif = 10125, s.fourdeva = 2410, s.fourgujarati = 2794, s.fourgurmukhi = 2666, s.fourhackarabic = 1636, s.fourhangzhou = 12324, s.fourideographicparen = 12835, s.fourinferior = 8324, s.fourmonospace = 65300, s.fournumeratorbengali = 2551, s.fouroldstyle = 63284, s.fourparen = 9335, s.fourperiod = 9355, s.fourpersian = 1780, s.fourroman = 8563, s.foursuperior = 8308, s.fourteencircle = 9325, s.fourteenparen = 9345, s.fourteenperiod = 9365, s.fourthai = 3668, s.fourthtonechinese = 715, s.fparen = 9377, s.fraction = 8260, s.franc = 8355, s.g = 103, s.gabengali = 2455, s.gacute = 501, s.gadeva = 2327, s.gafarabic = 1711, s.gaffinalarabic = 64403, s.gafinitialarabic = 64404, s.gafmedialarabic = 64405, s.gagujarati = 2711, s.gagurmukhi = 2583, s.gahiragana = 12364, s.gakatakana = 12460, s.gamma = 947, s.gammalatinsmall = 611, s.gammasuperior = 736, s.gangiacoptic = 1003, s.gbopomofo = 12557, s.gbreve = 287, s.gcaron = 487, s.gcedilla = 291, s.gcircle = 9430, s.gcircumflex = 285, s.gcommaaccent = 291, s.gdot = 289, s.gdotaccent = 289, s.gecyrillic = 1075, s.gehiragana = 12370, s.gekatakana = 12466, s.geometricallyequal = 8785, s.gereshaccenthebrew = 1436, s.gereshhebrew = 1523, s.gereshmuqdamhebrew = 1437, s.germandbls = 223, s.gershayimaccenthebrew = 1438, s.gershayimhebrew = 1524, s.getamark = 12307, s.ghabengali = 2456, s.ghadarmenian = 1394, s.ghadeva = 2328, s.ghagujarati = 2712, s.ghagurmukhi = 2584, s.ghainarabic = 1594, s.ghainfinalarabic = 65230, s.ghaininitialarabic = 65231, s.ghainmedialarabic = 65232, s.ghemiddlehookcyrillic = 1173, s.ghestrokecyrillic = 1171, s.gheupturncyrillic = 1169, s.ghhadeva = 2394, s.ghhagurmukhi = 2650, s.ghook = 608, s.ghzsquare = 13203, s.gihiragana = 12366, s.gikatakana = 12462, s.gimarmenian = 1379, s.gimel = 1490, s.gimeldagesh = 64306, s.gimeldageshhebrew = 64306, s.gimelhebrew = 1490, s.gjecyrillic = 1107, s.glottalinvertedstroke = 446, s.glottalstop = 660, s.glottalstopinverted = 662, s.glottalstopmod = 704, s.glottalstopreversed = 661, s.glottalstopreversedmod = 705, s.glottalstopreversedsuperior = 740, s.glottalstopstroke = 673, s.glottalstopstrokereversed = 674, s.gmacron = 7713, s.gmonospace = 65351, s.gohiragana = 12372, s.gokatakana = 12468, s.gparen = 9378, s.gpasquare = 13228, s.gradient = 8711, s.grave = 96, s.gravebelowcmb = 790, s.gravecmb = 768, s.gravecomb = 768, s.gravedeva = 2387, s.gravelowmod = 718, s.gravemonospace = 65344, s.gravetonecmb = 832, s.greater = 62, s.greaterequal = 8805, s.greaterequalorless = 8923, s.greatermonospace = 65310, s.greaterorequivalent = 8819, s.greaterorless = 8823, s.greateroverequal = 8807, s.greatersmall = 65125, s.gscript = 609, s.gstroke = 485, s.guhiragana = 12368, s.guillemotleft = 171, s.guillemotright = 187, s.guilsinglleft = 8249, s.guilsinglright = 8250, s.gukatakana = 12464, s.guramusquare = 13080, s.gysquare = 13257, s.h = 104, s.haabkhasiancyrillic = 1193, s.haaltonearabic = 1729, s.habengali = 2489, s.hadescendercyrillic = 1203, s.hadeva = 2361, s.hagujarati = 2745, s.hagurmukhi = 2617, s.haharabic = 1581, s.hahfinalarabic = 65186, s.hahinitialarabic = 65187, s.hahiragana = 12399, s.hahmedialarabic = 65188, s.haitusquare = 13098, s.hakatakana = 12495, s.hakatakanahalfwidth = 65418, s.halantgurmukhi = 2637, s.hamzaarabic = 1569, s.hamzalowarabic = 1569, s.hangulfiller = 12644, s.hardsigncyrillic = 1098, s.harpoonleftbarbup = 8636, s.harpoonrightbarbup = 8640, s.hasquare = 13258, s.hatafpatah = 1458, s.hatafpatah16 = 1458, s.hatafpatah23 = 1458, s.hatafpatah2f = 1458, s.hatafpatahhebrew = 1458, s.hatafpatahnarrowhebrew = 1458, s.hatafpatahquarterhebrew = 1458, s.hatafpatahwidehebrew = 1458, s.hatafqamats = 1459, s.hatafqamats1b = 1459, s.hatafqamats28 = 1459, s.hatafqamats34 = 1459, s.hatafqamatshebrew = 1459, s.hatafqamatsnarrowhebrew = 1459, s.hatafqamatsquarterhebrew = 1459, s.hatafqamatswidehebrew = 1459, s.hatafsegol = 1457, s.hatafsegol17 = 1457, s.hatafsegol24 = 1457, s.hatafsegol30 = 1457, s.hatafsegolhebrew = 1457, s.hatafsegolnarrowhebrew = 1457, s.hatafsegolquarterhebrew = 1457, s.hatafsegolwidehebrew = 1457, s.hbar = 295, s.hbopomofo = 12559, s.hbrevebelow = 7723, s.hcedilla = 7721, s.hcircle = 9431, s.hcircumflex = 293, s.hdieresis = 7719, s.hdotaccent = 7715, s.hdotbelow = 7717, s.he = 1492, s.heart = 9829, s.heartsuitblack = 9829, s.heartsuitwhite = 9825, s.hedagesh = 64308, s.hedageshhebrew = 64308, s.hehaltonearabic = 1729, s.heharabic = 1607, s.hehebrew = 1492, s.hehfinalaltonearabic = 64423, s.hehfinalalttwoarabic = 65258, s.hehfinalarabic = 65258, s.hehhamzaabovefinalarabic = 64421, s.hehhamzaaboveisolatedarabic = 64420, s.hehinitialaltonearabic = 64424, s.hehinitialarabic = 65259, s.hehiragana = 12408, s.hehmedialaltonearabic = 64425, s.hehmedialarabic = 65260, s.heiseierasquare = 13179, s.hekatakana = 12504, s.hekatakanahalfwidth = 65421, s.hekutaarusquare = 13110, s.henghook = 615, s.herutusquare = 13113, s.het = 1495, s.hethebrew = 1495, s.hhook = 614, s.hhooksuperior = 689, s.hieuhacirclekorean = 12923, s.hieuhaparenkorean = 12827, s.hieuhcirclekorean = 12909, s.hieuhkorean = 12622, s.hieuhparenkorean = 12813, s.hihiragana = 12402, s.hikatakana = 12498, s.hikatakanahalfwidth = 65419, s.hiriq = 1460, s.hiriq14 = 1460, s.hiriq21 = 1460, s.hiriq2d = 1460, s.hiriqhebrew = 1460, s.hiriqnarrowhebrew = 1460, s.hiriqquarterhebrew = 1460, s.hiriqwidehebrew = 1460, s.hlinebelow = 7830, s.hmonospace = 65352, s.hoarmenian = 1392, s.hohipthai = 3627, s.hohiragana = 12411, s.hokatakana = 12507, s.hokatakanahalfwidth = 65422, s.holam = 1465, s.holam19 = 1465, s.holam26 = 1465, s.holam32 = 1465, s.holamhebrew = 1465, s.holamnarrowhebrew = 1465, s.holamquarterhebrew = 1465, s.holamwidehebrew = 1465, s.honokhukthai = 3630, s.hookabovecomb = 777, s.hookcmb = 777, s.hookpalatalizedbelowcmb = 801, s.hookretroflexbelowcmb = 802, s.hoonsquare = 13122, s.horicoptic = 1001, s.horizontalbar = 8213, s.horncmb = 795, s.hotsprings = 9832, s.house = 8962, s.hparen = 9379, s.hsuperior = 688, s.hturned = 613, s.huhiragana = 12405, s.huiitosquare = 13107, s.hukatakana = 12501, s.hukatakanahalfwidth = 65420, s.hungarumlaut = 733, s.hungarumlautcmb = 779, s.hv = 405, s.hyphen = 45, s.hypheninferior = 63205, s.hyphenmonospace = 65293, s.hyphensmall = 65123, s.hyphensuperior = 63206, s.hyphentwo = 8208, s.i = 105, s.iacute = 237, s.iacyrillic = 1103, s.ibengali = 2439, s.ibopomofo = 12583, s.ibreve = 301, s.icaron = 464, s.icircle = 9432, s.icircumflex = 238, s.icyrillic = 1110, s.idblgrave = 521, s.ideographearthcircle = 12943, s.ideographfirecircle = 12939, s.ideographicallianceparen = 12863, s.ideographiccallparen = 12858, s.ideographiccentrecircle = 12965, s.ideographicclose = 12294, s.ideographiccomma = 12289, s.ideographiccommaleft = 65380, s.ideographiccongratulationparen = 12855, s.ideographiccorrectcircle = 12963, s.ideographicearthparen = 12847, s.ideographicenterpriseparen = 12861, s.ideographicexcellentcircle = 12957, s.ideographicfestivalparen = 12864, s.ideographicfinancialcircle = 12950, s.ideographicfinancialparen = 12854, s.ideographicfireparen = 12843, s.ideographichaveparen = 12850, s.ideographichighcircle = 12964, s.ideographiciterationmark = 12293, s.ideographiclaborcircle = 12952, s.ideographiclaborparen = 12856, s.ideographicleftcircle = 12967, s.ideographiclowcircle = 12966, s.ideographicmedicinecircle = 12969, s.ideographicmetalparen = 12846, s.ideographicmoonparen = 12842, s.ideographicnameparen = 12852, s.ideographicperiod = 12290, s.ideographicprintcircle = 12958, s.ideographicreachparen = 12867, s.ideographicrepresentparen = 12857, s.ideographicresourceparen = 12862, s.ideographicrightcircle = 12968, s.ideographicsecretcircle = 12953, s.ideographicselfparen = 12866, s.ideographicsocietyparen = 12851, s.ideographicspace = 12288, s.ideographicspecialparen = 12853, s.ideographicstockparen = 12849, s.ideographicstudyparen = 12859, s.ideographicsunparen = 12848, s.ideographicsuperviseparen = 12860, s.ideographicwaterparen = 12844, s.ideographicwoodparen = 12845, s.ideographiczero = 12295, s.ideographmetalcircle = 12942, s.ideographmooncircle = 12938, s.ideographnamecircle = 12948, s.ideographsuncircle = 12944, s.ideographwatercircle = 12940, s.ideographwoodcircle = 12941, s.ideva = 2311, s.idieresis = 239, s.idieresisacute = 7727, s.idieresiscyrillic = 1253, s.idotbelow = 7883, s.iebrevecyrillic = 1239, s.iecyrillic = 1077, s.ieungacirclekorean = 12917, s.ieungaparenkorean = 12821, s.ieungcirclekorean = 12903, s.ieungkorean = 12615, s.ieungparenkorean = 12807, s.igrave = 236, s.igujarati = 2695, s.igurmukhi = 2567, s.ihiragana = 12356, s.ihookabove = 7881, s.iibengali = 2440, s.iicyrillic = 1080, s.iideva = 2312, s.iigujarati = 2696, s.iigurmukhi = 2568, s.iimatragurmukhi = 2624, s.iinvertedbreve = 523, s.iishortcyrillic = 1081, s.iivowelsignbengali = 2496, s.iivowelsigndeva = 2368, s.iivowelsigngujarati = 2752, s.ij = 307, s.ikatakana = 12452, s.ikatakanahalfwidth = 65394, s.ikorean = 12643, s.ilde = 732, s.iluyhebrew = 1452, s.imacron = 299, s.imacroncyrillic = 1251, s.imageorapproximatelyequal = 8787, s.imatragurmukhi = 2623, s.imonospace = 65353, s.increment = 8710, s.infinity = 8734, s.iniarmenian = 1387, s.integral = 8747, s.integralbottom = 8993, s.integralbt = 8993, s.integralex = 63733, s.integraltop = 8992, s.integraltp = 8992, s.intersection = 8745, s.intisquare = 13061, s.invbullet = 9688, s.invcircle = 9689, s.invsmileface = 9787, s.iocyrillic = 1105, s.iogonek = 303, s.iota = 953, s.iotadieresis = 970, s.iotadieresistonos = 912, s.iotalatin = 617, s.iotatonos = 943, s.iparen = 9380, s.irigurmukhi = 2674, s.ismallhiragana = 12355, s.ismallkatakana = 12451, s.ismallkatakanahalfwidth = 65384, s.issharbengali = 2554, s.istroke = 616, s.isuperior = 63213, s.iterationhiragana = 12445, s.iterationkatakana = 12541, s.itilde = 297, s.itildebelow = 7725, s.iubopomofo = 12585, s.iucyrillic = 1102, s.ivowelsignbengali = 2495, s.ivowelsigndeva = 2367, s.ivowelsigngujarati = 2751, s.izhitsacyrillic = 1141, s.izhitsadblgravecyrillic = 1143, s.j = 106, s.jaarmenian = 1393, s.jabengali = 2460, s.jadeva = 2332, s.jagujarati = 2716, s.jagurmukhi = 2588, s.jbopomofo = 12560, s.jcaron = 496, s.jcircle = 9433, s.jcircumflex = 309, s.jcrossedtail = 669, s.jdotlessstroke = 607, s.jecyrillic = 1112, s.jeemarabic = 1580, s.jeemfinalarabic = 65182, s.jeeminitialarabic = 65183, s.jeemmedialarabic = 65184, s.jeharabic = 1688, s.jehfinalarabic = 64395, s.jhabengali = 2461, s.jhadeva = 2333, s.jhagujarati = 2717, s.jhagurmukhi = 2589, s.jheharmenian = 1403, s.jis = 12292, s.jmonospace = 65354, s.jparen = 9381, s.jsuperior = 690, s.k = 107, s.kabashkircyrillic = 1185, s.kabengali = 2453, s.kacute = 7729, s.kacyrillic = 1082, s.kadescendercyrillic = 1179, s.kadeva = 2325, s.kaf = 1499, s.kafarabic = 1603, s.kafdagesh = 64315, s.kafdageshhebrew = 64315, s.kaffinalarabic = 65242, s.kafhebrew = 1499, s.kafinitialarabic = 65243, s.kafmedialarabic = 65244, s.kafrafehebrew = 64333, s.kagujarati = 2709, s.kagurmukhi = 2581, s.kahiragana = 12363, s.kahookcyrillic = 1220, s.kakatakana = 12459, s.kakatakanahalfwidth = 65398, s.kappa = 954, s.kappasymbolgreek = 1008, s.kapyeounmieumkorean = 12657, s.kapyeounphieuphkorean = 12676, s.kapyeounpieupkorean = 12664, s.kapyeounssangpieupkorean = 12665, s.karoriisquare = 13069, s.kashidaautoarabic = 1600, s.kashidaautonosidebearingarabic = 1600, s.kasmallkatakana = 12533, s.kasquare = 13188, s.kasraarabic = 1616, s.kasratanarabic = 1613, s.kastrokecyrillic = 1183, s.katahiraprolongmarkhalfwidth = 65392, s.kaverticalstrokecyrillic = 1181, s.kbopomofo = 12558, s.kcalsquare = 13193, s.kcaron = 489, s.kcedilla = 311, s.kcircle = 9434, s.kcommaaccent = 311, s.kdotbelow = 7731, s.keharmenian = 1412, s.kehiragana = 12369, s.kekatakana = 12465, s.kekatakanahalfwidth = 65401, s.kenarmenian = 1391, s.kesmallkatakana = 12534, s.kgreenlandic = 312, s.khabengali = 2454, s.khacyrillic = 1093, s.khadeva = 2326, s.khagujarati = 2710, s.khagurmukhi = 2582, s.khaharabic = 1582, s.khahfinalarabic = 65190, s.khahinitialarabic = 65191, s.khahmedialarabic = 65192, s.kheicoptic = 999, s.khhadeva = 2393, s.khhagurmukhi = 2649, s.khieukhacirclekorean = 12920, s.khieukhaparenkorean = 12824, s.khieukhcirclekorean = 12906, s.khieukhkorean = 12619, s.khieukhparenkorean = 12810, s.khokhaithai = 3586, s.khokhonthai = 3589, s.khokhuatthai = 3587, s.khokhwaithai = 3588, s.khomutthai = 3675, s.khook = 409, s.khorakhangthai = 3590, s.khzsquare = 13201, s.kihiragana = 12365, s.kikatakana = 12461, s.kikatakanahalfwidth = 65399, s.kiroguramusquare = 13077, s.kiromeetorusquare = 13078, s.kirosquare = 13076, s.kiyeokacirclekorean = 12910, s.kiyeokaparenkorean = 12814, s.kiyeokcirclekorean = 12896, s.kiyeokkorean = 12593, s.kiyeokparenkorean = 12800, s.kiyeoksioskorean = 12595, s.kjecyrillic = 1116, s.klinebelow = 7733, s.klsquare = 13208, s.kmcubedsquare = 13222, s.kmonospace = 65355, s.kmsquaredsquare = 13218, s.kohiragana = 12371, s.kohmsquare = 13248, s.kokaithai = 3585, s.kokatakana = 12467, s.kokatakanahalfwidth = 65402, s.kooposquare = 13086, s.koppacyrillic = 1153, s.koreanstandardsymbol = 12927, s.koroniscmb = 835, s.kparen = 9382, s.kpasquare = 13226, s.ksicyrillic = 1135, s.ktsquare = 13263, s.kturned = 670, s.kuhiragana = 12367, s.kukatakana = 12463, s.kukatakanahalfwidth = 65400, s.kvsquare = 13240, s.kwsquare = 13246, s.l = 108, s.labengali = 2482, s.lacute = 314, s.ladeva = 2354, s.lagujarati = 2738, s.lagurmukhi = 2610, s.lakkhangyaothai = 3653, s.lamaleffinalarabic = 65276, s.lamalefhamzaabovefinalarabic = 65272, s.lamalefhamzaaboveisolatedarabic = 65271, s.lamalefhamzabelowfinalarabic = 65274, s.lamalefhamzabelowisolatedarabic = 65273, s.lamalefisolatedarabic = 65275, s.lamalefmaddaabovefinalarabic = 65270, s.lamalefmaddaaboveisolatedarabic = 65269, s.lamarabic = 1604, s.lambda = 955, s.lambdastroke = 411, s.lamed = 1500, s.lameddagesh = 64316, s.lameddageshhebrew = 64316, s.lamedhebrew = 1500, s.lamfinalarabic = 65246, s.lamhahinitialarabic = 64714, s.laminitialarabic = 65247, s.lamjeeminitialarabic = 64713, s.lamkhahinitialarabic = 64715, s.lamlamhehisolatedarabic = 65010, s.lammedialarabic = 65248, s.lammeemhahinitialarabic = 64904, s.lammeeminitialarabic = 64716, s.largecircle = 9711, s.lbar = 410, s.lbelt = 620, s.lbopomofo = 12556, s.lcaron = 318, s.lcedilla = 316, s.lcircle = 9435, s.lcircumflexbelow = 7741, s.lcommaaccent = 316, s.ldot = 320, s.ldotaccent = 320, s.ldotbelow = 7735, s.ldotbelowmacron = 7737, s.leftangleabovecmb = 794, s.lefttackbelowcmb = 792, s.less = 60, s.lessequal = 8804, s.lessequalorgreater = 8922, s.lessmonospace = 65308, s.lessorequivalent = 8818, s.lessorgreater = 8822, s.lessoverequal = 8806, s.lesssmall = 65124, s.lezh = 622, s.lfblock = 9612, s.lhookretroflex = 621, s.lira = 8356, s.liwnarmenian = 1388, s.lj = 457, s.ljecyrillic = 1113, s.ll = 63168, s.lladeva = 2355, s.llagujarati = 2739, s.llinebelow = 7739, s.llladeva = 2356, s.llvocalicbengali = 2529, s.llvocalicdeva = 2401, s.llvocalicvowelsignbengali = 2531, s.llvocalicvowelsigndeva = 2403, s.lmiddletilde = 619, s.lmonospace = 65356, s.lmsquare = 13264, s.lochulathai = 3628, s.logicaland = 8743, s.logicalnot = 172, s.logicalnotreversed = 8976, s.logicalor = 8744, s.lolingthai = 3621, s.longs = 383, s.lowlinecenterline = 65102, s.lowlinecmb = 818, s.lowlinedashed = 65101, s.lozenge = 9674, s.lparen = 9383, s.lslash = 322, s.lsquare = 8467, s.lsuperior = 63214, s.ltshade = 9617, s.luthai = 3622, s.lvocalicbengali = 2444, s.lvocalicdeva = 2316, s.lvocalicvowelsignbengali = 2530, s.lvocalicvowelsigndeva = 2402, s.lxsquare = 13267, s.m = 109, s.mabengali = 2478, s.macron = 175, s.macronbelowcmb = 817, s.macroncmb = 772, s.macronlowmod = 717, s.macronmonospace = 65507, s.macute = 7743, s.madeva = 2350, s.magujarati = 2734, s.magurmukhi = 2606, s.mahapakhhebrew = 1444, s.mahapakhlefthebrew = 1444, s.mahiragana = 12414, s.maichattawalowleftthai = 63637, s.maichattawalowrightthai = 63636, s.maichattawathai = 3659, s.maichattawaupperleftthai = 63635, s.maieklowleftthai = 63628, s.maieklowrightthai = 63627, s.maiekthai = 3656, s.maiekupperleftthai = 63626, s.maihanakatleftthai = 63620, s.maihanakatthai = 3633, s.maitaikhuleftthai = 63625, s.maitaikhuthai = 3655, s.maitholowleftthai = 63631, s.maitholowrightthai = 63630, s.maithothai = 3657, s.maithoupperleftthai = 63629, s.maitrilowleftthai = 63634, s.maitrilowrightthai = 63633, s.maitrithai = 3658, s.maitriupperleftthai = 63632, s.maiyamokthai = 3654, s.makatakana = 12510, s.makatakanahalfwidth = 65423, s.male = 9794, s.mansyonsquare = 13127, s.maqafhebrew = 1470, s.mars = 9794, s.masoracirclehebrew = 1455, s.masquare = 13187, s.mbopomofo = 12551, s.mbsquare = 13268, s.mcircle = 9436, s.mcubedsquare = 13221, s.mdotaccent = 7745, s.mdotbelow = 7747, s.meemarabic = 1605, s.meemfinalarabic = 65250, s.meeminitialarabic = 65251, s.meemmedialarabic = 65252, s.meemmeeminitialarabic = 64721, s.meemmeemisolatedarabic = 64584, s.meetorusquare = 13133, s.mehiragana = 12417, s.meizierasquare = 13182, s.mekatakana = 12513, s.mekatakanahalfwidth = 65426, s.mem = 1502, s.memdagesh = 64318, s.memdageshhebrew = 64318, s.memhebrew = 1502, s.menarmenian = 1396, s.merkhahebrew = 1445, s.merkhakefulahebrew = 1446, s.merkhakefulalefthebrew = 1446, s.merkhalefthebrew = 1445, s.mhook = 625, s.mhzsquare = 13202, s.middledotkatakanahalfwidth = 65381, s.middot = 183, s.mieumacirclekorean = 12914, s.mieumaparenkorean = 12818, s.mieumcirclekorean = 12900, s.mieumkorean = 12609, s.mieumpansioskorean = 12656, s.mieumparenkorean = 12804, s.mieumpieupkorean = 12654, s.mieumsioskorean = 12655, s.mihiragana = 12415, s.mikatakana = 12511, s.mikatakanahalfwidth = 65424, s.minus = 8722, s.minusbelowcmb = 800, s.minuscircle = 8854, s.minusmod = 727, s.minusplus = 8723, s.minute = 8242, s.miribaarusquare = 13130, s.mirisquare = 13129, s.mlonglegturned = 624, s.mlsquare = 13206, s.mmcubedsquare = 13219, s.mmonospace = 65357, s.mmsquaredsquare = 13215, s.mohiragana = 12418, s.mohmsquare = 13249, s.mokatakana = 12514, s.mokatakanahalfwidth = 65427, s.molsquare = 13270, s.momathai = 3617, s.moverssquare = 13223, s.moverssquaredsquare = 13224, s.mparen = 9384, s.mpasquare = 13227, s.mssquare = 13235, s.msuperior = 63215, s.mturned = 623, s.mu = 181, s.mu1 = 181, s.muasquare = 13186, s.muchgreater = 8811, s.muchless = 8810, s.mufsquare = 13196, s.mugreek = 956, s.mugsquare = 13197, s.muhiragana = 12416, s.mukatakana = 12512, s.mukatakanahalfwidth = 65425, s.mulsquare = 13205, s.multiply = 215, s.mumsquare = 13211, s.munahhebrew = 1443, s.munahlefthebrew = 1443, s.musicalnote = 9834, s.musicalnotedbl = 9835, s.musicflatsign = 9837, s.musicsharpsign = 9839, s.mussquare = 13234, s.muvsquare = 13238, s.muwsquare = 13244, s.mvmegasquare = 13241, s.mvsquare = 13239, s.mwmegasquare = 13247, s.mwsquare = 13245, s.n = 110, s.nabengali = 2472, s.nabla = 8711, s.nacute = 324, s.nadeva = 2344, s.nagujarati = 2728, s.nagurmukhi = 2600, s.nahiragana = 12394, s.nakatakana = 12490, s.nakatakanahalfwidth = 65413, s.napostrophe = 329, s.nasquare = 13185, s.nbopomofo = 12555, s.nbspace = 160, s.ncaron = 328, s.ncedilla = 326, s.ncircle = 9437, s.ncircumflexbelow = 7755, s.ncommaaccent = 326, s.ndotaccent = 7749, s.ndotbelow = 7751, s.nehiragana = 12397, s.nekatakana = 12493, s.nekatakanahalfwidth = 65416, s.newsheqelsign = 8362, s.nfsquare = 13195, s.ngabengali = 2457, s.ngadeva = 2329, s.ngagujarati = 2713, s.ngagurmukhi = 2585, s.ngonguthai = 3591, s.nhiragana = 12435, s.nhookleft = 626, s.nhookretroflex = 627, s.nieunacirclekorean = 12911, s.nieunaparenkorean = 12815, s.nieuncieuckorean = 12597, s.nieuncirclekorean = 12897, s.nieunhieuhkorean = 12598, s.nieunkorean = 12596, s.nieunpansioskorean = 12648, s.nieunparenkorean = 12801, s.nieunsioskorean = 12647, s.nieuntikeutkorean = 12646, s.nihiragana = 12395, s.nikatakana = 12491, s.nikatakanahalfwidth = 65414, s.nikhahitleftthai = 63641, s.nikhahitthai = 3661, s.nine = 57, s.ninearabic = 1641, s.ninebengali = 2543, s.ninecircle = 9320, s.ninecircleinversesansserif = 10130, s.ninedeva = 2415, s.ninegujarati = 2799, s.ninegurmukhi = 2671, s.ninehackarabic = 1641, s.ninehangzhou = 12329, s.nineideographicparen = 12840, s.nineinferior = 8329, s.ninemonospace = 65305, s.nineoldstyle = 63289, s.nineparen = 9340, s.nineperiod = 9360, s.ninepersian = 1785, s.nineroman = 8568, s.ninesuperior = 8313, s.nineteencircle = 9330, s.nineteenparen = 9350, s.nineteenperiod = 9370, s.ninethai = 3673, s.nj = 460, s.njecyrillic = 1114, s.nkatakana = 12531, s.nkatakanahalfwidth = 65437, s.nlegrightlong = 414, s.nlinebelow = 7753, s.nmonospace = 65358, s.nmsquare = 13210, s.nnabengali = 2467, s.nnadeva = 2339, s.nnagujarati = 2723, s.nnagurmukhi = 2595, s.nnnadeva = 2345, s.nohiragana = 12398, s.nokatakana = 12494, s.nokatakanahalfwidth = 65417, s.nonbreakingspace = 160, s.nonenthai = 3603, s.nonuthai = 3609, s.noonarabic = 1606, s.noonfinalarabic = 65254, s.noonghunnaarabic = 1722, s.noonghunnafinalarabic = 64415, s.nooninitialarabic = 65255, s.noonjeeminitialarabic = 64722, s.noonjeemisolatedarabic = 64587, s.noonmedialarabic = 65256, s.noonmeeminitialarabic = 64725, s.noonmeemisolatedarabic = 64590, s.noonnoonfinalarabic = 64653, s.notcontains = 8716, s.notelement = 8713, s.notelementof = 8713, s.notequal = 8800, s.notgreater = 8815, s.notgreaternorequal = 8817, s.notgreaternorless = 8825, s.notidentical = 8802, s.notless = 8814, s.notlessnorequal = 8816, s.notparallel = 8742, s.notprecedes = 8832, s.notsubset = 8836, s.notsucceeds = 8833, s.notsuperset = 8837, s.nowarmenian = 1398, s.nparen = 9385, s.nssquare = 13233, s.nsuperior = 8319, s.ntilde = 241, s.nu = 957, s.nuhiragana = 12396, s.nukatakana = 12492, s.nukatakanahalfwidth = 65415, s.nuktabengali = 2492, s.nuktadeva = 2364, s.nuktagujarati = 2748, s.nuktagurmukhi = 2620, s.numbersign = 35, s.numbersignmonospace = 65283, s.numbersignsmall = 65119, s.numeralsigngreek = 884, s.numeralsignlowergreek = 885, s.numero = 8470, s.nun = 1504, s.nundagesh = 64320, s.nundageshhebrew = 64320, s.nunhebrew = 1504, s.nvsquare = 13237, s.nwsquare = 13243, s.nyabengali = 2462, s.nyadeva = 2334, s.nyagujarati = 2718, s.nyagurmukhi = 2590, s.o = 111, s.oacute = 243, s.oangthai = 3629, s.obarred = 629, s.obarredcyrillic = 1257, s.obarreddieresiscyrillic = 1259, s.obengali = 2451, s.obopomofo = 12571, s.obreve = 335, s.ocandradeva = 2321, s.ocandragujarati = 2705, s.ocandravowelsigndeva = 2377, s.ocandravowelsigngujarati = 2761, s.ocaron = 466, s.ocircle = 9438, s.ocircumflex = 244, s.ocircumflexacute = 7889, s.ocircumflexdotbelow = 7897, s.ocircumflexgrave = 7891, s.ocircumflexhookabove = 7893, s.ocircumflextilde = 7895, s.ocyrillic = 1086, s.odblacute = 337, s.odblgrave = 525, s.odeva = 2323, s.odieresis = 246, s.odieresiscyrillic = 1255, s.odotbelow = 7885, s.oe = 339, s.oekorean = 12634, s.ogonek = 731, s.ogonekcmb = 808, s.ograve = 242, s.ogujarati = 2707, s.oharmenian = 1413, s.ohiragana = 12362, s.ohookabove = 7887, s.ohorn = 417, s.ohornacute = 7899, s.ohorndotbelow = 7907, s.ohorngrave = 7901, s.ohornhookabove = 7903, s.ohorntilde = 7905, s.ohungarumlaut = 337, s.oi = 419, s.oinvertedbreve = 527, s.okatakana = 12458, s.okatakanahalfwidth = 65397, s.okorean = 12631, s.olehebrew = 1451, s.omacron = 333, s.omacronacute = 7763, s.omacrongrave = 7761, s.omdeva = 2384, s.omega = 969, s.omega1 = 982, s.omegacyrillic = 1121, s.omegalatinclosed = 631, s.omegaroundcyrillic = 1147, s.omegatitlocyrillic = 1149, s.omegatonos = 974, s.omgujarati = 2768, s.omicron = 959, s.omicrontonos = 972, s.omonospace = 65359, s.one = 49, s.onearabic = 1633, s.onebengali = 2535, s.onecircle = 9312, s.onecircleinversesansserif = 10122, s.onedeva = 2407, s.onedotenleader = 8228, s.oneeighth = 8539, s.onefitted = 63196, s.onegujarati = 2791, s.onegurmukhi = 2663, s.onehackarabic = 1633, s.onehalf = 189, s.onehangzhou = 12321, s.oneideographicparen = 12832, s.oneinferior = 8321, s.onemonospace = 65297, s.onenumeratorbengali = 2548, s.oneoldstyle = 63281, s.oneparen = 9332, s.oneperiod = 9352, s.onepersian = 1777, s.onequarter = 188, s.oneroman = 8560, s.onesuperior = 185, s.onethai = 3665, s.onethird = 8531, s.oogonek = 491, s.oogonekmacron = 493, s.oogurmukhi = 2579, s.oomatragurmukhi = 2635, s.oopen = 596, s.oparen = 9386, s.openbullet = 9702, s.option = 8997, s.ordfeminine = 170, s.ordmasculine = 186, s.orthogonal = 8735, s.oshortdeva = 2322, s.oshortvowelsigndeva = 2378, s.oslash = 248, s.oslashacute = 511, s.osmallhiragana = 12361, s.osmallkatakana = 12457, s.osmallkatakanahalfwidth = 65387, s.ostrokeacute = 511, s.osuperior = 63216, s.otcyrillic = 1151, s.otilde = 245, s.otildeacute = 7757, s.otildedieresis = 7759, s.oubopomofo = 12577, s.overline = 8254, s.overlinecenterline = 65098, s.overlinecmb = 773, s.overlinedashed = 65097, s.overlinedblwavy = 65100, s.overlinewavy = 65099, s.overscore = 175, s.ovowelsignbengali = 2507, s.ovowelsigndeva = 2379, s.ovowelsigngujarati = 2763, s.p = 112, s.paampssquare = 13184, s.paasentosquare = 13099, s.pabengali = 2474, s.pacute = 7765, s.padeva = 2346, s.pagedown = 8671, s.pageup = 8670, s.pagujarati = 2730, s.pagurmukhi = 2602, s.pahiragana = 12401, s.paiyannoithai = 3631, s.pakatakana = 12497, s.palatalizationcyrilliccmb = 1156, s.palochkacyrillic = 1216, s.pansioskorean = 12671, s.paragraph = 182, s.parallel = 8741, s.parenleft = 40, s.parenleftaltonearabic = 64830, s.parenleftbt = 63725, s.parenleftex = 63724, s.parenleftinferior = 8333, s.parenleftmonospace = 65288, s.parenleftsmall = 65113, s.parenleftsuperior = 8317, s.parenlefttp = 63723, s.parenleftvertical = 65077, s.parenright = 41, s.parenrightaltonearabic = 64831, s.parenrightbt = 63736, s.parenrightex = 63735, s.parenrightinferior = 8334, s.parenrightmonospace = 65289, s.parenrightsmall = 65114, s.parenrightsuperior = 8318, s.parenrighttp = 63734, s.parenrightvertical = 65078, s.partialdiff = 8706, s.paseqhebrew = 1472, s.pashtahebrew = 1433, s.pasquare = 13225, s.patah = 1463, s.patah11 = 1463, s.patah1d = 1463, s.patah2a = 1463, s.patahhebrew = 1463, s.patahnarrowhebrew = 1463, s.patahquarterhebrew = 1463, s.patahwidehebrew = 1463, s.pazerhebrew = 1441, s.pbopomofo = 12550, s.pcircle = 9439, s.pdotaccent = 7767, s.pe = 1508, s.pecyrillic = 1087, s.pedagesh = 64324, s.pedageshhebrew = 64324, s.peezisquare = 13115, s.pefinaldageshhebrew = 64323, s.peharabic = 1662, s.peharmenian = 1402, s.pehebrew = 1508, s.pehfinalarabic = 64343, s.pehinitialarabic = 64344, s.pehiragana = 12410, s.pehmedialarabic = 64345, s.pekatakana = 12506, s.pemiddlehookcyrillic = 1191, s.perafehebrew = 64334, s.percent = 37, s.percentarabic = 1642, s.percentmonospace = 65285, s.percentsmall = 65130, s.period = 46, s.periodarmenian = 1417, s.periodcentered = 183, s.periodhalfwidth = 65377, s.periodinferior = 63207, s.periodmonospace = 65294, s.periodsmall = 65106, s.periodsuperior = 63208, s.perispomenigreekcmb = 834, s.perpendicular = 8869, s.perthousand = 8240, s.peseta = 8359, s.pfsquare = 13194, s.phabengali = 2475, s.phadeva = 2347, s.phagujarati = 2731, s.phagurmukhi = 2603, s.phi = 966, s.phi1 = 981, s.phieuphacirclekorean = 12922, s.phieuphaparenkorean = 12826, s.phieuphcirclekorean = 12908, s.phieuphkorean = 12621, s.phieuphparenkorean = 12812, s.philatin = 632, s.phinthuthai = 3642, s.phisymbolgreek = 981, s.phook = 421, s.phophanthai = 3614, s.phophungthai = 3612, s.phosamphaothai = 3616, s.pi = 960, s.pieupacirclekorean = 12915, s.pieupaparenkorean = 12819, s.pieupcieuckorean = 12662, s.pieupcirclekorean = 12901, s.pieupkiyeokkorean = 12658, s.pieupkorean = 12610, s.pieupparenkorean = 12805, s.pieupsioskiyeokkorean = 12660, s.pieupsioskorean = 12612, s.pieupsiostikeutkorean = 12661, s.pieupthieuthkorean = 12663, s.pieuptikeutkorean = 12659, s.pihiragana = 12404, s.pikatakana = 12500, s.pisymbolgreek = 982, s.piwrarmenian = 1411, s.planckover2pi = 8463, s.planckover2pi1 = 8463, s.plus = 43, s.plusbelowcmb = 799, s.pluscircle = 8853, s.plusminus = 177, s.plusmod = 726, s.plusmonospace = 65291, s.plussmall = 65122, s.plussuperior = 8314, s.pmonospace = 65360, s.pmsquare = 13272, s.pohiragana = 12413, s.pointingindexdownwhite = 9759, s.pointingindexleftwhite = 9756, s.pointingindexrightwhite = 9758, s.pointingindexupwhite = 9757, s.pokatakana = 12509, s.poplathai = 3611, s.postalmark = 12306, s.postalmarkface = 12320, s.pparen = 9387, s.precedes = 8826, s.prescription = 8478, s.primemod = 697, s.primereversed = 8245, s.product = 8719, s.projective = 8965, s.prolongedkana = 12540, s.propellor = 8984, s.propersubset = 8834, s.propersuperset = 8835, s.proportion = 8759, s.proportional = 8733, s.psi = 968, s.psicyrillic = 1137, s.psilipneumatacyrilliccmb = 1158, s.pssquare = 13232, s.puhiragana = 12407, s.pukatakana = 12503, s.pvsquare = 13236, s.pwsquare = 13242, s.q = 113, s.qadeva = 2392, s.qadmahebrew = 1448, s.qafarabic = 1602, s.qaffinalarabic = 65238, s.qafinitialarabic = 65239, s.qafmedialarabic = 65240, s.qamats = 1464, s.qamats10 = 1464, s.qamats1a = 1464, s.qamats1c = 1464, s.qamats27 = 1464, s.qamats29 = 1464, s.qamats33 = 1464, s.qamatsde = 1464, s.qamatshebrew = 1464, s.qamatsnarrowhebrew = 1464, s.qamatsqatanhebrew = 1464, s.qamatsqatannarrowhebrew = 1464, s.qamatsqatanquarterhebrew = 1464, s.qamatsqatanwidehebrew = 1464, s.qamatsquarterhebrew = 1464, s.qamatswidehebrew = 1464, s.qarneyparahebrew = 1439, s.qbopomofo = 12561, s.qcircle = 9440, s.qhook = 672, s.qmonospace = 65361, s.qof = 1511, s.qofdagesh = 64327, s.qofdageshhebrew = 64327, s.qofhebrew = 1511, s.qparen = 9388, s.quarternote = 9833, s.qubuts = 1467, s.qubuts18 = 1467, s.qubuts25 = 1467, s.qubuts31 = 1467, s.qubutshebrew = 1467, s.qubutsnarrowhebrew = 1467, s.qubutsquarterhebrew = 1467, s.qubutswidehebrew = 1467, s.question = 63, s.questionarabic = 1567, s.questionarmenian = 1374, s.questiondown = 191, s.questiondownsmall = 63423, s.questiongreek = 894, s.questionmonospace = 65311, s.questionsmall = 63295, s.quotedbl = 34, s.quotedblbase = 8222, s.quotedblleft = 8220, s.quotedblmonospace = 65282, s.quotedblprime = 12318, s.quotedblprimereversed = 12317, s.quotedblright = 8221, s.quoteleft = 8216, s.quoteleftreversed = 8219, s.quotereversed = 8219, s.quoteright = 8217, s.quoterightn = 329, s.quotesinglbase = 8218, s.quotesingle = 39, s.quotesinglemonospace = 65287, s.r = 114, s.raarmenian = 1404, s.rabengali = 2480, s.racute = 341, s.radeva = 2352, s.radical = 8730, s.radicalex = 63717, s.radoverssquare = 13230, s.radoverssquaredsquare = 13231, s.radsquare = 13229, s.rafe = 1471, s.rafehebrew = 1471, s.ragujarati = 2736, s.ragurmukhi = 2608, s.rahiragana = 12425, s.rakatakana = 12521, s.rakatakanahalfwidth = 65431, s.ralowerdiagonalbengali = 2545, s.ramiddlediagonalbengali = 2544, s.ramshorn = 612, s.ratio = 8758, s.rbopomofo = 12566, s.rcaron = 345, s.rcedilla = 343, s.rcircle = 9441, s.rcommaaccent = 343, s.rdblgrave = 529, s.rdotaccent = 7769, s.rdotbelow = 7771, s.rdotbelowmacron = 7773, s.referencemark = 8251, s.reflexsubset = 8838, s.reflexsuperset = 8839, s.registered = 174, s.registersans = 63720, s.registerserif = 63194, s.reharabic = 1585, s.reharmenian = 1408, s.rehfinalarabic = 65198, s.rehiragana = 12428, s.rekatakana = 12524, s.rekatakanahalfwidth = 65434, s.resh = 1512, s.reshdageshhebrew = 64328, s.reshhebrew = 1512, s.reversedtilde = 8765, s.reviahebrew = 1431, s.reviamugrashhebrew = 1431, s.revlogicalnot = 8976, s.rfishhook = 638, s.rfishhookreversed = 639, s.rhabengali = 2525, s.rhadeva = 2397, s.rho = 961, s.rhook = 637, s.rhookturned = 635, s.rhookturnedsuperior = 693, s.rhosymbolgreek = 1009, s.rhotichookmod = 734, s.rieulacirclekorean = 12913, s.rieulaparenkorean = 12817, s.rieulcirclekorean = 12899, s.rieulhieuhkorean = 12608, s.rieulkiyeokkorean = 12602, s.rieulkiyeoksioskorean = 12649, s.rieulkorean = 12601, s.rieulmieumkorean = 12603, s.rieulpansioskorean = 12652, s.rieulparenkorean = 12803, s.rieulphieuphkorean = 12607, s.rieulpieupkorean = 12604, s.rieulpieupsioskorean = 12651, s.rieulsioskorean = 12605, s.rieulthieuthkorean = 12606, s.rieultikeutkorean = 12650, s.rieulyeorinhieuhkorean = 12653, s.rightangle = 8735, s.righttackbelowcmb = 793, s.righttriangle = 8895, s.rihiragana = 12426, s.rikatakana = 12522, s.rikatakanahalfwidth = 65432, s.ring = 730, s.ringbelowcmb = 805, s.ringcmb = 778, s.ringhalfleft = 703, s.ringhalfleftarmenian = 1369, s.ringhalfleftbelowcmb = 796, s.ringhalfleftcentered = 723, s.ringhalfright = 702, s.ringhalfrightbelowcmb = 825, s.ringhalfrightcentered = 722, s.rinvertedbreve = 531, s.rittorusquare = 13137, s.rlinebelow = 7775, s.rlongleg = 636, s.rlonglegturned = 634, s.rmonospace = 65362, s.rohiragana = 12429, s.rokatakana = 12525, s.rokatakanahalfwidth = 65435, s.roruathai = 3619, s.rparen = 9389, s.rrabengali = 2524, s.rradeva = 2353, s.rragurmukhi = 2652, s.rreharabic = 1681, s.rrehfinalarabic = 64397, s.rrvocalicbengali = 2528, s.rrvocalicdeva = 2400, s.rrvocalicgujarati = 2784, s.rrvocalicvowelsignbengali = 2500, s.rrvocalicvowelsigndeva = 2372, s.rrvocalicvowelsigngujarati = 2756, s.rsuperior = 63217, s.rtblock = 9616, s.rturned = 633, s.rturnedsuperior = 692, s.ruhiragana = 12427, s.rukatakana = 12523, s.rukatakanahalfwidth = 65433, s.rupeemarkbengali = 2546, s.rupeesignbengali = 2547, s.rupiah = 63197, s.ruthai = 3620, s.rvocalicbengali = 2443, s.rvocalicdeva = 2315, s.rvocalicgujarati = 2699, s.rvocalicvowelsignbengali = 2499, s.rvocalicvowelsigndeva = 2371, s.rvocalicvowelsigngujarati = 2755, s.s = 115, s.sabengali = 2488, s.sacute = 347, s.sacutedotaccent = 7781, s.sadarabic = 1589, s.sadeva = 2360, s.sadfinalarabic = 65210, s.sadinitialarabic = 65211, s.sadmedialarabic = 65212, s.sagujarati = 2744, s.sagurmukhi = 2616, s.sahiragana = 12373, s.sakatakana = 12469, s.sakatakanahalfwidth = 65403, s.sallallahoualayhewasallamarabic = 65018, s.samekh = 1505, s.samekhdagesh = 64321, s.samekhdageshhebrew = 64321, s.samekhhebrew = 1505, s.saraaathai = 3634, s.saraaethai = 3649, s.saraaimaimalaithai = 3652, s.saraaimaimuanthai = 3651, s.saraamthai = 3635, s.saraathai = 3632, s.saraethai = 3648, s.saraiileftthai = 63622, s.saraiithai = 3637, s.saraileftthai = 63621, s.saraithai = 3636, s.saraothai = 3650, s.saraueeleftthai = 63624, s.saraueethai = 3639, s.saraueleftthai = 63623, s.sarauethai = 3638, s.sarauthai = 3640, s.sarauuthai = 3641, s.sbopomofo = 12569, s.scaron = 353, s.scarondotaccent = 7783, s.scedilla = 351, s.schwa = 601, s.schwacyrillic = 1241, s.schwadieresiscyrillic = 1243, s.schwahook = 602, s.scircle = 9442, s.scircumflex = 349, s.scommaaccent = 537, s.sdotaccent = 7777, s.sdotbelow = 7779, s.sdotbelowdotaccent = 7785, s.seagullbelowcmb = 828, s.second = 8243, s.secondtonechinese = 714, s.section = 167, s.seenarabic = 1587, s.seenfinalarabic = 65202, s.seeninitialarabic = 65203, s.seenmedialarabic = 65204, s.segol = 1462, s.segol13 = 1462, s.segol1f = 1462, s.segol2c = 1462, s.segolhebrew = 1462, s.segolnarrowhebrew = 1462, s.segolquarterhebrew = 1462, s.segoltahebrew = 1426, s.segolwidehebrew = 1462, s.seharmenian = 1405, s.sehiragana = 12379, s.sekatakana = 12475, s.sekatakanahalfwidth = 65406, s.semicolon = 59, s.semicolonarabic = 1563, s.semicolonmonospace = 65307, s.semicolonsmall = 65108, s.semivoicedmarkkana = 12444, s.semivoicedmarkkanahalfwidth = 65439, s.sentisquare = 13090, s.sentosquare = 13091, s.seven = 55, s.sevenarabic = 1639, s.sevenbengali = 2541, s.sevencircle = 9318, s.sevencircleinversesansserif = 10128, s.sevendeva = 2413, s.seveneighths = 8542, s.sevengujarati = 2797, s.sevengurmukhi = 2669, s.sevenhackarabic = 1639, s.sevenhangzhou = 12327, s.sevenideographicparen = 12838, s.seveninferior = 8327, s.sevenmonospace = 65303, s.sevenoldstyle = 63287, s.sevenparen = 9338, s.sevenperiod = 9358, s.sevenpersian = 1783, s.sevenroman = 8566, s.sevensuperior = 8311, s.seventeencircle = 9328, s.seventeenparen = 9348, s.seventeenperiod = 9368, s.seventhai = 3671, s.sfthyphen = 173, s.shaarmenian = 1399, s.shabengali = 2486, s.shacyrillic = 1096, s.shaddaarabic = 1617, s.shaddadammaarabic = 64609, s.shaddadammatanarabic = 64606, s.shaddafathaarabic = 64608, s.shaddakasraarabic = 64610, s.shaddakasratanarabic = 64607, s.shade = 9618, s.shadedark = 9619, s.shadelight = 9617, s.shademedium = 9618, s.shadeva = 2358, s.shagujarati = 2742, s.shagurmukhi = 2614, s.shalshelethebrew = 1427, s.shbopomofo = 12565, s.shchacyrillic = 1097, s.sheenarabic = 1588, s.sheenfinalarabic = 65206, s.sheeninitialarabic = 65207, s.sheenmedialarabic = 65208, s.sheicoptic = 995, s.sheqel = 8362, s.sheqelhebrew = 8362, s.sheva = 1456, s.sheva115 = 1456, s.sheva15 = 1456, s.sheva22 = 1456, s.sheva2e = 1456, s.shevahebrew = 1456, s.shevanarrowhebrew = 1456, s.shevaquarterhebrew = 1456, s.shevawidehebrew = 1456, s.shhacyrillic = 1211, s.shimacoptic = 1005, s.shin = 1513, s.shindagesh = 64329, s.shindageshhebrew = 64329, s.shindageshshindot = 64300, s.shindageshshindothebrew = 64300, s.shindageshsindot = 64301, s.shindageshsindothebrew = 64301, s.shindothebrew = 1473, s.shinhebrew = 1513, s.shinshindot = 64298, s.shinshindothebrew = 64298, s.shinsindot = 64299, s.shinsindothebrew = 64299, s.shook = 642, s.sigma = 963, s.sigma1 = 962, s.sigmafinal = 962, s.sigmalunatesymbolgreek = 1010, s.sihiragana = 12375, s.sikatakana = 12471, s.sikatakanahalfwidth = 65404, s.siluqhebrew = 1469, s.siluqlefthebrew = 1469, s.similar = 8764, s.sindothebrew = 1474, s.siosacirclekorean = 12916, s.siosaparenkorean = 12820, s.sioscieuckorean = 12670, s.sioscirclekorean = 12902, s.sioskiyeokkorean = 12666, s.sioskorean = 12613, s.siosnieunkorean = 12667, s.siosparenkorean = 12806, s.siospieupkorean = 12669, s.siostikeutkorean = 12668, s.six = 54, s.sixarabic = 1638, s.sixbengali = 2540, s.sixcircle = 9317, s.sixcircleinversesansserif = 10127, s.sixdeva = 2412, s.sixgujarati = 2796, s.sixgurmukhi = 2668, s.sixhackarabic = 1638, s.sixhangzhou = 12326, s.sixideographicparen = 12837, s.sixinferior = 8326, s.sixmonospace = 65302, s.sixoldstyle = 63286, s.sixparen = 9337, s.sixperiod = 9357, s.sixpersian = 1782, s.sixroman = 8565, s.sixsuperior = 8310, s.sixteencircle = 9327, s.sixteencurrencydenominatorbengali = 2553, s.sixteenparen = 9347, s.sixteenperiod = 9367, s.sixthai = 3670, s.slash = 47, s.slashmonospace = 65295, s.slong = 383, s.slongdotaccent = 7835, s.smileface = 9786, s.smonospace = 65363, s.sofpasuqhebrew = 1475, s.softhyphen = 173, s.softsigncyrillic = 1100, s.sohiragana = 12381, s.sokatakana = 12477, s.sokatakanahalfwidth = 65407, s.soliduslongoverlaycmb = 824, s.solidusshortoverlaycmb = 823, s.sorusithai = 3625, s.sosalathai = 3624, s.sosothai = 3595, s.sosuathai = 3626, s.space = 32, s.spacehackarabic = 32, s.spade = 9824, s.spadesuitblack = 9824, s.spadesuitwhite = 9828, s.sparen = 9390, s.squarebelowcmb = 827, s.squarecc = 13252, s.squarecm = 13213, s.squarediagonalcrosshatchfill = 9641, s.squarehorizontalfill = 9636, s.squarekg = 13199, s.squarekm = 13214, s.squarekmcapital = 13262, s.squareln = 13265, s.squarelog = 13266, s.squaremg = 13198, s.squaremil = 13269, s.squaremm = 13212, s.squaremsquared = 13217, s.squareorthogonalcrosshatchfill = 9638, s.squareupperlefttolowerrightfill = 9639, s.squareupperrighttolowerleftfill = 9640, s.squareverticalfill = 9637, s.squarewhitewithsmallblack = 9635, s.srsquare = 13275, s.ssabengali = 2487, s.ssadeva = 2359, s.ssagujarati = 2743, s.ssangcieuckorean = 12617, s.ssanghieuhkorean = 12677, s.ssangieungkorean = 12672, s.ssangkiyeokkorean = 12594, s.ssangnieunkorean = 12645, s.ssangpieupkorean = 12611, s.ssangsioskorean = 12614, s.ssangtikeutkorean = 12600, s.ssuperior = 63218, s.sterling = 163, s.sterlingmonospace = 65505, s.strokelongoverlaycmb = 822, s.strokeshortoverlaycmb = 821, s.subset = 8834, s.subsetnotequal = 8842, s.subsetorequal = 8838, s.succeeds = 8827, s.suchthat = 8715, s.suhiragana = 12377, s.sukatakana = 12473, s.sukatakanahalfwidth = 65405, s.sukunarabic = 1618, s.summation = 8721, s.sun = 9788, s.superset = 8835, s.supersetnotequal = 8843, s.supersetorequal = 8839, s.svsquare = 13276, s.syouwaerasquare = 13180, s.t = 116, s.tabengali = 2468, s.tackdown = 8868, s.tackleft = 8867, s.tadeva = 2340, s.tagujarati = 2724, s.tagurmukhi = 2596, s.taharabic = 1591, s.tahfinalarabic = 65218, s.tahinitialarabic = 65219, s.tahiragana = 12383, s.tahmedialarabic = 65220, s.taisyouerasquare = 13181, s.takatakana = 12479, s.takatakanahalfwidth = 65408, s.tatweelarabic = 1600, s.tau = 964, s.tav = 1514, s.tavdages = 64330, s.tavdagesh = 64330, s.tavdageshhebrew = 64330, s.tavhebrew = 1514, s.tbar = 359, s.tbopomofo = 12554, s.tcaron = 357, s.tccurl = 680, s.tcedilla = 355, s.tcheharabic = 1670, s.tchehfinalarabic = 64379, s.tchehinitialarabic = 64380, s.tchehmedialarabic = 64381, s.tcircle = 9443, s.tcircumflexbelow = 7793, s.tcommaaccent = 355, s.tdieresis = 7831, s.tdotaccent = 7787, s.tdotbelow = 7789, s.tecyrillic = 1090, s.tedescendercyrillic = 1197, s.teharabic = 1578, s.tehfinalarabic = 65174, s.tehhahinitialarabic = 64674, s.tehhahisolatedarabic = 64524, s.tehinitialarabic = 65175, s.tehiragana = 12390, s.tehjeeminitialarabic = 64673, s.tehjeemisolatedarabic = 64523, s.tehmarbutaarabic = 1577, s.tehmarbutafinalarabic = 65172, s.tehmedialarabic = 65176, s.tehmeeminitialarabic = 64676, s.tehmeemisolatedarabic = 64526, s.tehnoonfinalarabic = 64627, s.tekatakana = 12486, s.tekatakanahalfwidth = 65411, s.telephone = 8481, s.telephoneblack = 9742, s.telishagedolahebrew = 1440, s.telishaqetanahebrew = 1449, s.tencircle = 9321, s.tenideographicparen = 12841, s.tenparen = 9341, s.tenperiod = 9361, s.tenroman = 8569, s.tesh = 679, s.tet = 1496, s.tetdagesh = 64312, s.tetdageshhebrew = 64312, s.tethebrew = 1496, s.tetsecyrillic = 1205, s.tevirhebrew = 1435, s.tevirlefthebrew = 1435, s.thabengali = 2469, s.thadeva = 2341, s.thagujarati = 2725, s.thagurmukhi = 2597, s.thalarabic = 1584, s.thalfinalarabic = 65196, s.thanthakhatlowleftthai = 63640, s.thanthakhatlowrightthai = 63639, s.thanthakhatthai = 3660, s.thanthakhatupperleftthai = 63638, s.theharabic = 1579, s.thehfinalarabic = 65178, s.thehinitialarabic = 65179, s.thehmedialarabic = 65180, s.thereexists = 8707, s.therefore = 8756, s.theta = 952, s.theta1 = 977, s.thetasymbolgreek = 977, s.thieuthacirclekorean = 12921, s.thieuthaparenkorean = 12825, s.thieuthcirclekorean = 12907, s.thieuthkorean = 12620, s.thieuthparenkorean = 12811, s.thirteencircle = 9324, s.thirteenparen = 9344, s.thirteenperiod = 9364, s.thonangmonthothai = 3601, s.thook = 429, s.thophuthaothai = 3602, s.thorn = 254, s.thothahanthai = 3607, s.thothanthai = 3600, s.thothongthai = 3608, s.thothungthai = 3606, s.thousandcyrillic = 1154, s.thousandsseparatorarabic = 1644, s.thousandsseparatorpersian = 1644, s.three = 51, s.threearabic = 1635, s.threebengali = 2537, s.threecircle = 9314, s.threecircleinversesansserif = 10124, s.threedeva = 2409, s.threeeighths = 8540, s.threegujarati = 2793, s.threegurmukhi = 2665, s.threehackarabic = 1635, s.threehangzhou = 12323, s.threeideographicparen = 12834, s.threeinferior = 8323, s.threemonospace = 65299, s.threenumeratorbengali = 2550, s.threeoldstyle = 63283, s.threeparen = 9334, s.threeperiod = 9354, s.threepersian = 1779, s.threequarters = 190, s.threequartersemdash = 63198, s.threeroman = 8562, s.threesuperior = 179, s.threethai = 3667, s.thzsquare = 13204, s.tihiragana = 12385, s.tikatakana = 12481, s.tikatakanahalfwidth = 65409, s.tikeutacirclekorean = 12912, s.tikeutaparenkorean = 12816, s.tikeutcirclekorean = 12898, s.tikeutkorean = 12599, s.tikeutparenkorean = 12802, s.tilde = 732, s.tildebelowcmb = 816, s.tildecmb = 771, s.tildecomb = 771, s.tildedoublecmb = 864, s.tildeoperator = 8764, s.tildeoverlaycmb = 820, s.tildeverticalcmb = 830, s.timescircle = 8855, s.tipehahebrew = 1430, s.tipehalefthebrew = 1430, s.tippigurmukhi = 2672, s.titlocyrilliccmb = 1155, s.tiwnarmenian = 1407, s.tlinebelow = 7791, s.tmonospace = 65364, s.toarmenian = 1385, s.tohiragana = 12392, s.tokatakana = 12488, s.tokatakanahalfwidth = 65412, s.tonebarextrahighmod = 741, s.tonebarextralowmod = 745, s.tonebarhighmod = 742, s.tonebarlowmod = 744, s.tonebarmidmod = 743, s.tonefive = 445, s.tonesix = 389, s.tonetwo = 424, s.tonos = 900, s.tonsquare = 13095, s.topatakthai = 3599, s.tortoiseshellbracketleft = 12308, s.tortoiseshellbracketleftsmall = 65117, s.tortoiseshellbracketleftvertical = 65081, s.tortoiseshellbracketright = 12309, s.tortoiseshellbracketrightsmall = 65118, s.tortoiseshellbracketrightvertical = 65082, s.totaothai = 3605, s.tpalatalhook = 427, s.tparen = 9391, s.trademark = 8482, s.trademarksans = 63722, s.trademarkserif = 63195, s.tretroflexhook = 648, s.triagdn = 9660, s.triaglf = 9668, s.triagrt = 9658, s.triagup = 9650, s.ts = 678, s.tsadi = 1510, s.tsadidagesh = 64326, s.tsadidageshhebrew = 64326, s.tsadihebrew = 1510, s.tsecyrillic = 1094, s.tsere = 1461, s.tsere12 = 1461, s.tsere1e = 1461, s.tsere2b = 1461, s.tserehebrew = 1461, s.tserenarrowhebrew = 1461, s.tserequarterhebrew = 1461, s.tserewidehebrew = 1461, s.tshecyrillic = 1115, s.tsuperior = 63219, s.ttabengali = 2463, s.ttadeva = 2335, s.ttagujarati = 2719, s.ttagurmukhi = 2591, s.tteharabic = 1657, s.ttehfinalarabic = 64359, s.ttehinitialarabic = 64360, s.ttehmedialarabic = 64361, s.tthabengali = 2464, s.tthadeva = 2336, s.tthagujarati = 2720, s.tthagurmukhi = 2592, s.tturned = 647, s.tuhiragana = 12388, s.tukatakana = 12484, s.tukatakanahalfwidth = 65410, s.tusmallhiragana = 12387, s.tusmallkatakana = 12483, s.tusmallkatakanahalfwidth = 65391, s.twelvecircle = 9323, s.twelveparen = 9343, s.twelveperiod = 9363, s.twelveroman = 8571, s.twentycircle = 9331, s.twentyhangzhou = 21316, s.twentyparen = 9351, s.twentyperiod = 9371, s.two = 50, s.twoarabic = 1634, s.twobengali = 2536, s.twocircle = 9313, s.twocircleinversesansserif = 10123, s.twodeva = 2408, s.twodotenleader = 8229, s.twodotleader = 8229, s.twodotleadervertical = 65072, s.twogujarati = 2792, s.twogurmukhi = 2664, s.twohackarabic = 1634, s.twohangzhou = 12322, s.twoideographicparen = 12833, s.twoinferior = 8322, s.twomonospace = 65298, s.twonumeratorbengali = 2549, s.twooldstyle = 63282, s.twoparen = 9333, s.twoperiod = 9353, s.twopersian = 1778, s.tworoman = 8561, s.twostroke = 443, s.twosuperior = 178, s.twothai = 3666, s.twothirds = 8532, s.u = 117, s.uacute = 250, s.ubar = 649, s.ubengali = 2441, s.ubopomofo = 12584, s.ubreve = 365, s.ucaron = 468, s.ucircle = 9444, s.ucircumflex = 251, s.ucircumflexbelow = 7799, s.ucyrillic = 1091, s.udattadeva = 2385, s.udblacute = 369, s.udblgrave = 533, s.udeva = 2313, s.udieresis = 252, s.udieresisacute = 472, s.udieresisbelow = 7795, s.udieresiscaron = 474, s.udieresiscyrillic = 1265, s.udieresisgrave = 476, s.udieresismacron = 470, s.udotbelow = 7909, s.ugrave = 249, s.ugujarati = 2697, s.ugurmukhi = 2569, s.uhiragana = 12358, s.uhookabove = 7911, s.uhorn = 432, s.uhornacute = 7913, s.uhorndotbelow = 7921, s.uhorngrave = 7915, s.uhornhookabove = 7917, s.uhorntilde = 7919, s.uhungarumlaut = 369, s.uhungarumlautcyrillic = 1267, s.uinvertedbreve = 535, s.ukatakana = 12454, s.ukatakanahalfwidth = 65395, s.ukcyrillic = 1145, s.ukorean = 12636, s.umacron = 363, s.umacroncyrillic = 1263, s.umacrondieresis = 7803, s.umatragurmukhi = 2625, s.umonospace = 65365, s.underscore = 95, s.underscoredbl = 8215, s.underscoremonospace = 65343, s.underscorevertical = 65075, s.underscorewavy = 65103, s.union = 8746, s.universal = 8704, s.uogonek = 371, s.uparen = 9392, s.upblock = 9600, s.upperdothebrew = 1476, s.upsilon = 965, s.upsilondieresis = 971, s.upsilondieresistonos = 944, s.upsilonlatin = 650, s.upsilontonos = 973, s.uptackbelowcmb = 797, s.uptackmod = 724, s.uragurmukhi = 2675, s.uring = 367, s.ushortcyrillic = 1118, s.usmallhiragana = 12357, s.usmallkatakana = 12453, s.usmallkatakanahalfwidth = 65385, s.ustraightcyrillic = 1199, s.ustraightstrokecyrillic = 1201, s.utilde = 361, s.utildeacute = 7801, s.utildebelow = 7797, s.uubengali = 2442, s.uudeva = 2314, s.uugujarati = 2698, s.uugurmukhi = 2570, s.uumatragurmukhi = 2626, s.uuvowelsignbengali = 2498, s.uuvowelsigndeva = 2370, s.uuvowelsigngujarati = 2754, s.uvowelsignbengali = 2497, s.uvowelsigndeva = 2369, s.uvowelsigngujarati = 2753, s.v = 118, s.vadeva = 2357, s.vagujarati = 2741, s.vagurmukhi = 2613, s.vakatakana = 12535, s.vav = 1493, s.vavdagesh = 64309, s.vavdagesh65 = 64309, s.vavdageshhebrew = 64309, s.vavhebrew = 1493, s.vavholam = 64331, s.vavholamhebrew = 64331, s.vavvavhebrew = 1520, s.vavyodhebrew = 1521, s.vcircle = 9445, s.vdotbelow = 7807, s.vecyrillic = 1074, s.veharabic = 1700, s.vehfinalarabic = 64363, s.vehinitialarabic = 64364, s.vehmedialarabic = 64365, s.vekatakana = 12537, s.venus = 9792, s.verticalbar = 124, s.verticallineabovecmb = 781, s.verticallinebelowcmb = 809, s.verticallinelowmod = 716, s.verticallinemod = 712, s.vewarmenian = 1406, s.vhook = 651, s.vikatakana = 12536, s.viramabengali = 2509, s.viramadeva = 2381, s.viramagujarati = 2765, s.visargabengali = 2435, s.visargadeva = 2307, s.visargagujarati = 2691, s.vmonospace = 65366, s.voarmenian = 1400, s.voicediterationhiragana = 12446, s.voicediterationkatakana = 12542, s.voicedmarkkana = 12443, s.voicedmarkkanahalfwidth = 65438, s.vokatakana = 12538, s.vparen = 9393, s.vtilde = 7805, s.vturned = 652, s.vuhiragana = 12436, s.vukatakana = 12532, s.w = 119, s.wacute = 7811, s.waekorean = 12633, s.wahiragana = 12431, s.wakatakana = 12527, s.wakatakanahalfwidth = 65436, s.wakorean = 12632, s.wasmallhiragana = 12430, s.wasmallkatakana = 12526, s.wattosquare = 13143, s.wavedash = 12316, s.wavyunderscorevertical = 65076, s.wawarabic = 1608, s.wawfinalarabic = 65262, s.wawhamzaabovearabic = 1572, s.wawhamzaabovefinalarabic = 65158, s.wbsquare = 13277, s.wcircle = 9446, s.wcircumflex = 373, s.wdieresis = 7813, s.wdotaccent = 7815, s.wdotbelow = 7817, s.wehiragana = 12433, s.weierstrass = 8472, s.wekatakana = 12529, s.wekorean = 12638, s.weokorean = 12637, s.wgrave = 7809, s.whitebullet = 9702, s.whitecircle = 9675, s.whitecircleinverse = 9689, s.whitecornerbracketleft = 12302, s.whitecornerbracketleftvertical = 65091, s.whitecornerbracketright = 12303, s.whitecornerbracketrightvertical = 65092, s.whitediamond = 9671, s.whitediamondcontainingblacksmalldiamond = 9672, s.whitedownpointingsmalltriangle = 9663, s.whitedownpointingtriangle = 9661, s.whiteleftpointingsmalltriangle = 9667, s.whiteleftpointingtriangle = 9665, s.whitelenticularbracketleft = 12310, s.whitelenticularbracketright = 12311, s.whiterightpointingsmalltriangle = 9657, s.whiterightpointingtriangle = 9655, s.whitesmallsquare = 9643, s.whitesmilingface = 9786, s.whitesquare = 9633, s.whitestar = 9734, s.whitetelephone = 9743, s.whitetortoiseshellbracketleft = 12312, s.whitetortoiseshellbracketright = 12313, s.whiteuppointingsmalltriangle = 9653, s.whiteuppointingtriangle = 9651, s.wihiragana = 12432, s.wikatakana = 12528, s.wikorean = 12639, s.wmonospace = 65367, s.wohiragana = 12434, s.wokatakana = 12530, s.wokatakanahalfwidth = 65382, s.won = 8361, s.wonmonospace = 65510, s.wowaenthai = 3623, s.wparen = 9394, s.wring = 7832, s.wsuperior = 695, s.wturned = 653, s.wynn = 447, s.x = 120, s.xabovecmb = 829, s.xbopomofo = 12562, s.xcircle = 9447, s.xdieresis = 7821, s.xdotaccent = 7819, s.xeharmenian = 1389, s.xi = 958, s.xmonospace = 65368, s.xparen = 9395, s.xsuperior = 739, s.y = 121, s.yaadosquare = 13134, s.yabengali = 2479, s.yacute = 253, s.yadeva = 2351, s.yaekorean = 12626, s.yagujarati = 2735, s.yagurmukhi = 2607, s.yahiragana = 12420, s.yakatakana = 12516, s.yakatakanahalfwidth = 65428, s.yakorean = 12625, s.yamakkanthai = 3662, s.yasmallhiragana = 12419, s.yasmallkatakana = 12515, s.yasmallkatakanahalfwidth = 65388, s.yatcyrillic = 1123, s.ycircle = 9448, s.ycircumflex = 375, s.ydieresis = 255, s.ydotaccent = 7823, s.ydotbelow = 7925, s.yeharabic = 1610, s.yehbarreearabic = 1746, s.yehbarreefinalarabic = 64431, s.yehfinalarabic = 65266, s.yehhamzaabovearabic = 1574, s.yehhamzaabovefinalarabic = 65162, s.yehhamzaaboveinitialarabic = 65163, s.yehhamzaabovemedialarabic = 65164, s.yehinitialarabic = 65267, s.yehmedialarabic = 65268, s.yehmeeminitialarabic = 64733, s.yehmeemisolatedarabic = 64600, s.yehnoonfinalarabic = 64660, s.yehthreedotsbelowarabic = 1745, s.yekorean = 12630, s.yen = 165, s.yenmonospace = 65509, s.yeokorean = 12629, s.yeorinhieuhkorean = 12678, s.yerahbenyomohebrew = 1450, s.yerahbenyomolefthebrew = 1450, s.yericyrillic = 1099, s.yerudieresiscyrillic = 1273, s.yesieungkorean = 12673, s.yesieungpansioskorean = 12675, s.yesieungsioskorean = 12674, s.yetivhebrew = 1434, s.ygrave = 7923, s.yhook = 436, s.yhookabove = 7927, s.yiarmenian = 1397, s.yicyrillic = 1111, s.yikorean = 12642, s.yinyang = 9775, s.yiwnarmenian = 1410, s.ymonospace = 65369, s.yod = 1497, s.yoddagesh = 64313, s.yoddageshhebrew = 64313, s.yodhebrew = 1497, s.yodyodhebrew = 1522, s.yodyodpatahhebrew = 64287, s.yohiragana = 12424, s.yoikorean = 12681, s.yokatakana = 12520, s.yokatakanahalfwidth = 65430, s.yokorean = 12635, s.yosmallhiragana = 12423, s.yosmallkatakana = 12519, s.yosmallkatakanahalfwidth = 65390, s.yotgreek = 1011, s.yoyaekorean = 12680, s.yoyakorean = 12679, s.yoyakthai = 3618, s.yoyingthai = 3597, s.yparen = 9396, s.ypogegrammeni = 890, s.ypogegrammenigreekcmb = 837, s.yr = 422, s.yring = 7833, s.ysuperior = 696, s.ytilde = 7929, s.yturned = 654, s.yuhiragana = 12422, s.yuikorean = 12684, s.yukatakana = 12518, s.yukatakanahalfwidth = 65429, s.yukorean = 12640, s.yusbigcyrillic = 1131, s.yusbigiotifiedcyrillic = 1133, s.yuslittlecyrillic = 1127, s.yuslittleiotifiedcyrillic = 1129, s.yusmallhiragana = 12421, s.yusmallkatakana = 12517, s.yusmallkatakanahalfwidth = 65389, s.yuyekorean = 12683, s.yuyeokorean = 12682, s.yyabengali = 2527, s.yyadeva = 2399, s.z = 122, s.zaarmenian = 1382, s.zacute = 378, s.zadeva = 2395, s.zagurmukhi = 2651, s.zaharabic = 1592, s.zahfinalarabic = 65222, s.zahinitialarabic = 65223, s.zahiragana = 12374, s.zahmedialarabic = 65224, s.zainarabic = 1586, s.zainfinalarabic = 65200, s.zakatakana = 12470, s.zaqefgadolhebrew = 1429, s.zaqefqatanhebrew = 1428, s.zarqahebrew = 1432, s.zayin = 1494, s.zayindagesh = 64310, s.zayindageshhebrew = 64310, s.zayinhebrew = 1494, s.zbopomofo = 12567, s.zcaron = 382, s.zcircle = 9449, s.zcircumflex = 7825, s.zcurl = 657, s.zdot = 380, s.zdotaccent = 380, s.zdotbelow = 7827, s.zecyrillic = 1079, s.zedescendercyrillic = 1177, s.zedieresiscyrillic = 1247, s.zehiragana = 12380, s.zekatakana = 12476, s.zero = 48, s.zeroarabic = 1632, s.zerobengali = 2534, s.zerodeva = 2406, s.zerogujarati = 2790, s.zerogurmukhi = 2662, s.zerohackarabic = 1632, s.zeroinferior = 8320, s.zeromonospace = 65296, s.zerooldstyle = 63280, s.zeropersian = 1776, s.zerosuperior = 8304, s.zerothai = 3664, s.zerowidthjoiner = 65279, s.zerowidthnonjoiner = 8204, s.zerowidthspace = 8203, s.zeta = 950, s.zhbopomofo = 12563, s.zhearmenian = 1386, s.zhebrevecyrillic = 1218, s.zhecyrillic = 1078, s.zhedescendercyrillic = 1175, s.zhedieresiscyrillic = 1245, s.zihiragana = 12376, s.zikatakana = 12472, s.zinorhebrew = 1454, s.zlinebelow = 7829, s.zmonospace = 65370, s.zohiragana = 12382, s.zokatakana = 12478, s.zparen = 9397, s.zretroflexhook = 656, s.zstroke = 438, s.zuhiragana = 12378, s.zukatakana = 12474, s[".notdef"] = 0, s.angbracketleftbig = 9001, s.angbracketleftBig = 9001, s.angbracketleftbigg = 9001, s.angbracketleftBigg = 9001, s.angbracketrightBig = 9002, s.angbracketrightbig = 9002, s.angbracketrightBigg = 9002, s.angbracketrightbigg = 9002, s.arrowhookleft = 8618, s.arrowhookright = 8617, s.arrowlefttophalf = 8636, s.arrowleftbothalf = 8637, s.arrownortheast = 8599, s.arrownorthwest = 8598, s.arrowrighttophalf = 8640, s.arrowrightbothalf = 8641, s.arrowsoutheast = 8600, s.arrowsouthwest = 8601, s.backslashbig = 8726, s.backslashBig = 8726, s.backslashBigg = 8726, s.backslashbigg = 8726, s.bardbl = 8214, s.bracehtipdownleft = 65079, s.bracehtipdownright = 65079, s.bracehtipupleft = 65080, s.bracehtipupright = 65080, s.braceleftBig = 123, s.braceleftbig = 123, s.braceleftbigg = 123, s.braceleftBigg = 123, s.bracerightBig = 125, s.bracerightbig = 125, s.bracerightbigg = 125, s.bracerightBigg = 125, s.bracketleftbig = 91, s.bracketleftBig = 91, s.bracketleftbigg = 91, s.bracketleftBigg = 91, s.bracketrightBig = 93, s.bracketrightbig = 93, s.bracketrightbigg = 93, s.bracketrightBigg = 93, s.ceilingleftbig = 8968, s.ceilingleftBig = 8968, s.ceilingleftBigg = 8968, s.ceilingleftbigg = 8968, s.ceilingrightbig = 8969, s.ceilingrightBig = 8969, s.ceilingrightbigg = 8969, s.ceilingrightBigg = 8969, s.circledotdisplay = 8857, s.circledottext = 8857, s.circlemultiplydisplay = 8855, s.circlemultiplytext = 8855, s.circleplusdisplay = 8853, s.circleplustext = 8853, s.contintegraldisplay = 8750, s.contintegraltext = 8750, s.coproductdisplay = 8720, s.coproducttext = 8720, s.floorleftBig = 8970, s.floorleftbig = 8970, s.floorleftbigg = 8970, s.floorleftBigg = 8970, s.floorrightbig = 8971, s.floorrightBig = 8971, s.floorrightBigg = 8971, s.floorrightbigg = 8971, s.hatwide = 770, s.hatwider = 770, s.hatwidest = 770, s.intercal = 7488, s.integraldisplay = 8747, s.integraltext = 8747, s.intersectiondisplay = 8898, s.intersectiontext = 8898, s.logicalanddisplay = 8743, s.logicalandtext = 8743, s.logicalordisplay = 8744, s.logicalortext = 8744, s.parenleftBig = 40, s.parenleftbig = 40, s.parenleftBigg = 40, s.parenleftbigg = 40, s.parenrightBig = 41, s.parenrightbig = 41, s.parenrightBigg = 41, s.parenrightbigg = 41, s.prime = 8242, s.productdisplay = 8719, s.producttext = 8719, s.radicalbig = 8730, s.radicalBig = 8730, s.radicalBigg = 8730, s.radicalbigg = 8730, s.radicalbt = 8730, s.radicaltp = 8730, s.radicalvertex = 8730, s.slashbig = 47, s.slashBig = 47, s.slashBigg = 47, s.slashbigg = 47, s.summationdisplay = 8721, s.summationtext = 8721, s.tildewide = 732, s.tildewider = 732, s.tildewidest = 732, s.uniondisplay = 8899, s.unionmultidisplay = 8846, s.unionmultitext = 8846, s.unionsqdisplay = 8852, s.unionsqtext = 8852, s.uniontext = 8899, s.vextenddouble = 8741, s.vextendsingle = 8739;
}), B_ = Ee(function(s) {
  s.space = 32, s.a1 = 9985, s.a2 = 9986, s.a202 = 9987, s.a3 = 9988, s.a4 = 9742, s.a5 = 9990, s.a119 = 9991, s.a118 = 9992, s.a117 = 9993, s.a11 = 9755, s.a12 = 9758, s.a13 = 9996, s.a14 = 9997, s.a15 = 9998, s.a16 = 9999, s.a105 = 1e4, s.a17 = 10001, s.a18 = 10002, s.a19 = 10003, s.a20 = 10004, s.a21 = 10005, s.a22 = 10006, s.a23 = 10007, s.a24 = 10008, s.a25 = 10009, s.a26 = 10010, s.a27 = 10011, s.a28 = 10012, s.a6 = 10013, s.a7 = 10014, s.a8 = 10015, s.a9 = 10016, s.a10 = 10017, s.a29 = 10018, s.a30 = 10019, s.a31 = 10020, s.a32 = 10021, s.a33 = 10022, s.a34 = 10023, s.a35 = 9733, s.a36 = 10025, s.a37 = 10026, s.a38 = 10027, s.a39 = 10028, s.a40 = 10029, s.a41 = 10030, s.a42 = 10031, s.a43 = 10032, s.a44 = 10033, s.a45 = 10034, s.a46 = 10035, s.a47 = 10036, s.a48 = 10037, s.a49 = 10038, s.a50 = 10039, s.a51 = 10040, s.a52 = 10041, s.a53 = 10042, s.a54 = 10043, s.a55 = 10044, s.a56 = 10045, s.a57 = 10046, s.a58 = 10047, s.a59 = 10048, s.a60 = 10049, s.a61 = 10050, s.a62 = 10051, s.a63 = 10052, s.a64 = 10053, s.a65 = 10054, s.a66 = 10055, s.a67 = 10056, s.a68 = 10057, s.a69 = 10058, s.a70 = 10059, s.a71 = 9679, s.a72 = 10061, s.a73 = 9632, s.a74 = 10063, s.a203 = 10064, s.a75 = 10065, s.a204 = 10066, s.a76 = 9650, s.a77 = 9660, s.a78 = 9670, s.a79 = 10070, s.a81 = 9687, s.a82 = 10072, s.a83 = 10073, s.a84 = 10074, s.a97 = 10075, s.a98 = 10076, s.a99 = 10077, s.a100 = 10078, s.a101 = 10081, s.a102 = 10082, s.a103 = 10083, s.a104 = 10084, s.a106 = 10085, s.a107 = 10086, s.a108 = 10087, s.a112 = 9827, s.a111 = 9830, s.a110 = 9829, s.a109 = 9824, s.a120 = 9312, s.a121 = 9313, s.a122 = 9314, s.a123 = 9315, s.a124 = 9316, s.a125 = 9317, s.a126 = 9318, s.a127 = 9319, s.a128 = 9320, s.a129 = 9321, s.a130 = 10102, s.a131 = 10103, s.a132 = 10104, s.a133 = 10105, s.a134 = 10106, s.a135 = 10107, s.a136 = 10108, s.a137 = 10109, s.a138 = 10110, s.a139 = 10111, s.a140 = 10112, s.a141 = 10113, s.a142 = 10114, s.a143 = 10115, s.a144 = 10116, s.a145 = 10117, s.a146 = 10118, s.a147 = 10119, s.a148 = 10120, s.a149 = 10121, s.a150 = 10122, s.a151 = 10123, s.a152 = 10124, s.a153 = 10125, s.a154 = 10126, s.a155 = 10127, s.a156 = 10128, s.a157 = 10129, s.a158 = 10130, s.a159 = 10131, s.a160 = 10132, s.a161 = 8594, s.a163 = 8596, s.a164 = 8597, s.a196 = 10136, s.a165 = 10137, s.a192 = 10138, s.a166 = 10139, s.a167 = 10140, s.a168 = 10141, s.a169 = 10142, s.a170 = 10143, s.a171 = 10144, s.a172 = 10145, s.a173 = 10146, s.a162 = 10147, s.a174 = 10148, s.a175 = 10149, s.a176 = 10150, s.a177 = 10151, s.a178 = 10152, s.a179 = 10153, s.a193 = 10154, s.a180 = 10155, s.a199 = 10156, s.a181 = 10157, s.a200 = 10158, s.a182 = 10159, s.a201 = 10161, s.a183 = 10162, s.a184 = 10163, s.a197 = 10164, s.a185 = 10165, s.a194 = 10166, s.a198 = 10167, s.a186 = 10168, s.a195 = 10169, s.a187 = 10170, s.a188 = 10171, s.a189 = 10172, s.a190 = 10173, s.a191 = 10174, s.a89 = 10088, s.a90 = 10089, s.a93 = 10090, s.a94 = 10091, s.a91 = 10092, s.a92 = 10093, s.a205 = 10094, s.a85 = 10095, s.a206 = 10096, s.a86 = 10097, s.a87 = 10098, s.a88 = 10099, s.a95 = 10100, s.a96 = 10101, s[".notdef"] = 0;
}), L_ = Ee(function(s) {
  s[63721] = 169, s[63193] = 169, s[63720] = 174, s[63194] = 174, s[63722] = 8482, s[63195] = 8482, s[63729] = 9127, s[63730] = 9128, s[63731] = 9129, s[63740] = 9131, s[63741] = 9132, s[63742] = 9133, s[63726] = 9121, s[63727] = 9122, s[63728] = 9123, s[63737] = 9124, s[63738] = 9125, s[63739] = 9126, s[63723] = 9115, s[63724] = 9116, s[63725] = 9117, s[63734] = 9118, s[63735] = 9119, s[63736] = 9120;
});
function M1(s, t) {
  let e = t[s];
  if (e !== void 0) return e;
  if (!s) return -1;
  if (s[0] === "u") {
    const i = s.length;
    let n;
    if (i === 7 && s[1] === "n" && s[2] === "i") n = s.substring(3);
    else {
      if (!(i >= 5 && i <= 7)) return -1;
      n = s.substring(1);
    }
    if (n === n.toUpperCase() && (e = parseInt(n, 16), e >= 0))
      return e;
  }
  return -1;
}
const Im = [[0, 127], [128, 255], [256, 383], [384, 591], [592, 687, 7424, 7551, 7552, 7615], [688, 767, 42752, 42783], [768, 879, 7616, 7679], [880, 1023], [11392, 11519], [1024, 1279, 1280, 1327, 11744, 11775, 42560, 42655], [1328, 1423], [1424, 1535], [42240, 42559], [1536, 1791, 1872, 1919], [1984, 2047], [2304, 2431], [2432, 2559], [2560, 2687], [2688, 2815], [2816, 2943], [2944, 3071], [3072, 3199], [3200, 3327], [3328, 3455], [3584, 3711], [3712, 3839], [4256, 4351, 11520, 11567], [6912, 7039], [4352, 4607], [7680, 7935, 11360, 11391, 42784, 43007], [7936, 8191], [8192, 8303, 11776, 11903], [8304, 8351], [8352, 8399], [8400, 8447], [8448, 8527], [8528, 8591], [8592, 8703, 10224, 10239, 10496, 10623, 11008, 11263], [8704, 8959, 10752, 11007, 10176, 10223, 10624, 10751], [8960, 9215], [9216, 9279], [9280, 9311], [9312, 9471], [9472, 9599], [9600, 9631], [9632, 9727], [9728, 9983], [9984, 10175], [12288, 12351], [12352, 12447], [12448, 12543, 12784, 12799], [12544, 12591, 12704, 12735], [12592, 12687], [43072, 43135], [12800, 13055], [13056, 13311], [44032, 55215], [55296, 57343], [67840, 67871], [19968, 40959, 11904, 12031, 12032, 12255, 12272, 12287, 13312, 19903, 131072, 173791, 12688, 12703], [57344, 63743], [12736, 12783, 63744, 64255, 194560, 195103], [64256, 64335], [64336, 65023], [65056, 65071], [65040, 65055], [65104, 65135], [65136, 65279], [65280, 65519], [65520, 65535], [3840, 4095], [1792, 1871], [1920, 1983], [3456, 3583], [4096, 4255], [4608, 4991, 4992, 5023, 11648, 11743], [5024, 5119], [5120, 5759], [5760, 5791], [5792, 5887], [6016, 6143], [6144, 6319], [10240, 10495], [40960, 42127], [5888, 5919, 5920, 5951, 5952, 5983, 5984, 6015], [66304, 66351], [66352, 66383], [66560, 66639], [118784, 119039, 119040, 119295, 119296, 119375], [119808, 120831], [1044480, 1048573], [65024, 65039, 917760, 917999], [917504, 917631], [6400, 6479], [6480, 6527], [6528, 6623], [6656, 6687], [11264, 11359], [11568, 11647], [19904, 19967], [43008, 43055], [65536, 65663, 65664, 65791, 65792, 65855], [65856, 65935], [66432, 66463], [66464, 66527], [66640, 66687], [66688, 66735], [67584, 67647], [68096, 68191], [119552, 119647], [73728, 74751, 74752, 74879], [119648, 119679], [7040, 7103], [7168, 7247], [7248, 7295], [43136, 43231], [43264, 43311], [43312, 43359], [43520, 43615], [65936, 65999], [66e3, 66047], [66208, 66271, 66176, 66207, 67872, 67903], [127024, 127135, 126976, 127023]];
function O_(s, t = -1) {
  if (t !== -1) {
    const e = Im[t];
    for (let i = 0, n = e.length; i < n; i += 2) if (s >= e[i] && s <= e[i + 1]) return t;
  }
  for (let e = 0, i = Im.length; e < i; e++) {
    const n = Im[e];
    for (let a = 0, r = n.length; a < r; a += 2) if (s >= n[a] && s <= n[a + 1]) return e;
  }
  return -1;
}
const U_ = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u"), r6 = /* @__PURE__ */ new Map(), h0 = !0, Jg = 1, _A = 2, Lp = 4, g4 = 32, p4 = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"];
function TA(s, t) {
  if (t[s] !== void 0) return s;
  const e = M1(s, t);
  if (e !== -1) {
    for (const i in t) if (t[i] === e) return i;
  }
  return qt("Unable to recover a standard glyph name for: " + s), s;
}
function EA(s, t, e) {
  const i = /* @__PURE__ */ Object.create(null);
  let n, a, r;
  const o = !!(s.flags & Lp);
  if (s.isInternalFont)
    for (r = t, a = 0; a < r.length; a++)
      n = e.indexOf(r[a]), i[a] = n >= 0 ? n : 0;
  else if (s.baseEncodingName)
    for (r = c0(s.baseEncodingName), a = 0; a < r.length; a++)
      n = e.indexOf(r[a]), i[a] = n >= 0 ? n : 0;
  else if (o) for (a in t) i[a] = t[a];
  else
    for (r = Ur, a = 0; a < r.length; a++)
      n = e.indexOf(r[a]), i[a] = n >= 0 ? n : 0;
  const l = s.differences;
  let c;
  if (l) for (a in l) {
    const h = l[a];
    if (n = e.indexOf(h), n === -1) {
      c || (c = ma());
      const u = TA(h, c);
      u !== h && (n = e.indexOf(u));
    }
    i[a] = n >= 0 ? n : 0;
  }
  return i;
}
function C2(s) {
  return s.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, "");
}
const q_ = Ee((s) => {
  s[8211] = 65074, s[8212] = 65073, s[8229] = 65072, s[8230] = 65049, s[12289] = 65041, s[12290] = 65042, s[12296] = 65087, s[12297] = 65088, s[12298] = 65085, s[12299] = 65086, s[12300] = 65089, s[12301] = 65090, s[12302] = 65091, s[12303] = 65092, s[12304] = 65083, s[12305] = 65084, s[12308] = 65081, s[12309] = 65082, s[12310] = 65047, s[12311] = 65048, s[65103] = 65076, s[65281] = 65045, s[65288] = 65077, s[65289] = 65078, s[65292] = 65040, s[65306] = 65043, s[65307] = 65044, s[65311] = 65046, s[65339] = 65095, s[65341] = 65096, s[65343] = 65075, s[65371] = 65079, s[65373] = 65080;
}), j_ = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron"], H_ = [".notdef", "space", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"], $_ = [".notdef", "space", "dollaroldstyle", "dollarsuperior", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "hyphensuperior", "colonmonetary", "onefitted", "rupiah", "centoldstyle", "figuredash", "hypheninferior", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior"], Zg = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"], _m = 391, Sh = [null, { id: "hstem", min: 2, stackClearing: !0, stem: !0 }, null, { id: "vstem", min: 2, stackClearing: !0, stem: !0 }, { id: "vmoveto", min: 1, stackClearing: !0 }, { id: "rlineto", min: 2, resetStack: !0 }, { id: "hlineto", min: 1, resetStack: !0 }, { id: "vlineto", min: 1, resetStack: !0 }, { id: "rrcurveto", min: 6, resetStack: !0 }, null, { id: "callsubr", min: 1, undefStack: !0 }, { id: "return", min: 0, undefStack: !0 }, null, null, { id: "endchar", min: 0, stackClearing: !0 }, null, null, null, { id: "hstemhm", min: 2, stackClearing: !0, stem: !0 }, { id: "hintmask", min: 0, stackClearing: !0 }, { id: "cntrmask", min: 0, stackClearing: !0 }, { id: "rmoveto", min: 2, stackClearing: !0 }, { id: "hmoveto", min: 1, stackClearing: !0 }, { id: "vstemhm", min: 2, stackClearing: !0, stem: !0 }, { id: "rcurveline", min: 8, resetStack: !0 }, { id: "rlinecurve", min: 8, resetStack: !0 }, { id: "vvcurveto", min: 4, resetStack: !0 }, { id: "hhcurveto", min: 4, resetStack: !0 }, null, { id: "callgsubr", min: 1, undefStack: !0 }, { id: "vhcurveto", min: 4, resetStack: !0 }, { id: "hvcurveto", min: 4, resetStack: !0 }], z_ = [null, null, null, { id: "and", min: 2, stackDelta: -1 }, { id: "or", min: 2, stackDelta: -1 }, { id: "not", min: 1, stackDelta: 0 }, null, null, null, { id: "abs", min: 1, stackDelta: 0 }, { id: "add", min: 2, stackDelta: -1, stackFn(s, t) {
  s[t - 2] = s[t - 2] + s[t - 1];
} }, { id: "sub", min: 2, stackDelta: -1, stackFn(s, t) {
  s[t - 2] = s[t - 2] - s[t - 1];
} }, { id: "div", min: 2, stackDelta: -1, stackFn(s, t) {
  s[t - 2] = s[t - 2] / s[t - 1];
} }, null, { id: "neg", min: 1, stackDelta: 0, stackFn(s, t) {
  s[t - 1] = -s[t - 1];
} }, { id: "eq", min: 2, stackDelta: -1 }, null, null, { id: "drop", min: 1, stackDelta: -1 }, null, { id: "put", min: 2, stackDelta: -2 }, { id: "get", min: 1, stackDelta: 0 }, { id: "ifelse", min: 4, stackDelta: -3 }, { id: "random", min: 0, stackDelta: 1 }, { id: "mul", min: 2, stackDelta: -1, stackFn(s, t) {
  s[t - 2] = s[t - 2] * s[t - 1];
} }, null, { id: "sqrt", min: 1, stackDelta: 0 }, { id: "dup", min: 1, stackDelta: 1 }, { id: "exch", min: 2, stackDelta: 0 }, { id: "index", min: 2, stackDelta: 0 }, { id: "roll", min: 3, stackDelta: -2 }, null, null, null, { id: "hflex", min: 7, resetStack: !0 }, { id: "flex", min: 13, resetStack: !0 }, { id: "hflex1", min: 9, resetStack: !0 }, { id: "flex1", min: 11, resetStack: !0 }];
class v7 {
  constructor(t, e, i) {
    this.bytes = t.getBytes(), this.properties = e, this.seacAnalysisEnabled = !!i;
  }
  parse() {
    const t = this.properties, e = new MA();
    this.cff = e;
    const i = this.parseHeader(), n = this.parseIndex(i.endPos), a = this.parseIndex(n.endPos), r = this.parseIndex(a.endPos), o = this.parseIndex(r.endPos), l = this.parseDict(a.obj.get(0)), c = this.createDict(u0, l, e.strings);
    e.header = i.obj, e.names = this.parseNameIndex(n.obj), e.strings = this.parseStringIndex(r.obj), e.topDict = c, e.globalSubrIndex = o.obj, this.parsePrivateDict(e.topDict), e.isCIDFont = c.hasName("ROS");
    const h = c.getByName("CharStrings"), u = this.parseIndex(h).obj, f = c.getByName("FontMatrix");
    f && (t.fontMatrix = f);
    const d = c.getByName("FontBBox");
    d && (t.ascent = Math.max(d[3], d[1]), t.descent = Math.min(d[1], d[3]), t.ascentScaled = !0);
    let p, m;
    if (e.isCIDFont) {
      const y = this.parseIndex(c.getByName("FDArray")).obj;
      for (let v = 0, w = y.count; v < w; ++v) {
        const A = y.get(v), x = this.createDict(u0, this.parseDict(A), e.strings);
        this.parsePrivateDict(x), e.fdArray.push(x);
      }
      m = null, p = this.parseCharsets(c.getByName("charset"), u.count, e.strings, !0), e.fdSelect = this.parseFDSelect(c.getByName("FDSelect"), u.count);
    } else
      p = this.parseCharsets(c.getByName("charset"), u.count, e.strings, !1), m = this.parseEncoding(c.getByName("Encoding"), t, e.strings, p.charset);
    e.charset = p, e.encoding = m;
    const b = this.parseCharStrings({ charStrings: u, localSubrIndex: c.privateDict.subrsIndex, globalSubrIndex: o.obj, fdSelect: e.fdSelect, fdArray: e.fdArray, privateDict: c.privateDict });
    return e.charStrings = b.charStrings, e.seacs = b.seacs, e.widths = b.widths, e;
  }
  parseHeader() {
    let t = this.bytes;
    const e = t.length;
    let i = 0;
    for (; i < e && t[i] !== 1; ) ++i;
    if (i >= e) throw new st("Invalid CFF header");
    i !== 0 && (qt("cff data is shifted"), t = t.subarray(i), this.bytes = t);
    const n = t[0], a = t[1], r = t[2], o = t[3];
    return { obj: new FA(n, a, r, o), endPos: r };
  }
  parseDict(t) {
    let e = 0;
    function i() {
      let o = t[e++];
      return o === 30 ? function() {
        let c = "";
        const u = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"], f = t.length;
        for (; e < f; ) {
          const d = t[e++], p = d >> 4, m = 15 & d;
          if (p === 15 || (c += u[p], m === 15)) break;
          c += u[m];
        }
        return parseFloat(c);
      }() : o === 28 ? (o = Nr(t, e), e += 2, o) : o === 29 ? (o = t[e++], o = o << 8 | t[e++], o = o << 8 | t[e++], o = o << 8 | t[e++], o) : o >= 32 && o <= 246 ? o - 139 : o >= 247 && o <= 250 ? 256 * (o - 247) + t[e++] + 108 : o >= 251 && o <= 254 ? -256 * (o - 251) - t[e++] - 108 : (D('CFFParser_parseDict: "' + o + '" is a reserved command.'), NaN);
    }
    let n = [];
    const a = [];
    e = 0;
    const r = t.length;
    for (; e < r; ) {
      let o = t[e];
      o <= 21 ? (o === 12 && (o = o << 8 | t[++e]), a.push([o, n]), n = [], ++e) : n.push(i());
    }
    return a;
  }
  parseIndex(t) {
    const e = new tl(), i = this.bytes, n = i[t++] << 8 | i[t++], a = [];
    let r, o, l = t;
    if (n !== 0) {
      const c = i[t++], h = t + (n + 1) * c - 1;
      for (r = 0, o = n + 1; r < o; ++r) {
        let u = 0;
        for (let f = 0; f < c; ++f)
          u <<= 8, u += i[t++];
        a.push(h + u);
      }
      l = a[n];
    }
    for (r = 0, o = a.length - 1; r < o; ++r) {
      const c = a[r], h = a[r + 1];
      e.add(i.subarray(c, h));
    }
    return { obj: e, endPos: l };
  }
  parseNameIndex(t) {
    const e = [];
    for (let i = 0, n = t.count; i < n; ++i) {
      const a = t.get(i);
      e.push(Si(a));
    }
    return e;
  }
  parseStringIndex(t) {
    const e = new A7();
    for (let i = 0, n = t.count; i < n; ++i) {
      const a = t.get(i);
      e.add(Si(a));
    }
    return e;
  }
  createDict(t, e, i) {
    const n = new t(i);
    for (const [a, r] of e) n.setByKey(a, r);
    return n;
  }
  parseCharString(t, e, i, n) {
    if (!e || t.callDepth > 10) return !1;
    let a = t.stackSize;
    const r = t.stack;
    let o = e.length;
    for (let l = 0; l < o; ) {
      const c = e[l++];
      let h = null;
      if (c === 12) {
        const u = e[l++];
        u === 0 ? (e[l - 2] = 139, e[l - 1] = 22, a = 0) : h = z_[u];
      } else if (c === 28)
        r[a] = Nr(e, l), l += 2, a++;
      else if (c === 14) {
        if (a >= 4 && (a -= 4, this.seacAnalysisEnabled))
          return t.seac = r.slice(a, a + 4), !1;
        h = Sh[c];
      } else if (c >= 32 && c <= 246)
        r[a] = c - 139, a++;
      else if (c >= 247 && c <= 254)
        r[a] = c < 251 ? (c - 247 << 8) + e[l] + 108 : -(c - 251 << 8) - e[l] - 108, l++, a++;
      else if (c === 255)
        r[a] = (e[l] << 24 | e[l + 1] << 16 | e[l + 2] << 8 | e[l + 3]) / 65536, l += 4, a++;
      else if (c === 19 || c === 20) {
        if (t.hints += a >> 1, t.hints === 0) {
          e.copyWithin(l - 1, l, -1), l -= 1, o -= 1;
          continue;
        }
        l += t.hints + 7 >> 3, a %= 2, h = Sh[c];
      } else {
        if (c === 10 || c === 29) {
          const u = c === 10 ? i : n;
          if (!u)
            return h = Sh[c], D("Missing subrsIndex for " + h.id), !1;
          let f = 32768;
          u.count < 1240 ? f = 107 : u.count < 33900 && (f = 1131);
          const d = r[--a] + f;
          if (d < 0 || d >= u.count || isNaN(d))
            return h = Sh[c], D("Out of bounds subrIndex for " + h.id), !1;
          if (t.stackSize = a, t.callDepth++, !this.parseCharString(t, u.get(d), i, n)) return !1;
          t.callDepth--, a = t.stackSize;
          continue;
        }
        if (c === 11)
          return t.stackSize = a, !0;
        if (c === 0 && l === e.length)
          e[l - 1] = 14, h = Sh[14];
        else {
          if (c === 9) {
            e.copyWithin(l - 1, l, -1), l -= 1, o -= 1;
            continue;
          }
          h = Sh[c];
        }
      }
      if (h) {
        if (h.stem && (t.hints += a >> 1, c === 3 || c === 23 ? t.hasVStems = !0 : t.hasVStems && (c === 1 || c === 18) && (D("CFF stem hints are in wrong order"), e[l - 1] = c === 1 ? 3 : 23)), "min" in h && !t.undefStack && a < h.min)
          return D("Not enough parameters for " + h.id + "; actual: " + a + ", expected: " + h.min), a === 0 ? (e[l - 1] = 14, !0) : !1;
        t.firstStackClearing && h.stackClearing && (t.firstStackClearing = !1, a -= h.min, a >= 2 && h.stem ? a %= 2 : a > 1 && D("Found too many parameters for stack-clearing command"), a > 0 && (t.width = r[a - 1])), "stackDelta" in h ? ("stackFn" in h && h.stackFn(r, a), a += h.stackDelta) : h.stackClearing ? a = 0 : h.resetStack ? (a = 0, t.undefStack = !1) : h.undefStack && (a = 0, t.undefStack = !0, t.firstStackClearing = !1);
      }
    }
    return o < e.length && e.fill(14, o), t.stackSize = a, !0;
  }
  parseCharStrings({ charStrings: t, localSubrIndex: e, globalSubrIndex: i, fdSelect: n, fdArray: a, privateDict: r }) {
    const o = [], l = [], c = t.count;
    for (let h = 0; h < c; h++) {
      const u = t.get(h), f = { callDepth: 0, stackSize: 0, stack: [], undefStack: !0, hints: 0, firstStackClearing: !0, seac: null, width: null, hasVStems: !1 };
      let d = !0, p = null, m = r;
      if (n && a.length) {
        const b = n.getFDIndex(h);
        b === -1 && (D("Glyph index is not in fd select."), d = !1), b >= a.length && (D("Invalid fd index for glyph index."), d = !1), d && (m = a[b].privateDict, p = m.subrsIndex);
      } else e && (p = e);
      if (d && (d = this.parseCharString(f, u, p, i)), f.width !== null) {
        const b = m.getByName("nominalWidthX");
        l[h] = b + f.width;
      } else {
        const b = m.getByName("defaultWidthX");
        l[h] = b;
      }
      f.seac !== null && (o[h] = f.seac), d || t.set(h, new Uint8Array([14]));
    }
    return { charStrings: t, seacs: o, widths: l };
  }
  emptyPrivateDictionary(t) {
    const e = this.createDict(d0, [], t.strings);
    t.setByKey(18, [0, 0]), t.privateDict = e;
  }
  parsePrivateDict(t) {
    if (!t.hasName("Private")) {
      this.emptyPrivateDictionary(t);
      return;
    }
    const e = t.getByName("Private");
    if (!Array.isArray(e) || e.length !== 2) {
      t.removeByName("Private");
      return;
    }
    const i = e[0], n = e[1];
    if (i === 0 || n >= this.bytes.length) {
      this.emptyPrivateDictionary(t);
      return;
    }
    const a = n + i, r = this.bytes.subarray(n, a), o = this.parseDict(r), l = this.createDict(d0, o, t.strings);
    if (t.privateDict = l, l.getByName("ExpansionFactor") === 0 && l.setByName("ExpansionFactor", 0.06), !l.getByName("Subrs")) return;
    const c = l.getByName("Subrs"), h = n + c;
    if (c === 0 || h >= this.bytes.length) {
      this.emptyPrivateDictionary(t);
      return;
    }
    const u = this.parseIndex(h);
    l.subrsIndex = u.obj;
  }
  parseCharsets(t, e, i, n) {
    if (t === 0) return new Fd(!0, Tm.ISO_ADOBE, j_);
    if (t === 1) return new Fd(!0, Tm.EXPERT, H_);
    if (t === 2) return new Fd(!0, Tm.EXPERT_SUBSET, $_);
    const a = this.bytes, r = t, o = a[t++], l = [n ? 0 : ".notdef"];
    let c, h, u;
    switch (e -= 1, o) {
      case 0:
        for (u = 0; u < e; u++)
          c = a[t++] << 8 | a[t++], l.push(n ? c : i.get(c));
        break;
      case 1:
        for (; l.length <= e; )
          for (c = a[t++] << 8 | a[t++], h = a[t++], u = 0; u <= h; u++) l.push(n ? c++ : i.get(c++));
        break;
      case 2:
        for (; l.length <= e; )
          for (c = a[t++] << 8 | a[t++], h = a[t++] << 8 | a[t++], u = 0; u <= h; u++) l.push(n ? c++ : i.get(c++));
        break;
      default:
        throw new st("Unknown charset format");
    }
    const f = t, d = a.subarray(r, f);
    return new Fd(!1, o, l, d);
  }
  parseEncoding(t, e, i, n) {
    const a = /* @__PURE__ */ Object.create(null), r = this.bytes;
    let o, l, c, h = !1, u = null;
    if (t === 0 || t === 1) {
      h = !0, o = t;
      const f = t ? IA : Ur;
      for (l = 0, c = n.length; l < c; l++) {
        const d = f.indexOf(n[l]);
        d !== -1 && (a[d] = l);
      }
    } else {
      const f = t;
      switch (o = r[t++], 127 & o) {
        case 0:
          const p = r[t++];
          for (l = 1; l <= p; l++) a[r[t++]] = l;
          break;
        case 1:
          const m = r[t++];
          let b = 1;
          for (l = 0; l < m; l++) {
            const y = r[t++], v = r[t++];
            for (let w = y; w <= y + v; w++) a[w] = b++;
          }
          break;
        default:
          throw new st(`Unknown encoding format: ${o} in CFF`);
      }
      const d = t;
      128 & o && (r[f] &= 127, function() {
        const m = r[t++];
        for (l = 0; l < m; l++) {
          const b = r[t++], y = (r[t++] << 8) + (255 & r[t++]);
          a[b] = n.indexOf(i.get(y));
        }
      }()), u = r.subarray(f, d);
    }
    return o &= 127, new W_(h, o, a, u);
  }
  parseFDSelect(t, e) {
    const i = this.bytes, n = i[t++], a = [];
    let r;
    switch (n) {
      case 0:
        for (r = 0; r < e; ++r) {
          const l = i[t++];
          a.push(l);
        }
        break;
      case 3:
        const o = i[t++] << 8 | i[t++];
        for (r = 0; r < o; ++r) {
          let l = i[t++] << 8 | i[t++];
          r === 0 && l !== 0 && (D("parseFDSelect: The first range must have a first GID of 0 -- trying to recover."), l = 0);
          const c = i[t++], h = i[t] << 8 | i[t + 1];
          for (let u = l; u < h; ++u) a.push(c);
        }
        t += 2;
        break;
      default:
        throw new st(`parseFDSelect: Unknown format "${n}".`);
    }
    if (a.length !== e) throw new st("parseFDSelect: Invalid font data.");
    return new X_(n, a);
  }
}
class MA {
  constructor() {
    this.header = null, this.names = [], this.topDict = null, this.strings = new A7(), this.globalSubrIndex = null, this.encoding = null, this.charset = null, this.charStrings = null, this.fdArray = [], this.fdSelect = null, this.isCIDFont = !1;
  }
  duplicateFirstGlyph() {
    if (this.charStrings.count >= 65535) {
      D("Not enough space in charstrings to duplicate first glyph.");
      return;
    }
    const t = this.charStrings.get(0);
    this.charStrings.add(t), this.isCIDFont && this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]);
  }
  hasGlyphId(t) {
    return t < 0 || t >= this.charStrings.count ? !1 : this.charStrings.get(t).length > 0;
  }
}
class FA {
  constructor(t, e, i, n) {
    this.major = t, this.minor = e, this.hdrSize = i, this.offSize = n;
  }
}
class A7 {
  constructor() {
    this.strings = [];
  }
  get(t) {
    return t >= 0 && t <= 390 ? Zg[t] : t - _m <= this.strings.length ? this.strings[t - _m] : Zg[0];
  }
  getSID(t) {
    let e = Zg.indexOf(t);
    return e !== -1 ? e : (e = this.strings.indexOf(t), e !== -1 ? e + _m : -1);
  }
  add(t) {
    this.strings.push(t);
  }
  get count() {
    return this.strings.length;
  }
}
class tl {
  constructor() {
    this.objects = [], this.length = 0;
  }
  add(t) {
    this.length += t.length, this.objects.push(t);
  }
  set(t, e) {
    this.length += e.length - this.objects[t].length, this.objects[t] = e;
  }
  get(t) {
    return this.objects[t];
  }
  get count() {
    return this.objects.length;
  }
}
class RA {
  constructor(t, e) {
    this.keyToNameMap = t.keyToNameMap, this.nameToKeyMap = t.nameToKeyMap, this.defaults = t.defaults, this.types = t.types, this.opcodes = t.opcodes, this.order = t.order, this.strings = e, this.values = /* @__PURE__ */ Object.create(null);
  }
  setByKey(t, e) {
    if (!(t in this.keyToNameMap)) return !1;
    if (e.length === 0) return !0;
    for (const n of e) if (isNaN(n))
      return D(`Invalid CFFDict value: "${e}" for key "${t}".`), !0;
    const i = this.types[t];
    return i !== "num" && i !== "sid" && i !== "offset" || (e = e[0]), this.values[t] = e, !0;
  }
  setByName(t, e) {
    if (!(t in this.nameToKeyMap)) throw new st(`Invalid dictionary name "${t}"`);
    this.values[this.nameToKeyMap[t]] = e;
  }
  hasName(t) {
    return this.nameToKeyMap[t] in this.values;
  }
  getByName(t) {
    if (!(t in this.nameToKeyMap)) throw new st(`Invalid dictionary name ${t}"`);
    const e = this.nameToKeyMap[t];
    return e in this.values ? this.values[e] : this.defaults[e];
  }
  removeByName(t) {
    delete this.values[this.nameToKeyMap[t]];
  }
  static createTables(t) {
    const e = { keyToNameMap: {}, nameToKeyMap: {}, defaults: {}, types: {}, opcodes: {}, order: [] };
    for (const i of t) {
      const n = Array.isArray(i[0]) ? (i[0][0] << 8) + i[0][1] : i[0];
      e.keyToNameMap[n] = i[1], e.nameToKeyMap[i[1]] = n, e.types[n] = i[2], e.defaults[n] = i[3], e.opcodes[n] = Array.isArray(i[0]) ? i[0] : [i[0]], e.order.push(n);
    }
    return e;
  }
}
const G_ = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [1e-3, 0, 0, 1e-3, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]];
class u0 extends RA {
  static get tables() {
    return gt(this, "tables", this.createTables(G_));
  }
  constructor(t) {
    super(u0.tables, t), this.privateDict = null;
  }
}
const V_ = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]];
class d0 extends RA {
  static get tables() {
    return gt(this, "tables", this.createTables(V_));
  }
  constructor(t) {
    super(d0.tables, t), this.subrsIndex = null;
  }
}
const Tm = { ISO_ADOBE: 0, EXPERT: 1, EXPERT_SUBSET: 2 };
class Fd {
  constructor(t, e, i, n) {
    this.predefined = t, this.format = e, this.charset = i, this.raw = n;
  }
}
class W_ {
  constructor(t, e, i, n) {
    this.predefined = t, this.format = e, this.encoding = i, this.raw = n;
  }
}
class X_ {
  constructor(t, e) {
    this.format = t, this.fdSelect = e;
  }
  getFDIndex(t) {
    return t < 0 || t >= this.fdSelect.length ? -1 : this.fdSelect[t];
  }
}
class m4 {
  constructor() {
    this.offsets = /* @__PURE__ */ Object.create(null);
  }
  isTracking(t) {
    return t in this.offsets;
  }
  track(t, e) {
    if (t in this.offsets) throw new st(`Already tracking location of ${t}`);
    this.offsets[t] = e;
  }
  offset(t) {
    for (const e in this.offsets) this.offsets[e] += t;
  }
  setEntryLocation(t, e, i) {
    if (!(t in this.offsets)) throw new st(`Not tracking location of ${t}`);
    const n = i.data, a = this.offsets[t];
    for (let r = 0, o = e.length; r < o; ++r) {
      const l = 5 * r + a, c = l + 1, h = l + 2, u = l + 3, f = l + 4;
      if (n[l] !== 29 || n[c] !== 0 || n[h] !== 0 || n[u] !== 0 || n[f] !== 0) throw new st("writing to an offset that is not empty");
      const d = e[r];
      n[l] = 29, n[c] = d >> 24 & 255, n[h] = d >> 16 & 255, n[u] = d >> 8 & 255, n[f] = 255 & d;
    }
  }
}
class I2 {
  constructor(t) {
    this.cff = t;
  }
  compile() {
    const t = this.cff, e = { data: [], length: 0, add(f) {
      try {
        this.data.push(...f);
      } catch {
        this.data = this.data.concat(f);
      }
      this.length = this.data.length;
    } }, i = this.compileHeader(t.header);
    e.add(i);
    const n = this.compileNameIndex(t.names);
    if (e.add(n), t.isCIDFont && t.topDict.hasName("FontMatrix")) {
      const f = t.topDict.getByName("FontMatrix");
      t.topDict.removeByName("FontMatrix");
      for (const d of t.fdArray) {
        let p = f.slice(0);
        d.hasName("FontMatrix") && (p = se.transform(p, d.getByName("FontMatrix"))), d.setByName("FontMatrix", p);
      }
    }
    const a = t.topDict.getByName("XUID");
    (a == null ? void 0 : a.length) > 16 && t.topDict.removeByName("XUID"), t.topDict.setByName("charset", 0);
    let r = this.compileTopDicts([t.topDict], e.length, t.isCIDFont);
    e.add(r.output);
    const o = r.trackers[0], l = this.compileStringIndex(t.strings.strings);
    e.add(l);
    const c = this.compileIndex(t.globalSubrIndex);
    if (e.add(c), t.encoding && t.topDict.hasName("Encoding")) if (t.encoding.predefined) o.setEntryLocation("Encoding", [t.encoding.format], e);
    else {
      const f = this.compileEncoding(t.encoding);
      o.setEntryLocation("Encoding", [e.length], e), e.add(f);
    }
    const h = this.compileCharset(t.charset, t.charStrings.count, t.strings, t.isCIDFont);
    o.setEntryLocation("charset", [e.length], e), e.add(h);
    const u = this.compileCharStrings(t.charStrings);
    if (o.setEntryLocation("CharStrings", [e.length], e), e.add(u), t.isCIDFont) {
      o.setEntryLocation("FDSelect", [e.length], e);
      const f = this.compileFDSelect(t.fdSelect);
      e.add(f), r = this.compileTopDicts(t.fdArray, e.length, !0), o.setEntryLocation("FDArray", [e.length], e), e.add(r.output);
      const d = r.trackers;
      this.compilePrivateDicts(t.fdArray, d, e);
    }
    return this.compilePrivateDicts([t.topDict], [o], e), e.add([0]), e.data;
  }
  encodeNumber(t) {
    return Number.isInteger(t) ? this.encodeInteger(t) : this.encodeFloat(t);
  }
  static get EncodeFloatRegExp() {
    return gt(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/);
  }
  encodeFloat(t) {
    let e = t.toString();
    const i = I2.EncodeFloatRegExp.exec(e);
    if (i) {
      const l = parseFloat("1e" + ((i[2] ? +i[2] : 0) + i[1].length));
      e = (Math.round(t * l) / l).toString();
    }
    let n, a, r = "";
    for (n = 0, a = e.length; n < a; ++n) {
      const l = e[n];
      r += l === "e" ? e[++n] === "-" ? "c" : "b" : l === "." ? "a" : l === "-" ? "e" : l;
    }
    r += 1 & r.length ? "f" : "ff";
    const o = [30];
    for (n = 0, a = r.length; n < a; n += 2) o.push(parseInt(r.substring(n, n + 2), 16));
    return o;
  }
  encodeInteger(t) {
    let e;
    return e = t >= -107 && t <= 107 ? [t + 139] : t >= 108 && t <= 1131 ? [247 + ((t -= 108) >> 8), 255 & t] : t >= -1131 && t <= -108 ? [251 + ((t = -t - 108) >> 8), 255 & t] : t >= -32768 && t <= 32767 ? [28, t >> 8 & 255, 255 & t] : [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t], e;
  }
  compileHeader(t) {
    return [t.major, t.minor, 4, t.offSize];
  }
  compileNameIndex(t) {
    const e = new tl();
    for (const i of t) {
      const n = Math.min(i.length, 127);
      let a = new Array(n);
      for (let r = 0; r < n; r++) {
        let o = i[r];
        (o < "!" || o > "~" || o === "[" || o === "]" || o === "(" || o === ")" || o === "{" || o === "}" || o === "<" || o === ">" || o === "/" || o === "%") && (o = "_"), a[r] = o;
      }
      a = a.join(""), a === "" && (a = "Bad_Font_Name"), e.add(Ns(a));
    }
    return this.compileIndex(e);
  }
  compileTopDicts(t, e, i) {
    const n = [];
    let a = new tl();
    for (const r of t) {
      i && (r.removeByName("CIDFontVersion"), r.removeByName("CIDFontRevision"), r.removeByName("CIDFontType"), r.removeByName("CIDCount"), r.removeByName("UIDBase"));
      const o = new m4(), l = this.compileDict(r, o);
      n.push(o), a.add(l), o.offset(e);
    }
    return a = this.compileIndex(a, n), { trackers: n, output: a };
  }
  compilePrivateDicts(t, e, i) {
    for (let n = 0, a = t.length; n < a; ++n) {
      const r = t[n], o = r.privateDict;
      if (!o || !r.hasName("Private")) throw new st("There must be a private dictionary.");
      const l = new m4(), c = this.compileDict(o, l);
      let h = i.length;
      if (l.offset(h), c.length || (h = 0), e[n].setEntryLocation("Private", [c.length, h], i), i.add(c), o.subrsIndex && o.hasName("Subrs")) {
        const u = this.compileIndex(o.subrsIndex);
        l.setEntryLocation("Subrs", [c.length], i), i.add(u);
      }
    }
  }
  compileDict(t, e) {
    const i = [];
    for (const n of t.order) {
      if (!(n in t.values)) continue;
      let a = t.values[n], r = t.types[n];
      if (Array.isArray(r) || (r = [r]), Array.isArray(a) || (a = [a]), a.length !== 0) {
        for (let o = 0, l = r.length; o < l; ++o) {
          const c = r[o], h = a[o];
          switch (c) {
            case "num":
            case "sid":
              i.push(...this.encodeNumber(h));
              break;
            case "offset":
              const u = t.keyToNameMap[n];
              e.isTracking(u) || e.track(u, i.length), i.push(29, 0, 0, 0, 0);
              break;
            case "array":
            case "delta":
              i.push(...this.encodeNumber(h));
              for (let f = 1, d = a.length; f < d; ++f) i.push(...this.encodeNumber(a[f]));
              break;
            default:
              throw new st(`Unknown data type of ${c}`);
          }
        }
        i.push(...t.opcodes[n]);
      }
    }
    return i;
  }
  compileStringIndex(t) {
    const e = new tl();
    for (const i of t) e.add(Ns(i));
    return this.compileIndex(e);
  }
  compileCharStrings(t) {
    const e = new tl();
    for (let i = 0; i < t.count; i++) {
      const n = t.get(i);
      n.length !== 0 ? e.add(n) : e.add(new Uint8Array([139, 14]));
    }
    return this.compileIndex(e);
  }
  compileCharset(t, e, i, n) {
    let a;
    const r = e - 1;
    if (n) {
      const o = r - 1;
      a = new Uint8Array([2, 0, 0, o >> 8 & 255, 255 & o]);
    } else {
      a = new Uint8Array(1 + 2 * r), a[0] = 0;
      let o = 0;
      const l = t.charset.length;
      let c = !1;
      for (let h = 1; h < a.length; h += 2) {
        let u = 0;
        if (o < l) {
          const f = t.charset[o++];
          u = i.getSID(f), u === -1 && (u = 0, c || (c = !0, D(`Couldn't find ${f} in CFF strings`)));
        }
        a[h] = u >> 8 & 255, a[h + 1] = 255 & u;
      }
    }
    return this.compileTypedArray(a);
  }
  compileEncoding(t) {
    return this.compileTypedArray(t.raw);
  }
  compileFDSelect(t) {
    const e = t.format;
    let i, n;
    switch (e) {
      case 0:
        for (i = new Uint8Array(1 + t.fdSelect.length), i[0] = e, n = 0; n < t.fdSelect.length; n++) i[n + 1] = t.fdSelect[n];
        break;
      case 3:
        const a = 0;
        let r = t.fdSelect[0];
        const o = [e, 0, 0, a >> 8 & 255, 255 & a, r];
        for (n = 1; n < t.fdSelect.length; n++) {
          const c = t.fdSelect[n];
          c !== r && (o.push(n >> 8 & 255, 255 & n, c), r = c);
        }
        const l = (o.length - 3) / 3;
        o[1] = l >> 8 & 255, o[2] = 255 & l, o.push(n >> 8 & 255, 255 & n), i = new Uint8Array(o);
    }
    return this.compileTypedArray(i);
  }
  compileTypedArray(t) {
    return Array.from(t);
  }
  compileIndex(t, e = []) {
    const i = t.objects, n = i.length;
    if (n === 0) return [0, 0];
    const a = [n >> 8 & 255, 255 & n];
    let r, o, l = 1;
    for (r = 0; r < n; ++r) l += i[r].length;
    o = l < 256 ? 1 : l < 65536 ? 2 : l < 16777216 ? 3 : 4, a.push(o);
    let c = 1;
    for (r = 0; r < n + 1; r++)
      o === 1 ? a.push(255 & c) : o === 2 ? a.push(c >> 8 & 255, 255 & c) : o === 3 ? a.push(c >> 16 & 255, c >> 8 & 255, 255 & c) : a.push(c >>> 24 & 255, c >> 16 & 255, c >> 8 & 255, 255 & c), i[r] && (c += i[r].length);
    for (r = 0; r < n; r++)
      e[r] && e[r].offset(a.length), a.push(...i[r]);
    return a;
  }
}
const J9 = Ee(function(s) {
  s["Times-Roman"] = "Times-Roman", s.Helvetica = "Helvetica", s.Courier = "Courier", s.Symbol = "Symbol", s["Times-Bold"] = "Times-Bold", s["Helvetica-Bold"] = "Helvetica-Bold", s["Courier-Bold"] = "Courier-Bold", s.ZapfDingbats = "ZapfDingbats", s["Times-Italic"] = "Times-Italic", s["Helvetica-Oblique"] = "Helvetica-Oblique", s["Courier-Oblique"] = "Courier-Oblique", s["Times-BoldItalic"] = "Times-BoldItalic", s["Helvetica-BoldOblique"] = "Helvetica-BoldOblique", s["Courier-BoldOblique"] = "Courier-BoldOblique", s.ArialNarrow = "Helvetica", s["ArialNarrow-Bold"] = "Helvetica-Bold", s["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique", s["ArialNarrow-Italic"] = "Helvetica-Oblique", s.ArialBlack = "Helvetica", s["ArialBlack-Bold"] = "Helvetica-Bold", s["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique", s["ArialBlack-Italic"] = "Helvetica-Oblique", s["Arial-Black"] = "Helvetica", s["Arial-Black-Bold"] = "Helvetica-Bold", s["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique", s["Arial-Black-Italic"] = "Helvetica-Oblique", s.Arial = "Helvetica", s["Arial-Bold"] = "Helvetica-Bold", s["Arial-BoldItalic"] = "Helvetica-BoldOblique", s["Arial-Italic"] = "Helvetica-Oblique", s.ArialMT = "Helvetica", s["Arial-BoldItalicMT"] = "Helvetica-BoldOblique", s["Arial-BoldMT"] = "Helvetica-Bold", s["Arial-ItalicMT"] = "Helvetica-Oblique", s["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique", s["Arial-BoldMT-Bold"] = "Helvetica-Bold", s["Arial-ItalicMT-Italic"] = "Helvetica-Oblique", s.ArialUnicodeMS = "Helvetica", s["ArialUnicodeMS-Bold"] = "Helvetica-Bold", s["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique", s["ArialUnicodeMS-Italic"] = "Helvetica-Oblique", s["Courier-BoldItalic"] = "Courier-BoldOblique", s["Courier-Italic"] = "Courier-Oblique", s.CourierNew = "Courier", s["CourierNew-Bold"] = "Courier-Bold", s["CourierNew-BoldItalic"] = "Courier-BoldOblique", s["CourierNew-Italic"] = "Courier-Oblique", s["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique", s["CourierNewPS-BoldMT"] = "Courier-Bold", s["CourierNewPS-ItalicMT"] = "Courier-Oblique", s.CourierNewPSMT = "Courier", s["Helvetica-BoldItalic"] = "Helvetica-BoldOblique", s["Helvetica-Italic"] = "Helvetica-Oblique", s["HelveticaLTStd-Bold"] = "Helvetica-Bold", s["Symbol-Bold"] = "Symbol", s["Symbol-BoldItalic"] = "Symbol", s["Symbol-Italic"] = "Symbol", s.TimesNewRoman = "Times-Roman", s["TimesNewRoman-Bold"] = "Times-Bold", s["TimesNewRoman-BoldItalic"] = "Times-BoldItalic", s["TimesNewRoman-Italic"] = "Times-Italic", s.TimesNewRomanPS = "Times-Roman", s["TimesNewRomanPS-Bold"] = "Times-Bold", s["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic", s["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic", s["TimesNewRomanPS-BoldMT"] = "Times-Bold", s["TimesNewRomanPS-Italic"] = "Times-Italic", s["TimesNewRomanPS-ItalicMT"] = "Times-Italic", s.TimesNewRomanPSMT = "Times-Roman", s["TimesNewRomanPSMT-Bold"] = "Times-Bold", s["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic", s["TimesNewRomanPSMT-Italic"] = "Times-Italic";
}), K_ = Ee(function(s) {
  s.Courier = "FoxitFixed.pfb", s["Courier-Bold"] = "FoxitFixedBold.pfb", s["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb", s["Courier-Oblique"] = "FoxitFixedItalic.pfb", s.Helvetica = "LiberationSans-Regular.ttf", s["Helvetica-Bold"] = "LiberationSans-Bold.ttf", s["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf", s["Helvetica-Oblique"] = "LiberationSans-Italic.ttf", s["Times-Roman"] = "FoxitSerif.pfb", s["Times-Bold"] = "FoxitSerifBold.pfb", s["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb", s["Times-Italic"] = "FoxitSerifItalic.pfb", s.Symbol = "FoxitSymbol.pfb", s.ZapfDingbats = "FoxitDingbats.pfb", s["LiberationSans-Regular"] = "LiberationSans-Regular.ttf", s["LiberationSans-Bold"] = "LiberationSans-Bold.ttf", s["LiberationSans-Italic"] = "LiberationSans-Italic.ttf", s["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf";
}), PA = Ee(function(s) {
  s.Calibri = "Helvetica", s["Calibri-Bold"] = "Helvetica-Bold", s["Calibri-BoldItalic"] = "Helvetica-BoldOblique", s["Calibri-Italic"] = "Helvetica-Oblique", s.CenturyGothic = "Helvetica", s["CenturyGothic-Bold"] = "Helvetica-Bold", s["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique", s["CenturyGothic-Italic"] = "Helvetica-Oblique", s.ComicSansMS = "Comic Sans MS", s["ComicSansMS-Bold"] = "Comic Sans MS-Bold", s["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic", s["ComicSansMS-Italic"] = "Comic Sans MS-Italic", s.GillSansMT = "Helvetica", s["GillSansMT-Bold"] = "Helvetica-Bold", s["GillSansMT-BoldItalic"] = "Helvetica-BoldOblique", s["GillSansMT-Italic"] = "Helvetica-Oblique", s.Impact = "Helvetica", s["ItcSymbol-Bold"] = "Helvetica-Bold", s["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique", s["ItcSymbol-Book"] = "Helvetica", s["ItcSymbol-BookItalic"] = "Helvetica-Oblique", s["ItcSymbol-Medium"] = "Helvetica", s["ItcSymbol-MediumItalic"] = "Helvetica-Oblique", s.LucidaConsole = "Courier", s["LucidaConsole-Bold"] = "Courier-Bold", s["LucidaConsole-BoldItalic"] = "Courier-BoldOblique", s["LucidaConsole-Italic"] = "Courier-Oblique", s["LucidaSans-Demi"] = "Helvetica-Bold", s["MS-Gothic"] = "MS Gothic", s["MS-Gothic-Bold"] = "MS Gothic-Bold", s["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic", s["MS-Gothic-Italic"] = "MS Gothic-Italic", s["MS-Mincho"] = "MS Mincho", s["MS-Mincho-Bold"] = "MS Mincho-Bold", s["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic", s["MS-Mincho-Italic"] = "MS Mincho-Italic", s["MS-PGothic"] = "MS PGothic", s["MS-PGothic-Bold"] = "MS PGothic-Bold", s["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic", s["MS-PGothic-Italic"] = "MS PGothic-Italic", s["MS-PMincho"] = "MS PMincho", s["MS-PMincho-Bold"] = "MS PMincho-Bold", s["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic", s["MS-PMincho-Italic"] = "MS PMincho-Italic", s.NuptialScript = "Times-Italic", s.SegoeUISymbol = "Helvetica";
}), x7 = Ee(function(s) {
  s["Adobe Jenson"] = !0, s["Adobe Text"] = !0, s.Albertus = !0, s.Aldus = !0, s.Alexandria = !0, s.Algerian = !0, s["American Typewriter"] = !0, s.Antiqua = !0, s.Apex = !0, s.Arno = !0, s.Aster = !0, s.Aurora = !0, s.Baskerville = !0, s.Bell = !0, s.Bembo = !0, s["Bembo Schoolbook"] = !0, s.Benguiat = !0, s["Berkeley Old Style"] = !0, s["Bernhard Modern"] = !0, s["Berthold City"] = !0, s.Bodoni = !0, s["Bauer Bodoni"] = !0, s["Book Antiqua"] = !0, s.Bookman = !0, s["Bordeaux Roman"] = !0, s["Californian FB"] = !0, s.Calisto = !0, s.Calvert = !0, s.Capitals = !0, s.Cambria = !0, s.Cartier = !0, s.Caslon = !0, s.Catull = !0, s.Centaur = !0, s["Century Old Style"] = !0, s["Century Schoolbook"] = !0, s.Chaparral = !0, s["Charis SIL"] = !0, s.Cheltenham = !0, s["Cholla Slab"] = !0, s.Clarendon = !0, s.Clearface = !0, s.Cochin = !0, s.Colonna = !0, s["Computer Modern"] = !0, s["Concrete Roman"] = !0, s.Constantia = !0, s["Cooper Black"] = !0, s.Corona = !0, s.Ecotype = !0, s.Egyptienne = !0, s.Elephant = !0, s.Excelsior = !0, s.Fairfield = !0, s["FF Scala"] = !0, s.Folkard = !0, s.Footlight = !0, s.FreeSerif = !0, s["Friz Quadrata"] = !0, s.Garamond = !0, s.Gentium = !0, s.Georgia = !0, s.Gloucester = !0, s["Goudy Old Style"] = !0, s["Goudy Schoolbook"] = !0, s["Goudy Pro Font"] = !0, s.Granjon = !0, s["Guardian Egyptian"] = !0, s.Heather = !0, s.Hercules = !0, s["High Tower Text"] = !0, s.Hiroshige = !0, s["Hoefler Text"] = !0, s["Humana Serif"] = !0, s.Imprint = !0, s["Ionic No. 5"] = !0, s.Janson = !0, s.Joanna = !0, s.Korinna = !0, s.Lexicon = !0, s.LiberationSerif = !0, s["Liberation Serif"] = !0, s["Linux Libertine"] = !0, s.Literaturnaya = !0, s.Lucida = !0, s["Lucida Bright"] = !0, s.Melior = !0, s.Memphis = !0, s.Miller = !0, s.Minion = !0, s.Modern = !0, s["Mona Lisa"] = !0, s["Mrs Eaves"] = !0, s["MS Serif"] = !0, s["Museo Slab"] = !0, s["New York"] = !0, s["Nimbus Roman"] = !0, s["NPS Rawlinson Roadway"] = !0, s.NuptialScript = !0, s.Palatino = !0, s.Perpetua = !0, s.Plantin = !0, s["Plantin Schoolbook"] = !0, s.Playbill = !0, s["Poor Richard"] = !0, s["Rawlinson Roadway"] = !0, s.Renault = !0, s.Requiem = !0, s.Rockwell = !0, s.Roman = !0, s["Rotis Serif"] = !0, s.Sabon = !0, s.Scala = !0, s.Seagull = !0, s.Sistina = !0, s.Souvenir = !0, s.STIX = !0, s["Stone Informal"] = !0, s["Stone Serif"] = !0, s.Sylfaen = !0, s.Times = !0, s.Trajan = !0, s.Trinité = !0, s["Trump Mediaeval"] = !0, s.Utopia = !0, s["Vale Type"] = !0, s["Bitstream Vera"] = !0, s["Vera Serif"] = !0, s.Versailles = !0, s.Wanted = !0, s.Weiss = !0, s["Wide Latin"] = !0, s.Windsor = !0, s.XITS = !0;
}), o6 = Ee(function(s) {
  s.Dingbats = !0, s.Symbol = !0, s.ZapfDingbats = !0, s.Wingdings = !0, s["Wingdings-Bold"] = !0, s["Wingdings-Regular"] = !0;
}), b4 = Ee(function(s) {
  s[2] = 10, s[3] = 32, s[4] = 33, s[5] = 34, s[6] = 35, s[7] = 36, s[8] = 37, s[9] = 38, s[10] = 39, s[11] = 40, s[12] = 41, s[13] = 42, s[14] = 43, s[15] = 44, s[16] = 45, s[17] = 46, s[18] = 47, s[19] = 48, s[20] = 49, s[21] = 50, s[22] = 51, s[23] = 52, s[24] = 53, s[25] = 54, s[26] = 55, s[27] = 56, s[28] = 57, s[29] = 58, s[30] = 894, s[31] = 60, s[32] = 61, s[33] = 62, s[34] = 63, s[35] = 64, s[36] = 65, s[37] = 66, s[38] = 67, s[39] = 68, s[40] = 69, s[41] = 70, s[42] = 71, s[43] = 72, s[44] = 73, s[45] = 74, s[46] = 75, s[47] = 76, s[48] = 77, s[49] = 78, s[50] = 79, s[51] = 80, s[52] = 81, s[53] = 82, s[54] = 83, s[55] = 84, s[56] = 85, s[57] = 86, s[58] = 87, s[59] = 88, s[60] = 89, s[61] = 90, s[62] = 91, s[63] = 92, s[64] = 93, s[65] = 94, s[66] = 95, s[67] = 96, s[68] = 97, s[69] = 98, s[70] = 99, s[71] = 100, s[72] = 101, s[73] = 102, s[74] = 103, s[75] = 104, s[76] = 105, s[77] = 106, s[78] = 107, s[79] = 108, s[80] = 109, s[81] = 110, s[82] = 111, s[83] = 112, s[84] = 113, s[85] = 114, s[86] = 115, s[87] = 116, s[88] = 117, s[89] = 118, s[90] = 119, s[91] = 120, s[92] = 121, s[93] = 122, s[94] = 123, s[95] = 124, s[96] = 125, s[97] = 126, s[98] = 196, s[99] = 197, s[100] = 199, s[101] = 201, s[102] = 209, s[103] = 214, s[104] = 220, s[105] = 225, s[106] = 224, s[107] = 226, s[108] = 228, s[109] = 227, s[110] = 229, s[111] = 231, s[112] = 233, s[113] = 232, s[114] = 234, s[115] = 235, s[116] = 237, s[117] = 236, s[118] = 238, s[119] = 239, s[120] = 241, s[121] = 243, s[122] = 242, s[123] = 244, s[124] = 246, s[125] = 245, s[126] = 250, s[127] = 249, s[128] = 251, s[129] = 252, s[130] = 8224, s[131] = 176, s[132] = 162, s[133] = 163, s[134] = 167, s[135] = 8226, s[136] = 182, s[137] = 223, s[138] = 174, s[139] = 169, s[140] = 8482, s[141] = 180, s[142] = 168, s[143] = 8800, s[144] = 198, s[145] = 216, s[146] = 8734, s[147] = 177, s[148] = 8804, s[149] = 8805, s[150] = 165, s[151] = 181, s[152] = 8706, s[153] = 8721, s[154] = 8719, s[156] = 8747, s[157] = 170, s[158] = 186, s[159] = 8486, s[160] = 230, s[161] = 248, s[162] = 191, s[163] = 161, s[164] = 172, s[165] = 8730, s[166] = 402, s[167] = 8776, s[168] = 8710, s[169] = 171, s[170] = 187, s[171] = 8230, s[179] = 8220, s[180] = 8221, s[181] = 8216, s[182] = 8217, s[200] = 193, s[203] = 205, s[207] = 211, s[210] = 218, s[223] = 711, s[224] = 321, s[225] = 322, s[226] = 352, s[227] = 353, s[228] = 381, s[229] = 382, s[233] = 221, s[234] = 253, s[252] = 263, s[253] = 268, s[254] = 269, s[258] = 258, s[260] = 260, s[261] = 261, s[265] = 280, s[266] = 281, s[267] = 282, s[268] = 283, s[269] = 313, s[275] = 323, s[276] = 324, s[278] = 328, s[283] = 344, s[284] = 345, s[285] = 346, s[286] = 347, s[292] = 367, s[295] = 377, s[296] = 378, s[298] = 380, s[305] = 963, s[306] = 964, s[307] = 966, s[308] = 8215, s[309] = 8252, s[310] = 8319, s[311] = 8359, s[312] = 8592, s[313] = 8593, s[337] = 9552, s[493] = 1039, s[494] = 1040, s[570] = 1040, s[571] = 1041, s[572] = 1042, s[573] = 1043, s[574] = 1044, s[575] = 1045, s[576] = 1046, s[577] = 1047, s[578] = 1048, s[579] = 1049, s[580] = 1050, s[581] = 1051, s[582] = 1052, s[583] = 1053, s[584] = 1054, s[585] = 1055, s[586] = 1056, s[587] = 1057, s[588] = 1058, s[589] = 1059, s[590] = 1060, s[591] = 1061, s[592] = 1062, s[593] = 1063, s[594] = 1064, s[595] = 1065, s[596] = 1066, s[597] = 1067, s[598] = 1068, s[599] = 1069, s[600] = 1070, s[672] = 1488, s[673] = 1489, s[674] = 1490, s[675] = 1491, s[676] = 1492, s[677] = 1493, s[678] = 1494, s[679] = 1495, s[680] = 1496, s[681] = 1497, s[682] = 1498, s[683] = 1499, s[684] = 1500, s[685] = 1501, s[686] = 1502, s[687] = 1503, s[688] = 1504, s[689] = 1505, s[690] = 1506, s[691] = 1507, s[692] = 1508, s[693] = 1509, s[694] = 1510, s[695] = 1511, s[696] = 1512, s[697] = 1513, s[698] = 1514, s[705] = 1524, s[706] = 8362, s[710] = 64288, s[711] = 64298, s[759] = 1617, s[761] = 1776, s[763] = 1778, s[775] = 1652, s[777] = 1764, s[778] = 1780, s[779] = 1781, s[780] = 1782, s[782] = 771, s[783] = 64726, s[786] = 8363, s[788] = 8532, s[790] = 768, s[791] = 769, s[792] = 768, s[795] = 803, s[797] = 64336, s[798] = 64337, s[799] = 64342, s[800] = 64343, s[801] = 64344, s[802] = 64345, s[803] = 64362, s[804] = 64363, s[805] = 64364, s[2424] = 7821, s[2425] = 7822, s[2426] = 7823, s[2427] = 7824, s[2428] = 7825, s[2429] = 7826, s[2430] = 7827, s[2433] = 7682, s[2678] = 8045, s[2679] = 8046, s[2830] = 1552, s[2838] = 686, s[2840] = 751, s[2842] = 753, s[2843] = 754, s[2844] = 755, s[2846] = 757, s[2856] = 767, s[2857] = 848, s[2858] = 849, s[2862] = 853, s[2863] = 854, s[2864] = 855, s[2865] = 861, s[2866] = 862, s[2906] = 7460, s[2908] = 7462, s[2909] = 7463, s[2910] = 7464, s[2912] = 7466, s[2913] = 7467, s[2914] = 7468, s[2916] = 7470, s[2917] = 7471, s[2918] = 7472, s[2920] = 7474, s[2921] = 7475, s[2922] = 7476, s[2924] = 7478, s[2925] = 7479, s[2926] = 7480, s[2928] = 7482, s[2929] = 7483, s[2930] = 7484, s[2932] = 7486, s[2933] = 7487, s[2934] = 7488, s[2936] = 7490, s[2937] = 7491, s[2938] = 7492, s[2940] = 7494, s[2941] = 7495, s[2942] = 7496, s[2944] = 7498, s[2946] = 7500, s[2948] = 7502, s[2950] = 7504, s[2951] = 7505, s[2952] = 7506, s[2954] = 7508, s[2955] = 7509, s[2956] = 7510, s[2958] = 7512, s[2959] = 7513, s[2960] = 7514, s[2962] = 7516, s[2963] = 7517, s[2964] = 7518, s[2966] = 7520, s[2967] = 7521, s[2968] = 7522, s[2970] = 7524, s[2971] = 7525, s[2972] = 7526, s[2974] = 7528, s[2975] = 7529, s[2976] = 7530, s[2978] = 1537, s[2979] = 1538, s[2980] = 1539, s[2982] = 1549, s[2983] = 1551, s[2984] = 1552, s[2986] = 1554, s[2987] = 1555, s[2988] = 1556, s[2990] = 1623, s[2991] = 1624, s[2995] = 1775, s[2999] = 1791, s[3002] = 64290, s[3003] = 64291, s[3004] = 64292, s[3006] = 64294, s[3007] = 64295, s[3008] = 64296, s[3011] = 1900, s[3014] = 8223, s[3015] = 8244, s[3017] = 7532, s[3018] = 7533, s[3019] = 7534, s[3075] = 7590, s[3076] = 7591, s[3079] = 7594, s[3080] = 7595, s[3083] = 7598, s[3084] = 7599, s[3087] = 7602, s[3088] = 7603, s[3091] = 7606, s[3092] = 7607, s[3095] = 7610, s[3096] = 7611, s[3099] = 7614, s[3100] = 7615, s[3103] = 7618, s[3104] = 7619, s[3107] = 8337, s[3108] = 8338, s[3116] = 1884, s[3119] = 1885, s[3120] = 1885, s[3123] = 1886, s[3124] = 1886, s[3127] = 1887, s[3128] = 1887, s[3131] = 1888, s[3132] = 1888, s[3135] = 1889, s[3136] = 1889, s[3139] = 1890, s[3140] = 1890, s[3143] = 1891, s[3144] = 1891, s[3147] = 1892, s[3148] = 1892, s[3153] = 580, s[3154] = 581, s[3157] = 584, s[3158] = 585, s[3161] = 588, s[3162] = 589, s[3165] = 891, s[3166] = 892, s[3169] = 1274, s[3170] = 1275, s[3173] = 1278, s[3174] = 1279, s[3181] = 7622, s[3182] = 7623, s[3282] = 11799, s[3316] = 578, s[3379] = 42785, s[3393] = 1159, s[3416] = 8377;
}), Y_ = Ee(function(s) {
  s[227] = 322, s[264] = 261, s[291] = 346;
}), J_ = Ee(function(s) {
  s[1] = 32, s[4] = 65, s[5] = 192, s[6] = 193, s[9] = 196, s[17] = 66, s[18] = 67, s[21] = 268, s[24] = 68, s[28] = 69, s[29] = 200, s[30] = 201, s[32] = 282, s[38] = 70, s[39] = 71, s[44] = 72, s[47] = 73, s[48] = 204, s[49] = 205, s[58] = 74, s[60] = 75, s[62] = 76, s[68] = 77, s[69] = 78, s[75] = 79, s[76] = 210, s[80] = 214, s[87] = 80, s[89] = 81, s[90] = 82, s[92] = 344, s[94] = 83, s[97] = 352, s[100] = 84, s[104] = 85, s[109] = 220, s[115] = 86, s[116] = 87, s[121] = 88, s[122] = 89, s[124] = 221, s[127] = 90, s[129] = 381, s[258] = 97, s[259] = 224, s[260] = 225, s[263] = 228, s[268] = 261, s[271] = 98, s[272] = 99, s[273] = 263, s[275] = 269, s[282] = 100, s[286] = 101, s[287] = 232, s[288] = 233, s[290] = 283, s[295] = 281, s[296] = 102, s[336] = 103, s[346] = 104, s[349] = 105, s[350] = 236, s[351] = 237, s[361] = 106, s[364] = 107, s[367] = 108, s[371] = 322, s[373] = 109, s[374] = 110, s[381] = 111, s[382] = 242, s[383] = 243, s[386] = 246, s[393] = 112, s[395] = 113, s[396] = 114, s[398] = 345, s[400] = 115, s[401] = 347, s[403] = 353, s[410] = 116, s[437] = 117, s[442] = 252, s[448] = 118, s[449] = 119, s[454] = 120, s[455] = 121, s[457] = 253, s[460] = 122, s[462] = 382, s[463] = 380, s[853] = 44, s[855] = 58, s[856] = 46, s[876] = 47, s[878] = 45, s[882] = 45, s[894] = 40, s[895] = 41, s[896] = 91, s[897] = 93, s[923] = 64, s[940] = 163, s[1004] = 48, s[1005] = 49, s[1006] = 50, s[1007] = 51, s[1008] = 52, s[1009] = 53, s[1010] = 54, s[1011] = 55, s[1012] = 56, s[1013] = 57, s[1081] = 37, s[1085] = 43, s[1086] = 45;
});
function y4(s) {
  const t = C2(s);
  return J9()[t];
}
function w4(s) {
  const t = C2(s);
  return !!(J9()[t] || PA()[t] || x7()[t] || o6()[t]);
}
class Rd {
  constructor(t = []) {
    this._map = t;
  }
  get length() {
    return this._map.length;
  }
  forEach(t) {
    for (const e in this._map) t(e, this._map[e].codePointAt(0));
  }
  has(t) {
    return this._map[t] !== void 0;
  }
  get(t) {
    return this._map[t];
  }
  charCodeOf(t) {
    const e = this._map;
    if (e.length <= 65536) return e.indexOf(t);
    for (const i in e) if (e[i] === t) return 0 | i;
    return -1;
  }
  amend(t) {
    for (const e in t) this._map[e] = t[e];
  }
}
class bn {
  constructor(t, e) {
    this.firstChar = t, this.lastChar = e;
  }
  get length() {
    return this.lastChar + 1 - this.firstChar;
  }
  forEach(t) {
    for (let e = this.firstChar, i = this.lastChar; e <= i; e++) t(e, e);
  }
  has(t) {
    return this.firstChar <= t && t <= this.lastChar;
  }
  get(t) {
    if (this.firstChar <= t && t <= this.lastChar) return String.fromCharCode(t);
  }
  charCodeOf(t) {
    return Number.isInteger(t) && t >= this.firstChar && t <= this.lastChar ? t : -1;
  }
  amend(t) {
    Wt("Should not call amend()");
  }
}
class Em {
  constructor(t, e) {
    this.properties = e;
    const i = new v7(t, e, h0);
    this.cff = i.parse(), this.cff.duplicateFirstGlyph();
    const n = new I2(this.cff);
    this.seacs = this.cff.seacs;
    try {
      this.data = n.compile();
    } catch {
      D("Failed to compile font " + e.loadedName), this.data = t;
    }
    this._createBuiltInEncoding();
  }
  get numGlyphs() {
    return this.cff.charStrings.count;
  }
  getCharset() {
    return this.cff.charset.charset;
  }
  getGlyphMapping() {
    const t = this.cff, e = this.properties, { cidToGidMap: i, cMap: n } = e, a = t.charset.charset;
    let r, o;
    if (e.composite) {
      let c, h;
      if ((i == null ? void 0 : i.length) > 0) {
        c = /* @__PURE__ */ Object.create(null);
        for (let u = 0, f = i.length; u < f; u++) {
          const d = i[u];
          d !== void 0 && (c[d] = u);
        }
      }
      if (r = /* @__PURE__ */ Object.create(null), t.isCIDFont) for (o = 0; o < a.length; o++) {
        const u = a[o];
        h = n.charCodeOf(u), (c == null ? void 0 : c[h]) !== void 0 && (h = c[h]), r[h] = o;
      }
      else for (o = 0; o < t.charStrings.count; o++)
        h = n.charCodeOf(o), r[h] = o;
      return r;
    }
    let l = t.encoding ? t.encoding.encoding : null;
    return e.isInternalFont && (l = e.defaultEncoding), r = EA(e, l, a), r;
  }
  hasGlyphId(t) {
    return this.cff.hasGlyphId(t);
  }
  _createBuiltInEncoding() {
    const { charset: t, encoding: e } = this.cff;
    if (!t || !e) return;
    const i = t.charset, n = e.encoding, a = [];
    for (const r in n) {
      const o = n[r];
      if (o >= 0) {
        const l = i[o];
        l && (a[r] = l);
      }
    }
    a.length > 0 && (this.properties.builtInEncoding = a);
  }
}
function ml(s, t) {
  return Nr(s, t) / 16384;
}
function l6(s) {
  const t = s.length;
  let e = 32768;
  return t < 1240 ? e = 107 : t < 33900 && (e = 1131), e;
}
function Z_(s, t, e) {
  const i = $t(s, t + 2) === 1 ? he(s, t + 8) : he(s, t + 16), n = $t(s, t + i);
  let a, r, o;
  if (n === 4) {
    $t(s, t + i + 2);
    const l = $t(s, t + i + 6) >> 1;
    for (r = t + i + 14, a = [], o = 0; o < l; o++, r += 2) a[o] = { end: $t(s, r) };
    for (r += 2, o = 0; o < l; o++, r += 2) a[o].start = $t(s, r);
    for (o = 0; o < l; o++, r += 2) a[o].idDelta = $t(s, r);
    for (o = 0; o < l; o++, r += 2) {
      let c = $t(s, r);
      if (c !== 0) {
        a[o].ids = [];
        for (let h = 0, u = a[o].end - a[o].start + 1; h < u; h++)
          a[o].ids[h] = $t(s, r + c), c += 2;
      }
    }
    return a;
  }
  if (n === 12) {
    const l = he(s, t + i + 12);
    for (r = t + i + 16, a = [], o = 0; o < l; o++)
      t = he(s, r), a.push({ start: t, end: he(s, r + 4), idDelta: he(s, r + 8) - t }), r += 12;
    return a;
  }
  throw new st(`unsupported cmap: ${n}`);
}
function Q_(s, t, e, i) {
  var a, r, o;
  const n = new v7(new Le(s, t, e - t), {}, i).parse();
  return { glyphs: n.charStrings.objects, subrs: (r = (a = n.topDict.privateDict) == null ? void 0 : a.subrsIndex) == null ? void 0 : r.objects, gsubrs: (o = n.globalSubrIndex) == null ? void 0 : o.objects, isCFFCIDFont: n.isCIDFont, fdSelect: n.fdSelect, fdArray: n.fdArray };
}
function Op(s, t) {
  const e = t.codePointAt(0);
  let i = 0, n = 0, a = s.length - 1;
  for (; n < a; ) {
    const r = n + a + 1 >> 1;
    e < s[r].start ? a = r - 1 : n = r;
  }
  return s[n].start <= e && e <= s[n].end && (i = s[n].idDelta + (s[n].ids ? s[n].ids[e - s[n].start] : e) & 65535), { charCode: e, glyphId: i };
}
function DA(s, t, e) {
  function i(f, d) {
    c && t.add("L", c), c = [f, d], t.add("M", [f, d]);
  }
  function n(f, d) {
    t.add("L", [f, d]);
  }
  function a(f, d, p, m) {
    t.add("Q", [f, d, p, m]);
  }
  let r = 0;
  const o = Nr(s, r);
  let l, c = null, h = 0, u = 0;
  if (r += 10, o < 0) do {
    l = $t(s, r);
    const f = $t(s, r + 2);
    r += 4;
    let d, p;
    1 & l ? (2 & l ? (d = Nr(s, r), p = Nr(s, r + 2)) : (d = $t(s, r), p = $t(s, r + 2)), r += 4) : 2 & l ? (d = pa(s, r++), p = pa(s, r++)) : (d = s[r++], p = s[r++]), 2 & l ? (h = d, u = p) : (h = 0, u = 0);
    let m = 1, b = 1, y = 0, v = 0;
    8 & l ? (m = b = ml(s, r), r += 2) : 64 & l ? (m = ml(s, r), b = ml(s, r + 2), r += 4) : 128 & l && (m = ml(s, r), y = ml(s, r + 2), v = ml(s, r + 4), b = ml(s, r + 6), r += 8);
    const w = e.glyphs[f];
    w && (t.save(), t.transform([m, y, v, b, h, u]), DA(w, t, e), t.restore());
  } while (32 & l);
  else {
    const f = [];
    let d, p;
    for (d = 0; d < o; d++)
      f.push($t(s, r)), r += 2;
    r += 2 + $t(s, r);
    const m = f.at(-1) + 1, b = [];
    for (; b.length < m; ) {
      l = s[r++];
      let v = 1;
      for (8 & l && (v += s[r++]); v-- > 0; ) b.push({ flags: l });
    }
    for (d = 0; d < m; d++) {
      switch (18 & b[d].flags) {
        case 0:
          h += Nr(s, r), r += 2;
          break;
        case 2:
          h -= s[r++];
          break;
        case 18:
          h += s[r++];
      }
      b[d].x = h;
    }
    for (d = 0; d < m; d++) {
      switch (36 & b[d].flags) {
        case 0:
          u += Nr(s, r), r += 2;
          break;
        case 4:
          u -= s[r++];
          break;
        case 36:
          u += s[r++];
      }
      b[d].y = u;
    }
    let y = 0;
    for (r = 0; r < o; r++) {
      const v = f[r], w = b.slice(y, v + 1);
      if (1 & w[0].flags) w.push(w[0]);
      else if (1 & w.at(-1).flags) w.unshift(w.at(-1));
      else {
        const A = { flags: 1, x: (w[0].x + w.at(-1).x) / 2, y: (w[0].y + w.at(-1).y) / 2 };
        w.unshift(A), w.push(A);
      }
      for (i(w[0].x, w[0].y), d = 1, p = w.length; d < p; d++) 1 & w[d].flags ? n(w[d].x, w[d].y) : 1 & w[d + 1].flags ? (a(w[d].x, w[d].y, w[d + 1].x, w[d + 1].y), d++) : a(w[d].x, w[d].y, (w[d].x + w[d + 1].x) / 2, (w[d].y + w[d + 1].y) / 2);
      y = v + 1;
    }
  }
}
function c6(s, t, e, i) {
  function n(f, d) {
    u && t.add("L", u), u = [f, d], t.add("M", [f, d]);
  }
  function a(f, d) {
    t.add("L", [f, d]);
  }
  function r(f, d, p, m, b, y) {
    t.add("C", [f, d, p, m, b, y]);
  }
  const o = [];
  let l = 0, c = 0, h = 0, u = null;
  (function f(d) {
    var m;
    let p = 0;
    for (; p < d.length; ) {
      let b, y, v, w, A, x, k, I, T, E = !1, M = d[p++];
      switch (M) {
        case 1:
        case 3:
        case 18:
        case 23:
          h += o.length >> 1, E = !0;
          break;
        case 4:
          c += o.pop(), n(l, c), E = !0;
          break;
        case 5:
          for (; o.length > 0; )
            l += o.shift(), c += o.shift(), a(l, c);
          break;
        case 6:
          for (; o.length > 0 && (l += o.shift(), a(l, c), o.length !== 0); )
            c += o.shift(), a(l, c);
          break;
        case 7:
          for (; o.length > 0 && (c += o.shift(), a(l, c), o.length !== 0); )
            l += o.shift(), a(l, c);
          break;
        case 8:
          for (; o.length > 0; )
            b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), r(b, v, y, w, l, c);
          break;
        case 10:
          if (I = o.pop(), T = null, e.isCFFCIDFont) {
            const F = e.fdSelect.getFDIndex(i);
            if (F >= 0 && F < e.fdArray.length) {
              const L = e.fdArray[F];
              let Y;
              (m = L.privateDict) != null && m.subrsIndex && (Y = L.privateDict.subrsIndex.objects), Y && (I += l6(Y), T = Y[I]);
            } else D("Invalid fd index for glyph index.");
          } else T = e.subrs[I + e.subrsBias];
          T && f(T);
          break;
        case 11:
          return;
        case 12:
          switch (M = d[p++], M) {
            case 34:
              b = l + o.shift(), y = b + o.shift(), A = c + o.shift(), l = y + o.shift(), r(b, c, y, A, l, A), b = l + o.shift(), y = b + o.shift(), l = y + o.shift(), r(b, A, y, c, l, c);
              break;
            case 35:
              b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), r(b, v, y, w, l, c), b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), r(b, v, y, w, l, c), o.pop();
              break;
            case 36:
              b = l + o.shift(), A = c + o.shift(), y = b + o.shift(), x = A + o.shift(), l = y + o.shift(), r(b, A, y, x, l, x), b = l + o.shift(), y = b + o.shift(), k = x + o.shift(), l = y + o.shift(), r(b, x, y, k, l, c);
              break;
            case 37:
              const F = l, L = c;
              b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), r(b, v, y, w, l, c), b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y, c = w, Math.abs(l - F) > Math.abs(c - L) ? l += o.shift() : c += o.shift(), r(b, v, y, w, l, c);
              break;
            default:
              throw new st(`unknown operator: 12 ${M}`);
          }
          break;
        case 14:
          if (o.length >= 4) {
            const F = o.pop(), L = o.pop();
            c = o.pop(), l = o.pop(), t.save(), t.translate(l, c);
            let Y = Op(e.cmap, String.fromCharCode(e.glyphNameMap[Ur[F]]));
            c6(e.glyphs[Y.glyphId], t, e, Y.glyphId), t.restore(), Y = Op(e.cmap, String.fromCharCode(e.glyphNameMap[Ur[L]])), c6(e.glyphs[Y.glyphId], t, e, Y.glyphId);
          }
          return;
        case 19:
        case 20:
          h += o.length >> 1, p += h + 7 >> 3, E = !0;
          break;
        case 21:
          c += o.pop(), l += o.pop(), n(l, c), E = !0;
          break;
        case 22:
          l += o.pop(), n(l, c), E = !0;
          break;
        case 24:
          for (; o.length > 2; )
            b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), r(b, v, y, w, l, c);
          l += o.shift(), c += o.shift(), a(l, c);
          break;
        case 25:
          for (; o.length > 6; )
            l += o.shift(), c += o.shift(), a(l, c);
          b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), r(b, v, y, w, l, c);
          break;
        case 26:
          for (o.length % 2 && (l += o.shift()); o.length > 0; )
            b = l, v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y, c = w + o.shift(), r(b, v, y, w, l, c);
          break;
        case 27:
          for (o.length % 2 && (c += o.shift()); o.length > 0; )
            b = l + o.shift(), v = c, y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w, r(b, v, y, w, l, c);
          break;
        case 28:
          o.push(Nr(d, p)), p += 2;
          break;
        case 29:
          I = o.pop() + e.gsubrsBias, T = e.gsubrs[I], T && f(T);
          break;
        case 30:
          for (; o.length > 0 && (b = l, v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + (o.length === 1 ? o.shift() : 0), r(b, v, y, w, l, c), o.length !== 0); )
            b = l + o.shift(), v = c, y = b + o.shift(), w = v + o.shift(), c = w + o.shift(), l = y + (o.length === 1 ? o.shift() : 0), r(b, v, y, w, l, c);
          break;
        case 31:
          for (; o.length > 0 && (b = l + o.shift(), v = c, y = b + o.shift(), w = v + o.shift(), c = w + o.shift(), l = y + (o.length === 1 ? o.shift() : 0), r(b, v, y, w, l, c), o.length !== 0); )
            b = l, v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + (o.length === 1 ? o.shift() : 0), r(b, v, y, w, l, c);
          break;
        default:
          if (M < 32) throw new st(`unknown operator: ${M}`);
          M < 247 ? o.push(M - 139) : M < 251 ? o.push(256 * (M - 247) + d[p++] + 108) : M < 255 ? o.push(256 * -(M - 251) - d[p++] - 108) : (o.push((d[p] << 24 | d[p + 1] << 16 | d[p + 2] << 8 | d[p + 3]) / 65536), p += 4);
      }
      E && (o.length = 0);
    }
  })(s);
}
class tT {
  constructor() {
    ht(this, "cmds", []);
    ht(this, "transformStack", []);
    ht(this, "currentTransform", [1, 0, 0, 1, 0, 0]);
  }
  add(t, e) {
    if (e) {
      const { currentTransform: i } = this;
      for (let n = 0, a = e.length; n < a; n += 2) se.applyTransform(e, i, n);
      this.cmds.push(`${t}${e.join(" ")}`);
    } else this.cmds.push(t);
  }
  transform(t) {
    this.currentTransform = se.transform(this.currentTransform, t);
  }
  translate(t, e) {
    this.transform([1, 0, 0, 1, t, e]);
  }
  save() {
    this.transformStack.push(this.currentTransform.slice());
  }
  restore() {
    this.currentTransform = this.transformStack.pop() || [1, 0, 0, 1, 0, 0];
  }
  getSVG() {
    return this.cmds.join("");
  }
}
class NA {
  constructor(t) {
    this.fontMatrix = t, this.compiledGlyphs = /* @__PURE__ */ Object.create(null), this.compiledCharCodeToGlyphId = /* @__PURE__ */ Object.create(null);
  }
  getPathJs(t) {
    var r;
    const { charCode: e, glyphId: i } = Op(this.cmap, t);
    let n, a = this.compiledGlyphs[i];
    if (a === void 0) {
      try {
        a = this.compileGlyph(this.glyphs[i], i);
      } catch (o) {
        a = "", n = o;
      }
      this.compiledGlyphs[i] = a;
    }
    if ((r = this.compiledCharCodeToGlyphId)[e] ?? (r[e] = i), n) throw n;
    return a;
  }
  compileGlyph(t, e) {
    if (!(t != null && t.length) || t[0] === 14) return "";
    let i = this.fontMatrix;
    if (this.isCFFCIDFont) {
      const a = this.fdSelect.getFDIndex(e);
      a >= 0 && a < this.fdArray.length ? i = this.fdArray[a].getByName("FontMatrix") || Qc : D("Invalid fd index for glyph index.");
    }
    As(ci(i, 6), "Expected a valid fontMatrix.");
    const n = new tT();
    return n.transform(i.slice()), this.compileGlyphImpl(t, n, e), n.add("Z"), n.getSVG();
  }
  compileGlyphImpl() {
    Wt("Children classes should implement this.");
  }
  hasBuiltPath(t) {
    const { charCode: e, glyphId: i } = Op(this.cmap, t);
    return this.compiledGlyphs[i] !== void 0 && this.compiledCharCodeToGlyphId[e] !== void 0;
  }
}
class eT extends NA {
  constructor(t, e, i) {
    super(i || [488e-6, 0, 0, 488e-6, 0, 0]), this.glyphs = t, this.cmap = e;
  }
  compileGlyphImpl(t, e) {
    DA(t, e, this);
  }
}
class sT extends NA {
  constructor(t, e, i) {
    super(i || [1e-3, 0, 0, 1e-3, 0, 0]), this.glyphs = t.glyphs, this.gsubrs = t.gsubrs || [], this.subrs = t.subrs || [], this.cmap = e, this.glyphNameMap = ma(), this.gsubrsBias = l6(this.gsubrs), this.subrsBias = l6(this.subrs), this.isCFFCIDFont = t.isCFFCIDFont, this.fdSelect = t.fdSelect, this.fdArray = t.fdArray;
  }
  compileGlyphImpl(t, e, i) {
    c6(t, e, this, i);
  }
}
class iT {
  static create(t, e) {
    const i = new Uint8Array(t.data);
    let n, a, r, o, l, c;
    const h = $t(i, 4);
    for (let u = 0, f = 12; u < h; u++, f += 16) {
      const d = Si(i.subarray(f, f + 4)), p = he(i, f + 8), m = he(i, f + 12);
      switch (d) {
        case "cmap":
          n = Z_(i, p);
          break;
        case "glyf":
          a = i.subarray(p, p + m);
          break;
        case "loca":
          r = i.subarray(p, p + m);
          break;
        case "head":
          c = $t(i, p + 18), l = $t(i, p + 50);
          break;
        case "CFF ":
          o = Q_(i, p, p + m, e);
      }
    }
    if (a) {
      const u = c ? [1 / c, 0, 0, 1 / c, 0, 0] : t.fontMatrix;
      return new eT(function(d, p, m) {
        let b, y;
        m ? (b = 4, y = he) : (b = 2, y = (A, x) => 2 * $t(A, x));
        const v = [];
        let w = y(p, 0);
        for (let A = b; A < p.length; A += b) {
          const x = y(p, A);
          v.push(d.subarray(w, x)), w = x;
        }
        return v;
      }(a, r, l), n, u);
    }
    return new sT(o, n, t.fontMatrix);
  }
}
const nT = Ee(function(s) {
  s.Courier = 600, s["Courier-Bold"] = 600, s["Courier-BoldOblique"] = 600, s["Courier-Oblique"] = 600, s.Helvetica = Ee(function(t) {
    t.space = 278, t.exclam = 278, t.quotedbl = 355, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 667, t.quoteright = 222, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 278, t.semicolon = 278, t.less = 584, t.equal = 584, t.greater = 584, t.question = 556, t.at = 1015, t.A = 667, t.B = 667, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 500, t.K = 667, t.L = 556, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 278, t.backslash = 278, t.bracketright = 278, t.asciicircum = 469, t.underscore = 556, t.quoteleft = 222, t.a = 556, t.b = 556, t.c = 500, t.d = 556, t.e = 556, t.f = 278, t.g = 556, t.h = 556, t.i = 222, t.j = 222, t.k = 500, t.l = 222, t.m = 833, t.n = 556, t.o = 556, t.p = 556, t.q = 556, t.r = 333, t.s = 500, t.t = 278, t.u = 556, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 500, t.braceleft = 334, t.bar = 260, t.braceright = 334, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 191, t.quotedblleft = 333, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 500, t.fl = 500, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 537, t.bullet = 350, t.quotesinglbase = 222, t.quotedblbase = 333, t.quotedblright = 333, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 556, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 222, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 556, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 667, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 500, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 500, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 222, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 500, t.scedilla = 500, t.iacute = 278, t.lozenge = 471, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 556, t.acircumflex = 556, t.Amacron = 667, t.rcaron = 333, t.ccedilla = 500, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 643, t.Umacron = 722, t.uring = 556, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 667, t.Abreve = 667, t.multiply = 584, t.uacute = 556, t.Tcaron = 611, t.partialdiff = 476, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 500, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 260, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 333, t.omacron = 556, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 222, t.tcaron = 317, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 667, t.Adieresis = 667, t.egrave = 556, t.zacute = 500, t.iogonek = 222, t.Oacute = 778, t.oacute = 556, t.amacron = 556, t.sacute = 500, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 556, t.twosuperior = 333, t.Odieresis = 778, t.mu = 556, t.igrave = 278, t.ohungarumlaut = 556, t.Eogonek = 667, t.dcroat = 556, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 299, t.Kcommaaccent = 667, t.Lacute = 556, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 556, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 556, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 556, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 556, t.Ccaron = 722, t.ugrave = 556, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 333, t.Ntilde = 722, t.otilde = 556, t.Rcommaaccent = 722, t.Lcommaaccent = 556, t.Atilde = 667, t.Aogonek = 667, t.Aring = 667, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 500, t.minus = 584, t.Icircumflex = 278, t.ncaron = 556, t.tcommaaccent = 278, t.logicalnot = 584, t.odieresis = 556, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 556, t.eth = 556, t.zcaron = 500, t.ncommaaccent = 556, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), s["Helvetica-Bold"] = Ee(function(t) {
    t.space = 278, t.exclam = 333, t.quotedbl = 474, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 722, t.quoteright = 278, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 333, t.semicolon = 333, t.less = 584, t.equal = 584, t.greater = 584, t.question = 611, t.at = 975, t.A = 722, t.B = 722, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 556, t.K = 722, t.L = 611, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 584, t.underscore = 556, t.quoteleft = 278, t.a = 556, t.b = 611, t.c = 556, t.d = 611, t.e = 556, t.f = 333, t.g = 611, t.h = 611, t.i = 278, t.j = 278, t.k = 556, t.l = 278, t.m = 889, t.n = 611, t.o = 611, t.p = 611, t.q = 611, t.r = 389, t.s = 556, t.t = 333, t.u = 611, t.v = 556, t.w = 778, t.x = 556, t.y = 556, t.z = 500, t.braceleft = 389, t.bar = 280, t.braceright = 389, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 238, t.quotedblleft = 500, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 611, t.fl = 611, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 556, t.bullet = 350, t.quotesinglbase = 278, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 611, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 278, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 611, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 722, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 556, t.scommaaccent = 556, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 611, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 556, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 556, t.scedilla = 556, t.iacute = 278, t.lozenge = 494, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 611, t.acircumflex = 556, t.Amacron = 722, t.rcaron = 389, t.ccedilla = 556, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 743, t.Umacron = 722, t.uring = 611, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 722, t.Abreve = 722, t.multiply = 584, t.uacute = 611, t.Tcaron = 611, t.partialdiff = 494, t.ydieresis = 556, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 556, t.nacute = 611, t.umacron = 611, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 280, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 389, t.omacron = 611, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 278, t.tcaron = 389, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 556, t.zacute = 500, t.iogonek = 278, t.Oacute = 778, t.oacute = 611, t.amacron = 556, t.sacute = 556, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 611, t.twosuperior = 333, t.Odieresis = 778, t.mu = 611, t.igrave = 278, t.ohungarumlaut = 611, t.Eogonek = 667, t.dcroat = 611, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 400, t.Kcommaaccent = 722, t.Lacute = 611, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 611, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 611, t.ntilde = 611, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 611, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 611, t.Ccaron = 722, t.ugrave = 611, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 722, t.otilde = 611, t.Rcommaaccent = 722, t.Lcommaaccent = 611, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 556, t.minus = 584, t.Icircumflex = 278, t.ncaron = 611, t.tcommaaccent = 333, t.logicalnot = 584, t.odieresis = 611, t.udieresis = 611, t.notequal = 549, t.gcommaaccent = 611, t.eth = 611, t.zcaron = 500, t.ncommaaccent = 611, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), s["Helvetica-BoldOblique"] = Ee(function(t) {
    t.space = 278, t.exclam = 333, t.quotedbl = 474, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 722, t.quoteright = 278, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 333, t.semicolon = 333, t.less = 584, t.equal = 584, t.greater = 584, t.question = 611, t.at = 975, t.A = 722, t.B = 722, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 556, t.K = 722, t.L = 611, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 584, t.underscore = 556, t.quoteleft = 278, t.a = 556, t.b = 611, t.c = 556, t.d = 611, t.e = 556, t.f = 333, t.g = 611, t.h = 611, t.i = 278, t.j = 278, t.k = 556, t.l = 278, t.m = 889, t.n = 611, t.o = 611, t.p = 611, t.q = 611, t.r = 389, t.s = 556, t.t = 333, t.u = 611, t.v = 556, t.w = 778, t.x = 556, t.y = 556, t.z = 500, t.braceleft = 389, t.bar = 280, t.braceright = 389, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 238, t.quotedblleft = 500, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 611, t.fl = 611, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 556, t.bullet = 350, t.quotesinglbase = 278, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 611, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 278, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 611, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 722, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 556, t.scommaaccent = 556, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 611, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 556, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 556, t.scedilla = 556, t.iacute = 278, t.lozenge = 494, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 611, t.acircumflex = 556, t.Amacron = 722, t.rcaron = 389, t.ccedilla = 556, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 743, t.Umacron = 722, t.uring = 611, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 722, t.Abreve = 722, t.multiply = 584, t.uacute = 611, t.Tcaron = 611, t.partialdiff = 494, t.ydieresis = 556, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 556, t.nacute = 611, t.umacron = 611, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 280, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 389, t.omacron = 611, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 278, t.tcaron = 389, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 556, t.zacute = 500, t.iogonek = 278, t.Oacute = 778, t.oacute = 611, t.amacron = 556, t.sacute = 556, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 611, t.twosuperior = 333, t.Odieresis = 778, t.mu = 611, t.igrave = 278, t.ohungarumlaut = 611, t.Eogonek = 667, t.dcroat = 611, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 400, t.Kcommaaccent = 722, t.Lacute = 611, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 611, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 611, t.ntilde = 611, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 611, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 611, t.Ccaron = 722, t.ugrave = 611, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 722, t.otilde = 611, t.Rcommaaccent = 722, t.Lcommaaccent = 611, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 556, t.minus = 584, t.Icircumflex = 278, t.ncaron = 611, t.tcommaaccent = 333, t.logicalnot = 584, t.odieresis = 611, t.udieresis = 611, t.notequal = 549, t.gcommaaccent = 611, t.eth = 611, t.zcaron = 500, t.ncommaaccent = 611, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), s["Helvetica-Oblique"] = Ee(function(t) {
    t.space = 278, t.exclam = 278, t.quotedbl = 355, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 667, t.quoteright = 222, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 278, t.semicolon = 278, t.less = 584, t.equal = 584, t.greater = 584, t.question = 556, t.at = 1015, t.A = 667, t.B = 667, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 500, t.K = 667, t.L = 556, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 278, t.backslash = 278, t.bracketright = 278, t.asciicircum = 469, t.underscore = 556, t.quoteleft = 222, t.a = 556, t.b = 556, t.c = 500, t.d = 556, t.e = 556, t.f = 278, t.g = 556, t.h = 556, t.i = 222, t.j = 222, t.k = 500, t.l = 222, t.m = 833, t.n = 556, t.o = 556, t.p = 556, t.q = 556, t.r = 333, t.s = 500, t.t = 278, t.u = 556, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 500, t.braceleft = 334, t.bar = 260, t.braceright = 334, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 191, t.quotedblleft = 333, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 500, t.fl = 500, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 537, t.bullet = 350, t.quotesinglbase = 222, t.quotedblbase = 333, t.quotedblright = 333, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 556, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 222, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 556, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 667, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 500, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 500, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 222, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 500, t.scedilla = 500, t.iacute = 278, t.lozenge = 471, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 556, t.acircumflex = 556, t.Amacron = 667, t.rcaron = 333, t.ccedilla = 500, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 643, t.Umacron = 722, t.uring = 556, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 667, t.Abreve = 667, t.multiply = 584, t.uacute = 556, t.Tcaron = 611, t.partialdiff = 476, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 500, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 260, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 333, t.omacron = 556, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 222, t.tcaron = 317, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 667, t.Adieresis = 667, t.egrave = 556, t.zacute = 500, t.iogonek = 222, t.Oacute = 778, t.oacute = 556, t.amacron = 556, t.sacute = 500, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 556, t.twosuperior = 333, t.Odieresis = 778, t.mu = 556, t.igrave = 278, t.ohungarumlaut = 556, t.Eogonek = 667, t.dcroat = 556, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 299, t.Kcommaaccent = 667, t.Lacute = 556, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 556, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 556, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 556, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 556, t.Ccaron = 722, t.ugrave = 556, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 333, t.Ntilde = 722, t.otilde = 556, t.Rcommaaccent = 722, t.Lcommaaccent = 556, t.Atilde = 667, t.Aogonek = 667, t.Aring = 667, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 500, t.minus = 584, t.Icircumflex = 278, t.ncaron = 556, t.tcommaaccent = 278, t.logicalnot = 584, t.odieresis = 556, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 556, t.eth = 556, t.zcaron = 500, t.ncommaaccent = 556, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), s.Symbol = Ee(function(t) {
    t.space = 250, t.exclam = 333, t.universal = 713, t.numbersign = 500, t.existential = 549, t.percent = 833, t.ampersand = 778, t.suchthat = 439, t.parenleft = 333, t.parenright = 333, t.asteriskmath = 500, t.plus = 549, t.comma = 250, t.minus = 549, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 278, t.semicolon = 278, t.less = 549, t.equal = 549, t.greater = 549, t.question = 444, t.congruent = 549, t.Alpha = 722, t.Beta = 667, t.Chi = 722, t.Delta = 612, t.Epsilon = 611, t.Phi = 763, t.Gamma = 603, t.Eta = 722, t.Iota = 333, t.theta1 = 631, t.Kappa = 722, t.Lambda = 686, t.Mu = 889, t.Nu = 722, t.Omicron = 722, t.Pi = 768, t.Theta = 741, t.Rho = 556, t.Sigma = 592, t.Tau = 611, t.Upsilon = 690, t.sigma1 = 439, t.Omega = 768, t.Xi = 645, t.Psi = 795, t.Zeta = 611, t.bracketleft = 333, t.therefore = 863, t.bracketright = 333, t.perpendicular = 658, t.underscore = 500, t.radicalex = 500, t.alpha = 631, t.beta = 549, t.chi = 549, t.delta = 494, t.epsilon = 439, t.phi = 521, t.gamma = 411, t.eta = 603, t.iota = 329, t.phi1 = 603, t.kappa = 549, t.lambda = 549, t.mu = 576, t.nu = 521, t.omicron = 549, t.pi = 549, t.theta = 521, t.rho = 549, t.sigma = 603, t.tau = 439, t.upsilon = 576, t.omega1 = 713, t.omega = 686, t.xi = 493, t.psi = 686, t.zeta = 494, t.braceleft = 480, t.bar = 200, t.braceright = 480, t.similar = 549, t.Euro = 750, t.Upsilon1 = 620, t.minute = 247, t.lessequal = 549, t.fraction = 167, t.infinity = 713, t.florin = 500, t.club = 753, t.diamond = 753, t.heart = 753, t.spade = 753, t.arrowboth = 1042, t.arrowleft = 987, t.arrowup = 603, t.arrowright = 987, t.arrowdown = 603, t.degree = 400, t.plusminus = 549, t.second = 411, t.greaterequal = 549, t.multiply = 549, t.proportional = 713, t.partialdiff = 494, t.bullet = 460, t.divide = 549, t.notequal = 549, t.equivalence = 549, t.approxequal = 549, t.ellipsis = 1e3, t.arrowvertex = 603, t.arrowhorizex = 1e3, t.carriagereturn = 658, t.aleph = 823, t.Ifraktur = 686, t.Rfraktur = 795, t.weierstrass = 987, t.circlemultiply = 768, t.circleplus = 768, t.emptyset = 823, t.intersection = 768, t.union = 768, t.propersuperset = 713, t.reflexsuperset = 713, t.notsubset = 713, t.propersubset = 713, t.reflexsubset = 713, t.element = 713, t.notelement = 713, t.angle = 768, t.gradient = 713, t.registerserif = 790, t.copyrightserif = 790, t.trademarkserif = 890, t.product = 823, t.radical = 549, t.dotmath = 250, t.logicalnot = 713, t.logicaland = 603, t.logicalor = 603, t.arrowdblboth = 1042, t.arrowdblleft = 987, t.arrowdblup = 603, t.arrowdblright = 987, t.arrowdbldown = 603, t.lozenge = 494, t.angleleft = 329, t.registersans = 790, t.copyrightsans = 790, t.trademarksans = 786, t.summation = 713, t.parenlefttp = 384, t.parenleftex = 384, t.parenleftbt = 384, t.bracketlefttp = 384, t.bracketleftex = 384, t.bracketleftbt = 384, t.bracelefttp = 494, t.braceleftmid = 494, t.braceleftbt = 494, t.braceex = 494, t.angleright = 329, t.integral = 274, t.integraltp = 686, t.integralex = 686, t.integralbt = 686, t.parenrighttp = 384, t.parenrightex = 384, t.parenrightbt = 384, t.bracketrighttp = 384, t.bracketrightex = 384, t.bracketrightbt = 384, t.bracerighttp = 494, t.bracerightmid = 494, t.bracerightbt = 494, t.apple = 790;
  }), s["Times-Roman"] = Ee(function(t) {
    t.space = 250, t.exclam = 333, t.quotedbl = 408, t.numbersign = 500, t.dollar = 500, t.percent = 833, t.ampersand = 778, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 564, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 278, t.semicolon = 278, t.less = 564, t.equal = 564, t.greater = 564, t.question = 444, t.at = 921, t.A = 722, t.B = 667, t.C = 667, t.D = 722, t.E = 611, t.F = 556, t.G = 722, t.H = 722, t.I = 333, t.J = 389, t.K = 722, t.L = 611, t.M = 889, t.N = 722, t.O = 722, t.P = 556, t.Q = 722, t.R = 667, t.S = 556, t.T = 611, t.U = 722, t.V = 722, t.W = 944, t.X = 722, t.Y = 722, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 469, t.underscore = 500, t.quoteleft = 333, t.a = 444, t.b = 500, t.c = 444, t.d = 500, t.e = 444, t.f = 333, t.g = 500, t.h = 500, t.i = 278, t.j = 278, t.k = 500, t.l = 278, t.m = 778, t.n = 500, t.o = 500, t.p = 500, t.q = 500, t.r = 333, t.s = 389, t.t = 278, t.u = 500, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 444, t.braceleft = 480, t.bar = 200, t.braceright = 480, t.asciitilde = 541, t.exclamdown = 333, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 180, t.quotedblleft = 444, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 556, t.fl = 556, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 453, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 444, t.quotedblright = 444, t.guillemotright = 500, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 444, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 889, t.ordfeminine = 276, t.Lslash = 611, t.Oslash = 722, t.OE = 889, t.ordmasculine = 310, t.ae = 667, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 722, t.germandbls = 500, t.Idieresis = 333, t.eacute = 444, t.abreve = 444, t.uhungarumlaut = 500, t.ecaron = 444, t.Ydieresis = 722, t.divide = 564, t.Yacute = 722, t.Acircumflex = 722, t.aacute = 444, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 444, t.Uacute = 722, t.uogonek = 500, t.Edieresis = 611, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 760, t.Emacron = 611, t.ccaron = 444, t.aring = 444, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 444, t.Tcommaaccent = 611, t.Cacute = 667, t.atilde = 444, t.Edotaccent = 611, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 471, t.Rcaron = 667, t.Gcommaaccent = 722, t.ucircumflex = 500, t.acircumflex = 444, t.Amacron = 722, t.rcaron = 333, t.ccedilla = 444, t.Zdotaccent = 611, t.Thorn = 556, t.Omacron = 722, t.Racute = 667, t.Sacute = 556, t.dcaron = 588, t.Umacron = 722, t.uring = 500, t.threesuperior = 300, t.Ograve = 722, t.Agrave = 722, t.Abreve = 722, t.multiply = 564, t.uacute = 500, t.Tcaron = 611, t.partialdiff = 476, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 611, t.adieresis = 444, t.edieresis = 444, t.cacute = 444, t.nacute = 500, t.umacron = 500, t.Ncaron = 722, t.Iacute = 333, t.plusminus = 564, t.brokenbar = 200, t.registered = 760, t.Gbreve = 722, t.Idotaccent = 333, t.summation = 600, t.Egrave = 611, t.racute = 333, t.omacron = 500, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 667, t.lcommaaccent = 278, t.tcaron = 326, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 444, t.zacute = 444, t.iogonek = 278, t.Oacute = 722, t.oacute = 500, t.amacron = 444, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 722, t.Ugrave = 722, t.Delta = 612, t.thorn = 500, t.twosuperior = 300, t.Odieresis = 722, t.mu = 500, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 611, t.dcroat = 500, t.threequarters = 750, t.Scedilla = 556, t.lcaron = 344, t.Kcommaaccent = 722, t.Lacute = 611, t.trademark = 980, t.edotaccent = 444, t.Igrave = 333, t.Imacron = 333, t.Lcaron = 611, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 500, t.Uhungarumlaut = 722, t.Eacute = 611, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 556, t.Scommaaccent = 556, t.Ohungarumlaut = 722, t.degree = 400, t.ograve = 500, t.Ccaron = 667, t.ugrave = 500, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 333, t.Ntilde = 722, t.otilde = 500, t.Rcommaaccent = 667, t.Lcommaaccent = 611, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 722, t.zdotaccent = 444, t.Ecaron = 611, t.Iogonek = 333, t.kcommaaccent = 500, t.minus = 564, t.Icircumflex = 333, t.ncaron = 500, t.tcommaaccent = 278, t.logicalnot = 564, t.odieresis = 500, t.udieresis = 500, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 444, t.ncommaaccent = 500, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), s["Times-Bold"] = Ee(function(t) {
    t.space = 250, t.exclam = 333, t.quotedbl = 555, t.numbersign = 500, t.dollar = 500, t.percent = 1e3, t.ampersand = 833, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 570, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 333, t.semicolon = 333, t.less = 570, t.equal = 570, t.greater = 570, t.question = 500, t.at = 930, t.A = 722, t.B = 667, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 778, t.I = 389, t.J = 500, t.K = 778, t.L = 667, t.M = 944, t.N = 722, t.O = 778, t.P = 611, t.Q = 778, t.R = 722, t.S = 556, t.T = 667, t.U = 722, t.V = 722, t.W = 1e3, t.X = 722, t.Y = 722, t.Z = 667, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 581, t.underscore = 500, t.quoteleft = 333, t.a = 500, t.b = 556, t.c = 444, t.d = 556, t.e = 444, t.f = 333, t.g = 500, t.h = 556, t.i = 278, t.j = 333, t.k = 556, t.l = 278, t.m = 833, t.n = 556, t.o = 500, t.p = 556, t.q = 556, t.r = 444, t.s = 389, t.t = 333, t.u = 556, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 444, t.braceleft = 394, t.bar = 220, t.braceright = 394, t.asciitilde = 520, t.exclamdown = 333, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 278, t.quotedblleft = 500, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 556, t.fl = 556, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 540, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 500, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 500, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 300, t.Lslash = 667, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 330, t.ae = 722, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 722, t.germandbls = 556, t.Idieresis = 389, t.eacute = 444, t.abreve = 500, t.uhungarumlaut = 556, t.ecaron = 444, t.Ydieresis = 722, t.divide = 570, t.Yacute = 722, t.Acircumflex = 722, t.aacute = 500, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 500, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 747, t.Emacron = 667, t.ccaron = 444, t.aring = 500, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 500, t.Tcommaaccent = 667, t.Cacute = 722, t.atilde = 500, t.Edotaccent = 667, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 494, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 556, t.acircumflex = 500, t.Amacron = 722, t.rcaron = 444, t.ccedilla = 444, t.Zdotaccent = 667, t.Thorn = 611, t.Omacron = 778, t.Racute = 722, t.Sacute = 556, t.dcaron = 672, t.Umacron = 722, t.uring = 556, t.threesuperior = 300, t.Ograve = 778, t.Agrave = 722, t.Abreve = 722, t.multiply = 570, t.uacute = 556, t.Tcaron = 667, t.partialdiff = 494, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 500, t.edieresis = 444, t.cacute = 444, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 389, t.plusminus = 570, t.brokenbar = 220, t.registered = 747, t.Gbreve = 778, t.Idotaccent = 389, t.summation = 600, t.Egrave = 667, t.racute = 444, t.omacron = 500, t.Zacute = 667, t.Zcaron = 667, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 278, t.tcaron = 416, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 444, t.zacute = 444, t.iogonek = 278, t.Oacute = 778, t.oacute = 500, t.amacron = 500, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 556, t.twosuperior = 300, t.Odieresis = 778, t.mu = 556, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 667, t.dcroat = 556, t.threequarters = 750, t.Scedilla = 556, t.lcaron = 394, t.Kcommaaccent = 778, t.Lacute = 667, t.trademark = 1e3, t.edotaccent = 444, t.Igrave = 389, t.Imacron = 389, t.Lcaron = 667, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 556, t.Scommaaccent = 556, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 500, t.Ccaron = 722, t.ugrave = 556, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 444, t.Ntilde = 722, t.otilde = 500, t.Rcommaaccent = 722, t.Lcommaaccent = 667, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 778, t.zdotaccent = 444, t.Ecaron = 667, t.Iogonek = 389, t.kcommaaccent = 556, t.minus = 570, t.Icircumflex = 389, t.ncaron = 556, t.tcommaaccent = 333, t.logicalnot = 570, t.odieresis = 500, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 444, t.ncommaaccent = 556, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), s["Times-BoldItalic"] = Ee(function(t) {
    t.space = 250, t.exclam = 389, t.quotedbl = 555, t.numbersign = 500, t.dollar = 500, t.percent = 833, t.ampersand = 778, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 570, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 333, t.semicolon = 333, t.less = 570, t.equal = 570, t.greater = 570, t.question = 500, t.at = 832, t.A = 667, t.B = 667, t.C = 667, t.D = 722, t.E = 667, t.F = 667, t.G = 722, t.H = 778, t.I = 389, t.J = 500, t.K = 667, t.L = 611, t.M = 889, t.N = 722, t.O = 722, t.P = 611, t.Q = 722, t.R = 667, t.S = 556, t.T = 611, t.U = 722, t.V = 667, t.W = 889, t.X = 667, t.Y = 611, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 570, t.underscore = 500, t.quoteleft = 333, t.a = 500, t.b = 500, t.c = 444, t.d = 500, t.e = 444, t.f = 333, t.g = 500, t.h = 556, t.i = 278, t.j = 278, t.k = 500, t.l = 278, t.m = 778, t.n = 556, t.o = 500, t.p = 500, t.q = 500, t.r = 389, t.s = 389, t.t = 278, t.u = 556, t.v = 444, t.w = 667, t.x = 500, t.y = 444, t.z = 389, t.braceleft = 348, t.bar = 220, t.braceright = 348, t.asciitilde = 570, t.exclamdown = 389, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 278, t.quotedblleft = 500, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 556, t.fl = 556, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 500, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 500, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 500, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 944, t.ordfeminine = 266, t.Lslash = 611, t.Oslash = 722, t.OE = 944, t.ordmasculine = 300, t.ae = 722, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 722, t.germandbls = 500, t.Idieresis = 389, t.eacute = 444, t.abreve = 500, t.uhungarumlaut = 556, t.ecaron = 444, t.Ydieresis = 611, t.divide = 570, t.Yacute = 611, t.Acircumflex = 667, t.aacute = 500, t.Ucircumflex = 722, t.yacute = 444, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 500, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 747, t.Emacron = 667, t.ccaron = 444, t.aring = 500, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 500, t.Tcommaaccent = 611, t.Cacute = 667, t.atilde = 500, t.Edotaccent = 667, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 494, t.Rcaron = 667, t.Gcommaaccent = 722, t.ucircumflex = 556, t.acircumflex = 500, t.Amacron = 667, t.rcaron = 389, t.ccedilla = 444, t.Zdotaccent = 611, t.Thorn = 611, t.Omacron = 722, t.Racute = 667, t.Sacute = 556, t.dcaron = 608, t.Umacron = 722, t.uring = 556, t.threesuperior = 300, t.Ograve = 722, t.Agrave = 667, t.Abreve = 667, t.multiply = 570, t.uacute = 556, t.Tcaron = 611, t.partialdiff = 494, t.ydieresis = 444, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 500, t.edieresis = 444, t.cacute = 444, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 389, t.plusminus = 570, t.brokenbar = 220, t.registered = 747, t.Gbreve = 722, t.Idotaccent = 389, t.summation = 600, t.Egrave = 667, t.racute = 389, t.omacron = 500, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 667, t.lcommaaccent = 278, t.tcaron = 366, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 667, t.Adieresis = 667, t.egrave = 444, t.zacute = 389, t.iogonek = 278, t.Oacute = 722, t.oacute = 500, t.amacron = 500, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 722, t.Ugrave = 722, t.Delta = 612, t.thorn = 500, t.twosuperior = 300, t.Odieresis = 722, t.mu = 576, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 667, t.dcroat = 500, t.threequarters = 750, t.Scedilla = 556, t.lcaron = 382, t.Kcommaaccent = 667, t.Lacute = 611, t.trademark = 1e3, t.edotaccent = 444, t.Igrave = 389, t.Imacron = 389, t.Lcaron = 611, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 556, t.Scommaaccent = 556, t.Ohungarumlaut = 722, t.degree = 400, t.ograve = 500, t.Ccaron = 667, t.ugrave = 556, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 722, t.otilde = 500, t.Rcommaaccent = 667, t.Lcommaaccent = 611, t.Atilde = 667, t.Aogonek = 667, t.Aring = 667, t.Otilde = 722, t.zdotaccent = 389, t.Ecaron = 667, t.Iogonek = 389, t.kcommaaccent = 500, t.minus = 606, t.Icircumflex = 389, t.ncaron = 556, t.tcommaaccent = 278, t.logicalnot = 606, t.odieresis = 500, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 389, t.ncommaaccent = 556, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), s["Times-Italic"] = Ee(function(t) {
    t.space = 250, t.exclam = 333, t.quotedbl = 420, t.numbersign = 500, t.dollar = 500, t.percent = 833, t.ampersand = 778, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 675, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 333, t.semicolon = 333, t.less = 675, t.equal = 675, t.greater = 675, t.question = 500, t.at = 920, t.A = 611, t.B = 611, t.C = 667, t.D = 722, t.E = 611, t.F = 611, t.G = 722, t.H = 722, t.I = 333, t.J = 444, t.K = 667, t.L = 556, t.M = 833, t.N = 667, t.O = 722, t.P = 611, t.Q = 722, t.R = 611, t.S = 500, t.T = 556, t.U = 722, t.V = 611, t.W = 833, t.X = 611, t.Y = 556, t.Z = 556, t.bracketleft = 389, t.backslash = 278, t.bracketright = 389, t.asciicircum = 422, t.underscore = 500, t.quoteleft = 333, t.a = 500, t.b = 500, t.c = 444, t.d = 500, t.e = 444, t.f = 278, t.g = 500, t.h = 500, t.i = 278, t.j = 278, t.k = 444, t.l = 278, t.m = 722, t.n = 500, t.o = 500, t.p = 500, t.q = 500, t.r = 389, t.s = 389, t.t = 278, t.u = 500, t.v = 444, t.w = 667, t.x = 444, t.y = 444, t.z = 389, t.braceleft = 400, t.bar = 275, t.braceright = 400, t.asciitilde = 541, t.exclamdown = 389, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 214, t.quotedblleft = 556, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 500, t.fl = 500, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 523, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 556, t.quotedblright = 556, t.guillemotright = 500, t.ellipsis = 889, t.perthousand = 1e3, t.questiondown = 500, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 889, t.AE = 889, t.ordfeminine = 276, t.Lslash = 556, t.Oslash = 722, t.OE = 944, t.ordmasculine = 310, t.ae = 667, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 667, t.germandbls = 500, t.Idieresis = 333, t.eacute = 444, t.abreve = 500, t.uhungarumlaut = 500, t.ecaron = 444, t.Ydieresis = 556, t.divide = 675, t.Yacute = 556, t.Acircumflex = 611, t.aacute = 500, t.Ucircumflex = 722, t.yacute = 444, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 500, t.Uacute = 722, t.uogonek = 500, t.Edieresis = 611, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 760, t.Emacron = 611, t.ccaron = 444, t.aring = 500, t.Ncommaaccent = 667, t.lacute = 278, t.agrave = 500, t.Tcommaaccent = 556, t.Cacute = 667, t.atilde = 500, t.Edotaccent = 611, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 471, t.Rcaron = 611, t.Gcommaaccent = 722, t.ucircumflex = 500, t.acircumflex = 500, t.Amacron = 611, t.rcaron = 389, t.ccedilla = 444, t.Zdotaccent = 556, t.Thorn = 611, t.Omacron = 722, t.Racute = 611, t.Sacute = 500, t.dcaron = 544, t.Umacron = 722, t.uring = 500, t.threesuperior = 300, t.Ograve = 722, t.Agrave = 611, t.Abreve = 611, t.multiply = 675, t.uacute = 500, t.Tcaron = 556, t.partialdiff = 476, t.ydieresis = 444, t.Nacute = 667, t.icircumflex = 278, t.Ecircumflex = 611, t.adieresis = 500, t.edieresis = 444, t.cacute = 444, t.nacute = 500, t.umacron = 500, t.Ncaron = 667, t.Iacute = 333, t.plusminus = 675, t.brokenbar = 275, t.registered = 760, t.Gbreve = 722, t.Idotaccent = 333, t.summation = 600, t.Egrave = 611, t.racute = 389, t.omacron = 500, t.Zacute = 556, t.Zcaron = 556, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 667, t.lcommaaccent = 278, t.tcaron = 300, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 611, t.Adieresis = 611, t.egrave = 444, t.zacute = 389, t.iogonek = 278, t.Oacute = 722, t.oacute = 500, t.amacron = 500, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 722, t.Ugrave = 722, t.Delta = 612, t.thorn = 500, t.twosuperior = 300, t.Odieresis = 722, t.mu = 500, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 611, t.dcroat = 500, t.threequarters = 750, t.Scedilla = 500, t.lcaron = 300, t.Kcommaaccent = 667, t.Lacute = 556, t.trademark = 980, t.edotaccent = 444, t.Igrave = 333, t.Imacron = 333, t.Lcaron = 611, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 500, t.Uhungarumlaut = 722, t.Eacute = 611, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 500, t.Scommaaccent = 500, t.Ohungarumlaut = 722, t.degree = 400, t.ograve = 500, t.Ccaron = 667, t.ugrave = 500, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 667, t.otilde = 500, t.Rcommaaccent = 611, t.Lcommaaccent = 556, t.Atilde = 611, t.Aogonek = 611, t.Aring = 611, t.Otilde = 722, t.zdotaccent = 389, t.Ecaron = 611, t.Iogonek = 333, t.kcommaaccent = 444, t.minus = 675, t.Icircumflex = 333, t.ncaron = 500, t.tcommaaccent = 278, t.logicalnot = 675, t.odieresis = 500, t.udieresis = 500, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 389, t.ncommaaccent = 500, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), s.ZapfDingbats = Ee(function(t) {
    t.space = 278, t.a1 = 974, t.a2 = 961, t.a202 = 974, t.a3 = 980, t.a4 = 719, t.a5 = 789, t.a119 = 790, t.a118 = 791, t.a117 = 690, t.a11 = 960, t.a12 = 939, t.a13 = 549, t.a14 = 855, t.a15 = 911, t.a16 = 933, t.a105 = 911, t.a17 = 945, t.a18 = 974, t.a19 = 755, t.a20 = 846, t.a21 = 762, t.a22 = 761, t.a23 = 571, t.a24 = 677, t.a25 = 763, t.a26 = 760, t.a27 = 759, t.a28 = 754, t.a6 = 494, t.a7 = 552, t.a8 = 537, t.a9 = 577, t.a10 = 692, t.a29 = 786, t.a30 = 788, t.a31 = 788, t.a32 = 790, t.a33 = 793, t.a34 = 794, t.a35 = 816, t.a36 = 823, t.a37 = 789, t.a38 = 841, t.a39 = 823, t.a40 = 833, t.a41 = 816, t.a42 = 831, t.a43 = 923, t.a44 = 744, t.a45 = 723, t.a46 = 749, t.a47 = 790, t.a48 = 792, t.a49 = 695, t.a50 = 776, t.a51 = 768, t.a52 = 792, t.a53 = 759, t.a54 = 707, t.a55 = 708, t.a56 = 682, t.a57 = 701, t.a58 = 826, t.a59 = 815, t.a60 = 789, t.a61 = 789, t.a62 = 707, t.a63 = 687, t.a64 = 696, t.a65 = 689, t.a66 = 786, t.a67 = 787, t.a68 = 713, t.a69 = 791, t.a70 = 785, t.a71 = 791, t.a72 = 873, t.a73 = 761, t.a74 = 762, t.a203 = 762, t.a75 = 759, t.a204 = 759, t.a76 = 892, t.a77 = 892, t.a78 = 788, t.a79 = 784, t.a81 = 438, t.a82 = 138, t.a83 = 277, t.a84 = 415, t.a97 = 392, t.a98 = 392, t.a99 = 668, t.a100 = 668, t.a89 = 390, t.a90 = 390, t.a93 = 317, t.a94 = 317, t.a91 = 276, t.a92 = 276, t.a205 = 509, t.a85 = 509, t.a206 = 410, t.a86 = 410, t.a87 = 234, t.a88 = 234, t.a95 = 334, t.a96 = 334, t.a101 = 732, t.a102 = 544, t.a103 = 544, t.a104 = 910, t.a106 = 667, t.a107 = 760, t.a108 = 760, t.a112 = 776, t.a111 = 595, t.a110 = 694, t.a109 = 626, t.a120 = 788, t.a121 = 788, t.a122 = 788, t.a123 = 788, t.a124 = 788, t.a125 = 788, t.a126 = 788, t.a127 = 788, t.a128 = 788, t.a129 = 788, t.a130 = 788, t.a131 = 788, t.a132 = 788, t.a133 = 788, t.a134 = 788, t.a135 = 788, t.a136 = 788, t.a137 = 788, t.a138 = 788, t.a139 = 788, t.a140 = 788, t.a141 = 788, t.a142 = 788, t.a143 = 788, t.a144 = 788, t.a145 = 788, t.a146 = 788, t.a147 = 788, t.a148 = 788, t.a149 = 788, t.a150 = 788, t.a151 = 788, t.a152 = 788, t.a153 = 788, t.a154 = 788, t.a155 = 788, t.a156 = 788, t.a157 = 788, t.a158 = 788, t.a159 = 788, t.a160 = 894, t.a161 = 838, t.a163 = 1016, t.a164 = 458, t.a196 = 748, t.a165 = 924, t.a192 = 748, t.a166 = 918, t.a167 = 927, t.a168 = 928, t.a169 = 928, t.a170 = 834, t.a171 = 873, t.a172 = 828, t.a173 = 924, t.a162 = 924, t.a174 = 917, t.a175 = 930, t.a176 = 931, t.a177 = 463, t.a178 = 883, t.a179 = 836, t.a193 = 836, t.a180 = 867, t.a199 = 867, t.a181 = 696, t.a200 = 696, t.a182 = 874, t.a201 = 874, t.a183 = 760, t.a184 = 946, t.a197 = 771, t.a185 = 865, t.a194 = 771, t.a198 = 888, t.a186 = 967, t.a195 = 888, t.a187 = 831, t.a188 = 873, t.a189 = 927, t.a190 = 970, t.a191 = 918;
  });
}), aT = Ee(function(s) {
  s.Courier = { ascent: 629, descent: -157, capHeight: 562, xHeight: -426 }, s["Courier-Bold"] = { ascent: 629, descent: -157, capHeight: 562, xHeight: 439 }, s["Courier-Oblique"] = { ascent: 629, descent: -157, capHeight: 562, xHeight: 426 }, s["Courier-BoldOblique"] = { ascent: 629, descent: -157, capHeight: 562, xHeight: 426 }, s.Helvetica = { ascent: 718, descent: -207, capHeight: 718, xHeight: 523 }, s["Helvetica-Bold"] = { ascent: 718, descent: -207, capHeight: 718, xHeight: 532 }, s["Helvetica-Oblique"] = { ascent: 718, descent: -207, capHeight: 718, xHeight: 523 }, s["Helvetica-BoldOblique"] = { ascent: 718, descent: -207, capHeight: 718, xHeight: 532 }, s["Times-Roman"] = { ascent: 683, descent: -217, capHeight: 662, xHeight: 450 }, s["Times-Bold"] = { ascent: 683, descent: -217, capHeight: 676, xHeight: 461 }, s["Times-Italic"] = { ascent: 683, descent: -217, capHeight: 653, xHeight: 441 }, s["Times-BoldItalic"] = { ascent: 683, descent: -217, capHeight: 669, xHeight: 462 }, s.Symbol = { ascent: Math.NaN, descent: Math.NaN, capHeight: Math.NaN, xHeight: Math.NaN }, s.ZapfDingbats = { ascent: Math.NaN, descent: Math.NaN, capHeight: Math.NaN, xHeight: Math.NaN };
});
class rT {
  constructor({ glyfTable: t, isGlyphLocationsLong: e, locaTable: i, numGlyphs: n }) {
    this.glyphs = [];
    const a = new DataView(i.buffer, i.byteOffset, i.byteLength), r = new DataView(t.buffer, t.byteOffset, t.byteLength), o = e ? 4 : 2;
    let l = e ? a.getUint32(0) : 2 * a.getUint16(0), c = 0;
    for (let h = 0; h < n; h++) {
      c += o;
      const u = e ? a.getUint32(c) : 2 * a.getUint16(c);
      if (u === l) {
        this.glyphs.push(new f0({}));
        continue;
      }
      const f = f0.parse(l, r);
      this.glyphs.push(f), l = u;
    }
  }
  getSize() {
    return Math.sumPrecise(this.glyphs.map((t) => t.getSize() + 3 & -4));
  }
  write() {
    const t = this.getSize(), e = new DataView(new ArrayBuffer(t)), i = t > 131070, n = i ? 4 : 2, a = new DataView(new ArrayBuffer((this.glyphs.length + 1) * n));
    i ? a.setUint32(0, 0) : a.setUint16(0, 0);
    let r = 0, o = 0;
    for (const l of this.glyphs)
      r += l.write(r, e), r = r + 3 & -4, o += n, i ? a.setUint32(o, r) : a.setUint16(o, r >> 1);
    return { isLocationLong: i, loca: new Uint8Array(a.buffer), glyf: new Uint8Array(e.buffer) };
  }
  scale(t) {
    for (let e = 0, i = this.glyphs.length; e < i; e++) this.glyphs[e].scale(t[e]);
  }
}
class f0 {
  constructor({ header: t = null, simple: e = null, composites: i = null }) {
    this.header = t, this.simple = e, this.composites = i;
  }
  static parse(t, e) {
    const [i, n] = k7.parse(t, e);
    if (t += i, n.numberOfContours < 0) {
      const r = [];
      for (; ; ) {
        const [o, l] = C7.parse(t, e);
        if (t += o, r.push(l), !(32 & l.flags)) break;
      }
      return new f0({ header: n, composites: r });
    }
    const a = S7.parse(t, e, n.numberOfContours);
    return new f0({ header: n, simple: a });
  }
  getSize() {
    if (!this.header) return 0;
    const t = this.simple ? this.simple.getSize() : Math.sumPrecise(this.composites.map((e) => e.getSize()));
    return this.header.getSize() + t;
  }
  write(t, e) {
    if (!this.header) return 0;
    const i = t;
    if (t += this.header.write(t, e), this.simple) t += this.simple.write(t, e);
    else for (const n of this.composites) t += n.write(t, e);
    return t - i;
  }
  scale(t) {
    if (!this.header) return;
    const e = (this.header.xMin + this.header.xMax) / 2;
    if (this.header.scale(e, t), this.simple) this.simple.scale(e, t);
    else for (const i of this.composites) i.scale(e, t);
  }
}
class k7 {
  constructor({ numberOfContours: t, xMin: e, yMin: i, xMax: n, yMax: a }) {
    this.numberOfContours = t, this.xMin = e, this.yMin = i, this.xMax = n, this.yMax = a;
  }
  static parse(t, e) {
    return [10, new k7({ numberOfContours: e.getInt16(t), xMin: e.getInt16(t + 2), yMin: e.getInt16(t + 4), xMax: e.getInt16(t + 6), yMax: e.getInt16(t + 8) })];
  }
  getSize() {
    return 10;
  }
  write(t, e) {
    return e.setInt16(t, this.numberOfContours), e.setInt16(t + 2, this.xMin), e.setInt16(t + 4, this.yMin), e.setInt16(t + 6, this.xMax), e.setInt16(t + 8, this.yMax), 10;
  }
  scale(t, e) {
    this.xMin = Math.round(t + (this.xMin - t) * e), this.xMax = Math.round(t + (this.xMax - t) * e);
  }
}
class oT {
  constructor({ flags: t, xCoordinates: e, yCoordinates: i }) {
    this.xCoordinates = e, this.yCoordinates = i, this.flags = t;
  }
}
class S7 {
  constructor({ contours: t, instructions: e }) {
    this.contours = t, this.instructions = e;
  }
  static parse(t, e, i) {
    const n = [];
    for (let b = 0; b < i; b++) {
      const y = e.getUint16(t);
      t += 2, n.push(y);
    }
    const a = n[i - 1] + 1, r = e.getUint16(t);
    t += 2;
    const o = new Uint8Array(e).slice(t, t + r);
    t += r;
    const l = [];
    for (let b = 0; b < a; t++, b++) {
      let y = e.getUint8(t);
      if (l.push(y), 8 & y) {
        const v = e.getUint8(++t);
        y ^= 8;
        for (let w = 0; w < v; w++) l.push(y);
        b += v;
      }
    }
    const c = [];
    let h = [], u = [], f = [];
    const d = [];
    let p = 0, m = 0;
    for (let b = 0; b < a; b++) {
      const y = l[b];
      if (2 & y) {
        const v = e.getUint8(t++);
        m += 16 & y ? v : -v, h.push(m);
      } else 16 & y || (m += e.getInt16(t), t += 2), h.push(m);
      n[p] === b && (p++, c.push(h), h = []);
    }
    m = 0, p = 0;
    for (let b = 0; b < a; b++) {
      const y = l[b];
      if (4 & y) {
        const v = e.getUint8(t++);
        m += 32 & y ? v : -v, u.push(m);
      } else 32 & y || (m += e.getInt16(t), t += 2), u.push(m);
      f.push(1 & y | 64 & y), n[p] === b && (h = c[p], p++, d.push(new oT({ flags: f, xCoordinates: h, yCoordinates: u })), u = [], f = []);
    }
    return new S7({ contours: d, instructions: o });
  }
  getSize() {
    let t = 2 * this.contours.length + 2 + this.instructions.length, e = 0, i = 0;
    for (const n of this.contours) {
      t += n.flags.length;
      for (let a = 0, r = n.xCoordinates.length; a < r; a++) {
        const o = n.xCoordinates[a], l = n.yCoordinates[a];
        let c = Math.abs(o - e);
        c > 255 ? t += 2 : c > 0 && (t += 1), e = o, c = Math.abs(l - i), c > 255 ? t += 2 : c > 0 && (t += 1), i = l;
      }
    }
    return t;
  }
  write(t, e) {
    const i = t, n = [], a = [], r = [];
    let o = 0, l = 0;
    for (const c of this.contours) {
      for (let h = 0, u = c.xCoordinates.length; h < u; h++) {
        let f = c.flags[h];
        const d = c.xCoordinates[h];
        let p = d - o;
        if (p === 0)
          f |= 16, n.push(0);
        else {
          const b = Math.abs(p);
          b <= 255 ? (f |= p >= 0 ? 18 : 2, n.push(b)) : n.push(p);
        }
        o = d;
        const m = c.yCoordinates[h];
        if (p = m - l, p === 0)
          f |= 32, a.push(0);
        else {
          const b = Math.abs(p);
          b <= 255 ? (f |= p >= 0 ? 36 : 4, a.push(b)) : a.push(p);
        }
        l = m, r.push(f);
      }
      e.setUint16(t, n.length - 1), t += 2;
    }
    e.setUint16(t, this.instructions.length), t += 2, this.instructions.length && (new Uint8Array(e.buffer, 0, e.buffer.byteLength).set(this.instructions, t), t += this.instructions.length);
    for (const c of r) e.setUint8(t++, c);
    for (let c = 0, h = n.length; c < h; c++) {
      const u = n[c], f = r[c];
      2 & f ? e.setUint8(t++, u) : 16 & f || (e.setInt16(t, u), t += 2);
    }
    for (let c = 0, h = a.length; c < h; c++) {
      const u = a[c], f = r[c];
      4 & f ? e.setUint8(t++, u) : 32 & f || (e.setInt16(t, u), t += 2);
    }
    return t - i;
  }
  scale(t, e) {
    for (const i of this.contours) if (i.xCoordinates.length !== 0) for (let n = 0, a = i.xCoordinates.length; n < a; n++) i.xCoordinates[n] = Math.round(t + (i.xCoordinates[n] - t) * e);
  }
}
class C7 {
  constructor({ flags: t, glyphIndex: e, argument1: i, argument2: n, transf: a, instructions: r }) {
    this.flags = t, this.glyphIndex = e, this.argument1 = i, this.argument2 = n, this.transf = a, this.instructions = r;
  }
  static parse(t, e) {
    const i = t, n = [];
    let a = e.getUint16(t);
    const r = e.getUint16(t + 2);
    t += 4;
    let o, l;
    1 & a ? (2 & a ? (o = e.getInt16(t), l = e.getInt16(t + 2)) : (o = e.getUint16(t), l = e.getUint16(t + 2)), t += 4, a ^= 1) : (2 & a ? (o = e.getInt8(t), l = e.getInt8(t + 1)) : (o = e.getUint8(t), l = e.getUint8(t + 1)), t += 2), 8 & a ? (n.push(e.getUint16(t)), t += 2) : 64 & a ? (n.push(e.getUint16(t), e.getUint16(t + 2)), t += 4) : 128 & a && (n.push(e.getUint16(t), e.getUint16(t + 2), e.getUint16(t + 4), e.getUint16(t + 6)), t += 8);
    let c = null;
    if (256 & a) {
      const h = e.getUint16(t);
      t += 2, c = new Uint8Array(e).slice(t, t + h), t += h;
    }
    return [t - i, new C7({ flags: a, glyphIndex: r, argument1: o, argument2: l, transf: n, instructions: c })];
  }
  getSize() {
    let t = 4 + 2 * this.transf.length;
    return 256 & this.flags && (t += 2 + this.instructions.length), t += 2, 2 & this.flags ? this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127 || (t += 2) : this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255 || (t += 2), t;
  }
  write(t, e) {
    const i = t;
    return 2 & this.flags ? this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127 || (this.flags |= 1) : this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255 || (this.flags |= 1), e.setUint16(t, this.flags), e.setUint16(t + 2, this.glyphIndex), t += 4, 1 & this.flags ? (2 & this.flags ? (e.setInt16(t, this.argument1), e.setInt16(t + 2, this.argument2)) : (e.setUint16(t, this.argument1), e.setUint16(t + 2, this.argument2)), t += 4) : (e.setUint8(t, this.argument1), e.setUint8(t + 1, this.argument2), t += 2), 256 & this.flags && (e.setUint16(t, this.instructions.length), t += 2, this.instructions.length && (new Uint8Array(e.buffer, 0, e.buffer.byteLength).set(this.instructions, t), t += this.instructions.length)), t - i;
  }
  scale(t, e) {
  }
}
function tg(s, t, e) {
  s[t] = e >> 8 & 255, s[t + 1] = 255 & e;
}
function Mm(s, t, e) {
  s[t] = e >> 24 & 255, s[t + 1] = e >> 16 & 255, s[t + 2] = e >> 8 & 255, s[t + 3] = 255 & e;
}
function lT(s, t, e) {
  if (e instanceof Uint8Array) s.set(e, t);
  else if (typeof e == "string") for (let i = 0, n = e.length; i < n; i++) s[t++] = 255 & e.charCodeAt(i);
  else for (const i of e) s[t++] = 255 & i;
}
class g0 {
  constructor(t) {
    this.sfnt = t, this.tables = /* @__PURE__ */ Object.create(null);
  }
  static getSearchParams(t, e) {
    let i = 1, n = 0;
    for (; (i ^ t) > i; )
      i <<= 1, n++;
    const a = i * e;
    return { range: a, entry: n, rangeShift: e * t - a };
  }
  toArray() {
    let t = this.sfnt;
    const e = this.tables, i = Object.keys(e);
    i.sort();
    const n = i.length;
    let a, r, o, l, c, h = 12 + 16 * n;
    const u = [h];
    for (a = 0; a < n; a++)
      l = e[i[a]], h += (l.length + 3 & -4) >>> 0, u.push(h);
    const f = new Uint8Array(h);
    for (a = 0; a < n; a++)
      l = e[i[a]], lT(f, u[a], l);
    t === "true" && (t = Fs(65536)), f[0] = 255 & t.charCodeAt(0), f[1] = 255 & t.charCodeAt(1), f[2] = 255 & t.charCodeAt(2), f[3] = 255 & t.charCodeAt(3), tg(f, 4, n);
    const d = g0.getSearchParams(n, 16);
    for (tg(f, 6, d.range), tg(f, 8, d.entry), tg(f, 10, d.rangeShift), h = 12, a = 0; a < n; a++) {
      c = i[a], f[h] = 255 & c.charCodeAt(0), f[h + 1] = 255 & c.charCodeAt(1), f[h + 2] = 255 & c.charCodeAt(2), f[h + 3] = 255 & c.charCodeAt(3);
      let p = 0;
      for (r = u[a], o = u[a + 1]; r < o; r += 4)
        p = p + he(f, r) >>> 0;
      Mm(f, h + 4, p), Mm(f, h + 8, u[a]), Mm(f, h + 12, e[c].length), h += 16;
    }
    return f;
  }
  addTable(t, e) {
    if (t in this.tables) throw new Error("Table " + t + " already exists");
    this.tables[t] = e;
  }
}
const cT = [4], hT = [5], uT = [6], dT = [7], fT = [8], gT = [12, 35], Fm = [14], v4 = [21], A4 = [22], pT = [30], mT = [31];
class bT {
  constructor() {
    this.width = 0, this.lsb = 0, this.flexing = !1, this.output = [], this.stack = [];
  }
  convert(t, e, i) {
    const n = t.length;
    let a, r, o, l = !1;
    for (let c = 0; c < n; c++) {
      let h = t[c];
      if (h < 32) {
        switch (h === 12 && (h = (h << 8) + t[++c]), h) {
          case 1:
          case 3:
          case 9:
          case 3072:
          case 3073:
          case 3074:
          case 3105:
            this.stack = [];
            break;
          case 4:
            if (this.flexing) {
              if (this.stack.length < 1) {
                l = !0;
                break;
              }
              const m = this.stack.pop();
              this.stack.push(0, m);
              break;
            }
            l = this.executeCommand(1, cT);
            break;
          case 5:
            l = this.executeCommand(2, hT);
            break;
          case 6:
            l = this.executeCommand(1, uT);
            break;
          case 7:
            l = this.executeCommand(1, dT);
            break;
          case 8:
            l = this.executeCommand(6, fT);
            break;
          case 10:
            if (this.stack.length < 1) {
              l = !0;
              break;
            }
            if (o = this.stack.pop(), !e[o]) {
              l = !0;
              break;
            }
            l = this.convert(e[o], e, i);
            break;
          case 11:
            return l;
          case 13:
            if (this.stack.length < 2) {
              l = !0;
              break;
            }
            a = this.stack.pop(), r = this.stack.pop(), this.lsb = r, this.width = a, this.stack.push(a, r), l = this.executeCommand(2, A4);
            break;
          case 14:
            this.output.push(Fm[0]);
            break;
          case 21:
            if (this.flexing) break;
            l = this.executeCommand(2, v4);
            break;
          case 22:
            if (this.flexing) {
              this.stack.push(0);
              break;
            }
            l = this.executeCommand(1, A4);
            break;
          case 30:
            l = this.executeCommand(4, pT);
            break;
          case 31:
            l = this.executeCommand(4, mT);
            break;
          case 3078:
            if (i) {
              const m = this.stack.at(-5);
              this.seac = this.stack.splice(-4, 4), this.seac[0] += this.lsb - m, l = this.executeCommand(0, Fm);
            } else l = this.executeCommand(4, Fm);
            break;
          case 3079:
            if (this.stack.length < 4) {
              l = !0;
              break;
            }
            this.stack.pop(), a = this.stack.pop();
            const u = this.stack.pop();
            r = this.stack.pop(), this.lsb = r, this.width = a, this.stack.push(a, r, u), l = this.executeCommand(3, v4);
            break;
          case 3084:
            if (this.stack.length < 2) {
              l = !0;
              break;
            }
            const f = this.stack.pop(), d = this.stack.pop();
            this.stack.push(d / f);
            break;
          case 3088:
            if (this.stack.length < 2) {
              l = !0;
              break;
            }
            o = this.stack.pop();
            const p = this.stack.pop();
            if (o === 0 && p === 3) {
              const m = this.stack.splice(-17, 17);
              this.stack.push(m[2] + m[0], m[3] + m[1], m[4], m[5], m[6], m[7], m[8], m[9], m[10], m[11], m[12], m[13], m[14]), l = this.executeCommand(13, gT, !0), this.flexing = !1, this.stack.push(m[15], m[16]);
            } else o === 1 && p === 0 && (this.flexing = !0);
            break;
          case 3089:
            break;
          default:
            D('Unknown type 1 charstring command of "' + h + '"');
        }
        if (l) break;
      } else
        h <= 246 ? h -= 139 : h = h <= 250 ? 256 * (h - 247) + t[++c] + 108 : h <= 254 ? -256 * (h - 251) - t[++c] - 108 : (255 & t[++c]) << 24 | (255 & t[++c]) << 16 | (255 & t[++c]) << 8 | 255 & t[++c], this.stack.push(h);
    }
    return l;
  }
  executeCommand(t, e, i) {
    const n = this.stack.length;
    if (t > n) return !0;
    const a = n - t;
    for (let r = a; r < n; r++) {
      let o = this.stack[r];
      Number.isInteger(o) ? this.output.push(28, o >> 8 & 255, 255 & o) : (o = 65536 * o | 0, this.output.push(255, o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, 255 & o));
    }
    return this.output.push(...e), i ? this.stack.splice(a, t) : this.stack.length = 0, !1;
  }
}
function fa(s) {
  return s >= 48 && s <= 57 || s >= 65 && s <= 70 || s >= 97 && s <= 102;
}
function x4(s, t, e) {
  if (e >= s.length) return new Uint8Array(0);
  let i, n, a = 0 | t;
  for (i = 0; i < e; i++) a = 52845 * (s[i] + a) + 22719 & 65535;
  const r = s.length - e, o = new Uint8Array(r);
  for (i = e, n = 0; n < r; i++, n++) {
    const l = s[i];
    o[n] = l ^ a >> 8, a = 52845 * (l + a) + 22719 & 65535;
  }
  return o;
}
function k4(s) {
  return s === 47 || s === 91 || s === 93 || s === 123 || s === 125 || s === 40 || s === 41;
}
class S4 {
  constructor(t, e, i) {
    if (e) {
      const n = t.getBytes(), a = !((fa(n[0]) || Qi(n[0])) && fa(n[1]) && fa(n[2]) && fa(n[3]) && fa(n[4]) && fa(n[5]) && fa(n[6]) && fa(n[7]));
      t = new Le(a ? x4(n, 55665, 4) : function(o, l, c) {
        let h = 0 | l;
        const u = o.length, f = new Uint8Array(u >>> 1);
        let d, p;
        for (d = 0, p = 0; d < u; d++) {
          const m = o[d];
          if (!fa(m)) continue;
          d++;
          let b;
          for (; d < u && !fa(b = o[d]); ) d++;
          if (d < u) {
            const y = parseInt(String.fromCharCode(m, b), 16);
            f[p++] = y ^ h >> 8, h = 52845 * (y + h) + 22719 & 65535;
          }
        }
        return f.slice(c, p);
      }(n, 55665, 4));
    }
    this.seacAnalysisEnabled = !!i, this.stream = t, this.nextChar();
  }
  readNumberArray() {
    this.getToken();
    const t = [];
    for (; ; ) {
      const e = this.getToken();
      if (e === null || e === "]" || e === "}") break;
      t.push(parseFloat(e || 0));
    }
    return t;
  }
  readNumber() {
    const t = this.getToken();
    return parseFloat(t || 0);
  }
  readInt() {
    const t = this.getToken();
    return 0 | parseInt(t || 0, 10);
  }
  readBoolean() {
    return this.getToken() === "true" ? 1 : 0;
  }
  nextChar() {
    return this.currentChar = this.stream.getByte();
  }
  prevChar() {
    return this.stream.skip(-2), this.currentChar = this.stream.getByte();
  }
  getToken() {
    let t = !1, e = this.currentChar;
    for (; ; ) {
      if (e === -1) return null;
      if (t) e !== 10 && e !== 13 || (t = !1);
      else if (e === 37) t = !0;
      else if (!Qi(e)) break;
      e = this.nextChar();
    }
    if (k4(e))
      return this.nextChar(), String.fromCharCode(e);
    let i = "";
    do
      i += String.fromCharCode(e), e = this.nextChar();
    while (e >= 0 && !Qi(e) && !k4(e));
    return i;
  }
  readCharStrings(t, e) {
    return e === -1 ? t : x4(t, 4330, e);
  }
  extractFontProgram(t) {
    const e = this.stream, i = [], n = [], a = /* @__PURE__ */ Object.create(null);
    a.lenIV = 4;
    const r = { subrs: [], charstrings: [], properties: { privateData: a } };
    let o, l, c, h;
    for (; (o = this.getToken()) !== null; ) if (o === "/")
      switch (o = this.getToken(), o) {
        case "CharStrings":
          for (this.getToken(), this.getToken(), this.getToken(), this.getToken(); o = this.getToken(), !(o === null || o === "end"); ) {
            if (o !== "/") continue;
            const f = this.getToken();
            l = this.readInt(), this.getToken(), c = l > 0 ? e.getBytes(l) : new Uint8Array(0), h = r.properties.privateData.lenIV;
            const d = this.readCharStrings(c, h);
            this.nextChar(), o = this.getToken(), o === "noaccess" ? this.getToken() : o === "/" && this.prevChar(), n.push({ glyph: f, encoded: d });
          }
          break;
        case "Subrs":
          for (this.readInt(), this.getToken(); this.getToken() === "dup"; ) {
            const f = this.readInt();
            l = this.readInt(), this.getToken(), c = l > 0 ? e.getBytes(l) : new Uint8Array(0), h = r.properties.privateData.lenIV;
            const d = this.readCharStrings(c, h);
            this.nextChar(), o = this.getToken(), o === "noaccess" && this.getToken(), i[f] = d;
          }
          break;
        case "BlueValues":
        case "OtherBlues":
        case "FamilyBlues":
        case "FamilyOtherBlues":
          const u = this.readNumberArray();
          u.length > 0 && u.length;
          break;
        case "StemSnapH":
        case "StemSnapV":
          r.properties.privateData[o] = this.readNumberArray();
          break;
        case "StdHW":
        case "StdVW":
          r.properties.privateData[o] = this.readNumberArray()[0];
          break;
        case "BlueShift":
        case "lenIV":
        case "BlueFuzz":
        case "BlueScale":
        case "LanguageGroup":
          r.properties.privateData[o] = this.readNumber();
          break;
        case "ExpansionFactor":
          r.properties.privateData[o] = this.readNumber() || 0.06;
          break;
        case "ForceBold":
          r.properties.privateData[o] = this.readBoolean();
      }
    for (const { encoded: u, glyph: f } of n) {
      const d = new bT(), p = d.convert(u, i, this.seacAnalysisEnabled);
      let m = d.output;
      p && (m = [14]);
      const b = { glyphName: f, charstring: m, width: d.width, lsb: d.lsb, seac: d.seac };
      if (f === ".notdef" ? r.charstrings.unshift(b) : r.charstrings.push(b), t.builtInEncoding) {
        const y = t.builtInEncoding.indexOf(f);
        y > -1 && t.widths[y] === void 0 && y >= t.firstChar && y <= t.lastChar && (t.widths[y] = d.width);
      }
    }
    return r;
  }
  extractFontHeader(t) {
    let e;
    for (; (e = this.getToken()) !== null; ) if (e === "/")
      switch (e = this.getToken(), e) {
        case "FontMatrix":
          const i = this.readNumberArray();
          t.fontMatrix = i;
          break;
        case "Encoding":
          const n = this.getToken();
          let a;
          if (/^\d+$/.test(n)) {
            a = [];
            const o = 0 | parseInt(n, 10);
            this.getToken();
            for (let l = 0; l < o; l++) {
              for (e = this.getToken(); e !== "dup" && e !== "def"; )
                if (e = this.getToken(), e === null) return;
              if (e === "def") break;
              const c = this.readInt();
              this.getToken();
              const h = this.getToken();
              a[c] = h, this.getToken();
            }
          } else a = c0(n);
          t.builtInEncoding = a;
          break;
        case "FontBBox":
          const r = this.readNumberArray();
          t.ascent = Math.max(r[3], r[1]), t.descent = Math.min(r[1], r[3]), t.ascentScaled = !0;
      }
  }
}
function C4(s, t, e) {
  const i = s.length, n = t.length, a = i - n;
  let r = e, o = !1;
  for (; r < a; ) {
    let l = 0;
    for (; l < n && s[r + l] === t[l]; ) l++;
    if (l >= n) {
      for (r += l; r < i && Qi(s[r]); ) r++;
      o = !0;
      break;
    }
    r++;
  }
  return { found: o, length: r };
}
class yT {
  constructor(t, e, i) {
    let n = i.length1;
    i.length2;
    let a = e.peekBytes(6);
    const r = a[0] === 128 && a[1] === 1;
    r && (e.skip(6), n = a[5] << 24 | a[4] << 16 | a[3] << 8 | a[2]);
    const o = function(p, m) {
      const b = [101, 101, 120, 101, 99], y = p.pos;
      let v, w, A, x;
      try {
        v = p.getBytes(m), w = v.length;
      } catch {
      }
      if (w === m && (A = C4(v, b, m - 2 * b.length), A.found && A.length === m))
        return { stream: new Le(v), length: m };
      for (D('Invalid "Length1" property in Type1 font -- trying to recover.'), p.pos = y; A = C4(p.peekBytes(2048), b, 0), A.length !== 0; )
        if (p.pos += A.length, A.found) {
          x = p.pos - y;
          break;
        }
      return p.pos = y, x ? { stream: new Le(p.getBytes(x)), length: x } : (D('Unable to recover "Length1" property in Type1 font -- using as is.'), { stream: new Le(p.getBytes(m)), length: m });
    }(e, n);
    new S4(o.stream, !1, h0).extractFontHeader(i), r && (a = e.getBytes(6), a[5] << 24 | a[4] << 16 | a[3] << 8 | a[2]);
    const l = function(p, m) {
      const b = p.getBytes();
      if (b.length === 0) throw new st("getEexecBlock - no font program found.");
      return { stream: new Le(b), length: b.length };
    }(e), c = new S4(l.stream, !0, h0).extractFontProgram(i);
    for (const d in c.properties) i[d] = c.properties[d];
    const h = c.charstrings, u = this.getType2Charstrings(h), f = this.getType2Subrs(c.subrs);
    this.charstrings = h, this.data = this.wrap(t, u, this.charstrings, f, i), this.seacs = this.getSeacs(c.charstrings);
  }
  get numGlyphs() {
    return this.charstrings.length + 1;
  }
  getCharset() {
    const t = [".notdef"];
    for (const { glyphName: e } of this.charstrings) t.push(e);
    return t;
  }
  getGlyphMapping(t) {
    const e = this.charstrings;
    if (t.composite) {
      const o = /* @__PURE__ */ Object.create(null);
      for (let l = 0, c = e.length; l < c; l++)
        o[t.cMap.charCodeOf(l)] = l + 1;
      return o;
    }
    const i = [".notdef"];
    let n, a;
    for (a = 0; a < e.length; a++) i.push(e[a].glyphName);
    const r = t.builtInEncoding;
    if (r) {
      n = /* @__PURE__ */ Object.create(null);
      for (const o in r)
        a = i.indexOf(r[o]), a >= 0 && (n[o] = a);
    }
    return EA(t, n, i);
  }
  hasGlyphId(t) {
    return t < 0 || t >= this.numGlyphs ? !1 : t === 0 ? !0 : this.charstrings[t - 1].charstring.length > 0;
  }
  getSeacs(t) {
    const e = [];
    for (let i = 0, n = t.length; i < n; i++) {
      const a = t[i];
      a.seac && (e[i + 1] = a.seac);
    }
    return e;
  }
  getType2Charstrings(t) {
    const e = [];
    for (const i of t) e.push(i.charstring);
    return e;
  }
  getType2Subrs(t) {
    let e = 0;
    const i = t.length;
    e = i < 1133 ? 107 : i < 33769 ? 1131 : 32768;
    const n = [];
    let a;
    for (a = 0; a < e; a++) n.push([11]);
    for (a = 0; a < i; a++) n.push(t[a]);
    return n;
  }
  wrap(t, e, i, n, a) {
    const r = new MA();
    r.header = new FA(1, 0, 4, 4), r.names = [t];
    const o = new u0();
    o.setByName("version", 391), o.setByName("Notice", 392), o.setByName("FullName", 393), o.setByName("FamilyName", 394), o.setByName("Weight", 395), o.setByName("Encoding", null), o.setByName("FontMatrix", a.fontMatrix), o.setByName("FontBBox", a.bbox), o.setByName("charset", null), o.setByName("CharStrings", null), o.setByName("Private", null), r.topDict = o;
    const l = new A7();
    l.add("Version 0.11"), l.add("See original notice"), l.add(t), l.add(t), l.add("Medium"), r.strings = l, r.globalSubrIndex = new tl();
    const c = e.length, h = [".notdef"];
    let u, f;
    for (u = 0; u < c; u++) {
      const y = i[u].glyphName;
      Zg.indexOf(y) === -1 && l.add(y), h.push(y);
    }
    r.charset = new Fd(!1, 0, h);
    const d = new tl();
    for (d.add([139, 14]), u = 0; u < c; u++) d.add(e[u]);
    r.charStrings = d;
    const p = new d0();
    p.setByName("Subrs", null);
    const m = ["BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StemSnapH", "StemSnapV", "BlueShift", "BlueFuzz", "BlueScale", "LanguageGroup", "ExpansionFactor", "ForceBold", "StdHW", "StdVW"];
    for (u = 0, f = m.length; u < f; u++) {
      const y = m[u];
      if (!(y in a.privateData)) continue;
      const v = a.privateData[y];
      if (Array.isArray(v)) for (let w = v.length - 1; w > 0; w--) v[w] -= v[w - 1];
      p.setByName(y, v);
    }
    r.topDict.privateDict = p;
    const b = new tl();
    for (u = 0, f = n.length; u < f; u++) b.add(n[u]);
    return p.subrsIndex = b, new I2(r).compile();
  }
}
const Xa = [[57344, 63743], [1048576, 1114109]], Il = 1e3, I4 = ["ascent", "bbox", "black", "bold", "charProcOperatorList", "cssFontInfo", "data", "defaultVMetrics", "defaultWidth", "descent", "disableFontFace", "fallbackName", "fontExtraProperties", "fontMatrix", "isInvalidPDFjsFont", "isType3Font", "italic", "loadedName", "mimetype", "missingFile", "name", "remeasure", "systemFontInfo", "vertical"], wT = ["cMap", "composite", "defaultEncoding", "differences", "isMonospace", "isSerifFont", "isSymbolicFont", "seacMap", "subtype", "toFontChar", "toUnicode", "type", "vmetrics", "widths"];
function _4(s) {
  if (!s.fontMatrix || s.fontMatrix[0] === Qc[0]) return;
  const t = 1e-3 / s.fontMatrix[0], e = s.widths;
  for (const i in e) e[i] *= t;
  s.defaultWidth *= t;
}
function T4(s) {
  if (!s.fallbackToUnicode || s.toUnicode instanceof bn) return;
  const t = [];
  for (const e in s.fallbackToUnicode) s.toUnicode.has(e) || (t[e] = s.fallbackToUnicode[e]);
  t.length > 0 && s.toUnicode.amend(t);
}
class vT {
  constructor(t, e, i, n, a, r, o, l, c) {
    this.originalCharCode = t, this.fontChar = e, this.unicode = i, this.accent = n, this.width = a, this.vmetric = r, this.operatorListId = o, this.isSpace = l, this.isInFont = c;
  }
  get category() {
    return gt(this, "category", function(e) {
      const i = r6.get(e);
      if (i) return i;
      const n = e.match(U_), a = { isWhitespace: !!(n != null && n[1]), isZeroWidthDiacritic: !!(n != null && n[2]), isInvisibleFormatMark: !!(n != null && n[3]) };
      return r6.set(e, a), a;
    }(this.unicode), !0);
  }
}
function bl(s, t) {
  return (s << 8) + t;
}
function X1(s, t, e) {
  s[t + 1] = e, s[t] = e >>> 8;
}
function Fi(s, t) {
  const e = (s << 8) + t;
  return 32768 & e ? e - 65536 : e;
}
function re(s) {
  return String.fromCharCode(s >> 8 & 255, 255 & s);
}
function yl(s) {
  return s > 32767 ? s = 32767 : s < -32768 && (s = -32768), String.fromCharCode(s >> 8 & 255, 255 & s);
}
function BA(s) {
  return Si(s.peekBytes(4)) === "ttcf";
}
function AT(s, { type: t, subtype: e, composite: i }) {
  let n, a;
  return function(o) {
    const l = o.peekBytes(4);
    return he(l, 0) === 65536 || Si(l) === "true";
  }(s) || BA(s) ? n = i ? "CIDFontType2" : "TrueType" : function(o) {
    return Si(o.peekBytes(4)) === "OTTO";
  }(s) ? n = i ? "CIDFontType2" : "OpenType" : function(o) {
    const l = o.peekBytes(2);
    return l[0] === 37 && l[1] === 33 || l[0] === 128 && l[1] === 1;
  }(s) ? n = i ? "CIDFontType0" : t === "MMType1" ? "MMType1" : "Type1" : function(o) {
    const l = o.peekBytes(4);
    return l[0] >= 1 && l[3] >= 1 && l[3] <= 4;
  }(s) ? i ? (n = "CIDFontType0", a = "CIDFontType0C") : (n = t === "MMType1" ? "MMType1" : "Type1", a = "Type1C") : (D("getFontFileType: Unable to detect correct font file Type/Subtype."), n = t, a = e), [n, a];
}
function eg(s, t) {
  for (const e in t) s[+e] = t[e];
}
function Rm(s, t, e) {
  const i = [];
  let n;
  for (let a = 0, r = s.length; a < r; a++)
    n = M1(s[a], t), n !== -1 && (i[a] = n);
  for (const a in e)
    n = M1(e[a], t), n !== -1 && (i[+a] = n);
  return i;
}
function xT(s) {
  return s.platform === 1 && s.encoding === 0 && s.language === 0;
}
function E4(s) {
  return s.platform === 3 && s.encoding === 1 && s.language === 1033;
}
function Pm(s, t, e = !1) {
  switch (t.length) {
    case 1:
      return t.charCodeAt(0);
    case 2:
      return t.charCodeAt(0) << 8 | t.charCodeAt(1);
  }
  const i = `Unsupported CID string (charCode ${s}): "${t}".`;
  if (e) throw new st(i);
  return D(i), t;
}
function M4(s, t, e, i) {
  const n = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ new Map(), r = [], o = /* @__PURE__ */ new Set();
  let l = 0, c = Xa[l][0], h = Xa[l][1], u = null;
  for (const d in s) {
    let p = s[d];
    if (!t(p)) continue;
    if (c > h) {
      if (l++, l >= Xa.length) {
        D("Ran out of space in font private use area.");
        break;
      }
      c = Xa[l][0], h = Xa[l][1];
    }
    const m = c++;
    p === 0 && (p = e);
    let b = i.get(d);
    if (typeof b == "string") if (b.length === 1) b = b.codePointAt(0);
    else {
      if (!u) {
        u = /* @__PURE__ */ new Map();
        for (let y = 64256; y <= 64335; y++) {
          const v = String.fromCharCode(y).normalize("NFKD");
          v.length > 1 && u.set(v, y);
        }
      }
      b = u.get(b) || b.codePointAt(0);
    }
    b && (f = b, !(Xa[0][0] <= f && f <= Xa[0][1] || Xa[1][0] <= f && f <= Xa[1][1])) && !o.has(p) && (a.set(b, p), o.add(p)), n[m] = p, r[d] = m;
  }
  var f;
  return { toFontChar: r, charCodeToGlyphId: n, toUnicodeExtraMap: a, nextAvailableFontCharCode: c };
}
function F4(s, t, e) {
  const i = function(L, Y, B) {
    const et = [];
    for (const G in L) L[G] >= B || et.push({ fontCharCode: 0 | G, glyphId: L[G] });
    if (Y) for (const [G, N] of Y) N >= B || et.push({ fontCharCode: G, glyphId: N });
    et.length === 0 && et.push({ fontCharCode: 0, glyphId: 0 }), et.sort((G, N) => G.fontCharCode - N.fontCharCode);
    const H = [], P = et.length;
    for (let G = 0; G < P; ) {
      const N = et[G].fontCharCode, j = [et[G].glyphId];
      ++G;
      let V = N;
      for (; G < P && V + 1 === et[G].fontCharCode && (j.push(et[G].glyphId), ++V, ++G, V !== 65535); )
        ;
      H.push([N, V, j]);
    }
    return H;
  }(s, t, e), n = i.at(-1)[1] > 65535 ? 2 : 1;
  let a, r, o, l, c = "\0\0" + re(n) + "\0\0" + Fs(4 + 8 * n);
  for (a = i.length - 1; a >= 0 && !(i[a][0] <= 65535); --a) ;
  const h = a + 1;
  i[a][0] < 65535 && i[a][1] === 65535 && (i[a][1] = 65534);
  const u = i[a][1] < 65535 ? 1 : 0, f = h + u, d = g0.getSearchParams(f, 2);
  let p, m, b, y, v = "", w = "", A = "", x = "", k = "", I = 0;
  for (a = 0, r = h; a < r; a++) {
    p = i[a], m = p[0], b = p[1], v += re(m), w += re(b), y = p[2];
    let F = !0;
    for (o = 1, l = y.length; o < l; ++o) if (y[o] !== y[o - 1] + 1) {
      F = !1;
      break;
    }
    if (F)
      A += re(y[0] - m & 65535), x += re(0);
    else {
      const L = 2 * (f - a) + 2 * I;
      for (I += b - m + 1, A += re(0), x += re(L), o = 0, l = y.length; o < l; ++o) k += re(y[o]);
    }
  }
  u > 0 && (w += "ÿÿ", v += "ÿÿ", A += "\0", x += "\0\0");
  const T = "\0\0" + re(2 * f) + re(d.range) + re(d.entry) + re(d.rangeShift) + w + "\0\0" + v + A + x + k;
  let E = "", M = "";
  if (n > 1) {
    for (c += `\0\0
` + Fs(4 + 8 * n + 4 + T.length), E = "", a = 0, r = i.length; a < r; a++) {
      p = i[a], m = p[0], y = p[2];
      let F = y[0];
      for (o = 1, l = y.length; o < l; ++o) y[o] !== y[o - 1] + 1 && (b = p[0] + o - 1, E += Fs(m) + Fs(b) + Fs(F), m = b + 1, F = y[o]);
      E += Fs(m) + Fs(p[1]) + Fs(F);
    }
    M = "\0\f\0\0" + Fs(E.length + 16) + "\0\0\0\0" + Fs(E.length / 12);
  }
  return c + "\0" + re(T.length + 4) + T + M + E;
}
function R4(s, t, e) {
  e || (e = { unitsPerEm: 0, yMax: 0, yMin: 0, ascent: 0, descent: 0 });
  let i = 0, n = 0, a = 0, r = 0, o = null, l = 0, c = -1;
  if (t) {
    for (let y in t)
      if (y |= 0, (o > y || !o) && (o = y), l < y && (l = y), c = O_(y, c), c < 32) i |= 1 << c;
      else if (c < 64) n |= 1 << c - 32;
      else if (c < 96) a |= 1 << c - 64;
      else {
        if (!(c < 123)) throw new st("Unicode ranges Bits > 123 are reserved for internal usage");
        r |= 1 << c - 96;
      }
    l > 65535 && (l = 65535);
  } else
    o = 0, l = 255;
  const h = s.bbox || [0, 0, 0, 0], u = e.unitsPerEm || (s.fontMatrix ? 1 / Math.max(...s.fontMatrix.slice(0, 4).map(Math.abs)) : 1e3), f = s.ascentScaled ? 1 : u / Il, d = e.ascent || Math.round(f * (s.ascent || h[3]));
  let p = e.descent || Math.round(f * (s.descent || h[1]));
  p > 0 && s.descent > 0 && h[1] < 0 && (p = -p);
  const m = e.yMax || d, b = -e.yMin || -p;
  return "\0$ô\0\0\0»\0\0\0»\0\0ß\x001\0\0\0\0" + String.fromCharCode(s.fixedPitch ? 9 : 0) + "\0\0\0\0\0\0" + Fs(i) + Fs(n) + Fs(a) + Fs(r) + "*21*" + re(s.italicAngle ? 1 : 0) + re(o || s.firstChar) + re(l || s.lastChar) + re(d) + re(p) + "\0d" + re(m) + re(b) + "\0\0\0\0\0\0\0\0" + re(s.xHeight) + re(s.capHeight) + re(0) + re(o || s.firstChar) + "\0";
}
function P4(s) {
  return "\0\0\0" + Fs(Math.floor(65536 * s.italicAngle)) + "\0\0\0\0" + Fs(s.fixedPitch ? 1 : 0) + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
}
function kT(s) {
  return s.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63);
}
function Dm(s, t) {
  t || (t = [[], []]);
  const e = [t[0][0] || "Original licence", t[0][1] || s, t[0][2] || "Unknown", t[0][3] || "uniqueID", t[0][4] || s, t[0][5] || "Version 0.11", t[0][6] || kT(s), t[0][7] || "Unknown", t[0][8] || "Unknown", t[0][9] || "Unknown"], i = [];
  let n, a, r, o, l;
  for (n = 0, a = e.length; n < a; n++) {
    l = t[1][n] || e[n];
    const b = [];
    for (r = 0, o = l.length; r < o; r++) b.push(re(l.charCodeAt(r)));
    i.push(b.join(""));
  }
  const c = [e, i], h = ["\0", "\0"], u = ["\0\0", "\0"], f = ["\0\0", "	"], d = e.length * h.length;
  let p = "\0\0" + re(d) + re(12 * d + 6), m = 0;
  for (n = 0, a = h.length; n < a; n++) {
    const b = c[n];
    for (r = 0, o = b.length; r < o; r++)
      l = b[r], p += h[n] + u[n] + f[n] + re(r) + re(l.length) + re(m), m += l.length;
  }
  return p += e.join("") + i.join(""), p;
}
class D4 {
  constructor(t, e, i, n) {
    var h;
    this.name = t, this.psName = null, this.mimetype = null, this.disableFontFace = n.disableFontFace, this.fontExtraProperties = n.fontExtraProperties, this.loadedName = i.loadedName, this.isType3Font = i.isType3Font, this.missingFile = !1, this.cssFontInfo = i.cssFontInfo, this._charsCache = /* @__PURE__ */ Object.create(null), this._glyphCache = /* @__PURE__ */ Object.create(null);
    let a = !!(i.flags & _A);
    if (!a && !i.isSimulatedFlags) {
      const u = t.replaceAll(/[,_]/g, "-").split("-", 1)[0], f = x7();
      for (const d of u.split("+")) if (f[d]) {
        a = !0;
        break;
      }
    }
    this.isSerifFont = a, this.isSymbolicFont = !!(i.flags & Lp), this.isMonospace = !!(i.flags & Jg);
    let { type: r, subtype: o } = i;
    this.type = r, this.subtype = o, this.systemFontInfo = i.systemFontInfo;
    const l = t.match(/^InvalidPDFjsFont_(.*)_\d+$/);
    if (this.isInvalidPDFjsFont = !!l, this.isInvalidPDFjsFont ? this.fallbackName = l[1] : this.isMonospace ? this.fallbackName = "monospace" : this.isSerifFont ? this.fallbackName = "serif" : this.fallbackName = "sans-serif", (h = this.systemFontInfo) != null && h.guessFallback && (this.systemFontInfo.guessFallback = !1, this.systemFontInfo.css += `,${this.fallbackName}`), this.differences = i.differences, this.widths = i.widths, this.defaultWidth = i.defaultWidth, this.composite = i.composite, this.cMap = i.cMap, this.capHeight = i.capHeight / Il, this.ascent = i.ascent / Il, this.descent = i.descent / Il, this.lineHeight = this.ascent - this.descent, this.fontMatrix = i.fontMatrix, this.bbox = i.bbox, this.defaultEncoding = i.defaultEncoding, this.toUnicode = i.toUnicode, this.toFontChar = [], i.type === "Type3") {
      for (let u = 0; u < 256; u++) this.toFontChar[u] = this.differences[u] || i.defaultEncoding[u];
      return;
    }
    if (this.cidEncoding = i.cidEncoding || "", this.vertical = !!i.vertical, this.vertical && (this.vmetrics = i.vmetrics, this.defaultVMetrics = i.defaultVMetrics), !e || e.isEmpty) {
      e && D('Font file is empty in "' + t + '" (' + this.loadedName + ")"), this.fallbackToSystemFont(i);
      return;
    }
    [r, o] = AT(e, i), r === this.type && o === this.subtype || qt(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${r}/${o}.`);
    let c;
    try {
      switch (r) {
        case "MMType1":
          qt("MMType1 font (" + t + "), falling back to Type1.");
        case "Type1":
        case "CIDFontType0":
          this.mimetype = "font/opentype";
          const u = o === "Type1C" || o === "CIDFontType0C" ? new Em(e, i) : new yT(t, e, i);
          _4(i), c = this.convert(t, u, i);
          break;
        case "OpenType":
        case "TrueType":
        case "CIDFontType2":
          this.mimetype = "font/opentype", c = this.checkAndRepair(t, e, i), _4(i), this.isOpenType && (r = "OpenType");
          break;
        default:
          throw new st(`Font ${r} is not supported`);
      }
    } catch (u) {
      D(u), this.fallbackToSystemFont(i);
      return;
    }
    T4(i), this.data = c, this.type = r, this.subtype = o, this.fontMatrix = i.fontMatrix, this.widths = i.widths, this.defaultWidth = i.defaultWidth, this.toUnicode = i.toUnicode, this.seacMap = i.seacMap;
  }
  get renderer() {
    return gt(this, "renderer", iT.create(this, h0));
  }
  exportData() {
    const t = this.fontExtraProperties ? [...I4, ...wT] : I4, e = /* @__PURE__ */ Object.create(null);
    for (const i of t) {
      const n = this[i];
      n !== void 0 && (e[i] = n);
    }
    return e;
  }
  fallbackToSystemFont(t) {
    this.missingFile = !0;
    const { name: e, type: i } = this;
    let n = C2(e);
    const a = J9(), r = PA(), o = !!a[n], l = !(!r[n] || !a[r[n]]);
    n = a[n] || r[n] || n;
    const c = aT()[n];
    c && (isNaN(this.ascent) && (this.ascent = c.ascent / Il), isNaN(this.descent) && (this.descent = c.descent / Il), isNaN(this.capHeight) && (this.capHeight = c.capHeight / Il)), this.bold = /bold/gi.test(n), this.italic = /oblique|italic/gi.test(n), this.black = /Black/g.test(e);
    const h = /Narrow/g.test(e);
    if (this.remeasure = (!o || h) && Object.keys(this.widths).length > 0, (o || l) && i === "CIDFontType2" && this.cidEncoding.startsWith("Identity-")) {
      const u = t.cidToGidMap, f = [];
      if (eg(f, b4()), /Arial-?Black/i.test(e) ? eg(f, Y_()) : /Calibri/i.test(e) && eg(f, J_()), u) {
        for (const d in f) {
          const p = f[d];
          u[p] !== void 0 && (f[+d] = u[p]);
        }
        u.length !== this.toUnicode.length && t.hasIncludedToUnicodeMap && this.toUnicode instanceof bn && this.toUnicode.forEach(function(d, p) {
          const m = f[d];
          u[m] === void 0 && (f[+d] = p);
        });
      }
      this.toUnicode instanceof bn || this.toUnicode.forEach(function(d, p) {
        f[+d] = p;
      }), this.toFontChar = f, this.toUnicode = new Rd(f);
    } else if (/Symbol/i.test(n)) this.toFontChar = Rm(y7, ma(), this.differences);
    else if (/Dingbats/i.test(n)) this.toFontChar = Rm(w7, B_(), this.differences);
    else if (o || l) {
      const u = Rm(this.defaultEncoding, ma(), this.differences);
      i !== "CIDFontType2" || this.cidEncoding.startsWith("Identity-") || this.toUnicode instanceof bn || this.toUnicode.forEach(function(f, d) {
        u[+f] = d;
      }), this.toFontChar = u;
    } else {
      const u = ma(), f = [];
      this.toUnicode.forEach((d, p) => {
        if (!this.composite) {
          const m = M1(this.differences[d] || this.defaultEncoding[d], u);
          m !== -1 && (p = m);
        }
        f[+d] = p;
      }), this.composite && this.toUnicode instanceof bn && /Tahoma|Verdana/i.test(e) && eg(f, b4()), this.toFontChar = f;
    }
    T4(t), this.loadedName = n.split("-", 1)[0];
  }
  checkAndRepair(t, e, i) {
    var B, et, H;
    const n = ["OS/2", "cmap", "head", "hhea", "hmtx", "maxp", "name", "post", "loca", "glyf", "fpgm", "prep", "cvt ", "CFF "];
    function a(P, G) {
      const N = /* @__PURE__ */ Object.create(null);
      N["OS/2"] = null, N.cmap = null, N.head = null, N.hhea = null, N.hmtx = null, N.maxp = null, N.name = null, N.post = null;
      for (let j = 0; j < G; j++) {
        const V = r(P);
        n.includes(V.tag) && V.length !== 0 && (N[V.tag] = V);
      }
      return N;
    }
    function r(P) {
      const G = P.getString(4), N = P.getInt32() >>> 0, j = P.getInt32() >>> 0, V = P.getInt32() >>> 0, X = P.pos;
      P.pos = P.start || 0, P.skip(j);
      const z = P.getBytes(V);
      return P.pos = X, G === "head" && (z[8] = z[9] = z[10] = z[11] = 0, z[17] |= 32), { tag: G, checksum: N, length: V, offset: j, data: z };
    }
    function o(P) {
      return { version: P.getString(4), numTables: P.getUint16(), searchRange: P.getUint16(), entrySelector: P.getUint16(), rangeShift: P.getUint16() };
    }
    function l(P, G, N, j, V, X) {
      const z = { length: 0, sizeOfInstructions: 0 };
      if (G < 0 || G >= P.length || N > P.length || N - G <= 12) return z;
      const K = P.subarray(G, N), W = Fi(K[2], K[3]), rt = Fi(K[4], K[5]), $ = Fi(K[6], K[7]), nt = Fi(K[8], K[9]);
      W > $ && (X1(K, 2, $), X1(K, 6, W)), rt > nt && (X1(K, 4, nt), X1(K, 8, rt));
      const wt = Fi(K[0], K[1]);
      if (wt < 0)
        return wt < -1 || (j.set(K, V), z.length = K.length), z;
      let O, U = 10, Q = 0;
      for (O = 0; O < wt; O++)
        Q = (K[U] << 8 | K[U + 1]) + 1, U += 2;
      const lt = U, pt = K[U] << 8 | K[U + 1];
      z.sizeOfInstructions = pt, U += 2 + pt;
      const ft = U;
      let dt = 0;
      for (O = 0; O < Q; O++) {
        const ct = K[U++];
        192 & ct && (K[U - 1] = 63 & ct);
        let Tt = 2;
        2 & ct ? Tt = 1 : 16 & ct && (Tt = 0);
        let Bt = 2;
        4 & ct ? Bt = 1 : 32 & ct && (Bt = 0);
        const vt = Tt + Bt;
        if (dt += vt, 8 & ct) {
          const xt = K[U++];
          xt === 0 && (K[U - 1] ^= 8), O += xt, dt += xt * vt;
        }
      }
      if (dt === 0) return z;
      let ut = U + dt;
      return ut > K.length ? z : !X && pt > 0 ? (j.set(K.subarray(0, lt), V), j.set([0, 0], V + lt), j.set(K.subarray(ft, ut), V + lt + 2), ut -= pt, K.length - ut > 3 && (ut = ut + 3 & -4), z.length = ut, z) : K.length - ut > 3 ? (ut = ut + 3 & -4, j.set(K.subarray(0, ut), V), z.length = ut, z) : (j.set(K, V), z.length = K.length, z);
    }
    function c(P) {
      const G = (e.start || 0) + P.offset;
      e.pos = G;
      const N = [[], []], j = [], V = P.length, X = G + V;
      if (e.getUint16() !== 0 || V < 6) return [N, j];
      const z = e.getUint16(), K = e.getUint16();
      let W, rt;
      for (W = 0; W < z && e.pos + 12 <= X; W++) {
        const $ = { platform: e.getUint16(), encoding: e.getUint16(), language: e.getUint16(), name: e.getUint16(), length: e.getUint16(), offset: e.getUint16() };
        (xT($) || E4($)) && j.push($);
      }
      for (W = 0, rt = j.length; W < rt; W++) {
        const $ = j[W];
        if ($.length <= 0) continue;
        const nt = G + K + $.offset;
        if (nt + $.length > X) continue;
        e.pos = nt;
        const wt = $.name;
        if ($.encoding) {
          let O = "";
          for (let U = 0, Q = $.length; U < Q; U += 2) O += String.fromCharCode(e.getUint16());
          N[1][wt] = O;
        } else N[0][wt] = e.getString($.length);
      }
      return [N, j];
    }
    const h = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2];
    function u(P, G) {
      let N, j, V, X, z, K = P.data, W = 0, rt = 0, $ = 0;
      const nt = [], wt = [], O = [];
      let U = G.tooComplexToFollowFunctions, Q = !1, lt = 0, pt = 0;
      for (let dt = K.length; W < dt; ) {
        const ut = K[W++];
        if (ut === 64)
          if (j = K[W++], Q || pt) W += j;
          else for (N = 0; N < j; N++) nt.push(K[W++]);
        else if (ut === 65)
          if (j = K[W++], Q || pt) W += 2 * j;
          else for (N = 0; N < j; N++)
            V = K[W++], nt.push(V << 8 | K[W++]);
        else if ((248 & ut) == 176)
          if (j = ut - 176 + 1, Q || pt) W += j;
          else for (N = 0; N < j; N++) nt.push(K[W++]);
        else if ((248 & ut) == 184)
          if (j = ut - 184 + 1, Q || pt) W += 2 * j;
          else for (N = 0; N < j; N++)
            V = K[W++], nt.push(Fi(V, K[W++]));
        else if (ut !== 43 || U) if (ut !== 44 || U) {
          if (ut === 45) if (Q)
            Q = !1, rt = W;
          else {
            if (z = wt.pop(), !z) {
              D("TT: ENDF bad stack"), G.hintsValid = !1;
              return;
            }
            X = O.pop(), K = z.data, W = z.i, G.functionsStackDeltas[X] = nt.length - z.stackTop;
          }
          else if (ut === 137)
            (Q || pt) && (D("TT: nested IDEFs not allowed"), U = !0), Q = !0, $ = W;
          else if (ut === 88) ++lt;
          else if (ut === 27) pt = lt;
          else if (ut === 89)
            pt === lt && (pt = 0), --lt;
          else if (ut === 28 && !Q && !pt) {
            const ct = nt.at(-1);
            ct > 0 && (W += ct - 1);
          }
        } else
          (Q || pt) && (D("TT: nested FDEFs not allowed"), U = !0), Q = !0, $ = W, X = nt.pop(), G.functionsDefined[X] = { data: K, i: W };
        else if (!Q && !pt) {
          if (X = nt.at(-1), isNaN(X)) qt("TT: CALL empty stack (or invalid entry).");
          else if (G.functionsUsed[X] = !0, X in G.functionsStackDeltas) {
            const ct = nt.length + G.functionsStackDeltas[X];
            if (ct < 0) {
              D("TT: CALL invalid functions stack delta."), G.hintsValid = !1;
              return;
            }
            nt.length = ct;
          } else if (X in G.functionsDefined && !O.includes(X)) {
            if (wt.push({ data: K, i: W, stackTop: nt.length - 1 }), O.push(X), z = G.functionsDefined[X], !z) {
              D("TT: CALL non-existent function"), G.hintsValid = !1;
              return;
            }
            K = z.data, W = z.i;
          }
        }
        if (!Q && !pt) {
          let ct = 0;
          for (ut <= 142 ? ct = h[ut] : ut >= 192 && ut <= 223 ? ct = -1 : ut >= 224 && (ct = -2), ut >= 113 && ut <= 117 && (j = nt.pop(), isNaN(j) || (ct = 2 * -j)); ct < 0 && nt.length > 0; )
            nt.pop(), ct++;
          for (; ct > 0; )
            nt.push(NaN), ct--;
        }
      }
      G.tooComplexToFollowFunctions = U;
      const ft = [K];
      W > K.length && ft.push(new Uint8Array(W - K.length)), $ > rt && (D("TT: complementing a missing function tail"), ft.push(new Uint8Array([34, 45]))), function(ut, ct) {
        if (ct.length > 1) {
          let Tt, Bt, vt = 0;
          for (Tt = 0, Bt = ct.length; Tt < Bt; Tt++) vt += ct[Tt].length;
          vt = vt + 3 & -4;
          const xt = new Uint8Array(vt);
          let kt = 0;
          for (Tt = 0, Bt = ct.length; Tt < Bt; Tt++)
            xt.set(ct[Tt], kt), kt += ct[Tt].length;
          ut.data = xt, ut.length = vt;
        }
      }(P, ft);
    }
    let f, d, p, m;
    if (BA(e = new Le(new Uint8Array(e.getBytes())))) {
      const P = function(N, j) {
        var W;
        const { numFonts: V, offsetTable: X } = function($) {
          const nt = $.getString(4);
          As(nt === "ttcf", "Must be a TrueType Collection font.");
          const wt = $.getUint16(), O = $.getUint16(), U = $.getInt32() >>> 0, Q = [];
          for (let pt = 0; pt < U; pt++) Q.push($.getInt32() >>> 0);
          const lt = { ttcTag: nt, majorVersion: wt, minorVersion: O, numFonts: U, offsetTable: Q };
          switch (wt) {
            case 1:
              return lt;
            case 2:
              return lt.dsigTag = $.getInt32() >>> 0, lt.dsigLength = $.getInt32() >>> 0, lt.dsigOffset = $.getInt32() >>> 0, lt;
          }
          throw new st(`Invalid TrueType Collection majorVersion: ${wt}.`);
        }(N), z = j.split("+");
        let K;
        for (let rt = 0; rt < V; rt++) {
          N.pos = (N.start || 0) + X[rt];
          const $ = o(N), nt = a(N, $.numTables);
          if (!nt.name) throw new st('TrueType Collection font must contain a "name" table.');
          const [wt] = c(nt.name);
          for (let O = 0, U = wt.length; O < U; O++) for (let Q = 0, lt = wt[O].length; Q < lt; Q++) {
            const pt = (W = wt[O][Q]) == null ? void 0 : W.replaceAll(/\s/g, "");
            if (pt) {
              if (pt === j) return { header: $, tables: nt };
              if (!(z.length < 2)) for (const ft of z) pt === ft && (K = { name: ft, header: $, tables: nt });
            }
          }
        }
        if (K)
          return D(`TrueType Collection does not contain "${j}" font, falling back to "${K.name}" font instead.`), { header: K.header, tables: K.tables };
        throw new st(`TrueType Collection does not contain "${j}" font.`);
      }(e, this.name);
      f = P.header, d = P.tables;
    } else
      f = o(e), d = a(e, f.numTables);
    const b = !d["CFF "];
    if (b) {
      if (!d.loca) throw new st('Required "loca" table is not found');
      d.glyf || (D('Required "glyf" table is not found -- trying to recover.'), d.glyf = { tag: "glyf", data: new Uint8Array(0) }), this.isOpenType = !1;
    } else {
      const P = i.composite && (((B = i.cidToGidMap) == null ? void 0 : B.length) > 0 || !(i.cMap instanceof au));
      if (f.version === "OTTO" && !P || !d.head || !d.hhea || !d.maxp || !d.post)
        return m = new Le(d["CFF "].data), p = new Em(m, i), this.convert(t, p, i);
      delete d.glyf, delete d.loca, delete d.fpgm, delete d.prep, delete d["cvt "], this.isOpenType = !0;
    }
    if (!d.maxp) throw new st('Required "maxp" table is not found');
    e.pos = (e.start || 0) + d.maxp.offset;
    let y = e.getInt32();
    const v = e.getUint16();
    if (y !== 65536 && y !== 20480) {
      if (d.maxp.length === 6) y = 20480;
      else {
        if (!(d.maxp.length >= 32)) throw new st('"maxp" table has a wrong version number');
        y = 65536;
      }
      (function(G, N, j) {
        G[N + 3] = 255 & j, G[N + 2] = j >>> 8, G[N + 1] = j >>> 16, G[N] = j >>> 24;
      })(d.maxp.data, 0, y);
    }
    if (((et = i.scaleFactors) == null ? void 0 : et.length) === v && b) {
      const { scaleFactors: P } = i, G = bl(d.head.data[50], d.head.data[51]), N = new rT({ glyfTable: d.glyf.data, isGlyphLocationsLong: G, locaTable: d.loca.data, numGlyphs: v });
      N.scale(P);
      const { glyf: j, loca: V, isLocationLong: X } = N.write();
      d.glyf.data = j, d.loca.data = V, X !== !!G && (d.head.data[50] = 0, d.head.data[51] = X ? 1 : 0);
      const z = d.hmtx.data;
      for (let K = 0; K < v; K++) {
        const W = 4 * K, rt = Math.round(P[K] * bl(z[W], z[W + 1]));
        z[W] = rt >> 8 & 255, z[W + 1] = 255 & rt, X1(z, W + 2, Math.round(P[K] * Fi(z[W + 2], z[W + 3])));
      }
    }
    let w = v + 1, A = !0;
    w > 65535 && (A = !1, w = v, D("Not enough space in glyfs to duplicate first glyph."));
    let x = 0, k = 0;
    y >= 65536 && d.maxp.length >= 32 && (e.pos += 8, e.getUint16() > 2 && (d.maxp.data[14] = 0, d.maxp.data[15] = 2), e.pos += 4, x = e.getUint16(), e.pos += 4, k = e.getUint16()), d.maxp.data[4] = w >> 8, d.maxp.data[5] = 255 & w;
    const I = function(G, N, j, V) {
      const X = { functionsDefined: [], functionsUsed: [], functionsStackDeltas: [], tooComplexToFollowFunctions: !1, hintsValid: !0 };
      if (G && u(G, X), N && u(N, X), G && function(K, W) {
        if (!K.tooComplexToFollowFunctions) if (K.functionsDefined.length > W)
          D("TT: more functions defined than expected"), K.hintsValid = !1;
        else for (let rt = 0, $ = K.functionsUsed.length; rt < $; rt++) {
          if (rt > W) {
            D("TT: invalid function id: " + rt), K.hintsValid = !1;
            return;
          }
          if (K.functionsUsed[rt] && !K.functionsDefined[rt]) {
            D("TT: undefined function: " + rt), K.hintsValid = !1;
            return;
          }
        }
      }(X, V), j && 1 & j.length) {
        const z = new Uint8Array(j.length + 1);
        z.set(j.data), j.data = z;
      }
      return X.hintsValid;
    }(d.fpgm, d.prep, d["cvt "], x);
    if (I || (delete d.fpgm, delete d.prep, delete d["cvt "]), function(G, N, j, V, X, z) {
      if (!N) {
        j && (j.data = null);
        return;
      }
      G.pos = (G.start || 0) + N.offset, G.pos += 4, G.pos += 2, G.pos += 2, G.pos += 2, G.pos += 2, G.pos += 2, G.pos += 2, G.pos += 2, G.pos += 2, G.pos += 2;
      const K = G.getUint16();
      G.pos += 8, G.pos += 2;
      let W = G.getUint16();
      K !== 0 && (2 & bl(V.data[44], V.data[45]) || (N.data[22] = 0, N.data[23] = 0)), W > X && (qt(`The numOfMetrics (${W}) should not be greater than the numGlyphs (${X}).`), W = X, N.data[34] = (65280 & W) >> 8, N.data[35] = 255 & W);
      const rt = X - W - (j.length - 4 * W >> 1);
      if (rt > 0) {
        const $ = new Uint8Array(j.length + 2 * rt);
        $.set(j.data), z && ($[j.length] = j.data[2], $[j.length + 1] = j.data[3]), j.data = $;
      }
    }(e, d.hhea, d.hmtx, d.head, w, A), !d.head) throw new st('Required "head" table is not found');
    (function(G, N, j) {
      const V = G.data, X = function(W, rt, $, nt) {
        return (W << 24) + (rt << 16) + ($ << 8) + nt;
      }(V[0], V[1], V[2], V[3]);
      X >> 16 != 1 && (qt("Attempting to fix invalid version in head table: " + X), V[0] = 0, V[1] = 1, V[2] = 0, V[3] = 0);
      const z = bl(V[50], V[51]);
      if (z < 0 || z > 1) {
        qt("Attempting to fix invalid indexToLocFormat in head table: " + z);
        const K = N + 1;
        if (j === K << 1)
          V[50] = 0, V[51] = 0;
        else {
          if (j !== K << 2) throw new st("Could not fix indexToLocFormat: " + z);
          V[50] = 0, V[51] = 1;
        }
      }
    })(d.head, v, b ? d.loca.length : 0);
    let T = /* @__PURE__ */ Object.create(null);
    if (b) {
      const P = bl(d.head.data[50], d.head.data[51]), G = function(j, V, X, z, K, W, rt) {
        let $, nt, wt;
        z ? ($ = 4, nt = function(kt, Gt) {
          return kt[Gt] << 24 | kt[Gt + 1] << 16 | kt[Gt + 2] << 8 | kt[Gt + 3];
        }, wt = function(kt, Gt, Kt) {
          kt[Gt] = Kt >>> 24 & 255, kt[Gt + 1] = Kt >> 16 & 255, kt[Gt + 2] = Kt >> 8 & 255, kt[Gt + 3] = 255 & Kt;
        }) : ($ = 2, nt = function(kt, Gt) {
          return kt[Gt] << 9 | kt[Gt + 1] << 1;
        }, wt = function(kt, Gt, Kt) {
          kt[Gt] = Kt >> 9 & 255, kt[Gt + 1] = Kt >> 1 & 255;
        });
        const O = W ? X + 1 : X, U = $ * (1 + O), Q = new Uint8Array(U);
        Q.set(j.data.subarray(0, U)), j.data = Q;
        const lt = V.data, pt = lt.length, ft = new Uint8Array(pt);
        let dt, ut;
        const ct = [];
        for (dt = 0, ut = 0; dt < X + 1; dt++, ut += $) {
          let xt = nt(Q, ut);
          xt > pt && (xt = pt), ct.push({ index: dt, offset: xt, endOffset: 0 });
        }
        for (ct.sort((xt, kt) => xt.offset - kt.offset), dt = 0; dt < X; dt++) ct[dt].endOffset = ct[dt + 1].offset;
        for (ct.sort((xt, kt) => xt.index - kt.index), dt = 0; dt < X; dt++) {
          const { offset: xt, endOffset: kt } = ct[dt];
          if (xt !== 0 || kt !== 0) break;
          const Gt = ct[dt + 1].offset;
          if (Gt !== 0) {
            ct[dt].endOffset = Gt;
            break;
          }
        }
        const Tt = ct.at(-2);
        Tt.offset !== 0 && Tt.endOffset === 0 && (Tt.endOffset = pt);
        const Bt = /* @__PURE__ */ Object.create(null);
        let vt = 0;
        for (wt(Q, 0, vt), dt = 0, ut = $; dt < X; dt++, ut += $) {
          const xt = l(lt, ct[dt].offset, ct[dt].endOffset, ft, vt, K), kt = xt.length;
          kt === 0 && (Bt[dt] = !0), xt.sizeOfInstructions > rt && (rt = xt.sizeOfInstructions), vt += kt, wt(Q, ut, vt);
        }
        if (vt === 0) {
          const xt = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]);
          for (dt = 0, ut = $; dt < O; dt++, ut += $) wt(Q, ut, xt.length);
          V.data = xt;
        } else if (W) {
          const xt = nt(Q, $);
          ft.length > xt + vt ? V.data = ft.subarray(0, xt + vt) : (V.data = new Uint8Array(xt + vt), V.data.set(ft.subarray(0, vt))), V.data.set(ft.subarray(0, xt), vt), wt(j.data, Q.length - $, vt + xt);
        } else V.data = ft.subarray(0, vt);
        return { missingGlyphs: Bt, maxSizeOfInstructions: rt };
      }(d.loca, d.glyf, v, P, I, A, k);
      T = G.missingGlyphs, y >= 65536 && d.maxp.length >= 32 && (d.maxp.data[26] = G.maxSizeOfInstructions >> 8, d.maxp.data[27] = 255 & G.maxSizeOfInstructions);
    }
    if (!d.hhea) throw new st('Required "hhea" table is not found');
    d.hhea.data[10] === 0 && d.hhea.data[11] === 0 && (d.hhea.data[10] = 255, d.hhea.data[11] = 255);
    const E = { unitsPerEm: bl(d.head.data[18], d.head.data[19]), yMax: Fi(d.head.data[42], d.head.data[43]), yMin: Fi(d.head.data[38], d.head.data[39]), ascent: Fi(d.hhea.data[4], d.hhea.data[5]), descent: Fi(d.hhea.data[6], d.hhea.data[7]), lineGap: Fi(d.hhea.data[8], d.hhea.data[9]) };
    this.ascent = E.ascent / E.unitsPerEm, this.descent = E.descent / E.unitsPerEm, this.lineGap = E.lineGap / E.unitsPerEm, (H = this.cssFontInfo) != null && H.lineHeight ? (this.lineHeight = this.cssFontInfo.metrics.lineHeight, this.lineGap = this.cssFontInfo.metrics.lineGap) : this.lineHeight = this.ascent - this.descent + this.lineGap, d.post && function(G, N, j) {
      const V = (e.start || 0) + G.offset;
      e.pos = V;
      const X = V + G.length, z = e.getInt32();
      e.skip(28);
      let K, W, rt = !0;
      switch (z) {
        case 65536:
          K = p4;
          break;
        case 131072:
          const $ = e.getUint16();
          if ($ !== j) {
            rt = !1;
            break;
          }
          const nt = [];
          for (W = 0; W < $; ++W) {
            const U = e.getUint16();
            if (U >= 32768) {
              rt = !1;
              break;
            }
            nt.push(U);
          }
          if (!rt) break;
          const wt = [], O = [];
          for (; e.pos < X; ) {
            const U = e.getByte();
            for (O.length = U, W = 0; W < U; ++W) O[W] = String.fromCharCode(e.getByte());
            wt.push(O.join(""));
          }
          for (K = [], W = 0; W < $; ++W) {
            const U = nt[W];
            U < 258 ? K.push(p4[U]) : K.push(wt[U - 258]);
          }
          break;
        case 196608:
          break;
        default:
          D("Unknown/unsupported post table version " + z), rt = !1, N.defaultEncoding && (K = N.defaultEncoding);
      }
      return N.glyphNames = K, rt;
    }(d.post, i, v), d.post = { tag: "post", data: P4(i) };
    const M = /* @__PURE__ */ Object.create(null);
    function F(P) {
      return !T[P];
    }
    if (i.composite) {
      const P = i.cidToGidMap || [], G = P.length === 0;
      i.cMap.forEach(function(N, j) {
        if (typeof j == "string" && (j = Pm(N, j, !0)), j > 65535) throw new st("Max size of CID is 65,535");
        let V = -1;
        G ? V = j : P[j] !== void 0 && (V = P[j]), V >= 0 && V < v && F(V) && (M[N] = V);
      });
    } else {
      const P = function(K, W, rt, $) {
        if (!K)
          return D("No cmap table available."), { platformId: -1, encodingId: -1, mappings: [], hasShortCmap: !1 };
        let nt, wt = (W.start || 0) + K.offset;
        W.pos = wt, W.skip(2);
        const O = W.getUint16();
        let U, Q = !1;
        for (let Bt = 0; Bt < O; Bt++) {
          const vt = W.getUint16(), xt = W.getUint16(), kt = W.getInt32() >>> 0;
          let Gt = !1;
          if ((U == null ? void 0 : U.platformId) !== vt || (U == null ? void 0 : U.encodingId) !== xt) {
            if (vt !== 0 || xt !== 0 && xt !== 1 && xt !== 3) if (vt === 1 && xt === 0) Gt = !0;
            else if (vt !== 3 || xt !== 1 || !$ && U) {
              if (rt && vt === 3 && xt === 0) {
                Gt = !0;
                let Kt = !0;
                if (Bt < O - 1) {
                  const Mi = W.peekBytes(2);
                  bl(Mi[0], Mi[1]) < vt && (Kt = !1);
                }
                Kt && (Q = !0);
              }
            } else
              Gt = !0, rt || (Q = !0);
            else Gt = !0;
            if (Gt && (U = { platformId: vt, encodingId: xt, offset: kt }), Q) break;
          }
        }
        if (U && (W.pos = wt + U.offset), !U || W.peekByte() === -1)
          return D("Could not find a preferred cmap table."), { platformId: -1, encodingId: -1, mappings: [], hasShortCmap: !1 };
        const lt = W.getUint16();
        let pt = !1;
        const ft = [];
        let dt, ut;
        if (lt === 0) {
          for (W.skip(4), dt = 0; dt < 256; dt++) {
            const Bt = W.getByte();
            Bt && ft.push({ charCode: dt, glyphId: Bt });
          }
          pt = !0;
        } else if (lt === 2) {
          W.skip(4);
          const Bt = [];
          let vt = 0;
          for (let kt = 0; kt < 256; kt++) {
            const Gt = W.getUint16() >> 3;
            Bt.push(Gt), vt = Math.max(Gt, vt);
          }
          const xt = [];
          for (let kt = 0; kt <= vt; kt++) xt.push({ firstCode: W.getUint16(), entryCount: W.getUint16(), idDelta: Fi(W.getByte(), W.getByte()), idRangePos: W.pos + W.getUint16() });
          for (let kt = 0; kt < 256; kt++) if (Bt[kt] === 0)
            W.pos = xt[0].idRangePos + 2 * kt, ut = W.getUint16(), ft.push({ charCode: kt, glyphId: ut });
          else {
            const Gt = xt[Bt[kt]];
            for (dt = 0; dt < Gt.entryCount; dt++) {
              const Kt = (kt << 8) + dt + Gt.firstCode;
              W.pos = Gt.idRangePos + 2 * dt, ut = W.getUint16(), ut !== 0 && (ut = (ut + Gt.idDelta) % 65536), ft.push({ charCode: Kt, glyphId: ut });
            }
          }
        } else if (lt === 4) {
          W.skip(4);
          const Bt = W.getUint16() >> 1;
          W.skip(6);
          const vt = [];
          let xt;
          for (xt = 0; xt < Bt; xt++) vt.push({ end: W.getUint16() });
          for (W.skip(2), xt = 0; xt < Bt; xt++) vt[xt].start = W.getUint16();
          for (xt = 0; xt < Bt; xt++) vt[xt].delta = W.getUint16();
          let kt, Gt = 0;
          for (xt = 0; xt < Bt; xt++) {
            nt = vt[xt];
            const Mi = W.getUint16();
            Mi ? (kt = (Mi >> 1) - (Bt - xt), nt.offsetIndex = kt, Gt = Math.max(Gt, kt + nt.end - nt.start + 1)) : nt.offsetIndex = -1;
          }
          const Kt = [];
          for (dt = 0; dt < Gt; dt++) Kt.push(W.getUint16());
          for (xt = 0; xt < Bt; xt++) {
            nt = vt[xt], wt = nt.start;
            const Mi = nt.end, os = nt.delta;
            for (kt = nt.offsetIndex, dt = wt; dt <= Mi; dt++) dt !== 65535 && (ut = kt < 0 ? dt : Kt[kt + dt - wt], ut = ut + os & 65535, ft.push({ charCode: dt, glyphId: ut }));
          }
        } else if (lt === 6) {
          W.skip(4);
          const Bt = W.getUint16(), vt = W.getUint16();
          for (dt = 0; dt < vt; dt++) {
            ut = W.getUint16();
            const xt = Bt + dt;
            ft.push({ charCode: xt, glyphId: ut });
          }
        } else {
          if (lt !== 12)
            return D("cmap table has unsupported format: " + lt), { platformId: -1, encodingId: -1, mappings: [], hasShortCmap: !1 };
          {
            W.skip(10);
            const Bt = W.getInt32() >>> 0;
            for (dt = 0; dt < Bt; dt++) {
              const vt = W.getInt32() >>> 0, xt = W.getInt32() >>> 0;
              let kt = W.getInt32() >>> 0;
              for (let Gt = vt; Gt <= xt; Gt++) ft.push({ charCode: Gt, glyphId: kt++ });
            }
          }
        }
        ft.sort((Bt, vt) => Bt.charCode - vt.charCode);
        const ct = [], Tt = /* @__PURE__ */ new Set();
        for (const Bt of ft) {
          const { charCode: vt } = Bt;
          Tt.has(vt) || (Tt.add(vt), ct.push(Bt));
        }
        return { platformId: U.platformId, encodingId: U.encodingId, mappings: ct, hasShortCmap: pt };
      }(d.cmap, e, this.isSymbolicFont, i.hasEncoding), G = P.platformId, N = P.encodingId, j = P.mappings;
      let V = [], X = !1;
      if (!i.hasEncoding || i.baseEncodingName !== "MacRomanEncoding" && i.baseEncodingName !== "WinAnsiEncoding" || (V = c0(i.baseEncodingName)), i.hasEncoding && !this.isSymbolicFont && (G === 3 && N === 1 || G === 1 && N === 0)) {
        const z = ma();
        for (let K = 0; K < 256; K++) {
          let W;
          if (W = this.differences[K] !== void 0 ? this.differences[K] : V.length && V[K] !== "" ? V[K] : Ur[K], !W) continue;
          const rt = TA(W, z);
          let $;
          if (G === 3 && N === 1 ? $ = z[rt] : G === 1 && N === 0 && ($ = b7.indexOf(rt)), $ === void 0) {
            if (!i.glyphNames && i.hasIncludedToUnicodeMap && !(this.toUnicode instanceof bn)) {
              const nt = this.toUnicode.get(K);
              nt && ($ = nt.codePointAt(0));
            }
            if ($ === void 0) continue;
          }
          for (const nt of j) if (nt.charCode === $) {
            M[K] = nt.glyphId;
            break;
          }
        }
      } else if (G === 0) {
        for (const z of j) M[z.charCode] = z.glyphId;
        X = !0;
      } else if (G === 3 && N === 0) for (const z of j) {
        let K = z.charCode;
        K >= 61440 && K <= 61695 && (K &= 255), M[K] = z.glyphId;
      }
      else for (const z of j) M[z.charCode] = z.glyphId;
      if (i.glyphNames && (V.length || this.differences.length)) for (let z = 0; z < 256; ++z) {
        if (!X && M[z] !== void 0) continue;
        const K = this.differences[z] || V[z];
        if (!K) continue;
        const W = i.glyphNames.indexOf(K);
        W > 0 && F(W) && (M[z] = W);
      }
    }
    M.length === 0 && (M[0] = 0);
    let L = w - 1;
    if (A || (L = 0), !i.cssFontInfo) {
      const P = M4(M, F, L, this.toUnicode);
      this.toFontChar = P.toFontChar, d.cmap = { tag: "cmap", data: F4(P.charCodeToGlyphId, P.toUnicodeExtraMap, w) }, d["OS/2"] && function(N, j) {
        j.pos = (j.start || 0) + N.offset;
        const V = j.getUint16();
        j.skip(60);
        const X = j.getUint16();
        return V < 4 && 768 & X || j.getUint16() > j.getUint16() || (j.skip(6), j.getUint16() === 0) ? !1 : (N.data[8] = N.data[9] = 0, !0);
      }(d["OS/2"], e) || (d["OS/2"] = { tag: "OS/2", data: R4(i, P.charCodeToGlyphId, E) });
    }
    if (!b) try {
      m = new Le(d["CFF "].data), p = new v7(m, i, h0).parse(), p.duplicateFirstGlyph();
      const P = new I2(p);
      d["CFF "].data = P.compile();
    } catch {
      D("Failed to compile font " + i.loadedName);
    }
    if (d.name) {
      const [P, G] = c(d.name);
      d.name.data = Dm(t, P), this.psName = P[0][6] || null, i.composite || function(j, V, X) {
        if (j.isInternalFont || j.hasIncludedToUnicodeMap || j.hasEncoding || j.toUnicode instanceof bn || !V || X.length === 0 || j.defaultEncoding === l0) return;
        for (const rt of X) if (!E4(rt)) return;
        const z = l0, K = [], W = ma();
        for (const rt in z) {
          const $ = z[rt];
          if ($ === "") continue;
          const nt = W[$];
          nt !== void 0 && (K[rt] = String.fromCharCode(nt));
        }
        K.length > 0 && j.toUnicode.amend(K);
      }(i, this.isSymbolicFont, G);
    } else d.name = { tag: "name", data: Dm(this.name) };
    const Y = new g0(f.version);
    for (const P in d) Y.addTable(P, d[P].data);
    return Y.toArray();
  }
  convert(t, e, i) {
    i.fixedPitch = !1, i.builtInEncoding && function(b, y) {
      if (b.isInternalFont || b.hasIncludedToUnicodeMap || y === b.defaultEncoding || b.toUnicode instanceof bn) return;
      const v = [], w = ma();
      for (const A in y) {
        if (b.hasEncoding && (b.baseEncodingName || b.differences[A] !== void 0)) continue;
        const x = M1(y[A], w);
        x !== -1 && (v[A] = String.fromCharCode(x));
      }
      v.length > 0 && b.toUnicode.amend(v);
    }(i, i.builtInEncoding);
    let n = 1;
    e instanceof Em && (n = e.numGlyphs - 1);
    const a = e.getGlyphMapping(i);
    let r = null, o = a, l = null;
    i.cssFontInfo || (r = M4(a, e.hasGlyphId.bind(e), n, this.toUnicode), this.toFontChar = r.toFontChar, o = r.charCodeToGlyphId, l = r.toUnicodeExtraMap);
    const c = e.numGlyphs;
    function h(m, b) {
      let y = null;
      for (const v in m) b === m[v] && (y || (y = [])).push(0 | v);
      return y;
    }
    function u(m, b) {
      for (const y in m) if (b === m[y]) return 0 | y;
      return r.charCodeToGlyphId[r.nextAvailableFontCharCode] = b, r.nextAvailableFontCharCode++;
    }
    const f = e.seacs;
    if (r && (f != null && f.length)) {
      const m = i.fontMatrix || Qc, b = e.getCharset(), y = /* @__PURE__ */ Object.create(null);
      for (let v in f) {
        v |= 0;
        const w = f[v], A = Ur[w[2]], x = Ur[w[3]], k = b.indexOf(A), I = b.indexOf(x);
        if (k < 0 || I < 0) continue;
        const T = { x: w[0] * m[0] + w[1] * m[2] + m[4], y: w[0] * m[1] + w[1] * m[3] + m[5] }, E = h(a, v);
        if (E) for (const M of E) {
          const F = r.charCodeToGlyphId, L = u(F, k), Y = u(F, I);
          y[M] = { baseFontCharCode: L, accentFontCharCode: Y, accentOffset: T };
        }
      }
      i.seacMap = y;
    }
    const d = i.fontMatrix ? 1 / Math.max(...i.fontMatrix.slice(0, 4).map(Math.abs)) : 1e3, p = new g0("OTTO");
    return p.addTable("CFF ", e.data), p.addTable("OS/2", R4(i, o)), p.addTable("cmap", F4(o, l, c)), p.addTable("head", "\0\0\0\0\0\0\0\0\0\0_<õ\0\0" + yl(d) + "\0\0\0\0\v~'\0\0\0\0\v~'\0\0" + yl(i.descent) + "ÿ" + yl(i.ascent) + re(i.italicAngle ? 2 : 0) + "\0\0\0\0\0\0\0"), p.addTable("hhea", "\0\0\0" + yl(i.ascent) + yl(i.descent) + "\0\0ÿÿ\0\0\0\0\0\0" + yl(i.capHeight) + yl(Math.tan(i.italicAngle) * i.xHeight) + "\0\0\0\0\0\0\0\0\0\0\0\0" + re(c)), p.addTable("hmtx", function() {
      const b = e.charstrings, y = e.cff ? e.cff.widths : null;
      let v = "\0\0\0\0";
      for (let w = 1, A = c; w < A; w++) {
        let x = 0;
        if (b) {
          const k = b[w - 1];
          x = "width" in k ? k.width : 0;
        } else y && (x = Math.ceil(y[w] || 0));
        v += re(x) + re(0);
      }
      return v;
    }()), p.addTable("maxp", "\0\0P\0" + re(c)), p.addTable("name", Dm(t)), p.addTable("post", P4(i)), p.toArray();
  }
  get _spaceWidth() {
    const t = ["space", "minus", "one", "i", "I"];
    let e;
    for (const i of t) {
      if (i in this.widths) {
        e = this.widths[i];
        break;
      }
      const n = ma()[i];
      let a = 0;
      if (this.composite && this.cMap.contains(n) && (a = this.cMap.lookup(n), typeof a == "string" && (a = Pm(n, a))), !a && this.toUnicode && (a = this.toUnicode.charCodeOf(n)), a <= 0 && (a = n), e = this.widths[a], e) break;
    }
    return gt(this, "_spaceWidth", e || this.defaultWidth);
  }
  _charToGlyph(t, e = !1) {
    var d, p, m;
    let i, n, a, r = this._glyphCache[t];
    if ((r == null ? void 0 : r.isSpace) === e) return r;
    let o = t;
    (d = this.cMap) != null && d.contains(t) && (o = this.cMap.lookup(t), typeof o == "string" && (o = Pm(t, o))), n = this.widths[o], typeof n != "number" && (n = this.defaultWidth);
    const l = (p = this.vmetrics) == null ? void 0 : p[o];
    let c = this.toUnicode.get(t) || t;
    typeof c == "number" && (c = String.fromCharCode(c));
    let h = this.toFontChar[t] !== void 0;
    if (i = this.toFontChar[t] || t, this.missingFile) {
      const b = this.differences[t] || this.defaultEncoding[t];
      (b === ".notdef" || b === "") && this.type === "Type1" && (i = 32, b === "" && (n || (n = this._spaceWidth), c = String.fromCharCode(i))), i = function(v) {
        return v >= 65520 && v <= 65535 ? 0 : v >= 62976 && v <= 63743 ? L_()[v] || v : v === 173 ? 45 : v;
      }(i);
    }
    this.isType3Font && (a = i);
    let u = null;
    if ((m = this.seacMap) != null && m[t]) {
      h = !0;
      const b = this.seacMap[t];
      i = b.baseFontCharCode, u = { fontChar: String.fromCodePoint(b.accentFontCharCode), offset: b.accentOffset };
    }
    let f = "";
    if (typeof i == "number" && (i <= 1114111 ? f = String.fromCodePoint(i) : D(`charToGlyph - invalid fontCharCode: ${i}`)), this.missingFile && this.vertical && f.length === 1) {
      const b = q_()[f.charCodeAt(0)];
      b && (f = c = String.fromCharCode(b));
    }
    return r = new vT(t, f, c, u, n, l, a, e, h), this._glyphCache[t] = r;
  }
  charsToGlyphs(t) {
    let e = this._charsCache[t];
    if (e) return e;
    if (e = [], this.cMap) {
      const i = /* @__PURE__ */ Object.create(null), n = t.length;
      let a = 0;
      for (; a < n; ) {
        this.cMap.readCharCode(t, a, i);
        const { charcode: r, length: o } = i;
        a += o;
        const l = this._charToGlyph(r, o === 1 && t.charCodeAt(a - 1) === 32);
        e.push(l);
      }
    } else for (let i = 0, n = t.length; i < n; ++i) {
      const a = t.charCodeAt(i), r = this._charToGlyph(a, a === 32);
      e.push(r);
    }
    return this._charsCache[t] = e;
  }
  getCharPositions(t) {
    const e = [];
    if (this.cMap) {
      const i = /* @__PURE__ */ Object.create(null);
      let n = 0;
      for (; n < t.length; ) {
        this.cMap.readCharCode(t, n, i);
        const a = i.length;
        e.push([n, n + a]), n += a;
      }
    } else for (let i = 0, n = t.length; i < n; ++i) e.push([i, i + 1]);
    return e;
  }
  get glyphCacheValues() {
    return Object.values(this._glyphCache);
  }
  encodeString(t) {
    const e = [], i = [], n = () => e.length % 2 == 1, a = this.toUnicode instanceof bn ? (r) => this.toUnicode.charCodeOf(r) : (r) => this.toUnicode.charCodeOf(String.fromCodePoint(r));
    for (let r = 0, o = t.length; r < o; r++) {
      const l = t.codePointAt(r);
      if (l > 55295 && (l < 57344 || l > 65533) && r++, this.toUnicode) {
        const c = a(l);
        if (c !== -1) {
          n() && (e.push(i.join("")), i.length = 0);
          for (let h = (this.cMap ? this.cMap.getCharCodeLength(c) : 1) - 1; h >= 0; h--) i.push(String.fromCharCode(c >> 8 * h & 255));
          continue;
        }
      }
      n() || (e.push(i.join("")), i.length = 0), i.push(String.fromCodePoint(l));
    }
    return e.push(i.join("")), e;
  }
}
class N4 {
  constructor(t) {
    this.error = t, this.loadedName = "g_font_error", this.missingFile = !0;
  }
  charsToGlyphs() {
    return [];
  }
  encodeString(t) {
    return [t];
  }
  exportData() {
    return { error: this.error };
  }
}
const h6 = 2, Qg = 3, LA = 4, OA = 5, UA = 6, qA = 7;
class ST {
  constructor() {
    Wt("Cannot initialize Pattern.");
  }
  static parseShading(t, e, i, n, a, r) {
    const o = t instanceof Ot ? t.dict : t, l = o.get("ShadingType");
    try {
      switch (l) {
        case h6:
        case Qg:
          return new CT(o, e, i, n, a, r);
        case LA:
        case OA:
        case UA:
        case qA:
          return new u6(t, e, i, n, a, r);
        default:
          throw new st("Unsupported ShadingType: " + l);
      }
    } catch (c) {
      if (c instanceof ke) throw c;
      return D(c), new _T();
    }
  }
}
class ru {
  getIR() {
    Wt("Abstract method `getIR` called.");
  }
}
ht(ru, "SMALL_NUMBER", 1e-6);
class CT extends ru {
  constructor(t, e, i, n, a, r) {
    super(), this.shadingType = t.get("ShadingType");
    let o = 0;
    if (this.shadingType === h6 ? o = 4 : this.shadingType === Qg && (o = 6), this.coordsArr = t.getArray("Coords"), !ci(this.coordsArr, o)) throw new st("RadialAxialShading: Invalid /Coords array.");
    const l = te.parse({ cs: t.getRaw("CS") || t.getRaw("ColorSpace"), xref: e, resources: i, pdfFunctionFactory: n, globalColorSpaceCache: a, localColorSpaceCache: r });
    this.bbox = Kr(t.getArray("BBox"), null);
    let c = 0, h = 1;
    const u = t.getArray("Domain");
    ci(u, 2) && ([c, h] = u);
    let f = !1, d = !1;
    const p = t.getArray("Extend");
    if (function(X, z) {
      return Array.isArray(X) && X.length === z && X.every((K) => typeof K == "boolean");
    }(p, 2) && ([f, d] = p), !(this.shadingType !== Qg || f && d)) {
      const [V, X, z, K, W, rt] = this.coordsArr, $ = Math.hypot(V - K, X - W);
      z <= rt + $ && rt <= z + $ && D("Unsupported radial gradient.");
    }
    this.extendStart = f, this.extendEnd = d;
    const m = t.getRaw("Function"), b = n.create(m, !0), y = (h - c) / 840, v = this.colorStops = [];
    if (c >= h || y <= 0) {
      qt("Bad shading domain.");
      return;
    }
    const w = new Float32Array(l.numComps), A = new Float32Array(1);
    let x = 0;
    A[0] = c, b(A, 0, w, 0);
    const k = new Uint8ClampedArray(3);
    l.getRgb(w, 0, k);
    let [I, T, E] = k;
    v.push([0, se.makeHexColor(I, T, E)]);
    let M = 1;
    A[0] = c + y, b(A, 0, w, 0), l.getRgb(w, 0, k);
    let [F, L, Y] = k, B = F - I + 1, et = L - T + 1, H = Y - E + 1, P = F - I - 1, G = L - T - 1, N = Y - E - 1;
    for (let V = 2; V < 840; V++) {
      A[0] = c + V * y, b(A, 0, w, 0), l.getRgb(w, 0, k);
      const [X, z, K] = k, W = V - x;
      if (B = Math.min(B, (X - I + 1) / W), et = Math.min(et, (z - T + 1) / W), H = Math.min(H, (K - E + 1) / W), P = Math.max(P, (X - I - 1) / W), G = Math.max(G, (z - T - 1) / W), N = Math.max(N, (K - E - 1) / W), !(P <= B && G <= et && N <= H)) {
        const rt = se.makeHexColor(F, L, Y);
        v.push([M / 840, rt]), B = X - F + 1, et = z - L + 1, H = K - Y + 1, P = X - F - 1, G = z - L - 1, N = K - Y - 1, x = M, I = F, T = L, E = Y;
      }
      M = V, F = X, L = z, Y = K;
    }
    v.push([1, se.makeHexColor(F, L, Y)]);
    let j = "transparent";
    t.has("Background") && (j = l.getRgbHex(t.get("Background"), 0)), f || (v.unshift([0, j]), v[1][0] += ru.SMALL_NUMBER), d || (v.at(-1)[0] -= ru.SMALL_NUMBER, v.push([1, j])), this.colorStops = v;
  }
  getIR() {
    const { coordsArr: t, shadingType: e } = this;
    let i, n, a, r, o;
    return e === h6 ? (n = [t[0], t[1]], a = [t[2], t[3]], r = null, o = null, i = "axial") : e === Qg ? (n = [t[0], t[1]], a = [t[3], t[4]], r = t[2], o = t[5], i = "radial") : Wt(`getPattern type unknown: ${e}`), ["RadialAxial", i, this.bbox, this.colorStops, n, a, r, o];
  }
}
class IT {
  constructor(t, e) {
    this.stream = t, this.context = e, this.buffer = 0, this.bufferLength = 0;
    const i = e.numComps;
    this.tmpCompsBuf = new Float32Array(i);
    const n = e.colorSpace.numComps;
    this.tmpCsCompsBuf = e.colorFn ? new Float32Array(n) : this.tmpCompsBuf;
  }
  get hasData() {
    if (this.stream.end) return this.stream.pos < this.stream.end;
    if (this.bufferLength > 0) return !0;
    const t = this.stream.getByte();
    return t < 0 ? !1 : (this.buffer = t, this.bufferLength = 8, !0);
  }
  readBits(t) {
    const { stream: e } = this;
    let { buffer: i, bufferLength: n } = this;
    if (t === 32) {
      if (n === 0) return e.getInt32() >>> 0;
      i = i << 24 | e.getByte() << 16 | e.getByte() << 8 | e.getByte();
      const a = e.getByte();
      return this.buffer = a & (1 << n) - 1, (i << 8 - n | (255 & a) >> n) >>> 0;
    }
    if (t === 8 && n === 0) return e.getByte();
    for (; n < t; )
      i = i << 8 | e.getByte(), n += 8;
    return n -= t, this.bufferLength = n, this.buffer = i & (1 << n) - 1, i >> n;
  }
  align() {
    this.buffer = 0, this.bufferLength = 0;
  }
  readFlag() {
    return this.readBits(this.context.bitsPerFlag);
  }
  readCoordinate() {
    const { bitsPerCoordinate: t, decode: e } = this.context, i = this.readBits(t), n = this.readBits(t), a = t < 32 ? 1 / ((1 << t) - 1) : 23283064365386963e-26;
    return [i * a * (e[1] - e[0]) + e[0], n * a * (e[3] - e[2]) + e[2]];
  }
  readComponents() {
    const { bitsPerComponent: t, colorFn: e, colorSpace: i, decode: n, numComps: a } = this.context, r = t < 32 ? 1 / ((1 << t) - 1) : 23283064365386963e-26, o = this.tmpCompsBuf;
    for (let c = 0, h = 4; c < a; c++, h += 2) {
      const u = this.readBits(t);
      o[c] = u * r * (n[h + 1] - n[h]) + n[h];
    }
    const l = this.tmpCsCompsBuf;
    return e == null || e(o, 0, l, 0), i.getRgb(l, 0);
  }
}
let tp = /* @__PURE__ */ Object.create(null);
function B4(s) {
  return tp[s] || (tp[s] = function(e) {
    const i = [];
    for (let n = 0; n <= e; n++) {
      const a = n / e, r = 1 - a;
      i.push(new Float32Array([r ** 3, 3 * a * r ** 2, 3 * a ** 2 * r, a ** 3]));
    }
    return i;
  }(s));
}
const Nn = class Nn extends ru {
  constructor(t, e, i, n, a, r) {
    if (super(), !(t instanceof Ot)) throw new st("Mesh data is not a stream");
    const o = t.dict;
    this.shadingType = o.get("ShadingType"), this.bbox = Kr(o.getArray("BBox"), null);
    const l = te.parse({ cs: o.getRaw("CS") || o.getRaw("ColorSpace"), xref: e, resources: i, pdfFunctionFactory: n, globalColorSpaceCache: a, localColorSpaceCache: r });
    this.background = o.has("Background") ? l.getRgb(o.get("Background"), 0) : null;
    const c = o.getRaw("Function"), h = c ? n.create(c, !0) : null;
    this.coords = [], this.colors = [], this.figures = [];
    const u = { bitsPerCoordinate: o.get("BitsPerCoordinate"), bitsPerComponent: o.get("BitsPerComponent"), bitsPerFlag: o.get("BitsPerFlag"), decode: o.getArray("Decode"), colorFn: h, colorSpace: l, numComps: h ? 1 : l.numComps }, f = new IT(t, u);
    let d = !1;
    switch (this.shadingType) {
      case LA:
        this._decodeType4Shading(f);
        break;
      case OA:
        const p = 0 | o.get("VerticesPerRow");
        if (p < 2) throw new st("Invalid VerticesPerRow");
        this._decodeType5Shading(f, p);
        break;
      case UA:
        this._decodeType6Shading(f), d = !0;
        break;
      case qA:
        this._decodeType7Shading(f), d = !0;
        break;
      default:
        Wt("Unsupported mesh type.");
    }
    if (d) {
      this._updateBounds();
      for (let p = 0, m = this.figures.length; p < m; p++) this._buildFigureFromPatch(p);
    }
    this._updateBounds(), this._packData();
  }
  _decodeType4Shading(t) {
    const e = this.coords, i = this.colors, n = [];
    let a = 0;
    for (; t.hasData; ) {
      const r = t.readFlag(), o = t.readCoordinate(), l = t.readComponents();
      if (a === 0) {
        if (!(0 <= r && r <= 2)) throw new st("Unknown type4 flag");
        switch (r) {
          case 0:
            a = 3;
            break;
          case 1:
            n.push(n.at(-2), n.at(-1)), a = 1;
            break;
          case 2:
            n.push(n.at(-3), n.at(-1)), a = 1;
        }
      }
      n.push(e.length), e.push(o), i.push(l), a--, t.align();
    }
    this.figures.push({ type: "triangles", coords: new Int32Array(n), colors: new Int32Array(n) });
  }
  _decodeType5Shading(t, e) {
    const i = this.coords, n = this.colors, a = [];
    for (; t.hasData; ) {
      const r = t.readCoordinate(), o = t.readComponents();
      a.push(i.length), i.push(r), n.push(o);
    }
    this.figures.push({ type: "lattice", coords: new Int32Array(a), colors: new Int32Array(a), verticesPerRow: e });
  }
  _decodeType6Shading(t) {
    const e = this.coords, i = this.colors, n = new Int32Array(16), a = new Int32Array(4);
    for (; t.hasData; ) {
      const r = t.readFlag();
      if (!(0 <= r && r <= 3)) throw new st("Unknown type6 flag");
      const o = e.length;
      for (let d = 0, p = r !== 0 ? 8 : 12; d < p; d++) e.push(t.readCoordinate());
      const l = i.length;
      for (let d = 0, p = r !== 0 ? 2 : 4; d < p; d++) i.push(t.readComponents());
      let c, h, u, f;
      switch (r) {
        case 0:
          n[12] = o + 3, n[13] = o + 4, n[14] = o + 5, n[15] = o + 6, n[8] = o + 2, n[11] = o + 7, n[4] = o + 1, n[7] = o + 8, n[0] = o, n[1] = o + 11, n[2] = o + 10, n[3] = o + 9, a[2] = l + 1, a[3] = l + 2, a[0] = l, a[1] = l + 3;
          break;
        case 1:
          c = n[12], h = n[13], u = n[14], f = n[15], n[12] = f, n[13] = o + 0, n[14] = o + 1, n[15] = o + 2, n[8] = u, n[11] = o + 3, n[4] = h, n[7] = o + 4, n[0] = c, n[1] = o + 7, n[2] = o + 6, n[3] = o + 5, c = a[2], h = a[3], a[2] = h, a[3] = l, a[0] = c, a[1] = l + 1;
          break;
        case 2:
          c = n[15], h = n[11], n[12] = n[3], n[13] = o + 0, n[14] = o + 1, n[15] = o + 2, n[8] = n[7], n[11] = o + 3, n[4] = h, n[7] = o + 4, n[0] = c, n[1] = o + 7, n[2] = o + 6, n[3] = o + 5, c = a[3], a[2] = a[1], a[3] = l, a[0] = c, a[1] = l + 1;
          break;
        case 3:
          n[12] = n[0], n[13] = o + 0, n[14] = o + 1, n[15] = o + 2, n[8] = n[1], n[11] = o + 3, n[4] = n[2], n[7] = o + 4, n[0] = n[3], n[1] = o + 7, n[2] = o + 6, n[3] = o + 5, a[2] = a[0], a[3] = l, a[0] = a[1], a[1] = l + 1;
      }
      n[5] = e.length, e.push([(-4 * e[n[0]][0] - e[n[15]][0] + 6 * (e[n[4]][0] + e[n[1]][0]) - 2 * (e[n[12]][0] + e[n[3]][0]) + 3 * (e[n[13]][0] + e[n[7]][0])) / 9, (-4 * e[n[0]][1] - e[n[15]][1] + 6 * (e[n[4]][1] + e[n[1]][1]) - 2 * (e[n[12]][1] + e[n[3]][1]) + 3 * (e[n[13]][1] + e[n[7]][1])) / 9]), n[6] = e.length, e.push([(-4 * e[n[3]][0] - e[n[12]][0] + 6 * (e[n[2]][0] + e[n[7]][0]) - 2 * (e[n[0]][0] + e[n[15]][0]) + 3 * (e[n[4]][0] + e[n[14]][0])) / 9, (-4 * e[n[3]][1] - e[n[12]][1] + 6 * (e[n[2]][1] + e[n[7]][1]) - 2 * (e[n[0]][1] + e[n[15]][1]) + 3 * (e[n[4]][1] + e[n[14]][1])) / 9]), n[9] = e.length, e.push([(-4 * e[n[12]][0] - e[n[3]][0] + 6 * (e[n[8]][0] + e[n[13]][0]) - 2 * (e[n[0]][0] + e[n[15]][0]) + 3 * (e[n[11]][0] + e[n[1]][0])) / 9, (-4 * e[n[12]][1] - e[n[3]][1] + 6 * (e[n[8]][1] + e[n[13]][1]) - 2 * (e[n[0]][1] + e[n[15]][1]) + 3 * (e[n[11]][1] + e[n[1]][1])) / 9]), n[10] = e.length, e.push([(-4 * e[n[15]][0] - e[n[0]][0] + 6 * (e[n[11]][0] + e[n[14]][0]) - 2 * (e[n[12]][0] + e[n[3]][0]) + 3 * (e[n[2]][0] + e[n[8]][0])) / 9, (-4 * e[n[15]][1] - e[n[0]][1] + 6 * (e[n[11]][1] + e[n[14]][1]) - 2 * (e[n[12]][1] + e[n[3]][1]) + 3 * (e[n[2]][1] + e[n[8]][1])) / 9]), this.figures.push({ type: "patch", coords: new Int32Array(n), colors: new Int32Array(a) });
    }
  }
  _decodeType7Shading(t) {
    const e = this.coords, i = this.colors, n = new Int32Array(16), a = new Int32Array(4);
    for (; t.hasData; ) {
      const r = t.readFlag();
      if (!(0 <= r && r <= 3)) throw new st("Unknown type7 flag");
      const o = e.length;
      for (let d = 0, p = r !== 0 ? 12 : 16; d < p; d++) e.push(t.readCoordinate());
      const l = i.length;
      for (let d = 0, p = r !== 0 ? 2 : 4; d < p; d++) i.push(t.readComponents());
      let c, h, u, f;
      switch (r) {
        case 0:
          n[12] = o + 3, n[13] = o + 4, n[14] = o + 5, n[15] = o + 6, n[8] = o + 2, n[9] = o + 13, n[10] = o + 14, n[11] = o + 7, n[4] = o + 1, n[5] = o + 12, n[6] = o + 15, n[7] = o + 8, n[0] = o, n[1] = o + 11, n[2] = o + 10, n[3] = o + 9, a[2] = l + 1, a[3] = l + 2, a[0] = l, a[1] = l + 3;
          break;
        case 1:
          c = n[12], h = n[13], u = n[14], f = n[15], n[12] = f, n[13] = o + 0, n[14] = o + 1, n[15] = o + 2, n[8] = u, n[9] = o + 9, n[10] = o + 10, n[11] = o + 3, n[4] = h, n[5] = o + 8, n[6] = o + 11, n[7] = o + 4, n[0] = c, n[1] = o + 7, n[2] = o + 6, n[3] = o + 5, c = a[2], h = a[3], a[2] = h, a[3] = l, a[0] = c, a[1] = l + 1;
          break;
        case 2:
          c = n[15], h = n[11], n[12] = n[3], n[13] = o + 0, n[14] = o + 1, n[15] = o + 2, n[8] = n[7], n[9] = o + 9, n[10] = o + 10, n[11] = o + 3, n[4] = h, n[5] = o + 8, n[6] = o + 11, n[7] = o + 4, n[0] = c, n[1] = o + 7, n[2] = o + 6, n[3] = o + 5, c = a[3], a[2] = a[1], a[3] = l, a[0] = c, a[1] = l + 1;
          break;
        case 3:
          n[12] = n[0], n[13] = o + 0, n[14] = o + 1, n[15] = o + 2, n[8] = n[1], n[9] = o + 9, n[10] = o + 10, n[11] = o + 3, n[4] = n[2], n[5] = o + 8, n[6] = o + 11, n[7] = o + 4, n[0] = n[3], n[1] = o + 7, n[2] = o + 6, n[3] = o + 5, a[2] = a[0], a[3] = l, a[0] = a[1], a[1] = l + 1;
      }
      this.figures.push({ type: "patch", coords: new Int32Array(n), colors: new Int32Array(a) });
    }
  }
  _buildFigureFromPatch(t) {
    const e = this.figures[t];
    As(e.type === "patch", "Unexpected patch mesh figure");
    const i = this.coords, n = this.colors, a = e.coords, r = e.colors, o = Math.min(i[a[0]][0], i[a[3]][0], i[a[12]][0], i[a[15]][0]), l = Math.min(i[a[0]][1], i[a[3]][1], i[a[12]][1], i[a[15]][1]), c = Math.max(i[a[0]][0], i[a[3]][0], i[a[12]][0], i[a[15]][0]), h = Math.max(i[a[0]][1], i[a[3]][1], i[a[12]][1], i[a[15]][1]);
    let u = Math.ceil((c - o) * Nn.TRIANGLE_DENSITY / (this.bounds[2] - this.bounds[0]));
    u = Bs(u, Nn.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Nn.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);
    let f = Math.ceil((h - l) * Nn.TRIANGLE_DENSITY / (this.bounds[3] - this.bounds[1]));
    f = Bs(f, Nn.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Nn.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);
    const d = u + 1, p = new Int32Array((f + 1) * d), m = new Int32Array((f + 1) * d);
    let b = 0;
    const y = new Uint8Array(3), v = new Uint8Array(3), w = n[r[0]], A = n[r[1]], x = n[r[2]], k = n[r[3]], I = B4(f), T = B4(u);
    for (let E = 0; E <= f; E++) {
      y[0] = (w[0] * (f - E) + x[0] * E) / f | 0, y[1] = (w[1] * (f - E) + x[1] * E) / f | 0, y[2] = (w[2] * (f - E) + x[2] * E) / f | 0, v[0] = (A[0] * (f - E) + k[0] * E) / f | 0, v[1] = (A[1] * (f - E) + k[1] * E) / f | 0, v[2] = (A[2] * (f - E) + k[2] * E) / f | 0;
      for (let M = 0; M <= u; M++, b++) {
        if (!(E !== 0 && E !== f || M !== 0 && M !== u)) continue;
        let F = 0, L = 0, Y = 0;
        for (let et = 0; et <= 3; et++) for (let H = 0; H <= 3; H++, Y++) {
          const P = I[E][et] * T[M][H];
          F += i[a[Y]][0] * P, L += i[a[Y]][1] * P;
        }
        p[b] = i.length, i.push([F, L]), m[b] = n.length;
        const B = new Uint8Array(3);
        B[0] = (y[0] * (u - M) + v[0] * M) / u | 0, B[1] = (y[1] * (u - M) + v[1] * M) / u | 0, B[2] = (y[2] * (u - M) + v[2] * M) / u | 0, n.push(B);
      }
    }
    p[0] = a[0], m[0] = r[0], p[u] = a[3], m[u] = r[1], p[d * f] = a[12], m[d * f] = r[2], p[d * f + u] = a[15], m[d * f + u] = r[3], this.figures[t] = { type: "lattice", coords: p, colors: m, verticesPerRow: d };
  }
  _updateBounds() {
    let t = this.coords[0][0], e = this.coords[0][1], i = t, n = e;
    for (let a = 1, r = this.coords.length; a < r; a++) {
      const o = this.coords[a][0], l = this.coords[a][1];
      t = t > o ? o : t, e = e > l ? l : e, i = i < o ? o : i, n = n < l ? l : n;
    }
    this.bounds = [t, e, i, n];
  }
  _packData() {
    let t, e, i, n;
    const a = this.coords, r = new Float32Array(2 * a.length);
    for (t = 0, i = 0, e = a.length; t < e; t++) {
      const h = a[t];
      r[i++] = h[0], r[i++] = h[1];
    }
    this.coords = r;
    const o = this.colors, l = new Uint8Array(3 * o.length);
    for (t = 0, i = 0, e = o.length; t < e; t++) {
      const h = o[t];
      l[i++] = h[0], l[i++] = h[1], l[i++] = h[2];
    }
    this.colors = l;
    const c = this.figures;
    for (t = 0, e = c.length; t < e; t++) {
      const h = c[t], u = h.coords, f = h.colors;
      for (i = 0, n = u.length; i < n; i++)
        u[i] *= 2, f[i] *= 3;
    }
  }
  getIR() {
    const { bounds: t } = this;
    if (t[2] - t[0] == 0 || t[3] - t[1] == 0) throw new st(`Invalid MeshShading bounds: [${t}].`);
    return ["Mesh", this.shadingType, this.coords, this.colors, this.figures, t, this.bbox, this.background];
  }
};
ht(Nn, "MIN_SPLIT_PATCH_CHUNKS_AMOUNT", 3), ht(Nn, "MAX_SPLIT_PATCH_CHUNKS_AMOUNT", 20), ht(Nn, "TRIANGLE_DENSITY", 20);
let u6 = Nn;
class _T extends ru {
  getIR() {
    return ["Dummy"];
  }
}
function L4(s, t, e) {
  const i = Qo(t.getArray("Matrix"), ia), n = Kr(t.getArray("BBox"), null);
  if (!n || n[2] - n[0] == 0 || n[3] - n[1] == 0) throw new st("Invalid getTilingPatternIR /BBox array.");
  const a = t.get("XStep");
  if (typeof a != "number") throw new st("Invalid getTilingPatternIR /XStep value.");
  const r = t.get("YStep");
  if (typeof r != "number") throw new st("Invalid getTilingPatternIR /YStep value.");
  const o = t.get("PaintType");
  if (!Number.isInteger(o)) throw new st("Invalid getTilingPatternIR /PaintType value.");
  const l = t.get("TilingType");
  if (!Number.isInteger(l)) throw new st("Invalid getTilingPatternIR /TilingType value.");
  return ["TilingPattern", e, s, i, n, a, r, o, l];
}
const TT = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795, 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577, 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176, 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401, 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343, 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518, 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527, 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], ET = { lineHeight: 1.2207, lineGap: 0.2207 }, MT = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795, 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577, 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908, 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401, 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411, 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938, 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887, 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411, 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289, 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921, 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331, 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988, 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581, 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015, 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794, 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527, 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], FT = { lineHeight: 1.2207, lineGap: 0.2207 }, RT = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374, 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306, 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245, 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918, 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562, 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776, 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306, 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824, 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], PT = { lineHeight: 1.2207, lineGap: 0.2207 }, DT = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503, 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306, 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128, 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297, 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469, 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284, 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464, 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469, 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675, 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128, 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254, 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275, 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122, 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772, 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018, 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516, 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442, 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181, 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], NT = { lineHeight: 1.2207, lineGap: 0.2207 }, BT = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], LT = { lineHeight: 1.2, lineGap: 0.2 }, OT = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], UT = { lineHeight: 1.35, lineGap: 0.2 }, qT = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016, 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089, 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973, 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1, 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023, 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1, 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1, 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], jT = { lineHeight: 1.35, lineGap: 0.2 }, HT = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1, 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1, 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006, 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1, 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], $T = { lineHeight: 1.2, lineGap: 0.2 }, K1 = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1e3, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1e3, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906, 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722, 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278, 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278, 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753, 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556, 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626, 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730, 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556, 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875, 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417, 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487, 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1e3, 1e3, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1e3, 1e3, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1e3, 768, 600, 834, 834, 834, 834, 1e3, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333], Y1 = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], J1 = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1e3, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1e3, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906, 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722, 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278, 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278, 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773, 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556, 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643, 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729, 708, 979, 989, 854, 1e3, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556, 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885, 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469, 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575, 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1e3, 1e3, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1e3, 1e3, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1e3, 768, 600, 834, 834, 834, 834, 999, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333], Z1 = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], Q1 = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556, 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778, 556, 778, 556, 1e3, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1e3, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846, 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667, 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278, 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222, 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728, 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500, 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614, 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727, 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556, 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835, 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378, 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492, 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1e3, 1e3, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1e3, 1e3, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1e3, 768, 600, 834, 834, 834, 834, 1e3, 500, 998, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285], td = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], ed = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556, 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778, 556, 778, 556, 1e3, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1e3, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838, 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667, 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278, 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222, 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713, 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500, 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604, 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740, 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556, 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823, 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365, 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489, 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1e3, 1e3, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1e3, 1e3, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1e3, 768, 600, 834, 834, 834, 834, 1e3, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285], sd = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], zT = [1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179, 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083, 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903, 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933, 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407, 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938, 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793, 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295, 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1, 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061, 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179, 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438, 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938, 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933, 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367, 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774, 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083, 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582, 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169, 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], GT = { lineHeight: 1.2, lineGap: 0.2 }, VT = [1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222, 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582, 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655, 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222, 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605, 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058, 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796, 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168, 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236, 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276, 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074, 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1, 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043, 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729, 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621, 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058, 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216, 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381, 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595, 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364, 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783, 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523, 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036, 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513, 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], WT = { lineHeight: 1.2, lineGap: 0.2 }, XT = [1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307, 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945, 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058, 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125, 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588, 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832, 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012, 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075, 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1, 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728, 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475, 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865, 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867, 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866, 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512, 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1, 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], KT = { lineHeight: 1.2, lineGap: 0.2 }, YT = [1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706, 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002, 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051, 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761, 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111, 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231, 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938, 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284, 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377, 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441, 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991, 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434, 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1, 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856, 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936, 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915, 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1, 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903, 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241, 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1, 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], JT = { lineHeight: 1.2, lineGap: 0.2 }, ZT = [1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847, 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406, 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489, 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361, 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304, 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527, 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862, 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579, 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727, 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285, 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418, 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251, 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931, 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752, 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733, 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912, 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167, 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134, 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439, 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511, 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1, 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633, 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1, 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416, 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], QT = { lineHeight: 1.33008, lineGap: 0 }, tE = [1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378, 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723, 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128, 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527, 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293, 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042, 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236, 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922, 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107, 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754, 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168, 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385, 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126, 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205, 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815, 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552, 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945, 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961, 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518, 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377, 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514, 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1, 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633, 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], eE = { lineHeight: 1.33008, lineGap: 0 }, sE = [1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373, 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383, 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308, 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016, 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989, 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143, 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627, 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454, 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225, 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973, 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748, 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781, 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971, 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836, 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782, 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402, 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146, 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225, 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351, 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729, 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454, 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484, 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043, 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498, 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965, 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2, 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924, 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642, 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284, 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205, 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119, 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679, 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675, 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973, 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945, 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621, 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836, 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], iE = { lineHeight: 1.33008, lineGap: 0 }, nE = [1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985, 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084, 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831, 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968, 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433, 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484, 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011, 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771, 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287, 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571, 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771, 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572, 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366, 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491, 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796, 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287, 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424, 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424, 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087, 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205, 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965, 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196, 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714, 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], aE = { lineHeight: 1.33008, lineGap: 0 }, rE = Ee(function(s) {
  s["MyriadPro-Regular"] = s["PdfJS-Fallback-Regular"] = { name: "LiberationSans-Regular", factors: YT, baseWidths: ed, baseMapping: sd, metrics: JT }, s["MyriadPro-Bold"] = s["PdfJS-Fallback-Bold"] = { name: "LiberationSans-Bold", factors: zT, baseWidths: K1, baseMapping: Y1, metrics: GT }, s["MyriadPro-It"] = s["MyriadPro-Italic"] = s["PdfJS-Fallback-Italic"] = { name: "LiberationSans-Italic", factors: XT, baseWidths: Q1, baseMapping: td, metrics: KT }, s["MyriadPro-BoldIt"] = s["MyriadPro-BoldItalic"] = s["PdfJS-Fallback-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: VT, baseWidths: J1, baseMapping: Z1, metrics: WT }, s.ArialMT = s.Arial = s["Arial-Regular"] = { name: "LiberationSans-Regular", baseWidths: ed, baseMapping: sd }, s["Arial-BoldMT"] = s["Arial-Bold"] = { name: "LiberationSans-Bold", baseWidths: K1, baseMapping: Y1 }, s["Arial-ItalicMT"] = s["Arial-Italic"] = { name: "LiberationSans-Italic", baseWidths: Q1, baseMapping: td }, s["Arial-BoldItalicMT"] = s["Arial-BoldItalic"] = { name: "LiberationSans-BoldItalic", baseWidths: J1, baseMapping: Z1 }, s["Calibri-Regular"] = { name: "LiberationSans-Regular", factors: DT, baseWidths: ed, baseMapping: sd, metrics: NT }, s["Calibri-Bold"] = { name: "LiberationSans-Bold", factors: TT, baseWidths: K1, baseMapping: Y1, metrics: ET }, s["Calibri-Italic"] = { name: "LiberationSans-Italic", factors: RT, baseWidths: Q1, baseMapping: td, metrics: PT }, s["Calibri-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: MT, baseWidths: J1, baseMapping: Z1, metrics: FT }, s["Segoeui-Regular"] = { name: "LiberationSans-Regular", factors: nE, baseWidths: ed, baseMapping: sd, metrics: aE }, s["Segoeui-Bold"] = { name: "LiberationSans-Bold", factors: ZT, baseWidths: K1, baseMapping: Y1, metrics: QT }, s["Segoeui-Italic"] = { name: "LiberationSans-Italic", factors: sE, baseWidths: Q1, baseMapping: td, metrics: iE }, s["Segoeui-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: tE, baseWidths: J1, baseMapping: Z1, metrics: eE }, s["Helvetica-Regular"] = s.Helvetica = { name: "LiberationSans-Regular", factors: HT, baseWidths: ed, baseMapping: sd, metrics: $T }, s["Helvetica-Bold"] = { name: "LiberationSans-Bold", factors: BT, baseWidths: K1, baseMapping: Y1, metrics: LT }, s["Helvetica-Italic"] = { name: "LiberationSans-Italic", factors: qT, baseWidths: Q1, baseMapping: td, metrics: jT }, s["Helvetica-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: OT, baseWidths: J1, baseMapping: Z1, metrics: UT };
});
function I7(s) {
  const t = C2(s);
  return rE()[t];
}
function jA(s) {
  const t = function(r) {
    const o = I7(r);
    if (!o) return null;
    const { baseWidths: l, baseMapping: c, factors: h } = o, u = h ? l.map((m, b) => m * h[b]) : l;
    let f, d = -2;
    const p = [];
    for (const [m, b] of c.map((y, v) => [y, v]).sort(([y], [v]) => y - v)) m !== -1 && (m === d + 1 ? (f.push(u[b]), d += 1) : (d = m, f = [u[b]], p.push(m, f)));
    return p;
  }(s), e = new q(null);
  e.set("BaseFont", Z.get(s)), e.set("Type", Z.get("Font")), e.set("Subtype", Z.get("CIDFontType2")), e.set("Encoding", Z.get("Identity-H")), e.set("CIDToGIDMap", Z.get("Identity")), e.set("W", t), e.set("FirstChar", t[0]), e.set("LastChar", t.at(-2) + t.at(-1).length - 1);
  const i = new q(null);
  e.set("FontDescriptor", i);
  const n = new q(null);
  return n.set("Ordering", "Identity"), n.set("Registry", "Adobe"), n.set("Supplement", 0), e.set("CIDSystemInfo", n), e;
}
class oE {
  constructor(t) {
    this.lexer = t, this.operators = [], this.token = null, this.prev = null;
  }
  nextToken() {
    this.prev = this.token, this.token = this.lexer.getToken();
  }
  accept(t) {
    return this.token.type === t ? (this.nextToken(), !0) : !1;
  }
  expect(t) {
    if (this.accept(t)) return !0;
    throw new st(`Unexpected symbol: found ${this.token.type} expected ${t}.`);
  }
  parse() {
    return this.nextToken(), this.expect(Ks.LBRACE), this.parseBlock(), this.expect(Ks.RBRACE), this.operators;
  }
  parseBlock() {
    for (; ; ) if (this.accept(Ks.NUMBER)) this.operators.push(this.prev.value);
    else if (this.accept(Ks.OPERATOR)) this.operators.push(this.prev.value);
    else {
      if (!this.accept(Ks.LBRACE)) return;
      this.parseCondition();
    }
  }
  parseCondition() {
    const t = this.operators.length;
    if (this.operators.push(null, null), this.parseBlock(), this.expect(Ks.RBRACE), this.accept(Ks.IF))
      this.operators[t] = this.operators.length, this.operators[t + 1] = "jz";
    else {
      if (!this.accept(Ks.LBRACE)) throw new st("PS Function: error parsing conditional.");
      {
        const e = this.operators.length;
        this.operators.push(null, null);
        const i = this.operators.length;
        this.parseBlock(), this.expect(Ks.RBRACE), this.expect(Ks.IFELSE), this.operators[e] = this.operators.length, this.operators[e + 1] = "j", this.operators[t] = i, this.operators[t + 1] = "jz";
      }
    }
  }
}
const Ks = { LBRACE: 0, RBRACE: 1, NUMBER: 2, OPERATOR: 3, IF: 4, IFELSE: 5 };
class Yi {
  static get opCache() {
    return gt(this, "opCache", /* @__PURE__ */ Object.create(null));
  }
  constructor(t, e) {
    this.type = t, this.value = e;
  }
  static getOperator(t) {
    var e;
    return (e = Yi.opCache)[t] || (e[t] = new Yi(Ks.OPERATOR, t));
  }
  static get LBRACE() {
    return gt(this, "LBRACE", new Yi(Ks.LBRACE, "{"));
  }
  static get RBRACE() {
    return gt(this, "RBRACE", new Yi(Ks.RBRACE, "}"));
  }
  static get IF() {
    return gt(this, "IF", new Yi(Ks.IF, "IF"));
  }
  static get IFELSE() {
    return gt(this, "IFELSE", new Yi(Ks.IFELSE, "IFELSE"));
  }
}
class lE {
  constructor(t) {
    this.stream = t, this.nextChar(), this.strBuf = [];
  }
  nextChar() {
    return this.currentChar = this.stream.getByte();
  }
  getToken() {
    let t = !1, e = this.currentChar;
    for (; ; ) {
      if (e < 0) return vs;
      if (t) e !== 10 && e !== 13 || (t = !1);
      else if (e === 37) t = !0;
      else if (!Qi(e)) break;
      e = this.nextChar();
    }
    switch (0 | e) {
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 43:
      case 45:
      case 46:
        return new Yi(Ks.NUMBER, this.getNumber());
      case 123:
        return this.nextChar(), Yi.LBRACE;
      case 125:
        return this.nextChar(), Yi.RBRACE;
    }
    const i = this.strBuf;
    for (i.length = 0, i[0] = String.fromCharCode(e); (e = this.nextChar()) >= 0 && (e >= 65 && e <= 90 || e >= 97 && e <= 122); ) i.push(String.fromCharCode(e));
    const n = i.join("");
    switch (n.toLowerCase()) {
      case "if":
        return Yi.IF;
      case "ifelse":
        return Yi.IFELSE;
      default:
        return Yi.getOperator(n);
    }
  }
  getNumber() {
    let t = this.currentChar;
    const e = this.strBuf;
    for (e.length = 0, e[0] = String.fromCharCode(t); (t = this.nextChar()) >= 0 && (t >= 48 && t <= 57 || t === 45 || t === 46); ) e.push(String.fromCharCode(t));
    const i = parseFloat(e.join(""));
    if (isNaN(i)) throw new st(`Invalid floating point number: ${i}`);
    return i;
  }
}
class bh {
  constructor(t) {
    this._onlyRefs = (t == null ? void 0 : t.onlyRefs) === !0, this._onlyRefs || (this._nameRefMap = /* @__PURE__ */ new Map(), this._imageMap = /* @__PURE__ */ new Map()), this._imageCache = new xi();
  }
  getByName(t) {
    this._onlyRefs && Wt("Should not call `getByName` method.");
    const e = this._nameRefMap.get(t);
    return e ? this.getByRef(e) : this._imageMap.get(t) || null;
  }
  getByRef(t) {
    return this._imageCache.get(t) || null;
  }
  set(t, e, i) {
    Wt("Abstract method `set` called.");
  }
}
class O4 extends bh {
  set(t, e = null, i) {
    if (typeof t != "string") throw new Error('LocalImageCache.set - expected "name" argument.');
    if (e) {
      if (this._imageCache.has(e)) return;
      this._nameRefMap.set(t, e), this._imageCache.put(e, i);
    } else this._imageMap.has(t) || this._imageMap.set(t, i);
  }
}
class HA extends bh {
  set(t = null, e = null, i) {
    if (typeof t != "string" && !e) throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');
    if (e) {
      if (this._imageCache.has(e)) return;
      t !== null && this._nameRefMap.set(t, e), this._imageCache.put(e, i);
    } else this._imageMap.has(t) || this._imageMap.set(t, i);
  }
}
class cE extends bh {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, i) {
    if (!e) throw new Error('LocalFunctionCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, i);
  }
}
class U4 extends bh {
  set(t, e = null, i) {
    if (typeof t != "string") throw new Error('LocalGStateCache.set - expected "name" argument.');
    if (e) {
      if (this._imageCache.has(e)) return;
      this._nameRefMap.set(t, e), this._imageCache.put(e, i);
    } else this._imageMap.has(t) || this._imageMap.set(t, i);
  }
}
class hE extends bh {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, i) {
    if (!e) throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, i);
  }
}
class uE extends bh {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, i) {
    if (!e) throw new Error('RegionalImageCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, i);
  }
}
class dE extends bh {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, i) {
    if (!e) throw new Error('GlobalColorSpaceCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, i);
  }
  clear() {
    this._imageCache.clear();
  }
}
var A1, gh, $A, f6;
const er = class er {
  constructor() {
    _(this, gh);
    _(this, A1, new Qe());
    this._refCache = new xi(), this._imageCache = new xi();
  }
  shouldCache(t, e) {
    let i = this._refCache.get(t);
    return i || (i = /* @__PURE__ */ new Set(), this._refCache.put(t, i)), i.add(e), !(i.size < er.NUM_PAGES_THRESHOLD) && !(!this._imageCache.has(t) && g(this, gh, f6));
  }
  addDecodeFailed(t) {
    g(this, A1).put(t);
  }
  hasDecodeFailed(t) {
    return g(this, A1).has(t);
  }
  addByteSize(t, e) {
    const i = this._imageCache.get(t);
    i && (i.byteSize || (i.byteSize = e));
  }
  getData(t, e) {
    const i = this._refCache.get(t);
    if (!i || i.size < er.NUM_PAGES_THRESHOLD) return null;
    const n = this._imageCache.get(t);
    return n ? (i.add(e), n) : null;
  }
  setData(t, e) {
    if (!this._refCache.has(t)) throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');
    this._imageCache.has(t) || (g(this, gh, f6) ? D("GlobalImageCache.setData - cache limit reached.") : this._imageCache.put(t, e));
  }
  clear(t = !1) {
    t || (g(this, A1).clear(), this._refCache.clear()), this._imageCache.clear();
  }
};
A1 = new WeakMap(), gh = new WeakSet(), $A = function() {
  let t = 0;
  for (const e of this._imageCache) t += e.byteSize;
  return t;
}, f6 = function() {
  return !(this._imageCache.size < er.MIN_IMAGES_TO_CACHE) && !(g(this, gh, $A) < er.MAX_BYTE_SIZE);
}, ht(er, "NUM_PAGES_THRESHOLD", 2), ht(er, "MIN_IMAGES_TO_CACHE", 10), ht(er, "MAX_BYTE_SIZE", 5e7);
let d6 = er;
class zA {
  constructor({ xref: t, isEvalSupported: e = !0 }) {
    this.xref = t, this.isEvalSupported = e !== !1;
  }
  create(t, e = !1) {
    var r;
    let i, n;
    if (t instanceof yt ? i = t : t instanceof q ? i = t.objId : t instanceof Ot && (i = (r = t.dict) == null ? void 0 : r.objId), i) {
      const o = this._localFunctionCache.getByRef(i);
      if (o) return o;
    }
    const a = this.xref.fetchIfRef(t);
    if (Array.isArray(a)) {
      if (!e) throw new Error('PDFFunctionFactory.create - expected "parseArray" argument.');
      n = q4.parseArray(this, a);
    } else n = q4.parse(this, a);
    return i && this._localFunctionCache.set(null, i, n), n;
  }
  get _localFunctionCache() {
    return gt(this, "_localFunctionCache", new cE());
  }
}
function an(s) {
  return Array.isArray(s) ? ci(s, null) ? s : s.map((t) => +t) : null;
}
class q4 {
  static getSampleArray(t, e, i, n) {
    let a, r, o = 1;
    for (a = 0, r = t.length; a < r; a++) o *= t[a];
    o *= e;
    const l = new Array(o);
    let c = 0, h = 0;
    const u = 1 / (2 ** i - 1), f = n.getBytes((o * i + 7) / 8);
    let d = 0;
    for (a = 0; a < o; a++) {
      for (; c < i; )
        h <<= 8, h |= f[d++], c += 8;
      c -= i, l[a] = (h >> c) * u, h &= (1 << c) - 1;
    }
    return l;
  }
  static parse(t, e) {
    const i = e.dict || e;
    switch (i.get("FunctionType")) {
      case 0:
        return this.constructSampled(t, e, i);
      case 1:
        break;
      case 2:
        return this.constructInterpolated(t, i);
      case 3:
        return this.constructStiched(t, i);
      case 4:
        return this.constructPostScript(t, e, i);
    }
    throw new st("Unknown type of function");
  }
  static parseArray(t, e) {
    const { xref: i } = t, n = [];
    for (const a of e) n.push(this.parse(t, i.fetchIfRef(a)));
    return function(a, r, o, l) {
      for (let c = 0, h = n.length; c < h; c++) n[c](a, r, o, l + c);
    };
  }
  static constructSampled(t, e, i) {
    function n(b) {
      const y = b.length, v = [];
      let w = 0;
      for (let A = 0; A < y; A += 2) v[w++] = [b[A], b[A + 1]];
      return v;
    }
    function a(b, y, v, w, A) {
      return w + (A - w) / (v - y) * (b - y);
    }
    let r = an(i.getArray("Domain")), o = an(i.getArray("Range"));
    if (!r || !o) throw new st("No domain or range");
    const l = r.length / 2, c = o.length / 2;
    r = n(r), o = n(o);
    const h = an(i.getArray("Size")), u = i.get("BitsPerSample"), f = i.get("Order") || 1;
    f !== 1 && qt("No support for cubic spline interpolation: " + f);
    let d = an(i.getArray("Encode"));
    if (d) d = n(d);
    else {
      d = [];
      for (let b = 0; b < l; ++b) d.push([0, h[b] - 1]);
    }
    let p = an(i.getArray("Decode"));
    p = p ? n(p) : o;
    const m = this.getSampleArray(h, c, u, e);
    return function(y, v, w, A) {
      const x = 1 << l, k = new Float64Array(x).fill(1), I = new Uint32Array(x);
      let T, E, M = c, F = 1;
      for (T = 0; T < l; ++T) {
        const L = r[T][0], Y = r[T][1];
        let B = a(Bs(y[v + T], L, Y), L, Y, d[T][0], d[T][1]);
        const et = h[T];
        B = Bs(B, 0, et - 1);
        const H = B < et - 1 ? Math.floor(B) : B - 1, P = H + 1 - B, G = B - H, N = H * M, j = N + M;
        for (E = 0; E < x; E++) E & F ? (k[E] *= G, I[E] += j) : (k[E] *= P, I[E] += N);
        M *= et, F <<= 1;
      }
      for (E = 0; E < c; ++E) {
        let L = 0;
        for (T = 0; T < x; T++) L += m[I[T] + E] * k[T];
        L = a(L, 0, 1, p[E][0], p[E][1]), w[A + E] = Bs(L, o[E][0], o[E][1]);
      }
    };
  }
  static constructInterpolated(t, e) {
    const i = an(e.getArray("C0")) || [0], n = an(e.getArray("C1")) || [1], a = e.get("N"), r = [];
    for (let l = 0, c = i.length; l < c; ++l) r.push(n[l] - i[l]);
    const o = r.length;
    return function(c, h, u, f) {
      const d = a === 1 ? c[h] : c[h] ** a;
      for (let p = 0; p < o; ++p) u[f + p] = i[p] + d * r[p];
    };
  }
  static constructStiched(t, e) {
    const i = an(e.getArray("Domain"));
    if (!i) throw new st("No domain");
    if (i.length / 2 !== 1) throw new st("Bad domain for stiched function");
    const { xref: n } = t, a = [];
    for (const c of e.get("Functions")) a.push(this.parse(t, n.fetchIfRef(c)));
    const r = an(e.getArray("Bounds")), o = an(e.getArray("Encode")), l = new Float32Array(1);
    return function(h, u, f, d) {
      const p = Bs(h[u], i[0], i[1]), m = r.length;
      let b;
      for (b = 0; b < m && !(p < r[b]); ++b) ;
      let y = i[0];
      b > 0 && (y = r[b - 1]);
      let v = i[1];
      b < r.length && (v = r[b]);
      const w = o[2 * b], A = o[2 * b + 1];
      l[0] = y === v ? w : w + (p - y) * (A - w) / (v - y), a[b](l, 0, f, d);
    };
  }
  static constructPostScript(t, e, i) {
    const n = an(i.getArray("Domain")), a = an(i.getArray("Range"));
    if (!n) throw new st("No domain.");
    if (!a) throw new st("No range.");
    const r = new lE(e), o = new oE(r).parse();
    if (t.isEvalSupported && Ii.isEvalSupported) {
      const p = new vE().compile(o, n, a);
      if (p) return new Function("src", "srcOffset", "dest", "destOffset", p);
    }
    qt("Unable to compile PS function");
    const l = a.length >> 1, c = n.length >> 1, h = new fE(o), u = /* @__PURE__ */ Object.create(null);
    let f = 8192;
    const d = new Float32Array(c);
    return function(m, b, y, v) {
      let w, A, x = "";
      const k = d;
      for (w = 0; w < c; w++)
        A = m[b + w], k[w] = A, x += A + "_";
      const I = u[x];
      if (I !== void 0) {
        y.set(I, v);
        return;
      }
      const T = new Float32Array(l), E = h.execute(k), M = E.length - l;
      for (w = 0; w < l; w++) {
        A = E[M + w];
        let F = a[2 * w];
        A < F ? A = F : (F = a[2 * w + 1], A > F && (A = F)), T[w] = A;
      }
      f > 0 && (f--, u[x] = T), y.set(T, v);
    };
  }
}
function Nm(s) {
  let t;
  if (s instanceof q) t = s;
  else {
    if (!(s instanceof Ot)) return !1;
    t = s.dict;
  }
  return t.has("FunctionType");
}
const Yd = class Yd {
  constructor(t) {
    this.stack = t ? Array.from(t) : [];
  }
  push(t) {
    if (this.stack.length >= Yd.MAX_STACK_SIZE) throw new Error("PostScript function stack overflow.");
    this.stack.push(t);
  }
  pop() {
    if (this.stack.length <= 0) throw new Error("PostScript function stack underflow.");
    return this.stack.pop();
  }
  copy(t) {
    if (this.stack.length + t >= Yd.MAX_STACK_SIZE) throw new Error("PostScript function stack overflow.");
    const e = this.stack;
    for (let i = e.length - t, n = t - 1; n >= 0; n--, i++) e.push(e[i]);
  }
  index(t) {
    this.push(this.stack[this.stack.length - t - 1]);
  }
  roll(t, e) {
    const i = this.stack, n = i.length - t, a = i.length - 1, r = n + (e - Math.floor(e / t) * t);
    for (let o = n, l = a; o < l; o++, l--) {
      const c = i[o];
      i[o] = i[l], i[l] = c;
    }
    for (let o = n, l = r - 1; o < l; o++, l--) {
      const c = i[o];
      i[o] = i[l], i[l] = c;
    }
    for (let o = r, l = a; o < l; o++, l--) {
      const c = i[o];
      i[o] = i[l], i[l] = c;
    }
  }
};
ht(Yd, "MAX_STACK_SIZE", 100);
let g6 = Yd;
class fE {
  constructor(t) {
    this.operators = t;
  }
  execute(t) {
    const e = new g6(t);
    let i = 0;
    const n = this.operators, a = n.length;
    let r, o, l;
    for (; i < a; )
      if (r = n[i++], typeof r != "number") switch (r) {
        case "jz":
          l = e.pop(), o = e.pop(), o || (i = l);
          break;
        case "j":
          o = e.pop(), i = o;
          break;
        case "abs":
          o = e.pop(), e.push(Math.abs(o));
          break;
        case "add":
          l = e.pop(), o = e.pop(), e.push(o + l);
          break;
        case "and":
          l = e.pop(), o = e.pop(), typeof o == "boolean" && typeof l == "boolean" ? e.push(o && l) : e.push(o & l);
          break;
        case "atan":
          l = e.pop(), o = e.pop(), o = Math.atan2(o, l) / Math.PI * 180, o < 0 && (o += 360), e.push(o);
          break;
        case "bitshift":
          l = e.pop(), o = e.pop(), o > 0 ? e.push(o << l) : e.push(o >> l);
          break;
        case "ceiling":
          o = e.pop(), e.push(Math.ceil(o));
          break;
        case "copy":
          o = e.pop(), e.copy(o);
          break;
        case "cos":
          o = e.pop(), e.push(Math.cos(o % 360 / 180 * Math.PI));
          break;
        case "cvi":
          o = 0 | e.pop(), e.push(o);
          break;
        case "cvr":
          break;
        case "div":
          l = e.pop(), o = e.pop(), e.push(o / l);
          break;
        case "dup":
          e.copy(1);
          break;
        case "eq":
          l = e.pop(), o = e.pop(), e.push(o === l);
          break;
        case "exch":
          e.roll(2, 1);
          break;
        case "exp":
          l = e.pop(), o = e.pop(), e.push(o ** l);
          break;
        case "false":
          e.push(!1);
          break;
        case "floor":
          o = e.pop(), e.push(Math.floor(o));
          break;
        case "ge":
          l = e.pop(), o = e.pop(), e.push(o >= l);
          break;
        case "gt":
          l = e.pop(), o = e.pop(), e.push(o > l);
          break;
        case "idiv":
          l = e.pop(), o = e.pop(), e.push(o / l | 0);
          break;
        case "index":
          o = e.pop(), e.index(o);
          break;
        case "le":
          l = e.pop(), o = e.pop(), e.push(o <= l);
          break;
        case "ln":
          o = e.pop(), e.push(Math.log(o));
          break;
        case "log":
          o = e.pop(), e.push(Math.log10(o));
          break;
        case "lt":
          l = e.pop(), o = e.pop(), e.push(o < l);
          break;
        case "mod":
          l = e.pop(), o = e.pop(), e.push(o % l);
          break;
        case "mul":
          l = e.pop(), o = e.pop(), e.push(o * l);
          break;
        case "ne":
          l = e.pop(), o = e.pop(), e.push(o !== l);
          break;
        case "neg":
          o = e.pop(), e.push(-o);
          break;
        case "not":
          o = e.pop(), typeof o == "boolean" ? e.push(!o) : e.push(~o);
          break;
        case "or":
          l = e.pop(), o = e.pop(), typeof o == "boolean" && typeof l == "boolean" ? e.push(o || l) : e.push(o | l);
          break;
        case "pop":
          e.pop();
          break;
        case "roll":
          l = e.pop(), o = e.pop(), e.roll(o, l);
          break;
        case "round":
          o = e.pop(), e.push(Math.round(o));
          break;
        case "sin":
          o = e.pop(), e.push(Math.sin(o % 360 / 180 * Math.PI));
          break;
        case "sqrt":
          o = e.pop(), e.push(Math.sqrt(o));
          break;
        case "sub":
          l = e.pop(), o = e.pop(), e.push(o - l);
          break;
        case "true":
          e.push(!0);
          break;
        case "truncate":
          o = e.pop(), o = o < 0 ? Math.ceil(o) : Math.floor(o), e.push(o);
          break;
        case "xor":
          l = e.pop(), o = e.pop(), typeof o == "boolean" && typeof l == "boolean" ? e.push(o !== l) : e.push(o ^ l);
          break;
        default:
          throw new st(`Unknown operator ${r}`);
      }
      else e.push(r);
    return e.stack;
  }
}
class q1 {
  constructor(t) {
    this.type = t;
  }
  visit(t) {
    Wt("abstract method");
  }
}
class gE extends q1 {
  constructor(t, e, i) {
    super("args"), this.index = t, this.min = e, this.max = i;
  }
  visit(t) {
    t.visitArgument(this);
  }
}
class sh extends q1 {
  constructor(t) {
    super("literal"), this.number = t, this.min = t, this.max = t;
  }
  visit(t) {
    t.visitLiteral(this);
  }
}
class _7 extends q1 {
  constructor(t, e, i, n, a) {
    super("binary"), this.op = t, this.arg1 = e, this.arg2 = i, this.min = n, this.max = a;
  }
  visit(t) {
    t.visitBinaryOperation(this);
  }
}
class pE extends q1 {
  constructor(t, e) {
    super("max"), this.arg = t, this.min = t.min, this.max = e;
  }
  visit(t) {
    t.visitMin(this);
  }
}
class j4 extends q1 {
  constructor(t, e, i) {
    super("var"), this.index = t, this.min = e, this.max = i;
  }
  visit(t) {
    t.visitVariable(this);
  }
}
class H4 extends q1 {
  constructor(t, e) {
    super("definition"), this.variable = t, this.arg = e;
  }
  visit(t) {
    t.visitVariableDefinition(this);
  }
}
class $4 {
  constructor() {
    this.parts = [];
  }
  visitArgument(t) {
    this.parts.push("Math.max(", t.min, ", Math.min(", t.max, ", src[srcOffset + ", t.index, "]))");
  }
  visitVariable(t) {
    this.parts.push("v", t.index);
  }
  visitLiteral(t) {
    this.parts.push(t.number);
  }
  visitBinaryOperation(t) {
    this.parts.push("("), t.arg1.visit(this), this.parts.push(" ", t.op, " "), t.arg2.visit(this), this.parts.push(")");
  }
  visitVariableDefinition(t) {
    this.parts.push("var "), t.variable.visit(this), this.parts.push(" = "), t.arg.visit(this), this.parts.push(";");
  }
  visitMin(t) {
    this.parts.push("Math.min("), t.arg.visit(this), this.parts.push(", ", t.max, ")");
  }
  toString() {
    return this.parts.join("");
  }
}
function mE(s, t) {
  return t.type === "literal" && t.number === 0 ? s : s.type === "literal" && s.number === 0 ? t : t.type === "literal" && s.type === "literal" ? new sh(s.number + t.number) : new _7("+", s, t, s.min + t.min, s.max + t.max);
}
function bE(s, t) {
  if (t.type === "literal") {
    if (t.number === 0) return new sh(0);
    if (t.number === 1) return s;
    if (s.type === "literal") return new sh(s.number * t.number);
  }
  if (s.type === "literal") {
    if (s.number === 0) return new sh(0);
    if (s.number === 1) return t;
  }
  const e = Math.min(s.min * t.min, s.min * t.max, s.max * t.min, s.max * t.max), i = Math.max(s.min * t.min, s.min * t.max, s.max * t.min, s.max * t.max);
  return new _7("*", s, t, e, i);
}
function yE(s, t) {
  if (t.type === "literal") {
    if (t.number === 0) return s;
    if (s.type === "literal") return new sh(s.number - t.number);
  }
  return t.type === "binary" && t.op === "-" && s.type === "literal" && s.number === 1 && t.arg1.type === "literal" && t.arg1.number === 1 ? t.arg2 : new _7("-", s, t, s.min - t.max, s.max - t.min);
}
function wE(s, t) {
  return s.min >= t ? new sh(t) : s.max <= t ? s : new pE(s, t);
}
class vE {
  compile(t, e, i) {
    const n = [], a = [], r = e.length >> 1, o = i.length >> 1;
    let l, c, h, u, f, d, p, m, b = 0;
    for (let v = 0; v < r; v++) n.push(new gE(v, e[2 * v], e[2 * v + 1]));
    for (let v = 0, w = t.length; v < w; v++)
      if (m = t[v], typeof m != "number") switch (m) {
        case "add":
          if (n.length < 2) return null;
          u = n.pop(), h = n.pop(), n.push(mE(h, u));
          break;
        case "cvr":
          if (n.length < 1) return null;
          break;
        case "mul":
          if (n.length < 2) return null;
          u = n.pop(), h = n.pop(), n.push(bE(h, u));
          break;
        case "sub":
          if (n.length < 2) return null;
          u = n.pop(), h = n.pop(), n.push(yE(h, u));
          break;
        case "exch":
          if (n.length < 2) return null;
          f = n.pop(), d = n.pop(), n.push(f, d);
          break;
        case "pop":
          if (n.length < 1) return null;
          n.pop();
          break;
        case "index":
          if (n.length < 1 || (h = n.pop(), h.type !== "literal") || (l = h.number, l < 0 || !Number.isInteger(l) || n.length < l)) return null;
          if (f = n[n.length - l - 1], f.type === "literal" || f.type === "var") {
            n.push(f);
            break;
          }
          p = new j4(b++, f.min, f.max), n[n.length - l - 1] = p, n.push(p), a.push(new H4(p, f));
          break;
        case "dup":
          if (n.length < 1) return null;
          if (typeof t[v + 1] == "number" && t[v + 2] === "gt" && t[v + 3] === v + 7 && t[v + 4] === "jz" && t[v + 5] === "pop" && t[v + 6] === t[v + 1]) {
            h = n.pop(), n.push(wE(h, t[v + 1])), v += 6;
            break;
          }
          if (f = n.at(-1), f.type === "literal" || f.type === "var") {
            n.push(f);
            break;
          }
          p = new j4(b++, f.min, f.max), n[n.length - 1] = p, n.push(p), a.push(new H4(p, f));
          break;
        case "roll":
          if (n.length < 2 || (u = n.pop(), h = n.pop(), u.type !== "literal" || h.type !== "literal") || (c = u.number, l = h.number, l <= 0 || !Number.isInteger(l) || !Number.isInteger(c) || n.length < l)) return null;
          if (c = (c % l + l) % l, c === 0) break;
          n.push(...n.splice(n.length - l, l - c));
          break;
        default:
          return null;
      }
      else n.push(new sh(m));
    if (n.length !== o) return null;
    const y = [];
    for (const v of a) {
      const w = new $4();
      v.visit(w), y.push(w.toString());
    }
    for (let v = 0, w = n.length; v < w; v++) {
      const A = n[v], x = new $4();
      A.visit(x);
      const k = i[2 * v], I = i[2 * v + 1], T = [x.toString()];
      k > A.min && (T.unshift("Math.max(", k, ", "), T.push(")")), I < A.max && (T.unshift("Math.min(", I, ", "), T.push(")")), T.unshift("dest[destOffset + ", v, "] = "), T.push(";"), y.push(T.join(""));
    }
    return y.join(`
`);
  }
}
const AE = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"], xE = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"];
function z4(s) {
  return !!(1 & s);
}
function kE(s) {
  return !(1 & s);
}
function SE(s, t, e) {
  let i, n;
  for (i = t, n = s.length; i < n; ++i) if (s[i] !== e) return i;
  return i;
}
function G4(s, t, e) {
  for (let i = t, n = e - 1; i < n; ++i, --n) {
    const a = s[i];
    s[i] = s[n], s[n] = a;
  }
}
function Bm(s, t, e = !1) {
  let i = "ltr";
  return e ? i = "ttb" : t || (i = "rtl"), { str: s, dir: i };
}
const Qr = [], ie = [];
function GA(s, t = -1, e = !1) {
  let i = !0;
  const n = s.length;
  if (n === 0 || e) return Bm(s, i, e);
  Qr.length = n, ie.length = n;
  let a, r, o = 0;
  for (a = 0; a < n; ++a) {
    Qr[a] = s.charAt(a);
    const y = s.charCodeAt(a);
    let v = "L";
    y <= 255 ? v = AE[y] : 1424 <= y && y <= 1524 ? v = "R" : 1536 <= y && y <= 1791 ? (v = xE[255 & y], v || D("Bidi: invalid Unicode character " + y.toString(16))) : (1792 <= y && y <= 2220 || 64336 <= y && y <= 65023 || 65136 <= y && y <= 65279) && (v = "AL"), v !== "R" && v !== "AL" && v !== "AN" || o++, ie[a] = v;
  }
  if (o === 0)
    return i = !0, Bm(s, i);
  t === -1 && (o / n < 0.3 && n > 4 ? (i = !0, t = 0) : (i = !1, t = 1));
  const l = [];
  for (a = 0; a < n; ++a) l[a] = t;
  const c = z4(t) ? "R" : "L", h = c, u = h;
  let f, d = h;
  for (a = 0; a < n; ++a) ie[a] === "NSM" ? ie[a] = d : d = ie[a];
  for (d = h, a = 0; a < n; ++a)
    f = ie[a], f === "EN" ? ie[a] = d === "AL" ? "AN" : "EN" : f !== "R" && f !== "L" && f !== "AL" || (d = f);
  for (a = 0; a < n; ++a)
    f = ie[a], f === "AL" && (ie[a] = "R");
  for (a = 1; a < n - 1; ++a)
    ie[a] === "ES" && ie[a - 1] === "EN" && ie[a + 1] === "EN" && (ie[a] = "EN"), ie[a] !== "CS" || ie[a - 1] !== "EN" && ie[a - 1] !== "AN" || ie[a + 1] !== ie[a - 1] || (ie[a] = ie[a - 1]);
  for (a = 0; a < n; ++a) if (ie[a] === "EN") {
    for (let y = a - 1; y >= 0 && ie[y] === "ET"; --y) ie[y] = "EN";
    for (let y = a + 1; y < n && ie[y] === "ET"; ++y) ie[y] = "EN";
  }
  for (a = 0; a < n; ++a)
    f = ie[a], f !== "WS" && f !== "ES" && f !== "ET" && f !== "CS" || (ie[a] = "ON");
  for (d = h, a = 0; a < n; ++a)
    f = ie[a], f === "EN" ? ie[a] = d === "L" ? "L" : "EN" : f !== "R" && f !== "L" || (d = f);
  for (a = 0; a < n; ++a) if (ie[a] === "ON") {
    const y = SE(ie, a + 1, "ON");
    let v = h;
    a > 0 && (v = ie[a - 1]);
    let w = u;
    y + 1 < n && (w = ie[y + 1]), v !== "L" && (v = "R"), w !== "L" && (w = "R"), v === w && ie.fill(v, a, y), a = y - 1;
  }
  for (a = 0; a < n; ++a) ie[a] === "ON" && (ie[a] = c);
  for (a = 0; a < n; ++a)
    f = ie[a], kE(l[a]) ? f === "R" ? l[a] += 1 : f !== "AN" && f !== "EN" || (l[a] += 2) : f !== "L" && f !== "AN" && f !== "EN" || (l[a] += 1);
  let p, m = -1, b = 99;
  for (a = 0, r = l.length; a < r; ++a)
    p = l[a], m < p && (m = p), b > p && z4(p) && (b = p);
  for (p = m; p >= b; --p) {
    let y = -1;
    for (a = 0, r = l.length; a < r; ++a) l[a] < p ? y >= 0 && (G4(Qr, y, a), y = -1) : y < 0 && (y = a);
    y >= 0 && G4(Qr, y, l.length);
  }
  for (a = 0, r = Qr.length; a < r; ++a) {
    const y = Qr[a];
    y !== "<" && y !== ">" || (Qr[a] = "");
  }
  return Bm(Qr.join(""), i);
}
const _l = { style: "normal", weight: "normal" }, Nl = { style: "normal", weight: "bold" }, Bl = { style: "italic", weight: "normal" }, Ll = { style: "italic", weight: "bold" }, jd = /* @__PURE__ */ new Map([["Times-Roman", { local: ["Times New Roman", "Times-Roman", "Times", "Liberation Serif", "Nimbus Roman", "Nimbus Roman L", "Tinos", "Thorndale", "TeX Gyre Termes", "FreeSerif", "Linux Libertine O", "Libertinus Serif", "DejaVu Serif", "Bitstream Vera Serif", "Ubuntu"], style: _l, ultimate: "serif" }], ["Times-Bold", { alias: "Times-Roman", style: Nl, ultimate: "serif" }], ["Times-Italic", { alias: "Times-Roman", style: Bl, ultimate: "serif" }], ["Times-BoldItalic", { alias: "Times-Roman", style: Ll, ultimate: "serif" }], ["Helvetica", { local: ["Helvetica", "Helvetica Neue", "Arial", "Arial Nova", "Liberation Sans", "Arimo", "Nimbus Sans", "Nimbus Sans L", "A030", "TeX Gyre Heros", "FreeSans", "DejaVu Sans", "Albany", "Bitstream Vera Sans", "Arial Unicode MS", "Microsoft Sans Serif", "Apple Symbols", "Cantarell"], path: "LiberationSans-Regular.ttf", style: _l, ultimate: "sans-serif" }], ["Helvetica-Bold", { alias: "Helvetica", path: "LiberationSans-Bold.ttf", style: Nl, ultimate: "sans-serif" }], ["Helvetica-Oblique", { alias: "Helvetica", path: "LiberationSans-Italic.ttf", style: Bl, ultimate: "sans-serif" }], ["Helvetica-BoldOblique", { alias: "Helvetica", path: "LiberationSans-BoldItalic.ttf", style: Ll, ultimate: "sans-serif" }], ["Courier", { local: ["Courier", "Courier New", "Liberation Mono", "Nimbus Mono", "Nimbus Mono L", "Cousine", "Cumberland", "TeX Gyre Cursor", "FreeMono", "Linux Libertine Mono O", "Libertinus Mono"], style: _l, ultimate: "monospace" }], ["Courier-Bold", { alias: "Courier", style: Nl, ultimate: "monospace" }], ["Courier-Oblique", { alias: "Courier", style: Bl, ultimate: "monospace" }], ["Courier-BoldOblique", { alias: "Courier", style: Ll, ultimate: "monospace" }], ["ArialBlack", { local: ["Arial Black"], style: { style: "normal", weight: "900" }, fallback: "Helvetica-Bold" }], ["ArialBlack-Bold", { alias: "ArialBlack" }], ["ArialBlack-Italic", { alias: "ArialBlack", style: { style: "italic", weight: "900" }, fallback: "Helvetica-BoldOblique" }], ["ArialBlack-BoldItalic", { alias: "ArialBlack-Italic" }], ["ArialNarrow", { local: ["Arial Narrow", "Liberation Sans Narrow", "Helvetica Condensed", "Nimbus Sans Narrow", "TeX Gyre Heros Cn"], style: _l, fallback: "Helvetica" }], ["ArialNarrow-Bold", { alias: "ArialNarrow", style: Nl, fallback: "Helvetica-Bold" }], ["ArialNarrow-Italic", { alias: "ArialNarrow", style: Bl, fallback: "Helvetica-Oblique" }], ["ArialNarrow-BoldItalic", { alias: "ArialNarrow", style: Ll, fallback: "Helvetica-BoldOblique" }], ["Calibri", { local: ["Calibri", "Carlito"], style: _l, fallback: "Helvetica" }], ["Calibri-Bold", { alias: "Calibri", style: Nl, fallback: "Helvetica-Bold" }], ["Calibri-Italic", { alias: "Calibri", style: Bl, fallback: "Helvetica-Oblique" }], ["Calibri-BoldItalic", { alias: "Calibri", style: Ll, fallback: "Helvetica-BoldOblique" }], ["Wingdings", { local: ["Wingdings", "URW Dingbats"], style: _l }], ["Wingdings-Regular", { alias: "Wingdings" }], ["Wingdings-Bold", { alias: "Wingdings" }]]), CE = /* @__PURE__ */ new Map([["Arial-Black", "ArialBlack"]]);
function V4(s) {
  const t = /* @__PURE__ */ new Set(["thin", "extralight", "ultralight", "demilight", "semilight", "light", "book", "regular", "normal", "medium", "demibold", "semibold", "bold", "extrabold", "ultrabold", "black", "heavy", "extrablack", "ultrablack", "roman", "italic", "oblique", "ultracondensed", "extracondensed", "condensed", "semicondensed", "normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded", "bolditalic"]);
  return s.split(/[- ,+]+/g).filter((e) => !t.has(e.toLowerCase())).join(" ");
}
function p6({ alias: s, local: t, path: e, fallback: i, style: n, ultimate: a }, r, o, l = !0, c = !0, h = "") {
  const u = { style: null, ultimate: null };
  if (t) {
    const f = h ? ` ${h}` : "";
    for (const d of t) r.push(`local(${d}${f})`);
  }
  if (s) {
    const f = jd.get(s), d = h || function(m) {
      switch (m) {
        case Nl:
          return "Bold";
        case Bl:
          return "Italic";
        case Ll:
          return "Bold Italic";
        default:
          if ((m == null ? void 0 : m.weight) === "bold") return "Bold";
          if ((m == null ? void 0 : m.style) === "italic") return "Italic";
      }
      return "";
    }(n);
    Object.assign(u, p6(f, r, o, l && !i, c && !e, d));
  }
  if (n && (u.style = n), a && (u.ultimate = a), l && i) {
    const f = jd.get(i), { ultimate: d } = p6(f, r, o, l, c && !e, h);
    u.ultimate || (u.ultimate = d);
  }
  return c && e && o && r.push(`url(${o}${e})`), u;
}
function W4(s, t, e, i, n, a) {
  if (i.startsWith("InvalidPDFjsFont_")) return null;
  a !== "TrueType" && a !== "Type1" || !/^[A-Z]{6}\+/.test(i) || (i = i.slice(7));
  const r = i = C2(i);
  let o = s.get(r);
  if (o) return o;
  let l = jd.get(i);
  if (!l) {
    for (const [b, y] of CE) if (i.startsWith(b)) {
      i = `${y}${i.substring(b.length)}`, l = jd.get(i);
      break;
    }
  }
  let c = !1;
  l || (l = jd.get(n), c = !0);
  const h = `${t.getDocId()}_s${t.createFontId()}`;
  if (!l) {
    if (!G3(i))
      return D(`Cannot substitute the font because of its name: ${i}`), s.set(r, null), null;
    const b = /bold/gi.test(i), y = /oblique|italic/gi.test(i), v = b && y && Ll || b && Nl || y && Bl || _l;
    return o = { css: `"${V4(i)}",${h}`, guessFallback: !0, loadedName: h, baseFontName: i, src: `local(${i})`, style: v }, s.set(r, o), o;
  }
  const u = [];
  c && G3(i) && u.push(`local(${i})`);
  const { style: f, ultimate: d } = p6(l, u, e), p = d === null, m = p ? "" : `,${d}`;
  return o = { css: `"${V4(i)}",${h}${m}`, guessFallback: p, loadedName: h, baseFontName: i, src: u.join(","), style: f }, s.set(r, o), o;
}
const X4 = 3285377520, rn = 4294901760, to = 65535;
class IE {
  constructor(t) {
    this.h1 = t ? 4294967295 & t : X4, this.h2 = t ? 4294967295 & t : X4;
  }
  update(t) {
    let e, i;
    if (typeof t == "string") {
      e = new Uint8Array(2 * t.length), i = 0;
      for (let m = 0, b = t.length; m < b; m++) {
        const y = t.charCodeAt(m);
        y <= 255 ? e[i++] = y : (e[i++] = y >>> 8, e[i++] = 255 & y);
      }
    } else {
      if (!ArrayBuffer.isView(t)) throw new Error("Invalid data format, must be a string or TypedArray.");
      e = t.slice(), i = e.byteLength;
    }
    const n = i >> 2, a = i - 4 * n, r = new Uint32Array(e.buffer, 0, n);
    let o = 0, l = 0, c = this.h1, h = this.h2;
    const u = 3432918353, f = 461845907, d = 11601, p = 13715;
    for (let m = 0; m < n; m++) 1 & m ? (o = r[m], o = o * u & rn | o * d & to, o = o << 15 | o >>> 17, o = o * f & rn | o * p & to, c ^= o, c = c << 13 | c >>> 19, c = 5 * c + 3864292196) : (l = r[m], l = l * u & rn | l * d & to, l = l << 15 | l >>> 17, l = l * f & rn | l * p & to, h ^= l, h = h << 13 | h >>> 19, h = 5 * h + 3864292196);
    switch (o = 0, a) {
      case 3:
        o ^= e[4 * n + 2] << 16;
      case 2:
        o ^= e[4 * n + 1] << 8;
      case 1:
        o ^= e[4 * n], o = o * u & rn | o * d & to, o = o << 15 | o >>> 17, o = o * f & rn | o * p & to, 1 & n ? c ^= o : h ^= o;
    }
    this.h1 = c, this.h2 = h;
  }
  hexdigest() {
    let t = this.h1, e = this.h2;
    return t ^= e >>> 1, t = 3981806797 * t & rn | 36045 * t & to, e = 4283543511 * e & rn | (2950163797 * (e << 16 | t >>> 16) & rn) >>> 16, t ^= e >>> 1, t = 444984403 * t & rn | 60499 * t & to, e = 3301882366 * e & rn | (3120437893 * (e << 16 | t >>> 16) & rn) >>> 16, t ^= e >>> 1, (t >>> 0).toString(16).padStart(8, "0") + (e >>> 0).toString(16).padStart(8, "0");
  }
}
function K4(s, t, e, i, n, a) {
  const r = n * a;
  let o;
  o = t <= 8 ? new Uint8Array(r) : t <= 16 ? new Uint16Array(r) : new Uint32Array(r);
  const l = e / n, c = i / a;
  let h, u, f, d, p = 0;
  const m = new Uint16Array(n), b = e;
  for (h = 0; h < n; h++) m[h] = Math.floor(h * l);
  for (h = 0; h < a; h++)
    for (f = Math.floor(h * c) * b, u = 0; u < n; u++)
      d = f + m[u], o[p++] = s[d];
  return o;
}
var l2, m6;
const Jh = class Jh {
  constructor({ xref: t, res: e, image: i, isInline: n = !1, smask: a = null, mask: r = null, isMask: o = !1, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h }) {
    _(this, l2);
    var y, v;
    this.image = i;
    const u = i.dict, f = u.get("F", "Filter");
    let d;
    if (f instanceof Z) d = f.name;
    else if (Array.isArray(f)) {
      const w = t.fetchIfRef(f[0]);
      w instanceof Z && (d = w.name);
    }
    switch (d) {
      case "JPXDecode":
        ({ width: i.width, height: i.height, componentsCount: i.numComps, bitsPerComponent: i.bitsPerComponent } = Yn.parseImageProperties(i.stream)), i.stream.reset();
        const w = Bn.getReducePowerForJPX(i.width, i.height, i.numComps);
        if (this.jpxDecoderOptions = { numComponents: 0, isIndexedColormap: !1, smaskInData: u.has("SMaskInData"), reducePower: w }, w) {
          const A = 2 ** w;
          i.width = Math.ceil(i.width / A), i.height = Math.ceil(i.height / A);
        }
        break;
      case "JBIG2Decode":
        i.bitsPerComponent = 1, i.numComps = 1;
    }
    let p = u.get("W", "Width"), m = u.get("H", "Height");
    if (Number.isInteger(i.width) && i.width > 0 && Number.isInteger(i.height) && i.height > 0 && (i.width !== p || i.height !== m))
      D("PDFImage - using the Width/Height of the image data, rather than the image dictionary."), p = i.width, m = i.height;
    else {
      const w = typeof p == "number" && p > 0, A = typeof m == "number" && m > 0;
      if (!w || !A) {
        if (!i.fallbackDims) throw new st(`Invalid image width: ${p} or height: ${m}`);
        D("PDFImage - using the Width/Height of the parent image, for SMask/Mask data."), w || (p = i.fallbackDims.width), A || (m = i.fallbackDims.height);
      }
    }
    this.width = p, this.height = m, this.interpolate = u.get("I", "Interpolate"), this.imageMask = u.get("IM", "ImageMask") || !1, this.matte = u.get("Matte") || !1;
    let b = i.bitsPerComponent;
    if (!b && (b = u.get("BPC", "BitsPerComponent"), !b)) {
      if (!this.imageMask) throw new st(`Bits per component missing in image: ${this.imageMask}`);
      b = 1;
    }
    if (this.bpc = b, !this.imageMask) {
      let w = u.getRaw("CS") || u.getRaw("ColorSpace");
      const A = !!w;
      if (A) (y = this.jpxDecoderOptions) != null && y.smaskInData && (w = Z.get("DeviceRGBA"));
      else if (this.jpxDecoderOptions) w = Z.get("DeviceRGBA");
      else switch (i.numComps) {
        case 1:
          w = Z.get("DeviceGray");
          break;
        case 3:
          w = Z.get("DeviceRGB");
          break;
        case 4:
          w = Z.get("DeviceCMYK");
          break;
        default:
          throw new Error(`Images with ${i.numComps} color components not supported.`);
      }
      this.colorSpace = te.parse({ cs: w, xref: t, resources: n ? e : null, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h }), this.numComps = this.colorSpace.numComps, this.jpxDecoderOptions && (this.jpxDecoderOptions.numComponents = A ? this.numComps : 0, this.jpxDecoderOptions.isIndexedColormap = this.colorSpace.name === "Indexed");
    }
    if (this.decode = u.getArray("D", "Decode"), this.needsDecode = !1, this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, b) || o && !Us.isDefaultDecode(this.decode, 1))) {
      this.needsDecode = !0;
      const w = (1 << b) - 1;
      this.decodeCoefficients = [], this.decodeAddends = [];
      const A = ((v = this.colorSpace) == null ? void 0 : v.name) === "Indexed";
      for (let x = 0, k = 0; x < this.decode.length; x += 2, ++k) {
        const I = this.decode[x], T = this.decode[x + 1];
        this.decodeCoefficients[k] = A ? (T - I) / w : T - I, this.decodeAddends[k] = A ? I : w * I;
      }
    }
    a ? (a.fallbackDims ?? (a.fallbackDims = { width: p, height: m }), this.smask = new Jh({ xref: t, res: e, image: a, isInline: n, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h })) : r && (r instanceof Ot ? r.dict.get("IM", "ImageMask") ? (r.fallbackDims ?? (r.fallbackDims = { width: p, height: m }), this.mask = new Jh({ xref: t, res: e, image: r, isInline: n, isMask: !0, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h })) : D("Ignoring /Mask in image without /ImageMask.") : this.mask = r);
  }
  static async buildImage({ xref: t, res: e, image: i, isInline: n = !1, pdfFunctionFactory: a, globalColorSpaceCache: r, localColorSpaceCache: o }) {
    const l = i;
    let c = null, h = null;
    const u = i.dict.get("SMask"), f = i.dict.get("Mask");
    return u ? u instanceof Ot ? c = u : D("Unsupported /SMask format.") : f && (f instanceof Ot || Array.isArray(f) ? h = f : D("Unsupported /Mask format.")), new Jh({ xref: t, res: e, image: l, isInline: n, smask: c, mask: h, pdfFunctionFactory: a, globalColorSpaceCache: r, localColorSpaceCache: o });
  }
  static async createMask({ image: t, isOffscreenCanvasSupported: e = !1 }) {
    const { dict: i } = t, n = i.get("W", "Width"), a = i.get("H", "Height"), r = i.get("I", "Interpolate"), o = i.getArray("D", "Decode"), l = (o == null ? void 0 : o[0]) > 0, c = (n + 7 >> 3) * a, h = t.getBytes(c), u = n === 1 && a === 1 && l === (h.length === 0 || !!(128 & h[0]));
    if (u) return { isSingleOpaquePixel: u };
    if (e) {
      if (Bn.needsToBeResized(n, a)) {
        const y = new Uint8ClampedArray(n * a * 4);
        return Q3({ src: h, dest: y, width: n, height: a, nonBlackColor: 0, inverseDecode: l }), Bn.createImage({ kind: sr, data: y, width: n, height: a, interpolate: r });
      }
      const p = new OffscreenCanvas(n, a), m = p.getContext("2d"), b = m.createImageData(n, a);
      return Q3({ src: h, dest: b.data, width: n, height: a, nonBlackColor: 0, inverseDecode: l }), m.putImageData(b, 0, 0), { data: null, width: n, height: a, interpolate: r, bitmap: p.transferToImageBitmap() };
    }
    const f = h.byteLength;
    let d;
    if (t instanceof fi && (!l || c === f) ? d = h : l ? (d = new Uint8Array(c), d.set(h), d.fill(255, f)) : d = new Uint8Array(h), l) for (let p = 0; p < f; p++) d[p] ^= 255;
    return { data: d, width: n, height: a, interpolate: r };
  }
  get drawWidth() {
    var t, e;
    return Math.max(this.width, ((t = this.smask) == null ? void 0 : t.width) || 0, ((e = this.mask) == null ? void 0 : e.width) || 0);
  }
  get drawHeight() {
    var t, e;
    return Math.max(this.height, ((t = this.smask) == null ? void 0 : t.height) || 0, ((e = this.mask) == null ? void 0 : e.height) || 0);
  }
  decodeBuffer(t) {
    const e = this.bpc, i = this.numComps, n = this.decodeAddends, a = this.decodeCoefficients, r = (1 << e) - 1;
    let o, l;
    if (e === 1) {
      for (o = 0, l = t.length; o < l; o++) t[o] = +!t[o];
      return;
    }
    let c = 0;
    for (o = 0, l = this.width * this.height; o < l; o++) for (let h = 0; h < i; h++)
      t[c] = Bs(n[h] + t[c] * a[h], 0, r), c++;
  }
  getComponents(t) {
    const e = this.bpc;
    if (e === 8) return t;
    const i = this.width, n = this.height, a = this.numComps, r = i * n * a;
    let o, l = 0;
    o = e <= 8 ? new Uint8Array(r) : e <= 16 ? new Uint16Array(r) : new Uint32Array(r);
    const c = i * a, h = (1 << e) - 1;
    let u, f, d = 0;
    if (e === 1) {
      let p, m, b;
      for (let y = 0; y < n; y++) {
        for (m = d + (-8 & c), b = d + c; d < m; )
          f = t[l++], o[d] = f >> 7 & 1, o[d + 1] = f >> 6 & 1, o[d + 2] = f >> 5 & 1, o[d + 3] = f >> 4 & 1, o[d + 4] = f >> 3 & 1, o[d + 5] = f >> 2 & 1, o[d + 6] = f >> 1 & 1, o[d + 7] = 1 & f, d += 8;
        if (d < b)
          for (f = t[l++], p = 128; d < b; )
            o[d++] = +!!(f & p), p >>= 1;
      }
    } else {
      let p = 0;
      for (f = 0, d = 0, u = r; d < u; ++d) {
        for (d % c == 0 && (f = 0, p = 0); p < e; )
          f = f << 8 | t[l++], p += 8;
        const m = p - e;
        let b = f >> m;
        b < 0 ? b = 0 : b > h && (b = h), o[d] = b, f &= (1 << m) - 1, p = m;
      }
    }
    return o;
  }
  async fillOpacity(t, e, i, n, a) {
    const r = this.smask, o = this.mask;
    let l, c, h, u, f, d;
    if (r)
      c = r.width, h = r.height, l = new Uint8ClampedArray(c * h), await r.fillGrayBuffer(l), c === e && h === i || (l = K4(l, r.bpc, c, h, e, i));
    else if (o) if (o instanceof Jh) {
      for (c = o.width, h = o.height, l = new Uint8ClampedArray(c * h), o.numComps = 1, await o.fillGrayBuffer(l), u = 0, f = c * h; u < f; ++u) l[u] = 255 - l[u];
      c === e && h === i || (l = K4(l, o.bpc, c, h, e, i));
    } else {
      if (!Array.isArray(o)) throw new st("Unknown mask format.");
      {
        l = new Uint8ClampedArray(e * i);
        const p = this.numComps;
        for (u = 0, f = e * i; u < f; ++u) {
          let m = 0;
          const b = u * p;
          for (d = 0; d < p; ++d) {
            const y = a[b + d], v = 2 * d;
            if (y < o[v] || y > o[v + 1]) {
              m = 255;
              break;
            }
          }
          l[u] = m;
        }
      }
    }
    if (l) for (u = 0, d = 3, f = e * n; u < f; ++u, d += 4) t[d] = l[u];
    else for (u = 0, d = 3, f = e * n; u < f; ++u, d += 4) t[d] = 255;
  }
  undoPreblend(t, e, i) {
    var h;
    const n = (h = this.smask) == null ? void 0 : h.matte;
    if (!n) return;
    const a = this.colorSpace.getRgb(n, 0), r = a[0], o = a[1], l = a[2], c = e * i * 4;
    for (let u = 0; u < c; u += 4) {
      const f = t[u + 3];
      if (f === 0) {
        t[u] = 255, t[u + 1] = 255, t[u + 2] = 255;
        continue;
      }
      const d = 255 / f;
      t[u] = (t[u] - r) * d + r, t[u + 1] = (t[u + 1] - o) * d + o, t[u + 2] = (t[u + 2] - l) * d + l;
    }
  }
  async createImageData(t = !1, e = !1) {
    const i = this.drawWidth, n = this.drawHeight, a = { width: i, height: n, interpolate: this.interpolate, kind: 0, data: null }, r = this.numComps, o = this.width, l = this.height, c = this.bpc, h = o * r * c + 7 >> 3, u = e && Bn.needsToBeResized(i, n);
    if (!this.smask && !this.mask && this.colorSpace.name === "DeviceRGBA") {
      a.kind = sr;
      const x = a.data = await this.getImageBytes(l * o * 4, {});
      return e ? u ? Bn.createImage(a, !1) : this.createBitmap(sr, i, n, x) : a;
    }
    if (!t) {
      let x;
      if (this.colorSpace.name === "DeviceGray" && c === 1 ? x = yp : this.colorSpace.name !== "DeviceRGB" || c !== 8 || this.needsDecode || (x = Od), x && !this.smask && !this.mask && i === o && n === l) {
        const k = await C(this, l2, m6).call(this, o, l);
        if (k) return k;
        const I = await this.getImageBytes(l * h, {});
        if (e) return u ? Bn.createImage({ data: I, kind: x, width: i, height: n, interpolate: this.interpolate }, this.needsDecode) : this.createBitmap(x, o, l, I);
        if (a.kind = x, a.data = I, this.needsDecode) {
          As(x === yp, "PDFImage.createImageData: The image must be grayscale.");
          const T = a.data;
          for (let E = 0, M = T.length; E < M; E++) T[E] ^= 255;
        }
        return a;
      }
      if (this.image instanceof E1 && !this.smask && !this.mask && !this.needsDecode) {
        let k = l * h;
        if (e && !u) {
          let I = !1;
          switch (this.colorSpace.name) {
            case "DeviceGray":
              k *= 4, I = !0;
              break;
            case "DeviceRGB":
              k = k / 3 * 4, I = !0;
              break;
            case "DeviceCMYK":
              I = !0;
          }
          if (I) {
            const T = await C(this, l2, m6).call(this, i, n);
            if (T) return T;
            const E = await this.getImageBytes(k, { drawWidth: i, drawHeight: n, forceRGBA: !0 });
            return this.createBitmap(sr, i, n, E);
          }
        } else switch (this.colorSpace.name) {
          case "DeviceGray":
            k *= 3;
          case "DeviceRGB":
          case "DeviceCMYK":
            return a.kind = Od, a.data = await this.getImageBytes(k, { drawWidth: i, drawHeight: n, forceRGB: !0 }), u ? Bn.createImage(a) : a;
        }
      }
    }
    const f = await this.getImageBytes(l * h, { internal: !0 }), d = 0 | f.length / h * n / l, p = this.getComponents(f);
    let m, b, y, v, w, A;
    return e && !u && (y = new OffscreenCanvas(i, n), v = y.getContext("2d"), w = v.createImageData(i, n), A = w.data), a.kind = sr, t || this.smask || this.mask ? (e && !u || (A = new Uint8ClampedArray(i * n * 4)), m = 1, b = !0, await this.fillOpacity(A, i, n, d, p)) : (!e || u ? (a.kind = Od, A = new Uint8ClampedArray(i * n * 3), m = 0) : (new Uint32Array(A.buffer).fill(Ii.isLittleEndian ? 4278190080 : 255), m = 1), b = !1), this.needsDecode && this.decodeBuffer(p), this.colorSpace.fillRgb(A, o, l, i, n, d, c, p, m), b && this.undoPreblend(A, i, d), e && !u ? (v.putImageData(w, 0, 0), { data: null, width: i, height: n, bitmap: y.transferToImageBitmap(), interpolate: this.interpolate }) : (a.data = A, u ? Bn.createImage(a) : a);
  }
  async fillGrayBuffer(t) {
    const e = this.numComps;
    if (e !== 1) throw new st(`Reading gray scale from a color image: ${e}`);
    const i = this.width, n = this.height, a = this.bpc, r = i * e * a + 7 >> 3, o = await this.getImageBytes(n * r, { internal: !0 }), l = this.getComponents(o);
    let c, h;
    if (a === 1) {
      if (h = i * n, this.needsDecode) for (c = 0; c < h; ++c) t[c] = l[c] - 1 & 255;
      else for (c = 0; c < h; ++c) t[c] = 255 & -l[c];
      return;
    }
    this.needsDecode && this.decodeBuffer(l), h = i * n;
    const u = 255 / ((1 << a) - 1);
    for (c = 0; c < h; ++c) t[c] = u * l[c];
  }
  createBitmap(t, e, i, n) {
    const a = new OffscreenCanvas(e, i), r = a.getContext("2d");
    let o;
    return t === sr ? o = new ImageData(n, e, i) : (o = r.createImageData(e, i), gA({ kind: t, src: n, dest: new Uint32Array(o.data.buffer), width: e, height: i, inverseDecode: this.needsDecode })), r.putImageData(o, 0, 0), { data: null, width: e, height: i, bitmap: a.transferToImageBitmap(), interpolate: this.interpolate };
  }
  async getImageBytes(t, { drawWidth: e, drawHeight: i, forceRGBA: n = !1, forceRGB: a = !1, internal: r = !1 }) {
    this.image.reset(), this.image.drawWidth = e || this.width, this.image.drawHeight = i || this.height, this.image.forceRGBA = !!n, this.image.forceRGB = !!a;
    const o = await this.image.getImageData(t, this.jpxDecoderOptions);
    return r || this.image instanceof fi ? o : (As(o instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.'), new Uint8Array(o));
  }
};
l2 = new WeakSet(), m6 = async function(t, e) {
  const i = await this.image.getTransferableImage();
  return i ? { data: null, width: t, height: e, bitmap: i, interpolate: this.interpolate } : null;
};
let Hd = Jh;
const _E = Object.freeze({ maxImageSize: -1, disableFontFace: !1, ignoreErrors: !1, isEvalSupported: !0, isOffscreenCanvasSupported: !1, isImageDecoderSupported: !1, canvasMaxAreaInBytes: -1, fontExtraProperties: !1, useSystemFonts: !0, useWasm: !0, useWorkerFetch: !0, cMapUrl: null, iccUrl: null, standardFontDataUrl: null, wasmUrl: null }), TE = 1, EE = 2, Y4 = Promise.resolve();
function VA(s, t = !1) {
  if (Array.isArray(s)) {
    for (const e of s) {
      const i = VA(e, !0);
      if (i) return i;
    }
    return D(`Unsupported blend mode Array: ${s}`), "source-over";
  }
  if (!(s instanceof Z)) return t ? null : "source-over";
  switch (s.name) {
    case "Normal":
    case "Compatible":
      return "source-over";
    case "Multiply":
      return "multiply";
    case "Screen":
      return "screen";
    case "Overlay":
      return "overlay";
    case "Darken":
      return "darken";
    case "Lighten":
      return "lighten";
    case "ColorDodge":
      return "color-dodge";
    case "ColorBurn":
      return "color-burn";
    case "HardLight":
      return "hard-light";
    case "SoftLight":
      return "soft-light";
    case "Difference":
      return "difference";
    case "Exclusion":
      return "exclusion";
    case "Hue":
      return "hue";
    case "Saturation":
      return "saturation";
    case "Color":
      return "color";
    case "Luminosity":
      return "luminosity";
  }
  return t ? null : (D(`Unsupported blend mode: ${s.name}`), "source-over");
}
function Lm(s, { objId: t, fn: e, args: i, optionalContent: n, hasMask: a }) {
  var r;
  t && s.addDependency(t), s.addImageOps(e, i, n, a), e === _1 && ((r = i[0]) == null ? void 0 : r.count) > 0 && i[0].count++;
}
const Zh = class Zh {
  constructor() {
    this.reset();
  }
  check() {
    return ++this.checked < Zh.CHECK_TIME_EVERY ? !1 : (this.checked = 0, this.endTime <= Date.now());
  }
  reset() {
    this.endTime = Date.now() + Zh.TIME_SLOT_DURATION_MS, this.checked = 0;
  }
};
ht(Zh, "TIME_SLOT_DURATION_MS", 20), ht(Zh, "CHECK_TIME_EVERY", 100);
let Up = Zh;
class F1 {
  constructor({ xref: t, handler: e, pageIndex: i, idFactory: n, fontCache: a, builtInCMapCache: r, standardFontDataCache: o, globalColorSpaceCache: l, globalImageCache: c, systemFontCache: h, options: u = null }) {
    this.xref = t, this.handler = e, this.pageIndex = i, this.idFactory = n, this.fontCache = a, this.builtInCMapCache = r, this.standardFontDataCache = o, this.globalColorSpaceCache = l, this.globalImageCache = c, this.systemFontCache = h, this.options = u || _E, this.type3FontRefs = null, this._regionalImageCache = new uE(), this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this);
  }
  get _pdfFunctionFactory() {
    return gt(this, "_pdfFunctionFactory", new zA({ xref: this.xref, isEvalSupported: this.options.isEvalSupported }));
  }
  get parsingType3Font() {
    return !!this.type3FontRefs;
  }
  clone(t = null) {
    const e = Object.create(this);
    return e.options = Object.assign(/* @__PURE__ */ Object.create(null), this.options, t), e;
  }
  hasBlendModes(t, e) {
    if (!(t instanceof q) || t.objId && e.has(t.objId)) return !1;
    const i = new Qe(e);
    t.objId && i.put(t.objId);
    const n = [t], a = this.xref;
    for (; n.length; ) {
      const r = n.shift(), o = r.get("ExtGState");
      if (o instanceof q) for (let c of o.getRawValues()) {
        if (c instanceof yt) {
          if (i.has(c)) continue;
          try {
            c = a.fetch(c);
          } catch (u) {
            i.put(c), qt(`hasBlendModes - ignoring ExtGState: "${u}".`);
            continue;
          }
        }
        if (!(c instanceof q)) continue;
        c.objId && i.put(c.objId);
        const h = c.get("BM");
        if (h instanceof Z) {
          if (h.name !== "Normal") return !0;
        } else if (h !== void 0 && Array.isArray(h)) {
          for (const u of h) if (u instanceof Z && u.name !== "Normal") return !0;
        }
      }
      const l = r.get("XObject");
      if (l instanceof q) for (let c of l.getRawValues()) {
        if (c instanceof yt) {
          if (i.has(c)) continue;
          try {
            c = a.fetch(c);
          } catch (u) {
            i.put(c), qt(`hasBlendModes - ignoring XObject: "${u}".`);
            continue;
          }
        }
        if (!(c instanceof Ot)) continue;
        c.dict.objId && i.put(c.dict.objId);
        const h = c.dict.get("Resources");
        h instanceof q && (!h.objId || !i.has(h.objId)) && (n.push(h), h.objId && i.put(h.objId));
      }
    }
    for (const r of i) e.put(r);
    return !1;
  }
  async fetchBuiltInCMap(t) {
    const e = this.builtInCMapCache.get(t);
    if (e) return e;
    let i;
    return i = this.options.useWorkerFetch ? { cMapData: await $3(`${this.options.cMapUrl}${t}.bcmap`), isCompressed: !0 } : await this.handler.sendWithPromise("FetchBinaryData", { type: "cMapReaderFactory", name: t }), this.builtInCMapCache.set(t, i), i;
  }
  async fetchStandardFontData(t) {
    const e = this.standardFontDataCache.get(t);
    if (e) return new Le(e);
    if (this.options.useSystemFonts && t !== "Symbol" && t !== "ZapfDingbats") return null;
    const i = K_()[t];
    let n;
    try {
      n = this.options.useWorkerFetch ? await $3(`${this.options.standardFontDataUrl}${i}`) : await this.handler.sendWithPromise("FetchBinaryData", { type: "standardFontDataFactory", filename: i });
    } catch (a) {
      return D(a), null;
    }
    return this.standardFontDataCache.set(t, n), new Le(n);
  }
  async buildFormXObject(t, e, i, n, a, r, o, l) {
    const { dict: c } = e, h = Qo(c.getArray("Matrix"), null), u = Kr(c.getArray("BBox"), null);
    let f, d;
    c.has("OC") && (f = await this.parseMarkedContentProps(c.get("OC"), t)), f !== void 0 && n.addOp(Na, ["OC", f]);
    const p = c.get("Group");
    if (p) {
      d = { matrix: h, bbox: u, smask: i, isolated: !1, knockout: !1 };
      let y = null;
      if (He(p.get("S"), "Transparency") && (d.isolated = p.get("I") || !1, d.knockout = p.get("K") || !1, p.has("CS"))) {
        const v = this._getColorSpace(p.getRaw("CS"), t, o);
        y = v instanceof Us ? v : await this._handleColorSpace(v);
      }
      i != null && i.backdrop && (y || (y = te.rgb), i.backdrop = y.getRgbHex(i.backdrop, 0)), n.addOp(gI, [d]);
    }
    const m = [h && new Float32Array(h), !p && u && new Float32Array(u) || null];
    n.addOp(Wv, m);
    const b = c.get("Resources");
    await this.getOperatorList({ stream: e, task: a, resources: b instanceof q ? b : t, operatorList: n, initialState: r, prevRefs: l }), n.addOp(fI, []), p && n.addOp(pI, [d]), f !== void 0 && n.addOp(I1, []);
  }
  _sendImgData(t, e, i = !1) {
    const n = e ? [e.bitmap || e.data.buffer] : null;
    return this.parsingType3Font || i ? this.handler.send("commonobj", [t, "Image", e], n) : this.handler.send("obj", [t, this.pageIndex, "Image", e], n);
  }
  async buildPaintImageXObject({ resources: t, image: e, isInline: i = !1, operatorList: n, cacheKey: a, localImageCache: r, localColorSpaceCache: o }) {
    const { maxImageSize: l, ignoreErrors: c, isOffscreenCanvasSupported: h } = this.options, { dict: u } = e, f = u.objId, d = u.get("W", "Width"), p = u.get("H", "Height");
    if (!d || typeof d != "number" || !p || typeof p != "number") {
      D("Image dimensions are missing, or not numbers.");
      return;
    }
    if (l !== -1 && d * p > l) {
      const I = "Image exceeded maximum allowed size and was removed.";
      if (!c) throw new Error(I);
      D(I);
      return;
    }
    let m;
    u.has("OC") && (m = await this.parseMarkedContentProps(u.get("OC"), t));
    let b, y, v;
    if (u.get("IM", "ImageMask")) {
      if (b = await Hd.createMask({ image: e, isOffscreenCanvasSupported: h && !this.parsingType3Font }), b.isSingleOpaquePixel) {
        if (y = wI, v = [], n.addImageOps(y, v, m), a) {
          const T = { fn: y, args: v, optionalContent: m };
          r.set(a, f, T), f && this._regionalImageCache.set(null, f, T);
        }
        return;
      }
      if (this.parsingType3Font) {
        if (v = function({ data: E, width: M, height: F }) {
          if (M > 1e3 || F > 1e3) return null;
          const L = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), Y = M + 1, B = new Uint8Array(Y * (F + 1));
          let et, H, P;
          const G = M + 7 & -8, N = new Uint8Array(G * F);
          let j = 0;
          for (const O of E) {
            let U = 128;
            for (; U > 0; )
              N[j++] = O & U ? 0 : 255, U >>= 1;
          }
          let V = 0;
          for (j = 0, N[j] !== 0 && (B[0] = 1, ++V), H = 1; H < M; H++)
            N[j] !== N[j + 1] && (B[H] = N[j] ? 2 : 1, ++V), j++;
          for (N[j] !== 0 && (B[H] = 2, ++V), et = 1; et < F; et++) {
            j = et * G, P = et * Y, N[j - G] !== N[j] && (B[P] = N[j] ? 1 : 8, ++V);
            let O = (N[j] ? 4 : 0) + (N[j - G] ? 8 : 0);
            for (H = 1; H < M; H++)
              O = (O >> 2) + (N[j + 1] ? 4 : 0) + (N[j - G + 1] ? 8 : 0), L[O] && (B[P + H] = L[O], ++V), j++;
            if (N[j - G] !== N[j] && (B[P + H] = N[j] ? 2 : 4, ++V), V > 1e3) return null;
          }
          for (j = G * (F - 1), P = et * Y, N[j] !== 0 && (B[P] = 8, ++V), H = 1; H < M; H++)
            N[j] !== N[j + 1] && (B[P + H] = N[j] ? 4 : 8, ++V), j++;
          if (N[j] !== 0 && (B[P + H] = 4, ++V), V > 1e3) return null;
          const X = new Int32Array([0, Y, -1, 0, -Y, 0, 0, 0, 1]), z = [], { a: K, b: W, c: rt, d: $, e: nt, f: wt } = new DOMMatrix().scaleSelf(1 / M, -1 / F).translateSelf(0, -F);
          for (et = 0; V && et <= F; et++) {
            let O = et * Y;
            const U = O + M;
            for (; O < U && !B[O]; ) O++;
            if (O === U) continue;
            let Q = O % Y, lt = et;
            z.push(_d, K * Q + rt * lt + nt, W * Q + $ * lt + wt);
            const pt = O;
            let ft = B[O];
            do {
              const dt = X[ft];
              do
                O += dt;
              while (!B[O]);
              const ut = B[O];
              ut !== 5 && ut !== 10 ? (ft = ut, B[O] = 0) : (ft = ut & 51 * ft >> 4, B[O] &= ft >> 2 | ft << 2), Q = O % Y, lt = O / Y | 0, z.push(Cl, K * Q + rt * lt + nt, W * Q + $ * lt + wt), B[O] || --V;
            } while (pt !== O);
            --et;
          }
          return [xI, [new Float32Array(z)], new Float32Array([0, 0, M, F])];
        }(b), v) {
          n.addImageOps(eh, v, m);
          return;
        }
        D("Cannot compile Type3 glyph."), n.addImageOps(_1, [b], m);
        return;
      }
      const I = `mask_${this.idFactory.createObjId()}`;
      if (n.addDependency(I), b.dataLen = b.bitmap ? b.width * b.height * 4 : b.data.length, this._sendImgData(I, b), y = _1, v = [{ data: I, width: b.width, height: b.height, interpolate: b.interpolate, count: 1 }], n.addImageOps(y, v, m), a) {
        const T = { objId: I, fn: y, args: v, optionalContent: m };
        r.set(a, f, T), f && this._regionalImageCache.set(null, f, T);
      }
      return;
    }
    const w = u.has("SMask") || u.has("Mask");
    if (i && d + p < 200 && !w) {
      try {
        b = await new Hd({ xref: this.xref, res: t, image: e, isInline: i, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: o }).createImageData(!0, !1), n.addImageOps(Fp, [b], m);
      } catch (I) {
        const T = `Unable to decode inline image: "${I}".`;
        if (!c) throw new Error(T);
        D(T);
      }
      return;
    }
    let A = `img_${this.idFactory.createObjId()}`, x = !1, k = null;
    if (this.parsingType3Font ? A = `${this.idFactory.getDocId()}_type3_${A}` : a && f && (x = this.globalImageCache.shouldCache(f, this.pageIndex), x && (As(!i, "Cannot cache an inline image globally."), A = `${this.idFactory.getDocId()}_${A}`)), n.addDependency(A), y = B3, v = [A, d, p], n.addImageOps(y, v, m, w), x) {
      if (k = { objId: A, fn: y, args: v, optionalContent: m, hasMask: w, byteSize: 0 }, this.globalImageCache.hasDecodeFailed(f)) {
        this.globalImageCache.setData(f, k), this._sendImgData(A, null, x);
        return;
      }
      if (d * p > 25e4 || w) {
        const I = await this.handler.sendWithPromise("commonobj", [A, "CopyLocalImage", { imageRef: f }]);
        if (I) {
          this.globalImageCache.setData(f, k), this.globalImageCache.addByteSize(f, I);
          return;
        }
      }
    }
    if (Hd.buildImage({ xref: this.xref, res: t, image: e, isInline: i, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: o }).then(async (I) => (b = await I.createImageData(!1, h), b.dataLen = b.bitmap ? b.width * b.height * 4 : b.data.length, b.ref = f, x && this.globalImageCache.addByteSize(f, b.dataLen), this._sendImgData(A, b, x))).catch((I) => (D(`Unable to decode image "${A}": "${I}".`), f && this.globalImageCache.addDecodeFailed(f), this._sendImgData(A, null, x))), a) {
      const I = { objId: A, fn: y, args: v, optionalContent: m, hasMask: w };
      r.set(a, f, I), f && (this._regionalImageCache.set(null, f, I), x && (As(k, "The global cache-data must be available."), this.globalImageCache.setData(f, k)));
    }
  }
  handleSMask(t, e, i, n, a, r, o) {
    const l = t.get("G"), c = { subtype: t.get("S").name, backdrop: t.get("BC") }, h = t.get("TR");
    if (Nm(h)) {
      const u = this._pdfFunctionFactory.create(h), f = new Uint8Array(256), d = new Float32Array(1);
      for (let p = 0; p < 256; p++)
        d[0] = p / 255, u(d, 0, d, 0), f[p] = 255 * d[0] | 0;
      c.transferMap = f;
    }
    return this.buildFormXObject(e, l, c, i, n, a.state.clone({ newPath: !0 }), r, o);
  }
  handleTransferFunction(t) {
    let e;
    if (Array.isArray(t)) e = t;
    else {
      if (!Nm(t)) return null;
      e = [t];
    }
    const i = [];
    let n = 0, a = 0;
    for (const r of e) {
      const o = this.xref.fetchIfRef(r);
      if (n++, He(o, "Identity")) {
        i.push(null);
        continue;
      }
      if (!Nm(o)) return null;
      const l = this._pdfFunctionFactory.create(o), c = new Uint8Array(256), h = new Float32Array(1);
      for (let u = 0; u < 256; u++)
        h[0] = u / 255, l(h, 0, h, 0), c[u] = 255 * h[0] | 0;
      i.push(c), a++;
    }
    return n !== 1 && n !== 4 || a === 0 ? null : i;
  }
  handleTilingType(t, e, i, n, a, r, o, l) {
    const c = new Ys(), h = q.merge({ xref: this.xref, dictArray: [a.get("Resources"), i] });
    return this.getOperatorList({ stream: n, task: o, resources: h, operatorList: c }).then(function() {
      const u = c.getIR(), f = L4(u, a, e);
      r.addDependencies(c.dependencies), r.addOp(t, f), a.objId && l.set(null, a.objId, { operatorListIR: u, dict: a });
    }).catch((u) => {
      if (!(u instanceof Es)) {
        if (!this.options.ignoreErrors) throw u;
        D(`handleTilingType - ignoring pattern: "${u}".`);
      }
    });
  }
  async handleSetFont(t, e, i, n, a, r, o = null, l = null) {
    const c = (e == null ? void 0 : e[0]) instanceof Z ? e[0].name : null, h = await this.loadFont(c, i, t, a, o, l);
    return h.font.isType3Font && n.addDependencies(h.type3Dependencies), r.font = h.font, h.send(this.handler), h.loadedName;
  }
  handleText(t, e) {
    const i = e.font, n = i.charsToGlyphs(t);
    return i.data && (e.textRenderingMode & bC || e.fillColorSpace.name === "Pattern" || i.disableFontFace) && F1.buildFontPaths(i, n, this.handler, this.options), n;
  }
  ensureStateFont(t) {
    if (t.font) return;
    const e = new st("Missing setFont (Tf) operator before text rendering operator.");
    if (!this.options.ignoreErrors) throw e;
    D(`ensureStateFont: "${e}".`);
  }
  async setGState({ resources: t, gState: e, operatorList: i, cacheKey: n, task: a, stateManager: r, localGStateCache: o, localColorSpaceCache: l, seenRefs: c }) {
    const h = e.objId;
    let u = !0;
    const f = [];
    let d = Promise.resolve();
    for (const [p, m] of e) switch (p) {
      case "Type":
        break;
      case "LW":
        if (typeof m != "number") {
          D(`Invalid LW (line width): ${m}`);
          break;
        }
        f.push([p, Math.abs(m)]);
        break;
      case "LC":
      case "LJ":
      case "ML":
      case "D":
      case "RI":
      case "FL":
      case "CA":
      case "ca":
        f.push([p, m]);
        break;
      case "Font":
        u = !1, d = d.then(() => this.handleSetFont(t, null, m[0], i, a, r.state).then(function(y) {
          i.addDependency(y), f.push([p, [y, m[1]]]);
        }));
        break;
      case "BM":
        f.push([p, VA(m)]);
        break;
      case "SMask":
        if (He(m, "None")) {
          f.push([p, !1]);
          break;
        }
        m instanceof q ? (u = !1, d = d.then(() => this.handleSMask(m, t, i, a, r, l, c)), f.push([p, !0])) : D("Unsupported SMask type");
        break;
      case "TR":
        const b = this.handleTransferFunction(m);
        f.push([p, b]);
        break;
      case "OP":
      case "op":
      case "OPM":
      case "BG":
      case "BG2":
      case "UCR":
      case "UCR2":
      case "TR2":
      case "HT":
      case "SM":
      case "SA":
      case "AIS":
      case "TK":
        qt("graphic state operator " + p);
        break;
      default:
        qt("Unknown graphic state operator " + p);
    }
    await d, f.length > 0 && i.addOp(Hl, [f]), u && o.set(n, h, f);
  }
  loadFont(t, e, i, n, a = null, r = null) {
    var b;
    const o = async () => new Om({ loadedName: "g_font_error", font: new N4(`Font "${t}" is not available.`), dict: e });
    let l;
    if (e) e instanceof yt && (l = e);
    else {
      const y = i.get("Font");
      y && (l = y.getRaw(t));
    }
    if (l) {
      if ((b = this.type3FontRefs) != null && b.has(l)) return o();
      if (this.fontCache.has(l)) return this.fontCache.get(l);
      try {
        e = this.xref.fetchIfRef(l);
      } catch (y) {
        D(`loadFont - lookup failed: "${y}".`);
      }
    }
    if (!(e instanceof q)) {
      if (!this.options.ignoreErrors && !this.parsingType3Font)
        return D(`Font "${t}" is not available.`), o();
      D(`Font "${t}" is not available -- attempting to fallback to a default font.`), e = a || F1.fallbackFontDict;
    }
    if (e.cacheKey && this.fontCache.has(e.cacheKey)) return this.fontCache.get(e.cacheKey);
    const { promise: c, resolve: h } = Promise.withResolvers();
    let u;
    try {
      u = this.preEvaluateFont(e), u.cssFontInfo = r;
    } catch (y) {
      return D(`loadFont - preEvaluateFont failed: "${y}".`), o();
    }
    const { descriptor: f, hash: d } = u, p = l instanceof yt;
    let m;
    if (d && f instanceof q) {
      const y = f.fontAliases || (f.fontAliases = /* @__PURE__ */ Object.create(null));
      if (y[d]) {
        const v = y[d].aliasRef;
        if (p && v && this.fontCache.has(v))
          return this.fontCache.putAlias(l, v), this.fontCache.get(l);
      } else y[d] = { fontID: this.idFactory.createFontId() };
      p && (y[d].aliasRef = l), m = y[d].fontID;
    } else m = this.idFactory.createFontId();
    return As(m == null ? void 0 : m.startsWith("f"), 'The "fontID" must be (correctly) defined.'), p ? this.fontCache.put(l, c) : (e.cacheKey = `cacheKey_${m}`, this.fontCache.put(e.cacheKey, c)), e.loadedName = `${this.idFactory.getDocId()}_${m}`, this.translateFont(u).then(async (y) => {
      const v = new Om({ loadedName: e.loadedName, font: y, dict: e });
      if (y.isType3Font) try {
        await v.loadType3Data(this, i, n);
      } catch (w) {
        throw new Error(`Type3 font load error: ${w}`);
      }
      h(v);
    }).catch((y) => {
      D(`loadFont - translateFont failed: "${y}".`), h(new Om({ loadedName: e.loadedName, font: new N4(y == null ? void 0 : y.message), dict: e }));
    }), c;
  }
  buildPath(t, e, i) {
    const { pathMinMax: n, pathBuffer: a } = i;
    switch (0 | t) {
      case E3: {
        const r = i.currentPointX = e[0], o = i.currentPointY = e[1], l = e[2], c = e[3], h = r + l, u = o + c;
        l === 0 || c === 0 ? a.push(_d, r, o, Cl, h, u, H2) : a.push(_d, r, o, Cl, h, o, Cl, h, u, Cl, r, u, H2), se.rectBoundingBox(r, o, h, u, n);
        break;
      }
      case wp: {
        const r = i.currentPointX = e[0], o = i.currentPointY = e[1];
        a.push(_d, r, o), se.pointBoundingBox(r, o, n);
        break;
      }
      case S3: {
        const r = i.currentPointX = e[0], o = i.currentPointY = e[1];
        a.push(Cl, r, o), se.pointBoundingBox(r, o, n);
        break;
      }
      case C3: {
        const r = i.currentPointX, o = i.currentPointY, [l, c, h, u, f, d] = e;
        i.currentPointX = f, i.currentPointY = d, a.push(qg, l, c, h, u, f, d), se.bezierBoundingBox(r, o, l, c, h, u, f, d, n);
        break;
      }
      case I3: {
        const r = i.currentPointX, o = i.currentPointY, [l, c, h, u] = e;
        i.currentPointX = h, i.currentPointY = u, a.push(qg, r, o, l, c, h, u), se.bezierBoundingBox(r, o, r, o, l, c, h, u, n);
        break;
      }
      case _3: {
        const r = i.currentPointX, o = i.currentPointY, [l, c, h, u] = e;
        i.currentPointX = h, i.currentPointY = u, a.push(qg, l, c, h, u, h, u), se.bezierBoundingBox(r, o, l, c, h, u, h, u, n);
        break;
      }
      case T3:
        a.push(H2);
    }
  }
  _getColorSpace(t, e, i) {
    return te.parse({ cs: t, xref: this.xref, resources: e, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: i, asyncIfNotCached: !0 });
  }
  async _handleColorSpace(t) {
    try {
      return await t;
    } catch (e) {
      if (e instanceof Es) return null;
      if (this.options.ignoreErrors)
        return D(`_handleColorSpace - ignoring ColorSpace: "${e}".`), null;
      throw e;
    }
  }
  parseShading({ shading: t, resources: e, localColorSpaceCache: i, localShadingPatternCache: n }) {
    let a, r = n.get(t);
    if (r) return r;
    try {
      a = ST.parseShading(t, this.xref, e, this._pdfFunctionFactory, this.globalColorSpaceCache, i).getIR();
    } catch (o) {
      if (o instanceof Es) return null;
      if (this.options.ignoreErrors)
        return D(`parseShading - ignoring shading: "${o}".`), n.set(t, null), null;
      throw o;
    }
    return r = `pattern_${this.idFactory.createObjId()}`, this.parsingType3Font && (r = `${this.idFactory.getDocId()}_type3_${r}`), n.set(t, r), this.parsingType3Font ? this.handler.send("commonobj", [r, "Pattern", a]) : this.handler.send("obj", [r, this.pageIndex, "Pattern", a]), r;
  }
  handleColorN(t, e, i, n, a, r, o, l, c, h) {
    const u = i.pop();
    if (u instanceof Z) {
      const f = a.getRaw(u.name), d = f instanceof yt && c.getByRef(f);
      if (d) try {
        const m = n.base ? n.base.getRgbHex(i, 0) : null, b = L4(d.operatorListIR, d.dict, m);
        t.addOp(e, b);
        return;
      } catch {
      }
      const p = this.xref.fetchIfRef(f);
      if (p) {
        const m = p instanceof Ot ? p.dict : p, b = m.get("PatternType");
        if (b === TE) {
          const y = n.base ? n.base.getRgbHex(i, 0) : null;
          return this.handleTilingType(e, y, r, p, m, t, o, c);
        }
        if (b === EE) {
          const y = m.get("Shading"), v = this.parseShading({ shading: y, resources: r, localColorSpaceCache: l, localShadingPatternCache: h });
          if (v) {
            const w = Qo(m.getArray("Matrix"), null);
            t.addOp(e, ["Shading", v, w]);
          }
          return;
        }
        throw new st(`Unknown PatternType: ${b}`);
      }
    }
    throw new st(`Unknown PatternName: ${u}`);
  }
  _parseVisibilityExpression(t, e, i) {
    if (++e > 10) {
      D("Visibility expression is too deeply nested");
      return;
    }
    const n = t.length, a = this.xref.fetchIfRef(t[0]);
    if (!(n < 2) && a instanceof Z) {
      switch (a.name) {
        case "And":
        case "Or":
        case "Not":
          i.push(a.name);
          break;
        default:
          D(`Invalid operator ${a.name} in visibility expression`);
          return;
      }
      for (let r = 1; r < n; r++) {
        const o = t[r], l = this.xref.fetchIfRef(o);
        if (Array.isArray(l)) {
          const c = [];
          i.push(c), this._parseVisibilityExpression(l, e, c);
        } else o instanceof yt && i.push(o.toString());
      }
    } else D("Invalid visibility expression");
  }
  async parseMarkedContentProps(t, e) {
    var a;
    let i;
    if (t instanceof Z)
      i = e.get("Properties").get(t.name);
    else {
      if (!(t instanceof q)) throw new st("Optional content properties malformed.");
      i = t;
    }
    const n = (a = i.get("Type")) == null ? void 0 : a.name;
    if (n === "OCG") return { type: n, id: i.objId };
    if (n === "OCMD") {
      const r = i.get("VE");
      if (Array.isArray(r)) {
        const l = [];
        if (this._parseVisibilityExpression(r, 0, l), l.length > 0) return { type: "OCMD", expression: l };
      }
      const o = i.get("OCGs");
      if (Array.isArray(o) || o instanceof q) {
        const l = [];
        if (Array.isArray(o)) for (const c of o) l.push(c.toString());
        else l.push(o.objId);
        return { type: n, ids: l, policy: i.get("P") instanceof Z ? i.get("P").name : null, expression: null };
      }
      if (o instanceof yt) return { type: n, id: o.toString() };
    }
    return null;
  }
  getOperatorList({ stream: t, task: e, resources: i, operatorList: n, initialState: a = null, fallbackFontDict: r = null, prevRefs: o = null }) {
    var I;
    const l = (I = t.dict) == null ? void 0 : I.objId, c = new Qe(o);
    if (l) {
      if (o != null && o.has(l)) throw new Error(`getOperatorList - ignoring circular reference: ${l}`);
      c.put(l);
    }
    if (i || (i = q.empty), a || (a = new KA()), !n) throw new Error('getOperatorList: missing "operatorList" parameter');
    const h = this, u = this.xref, f = new O4(), d = new HA(), p = new U4(), m = new hE(), b = /* @__PURE__ */ new Map(), y = i.get("XObject") || q.empty, v = i.get("Pattern") || q.empty, w = new ep(a), A = new R1(t, u, w), x = new Up();
    function k(T) {
      for (let E = 0, M = A.savedStatesDepth; E < M; E++) n.addOp(Ci, []);
    }
    return new Promise(function T(E, M) {
      const F = function(N) {
        Promise.all([N, n.ready]).then(function() {
          try {
            T(E, M);
          } catch (j) {
            M(j);
          }
        }, M);
      };
      e.ensureNotTerminated(), x.reset();
      const L = {};
      let Y, B, et, H, P, G;
      for (; !(Y = x.check()) && (L.args = null, !!A.read(L)); ) {
        let N = L.args, j = L.fn;
        switch (0 | j) {
          case N3:
            if (G = N[0] instanceof Z, P = N[0].name, G) {
              const $ = f.getByName(P);
              if ($) {
                Lm(n, $), N = null;
                continue;
              }
            }
            F(new Promise(function($, nt) {
              if (!G) throw new st("XObject must be referred to by name.");
              let wt = y.getRaw(P);
              if (wt instanceof yt) {
                const U = f.getByRef(wt) || h._regionalImageCache.getByRef(wt) || h.globalImageCache.getData(wt, h.pageIndex);
                if (U) {
                  Lm(n, U), $();
                  return;
                }
                wt = u.fetch(wt);
              }
              if (!(wt instanceof Ot)) throw new st("XObject should be a stream");
              const O = wt.dict.get("Subtype");
              if (!(O instanceof Z)) throw new st("XObject should have a Name subtype");
              if (O.name !== "Form") if (O.name !== "Image") {
                if (O.name !== "PS") throw new st(`Unhandled XObject subtype ${O.name}`);
                qt("Ignored XObject subtype PS"), $();
              } else h.buildPaintImageXObject({ resources: i, image: wt, operatorList: n, cacheKey: P, localImageCache: f, localColorSpaceCache: d }).then($, nt);
              else
                w.save(), h.buildFormXObject(i, wt, null, n, e, w.state.clone({ newPath: !0 }), d, c).then(function() {
                  w.restore(), $();
                }, nt);
            }).catch(function($) {
              if (!($ instanceof Es)) {
                if (!h.options.ignoreErrors) throw $;
                D(`getOperatorList - ignoring XObject: "${$}".`);
              }
            }));
            return;
          case il:
            const V = N[1];
            F(h.handleSetFont(i, N, null, n, e, w.state, r).then(function($) {
              n.addDependency($), n.addOp(il, [$, V]);
            }));
            return;
          case jv:
            const X = N[0].cacheKey;
            if (X) {
              const $ = f.getByName(X);
              if ($) {
                Lm(n, $), N = null;
                continue;
              }
            }
            F(h.buildPaintImageXObject({ resources: i, image: N[0], isInline: !0, operatorList: n, cacheKey: X, localImageCache: f, localColorSpaceCache: d }));
            return;
          case Dr:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            N[0] = h.handleText(N[0], w.state);
            break;
          case Cp:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            const z = [], K = w.state;
            for (const $ of N[0]) typeof $ == "string" ? z.push(...h.handleText($, K)) : typeof $ == "number" && z.push($);
            N[0] = z, j = Dr;
            break;
          case Ip:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            n.addOp(Ug), N[0] = h.handleText(N[0], w.state), j = Dr;
            break;
          case _p:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            n.addOp(Ug), n.addOp(P3, [N.shift()]), n.addOp(R3, [N.shift()]), N[0] = h.handleText(N[0], w.state), j = Dr;
            break;
          case Bv:
            w.state.textRenderingMode = N[0];
            break;
          case V9: {
            const $ = h._getColorSpace(N[0], i, d);
            if ($ instanceof Us) {
              w.state.fillColorSpace = $;
              continue;
            }
            F(h._handleColorSpace($).then((nt) => {
              w.state.fillColorSpace = nt || te.gray;
            }));
            return;
          }
          case h7: {
            const $ = h._getColorSpace(N[0], i, d);
            if ($ instanceof Us) {
              w.state.strokeColorSpace = $;
              continue;
            }
            F(h._handleColorSpace($).then((nt) => {
              w.state.strokeColorSpace = nt || te.gray;
            }));
            return;
          }
          case W9:
            H = w.state.fillColorSpace, N = [H.getRgbHex(N, 0)], j = Da;
            break;
          case u7:
            H = w.state.strokeColorSpace, N = [H.getRgbHex(N, 0)], j = no;
            break;
          case x2:
            w.state.fillColorSpace = te.gray, N = [te.gray.getRgbHex(N, 0)], j = Da;
            break;
          case d7:
            w.state.strokeColorSpace = te.gray, N = [te.gray.getRgbHex(N, 0)], j = no;
            break;
          case k2:
            w.state.fillColorSpace = te.cmyk, N = [te.cmyk.getRgbHex(N, 0)], j = Da;
            break;
          case f7:
            w.state.strokeColorSpace = te.cmyk, N = [te.cmyk.getRgbHex(N, 0)], j = no;
            break;
          case Da:
            w.state.fillColorSpace = te.rgb, N = [te.rgb.getRgbHex(N, 0)];
            break;
          case no:
            w.state.strokeColorSpace = te.rgb, N = [te.rgb.getRgbHex(N, 0)];
            break;
          case Ep:
            if (H = w.state.patternFillColorSpace, !H) {
              if (ci(N, null)) {
                N = [te.gray.getRgbHex(N, 0)], j = Da;
                break;
              }
              N = [], j = AI;
              break;
            }
            if (H.name === "Pattern") {
              F(h.handleColorN(n, Ep, N, H, v, i, e, d, m, b));
              return;
            }
            N = [H.getRgbHex(N, 0)], j = Da;
            break;
          case Tp:
            if (H = w.state.patternStrokeColorSpace, !H) {
              if (ci(N, null)) {
                N = [te.gray.getRgbHex(N, 0)], j = no;
                break;
              }
              N = [], j = vI;
              break;
            }
            if (H.name === "Pattern") {
              F(h.handleColorN(n, Tp, N, H, v, i, e, d, m, b));
              return;
            }
            N = [H.getRgbHex(N, 0)], j = no;
            break;
          case Mp:
            let W;
            try {
              const $ = i.get("Shading");
              if (!$) throw new st("No shading resource found");
              if (W = $.get(N[0].name), !W) throw new st("No shading object found");
            } catch ($) {
              if ($ instanceof Es) continue;
              if (h.options.ignoreErrors) {
                D(`getOperatorList - ignoring Shading: "${$}".`);
                continue;
              }
              throw $;
            }
            const rt = h.parseShading({ shading: W, resources: i, localColorSpaceCache: d, localShadingPatternCache: b });
            if (!rt) continue;
            N = [rt], j = Mp;
            break;
          case Hl:
            if (G = N[0] instanceof Z, P = N[0].name, G) {
              const $ = p.getByName(P);
              if ($) {
                $.length > 0 && n.addOp(Hl, [$]), N = null;
                continue;
              }
            }
            F(new Promise(function($, nt) {
              if (!G) throw new st("GState must be referred to by name.");
              const wt = i.get("ExtGState");
              if (!(wt instanceof q)) throw new st("ExtGState should be a dictionary.");
              const O = wt.get(P);
              if (!(O instanceof q)) throw new st("GState should be a dictionary.");
              h.setGState({ resources: i, gState: O, operatorList: n, cacheKey: P, task: e, stateManager: w, localGStateCache: p, localColorSpaceCache: d, seenRefs: c }).then($, nt);
            }).catch(function($) {
              if (!($ instanceof Es)) {
                if (!h.options.ignoreErrors) throw $;
                D(`getOperatorList - ignoring ExtGState: "${$}".`);
              }
            }));
            return;
          case Fv: {
            const [$] = N;
            if (typeof $ != "number") {
              D(`Invalid setLineWidth: ${$}`);
              continue;
            }
            N[0] = Math.abs($);
            break;
          }
          case wp:
          case S3:
          case C3:
          case I3:
          case _3:
          case T3:
          case E3:
            h.buildPath(j, N, w.state);
            continue;
          case o7:
          case vp:
          case M3:
          case Pv:
          case l7:
          case c7:
          case Ap:
          case xp:
          case F3: {
            const { state: { pathBuffer: $, pathMinMax: nt } } = w;
            j !== vp && j !== Ap && j !== xp || $.push(H2), $.length === 0 ? n.addOp(eh, [j, [null], null]) : (n.addOp(eh, [j, [new Float32Array($)], nt.slice()]), $.length = 0, nt.set([1 / 0, 1 / 0, -1 / 0, -1 / 0], 0));
            continue;
          }
          case lh:
            n.addOp(j, [new Float32Array(N)]);
            continue;
          case Hv:
          case $v:
          case Gv:
          case Vv:
            continue;
          case Na:
            if (!(N[0] instanceof Z)) {
              D(`Expected name for beginMarkedContentProps arg0=${N[0]}`), n.addOp(Na, ["OC", null]);
              continue;
            }
            if (N[0].name === "OC") {
              F(h.parseMarkedContentProps(N[1], i).then(($) => {
                n.addOp(Na, ["OC", $]);
              }).catch(($) => {
                if (!($ instanceof Es)) {
                  if (!h.options.ignoreErrors) throw $;
                  D(`getOperatorList - ignoring beginMarkedContentProps: "${$}".`), n.addOp(Na, ["OC", null]);
                }
              }));
              return;
            }
            N = [N[0].name, N[1] instanceof q ? N[1].get("MCID") : null];
            break;
          default:
            if (N !== null) {
              for (B = 0, et = N.length; B < et && !(N[B] instanceof q); B++) ;
              if (B < et) {
                D("getOperatorList - ignoring operator: " + j);
                continue;
              }
            }
        }
        n.addOp(j, N);
      }
      Y ? F(Y4) : (k(), E());
    }).catch((T) => {
      if (!(T instanceof Es)) {
        if (!this.options.ignoreErrors) throw T;
        D(`getOperatorList - ignoring errors during "${e.name}" task: "${T}".`), k();
      }
    });
  }
  getTextContent({ stream: t, task: e, resources: i, stateManager: n = null, includeMarkedContent: a = !1, sink: r, seenStyles: o = /* @__PURE__ */ new Set(), viewBox: l, lang: c = null, markedContentData: h = null, disableNormalization: u = !1, keepWhiteSpace: f = !1, prevRefs: d = null }) {
    var wt;
    const p = (wt = t.dict) == null ? void 0 : wt.objId, m = new Qe(d);
    if (p) {
      if (d != null && d.has(p)) throw new Error(`getTextContent - ignoring circular reference: ${p}`);
      m.put(p);
    }
    i || (i = q.empty), n || (n = new ep(new ME())), a && (h || (h = { level: 0 }));
    const b = { items: [], styles: /* @__PURE__ */ Object.create(null), lang: c }, y = { initialized: !1, str: [], totalWidth: 0, totalHeight: 0, width: 0, height: 0, vertical: !1, prevTransform: null, textAdvanceScale: 0, spaceInFlowMin: 0, spaceInFlowMax: 0, trackingSpaceMin: 1 / 0, negativeSpaceMax: -1 / 0, notASpace: -1 / 0, transform: null, fontName: null, hasEOL: !1 }, v = [" ", " "];
    let w = 0;
    function A(O) {
      const U = (w + 1) % 2, Q = v[w] !== " " && v[U] === " ";
      return v[w] = O, w = U, !f && Q;
    }
    function x() {
      return !f && v[w] !== " " && v[(w + 1) % 2] === " ";
    }
    function k() {
      v[0] = v[1] = " ", w = 0;
    }
    const I = this, T = this.xref, E = [];
    let M = null;
    const F = new O4(), L = new U4(), Y = new R1(t, T, n);
    let B;
    function et({ width: O = 0, height: U = 0, transform: Q = y.prevTransform, fontName: lt = y.fontName }) {
      b.items.push({ str: " ", dir: "ltr", width: O, height: U, transform: Q, fontName: lt, hasEOL: !1 });
    }
    function H() {
      const O = B.font, U = [B.fontSize * B.textHScale, 0, 0, B.fontSize, 0, B.textRise];
      if (O.isType3Font && (B.fontSize <= 1 || O.isCharBBox) && !r0(B.fontMatrix, Qc)) {
        const Q = O.bbox[3] - O.bbox[1];
        Q > 0 && (U[3] *= Q * B.fontMatrix[3]);
      }
      return se.transform(B.ctm, se.transform(B.textMatrix, U));
    }
    function P() {
      if (y.initialized) return y;
      const { font: O, loadedName: U } = B;
      if (!o.has(U) && (o.add(U), b.styles[U] = { fontFamily: O.fallbackName, ascent: O.ascent, descent: O.descent, vertical: O.vertical }, I.options.fontExtraProperties && O.systemFontInfo)) {
        const dt = b.styles[U];
        dt.fontSubstitution = O.systemFontInfo.css, dt.fontSubstitutionLoadedName = O.systemFontInfo.loadedName;
      }
      y.fontName = U;
      const Q = y.transform = H();
      O.vertical ? (y.width = y.totalWidth = Math.hypot(Q[0], Q[1]), y.height = y.totalHeight = 0, y.vertical = !0) : (y.width = y.totalWidth = 0, y.height = y.totalHeight = Math.hypot(Q[2], Q[3]), y.vertical = !1);
      const lt = Math.hypot(B.textLineMatrix[0], B.textLineMatrix[1]), pt = Math.hypot(B.ctm[0], B.ctm[1]);
      y.textAdvanceScale = pt * lt;
      const { fontSize: ft } = B;
      return y.trackingSpaceMin = 0.102 * ft, y.notASpace = 0.03 * ft, y.negativeSpaceMax = -0.2 * ft, y.spaceInFlowMin = 0.102 * ft, y.spaceInFlowMax = 0.6 * ft, y.hasEOL = !1, y.initialized = !0, y;
    }
    function G() {
      if (!y.initialized) return;
      const O = Math.hypot(B.textLineMatrix[0], B.textLineMatrix[1]), U = Math.hypot(B.ctm[0], B.ctm[1]) * O;
      U !== y.textAdvanceScale && (y.vertical ? (y.totalHeight += y.height * y.textAdvanceScale, y.height = 0) : (y.totalWidth += y.width * y.textAdvanceScale, y.width = 0), y.textAdvanceScale = U);
    }
    function N(O) {
      let U = O.str.join("");
      u || (U = function(pt) {
        return vm || (vm = /([\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, W8 = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), pt.replaceAll(vm, (ft, dt, ut) => dt ? dt.normalize("NFKC") : W8.get(ut));
      }(U));
      const Q = GA(U, -1, O.vertical);
      return { str: Q.str, dir: Q.dir, width: Math.abs(O.totalWidth), height: Math.abs(O.totalHeight), transform: O.transform, fontName: O.fontName, hasEOL: O.hasEOL };
    }
    async function j(O, U) {
      const Q = await I.loadFont(O, U, i, e);
      B.loadedName = Q.loadedName, B.font = Q.font, B.fontMatrix = Q.font.fontMatrix || Qc;
    }
    function V(O, U, Q) {
      const lt = Math.hypot(Q[0], Q[1]);
      return [(Q[0] * O + Q[1] * U) / lt, (Q[2] * O + Q[3] * U) / lt];
    }
    function X(O) {
      var Bt;
      const U = H();
      let Q = U[4], lt = U[5];
      if ((Bt = B.font) != null && Bt.vertical) {
        if (Q < l[0] || Q > l[2] || lt + O < l[1] || lt > l[3]) return !1;
      } else if (Q + O < l[0] || Q > l[2] || lt < l[1] || lt > l[3]) return !1;
      if (!B.font || !y.prevTransform) return !0;
      let pt = y.prevTransform[4], ft = y.prevTransform[5];
      if (pt === Q && ft === lt) return !0;
      let dt = -1;
      switch (U[0] && U[1] === 0 && U[2] === 0 ? dt = U[0] > 0 ? 0 : 180 : U[1] && U[0] === 0 && U[3] === 0 && (dt = U[1] > 0 ? 90 : 270), dt) {
        case 0:
          break;
        case 90:
          [Q, lt] = [lt, Q], [pt, ft] = [ft, pt];
          break;
        case 180:
          [Q, lt, pt, ft] = [-Q, -lt, -pt, -ft];
          break;
        case 270:
          [Q, lt] = [-lt, -Q], [pt, ft] = [-ft, -pt];
          break;
        default:
          [Q, lt] = V(Q, lt, U), [pt, ft] = V(pt, ft, y.prevTransform);
      }
      if (B.font.vertical) {
        const vt = (ft - lt) / y.textAdvanceScale, xt = Q - pt, kt = Math.sign(y.height);
        return vt < kt * y.negativeSpaceMax ? Math.abs(xt) > 0.5 * y.width ? (K(), !0) : (k(), rt(), !0) : Math.abs(xt) > y.width ? (K(), !0) : (vt <= kt * y.notASpace && k(), vt <= kt * y.trackingSpaceMin ? x() ? (k(), rt(), et({ height: Math.abs(vt) })) : y.height += vt : W(vt, y.prevTransform, kt) || (y.str.length === 0 ? (k(), et({ height: Math.abs(vt) })) : y.height += vt), Math.abs(xt) > 0.25 * y.width && rt(), !0);
      }
      const ut = (Q - pt) / y.textAdvanceScale, ct = lt - ft, Tt = Math.sign(y.width);
      return ut < Tt * y.negativeSpaceMax ? Math.abs(ct) > 0.5 * y.height ? (K(), !0) : (k(), rt(), !0) : Math.abs(ct) > y.height ? (K(), !0) : (ut <= Tt * y.notASpace && k(), ut <= Tt * y.trackingSpaceMin ? x() ? (k(), rt(), et({ width: Math.abs(ut) })) : y.width += ut : W(ut, y.prevTransform, Tt) || (y.str.length === 0 ? (k(), et({ width: Math.abs(ut) })) : y.width += ut), Math.abs(ct) > 0.25 * y.height && rt(), !0);
    }
    function z({ chars: O, extraSpacing: U }) {
      const Q = B.font;
      if (!O) {
        const ft = B.charSpacing + U;
        ft && (Q.vertical ? B.translateTextMatrix(0, -ft) : B.translateTextMatrix(ft * B.textHScale, 0)), f && X(0);
        return;
      }
      const lt = Q.charsToGlyphs(O), pt = B.fontMatrix[0] * B.fontSize;
      for (let ft = 0, dt = lt.length; ft < dt; ft++) {
        const ut = lt[ft], { category: ct } = ut;
        if (ct.isInvisibleFormatMark) continue;
        let Tt = B.charSpacing + (ft + 1 === dt ? U : 0), Bt = ut.width;
        Q.vertical && (Bt = ut.vmetric ? ut.vmetric[0] : -Bt);
        let vt = Bt * pt;
        if (!f && ct.isWhitespace) {
          Q.vertical ? (Tt += -vt + B.wordSpacing, B.translateTextMatrix(0, -Tt)) : (Tt += vt + B.wordSpacing, B.translateTextMatrix(Tt * B.textHScale, 0)), A(" ");
          continue;
        }
        if (!ct.isZeroWidthDiacritic && !X(vt)) {
          Q.vertical ? B.translateTextMatrix(0, vt) : B.translateTextMatrix(vt * B.textHScale, 0);
          continue;
        }
        const xt = P();
        ct.isZeroWidthDiacritic && (vt = 0), Q.vertical ? (B.translateTextMatrix(0, vt), vt = Math.abs(vt), xt.height += vt) : (vt *= B.textHScale, B.translateTextMatrix(vt, 0), xt.width += vt), vt && (xt.prevTransform = H());
        const kt = ut.unicode;
        A(kt) && xt.str.push(" "), xt.str.push(kt), Tt && (Q.vertical ? B.translateTextMatrix(0, -Tt) : B.translateTextMatrix(Tt * B.textHScale, 0));
      }
    }
    function K() {
      k(), y.initialized ? (y.hasEOL = !0, rt()) : b.items.push({ str: "", dir: "ltr", width: 0, height: 0, transform: H(), fontName: B.loadedName, hasEOL: !0 });
    }
    function W(O, U, Q) {
      if (Q * y.spaceInFlowMin <= O && O <= Q * y.spaceInFlowMax)
        return y.initialized && (k(), y.str.push(" ")), !1;
      const lt = y.fontName;
      let pt = 0;
      return y.vertical && (pt = O, O = 0), rt(), k(), et({ width: Math.abs(O), height: Math.abs(pt), transform: U || H(), fontName: lt }), !0;
    }
    function rt() {
      y.initialized && y.str && (y.vertical ? y.totalHeight += y.height * y.textAdvanceScale : y.totalWidth += y.width * y.textAdvanceScale, b.items.push(N(y)), y.initialized = !1, y.str.length = 0);
    }
    function $(O = !1) {
      const U = b.items.length;
      U !== 0 && !(O && U < 10) && (r.enqueue(b, U), b.items = [], b.styles = /* @__PURE__ */ Object.create(null));
    }
    const nt = new Up();
    return new Promise(function O(U, Q) {
      const lt = function(Tt) {
        $(!0), Promise.all([Tt, r.ready]).then(function() {
          try {
            O(U, Q);
          } catch (Bt) {
            Q(Bt);
          }
        }, Q);
      };
      e.ensureNotTerminated(), nt.reset();
      const pt = {};
      let ft, dt, ut, ct = [];
      for (; !(ft = nt.check()) && (ct.length = 0, pt.args = ct, !!Y.read(pt)); ) {
        const Tt = B;
        B = n.state;
        const Bt = pt.fn;
        switch (ct = pt.args, 0 | Bt) {
          case il:
            const vt = ct[0].name, xt = ct[1];
            if (B.font && vt === B.fontName && xt === B.fontSize) break;
            rt(), B.fontName = vt, B.fontSize = xt, lt(j(vt, null));
            return;
          case Lv:
            B.textRise = ct[0];
            break;
          case Dv:
            B.textHScale = ct[0] / 100;
            break;
          case Nv:
            B.leading = ct[0];
            break;
          case Ov:
            B.translateTextLineMatrix(ct[0], ct[1]), B.textMatrix = B.textLineMatrix.slice();
            break;
          case Uv:
            B.leading = -ct[1], B.translateTextLineMatrix(ct[0], ct[1]), B.textMatrix = B.textLineMatrix.slice();
            break;
          case Ug:
            B.carriageReturn();
            break;
          case lh:
            B.setTextMatrix(ct[0], ct[1], ct[2], ct[3], ct[4], ct[5]), B.setTextLineMatrix(ct[0], ct[1], ct[2], ct[3], ct[4], ct[5]), G();
            break;
          case R3:
            B.charSpacing = ct[0];
            break;
          case P3:
            B.wordSpacing = ct[0];
            break;
          case kp:
            B.textMatrix = ia.slice(), B.textLineMatrix = ia.slice();
            break;
          case Cp:
            if (!n.state.font) {
              I.ensureStateFont(n.state);
              continue;
            }
            const kt = (B.font.vertical ? 1 : -1) * B.fontSize / 1e3, Gt = ct[0];
            for (let Kt = 0, Mi = Gt.length; Kt < Mi; Kt++) {
              const os = Gt[Kt];
              if (typeof os == "string") E.push(os);
              else if (typeof os == "number" && os !== 0) {
                const Pn = E.join("");
                E.length = 0, z({ chars: Pn, extraSpacing: os * kt });
              }
            }
            if (E.length > 0) {
              const Kt = E.join("");
              E.length = 0, z({ chars: Kt, extraSpacing: 0 });
            }
            break;
          case Dr:
            if (!n.state.font) {
              I.ensureStateFont(n.state);
              continue;
            }
            z({ chars: ct[0], extraSpacing: 0 });
            break;
          case Ip:
            if (!n.state.font) {
              I.ensureStateFont(n.state);
              continue;
            }
            B.carriageReturn(), z({ chars: ct[0], extraSpacing: 0 });
            break;
          case _p:
            if (!n.state.font) {
              I.ensureStateFont(n.state);
              continue;
            }
            B.wordSpacing = ct[0], B.charSpacing = ct[1], B.carriageReturn(), z({ chars: ct[2], extraSpacing: 0 });
            break;
          case N3:
            if (rt(), M ?? (M = i.get("XObject") || q.empty), ut = ct[0] instanceof Z, dt = ct[0].name, ut && F.getByName(dt)) break;
            lt(new Promise(function(Kt, Mi) {
              if (!ut) throw new st("XObject must be referred to by name.");
              let os = M.getRaw(dt);
              if (os instanceof yt) {
                if (F.getByRef(os)) {
                  Kt();
                  return;
                }
                if (I.globalImageCache.getData(os, I.pageIndex)) {
                  Kt();
                  return;
                }
                os = T.fetch(os);
              }
              if (!(os instanceof Ot)) throw new st("XObject should be a stream");
              const { dict: Pn } = os, wh = Pn.get("Subtype");
              if (!(wh instanceof Z)) throw new st("XObject should have a Name subtype");
              if (wh.name !== "Form") {
                F.set(dt, Pn.objId, !0), Kt();
                return;
              }
              const Ik = n.state.clone(), l8 = new ep(Ik), c8 = Qo(Pn.getArray("Matrix"), null);
              c8 && l8.transform(c8);
              const h8 = Pn.get("Resources");
              $();
              const u8 = { enqueueInvoked: !1, enqueue(_k, Tk) {
                this.enqueueInvoked = !0, r.enqueue(_k, Tk);
              }, get desiredSize() {
                return r.desiredSize;
              }, get ready() {
                return r.ready;
              } };
              I.getTextContent({ stream: os, task: e, resources: h8 instanceof q ? h8 : i, stateManager: l8, includeMarkedContent: a, sink: u8, seenStyles: o, viewBox: l, lang: c, markedContentData: h, disableNormalization: u, keepWhiteSpace: f, prevRefs: m }).then(function() {
                u8.enqueueInvoked || F.set(dt, Pn.objId, !0), Kt();
              }, Mi);
            }).catch(function(Kt) {
              if (!(Kt instanceof Es)) {
                if (!I.options.ignoreErrors) throw Kt;
                D(`getTextContent - ignoring XObject: "${Kt}".`);
              }
            }));
            return;
          case Hl:
            if (ut = ct[0] instanceof Z, dt = ct[0].name, ut && L.getByName(dt)) break;
            lt(new Promise(function(Kt, Mi) {
              if (!ut) throw new st("GState must be referred to by name.");
              const os = i.get("ExtGState");
              if (!(os instanceof q)) throw new st("ExtGState should be a dictionary.");
              const Pn = os.get(dt);
              if (!(Pn instanceof q)) throw new st("GState should be a dictionary.");
              const wh = Pn.get("Font");
              wh ? (rt(), B.fontName = null, B.fontSize = wh[1], j(null, wh[0]).then(Kt, Mi)) : (L.set(dt, Pn.objId, !0), Kt());
            }).catch(function(Kt) {
              if (!(Kt instanceof Es)) {
                if (!I.options.ignoreErrors) throw Kt;
                D(`getTextContent - ignoring ExtGState: "${Kt}".`);
              }
            }));
            return;
          case zv:
            rt(), a && (h.level++, b.items.push({ type: "beginMarkedContent", tag: ct[0] instanceof Z ? ct[0].name : null }));
            break;
          case Na:
            if (rt(), a) {
              h.level++;
              let Kt = null;
              ct[1] instanceof q && (Kt = ct[1].get("MCID")), b.items.push({ type: "beginMarkedContentProps", id: Number.isInteger(Kt) ? `${I.idFactory.getPageObjId()}_mc${Kt}` : null, tag: ct[0] instanceof Z ? ct[0].name : null });
            }
            break;
          case I1:
            if (rt(), a) {
              if (h.level === 0) break;
              h.level--, b.items.push({ type: "endMarkedContent" });
            }
            break;
          case Ci:
            !Tt || Tt.font === B.font && Tt.fontSize === B.fontSize && Tt.fontName === B.fontName || rt();
        }
        if (b.items.length >= r.desiredSize) {
          ft = !0;
          break;
        }
      }
      ft ? lt(Y4) : (rt(), $(), U());
    }).catch((O) => {
      if (!(O instanceof Es)) {
        if (!this.options.ignoreErrors) throw O;
        D(`getTextContent - ignoring errors during "${e.name}" task: "${O}".`), rt(), $();
      }
    });
  }
  async extractDataStructures(t, e) {
    const i = this.xref;
    let n;
    const a = this.readToUnicode(e.toUnicode);
    if (e.composite) {
      const f = t.get("CIDSystemInfo");
      f instanceof q && (e.cidSystemInfo = { registry: Jt(f.get("Registry")), ordering: Jt(f.get("Ordering")), supplement: f.get("Supplement") });
      try {
        const d = t.get("CIDToGIDMap");
        d instanceof Ot && (n = d.getBytes());
      } catch (d) {
        if (!this.options.ignoreErrors) throw d;
        D(`extractDataStructures - ignoring CIDToGIDMap data: "${d}".`);
      }
    }
    const r = [];
    let o, l = null;
    if (t.has("Encoding")) {
      if (o = t.get("Encoding"), o instanceof q) {
        if (l = o.get("BaseEncoding"), l = l instanceof Z ? l.name : null, o.has("Differences")) {
          const f = o.get("Differences");
          let d = 0;
          for (const p of f) {
            const m = i.fetchIfRef(p);
            if (typeof m == "number") d = m;
            else {
              if (!(m instanceof Z)) throw new st(`Invalid entry in 'Differences' array: ${m}`);
              r[d++] = m.name;
            }
          }
        }
      } else if (o instanceof Z) l = o.name;
      else {
        const f = "Encoding is not a Name nor a Dict";
        if (!this.options.ignoreErrors) throw new st(f);
        D(f);
      }
      l !== "MacRomanEncoding" && l !== "MacExpertEncoding" && l !== "WinAnsiEncoding" && (l = null);
    }
    const c = !e.file || e.isInternalFont, h = o6()[e.name];
    if (l && c && h && (l = null), l) e.defaultEncoding = c0(l);
    else {
      const f = !!(e.flags & Lp), d = !!(e.flags & g4);
      o = Ur, e.type !== "TrueType" || d || (o = l0), (f || h) && (o = b7, c && (/Symbol/i.test(e.name) ? o = y7 : /Dingbats/i.test(e.name) ? o = w7 : /Wingdings/i.test(e.name) && (o = l0))), e.defaultEncoding = o;
    }
    e.differences = r, e.baseEncodingName = l, e.hasEncoding = !!l || r.length > 0, e.dict = t, e.toUnicode = await a;
    const u = await this.buildToUnicode(e);
    return e.toUnicode = u, n && (e.cidToGidMap = this.readCidToGidMap(n, u)), e;
  }
  _simpleFontToUnicode(t, e = !1) {
    As(!t.composite, "Must be a simple font.");
    const i = [], n = t.defaultEncoding.slice(), a = t.baseEncodingName, r = t.differences;
    for (const l in r) {
      const c = r[l];
      c !== ".notdef" && (n[l] = c);
    }
    const o = ma();
    for (const l in n) {
      let c = n[l];
      if (c === "") continue;
      let h = o[c];
      if (h !== void 0) {
        i[l] = String.fromCharCode(h);
        continue;
      }
      let u = 0;
      switch (c[0]) {
        case "G":
          c.length === 3 && (u = parseInt(c.substring(1), 16));
          break;
        case "g":
          c.length === 5 && (u = parseInt(c.substring(1), 16));
          break;
        case "C":
        case "c":
          if (c.length >= 3 && c.length <= 4) {
            const f = c.substring(1);
            if (e) {
              u = parseInt(f, 16);
              break;
            }
            if (u = +f, Number.isNaN(u) && Number.isInteger(parseInt(f, 16))) return this._simpleFontToUnicode(t, !0);
          }
          break;
        case "u":
          h = M1(c, o), h !== -1 && (u = h);
          break;
        default:
          switch (c) {
            case "f_h":
            case "f_t":
            case "T_h":
              i[l] = c.replaceAll("_", "");
              continue;
          }
      }
      if (u > 0 && u <= 1114111 && Number.isInteger(u)) {
        if (a && u === +l) {
          const f = c0(a);
          if (f && (c = f[l])) {
            i[l] = String.fromCharCode(o[c]);
            continue;
          }
        }
        i[l] = String.fromCodePoint(u);
      }
    }
    return i;
  }
  async buildToUnicode(t) {
    var e, i;
    if (t.hasIncludedToUnicodeMap = ((e = t.toUnicode) == null ? void 0 : e.length) > 0, t.hasIncludedToUnicodeMap)
      return !t.composite && t.hasEncoding && (t.fallbackToUnicode = this._simpleFontToUnicode(t)), t.toUnicode;
    if (!t.composite) return new Rd(this._simpleFontToUnicode(t));
    if (t.composite && (t.cMap.builtInCMap && !(t.cMap instanceof au) || ((i = t.cidSystemInfo) == null ? void 0 : i.registry) === "Adobe" && (t.cidSystemInfo.ordering === "GB1" || t.cidSystemInfo.ordering === "CNS1" || t.cidSystemInfo.ordering === "Japan1" || t.cidSystemInfo.ordering === "Korea1"))) {
      const { registry: n, ordering: a } = t.cidSystemInfo, r = Z.get(`${n}-${a}-UCS2`), o = await Q2.create({ encoding: r, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null }), l = [], c = [];
      return t.cMap.forEach(function(h, u) {
        if (u > 65535) throw new st("Max size of CID is 65,535");
        const f = o.lookup(u);
        if (f) {
          c.length = 0;
          for (let d = 0, p = f.length; d < p; d += 2) c.push((f.charCodeAt(d) << 8) + f.charCodeAt(d + 1));
          l[h] = String.fromCharCode(...c);
        }
      }), new Rd(l);
    }
    return new bn(t.firstChar, t.lastChar);
  }
  async readToUnicode(t) {
    if (!t) return null;
    if (t instanceof Z) {
      const e = await Q2.create({ encoding: t, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null });
      return e instanceof au ? new bn(0, 65535) : new Rd(e.getMap());
    }
    if (t instanceof Ot) try {
      const e = await Q2.create({ encoding: t, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null });
      if (e instanceof au) return new bn(0, 65535);
      const i = new Array(e.length);
      return e.forEach(function(n, a) {
        if (typeof a == "number") {
          i[n] = String.fromCodePoint(a);
          return;
        }
        a.length % 2 != 0 && (a = "\0" + a);
        const r = [];
        for (let o = 0; o < a.length; o += 2) {
          const l = a.charCodeAt(o) << 8 | a.charCodeAt(o + 1);
          if ((63488 & l) != 55296) {
            r.push(l);
            continue;
          }
          o += 2;
          const c = a.charCodeAt(o) << 8 | a.charCodeAt(o + 1);
          r.push(((1023 & l) << 10) + (1023 & c) + 65536);
        }
        i[n] = String.fromCodePoint(...r);
      }), new Rd(i);
    } catch (e) {
      if (e instanceof Es) return null;
      if (this.options.ignoreErrors)
        return D(`readToUnicode - ignoring ToUnicode data: "${e}".`), null;
      throw e;
    }
    return null;
  }
  readCidToGidMap(t, e) {
    const i = [];
    for (let n = 0, a = t.length; n < a; n++) {
      const r = t[n++] << 8 | t[n], o = n >> 1;
      (r !== 0 || e.has(o)) && (i[o] = r);
    }
    return i;
  }
  extractWidths(t, e, i) {
    const n = this.xref;
    let a = [], r = 0;
    const o = [];
    let l;
    if (i.composite) {
      const u = t.get("DW");
      r = typeof u == "number" ? Math.ceil(u) : 1e3;
      const f = t.get("W");
      if (Array.isArray(f)) for (let d = 0, p = f.length; d < p; d++) {
        let m = n.fetchIfRef(f[d++]);
        if (!Number.isInteger(m)) break;
        const b = n.fetchIfRef(f[d]);
        if (Array.isArray(b)) for (const y of b) {
          const v = n.fetchIfRef(y);
          typeof v == "number" && (a[m] = v), m++;
        }
        else {
          if (!Number.isInteger(b)) break;
          {
            const y = n.fetchIfRef(f[++d]);
            if (typeof y != "number") continue;
            for (let v = m; v <= b; v++) a[v] = y;
          }
        }
      }
      if (i.vertical) {
        const d = t.getArray("DW2");
        let p = ci(d, 2) ? d : [880, -1e3];
        if (l = [p[1], 0.5 * r, p[0]], p = t.get("W2"), Array.isArray(p)) for (let m = 0, b = p.length; m < b; m++) {
          let y = n.fetchIfRef(p[m++]);
          if (!Number.isInteger(y)) break;
          const v = n.fetchIfRef(p[m]);
          if (Array.isArray(v)) for (let w = 0, A = v.length; w < A; w++) {
            const x = [n.fetchIfRef(v[w++]), n.fetchIfRef(v[w++]), n.fetchIfRef(v[w])];
            ci(x, null) && (o[y] = x), y++;
          }
          else {
            if (!Number.isInteger(v)) break;
            {
              const w = [n.fetchIfRef(p[++m]), n.fetchIfRef(p[++m]), n.fetchIfRef(p[++m])];
              if (!ci(w, null)) continue;
              for (let A = y; A <= v; A++) o[A] = w;
            }
          }
        }
      }
    } else {
      const u = t.get("Widths");
      if (Array.isArray(u)) {
        let f = i.firstChar;
        for (const p of u) {
          const m = n.fetchIfRef(p);
          typeof m == "number" && (a[f] = m), f++;
        }
        const d = e.get("MissingWidth");
        r = typeof d == "number" ? d : 0;
      } else {
        const f = t.get("BaseFont");
        if (f instanceof Z) {
          const d = this.getBaseFontMetrics(f.name);
          a = this.buildCharCodeToWidth(d.widths, i), r = d.defaultWidth;
        }
      }
    }
    let c = !0, h = r;
    for (const u in a) {
      const f = a[u];
      if (f) if (h) {
        if (h !== f) {
          c = !1;
          break;
        }
      } else h = f;
    }
    c ? i.flags |= Jg : i.flags &= ~Jg, i.defaultWidth = r, i.widths = a, i.defaultVMetrics = l, i.vmetrics = o;
  }
  isSerifFont(t) {
    const e = t.split("-", 1)[0];
    return e in x7() || /serif/gi.test(e);
  }
  getBaseFontMetrics(t) {
    let e = 0, i = /* @__PURE__ */ Object.create(null), n = !1, a = J9()[t] || t;
    const r = nT();
    a in r || (a = this.isSerifFont(t) ? "Times-Roman" : "Helvetica");
    const o = r[a];
    return typeof o == "number" ? (e = o, n = !0) : i = o(), { defaultWidth: e, monospace: n, widths: i };
  }
  buildCharCodeToWidth(t, e) {
    const i = /* @__PURE__ */ Object.create(null), n = e.differences, a = e.defaultEncoding;
    for (let r = 0; r < 256; r++) r in n && t[n[r]] ? i[r] = t[n[r]] : r in a && t[a[r]] && (i[r] = t[a[r]]);
    return i;
  }
  preEvaluateFont(t) {
    const e = t;
    let i = t.get("Subtype");
    if (!(i instanceof Z)) throw new st("invalid font Subtype");
    let n, a = !1;
    if (i.name === "Type0") {
      const h = t.get("DescendantFonts");
      if (!h) throw new st("Descendant fonts are not specified");
      if (!((t = Array.isArray(h) ? this.xref.fetchIfRef(h[0]) : h) instanceof q)) throw new st("Descendant font is not a dictionary.");
      if (i = t.get("Subtype"), !(i instanceof Z)) throw new st("invalid font Subtype");
      a = !0;
    }
    let r = t.get("FirstChar");
    Number.isInteger(r) || (r = 0);
    let o = t.get("LastChar");
    Number.isInteger(o) || (o = a ? 65535 : 255);
    const l = t.get("FontDescriptor"), c = t.get("ToUnicode") || e.get("ToUnicode");
    if (l) {
      n = new IE();
      const h = e.getRaw("Encoding");
      if (h instanceof Z) n.update(h.name);
      else if (h instanceof yt) n.update(h.toString());
      else if (h instanceof q) {
        for (const f of h.getRawValues()) if (f instanceof Z) n.update(f.name);
        else if (f instanceof yt) n.update(f.toString());
        else if (Array.isArray(f)) {
          const d = f.length, p = new Array(d);
          for (let m = 0; m < d; m++) {
            const b = f[m];
            b instanceof Z ? p[m] = b.name : (typeof b == "number" || b instanceof yt) && (p[m] = b.toString());
          }
          n.update(p.join());
        }
      }
      if (n.update(`${r}-${o}`), c instanceof Ot) {
        const f = c.str || c, d = f.buffer ? new Uint8Array(f.buffer.buffer, 0, f.bufferLength) : new Uint8Array(f.bytes.buffer, f.start, f.end - f.start);
        n.update(d);
      } else c instanceof Z && n.update(c.name);
      const u = t.get("Widths") || e.get("Widths");
      if (Array.isArray(u)) {
        const f = [];
        for (const d of u) (typeof d == "number" || d instanceof yt) && f.push(d.toString());
        n.update(f.join());
      }
      if (a) {
        n.update("compositeFont");
        const f = t.get("W") || e.get("W");
        if (Array.isArray(f)) {
          const p = [];
          for (const m of f) if (typeof m == "number" || m instanceof yt) p.push(m.toString());
          else if (Array.isArray(m)) {
            const b = [];
            for (const y of m) (typeof y == "number" || y instanceof yt) && b.push(y.toString());
            p.push(`[${b.join()}]`);
          }
          n.update(p.join());
        }
        const d = t.getRaw("CIDToGIDMap") || e.getRaw("CIDToGIDMap");
        d instanceof Z ? n.update(d.name) : d instanceof yt ? n.update(d.toString()) : d instanceof Ot && n.update(d.peekBytes());
      }
    }
    return { descriptor: l, dict: t, baseDict: e, composite: a, type: i.name, firstChar: r, lastChar: o, toUnicode: c, hash: n ? n.hexdigest() : "" };
  }
  async translateFont({ descriptor: t, dict: e, baseDict: i, composite: n, type: a, firstChar: r, lastChar: o, toUnicode: l, cssFontInfo: c }) {
    const h = a === "Type3";
    if (!t) {
      if (!h) {
        let P = e.get("BaseFont");
        if (!(P instanceof Z)) throw new st("Base font is not specified");
        P = P.name.replaceAll(/[,_]/g, "-");
        const G = this.getBaseFontMetrics(P), N = P.split("-", 1)[0], j = (this.isSerifFont(N) ? _A : 0) | (G.monospace ? Jg : 0) | (o6()[N] ? Lp : g4), V = { type: a, name: P, loadedName: i.loadedName, systemFontInfo: null, widths: G.widths, defaultWidth: G.defaultWidth, isSimulatedFlags: !0, flags: j, firstChar: r, lastChar: o, toUnicode: l, xHeight: 0, capHeight: 0, italicAngle: 0, isType3Font: h }, X = e.get("Widths"), z = y4(P);
        let K = null;
        z && (K = await this.fetchStandardFontData(z), V.isInternalFont = !!K), !V.isInternalFont && this.options.useSystemFonts && (V.systemFontInfo = W4(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, P, z, a));
        const W = await this.extractDataStructures(e, V);
        if (Array.isArray(X)) {
          const rt = [];
          let $ = r;
          for (const nt of X) {
            const wt = this.xref.fetchIfRef(nt);
            typeof wt == "number" && (rt[$] = wt), $++;
          }
          W.widths = rt;
        } else W.widths = this.buildCharCodeToWidth(G.widths, W);
        return new D4(P, K, W, this.options);
      }
      t = q.empty;
    }
    let u = t.get("FontName"), f = e.get("BaseFont");
    typeof u == "string" && (u = Z.get(u)), typeof f == "string" && (f = Z.get(f));
    const d = u == null ? void 0 : u.name, p = f == null ? void 0 : f.name;
    if (h ? d || (u = Z.get(a)) : d !== p && (qt(`The FontDescriptor's FontName is "${d}" but should be the same as the Font's BaseFont "${p}".`), d && p && (p.startsWith(d) || !w4(d) && w4(p)) && (u = null), u || (u = f)), !(u instanceof Z)) throw new st("invalid font name");
    let m, b, y, v, w;
    try {
      if (m = t.get("FontFile", "FontFile2", "FontFile3"), m) {
        if (!(m instanceof Ot)) throw new st("FontFile should be a stream");
        if (m.isEmpty) throw new st("FontFile is empty");
      }
    } catch (P) {
      if (!this.options.ignoreErrors) throw P;
      D(`translateFont - fetching "${u.name}" font file: "${P}".`), m = null;
    }
    let A = !1, x = null, k = null;
    if (m) {
      if (m.dict) {
        const P = m.dict.get("Subtype");
        P instanceof Z && (b = P.name), y = m.dict.get("Length1"), v = m.dict.get("Length2"), w = m.dict.get("Length3");
      }
    } else if (c) {
      const P = I7(u.name);
      P && (c.fontFamily = `${c.fontFamily}-PdfJS-XFA`, c.metrics = P.metrics || null, x = P.factors || null, m = await this.fetchStandardFontData(P.name), A = !!m, i = e = jA(u.name), n = !0);
    } else if (!h) {
      const P = y4(u.name);
      P && (m = await this.fetchStandardFontData(P), A = !!m), !A && this.options.useSystemFonts && (k = W4(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, u.name, P, a));
    }
    const I = Qo(e.getArray("FontMatrix"), Qc), T = Kr(t.getArray("FontBBox") || e.getArray("FontBBox"), h ? [0, 0, 0, 0] : void 0);
    let E = t.get("Ascent");
    typeof E != "number" && (E = void 0);
    let M = t.get("Descent");
    typeof M != "number" && (M = void 0);
    let F = t.get("XHeight");
    typeof F != "number" && (F = 0);
    let L = t.get("CapHeight");
    typeof L != "number" && (L = 0);
    let Y = t.get("Flags");
    Number.isInteger(Y) || (Y = 0);
    let B = t.get("ItalicAngle");
    typeof B != "number" && (B = 0);
    const et = { type: a, name: u.name, subtype: b, file: m, length1: y, length2: v, length3: w, isInternalFont: A, loadedName: i.loadedName, composite: n, fixedPitch: !1, fontMatrix: I, firstChar: r, lastChar: o, toUnicode: l, bbox: T, ascent: E, descent: M, xHeight: F, capHeight: L, flags: Y, italicAngle: B, isType3Font: h, cssFontInfo: c, scaleFactors: x, systemFontInfo: k };
    if (n) {
      const P = i.get("Encoding");
      P instanceof Z && (et.cidEncoding = P.name);
      const G = await Q2.create({ encoding: P, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null });
      et.cMap = G, et.vertical = et.cMap.vertical;
    }
    const H = await this.extractDataStructures(e, et);
    return this.extractWidths(e, t, H), new D4(u.name, m, H, this.options);
  }
  static buildFontPaths(t, e, i, n) {
    function a(r) {
      const o = `${t.loadedName}_path_${r}`;
      try {
        if (t.renderer.hasBuiltPath(r)) return;
        i.send("commonobj", [o, "FontPath", t.renderer.getPathJs(r)]);
      } catch (l) {
        if (n.ignoreErrors) {
          D(`buildFontPaths - ignoring ${o} glyph: "${l}".`);
          return;
        }
        throw l;
      }
    }
    for (const r of e) {
      a(r.fontChar);
      const o = r.accent;
      o != null && o.fontChar && a(o.fontChar);
    }
  }
  static get fallbackFontDict() {
    const t = new q();
    return t.set("BaseFont", Z.get("Helvetica")), t.set("Type", Z.get("FallbackType")), t.set("Subtype", Z.get("FallbackType")), t.set("Encoding", Z.get("WinAnsiEncoding")), gt(this, "fallbackFontDict", t);
  }
}
var c2, Jc, O1, WA, XA;
class Om {
  constructor({ loadedName: t, font: e, dict: i }) {
    _(this, O1);
    _(this, c2, !1);
    _(this, Jc, null);
    this.loadedName = t, this.font = e, this.dict = i, this.type3Dependencies = e.isType3Font ? /* @__PURE__ */ new Set() : null;
  }
  send(t) {
    g(this, c2) || (S(this, c2, !0), t.send("commonobj", [this.loadedName, "Font", this.font.exportData()]));
  }
  fallback(t, e) {
    this.font.data && (this.font.disableFontFace = !0, F1.buildFontPaths(this.font, this.font.glyphCacheValues, t, e));
  }
  loadType3Data(t, e, i) {
    if (g(this, Jc)) return g(this, Jc);
    const { font: n, type3Dependencies: a } = this;
    As(n.isType3Font, "Must be a Type3 font.");
    const r = t.clone({ ignoreErrors: !1 }), o = new Qe(t.type3FontRefs);
    this.dict.objId && !o.has(this.dict.objId) && o.put(this.dict.objId), r.type3FontRefs = o;
    let l = Promise.resolve();
    const c = this.dict.get("CharProcs"), h = this.dict.get("Resources") || e, u = /* @__PURE__ */ Object.create(null), [f, d, p, m] = n.bbox, b = p - f, y = m - d, v = Math.hypot(b, y);
    for (const w of c.getKeys()) l = l.then(() => {
      const A = c.get(w), x = new Ys();
      return r.getOperatorList({ stream: A, task: i, resources: h, operatorList: x }).then(() => {
        switch (x.fnArray[0]) {
          case D3:
            C(this, O1, WA).call(this, x, v);
            break;
          case qv:
            v || C(this, O1, XA).call(this, x);
        }
        u[w] = x.getIR();
        for (const k of x.dependencies) a.add(k);
      }).catch(function(k) {
        D(`Type3 font resource "${w}" is not available.`);
        const I = new Ys();
        u[w] = I.getIR();
      });
    });
    return S(this, Jc, l.then(() => {
      n.charProcOperatorList = u, this._bbox && (n.isCharBBox = !0, n.bbox = this._bbox);
    })), g(this, Jc);
  }
}
c2 = new WeakMap(), Jc = new WeakMap(), O1 = new WeakSet(), WA = function(t, e = NaN) {
  const i = se.normalizeRect(t.argsArray[0].slice(2)), n = i[2] - i[0], a = i[3] - i[1], r = Math.hypot(n, a);
  n === 0 || a === 0 ? (t.fnArray.splice(0, 1), t.argsArray.splice(0, 1)) : (e === 0 || Math.round(r / e) >= 10) && (this._bbox ?? (this._bbox = [1 / 0, 1 / 0, -1 / 0, -1 / 0]), se.rectBoundingBox(...i, this._bbox));
  let o = 0, l = t.length;
  for (; o < l; ) {
    switch (t.fnArray[o]) {
      case D3:
        break;
      case h7:
      case V9:
      case u7:
      case Tp:
      case W9:
      case Ep:
      case d7:
      case x2:
      case no:
      case Da:
      case f7:
      case k2:
      case Mp:
      case Rv:
        t.fnArray.splice(o, 1), t.argsArray.splice(o, 1), l--;
        continue;
      case Hl:
        const [c] = t.argsArray[o];
        let h = 0, u = c.length;
        for (; h < u; ) {
          const [f] = c[h];
          switch (f) {
            case "TR":
            case "TR2":
            case "HT":
            case "BG":
            case "BG2":
            case "UCR":
            case "UCR2":
              c.splice(h, 1), u--;
              continue;
          }
          h++;
        }
    }
    o++;
  }
}, XA = function(t) {
  let e = 1;
  const i = t.length;
  for (; e < i; ) {
    if (t.fnArray[e] === eh) {
      const n = t.argsArray[e][2];
      this._bbox ?? (this._bbox = [1 / 0, 1 / 0, -1 / 0, -1 / 0]), se.rectBoundingBox(...n, this._bbox);
    }
    e++;
  }
};
class ep {
  constructor(t = new KA()) {
    this.state = t, this.stateStack = [];
  }
  save() {
    const t = this.state;
    this.stateStack.push(this.state), this.state = t.clone();
  }
  restore() {
    const t = this.stateStack.pop();
    t && (this.state = t);
  }
  transform(t) {
    this.state.ctm = se.transform(this.state.ctm, t);
  }
}
class ME {
  constructor() {
    this.ctm = new Float32Array(ia), this.fontName = null, this.fontSize = 0, this.loadedName = null, this.font = null, this.fontMatrix = Qc, this.textMatrix = ia.slice(), this.textLineMatrix = ia.slice(), this.charSpacing = 0, this.wordSpacing = 0, this.leading = 0, this.textHScale = 1, this.textRise = 0;
  }
  setTextMatrix(t, e, i, n, a, r) {
    const o = this.textMatrix;
    o[0] = t, o[1] = e, o[2] = i, o[3] = n, o[4] = a, o[5] = r;
  }
  setTextLineMatrix(t, e, i, n, a, r) {
    const o = this.textLineMatrix;
    o[0] = t, o[1] = e, o[2] = i, o[3] = n, o[4] = a, o[5] = r;
  }
  translateTextMatrix(t, e) {
    const i = this.textMatrix;
    i[4] = i[0] * t + i[2] * e + i[4], i[5] = i[1] * t + i[3] * e + i[5];
  }
  translateTextLineMatrix(t, e) {
    const i = this.textLineMatrix;
    i[4] = i[0] * t + i[2] * e + i[4], i[5] = i[1] * t + i[3] * e + i[5];
  }
  carriageReturn() {
    this.translateTextLineMatrix(0, -this.leading), this.textMatrix = this.textLineMatrix.slice();
  }
  clone() {
    const t = Object.create(this);
    return t.textMatrix = this.textMatrix.slice(), t.textLineMatrix = this.textLineMatrix.slice(), t.fontMatrix = this.fontMatrix.slice(), t;
  }
}
class KA {
  constructor() {
    this.ctm = new Float32Array(ia), this.font = null, this.textRenderingMode = mC, this._fillColorSpace = this._strokeColorSpace = te.gray, this.patternFillColorSpace = null, this.patternStrokeColorSpace = null, this.currentPointX = this.currentPointY = 0, this.pathMinMax = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]), this.pathBuffer = [];
  }
  get fillColorSpace() {
    return this._fillColorSpace;
  }
  set fillColorSpace(t) {
    this._fillColorSpace = this.patternFillColorSpace = t;
  }
  get strokeColorSpace() {
    return this._strokeColorSpace;
  }
  set strokeColorSpace(t) {
    this._strokeColorSpace = this.patternStrokeColorSpace = t;
  }
  clone({ newPath: t = !1 } = {}) {
    const e = Object.create(this);
    return t && (e.pathBuffer = [], e.pathMinMax = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0])), e;
  }
}
const Qh = class Qh {
  static get opMap() {
    return gt(this, "opMap", Object.assign(/* @__PURE__ */ Object.create(null), { w: { id: Fv, numArgs: 1, variableArgs: !1 }, J: { id: nI, numArgs: 1, variableArgs: !1 }, j: { id: aI, numArgs: 1, variableArgs: !1 }, M: { id: rI, numArgs: 1, variableArgs: !1 }, d: { id: oI, numArgs: 2, variableArgs: !1 }, ri: { id: Rv, numArgs: 1, variableArgs: !1 }, i: { id: lI, numArgs: 1, variableArgs: !1 }, gs: { id: Hl, numArgs: 1, variableArgs: !1 }, q: { id: aa, numArgs: 0, variableArgs: !1 }, Q: { id: Ci, numArgs: 0, variableArgs: !1 }, cm: { id: Wr, numArgs: 6, variableArgs: !1 }, m: { id: wp, numArgs: 2, variableArgs: !1 }, l: { id: S3, numArgs: 2, variableArgs: !1 }, c: { id: C3, numArgs: 6, variableArgs: !1 }, v: { id: I3, numArgs: 4, variableArgs: !1 }, y: { id: _3, numArgs: 4, variableArgs: !1 }, h: { id: T3, numArgs: 0, variableArgs: !1 }, re: { id: E3, numArgs: 4, variableArgs: !1 }, S: { id: o7, numArgs: 0, variableArgs: !1 }, s: { id: vp, numArgs: 0, variableArgs: !1 }, f: { id: M3, numArgs: 0, variableArgs: !1 }, F: { id: M3, numArgs: 0, variableArgs: !1 }, "f*": { id: Pv, numArgs: 0, variableArgs: !1 }, B: { id: l7, numArgs: 0, variableArgs: !1 }, "B*": { id: c7, numArgs: 0, variableArgs: !1 }, b: { id: Ap, numArgs: 0, variableArgs: !1 }, "b*": { id: xp, numArgs: 0, variableArgs: !1 }, n: { id: F3, numArgs: 0, variableArgs: !1 }, W: { id: cI, numArgs: 0, variableArgs: !1 }, "W*": { id: hI, numArgs: 0, variableArgs: !1 }, BT: { id: kp, numArgs: 0, variableArgs: !1 }, ET: { id: Sp, numArgs: 0, variableArgs: !1 }, Tc: { id: R3, numArgs: 1, variableArgs: !1 }, Tw: { id: P3, numArgs: 1, variableArgs: !1 }, Tz: { id: Dv, numArgs: 1, variableArgs: !1 }, TL: { id: Nv, numArgs: 1, variableArgs: !1 }, Tf: { id: il, numArgs: 2, variableArgs: !1 }, Tr: { id: Bv, numArgs: 1, variableArgs: !1 }, Ts: { id: Lv, numArgs: 1, variableArgs: !1 }, Td: { id: Ov, numArgs: 2, variableArgs: !1 }, TD: { id: Uv, numArgs: 2, variableArgs: !1 }, Tm: { id: lh, numArgs: 6, variableArgs: !1 }, "T*": { id: Ug, numArgs: 0, variableArgs: !1 }, Tj: { id: Dr, numArgs: 1, variableArgs: !1 }, TJ: { id: Cp, numArgs: 1, variableArgs: !1 }, "'": { id: Ip, numArgs: 1, variableArgs: !1 }, '"': { id: _p, numArgs: 3, variableArgs: !1 }, d0: { id: qv, numArgs: 2, variableArgs: !1 }, d1: { id: D3, numArgs: 6, variableArgs: !1 }, CS: { id: h7, numArgs: 1, variableArgs: !1 }, cs: { id: V9, numArgs: 1, variableArgs: !1 }, SC: { id: u7, numArgs: 4, variableArgs: !0 }, SCN: { id: Tp, numArgs: 33, variableArgs: !0 }, sc: { id: W9, numArgs: 4, variableArgs: !0 }, scn: { id: Ep, numArgs: 33, variableArgs: !0 }, G: { id: d7, numArgs: 1, variableArgs: !1 }, g: { id: x2, numArgs: 1, variableArgs: !1 }, RG: { id: no, numArgs: 3, variableArgs: !1 }, rg: { id: Da, numArgs: 3, variableArgs: !1 }, K: { id: f7, numArgs: 4, variableArgs: !1 }, k: { id: k2, numArgs: 4, variableArgs: !1 }, sh: { id: Mp, numArgs: 1, variableArgs: !1 }, BI: { id: uI, numArgs: 0, variableArgs: !1 }, ID: { id: dI, numArgs: 0, variableArgs: !1 }, EI: { id: jv, numArgs: 1, variableArgs: !1 }, Do: { id: N3, numArgs: 1, variableArgs: !1 }, MP: { id: Hv, numArgs: 1, variableArgs: !1 }, DP: { id: $v, numArgs: 2, variableArgs: !1 }, BMC: { id: zv, numArgs: 1, variableArgs: !1 }, BDC: { id: Na, numArgs: 2, variableArgs: !1 }, EMC: { id: I1, numArgs: 0, variableArgs: !1 }, BX: { id: Gv, numArgs: 0, variableArgs: !1 }, EX: { id: Vv, numArgs: 0, variableArgs: !1 }, BM: null, BD: null, true: null, fa: null, fal: null, fals: null, false: null, nu: null, nul: null, null: null }));
  }
  constructor(t, e, i = new ep()) {
    this.parser = new ao({ lexer: new Zn(t, Qh.opMap), xref: e }), this.stateManager = i, this.nonProcessedArgs = [], this._isPathOp = !1, this._numInvalidPathOPS = 0;
  }
  get savedStatesDepth() {
    return this.stateManager.stateStack.length;
  }
  read(t) {
    let e = t.args;
    for (; ; ) {
      const i = this.parser.getObj();
      if (i instanceof Je) {
        const n = i.cmd, a = Qh.opMap[n];
        if (!a) {
          D(`Unknown command "${n}".`);
          continue;
        }
        const r = a.id, o = a.numArgs;
        let l = e !== null ? e.length : 0;
        if (this._isPathOp || (this._numInvalidPathOPS = 0), this._isPathOp = r >= wp && r <= F3, a.variableArgs) l > o && qt(`Command ${n}: expected [0, ${o}] args, but received ${l} args.`);
        else {
          if (l !== o) {
            const c = this.nonProcessedArgs;
            for (; l > o; )
              c.push(e.shift()), l--;
            for (; l < o && c.length !== 0; )
              e === null && (e = []), e.unshift(c.pop()), l++;
          }
          if (l < o) {
            const c = `command ${n}: expected ${o} args, but received ${l} args.`;
            if (this._isPathOp && ++this._numInvalidPathOPS > Qh.MAX_INVALID_PATH_OPS) throw new st(`Invalid ${c}`);
            D(`Skipping ${c}`), e !== null && (e.length = 0);
            continue;
          }
        }
        return this.preprocessCommand(r, e), t.fn = r, t.args = e, !0;
      }
      if (i === vs) return !1;
      if (i !== null && (e === null && (e = []), e.push(i), e.length > 33))
        throw new st("Too many arguments");
    }
  }
  preprocessCommand(t, e) {
    switch (0 | t) {
      case aa:
        this.stateManager.save();
        break;
      case Ci:
        this.stateManager.restore();
        break;
      case Wr:
        this.stateManager.transform(e);
    }
  }
};
ht(Qh, "MAX_INVALID_PATH_OPS", 10);
let R1 = Qh;
class FE extends R1 {
  constructor(t) {
    super(new di(t));
  }
  parse() {
    const t = { fn: 0, args: [] }, e = { fontSize: 0, fontName: "", fontColor: new Uint8ClampedArray(3) };
    try {
      for (; t.args.length = 0, !!this.read(t); ) {
        if (this.savedStatesDepth !== 0) continue;
        const { fn: i, args: n } = t;
        switch (0 | i) {
          case il:
            const [a, r] = n;
            a instanceof Z && (e.fontName = a.name), typeof r == "number" && r > 0 && (e.fontSize = r);
            break;
          case Da:
            te.rgb.getRgbItem(n, 0, e.fontColor, 0);
            break;
          case x2:
            te.gray.getRgbItem(n, 0, e.fontColor, 0);
            break;
          case k2:
            te.cmyk.getRgbItem(n, 0, e.fontColor, 0);
        }
      }
    } catch (i) {
      D(`parseDefaultAppearance - ignoring errors: "${i}".`);
    }
    return e;
  }
}
function T7(s) {
  return new FE(s).parse();
}
class RE extends R1 {
  constructor(t, e, i, n) {
    var a;
    super(t), this.stream = t, this.evaluatorOptions = e, this.xref = i, this.globalColorSpaceCache = n, this.resources = (a = t.dict) == null ? void 0 : a.get("Resources");
  }
  parse() {
    const t = { fn: 0, args: [] };
    let e = { scaleFactor: 1, fontSize: 0, fontName: "", fontColor: new Uint8ClampedArray(3), fillColorSpace: te.gray }, i = !1;
    const n = [];
    try {
      for (; t.args.length = 0, !(i || !this.read(t)); ) {
        const { fn: a, args: r } = t;
        switch (0 | a) {
          case aa:
            n.push({ scaleFactor: e.scaleFactor, fontSize: e.fontSize, fontName: e.fontName, fontColor: e.fontColor.slice(), fillColorSpace: e.fillColorSpace });
            break;
          case Ci:
            e = n.pop() || e;
            break;
          case lh:
            e.scaleFactor *= Math.hypot(r[0], r[1]);
            break;
          case il:
            const [o, l] = r;
            o instanceof Z && (e.fontName = o.name), typeof l == "number" && l > 0 && (e.fontSize = l * e.scaleFactor);
            break;
          case V9:
            e.fillColorSpace = te.parse({ cs: r[0], xref: this.xref, resources: this.resources, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: this._localColorSpaceCache });
            break;
          case W9:
            e.fillColorSpace.getRgbItem(r, 0, e.fontColor, 0);
            break;
          case Da:
            te.rgb.getRgbItem(r, 0, e.fontColor, 0);
            break;
          case x2:
            te.gray.getRgbItem(r, 0, e.fontColor, 0);
            break;
          case k2:
            te.cmyk.getRgbItem(r, 0, e.fontColor, 0);
            break;
          case Dr:
          case Cp:
          case Ip:
          case _p:
            i = !0;
        }
      }
    } catch (a) {
      D(`parseAppearanceStream - ignoring errors: "${a}".`);
    }
    return this.stream.reset(), delete e.scaleFactor, delete e.fillColorSpace, e;
  }
  get _localColorSpaceCache() {
    return gt(this, "_localColorSpaceCache", new HA());
  }
  get _pdfFunctionFactory() {
    return gt(this, "_pdfFunctionFactory", new zA({ xref: this.xref, isEvalSupported: this.evaluatorOptions.isEvalSupported }));
  }
}
function Ua(s, t) {
  return s[0] === s[1] && s[1] === s[2] ? `${Vt(s[0] / 255)} ${t ? "g" : "G"}` : Array.from(s, (e) => Vt(e / 255)).join(" ") + " " + (t ? "rg" : "RG");
}
class Ba {
  constructor(t, e) {
    this.xref = t, this.widths = null, this.firstChar = 1 / 0, this.lastChar = -1 / 0, this.fontFamily = e;
    const i = new OffscreenCanvas(1, 1);
    this.ctxMeasure = i.getContext("2d", { willReadFrequently: !0 }), Ba._fontNameId || (Ba._fontNameId = 1), this.fontName = Z.get(`InvalidPDFjsFont_${e}_${Ba._fontNameId++}`);
  }
  get fontDescriptorRef() {
    if (!Ba._fontDescriptorRef) {
      const t = new q(this.xref);
      t.set("Type", Z.get("FontDescriptor")), t.set("FontName", this.fontName), t.set("FontFamily", "MyriadPro Regular"), t.set("FontBBox", [0, 0, 0, 0]), t.set("FontStretch", Z.get("Normal")), t.set("FontWeight", 400), t.set("ItalicAngle", 0), Ba._fontDescriptorRef = this.xref.getNewPersistentRef(t);
    }
    return Ba._fontDescriptorRef;
  }
  get descendantFontRef() {
    const t = new q(this.xref);
    t.set("BaseFont", this.fontName), t.set("Type", Z.get("Font")), t.set("Subtype", Z.get("CIDFontType0")), t.set("CIDToGIDMap", Z.get("Identity")), t.set("FirstChar", this.firstChar), t.set("LastChar", this.lastChar), t.set("FontDescriptor", this.fontDescriptorRef), t.set("DW", 1e3);
    const e = [], i = [...this.widths.entries()].sort();
    let n = null, a = null;
    for (const [o, l] of i) n ? o === n + a.length ? a.push(l) : (e.push(n, a), n = o, a = [l]) : (n = o, a = [l]);
    n && e.push(n, a), t.set("W", e);
    const r = new q(this.xref);
    return r.set("Ordering", "Identity"), r.set("Registry", "Adobe"), r.set("Supplement", 0), t.set("CIDSystemInfo", r), this.xref.getNewPersistentRef(t);
  }
  get baseFontRef() {
    const t = new q(this.xref);
    return t.set("BaseFont", this.fontName), t.set("Type", Z.get("Font")), t.set("Subtype", Z.get("Type0")), t.set("Encoding", Z.get("Identity-H")), t.set("DescendantFonts", [this.descendantFontRef]), t.set("ToUnicode", Z.get("Identity-H")), this.xref.getNewPersistentRef(t);
  }
  get resources() {
    const t = new q(this.xref), e = new q(this.xref);
    return e.set(this.fontName.name, this.baseFontRef), t.set("Font", e), t;
  }
  _createContext() {
    return this.widths = /* @__PURE__ */ new Map(), this.ctxMeasure.font = `1000px ${this.fontFamily}`, this.ctxMeasure;
  }
  createFontResources(t) {
    const e = this._createContext();
    for (const i of t.split(/\r\n?|\n/)) for (const n of i.split("")) {
      const a = n.charCodeAt(0);
      if (this.widths.has(a)) continue;
      const r = e.measureText(n), o = Math.ceil(r.width);
      this.widths.set(a, o), this.firstChar = Math.min(a, this.firstChar), this.lastChar = Math.max(a, this.lastChar);
    }
    return this.resources;
  }
  static getFirstPositionInfo(t, e, i) {
    const [n, a, r, o] = t;
    let l = r - n, c = o - a;
    e % 180 != 0 && ([l, c] = [c, l]);
    const h = th * i;
    return { coords: [0, c + D8 * i - h], bbox: [0, 0, l, c], matrix: e !== 0 ? Np(e, c, h) : void 0 };
  }
  createAppearance(t, e, i, n, a, r) {
    const o = this._createContext(), l = [];
    let c = -1 / 0;
    for (const L of t.split(/\r\n?|\n/)) {
      l.push(L);
      const Y = o.measureText(L).width;
      c = Math.max(c, Y);
      for (const B of MI(L)) {
        const et = String.fromCodePoint(B);
        let H = this.widths.get(B);
        if (H === void 0) {
          const P = o.measureText(et);
          H = Math.ceil(P.width), this.widths.set(B, H), this.firstChar = Math.min(B, this.firstChar), this.lastChar = Math.max(B, this.lastChar);
        }
      }
    }
    c *= n / 1e3;
    const [h, u, f, d] = e;
    let p = f - h, m = d - u;
    i % 180 != 0 && ([p, m] = [m, p]);
    let b = 1;
    c > p && (b = p / c);
    let y = 1;
    const v = th * n, w = D8 * n, A = v * l.length;
    A > m && (y = m / A);
    const x = n * Math.min(b, y), k = ["q", `0 0 ${Vt(p)} ${Vt(m)} re W n`, "BT", `1 0 0 1 0 ${Vt(m + w)} Tm 0 Tc ${Ua(a, !0)}`, `/${this.fontName.name} ${Vt(x)} Tf`], { resources: I } = this;
    if ((r = typeof r == "number" && r >= 0 && r <= 1 ? r : 1) !== 1) {
      k.push("/R0 gs");
      const L = new q(this.xref), Y = new q(this.xref);
      Y.set("ca", r), Y.set("CA", r), Y.set("Type", Z.get("ExtGState")), L.set("R0", Y), I.set("ExtGState", L);
    }
    const T = Vt(v);
    for (const L of l) k.push(`0 -${T} Td <${RI(L)}> Tj`);
    k.push("ET", "Q");
    const E = k.join(`
`), M = new q(this.xref);
    if (M.set("Subtype", Z.get("Form")), M.set("Type", Z.get("XObject")), M.set("BBox", [0, 0, p, m]), M.set("Length", E.length), M.set("Resources", I), i) {
      const L = Np(i, p, m);
      M.set("Matrix", L);
    }
    const F = new di(E);
    return F.dict = M, F;
  }
}
class YA {
  constructor(t, e, i) {
    this.root = t, this.xref = e, this._type = i;
  }
  getAll() {
    const t = /* @__PURE__ */ new Map();
    if (!this.root) return t;
    const e = this.xref, i = new Qe();
    i.put(this.root);
    const n = [this.root];
    for (; n.length > 0; ) {
      const a = e.fetchIfRef(n.shift());
      if (!(a instanceof q)) continue;
      if (a.has("Kids")) {
        const o = a.get("Kids");
        if (!Array.isArray(o)) continue;
        for (const l of o) {
          if (i.has(l)) throw new st(`Duplicate entry in "${this._type}" tree.`);
          n.push(l), i.put(l);
        }
        continue;
      }
      const r = a.get(this._type);
      if (Array.isArray(r)) for (let o = 0, l = r.length; o < l; o += 2) t.set(e.fetchIfRef(r[o]), e.fetchIfRef(r[o + 1]));
    }
    return t;
  }
  getRaw(t) {
    if (!this.root) return null;
    const e = this.xref;
    let i = e.fetchIfRef(this.root), n = 0;
    for (; i.has("Kids"); ) {
      if (++n > 10)
        return D(`Search depth limit reached for "${this._type}" tree.`), null;
      const r = i.get("Kids");
      if (!Array.isArray(r)) return null;
      let o = 0, l = r.length - 1;
      for (; o <= l; ) {
        const c = o + l >> 1, h = e.fetchIfRef(r[c]), u = h.get("Limits");
        if (t < e.fetchIfRef(u[0])) l = c - 1;
        else {
          if (!(t > e.fetchIfRef(u[1]))) {
            i = h;
            break;
          }
          o = c + 1;
        }
      }
      if (o > l) return null;
    }
    const a = i.get(this._type);
    if (Array.isArray(a)) {
      let r = 0, o = a.length - 2;
      for (; r <= o; ) {
        const l = r + o >> 1, c = l + (1 & l), h = e.fetchIfRef(a[c]);
        if (t < h) o = c - 2;
        else {
          if (!(t > h)) return a[c + 1];
          r = c + 2;
        }
      }
    }
    return null;
  }
  get(t) {
    return this.xref.fetchIfRef(this.getRaw(t));
  }
}
class Ch extends YA {
  constructor(t, e) {
    super(t, e, "Names");
  }
}
class qp extends YA {
  constructor(t, e) {
    super(t, e, "Nums");
  }
}
function E7() {
  (function() {
    tp = /* @__PURE__ */ Object.create(null);
  })(), function() {
    Hg = /* @__PURE__ */ Object.create(null), $g = /* @__PURE__ */ Object.create(null), Bh = /* @__PURE__ */ Object.create(null);
  }(), function() {
    r6.clear();
  }(), Yn.cleanup();
}
function J4(s) {
  return s instanceof q ? s.has("UF") ? s.get("UF") : s.has("F") ? s.get("F") : s.has("Unix") ? s.get("Unix") : s.has("Mac") ? s.get("Mac") : s.has("DOS") ? s.get("DOS") : null : null;
}
var h2;
class b6 {
  constructor(t, e, i = !1) {
    _(this, h2, !1);
    t instanceof q && (this.xref = e, this.root = t, t.has("FS") && (this.fs = t.get("FS")), t.has("RF") && D("Related file specifications are not supported"), i || (t.has("EF") ? S(this, h2, !0) : D("Non-embedded file specifications are not supported")));
  }
  get filename() {
    let t = "";
    const e = J4(this.root);
    return e && typeof e == "string" && (t = Jt(e, !0).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/")), gt(this, "filename", t || "unnamed");
  }
  get content() {
    var e;
    if (!g(this, h2)) return null;
    this._contentRef || (this._contentRef = J4((e = this.root) == null ? void 0 : e.get("EF")));
    let t = null;
    if (this._contentRef) {
      const i = this.xref.fetchIfRef(this._contentRef);
      i instanceof Ot ? t = i.getBytes() : D("Embedded file specification points to non-existing/invalid content");
    } else D("Embedded file specification does not have any content");
    return t;
  }
  get description() {
    var i;
    let t = "";
    const e = (i = this.root) == null ? void 0 : i.get("Desc");
    return e && typeof e == "string" && (t = Jt(e)), gt(this, "description", t);
  }
  get serializable() {
    return { rawFilename: this.filename, filename: (t = this.filename, t.substring(t.lastIndexOf("/") + 1)), content: this.content, description: this.description };
    var t;
  }
}
h2 = new WeakMap();
const $d = 0, PE = -2, DE = -3, Z4 = -4, NE = -5, Q4 = -6, tb = -9;
function qh(s, t) {
  const e = s[t];
  return e === " " || e === `
` || e === "\r" || e === "	";
}
class JA {
  _resolveEntities(t) {
    return t.replaceAll(/&([^;]+);/g, (e, i) => {
      if (i.substring(0, 2) === "#x") return String.fromCodePoint(parseInt(i.substring(2), 16));
      if (i.substring(0, 1) === "#") return String.fromCodePoint(parseInt(i.substring(1), 10));
      switch (i) {
        case "lt":
          return "<";
        case "gt":
          return ">";
        case "amp":
          return "&";
        case "quot":
          return '"';
        case "apos":
          return "'";
      }
      return this.onResolveEntity(i);
    });
  }
  _parseContent(t, e) {
    const i = [];
    let n = e;
    function a() {
      for (; n < t.length && qh(t, n); ) ++n;
    }
    for (; n < t.length && !qh(t, n) && t[n] !== ">" && t[n] !== "/"; ) ++n;
    const r = t.substring(e, n);
    for (a(); n < t.length && t[n] !== ">" && t[n] !== "/" && t[n] !== "?"; ) {
      a();
      let o = "", l = "";
      for (; n < t.length && !qh(t, n) && t[n] !== "="; )
        o += t[n], ++n;
      if (a(), t[n] !== "=") return null;
      ++n, a();
      const c = t[n];
      if (c !== '"' && c !== "'") return null;
      const h = t.indexOf(c, ++n);
      if (h < 0) return null;
      l = t.substring(n, h), i.push({ name: o, value: this._resolveEntities(l) }), n = h + 1, a();
    }
    return { name: r, attributes: i, parsed: n - e };
  }
  _parseProcessingInstruction(t, e) {
    let i = e;
    for (; i < t.length && !qh(t, i) && t[i] !== ">" && t[i] !== "?" && t[i] !== "/"; ) ++i;
    const n = t.substring(e, i);
    (function() {
      for (; i < t.length && qh(t, i); ) ++i;
    })();
    const a = i;
    for (; i < t.length && (t[i] !== "?" || t[i + 1] !== ">"); ) ++i;
    return { name: n, value: t.substring(a, i), parsed: i - e };
  }
  parseXml(t) {
    let e = 0;
    for (; e < t.length; ) {
      let i = e;
      if (t[e] === "<") {
        ++i;
        let n;
        switch (t[i]) {
          case "/":
            if (++i, n = t.indexOf(">", i), n < 0) {
              this.onError(tb);
              return;
            }
            this.onEndElement(t.substring(i, n)), i = n + 1;
            break;
          case "?":
            ++i;
            const a = this._parseProcessingInstruction(t, i);
            if (t.substring(i + a.parsed, i + a.parsed + 2) !== "?>") {
              this.onError(DE);
              return;
            }
            this.onPi(a.name, a.value), i += a.parsed + 2;
            break;
          case "!":
            if (t.substring(i + 1, i + 3) === "--") {
              if (n = t.indexOf("-->", i + 3), n < 0) {
                this.onError(NE);
                return;
              }
              this.onComment(t.substring(i + 3, n)), i = n + 3;
            } else if (t.substring(i + 1, i + 8) === "[CDATA[") {
              if (n = t.indexOf("]]>", i + 8), n < 0) {
                this.onError(PE);
                return;
              }
              this.onCdata(t.substring(i + 8, n)), i = n + 3;
            } else {
              if (t.substring(i + 1, i + 8) !== "DOCTYPE") {
                this.onError(Q4);
                return;
              }
              {
                const l = t.indexOf("[", i + 8);
                let c = !1;
                if (n = t.indexOf(">", i + 8), n < 0) {
                  this.onError(Z4);
                  return;
                }
                if (l > 0 && n > l) {
                  if (n = t.indexOf("]>", i + 8), n < 0) {
                    this.onError(Z4);
                    return;
                  }
                  c = !0;
                }
                const h = t.substring(i + 8, n + (c ? 1 : 0));
                this.onDoctype(h), i = n + (c ? 2 : 1);
              }
            }
            break;
          default:
            const r = this._parseContent(t, i);
            if (r === null) {
              this.onError(Q4);
              return;
            }
            let o = !1;
            if (t.substring(i + r.parsed, i + r.parsed + 2) === "/>") o = !0;
            else if (t.substring(i + r.parsed, i + r.parsed + 1) !== ">") {
              this.onError(tb);
              return;
            }
            this.onBeginElement(r.name, r.attributes, o), i += r.parsed + (o ? 2 : 1);
        }
      } else {
        for (; i < t.length && t[i] !== "<"; ) i++;
        const n = t.substring(e, i);
        this.onText(this._resolveEntities(n));
      }
      e = i;
    }
  }
  onResolveEntity(t) {
    return `&${t};`;
  }
  onPi(t, e) {
  }
  onComment(t) {
  }
  onCdata(t) {
  }
  onDoctype(t) {
  }
  onText(t) {
  }
  onBeginElement(t, e, i) {
  }
  onEndElement(t) {
  }
  onError(t) {
  }
}
class zd {
  constructor(t, e) {
    this.nodeName = t, this.nodeValue = e, Object.defineProperty(this, "parentNode", { value: null, writable: !0 });
  }
  get firstChild() {
    var t;
    return (t = this.childNodes) == null ? void 0 : t[0];
  }
  get nextSibling() {
    const t = this.parentNode.childNodes;
    if (!t) return;
    const e = t.indexOf(this);
    return e !== -1 ? t[e + 1] : void 0;
  }
  get textContent() {
    return this.childNodes ? this.childNodes.map((t) => t.textContent).join("") : this.nodeValue || "";
  }
  get children() {
    return this.childNodes || [];
  }
  hasChildNodes() {
    var t;
    return ((t = this.childNodes) == null ? void 0 : t.length) > 0;
  }
  searchNode(t, e) {
    var r;
    if (e >= t.length) return this;
    const i = t[e];
    if (i.name.startsWith("#") && e < t.length - 1) return this.searchNode(t, e + 1);
    const n = [];
    let a = this;
    for (; ; ) {
      if (i.name === a.nodeName) {
        if (i.pos !== 0) {
          if (n.length === 0) return null;
          {
            const [o] = n.pop();
            let l = 0;
            for (const c of o.childNodes) if (i.name === c.nodeName) {
              if (l === i.pos) return c.searchNode(t, e + 1);
              l++;
            }
            return a.searchNode(t, e + 1);
          }
        }
        {
          const o = a.searchNode(t, e + 1);
          if (o !== null) return o;
        }
      }
      if (((r = a.childNodes) == null ? void 0 : r.length) > 0)
        n.push([a, 0]), a = a.childNodes[0];
      else {
        if (n.length === 0) return null;
        for (; n.length !== 0; ) {
          const [o, l] = n.pop(), c = l + 1;
          if (c < o.childNodes.length) {
            n.push([o, c]), a = o.childNodes[c];
            break;
          }
        }
        if (n.length === 0) return null;
      }
    }
  }
  dump(t) {
    if (this.nodeName !== "#text") {
      if (t.push(`<${this.nodeName}`), this.attributes) for (const e of this.attributes) t.push(` ${e.name}="${nu(e.value)}"`);
      if (this.hasChildNodes()) {
        t.push(">");
        for (const e of this.childNodes) e.dump(t);
        t.push(`</${this.nodeName}>`);
      } else this.nodeValue ? t.push(`>${nu(this.nodeValue)}</${this.nodeName}>`) : t.push("/>");
    } else t.push(nu(this.nodeValue));
  }
}
class Z9 extends JA {
  constructor({ hasAttributes: t = !1, lowerCaseName: e = !1 }) {
    super(), this._currentFragment = null, this._stack = null, this._errorCode = $d, this._hasAttributes = t, this._lowerCaseName = e;
  }
  parseFromString(t) {
    if (this._currentFragment = [], this._stack = [], this._errorCode = $d, this.parseXml(t), this._errorCode !== $d) return;
    const [e] = this._currentFragment;
    return e ? { documentElement: e } : void 0;
  }
  onText(t) {
    if (function(n) {
      for (let a = 0, r = n.length; a < r; a++) if (!qh(n, a)) return !1;
      return !0;
    }(t)) return;
    const e = new zd("#text", t);
    this._currentFragment.push(e);
  }
  onCdata(t) {
    const e = new zd("#text", t);
    this._currentFragment.push(e);
  }
  onBeginElement(t, e, i) {
    this._lowerCaseName && (t = t.toLowerCase());
    const n = new zd(t);
    n.childNodes = [], this._hasAttributes && (n.attributes = e), this._currentFragment.push(n), i || (this._stack.push(this._currentFragment), this._currentFragment = n.childNodes);
  }
  onEndElement(t) {
    this._currentFragment = this._stack.pop() || [];
    const e = this._currentFragment.at(-1);
    if (!e) return null;
    for (const i of e.childNodes) i.parentNode = e;
    return e;
  }
  onError(t) {
    this._errorCode = t;
  }
}
class BE {
  constructor(t) {
    t = this._repair(t);
    const e = new Z9({ lowerCaseName: !0 }).parseFromString(t);
    this._metadataMap = /* @__PURE__ */ new Map(), this._data = t, e && this._parse(e);
  }
  _repair(t) {
    return t.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function(e, i) {
      const n = i.replaceAll(/\\([0-3])([0-7])([0-7])/g, function(r, o, l, c) {
        return String.fromCharCode(64 * o + 8 * l + 1 * c);
      }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function(r, o) {
        switch (o) {
          case "amp":
            return "&";
          case "apos":
            return "'";
          case "gt":
            return ">";
          case "lt":
            return "<";
          case "quot":
            return '"';
        }
        throw new Error(`_repair: ${o} isn't defined.`);
      }), a = [">"];
      for (let r = 0, o = n.length; r < o; r += 2) {
        const l = 256 * n.charCodeAt(r) + n.charCodeAt(r + 1);
        l >= 32 && l < 127 && l !== 60 && l !== 62 && l !== 38 ? a.push(String.fromCharCode(l)) : a.push("&#x" + (65536 + l).toString(16).substring(1) + ";");
      }
      return a.join("");
    });
  }
  _getSequence(t) {
    const e = t.nodeName;
    return e !== "rdf:bag" && e !== "rdf:seq" && e !== "rdf:alt" ? null : t.childNodes.filter((i) => i.nodeName === "rdf:li");
  }
  _parseArray(t) {
    if (!t.hasChildNodes()) return;
    const [e] = t.childNodes, i = this._getSequence(e) || [];
    this._metadataMap.set(t.nodeName, i.map((n) => n.textContent.trim()));
  }
  _parse(t) {
    let e = t.documentElement;
    if (e.nodeName !== "rdf:rdf")
      for (e = e.firstChild; e && e.nodeName !== "rdf:rdf"; ) e = e.nextSibling;
    if (e && e.nodeName === "rdf:rdf" && e.hasChildNodes()) {
      for (const i of e.childNodes) if (i.nodeName === "rdf:description") for (const n of i.childNodes) {
        const a = n.nodeName;
        switch (a) {
          case "#text":
            continue;
          case "dc:creator":
          case "dc:subject":
            this._parseArray(n);
            continue;
        }
        this._metadataMap.set(a, n.textContent.trim());
      }
    }
  }
  get serializable() {
    return { parsedData: this._metadataMap, rawData: this._data };
  }
}
const ZA = 1, QA = 2, y6 = 3, tx = 4, w6 = 5;
var D9, ex, Fn, v6, A6, sx, ix;
const jl = class jl {
  constructor(t, e, i) {
    _(this, D9);
    this.xref = t, this.dict = e, this.ref = i instanceof yt ? i : null, this.roleMap = /* @__PURE__ */ new Map(), this.structParentIds = null;
  }
  init() {
    this.readRoleMap();
  }
  addAnnotationIdToPage(t, e) {
    C(this, D9, ex).call(this, t, e, tx);
  }
  readRoleMap() {
    const t = this.dict.get("RoleMap");
    if (t instanceof q) for (const [e, i] of t) i instanceof Z && this.roleMap.set(e, i.name);
  }
  static async canCreateStructureTree({ catalogRef: t, pdfManager: e, newAnnotationsByPage: i }) {
    var r;
    if (!(t instanceof yt))
      return D("Cannot save the struct tree: no catalog reference."), !1;
    let n = 0, a = !0;
    for (const [o, l] of i) {
      const { ref: c } = await e.getPage(o);
      if (!(c instanceof yt)) {
        D(`Cannot save the struct tree: page ${o} has no ref.`), a = !0;
        break;
      }
      for (const h of l) (r = h.accessibilityData) != null && r.type && (h.parentTreeId = n++, a = !1);
    }
    if (a) {
      for (const o of i.values()) for (const l of o) delete l.parentTreeId;
      return !1;
    }
    return !0;
  }
  static async createStructureTree({ newAnnotationsByPage: t, xref: e, catalogRef: i, pdfManager: n, changes: a }) {
    const r = await n.ensureCatalog("cloneDict"), o = new xi();
    o.put(i, r);
    const l = e.getNewTemporaryRef();
    r.set("StructTreeRoot", l);
    const c = new q(e);
    c.set("Type", Z.get("StructTreeRoot"));
    const h = e.getNewTemporaryRef();
    c.set("ParentTree", h);
    const u = [];
    c.set("K", u), o.put(l, c);
    const f = new q(e), d = [];
    f.set("Nums", d);
    const p = await C(this, Fn, v6).call(this, { newAnnotationsByPage: t, structTreeRootRef: l, structTreeRoot: null, kids: u, nums: d, xref: e, pdfManager: n, changes: a, cache: o });
    c.set("ParentTreeNextKey", p), o.put(h, f);
    for (const [m, b] of o.items()) a.put(m, { data: b });
  }
  async canUpdateStructTree({ pdfManager: t, newAnnotationsByPage: e }) {
    var l, c;
    if (!this.ref)
      return D("Cannot update the struct tree: no root reference."), !1;
    let i = this.dict.get("ParentTreeNextKey");
    if (!Number.isInteger(i) || i < 0)
      return D("Cannot update the struct tree: invalid next key."), !1;
    const n = this.dict.get("ParentTree");
    if (!(n instanceof q))
      return D("Cannot update the struct tree: ParentTree isn't a dict."), !1;
    const a = n.get("Nums");
    if (!Array.isArray(a))
      return D("Cannot update the struct tree: nums isn't an array."), !1;
    const r = new qp(n, this.xref);
    for (const h of e.keys()) {
      const { pageDict: u } = await t.getPage(h);
      if (!u.has("StructParents")) continue;
      const f = u.get("StructParents");
      if (!Number.isInteger(f) || !Array.isArray(r.get(f)))
        return D(`Cannot save the struct tree: page ${h} has a wrong id.`), !1;
    }
    let o = !0;
    for (const [h, u] of e) {
      const { pageDict: f } = await t.getPage(h);
      C(l = jl, Fn, sx).call(l, { elements: u, xref: this.xref, pageDict: f, numberTree: r });
      for (const d of u) (c = d.accessibilityData) != null && c.type && (d.accessibilityData.structParent >= 0 || (d.parentTreeId = i++), o = !1);
    }
    if (o) {
      for (const h of e.values()) for (const u of h)
        delete u.parentTreeId, delete u.structTreeParent;
      return !1;
    }
    return !0;
  }
  async updateStructureTree({ newAnnotationsByPage: t, pdfManager: e, changes: i }) {
    var d;
    const { ref: n, xref: a } = this, r = this.dict.clone(), o = new xi();
    o.put(n, r);
    let l, c = r.getRaw("ParentTree");
    c instanceof yt ? l = a.fetch(c) : (l = c, c = a.getNewTemporaryRef(), r.set("ParentTree", c)), l = l.clone(), o.put(c, l);
    let h = l.getRaw("Nums"), u = null;
    h instanceof yt && (u = h, h = a.fetch(u)), h = h.slice(), u || l.set("Nums", h);
    const f = await C(d = jl, Fn, v6).call(d, { newAnnotationsByPage: t, structTreeRootRef: n, structTreeRoot: this, kids: null, nums: h, xref: a, pdfManager: e, changes: i, cache: o });
    if (f !== -1) {
      r.set("ParentTreeNextKey", f), u && o.put(u, h);
      for (const [p, m] of o.items()) i.put(p, { data: m });
    }
  }
};
D9 = new WeakSet(), ex = function(t, e, i) {
  if (!(t instanceof yt) || e < 0) return;
  this.structParentIds || (this.structParentIds = new xi());
  let n = this.structParentIds.get(t);
  n || (n = [], this.structParentIds.put(t, n)), n.push([e, i]);
}, Fn = new WeakSet(), v6 = async function({ newAnnotationsByPage: t, structTreeRootRef: e, structTreeRoot: i, kids: n, nums: a, xref: r, pdfManager: o, changes: l, cache: c }) {
  var d, p;
  const h = Z.get("OBJR");
  let u, f = -1;
  for (const [m, b] of t) {
    const y = await o.getPage(m), { ref: v } = y, w = v instanceof yt;
    for (const { accessibilityData: A, ref: x, parentTreeId: k, structTreeParent: I } of b) {
      if (!(A != null && A.type)) continue;
      const { structParent: T } = A;
      if (i && Number.isInteger(T) && T >= 0) {
        let L = (u || (u = /* @__PURE__ */ new Map())).get(m);
        L === void 0 && (L = new nx(i, y.pageDict).collectObjects(v), u.set(m, L));
        const Y = L == null ? void 0 : L.get(T);
        if (Y) {
          const B = r.fetch(Y).clone();
          C(d = jl, Fn, A6).call(d, B, A), l.put(Y, { data: B });
          continue;
        }
      }
      f = Math.max(f, k);
      const E = r.getNewTemporaryRef(), M = new q(r);
      C(p = jl, Fn, A6).call(p, M, A), await C(this, Fn, ix).call(this, { structTreeParent: I, tagDict: M, newTagRef: E, structTreeRootRef: e, fallbackKids: n, xref: r, cache: c });
      const F = new q(r);
      M.set("K", F), F.set("Type", h), w && F.set("Pg", v), F.set("Obj", x), c.put(E, M), a.push(k, E);
    }
  }
  return f + 1;
}, A6 = function(t, { type: e, title: i, lang: n, alt: a, expanded: r, actualText: o }) {
  t.set("S", Z.get(e)), i && t.set("T", An(i)), n && t.set("Lang", An(n)), a && t.set("Alt", An(a)), r && t.set("E", An(r)), o && t.set("ActualText", An(o));
}, sx = function({ elements: t, xref: e, pageDict: i, numberTree: n }) {
  const a = /* @__PURE__ */ new Map();
  for (const c of t) if (c.structTreeParentId) {
    const h = parseInt(c.structTreeParentId.split("_mc")[1], 10);
    let u = a.get(h);
    u || (u = [], a.set(h, u)), u.push(c);
  }
  const r = i.get("StructParents");
  if (!Number.isInteger(r)) return;
  const o = n.get(r), l = (c, h, u) => {
    const f = a.get(c);
    if (f) {
      const d = h.getRaw("P"), p = e.fetchIfRef(d);
      if (d instanceof yt && p instanceof q) {
        const m = { ref: u, dict: h };
        for (const b of f) b.structTreeParent = m;
      }
      return !0;
    }
    return !1;
  };
  for (const c of o) {
    if (!(c instanceof yt)) continue;
    const h = e.fetch(c), u = h.get("K");
    if (Number.isInteger(u)) l(u, h, c);
    else if (Array.isArray(u)) for (let f of u) {
      if (f = e.fetchIfRef(f), Number.isInteger(f) && l(f, h, c)) break;
      if (!(f instanceof q)) continue;
      if (!He(f.get("Type"), "MCR")) break;
      const d = f.get("MCID");
      if (Number.isInteger(d) && l(d, h, c)) break;
    }
  }
}, ix = async function({ structTreeParent: t, tagDict: e, newTagRef: i, structTreeRootRef: n, fallbackKids: a, xref: r, cache: o }) {
  let l, c = null;
  t ? ({ ref: c } = t, l = t.dict.getRaw("P") || n) : l = n, e.set("P", l);
  const h = r.fetchIfRef(l);
  if (!h) {
    a.push(i);
    return;
  }
  let u = o.get(l);
  u || (u = h.clone(), o.put(l, u));
  const f = u.getRaw("K");
  let d = f instanceof yt ? o.get(f) : null;
  if (!d) {
    d = r.fetchIfRef(f), d = Array.isArray(d) ? d.slice() : [f];
    const m = r.getNewTemporaryRef();
    u.set("K", m), o.put(m, d);
  }
  const p = d.indexOf(c);
  d.splice(p >= 0 ? p + 1 : d.length, 0, i);
}, _(jl, Fn);
let p0 = jl;
class LE {
  constructor(t, e) {
    this.tree = t, this.xref = t.xref, this.dict = e, this.kids = [], this.parseKids();
  }
  get role() {
    const t = this.dict.get("S"), e = t instanceof Z ? t.name : "", { root: i } = this.tree;
    return i.roleMap.get(e) ?? e;
  }
  parseKids() {
    let t = null;
    const e = this.dict.getRaw("Pg");
    e instanceof yt && (t = e.toString());
    const i = this.dict.get("K");
    if (Array.isArray(i)) for (const n of i) {
      const a = this.parseKid(t, this.xref.fetchIfRef(n));
      a && this.kids.push(a);
    }
    else {
      const n = this.parseKid(t, i);
      n && this.kids.push(n);
    }
  }
  parseKid(t, e) {
    if (Number.isInteger(e)) return this.tree.pageDict.objId !== t ? null : new sg({ type: ZA, mcid: e, pageObjId: t });
    if (!(e instanceof q)) return null;
    const i = e.getRaw("Pg");
    i instanceof yt && (t = i.toString());
    const n = e.get("Type") instanceof Z ? e.get("Type").name : null;
    if (n === "MCR") {
      if (this.tree.pageDict.objId !== t) return null;
      const a = e.getRaw("Stm");
      return new sg({ type: QA, refObjId: a instanceof yt ? a.toString() : null, pageObjId: t, mcid: e.get("MCID") });
    }
    if (n === "OBJR") {
      if (this.tree.pageDict.objId !== t) return null;
      const a = e.getRaw("Obj");
      return new sg({ type: y6, refObjId: a instanceof yt ? a.toString() : null, pageObjId: t });
    }
    return new sg({ type: w6, dict: e });
  }
}
class sg {
  constructor({ type: t, dict: e = null, mcid: i = null, pageObjId: n = null, refObjId: a = null }) {
    this.type = t, this.dict = e, this.mcid = i, this.pageObjId = n, this.refObjId = a, this.parentNode = null;
  }
}
class nx {
  constructor(t, e) {
    this.root = t, this.xref = (t == null ? void 0 : t.xref) ?? null, this.rootDict = (t == null ? void 0 : t.dict) ?? null, this.pageDict = e, this.nodes = [];
  }
  collectObjects(t) {
    var r;
    if (!(this.root && this.rootDict && t instanceof yt)) return null;
    const e = this.rootDict.get("ParentTree");
    if (!e) return null;
    const i = (r = this.root.structParentIds) == null ? void 0 : r.get(t);
    if (!i) return null;
    const n = /* @__PURE__ */ new Map(), a = new qp(e, this.xref);
    for (const [o] of i) {
      const l = a.getRaw(o);
      l instanceof yt && n.set(o, l);
    }
    return n;
  }
  parse(t) {
    var o, l;
    if (!(this.root && this.rootDict && t instanceof yt)) return;
    const e = this.rootDict.get("ParentTree");
    if (!e) return;
    const i = this.pageDict.get("StructParents"), n = (o = this.root.structParentIds) == null ? void 0 : o.get(t);
    if (!Number.isInteger(i) && !n) return;
    const a = /* @__PURE__ */ new Map(), r = new qp(e, this.xref);
    if (Number.isInteger(i)) {
      const c = r.get(i);
      if (Array.isArray(c)) for (const h of c) h instanceof yt && this.addNode(this.xref.fetch(h), a);
    }
    if (n) for (const [c, h] of n) {
      const u = r.get(c);
      if (u) {
        const f = this.addNode(this.xref.fetchIfRef(u), a);
        ((l = f == null ? void 0 : f.kids) == null ? void 0 : l.length) === 1 && f.kids[0].type === y6 && (f.kids[0].type = h);
      }
    }
  }
  addNode(t, e, i = 0) {
    if (i > 40)
      return D("StructTree MAX_DEPTH reached."), null;
    if (!(t instanceof q)) return null;
    if (e.has(t)) return e.get(t);
    const n = new LE(this, t);
    e.set(t, n);
    const a = t.get("P");
    if (!(a instanceof q) || He(a.get("Type"), "StructTreeRoot"))
      return this.addTopLevelNode(t, n) || e.delete(t), n;
    const r = this.addNode(a, e, i + 1);
    if (!r) return n;
    let o = !1;
    for (const l of r.kids) l.type === w6 && l.dict === t && (l.parentNode = n, o = !0);
    return o || e.delete(t), n;
  }
  addTopLevelNode(t, e) {
    const i = this.rootDict.get("K");
    if (!i) return !1;
    if (i instanceof q)
      return i.objId !== t.objId ? !1 : (this.nodes[0] = e, !0);
    if (!Array.isArray(i)) return !0;
    let n = !1;
    for (let a = 0; a < i.length; a++) {
      const r = i[a];
      (r == null ? void 0 : r.toString()) === t.objId && (this.nodes[a] = e, n = !0);
    }
    return n;
  }
  get serializable() {
    function t(i, n, a = 0) {
      if (a > 40) {
        D("StructTree too deep to be fully serialized.");
        return;
      }
      const r = /* @__PURE__ */ Object.create(null);
      r.role = i.role, r.children = [], n.children.push(r);
      let o = i.dict.get("Alt");
      typeof o != "string" && (o = i.dict.get("ActualText")), typeof o == "string" && (r.alt = Jt(o));
      const l = i.dict.get("A");
      if (l instanceof q) {
        const h = Kr(l.getArray("BBox"), null);
        if (h) r.bbox = h;
        else {
          const u = l.get("Width"), f = l.get("Height");
          typeof u == "number" && u > 0 && typeof f == "number" && f > 0 && (r.bbox = [0, 0, u, f]);
        }
      }
      const c = i.dict.get("Lang");
      typeof c == "string" && (r.lang = Jt(c));
      for (const h of i.kids) {
        const u = h.type === w6 ? h.parentNode : null;
        u ? t(u, r, a + 1) : h.type === ZA || h.type === QA ? r.children.push({ type: "content", id: `p${h.pageObjId}_mc${h.mcid}` }) : h.type === y6 ? r.children.push({ type: "object", id: h.refObjId }) : h.type === tx && r.children.push({ type: "annotation", id: `pdfjs_internal_id_${h.refObjId}` });
      }
    }
    const e = /* @__PURE__ */ Object.create(null);
    e.children = [], e.role = "Root";
    for (const i of this.nodes) i && t(i, e);
    return e;
  }
}
const jp = (function(t, e, i) {
  if (!Array.isArray(i) || i.length < 2) return !1;
  const [n, a, ...r] = i;
  if (!t(n) && !Number.isInteger(n) || !e(a)) return !1;
  const o = r.length;
  let l = !0;
  switch (a.name) {
    case "XYZ":
      if (o < 2 || o > 3) return !1;
      break;
    case "Fit":
    case "FitB":
      return o === 0;
    case "FitH":
    case "FitBH":
    case "FitV":
    case "FitBV":
      if (o > 1) return !1;
      break;
    case "FitR":
      if (o !== 4) return !1;
      l = !1;
      break;
    default:
      return !1;
  }
  for (const c of r) if (!(typeof c == "number" || l && c === null)) return !1;
  return !0;
}).bind(null, (s) => s instanceof yt, He);
function Um(s) {
  return s instanceof q && (s = s.get("D")), jp(s) ? s : null;
}
function eb(s) {
  let t = s.get("D");
  if (t) {
    if (t instanceof Z && (t = t.name), typeof t == "string") return Jt(t, !0);
    if (jp(t)) return JSON.stringify(t);
  }
  return null;
}
var x1, ce, es, ax, rx, ox, lx, cx, hx, x6, ux, dx;
const N9 = class N9 {
  constructor(t, e) {
    _(this, es);
    _(this, x1, null);
    _(this, ce, null);
    ht(this, "builtInCMapCache", /* @__PURE__ */ new Map());
    ht(this, "fontCache", new xi());
    ht(this, "globalColorSpaceCache", new dE());
    ht(this, "globalImageCache", new d6());
    ht(this, "nonBlendModesSet", new Qe());
    ht(this, "pageDictCache", new xi());
    ht(this, "pageIndexCache", new xi());
    ht(this, "pageKidsCountCache", new xi());
    ht(this, "standardFontDataCache", /* @__PURE__ */ new Map());
    ht(this, "systemFontCache", /* @__PURE__ */ new Map());
    if (this.pdfManager = t, this.xref = e, S(this, ce, e.getCatalogObj()), !(g(this, ce) instanceof q)) throw new st("Catalog object is not a dictionary.");
    this.toplevelPagesDict;
  }
  cloneDict() {
    return g(this, ce).clone();
  }
  get version() {
    const t = g(this, ce).get("Version");
    if (t instanceof Z) {
      if (Qv.test(t.name)) return gt(this, "version", t.name);
      D(`Invalid PDF catalog version: ${t.name}`);
    }
    return gt(this, "version", null);
  }
  get lang() {
    const t = g(this, ce).get("Lang");
    return gt(this, "lang", t && typeof t == "string" ? Jt(t) : null);
  }
  get needsRendering() {
    const t = g(this, ce).get("NeedsRendering");
    return gt(this, "needsRendering", typeof t == "boolean" && t);
  }
  get collection() {
    let t = null;
    try {
      const e = g(this, ce).get("Collection");
      e instanceof q && e.size > 0 && (t = e);
    } catch (e) {
      if (e instanceof ke) throw e;
      qt("Cannot fetch Collection entry; assuming no collection is present.");
    }
    return gt(this, "collection", t);
  }
  get acroForm() {
    let t = null;
    try {
      const e = g(this, ce).get("AcroForm");
      e instanceof q && e.size > 0 && (t = e);
    } catch (e) {
      if (e instanceof ke) throw e;
      qt("Cannot fetch AcroForm entry; assuming no forms are present.");
    }
    return gt(this, "acroForm", t);
  }
  get acroFormRef() {
    const t = g(this, ce).getRaw("AcroForm");
    return gt(this, "acroFormRef", t instanceof yt ? t : null);
  }
  get metadata() {
    var i;
    const t = g(this, ce).getRaw("Metadata");
    if (!(t instanceof yt)) return gt(this, "metadata", null);
    let e = null;
    try {
      const n = this.xref.fetch(t, !((i = this.xref.encrypt) != null && i.encryptMetadata));
      if (n instanceof Ot && n.dict instanceof q) {
        const a = n.dict.get("Type"), r = n.dict.get("Subtype");
        if (He(a, "Metadata") && He(r, "XML")) {
          const o = a0(n.getString());
          o && (e = new BE(o).serializable);
        }
      }
    } catch (n) {
      if (n instanceof ke) throw n;
      qt(`Skipping invalid Metadata: "${n}".`);
    }
    return gt(this, "metadata", e);
  }
  get markInfo() {
    let t = null;
    try {
      t = C(this, es, ax).call(this);
    } catch (e) {
      if (e instanceof ke) throw e;
      D("Unable to read mark info.");
    }
    return gt(this, "markInfo", t);
  }
  get structTreeRoot() {
    let t = null;
    try {
      t = C(this, es, rx).call(this);
    } catch (e) {
      if (e instanceof ke) throw e;
      D("Unable read to structTreeRoot info.");
    }
    return gt(this, "structTreeRoot", t);
  }
  get toplevelPagesDict() {
    const t = g(this, ce).get("Pages");
    if (!(t instanceof q)) throw new st("Invalid top-level pages dictionary.");
    return gt(this, "toplevelPagesDict", t);
  }
  get documentOutline() {
    let t = null;
    try {
      t = C(this, es, ox).call(this);
    } catch (e) {
      if (e instanceof ke) throw e;
      D("Unable to read document outline.");
    }
    return gt(this, "documentOutline", t);
  }
  get permissions() {
    let t = null;
    try {
      t = C(this, es, lx).call(this);
    } catch (e) {
      if (e instanceof ke) throw e;
      D("Unable to read permissions.");
    }
    return gt(this, "permissions", t);
  }
  get optionalContentConfig() {
    let t = null;
    try {
      const e = g(this, ce).get("OCProperties");
      if (!e) return gt(this, "optionalContentConfig", null);
      const i = e.get("D");
      if (!i) return gt(this, "optionalContentConfig", null);
      const n = e.get("OCGs");
      if (!Array.isArray(n)) return gt(this, "optionalContentConfig", null);
      const a = new xi();
      for (const r of n) r instanceof yt && !a.has(r) && a.put(r, C(this, es, cx).call(this, r));
      t = C(this, es, hx).call(this, i, a);
    } catch (e) {
      if (e instanceof ke) throw e;
      D(`Unable to read optional content config: ${e}`);
    }
    return gt(this, "optionalContentConfig", t);
  }
  setActualNumPages(t = null) {
    S(this, x1, t);
  }
  get hasActualNumPages() {
    return g(this, x1) !== null;
  }
  get _pagesCount() {
    const t = this.toplevelPagesDict.get("Count");
    if (!Number.isInteger(t)) throw new st("Page count in top-level pages dictionary is not an integer.");
    return gt(this, "_pagesCount", t);
  }
  get numPages() {
    return g(this, x1) ?? this._pagesCount;
  }
  get destinations() {
    var i;
    const t = C(this, es, x6).call(this), e = /* @__PURE__ */ Object.create(null);
    for (const n of t) if (n instanceof Ch) for (const [a, r] of n.getAll()) {
      const o = Um(r);
      o && (e[Jt(a, !0)] = o);
    }
    else if (n instanceof q) for (const [a, r] of n) {
      const o = Um(r);
      o && (e[i = Jt(a, !0)] || (e[i] = o));
    }
    return gt(this, "destinations", e);
  }
  getDestination(t) {
    if (this.hasOwnProperty("destinations")) return this.destinations[t] ?? null;
    const e = C(this, es, x6).call(this);
    for (const i of e) if (i instanceof Ch || i instanceof q) {
      const n = Um(i.get(t));
      if (n) return n;
    }
    if (e.length) {
      const i = this.destinations[t];
      if (i) return i;
    }
    return null;
  }
  get pageLabels() {
    let t = null;
    try {
      t = C(this, es, ux).call(this);
    } catch (e) {
      if (e instanceof ke) throw e;
      D("Unable to read page labels.");
    }
    return gt(this, "pageLabels", t);
  }
  get pageLayout() {
    const t = g(this, ce).get("PageLayout");
    let e = "";
    if (t instanceof Z) switch (t.name) {
      case "SinglePage":
      case "OneColumn":
      case "TwoColumnLeft":
      case "TwoColumnRight":
      case "TwoPageLeft":
      case "TwoPageRight":
        e = t.name;
    }
    return gt(this, "pageLayout", e);
  }
  get pageMode() {
    const t = g(this, ce).get("PageMode");
    let e = "UseNone";
    if (t instanceof Z) switch (t.name) {
      case "UseNone":
      case "UseOutlines":
      case "UseThumbs":
      case "FullScreen":
      case "UseOC":
      case "UseAttachments":
        e = t.name;
    }
    return gt(this, "pageMode", e);
  }
  get viewerPreferences() {
    const t = g(this, ce).get("ViewerPreferences");
    if (!(t instanceof q)) return gt(this, "viewerPreferences", null);
    let e = null;
    for (const [i, n] of t) {
      let a;
      switch (i) {
        case "HideToolbar":
        case "HideMenubar":
        case "HideWindowUI":
        case "FitWindow":
        case "CenterWindow":
        case "DisplayDocTitle":
        case "PickTrayByPDFSize":
          typeof n == "boolean" && (a = n);
          break;
        case "NonFullScreenPageMode":
          if (n instanceof Z) switch (n.name) {
            case "UseNone":
            case "UseOutlines":
            case "UseThumbs":
            case "UseOC":
              a = n.name;
              break;
            default:
              a = "UseNone";
          }
          break;
        case "Direction":
          if (n instanceof Z) switch (n.name) {
            case "L2R":
            case "R2L":
              a = n.name;
              break;
            default:
              a = "L2R";
          }
          break;
        case "ViewArea":
        case "ViewClip":
        case "PrintArea":
        case "PrintClip":
          if (n instanceof Z) switch (n.name) {
            case "MediaBox":
            case "CropBox":
            case "BleedBox":
            case "TrimBox":
            case "ArtBox":
              a = n.name;
              break;
            default:
              a = "CropBox";
          }
          break;
        case "PrintScaling":
          if (n instanceof Z) switch (n.name) {
            case "None":
            case "AppDefault":
              a = n.name;
              break;
            default:
              a = "AppDefault";
          }
          break;
        case "Duplex":
          if (n instanceof Z) switch (n.name) {
            case "Simplex":
            case "DuplexFlipShortEdge":
            case "DuplexFlipLongEdge":
              a = n.name;
              break;
            default:
              a = "None";
          }
          break;
        case "PrintPageRange":
          Array.isArray(n) && n.length % 2 == 0 && n.every((r, o, l) => Number.isInteger(r) && r > 0 && (o === 0 || r >= l[o - 1]) && r <= this.numPages) && (a = n);
          break;
        case "NumCopies":
          Number.isInteger(n) && n > 0 && (a = n);
          break;
        default:
          D(`Ignoring non-standard key in ViewerPreferences: ${i}.`);
          continue;
      }
      a !== void 0 ? (e ?? (e = /* @__PURE__ */ Object.create(null)), e[i] = a) : D(`Bad value, for key "${i}", in ViewerPreferences: ${n}.`);
    }
    return gt(this, "viewerPreferences", e);
  }
  get openAction() {
    const t = g(this, ce).get("OpenAction"), e = /* @__PURE__ */ Object.create(null);
    if (t instanceof q) {
      const i = new q(this.xref);
      i.set("A", t);
      const n = { url: null, dest: null, action: null };
      N9.parseDestDictionary({ destDict: i, resultObj: n }), Array.isArray(n.dest) ? e.dest = n.dest : n.action && (e.action = n.action);
    } else jp(t) && (e.dest = t);
    return gt(this, "openAction", g7(e) > 0 ? e : null);
  }
  get attachments() {
    const t = g(this, ce).get("Names");
    let e = null;
    if (t instanceof q && t.has("EmbeddedFiles")) {
      const i = new Ch(t.getRaw("EmbeddedFiles"), this.xref);
      for (const [n, a] of i.getAll()) {
        const r = new b6(a, this.xref);
        e ?? (e = /* @__PURE__ */ Object.create(null)), e[Jt(n, !0)] = r.serializable;
      }
    }
    return gt(this, "attachments", e);
  }
  get xfaImages() {
    const t = g(this, ce).get("Names");
    let e = null;
    if (t instanceof q && t.has("XFAImages")) {
      const i = new Ch(t.getRaw("XFAImages"), this.xref);
      for (const [n, a] of i.getAll()) a instanceof Ot && (e ?? (e = /* @__PURE__ */ new Map()), e.set(Jt(n, !0), a.getBytes()));
    }
    return gt(this, "xfaImages", e);
  }
  get jsActions() {
    const t = C(this, es, dx).call(this);
    let e = K9(this.xref, g(this, ce), eI);
    if (t) {
      e || (e = /* @__PURE__ */ Object.create(null));
      for (const [i, n] of t) i in e ? e[i].push(n) : e[i] = [n];
    }
    return gt(this, "jsActions", e);
  }
  async cleanup(t = !1) {
    E7(), this.globalColorSpaceCache.clear(), this.globalImageCache.clear(t), this.pageKidsCountCache.clear(), this.pageIndexCache.clear(), this.pageDictCache.clear(), this.nonBlendModesSet.clear();
    for (const { dict: e } of await Promise.all(this.fontCache)) delete e.cacheKey;
    this.fontCache.clear(), this.builtInCMapCache.clear(), this.standardFontDataCache.clear(), this.systemFontCache.clear();
  }
  async getPageDict(t) {
    const e = [this.toplevelPagesDict], i = new Qe(), n = g(this, ce).getRaw("Pages");
    n instanceof yt && i.put(n);
    const a = this.xref, r = this.pageKidsCountCache, o = this.pageIndexCache, l = this.pageDictCache;
    let c = 0;
    for (; e.length; ) {
      const h = e.pop();
      if (h instanceof yt) {
        const p = r.get(h);
        if (p >= 0 && c + p <= t) {
          c += p;
          continue;
        }
        if (i.has(h)) throw new st("Pages tree contains circular reference.");
        i.put(h);
        const m = await (l.get(h) || a.fetchAsync(h));
        if (m instanceof q) {
          let b = m.getRaw("Type");
          if (b instanceof yt && (b = await a.fetchAsync(b)), He(b, "Page") || !m.has("Kids")) {
            if (r.has(h) || r.put(h, 1), o.has(h) || o.put(h, c), c === t) return [m, h];
            c++;
            continue;
          }
        }
        e.push(m);
        continue;
      }
      if (!(h instanceof q)) throw new st("Page dictionary kid reference points to wrong type of object.");
      const { objId: u } = h;
      let f = h.getRaw("Count");
      if (f instanceof yt && (f = await a.fetchAsync(f)), Number.isInteger(f) && f >= 0 && (u && !r.has(u) && r.put(u, f), c + f <= t)) {
        c += f;
        continue;
      }
      let d = h.getRaw("Kids");
      if (d instanceof yt && (d = await a.fetchAsync(d)), !Array.isArray(d)) {
        let p = h.getRaw("Type");
        if (p instanceof yt && (p = await a.fetchAsync(p)), He(p, "Page") || !h.has("Kids")) {
          if (c === t) return [h, null];
          c++;
          continue;
        }
        throw new st("Page dictionary kids object is not an array.");
      }
      for (let p = d.length - 1; p >= 0; p--) {
        const m = d[p];
        e.push(m), h === this.toplevelPagesDict && m instanceof yt && !l.has(m) && l.put(m, a.fetchAsync(m));
      }
    }
    throw new Error(`Page index ${t} not found.`);
  }
  async getAllPageDicts(t = !1) {
    const { ignoreErrors: e } = this.pdfManager.evaluatorOptions, i = [{ currentNode: this.toplevelPagesDict, posInKids: 0 }], n = new Qe(), a = g(this, ce).getRaw("Pages");
    a instanceof yt && n.put(a);
    const r = /* @__PURE__ */ new Map(), o = this.xref, l = this.pageIndexCache;
    let c = 0;
    function h(f, d) {
      d && !l.has(d) && l.put(d, c), r.set(c++, [f, d]);
    }
    function u(f) {
      if (f instanceof Zo && !t) throw f;
      t && e && c === 0 && (D(`getAllPageDicts - Skipping invalid first page: "${f}".`), f = q.empty), r.set(c++, [f, null]);
    }
    for (; i.length > 0; ) {
      const f = i.at(-1), { currentNode: d, posInKids: p } = f;
      let m = d.getRaw("Kids");
      if (m instanceof yt) try {
        m = await o.fetchAsync(m);
      } catch (w) {
        u(w);
        break;
      }
      if (!Array.isArray(m)) {
        u(new st("Page dictionary kids object is not an array."));
        break;
      }
      if (p >= m.length) {
        i.pop();
        continue;
      }
      const b = m[p];
      let y;
      if (b instanceof yt) {
        if (n.has(b)) {
          u(new st("Pages tree contains circular reference."));
          break;
        }
        n.put(b);
        try {
          y = await o.fetchAsync(b);
        } catch (w) {
          u(w);
          break;
        }
      } else y = b;
      if (!(y instanceof q)) {
        u(new st("Page dictionary kid reference points to wrong type of object."));
        break;
      }
      let v = y.getRaw("Type");
      if (v instanceof yt) try {
        v = await o.fetchAsync(v);
      } catch (w) {
        u(w);
        break;
      }
      He(v, "Page") || !y.has("Kids") ? h(y, b instanceof yt ? b : null) : i.push({ currentNode: y, posInKids: 0 }), f.posInKids++;
    }
    return r;
  }
  getPageIndex(t) {
    const e = this.pageIndexCache.get(t);
    if (e !== void 0) return Promise.resolve(e);
    const i = this.xref;
    let n = 0;
    const a = (r) => function(l) {
      let c, h = 0;
      return i.fetchAsync(l).then(function(u) {
        if (Pp(l, t) && !Zv(u, "Page") && !(u instanceof q && !u.has("Type") && u.has("Contents"))) throw new st("The reference does not point to a /Page dictionary.");
        if (!u) return null;
        if (!(u instanceof q)) throw new st("Node must be a dictionary.");
        return c = u.getRaw("Parent"), u.getAsync("Parent");
      }).then(function(u) {
        if (!u) return null;
        if (!(u instanceof q)) throw new st("Parent must be a dictionary.");
        return u.getAsync("Kids");
      }).then(function(u) {
        if (!u) return null;
        const f = [];
        let d = !1;
        for (const p of u) {
          if (!(p instanceof yt)) throw new st("Kid must be a reference.");
          if (Pp(p, l)) {
            d = !0;
            break;
          }
          f.push(i.fetchAsync(p).then(function(m) {
            if (!(m instanceof q)) throw new st("Kid node must be a dictionary.");
            m.has("Count") ? h += m.get("Count") : h++;
          }));
        }
        if (!d) throw new st("Kid reference not found in parent's kids.");
        return Promise.all(f).then(() => [h, c]);
      });
    }(r).then((o) => {
      if (!o)
        return this.pageIndexCache.put(t, n), n;
      const [l, c] = o;
      return n += l, a(c);
    });
    return a(t);
  }
  get baseUrl() {
    const t = g(this, ce).get("URI");
    if (t instanceof q) {
      const e = t.get("Base");
      if (typeof e == "string") {
        const i = Rp(e, null, { tryConvertEncoding: !0 });
        if (i) return gt(this, "baseUrl", i.href);
      }
    }
    return gt(this, "baseUrl", this.pdfManager.docBaseUrl);
  }
  static parseDestDictionary({ destDict: t, resultObj: e, docBaseUrl: i = null, docAttachments: n = null }) {
    if (!(t instanceof q)) {
      D("parseDestDictionary: `destDict` must be a dictionary.");
      return;
    }
    let a, r, o = t.get("A");
    if (o instanceof q || (t.has("Dest") ? o = t.get("Dest") : (o = t.get("AA"), o instanceof q && (o.has("D") ? o = o.get("D") : o.has("U") && (o = o.get("U"))))), o instanceof q) {
      const l = o.get("S");
      if (!(l instanceof Z)) {
        D("parseDestDictionary: Invalid type in Action dictionary.");
        return;
      }
      const c = l.name;
      switch (c) {
        case "ResetForm":
          const h = o.get("Flags"), u = !(1 & (typeof h == "number" ? h : 0)), f = [], d = [];
          for (const M of o.get("Fields") || []) M instanceof yt ? d.push(M.toString()) : typeof M == "string" && f.push(Jt(M));
          e.resetForm = { fields: f, refs: d, include: u };
          break;
        case "URI":
          a = o.get("URI"), a instanceof Z && (a = "/" + a.name);
          break;
        case "GoTo":
          r = o.get("D");
          break;
        case "Launch":
        case "GoToR":
          const p = o.get("F");
          if (p instanceof q) {
            const M = new b6(p, null, !0), { rawFilename: F } = M.serializable;
            a = F;
          } else typeof p == "string" && (a = p);
          const m = eb(o);
          m && typeof a == "string" && (a = a.split("#", 1)[0] + "#" + m);
          const b = o.get("NewWindow");
          typeof b == "boolean" && (e.newWindow = b);
          break;
        case "GoToE":
          const y = o.get("T");
          let v;
          if (n && y instanceof q) {
            const M = y.get("R"), F = y.get("N");
            He(M, "C") && typeof F == "string" && (v = n[Jt(F, !0)]);
          }
          if (v) {
            e.attachment = v;
            const M = eb(o);
            M && (e.attachmentDest = M);
          } else D('parseDestDictionary - unimplemented "GoToE" action.');
          break;
        case "Named":
          const w = o.get("N");
          w instanceof Z && (e.action = w.name);
          break;
        case "SetOCGState":
          const A = o.get("State"), x = o.get("PreserveRB");
          if (!Array.isArray(A) || A.length === 0) break;
          const k = [];
          for (const M of A) if (M instanceof Z) switch (M.name) {
            case "ON":
            case "OFF":
            case "Toggle":
              k.push(M.name);
          }
          else M instanceof yt && k.push(M.toString());
          if (k.length !== A.length) break;
          e.setOCGState = { state: k, preserveRB: typeof x != "boolean" || x };
          break;
        case "JavaScript":
          const I = o.get("JS");
          let T;
          I instanceof Ot ? T = I.getString() : typeof I == "string" && (T = I);
          const E = T && sA(Jt(T, !0));
          if (E) {
            a = E.url, e.newWindow = E.newWindow;
            break;
          }
        default:
          if (c === "JavaScript" || c === "SubmitForm") break;
          D(`parseDestDictionary - unsupported action: "${c}".`);
      }
    } else t.has("Dest") && (r = t.get("Dest"));
    if (typeof a == "string") {
      const l = Rp(a, i, { addDefaultProtocol: !0, tryConvertEncoding: !0 });
      l && (e.url = l.href), e.unsafeUrl = a;
    }
    r && (r instanceof Z && (r = r.name), typeof r == "string" ? e.dest = Jt(r, !0) : jp(r) && (e.dest = r));
  }
};
x1 = new WeakMap(), ce = new WeakMap(), es = new WeakSet(), ax = function() {
  const t = g(this, ce).get("MarkInfo");
  if (!(t instanceof q)) return null;
  const e = { Marked: !1, UserProperties: !1, Suspects: !1 };
  for (const i in e) {
    const n = t.get(i);
    typeof n == "boolean" && (e[i] = n);
  }
  return e;
}, rx = function() {
  const t = g(this, ce).getRaw("StructTreeRoot"), e = this.xref.fetchIfRef(t);
  if (!(e instanceof q)) return null;
  const i = new p0(this.xref, e, t);
  return i.init(), i;
}, ox = function() {
  let t = g(this, ce).get("Outlines");
  if (!(t instanceof q) || (t = t.getRaw("First"), !(t instanceof yt))) return null;
  const e = { items: [] }, i = [{ obj: t, parent: e }], n = new Qe();
  n.put(t);
  const a = this.xref, r = new Uint8ClampedArray(3);
  for (; i.length > 0; ) {
    const o = i.shift(), l = a.fetchIfRef(o.obj);
    if (l === null) continue;
    l.has("Title") || D("Invalid outline item encountered.");
    const c = { url: null, dest: null, action: null };
    N9.parseDestDictionary({ destDict: l, resultObj: c, docBaseUrl: this.baseUrl, docAttachments: this.attachments });
    const h = l.get("Title"), u = l.get("F") || 0, f = l.getArray("C"), d = l.get("Count");
    let p = r;
    !ci(f, 3) || f[0] === 0 && f[1] === 0 && f[2] === 0 || (p = te.rgb.getRgb(f, 0));
    const m = { action: c.action, attachment: c.attachment, dest: c.dest, url: c.url, unsafeUrl: c.unsafeUrl, newWindow: c.newWindow, setOCGState: c.setOCGState, title: typeof h == "string" ? Jt(h) : "", color: p, count: Number.isInteger(d) ? d : void 0, bold: !!(2 & u), italic: !!(1 & u), items: [] };
    o.parent.items.push(m), t = l.getRaw("First"), t instanceof yt && !n.has(t) && (i.push({ obj: t, parent: m }), n.put(t)), t = l.getRaw("Next"), t instanceof yt && !n.has(t) && (i.push({ obj: t, parent: o.parent }), n.put(t));
  }
  return e.items.length > 0 ? e.items : null;
}, lx = function() {
  const t = this.xref.trailer.get("Encrypt");
  if (!(t instanceof q)) return null;
  let e = t.get("P");
  if (typeof e != "number") return null;
  e += 2 ** 32;
  const i = [];
  for (const n in z8) {
    const a = z8[n];
    e & a && i.push(a);
  }
  return i;
}, cx = function(t) {
  const e = this.xref.fetch(t), i = { id: t.toString(), name: null, intent: null, usage: { print: null, view: null }, rbGroups: [] }, n = e.get("Name");
  typeof n == "string" && (i.name = Jt(n));
  let a = e.getArray("Intent");
  Array.isArray(a) || (a = [a]), a.every((h) => h instanceof Z) && (i.intent = a.map((h) => h.name));
  const r = e.get("Usage");
  if (!(r instanceof q)) return i;
  const o = i.usage, l = r.get("Print");
  if (l instanceof q) {
    const h = l.get("PrintState");
    if (h instanceof Z) switch (h.name) {
      case "ON":
      case "OFF":
        o.print = { printState: h.name };
    }
  }
  const c = r.get("View");
  if (c instanceof q) {
    const h = c.get("ViewState");
    if (h instanceof Z) switch (h.name) {
      case "ON":
      case "OFF":
        o.view = { viewState: h.name };
    }
  }
  return i;
}, hx = function(t, e) {
  function i(c) {
    const h = [];
    if (Array.isArray(c)) for (const u of c) u instanceof yt && e.has(u) && h.push(u.toString());
    return h;
  }
  function n(c, h = 0) {
    if (!Array.isArray(c)) return null;
    const u = [];
    for (const d of c) {
      if (d instanceof yt && e.has(d)) {
        o.put(d), u.push(d.toString());
        continue;
      }
      const p = a(d, h);
      p && u.push(p);
    }
    if (h > 0) return u;
    const f = [];
    for (const [d] of e.items()) o.has(d) || f.push(d.toString());
    return f.length && u.push({ name: null, order: f }), u;
  }
  function a(c, h) {
    if (++h > l)
      return D("parseNestedOrder - reached MAX_NESTED_LEVELS."), null;
    const u = r.fetchIfRef(c);
    if (!Array.isArray(u)) return null;
    const f = r.fetchIfRef(u[0]);
    if (typeof f != "string") return null;
    const d = n(u.slice(1), h);
    return d != null && d.length ? { name: Jt(f), order: d } : null;
  }
  const r = this.xref, o = new Qe(), l = 10;
  return function(h) {
    if (Array.isArray(h)) for (const u of h) {
      const f = r.fetchIfRef(u);
      if (!Array.isArray(f) || !f.length) continue;
      const d = /* @__PURE__ */ new Set();
      for (const p of f) p instanceof yt && e.has(p) && !d.has(p.toString()) && (d.add(p.toString()), e.get(p).rbGroups.push(d));
    }
  }(t.get("RBGroups")), { name: typeof t.get("Name") == "string" ? Jt(t.get("Name")) : null, creator: typeof t.get("Creator") == "string" ? Jt(t.get("Creator")) : null, baseState: t.get("BaseState") instanceof Z ? t.get("BaseState").name : null, on: i(t.get("ON")), off: i(t.get("OFF")), order: n(t.get("Order")), groups: [...e] };
}, x6 = function() {
  const t = g(this, ce).get("Names"), e = [];
  return t != null && t.has("Dests") && e.push(new Ch(t.getRaw("Dests"), this.xref)), g(this, ce).has("Dests") && e.push(g(this, ce).get("Dests")), e;
}, ux = function() {
  const t = g(this, ce).getRaw("PageLabels");
  if (!t) return null;
  const e = new Array(this.numPages);
  let i = null, n = "";
  const a = new qp(t, this.xref).getAll();
  let r = "", o = 1;
  for (let l = 0, c = this.numPages; l < c; l++) {
    const h = a.get(l);
    if (h !== void 0) {
      if (!(h instanceof q)) throw new st("PageLabel is not a dictionary.");
      if (h.has("Type") && !He(h.get("Type"), "PageLabel")) throw new st("Invalid type in PageLabel dictionary.");
      if (h.has("S")) {
        const u = h.get("S");
        if (!(u instanceof Z)) throw new st("Invalid style in PageLabel dictionary.");
        i = u.name;
      } else i = null;
      if (h.has("P")) {
        const u = h.get("P");
        if (typeof u != "string") throw new st("Invalid prefix in PageLabel dictionary.");
        n = Jt(u);
      } else n = "";
      if (h.has("St")) {
        const u = h.get("St");
        if (!(Number.isInteger(u) && u >= 1)) throw new st("Invalid start in PageLabel dictionary.");
        o = u;
      } else o = 1;
    }
    switch (i) {
      case "D":
        r = o;
        break;
      case "R":
      case "r":
        r = TI(o, i === "r");
        break;
      case "A":
      case "a":
        const u = 26, f = i === "a" ? 97 : 65, d = o - 1;
        r = String.fromCharCode(f + d % u).repeat(Math.floor(d / u) + 1);
        break;
      default:
        if (i) throw new st(`Invalid style "${i}" in PageLabel dictionary.`);
        r = "";
    }
    e[l] = n + r, o++;
  }
  return e;
}, dx = function() {
  const t = g(this, ce).get("Names");
  let e = null;
  function i(a, r) {
    if (!(r instanceof q) || !He(r.get("S"), "JavaScript")) return;
    let o = r.get("JS");
    if (o instanceof Ot) o = o.getString();
    else if (typeof o != "string") return;
    o = Jt(o, !0).replaceAll("\0", ""), o && (e || (e = /* @__PURE__ */ new Map())).set(a, o);
  }
  if (t instanceof q && t.has("JavaScript")) {
    const a = new Ch(t.getRaw("JavaScript"), this.xref);
    for (const [r, o] of a.getAll()) i(Jt(r, !0), o);
  }
  const n = g(this, ce).get("OpenAction");
  return n && i("OpenAction", n), e;
};
let m0 = N9;
function OE(s, t) {
  if (s instanceof q) s = s.getRawValues();
  else if (s instanceof Ot) s = s.dict.getRawValues();
  else if (!Array.isArray(s)) return;
  for (const i of s) ((e = i) instanceof yt || e instanceof q || e instanceof Ot || Array.isArray(e)) && t.push(i);
  var e;
}
var u2, k6;
const r8 = class r8 {
  constructor(t, e, i) {
    _(this, u2);
    ht(this, "refSet", new Qe());
    this.dict = t, this.keys = e, this.xref = i;
  }
  async load() {
    const { keys: t, dict: e } = this, i = [];
    for (const n of t) {
      const a = e.getRaw(n);
      a !== void 0 && i.push(a);
    }
    await C(this, u2, k6).call(this, i), this.refSet = null;
  }
  static async load(t, e, i) {
    if (i.stream.isDataLoaded) return;
    await new r8(t, e, i).load();
  }
};
u2 = new WeakSet(), k6 = async function(t) {
  const e = [], i = [];
  for (; t.length; ) {
    let n = t.pop();
    if (n instanceof yt) {
      if (this.refSet.has(n)) continue;
      try {
        this.refSet.put(n), n = this.xref.fetch(n);
      } catch (a) {
        if (!(a instanceof ke)) {
          D(`ObjectLoader.#walk - requesting all data: "${a}".`), await this.xref.stream.manager.requestAllChunks();
          return;
        }
        e.push(n), i.push({ begin: a.begin, end: a.end });
      }
    }
    if (n instanceof Ot) {
      const a = n.getBaseStreams();
      if (a) {
        let r = !1;
        for (const o of a) o.isDataLoaded || (r = !0, i.push({ begin: o.start, end: o.end }));
        r && e.push(n);
      }
    }
    OE(n, t);
  }
  if (i.length) {
    await this.xref.stream.manager.requestRanges(i);
    for (const n of e) n instanceof yt && this.refSet.remove(n);
    await C(this, u2, k6).call(this, e);
  }
};
let P1 = r8;
const Q9 = Symbol(), ih = Symbol(), Ne = Symbol(), cl = Symbol(), Mn = Symbol(), zh = Symbol(), sp = Symbol(), Qn = Symbol(), La = Symbol(), it = Symbol("content"), xn = Symbol("data"), D1 = Symbol(), J = Symbol("extra"), ge = Symbol(), _2 = Symbol(), S6 = Symbol(), fx = Symbol(), nh = Symbol(), tm = Symbol(), b0 = Symbol(), Gd = Symbol(), M7 = Symbol(), Ls = Symbol(), Vd = Symbol(), xs = Symbol(), N1 = Symbol(), ir = Symbol(), Ve = Symbol(), Nt = Symbol(), ze = Symbol(), fe = Symbol(), y0 = Symbol(), jh = Symbol(), C6 = Symbol(), ip = Symbol(), F7 = Symbol(), yh = Symbol(), Gh = Symbol(), co = Symbol(), Wd = Symbol(), qr = Symbol(), Yr = Symbol(), w0 = Symbol(), v0 = Symbol(), UE = Symbol(), Ge = Symbol("namespaceId"), ee = Symbol("nodeName"), Lr = Symbol(), qa = Symbol(), I6 = Symbol(), jr = Symbol(), Ga = Symbol(), ki = Symbol(), j1 = Symbol(), el = Symbol(), gx = Symbol("root"), Pd = Symbol(), Or = Symbol(), _6 = Symbol(), px = Symbol(), _i = Symbol(), Jn = Symbol(), ns = Symbol(), mx = Symbol(), Mt = Symbol(), Xd = Symbol(), Zt = Symbol(), oe = Symbol("uid"), la = Symbol(), We = { config: { id: 0, check: (s) => s.startsWith("http://www.xfa.org/schema/xci/") }, connectionSet: { id: 1, check: (s) => s.startsWith("http://www.xfa.org/schema/xfa-connection-set/") }, datasets: { id: 2, check: (s) => s.startsWith("http://www.xfa.org/schema/xfa-data/") }, form: { id: 3, check: (s) => s.startsWith("http://www.xfa.org/schema/xfa-form/") }, localeSet: { id: 4, check: (s) => s.startsWith("http://www.xfa.org/schema/xfa-locale-set/") }, pdf: { id: 5, check: (s) => s === "http://ns.adobe.com/xdp/pdf/" }, signature: { id: 6, check: (s) => s === "http://www.w3.org/2000/09/xmldsig#" }, sourceSet: { id: 7, check: (s) => s.startsWith("http://www.xfa.org/schema/xfa-source-set/") }, stylesheet: { id: 8, check: (s) => s === "http://www.w3.org/1999/XSL/Transform" }, template: { id: 9, check: (s) => s.startsWith("http://www.xfa.org/schema/xfa-template/") }, xdc: { id: 10, check: (s) => s.startsWith("http://www.xfa.org/schema/xdc/") }, xdp: { id: 11, check: (s) => s === "http://ns.adobe.com/xdp/" }, xfdf: { id: 12, check: (s) => s === "http://ns.adobe.com/xfdf/" }, xhtml: { id: 13, check: (s) => s === "http://www.w3.org/1999/xhtml" }, xmpmeta: { id: 14, check: (s) => s === "http://ns.adobe.com/xmpmeta/" } }, qE = { pt: (s) => s, cm: (s) => s / 2.54 * 72, mm: (s) => s / 25.4 * 72, in: (s) => 72 * s, px: (s) => s }, jE = /([+-]?\d+\.?\d*)(.*)/;
function em(s) {
  return s.startsWith("'") || s.startsWith('"') ? s.slice(1, -1) : s;
}
function Pt({ data: s, defaultValue: t, validate: e }) {
  if (!s) return t;
  s = s.trim();
  const i = parseInt(s, 10);
  return !isNaN(i) && e(i) ? i : t;
}
function Hp({ data: s, defaultValue: t, validate: e }) {
  if (!s) return t;
  s = s.trim();
  const i = parseFloat(s);
  return !isNaN(i) && e(i) ? i : t;
}
function sm({ data: s, defaultValue: t, validate: e }) {
  return s && e(s = s.trim()) ? s : t;
}
function at(s, t) {
  return sm({ data: s, defaultValue: t[0], validate: (e) => t.includes(e) });
}
function At(s, t = "0") {
  if (t || (t = "0"), !s) return At(t);
  const e = s.trim().match(jE);
  if (!e) return At(t);
  const [, i, n] = e, a = parseFloat(i);
  if (isNaN(a)) return At(t);
  if (a === 0) return 0;
  const r = qE[n];
  return r ? r(a) : a;
}
function sb(s) {
  if (!s) return { num: 1, den: 1 };
  const t = s.split(":", 2).map((n) => parseFloat(n.trim())).filter((n) => !isNaN(n));
  if (t.length === 1 && t.push(1), t.length === 0) return { num: 1, den: 1 };
  const [e, i] = t;
  return { num: e, den: i };
}
function ca(s) {
  return s ? s.trim().split(/\s+/).map((t) => ({ excluded: t[0] === "-", viewname: t.substring(1) })) : [];
}
class Ct {
  static get FAILURE() {
    return gt(this, "FAILURE", new Ct(!1, null, null, null));
  }
  static get EMPTY() {
    return gt(this, "EMPTY", new Ct(!0, null, null, null));
  }
  constructor(t, e, i, n) {
    this.success = t, this.html = e, this.bbox = i, this.breakNode = n;
  }
  isBreak() {
    return !!this.breakNode;
  }
  static breakNode(t) {
    return new Ct(!1, null, null, t);
  }
  static success(t, e = null) {
    return new Ct(!0, t, e, null);
  }
}
class HE {
  constructor(t) {
    this.fonts = /* @__PURE__ */ new Map(), this.cache = /* @__PURE__ */ new Map(), this.warned = /* @__PURE__ */ new Set(), this.defaultFont = null, this.add(t);
  }
  add(t, e = null) {
    for (const n of t) this.addPdfFont(n);
    for (const n of this.fonts.values()) n.regular || (n.regular = n.italic || n.bold || n.bolditalic);
    if (!e || e.size === 0) return;
    const i = this.fonts.get("PdfJS-Fallback-PdfJS-XFA");
    for (const n of e) this.fonts.set(n, i);
  }
  addPdfFont(t) {
    var o, l, c;
    const e = t.cssFontInfo, i = e.fontFamily;
    let n = this.fonts.get(i);
    n || (n = /* @__PURE__ */ Object.create(null), this.fonts.set(i, n), this.defaultFont || (this.defaultFont = n));
    let a = "";
    const r = parseFloat(e.fontWeight);
    parseFloat(e.italicAngle) !== 0 ? a = r >= 700 ? "bolditalic" : "italic" : r >= 700 && (a = "bold"), a || ((t.name.includes("Bold") || (o = t.psName) != null && o.includes("Bold")) && (a = "bold"), (t.name.includes("Italic") || t.name.endsWith("It") || (l = t.psName) != null && l.includes("Italic") || (c = t.psName) != null && c.endsWith("It")) && (a += "italic")), a || (a = "regular"), n[a] = t;
  }
  getDefault() {
    return this.defaultFont;
  }
  find(t, e = !0) {
    var o, l;
    let i = this.fonts.get(t) || this.cache.get(t);
    if (i) return i;
    const n = /,|-|_| |bolditalic|bold|italic|regular|it/gi;
    let a = t.replaceAll(n, "");
    if (i = this.fonts.get(a), i)
      return this.cache.set(t, i), i;
    a = a.toLowerCase();
    const r = [];
    for (const [c, h] of this.fonts.entries()) c.replaceAll(n, "").toLowerCase().startsWith(a) && r.push(h);
    if (r.length === 0) for (const [, c] of this.fonts.entries()) (o = c.regular.name) != null && o.replaceAll(n, "").toLowerCase().startsWith(a) && r.push(c);
    if (r.length === 0) {
      a = a.replaceAll(/psmt|mt/gi, "");
      for (const [c, h] of this.fonts.entries()) c.replaceAll(n, "").toLowerCase().startsWith(a) && r.push(h);
    }
    if (r.length === 0) for (const c of this.fonts.values()) (l = c.regular.name) != null && l.replaceAll(n, "").toLowerCase().startsWith(a) && r.push(c);
    return r.length >= 1 ? (r.length !== 1 && e && D(`XFA - Too many choices to guess the correct font: ${t}`), this.cache.set(t, r[0]), r[0]) : (e && !this.warned.has(t) && (this.warned.add(t), D(`XFA - Cannot find the font: ${t}`)), null);
  }
}
function R7(s, t) {
  return s.posture === "italic" ? s.weight === "bold" ? t.bolditalic : t.italic : s.weight === "bold" ? t.bold : t.regular;
}
class ib {
  constructor(t, e, i, n) {
    if (this.lineHeight = i, this.paraMargin = e || { top: 0, bottom: 0, left: 0, right: 0 }, !t) {
      [this.pdfFont, this.xfaFont] = this.defaultFont(n);
      return;
    }
    this.xfaFont = { typeface: t.typeface, posture: t.posture, weight: t.weight, size: t.size, letterSpacing: t.letterSpacing };
    const a = n.find(t.typeface);
    a ? (this.pdfFont = R7(t, a), this.pdfFont || ([this.pdfFont, this.xfaFont] = this.defaultFont(n))) : [this.pdfFont, this.xfaFont] = this.defaultFont(n);
  }
  defaultFont(t) {
    const e = t.find("Helvetica", !1) || t.find("Myriad Pro", !1) || t.find("Arial", !1) || t.getDefault();
    if (e != null && e.regular) {
      const i = e.regular;
      return [i, { typeface: i.cssFontInfo.fontFamily, posture: "normal", weight: "normal", size: 10, letterSpacing: 0 }];
    }
    return [null, { typeface: "Courier", posture: "normal", weight: "normal", size: 10, letterSpacing: 0 }];
  }
}
class $E {
  constructor(t, e, i, n) {
    this.fontFinder = n, this.stack = [new ib(t, e, i, n)];
  }
  pushData(t, e, i) {
    const n = this.stack.at(-1);
    for (const r of ["typeface", "posture", "weight", "size", "letterSpacing"]) t[r] || (t[r] = n.xfaFont[r]);
    for (const r of ["top", "bottom", "left", "right"]) isNaN(e[r]) && (e[r] = n.paraMargin[r]);
    const a = new ib(t, e, i || n.lineHeight, this.fontFinder);
    a.pdfFont || (a.pdfFont = n.pdfFont), this.stack.push(a);
  }
  popFont() {
    this.stack.pop();
  }
  topFont() {
    return this.stack.at(-1);
  }
}
class zE {
  constructor(t, e, i, n) {
    this.glyphs = [], this.fontSelector = new $E(t, e, i, n), this.extraHeight = 0;
  }
  pushData(t, e, i) {
    this.fontSelector.pushData(t, e, i);
  }
  popFont(t) {
    return this.fontSelector.popFont();
  }
  addPara() {
    const t = this.fontSelector.topFont();
    this.extraHeight += t.paraMargin.top + t.paraMargin.bottom;
  }
  addString(t) {
    if (!t) return;
    const e = this.fontSelector.topFont(), i = e.xfaFont.size;
    if (e.pdfFont) {
      const n = e.xfaFont.letterSpacing, a = e.pdfFont, r = a.lineHeight || 1.2, o = e.lineHeight || Math.max(1.2, r) * i, l = r - (a.lineGap === void 0 ? 0.2 : a.lineGap), c = Math.max(1, l) * i, h = i / 1e3, u = a.defaultWidth || a.charsToGlyphs(" ")[0].width;
      for (const f of t.split(/[\u2029\n]/)) {
        const d = a.encodeString(f).join(""), p = a.charsToGlyphs(d);
        for (const m of p) {
          const b = m.width || u;
          this.glyphs.push([b * h + n, o, c, m.unicode, !1]);
        }
        this.glyphs.push([0, 0, 0, `
`, !0]);
      }
      this.glyphs.pop();
    } else {
      for (const n of t.split(/[\u2029\n]/)) {
        for (const a of n.split("")) this.glyphs.push([i, 1.2 * i, i, a, !1]);
        this.glyphs.push([0, 0, 0, `
`, !0]);
      }
      this.glyphs.pop();
    }
  }
  compute(t) {
    let e = -1, i = 0, n = 0, a = 0, r = 0, o = 0, l = !1, c = !0;
    for (let h = 0, u = this.glyphs.length; h < u; h++) {
      const [f, d, p, m, b] = this.glyphs[h], y = m === " ", v = c ? p : d;
      b ? (n = Math.max(n, r), r = 0, a += o, o = v, e = -1, i = 0, c = !1) : y ? r + f > t ? (n = Math.max(n, r), r = 0, a += o, o = v, e = -1, i = 0, l = !0, c = !1) : (o = Math.max(v, o), i = r, r += f, e = h) : r + f > t ? (a += o, o = v, e !== -1 ? (h = e, n = Math.max(n, i), r = 0, e = -1, i = 0) : (n = Math.max(n, r), r = f), l = !0, c = !1) : (r += f, o = Math.max(v, o));
    }
    return n = Math.max(n, r), a += o + this.extraHeight, { width: 1.02 * n, height: a, isBroken: l };
  }
}
const nb = /^[^.[]+/, GE = /^[^\]]+/, $p = 0, zp = 1, P7 = 2, VE = 3, WE = 4, bx = /* @__PURE__ */ new Map([["$data", (s, t) => s.datasets ? s.datasets.data : s], ["$record", (s, t) => (s.datasets ? s.datasets.data : s)[xs]()[0]], ["$template", (s, t) => s.template], ["$connectionSet", (s, t) => s.connectionSet], ["$form", (s, t) => s.form], ["$layout", (s, t) => s.layout], ["$host", (s, t) => s.host], ["$dataWindow", (s, t) => s.dataWindow], ["$event", (s, t) => s.event], ["!", (s, t) => s.datasets], ["$xfa", (s, t) => s], ["xfa", (s, t) => s], ["$", (s, t) => t]]), ab = /* @__PURE__ */ new WeakMap();
function yx(s, t, e = !0) {
  let i = s.match(nb);
  if (!i) return null;
  let [n] = i;
  const a = [{ name: n, cacheName: "." + n, index: 0, js: null, formCalc: null, operator: $p }];
  let r = n.length;
  for (; r < s.length; ) {
    const l = r;
    if (s.charAt(r++) === "[") {
      if (i = s.slice(r).match(GE), !i)
        return D("XFA - Invalid index in SOM expression"), null;
      a.at(-1).index = (o = (o = i[0]).trim()) === "*" ? 1 / 0 : parseInt(o, 10) || 0, r += i[0].length + 1;
      continue;
    }
    let c;
    switch (s.charAt(r)) {
      case ".":
        if (!t) return null;
        r++, c = zp;
        break;
      case "#":
        r++, c = P7;
        break;
      case "[":
        if (e)
          return D("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."), null;
        c = VE;
        break;
      case "(":
        if (e)
          return D("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."), null;
        c = WE;
        break;
      default:
        c = $p;
    }
    if (i = s.slice(r).match(nb), !i) break;
    [n] = i, r += n.length, a.push({ name: n, cacheName: s.slice(l, r), operator: c, index: 0, js: null, formCalc: null });
  }
  var o;
  return a;
}
function ro(s, t, e, i = !0, n = !0) {
  const a = yx(e, i);
  if (!a) return null;
  const r = bx.get(a[0].name);
  let o, l = 0;
  r ? (o = !0, s = [r(s, t)], l = 1) : (o = t === null, s = [t || s]);
  for (let c = a.length; l < c; l++) {
    const { name: h, cacheName: u, operator: f, index: d } = a[l], p = [];
    for (const m of s) {
      if (!m.isXFAObject) continue;
      let b, y;
      if (n && (y = ab.get(m), y || (y = /* @__PURE__ */ new Map(), ab.set(m, y)), b = y.get(u)), !b) {
        switch (f) {
          case $p:
            b = m[b0](h, !1);
            break;
          case zp:
            b = m[b0](h, !0);
            break;
          case P7:
            b = m[tm](h), b = b.isXFAObjectArray ? b.children : [b];
        }
        n && y.set(u, b);
      }
      b.length > 0 && p.push(b);
    }
    if (p.length !== 0 || o || l !== 0) s = isFinite(d) ? p.filter((m) => d < m.length).map((m) => m[d]) : p.flat();
    else {
      if (!(t = t[Nt]())) return null;
      l = -1, s = [t];
    }
  }
  return s.length === 0 ? null : s;
}
function XE(s, t, e) {
  const i = yx(e);
  if (!i || i.some((r) => r.operator === zp)) return null;
  const n = bx.get(i[0].name);
  let a = 0;
  n ? (s = n(s, t), a = 1) : s = t || s;
  for (let r = i.length; a < r; a++) {
    const { name: o, operator: l, index: c } = i[a];
    if (!isFinite(c))
      return i[a].index = 0, s.createNodes(i.slice(a));
    let h;
    switch (l) {
      case $p:
        h = s[b0](o, !1);
        break;
      case zp:
        h = s[b0](o, !0);
        break;
      case P7:
        h = s[tm](o), h = h.isXFAObjectArray ? h.children : [h];
    }
    if (h.length === 0) return s.createNodes(i.slice(a));
    if (!(c < h.length))
      return i[a].index = c - h.length, s.createNodes(i.slice(a));
    {
      const u = h[c];
      if (!u.isXFAObject)
        return D("XFA - Cannot create a node."), null;
      s = u;
    }
  }
  return null;
}
const ig = Symbol(), wl = Symbol(), Ih = Symbol(), Ut = Symbol("_children"), qm = Symbol(), eo = Symbol(), jm = Symbol(), rb = Symbol(), Hm = Symbol(), ob = Symbol(), $m = Symbol(), Dd = Symbol(), ng = Symbol(), yn = Symbol("parent"), id = Symbol(), nd = Symbol(), zm = Symbol();
let T6 = 0;
const wx = We.datasets.id;
class tt {
  constructor(t, e, i = !1) {
    this[Ge] = t, this[ee] = e, this[$m] = i, this[yn] = null, this[Ut] = [], this[oe] = `${e}${T6++}`, this[fe] = null;
  }
  get isXFAObject() {
    return !0;
  }
  get isXFAObjectArray() {
    return !1;
  }
  createNodes(t) {
    let e = this, i = null;
    for (const { name: n, index: a } of t) {
      for (let r = 0, o = isFinite(a) ? a : 0; r <= o; r++) {
        const l = e[Ge] === wx ? -1 : e[Ge];
        i = new ja(l, n), e[Ne](i);
      }
      e = i;
    }
    return i;
  }
  [qa](t) {
    if (!this[$m] || !this[I6](t)) return !1;
    const e = t[ee], i = this[e];
    if (!(i instanceof R))
      return i !== null && this[el](i), this[e] = t, this[Ne](t), !0;
    if (i.push(t))
      return this[Ne](t), !0;
    let n = "";
    return this.id ? n = ` (id: ${this.id})` : this.name && (n = ` (name: ${this.name} ${this.h.value})`), D(`XFA - node "${this[ee]}"${n} has already enough "${e}"!`), !1;
  }
  [I6](t) {
    return this.hasOwnProperty(t[ee]) && t[Ge] === this[Ge];
  }
  [Wd]() {
    return !1;
  }
  [Q9]() {
    return !1;
  }
  [F7]() {
    return !1;
  }
  [yh]() {
    return !1;
  }
  [ki]() {
    this.para && this[ze]()[J].paraStack.pop();
  }
  [j1]() {
    this[ze]()[J].paraStack.push(this.para);
  }
  [_6](t) {
    this.id && this[Ge] === We.template.id && t.set(this.id, this);
  }
  [ze]() {
    return this[fe].template;
  }
  [qr]() {
    return !1;
  }
  [Yr]() {
    return !1;
  }
  [Ne](t) {
    t[yn] = this, this[Ut].push(t), !t[fe] && this[fe] && (t[fe] = this[fe]);
  }
  [el](t) {
    const e = this[Ut].indexOf(t);
    this[Ut].splice(e, 1);
  }
  [y0]() {
    return this.hasOwnProperty("value");
  }
  [_i](t) {
  }
  [jr](t) {
  }
  [ge]() {
  }
  [Mn](t) {
    delete this[$m], this[sp] && (t.clean(this[sp]), delete this[sp]);
  }
  [C6](t) {
    return this[Ut].indexOf(t);
  }
  [ip](t, e) {
    e[yn] = this, this[Ut].splice(t, 0, e), !e[fe] && this[fe] && (e[fe] = this[fe]);
  }
  [w0]() {
    return !this.name;
  }
  [UE]() {
    return "";
  }
  [ns]() {
    return this[Ut].length === 0 ? this[it] : this[Ut].map((t) => t[ns]()).join("");
  }
  get [Ih]() {
    const t = Object.getPrototypeOf(this);
    if (!t._attributes) {
      const e = t._attributes = /* @__PURE__ */ new Set();
      for (const i of Object.getOwnPropertyNames(this)) {
        if (this[i] === null || this[i] instanceof tt || this[i] instanceof R) break;
        e.add(i);
      }
    }
    return gt(this, Ih, t._attributes);
  }
  [co](t) {
    let e = this;
    for (; e; ) {
      if (e === t) return !0;
      e = e[Nt]();
    }
    return !1;
  }
  [Nt]() {
    return this[yn];
  }
  [Ve]() {
    return this[Nt]();
  }
  [xs](t = null) {
    return t ? this[t] : this[Ut];
  }
  [D1]() {
    const t = /* @__PURE__ */ Object.create(null);
    this[it] && (t.$content = this[it]);
    for (const e of Object.getOwnPropertyNames(this)) {
      const i = this[e];
      i !== null && (i instanceof tt ? t[e] = i[D1]() : i instanceof R ? i.isEmpty() || (t[e] = i.dump()) : t[e] = i);
    }
    return t;
  }
  [Zt]() {
    return null;
  }
  [Mt]() {
    return Ct.EMPTY;
  }
  *[N1]() {
    for (const t of this[xs]()) yield t;
  }
  *[rb](t, e) {
    for (const i of this[N1]()) if (!t || e === t.has(i[ee])) {
      const n = this[nh](), a = i[Mt](n);
      a.success || (this[J].failingNode = i), yield a;
    }
  }
  [_2]() {
    return null;
  }
  [ih](t, e) {
    this[J].children.push(t);
  }
  [nh]() {
  }
  [cl]({ filter: t = null, include: e = !0 }) {
    if (this[J].generator) {
      const i = this[nh](), n = this[J].failingNode[Mt](i);
      if (!n.success) return n;
      n.html && this[ih](n.html, n.bbox), delete this[J].failingNode;
    } else this[J].generator = this[rb](t, e);
    for (; ; ) {
      const i = this[J].generator.next();
      if (i.done) break;
      const n = i.value;
      if (!n.success) return n;
      n.html && this[ih](n.html, n.bbox);
    }
    return this[J].generator = null, Ct.EMPTY;
  }
  [px](t) {
    this[nd] = new Set(Object.keys(t));
  }
  [ob](t) {
    const e = this[Ih], i = this[nd];
    return [...t].filter((n) => e.has(n) && !i.has(n));
  }
  [Pd](t, e = /* @__PURE__ */ new Set()) {
    for (const i of this[Ut]) i[id](t, e);
  }
  [id](t, e) {
    const i = this[Hm](t, e);
    i ? this[ig](i, t, e) : this[Pd](t, e);
  }
  [Hm](t, e) {
    const { use: i, usehref: n } = this;
    if (!i && !n) return null;
    let a = null, r = null, o = null, l = i;
    if (n ? (l = n, n.startsWith("#som(") && n.endsWith(")") ? r = n.slice(5, -1) : n.startsWith(".#som(") && n.endsWith(")") ? r = n.slice(6, -1) : n.startsWith("#") ? o = n.slice(1) : n.startsWith(".#") && (o = n.slice(2))) : i.startsWith("#") ? o = i.slice(1) : r = i, this.use = this.usehref = "", o ? a = t.get(o) : (a = ro(t.get(gx), this, r, !0, !1), a && (a = a[0])), !a)
      return D(`XFA - Invalid prototype reference: ${l}.`), null;
    if (a[ee] !== this[ee])
      return D(`XFA - Incompatible prototype: ${a[ee]} !== ${this[ee]}.`), null;
    if (e.has(a))
      return D("XFA - Cycle detected in prototypes use."), null;
    e.add(a);
    const c = a[Hm](t, e);
    return c && a[ig](c, t, e), a[Pd](t, e), e.delete(a), a;
  }
  [ig](t, e, i) {
    if (i.has(t)) {
      D("XFA - Cycle detected in prototypes use.");
      return;
    }
    !this[it] && t[it] && (this[it] = t[it]), new Set(i).add(t);
    for (const n of this[ob](t[nd]))
      this[n] = t[n], this[nd] && this[nd].add(n);
    for (const n of Object.getOwnPropertyNames(this)) {
      if (this[Ih].has(n)) continue;
      const a = this[n], r = t[n];
      if (a instanceof R) {
        for (const o of a[Ut]) o[id](e, i);
        for (let o = a[Ut].length, l = r[Ut].length; o < l; o++) {
          const c = t[Ut][o][Qn]();
          if (!a.push(c)) break;
          c[yn] = this, this[Ut].push(c), c[id](e, i);
        }
      } else if (a === null) {
        if (r !== null) {
          const o = r[Qn]();
          o[yn] = this, this[n] = o, this[Ut].push(o), o[id](e, i);
        }
      } else
        a[Pd](e, i), r && a[ig](r, e, i);
    }
  }
  static [qm](t) {
    return Array.isArray(t) ? t.map((e) => tt[qm](e)) : typeof t == "object" && t !== null ? Object.assign({}, t) : t;
  }
  [Qn]() {
    const t = Object.create(Object.getPrototypeOf(this));
    for (const e of Object.getOwnPropertySymbols(this)) try {
      t[e] = this[e];
    } catch {
      gt(t, e, this[e]);
    }
    t[oe] = `${t[ee]}${T6++}`, t[Ut] = [];
    for (const e of Object.getOwnPropertyNames(this)) {
      if (this[Ih].has(e)) {
        t[e] = tt[qm](this[e]);
        continue;
      }
      const i = this[e];
      t[e] = i instanceof R ? new R(i[Dd]) : null;
    }
    for (const e of this[Ut]) {
      const i = e[ee], n = e[Qn]();
      t[Ut].push(n), n[yn] = t, t[i] === null ? t[i] = n : t[i][Ut].push(n);
    }
    return t;
  }
  [xs](t = null) {
    return t ? this[Ut].filter((e) => e[ee] === t) : this[Ut];
  }
  [tm](t) {
    return this[t];
  }
  [b0](t, e, i = !0) {
    return Array.from(this[Gd](t, e, i));
  }
  *[Gd](t, e, i = !0) {
    if (t !== "parent") {
      for (const n of this[Ut])
        n[ee] === t && (yield n), n.name === t && (yield n), (e || n[w0]()) && (yield* n[Gd](t, e, !1));
      i && this[Ih].has(t) && (yield new D7(this, t, this[t]));
    } else yield this[yn];
  }
}
class R {
  constructor(t = 1 / 0) {
    this[Dd] = t, this[Ut] = [];
  }
  get isXFAObject() {
    return !1;
  }
  get isXFAObjectArray() {
    return !0;
  }
  push(t) {
    return this[Ut].length <= this[Dd] ? (this[Ut].push(t), !0) : (D(`XFA - node "${t[ee]}" accepts no more than ${this[Dd]} children`), !1);
  }
  isEmpty() {
    return this[Ut].length === 0;
  }
  dump() {
    return this[Ut].length === 1 ? this[Ut][0][D1]() : this[Ut].map((t) => t[D1]());
  }
  [Qn]() {
    const t = new R(this[Dd]);
    return t[Ut] = this[Ut].map((e) => e[Qn]()), t;
  }
  get children() {
    return this[Ut];
  }
  clear() {
    this[Ut].length = 0;
  }
}
class D7 {
  constructor(t, e, i) {
    this[yn] = t, this[ee] = e, this[it] = i, this[La] = !1, this[oe] = "attribute" + T6++;
  }
  [Nt]() {
    return this[yn];
  }
  [Gh]() {
    return !0;
  }
  [M7]() {
    return this[it].trim();
  }
  [_i](t) {
    t = t.value || "", this[it] = t.toString();
  }
  [ns]() {
    return this[it];
  }
  [co](t) {
    return this[yn] === t || this[yn][co](t);
  }
}
class ja extends tt {
  constructor(t, e, i = {}) {
    if (super(t, e), this[it] = "", this[eo] = null, e !== "#text") {
      const n = /* @__PURE__ */ new Map();
      this[wl] = n;
      for (const [a, r] of Object.entries(i)) n.set(a, new D7(this, a, r));
      if (i.hasOwnProperty(Lr)) {
        const a = i[Lr].xfa.dataNode;
        a !== void 0 && (a === "dataGroup" ? this[eo] = !1 : a === "dataValue" && (this[eo] = !0));
      }
    }
    this[La] = !1;
  }
  [Xd](t) {
    const e = this[ee];
    if (e === "#text") {
      t.push(nu(this[it]));
      return;
    }
    const i = O3(e), n = this[Ge] === wx ? "xfa:" : "";
    t.push(`<${n}${i}`);
    for (const [a, r] of this[wl].entries()) {
      const o = O3(a);
      t.push(` ${o}="${nu(r[it])}"`);
    }
    if (this[eo] !== null && (this[eo] ? t.push(' xfa:dataNode="dataValue"') : t.push(' xfa:dataNode="dataGroup"')), this[it] || this[Ut].length !== 0) {
      if (t.push(">"), this[it]) typeof this[it] == "string" ? t.push(nu(this[it])) : this[it][Xd](t);
      else for (const a of this[Ut]) a[Xd](t);
      t.push(`</${n}${i}>`);
    } else t.push("/>");
  }
  [qa](t) {
    if (this[it]) {
      const e = new ja(this[Ge], "#text");
      this[Ne](e), e[it] = this[it], this[it] = "";
    }
    return this[Ne](t), !0;
  }
  [jr](t) {
    this[it] += t;
  }
  [ge]() {
    if (this[it] && this[Ut].length > 0) {
      const t = new ja(this[Ge], "#text");
      this[Ne](t), t[it] = this[it], delete this[it];
    }
  }
  [Mt]() {
    return this[ee] === "#text" ? Ct.success({ name: "#text", value: this[it] }) : Ct.EMPTY;
  }
  [xs](t = null) {
    return t ? this[Ut].filter((e) => e[ee] === t) : this[Ut];
  }
  [fx]() {
    return this[wl];
  }
  [tm](t) {
    const e = this[wl].get(t);
    return e !== void 0 ? e : this[xs](t);
  }
  *[Gd](t, e) {
    const i = this[wl].get(t);
    i && (yield i);
    for (const n of this[Ut])
      n[ee] === t && (yield n), e && (yield* n[Gd](t, e));
  }
  *[S6](t, e) {
    const i = this[wl].get(t);
    !i || e && i[La] || (yield i);
    for (const n of this[Ut]) yield* n[S6](t, e);
  }
  *[Vd](t, e, i) {
    for (const n of this[Ut])
      n[ee] !== t || i && n[La] || (yield n), e && (yield* n[Vd](t, e, i));
  }
  [Gh]() {
    return this[eo] === null ? this[Ut].length === 0 || this[Ut][0][Ge] === We.xhtml.id : this[eo];
  }
  [M7]() {
    return this[eo] === null ? this[Ut].length === 0 ? this[it].trim() : this[Ut][0][Ge] === We.xhtml.id ? this[Ut][0][ns]().trim() : null : this[it].trim();
  }
  [_i](t) {
    t = t.value || "", this[it] = t.toString();
  }
  [D1](t = !1) {
    const e = /* @__PURE__ */ Object.create(null);
    t && (e.$ns = this[Ge]), this[it] && (e.$content = this[it]), e.$name = this[ee], e.children = [];
    for (const i of this[Ut]) e.children.push(i[D1](t));
    e.attributes = /* @__PURE__ */ Object.create(null);
    for (const [i, n] of this[wl]) e.attributes[i] = n[it];
    return e;
  }
}
class Oe extends tt {
  constructor(t, e) {
    super(t, e), this[it] = "";
  }
  [jr](t) {
    this[it] += t;
  }
  [ge]() {
  }
}
class le extends Oe {
  constructor(t, e, i) {
    super(t, e), this[ng] = i;
  }
  [ge]() {
    this[it] = sm({ data: this[it], defaultValue: this[ng][0], validate: (t) => this[ng].includes(t) });
  }
  [Mn](t) {
    super[Mn](t), delete this[ng];
  }
}
class jt extends Oe {
  [ge]() {
    this[it] = this[it].trim();
  }
}
class ha extends Oe {
  constructor(t, e, i, n) {
    super(t, e), this[jm] = i, this[zm] = n;
  }
  [ge]() {
    this[it] = Pt({ data: this[it], defaultValue: this[jm], validate: this[zm] });
  }
  [Mn](t) {
    super[Mn](t), delete this[jm], delete this[zm];
  }
}
class rs extends ha {
  constructor(t, e) {
    super(t, e, 0, (i) => i === 1);
  }
}
class vx extends ha {
  constructor(t, e) {
    super(t, e, 1, (i) => i === 0);
  }
}
function Rt(s) {
  return typeof s == "string" ? "0px" : Number.isInteger(s) ? `${s}px` : `${s.toFixed(2)}px`;
}
const lb = { anchorType(s, t) {
  const e = s[Ve]();
  if (e && (!e.layout || e.layout === "position"))
    switch ("transform" in t || (t.transform = ""), s.anchorType) {
      case "bottomCenter":
        t.transform += "translate(-50%, -100%)";
        break;
      case "bottomLeft":
        t.transform += "translate(0,-100%)";
        break;
      case "bottomRight":
        t.transform += "translate(-100%,-100%)";
        break;
      case "middleCenter":
        t.transform += "translate(-50%,-50%)";
        break;
      case "middleLeft":
        t.transform += "translate(0,-50%)";
        break;
      case "middleRight":
        t.transform += "translate(-100%,-50%)";
        break;
      case "topCenter":
        t.transform += "translate(-50%,0)";
        break;
      case "topRight":
        t.transform += "translate(-100%,0)";
    }
}, dimensions(s, t) {
  var a;
  const e = s[Ve]();
  let i = s.w;
  const n = s.h;
  if ((a = e.layout) != null && a.includes("row")) {
    const r = e[J], o = s.colSpan;
    let l;
    o === -1 ? (l = Math.sumPrecise(r.columnWidths.slice(r.currentColumn)), r.currentColumn = 0) : (l = Math.sumPrecise(r.columnWidths.slice(r.currentColumn, r.currentColumn + o)), r.currentColumn = (r.currentColumn + s.colSpan) % r.columnWidths.length), isNaN(l) || (i = s.w = l);
  }
  t.width = i !== "" ? Rt(i) : "auto", t.height = n !== "" ? Rt(n) : "auto";
}, position(s, t) {
  const e = s[Ve]();
  (!(e != null && e.layout) || e.layout === "position") && (t.position = "absolute", t.left = Rt(s.x), t.top = Rt(s.y));
}, rotate(s, t) {
  s.rotate && ("transform" in t || (t.transform = ""), t.transform += `rotate(-${s.rotate}deg)`, t.transformOrigin = "top left");
}, presence(s, t) {
  switch (s.presence) {
    case "invisible":
      t.visibility = "hidden";
      break;
    case "hidden":
    case "inactive":
      t.display = "none";
  }
}, hAlign(s, t) {
  if (s[ee] === "para") switch (s.hAlign) {
    case "justifyAll":
      t.textAlign = "justify-all";
      break;
    case "radix":
      t.textAlign = "left";
      break;
    default:
      t.textAlign = s.hAlign;
  }
  else switch (s.hAlign) {
    case "left":
      t.alignSelf = "start";
      break;
    case "center":
      t.alignSelf = "center";
      break;
    case "right":
      t.alignSelf = "end";
  }
}, margin(s, t) {
  s.margin && (t.margin = s.margin[Zt]().margin);
} };
function Ax(s, t) {
  s[Ve]().layout === "position" && (s.minW > 0 && (t.minWidth = Rt(s.minW)), s.maxW > 0 && (t.maxWidth = Rt(s.maxW)), s.minH > 0 && (t.minHeight = Rt(s.minH)), s.maxH > 0 && (t.maxHeight = Rt(s.maxH)));
}
function cb(s, t, e, i, n, a) {
  const r = new zE(t, e, i, n);
  return typeof s == "string" ? r.addString(s) : s[Ga](r), r.compute(a);
}
function N7(s, t) {
  let e = null, i = null, n = !1;
  if ((!s.w || !s.h) && s.value) {
    let a = 0, r = 0;
    s.margin && (a = s.margin.leftInset + s.margin.rightInset, r = s.margin.topInset + s.margin.bottomInset);
    let o = null, l = null;
    s.para && (l = /* @__PURE__ */ Object.create(null), o = s.para.lineHeight === "" ? null : s.para.lineHeight, l.top = s.para.spaceAbove === "" ? 0 : s.para.spaceAbove, l.bottom = s.para.spaceBelow === "" ? 0 : s.para.spaceBelow, l.left = s.para.marginLeft === "" ? 0 : s.para.marginLeft, l.right = s.para.marginRight === "" ? 0 : s.para.marginRight);
    let c = s.font;
    if (!c) {
      const f = s[ze]();
      let d = s[Nt]();
      for (; d && d !== f; ) {
        if (d.font) {
          c = d.font;
          break;
        }
        d = d[Nt]();
      }
    }
    const h = (s.w || t.width) - a, u = s[fe].fontFinder;
    if (s.value.exData && s.value.exData[it] && s.value.exData.contentType === "text/html") {
      const f = cb(s.value.exData[it], c, l, o, u, h);
      i = f.width, e = f.height, n = f.isBroken;
    } else {
      const f = s.value[ns]();
      if (f) {
        const d = cb(f, c, l, o, u, h);
        i = d.width, e = d.height, n = d.isBroken;
      }
    }
    i === null || s.w || (i += a), e === null || s.h || (e += r);
  }
  return { w: i, h: e, isBroken: n };
}
function xx(s, t, e) {
  let i;
  if (s.w !== "" && s.h !== "") i = [s.x, s.y, s.w, s.h];
  else {
    if (!e) return null;
    let n = s.w;
    if (n === "") {
      if (s.maxW === 0) {
        const r = s[Ve]();
        n = r.layout === "position" && r.w !== "" ? 0 : s.minW;
      } else n = Math.min(s.maxW, e.width);
      t.attributes.style.width = Rt(n);
    }
    let a = s.h;
    if (a === "") {
      if (s.maxH === 0) {
        const r = s[Ve]();
        a = r.layout === "position" && r.h !== "" ? 0 : s.minH;
      } else a = Math.min(s.maxH, e.height);
      t.attributes.style.height = Rt(a);
    }
    i = [s.x, s.y, n, a];
  }
  return i;
}
function im(s) {
  var e;
  const t = s[Ve]();
  if ((e = t.layout) != null && e.includes("row")) {
    const i = t[J], n = s.colSpan;
    let a;
    a = n === -1 ? Math.sumPrecise(i.columnWidths.slice(i.currentColumn)) : Math.sumPrecise(i.columnWidths.slice(i.currentColumn, i.currentColumn + n)), isNaN(a) || (s.w = a);
  }
  t.layout && t.layout !== "position" && (s.x = s.y = 0), s.layout === "table" && s.w === "" && Array.isArray(s.columnWidths) && (s.w = Math.sumPrecise(s.columnWidths));
}
function kx(s) {
  switch (s.layout) {
    case "position":
    default:
      return "xfaPosition";
    case "lr-tb":
      return "xfaLrTb";
    case "rl-row":
      return "xfaRlRow";
    case "rl-tb":
      return "xfaRlTb";
    case "row":
      return "xfaRow";
    case "table":
      return "xfaTable";
    case "tb":
      return "xfaTb";
  }
}
function pi(s, ...t) {
  const e = /* @__PURE__ */ Object.create(null);
  for (const i of t) {
    const n = s[i];
    if (n !== null) {
      if (lb.hasOwnProperty(i)) lb[i](s, e);
      else if (n instanceof tt) {
        const a = n[Zt]();
        a ? Object.assign(e, a) : D(`(DEBUG) - XFA - style for ${i} not implemented yet`);
      }
    }
  }
  return e;
}
function ah(s, t) {
  const { attributes: e } = t, { style: i } = e, n = { name: "div", attributes: { class: ["xfaWrapper"], style: /* @__PURE__ */ Object.create(null) }, children: [] };
  if (e.class.push("xfaWrapped"), s.border) {
    const { widths: a, insets: r } = s.border[J];
    let o, l, c = r[0], h = r[3];
    const u = r[0] + r[2], f = r[1] + r[3];
    switch (s.border.hand) {
      case "even":
        c -= a[0] / 2, h -= a[3] / 2, o = `calc(100% + ${(a[1] + a[3]) / 2 - f}px)`, l = `calc(100% + ${(a[0] + a[2]) / 2 - u}px)`;
        break;
      case "left":
        c -= a[0], h -= a[3], o = `calc(100% + ${a[1] + a[3] - f}px)`, l = `calc(100% + ${a[0] + a[2] - u}px)`;
        break;
      case "right":
        o = f ? `calc(100% - ${f}px)` : "100%", l = u ? `calc(100% - ${u}px)` : "100%";
    }
    const d = ["xfaBorder"];
    H1(s.border) && d.push("xfaPrintOnly");
    const p = { name: "div", attributes: { class: d, style: { top: `${c}px`, left: `${h}px`, width: o, height: l } }, children: [] };
    for (const m of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) i[m] !== void 0 && (p.attributes.style[m] = i[m], delete i[m]);
    n.children.push(p, t);
  } else n.children.push(t);
  for (const a of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) i[a] !== void 0 && (n.attributes.style[a] = i[a], delete i[a]);
  return n.attributes.style.position = i.position === "absolute" ? "absolute" : "relative", delete i.position, i.alignSelf && (n.attributes.style.alignSelf = i.alignSelf, delete i.alignSelf), n;
}
function Sx(s) {
  const t = At(s.textIndent, "0px");
  if (t >= 0) return;
  const e = "padding" + ((s.textAlign === "right" ? "right" : "left") == "left" ? "Left" : "Right"), i = At(s[e], "0px");
  s[e] = i - t + "px";
}
function B7(s, t) {
  switch (s.access) {
    case "nonInteractive":
      t.push("xfaNonInteractive");
      break;
    case "readOnly":
      t.push("xfaReadOnly");
      break;
    case "protected":
      t.push("xfaDisabled");
  }
}
function H1(s) {
  return s.relevant.length > 0 && !s.relevant[0].excluded && s.relevant[0].viewname === "print";
}
function Cx(s) {
  const t = s[ze]()[J].paraStack;
  return t.length ? t.at(-1) : null;
}
function Ix(s, t, e) {
  var i;
  if ((i = e.attributes.class) != null && i.includes("xfaRich")) {
    t && (s.h === "" && (t.height = "auto"), s.w === "" && (t.width = "auto"));
    const n = Cx(s);
    if (n) {
      const a = e.attributes.style;
      switch (a.display = "flex", a.flexDirection = "column", n.vAlign) {
        case "top":
          a.justifyContent = "start";
          break;
        case "bottom":
          a.justifyContent = "end";
          break;
        case "middle":
          a.justifyContent = "center";
      }
      const r = n[Zt]();
      for (const [o, l] of Object.entries(r)) o in a || (a[o] = l);
    }
  }
}
function _x(s, t, e, i) {
  if (!e) {
    delete i.fontFamily;
    return;
  }
  const n = em(s.typeface);
  i.fontFamily = `"${n}"`;
  const a = e.find(n);
  if (a) {
    const { fontFamily: r } = a.regular.cssFontInfo;
    r !== n && (i.fontFamily = `"${r}"`);
    const o = Cx(t);
    if (o && o.lineHeight !== "" || i.lineHeight) return;
    const l = R7(s, a);
    l && (i.lineHeight = Math.max(1.2, l.lineHeight));
  }
}
function Tx(s) {
  const t = Rp(s, null, { addDefaultProtocol: !0, tryConvertEncoding: !0 });
  return t ? t.href : null;
}
function Ex(s, t) {
  return { name: "div", attributes: { class: [s.layout === "lr-tb" ? "xfaLr" : "xfaRl"] }, children: t };
}
function Mx(s) {
  if (!s[J]) return null;
  const t = { name: "div", attributes: s[J].attributes, children: s[J].children };
  if (s[J].failingNode) {
    const e = s[J].failingNode[_2]();
    e && (s.layout.endsWith("-tb") ? t.children.push(Ex(s, [e])) : t.children.push(e));
  }
  return t.children.length === 0 ? null : t;
}
function Fx(s, t, e) {
  const i = s[J], n = i.availableSpace, [a, r, o, l] = e;
  switch (s.layout) {
    case "position":
      i.width = Math.max(i.width, a + o), i.height = Math.max(i.height, r + l), i.children.push(t);
      break;
    case "lr-tb":
    case "rl-tb":
      (!i.line || i.attempt === 1) && (i.line = Ex(s, []), i.children.push(i.line), i.numberInLine = 0), i.numberInLine += 1, i.line.children.push(t), i.attempt === 0 ? (i.currentWidth += o, i.height = Math.max(i.height, i.prevHeight + l)) : (i.currentWidth = o, i.prevHeight = i.height, i.height += l, i.attempt = 0), i.width = Math.max(i.width, i.currentWidth);
      break;
    case "rl-row":
    case "row": {
      i.children.push(t), i.width += o, i.height = Math.max(i.height, l);
      const c = Rt(i.height);
      for (const h of i.children) h.attributes.style.height = c;
      break;
    }
    case "table":
    case "tb":
      i.width = Bs(o, i.width, n.width), i.height += l, i.children.push(t);
  }
}
function Rx(s) {
  const t = s[J].availableSpace, e = s.margin ? s.margin.topInset + s.margin.bottomInset : 0, i = s.margin ? s.margin.leftInset + s.margin.rightInset : 0;
  switch (s.layout) {
    case "lr-tb":
    case "rl-tb":
      return s[J].attempt === 0 ? { width: t.width - i - s[J].currentWidth, height: t.height - e - s[J].prevHeight } : { width: t.width - i, height: t.height - e - s[J].height };
    case "rl-row":
    case "row":
      return { width: Math.sumPrecise(s[J].columnWidths.slice(s[J].currentColumn)), height: t.height - i };
    case "table":
    case "tb":
      return { width: t.width - i, height: t.height - e - s[J].height };
    default:
      return t;
  }
}
function nm(s, t) {
  var o;
  if (s[ze]()[J].firstUnsplittable === null || s.w === 0 || s.h === 0) return !0;
  const e = s[Ve](), i = ((o = e[J]) == null ? void 0 : o.attempt) || 0, [, n, a, r] = function(c) {
    let h, u, f = c.w === "" ? NaN : c.w, d = c.h === "" ? NaN : c.h, [p, m] = [0, 0];
    switch (c.anchorType || "") {
      case "bottomCenter":
        [p, m] = [f / 2, d];
        break;
      case "bottomLeft":
        [p, m] = [0, d];
        break;
      case "bottomRight":
        [p, m] = [f, d];
        break;
      case "middleCenter":
        [p, m] = [f / 2, d / 2];
        break;
      case "middleLeft":
        [p, m] = [0, d / 2];
        break;
      case "middleRight":
        [p, m] = [f, d / 2];
        break;
      case "topCenter":
        [p, m] = [f / 2, 0];
        break;
      case "topRight":
        [p, m] = [f, 0];
    }
    switch (c.rotate || 0) {
      case 0:
        [h, u] = [-p, -m];
        break;
      case 90:
        [h, u] = [-m, p], [f, d] = [d, -f];
        break;
      case 180:
        [h, u] = [p, m], [f, d] = [-f, -d];
        break;
      case 270:
        [h, u] = [m, -p], [f, d] = [-d, f];
    }
    return [c.x + h + Math.min(0, f), c.y + u + Math.min(0, d), Math.abs(f), Math.abs(d)];
  }(s);
  switch (e.layout) {
    case "lr-tb":
    case "rl-tb":
      return i === 0 ? s[ze]()[J].noLayoutFailure ? s.w !== "" ? Math.round(a - t.width) <= 2 : t.width > 2 : !(s.h !== "" && Math.round(r - t.height) > 2) && (s.w !== "" ? Math.round(a - t.width) <= 2 || e[J].numberInLine === 0 && t.height > 2 : t.width > 2) : !!s[ze]()[J].noLayoutFailure || !(s.h !== "" && Math.round(r - t.height) > 2) && (s.w === "" || Math.round(a - t.width) <= 2 || !e[Yr]()) && t.height > 2;
    case "table":
    case "tb":
      return !!s[ze]()[J].noLayoutFailure || (s.h === "" || s[qr]() ? (s.w === "" || Math.round(a - t.width) <= 2 || !e[Yr]()) && t.height > 2 : Math.round(r - t.height) <= 2);
    case "position":
      return s[ze]()[J].noLayoutFailure || s.h === "" || Math.round(r + n - t.height) <= 2 ? !0 : r + n > s[ze]()[J].currentContentArea.h;
    case "rl-row":
    case "row":
      return !!s[ze]()[J].noLayoutFailure || s.h === "" || Math.round(r - t.height) <= 2;
    default:
      return !0;
  }
}
const mt = We.template.id, rh = "http://www.w3.org/2000/svg", KE = /^H(\d+)$/, YE = /* @__PURE__ */ new Set(["image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/png", "image/apng", "image/x-png", "image/bmp", "image/x-ms-bmp", "image/tiff", "image/tif", "application/octet-stream"]), JE = [[[66, 77], "image/bmp"], [[255, 216, 255], "image/jpeg"], [[73, 73, 42, 0], "image/tiff"], [[77, 77, 0, 42], "image/tiff"], [[71, 73, 70, 56, 57, 97], "image/gif"], [[137, 80, 78, 71, 13, 10, 26, 10], "image/png"]];
function hb(s) {
  if (!s || !s.border) return { w: 0, h: 0 };
  const t = s.border[Ls]();
  return t ? { w: t.widths[0] + t.widths[2] + t.insets[0] + t.insets[2], h: t.widths[1] + t.widths[3] + t.insets[1] + t.insets[3] } : { w: 0, h: 0 };
}
function L7(s) {
  return s.margin && (s.margin.topInset || s.margin.rightInset || s.margin.bottomInset || s.margin.leftInset);
}
function O7(s, t) {
  if (!s.value) {
    const e = new G7({});
    s[Ne](e), s.value = e;
  }
  s.value[_i](t);
}
function* U7(s) {
  for (const t of s[xs]()) t instanceof H7 ? yield* t[N1]() : yield t;
}
function T2(s) {
  var t;
  return ((t = s.validate) == null ? void 0 : t.nullTest) === "error";
}
function am(s) {
  for (; s; ) {
    if (!s.traversal) {
      s[Jn] = s[Nt]()[Jn];
      return;
    }
    if (s[Jn]) return;
    let t = null;
    for (const n of s.traversal[xs]()) if (n.operation === "next") {
      t = n;
      break;
    }
    if (!t || !t.ref) {
      s[Jn] = s[Nt]()[Jn];
      return;
    }
    const e = s[ze]();
    s[Jn] = ++e[Jn];
    const i = e[Or](t.ref, s);
    if (!i) return;
    s = i[0];
  }
}
function rm(s, t) {
  var i;
  const e = s.assist;
  if (e) {
    const n = e[Mt]();
    n && (t.title = n);
    const a = e.role.match(KE);
    if (a) {
      const r = "heading", o = a[1];
      t.role = r, t["aria-level"] = o;
    }
  }
  if (s.layout === "table") t.role = "table";
  else if (s.layout === "row") t.role = "row";
  else {
    const n = s[Nt]();
    n.layout === "row" && (t.role = ((i = n.assist) == null ? void 0 : i.role) === "TH" ? "columnheader" : "cell");
  }
}
function dh(s) {
  if (!s.assist) return null;
  const t = s.assist;
  return t.speak && t.speak[it] !== "" ? t.speak[it] : t.toolTip ? t.toolTip[it] : null;
}
function fl(s) {
  return Ct.success({ name: "div", attributes: { class: ["xfaRich"], style: /* @__PURE__ */ Object.create(null) }, children: [{ name: "span", attributes: { style: /* @__PURE__ */ Object.create(null) }, value: s }] });
}
function om(s) {
  const t = s[ze]();
  t[J].firstUnsplittable === null && (t[J].firstUnsplittable = s, t[J].noLayoutFailure = !0);
}
function lm(s) {
  const t = s[ze]();
  t[J].firstUnsplittable === s && (t[J].noLayoutFailure = !1);
}
function ub(s) {
  if (s[J] || (s[J] = /* @__PURE__ */ Object.create(null), s.targetType === "auto")) return !1;
  const t = s[ze]();
  let e = null;
  if (s.target) {
    if (e = t[Or](s.target, s[Nt]()), !e) return !1;
    e = e[0];
  }
  const { currentPageArea: i, currentContentArea: n } = t[J];
  if (s.targetType === "pageArea")
    return e instanceof B1 || (e = null), s.startNew ? (s[J].target = e || i, !0) : e && e !== i ? (s[J].target = e, !0) : !1;
  e instanceof q7 || (e = null);
  const a = e && e[Nt]();
  let r, o = a;
  if (s.startNew) if (e) {
    const l = a.contentArea.children, c = l.indexOf(n), h = l.indexOf(e);
    c !== -1 && c < h && (o = null), r = h - 1;
  } else r = i.contentArea.children.indexOf(n);
  else {
    if (!e || e === n) return !1;
    r = a.contentArea.children.indexOf(e) - 1, o = a === i ? null : a;
  }
  return s[J].target = o, s[J].index = r, !0;
}
function db(s, t, e) {
  const i = s[ze](), n = i[J].noLayoutFailure, a = t[Ve];
  t[Ve] = () => s, i[J].noLayoutFailure = !0;
  const r = t[Mt](e);
  s[ih](r.html, r.bbox), i[J].noLayoutFailure = n, t[Ve] = a;
}
class ZE extends jt {
  constructor(t) {
    super(mt, "appearanceFilter"), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class Px extends tt {
  constructor(t) {
    super(mt, "arc", !0), this.circular = Pt({ data: t.circular, defaultValue: 0, validate: (e) => e === 1 }), this.hand = at(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.startAngle = Hp({ data: t.startAngle, defaultValue: 0, validate: (e) => !0 }), this.sweepAngle = Hp({ data: t.sweepAngle, defaultValue: 360, validate: (e) => !0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.edge = null, this.fill = null;
  }
  [Mt]() {
    var o;
    const t = this.edge || new E2({}), e = t[Zt](), i = /* @__PURE__ */ Object.create(null);
    ((o = this.fill) == null ? void 0 : o.presence) === "visible" ? Object.assign(i, this.fill[Zt]()) : i.fill = "transparent", i.strokeWidth = Rt(t.presence === "visible" ? t.thickness : 0), i.stroke = e.color;
    let n;
    const a = { xmlns: rh, style: { width: "100%", height: "100%", overflow: "visible" } };
    if (this.sweepAngle === 360) n = { name: "ellipse", attributes: { xmlns: rh, cx: "50%", cy: "50%", rx: "50%", ry: "50%", style: i } };
    else {
      const l = this.startAngle * Math.PI / 180, c = this.sweepAngle * Math.PI / 180, h = this.sweepAngle > 180 ? 1 : 0, [u, f, d, p] = [50 * (1 + Math.cos(l)), 50 * (1 - Math.sin(l)), 50 * (1 + Math.cos(l + c)), 50 * (1 - Math.sin(l + c))];
      n = { name: "path", attributes: { xmlns: rh, d: `M ${u} ${f} A 50 50 0 ${h} 0 ${d} ${p}`, vectorEffect: "non-scaling-stroke", style: i } }, Object.assign(a, { viewBox: "0 0 100 100", preserveAspectRatio: "none" });
    }
    const r = { name: "svg", children: [n], attributes: a };
    return L7(this[Nt]()[Nt]()) ? Ct.success({ name: "div", attributes: { style: { display: "inline", width: "100%", height: "100%" } }, children: [r] }) : (r.attributes.style.position = "absolute", Ct.success(r));
  }
}
class QE extends tt {
  constructor(t) {
    super(mt, "area", !0), this.colSpan = Pt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.id = t.id || "", this.name = t.name || "", this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.x = At(t.x, "0pt"), this.y = At(t.y, "0pt"), this.desc = null, this.extras = null, this.area = new R(), this.draw = new R(), this.exObject = new R(), this.exclGroup = new R(), this.field = new R(), this.subform = new R(), this.subformSet = new R();
  }
  *[N1]() {
    yield* U7(this);
  }
  [w0]() {
    return !0;
  }
  [yh]() {
    return !0;
  }
  [ih](t, e) {
    const [i, n, a, r] = e;
    this[J].width = Math.max(this[J].width, i + a), this[J].height = Math.max(this[J].height, n + r), this[J].children.push(t);
  }
  [nh]() {
    return this[J].availableSpace;
  }
  [Mt](t) {
    const e = pi(this, "position"), i = { style: e, id: this[oe], class: ["xfaArea"] };
    H1(this) && i.class.push("xfaPrintOnly"), this.name && (i.xfaName = this.name);
    const n = [];
    this[J] = { children: n, width: 0, height: 0, availableSpace: t };
    const a = this[cl]({ filter: /* @__PURE__ */ new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]), include: !0 });
    if (!a.success)
      return a.isBreak() ? a : (delete this[J], Ct.FAILURE);
    e.width = Rt(this[J].width), e.height = Rt(this[J].height);
    const r = { name: "div", attributes: i, children: n }, o = [this.x, this.y, this[J].width, this[J].height];
    return delete this[J], Ct.success(r, o);
  }
}
class tM extends tt {
  constructor(t) {
    super(mt, "assist", !0), this.id = t.id || "", this.role = t.role || "", this.use = t.use || "", this.usehref = t.usehref || "", this.speak = null, this.toolTip = null;
  }
  [Mt]() {
    var t;
    return ((t = this.toolTip) == null ? void 0 : t[it]) || null;
  }
}
class eM extends tt {
  constructor(t) {
    super(mt, "barcode", !0), this.charEncoding = sm({ data: t.charEncoding ? t.charEncoding.toLowerCase() : "", defaultValue: "", validate: (e) => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(e) || e.match(/iso-8859-\d{2}/) }), this.checksum = at(t.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]), this.dataColumnCount = Pt({ data: t.dataColumnCount, defaultValue: -1, validate: (e) => e >= 0 }), this.dataLength = Pt({ data: t.dataLength, defaultValue: -1, validate: (e) => e >= 0 }), this.dataPrep = at(t.dataPrep, ["none", "flateCompress"]), this.dataRowCount = Pt({ data: t.dataRowCount, defaultValue: -1, validate: (e) => e >= 0 }), this.endChar = t.endChar || "", this.errorCorrectionLevel = Pt({ data: t.errorCorrectionLevel, defaultValue: -1, validate: (e) => e >= 0 && e <= 8 }), this.id = t.id || "", this.moduleHeight = At(t.moduleHeight, "5mm"), this.moduleWidth = At(t.moduleWidth, "0.25mm"), this.printCheckDigit = Pt({ data: t.printCheckDigit, defaultValue: 0, validate: (e) => e === 1 }), this.rowColumnRatio = sb(t.rowColumnRatio), this.startChar = t.startChar || "", this.textLocation = at(t.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]), this.truncate = Pt({ data: t.truncate, defaultValue: 0, validate: (e) => e === 1 }), this.type = at(t.type ? t.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]), this.upsMode = at(t.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]), this.use = t.use || "", this.usehref = t.usehref || "", this.wideNarrowRatio = sb(t.wideNarrowRatio), this.encrypt = null, this.extras = null;
  }
}
class sM extends tt {
  constructor(t) {
    super(mt, "bind", !0), this.match = at(t.match, ["once", "dataRef", "global", "none"]), this.ref = t.ref || "", this.picture = null;
  }
}
class E6 extends tt {
  constructor(t) {
    super(mt, "bindItems"), this.connection = t.connection || "", this.labelRef = t.labelRef || "", this.ref = t.ref || "", this.valueRef = t.valueRef || "";
  }
}
class iM extends tt {
  constructor(t) {
    super(mt, "bookend"), this.id = t.id || "", this.leader = t.leader || "", this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class nM extends rs {
  constructor(t) {
    super(mt, "boolean"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Mt](t) {
    return fl(this[it] === 1 ? "1" : "0");
  }
}
class Dx extends tt {
  constructor(t) {
    super(mt, "border", !0), this.break = at(t.break, ["close", "open"]), this.hand = at(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.corner = new R(4), this.edge = new R(4), this.extras = null, this.fill = null, this.margin = null;
  }
  [Ls]() {
    if (!this[J]) {
      const t = this.edge.children.slice();
      if (t.length < 4) {
        const n = t.at(-1) || new E2({});
        for (let a = t.length; a < 4; a++) t.push(n);
      }
      const e = t.map((n) => n.thickness), i = [0, 0, 0, 0];
      this.margin && (i[0] = this.margin.topInset, i[1] = this.margin.rightInset, i[2] = this.margin.bottomInset, i[3] = this.margin.leftInset), this[J] = { widths: e, insets: i, edges: t };
    }
    return this[J];
  }
  [Zt]() {
    var n;
    const { edges: t } = this[Ls](), e = t.map((a) => {
      const r = a[Zt]();
      return r.color || (r.color = "#000000"), r;
    }), i = /* @__PURE__ */ Object.create(null);
    if (this.margin && Object.assign(i, this.margin[Zt]()), ((n = this.fill) == null ? void 0 : n.presence) === "visible" && Object.assign(i, this.fill[Zt]()), this.corner.children.some((a) => a.radius !== 0)) {
      const a = this.corner.children.map((r) => r[Zt]());
      if (a.length === 2 || a.length === 3) {
        const r = a.at(-1);
        for (let o = a.length; o < 4; o++) a.push(r);
      }
      i.borderRadius = a.map((r) => r.radius).join(" ");
    }
    switch (this.presence) {
      case "invisible":
      case "hidden":
        i.borderStyle = "";
        break;
      case "inactive":
        i.borderStyle = "none";
        break;
      default:
        i.borderStyle = e.map((a) => a.style).join(" ");
    }
    return i.borderWidth = e.map((a) => a.width).join(" "), i.borderColor = e.map((a) => a.color).join(" "), i;
  }
}
class aM extends tt {
  constructor(t) {
    super(mt, "break", !0), this.after = at(t.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]), this.afterTarget = t.afterTarget || "", this.before = at(t.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]), this.beforeTarget = t.beforeTarget || "", this.bookendLeader = t.bookendLeader || "", this.bookendTrailer = t.bookendTrailer || "", this.id = t.id || "", this.overflowLeader = t.overflowLeader || "", this.overflowTarget = t.overflowTarget || "", this.overflowTrailer = t.overflowTrailer || "", this.startNew = Pt({ data: t.startNew, defaultValue: 0, validate: (e) => e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
}
class Nx extends tt {
  constructor(t) {
    super(mt, "breakAfter", !0), this.id = t.id || "", this.leader = t.leader || "", this.startNew = Pt({ data: t.startNew, defaultValue: 0, validate: (e) => e === 1 }), this.target = t.target || "", this.targetType = at(t.targetType, ["auto", "contentArea", "pageArea"]), this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "", this.script = null;
  }
}
class Bx extends tt {
  constructor(t) {
    super(mt, "breakBefore", !0), this.id = t.id || "", this.leader = t.leader || "", this.startNew = Pt({ data: t.startNew, defaultValue: 0, validate: (e) => e === 1 }), this.target = t.target || "", this.targetType = at(t.targetType, ["auto", "contentArea", "pageArea"]), this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "", this.script = null;
  }
  [Mt](t) {
    return this[J] = {}, Ct.FAILURE;
  }
}
class rM extends tt {
  constructor(t) {
    super(mt, "button", !0), this.highlight = at(t.highlight, ["inverted", "none", "outline", "push"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [Mt](t) {
    const e = this[Nt]()[Nt](), i = { name: "button", attributes: { id: this[oe], class: ["xfaButton"], style: {} }, children: [] };
    for (const n of e.event.children) {
      if (n.activity !== "click" || !n.script) continue;
      const a = sA(n.script[it]);
      if (!a) continue;
      const r = Tx(a.url);
      r && i.children.push({ name: "a", attributes: { id: "link" + this[oe], href: r, newWindow: a.newWindow, class: ["xfaLink"], style: {} }, children: [] });
    }
    return Ct.success(i);
  }
}
class oM extends tt {
  constructor(t) {
    super(mt, "calculate", !0), this.id = t.id || "", this.override = at(t.override, ["disabled", "error", "ignore", "warning"]), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.message = null, this.script = null;
  }
}
class lM extends tt {
  constructor(t) {
    super(mt, "caption", !0), this.id = t.id || "", this.placement = at(t.placement, ["left", "bottom", "inline", "right", "top"]), this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.reserve = Math.ceil(At(t.reserve)), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.font = null, this.margin = null, this.para = null, this.value = null;
  }
  [_i](t) {
    O7(this, t);
  }
  [Ls](t) {
    if (!this[J]) {
      let { width: e, height: i } = t;
      switch (this.placement) {
        case "left":
        case "right":
        case "inline":
          e = this.reserve <= 0 ? e : this.reserve;
          break;
        case "top":
        case "bottom":
          i = this.reserve <= 0 ? i : this.reserve;
      }
      this[J] = N7(this, { width: e });
    }
    return this[J];
  }
  [Mt](t) {
    if (!this.value) return Ct.EMPTY;
    this[j1]();
    const e = this.value[Mt](t).html;
    if (!e)
      return this[ki](), Ct.EMPTY;
    const i = this.reserve;
    if (this.reserve <= 0) {
      const { w: r, h: o } = this[Ls](t);
      switch (this.placement) {
        case "left":
        case "right":
        case "inline":
          this.reserve = r;
          break;
        case "top":
        case "bottom":
          this.reserve = o;
      }
    }
    const n = [];
    typeof e == "string" ? n.push({ name: "#text", value: e }) : n.push(e);
    const a = pi(this, "font", "margin", "visibility");
    switch (this.placement) {
      case "left":
      case "right":
        this.reserve > 0 && (a.width = Rt(this.reserve));
        break;
      case "top":
      case "bottom":
        this.reserve > 0 && (a.height = Rt(this.reserve));
    }
    return Ix(this, null, e), this[ki](), this.reserve = i, Ct.success({ name: "div", attributes: { style: a, class: ["xfaCaption"] }, children: n });
  }
}
class cM extends jt {
  constructor(t) {
    super(mt, "certificate"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class hM extends tt {
  constructor(t) {
    super(mt, "certificates", !0), this.credentialServerPolicy = at(t.credentialServerPolicy, ["optional", "required"]), this.id = t.id || "", this.url = t.url || "", this.urlPolicy = t.urlPolicy || "", this.use = t.use || "", this.usehref = t.usehref || "", this.encryption = null, this.issuers = null, this.keyUsage = null, this.oids = null, this.signing = null, this.subjectDNs = null;
  }
}
class Lx extends tt {
  constructor(t) {
    super(mt, "checkButton", !0), this.id = t.id || "", this.mark = at(t.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]), this.shape = at(t.shape, ["square", "round"]), this.size = At(t.size, "10pt"), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
  [Mt](t) {
    var m, b, y;
    const e = pi(this, "margin"), i = Rt(this.size);
    e.width = e.height = i;
    let n, a, r;
    const o = this[Nt]()[Nt](), l = o.items.children.length && o.items.children[0][Mt]().html || [], c = { on: (l[0] !== void 0 ? l[0] : "on").toString(), off: (l[1] !== void 0 ? l[1] : "off").toString() }, h = (((m = o.value) == null ? void 0 : m[ns]()) || "off") === c.on || void 0, u = o[Ve](), f = o[oe];
    let d;
    u instanceof jx ? (r = u[oe], n = "radio", a = "xfaRadio", d = ((b = u[xn]) == null ? void 0 : b[oe]) || u[oe]) : (n = "checkbox", a = "xfaCheckbox", d = ((y = o[xn]) == null ? void 0 : y[oe]) || o[oe]);
    const p = { name: "input", attributes: { class: [a], style: e, fieldId: f, dataId: d, type: n, checked: h, xfaOn: c.on, xfaOff: c.off, "aria-label": dh(o), "aria-required": !1 } };
    return r && (p.attributes.name = r), T2(o) && (p.attributes["aria-required"] = !0, p.attributes.required = !0), Ct.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [p] });
  }
}
class Ox extends tt {
  constructor(t) {
    super(mt, "choiceList", !0), this.commitOn = at(t.commitOn, ["select", "exit"]), this.id = t.id || "", this.open = at(t.open, ["userControl", "always", "multiSelect", "onEntry"]), this.textEntry = Pt({ data: t.textEntry, defaultValue: 0, validate: (e) => e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
  [Mt](t) {
    var o, l, c;
    const e = pi(this, "border", "margin"), i = this[Nt]()[Nt](), n = { fontSize: `calc(${((o = i.font) == null ? void 0 : o.size) || 10}px * var(--total-scale-factor))` }, a = [];
    if (i.items.children.length > 0) {
      const h = i.items;
      let u = 0, f = 0;
      h.children.length === 2 && (u = h.children[0].save, f = 1 - u);
      const d = h.children[u][Mt]().html, p = h.children[f][Mt]().html;
      let m = !1;
      const b = ((l = i.value) == null ? void 0 : l[ns]()) || "";
      for (let y = 0, v = d.length; y < v; y++) {
        const w = { name: "option", attributes: { value: p[y] || d[y], style: n }, value: d[y] };
        p[y] === b && (w.attributes.selected = m = !0), a.push(w);
      }
      m || a.splice(0, 0, { name: "option", attributes: { hidden: !0, selected: !0 }, value: " " });
    }
    const r = { class: ["xfaSelect"], fieldId: i[oe], dataId: ((c = i[xn]) == null ? void 0 : c[oe]) || i[oe], style: e, "aria-label": dh(i), "aria-required": !1 };
    return T2(i) && (r["aria-required"] = !0, r.required = !0), this.open === "multiSelect" && (r.multiple = !0), Ct.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [{ name: "select", children: a, attributes: r }] });
  }
}
class uM extends tt {
  constructor(t) {
    super(mt, "color", !0), this.cSpace = at(t.cSpace, ["SRGB"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.value = t.value ? function(i, n = [0, 0, 0]) {
      let [a, r, o] = n;
      if (!i) return { r: a, g: r, b: o };
      const l = i.split(",", 3).map((c) => Bs(parseInt(c.trim(), 10), 0, 255)).map((c) => isNaN(c) ? 0 : c);
      return l.length < 3 ? { r: a, g: r, b: o } : ([a, r, o] = l, { r: a, g: r, b: o });
    }(t.value) : "", this.extras = null;
  }
  [y0]() {
    return !1;
  }
  [Zt]() {
    return this.value ? se.makeHexColor(this.value.r, this.value.g, this.value.b) : null;
  }
}
class dM extends tt {
  constructor(t) {
    super(mt, "comb"), this.id = t.id || "", this.numberOfCells = Pt({ data: t.numberOfCells, defaultValue: 0, validate: (e) => e >= 0 }), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class fM extends tt {
  constructor(t) {
    super(mt, "connect", !0), this.connection = t.connection || "", this.id = t.id || "", this.ref = t.ref || "", this.usage = at(t.usage, ["exportAndImport", "exportOnly", "importOnly"]), this.use = t.use || "", this.usehref = t.usehref || "", this.picture = null;
  }
}
class q7 extends tt {
  constructor(t) {
    super(mt, "contentArea", !0), this.h = At(t.h), this.id = t.id || "", this.name = t.name || "", this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.w = At(t.w), this.x = At(t.x, "0pt"), this.y = At(t.y, "0pt"), this.desc = null, this.extras = null;
  }
  [Mt](t) {
    const e = { left: Rt(this.x), top: Rt(this.y), width: Rt(this.w), height: Rt(this.h) }, i = ["xfaContentarea"];
    return H1(this) && i.push("xfaPrintOnly"), Ct.success({ name: "div", children: [], attributes: { style: e, class: i, id: this[oe] } });
  }
}
class Ux extends tt {
  constructor(t) {
    super(mt, "corner", !0), this.id = t.id || "", this.inverted = Pt({ data: t.inverted, defaultValue: 0, validate: (e) => e === 1 }), this.join = at(t.join, ["square", "round"]), this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.radius = At(t.radius), this.stroke = at(t.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]), this.thickness = At(t.thickness, "0.5pt"), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [Zt]() {
    const t = pi(this, "visibility");
    return t.radius = Rt(this.join === "square" ? 0 : this.radius), t;
  }
}
class gM extends Oe {
  constructor(t) {
    super(mt, "date"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    const t = this[it].trim();
    this[it] = t ? new Date(t) : null;
  }
  [Mt](t) {
    return fl(this[it] ? this[it].toString() : "");
  }
}
class pM extends Oe {
  constructor(t) {
    super(mt, "dateTime"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    const t = this[it].trim();
    this[it] = t ? new Date(t) : null;
  }
  [Mt](t) {
    return fl(this[it] ? this[it].toString() : "");
  }
}
class mM extends tt {
  constructor(t) {
    super(mt, "dateTimeEdit", !0), this.hScrollPolicy = at(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.picker = at(t.picker, ["host", "none"]), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.comb = null, this.extras = null, this.margin = null;
  }
  [Mt](t) {
    var a;
    const e = pi(this, "border", "font", "margin"), i = this[Nt]()[Nt](), n = { name: "input", attributes: { type: "text", fieldId: i[oe], dataId: ((a = i[xn]) == null ? void 0 : a[oe]) || i[oe], class: ["xfaTextfield"], style: e, "aria-label": dh(i), "aria-required": !1 } };
    return T2(i) && (n.attributes["aria-required"] = !0, n.attributes.required = !0), Ct.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [n] });
  }
}
class bM extends Oe {
  constructor(t) {
    super(mt, "decimal"), this.fracDigits = Pt({ data: t.fracDigits, defaultValue: 2, validate: (e) => !0 }), this.id = t.id || "", this.leadDigits = Pt({ data: t.leadDigits, defaultValue: -1, validate: (e) => !0 }), this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    const t = parseFloat(this[it].trim());
    this[it] = isNaN(t) ? null : t;
  }
  [Mt](t) {
    return fl(this[it] !== null ? this[it].toString() : "");
  }
}
class yM extends tt {
  constructor(t) {
    super(mt, "defaultUi", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
}
class wM extends tt {
  constructor(t) {
    super(mt, "desc", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new R(), this.date = new R(), this.dateTime = new R(), this.decimal = new R(), this.exData = new R(), this.float = new R(), this.image = new R(), this.integer = new R(), this.text = new R(), this.time = new R();
  }
}
class vM extends le {
  constructor(t) {
    super(mt, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class AM extends tt {
  constructor(t) {
    super(mt, "digestMethods", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.digestMethod = new R();
  }
}
class qx extends tt {
  constructor(t) {
    super(mt, "draw", !0), this.anchorType = at(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Pt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.h = t.h ? At(t.h) : "", this.hAlign = at(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.locale = t.locale || "", this.maxH = At(t.maxH, "0pt"), this.maxW = At(t.maxW, "0pt"), this.minH = At(t.minH, "0pt"), this.minW = At(t.minW, "0pt"), this.name = t.name || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = ca(t.relevant), this.rotate = Pt({ data: t.rotate, defaultValue: 0, validate: (e) => e % 90 == 0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? At(t.w) : "", this.x = At(t.x, "0pt"), this.y = At(t.y, "0pt"), this.assist = null, this.border = null, this.caption = null, this.desc = null, this.extras = null, this.font = null, this.keep = null, this.margin = null, this.para = null, this.traversal = null, this.ui = null, this.value = null, this.setProperty = new R();
  }
  [_i](t) {
    O7(this, t);
  }
  [Mt](t) {
    if (am(this), this.presence === "hidden" || this.presence === "inactive") return Ct.EMPTY;
    im(this), this[j1]();
    const e = this.w, i = this.h, { w: n, h: a, isBroken: r } = N7(this, t);
    if (n && this.w === "") {
      if (r && this[Ve]()[Yr]())
        return this[ki](), Ct.FAILURE;
      this.w = n;
    }
    if (a && this.h === "" && (this.h = a), om(this), !nm(this, t))
      return this.w = e, this.h = i, this[ki](), Ct.FAILURE;
    lm(this);
    const o = pi(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin");
    Ax(this, o), o.margin && (o.padding = o.margin, delete o.margin);
    const l = ["xfaDraw"];
    this.font && l.push("xfaFont"), H1(this) && l.push("xfaPrintOnly");
    const c = { style: o, id: this[oe], class: l };
    this.name && (c.xfaName = this.name);
    const h = { name: "div", attributes: c, children: [] };
    rm(this, c);
    const u = xx(this, h, t), f = this.value ? this.value[Mt](t).html : null;
    return f === null ? (this.w = e, this.h = i, this[ki](), Ct.success(ah(this, h), u)) : (h.children.push(f), Ix(this, o, f), this.w = e, this.h = i, this[ki](), Ct.success(ah(this, h), u));
  }
}
class E2 extends tt {
  constructor(t) {
    super(mt, "edge", !0), this.cap = at(t.cap, ["square", "butt", "round"]), this.id = t.id || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.stroke = at(t.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]), this.thickness = At(t.thickness, "0.5pt"), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [Zt]() {
    const t = pi(this, "visibility");
    if (Object.assign(t, { linecap: this.cap, width: Rt(this.thickness), color: this.color ? this.color[Zt]() : "#000000", style: "" }), this.presence !== "visible") t.style = "none";
    else switch (this.stroke) {
      case "solid":
        t.style = "solid";
        break;
      case "dashDot":
      case "dashDotDot":
      case "dashed":
        t.style = "dashed";
        break;
      case "dotted":
        t.style = "dotted";
        break;
      case "embossed":
        t.style = "ridge";
        break;
      case "etched":
        t.style = "groove";
        break;
      case "lowered":
        t.style = "inset";
        break;
      case "raised":
        t.style = "outset";
    }
    return t;
  }
}
class xM extends le {
  constructor(t) {
    super(mt, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class kM extends tt {
  constructor(t) {
    super(mt, "encodings", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.encoding = new R();
  }
}
class SM extends tt {
  constructor(t) {
    super(mt, "encrypt", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = null;
  }
}
class CM extends tt {
  constructor(t) {
    super(mt, "encryptData", !0), this.id = t.id || "", this.operation = at(t.operation, ["encrypt", "decrypt"]), this.target = t.target || "", this.use = t.use || "", this.usehref = t.usehref || "", this.filter = null, this.manifest = null;
  }
}
class IM extends tt {
  constructor(t) {
    super(mt, "encryption", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = new R();
  }
}
class _M extends le {
  constructor(t) {
    super(mt, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class TM extends tt {
  constructor(t) {
    super(mt, "encryptionMethods", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.encryptionMethod = new R();
  }
}
let EM = class extends tt {
  constructor(t) {
    super(mt, "event", !0), this.activity = at(t.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]), this.id = t.id || "", this.listen = at(t.listen, ["refOnly", "refAndDescendents"]), this.name = t.name || "", this.ref = t.ref || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.encryptData = null, this.execute = null, this.script = null, this.signData = null, this.submit = null;
  }
};
class MM extends Oe {
  constructor(t) {
    super(mt, "exData"), this.contentType = t.contentType || "", this.href = t.href || "", this.id = t.id || "", this.maxLength = Pt({ data: t.maxLength, defaultValue: -1, validate: (e) => e >= -1 }), this.name = t.name || "", this.rid = t.rid || "", this.transferEncoding = at(t.transferEncoding, ["none", "base64", "package"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [F7]() {
    return this.contentType === "text/html";
  }
  [qa](t) {
    return this.contentType === "text/html" && t[Ge] === We.xhtml.id ? (this[it] = t, !0) : this.contentType === "text/xml" ? (this[it] = t, !0) : !1;
  }
  [Mt](t) {
    return this.contentType === "text/html" && this[it] ? this[it][Mt](t) : Ct.EMPTY;
  }
}
class FM extends tt {
  constructor(t) {
    super(mt, "exObject", !0), this.archive = t.archive || "", this.classId = t.classId || "", this.codeBase = t.codeBase || "", this.codeType = t.codeType || "", this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.boolean = new R(), this.date = new R(), this.dateTime = new R(), this.decimal = new R(), this.exData = new R(), this.exObject = new R(), this.float = new R(), this.image = new R(), this.integer = new R(), this.text = new R(), this.time = new R();
  }
}
class jx extends tt {
  constructor(t) {
    super(mt, "exclGroup", !0), this.access = at(t.access, ["open", "nonInteractive", "protected", "readOnly"]), this.accessKey = t.accessKey || "", this.anchorType = at(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Pt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.h = t.h ? At(t.h) : "", this.hAlign = at(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.layout = at(t.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]), this.maxH = At(t.maxH, "0pt"), this.maxW = At(t.maxW, "0pt"), this.minH = At(t.minH, "0pt"), this.minW = At(t.minW, "0pt"), this.name = t.name || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? At(t.w) : "", this.x = At(t.x, "0pt"), this.y = At(t.y, "0pt"), this.assist = null, this.bind = null, this.border = null, this.calculate = null, this.caption = null, this.desc = null, this.extras = null, this.margin = null, this.para = null, this.traversal = null, this.validate = null, this.connect = new R(), this.event = new R(), this.field = new R(), this.setProperty = new R();
  }
  [yh]() {
    return !0;
  }
  [y0]() {
    return !0;
  }
  [_i](t) {
    for (const e of this.field.children) {
      if (!e.value) {
        const i = new G7({});
        e[Ne](i), e.value = i;
      }
      e.value[_i](t);
    }
  }
  [Yr]() {
    return this.layout.endsWith("-tb") && this[J].attempt === 0 && this[J].numberInLine > 0 || this[Nt]()[Yr]();
  }
  [qr]() {
    var e;
    const t = this[Ve]();
    return t[qr]() ? this[J]._isSplittable !== void 0 ? this[J]._isSplittable : this.layout === "position" || this.layout.includes("row") ? (this[J]._isSplittable = !1, !1) : (e = t.layout) != null && e.endsWith("-tb") && t[J].numberInLine !== 0 ? !1 : (this[J]._isSplittable = !0, !0) : !1;
  }
  [_2]() {
    return Mx(this);
  }
  [ih](t, e) {
    Fx(this, t, e);
  }
  [nh]() {
    return Rx(this);
  }
  [Mt](t) {
    if (am(this), this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) return Ct.EMPTY;
    im(this);
    const e = [], i = { id: this[oe], class: [] };
    B7(this, i.class), this[J] || (this[J] = /* @__PURE__ */ Object.create(null)), Object.assign(this[J], { children: e, attributes: i, attempt: 0, line: null, numberInLine: 0, availableSpace: { width: Math.min(this.w || 1 / 0, t.width), height: Math.min(this.h || 1 / 0, t.height) }, width: 0, height: 0, prevHeight: 0, currentWidth: 0 });
    const n = this[qr]();
    if (n || om(this), !nm(this, t)) return Ct.FAILURE;
    const a = /* @__PURE__ */ new Set(["field"]);
    if (this.layout.includes("row")) {
      const y = this[Ve]().columnWidths;
      Array.isArray(y) && y.length > 0 && (this[J].columnWidths = y, this[J].currentColumn = 0);
    }
    const r = pi(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"), o = ["xfaExclgroup"], l = kx(this);
    l && o.push(l), H1(this) && o.push("xfaPrintOnly"), i.style = r, i.class = o, this.name && (i.xfaName = this.name), this[j1]();
    const c = this.layout === "lr-tb" || this.layout === "rl-tb", h = c ? 2 : 1;
    for (; this[J].attempt < h; this[J].attempt++) {
      c && this[J].attempt === 1 && (this[J].numberInLine = 0);
      const y = this[cl]({ filter: a, include: !0 });
      if (y.success) break;
      if (y.isBreak())
        return this[ki](), y;
      if (c && this[J].attempt === 0 && this[J].numberInLine === 0 && !this[ze]()[J].noLayoutFailure) {
        this[J].attempt = h;
        break;
      }
    }
    if (this[ki](), n || lm(this), this[J].attempt === h)
      return n || delete this[J], Ct.FAILURE;
    let u = 0, f = 0;
    this.margin && (u = this.margin.leftInset + this.margin.rightInset, f = this.margin.topInset + this.margin.bottomInset);
    const d = Math.max(this[J].width + u, this.w || 0), p = Math.max(this[J].height + f, this.h || 0), m = [this.x, this.y, d, p];
    this.w === "" && (r.width = Rt(d)), this.h === "" && (r.height = Rt(p));
    const b = { name: "div", attributes: i, children: e };
    return rm(this, i), delete this[J], Ct.success(ah(this, b), m);
  }
}
class RM extends tt {
  constructor(t) {
    super(mt, "execute"), this.connection = t.connection || "", this.executeType = at(t.executeType, ["import", "remerge"]), this.id = t.id || "", this.runAt = at(t.runAt, ["client", "both", "server"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class PM extends tt {
  constructor(t) {
    super(mt, "extras", !0), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new R(), this.date = new R(), this.dateTime = new R(), this.decimal = new R(), this.exData = new R(), this.extras = new R(), this.float = new R(), this.image = new R(), this.integer = new R(), this.text = new R(), this.time = new R();
  }
}
class j7 extends tt {
  constructor(t) {
    super(mt, "field", !0), this.access = at(t.access, ["open", "nonInteractive", "protected", "readOnly"]), this.accessKey = t.accessKey || "", this.anchorType = at(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Pt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.h = t.h ? At(t.h) : "", this.hAlign = at(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.locale = t.locale || "", this.maxH = At(t.maxH, "0pt"), this.maxW = At(t.maxW, "0pt"), this.minH = At(t.minH, "0pt"), this.minW = At(t.minW, "0pt"), this.name = t.name || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = ca(t.relevant), this.rotate = Pt({ data: t.rotate, defaultValue: 0, validate: (e) => e % 90 == 0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? At(t.w) : "", this.x = At(t.x, "0pt"), this.y = At(t.y, "0pt"), this.assist = null, this.bind = null, this.border = null, this.calculate = null, this.caption = null, this.desc = null, this.extras = null, this.font = null, this.format = null, this.items = new R(2), this.keep = null, this.margin = null, this.para = null, this.traversal = null, this.ui = null, this.validate = null, this.value = null, this.bindItems = new R(), this.connect = new R(), this.event = new R(), this.setProperty = new R();
  }
  [yh]() {
    return !0;
  }
  [_i](t) {
    O7(this, t);
  }
  [Mt](t) {
    var y, v, w, A, x;
    if (am(this), !this.ui) {
      this.ui = new z7({}), this.ui[fe] = this[fe], this[Ne](this.ui);
      let k;
      switch (this.items.children.length) {
        case 0:
          k = new Wx({}), this.ui.textEdit = k;
          break;
        case 1:
          k = new Lx({}), this.ui.checkButton = k;
          break;
        case 2:
          k = new Ox({}), this.ui.choiceList = k;
      }
      this.ui[Ne](k);
    }
    if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) return Ct.EMPTY;
    this.caption && delete this.caption[J], this[j1]();
    const e = this.caption ? this.caption[Mt](t).html : null, i = this.w, n = this.h;
    let a = 0, r = 0;
    this.margin && (a = this.margin.leftInset + this.margin.rightInset, r = this.margin.topInset + this.margin.bottomInset);
    let o = null;
    if (this.w === "" || this.h === "") {
      let k = null, I = null, T = 0, E = 0;
      if (this.ui.checkButton) T = E = this.ui.checkButton.size;
      else {
        const { w: M, h: F } = N7(this, t);
        M !== null ? (T = M, E = F) : E = function(Y, B = !1) {
          let et = null;
          if (Y) {
            const N = em(Y.typeface), j = Y[fe].fontFinder.find(N);
            et = R7(Y, j);
          }
          if (!et) return { lineHeight: 12, lineGap: 2, lineNoGap: 10 };
          const H = Y.size || 10, P = et.lineHeight ? Math.max(B ? 0 : 1.2, et.lineHeight) : 1.2, G = et.lineGap === void 0 ? 0.2 : et.lineGap;
          return { lineHeight: P * H, lineGap: G * H, lineNoGap: Math.max(1, P - G) * H };
        }(this.font, !0).lineNoGap;
      }
      if (o = hb(this.ui[Ls]()), T += o.w, E += o.h, this.caption) {
        const { w: M, h: F, isBroken: L } = this.caption[Ls](t);
        if (L && this[Ve]()[Yr]())
          return this[ki](), Ct.FAILURE;
        switch (k = M, I = F, this.caption.placement) {
          case "left":
          case "right":
          case "inline":
            k += T;
            break;
          case "top":
          case "bottom":
            I += E;
        }
      } else
        k = T, I = E;
      k && this.w === "" && (k += a, this.w = Math.min(this.maxW <= 0 ? 1 / 0 : this.maxW, this.minW + 1 < k ? k : this.minW)), I && this.h === "" && (I += r, this.h = Math.min(this.maxH <= 0 ? 1 / 0 : this.maxH, this.minH + 1 < I ? I : this.minH));
    }
    if (this[ki](), im(this), om(this), !nm(this, t))
      return this.w = i, this.h = n, this[ki](), Ct.FAILURE;
    lm(this);
    const l = pi(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign");
    Ax(this, l);
    const c = ["xfaField"];
    this.font && c.push("xfaFont"), H1(this) && c.push("xfaPrintOnly");
    const h = { style: l, id: this[oe], class: c };
    l.margin && (l.padding = l.margin, delete l.margin), B7(this, c), this.name && (h.xfaName = this.name);
    const u = [], f = { name: "div", attributes: h, children: u };
    rm(this, h);
    const d = this.border ? this.border[Zt]() : null, p = xx(this, f, t), m = this.ui[Mt]().html;
    if (!m)
      return Object.assign(l, d), Ct.success(ah(this, f), p);
    this[Jn] && ((y = m.children) != null && y[0] ? m.children[0].attributes.tabindex = this[Jn] : m.attributes.tabindex = this[Jn]), (v = m.attributes).style || (v.style = /* @__PURE__ */ Object.create(null));
    let b = null;
    if (this.ui.button ? (m.children.length === 1 && ([b] = m.children.splice(0, 1)), Object.assign(m.attributes.style, d)) : Object.assign(l, d), u.push(m), this.value) {
      if (this.ui.imageEdit) m.children.push(this.value[Mt]().html);
      else if (!this.ui.button) {
        let k = "";
        if (this.value.exData) k = this.value.exData[ns]();
        else if (this.value.text) k = this.value.text[Ls]();
        else {
          const I = this.value[Mt]().html;
          I !== null && (k = I.children[0].value);
        }
        this.ui.textEdit && ((w = this.value.text) != null && w.maxChars) && (m.children[0].attributes.maxLength = this.value.text.maxChars), k && (this.ui.numericEdit && (k = parseFloat(k), k = isNaN(k) ? "" : k.toString()), m.children[0].name === "textarea" ? m.children[0].attributes.textContent = k : m.children[0].attributes.value = k);
      }
    }
    if (!this.ui.imageEdit && ((A = m.children) != null && A[0]) && this.h) {
      o = o || hb(this.ui[Ls]());
      let k = 0;
      if (this.caption && ["top", "bottom"].includes(this.caption.placement)) {
        k = this.caption.reserve, k <= 0 && (k = this.caption[Ls](t).h);
        const I = this.h - k - r - o.h;
        m.children[0].attributes.style.height = Rt(I);
      } else m.children[0].attributes.style.height = "100%";
    }
    if (b && m.children.push(b), !e)
      return m.attributes.class && m.attributes.class.push("xfaLeft"), this.w = i, this.h = n, Ct.success(ah(this, f), p);
    if (this.ui.button)
      return l.padding && delete l.padding, e.name === "div" && (e.name = "span"), m.children.push(e), Ct.success(f, p);
    switch (this.ui.checkButton && (e.attributes.class[0] = "xfaCaptionForCheckButton"), (x = m.attributes).class || (x.class = []), m.children.splice(0, 0, e), this.caption.placement) {
      case "left":
      case "inline":
        m.attributes.class.push("xfaLeft");
        break;
      case "right":
        m.attributes.class.push("xfaRight");
        break;
      case "top":
        m.attributes.class.push("xfaTop");
        break;
      case "bottom":
        m.attributes.class.push("xfaBottom");
    }
    return this.w = i, this.h = n, Ct.success(ah(this, f), p);
  }
}
class DM extends tt {
  constructor(t) {
    super(mt, "fill", !0), this.id = t.id || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null, this.linear = null, this.pattern = null, this.radial = null, this.solid = null, this.stipple = null;
  }
  [Zt]() {
    var r;
    const t = this[Nt](), e = t[Nt]()[Nt](), i = /* @__PURE__ */ Object.create(null);
    let n = "color", a = n;
    t instanceof Dx && (n = "background-color", a = "background", e instanceof z7 && (i.backgroundColor = "white")), (t instanceof zx || t instanceof Px) && (n = a = "fill", i.fill = "white");
    for (const o of Object.getOwnPropertyNames(this)) {
      if (o === "extras" || o === "color") continue;
      const l = this[o];
      if (!(l instanceof tt)) continue;
      const c = l[Zt](this.color);
      return c && (i[c.startsWith("#") ? n : a] = c), i;
    }
    if ((r = this.color) != null && r.value) {
      const o = this.color[Zt]();
      i[o.startsWith("#") ? n : a] = o;
    }
    return i;
  }
}
class NM extends tt {
  constructor(t) {
    super(mt, "filter", !0), this.addRevocationInfo = at(t.addRevocationInfo, ["", "required", "optional", "none"]), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.version = Pt({ data: this.version, defaultValue: 5, validate: (e) => e >= 1 && e <= 5 }), this.appearanceFilter = null, this.certificates = null, this.digestMethods = null, this.encodings = null, this.encryptionMethods = null, this.handler = null, this.lockDocument = null, this.mdp = null, this.reasons = null, this.timeStamp = null;
  }
}
class BM extends Oe {
  constructor(t) {
    super(mt, "float"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    const t = parseFloat(this[it].trim());
    this[it] = isNaN(t) ? null : t;
  }
  [Mt](t) {
    return fl(this[it] !== null ? this[it].toString() : "");
  }
}
class LM extends tt {
  constructor(t) {
    super(mt, "font", !0), this.baselineShift = At(t.baselineShift), this.fontHorizontalScale = Hp({ data: t.fontHorizontalScale, defaultValue: 100, validate: (e) => e >= 0 }), this.fontVerticalScale = Hp({ data: t.fontVerticalScale, defaultValue: 100, validate: (e) => e >= 0 }), this.id = t.id || "", this.kerningMode = at(t.kerningMode, ["none", "pair"]), this.letterSpacing = At(t.letterSpacing, "0"), this.lineThrough = Pt({ data: t.lineThrough, defaultValue: 0, validate: (e) => e === 1 || e === 2 }), this.lineThroughPeriod = at(t.lineThroughPeriod, ["all", "word"]), this.overline = Pt({ data: t.overline, defaultValue: 0, validate: (e) => e === 1 || e === 2 }), this.overlinePeriod = at(t.overlinePeriod, ["all", "word"]), this.posture = at(t.posture, ["normal", "italic"]), this.size = At(t.size, "10pt"), this.typeface = t.typeface || "Courier", this.underline = Pt({ data: t.underline, defaultValue: 0, validate: (e) => e === 1 || e === 2 }), this.underlinePeriod = at(t.underlinePeriod, ["all", "word"]), this.use = t.use || "", this.usehref = t.usehref || "", this.weight = at(t.weight, ["normal", "bold"]), this.extras = null, this.fill = null;
  }
  [Mn](t) {
    super[Mn](t), this[fe].usedTypefaces.add(this.typeface);
  }
  [Zt]() {
    const t = pi(this, "fill"), e = t.color;
    return e && (e === "#000000" ? delete t.color : e.startsWith("#") || (t.background = e, t.backgroundClip = "text", t.color = "transparent")), this.baselineShift && (t.verticalAlign = Rt(this.baselineShift)), t.fontKerning = this.kerningMode === "none" ? "none" : "normal", t.letterSpacing = Rt(this.letterSpacing), this.lineThrough !== 0 && (t.textDecoration = "line-through", this.lineThrough === 2 && (t.textDecorationStyle = "double")), this.overline !== 0 && (t.textDecoration = "overline", this.overline === 2 && (t.textDecorationStyle = "double")), t.fontStyle = this.posture, t.fontSize = Rt(0.99 * this.size), _x(this, this, this[fe].fontFinder, t), this.underline !== 0 && (t.textDecoration = "underline", this.underline === 2 && (t.textDecorationStyle = "double")), t.fontWeight = this.weight, t;
  }
}
class OM extends tt {
  constructor(t) {
    super(mt, "format", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.picture = null;
  }
}
class UM extends jt {
  constructor(t) {
    super(mt, "handler"), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class qM extends tt {
  constructor(t) {
    super(mt, "hyphenation"), this.excludeAllCaps = Pt({ data: t.excludeAllCaps, defaultValue: 0, validate: (e) => e === 1 }), this.excludeInitialCap = Pt({ data: t.excludeInitialCap, defaultValue: 0, validate: (e) => e === 1 }), this.hyphenate = Pt({ data: t.hyphenate, defaultValue: 0, validate: (e) => e === 1 }), this.id = t.id || "", this.pushCharacterCount = Pt({ data: t.pushCharacterCount, defaultValue: 3, validate: (e) => e >= 0 }), this.remainCharacterCount = Pt({ data: t.remainCharacterCount, defaultValue: 3, validate: (e) => e >= 0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.wordCharacterCount = Pt({ data: t.wordCharacterCount, defaultValue: 7, validate: (e) => e >= 0 });
  }
}
let Hx = class extends jt {
  constructor(t) {
    super(mt, "image"), this.aspect = at(t.aspect, ["fit", "actual", "height", "none", "width"]), this.contentType = t.contentType || "", this.href = t.href || "", this.id = t.id || "", this.name = t.name || "", this.transferEncoding = at(t.transferEncoding, ["base64", "none", "package"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Mt]() {
    var a;
    if (this.contentType && !YE.has(this.contentType.toLowerCase())) return Ct.EMPTY;
    let t = (a = this[fe].images) == null ? void 0 : a.get(this.href);
    if (!t && (this.href || !this[it]) || (t || this.transferEncoding !== "base64" || (t = function(o) {
      return Uint8Array.fromBase64 ? Uint8Array.fromBase64(o) : Ns(atob(o));
    }(this[it])), !t)) return Ct.EMPTY;
    if (!this.contentType) {
      for (const [r, o] of JE) if (t.length > r.length && r.every((l, c) => l === t[c])) {
        this.contentType = o;
        break;
      }
      if (!this.contentType) return Ct.EMPTY;
    }
    const e = new Blob([t], { type: this.contentType });
    let i;
    switch (this.aspect) {
      case "fit":
      case "actual":
        break;
      case "height":
        i = { height: "100%", objectFit: "fill" };
        break;
      case "none":
        i = { width: "100%", height: "100%", objectFit: "fill" };
        break;
      case "width":
        i = { width: "100%", objectFit: "fill" };
    }
    const n = this[Nt]();
    return Ct.success({ name: "img", attributes: { class: ["xfaImage"], style: i, src: URL.createObjectURL(e), alt: n ? dh(n[Nt]()) : null } });
  }
};
class jM extends tt {
  constructor(t) {
    super(mt, "imageEdit", !0), this.data = at(t.data, ["link", "embed"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
  [Mt](t) {
    return this.data === "embed" ? Ct.success({ name: "div", children: [], attributes: {} }) : Ct.EMPTY;
  }
}
class HM extends Oe {
  constructor(t) {
    super(mt, "integer"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    const t = parseInt(this[it].trim(), 10);
    this[it] = isNaN(t) ? null : t;
  }
  [Mt](t) {
    return fl(this[it] !== null ? this[it].toString() : "");
  }
}
class $M extends tt {
  constructor(t) {
    super(mt, "issuers", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = new R();
  }
}
class M6 extends tt {
  constructor(t) {
    super(mt, "items", !0), this.id = t.id || "", this.name = t.name || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.ref = t.ref || "", this.save = Pt({ data: t.save, defaultValue: 0, validate: (e) => e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new R(), this.date = new R(), this.dateTime = new R(), this.decimal = new R(), this.exData = new R(), this.float = new R(), this.image = new R(), this.integer = new R(), this.text = new R(), this.time = new R();
  }
  [Mt]() {
    const t = [];
    for (const e of this[xs]()) t.push(e[ns]());
    return Ct.success(t);
  }
}
class zM extends tt {
  constructor(t) {
    super(mt, "keep", !0), this.id = t.id || "";
    const e = ["none", "contentArea", "pageArea"];
    this.intact = at(t.intact, e), this.next = at(t.next, e), this.previous = at(t.previous, e), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
}
class GM extends tt {
  constructor(t) {
    super(mt, "keyUsage");
    const e = ["", "yes", "no"];
    this.crlSign = at(t.crlSign, e), this.dataEncipherment = at(t.dataEncipherment, e), this.decipherOnly = at(t.decipherOnly, e), this.digitalSignature = at(t.digitalSignature, e), this.encipherOnly = at(t.encipherOnly, e), this.id = t.id || "", this.keyAgreement = at(t.keyAgreement, e), this.keyCertSign = at(t.keyCertSign, e), this.keyEncipherment = at(t.keyEncipherment, e), this.nonRepudiation = at(t.nonRepudiation, e), this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class VM extends tt {
  constructor(t) {
    super(mt, "line", !0), this.hand = at(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.slope = at(t.slope, ["\\", "/"]), this.use = t.use || "", this.usehref = t.usehref || "", this.edge = null;
  }
  [Mt]() {
    const t = this[Nt]()[Nt](), e = this.edge || new E2({}), i = e[Zt](), n = /* @__PURE__ */ Object.create(null), a = e.presence === "visible" ? e.thickness : 0;
    n.strokeWidth = Rt(a), n.stroke = i.color;
    let r, o, l, c, h = "100%", u = "100%";
    t.w <= a ? ([r, o, l, c] = ["50%", 0, "50%", "100%"], h = n.strokeWidth) : t.h <= a ? ([r, o, l, c] = [0, "50%", "100%", "50%"], u = n.strokeWidth) : this.slope === "\\" ? [r, o, l, c] = [0, 0, "100%", "100%"] : [r, o, l, c] = [0, "100%", "100%", 0];
    const f = { name: "svg", children: [{ name: "line", attributes: { xmlns: rh, x1: r, y1: o, x2: l, y2: c, style: n } }], attributes: { xmlns: rh, width: h, height: u, style: { overflow: "visible" } } };
    return L7(t) ? Ct.success({ name: "div", attributes: { style: { display: "inline", width: "100%", height: "100%" } }, children: [f] }) : (f.attributes.style.position = "absolute", Ct.success(f));
  }
}
class WM extends tt {
  constructor(t) {
    super(mt, "linear", !0), this.id = t.id || "", this.type = at(t.type, ["toRight", "toBottom", "toLeft", "toTop"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [Zt](t) {
    return t = t ? t[Zt]() : "#FFFFFF", `linear-gradient(${this.type.replace(/([RBLT])/, " $1").toLowerCase()}, ${t}, ${this.color ? this.color[Zt]() : "#000000"})`;
  }
}
class XM extends Oe {
  constructor(t) {
    super(mt, "lockDocument"), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    this[it] = at(this[it], ["auto", "0", "1"]);
  }
}
class KM extends tt {
  constructor(t) {
    super(mt, "manifest", !0), this.action = at(t.action, ["include", "all", "exclude"]), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.ref = new R();
  }
}
class YM extends tt {
  constructor(t) {
    super(mt, "margin", !0), this.bottomInset = At(t.bottomInset, "0"), this.id = t.id || "", this.leftInset = At(t.leftInset, "0"), this.rightInset = At(t.rightInset, "0"), this.topInset = At(t.topInset, "0"), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [Zt]() {
    return { margin: Rt(this.topInset) + " " + Rt(this.rightInset) + " " + Rt(this.bottomInset) + " " + Rt(this.leftInset) };
  }
}
class JM extends tt {
  constructor(t) {
    super(mt, "mdp"), this.id = t.id || "", this.permissions = Pt({ data: t.permissions, defaultValue: 2, validate: (e) => e === 1 || e === 3 }), this.signatureType = at(t.signatureType, ["filler", "author"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class ZM extends tt {
  constructor(t) {
    super(mt, "medium"), this.id = t.id || "", this.imagingBBox = function(i) {
      if (!i) return { x: -1, y: -1, width: -1, height: -1 };
      const a = i.split(",", 4).map((h) => At(h.trim(), "-1"));
      if (a.length < 4 || a[2] < 0 || a[3] < 0) return { x: -1, y: -1, width: -1, height: -1 };
      const [r, o, l, c] = a;
      return { x: r, y: o, width: l, height: c };
    }(t.imagingBBox), this.long = At(t.long), this.orientation = at(t.orientation, ["portrait", "landscape"]), this.short = At(t.short), this.stock = t.stock || "", this.trayIn = at(t.trayIn, ["auto", "delegate", "pageFront"]), this.trayOut = at(t.trayOut, ["auto", "delegate"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class QM extends tt {
  constructor(t) {
    super(mt, "message", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.text = new R();
  }
}
class tF extends tt {
  constructor(t) {
    super(mt, "numericEdit", !0), this.hScrollPolicy = at(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.comb = null, this.extras = null, this.margin = null;
  }
  [Mt](t) {
    var a;
    const e = pi(this, "border", "font", "margin"), i = this[Nt]()[Nt](), n = { name: "input", attributes: { type: "text", fieldId: i[oe], dataId: ((a = i[xn]) == null ? void 0 : a[oe]) || i[oe], class: ["xfaTextfield"], style: e, "aria-label": dh(i), "aria-required": !1 } };
    return T2(i) && (n.attributes["aria-required"] = !0, n.attributes.required = !0), Ct.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [n] });
  }
}
class eF extends tt {
  constructor(t) {
    super(mt, "occur", !0), this.id = t.id || "", this.initial = t.initial !== "" ? Pt({ data: t.initial, defaultValue: "", validate: (e) => !0 }) : "", this.max = t.max !== "" ? Pt({ data: t.max, defaultValue: 1, validate: (e) => !0 }) : "", this.min = t.min !== "" ? Pt({ data: t.min, defaultValue: 1, validate: (e) => !0 }) : "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [Mn]() {
    const t = this[Nt](), e = this.min;
    this.min === "" && (this.min = t instanceof B1 || t instanceof A0 ? 0 : 1), this.max === "" && (this.max = e === "" ? t instanceof B1 || t instanceof A0 ? -1 : 1 : this.min), this.max !== -1 && this.max < this.min && (this.max = this.min), this.initial === "" && (this.initial = t instanceof $7 ? 1 : this.min);
  }
}
class sF extends jt {
  constructor(t) {
    super(mt, "oid"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class iF extends tt {
  constructor(t) {
    super(mt, "oids", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.oid = new R();
  }
}
class $x extends tt {
  constructor(t) {
    super(mt, "overflow"), this.id = t.id || "", this.leader = t.leader || "", this.target = t.target || "", this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ls]() {
    if (!this[J]) {
      const t = this[Nt](), e = this[ze](), i = e[Or](this.target, t), n = e[Or](this.leader, t), a = e[Or](this.trailer, t);
      this[J] = { target: (i == null ? void 0 : i[0]) || null, leader: (n == null ? void 0 : n[0]) || null, trailer: (a == null ? void 0 : a[0]) || null, addLeader: !1, addTrailer: !1 };
    }
    return this[J];
  }
}
class B1 extends tt {
  constructor(t) {
    super(mt, "pageArea", !0), this.blankOrNotBlank = at(t.blankOrNotBlank, ["any", "blank", "notBlank"]), this.id = t.id || "", this.initialNumber = Pt({ data: t.initialNumber, defaultValue: 1, validate: (e) => !0 }), this.name = t.name || "", this.numbered = Pt({ data: t.numbered, defaultValue: 1, validate: (e) => !0 }), this.oddOrEven = at(t.oddOrEven, ["any", "even", "odd"]), this.pagePosition = at(t.pagePosition, ["any", "first", "last", "only", "rest"]), this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.desc = null, this.extras = null, this.medium = null, this.occur = null, this.area = new R(), this.contentArea = new R(), this.draw = new R(), this.exclGroup = new R(), this.field = new R(), this.subform = new R();
  }
  [v0]() {
    return this[J] ? !this.occur || this.occur.max === -1 || this[J].numberOfUse < this.occur.max : (this[J] = { numberOfUse: 0 }, !0);
  }
  [zh]() {
    delete this[J];
  }
  [ir]() {
    this[J] || (this[J] = { numberOfUse: 0 });
    const t = this[Nt]();
    return t.relation === "orderedOccurrence" && this[v0]() ? (this[J].numberOfUse += 1, this) : t[ir]();
  }
  [nh]() {
    return this[J].space || { width: 0, height: 0 };
  }
  [Mt]() {
    this[J] || (this[J] = { numberOfUse: 1 });
    const t = [];
    this[J].children = t;
    const e = /* @__PURE__ */ Object.create(null);
    if (this.medium && this.medium.short && this.medium.long) {
      if (e.width = Rt(this.medium.short), e.height = Rt(this.medium.long), this[J].space = { width: this.medium.short, height: this.medium.long }, this.medium.orientation === "landscape") {
        const i = e.width;
        e.width = e.height, e.height = i, this[J].space = { width: this.medium.long, height: this.medium.short };
      }
    } else D("XFA - No medium specified in pageArea: please file a bug.");
    return this[cl]({ filter: /* @__PURE__ */ new Set(["area", "draw", "field", "subform"]), include: !0 }), this[cl]({ filter: /* @__PURE__ */ new Set(["contentArea"]), include: !0 }), Ct.success({ name: "div", children: t, attributes: { class: ["xfaPage"], id: this[oe], style: e, xfaName: this.name } });
  }
}
class A0 extends tt {
  constructor(t) {
    super(mt, "pageSet", !0), this.duplexImposition = at(t.duplexImposition, ["longEdge", "shortEdge"]), this.id = t.id || "", this.name = t.name || "", this.relation = at(t.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]), this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.occur = null, this.pageArea = new R(), this.pageSet = new R();
  }
  [zh]() {
    for (const t of this.pageArea.children) t[zh]();
    for (const t of this.pageSet.children) t[zh]();
  }
  [v0]() {
    return !this.occur || this.occur.max === -1 || this[J].numberOfUse < this.occur.max;
  }
  [ir]() {
    if (this[J] || (this[J] = { numberOfUse: 1, pageIndex: -1, pageSetIndex: -1 }), this.relation === "orderedOccurrence") {
      if (this[J].pageIndex + 1 < this.pageArea.children.length)
        return this[J].pageIndex += 1, this.pageArea.children[this[J].pageIndex][ir]();
      if (this[J].pageSetIndex + 1 < this.pageSet.children.length)
        return this[J].pageSetIndex += 1, this.pageSet.children[this[J].pageSetIndex][ir]();
      if (this[v0]())
        return this[J].numberOfUse += 1, this[J].pageIndex = -1, this[J].pageSetIndex = -1, this[ir]();
      const a = this[Nt]();
      return a instanceof A0 ? a[ir]() : (this[zh](), this[ir]());
    }
    const t = this[ze]()[J].pageNumber, e = t % 2 == 0 ? "even" : "odd", i = t === 0 ? "first" : "rest";
    let n = this.pageArea.children.find((a) => a.oddOrEven === e && a.pagePosition === i);
    return n || (n = this.pageArea.children.find((a) => a.oddOrEven === "any" && a.pagePosition === i), n) ? n : (n = this.pageArea.children.find((a) => a.oddOrEven === "any" && a.pagePosition === "any"), n || this.pageArea.children[0]);
  }
}
class nF extends tt {
  constructor(t) {
    super(mt, "para", !0), this.hAlign = at(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.lineHeight = t.lineHeight ? At(t.lineHeight, "0pt") : "", this.marginLeft = t.marginLeft ? At(t.marginLeft, "0pt") : "", this.marginRight = t.marginRight ? At(t.marginRight, "0pt") : "", this.orphans = Pt({ data: t.orphans, defaultValue: 0, validate: (e) => e >= 0 }), this.preserve = t.preserve || "", this.radixOffset = t.radixOffset ? At(t.radixOffset, "0pt") : "", this.spaceAbove = t.spaceAbove ? At(t.spaceAbove, "0pt") : "", this.spaceBelow = t.spaceBelow ? At(t.spaceBelow, "0pt") : "", this.tabDefault = t.tabDefault ? At(this.tabDefault) : "", this.tabStops = (t.tabStops || "").trim().split(/\s+/).map((e, i) => i % 2 == 1 ? At(e) : e), this.textIndent = t.textIndent ? At(t.textIndent, "0pt") : "", this.use = t.use || "", this.usehref = t.usehref || "", this.vAlign = at(t.vAlign, ["top", "bottom", "middle"]), this.widows = Pt({ data: t.widows, defaultValue: 0, validate: (e) => e >= 0 }), this.hyphenation = null;
  }
  [Zt]() {
    const t = pi(this, "hAlign");
    return this.marginLeft !== "" && (t.paddingLeft = Rt(this.marginLeft)), this.marginRight !== "" && (t.paddingRight = Rt(this.marginRight)), this.spaceAbove !== "" && (t.paddingTop = Rt(this.spaceAbove)), this.spaceBelow !== "" && (t.paddingBottom = Rt(this.spaceBelow)), this.textIndent !== "" && (t.textIndent = Rt(this.textIndent), Sx(t)), this.lineHeight > 0 && (t.lineHeight = Rt(this.lineHeight)), this.tabDefault !== "" && (t.tabSize = Rt(this.tabDefault)), this.tabStops.length, this.hyphenatation && Object.assign(t, this.hyphenatation[Zt]()), t;
  }
}
class aF extends tt {
  constructor(t) {
    super(mt, "passwordEdit", !0), this.hScrollPolicy = at(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.passwordChar = t.passwordChar || "*", this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
}
class rF extends tt {
  constructor(t) {
    super(mt, "pattern", !0), this.id = t.id || "", this.type = at(t.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [Zt](t) {
    t = t ? t[Zt]() : "#FFFFFF";
    const e = this.color ? this.color[Zt]() : "#000000", i = "repeating-linear-gradient", n = `${t},${t} 5px,${e} 5px,${e} 10px`;
    switch (this.type) {
      case "crossHatch":
        return `${i}(to top,${n}) ${i}(to right,${n})`;
      case "crossDiagonal":
        return `${i}(45deg,${n}) ${i}(-45deg,${n})`;
      case "diagonalLeft":
        return `${i}(45deg,${n})`;
      case "diagonalRight":
        return `${i}(-45deg,${n})`;
      case "horizontal":
        return `${i}(to top,${n})`;
      case "vertical":
        return `${i}(to right,${n})`;
    }
    return "";
  }
}
class oF extends jt {
  constructor(t) {
    super(mt, "picture"), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class lF extends tt {
  constructor(t) {
    super(mt, "proto", !0), this.appearanceFilter = new R(), this.arc = new R(), this.area = new R(), this.assist = new R(), this.barcode = new R(), this.bindItems = new R(), this.bookend = new R(), this.boolean = new R(), this.border = new R(), this.break = new R(), this.breakAfter = new R(), this.breakBefore = new R(), this.button = new R(), this.calculate = new R(), this.caption = new R(), this.certificate = new R(), this.certificates = new R(), this.checkButton = new R(), this.choiceList = new R(), this.color = new R(), this.comb = new R(), this.connect = new R(), this.contentArea = new R(), this.corner = new R(), this.date = new R(), this.dateTime = new R(), this.dateTimeEdit = new R(), this.decimal = new R(), this.defaultUi = new R(), this.desc = new R(), this.digestMethod = new R(), this.digestMethods = new R(), this.draw = new R(), this.edge = new R(), this.encoding = new R(), this.encodings = new R(), this.encrypt = new R(), this.encryptData = new R(), this.encryption = new R(), this.encryptionMethod = new R(), this.encryptionMethods = new R(), this.event = new R(), this.exData = new R(), this.exObject = new R(), this.exclGroup = new R(), this.execute = new R(), this.extras = new R(), this.field = new R(), this.fill = new R(), this.filter = new R(), this.float = new R(), this.font = new R(), this.format = new R(), this.handler = new R(), this.hyphenation = new R(), this.image = new R(), this.imageEdit = new R(), this.integer = new R(), this.issuers = new R(), this.items = new R(), this.keep = new R(), this.keyUsage = new R(), this.line = new R(), this.linear = new R(), this.lockDocument = new R(), this.manifest = new R(), this.margin = new R(), this.mdp = new R(), this.medium = new R(), this.message = new R(), this.numericEdit = new R(), this.occur = new R(), this.oid = new R(), this.oids = new R(), this.overflow = new R(), this.pageArea = new R(), this.pageSet = new R(), this.para = new R(), this.passwordEdit = new R(), this.pattern = new R(), this.picture = new R(), this.radial = new R(), this.reason = new R(), this.reasons = new R(), this.rectangle = new R(), this.ref = new R(), this.script = new R(), this.setProperty = new R(), this.signData = new R(), this.signature = new R(), this.signing = new R(), this.solid = new R(), this.speak = new R(), this.stipple = new R(), this.subform = new R(), this.subformSet = new R(), this.subjectDN = new R(), this.subjectDNs = new R(), this.submit = new R(), this.text = new R(), this.textEdit = new R(), this.time = new R(), this.timeStamp = new R(), this.toolTip = new R(), this.traversal = new R(), this.traverse = new R(), this.ui = new R(), this.validate = new R(), this.value = new R(), this.variables = new R();
  }
}
class cF extends tt {
  constructor(t) {
    super(mt, "radial", !0), this.id = t.id || "", this.type = at(t.type, ["toEdge", "toCenter"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [Zt](t) {
    t = t ? t[Zt]() : "#FFFFFF";
    const e = this.color ? this.color[Zt]() : "#000000";
    return `radial-gradient(circle at center, ${this.type === "toEdge" ? `${t},${e}` : `${e},${t}`})`;
  }
}
class hF extends jt {
  constructor(t) {
    super(mt, "reason"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class uF extends tt {
  constructor(t) {
    super(mt, "reasons", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.reason = new R();
  }
}
class zx extends tt {
  constructor(t) {
    super(mt, "rectangle", !0), this.hand = at(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.corner = new R(4), this.edge = new R(4), this.fill = null;
  }
  [Mt]() {
    var r;
    const t = this.edge.children.length ? this.edge.children[0] : new E2({}), e = t[Zt](), i = /* @__PURE__ */ Object.create(null);
    ((r = this.fill) == null ? void 0 : r.presence) === "visible" ? Object.assign(i, this.fill[Zt]()) : i.fill = "transparent", i.strokeWidth = Rt(t.presence === "visible" ? t.thickness : 0), i.stroke = e.color;
    const n = (this.corner.children.length ? this.corner.children[0] : new Ux({}))[Zt](), a = { name: "svg", children: [{ name: "rect", attributes: { xmlns: rh, width: "100%", height: "100%", x: 0, y: 0, rx: n.radius, ry: n.radius, style: i } }], attributes: { xmlns: rh, style: { overflow: "visible" }, width: "100%", height: "100%" } };
    return L7(this[Nt]()[Nt]()) ? Ct.success({ name: "div", attributes: { style: { display: "inline", width: "100%", height: "100%" } }, children: [a] }) : (a.attributes.style.position = "absolute", Ct.success(a));
  }
}
class dF extends jt {
  constructor(t) {
    super(mt, "ref"), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class fF extends jt {
  constructor(t) {
    super(mt, "script"), this.binding = t.binding || "", this.contentType = t.contentType || "", this.id = t.id || "", this.name = t.name || "", this.runAt = at(t.runAt, ["client", "both", "server"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class F6 extends tt {
  constructor(t) {
    super(mt, "setProperty"), this.connection = t.connection || "", this.ref = t.ref || "", this.target = t.target || "";
  }
}
class gF extends tt {
  constructor(t) {
    super(mt, "signData", !0), this.id = t.id || "", this.operation = at(t.operation, ["sign", "clear", "verify"]), this.ref = t.ref || "", this.target = t.target || "", this.use = t.use || "", this.usehref = t.usehref || "", this.filter = null, this.manifest = null;
  }
}
class pF extends tt {
  constructor(t) {
    super(mt, "signature", !0), this.id = t.id || "", this.type = at(t.type, ["PDF1.3", "PDF1.6"]), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.filter = null, this.manifest = null, this.margin = null;
  }
}
class mF extends tt {
  constructor(t) {
    super(mt, "signing", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = new R();
  }
}
class bF extends tt {
  constructor(t) {
    super(mt, "solid", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [Zt](t) {
    return t ? t[Zt]() : "#FFFFFF";
  }
}
class yF extends jt {
  constructor(t) {
    super(mt, "speak"), this.disable = Pt({ data: t.disable, defaultValue: 0, validate: (e) => e === 1 }), this.id = t.id || "", this.priority = at(t.priority, ["custom", "caption", "name", "toolTip"]), this.rid = t.rid || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class wF extends tt {
  constructor(t) {
    super(mt, "stipple", !0), this.id = t.id || "", this.rate = Pt({ data: t.rate, defaultValue: 50, validate: (e) => e >= 0 && e <= 100 }), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [Zt](t) {
    const e = this.rate / 100;
    return se.makeHexColor(Math.round(t.value.r * (1 - e) + this.value.r * e), Math.round(t.value.g * (1 - e) + this.value.g * e), Math.round(t.value.b * (1 - e) + this.value.b * e));
  }
}
class Gx extends tt {
  constructor(t) {
    super(mt, "subform", !0), this.access = at(t.access, ["open", "nonInteractive", "protected", "readOnly"]), this.allowMacro = Pt({ data: t.allowMacro, defaultValue: 0, validate: (e) => e === 1 }), this.anchorType = at(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Pt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.columnWidths = (t.columnWidths || "").trim().split(/\s+/).map((e) => e === "-1" ? -1 : At(e)), this.h = t.h ? At(t.h) : "", this.hAlign = at(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.layout = at(t.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]), this.locale = t.locale || "", this.maxH = At(t.maxH, "0pt"), this.maxW = At(t.maxW, "0pt"), this.mergeMode = at(t.mergeMode, ["consumeData", "matchTemplate"]), this.minH = At(t.minH, "0pt"), this.minW = At(t.minW, "0pt"), this.name = t.name || "", this.presence = at(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = ca(t.relevant), this.restoreState = at(t.restoreState, ["manual", "auto"]), this.scope = at(t.scope, ["name", "none"]), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? At(t.w) : "", this.x = At(t.x, "0pt"), this.y = At(t.y, "0pt"), this.assist = null, this.bind = null, this.bookend = null, this.border = null, this.break = null, this.calculate = null, this.desc = null, this.extras = null, this.keep = null, this.margin = null, this.occur = null, this.overflow = null, this.pageSet = null, this.para = null, this.traversal = null, this.validate = null, this.variables = null, this.area = new R(), this.breakAfter = new R(), this.breakBefore = new R(), this.connect = new R(), this.draw = new R(), this.event = new R(), this.exObject = new R(), this.exclGroup = new R(), this.field = new R(), this.proto = new R(), this.setProperty = new R(), this.subform = new R(), this.subformSet = new R();
  }
  [Ve]() {
    const t = this[Nt]();
    return t instanceof H7 ? t[Ve]() : t;
  }
  [yh]() {
    return !0;
  }
  [Yr]() {
    return this.layout.endsWith("-tb") && this[J].attempt === 0 && this[J].numberInLine > 0 || this[Nt]()[Yr]();
  }
  *[N1]() {
    yield* U7(this);
  }
  [_2]() {
    return Mx(this);
  }
  [ih](t, e) {
    Fx(this, t, e);
  }
  [nh]() {
    return Rx(this);
  }
  [qr]() {
    var e;
    const t = this[Ve]();
    return t[qr]() ? this[J]._isSplittable !== void 0 ? this[J]._isSplittable : this.layout === "position" || this.layout.includes("row") ? (this[J]._isSplittable = !1, !1) : this.keep && this.keep.intact !== "none" ? (this[J]._isSplittable = !1, !1) : (e = t.layout) != null && e.endsWith("-tb") && t[J].numberInLine !== 0 ? !1 : (this[J]._isSplittable = !0, !0) : !1;
  }
  [Mt](t) {
    var A;
    if (am(this), this.break) {
      if (this.break.after !== "auto" || this.break.afterTarget !== "") {
        const x = new Nx({ targetType: this.break.after, target: this.break.afterTarget, startNew: this.break.startNew.toString() });
        x[fe] = this[fe], this[Ne](x), this.breakAfter.push(x);
      }
      if (this.break.before !== "auto" || this.break.beforeTarget !== "") {
        const x = new Bx({ targetType: this.break.before, target: this.break.beforeTarget, startNew: this.break.startNew.toString() });
        x[fe] = this[fe], this[Ne](x), this.breakBefore.push(x);
      }
      if (this.break.overflowTarget !== "") {
        const x = new $x({ target: this.break.overflowTarget, leader: this.break.overflowLeader, trailer: this.break.overflowTrailer });
        x[fe] = this[fe], this[Ne](x), this.overflow.push(x);
      }
      this[el](this.break), this.break = null;
    }
    if (this.presence === "hidden" || this.presence === "inactive") return Ct.EMPTY;
    if ((this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) && D("XFA - Several breakBefore or breakAfter in subforms: please file a bug."), this.breakBefore.children.length >= 1) {
      const x = this.breakBefore.children[0];
      if (ub(x)) return Ct.breakNode(x);
    }
    if ((A = this[J]) != null && A.afterBreakAfter) return Ct.EMPTY;
    im(this);
    const e = [], i = { id: this[oe], class: [] };
    B7(this, i.class), this[J] || (this[J] = /* @__PURE__ */ Object.create(null)), Object.assign(this[J], { children: e, line: null, attributes: i, attempt: 0, numberInLine: 0, availableSpace: { width: Math.min(this.w || 1 / 0, t.width), height: Math.min(this.h || 1 / 0, t.height) }, width: 0, height: 0, prevHeight: 0, currentWidth: 0 });
    const n = this[ze](), a = n[J].noLayoutFailure, r = this[qr]();
    if (r || om(this), !nm(this, t)) return Ct.FAILURE;
    const o = /* @__PURE__ */ new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]);
    if (this.layout.includes("row")) {
      const x = this[Ve]().columnWidths;
      Array.isArray(x) && x.length > 0 && (this[J].columnWidths = x, this[J].currentColumn = 0);
    }
    const l = pi(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"), c = ["xfaSubform"], h = kx(this);
    if (h && c.push(h), i.style = l, i.class = c, this.name && (i.xfaName = this.name), this.overflow) {
      const x = this.overflow[Ls]();
      x.addLeader && (x.addLeader = !1, db(this, x.leader, t));
    }
    this[j1]();
    const u = this.layout === "lr-tb" || this.layout === "rl-tb", f = u ? 2 : 1;
    for (; this[J].attempt < f; this[J].attempt++) {
      u && this[J].attempt === 1 && (this[J].numberInLine = 0);
      const x = this[cl]({ filter: o, include: !0 });
      if (x.success) break;
      if (x.isBreak())
        return this[ki](), x;
      if (u && this[J].attempt === 0 && this[J].numberInLine === 0 && !n[J].noLayoutFailure) {
        this[J].attempt = f;
        break;
      }
    }
    if (this[ki](), r || lm(this), n[J].noLayoutFailure = a, this[J].attempt === f)
      return this.overflow && (this[ze]()[J].overflowNode = this.overflow), r || delete this[J], Ct.FAILURE;
    if (this.overflow) {
      const x = this.overflow[Ls]();
      x.addTrailer && (x.addTrailer = !1, db(this, x.trailer, t));
    }
    let d = 0, p = 0;
    this.margin && (d = this.margin.leftInset + this.margin.rightInset, p = this.margin.topInset + this.margin.bottomInset);
    const m = Math.max(this[J].width + d, this.w || 0), b = Math.max(this[J].height + p, this.h || 0), y = [this.x, this.y, m, b];
    if (this.w === "" && (l.width = Rt(m)), this.h === "" && (l.height = Rt(b)), (l.width === "0px" || l.height === "0px") && e.length === 0) return Ct.EMPTY;
    const v = { name: "div", attributes: i, children: e };
    rm(this, i);
    const w = Ct.success(ah(this, v), y);
    if (this.breakAfter.children.length >= 1) {
      const x = this.breakAfter.children[0];
      if (ub(x))
        return this[J].afterBreakAfter = w, Ct.breakNode(x);
    }
    return delete this[J], w;
  }
}
class H7 extends tt {
  constructor(t) {
    super(mt, "subformSet", !0), this.id = t.id || "", this.name = t.name || "", this.relation = at(t.relation, ["ordered", "choice", "unordered"]), this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.bookend = null, this.break = null, this.desc = null, this.extras = null, this.occur = null, this.overflow = null, this.breakAfter = new R(), this.breakBefore = new R(), this.subform = new R(), this.subformSet = new R();
  }
  *[N1]() {
    yield* U7(this);
  }
  [Ve]() {
    let t = this[Nt]();
    for (; !(t instanceof Gx); ) t = t[Nt]();
    return t;
  }
  [yh]() {
    return !0;
  }
}
class vF extends Oe {
  constructor(t) {
    super(mt, "subjectDN"), this.delimiter = t.delimiter || ",", this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    this[it] = new Map(this[it].split(this.delimiter).map((t) => ((t = t.split("=", 2))[0] = t[0].trim(), t)));
  }
}
class AF extends tt {
  constructor(t) {
    super(mt, "subjectDNs", !0), this.id = t.id || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.subjectDN = new R();
  }
}
class xF extends tt {
  constructor(t) {
    super(mt, "submit", !0), this.embedPDF = Pt({ data: t.embedPDF, defaultValue: 0, validate: (e) => e === 1 }), this.format = at(t.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]), this.id = t.id || "", this.target = t.target || "", this.textEncoding = sm({ data: t.textEncoding ? t.textEncoding.toLowerCase() : "", defaultValue: "", validate: (e) => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(e) || e.match(/iso-8859-\d{2}/) }), this.use = t.use || "", this.usehref = t.usehref || "", this.xdpContent = t.xdpContent || "", this.encrypt = null, this.encryptData = new R(), this.signData = new R();
  }
}
class $7 extends tt {
  constructor(t) {
    super(mt, "template", !0), this.baseProfile = at(t.baseProfile, ["full", "interactiveForms"]), this.extras = null, this.subform = new R();
  }
  [ge]() {
    this.subform.children.length === 0 && D("XFA - No subforms in template node."), this.subform.children.length >= 2 && D("XFA - Several subforms in template node: please file a bug."), this[Jn] = 5e3;
  }
  [qr]() {
    return !0;
  }
  [Or](t, e) {
    return t.startsWith("#") ? [this[jh].get(t.slice(1))] : ro(this, e, t, !0, !0);
  }
  *[mx]() {
    var p, m, b;
    if (!this.subform.children.length) return Ct.success({ name: "div", children: [] });
    this[J] = { overflowNode: null, firstUnsplittable: null, currentContentArea: null, currentPageArea: null, noLayoutFailure: !1, pageNumber: 1, pagePosition: "first", oddOrEven: "odd", blankOrNotBlank: "nonBlank", paraStack: [] };
    const t = this.subform.children[0];
    t.pageSet[zh]();
    const e = t.pageSet.pageArea.children, i = { name: "div", children: [] };
    let n = null, a = null, r = null;
    if (t.breakBefore.children.length >= 1 ? (a = t.breakBefore.children[0], r = a.target) : t.subform.children.length >= 1 && t.subform.children[0].breakBefore.children.length >= 1 ? (a = t.subform.children[0].breakBefore.children[0], r = a.target) : (p = t.break) != null && p.beforeTarget ? (a = t.break, r = a.beforeTarget) : t.subform.children.length >= 1 && ((m = t.subform.children[0].break) != null && m.beforeTarget) && (a = t.subform.children[0].break, r = a.beforeTarget), a) {
      const y = this[Or](r, a[Nt]());
      y instanceof B1 && (n = y, a[J] = {});
    }
    n || (n = e[0]), n[J] = { numberOfUse: 1 };
    const o = n[Nt]();
    o[J] = { numberOfUse: 1, pageIndex: o.pageArea.children.indexOf(n), pageSetIndex: 0 };
    let l, c = null, h = null, u = !0, f = 0, d = 0;
    for (; ; ) {
      if (u) f = 0;
      else if (i.children.pop(), ++f == 3)
        return D("XFA - Something goes wrong: please file a bug."), i;
      l = null, this[J].currentPageArea = n;
      const y = n[Mt]().html;
      i.children.push(y), c && (this[J].noLayoutFailure = !0, y.children.push(c[Mt](n[J].space).html), c = null), h && (this[J].noLayoutFailure = !0, y.children.push(h[Mt](n[J].space).html), h = null);
      const v = n.contentArea.children, w = y.children.filter((x) => x.attributes.class.includes("xfaContentarea"));
      u = !1, this[J].firstUnsplittable = null, this[J].noLayoutFailure = !1;
      const A = (x) => {
        var I;
        const k = t[_2]();
        k && (u || (u = ((I = k.children) == null ? void 0 : I.length) > 0), w[x].children.push(k));
      };
      for (let x = d, k = v.length; x < k; x++) {
        const I = this[J].currentContentArea = v[x], T = { width: I.w, height: I.h };
        d = 0, c && (w[x].children.push(c[Mt](T).html), c = null), h && (w[x].children.push(h[Mt](T).html), h = null);
        const E = t[Mt](T);
        if (E.success)
          return E.html ? (u || (u = ((b = E.html.children) == null ? void 0 : b.length) > 0), w[x].children.push(E.html)) : !u && i.children.length > 1 && i.children.pop(), i;
        if (E.isBreak()) {
          const M = E.breakNode;
          if (A(x), M.targetType === "auto") continue;
          M.leader && (c = this[Or](M.leader, M[Nt]()), c = c ? c[0] : null), M.trailer && (h = this[Or](M.trailer, M[Nt]()), h = h ? h[0] : null), M.targetType === "pageArea" ? (l = M[J].target, x = 1 / 0) : M[J].target ? (l = M[J].target, d = M[J].index + 1, x = 1 / 0) : x = M[J].index;
        } else if (this[J].overflowNode) {
          const M = this[J].overflowNode;
          this[J].overflowNode = null;
          const F = M[Ls](), L = F.target;
          F.addLeader = F.leader !== null, F.addTrailer = F.trailer !== null, A(x);
          const Y = x;
          if (x = 1 / 0, L instanceof B1) l = L;
          else if (L instanceof q7) {
            const B = v.indexOf(L);
            B !== -1 ? B > Y ? x = B - 1 : d = B : (l = L[Nt](), d = l.contentArea.children.indexOf(L));
          }
        } else A(x);
      }
      this[J].pageNumber += 1, l && (l[v0]() ? l[J].numberOfUse += 1 : l = null), n = l || n[ir](), yield null;
    }
  }
}
class Vx extends Oe {
  constructor(t) {
    super(mt, "text"), this.id = t.id || "", this.maxChars = Pt({ data: t.maxChars, defaultValue: 0, validate: (e) => e >= 0 }), this.name = t.name || "", this.rid = t.rid || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Q9]() {
    return !0;
  }
  [qa](t) {
    return t[Ge] === We.xhtml.id ? (this[it] = t, !0) : (D(`XFA - Invalid content in Text: ${t[ee]}.`), !1);
  }
  [jr](t) {
    this[it] instanceof tt || super[jr](t);
  }
  [ge]() {
    typeof this[it] == "string" && (this[it] = this[it].replaceAll(`\r
`, `
`));
  }
  [Ls]() {
    return typeof this[it] == "string" ? this[it].split(/[\u2029\u2028\n]/).filter((t) => !!t).join(`
`) : this[it][ns]();
  }
  [Mt](t) {
    if (typeof this[it] == "string") {
      const e = fl(this[it]).html;
      return this[it].includes("\u2029") ? (e.name = "div", e.children = [], this[it].split("\u2029").map((i) => i.split(/[\u2028\n]/).flatMap((n) => [{ name: "span", value: n }, { name: "br" }])).forEach((i) => {
        e.children.push({ name: "p", children: i });
      })) : /[\u2028\n]/.test(this[it]) && (e.name = "div", e.children = [], this[it].split(/[\u2028\n]/).forEach((i) => {
        e.children.push({ name: "span", value: i }, { name: "br" });
      })), Ct.success(e);
    }
    return this[it][Mt](t);
  }
}
class Wx extends tt {
  constructor(t) {
    super(mt, "textEdit", !0), this.allowRichText = Pt({ data: t.allowRichText, defaultValue: 0, validate: (e) => e === 1 }), this.hScrollPolicy = at(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.multiLine = Pt({ data: t.multiLine, defaultValue: "", validate: (e) => e === 0 || e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.vScrollPolicy = at(t.vScrollPolicy, ["auto", "off", "on"]), this.border = null, this.comb = null, this.extras = null, this.margin = null;
  }
  [Mt](t) {
    var a, r;
    const e = pi(this, "border", "font", "margin");
    let i;
    const n = this[Nt]()[Nt]();
    return this.multiLine === "" && (this.multiLine = n instanceof qx ? 1 : 0), i = this.multiLine === 1 ? { name: "textarea", attributes: { dataId: ((a = n[xn]) == null ? void 0 : a[oe]) || n[oe], fieldId: n[oe], class: ["xfaTextfield"], style: e, "aria-label": dh(n), "aria-required": !1 } } : { name: "input", attributes: { type: "text", dataId: ((r = n[xn]) == null ? void 0 : r[oe]) || n[oe], fieldId: n[oe], class: ["xfaTextfield"], style: e, "aria-label": dh(n), "aria-required": !1 } }, T2(n) && (i.attributes["aria-required"] = !0, i.attributes.required = !0), Ct.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [i] });
  }
}
class kF extends jt {
  constructor(t) {
    super(mt, "time"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ge]() {
    const t = this[it].trim();
    this[it] = t ? new Date(t) : null;
  }
  [Mt](t) {
    return fl(this[it] ? this[it].toString() : "");
  }
}
class SF extends tt {
  constructor(t) {
    super(mt, "timeStamp"), this.id = t.id || "", this.server = t.server || "", this.type = at(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class CF extends jt {
  constructor(t) {
    super(mt, "toolTip"), this.id = t.id || "", this.rid = t.rid || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class IF extends tt {
  constructor(t) {
    super(mt, "traversal", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.traverse = new R();
  }
}
class _F extends tt {
  constructor(t) {
    super(mt, "traverse", !0), this.id = t.id || "", this.operation = at(t.operation, ["next", "back", "down", "first", "left", "right", "up"]), this.ref = t.ref || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.script = null;
  }
  get name() {
    return this.operation;
  }
  [w0]() {
    return !1;
  }
}
class z7 extends tt {
  constructor(t) {
    super(mt, "ui", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.picture = null, this.barcode = null, this.button = null, this.checkButton = null, this.choiceList = null, this.dateTimeEdit = null, this.defaultUi = null, this.imageEdit = null, this.numericEdit = null, this.passwordEdit = null, this.signature = null, this.textEdit = null;
  }
  [Ls]() {
    if (this[J] === void 0) {
      for (const t of Object.getOwnPropertyNames(this)) {
        if (t === "extras" || t === "picture") continue;
        const e = this[t];
        if (e instanceof tt)
          return this[J] = e, e;
      }
      this[J] = null;
    }
    return this[J];
  }
  [Mt](t) {
    const e = this[Ls]();
    return e ? e[Mt](t) : Ct.EMPTY;
  }
}
class TF extends tt {
  constructor(t) {
    super(mt, "validate", !0), this.formatTest = at(t.formatTest, ["warning", "disabled", "error"]), this.id = t.id || "", this.nullTest = at(t.nullTest, ["disabled", "error", "warning"]), this.scriptTest = at(t.scriptTest, ["error", "disabled", "warning"]), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.message = null, this.picture = null, this.script = null;
  }
}
class G7 extends tt {
  constructor(t) {
    super(mt, "value", !0), this.id = t.id || "", this.override = Pt({ data: t.override, defaultValue: 0, validate: (e) => e === 1 }), this.relevant = ca(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.arc = null, this.boolean = null, this.date = null, this.dateTime = null, this.decimal = null, this.exData = null, this.float = null, this.image = null, this.integer = null, this.line = null, this.rectangle = null, this.text = null, this.time = null;
  }
  [_i](t) {
    var n;
    const e = this[Nt]();
    if (e instanceof j7 && ((n = e.ui) != null && n.imageEdit)) {
      this.image || (this.image = new Hx({}), this[Ne](this.image)), this.image[it] = t[it];
      return;
    }
    const i = t[ee];
    if (this[i] === null) {
      for (const a of Object.getOwnPropertyNames(this)) {
        const r = this[a];
        r instanceof tt && (this[a] = null, this[el](r));
      }
      this[t[ee]] = t, this[Ne](t);
    } else this[i][it] = t[it];
  }
  [ns]() {
    if (this.exData) return typeof this.exData[it] == "string" ? this.exData[it].trim() : this.exData[it][ns]().trim();
    for (const t of Object.getOwnPropertyNames(this)) {
      if (t === "image") continue;
      const e = this[t];
      if (e instanceof tt) return (e[it] || "").toString().trim();
    }
    return null;
  }
  [Mt](t) {
    for (const e of Object.getOwnPropertyNames(this)) {
      const i = this[e];
      if (i instanceof tt) return i[Mt](t);
    }
    return Ct.EMPTY;
  }
}
class EF extends tt {
  constructor(t) {
    super(mt, "variables", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new R(), this.date = new R(), this.dateTime = new R(), this.decimal = new R(), this.exData = new R(), this.float = new R(), this.image = new R(), this.integer = new R(), this.manifest = new R(), this.script = new R(), this.text = new R(), this.time = new R();
  }
  [w0]() {
    return !0;
  }
}
class Gp {
  static [la](t, e) {
    if (Gp.hasOwnProperty(t)) {
      const i = Gp[t](e);
      return i[px](e), i;
    }
  }
  static appearanceFilter(t) {
    return new ZE(t);
  }
  static arc(t) {
    return new Px(t);
  }
  static area(t) {
    return new QE(t);
  }
  static assist(t) {
    return new tM(t);
  }
  static barcode(t) {
    return new eM(t);
  }
  static bind(t) {
    return new sM(t);
  }
  static bindItems(t) {
    return new E6(t);
  }
  static bookend(t) {
    return new iM(t);
  }
  static boolean(t) {
    return new nM(t);
  }
  static border(t) {
    return new Dx(t);
  }
  static break(t) {
    return new aM(t);
  }
  static breakAfter(t) {
    return new Nx(t);
  }
  static breakBefore(t) {
    return new Bx(t);
  }
  static button(t) {
    return new rM(t);
  }
  static calculate(t) {
    return new oM(t);
  }
  static caption(t) {
    return new lM(t);
  }
  static certificate(t) {
    return new cM(t);
  }
  static certificates(t) {
    return new hM(t);
  }
  static checkButton(t) {
    return new Lx(t);
  }
  static choiceList(t) {
    return new Ox(t);
  }
  static color(t) {
    return new uM(t);
  }
  static comb(t) {
    return new dM(t);
  }
  static connect(t) {
    return new fM(t);
  }
  static contentArea(t) {
    return new q7(t);
  }
  static corner(t) {
    return new Ux(t);
  }
  static date(t) {
    return new gM(t);
  }
  static dateTime(t) {
    return new pM(t);
  }
  static dateTimeEdit(t) {
    return new mM(t);
  }
  static decimal(t) {
    return new bM(t);
  }
  static defaultUi(t) {
    return new yM(t);
  }
  static desc(t) {
    return new wM(t);
  }
  static digestMethod(t) {
    return new vM(t);
  }
  static digestMethods(t) {
    return new AM(t);
  }
  static draw(t) {
    return new qx(t);
  }
  static edge(t) {
    return new E2(t);
  }
  static encoding(t) {
    return new xM(t);
  }
  static encodings(t) {
    return new kM(t);
  }
  static encrypt(t) {
    return new SM(t);
  }
  static encryptData(t) {
    return new CM(t);
  }
  static encryption(t) {
    return new IM(t);
  }
  static encryptionMethod(t) {
    return new _M(t);
  }
  static encryptionMethods(t) {
    return new TM(t);
  }
  static event(t) {
    return new EM(t);
  }
  static exData(t) {
    return new MM(t);
  }
  static exObject(t) {
    return new FM(t);
  }
  static exclGroup(t) {
    return new jx(t);
  }
  static execute(t) {
    return new RM(t);
  }
  static extras(t) {
    return new PM(t);
  }
  static field(t) {
    return new j7(t);
  }
  static fill(t) {
    return new DM(t);
  }
  static filter(t) {
    return new NM(t);
  }
  static float(t) {
    return new BM(t);
  }
  static font(t) {
    return new LM(t);
  }
  static format(t) {
    return new OM(t);
  }
  static handler(t) {
    return new UM(t);
  }
  static hyphenation(t) {
    return new qM(t);
  }
  static image(t) {
    return new Hx(t);
  }
  static imageEdit(t) {
    return new jM(t);
  }
  static integer(t) {
    return new HM(t);
  }
  static issuers(t) {
    return new $M(t);
  }
  static items(t) {
    return new M6(t);
  }
  static keep(t) {
    return new zM(t);
  }
  static keyUsage(t) {
    return new GM(t);
  }
  static line(t) {
    return new VM(t);
  }
  static linear(t) {
    return new WM(t);
  }
  static lockDocument(t) {
    return new XM(t);
  }
  static manifest(t) {
    return new KM(t);
  }
  static margin(t) {
    return new YM(t);
  }
  static mdp(t) {
    return new JM(t);
  }
  static medium(t) {
    return new ZM(t);
  }
  static message(t) {
    return new QM(t);
  }
  static numericEdit(t) {
    return new tF(t);
  }
  static occur(t) {
    return new eF(t);
  }
  static oid(t) {
    return new sF(t);
  }
  static oids(t) {
    return new iF(t);
  }
  static overflow(t) {
    return new $x(t);
  }
  static pageArea(t) {
    return new B1(t);
  }
  static pageSet(t) {
    return new A0(t);
  }
  static para(t) {
    return new nF(t);
  }
  static passwordEdit(t) {
    return new aF(t);
  }
  static pattern(t) {
    return new rF(t);
  }
  static picture(t) {
    return new oF(t);
  }
  static proto(t) {
    return new lF(t);
  }
  static radial(t) {
    return new cF(t);
  }
  static reason(t) {
    return new hF(t);
  }
  static reasons(t) {
    return new uF(t);
  }
  static rectangle(t) {
    return new zx(t);
  }
  static ref(t) {
    return new dF(t);
  }
  static script(t) {
    return new fF(t);
  }
  static setProperty(t) {
    return new F6(t);
  }
  static signData(t) {
    return new gF(t);
  }
  static signature(t) {
    return new pF(t);
  }
  static signing(t) {
    return new mF(t);
  }
  static solid(t) {
    return new bF(t);
  }
  static speak(t) {
    return new yF(t);
  }
  static stipple(t) {
    return new wF(t);
  }
  static subform(t) {
    return new Gx(t);
  }
  static subformSet(t) {
    return new H7(t);
  }
  static subjectDN(t) {
    return new vF(t);
  }
  static subjectDNs(t) {
    return new AF(t);
  }
  static submit(t) {
    return new xF(t);
  }
  static template(t) {
    return new $7(t);
  }
  static text(t) {
    return new Vx(t);
  }
  static textEdit(t) {
    return new Wx(t);
  }
  static time(t) {
    return new kF(t);
  }
  static timeStamp(t) {
    return new SF(t);
  }
  static toolTip(t) {
    return new CF(t);
  }
  static traversal(t) {
    return new IF(t);
  }
  static traverse(t) {
    return new _F(t);
  }
  static ui(t) {
    return new z7(t);
  }
  static validate(t) {
    return new TF(t);
  }
  static value(t) {
    return new G7(t);
  }
  static variables(t) {
    return new EF(t);
  }
}
const fb = We.datasets.id;
function ag(s) {
  const t = new Vx({});
  return t[it] = s, t;
}
class MF {
  constructor(t) {
    var e;
    this.root = t, this.datasets = t.datasets, this.data = ((e = t.datasets) == null ? void 0 : e.data) || new ja(We.datasets.id, "data"), this.emptyMerge = this.data[xs]().length === 0, this.root.form = this.form = t.template[Qn]();
  }
  _isConsumeData() {
    return !this.emptyMerge && this._mergeMode;
  }
  _isMatchTemplate() {
    return !this._isConsumeData();
  }
  bind() {
    return this._bindElement(this.form, this.data), this.form;
  }
  getData() {
    return this.data;
  }
  _bindValue(t, e, i) {
    var n, a;
    if (t[xn] = e, t[y0]()) if (e[Gh]()) {
      const r = e[M7]();
      t[_i](ag(r));
    } else if (t instanceof j7 && ((a = (n = t.ui) == null ? void 0 : n.choiceList) == null ? void 0 : a.open) === "multiSelect") {
      const r = e[xs]().map((o) => o[it].trim()).join(`
`);
      t[_i](ag(r));
    } else this._isConsumeData() && D("XFA - Nodes haven't the same type.");
    else !e[Gh]() || this._isMatchTemplate() ? this._bindElement(t, e) : D("XFA - Nodes haven't the same type.");
  }
  _findDataByNameToConsume(t, e, i, n) {
    if (!t) return null;
    let a, r;
    for (let o = 0; o < 3; o++) {
      for (a = i[Vd](t, !1, !0); r = a.next().value, !!r; )
        if (e === r[Gh]()) return r;
      if (i[Ge] === We.datasets.id && i[ee] === "data") break;
      i = i[Nt]();
    }
    return n ? (a = this.data[Vd](t, !0, !1), r = a.next().value, r || (a = this.data[S6](t, !0), r = a.next().value, r != null && r[Gh]() ? r : null)) : null;
  }
  _setProperties(t, e) {
    if (t.hasOwnProperty("setProperty")) for (const { ref: i, target: n, connection: a } of t.setProperty.children) {
      if (a || !i) continue;
      const r = ro(this.root, e, i, !1, !1);
      if (!r) {
        D(`XFA - Invalid reference: ${i}.`);
        continue;
      }
      const [o] = r;
      if (!o[co](this.data)) {
        D("XFA - Invalid node: must be a data node.");
        continue;
      }
      const l = ro(this.root, t, n, !1, !1);
      if (!l) {
        D(`XFA - Invalid target: ${n}.`);
        continue;
      }
      const [c] = l;
      if (!c[co](t)) {
        D("XFA - Invalid target: must be a property or subproperty.");
        continue;
      }
      const h = c[Nt]();
      if (c instanceof F6 || h instanceof F6) {
        D("XFA - Invalid target: cannot be a setProperty or one of its properties.");
        continue;
      }
      if (c instanceof E6 || h instanceof E6) {
        D("XFA - Invalid target: cannot be a bindItems or one of its properties.");
        continue;
      }
      const u = o[ns](), f = c[ee];
      if (c instanceof D7) {
        const d = /* @__PURE__ */ Object.create(null);
        d[f] = u;
        const p = Reflect.construct(Object.getPrototypeOf(h).constructor, [d]);
        h[f] = p[f];
      } else c.hasOwnProperty(it) ? (c[xn] = o, c[it] = u, c[ge]()) : D("XFA - Invalid node to use in setProperty");
    }
  }
  _bindItems(t, e) {
    if (!t.hasOwnProperty("items") || !t.hasOwnProperty("bindItems") || t.bindItems.isEmpty()) return;
    for (const a of t.items.children) t[el](a);
    t.items.clear();
    const i = new M6({}), n = new M6({});
    t[Ne](i), t.items.push(i), t[Ne](n), t.items.push(n);
    for (const { ref: a, labelRef: r, valueRef: o, connection: l } of t.bindItems.children) {
      if (l || !a) continue;
      const c = ro(this.root, e, a, !1, !1);
      if (c) for (const h of c) {
        if (!h[co](this.datasets)) {
          D(`XFA - Invalid ref (${a}): must be a datasets child.`);
          continue;
        }
        const u = ro(this.root, h, r, !0, !1);
        if (!u) {
          D(`XFA - Invalid label: ${r}.`);
          continue;
        }
        const [f] = u;
        if (!f[co](this.datasets)) {
          D("XFA - Invalid label: must be a datasets child.");
          continue;
        }
        const d = ro(this.root, h, o, !0, !1);
        if (!d) {
          D(`XFA - Invalid value: ${o}.`);
          continue;
        }
        const [p] = d;
        if (!p[co](this.datasets)) {
          D("XFA - Invalid value: must be a datasets child.");
          continue;
        }
        const m = ag(f[ns]()), b = ag(p[ns]());
        i[Ne](m), i.text.push(m), n[Ne](b), n.text.push(b);
      }
      else D(`XFA - Invalid reference: ${a}.`);
    }
  }
  _bindOccurrences(t, e, i) {
    let n;
    if (e.length > 1 && (n = t[Qn](), n[el](n.occur), n.occur = null), this._bindValue(t, e[0], i), this._setProperties(t, e[0]), this._bindItems(t, e[0]), e.length === 1) return;
    const a = t[Nt](), r = t[ee], o = a[C6](t);
    for (let l = 1, c = e.length; l < c; l++) {
      const h = e[l], u = n[Qn]();
      a[r].push(u), a[ip](o + l, u), this._bindValue(u, h, i), this._setProperties(u, h), this._bindItems(u, h);
    }
  }
  _createOccurrences(t) {
    if (!this.emptyMerge) return;
    const { occur: e } = t;
    if (!e || e.initial <= 1) return;
    const i = t[Nt](), n = t[ee];
    if (!(i[n] instanceof R)) return;
    let a;
    a = t.name ? i[n].children.filter((l) => l.name === t.name).length : i[n].children.length;
    const r = i[C6](t) + 1, o = e.initial - a;
    if (o) {
      const l = t[Qn]();
      l[el](l.occur), l.occur = null, i[n].push(l), i[ip](r, l);
      for (let c = 1; c < o; c++) {
        const h = l[Qn]();
        i[n].push(h), i[ip](r + c, h);
      }
    }
  }
  _getOccurInfo(t) {
    const { name: e, occur: i } = t;
    if (!i || !e) return [1, 1];
    const n = i.max === -1 ? 1 / 0 : i.max;
    return [i.min, n];
  }
  _setAndBind(t, e) {
    this._setProperties(t, e), this._bindItems(t, e), this._bindElement(t, e);
  }
  _bindElement(t, e) {
    const i = [];
    this._createOccurrences(t);
    for (const n of t[xs]()) {
      if (n[xn]) continue;
      if (this._mergeMode === void 0 && n[ee] === "subform") {
        this._mergeMode = n.mergeMode === "consumeData";
        const u = e[xs]();
        if (u.length > 0) this._bindOccurrences(n, [u[0]], null);
        else if (this.emptyMerge) {
          const f = e[Ge] === fb ? -1 : e[Ge], d = n[xn] = new ja(f, n.name || "root");
          e[Ne](d), this._bindElement(n, d);
        }
        continue;
      }
      if (!n[yh]()) continue;
      let a = !1, r = null, o = null, l = null;
      if (n.bind) {
        switch (n.bind.match) {
          case "none":
            this._setAndBind(n, e);
            continue;
          case "global":
            a = !0;
            break;
          case "dataRef":
            if (!n.bind.ref) {
              D(`XFA - ref is empty in node ${n[ee]}.`), this._setAndBind(n, e);
              continue;
            }
            o = n.bind.ref;
        }
        n.bind.picture && (r = n.bind.picture[it]);
      }
      const [c, h] = this._getOccurInfo(n);
      if (o) {
        if (l = ro(this.root, e, o, !0, !1), l === null) {
          if (l = XE(this.data, e, o), !l) continue;
          this._isConsumeData() && (l[La] = !0), this._setAndBind(n, l);
          continue;
        }
        this._isConsumeData() && (l = l.filter((u) => !u[La])), l.length > h ? l = l.slice(0, h) : l.length === 0 && (l = null), l && this._isConsumeData() && l.forEach((u) => {
          u[La] = !0;
        });
      } else {
        if (!n.name) {
          this._setAndBind(n, e);
          continue;
        }
        if (this._isConsumeData()) {
          const u = [];
          for (; u.length < h; ) {
            const f = this._findDataByNameToConsume(n.name, n[y0](), e, a);
            if (!f) break;
            f[La] = !0, u.push(f);
          }
          l = u.length > 0 ? u : null;
        } else {
          if (l = e[Vd](n.name, !1, this.emptyMerge).next().value, !l) {
            if (c === 0) {
              i.push(n);
              continue;
            }
            const u = e[Ge] === fb ? -1 : e[Ge];
            l = n[xn] = new ja(u, n.name), this.emptyMerge && (l[La] = !0), e[Ne](l), this._setAndBind(n, l);
            continue;
          }
          this.emptyMerge && (l[La] = !0), l = [l];
        }
      }
      l ? this._bindOccurrences(n, l, r) : c > 0 ? this._setAndBind(n, e) : i.push(n);
    }
    i.forEach((n) => n[Nt]()[el](n));
  }
}
class FF {
  constructor(t, e) {
    this.data = e, this.dataset = t.datasets || null;
  }
  serialize(t) {
    const e = [[-1, this.data[xs]()]];
    for (; e.length > 0; ) {
      const n = e.at(-1), [a, r] = n;
      if (a + 1 === r.length) {
        e.pop();
        continue;
      }
      const o = r[++n[0]], l = t.get(o[oe]);
      if (l) o[_i](l);
      else {
        const h = o[fx]();
        for (const u of h.values()) {
          const f = t.get(u[oe]);
          if (f) {
            u[_i](f);
            break;
          }
        }
      }
      const c = o[xs]();
      c.length > 0 && e.push([-1, c]);
    }
    const i = ['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];
    if (this.dataset) for (const n of this.dataset[xs]()) n[ee] !== "data" && n[Xd](i);
    return this.data[Xd](i), i.push("</xfa:datasets>"), i.join("");
  }
}
const ot = We.config.id;
class RF extends tt {
  constructor(t) {
    super(ot, "acrobat", !0), this.acrobat7 = null, this.autoSave = null, this.common = null, this.validate = null, this.validateApprovalSignatures = null, this.submitUrl = new R();
  }
}
class PF extends tt {
  constructor(t) {
    super(ot, "acrobat7", !0), this.dynamicRender = null;
  }
}
class DF extends le {
  constructor(t) {
    super(ot, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]);
  }
}
class NF extends le {
  constructor(t) {
    super(ot, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]);
  }
}
class BF extends rs {
  constructor(t) {
    super(ot, "addSilentPrint");
  }
}
class LF extends rs {
  constructor(t) {
    super(ot, "addViewerPreferences");
  }
}
class OF extends vx {
  constructor(t) {
    super(ot, "adjustData");
  }
}
class UF extends ha {
  constructor(t) {
    super(ot, "adobeExtensionLevel", 0, (e) => e >= 1 && e <= 8);
  }
}
class qF extends tt {
  constructor(t) {
    super(ot, "agent", !0), this.name = t.name ? t.name.trim() : "", this.common = new R();
  }
}
class jF extends Oe {
  constructor(t) {
    super(ot, "alwaysEmbed");
  }
}
class HF extends jt {
  constructor(t) {
    super(ot, "amd");
  }
}
class $F extends tt {
  constructor(t) {
    super(ot, "area"), this.level = Pt({ data: t.level, defaultValue: 0, validate: (e) => e >= 1 && e <= 3 }), this.name = at(t.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]);
  }
}
class zF extends le {
  constructor(t) {
    super(ot, "attributes", ["preserve", "delegate", "ignore"]);
  }
}
class GF extends le {
  constructor(t) {
    super(ot, "autoSave", ["disabled", "enabled"]);
  }
}
class VF extends jt {
  constructor(t) {
    super(ot, "base");
  }
}
class WF extends tt {
  constructor(t) {
    super(ot, "batchOutput"), this.format = at(t.format, ["none", "concat", "zip", "zipCompress"]);
  }
}
class XF extends Oe {
  constructor(t) {
    super(ot, "behaviorOverride");
  }
  [ge]() {
    this[it] = new Map(this[it].trim().split(/\s+/).filter((t) => t.includes(":")).map((t) => t.split(":", 2)));
  }
}
class KF extends tt {
  constructor(t) {
    super(ot, "cache", !0), this.templateCache = null;
  }
}
class YF extends rs {
  constructor(t) {
    super(ot, "change");
  }
}
class JF extends tt {
  constructor(t) {
    super(ot, "common", !0), this.data = null, this.locale = null, this.localeSet = null, this.messaging = null, this.suppressBanner = null, this.template = null, this.validationMessaging = null, this.versionControl = null, this.log = new R();
  }
}
class ZF extends tt {
  constructor(t) {
    super(ot, "compress"), this.scope = at(t.scope, ["imageOnly", "document"]);
  }
}
class QF extends rs {
  constructor(t) {
    super(ot, "compressLogicalStructure");
  }
}
class tR extends vx {
  constructor(t) {
    super(ot, "compressObjectStream");
  }
}
class eR extends tt {
  constructor(t) {
    super(ot, "compression", !0), this.compressLogicalStructure = null, this.compressObjectStream = null, this.level = null, this.type = null;
  }
}
class sR extends tt {
  constructor(t) {
    super(ot, "config", !0), this.acrobat = null, this.present = null, this.trace = null, this.agent = new R();
  }
}
class iR extends le {
  constructor(t) {
    super(ot, "conformance", ["A", "B"]);
  }
}
class nR extends rs {
  constructor(t) {
    super(ot, "contentCopy");
  }
}
class aR extends ha {
  constructor(t) {
    super(ot, "copies", 1, (e) => e >= 1);
  }
}
class rR extends jt {
  constructor(t) {
    super(ot, "creator");
  }
}
class oR extends ha {
  constructor(t) {
    super(ot, "currentPage", 0, (e) => e >= 0);
  }
}
class lR extends tt {
  constructor(t) {
    super(ot, "data", !0), this.adjustData = null, this.attributes = null, this.incrementalLoad = null, this.outputXSL = null, this.range = null, this.record = null, this.startNode = null, this.uri = null, this.window = null, this.xsl = null, this.excludeNS = new R(), this.transform = new R();
  }
}
class cR extends tt {
  constructor(t) {
    super(ot, "debug", !0), this.uri = null;
  }
}
class hR extends Oe {
  constructor(t) {
    super(ot, "defaultTypeface"), this.writingScript = at(t.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]);
  }
}
class uR extends le {
  constructor(t) {
    super(ot, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]);
  }
}
class dR extends rs {
  constructor(t) {
    super(ot, "documentAssembly");
  }
}
class fR extends tt {
  constructor(t) {
    super(ot, "driver", !0), this.name = t.name ? t.name.trim() : "", this.fontInfo = null, this.xdc = null;
  }
}
class gR extends le {
  constructor(t) {
    super(ot, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]);
  }
}
class pR extends le {
  constructor(t) {
    super(ot, "dynamicRender", ["forbidden", "required"]);
  }
}
class mR extends rs {
  constructor(t) {
    super(ot, "embed");
  }
}
class bR extends rs {
  constructor(t) {
    super(ot, "encrypt");
  }
}
class yR extends tt {
  constructor(t) {
    super(ot, "encryption", !0), this.encrypt = null, this.encryptionLevel = null, this.permissions = null;
  }
}
class wR extends le {
  constructor(t) {
    super(ot, "encryptionLevel", ["40bit", "128bit"]);
  }
}
class vR extends jt {
  constructor(t) {
    super(ot, "enforce");
  }
}
class AR extends tt {
  constructor(t) {
    super(ot, "equate"), this.force = Pt({ data: t.force, defaultValue: 1, validate: (e) => e === 0 }), this.from = t.from || "", this.to = t.to || "";
  }
}
class xR extends tt {
  constructor(t) {
    super(ot, "equateRange"), this.from = t.from || "", this.to = t.to || "", this._unicodeRange = t.unicodeRange || "";
  }
  get unicodeRange() {
    const t = [], e = /U\+([0-9a-fA-F]+)/, i = this._unicodeRange;
    for (let n of i.split(",").map((a) => a.trim()).filter((a) => !!a))
      n = n.split("-", 2).map((a) => {
        const r = a.match(e);
        return r ? parseInt(r[1], 16) : 0;
      }), n.length === 1 && n.push(n[0]), t.push(n);
    return gt(this, "unicodeRange", t);
  }
}
class kR extends Oe {
  constructor(t) {
    super(ot, "exclude");
  }
  [ge]() {
    this[it] = this[it].trim().split(/\s+/).filter((t) => t && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(t));
  }
}
class SR extends jt {
  constructor(t) {
    super(ot, "excludeNS");
  }
}
class CR extends le {
  constructor(t) {
    super(ot, "flipLabel", ["usePrinterSetting", "on", "off"]);
  }
}
class IR extends tt {
  constructor(t) {
    super(ot, "fontInfo", !0), this.embed = null, this.map = null, this.subsetBelow = null, this.alwaysEmbed = new R(), this.defaultTypeface = new R(), this.neverEmbed = new R();
  }
}
class _R extends rs {
  constructor(t) {
    super(ot, "formFieldFilling");
  }
}
class TR extends jt {
  constructor(t) {
    super(ot, "groupParent");
  }
}
class ER extends le {
  constructor(t) {
    super(ot, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]);
  }
}
class MR extends jt {
  constructor(t) {
    super(ot, "includeXDPContent");
  }
}
class FR extends le {
  constructor(t) {
    super(ot, "incrementalLoad", ["none", "forwardOnly"]);
  }
}
class RR extends rs {
  constructor(t) {
    super(ot, "incrementalMerge");
  }
}
class PR extends rs {
  constructor(t) {
    super(ot, "interactive");
  }
}
class DR extends le {
  constructor(t) {
    super(ot, "jog", ["usePrinterSetting", "none", "pageSet"]);
  }
}
class NR extends tt {
  constructor(t) {
    super(ot, "labelPrinter", !0), this.name = at(t.name, ["zpl", "dpl", "ipl", "tcpl"]), this.batchOutput = null, this.flipLabel = null, this.fontInfo = null, this.xdc = null;
  }
}
class BR extends le {
  constructor(t) {
    super(ot, "layout", ["paginate", "panel"]);
  }
}
class LR extends ha {
  constructor(t) {
    super(ot, "level", 0, (e) => e > 0);
  }
}
class OR extends rs {
  constructor(t) {
    super(ot, "linearized");
  }
}
class UR extends jt {
  constructor(t) {
    super(ot, "locale");
  }
}
class qR extends jt {
  constructor(t) {
    super(ot, "localeSet");
  }
}
class jR extends tt {
  constructor(t) {
    super(ot, "log", !0), this.mode = null, this.threshold = null, this.to = null, this.uri = null;
  }
}
class HR extends tt {
  constructor(t) {
    super(ot, "map", !0), this.equate = new R(), this.equateRange = new R();
  }
}
class $R extends tt {
  constructor(t) {
    super(ot, "mediumInfo", !0), this.map = null;
  }
}
class zR extends tt {
  constructor(t) {
    super(ot, "message", !0), this.msgId = null, this.severity = null;
  }
}
class GR extends tt {
  constructor(t) {
    super(ot, "messaging", !0), this.message = new R();
  }
}
class VR extends le {
  constructor(t) {
    super(ot, "mode", ["append", "overwrite"]);
  }
}
class WR extends rs {
  constructor(t) {
    super(ot, "modifyAnnots");
  }
}
class XR extends ha {
  constructor(t) {
    super(ot, "msgId", 1, (e) => e >= 1);
  }
}
class KR extends jt {
  constructor(t) {
    super(ot, "nameAttr");
  }
}
class YR extends Oe {
  constructor(t) {
    super(ot, "neverEmbed");
  }
}
class JR extends ha {
  constructor(t) {
    super(ot, "numberOfCopies", null, (e) => e >= 2 && e <= 5);
  }
}
class ZR extends tt {
  constructor(t) {
    super(ot, "openAction", !0), this.destination = null;
  }
}
class QR extends tt {
  constructor(t) {
    super(ot, "output", !0), this.to = null, this.type = null, this.uri = null;
  }
}
class tP extends jt {
  constructor(t) {
    super(ot, "outputBin");
  }
}
class eP extends tt {
  constructor(t) {
    super(ot, "outputXSL", !0), this.uri = null;
  }
}
class sP extends le {
  constructor(t) {
    super(ot, "overprint", ["none", "both", "draw", "field"]);
  }
}
class iP extends jt {
  constructor(t) {
    super(ot, "packets");
  }
  [ge]() {
    this[it] !== "*" && (this[it] = this[it].trim().split(/\s+/).filter((t) => ["config", "datasets", "template", "xfdf", "xslt"].includes(t)));
  }
}
class nP extends tt {
  constructor(t) {
    super(ot, "pageOffset"), this.x = Pt({ data: t.x, defaultValue: "useXDCSetting", validate: (e) => !0 }), this.y = Pt({ data: t.y, defaultValue: "useXDCSetting", validate: (e) => !0 });
  }
}
class aP extends jt {
  constructor(t) {
    super(ot, "pageRange");
  }
  [ge]() {
    const t = this[it].trim().split(/\s+/).map((i) => parseInt(i, 10)), e = [];
    for (let i = 0, n = t.length; i < n; i += 2) e.push(t.slice(i, i + 2));
    this[it] = e;
  }
}
class rP extends le {
  constructor(t) {
    super(ot, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]);
  }
}
class oP extends le {
  constructor(t) {
    super(ot, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]);
  }
}
class lP extends ha {
  constructor(t) {
    super(ot, "part", 1, (e) => !1);
  }
}
class cP extends tt {
  constructor(t) {
    super(ot, "pcl", !0), this.name = t.name || "", this.batchOutput = null, this.fontInfo = null, this.jog = null, this.mediumInfo = null, this.outputBin = null, this.pageOffset = null, this.staple = null, this.xdc = null;
  }
}
class hP extends tt {
  constructor(t) {
    super(ot, "pdf", !0), this.name = t.name || "", this.adobeExtensionLevel = null, this.batchOutput = null, this.compression = null, this.creator = null, this.encryption = null, this.fontInfo = null, this.interactive = null, this.linearized = null, this.openAction = null, this.pdfa = null, this.producer = null, this.renderPolicy = null, this.scriptModel = null, this.silentPrint = null, this.submitFormat = null, this.tagged = null, this.version = null, this.viewerPreferences = null, this.xdc = null;
  }
}
class uP extends tt {
  constructor(t) {
    super(ot, "pdfa", !0), this.amd = null, this.conformance = null, this.includeXDPContent = null, this.part = null;
  }
}
class dP extends tt {
  constructor(t) {
    super(ot, "permissions", !0), this.accessibleContent = null, this.change = null, this.contentCopy = null, this.documentAssembly = null, this.formFieldFilling = null, this.modifyAnnots = null, this.plaintextMetadata = null, this.print = null, this.printHighQuality = null;
  }
}
class fP extends rs {
  constructor(t) {
    super(ot, "pickTrayByPDFSize");
  }
}
class gP extends jt {
  constructor(t) {
    super(ot, "picture");
  }
}
class pP extends rs {
  constructor(t) {
    super(ot, "plaintextMetadata");
  }
}
class mP extends le {
  constructor(t) {
    super(ot, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]);
  }
}
class bP extends tt {
  constructor(t) {
    super(ot, "present", !0), this.behaviorOverride = null, this.cache = null, this.common = null, this.copies = null, this.destination = null, this.incrementalMerge = null, this.layout = null, this.output = null, this.overprint = null, this.pagination = null, this.paginationOverride = null, this.script = null, this.validate = null, this.xdp = null, this.driver = new R(), this.labelPrinter = new R(), this.pcl = new R(), this.pdf = new R(), this.ps = new R(), this.submitUrl = new R(), this.webClient = new R(), this.zpl = new R();
  }
}
class yP extends rs {
  constructor(t) {
    super(ot, "print");
  }
}
class wP extends rs {
  constructor(t) {
    super(ot, "printHighQuality");
  }
}
class vP extends le {
  constructor(t) {
    super(ot, "printScaling", ["appdefault", "noScaling"]);
  }
}
class AP extends jt {
  constructor(t) {
    super(ot, "printerName");
  }
}
class xP extends jt {
  constructor(t) {
    super(ot, "producer");
  }
}
class kP extends tt {
  constructor(t) {
    super(ot, "ps", !0), this.name = t.name || "", this.batchOutput = null, this.fontInfo = null, this.jog = null, this.mediumInfo = null, this.outputBin = null, this.staple = null, this.xdc = null;
  }
}
let SP = class extends Oe {
  constructor(t) {
    super(ot, "range");
  }
  [ge]() {
    this[it] = this[it].split(",", 2).map((t) => t.split("-").map((e) => parseInt(e.trim(), 10))).filter((t) => t.every((e) => !isNaN(e))).map((t) => (t.length === 1 && t.push(t[0]), t));
  }
};
class CP extends Oe {
  constructor(t) {
    super(ot, "record");
  }
  [ge]() {
    this[it] = this[it].trim();
    const t = parseInt(this[it], 10);
    !isNaN(t) && t >= 0 && (this[it] = t);
  }
}
class IP extends Oe {
  constructor(t) {
    super(ot, "relevant");
  }
  [ge]() {
    this[it] = this[it].trim().split(/\s+/);
  }
}
class _P extends Oe {
  constructor(t) {
    super(ot, "rename");
  }
  [ge]() {
    this[it] = this[it].trim(), (this[it].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[it])) && D("XFA - Rename: invalid XFA name");
  }
}
class TP extends le {
  constructor(t) {
    super(ot, "renderPolicy", ["server", "client"]);
  }
}
class EP extends le {
  constructor(t) {
    super(ot, "runScripts", ["both", "client", "none", "server"]);
  }
}
class MP extends tt {
  constructor(t) {
    super(ot, "script", !0), this.currentPage = null, this.exclude = null, this.runScripts = null;
  }
}
class FP extends le {
  constructor(t) {
    super(ot, "scriptModel", ["XFA", "none"]);
  }
}
class RP extends le {
  constructor(t) {
    super(ot, "severity", ["ignore", "error", "information", "trace", "warning"]);
  }
}
class PP extends tt {
  constructor(t) {
    super(ot, "silentPrint", !0), this.addSilentPrint = null, this.printerName = null;
  }
}
class DP extends tt {
  constructor(t) {
    super(ot, "staple"), this.mode = at(t.mode, ["usePrinterSetting", "on", "off"]);
  }
}
class NP extends jt {
  constructor(t) {
    super(ot, "startNode");
  }
}
class BP extends ha {
  constructor(t) {
    super(ot, "startPage", 0, (e) => !0);
  }
}
class LP extends le {
  constructor(t) {
    super(ot, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]);
  }
}
class OP extends jt {
  constructor(t) {
    super(ot, "submitUrl");
  }
}
class UP extends ha {
  constructor(t) {
    super(ot, "subsetBelow", 100, (e) => e >= 0 && e <= 100);
  }
}
class qP extends rs {
  constructor(t) {
    super(ot, "suppressBanner");
  }
}
class jP extends rs {
  constructor(t) {
    super(ot, "tagged");
  }
}
class HP extends tt {
  constructor(t) {
    super(ot, "template", !0), this.base = null, this.relevant = null, this.startPage = null, this.uri = null, this.xsl = null;
  }
}
class $P extends le {
  constructor(t) {
    super(ot, "threshold", ["trace", "error", "information", "warning"]);
  }
}
class zP extends le {
  constructor(t) {
    super(ot, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]);
  }
}
class GP extends tt {
  constructor(t) {
    super(ot, "templateCache"), this.maxEntries = Pt({ data: t.maxEntries, defaultValue: 5, validate: (e) => e >= 0 });
  }
}
class VP extends tt {
  constructor(t) {
    super(ot, "trace", !0), this.area = new R();
  }
}
class WP extends tt {
  constructor(t) {
    super(ot, "transform", !0), this.groupParent = null, this.ifEmpty = null, this.nameAttr = null, this.picture = null, this.presence = null, this.rename = null, this.whitespace = null;
  }
}
class XP extends le {
  constructor(t) {
    super(ot, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]);
  }
}
class KP extends jt {
  constructor(t) {
    super(ot, "uri");
  }
}
class YP extends le {
  constructor(t) {
    super(ot, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]);
  }
}
class JP extends Oe {
  constructor(t) {
    super(ot, "validateApprovalSignatures");
  }
  [ge]() {
    this[it] = this[it].trim().split(/\s+/).filter((t) => ["docReady", "postSign"].includes(t));
  }
}
class ZP extends le {
  constructor(t) {
    super(ot, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]);
  }
}
class QP extends le {
  constructor(t) {
    super(ot, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]);
  }
}
class tD extends tt {
  constructor(t) {
    super(ot, "VersionControl"), this.outputBelow = at(t.outputBelow, ["warn", "error", "update"]), this.sourceAbove = at(t.sourceAbove, ["warn", "error"]), this.sourceBelow = at(t.sourceBelow, ["update", "maintain"]);
  }
}
class eD extends tt {
  constructor(t) {
    super(ot, "viewerPreferences", !0), this.ADBE_JSConsole = null, this.ADBE_JSDebugger = null, this.addViewerPreferences = null, this.duplexOption = null, this.enforce = null, this.numberOfCopies = null, this.pageRange = null, this.pickTrayByPDFSize = null, this.printScaling = null;
  }
}
class sD extends tt {
  constructor(t) {
    super(ot, "webClient", !0), this.name = t.name ? t.name.trim() : "", this.fontInfo = null, this.xdc = null;
  }
}
class iD extends le {
  constructor(t) {
    super(ot, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]);
  }
}
class nD extends Oe {
  constructor(t) {
    super(ot, "window");
  }
  [ge]() {
    const t = this[it].split(",", 2).map((e) => parseInt(e.trim(), 10));
    t.some((e) => isNaN(e)) ? this[it] = [0, 0] : (t.length === 1 && t.push(t[0]), this[it] = t);
  }
}
class aD extends tt {
  constructor(t) {
    super(ot, "xdc", !0), this.uri = new R(), this.xsl = new R();
  }
}
class rD extends tt {
  constructor(t) {
    super(ot, "xdp", !0), this.packets = null;
  }
}
class oD extends tt {
  constructor(t) {
    super(ot, "xsl", !0), this.debug = null, this.uri = null;
  }
}
class lD extends tt {
  constructor(t) {
    super(ot, "zpl", !0), this.name = t.name ? t.name.trim() : "", this.batchOutput = null, this.flipLabel = null, this.fontInfo = null, this.xdc = null;
  }
}
class Vp {
  static [la](t, e) {
    if (Vp.hasOwnProperty(t)) return Vp[t](e);
  }
  static acrobat(t) {
    return new RF(t);
  }
  static acrobat7(t) {
    return new PF(t);
  }
  static ADBE_JSConsole(t) {
    return new DF(t);
  }
  static ADBE_JSDebugger(t) {
    return new NF(t);
  }
  static addSilentPrint(t) {
    return new BF(t);
  }
  static addViewerPreferences(t) {
    return new LF(t);
  }
  static adjustData(t) {
    return new OF(t);
  }
  static adobeExtensionLevel(t) {
    return new UF(t);
  }
  static agent(t) {
    return new qF(t);
  }
  static alwaysEmbed(t) {
    return new jF(t);
  }
  static amd(t) {
    return new HF(t);
  }
  static area(t) {
    return new $F(t);
  }
  static attributes(t) {
    return new zF(t);
  }
  static autoSave(t) {
    return new GF(t);
  }
  static base(t) {
    return new VF(t);
  }
  static batchOutput(t) {
    return new WF(t);
  }
  static behaviorOverride(t) {
    return new XF(t);
  }
  static cache(t) {
    return new KF(t);
  }
  static change(t) {
    return new YF(t);
  }
  static common(t) {
    return new JF(t);
  }
  static compress(t) {
    return new ZF(t);
  }
  static compressLogicalStructure(t) {
    return new QF(t);
  }
  static compressObjectStream(t) {
    return new tR(t);
  }
  static compression(t) {
    return new eR(t);
  }
  static config(t) {
    return new sR(t);
  }
  static conformance(t) {
    return new iR(t);
  }
  static contentCopy(t) {
    return new nR(t);
  }
  static copies(t) {
    return new aR(t);
  }
  static creator(t) {
    return new rR(t);
  }
  static currentPage(t) {
    return new oR(t);
  }
  static data(t) {
    return new lR(t);
  }
  static debug(t) {
    return new cR(t);
  }
  static defaultTypeface(t) {
    return new hR(t);
  }
  static destination(t) {
    return new uR(t);
  }
  static documentAssembly(t) {
    return new dR(t);
  }
  static driver(t) {
    return new fR(t);
  }
  static duplexOption(t) {
    return new gR(t);
  }
  static dynamicRender(t) {
    return new pR(t);
  }
  static embed(t) {
    return new mR(t);
  }
  static encrypt(t) {
    return new bR(t);
  }
  static encryption(t) {
    return new yR(t);
  }
  static encryptionLevel(t) {
    return new wR(t);
  }
  static enforce(t) {
    return new vR(t);
  }
  static equate(t) {
    return new AR(t);
  }
  static equateRange(t) {
    return new xR(t);
  }
  static exclude(t) {
    return new kR(t);
  }
  static excludeNS(t) {
    return new SR(t);
  }
  static flipLabel(t) {
    return new CR(t);
  }
  static fontInfo(t) {
    return new IR(t);
  }
  static formFieldFilling(t) {
    return new _R(t);
  }
  static groupParent(t) {
    return new TR(t);
  }
  static ifEmpty(t) {
    return new ER(t);
  }
  static includeXDPContent(t) {
    return new MR(t);
  }
  static incrementalLoad(t) {
    return new FR(t);
  }
  static incrementalMerge(t) {
    return new RR(t);
  }
  static interactive(t) {
    return new PR(t);
  }
  static jog(t) {
    return new DR(t);
  }
  static labelPrinter(t) {
    return new NR(t);
  }
  static layout(t) {
    return new BR(t);
  }
  static level(t) {
    return new LR(t);
  }
  static linearized(t) {
    return new OR(t);
  }
  static locale(t) {
    return new UR(t);
  }
  static localeSet(t) {
    return new qR(t);
  }
  static log(t) {
    return new jR(t);
  }
  static map(t) {
    return new HR(t);
  }
  static mediumInfo(t) {
    return new $R(t);
  }
  static message(t) {
    return new zR(t);
  }
  static messaging(t) {
    return new GR(t);
  }
  static mode(t) {
    return new VR(t);
  }
  static modifyAnnots(t) {
    return new WR(t);
  }
  static msgId(t) {
    return new XR(t);
  }
  static nameAttr(t) {
    return new KR(t);
  }
  static neverEmbed(t) {
    return new YR(t);
  }
  static numberOfCopies(t) {
    return new JR(t);
  }
  static openAction(t) {
    return new ZR(t);
  }
  static output(t) {
    return new QR(t);
  }
  static outputBin(t) {
    return new tP(t);
  }
  static outputXSL(t) {
    return new eP(t);
  }
  static overprint(t) {
    return new sP(t);
  }
  static packets(t) {
    return new iP(t);
  }
  static pageOffset(t) {
    return new nP(t);
  }
  static pageRange(t) {
    return new aP(t);
  }
  static pagination(t) {
    return new rP(t);
  }
  static paginationOverride(t) {
    return new oP(t);
  }
  static part(t) {
    return new lP(t);
  }
  static pcl(t) {
    return new cP(t);
  }
  static pdf(t) {
    return new hP(t);
  }
  static pdfa(t) {
    return new uP(t);
  }
  static permissions(t) {
    return new dP(t);
  }
  static pickTrayByPDFSize(t) {
    return new fP(t);
  }
  static picture(t) {
    return new gP(t);
  }
  static plaintextMetadata(t) {
    return new pP(t);
  }
  static presence(t) {
    return new mP(t);
  }
  static present(t) {
    return new bP(t);
  }
  static print(t) {
    return new yP(t);
  }
  static printHighQuality(t) {
    return new wP(t);
  }
  static printScaling(t) {
    return new vP(t);
  }
  static printerName(t) {
    return new AP(t);
  }
  static producer(t) {
    return new xP(t);
  }
  static ps(t) {
    return new kP(t);
  }
  static range(t) {
    return new SP(t);
  }
  static record(t) {
    return new CP(t);
  }
  static relevant(t) {
    return new IP(t);
  }
  static rename(t) {
    return new _P(t);
  }
  static renderPolicy(t) {
    return new TP(t);
  }
  static runScripts(t) {
    return new EP(t);
  }
  static script(t) {
    return new MP(t);
  }
  static scriptModel(t) {
    return new FP(t);
  }
  static severity(t) {
    return new RP(t);
  }
  static silentPrint(t) {
    return new PP(t);
  }
  static staple(t) {
    return new DP(t);
  }
  static startNode(t) {
    return new NP(t);
  }
  static startPage(t) {
    return new BP(t);
  }
  static submitFormat(t) {
    return new LP(t);
  }
  static submitUrl(t) {
    return new OP(t);
  }
  static subsetBelow(t) {
    return new UP(t);
  }
  static suppressBanner(t) {
    return new qP(t);
  }
  static tagged(t) {
    return new jP(t);
  }
  static template(t) {
    return new HP(t);
  }
  static templateCache(t) {
    return new GP(t);
  }
  static threshold(t) {
    return new $P(t);
  }
  static to(t) {
    return new zP(t);
  }
  static trace(t) {
    return new VP(t);
  }
  static transform(t) {
    return new WP(t);
  }
  static type(t) {
    return new XP(t);
  }
  static uri(t) {
    return new KP(t);
  }
  static validate(t) {
    return new YP(t);
  }
  static validateApprovalSignatures(t) {
    return new JP(t);
  }
  static validationMessaging(t) {
    return new ZP(t);
  }
  static version(t) {
    return new QP(t);
  }
  static versionControl(t) {
    return new tD(t);
  }
  static viewerPreferences(t) {
    return new eD(t);
  }
  static webClient(t) {
    return new sD(t);
  }
  static whitespace(t) {
    return new iD(t);
  }
  static window(t) {
    return new nD(t);
  }
  static xdc(t) {
    return new aD(t);
  }
  static xdp(t) {
    return new rD(t);
  }
  static xsl(t) {
    return new oD(t);
  }
  static zpl(t) {
    return new lD(t);
  }
}
const Rn = We.connectionSet.id;
class cD extends tt {
  constructor(t) {
    super(Rn, "connectionSet", !0), this.wsdlConnection = new R(), this.xmlConnection = new R(), this.xsdConnection = new R();
  }
}
class hD extends tt {
  constructor(t) {
    super(Rn, "effectiveInputPolicy"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class uD extends tt {
  constructor(t) {
    super(Rn, "effectiveOutputPolicy"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class dD extends jt {
  constructor(t) {
    super(Rn, "operation"), this.id = t.id || "", this.input = t.input || "", this.name = t.name || "", this.output = t.output || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class fD extends jt {
  constructor(t) {
    super(Rn, "rootElement"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class gD extends jt {
  constructor(t) {
    super(Rn, "soapAction"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class pD extends jt {
  constructor(t) {
    super(Rn, "soapAddress"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class mD extends jt {
  constructor(t) {
    super(Rn, "uri"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class bD extends jt {
  constructor(t) {
    super(Rn, "wsdlAddress"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class yD extends tt {
  constructor(t) {
    super(Rn, "wsdlConnection", !0), this.dataDescription = t.dataDescription || "", this.name = t.name || "", this.effectiveInputPolicy = null, this.effectiveOutputPolicy = null, this.operation = null, this.soapAction = null, this.soapAddress = null, this.wsdlAddress = null;
  }
}
class wD extends tt {
  constructor(t) {
    super(Rn, "xmlConnection", !0), this.dataDescription = t.dataDescription || "", this.name = t.name || "", this.uri = null;
  }
}
class vD extends tt {
  constructor(t) {
    super(Rn, "xsdConnection", !0), this.dataDescription = t.dataDescription || "", this.name = t.name || "", this.rootElement = null, this.uri = null;
  }
}
class Wp {
  static [la](t, e) {
    if (Wp.hasOwnProperty(t)) return Wp[t](e);
  }
  static connectionSet(t) {
    return new cD(t);
  }
  static effectiveInputPolicy(t) {
    return new hD(t);
  }
  static effectiveOutputPolicy(t) {
    return new uD(t);
  }
  static operation(t) {
    return new dD(t);
  }
  static rootElement(t) {
    return new fD(t);
  }
  static soapAction(t) {
    return new gD(t);
  }
  static soapAddress(t) {
    return new pD(t);
  }
  static uri(t) {
    return new mD(t);
  }
  static wsdlAddress(t) {
    return new bD(t);
  }
  static wsdlConnection(t) {
    return new yD(t);
  }
  static xmlConnection(t) {
    return new wD(t);
  }
  static xsdConnection(t) {
    return new vD(t);
  }
}
const R6 = We.datasets.id;
class AD extends ja {
  constructor(t) {
    super(R6, "data", t);
  }
  [Wd]() {
    return !0;
  }
}
class xD extends tt {
  constructor(t) {
    super(R6, "datasets", !0), this.data = null, this.Signature = null;
  }
  [qa](t) {
    const e = t[ee];
    (e === "data" && t[Ge] === R6 || e === "Signature" && t[Ge] === We.signature.id) && (this[e] = t), this[Ne](t);
  }
}
class Xp {
  static [la](t, e) {
    if (Xp.hasOwnProperty(t)) return Xp[t](e);
  }
  static datasets(t) {
    return new xD(t);
  }
  static data(t) {
    return new AD(t);
  }
}
const Ue = We.localeSet.id;
class kD extends tt {
  constructor(t) {
    super(Ue, "calendarSymbols", !0), this.name = "gregorian", this.dayNames = new R(2), this.eraNames = null, this.meridiemNames = null, this.monthNames = new R(2);
  }
}
class SD extends jt {
  constructor(t) {
    super(Ue, "currencySymbol"), this.name = at(t.name, ["symbol", "isoname", "decimal"]);
  }
}
class CD extends tt {
  constructor(t) {
    super(Ue, "currencySymbols", !0), this.currencySymbol = new R(3);
  }
}
class ID extends jt {
  constructor(t) {
    super(Ue, "datePattern"), this.name = at(t.name, ["full", "long", "med", "short"]);
  }
}
class _D extends tt {
  constructor(t) {
    super(Ue, "datePatterns", !0), this.datePattern = new R(4);
  }
}
class TD extends Oe {
  constructor(t) {
    super(Ue, "dateTimeSymbols");
  }
}
class ED extends jt {
  constructor(t) {
    super(Ue, "day");
  }
}
class MD extends tt {
  constructor(t) {
    super(Ue, "dayNames", !0), this.abbr = Pt({ data: t.abbr, defaultValue: 0, validate: (e) => e === 1 }), this.day = new R(7);
  }
}
class FD extends jt {
  constructor(t) {
    super(Ue, "era");
  }
}
class RD extends tt {
  constructor(t) {
    super(Ue, "eraNames", !0), this.era = new R(2);
  }
}
class PD extends tt {
  constructor(t) {
    super(Ue, "locale", !0), this.desc = t.desc || "", this.name = "isoname", this.calendarSymbols = null, this.currencySymbols = null, this.datePatterns = null, this.dateTimeSymbols = null, this.numberPatterns = null, this.numberSymbols = null, this.timePatterns = null, this.typeFaces = null;
  }
}
class DD extends tt {
  constructor(t) {
    super(Ue, "localeSet", !0), this.locale = new R();
  }
}
class ND extends jt {
  constructor(t) {
    super(Ue, "meridiem");
  }
}
class BD extends tt {
  constructor(t) {
    super(Ue, "meridiemNames", !0), this.meridiem = new R(2);
  }
}
class LD extends jt {
  constructor(t) {
    super(Ue, "month");
  }
}
class OD extends tt {
  constructor(t) {
    super(Ue, "monthNames", !0), this.abbr = Pt({ data: t.abbr, defaultValue: 0, validate: (e) => e === 1 }), this.month = new R(12);
  }
}
class UD extends jt {
  constructor(t) {
    super(Ue, "numberPattern"), this.name = at(t.name, ["full", "long", "med", "short"]);
  }
}
class qD extends tt {
  constructor(t) {
    super(Ue, "numberPatterns", !0), this.numberPattern = new R(4);
  }
}
class jD extends jt {
  constructor(t) {
    super(Ue, "numberSymbol"), this.name = at(t.name, ["decimal", "grouping", "percent", "minus", "zero"]);
  }
}
class HD extends tt {
  constructor(t) {
    super(Ue, "numberSymbols", !0), this.numberSymbol = new R(5);
  }
}
class $D extends jt {
  constructor(t) {
    super(Ue, "timePattern"), this.name = at(t.name, ["full", "long", "med", "short"]);
  }
}
class zD extends tt {
  constructor(t) {
    super(Ue, "timePatterns", !0), this.timePattern = new R(4);
  }
}
class GD extends tt {
  constructor(t) {
    super(Ue, "typeFace", !0), this.name = "" | t.name;
  }
}
class VD extends tt {
  constructor(t) {
    super(Ue, "typeFaces", !0), this.typeFace = new R();
  }
}
class Kp {
  static [la](t, e) {
    if (Kp.hasOwnProperty(t)) return Kp[t](e);
  }
  static calendarSymbols(t) {
    return new kD(t);
  }
  static currencySymbol(t) {
    return new SD(t);
  }
  static currencySymbols(t) {
    return new CD(t);
  }
  static datePattern(t) {
    return new ID(t);
  }
  static datePatterns(t) {
    return new _D(t);
  }
  static dateTimeSymbols(t) {
    return new TD(t);
  }
  static day(t) {
    return new ED(t);
  }
  static dayNames(t) {
    return new MD(t);
  }
  static era(t) {
    return new FD(t);
  }
  static eraNames(t) {
    return new RD(t);
  }
  static locale(t) {
    return new PD(t);
  }
  static localeSet(t) {
    return new DD(t);
  }
  static meridiem(t) {
    return new ND(t);
  }
  static meridiemNames(t) {
    return new BD(t);
  }
  static month(t) {
    return new LD(t);
  }
  static monthNames(t) {
    return new OD(t);
  }
  static numberPattern(t) {
    return new UD(t);
  }
  static numberPatterns(t) {
    return new qD(t);
  }
  static numberSymbol(t) {
    return new jD(t);
  }
  static numberSymbols(t) {
    return new HD(t);
  }
  static timePattern(t) {
    return new $D(t);
  }
  static timePatterns(t) {
    return new zD(t);
  }
  static typeFace(t) {
    return new GD(t);
  }
  static typeFaces(t) {
    return new VD(t);
  }
}
const WD = We.signature.id;
class XD extends tt {
  constructor(t) {
    super(WD, "signature", !0);
  }
}
class Yp {
  static [la](t, e) {
    if (Yp.hasOwnProperty(t)) return Yp[t](e);
  }
  static signature(t) {
    return new XD(t);
  }
}
const KD = We.stylesheet.id;
class YD extends tt {
  constructor(t) {
    super(KD, "stylesheet", !0);
  }
}
class Jp {
  static [la](t, e) {
    if (Jp.hasOwnProperty(t)) return Jp[t](e);
  }
  static stylesheet(t) {
    return new YD(t);
  }
}
const JD = We.xdp.id;
class ZD extends tt {
  constructor(t) {
    super(JD, "xdp", !0), this.uuid = t.uuid || "", this.timeStamp = t.timeStamp || "", this.config = null, this.connectionSet = null, this.datasets = null, this.localeSet = null, this.stylesheet = new R(), this.template = null;
  }
  [I6](t) {
    const e = We[t[ee]];
    return e && t[Ge] === e.id;
  }
}
class Zp {
  static [la](t, e) {
    if (Zp.hasOwnProperty(t)) return Zp[t](e);
  }
  static xdp(t) {
    return new ZD(t);
  }
}
const QD = We.xhtml.id, rg = Symbol(), tN = /* @__PURE__ */ new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]), eN = /* @__PURE__ */ new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", (s) => s === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", (s) => `scaleX(${Math.max(0, parseInt(s) / 100).toFixed(2)})`], ["xfa-font-vertical-scale", (s) => `scaleY(${Math.max(0, parseInt(s) / 100).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (s, t) => Rt(0.99 * (s = t.fontSize = Math.abs(At(s))))], ["letter-spacing", (s) => Rt(At(s))], ["line-height", (s) => Rt(At(s))], ["margin", (s) => Rt(At(s))], ["margin-bottom", (s) => Rt(At(s))], ["margin-left", (s) => Rt(At(s))], ["margin-right", (s) => Rt(At(s))], ["margin-top", (s) => Rt(At(s))], ["text-indent", (s) => Rt(At(s))], ["font-family", (s) => s], ["vertical-align", (s) => Rt(At(s))]]), sN = /\s+/g, iN = /[\r\n]+/g, nN = /\r\n?/g;
function aN(s, t, e) {
  const i = /* @__PURE__ */ Object.create(null);
  if (!s) return i;
  const n = /* @__PURE__ */ Object.create(null);
  for (const [a, r] of s.split(";").map((o) => o.split(":", 2))) {
    const o = eN.get(a);
    if (o === "") continue;
    let l = r;
    o && (l = typeof o == "string" ? o : o(r, n)), a.endsWith("scale") ? i.transform = i.transform ? `${i[a]} ${l}` : l : i[a.replaceAll(/-([a-zA-Z])/g, (c, h) => h.toUpperCase())] = l;
  }
  if (i.fontFamily && _x({ typeface: i.fontFamily, weight: i.fontWeight || "normal", posture: i.fontStyle || "normal", size: n.fontSize || 0 }, t, t[fe].fontFinder, i), e && i.verticalAlign && i.verticalAlign !== "0px" && i.fontSize) {
    const o = At(i.fontSize);
    i.fontSize = Rt(o * 0.583), i.verticalAlign = Rt(Math.sign(At(i.verticalAlign)) * o * 0.333);
  }
  return e && i.fontSize && (i.fontSize = `calc(${i.fontSize} * var(--total-scale-factor))`), Sx(i), i;
}
const rN = /* @__PURE__ */ new Set(["body", "html"]);
class sn extends ja {
  constructor(t, e) {
    super(QD, e), this[rg] = !1, this.style = t.style || "";
  }
  [Mn](t) {
    super[Mn](t), this.style = function(i) {
      return i.style ? i.style.split(";").filter((n) => !!n.trim()).map((n) => n.split(":", 2).map((a) => a.trim())).filter(([n, a]) => (n === "font-family" && i[fe].usedTypefaces.add(a), tN.has(n))).map((n) => n.join(":")).join(";") : "";
    }(this);
  }
  [Q9]() {
    return !rN.has(this[ee]);
  }
  [jr](t, e = !1) {
    e ? this[rg] = !0 : (t = t.replaceAll(iN, ""), this.style.includes("xfa-spacerun:yes") || (t = t.replaceAll(sN, " "))), t && (this[it] += t);
  }
  [Ga](t, e = !0) {
    const i = /* @__PURE__ */ Object.create(null), n = { top: NaN, bottom: NaN, left: NaN, right: NaN };
    let a = null;
    for (const [r, o] of this.style.split(";").map((l) => l.split(":", 2))) switch (r) {
      case "font-family":
        i.typeface = em(o);
        break;
      case "font-size":
        i.size = At(o);
        break;
      case "font-weight":
        i.weight = o;
        break;
      case "font-style":
        i.posture = o;
        break;
      case "letter-spacing":
        i.letterSpacing = At(o);
        break;
      case "margin":
        const l = o.split(/ \t/).map((c) => At(c));
        switch (l.length) {
          case 1:
            n.top = n.bottom = n.left = n.right = l[0];
            break;
          case 2:
            n.top = n.bottom = l[0], n.left = n.right = l[1];
            break;
          case 3:
            n.top = l[0], n.bottom = l[2], n.left = n.right = l[1];
            break;
          case 4:
            n.top = l[0], n.left = l[1], n.bottom = l[2], n.right = l[3];
        }
        break;
      case "margin-top":
        n.top = At(o);
        break;
      case "margin-bottom":
        n.bottom = At(o);
        break;
      case "margin-left":
        n.left = At(o);
        break;
      case "margin-right":
        n.right = At(o);
        break;
      case "line-height":
        a = At(o);
    }
    if (t.pushData(i, n, a), this[it]) t.addString(this[it]);
    else for (const r of this[xs]()) r[ee] !== "#text" ? r[Ga](t) : t.addString(r[it]);
    e && t.popFont();
  }
  [Mt](t) {
    const e = [];
    if (this[J] = { children: e }, this[cl]({}), e.length === 0 && !this[it]) return Ct.EMPTY;
    let i;
    return i = this[rg] ? this[it] ? this[it].replaceAll(nN, `
`) : void 0 : this[it] || void 0, Ct.success({ name: this[ee], attributes: { href: this.href, style: aN(this.style, this, this[rg]) }, children: e, value: i });
  }
}
class oN extends sn {
  constructor(t) {
    super(t, "a"), this.href = Tx(t.href) || "";
  }
}
class lN extends sn {
  constructor(t) {
    super(t, "b");
  }
  [Ga](t) {
    t.pushFont({ weight: "bold" }), super[Ga](t), t.popFont();
  }
}
class cN extends sn {
  constructor(t) {
    super(t, "body");
  }
  [Mt](t) {
    const e = super[Mt](t), { html: i } = e;
    return i ? (i.name = "div", i.attributes.class = ["xfaRich"], e) : Ct.EMPTY;
  }
}
class hN extends sn {
  constructor(t) {
    super(t, "br");
  }
  [ns]() {
    return `
`;
  }
  [Ga](t) {
    t.addString(`
`);
  }
  [Mt](t) {
    return Ct.success({ name: "br" });
  }
}
class uN extends sn {
  constructor(t) {
    super(t, "html");
  }
  [Mt](t) {
    var i;
    const e = [];
    if (this[J] = { children: e }, this[cl]({}), e.length === 0) return Ct.success({ name: "div", attributes: { class: ["xfaRich"], style: {} }, value: this[it] || "" });
    if (e.length === 1) {
      const n = e[0];
      if ((i = n.attributes) != null && i.class.includes("xfaRich")) return Ct.success(n);
    }
    return Ct.success({ name: "div", attributes: { class: ["xfaRich"], style: {} }, children: e });
  }
}
class dN extends sn {
  constructor(t) {
    super(t, "i");
  }
  [Ga](t) {
    t.pushFont({ posture: "italic" }), super[Ga](t), t.popFont();
  }
}
class fN extends sn {
  constructor(t) {
    super(t, "li");
  }
}
class gN extends sn {
  constructor(t) {
    super(t, "ol");
  }
}
class pN extends sn {
  constructor(t) {
    super(t, "p");
  }
  [Ga](t) {
    super[Ga](t, !1), t.addString(`
`), t.addPara(), t.popFont();
  }
  [ns]() {
    return this[Nt]()[xs]().at(-1) === this ? super[ns]() : super[ns]() + `
`;
  }
}
class mN extends sn {
  constructor(t) {
    super(t, "span");
  }
}
class bN extends sn {
  constructor(t) {
    super(t, "sub");
  }
}
class yN extends sn {
  constructor(t) {
    super(t, "sup");
  }
}
class wN extends sn {
  constructor(t) {
    super(t, "ul");
  }
}
class L1 {
  static [la](t, e) {
    if (L1.hasOwnProperty(t)) return L1[t](e);
  }
  static a(t) {
    return new oN(t);
  }
  static b(t) {
    return new lN(t);
  }
  static body(t) {
    return new cN(t);
  }
  static br(t) {
    return new hN(t);
  }
  static html(t) {
    return new uN(t);
  }
  static i(t) {
    return new dN(t);
  }
  static li(t) {
    return new fN(t);
  }
  static ol(t) {
    return new gN(t);
  }
  static p(t) {
    return new pN(t);
  }
  static span(t) {
    return new mN(t);
  }
  static sub(t) {
    return new bN(t);
  }
  static sup(t) {
    return new yN(t);
  }
  static ul(t) {
    return new wN(t);
  }
}
const gb = { config: Vp, connection: Wp, datasets: Xp, localeSet: Kp, signature: Yp, stylesheet: Jp, template: Gp, xdp: Zp, xhtml: L1 };
class pb {
  constructor(t) {
    this.namespaceId = t;
  }
  [la](t, e) {
    return new ja(this.namespaceId, t, e);
  }
}
class vN extends tt {
  constructor(t) {
    super(-1, "root", /* @__PURE__ */ Object.create(null)), this.element = null, this[jh] = t;
  }
  [qa](t) {
    return this.element = t, !0;
  }
  [ge]() {
    super[ge](), this.element.template instanceof $7 && (this[jh].set(gx, this.element), this.element.template[Pd](this[jh]), this.element.template[jh] = this[jh]);
  }
}
class AN extends tt {
  constructor() {
    super(-1, "", /* @__PURE__ */ Object.create(null));
  }
  [qa](t) {
    return !1;
  }
}
class xN {
  constructor(t = null) {
    this._namespaceStack = [], this._nsAgnosticLevel = 0, this._namespacePrefixes = /* @__PURE__ */ new Map(), this._namespaces = /* @__PURE__ */ new Map(), this._nextNsId = Math.max(...Object.values(We).map(({ id: e }) => e)), this._currentNamespace = t || new pb(++this._nextNsId);
  }
  buildRoot(t) {
    return new vN(t);
  }
  build({ nsPrefix: t, name: e, attributes: i, namespace: n, prefixes: a }) {
    const r = n !== null;
    if (r && (this._namespaceStack.push(this._currentNamespace), this._currentNamespace = this._searchNamespace(n)), a && this._addNamespacePrefix(a), i.hasOwnProperty(Lr)) {
      const c = gb.datasets, h = i[Lr];
      let u = null;
      for (const [f, d] of Object.entries(h))
        if (this._getNamespaceToUse(f) === c) {
          u = { xfa: d };
          break;
        }
      u ? i[Lr] = u : delete i[Lr];
    }
    const o = this._getNamespaceToUse(t), l = (o == null ? void 0 : o[la](e, i)) || new AN();
    return l[Wd]() && this._nsAgnosticLevel++, (r || a || l[Wd]()) && (l[sp] = { hasNamespace: r, prefixes: a, nsAgnostic: l[Wd]() }), l;
  }
  isNsAgnostic() {
    return this._nsAgnosticLevel > 0;
  }
  _searchNamespace(t) {
    let e = this._namespaces.get(t);
    if (e) return e;
    for (const [i, { check: n }] of Object.entries(We)) if (n(t)) {
      if (e = gb[i], e)
        return this._namespaces.set(t, e), e;
      break;
    }
    return e = new pb(++this._nextNsId), this._namespaces.set(t, e), e;
  }
  _addNamespacePrefix(t) {
    for (const { prefix: e, value: i } of t) {
      const n = this._searchNamespace(i);
      let a = this._namespacePrefixes.get(e);
      a || (a = [], this._namespacePrefixes.set(e, a)), a.push(n);
    }
  }
  _getNamespaceToUse(t) {
    if (!t) return this._currentNamespace;
    const e = this._namespacePrefixes.get(t);
    return (e == null ? void 0 : e.length) > 0 ? e.at(-1) : (D(`Unknown namespace prefix: ${t}.`), null);
  }
  clean(t) {
    const { hasNamespace: e, prefixes: i, nsAgnostic: n } = t;
    e && (this._currentNamespace = this._namespaceStack.pop()), i && i.forEach(({ prefix: a }) => {
      this._namespacePrefixes.get(a).pop();
    }), n && this._nsAgnosticLevel--;
  }
}
class Qp extends JA {
  constructor(t = null, e = !1) {
    super(), this._builder = new xN(t), this._stack = [], this._globalData = { usedTypefaces: /* @__PURE__ */ new Set() }, this._ids = /* @__PURE__ */ new Map(), this._current = this._builder.buildRoot(this._ids), this._errorCode = $d, this._whiteRegex = /^\s+$/, this._nbsps = /\xa0+/g, this._richText = e;
  }
  parse(t) {
    if (this.parseXml(t), this._errorCode === $d)
      return this._current[ge](), this._current.element;
  }
  onText(t) {
    t = t.replace(this._nbsps, (e) => e.slice(1) + " "), this._richText || this._current[Q9]() ? this._current[jr](t, this._richText) : this._whiteRegex.test(t) || this._current[jr](t.trim());
  }
  onCdata(t) {
    this._current[jr](t);
  }
  _mkAttributes(t, e) {
    let i = null, n = null;
    const a = /* @__PURE__ */ Object.create({});
    for (const { name: r, value: o } of t) if (r === "xmlns") i ? D(`XFA - multiple namespace definition in <${e}>`) : i = o;
    else if (r.startsWith("xmlns:")) {
      const l = r.substring(6);
      n ?? (n = []), n.push({ prefix: l, value: o });
    } else {
      const l = r.indexOf(":");
      if (l === -1) a[r] = o;
      else {
        const c = a[Lr] ?? (a[Lr] = /* @__PURE__ */ Object.create(null)), [h, u] = [r.slice(0, l), r.slice(l + 1)];
        (c[h] || (c[h] = /* @__PURE__ */ Object.create(null)))[u] = o;
      }
    }
    return [i, n, a];
  }
  _getNameAndPrefix(t, e) {
    const i = t.indexOf(":");
    return i === -1 ? [t, null] : [t.substring(i + 1), e ? "" : t.substring(0, i)];
  }
  onBeginElement(t, e, i) {
    const [n, a, r] = this._mkAttributes(e, t), [o, l] = this._getNameAndPrefix(t, this._builder.isNsAgnostic()), c = this._builder.build({ nsPrefix: l, name: o, attributes: r, namespace: n, prefixes: a });
    c[fe] = this._globalData, i ? (c[ge](), this._current[qa](c) && c[_6](this._ids), c[Mn](this._builder)) : (this._stack.push(this._current), this._current = c);
  }
  onEndElement(t) {
    const e = this._current;
    if (e[F7]() && typeof e[it] == "string") {
      const i = new Qp();
      i._globalData = this._globalData;
      const n = i.parse(e[it]);
      e[it] = null, e[qa](n);
    }
    e[ge](), this._current = this._stack.pop(), this._current[qa](e) && e[_6](this._ids), e[Mn](this._builder);
  }
  onError(t) {
    this._errorCode = t;
  }
}
class M2 {
  constructor(t) {
    try {
      this.root = new Qp().parse(M2._createDocument(t));
      const e = new MF(this.root);
      this.form = e.bind(), this.dataHandler = new FF(this.root, e.getData()), this.form[fe].template = this.form;
    } catch (e) {
      D(`XFA - an error occurred during parsing and binding: ${e}`);
    }
  }
  isValid() {
    return !(!this.root || !this.form);
  }
  _createPagesHelper() {
    const t = this.form[mx]();
    return new Promise((e, i) => {
      const n = () => {
        try {
          const a = t.next();
          a.done ? e(a.value) : setTimeout(n, 0);
        } catch (a) {
          i(a);
        }
      };
      setTimeout(n, 0);
    });
  }
  async _createPages() {
    try {
      this.pages = await this._createPagesHelper(), this.dims = this.pages.children.map((t) => {
        const { width: e, height: i } = t.attributes.style;
        return [0, 0, parseInt(e), parseInt(i)];
      });
    } catch (t) {
      D(`XFA - an error occurred during layout: ${t}`);
    }
  }
  getBoundingBox(t) {
    return this.dims[t];
  }
  async getNumPages() {
    return this.pages || await this._createPages(), this.dims.length;
  }
  setImages(t) {
    this.form[fe].images = t;
  }
  setFonts(t) {
    this.form[fe].fontFinder = new HE(t);
    const e = [];
    for (let i of this.form[fe].usedTypefaces)
      i = em(i), this.form[fe].fontFinder.find(i) || e.push(i);
    return e.length > 0 ? e : null;
  }
  appendFonts(t, e) {
    this.form[fe].fontFinder.add(t, e);
  }
  async getPages() {
    this.pages || await this._createPages();
    const t = this.pages;
    return this.pages = null, t;
  }
  serializeData(t) {
    return this.dataHandler.serialize(t);
  }
  static _createDocument(t) {
    return t["/xdp:xdp"] ? Object.values(t).join("") : t["xdp:xdp"];
  }
  static getRichTextAsHtml(t) {
    if (!t || typeof t != "string") return null;
    try {
      let e = new Qp(L1, !0).parse(t);
      if (!["body", "xhtml"].includes(e[ee])) {
        const r = L1.body({});
        r[Ne](e), e = r;
      }
      const i = e[Mt]();
      if (!i.success) return null;
      const { html: n } = i, { attributes: a } = n;
      return a && (a.class && (a.class = a.class.filter((r) => !r.startsWith("xfa"))), a.dir = "auto"), { html: n, str: e[ns]() };
    } catch (e) {
      D(`XFA - an error occurred during parsing of rich text: ${e}`);
    }
    return null;
  }
}
class ho {
  static createGlobals(t) {
    return Promise.all([t.ensureCatalog("acroForm"), t.ensureDoc("xfaDatasets"), t.ensureCatalog("structTreeRoot"), t.ensureCatalog("baseUrl"), t.ensureCatalog("attachments"), t.ensureCatalog("globalColorSpaceCache")]).then(([e, i, n, a, r, o]) => ({ pdfManager: t, acroForm: e instanceof q ? e : q.empty, xfaDatasets: i, structTreeRoot: n, baseUrl: a, attachments: r, globalColorSpaceCache: o }), (e) => (D(`createGlobals: "${e}".`), null));
  }
  static async create(t, e, i, n, a, r, o) {
    const l = a ? await this._getPageIndex(t, e, i.pdfManager) : null;
    return i.pdfManager.ensure(this, "_create", [t, e, i, n, a, r, l, o]);
  }
  static _create(t, e, i, n, a = !1, r = null, o = null, l = null) {
    const c = t.fetchIfRef(e);
    if (!(c instanceof q)) return;
    const { acroForm: h, pdfManager: u } = i, f = e instanceof yt ? e.toString() : `annot_${n.createObjId()}`;
    let d = c.get("Subtype");
    d = d instanceof Z ? d.name : null;
    const p = { xref: t, ref: e, dict: c, subtype: d, id: f, annotationGlobals: i, collectFields: a, orphanFields: r, needAppearances: !a && h.get("NeedAppearances") === !0, pageIndex: o, evaluatorOptions: u.evaluatorOptions, pageRef: l };
    switch (d) {
      case "Link":
        return new TN(p);
      case "Text":
        return new _N(p);
      case "Widget":
        let m = vn({ dict: c, key: "FT" });
        switch (m = m instanceof Z ? m.name : null, m) {
          case "Tx":
            return new SN(p);
          case "Btn":
            return new CN(p);
          case "Ch":
            return new IN(p);
          case "Sig":
            return new Xx(p);
        }
        return D(`Unimplemented widget field type "${m}", falling back to base field type.`), new ra(p);
      case "Popup":
        return new Kx(p);
      case "FreeText":
        return new Gm(p);
      case "Line":
        return new EN(p);
      case "Square":
        return new MN(p);
      case "Circle":
        return new FN(p);
      case "PolyLine":
        return new Yx(p);
      case "Polygon":
        return new Jx(p);
      case "Caret":
        return new RN(p);
      case "Ink":
        return new ad(p);
      case "Highlight":
        return new Vm(p);
      case "Underline":
        return new PN(p);
      case "Squiggly":
        return new DN(p);
      case "StrikeOut":
        return new NN(p);
      case "Stamp":
        return new Tl(p);
      case "FileAttachment":
        return new BN(p);
      default:
        return a || D(d ? `Unimplemented annotation type "${d}", falling back to base annotation.` : "Annotation is missing the required /Subtype."), new R2(p);
    }
  }
  static async _getPageIndex(t, e, i) {
    try {
      const n = await t.fetchIfRefAsync(e);
      if (!(n instanceof q)) return -1;
      const a = n.getRaw("P");
      if (a instanceof yt) try {
        return await i.ensureCatalog("getPageIndex", [a]);
      } catch (o) {
        qt(`_getPageIndex -- not a valid page reference: "${o}".`);
      }
      if (n.has("Kids")) return -1;
      const r = await i.ensureDoc("numPages");
      for (let o = 0; o < r; o++) {
        const l = await i.getPage(o), c = await i.ensure(l, "annotations");
        for (const h of c) if (h instanceof yt && Pp(h, e)) return o;
      }
    } catch (n) {
      D(`_getPageIndex: "${n}".`);
    }
    return -1;
  }
  static generateImages(t, e, i) {
    if (!i)
      return D("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."), null;
    let n;
    for (const { bitmapId: a, bitmap: r } of t) r && (n || (n = /* @__PURE__ */ new Map()), n.set(a, Tl.createImage(r, e)));
    return n;
  }
  static async saveNewAnnotations(t, e, i, n, a) {
    const r = t.xref;
    let o;
    const l = [], { isOffscreenCanvasSupported: c } = t.options;
    for (const h of i) if (!h.deleted) switch (h.annotationType) {
      case U8:
        if (!o) {
          const f = new q(r);
          f.set("BaseFont", Z.get("Helvetica")), f.set("Type", Z.get("Font")), f.set("Subtype", Z.get("Type1")), f.set("Encoding", Z.get("WinAnsiEncoding")), o = r.getNewTemporaryRef(), a.put(o, { data: f });
        }
        l.push(Gm.createNewAnnotation(r, h, a, { evaluator: t, task: e, baseFontRef: o }));
        break;
      case q8:
        h.quadPoints ? l.push(Vm.createNewAnnotation(r, h, a)) : l.push(ad.createNewAnnotation(r, h, a));
        break;
      case H8:
        l.push(ad.createNewAnnotation(r, h, a));
        break;
      case j8:
        const u = c ? await (n == null ? void 0 : n.get(h.bitmapId)) : null;
        if (u != null && u.imageStream) {
          const { imageStream: f, smaskStream: d } = u;
          if (d) {
            const m = r.getNewTemporaryRef();
            a.put(m, { data: d }), f.dict.set("SMask", m);
          }
          const p = u.imageRef = r.getNewTemporaryRef();
          a.put(p, { data: f }), u.imageStream = u.smaskStream = null;
        }
        l.push(Tl.createNewAnnotation(r, h, a, { image: u }));
        break;
      case $8:
        l.push(Tl.createNewAnnotation(r, h, a, {}));
    }
    return { annotations: await Promise.all(l) };
  }
  static async printNewAnnotations(t, e, i, n, a) {
    if (!n) return null;
    const { options: r, xref: o } = e, l = [];
    for (const c of n) if (!c.deleted) switch (c.annotationType) {
      case U8:
        l.push(Gm.createNewPrintAnnotation(t, o, c, { evaluator: e, task: i, evaluatorOptions: r }));
        break;
      case q8:
        c.quadPoints ? l.push(Vm.createNewPrintAnnotation(t, o, c, { evaluatorOptions: r })) : l.push(ad.createNewPrintAnnotation(t, o, c, { evaluatorOptions: r }));
        break;
      case H8:
        l.push(ad.createNewPrintAnnotation(t, o, c, { evaluatorOptions: r }));
        break;
      case j8:
        const h = r.isOffscreenCanvasSupported ? await (a == null ? void 0 : a.get(c.bitmapId)) : null;
        if (h != null && h.imageStream) {
          const { imageStream: u, smaskStream: f } = h;
          f && u.dict.set("SMask", f), h.imageRef = new E1(u, u.length), h.imageStream = h.smaskStream = null;
        }
        l.push(Tl.createNewPrintAnnotation(t, o, c, { image: h, evaluatorOptions: r }));
        break;
      case $8:
        l.push(Tl.createNewPrintAnnotation(t, o, c, { evaluatorOptions: r }));
    }
    return Promise.all(l);
  }
}
function ou(s, t = new Uint8ClampedArray(3)) {
  if (!Array.isArray(s)) return t;
  const e = t || new Uint8ClampedArray(3);
  switch (s.length) {
    case 0:
      return null;
    case 1:
      return te.gray.getRgbItem(s, 0, e, 0), e;
    case 3:
      return te.rgb.getRgbItem(s, 0, e, 0), e;
    case 4:
      return te.cmyk.getRgbItem(s, 0, e, 0), e;
    default:
      return t;
  }
}
function Zs(s) {
  return Array.from(s, (t) => t / 255);
}
function F2(s, t) {
  const e = s.getArray("QuadPoints");
  if (!ci(e, null) || e.length === 0 || e.length % 8 > 0) return null;
  const i = new Float32Array(e.length);
  for (let n = 0, a = e.length; n < a; n += 8) {
    const [r, o, l, c, h, u, f, d] = e.slice(n, n + 8), p = Math.min(r, l, h, f), m = Math.max(r, l, h, f), b = Math.min(o, c, u, d), y = Math.max(o, c, u, d);
    if (t !== null && (p < t[0] || m > t[2] || b < t[1] || y > t[3])) return null;
    i.set([p, y, m, y, p, b, m, b], n);
  }
  return i;
}
function P6(s, t, e) {
  const i = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]);
  se.axialAlignedBoundingBox(t, e, i);
  const [n, a, r, o] = i;
  if (n === r || a === o) return [1, 0, 0, 1, s[0], s[1]];
  const l = (s[2] - s[0]) / (r - n), c = (s[3] - s[1]) / (o - a);
  return [l, 0, 0, c, s[0] - n * l, s[1] - a * c];
}
class R2 {
  constructor(t) {
    const { dict: e, xref: i, annotationGlobals: n, ref: a, orphanFields: r } = t, o = r == null ? void 0 : r.get(a);
    o && e.set("Parent", o), this.setTitle(e.get("T")), this.setContents(e.get("Contents")), this.setModificationDate(e.get("M")), this.setFlags(e.get("F")), this.setRectangle(e.getArray("Rect")), this.setColor(e.getArray("C")), this.setBorderStyle(e), this.setAppearance(e), this.setOptionalContent(e);
    const l = e.get("MK");
    this.setBorderAndBackgroundColors(l), this.setRotation(l, e), this.ref = t.ref instanceof yt ? t.ref : null, this._streams = [], this.appearance && this._streams.push(this.appearance);
    const c = !!(this.flags & OC), h = !!(this.flags & UC);
    if (this.data = { annotationFlags: this.flags, borderStyle: this.borderStyle, color: this.color, backgroundColor: this.backgroundColor, borderColor: this.borderColor, rotation: this.rotation, contentsObj: this._contents, hasAppearance: !!this.appearance, id: t.id, modificationDate: this.modificationDate, rect: this.rectangle, subtype: t.subtype, hasOwnCanvas: !1, noRotate: !!(this.flags & LC), noHTML: c && h, isEditable: !1, structParent: -1 }, n.structTreeRoot) {
      let f = e.get("StructParent");
      this.data.structParent = f = Number.isInteger(f) && f >= 0 ? f : -1, n.structTreeRoot.addAnnotationIdToPage(t.pageRef, f);
    }
    if (t.collectFields) {
      const f = e.get("Kids");
      if (Array.isArray(f)) {
        const d = [];
        for (const p of f) p instanceof yt && d.push(p.toString());
        d.length !== 0 && (this.data.kidIds = d);
      }
      this.data.actions = K9(i, e, Ev), this.data.fieldName = this._constructFieldName(e), this.data.pageIndex = t.pageIndex;
    }
    const u = e.get("IT");
    u instanceof Z && (this.data.it = u.name), this._isOffscreenCanvasSupported = t.evaluatorOptions.isOffscreenCanvasSupported, this._fallbackFontDict = null, this._needAppearances = !1;
  }
  _hasFlag(t, e) {
    return !!(t & e);
  }
  _buildFlags(t, e) {
    let { flags: i } = this;
    return t === void 0 ? e === void 0 ? void 0 : e ? i & ~vh : i & ~Dl | vh : t ? (i |= vh, e ? i & ~Ud | Dl : i & ~Dl | Ud) : (i &= -35, e ? i & ~vh : i | vh);
  }
  _isViewable(t) {
    return !this._hasFlag(t, j2) && !this._hasFlag(t, Ud);
  }
  _isPrintable(t) {
    return this._hasFlag(t, vh) && !this._hasFlag(t, Dl) && !this._hasFlag(t, j2);
  }
  mustBeViewed(t, e) {
    var n;
    const i = (n = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : n.noView;
    return i !== void 0 ? !i : this.viewable && !this._hasFlag(this.flags, Dl);
  }
  mustBePrinted(t) {
    var i;
    const e = (i = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : i.noPrint;
    return e !== void 0 ? !e : this.printable;
  }
  mustBeViewedWhenEditing(t, e = null) {
    return t ? !this.data.isEditable : !(e != null && e.has(this.data.id));
  }
  get viewable() {
    return this.data.quadPoints !== null && (this.flags === 0 || this._isViewable(this.flags));
  }
  get printable() {
    return this.data.quadPoints !== null && this.flags !== 0 && this._isPrintable(this.flags);
  }
  _parseStringHelper(t) {
    const e = typeof t == "string" ? Jt(t) : "";
    return { str: e, dir: e && GA(e).dir === "rtl" ? "rtl" : "ltr" };
  }
  setDefaultAppearance(t) {
    const { dict: e, annotationGlobals: i } = t, n = vn({ dict: e, key: "DA" }) || i.acroForm.get("DA");
    this._defaultAppearance = typeof n == "string" ? n : "", this.data.defaultAppearanceData = T7(this._defaultAppearance);
  }
  setTitle(t) {
    this._title = this._parseStringHelper(t);
  }
  setContents(t) {
    this._contents = this._parseStringHelper(t);
  }
  setModificationDate(t) {
    this.modificationDate = typeof t == "string" ? t : null;
  }
  setFlags(t) {
    this.flags = Number.isInteger(t) && t > 0 ? t : 0, this.flags & j2 && this.constructor.name !== "Annotation" && (this.flags ^= j2);
  }
  hasFlag(t) {
    return this._hasFlag(this.flags, t);
  }
  setRectangle(t) {
    this.rectangle = Kr(t, [0, 0, 0, 0]);
  }
  setColor(t) {
    this.color = ou(t);
  }
  setLineEndings(t) {
    if (this.lineEndings = ["None", "None"], Array.isArray(t) && t.length === 2) for (let e = 0; e < 2; e++) {
      const i = t[e];
      if (i instanceof Z) switch (i.name) {
        case "None":
          continue;
        case "Square":
        case "Circle":
        case "Diamond":
        case "OpenArrow":
        case "ClosedArrow":
        case "Butt":
        case "ROpenArrow":
        case "RClosedArrow":
        case "Slash":
          this.lineEndings[e] = i.name;
          continue;
      }
      D(`Ignoring invalid lineEnding: ${i}`);
    }
  }
  setRotation(t, e) {
    this.rotation = 0;
    let i = t instanceof q ? t.get("R") || 0 : e.get("Rotate") || 0;
    Number.isInteger(i) && i !== 0 && (i %= 360, i < 0 && (i += 360), i % 90 == 0 && (this.rotation = i));
  }
  setBorderAndBackgroundColors(t) {
    t instanceof q ? (this.borderColor = ou(t.getArray("BC"), null), this.backgroundColor = ou(t.getArray("BG"), null)) : this.borderColor = this.backgroundColor = null;
  }
  setBorderStyle(t) {
    if (this.borderStyle = new kN(), t instanceof q) if (t.has("BS")) {
      const e = t.get("BS");
      if (e instanceof q) {
        const i = e.get("Type");
        (!i || He(i, "Border")) && (this.borderStyle.setWidth(e.get("W"), this.rectangle), this.borderStyle.setStyle(e.get("S")), this.borderStyle.setDashArray(e.getArray("D")));
      }
    } else if (t.has("Border")) {
      const e = t.getArray("Border");
      Array.isArray(e) && e.length >= 3 && (this.borderStyle.setHorizontalCornerRadius(e[0]), this.borderStyle.setVerticalCornerRadius(e[1]), this.borderStyle.setWidth(e[2], this.rectangle), e.length === 4 && this.borderStyle.setDashArray(e[3], !0));
    } else this.borderStyle.setWidth(0);
  }
  setAppearance(t) {
    this.appearance = null;
    const e = t.get("AP");
    if (!(e instanceof q)) return;
    const i = e.get("N");
    if (i instanceof Ot) {
      this.appearance = i;
      return;
    }
    if (!(i instanceof q)) return;
    const n = t.get("AS");
    if (!(n instanceof Z && i.has(n.name))) return;
    const a = i.get(n.name);
    a instanceof Ot && (this.appearance = a);
  }
  setOptionalContent(t) {
    this.oc = null;
    const e = t.get("OC");
    e instanceof Z ? D("setOptionalContent: Support for /Name-entry is not implemented.") : e instanceof q && (this.oc = e);
  }
  async loadResources(t, e) {
    const i = await e.dict.getAsync("Resources");
    return i && await P1.load(i, t, i.xref), i;
  }
  async getOperatorList(t, e, i, n) {
    const { hasOwnCanvas: a, id: r, rect: o } = this.data;
    let l = this.appearance;
    const c = !!(a && i & bp);
    if (c && (this.width === 0 || this.height === 0))
      return this.data.hasOwnCanvas = !1, { opList: new Ys(), separateForm: !1, separateCanvas: !1 };
    if (!l) {
      if (!c) return { opList: new Ys(), separateForm: !1, separateCanvas: !1 };
      l = new di(""), l.dict = new q();
    }
    const h = l.dict, u = await this.loadResources(q3, l), f = z3(h.getArray("BBox"), [0, 0, 1, 1]), d = Qo(h.getArray("Matrix"), ia), p = P6(o, f, d), m = new Ys();
    let b;
    return this.oc && (b = await t.parseMarkedContentProps(this.oc, null)), b !== void 0 && m.addOp(Na, ["OC", b]), m.addOp(Xv, [r, o, p, d, c]), await t.getOperatorList({ stream: l, task: e, resources: u, operatorList: m, fallbackFontDict: this._fallbackFontDict }), m.addOp(Kv, []), b !== void 0 && m.addOp(I1, []), this.reset(), { opList: m, separateForm: !1, separateCanvas: c };
  }
  async save(t, e, i, n) {
    return null;
  }
  get hasTextContent() {
    return !1;
  }
  async extractTextContent(t, e, i) {
    if (!this.appearance) return;
    const n = await this.loadResources(j3, this.appearance), a = [], r = [];
    let o = null;
    const l = { desiredSize: Math.Infinity, ready: !0, enqueue(c, h) {
      for (const u of c.items) u.str !== void 0 && (o || (o = u.transform.slice(-2)), r.push(u.str), u.hasEOL && (a.push(r.join("").trimEnd()), r.length = 0));
    } };
    if (await t.getTextContent({ stream: this.appearance, task: e, resources: n, includeMarkedContent: !0, keepWhiteSpace: !0, sink: l, viewBox: i }), this.reset(), r.length && a.push(r.join("").trimEnd()), a.length > 1 || a[0]) {
      const c = this.appearance.dict, h = z3(c.getArray("BBox"), null), u = Qo(c.getArray("Matrix"), null);
      this.data.textPosition = this._transformPoint(o, h, u), this.data.textContent = a;
    }
  }
  _transformPoint(t, e, i) {
    const { rect: n } = this.data;
    e || (e = [0, 0, 1, 1]), i || (i = [1, 0, 0, 1, 0, 0]);
    const a = P6(n, e, i);
    a[4] -= n[0], a[5] -= n[1];
    const r = t.slice();
    return se.applyTransform(r, a), se.applyTransform(r, i), r;
  }
  getFieldObject() {
    return this.data.kidIds ? { id: this.data.id, actions: this.data.actions, name: this.data.fieldName, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, type: "", kidIds: this.data.kidIds, page: this.data.pageIndex, rotation: this.rotation } : null;
  }
  reset() {
    for (const t of this._streams) t.reset();
  }
  _constructFieldName(t) {
    if (!t.has("T") && !t.has("Parent"))
      return D("Unknown field name, falling back to empty field name."), "";
    if (!t.has("Parent")) return Jt(t.get("T"));
    const e = [];
    t.has("T") && e.unshift(Jt(t.get("T")));
    let i = t;
    const n = new Qe();
    for (t.objId && n.put(t.objId); i.has("Parent") && (i = i.get("Parent"), !(!(i instanceof q) || i.objId && n.has(i.objId))); )
      i.objId && n.put(i.objId), i.has("T") && e.unshift(Jt(i.get("T")));
    return e.join(".");
  }
  get width() {
    return this.data.rect[2] - this.data.rect[0];
  }
  get height() {
    return this.data.rect[3] - this.data.rect[1];
  }
}
class kN {
  constructor() {
    this.width = 1, this.rawWidth = 1, this.style = G8, this.dashArray = [3], this.horizontalCornerRadius = 0, this.verticalCornerRadius = 0;
  }
  setWidth(t, e = [0, 0, 0, 0]) {
    if (t instanceof Z) this.width = 0;
    else if (typeof t == "number") {
      if (t > 0) {
        this.rawWidth = t;
        const i = (e[2] - e[0]) / 2, n = (e[3] - e[1]) / 2;
        i > 0 && n > 0 && (t > i || t > n) && (D(`AnnotationBorderStyle.setWidth - ignoring width: ${t}`), t = 1);
      }
      this.width = t;
    }
  }
  setStyle(t) {
    if (t instanceof Z) switch (t.name) {
      case "S":
        this.style = G8;
        break;
      case "D":
        this.style = JC;
        break;
      case "B":
        this.style = ZC;
        break;
      case "I":
        this.style = QC;
        break;
      case "U":
        this.style = tI;
    }
  }
  setDashArray(t, e = !1) {
    if (Array.isArray(t)) {
      let i = !0, n = !0;
      for (const a of t) {
        if (!(+a >= 0)) {
          i = !1;
          break;
        }
        a > 0 && (n = !1);
      }
      t.length === 0 || i && !n ? (this.dashArray = t, e && this.setStyle(Z.get("D"))) : this.width = 0;
    } else t && (this.width = 0);
  }
  setHorizontalCornerRadius(t) {
    Number.isInteger(t) && (this.horizontalCornerRadius = t);
  }
  setVerticalCornerRadius(t) {
    Number.isInteger(t) && (this.verticalCornerRadius = t);
  }
}
class Ei extends R2 {
  constructor(t) {
    super(t);
    const { dict: e } = t;
    if (e.has("IRT")) {
      const n = e.getRaw("IRT");
      this.data.inReplyTo = n instanceof yt ? n.toString() : null;
      const a = e.get("RT");
      this.data.replyType = a instanceof Z ? a.name : BC;
    }
    let i = null;
    if (this.data.replyType === Tv) {
      const n = e.get("IRT");
      this.setTitle(n.get("T")), this.data.titleObj = this._title, this.setContents(n.get("Contents")), this.data.contentsObj = this._contents, n.has("CreationDate") ? (this.setCreationDate(n.get("CreationDate")), this.data.creationDate = this.creationDate) : this.data.creationDate = null, n.has("M") ? (this.setModificationDate(n.get("M")), this.data.modificationDate = this.modificationDate) : this.data.modificationDate = null, i = n.getRaw("Popup"), n.has("C") ? (this.setColor(n.getArray("C")), this.data.color = this.color) : this.data.color = null;
    } else
      this.data.titleObj = this._title, this.setCreationDate(e.get("CreationDate")), this.data.creationDate = this.creationDate, i = e.getRaw("Popup"), e.has("C") || (this.data.color = null);
    this.data.popupRef = i instanceof yt ? i.toString() : null, e.has("RC") && (this.data.richText = M2.getRichTextAsHtml(e.get("RC")));
  }
  setCreationDate(t) {
    this.creationDate = typeof t == "string" ? t : null;
  }
  _setDefaultAppearance({ xref: t, extra: e, strokeColor: i, fillColor: n, blendMode: a, strokeAlpha: r, fillAlpha: o, pointsCallback: l }) {
    const c = this.data.rect = [1 / 0, 1 / 0, -1 / 0, -1 / 0], h = ["q"];
    e && h.push(e), i && h.push(`${i[0]} ${i[1]} ${i[2]} RG`), n && h.push(`${n[0]} ${n[1]} ${n[2]} rg`);
    const u = this.data.quadPoints || Float32Array.from([this.rectangle[0], this.rectangle[3], this.rectangle[2], this.rectangle[3], this.rectangle[0], this.rectangle[1], this.rectangle[2], this.rectangle[1]]);
    for (let w = 0, A = u.length; w < A; w += 8) {
      const x = l(h, u.subarray(w, w + 8));
      se.rectBoundingBox(...x, c);
    }
    h.push("Q");
    const f = new q(t), d = new q(t);
    d.set("Subtype", Z.get("Form"));
    const p = new di(h.join(" "));
    p.dict = d, f.set("Fm0", p);
    const m = new q(t);
    a && m.set("BM", Z.get(a)), typeof r == "number" && m.set("CA", r), typeof o == "number" && m.set("ca", o);
    const b = new q(t);
    b.set("GS0", m);
    const y = new q(t);
    y.set("ExtGState", b), y.set("XObject", f);
    const v = new q(t);
    v.set("Resources", y), v.set("BBox", c), this.appearance = new di("/GS0 gs /Fm0 Do"), this.appearance.dict = v, this._streams.push(this.appearance, p);
  }
  static async createNewAnnotation(t, e, i, n) {
    const a = e.ref || (e.ref = t.getNewTemporaryRef()), r = await this.createNewAppearanceStream(e, t, n);
    let o;
    if (r) {
      const l = t.getNewTemporaryRef();
      o = this.createNewDict(e, t, { apRef: l }), i.put(l, { data: r });
    } else o = this.createNewDict(e, t, {});
    return Number.isInteger(e.parentTreeId) && o.set("StructParent", e.parentTreeId), i.put(a, { data: o }), { ref: a };
  }
  static async createNewPrintAnnotation(t, e, i, n) {
    const a = await this.createNewAppearanceStream(i, e, n), r = this.createNewDict(i, e, a ? { ap: a } : {}), o = new this.prototype.constructor({ dict: r, xref: e, annotationGlobals: t, evaluatorOptions: n.evaluatorOptions });
    return i.ref && (o.ref = o.refToReplace = i.ref), o;
  }
}
class ra extends R2 {
  constructor(t) {
    var f;
    super(t);
    const { dict: e, xref: i, annotationGlobals: n } = t, a = this.data;
    this._needAppearances = t.needAppearances, a.annotationType = NC, a.fieldName === void 0 && (a.fieldName = this._constructFieldName(e)), a.actions === void 0 && (a.actions = K9(i, e, Ev));
    let r = vn({ dict: e, key: "V", getArray: !0 });
    a.fieldValue = this._decodeFormValue(r);
    const o = vn({ dict: e, key: "DV", getArray: !0 });
    if (a.defaultFieldValue = this._decodeFormValue(o), r === void 0 && n.xfaDatasets) {
      const d = this._title.str;
      d && (this._hasValueFromXFA = !0, a.fieldValue = r = n.xfaDatasets.getValue(d));
    }
    r === void 0 && a.defaultFieldValue !== null && (a.fieldValue = a.defaultFieldValue), a.alternativeText = Jt(e.get("TU") || ""), this.setDefaultAppearance(t), a.hasAppearance || (a.hasAppearance = this._needAppearances && a.fieldValue !== void 0 && a.fieldValue !== null);
    const l = vn({ dict: e, key: "FT" });
    a.fieldType = l instanceof Z ? l.name : null;
    const c = vn({ dict: e, key: "DR" }), h = n.acroForm.get("DR"), u = (f = this.appearance) == null ? void 0 : f.dict.get("Resources");
    this._fieldResources = { localResources: c, acroFormResources: h, appearanceResources: u, mergedResources: q.merge({ xref: i, dictArray: [c, u, h], mergeSubDicts: !0 }) }, a.fieldFlags = vn({ dict: e, key: "Ff" }), (!Number.isInteger(a.fieldFlags) || a.fieldFlags < 0) && (a.fieldFlags = 0), a.password = this.hasFieldFlag($C), a.readOnly = this.hasFieldFlag(qC), a.required = this.hasFieldFlag(jC), a.hidden = this._hasFlag(a.annotationFlags, Dl) || this._hasFlag(a.annotationFlags, Ud);
  }
  _decodeFormValue(t) {
    return Array.isArray(t) ? t.filter((e) => typeof e == "string").map((e) => Jt(e)) : t instanceof Z ? Jt(t.name) : typeof t == "string" ? Jt(t) : null;
  }
  hasFieldFlag(t) {
    return !!(this.data.fieldFlags & t);
  }
  _isViewable(t) {
    return !0;
  }
  mustBeViewed(t, e) {
    return e ? this.viewable : super.mustBeViewed(t, e) && !this._hasFlag(this.flags, Ud);
  }
  getRotationMatrix(t) {
    var i;
    let e = (i = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : i.rotation;
    return e === void 0 && (e = this.rotation), e === 0 ? ia : Np(e, this.width, this.height);
  }
  getBorderAndBackgroundAppearances(t) {
    var a;
    let e = (a = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : a.rotation;
    if (e === void 0 && (e = this.rotation), !this.backgroundColor && !this.borderColor) return "";
    const i = e === 0 || e === 180 ? `0 0 ${this.width} ${this.height} re` : `0 0 ${this.height} ${this.width} re`;
    let n = "";
    return this.backgroundColor && (n = `${Ua(this.backgroundColor, !0)} ${i} f `), this.borderColor && (n += `${this.borderStyle.width || 1} w ${Ua(this.borderColor, !1)} ${i} S `), n;
  }
  async getOperatorList(t, e, i, n) {
    if (i & Iv && !(this instanceof Xx) && !this.data.noHTML && !this.data.hasOwnCanvas) return { opList: new Ys(), separateForm: !0, separateCanvas: !1 };
    if (!this._hasText) return super.getOperatorList(t, e, i, n);
    const a = await this._getAppearance(t, e, i, n);
    if (this.appearance && a === null) return super.getOperatorList(t, e, i, n);
    const r = new Ys();
    if (!this._defaultAppearance || a === null) return { opList: r, separateForm: !1, separateCanvas: !1 };
    const o = !!(this.data.hasOwnCanvas && i & bp), l = [0, 0, this.width, this.height], c = P6(this.data.rect, l, [1, 0, 0, 1, 0, 0]);
    let h;
    this.oc && (h = await t.parseMarkedContentProps(this.oc, null)), h !== void 0 && r.addOp(Na, ["OC", h]), r.addOp(Xv, [this.data.id, this.data.rect, c, this.getRotationMatrix(n), o]);
    const u = new di(a);
    return await t.getOperatorList({ stream: u, task: e, resources: this._fieldResources.mergedResources, operatorList: r }), r.addOp(Kv, []), h !== void 0 && r.addOp(I1, []), { opList: r, separateForm: !1, separateCanvas: o };
  }
  _getMKDict(t) {
    const e = new q(null);
    return t && e.set("R", t), this.borderColor && e.set("BC", Zs(this.borderColor)), this.backgroundColor && e.set("BG", Zs(this.backgroundColor)), e.size > 0 ? e : null;
  }
  amendSavedDict(t, e) {
  }
  setValue(t, e, i, n) {
    const { dict: a, ref: r } = function(l, c, h) {
      const u = new Qe(), f = l, d = { dict: null, ref: null };
      for (; l instanceof q && !u.has(c) && (u.put(c), !l.has("T")); ) {
        if (!((c = l.getRaw("Parent")) instanceof yt)) return d;
        l = h.fetch(c);
      }
      return l instanceof q && l !== f && (d.dict = l, d.ref = c), d;
    }(t, this.ref, i);
    if (a) {
      if (!n.has(r)) {
        const o = a.clone();
        return o.set("V", e), n.put(r, { data: o }), o;
      }
    } else t.set("V", e);
    return null;
  }
  async save(t, e, i, n) {
    const a = i == null ? void 0 : i.get(this.data.id), r = this._buildFlags(a == null ? void 0 : a.noView, a == null ? void 0 : a.noPrint);
    let o = a == null ? void 0 : a.value, l = a == null ? void 0 : a.rotation;
    if (o === this.data.fieldValue || o === void 0) {
      if (!this._hasValueFromXFA && l === void 0 && r === void 0) return;
      o || (o = this.data.fieldValue);
    }
    if (l === void 0 && !this._hasValueFromXFA && Array.isArray(o) && Array.isArray(this.data.fieldValue) && r0(o, this.data.fieldValue) && r === void 0) return;
    l === void 0 && (l = this.rotation);
    let c = null;
    if (!this._needAppearances && (c = await this._getAppearance(t, e, O8, i), c === null && r === void 0))
      return;
    let h = !1;
    c != null && c.needAppearances && (h = !0, c = null);
    const { xref: u } = t, f = u.fetchIfRef(this.ref);
    if (!(f instanceof q)) return;
    const d = new q(u);
    for (const y of f.getKeys()) y !== "AP" && d.set(y, f.getRaw(y));
    if (r !== void 0 && (d.set("F", r), c === null && !h)) {
      const y = f.getRaw("AP");
      y && d.set("AP", y);
    }
    const p = { path: this.data.fieldName, value: o }, m = this.setValue(d, Array.isArray(o) ? o.map(An) : An(o), u, n);
    this.amendSavedDict(i, m || d);
    const b = this._getMKDict(l);
    if (b && d.set("MK", b), n.put(this.ref, { data: d, xfa: p, needAppearances: h }), c !== null) {
      const y = u.getNewTemporaryRef(), v = new q(u);
      d.set("AP", v), v.set("N", y);
      const w = this._getSaveFieldResources(u), A = new di(c), x = A.dict = new q(u);
      x.set("Subtype", Z.get("Form")), x.set("Resources", w);
      const k = l % 180 == 0 ? [0, 0, this.width, this.height] : [0, 0, this.height, this.width];
      x.set("BBox", k);
      const I = this.getRotationMatrix(i);
      I !== ia && x.set("Matrix", I), n.put(y, { data: A, xfa: null, needAppearances: !1 });
    }
    d.set("M", `D:${Xr()}`);
  }
  async _getAppearance(t, e, i, n) {
    if (this.data.password) return null;
    const a = n == null ? void 0 : n.get(this.data.id);
    let r, o;
    if (a && (r = a.formattedValue || a.value, o = a.rotation), o === void 0 && r === void 0 && !this._needAppearances && (!this._hasValueFromXFA || this.appearance)) return null;
    const l = this.getBorderAndBackgroundAppearances(n);
    if (r === void 0 && (r = this.data.fieldValue, !r))
      return `/Tx BMC q ${l}Q EMC`;
    if (Array.isArray(r) && r.length === 1 && (r = r[0]), As(typeof r == "string", "Expected `value` to be a string."), r = r.trimEnd(), this.data.combo) {
      const I = this.data.options.find(({ exportValue: T }) => r === T);
      r = (I == null ? void 0 : I.displayValue) || r;
    }
    if (r === "") return `/Tx BMC q ${l}Q EMC`;
    o === void 0 && (o = this.rotation);
    let c, h = -1;
    this.data.multiLine ? (c = r.split(/\r\n?|\n/).map((I) => I.normalize("NFC")), h = c.length) : c = [r.replace(/\r\n?|\n/, "").normalize("NFC")];
    let { width: u, height: f } = this;
    o !== 90 && o !== 270 || ([u, f] = [f, u]), this._defaultAppearance || (this.data.defaultAppearanceData = T7(this._defaultAppearance = "/Helvetica 0 Tf 0 g"));
    let d, p, m, b = await ra._getFontData(t, e, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
    const y = [];
    let v = !1;
    for (const I of c) {
      const T = b.encodeString(I);
      T.length > 1 && (v = !0), y.push(T.join(""));
    }
    if (v && i & O8) return { needAppearances: !0 };
    if (v && this._isOffscreenCanvasSupported) {
      const I = this.data.comb ? "monospace" : "sans-serif", T = new Ba(t.xref, I), E = T.createFontResources(c.join("")), M = E.getRaw("Font");
      if (this._fieldResources.mergedResources.has("Font")) {
        const Y = this._fieldResources.mergedResources.get("Font");
        for (const B of M.getKeys()) Y.set(B, M.getRaw(B));
      } else this._fieldResources.mergedResources.set("Font", M);
      const F = T.fontName.name;
      b = await ra._getFontData(t, e, { fontName: F, fontSize: 0 }, E);
      for (let Y = 0, B = y.length; Y < B; Y++) y[Y] = nA(c[Y]);
      const L = Object.assign(/* @__PURE__ */ Object.create(null), this.data.defaultAppearanceData);
      this.data.defaultAppearanceData.fontSize = 0, this.data.defaultAppearanceData.fontName = F, [d, p, m] = this._computeFontSize(f - 2, u - 4, r, b, h), this.data.defaultAppearanceData = L;
    } else
      this._isOffscreenCanvasSupported || D("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."), [d, p, m] = this._computeFontSize(f - 2, u - 4, r, b, h);
    let w = b.descent;
    w = isNaN(w) ? N8 * m : Math.max(N8 * m, Math.abs(w) * p);
    const A = Math.min(Math.floor((f - p) / 2), 1), x = this.data.textAlignment;
    if (this.data.multiLine) return this._getMultilineAppearance(d, y, b, p, u, f, x, 2, A, w, m, n);
    if (this.data.comb) return this._getCombAppearance(d, b, y[0], p, u, f, 2, A, w, m, n);
    const k = A + w;
    return x === 0 || x > 2 ? `/Tx BMC q ${l}BT ` + d + ` 1 0 0 1 ${Vt(2)} ${Vt(k)} Tm (${T1(y[0])}) Tj ET Q EMC` : `/Tx BMC q ${l}BT ` + d + ` 1 0 0 1 0 0 Tm ${this._renderText(y[0], b, p, u, x, { shift: 0 }, 2, k)} ET Q EMC`;
  }
  static async _getFontData(t, e, i, n) {
    const a = new Ys(), r = { font: null, clone() {
      return this;
    } }, { fontName: o, fontSize: l } = i;
    return await t.handleSetFont(n, [o && Z.get(o), l], null, a, e, r, null), r.font;
  }
  _getTextWidth(t, e) {
    return Math.sumPrecise(e.charsToGlyphs(t).map((i) => i.width)) / 1e3;
  }
  _computeFontSize(t, e, i, n, a) {
    let { fontSize: r } = this.data.defaultAppearanceData, o = (r || 12) * th, l = Math.round(t / o);
    if (!r) {
      const c = (f) => Math.floor(100 * f) / 100;
      if (a === -1) {
        const f = this._getTextWidth(i, n);
        r = c(Math.min(t / th, e / f)), l = 1;
      } else {
        const f = i.split(/\r\n?|\n/), d = [];
        for (const m of f) {
          const b = n.encodeString(m).join(""), y = n.charsToGlyphs(b), v = n.getCharPositions(b);
          d.push({ line: b, glyphs: y, positions: v });
        }
        const p = (m) => {
          let b = 0;
          for (const y of d)
            if (b += this._splitLine(null, n, m, e, y).length * m, b > t) return !0;
          return !1;
        };
        for (l = Math.max(l, a); o = t / l, r = c(o / th), !!p(r); )
          l++;
      }
      const { fontName: h, fontColor: u } = this.data.defaultAppearanceData;
      this._defaultAppearance = function({ fontSize: d, fontName: p, fontColor: m }) {
        return `/${p7(p)} ${d} Tf ${Ua(m, !0)}`;
      }({ fontSize: r, fontName: h, fontColor: u });
    }
    return [this._defaultAppearance, r, t / l];
  }
  _renderText(t, e, i, n, a, r, o, l) {
    let c;
    a === 1 ? c = (n - this._getTextWidth(t, e) * i) / 2 : a === 2 ? c = n - this._getTextWidth(t, e) * i - o : c = o;
    const h = Vt(c - r.shift);
    return r.shift = c, `${h} ${l = Vt(l)} Td (${T1(t)}) Tj`;
  }
  _getSaveFieldResources(t) {
    var r;
    const { localResources: e, appearanceResources: i, acroFormResources: n } = this._fieldResources, a = (r = this.data.defaultAppearanceData) == null ? void 0 : r.fontName;
    if (!a) return e || q.empty;
    for (const o of [e, i]) if (o instanceof q) {
      const l = o.get("Font");
      if (l instanceof q && l.has(a)) return o;
    }
    if (n instanceof q) {
      const o = n.get("Font");
      if (o instanceof q && o.has(a)) {
        const l = new q(t);
        l.set(a, o.getRaw(a));
        const c = new q(t);
        return c.set("Font", l), q.merge({ xref: t, dictArray: [c, e], mergeSubDicts: !0 });
      }
    }
    return e || q.empty;
  }
  getFieldObject() {
    return null;
  }
}
class SN extends ra {
  constructor(t) {
    super(t);
    const { dict: e } = t;
    e.has("PMD") && (this.flags |= Dl, this.data.hidden = !0, D("Barcodes are not supported")), this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML, this._hasText = !0, typeof this.data.fieldValue != "string" && (this.data.fieldValue = "");
    let i = vn({ dict: e, key: "Q" });
    (!Number.isInteger(i) || i < 0 || i > 2) && (i = null), this.data.textAlignment = i;
    let n = vn({ dict: e, key: "MaxLen" });
    (!Number.isInteger(n) || n < 0) && (n = 0), this.data.maxLen = n, this.data.multiLine = this.hasFieldFlag(HC), this.data.comb = this.hasFieldFlag(YC) && !this.data.multiLine && !this.data.password && !this.hasFieldFlag(WC) && this.data.maxLen !== 0, this.data.doNotScroll = this.hasFieldFlag(KC);
  }
  get hasTextContent() {
    return !!this.appearance && !this._needAppearances;
  }
  _getCombAppearance(t, e, i, n, a, r, o, l, c, h, u) {
    const f = a / this.data.maxLen, d = this.getBorderAndBackgroundAppearances(u), p = [], m = e.getCharPositions(i);
    for (const [y, v] of m) p.push(`(${T1(i.substring(y, v))}) Tj`);
    const b = p.join(` ${Vt(f)} 0 Td `);
    return `/Tx BMC q ${d}BT ` + t + ` 1 0 0 1 ${Vt(o)} ${Vt(l + c)} Tm ${b} ET Q EMC`;
  }
  _getMultilineAppearance(t, e, i, n, a, r, o, l, c, h, u, f) {
    const d = [], p = a - 2 * l, m = { shift: 0 };
    for (let v = 0, w = e.length; v < w; v++) {
      const A = e[v], x = this._splitLine(A, i, n, p);
      for (let k = 0, I = x.length; k < I; k++) {
        const T = x[k], E = v === 0 && k === 0 ? -c - (u - h) : -u;
        d.push(this._renderText(T, i, n, a, o, m, l, E));
      }
    }
    const b = this.getBorderAndBackgroundAppearances(f), y = d.join(`
`);
    return `/Tx BMC q ${b}BT ` + t + ` 1 0 0 1 0 ${Vt(r)} Tm ${y} ET Q EMC`;
  }
  _splitLine(t, e, i, n, a = {}) {
    t = a.line || t;
    const r = a.glyphs || e.charsToGlyphs(t);
    if (r.length <= 1) return [t];
    const o = a.positions || e.getCharPositions(t), l = i / 1e3, c = [];
    let h = -1, u = -1, f = -1, d = 0, p = 0;
    for (let m = 0, b = r.length; m < b; m++) {
      const [y, v] = o[m], w = r[m], A = w.width * l;
      w.unicode === " " ? p + A > n ? (c.push(t.substring(d, y)), d = y, p = A, h = -1, f = -1) : (p += A, h = y, u = v, f = m) : p + A > n ? h !== -1 ? (c.push(t.substring(d, u)), d = u, m = f + 1, h = -1, p = 0) : (c.push(t.substring(d, y)), d = y, p = A) : p += A;
    }
    return d < t.length && c.push(t.substring(d, t.length)), c;
  }
  async extractTextContent(t, e, i) {
    await super.extractTextContent(t, e, i);
    const n = this.data.textContent;
    if (!n) return;
    const a = n.join(`
`);
    if (a === this.data.fieldValue) return;
    const r = a.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g, (o, l) => l ? `\\${l}` : "\\s+");
    new RegExp(`^\\s*${r}\\s*$`).test(this.data.fieldValue) && (this.data.textContent = this.data.fieldValue.split(`
`));
  }
  getFieldObject() {
    return { id: this.data.id, value: this.data.fieldValue, defaultValue: this.data.defaultFieldValue || "", multiline: this.data.multiLine, password: this.data.password, charLimit: this.data.maxLen, comb: this.data.comb, editable: !this.data.readOnly, hidden: this.data.hidden, name: this.data.fieldName, rect: this.data.rect, actions: this.data.actions, page: this.data.pageIndex, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, type: "text" };
  }
}
class CN extends ra {
  constructor(t) {
    super(t), this.checkedAppearance = null, this.uncheckedAppearance = null;
    const e = this.hasFieldFlag(zC), i = this.hasFieldFlag(GC);
    this.data.checkBox = !e && !i, this.data.radioButton = e && !i, this.data.pushButton = i, this.data.isTooltipOnly = !1, this.data.checkBox ? this._processCheckBox(t) : this.data.radioButton ? this._processRadioButton(t) : this.data.pushButton ? (this.data.hasOwnCanvas = !0, this.data.noHTML = !1, this._processPushButton(t)) : D("Invalid field flags for button widget annotation");
  }
  async getOperatorList(t, e, i, n) {
    if (this.data.pushButton) return super.getOperatorList(t, e, i, !1, n);
    let a = null, r = null;
    if (n) {
      const l = n.get(this.data.id);
      a = l ? l.value : null, r = l ? l.rotation : null;
    }
    if (a === null && this.appearance) return super.getOperatorList(t, e, i, n);
    a == null && (a = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue);
    const o = a ? this.checkedAppearance : this.uncheckedAppearance;
    if (o) {
      const l = this.appearance, c = Qo(o.dict.getArray("Matrix"), ia);
      r && o.dict.set("Matrix", this.getRotationMatrix(n)), this.appearance = o;
      const h = super.getOperatorList(t, e, i, n);
      return this.appearance = l, o.dict.set("Matrix", c), h;
    }
    return { opList: new Ys(), separateForm: !1, separateCanvas: !1 };
  }
  async save(t, e, i, n) {
    this.data.checkBox ? this._saveCheckbox(t, e, i, n) : this.data.radioButton && this._saveRadioButton(t, e, i, n);
  }
  async _saveCheckbox(t, e, i, n) {
    if (!i) return;
    const a = i.get(this.data.id), r = this._buildFlags(a == null ? void 0 : a.noView, a == null ? void 0 : a.noPrint);
    let o = a == null ? void 0 : a.rotation, l = a == null ? void 0 : a.value;
    if (o === void 0 && r === void 0 && (l === void 0 || this.data.fieldValue === this.data.exportValue === l))
      return;
    let c = t.xref.fetchIfRef(this.ref);
    if (!(c instanceof q)) return;
    c = c.clone(), o === void 0 && (o = this.rotation), l === void 0 && (l = this.data.fieldValue === this.data.exportValue);
    const h = { path: this.data.fieldName, value: l ? this.data.exportValue : "" }, u = Z.get(l ? this.data.exportValue : "Off");
    this.setValue(c, u, t.xref, n), c.set("AS", u), c.set("M", `D:${Xr()}`), r !== void 0 && c.set("F", r);
    const f = this._getMKDict(o);
    f && c.set("MK", f), n.put(this.ref, { data: c, xfa: h, needAppearances: !1 });
  }
  async _saveRadioButton(t, e, i, n) {
    if (!i) return;
    const a = i.get(this.data.id), r = this._buildFlags(a == null ? void 0 : a.noView, a == null ? void 0 : a.noPrint);
    let o = a == null ? void 0 : a.rotation, l = a == null ? void 0 : a.value;
    if (o === void 0 && r === void 0 && (l === void 0 || this.data.fieldValue === this.data.buttonValue === l))
      return;
    let c = t.xref.fetchIfRef(this.ref);
    if (!(c instanceof q)) return;
    c = c.clone(), l === void 0 && (l = this.data.fieldValue === this.data.buttonValue), o === void 0 && (o = this.rotation);
    const h = { path: this.data.fieldName, value: l ? this.data.buttonValue : "" }, u = Z.get(l ? this.data.buttonValue : "Off");
    l && this.setValue(c, u, t.xref, n), c.set("AS", u), c.set("M", `D:${Xr()}`), r !== void 0 && c.set("F", r);
    const f = this._getMKDict(o);
    f && c.set("MK", f), n.put(this.ref, { data: c, xfa: h, needAppearances: !1 });
  }
  _getDefaultCheckedAppearance(t, e) {
    const { width: i, height: n } = this, a = [0, 0, i, n], r = 0.8 * Math.min(i, n);
    let o, l;
    e === "check" ? (o = { width: 0.755 * r, height: 0.705 * r }, l = "3") : e === "disc" ? (o = { width: 0.791 * r, height: 0.705 * r }, l = "l") : Wt(`_getDefaultCheckedAppearance - unsupported type: ${e}`);
    const c = `q BT /PdfJsZaDb ${r} Tf 0 g ${Vt((i - o.width) / 2)} ${Vt((n - o.height) / 2)} Td (${l}) Tj ET Q`, h = new q(t.xref);
    h.set("FormType", 1), h.set("Subtype", Z.get("Form")), h.set("Type", Z.get("XObject")), h.set("BBox", a), h.set("Matrix", [1, 0, 0, 1, 0, 0]), h.set("Length", c.length);
    const u = new q(t.xref), f = new q(t.xref);
    f.set("PdfJsZaDb", this.fallbackFontDict), u.set("Font", f), h.set("Resources", u), this.checkedAppearance = new di(c), this.checkedAppearance.dict = h, this._streams.push(this.checkedAppearance);
  }
  _processCheckBox(t) {
    const e = t.dict.get("AP");
    if (!(e instanceof q)) return;
    const i = e.get("N");
    if (!(i instanceof q)) return;
    const n = this._decodeFormValue(t.dict.get("AS"));
    typeof n == "string" && (this.data.fieldValue = n);
    const a = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes", r = this._decodeFormValue(i.getKeys());
    if (r.length === 0) r.push("Off", a);
    else if (r.length === 1) r[0] === "Off" ? r.push(a) : r.unshift("Off");
    else if (r.includes(a))
      r.length = 0, r.push("Off", a);
    else {
      const c = r.find((h) => h !== "Off");
      r.length = 0, r.push("Off", c);
    }
    r.includes(this.data.fieldValue) || (this.data.fieldValue = "Off"), this.data.exportValue = r[1];
    const o = i.get(this.data.exportValue);
    this.checkedAppearance = o instanceof Ot ? o : null;
    const l = i.get("Off");
    this.uncheckedAppearance = l instanceof Ot ? l : null, this.checkedAppearance ? this._streams.push(this.checkedAppearance) : this._getDefaultCheckedAppearance(t, "check"), this.uncheckedAppearance && this._streams.push(this.uncheckedAppearance), this._fallbackFontDict = this.fallbackFontDict, this.data.defaultFieldValue === null && (this.data.defaultFieldValue = "Off");
  }
  _processRadioButton(t) {
    this.data.buttonValue = null;
    const e = t.dict.get("Parent");
    if (e instanceof q) {
      this.parent = t.dict.getRaw("Parent");
      const o = e.get("V");
      o instanceof Z && (this.data.fieldValue = this._decodeFormValue(o));
    }
    const i = t.dict.get("AP");
    if (!(i instanceof q)) return;
    const n = i.get("N");
    if (!(n instanceof q)) return;
    for (const o of n.getKeys()) if (o !== "Off") {
      this.data.buttonValue = this._decodeFormValue(o);
      break;
    }
    const a = n.get(this.data.buttonValue);
    this.checkedAppearance = a instanceof Ot ? a : null;
    const r = n.get("Off");
    this.uncheckedAppearance = r instanceof Ot ? r : null, this.checkedAppearance ? this._streams.push(this.checkedAppearance) : this._getDefaultCheckedAppearance(t, "disc"), this.uncheckedAppearance && this._streams.push(this.uncheckedAppearance), this._fallbackFontDict = this.fallbackFontDict, this.data.defaultFieldValue === null && (this.data.defaultFieldValue = "Off");
  }
  _processPushButton(t) {
    const { dict: e, annotationGlobals: i } = t;
    e.has("A") || e.has("AA") || this.data.alternativeText ? (this.data.isTooltipOnly = !e.has("A") && !e.has("AA"), m0.parseDestDictionary({ destDict: e, resultObj: this.data, docBaseUrl: i.baseUrl, docAttachments: i.attachments })) : D("Push buttons without action dictionaries are not supported");
  }
  getFieldObject() {
    let t, e = "button";
    return this.data.checkBox ? (e = "checkbox", t = this.data.exportValue) : this.data.radioButton && (e = "radiobutton", t = this.data.buttonValue), { id: this.data.id, value: this.data.fieldValue || "Off", defaultValue: this.data.defaultFieldValue, exportValues: t, editable: !this.data.readOnly, name: this.data.fieldName, rect: this.data.rect, hidden: this.data.hidden, actions: this.data.actions, page: this.data.pageIndex, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, type: e };
  }
  get fallbackFontDict() {
    const t = new q();
    return t.set("BaseFont", Z.get("ZapfDingbats")), t.set("Type", Z.get("FallbackType")), t.set("Subtype", Z.get("FallbackType")), t.set("Encoding", Z.get("ZapfDingbatsEncoding")), gt(this, "fallbackFontDict", t);
  }
}
class IN extends ra {
  constructor(t) {
    var a;
    super(t);
    const { dict: e, xref: i } = t;
    this.indices = e.getArray("I"), this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0, this.data.options = [];
    const n = vn({ dict: e, key: "Opt" });
    if (Array.isArray(n)) for (let r = 0, o = n.length; r < o; r++) {
      const l = i.fetchIfRef(n[r]), c = Array.isArray(l);
      this.data.options[r] = { exportValue: this._decodeFormValue(c ? i.fetchIfRef(l[0]) : l), displayValue: this._decodeFormValue(c ? i.fetchIfRef(l[1]) : l) };
    }
    if (this.hasIndices) {
      this.data.fieldValue = [];
      const r = this.data.options.length;
      for (const o of this.indices) Number.isInteger(o) && o >= 0 && o < r && this.data.fieldValue.push(this.data.options[o].exportValue);
    } else typeof this.data.fieldValue == "string" ? this.data.fieldValue = [this.data.fieldValue] : (a = this.data).fieldValue || (a.fieldValue = []);
    this.data.options.length === 0 && this.data.fieldValue.length > 0 && (this.data.options = this.data.fieldValue.map((r) => ({ exportValue: r, displayValue: r }))), this.data.combo = this.hasFieldFlag(VC), this.data.multiSelect = this.hasFieldFlag(XC), this._hasText = !0;
  }
  getFieldObject() {
    const t = this.data.combo ? "combobox" : "listbox", e = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null;
    return { id: this.data.id, value: e, defaultValue: this.data.defaultFieldValue, editable: !this.data.readOnly, name: this.data.fieldName, rect: this.data.rect, numItems: this.data.fieldValue.length, multipleSelection: this.data.multiSelect, hidden: this.data.hidden, actions: this.data.actions, items: this.data.options, page: this.data.pageIndex, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, type: t };
  }
  amendSavedDict(t, e) {
    var r;
    if (!this.hasIndices) return;
    let i = (r = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : r.value;
    Array.isArray(i) || (i = [i]);
    const n = [], { options: a } = this.data;
    for (let o = 0, l = 0, c = a.length; o < c; o++) a[o].exportValue === i[l] && (n.push(o), l += 1);
    e.set("I", n);
  }
  async _getAppearance(t, e, i, n) {
    if (this.data.combo) return super._getAppearance(t, e, i, n);
    let a, r;
    const o = n == null ? void 0 : n.get(this.data.id);
    if (o && (r = o.rotation, a = o.value), r === void 0 && a === void 0 && !this._needAppearances) return null;
    a === void 0 ? a = this.data.fieldValue : Array.isArray(a) || (a = [a]);
    let { width: l, height: c } = this;
    r !== 90 && r !== 270 || ([l, c] = [c, l]);
    const h = this.data.options.length, u = [];
    for (let k = 0; k < h; k++) {
      const { exportValue: I } = this.data.options[k];
      a.includes(I) && u.push(k);
    }
    this._defaultAppearance || (this.data.defaultAppearanceData = T7(this._defaultAppearance = "/Helvetica 0 Tf 0 g"));
    const f = await ra._getFontData(t, e, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
    let d, { fontSize: p } = this.data.defaultAppearanceData;
    if (p) d = this._defaultAppearance;
    else {
      const k = (c - 1) / h;
      let I, T = -1;
      for (const { displayValue: E } of this.data.options) {
        const M = this._getTextWidth(E, f);
        M > T && (T = M, I = E);
      }
      [d, p] = this._computeFontSize(k, l - 4, I, f, -1);
    }
    const m = p * th, b = (m - p) / 2, y = Math.floor(c / m);
    let v = 0;
    if (u.length > 0) {
      const k = Math.min(...u), I = Math.max(...u);
      v = Math.max(0, I - y + 1), v > k && (v = k);
    }
    const w = Math.min(v + y + 1, h), A = ["/Tx BMC q", `1 1 ${l} ${c} re W n`];
    if (u.length) {
      A.push("0.600006 0.756866 0.854904 rg");
      for (const k of u) v <= k && k < w && A.push(`1 ${c - (k - v + 1) * m} ${l} ${m} re f`);
    }
    A.push("BT", d, `1 0 0 1 0 ${c} Tm`);
    const x = { shift: 0 };
    for (let k = v; k < w; k++) {
      const { displayValue: I } = this.data.options[k], T = k === v ? b : 0;
      A.push(this._renderText(I, f, p, l, 0, x, 2, -m + T));
    }
    return A.push("ET Q EMC"), A.join(`
`);
  }
}
class Xx extends ra {
  constructor(t) {
    super(t), this.data.fieldValue = null, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !this.data.hasOwnCanvas;
  }
  getFieldObject() {
    return { id: this.data.id, value: null, page: this.data.pageIndex, type: "signature" };
  }
}
class _N extends Ei {
  constructor(t) {
    super(t), this.data.noRotate = !0, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1;
    const { dict: e } = t;
    this.data.annotationType = yC, this.data.hasAppearance ? this.data.name = "NoIcon" : (this.data.rect[1] = this.data.rect[3] - 22, this.data.rect[2] = this.data.rect[0] + 22, this.data.name = e.has("Name") ? e.get("Name").name : "Note"), e.has("State") ? (this.data.state = e.get("State") || null, this.data.stateModel = e.get("StateModel") || null) : (this.data.state = null, this.data.stateModel = null);
  }
}
class TN extends R2 {
  constructor(t) {
    var a;
    super(t);
    const { dict: e, annotationGlobals: i } = t;
    this.data.annotationType = wC, this.data.noHTML = !1;
    const n = F2(e, this.rectangle);
    n && (this.data.quadPoints = n), (a = this.data).borderColor || (a.borderColor = this.data.color), m0.parseDestDictionary({ destDict: e, resultObj: this.data, docBaseUrl: i.baseUrl, docAttachments: i.attachments });
  }
}
class Kx extends R2 {
  constructor(t) {
    super(t);
    const { dict: e } = t;
    this.data.annotationType = PC, this.data.noHTML = !1, this.width !== 0 && this.height !== 0 || (this.data.rect = null);
    let i = e.get("Parent");
    if (!i) {
      D("Popup annotation has a missing or invalid parent annotation.");
      return;
    }
    if (this.data.parentRect = Kr(i.getArray("Rect"), null), He(i.get("RT"), Tv) && (i = i.get("IRT")), i.has("M") ? (this.setModificationDate(i.get("M")), this.data.modificationDate = this.modificationDate) : this.data.modificationDate = null, i.has("C") ? (this.setColor(i.getArray("C")), this.data.color = this.color) : this.data.color = null, !this.viewable) {
      const n = i.get("F");
      this._isViewable(n) && this.setFlags(n);
    }
    this.setTitle(i.get("T")), this.data.titleObj = this._title, this.setContents(i.get("Contents")), this.data.contentsObj = this._contents, i.has("RC") && (this.data.richText = M2.getRichTextAsHtml(i.get("RC"))), this.data.open = !!e.get("Open");
  }
}
class Gm extends Ei {
  constructor(t) {
    var a;
    super(t), this.data.hasOwnCanvas = this.data.noRotate, this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1;
    const { annotationGlobals: e, evaluatorOptions: i, xref: n } = t;
    if (this.data.annotationType = vC, this.setDefaultAppearance(t), this._hasAppearance = !!this.appearance, this._hasAppearance) {
      const { fontColor: r, fontSize: o } = function(c, h, u, f) {
        return new RE(c, h, u, f).parse();
      }(this.appearance, i, n, e.globalColorSpaceCache);
      this.data.defaultAppearanceData.fontColor = r, this.data.defaultAppearanceData.fontSize = o || 10;
    } else {
      (a = this.data.defaultAppearanceData).fontSize || (a.fontSize = 10);
      const { fontColor: r, fontSize: o } = this.data.defaultAppearanceData;
      if (this._contents.str) {
        this.data.textContent = this._contents.str.split(/\r\n?|\n/).map((u) => u.trimEnd());
        const { coords: l, bbox: c, matrix: h } = Ba.getFirstPositionInfo(this.rectangle, this.rotation, o);
        this.data.textPosition = this._transformPoint(l, c, h);
      }
      if (this._isOffscreenCanvasSupported) {
        const l = t.dict.get("CA"), c = new Ba(n, "sans-serif");
        this.appearance = c.createAppearance(this._contents.str, this.rectangle, this.rotation, o, r, l), this._streams.push(this.appearance);
      } else D("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.");
    }
  }
  get hasTextContent() {
    return this._hasAppearance;
  }
  static createNewDict(t, e, { apRef: i, ap: n }) {
    const { color: a, fontSize: r, oldAnnotation: o, rect: l, rotation: c, user: h, value: u } = t, f = o || new q(e);
    f.set("Type", Z.get("Annot")), f.set("Subtype", Z.get("FreeText")), o ? (f.set("M", `D:${Xr()}`), f.delete("RC")) : f.set("CreationDate", `D:${Xr()}`), f.set("Rect", l);
    const d = `/Helv ${r} Tf ${Ua(a, !0)}`;
    if (f.set("DA", d), f.set("Contents", An(u)), f.set("F", 4), f.set("Border", [0, 0, 0]), f.set("Rotate", c), h && f.set("T", An(h)), i || n) {
      const p = new q(e);
      f.set("AP", p), i ? p.set("N", i) : p.set("N", n);
    }
    return f;
  }
  static async createNewAppearanceStream(t, e, i) {
    const { baseFontRef: n, evaluator: a, task: r } = i, { color: o, fontSize: l, rect: c, rotation: h, value: u } = t, f = new q(e), d = new q(e);
    if (n) d.set("Helv", n);
    else {
      const z = new q(e);
      z.set("BaseFont", Z.get("Helvetica")), z.set("Type", Z.get("Font")), z.set("Subtype", Z.get("Type1")), z.set("Encoding", Z.get("WinAnsiEncoding")), d.set("Helv", z);
    }
    f.set("Font", d);
    const p = await ra._getFontData(a, r, { fontName: "Helv", fontSize: l }, f), [m, b, y, v] = c;
    let w = y - m, A = v - b;
    h % 180 != 0 && ([w, A] = [A, w]);
    const x = u.split(`
`), k = l / 1e3;
    let I = -1 / 0;
    const T = [];
    for (let z of x) {
      const K = p.encodeString(z);
      if (K.length > 1) return null;
      z = K.join(""), T.push(z);
      let W = 0;
      const rt = p.charsToGlyphs(z);
      for (const $ of rt) W += $.width * k;
      I = Math.max(I, W);
    }
    let E = 1;
    I > w && (E = w / I);
    let M = 1;
    const F = th * l, L = 1 * l, Y = F * x.length;
    Y > A && (M = A / Y);
    const B = l * Math.min(E, M);
    let et, H, P;
    switch (h) {
      case 0:
        P = [1, 0, 0, 1], H = [c[0], c[1], w, A], et = [c[0], c[3] - L];
        break;
      case 90:
        P = [0, 1, -1, 0], H = [c[1], -c[2], w, A], et = [c[1], -c[0] - L];
        break;
      case 180:
        P = [-1, 0, 0, -1], H = [-c[2], -c[3], w, A], et = [-c[2], -c[1] - L];
        break;
      case 270:
        P = [0, -1, 1, 0], H = [-c[3], c[0], w, A], et = [-c[3], c[2] - L];
    }
    const G = ["q", `${P.join(" ")} 0 0 cm`, `${H.join(" ")} re W n`, "BT", `${Ua(o, !0)}`, `0 Tc /Helv ${Vt(B)} Tf`];
    G.push(`${et.join(" ")} Td (${T1(T[0])}) Tj`);
    const N = Vt(F);
    for (let z = 1, K = T.length; z < K; z++) {
      const W = T[z];
      G.push(`0 -${N} Td (${T1(W)}) Tj`);
    }
    G.push("ET", "Q");
    const j = G.join(`
`), V = new q(e);
    V.set("FormType", 1), V.set("Subtype", Z.get("Form")), V.set("Type", Z.get("XObject")), V.set("BBox", c), V.set("Resources", f), V.set("Matrix", [1, 0, 0, 1, -c[0], -c[1]]);
    const X = new di(j);
    return X.dict = V, X;
  }
}
class EN extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t;
    this.data.annotationType = AC, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1;
    const n = z3(e.getArray("L"), [0, 0, 0, 0]);
    if (this.data.lineCoordinates = se.normalizeRect(n), this.setLineEndings(e.getArray("LE")), this.data.lineEndings = this.lineEndings, !this.appearance) {
      const a = this.color ? Zs(this.color) : [0, 0, 0], r = e.get("CA"), o = ou(e.getArray("IC"), null), l = o ? Zs(o) : null, c = l ? r : null, h = this.borderStyle.width || 1, u = 2 * h, f = [this.data.lineCoordinates[0] - u, this.data.lineCoordinates[1] - u, this.data.lineCoordinates[2] + u, this.data.lineCoordinates[3] + u];
      se.intersect(this.rectangle, f) || (this.rectangle = f), this._setDefaultAppearance({ xref: i, extra: `${h} w`, strokeColor: a, fillColor: l, strokeAlpha: r, fillAlpha: c, pointsCallback: (d, p) => (d.push(`${n[0]} ${n[1]} m`, `${n[2]} ${n[3]} l`, "S"), [p[0] - h, p[7] - h, p[2] + h, p[3] + h]) });
    }
  }
}
class MN extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t;
    if (this.data.annotationType = xC, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1, !this.appearance) {
      const n = this.color ? Zs(this.color) : [0, 0, 0], a = e.get("CA"), r = ou(e.getArray("IC"), null), o = r ? Zs(r) : null, l = o ? a : null;
      if (this.borderStyle.width === 0 && !o) return;
      this._setDefaultAppearance({ xref: i, extra: `${this.borderStyle.width} w`, strokeColor: n, fillColor: o, strokeAlpha: a, fillAlpha: l, pointsCallback: (c, h) => {
        const u = h[4] + this.borderStyle.width / 2, f = h[5] + this.borderStyle.width / 2, d = h[6] - h[4] - this.borderStyle.width, p = h[3] - h[7] - this.borderStyle.width;
        return c.push(`${u} ${f} ${d} ${p} re`), o ? c.push("B") : c.push("S"), [h[0], h[7], h[2], h[3]];
      } });
    }
  }
}
class FN extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t;
    if (this.data.annotationType = kC, !this.appearance) {
      const n = this.color ? Zs(this.color) : [0, 0, 0], a = e.get("CA"), r = ou(e.getArray("IC"), null), o = r ? Zs(r) : null, l = o ? a : null;
      if (this.borderStyle.width === 0 && !o) return;
      const c = 4 / 3 * Math.tan(Math.PI / 8);
      this._setDefaultAppearance({ xref: i, extra: `${this.borderStyle.width} w`, strokeColor: n, fillColor: o, strokeAlpha: a, fillAlpha: l, pointsCallback: (h, u) => {
        const f = u[0] + this.borderStyle.width / 2, d = u[1] - this.borderStyle.width / 2, p = u[6] - this.borderStyle.width / 2, m = u[7] + this.borderStyle.width / 2, b = f + (p - f) / 2, y = d + (m - d) / 2, v = (p - f) / 2 * c, w = (m - d) / 2 * c;
        return h.push(`${b} ${m} m`, `${b + v} ${m} ${p} ${y + w} ${p} ${y} c`, `${p} ${y - w} ${b + v} ${d} ${b} ${d} c`, `${b - v} ${d} ${f} ${y - w} ${f} ${y} c`, `${f} ${y + w} ${b - v} ${m} ${b} ${m} c`, "h"), o ? h.push("B") : h.push("S"), [u[0], u[7], u[2], u[3]];
      } });
    }
  }
}
class Yx extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t;
    this.data.annotationType = CC, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1, this.data.vertices = null, this instanceof Jx || (this.setLineEndings(e.getArray("LE")), this.data.lineEndings = this.lineEndings);
    const n = e.getArray("Vertices");
    if (!ci(n, null)) return;
    const a = this.data.vertices = Float32Array.from(n);
    if (!this.appearance) {
      const r = this.color ? Zs(this.color) : [0, 0, 0], o = e.get("CA"), l = this.borderStyle.width || 1, c = 2 * l, h = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
      for (let u = 0, f = a.length; u < f; u += 2) se.rectBoundingBox(a[u] - c, a[u + 1] - c, a[u] + c, a[u + 1] + c, h);
      se.intersect(this.rectangle, h) || (this.rectangle = h), this._setDefaultAppearance({ xref: i, extra: `${l} w`, strokeColor: r, strokeAlpha: o, pointsCallback: (u, f) => {
        for (let d = 0, p = a.length; d < p; d += 2) u.push(`${a[d]} ${a[d + 1]} ${d === 0 ? "m" : "l"}`);
        return u.push("S"), [f[0], f[7], f[2], f[3]];
      } });
    }
  }
}
class Jx extends Yx {
  constructor(t) {
    super(t), this.data.annotationType = SC;
  }
}
class RN extends Ei {
  constructor(t) {
    super(t), this.data.annotationType = FC;
  }
}
class ad extends Ei {
  constructor(t) {
    super(t), this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1;
    const { dict: e, xref: i } = t;
    this.data.annotationType = RC, this.data.inkLists = [], this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1, this.data.opacity = e.get("CA") || 1;
    const n = e.getArray("InkList");
    if (Array.isArray(n)) {
      for (let a = 0, r = n.length; a < r; ++a) {
        if (!Array.isArray(n[a])) continue;
        const o = new Float32Array(n[a].length);
        this.data.inkLists.push(o);
        for (let l = 0, c = n[a].length; l < c; l += 2) {
          const h = i.fetchIfRef(n[a][l]), u = i.fetchIfRef(n[a][l + 1]);
          typeof h == "number" && typeof u == "number" && (o[l] = h, o[l + 1] = u);
        }
      }
      if (!this.appearance) {
        const a = this.color ? Zs(this.color) : [0, 0, 0], r = e.get("CA"), o = this.borderStyle.width || 1, l = 2 * o, c = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
        for (const h of this.data.inkLists) for (let u = 0, f = h.length; u < f; u += 2) se.rectBoundingBox(h[u] - l, h[u + 1] - l, h[u] + l, h[u + 1] + l, c);
        se.intersect(this.rectangle, c) || (this.rectangle = c), this._setDefaultAppearance({ xref: i, extra: `${o} w`, strokeColor: a, strokeAlpha: r, pointsCallback: (h, u) => {
          for (const f of this.data.inkLists) {
            for (let d = 0, p = f.length; d < p; d += 2) h.push(`${f[d]} ${f[d + 1]} ${d === 0 ? "m" : "l"}`);
            h.push("S");
          }
          return [u[0], u[7], u[2], u[3]];
        } });
      }
    }
  }
  static createNewDict(t, e, { apRef: i, ap: n }) {
    const { oldAnnotation: a, color: r, opacity: o, paths: l, outlines: c, rect: h, rotation: u, thickness: f, user: d } = t, p = a || new q(e);
    p.set("Type", Z.get("Annot")), p.set("Subtype", Z.get("Ink")), p.set(a ? "M" : "CreationDate", `D:${Xr()}`), p.set("Rect", h), p.set("InkList", (c == null ? void 0 : c.points) || l.points), p.set("F", 4), p.set("Rotate", u), d && p.set("T", An(d)), c && p.set("IT", Z.get("InkHighlight"));
    const m = new q(e);
    p.set("BS", m), m.set("W", f), p.set("C", Zs(r)), p.set("CA", o);
    const b = new q(e);
    return p.set("AP", b), i ? b.set("N", i) : b.set("N", n), p;
  }
  static async createNewAppearanceStream(t, e, i) {
    if (t.outlines) return this.createNewAppearanceStreamForHighlight(t, e, i);
    const { color: n, rect: a, paths: r, thickness: o, opacity: l } = t, c = [`${o} w 1 J 1 j`, `${Ua(n, !1)}`];
    l !== 1 && c.push("/R0 gs");
    for (const d of r.lines) {
      c.push(`${Vt(d[4])} ${Vt(d[5])} m`);
      for (let p = 6, m = d.length; p < m; p += 6) if (isNaN(d[p])) c.push(`${Vt(d[p + 4])} ${Vt(d[p + 5])} l`);
      else {
        const [b, y, v, w, A, x] = d.slice(p, p + 6);
        c.push([b, y, v, w, A, x].map(Vt).join(" ") + " c");
      }
      d.length === 6 && c.push(`${Vt(d[4])} ${Vt(d[5])} l`);
    }
    c.push("S");
    const h = c.join(`
`), u = new q(e);
    if (u.set("FormType", 1), u.set("Subtype", Z.get("Form")), u.set("Type", Z.get("XObject")), u.set("BBox", a), u.set("Length", h.length), l !== 1) {
      const d = new q(e), p = new q(e), m = new q(e);
      m.set("CA", l), m.set("Type", Z.get("ExtGState")), p.set("R0", m), d.set("ExtGState", p), u.set("Resources", d);
    }
    const f = new di(h);
    return f.dict = u, f;
  }
  static async createNewAppearanceStreamForHighlight(t, e, i) {
    const { color: n, rect: a, outlines: { outline: r }, opacity: o } = t, l = [`${Ua(n, !0)}`, "/R0 gs"];
    l.push(`${Vt(r[4])} ${Vt(r[5])} m`);
    for (let m = 6, b = r.length; m < b; m += 6) if (isNaN(r[m])) l.push(`${Vt(r[m + 4])} ${Vt(r[m + 5])} l`);
    else {
      const [y, v, w, A, x, k] = r.slice(m, m + 6);
      l.push([y, v, w, A, x, k].map(Vt).join(" ") + " c");
    }
    l.push("h f");
    const c = l.join(`
`), h = new q(e);
    h.set("FormType", 1), h.set("Subtype", Z.get("Form")), h.set("Type", Z.get("XObject")), h.set("BBox", a), h.set("Length", c.length);
    const u = new q(e), f = new q(e);
    u.set("ExtGState", f), h.set("Resources", u);
    const d = new q(e);
    f.set("R0", d), d.set("BM", Z.get("Multiply")), o !== 1 && (d.set("ca", o), d.set("Type", Z.get("ExtGState")));
    const p = new di(c);
    return p.dict = h, p;
  }
}
class Vm extends Ei {
  constructor(t) {
    var n;
    super(t);
    const { dict: e, xref: i } = t;
    if (this.data.annotationType = IC, this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1, this.data.opacity = e.get("CA") || 1, this.data.quadPoints = F2(e, null)) {
      const a = (n = this.appearance) == null ? void 0 : n.dict.get("Resources");
      if (!this.appearance || !(a != null && a.has("ExtGState"))) {
        this.appearance && D("HighlightAnnotation - ignoring built-in appearance stream.");
        const r = this.color ? Zs(this.color) : [1, 1, 0], o = e.get("CA");
        this._setDefaultAppearance({ xref: i, fillColor: r, blendMode: "Multiply", fillAlpha: o, pointsCallback: (l, c) => (l.push(`${c[0]} ${c[1]} m`, `${c[2]} ${c[3]} l`, `${c[6]} ${c[7]} l`, `${c[4]} ${c[5]} l`, "f"), [c[0], c[7], c[2], c[3]]) });
      }
    } else this.data.popupRef = null;
  }
  static createNewDict(t, e, { apRef: i, ap: n }) {
    const { color: a, oldAnnotation: r, opacity: o, rect: l, rotation: c, user: h, quadPoints: u } = t, f = r || new q(e);
    if (f.set("Type", Z.get("Annot")), f.set("Subtype", Z.get("Highlight")), f.set(r ? "M" : "CreationDate", `D:${Xr()}`), f.set("CreationDate", `D:${Xr()}`), f.set("Rect", l), f.set("F", 4), f.set("Border", [0, 0, 0]), f.set("Rotate", c), f.set("QuadPoints", u), f.set("C", Zs(a)), f.set("CA", o), h && f.set("T", An(h)), i || n) {
      const d = new q(e);
      f.set("AP", d), d.set("N", i || n);
    }
    return f;
  }
  static async createNewAppearanceStream(t, e, i) {
    const { color: n, rect: a, outlines: r, opacity: o } = t, l = [`${Ua(n, !0)}`, "/R0 gs"], c = [];
    for (const b of r) {
      c.length = 0, c.push(`${Vt(b[0])} ${Vt(b[1])} m`);
      for (let y = 2, v = b.length; y < v; y += 2) c.push(`${Vt(b[y])} ${Vt(b[y + 1])} l`);
      c.push("h"), l.push(c.join(`
`));
    }
    l.push("f*");
    const h = l.join(`
`), u = new q(e);
    u.set("FormType", 1), u.set("Subtype", Z.get("Form")), u.set("Type", Z.get("XObject")), u.set("BBox", a), u.set("Length", h.length);
    const f = new q(e), d = new q(e);
    f.set("ExtGState", d), u.set("Resources", f);
    const p = new q(e);
    d.set("R0", p), p.set("BM", Z.get("Multiply")), o !== 1 && (p.set("ca", o), p.set("Type", Z.get("ExtGState")));
    const m = new di(h);
    return m.dict = u, m;
  }
}
class PN extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t;
    if (this.data.annotationType = _C, this.data.quadPoints = F2(e, null)) {
      if (!this.appearance) {
        const n = this.color ? Zs(this.color) : [0, 0, 0], a = e.get("CA");
        this._setDefaultAppearance({ xref: i, extra: "[] 0 d 0.571 w", strokeColor: n, strokeAlpha: a, pointsCallback: (r, o) => (r.push(`${o[4]} ${o[5] + 1.3} m`, `${o[6]} ${o[7] + 1.3} l`, "S"), [o[0], o[7], o[2], o[3]]) });
      }
    } else this.data.popupRef = null;
  }
}
class DN extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t;
    if (this.data.annotationType = TC, this.data.quadPoints = F2(e, null)) {
      if (!this.appearance) {
        const n = this.color ? Zs(this.color) : [0, 0, 0], a = e.get("CA");
        this._setDefaultAppearance({ xref: i, extra: "[] 0 d 1 w", strokeColor: n, strokeAlpha: a, pointsCallback: (r, o) => {
          const l = (o[1] - o[5]) / 6;
          let c = l, h = o[4];
          const u = o[5], f = o[6];
          r.push(`${h} ${u + c} m`);
          do
            h += 2, c = c === 0 ? l : 0, r.push(`${h} ${u + c} l`);
          while (h < f);
          return r.push("S"), [o[4], u - 2 * l, f, u + 2 * l];
        } });
      }
    } else this.data.popupRef = null;
  }
}
class NN extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t;
    if (this.data.annotationType = EC, this.data.quadPoints = F2(e, null)) {
      if (!this.appearance) {
        const n = this.color ? Zs(this.color) : [0, 0, 0], a = e.get("CA");
        this._setDefaultAppearance({ xref: i, extra: "[] 0 d 1 w", strokeColor: n, strokeAlpha: a, pointsCallback: (r, o) => (r.push((o[0] + o[4]) / 2 + " " + (o[1] + o[5]) / 2 + " m", (o[2] + o[6]) / 2 + " " + (o[3] + o[7]) / 2 + " l", "S"), [o[0], o[7], o[2], o[3]]) });
      }
    } else this.data.popupRef = null;
  }
}
var Zc, B9, Zx;
class Tl extends Ei {
  constructor(e) {
    super(e);
    _(this, Zc, null);
    this.data.annotationType = MC, this.data.hasOwnCanvas = this.data.noRotate, this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1;
  }
  mustBeViewedWhenEditing(e, i = null) {
    return e ? (this.data.isEditable && (g(this, Zc) ?? S(this, Zc, this.data.hasOwnCanvas), this.data.hasOwnCanvas = !0), !0) : (g(this, Zc) !== null && (this.data.hasOwnCanvas = g(this, Zc), S(this, Zc, null)), !(i != null && i.has(this.data.id)));
  }
  static async createImage(e, i) {
    const { width: n, height: a } = e, r = new OffscreenCanvas(n, a), o = r.getContext("2d", { alpha: !0 });
    o.drawImage(e, 0, 0);
    const l = o.getImageData(0, 0, n, a).data, c = new Uint32Array(l.buffer), h = c.some(Ii.isLittleEndian ? (b) => b >>> 24 != 255 : (b) => !!(255 & ~b));
    h && (o.fillStyle = "white", o.fillRect(0, 0, n, a), o.drawImage(e, 0, 0));
    const u = r.convertToBlob({ type: "image/jpeg", quality: 1 }).then((b) => b.arrayBuffer()), f = Z.get("XObject"), d = Z.get("Image"), p = new q(i);
    p.set("Type", f), p.set("Subtype", d), p.set("BitsPerComponent", 8), p.set("ColorSpace", Z.get("DeviceRGB")), p.set("Filter", Z.get("DCTDecode")), p.set("BBox", [0, 0, n, a]), p.set("Width", n), p.set("Height", a);
    let m = null;
    if (h) {
      const b = new Uint8Array(c.length);
      if (Ii.isLittleEndian) for (let v = 0, w = c.length; v < w; v++) b[v] = c[v] >>> 24;
      else for (let v = 0, w = c.length; v < w; v++) b[v] = 255 & c[v];
      const y = new q(i);
      y.set("Type", f), y.set("Subtype", d), y.set("BitsPerComponent", 8), y.set("ColorSpace", Z.get("DeviceGray")), y.set("Width", n), y.set("Height", a), m = new Le(b, 0, 0, y);
    }
    return { imageStream: new Le(await u, 0, 0, p), smaskStream: m, width: n, height: a };
  }
  static createNewDict(e, i, { apRef: n, ap: a }) {
    const { oldAnnotation: r, rect: o, rotation: l, user: c } = e, h = r || new q(i);
    if (h.set("Type", Z.get("Annot")), h.set("Subtype", Z.get("Stamp")), h.set(r ? "M" : "CreationDate", `D:${Xr()}`), h.set("Rect", o), h.set("F", 4), h.set("Border", [0, 0, 0]), h.set("Rotate", l), c && h.set("T", An(c)), n || a) {
      const u = new q(i);
      h.set("AP", u), n ? u.set("N", n) : u.set("N", a);
    }
    return h;
  }
  static async createNewAppearanceStream(e, i, n) {
    if (e.oldAnnotation) return null;
    if (e.isSignature) return C(this, B9, Zx).call(this, e, i);
    const { rotation: a } = e, { imageRef: r, width: o, height: l } = n.image, c = new q(i), h = new q(i);
    c.set("XObject", h), h.set("Im0", r);
    const u = `q ${o} 0 0 ${l} 0 0 cm /Im0 Do Q`, f = new q(i);
    if (f.set("FormType", 1), f.set("Subtype", Z.get("Form")), f.set("Type", Z.get("XObject")), f.set("BBox", [0, 0, o, l]), f.set("Resources", c), a) {
      const p = Np(a, o, l);
      f.set("Matrix", p);
    }
    const d = new di(u);
    return d.dict = f, d;
  }
}
Zc = new WeakMap(), B9 = new WeakSet(), Zx = async function(e, i) {
  const { areContours: n, color: a, rect: r, lines: o, thickness: l } = e, c = [`${l} w 1 J 1 j`, `${Ua(a, n)}`];
  for (const d of o) {
    c.push(`${Vt(d[4])} ${Vt(d[5])} m`);
    for (let p = 6, m = d.length; p < m; p += 6) if (isNaN(d[p])) c.push(`${Vt(d[p + 4])} ${Vt(d[p + 5])} l`);
    else {
      const [b, y, v, w, A, x] = d.slice(p, p + 6);
      c.push([b, y, v, w, A, x].map(Vt).join(" ") + " c");
    }
    d.length === 6 && c.push(`${Vt(d[4])} ${Vt(d[5])} l`);
  }
  c.push(n ? "F" : "S");
  const h = c.join(`
`), u = new q(i);
  u.set("FormType", 1), u.set("Subtype", Z.get("Form")), u.set("Type", Z.get("XObject")), u.set("BBox", r), u.set("Length", h.length);
  const f = new di(h);
  return f.dict = u, f;
}, _(Tl, B9);
class BN extends Ei {
  constructor(t) {
    super(t);
    const { dict: e, xref: i } = t, n = new b6(e.get("FS"), i);
    this.data.annotationType = DC, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1, this.data.file = n.serializable;
    const a = e.get("Name");
    this.data.name = a instanceof Z ? Jt(a.name) : "PushPin";
    const r = e.get("ca");
    this.data.fillAlpha = typeof r == "number" && r >= 0 && r <= 1 ? r : null;
  }
}
const LN = { get r() {
  return gt(this, "r", new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]));
}, get k() {
  return gt(this, "k", new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]));
} };
function oo(s, t, e) {
  let i = 1732584193, n = -271733879, a = -1732584194, r = 271733878;
  const o = e + 72 & -64, l = new Uint8Array(o);
  let c, h;
  for (c = 0; c < e; ++c) l[c] = s[t++];
  l[c++] = 128;
  const u = o - 8;
  c < u && (c = u), l[c++] = e << 3 & 255, l[c++] = e >> 5 & 255, l[c++] = e >> 13 & 255, l[c++] = e >> 21 & 255, l[c++] = e >>> 29 & 255, c += 3;
  const f = new Int32Array(16), { k: d, r: p } = LN;
  for (c = 0; c < o; ) {
    for (h = 0; h < 16; ++h, c += 4) f[h] = l[c] | l[c + 1] << 8 | l[c + 2] << 16 | l[c + 3] << 24;
    let m, b, y = i, v = n, w = a, A = r;
    for (h = 0; h < 64; ++h) {
      h < 16 ? (m = v & w | ~v & A, b = h) : h < 32 ? (m = A & v | ~A & w, b = 5 * h + 1 & 15) : h < 48 ? (m = v ^ w ^ A, b = 3 * h + 5 & 15) : (m = w ^ (v | ~A), b = 7 * h & 15);
      const x = A, k = y + m + d[h] + f[b] | 0, I = p[h];
      A = w, w = v, v = v + (k << I | k >>> 32 - I) | 0, y = x;
    }
    i = i + y | 0, n = n + v | 0, a = a + w | 0, r = r + A | 0;
  }
  return new Uint8Array([255 & i, i >> 8 & 255, i >> 16 & 255, i >>> 24 & 255, 255 & n, n >> 8 & 255, n >> 16 & 255, n >>> 24 & 255, 255 & a, a >> 8 & 255, a >> 16 & 255, a >>> 24 & 255, 255 & r, r >> 8 & 255, r >> 16 & 255, r >>> 24 & 255]);
}
function mb(s) {
  try {
    return a0(s);
  } catch (t) {
    return D(`UTF-8 decoding failed: "${t}".`), s;
  }
}
class ON extends Z9 {
  constructor(t) {
    super(t), this.node = null;
  }
  onEndElement(t) {
    const e = super.onEndElement(t);
    if (e && t === "xfa:datasets")
      throw this.node = e, new Error("Aborting DatasetXMLParser.");
  }
}
class UN {
  constructor(t) {
    if (t.datasets) this.node = new Z9({ hasAttributes: !0 }).parseFromString(t.datasets).documentElement;
    else {
      const e = new ON({ hasAttributes: !0 });
      try {
        e.parseFromString(t["xdp:xdp"]);
      } catch {
      }
      this.node = e.node;
    }
  }
  getValue(t) {
    if (!this.node || !t) return "";
    const e = this.node.searchNode(eA(t), 0);
    if (!e) return "";
    const i = e.firstChild;
    return (i == null ? void 0 : i.nodeName) === "value" ? e.children.map((n) => mb(n.textContent)) : mb(e.textContent);
  }
}
class bt {
  constructor(t, e) {
    this.high = 0 | t, this.low = 0 | e;
  }
  and(t) {
    this.high &= t.high, this.low &= t.low;
  }
  xor(t) {
    this.high ^= t.high, this.low ^= t.low;
  }
  shiftRight(t) {
    t >= 32 ? (this.low = this.high >>> t - 32 | 0, this.high = 0) : (this.low = this.low >>> t | this.high << 32 - t, this.high = this.high >>> t | 0);
  }
  rotateRight(t) {
    let e, i;
    32 & t ? (i = this.low, e = this.high) : (e = this.low, i = this.high), t &= 31, this.low = e >>> t | i << 32 - t, this.high = i >>> t | e << 32 - t;
  }
  not() {
    this.high = ~this.high, this.low = ~this.low;
  }
  add(t) {
    const e = (this.low >>> 0) + (t.low >>> 0);
    let i = (this.high >>> 0) + (t.high >>> 0);
    e > 4294967295 && (i += 1), this.low = 0 | e, this.high = 0 | i;
  }
  copyTo(t, e) {
    t[e] = this.high >>> 24 & 255, t[e + 1] = this.high >> 16 & 255, t[e + 2] = this.high >> 8 & 255, t[e + 3] = 255 & this.high, t[e + 4] = this.low >>> 24 & 255, t[e + 5] = this.low >> 16 & 255, t[e + 6] = this.low >> 8 & 255, t[e + 7] = 255 & this.low;
  }
  assign(t) {
    this.high = t.high, this.low = t.low;
  }
}
const qN = { get k() {
  return gt(this, "k", [new bt(1116352408, 3609767458), new bt(1899447441, 602891725), new bt(3049323471, 3964484399), new bt(3921009573, 2173295548), new bt(961987163, 4081628472), new bt(1508970993, 3053834265), new bt(2453635748, 2937671579), new bt(2870763221, 3664609560), new bt(3624381080, 2734883394), new bt(310598401, 1164996542), new bt(607225278, 1323610764), new bt(1426881987, 3590304994), new bt(1925078388, 4068182383), new bt(2162078206, 991336113), new bt(2614888103, 633803317), new bt(3248222580, 3479774868), new bt(3835390401, 2666613458), new bt(4022224774, 944711139), new bt(264347078, 2341262773), new bt(604807628, 2007800933), new bt(770255983, 1495990901), new bt(1249150122, 1856431235), new bt(1555081692, 3175218132), new bt(1996064986, 2198950837), new bt(2554220882, 3999719339), new bt(2821834349, 766784016), new bt(2952996808, 2566594879), new bt(3210313671, 3203337956), new bt(3336571891, 1034457026), new bt(3584528711, 2466948901), new bt(113926993, 3758326383), new bt(338241895, 168717936), new bt(666307205, 1188179964), new bt(773529912, 1546045734), new bt(1294757372, 1522805485), new bt(1396182291, 2643833823), new bt(1695183700, 2343527390), new bt(1986661051, 1014477480), new bt(2177026350, 1206759142), new bt(2456956037, 344077627), new bt(2730485921, 1290863460), new bt(2820302411, 3158454273), new bt(3259730800, 3505952657), new bt(3345764771, 106217008), new bt(3516065817, 3606008344), new bt(3600352804, 1432725776), new bt(4094571909, 1467031594), new bt(275423344, 851169720), new bt(430227734, 3100823752), new bt(506948616, 1363258195), new bt(659060556, 3750685593), new bt(883997877, 3785050280), new bt(958139571, 3318307427), new bt(1322822218, 3812723403), new bt(1537002063, 2003034995), new bt(1747873779, 3602036899), new bt(1955562222, 1575990012), new bt(2024104815, 1125592928), new bt(2227730452, 2716904306), new bt(2361852424, 442776044), new bt(2428436474, 593698344), new bt(2756734187, 3733110249), new bt(3204031479, 2999351573), new bt(3329325298, 3815920427), new bt(3391569614, 3928383900), new bt(3515267271, 566280711), new bt(3940187606, 3454069534), new bt(4118630271, 4000239992), new bt(116418474, 1914138554), new bt(174292421, 2731055270), new bt(289380356, 3203993006), new bt(460393269, 320620315), new bt(685471733, 587496836), new bt(852142971, 1086792851), new bt(1017036298, 365543100), new bt(1126000580, 2618297676), new bt(1288033470, 3409855158), new bt(1501505948, 4234509866), new bt(1607167915, 987167468), new bt(1816402316, 1246189591)]);
} };
function jN(s, t, e, i, n) {
  s.assign(t), s.and(e), n.assign(t), n.not(), n.and(i), s.xor(n);
}
function HN(s, t, e, i, n) {
  s.assign(t), s.and(e), n.assign(t), n.and(i), s.xor(n), n.assign(e), n.and(i), s.xor(n);
}
function $N(s, t, e) {
  s.assign(t), s.rotateRight(28), e.assign(t), e.rotateRight(34), s.xor(e), e.assign(t), e.rotateRight(39), s.xor(e);
}
function zN(s, t, e) {
  s.assign(t), s.rotateRight(14), e.assign(t), e.rotateRight(18), s.xor(e), e.assign(t), e.rotateRight(41), s.xor(e);
}
function GN(s, t, e) {
  s.assign(t), s.rotateRight(1), e.assign(t), e.rotateRight(8), s.xor(e), e.assign(t), e.shiftRight(7), s.xor(e);
}
function VN(s, t, e) {
  s.assign(t), s.rotateRight(19), e.assign(t), e.rotateRight(61), s.xor(e), e.assign(t), e.shiftRight(6), s.xor(e);
}
function bb(s, t, e, i = !1) {
  let n, a, r, o, l, c, h, u;
  i ? (n = new bt(3418070365, 3238371032), a = new bt(1654270250, 914150663), r = new bt(2438529370, 812702999), o = new bt(355462360, 4144912697), l = new bt(1731405415, 4290775857), c = new bt(2394180231, 1750603025), h = new bt(3675008525, 1694076839), u = new bt(1203062813, 3204075428)) : (n = new bt(1779033703, 4089235720), a = new bt(3144134277, 2227873595), r = new bt(1013904242, 4271175723), o = new bt(2773480762, 1595750129), l = new bt(1359893119, 2917565137), c = new bt(2600822924, 725511199), h = new bt(528734635, 4215389547), u = new bt(1541459225, 327033209));
  const f = 128 * Math.ceil((e + 17) / 128), d = new Uint8Array(f);
  let p, m;
  for (p = 0; p < e; ++p) d[p] = s[t++];
  d[p++] = 128;
  const b = f - 16;
  p < b && (p = b), p += 11, d[p++] = e >>> 29 & 255, d[p++] = e >> 21 & 255, d[p++] = e >> 13 & 255, d[p++] = e >> 5 & 255, d[p++] = e << 3 & 255;
  const y = new Array(80);
  for (p = 0; p < 80; p++) y[p] = new bt(0, 0);
  const { k: v } = qN;
  let w = new bt(0, 0), A = new bt(0, 0), x = new bt(0, 0), k = new bt(0, 0), I = new bt(0, 0), T = new bt(0, 0), E = new bt(0, 0), M = new bt(0, 0);
  const F = new bt(0, 0), L = new bt(0, 0), Y = new bt(0, 0), B = new bt(0, 0);
  let et, H;
  for (p = 0; p < f; ) {
    for (m = 0; m < 16; ++m)
      y[m].high = d[p] << 24 | d[p + 1] << 16 | d[p + 2] << 8 | d[p + 3], y[m].low = d[p + 4] << 24 | d[p + 5] << 16 | d[p + 6] << 8 | d[p + 7], p += 8;
    for (m = 16; m < 80; ++m)
      et = y[m], VN(et, y[m - 2], B), et.add(y[m - 7]), GN(Y, y[m - 15], B), et.add(Y), et.add(y[m - 16]);
    for (w.assign(n), A.assign(a), x.assign(r), k.assign(o), I.assign(l), T.assign(c), E.assign(h), M.assign(u), m = 0; m < 80; ++m)
      F.assign(M), zN(Y, I, B), F.add(Y), jN(Y, I, T, E, B), F.add(Y), F.add(v[m]), F.add(y[m]), $N(L, w, B), HN(Y, w, A, x, B), L.add(Y), et = M, M = E, E = T, T = I, k.add(F), I = k, k = x, x = A, A = w, et.assign(F), et.add(L), w = et;
    n.add(w), a.add(A), r.add(x), o.add(k), l.add(I), c.add(T), h.add(E), u.add(M);
  }
  return i ? (H = new Uint8Array(48), n.copyTo(H, 0), a.copyTo(H, 8), r.copyTo(H, 16), o.copyTo(H, 24), l.copyTo(H, 32), c.copyTo(H, 40)) : (H = new Uint8Array(64), n.copyTo(H, 0), a.copyTo(H, 8), r.copyTo(H, 16), o.copyTo(H, 24), l.copyTo(H, 32), c.copyTo(H, 40), h.copyTo(H, 48), u.copyTo(H, 56)), H;
}
const WN = { get k() {
  return gt(this, "k", [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]);
} };
function Ha(s, t) {
  return s >>> t | s << 32 - t;
}
function XN(s, t, e) {
  return s & t ^ ~s & e;
}
function KN(s, t, e) {
  return s & t ^ s & e ^ t & e;
}
function YN(s) {
  return Ha(s, 2) ^ Ha(s, 13) ^ Ha(s, 22);
}
function JN(s) {
  return Ha(s, 6) ^ Ha(s, 11) ^ Ha(s, 25);
}
function ZN(s) {
  return Ha(s, 7) ^ Ha(s, 18) ^ s >>> 3;
}
function D6(s, t, e) {
  let i = 1779033703, n = 3144134277, a = 1013904242, r = 2773480762, o = 1359893119, l = 2600822924, c = 528734635, h = 1541459225;
  const u = 64 * Math.ceil((e + 9) / 64), f = new Uint8Array(u);
  let d, p;
  for (d = 0; d < e; ++d) f[d] = s[t++];
  f[d++] = 128;
  const m = u - 8;
  d < m && (d = m), d += 3, f[d++] = e >>> 29 & 255, f[d++] = e >> 21 & 255, f[d++] = e >> 13 & 255, f[d++] = e >> 5 & 255, f[d++] = e << 3 & 255;
  const b = new Uint32Array(64), { k: y } = WN;
  for (d = 0; d < u; ) {
    for (p = 0; p < 16; ++p)
      b[p] = f[d] << 24 | f[d + 1] << 16 | f[d + 2] << 8 | f[d + 3], d += 4;
    for (p = 16; p < 64; ++p) b[p] = (Ha(v = b[p - 2], 17) ^ Ha(v, 19) ^ v >>> 10) + b[p - 7] + ZN(b[p - 15]) + b[p - 16] | 0;
    let w, A, x = i, k = n, I = a, T = r, E = o, M = l, F = c, L = h;
    for (p = 0; p < 64; ++p)
      w = L + JN(E) + XN(E, M, F) + y[p] + b[p], A = YN(x) + KN(x, k, I), L = F, F = M, M = E, E = T + w | 0, T = I, I = k, k = x, x = w + A | 0;
    i = i + x | 0, n = n + k | 0, a = a + I | 0, r = r + T | 0, o = o + E | 0, l = l + M | 0, c = c + F | 0, h = h + L | 0;
  }
  var v;
  return new Uint8Array([i >> 24 & 255, i >> 16 & 255, i >> 8 & 255, 255 & i, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n, a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, 255 & a, r >> 24 & 255, r >> 16 & 255, r >> 8 & 255, 255 & r, o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, 255 & o, l >> 24 & 255, l >> 16 & 255, l >> 8 & 255, 255 & l, c >> 24 & 255, c >> 16 & 255, c >> 8 & 255, 255 & c, h >> 24 & 255, h >> 16 & 255, h >> 8 & 255, 255 & h]);
}
class QN extends fi {
  constructor(t, e, i) {
    super(e), this.str = t, this.dict = t.dict, this.decrypt = i, this.nextChunk = null, this.initialized = !1;
  }
  readBlock() {
    var a;
    let t;
    if (this.initialized ? t = this.nextChunk : (t = this.str.getBytes(512), this.initialized = !0), !(t != null && t.length)) {
      this.eof = !0;
      return;
    }
    this.nextChunk = this.str.getBytes(512);
    const e = ((a = this.nextChunk) == null ? void 0 : a.length) > 0;
    t = (0, this.decrypt)(t, !e);
    const i = this.bufferLength, n = i + t.length;
    this.ensureBuffer(n).set(t, i), this.bufferLength = n;
  }
}
class vl {
  constructor(t) {
    this.a = 0, this.b = 0;
    const e = new Uint8Array(256), i = t.length;
    for (let n = 0; n < 256; ++n) e[n] = n;
    for (let n = 0, a = 0; n < 256; ++n) {
      const r = e[n];
      a = a + r + t[n % i] & 255, e[n] = e[a], e[a] = r;
    }
    this.s = e;
  }
  encryptBlock(t) {
    let e = this.a, i = this.b;
    const n = this.s, a = t.length, r = new Uint8Array(a);
    for (let o = 0; o < a; ++o) {
      e = e + 1 & 255;
      const l = n[e];
      i = i + l & 255;
      const c = n[i];
      n[e] = c, n[i] = l, r[o] = t[o] ^ n[l + c & 255];
    }
    return this.a = e, this.b = i, r;
  }
  decryptBlock(t) {
    return this.encryptBlock(t);
  }
  encrypt(t) {
    return this.encryptBlock(t);
  }
}
class tB {
  decryptBlock(t) {
    return t;
  }
  encrypt(t) {
    return t;
  }
}
class V7 {
  constructor() {
    ht(this, "_s", new Uint8Array([99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22]));
    ht(this, "_inv_s", new Uint8Array([82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125]));
    ht(this, "_mix", new Uint32Array([0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795]));
    ht(this, "_mixCol", new Uint8Array(256).map((t, e) => e < 128 ? e << 1 : e << 1 ^ 27));
    this.buffer = new Uint8Array(16), this.bufferPosition = 0;
  }
  _expandKey(t) {
    Wt("Cannot call `_expandKey` on the base class");
  }
  _decrypt(t, e) {
    let i, n, a;
    const r = new Uint8Array(16);
    r.set(t);
    for (let o = 0, l = this._keySize; o < 16; ++o, ++l) r[o] ^= e[l];
    for (let o = this._cyclesOfRepetition - 1; o >= 1; --o) {
      i = r[13], r[13] = r[9], r[9] = r[5], r[5] = r[1], r[1] = i, i = r[14], n = r[10], r[14] = r[6], r[10] = r[2], r[6] = i, r[2] = n, i = r[15], n = r[11], a = r[7], r[15] = r[3], r[11] = i, r[7] = n, r[3] = a;
      for (let l = 0; l < 16; ++l) r[l] = this._inv_s[r[l]];
      for (let l = 0, c = 16 * o; l < 16; ++l, ++c) r[l] ^= e[c];
      for (let l = 0; l < 16; l += 4) {
        const c = this._mix[r[l]], h = this._mix[r[l + 1]], u = this._mix[r[l + 2]], f = this._mix[r[l + 3]];
        i = c ^ h >>> 8 ^ h << 24 ^ u >>> 16 ^ u << 16 ^ f >>> 24 ^ f << 8, r[l] = i >>> 24 & 255, r[l + 1] = i >> 16 & 255, r[l + 2] = i >> 8 & 255, r[l + 3] = 255 & i;
      }
    }
    i = r[13], r[13] = r[9], r[9] = r[5], r[5] = r[1], r[1] = i, i = r[14], n = r[10], r[14] = r[6], r[10] = r[2], r[6] = i, r[2] = n, i = r[15], n = r[11], a = r[7], r[15] = r[3], r[11] = i, r[7] = n, r[3] = a;
    for (let o = 0; o < 16; ++o)
      r[o] = this._inv_s[r[o]], r[o] ^= e[o];
    return r;
  }
  _encrypt(t, e) {
    const i = this._s;
    let n, a, r;
    const o = new Uint8Array(16);
    o.set(t);
    for (let l = 0; l < 16; ++l) o[l] ^= e[l];
    for (let l = 1; l < this._cyclesOfRepetition; l++) {
      for (let c = 0; c < 16; ++c) o[c] = i[o[c]];
      r = o[1], o[1] = o[5], o[5] = o[9], o[9] = o[13], o[13] = r, r = o[2], a = o[6], o[2] = o[10], o[6] = o[14], o[10] = r, o[14] = a, r = o[3], a = o[7], n = o[11], o[3] = o[15], o[7] = r, o[11] = a, o[15] = n;
      for (let c = 0; c < 16; c += 4) {
        const h = o[c], u = o[c + 1], f = o[c + 2], d = o[c + 3];
        n = h ^ u ^ f ^ d, o[c] ^= n ^ this._mixCol[h ^ u], o[c + 1] ^= n ^ this._mixCol[u ^ f], o[c + 2] ^= n ^ this._mixCol[f ^ d], o[c + 3] ^= n ^ this._mixCol[d ^ h];
      }
      for (let c = 0, h = 16 * l; c < 16; ++c, ++h) o[c] ^= e[h];
    }
    for (let l = 0; l < 16; ++l) o[l] = i[o[l]];
    r = o[1], o[1] = o[5], o[5] = o[9], o[9] = o[13], o[13] = r, r = o[2], a = o[6], o[2] = o[10], o[6] = o[14], o[10] = r, o[14] = a, r = o[3], a = o[7], n = o[11], o[3] = o[15], o[7] = r, o[11] = a, o[15] = n;
    for (let l = 0, c = this._keySize; l < 16; ++l, ++c) o[l] ^= e[c];
    return o;
  }
  _decryptBlock2(t, e) {
    const i = t.length;
    let n = this.buffer, a = this.bufferPosition;
    const r = [];
    let o = this.iv;
    for (let h = 0; h < i; ++h) {
      if (n[a] = t[h], ++a, a < 16) continue;
      const u = this._decrypt(n, this._key);
      for (let f = 0; f < 16; ++f) u[f] ^= o[f];
      o = n, r.push(u), n = new Uint8Array(16), a = 0;
    }
    if (this.buffer = n, this.bufferLength = a, this.iv = o, r.length === 0) return new Uint8Array(0);
    let l = 16 * r.length;
    if (e) {
      const h = r.at(-1);
      let u = h[15];
      if (u <= 16) {
        for (let f = 15, d = 16 - u; f >= d; --f) if (h[f] !== u) {
          u = 0;
          break;
        }
        l -= u, r[r.length - 1] = h.subarray(0, 16 - u);
      }
    }
    const c = new Uint8Array(l);
    for (let h = 0, u = 0, f = r.length; h < f; ++h, u += 16) c.set(r[h], u);
    return c;
  }
  decryptBlock(t, e, i = null) {
    const n = t.length, a = this.buffer;
    let r = this.bufferPosition;
    if (i) this.iv = i;
    else {
      for (let o = 0; r < 16 && o < n; ++o, ++r) a[r] = t[o];
      if (r < 16)
        return this.bufferLength = r, new Uint8Array(0);
      this.iv = a, t = t.subarray(16);
    }
    return this.buffer = new Uint8Array(16), this.bufferLength = 0, this.decryptBlock = this._decryptBlock2, this.decryptBlock(t, e);
  }
  encrypt(t, e) {
    const i = t.length;
    let n = this.buffer, a = this.bufferPosition;
    const r = [];
    e || (e = new Uint8Array(16));
    for (let c = 0; c < i; ++c) {
      if (n[a] = t[c], ++a, a < 16) continue;
      for (let u = 0; u < 16; ++u) n[u] ^= e[u];
      const h = this._encrypt(n, this._key);
      e = h, r.push(h), n = new Uint8Array(16), a = 0;
    }
    if (this.buffer = n, this.bufferLength = a, this.iv = e, r.length === 0) return new Uint8Array(0);
    const o = 16 * r.length, l = new Uint8Array(o);
    for (let c = 0, h = 0, u = r.length; c < u; ++c, h += 16) l.set(r[c], h);
    return l;
  }
}
class Qx extends V7 {
  constructor(e) {
    super();
    ht(this, "_rcon", new Uint8Array([141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141]));
    this._cyclesOfRepetition = 10, this._keySize = 160, this._key = this._expandKey(e);
  }
  _expandKey(e) {
    const i = this._s, n = this._rcon, a = new Uint8Array(176);
    a.set(e);
    for (let r = 16, o = 1; r < 176; ++o) {
      let l = a[r - 3], c = a[r - 2], h = a[r - 1], u = a[r - 4];
      l = i[l], c = i[c], h = i[h], u = i[u], l ^= n[o];
      for (let f = 0; f < 4; ++f)
        a[r] = l ^= a[r - 16], r++, a[r] = c ^= a[r - 16], r++, a[r] = h ^= a[r - 16], r++, a[r] = u ^= a[r - 16], r++;
    }
    return a;
  }
}
class N6 extends V7 {
  constructor(t) {
    super(), this._cyclesOfRepetition = 14, this._keySize = 224, this._key = this._expandKey(t);
  }
  _expandKey(t) {
    const e = this._s, i = new Uint8Array(240);
    i.set(t);
    let n, a, r, o, l = 1;
    for (let c = 32, h = 1; c < 240; ++h) {
      c % 32 == 16 ? (n = e[n], a = e[a], r = e[r], o = e[o]) : c % 32 == 0 && (n = i[c - 3], a = i[c - 2], r = i[c - 1], o = i[c - 4], n = e[n], a = e[a], r = e[r], o = e[o], n ^= l, (l <<= 1) >= 256 && (l = 255 & (27 ^ l)));
      for (let u = 0; u < 4; ++u)
        i[c] = n ^= i[c - 32], c++, i[c] = a ^= i[c - 32], c++, i[c] = r ^= i[c - 32], c++, i[c] = o ^= i[c - 32], c++;
    }
    return i;
  }
}
class tk {
  _hash(t, e, i) {
    Wt("Abstract method `_hash` called");
  }
  checkOwnerPassword(t, e, i, n) {
    const a = new Uint8Array(t.length + 56);
    return a.set(t, 0), a.set(e, t.length), a.set(i, t.length + e.length), r0(this._hash(t, a, i), n);
  }
  checkUserPassword(t, e, i) {
    const n = new Uint8Array(t.length + 8);
    return n.set(t, 0), n.set(e, t.length), r0(this._hash(t, n, []), i);
  }
  getOwnerKey(t, e, i, n) {
    const a = new Uint8Array(t.length + 56);
    a.set(t, 0), a.set(e, t.length), a.set(i, t.length + e.length);
    const r = this._hash(t, a, i);
    return new N6(r).decryptBlock(n, !1, new Uint8Array(16));
  }
  getUserKey(t, e, i) {
    const n = new Uint8Array(t.length + 8);
    n.set(t, 0), n.set(e, t.length);
    const a = this._hash(t, n, []);
    return new N6(a).decryptBlock(i, !1, new Uint8Array(16));
  }
}
class eB extends tk {
  _hash(t, e, i) {
    return D6(e, 0, e.length);
  }
}
class sB extends tk {
  _hash(t, e, i) {
    let n = D6(e, 0, e.length).subarray(0, 32), a = [0], r = 0;
    for (; r < 64 || a.at(-1) > r - 32; ) {
      const h = t.length + n.length + i.length, u = new Uint8Array(h);
      let f = 0;
      u.set(t, f), f += t.length, u.set(n, f), f += n.length, u.set(i, f);
      const d = new Uint8Array(64 * h);
      for (let m = 0, b = 0; m < 64; m++, b += h) d.set(u, b);
      a = new Qx(n.subarray(0, 16)).encrypt(d, n.subarray(16, 32));
      const p = Math.sumPrecise(a.slice(0, 16)) % 3;
      p === 0 ? n = D6(a, 0, a.length) : p === 1 ? n = (o = a, l = 0, c = a.length, bb(o, l, c, !0)) : p === 2 && (n = bb(a, 0, a.length)), r++;
    }
    var o, l, c;
    return n.subarray(0, 32);
  }
}
class yb {
  constructor(t, e) {
    this.StringCipherConstructor = t, this.StreamCipherConstructor = e;
  }
  createStream(t, e) {
    const i = new this.StreamCipherConstructor();
    return new QN(t, e, function(a, r) {
      return i.decryptBlock(a, r);
    });
  }
  decryptString(t) {
    const e = new this.StringCipherConstructor();
    let i = Ns(t);
    return i = e.decryptBlock(i, !0), Si(i);
  }
  encryptString(t) {
    const e = new this.StringCipherConstructor();
    if (e instanceof V7) {
      const n = 16 - t.length % 16;
      t += String.fromCharCode(n).repeat(n);
      const a = new Uint8Array(16);
      crypto.getRandomValues(a);
      let r = Ns(t);
      r = e.encrypt(r, a);
      const o = new Uint8Array(16 + r.length);
      return o.set(a), o.set(r, 16), Si(o);
    }
    let i = Ns(t);
    return i = e.encrypt(i), Si(i);
  }
}
var Js, ek, L6, sk, np, O6;
const tu = class tu {
  constructor(t, e, i) {
    _(this, Js);
    const n = t.get("Filter");
    if (!He(n, "Standard")) throw new st("unknown encryption method");
    this.filterName = n.name, this.dict = t;
    const a = t.get("V");
    if (!Number.isInteger(a) || a !== 1 && a !== 2 && a !== 4 && a !== 5) throw new st("unsupported encryption algorithm");
    this.algorithm = a;
    let r = t.get("Length");
    if (!r) if (a <= 3) r = 40;
    else {
      const y = t.get("CF"), v = t.get("StmF");
      if (y instanceof q && v instanceof Z) {
        y.suppressEncryption = !0;
        const w = y.get(v.name);
        r = (w == null ? void 0 : w.get("Length")) || 128, r < 40 && (r <<= 3);
      }
    }
    if (!Number.isInteger(r) || r < 40 || r % 8 != 0) throw new st("invalid key length");
    const o = Ns(t.get("O")), l = Ns(t.get("U")), c = o.subarray(0, 32), h = l.subarray(0, 32), u = t.get("P"), f = t.get("R"), d = (a === 4 || a === 5) && t.get("EncryptMetadata") !== !1;
    this.encryptMetadata = d;
    const p = Ns(e);
    let m, b;
    if (i) {
      if (f === 6) try {
        i = O3(i);
      } catch {
        D("CipherTransformFactory: Unable to convert UTF8 encoded password.");
      }
      m = Ns(i);
    }
    if (a !== 5) b = C(this, Js, L6).call(this, p, m, c, h, u, f, r, d);
    else {
      const y = o.subarray(32, 40), v = o.subarray(40, 48), w = l.subarray(0, 48), A = l.subarray(32, 40), x = l.subarray(40, 48), k = Ns(t.get("OE")), I = Ns(t.get("UE")), T = Ns(t.get("Perms"));
      b = C(this, Js, ek).call(this, f, m, c, y, v, w, h, A, x, k, I, T);
    }
    if (!b) {
      if (!i) throw new i0("No password given", kI);
      const y = C(this, Js, sk).call(this, m, c, f, r);
      b = C(this, Js, L6).call(this, p, y, c, h, u, f, r, d);
    }
    if (!b) throw new i0("Incorrect Password", SI);
    if (a === 4 && b.length < 16 ? (this.encryptionKey = new Uint8Array(16), this.encryptionKey.set(b)) : this.encryptionKey = b, a >= 4) {
      const y = t.get("CF");
      y instanceof q && (y.suppressEncryption = !0), this.cf = y, this.stmf = t.get("StmF") || Z.get("Identity"), this.strf = t.get("StrF") || Z.get("Identity"), this.eff = t.get("EFF") || this.stmf;
    }
  }
  static get _defaultPasswordBytes() {
    return gt(this, "_defaultPasswordBytes", new Uint8Array([40, 191, 78, 94, 78, 117, 138, 65, 100, 0, 78, 86, 255, 250, 1, 8, 46, 46, 0, 182, 208, 104, 62, 128, 47, 12, 169, 254, 100, 83, 105, 122]));
  }
  createCipherTransform(t, e) {
    if (this.algorithm === 4 || this.algorithm === 5) return new yb(C(this, Js, O6).call(this, this.cf, this.strf, t, e, this.encryptionKey), C(this, Js, O6).call(this, this.cf, this.stmf, t, e, this.encryptionKey));
    const i = C(this, Js, np).call(this, t, e, this.encryptionKey, !1), n = function() {
      return new vl(i);
    };
    return new yb(n, n);
  }
};
Js = new WeakSet(), ek = function(t, e, i, n, a, r, o, l, c, h, u, f) {
  if (e) {
    const p = Math.min(127, e.length);
    e = e.subarray(0, p);
  } else e = [];
  const d = t === 6 ? new sB() : new eB();
  return d.checkUserPassword(e, l, o) ? d.getUserKey(e, c, u) : e.length && d.checkOwnerPassword(e, n, r, i) ? d.getOwnerKey(e, a, r, h) : null;
}, L6 = function(t, e, i, n, a, r, o, l) {
  const c = 40 + i.length + t.length, h = new Uint8Array(c);
  let u, f, d = 0;
  if (e)
    for (f = Math.min(32, e.length); d < f; ++d) h[d] = e[d];
  for (u = 0; d < 32; ) h[d++] = tu._defaultPasswordBytes[u++];
  h.set(i, d), d += i.length, h[d++] = 255 & a, h[d++] = a >> 8 & 255, h[d++] = a >> 16 & 255, h[d++] = a >>> 24 & 255, h.set(t, d), d += t.length, r >= 4 && !l && (h.fill(255, d, d + 4), d += 4);
  let p = oo(h, 0, d);
  const m = o >> 3;
  if (r >= 3) for (u = 0; u < 50; ++u) p = oo(p, 0, m);
  const b = p.subarray(0, m);
  let y, v;
  if (r >= 3) {
    d = 0, h.set(tu._defaultPasswordBytes, d), d += 32, h.set(t, d), d += t.length, y = new vl(b), v = y.encryptBlock(oo(h, 0, d)), f = b.length;
    const w = new Uint8Array(f);
    for (u = 1; u <= 19; ++u) {
      for (let A = 0; A < f; ++A) w[A] = b[A] ^ u;
      y = new vl(w), v = y.encryptBlock(v);
    }
  } else
    y = new vl(b), v = y.encryptBlock(tu._defaultPasswordBytes);
  return v.every((w, A) => n[A] === w) ? b : null;
}, sk = function(t, e, i, n) {
  const a = new Uint8Array(32);
  let r = 0;
  const o = Math.min(32, t.length);
  for (; r < o; ++r) a[r] = t[r];
  let l = 0;
  for (; r < 32; ) a[r++] = tu._defaultPasswordBytes[l++];
  let c = oo(a, 0, r);
  const h = n >> 3;
  if (i >= 3) for (l = 0; l < 50; ++l) c = oo(c, 0, c.length);
  let u, f;
  if (i >= 3) {
    f = e;
    const d = new Uint8Array(h);
    for (l = 19; l >= 0; l--) {
      for (let p = 0; p < h; ++p) d[p] = c[p] ^ l;
      u = new vl(d), f = u.encryptBlock(f);
    }
  } else
    u = new vl(c.subarray(0, h)), f = u.encryptBlock(e);
  return f;
}, np = function(t, e, i, n = !1) {
  const a = i.length, r = new Uint8Array(a + 9);
  r.set(i);
  let o = a;
  return r[o++] = 255 & t, r[o++] = t >> 8 & 255, r[o++] = t >> 16 & 255, r[o++] = 255 & e, r[o++] = e >> 8 & 255, n && (r[o++] = 115, r[o++] = 65, r[o++] = 108, r[o++] = 84), oo(r, 0, o).subarray(0, Math.min(a + 5, 16));
}, O6 = function(t, e, i, n, a) {
  if (!(e instanceof Z)) throw new st("Invalid crypt filter name.");
  const r = this, o = t.get(e.name), l = o == null ? void 0 : o.get("CFM");
  if (!l || l.name === "None") return function() {
    return new tB();
  };
  if (l.name === "V2") return function() {
    var c;
    return new vl(C(c = r, Js, np).call(c, i, n, a, !1));
  };
  if (l.name === "AESV2") return function() {
    var c;
    return new Qx(C(c = r, Js, np).call(c, i, n, a, !0));
  };
  if (l.name === "AESV3") return function() {
    return new N6(a);
  };
  throw new st("Unknown crypto method");
};
let B6 = tu;
var d2;
class iB {
  constructor(t, e) {
    _(this, d2, null);
    this.stream = t, this.pdfManager = e, this.entries = [], this._xrefStms = /* @__PURE__ */ new Set(), this._cacheMap = /* @__PURE__ */ new Map(), this._pendingRefs = new Qe(), this._newPersistentRefNum = null, this._newTemporaryRefNum = null, this._persistentRefsCache = null;
  }
  getNewPersistentRef(t) {
    this._newPersistentRefNum === null && (this._newPersistentRefNum = this.entries.length || 1);
    const e = this._newPersistentRefNum++;
    return this._cacheMap.set(e, t), yt.get(e, 0);
  }
  getNewTemporaryRef() {
    if (this._newTemporaryRefNum === null && (this._newTemporaryRefNum = this.entries.length || 1, this._newPersistentRefNum)) {
      this._persistentRefsCache = /* @__PURE__ */ new Map();
      for (let t = this._newTemporaryRefNum; t < this._newPersistentRefNum; t++)
        this._persistentRefsCache.set(t, this._cacheMap.get(t)), this._cacheMap.delete(t);
    }
    return yt.get(this._newTemporaryRefNum++, 0);
  }
  resetNewTemporaryRef() {
    if (this._newTemporaryRefNum = null, this._persistentRefsCache) for (const [t, e] of this._persistentRefsCache) this._cacheMap.set(t, e);
    this._persistentRefsCache = null;
  }
  setStartXRef(t) {
    this.startXRefQueue = [t];
  }
  parse(t = !1) {
    let e, i, n;
    t ? (D("Indexing all PDF objects"), e = this.indexObjects()) : e = this.readXRef(), e.assignXref(this), this.trailer = e;
    try {
      i = e.get("Encrypt");
    } catch (a) {
      if (a instanceof ke) throw a;
      D(`XRef.parse - Invalid "Encrypt" reference: "${a}".`);
    }
    if (i instanceof q) {
      const a = e.get("ID"), r = a != null && a.length ? a[0] : "";
      i.suppressEncryption = !0, this.encrypt = new B6(i, r, this.pdfManager.password);
    }
    try {
      n = e.get("Root");
    } catch (a) {
      if (a instanceof ke) throw a;
      D(`XRef.parse - Invalid "Root" reference: "${a}".`);
    }
    if (n instanceof q) try {
      if (n.get("Pages") instanceof q) {
        this.root = n;
        return;
      }
    } catch (a) {
      if (a instanceof ke) throw a;
      D(`XRef.parse - Invalid "Pages" reference: "${a}".`);
    }
    throw t ? new n0("Invalid Root reference.") : new iu();
  }
  processXRefTable(t) {
    if ("tableState" in this || (this.tableState = { entryNum: 0, streamPos: t.lexer.stream.pos, parserBuf1: t.buf1, parserBuf2: t.buf2 }), !ds(this.readXRefTable(t), "trailer")) throw new st("Invalid XRef table: could not find trailer dictionary");
    let e = t.getObj();
    if (e instanceof q || !e.dict || (e = e.dict), !(e instanceof q)) throw new st("Invalid XRef table: could not parse trailer dictionary");
    return delete this.tableState, e;
  }
  readXRefTable(t) {
    const e = t.lexer.stream, i = this.tableState;
    e.pos = i.streamPos, t.buf1 = i.parserBuf1, t.buf2 = i.parserBuf2;
    let n;
    for (; ; ) {
      if (!("firstEntryNum" in i) || !("entryCount" in i)) {
        if (ds(n = t.getObj(), "trailer")) break;
        i.firstEntryNum = n, i.entryCount = t.getObj();
      }
      let a = i.firstEntryNum;
      const r = i.entryCount;
      if (!Number.isInteger(a) || !Number.isInteger(r)) throw new st("Invalid XRef table: wrong types in subsection header");
      for (let o = i.entryNum; o < r; o++) {
        i.streamPos = e.pos, i.entryNum = o, i.parserBuf1 = t.buf1, i.parserBuf2 = t.buf2;
        const l = {};
        l.offset = t.getObj(), l.gen = t.getObj();
        const c = t.getObj();
        if (c instanceof Je) switch (c.cmd) {
          case "f":
            l.free = !0;
            break;
          case "n":
            l.uncompressed = !0;
        }
        if (!Number.isInteger(l.offset) || !Number.isInteger(l.gen) || !l.free && !l.uncompressed) throw new st(`Invalid entry in XRef subsection: ${a}, ${r}`);
        o === 0 && l.free && a === 1 && (a = 0), this.entries[o + a] || (this.entries[o + a] = l);
      }
      i.entryNum = 0, i.streamPos = e.pos, i.parserBuf1 = t.buf1, i.parserBuf2 = t.buf2, delete i.firstEntryNum, delete i.entryCount;
    }
    if (this.entries[0] && !this.entries[0].free) throw new st("Invalid XRef table: unexpected first object");
    return n;
  }
  processXRefStream(t) {
    if (!("streamState" in this)) {
      const { dict: e, pos: i } = t, n = e.get("W"), a = e.get("Index") || [0, e.get("Size")];
      this.streamState = { entryRanges: a, byteWidths: n, entryNum: 0, streamPos: i };
    }
    return this.readXRefStream(t), delete this.streamState, t.dict;
  }
  readXRefStream(t) {
    const e = this.streamState;
    t.pos = e.streamPos;
    const [i, n, a] = e.byteWidths, r = e.entryRanges;
    for (; r.length > 0; ) {
      const [o, l] = r;
      if (!Number.isInteger(o) || !Number.isInteger(l)) throw new st(`Invalid XRef range fields: ${o}, ${l}`);
      if (!Number.isInteger(i) || !Number.isInteger(n) || !Number.isInteger(a)) throw new st(`Invalid XRef entry fields length: ${o}, ${l}`);
      for (let c = e.entryNum; c < l; ++c) {
        e.entryNum = c, e.streamPos = t.pos;
        let h = 0, u = 0, f = 0;
        for (let p = 0; p < i; ++p) {
          const m = t.getByte();
          if (m === -1) throw new st("Invalid XRef byteWidths 'type'.");
          h = h << 8 | m;
        }
        i === 0 && (h = 1);
        for (let p = 0; p < n; ++p) {
          const m = t.getByte();
          if (m === -1) throw new st("Invalid XRef byteWidths 'offset'.");
          u = u << 8 | m;
        }
        for (let p = 0; p < a; ++p) {
          const m = t.getByte();
          if (m === -1) throw new st("Invalid XRef byteWidths 'generation'.");
          f = f << 8 | m;
        }
        const d = {};
        switch (d.offset = u, d.gen = f, h) {
          case 0:
            d.free = !0;
            break;
          case 1:
            d.uncompressed = !0;
            break;
          case 2:
            break;
          default:
            throw new st(`Invalid XRef entry type: ${h}`);
        }
        this.entries[o + c] || (this.entries[o + c] = d);
      }
      e.entryNum = 0, e.streamPos = t.pos, r.splice(0, 2);
    }
  }
  indexObjects() {
    function t(A, x) {
      let k = "", I = A[x];
      for (; I !== 10 && I !== 13 && I !== 60 && !(++x >= A.length); )
        k += String.fromCharCode(I), I = A[x];
      return k;
    }
    function e(A, x, k) {
      const I = k.length, T = A.length;
      let E = 0;
      for (; x < T; ) {
        let M = 0;
        for (; M < I && A[x + M] === k[M]; ) ++M;
        if (M >= I) break;
        x++, E++;
      }
      return E;
    }
    const i = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g, n = /\b(startxref|\d+\s+\d+\s+obj)\b/g, a = /^(\d+)\s+(\d+)\s+obj\b/, r = new Uint8Array([116, 114, 97, 105, 108, 101, 114]), o = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]), l = new Uint8Array([47, 88, 82, 101, 102]);
    this.entries.length = 0, this._cacheMap.clear();
    const c = this.stream;
    c.pos = 0;
    const h = c.getBytes(), u = Si(h), f = h.length;
    let d = c.start;
    const p = [], m = [];
    for (; d < f; ) {
      let A = h[d];
      if (A === 9 || A === 10 || A === 13 || A === 32) {
        ++d;
        continue;
      }
      if (A === 37) {
        do {
          if (++d, d >= f) break;
          A = h[d];
        } while (A !== 10 && A !== 13);
        continue;
      }
      const x = t(h, d);
      let k;
      if (x.startsWith("xref") && (x.length === 4 || /\s/.test(x[4])))
        d += e(h, d, r), p.push(d), d += e(h, d, o);
      else if (k = a.exec(x)) {
        const I = 0 | k[1], T = 0 | k[2], E = d + x.length;
        let M, F = !1;
        if (this.entries[I]) {
          if (this.entries[I].gen === T) try {
            new ao({ lexer: new Zn(c.makeSubStream(E)) }).getObj(), F = !0;
          } catch (et) {
            et instanceof H3 ? D(`indexObjects -- checking object (${x}): "${et}".`) : F = !0;
          }
        } else F = !0;
        F && (this.entries[I] = { offset: d - c.start, gen: T, uncompressed: !0 }), i.lastIndex = E;
        const L = i.exec(u);
        L ? (M = i.lastIndex + 1 - d, L[1] !== "endobj" && (D(`indexObjects: Found "${L[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`), M -= L[1].length + 1)) : M = f - d;
        const Y = h.subarray(d, d + M), B = e(Y, 0, l);
        B < M && Y[B + 5] < 64 && (m.push(d - c.start), this._xrefStms.add(d - c.start)), d += M;
      } else if (x.startsWith("trailer") && (x.length === 7 || /\s/.test(x[7]))) {
        p.push(d);
        const I = d + x.length;
        let T;
        n.lastIndex = I;
        const E = n.exec(u);
        E ? (T = n.lastIndex + 1 - d, E[1] !== "startxref" && (D(`indexObjects: Found "${E[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`), T -= E[1].length + 1)) : T = f - d, d += T;
      } else d += x.length + 1;
    }
    for (const A of m)
      this.startXRefQueue.push(A), this.readXRef(!0);
    const b = [];
    let y, v, w = !1;
    for (const A of p) {
      c.pos = A;
      const x = new ao({ lexer: new Zn(c), xref: this, allowStreams: !0, recoveryMode: !0 });
      if (!ds(x.getObj(), "trailer")) continue;
      const k = x.getObj();
      k instanceof q && (b.push(k), k.has("Encrypt") && (w = !0));
    }
    for (const A of [...b, "genFallback", ...b]) {
      if (A === "genFallback") {
        if (!v) break;
        this._generationFallback = !0;
        continue;
      }
      let x = !1;
      try {
        const k = A.get("Root");
        if (!(k instanceof q)) continue;
        const I = k.get("Pages");
        if (!(I instanceof q)) continue;
        const T = I.get("Count");
        Number.isInteger(T) && (x = !0);
      } catch (k) {
        v = k;
        continue;
      }
      if (x && (!w || A.has("Encrypt")) && A.has("ID")) return A;
      y = A;
    }
    if (y) return y;
    if (this.topDict) return this.topDict;
    if (!b.length) for (const [A, x] of this.entries.entries()) {
      if (!x) continue;
      const k = yt.get(A, x.gen);
      let I;
      try {
        I = this.fetch(k);
      } catch {
        continue;
      }
      if (I instanceof Ot && (I = I.dict), I instanceof q && I.has("Root")) return I;
    }
    throw new n0("Invalid PDF structure.");
  }
  readXRef(t = !1) {
    const e = this.stream, i = /* @__PURE__ */ new Set();
    for (; this.startXRefQueue.length; ) {
      try {
        const n = this.startXRefQueue[0];
        if (i.has(n)) {
          D("readXRef - skipping XRef table since it was already parsed."), this.startXRefQueue.shift();
          continue;
        }
        i.add(n), e.pos = n + e.start;
        const a = new ao({ lexer: new Zn(e), xref: this, allowStreams: !0 });
        let r, o = a.getObj();
        if (ds(o, "xref"))
          r = this.processXRefTable(a), this.topDict || (this.topDict = r), o = r.get("XRefStm"), Number.isInteger(o) && !this._xrefStms.has(o) && (this._xrefStms.add(o), this.startXRefQueue.push(o), g(this, d2) ?? S(this, d2, o));
        else {
          if (!Number.isInteger(o)) throw new st("Invalid XRef stream header");
          if (!(Number.isInteger(a.getObj()) && ds(a.getObj(), "obj") && (o = a.getObj()) instanceof Ot)) throw new st("Invalid XRef stream");
          if (r = this.processXRefStream(o), this.topDict || (this.topDict = r), !r) throw new st("Failed to read XRef stream");
        }
        o = r.get("Prev"), Number.isInteger(o) ? this.startXRefQueue.push(o) : o instanceof yt && this.startXRefQueue.push(o.num);
      } catch (n) {
        if (n instanceof ke) throw n;
        qt("(while reading XRef): " + n);
      }
      this.startXRefQueue.shift();
    }
    if (this.topDict) return this.topDict;
    if (!t) throw new iu();
  }
  get lastXRefStreamPos() {
    return g(this, d2) ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null);
  }
  getEntry(t) {
    const e = this.entries[t];
    return e && !e.free && e.offset ? e : null;
  }
  fetchIfRef(t, e = !1) {
    return t instanceof yt ? this.fetch(t, e) : t;
  }
  fetch(t, e = !1) {
    if (!(t instanceof yt)) throw new Error("ref object is not a reference");
    const i = t.num, n = this._cacheMap.get(i);
    if (n !== void 0)
      return n instanceof q && !n.objId && (n.objId = t.toString()), n;
    let a = this.getEntry(i);
    if (a === null) return a;
    if (this._pendingRefs.has(t))
      return this._pendingRefs.remove(t), D(`Ignoring circular reference: ${t}.`), _I;
    this._pendingRefs.put(t);
    try {
      a = a.uncompressed ? this.fetchUncompressed(t, a, e) : this.fetchCompressed(t, a, e), this._pendingRefs.remove(t);
    } catch (r) {
      throw this._pendingRefs.remove(t), r;
    }
    return a instanceof q ? a.objId = t.toString() : a instanceof Ot && (a.dict.objId = t.toString()), a;
  }
  fetchUncompressed(t, e, i = !1) {
    const n = t.gen;
    let a = t.num;
    if (e.gen !== n) {
      const u = `Inconsistent generation in XRef: ${t}`;
      if (this._generationFallback && e.gen < n)
        return D(u), this.fetchUncompressed(yt.get(a, e.gen), e, i);
      throw new Zo(u);
    }
    const r = this.stream.makeSubStream(e.offset + this.stream.start), o = new ao({ lexer: new Zn(r), xref: this, allowStreams: !0 }), l = o.getObj(), c = o.getObj(), h = o.getObj();
    if (l !== a || c !== n || !(h instanceof Je)) throw new Zo(`Bad (uncompressed) XRef entry: ${t}`);
    if (h.cmd !== "obj") {
      if (h.cmd.startsWith("obj") && (a = parseInt(h.cmd.substring(3), 10), !Number.isNaN(a)))
        return a;
      throw new Zo(`Bad (uncompressed) XRef entry: ${t}`);
    }
    return (e = this.encrypt && !i ? o.getObj(this.encrypt.createCipherTransform(a, n)) : o.getObj()) instanceof Ot || this._cacheMap.set(a, e), e;
  }
  fetchCompressed(t, e, i = !1) {
    const n = e.offset, a = this.fetch(yt.get(n, 0));
    if (!(a instanceof Ot)) throw new st("bad ObjStm stream");
    const r = a.dict.get("First"), o = a.dict.get("N");
    if (!Number.isInteger(r) || !Number.isInteger(o)) throw new st("invalid first and n parameters for ObjStm stream");
    let l = new ao({ lexer: new Zn(a), xref: this, allowStreams: !0 });
    const c = new Array(o), h = new Array(o);
    for (let d = 0; d < o; ++d) {
      const p = l.getObj();
      if (!Number.isInteger(p)) throw new st(`invalid object number in the ObjStm stream: ${p}`);
      const m = l.getObj();
      if (!Number.isInteger(m)) throw new st(`invalid object offset in the ObjStm stream: ${m}`);
      c[d] = p, h[d] = m;
    }
    const u = (a.start || 0) + r, f = new Array(o);
    for (let d = 0; d < o; ++d) {
      const p = d < o - 1 ? h[d + 1] - h[d] : void 0;
      if (p < 0) throw new st("Invalid offset in the ObjStm stream.");
      l = new ao({ lexer: new Zn(a.makeSubStream(u + h[d], p, a.dict)), xref: this, allowStreams: !0 });
      const m = l.getObj();
      if (f[d] = m, m instanceof Ot) continue;
      const b = c[d], y = this.entries[b];
      y && y.offset === n && y.gen === d && this._cacheMap.set(b, m);
    }
    if ((e = f[e.gen]) === void 0) throw new Zo(`Bad (compressed) XRef entry: ${t}`);
    return e;
  }
  async fetchIfRefAsync(t, e) {
    return t instanceof yt ? this.fetchAsync(t, e) : t;
  }
  async fetchAsync(t, e) {
    try {
      return this.fetch(t, e);
    } catch (i) {
      if (!(i instanceof ke)) throw i;
      return await this.pdfManager.requestRange(i.begin, i.end), this.fetchAsync(t, e);
    }
  }
  getCatalogObj() {
    return this.root;
  }
}
d2 = new WeakMap();
const nB = [0, 0, 612, 792];
var L9, Be, Hh, Nd, U6, ik, q6, j6;
class wb {
  constructor({ pdfManager: t, xref: e, pageIndex: i, pageDict: n, ref: a, globalIdFactory: r, fontCache: o, builtInCMapCache: l, standardFontDataCache: c, globalColorSpaceCache: h, globalImageCache: u, systemFontCache: f, nonBlendModesSet: d, xfaFactory: p }) {
    _(this, Be);
    _(this, L9, null);
    this.pdfManager = t, this.pageIndex = i, this.pageDict = n, this.xref = e, this.ref = a, this.fontCache = o, this.builtInCMapCache = l, this.standardFontDataCache = c, this.globalColorSpaceCache = h, this.globalImageCache = u, this.systemFontCache = f, this.nonBlendModesSet = d, this.evaluatorOptions = t.evaluatorOptions, this.xfaFactory = p;
    const m = { obj: 0 };
    this._localIdFactory = class extends r {
      static createObjId() {
        return `p${i}_${++m.obj}`;
      }
      static getPageObjId() {
        return `p${a.toString()}`;
      }
    };
  }
  get content() {
    return this.pageDict.getArray("Contents");
  }
  get resources() {
    const t = C(this, Be, Nd).call(this, "Resources");
    return gt(this, "resources", t instanceof q ? t : q.empty);
  }
  get mediaBox() {
    return gt(this, "mediaBox", C(this, Be, U6).call(this, "MediaBox") || nB);
  }
  get cropBox() {
    return gt(this, "cropBox", C(this, Be, U6).call(this, "CropBox") || this.mediaBox);
  }
  get userUnit() {
    const t = this.pageDict.get("UserUnit");
    return gt(this, "userUnit", typeof t == "number" && t > 0 ? t : 1);
  }
  get view() {
    const { cropBox: t, mediaBox: e } = this;
    if (t !== e && !r0(t, e)) {
      const i = se.intersect(t, e);
      if (i && i[2] - i[0] > 0 && i[3] - i[1] > 0) return gt(this, "view", i);
      D("Empty /CropBox and /MediaBox intersection.");
    }
    return gt(this, "view", e);
  }
  get rotate() {
    let t = C(this, Be, Nd).call(this, "Rotate") || 0;
    return t % 90 != 0 ? t = 0 : t >= 360 ? t %= 360 : t < 0 && (t = (t % 360 + 360) % 360), gt(this, "rotate", t);
  }
  async getContentStream() {
    const t = await this.pdfManager.ensure(this, "content");
    return t instanceof Ot ? t : Array.isArray(t) ? new VI(t, C(this, Be, ik).bind(this)) : new Z3();
  }
  get xfaData() {
    return gt(this, "xfaData", this.xfaFactory ? { bbox: this.xfaFactory.getBoundingBox(this.pageIndex) } : null);
  }
  async saveNewAnnotations(t, e, i, n, a) {
    if (this.xfaFactory) throw new Error("XFA: Cannot save new annotations.");
    const r = C(this, Be, Hh).call(this, t), o = new xi(), l = new Qe();
    await C(this, Be, q6).call(this, i, o, l);
    const c = this.pageDict, h = this.annotations.filter((d) => !(d instanceof yt && o.has(d))), u = await ho.saveNewAnnotations(r, e, i, n, a);
    for (const { ref: d } of u.annotations) d instanceof yt && !l.has(d) && h.push(d);
    const f = c.clone();
    f.set("Annots", h), a.put(this.ref, { data: f });
    for (const d of o) a.put(d, { data: null });
  }
  async save(t, e, i, n) {
    const a = C(this, Be, Hh).call(this, t), r = await this._parsedAnnotations, o = [];
    for (const l of r) o.push(l.save(a, e, i, n).catch(function(c) {
      return D(`save - ignoring annotation data during "${e.name}" task: "${c}".`), null;
    }));
    return Promise.all(o);
  }
  async loadResources(t) {
    await (g(this, L9) ?? S(this, L9, this.pdfManager.ensure(this, "resources"))), await P1.load(this.resources, t, this.xref);
  }
  async getOperatorList({ handler: t, sink: e, task: i, intent: n, cacheKey: a, annotationStorage: r = null, modifiedIds: o = null }) {
    const l = this.getContentStream(), c = this.loadResources(q3), h = C(this, Be, Hh).call(this, t), u = this.xfaFactory ? null : iA(r), f = u == null ? void 0 : u.get(this.pageIndex);
    let d = Promise.resolve(null), p = null;
    if (f) {
      const L = this.pdfManager.ensureDoc("annotationGlobals");
      let Y;
      const B = /* @__PURE__ */ new Set();
      for (const { bitmapId: H, bitmap: P } of f) !H || P || B.has(H) || B.add(H);
      const { isOffscreenCanvasSupported: et } = this.evaluatorOptions;
      if (B.size > 0) {
        const H = f.slice();
        for (const [P, G] of r) P.startsWith(_v) && G.bitmap && B.has(G.bitmapId) && H.push(G);
        Y = ho.generateImages(H, this.xref, et);
      } else Y = ho.generateImages(f, this.xref, et);
      p = new Qe(), d = Promise.all([L, C(this, Be, q6).call(this, f, p, null)]).then(([H]) => H ? ho.printNewAnnotations(H, h, i, f, Y) : null);
    }
    const m = Promise.all([l, c]).then(async ([L]) => {
      const Y = await C(this, Be, j6).call(this, L.dict, q3), B = new Ys(n, e);
      return t.send("StartRenderPage", { transparency: h.hasBlendModes(Y, this.nonBlendModesSet), pageIndex: this.pageIndex, cacheKey: a }), await h.getOperatorList({ stream: L, task: i, resources: Y, operatorList: B }), B;
    });
    let [b, y, v] = await Promise.all([m, this._parsedAnnotations, d]);
    if (v) {
      y = y.filter((L) => !(L.ref && p.has(L.ref)));
      for (let L = 0, Y = v.length; L < Y; L++) {
        const B = v[L];
        if (B.refToReplace) {
          const et = y.findIndex((H) => H.ref && Pp(H.ref, B.refToReplace));
          et >= 0 && (y.splice(et, 1, B), v.splice(L--, 1), Y--);
        }
      }
      y = y.concat(v);
    }
    if (y.length === 0 || n & fC)
      return b.flush(!0), { length: b.totalLength };
    const w = !!(n & Iv), A = !!(n & gC), x = !!(n & B8), k = !!(n & bp), I = !!(n & L8), T = [];
    for (const L of y) (x || k && L.mustBeViewed(r, w) && L.mustBeViewedWhenEditing(A, o) || I && L.mustBePrinted(r)) && T.push(L.getOperatorList(h, i, n, r).catch(function(Y) {
      return D(`getOperatorList - ignoring annotation data during "${i.name}" task: "${Y}".`), { opList: null, separateForm: !1, separateCanvas: !1 };
    }));
    const E = await Promise.all(T);
    let M = !1, F = !1;
    for (const { opList: L, separateForm: Y, separateCanvas: B } of E)
      b.addOpList(L), M || (M = Y), F || (F = B);
    return b.flush(!0, { form: M, canvas: F }), { length: b.totalLength };
  }
  async extractTextContent({ handler: t, task: e, includeMarkedContent: i, disableNormalization: n, sink: a }) {
    const r = this.getContentStream(), o = this.loadResources(j3), l = this.pdfManager.ensureCatalog("lang"), [c, , h] = await Promise.all([r, o, l]), u = await C(this, Be, j6).call(this, c.dict, j3);
    return C(this, Be, Hh).call(this, t).getTextContent({ stream: c, task: e, resources: u, includeMarkedContent: i, disableNormalization: n, sink: a, viewBox: this.view, lang: h });
  }
  async getStructTree() {
    const t = await this.pdfManager.ensureCatalog("structTreeRoot");
    if (!t) return null;
    await this._parsedAnnotations;
    try {
      const e = await this.pdfManager.ensure(this, "_parseStructTree", [t]);
      return await this.pdfManager.ensure(e, "serializable");
    } catch (e) {
      return D(`getStructTree: "${e}".`), null;
    }
  }
  _parseStructTree(t) {
    const e = new nx(t, this.pageDict);
    return e.parse(this.ref), e;
  }
  async getAnnotationsData(t, e, i) {
    const n = await this._parsedAnnotations;
    if (n.length === 0) return n;
    const a = [], r = [];
    let o;
    const l = !!(i & B8), c = !!(i & bp), h = !!(i & L8);
    for (const u of n) {
      const f = l || c && u.viewable;
      (f || h && u.printable) && a.push(u.data), u.hasTextContent && f && (o ?? (o = C(this, Be, Hh).call(this, t)), r.push(u.extractTextContent(o, e, [-1 / 0, -1 / 0, 1 / 0, 1 / 0]).catch(function(d) {
        D(`getAnnotationsData - ignoring textContent during "${e.name}" task: "${d}".`);
      })));
    }
    return await Promise.all(r), a;
  }
  get annotations() {
    const t = C(this, Be, Nd).call(this, "Annots");
    return gt(this, "annotations", Array.isArray(t) ? t : []);
  }
  get _parsedAnnotations() {
    return gt(this, "_parsedAnnotations", this.pdfManager.ensure(this, "annotations").then(async (t) => {
      if (t.length === 0) return t;
      const [e, i] = await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureDoc("fieldObjects")]);
      if (!e) return [];
      const n = i == null ? void 0 : i.orphanFields, a = [];
      for (const c of t) a.push(ho.create(this.xref, c, e, this._localIdFactory, !1, n, this.ref).catch(function(h) {
        return D(`_parsedAnnotations: "${h}".`), null;
      }));
      const r = [];
      let o, l;
      for (const c of await Promise.all(a)) c && (c instanceof ra ? (l || (l = [])).push(c) : c instanceof Kx ? (o || (o = [])).push(c) : r.push(c));
      return l && r.push(...l), o && r.push(...o), r;
    }));
  }
  get jsActions() {
    return gt(this, "jsActions", K9(this.xref, this.pageDict, sI));
  }
}
L9 = new WeakMap(), Be = new WeakSet(), Hh = function(t) {
  return new F1({ xref: this.xref, handler: t, pageIndex: this.pageIndex, idFactory: this._localIdFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, standardFontDataCache: this.standardFontDataCache, globalColorSpaceCache: this.globalColorSpaceCache, globalImageCache: this.globalImageCache, systemFontCache: this.systemFontCache, options: this.evaluatorOptions });
}, Nd = function(t, e = !1) {
  const i = vn({ dict: this.pageDict, key: t, getArray: e, stopWhenFound: !1 });
  return Array.isArray(i) ? i.length !== 1 && i[0] instanceof q ? q.merge({ xref: this.xref, dictArray: i }) : i[0] : i;
}, U6 = function(t) {
  if (this.xfaData) return this.xfaData.bbox;
  const e = Kr(C(this, Be, Nd).call(this, t, !0), null);
  if (e) {
    if (e[2] - e[0] > 0 && e[3] - e[1] > 0) return e;
    D(`Empty, or invalid, /${t} entry.`);
  }
  return null;
}, ik = function(t, e) {
  if (!this.evaluatorOptions.ignoreErrors) throw t;
  D(`getContentStream - ignoring sub-stream (${e}): "${t}".`);
}, q6 = async function(t, e, i) {
  const n = [];
  for (const a of t) if (a.id) {
    const r = yt.fromString(a.id);
    if (!r) {
      D(`A non-linked annotation cannot be modified: ${a.id}`);
      continue;
    }
    if (a.deleted) {
      if (e.put(r, r), a.popupRef) {
        const o = yt.fromString(a.popupRef);
        o && e.put(o, o);
      }
      continue;
    }
    i == null || i.put(r), a.ref = r, n.push(this.xref.fetchAsync(r).then((o) => {
      o instanceof q && (a.oldAnnotation = o.clone());
    }, () => {
      D(`Cannot fetch \`oldAnnotation\` for: ${r}.`);
    })), delete a.id;
  }
  await Promise.all(n);
}, j6 = async function(t, e) {
  const i = t == null ? void 0 : t.get("Resources");
  return i instanceof q && i.size ? (await P1.load(i, e, this.xref), q.merge({ xref: this.xref, dictArray: [i, this.resources], mergeSubDicts: !0 })) : this.resources;
};
const vb = new Uint8Array([37, 80, 68, 70, 45]), Ab = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]), aB = new Uint8Array([101, 110, 100, 111, 98, 106]);
function Wm(s, t, e = 1024, i = !1) {
  const n = t.length, a = s.peekBytes(e), r = a.length - n;
  if (r <= 0) return !1;
  if (i) {
    const o = n - 1;
    let l = a.length - 1;
    for (; l >= o; ) {
      let c = 0;
      for (; c < n && a[l - c] === t[o - c]; ) c++;
      if (c >= n)
        return s.pos += l - o, !0;
      l--;
    }
  } else {
    let o = 0;
    for (; o <= r; ) {
      let l = 0;
      for (; l < n && a[o + l] === t[l]; ) l++;
      if (l >= n)
        return s.pos += o, !0;
      o++;
    }
  }
  return !1;
}
var Jo, f2, Ti, H6, ak, rk, ok, $6;
class nk {
  constructor(t, e) {
    _(this, Ti);
    _(this, Jo, /* @__PURE__ */ new Map());
    _(this, f2, null);
    if (e.length <= 0) throw new n0("The PDF file is empty, i.e. its size is zero bytes.");
    this.pdfManager = t, this.stream = e, this.xref = new iB(e, t);
    const i = { font: 0 };
    this._globalIdFactory = class {
      static getDocId() {
        return `g_${t.docId}`;
      }
      static createFontId() {
        return "f" + ++i.font;
      }
      static createObjId() {
        Wt("Abstract method `createObjId` called.");
      }
      static getPageObjId() {
        Wt("Abstract method `getPageObjId` called.");
      }
    };
  }
  parse(t) {
    this.xref.parse(t), this.catalog = new m0(this.pdfManager, this.xref);
  }
  get linearization() {
    let t = null;
    try {
      t = I_.create(this.stream);
    } catch (e) {
      if (e instanceof ke) throw e;
      qt(e);
    }
    return gt(this, "linearization", t);
  }
  get startXRef() {
    const t = this.stream;
    let e = 0;
    if (this.linearization) {
      if (t.reset(), Wm(t, aB)) {
        t.skip(6);
        let i = t.peekByte();
        for (; Qi(i); )
          t.pos++, i = t.peekByte();
        e = t.pos - t.start;
      }
    } else {
      const n = Ab.length;
      let a = !1, r = t.end;
      for (; !a && r > 0; )
        r -= 1024 - n, r < 0 && (r = 0), t.pos = r, a = Wm(t, Ab, 1024, !0);
      if (a) {
        t.skip(9);
        let o;
        do
          o = t.getByte();
        while (Qi(o));
        let l = "";
        for (; o >= 32 && o <= 57; )
          l += String.fromCharCode(o), o = t.getByte();
        e = parseInt(l, 10), isNaN(e) && (e = 0);
      }
    }
    return gt(this, "startXRef", e);
  }
  checkHeader() {
    const t = this.stream;
    if (t.reset(), !Wm(t, vb)) return;
    t.moveStart(), t.skip(vb.length);
    let e, i = "";
    for (; (e = t.getByte()) > 32 && i.length < 7; ) i += String.fromCharCode(e);
    Qv.test(i) ? S(this, f2, i) : D(`Invalid PDF header version: ${i}`);
  }
  parseStartXRef() {
    this.xref.setStartXRef(this.startXRef);
  }
  get numPages() {
    let t = 0;
    return t = this.catalog.hasActualNumPages ? this.catalog.numPages : this.xfaFactory ? this.xfaFactory.getNumPages() : this.linearization ? this.linearization.numPages : this.catalog.numPages, gt(this, "numPages", t);
  }
  get _xfaStreams() {
    const { acroForm: t } = this.catalog;
    if (!t) return null;
    const e = t.get("XFA"), i = new Map(["xdp:xdp", "template", "datasets", "config", "connectionSet", "localeSet", "stylesheet", "/xdp:xdp"].map((n) => [n, null]));
    if (e instanceof Ot && !e.isEmpty)
      return i.set("xdp:xdp", e), i;
    if (!Array.isArray(e) || e.length === 0) return null;
    for (let n = 0, a = e.length; n < a; n += 2) {
      let r;
      if (r = n === 0 ? "xdp:xdp" : n === a - 2 ? "/xdp:xdp" : e[n], !i.has(r)) continue;
      const o = this.xref.fetchIfRef(e[n + 1]);
      o instanceof Ot && !o.isEmpty && i.set(r, o);
    }
    return i;
  }
  get xfaDatasets() {
    const t = this._xfaStreams;
    if (!t) return gt(this, "xfaDatasets", null);
    for (const e of ["datasets", "xdp:xdp"]) {
      const i = t.get(e);
      if (i) try {
        const n = a0(i.getString());
        return gt(this, "xfaDatasets", new UN({ [e]: n }));
      } catch {
        D("XFA - Invalid utf-8 string.");
        break;
      }
    }
    return gt(this, "xfaDatasets", null);
  }
  get xfaData() {
    const t = this._xfaStreams;
    if (!t) return null;
    const e = /* @__PURE__ */ Object.create(null);
    for (const [i, n] of t) if (n) try {
      e[i] = a0(n.getString());
    } catch {
      return D("XFA - Invalid utf-8 string."), null;
    }
    return e;
  }
  get xfaFactory() {
    let t;
    return this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm && (t = this.xfaData), gt(this, "xfaFactory", t ? new M2(t) : null);
  }
  get isPureXfa() {
    return !!this.xfaFactory && this.xfaFactory.isValid();
  }
  get htmlForXfa() {
    return this.xfaFactory ? this.xfaFactory.getPages() : null;
  }
  loadXfaResources(t, e) {
    return Promise.all([C(this, Ti, rk).call(this, t, e).catch(() => {
    }), C(this, Ti, ak).call(this)]);
  }
  serializeXfaData(t) {
    return this.xfaFactory ? this.xfaFactory.serializeData(t) : null;
  }
  get version() {
    return this.catalog.version || g(this, f2);
  }
  get formInfo() {
    const t = { hasFields: !1, hasAcroForm: !1, hasXfa: !1, hasSignatures: !1 }, { acroForm: e } = this.catalog;
    if (!e) return gt(this, "formInfo", t);
    try {
      const i = e.get("Fields"), n = Array.isArray(i) && i.length > 0;
      t.hasFields = n;
      const a = e.get("XFA");
      t.hasXfa = Array.isArray(a) && a.length > 0 || a instanceof Ot && !a.isEmpty;
      const r = !!(1 & e.get("SigFlags")), o = r && C(this, Ti, H6).call(this, i);
      t.hasAcroForm = n && !o, t.hasSignatures = r;
    } catch (i) {
      if (i instanceof ke) throw i;
      D(`Cannot fetch form information: "${i}".`);
    }
    return gt(this, "formInfo", t);
  }
  get documentInfo() {
    var r;
    const { catalog: t, formInfo: e, xref: i } = this, n = { PDFFormatVersion: this.version, Language: t.lang, EncryptFilterName: ((r = i.encrypt) == null ? void 0 : r.filterName) ?? null, IsLinearized: !!this.linearization, IsAcroFormPresent: e.hasAcroForm, IsXFAPresent: e.hasXfa, IsCollectionPresent: !!t.collection, IsSignaturesPresent: e.hasSignatures };
    let a;
    try {
      a = i.trailer.get("Info");
    } catch (o) {
      if (o instanceof ke) throw o;
      qt("The document information dictionary is invalid.");
    }
    if (!(a instanceof q)) return gt(this, "documentInfo", n);
    for (const [o, l] of a) {
      switch (o) {
        case "Title":
        case "Author":
        case "Subject":
        case "Keywords":
        case "Creator":
        case "Producer":
        case "CreationDate":
        case "ModDate":
          if (typeof l == "string") {
            n[o] = Jt(l);
            continue;
          }
          break;
        case "Trapped":
          if (l instanceof Z) {
            n[o] = l;
            continue;
          }
          break;
        default:
          let c;
          switch (typeof l) {
            case "string":
              c = Jt(l);
              break;
            case "number":
            case "boolean":
              c = l;
              break;
            default:
              l instanceof Z && (c = l);
          }
          if (c === void 0) {
            D(`Bad value, for custom key "${o}", in Info: ${l}.`);
            continue;
          }
          n.Custom ?? (n.Custom = /* @__PURE__ */ Object.create(null)), n.Custom[o] = c;
          continue;
      }
      D(`Bad value, for key "${o}", in Info: ${l}.`);
    }
    return gt(this, "documentInfo", n);
  }
  get fingerprints() {
    const t = "\0".repeat(16);
    function e(r) {
      return typeof r == "string" && r.length === 16 && r !== t;
    }
    const i = this.xref.trailer.get("ID");
    let n, a;
    return Array.isArray(i) && e(i[0]) ? (n = Ns(i[0]), i[1] !== i[0] && e(i[1]) && (a = Ns(i[1]))) : n = oo(this.stream.getByteRange(0, 1024), 0, 1024), gt(this, "fingerprints", [X8(n), a ? X8(a) : null]);
  }
  getPage(t) {
    const e = g(this, Jo).get(t);
    if (e) return e;
    const { catalog: i, linearization: n, xfaFactory: a } = this;
    let r;
    return r = a ? Promise.resolve([q.empty, null]) : (n == null ? void 0 : n.pageFirst) === t ? C(this, Ti, ok).call(this, t) : i.getPageDict(t), r = r.then(([o, l]) => new wb({ pdfManager: this.pdfManager, xref: this.xref, pageIndex: t, pageDict: o, ref: l, globalIdFactory: this._globalIdFactory, fontCache: i.fontCache, builtInCMapCache: i.builtInCMapCache, standardFontDataCache: i.standardFontDataCache, globalColorSpaceCache: i.globalColorSpaceCache, globalImageCache: i.globalImageCache, systemFontCache: i.systemFontCache, nonBlendModesSet: i.nonBlendModesSet, xfaFactory: a })), g(this, Jo).set(t, r), r;
  }
  async checkFirstPage(t = !1) {
    if (!t) try {
      await this.getPage(0);
    } catch (e) {
      if (e instanceof Zo)
        throw g(this, Jo).delete(0), await this.cleanup(), new iu();
    }
  }
  async checkLastPage(t = !1) {
    const { catalog: e, pdfManager: i } = this;
    e.setActualNumPages();
    let n;
    try {
      if (await Promise.all([i.ensureDoc("xfaFactory"), i.ensureDoc("linearization"), i.ensureCatalog("numPages")]), this.xfaFactory) return;
      if (n = this.linearization ? this.linearization.numPages : e.numPages, !Number.isInteger(n)) throw new st("Page count is not an integer.");
      if (n <= 1) return;
      await this.getPage(n - 1);
    } catch (a) {
      if (g(this, Jo).delete(n - 1), await this.cleanup(), a instanceof Zo && !t) throw new iu();
      D(`checkLastPage - invalid /Pages tree /Count: ${n}.`);
      let r;
      try {
        r = await e.getAllPageDicts(t);
      } catch (o) {
        if (o instanceof Zo && !t) throw new iu();
        e.setActualNumPages(1);
        return;
      }
      for (const [o, [l, c]] of r) {
        let h;
        l instanceof Error ? (h = Promise.reject(l), h.catch(() => {
        })) : h = Promise.resolve(new wb({ pdfManager: i, xref: this.xref, pageIndex: o, pageDict: l, ref: c, globalIdFactory: this._globalIdFactory, fontCache: e.fontCache, builtInCMapCache: e.builtInCMapCache, standardFontDataCache: e.standardFontDataCache, globalColorSpaceCache: this.globalColorSpaceCache, globalImageCache: e.globalImageCache, systemFontCache: e.systemFontCache, nonBlendModesSet: e.nonBlendModesSet, xfaFactory: null })), g(this, Jo).set(o, h);
      }
      e.setActualNumPages(r.size);
    }
  }
  async fontFallback(t, e) {
    const { catalog: i, pdfManager: n } = this;
    for (const a of await Promise.all(i.fontCache)) if (a.loadedName === t) {
      a.fallback(e, n.evaluatorOptions);
      return;
    }
  }
  async cleanup(t = !1) {
    return this.catalog ? this.catalog.cleanup(t) : E7();
  }
  get fieldObjects() {
    return gt(this, "fieldObjects", this.pdfManager.ensureDoc("formInfo").then(async (t) => {
      if (!t.hasFields) return null;
      const e = await this.annotationGlobals;
      if (!e) return null;
      const { acroForm: i } = e, n = new Qe(), a = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ new Map(), o = new xi();
      for (const c of i.get("Fields")) await C(this, Ti, $6).call(this, "", null, c, r, e, n, o);
      const l = [];
      for (const [c, h] of r) l.push(Promise.all(h).then((u) => {
        (u = u.filter((f) => !!f)).length > 0 && (a[c] = u);
      }));
      return await Promise.all(l), { allFields: g7(a) > 0 ? a : null, orphanFields: o };
    }));
  }
  get hasJSActions() {
    return gt(this, "hasJSActions", this.pdfManager.ensureDoc("_parseHasJSActions"));
  }
  async _parseHasJSActions() {
    const [t, e] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]);
    return !!t || !!(e != null && e.allFields) && Object.values(e.allFields).some((i) => i.some((n) => n.actions !== null));
  }
  get calculationOrderIds() {
    var i;
    const t = (i = this.catalog.acroForm) == null ? void 0 : i.get("CO");
    if (!Array.isArray(t) || t.length === 0) return gt(this, "calculationOrderIds", null);
    const e = [];
    for (const n of t) n instanceof yt && e.push(n.toString());
    return gt(this, "calculationOrderIds", e.length ? e : null);
  }
  get annotationGlobals() {
    return gt(this, "annotationGlobals", ho.createGlobals(this.pdfManager));
  }
}
Jo = new WeakMap(), f2 = new WeakMap(), Ti = new WeakSet(), H6 = function(t, e = 0) {
  return !!Array.isArray(t) && t.every((i) => {
    if (!((i = this.xref.fetchIfRef(i)) instanceof q)) return !1;
    if (i.has("Kids"))
      return ++e > 10 ? (D("#hasOnlyDocumentSignatures: maximum recursion depth reached"), !1) : C(this, Ti, H6).call(this, i.get("Kids"), e);
    const n = He(i.get("FT"), "Sig"), a = i.get("Rect"), r = Array.isArray(a) && a.every((o) => o === 0);
    return n && r;
  });
}, ak = async function() {
  const t = await this.pdfManager.ensureCatalog("xfaImages");
  t && this.xfaFactory.setImages(t);
}, rk = async function(t, e) {
  const i = await this.pdfManager.ensureCatalog("acroForm");
  if (!i) return;
  const n = await i.getAsync("DR");
  if (!(n instanceof q)) return;
  await P1.load(n, ["Font"], this.xref);
  const a = n.get("Font");
  if (!(a instanceof q)) return;
  const r = Object.assign(/* @__PURE__ */ Object.create(null), this.pdfManager.evaluatorOptions, { useSystemFonts: !1 }), { builtInCMapCache: o, fontCache: l, standardFontDataCache: c } = this.catalog, h = new F1({ xref: this.xref, handler: t, pageIndex: -1, idFactory: this._globalIdFactory, fontCache: l, builtInCMapCache: o, standardFontDataCache: c, options: r }), u = new Ys(), f = [], d = { get font() {
    return f.at(-1);
  }, set font(v) {
    f.push(v);
  }, clone() {
    return this;
  } }, p = (v, w, A) => h.handleSetFont(n, [Z.get(v), 1], null, u, e, d, w, A).catch((x) => (D(`loadXfaFonts: "${x}".`), null)), m = [];
  for (const [v, w] of a) {
    const A = w.get("FontDescriptor");
    if (!(A instanceof q)) continue;
    let x = A.get("FontFamily");
    x = x.replaceAll(/[ ]+(\d)/g, "$1");
    const k = { fontFamily: x, fontWeight: A.get("FontWeight"), italicAngle: -A.get("ItalicAngle") };
    FI(k) && m.push(p(v, null, k));
  }
  await Promise.all(m);
  const b = this.xfaFactory.setFonts(f);
  if (!b) return;
  r.ignoreErrors = !0, m.length = 0, f.length = 0;
  const y = /* @__PURE__ */ new Set();
  for (const v of b) I7(`${v}-Regular`) || y.add(v);
  y.size && b.push("PdfJS-Fallback");
  for (const v of b) if (!y.has(v)) for (const w of [{ name: "Regular", fontWeight: 400, italicAngle: 0 }, { name: "Bold", fontWeight: 700, italicAngle: 0 }, { name: "Italic", fontWeight: 400, italicAngle: 12 }, { name: "BoldItalic", fontWeight: 700, italicAngle: 12 }]) {
    const A = `${v}-${w.name}`;
    m.push(p(A, jA(A), { fontFamily: v, fontWeight: w.fontWeight, italicAngle: w.italicAngle }));
  }
  await Promise.all(m), this.xfaFactory.appendFonts(f, y);
}, ok = async function(t) {
  const { catalog: e, linearization: i, xref: n } = this, a = yt.get(i.objectNumberFirst, 0);
  try {
    const r = await n.fetchAsync(a);
    if (r instanceof q) {
      let o = r.getRaw("Type");
      if (o instanceof yt && (o = await n.fetchAsync(o)), He(o, "Page") || !r.has("Type") && !r.has("Kids") && r.has("Contents"))
        return e.pageKidsCountCache.has(a) || e.pageKidsCountCache.put(a, 1), e.pageIndexCache.has(a) || e.pageIndexCache.put(a, 0), [r, a];
    }
    throw new st("The Linearization dictionary doesn't point to a valid Page dictionary.");
  } catch (r) {
    return D(`_getLinearizationPage: "${r.message}".`), e.getPageDict(t);
  }
}, $6 = async function(t, e, i, n, a, r, o) {
  const { xref: l } = this;
  if (!(i instanceof yt) || r.has(i)) return;
  r.put(i);
  const c = await l.fetchAsync(i);
  if (!(c instanceof q)) return;
  let h = await c.getAsync("Subtype");
  if (h = h instanceof Z ? h.name : null, h === "Link") return;
  if (c.has("T")) {
    const f = Jt(await c.getAsync("T"));
    t = t === "" ? f : `${t}.${f}`;
  } else {
    let f = c;
    for (; ; ) {
      if (f = f.getRaw("Parent") || e, f instanceof yt) {
        if (r.has(f)) break;
        f = await l.fetchAsync(f);
      }
      if (!(f instanceof q)) break;
      if (f.has("T")) {
        const d = Jt(await f.getAsync("T"));
        t = t === "" ? d : `${t}.${d}`;
        break;
      }
    }
  }
  if (e && !c.has("Parent") && He(c.get("Subtype"), "Widget") && o.put(i, e), n.has(t) || n.set(t, []), n.get(t).push(ho.create(l, i, a, null, !0, o, null).then((f) => f == null ? void 0 : f.getFieldObject()).catch(function(f) {
    return D(`#collectFieldObjects: "${f}".`), null;
  })), !c.has("Kids")) return;
  const u = await c.getAsync("Kids");
  if (Array.isArray(u)) for (const f of u) await C(this, Ti, $6).call(this, t, i, f, n, a, r, o);
};
class lk {
  constructor({ docBaseUrl: t, docId: e, enableXfa: i, evaluatorOptions: n, handler: a, password: r }) {
    this._docBaseUrl = function(c) {
      if (c) {
        const h = Rp(c);
        if (h) return h.href;
        D(`Invalid absolute docBaseUrl: "${c}".`);
      }
      return null;
    }(t), this._docId = e, this._password = r, this.enableXfa = i, n.isOffscreenCanvasSupported && (n.isOffscreenCanvasSupported = Ii.isOffscreenCanvasSupported), n.isImageDecoderSupported && (n.isImageDecoderSupported = Ii.isImageDecoderSupported), this.evaluatorOptions = Object.freeze(n), Bn.setOptions(n), E1.setOptions(n), Ys.setOptions(n);
    const o = { ...n, handler: a };
    Yn.setOptions(o), ch.setOptions(o), o0.setOptions(o);
  }
  get docId() {
    return this._docId;
  }
  get password() {
    return this._password;
  }
  get docBaseUrl() {
    return this._docBaseUrl;
  }
  ensureDoc(t, e) {
    return this.ensure(this.pdfDocument, t, e);
  }
  ensureXRef(t, e) {
    return this.ensure(this.pdfDocument.xref, t, e);
  }
  ensureCatalog(t, e) {
    return this.ensure(this.pdfDocument.catalog, t, e);
  }
  getPage(t) {
    return this.pdfDocument.getPage(t);
  }
  fontFallback(t, e) {
    return this.pdfDocument.fontFallback(t, e);
  }
  cleanup(t = !1) {
    return this.pdfDocument.cleanup(t);
  }
  async ensure(t, e, i) {
    Wt("Abstract method `ensure` called");
  }
  requestRange(t, e) {
    Wt("Abstract method `requestRange` called");
  }
  requestLoadedStream(t = !1) {
    Wt("Abstract method `requestLoadedStream` called");
  }
  sendProgressiveData(t) {
    Wt("Abstract method `sendProgressiveData` called");
  }
  updatePassword(t) {
    this._password = t;
  }
  terminate(t) {
    Wt("Abstract method `terminate` called");
  }
}
class xb extends lk {
  constructor(t) {
    super(t);
    const e = new Le(t.source);
    this.pdfDocument = new nk(this, e), this._loadedStreamPromise = Promise.resolve(e);
  }
  async ensure(t, e, i) {
    const n = t[e];
    return typeof n == "function" ? n.apply(t, i) : n;
  }
  requestRange(t, e) {
    return Promise.resolve();
  }
  requestLoadedStream(t = !1) {
    return this._loadedStreamPromise;
  }
  terminate(t) {
  }
}
class rB extends lk {
  constructor(t) {
    super(t), this.streamManager = new zI(t.source, { msgHandler: t.handler, length: t.length, disableAutoFetch: t.disableAutoFetch, rangeChunkSize: t.rangeChunkSize }), this.pdfDocument = new nk(this, this.streamManager.getStream());
  }
  async ensure(t, e, i) {
    try {
      const n = t[e];
      return typeof n == "function" ? n.apply(t, i) : n;
    } catch (n) {
      if (!(n instanceof ke)) throw n;
      return await this.requestRange(n.begin, n.end), this.ensure(t, e, i);
    }
  }
  requestRange(t, e) {
    return this.streamManager.requestRange(t, e);
  }
  requestLoadedStream(t = !1) {
    return this.streamManager.requestAllChunks(t);
  }
  sendProgressiveData(t) {
    this.streamManager.onReceiveData({ chunk: t });
  }
  terminate(t) {
    this.streamManager.abort(t);
  }
}
const kb = 1, Sb = 2, Cb = 1, Xm = 2, Ib = 3, _b = 4, Tb = 5, Eb = 6, og = 7, Km = 8;
function Mb() {
}
function Ri(s) {
  if (s instanceof Es || s instanceof n0 || s instanceof i0 || s instanceof V8 || s instanceof wm) return s;
  switch (s instanceof Error || typeof s == "object" && s !== null || Wt('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), s.name) {
    case "AbortException":
      return new Es(s.message);
    case "InvalidPDFException":
      return new n0(s.message);
    case "PasswordException":
      return new i0(s.message, s.code);
    case "ResponseException":
      return new V8(s.message, s.status, s.missing);
    case "UnknownErrorException":
      return new wm(s.message, s.details);
  }
  return new wm(s.message, s.toString());
}
var k1, Tn, ck, hk, uk, ap;
class Fb {
  constructor(t, e, i) {
    _(this, Tn);
    _(this, k1, new AbortController());
    this.sourceName = t, this.targetName = e, this.comObj = i, 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), i.addEventListener("message", C(this, Tn, ck).bind(this), { signal: g(this, k1).signal });
  }
  on(t, e) {
    const i = this.actionHandler;
    if (i[t]) throw new Error(`There is already an actionName called "${t}"`);
    i[t] = e;
  }
  send(t, e, i) {
    this.comObj.postMessage({ sourceName: this.sourceName, targetName: this.targetName, action: t, data: e }, i);
  }
  sendWithPromise(t, e, i) {
    const n = this.callbackId++, a = Promise.withResolvers();
    this.callbackCapabilities[n] = a;
    try {
      this.comObj.postMessage({ sourceName: this.sourceName, targetName: this.targetName, action: t, callbackId: n, data: e }, i);
    } catch (r) {
      a.reject(r);
    }
    return a.promise;
  }
  sendWithStream(t, e, i, n) {
    const a = this.streamId++, r = this.sourceName, o = this.targetName, l = this.comObj;
    return new ReadableStream({ start: (c) => {
      const h = Promise.withResolvers();
      return this.streamControllers[a] = { controller: c, startCall: h, pullCall: null, cancelCall: null, isClosed: !1 }, l.postMessage({ sourceName: r, targetName: o, action: t, streamId: a, data: e, desiredSize: c.desiredSize }, n), h.promise;
    }, pull: (c) => {
      const h = Promise.withResolvers();
      return this.streamControllers[a].pullCall = h, l.postMessage({ sourceName: r, targetName: o, stream: Eb, streamId: a, desiredSize: c.desiredSize }), h.promise;
    }, cancel: (c) => {
      As(c instanceof Error, "cancel must have a valid reason");
      const h = Promise.withResolvers();
      return this.streamControllers[a].cancelCall = h, this.streamControllers[a].isClosed = !0, l.postMessage({ sourceName: r, targetName: o, stream: Cb, streamId: a, reason: Ri(c) }), h.promise;
    } }, i);
  }
  destroy() {
    var t;
    (t = g(this, k1)) == null || t.abort(), S(this, k1, null);
  }
}
k1 = new WeakMap(), Tn = new WeakSet(), ck = function({ data: t }) {
  if (t.targetName !== this.sourceName) return;
  if (t.stream) {
    C(this, Tn, uk).call(this, t);
    return;
  }
  if (t.callback) {
    const i = t.callbackId, n = this.callbackCapabilities[i];
    if (!n) throw new Error(`Cannot resolve callback ${i}`);
    if (delete this.callbackCapabilities[i], t.callback === kb) n.resolve(t.data);
    else {
      if (t.callback !== Sb) throw new Error("Unexpected callback case");
      n.reject(Ri(t.reason));
    }
    return;
  }
  const e = this.actionHandler[t.action];
  if (!e) throw new Error(`Unknown action from worker: ${t.action}`);
  if (t.callbackId) {
    const i = this.sourceName, n = t.sourceName, a = this.comObj;
    Promise.try(e, t.data).then(function(r) {
      a.postMessage({ sourceName: i, targetName: n, callback: kb, callbackId: t.callbackId, data: r });
    }, function(r) {
      a.postMessage({ sourceName: i, targetName: n, callback: Sb, callbackId: t.callbackId, reason: Ri(r) });
    });
  } else t.streamId ? C(this, Tn, hk).call(this, t) : e(t.data);
}, hk = function(t) {
  const e = t.streamId, i = this.sourceName, n = t.sourceName, a = this.comObj, r = this, o = this.actionHandler[t.action], l = { enqueue(c, h = 1, u) {
    if (this.isCancelled) return;
    const f = this.desiredSize;
    this.desiredSize -= h, f > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), a.postMessage({ sourceName: i, targetName: n, stream: _b, streamId: e, chunk: c }, u);
  }, close() {
    this.isCancelled || (this.isCancelled = !0, a.postMessage({ sourceName: i, targetName: n, stream: Ib, streamId: e }), delete r.streamSinks[e]);
  }, error(c) {
    As(c instanceof Error, "error must have a valid reason"), this.isCancelled || (this.isCancelled = !0, a.postMessage({ sourceName: i, targetName: n, stream: Tb, streamId: e, reason: Ri(c) }));
  }, sinkCapability: Promise.withResolvers(), onPull: null, onCancel: null, isCancelled: !1, desiredSize: t.desiredSize, ready: null };
  l.sinkCapability.resolve(), l.ready = l.sinkCapability.promise, this.streamSinks[e] = l, Promise.try(o, t.data, l).then(function() {
    a.postMessage({ sourceName: i, targetName: n, stream: Km, streamId: e, success: !0 });
  }, function(c) {
    a.postMessage({ sourceName: i, targetName: n, stream: Km, streamId: e, reason: Ri(c) });
  });
}, uk = function(t) {
  const e = t.streamId, i = this.sourceName, n = t.sourceName, a = this.comObj, r = this.streamControllers[e], o = this.streamSinks[e];
  switch (t.stream) {
    case Km:
      t.success ? r.startCall.resolve() : r.startCall.reject(Ri(t.reason));
      break;
    case og:
      t.success ? r.pullCall.resolve() : r.pullCall.reject(Ri(t.reason));
      break;
    case Eb:
      if (!o) {
        a.postMessage({ sourceName: i, targetName: n, stream: og, streamId: e, success: !0 });
        break;
      }
      o.desiredSize <= 0 && t.desiredSize > 0 && o.sinkCapability.resolve(), o.desiredSize = t.desiredSize, Promise.try(o.onPull || Mb).then(function() {
        a.postMessage({ sourceName: i, targetName: n, stream: og, streamId: e, success: !0 });
      }, function(c) {
        a.postMessage({ sourceName: i, targetName: n, stream: og, streamId: e, reason: Ri(c) });
      });
      break;
    case _b:
      if (As(r, "enqueue should have stream controller"), r.isClosed) break;
      r.controller.enqueue(t.chunk);
      break;
    case Ib:
      if (As(r, "close should have stream controller"), r.isClosed) break;
      r.isClosed = !0, r.controller.close(), C(this, Tn, ap).call(this, r, e);
      break;
    case Tb:
      As(r, "error should have stream controller"), r.controller.error(Ri(t.reason)), C(this, Tn, ap).call(this, r, e);
      break;
    case Xm:
      t.success ? r.cancelCall.resolve() : r.cancelCall.reject(Ri(t.reason)), C(this, Tn, ap).call(this, r, e);
      break;
    case Cb:
      if (!o) break;
      const l = Ri(t.reason);
      Promise.try(o.onCancel || Mb, l).then(function() {
        a.postMessage({ sourceName: i, targetName: n, stream: Xm, streamId: e, success: !0 });
      }, function(c) {
        a.postMessage({ sourceName: i, targetName: n, stream: Xm, streamId: e, reason: Ri(c) });
      }), o.sinkCapability.reject(l), o.isCancelled = !0, delete this.streamSinks[e];
      break;
    default:
      throw new Error("Unexpected stream case");
  }
}, ap = async function(t, e) {
  var i, n, a;
  await Promise.allSettled([(i = t.startCall) == null ? void 0 : i.promise, (n = t.pullCall) == null ? void 0 : n.promise, (a = t.cancelCall) == null ? void 0 : a.promise]), delete this.streamControllers[e];
};
async function Rb(s, t, e, { encrypt: i = null }) {
  const n = i == null ? void 0 : i.createCipherTransform(s.num, s.gen);
  e.push(`${s.num} ${s.gen} obj
`), t instanceof q ? await cm(t, e, n) : t instanceof Ot ? await dk(t, e, n) : (Array.isArray(t) || ArrayBuffer.isView(t)) && await fk(t, e, n), e.push(`
endobj
`);
}
async function cm(s, t, e) {
  t.push("<<");
  for (const i of s.getKeys())
    t.push(` /${p7(i)} `), await gk(s.getRaw(i), t, e);
  t.push(">>");
}
async function dk(s, t, e) {
  let i = s.getBytes();
  const { dict: n } = s, [a, r] = await Promise.all([n.getAsync("Filter"), n.getAsync("DecodeParms")]), o = He(Array.isArray(a) ? await n.xref.fetchIfRefAsync(a[0]) : a, "FlateDecode");
  if (i.length >= 256 || o) try {
    const c = new CompressionStream("deflate"), h = c.writable.getWriter();
    await h.ready, h.write(i).then(async () => {
      await h.ready, await h.close();
    }).catch(() => {
    });
    const u = await new Response(c.readable).arrayBuffer();
    i = new Uint8Array(u);
    let f, d;
    a ? o || (f = Array.isArray(a) ? [Z.get("FlateDecode"), ...a] : [Z.get("FlateDecode"), a], r && (d = Array.isArray(r) ? [null, ...r] : [null, r])) : f = Z.get("FlateDecode"), f && n.set("Filter", f), d && n.set("DecodeParms", d);
  } catch (c) {
    qt(`writeStream - cannot compress data: "${c}".`);
  }
  let l = Si(i);
  e && (l = e.encryptString(l)), n.set("Length", l.length), await cm(n, t, e), t.push(` stream
`, l, `
endstream`);
}
async function fk(s, t, e) {
  t.push("[");
  let i = !0;
  for (const n of s)
    i ? i = !1 : t.push(" "), await gk(n, t, e);
  t.push("]");
}
async function gk(s, t, e) {
  s instanceof Z ? t.push(`/${p7(s.name)}`) : s instanceof yt ? t.push(`${s.num} ${s.gen} R`) : Array.isArray(s) || ArrayBuffer.isView(s) ? await fk(s, t, e) : typeof s == "string" ? (e && (s = e.encryptString(s)), t.push(`(${T1(s)})`)) : typeof s == "number" ? t.push(Vt(s)) : typeof s == "boolean" ? t.push(s.toString()) : s instanceof q ? await cm(s, t, e) : s instanceof Ot ? await dk(s, t, e) : s === null ? t.push("null") : D(`Unhandled value in writer: ${typeof s}, please file a bug.`);
}
function Ym(s, t, e, i) {
  for (let n = t + e - 1; n > e - 1; n--)
    i[n] = 255 & s, s >>= 8;
  return e + t;
}
function pk(s, t, e) {
  const i = s.length;
  for (let n = 0; n < i; n++) e[t + n] = 255 & s.charCodeAt(n);
  return t + i;
}
function oB({ xfaData: s, xfaDatasetsRef: t, changes: e, xref: i }) {
  s === null && (s = function(r, o) {
    const l = new Z9({ hasAttributes: !0 }).parseFromString(r);
    for (const { xfa: h } of o) {
      if (!h) continue;
      const { path: u, value: f } = h;
      if (!u) continue;
      const d = eA(u);
      let p = l.documentElement.searchNode(d, 0);
      !p && d.length > 1 && (p = l.documentElement.searchNode([d.at(-1)], 0)), p ? p.childNodes = Array.isArray(f) ? f.map((m) => new zd("value", m)) : [new zd("#text", f)] : D(`Node not found for path: ${u}`);
    }
    const c = [];
    return l.documentElement.dump(c), c.join("");
  }(i.fetchIfRef(t).getString(), e));
  const n = new di(s);
  n.dict = new q(i), n.dict.set("Type", Z.get("EmbeddedFile")), e.put(t, { data: n });
}
function Pb(s) {
  const t = [];
  for (const { ref: e } of s) e.num === t.at(-2) + t.at(-1) ? t[t.length - 1] += 1 : t.push(e.num, 1);
  return t;
}
function Db(s, t, e) {
  if (Array.isArray(t.fileIds) && t.fileIds.length > 0) {
    const i = function(a, r) {
      const o = Math.floor(Date.now() / 1e3), l = r.filename || "", c = [o.toString(), l, a.toString(), ...r.infoMap.values()], h = Math.sumPrecise(c.map((d) => d.length)), u = new Uint8Array(h);
      let f = 0;
      for (const d of c) f = pk(d, f, u);
      return Si(oo(u, 0, u.length));
    }(s, t);
    e.set("ID", [t.fileIds[0], i]);
  }
}
async function lB({ originalData: s, xrefInfo: t, changes: e, xref: i = null, hasXfa: n = !1, xfaDatasetsRef: a = null, hasXfaDatasetsEntry: r = !1, needAppearances: o, acroFormRef: l = null, acroForm: c = null, xfaData: h = null, useXrefStream: u = !1 }) {
  await async function({ xref: x, acroForm: k, acroFormRef: I, hasXfa: T, hasXfaDatasetsEntry: E, xfaDatasetsRef: M, needAppearances: F, changes: L }) {
    if (!T || E || M || D("XFA - Cannot save it"), !F && (!T || !M || E)) return;
    const Y = k.clone();
    if (T && !E) {
      const B = k.get("XFA").slice();
      B.splice(2, 0, "datasets"), B.splice(3, 0, M), Y.set("XFA", B);
    }
    F && Y.set("NeedAppearances", !0), L.put(I, { data: Y });
  }({ xref: i, acroForm: c, acroFormRef: l, hasXfa: n, hasXfaDatasetsEntry: r, xfaDatasetsRef: a, needAppearances: o, changes: e }), n && oB({ xfaData: h, xfaDatasetsRef: a, changes: e, xref: i });
  const f = function(x, k, I) {
    const T = new q(null);
    T.set("Prev", x.startXRef);
    const E = x.newRef;
    return I ? (k.put(E, { data: "" }), T.set("Size", E.num + 1), T.set("Type", Z.get("XRef"))) : T.set("Size", E.num), x.rootRef !== null && T.set("Root", x.rootRef), x.infoRef !== null && T.set("Info", x.infoRef), x.encryptRef !== null && T.set("Encrypt", x.encryptRef), T;
  }(t, e, u), d = [], p = await async function(x, k, I = []) {
    const T = [];
    for (const [E, { data: M }] of x.items()) M !== null && typeof M != "string" ? (await Rb(E, M, I, k), T.push({ ref: E, data: I.join("") }), I.length = 0) : T.push({ ref: E, data: M });
    return T.sort((E, M) => E.ref.num - M.ref.num);
  }(e, i, d);
  let m = s.length;
  const b = s.at(-1);
  b !== 10 && b !== 13 && (d.push(`
`), m += 1);
  for (const { data: A } of p) A !== null && d.push(A);
  await (u ? async function(x, k, I, T, E) {
    const M = [];
    let F = 0, L = 0;
    for (const { ref: G, data: N } of I) {
      let j;
      F = Math.max(F, k), N !== null ? (j = Math.min(G.gen, 65535), M.push([1, k, j]), k += N.length) : (j = Math.min(G.gen + 1, 65535), M.push([0, 0, j])), L = Math.max(L, j);
    }
    T.set("Index", Pb(I));
    const Y = [1, K8(F), K8(L)];
    T.set("W", Y), Db(k, x, T);
    const B = Math.sumPrecise(Y), et = new Uint8Array(B * M.length), H = new Le(et);
    H.dict = T;
    let P = 0;
    for (const [G, N, j] of M)
      P = Ym(G, Y[0], P, et), P = Ym(N, Y[1], P, et), P = Ym(j, Y[2], P, et);
    await Rb(x.newRef, H, E, {}), E.push(`startxref
`, k.toString(), `
%%EOF
`);
  }(t, m, p, f, d) : async function(x, k, I, T, E) {
    E.push(`xref
`);
    const M = Pb(I);
    let F = 0;
    for (const { ref: L, data: Y } of I)
      L.num === M[F] && (E.push(`${M[F]} ${M[F + 1]}
`), F += 2), Y !== null ? (E.push(`${k.toString().padStart(10, "0")} ${Math.min(L.gen, 65535).toString().padStart(5, "0")} n\r
`), k += Y.length) : E.push(`0000000000 ${Math.min(L.gen + 1, 65535).toString().padStart(5, "0")} f\r
`);
    Db(k, x, T), E.push(`trailer
`), await cm(T, E), E.push(`
startxref
`, k.toString(), `
%%EOF
`);
  }(t, m, p, f, d));
  const y = s.length + Math.sumPrecise(d.map((A) => A.length)), v = new Uint8Array(y);
  v.set(s);
  let w = s.length;
  for (const A of d) w = pk(A, w, v);
  return v;
}
class cB {
  constructor(t) {
    this._msgHandler = t, this._contentLength = null, this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  getFullReader() {
    return As(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once."), this._fullRequestReader = new hB(this._msgHandler), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    const i = new uB(t, e, this._msgHandler);
    return this._rangeRequestReaders.push(i), i;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const i of this._rangeRequestReaders.slice(0)) i.cancel(t);
  }
}
class hB {
  constructor(t) {
    this._msgHandler = t, this.onProgress = null, this._contentLength = null, this._isRangeSupported = !1, this._isStreamingSupported = !1;
    const e = this._msgHandler.sendWithStream("GetReader");
    this._reader = e.getReader(), this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then((i) => {
      this._isStreamingSupported = i.isStreamingSupported, this._isRangeSupported = i.isRangeSupported, this._contentLength = i.contentLength;
    });
  }
  get headersReady() {
    return this._headersReady;
  }
  get contentLength() {
    return this._contentLength;
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  get isRangeSupported() {
    return this._isRangeSupported;
  }
  async read() {
    const { value: t, done: e } = await this._reader.read();
    return e ? { value: void 0, done: !0 } : { value: t.buffer, done: !1 };
  }
  cancel(t) {
    this._reader.cancel(t);
  }
}
class uB {
  constructor(t, e, i) {
    this._msgHandler = i, this.onProgress = null;
    const n = this._msgHandler.sendWithStream("GetRangeReader", { begin: t, end: e });
    this._reader = n.getReader();
  }
  get isStreamingSupported() {
    return !1;
  }
  async read() {
    const { value: t, done: e } = await this._reader.read();
    return e ? { value: void 0, done: !0 } : { value: t.buffer, done: !1 };
  }
  cancel(t) {
    this._reader.cancel(t);
  }
}
class Al {
  constructor(t) {
    this.name = t, this.terminated = !1, this._capability = Promise.withResolvers();
  }
  get finished() {
    return this._capability.promise;
  }
  finish() {
    this._capability.resolve();
  }
  terminate() {
    this.terminated = !0;
  }
  ensureNotTerminated() {
    if (this.terminated) throw new Error("Worker task was terminated");
  }
}
const o8 = class o8 {
  static setup(t, e) {
    let i = !1;
    t.on("test", (n) => {
      i || (i = !0, t.send("test", n instanceof Uint8Array));
    }), t.on("configure", (n) => {
      (function(r) {
        Number.isInteger(r) && (X9 = r);
      })(n.verbosity);
    }), t.on("GetDocRequest", (n) => this.createDocumentHandler(n, e));
  }
  static createDocumentHandler(t, e) {
    let i, n = !1, a = null;
    const r = /* @__PURE__ */ new Set(), o = CI(), { docId: l, apiVersion: c } = t, h = "5.3.31";
    if (c !== h) throw new Error(`The API version "${c}" does not match the Worker version "${h}".`);
    const u = (w, A) => `The \`${w}.prototype\` contains unexpected enumerable property "${A}", thus breaking e.g. \`for...in\` iteration of ${w}s.`;
    for (const w in {}) throw new Error(u("Object", w));
    for (const w in []) throw new Error(u("Array", w));
    const f = l + "_worker";
    let d = new Fb(f, l, e);
    function p() {
      if (n) throw new Error("Worker was terminated");
    }
    function m(w) {
      r.add(w);
    }
    function b(w) {
      w.finish(), r.delete(w);
    }
    async function y(w) {
      await i.ensureDoc("checkHeader"), await i.ensureDoc("parseStartXRef"), await i.ensureDoc("parse", [w]), await i.ensureDoc("checkFirstPage", [w]), await i.ensureDoc("checkLastPage", [w]);
      const A = await i.ensureDoc("isPureXfa");
      if (A) {
        const I = new Al("loadXfaResources");
        m(I), await i.ensureDoc("loadXfaResources", [d, I]), b(I);
      }
      const [x, k] = await Promise.all([i.ensureDoc("numPages"), i.ensureDoc("fingerprints")]);
      return { numPages: x, fingerprints: k, htmlForXfa: A ? await i.ensureDoc("htmlForXfa") : null };
    }
    function v(w) {
      function A(I) {
        p(), d.send("GetDoc", { pdfInfo: I });
      }
      function x(I) {
        if (p(), I instanceof i0) {
          const T = new Al(`PasswordException: response ${I.code}`);
          m(T), d.sendWithPromise("PasswordRequest", I).then(function({ password: E }) {
            b(T), i.updatePassword(E), k();
          }).catch(function() {
            b(T), d.send("DocException", I);
          });
        } else d.send("DocException", Ri(I));
      }
      function k() {
        p(), y(!1).then(A, function(I) {
          p(), I instanceof iu ? i.requestLoadedStream().then(function() {
            p(), y(!0).then(A, x);
          }) : x(I);
        });
      }
      p(), async function({ data: T, password: E, disableAutoFetch: M, rangeChunkSize: F, length: L, docBaseUrl: Y, enableXfa: B, evaluatorOptions: et }) {
        const H = { source: null, disableAutoFetch: M, docBaseUrl: Y, docId: l, enableXfa: B, evaluatorOptions: et, handler: d, length: L, password: E, rangeChunkSize: F };
        if (T)
          return H.source = T, new xb(H);
        const P = new cB(d), G = P.getFullReader(), N = Promise.withResolvers();
        let j, V = [], X = 0;
        return G.headersReady.then(function() {
          if (G.isRangeSupported) {
            H.source = P, H.length = G.contentLength, H.disableAutoFetch || (H.disableAutoFetch = G.isStreamingSupported), j = new rB(H);
            for (const z of V) j.sendProgressiveData(z);
            V = [], N.resolve(j), a = null;
          }
        }).catch(function(z) {
          N.reject(z), a = null;
        }), new Promise(function(z, K) {
          const W = function({ value: rt, done: $ }) {
            try {
              if (p(), $) {
                if (!j) {
                  const nt = tA(V);
                  V = [], L && nt.length !== L && D("reported HTTP length is different from actual"), H.source = nt, j = new xb(H), N.resolve(j);
                }
                a = null;
                return;
              }
              X += rt.byteLength, G.isStreamingSupported || d.send("DocProgress", { loaded: X, total: Math.max(X, G.contentLength || 0) }), j ? j.sendProgressiveData(rt) : V.push(rt), G.read().then(W, K);
            } catch (nt) {
              K(nt);
            }
          };
          G.read().then(W, K);
        }).catch(function(z) {
          N.reject(z), a = null;
        }), a = (z) => {
          P.cancelAllRequests(z);
        }, N.promise;
      }(w).then(function(I) {
        if (n)
          throw I.terminate(new Es("Worker was terminated.")), new Error("Worker was terminated");
        i = I, i.requestLoadedStream(!0).then((T) => {
          d.send("DataLoaded", { length: T.bytes.byteLength });
        });
      }).then(k, x);
    }
    return d.on("GetPage", function(w) {
      return i.getPage(w.pageIndex).then(function(A) {
        return Promise.all([i.ensure(A, "rotate"), i.ensure(A, "ref"), i.ensure(A, "userUnit"), i.ensure(A, "view")]).then(function([x, k, I, T]) {
          return { rotate: x, ref: k, refStr: (k == null ? void 0 : k.toString()) ?? null, userUnit: I, view: T };
        });
      });
    }), d.on("GetPageIndex", function(w) {
      const A = yt.get(w.num, w.gen);
      return i.ensureCatalog("getPageIndex", [A]);
    }), d.on("GetDestinations", function(w) {
      return i.ensureCatalog("destinations");
    }), d.on("GetDestination", function(w) {
      return i.ensureCatalog("getDestination", [w.id]);
    }), d.on("GetPageLabels", function(w) {
      return i.ensureCatalog("pageLabels");
    }), d.on("GetPageLayout", function(w) {
      return i.ensureCatalog("pageLayout");
    }), d.on("GetPageMode", function(w) {
      return i.ensureCatalog("pageMode");
    }), d.on("GetViewerPreferences", function(w) {
      return i.ensureCatalog("viewerPreferences");
    }), d.on("GetOpenAction", function(w) {
      return i.ensureCatalog("openAction");
    }), d.on("GetAttachments", function(w) {
      return i.ensureCatalog("attachments");
    }), d.on("GetDocJSActions", function(w) {
      return i.ensureCatalog("jsActions");
    }), d.on("GetPageJSActions", function({ pageIndex: w }) {
      return i.getPage(w).then((A) => i.ensure(A, "jsActions"));
    }), d.on("GetOutline", function(w) {
      return i.ensureCatalog("documentOutline");
    }), d.on("GetOptionalContentConfig", function(w) {
      return i.ensureCatalog("optionalContentConfig");
    }), d.on("GetPermissions", function(w) {
      return i.ensureCatalog("permissions");
    }), d.on("GetMetadata", function(w) {
      return Promise.all([i.ensureDoc("documentInfo"), i.ensureCatalog("metadata")]);
    }), d.on("GetMarkInfo", function(w) {
      return i.ensureCatalog("markInfo");
    }), d.on("GetData", function(w) {
      return i.requestLoadedStream().then((A) => A.bytes);
    }), d.on("GetAnnotations", function({ pageIndex: w, intent: A }) {
      return i.getPage(w).then(function(x) {
        const k = new Al(`GetAnnotations: page ${w}`);
        return m(k), x.getAnnotationsData(d, k, A).then((I) => (b(k), I), (I) => {
          throw b(k), I;
        });
      });
    }), d.on("GetFieldObjects", function(w) {
      return i.ensureDoc("fieldObjects").then((A) => (A == null ? void 0 : A.allFields) || null);
    }), d.on("HasJSActions", function(w) {
      return i.ensureDoc("hasJSActions");
    }), d.on("GetCalculationOrderIds", function(w) {
      return i.ensureDoc("calculationOrderIds");
    }), d.on("SaveDocument", async function({ isPureXfa: w, numPages: A, annotationStorage: x, filename: k }) {
      const I = [i.requestLoadedStream(), i.ensureCatalog("acroForm"), i.ensureCatalog("acroFormRef"), i.ensureDoc("startXRef"), i.ensureDoc("xref"), i.ensureDoc("linearization"), i.ensureCatalog("structTreeRoot")], T = new xi(), E = [], M = w ? null : iA(x), [F, L, Y, B, et, H, P] = await Promise.all(I), G = et.trailer.getRaw("Root") || null;
      let N;
      if (M) {
        P ? await P.canUpdateStructTree({ pdfManager: i, newAnnotationsByPage: M }) && (N = P) : await p0.canCreateStructureTree({ catalogRef: G, pdfManager: i, newAnnotationsByPage: M }) && (N = null);
        const $ = ho.generateImages(x.values(), et, i.evaluatorOptions.isOffscreenCanvasSupported), nt = N === void 0 ? E : [];
        for (const [wt, O] of M) nt.push(i.getPage(wt).then((U) => {
          const Q = new Al(`Save (editor): page ${wt}`);
          return m(Q), U.saveNewAnnotations(d, Q, O, $, T).finally(function() {
            b(Q);
          });
        }));
        N === null ? E.push(Promise.all(nt).then(async () => {
          await p0.createStructureTree({ newAnnotationsByPage: M, xref: et, catalogRef: G, pdfManager: i, changes: T });
        })) : N && E.push(Promise.all(nt).then(async () => {
          await N.updateStructureTree({ newAnnotationsByPage: M, pdfManager: i, changes: T });
        }));
      }
      if (w) E.push(i.ensureDoc("serializeXfaData", [x]));
      else for (let $ = 0; $ < A; $++) E.push(i.getPage($).then(function(nt) {
        const wt = new Al(`Save: page ${$}`);
        return m(wt), nt.save(d, wt, x, T).finally(function() {
          b(wt);
        });
      }));
      const j = await Promise.all(E);
      let V = null;
      if (w) {
        if (V = j[0], !V) return F.bytes;
      } else if (T.size === 0) return F.bytes;
      const X = Y && L instanceof q && T.values().some(($) => $.needAppearances), z = L instanceof q && L.get("XFA") || null;
      let K = null, W = !1;
      if (Array.isArray(z)) {
        for (let $ = 0, nt = z.length; $ < nt; $ += 2) z[$] === "datasets" && (K = z[$ + 1], W = !0);
        K === null && (K = et.getNewTemporaryRef());
      } else z && D("Unsupported XFA type.");
      let rt = /* @__PURE__ */ Object.create(null);
      if (et.trailer) {
        const $ = /* @__PURE__ */ new Map(), nt = et.trailer.get("Info") || null;
        if (nt instanceof q) for (const [wt, O] of nt) typeof O == "string" && $.set(wt, Jt(O));
        rt = { rootRef: G, encryptRef: et.trailer.getRaw("Encrypt") || null, newRef: et.getNewTemporaryRef(), infoRef: et.trailer.getRaw("Info") || null, infoMap: $, fileIds: et.trailer.get("ID") || null, startXRef: H ? B : et.lastXRefStreamPos ?? B, filename: k };
      }
      return lB({ originalData: F.bytes, xrefInfo: rt, changes: T, xref: et, hasXfa: !!z, xfaDatasetsRef: K, hasXfaDatasetsEntry: W, needAppearances: X, acroFormRef: Y, acroForm: L, xfaData: V, useXrefStream: Zv(et.topDict, "XRef") }).finally(() => {
        et.resetNewTemporaryRef();
      });
    }), d.on("GetOperatorList", function(w, A) {
      const x = w.pageIndex;
      i.getPage(x).then(function(k) {
        const I = new Al(`GetOperatorList: page ${x}`);
        m(I);
        const T = o >= k3 ? Date.now() : 0;
        k.getOperatorList({ handler: d, sink: A, task: I, intent: w.intent, cacheKey: w.cacheKey, annotationStorage: w.annotationStorage, modifiedIds: w.modifiedIds }).then(function(E) {
          b(I), T && qt(`page=${x + 1} - getOperatorList: time=${Date.now() - T}ms, len=${E.length}`), A.close();
        }, function(E) {
          b(I), I.terminated || A.error(E);
        });
      });
    }), d.on("GetTextContent", function(w, A) {
      const { pageIndex: x, includeMarkedContent: k, disableNormalization: I } = w;
      i.getPage(x).then(function(T) {
        const E = new Al("GetTextContent: page " + x);
        m(E);
        const M = o >= k3 ? Date.now() : 0;
        T.extractTextContent({ handler: d, task: E, sink: A, includeMarkedContent: k, disableNormalization: I }).then(function() {
          b(E), M && qt(`page=${x + 1} - getTextContent: time=` + (Date.now() - M) + "ms"), A.close();
        }, function(F) {
          b(E), E.terminated || A.error(F);
        });
      });
    }), d.on("GetStructTree", function(w) {
      return i.getPage(w.pageIndex).then((A) => i.ensure(A, "getStructTree"));
    }), d.on("FontFallback", function(w) {
      return i.fontFallback(w.id, d);
    }), d.on("Cleanup", function(w) {
      return i.cleanup(!0);
    }), d.on("Terminate", function(w) {
      n = !0;
      const A = [];
      if (i) {
        i.terminate(new Es("Worker was terminated."));
        const x = i.cleanup();
        A.push(x), i = null;
      } else E7();
      a == null || a(new Es("Worker was terminated."));
      for (const x of r)
        A.push(x.finished), x.terminate();
      return Promise.all(A).then(function() {
        d.destroy(), d = null;
      });
    }), d.on("Ready", function(w) {
      v(t), t = null;
    }), f;
  }
  static initializeFromPort(t) {
    const e = new Fb("worker", "main", t);
    this.setup(e, t), e.send("ready", null);
  }
};
typeof window > "u" && !dC && typeof self < "u" && typeof self.postMessage == "function" && "onmessage" in self && o8.initializeFromPort(self);
let z6 = o8;
globalThis.pdfjsWorker = { WorkerMessageHandler: z6 };
const {
  SvelteComponent: dB,
  append_hydration: Ms,
  attr: Te,
  children: Br,
  claim_element: kn,
  claim_space: El,
  claim_svg_element: Nb,
  claim_text: W7,
  detach: Ps,
  element: Sn,
  empty: Bb,
  get_svelte_dataset: t9,
  init: fB,
  insert_hydration: nl,
  listen: G6,
  noop: e9,
  run_all: gB,
  safe_not_equal: pB,
  set_data: X7,
  space: Ml,
  svg_element: Lb,
  text: K7
} = window.__gradio__svelte__internal, { createEventDispatcher: mB } = window.__gradio__svelte__internal;
function bB(s) {
  let t, e = "PDF files only";
  return {
    c() {
      t = Sn("p"), t.textContent = e, this.h();
    },
    l(i) {
      t = kn(i, "P", { class: !0, "data-svelte-h": !0 }), t9(t) !== "svelte-950tbk" && (t.textContent = e), this.h();
    },
    h() {
      Te(t, "class", "file-type-info svelte-18dkc5v");
    },
    m(i, n) {
      nl(i, t, n);
    },
    p: e9,
    d(i) {
      i && Ps(t);
    }
  };
}
function yB(s) {
  let t, e;
  return {
    c() {
      t = Sn("p"), e = K7(
        /*errorMessage*/
        s[2]
      ), this.h();
    },
    l(i) {
      t = kn(i, "P", { class: !0 });
      var n = Br(t);
      e = W7(
        n,
        /*errorMessage*/
        s[2]
      ), n.forEach(Ps), this.h();
    },
    h() {
      Te(t, "class", "error-message svelte-18dkc5v");
    },
    m(i, n) {
      nl(i, t, n), Ms(t, e);
    },
    p(i, n) {
      n & /*errorMessage*/
      4 && X7(
        e,
        /*errorMessage*/
        i[2]
      );
    },
    d(i) {
      i && Ps(t);
    }
  };
}
function Ob(s) {
  let t, e;
  return {
    c() {
      t = Sn("p"), e = K7(
        /*fileName*/
        s[0]
      ), this.h();
    },
    l(i) {
      t = kn(i, "P", { class: !0 });
      var n = Br(t);
      e = W7(
        n,
        /*fileName*/
        s[0]
      ), n.forEach(Ps), this.h();
    },
    h() {
      Te(t, "class", "file-name svelte-18dkc5v");
    },
    m(i, n) {
      nl(i, t, n), Ms(t, e);
    },
    p(i, n) {
      n & /*fileName*/
      1 && X7(
        e,
        /*fileName*/
        i[0]
      );
    },
    d(i) {
      i && Ps(t);
    }
  };
}
function Ub(s) {
  let t, e;
  return {
    c() {
      t = Sn("p"), e = K7(
        /*progessStatus*/
        s[3]
      ), this.h();
    },
    l(i) {
      t = kn(i, "P", { class: !0 });
      var n = Br(t);
      e = W7(
        n,
        /*progessStatus*/
        s[3]
      ), n.forEach(Ps), this.h();
    },
    h() {
      Te(t, "class", "progess-status svelte-18dkc5v");
    },
    m(i, n) {
      nl(i, t, n), Ms(t, e);
    },
    p(i, n) {
      n & /*progessStatus*/
      8 && X7(
        e,
        /*progessStatus*/
        i[3]
      );
    },
    d(i) {
      i && Ps(t);
    }
  };
}
function qb(s) {
  let t, e, i = "Cancel", n, a, r = "Upload and Extract Text", o, l;
  return {
    c() {
      t = Sn("div"), e = Sn("button"), e.textContent = i, n = Ml(), a = Sn("button"), a.textContent = r, this.h();
    },
    l(c) {
      t = kn(c, "DIV", { class: !0 });
      var h = Br(t);
      e = kn(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), t9(e) !== "svelte-q4w5wr" && (e.textContent = i), n = El(h), a = kn(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), t9(a) !== "svelte-ohnl2u" && (a.textContent = r), h.forEach(Ps), this.h();
    },
    h() {
      Te(e, "class", "cancel-button svelte-18dkc5v"), Te(a, "class", "upload-button svelte-18dkc5v"), Te(t, "class", "action-buttons svelte-18dkc5v");
    },
    m(c, h) {
      nl(c, t, h), Ms(t, e), Ms(t, n), Ms(t, a), o || (l = [
        G6(
          e,
          "click",
          /*click_handler*/
          s[6]
        ),
        G6(
          a,
          "click",
          /*dispatchUpload*/
          s[5]
        )
      ], o = !0);
    },
    p: e9,
    d(c) {
      c && Ps(t), o = !1, gB(l);
    }
  };
}
function wB(s) {
  let t, e, i, n, a, r, o, l, c, h = '<span class="upload-text-main svelte-18dkc5v">Click to upload</span>', u, f, d, p, m, b, y;
  function v(T, E) {
    return (
      /*errorMessage*/
      T[2] ? yB : bB
    );
  }
  let w = v(s), A = w(s), x = (
    /*fileName*/
    s[0] && Ob(s)
  ), k = (
    /*progessStatus*/
    s[3] && Ub(s)
  ), I = (
    /*selectedFile*/
    s[1] && qb(s)
  );
  return {
    c() {
      t = Sn("div"), e = Sn("input"), i = Ml(), n = Sn("label"), a = Sn("div"), r = Lb("svg"), o = Lb("path"), l = Ml(), c = Sn("div"), c.innerHTML = h, u = Ml(), A.c(), f = Ml(), x && x.c(), d = Ml(), k && k.c(), p = Ml(), I && I.c(), m = Bb(), this.h();
    },
    l(T) {
      t = kn(T, "DIV", { class: !0 });
      var E = Br(t);
      e = kn(E, "INPUT", {
        type: !0,
        accept: !0,
        class: !0,
        id: !0
      }), i = El(E), n = kn(E, "LABEL", { for: !0, class: !0 });
      var M = Br(n);
      a = kn(M, "DIV", { class: !0 });
      var F = Br(a);
      r = Nb(F, "svg", {
        xmlns: !0,
        class: !0,
        fill: !0,
        viewBox: !0,
        stroke: !0
      });
      var L = Br(r);
      o = Nb(L, "path", {
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        "stroke-width": !0,
        d: !0
      }), Br(o).forEach(Ps), L.forEach(Ps), l = El(F), c = kn(F, "DIV", { class: !0, "data-svelte-h": !0 }), t9(c) !== "svelte-1qejmv7" && (c.innerHTML = h), u = El(F), A.l(F), f = El(F), x && x.l(F), d = El(F), k && k.l(F), F.forEach(Ps), M.forEach(Ps), E.forEach(Ps), p = El(T), I && I.l(T), m = Bb(), this.h();
    },
    h() {
      Te(e, "type", "file"), Te(e, "accept", ".pdf"), Te(e, "class", "file-input svelte-18dkc5v"), Te(e, "id", "file-upload"), Te(o, "stroke-linecap", "round"), Te(o, "stroke-linejoin", "round"), Te(o, "stroke-width", "2"), Te(o, "d", "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"), Te(r, "xmlns", "http://www.w3.org/2000/svg"), Te(r, "class", "icon svelte-18dkc5v"), Te(r, "fill", "none"), Te(r, "viewBox", "0 0 24 24"), Te(r, "stroke", "currentColor"), Te(c, "class", "upload-text svelte-18dkc5v"), Te(a, "class", "label-content svelte-18dkc5v"), Te(n, "for", "file-upload"), Te(n, "class", "file-label svelte-18dkc5v"), Te(t, "class", "upload-container svelte-18dkc5v");
    },
    m(T, E) {
      nl(T, t, E), Ms(t, e), Ms(t, i), Ms(t, n), Ms(n, a), Ms(a, r), Ms(r, o), Ms(a, l), Ms(a, c), Ms(a, u), A.m(a, null), Ms(a, f), x && x.m(a, null), Ms(a, d), k && k.m(a, null), nl(T, p, E), I && I.m(T, E), nl(T, m, E), b || (y = G6(
        e,
        "change",
        /*handleFileSelect*/
        s[4]
      ), b = !0);
    },
    p(T, [E]) {
      w === (w = v(T)) && A ? A.p(T, E) : (A.d(1), A = w(T), A && (A.c(), A.m(a, f))), /*fileName*/
      T[0] ? x ? x.p(T, E) : (x = Ob(T), x.c(), x.m(a, d)) : x && (x.d(1), x = null), /*progessStatus*/
      T[3] ? k ? k.p(T, E) : (k = Ub(T), k.c(), k.m(a, null)) : k && (k.d(1), k = null), /*selectedFile*/
      T[1] ? I ? I.p(T, E) : (I = qb(T), I.c(), I.m(m.parentNode, m)) : I && (I.d(1), I = null);
    },
    i: e9,
    o: e9,
    d(T) {
      T && (Ps(t), Ps(p), Ps(m)), A.d(), x && x.d(), k && k.d(), I && I.d(T), b = !1, y();
    }
  };
}
function vB(s, t, e) {
  let i;
  var n = this && this.__awaiter || function(p, m, b, y) {
    function v(w) {
      return w instanceof b ? w : new b(function(A) {
        A(w);
      });
    }
    return new (b || (b = Promise))(function(w, A) {
      function x(T) {
        try {
          I(y.next(T));
        } catch (E) {
          A(E);
        }
      }
      function k(T) {
        try {
          I(y.throw(T));
        } catch (E) {
          A(E);
        }
      }
      function I(T) {
        T.done ? w(T.value) : v(T.value).then(x, k);
      }
      I((y = y.apply(p, m || [])).next());
    });
  };
  wn.workerSrc = "https://cdn.bootcss.com/pdf.js/3.11.174/pdf.worker.js";
  const a = mB();
  let r = "", o = null, l = "", c = "";
  function h(p) {
    e(2, c = "");
    const m = p.target;
    m.files && m.files[0] && (e(1, o = m.files[0]), e(0, r = o.name));
  }
  function u() {
    return n(this, void 0, void 0, function* () {
      if (e(3, i = "Checking file..."), !o) {
        e(3, i = ""), e(2, c = "No file selected. Please select a file to upload.");
        return;
      }
      if (o.type !== "application/pdf") {
        e(3, i = ""), e(1, o = null), e(2, c = "The file you selected is not a PDF. Please select a PDF file and try again.");
        return;
      }
      if (e(3, i = "Extracting text..."), l = yield f(o), o && l.length === 0) {
        e(3, i = ""), e(1, o = null), e(2, c = "No text found in the file. Please select a different file.");
        return;
      }
      a("upload", {
        content: {
          asString: l,
          asFile: o
        },
        type: "pdf"
      }), e(3, i = "Text extracted successfully");
    });
  }
  function f(p) {
    return n(this, void 0, void 0, function* () {
      if (!Cv)
        return console.log("pdfjsLib is not initialized"), "";
      if (!p)
        return console.log("no file input"), "";
      const m = yield p.arrayBuffer(), b = yield z9({ data: m }).promise;
      let y = "";
      for (let v = 1; v <= b.numPages; v++) {
        const x = (yield (yield b.getPage(v)).getTextContent()).items.map((k) => k.str).join(" ");
        y += x + `

`;
      }
      return y.trim();
    });
  }
  const d = () => {
    e(1, o = null), e(0, r = ""), e(2, c = ""), e(3, i = "");
  };
  return e(3, i = ""), [
    r,
    o,
    c,
    i,
    h,
    u,
    d
  ];
}
class AB extends dB {
  constructor(t) {
    super(), fB(this, t, vB, wB, pB, {});
  }
}
const {
  SvelteComponent: xB,
  append_hydration: Ki,
  attr: Cn,
  children: P2,
  claim_element: $a,
  claim_space: Fl,
  claim_text: Y7,
  detach: Zi,
  element: za,
  empty: jb,
  get_svelte_dataset: s9,
  init: kB,
  insert_hydration: al,
  listen: i9,
  noop: V6,
  run_all: mk,
  safe_not_equal: SB,
  set_data: J7,
  set_input_value: Hb,
  space: Rl,
  text: Z7
} = window.__gradio__svelte__internal, { createEventDispatcher: CB } = window.__gradio__svelte__internal;
function $b(s) {
  let t, e;
  return {
    c() {
      t = za("p"), e = Z7(
        /*fileName*/
        s[3]
      ), this.h();
    },
    l(i) {
      t = $a(i, "P", { class: !0 });
      var n = P2(t);
      e = Y7(
        n,
        /*fileName*/
        s[3]
      ), n.forEach(Zi), this.h();
    },
    h() {
      Cn(t, "class", "file-name svelte-16wve4y");
    },
    m(i, n) {
      al(i, t, n), Ki(t, e);
    },
    p(i, n) {
      n & /*fileName*/
      8 && J7(
        e,
        /*fileName*/
        i[3]
      );
    },
    d(i) {
      i && Zi(t);
    }
  };
}
function zb(s) {
  let t, e = "Fetching PDF...";
  return {
    c() {
      t = za("p"), t.textContent = e, this.h();
    },
    l(i) {
      t = $a(i, "P", { class: !0, "data-svelte-h": !0 }), s9(t) !== "svelte-su2spr" && (t.textContent = e), this.h();
    },
    h() {
      Cn(t, "class", "fetching-message svelte-16wve4y");
    },
    m(i, n) {
      al(i, t, n);
    },
    d(i) {
      i && Zi(t);
    }
  };
}
function Gb(s) {
  let t, e;
  return {
    c() {
      t = za("p"), e = Z7(
        /*errorMessage*/
        s[2]
      ), this.h();
    },
    l(i) {
      t = $a(i, "P", { class: !0 });
      var n = P2(t);
      e = Y7(
        n,
        /*errorMessage*/
        s[2]
      ), n.forEach(Zi), this.h();
    },
    h() {
      Cn(t, "class", "error-message svelte-16wve4y");
    },
    m(i, n) {
      al(i, t, n), Ki(t, e);
    },
    p(i, n) {
      n & /*errorMessage*/
      4 && J7(
        e,
        /*errorMessage*/
        i[2]
      );
    },
    d(i) {
      i && Zi(t);
    }
  };
}
function Vb(s) {
  let t, e;
  return {
    c() {
      t = za("p"), e = Z7(
        /*progessStatus*/
        s[5]
      ), this.h();
    },
    l(i) {
      t = $a(i, "P", { class: !0 });
      var n = P2(t);
      e = Y7(
        n,
        /*progessStatus*/
        s[5]
      ), n.forEach(Zi), this.h();
    },
    h() {
      Cn(t, "class", "progess-status svelte-16wve4y");
    },
    m(i, n) {
      al(i, t, n), Ki(t, e);
    },
    p(i, n) {
      n & /*progessStatus*/
      32 && J7(
        e,
        /*progessStatus*/
        i[5]
      );
    },
    d(i) {
      i && Zi(t);
    }
  };
}
function Wb(s) {
  let t, e, i = "Cancel", n, a, r = "Upload and Extract Text", o, l;
  return {
    c() {
      t = za("div"), e = za("button"), e.textContent = i, n = Rl(), a = za("button"), a.textContent = r, this.h();
    },
    l(c) {
      t = $a(c, "DIV", { class: !0 });
      var h = P2(t);
      e = $a(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), s9(e) !== "svelte-1txfzh9" && (e.textContent = i), n = Fl(h), a = $a(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), s9(a) !== "svelte-y6120m" && (a.textContent = r), h.forEach(Zi), this.h();
    },
    h() {
      Cn(e, "class", "cancel-button svelte-16wve4y"), Cn(a, "class", "upload-button svelte-16wve4y"), Cn(t, "class", "action-buttons svelte-16wve4y");
    },
    m(c, h) {
      al(c, t, h), Ki(t, e), Ki(t, n), Ki(t, a), o || (l = [
        i9(
          e,
          "click",
          /*click_handler_1*/
          s[10]
        ),
        i9(
          a,
          "click",
          /*dispatchUpload*/
          s[7]
        )
      ], o = !0);
    },
    p: V6,
    d(c) {
      c && Zi(t), o = !1, mk(l);
    }
  };
}
function IB(s) {
  let t, e, i, n, a = "Get PDF", r, o, l, c, h, u, f, d, p = (
    /*fileName*/
    s[3] && $b(s)
  ), m = (
    /*fetching*/
    s[4] && zb()
  ), b = (
    /*errorMessage*/
    s[2] && Gb(s)
  ), y = (
    /*progessStatus*/
    s[5] && Vb(s)
  ), v = (
    /*selectedFile*/
    s[1] && Wb(s)
  );
  return {
    c() {
      t = za("div"), e = za("input"), i = Rl(), n = za("button"), n.textContent = a, r = Rl(), p && p.c(), o = Rl(), m && m.c(), l = Rl(), b && b.c(), c = Rl(), y && y.c(), h = Rl(), v && v.c(), u = jb(), this.h();
    },
    l(w) {
      t = $a(w, "DIV", { class: !0 });
      var A = P2(t);
      e = $a(A, "INPUT", {
        type: !0,
        class: !0,
        placeholder: !0
      }), i = Fl(A), n = $a(A, "BUTTON", { class: !0, "data-svelte-h": !0 }), s9(n) !== "svelte-11gw4mi" && (n.textContent = a), r = Fl(A), p && p.l(A), o = Fl(A), m && m.l(A), l = Fl(A), b && b.l(A), c = Fl(A), y && y.l(A), A.forEach(Zi), h = Fl(w), v && v.l(w), u = jb(), this.h();
    },
    h() {
      Cn(e, "type", "url"), Cn(e, "class", "url-input svelte-16wve4y"), Cn(e, "placeholder", "Enter PDF URL..."), Cn(n, "class", "get-pdf-button svelte-16wve4y"), Cn(t, "class", "upload-url-container svelte-16wve4y");
    },
    m(w, A) {
      al(w, t, A), Ki(t, e), Hb(
        e,
        /*pdfUrl*/
        s[0]
      ), Ki(t, i), Ki(t, n), Ki(t, r), p && p.m(t, null), Ki(t, o), m && m.m(t, null), Ki(t, l), b && b.m(t, null), Ki(t, c), y && y.m(t, null), al(w, h, A), v && v.m(w, A), al(w, u, A), f || (d = [
        i9(
          e,
          "input",
          /*input_input_handler*/
          s[8]
        ),
        i9(
          n,
          "click",
          /*click_handler*/
          s[9]
        )
      ], f = !0);
    },
    p(w, [A]) {
      A & /*pdfUrl*/
      1 && e.value !== /*pdfUrl*/
      w[0] && Hb(
        e,
        /*pdfUrl*/
        w[0]
      ), /*fileName*/
      w[3] ? p ? p.p(w, A) : (p = $b(w), p.c(), p.m(t, o)) : p && (p.d(1), p = null), /*fetching*/
      w[4] ? m || (m = zb(), m.c(), m.m(t, l)) : m && (m.d(1), m = null), /*errorMessage*/
      w[2] ? b ? b.p(w, A) : (b = Gb(w), b.c(), b.m(t, c)) : b && (b.d(1), b = null), /*progessStatus*/
      w[5] ? y ? y.p(w, A) : (y = Vb(w), y.c(), y.m(t, null)) : y && (y.d(1), y = null), /*selectedFile*/
      w[1] ? v ? v.p(w, A) : (v = Wb(w), v.c(), v.m(u.parentNode, u)) : v && (v.d(1), v = null);
    },
    i: V6,
    o: V6,
    d(w) {
      w && (Zi(t), Zi(h), Zi(u)), p && p.d(), m && m.d(), b && b.d(), y && y.d(), v && v.d(w), f = !1, mk(d);
    }
  };
}
function _B(s, t, e) {
  var i = this && this.__awaiter || function(v, w, A, x) {
    function k(I) {
      return I instanceof A ? I : new A(function(T) {
        T(I);
      });
    }
    return new (A || (A = Promise))(function(I, T) {
      function E(L) {
        try {
          F(x.next(L));
        } catch (Y) {
          T(Y);
        }
      }
      function M(L) {
        try {
          F(x.throw(L));
        } catch (Y) {
          T(Y);
        }
      }
      function F(L) {
        L.done ? I(L.value) : k(L.value).then(E, M);
      }
      F((x = x.apply(v, w || [])).next());
    });
  };
  wn.workerSrc = "https://cdn.bootcss.com/pdf.js/3.11.174/pdf.worker.js";
  const n = CB();
  let a = "", r = null, o = "", l = "", c = "", h = !1, u = "";
  function f() {
    return i(this, void 0, void 0, function* () {
      if (e(4, h = !0), e(1, r = null), e(2, l = ""), !a) {
        e(4, h = !1), e(2, l = "Please enter a valid URL");
        return;
      }
      const v = yield fetch(a);
      if (!v.ok) {
        e(4, h = !1), e(2, l = `Failed to fetch PDF: ${v.status}`);
        return;
      }
      const w = yield v.blob();
      if (w.size === 0) {
        e(4, h = !1), e(2, l = "The url you provided did not return a PDF. Please check the URL and try again.");
        return;
      }
      if (w.type !== "application/pdf") {
        e(4, h = !1), e(2, l = "The url you provided did not return a PDF. Please check the URL and try again.");
        return;
      }
      e(1, r = new File([w], "downloaded.pdf", { type: w.type })), e(3, c = r.name), e(4, h = !1), e(2, l = "");
    });
  }
  function d() {
    return i(this, void 0, void 0, function* () {
      if (e(5, u = "Checking file..."), !r) {
        e(2, l = "No file selected. Please select a file to upload.");
        return;
      }
      if (e(5, u = "Extracting text..."), o = yield p(r), r && o.length === 0) {
        e(5, u = ""), e(1, r = null), e(2, l = "No text found in the file. Please select a different file.");
        return;
      }
      e(5, u = "Text extracted successfully"), n("upload", {
        content: {
          asString: o,
          asFile: r
        },
        type: "pdf"
      });
    });
  }
  function p(v) {
    return i(this, void 0, void 0, function* () {
      if (!Cv)
        return console.log("pdfjsLib is not initialized"), "";
      if (!v)
        return console.log("no file input"), "";
      const w = yield v.arrayBuffer(), A = yield z9({ data: w }).promise;
      let x = "";
      for (let k = 1; k <= A.numPages; k++) {
        const E = (yield (yield A.getPage(k)).getTextContent()).items.map((M) => M.str).join(" ");
        x += E + `

`;
      }
      return x.trim();
    });
  }
  function m() {
    a = this.value, e(0, a);
  }
  return [
    a,
    r,
    l,
    c,
    h,
    u,
    f,
    d,
    m,
    () => f(),
    () => {
      e(1, r = null), e(3, c = ""), e(2, l = "");
    }
  ];
}
class TB extends xB {
  constructor(t) {
    super(), kB(this, t, _B, IB, SB, {});
  }
}
const {
  SvelteComponent: EB,
  append_hydration: rd,
  attr: od,
  bubble: Xb,
  check_outros: MB,
  children: Jm,
  claim_component: bk,
  claim_element: Zm,
  claim_space: Kb,
  claim_text: Yb,
  create_component: yk,
  destroy_component: wk,
  detach: _h,
  element: Qm,
  empty: Jb,
  group_outros: FB,
  init: RB,
  insert_hydration: t5,
  listen: Zb,
  mount_component: vk,
  run_all: PB,
  safe_not_equal: DB,
  space: Qb,
  text: ty,
  transition_in: n9,
  transition_out: a9
} = window.__gradio__svelte__internal;
function NB(s) {
  let t, e;
  return t = new TB({}), t.$on(
    "upload",
    /*upload_handler_1*/
    s[4]
  ), {
    c() {
      yk(t.$$.fragment);
    },
    l(i) {
      bk(t.$$.fragment, i);
    },
    m(i, n) {
      vk(t, i, n), e = !0;
    },
    i(i) {
      e || (n9(t.$$.fragment, i), e = !0);
    },
    o(i) {
      a9(t.$$.fragment, i), e = !1;
    },
    d(i) {
      wk(t, i);
    }
  };
}
function BB(s) {
  let t, e;
  return t = new AB({}), t.$on(
    "upload",
    /*upload_handler*/
    s[3]
  ), {
    c() {
      yk(t.$$.fragment);
    },
    l(i) {
      bk(t.$$.fragment, i);
    },
    m(i, n) {
      vk(t, i, n), e = !0;
    },
    i(i) {
      e || (n9(t.$$.fragment, i), e = !0);
    },
    o(i) {
      a9(t.$$.fragment, i), e = !1;
    },
    d(i) {
      wk(t, i);
    }
  };
}
function LB(s) {
  let t, e, i, n, a, r, o, l, c, h, u, f, d, p, m;
  const b = [BB, NB], y = [];
  function v(w, A) {
    return (
      /*uploadMode*/
      w[0] === "device" ? 0 : 1
    );
  }
  return h = v(s), u = y[h] = b[h](s), {
    c() {
      t = Qm("div"), e = Qm("button"), i = ty("Upload from Device"), a = Qb(), r = Qm("button"), o = ty("Upload from URL"), c = Qb(), u.c(), f = Jb(), this.h();
    },
    l(w) {
      t = Zm(w, "DIV", { class: !0 });
      var A = Jm(t);
      e = Zm(A, "BUTTON", { class: !0 });
      var x = Jm(e);
      i = Yb(x, "Upload from Device"), x.forEach(_h), a = Kb(A), r = Zm(A, "BUTTON", { class: !0 });
      var k = Jm(r);
      o = Yb(k, "Upload from URL"), k.forEach(_h), A.forEach(_h), c = Kb(w), u.l(w), f = Jb(), this.h();
    },
    h() {
      od(e, "class", n = "upload-mode-button " + /*uploadMode*/
      (s[0] === "device" ? "active" : "") + " svelte-2ax2qy"), od(r, "class", l = "upload-mode-button " + /*uploadMode*/
      (s[0] === "url" ? "active" : "") + " svelte-2ax2qy"), od(t, "class", "upload-mode-selector svelte-2ax2qy");
    },
    m(w, A) {
      t5(w, t, A), rd(t, e), rd(e, i), rd(t, a), rd(t, r), rd(r, o), t5(w, c, A), y[h].m(w, A), t5(w, f, A), d = !0, p || (m = [
        Zb(
          e,
          "click",
          /*click_handler*/
          s[1]
        ),
        Zb(
          r,
          "click",
          /*click_handler_1*/
          s[2]
        )
      ], p = !0);
    },
    p(w, [A]) {
      (!d || A & /*uploadMode*/
      1 && n !== (n = "upload-mode-button " + /*uploadMode*/
      (w[0] === "device" ? "active" : "") + " svelte-2ax2qy")) && od(e, "class", n), (!d || A & /*uploadMode*/
      1 && l !== (l = "upload-mode-button " + /*uploadMode*/
      (w[0] === "url" ? "active" : "") + " svelte-2ax2qy")) && od(r, "class", l);
      let x = h;
      h = v(w), h !== x && (FB(), a9(y[x], 1, 1, () => {
        y[x] = null;
      }), MB(), u = y[h], u || (u = y[h] = b[h](w), u.c()), n9(u, 1), u.m(f.parentNode, f));
    },
    i(w) {
      d || (n9(u), d = !0);
    },
    o(w) {
      a9(u), d = !1;
    },
    d(w) {
      w && (_h(t), _h(c), _h(f)), y[h].d(w), p = !1, PB(m);
    }
  };
}
function OB(s, t, e) {
  let i = "device";
  const n = () => e(0, i = "device"), a = () => e(0, i = "url");
  function r(l) {
    Xb.call(this, s, l);
  }
  function o(l) {
    Xb.call(this, s, l);
  }
  return [i, n, a, r, o];
}
class UB extends EB {
  constructor(t) {
    super(), RB(this, t, OB, LB, DB, {});
  }
}
const {
  SvelteComponent: qB,
  append_hydration: Pl,
  attr: si,
  children: Bd,
  claim_element: Vh,
  claim_space: ey,
  claim_text: rp,
  detach: ta,
  element: Wh,
  empty: sy,
  get_svelte_dataset: jB,
  init: HB,
  insert_hydration: Xh,
  listen: $B,
  noop: iy,
  safe_not_equal: zB,
  set_data: GB,
  space: ny,
  text: op
} = window.__gradio__svelte__internal;
function ay(s) {
  let t, e, i, n, a, r, o, l, c;
  return {
    c() {
      t = Wh("div"), e = Wh("object"), i = Wh("p"), n = op("Your browser doesn't support PDF viewing. "), a = Wh("a"), r = op("Click here to download the PDF"), l = op("."), this.h();
    },
    l(h) {
      t = Vh(h, "DIV", { class: !0 });
      var u = Bd(t);
      e = Vh(u, "OBJECT", {
        data: !0,
        type: !0,
        class: !0,
        title: !0,
        "aria-label": !0,
        role: !0
      });
      var f = Bd(e);
      i = Vh(f, "P", {});
      var d = Bd(i);
      n = rp(d, "Your browser doesn't support PDF viewing. "), a = Vh(d, "A", {
        href: !0,
        target: !0,
        "aria-label": !0,
        title: !0
      });
      var p = Bd(a);
      r = rp(p, "Click here to download the PDF"), p.forEach(ta), l = rp(d, "."), d.forEach(ta), f.forEach(ta), u.forEach(ta), this.h();
    },
    h() {
      si(a, "href", o = URL.createObjectURL(
        /*file*/
        s[0]
      )), si(a, "target", "_blank"), si(a, "aria-label", "Download resume PDF"), si(a, "title", "Download PDF"), si(e, "data", c = URL.createObjectURL(
        /*file*/
        s[0]
      )), si(e, "type", "application/pdf"), si(e, "class", "pdf-object svelte-1y7apjc"), si(e, "title", "Resume PDF Viewer"), si(e, "aria-label", "PDF resume document viewer"), si(e, "role", "document"), si(t, "class", "pdf-viewer-container svelte-1y7apjc");
    },
    m(h, u) {
      Xh(h, t, u), Pl(t, e), Pl(e, i), Pl(i, n), Pl(i, a), Pl(a, r), Pl(i, l);
    },
    p(h, u) {
      u & /*file*/
      1 && o !== (o = URL.createObjectURL(
        /*file*/
        h[0]
      )) && si(a, "href", o), u & /*file*/
      1 && c !== (c = URL.createObjectURL(
        /*file*/
        h[0]
      )) && si(e, "data", c);
    },
    d(h) {
      h && ta(t);
    }
  };
}
function ry(s) {
  let t, e = "<p>The PDF will appear here</p>";
  return {
    c() {
      t = Wh("div"), t.innerHTML = e, this.h();
    },
    l(i) {
      t = Vh(i, "DIV", { class: !0, "data-svelte-h": !0 }), jB(t) !== "svelte-8k1pwj" && (t.innerHTML = e), this.h();
    },
    h() {
      si(t, "class", "container svelte-1y7apjc");
    },
    m(i, n) {
      Xh(i, t, n);
    },
    d(i) {
      i && ta(t);
    }
  };
}
function VB(s) {
  let t, e = (
    /*showPDF*/
    s[1] ? "Hide PDF" : "Show PDF"
  ), i, n, a, r, o, l, c = (
    /*file*/
    s[0] && /*showPDF*/
    s[1] && ay(s)
  ), h = !/*file*/
  s[0] && ry();
  return {
    c() {
      t = Wh("button"), i = op(e), n = ny(), c && c.c(), a = ny(), h && h.c(), r = sy(), this.h();
    },
    l(u) {
      t = Vh(u, "BUTTON", { class: !0 });
      var f = Bd(t);
      i = rp(f, e), f.forEach(ta), n = ey(u), c && c.l(u), a = ey(u), h && h.l(u), r = sy(), this.h();
    },
    h() {
      si(t, "class", "button svelte-1y7apjc");
    },
    m(u, f) {
      Xh(u, t, f), Pl(t, i), Xh(u, n, f), c && c.m(u, f), Xh(u, a, f), h && h.m(u, f), Xh(u, r, f), o || (l = $B(
        t,
        "click",
        /*click_handler*/
        s[2]
      ), o = !0);
    },
    p(u, [f]) {
      f & /*showPDF*/
      2 && e !== (e = /*showPDF*/
      u[1] ? "Hide PDF" : "Show PDF") && GB(i, e), /*file*/
      u[0] && /*showPDF*/
      u[1] ? c ? c.p(u, f) : (c = ay(u), c.c(), c.m(a.parentNode, a)) : c && (c.d(1), c = null), /*file*/
      u[0] ? h && (h.d(1), h = null) : h || (h = ry(), h.c(), h.m(r.parentNode, r));
    },
    i: iy,
    o: iy,
    d(u) {
      u && (ta(t), ta(n), ta(a), ta(r)), c && c.d(u), h && h.d(u), o = !1, l();
    }
  };
}
function WB(s, t, e) {
  let { file: i = null } = t, n = !0;
  const a = () => e(1, n = !n);
  return s.$$set = (r) => {
    "file" in r && e(0, i = r.file);
  }, [i, n, a];
}
class XB extends qB {
  constructor(t) {
    super(), HB(this, t, WB, VB, zB, { file: 0 });
  }
}
const {
  SvelteComponent: KB,
  append_hydration: YB,
  attr: Ak,
  children: xk,
  claim_element: Q7,
  claim_space: JB,
  claim_text: kk,
  detach: sl,
  element: t8,
  empty: oy,
  get_svelte_dataset: ZB,
  init: QB,
  insert_hydration: lu,
  listen: tL,
  noop: W6,
  safe_not_equal: eL,
  set_data: Sk,
  set_style: sL,
  space: iL,
  text: Ck
} = window.__gradio__svelte__internal;
function ly(s) {
  let t;
  function e(a, r) {
    return (
      /*textContent*/
      a[0] ? aL : nL
    );
  }
  let i = e(s), n = i(s);
  return {
    c() {
      t = t8("div"), n.c(), this.h();
    },
    l(a) {
      t = Q7(a, "DIV", { class: !0 });
      var r = xk(t);
      n.l(r), r.forEach(sl), this.h();
    },
    h() {
      Ak(t, "class", "scrollable-content svelte-olw9pd");
    },
    m(a, r) {
      lu(a, t, r), n.m(t, null);
    },
    p(a, r) {
      i === (i = e(a)) && n ? n.p(a, r) : (n.d(1), n = i(a), n && (n.c(), n.m(t, null)));
    },
    d(a) {
      a && sl(t), n.d();
    }
  };
}
function nL(s) {
  let t, e = "The Extracted Text Will Appear Here";
  return {
    c() {
      t = t8("p"), t.textContent = e, this.h();
    },
    l(i) {
      t = Q7(i, "P", { style: !0, "data-svelte-h": !0 }), ZB(t) !== "svelte-1cinss4" && (t.textContent = e), this.h();
    },
    h() {
      sL(t, "text-align", "center");
    },
    m(i, n) {
      lu(i, t, n);
    },
    p: W6,
    d(i) {
      i && sl(t);
    }
  };
}
function aL(s) {
  let t;
  return {
    c() {
      t = Ck(
        /*textContent*/
        s[0]
      );
    },
    l(e) {
      t = kk(
        e,
        /*textContent*/
        s[0]
      );
    },
    m(e, i) {
      lu(e, t, i);
    },
    p(e, i) {
      i & /*textContent*/
      1 && Sk(
        t,
        /*textContent*/
        e[0]
      );
    },
    d(e) {
      e && sl(t);
    }
  };
}
function rL(s) {
  let t, e = (
    /*showTextContent*/
    s[1] ? "Hide Text" : "Show Text"
  ), i, n, a, r, o, l = (
    /*showTextContent*/
    s[1] && ly(s)
  );
  return {
    c() {
      t = t8("button"), i = Ck(e), n = iL(), l && l.c(), a = oy(), this.h();
    },
    l(c) {
      t = Q7(c, "BUTTON", { class: !0 });
      var h = xk(t);
      i = kk(h, e), h.forEach(sl), n = JB(c), l && l.l(c), a = oy(), this.h();
    },
    h() {
      Ak(t, "class", "button svelte-olw9pd");
    },
    m(c, h) {
      lu(c, t, h), YB(t, i), lu(c, n, h), l && l.m(c, h), lu(c, a, h), r || (o = tL(
        t,
        "click",
        /*click_handler*/
        s[2]
      ), r = !0);
    },
    p(c, [h]) {
      h & /*showTextContent*/
      2 && e !== (e = /*showTextContent*/
      c[1] ? "Hide Text" : "Show Text") && Sk(i, e), /*showTextContent*/
      c[1] ? l ? l.p(c, h) : (l = ly(c), l.c(), l.m(a.parentNode, a)) : l && (l.d(1), l = null);
    },
    i: W6,
    o: W6,
    d(c) {
      c && (sl(t), sl(n), sl(a)), l && l.d(c), r = !1, o();
    }
  };
}
function oL(s, t, e) {
  let { textContent: i } = t, n = !0;
  const a = () => e(1, n = !n);
  return s.$$set = (r) => {
    "textContent" in r && e(0, i = r.textContent);
  }, [i, n, a];
}
class lL extends KB {
  constructor(t) {
    super(), QB(this, t, oL, rL, eL, { textContent: 0 });
  }
}
const {
  SvelteComponent: cL,
  append_hydration: lg,
  attr: hL,
  children: uL,
  claim_component: e5,
  claim_element: dL,
  claim_space: s5,
  claim_text: fL,
  create_component: i5,
  destroy_component: n5,
  detach: cy,
  element: gL,
  init: pL,
  insert_hydration: mL,
  mount_component: a5,
  safe_not_equal: bL,
  set_data: yL,
  space: r5,
  text: wL,
  toggle_class: Th,
  transition_in: o5,
  transition_out: l5
} = window.__gradio__svelte__internal;
function vL(s) {
  let t, e, i, n, a, r, o, l, c;
  return n = new UB({}), r = new XB({}), l = new lL({ props: { textContent: (
    /*value*/
    s[0]
  ) } }), {
    c() {
      t = gL("div"), e = wL(
        /*value*/
        s[0]
      ), i = r5(), i5(n.$$.fragment), a = r5(), i5(r.$$.fragment), o = r5(), i5(l.$$.fragment), this.h();
    },
    l(h) {
      t = dL(h, "DIV", { class: !0 });
      var u = uL(t);
      e = fL(
        u,
        /*value*/
        s[0]
      ), i = s5(u), e5(n.$$.fragment, u), a = s5(u), e5(r.$$.fragment, u), o = s5(u), e5(l.$$.fragment, u), u.forEach(cy), this.h();
    },
    h() {
      hL(t, "class", "svelte-1gecy8w"), Th(
        t,
        "table",
        /*type*/
        s[1] === "table"
      ), Th(
        t,
        "gallery",
        /*type*/
        s[1] === "gallery"
      ), Th(
        t,
        "selected",
        /*selected*/
        s[2]
      );
    },
    m(h, u) {
      mL(h, t, u), lg(t, e), lg(t, i), a5(n, t, null), lg(t, a), a5(r, t, null), lg(t, o), a5(l, t, null), c = !0;
    },
    p(h, [u]) {
      (!c || u & /*value*/
      1) && yL(
        e,
        /*value*/
        h[0]
      );
      const f = {};
      u & /*value*/
      1 && (f.textContent = /*value*/
      h[0]), l.$set(f), (!c || u & /*type*/
      2) && Th(
        t,
        "table",
        /*type*/
        h[1] === "table"
      ), (!c || u & /*type*/
      2) && Th(
        t,
        "gallery",
        /*type*/
        h[1] === "gallery"
      ), (!c || u & /*selected*/
      4) && Th(
        t,
        "selected",
        /*selected*/
        h[2]
      );
    },
    i(h) {
      c || (o5(n.$$.fragment, h), o5(r.$$.fragment, h), o5(l.$$.fragment, h), c = !0);
    },
    o(h) {
      l5(n.$$.fragment, h), l5(r.$$.fragment, h), l5(l.$$.fragment, h), c = !1;
    },
    d(h) {
      h && cy(t), n5(n), n5(r), n5(l);
    }
  };
}
function AL(s, t, e) {
  let { value: i } = t, { type: n } = t, { selected: a = !1 } = t;
  return s.$$set = (r) => {
    "value" in r && e(0, i = r.value), "type" in r && e(1, n = r.type), "selected" in r && e(2, a = r.selected);
  }, [i, n, a];
}
class NL extends cL {
  constructor(t) {
    super(), pL(this, t, AL, vL, bL, { value: 0, type: 1, selected: 2 });
  }
}
export {
  NL as default
};
