react-edit-to-html 1.1.9 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -182,7 +182,7 @@ function O(e, t, n) {
182
182
  //#endregion
183
183
  //#region node_modules/pdfjs-dist/build/pdf.mjs
184
184
  var k = /* @__PURE__ */ d({
185
- AbortException: () => Ye,
185
+ AbortException: () => Xe,
186
186
  AnnotationEditorLayer: () => by,
187
187
  AnnotationEditorParamsType: () => P,
188
188
  AnnotationEditorType: () => N,
@@ -194,33 +194,33 @@ var k = /* @__PURE__ */ d({
194
194
  ColorPicker: () => np,
195
195
  DOMSVGFactory: () => bp,
196
196
  DrawLayer: () => By,
197
- FeatureTest: () => z,
197
+ FeatureTest: () => R,
198
198
  GlobalWorkerOptions: () => Bu,
199
199
  ImageKind: () => Oe,
200
- InvalidPDFException: () => Ke,
201
- MathClamp: () => lt,
200
+ InvalidPDFException: () => qe,
201
+ MathClamp: () => B,
202
202
  OPS: () => Me,
203
203
  OutputScale: () => Pt,
204
204
  PDFDataRangeTransport: () => sf,
205
205
  PDFDateString: () => Et,
206
206
  PDFWorker: () => yf,
207
- PasswordException: () => We,
207
+ PasswordException: () => Ge,
208
208
  PasswordResponses: () => Pe,
209
209
  PermissionFlag: () => Ee,
210
210
  PixelsPerInch: () => pt,
211
211
  RenderingCancelledException: () => gt,
212
- ResponseException: () => qe,
212
+ ResponseException: () => Je,
213
213
  SignatureExtractor: () => gv,
214
214
  SupportedImageMimeTypes: () => Ft,
215
215
  TextLayer: () => Vd,
216
216
  TextLayerImages: () => ub,
217
217
  TouchManager: () => Xi,
218
- Util: () => B,
218
+ Util: () => z,
219
219
  VerbosityLevel: () => je,
220
220
  XfaLayer: () => ft,
221
221
  applyOpacity: () => Rt,
222
222
  build: () => Wf,
223
- createValidAbsoluteUrl: () => Be,
223
+ createValidAbsoluteUrl: () => Ve,
224
224
  fetchData: () => mt,
225
225
  findContrastColor: () => Wt,
226
226
  getDocument: () => tf,
@@ -228,20 +228,20 @@ var k = /* @__PURE__ */ d({
228
228
  getPdfFilenameFromUrl: () => bt,
229
229
  getRGB: () => kt,
230
230
  getRGBA: () => Ot,
231
- getUuid: () => it,
231
+ getUuid: () => at,
232
232
  isDataScheme: () => _t,
233
233
  isPdfFile: () => vt,
234
234
  isValidExplicitDest: () => Ps,
235
- makeArr: () => ot,
236
- makeMap: () => st,
237
- makeObj: () => ct,
235
+ makeArr: () => st,
236
+ makeMap: () => ct,
237
+ makeObj: () => lt,
238
238
  noContextMenu: () => wt,
239
- normalizeUnicode: () => rt,
239
+ normalizeUnicode: () => it,
240
240
  renderRichText: () => Gt,
241
241
  setLayerDimensions: () => Nt,
242
- shadow: () => R,
242
+ shadow: () => L,
243
243
  stopEvent: () => Tt,
244
- updateUrlHash: () => Ve,
244
+ updateUrlHash: () => He,
245
245
  version: () => Uf
246
246
  }), A, ee, j, te, ne, re, ie, M, ae, oe, se, ce, le, ue, de, fe, pe, me, he, ge = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), _e = [
247
247
  Infinity,
@@ -474,10 +474,10 @@ function F(e) {
474
474
  function I(e) {
475
475
  throw Error(e);
476
476
  }
477
- function L(e, t) {
477
+ function ze(e, t) {
478
478
  e || I(t);
479
479
  }
480
- function ze(e) {
480
+ function Be(e) {
481
481
  switch (e == null ? void 0 : e.protocol) {
482
482
  case "http:":
483
483
  case "https:":
@@ -487,7 +487,7 @@ function ze(e) {
487
487
  default: return !1;
488
488
  }
489
489
  }
490
- function Be(e, t = null, n = null) {
490
+ function Ve(e, t = null, n = null) {
491
491
  if (!e) return null;
492
492
  if (n && typeof e == "string") {
493
493
  if (n.addDefaultProtocol && e.startsWith("www.")) {
@@ -495,20 +495,20 @@ function Be(e, t = null, n = null) {
495
495
  (t == null ? void 0 : t.length) >= 2 && (e = `http://${e}`);
496
496
  }
497
497
  if (n.tryConvertEncoding) try {
498
- e = et(e);
498
+ e = tt(e);
499
499
  } catch (e) {}
500
500
  }
501
501
  let r = t ? URL.parse(e, t) : URL.parse(e);
502
- return ze(r) ? r : null;
502
+ return Be(r) ? r : null;
503
503
  }
504
- function Ve(e, t, n = !1) {
504
+ function He(e, t, n = !1) {
505
505
  let r = URL.parse(e);
506
- return r ? (r.hash = t, r.href) : n && Be(e, "http://example.com") ? e.split("#", 1)[0] + `${t ? `#${t}` : ""}` : "";
506
+ return r ? (r.hash = t, r.href) : n && Ve(e, "http://example.com") ? e.split("#", 1)[0] + `${t ? `#${t}` : ""}` : "";
507
507
  }
508
- function He(e) {
508
+ function Ue(e) {
509
509
  return e.substring(e.lastIndexOf("/") + 1);
510
510
  }
511
- function R(e, t, n, r = !1) {
511
+ function L(e, t, n, r = !1) {
512
512
  return Object.defineProperty(e, t, {
513
513
  value: n,
514
514
  enumerable: !r,
@@ -516,37 +516,37 @@ function R(e, t, n, r = !1) {
516
516
  writable: !1
517
517
  }), n;
518
518
  }
519
- var Ue = function() {
519
+ var We = function() {
520
520
  function e(e, t) {
521
521
  this.message = e, this.name = t;
522
522
  }
523
523
  return e.prototype = /* @__PURE__ */ Error(), e.constructor = e, e;
524
- }(), We = class extends Ue {
524
+ }(), Ge = class extends We {
525
525
  constructor(e, t) {
526
526
  super(e, "PasswordException"), this.code = t;
527
527
  }
528
- }, Ge = class extends Ue {
528
+ }, Ke = class extends We {
529
529
  constructor(e, t) {
530
530
  super(e, "UnknownErrorException"), this.details = t;
531
531
  }
532
- }, Ke = class extends Ue {
532
+ }, qe = class extends We {
533
533
  constructor(e) {
534
534
  super(e, "InvalidPDFException");
535
535
  }
536
- }, qe = class extends Ue {
536
+ }, Je = class extends We {
537
537
  constructor(e, t, n) {
538
538
  super(e, "ResponseException"), this.status = t, this.missing = n;
539
539
  }
540
- }, Je = class extends Ue {
540
+ }, Ye = class extends We {
541
541
  constructor(e) {
542
542
  super(e, "FormatError");
543
543
  }
544
- }, Ye = class extends Ue {
544
+ }, Xe = class extends We {
545
545
  constructor(e) {
546
546
  super(e, "AbortException");
547
547
  }
548
548
  };
549
- function Xe(e) {
549
+ function Ze(e) {
550
550
  (typeof e != "object" || (e == null ? void 0 : e.length) === void 0) && I("Invalid argument for bytesToString");
551
551
  let t = e.length, n = 8192;
552
552
  if (t < n) return String.fromCharCode.apply(null, e);
@@ -557,34 +557,34 @@ function Xe(e) {
557
557
  }
558
558
  return r.join("");
559
559
  }
560
- function Ze(e) {
560
+ function Qe(e) {
561
561
  typeof e != "string" && I("Invalid argument for stringToBytes");
562
562
  let t = e.length, n = new Uint8Array(t);
563
563
  for (let r = 0; r < t; ++r) n[r] = e.charCodeAt(r) & 255;
564
564
  return n;
565
565
  }
566
- var z = class {
566
+ var R = class {
567
567
  static get isLittleEndian() {
568
568
  let e = /* @__PURE__ */ new Uint8Array(4);
569
569
  e[0] = 1;
570
570
  let t = new Uint32Array(e.buffer, 0, 1);
571
- return R(this, "isLittleEndian", t[0] === 1);
571
+ return L(this, "isLittleEndian", t[0] === 1);
572
572
  }
573
573
  static get isOffscreenCanvasSupported() {
574
- return R(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
574
+ return L(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
575
575
  }
576
576
  static get isImageDecoderSupported() {
577
- return R(this, "isImageDecoderSupported", typeof ImageDecoder < "u");
577
+ return L(this, "isImageDecoderSupported", typeof ImageDecoder < "u");
578
578
  }
579
579
  static get isFloat16ArraySupported() {
580
- return R(this, "isFloat16ArraySupported", typeof Float16Array < "u");
580
+ return L(this, "isFloat16ArraySupported", typeof Float16Array < "u");
581
581
  }
582
582
  static get isSanitizerSupported() {
583
- return R(this, "isSanitizerSupported", typeof Sanitizer < "u");
583
+ return L(this, "isSanitizerSupported", typeof Sanitizer < "u");
584
584
  }
585
585
  static get platform() {
586
586
  let { platform: e, userAgent: t } = navigator;
587
- return R(this, "platform", {
587
+ return L(this, "platform", {
588
588
  isAndroid: t.includes("Android"),
589
589
  isLinux: e.includes("Linux"),
590
590
  isMac: e.includes("Mac"),
@@ -594,19 +594,19 @@ var z = class {
594
594
  }
595
595
  static get isCanvasFilterSupported() {
596
596
  let e;
597
- return this.isOffscreenCanvasSupported ? e = new OffscreenCanvas(1, 1).getContext("2d") : typeof document < "u" && (e = document.createElement("canvas").getContext("2d")), R(this, "isCanvasFilterSupported", (e == null ? void 0 : e.filter) !== void 0);
597
+ return this.isOffscreenCanvasSupported ? e = new OffscreenCanvas(1, 1).getContext("2d") : typeof document < "u" && (e = document.createElement("canvas").getContext("2d")), L(this, "isCanvasFilterSupported", (e == null ? void 0 : e.filter) !== void 0);
598
598
  }
599
599
  static get isAlphaColorInputSupported() {
600
- if (typeof document > "u") return R(this, "isAlphaColorInputSupported", !1);
600
+ if (typeof document > "u") return L(this, "isAlphaColorInputSupported", !1);
601
601
  let e = document.createElement("input");
602
- return e.type = "color", e.setAttribute("alpha", ""), e.value = "#ff000080", R(this, "isAlphaColorInputSupported", e.value !== "#ff0000");
602
+ return e.type = "color", e.setAttribute("alpha", ""), e.value = "#ff000080", L(this, "isAlphaColorInputSupported", e.value !== "#ff0000");
603
603
  }
604
604
  static get isBackdropFilterSupported() {
605
- return R(this, "isBackdropFilterSupported", typeof CSS < "u" && CSS.supports("backdrop-filter", "blur(1px)"));
605
+ return L(this, "isBackdropFilterSupported", typeof CSS < "u" && CSS.supports("backdrop-filter", "blur(1px)"));
606
606
  }
607
- }, B = class e {
607
+ }, z = class e {
608
608
  static get hexNums() {
609
- return R(this, "hexNums", Array.from(Array(256).keys(), (e) => e.toString(16).padStart(2, "0")));
609
+ return L(this, "hexNums", Array.from(Array(256).keys(), (e) => e.toString(16).padStart(2, "0")));
610
610
  }
611
611
  static makeHexColor(e, t, n) {
612
612
  return `#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`;
@@ -691,38 +691,38 @@ var z = class {
691
691
  i[0] = Math.min(i[0], e, n), i[1] = Math.min(i[1], t, r), i[2] = Math.max(i[2], e, n), i[3] = Math.max(i[3], t, r);
692
692
  }
693
693
  static bezierBoundingBox(t, n, r, i, a, o, s, c, l) {
694
- l[0] = Math.min(l[0], t, s), l[1] = Math.min(l[1], n, c), l[2] = Math.max(l[2], t, s), l[3] = Math.max(l[3], n, c), f(e, this, $e).call(this, t, r, a, s, n, i, o, c, 3 * (-t + 3 * (r - a) + s), 6 * (t - 2 * r + a), 3 * (r - t), l), f(e, this, $e).call(this, t, r, a, s, n, i, o, c, 3 * (-n + 3 * (i - o) + c), 6 * (n - 2 * i + o), 3 * (i - n), l);
694
+ l[0] = Math.min(l[0], t, s), l[1] = Math.min(l[1], n, c), l[2] = Math.max(l[2], t, s), l[3] = Math.max(l[3], n, c), f(e, this, et).call(this, t, r, a, s, n, i, o, c, 3 * (-t + 3 * (r - a) + s), 6 * (t - 2 * r + a), 3 * (r - t), l), f(e, this, et).call(this, t, r, a, s, n, i, o, c, 3 * (-n + 3 * (i - o) + c), 6 * (n - 2 * i + o), 3 * (i - n), l);
695
695
  }
696
696
  };
697
- A = B;
698
- function Qe(e, t, n, r, i, a, o, s, c, l) {
697
+ A = z;
698
+ function $e(e, t, n, r, i, a, o, s, c, l) {
699
699
  if (c <= 0 || c >= 1) return;
700
700
  let u = 1 - c, d = c * c, f = d * c, p = u * (u * (u * e + 3 * c * t) + 3 * d * n) + f * r, m = u * (u * (u * i + 3 * c * a) + 3 * d * o) + f * s;
701
701
  l[0] = Math.min(l[0], p), l[1] = Math.min(l[1], m), l[2] = Math.max(l[2], p), l[3] = Math.max(l[3], m);
702
702
  }
703
- function $e(e, t, n, r, i, a, o, s, c, l, u, d) {
703
+ function et(e, t, n, r, i, a, o, s, c, l, u, d) {
704
704
  if (Math.abs(c) < 1e-12) {
705
- Math.abs(l) >= 1e-12 && f(A, this, Qe).call(this, e, t, n, r, i, a, o, s, -u / l, d);
705
+ Math.abs(l) >= 1e-12 && f(A, this, $e).call(this, e, t, n, r, i, a, o, s, -u / l, d);
706
706
  return;
707
707
  }
708
708
  let p = Math.pow(l, 2) - 4 * u * c;
709
709
  if (p < 0) return;
710
710
  let m = Math.sqrt(p), h = 2 * c;
711
- f(A, this, Qe).call(this, e, t, n, r, i, a, o, s, (-l + m) / h, d), f(A, this, Qe).call(this, e, t, n, r, i, a, o, s, (-l - m) / h, d);
711
+ f(A, this, $e).call(this, e, t, n, r, i, a, o, s, (-l + m) / h, d), f(A, this, $e).call(this, e, t, n, r, i, a, o, s, (-l - m) / h, d);
712
712
  }
713
- function et(e) {
713
+ function tt(e) {
714
714
  return decodeURIComponent(escape(e));
715
715
  }
716
- var tt = null, nt = null;
717
- function rt(e) {
718
- return tt || (tt = /([\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, nt = /* @__PURE__ */ new Map([["ſt", "ſt"]])), e.replaceAll(tt, (e, t, n) => t ? t.normalize("NFKC") : nt.get(n));
716
+ var nt = null, rt = null;
717
+ function it(e) {
718
+ return nt || (nt = /([\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, rt = /* @__PURE__ */ new Map([["ſt", "ſt"]])), e.replaceAll(nt, (e, t, n) => t ? t.normalize("NFKC") : rt.get(n));
719
719
  }
720
- function it() {
720
+ function at() {
721
721
  if (typeof crypto.randomUUID == "function") return crypto.randomUUID();
722
722
  let e = /* @__PURE__ */ new Uint8Array(32);
723
- return crypto.getRandomValues(e), Xe(e);
723
+ return crypto.getRandomValues(e), Ze(e);
724
724
  }
725
- function at(e, t, n) {
725
+ function ot(e, t, n) {
726
726
  if (!Array.isArray(n) || n.length < 2) return !1;
727
727
  let [r, i, ...a] = n;
728
728
  if (!e(r) && !Number.isInteger(r) || !t(i)) return !1;
@@ -748,8 +748,8 @@ function at(e, t, n) {
748
748
  for (let e of a) if (!(typeof e == "number" || s && e === null)) return !1;
749
749
  return !0;
750
750
  }
751
- var ot = () => [], st = () => /* @__PURE__ */ new Map(), ct = () => Object.create(null);
752
- function lt(e, t, n) {
751
+ var st = () => [], ct = () => /* @__PURE__ */ new Map(), lt = () => Object.create(null);
752
+ function B(e, t, n) {
753
753
  return Math.min(Math.max(e, t), n);
754
754
  }
755
755
  var ut = class e {
@@ -784,7 +784,7 @@ var ut = class e {
784
784
  }
785
785
  get rawDims() {
786
786
  let e = this.viewBox;
787
- return R(this, "rawDims", {
787
+ return L(this, "rawDims", {
788
788
  pageWidth: e[2] - e[0],
789
789
  pageHeight: e[3] - e[1],
790
790
  pageX: e[0],
@@ -804,11 +804,11 @@ var ut = class e {
804
804
  }
805
805
  convertToViewportPoint(e, t) {
806
806
  let n = [e, t];
807
- return B.applyTransform(n, this.transform), n;
807
+ return z.applyTransform(n, this.transform), n;
808
808
  }
809
809
  convertToPdfPoint(e, t) {
810
810
  let n = [e, t];
811
- return B.applyInverseTransform(n, this.transform), n;
811
+ return z.applyInverseTransform(n, this.transform), n;
812
812
  }
813
813
  }, dt = class e {
814
814
  static textContent(t) {
@@ -1006,7 +1006,7 @@ function ht() {
1006
1006
  });
1007
1007
  }), ht.apply(this, arguments);
1008
1008
  }
1009
- var gt = class extends Ue {
1009
+ var gt = class extends We {
1010
1010
  constructor(e, t = 0) {
1011
1011
  super(e, "RenderingCancelledException"), this.extraDelay = t;
1012
1012
  }
@@ -1020,7 +1020,7 @@ function vt(e) {
1020
1020
  return typeof e == "string" && /\.pdf$/i.test(e);
1021
1021
  }
1022
1022
  function yt(e) {
1023
- return [e] = e.split(/[#?]/, 1), He(e);
1023
+ return [e] = e.split(/[#?]/, 1), Ue(e);
1024
1024
  }
1025
1025
  function bt(e, t = "document.pdf") {
1026
1026
  if (typeof e != "string") return t;
@@ -1044,11 +1044,11 @@ function bt(e, t = "document.pdf") {
1044
1044
  let r = (e) => {
1045
1045
  try {
1046
1046
  let t = decodeURIComponent(e);
1047
- return t.includes("/") && (t = He(t), t.length === 4 && i.test(t)) ? e : t;
1047
+ return t.includes("/") && (t = Ue(t), t.length === 4 && i.test(t)) ? e : t;
1048
1048
  } catch (t) {
1049
1049
  return e;
1050
1050
  }
1051
- }, i = /\.pdf$/i, a = He(n.pathname);
1051
+ }, i = /\.pdf$/i, a = Ue(n.pathname);
1052
1052
  if (i.test(a)) return r(a);
1053
1053
  if (n.searchParams.size > 0) {
1054
1054
  var o;
@@ -1237,7 +1237,7 @@ var Pt = class e {
1237
1237
  ], It = class {
1238
1238
  static get isDarkMode() {
1239
1239
  var e, t;
1240
- return R(this, "isDarkMode", !!(!((e = window) == null || (t = e.matchMedia) == null) && t.call(e, "(prefers-color-scheme: dark)").matches));
1240
+ return L(this, "isDarkMode", !!(!((e = window) == null || (t = e.matchMedia) == null) && t.call(e, "(prefers-color-scheme: dark)").matches));
1241
1241
  }
1242
1242
  }, Lt = class {
1243
1243
  static get commentForegroundColor() {
@@ -1246,12 +1246,12 @@ var Pt = class e {
1246
1246
  let { style: t } = e;
1247
1247
  t.width = t.height = "0", t.display = "none", t.color = "var(--comment-fg-color)", document.body.append(e);
1248
1248
  let { color: n } = window.getComputedStyle(e);
1249
- return e.remove(), R(this, "commentForegroundColor", kt(n));
1249
+ return e.remove(), L(this, "commentForegroundColor", kt(n));
1250
1250
  }
1251
1251
  };
1252
1252
  function Rt(e, t) {
1253
1253
  var n;
1254
- t = lt((n = t) == null ? 1 : n, 0, 1);
1254
+ t = B((n = t) == null ? 1 : n, 0, 1);
1255
1255
  let r = 255 * (1 - t);
1256
1256
  return e.map((e) => Math.round(e * t + r));
1257
1257
  }
@@ -1325,7 +1325,7 @@ function Wt(e, t) {
1325
1325
  }
1326
1326
  o[2] = c ? t : e;
1327
1327
  }
1328
- return Bt(o, a), r = B.makeHexColor(Math.round(a[0] * 255), Math.round(a[1] * 255), Math.round(a[2] * 255)), Ut.set(n, r), r;
1328
+ return Bt(o, a), r = z.makeHexColor(Math.round(a[0] * 255), Math.round(a[1] * 255), Math.round(a[2] * 255)), Ut.set(n, r), r;
1329
1329
  }
1330
1330
  function Gt({ html: e, dir: t, className: n }, r) {
1331
1331
  let i = document.createDocumentFragment();
@@ -1607,13 +1607,13 @@ var bn = class e {
1607
1607
  }
1608
1608
  }, Dn = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), kn = /* @__PURE__ */ new WeakMap(), An = /* @__PURE__ */ new WeakSet(), jn = class {
1609
1609
  constructor() {
1610
- S(this, An), b(this, Dn, it()), b(this, On, 0), b(this, kn, null);
1610
+ S(this, An), b(this, Dn, at()), b(this, On, 0), b(this, kn, null);
1611
1611
  }
1612
1612
  static get _isSVGFittingCanvas() {
1613
1613
  let e = `data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${xe}"><rect width="1" height="1" style="fill:red;"/></svg>`, t = new OffscreenCanvas(1, 3).getContext("2d", { willReadFrequently: !0 }), n = new Image();
1614
1614
  n.src = e;
1615
1615
  let r = n.decode().then(() => (t.drawImage(n, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(t.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
1616
- return R(this, "_isSVGFittingCanvas", r);
1616
+ return L(this, "_isSVGFittingCanvas", r);
1617
1617
  }
1618
1618
  getFromFile(e) {
1619
1619
  var t = this;
@@ -1775,7 +1775,7 @@ var Nn = /* @__PURE__ */ new WeakMap(), Pn = /* @__PURE__ */ new WeakMap(), Fn =
1775
1775
  }, Rn = class e {
1776
1776
  constructor(t) {
1777
1777
  this.callbacks = /* @__PURE__ */ new Map();
1778
- let { isMac: n } = z.platform;
1778
+ let { isMac: n } = R.platform;
1779
1779
  for (let [r, i, a = {}] of t) {
1780
1780
  let t = r.some((e) => e.startsWith("mac+"));
1781
1781
  for (let o of r) {
@@ -1786,7 +1786,7 @@ var Nn = /* @__PURE__ */ new WeakMap(), Pn = /* @__PURE__ */ new WeakMap(), Fn =
1786
1786
  e && (r = o.slice(4));
1787
1787
  }
1788
1788
  let [s, c] = zn.call(e, r);
1789
- s !== null && this.callbacks.getOrInsertComputed(s, ot).push({
1789
+ s !== null && this.callbacks.getOrInsertComputed(s, st).push({
1790
1790
  callback: i,
1791
1791
  options: a,
1792
1792
  modifiers: c
@@ -1834,7 +1834,7 @@ g(Rn, "ALT", 1), g(Rn, "CTRL", 2), g(Rn, "META", 4), g(Rn, "SHIFT", 8);
1834
1834
  var Vn = class e {
1835
1835
  get _colors() {
1836
1836
  let e = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
1837
- return At(e), R(this, "_colors", e);
1837
+ return At(e), L(this, "_colors", e);
1838
1838
  }
1839
1839
  convert(t) {
1840
1840
  let n = kt(t);
@@ -1844,7 +1844,7 @@ var Vn = class e {
1844
1844
  }
1845
1845
  getHexCode(e) {
1846
1846
  let t = this._colors.get(e);
1847
- return t ? B.makeHexColor(...t) : e;
1847
+ return t ? z.makeHexColor(...t) : e;
1848
1848
  }
1849
1849
  };
1850
1850
  g(Vn, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [
@@ -1865,7 +1865,7 @@ var Hn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Wn =
1865
1865
  }
1866
1866
  return !0;
1867
1867
  }, i = this.TRANSLATE_SMALL, a = this.TRANSLATE_BIG;
1868
- return R(this, "_keyboardManager", new Rn([
1868
+ return L(this, "_keyboardManager", new Rn([
1869
1869
  [
1870
1870
  ["ctrl+a", "mac+meta+a"],
1871
1871
  t.selectAll,
@@ -2030,17 +2030,17 @@ var Hn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Wn =
2030
2030
  return x(cr, this);
2031
2031
  }
2032
2032
  get hcmFilter() {
2033
- return R(this, "hcmFilter", x(Or, this) ? x(lr, this).addHCMFilter(x(Or, this).foreground, x(Or, this).background) : "none");
2033
+ return L(this, "hcmFilter", x(Or, this) ? x(lr, this).addHCMFilter(x(Or, this).foreground, x(Or, this).background) : "none");
2034
2034
  }
2035
2035
  get direction() {
2036
- return R(this, "direction", getComputedStyle(x(Pr, this)).direction);
2036
+ return L(this, "direction", getComputedStyle(x(Pr, this)).direction);
2037
2037
  }
2038
2038
  get _highlightColors() {
2039
- return R(this, "_highlightColors", x(fr, this) ? new Map(x(fr, this).split(",").map((e) => (e = e.split("=").map((e) => e.trim()), e[1] = e[1].toUpperCase(), e))) : null);
2039
+ return L(this, "_highlightColors", x(fr, this) ? new Map(x(fr, this).split(",").map((e) => (e = e.split("=").map((e) => e.trim()), e[1] = e[1].toUpperCase(), e))) : null);
2040
2040
  }
2041
2041
  get highlightColors() {
2042
2042
  let { _highlightColors: e } = this;
2043
- if (!e) return R(this, "highlightColors", null);
2043
+ if (!e) return L(this, "highlightColors", null);
2044
2044
  let t = /* @__PURE__ */ new Map(), n = !!x(Or, this);
2045
2045
  for (let [r, i] of e) {
2046
2046
  let e = r.endsWith("_HCM");
@@ -2050,10 +2050,10 @@ var Hn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Wn =
2050
2050
  }
2051
2051
  !n && !e && t.set(r, i);
2052
2052
  }
2053
- return R(this, "highlightColors", t);
2053
+ return L(this, "highlightColors", t);
2054
2054
  }
2055
2055
  get highlightColorNames() {
2056
- return R(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, (e) => e.reverse())) : null);
2056
+ return L(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, (e) => e.reverse())) : null);
2057
2057
  }
2058
2058
  getNonHCMColor(e) {
2059
2059
  if (!this._highlightColors) return e;
@@ -2705,7 +2705,7 @@ var Hn = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Wn =
2705
2705
  return x(wr, this) !== N.NONE;
2706
2706
  }
2707
2707
  get imageManager() {
2708
- return R(this, "imageManager", new jn());
2708
+ return L(this, "imageManager", new jn());
2709
2709
  }
2710
2710
  getSelectionBoxes(e) {
2711
2711
  if (!e) return null;
@@ -3289,7 +3289,7 @@ function $i(e) {
3289
3289
  var ea = /* @__PURE__ */ new WeakMap(), ta = /* @__PURE__ */ new WeakMap(), na = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), ra = /* @__PURE__ */ new WeakMap(), ia = /* @__PURE__ */ new WeakMap(), aa = /* @__PURE__ */ new WeakMap(), oa = /* @__PURE__ */ new WeakMap(), sa = /* @__PURE__ */ new WeakMap(), ca = /* @__PURE__ */ new WeakMap(), la = /* @__PURE__ */ new WeakMap(), ua = /* @__PURE__ */ new WeakMap(), da = /* @__PURE__ */ new WeakMap(), fa = /* @__PURE__ */ new WeakMap(), pa = /* @__PURE__ */ new WeakMap(), ma = /* @__PURE__ */ new WeakMap(), ha = /* @__PURE__ */ new WeakMap(), ga = /* @__PURE__ */ new WeakMap(), _a = /* @__PURE__ */ new WeakMap(), va = /* @__PURE__ */ new WeakMap(), ya = /* @__PURE__ */ new WeakMap(), ba = /* @__PURE__ */ new WeakMap(), xa = /* @__PURE__ */ new WeakMap(), Sa = /* @__PURE__ */ new WeakMap(), Ca = /* @__PURE__ */ new WeakMap(), wa = /* @__PURE__ */ new WeakMap(), U = /* @__PURE__ */ new WeakSet(), W = class e {
3290
3290
  static get _resizerKeyboardManager() {
3291
3291
  let t = e.prototype._resizeWithKeyboard, n = Rr.TRANSLATE_SMALL, r = Rr.TRANSLATE_BIG;
3292
- return R(this, "_resizerKeyboardManager", new Rn([
3292
+ return L(this, "_resizerKeyboardManager", new Rn([
3293
3293
  [
3294
3294
  ["ArrowLeft"],
3295
3295
  t,
@@ -3353,7 +3353,7 @@ var ea = /* @__PURE__ */ new WeakMap(), ta = /* @__PURE__ */ new WeakMap(), na =
3353
3353
  return !1;
3354
3354
  }
3355
3355
  static get _defaultLineColor() {
3356
- return R(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
3356
+ return L(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
3357
3357
  }
3358
3358
  static deleteAnnotationElement(e) {
3359
3359
  let t = new Wa({
@@ -3532,16 +3532,16 @@ var ea = /* @__PURE__ */ new WeakMap(), ta = /* @__PURE__ */ new WeakMap(), na =
3532
3532
  let { div: { style: t }, pageDimensions: [n, r] } = this, { x: i, y: a, width: o, height: s } = this;
3533
3533
  if (o *= n, s *= r, i *= n, a *= r, this._mustFixPosition) switch (e) {
3534
3534
  case 0:
3535
- i = lt(i, 0, n - o), a = lt(a, 0, r - s);
3535
+ i = B(i, 0, n - o), a = B(a, 0, r - s);
3536
3536
  break;
3537
3537
  case 90:
3538
- i = lt(i, 0, n - s), a = lt(a, o, r);
3538
+ i = B(i, 0, n - s), a = B(a, o, r);
3539
3539
  break;
3540
3540
  case 180:
3541
- i = lt(i, o, n), a = lt(a, s, r);
3541
+ i = B(i, o, n), a = B(a, s, r);
3542
3542
  break;
3543
3543
  case 270:
3544
- i = lt(i, s, n), a = lt(a, 0, r - o);
3544
+ i = B(i, s, n), a = B(a, 0, r - o);
3545
3545
  break;
3546
3546
  }
3547
3547
  this.x = i /= n, this.y = a /= r;
@@ -3754,7 +3754,7 @@ var ea = /* @__PURE__ */ new WeakMap(), ta = /* @__PURE__ */ new WeakMap(), na =
3754
3754
  }))), this.addStandaloneCommentButton(), (e = this._uiManager._editorUndoBar) == null || e.hide(), t;
3755
3755
  }
3756
3756
  pointerdown(e) {
3757
- let { isMac: t } = z.platform;
3757
+ let { isMac: t } = R.platform;
3758
3758
  if (e.button !== 0 || e.ctrlKey && t) {
3759
3759
  e.preventDefault();
3760
3760
  return;
@@ -4216,7 +4216,7 @@ function Oa() {
4216
4216
  function ka(e, t) {
4217
4217
  var n;
4218
4218
  t.preventDefault();
4219
- let { isMac: r } = z.platform;
4219
+ let { isMac: r } = R.platform;
4220
4220
  if (t.button !== 0 || t.ctrlKey && r) return;
4221
4221
  (n = x(na, this)) == null || n.toggle(!1);
4222
4222
  let i = this._isDraggable;
@@ -4294,7 +4294,7 @@ function Ma(e, t) {
4294
4294
  if ([O, k] = m(O / n, k / r), _) {
4295
4295
  let e = Math.hypot(o, s);
4296
4296
  E = D = Math.max(Math.min(Math.hypot(b[0] - y[0] - O, b[1] - y[1] - k) / e, 1 / o, 1 / s), c / o, l / s);
4297
- } else v ? E = lt(Math.abs(b[0] - y[0] - O), c, 1) / o : D = lt(Math.abs(b[1] - y[1] - k), l, 1) / s;
4297
+ } else v ? E = B(Math.abs(b[0] - y[0] - O), c, 1) / o : D = B(Math.abs(b[1] - y[1] - k), l, 1) / s;
4298
4298
  let A = re._round(o * E), ee = re._round(s * D);
4299
4299
  S = d(...g(A, ee));
4300
4300
  let j = w - S[0], te = T - S[1];
@@ -4335,7 +4335,7 @@ function Fa() {
4335
4335
  (e = x(na, this)) == null || e.toggle(!0), this.parent.togglePointerEvents(!0), f(U, this, ja).call(this);
4336
4336
  }
4337
4337
  function Ia(e) {
4338
- let { isMac: t } = z.platform;
4338
+ let { isMac: t } = R.platform;
4339
4339
  e.ctrlKey && !t || e.shiftKey || e.metaKey && t ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
4340
4340
  }
4341
4341
  function La(e) {
@@ -4503,7 +4503,7 @@ var to = class {
4503
4503
  for (let [e, t] of Object.entries(s)) {
4504
4504
  var a;
4505
4505
  if (e === "type") continue;
4506
- let n = l.getOrInsertComputed(e, st);
4506
+ let n = l.getOrInsertComputed(e, ct);
4507
4507
  n.set(t, ((a = n.get(t)) == null ? 0 : a) + 1);
4508
4508
  }
4509
4509
  }
@@ -4569,7 +4569,7 @@ var ro = /* @__PURE__ */ new WeakMap(), io = class extends to {
4569
4569
  return x(ro, this);
4570
4570
  }
4571
4571
  get modifiedIds() {
4572
- return R(this, "modifiedIds", {
4572
+ return L(this, "modifiedIds", {
4573
4573
  ids: /* @__PURE__ */ new Set(),
4574
4574
  hash: ""
4575
4575
  });
@@ -4662,7 +4662,7 @@ var uo = new Uint32Array(new Uint8Array([
4662
4662
  return n !== void 0 && (t == null || t(n, e), x(xo, this)[e] = x(xo, this)[n]), this;
4663
4663
  }
4664
4664
  pushBaseTransform(e) {
4665
- return x(go, this).push(B.multiplyByDOMMatrix(x(go, this).at(-1), e.getTransform())), this;
4665
+ return x(go, this).push(z.multiplyByDOMMatrix(x(go, this).at(-1), e.getTransform())), this;
4666
4666
  }
4667
4667
  popBaseTransform() {
4668
4668
  return x(go, this).length > 1 && x(go, this).pop(), this;
@@ -4671,33 +4671,33 @@ var uo = new Uint32Array(new Uint8Array([
4671
4671
  return this._pendingBBoxIdx !== e && (this._pendingBBoxIdx = e, x(_o, this).set(_e, 0)), this;
4672
4672
  }
4673
4673
  recordClipBox(e, t, n, r, i, a) {
4674
- let o = B.multiplyByDOMMatrix(x(go, this).at(-1), t.getTransform()), s = _e.slice();
4675
- B.axialAlignedBoundingBox([
4674
+ let o = z.multiplyByDOMMatrix(x(go, this).at(-1), t.getTransform()), s = _e.slice();
4675
+ z.axialAlignedBoundingBox([
4676
4676
  n,
4677
4677
  i,
4678
4678
  r,
4679
4679
  a
4680
4680
  ], o, s);
4681
- let c = B.intersect(x(G, this), s);
4681
+ let c = z.intersect(x(G, this), s);
4682
4682
  return c ? (x(G, this)[0] = c[0], x(G, this)[1] = c[1], x(G, this)[2] = c[2], x(G, this)[3] = c[3]) : (x(G, this)[0] = x(G, this)[1] = Infinity, x(G, this)[2] = x(G, this)[3] = -Infinity), this;
4683
4683
  }
4684
4684
  recordBBox(e, t, n, r, i, a) {
4685
4685
  let o = x(G, this);
4686
4686
  if (o[0] === Infinity) return this;
4687
- let s = B.multiplyByDOMMatrix(x(go, this).at(-1), t.getTransform());
4688
- if (o[0] === -Infinity) return B.axialAlignedBoundingBox([
4687
+ let s = z.multiplyByDOMMatrix(x(go, this).at(-1), t.getTransform());
4688
+ if (o[0] === -Infinity) return z.axialAlignedBoundingBox([
4689
4689
  n,
4690
4690
  i,
4691
4691
  r,
4692
4692
  a
4693
4693
  ], s, x(_o, this)), this;
4694
4694
  let c = _e.slice();
4695
- return B.axialAlignedBoundingBox([
4695
+ return z.axialAlignedBoundingBox([
4696
4696
  n,
4697
4697
  i,
4698
4698
  r,
4699
4699
  a
4700
- ], s, c), x(_o, this)[0] = lt(c[0], o[0], x(_o, this)[0]), x(_o, this)[1] = lt(c[1], o[1], x(_o, this)[1]), x(_o, this)[2] = lt(c[2], x(_o, this)[2], o[2]), x(_o, this)[3] = lt(c[3], x(_o, this)[3], o[3]), this;
4700
+ ], s, c), x(_o, this)[0] = B(c[0], o[0], x(_o, this)[0]), x(_o, this)[1] = B(c[1], o[1], x(_o, this)[1]), x(_o, this)[2] = B(c[2], x(_o, this)[2], o[2]), x(_o, this)[3] = B(c[3], x(_o, this)[3], o[3]), this;
4701
4701
  }
4702
4702
  recordFullPageBBox(e) {
4703
4703
  return x(_o, this)[0] = Math.max(0, x(G, this)[0]), x(_o, this)[1] = Math.max(0, x(G, this)[1]), x(_o, this)[2] = Math.min(x(vo, this), x(G, this)[2]), x(_o, this)[3] = Math.min(x(yo, this), x(G, this)[3]), this;
@@ -4855,7 +4855,7 @@ var To = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), Do =
4855
4855
  0,
4856
4856
  0,
4857
4857
  0
4858
- ], B.axialAlignedBoundingBox(s, n.fontMatrix, l), (r !== 1 || i !== 0 || a !== 0) && lo(r, -r, i, a, l), c))) return this.recordBBox(e, t, l[0], l[2], l[1], l[3]);
4858
+ ], z.axialAlignedBoundingBox(s, n.fontMatrix, l), (r !== 1 || i !== 0 || a !== 0) && lo(r, -r, i, a, l), c))) return this.recordBBox(e, t, l[0], l[2], l[1], l[3]);
4859
4859
  if (!o) return this.recordFullPageBBox(e);
4860
4860
  let u = o();
4861
4861
  return s && l && c === void 0 && (c = l[0] <= i - u.actualBoundingBoxLeft && l[2] >= i + u.actualBoundingBoxRight && l[1] <= a - u.actualBoundingBoxAscent && l[3] >= a + u.actualBoundingBoxDescent, x(ko, this).set(n, c), c) ? this.recordBBox(e, t, l[0], l[2], l[1], l[3]) : this.recordBBox(e, t, i - u.actualBoundingBoxLeft, i + u.actualBoundingBoxRight, a - u.actualBoundingBoxAscent, a + u.actualBoundingBoxDescent);
@@ -5081,13 +5081,13 @@ var To = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), Do =
5081
5081
  let a = jt(e), o;
5082
5082
  if (r[0] !== Infinity) {
5083
5083
  let e = _e.slice();
5084
- B.axialAlignedBoundingBox([
5084
+ z.axialAlignedBoundingBox([
5085
5085
  0,
5086
5086
  -n,
5087
5087
  t,
5088
5088
  0
5089
5089
  ], a, e);
5090
- let i = B.intersect(r, e);
5090
+ let i = z.intersect(r, e);
5091
5091
  if (!i) return;
5092
5092
  let [s, c, l, u] = i;
5093
5093
  if (s !== e[0] || c !== e[1] || l !== e[2] || u !== e[3]) {
@@ -5120,12 +5120,12 @@ var To = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), Do =
5120
5120
  0,
5121
5121
  t,
5122
5122
  -n
5123
- ], B.applyTransform(o, a, 0), B.applyTransform(o, a, 2), B.applyTransform(o, a, 4)), o[0] /= x(Vo, this), o[1] /= x(Ho, this), o[2] /= x(Vo, this), o[3] /= x(Ho, this), o[4] /= x(Vo, this), o[5] /= x(Ho, this), x(Go, this).set(o, x(Wo, this) * 6), C(Wo, this, (i = x(Wo, this), i++, i));
5123
+ ], z.applyTransform(o, a, 0), z.applyTransform(o, a, 2), z.applyTransform(o, a, 4)), o[0] /= x(Vo, this), o[1] /= x(Ho, this), o[2] /= x(Vo, this), o[3] /= x(Ho, this), o[4] /= x(Vo, this), o[5] /= x(Ho, this), x(Go, this).set(o, x(Wo, this) * 6), C(Wo, this, (i = x(Wo, this), i++, i));
5124
5124
  }
5125
5125
  take() {
5126
5126
  return x(Go, this).subarray(0, x(Wo, this) * 6);
5127
5127
  }
5128
- }, qo = { _: z.isFloat16ArraySupported ? Float16Array : Float32Array }, Jo = /* @__PURE__ */ new WeakMap(), Yo = /* @__PURE__ */ new WeakMap(), Xo = /* @__PURE__ */ new WeakSet(), Zo = class {
5128
+ }, qo = { _: R.isFloat16ArraySupported ? Float16Array : Float32Array }, Jo = /* @__PURE__ */ new WeakMap(), Yo = /* @__PURE__ */ new WeakMap(), Xo = /* @__PURE__ */ new WeakSet(), Zo = class {
5129
5129
  constructor({ ownerDocument: e = globalThis.document, styleElement: t = null }) {
5130
5130
  S(this, Xo), b(this, Jo, /* @__PURE__ */ new Set()), b(this, Yo, null), this._document = e, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
5131
5131
  }
@@ -5151,7 +5151,7 @@ var To = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), Do =
5151
5151
  var r = this;
5152
5152
  return v(function* () {
5153
5153
  if (!(!e || x(Jo, r).has(e.loadedName))) {
5154
- if (L(!t, "loadSystemFont shouldn't be called when `disableFontFace` is set."), r.isFontLoadingAPISupported) {
5154
+ if (ze(!t, "loadSystemFont shouldn't be called when `disableFontFace` is set."), r.isFontLoadingAPISupported) {
5155
5155
  let { loadedName: t, src: i, style: a } = e, o = new FontFace(t, i, a);
5156
5156
  r.addNativeFontFace(o);
5157
5157
  try {
@@ -5198,14 +5198,14 @@ var To = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), Do =
5198
5198
  get isFontLoadingAPISupported() {
5199
5199
  var e;
5200
5200
  let t = !!((e = this._document) != null && e.fonts);
5201
- return R(this, "isFontLoadingAPISupported", t);
5201
+ return L(this, "isFontLoadingAPISupported", t);
5202
5202
  }
5203
5203
  get isSyncFontLoadingSupported() {
5204
- return R(this, "isSyncFontLoadingSupported", ge || z.platform.isFirefox);
5204
+ return L(this, "isSyncFontLoadingSupported", ge || R.platform.isFirefox);
5205
5205
  }
5206
5206
  _queueLoadingCallback(e) {
5207
5207
  function t() {
5208
- for (L(!r.done, "completeRequest() cannot be called twice."), r.done = !0; n.length > 0 && n[0].done;) {
5208
+ for (ze(!r.done, "completeRequest() cannot be called twice."), r.done = !0; n.length > 0 && n[0].done;) {
5209
5209
  let e = n.shift();
5210
5210
  setTimeout(e.callback, 0);
5211
5211
  }
@@ -5219,7 +5219,7 @@ var To = /* @__PURE__ */ new WeakMap(), Eo = /* @__PURE__ */ new WeakMap(), Do =
5219
5219
  }
5220
5220
  get _loadTestFont() {
5221
5221
  let e = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
5222
- return R(this, "_loadTestFont", e);
5222
+ return L(this, "_loadTestFont", e);
5223
5223
  }
5224
5224
  _prepareFontLoadEvent(e, t) {
5225
5225
  function n(e, t) {
@@ -5324,7 +5324,7 @@ var $o = /* @__PURE__ */ new WeakMap(), es = class {
5324
5324
  return x($o, this).disableFontFace;
5325
5325
  }
5326
5326
  set disableFontFace(e) {
5327
- R(this, "disableFontFace", !!e);
5327
+ L(this, "disableFontFace", !!e);
5328
5328
  }
5329
5329
  get fontExtraProperties() {
5330
5330
  return x($o, this).fontExtraProperties;
@@ -5441,7 +5441,7 @@ var as = /* @__PURE__ */ new WeakMap(), os = /* @__PURE__ */ new WeakMap(), ss =
5441
5441
  }
5442
5442
  };
5443
5443
  function us(e) {
5444
- L(e < ts.strings.length, "Invalid string index");
5444
+ ze(e < ts.strings.length, "Invalid string index");
5445
5445
  let t = 0;
5446
5446
  for (let n = 0; n < e; n++) t += x(ss, this).getUint32(t) + 4;
5447
5447
  let n = x(ss, this).getUint32(t);
@@ -5479,7 +5479,7 @@ var ds = /* @__PURE__ */ new WeakMap(), fs = /* @__PURE__ */ new WeakMap(), ps =
5479
5479
  }
5480
5480
  };
5481
5481
  function gs(e) {
5482
- L(e < ns.strings.length, "Invalid string index");
5482
+ ze(e < ns.strings.length, "Invalid string index");
5483
5483
  let t = 5;
5484
5484
  for (let n = 0; n < e; n++) t += x(ps, this).getUint32(t) + 4;
5485
5485
  let n = x(ps, this).getUint32(t);
@@ -5577,23 +5577,23 @@ var _s = /* @__PURE__ */ new WeakMap(), vs = /* @__PURE__ */ new WeakMap(), ys =
5577
5577
  }
5578
5578
  };
5579
5579
  function Ss(e) {
5580
- L(e < rs.bools.length, "Invalid boolean index");
5580
+ ze(e < rs.bools.length, "Invalid boolean index");
5581
5581
  let t = Math.floor(e / 4), n = e * 2 % 8, r = x(ys, this).getUint8(t) >> n & 3;
5582
5582
  return r === 0 ? void 0 : r === 2;
5583
5583
  }
5584
5584
  function Cs(e) {
5585
- return L(e < rs.numbers.length, "Invalid number index"), x(ys, this).getFloat64(rs.OFFSET_NUMBERS + e * 8);
5585
+ return ze(e < rs.numbers.length, "Invalid number index"), x(ys, this).getFloat64(rs.OFFSET_NUMBERS + e * 8);
5586
5586
  }
5587
5587
  function ws(e, t, n, r) {
5588
5588
  let i = x(ys, this).getUint8(e);
5589
5589
  if (i === 0) return;
5590
- L(i === t, "Invalid array length."), e += 1;
5590
+ ze(i === t, "Invalid array length."), e += 1;
5591
5591
  let a = Array(i);
5592
5592
  for (let t = 0; t < i; t++) a[t] = x(ys, this)[n](e, !0), e += r;
5593
5593
  return a;
5594
5594
  }
5595
5595
  function Ts(e) {
5596
- L(e < rs.strings.length, "Invalid string index");
5596
+ ze(e < rs.strings.length, "Invalid string index");
5597
5597
  let t = rs.OFFSET_STRINGS + 4;
5598
5598
  for (let n = 0; n < e; n++) t += x(ys, this).getUint32(t) + 4;
5599
5599
  let n = x(ys, this).getUint32(t);
@@ -5658,7 +5658,7 @@ var Ds = class {
5658
5658
  let e = this.data[is.SHADING_TYPE], t = null;
5659
5659
  if (c.length > 0) {
5660
5660
  t = _e.slice();
5661
- for (let e = 0, n = c.length; e < n; e += 2) B.pointBoundingBox(c[e], c[e + 1], t);
5661
+ for (let e = 0, n = c.length; e < n; e += 2) z.pointBoundingBox(c[e], c[e + 1], t);
5662
5662
  }
5663
5663
  return [
5664
5664
  "Mesh",
@@ -5678,7 +5678,7 @@ var Ds = class {
5678
5678
  b(this, Os, void 0), C(Os, this, e);
5679
5679
  }
5680
5680
  get path() {
5681
- return z.isFloat16ArraySupported ? new Float16Array(x(Os, this)) : new Float32Array(x(Os, this));
5681
+ return R.isFloat16ArraySupported ? new Float16Array(x(Os, this)) : new Float32Array(x(Os, this));
5682
5682
  }
5683
5683
  };
5684
5684
  function As(e) {
@@ -5697,7 +5697,7 @@ function As(e) {
5697
5697
  function js(e) {
5698
5698
  if (ge && typeof Buffer < "u" && e instanceof Buffer) throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
5699
5699
  if (e instanceof Uint8Array && e.byteLength === e.buffer.byteLength) return e;
5700
- if (typeof e == "string") return Ze(e);
5700
+ if (typeof e == "string") return Qe(e);
5701
5701
  if (e instanceof ArrayBuffer || ArrayBuffer.isView(e) || typeof e == "object" && !isNaN(e == null ? void 0 : e.length)) return new Uint8Array(e);
5702
5702
  throw Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
5703
5703
  }
@@ -5706,7 +5706,7 @@ function Ms(e) {
5706
5706
  if (e.endsWith("/")) return e;
5707
5707
  throw Error(`Invalid factory url: "${e}" must include trailing slash.`);
5708
5708
  }
5709
- var Ns = (e) => typeof e == "object" && Number.isInteger(e == null ? void 0 : e.num) && e.num >= 0 && Number.isInteger(e == null ? void 0 : e.gen) && e.gen >= 0, Ps = at.bind(null, Ns, (e) => typeof e == "object" && typeof (e == null ? void 0 : e.name) == "string"), Fs = /* @__PURE__ */ new WeakMap(), Is = /* @__PURE__ */ new WeakMap(), Ls = class {
5709
+ var Ns = (e) => typeof e == "object" && Number.isInteger(e == null ? void 0 : e.num) && e.num >= 0 && Number.isInteger(e == null ? void 0 : e.gen) && e.gen >= 0, Ps = ot.bind(null, Ns, (e) => typeof e == "object" && typeof (e == null ? void 0 : e.name) == "string"), Fs = /* @__PURE__ */ new WeakMap(), Is = /* @__PURE__ */ new WeakMap(), Ls = class {
5710
5710
  constructor() {
5711
5711
  b(this, Fs, /* @__PURE__ */ new Map()), b(this, Is, Promise.resolve());
5712
5712
  }
@@ -5752,15 +5752,15 @@ var Ns = (e) => typeof e == "object" && Number.isInteger(e == null ? void 0 : e.
5752
5752
  };
5753
5753
  function Bs() {}
5754
5754
  function Vs(e) {
5755
- if (e instanceof Ye || e instanceof Ke || e instanceof We || e instanceof qe || e instanceof Ge) return e;
5755
+ if (e instanceof Xe || e instanceof qe || e instanceof Ge || e instanceof Je || e instanceof Ke) return e;
5756
5756
  switch (e instanceof Error || typeof e == "object" && e || I("wrapReason: Expected \"reason\" to be a (possibly cloned) Error."), e.name) {
5757
- case "AbortException": return new Ye(e.message);
5758
- case "InvalidPDFException": return new Ke(e.message);
5759
- case "PasswordException": return new We(e.message, e.code);
5760
- case "ResponseException": return new qe(e.message, e.status, e.missing);
5761
- case "UnknownErrorException": return new Ge(e.message, e.details);
5757
+ case "AbortException": return new Xe(e.message);
5758
+ case "InvalidPDFException": return new qe(e.message);
5759
+ case "PasswordException": return new Ge(e.message, e.code);
5760
+ case "ResponseException": return new Je(e.message, e.status, e.missing);
5761
+ case "UnknownErrorException": return new Ke(e.message, e.details);
5762
5762
  }
5763
- return new Ge(e.message, e.toString());
5763
+ return new Ke(e.message, e.toString());
5764
5764
  }
5765
5765
  var Hs = /* @__PURE__ */ new WeakMap(), Us = /* @__PURE__ */ new WeakSet(), Ws = class {
5766
5766
  constructor(e, t, n) {
@@ -5826,7 +5826,7 @@ var Hs = /* @__PURE__ */ new WeakMap(), Us = /* @__PURE__ */ new WeakSet(), Ws =
5826
5826
  }), t.promise;
5827
5827
  },
5828
5828
  cancel: (e) => {
5829
- L(e instanceof Error, "cancel must have a valid reason");
5829
+ ze(e instanceof Error, "cancel must have a valid reason");
5830
5830
  let t = Promise.withResolvers();
5831
5831
  return this.streamControllers[i].cancelCall = t, this.streamControllers[i].isClosed = !0, s.postMessage({
5832
5832
  sourceName: a,
@@ -5908,7 +5908,7 @@ function Ks(e) {
5908
5908
  }), delete a.streamSinks[t]);
5909
5909
  },
5910
5910
  error(e) {
5911
- L(e instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, i.postMessage({
5911
+ ze(e instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, i.postMessage({
5912
5912
  sourceName: n,
5913
5913
  targetName: r,
5914
5914
  stream: zs.ERROR,
@@ -5980,15 +5980,15 @@ function qs(e) {
5980
5980
  });
5981
5981
  break;
5982
5982
  case zs.ENQUEUE:
5983
- if (L(a, "enqueue should have stream controller"), a.isClosed) break;
5983
+ if (ze(a, "enqueue should have stream controller"), a.isClosed) break;
5984
5984
  a.controller.enqueue(e.chunk);
5985
5985
  break;
5986
5986
  case zs.CLOSE:
5987
- if (L(a, "close should have stream controller"), a.isClosed) break;
5987
+ if (ze(a, "close should have stream controller"), a.isClosed) break;
5988
5988
  a.isClosed = !0, a.controller.close(), f(Us, this, Js).call(this, a, t);
5989
5989
  break;
5990
5990
  case zs.ERROR:
5991
- L(a, "error should have stream controller"), a.controller.error(Vs(e.reason)), f(Us, this, Js).call(this, a, t);
5991
+ ze(a, "error should have stream controller"), a.controller.error(Vs(e.reason)), f(Us, this, Js).call(this, a, t);
5992
5992
  break;
5993
5993
  case zs.CANCEL_COMPLETE:
5994
5994
  e.success ? a.cancelCall.resolve() : a.cancelCall.reject(Vs(e.reason)), f(Us, this, Js).call(this, a, t);
@@ -6062,7 +6062,7 @@ var Ys = /* @__PURE__ */ new WeakMap(), Xs = class {
6062
6062
  _fetch(e, t) {
6063
6063
  return v(function* () {
6064
6064
  let n = yield mt(e, t === "cMapUrl" && !e.endsWith(".bcmap") ? "text" : "bytes");
6065
- return n instanceof Uint8Array ? n : Ze(n);
6065
+ return n instanceof Uint8Array ? n : Qe(n);
6066
6066
  })();
6067
6067
  }
6068
6068
  }, Qs = /* @__PURE__ */ new WeakMap(), $s = class {
@@ -6156,9 +6156,9 @@ var Ys = /* @__PURE__ */ new WeakMap(), Xs = class {
6156
6156
  }, dc.call(f(K, this)).set(r, i);
6157
6157
  if (!e || !t) return i.url;
6158
6158
  let o = f(K, this, xc).call(this, e);
6159
- e = B.makeHexColor(...o);
6159
+ e = z.makeHexColor(...o);
6160
6160
  let s = f(K, this, xc).call(this, t);
6161
- if (t = B.makeHexColor(...s), fc.call(f(K, this)).style.color = "", e === "#000000" && t === "#ffffff" || e === t) return i.url;
6161
+ if (t = z.makeHexColor(...s), fc.call(f(K, this)).style.color = "", e === "#000000" && t === "#ffffff" || e === t) return i.url;
6162
6162
  let c = Array(256);
6163
6163
  for (let e = 0; e <= 255; e++) {
6164
6164
  let t = e / 255;
@@ -6181,7 +6181,7 @@ var Ys = /* @__PURE__ */ new WeakMap(), Xs = class {
6181
6181
  }
6182
6182
  createSelectionStyle(e = null) {
6183
6183
  let t = e ? this.addSelectionHCMFilter(e.foreground, e.background) : this.addSelectionFilter();
6184
- return t === "none" || !z.platform.isFirefox ? null : {
6184
+ return t === "none" || !R.platform.isFirefox ? null : {
6185
6185
  "backdrop-filter": t,
6186
6186
  "background-color": "transparent"
6187
6187
  };
@@ -6293,7 +6293,7 @@ function mc(e) {
6293
6293
  if (x(nc, this) === void 0) {
6294
6294
  C(nc, this, "");
6295
6295
  let e = x(oc, this).URL;
6296
- e !== x(oc, this).baseURI && (_t(e) ? F("#createUrl: ignore \"data:\"-URL for performance reasons.") : C(nc, this, Ve(e, "")));
6296
+ e !== x(oc, this).baseURI && (_t(e) ? F("#createUrl: ignore \"data:\"-URL for performance reasons.") : C(nc, this, He(e, "")));
6297
6297
  }
6298
6298
  return `url(${x(nc, this)}#${e})`;
6299
6299
  }
@@ -6366,7 +6366,7 @@ var Dc = class extends tc {}, Oc = class extends $s {
6366
6366
  }
6367
6367
  };
6368
6368
  function Ac({ src: e, srcPos: t = 0, dest: n, width: r, height: i, nonBlackColor: a = 4294967295, inverseDecode: o = !1 }) {
6369
- let s = z.isLittleEndian ? 4278190080 : 255, [c, l] = o ? [a, s] : [s, a], u = r >> 3, d = r & 7, f = c ^ l, p = e.length;
6369
+ let s = R.isLittleEndian ? 4278190080 : 255, [c, l] = o ? [a, s] : [s, a], u = r >> 3, d = r & 7, f = c ^ l, p = e.length;
6370
6370
  n = new Uint32Array(n.buffer);
6371
6371
  let m = 0;
6372
6372
  for (let r = 0; r < i; ++r) {
@@ -6384,8 +6384,8 @@ function Ac({ src: e, srcPos: t = 0, dest: n, width: r, height: i, nonBlackColor
6384
6384
  };
6385
6385
  }
6386
6386
  function jc({ src: e, srcPos: t = 0, dest: n, destPos: r = 0, width: i, height: a }) {
6387
- let o = 0, s = i * a * 3, c = s >> 2, l = new Uint32Array(e.buffer, t, c), u = z.isLittleEndian ? 4278190080 : 255;
6388
- if (z.isLittleEndian) {
6387
+ let o = 0, s = i * a * 3, c = s >> 2, l = new Uint32Array(e.buffer, t, c), u = R.isLittleEndian ? 4278190080 : 255;
6388
+ if (R.isLittleEndian) {
6389
6389
  for (; o < c - 2; o += 3, r += 4) {
6390
6390
  let e = l[o], t = l[o + 1], i = l[o + 2];
6391
6391
  n[r] = e | u, n[r + 1] = e >>> 24 | t << 8 | u, n[r + 2] = t >>> 16 | i << 16 | u, n[r + 3] = i >>> 8 | u;
@@ -6562,12 +6562,12 @@ var qc = class {
6562
6562
  }
6563
6563
  _createGradient(e, t = null) {
6564
6564
  let n, r = this._p0, i = this._p1;
6565
- if (t && (r = r.slice(), i = i.slice(), B.applyTransform(r, t), B.applyTransform(i, t)), this._type === "axial") n = e.createLinearGradient(r[0], r[1], i[0], i[1]);
6565
+ if (t && (r = r.slice(), i = i.slice(), z.applyTransform(r, t), z.applyTransform(i, t)), this._type === "axial") n = e.createLinearGradient(r[0], r[1], i[0], i[1]);
6566
6566
  else if (this._type === "radial") {
6567
6567
  let a = this._r0, o = this._r1;
6568
6568
  if (t) {
6569
6569
  let e = /* @__PURE__ */ new Float32Array(2);
6570
- B.singularValueDecompose2dScale(t, e), a *= e[0], o *= e[0];
6570
+ z.singularValueDecompose2dScale(t, e), a *= e[0], o *= e[0];
6571
6571
  }
6572
6572
  n = e.createRadialGradient(r[0], r[1], a, i[0], i[1], o);
6573
6573
  }
@@ -6576,11 +6576,11 @@ var qc = class {
6576
6576
  }
6577
6577
  _createReversedGradient(e, t = null) {
6578
6578
  let n = this._p1, r = this._p0;
6579
- t && (n = n.slice(), r = r.slice(), B.applyTransform(n, t), B.applyTransform(r, t));
6579
+ t && (n = n.slice(), r = r.slice(), z.applyTransform(n, t), z.applyTransform(r, t));
6580
6580
  let i = this._r1, a = this._r0;
6581
6581
  if (t) {
6582
6582
  let e = /* @__PURE__ */ new Float32Array(2);
6583
- B.singularValueDecompose2dScale(t, e), i *= e[0], a *= e[0];
6583
+ z.singularValueDecompose2dScale(t, e), i *= e[0], a *= e[0];
6584
6584
  }
6585
6585
  let o = e.createRadialGradient(n[0], n[1], i, r[0], r[1], a), s = this._colorStops.map(([e, t]) => [1 - e, t]).reverse();
6586
6586
  for (let [e, t] of s) o.addColorStop(e, t);
@@ -6590,8 +6590,8 @@ var qc = class {
6590
6590
  let i;
6591
6591
  if (r === Gc.STROKE || r === Gc.FILL) {
6592
6592
  if (this.isOriginBased()) {
6593
- let r = B.transform(n, t.baseTransform);
6594
- this.matrix && (r = B.transform(r, this.matrix));
6593
+ let r = z.transform(n, t.baseTransform);
6594
+ this.matrix && (r = z.transform(r, this.matrix));
6595
6595
  let i = .001, a = Math.hypot(r[0], r[1]), o = Math.hypot(r[2], r[3]), s = (r[0] * r[2] + r[1] * r[3]) / (a * o);
6596
6596
  if (Math.abs(s) < i) if (this.isRadial()) {
6597
6597
  if (Math.abs(a - o) < i) return this._createGradient(e, r);
@@ -6603,7 +6603,7 @@ var qc = class {
6603
6603
  0,
6604
6604
  0
6605
6605
  ], o = Math.ceil(a[2] - a[0]) || 1, s = Math.ceil(a[3] - a[1]) || 1, c = t.canvasFactory.create(o, s), l = c.context;
6606
- l.clearRect(0, 0, l.canvas.width, l.canvas.height), l.beginPath(), l.rect(0, 0, l.canvas.width, l.canvas.height), l.translate(-a[0], -a[1]), n = B.transform(n, [
6606
+ l.clearRect(0, 0, l.canvas.width, l.canvas.height), l.beginPath(), l.rect(0, 0, l.canvas.width, l.canvas.height), l.translate(-a[0], -a[1]), n = z.transform(n, [
6607
6607
  1,
6608
6608
  0,
6609
6609
  0,
@@ -6674,12 +6674,12 @@ var Xc = class extends qc {
6674
6674
  getPattern(e, t, n, r) {
6675
6675
  Kc(e, this._bbox);
6676
6676
  let i = /* @__PURE__ */ new Float32Array(2);
6677
- if (r === Gc.SHADING) B.singularValueDecompose2dScale(jt(e), i);
6677
+ if (r === Gc.SHADING) z.singularValueDecompose2dScale(jt(e), i);
6678
6678
  else if (this.matrix) {
6679
- B.singularValueDecompose2dScale(this.matrix, i);
6679
+ z.singularValueDecompose2dScale(this.matrix, i);
6680
6680
  let [e, n] = i;
6681
- B.singularValueDecompose2dScale(t.baseTransform, i), i[0] *= e, i[1] *= n;
6682
- } else B.singularValueDecompose2dScale(t.baseTransform, i);
6681
+ z.singularValueDecompose2dScale(t.baseTransform, i), i[0] *= e, i[1] *= n;
6682
+ } else z.singularValueDecompose2dScale(t.baseTransform, i);
6683
6683
  let a = this._createMeshCanvas(i, r === Gc.SHADING ? null : this._background, t.canvasFactory);
6684
6684
  r !== Gc.SHADING && (e.setTransform(...t.baseTransform), this.matrix && e.transform(...this.matrix)), e.translate(a.offsetX, a.offsetY), e.scale(a.scaleX, a.scaleY);
6685
6685
  let o = e.createPattern(a.canvas, "no-repeat");
@@ -6704,7 +6704,7 @@ var $c = {
6704
6704
  }, el = class e {
6705
6705
  constructor(e, t, n, r) {
6706
6706
  var i;
6707
- this.color = e[1], this.operatorList = e[2], this.matrix = e[3], this.bbox = e[4], this.xstep = e[5], this.ystep = e[6], this.paintType = e[7], this.tilingType = e[8], this.needsIsolation = (i = e[9]) == null || i, this.ctx = t, this.canvasGraphicsFactory = n, this.baseTransform = r, this.patternBaseMatrix = this.matrix ? B.transform(r, this.matrix) : r;
6707
+ this.color = e[1], this.operatorList = e[2], this.matrix = e[3], this.bbox = e[4], this.xstep = e[5], this.ystep = e[6], this.paintType = e[7], this.tilingType = e[8], this.needsIsolation = (i = e[9]) == null || i, this.ctx = t, this.canvasGraphicsFactory = n, this.baseTransform = r, this.patternBaseMatrix = this.matrix ? z.transform(r, this.matrix) : r;
6708
6708
  }
6709
6709
  canSkipPatternCanvas([e, t, n, r]) {
6710
6710
  let [i, a, o, s] = this.bbox, c = Math.abs(this.xstep), l = Math.abs(this.ystep);
@@ -6713,8 +6713,8 @@ var $c = {
6713
6713
  return d <= u && p <= f ? [u, f] : null;
6714
6714
  }
6715
6715
  updatePatternDims(e, t) {
6716
- let n = B.inverseTransform(this.patternBaseMatrix), r = [e[0], e[1]], i = [e[2], e[3]];
6717
- B.applyTransform(r, n), B.applyTransform(i, n), t[0] = Math.abs(i[0] - r[0]), t[1] = Math.abs(i[1] - r[1]), t[2] = Math.min(r[0], i[0]), t[3] = Math.min(r[1], i[1]);
6716
+ let n = z.inverseTransform(this.patternBaseMatrix), r = [e[0], e[1]], i = [e[2], e[3]];
6717
+ z.applyTransform(r, n), z.applyTransform(i, n), t[0] = Math.abs(i[0] - r[0]), t[1] = Math.abs(i[1] - r[1]), t[2] = Math.min(r[0], i[0]), t[3] = Math.min(r[1], i[1]);
6718
6718
  }
6719
6719
  _renderTileCanvas(e, t, n, r) {
6720
6720
  var i, a;
@@ -6723,9 +6723,9 @@ var $c = {
6723
6723
  }
6724
6724
  _getCombinedScales() {
6725
6725
  let e = /* @__PURE__ */ new Float32Array(2);
6726
- B.singularValueDecompose2dScale(this.matrix, e);
6726
+ z.singularValueDecompose2dScale(this.matrix, e);
6727
6727
  let [t, n] = e;
6728
- return B.singularValueDecompose2dScale(this.baseTransform, e), [t * e[0], n * e[1]];
6728
+ return z.singularValueDecompose2dScale(this.baseTransform, e), [t * e[0], n * e[1]];
6729
6729
  }
6730
6730
  drawPattern(e, t, n = !1, [r, i], a) {
6731
6731
  let [o, s, c, l] = this.bbox, u = e.dependencyTracker;
@@ -6773,7 +6773,7 @@ var $c = {
6773
6773
  }
6774
6774
  clipBbox(e, t, n, r, i) {
6775
6775
  let a = r - t, o = i - n, s = new Path2D();
6776
- s.rect(t, n, a, o), B.axialAlignedBoundingBox([
6776
+ s.rect(t, n, a, o), z.axialAlignedBoundingBox([
6777
6777
  t,
6778
6778
  n,
6779
6779
  r,
@@ -6790,14 +6790,14 @@ var $c = {
6790
6790
  case $c.UNCOLORED:
6791
6791
  r.fillStyle = r.strokeStyle = n, i.fillColor = i.strokeColor = n;
6792
6792
  break;
6793
- default: throw new Je(`Unsupported paint type: ${t}`);
6793
+ default: throw new Ye(`Unsupported paint type: ${t}`);
6794
6794
  }
6795
6795
  }
6796
6796
  isModifyingCurrentTransform() {
6797
6797
  return !1;
6798
6798
  }
6799
6799
  getPattern(e, t, n, r, i) {
6800
- let a = r === Gc.SHADING ? n : B.transform(n, this.patternBaseMatrix), o = this.createPatternCanvas(t, i), s = new DOMMatrix(a);
6800
+ let a = r === Gc.SHADING ? n : z.transform(n, this.patternBaseMatrix), o = this.createPatternCanvas(t, i), s = new DOMMatrix(a);
6801
6801
  s = s.translate(o.offsetX, o.offsetY), s = s.scale(1 / o.scaleX, 1 / o.scaleY);
6802
6802
  let c = e.createPattern(o.canvas, "repeat");
6803
6803
  return t.canvasFactory.destroy(o.canvasEntry), c.setTransform(s), c;
@@ -6871,14 +6871,14 @@ var ul = class {
6871
6871
  getPathBoundingBox(e = Gc.FILL, t = null) {
6872
6872
  let n = this.minMax.slice();
6873
6873
  if (e === Gc.STROKE) {
6874
- t || I("Stroke bounding box must include transform."), B.singularValueDecompose2dScale(t, sl);
6874
+ t || I("Stroke bounding box must include transform."), z.singularValueDecompose2dScale(t, sl);
6875
6875
  let e = sl[0] * this.lineWidth / 2, r = sl[1] * this.lineWidth / 2;
6876
6876
  n[0] -= e, n[1] -= r, n[2] += e, n[3] += r;
6877
6877
  }
6878
6878
  return n;
6879
6879
  }
6880
6880
  updateClipFromPath() {
6881
- let e = B.intersect(this.clipBox, this.getPathBoundingBox());
6881
+ let e = z.intersect(this.clipBox, this.getPathBoundingBox());
6882
6882
  this.startNewPathAndClipBox(e || [
6883
6883
  0,
6884
6884
  0,
@@ -6893,7 +6893,7 @@ var ul = class {
6893
6893
  this.clipBox.set(e, 0), this.minMax.set(ve, 0);
6894
6894
  }
6895
6895
  getClippedPathBoundingBox(e = Gc.FILL, t = null) {
6896
- return B.intersect(this.clipBox, this.getPathBoundingBox(e, t));
6896
+ return z.intersect(this.clipBox, this.getPathBoundingBox(e, t));
6897
6897
  }
6898
6898
  };
6899
6899
  function dl(e, t) {
@@ -6956,7 +6956,7 @@ function ml(e) {
6956
6956
  }
6957
6957
  function hl(e, t) {
6958
6958
  if (t) return !0;
6959
- B.singularValueDecompose2dScale(e, sl);
6959
+ z.singularValueDecompose2dScale(e, sl);
6960
6960
  let n = Math.fround(Pt.pixelRatio * pt.PDF_TO_CSS_UNITS);
6961
6961
  return sl[0] <= n && sl[1] <= n;
6962
6962
  }
@@ -7067,7 +7067,7 @@ var gl = [
7067
7067
  let r = this.ctx, { width: i, height: a } = t, o = this.current.fillColor, s = this.current.patternFill, c = jt(r), l, u, d, f;
7068
7068
  if ((t.bitmap || t.data) && t.count > 1) {
7069
7069
  let n = t.bitmap || t.data.buffer;
7070
- u = JSON.stringify(s ? c : [c.slice(0, 4), o]), l = this._cachedBitmapsMap.getOrInsertComputed(n, st);
7070
+ u = JSON.stringify(s ? c : [c.slice(0, 4), o]), l = this._cachedBitmapsMap.getOrInsertComputed(n, ct);
7071
7071
  let r = l.get(u);
7072
7072
  if (r && !s) {
7073
7073
  var p;
@@ -7081,7 +7081,7 @@ var gl = [
7081
7081
  d = r;
7082
7082
  }
7083
7083
  d || (f = this.canvasFactory.create(i, a), fl(f.context, t));
7084
- let m = B.transform(c, [
7084
+ let m = z.transform(c, [
7085
7085
  1 / i,
7086
7086
  0,
7087
7087
  0,
@@ -7089,7 +7089,7 @@ var gl = [
7089
7089
  0,
7090
7090
  0
7091
7091
  ]);
7092
- m = B.transform(m, [
7092
+ m = z.transform(m, [
7093
7093
  1,
7094
7094
  0,
7095
7095
  0,
@@ -7098,7 +7098,7 @@ var gl = [
7098
7098
  -a
7099
7099
  ]);
7100
7100
  let h = ve.slice();
7101
- B.axialAlignedBoundingBox([
7101
+ z.axialAlignedBoundingBox([
7102
7102
  0,
7103
7103
  0,
7104
7104
  i,
@@ -7112,7 +7112,7 @@ var gl = [
7112
7112
  d = e.img, E = e.tmpCanvas, d !== f.canvas && (this.canvasFactory.destroy(f), f = null), l && s && (l.set(u, d), E = null, f = null);
7113
7113
  }
7114
7114
  C.imageSmoothingEnabled = hl(jt(C), t.interpolate), ll(C, d, 0, 0, d.width, d.height, 0, 0, i, a), E && this.canvasFactory.destroy(E), f && this.canvasFactory.destroy(f), C.globalCompositeOperation = "source-in";
7115
- let D = B.transform(Mt(C), [
7115
+ let D = z.transform(Mt(C), [
7116
7116
  1,
7117
7117
  0,
7118
7118
  0,
@@ -7240,8 +7240,8 @@ var gl = [
7240
7240
  if (c.drawImage(e, t, n), a && (c.globalCompositeOperation = "destination-atop", c.fillStyle = a, c.fillRect(0, 0, r, i)), !o) return s;
7241
7241
  let l = this.canvasFactory.create(r, i), u = l.context;
7242
7242
  u.filter = o.url;
7243
- let d = z.isCanvasFilterSupported && u.filter !== "none" && u.filter !== "";
7244
- if (u.drawImage(s.canvas, 0, 0), z.isCanvasFilterSupported && (u.filter = "none"), !d) {
7243
+ let d = R.isCanvasFilterSupported && u.filter !== "none" && u.filter !== "";
7244
+ if (u.drawImage(s.canvas, 0, 0), R.isCanvasFilterSupported && (u.filter = "none"), !d) {
7245
7245
  let e = u.getImageData(0, 0, r, i), { data: t } = e, { transferMap: n } = o;
7246
7246
  if (o.subtype === "Luminosity") for (let e = 0, r = t.length; e < r; e += 4) {
7247
7247
  var f;
@@ -7341,10 +7341,10 @@ var gl = [
7341
7341
  let n = t === Me.stroke ? this.current.lineWidth / 2 : 0;
7342
7342
  this.dependencyTracker.resetBBox(e).recordBBox(e, this.ctx, r[0] - n, r[2] + n, r[1] - n, r[3] + n).recordDependencies(e, ["transform"]);
7343
7343
  }
7344
- i instanceof Path2D || (i = n[0] = Kt(i)), B.axialAlignedBoundingBox(r, jt(this.ctx), this.current.minMax);
7344
+ i instanceof Path2D || (i = n[0] = Kt(i)), z.axialAlignedBoundingBox(r, jt(this.ctx), this.current.minMax);
7345
7345
  let a = this.current.tilingPatternDims;
7346
7346
  if (a && t !== Me.stroke && t !== Me.closeStroke && this.current.fillColor instanceof el) {
7347
- let e = B.intersect(this.current.clipBox, this.current.minMax);
7347
+ let e = z.intersect(this.current.clipBox, this.current.minMax);
7348
7348
  e ? this.current.fillColor.updatePatternDims(e, a) : this.current.tilingPatternDims = null;
7349
7349
  }
7350
7350
  this[t](e, i), this._pathStartIdx = e;
@@ -7464,7 +7464,7 @@ var gl = [
7464
7464
  if (o.fontMatrix = a.fontMatrix || ye, (o.fontMatrix[0] === 0 || o.fontMatrix[3] === 0) && F("Invalid font matrix for font " + t), n < 0 ? (n = -n, o.fontDirection = -1) : o.fontDirection = 1, this.current.font = a, this.current.fontSize = n, a.isType3Font) return;
7465
7465
  let s = a.loadedName || "sans-serif", c = ((i = a.systemFontInfo) == null ? void 0 : i.css) || `"${s}", ${a.fallbackName}`, l = "normal";
7466
7466
  a.black ? l = "900" : a.bold && (l = "bold");
7467
- let u = a.italic ? "italic" : "normal", d = lt(n, tl, nl);
7467
+ let u = a.italic ? "italic" : "normal", d = B(n, tl, nl);
7468
7468
  this.current.fontSizeScale = n / d, this.ctx.font = `${u} ${l} ${d}px ${c}`;
7469
7469
  }
7470
7470
  setTextRenderingMode(e, t) {
@@ -7505,7 +7505,7 @@ var gl = [
7505
7505
  } else o.fill(g);
7506
7506
  if (d === De.STROKE || d === De.FILL_STROKE) if (a) {
7507
7507
  t || (t = o.getTransform()), o.setTransform(...a);
7508
- let { a: e, b: n, c: r, d: i } = t, s = B.inverseTransform(a), c = B.transform([
7508
+ let { a: e, b: n, c: r, d: i } = t, s = z.inverseTransform(a), c = z.transform([
7509
7509
  e,
7510
7510
  n,
7511
7511
  r,
@@ -7513,7 +7513,7 @@ var gl = [
7513
7513
  0,
7514
7514
  0
7515
7515
  ], s);
7516
- B.singularValueDecompose2dScale(c, sl), o.lineWidth *= Math.max(sl[0], sl[1]) / u, o.stroke(f(q, this, Rl).call(this, g, t, a));
7516
+ z.singularValueDecompose2dScale(c, sl), o.lineWidth *= Math.max(sl[0], sl[1]) / u, o.stroke(f(q, this, Rl).call(this, g, t, a));
7517
7517
  } else o.lineWidth /= u, o.stroke(g);
7518
7518
  o.restore();
7519
7519
  } else {
@@ -7550,7 +7550,7 @@ var gl = [
7550
7550
  r = !0;
7551
7551
  break;
7552
7552
  }
7553
- return R(this, "isFontSubpixelAAEnabled", r);
7553
+ return L(this, "isFontSubpixelAAEnabled", r);
7554
7554
  }
7555
7555
  showText(e, t) {
7556
7556
  var n;
@@ -7643,7 +7643,7 @@ var gl = [
7643
7643
  let e = (h.isSpace ? l : 0) + c, o = i.charProcOperatorList[h.operatorListId];
7644
7644
  o ? this.contentVisible && (this.save(), o.fnArray[0] === Me.setCharWidth && (r.fillAlpha = r.strokeAlpha = 1, n.globalAlpha = 1), n.scale(a, a), n.transform(...d), this.executeOperatorList(o), this.restore()) : F(`Type3 character "${h.operatorListId}" is not available.`);
7645
7645
  let f = [h.width, 0];
7646
- B.applyTransform(f, d), g = f[0] * a + e, n.translate(g, 0), r.x += g * u;
7646
+ z.applyTransform(f, d), g = f[0] * a + e, n.translate(g, 0), r.x += g * u;
7647
7647
  }
7648
7648
  n.restore(), v && (this.dependencyTracker = v);
7649
7649
  }
@@ -7707,7 +7707,7 @@ var gl = [
7707
7707
  let a = Mt(i);
7708
7708
  if (a) {
7709
7709
  let { width: e, height: t } = i.canvas, n = ve.slice();
7710
- B.axialAlignedBoundingBox([
7710
+ z.axialAlignedBoundingBox([
7711
7711
  0,
7712
7712
  0,
7713
7713
  e,
@@ -7727,7 +7727,7 @@ var gl = [
7727
7727
  paintFormXObjectBegin(e, t, n) {
7728
7728
  if (this.contentVisible && (this.save(e), this.baseTransformStack.push(this.baseTransform), t && this.transform(e, ...t), this.baseTransform = jt(this.ctx), n)) {
7729
7729
  var r;
7730
- B.axialAlignedBoundingBox(n, this.baseTransform, this.current.minMax);
7730
+ z.axialAlignedBoundingBox(n, this.baseTransform, this.current.minMax);
7731
7731
  let [t, i, a, o] = n, s = new Path2D();
7732
7732
  s.rect(t, i, a - t, o - i), this.ctx.clip(s), (r = this.dependencyTracker) == null || r.recordClipBox(e, this.ctx, t, a, i, o), this.endPath(e);
7733
7733
  }
@@ -7763,7 +7763,7 @@ var gl = [
7763
7763
  i.canvas.width,
7764
7764
  i.canvas.height
7765
7765
  ], s;
7766
- t.bbox ? (s = ve.slice(), B.axialAlignedBoundingBox(t.bbox, jt(i), s), s = B.intersect(s, o) || [
7766
+ t.bbox ? (s = ve.slice(), z.axialAlignedBoundingBox(t.bbox, jt(i), s), s = z.intersect(s, o) || [
7767
7767
  0,
7768
7768
  0,
7769
7769
  0,
@@ -7834,7 +7834,7 @@ var gl = [
7834
7834
  let t = jt(this.ctx);
7835
7835
  this.restore(e), this.ctx.save(), this.ctx.setTransform(...t);
7836
7836
  let n = ve.slice();
7837
- B.axialAlignedBoundingBox([
7837
+ z.axialAlignedBoundingBox([
7838
7838
  0,
7839
7839
  0,
7840
7840
  r.canvas.width,
@@ -7847,7 +7847,7 @@ var gl = [
7847
7847
  let c = f(q, this, Nl).call(this, r.canvas);
7848
7848
  s.globalCompositeOperation = "destination-in", s.drawImage(c.canvas, 0, 0);
7849
7849
  let l = this.ctx.globalCompositeOperation, u = this.ctx.globalAlpha, d = this.ctx.filter;
7850
- this.ctx.save(), this.ctx.setTransform(...t), this.ctx.globalAlpha = 1, z.isCanvasFilterSupported && (this.ctx.filter = "none"), this.ctx.globalCompositeOperation = "destination-out", this.ctx.drawImage(c.canvas, 0, 0), this.ctx.globalCompositeOperation = l, this.ctx.globalAlpha = u, z.isCanvasFilterSupported && (this.ctx.filter = d == null ? "none" : d), this.ctx.drawImage(o.canvas, 0, 0), this.ctx.restore(), this.canvasFactory.destroy(c), this.canvasFactory.destroy(o);
7850
+ this.ctx.save(), this.ctx.setTransform(...t), this.ctx.globalAlpha = 1, R.isCanvasFilterSupported && (this.ctx.filter = "none"), this.ctx.globalCompositeOperation = "destination-out", this.ctx.drawImage(c.canvas, 0, 0), this.ctx.globalCompositeOperation = l, this.ctx.globalAlpha = u, R.isCanvasFilterSupported && (this.ctx.filter = d == null ? "none" : d), this.ctx.drawImage(o.canvas, 0, 0), this.ctx.restore(), this.canvasFactory.destroy(c), this.canvasFactory.destroy(o);
7851
7851
  } else {
7852
7852
  var o, s;
7853
7853
  let e = (o = c == null ? void 0 : c.backdropCtx) == null ? null : o;
@@ -7870,12 +7870,12 @@ var gl = [
7870
7870
  if (f(q, this, jl).call(this), ml(this.ctx), this.ctx.save(), this.save(e), this.baseTransform && this.ctx.setTransform(...this.baseTransform), n) {
7871
7871
  let i = n[2] - n[0], s = n[3] - n[1];
7872
7872
  if (a && this.annotationCanvasMap) {
7873
- r = r.slice(), r[4] -= n[0], r[5] -= n[1], n = n.slice(), n[0] = n[1] = 0, n[2] = i, n[3] = s, B.singularValueDecompose2dScale(jt(this.ctx), sl);
7873
+ r = r.slice(), r[4] -= n[0], r[5] -= n[1], n = n.slice(), n[0] = n[1] = 0, n[2] = i, n[3] = s, z.singularValueDecompose2dScale(jt(this.ctx), sl);
7874
7874
  let { viewportScale: e } = this, a = Math.ceil(i * this.outputScaleX * e), c = Math.ceil(s * this.outputScaleY * e);
7875
7875
  this.annotationCanvas = this.canvasFactory.create(a, c);
7876
7876
  let { canvas: l, context: u } = this.annotationCanvas;
7877
7877
  if (o) {
7878
- let e = this.annotationCanvasMap.getOrInsertComputed(t, ot);
7878
+ let e = this.annotationCanvasMap.getOrInsertComputed(t, st);
7879
7879
  l.setAttribute("data-canvas-name", o);
7880
7880
  let n = e.findIndex((e) => e.getAttribute("data-canvas-name") === o);
7881
7881
  n === -1 ? e.push(l) : e[n] = l;
@@ -7912,7 +7912,7 @@ var gl = [
7912
7912
  u.setTransform(1, 0, 0, 1, p.offsetX - d[4], p.offsetY - d[5]), (s = this.dependencyTracker) == null || s.resetBBox(e);
7913
7913
  for (let t = 0, s = o.length; t < s; t += 2) {
7914
7914
  var m;
7915
- let s = B.transform(d, [
7915
+ let s = z.transform(d, [
7916
7916
  n,
7917
7917
  r,
7918
7918
  i,
@@ -8130,7 +8130,7 @@ function Nl(e, t = null, n = 1) {
8130
8130
  let { width: r, height: i } = e, a = t == null ? this.canvasFactory.create(r, i) : t, o = a.context;
8131
8131
  n = Math.round(n * 255) / 255;
8132
8132
  let s = n < 1;
8133
- s && x(Dl, this) === void 0 && C(Dl, this, z.isCanvasFilterSupported ? /* @__PURE__ */ new Map() : "none");
8133
+ s && x(Dl, this) === void 0 && C(Dl, this, R.isCanvasFilterSupported ? /* @__PURE__ */ new Map() : "none");
8134
8134
  let c = "none";
8135
8135
  if (s && x(Dl, this) instanceof Map && (c = x(Dl, this).getOrInsertComputed(n, () => this.filterFactory.addKnockoutFilter(n))), !s || c !== "none") return t && (o.save(), o.setTransform(1, 0, 0, 1, 0, 0), o.clearRect(0, 0, r, i), o.restore()), o.filter = c, o.drawImage(e, 0, 0), o.filter = "none", a;
8136
8136
  let l = e.getContext("2d", { willReadFrequently: !0 }).getImageData(0, 0, r, i), u = o.createImageData(r, i), d = l.data, f = u.data, p = n > 0 ? 1 / n : 1e6;
@@ -8153,11 +8153,11 @@ function Fl(e, t, n = {}) {
8153
8153
  0,
8154
8154
  0
8155
8155
  ], backdropOffset: a = [0, 0], reuseMaskEntry: o = null, poolMeta: s = null, sourceAlpha: c = 1, sourceFilter: l = "none", knockoutAlpha: u = 1 } = n, { width: d, height: p } = t, m = f(q, this, Nl).call(this, t, o, u), h = e.globalCompositeOperation;
8156
- if (e.save(), e.setTransform(...i), e.globalAlpha = 1, z.isCanvasFilterSupported && (e.filter = "none"), e.globalCompositeOperation = "destination-out", e.drawImage(m.canvas, 0, 0), r) {
8156
+ if (e.save(), e.setTransform(...i), e.globalAlpha = 1, R.isCanvasFilterSupported && (e.filter = "none"), e.globalCompositeOperation = "destination-out", e.drawImage(m.canvas, 0, 0), r) {
8157
8157
  let [t, n] = a, i = f(q, this, Pl).call(this, s, "knockoutBackdropEntry", d, p), o = i.context;
8158
8158
  o.drawImage(r, t, n, d, p, 0, 0, d, p), o.globalCompositeOperation = "destination-in", o.drawImage(m.canvas, 0, 0), o.globalCompositeOperation = "source-over", e.globalCompositeOperation = "destination-over", e.drawImage(i.canvas, 0, 0), s || this.canvasFactory.destroy(i);
8159
8159
  }
8160
- e.globalCompositeOperation = h, e.globalAlpha = c, z.isCanvasFilterSupported && (e.filter = l == null ? "none" : l), e.drawImage(t, 0, 0), e.restore(), o || this.canvasFactory.destroy(m);
8160
+ e.globalCompositeOperation = h, e.globalAlpha = c, R.isCanvasFilterSupported && (e.filter = l == null ? "none" : l), e.drawImage(t, 0, 0), e.restore(), o || this.canvasFactory.destroy(m);
8161
8161
  }
8162
8162
  function Il(e = 1) {
8163
8163
  var t;
@@ -8196,7 +8196,7 @@ function Rl(e, t, n) {
8196
8196
  }
8197
8197
  function zl(e) {
8198
8198
  let { canvas: t } = e, { width: n, height: r } = t;
8199
- if (z.isCanvasFilterSupported) {
8199
+ if (R.isCanvasFilterSupported) {
8200
8200
  e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.filter = "grayscale(1)", e.globalAlpha = 1, e.globalCompositeOperation = "copy", e.drawImage(t, 0, 0), e.restore();
8201
8201
  return;
8202
8202
  }
@@ -8220,7 +8220,7 @@ var Vl = /* @__PURE__ */ new WeakMap(), Hl = /* @__PURE__ */ new WeakMap(), Ul =
8220
8220
  return (e = (t = this._fullReader) == null ? void 0 : t._loaded) == null ? 0 : e;
8221
8221
  }
8222
8222
  getFullReader() {
8223
- return L(!this._fullReader, "BasePDFStream.getFullReader can only be called once."), this._fullReader = new (x(Vl, this))(this);
8223
+ return ze(!this._fullReader, "BasePDFStream.getFullReader can only be called once."), this._fullReader = new (x(Vl, this))(this);
8224
8224
  }
8225
8225
  getRangeReader(e, t) {
8226
8226
  if (t <= this._progressiveDataLength) return null;
@@ -8299,7 +8299,7 @@ function Kl(e) {
8299
8299
  if (e) {
8300
8300
  if (!/^[\x00-\xFF]+$/.test(n)) return n;
8301
8301
  try {
8302
- let r = new TextDecoder(e, { fatal: !0 }), i = Ze(n);
8302
+ let r = new TextDecoder(e, { fatal: !0 }), i = Qe(n);
8303
8303
  n = r.decode(i), t = !1;
8304
8304
  } catch (e) {}
8305
8305
  }
@@ -8385,7 +8385,7 @@ function Xl(e) {
8385
8385
  return null;
8386
8386
  }
8387
8387
  function Zl(e, t) {
8388
- return new qe(`Unexpected server response (${e}) while retrieving PDF "${t.href}".`, e, e === 404 || e === 0 && t.protocol === "file:");
8388
+ return new Je(`Unexpected server response (${e}) while retrieving PDF "${t.href}".`, e, e === 404 || e === 0 && t.protocol === "file:");
8389
8389
  }
8390
8390
  function Ql(e, t) {
8391
8391
  if (e !== t) throw Error(`Expected range response-origin "${e}" to match "${t}".`);
@@ -8412,7 +8412,7 @@ var nu = class extends Ul {
8412
8412
  constructor(e) {
8413
8413
  super(e, ru, iu), g(this, "_responseOrigin", null);
8414
8414
  let { httpHeaders: t, url: n } = e;
8415
- L(/https?:/.test(n.protocol), "PDFFetchStream only supports http(s):// URLs."), this.headers = ql(!0, t);
8415
+ ze(/https?:/.test(n.protocol), "PDFFetchStream only supports http(s):// URLs."), this.headers = ql(!0, t);
8416
8416
  }
8417
8417
  }, ru = class extends Wl {
8418
8418
  constructor(e) {
@@ -8426,7 +8426,7 @@ var nu = class extends Ul {
8426
8426
  rangeChunkSize: r,
8427
8427
  disableRange: t
8428
8428
  });
8429
- this._contentLength = o, this._isRangeSupported = s, this._filename = Xl(a), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new Ye("Streaming is disabled.")), this._headersCapability.resolve();
8429
+ this._contentLength = o, this._isRangeSupported = s, this._filename = Xl(a), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new Xe("Streaming is disabled.")), this._headersCapability.resolve();
8430
8430
  }).catch(this._headersCapability.reject);
8431
8431
  }
8432
8432
  read() {
@@ -8522,7 +8522,7 @@ function lu(e, t) {
8522
8522
  if (e === void 0) this._fullReader ? this._fullReader._enqueue(n) : this._queuedChunks.push(n);
8523
8523
  else {
8524
8524
  let t = this._rangeReaders.keys().find((t) => t._begin === e);
8525
- L(t, "#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."), t._enqueue(n);
8525
+ ze(t, "#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."), t._enqueue(n);
8526
8526
  }
8527
8527
  }
8528
8528
  var uu = /* @__PURE__ */ new WeakMap(), du = class extends Wl {
@@ -8599,7 +8599,7 @@ var uu = /* @__PURE__ */ new WeakMap(), du = class extends Wl {
8599
8599
  }
8600
8600
  }, mu = 200, hu = 206;
8601
8601
  function gu(e) {
8602
- return typeof e == "string" ? Ze(e).buffer : e;
8602
+ return typeof e == "string" ? Qe(e).buffer : e;
8603
8603
  }
8604
8604
  var _u = /* @__PURE__ */ new WeakMap(), vu = /* @__PURE__ */ new WeakSet(), yu = class extends Ul {
8605
8605
  constructor(e) {
@@ -8617,7 +8617,7 @@ var _u = /* @__PURE__ */ new WeakMap(), vu = /* @__PURE__ */ new WeakSet(), yu =
8617
8617
  };
8618
8618
  x(_u, this).set(t, n), t.open("GET", this.url), t.withCredentials = this._source.withCredentials;
8619
8619
  for (let [e, n] of this.headers) t.setRequestHeader(e, n);
8620
- return this.isHttp && "begin" in e && "end" in e ? (t.setRequestHeader("Range", `bytes=${e.begin}-${e.end - 1}`), n.validateStatus = (e) => e === hu || e === mu) : n.validateStatus = (e) => e === mu, t.responseType = "arraybuffer", L(e.onError, "Expected `onError` callback to be provided."), t.onerror = () => e.onError(t.status), t.onreadystatechange = f(vu, this, xu).bind(this, t), t.onprogress = f(vu, this, bu).bind(this, t), t.send(null), t;
8620
+ return this.isHttp && "begin" in e && "end" in e ? (t.setRequestHeader("Range", `bytes=${e.begin}-${e.end - 1}`), n.validateStatus = (e) => e === hu || e === mu) : n.validateStatus = (e) => e === mu, t.responseType = "arraybuffer", ze(e.onError, "Expected `onError` callback to be provided."), t.onerror = () => e.onError(t.status), t.onreadystatechange = f(vu, this, xu).bind(this, t), t.onprogress = f(vu, this, bu).bind(this, t), t.send(null), t;
8621
8621
  }
8622
8622
  _abortRequest(e) {
8623
8623
  x(_u, this).has(e) && (x(_u, this).delete(e), e.abort());
@@ -8775,7 +8775,7 @@ var Iu = class extends Ul {
8775
8775
  constructor(e) {
8776
8776
  super(e, Lu, Ru);
8777
8777
  let { url: t } = e;
8778
- L(t.protocol === "file:", "PDFNodeStream only supports file:// URLs.");
8778
+ ze(t.protocol === "file:", "PDFNodeStream only supports file:// URLs.");
8779
8779
  }
8780
8780
  }, Lu = class extends Wl {
8781
8781
  constructor(e) {
@@ -8785,7 +8785,7 @@ var Iu = class extends Ul {
8785
8785
  let n = Fu(i);
8786
8786
  this._reader = n.getReader();
8787
8787
  let { size: a } = e;
8788
- this._contentLength = a, this._isRangeSupported = !t && a > 2 * r, !this._isStreamingSupported && this._isRangeSupported && this.cancel(new Ye("Streaming is disabled.")), this._headersCapability.resolve();
8788
+ this._contentLength = a, this._isRangeSupported = !t && a > 2 * r, !this._isStreamingSupported && this._isRangeSupported && this.cancel(new Xe("Streaming is disabled.")), this._headersCapability.resolve();
8789
8789
  }).catch((e) => {
8790
8790
  e.code === "ENOENT" && (e = Zl(0, i)), this._headersCapability.reject(e);
8791
8791
  });
@@ -9056,7 +9056,7 @@ var ad = /* @__PURE__ */ new WeakMap(), od = /* @__PURE__ */ new WeakMap(), sd =
9056
9056
  let i = t[e] - 1;
9057
9057
  o[e] = r[i], i < n && s++;
9058
9058
  }
9059
- let c = x(sd, this), l = c - a, u = lt(n - s, 0, l);
9059
+ let c = x(sd, this), l = c - a, u = B(n - s, 0, l);
9060
9060
  for (let t = 0, n = 0; t < c; t++) e.has(t + 1) || (r[n++] = r[t]);
9061
9061
  r.copyWithin(u + a, u, l), r.set(o, u), f(ud, this, md).call(this, i), r.every((e, t) => e === t + 1) && C(ad, this, null);
9062
9062
  }
@@ -9126,7 +9126,7 @@ var ad = /* @__PURE__ */ new WeakMap(), od = /* @__PURE__ */ new WeakMap(), sd =
9126
9126
  let t = /* @__PURE__ */ new Map();
9127
9127
  for (let n = 0, r = e.length; n < r; n++) {
9128
9128
  let r = this.getPageId(e[n]);
9129
- t.getOrInsertComputed(r, ot).push(n + 1);
9129
+ t.getOrInsertComputed(r, st).push(n + 1);
9130
9130
  }
9131
9131
  return this.getPageMappingForSaving(t);
9132
9132
  }
@@ -9240,8 +9240,8 @@ var vd = class {
9240
9240
  }).catch(() => {});
9241
9241
  }
9242
9242
  static get fontFamilyMap() {
9243
- let { isWindows: e, isFirefox: t } = z.platform;
9244
- return R(this, "fontFamilyMap", /* @__PURE__ */ new Map([["sans-serif", `${e && t ? "Calibri, " : ""}sans-serif`], ["monospace", `${e && t ? "Lucida Console, " : ""}monospace`]]));
9243
+ let { isWindows: e, isFirefox: t } = R.platform;
9244
+ return L(this, "fontFamilyMap", /* @__PURE__ */ new Map([["sans-serif", `${e && t ? "Calibri, " : ""}sans-serif`], ["monospace", `${e && t ? "Lucida Console, " : ""}monospace`]]));
9245
9245
  }
9246
9246
  render() {
9247
9247
  x(Td, this) && x(Sd, this).append(x(Td, this).render());
@@ -9270,7 +9270,7 @@ var vd = class {
9270
9270
  }
9271
9271
  cancel() {
9272
9272
  var e;
9273
- let t = new Ye("TextLayer task cancelled.");
9273
+ let t = new Xe("TextLayer task cancelled.");
9274
9274
  (e = x(Ad, this)) == null || e.cancel(t).catch(() => {}), C(Ad, this, null), x(xd, this).reject(t);
9275
9275
  }
9276
9276
  get textDivs() {
@@ -9317,7 +9317,7 @@ function Ud(e) {
9317
9317
  fontSize: 0
9318
9318
  };
9319
9319
  x(Ld, this).push(t);
9320
- let r = B.transform(x(zd, this), e.transform), i = Math.atan2(r[1], r[0]), a = x(Pd, this)[e.fontName];
9320
+ let r = z.transform(x(zd, this), e.transform), i = Math.atan2(r[1], r[0]), a = x(Pd, this)[e.fontName];
9321
9321
  a.vertical && (i += Math.PI / 2);
9322
9322
  let o = x(wd, this) && a.fontSubstitution || a.fontFamily;
9323
9323
  o = M.fontFamilyMap.get(o) || o;
@@ -9377,7 +9377,7 @@ function Jd(e, t, n) {
9377
9377
  let a = i.measureText(""), o = a.fontBoundingBoxAscent, s = Math.abs(a.fontBoundingBoxDescent);
9378
9378
  i.canvas.width = i.canvas.height = 0;
9379
9379
  let c = .8;
9380
- return o ? c = o / (o + s) : (z.platform.isFirefox && F("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), t.ascent ? c = t.ascent : t.descent && (c = 1 + t.descent)), f(M, this, Yd)._.set(e, c), c;
9380
+ return o ? c = o / (o + s) : (R.platform.isFirefox && F("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), t.ascent ? c = t.ascent : t.descent && (c = 1 + t.descent)), f(M, this, Yd)._.set(e, c), c;
9381
9381
  }
9382
9382
  var Yd = { _: /* @__PURE__ */ new Map() }, Xd = { _: /* @__PURE__ */ new Map() }, Zd = { _: /* @__PURE__ */ new WeakMap() }, Qd = { _: null }, $d = { _: /* @__PURE__ */ new Set() }, ef = 100;
9383
9383
  function tf(e = {}) {
@@ -9549,7 +9549,7 @@ var nf = class {
9549
9549
  return this._pdfInfo.fingerprints;
9550
9550
  }
9551
9551
  get isPureXfa() {
9552
- return R(this, "isPureXfa", !!this._transport._htmlForXfa);
9552
+ return L(this, "isPureXfa", !!this._transport._htmlForXfa);
9553
9553
  }
9554
9554
  get allXfaHtml() {
9555
9555
  return this._transport._htmlForXfa;
@@ -9694,7 +9694,7 @@ var nf = class {
9694
9694
  return this._transport.filterFactory;
9695
9695
  }
9696
9696
  get isPureXfa() {
9697
- return R(this, "isPureXfa", !!this._transport._htmlForXfa);
9697
+ return L(this, "isPureXfa", !!this._transport._htmlForXfa);
9698
9698
  }
9699
9699
  getXfa() {
9700
9700
  var e = this;
@@ -9708,7 +9708,7 @@ var nf = class {
9708
9708
  (g = this._stats) == null || g.time("Overall");
9709
9709
  let y = this._transport.getRenderingIntent(r, i, u, d), { renderingIntent: b, cacheKey: x } = y;
9710
9710
  C(lf, this, !1), s || (s = this._transport.getOptionalContentConfig(b));
9711
- let S = this._intentStates.getOrInsertComputed(x, ct);
9711
+ let S = this._intentStates.getOrInsertComputed(x, lt);
9712
9712
  S.streamReaderCancelTimeout && (clearTimeout(S.streamReaderCancelTimeout), S.streamReaderCancelTimeout = null);
9713
9713
  let w = !!(b & Se.PRINT);
9714
9714
  if (!S.displayReadyCapability) {
@@ -9785,7 +9785,7 @@ var nf = class {
9785
9785
  function i() {
9786
9786
  o.operatorList.lastChunk && (o.opListReadCapability.resolve(o.operatorList), o.renderTasks.delete(s));
9787
9787
  }
9788
- let a = this._transport.getRenderingIntent(e, t, n, r, !0), o = this._intentStates.getOrInsertComputed(a.cacheKey, ct), s;
9788
+ let a = this._transport.getRenderingIntent(e, t, n, r, !0), o = this._intentStates.getOrInsertComputed(a.cacheKey, lt), s;
9789
9789
  if (!o.opListReadCapability) {
9790
9790
  var c;
9791
9791
  s = Object.create(null), s.operatorListChanged = i, o.opListReadCapability = Promise.withResolvers(), (o.renderTasks || (o.renderTasks = /* @__PURE__ */ new Set())).add(s), o.operatorList = {
@@ -9914,7 +9914,7 @@ var nf = class {
9914
9914
  return;
9915
9915
  }
9916
9916
  }
9917
- if (e.streamReader.cancel(new Ye(t.message)).catch(() => {}), e.streamReader = null, !this._transport.destroyed) {
9917
+ if (e.streamReader.cancel(new Xe(t.message)).catch(() => {}), e.streamReader = null, !this._transport.destroyed) {
9918
9918
  for (let [t, n] of this._intentStates) if (n === e) {
9919
9919
  this._intentStates.delete(t);
9920
9920
  break;
@@ -9978,7 +9978,7 @@ var mf = /* @__PURE__ */ new WeakMap(), hf = /* @__PURE__ */ new WeakMap(), gf =
9978
9978
  return n.apply(this, arguments);
9979
9979
  };
9980
9980
  }();
9981
- return R(this, "_setupFakeWorkerGlobal", n());
9981
+ return L(this, "_setupFakeWorkerGlobal", n());
9982
9982
  }
9983
9983
  };
9984
9984
  ae = yf;
@@ -10074,7 +10074,7 @@ var Of = /* @__PURE__ */ new WeakMap(), kf = /* @__PURE__ */ new WeakMap(), Af =
10074
10074
  x(jf, this).set(t, e), x(Mf, this).set(t, Promise.resolve(e));
10075
10075
  }
10076
10076
  get annotationStorage() {
10077
- return R(this, "annotationStorage", new to());
10077
+ return L(this, "annotationStorage", new to());
10078
10078
  }
10079
10079
  getRenderingIntent(e, t = Ce.ENABLE, n = null, r = !1, i = !1) {
10080
10080
  let a = Se.DISPLAY, o = Ya;
@@ -10125,20 +10125,20 @@ var Of = /* @__PURE__ */ new WeakMap(), kf = /* @__PURE__ */ new WeakMap(), Af =
10125
10125
  let n = this.messageHandler.sendWithPromise("Terminate", null);
10126
10126
  return t.push(n), Promise.all(t).then(() => {
10127
10127
  var e, t;
10128
- this.commonObjs.clear(), this.fontLoader.clear(), x(kf, this).clear(), this.filterFactory.destroy(), Vd.cleanup(), (e = x(Af, this)) == null || e.cancelAllRequests(new Ye("Worker was terminated.")), (t = this.messageHandler) == null || t.destroy(), this.messageHandler = null, this.destroyCapability.resolve();
10128
+ this.commonObjs.clear(), this.fontLoader.clear(), x(kf, this).clear(), this.filterFactory.destroy(), Vd.cleanup(), (e = x(Af, this)) == null || e.cancelAllRequests(new Xe("Worker was terminated.")), (t = this.messageHandler) == null || t.destroy(), this.messageHandler = null, this.destroyCapability.resolve();
10129
10129
  }, this.destroyCapability.reject), this.destroyCapability.promise;
10130
10130
  }
10131
10131
  setupMessageHandler() {
10132
10132
  var e = this;
10133
10133
  let { messageHandler: t, loadingTask: n } = this;
10134
10134
  t.on("GetReader", (e, t) => {
10135
- L(x(Af, this), "GetReader - no `BasePDFStream` instance available."), C(Of, this, x(Af, this).getFullReader()), x(Of, this).onProgress = (e) => f(Ff, this, Rf).call(this, e), t.onPull = () => {
10135
+ ze(x(Af, this), "GetReader - no `BasePDFStream` instance available."), C(Of, this, x(Af, this).getFullReader()), x(Of, this).onProgress = (e) => f(Ff, this, Rf).call(this, e), t.onPull = () => {
10136
10136
  x(Of, this).read().then(function({ value: e, done: n }) {
10137
10137
  if (n) {
10138
10138
  t.close();
10139
10139
  return;
10140
10140
  }
10141
- L(e instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), t.enqueue(new Uint8Array(e), 1, [e]);
10141
+ ze(e instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), t.enqueue(new Uint8Array(e), 1, [e]);
10142
10142
  }).catch((e) => {
10143
10143
  t.error(e);
10144
10144
  });
@@ -10161,7 +10161,7 @@ var Of = /* @__PURE__ */ new WeakMap(), kf = /* @__PURE__ */ new WeakMap(), Af =
10161
10161
  return t.apply(this, arguments);
10162
10162
  };
10163
10163
  }()), t.on("GetRangeReader", (e, t) => {
10164
- L(x(Af, this), "GetRangeReader - no `BasePDFStream` instance available.");
10164
+ ze(x(Af, this), "GetRangeReader - no `BasePDFStream` instance available.");
10165
10165
  let n = x(Af, this).getRangeReader(e.begin, e.end);
10166
10166
  if (!n) {
10167
10167
  t.close();
@@ -10173,7 +10173,7 @@ var Of = /* @__PURE__ */ new WeakMap(), kf = /* @__PURE__ */ new WeakMap(), Af =
10173
10173
  t.close();
10174
10174
  return;
10175
10175
  }
10176
- L(e instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), t.enqueue(new Uint8Array(e), 1, [e]);
10176
+ ze(e instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), t.enqueue(new Uint8Array(e), 1, [e]);
10177
10177
  }).catch((e) => {
10178
10178
  t.error(e);
10179
10179
  });
@@ -10221,7 +10221,7 @@ var Of = /* @__PURE__ */ new WeakMap(), kf = /* @__PURE__ */ new WeakMap(), Af =
10221
10221
  break;
10222
10222
  case "CopyLocalImage":
10223
10223
  let { imageRef: o } = r;
10224
- L(o, "The imageRef must be defined.");
10224
+ ze(o, "The imageRef must be defined.");
10225
10225
  for (let t of x(jf, this).values()) for (let [, n] of t.objs) {
10226
10226
  if ((n == null ? void 0 : n.ref) !== o) continue;
10227
10227
  if (!n.dataLen) return null;
@@ -10456,7 +10456,7 @@ function Rf({ loaded: e, total: t }) {
10456
10456
  (n = (r = this.loadingTask).onProgress) == null || n.call(r, {
10457
10457
  loaded: e,
10458
10458
  total: t,
10459
- percent: t ? lt(Math.round(e / t * 100), 0, 100) : NaN
10459
+ percent: t ? B(Math.round(e / t * 100), 0, 100) : NaN
10460
10460
  });
10461
10461
  }
10462
10462
  var zf = class {
@@ -10532,7 +10532,7 @@ var zf = class {
10532
10532
  }
10533
10533
  }, Hf = { _: /* @__PURE__ */ new WeakSet() }, Uf = "6.1.200", Wf = "6353acefe", Gf = /* @__PURE__ */ new WeakMap(), Kf = /* @__PURE__ */ new WeakMap(), qf = /* @__PURE__ */ new WeakMap(), Jf = /* @__PURE__ */ new WeakMap(), Yf = /* @__PURE__ */ new WeakMap(), Xf = /* @__PURE__ */ new WeakMap(), Zf = /* @__PURE__ */ new WeakMap(), Qf = /* @__PURE__ */ new WeakMap(), $f = /* @__PURE__ */ new WeakMap(), ep = /* @__PURE__ */ new WeakMap(), tp = /* @__PURE__ */ new WeakSet(), np = class e {
10534
10534
  static get _keyboardManager() {
10535
- return R(this, "_keyboardManager", new Rn([
10535
+ return L(this, "_keyboardManager", new Rn([
10536
10536
  [["Escape"], e.prototype._hideDropdownFromKeyboard],
10537
10537
  [["Space"], e.prototype._colorSelectFromKeyboard],
10538
10538
  [["ArrowDown", "ArrowRight"], e.prototype._moveToNext],
@@ -10685,17 +10685,17 @@ var lp = { _: null }, up = /* @__PURE__ */ new WeakMap(), dp = /* @__PURE__ */ n
10685
10685
  }
10686
10686
  renderButton() {
10687
10687
  if (x(up, this)) return x(up, this);
10688
- let { editorType: e, colorType: t, colorAndOpacityType: n, opacityType: r, color: i, opacity: a } = x(fp, this), o = C(dp, this, z.isAlphaColorInputSupported && r !== void 0), s = C(up, this, document.createElement("input"));
10688
+ let { editorType: e, colorType: t, colorAndOpacityType: n, opacityType: r, color: i, opacity: a } = x(fp, this), o = C(dp, this, R.isAlphaColorInputSupported && r !== void 0), s = C(up, this, document.createElement("input"));
10689
10689
  if (s.type = "color", o) {
10690
10690
  s.setAttribute("alpha", "");
10691
- let e = B.hexNums[Math.round((a == null ? 1 : a) * 255)];
10691
+ let e = z.hexNums[Math.round((a == null ? 1 : a) * 255)];
10692
10692
  s.value = (i || "#000000") + e;
10693
10693
  } else s.value = i || "#000000";
10694
10694
  return s.className = "basicColorPicker", s.tabIndex = 0, s.setAttribute("data-l10n-id", hp._[e]), s.addEventListener("input", () => {
10695
10695
  if (o) {
10696
10696
  let e = Ot(s.value);
10697
10697
  if (!e) return;
10698
- let [i, a, o, c] = e, l = B.makeHexColor(i, a, o);
10698
+ let [i, a, o, c] = e, l = z.makeHexColor(i, a, o);
10699
10699
  n === void 0 ? (x(pp, this).updateParams(t, l), x(pp, this).updateParams(r, c)) : x(pp, this).updateParams(n, {
10700
10700
  color: l,
10701
10701
  opacity: c
@@ -10705,13 +10705,13 @@ var lp = { _: null }, up = /* @__PURE__ */ new WeakMap(), dp = /* @__PURE__ */ n
10705
10705
  }
10706
10706
  update(e) {
10707
10707
  if (x(up, this)) if (x(dp, this)) {
10708
- let t = B.hexNums[Math.round(x(fp, this).opacity * 255)];
10708
+ let t = z.hexNums[Math.round(x(fp, this).opacity * 255)];
10709
10709
  x(up, this).value = e + t;
10710
10710
  } else x(up, this).value = e;
10711
10711
  }
10712
10712
  updateOpacity(e) {
10713
10713
  if (!x(up, this) || !x(dp, this)) return;
10714
- let t = B.hexNums[Math.round(e * 255)];
10714
+ let t = z.hexNums[Math.round(e * 255)];
10715
10715
  x(up, this).value = x(fp, this).color + t;
10716
10716
  }
10717
10717
  destroy() {
@@ -10721,10 +10721,10 @@ var lp = { _: null }, up = /* @__PURE__ */ new WeakMap(), dp = /* @__PURE__ */ n
10721
10721
  hideDropdown() {}
10722
10722
  }, hp = { _: null };
10723
10723
  function gp(e) {
10724
- return Math.floor(lt(e, 0, 1) * 255).toString(16).padStart(2, "0");
10724
+ return Math.floor(B(e, 0, 1) * 255).toString(16).padStart(2, "0");
10725
10725
  }
10726
10726
  function _p(e) {
10727
- return lt(e, 0, 1) * 255;
10727
+ return B(e, 0, 1) * 255;
10728
10728
  }
10729
10729
  var vp = class {
10730
10730
  static CMYK_G([e, t, n, r]) {
@@ -10959,9 +10959,9 @@ var vp = class {
10959
10959
  default: break;
10960
10960
  }
10961
10961
  let r = t.borderColor || null;
10962
- r ? (C(Ep, this, !0), a.borderColor = B.makeHexColor(...r)) : a.borderWidth = 0;
10962
+ r ? (C(Ep, this, !0), a.borderColor = z.makeHexColor(...r)) : a.borderWidth = 0;
10963
10963
  }
10964
- let c = B.normalizeRect([
10964
+ let c = z.normalizeRect([
10965
10965
  t.rect[0],
10966
10966
  n.view[3] - t.rect[1] + n.view[1],
10967
10967
  t.rect[2],
@@ -10981,7 +10981,7 @@ var vp = class {
10981
10981
  let r = n.detail[e], i = r[0], a = r.slice(1);
10982
10982
  n.target.style[t] = vp[`${i}_HTML`](a), this.annotationStorage.setValue(this.data.id, { [t]: vp[`${i}_rgb`](a) });
10983
10983
  };
10984
- return R(this, "_commonActions", {
10984
+ return L(this, "_commonActions", {
10985
10985
  display: (e) => {
10986
10986
  let { display: t } = e.detail, n = t % 2 == 1;
10987
10987
  this.container.style.visibility = n ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
@@ -11183,7 +11183,7 @@ var vp = class {
11183
11183
  }
11184
11184
  _setBackgroundColor(e) {
11185
11185
  let t = this.data.backgroundColor || null;
11186
- e.style.backgroundColor = t === null ? "transparent" : B.makeHexColor(...t);
11186
+ e.style.backgroundColor = t === null ? "transparent" : z.makeHexColor(...t);
11187
11187
  }
11188
11188
  };
11189
11189
  function Ap(e) {
@@ -11365,7 +11365,7 @@ var Lp = class extends kp {
11365
11365
  return this.container;
11366
11366
  }
11367
11367
  _getKeyModifier(e) {
11368
- return z.platform.isMac ? e.metaKey : e.ctrlKey;
11368
+ return R.platform.isMac ? e.metaKey : e.ctrlKey;
11369
11369
  }
11370
11370
  _setEventListener(e, t, n, r, i) {
11371
11371
  n.includes("mouse") ? e.addEventListener(n, (e) => {
@@ -11421,7 +11421,7 @@ var Lp = class extends kp {
11421
11421
  let e = Math.abs(this.data.rect[3] - this.data.rect[1] - 2);
11422
11422
  a = Math.min(r, o(e / be));
11423
11423
  }
11424
- i.fontSize = `calc(${a}px * var(--total-scale-factor))`, i.color = B.makeHexColor(...n), this.data.textAlignment !== null && !this.data.comb && (i.textAlign = t[this.data.textAlignment]);
11424
+ i.fontSize = `calc(${a}px * var(--total-scale-factor))`, i.color = z.makeHexColor(...n), this.data.textAlignment !== null && !this.data.comb && (i.textAlign = t[this.data.textAlignment]);
11425
11425
  }
11426
11426
  _setRequired(e, t) {
11427
11427
  t ? e.setAttribute("required", !0) : e.removeAttribute("required"), e.setAttribute("aria-required", t);
@@ -11977,7 +11977,7 @@ var Jp = /* @__PURE__ */ new WeakMap(), Yp = /* @__PURE__ */ new WeakMap(), Xp =
11977
11977
  if (x(sm, this)) return;
11978
11978
  let n = C(sm, this, document.createElement("div"));
11979
11979
  if (n.className = "popup", x($p, this)) {
11980
- let e = n.style.outlineColor = B.makeHexColor(...x($p, this));
11980
+ let e = n.style.outlineColor = z.makeHexColor(...x($p, this));
11981
11981
  n.style.backgroundColor = `color-mix(in srgb, ${e} 30%, white)`;
11982
11982
  }
11983
11983
  let r = document.createElement("span");
@@ -12091,11 +12091,11 @@ function km(e) {
12091
12091
  function Am() {
12092
12092
  if (x(lm, this) !== null) return;
12093
12093
  let { page: { view: e }, viewport: { rawDims: { pageWidth: t, pageHeight: n, pageX: r, pageY: i } } } = x(im, this), a = !!x(am, this), o = x(a ? am : pm, this);
12094
- for (let e of x(rm, this)) if (!o || B.intersect(e.data.rect, o) !== null) {
12094
+ for (let e of x(rm, this)) if (!o || z.intersect(e.data.rect, o) !== null) {
12095
12095
  o = e.data.rect, a = !0;
12096
12096
  break;
12097
12097
  }
12098
- let s = B.normalizeRect([
12098
+ let s = z.normalizeRect([
12099
12099
  o[0],
12100
12100
  e[3] - o[1] + e[1],
12101
12101
  o[2],
@@ -12376,7 +12376,7 @@ var Xm = class extends kp {
12376
12376
  this.container.classList.add("fileAttachmentAnnotation");
12377
12377
  let { container: e, data: t } = this, n;
12378
12378
  t.hasAppearance || t.fillAlpha === 0 ? n = document.createElement("div") : (n = document.createElement("img"), n.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name) ? "paperclip" : "pushpin"}.svg`, t.fillAlpha && t.fillAlpha < 1 && (n.style = `filter: opacity(${Math.round(t.fillAlpha * 100)}%);`)), n.addEventListener("dblclick", f(nh, this, ih).bind(this)), C(th, this, n);
12379
- let { isMac: r } = z.platform;
12379
+ let { isMac: r } = R.platform;
12380
12380
  return e.addEventListener("keydown", (e) => {
12381
12381
  e.key === "Enter" && (r ? e.metaKey : e.ctrlKey) && f(nh, this, ih).call(this);
12382
12382
  }), !t.popupRef && this.hasPopupData ? (this.hasOwnCommentButton = !0, this._createPopup()) : n.classList.add("popupTriggerArea"), e.append(n), e;
@@ -12494,7 +12494,7 @@ var fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakMap(), mh =
12494
12494
  s.data = e;
12495
12495
  let i = wp.create(s);
12496
12496
  if (!i.isRenderable) continue;
12497
- n || (x(vh, t).push(i), e.popupRef && a.getOrInsertComputed(e.popupRef, ot).push(i));
12497
+ n || (x(vh, t).push(i), e.popupRef && a.getOrInsertComputed(e.popupRef, st).push(i));
12498
12498
  let l = i.render();
12499
12499
  if (e.hidden && (l.style.visibility = "hidden"), i.updateOC(r), i._isEditable) {
12500
12500
  var c;
@@ -12586,7 +12586,7 @@ var fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakMap(), mh =
12586
12586
  this.div.classList.toggle("disabled", !e);
12587
12587
  }
12588
12588
  static get _defaultBorderStyle() {
12589
- return R(this, "_defaultBorderStyle", Object.freeze({
12589
+ return L(this, "_defaultBorderStyle", Object.freeze({
12590
12590
  width: 1,
12591
12591
  rawWidth: 1,
12592
12592
  style: Ae.SOLID,
@@ -12653,7 +12653,7 @@ function Ch() {
12653
12653
  var wh = /\r\n?|\n/g, Th = /* @__PURE__ */ new WeakMap(), Eh = /* @__PURE__ */ new WeakMap(), Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakSet(), Ah = class e extends W {
12654
12654
  static get _keyboardManager() {
12655
12655
  let t = e.prototype, n = (e) => e.isEmpty(), r = Rr.TRANSLATE_SMALL, i = Rr.TRANSLATE_BIG;
12656
- return R(this, "_keyboardManager", new Rn([
12656
+ return L(this, "_keyboardManager", new Rn([
12657
12657
  [
12658
12658
  [
12659
12659
  "ctrl+s",
@@ -12970,7 +12970,7 @@ var wh = /\r\n?|\n/g, Th = /* @__PURE__ */ new WeakMap(), Eh = /* @__PURE__ */ n
12970
12970
  };
12971
12971
  }
12972
12972
  let s = yield i().call(a, t, n, r);
12973
- return C(Oh, s, t.fontSize), s.color = B.makeHexColor(...t.color), C(Th, s, Rh.call(e, t.value)), s._initialData = o, t.comment && s.setCommentData(t), s;
12973
+ return C(Oh, s, t.fontSize), s.color = z.makeHexColor(...t.color), C(Th, s, Rh.call(e, t.value)), s._initialData = o, t.comment && s.setCommentData(t), s;
12974
12974
  })();
12975
12975
  }
12976
12976
  serialize(e = !1) {
@@ -13358,7 +13358,7 @@ function vg(e) {
13358
13358
  ], a = n, o = r, s = n, c = r, l = e ? Math.max : Math.min, u = /* @__PURE__ */ new Float32Array(4);
13359
13359
  for (let e = 6, d = t.length; e < d; e += 6) {
13360
13360
  let d = t[e + 4], f = t[e + 5];
13361
- isNaN(t[e]) ? (B.pointBoundingBox(d, f, i), o > f ? (a = d, o = f) : o === f && (a = l(a, d)), c < f ? (s = d, c = f) : c === f && (s = l(s, d))) : (u.set(_e, 0), B.bezierBoundingBox(n, r, ...t.slice(e, e + 6), u), B.rectBoundingBox(...u, i), o > u[1] ? (a = u[0], o = u[1]) : o === u[1] && (a = l(a, u[0])), c < u[3] ? (s = u[2], c = u[3]) : c === u[3] && (s = l(s, u[2]))), n = d, r = f;
13361
+ isNaN(t[e]) ? (z.pointBoundingBox(d, f, i), o > f ? (a = d, o = f) : o === f && (a = l(a, d)), c < f ? (s = d, c = f) : c === f && (s = l(s, d))) : (u.set(_e, 0), z.bezierBoundingBox(n, r, ...t.slice(e, e + 6), u), z.rectBoundingBox(...u, i), o > u[1] ? (a = u[0], o = u[1]) : o === u[1] && (a = l(a, u[0])), c < u[3] ? (s = u[2], c = u[3]) : c === u[3] && (s = l(s, u[2]))), n = d, r = f;
13362
13362
  }
13363
13363
  let d = x(ug, this);
13364
13364
  d[0] = i[0] - x(dg, this), d[1] = i[1] - x(dg, this), d[2] = i[2] - i[0] + 2 * x(dg, this), d[3] = i[3] - i[1] + 2 * x(dg, this), this.firstPoint = [a, o], this.lastPoint = [s, c];
@@ -13379,7 +13379,7 @@ var yg = /* @__PURE__ */ new WeakMap(), bg = /* @__PURE__ */ new WeakMap(), xg =
13379
13379
  u,
13380
13380
  !1
13381
13381
  ];
13382
- x(Sg, this).push(d, f), B.rectBoundingBox(e, l, c, u, i);
13382
+ x(Sg, this).push(d, f), z.rectBoundingBox(e, l, c, u, i);
13383
13383
  }
13384
13384
  let o = i[2] - i[0] + 2 * n, s = i[3] - i[1] + 2 * n, c = i[0] - n, l = i[1] - n, u = r ? -Infinity : Infinity, d = Infinity, f = x(Sg, this).at(r ? -1 : -2), p = [f[0], f[2]];
13385
13385
  for (let e of x(Sg, this)) {
@@ -13536,7 +13536,7 @@ var jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng =
13536
13536
  }, Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = /* @__PURE__ */ new WeakMap(), Bg = /* @__PURE__ */ new WeakMap(), Vg = /* @__PURE__ */ new WeakMap(), Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), e_ = class e extends W {
13537
13537
  static get _keyboardManager() {
13538
13538
  let t = e.prototype;
13539
- return R(this, "_keyboardManager", new Rn([
13539
+ return L(this, "_keyboardManager", new Rn([
13540
13540
  [
13541
13541
  ["ArrowLeft"],
13542
13542
  t._moveCaret,
@@ -13808,7 +13808,7 @@ var jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng =
13808
13808
  };
13809
13809
  }
13810
13810
  let { color: o, quadPoints: s, inkLists: c, outlines: l, opacity: u } = e, d = yield r().call(i, e, t, n);
13811
- d.color = B.makeHexColor(...o), d.opacity = u || 1, c && C(Qg, d, e.thickness), d._initialData = a, e.comment && d.setCommentData(e);
13811
+ d.color = z.makeHexColor(...o), d.opacity = u || 1, c && C(Qg, d, e.thickness), d._initialData = a, e.comment && d.setCommentData(e);
13812
13812
  let [p, m] = d.pageDimensions, [h, g] = d.pageTranslation;
13813
13813
  if (s) {
13814
13814
  let e = C(Rg, d, []);
@@ -14921,17 +14921,17 @@ function sv() {
14921
14921
  let e = C(J_, this, ve.slice());
14922
14922
  for (let { line: t } of x(Z_, this)) {
14923
14923
  if (t.length <= 12) {
14924
- for (let n = 4, r = t.length; n < r; n += 6) B.pointBoundingBox(t[n], t[n + 1], e);
14924
+ for (let n = 4, r = t.length; n < r; n += 6) z.pointBoundingBox(t[n], t[n + 1], e);
14925
14925
  continue;
14926
14926
  }
14927
14927
  let n = t[4], r = t[5];
14928
14928
  for (let i = 6, a = t.length; i < a; i += 6) {
14929
14929
  let [a, o, s, c, l, u] = t.subarray(i, i + 6);
14930
- B.bezierBoundingBox(n, r, a, o, s, c, l, u, e), n = l, r = u;
14930
+ z.bezierBoundingBox(n, r, a, o, s, c, l, u, e), n = l, r = u;
14931
14931
  }
14932
14932
  }
14933
14933
  let [t, n] = f(rv, this, av).call(this);
14934
- e[0] = lt(e[0] - t, 0, 1), e[1] = lt(e[1] - n, 0, 1), e[2] = lt(e[2] + t, 0, 1), e[3] = lt(e[3] + n, 0, 1), e[2] -= e[0], e[3] -= e[1];
14934
+ e[0] = B(e[0] - t, 0, 1), e[1] = B(e[1] - n, 0, 1), e[2] = B(e[2] + t, 0, 1), e[3] = B(e[3] + n, 0, 1), e[2] -= e[0], e[3] -= e[1];
14935
14935
  }
14936
14936
  function cv(e) {
14937
14937
  let [t, n] = f(rv, this, av).call(this);
@@ -14973,7 +14973,7 @@ var lv = class e extends v_ {
14973
14973
  return !0;
14974
14974
  }
14975
14975
  static get typesMap() {
14976
- return R(this, "typesMap", /* @__PURE__ */ new Map([
14976
+ return L(this, "typesMap", /* @__PURE__ */ new Map([
14977
14977
  [P.INK_THICKNESS, "stroke-width"],
14978
14978
  [P.INK_COLOR, "stroke"],
14979
14979
  [P.INK_OPACITY, "stroke-opacity"]
@@ -15059,7 +15059,7 @@ var lv = class e extends v_ {
15059
15059
  }
15060
15060
  createDrawingOptions({ color: t, thickness: n, opacity: r }) {
15061
15061
  this._drawingOptions = e.getDefaultDrawingOptions({
15062
- stroke: B.makeHexColor(...t),
15062
+ stroke: z.makeHexColor(...t),
15063
15063
  "stroke-width": n,
15064
15064
  "stroke-opacity": r
15065
15065
  });
@@ -15501,7 +15501,7 @@ var Ov = { _: {
15501
15501
  return !1;
15502
15502
  }
15503
15503
  static get typesMap() {
15504
- return R(this, "typesMap", /* @__PURE__ */ new Map());
15504
+ return L(this, "typesMap", /* @__PURE__ */ new Map());
15505
15505
  }
15506
15506
  static get isDrawer() {
15507
15507
  return !1;
@@ -16281,7 +16281,7 @@ var iy = /* @__PURE__ */ new WeakMap(), ay = /* @__PURE__ */ new WeakMap(), oy =
16281
16281
  }
16282
16282
  pointerup(e) {
16283
16283
  var t;
16284
- let { isMac: n } = z.platform;
16284
+ let { isMac: n } = R.platform;
16285
16285
  if (e.button !== 0 || e.ctrlKey && n || e.target !== this.div || !x(uy, this) || (C(uy, this, !1), (t = Cy.call(f(yy, this))) != null && t.isDrawer && Cy.call(f(yy, this)).supportMultipleDrawings)) return;
16286
16286
  if (!x(ay, this)) {
16287
16287
  C(ay, this, !0);
@@ -16300,7 +16300,7 @@ var iy = /* @__PURE__ */ new WeakMap(), ay = /* @__PURE__ */ new WeakMap(), oy =
16300
16300
  C(uy, this, !1);
16301
16301
  return;
16302
16302
  }
16303
- let { isMac: n } = z.platform;
16303
+ let { isMac: n } = R.platform;
16304
16304
  if (e.button !== 0 || e.ctrlKey && n || e.target !== this.div) return;
16305
16305
  if (C(uy, this, !0), (t = Cy.call(f(yy, this))) != null && t.isDrawer) {
16306
16306
  this.startDrawingSession(e);
@@ -16381,7 +16381,7 @@ function Sy(e) {
16381
16381
  x($, this).unselectAll();
16382
16382
  let { target: t } = e;
16383
16383
  if (t === x(hy, this).div || (t.getAttribute("role") === "img" || t.classList.contains("endOfContent") || t.classList.contains("textLayerImages") || t.classList.contains("textLayerImagePlaceholder")) && x(hy, this).div.contains(t)) {
16384
- let { isMac: t } = z.platform;
16384
+ let { isMac: t } = R.platform;
16385
16385
  if (e.button !== 0 || e.ctrlKey && t) return;
16386
16386
  x($, this).showAllEditors("highlight", !0, !0), x(hy, this).div.classList.add("free"), this.toggleDrawing(), e_.startHighlighting(this, x($, this).direction === "ltr", {
16387
16387
  target: x(hy, this).div,
@@ -16483,7 +16483,7 @@ var My = /* @__PURE__ */ new WeakMap(), Ny = /* @__PURE__ */ new WeakMap(), Py =
16483
16483
  }
16484
16484
  }
16485
16485
  static get _svgFactory() {
16486
- return R(this, "_svgFactory", new bp());
16486
+ return L(this, "_svgFactory", new bp());
16487
16487
  }
16488
16488
  draw(t, n = !1, r = !1) {
16489
16489
  var i, a;
@@ -16721,7 +16721,7 @@ function db([e, t, n, r, i, a]) {
16721
16721
  (r - t) * x(cb, this) / s,
16722
16722
  0,
16723
16723
  0
16724
- ], l = B.inverseTransform(c), u = document.createElement("canvas");
16724
+ ], l = z.inverseTransform(c), u = document.createElement("canvas");
16725
16725
  return u.className = "textLayerImagePlaceholder", u.width = 0, u.height = 0, Object.assign(u.style, {
16726
16726
  opacity: 0,
16727
16727
  position: "absolute",
@@ -16741,7 +16741,7 @@ function db([e, t, n, r, i, a]) {
16741
16741
  }
16742
16742
  var fb = { _: null };
16743
16743
  globalThis._pdfjsTestingUtils = { HighlightOutliner: Tg }, globalThis.pdfjsLib = {
16744
- AbortException: Ye,
16744
+ AbortException: Xe,
16745
16745
  AnnotationEditorLayer: by,
16746
16746
  AnnotationEditorParamsType: P,
16747
16747
  AnnotationEditorType: N,
@@ -16752,11 +16752,11 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Tg }, globalThis.pdfjsLib =
16752
16752
  applyOpacity: Rt,
16753
16753
  build: Wf,
16754
16754
  ColorPicker: np,
16755
- createValidAbsoluteUrl: Be,
16755
+ createValidAbsoluteUrl: Ve,
16756
16756
  CSSConstants: Lt,
16757
16757
  DOMSVGFactory: bp,
16758
16758
  DrawLayer: By,
16759
- FeatureTest: z,
16759
+ FeatureTest: R,
16760
16760
  fetchData: mt,
16761
16761
  findContrastColor: Wt,
16762
16762
  getDocument: tf,
@@ -16764,22 +16764,22 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Tg }, globalThis.pdfjsLib =
16764
16764
  getPdfFilenameFromUrl: bt,
16765
16765
  getRGB: kt,
16766
16766
  getRGBA: Ot,
16767
- getUuid: it,
16767
+ getUuid: at,
16768
16768
  GlobalWorkerOptions: Bu,
16769
16769
  ImageKind: Oe,
16770
- InvalidPDFException: Ke,
16770
+ InvalidPDFException: qe,
16771
16771
  isDataScheme: _t,
16772
16772
  isPdfFile: vt,
16773
16773
  isValidExplicitDest: Ps,
16774
- makeArr: ot,
16775
- makeMap: st,
16776
- makeObj: ct,
16777
- MathClamp: lt,
16774
+ makeArr: st,
16775
+ makeMap: ct,
16776
+ makeObj: lt,
16777
+ MathClamp: B,
16778
16778
  noContextMenu: wt,
16779
- normalizeUnicode: rt,
16779
+ normalizeUnicode: it,
16780
16780
  OPS: Me,
16781
16781
  OutputScale: Pt,
16782
- PasswordException: We,
16782
+ PasswordException: Ge,
16783
16783
  PasswordResponses: Pe,
16784
16784
  PDFDataRangeTransport: sf,
16785
16785
  PDFDateString: Et,
@@ -16788,17 +16788,17 @@ globalThis._pdfjsTestingUtils = { HighlightOutliner: Tg }, globalThis.pdfjsLib =
16788
16788
  PixelsPerInch: pt,
16789
16789
  RenderingCancelledException: gt,
16790
16790
  renderRichText: Gt,
16791
- ResponseException: qe,
16791
+ ResponseException: Je,
16792
16792
  setLayerDimensions: Nt,
16793
- shadow: R,
16793
+ shadow: L,
16794
16794
  SignatureExtractor: gv,
16795
16795
  stopEvent: Tt,
16796
16796
  SupportedImageMimeTypes: Ft,
16797
16797
  TextLayer: Vd,
16798
16798
  TextLayerImages: ub,
16799
16799
  TouchManager: Xi,
16800
- updateUrlHash: Ve,
16801
- Util: B,
16800
+ updateUrlHash: He,
16801
+ Util: z,
16802
16802
  VerbosityLevel: je,
16803
16803
  version: Uf,
16804
16804
  XfaLayer: ft
@@ -17986,95 +17986,30 @@ var Fb = [
17986
17986
  }]]);
17987
17987
  //#endregion
17988
17988
  //#region src/components/WorkspaceHeader.tsx
17989
- function dx({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, isParsing: i, parseStatusText: o, showImportHtml: u, showImportPdf: d, showPreview: f, showExport: p, showExportPdf: m = !0, customButtonStyles: h, customButtonClassNames: g, customActionComponents: _, handleHtmlImport: v, handlePdfImport: y, setPreviewOpen: b, handleExport: x, handleExportPdf: S }) {
17990
- let C = a(null), w = a(null);
17989
+ function dx({ headerLogo: e, headerTitle: t, headerSubtitle: n, parseError: r, isParsing: i, parseStatusText: a }) {
17991
17990
  return /* @__PURE__ */ l("header", {
17992
- className: "bg-white border-b border-gray-200 px-6 py-4 flex flex-col sm:flex-row items-center justify-between sticky top-0 z-10 shadow-sm gap-4",
17991
+ className: "bg-white border-b border-gray-200 px-6 py-3.5 flex items-center justify-between sticky top-0 z-10 shadow-xs gap-4",
17993
17992
  children: [/* @__PURE__ */ l("div", {
17994
17993
  className: "flex items-center space-x-3",
17995
17994
  children: [e || /* @__PURE__ */ c("div", {
17996
- className: "h-10 w-10 bg-orange-600 rounded-xl flex items-center justify-center text-white shadow-md shadow-orange-600/20",
17997
- children: /* @__PURE__ */ c($b, { className: "h-6 w-6" })
17998
- }), /* @__PURE__ */ l("div", { children: [
17999
- /* @__PURE__ */ c("h1", {
18000
- className: "text-xl font-bold tracking-tight text-slate-800",
18001
- children: t
18002
- }),
18003
- /* @__PURE__ */ c("p", {
18004
- className: "text-xs text-slate-500",
18005
- children: n
18006
- }),
18007
- r && /* @__PURE__ */ l("span", {
18008
- className: "text-[10px] text-red-500 font-bold bg-red-50 px-2 py-0.5 rounded mt-1 inline-block border border-red-100",
18009
- children: ["Error: ", r]
18010
- }),
18011
- i && /* @__PURE__ */ c("span", {
18012
- className: "text-[10px] text-orange-600 font-bold bg-orange-50 px-2 py-0.5 rounded mt-1 inline-block border border-orange-100 animate-pulse",
18013
- children: o || "Parsing..."
18014
- })
18015
- ] })]
17995
+ className: "h-9 w-9 bg-orange-600 rounded-xl flex items-center justify-center text-white shadow-md shadow-orange-600/20",
17996
+ children: /* @__PURE__ */ c($b, { className: "h-5 w-5" })
17997
+ }), /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h1", {
17998
+ className: "text-lg font-bold tracking-tight text-slate-800",
17999
+ children: t
18000
+ }), /* @__PURE__ */ c("p", {
18001
+ className: "text-xs text-slate-500",
18002
+ children: n
18003
+ })] })]
18016
18004
  }), /* @__PURE__ */ l("div", {
18017
- className: "flex flex-wrap items-center gap-3",
18018
- children: [
18019
- (u || d) && /* @__PURE__ */ l("div", {
18020
- className: "flex space-x-2 border-r border-gray-200 pr-4",
18021
- children: [u && /* @__PURE__ */ l(s, { children: [_ != null && _.importHtml ? _.importHtml({ onClick: () => {
18022
- var e;
18023
- return (e = C.current) == null ? void 0 : e.click();
18024
- } }) : /* @__PURE__ */ l("button", {
18025
- onClick: () => {
18026
- var e;
18027
- return (e = C.current) == null ? void 0 : e.click();
18028
- },
18029
- style: h == null ? void 0 : h.importHtml,
18030
- className: (g == null ? void 0 : g.importHtml) || "inline-flex items-center space-x-2 px-3 py-1.5 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-sm",
18031
- title: "Import local HTML file",
18032
- children: [/* @__PURE__ */ c(lx, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ c("span", { children: "Import HTML" })]
18033
- }), /* @__PURE__ */ c("input", {
18034
- type: "file",
18035
- ref: C,
18036
- onChange: v,
18037
- accept: ".html",
18038
- className: "hidden"
18039
- })] }), d && /* @__PURE__ */ l(s, { children: [_ != null && _.importPdf ? _.importPdf({ onClick: () => {
18040
- var e;
18041
- return (e = w.current) == null ? void 0 : e.click();
18042
- } }) : /* @__PURE__ */ l("button", {
18043
- onClick: () => {
18044
- var e;
18045
- return (e = w.current) == null ? void 0 : e.click();
18046
- },
18047
- style: h == null ? void 0 : h.importPdf,
18048
- className: (g == null ? void 0 : g.importPdf) || "inline-flex items-center space-x-2 px-3 py-1.5 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-sm",
18049
- title: "Import PDF layout structure",
18050
- children: [/* @__PURE__ */ c(Kb, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ c("span", { children: "Import PDF" })]
18051
- }), /* @__PURE__ */ c("input", {
18052
- type: "file",
18053
- ref: w,
18054
- onChange: y,
18055
- accept: ".pdf",
18056
- className: "hidden"
18057
- })] })]
18058
- }),
18059
- f && (_ != null && _.preview ? _.preview({ onClick: () => b(!0) }) : /* @__PURE__ */ l("button", {
18060
- onClick: () => b(!0),
18061
- style: h == null ? void 0 : h.preview,
18062
- className: (g == null ? void 0 : g.preview) || "inline-flex items-center space-x-2 px-4 py-2 border border-slate-200 rounded-lg text-sm font-semibold bg-slate-50 text-slate-700 hover:bg-slate-100 transition-colors shadow-sm",
18063
- children: [/* @__PURE__ */ c(Gb, { className: "h-4 w-4 text-slate-500" }), /* @__PURE__ */ c("span", { children: "Live Preview" })]
18064
- })),
18065
- m && (_ != null && _.exportPdf ? _.exportPdf({ onClick: S }) : /* @__PURE__ */ l("button", {
18066
- onClick: S,
18067
- style: h == null ? void 0 : h.exportPdf,
18068
- className: (g == null ? void 0 : g.exportPdf) || "inline-flex items-center space-x-2 px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-sm font-semibold transition-colors shadow-sm shadow-indigo-600/10",
18069
- children: [/* @__PURE__ */ c(Xb, { className: "h-4 w-4" }), /* @__PURE__ */ c("span", { children: "Download PDF" })]
18070
- })),
18071
- p && (_ != null && _.export ? _.export({ onClick: x }) : /* @__PURE__ */ l("button", {
18072
- onClick: x,
18073
- style: h == null ? void 0 : h.export,
18074
- className: (g == null ? void 0 : g.export) || "inline-flex items-center space-x-2 px-4 py-2 bg-orange-600 hover:bg-orange-700 text-white rounded-lg text-sm font-semibold transition-colors shadow-sm shadow-orange-600/10",
18075
- children: [/* @__PURE__ */ c(Wb, { className: "h-4 w-4" }), /* @__PURE__ */ c("span", { children: "Export Template" })]
18076
- }))
18077
- ]
18005
+ className: "flex items-center space-x-2",
18006
+ children: [r && /* @__PURE__ */ l("span", {
18007
+ className: "text-[10px] text-red-500 font-bold bg-red-50 px-2 py-0.5 rounded inline-block border border-red-100",
18008
+ children: ["Error: ", r]
18009
+ }), i && /* @__PURE__ */ c("span", {
18010
+ className: "text-[10px] text-orange-600 font-bold bg-orange-50 px-2 py-0.5 rounded inline-block border border-orange-100 animate-pulse",
18011
+ children: a || "Parsing..."
18012
+ })]
18078
18013
  })]
18079
18014
  });
18080
18015
  }
@@ -18155,8 +18090,36 @@ function fx({ handleSidebarDragStart: e, createTextBlock: t, setBlocks: n, setSe
18155
18090
  }
18156
18091
  //#endregion
18157
18092
  //#region src/components/sidebar/TablesTab.tsx
18158
- function px({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTableName: r, customLoopStart: i, setCustomLoopStart: a, customLoopEnd: o, setCustomLoopEnd: s, handleAddCustomTable: u, handleSidebarDragStart: d, setBlocks: f, setSelectedBlockId: p, setActiveTab: m, defaultStyles: h }) {
18159
- return /* @__PURE__ */ l("div", {
18093
+ function px({ schemas: e, toggleSchemaColumn: t, customTableName: n, setCustomTableName: r, customLoopStart: i, setCustomLoopStart: a, customLoopEnd: o, setCustomLoopEnd: s, handleAddCustomTable: u, handleSidebarDragStart: d, setBlocks: f, setSelectedBlockId: p, setActiveTab: m, defaultStyles: h, isTablesLoading: g, tablesLoading: _ }) {
18094
+ return g || _ ? /* @__PURE__ */ l("div", {
18095
+ className: "space-y-6",
18096
+ children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h3", {
18097
+ className: "text-sm font-bold text-slate-800",
18098
+ children: "Dynamic Tables"
18099
+ }), /* @__PURE__ */ c("p", {
18100
+ className: "text-xs text-slate-500",
18101
+ children: "Configure loop table templates and drag onto the canvas."
18102
+ })] }), /* @__PURE__ */ c("div", {
18103
+ className: "space-y-4 animate-pulse",
18104
+ children: [1, 2].map((e) => /* @__PURE__ */ l("div", {
18105
+ className: "border border-gray-200 rounded-2xl p-4 bg-white space-y-3 shadow-xs",
18106
+ children: [
18107
+ /* @__PURE__ */ l("div", {
18108
+ className: "flex items-center justify-between",
18109
+ children: [/* @__PURE__ */ c("div", { className: "h-4 bg-slate-200 rounded w-1/3" }), /* @__PURE__ */ c("div", { className: "h-3 bg-slate-100 rounded w-16" })]
18110
+ }),
18111
+ /* @__PURE__ */ c("div", { className: "h-9 bg-slate-100 rounded-lg w-full" }),
18112
+ /* @__PURE__ */ l("div", {
18113
+ className: "space-y-2",
18114
+ children: [/* @__PURE__ */ c("div", { className: "h-3 bg-slate-100 rounded w-1/4" }), /* @__PURE__ */ l("div", {
18115
+ className: "h-20 bg-slate-50 border border-gray-100 rounded-lg w-full p-2 space-y-2",
18116
+ children: [/* @__PURE__ */ c("div", { className: "h-3.5 bg-slate-200/70 rounded w-3/4" }), /* @__PURE__ */ c("div", { className: "h-3.5 bg-slate-200/70 rounded w-2/3" })]
18117
+ })]
18118
+ })
18119
+ ]
18120
+ }, e))
18121
+ })]
18122
+ }) : /* @__PURE__ */ l("div", {
18160
18123
  className: "space-y-6",
18161
18124
  children: [
18162
18125
  /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h3", {
@@ -18452,8 +18415,36 @@ function mx({ customImageTypes: e, newImgTypeName: t, setNewImgTypeName: n, hand
18452
18415
  }
18453
18416
  //#endregion
18454
18417
  //#region src/components/sidebar/PlaceholdersTab.tsx
18455
- function hx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceholder: r, placeholderMockData: i, setPlaceholderMockData: a, selectedBlockId: o, setBlocks: s }) {
18456
- let u = () => {
18418
+ function hx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceholder: r, placeholderMockData: i, setPlaceholderMockData: a, selectedBlockId: o, setBlocks: s, isPlaceholdersLoading: u, placeholdersLoading: d }) {
18419
+ if (u || d) return /* @__PURE__ */ l("div", {
18420
+ className: "space-y-4 flex-1 flex flex-col min-h-0",
18421
+ children: [
18422
+ /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("h3", {
18423
+ className: "text-sm font-bold text-slate-800",
18424
+ children: "Variables Palette"
18425
+ }), /* @__PURE__ */ c("p", {
18426
+ className: "text-xs text-slate-500",
18427
+ children: "Click to copy, or drag into text areas. Edit mock values below to visualize content."
18428
+ })] }),
18429
+ /* @__PURE__ */ c("div", { className: "h-9 bg-slate-100 rounded-xl w-full animate-pulse" }),
18430
+ /* @__PURE__ */ c("div", {
18431
+ className: "flex-1 overflow-y-auto space-y-2 pr-1 animate-pulse",
18432
+ children: [
18433
+ 1,
18434
+ 2,
18435
+ 3,
18436
+ 4
18437
+ ].map((e) => /* @__PURE__ */ l("div", {
18438
+ className: "w-full border border-gray-200 p-2.5 rounded-xl bg-white shadow-xs space-y-2",
18439
+ children: [/* @__PURE__ */ l("div", {
18440
+ className: "flex items-center justify-between",
18441
+ children: [/* @__PURE__ */ c("div", { className: "h-3.5 bg-slate-200 rounded w-1/2" }), /* @__PURE__ */ c("div", { className: "h-3.5 bg-slate-100 rounded w-1/4" })]
18442
+ }), /* @__PURE__ */ c("div", { className: "h-6 bg-slate-50 rounded border border-gray-100 w-full" })]
18443
+ }, e))
18444
+ })
18445
+ ]
18446
+ });
18447
+ let f = () => {
18457
18448
  let t = [];
18458
18449
  return (e || []).forEach((e) => {
18459
18450
  t.push({
@@ -18462,12 +18453,12 @@ function hx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceh
18462
18453
  category: e.category || "General"
18463
18454
  });
18464
18455
  }), t.filter((e) => e.label.toLowerCase().includes(n.toLowerCase()) || e.placeholder.toLowerCase().includes(n.toLowerCase()));
18465
- }, d = (e) => {
18456
+ }, p = (e) => {
18466
18457
  if (o) {
18467
18458
  let t = `{{${e.replace(/[{}]/g, "")}}}`;
18468
18459
  s((e) => e.map((e) => e.id === o && e.type !== "table" ? T(T({}, e), {}, { content: e.content + t }) : e));
18469
18460
  }
18470
- }, f = u();
18461
+ }, m = f();
18471
18462
  return /* @__PURE__ */ l("div", {
18472
18463
  className: "space-y-4 flex-1 flex flex-col min-h-0",
18473
18464
  children: [
@@ -18490,10 +18481,10 @@ function hx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceh
18490
18481
  }),
18491
18482
  /* @__PURE__ */ c("div", {
18492
18483
  className: "flex-1 overflow-y-auto space-y-2 pr-1",
18493
- children: f.length === 0 ? /* @__PURE__ */ c("div", {
18484
+ children: m.length === 0 ? /* @__PURE__ */ c("div", {
18494
18485
  className: "text-xs text-slate-400 italic text-center py-4",
18495
18486
  children: "No variables available."
18496
- }) : f.map((e, t) => {
18487
+ }) : m.map((e, t) => {
18497
18488
  let n = e.placeholder.replace(/[{}]/g, "");
18498
18489
  return /* @__PURE__ */ l("div", {
18499
18490
  className: "w-full border border-gray-200 p-2.5 rounded-xl bg-white shadow-xs space-y-2",
@@ -18502,7 +18493,7 @@ function hx({ placeholders: e, schemas: t, searchPlaceholder: n, setSearchPlaceh
18502
18493
  onDragStart: (e) => {
18503
18494
  e.dataTransfer.setData("placeholder", n), e.dataTransfer.effectAllowed = "copy";
18504
18495
  },
18505
- onClick: () => d(e.placeholder),
18496
+ onClick: () => p(e.placeholder),
18506
18497
  className: "flex items-center justify-between cursor-grab active:cursor-grabbing hover:bg-slate-50 p-1 rounded",
18507
18498
  title: "Drag into text or cells, or click to copy",
18508
18499
  children: [/* @__PURE__ */ c("span", {
@@ -19482,7 +19473,7 @@ function gx({ selectedBlockId: e, getSelectedBlock: t, updateSelectedStyle: n, u
19482
19473
  }
19483
19474
  //#endregion
19484
19475
  //#region src/components/SidebarPanel.tsx
19485
- function _x({ activeTab: e, setActiveTab: t, setBlocks: n, selectedBlockId: r, setSelectedBlockId: i, getSelectedBlock: a, defaultStyles: o, createTextBlock: s, createImageBlock: u, updateSelectedStyle: d, updateSelectedImageInfo: f, handleDeleteBlock: p, handleRemoveTableColumn: m, handleAddTableColumn: h, handleUpdateTableColumn: g, handleReorderTableColumn: _, handleAddTableRow: v, handleRemoveTableRow: y, schemas: b, toggleSchemaColumn: x, customTableName: S, setCustomTableName: C, customLoopStart: w, setCustomLoopStart: T, customLoopEnd: E, setCustomLoopEnd: D, handleAddCustomTable: O, newColName: k, setNewColName: A, newColPlaceholder: ee, setNewColPlaceholder: j, customImageTypes: te, newImgTypeName: ne, setNewImgTypeName: re, handleAddCustomImageType: ie, placeholders: M, searchPlaceholder: ae, setSearchPlaceholder: oe, placeholderMockData: se, setPlaceholderMockData: ce, handleSidebarDragStart: le, fontSizesState: ue, fontFamiliesState: de, fontWeightsState: fe }) {
19476
+ function _x({ activeTab: e, setActiveTab: t, setBlocks: n, selectedBlockId: r, setSelectedBlockId: i, getSelectedBlock: a, defaultStyles: o, createTextBlock: s, createImageBlock: u, updateSelectedStyle: d, updateSelectedImageInfo: f, handleDeleteBlock: p, handleRemoveTableColumn: m, handleAddTableColumn: h, handleUpdateTableColumn: g, handleReorderTableColumn: _, handleAddTableRow: v, handleRemoveTableRow: y, schemas: b, toggleSchemaColumn: x, customTableName: S, setCustomTableName: C, customLoopStart: w, setCustomLoopStart: T, customLoopEnd: E, setCustomLoopEnd: D, handleAddCustomTable: O, newColName: k, setNewColName: A, newColPlaceholder: ee, setNewColPlaceholder: j, customImageTypes: te, newImgTypeName: ne, setNewImgTypeName: re, handleAddCustomImageType: ie, placeholders: M, searchPlaceholder: ae, setSearchPlaceholder: oe, placeholderMockData: se, setPlaceholderMockData: ce, handleSidebarDragStart: le, isTablesLoading: ue, tablesLoading: de, isPlaceholdersLoading: fe, placeholdersLoading: pe, fontSizesState: me, fontFamiliesState: he, fontWeightsState: ge }) {
19486
19477
  return /* @__PURE__ */ l("aside", {
19487
19478
  className: "w-full lg:w-[30%] flex flex-col bg-white border-t lg:border-t-0 lg:border-l border-gray-200 overflow-y-auto shrink-0",
19488
19479
  children: [/* @__PURE__ */ c("div", {
@@ -19538,7 +19529,9 @@ function _x({ activeTab: e, setActiveTab: t, setBlocks: n, selectedBlockId: r, s
19538
19529
  setBlocks: n,
19539
19530
  setSelectedBlockId: i,
19540
19531
  setActiveTab: t,
19541
- defaultStyles: o
19532
+ defaultStyles: o,
19533
+ isTablesLoading: ue,
19534
+ tablesLoading: de
19542
19535
  }),
19543
19536
  e === "images" && /* @__PURE__ */ c(mx, {
19544
19537
  customImageTypes: te,
@@ -19559,16 +19552,18 @@ function _x({ activeTab: e, setActiveTab: t, setBlocks: n, selectedBlockId: r, s
19559
19552
  placeholderMockData: se,
19560
19553
  setPlaceholderMockData: ce,
19561
19554
  selectedBlockId: r,
19562
- setBlocks: n
19555
+ setBlocks: n,
19556
+ isPlaceholdersLoading: fe,
19557
+ placeholdersLoading: pe
19563
19558
  }),
19564
19559
  e === "styles" && /* @__PURE__ */ c(gx, {
19565
19560
  selectedBlockId: r,
19566
19561
  getSelectedBlock: a,
19567
19562
  updateSelectedStyle: d,
19568
19563
  updateSelectedImageInfo: f,
19569
- fontSizesState: ue,
19570
- fontFamiliesState: de,
19571
- fontWeightsState: fe,
19564
+ fontSizesState: me,
19565
+ fontFamiliesState: he,
19566
+ fontWeightsState: ge,
19572
19567
  handleDeleteBlock: p,
19573
19568
  newColName: k,
19574
19569
  setNewColName: A,
@@ -19872,60 +19867,119 @@ function Sx({ blocks: e, setBlocks: t, selectedBlockId: n, setSelectedBlockId: r
19872
19867
  }
19873
19868
  //#endregion
19874
19869
  //#region src/components/CanvasToolbar.tsx
19875
- function Cx({ showClearCanvas: e, handleClearCanvas: t, customButtonStyles: n, customButtonClassNames: r, zoom: i, setZoom: a, setPanOffset: o }) {
19870
+ function Cx({ showImportHtml: e = !0, showImportPdf: t = !0, showPreview: n = !0, showExport: r = !0, showExportPdf: i = !0, showClearCanvas: o, customButtonStyles: u, customButtonClassNames: d, customActionComponents: f, handleHtmlImport: p, handlePdfImport: m, setPreviewOpen: h, handleExport: g, handleExportPdf: _, handleClearCanvas: v, zoom: y, setZoom: b, setPanOffset: x }) {
19871
+ let S = a(null), C = a(null);
19876
19872
  return /* @__PURE__ */ l("div", {
19877
- className: "bg-white border-b border-gray-200 px-6 py-3 flex items-center justify-between shadow-xs sticky top-0 z-20",
19878
- children: [/* @__PURE__ */ c("div", {
19879
- className: "flex items-center space-x-4",
19880
- children: e && /* @__PURE__ */ l("button", {
19881
- onClick: t,
19882
- style: n == null ? void 0 : n.clearCanvas,
19883
- className: (r == null ? void 0 : r.clearCanvas) || "inline-flex items-center space-x-1 px-2.5 py-1 text-xs font-semibold border border-red-200 text-red-650 bg-red-50 hover:bg-red-100 rounded-lg transition-colors",
19884
- title: "Clear all canvas elements",
19885
- children: [/* @__PURE__ */ c(sx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ c("span", { children: "Clear Canvas" })]
19886
- })
19873
+ className: "bg-white border-b border-gray-200 px-4 py-2 flex flex-wrap items-center justify-between shadow-xs sticky top-0 z-20 gap-2",
19874
+ children: [/* @__PURE__ */ l("div", {
19875
+ className: "flex flex-wrap items-center gap-1.5",
19876
+ children: [
19877
+ e && /* @__PURE__ */ l(s, { children: [f != null && f.importHtml ? f.importHtml({ onClick: () => {
19878
+ var e;
19879
+ return (e = S.current) == null ? void 0 : e.click();
19880
+ } }) : /* @__PURE__ */ l("button", {
19881
+ onClick: () => {
19882
+ var e;
19883
+ return (e = S.current) == null ? void 0 : e.click();
19884
+ },
19885
+ style: u == null ? void 0 : u.importHtml,
19886
+ className: (d == null ? void 0 : d.importHtml) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-2xs cursor-pointer",
19887
+ title: "Import local HTML file",
19888
+ children: [/* @__PURE__ */ c(lx, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ c("span", { children: "Import HTML" })]
19889
+ }), /* @__PURE__ */ c("input", {
19890
+ type: "file",
19891
+ ref: S,
19892
+ onChange: p,
19893
+ accept: ".html",
19894
+ className: "hidden"
19895
+ })] }),
19896
+ t && /* @__PURE__ */ l(s, { children: [f != null && f.importPdf ? f.importPdf({ onClick: () => {
19897
+ var e;
19898
+ return (e = C.current) == null ? void 0 : e.click();
19899
+ } }) : /* @__PURE__ */ l("button", {
19900
+ onClick: () => {
19901
+ var e;
19902
+ return (e = C.current) == null ? void 0 : e.click();
19903
+ },
19904
+ style: u == null ? void 0 : u.importPdf,
19905
+ className: (d == null ? void 0 : d.importPdf) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-gray-200 rounded-lg text-xs font-semibold bg-white hover:bg-slate-50 text-slate-700 transition-colors shadow-2xs cursor-pointer",
19906
+ title: "Import PDF layout structure",
19907
+ children: [/* @__PURE__ */ c(Kb, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ c("span", { children: "Import PDF" })]
19908
+ }), /* @__PURE__ */ c("input", {
19909
+ type: "file",
19910
+ ref: C,
19911
+ onChange: m,
19912
+ accept: ".pdf",
19913
+ className: "hidden"
19914
+ })] }),
19915
+ n && (f != null && f.preview ? f.preview({ onClick: () => h(!0) }) : /* @__PURE__ */ l("button", {
19916
+ onClick: () => h(!0),
19917
+ style: u == null ? void 0 : u.preview,
19918
+ className: (d == null ? void 0 : d.preview) || "inline-flex items-center space-x-1 px-2.5 py-1 border border-slate-200 rounded-lg text-xs font-semibold bg-slate-50 text-slate-700 hover:bg-slate-100 transition-colors shadow-2xs cursor-pointer",
19919
+ children: [/* @__PURE__ */ c(Gb, { className: "h-3.5 w-3.5 text-slate-500" }), /* @__PURE__ */ c("span", { children: "Live Preview" })]
19920
+ })),
19921
+ i && (f != null && f.exportPdf ? f.exportPdf({ onClick: _ }) : /* @__PURE__ */ l("button", {
19922
+ onClick: _,
19923
+ style: u == null ? void 0 : u.exportPdf,
19924
+ className: (d == null ? void 0 : d.exportPdf) || "inline-flex items-center space-x-1 px-2.5 py-1 bg-indigo-600 hover:bg-indigo-700 text-white rounded-lg text-xs font-semibold transition-colors shadow-2xs shadow-indigo-600/10 cursor-pointer",
19925
+ children: [/* @__PURE__ */ c(Xb, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ c("span", { children: "Download PDF" })]
19926
+ })),
19927
+ r && (f != null && f.export ? f.export({ onClick: g }) : /* @__PURE__ */ l("button", {
19928
+ onClick: g,
19929
+ style: u == null ? void 0 : u.export,
19930
+ className: (d == null ? void 0 : d.export) || "inline-flex items-center space-x-1 px-2.5 py-1 bg-orange-600 hover:bg-orange-700 text-white rounded-lg text-xs font-semibold transition-colors shadow-2xs shadow-orange-600/10 cursor-pointer",
19931
+ children: [/* @__PURE__ */ c(Wb, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ c("span", { children: "Export Template" })]
19932
+ })),
19933
+ o && /* @__PURE__ */ l("button", {
19934
+ onClick: v,
19935
+ style: u == null ? void 0 : u.clearCanvas,
19936
+ className: (d == null ? void 0 : d.clearCanvas) || "inline-flex items-center space-x-1 px-2.5 py-1 text-xs font-semibold border border-red-200 text-red-650 bg-red-50 hover:bg-red-100 rounded-lg transition-colors cursor-pointer",
19937
+ title: "Clear all canvas elements",
19938
+ children: [/* @__PURE__ */ c(sx, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ c("span", { children: "Clear Canvas" })]
19939
+ })
19940
+ ]
19887
19941
  }), /* @__PURE__ */ l("div", {
19888
- className: "flex items-center space-x-3 bg-slate-50 border border-gray-200 px-3 py-1 rounded-xl shadow-xs select-none",
19942
+ className: "flex items-center space-x-2 bg-slate-50 border border-gray-200 px-2.5 py-0.5 rounded-xl shadow-xs select-none shrink-0",
19889
19943
  children: [
19890
19944
  /* @__PURE__ */ l("div", {
19891
19945
  className: "flex items-center space-x-1",
19892
19946
  children: [
19893
19947
  /* @__PURE__ */ c("button", {
19894
- onClick: () => a((e) => Math.max(e - .1, .5)),
19895
- className: "h-6 w-6 rounded border border-gray-200 bg-white hover:bg-slate-50 flex items-center justify-center font-bold text-slate-650 hover:text-slate-900 transition-colors text-xs select-none",
19948
+ onClick: () => b((e) => Math.max(e - .1, .5)),
19949
+ className: "h-5 w-5 rounded border border-gray-200 bg-white hover:bg-slate-50 flex items-center justify-center font-bold text-slate-650 hover:text-slate-900 transition-colors text-[10px] select-none cursor-pointer",
19896
19950
  title: "Zoom Out",
19897
19951
  children: "−"
19898
19952
  }),
19899
19953
  /* @__PURE__ */ l("div", {
19900
- className: "w-12 text-center text-xs font-bold text-slate-700",
19901
- children: [Math.round(i * 100), "%"]
19954
+ className: "w-10 text-center text-[11px] font-bold text-slate-700",
19955
+ children: [Math.round(y * 100), "%"]
19902
19956
  }),
19903
19957
  /* @__PURE__ */ c("button", {
19904
- onClick: () => a((e) => Math.min(e + .1, 2)),
19905
- className: "h-6 w-6 rounded border border-gray-200 bg-white hover:bg-slate-50 flex items-center justify-center font-bold text-slate-650 hover:text-slate-900 transition-colors text-xs select-none",
19958
+ onClick: () => b((e) => Math.min(e + .1, 2)),
19959
+ className: "h-5 w-5 rounded border border-gray-200 bg-white hover:bg-slate-50 flex items-center justify-center font-bold text-slate-650 hover:text-slate-900 transition-colors text-[10px] select-none cursor-pointer",
19906
19960
  title: "Zoom In",
19907
19961
  children: "+"
19908
19962
  })
19909
19963
  ]
19910
19964
  }),
19911
- /* @__PURE__ */ c("div", { className: "h-4 w-[1px] bg-gray-200" }),
19965
+ /* @__PURE__ */ c("div", { className: "h-3.5 w-[1px] bg-gray-200" }),
19912
19966
  /* @__PURE__ */ c("input", {
19913
19967
  type: "range",
19914
19968
  min: "0.5",
19915
19969
  max: "2.0",
19916
19970
  step: "0.05",
19917
- value: i,
19918
- onChange: (e) => a(parseFloat(e.target.value)),
19919
- className: "w-20 accent-orange-600 h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
19971
+ value: y,
19972
+ onChange: (e) => b(parseFloat(e.target.value)),
19973
+ className: "w-16 accent-orange-600 h-1 bg-gray-200 rounded-lg appearance-none cursor-pointer"
19920
19974
  }),
19921
19975
  /* @__PURE__ */ c("button", {
19922
19976
  onClick: () => {
19923
- a(1), o({
19977
+ b(1), x({
19924
19978
  x: 0,
19925
19979
  y: 0
19926
19980
  });
19927
19981
  },
19928
- className: "text-[10px] font-bold text-slate-500 hover:text-slate-800 hover:underline",
19982
+ className: "text-[9px] font-bold text-slate-500 hover:text-slate-800 hover:underline cursor-pointer",
19929
19983
  children: "Reset"
19930
19984
  })
19931
19985
  ]
@@ -20105,14 +20159,14 @@ var Ex = (e) => {
20105
20159
  });
20106
20160
  }), t;
20107
20161
  }, Dx = (e) => e ? e.replace(/contenteditable="[^"]*"/g, "").replace(/class="[^"]*"/g, "").replace(/data-placeholder="[^"]*"/g, "").replace(/&nbsp;/g, " ").trim() : "";
20108
- function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r, headerTitle: a = "HTML Template Builder", headerSubtitle: s = "Design and export templates dynamically", headerLogo: u, typographySizes: d, typographyWeights: f, typographyFonts: p, templatingLanguage: m = "csharp", loopSyntax: h = "foreach", onChange: g, onExport: _, onExportPdf: y, initialBlocks: b, defaultStyles: x, showImportHtml: S = !0, showImportPdf: C = !0, showClearCanvas: w = !0, showPreview: E = !0, showExport: D = !0, showExportPdf: O = !0, customButtonStyles: A, customButtonClassNames: ee, customActionComponents: j } = {}) {
20109
- let { zoom: te, setZoom: ne, panOffset: re, setPanOffset: ie, spacePressed: M, canvasHeight: ae, viewportRef: oe, canvasContainerRef: se, handleMouseDown: ce, handleMouseMove: le, handleMouseUp: ue } = Cb(), { customTableName: de, setCustomTableName: fe, customLoopStart: pe, setCustomLoopStart: me, customLoopEnd: he, setCustomLoopEnd: ge, newColName: _e, setNewColName: ve, newColPlaceholder: ye, setNewColPlaceholder: be, bubbleCoords: xe, setBubbleCoords: Se, schemas: Ce, isParsing: we, setIsParsing: Te, parseStatusText: N, setParseStatusText: P, parseError: Ee, setParseError: De, draggedSidebarItem: Oe, setDraggedSidebarItem: ke, dragOverIndex: Ae, setDragOverIndex: je, newImgTypeName: Me, setNewImgTypeName: Ne, customImageTypes: Pe, searchPlaceholder: Fe, setSearchPlaceholder: Ie, handleAddCustomTable: Le, handleAddCustomImageType: Re, toggleSchemaColumn: F, applySelectionFormat: I, setSavedRange: L } = wb({ tableSchemas: e }), { blocks: ze, setBlocks: Be, selectedBlockId: Ve, setSelectedBlockId: He, getSelectedBlock: R, createTextBlock: Ue, createTableBlock: We, createImageBlock: Ge, handleDeleteBlock: Ke, handleDuplicateBlock: qe, handleMoveBlockUp: Je, handleMoveBlockDown: Ye, updateSelectedStyle: Xe, updateSelectedImageInfo: Ze, handleRemoveTableColumn: z, handleAddTableColumn: B, handleUpdateTableColumn: Qe, handleReorderTableColumn: $e, handleAddTableRow: et, handleRemoveTableRow: tt } = Sb({
20162
+ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r, headerTitle: a = "HTML Template Builder", headerSubtitle: s = "Design and export templates dynamically", headerLogo: u, typographySizes: d, typographyWeights: f, typographyFonts: p, templatingLanguage: m = "csharp", loopSyntax: h = "foreach", onChange: g, onExport: _, onExportPdf: y, initialBlocks: b, defaultStyles: x, showImportHtml: S = !0, showImportPdf: C = !0, showClearCanvas: w = !0, showPreview: E = !0, showExport: D = !0, showExportPdf: O = !0, showHeader: A = !0, isTablesLoading: ee, tablesLoading: j, isPlaceholdersLoading: te, placeholdersLoading: ne, customButtonStyles: re, customButtonClassNames: ie, customActionComponents: M } = {}) {
20163
+ let { zoom: ae, setZoom: oe, panOffset: se, setPanOffset: ce, spacePressed: le, canvasHeight: ue, viewportRef: de, canvasContainerRef: fe, handleMouseDown: pe, handleMouseMove: me, handleMouseUp: he } = Cb(), { customTableName: ge, setCustomTableName: _e, customLoopStart: ve, setCustomLoopStart: ye, customLoopEnd: be, setCustomLoopEnd: xe, newColName: Se, setNewColName: Ce, newColPlaceholder: we, setNewColPlaceholder: Te, bubbleCoords: N, setBubbleCoords: P, schemas: Ee, isParsing: De, setIsParsing: Oe, parseStatusText: ke, setParseStatusText: Ae, parseError: je, setParseError: Me, draggedSidebarItem: Ne, setDraggedSidebarItem: Pe, dragOverIndex: Fe, setDragOverIndex: Ie, newImgTypeName: Le, setNewImgTypeName: Re, customImageTypes: F, searchPlaceholder: I, setSearchPlaceholder: ze, handleAddCustomTable: Be, handleAddCustomImageType: Ve, toggleSchemaColumn: He, applySelectionFormat: Ue, setSavedRange: L } = wb({ tableSchemas: e }), { blocks: We, setBlocks: Ge, selectedBlockId: Ke, setSelectedBlockId: qe, getSelectedBlock: Je, createTextBlock: Ye, createTableBlock: Xe, createImageBlock: Ze, handleDeleteBlock: Qe, handleDuplicateBlock: R, handleMoveBlockUp: z, handleMoveBlockDown: $e, updateSelectedStyle: et, updateSelectedImageInfo: tt, handleRemoveTableColumn: nt, handleAddTableColumn: rt, handleUpdateTableColumn: it, handleReorderTableColumn: at, handleAddTableRow: ot, handleRemoveTableRow: st } = Sb({
20110
20164
  initialBlocks: b,
20111
20165
  defaultStyles: x,
20112
20166
  defaultLogo: n,
20113
20167
  defaultBanner: r,
20114
20168
  onChange: g
20115
- }), [nt, rt] = o("text"), [it, at] = o(!1), [ot] = o(!0), [st] = o(d || [
20169
+ }), [ct, lt] = o("text"), [B, ut] = o(!1), [dt] = o(!0), [ft] = o(d || [
20116
20170
  {
20117
20171
  label: "8px",
20118
20172
  value: "8px"
@@ -20165,7 +20219,7 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20165
20219
  label: "36px",
20166
20220
  value: "36px"
20167
20221
  }
20168
- ]), [ct] = o(p || [
20222
+ ]), [pt] = o(p || [
20169
20223
  {
20170
20224
  label: "Outfit (Default)",
20171
20225
  value: "'Outfit', 'Inter', sans-serif"
@@ -20190,7 +20244,7 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20190
20244
  label: "Courier New (Mono)",
20191
20245
  value: "'Courier New', monospace"
20192
20246
  }
20193
- ]), [lt] = o(f || [
20247
+ ]), [mt] = o(f || [
20194
20248
  {
20195
20249
  label: "Light",
20196
20250
  value: "300"
@@ -20215,116 +20269,116 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20215
20269
  label: "Extra Bold",
20216
20270
  value: "800"
20217
20271
  }
20218
- ]), [ut] = o(m), [dt] = o(h), [ft] = o(!0), [pt, mt] = o({});
20272
+ ]), [ht] = o(m), [gt] = o(h), [_t] = o(!0), [vt, yt] = o({});
20219
20273
  i(() => {
20220
20274
  let e = () => {
20221
20275
  let e = window.getSelection();
20222
20276
  if (!e || e.isCollapsed || e.toString().trim() === "") {
20223
- Se(null), L(null);
20277
+ P(null), L(null);
20224
20278
  return;
20225
20279
  }
20226
20280
  let t = document.activeElement;
20227
20281
  if (!(t && t.getAttribute("contenteditable") === "true" && (t.closest(".canvas-editor-area") || t.closest("td")))) {
20228
- Se(null), L(null);
20282
+ P(null), L(null);
20229
20283
  return;
20230
20284
  }
20231
20285
  try {
20232
20286
  let t = e.getRangeAt(0), n = t.getBoundingClientRect(), r = document.queryCommandValue("formatBlock") || "";
20233
- r = r.toUpperCase(), Se({
20287
+ r = r.toUpperCase(), P({
20234
20288
  x: n.left + n.width / 2,
20235
20289
  y: n.top - 38,
20236
20290
  format: r
20237
20291
  }), L(t);
20238
20292
  } catch (e) {
20239
- Se(null), L(null);
20293
+ P(null), L(null);
20240
20294
  }
20241
20295
  };
20242
20296
  return document.addEventListener("selectionchange", e), () => document.removeEventListener("selectionchange", e);
20243
- }, [Se]), i(() => {
20297
+ }, [P]), i(() => {
20244
20298
  let e = {};
20245
20299
  (t || []).forEach((t) => {
20246
20300
  let n = t.placeholder.replace(/[{}]/g, "");
20247
20301
  e[n] = t.mockValue || "";
20248
- }), Ce.forEach((t) => {
20302
+ }), Ee.forEach((t) => {
20249
20303
  t.columns.forEach((t) => {
20250
20304
  let n = t.placeholder.replace(/[{}]/g, "").replace(/^(\.\.\/|package\.|item\.)/, "");
20251
20305
  e[n] || (e[n] = t.mockValue || "");
20252
20306
  });
20253
- }), mt(e);
20254
- }, [t, Ce]), i(() => {
20255
- let e = oe.current;
20307
+ }), yt(e);
20308
+ }, [t, Ee]), i(() => {
20309
+ let e = de.current;
20256
20310
  if (!e) return;
20257
20311
  let t = (e) => {
20258
20312
  if (e.ctrlKey) {
20259
20313
  e.preventDefault();
20260
20314
  let t = e.deltaY < 0 ? 1 : -1;
20261
- ne((e) => Math.min(2, Math.max(.5, e + t * .05)));
20315
+ oe((e) => Math.min(2, Math.max(.5, e + t * .05)));
20262
20316
  }
20263
20317
  };
20264
20318
  return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
20265
- }, [oe, ne]), i(() => {
20319
+ }, [de, oe]), i(() => {
20266
20320
  window.updateContentFromRawDelete = (e, t) => {
20267
- Be((n) => n.map((n) => n.id === e ? T(T({}, n), {}, { content: t }) : n));
20321
+ Ge((n) => n.map((n) => n.id === e ? T(T({}, n), {}, { content: t }) : n));
20268
20322
  };
20269
- }, [Be]);
20270
- let ht = (e) => {
20323
+ }, [Ge]);
20324
+ let bt = (e) => {
20271
20325
  var t;
20272
20326
  let n = (t = e.target.files) == null ? void 0 : t[0];
20273
20327
  if (!n) return;
20274
- Te(!0), P("Parsing HTML..."), De(null);
20328
+ Oe(!0), Ae("Parsing HTML..."), Me(null);
20275
20329
  let r = new FileReader();
20276
20330
  r.onload = (t) => {
20277
20331
  try {
20278
20332
  var n;
20279
20333
  let e = bb((n = t.target) == null ? void 0 : n.result);
20280
- e.length > 0 && Be(e);
20334
+ e.length > 0 && Ge(e);
20281
20335
  } catch (e) {
20282
- console.error(e), De(e.message || "Failed to parse HTML");
20336
+ console.error(e), Me(e.message || "Failed to parse HTML");
20283
20337
  } finally {
20284
- Te(!1), e.target && (e.target.value = "");
20338
+ Oe(!1), e.target && (e.target.value = "");
20285
20339
  }
20286
20340
  }, r.readAsText(n);
20287
- }, gt = (e) => {
20341
+ }, xt = (e) => {
20288
20342
  var t;
20289
20343
  let n = (t = e.target.files) == null ? void 0 : t[0];
20290
20344
  if (!n) return;
20291
- Te(!0), P("Reading PDF text layers..."), De(null);
20345
+ Oe(!0), Ae("Reading PDF text layers..."), Me(null);
20292
20346
  let r = new FileReader();
20293
20347
  r.onload = v(function* () {
20294
20348
  try {
20295
20349
  let e = r.result, t = yield xb(e, k);
20296
- t.length > 0 && Be((e) => [...e, ...t]);
20350
+ t.length > 0 && Ge((e) => [...e, ...t]);
20297
20351
  } catch (e) {
20298
- console.error(e), De(e.message || "Failed to read PDF");
20352
+ console.error(e), Me(e.message || "Failed to read PDF");
20299
20353
  } finally {
20300
- Te(!1), e.target && (e.target.value = "");
20354
+ Oe(!1), e.target && (e.target.value = "");
20301
20355
  }
20302
20356
  }), r.readAsArrayBuffer(n);
20303
- }, _t = (e) => {
20357
+ }, St = (e) => {
20304
20358
  let t = e || "items";
20305
- if (ut === "handlebars" || ut === "mustache") {
20306
- let e = dt === "foreach" ? "foreach" : "each";
20359
+ if (ht === "handlebars" || ht === "mustache") {
20360
+ let e = gt === "foreach" ? "foreach" : "each";
20307
20361
  return {
20308
20362
  start: `{{#${e} ${t}}}`,
20309
20363
  end: `{{/${e}}}`
20310
20364
  };
20311
20365
  }
20312
- return ut === "liquid" || ut === "scriban" || ut === "dotnet" ? {
20366
+ return ht === "liquid" || ht === "scriban" || ht === "dotnet" ? {
20313
20367
  start: `{% for ${t.endsWith("s") ? t.slice(0, -1) : "item"} in ${t} %}`,
20314
20368
  end: "{% endfor %}"
20315
- } : ut === "js" || ut === "ts" ? {
20369
+ } : ht === "js" || ht === "ts" ? {
20316
20370
  start: `\${${t}.map(${t.endsWith("s") ? t.slice(0, -1) : "item"} => \``,
20317
20371
  end: "`).join('')}"
20318
- } : ut === "csharp" || ut === "razor" ? {
20372
+ } : ht === "csharp" || ht === "razor" ? {
20319
20373
  start: `@foreach (var ${t.endsWith("s") ? t.slice(0, -1) : "item"} in ${t}) {`,
20320
20374
  end: "}"
20321
20375
  } : {
20322
- start: pe.replace("items", t),
20323
- end: he
20376
+ start: ve.replace("items", t),
20377
+ end: be
20324
20378
  };
20325
- }, vt = (e = !1) => {
20379
+ }, Ct = (e = !1) => {
20326
20380
  let t = "<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Exported HTML Template</title>\n <style>\n body { font-family: 'Outfit', 'Inter', sans-serif; padding: 30px; background-color: #f8fafc; color: #1e293b; max-width: 800px; margin: 0 auto; line-height: 1.5; }\n .block-container { box-sizing: border-box; page-break-inside: avoid; break-inside: avoid; }\n table { width: 100%; border-collapse: collapse; margin: 10px 0; }\n th { background-color: #f1f5f9; color: #334155; border: 1px solid #e2e8f0; padding: 6px 8px; font-weight: 600; text-align: left; }\n td { border: 1px solid #e2e8f0; padding: 6px 8px; color: #475569; }\n tr:nth-child(even) { background-color: #f8fafc; }\n span[data-placeholder] { background-color: #f1f5f9; color: #1e293b; border: 1px solid #e2e8f0; padding: 1px 4px; border-radius: 3px; font-weight: 600; display: inline-flex; font-size: inherit; }\n h1, h2, h3, h4, h5, h6, p { margin:5px; }\n </style>\n</head>\n<body>\n";
20327
- return Ex(ze).forEach((n) => {
20381
+ return Ex(We).forEach((n) => {
20328
20382
  let r = n.blocks.length > 1;
20329
20383
  if (r) {
20330
20384
  var i;
@@ -20347,7 +20401,7 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20347
20401
  let r = (t.columns || []).filter((e) => e.enabled !== !1), i = " <table style=\"width: 100%; border-collapse: collapse; margin: 4px 0;\">\n";
20348
20402
  if (i += " <thead>\n", i += " <tr>\n", r.forEach((e) => {
20349
20403
  i += ` <th>${e.columnName || ""}</th>\n`;
20350
- }), i += " </tr>\n", i += " </thead>\n", i += " <tbody>\n", e && ot) {
20404
+ }), i += " </tr>\n", i += " </thead>\n", i += " <tbody>\n", e && dt) {
20351
20405
  let e = t.columnName;
20352
20406
  (n && Array.isArray(n[e]) ? n[e] : [{}]).forEach((e) => {
20353
20407
  i += " <tr>\n", r.forEach((t) => {
@@ -20355,17 +20409,17 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20355
20409
  typeof e == "object" && e && Object.keys(e).forEach((t) => {
20356
20410
  let r = RegExp(`\\{\\{(item\\.|package\\.)?${t}\\}\\}`, "g");
20357
20411
  n = n.replace(r, e[t]);
20358
- }), Object.keys(pt).forEach((e) => {
20359
- let t = pt[e];
20412
+ }), Object.keys(vt).forEach((e) => {
20413
+ let t = vt[e];
20360
20414
  n.includes(`{{${e}}}`) && (n = n.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
20361
20415
  }), n = n.replace(/\{\{[^}]+\}\}/g, ""), i += ` <td>${n}</td>\n`;
20362
20416
  }), i += " </tr>\n";
20363
20417
  });
20364
20418
  } else {
20365
- let e = t.columnName || "items", n = _t(e);
20366
- ft ? i += ` <!-- ${n.start} --><tr>\n` : i += ` ${n.start}<tr>\n`, r.forEach((e) => {
20419
+ let e = t.columnName || "items", n = St(e);
20420
+ _t ? i += ` <!-- ${n.start} --><tr>\n` : i += ` ${n.start}<tr>\n`, r.forEach((e) => {
20367
20421
  i += ` <td>${e.placeholder}</td>\n`;
20368
- }), ft ? i += ` </tr><!-- ${n.end} -->\n` : i += ` </tr>${n.end}\n`;
20422
+ }), _t ? i += ` </tr><!-- ${n.end} -->\n` : i += ` </tr>${n.end}\n`;
20369
20423
  }
20370
20424
  return i += " </tbody>\n", i += " </table>", i;
20371
20425
  }, c = (t) => {
@@ -20374,30 +20428,30 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20374
20428
  if (r.loop && r.columns && r.columns.length > 0) n += ` <td>\n${s(r, t)}\n </td>\n`;
20375
20429
  else {
20376
20430
  let i = Dx(r.placeholder);
20377
- e && ot && (Object.keys(t).forEach((e) => {
20431
+ e && dt && (Object.keys(t).forEach((e) => {
20378
20432
  i.includes(`{{${e}}}`) && (i = i.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t[e])), i.includes(`{{item.${e}}}`) && (i = i.replace(RegExp(`\\{\\{item\\.${e}\\}\\}`, "g"), t[e])), i.includes(`{{package.${e}}}`) && (i = i.replace(RegExp(`\\{\\{package\\.${e}\\}\\}`, "g"), t[e]));
20379
- }), Object.keys(pt).forEach((e) => {
20380
- let t = pt[e];
20433
+ }), Object.keys(vt).forEach((e) => {
20434
+ let t = vt[e];
20381
20435
  i.includes(`{{${e}}}`) && (i = i.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t));
20382
20436
  }), i = i.replace(/\{\{[^}]+\}\}/g, "")), n += ` <td>${i}</td>\n`;
20383
20437
  }
20384
20438
  }), n += " </tr>\n", n;
20385
20439
  };
20386
- if (e && ot) {
20440
+ if (e && dt) {
20387
20441
  let e = [];
20388
20442
  e = r.mockRows && r.mockRows.length > 0 ? r.mockRows : [{}], e.forEach((e) => {
20389
20443
  t += c(e);
20390
20444
  });
20391
20445
  } else {
20392
- let e = r.tableName === "package" ? "shipment.packages" : r.tableName === "article" ? "package.articles" : r.tableName, n = _t(e);
20393
- ft ? t += ` <!-- ${n.start} --><tr>\n` : t += ` ${n.start}<tr>\n`, a.forEach((e) => {
20446
+ let e = r.tableName === "package" ? "shipment.packages" : r.tableName === "article" ? "package.articles" : r.tableName, n = St(e);
20447
+ _t ? t += ` <!-- ${n.start} --><tr>\n` : t += ` ${n.start}<tr>\n`, a.forEach((e) => {
20394
20448
  e.loop && e.columns && e.columns.length > 0 ? t += ` <td>\n${s(e)}\n </td>\n` : t += ` <td>${e.placeholder}</td>\n`;
20395
- }), ft ? t += ` </tr><!-- ${n.end} -->\n` : t += ` </tr>${n.end}\n`;
20449
+ }), _t ? t += ` </tr><!-- ${n.end} -->\n` : t += ` </tr>${n.end}\n`;
20396
20450
  }
20397
20451
  t += " </tbody>\n", t += " </table>\n", t += " </div>\n";
20398
20452
  } else if (n.type === "image") {
20399
20453
  let i = n.imageInfo || { imageType: "logo" }, a = "", s = n.style.height || n.style.minHeight || "auto";
20400
- a = i.imageType === "barcode" ? e && ot ? vb(i.barcodeValue || "SHIP-99201") : `<img src="${i.barcodePlaceholder || "{{barcode}}"}" style="width: 100%; height: ${s}; display: block;" alt="Barcode" />` : `<img src="${i.url || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg=="}" style="width: 100%; height: auto; max-height: ${s === "auto" ? "300px" : s}; object-fit: ${n.style.objectFit || "contain"}; ${n.style.opacity ? `opacity: ${n.style.opacity};` : ""} display: block;" alt="${i.imageType}" />`;
20454
+ a = i.imageType === "barcode" ? e && dt ? vb(i.barcodeValue || "SHIP-99201") : `<img src="${i.barcodePlaceholder || "{{barcode}}"}" style="width: 100%; height: ${s}; display: block;" alt="Barcode" />` : `<img src="${i.url || "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI4MDAiIGhlaWdodD0iNDAwIiB2aWV3Qm94PSIwIDAgODAwIDQwMCI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iI2YxZjVmOSIvPjxyZWN0IHg9IjEwIiB5PSIxMCIgd2lkdGg9Ijc4MCIgaGVpZ2h0PSIzODAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2RiZTJmNiIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtZGFzaGFycmF5PSI2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSInT3V0Zml0JywgJ0ludGVyJywgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyNCIgZm9udC13ZWlnaHQ9IjYwMCIgZmlsbD0iIzk0YTNiOCIgZG9taW5hbnQtYmFzZWxpbmU9Im1pZGRsZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+U2VsZWN0IEltYWdlPC90ZXh0Pjwvc3ZnPg=="}" style="width: 100%; height: auto; max-height: ${s === "auto" ? "300px" : s}; object-fit: ${n.style.objectFit || "contain"}; ${n.style.opacity ? `opacity: ${n.style.opacity};` : ""} display: block;" alt="${i.imageType}" />`;
20401
20455
  let c = r ? "100%" : n.style.width || "100%";
20402
20456
  t += ` <div class="block-container" style="display: block; width: ${o}; text-align: ${n.style.textAlign || "left"}; border: none; background-color: transparent; ${n.style.marginBottom ? `margin-bottom: ${n.style.marginBottom};` : ""}">\n`, t += ` <div style="width: ${c}; display: inline-block;">\n`, t += ` ${a}\n`, t += " </div>\n", t += " </div>\n";
20403
20457
  } else {
@@ -20411,22 +20465,22 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20411
20465
  "h6"
20412
20466
  ].includes(n.type) ? r = n.type : n.type === "title" ? r = "h1" : n.type === "subtitle" ? r = "h2" : n.type === "caption" && (r = "span");
20413
20467
  let a = Dx(n.content);
20414
- e && ot && (Object.keys(pt).forEach((e) => {
20415
- let t = pt[e];
20468
+ e && dt && (Object.keys(vt).forEach((e) => {
20469
+ let t = vt[e];
20416
20470
  a = a.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), t);
20417
20471
  }), a = a.replace(/\{\{[^}]+\}\}/g, "")), t += ` <div class="block-container" style="${l} text-align: ${n.style.textAlign};">\n`, t += ` <${r} style="${i}">${a}</${r}>\n`, t += " </div>\n";
20418
20472
  }
20419
20473
  }), r && (t += " </div>\n");
20420
20474
  }), t += "</body>\n</html>", t;
20421
- }, yt = () => {
20422
- let e = vt(!1);
20475
+ }, wt = () => {
20476
+ let e = Ct(!1);
20423
20477
  if (_) _(e);
20424
20478
  else {
20425
20479
  let t = new Blob([e], { type: "text/html;charset=utf-8;" }), n = document.createElement("a");
20426
20480
  n.href = URL.createObjectURL(t), n.download = "exported_template.html", n.click();
20427
20481
  }
20428
- }, bt = () => {
20429
- let e = vt(!0);
20482
+ }, Tt = () => {
20483
+ let e = Ct(!0);
20430
20484
  if (y) y(e);
20431
20485
  else {
20432
20486
  let t = window.open("", "_blank");
@@ -20434,22 +20488,22 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20434
20488
  t.print(), t.close();
20435
20489
  }, 500));
20436
20490
  }
20437
- }, xt = () => {
20438
- Be([]), He(null);
20439
- }, St = (e, t) => {
20491
+ }, Et = () => {
20492
+ Ge([]), qe(null);
20493
+ }, Dt = (e, t) => {
20440
20494
  let n = e.dataTransfer.getData("placeholder");
20441
20495
  if (!n) return;
20442
20496
  e.preventDefault(), e.stopPropagation();
20443
20497
  let r = `{{${n.replace(/[{}]/g, "")}}}`;
20444
- Be((e) => e.map((e) => e.id === t ? T(T({}, e), {}, { content: e.content + r }) : e));
20445
- }, Ct = (e, t, n, r) => {
20498
+ Ge((e) => e.map((e) => e.id === t ? T(T({}, e), {}, { content: e.content + r }) : e));
20499
+ }, Ot = (e, t, n, r) => {
20446
20500
  let i = e.dataTransfer.getData("placeholder");
20447
20501
  if (!i) return;
20448
20502
  e.preventDefault(), e.stopPropagation();
20449
20503
  let a = i.startsWith("{{") ? i : `{{${i}}}`;
20450
- wt(t, n, a, r);
20451
- }, wt = (e, t, n, r) => {
20452
- Be((i) => i.map((i) => {
20504
+ kt(t, n, a, r);
20505
+ }, kt = (e, t, n, r) => {
20506
+ Ge((i) => i.map((i) => {
20453
20507
  if (i.id === e && i.type === "table" && i.tableInfo) {
20454
20508
  var a;
20455
20509
  let e = [...i.tableInfo.columns];
@@ -20465,145 +20519,147 @@ function Ox({ tableSchemas: e, placeholders: t, defaultLogo: n, defaultBanner: r
20465
20519
  return /* @__PURE__ */ l("div", {
20466
20520
  className: "min-h-screen bg-slate-50 flex flex-col font-sans",
20467
20521
  children: [
20468
- /* @__PURE__ */ c(dx, {
20522
+ A && /* @__PURE__ */ c(dx, {
20469
20523
  headerLogo: u,
20470
20524
  headerTitle: a,
20471
20525
  headerSubtitle: s,
20472
- parseError: Ee,
20473
- isParsing: we,
20474
- parseStatusText: N,
20475
- showImportHtml: S,
20476
- showImportPdf: C,
20477
- showPreview: E,
20478
- showExport: D,
20479
- showExportPdf: O,
20480
- customButtonStyles: A,
20481
- customButtonClassNames: ee,
20482
- customActionComponents: j,
20483
- handleHtmlImport: ht,
20484
- handlePdfImport: gt,
20485
- setPreviewOpen: at,
20486
- handleExport: yt,
20487
- handleExportPdf: bt
20526
+ parseError: je,
20527
+ isParsing: De,
20528
+ parseStatusText: ke
20488
20529
  }),
20489
20530
  /* @__PURE__ */ l("div", {
20490
20531
  className: "flex-1 flex flex-col lg:flex-row overflow-hidden",
20491
20532
  children: [/* @__PURE__ */ l("main", {
20492
20533
  className: "w-full lg:w-[70%] flex flex-col bg-slate-100 border-b lg:border-b-0 lg:border-r border-gray-200 overflow-hidden relative",
20493
20534
  children: [/* @__PURE__ */ c(Cx, {
20535
+ showImportHtml: S,
20536
+ showImportPdf: C,
20537
+ showPreview: E,
20538
+ showExport: D,
20539
+ showExportPdf: O,
20494
20540
  showClearCanvas: w,
20495
- handleClearCanvas: xt,
20496
- customButtonStyles: A,
20497
- customButtonClassNames: ee,
20498
- zoom: te,
20499
- setZoom: ne,
20500
- setPanOffset: ie
20541
+ customButtonStyles: re,
20542
+ customButtonClassNames: ie,
20543
+ customActionComponents: M,
20544
+ handleHtmlImport: bt,
20545
+ handlePdfImport: xt,
20546
+ setPreviewOpen: ut,
20547
+ handleExport: wt,
20548
+ handleExportPdf: Tt,
20549
+ handleClearCanvas: Et,
20550
+ zoom: ae,
20551
+ setZoom: oe,
20552
+ setPanOffset: ce
20501
20553
  }), /* @__PURE__ */ c(Sx, {
20502
- blocks: ze,
20503
- setBlocks: Be,
20504
- selectedBlockId: Ve,
20505
- setSelectedBlockId: He,
20506
- setActiveTab: rt,
20507
- showMockData: ot,
20508
- placeholderMockData: pt,
20509
- dragOverIndex: Ae,
20510
- setDragOverIndex: je,
20511
- draggedSidebarItem: Oe,
20554
+ blocks: We,
20555
+ setBlocks: Ge,
20556
+ selectedBlockId: Ke,
20557
+ setSelectedBlockId: qe,
20558
+ setActiveTab: lt,
20559
+ showMockData: dt,
20560
+ placeholderMockData: vt,
20561
+ dragOverIndex: Fe,
20562
+ setDragOverIndex: Ie,
20563
+ draggedSidebarItem: Ne,
20512
20564
  defaultStyles: x,
20513
- zoom: te,
20514
- panOffset: re,
20515
- spacePressed: M,
20516
- canvasHeight: ae,
20517
- viewportRef: oe,
20518
- canvasContainerRef: se,
20519
- handleMouseDown: ce,
20520
- handleMouseMove: le,
20521
- handleMouseUp: ue,
20522
- createTextBlock: Ue,
20523
- duplicateBlock: qe,
20565
+ zoom: ae,
20566
+ panOffset: se,
20567
+ spacePressed: le,
20568
+ canvasHeight: ue,
20569
+ viewportRef: de,
20570
+ canvasContainerRef: fe,
20571
+ handleMouseDown: pe,
20572
+ handleMouseMove: me,
20573
+ handleMouseUp: he,
20574
+ createTextBlock: Ye,
20575
+ duplicateBlock: R,
20524
20576
  reorderBlock: (e, t) => {
20525
- t === "up" ? Je(e) : Ye(e);
20577
+ t === "up" ? z(e) : $e(e);
20526
20578
  },
20527
- handleDeleteBlock: Ke,
20579
+ handleDeleteBlock: Qe,
20528
20580
  handleSidebarDrop: (e) => {
20529
- if (!Oe) return;
20581
+ if (!Ne) return;
20530
20582
  let t;
20531
- if (Oe.type === "table" && Oe.tableSchema) t = We(Oe.tableSchema);
20532
- else if (Oe.type === "image" && Oe.imageType) t = Ge(Oe.imageType);
20583
+ if (Ne.type === "table" && Ne.tableSchema) t = Xe(Ne.tableSchema);
20584
+ else if (Ne.type === "image" && Ne.imageType) t = Ze(Ne.imageType);
20533
20585
  else {
20534
20586
  let e = "Enter text here...";
20535
- Oe.type === "h1" ? e = "Heading 1" : Oe.type === "h2" ? e = "Heading 2" : Oe.type === "h3" ? e = "Heading 3" : Oe.type === "title" ? e = "Document Title" : Oe.type === "subtitle" ? e = "Document Subtitle" : Oe.type === "caption" && (e = "Caption text..."), t = Ue(Oe.type, e, x == null ? void 0 : x[Oe.type]);
20587
+ Ne.type === "h1" ? e = "Heading 1" : Ne.type === "h2" ? e = "Heading 2" : Ne.type === "h3" ? e = "Heading 3" : Ne.type === "title" ? e = "Document Title" : Ne.type === "subtitle" ? e = "Document Subtitle" : Ne.type === "caption" && (e = "Caption text..."), t = Ye(Ne.type, e, x == null ? void 0 : x[Ne.type]);
20536
20588
  }
20537
- Be((n) => {
20589
+ Ge((n) => {
20538
20590
  let r = [...n];
20539
20591
  return r.splice(e, 0, t), r;
20540
- }), He(t.id), rt("styles");
20592
+ }), qe(t.id), lt("styles");
20541
20593
  },
20542
- handleTableCellDrop: Ct,
20543
- updateTableCell: wt,
20544
- handleTextDrop: St
20594
+ handleTableCellDrop: Ot,
20595
+ updateTableCell: kt,
20596
+ handleTextDrop: Dt
20545
20597
  })]
20546
20598
  }), /* @__PURE__ */ c(_x, {
20547
- activeTab: nt,
20548
- setActiveTab: rt,
20549
- setBlocks: Be,
20550
- selectedBlockId: Ve,
20551
- setSelectedBlockId: He,
20552
- getSelectedBlock: R,
20599
+ activeTab: ct,
20600
+ setActiveTab: lt,
20601
+ setBlocks: Ge,
20602
+ selectedBlockId: Ke,
20603
+ setSelectedBlockId: qe,
20604
+ getSelectedBlock: Je,
20553
20605
  defaultStyles: x,
20554
- createTextBlock: Ue,
20555
- createImageBlock: Ge,
20556
- updateSelectedStyle: Xe,
20557
- updateSelectedImageInfo: Ze,
20558
- handleDeleteBlock: Ke,
20559
- handleRemoveTableColumn: z,
20560
- handleAddTableColumn: B,
20561
- handleUpdateTableColumn: Qe,
20562
- handleReorderTableColumn: $e,
20563
- handleAddTableRow: et,
20564
- handleRemoveTableRow: tt,
20565
- schemas: Ce,
20566
- toggleSchemaColumn: F,
20567
- customTableName: de,
20568
- setCustomTableName: fe,
20569
- customLoopStart: pe,
20570
- setCustomLoopStart: me,
20571
- customLoopEnd: he,
20572
- setCustomLoopEnd: ge,
20573
- handleAddCustomTable: Le,
20574
- newColName: _e,
20575
- setNewColName: ve,
20576
- newColPlaceholder: ye,
20577
- setNewColPlaceholder: be,
20578
- customImageTypes: Pe,
20579
- newImgTypeName: Me,
20580
- setNewImgTypeName: Ne,
20581
- handleAddCustomImageType: Re,
20606
+ createTextBlock: Ye,
20607
+ createImageBlock: Ze,
20608
+ updateSelectedStyle: et,
20609
+ updateSelectedImageInfo: tt,
20610
+ handleDeleteBlock: Qe,
20611
+ handleRemoveTableColumn: nt,
20612
+ handleAddTableColumn: rt,
20613
+ handleUpdateTableColumn: it,
20614
+ handleReorderTableColumn: at,
20615
+ handleAddTableRow: ot,
20616
+ handleRemoveTableRow: st,
20617
+ schemas: Ee,
20618
+ toggleSchemaColumn: He,
20619
+ customTableName: ge,
20620
+ setCustomTableName: _e,
20621
+ customLoopStart: ve,
20622
+ setCustomLoopStart: ye,
20623
+ customLoopEnd: be,
20624
+ setCustomLoopEnd: xe,
20625
+ handleAddCustomTable: Be,
20626
+ newColName: Se,
20627
+ setNewColName: Ce,
20628
+ newColPlaceholder: we,
20629
+ setNewColPlaceholder: Te,
20630
+ customImageTypes: F,
20631
+ newImgTypeName: Le,
20632
+ setNewImgTypeName: Re,
20633
+ handleAddCustomImageType: Ve,
20582
20634
  placeholders: t,
20583
- searchPlaceholder: Fe,
20584
- setSearchPlaceholder: Ie,
20585
- placeholderMockData: pt,
20586
- setPlaceholderMockData: mt,
20635
+ searchPlaceholder: I,
20636
+ setSearchPlaceholder: ze,
20637
+ placeholderMockData: vt,
20638
+ setPlaceholderMockData: yt,
20587
20639
  handleSidebarDragStart: (e, t, n, r) => {
20588
- ke({
20640
+ Pe({
20589
20641
  type: t,
20590
20642
  tableSchema: n,
20591
20643
  imageType: r
20592
20644
  }), e.dataTransfer.setData("source", "sidebar"), e.dataTransfer.effectAllowed = "copy";
20593
20645
  },
20594
- fontSizesState: st,
20595
- fontFamiliesState: ct,
20596
- fontWeightsState: lt
20646
+ isTablesLoading: ee,
20647
+ tablesLoading: j,
20648
+ isPlaceholdersLoading: te,
20649
+ placeholdersLoading: ne,
20650
+ fontSizesState: ft,
20651
+ fontFamiliesState: pt,
20652
+ fontWeightsState: mt
20597
20653
  })]
20598
20654
  }),
20599
20655
  /* @__PURE__ */ c(Tx, {
20600
- bubbleCoords: xe,
20601
- applySelectionFormat: I
20656
+ bubbleCoords: N,
20657
+ applySelectionFormat: Ue
20602
20658
  }),
20603
20659
  /* @__PURE__ */ c(wx, {
20604
- previewOpen: it,
20605
- setPreviewOpen: at,
20606
- generateExportHtml: vt
20660
+ previewOpen: B,
20661
+ setPreviewOpen: ut,
20662
+ generateExportHtml: Ct
20607
20663
  })
20608
20664
  ]
20609
20665
  });