@commentkit/comment-kit 1.5.1 → 1.6.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/npm/THIRD_PARTY_NOTICES.txt +2 -2
  3. package/dist/npm/chunks/{AgentSend-DjFZSC0S.js → AgentSend-2JPDseOo.js} +4 -5
  4. package/dist/npm/chunks/{Checklist-BEz4IZdT.js → Checklist-BpDXQebo.js} +77 -79
  5. package/dist/npm/chunks/Composer-CAyj-c8e.js +677 -0
  6. package/dist/npm/chunks/Guest-ZdFmTcXI.js +187 -0
  7. package/dist/npm/chunks/{MarkupEditor-CPH4yKx4.js → MarkupEditor-BFplZwFy.js} +3 -5
  8. package/dist/npm/chunks/{Panel-DSoUAlbQ.js → Panel-BhZ4XRDR.js} +300 -302
  9. package/dist/npm/chunks/{Settings-C_qV4n7J.js → Settings-SPG9EHUZ.js} +70 -72
  10. package/dist/npm/chunks/{Shortcuts-ChnaribX.js → Shortcuts-C28HVDw6.js} +3 -5
  11. package/dist/npm/chunks/{StyleEditor-DqZd6C5o.js → StyleEditor-ByZMtq10.js} +4 -5
  12. package/dist/npm/chunks/{StylePanel-DMC3riYK.js → StylePanel-Iwhce2tE.js} +62 -64
  13. package/dist/npm/chunks/{TaskFields-BfjjllMx.js → TaskFields-BsP_fVJg.js} +7 -6
  14. package/dist/npm/chunks/{ThreadCard-DmKAelSL.js → ThreadCard-BzVZdDCb.js} +407 -403
  15. package/dist/npm/chunks/{Viewer-mw69qSI5.js → Viewer-CqtGrdD8.js} +29 -31
  16. package/dist/npm/chunks/{agent-CqDO3JMA.js → agent-BDMQtOzH.js} +14 -15
  17. package/dist/npm/chunks/{anchor-OCQnjp_6.js → anchor-BsradQhn.js} +1 -2
  18. package/dist/npm/chunks/{ar-BQ9K9Oqf.js → ar-8tPch6W4.js} +5 -2
  19. package/dist/npm/chunks/{card-bits-C7bIk5KX.js → card-bits-Bna-g3Py.js} +24 -26
  20. package/dist/npm/chunks/{client-dZeNdizE.js → client-EFTWxHbJ.js} +76 -61
  21. package/dist/npm/chunks/{colors-CAjY4jxf.js → colors-CWAn_swA.js} +1 -2
  22. package/dist/npm/chunks/{confetti-DKeKR7-6.js → confetti-DTKpwF3O.js} +1 -2
  23. package/dist/npm/chunks/{de-CcPi8xdC.js → de-C63897uD.js} +5 -2
  24. package/dist/npm/chunks/{drafts-CpQdHhcK.js → drafts-akdBsOd0.js} +1 -2
  25. package/dist/npm/chunks/{es-DXgkjDCG.js → es-CI2bSpvB.js} +5 -2
  26. package/dist/npm/chunks/{extension-BFkXOmX5.js → extension-BST6LH1q.js} +2 -3
  27. package/dist/npm/chunks/{extension-Gvei3opb.js → extension-D-V3utTm.js} +3 -4
  28. package/dist/npm/chunks/{fr-IjJaUbWh.js → fr-rsVe-Lqk.js} +5 -2
  29. package/dist/npm/chunks/{hi-BhKQK2MU.js → hi-cvwbSaWP.js} +5 -2
  30. package/dist/npm/chunks/{html2canvas-pro.esm-lgs6tb4C.js → html2canvas-pro.esm-B7b8p5Wr.js} +608 -528
  31. package/dist/npm/chunks/{i18n-DAJGndZ2.js → i18n-C4v0M-6z.js} +254 -257
  32. package/dist/npm/chunks/{it-DKiSCkiD.js → it-C8tnV0BF.js} +5 -2
  33. package/dist/npm/chunks/{ja-BI1WagDg.js → ja-BWxDfC2f.js} +5 -2
  34. package/dist/npm/chunks/{live-MvvBdoGd.js → live-BCpJVBeN.js} +2 -3
  35. package/dist/npm/chunks/{lock-C82sC17d.js → lock-B1JLlOhz.js} +0 -1
  36. package/dist/npm/chunks/{nl-CJw3VUQ5.js → nl-DNQ6eCht.js} +5 -2
  37. package/dist/npm/chunks/{pick-dDDLxCDI.js → pick-CLyOdjnD.js} +3 -4
  38. package/dist/npm/chunks/{pt-BR-CjBolC5g.js → pt-BR-CkG7vpU2.js} +5 -2
  39. package/dist/npm/chunks/{realtime-D22tI_AS.js → realtime-DIo-Wth4.js} +2 -3
  40. package/dist/npm/chunks/{report-DoDVi1qT.js → report-BBrT3r89.js} +1 -2
  41. package/dist/npm/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  42. package/dist/npm/chunks/{source-BQS2_xfB.js → source-CS7C6wJA.js} +2 -3
  43. package/dist/npm/chunks/{src-C_oUnL0i.js → src-C4FsVoUp.js} +22 -24
  44. package/dist/npm/chunks/{start-C5-rebEU.js → start-i9M-r3aH.js} +374 -357
  45. package/dist/npm/chunks/{upload-CzPAjktW.js → upload-DSv7EyBD.js} +2 -3
  46. package/dist/npm/chunks/uploads-I01kdqQF.js +1103 -0
  47. package/dist/npm/chunks/{zh-CN-BrZGx2S0.js → zh-CN-BKuZOLBE.js} +5 -2
  48. package/dist/npm/element.js +2 -3
  49. package/dist/npm/headless.js +2 -2
  50. package/dist/npm/index.js +2 -2
  51. package/dist/npm/react.js +2 -3
  52. package/dist/npm/svelte.js +2 -3
  53. package/dist/npm/types/core/auth.d.ts +14 -0
  54. package/dist/npm/vue.js +2 -3
  55. package/package.json +8 -8
  56. package/dist/npm/chunks/Composer-D1wbmdjF.js +0 -681
  57. package/dist/npm/chunks/Guest-CtyRy8Kz.js +0 -170
  58. package/dist/npm/chunks/uploads-tpLjiJdH.js +0 -541
@@ -1,4 +1,4 @@
1
- //#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
1
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/typeof.js
2
2
  function e(t) {
3
3
  "@babel/helpers - typeof";
4
4
  return e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
@@ -7,8 +7,7 @@ function e(t) {
7
7
  return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
8
8
  }, e(t);
9
9
  }
10
- //#endregion
11
- //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
10
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPrimitive.js
12
11
  function t(t, n) {
13
12
  if (e(t) != "object" || !t) return t;
14
13
  var r = t[Symbol.toPrimitive];
@@ -19,14 +18,12 @@ function t(t, n) {
19
18
  }
20
19
  return (n === "string" ? String : Number)(t);
21
20
  }
22
- //#endregion
23
- //#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
21
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/toPropertyKey.js
24
22
  function n(n) {
25
23
  var r = t(n, "string");
26
24
  return e(r) == "symbol" ? r : r + "";
27
25
  }
28
- //#endregion
29
- //#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
26
+ // \0@oxc-project+runtime@0.155.0/helpers/esm/defineProperty.js
30
27
  function r(e, t, r) {
31
28
  return (t = n(t)) in e ? Object.defineProperty(e, t, {
32
29
  value: r,
@@ -35,8 +32,7 @@ function r(e, t, r) {
35
32
  writable: !0
36
33
  }) : e[t] = r, e;
37
34
  }
38
- //#endregion
39
- //#region node_modules/html2canvas-pro/dist/html2canvas-pro.esm.js
35
+ // node_modules/html2canvas-pro/dist/html2canvas-pro.esm.js
40
36
  var i, a, o, s;
41
37
  function c(e) {
42
38
  var t = typeof trustedTypes < "u" ? trustedTypes : null;
@@ -218,6 +214,21 @@ var l = class e {
218
214
  error: "CSP nonce contains invalid characters"
219
215
  };
220
216
  }
217
+ validateBackgroundColor(e) {
218
+ return e === null ? {
219
+ valid: !0,
220
+ sanitized: null
221
+ } : typeof e != "string" || e.length === 0 ? {
222
+ valid: !1,
223
+ error: "backgroundColor must be a CSS color string or null"
224
+ } : /[^a-zA-Z0-9%(),.#\s/-]/.test(e) ? {
225
+ valid: !1,
226
+ error: `backgroundColor contains characters that cannot appear in a CSS color: ${e}`
227
+ } : {
228
+ valid: !0,
229
+ sanitized: e
230
+ };
231
+ }
221
232
  validateImageTimeout(e) {
222
233
  return typeof e != "number" || isNaN(e) ? {
223
234
  valid: !1,
@@ -316,6 +327,10 @@ var l = class e {
316
327
  let n = this.validateCspNonce(e.cspNonce);
317
328
  n.valid || t.push(`CSP nonce: ${n.error}`);
318
329
  }
330
+ if (e.backgroundColor !== void 0) {
331
+ let n = this.validateBackgroundColor(e.backgroundColor);
332
+ n.valid || t.push(`backgroundColor: ${n.error}`);
333
+ }
319
334
  if (this.config.customValidator) {
320
335
  let n = this.config.customValidator(e, "options");
321
336
  n.valid || t.push(`Custom validation: ${n.error}`);
@@ -424,7 +439,7 @@ var f = class {
424
439
  let n = e[t];
425
440
  if (n === void 0) throw Error(`Missing element at index ${t}`);
426
441
  return n;
427
- }, _ = 65533, v = (e) => e >= 48 && e <= 57, y = (e) => e >= 55296 && e <= 57343, b = (e) => v(e) || e >= 65 && e <= 70 || e >= 97 && e <= 102, x = (e) => e >= 97 && e <= 122, S = (e) => e >= 65 && e <= 90, ee = (e) => x(e) || S(e), te = (e) => e >= 128, C = (e) => e === 10 || e === 9 || e === 32, ne = (e) => ee(e) || te(e) || e === 95, re = (e) => ne(e) || v(e) || e === 45, ie = (e) => e >= 0 && e <= 8 || e === 11 || e >= 14 && e <= 31 || e === 127, w = (e, t) => e === 92 && t !== 10, ae = (e, t, n) => e === 45 ? ne(t) || w(t, n) : !!(ne(e) || e === 92 && w(e, t)), oe = (e, t, n) => e === 43 || e === 45 ? v(t) ? !0 : t === 46 && v(n) : v(e === 46 ? t : e), se = (e) => {
442
+ }, _ = 65533, v = (e) => e >= 48 && e <= 57, y = (e) => e >= 55296 && e <= 57343, b = (e) => v(e) || e >= 65 && e <= 70 || e >= 97 && e <= 102, x = (e) => e >= 97 && e <= 122, S = (e) => e >= 65 && e <= 90, C = (e) => x(e) || S(e), ee = (e) => e >= 128, w = (e) => e === 10 || e === 9 || e === 32, te = (e) => C(e) || ee(e) || e === 95, ne = (e) => te(e) || v(e) || e === 45, re = (e) => e >= 0 && e <= 8 || e === 11 || e >= 14 && e <= 31 || e === 127, ie = (e, t) => e === 92 && t !== 10, ae = (e, t, n) => e === 45 ? te(t) || ie(t, n) : !!(te(e) || e === 92 && ie(e, t)), oe = (e, t, n) => e === 43 || e === 45 ? v(t) ? !0 : t === 46 && v(n) : v(e === 46 ? t : e), se = (e) => {
428
443
  let t = 0, n = 1;
429
444
  (e[t] === 43 || e[t] === 45) && (e[t] === 45 && (n = -1), t++);
430
445
  let r = [];
@@ -468,7 +483,7 @@ var f = class {
468
483
  case 34: return this.consumeStringToken(34);
469
484
  case 35: {
470
485
  let e = this.peekCodePoint(0), t = this.peekCodePoint(1), n = this.peekCodePoint(2);
471
- if (re(e) || w(t, n)) {
486
+ if (ne(e) || ie(t, n)) {
472
487
  let r = ae(e, t, n) ? 2 : 1;
473
488
  return {
474
489
  type: 5,
@@ -520,7 +535,7 @@ var f = class {
520
535
  break;
521
536
  case 91: return Te;
522
537
  case 92:
523
- if (w(e, this.peekCodePoint(0))) return this.reconsumeCodePoint(e), this.consumeIdentLikeToken();
538
+ if (ie(e, this.peekCodePoint(0))) return this.reconsumeCodePoint(e), this.consumeIdentLikeToken();
524
539
  break;
525
540
  case 93: return Ee;
526
541
  case 94:
@@ -542,7 +557,7 @@ var f = class {
542
557
  break;
543
558
  case -1: return Oe;
544
559
  }
545
- return C(e) ? (this.consumeWhiteSpace(), De) : v(e) ? (this.reconsumeCodePoint(e), this.consumeNumericToken()) : ne(e) ? (this.reconsumeCodePoint(e), this.consumeIdentLikeToken()) : {
560
+ return w(e) ? (this.consumeWhiteSpace(), De) : v(e) ? (this.reconsumeCodePoint(e), this.consumeNumericToken()) : te(e) ? (this.reconsumeCodePoint(e), this.consumeIdentLikeToken()) : {
546
561
  type: 6,
547
562
  value: String.fromCodePoint(e)
548
563
  };
@@ -615,25 +630,25 @@ var f = class {
615
630
  type: 22,
616
631
  value: String.fromCodePoint(...e)
617
632
  };
618
- if (C(t)) return this.consumeWhiteSpace(), this.peekCodePoint(0) === -1 || this.peekCodePoint(0) === 41 ? (this.consumeCodePoint(), {
633
+ if (w(t)) return this.consumeWhiteSpace(), this.peekCodePoint(0) === -1 || this.peekCodePoint(0) === 41 ? (this.consumeCodePoint(), {
619
634
  type: 22,
620
635
  value: String.fromCodePoint(...e)
621
636
  }) : (this.consumeBadUrlRemnants(), ye);
622
- if (t === 34 || t === 39 || t === 40 || ie(t)) return this.consumeBadUrlRemnants(), ye;
637
+ if (t === 34 || t === 39 || t === 40 || re(t)) return this.consumeBadUrlRemnants(), ye;
623
638
  if (t === 92) {
624
- if (w(t, this.peekCodePoint(0))) e.push(this.consumeEscapedCodePoint());
639
+ if (ie(t, this.peekCodePoint(0))) e.push(this.consumeEscapedCodePoint());
625
640
  else return this.consumeBadUrlRemnants(), ye;
626
641
  } else e.push(t);
627
642
  }
628
643
  }
629
644
  consumeWhiteSpace() {
630
- for (; C(this.peekCodePoint(0));) this.consumeCodePoint();
645
+ for (; w(this.peekCodePoint(0));) this.consumeCodePoint();
631
646
  }
632
647
  consumeBadUrlRemnants() {
633
648
  for (;;) {
634
649
  let e = this.consumeCodePoint();
635
650
  if (e === 41 || e === -1) return;
636
- w(e, this.peekCodePoint(0)) && this.consumeEscapedCodePoint();
651
+ ie(e, this.peekCodePoint(0)) && this.consumeEscapedCodePoint();
637
652
  }
638
653
  }
639
654
  consumeStringSlice(e) {
@@ -655,7 +670,7 @@ var f = class {
655
670
  if (r === 10) return this._cursor += n, be;
656
671
  if (r === 92) {
657
672
  let e = this._value[this._cursor + n + 1];
658
- e !== -1 && e !== void 0 && (e === 10 ? (t += this.consumeStringSlice(n), n = -1, this._cursor++) : w(r, e) && (t += this.consumeStringSlice(n), t += String.fromCodePoint(this.consumeEscapedCodePoint()), n = -1));
673
+ e !== -1 && e !== void 0 && (e === 10 ? (t += this.consumeStringSlice(n), n = -1, this._cursor++) : ie(r, e) && (t += this.consumeStringSlice(n), t += String.fromCodePoint(this.consumeEscapedCodePoint()), n = -1));
659
674
  }
660
675
  n++;
661
676
  } while (1);
@@ -693,7 +708,7 @@ var f = class {
693
708
  if (b(e)) {
694
709
  let t = String.fromCodePoint(e);
695
710
  for (; b(this.peekCodePoint(0)) && t.length < 6;) t += String.fromCodePoint(this.consumeCodePoint());
696
- C(this.peekCodePoint(0)) && this.consumeCodePoint();
711
+ w(this.peekCodePoint(0)) && this.consumeCodePoint();
697
712
  let n = parseInt(t, 16);
698
713
  return n === 0 || y(n) || n > 1114111 ? _ : n;
699
714
  }
@@ -703,8 +718,8 @@ var f = class {
703
718
  let e = "";
704
719
  for (;;) {
705
720
  let t = this.consumeCodePoint();
706
- if (re(t)) e += String.fromCodePoint(t);
707
- else if (w(t, this.peekCodePoint(0))) e += String.fromCodePoint(this.consumeEscapedCodePoint());
721
+ if (ne(t)) e += String.fromCodePoint(t);
722
+ else if (ie(t, this.peekCodePoint(0))) e += String.fromCodePoint(this.consumeEscapedCodePoint());
708
723
  else return this.reconsumeCodePoint(t), e;
709
724
  }
710
725
  }
@@ -4284,7 +4299,7 @@ var Ei = {
4284
4299
  for (let e of t) E(e) && n.push(e.number);
4285
4300
  return n.length === 0 ? null : [g(n, 0), n.length > 1 ? g(n, 1) : g(n, 0)];
4286
4301
  }
4287
- }, $o = 1e4, es = 3e4, ts = 6e4, ns = [
4302
+ }, $o = 1e4, es = 3e4, ts = 1e4, ns = 6e4, rs = [
4288
4303
  [
4289
4304
  "animationDuration",
4290
4305
  ro,
@@ -4795,10 +4810,10 @@ var Ei = {
4795
4810
  Xo,
4796
4811
  "webkitBoxReflect"
4797
4812
  ]
4798
- ], rs = /* @__PURE__ */ new Map(), is = (e, t, n) => {
4813
+ ], is = /* @__PURE__ */ new Map(), as = (e, t, n) => {
4799
4814
  let r = n == null ? t.initialValue : n.toString();
4800
4815
  r.trim() === "" && (r = t.initialValue);
4801
- let i = rs.get(t);
4816
+ let i = is.get(t);
4802
4817
  if (i) {
4803
4818
  let e = i.get(r);
4804
4819
  if (e !== void 0) return i.delete(r), i.set(r, e), e;
@@ -4832,7 +4847,7 @@ var Ei = {
4832
4847
  }
4833
4848
  }
4834
4849
  })();
4835
- if (i || (i = /* @__PURE__ */ new Map(), rs.set(t, i)), !(t.skipCache || t.type === 3 && t.format === "image")) {
4850
+ if (i || (i = /* @__PURE__ */ new Map(), is.set(t, i)), !(t.skipCache || t.type === 3 && t.format === "image")) {
4836
4851
  if (i.size >= 200) {
4837
4852
  let e = i.keys().next().value;
4838
4853
  e !== void 0 && i.delete(e);
@@ -4840,7 +4855,7 @@ var Ei = {
4840
4855
  i.set(r, s);
4841
4856
  }
4842
4857
  return s;
4843
- }, as = class {
4858
+ }, os = class {
4844
4859
  constructor(e) {
4845
4860
  r(this, "styles", void 0), this.styles = e;
4846
4861
  }
@@ -4904,7 +4919,7 @@ var Ei = {
4904
4919
  get boxShadow() {
4905
4920
  return this.styles.boxShadow;
4906
4921
  }
4907
- }, os = class {
4922
+ }, ss = class {
4908
4923
  constructor(e) {
4909
4924
  r(this, "styles", void 0), this.styles = e;
4910
4925
  }
@@ -4932,7 +4947,7 @@ var Ei = {
4932
4947
  get blendMode() {
4933
4948
  return this.styles.backgroundBlendMode;
4934
4949
  }
4935
- }, ss = class {
4950
+ }, cs = class {
4936
4951
  constructor(e) {
4937
4952
  r(this, "styles", void 0), this.styles = e;
4938
4953
  }
@@ -5017,7 +5032,7 @@ var Ei = {
5017
5032
  get paintOrder() {
5018
5033
  return this.styles.paintOrder;
5019
5034
  }
5020
- }, cs = class {
5035
+ }, ls = class {
5021
5036
  constructor(e) {
5022
5037
  r(this, "styles", void 0), this.styles = e;
5023
5038
  }
@@ -5135,27 +5150,27 @@ var Ei = {
5135
5150
  isInlineLevel() {
5136
5151
  return this.styles.isInlineLevel();
5137
5152
  }
5138
- }, ls = class {
5153
+ }, us = class {
5139
5154
  get border() {
5140
- return this._border ?? (this._border = new as(this));
5155
+ return this._border ?? (this._border = new os(this));
5141
5156
  }
5142
5157
  get background() {
5143
- return this._background ?? (this._background = new os(this));
5158
+ return this._background ?? (this._background = new ss(this));
5144
5159
  }
5145
5160
  get font() {
5146
- return this._font ?? (this._font = new ss(this));
5161
+ return this._font ?? (this._font = new cs(this));
5147
5162
  }
5148
5163
  get layout() {
5149
- return this._layout ?? (this._layout = new cs(this));
5164
+ return this._layout ?? (this._layout = new ls(this));
5150
5165
  }
5151
5166
  constructor(e, t) {
5152
5167
  if (r(this, "animationDuration", void 0), r(this, "backgroundClip", void 0), r(this, "backgroundColor", void 0), r(this, "backgroundImage", void 0), r(this, "backgroundOrigin", void 0), r(this, "backgroundPosition", void 0), r(this, "backgroundRepeat", void 0), r(this, "backgroundSize", void 0), r(this, "borderTopColor", void 0), r(this, "borderRightColor", void 0), r(this, "borderBottomColor", void 0), r(this, "borderLeftColor", void 0), r(this, "borderTopLeftRadius", void 0), r(this, "borderTopRightRadius", void 0), r(this, "borderBottomRightRadius", void 0), r(this, "borderBottomLeftRadius", void 0), r(this, "borderTopStyle", void 0), r(this, "borderRightStyle", void 0), r(this, "borderBottomStyle", void 0), r(this, "borderLeftStyle", void 0), r(this, "borderTopWidth", void 0), r(this, "borderRightWidth", void 0), r(this, "borderBottomWidth", void 0), r(this, "borderLeftWidth", void 0), r(this, "boxShadow", void 0), r(this, "clipPath", void 0), r(this, "color", void 0), r(this, "direction", void 0), r(this, "display", void 0), r(this, "float", void 0), r(this, "fontFamily", void 0), r(this, "fontSize", void 0), r(this, "fontStyle", void 0), r(this, "fontVariant", void 0), r(this, "fontWeight", void 0), r(this, "letterSpacing", void 0), r(this, "lineBreak", void 0), r(this, "lineHeight", void 0), r(this, "listStyleImage", void 0), r(this, "listStylePosition", void 0), r(this, "listStyleType", void 0), r(this, "marginTop", void 0), r(this, "marginRight", void 0), r(this, "marginBottom", void 0), r(this, "marginLeft", void 0), r(this, "opacity", void 0), r(this, "overflowX", void 0), r(this, "overflowY", void 0), r(this, "overflowWrap", void 0), r(this, "paddingTop", void 0), r(this, "paddingRight", void 0), r(this, "paddingBottom", void 0), r(this, "paddingLeft", void 0), r(this, "paintOrder", void 0), r(this, "position", void 0), r(this, "textAlign", void 0), r(this, "textDecorationColor", void 0), r(this, "textDecorationLine", void 0), r(this, "textDecorationStyle", void 0), r(this, "textDecorationThickness", void 0), r(this, "textUnderlineOffset", void 0), r(this, "textShadow", void 0), r(this, "textTransform", void 0), r(this, "textOverflow", void 0), r(this, "transform", void 0), r(this, "transformOrigin", void 0), r(this, "rotate", void 0), r(this, "translate", void 0), r(this, "scale", void 0), r(this, "visibility", void 0), r(this, "webkitTextStrokeColor", void 0), r(this, "webkitTextStrokeWidth", void 0), r(this, "webkitLineClamp", void 0), r(this, "wordBreak", void 0), r(this, "whiteSpace", void 0), r(this, "writingMode", void 0), r(this, "zIndex", void 0), r(this, "objectFit", void 0), r(this, "imageRendering", void 0), r(this, "mixBlendMode", void 0), r(this, "filter", void 0), r(this, "fontVariantLigatures", void 0), r(this, "zoom", void 0), r(this, "objectPosition", void 0), r(this, "backgroundBlendMode", void 0), r(this, "borderImageSource", void 0), r(this, "borderImageSlice", void 0), r(this, "borderImageRepeat", void 0), r(this, "boxDecorationBreak", void 0), r(this, "accentColor", void 0), r(this, "webkitTextFillColor", void 0), r(this, "isolation", void 0), r(this, "outlineColor", void 0), r(this, "outlineStyle", void 0), r(this, "outlineWidth", void 0), r(this, "outlineOffset", void 0), r(this, "backdropFilter", void 0), r(this, "maskImage", void 0), r(this, "maskPosition", void 0), r(this, "maskRepeat", void 0), r(this, "maskSize", void 0), r(this, "textEmphasisStyle", void 0), r(this, "textEmphasisColor", void 0), r(this, "textEmphasisPosition", void 0), r(this, "borderImageWidth", void 0), r(this, "borderImageOutset", void 0), r(this, "webkitBoxReflect", void 0), r(this, "_border", void 0), r(this, "_background", void 0), r(this, "_font", void 0), r(this, "_layout", void 0), t.display === "none") {
5153
5168
  this.display = 0;
5154
- for (let [t, n] of ns) t !== "display" && (this[t] = is(e, n, void 0));
5155
- Object.assign(this, us(e, null));
5169
+ for (let [t, n] of rs) t !== "display" && (this[t] = as(e, n, void 0));
5170
+ Object.assign(this, ds(e, null));
5156
5171
  } else {
5157
- for (let [n, r, i] of ns) this[n] = is(e, r, t[i]);
5158
- Object.assign(this, us(e, t));
5172
+ for (let [n, r, i] of rs) this[n] = as(e, r, t[i]);
5173
+ Object.assign(this, ds(e, t));
5159
5174
  }
5160
5175
  }
5161
5176
  isVisible() {
@@ -5179,38 +5194,38 @@ var Ei = {
5179
5194
  isInlineLevel() {
5180
5195
  return H(this.display, 4) || H(this.display, 33554432) || H(this.display, 268435456) || H(this.display, 536870912) || H(this.display, 67108864) || H(this.display, 134217728);
5181
5196
  }
5182
- }, us = (e, t) => {
5197
+ }, ds = (e, t) => {
5183
5198
  let n = (e, n) => {
5184
5199
  if (t) return t[e] ?? n;
5185
- }, r = is(e, Lr, n("overflow"));
5200
+ }, r = as(e, Lr, n("overflow"));
5186
5201
  return {
5187
- float: is(e, Ir, n("cssFloat")),
5188
- textDecorationColor: is(e, Rr, n("textDecorationColor", n("color"))),
5189
- textDecorationLine: is(e, zr, n("textDecorationLine", n("textDecoration"))),
5202
+ float: as(e, Ir, n("cssFloat")),
5203
+ textDecorationColor: as(e, Rr, n("textDecorationColor", n("color"))),
5204
+ textDecorationLine: as(e, zr, n("textDecorationLine", n("textDecoration"))),
5190
5205
  overflowX: r[0],
5191
5206
  overflowY: r[+(r.length > 1)]
5192
5207
  };
5193
- }, ds = class {
5208
+ }, fs = class {
5194
5209
  constructor(e, t) {
5195
- r(this, "content", void 0), r(this, "quotes", void 0), this.content = is(e, Br, t.content), this.quotes = is(e, Vr, t.quotes);
5210
+ r(this, "content", void 0), r(this, "quotes", void 0), this.content = as(e, Br, t.content), this.quotes = as(e, Vr, t.quotes);
5196
5211
  }
5197
- }, fs = class {
5212
+ }, ps = class {
5198
5213
  constructor(e, t) {
5199
- r(this, "counterIncrement", void 0), r(this, "counterReset", void 0), this.counterIncrement = is(e, Wr, t.counterIncrement), this.counterReset = is(e, Gr, t.counterReset);
5214
+ r(this, "counterIncrement", void 0), r(this, "counterReset", void 0), this.counterIncrement = as(e, Wr, t.counterIncrement), this.counterReset = as(e, Gr, t.counterReset);
5200
5215
  }
5201
- }, ps = "data-html2canvas-debug", ms = (e) => {
5216
+ }, ms = "data-html2canvas-debug", hs = (e) => {
5202
5217
  if (typeof e.getAttribute != "function") return 0;
5203
- switch (e.getAttribute(ps)) {
5218
+ switch (e.getAttribute(ms)) {
5204
5219
  case "all": return 1;
5205
5220
  case "clone": return 2;
5206
5221
  case "parse": return 3;
5207
5222
  case "render": return 4;
5208
5223
  default: return 0;
5209
5224
  }
5210
- }, hs = (e, t) => {
5211
- let n = ms(e);
5225
+ }, gs = (e, t) => {
5226
+ let n = hs(e);
5212
5227
  return n === 1 || t === n;
5213
- }, gs = (e) => {
5228
+ }, _s = (e) => {
5214
5229
  let t = "";
5215
5230
  for (let n of e) try {
5216
5231
  let e = n.cssRules;
@@ -5220,12 +5235,12 @@ var Ei = {
5220
5235
  }
5221
5236
  } catch {}
5222
5237
  return t;
5223
- }, _s = (e, t, n) => {
5224
- let r = gs(t);
5238
+ }, vs = (e, t, n) => {
5239
+ let r = _s(t);
5225
5240
  if (!r) return null;
5226
5241
  let i = e.createElement("style");
5227
5242
  return i.textContent = r, n && (i.nonce = n), i;
5228
- }, vs = "data-html2canvas-ignore", ys = class {
5243
+ }, ys = "data-html2canvas-ignore", bs = class {
5229
5244
  constructor(e, t, n) {
5230
5245
  r(this, "cloneNodeFn", void 0), r(this, "options", void 0), r(this, "context", void 0), this.cloneNodeFn = e, this.options = t, this.context = n;
5231
5246
  }
@@ -5290,18 +5305,18 @@ var Ei = {
5290
5305
  if (!r || r.length === 0) return;
5291
5306
  let i = "host" in t ? t.host.ownerDocument : t.ownerDocument;
5292
5307
  if (!i) return;
5293
- let a = _s(i, r, this.options.cspNonce);
5308
+ let a = vs(i, r, this.options.cspNonce);
5294
5309
  a && t.appendChild(a);
5295
5310
  }
5296
- }, bs = [
5311
+ }, xs = [
5297
5312
  "all",
5298
5313
  "d",
5299
5314
  "content"
5300
- ], xs = (e, t) => {
5315
+ ], Ss = (e, t) => {
5301
5316
  let n = [];
5302
5317
  for (let t = e.length - 1; t >= 0; t--) {
5303
5318
  let r = e.item(t);
5304
- if (bs.indexOf(r) === -1 && !r.startsWith("--")) {
5319
+ if (xs.indexOf(r) === -1 && !r.startsWith("--")) {
5305
5320
  let t = e.getPropertyValue(r);
5306
5321
  if (t) {
5307
5322
  let i = e.getPropertyPriority(r);
@@ -5310,16 +5325,16 @@ var Ei = {
5310
5325
  }
5311
5326
  }
5312
5327
  return n.length > 0 && (t.style.cssText = n.join(";") + ";"), t;
5313
- }, Ss = ":before", Cs = ":after", ws = "___html2canvas___pseudoelement_before", Ts = "___html2canvas___pseudoelement_after", Es = "{\n content: \"\" !important;\n display: none !important;\n}", Ds = (e, t) => {
5314
- Os(e, `.${ws}${Ss}${Es}
5315
- .${Ts}${Cs}${Es}`, t);
5316
- }, Os = (e, t, n) => {
5328
+ }, Cs = ":before", ws = ":after", Ts = "___html2canvas___pseudoelement_before", Es = "___html2canvas___pseudoelement_after", Ds = "{\n content: \"\" !important;\n display: none !important;\n}", Os = (e, t) => {
5329
+ ks(e, `.${Ts}${Cs}${Ds}
5330
+ .${Es}${ws}${Ds}`, t);
5331
+ }, ks = (e, t, n) => {
5317
5332
  let r = e.ownerDocument;
5318
5333
  if (r) {
5319
5334
  let i = r.createElement("style");
5320
5335
  i.textContent = t, n && (i.nonce = n), e.appendChild(i);
5321
5336
  }
5322
- }, ks = class {
5337
+ }, As = class {
5323
5338
  constructor(e, t) {
5324
5339
  r(this, "context", void 0), r(this, "counters", void 0), r(this, "quoteDepth", 0), this.context = e, this.counters = t;
5325
5340
  }
@@ -5327,9 +5342,9 @@ var Ei = {
5327
5342
  if (!n) return;
5328
5343
  let i = n.content, a = t.ownerDocument;
5329
5344
  if (!a || !i || i === "none" || i === "-moz-alt-content" || n.display === "none") return;
5330
- this.counters.parse(new fs(this.context, n));
5331
- let o = new ds(this.context, n), s = a.createElement("html2canvaspseudoelement");
5332
- xs(n, s), o.content.forEach((t) => {
5345
+ this.counters.parse(new ps(this.context, n));
5346
+ let o = new fs(this.context, n), s = a.createElement("html2canvaspseudoelement");
5347
+ Ss(n, s), o.content.forEach((t) => {
5333
5348
  if (t.type === 0) s.appendChild(a.createTextNode(t.value));
5334
5349
  else if (t.type === 22) {
5335
5350
  let e = a.createElement("img");
@@ -5362,23 +5377,83 @@ var Ei = {
5362
5377
  }
5363
5378
  default: s.appendChild(a.createTextNode(t.value));
5364
5379
  }
5365
- }), s.className = `${ws} ${Ts}`;
5366
- let c = r === 0 ? ` ${ws}` : ` ${Ts}`;
5380
+ }), s.className = `${Ts} ${Es}`;
5381
+ let c = r === 0 ? ` ${Ts}` : ` ${Es}`;
5367
5382
  return Yn(t) ? t.className.baseValue += c : t.className += c, s;
5368
5383
  }
5369
5384
  }, q = (e) => {
5370
5385
  if (e?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
5371
- }, As = (e, t, n) => {
5386
+ }, js = (e, t, n) => {
5372
5387
  let r = e.createElement("iframe");
5373
- return r.className = "html2canvas-container", r.style.visibility = "hidden", r.style.position = "fixed", r.style.left = "-10000px", r.style.top = "0px", r.style.border = "0", r.width = t.width.toString(), r.height = t.height.toString(), r.scrolling = "no", r.setAttribute(vs, "true"), (n || e.body).appendChild(r), r;
5374
- }, js = (e) => new Promise((t) => {
5388
+ return r.className = "html2canvas-container", r.style.visibility = "hidden", r.style.position = "fixed", r.style.left = "-10000px", r.style.top = "0px", r.style.border = "0", r.width = t.width.toString(), r.height = t.height.toString(), r.scrolling = "no", r.setAttribute(ys, "true"), (n || e.body).appendChild(r), r;
5389
+ }, Ms = (e) => new Promise((t) => {
5375
5390
  e.complete ? t() : e.src ? (e.onload = t, e.onerror = t) : t();
5376
- }), Ms = (e) => Promise.all([].slice.call(e.images, 0).map(js)), Ns = (e, t, n) => new Promise((r, i) => {
5391
+ }), Ns = (e) => Promise.all([].slice.call(e.images, 0).map(Ms)), Ps = (e, t = 0) => {
5392
+ if (!e || t > Fs) return !0;
5393
+ let n;
5394
+ try {
5395
+ n = e.cssRules;
5396
+ } catch {
5397
+ return !0;
5398
+ }
5399
+ if (!n) return !0;
5400
+ for (let e = 0; e < n.length; e++) {
5401
+ let r = n[e];
5402
+ if (!r || !("styleSheet" in r)) continue;
5403
+ let i = r.styleSheet;
5404
+ if (!i || !Ps(i, t + 1)) return !1;
5405
+ }
5406
+ return !0;
5407
+ }, Fs = 32, Is = (e, t) => {
5408
+ let n = e.querySelectorAll("link");
5409
+ for (let e = 0; e < n.length; e++) {
5410
+ let r = n[e];
5411
+ r && t.push(r);
5412
+ }
5413
+ let r = (e.ownerDocument ?? e).createTreeWalker(e, NodeFilter.SHOW_ELEMENT), i = r.nextNode();
5414
+ for (; i;) {
5415
+ let e = i.shadowRoot;
5416
+ e && Is(e, t), i = r.nextNode();
5417
+ }
5418
+ }, Ls = (e, t, n, r = ts) => {
5419
+ if (n?.aborted) return Promise.resolve();
5420
+ let i = [], a = [];
5421
+ Is(e, a);
5422
+ for (let e of a) {
5423
+ if (e.sheet) continue;
5424
+ let a = (e.getAttribute("rel") ?? "").trim().toLowerCase().split(/\s+/);
5425
+ a.includes("stylesheet") && !a.includes("alternate") && !e.disabled && e.getAttribute("href") && i.push(new Promise((i) => {
5426
+ let a = e.href, o = () => {
5427
+ e.removeEventListener("load", o), e.removeEventListener("error", o), n?.removeEventListener("abort", s), clearInterval(l), i();
5428
+ }, s = () => o();
5429
+ if (e.sheet) {
5430
+ i();
5431
+ return;
5432
+ }
5433
+ e.addEventListener("load", o), e.addEventListener("error", o), n?.addEventListener("abort", s, { once: !0 });
5434
+ let c = 0, l = setInterval(() => {
5435
+ c += 50, e.sheet ? o() : c >= r && (t?.warn(`Stylesheet ${a} did not finish loading within ${r / 1e3}s; continuing with a possibly unstyled clone`), o());
5436
+ }, 50);
5437
+ }));
5438
+ }
5439
+ let o = e.getElementsByTagName("style");
5440
+ for (let e = 0; e < o.length; e++) {
5441
+ let n = o[e], a = n?.sheet;
5442
+ a && n?.textContent?.includes("@import") && (Ps(a) || i.push(new Promise((e) => {
5443
+ let i = 0, a = setInterval(() => {
5444
+ i += 50;
5445
+ let o = n.sheet;
5446
+ (o && Ps(o) || i >= r) && (i >= r && !Ps(o ?? null) && t?.warn(`@import chain in an inline <style> did not finish loading within ${r / 1e3}s; continuing with a possibly unstyled clone`), clearInterval(a), e());
5447
+ }, 50);
5448
+ })));
5449
+ }
5450
+ return i.length === 0 ? Promise.resolve() : Promise.all(i).then(() => void 0);
5451
+ }, Rs = (e, t, n) => new Promise((r, i) => {
5377
5452
  let a = e.contentWindow;
5378
5453
  if (!a) return i("No window assigned for iframe");
5379
5454
  let o = a.document, s, c = setTimeout(() => {
5380
- s && clearInterval(s), i(/* @__PURE__ */ Error(`Cloned iframe did not fire its load event within ${ts}ms`));
5381
- }, ts), l = () => {
5455
+ s && clearInterval(s), i(/* @__PURE__ */ Error(`Cloned iframe did not fire its load event within ${ns}ms`));
5456
+ }, ns), l = () => {
5382
5457
  s && clearInterval(s), clearTimeout(c), i(new DOMException("The operation was aborted.", "AbortError"));
5383
5458
  };
5384
5459
  a.onload = e.onload = () => {
@@ -5388,39 +5463,43 @@ var Ei = {
5388
5463
  u++, n?.aborted ? l() : o.body.childNodes.length > 0 && o.readyState === "complete" ? (clearInterval(s), s = void 0, clearTimeout(c), r(e)) : u >= i && (clearInterval(s), s = void 0, t?.warn(`Cloned iframe did not become ready within ${es / 1e3} seconds; continuing with a possibly incomplete document`), r(e));
5389
5464
  }, 50);
5390
5465
  }, n && (n.aborted ? l() : n.addEventListener("abort", l, { once: !0 }));
5391
- }), Ps = (e) => {
5466
+ }), zs = (e) => e.replace(/[<>&"'`\\]|[\u0000-\u001f\u007f]/g, ""), Bs = (e) => {
5392
5467
  let t = "";
5393
- return e && (t += "<!DOCTYPE ", e.name && (t += e.name), e.internalSubset && (t += " " + e.internalSubset.replace(/"/g, "&quot;").replace(/>/g, "&gt;")), e.publicId ? (t += " PUBLIC \"" + e.publicId.replace(/"/g, "&quot;") + "\"", e.systemId && (t += " \"" + e.systemId.replace(/"/g, "&quot;") + "\"")) : e.systemId && (t += " SYSTEM \"" + e.systemId.replace(/"/g, "&quot;") + "\""), t += ">"), t;
5394
- }, Fs = (e, t, n) => {
5468
+ return e && (t += "<!DOCTYPE ", e.name && (t += zs(e.name)), e.internalSubset && (t += " " + zs(e.internalSubset)), e.publicId ? (t += " PUBLIC \"" + zs(e.publicId) + "\"", e.systemId && (t += " \"" + zs(e.systemId) + "\"")) : e.systemId && (t += " SYSTEM \"" + zs(e.systemId) + "\""), t += ">"), t;
5469
+ }, Vs = (e, t, n) => {
5395
5470
  e && e.defaultView && (t !== e.defaultView.pageXOffset || n !== e.defaultView.pageYOffset) && e.defaultView.scrollTo(t, n);
5396
- }, Is = ([e, t, n]) => {
5471
+ }, Hs = ([e, t, n]) => {
5397
5472
  e.scrollLeft = t, e.scrollTop = n;
5398
- }, Ls = (e, t) => {
5473
+ }, Us = (e, t) => {
5399
5474
  let n = e.ownerDocument.createElement("base");
5400
5475
  n.href = t;
5401
5476
  let r = e.getElementsByTagName("head").item(0);
5402
5477
  r?.insertBefore(n, r?.firstChild ?? null);
5403
- }, Rs = (e, t, n, r) => {
5404
- let i = As(t, n, r.container);
5478
+ }, Ws = (e, t, n, r) => {
5479
+ let i = js(t, n, r.container);
5405
5480
  if (!i.contentWindow) throw Error("Unable to find iframe window");
5406
- let a = t.defaultView.pageXOffset, o = t.defaultView.pageYOffset, s = i.contentWindow, l = s.document, u = Ns(i, e.logger, r.signal).then(async () => {
5407
- r.scrolledElements.forEach(Is), s && s.scrollTo(n.left, n.top);
5481
+ let a = t.defaultView.pageXOffset, o = t.defaultView.pageYOffset, s = i.contentWindow, l = s.document, u = Rs(i, e.logger, r.signal).then(async () => {
5482
+ r.scrolledElements.forEach(Hs), s && s.scrollTo(n.left, n.top);
5408
5483
  let t = r.onclone, a = r.clonedReferenceElement;
5409
5484
  if (a === void 0) throw Error(`Error finding the ${r.referenceElementName} in the cloned document`);
5410
- return q(r.signal), l.fonts && l.fonts.ready && await l.fonts.ready, q(r.signal), /(AppleWebKit)/g.test(navigator.userAgent) && (await Ms(l), q(r.signal)), typeof t == "function" && await Promise.resolve().then(() => t(l, a)), s.scrollTo(n.left, n.top), /AppleWebKit/g.test(navigator.userAgent) && (s.scrollY !== n.top || s.scrollX !== n.left) && (e.logger.warn("Unable to restore scroll position for cloned document"), e.adjustWindowBounds(s.scrollX - n.left, s.scrollY - n.top)), i;
5485
+ return q(r.signal), await m, q(r.signal), l.fonts && l.fonts.ready && await l.fonts.ready, q(r.signal), /(AppleWebKit)/g.test(navigator.userAgent) && (await Ns(l), q(r.signal)), typeof t == "function" && await Promise.resolve().then(() => t(l, a)), s.scrollTo(n.left, n.top), /AppleWebKit/g.test(navigator.userAgent) && (s.scrollY !== n.top || s.scrollX !== n.left) && (e.logger.warn("Unable to restore scroll position for cloned document"), e.adjustWindowBounds(s.scrollX - n.left, s.scrollY - n.top)), i;
5411
5486
  }), d = t.baseURI;
5412
5487
  l.open();
5413
- let f = Ps(t.doctype) + "<html></html>";
5488
+ let f = Bs(t.doctype) + "<html></html>";
5414
5489
  try {
5415
5490
  let e = c(f);
5416
5491
  l.write(e);
5417
5492
  } catch {
5418
5493
  l.write(c(f));
5419
5494
  }
5420
- Fs(t, a, o), l.close();
5495
+ Vs(t, a, o), l.close();
5421
5496
  let p = l.adoptNode(r.documentElement);
5422
- return Ls(p, d), l.replaceChild(p, l.documentElement), u;
5423
- }, zs = (e) => {
5497
+ Us(p, d), l.replaceChild(p, l.documentElement);
5498
+ let m = Ls(l, e.logger, r.signal);
5499
+ return u.catch((e) => {
5500
+ throw i.parentNode?.removeChild(i), e;
5501
+ });
5502
+ }, Gs = (e) => {
5424
5503
  let t = e;
5425
5504
  for (; t;) {
5426
5505
  if (t.parentNode && t.parentNode.host) return t.parentNode;
@@ -5429,15 +5508,15 @@ var Ei = {
5429
5508
  t = t.parentNode;
5430
5509
  }
5431
5510
  return null;
5432
- }, Bs = class {
5511
+ }, Ks = class {
5433
5512
  constructor(e, t, n) {
5434
- if (r(this, "context", void 0), r(this, "options", void 0), r(this, "scrolledElements", void 0), r(this, "referenceElement", void 0), r(this, "clonedReferenceElement", void 0), r(this, "documentElement", void 0), r(this, "counters", void 0), r(this, "pseudoContents", void 0), r(this, "slotCloner", void 0), this.context = e, this.options = n, this.scrolledElements = [], this.referenceElement = t, this.counters = new gr(), this.pseudoContents = new ks(e, this.counters), this.slotCloner = new ys((e, t) => this.cloneNode(e, t), {
5513
+ if (r(this, "context", void 0), r(this, "options", void 0), r(this, "scrolledElements", void 0), r(this, "referenceElement", void 0), r(this, "clonedReferenceElement", void 0), r(this, "documentElement", void 0), r(this, "counters", void 0), r(this, "pseudoContents", void 0), r(this, "slotCloner", void 0), this.context = e, this.options = n, this.scrolledElements = [], this.referenceElement = t, this.counters = new gr(), this.pseudoContents = new As(e, this.counters), this.slotCloner = new bs((e, t) => this.cloneNode(e, t), {
5435
5514
  ignoreElements: n.ignoreElements,
5436
5515
  copyStyles: n.copyStyles ?? !0,
5437
5516
  cspNonce: n.cspNonce
5438
5517
  }, e), !t.ownerDocument) throw Error("Cloned element does not have an owner document");
5439
5518
  if (!this.options.iframeContainer) {
5440
- let e = zs(t);
5519
+ let e = Gs(t);
5441
5520
  e && (this.options.iframeContainer = e);
5442
5521
  }
5443
5522
  this.documentElement = this.cloneNode(t.ownerDocument.documentElement, !1), this.appendDocumentAdoptedStyles(t.ownerDocument);
@@ -5448,11 +5527,11 @@ var Ei = {
5448
5527
  if (!t || t.length === 0) return;
5449
5528
  let n = this.documentElement.getElementsByTagName("head").item(0);
5450
5529
  if (!n) return;
5451
- let r = _s(this.documentElement.ownerDocument ?? e, t, this.options.cspNonce);
5530
+ let r = vs(this.documentElement.ownerDocument ?? e, t, this.options.cspNonce);
5452
5531
  r && n.appendChild(r);
5453
5532
  }
5454
5533
  toIFrame(e, t) {
5455
- return Rs(this.context, e, t, {
5534
+ return Ws(this.context, e, t, {
5456
5535
  documentElement: this.documentElement,
5457
5536
  clonedReferenceElement: this.clonedReferenceElement,
5458
5537
  referenceElementName: this.referenceElement.nodeName,
@@ -5463,8 +5542,7 @@ var Ei = {
5463
5542
  });
5464
5543
  }
5465
5544
  createElementClone(e) {
5466
- if (hs(e, 2)) debugger;
5467
- if (tr(e)) return this.createCanvasClone(e);
5545
+ if (gs(e, 2), tr(e)) return this.createCanvasClone(e);
5468
5546
  if (nr(e)) return this.createVideoClone(e);
5469
5547
  if (ar(e)) return this.createStyleClone(e);
5470
5548
  let t = e.cloneNode(!1);
@@ -5472,7 +5550,7 @@ var Ei = {
5472
5550
  }
5473
5551
  createCustomElementClone(e, t) {
5474
5552
  let n = document.createElement("div");
5475
- n.className = t.className, xs(t.style, n);
5553
+ n.className = t.className, Ss(t.style, n);
5476
5554
  let r = t.attributes;
5477
5555
  for (let e = 0; e < r.length; e++) {
5478
5556
  let t = r.item(e);
@@ -5550,8 +5628,8 @@ var Ei = {
5550
5628
  let r = this.createElementClone(e);
5551
5629
  r.style.transitionProperty = "none";
5552
5630
  let i = n.getComputedStyle(e), a = mr(e);
5553
- this.referenceElement === e && Xn(r) && (this.clonedReferenceElement = r), er(r) && Ds(r, this.options.cspNonce);
5554
- let o = this.counters.parse(new fs(this.context, i));
5631
+ this.referenceElement === e && Xn(r) && (this.clonedReferenceElement = r), er(r) && Os(r, this.options.cspNonce);
5632
+ let o = this.counters.parse(new ps(this.context, i));
5555
5633
  if (a) {
5556
5634
  let t = n.getComputedStyle(e, ":before"), i = this.pseudoContents.resolvePseudoContent(e, r, t, 0);
5557
5635
  i && r.insertBefore(i, r.firstChild);
@@ -5560,7 +5638,7 @@ var Ei = {
5560
5638
  let t = n.getComputedStyle(e, ":after"), i = this.pseudoContents.resolvePseudoContent(e, r, t, 1);
5561
5639
  i && r.appendChild(i);
5562
5640
  }
5563
- return this.counters.pop(o), (i && (this.options.copyStyles || Yn(e)) && !ir(e) || t) && xs(i, r), (e.scrollTop !== 0 || e.scrollLeft !== 0) && this.scrolledElements.push([
5641
+ return this.counters.pop(o), (i && (this.options.copyStyles || Yn(e)) && !ir(e) || t) && Ss(i, r), (e.scrollTop !== 0 || e.scrollLeft !== 0) && this.scrolledElements.push([
5564
5642
  r,
5565
5643
  e.scrollLeft,
5566
5644
  e.scrollTop
@@ -5571,7 +5649,7 @@ var Ei = {
5571
5649
  static destroy(e) {
5572
5650
  return e.parentNode ? (e.parentNode.removeChild(e), !0) : !1;
5573
5651
  }
5574
- }, Vs = class {
5652
+ }, qs = class {
5575
5653
  static normalizeElement(e, t) {
5576
5654
  let n = {};
5577
5655
  if (!Xn(e) && !Yn(e)) return n;
@@ -5582,10 +5660,9 @@ var Ei = {
5582
5660
  static restoreElement(e, t) {
5583
5661
  (Xn(e) || Yn(e)) && (t.animationDuration !== void 0 && (e.style.animationDuration = t.animationDuration), t.transform !== void 0 && (e.style.transform = t.transform), t.rotate !== void 0 && (e.style.rotate = t.rotate), t.translate !== void 0 && (e.style.translate = t.translate), t.scale !== void 0 && (e.style.scale = t.scale));
5584
5662
  }
5585
- }, Hs = class {
5663
+ }, Js = class {
5586
5664
  constructor(e, t, n = {}) {
5587
- if (r(this, "context", void 0), r(this, "styles", void 0), r(this, "textNodes", []), r(this, "elements", []), r(this, "bounds", void 0), r(this, "legendBounds", void 0), r(this, "createsStackingContext", !1), r(this, "createsRealStackingContext", !1), r(this, "isListOwner", !1), r(this, "debugRender", !1), r(this, "originalStyles", void 0), r(this, "originalElement", void 0), this.context = e, hs(t, 3)) debugger;
5588
- if (this.styles = new ls(e, e.config.window.getComputedStyle(t, null)), n.normalizeDom !== !1 && (Xn(t) || Yn(t)) && (this.originalStyles = Vs.normalizeElement(t, this.styles), this.originalElement = t), this.bounds = m(this.context, t), t.tagName === "FIELDSET") {
5665
+ if (r(this, "context", void 0), r(this, "styles", void 0), r(this, "textNodes", []), r(this, "elements", []), r(this, "bounds", void 0), r(this, "legendBounds", void 0), r(this, "createsStackingContext", !1), r(this, "createsRealStackingContext", !1), r(this, "isListOwner", !1), r(this, "debugRender", !1), r(this, "originalStyles", void 0), r(this, "originalElement", void 0), this.context = e, gs(t, 3), this.styles = new us(e, e.config.window.getComputedStyle(t, null)), n.normalizeDom !== !1 && (Xn(t) || Yn(t)) && (this.originalStyles = qs.normalizeElement(t, this.styles), this.originalElement = t), this.bounds = m(this.context, t), t.tagName === "FIELDSET") {
5589
5666
  let e = t.querySelector(":scope > legend");
5590
5667
  if (e) {
5591
5668
  let t = m(this.context, e);
@@ -5594,16 +5671,16 @@ var Ei = {
5594
5671
  this.bounds = new p(this.bounds.left, n, this.bounds.width, this.bounds.height - (n - this.bounds.top));
5595
5672
  }
5596
5673
  }
5597
- hs(t, 4) && (this.debugRender = !0);
5674
+ gs(t, 4) && (this.debugRender = !0);
5598
5675
  }
5599
5676
  restore() {
5600
- this.originalStyles && this.originalElement && (Vs.restoreElement(this.originalElement, this.originalStyles), this.originalStyles = void 0, this.originalElement = void 0);
5677
+ this.originalStyles && this.originalElement && (qs.restoreElement(this.originalElement, this.originalStyles), this.originalStyles = void 0, this.originalElement = void 0);
5601
5678
  }
5602
5679
  restoreTree() {
5603
5680
  this.restore();
5604
5681
  for (let e of this.elements) e.restoreTree();
5605
5682
  }
5606
- }, Us = (e) => {
5683
+ }, Ys = (e) => {
5607
5684
  if (e.createRange) {
5608
5685
  let t = e.createRange();
5609
5686
  if (t.getBoundingClientRect) {
@@ -5614,7 +5691,7 @@ var Ei = {
5614
5691
  }
5615
5692
  }
5616
5693
  return !1;
5617
- }, Ws = () => new Image().crossOrigin !== void 0, Gs = (e) => {
5694
+ }, Xs = () => new Image().crossOrigin !== void 0, Zs = (e) => {
5618
5695
  let t = new Image(), n = e.createElement("canvas"), r = n.getContext("2d");
5619
5696
  if (!r) return !1;
5620
5697
  t.src = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";
@@ -5624,49 +5701,49 @@ var Ei = {
5624
5701
  return !1;
5625
5702
  }
5626
5703
  return !0;
5627
- }, Ks = (e, t, n, r, i) => {
5704
+ }, Qs = (e, t, n, r, i) => {
5628
5705
  let a = "http://www.w3.org/2000/svg", o = document.createElementNS(a, "svg"), s = document.createElementNS(a, "foreignObject");
5629
5706
  return o.setAttributeNS(null, "width", e.toString()), o.setAttributeNS(null, "height", t.toString()), s.setAttributeNS(null, "width", "100%"), s.setAttributeNS(null, "height", "100%"), s.setAttributeNS(null, "x", n.toString()), s.setAttributeNS(null, "y", r.toString()), s.setAttributeNS(null, "externalResourcesRequired", "true"), o.appendChild(s), s.appendChild(i), o;
5630
- }, qs = (e) => new Promise((t, n) => {
5707
+ }, $s = (e) => new Promise((t, n) => {
5631
5708
  let r = new Image();
5632
5709
  r.onload = () => t(r), r.onerror = n, r.src = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(e))}`;
5633
- }), Js = {
5710
+ }), ec = {
5634
5711
  get SUPPORT_RANGE_BOUNDS() {
5635
- let e = Us(document);
5636
- return Object.defineProperty(Js, "SUPPORT_RANGE_BOUNDS", { value: e }), e;
5712
+ let e = Ys(document);
5713
+ return Object.defineProperty(ec, "SUPPORT_RANGE_BOUNDS", { value: e }), e;
5637
5714
  },
5638
5715
  get SUPPORT_SVG_DRAWING() {
5639
- let e = Gs(document);
5640
- return Object.defineProperty(Js, "SUPPORT_SVG_DRAWING", { value: e }), e;
5716
+ let e = Zs(document);
5717
+ return Object.defineProperty(ec, "SUPPORT_SVG_DRAWING", { value: e }), e;
5641
5718
  },
5642
5719
  get SUPPORT_CORS_IMAGES() {
5643
- let e = Ws();
5644
- return Object.defineProperty(Js, "SUPPORT_CORS_IMAGES", { value: e }), e;
5720
+ let e = Xs();
5721
+ return Object.defineProperty(ec, "SUPPORT_CORS_IMAGES", { value: e }), e;
5645
5722
  }
5646
- }, Ys = class {
5723
+ }, tc = class {
5647
5724
  constructor(e, t) {
5648
5725
  r(this, "text", void 0), r(this, "bounds", void 0), this.text = e, this.bounds = t;
5649
5726
  }
5650
- }, Xs = (e, t, n, r) => {
5651
- let i = rc(t, n), a = [], o = 0;
5727
+ }, nc = (e, t, n, r) => {
5728
+ let i = lc(t, n), a = [], o = 0;
5652
5729
  return i.forEach((t) => {
5653
5730
  if (n.textDecorationLine.length || t.trim().length > 0) {
5654
- if (Js.SUPPORT_RANGE_BOUNDS) {
5655
- let n = Qs(r, o, t.length).getClientRects();
5731
+ if (ec.SUPPORT_RANGE_BOUNDS) {
5732
+ let n = ic(r, o, t.length).getClientRects();
5656
5733
  if (n.length > 1) {
5657
- let n = tc(t), i = 0;
5734
+ let n = sc(t), i = 0;
5658
5735
  n.forEach((t) => {
5659
- a.push(new Ys(t, p.fromDOMRectList(e, Qs(r, i + o, t.length).getClientRects()))), i += t.length;
5736
+ a.push(new tc(t, p.fromDOMRectList(e, ic(r, i + o, t.length).getClientRects()))), i += t.length;
5660
5737
  });
5661
- } else a.push(new Ys(t, p.fromDOMRectList(e, n)));
5738
+ } else a.push(new tc(t, p.fromDOMRectList(e, n)));
5662
5739
  } else {
5663
5740
  let n = r.splitText(t.length);
5664
- a.push(new Ys(t, Zs(e, r))), r = n;
5741
+ a.push(new tc(t, rc(e, r))), r = n;
5665
5742
  }
5666
- } else Js.SUPPORT_RANGE_BOUNDS || (r = r.splitText(t.length));
5743
+ } else ec.SUPPORT_RANGE_BOUNDS || (r = r.splitText(t.length));
5667
5744
  o += t.length;
5668
5745
  }), a;
5669
- }, Zs = (e, t) => {
5746
+ }, rc = (e, t) => {
5670
5747
  let n = t.ownerDocument;
5671
5748
  if (n) {
5672
5749
  let r = n.createElement("html2canvaswrapper");
@@ -5679,34 +5756,34 @@ var Ei = {
5679
5756
  }
5680
5757
  }
5681
5758
  return p.EMPTY;
5682
- }, Qs = (e, t, n) => {
5759
+ }, ic = (e, t, n) => {
5683
5760
  let r = e.ownerDocument;
5684
5761
  if (!r) throw Error("Node has no owner document");
5685
5762
  let i = r.createRange();
5686
5763
  return i.setStart(e, t), i.setEnd(e, t + n), i;
5687
- }, $s = /* @__PURE__ */ new Map(), ec = (e) => {
5688
- let t = $s.get(e);
5689
- return t || (t = new Intl.Segmenter(void 0, { granularity: e }), $s.set(e, t)), t;
5690
- }, tc = (e) => Array.from(ec("grapheme").segment(e), (e) => e.segment), nc = (e) => Array.from(ec("word").segment(e), (e) => e.segment), rc = (e, t) => Ga(t.writingMode) ? tc(e) : t.letterSpacing === 0 ? nc(e) : tc(e), ic = class {
5764
+ }, ac = /* @__PURE__ */ new Map(), oc = (e) => {
5765
+ let t = ac.get(e);
5766
+ return t || (t = new Intl.Segmenter(void 0, { granularity: e }), ac.set(e, t)), t;
5767
+ }, sc = (e) => Array.from(oc("grapheme").segment(e), (e) => e.segment), cc = (e) => Array.from(oc("word").segment(e), (e) => e.segment), lc = (e, t) => Ga(t.writingMode) ? sc(e) : t.letterSpacing === 0 ? cc(e) : sc(e), uc = class {
5691
5768
  constructor(e, t, n) {
5692
- r(this, "text", void 0), r(this, "textBounds", void 0), this.text = ac(t.data, n.textTransform), this.text.length !== t.data.length && (t.data = this.text), this.textBounds = Xs(e, this.text, n, t);
5769
+ r(this, "text", void 0), r(this, "textBounds", void 0), this.text = dc(t.data, n.textTransform), this.text.length !== t.data.length && (t.data = this.text), this.textBounds = nc(e, this.text, n, t);
5693
5770
  }
5694
- }, ac = (e, t) => {
5771
+ }, dc = (e, t) => {
5695
5772
  switch (t) {
5696
5773
  case 1: return e.toLowerCase();
5697
- case 3: return e.replace(oc, sc);
5774
+ case 3: return e.replace(fc, pc);
5698
5775
  case 2: return e.toUpperCase();
5699
5776
  default: return e;
5700
5777
  }
5701
- }, oc = /(^|\s|:|-|\(|\))([a-z])/g, sc = (e, t, n) => e.length > 0 ? t + n.toUpperCase() : e, cc = class extends Hs {
5778
+ }, fc = /(^|\s|:|-|\(|\))([a-z])/g, pc = (e, t, n) => e.length > 0 ? t + n.toUpperCase() : e, mc = class extends Js {
5702
5779
  constructor(e, t, n = {}) {
5703
5780
  super(e, t, n), r(this, "src", void 0), r(this, "intrinsicWidth", void 0), r(this, "intrinsicHeight", void 0), this.src = t.currentSrc || t.src, this.intrinsicWidth = t.naturalWidth, this.intrinsicHeight = t.naturalHeight, this.context.cache.addImage(this.src);
5704
5781
  }
5705
- }, lc = class extends Hs {
5782
+ }, hc = class extends Js {
5706
5783
  constructor(e, t, n = {}) {
5707
5784
  super(e, t, n), r(this, "canvas", void 0), r(this, "intrinsicWidth", void 0), r(this, "intrinsicHeight", void 0), this.canvas = t, this.intrinsicWidth = t.width, this.intrinsicHeight = t.height;
5708
5785
  }
5709
- }, uc = [
5786
+ }, gc = [
5710
5787
  "position",
5711
5788
  "inset",
5712
5789
  "top",
@@ -5730,57 +5807,57 @@ var Ei = {
5730
5807
  "margin-block",
5731
5808
  "margin-block-start",
5732
5809
  "margin-block-end"
5733
- ], dc = (e, t) => {
5810
+ ], _c = (e, t) => {
5734
5811
  let n = t.getAttribute("style");
5735
- uc.forEach((e) => t.style.removeProperty(e));
5812
+ gc.forEach((e) => t.style.removeProperty(e));
5736
5813
  let r = e.serializeToString(t);
5737
5814
  return n === null ? t.removeAttribute("style") : t.setAttribute("style", n), r;
5738
- }, fc = class extends Hs {
5815
+ }, vc = class extends Js {
5739
5816
  constructor(e, t, n = {}) {
5740
5817
  super(e, t, n), r(this, "svg", void 0), r(this, "intrinsicWidth", void 0), r(this, "intrinsicHeight", void 0);
5741
5818
  let i = new XMLSerializer(), a = m(e, t);
5742
- t.setAttribute("width", `${a.width}px`), t.setAttribute("height", `${a.height}px`), this.svg = `data:image/svg+xml,${encodeURIComponent(dc(i, t))}`, this.intrinsicWidth = t.width.baseVal.value, this.intrinsicHeight = t.height.baseVal.value, this.context.cache.addImage(this.svg);
5819
+ t.setAttribute("width", `${a.width}px`), t.setAttribute("height", `${a.height}px`), this.svg = `data:image/svg+xml,${encodeURIComponent(_c(i, t))}`, this.intrinsicWidth = t.width.baseVal.value, this.intrinsicHeight = t.height.baseVal.value, this.context.cache.addImage(this.svg);
5743
5820
  }
5744
- }, pc = class extends Hs {
5821
+ }, yc = class extends Js {
5745
5822
  constructor(e, t, n = {}) {
5746
5823
  super(e, t, n), r(this, "value", void 0), this.value = t.value;
5747
5824
  }
5748
- }, mc = class extends Hs {
5825
+ }, bc = class extends Js {
5749
5826
  constructor(e, t, n = {}) {
5750
5827
  super(e, t, n), r(this, "start", void 0), r(this, "reversed", void 0), this.start = t.start, this.reversed = typeof t.reversed == "boolean" && t.reversed === !0;
5751
5828
  }
5752
- }, hc = [{
5829
+ }, xc = [{
5753
5830
  type: 15,
5754
5831
  flags: 0,
5755
5832
  unit: "px",
5756
5833
  number: 3
5757
- }], gc = [{
5834
+ }], Sc = [{
5758
5835
  type: 16,
5759
5836
  flags: 0,
5760
5837
  number: 50
5761
- }], _c = (e) => e.width > e.height ? new p(e.left + (e.width - e.height) / 2, e.top, e.height, e.height) : e.width < e.height ? new p(e.left, e.top + (e.height - e.width) / 2, e.width, e.width) : e, vc = (e) => {
5838
+ }], Cc = (e) => e.width > e.height ? new p(e.left + (e.width - e.height) / 2, e.top, e.height, e.height) : e.width < e.height ? new p(e.left, e.top + (e.height - e.width) / 2, e.width, e.width) : e, wc = (e) => {
5762
5839
  let t = e.type === "password" ? Array(e.value.length + 1).join("•") : e.value;
5763
5840
  return t.length === 0 ? e.placeholder || "" : t;
5764
- }, yc = (e) => e.value.length === 0 && !!e.placeholder, bc = "checkbox", xc = "radio", Sc = 1970632191, Cc = class extends Hs {
5841
+ }, Tc = (e) => e.value.length === 0 && !!e.placeholder, Ec = "checkbox", Dc = "radio", Oc = 1970632191, kc = class extends Js {
5765
5842
  constructor(e, t, n = {}) {
5766
- switch (super(e, t, n), r(this, "type", void 0), r(this, "checked", void 0), r(this, "value", void 0), r(this, "isPlaceholder", void 0), this.type = t.type.toLowerCase(), this.checked = t.checked, this.value = vc(t), this.isPlaceholder = yc(t), (this.type === "checkbox" || this.type === "radio") && (this.styles.backgroundColor = 3739148031, this.styles.borderTopColor = this.styles.borderRightColor = this.styles.borderBottomColor = this.styles.borderLeftColor = 2779096575, this.styles.borderTopWidth = this.styles.borderRightWidth = this.styles.borderBottomWidth = this.styles.borderLeftWidth = 1, this.styles.borderTopStyle = this.styles.borderRightStyle = this.styles.borderBottomStyle = this.styles.borderLeftStyle = 1, this.styles.backgroundClip = [0], this.styles.backgroundOrigin = [0], this.bounds = _c(this.bounds)), this.type) {
5767
- case bc:
5768
- this.styles.borderTopRightRadius = this.styles.borderTopLeftRadius = this.styles.borderBottomRightRadius = this.styles.borderBottomLeftRadius = hc;
5843
+ switch (super(e, t, n), r(this, "type", void 0), r(this, "checked", void 0), r(this, "value", void 0), r(this, "isPlaceholder", void 0), this.type = t.type.toLowerCase(), this.checked = t.checked, this.value = wc(t), this.isPlaceholder = Tc(t), (this.type === "checkbox" || this.type === "radio") && (this.styles.backgroundColor = 3739148031, this.styles.borderTopColor = this.styles.borderRightColor = this.styles.borderBottomColor = this.styles.borderLeftColor = 2779096575, this.styles.borderTopWidth = this.styles.borderRightWidth = this.styles.borderBottomWidth = this.styles.borderLeftWidth = 1, this.styles.borderTopStyle = this.styles.borderRightStyle = this.styles.borderBottomStyle = this.styles.borderLeftStyle = 1, this.styles.backgroundClip = [0], this.styles.backgroundOrigin = [0], this.bounds = Cc(this.bounds)), this.type) {
5844
+ case Ec:
5845
+ this.styles.borderTopRightRadius = this.styles.borderTopLeftRadius = this.styles.borderBottomRightRadius = this.styles.borderBottomLeftRadius = xc;
5769
5846
  break;
5770
- case xc: this.styles.borderTopRightRadius = this.styles.borderTopLeftRadius = this.styles.borderBottomRightRadius = this.styles.borderBottomLeftRadius = gc;
5847
+ case Dc: this.styles.borderTopRightRadius = this.styles.borderTopLeftRadius = this.styles.borderBottomRightRadius = this.styles.borderBottomLeftRadius = Sc;
5771
5848
  }
5772
5849
  }
5773
- }, wc = class extends Hs {
5850
+ }, Ac = class extends Js {
5774
5851
  constructor(e, t, n = {}) {
5775
5852
  super(e, t, n), r(this, "value", void 0);
5776
5853
  let i = t.options[t.selectedIndex || 0];
5777
5854
  this.value = i && i.text || "";
5778
5855
  }
5779
- }, Tc = class extends Hs {
5856
+ }, jc = class extends Js {
5780
5857
  constructor(e, t, n = {}) {
5781
5858
  super(e, t, n), r(this, "value", void 0), this.value = t.value;
5782
5859
  }
5783
- }, Ec = class extends Hs {
5860
+ }, Mc = class extends Js {
5784
5861
  constructor(e, t, n, i = {}) {
5785
5862
  super(e, t, i), r(this, "src", void 0), r(this, "width", void 0), r(this, "height", void 0), r(this, "tree", void 0), r(this, "backgroundColor", void 0), r(this, "parseTreeFn", void 0), this.src = t.src, this.width = parseInt(t.width, 10) || 0, this.height = parseInt(t.height, 10) || 0, this.backgroundColor = this.styles.backgroundColor, this.parseTreeFn = n;
5786
5863
  try {
@@ -5795,35 +5872,35 @@ var Ei = {
5795
5872
  this.context.logger.warn(`Unable to render iframe content${this.src ? ` from ${this.src}` : ""}: ${t.message}`), this.context.onError?.(t);
5796
5873
  }
5797
5874
  }
5798
- }, Dc = [
5875
+ }, Nc = [
5799
5876
  "OL",
5800
5877
  "UL",
5801
5878
  "MENU"
5802
- ], Oc = (e, t, n, r, i = 1, a = {}) => {
5803
- for (let o = t.firstChild, s; o; o = s) s = o.nextSibling, kc(e, o, n, r, i, a);
5804
- }, kc = (e, t, n, r, i = 1, a = {}) => {
5879
+ ], Pc = (e, t, n, r, i = 1, a = {}) => {
5880
+ for (let o = t.firstChild, s; o; o = s) s = o.nextSibling, Fc(e, o, n, r, i, a);
5881
+ }, Fc = (e, t, n, r, i = 1, a = {}) => {
5805
5882
  if (Jn(t) && t.data.length > 0) {
5806
- let r = new ic(e, t, n.styles);
5883
+ let r = new uc(e, t, n.styles);
5807
5884
  if (i !== 1) {
5808
5885
  let e = n.bounds.left, t = n.bounds.top;
5809
- r.textBounds = r.textBounds.map((n) => new Ys(n.text, new p(e + (n.bounds.left - e) / i, t + (n.bounds.top - t) / i, n.bounds.width / i, n.bounds.height / i)));
5886
+ r.textBounds = r.textBounds.map((n) => new tc(n.text, new p(e + (n.bounds.left - e) / i, t + (n.bounds.top - t) / i, n.bounds.width / i, n.bounds.height / i)));
5810
5887
  }
5811
5888
  n.textNodes.push(r);
5812
5889
  } else if (qn(t)) {
5813
- if (lr(t) && t.assignedNodes) t.assignedNodes().forEach((t) => kc(e, t, n, r, i, a));
5890
+ if (lr(t) && t.assignedNodes) t.assignedNodes().forEach((t) => Fc(e, t, n, r, i, a));
5814
5891
  else {
5815
- let o = Ac(e, t, a), s = o.styles.zoom || 1;
5892
+ let o = Ic(e, t, a), s = o.styles.zoom || 1;
5816
5893
  if (s !== 1 && (o.bounds = new p(o.bounds.left, o.bounds.top, o.bounds.width / s, o.bounds.height / s)), o.styles.isVisible()) {
5817
- Mc(t, o, r) ? o.createsRealStackingContext = !0 : Nc(o.styles) && (o.createsStackingContext = !0), Dc.indexOf(t.tagName) !== -1 && (o.isListOwner = !0), n.elements.push(o);
5894
+ Rc(t, o, r) ? o.createsRealStackingContext = !0 : zc(o.styles) && (o.createsStackingContext = !0), Nc.indexOf(t.tagName) !== -1 && (o.isListOwner = !0), n.elements.push(o);
5818
5895
  let s = i * (o.styles.zoom || 1);
5819
- t.shadowRoot ? Oc(e, t.shadowRoot, o, r, s, a) : !sr(t) && !$n(t) && !cr(t) && Oc(e, t, o, r, s, a);
5896
+ t.shadowRoot ? Pc(e, t.shadowRoot, o, r, s, a) : sr(t) || $n(t) || cr(t) || Pc(e, t, o, r, s, a);
5820
5897
  }
5821
5898
  }
5822
5899
  }
5823
- }, Ac = (e, t, n = {}) => rr(t) ? new cc(e, t, n) : tr(t) ? new lc(e, t, n) : $n(t) ? new fc(e, t, n) : ur(t) ? new pc(e, t, n) : dr(t) ? new mc(e, t, n) : Zn(t) ? new Cc(e, t, n) : cr(t) ? new wc(e, t, n) : sr(t) ? new Tc(e, t, n) : ir(t) ? new Ec(e, t, (e, t) => jc(e, t, n), n) : new Hs(e, t, n), jc = (e, t, n = {}) => {
5824
- let r = Ac(e, t, n);
5825
- return r.createsRealStackingContext = !0, Oc(e, t, r, r, 1, n), r;
5826
- }, Mc = (e, t, n) => t.styles.isPositionedWithZIndex() || t.styles.opacity < 1 || !!t.styles.filter || !!t.styles.backdropFilter || t.styles.maskImage.length > 0 || !!t.styles.webkitBoxReflect || t.styles.isolation === 1 || t.styles.isTransformed() || er(e) && n.styles.isTransparent(), Nc = (e) => e.isPositioned() || e.isFloating() || e.mixBlendMode !== K.NORMAL ? !0 : H(e.display, 268435456) || H(e.display, 33554432) || H(e.display, 536870912) || H(e.display, 134217728), Pc = (e, t) => e.length === t.length && e.some((e, n) => e === t[n]), Fc = (e, t, n, r, i) => e.map((e, a) => {
5900
+ }, Ic = (e, t, n = {}) => rr(t) ? new mc(e, t, n) : tr(t) ? new hc(e, t, n) : $n(t) ? new vc(e, t, n) : ur(t) ? new yc(e, t, n) : dr(t) ? new bc(e, t, n) : Zn(t) ? new kc(e, t, n) : cr(t) ? new Ac(e, t, n) : sr(t) ? new jc(e, t, n) : ir(t) ? new Mc(e, t, (e, t) => Lc(e, t, n), n) : new Js(e, t, n), Lc = (e, t, n = {}) => {
5901
+ let r = Ic(e, t, n);
5902
+ return r.createsRealStackingContext = !0, Pc(e, t, r, r, 1, n), r;
5903
+ }, Rc = (e, t, n) => t.styles.isPositionedWithZIndex() || t.styles.opacity < 1 || !!t.styles.filter || !!t.styles.backdropFilter || t.styles.maskImage.length > 0 || !!t.styles.webkitBoxReflect || t.styles.isolation === 1 || t.styles.isTransformed() || er(e) && n.styles.isTransparent(), zc = (e) => e.isPositioned() || e.isFloating() || e.mixBlendMode !== K.NORMAL ? !0 : H(e.display, 268435456) || H(e.display, 33554432) || H(e.display, 536870912) || H(e.display, 134217728), Bc = (e, t) => e.length === t.length && e.some((e, n) => e === t[n]), Vc = (e, t, n, r, i) => e.map((e, a) => {
5827
5904
  switch (a) {
5828
5905
  case 0: return e.add(t, n);
5829
5906
  case 1: return e.add(t + r, n);
@@ -5838,12 +5915,12 @@ var Ei = {
5838
5915
  add(t, n) {
5839
5916
  return new e(this.x + t, this.y + n);
5840
5917
  }
5841
- }, Ic = (e, t, n) => new J(e.x + (t.x - e.x) * n, e.y + (t.y - e.y) * n), Lc = class e {
5918
+ }, Hc = (e, t, n) => new J(e.x + (t.x - e.x) * n, e.y + (t.y - e.y) * n), Uc = class e {
5842
5919
  constructor(e, t, n, i) {
5843
5920
  r(this, "type", void 0), r(this, "start", void 0), r(this, "startControl", void 0), r(this, "endControl", void 0), r(this, "end", void 0), this.type = 1, this.start = e, this.startControl = t, this.endControl = n, this.end = i;
5844
5921
  }
5845
5922
  subdivide(t, n) {
5846
- let r = Ic(this.start, this.startControl, t), i = Ic(this.startControl, this.endControl, t), a = Ic(this.endControl, this.end, t), o = Ic(r, i, t), s = Ic(i, a, t), c = Ic(o, s, t);
5923
+ let r = Hc(this.start, this.startControl, t), i = Hc(this.startControl, this.endControl, t), a = Hc(this.endControl, this.end, t), o = Hc(r, i, t), s = Hc(i, a, t), c = Hc(o, s, t);
5847
5924
  return n ? new e(this.start, r, o, c) : new e(c, s, a, this.end);
5848
5925
  }
5849
5926
  add(t, n) {
@@ -5852,56 +5929,56 @@ var Ei = {
5852
5929
  reverse() {
5853
5930
  return new e(this.end, this.endControl, this.startControl, this.start);
5854
5931
  }
5855
- }, Y = (e) => e.type === 1, Rc = class {
5932
+ }, Y = (e) => e.type === 1, Wc = class {
5856
5933
  constructor(e) {
5857
5934
  r(this, "topLeftBorderDoubleOuterBox", void 0), r(this, "topRightBorderDoubleOuterBox", void 0), r(this, "bottomRightBorderDoubleOuterBox", void 0), r(this, "bottomLeftBorderDoubleOuterBox", void 0), r(this, "topLeftBorderDoubleInnerBox", void 0), r(this, "topRightBorderDoubleInnerBox", void 0), r(this, "bottomRightBorderDoubleInnerBox", void 0), r(this, "bottomLeftBorderDoubleInnerBox", void 0), r(this, "topLeftBorderStroke", void 0), r(this, "topRightBorderStroke", void 0), r(this, "bottomRightBorderStroke", void 0), r(this, "bottomLeftBorderStroke", void 0), r(this, "topLeftBorderBox", void 0), r(this, "topRightBorderBox", void 0), r(this, "bottomRightBorderBox", void 0), r(this, "bottomLeftBorderBox", void 0), r(this, "topLeftPaddingBox", void 0), r(this, "topRightPaddingBox", void 0), r(this, "bottomRightPaddingBox", void 0), r(this, "bottomLeftPaddingBox", void 0), r(this, "topLeftContentBox", void 0), r(this, "topRightContentBox", void 0), r(this, "bottomRightContentBox", void 0), r(this, "bottomLeftContentBox", void 0);
5858
5935
  let t = e.styles, n = e.bounds, [i, a] = Xe(t.borderTopLeftRadius, n.width, n.height), [o, s] = Xe(t.borderTopRightRadius, n.width, n.height), [c, l] = Xe(t.borderBottomRightRadius, n.width, n.height), [u, d] = Xe(t.borderBottomLeftRadius, n.width, n.height), f = [];
5859
5936
  f.push((i + o) / n.width), f.push((u + c) / n.width), f.push((a + d) / n.height), f.push((s + l) / n.height);
5860
5937
  let p = Math.max(...f);
5861
5938
  p > 1 && (i /= p, a /= p, o /= p, s /= p, c /= p, l /= p, u /= p, d /= p);
5862
- let m = n.width - o, h = n.height - l, g = n.width - c, _ = n.height - d, v = t.borderTopWidth, y = t.borderRightWidth, b = t.borderBottomWidth, x = t.borderLeftWidth, S = I(t.paddingTop, e.bounds.width), ee = I(t.paddingRight, e.bounds.width), te = I(t.paddingBottom, e.bounds.width), C = I(t.paddingLeft, e.bounds.width);
5863
- this.topLeftBorderDoubleOuterBox = i > 0 || a > 0 ? X(n.left + x / 3, n.top + v / 3, i - x / 3, a - v / 3, 0) : new J(n.left + x / 3, n.top + v / 3), this.topRightBorderDoubleOuterBox = o > 0 || s > 0 ? X(n.left + m, n.top + v / 3, o - y / 3, s - v / 3, 1) : new J(n.left + n.width - y / 3, n.top + v / 3), this.bottomRightBorderDoubleOuterBox = c > 0 || l > 0 ? X(n.left + g, n.top + h, c - y / 3, l - b / 3, 2) : new J(n.left + n.width - y / 3, n.top + n.height - b / 3), this.bottomLeftBorderDoubleOuterBox = u > 0 || d > 0 ? X(n.left + x / 3, n.top + _, u - x / 3, d - b / 3, 3) : new J(n.left + x / 3, n.top + n.height - b / 3), this.topLeftBorderDoubleInnerBox = i > 0 || a > 0 ? X(n.left + x * 2 / 3, n.top + v * 2 / 3, i - x * 2 / 3, a - v * 2 / 3, 0) : new J(n.left + x * 2 / 3, n.top + v * 2 / 3), this.topRightBorderDoubleInnerBox = o > 0 || s > 0 ? X(n.left + m, n.top + v * 2 / 3, o - y * 2 / 3, s - v * 2 / 3, 1) : new J(n.left + n.width - y * 2 / 3, n.top + v * 2 / 3), this.bottomRightBorderDoubleInnerBox = c > 0 || l > 0 ? X(n.left + g, n.top + h, c - y * 2 / 3, l - b * 2 / 3, 2) : new J(n.left + n.width - y * 2 / 3, n.top + n.height - b * 2 / 3), this.bottomLeftBorderDoubleInnerBox = u > 0 || d > 0 ? X(n.left + x * 2 / 3, n.top + _, u - x * 2 / 3, d - b * 2 / 3, 3) : new J(n.left + x * 2 / 3, n.top + n.height - b * 2 / 3), this.topLeftBorderStroke = i > 0 || a > 0 ? X(n.left + x / 2, n.top + v / 2, i - x / 2, a - v / 2, 0) : new J(n.left + x / 2, n.top + v / 2), this.topRightBorderStroke = o > 0 || s > 0 ? X(n.left + m, n.top + v / 2, o - y / 2, s - v / 2, 1) : new J(n.left + n.width - y / 2, n.top + v / 2), this.bottomRightBorderStroke = c > 0 || l > 0 ? X(n.left + g, n.top + h, c - y / 2, l - b / 2, 2) : new J(n.left + n.width - y / 2, n.top + n.height - b / 2), this.bottomLeftBorderStroke = u > 0 || d > 0 ? X(n.left + x / 2, n.top + _, u - x / 2, d - b / 2, 3) : new J(n.left + x / 2, n.top + n.height - b / 2), this.topLeftBorderBox = i > 0 || a > 0 ? X(n.left, n.top, i, a, 0) : new J(n.left, n.top), this.topRightBorderBox = o > 0 || s > 0 ? X(n.left + m, n.top, o, s, 1) : new J(n.left + n.width, n.top), this.bottomRightBorderBox = c > 0 || l > 0 ? X(n.left + g, n.top + h, c, l, 2) : new J(n.left + n.width, n.top + n.height), this.bottomLeftBorderBox = u > 0 || d > 0 ? X(n.left, n.top + _, u, d, 3) : new J(n.left, n.top + n.height), this.topLeftPaddingBox = i > 0 || a > 0 ? X(n.left + x, n.top + v, Math.max(0, i - x), Math.max(0, a - v), 0) : new J(n.left + x, n.top + v), this.topRightPaddingBox = o > 0 || s > 0 ? X(n.left + Math.min(m, n.width - y), n.top + v, m > n.width + y ? 0 : Math.max(0, o - y), Math.max(0, s - v), 1) : new J(n.left + n.width - y, n.top + v), this.bottomRightPaddingBox = c > 0 || l > 0 ? X(n.left + Math.min(g, n.width - x), n.top + Math.min(h, n.height - b), Math.max(0, c - y), Math.max(0, l - b), 2) : new J(n.left + n.width - y, n.top + n.height - b), this.bottomLeftPaddingBox = u > 0 || d > 0 ? X(n.left + x, n.top + Math.min(_, n.height - b), Math.max(0, u - x), Math.max(0, d - b), 3) : new J(n.left + x, n.top + n.height - b), this.topLeftContentBox = i > 0 || a > 0 ? X(n.left + x + C, n.top + v + S, Math.max(0, i - (x + C)), Math.max(0, a - (v + S)), 0) : new J(n.left + x + C, n.top + v + S), this.topRightContentBox = o > 0 || s > 0 ? X(n.left + Math.min(m, n.width + x + C), n.top + v + S, m > n.width + x + C ? 0 : o - x + C, s - (v + S), 1) : new J(n.left + n.width - (y + ee), n.top + v + S), this.bottomRightContentBox = c > 0 || l > 0 ? X(n.left + Math.min(g, n.width - (x + C)), n.top + Math.min(h, n.height + v + S), Math.max(0, c - (y + ee)), l - (b + te), 2) : new J(n.left + n.width - (y + ee), n.top + n.height - (b + te)), this.bottomLeftContentBox = u > 0 || d > 0 ? X(n.left + x + C, n.top + _, Math.max(0, u - (x + C)), d - (b + te), 3) : new J(n.left + x + C, n.top + n.height - (b + te));
5939
+ let m = n.width - o, h = n.height - l, g = n.width - c, _ = n.height - d, v = t.borderTopWidth, y = t.borderRightWidth, b = t.borderBottomWidth, x = t.borderLeftWidth, S = I(t.paddingTop, e.bounds.width), C = I(t.paddingRight, e.bounds.width), ee = I(t.paddingBottom, e.bounds.width), w = I(t.paddingLeft, e.bounds.width);
5940
+ this.topLeftBorderDoubleOuterBox = i > 0 || a > 0 ? X(n.left + x / 3, n.top + v / 3, i - x / 3, a - v / 3, 0) : new J(n.left + x / 3, n.top + v / 3), this.topRightBorderDoubleOuterBox = o > 0 || s > 0 ? X(n.left + m, n.top + v / 3, o - y / 3, s - v / 3, 1) : new J(n.left + n.width - y / 3, n.top + v / 3), this.bottomRightBorderDoubleOuterBox = c > 0 || l > 0 ? X(n.left + g, n.top + h, c - y / 3, l - b / 3, 2) : new J(n.left + n.width - y / 3, n.top + n.height - b / 3), this.bottomLeftBorderDoubleOuterBox = u > 0 || d > 0 ? X(n.left + x / 3, n.top + _, u - x / 3, d - b / 3, 3) : new J(n.left + x / 3, n.top + n.height - b / 3), this.topLeftBorderDoubleInnerBox = i > 0 || a > 0 ? X(n.left + x * 2 / 3, n.top + v * 2 / 3, i - x * 2 / 3, a - v * 2 / 3, 0) : new J(n.left + x * 2 / 3, n.top + v * 2 / 3), this.topRightBorderDoubleInnerBox = o > 0 || s > 0 ? X(n.left + m, n.top + v * 2 / 3, o - y * 2 / 3, s - v * 2 / 3, 1) : new J(n.left + n.width - y * 2 / 3, n.top + v * 2 / 3), this.bottomRightBorderDoubleInnerBox = c > 0 || l > 0 ? X(n.left + g, n.top + h, c - y * 2 / 3, l - b * 2 / 3, 2) : new J(n.left + n.width - y * 2 / 3, n.top + n.height - b * 2 / 3), this.bottomLeftBorderDoubleInnerBox = u > 0 || d > 0 ? X(n.left + x * 2 / 3, n.top + _, u - x * 2 / 3, d - b * 2 / 3, 3) : new J(n.left + x * 2 / 3, n.top + n.height - b * 2 / 3), this.topLeftBorderStroke = i > 0 || a > 0 ? X(n.left + x / 2, n.top + v / 2, i - x / 2, a - v / 2, 0) : new J(n.left + x / 2, n.top + v / 2), this.topRightBorderStroke = o > 0 || s > 0 ? X(n.left + m, n.top + v / 2, o - y / 2, s - v / 2, 1) : new J(n.left + n.width - y / 2, n.top + v / 2), this.bottomRightBorderStroke = c > 0 || l > 0 ? X(n.left + g, n.top + h, c - y / 2, l - b / 2, 2) : new J(n.left + n.width - y / 2, n.top + n.height - b / 2), this.bottomLeftBorderStroke = u > 0 || d > 0 ? X(n.left + x / 2, n.top + _, u - x / 2, d - b / 2, 3) : new J(n.left + x / 2, n.top + n.height - b / 2), this.topLeftBorderBox = i > 0 || a > 0 ? X(n.left, n.top, i, a, 0) : new J(n.left, n.top), this.topRightBorderBox = o > 0 || s > 0 ? X(n.left + m, n.top, o, s, 1) : new J(n.left + n.width, n.top), this.bottomRightBorderBox = c > 0 || l > 0 ? X(n.left + g, n.top + h, c, l, 2) : new J(n.left + n.width, n.top + n.height), this.bottomLeftBorderBox = u > 0 || d > 0 ? X(n.left, n.top + _, u, d, 3) : new J(n.left, n.top + n.height), this.topLeftPaddingBox = i > 0 || a > 0 ? X(n.left + x, n.top + v, Math.max(0, i - x), Math.max(0, a - v), 0) : new J(n.left + x, n.top + v), this.topRightPaddingBox = o > 0 || s > 0 ? X(n.left + Math.min(m, n.width - y), n.top + v, m > n.width + y ? 0 : Math.max(0, o - y), Math.max(0, s - v), 1) : new J(n.left + n.width - y, n.top + v), this.bottomRightPaddingBox = c > 0 || l > 0 ? X(n.left + Math.min(g, n.width - x), n.top + Math.min(h, n.height - b), Math.max(0, c - y), Math.max(0, l - b), 2) : new J(n.left + n.width - y, n.top + n.height - b), this.bottomLeftPaddingBox = u > 0 || d > 0 ? X(n.left + x, n.top + Math.min(_, n.height - b), Math.max(0, u - x), Math.max(0, d - b), 3) : new J(n.left + x, n.top + n.height - b), this.topLeftContentBox = i > 0 || a > 0 ? X(n.left + x + w, n.top + v + S, Math.max(0, i - (x + w)), Math.max(0, a - (v + S)), 0) : new J(n.left + x + w, n.top + v + S), this.topRightContentBox = o > 0 || s > 0 ? X(n.left + Math.min(m, n.width + x + w), n.top + v + S, m > n.width + x + w ? 0 : o - x + w, s - (v + S), 1) : new J(n.left + n.width - (y + C), n.top + v + S), this.bottomRightContentBox = c > 0 || l > 0 ? X(n.left + Math.min(g, n.width - (x + w)), n.top + Math.min(h, n.height + v + S), Math.max(0, c - (y + C)), l - (b + ee), 2) : new J(n.left + n.width - (y + C), n.top + n.height - (b + ee)), this.bottomLeftContentBox = u > 0 || d > 0 ? X(n.left + x + w, n.top + _, Math.max(0, u - (x + w)), d - (b + ee), 3) : new J(n.left + x + w, n.top + n.height - (b + ee));
5864
5941
  }
5865
5942
  }, X = (e, t, n, r, i) => {
5866
5943
  let a = 4 * ((Math.sqrt(2) - 1) / 3), o = n * a, s = r * a, c = e + n, l = t + r;
5867
5944
  switch (i) {
5868
- case 0: return new Lc(new J(e, l), new J(e, l - s), new J(c - o, t), new J(c, t));
5869
- case 1: return new Lc(new J(e, t), new J(e + o, t), new J(c, l - s), new J(c, l));
5870
- case 2: return new Lc(new J(c, t), new J(c, t + s), new J(e + o, l), new J(e, l));
5871
- default: return new Lc(new J(c, l), new J(c - o, l), new J(e, t + s), new J(e, t));
5945
+ case 0: return new Uc(new J(e, l), new J(e, l - s), new J(c - o, t), new J(c, t));
5946
+ case 1: return new Uc(new J(e, t), new J(e + o, t), new J(c, l - s), new J(c, l));
5947
+ case 2: return new Uc(new J(c, t), new J(c, t + s), new J(e + o, l), new J(e, l));
5948
+ default: return new Uc(new J(c, l), new J(c - o, l), new J(e, t + s), new J(e, t));
5872
5949
  }
5873
- }, zc = (e) => [
5950
+ }, Gc = (e) => [
5874
5951
  e.topLeftBorderBox,
5875
5952
  e.topRightBorderBox,
5876
5953
  e.bottomRightBorderBox,
5877
5954
  e.bottomLeftBorderBox
5878
- ], Bc = (e) => [
5955
+ ], Kc = (e) => [
5879
5956
  e.topLeftContentBox,
5880
5957
  e.topRightContentBox,
5881
5958
  e.bottomRightContentBox,
5882
5959
  e.bottomLeftContentBox
5883
- ], Vc = (e) => [
5960
+ ], qc = (e) => [
5884
5961
  e.topLeftPaddingBox,
5885
5962
  e.topRightPaddingBox,
5886
5963
  e.bottomRightPaddingBox,
5887
5964
  e.bottomLeftPaddingBox
5888
- ], Hc = class {
5965
+ ], Jc = class {
5889
5966
  constructor(e, t, n) {
5890
5967
  r(this, "offsetX", void 0), r(this, "offsetY", void 0), r(this, "matrix", void 0), r(this, "type", 0), r(this, "target", 6), this.offsetX = e, this.offsetY = t, this.matrix = n;
5891
5968
  }
5892
- }, Uc = class {
5969
+ }, Yc = class {
5893
5970
  constructor(e, t) {
5894
5971
  r(this, "path", void 0), r(this, "target", void 0), r(this, "type", 1), this.path = e, this.target = t;
5895
5972
  }
5896
- }, Wc = class {
5973
+ }, Xc = class {
5897
5974
  constructor(e) {
5898
5975
  r(this, "opacity", void 0), r(this, "type", 2), r(this, "target", 6), this.opacity = e;
5899
5976
  }
5900
- }, Gc = class {
5977
+ }, Zc = class {
5901
5978
  constructor(e) {
5902
5979
  r(this, "applyClip", void 0), r(this, "type", 3), r(this, "target", 6), this.applyClip = e;
5903
5980
  }
5904
- }, Kc = {
5981
+ }, Qc = {
5905
5982
  [K.NORMAL]: "source-over",
5906
5983
  [K.MULTIPLY]: "multiply",
5907
5984
  [K.SCREEN]: "screen",
@@ -5918,11 +5995,11 @@ var Ei = {
5918
5995
  [K.SATURATION]: "saturation",
5919
5996
  [K.COLOR]: "color",
5920
5997
  [K.LUMINOSITY]: "luminosity"
5921
- }, qc = class {
5998
+ }, $c = class {
5922
5999
  constructor(e) {
5923
- r(this, "mixBlendMode", void 0), r(this, "type", 4), r(this, "target", 6), r(this, "compositeOperation", void 0), this.mixBlendMode = e, this.compositeOperation = Kc[e];
6000
+ r(this, "mixBlendMode", void 0), r(this, "type", 4), r(this, "target", 6), r(this, "compositeOperation", void 0), this.mixBlendMode = e, this.compositeOperation = Qc[e];
5924
6001
  }
5925
- }, Jc = class e {
6002
+ }, el = class e {
5926
6003
  constructor(t) {
5927
6004
  r(this, "type", 5), r(this, "target", 6), r(this, "safeFilterString", void 0), r(this, "shadow", void 0);
5928
6005
  let n = e.parseDropShadow(t);
@@ -5978,15 +6055,15 @@ var Ei = {
5978
6055
  static isCSSLength(e) {
5979
6056
  return /^-?[\d.]+(px|em|rem|pt|cm|mm|in|pc|ex|ch|vw|vh|vmin|vmax|%)?$/i.test(e);
5980
6057
  }
5981
- }, Yc = (e) => e.type === 0, Xc = (e) => e.type === 1, Zc = (e) => e.type === 2, Qc = (e) => e.type === 3, $c = (e) => e.type === 4, el = (e) => e.type === 5, tl = class {
6058
+ }, tl = (e) => e.type === 0, nl = (e) => e.type === 1, rl = (e) => e.type === 2, il = (e) => e.type === 3, al = (e) => e.type === 4, ol = (e) => e.type === 5, sl = class {
5982
6059
  constructor(e) {
5983
6060
  r(this, "element", void 0), r(this, "negativeZIndex", void 0), r(this, "zeroOrAutoZIndexOrTransformedOrOpacity", void 0), r(this, "positiveZIndex", void 0), r(this, "nonPositionedFloats", void 0), r(this, "nonPositionedInlineLevel", void 0), r(this, "inlineLevel", void 0), r(this, "nonInlineLevel", void 0), this.element = e, this.inlineLevel = [], this.nonInlineLevel = [], this.negativeZIndex = [], this.zeroOrAutoZIndexOrTransformedOrOpacity = [], this.positiveZIndex = [], this.nonPositionedFloats = [], this.nonPositionedInlineLevel = [];
5984
6061
  }
5985
- }, nl = class {
6062
+ }, cl = class {
5986
6063
  constructor(e, t) {
5987
- if (r(this, "container", void 0), r(this, "parent", void 0), r(this, "effects", []), r(this, "curves", void 0), r(this, "listValue", void 0), r(this, "plainEffectsCache", null), this.container = e, this.parent = t, this.curves = new Rc(this.container), this.container.styles.opacity < 1 && this.effects.push(new Wc(this.container.styles.opacity)), this.container.styles.translate !== null) {
6064
+ if (r(this, "container", void 0), r(this, "parent", void 0), r(this, "effects", []), r(this, "curves", void 0), r(this, "listValue", void 0), r(this, "plainEffectsCache", null), this.container = e, this.parent = t, this.curves = new Wc(this.container), this.container.styles.opacity < 1 && this.effects.push(new Xc(this.container.styles.opacity)), this.container.styles.translate !== null) {
5988
6065
  let e = this.container.styles.transformOrigin, t = this.container.bounds.left + I(e[0], this.container.bounds.width), n = this.container.bounds.top + I(e[1], this.container.bounds.height), [r, i] = this.container.styles.translate, a = I(r, this.container.bounds.width), o = I(i, this.container.bounds.height);
5989
- this.effects.push(new Hc(t, n, [
6066
+ this.effects.push(new Jc(t, n, [
5990
6067
  1,
5991
6068
  0,
5992
6069
  0,
@@ -6004,11 +6081,11 @@ var Ei = {
6004
6081
  0,
6005
6082
  0
6006
6083
  ];
6007
- this.effects.push(new Hc(t, n, o));
6084
+ this.effects.push(new Jc(t, n, o));
6008
6085
  }
6009
6086
  if (this.container.styles.scale !== null) {
6010
6087
  let e = this.container.styles.transformOrigin, t = this.container.bounds.left + I(e[0], this.container.bounds.width), n = this.container.bounds.top + I(e[1], this.container.bounds.height), [r, i] = this.container.styles.scale;
6011
- this.effects.push(new Hc(t, n, [
6088
+ this.effects.push(new Jc(t, n, [
6012
6089
  r,
6013
6090
  0,
6014
6091
  0,
@@ -6019,17 +6096,17 @@ var Ei = {
6019
6096
  }
6020
6097
  if (this.container.styles.transform !== null) {
6021
6098
  let e = this.container.styles.transformOrigin, t = this.container.bounds.left + I(e[0], this.container.bounds.width), n = this.container.bounds.top + I(e[1], this.container.bounds.height), r = this.container.styles.transform;
6022
- this.effects.push(new Hc(t, n, r));
6099
+ this.effects.push(new Jc(t, n, r));
6023
6100
  }
6024
- if (rl(this.container.styles)) {
6025
- let e = zc(this.curves), t = Vc(this.curves);
6026
- Pc(e, t) ? this.effects.push(new Uc(e, 6)) : (this.effects.push(new Uc(e, 2)), this.effects.push(new Uc(t, 4)));
6101
+ if (ll(this.container.styles)) {
6102
+ let e = Gc(this.curves), t = qc(this.curves);
6103
+ Bc(e, t) ? this.effects.push(new Yc(e, 6)) : (this.effects.push(new Yc(e, 2)), this.effects.push(new Yc(t, 4)));
6027
6104
  }
6028
6105
  if (this.container.styles.clipPath.type !== 0) {
6029
- let e = al(this.container.styles.clipPath, this.container.bounds);
6106
+ let e = dl(this.container.styles.clipPath, this.container.bounds);
6030
6107
  e && this.effects.push(e);
6031
6108
  }
6032
- if (this.container.styles.mixBlendMode !== K.NORMAL && this.effects.push(new qc(this.container.styles.mixBlendMode)), this.container.styles.filter !== null && this.effects.push(new Jc(this.container.styles.filter)), this.container.styles.zoom !== 1) {
6109
+ if (this.container.styles.mixBlendMode !== K.NORMAL && this.effects.push(new $c(this.container.styles.mixBlendMode)), this.container.styles.filter !== null && this.effects.push(new el(this.container.styles.filter)), this.container.styles.zoom !== 1) {
6033
6110
  let e = this.container.bounds.left, t = this.container.bounds.top, n = this.container.styles.zoom, r = [
6034
6111
  n,
6035
6112
  0,
@@ -6038,7 +6115,7 @@ var Ei = {
6038
6115
  0,
6039
6116
  0
6040
6117
  ];
6041
- this.effects.push(new Hc(e, t, r));
6118
+ this.effects.push(new Jc(e, t, r));
6042
6119
  }
6043
6120
  }
6044
6121
  getEffects(e, t) {
@@ -6051,13 +6128,13 @@ var Ei = {
6051
6128
  return this.computeEffects(e, t);
6052
6129
  }
6053
6130
  computeEffects(e, t) {
6054
- let n = [2, 3].indexOf(this.container.styles.position) === -1, r = this === t ? null : this.parent, i = (e) => e.effects.filter((n) => e !== t || !el(n) && !Zc(n) && !$c(n)), a = i(this);
6131
+ let n = [2, 3].indexOf(this.container.styles.position) === -1, r = this === t ? null : this.parent, i = (e) => e.effects.filter((n) => e !== t || !ol(n) && !rl(n) && !al(n)), a = i(this);
6055
6132
  for (; r;) {
6056
- let e = i(r).filter((e) => !Xc(e));
6133
+ let e = i(r).filter((e) => !nl(e));
6057
6134
  if (n || r.container.styles.position !== 0 || !r.parent) {
6058
- if (n = [2, 3].indexOf(r.container.styles.position) === -1, rl(r.container.styles)) {
6059
- let e = zc(r.curves), t = Vc(r.curves);
6060
- Pc(e, t) || a.unshift(new Uc(t, 6));
6135
+ if (n = [2, 3].indexOf(r.container.styles.position) === -1, ll(r.container.styles)) {
6136
+ let e = Gc(r.curves), t = qc(r.curves);
6137
+ Bc(e, t) || a.unshift(new Yc(t, 6));
6061
6138
  }
6062
6139
  a.unshift(...e);
6063
6140
  } else a.unshift(...e);
@@ -6065,30 +6142,30 @@ var Ei = {
6065
6142
  }
6066
6143
  return a.filter((t) => H(t.target, e));
6067
6144
  }
6068
- }, rl = (e) => e.overflowX !== 0 || e.overflowY !== 0, il = (e, t, n, r, i) => e === "closest-side" ? Math.min(t - n, r - t) : e === "farthest-side" ? Math.max(t - n, r - t) : I(e, i), al = (e, t) => {
6145
+ }, ll = (e) => e.overflowX !== 0 || e.overflowY !== 0, ul = (e, t, n, r, i) => e === "closest-side" ? Math.min(t - n, r - t) : e === "farthest-side" ? Math.max(t - n, r - t) : I(e, i), dl = (e, t) => {
6069
6146
  let { left: n, top: r, width: i, height: a } = t;
6070
6147
  switch (e.type) {
6071
6148
  case 1: {
6072
6149
  let t = I(e.left, i), o = I(e.top, a), s = n + t, c = r + o, l = Math.max(0, i - t - I(e.right, i)), u = Math.max(0, a - o - I(e.bottom, a));
6073
- return new Gc((e) => {
6150
+ return new Zc((e) => {
6074
6151
  e.beginPath(), e.rect(s, c, l, u), e.clip();
6075
6152
  });
6076
6153
  }
6077
6154
  case 2: {
6078
6155
  let t = n + I(e.cx, i), o = r + I(e.cy, a), s;
6079
- return s = e.radius === "closest-side" ? Math.min(t - n, o - r, n + i - t, r + a - o) : e.radius === "farthest-side" ? Math.max(t - n, o - r, n + i - t, r + a - o) : I(e.radius, Math.sqrt(i * i + a * a) / Math.SQRT2), new Gc((e) => {
6156
+ return s = e.radius === "closest-side" ? Math.min(t - n, o - r, n + i - t, r + a - o) : e.radius === "farthest-side" ? Math.max(t - n, o - r, n + i - t, r + a - o) : I(e.radius, Math.sqrt(i * i + a * a) / Math.SQRT2), new Zc((e) => {
6080
6157
  e.beginPath(), e.arc(t, o, Math.max(0, s), 0, Math.PI * 2), e.clip();
6081
6158
  });
6082
6159
  }
6083
6160
  case 3: {
6084
- let t = n + I(e.cx, i), o = r + I(e.cy, a), s = il(e.rx, t, n, n + i, i), c = il(e.ry, o, r, r + a, a);
6085
- return new Gc((e) => {
6161
+ let t = n + I(e.cx, i), o = r + I(e.cy, a), s = ul(e.rx, t, n, n + i, i), c = ul(e.ry, o, r, r + a, a);
6162
+ return new Zc((e) => {
6086
6163
  e.beginPath(), e.ellipse(t, o, Math.max(0, s), Math.max(0, c), 0, 0, Math.PI * 2), e.clip();
6087
6164
  });
6088
6165
  }
6089
6166
  case 4: {
6090
6167
  let t = e.points.map(([e, t]) => [n + I(e, i), r + I(t, a)]);
6091
- return new Gc((e) => {
6168
+ return new Zc((e) => {
6092
6169
  if (e.beginPath(), t.length > 0) {
6093
6170
  e.moveTo(g(g(t, 0), 0), g(g(t, 0), 1));
6094
6171
  for (let n = 1; n < t.length; n++) e.lineTo(g(g(t, n), 0), g(g(t, n), 1));
@@ -6099,7 +6176,7 @@ var Ei = {
6099
6176
  }
6100
6177
  case 5: {
6101
6178
  let { d: t } = e, i = null;
6102
- return new Gc((e) => {
6179
+ return new Zc((e) => {
6103
6180
  try {
6104
6181
  i || (i = new Path2D(t));
6105
6182
  let a = e.getTransform();
@@ -6109,21 +6186,21 @@ var Ei = {
6109
6186
  }
6110
6187
  case 6: {
6111
6188
  let t = n + I(e.x, i), o = r + I(e.y, a), s = Math.max(0, I(e.width, i)), c = Math.max(0, I(e.height, a));
6112
- return new Gc((e) => {
6189
+ return new Zc((e) => {
6113
6190
  e.beginPath(), e.rect(t, o, s, c), e.clip();
6114
6191
  });
6115
6192
  }
6116
6193
  case 0: return null;
6117
6194
  default: return null;
6118
6195
  }
6119
- }, ol = (e, t, n, r) => {
6196
+ }, fl = (e, t, n, r) => {
6120
6197
  e.container.elements.forEach((i) => {
6121
- let a = i.createsRealStackingContext, o = i.createsStackingContext, s = new nl(i, e);
6198
+ let a = i.createsRealStackingContext, o = i.createsStackingContext, s = new cl(i, e);
6122
6199
  H(i.styles.display, 2048) && r.push(s);
6123
6200
  let c = i.isListOwner ? [] : r;
6124
6201
  if (a || o) {
6125
- let e = a || i.styles.isPositioned() ? n : t, r = new tl(s);
6126
- if (i.styles.isPositioned() || i.styles.opacity < 1 || i.styles.isTransformed()) {
6202
+ let e = a || i.styles.isPositioned() ? n : t, r = new sl(s);
6203
+ if (a || i.styles.isPositioned() || i.styles.opacity < 1 || i.styles.isTransformed()) {
6127
6204
  let t = i.styles.zIndex.order;
6128
6205
  if (t < 0) {
6129
6206
  let n = 0;
@@ -6133,20 +6210,20 @@ var Ei = {
6133
6210
  e.positiveZIndex.some((e, r) => t >= e.element.container.styles.zIndex.order ? (n = r + 1, !1) : n > 0), e.positiveZIndex.splice(n, 0, r);
6134
6211
  } else e.zeroOrAutoZIndexOrTransformedOrOpacity.push(r);
6135
6212
  } else i.styles.isFloating() ? e.nonPositionedFloats.push(r) : e.nonPositionedInlineLevel.push(r);
6136
- ol(s, r, a ? r : n, c);
6137
- } else i.styles.isInlineLevel() ? t.inlineLevel.push(s) : t.nonInlineLevel.push(s), ol(s, t, n, c);
6138
- i.isListOwner && sl(i, c);
6213
+ fl(s, r, a ? r : n, c);
6214
+ } else i.styles.isInlineLevel() ? t.inlineLevel.push(s) : t.nonInlineLevel.push(s), fl(s, t, n, c);
6215
+ i.isListOwner && pl(i, c);
6139
6216
  });
6140
- }, sl = (e, t) => {
6141
- let n = e instanceof mc ? e.start : 1, r = e instanceof mc && e.reversed;
6217
+ }, pl = (e, t) => {
6218
+ let n = e instanceof bc ? e.start : 1, r = e instanceof bc && e.reversed;
6142
6219
  for (let e = 0; e < t.length; e++) {
6143
6220
  let i = g(t, e);
6144
- i.container instanceof pc && typeof i.container.value == "number" && i.container.value !== 0 && (n = i.container.value), i.listValue = Nr(n, i.container.styles.listStyleType, !0), n += r ? -1 : 1;
6221
+ i.container instanceof yc && typeof i.container.value == "number" && i.container.value !== 0 && (n = i.container.value), i.listValue = Nr(n, i.container.styles.listStyleType, !0), n += r ? -1 : 1;
6145
6222
  }
6146
- }, cl = (e) => {
6147
- let t = new nl(e, null), n = new tl(t), r = [];
6148
- return ol(t, n, n, r), sl(t.container, r), n;
6149
- }, ll = (e) => Math.min(1, Math.max(0, e)), ul = (e) => {
6223
+ }, ml = (e) => {
6224
+ let t = new cl(e, null), n = new sl(t), r = [];
6225
+ return fl(t, n, n, r), pl(t.container, r), n;
6226
+ }, hl = (e) => Math.min(1, Math.max(0, e)), gl = (e) => {
6150
6227
  let t = g(e, 0), n = g(e, e.length - 1);
6151
6228
  if (n.stop - t.stop < 1e-6) return null;
6152
6229
  let r = Math.max(n.stop - t.stop, .01), i = [], a = Math.ceil(1 / r);
@@ -6163,17 +6240,17 @@ var Ei = {
6163
6240
  stop: 1,
6164
6241
  color: z(n.color)
6165
6242
  }), i;
6166
- }, dl = (e) => e.map((e) => ({
6167
- stop: ll(e.stop),
6243
+ }, _l = (e) => e.map((e) => ({
6244
+ stop: hl(e.stop),
6168
6245
  color: z(e.color)
6169
- })), fl = (e, t, n, r, i = !1) => {
6246
+ })), vl = (e, t, n, r, i = !1) => {
6170
6247
  let a = W(r, t), o = z(g(a, a.length - 1).color), s = e.createElement("canvas");
6171
6248
  s.width = Math.max(1, Math.ceil(t * 2)), s.height = Math.max(1, Math.ceil(n * 2));
6172
6249
  let c = s.getContext("2d");
6173
6250
  if (!c) return null;
6174
6251
  let l;
6175
6252
  if (i) {
6176
- let e = ul(a);
6253
+ let e = gl(a);
6177
6254
  if (!e) return c.fillStyle = o, c.fillRect(0, 0, s.width, s.height), {
6178
6255
  canvas: s,
6179
6256
  lastColor: o,
@@ -6181,22 +6258,22 @@ var Ei = {
6181
6258
  ry: n
6182
6259
  };
6183
6260
  l = e;
6184
- } else l = dl(a);
6261
+ } else l = _l(a);
6185
6262
  let u = c.createRadialGradient(t, t, 0, t, t, t);
6186
- return l.forEach((e) => u.addColorStop(ll(e.stop), e.color)), c.fillStyle = u, t !== n && c.scale(1, n / t), c.fillRect(0, 0, t * 2, t * 2), {
6263
+ return l.forEach((e) => u.addColorStop(hl(e.stop), e.color)), c.fillStyle = u, t !== n && c.scale(1, n / t), c.fillRect(0, 0, t * 2, t * 2), {
6187
6264
  canvas: s,
6188
6265
  lastColor: o,
6189
6266
  rx: t,
6190
6267
  ry: n
6191
6268
  };
6192
- }, pl = (e) => {
6269
+ }, yl = (e) => {
6193
6270
  let t = e.bounds, n = e.styles;
6194
6271
  return t.add(n.borderLeftWidth, n.borderTopWidth, -(n.borderRightWidth + n.borderLeftWidth), -(n.borderTopWidth + n.borderBottomWidth));
6195
- }, ml = (e) => {
6272
+ }, bl = (e) => {
6196
6273
  let t = e.styles, n = e.bounds, r = I(t.paddingLeft, n.width), i = I(t.paddingRight, n.width), a = I(t.paddingTop, n.width), o = I(t.paddingBottom, n.width);
6197
6274
  return n.add(r + t.borderLeftWidth, a + t.borderTopWidth, -(t.borderRightWidth + t.borderLeftWidth + r + i), -(t.borderTopWidth + t.borderBottomWidth + a + o));
6198
- }, hl = (e, t) => e === 0 ? t.bounds : e === 2 ? ml(t) : pl(t), gl = (e, t) => e === 0 ? t.bounds : e === 2 ? ml(t) : pl(t), _l = (e, t, n) => {
6199
- let r = hl(xl(e.styles.backgroundOrigin, t), e), i = gl(xl(e.styles.backgroundClip, t), e), a = bl(xl(e.styles.backgroundSize, t), n, r), [o, s] = a, c = Xe(xl(e.styles.backgroundPosition, t), r.width - o, r.height - s), l = Sl(xl(e.styles.backgroundRepeat, t), c, a, r, i), u = Math.round(r.left + c[0]), d = Math.round(r.top + c[1]);
6275
+ }, xl = (e, t) => e === 0 ? t.bounds : e === 2 ? bl(t) : yl(t), Sl = (e, t) => e === 0 ? t.bounds : e === 2 ? bl(t) : yl(t), Cl = (e, t, n) => {
6276
+ let r = xl(Dl(e.styles.backgroundOrigin, t), e), i = Sl(Dl(e.styles.backgroundClip, t), e), a = El(Dl(e.styles.backgroundSize, t), n, r), [o, s] = a, c = Xe(Dl(e.styles.backgroundPosition, t), r.width - o, r.height - s), l = Ol(Dl(e.styles.backgroundRepeat, t), c, a, r, i), u = Math.round(r.left + c[0]), d = Math.round(r.top + c[1]);
6200
6277
  return o = Math.max(1, o), s = Math.max(1, s), [
6201
6278
  l,
6202
6279
  u,
@@ -6204,25 +6281,25 @@ var Ei = {
6204
6281
  o,
6205
6282
  s
6206
6283
  ];
6207
- }, vl = (e) => D(e) && e.value === "auto", yl = (e) => typeof e == "number", bl = (e, [t, n, r], i) => {
6284
+ }, wl = (e) => D(e) && e.value === "auto", Tl = (e) => typeof e == "number", El = (e, [t, n, r], i) => {
6208
6285
  let [a, o] = e;
6209
6286
  if (!a) return [0, 0];
6210
6287
  if (M(a) && o && M(o)) return [I(a, i.width), I(o, i.height)];
6211
- let s = yl(r);
6212
- if (D(a) && (a.value === "contain" || a.value === "cover")) return yl(r) ? i.width / i.height < r == (a.value === "cover") ? [i.height * r, i.height] : [i.width, i.width / r] : [i.width, i.height];
6213
- let c = yl(t), l = yl(n), u = c || l;
6214
- if (vl(a) && (!o || vl(o))) return c && l ? [t, n] : !s && !u ? [i.width, i.height] : u && s ? [c ? t : n * r, l ? n : t / r] : [c ? t : i.width, l ? n : i.height];
6288
+ let s = Tl(r);
6289
+ if (D(a) && (a.value === "contain" || a.value === "cover")) return Tl(r) ? i.width / i.height < r == (a.value === "cover") ? [i.height * r, i.height] : [i.width, i.width / r] : [i.width, i.height];
6290
+ let c = Tl(t), l = Tl(n), u = c || l;
6291
+ if (wl(a) && (!o || wl(o))) return c && l ? [t, n] : !s && !u ? [i.width, i.height] : u && s ? [c ? t : n * r, l ? n : t / r] : [c ? t : i.width, l ? n : i.height];
6215
6292
  if (s) {
6216
6293
  let e = 0, t = 0;
6217
- return M(a) ? e = I(a, i.width) : o && M(o) && (t = I(o, i.height)), vl(a) ? e = t * r : (!o || vl(o)) && (t = e / r), [e, t];
6294
+ return M(a) ? e = I(a, i.width) : o && M(o) && (t = I(o, i.height)), wl(a) ? e = t * r : (!o || wl(o)) && (t = e / r), [e, t];
6218
6295
  }
6219
6296
  let d = null, f = null;
6220
- if (M(a) ? d = I(a, i.width) : o && M(o) && (f = I(o, i.height)), d !== null && (!o || vl(o)) && (f = c && l ? d / t * n : i.height), f !== null && vl(a) && (d = c && l ? f / n * t : i.width), d !== null && f !== null) return [d, f];
6297
+ if (M(a) ? d = I(a, i.width) : o && M(o) && (f = I(o, i.height)), d !== null && (!o || wl(o)) && (f = c && l ? d / t * n : i.height), f !== null && wl(a) && (d = c && l ? f / n * t : i.width), d !== null && f !== null) return [d, f];
6221
6298
  throw Error("Unable to calculate background-size for element");
6222
- }, xl = (e, t) => {
6299
+ }, Dl = (e, t) => {
6223
6300
  let n = e[t];
6224
6301
  return n === void 0 ? g(e, 0) : n;
6225
- }, Sl = (e, [t, n], [r, i], a, o) => {
6302
+ }, Ol = (e, [t, n], [r, i], a, o) => {
6226
6303
  switch (e) {
6227
6304
  case 2: return [
6228
6305
  new J(Math.round(a.left), Math.round(a.top + n)),
@@ -6251,7 +6328,7 @@ var Ei = {
6251
6328
  }
6252
6329
  }, Z = class extends Error {}, Q = (e) => {
6253
6330
  e.width = e.height = 0;
6254
- }, Cl = [
6331
+ }, kl = [
6255
6332
  "brightness",
6256
6333
  "contrast",
6257
6334
  "grayscale",
@@ -6260,19 +6337,19 @@ var Ei = {
6260
6337
  "opacity",
6261
6338
  "saturate",
6262
6339
  "sepia"
6263
- ], wl = 256, Tl = /* @__PURE__ */ new Map(), El = { functions: [] };
6264
- function Dl(e) {
6265
- if (!e || e === "none") return El;
6266
- let t = Tl.get(e);
6267
- if (t !== void 0) return Tl.delete(e), Tl.set(e, t), t;
6268
- let n = Ol(e);
6269
- if (Tl.size >= wl) {
6270
- let e = Tl.keys().next().value;
6271
- e !== void 0 && Tl.delete(e);
6272
- }
6273
- return Tl.set(e, n), n;
6340
+ ], Al = 256, jl = /* @__PURE__ */ new Map(), Ml = { functions: [] };
6341
+ function Nl(e) {
6342
+ if (!e || e === "none") return Ml;
6343
+ let t = jl.get(e);
6344
+ if (t !== void 0) return jl.delete(e), jl.set(e, t), t;
6345
+ let n = Pl(e);
6346
+ if (jl.size >= Al) {
6347
+ let e = jl.keys().next().value;
6348
+ e !== void 0 && jl.delete(e);
6349
+ }
6350
+ return jl.set(e, n), n;
6274
6351
  }
6275
- var Ol = (e) => {
6352
+ var Pl = (e) => {
6276
6353
  let t = [], n = 0;
6277
6354
  for (; n < e.length;) {
6278
6355
  let r = e[n];
@@ -6284,14 +6361,14 @@ var Ol = (e) => {
6284
6361
  if (i === -1) return null;
6285
6362
  let a = e.slice(n, i).trim();
6286
6363
  if (!/^[a-zA-Z-]+$/.test(a)) return null;
6287
- let o = kl(e, i);
6364
+ let o = Fl(e, i);
6288
6365
  if (o === -1) return null;
6289
- let s = jl(a, e.slice(i + 1, o).trim());
6366
+ let s = Ll(a, e.slice(i + 1, o).trim());
6290
6367
  if (!s) return null;
6291
6368
  t.push(s), n = o + 1;
6292
6369
  }
6293
6370
  return { functions: t };
6294
- }, kl = (e, t) => {
6371
+ }, Fl = (e, t) => {
6295
6372
  let n = 1;
6296
6373
  for (let r = t + 1; r < e.length; r++) {
6297
6374
  let t = e[r];
@@ -6299,24 +6376,24 @@ var Ol = (e) => {
6299
6376
  else if (t === ")" && (n--, n === 0)) return r;
6300
6377
  }
6301
6378
  return -1;
6302
- }, Al = /^-?\d+(?:\.\d+)?px$/, jl = (e, t) => {
6379
+ }, Il = /^-?\d+(?:\.\d+)?px$/, Ll = (e, t) => {
6303
6380
  if (e === "blur") {
6304
6381
  if (t === "0") return {
6305
6382
  kind: "blur",
6306
6383
  value: 0
6307
6384
  };
6308
- if (!Al.test(t)) return null;
6385
+ if (!Il.test(t)) return null;
6309
6386
  let e = Number.parseFloat(t);
6310
6387
  return e < 0 ? null : {
6311
6388
  kind: "blur",
6312
6389
  value: e
6313
6390
  };
6314
6391
  }
6315
- if (e === "drop-shadow") return Nl(t);
6316
- if (Cl.indexOf(e) !== -1) {
6392
+ if (e === "drop-shadow") return zl(t);
6393
+ if (kl.indexOf(e) !== -1) {
6317
6394
  let n = e;
6318
6395
  if (n === "hue-rotate") {
6319
- let e = Pl(t);
6396
+ let e = Bl(t);
6320
6397
  return e === null ? null : {
6321
6398
  kind: "unitless",
6322
6399
  name: n,
@@ -6331,14 +6408,14 @@ var Ol = (e) => {
6331
6408
  } : null;
6332
6409
  }
6333
6410
  return null;
6334
- }, Ml = (e) => {
6411
+ }, Rl = (e) => {
6335
6412
  let t = [], n = 0, r = "";
6336
6413
  for (let i of e) i === "(" ? n++ : i === ")" && n--, i === " " && n === 0 ? (r && t.push(r), r = "") : r += i;
6337
6414
  return r && t.push(r), t;
6338
- }, Nl = (e) => {
6339
- let t = Ml(e), n = t.filter((e) => Al.test(e)).map((e) => Number.parseFloat(e));
6415
+ }, zl = (e) => {
6416
+ let t = Rl(e), n = t.filter((e) => Il.test(e)).map((e) => Number.parseFloat(e));
6340
6417
  if (n.length < 2 || n.length > 3) return null;
6341
- let r = t.filter((e) => !Al.test(e));
6418
+ let r = t.filter((e) => !Il.test(e));
6342
6419
  return t.length - r.length === n.length ? {
6343
6420
  kind: "drop-shadow",
6344
6421
  x: n[0],
@@ -6346,35 +6423,35 @@ var Ol = (e) => {
6346
6423
  blur: n[2] ?? 0,
6347
6424
  color: r.join(" ") || "rgba(0, 0, 0, 0)"
6348
6425
  } : null;
6349
- }, Pl = (e) => {
6426
+ }, Bl = (e) => {
6350
6427
  let t = e.trim();
6351
6428
  if (t === "0") return 0;
6352
6429
  let n = Number.parseFloat(t);
6353
6430
  return Number.isNaN(n) ? null : t.endsWith("deg") ? n : t.endsWith("grad") ? n * .9 : t.endsWith("rad") ? n * 180 / Math.PI : t.endsWith("turn") ? n * 360 : null;
6354
- }, Fl = (e, t) => e.functions.map((e) => {
6431
+ }, Vl = (e, t) => e.functions.map((e) => {
6355
6432
  switch (e.kind) {
6356
6433
  case "blur": return `blur(${e.value * t}px)`;
6357
6434
  case "drop-shadow": return `drop-shadow(${e.x * t}px ${e.y * t}px ${e.blur * t}px ${e.color})`;
6358
6435
  case "unitless": return e.name === "hue-rotate" ? `hue-rotate(${e.value}deg)` : `${e.name}(${e.value})`;
6359
6436
  }
6360
6437
  }).join(" ");
6361
- function Il(e) {
6438
+ function Hl(e) {
6362
6439
  let t = 0, n = 0;
6363
6440
  for (let r of e.functions) r.kind === "blur" ? t += r.value : r.kind === "drop-shadow" && (t += r.blur, n = Math.max(n, Math.abs(r.x), Math.abs(r.y)));
6364
6441
  return Math.ceil(3 * t + n);
6365
6442
  }
6366
- function Ll(e) {
6443
+ function Ul(e) {
6367
6444
  let t = (e.ownerDocument ?? document).createElement("canvas");
6368
6445
  return t.width = e.width, t.height = e.height, t;
6369
6446
  }
6370
- var Rl = (e, t) => new Promise((n, r) => {
6447
+ var Wl = (e, t) => new Promise((n, r) => {
6371
6448
  let i = (e) => {
6372
6449
  clearTimeout(o), t?.removeEventListener("abort", a), e ? r(e) : n();
6373
6450
  }, a = () => i(new DOMException("The operation was aborted.", "AbortError")), o = setTimeout(() => i(new Z("Filter surface image decode timed out")), 1e4);
6374
6451
  t?.addEventListener("abort", a, { once: !0 }), t?.aborted ? a() : e.decode().then(() => i(), () => i(new Z("Filter surface image decode failed")));
6375
- }), zl = /* @__PURE__ */ new WeakMap();
6376
- function Bl(e = document) {
6377
- let t = zl.get(e);
6452
+ }), Gl = /* @__PURE__ */ new WeakMap();
6453
+ function Kl(e = document) {
6454
+ let t = Gl.get(e);
6378
6455
  if (t !== void 0) return t;
6379
6456
  let n = e.createElement("canvas"), r = e.createElement("canvas"), i = !1;
6380
6457
  try {
@@ -6390,15 +6467,15 @@ function Bl(e = document) {
6390
6467
  } catch {} finally {
6391
6468
  Q(n), Q(r);
6392
6469
  }
6393
- return zl.set(e, i), i;
6470
+ return Gl.set(e, i), i;
6394
6471
  }
6395
- function Vl(e, t, n, r, i) {
6472
+ function ql(e, t, n, r, i) {
6396
6473
  let a, o, s = !1;
6397
6474
  try {
6398
- q(i), a = Ll(e);
6475
+ q(i), a = Ul(e);
6399
6476
  let c = a.getContext("2d");
6400
- if (!c || !("filter" in c) || (c.filter = Fl(t, r), c.filter === "none" || c.filter === "")) return null;
6401
- c.drawImage(e, 0, 0), q(i), o = Ll(e);
6477
+ if (!c || !("filter" in c) || (c.filter = Vl(t, r), c.filter === "none" || c.filter === "")) return null;
6478
+ c.drawImage(e, 0, 0), q(i), o = Ul(e);
6402
6479
  let l = o.getContext("2d");
6403
6480
  return l ? (l.globalAlpha = n, l.drawImage(a, 0, 0), q(i), s = !0, o) : null;
6404
6481
  } catch {
@@ -6407,22 +6484,22 @@ function Vl(e, t, n, r, i) {
6407
6484
  a && Q(a), o && !s && Q(o);
6408
6485
  }
6409
6486
  }
6410
- var Hl = (e) => {
6487
+ var Jl = (e) => {
6411
6488
  let t = 0, n = 0;
6412
6489
  for (let r of e.functions) if (r.kind === "blur") t++;
6413
6490
  else if (r.kind === "drop-shadow") n++;
6414
6491
  else return !1;
6415
6492
  return t > 1 || n > 1 ? !1 : t > 0 && n > 0 ? e.functions.findIndex((e) => e.kind === "blur") < e.functions.findIndex((e) => e.kind === "drop-shadow") : !0;
6416
6493
  };
6417
- async function Ul(e, t, n, r, i) {
6418
- if (q(i), t.functions.length > 0 && Bl(e.ownerDocument ?? document)) {
6419
- let a = Vl(e, t, n, r, i);
6494
+ async function Yl(e, t, n, r, i) {
6495
+ if (q(i), t.functions.length > 0 && Kl(e.ownerDocument ?? document)) {
6496
+ let a = ql(e, t, n, r, i);
6420
6497
  if (a) return a;
6421
6498
  }
6422
- if (!Hl(t)) throw new Z("Filter chain requires native canvas filters");
6423
- return Wl(e, t, n, r, i);
6499
+ if (!Jl(t)) throw new Z("Filter chain requires native canvas filters");
6500
+ return Xl(e, t, n, r, i);
6424
6501
  }
6425
- async function Wl(e, t, n, r, i) {
6502
+ async function Xl(e, t, n, r, i) {
6426
6503
  q(i);
6427
6504
  let a = t.functions.find((e) => e.kind === "blur"), o = t.functions.find((e) => e.kind === "drop-shadow"), s = a && a.kind === "blur" ? a.value : 0, c = o && o.kind === "drop-shadow" ? {
6428
6505
  x: o.x,
@@ -6431,7 +6508,7 @@ async function Wl(e, t, n, r, i) {
6431
6508
  color: o.color
6432
6509
  } : void 0;
6433
6510
  if (!s && !c) {
6434
- let t = Ll(e), r = t.getContext("2d");
6511
+ let t = Ul(e), r = t.getContext("2d");
6435
6512
  if (!r) throw Q(t), new Z("Filter surface canvas is unavailable");
6436
6513
  r.globalAlpha = n;
6437
6514
  try {
@@ -6489,7 +6566,7 @@ async function Wl(e, t, n, r, i) {
6489
6566
  }));
6490
6567
  let h = l.defaultView, g = h?.Image ? new h.Image() : new Image(), _;
6491
6568
  try {
6492
- g.src = `data:image/svg+xml,${encodeURIComponent(new XMLSerializer().serializeToString(d))}`, await Rl(g, i), q(i), _ = Ll(e);
6569
+ g.src = `data:image/svg+xml,${encodeURIComponent(new XMLSerializer().serializeToString(d))}`, await Wl(g, i), q(i), _ = Ul(e);
6493
6570
  let t = _.getContext("2d");
6494
6571
  if (!t) throw new Z("Filter surface canvas is unavailable");
6495
6572
  return t.globalAlpha = n, t.drawImage(g, 0, 0), _;
@@ -6499,31 +6576,31 @@ async function Wl(e, t, n, r, i) {
6499
6576
  g.removeAttribute("src");
6500
6577
  }
6501
6578
  }
6502
- function Gl(e, t, n) {
6579
+ function Zl(e, t, n) {
6503
6580
  let r = t * n * 4;
6504
6581
  return !Number.isFinite(r) || t <= 0 || n <= 0 || t > 8192 || n > 8192 || e.pixels + r > 16777216 ? 0 : (e.pixels += r, r);
6505
6582
  }
6506
- var Kl = (e, t) => e.add(-t, -t, t * 2, t * 2), ql = (e, t) => new p(Math.min(e.left, t.left), Math.min(e.top, t.top), Math.max(e.left + e.width, t.left + t.width) - Math.min(e.left, t.left), Math.max(e.top + e.height, t.top + t.height) - Math.min(e.top, t.top));
6507
- function Jl(e) {
6583
+ var Ql = (e, t) => e.add(-t, -t, t * 2, t * 2), $l = (e, t) => new p(Math.min(e.left, t.left), Math.min(e.top, t.top), Math.max(e.left + e.width, t.left + t.width) - Math.min(e.left, t.left), Math.max(e.top + e.height, t.top + t.height) - Math.min(e.top, t.top));
6584
+ function eu(e) {
6508
6585
  let t = e.styles, n = e.bounds;
6509
6586
  for (let r of t.boxShadow) if (!r.inset) {
6510
6587
  let t = Math.max(0, r.spread.number) + 3 * r.blur.number;
6511
- n = ql(n, Kl(e.bounds.add(r.offsetX.number, r.offsetY.number, 0, 0), t));
6588
+ n = $l(n, Ql(e.bounds.add(r.offsetX.number, r.offsetY.number, 0, 0), t));
6512
6589
  }
6513
6590
  for (let r of e.textNodes) for (let i of r.textBounds) {
6514
- let r = Kl(i.bounds, 2 * I(t.fontSize, e.bounds.height) + t.webkitTextStrokeWidth);
6515
- n = ql(n, r);
6516
- for (let e of t.textShadow) n = ql(n, Kl(r.add(e.offsetX.number, e.offsetY.number, 0, 0), 3 * e.blur.number));
6591
+ let r = Ql(i.bounds, 2 * I(t.fontSize, e.bounds.height) + t.webkitTextStrokeWidth);
6592
+ n = $l(n, r);
6593
+ for (let e of t.textShadow) n = $l(n, Ql(r.add(e.offsetX.number, e.offsetY.number, 0, 0), 3 * e.blur.number));
6517
6594
  }
6518
- for (let t of e.elements) t.styles.isVisible() && (n = ql(n, Jl(t)));
6519
- let r = Dl(t.filter);
6520
- return Kl(n, r ? Il(r) : 0);
6595
+ for (let t of e.elements) t.styles.isVisible() && (n = $l(n, eu(t)));
6596
+ let r = Nl(t.filter);
6597
+ return Ql(n, r ? Hl(r) : 0);
6521
6598
  }
6522
- function Yl(e, t, n, r) {
6523
- let i = Kl(t, n), a = Math.floor(Math.max(e.left, i.left) * r) / r, o = Math.floor(Math.max(e.top, i.top) * r) / r, s = Math.ceil(Math.min(e.left + e.width, i.left + i.width) * r) / r, c = Math.ceil(Math.min(e.top + e.height, i.top + i.height) * r) / r;
6599
+ function tu(e, t, n, r) {
6600
+ let i = Ql(t, n), a = Math.floor(Math.max(e.left, i.left) * r) / r, o = Math.floor(Math.max(e.top, i.top) * r) / r, s = Math.ceil(Math.min(e.left + e.width, i.left + i.width) * r) / r, c = Math.ceil(Math.min(e.top + e.height, i.top + i.height) * r) / r;
6524
6601
  return new p(a, o, Math.max(0, s - a), Math.max(0, c - o));
6525
6602
  }
6526
- var Xl = class {
6603
+ var nu = class {
6527
6604
  constructor(e) {
6528
6605
  r(this, "ctx", void 0), this.ctx = e;
6529
6606
  }
@@ -6588,15 +6665,15 @@ var Xl = class {
6588
6665
  }
6589
6666
  this.ctx.stroke(), this.ctx.restore();
6590
6667
  }
6591
- }, Zl = "Mg", Ql = (e) => e !== void 0 && !Number.isNaN(e), $l = (e, t) => {
6592
- let n = e.measureText(Zl), r = n;
6668
+ }, ru = "Mg", iu = (e) => e !== void 0 && !Number.isNaN(e), au = (e, t) => {
6669
+ let n = e.measureText(ru), r = n;
6593
6670
  return {
6594
- baseline: Ql(r.fontBoundingBoxAscent) ? r.fontBoundingBoxAscent : Ql(n.actualBoundingBoxAscent) ? n.actualBoundingBoxAscent : t,
6595
- height: Ql(r.fontBoundingBoxAscent) && Ql(r.fontBoundingBoxDescent) ? r.fontBoundingBoxAscent + r.fontBoundingBoxDescent : Ql(n.actualBoundingBoxAscent) && Ql(n.actualBoundingBoxDescent) ? n.actualBoundingBoxAscent + n.actualBoundingBoxDescent : t
6671
+ baseline: iu(r.fontBoundingBoxAscent) ? r.fontBoundingBoxAscent : iu(n.actualBoundingBoxAscent) ? n.actualBoundingBoxAscent : t,
6672
+ height: iu(r.fontBoundingBoxAscent) && iu(r.fontBoundingBoxDescent) ? r.fontBoundingBoxAscent + r.fontBoundingBoxDescent : iu(n.actualBoundingBoxAscent) && iu(n.actualBoundingBoxDescent) ? n.actualBoundingBoxAscent + n.actualBoundingBoxDescent : t
6596
6673
  };
6597
- }, eu = (e, t) => $l(e, t).baseline, tu = 1, nu = /[\u2E80-\u2FFF\u3000-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFFEF]/, ru = (e) => nu.test(e), iu = () => typeof navigator > "u" ? !1 : navigator.userAgentData !== void 0 || (typeof window < "u" ? window : void 0)?.chrome !== void 0, au = () => iu() ? "miter" : "round", ou = class {
6674
+ }, ou = (e, t) => au(e, t).baseline, su = 1, cu = /[\u2E80-\u2FFF\u3000-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\uF900-\uFAFF\uFF01-\uFFEF]/, lu = (e) => cu.test(e), uu = () => typeof navigator > "u" ? !1 : navigator.userAgentData !== void 0 || (typeof window < "u" ? window : void 0)?.chrome !== void 0, du = () => uu() ? "miter" : "round", fu = class {
6598
6675
  constructor(e) {
6599
- r(this, "ctx", void 0), r(this, "options", void 0), r(this, "decorationRenderer", void 0), r(this, "baselineCache", /* @__PURE__ */ new Map()), r(this, "glyphWidthCache", null), this.ctx = e.ctx, this.options = e.options, this.decorationRenderer = new Xl(e.ctx);
6676
+ r(this, "ctx", void 0), r(this, "options", void 0), r(this, "decorationRenderer", void 0), r(this, "baselineCache", /* @__PURE__ */ new Map()), r(this, "glyphWidthCache", null), this.ctx = e.ctx, this.options = e.options, this.decorationRenderer = new nu(e.ctx);
6600
6677
  }
6601
6678
  cachedMeasureText(e, t) {
6602
6679
  let n = this.glyphWidthCache;
@@ -6609,23 +6686,23 @@ var Xl = class {
6609
6686
  this.iterateVerticalGlyphs(e, t, n, r, i);
6610
6687
  return;
6611
6688
  }
6612
- let a = tc(e.text), o = e.bounds.top + n, s = this.ctx.font, c = e.bounds.left;
6689
+ let a = sc(e.text), o = e.bounds.top + n, s = this.ctx.font, c = e.bounds.left;
6613
6690
  for (let e of a) i(e, c, o), c += this.cachedMeasureText(e, s) + t;
6614
6691
  }
6615
6692
  iterateVerticalGlyphs(e, t, n, r, i) {
6616
- let a = tc(e.text), o = this.ctx.font, s = r === 4 ? -Math.PI / 2 : Math.PI / 2, c = e.bounds.top;
6693
+ let a = sc(e.text), o = this.ctx.font, s = r === 4 ? -Math.PI / 2 : Math.PI / 2, c = e.bounds.top;
6617
6694
  for (let l = 0; l < a.length;) {
6618
6695
  let u = a[l];
6619
- if (!(Ka(r) || !ru(u) && u.trim().length > 0)) {
6696
+ if (!(Ka(r) || !lu(u) && u.trim().length > 0)) {
6620
6697
  let r = this.ctx.textBaseline;
6621
- ru(u) && (this.ctx.textBaseline = "ideographic"), i(u, e.bounds.left, c + n), this.ctx.textBaseline = r, c += this.cachedMeasureText(u, o) + t, l++;
6698
+ lu(u) && (this.ctx.textBaseline = "ideographic"), i(u, e.bounds.left, c + n), this.ctx.textBaseline = r, c += this.cachedMeasureText(u, o) + t, l++;
6622
6699
  continue;
6623
6700
  }
6624
6701
  let d = l;
6625
6702
  for (; l < a.length;) {
6626
6703
  let e = a[l];
6627
- if (!Ka(r) && !ru(e) && e.trim().length === 0) break;
6628
- if (Ka(r) || !ru(e) && e.trim().length > 0) l++;
6704
+ if (!Ka(r) && !lu(e) && e.trim().length === 0) break;
6705
+ if (Ka(r) || !lu(e) && e.trim().length > 0) l++;
6629
6706
  else break;
6630
6707
  }
6631
6708
  this.ctx.save(), this.ctx.translate(e.bounds.left + n, c), this.ctx.rotate(s);
@@ -6654,7 +6731,7 @@ var Xl = class {
6654
6731
  });
6655
6732
  }
6656
6733
  renderTextStrokeWithStyle(e, t, n) {
6657
- t.webkitTextStrokeWidth && e.text.trim().length && (this.ctx.strokeStyle = z(t.webkitTextStrokeColor), this.ctx.lineWidth = t.webkitTextStrokeWidth, this.ctx.lineJoin = au(), this.renderStrokeText(e, t.letterSpacing, n, t.writingMode), this.ctx.strokeStyle = "", this.ctx.lineWidth = 0, this.ctx.lineJoin = "miter");
6734
+ t.webkitTextStrokeWidth && e.text.trim().length && (this.ctx.strokeStyle = z(t.webkitTextStrokeColor), this.ctx.lineWidth = t.webkitTextStrokeWidth, this.ctx.lineJoin = du(), this.renderStrokeText(e, t.letterSpacing, n, t.writingMode), this.ctx.strokeStyle = "", this.ctx.lineWidth = 0, this.ctx.lineJoin = "miter");
6658
6735
  }
6659
6736
  renderTextFillWithShadows(e, t, n) {
6660
6737
  this.ctx.fillStyle = this.resolveFillColor(t), this.renderTextWithLetterSpacing(e, t.letterSpacing, n, t.writingMode);
@@ -6677,7 +6754,7 @@ var Xl = class {
6677
6754
  this.decorationRenderer.render(e, t);
6678
6755
  }
6679
6756
  truncateTextWithEllipsis(e, t, n) {
6680
- let r = this.ctx.measureText("…").width, i = tc(e);
6757
+ let r = this.ctx.measureText("…").width, i = sc(e);
6681
6758
  if (n === 0) {
6682
6759
  let e = (e) => this.ctx.measureText(i.slice(0, e).join("")).width + r <= t, n = 0, a = i.length;
6683
6760
  for (; n < a;) {
@@ -6723,7 +6800,7 @@ var Xl = class {
6723
6800
  for (let e = 0; e < l - 1; e++) g(o, e).forEach((e) => this.renderTextBoundWithPaintOrder(e, t, n, r));
6724
6801
  let u = o[l - 1];
6725
6802
  if (u?.length && i) {
6726
- let e = u.map((e) => e.text).join(""), a = g(u, 0), o = i.width - (a.bounds.left - i.left), s = new Ys(this.truncateTextWithEllipsis(e, o, t.letterSpacing), a.bounds);
6803
+ let e = u.map((e) => e.text).join(""), a = g(u, 0), o = i.width - (a.bounds.left - i.left), s = new tc(this.truncateTextWithEllipsis(e, o, t.letterSpacing), a.bounds);
6727
6804
  for (let e of n) e === 0 ? (this.ctx.fillStyle = this.resolveFillColor(t), this.renderTextWithLetterSpacing(s, t.letterSpacing, r, t.writingMode)) : e === 1 && this.renderTextStrokeWithStyle(s, t, r);
6728
6805
  }
6729
6806
  return !0;
@@ -6732,14 +6809,14 @@ var Xl = class {
6732
6809
  let a = va(t.lineHeight, t.fontSize.number), o = g(e.textBounds, 0).bounds.top;
6733
6810
  if (!e.textBounds.every((e) => Math.abs(e.bounds.top - o) < a * .5)) return !1;
6734
6811
  let s = e.textBounds.map((e) => e.text).join("").replace(/\s+/g, " ").trim();
6735
- if (this.ctx.measureText(s).width <= i.width + tu) return !1;
6736
- let c = new Ys(this.truncateTextWithEllipsis(s, i.width, t.letterSpacing), g(e.textBounds, 0).bounds);
6812
+ if (this.ctx.measureText(s).width <= i.width + su) return !1;
6813
+ let c = new tc(this.truncateTextWithEllipsis(s, i.width, t.letterSpacing), g(e.textBounds, 0).bounds);
6737
6814
  for (let e of n) e === 0 ? this.renderTextFillWithShadows(c, t, r) : e === 1 && this.renderTextStrokeWithStyle(c, t, r);
6738
6815
  return !0;
6739
6816
  }
6740
6817
  measureBaselineCached(e, t) {
6741
6818
  let n = this.baselineCache.get(e);
6742
- return n === void 0 && (n = eu(this.ctx, t), this.baselineCache.size >= 64 && this.baselineCache.clear(), this.baselineCache.set(e, n)), n;
6819
+ return n === void 0 && (n = ou(this.ctx, t), this.baselineCache.size >= 64 && this.baselineCache.clear(), this.baselineCache.set(e, n)), n;
6743
6820
  }
6744
6821
  async renderTextNode(e, t, n) {
6745
6822
  this.glyphWidthCache = null;
@@ -6767,7 +6844,7 @@ var Xl = class {
6767
6844
  }, l = this.ctx.font;
6768
6845
  for (let r of e.textBounds) {
6769
6846
  let e = r.bounds.top + n, u = s.over ? e - i - a * .4 : e + a * .9, d = r.bounds.left;
6770
- for (let e of tc(r.text)) {
6847
+ for (let e of sc(r.text)) {
6771
6848
  let n = this.cachedMeasureText(e, l);
6772
6849
  this.ctx.save();
6773
6850
  try {
@@ -6779,14 +6856,14 @@ var Xl = class {
6779
6856
  }
6780
6857
  }
6781
6858
  }
6782
- }, su = (e, t) => {
6859
+ }, pu = (e, t) => {
6783
6860
  t.forEach((t, n) => {
6784
6861
  let r = Y(t) ? t.start : t;
6785
6862
  n === 0 ? e.moveTo(r.x, r.y) : e.lineTo(r.x, r.y), Y(t) && e.bezierCurveTo(t.startControl.x, t.startControl.y, t.endControl.x, t.endControl.y, t.end.x, t.end.y);
6786
6863
  });
6787
- }, cu = (e, t) => {
6788
- e.beginPath(), su(e, t), e.closePath();
6789
- }, lu = class {
6864
+ }, mu = (e, t) => {
6865
+ e.beginPath(), pu(e, t), e.closePath();
6866
+ }, hu = class {
6790
6867
  constructor(e) {
6791
6868
  r(this, "maxSize", void 0), r(this, "_map", void 0), this.maxSize = e, this._map = /* @__PURE__ */ new Map();
6792
6869
  }
@@ -6809,9 +6886,9 @@ var Xl = class {
6809
6886
  clear() {
6810
6887
  this._map.clear();
6811
6888
  }
6812
- }, uu = class {
6889
+ }, gu = class {
6813
6890
  constructor(e) {
6814
- r(this, "ctx", void 0), r(this, "context", void 0), r(this, "canvas", void 0), r(this, "patternCache", new lu(50)), this.ctx = e.ctx, this.context = e.context, this.canvas = e.canvas;
6891
+ r(this, "ctx", void 0), r(this, "context", void 0), r(this, "canvas", void 0), r(this, "patternCache", new hu(50)), this.ctx = e.ctx, this.context = e.context, this.canvas = e.canvas;
6815
6892
  }
6816
6893
  async renderBackgroundImage(e) {
6817
6894
  let t = e.styles.backgroundImage.length - 1, n = e.styles.backgroundBlendMode, r = 0;
@@ -6831,11 +6908,11 @@ var Xl = class {
6831
6908
  this.context.logger.error(`Error loading background-image ${i}`);
6832
6909
  }
6833
6910
  if (r) {
6834
- let t = isNaN(r.width) || r.width === 0 ? 1 : r.width, a = isNaN(r.height) || r.height === 0 ? 1 : r.height, [o, s, c, l, u] = _l(e, n, [
6911
+ let t = isNaN(r.width) || r.width === 0 ? 1 : r.width, a = isNaN(r.height) || r.height === 0 ? 1 : r.height, [o, s, c, l, u] = Cl(e, n, [
6835
6912
  t,
6836
6913
  a,
6837
6914
  t / a
6838
- ]), d = xl(e.styles.backgroundRepeat, n), f = d === 1 ? "no-repeat" : d === 2 ? "repeat-x" : d === 3 ? "repeat-y" : "repeat", p = `${i}|${Math.round(l)}x${Math.round(u)}|${e.styles.imageRendering}|${f}`, m = this.patternCache.get(p);
6915
+ ]), d = Dl(e.styles.backgroundRepeat, n), f = d === 1 ? "no-repeat" : d === 2 ? "repeat-x" : d === 3 ? "repeat-y" : "repeat", p = `${i}|${Math.round(l)}x${Math.round(u)}|${e.styles.imageRendering}|${f}`, m = this.patternCache.get(p);
6839
6916
  if (!m) {
6840
6917
  let t = this.resizeImage(r, l, u, e.styles.imageRendering);
6841
6918
  m = this.ctx.createPattern(t, f), this.patternCache.set(p, m);
@@ -6844,11 +6921,11 @@ var Xl = class {
6844
6921
  }
6845
6922
  }
6846
6923
  renderRepeatingLinearGradient(e, t, n) {
6847
- let [r, i, a, o, s] = _l(e, n, [
6924
+ let [r, i, a, o, s] = Cl(e, n, [
6848
6925
  null,
6849
6926
  null,
6850
6927
  null
6851
- ]), [c, l, u, d, f] = Xr(t.angle, o, s), p = i + l, m = i + u, h = a + d, _ = a + f, v = W(t.stops, c || 1), y = ul(v), b = this.ctx.createLinearGradient(p, h, m, _);
6928
+ ]), [c, l, u, d, f] = Xr(t.angle, o, s), p = i + l, m = i + u, h = a + d, _ = a + f, v = W(t.stops, c || 1), y = gl(v), b = this.ctx.createLinearGradient(p, h, m, _);
6852
6929
  if (y) y.forEach((e) => b.addColorStop(Math.min(1, Math.max(0, e.stop)), e.color));
6853
6930
  else {
6854
6931
  let e = z(g(v, v.length - 1).color);
@@ -6857,7 +6934,7 @@ var Xl = class {
6857
6934
  this.path(r), this.ctx.fillStyle = b, this.ctx.fill();
6858
6935
  }
6859
6936
  renderLinearGradient(e, t, n) {
6860
- let [r, i, a, o, s] = _l(e, n, [
6937
+ let [r, i, a, o, s] = Cl(e, n, [
6861
6938
  null,
6862
6939
  null,
6863
6940
  null
@@ -6873,7 +6950,7 @@ var Xl = class {
6873
6950
  m && this.renderRepeat(r, m, i, a);
6874
6951
  }
6875
6952
  renderRadialGradient(e, t, n) {
6876
- let [r, i, a, o, s] = _l(e, n, [
6953
+ let [r, i, a, o, s] = Cl(e, n, [
6877
6954
  null,
6878
6955
  null,
6879
6956
  null
@@ -6881,7 +6958,7 @@ var Xl = class {
6881
6958
  if ((d === 0 || f === 0) && (d = Math.max(d, .01), f = Math.max(f, .01)), d > 0 && f > 0) {
6882
6959
  let e = `rg|${Math.round(l)}x${Math.round(u)}|${Math.round(d)}x${Math.round(f)}|${JSON.stringify(t.stops)}`, n = W(t.stops, d), o = z(g(n, n.length - 1).color), s = this.patternCache.get(e);
6883
6960
  if (!s) {
6884
- let n = fl(this.canvas.ownerDocument ?? document, d, f, t.stops, !1);
6961
+ let n = vl(this.canvas.ownerDocument ?? document, d, f, t.stops, !1);
6885
6962
  if (!n) return;
6886
6963
  s = this.ctx.createPattern(n.canvas, "no-repeat"), this.patternCache.set(e, s);
6887
6964
  }
@@ -6889,7 +6966,7 @@ var Xl = class {
6889
6966
  }
6890
6967
  }
6891
6968
  renderRepeatingRadialGradient(e, t, n) {
6892
- let [r, i, a, o, s] = _l(e, n, [
6969
+ let [r, i, a, o, s] = Cl(e, n, [
6893
6970
  null,
6894
6971
  null,
6895
6972
  null
@@ -6897,14 +6974,14 @@ var Xl = class {
6897
6974
  if ((d === 0 || f === 0) && (d = Math.max(d, .01), f = Math.max(f, .01)), !(d > 0 && f > 0)) return;
6898
6975
  let p = `rrg|${Math.round(l)}x${Math.round(u)}|${Math.round(d)}x${Math.round(f)}|${JSON.stringify(t.stops)}`, m = this.patternCache.get(p);
6899
6976
  if (!m) {
6900
- let e = fl(this.canvas.ownerDocument ?? document, d, f, t.stops, !0);
6977
+ let e = vl(this.canvas.ownerDocument ?? document, d, f, t.stops, !0);
6901
6978
  if (!e) return;
6902
6979
  m = this.ctx.createPattern(e.canvas, "no-repeat"), this.patternCache.set(p, m);
6903
6980
  }
6904
6981
  m && (this.path(r), this.ctx.save(), this.ctx.clip(), this.ctx.translate(i + l - d, a + u - f), this.ctx.fillStyle = m, this.ctx.fillRect(0, 0, d * 2, f * 2), this.ctx.restore());
6905
6982
  }
6906
6983
  renderConicGradient(e, t, n) {
6907
- let [r, i, a, o, s] = _l(e, n, [
6984
+ let [r, i, a, o, s] = Cl(e, n, [
6908
6985
  null,
6909
6986
  null,
6910
6987
  null
@@ -6914,7 +6991,7 @@ var Xl = class {
6914
6991
  }), this.path(r), this.ctx.save(), this.ctx.clip(), this.ctx.fillStyle = d, this.ctx.fill(), this.ctx.restore();
6915
6992
  }
6916
6993
  renderRepeatingConicGradient(e, t, n) {
6917
- let [r, i, a, o, s] = _l(e, n, [
6994
+ let [r, i, a, o, s] = Cl(e, n, [
6918
6995
  null,
6919
6996
  null,
6920
6997
  null
@@ -6953,62 +7030,62 @@ var Xl = class {
6953
7030
  return a ? (r === 2 || r === 1 ? (this.context.logger.debug("Disabling image smoothing for background image due to CSS image-rendering"), a.imageSmoothingEnabled = !1) : r === 3 ? (this.context.logger.debug("Enabling image smoothing for background image due to CSS image-rendering: smooth"), a.imageSmoothingEnabled = !0) : a.imageSmoothingEnabled = this.ctx.imageSmoothingEnabled, this.ctx.imageSmoothingQuality && (a.imageSmoothingQuality = this.ctx.imageSmoothingQuality), a.drawImage(e, 0, 0, e.width, e.height, 0, 0, t, n), i) : e;
6954
7031
  }
6955
7032
  path(e) {
6956
- cu(this.ctx, e);
7033
+ mu(this.ctx, e);
6957
7034
  }
6958
- }, du = (e, t) => {
7035
+ }, _u = (e, t) => {
6959
7036
  switch (t) {
6960
7037
  case 0: return $(e.topLeftBorderBox, e.topLeftPaddingBox, e.topRightBorderBox, e.topRightPaddingBox);
6961
7038
  case 1: return $(e.topRightBorderBox, e.topRightPaddingBox, e.bottomRightBorderBox, e.bottomRightPaddingBox);
6962
7039
  case 2: return $(e.bottomRightBorderBox, e.bottomRightPaddingBox, e.bottomLeftBorderBox, e.bottomLeftPaddingBox);
6963
7040
  default: return $(e.bottomLeftBorderBox, e.bottomLeftPaddingBox, e.topLeftBorderBox, e.topLeftPaddingBox);
6964
7041
  }
6965
- }, fu = (e, t) => {
7042
+ }, vu = (e, t) => {
6966
7043
  switch (t) {
6967
7044
  case 0: return $(e.topLeftBorderBox, e.topLeftBorderDoubleOuterBox, e.topRightBorderBox, e.topRightBorderDoubleOuterBox);
6968
7045
  case 1: return $(e.topRightBorderBox, e.topRightBorderDoubleOuterBox, e.bottomRightBorderBox, e.bottomRightBorderDoubleOuterBox);
6969
7046
  case 2: return $(e.bottomRightBorderBox, e.bottomRightBorderDoubleOuterBox, e.bottomLeftBorderBox, e.bottomLeftBorderDoubleOuterBox);
6970
7047
  default: return $(e.bottomLeftBorderBox, e.bottomLeftBorderDoubleOuterBox, e.topLeftBorderBox, e.topLeftBorderDoubleOuterBox);
6971
7048
  }
6972
- }, pu = (e, t) => {
7049
+ }, yu = (e, t) => {
6973
7050
  switch (t) {
6974
7051
  case 0: return $(e.topLeftBorderDoubleInnerBox, e.topLeftPaddingBox, e.topRightBorderDoubleInnerBox, e.topRightPaddingBox);
6975
7052
  case 1: return $(e.topRightBorderDoubleInnerBox, e.topRightPaddingBox, e.bottomRightBorderDoubleInnerBox, e.bottomRightPaddingBox);
6976
7053
  case 2: return $(e.bottomRightBorderDoubleInnerBox, e.bottomRightPaddingBox, e.bottomLeftBorderDoubleInnerBox, e.bottomLeftPaddingBox);
6977
7054
  default: return $(e.bottomLeftBorderDoubleInnerBox, e.bottomLeftPaddingBox, e.topLeftBorderDoubleInnerBox, e.topLeftPaddingBox);
6978
7055
  }
6979
- }, mu = (e, t) => {
7056
+ }, bu = (e, t) => {
6980
7057
  switch (t) {
6981
- case 0: return hu(e.topLeftBorderStroke, e.topRightBorderStroke);
6982
- case 1: return hu(e.topRightBorderStroke, e.bottomRightBorderStroke);
6983
- case 2: return hu(e.bottomRightBorderStroke, e.bottomLeftBorderStroke);
6984
- default: return hu(e.bottomLeftBorderStroke, e.topLeftBorderStroke);
7058
+ case 0: return xu(e.topLeftBorderStroke, e.topRightBorderStroke);
7059
+ case 1: return xu(e.topRightBorderStroke, e.bottomRightBorderStroke);
7060
+ case 2: return xu(e.bottomRightBorderStroke, e.bottomLeftBorderStroke);
7061
+ default: return xu(e.bottomLeftBorderStroke, e.topLeftBorderStroke);
6985
7062
  }
6986
- }, hu = (e, t) => {
7063
+ }, xu = (e, t) => {
6987
7064
  let n = [];
6988
7065
  return Y(e) ? n.push(e.subdivide(.5, !1)) : n.push(e), Y(t) ? n.push(t.subdivide(.5, !0)) : n.push(t), n;
6989
7066
  }, $ = (e, t, n, r) => {
6990
7067
  let i = [];
6991
7068
  return Y(e) ? i.push(e.subdivide(.5, !1)) : i.push(e), Y(n) ? i.push(n.subdivide(.5, !0)) : i.push(n), Y(r) ? i.push(r.subdivide(.5, !0).reverse()) : i.push(r), Y(t) ? i.push(t.subdivide(.5, !1).reverse()) : i.push(t), i;
6992
- }, gu = class {
7069
+ }, Su = class {
6993
7070
  constructor(e, t) {
6994
7071
  r(this, "ctx", void 0), r(this, "pathCallbacks", void 0), this.ctx = e.ctx, this.pathCallbacks = t;
6995
7072
  }
6996
7073
  async renderSolidBorder(e, t, n) {
6997
- this.pathCallbacks.path(du(n, t)), this.ctx.fillStyle = z(e), this.ctx.fill();
7074
+ this.pathCallbacks.path(_u(n, t)), this.ctx.fillStyle = z(e), this.ctx.fill();
6998
7075
  }
6999
7076
  async renderDoubleBorder(e, t, n, r) {
7000
7077
  if (t < 3) {
7001
7078
  await this.renderSolidBorder(e, n, r);
7002
7079
  return;
7003
7080
  }
7004
- let i = fu(r, n);
7081
+ let i = vu(r, n);
7005
7082
  this.pathCallbacks.path(i), this.ctx.fillStyle = z(e), this.ctx.fill();
7006
- let a = pu(r, n);
7083
+ let a = yu(r, n);
7007
7084
  this.pathCallbacks.path(a), this.ctx.fill();
7008
7085
  }
7009
7086
  async renderDashedDottedBorder(e, t, n, r, i) {
7010
7087
  this.ctx.save();
7011
- let a = mu(r, n), o = du(r, n);
7088
+ let a = bu(r, n), o = _u(r, n);
7012
7089
  i === 2 && (this.pathCallbacks.path(o), this.ctx.clip());
7013
7090
  let s, c, l, u;
7014
7091
  Y(g(o, 0)) ? (s = g(o, 0).start.x, c = g(o, 0).start.y) : (s = g(o, 0).x, c = g(o, 0).y), Y(g(o, 1)) ? (l = g(o, 1).end.x, u = g(o, 1).end.y) : (l = g(o, 1).x, u = g(o, 1).y);
@@ -7037,7 +7114,7 @@ var Xl = class {
7037
7114
  }
7038
7115
  this.ctx.restore();
7039
7116
  }
7040
- }, _u = (e, t, n) => {
7117
+ }, Cu = (e, t, n) => {
7041
7118
  let r = e ? [
7042
7119
  e.top,
7043
7120
  e.right,
@@ -7053,7 +7130,7 @@ var Xl = class {
7053
7130
  let i = r ? r[e] : null, a = t[e] ?? 0;
7054
7131
  return !i || i.kind === "auto" ? a : i.kind === "number" ? a * (i.value ?? 1) : i.kind === "length" ? i.value ?? 0 : (i.value ?? 0) / 100 * (e === 0 || e === 2 ? n.height : n.width);
7055
7132
  });
7056
- }, vu = (e, t) => {
7133
+ }, wu = (e, t) => {
7057
7134
  let n = e ? [
7058
7135
  e.top,
7059
7136
  e.right,
@@ -7069,7 +7146,7 @@ var Xl = class {
7069
7146
  bottom: r(2),
7070
7147
  left: r(3)
7071
7148
  };
7072
- }, yu = class {
7149
+ }, Tu = class {
7073
7150
  constructor(e) {
7074
7151
  r(this, "ctx", void 0), this.ctx = e;
7075
7152
  }
@@ -7086,7 +7163,7 @@ var Xl = class {
7086
7163
  if (_ <= 0 || v <= 0) return;
7087
7164
  let y = Math.min(i, v), b = Math.min(a, _), x = Math.min(o, v - y), S = Math.min(s, _ - b);
7088
7165
  this.drawRegion(t, 0, 0, m, d, h, g, S, y), this.drawRegion(t, l - f, 0, f, d, h + _ - b, g, b, y), this.drawRegion(t, l - f, u - p, f, p, h + _ - b, g + v - x, b, x), this.drawRegion(t, 0, u - p, m, p, h, g + v - x, S, x);
7089
- let ee = [
7166
+ let C = [
7090
7167
  {
7091
7168
  sx: m,
7092
7169
  sy: 0,
@@ -7136,7 +7213,7 @@ var Xl = class {
7136
7213
  horizontal: !1
7137
7214
  }
7138
7215
  ];
7139
- for (let e of ee) e.sw <= 0 || e.sh <= 0 || e.dw <= 0 || e.dh <= 0 || (e.repeat === 0 ? this.ctx.drawImage(t, e.sx, e.sy, e.sw, e.sh, e.dx, e.dy, e.dw, e.dh) : (e.repeat === 1 || e.repeat === 2) && this.drawRepeatedEdge(t, e, e.horizontal, e.repeat === 2));
7216
+ for (let e of C) e.sw <= 0 || e.sh <= 0 || e.dw <= 0 || e.dh <= 0 || (e.repeat === 0 ? this.ctx.drawImage(t, e.sx, e.sy, e.sw, e.sh, e.dx, e.dy, e.dw, e.dh) : (e.repeat === 1 || e.repeat === 2) && this.drawRepeatedEdge(t, e, e.horizontal, e.repeat === 2));
7140
7217
  n.fill && this.drawCenterRegion(t, {
7141
7218
  sx: m,
7142
7219
  sy: d,
@@ -7186,21 +7263,21 @@ var Xl = class {
7186
7263
  for (let r = 0; r < o.count; r++) for (let i = 0; i < a.count; i++) this.ctx.drawImage(e, t.sx, t.sy, t.sw, t.sh, n.dx + i * a.size, n.dy + r * o.size, a.size, o.size);
7187
7264
  this.ctx.restore();
7188
7265
  }
7189
- }, bu = /blur\((\d+(?:\.\d+)?)px\)/gi, xu = (e, t) => t === 1 ? e : e.replace(bu, (e, n) => `blur(${parseFloat(n) * t}px)`), Su = class {
7266
+ }, Eu = /blur\((\d+(?:\.\d+)?)px\)/gi, Du = (e, t) => t === 1 ? e : e.replace(Eu, (e, n) => `blur(${parseFloat(n) * t}px)`), Ou = class {
7190
7267
  constructor(e, t) {
7191
7268
  r(this, "ctx", void 0), r(this, "pathCallback", void 0), r(this, "scale", void 0), r(this, "activeEffects", []), r(this, "didSave", !1), r(this, "saveAtDepth", -1), this.ctx = e.ctx, this.pathCallback = t, this.scale = e.scale ?? 1;
7192
7269
  }
7193
7270
  applyEffects(e) {
7194
7271
  for (; this.activeEffects.length;) this.popEffect();
7195
7272
  this.didSave = !1, this.saveAtDepth = -1;
7196
- let t = (e) => Yc(e) || Xc(e) || Qc(e), n = e.reduceRight((e, n, r) => e === -1 ? t(n) ? r : -1 : e, -1);
7273
+ let t = (e) => tl(e) || nl(e) || il(e), n = e.reduceRight((e, n, r) => e === -1 ? t(n) ? r : -1 : e, -1);
7197
7274
  for (let r = 0; r < e.length; r++) {
7198
7275
  let i = g(e, r);
7199
7276
  t(i) && (this.didSave || (this.ctx.save(), this.didSave = !0), r === n && (this.saveAtDepth = this.activeEffects.length)), this.applyEffect(i);
7200
7277
  }
7201
7278
  }
7202
7279
  applyEffect(e) {
7203
- Yc(e) ? (this.ctx.translate(e.offsetX, e.offsetY), this.ctx.transform(e.matrix[0], e.matrix[1], e.matrix[2], e.matrix[3], e.matrix[4], e.matrix[5]), this.ctx.translate(-e.offsetX, -e.offsetY)) : Xc(e) ? (this.pathCallback.path(e.path), this.ctx.clip()) : Qc(e) ? e.applyClip(this.ctx) : Zc(e) ? this.ctx.globalAlpha *= e.opacity : $c(e) ? this.ctx.globalCompositeOperation = e.compositeOperation : el(e) && (this.ctx.filter = xu(e.safeFilterString, this.scale) || "none", e.shadow && (this.ctx.shadowOffsetX = e.shadow.offsetX * this.scale, this.ctx.shadowOffsetY = e.shadow.offsetY * this.scale, this.ctx.shadowBlur = e.shadow.blur * this.scale, this.ctx.shadowColor = e.shadow.color)), this.activeEffects.push(e);
7280
+ tl(e) ? (this.ctx.translate(e.offsetX, e.offsetY), this.ctx.transform(e.matrix[0], e.matrix[1], e.matrix[2], e.matrix[3], e.matrix[4], e.matrix[5]), this.ctx.translate(-e.offsetX, -e.offsetY)) : nl(e) ? (this.pathCallback.path(e.path), this.ctx.clip()) : il(e) ? e.applyClip(this.ctx) : rl(e) ? this.ctx.globalAlpha *= e.opacity : al(e) ? this.ctx.globalCompositeOperation = e.compositeOperation : ol(e) && (this.ctx.filter = Du(e.safeFilterString, this.scale) || "none", e.shadow && (this.ctx.shadowOffsetX = e.shadow.offsetX * this.scale, this.ctx.shadowOffsetY = e.shadow.offsetY * this.scale, this.ctx.shadowBlur = e.shadow.blur * this.scale, this.ctx.shadowColor = e.shadow.color)), this.activeEffects.push(e);
7204
7281
  }
7205
7282
  popEffect() {
7206
7283
  this.activeEffects.length !== 0 && (this.didSave && this.activeEffects.length - 1 === this.saveAtDepth && (this.ctx.restore(), this.didSave = !1, this.saveAtDepth = -1), this.activeEffects.pop(), !this.didSave && this.activeEffects.length === 0 && (this.ctx.globalAlpha = 1, this.ctx.globalCompositeOperation = "source-over", this.ctx.filter = "none", this.ctx.shadowOffsetX = 0, this.ctx.shadowOffsetY = 0, this.ctx.shadowBlur = 0, this.ctx.shadowColor = "rgba(0, 0, 0, 0)"));
@@ -7211,7 +7288,7 @@ var Xl = class {
7211
7288
  hasActiveEffects() {
7212
7289
  return this.activeEffects.length > 0;
7213
7290
  }
7214
- }, Cu = (e, t) => e.length === 0 ? void 0 : e[t % e.length] ?? e[0], wu = (e, t, n, r) => {
7291
+ }, ku = (e, t) => e.length === 0 ? void 0 : e[t % e.length] ?? e[0], Au = (e, t, n, r) => {
7215
7292
  let i = e ? e[0] : void 0, a = e && e.length > 1 ? g(e, 1) : void 0, o = (e) => e !== void 0 && D(e) ? e.value : null, s = (e, t, n) => e === void 0 || D(e) ? null : M(e) ? I(e, t) : n, c = o(i);
7216
7293
  if (c === "contain" || c === "cover") {
7217
7294
  let e = c === "contain" ? Math.min(t.width / n, t.height / r) : Math.max(t.width / n, t.height / r);
@@ -7225,50 +7302,50 @@ var Xl = class {
7225
7302
  width: l,
7226
7303
  height: u
7227
7304
  };
7228
- }, Tu = (e, t, n, r, i) => {
7229
- let a = t.naturalWidth || t.width || i.width, o = t.naturalHeight || t.height || i.height, { width: s, height: c } = wu(Cu(n.maskSize, r), i, a, o), l = Cu(n.maskPosition, r) ?? [], u = i.left + I(g(l, 0), i.width - s), d = i.top + I(g(l, l.length - 1), i.height - c), f = Cu(n.maskRepeat, r) ?? 0, p = f === 0 || f === 2, m = f === 0 || f === 3, h = p ? Math.ceil((u - i.left) / s) : 0, _ = m ? Math.ceil((d - i.top) / c) : 0, v = p ? Math.ceil((i.left + i.width - u) / s) : 0, y = m ? Math.ceil((i.top + i.height - d) / c) : 0;
7305
+ }, ju = (e, t, n, r, i) => {
7306
+ let a = t.naturalWidth || t.width || i.width, o = t.naturalHeight || t.height || i.height, { width: s, height: c } = Au(ku(n.maskSize, r), i, a, o), l = ku(n.maskPosition, r) ?? [], u = i.left + I(g(l, 0), i.width - s), d = i.top + I(g(l, l.length - 1), i.height - c), f = ku(n.maskRepeat, r) ?? 0, p = f === 0 || f === 2, m = f === 0 || f === 3, h = p ? Math.ceil((u - i.left) / s) : 0, _ = m ? Math.ceil((d - i.top) / c) : 0, v = p ? Math.ceil((i.left + i.width - u) / s) : 0, y = m ? Math.ceil((i.top + i.height - d) / c) : 0;
7230
7307
  for (let n = -_; n <= y; n++) for (let r = -h; r <= v; r++) e.drawImage(t, u + r * s, d + n * c, s, c);
7231
- }, Eu = (e, t, n) => {
7308
+ }, Mu = (e, t, n) => {
7232
7309
  let { width: r, height: i } = n, a = t.position.length === 0 ? [P] : t.position, o = I(g(a, 0), r), s = I(g(a, a.length - 1), i), [c, l] = Qr(t, o, s, r, i);
7233
7310
  c = Math.max(c, .01), l = Math.max(l, .01);
7234
- let u = fl(e.canvas.ownerDocument ?? document, c, l, t.stops, xi(t));
7235
- u && (e.fillStyle = u.lastColor, e.fillRect(n.left, n.top, n.width, n.height), e.drawImage(u.canvas, n.left + o - c, n.top + s - l, c * 2, l * 2));
7236
- }, Du = (e, t, n) => {
7311
+ let u = vl(e.canvas.ownerDocument ?? document, c, l, t.stops, xi(t));
7312
+ u && (e.fillStyle = u.lastColor, e.fillRect(n.left, n.top, n.width, n.height), e.drawImage(u.canvas, n.left + o - c, n.top + s - l, c * 2, l * 2), Q(u.canvas));
7313
+ }, Nu = (e, t, n) => {
7237
7314
  let { width: r, height: i } = n;
7238
7315
  if (r <= 0 || i <= 0) return;
7239
7316
  if (yi(t) || xi(t)) {
7240
- Eu(e, t, n);
7317
+ Mu(e, t, n);
7241
7318
  return;
7242
7319
  }
7243
7320
  let a = null;
7244
7321
  if (t.type === 1 || t.type === 3) {
7245
7322
  let o = t, [s, c, l, u, d] = Xr(o.angle || 0, r, i), f = W(o.stops, s || 1);
7246
7323
  if (t.type === 3) {
7247
- let t = ul(f);
7324
+ let t = gl(f);
7248
7325
  if (!t) {
7249
7326
  e.fillStyle = z(g(f, f.length - 1).color), e.fillRect(n.left, n.top, r, i);
7250
7327
  return;
7251
7328
  }
7252
7329
  a = e.createLinearGradient(n.left + c, n.top + u, n.left + l, n.top + d), t.forEach((e) => a.addColorStop(Math.min(1, Math.max(0, e.stop)), e.color));
7253
- } else a = e.createLinearGradient(n.left + c, n.top + u, n.left + l, n.top + d), dl(f).forEach((e) => a.addColorStop(e.stop, e.color));
7330
+ } else a = e.createLinearGradient(n.left + c, n.top + u, n.left + l, n.top + d), _l(f).forEach((e) => a.addColorStop(e.stop, e.color));
7254
7331
  } else if (t.type === 5 || t.type === 6) {
7255
7332
  let o = t, s = W(o.stops, 1), c = t.type === 6;
7256
- if (c && !ul(s)) {
7333
+ if (c && !gl(s)) {
7257
7334
  e.fillStyle = z(g(s, s.length - 1).color), e.fillRect(n.left, n.top, r, i);
7258
7335
  return;
7259
7336
  }
7260
- a = e.createConicGradient(o.angle - Math.PI / 2, n.left + r / 2, n.top + i / 2), ((c ? ul(s) : null) ?? dl(s)).forEach((e) => a.addColorStop(Math.min(1, Math.max(0, e.stop)), e.color));
7337
+ a = e.createConicGradient(o.angle - Math.PI / 2, n.left + r / 2, n.top + i / 2), ((c ? gl(s) : null) ?? _l(s)).forEach((e) => a.addColorStop(Math.min(1, Math.max(0, e.stop)), e.color));
7261
7338
  }
7262
7339
  a && (e.fillStyle = a, e.fillRect(n.left, n.top, r, i));
7263
- }, Ou = async (e, t, n, r, i) => {
7340
+ }, Pu = async (e, t, n, r, i) => {
7264
7341
  for (let a = 0; a < t.length; a++) {
7265
7342
  let o = g(t, a);
7266
7343
  if (o.type === 0) {
7267
7344
  let t = await i(o.url);
7268
- t && Tu(e, t, n, a, r);
7269
- } else Du(e, o, r);
7345
+ t && ju(e, t, n, a, r);
7346
+ } else Nu(e, o, r);
7270
7347
  }
7271
- }, ku = (e, t, n, r, i) => {
7348
+ }, Fu = (e, t, n, r, i) => {
7272
7349
  let a = 0, o = 0, s = e, c = t, l = n.left, u = n.top, d = n.width, f = n.height, p = d / f, m = s / c, h = i ? I(i[0], 1) : .5, g = i ? I(i[1], 1) : .5;
7273
7350
  if (r === 2) m > p ? (f = d / m, u += (n.height - f) * g) : (d = f * m, l += (n.width - d) * h);
7274
7351
  else if (r === 4) m > p ? (s = c * p, a += (e - s) * h) : (c = s / p, o += (t - c) * g);
@@ -7288,19 +7365,19 @@ var Xl = class {
7288
7365
  dh: f
7289
7366
  };
7290
7367
  };
7291
- async function Au(e, t, n, r, i, a, o, s) {
7292
- if (i instanceof cc) try {
7368
+ async function Iu(e, t, n, r, i, a, o, s) {
7369
+ if (i instanceof mc) try {
7293
7370
  let n = await t.cache.match(i.src), r = e.imageSmoothingEnabled;
7294
7371
  o.imageRendering === 2 || o.imageRendering === 1 ? e.imageSmoothingEnabled = !1 : o.imageRendering === 3 && (e.imageSmoothingEnabled = !0), s(i, a, n), e.imageSmoothingEnabled = r;
7295
7372
  } catch {
7296
7373
  t.logger.error(`Error loading image ${i.src}`);
7297
7374
  }
7298
- if (i instanceof lc && s(i, a, i.canvas), i instanceof fc) try {
7375
+ if (i instanceof hc && s(i, a, i.canvas), i instanceof vc) try {
7299
7376
  s(i, a, await t.cache.match(i.svg));
7300
7377
  } catch {
7301
7378
  t.logger.error(`Error loading svg ${i.svg.substring(0, 255)}`);
7302
7379
  }
7303
- if (i instanceof Ec && i.tree) {
7380
+ if (i instanceof Mc && i.tree) {
7304
7381
  let a = await r(t, {
7305
7382
  scale: n.scale,
7306
7383
  backgroundColor: i.backgroundColor,
@@ -7312,8 +7389,8 @@ async function Au(e, t, n, r, i, a, o, s) {
7312
7389
  i.width && i.height && e.drawImage(a, 0, 0, i.width, i.height, i.bounds.left, i.bounds.top, i.bounds.width, i.bounds.height);
7313
7390
  }
7314
7391
  }
7315
- function ju(e, t, n, r, i) {
7316
- if (r instanceof Cc) {
7392
+ function Lu(e, t, n, r, i) {
7393
+ if (r instanceof kc) {
7317
7394
  let t = Math.min(r.bounds.width, r.bounds.height);
7318
7395
  r.type === "checkbox" && r.checked ? (e.save(), n([
7319
7396
  new J(r.bounds.left + t * .39363, r.bounds.top + t * .79),
@@ -7325,12 +7402,12 @@ function ju(e, t, n, r, i) {
7325
7402
  new J(r.bounds.left + t * .39363, r.bounds.top + t * .79)
7326
7403
  ]), e.fillStyle = z(r.styles.accentColor ?? 7733247), e.fill(), e.restore()) : r.type === "radio" && r.checked && (e.save(), e.beginPath(), e.arc(r.bounds.left + t / 2, r.bounds.top + t / 2, t / 4, 0, Math.PI * 2, !0), e.fillStyle = z(r.styles.accentColor ?? 7733247), e.fill(), e.restore());
7327
7404
  }
7328
- if (Fu(r) && r.value.length) {
7405
+ if (Vu(r) && r.value.length) {
7329
7406
  let [a] = t.createFontStyle(i);
7330
7407
  e.font = a ?? "";
7331
- let o = I(i.fontSize, 0), { baseline: s, height: c } = $l(e, o);
7332
- e.fillStyle = r instanceof Cc && r.isPlaceholder ? z(Sc) : z(i.color), e.textBaseline = "alphabetic", e.textAlign = Iu(r.styles.textAlign);
7333
- let l = ml(r), u = r instanceof Cc ? Mu(l, pl(r), c) : l, d = 0;
7408
+ let o = I(i.fontSize, 0), { baseline: s, height: c } = au(e, o);
7409
+ e.fillStyle = r instanceof kc && r.isPlaceholder ? z(Oc) : z(i.color), e.textBaseline = "alphabetic", e.textAlign = Hu(r.styles.textAlign);
7410
+ let l = bl(r), u = r instanceof kc ? Ru(l, yl(r), c) : l, d = 0;
7334
7411
  switch (r.styles.textAlign) {
7335
7412
  case 1:
7336
7413
  d += l.width / 2;
@@ -7338,7 +7415,7 @@ function ju(e, t, n, r, i) {
7338
7415
  case 2: d += l.width;
7339
7416
  }
7340
7417
  let f = 0;
7341
- r instanceof Cc && (f = (l.height - c) / 2);
7418
+ r instanceof kc && (f = (l.height - c) / 2);
7342
7419
  let m = l.add(d, f, 0, 0);
7343
7420
  e.save(), n([
7344
7421
  new J(u.left, u.top),
@@ -7346,7 +7423,7 @@ function ju(e, t, n, r, i) {
7346
7423
  new J(u.left + u.width, u.top + u.height),
7347
7424
  new J(u.left, u.top + u.height)
7348
7425
  ]), e.clip();
7349
- let h = Nu(e, r.value, l.width, i.whiteSpace === "pre" || i.whiteSpace === "nowrap"), g = va(i.lineHeight, o);
7426
+ let h = zu(e, r.value, l.width, i.whiteSpace === "pre" || i.whiteSpace === "nowrap"), g = va(i.lineHeight, o);
7350
7427
  h.forEach((n, r) => {
7351
7428
  let a = m.left, o = e.measureText(n).width;
7352
7429
  switch (i.textAlign) {
@@ -7356,11 +7433,11 @@ function ju(e, t, n, r, i) {
7356
7433
  case 2: a += l.width - o;
7357
7434
  }
7358
7435
  let c = new p(a, m.top + r * g, 0, 0);
7359
- t.renderTextWithLetterSpacing(new Ys(n, c), i.letterSpacing, s, i.writingMode);
7436
+ t.renderTextWithLetterSpacing(new tc(n, c), i.letterSpacing, s, i.writingMode);
7360
7437
  }), e.restore(), e.textBaseline = "alphabetic", e.textAlign = "left";
7361
7438
  }
7362
7439
  }
7363
- var Mu = (e, t, n) => e.height < n ? new p(e.left, t.top, e.width, t.height) : e, Nu = (e, t, n, r) => {
7440
+ var Ru = (e, t, n) => e.height < n ? new p(e.left, t.top, e.width, t.height) : e, zu = (e, t, n, r) => {
7364
7441
  let i = [], a = t.split("\n");
7365
7442
  for (let t of a) {
7366
7443
  if (r) {
@@ -7376,7 +7453,7 @@ var Mu = (e, t, n) => e.height < n ? new p(e.left, t.top, e.width, t.height) : e
7376
7453
  }
7377
7454
  return i;
7378
7455
  };
7379
- async function Pu(e, t, n, r, i, a) {
7456
+ async function Bu(e, t, n, r, i, a) {
7380
7457
  if (H(i.styles.display, 2048)) {
7381
7458
  if (i.styles.listStyleImage !== null) {
7382
7459
  let n = i.styles.listStyleImage;
@@ -7400,21 +7477,21 @@ async function Pu(e, t, n, r, i, a) {
7400
7477
  let [t] = n.createFontStyle(a);
7401
7478
  e.font = t ?? "", e.fillStyle = z(a.color), e.textBaseline = "middle", e.textAlign = "right";
7402
7479
  let o = new p(i.bounds.left, i.bounds.top + I(i.styles.paddingTop, i.bounds.width), i.bounds.width, va(a.lineHeight, a.fontSize.number) / 2 + 1);
7403
- n.renderTextWithLetterSpacing(new Ys(r.listValue, o), a.letterSpacing, va(a.lineHeight, a.fontSize.number) / 2 + 2, a.writingMode), e.textBaseline = "bottom", e.textAlign = "left";
7480
+ n.renderTextWithLetterSpacing(new tc(r.listValue, o), a.letterSpacing, va(a.lineHeight, a.fontSize.number) / 2 + 2, a.writingMode), e.textBaseline = "bottom", e.textAlign = "left";
7404
7481
  }
7405
7482
  }
7406
7483
  }
7407
7484
  }
7408
- var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type !== "radio" && e.type !== "checkbox", Iu = (e) => {
7485
+ var Vu = (e) => e instanceof jc || e instanceof Ac || e instanceof kc && e.type !== "radio" && e.type !== "checkbox", Hu = (e) => {
7409
7486
  switch (e) {
7410
7487
  case 1: return "center";
7411
7488
  case 2: return "right";
7412
7489
  default: return "left";
7413
7490
  }
7414
- }, Lu = (e, t) => {
7491
+ }, Uu = (e, t) => {
7415
7492
  let n = t > e ? t * (1 + (e / t - 1) ** 3) : t;
7416
7493
  return Math.max(0, e + n);
7417
- }, Ru = (e, t) => {
7494
+ }, Wu = (e, t) => {
7418
7495
  if (t === 0) return e;
7419
7496
  let n = e.map((e, t) => Y(e) ? {
7420
7497
  x: t % 2 == 0 ? e.start.x : e.end.x,
@@ -7429,8 +7506,8 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7429
7506
  }), r = g(n, 1).x - g(n, 0).x + 2 * t, i = g(n, 3).y - g(n, 0).y + 2 * t;
7430
7507
  if (r <= 0 || i <= 0) return [];
7431
7508
  let a = n.map((e) => ({
7432
- x: Lu(e.rx, t),
7433
- y: Lu(e.ry, t)
7509
+ x: Uu(e.rx, t),
7510
+ y: Uu(e.ry, t)
7434
7511
  })), o = (e, t) => t > 0 ? e / t : 1, s = Math.min(1, o(r, g(a, 0).x + g(a, 1).x), o(r, g(a, 3).x + g(a, 2).x), o(i, g(a, 0).y + g(a, 3).y), o(i, g(a, 1).y + g(a, 2).y));
7435
7512
  return e.map((e, r) => {
7436
7513
  let i = g(n, r), o = i.x + (r === 1 || r === 2 ? t : -t), c = i.y + (r >= 2 ? t : -t);
@@ -7438,9 +7515,9 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7438
7515
  let l = g(a, r).x * s, u = g(a, r).y * s;
7439
7516
  if (!l || !u) return new J(o, c);
7440
7517
  let d = l / i.rx, f = u / i.ry, p = (e) => new J(o + (e.x - i.x) * d, c + (e.y - i.y) * f);
7441
- return new Lc(p(e.start), p(e.startControl), p(e.endControl), p(e.end));
7518
+ return new Uc(p(e.start), p(e.startControl), p(e.endControl), p(e.end));
7442
7519
  });
7443
- }, zu = (e, t, n) => {
7520
+ }, Gu = (e, t, n) => {
7444
7521
  let { a: r, b: i, c: a, d: o, e: s, f: c } = e;
7445
7522
  if (![
7446
7523
  r,
@@ -7473,15 +7550,15 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7473
7550
  scale: b,
7474
7551
  uniform: Math.abs(_ - v) <= x && Math.abs(y) <= x
7475
7552
  };
7476
- }, Bu = (e, t, n) => {
7477
- e.beginPath(), e.rect(t.left, t.top, t.width, t.height), n.length && (su(e, n), e.closePath());
7478
- }, Vu = (e, t) => {
7479
- let n = t.spread.number, r = pl(e.container);
7480
- return r.width - 2 * n <= 0 || r.height - 2 * n <= 0 ? [] : Ru(Vc(e.curves), -n);
7481
- }, Hu = async (e, t, n, r, i, a) => {
7482
- let o = pl(t.container), s = n.blur.number / 2, c = Math.ceil(3 * s) + 2, l = n.spread.number, u = Yl((n.inset ? o : t.container.bounds.add(n.offsetX.number - l, n.offsetY.number - l, 2 * l, 2 * l)).add(-c, -c, 2 * c, 2 * c), a.viewport, c, a.scale);
7553
+ }, Ku = (e, t, n) => {
7554
+ e.beginPath(), e.rect(t.left, t.top, t.width, t.height), n.length && (pu(e, n), e.closePath());
7555
+ }, qu = (e, t) => {
7556
+ let n = t.spread.number, r = yl(e.container);
7557
+ return r.width - 2 * n <= 0 || r.height - 2 * n <= 0 ? [] : Wu(qc(e.curves), -n);
7558
+ }, Ju = async (e, t, n, r, i, a) => {
7559
+ let o = yl(t.container), s = n.blur.number / 2, c = Math.ceil(3 * s) + 2, l = n.spread.number, u = tu((n.inset ? o : t.container.bounds.add(n.offsetX.number - l, n.offsetY.number - l, 2 * l, 2 * l)).add(-c, -c, 2 * c, 2 * c), a.viewport, c, a.scale);
7483
7560
  if (!u.width || !u.height) return !0;
7484
- let d = Math.ceil(u.width * a.scale), f = Math.ceil(u.height * a.scale), p = Gl(i, d, f);
7561
+ let d = Math.ceil(u.width * a.scale), f = Math.ceil(u.height * a.scale), p = Zl(i, d, f);
7485
7562
  if (!p) return !1;
7486
7563
  let m, h;
7487
7564
  try {
@@ -7489,13 +7566,13 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7489
7566
  let i = m.getContext("2d");
7490
7567
  if (!i) return !1;
7491
7568
  i.scale(a.scale, a.scale), i.translate(-u.left, -u.top);
7492
- let o = Fc(n.inset ? Vu(t, n) : Ru(zc(t.curves), l), n.offsetX.number, n.offsetY.number, 0, 0);
7493
- n.inset ? Bu(i, u, o) : cu(i, o), i.fillStyle = z(n.color), i.fill(n.inset ? "evenodd" : "nonzero"), h = await Ul(m, { functions: [{
7569
+ let o = Vc(n.inset ? qu(t, n) : Wu(Gc(t.curves), l), n.offsetX.number, n.offsetY.number, 0, 0);
7570
+ n.inset ? Ku(i, u, o) : mu(i, o), i.fillStyle = z(n.color), i.fill(n.inset ? "evenodd" : "nonzero"), h = await Yl(m, { functions: [{
7494
7571
  kind: "blur",
7495
7572
  value: s
7496
7573
  }] }, 1, a.scale, r.signal), e.save();
7497
7574
  try {
7498
- n.inset ? (cu(e, Vc(t.curves)), e.clip()) : (Bu(e, a.viewport, zc(t.curves)), e.clip("evenodd")), e.drawImage(h, u.left, u.top, h.width / a.scale, h.height / a.scale);
7575
+ n.inset ? (mu(e, qc(t.curves)), e.clip()) : (Ku(e, a.viewport, Gc(t.curves)), e.clip("evenodd")), e.drawImage(h, u.left, u.top, h.width / a.scale, h.height / a.scale);
7499
7576
  } finally {
7500
7577
  e.restore();
7501
7578
  }
@@ -7506,7 +7583,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7506
7583
  } finally {
7507
7584
  h && h !== m && Q(h), m && Q(m), i.pixels -= p;
7508
7585
  }
7509
- }, Uu = async (e, t, n, r, i) => {
7586
+ }, Yu = async (e, t, n, r, i) => {
7510
7587
  if (r.signal?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
7511
7588
  if (R(n.color)) return;
7512
7589
  let a = n.spread.number;
@@ -7518,23 +7595,23 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7518
7595
  d: r.scale,
7519
7596
  e: -r.x * r.scale,
7520
7597
  f: -r.y * r.scale
7521
- }, c = zu(s, e.canvas.width, e.canvas.height);
7598
+ }, c = Gu(s, e.canvas.width, e.canvas.height);
7522
7599
  if (!c) return;
7523
7600
  let { viewport: l } = c;
7524
- if (n.blur.number > 0 && (n.inset || !c.uniform) && await Hu(e, t, n, r, i, c)) return;
7525
- let u = pl(t.container);
7601
+ if (n.blur.number > 0 && (n.inset || !c.uniform) && await Ju(e, t, n, r, i, c)) return;
7602
+ let u = yl(t.container);
7526
7603
  e.save();
7527
7604
  try {
7528
7605
  if (n.inset && n.blur.number === 0) {
7529
- cu(e, Vc(t.curves)), e.clip(), Bu(e, u, Fc(Vu(t, n), n.offsetX.number, n.offsetY.number, 0, 0)), e.fillStyle = z(n.color), e.fill("evenodd");
7606
+ mu(e, qc(t.curves)), e.clip(), Ku(e, u, Vc(qu(t, n), n.offsetX.number, n.offsetY.number, 0, 0)), e.fillStyle = z(n.color), e.fill("evenodd");
7530
7607
  return;
7531
7608
  }
7532
7609
  let r = Math.ceil(n.blur.number * 2 + Math.abs(a) + Math.abs(n.offsetX.number) + Math.abs(n.offsetY.number)) + 2, i = n.inset ? u.add(-r, -r, 2 * r, 2 * r) : t.container.bounds.add(-a, -a, 2 * a, 2 * a), { a: d, b: f, c: p, d: m, e: h, f: g } = s, _ = i.left + i.width, v = i.top + i.height, y = Math.max(d * i.left + p * i.top + h, d * _ + p * i.top + h, d * _ + p * v + h, d * i.left + p * v + h), b = Math.max($o, y + r * c.scale + 2);
7533
- n.inset ? (cu(e, Vc(t.curves)), e.clip()) : (Bu(e, l, zc(t.curves)), e.clip("evenodd")), o ? e.setTransform(d, f, p, m, h - b, g) : e.translate(-b / d, 0), n.inset ? Bu(e, i, Vu(t, n)) : cu(e, Ru(zc(t.curves), a)), o ? e.setTransform(d, f, p, m, h, g) : e.translate(b / d, 0), e.shadowOffsetX = b + d * n.offsetX.number + p * n.offsetY.number, e.shadowOffsetY = f * n.offsetX.number + m * n.offsetY.number, e.shadowBlur = n.blur.number * c.scale, e.shadowColor = z(n.color), e.fillStyle = "rgb(0, 0, 0)", e.fill(n.inset ? "evenodd" : "nonzero");
7610
+ n.inset ? (mu(e, qc(t.curves)), e.clip()) : (Ku(e, l, Gc(t.curves)), e.clip("evenodd")), o ? e.setTransform(d, f, p, m, h - b, g) : e.translate(-b / d, 0), n.inset ? Ku(e, i, qu(t, n)) : mu(e, Wu(Gc(t.curves), a)), o ? e.setTransform(d, f, p, m, h, g) : e.translate(b / d, 0), e.shadowOffsetX = b + d * n.offsetX.number + p * n.offsetY.number, e.shadowOffsetY = f * n.offsetX.number + m * n.offsetY.number, e.shadowBlur = n.blur.number * c.scale, e.shadowColor = z(n.color), e.fillStyle = "rgb(0, 0, 0)", e.fill(n.inset ? "evenodd" : "nonzero");
7534
7611
  } finally {
7535
7612
  e.restore();
7536
7613
  }
7537
- }, Wu = class {
7614
+ }, Xu = class {
7538
7615
  constructor(e) {
7539
7616
  r(this, "ctx", void 0), r(this, "context", void 0), r(this, "scale", void 0), r(this, "createFontStyle", void 0), this.ctx = e.ctx, this.context = e.context, this.scale = e.scale, this.createFontStyle = e.createFontStyle;
7540
7617
  }
@@ -7548,7 +7625,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7548
7625
  u.ctx.scale(i, i);
7549
7626
  let [m] = this.createFontStyle(n);
7550
7627
  u.ctx.font = m ?? "", u.ctx.textBaseline = "alphabetic", u.ctx.textAlign = "left", u.ctx.direction = n.direction === 1 ? "rtl" : "ltr";
7551
- let h = eu(u.ctx, n.fontSize.number), g = new uu({
7628
+ let h = ou(u.ctx, n.fontSize.number), g = new gu({
7552
7629
  ctx: u.ctx,
7553
7630
  context: this.context,
7554
7631
  canvas: u.canvas,
@@ -7567,7 +7644,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7567
7644
  };
7568
7645
  if (d = this.createGlyphLayer(a, c, l, u.ctx), !d) return;
7569
7646
  let v = !!n.webkitTextStrokeWidth;
7570
- v && (d.ctx.strokeStyle = z(n.webkitTextStrokeColor), d.ctx.lineWidth = n.webkitTextStrokeWidth, d.ctx.lineJoin = au());
7647
+ v && (d.ctx.strokeStyle = z(n.webkitTextStrokeColor), d.ctx.lineWidth = n.webkitTextStrokeWidth, d.ctx.lineJoin = du());
7571
7648
  for (let e of t.textNodes) for (let t of e.textBounds) this.drawGlyphs(d, t, _, (e, t, n, r) => {
7572
7649
  e.fillText(t, n, r), v && e.strokeText(t, n, r);
7573
7650
  });
@@ -7600,7 +7677,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7600
7677
  return;
7601
7678
  }
7602
7679
  let c = i;
7603
- for (let n of tc(t.text)) r(e.ctx, n, c, a), c += e.ctx.measureText(n).width + o;
7680
+ for (let n of sc(t.text)) r(e.ctx, n, c, a), c += e.ctx.measureText(n).width + o;
7604
7681
  }
7605
7682
  renderShadowSilhouettes(e, t, n, r, i, a, o) {
7606
7683
  let s = a.textShadow;
@@ -7618,12 +7695,12 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7618
7695
  }
7619
7696
  return c.length ? c : null;
7620
7697
  }
7621
- }, Gu = class e {
7698
+ }, Zu = class e {
7622
7699
  constructor(e, t, n, i = { pixels: 0 }) {
7623
7700
  r(this, "surfaceRoot", void 0), r(this, "surfaceBudget", void 0), r(this, "canvas", void 0), r(this, "ctx", void 0), r(this, "context", void 0), r(this, "options", void 0), r(this, "backgroundRenderer", void 0), r(this, "borderRenderer", void 0), r(this, "borderImageRenderer", void 0), r(this, "effectsRenderer", void 0), r(this, "textRenderer", void 0), r(this, "textClipRenderer", void 0), r(this, "legacySubtree", !1), this.surfaceRoot = n, this.surfaceBudget = i, this.context = e, this.options = t, this.canvas = t.canvas ? t.canvas : e.resourceDocument.createElement("canvas");
7624
7701
  let a = this.canvas.getContext("2d");
7625
7702
  if (!a) throw t.canvas || Q(this.canvas), n ? new Z("Filter surface canvas is unavailable") : Error("Failed to get 2D rendering context from canvas");
7626
- this.ctx = a, t.canvas || (this.canvas.width = Math.floor(t.width * t.scale), this.canvas.height = Math.floor(t.height * t.scale), this.canvas.style.width = `${t.width}px`, this.canvas.style.height = `${t.height}px`), this.ctx.scale(this.options.scale, this.options.scale), this.ctx.translate(-t.x, -t.y), this.ctx.textBaseline = "bottom", t.imageSmoothing !== void 0 && (this.ctx.imageSmoothingEnabled = t.imageSmoothing), t.imageSmoothingQuality && (this.ctx.imageSmoothingQuality = t.imageSmoothingQuality), this.backgroundRenderer = new uu({
7703
+ this.ctx = a, t.canvas || (this.canvas.width = Math.floor(t.width * t.scale), this.canvas.height = Math.floor(t.height * t.scale), this.canvas.style.width = `${t.width}px`, this.canvas.style.height = `${t.height}px`), this.ctx.scale(this.options.scale, this.options.scale), this.ctx.translate(-t.x, -t.y), this.ctx.textBaseline = "bottom", t.imageSmoothing !== void 0 && (this.ctx.imageSmoothingEnabled = t.imageSmoothing), t.imageSmoothingQuality && (this.ctx.imageSmoothingQuality = t.imageSmoothingQuality), this.backgroundRenderer = new gu({
7627
7704
  ctx: this.ctx,
7628
7705
  context: this.context,
7629
7706
  canvas: this.canvas,
@@ -7632,16 +7709,16 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7632
7709
  height: t.height,
7633
7710
  scale: t.scale
7634
7711
  }
7635
- }), this.borderRenderer = new gu({ ctx: this.ctx }, {
7712
+ }), this.borderRenderer = new Su({ ctx: this.ctx }, {
7636
7713
  path: (e) => this.path(e),
7637
7714
  formatPath: (e) => this.formatPath(e)
7638
- }), this.borderImageRenderer = new yu(this.ctx), this.effectsRenderer = new Su({
7715
+ }), this.borderImageRenderer = new Tu(this.ctx), this.effectsRenderer = new Ou({
7639
7716
  ctx: this.ctx,
7640
7717
  scale: t.scale
7641
- }, { path: (e) => this.path(e) }), this.textRenderer = new ou({
7718
+ }, { path: (e) => this.path(e) }), this.textRenderer = new fu({
7642
7719
  ctx: this.ctx,
7643
7720
  options: { scale: t.scale }
7644
- }), this.textClipRenderer = new Wu({
7721
+ }), this.textClipRenderer = new Xu({
7645
7722
  ctx: this.ctx,
7646
7723
  context: this.context,
7647
7724
  scale: t.scale,
@@ -7651,7 +7728,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7651
7728
  async renderStack(e) {
7652
7729
  let t = e.element.container.styles;
7653
7730
  if (t.isVisible()) {
7654
- let n = Dl(t.filter), r = n !== null && n.functions.length > 0, i = t.maskImage.length > 0, a = t.webkitBoxReflect, o = t.mixBlendMode !== K.NORMAL;
7731
+ let n = Nl(t.filter), r = n !== null && n.functions.length > 0, i = t.maskImage.length > 0, a = t.webkitBoxReflect, o = t.mixBlendMode !== K.NORMAL;
7655
7732
  if (e.element !== this.surfaceRoot && !this.legacySubtree && (i || a || o || n !== null && (r || t.opacity < 1)) && this.canComposite(e.element)) {
7656
7733
  if (!await this.renderCompositedStack(e, n, i, a, o)) {
7657
7734
  this.legacySubtree = !0;
@@ -7669,7 +7746,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7669
7746
  canComposite(e) {
7670
7747
  let t = (e) => {
7671
7748
  let t = e.styles;
7672
- return !t.isTransformed() && t.zoom === 1 && t.clipPath.type === 0 && !H(t.display, 2048) && Dl(t.filter) !== null;
7749
+ return !t.isTransformed() && t.zoom === 1 && t.clipPath.type === 0 && !H(t.display, 2048) && Nl(t.filter) !== null;
7673
7750
  }, n = (e) => t(e) && e.elements.every(n), r = e.parent;
7674
7751
  for (; r && r !== this.surfaceRoot;) {
7675
7752
  if (!t(r.container)) return !1;
@@ -7680,9 +7757,9 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7680
7757
  async renderCompositedStack(t, n, r, i, a = !1) {
7681
7758
  let o = this.options.signal;
7682
7759
  if (o?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
7683
- let s = Yl(Jl(t.element.container), new p(this.options.x, this.options.y, this.options.width, this.options.height), n ? Il(n) : 0, this.options.scale);
7760
+ let s = tu(eu(t.element.container), new p(this.options.x, this.options.y, this.options.width, this.options.height), n ? Hl(n) : 0, this.options.scale);
7684
7761
  if (!s.width || !s.height) return !0;
7685
- let c = Gl(this.surfaceBudget, Math.ceil(s.width * this.options.scale), Math.ceil(s.height * this.options.scale));
7762
+ let c = Zl(this.surfaceBudget, Math.ceil(s.width * this.options.scale), Math.ceil(s.height * this.options.scale));
7686
7763
  if (!c) return this.context.logger.info("Filter surface budget exceeded; using the existing renderer"), !1;
7687
7764
  let l = {
7688
7765
  ...this.options,
@@ -7694,10 +7771,10 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7694
7771
  height: s.height
7695
7772
  }, u, d;
7696
7773
  try {
7697
- u = new e(this.context, l, t.element, this.surfaceBudget), await u.renderStackContent(t), u.effectsRenderer.applyEffects([]), n && (d = await Ul(u.canvas, n, t.element.container.styles.opacity, l.scale, o));
7774
+ u = new e(this.context, l, t.element, this.surfaceBudget), await u.renderStackContent(t), u.effectsRenderer.applyEffects([]), n && (d = await Yl(u.canvas, n, t.element.container.styles.opacity, l.scale, o));
7698
7775
  let c = d ?? u.canvas;
7699
7776
  if (r && await this.applyMask(c, t.element.container.styles, s), o?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
7700
- let f = t.element.effects, p = t.element.getEffects(4, this.surfaceRoot).filter((e) => !f.includes(e) || !el(e) && !Zc(e) && !$c(e) && !Xc(e));
7777
+ let f = t.element.effects, p = t.element.getEffects(4, this.surfaceRoot).filter((e) => !f.includes(e) || !ol(e) && !rl(e) && !al(e) && !nl(e));
7701
7778
  return this.effectsRenderer.applyEffects(p), a ? (this.ctx.save(), this.ctx.globalCompositeOperation = t.element.container.styles.mixBlendMode, this.ctx.drawImage(c, l.x, l.y, c.width / l.scale, c.height / l.scale), this.ctx.restore()) : this.ctx.drawImage(c, l.x, l.y, c.width / l.scale, c.height / l.scale), i && await this.drawReflection(c, t.element.container.bounds, s, i), !0;
7702
7779
  } catch (e) {
7703
7780
  if (!(e instanceof Z)) throw e;
@@ -7712,31 +7789,32 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7712
7789
  let i = this.context.resourceDocument.createElement("canvas");
7713
7790
  i.width = e.width, i.height = e.height;
7714
7791
  let a = i.getContext("2d");
7715
- if (a) {
7792
+ if (!a) Q(i);
7793
+ else {
7716
7794
  a.scale(this.options.scale, this.options.scale), a.translate(-n.left, -n.top);
7717
7795
  try {
7718
- await Ou(a, t.maskImage, t, {
7796
+ await Pu(a, t.maskImage, t, {
7719
7797
  left: n.left,
7720
7798
  top: n.top,
7721
7799
  width: n.width,
7722
7800
  height: n.height
7723
7801
  }, async (e) => await this.context.cache.match(e));
7724
7802
  } catch (e) {
7725
- this.context.logger.error(`Error rendering mask-image: ${e instanceof Error ? e.message : e}`);
7803
+ this.context.logger.error(`Error rendering mask-image: ${e instanceof Error ? e.message : e}`), Q(i);
7726
7804
  return;
7727
7805
  }
7728
7806
  r.save();
7729
7807
  try {
7730
7808
  r.setTransform(1, 0, 0, 1, 0, 0), r.globalCompositeOperation = "destination-in", r.drawImage(i, 0, 0);
7731
7809
  } finally {
7732
- r.restore();
7810
+ r.restore(), Q(i);
7733
7811
  }
7734
7812
  }
7735
7813
  }
7736
7814
  async drawReflection(e, t, n, r) {
7737
7815
  let i = this.options.scale, a = Math.ceil(t.width * i), o = Math.ceil(t.height * i);
7738
7816
  if (a <= 0 || o <= 0) return;
7739
- let s = Gl(this.surfaceBudget, a, o);
7817
+ let s = Zl(this.surfaceBudget, a, o);
7740
7818
  if (!s) return;
7741
7819
  let c, l;
7742
7820
  try {
@@ -7754,7 +7832,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7754
7832
  l = this.context.resourceDocument.createElement("canvas"), l.width = a, l.height = o;
7755
7833
  let e = l.getContext("2d");
7756
7834
  if (e) {
7757
- e.scale(i, i), await Ou(e, [r.mask], {
7835
+ e.scale(i, i), await Pu(e, [r.mask], {
7758
7836
  maskPosition: [],
7759
7837
  maskRepeat: [],
7760
7838
  maskSize: []
@@ -7783,33 +7861,32 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7783
7861
  }
7784
7862
  }
7785
7863
  async renderNode(e) {
7786
- if (e.container.debugRender) debugger;
7787
- e.container.styles.isVisible() && (await this.renderNodeBackgroundAndBorders(e), await this.renderNodeContent(e));
7864
+ e.container.debugRender, e.container.styles.isVisible() && (await this.renderNodeBackgroundAndBorders(e), await this.renderNodeContent(e));
7788
7865
  }
7789
7866
  renderReplacedElement(e, t, n) {
7790
7867
  let r = n.naturalWidth || e.intrinsicWidth, i = n.naturalHeight || e.intrinsicHeight;
7791
7868
  if (n && r > 0 && i > 0) {
7792
- let a = ml(e), o = Vc(t);
7869
+ let a = bl(e), o = qc(t);
7793
7870
  this.path(o), this.ctx.save(), this.ctx.clip();
7794
- let { sx: s, sy: c, sw: l, sh: u, dx: d, dy: f, dw: p, dh: m } = ku(r, i, a, e.styles.objectFit, e.styles.objectPosition);
7871
+ let { sx: s, sy: c, sw: l, sh: u, dx: d, dy: f, dw: p, dh: m } = Fu(r, i, a, e.styles.objectFit, e.styles.objectPosition);
7795
7872
  this.ctx.drawImage(n, s, c, l, u, d, f, p, m), this.ctx.restore();
7796
7873
  }
7797
7874
  }
7798
7875
  async renderNodeContent(t) {
7799
7876
  this.effectsRenderer.applyEffects(t.getEffects(4, this.surfaceRoot));
7800
- let n = t.container, r = t.curves, i = n.styles, a = ml(n);
7877
+ let n = t.container, r = t.curves, i = n.styles, a = bl(n);
7801
7878
  for (let e of n.textNodes) await this.textRenderer.renderTextNode(e, i, a);
7802
- await Au(this.ctx, this.context, {
7879
+ await Iu(this.ctx, this.context, {
7803
7880
  scale: this.options.scale,
7804
7881
  backgroundColor: this.options.backgroundColor,
7805
7882
  x: this.options.x,
7806
7883
  y: this.options.y,
7807
7884
  width: this.options.width,
7808
7885
  height: this.options.height
7809
- }, (t, n) => new e(t, n), n, r, i, (e, t, n) => this.renderReplacedElement(e, t, n)), ju(this.ctx, this.textRenderer, this.path.bind(this), n, i), await Pu(this.ctx, this.context, this.textRenderer, t, n, i);
7886
+ }, (t, n) => new e(t, n), n, r, i, (e, t, n) => this.renderReplacedElement(e, t, n)), Lu(this.ctx, this.textRenderer, this.path.bind(this), n, i), await Bu(this.ctx, this.context, this.textRenderer, t, n, i);
7810
7887
  }
7811
7888
  async renderStackContent(e) {
7812
- if (e.element.container.debugRender) debugger;
7889
+ e.element.container.debugRender;
7813
7890
  let t = this.options.signal;
7814
7891
  await this.renderNodeBackgroundAndBorders(e.element);
7815
7892
  for (let n of e.negativeZIndex) {
@@ -7838,29 +7915,29 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7838
7915
  }
7839
7916
  }
7840
7917
  path(e) {
7841
- cu(this.ctx, e);
7918
+ mu(this.ctx, e);
7842
7919
  }
7843
7920
  formatPath(e) {
7844
- su(this.ctx, e);
7921
+ pu(this.ctx, e);
7845
7922
  }
7846
7923
  async renderSurfaceBoxShadow(e, t) {
7847
7924
  let n = t.spread.number, r = t.blur.number / 2, i = Math.ceil(3 * r) + 1, a = e.container.bounds.add(-n, -n, 2 * n, 2 * n);
7848
7925
  if (a.width <= 0 || a.height <= 0) return;
7849
- let o = this.options.scale, s = Yl(a.add(-i, -i, 2 * i, 2 * i), new p(this.options.x - t.offsetX.number, this.options.y - t.offsetY.number, this.options.width, this.options.height), i, o);
7926
+ let o = this.options.scale, s = tu(a.add(-i, -i, 2 * i, 2 * i), new p(this.options.x - t.offsetX.number, this.options.y - t.offsetY.number, this.options.width, this.options.height), i, o);
7850
7927
  if (!s.width || !s.height) return;
7851
- let c = Math.ceil(s.width * o), l = Math.ceil(s.height * o), u = Gl(this.surfaceBudget, c, l);
7928
+ let c = Math.ceil(s.width * o), l = Math.ceil(s.height * o), u = Zl(this.surfaceBudget, c, l);
7852
7929
  if (!u) throw new Z("Box shadow surface budget exceeded");
7853
7930
  let d, f;
7854
7931
  try {
7855
7932
  d = this.context.resourceDocument.createElement("canvas"), d.width = c, d.height = l;
7856
7933
  let i = d.getContext("2d");
7857
7934
  if (!i) throw new Z("Box shadow surface canvas is unavailable");
7858
- i.scale(o, o), i.translate(-s.left, -s.top), cu(i, Fc(zc(e.curves), -n, -n, 2 * n, 2 * n)), i.fillStyle = z(t.color), i.fill(), f = await Ul(d, { functions: [{
7935
+ i.scale(o, o), i.translate(-s.left, -s.top), mu(i, Vc(Gc(e.curves), -n, -n, 2 * n, 2 * n)), i.fillStyle = z(t.color), i.fill(), f = await Yl(d, { functions: [{
7859
7936
  kind: "blur",
7860
7937
  value: r
7861
7938
  }] }, 1, o, this.options.signal), this.ctx.save();
7862
7939
  try {
7863
- this.ctx.beginPath(), this.ctx.rect(this.options.x, this.options.y, this.options.width, this.options.height), su(this.ctx, zc(e.curves)), this.ctx.closePath(), this.ctx.clip("evenodd"), this.ctx.drawImage(f, s.left + t.offsetX.number, s.top + t.offsetY.number, f.width / o, f.height / o);
7940
+ this.ctx.beginPath(), this.ctx.rect(this.options.x, this.options.y, this.options.width, this.options.height), pu(this.ctx, Gc(e.curves)), this.ctx.closePath(), this.ctx.clip("evenodd"), this.ctx.drawImage(f, s.left + t.offsetX.number, s.top + t.offsetY.number, f.width / o, f.height / o);
7864
7941
  } finally {
7865
7942
  this.ctx.restore();
7866
7943
  }
@@ -7870,7 +7947,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7870
7947
  }
7871
7948
  async renderNodeBackgroundAndBorders(e) {
7872
7949
  this.effectsRenderer.applyEffects(e.getEffects(2, this.surfaceRoot)), !this.surfaceRoot && e.container.styles.backdropFilter && await this.renderBackdropFilter(e);
7873
- let t = e.container.styles, n = !R(t.backgroundColor) || t.backgroundImage.length, r = qu(t), i = [
7950
+ let t = e.container.styles, n = !R(t.backgroundColor) || t.backgroundImage.length, r = $u(t), i = [
7874
7951
  {
7875
7952
  style: t.borderTopStyle,
7876
7953
  color: t.borderTopColor,
@@ -7891,10 +7968,10 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7891
7968
  color: t.borderLeftColor,
7892
7969
  width: t.borderLeftWidth
7893
7970
  }
7894
- ], a = Ku(xl(t.backgroundClip, 0), e.curves);
7971
+ ], a = Qu(Dl(t.backgroundClip, 0), e.curves);
7895
7972
  if (n || t.boxShadow.length) {
7896
7973
  r && e.container.textNodes.length > 0 ? await this.textClipRenderer.render(e) : (this.ctx.save(), this.path(a), this.ctx.clip(), R(t.backgroundColor) || (this.ctx.fillStyle = z(t.backgroundColor), this.ctx.fill()), await this.backgroundRenderer.renderBackgroundImage(e.container), this.ctx.restore());
7897
- for (let n of t.boxShadow.slice(0).reverse()) this.surfaceRoot && !n.inset ? await this.renderSurfaceBoxShadow(e, n) : await Uu(this.ctx, e, n, this.options, this.surfaceBudget);
7974
+ for (let n of t.boxShadow.slice(0).reverse()) this.surfaceRoot && !n.inset ? await this.renderSurfaceBoxShadow(e, n) : await Yu(this.ctx, e, n, this.options, this.surfaceBudget);
7898
7975
  }
7899
7976
  if (t.borderImageSource) {
7900
7977
  let n = t.borderImageSource, r = e.container.bounds, i = [
@@ -7912,7 +7989,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7912
7989
  }
7913
7990
  } else a = this.rasterizeGradientSource(n, r);
7914
7991
  if (a) {
7915
- let e = vu(t.borderImageOutset, i), n = r.add(-e.left, -e.top, e.left + e.right, e.top + e.bottom), o = _u(t.borderImageWidth, i, n);
7992
+ let e = wu(t.borderImageOutset, i), n = r.add(-e.left, -e.top, e.left + e.right, e.top + e.bottom), o = Cu(t.borderImageWidth, i, n);
7916
7993
  this.borderImageRenderer.renderBorderImage(r, a, t.borderImageSlice, t.borderImageRepeat, o[0], o[1], o[2], o[3], e);
7917
7994
  }
7918
7995
  return;
@@ -7941,7 +8018,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7941
8018
  if (n <= 0) return;
7942
8019
  let r = t.outlineColor ?? t.color;
7943
8020
  if (R(r)) return;
7944
- let i = Math.max(0, t.outlineOffset) + n / 2, a = Fc(zc(e.curves), -i, -i, 2 * i, 2 * i);
8021
+ let i = Math.max(0, t.outlineOffset) + n / 2, a = Vc(Gc(e.curves), -i, -i, 2 * i, 2 * i);
7945
8022
  this.ctx.save();
7946
8023
  try {
7947
8024
  this.ctx.strokeStyle = z(r), this.ctx.lineWidth = n, t.outlineStyle === 3 ? this.ctx.setLineDash([n * 3, n * 3]) : t.outlineStyle === 4 && this.ctx.setLineDash([n, n * 2]), this.path(a), this.ctx.stroke();
@@ -7955,14 +8032,14 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7955
8032
  let a = i.getContext("2d");
7956
8033
  if (!a) return null;
7957
8034
  if (e.type === 1 || e.type === 3) {
7958
- let t = e, [o, s, c, l, u] = Xr(t.angle, n, r), d = W(t.stops, o || n), f = e.type === 3, p = f ? ul(d) : null, m = a.createLinearGradient(s, c, l, u);
8035
+ let t = e, [o, s, c, l, u] = Xr(t.angle, n, r), d = W(t.stops, o || n), f = e.type === 3, p = f ? gl(d) : null, m = a.createLinearGradient(s, c, l, u);
7959
8036
  if (p) p.forEach((e) => {
7960
8037
  m.addColorStop(Math.min(1, Math.max(0, e.stop)), e.color);
7961
8038
  });
7962
8039
  else if (f) {
7963
8040
  let e = z(g(d, d.length - 1).color);
7964
8041
  m.addColorStop(0, e), m.addColorStop(1, e);
7965
- } else dl(d).forEach((e) => {
8042
+ } else _l(d).forEach((e) => {
7966
8043
  m.addColorStop(e.stop, e.color);
7967
8044
  });
7968
8045
  return a.fillStyle = m, a.fillRect(0, 0, n, r), i;
@@ -7970,8 +8047,8 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
7970
8047
  if (e.type === 2 || e.type === 4) {
7971
8048
  let t = e, o = t.position.length === 0 ? [P] : t.position, s = I(g(o, 0), n), c = I(g(o, o.length - 1), r), [l, u] = Qr(t, s, c, n, r);
7972
8049
  if (l <= 0 || u <= 0) return null;
7973
- let d = fl(this.ctx.canvas.ownerDocument ?? document, l, u, t.stops, e.type === 4);
7974
- return d ? (a.fillStyle = d.lastColor, a.fillRect(0, 0, n, r), a.drawImage(d.canvas, s - l, c - u, l * 2, u * 2), i) : null;
8050
+ let d = vl(this.ctx.canvas.ownerDocument ?? document, l, u, t.stops, e.type === 4);
8051
+ return d ? (a.fillStyle = d.lastColor, a.fillRect(0, 0, n, r), a.drawImage(d.canvas, s - l, c - u, l * 2, u * 2), Q(d.canvas), i) : null;
7975
8052
  }
7976
8053
  if (e.type === 5 || e.type === 6) {
7977
8054
  let t = e, o = I(g(t.position, 0), n), s = I(g(t.position, 1), r), c = a.createConicGradient(t.angle - Math.PI / 2, o, s), l;
@@ -8003,13 +8080,13 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8003
8080
  return this.context.logger.warn("Unsupported border-image source; only URL and gradient images are supported"), null;
8004
8081
  }
8005
8082
  async renderBackdropFilter(e) {
8006
- let t = Dl(e.container.styles.backdropFilter);
8083
+ let t = Nl(e.container.styles.backdropFilter);
8007
8084
  if (!t || t.functions.length === 0) return;
8008
8085
  let n = e.container.bounds;
8009
8086
  if (n.width <= 0 || n.height <= 0) return;
8010
8087
  let r = this.options.scale, i = Math.ceil(n.width * r), a = Math.ceil(n.height * r);
8011
8088
  if (i <= 0 || a <= 0) return;
8012
- let o = Gl(this.surfaceBudget, i, a);
8089
+ let o = Zl(this.surfaceBudget, i, a);
8013
8090
  if (!o) return;
8014
8091
  let s, c;
8015
8092
  try {
@@ -8019,7 +8096,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8019
8096
  let o = Math.round((n.left - this.options.x) * r), l = Math.round((n.top - this.options.y) * r);
8020
8097
  e.drawImage(this.canvas, o, l, i, a, 0, 0, i, a);
8021
8098
  try {
8022
- c = await Ul(s, t, 1, r, this.options.signal);
8099
+ c = await Yl(s, t, 1, r, this.options.signal);
8023
8100
  } catch (e) {
8024
8101
  if (e instanceof Z) {
8025
8102
  this.context.logger.info(`${e.message}; rendering without the backdrop effect`);
@@ -8041,19 +8118,19 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8041
8118
  async render(e) {
8042
8119
  try {
8043
8120
  this.options.backgroundColor && (this.ctx.fillStyle = z(this.options.backgroundColor), this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height));
8044
- let t = cl(e);
8121
+ let t = ml(e);
8045
8122
  return await this.renderStack(t), this.effectsRenderer.applyEffects([]), this.canvas;
8046
8123
  } catch (e) {
8047
8124
  throw this.options.canvas || Q(this.canvas), e;
8048
8125
  }
8049
8126
  }
8050
- }, Ku = (e, t) => {
8127
+ }, Qu = (e, t) => {
8051
8128
  switch (e) {
8052
- case 0: return zc(t);
8053
- case 2: return Bc(t);
8054
- default: return Vc(t);
8129
+ case 0: return Gc(t);
8130
+ case 2: return Kc(t);
8131
+ default: return qc(t);
8055
8132
  }
8056
- }, qu = (e) => e.backgroundClip.some((e) => e === 3), Ju = class {
8133
+ }, $u = (e) => e.backgroundClip.some((e) => e === 3), ed = class {
8057
8134
  constructor(e, t) {
8058
8135
  r(this, "canvas", void 0), r(this, "ctx", void 0), r(this, "options", void 0), r(this, "context", void 0), this.context = e, this.options = t, this.canvas = t.canvas ? t.canvas : e.resourceDocument.createElement("canvas");
8059
8136
  let n = this.canvas.getContext("2d");
@@ -8062,13 +8139,17 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8062
8139
  }
8063
8140
  async render(e) {
8064
8141
  if (this.options.signal?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
8065
- let t = Xu(e), n = qs(Ks(this.options.width, this.options.height, 0, 0, e));
8142
+ let t = nd(e), n = $s(Qs(this.options.width, this.options.height, 0, 0, e));
8066
8143
  t();
8067
- let r = await n;
8068
- if (this.options.signal?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
8069
- return this.options.backgroundColor && (this.ctx.fillStyle = z(this.options.backgroundColor), this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height)), this.ctx.drawImage(r, this.options.x, this.options.y, this.options.width, this.options.height), this.canvas;
8144
+ try {
8145
+ let e = await n;
8146
+ if (this.options.signal?.aborted) throw new DOMException("The operation was aborted.", "AbortError");
8147
+ return this.options.backgroundColor && (this.ctx.fillStyle = z(this.options.backgroundColor), this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height)), this.ctx.drawImage(e, this.options.x, this.options.y, this.options.width, this.options.height), this.canvas;
8148
+ } catch (e) {
8149
+ throw this.options.canvas || Q(this.canvas), e;
8150
+ }
8070
8151
  }
8071
- }, Yu = [
8152
+ }, td = [
8072
8153
  "marginTop",
8073
8154
  "marginRight",
8074
8155
  "marginBottom",
@@ -8077,13 +8158,13 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8077
8158
  "right",
8078
8159
  "bottom",
8079
8160
  "left"
8080
- ], Xu = (e) => {
8081
- let t = e.style, n = Yu.map((e) => [e, t[e]]);
8082
- for (let e of Yu) t[e] = e.startsWith("margin") ? "0px" : "auto";
8161
+ ], nd = (e) => {
8162
+ let t = e.style, n = td.map((e) => [e, t[e]]);
8163
+ for (let e of td) t[e] = e.startsWith("margin") ? "0px" : "auto";
8083
8164
  return () => {
8084
8165
  for (let [e, r] of n) t[e] = r;
8085
8166
  };
8086
- }, Zu = class {
8167
+ }, rd = class {
8087
8168
  constructor({ id: e, enabled: t }) {
8088
8169
  r(this, "id", void 0), r(this, "enabled", void 0), r(this, "start", void 0), this.id = e, this.enabled = t, this.start = Date.now();
8089
8170
  }
@@ -8102,7 +8183,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8102
8183
  error(...e) {
8103
8184
  this.enabled && (typeof window < "u" && window.console && typeof console.error == "function" ? console.error(this.id, `${this.getTime()}ms`, ...e) : this.info(...e));
8104
8185
  }
8105
- }, Qu = class {
8186
+ }, id = class {
8106
8187
  get _evictionEnabled() {
8107
8188
  return this._evictionSuspendCount === 0;
8108
8189
  }
@@ -8138,14 +8219,14 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8138
8219
  }
8139
8220
  }
8140
8221
  addImage(e) {
8141
- if (this._deferMode) return !this.has(e) && (ad(e) || nd(e)) && this._collectedUrls.add(e), Promise.resolve();
8222
+ if (this._deferMode) return !this.has(e) && (dd(e) || cd(e)) && this._collectedUrls.add(e), Promise.resolve();
8142
8223
  let t = this._pendingOperations.get(e);
8143
8224
  if (t) return t;
8144
8225
  if (this.has(e)) {
8145
8226
  let t = this._cache.get(e);
8146
8227
  return this._cache.delete(e), this._cache.set(e, t), Promise.resolve();
8147
8228
  }
8148
- return ad(e) || nd(e) ? this._addImageWithPending(e) : Promise.resolve();
8229
+ return dd(e) || cd(e) ? this._addImageWithPending(e) : Promise.resolve();
8149
8230
  }
8150
8231
  _addImageWithPending(e) {
8151
8232
  let t = this._pendingOperations.get(e);
@@ -8193,14 +8274,14 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8193
8274
  this._cache.clear();
8194
8275
  }
8195
8276
  async loadImage(e) {
8196
- let t = this.context.originChecker, n = (e) => t.isSameOrigin(e), r = typeof this._options.customIsSameOrigin == "function" ? await this._options.customIsSameOrigin(e, n) : n(e), i = !r && this._options.allowTaint === !1 && !rd(e) && !ad(e) && typeof this._options.proxy != "string", a = !rd(e) && (this._options.useCORS === !0 || i) && Js.SUPPORT_CORS_IMAGES && !r, o = !rd(e) && !r && !ad(e) && typeof this._options.proxy == "string" && !a;
8197
- if (!r && this._options.allowTaint === !1 && !rd(e) && !ad(e) && !o && !a) return;
8277
+ let t = this.context.originChecker, n = (e) => t.isSameOrigin(e), r = typeof this._options.customIsSameOrigin == "function" ? await this._options.customIsSameOrigin(e, n) : n(e), i = !r && this._options.allowTaint === !1 && !ld(e) && !dd(e) && typeof this._options.proxy != "string", a = !ld(e) && (this._options.useCORS === !0 || i) && ec.SUPPORT_CORS_IMAGES && !r, o = !ld(e) && !r && !dd(e) && typeof this._options.proxy == "string" && !a;
8278
+ if (!r && this._options.allowTaint === !1 && !ld(e) && !dd(e) && !o && !a) return;
8198
8279
  let s = e;
8199
8280
  o && (s = await this.proxy(s)), this.context.logger.debug(`Added image ${e.substring(0, 256)}`);
8200
8281
  let c = this.context.config.window.Image ?? Image;
8201
8282
  return await new Promise((e, t) => {
8202
8283
  let n = new c();
8203
- n.onload = () => e(n), n.onerror = t, (id(s) || a) && (n.crossOrigin = "anonymous"), n.src = s, n.complete === !0 && (typeof n.decode == "function" ? n.decode().then(() => e(n), () => t(/* @__PURE__ */ Error(`Failed to decode image ${s.substring(0, 256)}`))) : setTimeout(() => e(n), 500));
8284
+ n.onload = () => e(n), n.onerror = t, (ud(s) || a) && (n.crossOrigin = "anonymous"), n.src = s, n.complete === !0 && (typeof n.decode == "function" ? n.decode().then(() => e(n), () => t(/* @__PURE__ */ Error(`Failed to decode image ${s.substring(0, 256)}`))) : setTimeout(() => e(n), 500));
8204
8285
  });
8205
8286
  }
8206
8287
  has(e) {
@@ -8229,7 +8310,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8229
8310
  a.send();
8230
8311
  });
8231
8312
  }
8232
- }, $u = /^data:image\/svg\+xml/i, ed = /^data:image\/.*;base64,/i, td = /^data:image\/.*/i, nd = (e) => Js.SUPPORT_SVG_DRAWING || !od(e), rd = (e) => td.test(e), id = (e) => ed.test(e), ad = (e) => e.substring(0, 4) === "blob", od = (e) => e.slice(-3).toLowerCase() === "svg" || $u.test(e), sd = class {
8313
+ }, ad = /^data:image\/svg\+xml/i, od = /^data:image\/.*;base64,/i, sd = /^data:image\/.*/i, cd = (e) => ec.SUPPORT_SVG_DRAWING || !fd(e), ld = (e) => sd.test(e), ud = (e) => od.test(e), dd = (e) => e.substring(0, 4) === "blob", fd = (e) => e.slice(-3).toLowerCase() === "svg" || ad.test(e), pd = class {
8233
8314
  constructor(e) {
8234
8315
  if (r(this, "baseUri", void 0), r(this, "origin", void 0), !e || !e.document) throw Error("Valid window object required for OriginChecker");
8235
8316
  if (!e.location || !e.location.href) throw Error("Window object must have valid location");
@@ -8248,12 +8329,12 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8248
8329
  getContextOrigin() {
8249
8330
  return this.origin;
8250
8331
  }
8251
- }, cd = (o = class e {
8332
+ }, md = (o = class e {
8252
8333
  constructor(t, n, i) {
8253
- r(this, "instanceName", `#${e.instanceCount++}`), r(this, "logger", void 0), r(this, "cache", void 0), r(this, "originChecker", void 0), r(this, "config", void 0), r(this, "onError", void 0), r(this, "_windowBounds", void 0), this.config = i, this.logger = new Zu({
8334
+ r(this, "instanceName", `#${e.instanceCount++}`), r(this, "logger", void 0), r(this, "cache", void 0), r(this, "originChecker", void 0), r(this, "config", void 0), r(this, "onError", void 0), r(this, "_windowBounds", void 0), this.config = i, this.logger = new rd({
8254
8335
  id: this.instanceName,
8255
8336
  enabled: t.logging
8256
- }), this.originChecker = new sd(i.window), this.cache = t.cache ?? i.cache ?? new Qu(this, t), this.onError = t.onError, this._windowBounds = n;
8337
+ }), this.originChecker = new pd(i.window), this.cache = t.cache ?? i.cache ?? new id(this, t), this.onError = t.onError, this._windowBounds = n;
8257
8338
  }
8258
8339
  get windowBounds() {
8259
8340
  return this._windowBounds;
@@ -8264,7 +8345,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8264
8345
  adjustWindowBounds(e, t) {
8265
8346
  this._windowBounds = this._windowBounds.add(e, t, 0, 0);
8266
8347
  }
8267
- }, r(o, "instanceCount", 1), o), ld = (e) => {
8348
+ }, r(o, "instanceCount", 1), o), hd = (e) => {
8268
8349
  [
8269
8350
  "scale",
8270
8351
  "width",
@@ -8283,26 +8364,26 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8283
8364
  Number.isNaN(r) || (e[t] = r);
8284
8365
  }
8285
8366
  });
8286
- }, ud = (e) => ({
8367
+ }, gd = (e) => ({
8287
8368
  allowTaint: e.allowTaint ?? !1,
8288
8369
  imageTimeout: e.imageTimeout ?? 15e3,
8289
8370
  proxy: e.proxy,
8290
8371
  useCORS: e.useCORS ?? !1,
8291
8372
  customIsSameOrigin: e.customIsSameOrigin,
8292
8373
  maxCacheSize: e.maxCacheSize
8293
- }), dd = (e, t, n) => ({
8374
+ }), _d = (e, t, n) => ({
8294
8375
  logging: e.logging ?? !0,
8295
8376
  cache: e.cache ?? t.cache,
8296
8377
  ...n
8297
- }), fd = 800, pd = 600, md = 0, hd = (e, t) => {
8378
+ }), vd = 800, yd = 600, bd = 0, xd = (e, t) => {
8298
8379
  let n = t;
8299
8380
  return {
8300
- windowWidth: e.windowWidth ?? n.innerWidth ?? fd,
8301
- windowHeight: e.windowHeight ?? n.innerHeight ?? pd,
8302
- scrollX: e.scrollX ?? n.pageXOffset ?? md,
8303
- scrollY: e.scrollY ?? n.pageYOffset ?? md
8381
+ windowWidth: e.windowWidth ?? n.innerWidth ?? vd,
8382
+ windowHeight: e.windowHeight ?? n.innerHeight ?? yd,
8383
+ scrollX: e.scrollX ?? n.pageXOffset ?? bd,
8384
+ scrollY: e.scrollY ?? n.pageYOffset ?? bd
8304
8385
  };
8305
- }, gd = (e, t, n) => ({
8386
+ }, Sd = (e, t, n) => ({
8306
8387
  allowTaint: e.allowTaint ?? !1,
8307
8388
  onclone: e.onclone,
8308
8389
  ignoreElements: e.ignoreElements,
@@ -8311,7 +8392,7 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8311
8392
  copyStyles: n,
8312
8393
  cspNonce: e.cspNonce ?? t.cspNonce,
8313
8394
  signal: e.signal
8314
- }), _d = (e, t, n, r, i, a, o) => ({
8395
+ }), Cd = (e, t, n, r, i, a, o) => ({
8315
8396
  canvas: e.canvas,
8316
8397
  backgroundColor: t,
8317
8398
  signal: e.signal,
@@ -8322,17 +8403,17 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8322
8403
  height: e.height ?? Math.ceil(a),
8323
8404
  imageSmoothing: e.imageSmoothing,
8324
8405
  imageSmoothingQuality: e.imageSmoothingQuality
8325
- }), vd = (e, t, n) => {
8406
+ }), wd = (e, t, n) => {
8326
8407
  let r = t.ownerDocument, i = r.documentElement ? Gn(e, getComputedStyle(r.documentElement).backgroundColor) : 0, a = r.body ? Gn(e, getComputedStyle(r.body).backgroundColor) : 0, o = typeof n == "string" ? Gn(e, n) : n === null ? 0 : 4294967295;
8327
8408
  return t === r.documentElement ? R(i) ? R(a) ? o : a : i : o;
8328
- }, yd = (e, t, n, r) => {
8409
+ }, Td = (e, t, n, r) => {
8329
8410
  if (e) try {
8330
8411
  e(n, r);
8331
8412
  } catch (e) {
8332
8413
  t.logger.error(`onProgress callback failed: ${e instanceof Error ? e.message : String(e)}`);
8333
8414
  }
8334
- }, bd = async (e, t, n) => {
8335
- if (ld(t), !t.skipValidation) {
8415
+ }, Ed = async (e, t, n) => {
8416
+ if (hd(t), !t.skipValidation) {
8336
8417
  let n = t.validator || d(), r = n.validateElement(e);
8337
8418
  if (!r.valid) throw Error(r.error);
8338
8419
  let i = n.validateOptions(t);
@@ -8343,36 +8424,35 @@ var Fu = (e) => e instanceof Tc || e instanceof wc || e instanceof Cc && e.type
8343
8424
  if (!r) throw Error("Element is not attached to a Document");
8344
8425
  let i = r.defaultView;
8345
8426
  if (!i) throw Error("Document is not attached to a Window");
8346
- let a = dd(t, n, ud(t)), o = hd(t, i), s = new p(o.scrollX, o.scrollY, o.windowWidth, o.windowHeight), c = new cd(a, s, n), l = t.enablePerformanceMonitoring ?? t.logging ?? !1, u = new f(c, l);
8427
+ let a = _d(t, n, gd(t)), o = xd(t, i), s = new p(o.scrollX, o.scrollY, o.windowWidth, o.windowHeight), c = new md(a, s, n), l = t.enablePerformanceMonitoring ?? t.logging ?? !1, u = new f(c, l);
8347
8428
  u.start("total", {
8348
8429
  width: o.windowWidth,
8349
8430
  height: o.windowHeight
8350
8431
  });
8351
8432
  let g = t.signal;
8352
8433
  q(g);
8353
- let _ = t.foreignObjectRendering ?? !1, v = gd(t, n, _);
8354
- c.logger.debug(`Starting document clone with size ${s.width}x${s.height} scrolled to ${-s.left},${-s.top}`), yd(t.onProgress, c, "clone", 10), u.start("clone");
8355
- let y = new Bs(c, e, v), b = y.clonedReferenceElement;
8434
+ let _ = t.foreignObjectRendering ?? !1, v = Sd(t, n, _);
8435
+ c.logger.debug(`Starting document clone with size ${s.width}x${s.height} scrolled to ${-s.left},${-s.top}`), Td(t.onProgress, c, "clone", 10), u.start("clone");
8436
+ let y = new Ks(c, e, v), b = y.clonedReferenceElement;
8356
8437
  if (!b) throw Error("Unable to find element in cloned iframe");
8357
- let x = await y.toIFrame(r, s);
8358
- u.end("clone"), yd(t.onProgress, c, "clone", 30), g?.aborted && ((t.removeContainer ?? !0) && Bs.destroy(x), q(g));
8359
- let { width: S, height: ee, left: te, top: C } = er(b) || Qn(b) ? h(b.ownerDocument) : m(c, b), ne = vd(c, b, t.backgroundColor), re = _d(t, ne, te, C, S, ee, i.devicePixelRatio ?? 1), ie, w;
8438
+ let x, S, C;
8360
8439
  try {
8361
- _ ? (c.logger.debug("Document cloned, using foreign object rendering"), u.start("render-foreignobject"), ie = await new Ju(c, re).render(b), u.end("render-foreignobject")) : (c.logger.debug(`Document cloned, element located at ${te},${C} with size ${S}x${ee} using computed rendering`), c.logger.debug("Starting DOM parsing"), u.start("parse"), q(g), c.cache.startDefer(), w = jc(c, b, { normalizeDom: t.normalizeDom }), u.end("parse"), yd(t.onProgress, c, "parse", 50), u.start("preload"), await c.cache.preloadAll(10, (e, n) => {
8362
- yd(t.onProgress, c, "preload", 50 + Math.round(e / n * 10));
8363
- }, g), u.end("preload"), yd(t.onProgress, c, "layout", 60), ne === w.styles.backgroundColor && (w.styles.backgroundColor = 0), c.logger.debug(`Starting renderer for element at ${re.x},${re.y} with size ${re.width}x${re.height}`), u.start("render"), q(g), ie = await new Gu(c, re).render(w), u.end("render")), yd(t.onProgress, c, "render", 90);
8440
+ x = await y.toIFrame(r, s), u.end("clone"), Td(t.onProgress, c, "clone", 30), q(g);
8441
+ let { width: e, height: n, left: a, top: o } = er(b) || Qn(b) ? h(b.ownerDocument) : m(c, b), l = wd(c, b, t.backgroundColor), d = Cd(t, l, a, o, e, n, i.devicePixelRatio ?? 1);
8442
+ _ ? (c.logger.debug("Document cloned, using foreign object rendering"), u.start("render-foreignobject"), S = await new ed(c, d).render(b), u.end("render-foreignobject")) : (c.logger.debug(`Document cloned, element located at ${a},${o} with size ${e}x${n} using computed rendering`), c.logger.debug("Starting DOM parsing"), u.start("parse"), q(g), c.cache.startDefer(), C = Lc(c, b, { normalizeDom: t.normalizeDom }), u.end("parse"), Td(t.onProgress, c, "parse", 50), u.start("preload"), await c.cache.preloadAll(10, (e, n) => {
8443
+ Td(t.onProgress, c, "preload", 50 + Math.round(e / n * 10));
8444
+ }, g), u.end("preload"), Td(t.onProgress, c, "layout", 60), l === C.styles.backgroundColor && (C.styles.backgroundColor = 0), c.logger.debug(`Starting renderer for element at ${d.x},${d.y} with size ${d.width}x${d.height}`), u.start("render"), q(g), S = await new Zu(c, d).render(C), u.end("render")), Td(t.onProgress, c, "render", 90);
8364
8445
  } finally {
8365
8446
  u.start("cleanup");
8366
8447
  try {
8367
- w && w.restoreTree();
8448
+ C && C.restoreTree();
8368
8449
  } finally {
8369
- (t.removeContainer ?? !0) && Bs.destroy(x), u.end("cleanup");
8450
+ x && (t.removeContainer ?? !0) && Ks.destroy(x), u.end("cleanup");
8370
8451
  }
8371
8452
  }
8372
- return u.end("total"), c.logger.debug("Finished rendering"), l && u.logSummary(), yd(t.onProgress, c, "render", 100), ie;
8373
- }, xd = (e, t = {}, n) => bd(e, t, n || l.fromElement(e, {
8453
+ return u.end("total"), c.logger.debug("Finished rendering"), l && u.logSummary(), Td(t.onProgress, c, "render", 100), S;
8454
+ }, Dd = (e, t = {}, n) => Ed(e, t, n || l.fromElement(e, {
8374
8455
  cspNonce: t.cspNonce,
8375
8456
  cache: t.cache
8376
8457
  }));
8377
- //#endregion
8378
- export { l as Html2CanvasConfig, f as PerformanceMonitor, u as Validator, d as createDefaultValidator, xd as default, xd as html2canvas };
8458
+ export { l as Html2CanvasConfig, f as PerformanceMonitor, u as Validator, d as createDefaultValidator, Dd as default, Dd as html2canvas };