@epam/ai-dial-attachment-canvas 1.2.0-dev.2 → 1.2.0-dev.6

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 (41) hide show
  1. package/{LazyContentBoundary-CL7J_W9c.js → LazyContentBoundary-CRXN6PG3.js} +1 -1
  2. package/{PdfContent-DhfjgYL-.js → PdfContent-D71LPAe3.js} +1 -1
  3. package/{attachment-canvas-Bp6WeQws.js → attachment-canvas-nvhW3tKV.js} +3 -1
  4. package/{bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js → bounded-raw-part-cache-Cg1BsSZQ-DN8p45IK.js} +1111 -1043
  5. package/{chart-ex-B0DgG3Dt.js → chart-ex-DsESBs97.js} +1 -1
  6. package/{comment-occurrence-CqejEuts-7SeKCBXk.js → comment-occurrence-C8Y2uoVr-C1cxz2TU.js} +1 -1
  7. package/{comment-ui-runtime-lXwVOgjW-Be4RALsI.js → comment-ui-runtime-BfE7MJZn-DhQ_eg15.js} +29 -29
  8. package/comment-ui-runtime-BsK8pmUT-EgWiymew.js +2 -0
  9. package/{comment-ui-runtime-DEtgcmj7-B1G7PH4z.js → comment-ui-runtime-DcJOYlw--B15auUq-.js} +52 -52
  10. package/{comments-CAn2A_Xh-CdgNAj0h.js → comments-Diid5ujN-BdQhRNjI.js} +2 -2
  11. package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -1
  12. package/{delimited-text-worker-host-DcHj_JZt-DWJmaPag.js → delimited-text-worker-host-BVY-Ecni-AimUmSn0.js} +1 -1
  13. package/{docx-B9qBTEkj.js → docx-B-VcIRoc.js} +4628 -4580
  14. package/index.js +564 -564
  15. package/line-distribute-Dtudnqhs--BYZNgzX.js +1237 -0
  16. package/{line-metrics-CBbw80Ko-DoOuwYxZ.js → line-metrics-B60C86uh-DfQUk7X1.js} +1 -1
  17. package/ooxml-highlight-surfaces-CaMjx8u-.js +351 -0
  18. package/package.json +4 -4
  19. package/{pptx-dkJw0-Vx.js → pptx-CnoDB8Fv.js} +955 -923
  20. package/{read-only-comment-decoration-BTnWEeo5-BNhbteYc.js → read-only-comment-decoration-Dz7eTQ4d-Cl3RKKH6.js} +1 -1
  21. package/{read-only-comment-margin-plStyGfE-mggNAMB_.js → read-only-comment-margin-DkgzASAl-BbDxMI5E.js} +1 -1
  22. package/render-worker-host-BfbnEChF-D2thMRGX.js +7 -0
  23. package/render-worker-host-DNL9dWRh-Bky38ZHE.js +7 -0
  24. package/render-worker-host-IkHrYOci-DbjyHK7U.js +7 -0
  25. package/{renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js → renderer-module-contract-D91rkYHH-BtfSKxb4.js} +1 -1
  26. package/test-setup.d.ts +10 -1
  27. package/test-setup.d.ts.map +1 -1
  28. package/types/attachment-canvas.d.ts +17 -0
  29. package/types/attachment-canvas.d.ts.map +1 -1
  30. package/utils/ooxml-highlight-geometry.d.ts +87 -3
  31. package/utils/ooxml-highlight-geometry.d.ts.map +1 -1
  32. package/utils/ooxml-highlight-surfaces.d.ts +33 -6
  33. package/utils/ooxml-highlight-surfaces.d.ts.map +1 -1
  34. package/{visible-index-DPoQYSDt-9lRc-2Ik.js → visible-index-BgiHEc1z-BOzE9X5U.js} +7 -7
  35. package/{xlsx-BAXMTJTG.js → xlsx-Dn0XSlTO.js} +1581 -1556
  36. package/comment-ui-runtime-TLHustXJ-DWCXG2mL.js +0 -2
  37. package/line-distribute-IsUGfHXm-DeITjLzJ.js +0 -1234
  38. package/ooxml-highlight-surfaces-DhK1KJcR.js +0 -294
  39. package/render-worker-host-BEfLZvSL-COy91Rd8.js +0 -7
  40. package/render-worker-host-Ba6Fchqr-DZeKpMWD.js +0 -7
  41. package/render-worker-host-C3xwtHnv-BBGHFdo9.js +0 -7
@@ -1,4 +1,4 @@
1
- import { $t as e, At as t, Et as n, Ft as r, It as i, Jt as a, K as o, Kt as s, Ot as c, Qt as l, Tt as u, Xt as d, Yt as f, Zt as p, en as m, qt as h, tt as g, zt as _ } from "./renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js";
1
+ import { $t as e, At as t, Et as n, Ft as r, It as i, Jt as a, K as o, Kt as s, Ot as c, Qt as l, Tt as u, Xt as d, Yt as f, Zt as p, en as m, qt as h, tt as g, zt as _ } from "./renderer-module-contract-D91rkYHH-BtfSKxb4.js";
2
2
  //#region ../../node_modules/@silurus/ooxml/dist/raster-target-ojDdQizC.js
3
3
  var v = class e extends Error {
4
4
  code = "ooxml-tiff-decode";
@@ -87,12 +87,12 @@ function ne(e, t, n, r) {
87
87
  } : void 0;
88
88
  }
89
89
  //#endregion
90
- //#region ../../node_modules/@silurus/ooxml/dist/mathjax-DS69BmJd.js
90
+ //#region ../../node_modules/@silurus/ooxml/dist/mathjax-DoyWZbSp.js
91
91
  function re(e, t) {
92
92
  return e.replace(/currentColor/g, t);
93
93
  }
94
94
  //#endregion
95
- //#region ../../node_modules/@silurus/ooxml/dist/hyperlink-BR1NCO7S.js
95
+ //#region ../../node_modules/@silurus/ooxml/dist/hyperlink-ArrU3ArU.js
96
96
  var w = class e extends Error {
97
97
  code;
98
98
  constructor(t, n) {
@@ -282,7 +282,11 @@ var Ne = [
282
282
  "noto sans thai": { url: E("Noto+Sans+Thai") },
283
283
  "noto sans hebrew": { url: E("Noto+Sans+Hebrew") },
284
284
  "noto serif hebrew": { url: E("Noto+Serif+Hebrew") }
285
- }, Re = class e {
285
+ };
286
+ function Re(e) {
287
+ return /\p{Script=Han}/u.test(e);
288
+ }
289
+ var ze = class e {
286
290
  hasHan = !1;
287
291
  hasHangul = !1;
288
292
  hasKana = !1;
@@ -294,6 +298,12 @@ var Ne = [
294
298
  constructor(e) {
295
299
  this.cjkLang = e;
296
300
  }
301
+ scriptCjkLanguage() {
302
+ return this.hasHangul ? "kr" : this.hasKana ? "jp" : null;
303
+ }
304
+ preferredCjkLanguage() {
305
+ return this.scriptCjkLanguage() ?? this.cjkLang ?? "jp";
306
+ }
297
307
  clone() {
298
308
  let t = new e(this.cjkLang);
299
309
  return t.hasHan = this.hasHan, t.hasHangul = this.hasHangul, t.hasKana = this.hasKana, t.hasArabic = this.hasArabic, t.hasThai = this.hasThai, t.hasHebrew = this.hasHebrew, t.hasDevanagari = this.hasDevanagari, t.hasCyrGreek = this.hasCyrGreek, t;
@@ -302,36 +312,40 @@ var Ne = [
302
312
  let t = () => this.hasHan && this.hasHangul && this.hasKana && this.hasArabic && this.hasThai && this.hasHebrew && this.hasDevanagari && this.hasCyrGreek;
303
313
  outer: for (let n of e) if (n) for (let e of n) {
304
314
  let n = e.codePointAt(0);
305
- if (n !== void 0 && !(n <= 591) && (n >= 4352 && n <= 4607 || n >= 12592 && n <= 12687 || n >= 44032 && n <= 55215 ? this.hasHangul = !0 : n >= 12352 && n <= 12543 ? this.hasKana = !0 : n >= 13312 && n <= 19903 || n >= 19968 && n <= 40959 || n >= 63744 && n <= 64255 || n >= 131072 && n <= 195103 ? this.hasHan = !0 : n >= 1536 && n <= 1791 || n >= 1872 && n <= 1919 || n >= 2208 && n <= 2303 || n >= 64336 && n <= 65023 || n >= 65136 && n <= 65279 ? this.hasArabic = !0 : n >= 3584 && n <= 3711 ? this.hasThai = !0 : n >= 1424 && n <= 1535 || n >= 64285 && n <= 64335 ? this.hasHebrew = !0 : n >= 2304 && n <= 2431 ? this.hasDevanagari = !0 : (n >= 1024 && n <= 1279 || n >= 880 && n <= 1023) && (this.hasCyrGreek = !0), t())) break outer;
315
+ if (n !== void 0 && !(n <= 591) && (n >= 4352 && n <= 4607 || n >= 12592 && n <= 12687 || n >= 44032 && n <= 55215 ? this.hasHangul = !0 : n >= 12352 && n <= 12543 ? this.hasKana = !0 : Re(e) ? this.hasHan = !0 : n >= 1536 && n <= 1791 || n >= 1872 && n <= 1919 || n >= 2208 && n <= 2303 || n >= 64336 && n <= 65023 || n >= 65136 && n <= 65279 ? this.hasArabic = !0 : n >= 3584 && n <= 3711 ? this.hasThai = !0 : n >= 1424 && n <= 1535 || n >= 64285 && n <= 64335 ? this.hasHebrew = !0 : n >= 2304 && n <= 2431 ? this.hasDevanagari = !0 : (n >= 1024 && n <= 1279 || n >= 880 && n <= 1023) && (this.hasCyrGreek = !0), t())) break outer;
306
316
  }
307
317
  }
308
- names() {
309
- let e = [], t = /* @__PURE__ */ new Set();
310
- this.hasHangul && t.add("kr"), this.hasKana && t.add("jp"), this.hasHan && t.size === 0 && t.add(this.cjkLang ?? "jp");
311
- for (let n of [
318
+ names(e = !1) {
319
+ let t = [], n = /* @__PURE__ */ new Set();
320
+ this.hasHangul && n.add("kr"), this.hasKana && n.add("jp"), this.hasHan && (n.size === 0 || e) && n.add(this.cjkLang ?? "jp");
321
+ for (let e of [
312
322
  "kr",
313
323
  "sc",
314
324
  "tc",
315
325
  "hk",
316
326
  "jp"
317
- ]) if (t.has(n)) {
318
- let t = {
327
+ ]) if (n.has(e)) {
328
+ let n = {
319
329
  kr: "KR",
320
330
  sc: "SC",
321
331
  tc: "TC",
322
332
  hk: "HK",
323
333
  jp: "JP"
324
- }[n];
325
- e.push(`Noto Sans ${t}`), n !== "hk" && e.push(`Noto Serif ${t}`);
334
+ }[e];
335
+ t.push(`Noto Sans ${n}`), e !== "hk" && t.push(`Noto Serif ${n}`);
326
336
  }
327
- return this.hasCyrGreek && e.push("Noto Sans", "Noto Serif"), this.hasArabic && e.push("Noto Naskh Arabic", "Noto Sans Arabic"), this.hasThai && e.push("Noto Sans Thai"), this.hasHebrew && e.push("Noto Sans Hebrew", "Noto Serif Hebrew"), this.hasDevanagari && e.push("Noto Sans Devanagari"), e;
337
+ return this.hasCyrGreek && t.push("Noto Sans", "Noto Serif"), this.hasArabic && t.push("Noto Naskh Arabic", "Noto Sans Arabic"), this.hasThai && t.push("Noto Sans Thai"), this.hasHebrew && t.push("Noto Sans Hebrew", "Noto Serif Hebrew"), this.hasDevanagari && t.push("Noto Sans Devanagari"), t;
328
338
  }
329
339
  };
330
- function ze(e, t) {
331
- let n = new Re(t);
332
- return n.addText(e), n.names();
340
+ function Be(e, t, n = !1) {
341
+ let r = new ze(t);
342
+ return r.addText(e), r.names(n);
333
343
  }
334
- var Be = {
344
+ function Ve(e, t) {
345
+ let n = new ze(t);
346
+ return n.addText(e), n.preferredCjkLanguage();
347
+ }
348
+ var He = {
335
349
  accentbordercallout1: {
336
350
  adj: [
337
351
  ["adj1", "val 18750"],
@@ -22194,15 +22208,15 @@ var Be = {
22194
22208
  ]
22195
22209
  }]
22196
22210
  }
22197
- }, D = 216e5, Ve = Math.PI * 2 / D;
22198
- function He(e) {
22211
+ }, D = 216e5, Ue = Math.PI * 2 / D;
22212
+ function We(e) {
22199
22213
  let t = e.trim().split(/\s+/);
22200
22214
  return {
22201
22215
  op: t[0],
22202
22216
  argTokens: t.slice(1)
22203
22217
  };
22204
22218
  }
22205
- function Ue(e, t, n) {
22219
+ function Ge(e, t, n) {
22206
22220
  let { w: r, h: i, adj: a } = e, o = Math.min(r, i), s = Math.max(r, i), c = Object.create(null);
22207
22221
  Object.assign(c, {
22208
22222
  w: r,
@@ -22291,18 +22305,18 @@ function Ue(e, t, n) {
22291
22305
  case "pin": return t[1] < t[0] ? t[0] : t[1] > t[2] ? t[2] : t[1];
22292
22306
  case "sqrt": return Math.sqrt(Math.max(0, t[0]));
22293
22307
  case "mod": return Math.sqrt(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]);
22294
- case "sin": return t[0] * Math.sin(t[1] * Ve);
22295
- case "cos": return t[0] * Math.cos(t[1] * Ve);
22296
- case "tan": return t[0] * Math.tan(t[1] * Ve);
22297
- case "at2": return Math.atan2(t[1], t[0]) / Ve;
22308
+ case "sin": return t[0] * Math.sin(t[1] * Ue);
22309
+ case "cos": return t[0] * Math.cos(t[1] * Ue);
22310
+ case "tan": return t[0] * Math.tan(t[1] * Ue);
22311
+ case "at2": return Math.atan2(t[1], t[0]) / Ue;
22298
22312
  case "cat2": return t[0] * Math.cos(Math.atan2(t[2], t[1]));
22299
22313
  case "sat2": return t[0] * Math.sin(Math.atan2(t[2], t[1]));
22300
22314
  default: throw Error(`preset-shape: unknown operator "${e}" in "${[n.op, ...n.argTokens].join(" ")}"`);
22301
22315
  }
22302
22316
  }
22303
22317
  }
22304
- var We = Math.PI * 2 / 216e5;
22305
- function Ge(e, t, n, r, i, a, o) {
22318
+ var Ke = Math.PI * 2 / 216e5;
22319
+ function qe(e, t, n, r, i, a, o) {
22306
22320
  let s = t.w == null ? 1 : a / t.w, c = t.h == null ? 1 : o / t.h, l = (e) => r + e * s, u = (e) => i + e * c, d = 0, f = 0;
22307
22321
  for (let r of t.cmds) switch (r[0]) {
22308
22322
  case "m": {
@@ -22326,7 +22340,7 @@ function Ge(e, t, n, r, i, a, o) {
22326
22340
  break;
22327
22341
  }
22328
22342
  case "a": {
22329
- let t = n.resolve(r[1]), i = n.resolve(r[2]), a = t * s, o = i * c, l = n.resolve(r[3]) * We, u = n.resolve(r[4]) * We, p = Math.PI * 2, m = (e) => Math.atan2(t * Math.sin(e), i * Math.cos(e)), h = m(l), g = Math.trunc(u / p), _ = u - g * p, v = m(l + _) - h;
22343
+ let t = n.resolve(r[1]), i = n.resolve(r[2]), a = t * s, o = i * c, l = n.resolve(r[3]) * Ke, u = n.resolve(r[4]) * Ke, p = Math.PI * 2, m = (e) => Math.atan2(t * Math.sin(e), i * Math.cos(e)), h = m(l), g = Math.trunc(u / p), _ = u - g * p, v = m(l + _) - h;
22330
22344
  _ > 0 && v < 0 ? v += p : _ < 0 && v > 0 && (v -= p);
22331
22345
  let y = h + v + g * p, b = d - a * Math.cos(h), x = f - o * Math.sin(h);
22332
22346
  Math.abs(a) > 1e-6 && Math.abs(o) > 1e-6 && (e.ellipse(b, x, Math.abs(a), Math.abs(o), 0, h, y, u < 0), d = b + a * Math.cos(y), f = x + o * Math.sin(y));
@@ -22337,44 +22351,44 @@ function Ge(e, t, n, r, i, a, o) {
22337
22351
  break;
22338
22352
  }
22339
22353
  }
22340
- var O = Be, Ke = /* @__PURE__ */ new WeakMap();
22341
- function qe(e) {
22342
- let t = Ke.get(e);
22354
+ var O = He, Je = /* @__PURE__ */ new WeakMap();
22355
+ function Ye(e) {
22356
+ let t = Je.get(e);
22343
22357
  return t || (t = {
22344
- adj: e.adj.map(([e, t]) => [e, He(t)]),
22345
- gd: e.gd.map(([e, t]) => [e, He(t)])
22346
- }, Ke.set(e, t)), t;
22358
+ adj: e.adj.map(([e, t]) => [e, We(t)]),
22359
+ gd: e.gd.map(([e, t]) => [e, We(t)])
22360
+ }, Je.set(e, t)), t;
22347
22361
  }
22348
- function Je(e, t, n, r) {
22349
- let i = qe(e);
22350
- return Ue({
22362
+ function Xe(e, t, n, r) {
22363
+ let i = Ye(e);
22364
+ return Ge({
22351
22365
  w: t,
22352
22366
  h: n,
22353
22367
  adj: r
22354
22368
  }, i.adj, i.gd);
22355
22369
  }
22356
- function Ye(e) {
22370
+ function Ze(e) {
22357
22371
  return e.toLowerCase() in O;
22358
22372
  }
22359
- function Xe(e, t, n, r, i, a, o = []) {
22373
+ function Qe(e, t, n, r, i, a, o = []) {
22360
22374
  let s = O[t.toLowerCase()];
22361
22375
  if (!s) return !1;
22362
- let c = Je(s, i, a, o);
22363
- for (let t of s.paths) Ge(e, t, c, n, r, i, a);
22376
+ let c = Xe(s, i, a, o);
22377
+ for (let t of s.paths) qe(e, t, c, n, r, i, a);
22364
22378
  return !0;
22365
22379
  }
22366
- function Ze(e, t, n, r, i, a, o = []) {
22380
+ function $e(e, t, n, r, i, a, o = []) {
22367
22381
  let s = O[t.toLowerCase()];
22368
22382
  if (!s) return !1;
22369
- let c = Je(s, i, a, o);
22370
- for (let t of s.paths) t.fill !== "none" && Ge(e, t, c, n, r, i, a);
22383
+ let c = Xe(s, i, a, o);
22384
+ for (let t of s.paths) t.fill !== "none" && qe(e, t, c, n, r, i, a);
22371
22385
  return !0;
22372
22386
  }
22373
- var Qe = {
22387
+ var et = {
22374
22388
  wedgeroundrectcallout: "roundrect",
22375
22389
  wedgeellipsecallout: "ellipse",
22376
22390
  wedgerectcallout: null
22377
- }, $e = {
22391
+ }, tt = {
22378
22392
  adj: [],
22379
22393
  gd: [],
22380
22394
  paths: [{
@@ -22408,20 +22422,20 @@ var Qe = {
22408
22422
  ]
22409
22423
  }]
22410
22424
  };
22411
- function et(e, t, n) {
22425
+ function nt(e, t, n) {
22412
22426
  let r = e[n];
22413
22427
  if (typeof r == "number") return r;
22414
22428
  let i = t.adj[n];
22415
22429
  return i && Number(i[1].replace(/^val\s+/, "")) || 0;
22416
22430
  }
22417
- function tt(e, t, n, r) {
22431
+ function rt(e, t, n, r) {
22418
22432
  let i = O[e];
22419
22433
  if (!i) return null;
22420
- if (e in Qe) {
22421
- let a = et(r, i, 0), o = et(r, i, 1), s = t / 2 + t * a / 1e5, c = n / 2 + n * o / 1e5;
22434
+ if (e in et) {
22435
+ let a = nt(r, i, 0), o = nt(r, i, 1), s = t / 2 + t * a / 1e5, c = n / 2 + n * o / 1e5;
22422
22436
  if (s >= 0 && s <= t && c >= 0 && c <= n) {
22423
- let t = Qe[e];
22424
- t === "roundrect" ? (i = O.roundrect, r = [et(r, O[e], 2)]) : t && O[t] ? (i = O[t], r = []) : (i = $e, r = []);
22437
+ let t = et[e];
22438
+ t === "roundrect" ? (i = O.roundrect, r = [nt(r, O[e], 2)]) : t && O[t] ? (i = O[t], r = []) : (i = tt, r = []);
22425
22439
  }
22426
22440
  }
22427
22441
  return {
@@ -22429,8 +22443,8 @@ function tt(e, t, n, r) {
22429
22443
  adj: r
22430
22444
  };
22431
22445
  }
22432
- function nt(e, t, n, r, i, a = []) {
22433
- let o = tt(e.toLowerCase(), r, i, a);
22446
+ function it(e, t, n, r, i, a = []) {
22447
+ let o = rt(e.toLowerCase(), r, i, a);
22434
22448
  if (!o) return null;
22435
22449
  let s = Infinity, c = Infinity, l = -Infinity, u = -Infinity, d = (e, t) => {
22436
22450
  !Number.isFinite(e) || !Number.isFinite(t) || (s = Math.min(s, e), c = Math.min(c, t), l = Math.max(l, e), u = Math.max(u, t));
@@ -22447,8 +22461,8 @@ function nt(e, t, n, r, i, a = []) {
22447
22461
  d(e - Math.abs(n), t - Math.abs(r)), d(e + Math.abs(n), t + Math.abs(r));
22448
22462
  },
22449
22463
  closePath() {}
22450
- }, p = Je(o.def, r, i, o.adj);
22451
- for (let e of o.def.paths) Ge(f, e, p, t, n, r, i);
22464
+ }, p = Xe(o.def, r, i, o.adj);
22465
+ for (let e of o.def.paths) qe(f, e, p, t, n, r, i);
22452
22466
  return Number.isFinite(s) ? {
22453
22467
  x: s,
22454
22468
  y: c,
@@ -22461,19 +22475,19 @@ function nt(e, t, n, r, i, a = []) {
22461
22475
  h: i
22462
22476
  };
22463
22477
  }
22464
- function rt(e, t, n, r, i, a, o, s, c, l, u) {
22465
- let d = tt(t.toLowerCase(), i, a, o);
22478
+ function at(e, t, n, r, i, a, o, s, c, l, u) {
22479
+ let d = rt(t.toLowerCase(), i, a, o);
22466
22480
  if (!d) return !1;
22467
22481
  let { def: f } = d;
22468
22482
  o = d.adj;
22469
- let p = Je(f, i, a, o), m = !1, h = f.paths.length - 1;
22483
+ let p = Xe(f, i, a, o), m = !1, h = f.paths.length - 1;
22470
22484
  for (let t = 0; t < f.paths.length; t++) {
22471
22485
  let o = f.paths[t];
22472
- e.beginPath(), Ge(e, o, p, n, r, i, a);
22486
+ e.beginPath(), qe(e, o, p, n, r, i, a);
22473
22487
  let d = o.fill;
22474
22488
  if (d !== "none" && s != null) {
22475
22489
  e.save(), e.fillStyle = s, e.fill();
22476
- let t = at(d);
22490
+ let t = st(d);
22477
22491
  t && (e.fillStyle = t, e.fill()), e.restore(), m ||= (l(), !0);
22478
22492
  }
22479
22493
  if (o.stroke && c) {
@@ -22483,10 +22497,10 @@ function rt(e, t, n, r, i, a, o, s, c, l, u) {
22483
22497
  }
22484
22498
  return !0;
22485
22499
  }
22486
- function it(e, t, n, r, i, a) {
22500
+ function ot(e, t, n, r, i, a) {
22487
22501
  let o = O[e.toLowerCase()];
22488
22502
  if (!o || o.paths.length === 0) return null;
22489
- let s = o.paths[o.paths.length - 1], c = Je(o, r, i, a), l = s.w == null ? 1 : r / s.w, u = s.h == null ? 1 : i / s.h, d = (e) => t + e * l, f = (e) => n + e * u, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0, y = !1, b = 0, x = 0, S = [];
22503
+ let s = o.paths[o.paths.length - 1], c = Xe(o, r, i, a), l = s.w == null ? 1 : r / s.w, u = s.h == null ? 1 : i / s.h, d = (e) => t + e * l, f = (e) => n + e * u, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0, y = !1, b = 0, x = 0, S = [];
22490
22504
  for (let e of s.cmds) switch (e[0]) {
22491
22505
  case "m":
22492
22506
  h = d(c.resolve(e[1])), g = f(c.resolve(e[2])), p = h, m = g, S.push({
@@ -22526,7 +22540,7 @@ function it(e, t, n, r, i, a) {
22526
22540
  vertices: S
22527
22541
  };
22528
22542
  }
22529
- function at(e) {
22543
+ function st(e) {
22530
22544
  switch (e) {
22531
22545
  case "lighten": return "rgba(255,255,255,0.30)";
22532
22546
  case "lightenLess": return "rgba(255,255,255,0.15)";
@@ -22610,7 +22624,7 @@ var k = {
22610
22624
  TWIPS: 6,
22611
22625
  ISOTROPIC: 7,
22612
22626
  ANISOTROPIC: 8
22613
- }, ot = () => ({
22627
+ }, ct = () => ({
22614
22628
  m11: 1,
22615
22629
  m12: 0,
22616
22630
  m21: 0,
@@ -22618,7 +22632,7 @@ var k = {
22618
22632
  dx: 0,
22619
22633
  dy: 0
22620
22634
  });
22621
- function st(e, t) {
22635
+ function lt(e, t) {
22622
22636
  return {
22623
22637
  m11: e.m11 * t.m11 + e.m21 * t.m12,
22624
22638
  m12: e.m12 * t.m11 + e.m22 * t.m12,
@@ -22628,7 +22642,7 @@ function st(e, t) {
22628
22642
  dy: e.m12 * t.dx + e.m22 * t.dy + e.dy
22629
22643
  };
22630
22644
  }
22631
- var ct = class {
22645
+ var ut = class {
22632
22646
  p;
22633
22647
  constructor(e, t, n) {
22634
22648
  this.dv = e, this.end = n, this.p = t;
@@ -22671,68 +22685,68 @@ var ct = class {
22671
22685
  skip(e) {
22672
22686
  this.p += e;
22673
22687
  }
22674
- }, lt = 2162688;
22688
+ }, dt = 2162688;
22675
22689
  function M(e, t) {
22676
22690
  if (!e.inPath) return !0;
22677
22691
  if (e.pathDiscarded) return !1;
22678
22692
  let n = e.pathCommandCount + t;
22679
22693
  return !Number.isSafeInteger(n) || t < 0 || n > e.maxPathCommands ? (e.ctx.beginPath(), e.pathDiscarded = !0, !1) : (e.pathCommandCount = n, !0);
22680
22694
  }
22681
- function ut(e, t, n) {
22695
+ function ft(e, t, n) {
22682
22696
  let r = n === F ? 4 : 8;
22683
22697
  return Math.min(t, Math.floor(e.remaining / r));
22684
22698
  }
22685
- function dt(e, t, n) {
22699
+ function pt(e, t, n) {
22686
22700
  return e.wt.m11 * t + e.wt.m21 * n + e.wt.dx;
22687
22701
  }
22688
- function ft(e, t, n) {
22702
+ function mt(e, t, n) {
22689
22703
  return e.wt.m12 * t + e.wt.m22 * n + e.wt.dy;
22690
22704
  }
22691
- function pt(e) {
22705
+ function ht(e) {
22692
22706
  return e.winExtX === 0 ? 1 : e.vpExtX / e.winExtX;
22693
22707
  }
22694
- function mt(e) {
22708
+ function gt(e) {
22695
22709
  return e.winExtY === 0 ? 1 : e.vpExtY / e.winExtY;
22696
22710
  }
22697
- function ht(e) {
22698
- return Math.min(Math.abs(pt(e)), Math.abs(mt(e)));
22711
+ function _t(e) {
22712
+ return Math.min(Math.abs(ht(e)), Math.abs(gt(e)));
22699
22713
  }
22700
- function gt(e) {
22701
- return e.mapMode === j.ISOTROPIC ? pt(e) < 0 ? -ht(e) : ht(e) : pt(e);
22714
+ function vt(e) {
22715
+ return e.mapMode === j.ISOTROPIC ? ht(e) < 0 ? -_t(e) : _t(e) : ht(e);
22702
22716
  }
22703
- function _t(e) {
22704
- return e.mapMode === j.ISOTROPIC ? mt(e) < 0 ? -ht(e) : ht(e) : mt(e);
22717
+ function yt(e) {
22718
+ return e.mapMode === j.ISOTROPIC ? gt(e) < 0 ? -_t(e) : _t(e) : gt(e);
22705
22719
  }
22706
- function vt(e, t) {
22707
- return (t - e.winOrgX) * gt(e) + e.vpOrgX;
22720
+ function bt(e, t) {
22721
+ return (t - e.winOrgX) * vt(e) + e.vpOrgX;
22708
22722
  }
22709
- function yt(e, t) {
22710
- return (t - e.winOrgY) * _t(e) + e.vpOrgY;
22723
+ function xt(e, t) {
22724
+ return (t - e.winOrgY) * yt(e) + e.vpOrgY;
22711
22725
  }
22712
22726
  function N(e, t, n) {
22713
- let r = vt(e, dt(e, t, n)), i = yt(e, ft(e, t, n));
22727
+ let r = bt(e, pt(e, t, n)), i = xt(e, mt(e, t, n));
22714
22728
  return [(r - e.left) * e.W / e.boundsW, (i - e.top) * e.H / e.boundsH];
22715
22729
  }
22716
- function bt(e) {
22730
+ function St(e) {
22717
22731
  return (Math.hypot(e.wt.m11, e.wt.m12) + Math.hypot(e.wt.m21, e.wt.m22)) / 2;
22718
22732
  }
22719
- function xt(e) {
22720
- return (Math.abs(gt(e)) + Math.abs(_t(e))) / 2;
22733
+ function Ct(e) {
22734
+ return (Math.abs(vt(e)) + Math.abs(yt(e))) / 2;
22721
22735
  }
22722
- function St(e) {
22736
+ function wt(e) {
22723
22737
  return (e.W / e.boundsW + e.H / e.boundsH) / 2;
22724
22738
  }
22725
- function Ct(e) {
22739
+ function Tt(e) {
22726
22740
  return Math.hypot(e.wt.m21, e.wt.m22);
22727
22741
  }
22728
- function wt(e) {
22742
+ function Et(e) {
22729
22743
  return e.H / e.boundsH;
22730
22744
  }
22731
22745
  function P(e, t) {
22732
- let n = t * bt(e) * xt(e) * St(e);
22746
+ let n = t * St(e) * Ct(e) * wt(e);
22733
22747
  return Math.max(.75, n);
22734
22748
  }
22735
- function Tt(e, t) {
22749
+ function Dt(e, t) {
22736
22750
  if (e.mapMode = t, t === j.TEXT) {
22737
22751
  e.winOrgX = 0, e.winOrgY = 0, e.vpOrgX = 0, e.vpOrgY = 0, e.winExtX = 1, e.winExtY = 1, e.vpExtX = 1, e.vpExtY = 1;
22738
22752
  return;
@@ -22741,7 +22755,7 @@ function Tt(e, t) {
22741
22755
  let n = 25.4, r = t === j.LOMETRIC ? .1 : t === j.HIMETRIC ? .01 : t === j.LOENGLISH ? .01 * n : t === j.HIENGLISH ? .001 * n : t === j.TWIPS ? n / 1440 : 0;
22742
22756
  r <= 0 || (e.winOrgX = 0, e.winOrgY = 0, e.vpOrgX = 0, e.vpOrgY = 0, e.winExtX = 1, e.winExtY = 1, e.vpExtX = r * e.devPxPerMmX, e.vpExtY = -(r * e.devPxPerMmY));
22743
22757
  }
22744
- var Et = {
22758
+ var Ot = {
22745
22759
  [A.WHITE_BRUSH]: {
22746
22760
  kind: "brush",
22747
22761
  fill: "#ffffff"
@@ -22766,7 +22780,7 @@ var Et = {
22766
22780
  kind: "brush",
22767
22781
  fill: null
22768
22782
  }
22769
- }, Dt = {
22783
+ }, kt = {
22770
22784
  [A.WHITE_PEN]: {
22771
22785
  kind: "pen",
22772
22786
  stroke: "#ffffff",
@@ -22788,13 +22802,13 @@ var Et = {
22788
22802
  width: 1
22789
22803
  }
22790
22804
  };
22791
- function Ot(e, t) {
22792
- let n = Et[t];
22805
+ function At(e, t) {
22806
+ let n = Ot[t];
22793
22807
  if (n) {
22794
22808
  e.curBrush = n;
22795
22809
  return;
22796
22810
  }
22797
- let r = Dt[t];
22811
+ let r = kt[t];
22798
22812
  if (r) {
22799
22813
  e.curPen = r;
22800
22814
  return;
@@ -22804,7 +22818,7 @@ function Ot(e, t) {
22804
22818
  fill: "#000000"
22805
22819
  });
22806
22820
  }
22807
- function kt(e) {
22821
+ function jt(e) {
22808
22822
  let t = 0, n = 0, r = 0, i = 0;
22809
22823
  for (let a = 0; a < e.data.length; a += 4) e.data[a + 3] !== 0 && (t += e.data[a], n += e.data[a + 1], r += e.data[a + 2], i++);
22810
22824
  if (i === 0) return "#808080";
@@ -22812,11 +22826,11 @@ function kt(e) {
22812
22826
  return `#${a(t)}${a(n)}${a(r)}`;
22813
22827
  }
22814
22828
  var F = (e) => [e.i16(), e.i16()], I = (e) => [e.i32(), e.i32()];
22815
- function At(e, t, n) {
22829
+ function Mt(e, t, n) {
22816
22830
  t.skip(16);
22817
22831
  let r = t.u32();
22818
22832
  if (r < 2 || r > 1048576 || !e.inPath && (!e.curPen || e.curPen.stroke == null)) return;
22819
- let { ctx: i } = e, a = M(e, ut(t, r, n));
22833
+ let { ctx: i } = e, a = M(e, ft(t, r, n));
22820
22834
  e.inPath || i.beginPath();
22821
22835
  let o = 0, s = 0;
22822
22836
  for (let c = 0; c < r && !(t.remaining < 4); c++) {
@@ -22825,11 +22839,11 @@ function At(e, t, n) {
22825
22839
  }
22826
22840
  !e.inPath && e.curPen?.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth = P(e, e.curPen.width), i.stroke(), e.drew = !0), e.curX = o, e.curY = s;
22827
22841
  }
22828
- function jt(e, t, n) {
22842
+ function Nt(e, t, n) {
22829
22843
  t.skip(16);
22830
22844
  let r = t.u32();
22831
22845
  if (r < 1 || r > 1048576) return;
22832
- let { ctx: i } = e, a = e.inPath || e.curPen != null && e.curPen.stroke != null, o = !e.inPath || M(e, ut(t, r, n));
22846
+ let { ctx: i } = e, a = e.inPath || e.curPen != null && e.curPen.stroke != null, o = !e.inPath || M(e, ft(t, r, n));
22833
22847
  if (a && !e.inPath) {
22834
22848
  i.beginPath();
22835
22849
  let [t, n] = N(e, e.curX, e.curY);
@@ -22845,11 +22859,11 @@ function jt(e, t, n) {
22845
22859
  }
22846
22860
  a && !e.inPath && e.curPen && (i.strokeStyle = e.curPen.stroke, i.lineWidth = P(e, e.curPen.width), i.stroke(), e.drew = !0);
22847
22861
  }
22848
- function Mt(e, t, n) {
22862
+ function Pt(e, t, n) {
22849
22863
  t.skip(16);
22850
22864
  let r = t.u32();
22851
22865
  if (r < 2 || r > 1048576) return;
22852
- let { ctx: i } = e, a = M(e, ut(t, r, n) + 1);
22866
+ let { ctx: i } = e, a = M(e, ft(t, r, n) + 1);
22853
22867
  e.inPath || i.beginPath();
22854
22868
  let o = !1;
22855
22869
  for (let s = 0; s < r && !(t.remaining < 4); s++) {
@@ -22858,11 +22872,11 @@ function Mt(e, t, n) {
22858
22872
  }
22859
22873
  o && (a && i.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth = P(e, e.curPen.width), i.stroke(), e.drew = !0)));
22860
22874
  }
22861
- function Nt(e, t, n, r) {
22875
+ function Ft(e, t, n, r) {
22862
22876
  t.skip(16);
22863
22877
  let i = t.u32();
22864
22878
  if (i < 1 || i > 1048576) return;
22865
- let a = ut(t, i, n), o = !e.inPath || M(e, a);
22879
+ let a = ft(t, i, n), o = !e.inPath || M(e, a);
22866
22880
  if (e.inPath && !o) {
22867
22881
  for (let r = 0; r < a; r++) {
22868
22882
  let [r, i] = n(t);
@@ -22894,7 +22908,7 @@ function Nt(e, t, n, r) {
22894
22908
  }
22895
22909
  c && !e.inPath && e.curPen && (l.strokeStyle = e.curPen.stroke, l.lineWidth = P(e, e.curPen.width), l.stroke(), e.drew = !0);
22896
22910
  }
22897
- function Pt(e, t, n, r) {
22911
+ function It(e, t, n, r) {
22898
22912
  t.skip(16);
22899
22913
  let i = t.u32(), a = t.u32();
22900
22914
  if (i <= 0 || i > 65536 || a <= 0 || a > 2097152) return;
@@ -22906,7 +22920,7 @@ function Pt(e, t, n, r) {
22906
22920
  o.push(e);
22907
22921
  }
22908
22922
  if (s !== a) return;
22909
- let { ctx: c } = e, l = M(e, ut(t, a, n) + (r ? i : 0));
22923
+ let { ctx: c } = e, l = M(e, ft(t, a, n) + (r ? i : 0));
22910
22924
  e.inPath || c.beginPath();
22911
22925
  let u = !1;
22912
22926
  for (let i of o) {
@@ -22925,14 +22939,14 @@ function Pt(e, t, n, r) {
22925
22939
  }
22926
22940
  !u || e.inPath || (r && e.curBrush && e.curBrush.fill != null && (c.fillStyle = e.curBrush.fill, c.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (c.strokeStyle = e.curPen.stroke, c.lineWidth = P(e, e.curPen.width), c.stroke(), e.drew = !0));
22927
22941
  }
22928
- function Ft(e, t, n, r, i) {
22942
+ function Lt(e, t, n, r, i) {
22929
22943
  let { ctx: a } = e, o = N(e, t, n), s = N(e, r, n), c = N(e, r, i), l = N(e, t, i), u = M(e, 5);
22930
22944
  e.inPath || a.beginPath(), u && (a.moveTo(o[0], o[1]), a.lineTo(s[0], s[1]), a.lineTo(c[0], c[1]), a.lineTo(l[0], l[1]), a.closePath()), !e.inPath && (e.curBrush && e.curBrush.fill != null && (a.fillStyle = e.curBrush.fill, a.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (a.strokeStyle = e.curPen.stroke, a.lineWidth = P(e, e.curPen.width), a.stroke(), e.drew = !0));
22931
22945
  }
22932
- function It(e, t, n) {
22946
+ function Rt(e, t, n) {
22933
22947
  !e.pathDiscarded && t && e.curBrush?.fill != null && (e.ctx.fillStyle = e.curBrush.fill, e.ctx.fill(e.fillRule), e.drew = !0), !e.pathDiscarded && n && e.curPen?.stroke != null && (e.ctx.strokeStyle = e.curPen.stroke, e.ctx.lineWidth = P(e, e.curPen.width), e.ctx.stroke(), e.drew = !0), e.ctx.beginPath(), e.pathCommandCount = 0, e.pathDiscarded = !1;
22934
22948
  }
22935
- function Lt(e) {
22949
+ function zt(e) {
22936
22950
  let t = e.u32(), n = e.u32(), r = e.i32();
22937
22951
  e.i32();
22938
22952
  let i = e.u32();
@@ -22942,7 +22956,7 @@ function Lt(e) {
22942
22956
  width: Math.abs(r)
22943
22957
  }];
22944
22958
  }
22945
- function Rt(e) {
22959
+ function Bt(e) {
22946
22960
  let t = e.u32();
22947
22961
  e.skip(16);
22948
22962
  let n = e.u32(), r = e.u32();
@@ -22954,27 +22968,27 @@ function Rt(e) {
22954
22968
  width: Math.abs(r)
22955
22969
  }];
22956
22970
  }
22957
- function zt(e) {
22971
+ function Vt(e) {
22958
22972
  let t = e.u32(), n = e.u32(), r = e.u32();
22959
22973
  return e.u32(), [t, {
22960
22974
  kind: "brush",
22961
22975
  fill: n === 1 ? null : g(r)
22962
22976
  }];
22963
22977
  }
22964
- function Bt(e, t, n) {
22978
+ function Ht(e, t, n) {
22965
22979
  let r = e.u32();
22966
22980
  e.u32();
22967
22981
  let i = e.u32(), a = e.u32(), o = e.u32(), s = e.u32(), l = "#808080";
22968
22982
  try {
22969
22983
  let e = c(t, n + i, a, n + o, s);
22970
- e && (l = kt(e));
22984
+ e && (l = jt(e));
22971
22985
  } catch {}
22972
22986
  return [r, {
22973
22987
  kind: "brush",
22974
22988
  fill: l
22975
22989
  }];
22976
22990
  }
22977
- function Vt(e, t, n) {
22991
+ function Ut(e, t, n) {
22978
22992
  let r = e.u32(), i = n + 12, a = t.getInt32(i, !0), o = t.getInt32(i + 8, !0), s = t.getInt32(i + 16, !0), c = t.getUint8(i + 20), l = "";
22979
22993
  for (let e = 0; e < 32; e++) {
22980
22994
  let n = i + 28 + e * 2;
@@ -22992,7 +23006,7 @@ function Vt(e, t, n) {
22992
23006
  escapement: o
22993
23007
  }];
22994
23008
  }
22995
- function Ht(e, t, n, r) {
23009
+ function Wt(e, t, n, r) {
22996
23010
  t.skip(16), t.u32(), t.f32(), t.f32();
22997
23011
  let i = t.i32(), a = t.i32(), o = t.u32(), s = t.u32();
22998
23012
  if (t.u32(), o <= 0 || o > 65536) return;
@@ -23003,7 +23017,7 @@ function Ht(e, t, n, r) {
23003
23017
  c += String.fromCharCode(n.getUint16(t, !0));
23004
23018
  }
23005
23019
  if (c.length === 0) return;
23006
- let l = e.curFont, u = Math.abs(l?.height ?? 0) * Ct(e) * Math.abs(_t(e)) * wt(e);
23020
+ let l = e.curFont, u = Math.abs(l?.height ?? 0) * Tt(e) * Math.abs(yt(e)) * Et(e);
23007
23021
  if (!Number.isFinite(u) || u < 1) return;
23008
23022
  let { ctx: d } = e, [f, p] = N(e, i, a);
23009
23023
  d.fillStyle = e.textColor;
@@ -23024,28 +23038,28 @@ function Ht(e, t, n, r) {
23024
23038
  e.drew = !0;
23025
23039
  } catch {}
23026
23040
  }
23027
- function Ut(e, t, n, i, a, o, s, l, u, d, f) {
23041
+ function Gt(e, t, n, i, a, o, s, l, u, d, f) {
23028
23042
  if (a === 0 || s === 0) return;
23029
23043
  let p = c(t, n + i, a, n + o, s);
23030
23044
  if (!p) return;
23031
23045
  let [m, h] = N(e, l, u), [g, _] = N(e, d, f);
23032
23046
  r(e.ctx, p, m, h, g, _) && (e.drew = !0);
23033
23047
  }
23034
- function Wt(e, t, n, r) {
23048
+ function Kt(e, t, n, r) {
23035
23049
  t.skip(16);
23036
23050
  let i = t.i32(), a = t.i32(), o = t.i32(), s = t.i32();
23037
- t.u32(), t.i32(), t.i32(), t.skip(24), t.u32(), t.u32(), Ut(e, n, r, t.u32(), t.u32(), t.u32(), t.u32(), i, a, i + o, a + s);
23051
+ t.u32(), t.i32(), t.i32(), t.skip(24), t.u32(), t.u32(), Gt(e, n, r, t.u32(), t.u32(), t.u32(), t.u32(), i, a, i + o, a + s);
23038
23052
  }
23039
- function Gt(e, t, n, r) {
23053
+ function qt(e, t, n, r) {
23040
23054
  t.skip(16);
23041
23055
  let i = t.i32(), a = t.i32();
23042
23056
  t.i32(), t.i32(), t.i32(), t.i32();
23043
23057
  let o = t.u32(), s = t.u32(), c = t.u32(), l = t.u32();
23044
23058
  t.u32(), t.u32();
23045
23059
  let u = t.i32(), d = t.i32();
23046
- Ut(e, n, r, o, s, c, l, i, a, i + u, a + d);
23060
+ Gt(e, n, r, o, s, c, l, i, a, i + u, a + d);
23047
23061
  }
23048
- function Kt(e, t, n, r, i = {}) {
23062
+ function Jt(e, t, n, r, i = {}) {
23049
23063
  if (!_(e) || n <= 0 || r <= 0) return !1;
23050
23064
  let a = new DataView(e.buffer, e.byteOffset, e.byteLength), o = {
23051
23065
  ctx: t,
@@ -23055,7 +23069,7 @@ function Kt(e, t, n, r, i = {}) {
23055
23069
  top: 0,
23056
23070
  boundsW: n,
23057
23071
  boundsH: r,
23058
- wt: ot(),
23072
+ wt: ct(),
23059
23073
  mapMode: j.TEXT,
23060
23074
  winOrgX: 0,
23061
23075
  winOrgY: 0,
@@ -23082,14 +23096,14 @@ function Kt(e, t, n, r, i = {}) {
23082
23096
  inPath: !1,
23083
23097
  pathCommandCount: 0,
23084
23098
  pathDiscarded: !1,
23085
- maxPathCommands: Number.isSafeInteger(i.maxPathCommands) && i.maxPathCommands > 0 ? Math.min(i.maxPathCommands, lt) : lt
23099
+ maxPathCommands: Number.isSafeInteger(i.maxPathCommands) && i.maxPathCommands > 0 ? Math.min(i.maxPathCommands, dt) : dt
23086
23100
  }, s = 0;
23087
23101
  for (; s + 8 <= e.length;) {
23088
23102
  let n = a.getUint32(s, !0), r = a.getUint32(s + 4, !0);
23089
23103
  if (r < 8 || r & 3) break;
23090
23104
  let i = s + r;
23091
23105
  if (i > e.length || n === k.EOF) break;
23092
- let c = new ct(a, s + 8, i);
23106
+ let c = new ut(a, s + 8, i);
23093
23107
  try {
23094
23108
  switch (n) {
23095
23109
  case k.HEADER: {
@@ -23108,11 +23122,11 @@ function Kt(e, t, n, r, i = {}) {
23108
23122
  break;
23109
23123
  case k.MODIFYWORLDTRANSFORM: {
23110
23124
  let e = c.xform(), t = c.u32();
23111
- t === 1 ? o.wt = ot() : t === 2 ? o.wt = st(e, o.wt) : t === 3 ? o.wt = st(o.wt, e) : t === 4 && (o.wt = e);
23125
+ t === 1 ? o.wt = ct() : t === 2 ? o.wt = lt(e, o.wt) : t === 3 ? o.wt = lt(o.wt, e) : t === 4 && (o.wt = e);
23112
23126
  break;
23113
23127
  }
23114
23128
  case k.SETMAPMODE:
23115
- Tt(o, c.u32());
23129
+ Dt(o, c.u32());
23116
23130
  break;
23117
23131
  case k.SETWINDOWORGEX:
23118
23132
  o.winOrgX = c.i32(), o.winOrgY = c.i32();
@@ -23179,13 +23193,13 @@ function Kt(e, t, n, r, i = {}) {
23179
23193
  o.inPath = !1;
23180
23194
  break;
23181
23195
  case k.FILLPATH:
23182
- It(o, !0, !1);
23196
+ Rt(o, !0, !1);
23183
23197
  break;
23184
23198
  case k.STROKEANDFILLPATH:
23185
- It(o, !0, !0);
23199
+ Rt(o, !0, !0);
23186
23200
  break;
23187
23201
  case k.STROKEPATH:
23188
- It(o, !1, !0);
23202
+ Rt(o, !1, !0);
23189
23203
  break;
23190
23204
  case k.SELECTCLIPPATH:
23191
23205
  if (!o.pathDiscarded) try {
@@ -23195,7 +23209,7 @@ function Kt(e, t, n, r, i = {}) {
23195
23209
  break;
23196
23210
  case k.SELECTOBJECT: {
23197
23211
  let e = c.u32();
23198
- if (e & 2147483648) Ot(o, e >>> 0);
23212
+ if (e & 2147483648) At(o, e >>> 0);
23199
23213
  else {
23200
23214
  let t = o.objects.get(e);
23201
23215
  t?.kind === "pen" ? o.curPen = t : t?.kind === "brush" ? o.curBrush = t : t?.kind === "font" && (o.curFont = t);
@@ -23208,72 +23222,72 @@ function Kt(e, t, n, r, i = {}) {
23208
23222
  break;
23209
23223
  }
23210
23224
  case k.CREATEPEN: {
23211
- let [e, t] = Lt(c);
23225
+ let [e, t] = zt(c);
23212
23226
  o.objects.set(e, t);
23213
23227
  break;
23214
23228
  }
23215
23229
  case k.EXTCREATEPEN: {
23216
- let [e, t] = Rt(c);
23230
+ let [e, t] = Bt(c);
23217
23231
  o.objects.set(e, t);
23218
23232
  break;
23219
23233
  }
23220
23234
  case k.CREATEBRUSHINDIRECT: {
23221
- let [e, t] = zt(c);
23235
+ let [e, t] = Vt(c);
23222
23236
  o.objects.set(e, t);
23223
23237
  break;
23224
23238
  }
23225
23239
  case k.CREATEMONOBRUSH:
23226
23240
  case k.CREATEDIBPATTERNBRUSHPT: {
23227
- let [e, t] = Bt(c, a, s);
23241
+ let [e, t] = Ht(c, a, s);
23228
23242
  o.objects.set(e, t);
23229
23243
  break;
23230
23244
  }
23231
23245
  case k.EXTCREATEFONTINDIRECTW: {
23232
- let [e, t] = Vt(c, a, s);
23246
+ let [e, t] = Ut(c, a, s);
23233
23247
  o.objects.set(e, t);
23234
23248
  break;
23235
23249
  }
23236
23250
  case k.POLYLINE16:
23237
- At(o, c, F);
23251
+ Mt(o, c, F);
23238
23252
  break;
23239
23253
  case k.POLYLINE:
23240
- At(o, c, I);
23254
+ Mt(o, c, I);
23241
23255
  break;
23242
23256
  case k.POLYLINETO16:
23243
- jt(o, c, F);
23257
+ Nt(o, c, F);
23244
23258
  break;
23245
23259
  case k.POLYLINETO:
23246
- jt(o, c, I);
23260
+ Nt(o, c, I);
23247
23261
  break;
23248
23262
  case k.POLYGON16:
23249
- Mt(o, c, F);
23263
+ Pt(o, c, F);
23250
23264
  break;
23251
23265
  case k.POLYGON:
23252
- Mt(o, c, I);
23266
+ Pt(o, c, I);
23253
23267
  break;
23254
23268
  case k.POLYBEZIER16:
23255
- Nt(o, c, F, !1);
23269
+ Ft(o, c, F, !1);
23256
23270
  break;
23257
23271
  case k.POLYBEZIER:
23258
- Nt(o, c, I, !1);
23272
+ Ft(o, c, I, !1);
23259
23273
  break;
23260
23274
  case k.POLYBEZIERTO16:
23261
- Nt(o, c, F, !0);
23275
+ Ft(o, c, F, !0);
23262
23276
  break;
23263
23277
  case k.POLYBEZIERTO:
23264
- Nt(o, c, I, !0);
23278
+ Ft(o, c, I, !0);
23265
23279
  break;
23266
23280
  case k.POLYPOLYGON16:
23267
- Pt(o, c, F, !0);
23281
+ It(o, c, F, !0);
23268
23282
  break;
23269
23283
  case k.POLYPOLYGON:
23270
- Pt(o, c, I, !0);
23284
+ It(o, c, I, !0);
23271
23285
  break;
23272
23286
  case k.POLYPOLYLINE16:
23273
- Pt(o, c, F, !1);
23287
+ It(o, c, F, !1);
23274
23288
  break;
23275
23289
  case k.POLYPOLYLINE:
23276
- Pt(o, c, I, !1);
23290
+ It(o, c, I, !1);
23277
23291
  break;
23278
23292
  case k.MOVETOEX:
23279
23293
  if (o.curX = c.i32(), o.curY = c.i32(), o.inPath && M(o, 1)) {
@@ -23294,7 +23308,7 @@ function Kt(e, t, n, r, i = {}) {
23294
23308
  break;
23295
23309
  }
23296
23310
  case k.RECTANGLE:
23297
- Ft(o, c.i32(), c.i32(), c.i32(), c.i32());
23311
+ Lt(o, c.i32(), c.i32(), c.i32(), c.i32());
23298
23312
  break;
23299
23313
  case k.ELLIPSE: {
23300
23314
  let e = c.i32(), n = c.i32(), r = c.i32(), i = c.i32(), [a, s] = [(e + r) / 2, (n + i) / 2], [l, u] = N(o, a, s), [d] = N(o, r, s), [, f] = N(o, a, i), p = Math.abs(d - l), m = Math.abs(f - u);
@@ -23314,13 +23328,13 @@ function Kt(e, t, n, r, i = {}) {
23314
23328
  o.bkMode = c.u32();
23315
23329
  break;
23316
23330
  case k.EXTTEXTOUTW:
23317
- Ht(o, c, a, s);
23331
+ Wt(o, c, a, s);
23318
23332
  break;
23319
23333
  case k.BITBLT:
23320
- Wt(o, c, a, s);
23334
+ Kt(o, c, a, s);
23321
23335
  break;
23322
23336
  case k.STRETCHDIBITS:
23323
- Gt(o, c, a, s);
23337
+ qt(o, c, a, s);
23324
23338
  break;
23325
23339
  default: break;
23326
23340
  }
@@ -23329,57 +23343,57 @@ function Kt(e, t, n, r, i = {}) {
23329
23343
  }
23330
23344
  return o.drew;
23331
23345
  }
23332
- async function qt(e, t, n) {
23346
+ async function Yt(e, t, n) {
23333
23347
  if (!_(e) || t <= 0 || n <= 0) return null;
23334
23348
  let r = i(t, n);
23335
23349
  if (!r) return null;
23336
23350
  let a = r.getContext("2d");
23337
- return !a || (a.lineJoin = "round", a.lineCap = "round", !Kt(e, a, t, n)) ? null : createImageBitmap(r);
23351
+ return !a || (a.lineJoin = "round", a.lineCap = "round", !Jt(e, a, t, n)) ? null : createImageBitmap(r);
23338
23352
  }
23339
- function Jt(e) {
23353
+ function Xt(e) {
23340
23354
  let t = e.close;
23341
23355
  typeof t == "function" && t.call(e);
23342
23356
  }
23343
- function Yt(e, t) {
23357
+ function Zt(e, t) {
23344
23358
  return e[t] << 8 | e[t + 1];
23345
23359
  }
23346
- function Xt(e, t) {
23360
+ function Qt(e, t) {
23347
23361
  return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0;
23348
23362
  }
23349
- function Zt(e, t) {
23363
+ function $t(e, t) {
23350
23364
  return e[t] | e[t + 1] << 8;
23351
23365
  }
23352
- function Qt(e, t) {
23366
+ function en(e, t) {
23353
23367
  return e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24 | 0;
23354
23368
  }
23355
- function $t(e) {
23369
+ function tn(e) {
23356
23370
  let t = e.length;
23357
23371
  return t >= 24 && e[0] === 137 && e[1] === 80 && e[2] === 78 && e[3] === 71 && e[4] === 13 && e[5] === 10 && e[6] === 26 && e[7] === 10 ? e[12] === 73 && e[13] === 72 && e[14] === 68 && e[15] === 82 ? {
23358
- width: Xt(e, 16),
23359
- height: Xt(e, 20)
23372
+ width: Qt(e, 16),
23373
+ height: Qt(e, 20)
23360
23374
  } : null : t >= 10 && e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97 ? {
23361
- width: Zt(e, 6),
23362
- height: Zt(e, 8)
23363
- } : t >= 26 && e[0] === 66 && e[1] === 77 ? en(e, 14) === 12 ? {
23364
- width: Zt(e, 18),
23365
- height: Zt(e, 20)
23375
+ width: $t(e, 6),
23376
+ height: $t(e, 8)
23377
+ } : t >= 26 && e[0] === 66 && e[1] === 77 ? nn(e, 14) === 12 ? {
23378
+ width: $t(e, 18),
23379
+ height: $t(e, 20)
23366
23380
  } : {
23367
- width: Math.abs(Qt(e, 18)),
23368
- height: Math.abs(Qt(e, 22))
23369
- } : t >= 16 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ? tn(e) : t >= 4 && e[0] === 255 && e[1] === 216 ? an(e) : t >= 4 && (e[0] === 73 && e[1] === 73 || e[0] === 77 && e[1] === 77) ? S(e) : null;
23381
+ width: Math.abs(en(e, 18)),
23382
+ height: Math.abs(en(e, 22))
23383
+ } : t >= 16 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ? rn(e) : t >= 4 && e[0] === 255 && e[1] === 216 ? sn(e) : t >= 4 && (e[0] === 73 && e[1] === 73 || e[0] === 77 && e[1] === 77) ? S(e) : null;
23370
23384
  }
23371
- function en(e, t) {
23385
+ function nn(e, t) {
23372
23386
  return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
23373
23387
  }
23374
- function tn(e) {
23388
+ function rn(e) {
23375
23389
  let t = e.length, n = e[12], r = e[13], i = e[14], a = e[15];
23376
23390
  if (n === 86 && r === 80 && i === 56 && a === 32) return t < 30 ? null : {
23377
- width: Zt(e, 26) & 16383,
23378
- height: Zt(e, 28) & 16383
23391
+ width: $t(e, 26) & 16383,
23392
+ height: $t(e, 28) & 16383
23379
23393
  };
23380
23394
  if (n === 86 && r === 80 && i === 56 && a === 76) {
23381
23395
  if (t < 25 || e[20] !== 47) return null;
23382
- let n = en(e, 21);
23396
+ let n = nn(e, 21);
23383
23397
  return {
23384
23398
  width: (n & 16383) + 1,
23385
23399
  height: (n >>> 14 & 16383) + 1
@@ -23390,11 +23404,11 @@ function tn(e) {
23390
23404
  height: (e[27] | e[28] << 8 | e[29] << 16) + 1
23391
23405
  } : null;
23392
23406
  }
23393
- function nn(e) {
23407
+ function an(e) {
23394
23408
  return e.length >= 6 && e[0] === 69 && e[1] === 120 && e[2] === 105 && e[3] === 102 && e[4] === 0 && e[5] === 0;
23395
23409
  }
23396
- function rn(e) {
23397
- if (e.length < 14 || !nn(e)) return null;
23410
+ function on(e) {
23411
+ if (e.length < 14 || !an(e)) return null;
23398
23412
  let t = e[6] === 73 && e[7] === 73, n = e[6] === 77 && e[7] === 77;
23399
23413
  if (!t && !n) return null;
23400
23414
  let r = new DataView(e.buffer, e.byteOffset, e.byteLength);
@@ -23416,7 +23430,7 @@ function L(e, t) {
23416
23430
  height: e.width
23417
23431
  } : e;
23418
23432
  }
23419
- function an(e) {
23433
+ function sn(e) {
23420
23434
  let t = e.length, n = 2, r = null, i = !1, a = null;
23421
23435
  for (; n + 1 < t;) {
23422
23436
  if (e[n] !== 255) {
@@ -23434,10 +23448,10 @@ function an(e) {
23434
23448
  }
23435
23449
  if (o === 217 || o === 218) return a ? L(a, r) : null;
23436
23450
  if (n + 3 >= t) return null;
23437
- let s = Yt(e, n + 2);
23451
+ let s = Zt(e, n + 2);
23438
23452
  if (o >= 192 && o <= 207 && o !== 196 && o !== 200 && o !== 204) {
23439
23453
  if (s < 7 || n + 8 >= t) return null;
23440
- let r = Yt(e, n + 5), i = Yt(e, n + 7);
23454
+ let r = Zt(e, n + 5), i = Zt(e, n + 7);
23441
23455
  a ??= {
23442
23456
  width: i,
23443
23457
  height: r
@@ -23448,21 +23462,21 @@ function an(e) {
23448
23462
  if (c > t) return a ? L(a, r) : null;
23449
23463
  if (o === 225 && !i) {
23450
23464
  let t = e.subarray(n + 4, c);
23451
- nn(t) && (i = !0, r = rn(t));
23465
+ an(t) && (i = !0, r = on(t));
23452
23466
  }
23453
23467
  n = c;
23454
23468
  }
23455
23469
  return a ? L(a, r) : null;
23456
23470
  }
23457
- function on(t) {
23471
+ function cn(t) {
23458
23472
  let { width: n, height: r } = t;
23459
23473
  return !Number.isFinite(n) || !Number.isFinite(r) || n <= 0 || r <= 0 || n > 32767 || r > 32767 ? !0 : n * r > e;
23460
23474
  }
23461
- function sn(e) {
23475
+ function ln(e) {
23462
23476
  let { width: t, height: n } = e;
23463
23477
  return !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 || t > 134217728 || n > 134217728 ? !0 : t * n > p;
23464
23478
  }
23465
- function cn(e) {
23479
+ function un(e) {
23466
23480
  switch (e.split(";", 1)[0]?.trim().toLowerCase()) {
23467
23481
  case "image/png":
23468
23482
  case "image/jpeg":
@@ -23474,17 +23488,17 @@ function cn(e) {
23474
23488
  default: return !1;
23475
23489
  }
23476
23490
  }
23477
- function ln(e, t = !1) {
23491
+ function dn(e, t = !1) {
23478
23492
  return e !== null && e !== "wmf" && e !== "emf" && (e !== "tiff" || t);
23479
23493
  }
23480
- var un = 64 * 1024;
23481
- function dn(e) {
23494
+ var fn = 64 * 1024;
23495
+ function pn(e) {
23482
23496
  return n(e) ? "wmf" : _(e) ? "emf" : e.length >= 8 && e[0] === 137 && e[1] === 80 && e[2] === 78 && e[3] === 71 && e[4] === 13 && e[5] === 10 && e[6] === 26 && e[7] === 10 ? "png" : e.length >= 2 && e[0] === 255 && e[1] === 216 ? "jpeg" : e.length >= 6 && e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97 ? "gif" : e.length >= 2 && e[0] === 66 && e[1] === 77 ? "bmp" : e.length >= 12 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ? "webp" : x(e) ? "tiff" : null;
23483
23497
  }
23484
- function fn(e) {
23498
+ function mn(e) {
23485
23499
  return e >= 192 && e <= 207 && e !== 196 && e !== 200 && e !== 204;
23486
23500
  }
23487
- async function pn(e) {
23501
+ async function hn(e) {
23488
23502
  let t = e.slice(2).stream().getReader(), n = !1, r = -1, i = -1, a = 0, o = null, s = 0, c = 0, l = null, u = null, d = 0, f = null, p = !1;
23489
23503
  try {
23490
23504
  for (;;) {
@@ -23503,7 +23517,7 @@ async function pn(e) {
23503
23517
  continue;
23504
23518
  }
23505
23519
  if (u) {
23506
- if (u[d++] = m, d === u.length && (nn(u) && (p = !0, f = rn(u)), u = null, d = 0, p && l)) return await t.cancel(), L(l, f);
23520
+ if (u[d++] = m, d === u.length && (an(u) && (p = !0, f = on(u)), u = null, d = 0, p && l)) return await t.cancel(), L(l, f);
23507
23521
  continue;
23508
23522
  }
23509
23523
  if (a > 0) {
@@ -23517,7 +23531,7 @@ async function pn(e) {
23517
23531
  }
23518
23532
  let e = i << 8 | m;
23519
23533
  if (e < 2) return null;
23520
- if (fn(r)) {
23534
+ if (mn(r)) {
23521
23535
  if (e < 7) return null;
23522
23536
  l ? a = e - 2 : (o = new Uint8Array(5), s = 0, c = e - 7);
23523
23537
  } else r === 225 && !p && e > 2 ? (u = new Uint8Array(e - 2), d = 0) : a = e - 2;
@@ -23538,7 +23552,7 @@ async function pn(e) {
23538
23552
  t.releaseLock();
23539
23553
  }
23540
23554
  }
23541
- async function mn(e, t) {
23555
+ async function gn(e, t) {
23542
23556
  if (t.length < 8 || !x(t)) return null;
23543
23557
  let n = t[0] === 73, r = new DataView(t.buffer, t.byteOffset, t.byteLength).getUint32(4, n);
23544
23558
  if (!Number.isSafeInteger(r) || r < 8 || r > e.size - 2) return null;
@@ -23560,34 +23574,34 @@ async function mn(e, t) {
23560
23574
  height: u
23561
23575
  };
23562
23576
  }
23563
- async function hn(e, t) {
23564
- let n = t ?? new Uint8Array(await e.slice(0, un).arrayBuffer()), r = dn(n);
23577
+ async function _n(e, t) {
23578
+ let n = t ?? new Uint8Array(await e.slice(0, fn).arrayBuffer()), r = pn(n);
23565
23579
  if (!r) return {
23566
23580
  format: null,
23567
23581
  dimensions: null
23568
23582
  };
23569
- let i = $t(n);
23583
+ let i = tn(n);
23570
23584
  return r === "jpeg" ? {
23571
23585
  format: r,
23572
- dimensions: await pn(e) ?? i
23586
+ dimensions: await hn(e) ?? i
23573
23587
  } : i ? {
23574
23588
  format: r,
23575
23589
  dimensions: i
23576
23590
  } : r === "tiff" ? {
23577
23591
  format: r,
23578
- dimensions: await mn(e, n)
23592
+ dimensions: await gn(e, n)
23579
23593
  } : {
23580
23594
  format: r,
23581
23595
  dimensions: null
23582
23596
  };
23583
23597
  }
23584
- var gn = class e extends Error {
23598
+ var vn = class e extends Error {
23585
23599
  code = "ooxml-optional-image-codec-unavailable";
23586
23600
  constructor(t) {
23587
23601
  super(`${t.toUpperCase()} image requires an optional codec`), this.codec = t, this.name = "OptionalImageCodecUnavailableError", Object.setPrototypeOf(this, e.prototype);
23588
23602
  }
23589
23603
  };
23590
- function _n(e, t) {
23604
+ function yn(e, t) {
23591
23605
  if (typeof e != "object" || !e) return !1;
23592
23606
  try {
23593
23607
  let n = e;
@@ -23596,8 +23610,8 @@ function _n(e, t) {
23596
23610
  return !1;
23597
23611
  }
23598
23612
  }
23599
- var vn = { tiff: "TIFF image unavailable" };
23600
- function yn(e, t, n) {
23613
+ var bn = { tiff: "TIFF image unavailable" };
23614
+ function xn(e, t, n) {
23601
23615
  if (!(![
23602
23616
  n.x,
23603
23617
  n.y,
@@ -23607,21 +23621,21 @@ function yn(e, t, n) {
23607
23621
  e.save();
23608
23622
  try {
23609
23623
  e.fillStyle = "#888", e.font = "11px sans-serif", e.textAlign = "center", e.textBaseline = "middle";
23610
- let r = vn[t];
23624
+ let r = bn[t];
23611
23625
  e.fillText(r, n.x + n.width / 2, n.y + n.height / 2, n.width);
23612
23626
  } finally {
23613
23627
  e.restore();
23614
23628
  }
23615
23629
  }
23616
23630
  }
23617
- function bn(e, t) {
23631
+ function Sn(e, t) {
23618
23632
  return e.width <= 0 || e.height <= 0 || e.width > 32767 || e.height > 32767 || e.width * e.height > t;
23619
23633
  }
23620
- function xn(e) {
23634
+ function Cn(e) {
23621
23635
  let t = e.split(";", 1)[0]?.trim().toLowerCase();
23622
23636
  return t === "image/tiff" || t === "image/x-tiff";
23623
23637
  }
23624
- function Sn(e, t, n, r = !1) {
23638
+ function wn(e, t, n, r = !1) {
23625
23639
  let i = {
23626
23640
  retainedDimensions: e,
23627
23641
  resizeOptions: null
@@ -23635,31 +23649,31 @@ function Sn(e, t, n, r = !1) {
23635
23649
  }
23636
23650
  } : i;
23637
23651
  }
23638
- function Cn(e, t, n) {
23652
+ function Tn(e, t, n) {
23639
23653
  let r = Math.max(e.width, e.height);
23640
23654
  if (!Number.isFinite(r) || r > t) return new h("image-dimension", t, Number.isFinite(r) ? r : 2 ** 53 - 1);
23641
23655
  let i = e.width * e.height;
23642
23656
  return new h("image-pixels", n, Number.isSafeInteger(i) && i >= 0 ? i : 2 ** 53 - 1);
23643
23657
  }
23644
- async function wn(e, t = {}) {
23645
- return Tn(e, t);
23658
+ async function En(e, t = {}) {
23659
+ return Dn(e, t);
23646
23660
  }
23647
- async function Tn(r, i = {}, o) {
23661
+ async function Dn(r, i = {}, o) {
23648
23662
  let { widthPt: s = 0, heightPt: c = 0, suppressBoundaryFrame: d = !1, tiff: f, targetWidthPx: h, targetHeightPx: g, maxRetainedPixels: y = e } = i, S = Number.isSafeInteger(y) && y > 0 ? Math.min(y, e) : e, C = new Uint8Array(await r.slice(0, 64 * 1024).arrayBuffer());
23649
23663
  if (n(C)) {
23650
23664
  let { w: e, h: n } = t(s, c);
23651
- return En(await u(new Uint8Array(await r.arrayBuffer()), e, n, d), S);
23665
+ return On(await u(new Uint8Array(await r.arrayBuffer()), e, n, d), S);
23652
23666
  }
23653
23667
  if (_(C)) {
23654
23668
  let { w: e, h: n } = t(s, c);
23655
- return En(await qt(new Uint8Array(await r.arrayBuffer()), e, n), S);
23669
+ return On(await Yt(new Uint8Array(await r.arrayBuffer()), e, n), S);
23656
23670
  }
23657
- let ee = (o ?? await hn(r, C)).dimensions;
23658
- if (ee && sn(ee)) throw Cn(ee, l, p);
23659
- let te = x(C) || xn(r.type), ne = ee ? Sn(ee, h, g, te) : null;
23660
- if (ne && bn(ne.retainedDimensions, S)) throw Cn(ne.retainedDimensions, a, S);
23671
+ let ee = (o ?? await _n(r, C)).dimensions;
23672
+ if (ee && ln(ee)) throw Tn(ee, l, p);
23673
+ let te = x(C) || Cn(r.type), ne = ee ? wn(ee, h, g, te) : null;
23674
+ if (ne && Sn(ne.retainedDimensions, S)) throw Tn(ne.retainedDimensions, a, S);
23661
23675
  if (te) {
23662
- if (!f) throw new gn("tiff");
23676
+ if (!f) throw new vn("tiff");
23663
23677
  let e;
23664
23678
  try {
23665
23679
  e = await f.render(new Uint8Array(await r.arrayBuffer()), {
@@ -23671,34 +23685,34 @@ async function Tn(r, i = {}, o) {
23671
23685
  throw m(e) || b(e) ? e : new v("TIFF codec failed to decode the image", { cause: e });
23672
23686
  }
23673
23687
  if (!e) throw new v("TIFF codec failed to decode the image");
23674
- return En(e, S);
23688
+ return On(e, S);
23675
23689
  }
23676
- return En(ne?.resizeOptions ? await createImageBitmap(r, ne.resizeOptions) : await createImageBitmap(r), S);
23690
+ return On(ne?.resizeOptions ? await createImageBitmap(r, ne.resizeOptions) : await createImageBitmap(r), S);
23677
23691
  }
23678
- function En(t, n = e) {
23692
+ function On(t, n = e) {
23679
23693
  if (!t) return null;
23680
23694
  let r = {
23681
23695
  width: Number(t.width),
23682
23696
  height: Number(t.height)
23683
23697
  };
23684
- if (!bn(r, n)) return t;
23685
- throw Jt(t), Cn(r, a, n);
23698
+ if (!Sn(r, n)) return t;
23699
+ throw Xt(t), Tn(r, a, n);
23686
23700
  }
23687
- var Dn = /* @__PURE__ */ new WeakMap();
23688
- async function On(e, t) {
23689
- let n = Dn.get(e);
23701
+ var kn = /* @__PURE__ */ new WeakMap();
23702
+ async function An(e, t) {
23703
+ let n = kn.get(e);
23690
23704
  n || (n = {
23691
23705
  active: 0,
23692
23706
  waiters: []
23693
- }, Dn.set(e, n)), n.active >= 2 || n.waiters.length > 0 ? await new Promise((e) => n.waiters.push(e)) : n.active++;
23707
+ }, kn.set(e, n)), n.active >= 2 || n.waiters.length > 0 ? await new Promise((e) => n.waiters.push(e)) : n.active++;
23694
23708
  try {
23695
23709
  return await Promise.resolve(), await t();
23696
23710
  } finally {
23697
23711
  let t = n.waiters.shift();
23698
- t ? t() : (n.active--, n.active === 0 && Dn.delete(e));
23712
+ t ? t() : (n.active--, n.active === 0 && kn.delete(e));
23699
23713
  }
23700
23714
  }
23701
- function kn(e = void 0) {
23715
+ function jn(e = void 0) {
23702
23716
  if (e !== void 0 && (typeof e != "object" || !e || Array.isArray(e))) throw TypeError("imageResources must be an object when provided");
23703
23717
  let t = e?.decodedByteBudget ?? 134217728;
23704
23718
  if (!Number.isSafeInteger(t) || t < 4 || t > 536870912) throw RangeError(`imageResources.decodedByteBudget must be a safe integer from 4 to ${s} bytes`);
@@ -23712,13 +23726,13 @@ function kn(e = void 0) {
23712
23726
  resolution: r
23713
23727
  });
23714
23728
  }
23715
- function An(e) {
23729
+ function Mn(e) {
23716
23730
  return Number.isFinite(e) && e > 0 ? Math.max(1, Math.ceil(e)) : 1;
23717
23731
  }
23718
- function jn(e) {
23732
+ function Nn(e) {
23719
23733
  return Number.isSafeInteger(e) && (e ?? 0) > 0 ? e : 1;
23720
23734
  }
23721
- function Mn(e, t) {
23735
+ function Pn(e, t) {
23722
23736
  let n = 0;
23723
23737
  for (let r of e.values()) {
23724
23738
  let e = t(r), i = e.width * e.height * r.surfaces * 4;
@@ -23726,10 +23740,10 @@ function Mn(e, t) {
23726
23740
  }
23727
23741
  return n;
23728
23742
  }
23729
- function Nn(t, n) {
23743
+ function Fn(t, n) {
23730
23744
  let r = /* @__PURE__ */ new Map();
23731
23745
  for (let e of t) {
23732
- let t = An(e.targetWidthPx), n = An(e.targetHeightPx), i = e.sourceWidthPx !== void 0 && e.sourceHeightPx !== void 0, a = i ? An(e.sourceWidthPx) : void 0, o = i ? An(e.sourceHeightPx) : void 0, s = jn(e.retainedSurfaceCount), c = r.get(e.key);
23746
+ let t = Mn(e.targetWidthPx), n = Mn(e.targetHeightPx), i = e.sourceWidthPx !== void 0 && e.sourceHeightPx !== void 0, a = i ? Mn(e.sourceWidthPx) : void 0, o = i ? Mn(e.sourceHeightPx) : void 0, s = Nn(e.retainedSurfaceCount), c = r.get(e.key);
23733
23747
  c ? (c.targetWidth = Math.max(c.targetWidth, t), c.targetHeight = Math.max(c.targetHeight, n), a !== void 0 && o !== void 0 && (c.sourceWidth = Math.max(c.sourceWidth ?? 0, a), c.sourceHeight = Math.max(c.sourceHeight ?? 0, o)), c.surfaces = Math.max(c.surfaces, s)) : r.set(e.key, {
23734
23748
  targetWidth: t,
23735
23749
  targetHeight: n,
@@ -23762,10 +23776,10 @@ function Nn(t, n) {
23762
23776
  retainedPixels: s,
23763
23777
  maxRetainedPixels: n ?? s
23764
23778
  });
23765
- }, c = Mn(r, i), l = [...r.values()].every((t) => {
23779
+ }, c = Pn(r, i), l = [...r.values()].every((t) => {
23766
23780
  let n = i(t);
23767
23781
  return n.width * n.height <= e;
23768
- }), u = [...r.values()].some((e) => e.sourceWidth === void 0 || e.sourceHeight === void 0), d = n.resolution === "native-if-fit" && !u && l && c <= n.decodedByteBudget, f = Mn(r, (e) => o(e, 1));
23782
+ }), u = [...r.values()].some((e) => e.sourceWidth === void 0 || e.sourceHeight === void 0), d = n.resolution === "native-if-fit" && !u && l && c <= n.decodedByteBudget, f = Pn(r, (e) => o(e, 1));
23769
23783
  if (d) {
23770
23784
  let e = /* @__PURE__ */ new Map();
23771
23785
  for (let [t, n] of r) {
@@ -23810,7 +23824,7 @@ function Nn(t, n) {
23810
23824
  }
23811
23825
  if (n.strategy === "strict" && f > n.decodedByteBudget) throw new h("active-decoded-bytes", n.decodedByteBudget, f);
23812
23826
  if (n.strategy === "adaptive") {
23813
- let e = Mn(r, (e) => o(e, 0));
23827
+ let e = Pn(r, (e) => o(e, 0));
23814
23828
  if (e > n.decodedByteBudget) throw new h("active-decoded-bytes", n.decodedByteBudget, e);
23815
23829
  }
23816
23830
  let p = 1;
@@ -23818,13 +23832,13 @@ function Nn(t, n) {
23818
23832
  let e = 0, t = 1;
23819
23833
  for (let i = 0; i < 40; i++) {
23820
23834
  let i = (e + t) / 2;
23821
- Mn(r, (e) => o(e, i)) <= n.decodedByteBudget ? e = i : t = i;
23835
+ Pn(r, (e) => o(e, i)) <= n.decodedByteBudget ? e = i : t = i;
23822
23836
  }
23823
23837
  p = e;
23824
23838
  }
23825
23839
  let m = /* @__PURE__ */ new Map();
23826
23840
  for (let [e, t] of r) m.set(e, s(t, p));
23827
- let g = Mn(r, (e) => o(e, p)), _ = p < 1 && r.size > 0 ? Math.min(...[...r.entries()].flatMap(([e, t]) => {
23841
+ let g = Pn(r, (e) => o(e, p)), _ = p < 1 && r.size > 0 ? Math.min(...[...r.entries()].flatMap(([e, t]) => {
23828
23842
  let n = m.get(e);
23829
23843
  return [n.width / t.targetWidth, n.height / t.targetHeight];
23830
23844
  })) : p;
@@ -23836,48 +23850,48 @@ function Nn(t, n) {
23836
23850
  degraded: p < 1
23837
23851
  });
23838
23852
  }
23839
- function Pn(e) {
23853
+ function In(e) {
23840
23854
  return typeof e == "object" && !!e || typeof e == "function";
23841
23855
  }
23842
- var Fn = 256, R = /* @__PURE__ */ new WeakMap(), In = /* @__PURE__ */ new WeakMap(), Ln = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap();
23843
- function zn(e) {
23844
- return Ln.get(e) ?? 0;
23856
+ var Ln = 256, R = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), zn = /* @__PURE__ */ new WeakMap(), Bn = /* @__PURE__ */ new WeakMap();
23857
+ function Vn(e) {
23858
+ return zn.get(e) ?? 0;
23845
23859
  }
23846
- function Bn(e, t) {
23847
- return Rn.get(e)?.get(t) ?? 0;
23860
+ function Hn(e, t) {
23861
+ return Bn.get(e)?.get(t) ?? 0;
23848
23862
  }
23849
- function Vn(e, t) {
23850
- if (zn(e) !== t) throw Error("Decoded bitmap cache was dropped during raster inspection");
23863
+ function Un(e, t) {
23864
+ if (Vn(e) !== t) throw Error("Decoded bitmap cache was dropped during raster inspection");
23851
23865
  }
23852
- function Hn(e, t) {
23866
+ function Wn(e, t) {
23853
23867
  return {
23854
23868
  owner: e,
23855
- ownerGeneration: zn(e),
23869
+ ownerGeneration: Vn(e),
23856
23870
  namespace: t,
23857
- namespaceGeneration: Bn(e, t)
23871
+ namespaceGeneration: Hn(e, t)
23858
23872
  };
23859
23873
  }
23860
- function Un(e, t) {
23861
- if (t.owner !== e || zn(e) !== t.ownerGeneration) throw Error("Decoded bitmap cache was dropped during a derived image operation");
23874
+ function Gn(e, t) {
23875
+ if (t.owner !== e || Vn(e) !== t.ownerGeneration) throw Error("Decoded bitmap cache was dropped during a derived image operation");
23862
23876
  }
23863
- function Wn(e, t, n) {
23864
- if (Un(e, n), n.namespace !== t || Bn(e, t) !== n.namespaceGeneration) throw Error("Decoded bitmap cache namespace was dropped during a derived image operation");
23877
+ function Kn(e, t, n) {
23878
+ if (Gn(e, n), n.namespace !== t || Hn(e, t) !== n.namespaceGeneration) throw Error("Decoded bitmap cache namespace was dropped during a derived image operation");
23865
23879
  }
23866
- function Gn(e) {
23867
- let t = In.get(e);
23880
+ function qn(e) {
23881
+ let t = Rn.get(e);
23868
23882
  if (t) for (let e of t.values()) e.then((e) => {
23869
23883
  e.initialBlob = void 0;
23870
23884
  }).catch(() => {});
23871
23885
  }
23872
- function Kn(e, t, n, r) {
23873
- let i = In.get(e);
23874
- i || (i = /* @__PURE__ */ new Map(), In.set(e, i));
23886
+ function Jn(e, t, n, r) {
23887
+ let i = Rn.get(e);
23888
+ i || (i = /* @__PURE__ */ new Map(), Rn.set(e, i));
23875
23889
  let a = i.get(t);
23876
23890
  if (a) return a;
23877
- let o = On(e, async () => {
23891
+ let o = An(e, async () => {
23878
23892
  let e = await r(t, n);
23879
23893
  return {
23880
- inspection: await hn(e),
23894
+ inspection: await _n(e),
23881
23895
  initialBlob: e
23882
23896
  };
23883
23897
  }).catch((e) => {
@@ -23885,10 +23899,10 @@ function Kn(e, t, n, r) {
23885
23899
  });
23886
23900
  return i.set(t, o), o;
23887
23901
  }
23888
- async function qn(e, t, n, r = n) {
23889
- return (await Kn(r, e, t, n)).inspection;
23902
+ async function Yn(e, t, n, r = n) {
23903
+ return (await Jn(r, e, t, n)).inspection;
23890
23904
  }
23891
- function Jn(e) {
23905
+ function Xn(e) {
23892
23906
  let t = R.get(e);
23893
23907
  return t || (t = {
23894
23908
  entries: /* @__PURE__ */ new Map(),
@@ -23896,9 +23910,9 @@ function Jn(e) {
23896
23910
  retainedLimit: 134217728
23897
23911
  }, R.set(e, t)), t;
23898
23912
  }
23899
- var Yn = /* @__PURE__ */ new WeakMap(), Xn = /* @__PURE__ */ new WeakMap();
23900
- async function Zn(e, t, n) {
23901
- let r = Xn.get(e);
23913
+ var Zn = /* @__PURE__ */ new WeakMap(), Qn = /* @__PURE__ */ new WeakMap();
23914
+ async function $n(e, t, n) {
23915
+ let r = Qn.get(e);
23902
23916
  if (!r) {
23903
23917
  let i;
23904
23918
  r = {
@@ -23906,12 +23920,12 @@ async function Zn(e, t, n) {
23906
23920
  i = e;
23907
23921
  }),
23908
23922
  pending: 1
23909
- }, Xn.set(e, r);
23923
+ }, Qn.set(e, r);
23910
23924
  let a;
23911
23925
  try {
23912
- return a = tr(e, t), await n();
23926
+ return a = rr(e, t), await n();
23913
23927
  } finally {
23914
- Gn(e), a?.(), i(), r.pending--, r.pending === 0 && Xn.delete(e);
23928
+ qn(e), a?.(), i(), r.pending--, r.pending === 0 && Qn.delete(e);
23915
23929
  }
23916
23930
  }
23917
23931
  let i = r, a = i.tail.catch(() => {}), o, s = new Promise((e) => {
@@ -23920,22 +23934,22 @@ async function Zn(e, t, n) {
23920
23934
  i.pending++, i.tail = a.then(() => s), await a;
23921
23935
  let c;
23922
23936
  try {
23923
- return c = tr(e, t), await n();
23937
+ return c = rr(e, t), await n();
23924
23938
  } finally {
23925
- Gn(e), c?.(), o(), i.pending--, i.pending === 0 && Xn.delete(e);
23939
+ qn(e), c?.(), o(), i.pending--, i.pending === 0 && Qn.delete(e);
23926
23940
  }
23927
23941
  }
23928
- var Qn = /* @__PURE__ */ new WeakSet();
23929
- function $n(e) {
23930
- !e || Qn.has(e) || (Qn.add(e), Jt(e));
23942
+ var er = /* @__PURE__ */ new WeakSet();
23943
+ function tr(e) {
23944
+ !e || er.has(e) || (er.add(e), Xt(e));
23931
23945
  }
23932
- function er(e) {
23946
+ function nr(e) {
23933
23947
  try {
23934
- $n(e);
23948
+ tr(e);
23935
23949
  } catch {}
23936
23950
  }
23937
- function tr(e, t) {
23938
- let n = kn(t), r = Yn.get(e);
23951
+ function rr(e, t) {
23952
+ let n = jn(t), r = Zn.get(e);
23939
23953
  r || (r = {
23940
23954
  count: 0,
23941
23955
  deferred: [],
@@ -23943,11 +23957,11 @@ function tr(e, t) {
23943
23957
  activeBitmaps: /* @__PURE__ */ new WeakSet(),
23944
23958
  limits: /* @__PURE__ */ new Map(),
23945
23959
  activeLimit: n.decodedByteBudget
23946
- }, Yn.set(e, r));
23960
+ }, Zn.set(e, r));
23947
23961
  let i = r, a = Symbol("decoded-image-lease");
23948
23962
  i.limits.set(a, n.decodedByteBudget), i.activeLimit = Math.min(...i.limits.values());
23949
- let o = Jn(e);
23950
- for (o.retainedLimit = i.activeLimit; o.retainedBytes > o.retainedLimit && ir(e, o););
23963
+ let o = Xn(e);
23964
+ for (o.retainedLimit = i.activeLimit; o.retainedBytes > o.retainedLimit && or(e, o););
23951
23965
  i.count++;
23952
23966
  let s = !1;
23953
23967
  return () => {
@@ -23958,89 +23972,89 @@ function tr(e, t) {
23958
23972
  t && (t.retainedLimit = i.activeLimit);
23959
23973
  return;
23960
23974
  }
23961
- for (let e of i.deferred) e.then((e) => $n(e)).catch(() => {});
23962
- i.deferred = [], i.activeBytes = 0, i.activeBitmaps = /* @__PURE__ */ new WeakSet(), Yn.delete(e);
23975
+ for (let e of i.deferred) e.then((e) => tr(e)).catch(() => {});
23976
+ i.deferred = [], i.activeBytes = 0, i.activeBitmaps = /* @__PURE__ */ new WeakSet(), Zn.delete(e);
23963
23977
  let t = R.get(e);
23964
23978
  t && (t.retainedLimit = 134217728);
23965
23979
  };
23966
23980
  }
23967
- function nr(e) {
23981
+ function ir(e) {
23968
23982
  if (!e) return 0;
23969
23983
  let t = Number(e.width), n = Number(e.height);
23970
23984
  return Number.isSafeInteger(t) && t > 0 && Number.isSafeInteger(n) && n > 0 ? t * n * 4 : 0;
23971
23985
  }
23972
- function rr(e, t) {
23986
+ function ar(e, t) {
23973
23987
  if (!t) return;
23974
- let n = Yn.get(e);
23988
+ let n = Zn.get(e);
23975
23989
  if (!n || n.count === 0 || n.activeBitmaps.has(t)) return;
23976
- let r = n.activeBytes + nr(t);
23990
+ let r = n.activeBytes + ir(t);
23977
23991
  if (r > n.activeLimit) throw new h("active-decoded-bytes", n.activeLimit, r);
23978
23992
  n.activeBitmaps.add(t), n.activeBytes = r;
23979
23993
  }
23980
- function ir(e, t, n) {
23994
+ function or(e, t, n) {
23981
23995
  let r = [...t.entries].find(([e]) => e !== n);
23982
23996
  if (!r) return !1;
23983
23997
  let [i, a] = r;
23984
- return t.entries.delete(i), t.retainedBytes -= a.weight, ar(e, a.ownedPromise), !0;
23998
+ return t.entries.delete(i), t.retainedBytes -= a.weight, sr(e, a.ownedPromise), !0;
23985
23999
  }
23986
- function ar(e, t) {
23987
- let n = Yn.get(e);
24000
+ function sr(e, t) {
24001
+ let n = Zn.get(e);
23988
24002
  if (n && n.count > 0) {
23989
24003
  n.deferred.push(t);
23990
24004
  return;
23991
24005
  }
23992
- t.then((e) => $n(e)).catch(() => {});
24006
+ t.then((e) => tr(e)).catch(() => {});
23993
24007
  }
23994
24008
  function z(e) {
23995
24009
  if (!(typeof e != "number" || !Number.isFinite(e) || !(e > 0))) return Math.ceil(e);
23996
24010
  }
23997
- function or(e) {
24011
+ function cr(e) {
23998
24012
  return {
23999
24013
  ...e,
24000
24014
  targetWidthPx: z(e.targetWidthPx),
24001
24015
  targetHeightPx: z(e.targetHeightPx)
24002
24016
  };
24003
24017
  }
24004
- function sr(e) {
24018
+ function lr(e) {
24005
24019
  let t = e.maxRetainedPixels;
24006
24020
  return typeof t == "number" && Number.isSafeInteger(t) && t > 0 ? Math.min(t, f / 4) : f / 4;
24007
24021
  }
24008
- function cr(e) {
24009
- return sr(e) < f / 4;
24022
+ function ur(e) {
24023
+ return lr(e) < f / 4;
24010
24024
  }
24011
- function lr(e, t) {
24025
+ function dr(e, t) {
24012
24026
  if (!e) return null;
24013
- let n = sr(t), r = Number(e.width), i = Number(e.height), o = Math.max(r, i);
24027
+ let n = lr(t), r = Number(e.width), i = Number(e.height), o = Math.max(r, i);
24014
24028
  if (!Number.isFinite(o) || o > 32767) throw new h("image-dimension", a, Number.isFinite(o) ? o : 2 ** 53 - 1);
24015
24029
  let s = r * i;
24016
24030
  if (!(r > 0) || !(i > 0) || s > n) throw new h("image-pixels", n, Number.isSafeInteger(s) && s >= 0 ? s : 2 ** 53 - 1);
24017
24031
  return e;
24018
24032
  }
24019
24033
  function B(e, t = {}) {
24020
- let n = z(t.targetWidthPx), r = z(t.targetHeightPx), i = `${e.length}:${e}`, a = sr(t);
24034
+ let n = z(t.targetWidthPx), r = z(t.targetHeightPx), i = `${e.length}:${e}`, a = lr(t);
24021
24035
  return n || r ? `raster:${i}:${n ?? 0}x${r ?? 0}:p${a}` : `native:${i}`;
24022
24036
  }
24023
- function ur(e) {
24037
+ function fr(e) {
24024
24038
  return e.inspection.format === "wmf" || e.inspection.format === "emf";
24025
24039
  }
24026
- function dr(e) {
24040
+ function pr(e) {
24027
24041
  let n = t(e.widthPt ?? 0, e.heightPt ?? 0);
24028
24042
  return {
24029
24043
  width: n.w,
24030
24044
  height: n.h,
24031
24045
  suppressBoundaryFrame: e.suppressBoundaryFrame === !0,
24032
- pixelLimit: sr(e)
24046
+ pixelLimit: lr(e)
24033
24047
  };
24034
24048
  }
24035
- function fr(e, t) {
24049
+ function mr(e, t) {
24036
24050
  return `metafile:${`${e.length}:${e}`}:s${+!!t.suppressBoundaryFrame}:p${t.pixelLimit}:`;
24037
24051
  }
24038
- function pr(e, t, n) {
24039
- let r = dr(t), i = z(n?.width) ?? r.width, a = z(n?.height) ?? r.height;
24040
- return `${fr(e, r)}${i}x${a}`;
24052
+ function hr(e, t, n) {
24053
+ let r = pr(t), i = z(n?.width) ?? r.width, a = z(n?.height) ?? r.height;
24054
+ return `${mr(e, r)}${i}x${a}`;
24041
24055
  }
24042
- function mr(e, t, n) {
24043
- let r = dr(n), i = `${V}${fr(t, r)}`, a;
24056
+ function gr(e, t, n) {
24057
+ let r = pr(n), i = `${V}${mr(t, r)}`, a;
24044
24058
  for (let t of R.get(e)?.entries.keys() ?? []) {
24045
24059
  if (!t.startsWith(i)) continue;
24046
24060
  let e = /^(\d+)x(\d+)$/.exec(t.slice(i.length));
@@ -24055,10 +24069,10 @@ function mr(e, t, n) {
24055
24069
  }
24056
24070
  return a?.key;
24057
24071
  }
24058
- function hr(e, t, n, r) {
24072
+ function _r(e, t, n, r) {
24059
24073
  let i = z(n.targetWidthPx), a = z(n.targetHeightPx);
24060
24074
  if (!i && !a) return;
24061
- let o = sr(n), s = `${V}raster:${`${t.length}:${t}`}:`, c;
24075
+ let o = lr(n), s = `${V}raster:${`${t.length}:${t}`}:`, c;
24062
24076
  for (let [t, n] of R.get(e)?.entries ?? []) {
24063
24077
  if (!t.startsWith(s)) continue;
24064
24078
  let e = /^(\d+)x(\d+):p(\d+)$/.exec(t.slice(s.length));
@@ -24073,20 +24087,20 @@ function hr(e, t, n, r) {
24073
24087
  }
24074
24088
  return c?.key;
24075
24089
  }
24076
- function gr(e, t = {}) {
24077
- let n = sr(t), r = e.inspection.dimensions;
24090
+ function vr(e, t = {}) {
24091
+ let n = lr(t), r = e.inspection.dimensions;
24078
24092
  if (!r) return !1;
24079
24093
  let i = r.width * r.height;
24080
- if (t.maxRetainedPixels !== void 0 && !on(r) && i <= n) return !1;
24094
+ if (t.maxRetainedPixels !== void 0 && !cn(r) && i <= n) return !1;
24081
24095
  let a = z(t.targetWidthPx), o = z(t.targetHeightPx);
24082
- return (e.inspection.format === "tiff" ? (a !== void 0 || o !== void 0) && (a === void 0 || a < r.width) && (o === void 0 || o < r.height) : a !== void 0 && o !== void 0 && (a < r.width || o < r.height)) || on(r) || i > n;
24083
- }
24084
- async function _r(e, t, n, r = {}, i, a) {
24085
- i && Un(n, i);
24086
- let o = or(r), s = i?.ownerGeneration ?? zn(n), c = await Kn(n, e, t, n);
24087
- i ? Un(n, i) : Vn(n, s);
24088
- let l = ur(c);
24089
- if (a) return l ? pr(e, o, {
24096
+ return (e.inspection.format === "tiff" ? (a !== void 0 || o !== void 0) && (a === void 0 || a < r.width) && (o === void 0 || o < r.height) : a !== void 0 && o !== void 0 && (a < r.width || o < r.height)) || cn(r) || i > n;
24097
+ }
24098
+ async function yr(e, t, n, r = {}, i, a) {
24099
+ i && Gn(n, i);
24100
+ let o = cr(r), s = i?.ownerGeneration ?? Vn(n), c = await Jn(n, e, t, n);
24101
+ i ? Gn(n, i) : Un(n, s);
24102
+ let l = fr(c);
24103
+ if (a) return l ? hr(e, o, {
24090
24104
  width: Number(a.width),
24091
24105
  height: Number(a.height)
24092
24106
  }) : B(e, {
@@ -24094,19 +24108,19 @@ async function _r(e, t, n, r = {}, i, a) {
24094
24108
  targetHeightPx: Number(a.height),
24095
24109
  maxRetainedPixels: o.maxRetainedPixels
24096
24110
  });
24097
- if (l) return mr(n, e, o) ?? pr(e, o);
24111
+ if (l) return gr(n, e, o) ?? hr(e, o);
24098
24112
  if (!o.targetWidthPx && !o.targetHeightPx) return B(e);
24099
24113
  let u = `${V}${B(e)}`;
24100
- return !cr(o) && R.get(n)?.entries.has(u) ? B(e) : gr(c, o) ? hr(n, e, o, c.inspection.dimensions) ?? B(e, o) : B(e);
24114
+ return !ur(o) && R.get(n)?.entries.has(u) ? B(e) : vr(c, o) ? _r(n, e, o, c.inspection.dimensions) ?? B(e, o) : B(e);
24101
24115
  }
24102
- function vr(e, t, n) {
24103
- let r = Jn(t), i = r.entries, a = i.get(e);
24104
- if (a) return i.delete(e), i.set(e, a), a.promise.then((e) => (rr(t, e), e));
24105
- let o = On(t, n), s = o.then(({ bitmap: e, owned: t }) => t ? e : null).catch(() => null), c = o.then(({ bitmap: e, owned: n }) => {
24116
+ function br(e, t, n) {
24117
+ let r = Xn(t), i = r.entries, a = i.get(e);
24118
+ if (a) return i.delete(e), i.set(e, a), a.promise.then((e) => (ar(t, e), e));
24119
+ let o = An(t, n), s = o.then(({ bitmap: e, owned: t }) => t ? e : null).catch(() => null), c = o.then(({ bitmap: e, owned: n }) => {
24106
24120
  try {
24107
- return rr(t, e), e;
24121
+ return ar(t, e), e;
24108
24122
  } catch (t) {
24109
- throw n && $n(e), t;
24123
+ throw n && tr(e), t;
24110
24124
  }
24111
24125
  }), l = {
24112
24126
  promise: c,
@@ -24119,23 +24133,23 @@ function vr(e, t, n) {
24119
24133
  i.delete(e);
24120
24134
  return;
24121
24135
  }
24122
- for (l.weight = nr(n), r.retainedBytes += l.weight; r.retainedBytes > r.retainedLimit && ir(t, r, e););
24136
+ for (l.weight = ir(n), r.retainedBytes += l.weight; r.retainedBytes > r.retainedLimit && or(t, r, e););
24123
24137
  }
24124
24138
  }).catch(() => {}), c.catch(() => {
24125
- i.get(e) === l && (i.delete(e), r.retainedBytes -= l.weight, ar(t, s));
24126
- }), i.set(e, l); i.size > Fn && ir(t, r, e););
24139
+ i.get(e) === l && (i.delete(e), r.retainedBytes -= l.weight, sr(t, s));
24140
+ }), i.set(e, l); i.size > Ln && or(t, r, e););
24127
24141
  return c;
24128
24142
  }
24129
- var yr = "base", V = `${yr}:`, br = "derived:";
24130
- function xr(e, t, n, r) {
24131
- return vr(`${e}:${t}`, n, r);
24143
+ var xr = "base", V = `${xr}:`, Sr = "derived:";
24144
+ function Cr(e, t, n, r) {
24145
+ return br(`${e}:${t}`, n, r);
24132
24146
  }
24133
- function Sr(e, t, n, r, i) {
24134
- return i && Wn(n, e, i), xr(`${br}${e}`, t, n, r);
24147
+ function wr(e, t, n, r, i) {
24148
+ return i && Kn(n, e, i), Cr(`${Sr}${e}`, t, n, r);
24135
24149
  }
24136
- function Cr(e, t, n, r = {}, i = n) {
24137
- let a = or(r), { widthPt: o = 0, heightPt: s = 0, suppressBoundaryFrame: c = !1, tiff: l, targetWidthPx: u, targetHeightPx: d, maxRetainedPixels: f, svgDecoder: p } = a;
24138
- if (t === "image/svg+xml" && p) return xr(yr, B(e, a), i, async () => ({
24150
+ function Tr(e, t, n, r = {}, i = n) {
24151
+ let a = cr(r), { widthPt: o = 0, heightPt: s = 0, suppressBoundaryFrame: c = !1, tiff: l, targetWidthPx: u, targetHeightPx: d, maxRetainedPixels: f, svgDecoder: p } = a;
24152
+ if (t === "image/svg+xml" && p) return Cr(xr, B(e, a), i, async () => ({
24139
24153
  bitmap: await p(await n(e, t), {
24140
24154
  targetWidthPx: u,
24141
24155
  targetHeightPx: d
@@ -24144,7 +24158,7 @@ function Cr(e, t, n, r = {}, i = n) {
24144
24158
  }));
24145
24159
  let m = (r, p, m = !0) => {
24146
24160
  let h = p?.initialBlob;
24147
- return p && (p.initialBlob = void 0), xr(yr, r, i, async () => {
24161
+ return p && (p.initialBlob = void 0), Cr(xr, r, i, async () => {
24148
24162
  let r = h ?? await n(e, t), i = {
24149
24163
  widthPt: o,
24150
24164
  heightPt: s,
@@ -24155,39 +24169,39 @@ function Cr(e, t, n, r = {}, i = n) {
24155
24169
  maxRetainedPixels: f
24156
24170
  };
24157
24171
  return {
24158
- bitmap: p ? await Tn(r, i, p.inspection) : await wn(r, i),
24172
+ bitmap: p ? await Dn(r, i, p.inspection) : await En(r, i),
24159
24173
  owned: !0
24160
24174
  };
24161
- }).then((e) => lr(e, a));
24162
- }, h = zn(i);
24163
- return Kn(i, e, t, n).then((t) => {
24164
- if (Vn(i, h), ur(t)) return m(mr(i, e, a) ?? pr(e, a), t);
24175
+ }).then((e) => dr(e, a));
24176
+ }, h = Vn(i);
24177
+ return Jn(i, e, t, n).then((t) => {
24178
+ if (Un(i, h), fr(t)) return m(gr(i, e, a) ?? hr(e, a), t);
24165
24179
  if (!u && !d) return m(B(e), t, !1);
24166
24180
  let n = `${V}${B(e)}`;
24167
- if (!cr(a) && R.get(i)?.entries.has(n)) return m(B(e), t, !1);
24168
- let r = gr(t, a);
24169
- return m(r ? hr(i, e, a, t.inspection.dimensions) ?? B(e, a) : B(e), t, r);
24181
+ if (!ur(a) && R.get(i)?.entries.has(n)) return m(B(e), t, !1);
24182
+ let r = vr(t, a);
24183
+ return m(r ? _r(i, e, a, t.inspection.dimensions) ?? B(e, a) : B(e), t, r);
24170
24184
  });
24171
24185
  }
24172
- function wr(e, t) {
24186
+ function Er(e, t) {
24173
24187
  return R.get(t)?.entries.get(`${V}${B(e)}`)?.bitmap;
24174
24188
  }
24175
- function Tr(e) {
24176
- if (!Pn(e)) return;
24177
- Ln.set(e, zn(e) + 1), Rn.delete(e), In.delete(e);
24189
+ function Dr(e) {
24190
+ if (!In(e)) return;
24191
+ zn.set(e, Vn(e) + 1), Bn.delete(e), Rn.delete(e);
24178
24192
  let t = R.get(e);
24179
24193
  if (t) {
24180
- for (let n of t.entries.values()) ar(e, n.ownedPromise);
24194
+ for (let n of t.entries.values()) sr(e, n.ownedPromise);
24181
24195
  t.entries.clear(), t.retainedBytes = 0, R.delete(e);
24182
24196
  }
24183
24197
  }
24184
- var Er = /* @__PURE__ */ new WeakMap(), Dr = 256;
24185
- function Or(e) {
24186
- let t = Er.get(e);
24187
- return t || (t = { imgs: /* @__PURE__ */ new Map() }, Er.set(e, t)), t;
24198
+ var Or = /* @__PURE__ */ new WeakMap(), kr = 256;
24199
+ function Ar(e) {
24200
+ let t = Or.get(e);
24201
+ return t || (t = { imgs: /* @__PURE__ */ new Map() }, Or.set(e, t)), t;
24188
24202
  }
24189
- function kr(e, t, n = {}) {
24190
- if (typeof Image > "u") return Cr(e, "image/svg+xml", t, {
24203
+ function jr(e, t, n = {}) {
24204
+ if (typeof Image > "u") return Tr(e, "image/svg+xml", t, {
24191
24205
  targetWidthPx: n.targetWidthPx,
24192
24206
  targetHeightPx: n.targetHeightPx,
24193
24207
  maxRetainedPixels: n.maxRetainedPixels,
@@ -24196,10 +24210,10 @@ function kr(e, t, n = {}) {
24196
24210
  if (!t) throw Error(`svg decode failed: ${e}`);
24197
24211
  return t;
24198
24212
  });
24199
- let r = Or(t), i = r.imgs.get(e);
24213
+ let r = Ar(t), i = r.imgs.get(e);
24200
24214
  if (i) return r.imgs.delete(e), r.imgs.set(e, i), i.promise;
24201
24215
  let a = {};
24202
- if (a.promise = On(t, async () => {
24216
+ if (a.promise = An(t, async () => {
24203
24217
  if (r.imgs.get(e) !== a) throw Error("SVG decode was superseded before it started");
24204
24218
  let n = await t(e, "image/svg+xml"), i = URL.createObjectURL(n);
24205
24219
  try {
@@ -24214,42 +24228,42 @@ function kr(e, t, n = {}) {
24214
24228
  }
24215
24229
  }), a.promise.catch(() => {
24216
24230
  r.imgs.get(e) === a && r.imgs.delete(e);
24217
- }), r.imgs.set(e, a), r.imgs.size > Dr) {
24231
+ }), r.imgs.set(e, a), r.imgs.size > kr) {
24218
24232
  let e = r.imgs.keys().next().value;
24219
24233
  r.imgs.delete(e);
24220
24234
  }
24221
24235
  return a.promise;
24222
24236
  }
24223
- function Ar(e) {
24224
- let t = Er.get(e);
24225
- t && (t.imgs.clear(), Er.delete(e));
24237
+ function Mr(e) {
24238
+ let t = Or.get(e);
24239
+ t && (t.imgs.clear(), Or.delete(e));
24226
24240
  }
24227
- function jr(e) {
24241
+ function Nr(e) {
24228
24242
  return /^[0-9a-fA-F]{6}$/.test(e) ? [
24229
24243
  parseInt(e.slice(0, 2), 16),
24230
24244
  parseInt(e.slice(2, 4), 16),
24231
24245
  parseInt(e.slice(4, 6), 16)
24232
24246
  ] : null;
24233
24247
  }
24234
- function Mr(e, t, n) {
24248
+ function Pr(e, t, n) {
24235
24249
  return (.299 * e + .587 * t + .114 * n) / 255;
24236
24250
  }
24237
- function Nr(e, t, n) {
24238
- let r = jr(t), i = jr(n);
24251
+ function Fr(e, t, n) {
24252
+ let r = Nr(t), i = Nr(n);
24239
24253
  if (!r || !i) return e;
24240
24254
  let [a, o, s] = r, [c, l, u] = i, d = e.data;
24241
24255
  for (let e = 0; e < d.length; e += 4) {
24242
24256
  if (d[e + 3] === 0) continue;
24243
- let t = Mr(d[e], d[e + 1], d[e + 2]);
24257
+ let t = Pr(d[e], d[e + 1], d[e + 2]);
24244
24258
  d[e] = Math.round(a + (c - a) * t), d[e + 1] = Math.round(o + (l - o) * t), d[e + 2] = Math.round(s + (u - s) * t);
24245
24259
  }
24246
24260
  return e;
24247
24261
  }
24248
- var Pr = (e, t) => typeof OffscreenCanvas > "u" ? null : new OffscreenCanvas(e, t);
24249
- async function Fr(e, t, n) {
24262
+ var Ir = (e, t) => typeof OffscreenCanvas > "u" ? null : new OffscreenCanvas(e, t);
24263
+ async function Lr(e, t, n) {
24250
24264
  let { width: r, height: i } = n;
24251
24265
  if (r <= 0 || i <= 0 || typeof createImageBitmap > "u") return e;
24252
- let a = (n.offscreenFactory ?? Pr)(r, i);
24266
+ let a = (n.offscreenFactory ?? Ir)(r, i);
24253
24267
  if (!a) return e;
24254
24268
  let o = a.getContext("2d");
24255
24269
  if (!o) return e;
@@ -24260,20 +24274,20 @@ async function Fr(e, t, n) {
24260
24274
  } catch {
24261
24275
  return e;
24262
24276
  }
24263
- Nr(s, t.clr1, t.clr2), o.putImageData(s, 0, 0);
24277
+ Fr(s, t.clr1, t.clr2), o.putImageData(s, 0, 0);
24264
24278
  let c = ne(r, i, n.targetWidthPx, n.targetHeightPx);
24265
24279
  return c ? createImageBitmap(a, c) : createImageBitmap(a);
24266
24280
  }
24267
- function Ir(e) {
24281
+ function Rr(e) {
24268
24282
  return e.svgImagePath != null && e.srcRect == null;
24269
24283
  }
24270
- var Lr = {
24284
+ var zr = {
24271
24285
  "&": "&amp;",
24272
24286
  "<": "&lt;",
24273
24287
  ">": "&gt;",
24274
24288
  "\"": "&quot;"
24275
- }, H = (e) => e.replace(/[&<>"]/g, (e) => Lr[e]);
24276
- function Rr(e, t = "roman") {
24289
+ }, H = (e) => e.replace(/[&<>"]/g, (e) => zr[e]);
24290
+ function Br(e, t = "roman") {
24277
24291
  if (t === "double-struck" || t === "monospace") return t;
24278
24292
  if (t === "fraktur") return e === "bold" || e === "boldItalic" ? "bold-fraktur" : "fraktur";
24279
24293
  if (t === "script") return e === "bold" || e === "boldItalic" ? "bold-script" : "script";
@@ -24290,9 +24304,9 @@ function Rr(e, t = "roman") {
24290
24304
  case "italic": return null;
24291
24305
  }
24292
24306
  }
24293
- var zr = new Set([..."⏞⏟⎴⎵︷︸⏜⏝{}[]()¯_‾"]), Br = "+−±∓×÷·∗⋅∘∙*/", Vr = "=≠<>≤≥≈≡∼≅≃→←↔⇒∈∉⊂⊆⊃⊇∝≪≫⊥≔", Hr = "([{⟨⌈⌊", Ur = ")]}⟩⌉⌋", Wr = ",;";
24294
- function Gr(e, t, n) {
24295
- let r = Rr(t, n), i = r ? ` mathvariant="${r}"` : "", a = "", o = "", s = () => {
24307
+ var Vr = new Set([..."⏞⏟⎴⎵︷︸⏜⏝{}[]()¯_‾"]), Hr = "+−±∓×÷·∗⋅∘∙*/", Ur = "=≠<>≤≥≈≡∼≅≃→←↔⇒∈∉⊂⊆⊃⊇∝≪≫⊥≔", Wr = "([{⟨⌈⌊", Gr = ")]}⟩⌉⌋", Kr = ",;";
24308
+ function qr(e, t, n) {
24309
+ let r = Br(t, n), i = r ? ` mathvariant="${r}"` : "", a = "", o = "", s = () => {
24296
24310
  o &&= (a += `<mn${i}>${H(o)}</mn>`, "");
24297
24311
  };
24298
24312
  for (let t of e) {
@@ -24304,56 +24318,56 @@ function Gr(e, t, n) {
24304
24318
  o += t;
24305
24319
  continue;
24306
24320
  }
24307
- s(), Br.includes(t) || Vr.includes(t) || Wr.includes(t) ? a += `<mo>${H(t)}</mo>` : Hr.includes(t) || Ur.includes(t) ? a += `<mo fence="true" stretchy="false">${H(t)}</mo>` : a += `<mi${i}>${H(t)}</mi>`;
24321
+ s(), Hr.includes(t) || Ur.includes(t) || Kr.includes(t) ? a += `<mo>${H(t)}</mo>` : Wr.includes(t) || Gr.includes(t) ? a += `<mo fence="true" stretchy="false">${H(t)}</mo>` : a += `<mi${i}>${H(t)}</mi>`;
24308
24322
  }
24309
24323
  return s(), a;
24310
24324
  }
24311
24325
  function U(e) {
24312
- return e.map(Kr).join("");
24326
+ return e.map(Jr).join("");
24313
24327
  }
24314
24328
  function W(e) {
24315
24329
  return `<mrow>${U(e)}</mrow>`;
24316
24330
  }
24317
- function Kr(e) {
24331
+ function Jr(e) {
24318
24332
  switch (e.kind) {
24319
- case "run": return Gr(e.text, e.style, e.__script);
24333
+ case "run": return qr(e.text, e.style, e.__script);
24320
24334
  case "group": return W(e.items);
24321
24335
  case "fraction": return `<mfrac${e.bar === !1 ? " linethickness=\"0\"" : ""}>${W(e.num)}${W(e.den)}</mfrac>`;
24322
24336
  case "sup": return `<msup>${W(e.base)}${W(e.sup ?? [])}</msup>`;
24323
24337
  case "sub": return `<msub>${W(e.base)}${W(e.sub ?? [])}</msub>`;
24324
24338
  case "subSup": return `<msubsup>${W(e.base)}${W(e.sub ?? [])}${W(e.sup ?? [])}</msubsup>`;
24325
- case "nary": return ti(e);
24326
- case "delimiter": return ni(e);
24339
+ case "nary": return ri(e);
24340
+ case "delimiter": return ii(e);
24327
24341
  case "radical": return e.index && e.index.length ? `<mroot>${W(e.radicand)}${W(e.index)}</mroot>` : `<msqrt>${U(e.radicand)}</msqrt>`;
24328
- case "limit": return Qr(e);
24329
- case "array": return $r(e);
24342
+ case "limit": return ei(e);
24343
+ case "array": return ti(e);
24330
24344
  case "groupChr": {
24331
- let t = W(e.base), n = zr.has(e.char), r = e.pos === "top" ? "mover" : "munder", i = `<mo stretchy="${n}">${H(e.char)}</mo>`;
24345
+ let t = W(e.base), n = Vr.has(e.char), r = e.pos === "top" ? "mover" : "munder", i = `<mo stretchy="${n}">${H(e.char)}</mo>`;
24332
24346
  return n ? `<${r}>${t}${i}</${r}>` : `<${r} accent="true">${t}${i}</${r}>`;
24333
24347
  }
24334
24348
  case "bar": {
24335
24349
  let t = W(e.base), n = "<mo stretchy=\"true\">&#x2015;</mo>";
24336
24350
  return e.pos === "bot" ? `<munder>${t}${n}</munder>` : `<mover>${t}${n}</mover>`;
24337
24351
  }
24338
- case "accent": return Zr(e);
24352
+ case "accent": return $r(e);
24339
24353
  case "func": return `<mrow>${W(e.name)}<mo>&#x2061;</mo>${W(e.arg)}</mrow>`;
24340
- case "phant": return qr(e);
24354
+ case "phant": return Yr(e);
24341
24355
  case "sPre": return `<mmultiscripts>${W(e.base)}<mprescripts/>${W(e.sub)}${W(e.sup)}</mmultiscripts>`;
24342
24356
  case "box": return W(e.base);
24343
- case "borderBox": return Jr(e);
24357
+ case "borderBox": return Xr(e);
24344
24358
  }
24345
24359
  }
24346
- function qr(e) {
24360
+ function Yr(e) {
24347
24361
  let t = e.show ? U(e.base) : `<mphantom>${U(e.base)}</mphantom>`, n = [];
24348
24362
  return e.zeroWid && n.push("width=\"0\""), e.zeroAsc && n.push("height=\"0\""), e.zeroDesc && n.push("depth=\"0\""), n.length ? `<mpadded ${n.join(" ")}>${t}</mpadded>` : `<mrow>${t}</mrow>`;
24349
24363
  }
24350
- function Jr(e) {
24364
+ function Xr(e) {
24351
24365
  let t = [], n = !e.hideTop, r = !e.hideBot, i = !e.hideLeft, a = !e.hideRight;
24352
24366
  n && r && i && a ? t.push("box") : (n && t.push("top"), r && t.push("bottom"), i && t.push("left"), a && t.push("right")), e.strikeH && t.push("horizontalstrike"), e.strikeV && t.push("verticalstrike"), e.strikeBltr && t.push("updiagonalstrike"), e.strikeTlbr && t.push("downdiagonalstrike");
24353
24367
  let o = U(e.base);
24354
24368
  return t.length ? `<menclose notation="${t.join(" ")}">${o}</menclose>` : `<mrow>${o}</mrow>`;
24355
24369
  }
24356
- var Yr = {
24370
+ var Zr = {
24357
24371
  "̀": "`",
24358
24372
  "́": "´",
24359
24373
  "̂": "^",
@@ -24364,7 +24378,7 @@ var Yr = {
24364
24378
  "̌": "ˇ",
24365
24379
  "⃗": "→",
24366
24380
  "⃖": "←"
24367
- }, Xr = new Set([
24381
+ }, Qr = new Set([
24368
24382
  "̅",
24369
24383
  "̄",
24370
24384
  "¯",
@@ -24372,47 +24386,47 @@ var Yr = {
24372
24386
  "̲",
24373
24387
  "̳"
24374
24388
  ]);
24375
- function Zr(e) {
24389
+ function $r(e) {
24376
24390
  let t = W(e.base);
24377
- if (Xr.has(e.char)) return `<mover>${t}<mo stretchy="true">&#x2015;</mo></mover>`;
24378
- let n = Yr[e.char] ?? e.char;
24391
+ if (Qr.has(e.char)) return `<mover>${t}<mo stretchy="true">&#x2015;</mo></mover>`;
24392
+ let n = Zr[e.char] ?? e.char;
24379
24393
  return `<mover accent="true">${t}<mo stretchy="${n === "→" || n === "←" ? "true" : "false"}">${H(n)}</mo></mover>`;
24380
24394
  }
24381
- function Qr(e) {
24395
+ function ei(e) {
24382
24396
  let t = W(e.base), n = e.lower && e.lower.length ? W(e.lower) : null, r = e.upper && e.upper.length ? W(e.upper) : null;
24383
24397
  return n && r ? `<munderover>${t}${n}${r}</munderover>` : n ? `<munder>${t}${n}</munder>` : r ? `<mover>${t}${r}</mover>` : t;
24384
24398
  }
24385
- function $r(e) {
24399
+ function ti(e) {
24386
24400
  let t = Math.max(1, ...e.rows.map((e) => e.length)), n;
24387
24401
  n = e.align === "eq" ? Array.from({ length: t }, (e, t) => t % 2 == 0 ? "right" : "left").join(" ") : e.align === "left" ? "left" : "center";
24388
24402
  let r = e.rows.map((e) => `<mtr>${e.map((e) => `<mtd>${U(e)}</mtd>`).join("")}</mtr>`).join("");
24389
24403
  return `<mtable columnalign="${n}" rowspacing="0.2em" columnspacing="0.3em">${r}</mtable>`;
24390
24404
  }
24391
- var ei = new Set([..."∫∬∭∮∯∰∱∲∳⨌⨍⨎⨏⨐⨑⨒⨓⨔⨕⨖⨗"]);
24392
- function ti(e) {
24393
- let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 : ei.has(e.op), n = `<mo largeop="true">${H(e.op)}</mo>`, r = e.sub ?? [], i = e.sup ?? [], a;
24405
+ var ni = new Set([..."∫∬∭∮∯∰∱∲∳⨌⨍⨎⨏⨐⨑⨒⨓⨔⨕⨖⨗"]);
24406
+ function ri(e) {
24407
+ let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 : ni.has(e.op), n = `<mo largeop="true">${H(e.op)}</mo>`, r = e.sub ?? [], i = e.sup ?? [], a;
24394
24408
  return a = t ? r.length && i.length ? `<msubsup>${n}${W(r)}${W(i)}</msubsup>` : r.length ? `<msub>${n}${W(r)}</msub>` : i.length ? `<msup>${n}${W(i)}</msup>` : n : r.length && i.length ? `<munderover>${n}${W(r)}${W(i)}</munderover>` : r.length ? `<munder>${n}${W(r)}</munder>` : i.length ? `<mover>${n}${W(i)}</mover>` : n, `<mrow>${a}${U(e.body)}</mrow>`;
24395
24409
  }
24396
- function ni(e) {
24410
+ function ii(e) {
24397
24411
  let t = (e) => `<mo fence="true" stretchy="true">${H(e)}</mo>`, n = e.items.map((e) => W(e)).join("<mo separator=\"true\">,</mo>");
24398
24412
  return `<mrow>${t(e.begChar)}${n}${t(e.endChar)}</mrow>`;
24399
24413
  }
24400
- function ri(e, t) {
24414
+ function ai(e, t) {
24401
24415
  return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="${t ? "block" : "inline"}">${U(e)}</math>`;
24402
24416
  }
24403
- var ii = 64;
24404
- function ai(e, t, n) {
24417
+ var oi = 64;
24418
+ function si(e, t, n) {
24405
24419
  let r = Math.max(1, Math.round(t * 256)), i = Math.max(1, Math.round(n * 256));
24406
24420
  return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
24407
24421
  }
24408
- function G(e, t) {
24422
+ function ci(e, t) {
24409
24423
  return RegExp(`(?:^|\\s)${t}="([^"]*)"`).exec(e)?.[1];
24410
24424
  }
24411
- function K(e, t, n = 0) {
24412
- let r = Number.parseFloat(G(e, t) ?? "");
24425
+ function G(e, t, n = 0) {
24426
+ let r = Number.parseFloat(ci(e, t) ?? "");
24413
24427
  return Number.isFinite(r) ? r : n;
24414
24428
  }
24415
- function oi(e) {
24429
+ function li(e) {
24416
24430
  let t = /* @__PURE__ */ new Map();
24417
24431
  for (let n of [
24418
24432
  "fill",
@@ -24423,10 +24437,10 @@ function oi(e) {
24423
24437
  "fill-rule",
24424
24438
  "opacity"
24425
24439
  ]) {
24426
- let r = G(e, n);
24440
+ let r = ci(e, n);
24427
24441
  r !== void 0 && t.set(n, r);
24428
24442
  }
24429
- let n = G(e, "style");
24443
+ let n = ci(e, "style");
24430
24444
  if (n) for (let e of n.split(";")) {
24431
24445
  let n = e.indexOf(":");
24432
24446
  if (n < 0) continue;
@@ -24435,8 +24449,8 @@ function oi(e) {
24435
24449
  }
24436
24450
  return t;
24437
24451
  }
24438
- function si(e, t, n) {
24439
- let r = oi(t), i = { ...n }, a = r.get("fill");
24452
+ function ui(e, t, n) {
24453
+ let r = li(t), i = { ...n }, a = r.get("fill");
24440
24454
  a === "none" ? i.fill = !1 : a && (i.fill = !0, e.fillStyle = a);
24441
24455
  let o = r.get("stroke");
24442
24456
  o === "none" ? i.stroke = !1 : o && (i.stroke = !0, e.strokeStyle = o);
@@ -24451,7 +24465,7 @@ function si(e, t, n) {
24451
24465
  let d = Number.parseFloat(r.get("opacity") ?? "");
24452
24466
  return Number.isFinite(d) && (e.globalAlpha *= Math.max(0, Math.min(1, d))), i;
24453
24467
  }
24454
- function ci(e, t) {
24468
+ function di(e, t) {
24455
24469
  if (!t) return;
24456
24470
  let n = /([a-zA-Z]+)\(([^)]*)\)/g;
24457
24471
  for (let r = n.exec(t); r; r = n.exec(t)) {
@@ -24476,11 +24490,11 @@ function ci(e, t) {
24476
24490
  }
24477
24491
  }
24478
24492
  }
24479
- function li(e, t, n) {
24493
+ function fi(e, t, n) {
24480
24494
  n.fill && e.fill(t, n.fillRule), n.stroke && e.lineWidth > 0 && e.stroke(t);
24481
24495
  }
24482
- function ui(e, t, n, r) {
24483
- let i = G(t.slice(0, t.indexOf(">") + 1), "viewBox")?.trim().split(/[\s,]+/).map(Number);
24496
+ function pi(e, t, n, r) {
24497
+ let i = ci(t.slice(0, t.indexOf(">") + 1), "viewBox")?.trim().split(/[\s,]+/).map(Number);
24484
24498
  if (!i || i.length !== 4 || i.some((e) => !Number.isFinite(e))) throw TypeError("MathJax SVG must contain a finite viewBox");
24485
24499
  let [a, o, s, c] = i;
24486
24500
  if (!(s > 0) || !(c > 0)) throw TypeError("MathJax SVG viewBox must have positive dimensions");
@@ -24498,23 +24512,23 @@ function ui(e, t, n, r) {
24498
24512
  continue;
24499
24513
  }
24500
24514
  if (a === "g") {
24501
- u.push(l), e.save(), l = si(e, i, l), ci(e, G(i, "transform"));
24515
+ u.push(l), e.save(), l = ui(e, i, l), di(e, ci(i, "transform"));
24502
24516
  continue;
24503
24517
  }
24504
24518
  if (a !== "path" && a !== "rect" && a !== "line") continue;
24505
24519
  e.save();
24506
- let s = si(e, i, l);
24507
- ci(e, G(i, "transform"));
24508
- let c = a === "path" ? new Path2D(G(i, "d") ?? "") : new Path2D();
24509
- a === "rect" ? c.rect(K(i, "x"), K(i, "y"), K(i, "width"), K(i, "height")) : a === "line" && (c.moveTo(K(i, "x1"), K(i, "y1")), c.lineTo(K(i, "x2"), K(i, "y2"))), li(e, c, s), e.restore();
24520
+ let s = ui(e, i, l);
24521
+ di(e, ci(i, "transform"));
24522
+ let c = a === "path" ? new Path2D(ci(i, "d") ?? "") : new Path2D();
24523
+ a === "rect" ? c.rect(G(i, "x"), G(i, "y"), G(i, "width"), G(i, "height")) : a === "line" && (c.moveTo(G(i, "x1"), G(i, "y1")), c.lineTo(G(i, "x2"), G(i, "y2"))), fi(e, c, s), e.restore();
24510
24524
  }
24511
24525
  e.restore();
24512
24526
  }
24513
- async function di(e, t) {
24527
+ async function mi(e, t) {
24514
24528
  let { width: n, height: r } = o(e.widthEm * 256, (e.ascentEm + e.descentEm) * 256), a = i(n, r), s = a?.getContext("2d");
24515
24529
  if (!a || !s || typeof Path2D > "u") throw Error("Math SVG rasterization requires Canvas 2D and Path2D support");
24516
- ui(s, ai(re(e.svg, t), e.widthEm, e.ascentEm + e.descentEm), n, r);
24517
- let c = a, l = n, u = r, d = ii / 256, f = Math.max(1, Math.round(n * d)), p = Math.max(1, Math.round(r * d));
24530
+ pi(s, si(re(e.svg, t), e.widthEm, e.ascentEm + e.descentEm), n, r);
24531
+ let c = a, l = n, u = r, d = oi / 256, f = Math.max(1, Math.round(n * d)), p = Math.max(1, Math.round(r * d));
24518
24532
  for (; l > f || u > p;) {
24519
24533
  let e = Math.max(f, Math.ceil(l / 2)), t = Math.max(p, Math.ceil(u / 2)), n = i(e, t), r = n?.getContext("2d");
24520
24534
  if (!n || !r) break;
@@ -24526,48 +24540,48 @@ async function di(e, t) {
24526
24540
  heightPx: u
24527
24541
  };
24528
24542
  }
24529
- function fi(e, t) {
24543
+ function hi(e, t) {
24530
24544
  let n = i(e.widthPx, e.heightPx);
24531
24545
  if (!n) return e.source;
24532
24546
  let r = n.getContext("2d");
24533
24547
  return r ? (r.drawImage(e.source, 0, 0, e.widthPx, e.heightPx), r.globalCompositeOperation = "source-in", r.fillStyle = t, r.fillRect(0, 0, e.widthPx, e.heightPx), n) : e.source;
24534
24548
  }
24535
- function pi(e) {
24549
+ function gi(e) {
24536
24550
  return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
24537
24551
  }
24538
- function mi(e = 1) {
24552
+ function _i(e = 1) {
24539
24553
  return typeof window < "u" && window.devicePixelRatio || e;
24540
24554
  }
24541
- function hi(e, t, n) {
24555
+ function vi(e, t, n) {
24542
24556
  let r = Math.round(t * n) % 2 == 1 ? .5 : 0, i = e * n;
24543
24557
  return (Math.round(i - r) + r) / n - e;
24544
24558
  }
24545
- var gi = class e extends Error {
24559
+ var yi = class e extends Error {
24546
24560
  code = "parser-crashed";
24547
24561
  constructor(t) {
24548
24562
  super(t), this.name = "WasmTrapError", Object.setPrototypeOf(this, e.prototype);
24549
24563
  }
24550
- }, _i = "ooxml-insufficient-credit", vi = "OOXML_INSUFFICIENT_CREDIT:";
24551
- function yi(e) {
24564
+ }, bi = "ooxml-insufficient-credit", xi = "OOXML_INSUFFICIENT_CREDIT:";
24565
+ function Si(e) {
24552
24566
  return typeof e == "number" && Number.isSafeInteger(e) && e > 0;
24553
24567
  }
24554
- function bi(e) {
24568
+ function Ci(e) {
24555
24569
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
24556
24570
  let t = e;
24557
- return yi(t.requiredBytes) && yi(t.offeredBytes) && t.requiredBytes > t.offeredBytes;
24571
+ return Si(t.requiredBytes) && Si(t.offeredBytes) && t.requiredBytes > t.offeredBytes;
24558
24572
  }
24559
- var xi = class e extends RangeError {
24560
- code = _i;
24573
+ var wi = class e extends RangeError {
24574
+ code = bi;
24561
24575
  requiredBytes;
24562
24576
  offeredBytes;
24563
24577
  constructor(t) {
24564
24578
  super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`), this.name = "PullSessionInsufficientCreditError", this.requiredBytes = t.requiredBytes, this.offeredBytes = t.offeredBytes, Object.setPrototypeOf(this, e.prototype);
24565
24579
  }
24566
24580
  };
24567
- function Si(e) {
24568
- if (e instanceof xi) return e;
24581
+ function Ti(e) {
24582
+ if (e instanceof wi) return e;
24569
24583
  let t = e instanceof Error ? e.message : String(e);
24570
- if (!t.startsWith(vi)) return;
24584
+ if (!t.startsWith(xi)) return;
24571
24585
  let n;
24572
24586
  try {
24573
24587
  n = JSON.parse(t.slice(26));
@@ -24576,49 +24590,49 @@ function Si(e) {
24576
24590
  }
24577
24591
  if (!n || typeof n != "object" || Array.isArray(n)) return;
24578
24592
  let r = n;
24579
- if (!(r.code !== "ooxml-insufficient-credit" || !bi(r))) return new xi(r);
24593
+ if (!(r.code !== "ooxml-insufficient-credit" || !Ci(r))) return new wi(r);
24580
24594
  }
24581
- function Ci(e, t, n) {
24582
- if (wi(e)) return e.offeredBytes === t && e.requiredBytes <= n ? e.requiredBytes : void 0;
24595
+ function Ei(e, t, n) {
24596
+ if (Di(e)) return e.offeredBytes === t && e.requiredBytes <= n ? e.requiredBytes : void 0;
24583
24597
  }
24584
- function wi(e) {
24585
- return e instanceof xi || !!e && typeof e == "object" && e.code === "ooxml-insufficient-credit" && bi(e);
24598
+ function Di(e) {
24599
+ return e instanceof wi || !!e && typeof e == "object" && e.code === "ooxml-insufficient-credit" && Ci(e);
24586
24600
  }
24587
- var Ti = "OOXML_RESOURCE_LIMIT:", Ei = 128, Di = 256, Oi = 4096;
24588
- function q(e) {
24601
+ var Oi = "OOXML_RESOURCE_LIMIT:", ki = 128, Ai = 256, ji = 4096;
24602
+ function K(e) {
24589
24603
  return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
24590
24604
  }
24591
- function ki(e) {
24605
+ function Mi(e) {
24592
24606
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
24593
24607
  let t = e;
24594
- return q(t.archiveEntryCount) && q(t.declaredInflatedBytes) && (t.largestInflatedEntryBytes === void 0 || q(t.largestInflatedEntryBytes)) && q(t.distinctInflatedBytes) && q(t.operationInflatedBytes);
24608
+ return K(t.archiveEntryCount) && K(t.declaredInflatedBytes) && (t.largestInflatedEntryBytes === void 0 || K(t.largestInflatedEntryBytes)) && K(t.distinctInflatedBytes) && K(t.operationInflatedBytes);
24595
24609
  }
24596
- function Ai(e) {
24610
+ function Ni(e) {
24597
24611
  let t;
24598
24612
  try {
24599
24613
  t = JSON.parse(new TextDecoder().decode(e));
24600
24614
  } catch {
24601
24615
  throw TypeError("OOXML resource usage checkpoint is not valid JSON");
24602
24616
  }
24603
- if (!ki(t)) throw TypeError("OOXML resource usage checkpoint is invalid");
24617
+ if (!Mi(t)) throw TypeError("OOXML resource usage checkpoint is invalid");
24604
24618
  return t;
24605
24619
  }
24606
- function ji(e) {
24620
+ function Pi(e) {
24607
24621
  return e === "docx" || e === "xlsx" || e === "pptx";
24608
24622
  }
24609
- function Mi(e) {
24623
+ function Fi(e) {
24610
24624
  return e === "container" || e === "decompression" || e === "parsing" || e === "serialization" || e === "layout" || e === "rendering" || e === "worker";
24611
24625
  }
24612
- function Ni(e, t) {
24626
+ function Ii(e, t) {
24613
24627
  return typeof e == "string" && e.length > 0 && e.length <= t && !/[\u0000-\u001f\u007f]/u.test(e);
24614
24628
  }
24615
- function Pi(e) {
24616
- return Ni(e, Ei) && /^[a-z0-9][a-z0-9-]*$/u.test(e);
24629
+ function Li(e) {
24630
+ return Ii(e, ki) && /^[a-z0-9][a-z0-9-]*$/u.test(e);
24617
24631
  }
24618
- function Fi(e) {
24619
- return !Ni(e, Oi) || e.startsWith("/") || e.startsWith("\\") || e.includes("\\") || e.includes("?") || e.includes("#") || e.includes("://") || /^[a-z]:/iu.test(e) ? !1 : e.split("/").every((e) => e !== "" && e !== "." && e !== "..");
24632
+ function Ri(e) {
24633
+ return !Ii(e, ji) || e.startsWith("/") || e.startsWith("\\") || e.includes("\\") || e.includes("?") || e.includes("#") || e.includes("://") || /^[a-z]:/iu.test(e) ? !1 : e.split("/").every((e) => e !== "" && e !== "." && e !== "..");
24620
24634
  }
24621
- var Ii = new Map([
24635
+ var zi = new Map([
24622
24636
  ["archive-entry:declared-inflated-bytes", {
24623
24637
  stage: "container",
24624
24638
  part: "required"
@@ -24665,20 +24679,20 @@ var Ii = new Map([
24665
24679
  part: "optional",
24666
24680
  configurable: !1
24667
24681
  }]
24668
- ]), Li = new Set([...Ii.keys()].map((e) => e.slice(0, e.indexOf(":")))), Ri = new Set([...Ii.keys()].map((e) => e.slice(e.indexOf(":") + 1)));
24669
- function zi(e) {
24682
+ ]), Bi = new Set([...zi.keys()].map((e) => e.slice(0, e.indexOf(":")))), Vi = new Set([...zi.keys()].map((e) => e.slice(e.indexOf(":") + 1)));
24683
+ function Hi(e) {
24670
24684
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
24671
24685
  let t = e;
24672
- return !ji(t.format) || !Ni(t.operation, Di) || !Pi(t.resource) || !Pi(t.metric) || !q(t.limit) || !q(t.observed) || typeof t.configurable != "boolean" || !ki(t.usage) ? !1 : !("part" in t) || Fi(t.part);
24686
+ return !Pi(t.format) || !Ii(t.operation, Ai) || !Li(t.resource) || !Li(t.metric) || !K(t.limit) || !K(t.observed) || typeof t.configurable != "boolean" || !Mi(t.usage) ? !1 : !("part" in t) || Ri(t.part);
24673
24687
  }
24674
- function Bi(e) {
24688
+ function Ui(e) {
24675
24689
  if (!e || typeof e != "object" || Array.isArray(e)) return !1;
24676
24690
  let t = e;
24677
- if (!Mi(t.stage) || !zi(t.violation)) return !1;
24678
- let n = t.violation, r = Ii.get(`${n.resource}:${n.metric}`);
24679
- return r ? t.stage !== r.stage || r.configurable === !1 && n.configurable !== !1 ? !1 : r.part === "required" ? n.part !== void 0 : r.part === "forbidden" ? n.part === void 0 : !0 : !(Li.has(n.resource) && Ri.has(n.metric));
24691
+ if (!Fi(t.stage) || !Hi(t.violation)) return !1;
24692
+ let n = t.violation, r = zi.get(`${n.resource}:${n.metric}`);
24693
+ return r ? t.stage !== r.stage || r.configurable === !1 && n.configurable !== !1 ? !1 : r.part === "required" ? n.part !== void 0 : r.part === "forbidden" ? n.part === void 0 : !0 : !(Bi.has(n.resource) && Vi.has(n.metric));
24680
24694
  }
24681
- function Vi(e) {
24695
+ function Wi(e) {
24682
24696
  return {
24683
24697
  archiveEntryCount: e.archiveEntryCount,
24684
24698
  declaredInflatedBytes: e.declaredInflatedBytes,
@@ -24687,8 +24701,8 @@ function Vi(e) {
24687
24701
  operationInflatedBytes: e.operationInflatedBytes
24688
24702
  };
24689
24703
  }
24690
- function Hi(e) {
24691
- if (!Bi(e)) return;
24704
+ function Gi(e) {
24705
+ if (!Ui(e)) return;
24692
24706
  let t = e.violation, n = {
24693
24707
  stage: e.stage,
24694
24708
  violation: {
@@ -24700,18 +24714,18 @@ function Hi(e) {
24700
24714
  limit: t.limit,
24701
24715
  observed: t.observed,
24702
24716
  configurable: t.configurable,
24703
- usage: Vi(t.usage)
24717
+ usage: Wi(t.usage)
24704
24718
  }
24705
24719
  };
24706
- return Bi(n) ? n : void 0;
24720
+ return Ui(n) ? n : void 0;
24707
24721
  }
24708
- function Ui(e) {
24722
+ function Ki(e) {
24709
24723
  let t = e.violation;
24710
24724
  return `OOXML resource limit exceeded${t.part ? ` for ${t.part}` : ""}: ${t.metric} ${t.observed} > ${t.limit}`;
24711
24725
  }
24712
- function Wi(e) {
24726
+ function qi(e) {
24713
24727
  let t = e instanceof Error ? e.message : String(e);
24714
- if (!t.startsWith(Ti)) return;
24728
+ if (!t.startsWith(Oi)) return;
24715
24729
  let n;
24716
24730
  try {
24717
24731
  n = JSON.parse(t.slice(21));
@@ -24720,9 +24734,9 @@ function Wi(e) {
24720
24734
  }
24721
24735
  if (!n || typeof n != "object") return;
24722
24736
  let r = n;
24723
- if (!(r.code !== "ooxml-resource-limit" || !Bi(r.details))) return new T(Ui(r.details), r.details);
24737
+ if (!(r.code !== "ooxml-resource-limit" || !Ui(r.details))) return new T(Ki(r.details), r.details);
24724
24738
  }
24725
- function Gi(e) {
24739
+ function Ji(e) {
24726
24740
  let t = d(e);
24727
24741
  if (t) {
24728
24742
  let e = new h(t.metric, t.limit, t.observed);
@@ -24739,7 +24753,7 @@ function Gi(e) {
24739
24753
  errorName: "TiffDecodeError",
24740
24754
  code: "ooxml-tiff-decode"
24741
24755
  };
24742
- let r = Si(e);
24756
+ let r = Ti(e);
24743
24757
  if (r) return {
24744
24758
  message: r.message,
24745
24759
  errorName: r.name,
@@ -24749,11 +24763,11 @@ function Gi(e) {
24749
24763
  offeredBytes: r.offeredBytes
24750
24764
  }
24751
24765
  };
24752
- let i = e instanceof w || e instanceof T ? e : Wi(e);
24766
+ let i = e instanceof w || e instanceof T ? e : qi(e);
24753
24767
  if (i instanceof T) {
24754
- let e = Hi(i.details);
24768
+ let e = Gi(i.details);
24755
24769
  return e ? {
24756
- message: typeof i.message == "string" ? i.message : Ui(e),
24770
+ message: typeof i.message == "string" ? i.message : Ki(e),
24757
24771
  errorName: "OoxmlResourceLimitError",
24758
24772
  code: "ooxml-resource-limit",
24759
24773
  resourceLimit: e
@@ -24764,24 +24778,24 @@ function Gi(e) {
24764
24778
  }
24765
24779
  if (i instanceof w) return {
24766
24780
  message: typeof i.message == "string" ? i.message : String(i.message),
24767
- errorName: Ni(i.name, Ei) ? i.name : "OoxmlError",
24768
- ...Pi(i.code) ? { code: i.code } : {}
24781
+ errorName: Ii(i.name, ki) ? i.name : "OoxmlError",
24782
+ ...Li(i.code) ? { code: i.code } : {}
24769
24783
  };
24770
24784
  let a = e instanceof Error ? e.message : String(e);
24771
- if (typeof a == "string" && a.startsWith(Ti)) return {
24785
+ if (typeof a == "string" && a.startsWith(Oi)) return {
24772
24786
  message: "Invalid OOXML resource-limit payload",
24773
24787
  errorName: "Error"
24774
24788
  };
24775
24789
  let o = e instanceof Error ? e : Error(a), s = o;
24776
24790
  return {
24777
24791
  message: typeof o.message == "string" ? o.message : String(o.message),
24778
- errorName: Ni(o.name, Ei) ? o.name : "Error",
24792
+ errorName: Ii(o.name, ki) ? o.name : "Error",
24779
24793
  ...typeof s.code == "string" ? { code: s.code } : {}
24780
24794
  };
24781
24795
  }
24782
- function Ki(e) {
24796
+ function Yi(e) {
24783
24797
  try {
24784
- return Gi(e);
24798
+ return Ji(e);
24785
24799
  } catch {
24786
24800
  return {
24787
24801
  message: "Worker operation failed with an unreadable error",
@@ -24789,91 +24803,91 @@ function Ki(e) {
24789
24803
  };
24790
24804
  }
24791
24805
  }
24792
- var qi = new Set([
24806
+ var Xi = new Set([
24793
24807
  "encrypted",
24794
24808
  "invalid-password",
24795
24809
  "unsupported-encryption",
24796
24810
  "legacy-binary-format",
24797
24811
  "not-ooxml"
24798
- ]), Ji = {
24812
+ ]), Zi = {
24799
24813
  "image-dimension": !0,
24800
24814
  "image-pixels": !0,
24801
24815
  "active-decoded-bytes": !0
24802
24816
  };
24803
- function Yi(e) {
24804
- return typeof e == "string" && Object.prototype.hasOwnProperty.call(Ji, e);
24817
+ function Qi(e) {
24818
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(Zi, e);
24805
24819
  }
24806
- function Xi(e, t) {
24820
+ function $i(e, t) {
24807
24821
  if (e !== "ooxml-decoded-image-limit" || !t || typeof t != "object") return;
24808
24822
  let n = t, r = n.metric, i = n.limit, a = n.observed;
24809
- if (!(!Yi(r) || !q(i) || !q(a) || a <= i)) return {
24823
+ if (!(!Qi(r) || !K(i) || !K(a) || a <= i)) return {
24810
24824
  metric: r,
24811
24825
  limit: i,
24812
24826
  observed: a
24813
24827
  };
24814
24828
  }
24815
- function Zi(e) {
24816
- let t = e.message, n = e.errorName, r = e.code, i = e.decodedImage, a = e.insufficientCredit, o = e.resourceLimit, s = typeof t == "string" ? t : "Worker operation failed with an invalid error payload", c = Ni(n, Ei) ? n : void 0, l = typeof r == "string" ? r : void 0, u = Xi(l, i);
24829
+ function ea(e) {
24830
+ let t = e.message, n = e.errorName, r = e.code, i = e.decodedImage, a = e.insufficientCredit, o = e.resourceLimit, s = typeof t == "string" ? t : "Worker operation failed with an invalid error payload", c = Ii(n, ki) ? n : void 0, l = typeof r == "string" ? r : void 0, u = $i(l, i);
24817
24831
  if (u) return new h(u.metric, u.limit, u.observed);
24818
24832
  if (l === "ooxml-tiff-decode") return new v(s);
24819
- if (l === "ooxml-insufficient-credit" && bi(a)) return new xi(a);
24820
- if (l === "ooxml-resource-limit" && Bi(o)) return new T(s, o);
24821
- if (l && qi.has(l)) return new w(l, s);
24833
+ if (l === "ooxml-insufficient-credit" && Ci(a)) return new wi(a);
24834
+ if (l === "ooxml-resource-limit" && Ui(o)) return new T(s, o);
24835
+ if (l && Xi.has(l)) return new w(l, s);
24822
24836
  let d = c === "TypeError" ? TypeError(s) : c === "RangeError" ? RangeError(s) : Error(s);
24823
24837
  return c && (d.name = c), l !== void 0 && Object.assign(d, { code: l }), d;
24824
24838
  }
24825
- function Qi(e) {
24839
+ function ta(e) {
24826
24840
  try {
24827
- return Zi(e);
24841
+ return ea(e);
24828
24842
  } catch {
24829
24843
  return /* @__PURE__ */ Error("Worker operation failed with an unreadable error payload");
24830
24844
  }
24831
24845
  }
24832
- var $i = Object.freeze({
24846
+ var na = Object.freeze({
24833
24847
  maxArchiveEntryBytes: ie,
24834
24848
  maxTotalInflatedBytes: ae,
24835
24849
  maxArchiveEntries: oe
24836
24850
  });
24837
- function ea(e, t, n) {
24851
+ function ra(e, t, n) {
24838
24852
  if (t === void 0) return n;
24839
24853
  if (t === null) return null;
24840
24854
  if (!Number.isSafeInteger(t) || t <= 0) throw RangeError(`resourceLimits.${e} must be null or a positive safe integer number of bytes`);
24841
24855
  return t;
24842
24856
  }
24843
- function ta(e) {
24844
- if (e === void 0) return $i.maxArchiveEntries;
24857
+ function ia(e) {
24858
+ if (e === void 0) return na.maxArchiveEntries;
24845
24859
  if (e === null) return null;
24846
24860
  if (!Number.isSafeInteger(e) || e <= 0) throw RangeError("resourceLimits.maxArchiveEntries must be null or a positive safe integer");
24847
24861
  if (e > 2e4) throw RangeError(`resourceLimits.maxArchiveEntries must not exceed the internal hard ceiling of ${se}`);
24848
24862
  return e;
24849
24863
  }
24850
- function na(e) {
24864
+ function aa(e) {
24851
24865
  if (!(e === void 0 || !(e > 0))) {
24852
24866
  if (!Number.isSafeInteger(e)) throw RangeError("maxZipEntryBytes must be a positive safe integer number of bytes");
24853
24867
  return e;
24854
24868
  }
24855
24869
  }
24856
- function ra(e) {
24870
+ function oa(e) {
24857
24871
  let t = e.resourceLimits;
24858
24872
  if (t !== void 0 && (typeof t != "object" || !t || Array.isArray(t))) throw TypeError("resourceLimits must be an object when provided");
24859
- let n = na(e.maxZipEntryBytes), r = t?.maxArchiveEntryBytes;
24873
+ let n = aa(e.maxZipEntryBytes), r = t?.maxArchiveEntryBytes;
24860
24874
  if (n !== void 0 && r !== void 0 && n !== r) throw RangeError("maxZipEntryBytes conflicts with resourceLimits.maxArchiveEntryBytes");
24861
24875
  return Object.freeze({
24862
- maxArchiveEntryBytes: ea("maxArchiveEntryBytes", r === void 0 ? n : r, $i.maxArchiveEntryBytes),
24863
- maxTotalInflatedBytes: ea("maxTotalInflatedBytes", t?.maxTotalInflatedBytes, $i.maxTotalInflatedBytes),
24864
- maxArchiveEntries: ta(t?.maxArchiveEntries)
24876
+ maxArchiveEntryBytes: ra("maxArchiveEntryBytes", r === void 0 ? n : r, na.maxArchiveEntryBytes),
24877
+ maxTotalInflatedBytes: ra("maxTotalInflatedBytes", t?.maxTotalInflatedBytes, na.maxTotalInflatedBytes),
24878
+ maxArchiveEntries: ia(t?.maxArchiveEntries)
24865
24879
  });
24866
24880
  }
24867
- function ia(e) {
24881
+ function sa(e) {
24868
24882
  if (e.debug !== void 0 && typeof e.debug != "boolean") throw TypeError("debug must be a boolean when provided");
24869
24883
  if (e.onResourceMetrics !== void 0 && typeof e.onResourceMetrics != "function") throw TypeError("onResourceMetrics must be a function when provided");
24870
24884
  return Object.freeze({
24871
- policy: ra(e),
24885
+ policy: oa(e),
24872
24886
  debug: e.debug ?? !1,
24873
24887
  ...e.onResourceMetrics ? { onResourceMetrics: e.onResourceMetrics } : {}
24874
24888
  });
24875
24889
  }
24876
- var aa = [
24890
+ var ca = [
24877
24891
  "font-family: \"SFMono-Regular\", Menlo, Monaco, Consolas, monospace",
24878
24892
  "font-size: 12px",
24879
24893
  "line-height: 1.35",
@@ -24881,41 +24895,41 @@ var aa = [
24881
24895
  "letter-spacing: 0",
24882
24896
  "white-space: pre"
24883
24897
  ].join(";");
24884
- function oa(e) {
24885
- if (sa()) {
24886
- console.log(`%c${e}`, aa);
24898
+ function la(e) {
24899
+ if (ua()) {
24900
+ console.log(`%c${e}`, ca);
24887
24901
  return;
24888
24902
  }
24889
24903
  console.log(e);
24890
24904
  }
24891
- function sa() {
24905
+ function ua() {
24892
24906
  return typeof window < "u" && globalThis.process?.release?.name !== "node";
24893
24907
  }
24894
- function ca(e) {
24895
- let t = e.scope === "session" ? "SESSION" : "LOAD", n = e.status === "ok" ? e.scope === "session" ? "COMPLETE" : "READY" : "FAILED", r = [pa(` OOXML ${t} ${e.format.toUpperCase()} ${n} `, 68)];
24896
- if (r.push(J(`mode ${e.mode.padEnd(8)} elapsed ${da(e.elapsedMs)}`, 68)), e.sourceBytes !== void 0 && r.push(J(`source ${ua(e.sourceBytes)}`, 68)), r.push(ma(" admission ", 68)), r.push(ha("largest entry", e.usage?.largestInflatedEntryBytes, e.policy.maxArchiveEntryBytes, 68)), r.push(ha("total inflated", e.usage?.distinctInflatedBytes, e.policy.maxTotalInflatedBytes, 68)), r.push(J(`entry count ${e.usage ? fa(e.usage.archiveEntryCount) : "—"} / ${e.policy.maxArchiveEntries === null ? "public off" : fa(e.policy.maxArchiveEntries)}`, 68)), e.usage ? r.push(J(`declared inflated ${ua(e.usage.declaredInflatedBytes)}`, 68)) : r.push(J("usage unavailable for this report", 68)), e.checkpoints.length > 0) {
24897
- r.push(ma(" checkpoints ", 68));
24908
+ function da(e) {
24909
+ let t = e.scope === "session" ? "SESSION" : "LOAD", n = e.status === "ok" ? e.scope === "session" ? "COMPLETE" : "READY" : "FAILED", r = [ga(` OOXML ${t} ${e.format.toUpperCase()} ${n} `, 68)];
24910
+ if (r.push(q(`mode ${e.mode.padEnd(8)} elapsed ${ma(e.elapsedMs)}`, 68)), e.sourceBytes !== void 0 && r.push(q(`source ${pa(e.sourceBytes)}`, 68)), r.push(_a(" admission ", 68)), r.push(va("largest entry", e.usage?.largestInflatedEntryBytes, e.policy.maxArchiveEntryBytes, 68)), r.push(va("total inflated", e.usage?.distinctInflatedBytes, e.policy.maxTotalInflatedBytes, 68)), r.push(q(`entry count ${e.usage ? ha(e.usage.archiveEntryCount) : "—"} / ${e.policy.maxArchiveEntries === null ? "public off" : ha(e.policy.maxArchiveEntries)}`, 68)), e.usage ? r.push(q(`declared inflated ${pa(e.usage.declaredInflatedBytes)}`, 68)) : r.push(q("usage unavailable for this report", 68)), e.checkpoints.length > 0) {
24911
+ r.push(_a(" checkpoints ", 68));
24898
24912
  for (let t of e.checkpoints) {
24899
- let e = t.usage ? ua(t.usage.distinctInflatedBytes) : "—";
24900
- r.push(J(`${da(t.elapsedMs).padStart(8)} ${t.name.padEnd(25)} ${e.padStart(12)}`, 68));
24913
+ let e = t.usage ? pa(t.usage.distinctInflatedBytes) : "—";
24914
+ r.push(q(`${ma(t.elapsedMs).padStart(8)} ${t.name.padEnd(25)} ${e.padStart(12)}`, 68));
24901
24915
  }
24902
24916
  }
24903
- if (e.outcome && Object.keys(e.outcome).length > 0 && (r.push(ma(" result ", 68)), r.push(J(Object.entries(e.outcome).map(([e, t]) => `${e} ${fa(t)}`).join(" "), 68))), e.error) {
24904
- r.push(ma(" failure ", 68));
24917
+ if (e.outcome && Object.keys(e.outcome).length > 0 && (r.push(_a(" result ", 68)), r.push(q(Object.entries(e.outcome).map(([e, t]) => `${e} ${ha(t)}`).join(" "), 68))), e.error) {
24918
+ r.push(_a(" failure ", 68));
24905
24919
  let t = [
24906
24920
  e.error.code,
24907
24921
  e.error.stage,
24908
24922
  e.error.resource,
24909
24923
  e.error.metric
24910
24924
  ].filter((e) => !!e).join(" · ");
24911
- r.push(J(t || "unclassified error", 68));
24925
+ r.push(q(t || "unclassified error", 68));
24912
24926
  }
24913
24927
  return r.push(`└${"─".repeat(68)}┘`), r.join("\n");
24914
24928
  }
24915
- function la(e) {
24916
- oa(ca(e));
24929
+ function fa(e) {
24930
+ la(da(e));
24917
24931
  }
24918
- function ua(e) {
24932
+ function pa(e) {
24919
24933
  if (!Number.isFinite(e) || e < 0) return "—";
24920
24934
  let t = [
24921
24935
  "B",
@@ -24928,36 +24942,36 @@ function ua(e) {
24928
24942
  let i = r === 0 || n >= 100 ? 0 : n >= 10 ? 1 : 2;
24929
24943
  return `${n.toFixed(i)} ${t[r]}`;
24930
24944
  }
24931
- function da(e) {
24945
+ function ma(e) {
24932
24946
  return e < 1e3 ? `${Math.round(e)} ms` : `${(e / 1e3).toFixed(2)} s`;
24933
24947
  }
24934
- function fa(e) {
24948
+ function ha(e) {
24935
24949
  return Number.isSafeInteger(e) ? e.toLocaleString("en-US") : "—";
24936
24950
  }
24937
- function pa(e, t) {
24951
+ function ga(e, t) {
24938
24952
  let n = e.slice(0, t);
24939
24953
  return `┌${n}${"─".repeat(t - n.length)}┐`;
24940
24954
  }
24941
- function ma(e, t) {
24955
+ function _a(e, t) {
24942
24956
  let n = e.slice(0, t);
24943
24957
  return `├${n}${"─".repeat(t - n.length)}┤`;
24944
24958
  }
24945
- function J(e, t) {
24959
+ function q(e, t) {
24946
24960
  let n = e.slice(0, t - 2);
24947
24961
  return `│ ${n}${" ".repeat(t - n.length - 2)} │`;
24948
24962
  }
24949
- function ha(e, t, n, r) {
24950
- let i = t === void 0 || n === null || n <= 0 ? 0 : Math.min(1, t / n), a = Math.round(i * 16), o = `${"█".repeat(a)}${"░".repeat(16 - a)}`, s = `${t === void 0 ? "—" : ua(t)} / ${n === null ? "public off" : ua(n)}`;
24951
- return J(`${e.padEnd(14)} ${o} ${s}`, r);
24963
+ function va(e, t, n, r) {
24964
+ let i = t === void 0 || n === null || n <= 0 ? 0 : Math.min(1, t / n), a = Math.round(i * 16), o = `${"█".repeat(a)}${"░".repeat(16 - a)}`, s = `${t === void 0 ? "—" : pa(t)} / ${n === null ? "public off" : pa(n)}`;
24965
+ return q(`${e.padEnd(14)} ${o} ${s}`, r);
24952
24966
  }
24953
- var ga = 1e3;
24954
- async function _a(e, t) {
24955
- e.observeUsage(await t(ga));
24967
+ var ya = 1e3;
24968
+ async function ba(e, t) {
24969
+ e.observeUsage(await t(ya));
24956
24970
  let n = e.current();
24957
24971
  if (!n) throw Error("OOXML resource metrics are not ready");
24958
24972
  return n;
24959
24973
  }
24960
- var va = class {
24974
+ var xa = class {
24961
24975
  now;
24962
24976
  startedAt;
24963
24977
  policy;
@@ -24971,7 +24985,7 @@ var va = class {
24971
24985
  terminalOutcome;
24972
24986
  terminalElapsedMs;
24973
24987
  constructor(e) {
24974
- this.options = e, this.now = e.now ?? xa, this.startedAt = this.now(), this.policy = Object.freeze({
24988
+ this.options = e, this.now = e.now ?? wa, this.startedAt = this.now(), this.policy = Object.freeze({
24975
24989
  maxArchiveEntryBytes: e.policy.maxArchiveEntryBytes,
24976
24990
  maxTotalInflatedBytes: e.policy.maxTotalInflatedBytes,
24977
24991
  maxArchiveEntries: e.policy.maxArchiveEntries
@@ -24985,16 +24999,16 @@ var va = class {
24985
24999
  }
24986
25000
  checkpoint(e, t) {
24987
25001
  if (!this.options.enabled || this.finished) return;
24988
- t && (this.lastUsage = Sa(t));
25002
+ t && (this.lastUsage = Ta(t));
24989
25003
  let n = this.lastUsage;
24990
25004
  this.checkpoints.push(Object.freeze({
24991
- name: Ta(e),
24992
- elapsedMs: wa(this.startedAt, this.now()),
25005
+ name: Oa(e),
25006
+ elapsedMs: Da(this.startedAt, this.now()),
24993
25007
  ...n ? { usage: n } : {}
24994
25008
  }));
24995
25009
  }
24996
25010
  observeUsage(e) {
24997
- !this.options.enabled || !e || (this.lastUsage = Sa(e));
25011
+ !this.options.enabled || !e || (this.lastUsage = Ta(e));
24998
25012
  }
24999
25013
  current() {
25000
25014
  if (!(!this.options.enabled || !this.terminalStatus)) return this.report(this.terminalStatus, this.terminalError, this.terminalOutcome);
@@ -25007,12 +25021,12 @@ var va = class {
25007
25021
  }
25008
25022
  finish(e, t, n) {
25009
25023
  if (!this.options.enabled || this.finished) return;
25010
- this.finished = !0, this.terminalStatus = e, this.terminalError = t, this.terminalOutcome = n, this.terminalElapsedMs = wa(this.startedAt, this.now());
25024
+ this.finished = !0, this.terminalStatus = e, this.terminalError = t, this.terminalOutcome = n, this.terminalElapsedMs = Da(this.startedAt, this.now());
25011
25025
  let r = this.report(e, t, n);
25012
- return this.options.onMetrics && ya(this.options.onMetrics, r), (this.options.emitToConsole ?? this.options.onMetrics === void 0) && ya(la, r), r;
25026
+ return this.options.onMetrics && Sa(this.options.onMetrics, r), (this.options.emitToConsole ?? this.options.onMetrics === void 0) && Sa(fa, r), r;
25013
25027
  }
25014
25028
  report(e, t, n) {
25015
- let r = Ca(t) ?? this.lastUsage;
25029
+ let r = Ea(t) ?? this.lastUsage;
25016
25030
  return Object.freeze({
25017
25031
  schemaVersion: 1,
25018
25032
  scope: this.options.scope ?? "load",
@@ -25020,28 +25034,28 @@ var va = class {
25020
25034
  mode: this.mode,
25021
25035
  status: e,
25022
25036
  ...this.sourceBytes === void 0 ? {} : { sourceBytes: this.sourceBytes },
25023
- elapsedMs: this.terminalElapsedMs ?? wa(this.startedAt, this.now()),
25037
+ elapsedMs: this.terminalElapsedMs ?? Da(this.startedAt, this.now()),
25024
25038
  policy: this.policy,
25025
25039
  ...r ? { usage: r } : {},
25026
25040
  checkpoints: Object.freeze([...this.checkpoints]),
25027
- ...n ? { outcome: Ea(n) } : {},
25028
- ...e === "error" ? { error: Da(t) } : {}
25041
+ ...n ? { outcome: ka(n) } : {},
25042
+ ...e === "error" ? { error: Aa(t) } : {}
25029
25043
  });
25030
25044
  }
25031
25045
  };
25032
- function ya(e, t) {
25046
+ function Sa(e, t) {
25033
25047
  try {
25034
25048
  let n = e(t);
25035
- ba(n) && Promise.resolve(n).catch(() => void 0);
25049
+ Ca(n) && Promise.resolve(n).catch(() => void 0);
25036
25050
  } catch {}
25037
25051
  }
25038
- function ba(e) {
25052
+ function Ca(e) {
25039
25053
  return (typeof e == "object" && !!e || typeof e == "function") && typeof e.then == "function";
25040
25054
  }
25041
- function xa() {
25055
+ function wa() {
25042
25056
  return typeof performance > "u" ? Date.now() : performance.now();
25043
25057
  }
25044
- function Sa(e) {
25058
+ function Ta(e) {
25045
25059
  return Object.freeze({
25046
25060
  archiveEntryCount: e.archiveEntryCount,
25047
25061
  declaredInflatedBytes: e.declaredInflatedBytes,
@@ -25050,23 +25064,23 @@ function Sa(e) {
25050
25064
  operationInflatedBytes: e.operationInflatedBytes
25051
25065
  });
25052
25066
  }
25053
- function Ca(e) {
25067
+ function Ea(e) {
25054
25068
  try {
25055
- return e instanceof T ? Sa(e.details.violation.usage) : void 0;
25069
+ return e instanceof T ? Ta(e.details.violation.usage) : void 0;
25056
25070
  } catch {
25057
25071
  return;
25058
25072
  }
25059
25073
  }
25060
- function wa(e, t) {
25074
+ function Da(e, t) {
25061
25075
  return Math.max(0, Math.round((t - e) * 10) / 10);
25062
25076
  }
25063
- function Ta(e) {
25077
+ function Oa(e) {
25064
25078
  return e.replace(/[^a-z0-9 -]/giu, "").trim().slice(0, 32) || "checkpoint";
25065
25079
  }
25066
- function Ea(e) {
25080
+ function ka(e) {
25067
25081
  return Object.freeze(Object.fromEntries(Object.entries(e).filter(([e, t]) => /^[a-z][a-z0-9-]{0,31}$/u.test(e) && Number.isSafeInteger(t) && t >= 0)));
25068
25082
  }
25069
- function Da(e) {
25083
+ function Aa(e) {
25070
25084
  try {
25071
25085
  if (e instanceof T) {
25072
25086
  let t = e.details.violation;
@@ -25078,18 +25092,18 @@ function Da(e) {
25078
25092
  });
25079
25093
  }
25080
25094
  if (e instanceof w || e instanceof h) return Object.freeze({ code: e.code });
25081
- if (e instanceof gi || typeof e == "object" && e && e.code === "parser-crashed") return Object.freeze({ code: "parser-crashed" });
25095
+ if (e instanceof yi || typeof e == "object" && e && e.code === "parser-crashed") return Object.freeze({ code: "parser-crashed" });
25082
25096
  } catch {}
25083
25097
  return Object.freeze({});
25084
25098
  }
25085
- var Oa = "ooxml-pull-v1";
25099
+ var J = "ooxml-pull-v1";
25086
25100
  function Y(e, t) {
25087
25101
  if (!Number.isSafeInteger(e) || e <= 0) throw RangeError(`${t} must be a positive safe integer`);
25088
25102
  }
25089
- function ka(e) {
25103
+ function ja(e) {
25090
25104
  if (!(typeof e == "string" && e.length > 0 || typeof e == "number" && Number.isSafeInteger(e) && e > 0)) throw RangeError("session id must be a non-empty string or positive safe integer");
25091
25105
  }
25092
- var Aa = class {
25106
+ var Ma = class {
25093
25107
  bridge;
25094
25108
  options;
25095
25109
  sequence = 0;
@@ -25102,7 +25116,7 @@ var Aa = class {
25102
25116
  orphanedRequestIds = /* @__PURE__ */ new Set();
25103
25117
  transferDisposers = /* @__PURE__ */ new Set();
25104
25118
  constructor(e, t) {
25105
- ka(t.sessionId), Y(t.operationId, "operation id"), Y(t.generation, "generation"), Y(t.maxByteCredit, "max byte credit"), t.cancelGraceMs !== void 0 && Y(t.cancelGraceMs, "cancel grace"), this.bridge = e, this.options = t;
25119
+ ja(t.sessionId), Y(t.operationId, "operation id"), Y(t.generation, "generation"), Y(t.maxByteCredit, "max byte credit"), t.cancelGraceMs !== void 0 && Y(t.cancelGraceMs, "cancel grace"), this.bridge = e, this.options = t;
25106
25120
  }
25107
25121
  async pull(e, t) {
25108
25122
  if (this.validateCredit(e), this.ending || this.completed) throw Error("pull session is closed");
@@ -25112,14 +25126,14 @@ var Aa = class {
25112
25126
  let n = this.sequence;
25113
25127
  try {
25114
25128
  let r = await this.request((t) => ({
25115
- protocol: Oa,
25129
+ protocol: J,
25116
25130
  kind: "pull",
25117
25131
  ...this.identity(),
25118
25132
  requestId: t,
25119
25133
  sequence: n,
25120
25134
  byteCredit: e
25121
25135
  }), t);
25122
- if (this.validateResponseIdentity(r), r.usage && (this.usage = r.usage), r.kind === "error") throw Qi(r.error);
25136
+ if (this.validateResponseIdentity(r), r.usage && (this.usage = r.usage), r.kind === "error") throw ta(r.error);
25123
25137
  if (r.kind !== "chunk") throw Error(`expected chunk response, received ${r.kind}`);
25124
25138
  if (this.ending) throw this.disposePayload(r.payload), Error("pull session is closed");
25125
25139
  try {
@@ -25129,14 +25143,14 @@ var Aa = class {
25129
25143
  }
25130
25144
  return this.outstanding = !0, this.makeChunk(r);
25131
25145
  } catch (e) {
25132
- throw !wi(e) && !this.ending && !this.completed && this.cancel("protocol-error").catch(() => void 0), e;
25146
+ throw !Di(e) && !this.ending && !this.completed && this.cancel("protocol-error").catch(() => void 0), e;
25133
25147
  } finally {
25134
25148
  this.pulling = !1;
25135
25149
  }
25136
25150
  }
25137
25151
  cancel(e = "closed", t) {
25138
25152
  return this.lifecyclePromise ? this.lifecyclePromise : (this.ending = !0, this.disposeAllTransferred(), this.lifecyclePromise = this.lifecycleControl(this.control("cancel", t, (t) => ({
25139
- protocol: Oa,
25153
+ protocol: J,
25140
25154
  kind: "cancel",
25141
25155
  ...this.identity(),
25142
25156
  requestId: t,
@@ -25145,7 +25159,7 @@ var Aa = class {
25145
25159
  }
25146
25160
  close(e) {
25147
25161
  return this.lifecyclePromise ? this.lifecyclePromise : (this.ending = !0, this.disposeAllTransferred(), this.lifecyclePromise = this.lifecycleControl(this.control("close", e, (e) => ({
25148
- protocol: Oa,
25162
+ protocol: J,
25149
25163
  kind: "close",
25150
25164
  ...this.identity(),
25151
25165
  requestId: e
@@ -25195,7 +25209,7 @@ var Aa = class {
25195
25209
  this.forgetLifecycleOrphans();
25196
25210
  return;
25197
25211
  }
25198
- throw Qi(r.error);
25212
+ throw ta(r.error);
25199
25213
  }
25200
25214
  if (r.kind !== "accepted" || r.command !== e) throw Error(`expected ${e} acceptance`);
25201
25215
  (e === "cancel" || e === "close") && this.forgetLifecycleOrphans();
@@ -25259,7 +25273,7 @@ var Aa = class {
25259
25273
  this.options.disposeTransferred?.(e);
25260
25274
  } catch {}
25261
25275
  }
25262
- }, ja = class {
25276
+ }, Na = class {
25263
25277
  owner;
25264
25278
  queue = Promise.resolve();
25265
25279
  leases = /* @__PURE__ */ new Map();
@@ -25316,7 +25330,7 @@ var Aa = class {
25316
25330
  }
25317
25331
  return this.fatal;
25318
25332
  }
25319
- }, Ma = class {
25333
+ }, Pa = class {
25320
25334
  options;
25321
25335
  coordinator;
25322
25336
  coordinatorOwner = Symbol("pull-session-host");
@@ -25334,7 +25348,7 @@ var Aa = class {
25334
25348
  driverCloseComplete = !1;
25335
25349
  completed = !1;
25336
25350
  constructor(e) {
25337
- ka(e.sessionId), Y(e.operationId, "operation id"), Y(e.generation, "generation"), Y(e.maxByteCredit, "max byte credit"), e.wireLeaseIdStart !== void 0 && Y(e.wireLeaseIdStart, "wire lease id start"), this.options = e, this.coordinator = e.coordinator, this.nextWireLeaseId = e.wireLeaseIdStart ?? 1, this.unregisterCleanup = this.coordinator.registerCleanup(() => this.forceFatalCleanup());
25351
+ ja(e.sessionId), Y(e.operationId, "operation id"), Y(e.generation, "generation"), Y(e.maxByteCredit, "max byte credit"), e.wireLeaseIdStart !== void 0 && Y(e.wireLeaseIdStart, "wire lease id start"), this.options = e, this.coordinator = e.coordinator, this.nextWireLeaseId = e.wireLeaseIdStart ?? 1, this.unregisterCleanup = this.coordinator.registerCleanup(() => this.forceFatalCleanup());
25338
25352
  }
25339
25353
  dispatch(e, t) {
25340
25354
  return this.coordinator.enqueue(async () => {
@@ -25393,7 +25407,7 @@ var Aa = class {
25393
25407
  case "close": return await this.close(), { response: this.accepted(e, "close") };
25394
25408
  }
25395
25409
  } catch (t) {
25396
- let n = Ki(t);
25410
+ let n = Yi(t);
25397
25411
  return n.code === "ooxml-resource-limit" && (n = await this.coordinator.poison(n)), { response: this.errorResponse(e, n) };
25398
25412
  }
25399
25413
  }
@@ -25452,7 +25466,7 @@ var Aa = class {
25452
25466
  }, {
25453
25467
  response: {
25454
25468
  kind: "chunk",
25455
- protocol: Oa,
25469
+ protocol: J,
25456
25470
  ...this.identity(),
25457
25471
  requestId: e.requestId,
25458
25472
  sequence: this.sequence,
@@ -25529,7 +25543,7 @@ var Aa = class {
25529
25543
  accepted(e, t, n = !1) {
25530
25544
  return {
25531
25545
  kind: "accepted",
25532
- protocol: Oa,
25546
+ protocol: J,
25533
25547
  ...n ? {
25534
25548
  sessionId: e.sessionId,
25535
25549
  operationId: e.operationId,
@@ -25556,7 +25570,7 @@ var Aa = class {
25556
25570
  errorResponse(e, t) {
25557
25571
  return {
25558
25572
  kind: "error",
25559
- protocol: Oa,
25573
+ protocol: J,
25560
25574
  sessionId: e.sessionId,
25561
25575
  operationId: e.operationId,
25562
25576
  generation: e.generation,
@@ -25603,7 +25617,7 @@ var Aa = class {
25603
25617
  return;
25604
25618
  }
25605
25619
  }
25606
- }, Na = [
25620
+ }, Fa = [
25607
25621
  "L",
25608
25622
  "R",
25609
25623
  "AL",
@@ -25627,7 +25641,7 @@ var Aa = class {
25627
25641
  "RLI",
25628
25642
  "FSI",
25629
25643
  "PDI"
25630
- ], Pa = [
25644
+ ], Ia = [
25631
25645
  0,
25632
25646
  9,
25633
25647
  10,
@@ -26895,7 +26909,7 @@ var Aa = class {
26895
26909
  1048574,
26896
26910
  1048576,
26897
26911
  1114110
26898
- ], Fa = [
26912
+ ], La = [
26899
26913
  9,
26900
26914
  11,
26901
26915
  10,
@@ -28163,7 +28177,7 @@ var Aa = class {
28163
28177
  9,
28164
28178
  0,
28165
28179
  9
28166
- ], Ia = [
28180
+ ], Ra = [
28167
28181
  40,
28168
28182
  41,
28169
28183
  41,
@@ -29020,7 +29034,7 @@ var Aa = class {
29020
29034
  65379,
29021
29035
  65379,
29022
29036
  65378
29023
- ], La = [
29037
+ ], za = [
29024
29038
  40,
29025
29039
  41,
29026
29040
  0,
@@ -29406,42 +29420,42 @@ var Aa = class {
29406
29420
  65378,
29407
29421
  1
29408
29422
  ];
29409
- function Ra(e) {
29410
- let t = 0, n = Pa.length - 1;
29423
+ function Ba(e) {
29424
+ let t = 0, n = Ia.length - 1;
29411
29425
  for (; t < n;) {
29412
29426
  let r = t + n + 1 >> 1;
29413
- Pa[r] <= e ? t = r : n = r - 1;
29427
+ Ia[r] <= e ? t = r : n = r - 1;
29414
29428
  }
29415
- return Fa[t];
29429
+ return La[t];
29416
29430
  }
29417
- function za(e) {
29418
- return Na[Ra(e)];
29431
+ function Va(e) {
29432
+ return Fa[Ba(e)];
29419
29433
  }
29420
- var Ba = (() => {
29434
+ var Ha = (() => {
29421
29435
  let e = /* @__PURE__ */ new Map();
29422
- for (let t = 0; t < Ia.length; t += 2) e.set(Ia[t], Ia[t + 1]);
29436
+ for (let t = 0; t < Ra.length; t += 2) e.set(Ra[t], Ra[t + 1]);
29423
29437
  return e;
29424
29438
  })();
29425
- function Va(e) {
29426
- return Ba.get(e) ?? null;
29439
+ function Ua(e) {
29440
+ return Ha.get(e) ?? null;
29427
29441
  }
29428
- var Ha = (() => {
29442
+ var Wa = (() => {
29429
29443
  let e = /* @__PURE__ */ new Map();
29430
- for (let t = 0; t < La.length; t += 3) e.set(La[t], {
29431
- pair: La[t + 1],
29432
- type: La[t + 2] === 0 ? "o" : "c"
29444
+ for (let t = 0; t < za.length; t += 3) e.set(za[t], {
29445
+ pair: za[t + 1],
29446
+ type: za[t + 2] === 0 ? "o" : "c"
29433
29447
  });
29434
29448
  return e;
29435
29449
  })();
29436
- function Ua(e) {
29437
- return Ha.get(e) ?? null;
29450
+ function Ga(e) {
29451
+ return Wa.get(e) ?? null;
29438
29452
  }
29439
- var Wa = (e) => e === "RLE" || e === "LRE" || e === "RLO" || e === "LRO" || e === "PDF" || e === "BN", Ga = (e) => e === "LRI" || e === "RLI" || e === "FSI", Ka = (e) => e === "B" || e === "S" || e === "WS" || e === "ON" || e === "FSI" || e === "LRI" || e === "RLI" || e === "PDI", qa = (e) => e & 1 ? e + 2 : e + 1, Ja = (e) => e & 1 ? e + 1 : e + 2;
29440
- function Ya(e, t, n) {
29453
+ var Ka = (e) => e === "RLE" || e === "LRE" || e === "RLO" || e === "LRO" || e === "PDF" || e === "BN", qa = (e) => e === "LRI" || e === "RLI" || e === "FSI", Ja = (e) => e === "B" || e === "S" || e === "WS" || e === "ON" || e === "FSI" || e === "LRI" || e === "RLI" || e === "PDI", Ya = (e) => e & 1 ? e + 2 : e + 1, Xa = (e) => e & 1 ? e + 1 : e + 2;
29454
+ function Za(e, t, n) {
29441
29455
  let r = 0;
29442
29456
  for (let i = t; i < n; i++) {
29443
29457
  let t = e[i];
29444
- if (Ga(t)) r++;
29458
+ if (qa(t)) r++;
29445
29459
  else if (t === "PDI") r > 0 && r--;
29446
29460
  else if (r === 0) {
29447
29461
  if (t === "L") return 0;
@@ -29450,11 +29464,11 @@ function Ya(e, t, n) {
29450
29464
  }
29451
29465
  return 0;
29452
29466
  }
29453
- function Xa(e) {
29467
+ function Qa(e) {
29454
29468
  let t = e.length, n = new Int32Array(t).fill(t), r = new Int32Array(t).fill(-1), i = [];
29455
29469
  for (let a = 0; a < t; a++) {
29456
29470
  let t = e[a];
29457
- if (Ga(t)) i.push(a);
29471
+ if (qa(t)) i.push(a);
29458
29472
  else if (t === "PDI" && i.length) {
29459
29473
  let e = i.pop();
29460
29474
  n[e] = a, r[a] = e;
@@ -29465,7 +29479,7 @@ function Xa(e) {
29465
29479
  initOf: r
29466
29480
  };
29467
29481
  }
29468
- function Za(e, t, n) {
29482
+ function $a(e, t, n) {
29469
29483
  let r = e.length, i = Array(r).fill(t), a = e.slice(), o = [{
29470
29484
  level: t,
29471
29485
  override: "neutral",
@@ -29479,7 +29493,7 @@ function Za(e, t, n) {
29479
29493
  case "RLO":
29480
29494
  case "LRO": {
29481
29495
  i[d] = u().level;
29482
- let e = r === "RLE" || r === "RLO" ? qa(u().level) : Ja(u().level);
29496
+ let e = r === "RLE" || r === "RLO" ? Ya(u().level) : Xa(u().level);
29483
29497
  e <= 125 && s === 0 && c === 0 ? o.push({
29484
29498
  level: e,
29485
29499
  override: r === "RLO" ? "R" : r === "LRO" ? "L" : "neutral",
@@ -29494,8 +29508,8 @@ function Za(e, t, n) {
29494
29508
  let t = u().override;
29495
29509
  t !== "neutral" && (a[d] = t);
29496
29510
  let f;
29497
- f = r === "RLI" ? "R" : r === "LRI" ? "L" : Ya(e, d + 1, n[d]) === 1 ? "R" : "L";
29498
- let p = f === "R" ? qa(u().level) : Ja(u().level);
29511
+ f = r === "RLI" ? "R" : r === "LRI" ? "L" : Za(e, d + 1, n[d]) === 1 ? "R" : "L";
29512
+ let p = f === "R" ? Ya(u().level) : Xa(u().level);
29499
29513
  p <= 125 && s === 0 && c === 0 ? (l++, o.push({
29500
29514
  level: p,
29501
29515
  override: "neutral",
@@ -29537,10 +29551,10 @@ function Za(e, t, n) {
29537
29551
  types: a
29538
29552
  };
29539
29553
  }
29540
- function Qa(e) {
29554
+ function eo(e) {
29541
29555
  return e === 9001 ? 12296 : e === 9002 ? 12297 : e;
29542
29556
  }
29543
- function $a(e, t, n, r, i, a) {
29557
+ function to(e, t, n, r, i, a) {
29544
29558
  let o = e.length, s = [];
29545
29559
  for (let e = 0; e < o; e++) n[e] || s.push(e);
29546
29560
  let c = [];
@@ -29558,7 +29572,7 @@ function $a(e, t, n, r, i, a) {
29558
29572
  for (;;) {
29559
29573
  for (let e of p) f.push(e);
29560
29574
  let t = p[p.length - 1];
29561
- if (Ga(e[t]) && i[t] !== o) {
29575
+ if (qa(e[t]) && i[t] !== o) {
29562
29576
  let e = l.get(i[t]);
29563
29577
  if (e) {
29564
29578
  p = e;
@@ -29573,7 +29587,7 @@ function $a(e, t, n, r, i, a) {
29573
29587
  break;
29574
29588
  }
29575
29589
  let g = u(Math.max(m, h)), _ = f[f.length - 1], v = r;
29576
- if (!(Ga(e[_]) && i[_] === o)) {
29590
+ if (!(qa(e[_]) && i[_] === o)) {
29577
29591
  for (let e = _ + 1; e < o; e++) if (!n[e]) {
29578
29592
  v = t[e];
29579
29593
  break;
@@ -29589,8 +29603,8 @@ function $a(e, t, n, r, i, a) {
29589
29603
  }
29590
29604
  return d;
29591
29605
  }
29592
- var eo = (e) => e === "L" ? "L" : e === "R" || e === "EN" || e === "AN" ? "R" : null;
29593
- function to(e, t, n, r, i) {
29606
+ var no = (e) => e === "L" ? "L" : e === "R" || e === "EN" || e === "AN" ? "R" : null;
29607
+ function ro(e, t, n, r, i) {
29594
29608
  let a = e.indices, o = a.length, { sos: s, eos: c, level: l } = e;
29595
29609
  for (let e = 0; e < o; e++) {
29596
29610
  let t = a[e];
@@ -29637,15 +29651,15 @@ function to(e, t, n, r, i) {
29637
29651
  outer: for (let n = 0; n < o; n++) {
29638
29652
  let i = a[n];
29639
29653
  if (r[i] !== "ON") continue;
29640
- let o = Ua(t[i]);
29654
+ let o = Ga(t[i]);
29641
29655
  if (o) if (o.type === "o") {
29642
29656
  if (e.length === 63) break outer;
29643
29657
  e.push({
29644
- expect: Qa(o.pair),
29658
+ expect: eo(o.pair),
29645
29659
  pos: n
29646
29660
  });
29647
29661
  } else {
29648
- let r = Qa(t[i]);
29662
+ let r = eo(t[i]);
29649
29663
  for (let t = e.length - 1; t >= 0; t--) if (e[t].expect === r) {
29650
29664
  f.push({
29651
29665
  open: e[t].pos,
@@ -29663,7 +29677,7 @@ function to(e, t, n, r, i) {
29663
29677
  for (let { open: e, close: t } of f) {
29664
29678
  let n = !1, i = !1;
29665
29679
  for (let o = e + 1; o < t; o++) {
29666
- let e = eo(r[a[o]]);
29680
+ let e = no(r[a[o]]);
29667
29681
  e === u ? n = !0 : e === d && (i = !0);
29668
29682
  }
29669
29683
  let o = null;
@@ -29671,7 +29685,7 @@ function to(e, t, n, r, i) {
29671
29685
  else if (i) {
29672
29686
  let t = s;
29673
29687
  for (let n = e - 1; n >= 0; n--) {
29674
- let e = eo(r[a[n]]);
29688
+ let e = no(r[a[n]]);
29675
29689
  if (e) {
29676
29690
  t = e;
29677
29691
  break;
@@ -29682,29 +29696,29 @@ function to(e, t, n, r, i) {
29682
29696
  o && (r[a[e]] = o, r[a[t]] = o, p(e, o), p(t, o));
29683
29697
  }
29684
29698
  for (let e = 0; e < o; e++) {
29685
- if (!Ka(r[a[e]])) continue;
29699
+ if (!Ja(r[a[e]])) continue;
29686
29700
  let t = e;
29687
- for (; t < o && Ka(r[a[t]]);) t++;
29688
- let n = e > 0 ? eo(r[a[e - 1]]) : s, i = t < o ? eo(r[a[t]]) : c;
29701
+ for (; t < o && Ja(r[a[t]]);) t++;
29702
+ let n = e > 0 ? no(r[a[e - 1]]) : s, i = t < o ? no(r[a[t]]) : c;
29689
29703
  if (n && i && n === i) for (let i = e; i < t; i++) r[a[i]] = n;
29690
29704
  e = t - 1;
29691
29705
  }
29692
- for (let e = 0; e < o; e++) Ka(r[a[e]]) && (r[a[e]] = u);
29706
+ for (let e = 0; e < o; e++) Ja(r[a[e]]) && (r[a[e]] = u);
29693
29707
  for (let e = 0; e < o; e++) {
29694
29708
  let t = a[e], n = r[t];
29695
29709
  l & 1 ? (n === "L" || n === "EN" || n === "AN") && (i[t] += 1) : n === "R" ? i[t] += 1 : (n === "AN" || n === "EN") && (i[t] += 2);
29696
29710
  }
29697
29711
  }
29698
- function no(e, t, n) {
29712
+ function io(e, t, n) {
29699
29713
  let r = e.length, i = Array(r);
29700
- for (let t = 0; t < r; t++) i[t] = n?.[t] ?? za(e[t]);
29701
- let a = t === "rtl" ? 1 : t === "ltr" ? 0 : Ya(i, 0, r), { pdiOf: o, initOf: s } = Xa(i), { levels: c, types: l } = Za(i, a, o), u = Array(r);
29702
- for (let e = 0; e < r; e++) u[e] = Wa(i[e]);
29703
- let d = $a(i, c, u, a, o, s), f = l.slice();
29704
- for (let t of d) to(t, e, i, f, c);
29714
+ for (let t = 0; t < r; t++) i[t] = n?.[t] ?? Va(e[t]);
29715
+ let a = t === "rtl" ? 1 : t === "ltr" ? 0 : Za(i, 0, r), { pdiOf: o, initOf: s } = Qa(i), { levels: c, types: l } = $a(i, a, o), u = Array(r);
29716
+ for (let e = 0; e < r; e++) u[e] = Ka(i[e]);
29717
+ let d = to(i, c, u, a, o, s), f = l.slice();
29718
+ for (let t of d) ro(t, e, i, f, c);
29705
29719
  let p = (e) => {
29706
29720
  let t = i[e];
29707
- return t === "WS" || Ga(t) || t === "PDI" || u[e];
29721
+ return t === "WS" || qa(t) || t === "PDI" || u[e];
29708
29722
  };
29709
29723
  for (let e = 0; e < r; e++) {
29710
29724
  let t = i[e];
@@ -29720,7 +29734,7 @@ function no(e, t, n) {
29720
29734
  paragraphLevel: a
29721
29735
  };
29722
29736
  }
29723
- function ro(e, t, n) {
29737
+ function ao(e, t, n) {
29724
29738
  let r = [];
29725
29739
  for (let i = t; i < n; i++) {
29726
29740
  let t = e[i];
@@ -29746,7 +29760,7 @@ function ro(e, t, n) {
29746
29760
  }
29747
29761
  return r;
29748
29762
  }
29749
- function io(e) {
29763
+ function oo(e) {
29750
29764
  let t = [], n = [], r = [];
29751
29765
  for (let i = 0; i < e.length;) {
29752
29766
  let a = e.codePointAt(i), o = a > 65535 ? 2 : 1;
@@ -29758,9 +29772,9 @@ function io(e) {
29758
29772
  starts: r
29759
29773
  };
29760
29774
  }
29761
- var ao = class {
29775
+ var so = class {
29762
29776
  computeLevels(e, t, n) {
29763
- let { cps: r, units: i, starts: a } = io(e), { levels: o, paragraphLevel: s } = no(r, t, n ? r.map((e, t) => n[a[t]] ?? null) : void 0), c = new Uint8Array(e.length), l = 0;
29777
+ let { cps: r, units: i, starts: a } = oo(e), { levels: o, paragraphLevel: s } = io(r, t, n ? r.map((e, t) => n[a[t]] ?? null) : void 0), c = new Uint8Array(e.length), l = 0;
29764
29778
  for (let e = 0; e < o.length; e++) {
29765
29779
  let t = o[e] === -1 ? 255 : o[e];
29766
29780
  for (let n = 0; n < i[e]; n++) c[l++] = t;
@@ -29771,55 +29785,55 @@ var ao = class {
29771
29785
  };
29772
29786
  }
29773
29787
  reorderVisual(e, t, n) {
29774
- return ro(e, t, n);
29788
+ return ao(e, t, n);
29775
29789
  }
29776
29790
  getMirror(e) {
29777
- return Va(e);
29791
+ return Ua(e);
29778
29792
  }
29779
29793
  };
29780
- function oo() {
29781
- return new ao();
29782
- }
29783
- var so = null;
29784
29794
  function co() {
29785
- return so === null && (so = oo()), so;
29795
+ return new so();
29786
29796
  }
29787
- var lo = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]|[\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]/u;
29788
- function uo(e) {
29789
- return lo.test(e);
29797
+ var lo = null;
29798
+ function uo() {
29799
+ return lo === null && (lo = co()), lo;
29790
29800
  }
29791
- function fo(e, t, n) {
29801
+ var fo = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]|[\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]/u;
29802
+ function po(e) {
29803
+ return fo.test(e);
29804
+ }
29805
+ function mo(e, t, n) {
29792
29806
  let r = n.length, i = new Uint8Array(r);
29793
29807
  for (let a = 0; a < r; a++) {
29794
29808
  let r = e[n[a]];
29795
29809
  i[a] = r === 255 ? t : r;
29796
29810
  }
29797
29811
  return {
29798
- order: co().reorderVisual(i, 0, r),
29812
+ order: uo().reorderVisual(i, 0, r),
29799
29813
  segLevels: i
29800
29814
  };
29801
29815
  }
29802
- var po = "”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆", mo = "“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅";
29803
- function ho(e) {
29816
+ var ho = "”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆", go = "“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅";
29817
+ function _o(e) {
29804
29818
  let t = /* @__PURE__ */ new Set();
29805
29819
  for (let n of e) t.add(n.codePointAt(0));
29806
29820
  return t;
29807
29821
  }
29808
- function go(e) {
29822
+ function vo(e) {
29809
29823
  return {
29810
29824
  enabled: e?.kinsoku !== !1,
29811
- lineStartForbidden: ho(e?.noLineBreaksBefore ?? po),
29812
- lineEndForbidden: ho(e?.noLineBreaksAfter ?? mo)
29825
+ lineStartForbidden: _o(e?.noLineBreaksBefore ?? ho),
29826
+ lineEndForbidden: _o(e?.noLineBreaksAfter ?? go)
29813
29827
  };
29814
29828
  }
29815
- var _o = go();
29816
- function vo(e, t, n, r = 1) {
29829
+ var yo = vo();
29830
+ function bo(e, t, n, r = 1) {
29817
29831
  if (!n.enabled || t <= 0 || t >= e.length) return t;
29818
29832
  let i = (t) => t < e.length && n.lineStartForbidden.has(e[t].codePointAt(0)), a = (t) => t >= 0 && n.lineEndForbidden.has(e[t].codePointAt(0)), o = t;
29819
29833
  for (; o > r && (i(o) || a(o - 1));) o--;
29820
29834
  return o <= r && (i(o) || a(o - 1)) ? t : o;
29821
29835
  }
29822
- function yo(e, t, n) {
29836
+ function xo(e, t, n) {
29823
29837
  if (!t.enabled) return 0;
29824
29838
  let r = e.length - n;
29825
29839
  for (let n = 1; n <= r; n++) {
@@ -29830,13 +29844,13 @@ function yo(e, t, n) {
29830
29844
  }
29831
29845
  return 0;
29832
29846
  }
29833
- function bo(e) {
29847
+ function So(e) {
29834
29848
  return e >= 12288 && e <= 40959 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65280 && e <= 65519;
29835
29849
  }
29836
- function xo(e) {
29837
- return e === 32 || e === 9 || e === 10 || e === 13 ? !1 : !bo(e);
29850
+ function Co(e) {
29851
+ return e === 32 || e === 9 || e === 10 || e === 13 ? !1 : !So(e);
29838
29852
  }
29839
- var So = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB.CL.CP.EB.EM.EX.H2.H3.HL.HH.HY.ID.IN.IS.JL.JT.JV.NS.NU.OP.PO.PR.QU.RI.SY.VF.VI".split("."), Co = [
29853
+ var wo = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB.CL.CP.EB.EM.EX.H2.H3.HL.HH.HY.ID.IN.IS.JL.JT.JV.NS.NU.OP.PO.PR.QU.RI.SY.VF.VI".split("."), To = [
29840
29854
  0,
29841
29855
  9,
29842
29856
  10,
@@ -32459,7 +32473,7 @@ var So = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
32459
32473
  917632,
32460
32474
  917760,
32461
32475
  918e3
32462
- ], wo = [
32476
+ ], Eo = [
32463
32477
  1,
32464
32478
  15,
32465
32479
  4,
@@ -35082,7 +35096,7 @@ var So = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
35082
35096
  11,
35083
35097
  1,
35084
35098
  11
35085
- ], To = [
35099
+ ], Do = [
35086
35100
  4352,
35087
35101
  8361,
35088
35102
  8986,
@@ -35212,7 +35226,7 @@ var So = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
35212
35226
  129775,
35213
35227
  131072,
35214
35228
  196608
35215
- ], Eo = [
35229
+ ], Oo = [
35216
35230
  4448,
35217
35231
  8362,
35218
35232
  8988,
@@ -35343,66 +35357,66 @@ var So = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
35343
35357
  196606,
35344
35358
  262142
35345
35359
  ];
35346
- function Do(e) {
35347
- let t = 0, n = Co.length - 1;
35360
+ function ko(e) {
35361
+ let t = 0, n = To.length - 1;
35348
35362
  for (; t < n;) {
35349
35363
  let r = t + n + 1 >> 1;
35350
- Co[r] <= e ? t = r : n = r - 1;
35364
+ To[r] <= e ? t = r : n = r - 1;
35351
35365
  }
35352
- return So[wo[t]];
35366
+ return wo[Eo[t]];
35353
35367
  }
35354
- function Oo(e) {
35355
- let t = 0, n = To.length - 1;
35356
- if (n < 0 || e < To[0]) return !1;
35368
+ function Ao(e) {
35369
+ let t = 0, n = Do.length - 1;
35370
+ if (n < 0 || e < Do[0]) return !1;
35357
35371
  for (; t < n;) {
35358
35372
  let r = t + n + 1 >> 1;
35359
- To[r] <= e ? t = r : n = r - 1;
35373
+ Do[r] <= e ? t = r : n = r - 1;
35360
35374
  }
35361
- return e < Eo[t];
35375
+ return e < Oo[t];
35362
35376
  }
35363
- function ko(e, t) {
35364
- let n = Do(e);
35377
+ function jo(e, t) {
35378
+ let n = ko(e);
35365
35379
  if (n === "OP") return !0;
35366
- let r = Do(t), i = n === "AL" || n === "HL", a = r === "AL" || r === "HL";
35367
- return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !Oo(t) || n === "CP" && !Oo(e) && (a || r === "NU"));
35380
+ let r = ko(t), i = n === "AL" || n === "HL", a = r === "AL" || r === "HL";
35381
+ return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !Ao(t) || n === "CP" && !Ao(e) && (a || r === "NU"));
35368
35382
  }
35369
- function Ao(e) {
35383
+ function Mo(e) {
35370
35384
  return e === "my" || e === "bo";
35371
35385
  }
35372
35386
  function X(e) {
35373
35387
  return e >= 3584 && e <= 3711 || e >= 3712 && e <= 3839 || e >= 6016 && e <= 6143 || e >= 4096 && e <= 4255 || e >= 43616 && e <= 43647 || e >= 43488 && e <= 43519 || e >= 3840 && e <= 4095;
35374
35388
  }
35375
- function jo(e) {
35389
+ function No(e) {
35376
35390
  return e === 3633 || e >= 3635 && e <= 3642 || e >= 3655 && e <= 3662 || e === 3761 || e >= 3763 && e <= 3772 || e >= 3784 && e <= 3790 || e >= 6068 && e <= 6099 || e === 6109;
35377
35391
  }
35378
- function Mo(e) {
35392
+ function Po(e) {
35379
35393
  return e <= 3711 ? "th" : e <= 3839 ? "lo" : e <= 4095 ? "bo" : e <= 4255 ? "my" : e <= 6143 ? "km" : "my";
35380
35394
  }
35381
- function No(e) {
35395
+ function Fo(e) {
35382
35396
  for (let t of e) if (X(t.codePointAt(0))) return !0;
35383
35397
  return !1;
35384
35398
  }
35385
- function Po(e) {
35399
+ function Io(e) {
35386
35400
  for (let t of e) {
35387
35401
  let e = t.codePointAt(0);
35388
- if (X(e)) return Ao(Mo(e));
35402
+ if (X(e)) return Mo(Po(e));
35389
35403
  }
35390
35404
  return !1;
35391
35405
  }
35392
- function Fo(e) {
35406
+ function Lo(e) {
35393
35407
  let t = !1;
35394
35408
  for (let n of e) {
35395
35409
  let e = n.codePointAt(0);
35396
35410
  if (X(e)) {
35397
- if (Ao(Mo(e))) return !1;
35411
+ if (Mo(Po(e))) return !1;
35398
35412
  t = !0;
35399
35413
  }
35400
35414
  }
35401
35415
  return t;
35402
35416
  }
35403
- var Io, Lo = /* @__PURE__ */ new Map();
35404
- function Ro(e) {
35405
- let t = Lo.get(e);
35417
+ var Ro, zo = /* @__PURE__ */ new Map();
35418
+ function Bo(e) {
35419
+ let t = zo.get(e);
35406
35420
  if (t !== void 0) return t;
35407
35421
  let n = null;
35408
35422
  try {
@@ -35410,19 +35424,19 @@ function Ro(e) {
35410
35424
  } catch {
35411
35425
  n = null;
35412
35426
  }
35413
- return Lo.set(e, n), n;
35427
+ return zo.set(e, n), n;
35414
35428
  }
35415
- function zo(e) {
35416
- if (Io === null) return null;
35417
- if (typeof Io == "function") {
35418
- let t = Io;
35429
+ function Vo(e) {
35430
+ if (Ro === null) return null;
35431
+ if (typeof Ro == "function") {
35432
+ let t = Ro;
35419
35433
  return (n) => t(n, e);
35420
35434
  }
35421
- let t = Ro(e);
35435
+ let t = Bo(e);
35422
35436
  return t ? (e) => t.segment(e) : null;
35423
35437
  }
35424
- function Bo(e) {
35425
- if (!No(e)) return [];
35438
+ function Ho(e) {
35439
+ if (!Fo(e)) return [];
35426
35440
  let t = [], n = e.length, r = 0;
35427
35441
  for (; r < n;) {
35428
35442
  let i = e.codePointAt(r), a = i > 65535 ? 2 : 1;
@@ -35430,16 +35444,16 @@ function Bo(e) {
35430
35444
  r += a;
35431
35445
  continue;
35432
35446
  }
35433
- let o = Mo(i), s = Ao(o), c = r + a;
35447
+ let o = Po(i), s = Mo(o), c = r + a;
35434
35448
  for (; c < n;) {
35435
35449
  let t = e.codePointAt(c);
35436
- if (!X(t) || Ao(Mo(t)) !== s) break;
35450
+ if (!X(t) || Mo(Po(t)) !== s) break;
35437
35451
  c += t > 65535 ? 2 : 1;
35438
35452
  }
35439
35453
  let l = e.slice(r, c);
35440
- if (s) for (let e of Jo(l)) t.push(r + e);
35454
+ if (s) for (let e of Xo(l)) t.push(r + e);
35441
35455
  else {
35442
- let e = zo(o);
35456
+ let e = Vo(o);
35443
35457
  if (e) {
35444
35458
  let n = [];
35445
35459
  try {
@@ -35452,42 +35466,42 @@ function Bo(e) {
35452
35466
  }
35453
35467
  return t;
35454
35468
  }
35455
- function Vo(e) {
35456
- if (!No(e)) return [];
35469
+ function Uo(e) {
35470
+ if (!Fo(e)) return [];
35457
35471
  let t = [], n = e.length, r = e.codePointAt(0), i = r > 65535 ? 2 : 1;
35458
35472
  for (; i < n;) {
35459
35473
  let n = e.codePointAt(i), a = n > 65535 ? 2 : 1;
35460
- X(r) !== X(n) && !Ho(r) && !Ho(n) && t.push(i), r = n, i += a;
35474
+ X(r) !== X(n) && !Wo(r) && !Wo(n) && t.push(i), r = n, i += a;
35461
35475
  }
35462
35476
  return t;
35463
35477
  }
35464
- function Ho(e) {
35478
+ function Wo(e) {
35465
35479
  return e === 32 || e === 9 || e === 10 || e === 13 || e === 12288 || e === 160 || e === 8199 || e === 8239 || e === 8288 || e === 65279;
35466
35480
  }
35467
- function Uo(e, t) {
35468
- if (!No(e)) return [];
35469
- let n = e.length, r = new Set(Bo(e)), i = new Set(Jo(e)), a = (e) => {
35481
+ function Go(e, t) {
35482
+ if (!Fo(e)) return [];
35483
+ let n = e.length, r = new Set(Ho(e)), i = new Set(Xo(e)), a = (e) => {
35470
35484
  i.has(e) && r.add(e);
35471
35485
  };
35472
- for (let t of Vo(e)) a(t);
35486
+ for (let t of Uo(e)) a(t);
35473
35487
  if (t?.cjk) {
35474
35488
  let t = e.codePointAt(0), r = t > 65535 ? 2 : 1;
35475
35489
  for (; r < n;) {
35476
35490
  let n = e.codePointAt(r);
35477
- (bo(n) || bo(t)) && a(r), t = n, r += n > 65535 ? 2 : 1;
35491
+ (So(n) || So(t)) && a(r), t = n, r += n > 65535 ? 2 : 1;
35478
35492
  }
35479
35493
  }
35480
35494
  let o = t?.kinsoku, s = o != null && o.enabled !== !1, c = [];
35481
35495
  for (let t of r) if (!(t <= 0 || t >= n)) {
35482
35496
  if (s) {
35483
- let n = e.codePointAt(t), r = Wo(e, t);
35497
+ let n = e.codePointAt(t), r = Ko(e, t);
35484
35498
  if (r !== void 0 && o.lineEndForbidden.has(r) || o.lineStartForbidden.has(n)) continue;
35485
35499
  }
35486
35500
  c.push(t);
35487
35501
  }
35488
35502
  return c.sort((e, t) => e - t), c;
35489
35503
  }
35490
- function Wo(e, t) {
35504
+ function Ko(e, t) {
35491
35505
  if (t <= 0) return;
35492
35506
  let n = e.charCodeAt(t - 1);
35493
35507
  if (n >= 56320 && n <= 57343 && t >= 2) {
@@ -35496,7 +35510,7 @@ function Wo(e, t) {
35496
35510
  }
35497
35511
  return n;
35498
35512
  }
35499
- function Go(e, t, n, r, i, a = !1) {
35513
+ function qo(e, t, n, r, i, a = !1) {
35500
35514
  let o = e.length;
35501
35515
  if (n >= o) return n;
35502
35516
  if (a) {
@@ -35512,19 +35526,19 @@ function Go(e, t, n, r, i, a = !1) {
35512
35526
  for (let a of t) a <= n || a >= o || i(e.slice(n, a)) <= r && (s = a);
35513
35527
  return i(e.slice(n, o)) <= r && (s = o), s;
35514
35528
  }
35515
- var Ko;
35516
- function qo() {
35517
- if (Ko !== void 0) return Ko;
35529
+ var Jo;
35530
+ function Yo() {
35531
+ if (Jo !== void 0) return Jo;
35518
35532
  let e = null;
35519
35533
  try {
35520
35534
  typeof Intl < "u" && typeof Intl.Segmenter == "function" && (e = new Intl.Segmenter(void 0, { granularity: "grapheme" }));
35521
35535
  } catch {
35522
35536
  e = null;
35523
35537
  }
35524
- return Ko = e, e;
35538
+ return Jo = e, e;
35525
35539
  }
35526
- function Jo(e) {
35527
- let t = qo();
35540
+ function Xo(e) {
35541
+ let t = Yo();
35528
35542
  if (t) try {
35529
35543
  let n = [];
35530
35544
  for (let r of t.segment(e)) r.index > 0 && n.push(r.index);
@@ -35537,12 +35551,12 @@ function Jo(e) {
35537
35551
  }
35538
35552
  return n;
35539
35553
  }
35540
- var Yo = [
35554
+ var Zo = [
35541
35555
  "U",
35542
35556
  "R",
35543
35557
  "Tu",
35544
35558
  "Tr"
35545
- ], Xo = [
35559
+ ], Qo = [
35546
35560
  0,
35547
35561
  167,
35548
35562
  168,
@@ -35823,7 +35837,7 @@ var Yo = [
35823
35837
  1048574,
35824
35838
  1048576,
35825
35839
  1114110
35826
- ], Zo = [
35840
+ ], $o = [
35827
35841
  1,
35828
35842
  0,
35829
35843
  1,
@@ -36105,29 +36119,29 @@ var Yo = [
36105
36119
  0,
36106
36120
  1
36107
36121
  ];
36108
- function Qo(e) {
36109
- let t = 0, n = Xo.length - 1;
36122
+ function es(e) {
36123
+ let t = 0, n = Qo.length - 1;
36110
36124
  for (; t < n;) {
36111
36125
  let r = t + n + 1 >> 1;
36112
- Xo[r] <= e ? t = r : n = r - 1;
36126
+ Qo[r] <= e ? t = r : n = r - 1;
36113
36127
  }
36114
- return Zo[t];
36128
+ return $o[t];
36115
36129
  }
36116
- function $o(e) {
36117
- return Yo[Qo(e)];
36130
+ function ts(e) {
36131
+ return Zo[es(e)];
36118
36132
  }
36119
- function es(e) {
36120
- return ts.get(e) ?? null;
36133
+ function ns(e) {
36134
+ return rs.get(e) ?? null;
36121
36135
  }
36122
- var ts = new Map([
36136
+ var rs = new Map([
36123
36137
  [65292, 65040],
36124
36138
  [12289, 65041],
36125
36139
  [12290, 65042]
36126
36140
  ]);
36127
- function ns(e) {
36128
- return rs.get(e) ?? null;
36141
+ function is(e) {
36142
+ return as.get(e) ?? null;
36129
36143
  }
36130
- var rs = new Map([
36144
+ var as = new Map([
36131
36145
  [65288, 65077],
36132
36146
  [65289, 65078],
36133
36147
  [65371, 65079],
@@ -36146,38 +36160,38 @@ var rs = new Map([
36146
36160
  [12303, 65092],
36147
36161
  [12310, 65047],
36148
36162
  [12311, 65048]
36149
- ]), is = new Set([65307]);
36150
- function as(e) {
36151
- return is.has(e);
36163
+ ]), os = new Set([65307]);
36164
+ function ss(e) {
36165
+ return os.has(e);
36152
36166
  }
36153
- var os = new Set([
36167
+ var cs = new Set([
36154
36168
  12540,
36155
36169
  12316,
36156
36170
  65374
36157
36171
  ]);
36158
- function ss(e) {
36159
- return os.has(e);
36172
+ function ls(e) {
36173
+ return cs.has(e);
36160
36174
  }
36161
- var cs = 256, ls = 200, us = /* @__PURE__ */ new WeakMap();
36162
- function ds(e) {
36175
+ var us = 256, ds = 200, fs = /* @__PURE__ */ new WeakMap();
36176
+ function ps(e) {
36163
36177
  let t = e.canvas, n = t?.ownerDocument?.defaultView?.HTMLCanvasElement;
36164
36178
  return typeof n == "function" && t instanceof n || typeof HTMLCanvasElement < "u" && t instanceof HTMLCanvasElement ? t : null;
36165
36179
  }
36166
- function fs(e, t) {
36180
+ function ms(e, t) {
36167
36181
  return e.replace(/(^|\s)\d*\.?\d+(?:px|pt|pc|in|cm|mm|q|em|rem|%)(?:\/[^\s]+)?(?=\s)/i, `$1${t}`);
36168
36182
  }
36169
- function ps(e, t = !0) {
36183
+ function hs(e, t = !0) {
36170
36184
  let n = e.trim();
36171
36185
  return [...n === "" || n.toLowerCase() === "normal" ? [] : n.split(",").map((e) => e.trim()).filter((e) => !/^(["'])vert\1(?:\s+(?:on|off|\d+))?$/i.test(e)), `"vert" ${+!!t}`].join(", ");
36172
36186
  }
36173
- function ms(e) {
36187
+ function gs(e) {
36174
36188
  try {
36175
36189
  let t = e.ownerDocument?.defaultView, n = t?.getComputedStyle ? t.getComputedStyle(e) : typeof getComputedStyle == "function" ? getComputedStyle(e) : null;
36176
36190
  if (n?.fontFeatureSettings) return n.fontFeatureSettings;
36177
36191
  } catch {}
36178
36192
  return e.style.fontFeatureSettings;
36179
36193
  }
36180
- function hs(e, t) {
36194
+ function _s(e, t) {
36181
36195
  if (e.isConnected) return t();
36182
36196
  let n = e.ownerDocument ?? (typeof document > "u" ? null : document), r = n?.body ?? n?.documentElement;
36183
36197
  if (!r) return t();
@@ -36218,15 +36232,15 @@ function hs(e, t) {
36218
36232
  if (t !== void 0 && !c) throw t;
36219
36233
  }
36220
36234
  }
36221
- function gs(e, t) {
36222
- let n = ds(e);
36223
- return n === null ? t() : hs(n, t);
36235
+ function vs(e, t) {
36236
+ let n = ps(e);
36237
+ return n === null ? t() : _s(n, t);
36224
36238
  }
36225
- function _s(e) {
36226
- let t = us.get(e);
36239
+ function ys(e) {
36240
+ let t = fs.get(e);
36227
36241
  if (t) return t;
36228
36242
  let n = e.createElement("canvas");
36229
- n.width = cs, n.height = cs, n.setAttribute("aria-hidden", "true"), Object.assign(n.style, {
36243
+ n.width = us, n.height = us, n.setAttribute("aria-hidden", "true"), Object.assign(n.style, {
36230
36244
  position: "fixed",
36231
36245
  left: "-99999px",
36232
36246
  top: "0",
@@ -36240,9 +36254,9 @@ function _s(e) {
36240
36254
  }, i = () => {
36241
36255
  r.epoch += 1, r.cache.clear();
36242
36256
  };
36243
- return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i), us.set(e, r), r;
36257
+ return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i), fs.set(e, r), r;
36244
36258
  }
36245
- function vs(e, t) {
36259
+ function bs(e, t) {
36246
36260
  let { width: n, height: r } = e.canvas, i = e.getImageData(0, 0, n, r).data, a = new Uint8ClampedArray(n * r), o = n, s = r, c = -1, l = -1, u = 0, d = 0, f = 0;
36247
36261
  for (let e = 0; e < r; e += 1) for (let t = 0; t < n; t += 1) {
36248
36262
  let r = i[(e * n + t) * 4 + 3];
@@ -36269,28 +36283,28 @@ function vs(e, t) {
36269
36283
  ]
36270
36284
  };
36271
36285
  }
36272
- function ys(e, t, n) {
36286
+ function xs(e, t, n) {
36273
36287
  let r = e.canvas;
36274
36288
  r.style.fontFeatureSettings = n, e.font = e.font, e.clearRect(0, 0, r.width, r.height);
36275
36289
  let i = String.fromCodePoint(t);
36276
- return e.fillText(i, r.width / 2, r.height / 2), vs(e, i);
36290
+ return e.fillText(i, r.width / 2, r.height / 2), bs(e, i);
36277
36291
  }
36278
- function bs(e, t) {
36292
+ function Ss(e, t) {
36279
36293
  let n = 0, r = Math.min(e.length, t.length);
36280
36294
  for (let i = 0; i < r; i += 1) n += Math.abs(e[i] - t[i]);
36281
36295
  return n;
36282
36296
  }
36283
- function xs(e, t, n, r) {
36297
+ function Cs(e, t, n, r) {
36284
36298
  let i = (e, t, n, r) => {
36285
- let i = Math.max(bs(e, t), bs(n, r));
36286
- return Math.min(bs(e, n), bs(e, r), bs(t, n), bs(t, r)) > i;
36299
+ let i = Math.max(Ss(e, t), Ss(n, r));
36300
+ return Math.min(Ss(e, n), Ss(e, r), Ss(t, n), Ss(t, r)) > i;
36287
36301
  };
36288
36302
  return i(e.alpha, t.alpha, n.alpha, r.alpha) || i(e.geometry, t.geometry, n.geometry, r.geometry) || i(e.metrics, t.metrics, n.metrics, r.metrics);
36289
36303
  }
36290
- function Ss(e, t) {
36291
- let n = ds(e);
36304
+ function ws(e, t) {
36305
+ let n = ps(e);
36292
36306
  if (n === null || typeof document > "u") return !1;
36293
- let r = n.ownerDocument ?? document, i = _s(r), a = ms(n), o = `${i.epoch}:${fs(e.font, "<size>")}:${a}:${t}`, s = i.cache.get(o);
36307
+ let r = n.ownerDocument ?? document, i = ys(r), a = gs(n), o = `${i.epoch}:${ms(e.font, "<size>")}:${a}:${t}`, s = i.cache.get(o);
36294
36308
  if (s !== void 0) return s;
36295
36309
  let c = !1, l = r.body ?? r.documentElement;
36296
36310
  if (!l) return !1;
@@ -36300,9 +36314,9 @@ function Ss(e, t) {
36300
36314
  if (d !== null) {
36301
36315
  let n = i.canvas.style.fontFeatureSettings;
36302
36316
  try {
36303
- d.font = fs(e.font, `${ls}px`), d.fillStyle = "#000", d.textAlign = "center", d.textBaseline = "middle";
36304
- let n = ps(a, !1), r = ps(a, !0), i = ys(d, t, n), o = ys(d, t, n), s = ys(d, t, r), l = ys(d, t, r);
36305
- c = i !== null && o !== null && s !== null && l !== null && xs(i, o, s, l);
36317
+ d.font = ms(e.font, `${ds}px`), d.fillStyle = "#000", d.textAlign = "center", d.textBaseline = "middle";
36318
+ let n = hs(a, !1), r = hs(a, !0), i = xs(d, t, n), o = xs(d, t, n), s = xs(d, t, r), l = xs(d, t, r);
36319
+ c = i !== null && o !== null && s !== null && l !== null && Cs(i, o, s, l);
36306
36320
  } catch {
36307
36321
  c = !1;
36308
36322
  } finally {
@@ -36311,11 +36325,11 @@ function Ss(e, t) {
36311
36325
  }
36312
36326
  return i.cache.set(o, c), c;
36313
36327
  }
36314
- function Cs(e, t) {
36328
+ function Ts(e, t) {
36315
36329
  let n = e.canvas;
36316
- return n?.style ? gs(e, () => {
36330
+ return n?.style ? vs(e, () => {
36317
36331
  let r = n.style, i = r.fontFeatureSettings;
36318
- r.fontFeatureSettings = ps(ms(n)), e.font = e.font;
36332
+ r.fontFeatureSettings = hs(gs(n)), e.font = e.font;
36319
36333
  try {
36320
36334
  return t();
36321
36335
  } finally {
@@ -36323,8 +36337,8 @@ function Cs(e, t) {
36323
36337
  }
36324
36338
  }) : t();
36325
36339
  }
36326
- function ws(e, t) {
36327
- return Cs(e, () => {
36340
+ function Es(e, t) {
36341
+ return Ts(e, () => {
36328
36342
  let n = e.textAlign, r = e.textBaseline;
36329
36343
  e.textAlign = "center", e.textBaseline = "middle";
36330
36344
  try {
@@ -36341,13 +36355,13 @@ function ws(e, t) {
36341
36355
  }
36342
36356
  });
36343
36357
  }
36344
- var Ts = [
36358
+ var Ds = [
36345
36359
  "http",
36346
36360
  "https",
36347
36361
  "mailto",
36348
36362
  "tel"
36349
36363
  ];
36350
- function Es(e) {
36364
+ function Os(e) {
36351
36365
  let t = "";
36352
36366
  for (let n of e) {
36353
36367
  let e = n.codePointAt(0);
@@ -36356,18 +36370,18 @@ function Es(e) {
36356
36370
  let n = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);
36357
36371
  return n ? n[1].toLowerCase() : null;
36358
36372
  }
36359
- function Ds(e, t = Ts) {
36373
+ function ks(e, t = Ds) {
36360
36374
  if (e === "") return null;
36361
- let n = Es(e);
36375
+ let n = Os(e);
36362
36376
  return n === null || t.includes(n) ? e : null;
36363
36377
  }
36364
- function Os(e, t = Ts, n = typeof window < "u" ? window : void 0) {
36365
- let r = Ds(e, t);
36378
+ function As(e, t = Ds, n = typeof window < "u" ? window : void 0) {
36379
+ let r = ks(e, t);
36366
36380
  return r === null || !n ? !1 : (n.open(r, "_blank", "noopener,noreferrer"), !0);
36367
36381
  }
36368
36382
  //#endregion
36369
- //#region ../../node_modules/@silurus/ooxml/dist/canvas-viewer-mechanics-DN5SqWGS.js
36370
- var ks = [
36383
+ //#region ../../node_modules/@silurus/ooxml/dist/canvas-viewer-mechanics-Cpk0YFvM.js
36384
+ var js = [
36371
36385
  208,
36372
36386
  207,
36373
36387
  17,
@@ -36376,44 +36390,44 @@ var ks = [
36376
36390
  177,
36377
36391
  26,
36378
36392
  225
36379
- ], As = 4294967290, js = 512, Ms = 128, Ns = 4096, Ps = 8192, Fs = new Set([
36393
+ ], Ms = 4294967290, Ns = 512, Ps = 128, Fs = 4096, Is = 8192, Ls = new Set([
36380
36394
  "WordDocument",
36381
36395
  "Workbook",
36382
36396
  "Book",
36383
36397
  "PowerPoint Document"
36384
- ]), Is = "EncryptionInfo";
36385
- function Ls(e) {
36386
- if (e.length < js) return null;
36387
- for (let t = 0; t < ks.length; t++) if (e[t] !== ks[t]) return null;
36398
+ ]), Rs = "EncryptionInfo";
36399
+ function zs(e) {
36400
+ if (e.length < Ns) return null;
36401
+ for (let t = 0; t < js.length; t++) if (e[t] !== js[t]) return null;
36388
36402
  let t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = t.getUint16(30, !0);
36389
36403
  if (n !== 9 && n !== 12) return "cfb-unknown";
36390
- let r = 1 << n, i = t.getUint32(48, !0), a = Rs(t, e.length, r, i);
36404
+ let r = 1 << n, i = t.getUint32(48, !0), a = Bs(t, e.length, r, i);
36391
36405
  if (a === null) return "cfb-unknown";
36392
- if (a.has(Is)) return "encrypted";
36393
- for (let e of a) if (Fs.has(e)) return "legacy-binary-format";
36406
+ if (a.has(Rs)) return "encrypted";
36407
+ for (let e of a) if (Ls.has(e)) return "legacy-binary-format";
36394
36408
  return "cfb-unknown";
36395
36409
  }
36396
- function Rs(e, t, n, r) {
36397
- if (!Hs(r)) return null;
36398
- let i = /* @__PURE__ */ new Set(), a = Math.floor(n / Ms);
36410
+ function Bs(e, t, n, r) {
36411
+ if (!Ws(r)) return null;
36412
+ let i = /* @__PURE__ */ new Set(), a = Math.floor(n / Ps);
36399
36413
  if (a < 1) return null;
36400
36414
  let o = /* @__PURE__ */ new Set(), s = r, c = 0, l = 0;
36401
- for (; Hs(s) && !(c++ > Ps || o.has(s));) {
36415
+ for (; Ws(s) && !(c++ > Is || o.has(s));) {
36402
36416
  o.add(s);
36403
- let r = Vs(s, n);
36417
+ let r = Us(s, n);
36404
36418
  if (r < 0 || r + n > t) return null;
36405
36419
  for (let t = 0; t < a; t++) {
36406
- if (l++ > Ns) return i;
36407
- let n = zs(e, r + t * Ms);
36420
+ if (l++ > Fs) return i;
36421
+ let n = Vs(e, r + t * Ps);
36408
36422
  n && i.add(n);
36409
36423
  }
36410
- let c = Bs(e, t, n, s);
36424
+ let c = Hs(e, t, n, s);
36411
36425
  if (c === null) break;
36412
36426
  s = c;
36413
36427
  }
36414
36428
  return i;
36415
36429
  }
36416
- function zs(e, t) {
36430
+ function Vs(e, t) {
36417
36431
  let n = e.getUint16(t + 64, !0);
36418
36432
  if (n < 2 || n > 64) return "";
36419
36433
  let r = n / 2 - 1, i = "";
@@ -36424,7 +36438,7 @@ function zs(e, t) {
36424
36438
  }
36425
36439
  return i;
36426
36440
  }
36427
- function Bs(e, t, n, r) {
36441
+ function Hs(e, t, n, r) {
36428
36442
  let i = Math.floor(n / 4);
36429
36443
  if (i < 1) return null;
36430
36444
  let a = Math.floor(r / i), o = r % i;
@@ -36432,17 +36446,17 @@ function Bs(e, t, n, r) {
36432
36446
  let s = 76 + a * 4;
36433
36447
  if (s + 4 > t) return null;
36434
36448
  let c = e.getUint32(s, !0);
36435
- if (!Hs(c)) return null;
36436
- let l = Vs(c, n), u = l + o * 4;
36449
+ if (!Ws(c)) return null;
36450
+ let l = Us(c, n), u = l + o * 4;
36437
36451
  return l < 0 || u + 4 > t ? null : e.getUint32(u, !0);
36438
36452
  }
36439
- function Vs(e, t) {
36453
+ function Us(e, t) {
36440
36454
  return (e + 1) * t;
36441
36455
  }
36442
- function Hs(e) {
36443
- return e >= 0 && e <= As;
36456
+ function Ws(e) {
36457
+ return e >= 0 && e <= Ms;
36444
36458
  }
36445
- var Us = [
36459
+ var Gs = [
36446
36460
  208,
36447
36461
  207,
36448
36462
  17,
@@ -36451,20 +36465,20 @@ var Us = [
36451
36465
  177,
36452
36466
  26,
36453
36467
  225
36454
- ], Ws = 4294967290, Gs = 4294967294, Ks = 512, qs = 128, Js = 4e6, Ys = 8e6, Xs = 65536, Zs = 1e6;
36455
- function Qs(e, t) {
36456
- if (e.length < Ks) return null;
36457
- for (let t = 0; t < Us.length; t++) if (e[t] !== Us[t]) return null;
36458
- let n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = $s(n);
36468
+ ], Ks = 4294967290, qs = 4294967294, Js = 512, Ys = 128, Xs = 4e6, Zs = 8e6, Qs = 65536, $s = 1e6;
36469
+ function ec(e, t) {
36470
+ if (e.length < Js) return null;
36471
+ for (let t = 0; t < Gs.length; t++) if (e[t] !== Gs[t]) return null;
36472
+ let n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = tc(n);
36459
36473
  if (r === null) return null;
36460
- let i = tc(n, e.length, r);
36474
+ let i = rc(n, e.length, r);
36461
36475
  if (i === null) return null;
36462
- let a = rc(n, e.length, r, i, t);
36476
+ let a = ac(n, e.length, r, i, t);
36463
36477
  if (a === null || a.target === null) return null;
36464
36478
  let { target: o, root: s } = a;
36465
- return o.size === 0 ? new Uint8Array() : o.size < r.miniStreamCutoff ? s === null ? null : oc(n, e.length, r, i, s, o) : ac(n, e.length, r, i, o.startSector, o.size);
36479
+ return o.size === 0 ? new Uint8Array() : o.size < r.miniStreamCutoff ? s === null ? null : cc(n, e.length, r, i, s, o) : sc(n, e.length, r, i, o.startSector, o.size);
36466
36480
  }
36467
- function $s(e) {
36481
+ function tc(e) {
36468
36482
  let t = e.getUint16(30, !0);
36469
36483
  if (t !== 9 && t !== 12) return null;
36470
36484
  let n = e.getUint16(32, !0);
@@ -36478,13 +36492,13 @@ function $s(e) {
36478
36492
  numDifatSectors: e.getUint32(72, !0)
36479
36493
  } : null;
36480
36494
  }
36481
- function ec(e, t) {
36495
+ function nc(e, t) {
36482
36496
  return (e + 1) * t;
36483
36497
  }
36484
36498
  function Z(e) {
36485
- return e >= 0 && e <= Ws;
36499
+ return e >= 0 && e <= Ks;
36486
36500
  }
36487
- function tc(e, t, n) {
36501
+ function rc(e, t, n) {
36488
36502
  let { sectorSize: r } = n, i = [];
36489
36503
  for (let t = 0; t < 109; t++) {
36490
36504
  let n = e.getUint32(76 + t * 4, !0);
@@ -36492,10 +36506,10 @@ function tc(e, t, n) {
36492
36506
  }
36493
36507
  let a = r / 4 - 1, o = n.firstDifatSector, s = /* @__PURE__ */ new Set(), c = 0;
36494
36508
  for (; Z(o);) {
36495
- if (c++ > Zs) return null;
36509
+ if (c++ > $s) return null;
36496
36510
  if (s.has(o)) break;
36497
36511
  s.add(o);
36498
- let n = ec(o, r);
36512
+ let n = nc(o, r);
36499
36513
  if (n < 0 || n + r > t) return null;
36500
36514
  for (let t = 0; t < a; t++) {
36501
36515
  let r = e.getUint32(n + t * 4, !0);
@@ -36505,30 +36519,30 @@ function tc(e, t, n) {
36505
36519
  }
36506
36520
  return i;
36507
36521
  }
36508
- function nc(e, t, n, r, i) {
36522
+ function ic(e, t, n, r, i) {
36509
36523
  let a = n / 4, o = Math.floor(i / a), s = i % a;
36510
36524
  if (o >= r.length) return null;
36511
36525
  let c = r[o];
36512
36526
  if (!Z(c)) return null;
36513
- let l = ec(c, n) + s * 4;
36527
+ let l = nc(c, n) + s * 4;
36514
36528
  return l < 0 || l + 4 > t ? null : e.getUint32(l, !0);
36515
36529
  }
36516
- function rc(e, t, n, r, i) {
36517
- let { sectorSize: a } = n, o = Math.floor(a / qs);
36530
+ function ac(e, t, n, r, i) {
36531
+ let { sectorSize: a } = n, o = Math.floor(a / Ys);
36518
36532
  if (o < 1) return null;
36519
36533
  let s = null, c = null, l = /* @__PURE__ */ new Set(), u = n.firstDirSector, d = 0, f = 0;
36520
36534
  for (; Z(u);) {
36521
- if (d++ > Js) return null;
36535
+ if (d++ > Xs) return null;
36522
36536
  if (l.has(u)) break;
36523
36537
  l.add(u);
36524
- let n = ec(u, a);
36538
+ let n = nc(u, a);
36525
36539
  if (n < 0 || n + a > t) return null;
36526
36540
  for (let t = 0; t < o; t++) {
36527
- if (f++ > Xs) return {
36541
+ if (f++ > Qs) return {
36528
36542
  target: s,
36529
36543
  root: c
36530
36544
  };
36531
- let r = n + t * qs, a = e.getUint8(r + 66);
36545
+ let r = n + t * Ys, a = e.getUint8(r + 66);
36532
36546
  if (a === 0) continue;
36533
36547
  let o = e.getUint32(r + 116, !0), l = e.getUint32(r + 120, !0);
36534
36548
  if (a === 5) {
@@ -36538,12 +36552,12 @@ function rc(e, t, n, r, i) {
36538
36552
  };
36539
36553
  continue;
36540
36554
  }
36541
- ic(e, r) === i && (s = {
36555
+ oc(e, r) === i && (s = {
36542
36556
  startSector: o,
36543
36557
  size: l
36544
36558
  });
36545
36559
  }
36546
- let p = nc(e, t, a, r, u);
36560
+ let p = ic(e, t, a, r, u);
36547
36561
  if (p === null) break;
36548
36562
  u = p;
36549
36563
  }
@@ -36552,7 +36566,7 @@ function rc(e, t, n, r, i) {
36552
36566
  root: c
36553
36567
  };
36554
36568
  }
36555
- function ic(e, t) {
36569
+ function oc(e, t) {
36556
36570
  let n = e.getUint16(t + 64, !0);
36557
36571
  if (n < 2 || n > 64) return "";
36558
36572
  let r = n / 2 - 1, i = "";
@@ -36563,54 +36577,54 @@ function ic(e, t) {
36563
36577
  }
36564
36578
  return i;
36565
36579
  }
36566
- function ac(e, t, n, r, i, a) {
36580
+ function sc(e, t, n, r, i, a) {
36567
36581
  let { sectorSize: o } = n, s = new Uint8Array(a), c = 0, l = i, u = /* @__PURE__ */ new Set(), d = 0;
36568
36582
  for (; Z(l) && c < a;) {
36569
- if (d++ > Js || u.has(l)) return null;
36583
+ if (d++ > Xs || u.has(l)) return null;
36570
36584
  u.add(l);
36571
- let n = ec(l, o);
36585
+ let n = nc(l, o);
36572
36586
  if (n < 0 || n + o > t) return null;
36573
36587
  let i = Math.min(o, a - c);
36574
36588
  s.set(new Uint8Array(e.buffer, e.byteOffset + n, i), c), c += i;
36575
- let f = nc(e, t, o, r, l);
36589
+ let f = ic(e, t, o, r, l);
36576
36590
  if (f === null) return null;
36577
36591
  l = f;
36578
36592
  }
36579
36593
  return c === a ? s : null;
36580
36594
  }
36581
- function oc(e, t, n, r, i, a) {
36582
- let { sectorSize: o, miniSectorSize: s } = n, c = ac(e, t, n, r, i.startSector, i.size);
36595
+ function cc(e, t, n, r, i, a) {
36596
+ let { sectorSize: o, miniSectorSize: s } = n, c = sc(e, t, n, r, i.startSector, i.size);
36583
36597
  if (c === null) return null;
36584
36598
  let l = new Uint8Array(a.size), u = 0, d = a.startSector, f = /* @__PURE__ */ new Set(), p = 0, m = o / 4;
36585
36599
  for (; Z(d) && u < a.size;) {
36586
- if (p++ > Ys || f.has(d)) return null;
36600
+ if (p++ > Zs || f.has(d)) return null;
36587
36601
  f.add(d);
36588
36602
  let i = d * s;
36589
36603
  if (i < 0 || i + s > c.length) return null;
36590
36604
  let o = Math.min(s, a.size - u);
36591
36605
  l.set(c.subarray(i, i + o), u), u += o;
36592
- let h = sc(e, t, n, r, m, d);
36606
+ let h = lc(e, t, n, r, m, d);
36593
36607
  if (h === null) return null;
36594
36608
  d = h;
36595
36609
  }
36596
36610
  return u === a.size ? l : null;
36597
36611
  }
36598
- function sc(e, t, n, r, i, a) {
36612
+ function lc(e, t, n, r, i, a) {
36599
36613
  let { sectorSize: o } = n, s = Math.floor(a / i), c = a % i, l = n.firstMiniFatSector, u = /* @__PURE__ */ new Set();
36600
36614
  for (let n = 0; n < s; n++) {
36601
36615
  if (!Z(l) || u.has(l)) return null;
36602
36616
  u.add(l);
36603
- let n = nc(e, t, o, r, l);
36617
+ let n = ic(e, t, o, r, l);
36604
36618
  if (n === null) return null;
36605
36619
  l = n;
36606
36620
  }
36607
36621
  if (!Z(l)) return null;
36608
- let d = ec(l, o) + c * 4;
36622
+ let d = nc(l, o) + c * 4;
36609
36623
  if (d < 0 || d + 4 > t) return null;
36610
36624
  let f = e.getUint32(d, !0);
36611
- return f === Gs ? Gs : f;
36625
+ return f === qs ? qs : f;
36612
36626
  }
36613
- function cc(e) {
36627
+ function uc(e) {
36614
36628
  if (typeof atob == "function") {
36615
36629
  let t = atob(e), n = new Uint8Array(t.length);
36616
36630
  for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
@@ -36626,13 +36640,13 @@ function Q(e, t, n) {
36626
36640
  let i = r[0], a = RegExp(`\\b${n}\\s*=\\s*"([^"]*)"`).exec(i);
36627
36641
  return a ? a[1] : null;
36628
36642
  }
36629
- function lc(e) {
36643
+ function dc(e) {
36630
36644
  if (e === null) return null;
36631
36645
  let t = Number(e);
36632
36646
  return Number.isFinite(t) ? t : null;
36633
36647
  }
36634
- function uc(e, t) {
36635
- let n = lc(Q(e, t, "saltSize")), r = lc(Q(e, t, "blockSize")), i = lc(Q(e, t, "keyBits")), a = lc(Q(e, t, "hashSize")), o = Q(e, t, "cipherAlgorithm"), s = Q(e, t, "cipherChaining"), c = Q(e, t, "hashAlgorithm"), l = Q(e, t, "saltValue");
36648
+ function fc(e, t) {
36649
+ let n = dc(Q(e, t, "saltSize")), r = dc(Q(e, t, "blockSize")), i = dc(Q(e, t, "keyBits")), a = dc(Q(e, t, "hashSize")), o = Q(e, t, "cipherAlgorithm"), s = Q(e, t, "cipherChaining"), c = Q(e, t, "hashAlgorithm"), l = Q(e, t, "saltValue");
36636
36650
  return n === null || r === null || i === null || a === null || !o || !s || !c || l === null ? null : {
36637
36651
  saltSize: n,
36638
36652
  blockSize: r,
@@ -36641,14 +36655,14 @@ function uc(e, t) {
36641
36655
  cipherAlgorithm: o,
36642
36656
  cipherChaining: s,
36643
36657
  hashAlgorithm: c,
36644
- saltValue: cc(l)
36658
+ saltValue: uc(l)
36645
36659
  };
36646
36660
  }
36647
- function dc(e) {
36661
+ function pc(e) {
36648
36662
  if (e.length < 8) return { kind: "unknown" };
36649
36663
  let t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = t.getUint16(0, !0), r = t.getUint16(2, !0);
36650
36664
  if (n === 4 && r === 4) {
36651
- let t = fc(e.subarray(8));
36665
+ let t = mc(e.subarray(8));
36652
36666
  return t ? {
36653
36667
  kind: "agile",
36654
36668
  descriptor: t
@@ -36656,28 +36670,28 @@ function dc(e) {
36656
36670
  }
36657
36671
  return r === 16 && (n === 3 || n === 4) ? { kind: "extensible" } : r === 2 && (n === 2 || n === 3 || n === 4) ? { kind: "standard" } : { kind: "unknown" };
36658
36672
  }
36659
- function fc(e) {
36660
- let t = new TextDecoder("utf-8").decode(e), n = uc(t, "keyData"), r = uc(t, "encryptedKey");
36673
+ function mc(e) {
36674
+ let t = new TextDecoder("utf-8").decode(e), n = fc(t, "keyData"), r = fc(t, "encryptedKey");
36661
36675
  if (!n || !r) return null;
36662
- let i = lc(Q(t, "encryptedKey", "spinCount")), a = Q(t, "encryptedKey", "encryptedVerifierHashInput"), o = Q(t, "encryptedKey", "encryptedVerifierHashValue"), s = Q(t, "encryptedKey", "encryptedKeyValue");
36676
+ let i = dc(Q(t, "encryptedKey", "spinCount")), a = Q(t, "encryptedKey", "encryptedVerifierHashInput"), o = Q(t, "encryptedKey", "encryptedVerifierHashValue"), s = Q(t, "encryptedKey", "encryptedKeyValue");
36663
36677
  if (i === null || a === null || o === null || s === null) return null;
36664
36678
  let c = {
36665
36679
  ...r,
36666
36680
  spinCount: i,
36667
- encryptedVerifierHashInput: cc(a),
36668
- encryptedVerifierHashValue: cc(o),
36669
- encryptedKeyValue: cc(s)
36681
+ encryptedVerifierHashInput: uc(a),
36682
+ encryptedVerifierHashValue: uc(o),
36683
+ encryptedKeyValue: uc(s)
36670
36684
  }, l = null, u = Q(t, "dataIntegrity", "encryptedHmacKey"), d = Q(t, "dataIntegrity", "encryptedHmacValue");
36671
36685
  return u !== null && d !== null && (l = {
36672
- encryptedHmacKey: cc(u),
36673
- encryptedHmacValue: cc(d)
36686
+ encryptedHmacKey: uc(u),
36687
+ encryptedHmacValue: uc(d)
36674
36688
  }), {
36675
36689
  keyData: n,
36676
36690
  passwordKeyEncryptor: c,
36677
36691
  dataIntegrity: l
36678
36692
  };
36679
36693
  }
36680
- var pc = {
36694
+ var hc = {
36681
36695
  verifierHashInput: new Uint8Array([
36682
36696
  254,
36683
36697
  167,
@@ -36728,18 +36742,18 @@ var pc = {
36728
36742
  132,
36729
36743
  51
36730
36744
  ])
36731
- }, mc = 54, hc = 4096, $ = class extends Error {
36745
+ }, gc = 54, _c = 4096, $ = class extends Error {
36732
36746
  reason;
36733
36747
  constructor(e, t) {
36734
36748
  super(t), this.name = "AgileDecryptError", this.reason = e;
36735
36749
  }
36736
36750
  };
36737
- function gc() {
36751
+ function vc() {
36738
36752
  let e = globalThis.crypto;
36739
36753
  if (!e || !e.subtle) throw new $("unsupported-encryption", "WebCrypto (globalThis.crypto.subtle) is unavailable; cannot decrypt.");
36740
36754
  return e.subtle;
36741
36755
  }
36742
- function _c(e) {
36756
+ function yc(e) {
36743
36757
  switch (e.toUpperCase().replace(/[-_]/g, "")) {
36744
36758
  case "SHA512": return "SHA-512";
36745
36759
  case "SHA384": return "SHA-384";
@@ -36748,98 +36762,98 @@ function _c(e) {
36748
36762
  default: throw new $("unsupported-encryption", `Unsupported hashAlgorithm "${e}" (only SHA-1/256/384/512).`);
36749
36763
  }
36750
36764
  }
36751
- function vc(e) {
36765
+ function bc(e) {
36752
36766
  if (e.cipherAlgorithm.toUpperCase() !== "AES") throw new $("unsupported-encryption", `Unsupported cipherAlgorithm "${e.cipherAlgorithm}" (only AES).`);
36753
36767
  if (e.cipherChaining.toLowerCase() !== "chainingmodecbc") throw new $("unsupported-encryption", `Unsupported cipherChaining "${e.cipherChaining}" (only ChainingModeCBC).`);
36754
36768
  if (e.keyBits !== 128 && e.keyBits !== 192 && e.keyBits !== 256) throw new $("unsupported-encryption", `Unsupported keyBits ${e.keyBits} (only 128/192/256).`);
36755
36769
  }
36756
- function yc(...e) {
36770
+ function xc(...e) {
36757
36771
  let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
36758
36772
  for (let t of e) n.set(t, r), r += t.length;
36759
36773
  return n;
36760
36774
  }
36761
- function bc(e) {
36775
+ function Sc(e) {
36762
36776
  let t = new Uint8Array(4);
36763
36777
  return new DataView(t.buffer).setUint32(0, e >>> 0, !0), t;
36764
36778
  }
36765
- function xc(e) {
36779
+ function Cc(e) {
36766
36780
  let t = new Uint8Array(e.length * 2), n = new DataView(t.buffer);
36767
36781
  for (let t = 0; t < e.length; t++) n.setUint16(t * 2, e.charCodeAt(t), !0);
36768
36782
  return t;
36769
36783
  }
36770
- async function Sc(e, t) {
36771
- return new Uint8Array(await gc().digest(e, t));
36784
+ async function wc(e, t) {
36785
+ return new Uint8Array(await vc().digest(e, t));
36772
36786
  }
36773
- function Cc(e, t) {
36787
+ function Tc(e, t) {
36774
36788
  if (e.length > t) return e.slice(0, t);
36775
36789
  let n = new Uint8Array(t);
36776
- return n.set(e), e.length < t && n.fill(mc, e.length), n;
36790
+ return n.set(e), e.length < t && n.fill(gc, e.length), n;
36777
36791
  }
36778
- async function wc(e, t, n, r) {
36779
- let i = _c(t.hashAlgorithm), a = await Sc(i, yc(t.saltValue, xc(e)));
36780
- for (let e = 0; e < n; e++) a = await Sc(i, yc(bc(e), a));
36781
- return Cc(await Sc(i, yc(a, r)), t.keyBits / 8);
36792
+ async function Ec(e, t, n, r) {
36793
+ let i = yc(t.hashAlgorithm), a = await wc(i, xc(t.saltValue, Cc(e)));
36794
+ for (let e = 0; e < n; e++) a = await wc(i, xc(Sc(e), a));
36795
+ return Tc(await wc(i, xc(a, r)), t.keyBits / 8);
36782
36796
  }
36783
- async function Tc(e, t, n) {
36784
- return Cc(n ? await Sc(_c(e.hashAlgorithm), yc(t, n)) : t, e.blockSize);
36797
+ async function Dc(e, t, n) {
36798
+ return Tc(n ? await wc(yc(e.hashAlgorithm), xc(t, n)) : t, e.blockSize);
36785
36799
  }
36786
- async function Ec(e, t, n) {
36800
+ async function Oc(e, t, n) {
36787
36801
  let r = t.length;
36788
36802
  if (n.length === 0) return new Uint8Array();
36789
36803
  if (n.length % r !== 0) throw new $("corrupt", "ciphertext length is not a multiple of the block size");
36790
- let i = await gc().importKey("raw", e, { name: "AES-CBC" }, !1, ["decrypt"]), a = await gc().importKey("raw", e, { name: "AES-CBC" }, !1, ["encrypt"]), o = n.subarray(n.length - r), s = Dc(new Uint8Array(r).fill(r), o), c = yc(n, new Uint8Array(await gc().encrypt({
36804
+ let i = await vc().importKey("raw", e, { name: "AES-CBC" }, !1, ["decrypt"]), a = await vc().importKey("raw", e, { name: "AES-CBC" }, !1, ["encrypt"]), o = n.subarray(n.length - r), s = kc(new Uint8Array(r).fill(r), o), c = xc(n, new Uint8Array(await vc().encrypt({
36791
36805
  name: "AES-CBC",
36792
36806
  iv: new Uint8Array(r)
36793
- }, a, s)).subarray(0, r)), l = new Uint8Array(await gc().decrypt({
36807
+ }, a, s)).subarray(0, r)), l = new Uint8Array(await vc().decrypt({
36794
36808
  name: "AES-CBC",
36795
36809
  iv: t
36796
36810
  }, i, c));
36797
36811
  return l.length >= n.length ? l.subarray(0, n.length) : l;
36798
36812
  }
36799
- function Dc(e, t) {
36813
+ function kc(e, t) {
36800
36814
  let n = new Uint8Array(e.length);
36801
36815
  for (let r = 0; r < e.length; r++) n[r] = e[r] ^ t[r];
36802
36816
  return n;
36803
36817
  }
36804
- async function Oc(e, t) {
36805
- vc(t);
36806
- let n = _c(t.hashAlgorithm), r = await Ec(await wc(e, t, t.spinCount, pc.verifierHashInput), await Tc(t, t.saltValue, null), t.encryptedVerifierHashInput), i = await Ec(await wc(e, t, t.spinCount, pc.verifierHashValue), await Tc(t, t.saltValue, null), t.encryptedVerifierHashValue);
36807
- return kc((await Sc(n, r)).subarray(0, t.hashSize), i.subarray(0, t.hashSize));
36818
+ async function Ac(e, t) {
36819
+ bc(t);
36820
+ let n = yc(t.hashAlgorithm), r = await Oc(await Ec(e, t, t.spinCount, hc.verifierHashInput), await Dc(t, t.saltValue, null), t.encryptedVerifierHashInput), i = await Oc(await Ec(e, t, t.spinCount, hc.verifierHashValue), await Dc(t, t.saltValue, null), t.encryptedVerifierHashValue);
36821
+ return jc((await wc(n, r)).subarray(0, t.hashSize), i.subarray(0, t.hashSize));
36808
36822
  }
36809
- function kc(e, t) {
36823
+ function jc(e, t) {
36810
36824
  if (e.length !== t.length) return !1;
36811
36825
  let n = 0;
36812
36826
  for (let r = 0; r < e.length; r++) n |= e[r] ^ t[r];
36813
36827
  return n === 0;
36814
36828
  }
36815
- async function Ac(e, t) {
36816
- return await Ec(await wc(e, t, t.spinCount, pc.keyValue), await Tc(t, t.saltValue, null), t.encryptedKeyValue);
36829
+ async function Mc(e, t) {
36830
+ return await Oc(await Ec(e, t, t.spinCount, hc.keyValue), await Dc(t, t.saltValue, null), t.encryptedKeyValue);
36817
36831
  }
36818
- async function jc(e, t, n) {
36819
- if (vc(t), e.length < 8) throw new $("corrupt", "EncryptedPackage is shorter than its size prefix");
36832
+ async function Nc(e, t, n) {
36833
+ if (bc(t), e.length < 8) throw new $("corrupt", "EncryptedPackage is shorter than its size prefix");
36820
36834
  let r = new DataView(e.buffer, e.byteOffset, e.byteLength), i = Number(r.getBigUint64(0, !0)), a = e.subarray(8);
36821
36835
  if (i > a.length) throw new $("corrupt", "EncryptedPackage size prefix exceeds the ciphertext");
36822
36836
  let o = n.slice(0, t.keyBits / 8), s = new Uint8Array(i), c = 0, l = 0;
36823
- for (let e = 0; e < a.length; e += hc) {
36824
- let n = a.subarray(e, e + hc), r = await Ec(o, await Tc(t, t.saltValue, bc(l)), n), u = Math.min(r.length, i - c);
36837
+ for (let e = 0; e < a.length; e += _c) {
36838
+ let n = a.subarray(e, e + _c), r = await Oc(o, await Dc(t, t.saltValue, Sc(l)), n), u = Math.min(r.length, i - c);
36825
36839
  if (s.set(r.subarray(0, u), c), c += u, l++, c >= i) break;
36826
36840
  }
36827
36841
  if (c !== i) throw new $("corrupt", "decrypted output is shorter than the declared size");
36828
36842
  return s;
36829
36843
  }
36830
- async function Mc(e, t, n) {
36844
+ async function Pc(e, t, n) {
36831
36845
  let { keyData: r, passwordKeyEncryptor: i } = e;
36832
- if (vc(r), vc(i), !await Oc(n, i)) throw new $("invalid-password", "The supplied password is incorrect.");
36833
- return jc(t, r, await Ac(n, i));
36846
+ if (bc(r), bc(i), !await Ac(n, i)) throw new $("invalid-password", "The supplied password is incorrect.");
36847
+ return Nc(t, r, await Mc(n, i));
36834
36848
  }
36835
- var Nc = "EncryptionInfo", Pc = "EncryptedPackage";
36836
- async function Fc(e, t) {
36837
- let n = Qs(e, Nc), r = Qs(e, Pc);
36849
+ var Fc = "EncryptionInfo", Ic = "EncryptedPackage";
36850
+ async function Lc(e, t) {
36851
+ let n = ec(e, Fc), r = ec(e, Ic);
36838
36852
  if (n === null || r === null) return {
36839
36853
  ok: !1,
36840
36854
  reason: "corrupt"
36841
36855
  };
36842
- let i = dc(n);
36856
+ let i = pc(n);
36843
36857
  if (i.kind !== "agile") return {
36844
36858
  ok: !1,
36845
36859
  reason: "unsupported-encryption"
@@ -36847,7 +36861,7 @@ async function Fc(e, t) {
36847
36861
  try {
36848
36862
  return {
36849
36863
  ok: !0,
36850
- data: await Mc(i.descriptor, r, t)
36864
+ data: await Pc(i.descriptor, r, t)
36851
36865
  };
36852
36866
  } catch (e) {
36853
36867
  return e instanceof $ ? {
@@ -36859,8 +36873,8 @@ async function Fc(e, t) {
36859
36873
  };
36860
36874
  }
36861
36875
  }
36862
- function Ic(e) {
36863
- let t = Ls(e instanceof Uint8Array ? e : new Uint8Array(e));
36876
+ function Rc(e) {
36877
+ let t = zs(e instanceof Uint8Array ? e : new Uint8Array(e));
36864
36878
  if (t !== null) switch (t) {
36865
36879
  case "encrypted": throw new w("encrypted", "This file is password-protected (MS-OFFCRYPTO). Pass LoadOptions.password to decrypt it.");
36866
36880
  case "legacy-binary-format": throw new w("legacy-binary-format", "This is a legacy binary Office file (.doc/.xls/.ppt), not OOXML.");
@@ -36868,12 +36882,12 @@ function Ic(e) {
36868
36882
  default: throw new w("not-ooxml", "This file is an OLE2/Compound File container of an unrecognised kind, not an OOXML (ZIP) document.");
36869
36883
  }
36870
36884
  }
36871
- async function Lc(e, t) {
36872
- let n = e instanceof Uint8Array ? e : new Uint8Array(e), r = Ls(n);
36885
+ async function zc(e, t) {
36886
+ let n = e instanceof Uint8Array ? e : new Uint8Array(e), r = zs(n);
36873
36887
  if (r === null) return n;
36874
36888
  if (r === "encrypted") {
36875
36889
  if (t === void 0) throw new w("encrypted", "This file is password-protected (MS-OFFCRYPTO). Pass LoadOptions.password to decrypt it.");
36876
- let e = await Fc(n, t);
36890
+ let e = await Lc(n, t);
36877
36891
  if (e.ok) return e.data;
36878
36892
  switch (e.reason) {
36879
36893
  case "invalid-password": throw new w("invalid-password", "The supplied password is incorrect.");
@@ -36882,14 +36896,14 @@ async function Lc(e, t) {
36882
36896
  default: throw e.reason, new w("not-ooxml", "This encrypted file could not be decrypted.");
36883
36897
  }
36884
36898
  }
36885
- return Ic(n), n;
36899
+ return Rc(n), n;
36886
36900
  }
36887
- function Rc(e) {
36901
+ function Bc(e) {
36888
36902
  return e.byteOffset === 0 && e.byteLength === e.buffer.byteLength && e.buffer instanceof ArrayBuffer ? e.buffer : e.slice().buffer;
36889
36903
  }
36890
- var zc = /* @__PURE__ */ new Map();
36891
- function Bc(e, t, n) {
36892
- let r = zc.get(e), i = r?.get(t);
36904
+ var Vc = /* @__PURE__ */ new Map();
36905
+ function Hc(e, t, n) {
36906
+ let r = Vc.get(e), i = r?.get(t);
36893
36907
  if (i) return i.refs++, {
36894
36908
  face: i.face,
36895
36909
  isNew: !1
@@ -36899,23 +36913,23 @@ function Bc(e, t, n) {
36899
36913
  face: a,
36900
36914
  set: t,
36901
36915
  refs: 1
36902
- }), zc.set(e, o), {
36916
+ }), Vc.set(e, o), {
36903
36917
  face: a,
36904
36918
  isNew: !0
36905
36919
  };
36906
36920
  }
36907
- function Vc(e) {
36921
+ function Uc(e) {
36908
36922
  let t = /* @__PURE__ */ new Set();
36909
36923
  for (let n of e) if (!t.has(n)) {
36910
36924
  t.add(n);
36911
- for (let [e, t] of zc) {
36925
+ for (let [e, t] of Vc) {
36912
36926
  let r = !1;
36913
36927
  for (let [i, a] of t) if (a.face === n) {
36914
36928
  if (r = !0, a.refs--, a.refs <= 0) {
36915
36929
  try {
36916
36930
  a.set.delete(n);
36917
36931
  } catch {}
36918
- t.delete(i), t.size === 0 && zc.delete(e);
36932
+ t.delete(i), t.size === 0 && Vc.delete(e);
36919
36933
  }
36920
36934
  break;
36921
36935
  }
@@ -36923,35 +36937,43 @@ function Vc(e) {
36923
36937
  }
36924
36938
  }
36925
36939
  }
36926
- var Hc = 15e3;
36927
- function Uc(e) {
36928
- return Promise.race([e, new Promise((e) => setTimeout(e, Hc))]);
36929
- }
36930
- var Wc = /* @__PURE__ */ new Map();
36940
+ var Wc = 15e3;
36931
36941
  function Gc(e) {
36932
- let t = [], n = /@font-face\s*\{([^}]*)\}/g, r;
36933
- for (; r = n.exec(e);) {
36934
- let e = r[1], n = (t) => e.match(RegExp(`(?:^|;|\\n)\\s*${t}\\s*:\\s*([^;]+)`, "i"))?.[1].trim(), i = n("font-family"), a = n("src");
36935
- if (!i || !a) continue;
36936
- let o = {}, s = n("font-style");
36937
- s && (o.style = s);
36938
- let c = n("font-weight");
36939
- c && (o.weight = c);
36940
- let l = n("font-stretch");
36941
- l && (o.stretch = l);
36942
- let u = n("unicode-range");
36943
- u && (o.unicodeRange = u), t.push({
36944
- family: i.replace(/^['"]|['"]$/g, ""),
36945
- src: a,
36946
- descriptors: o
36942
+ return Promise.race([e, new Promise((e) => setTimeout(e, Wc))]);
36943
+ }
36944
+ var Kc = /* @__PURE__ */ new Map();
36945
+ function qc(e, t) {
36946
+ let n = [], r = /@font-face\s*\{([^}]*)\}/g, i;
36947
+ for (; i = r.exec(e);) {
36948
+ let e = i[1], r = (t) => e.match(RegExp(`(?:^|;|\\n)\\s*${t}\\s*:\\s*([^;]+)`, "i"))?.[1].trim(), a = r("font-family"), o = r("src");
36949
+ if (!a || !o) continue;
36950
+ let s = t ? o.replace(/url\(\s*(?:(['"])(.*?)\1|([^)]*?))\s*\)/gi, (e, n, r, i) => {
36951
+ let a = (r ?? i ?? "").trim();
36952
+ if (!a) return e;
36953
+ try {
36954
+ return `url("${new URL(a, t).href}")`;
36955
+ } catch {
36956
+ return e;
36957
+ }
36958
+ }) : o, c = {}, l = r("font-style");
36959
+ l && (c.style = l);
36960
+ let u = r("font-weight");
36961
+ u && (c.weight = u);
36962
+ let d = r("font-stretch");
36963
+ d && (c.stretch = d);
36964
+ let f = r("unicode-range");
36965
+ f && (c.unicodeRange = f), n.push({
36966
+ family: a.replace(/^['"]|['"]$/g, ""),
36967
+ src: s,
36968
+ descriptors: c
36947
36969
  });
36948
36970
  }
36949
- return t;
36971
+ return n;
36950
36972
  }
36951
- function Kc() {
36973
+ function Jc() {
36952
36974
  return typeof document < "u" && document && document.fonts ? document.fonts : typeof self < "u" && self && "fonts" in self ? self.fonts : null;
36953
36975
  }
36954
- function qc(e, t) {
36976
+ function Yc(e, t) {
36955
36977
  let n = t.descriptors;
36956
36978
  return [
36957
36979
  "gfonts",
@@ -36964,7 +36986,7 @@ function qc(e, t) {
36964
36986
  t.src
36965
36987
  ].join("|");
36966
36988
  }
36967
- async function Jc(e, t, n = Kc()) {
36989
+ async function Xc(e, t, n = Jc()) {
36968
36990
  let r = n;
36969
36991
  if (!r || typeof FontFace > "u" || typeof fetch > "u") return [];
36970
36992
  let i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
@@ -36977,15 +36999,16 @@ async function Jc(e, t, n = Kc()) {
36977
36999
  i.add(r);
36978
37000
  let c = t[r];
36979
37001
  if (!c) continue;
36980
- o.add(c.url);
36981
- let l = (c.loadFamily ?? e).toLowerCase();
36982
- a.add(l);
36983
- let u = s.get(c.url);
36984
- u || (u = /* @__PURE__ */ new Set(), s.set(c.url, u)), u.add(l);
37002
+ let l = c.url;
37003
+ o.add(l);
37004
+ let u = (c.loadFamily ?? e).toLowerCase();
37005
+ a.add(u);
37006
+ let d = s.get(l);
37007
+ d || (d = /* @__PURE__ */ new Set(), s.set(l, d)), d.add(u);
36985
37008
  }
36986
37009
  if (a.size === 0) return [];
36987
- let l = await Uc(Promise.all([...o].map(async (e) => {
36988
- let t = Wc.get(e);
37010
+ let l = await Gc(Promise.all([...o].map(async (e) => {
37011
+ let t = Kc.get(e);
36989
37012
  if (t) return {
36990
37013
  url: e,
36991
37014
  rules: await t
@@ -36994,33 +37017,33 @@ async function Jc(e, t, n = Kc()) {
36994
37017
  try {
36995
37018
  let t = await fetch(e);
36996
37019
  if (!t.ok) throw Error(`HTTP ${t.status}`);
36997
- return Gc(await t.text());
37020
+ return qc(await t.text(), t.url || e);
36998
37021
  } catch {
36999
- Wc.delete(e);
37022
+ Kc.delete(e);
37000
37023
  for (let t of s.get(e) ?? []) c.add(t);
37001
37024
  return [];
37002
37025
  }
37003
37026
  })();
37004
- return Wc.set(e, n), {
37027
+ return Kc.set(e, n), {
37005
37028
  url: e,
37006
37029
  rules: await n
37007
37030
  };
37008
37031
  }))), u = [], d = [];
37009
37032
  for (let e of Array.isArray(l) ? l : []) for (let t of e.rules) {
37010
- let { face: n, isNew: i } = Bc(qc(e.url, t), r, () => {
37033
+ let { face: n, isNew: i } = Hc(Yc(e.url, t), r, () => {
37011
37034
  let e = new FontFace(t.family, t.src, t.descriptors);
37012
37035
  return r.add(e), e;
37013
37036
  });
37014
37037
  u.push(n), i && d.push(n);
37015
37038
  }
37016
- return d.length > 0 && await Uc(Promise.allSettled(d.map((e) => e.load())).then((e) => (e.forEach((e, t) => {
37039
+ return d.length > 0 && await Gc(Promise.allSettled(d.map((e) => e.load())).then((e) => (e.forEach((e, t) => {
37017
37040
  e.status === "rejected" && c.add(d[t].family.replace(/['"]/g, "").toLowerCase());
37018
37041
  }), r.ready))), c.size > 0 && console.warn(`[ooxml] failed to preload web font(s): ${[...c].join(", ")}; falling back to system fonts (text may shift or differ).`), u;
37019
37042
  }
37020
- function Yc(e) {
37021
- Vc(e);
37043
+ function Zc(e) {
37044
+ Uc(e);
37022
37045
  }
37023
- function Xc(e, t, n = {}) {
37046
+ function Qc(e, t, n = {}) {
37024
37047
  let r = n.pauseWhenHidden ?? !0, i = null, a = 0, o = 0, s = null, c = !1, l = !1, u = () => {
37025
37048
  if (!l && !(r && typeof document < "u" && document.hidden)) {
37026
37049
  if (s) {
@@ -37055,11 +37078,11 @@ function Xc(e, t, n = {}) {
37055
37078
  l = !0, f.disconnect(), i !== null && (cancelAnimationFrame(i), i = null), r && typeof document < "u" && document.removeEventListener("visibilitychange", p);
37056
37079
  };
37057
37080
  }
37058
- function Zc() {
37081
+ function $c() {
37059
37082
  let e = /* @__PURE__ */ Error("worker request aborted");
37060
37083
  return e.name = "AbortError", e;
37061
37084
  }
37062
- var Qc = class {
37085
+ var el = class {
37063
37086
  _worker;
37064
37087
  _opts;
37065
37088
  _pending = /* @__PURE__ */ new Map();
@@ -37116,7 +37139,7 @@ var Qc = class {
37116
37139
  return;
37117
37140
  }
37118
37141
  if (a?.aborted) {
37119
- o("abort"), c(Zc());
37142
+ o("abort"), c($c());
37120
37143
  return;
37121
37144
  }
37122
37145
  let l, u;
@@ -37132,7 +37155,7 @@ var Qc = class {
37132
37155
  e && (this._pending.delete(r), e.onOrphanedResponse && this._orphaned.set(r, e.onOrphanedResponse), e.cleanup(), o("timeout"), e.reject(/* @__PURE__ */ Error(`worker request timed out after ${i}ms`)));
37133
37156
  }, i)), a && (u = () => {
37134
37157
  let e = this._pending.get(r);
37135
- e && (this._pending.delete(r), e.onOrphanedResponse && this._orphaned.set(r, e.onOrphanedResponse), e.cleanup(), o("abort"), e.reject(Zc()));
37158
+ e && (this._pending.delete(r), e.onOrphanedResponse && this._orphaned.set(r, e.onOrphanedResponse), e.cleanup(), o("abort"), e.reject($c()));
37136
37159
  }, a.addEventListener("abort", u));
37137
37160
  try {
37138
37161
  this._worker.postMessage(e(r), t);
@@ -37171,7 +37194,7 @@ var Qc = class {
37171
37194
  this._terminated || (this._terminated = !0, this._worker.removeEventListener("message", this._handle), this._worker.removeEventListener("messageerror", this._handleWorkerError), this._worker.removeEventListener("error", this._handleWorkerError), this._worker.terminate(), this._rejectAll(/* @__PURE__ */ Error("Worker terminated")), this._orphaned.clear());
37172
37195
  }
37173
37196
  };
37174
- function $c(e, t) {
37197
+ function tl(e, t) {
37175
37198
  if (t) try {
37176
37199
  t();
37177
37200
  return;
@@ -37180,10 +37203,10 @@ function $c(e, t) {
37180
37203
  e.terminate();
37181
37204
  } catch {}
37182
37205
  }
37183
- function el(e) {
37206
+ function nl(e) {
37184
37207
  return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.ceil(e) : void 0;
37185
37208
  }
37186
- function tl(t, n) {
37209
+ function rl(t, n) {
37187
37210
  if (!Number.isFinite(t) || !Number.isFinite(n) || !(t > 0) || !(n > 0)) throw Error(`invalid SVG raster size: ${t}x${n}`);
37188
37211
  let r = Math.sqrt(e) / Math.sqrt(t) / Math.sqrt(n), i = Math.min(1, a / t, a / n, r);
37189
37212
  return {
@@ -37191,22 +37214,22 @@ function tl(t, n) {
37191
37214
  height: Math.min(a, Math.max(1, Math.floor(n * i)))
37192
37215
  };
37193
37216
  }
37194
- function nl(t, n, r, i) {
37217
+ function il(t, n, r, i) {
37195
37218
  let o = r === void 0 ? 0 : r / t, s = i === void 0 ? 0 : i / n, c = r === void 0 && i === void 0 ? 1 : Math.max(o, s), l = Math.min(a / t, a / n, Math.sqrt(e) / Math.sqrt(t) / Math.sqrt(n));
37196
37219
  if (!Number.isFinite(c) || !(c > 0) || !Number.isFinite(l) || !(l > 0)) throw Error(`invalid SVG raster scale: ${Math.min(c, l)}`);
37197
- return l < c ? tl(Math.max(1, Math.floor(t * l)), Math.max(1, Math.floor(n * l))) : r !== void 0 && o >= s ? tl(r, Math.max(1, Math.ceil(n * r / t))) : i === void 0 ? tl(Math.ceil(t), Math.ceil(n)) : tl(Math.max(1, Math.ceil(t * i / n)), i);
37220
+ return l < c ? rl(Math.max(1, Math.floor(t * l)), Math.max(1, Math.floor(n * l))) : r !== void 0 && o >= s ? rl(r, Math.max(1, Math.ceil(n * r / t))) : i === void 0 ? rl(Math.ceil(t), Math.ceil(n)) : rl(Math.max(1, Math.ceil(t * i / n)), i);
37198
37221
  }
37199
- async function rl(t, n = {}) {
37222
+ async function al(t, n = {}) {
37200
37223
  if (typeof Image > "u") throw Error("SVG host decode requires HTMLImageElement");
37201
37224
  let r = URL.createObjectURL(t);
37202
37225
  try {
37203
- let t = new Image(), i = el(n.targetWidthPx), a = el(n.targetHeightPx);
37226
+ let t = new Image(), i = nl(n.targetWidthPx), a = nl(n.targetHeightPx);
37204
37227
  await new Promise((e, n) => {
37205
37228
  t.onload = () => {
37206
37229
  typeof t.decode == "function" ? t.decode().then(e).catch(e) : e();
37207
37230
  }, t.onerror = () => n(/* @__PURE__ */ Error("SVG host decode failed")), t.src = r;
37208
37231
  });
37209
- let o = Number.isFinite(t.naturalWidth) && t.naturalWidth > 0 && Number.isFinite(t.naturalHeight) && t.naturalHeight > 0, s = nl(o ? t.naturalWidth : 300, o ? t.naturalHeight : 150, i, a);
37232
+ let o = Number.isFinite(t.naturalWidth) && t.naturalWidth > 0 && Number.isFinite(t.naturalHeight) && t.naturalHeight > 0, s = il(o ? t.naturalWidth : 300, o ? t.naturalHeight : 150, i, a);
37210
37233
  t.width = s.width, t.height = s.height;
37211
37234
  let c;
37212
37235
  if (typeof OffscreenCanvas < "u") {
@@ -37221,17 +37244,17 @@ async function rl(t, n = {}) {
37221
37244
  n.drawImage(t, 0, 0, s.width, s.height), c = await createImageBitmap(e);
37222
37245
  }
37223
37246
  let l = c.width * c.height;
37224
- if (c.width > 32767 || c.height > 32767 || l > 33554432) throw Jt(c), new h("image-pixels", e, l);
37247
+ if (c.width > 32767 || c.height > 32767 || l > 33554432) throw Xt(c), new h("image-pixels", e, l);
37225
37248
  return c;
37226
37249
  } finally {
37227
37250
  URL.revokeObjectURL(r);
37228
37251
  }
37229
37252
  }
37230
- function il(e) {
37253
+ function ol(e) {
37231
37254
  return !!e && typeof e == "object" && e.kind === "ooxmlDecodeSvg";
37232
37255
  }
37233
- function al(e, t) {
37234
- return il(t) ? (rl(new Blob([t.bytes], { type: "image/svg+xml" }), t).then((n) => {
37256
+ function sl(e, t) {
37257
+ return ol(t) ? (al(new Blob([t.bytes], { type: "image/svg+xml" }), t).then((n) => {
37235
37258
  try {
37236
37259
  e({
37237
37260
  kind: "ooxmlSvgDecoded",
@@ -37239,7 +37262,7 @@ function al(e, t) {
37239
37262
  bitmap: n
37240
37263
  }, [n]);
37241
37264
  } catch {
37242
- Jt(n);
37265
+ Xt(n);
37243
37266
  }
37244
37267
  }).catch((n) => {
37245
37268
  try {
@@ -37251,30 +37274,30 @@ function al(e, t) {
37251
37274
  } catch {}
37252
37275
  }), !0) : !1;
37253
37276
  }
37254
- var ol = 1.1, sl = 10, cl = 3, ll = 1;
37255
- function ul(e, t) {
37277
+ var cl = 1.1, ll = 10, ul = 3, dl = 1;
37278
+ function fl(e, t) {
37256
37279
  let n;
37257
37280
  switch (t) {
37258
37281
  case 1:
37259
- n = e / cl;
37282
+ n = e / ul;
37260
37283
  break;
37261
37284
  case 2:
37262
- n = e / ll;
37285
+ n = e / dl;
37263
37286
  break;
37264
37287
  default:
37265
- n = e / sl;
37288
+ n = e / ll;
37266
37289
  break;
37267
37290
  }
37268
37291
  return Math.max(-1, Math.min(1, n));
37269
37292
  }
37270
- function dl(e, t, n = 0) {
37271
- return e * ol ** +-ul(t, n);
37293
+ function pl(e, t, n = 0) {
37294
+ return e * cl ** +-fl(t, n);
37272
37295
  }
37273
- function fl(e, t, n, r, i) {
37296
+ function ml(e, t, n, r, i) {
37274
37297
  let a = n > 0 ? r / n : 1, o = (e + t) * a - t, s = i.maxScroll > 0 ? i.maxScroll : 0;
37275
37298
  return o < 0 ? 0 : o > s ? s : o;
37276
37299
  }
37277
- var pl = Object.freeze([
37300
+ var hl = Object.freeze([
37278
37301
  .25,
37279
37302
  .33,
37280
37303
  .5,
@@ -37290,22 +37313,22 @@ var pl = Object.freeze([
37290
37313
  2.5,
37291
37314
  3,
37292
37315
  4
37293
- ]), ml = .005;
37294
- function hl(e) {
37295
- for (let t of pl) if (t > e + ml) return t;
37296
- return pl[pl.length - 1];
37316
+ ]), gl = .005;
37317
+ function _l(e) {
37318
+ for (let t of hl) if (t > e + gl) return t;
37319
+ return hl[hl.length - 1];
37297
37320
  }
37298
- function gl(e, t = pl[0]) {
37299
- for (let t = pl.length - 1; t >= 0; t--) {
37300
- let n = pl[t];
37301
- if (n < e - ml) return n;
37321
+ function vl(e, t = hl[0]) {
37322
+ for (let t = hl.length - 1; t >= 0; t--) {
37323
+ let n = hl[t];
37324
+ if (n < e - gl) return n;
37302
37325
  }
37303
- return Math.min(t, pl[0]);
37326
+ return Math.min(t, hl[0]);
37304
37327
  }
37305
- function _l(e, t, n) {
37328
+ function yl(e, t, n) {
37306
37329
  return e < t ? t : e > n ? n : e;
37307
37330
  }
37308
- function vl(e, t) {
37331
+ function bl(e, t) {
37309
37332
  let { contentWidth: n, contentHeight: r, containerWidth: i, containerHeight: a } = e;
37310
37333
  if (n <= 0 || i <= 0) return 0;
37311
37334
  let o = i / n;
@@ -37314,7 +37337,7 @@ function vl(e, t) {
37314
37337
  let s = a / r;
37315
37338
  return Math.min(o, s);
37316
37339
  }
37317
- function yl(e) {
37340
+ function xl(e) {
37318
37341
  let t = e.toLowerCase();
37319
37342
  if (t.length === e.length) return t;
37320
37343
  let n = "";
@@ -37324,17 +37347,17 @@ function yl(e) {
37324
37347
  }
37325
37348
  return n;
37326
37349
  }
37327
- function bl(e) {
37350
+ function Sl(e) {
37328
37351
  let t = Array(e.length), n = 0, r = "";
37329
37352
  for (let i = 0; i < e.length; i++) t[i] = n, r += e[i].text, n += e[i].text.length;
37330
37353
  return {
37331
37354
  text: r,
37332
- folded: yl(r),
37355
+ folded: xl(r),
37333
37356
  runStart: t,
37334
37357
  runCount: e.length
37335
37358
  };
37336
37359
  }
37337
- function xl(e, t) {
37360
+ function Cl(e, t) {
37338
37361
  let { runStart: n } = e, r = 0, i = n.length - 1;
37339
37362
  for (; r < i;) {
37340
37363
  let e = r + i + 1 >> 1;
@@ -37342,8 +37365,8 @@ function xl(e, t) {
37342
37365
  }
37343
37366
  return r;
37344
37367
  }
37345
- function Sl(e, t, n) {
37346
- let { runStart: r, runCount: i, text: a } = e, o = [], s = xl(e, t), c = t;
37368
+ function wl(e, t, n) {
37369
+ let { runStart: r, runCount: i, text: a } = e, o = [], s = Cl(e, t), c = t;
37347
37370
  for (; c < n && s < i;) {
37348
37371
  let e = s + 1 < i ? r[s + 1] : a.length, t = Math.min(n, e), l = c - r[s], u = t - r[s];
37349
37372
  u > l && o.push({
@@ -37354,27 +37377,27 @@ function Sl(e, t, n) {
37354
37377
  }
37355
37378
  return o;
37356
37379
  }
37357
- function Cl(e, t, n = {}) {
37380
+ function Tl(e, t, n = {}) {
37358
37381
  if (t.length === 0) return [];
37359
- let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t : yl(t), o = [], s = 0, c = 0;
37382
+ let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t : xl(t), o = [], s = 0, c = 0;
37360
37383
  for (;;) {
37361
37384
  let t = i.indexOf(a, s);
37362
37385
  if (t === -1) break;
37363
37386
  o.push({
37364
37387
  matchIndex: c,
37365
- slices: Sl(e, t, t + a.length)
37388
+ slices: wl(e, t, t + a.length)
37366
37389
  }), c++, s = t + a.length;
37367
37390
  }
37368
37391
  return o;
37369
37392
  }
37370
- function wl(e, t) {
37393
+ function El(e, t) {
37371
37394
  return t <= 0 ? -1 : e < 0 ? 0 : (e + 1) % t;
37372
37395
  }
37373
- function Tl(e, t) {
37396
+ function Dl(e, t) {
37374
37397
  return t <= 0 ? -1 : e < 0 ? t - 1 : (e - 1 + t) % t;
37375
37398
  }
37376
- var El = 65536;
37377
- function Dl(e, t) {
37399
+ var Ol = 65536;
37400
+ function kl(e, t) {
37378
37401
  let n = Math.min(e.length, t);
37379
37402
  if (n > 0 && n < e.length) {
37380
37403
  let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
@@ -37382,19 +37405,19 @@ function Dl(e, t) {
37382
37405
  }
37383
37406
  return e.slice(0, n);
37384
37407
  }
37385
- function Ol(e) {
37408
+ function Al(e) {
37386
37409
  let t = e ?? 16384;
37387
37410
  if (!Number.isFinite(t) || t < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
37388
- return Math.min(El, Math.floor(t));
37411
+ return Math.min(Ol, Math.floor(t));
37389
37412
  }
37390
- function kl(e, t) {
37391
- let n = Ol(t), r = [], i = 0, a = !1, o = !1, s = (e, t) => {
37413
+ function jl(e, t) {
37414
+ let n = Al(t), r = [], i = 0, a = !1, o = !1, s = (e, t) => {
37392
37415
  if (t && o) {
37393
37416
  if (i >= n) return a = !0, !1;
37394
37417
  r.push("\n"), i++;
37395
37418
  }
37396
37419
  o = !0;
37397
- let s = Dl(e, Math.max(0, n - i));
37420
+ let s = kl(e, Math.max(0, n - i));
37398
37421
  return r.push(s), i += s.length, s.length < e.length ? (a = !0, !1) : !0;
37399
37422
  };
37400
37423
  if (!s(`Chart type: ${e.chartType}`, !0) || e.title !== null && !s(`Title: ${e.title}`, !0)) return {
@@ -37434,13 +37457,13 @@ function kl(e, t) {
37434
37457
  maxTextCharacters: n
37435
37458
  };
37436
37459
  }
37437
- var Al = 65536, jl = 1024;
37438
- function Ml(e, t, n) {
37460
+ var Ml = 65536, Nl = 1024;
37461
+ function Pl(e, t, n) {
37439
37462
  let r = e ?? t;
37440
37463
  if (!Number.isFinite(r) || r < 0) throw RangeError(`${n} must be a finite non-negative number.`);
37441
37464
  return Math.min(t, Math.floor(r));
37442
37465
  }
37443
- function Nl(e, t) {
37466
+ function Fl(e, t) {
37444
37467
  let n = Math.min(e.length, t);
37445
37468
  if (n > 0 && n < e.length) {
37446
37469
  let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
@@ -37448,7 +37471,7 @@ function Nl(e, t) {
37448
37471
  }
37449
37472
  return e.slice(0, n);
37450
37473
  }
37451
- function* Pl(e) {
37474
+ function* Il(e) {
37452
37475
  let t = e.firstChild ?? e.childNodes[0] ?? null;
37453
37476
  for (; t;) {
37454
37477
  if (t.nodeType === 3 && (yield t), t.firstChild) {
@@ -37460,13 +37483,13 @@ function* Pl(e) {
37460
37483
  t = t.nextSibling;
37461
37484
  }
37462
37485
  }
37463
- function Fl(e, t, n, r, i) {
37486
+ function Ll(e, t, n, r, i) {
37464
37487
  for (let a of r) {
37465
37488
  let r = !1;
37466
37489
  try {
37467
37490
  r = a.intersectsNode(n);
37468
37491
  } catch {}
37469
- if (r) for (let r of Pl(n)) {
37492
+ if (r) for (let r of Il(n)) {
37470
37493
  let n = r.data, o, s;
37471
37494
  if (a.startContainer === r) o = a.startOffset;
37472
37495
  else try {
@@ -37489,7 +37512,7 @@ function Fl(e, t, n, r, i) {
37489
37512
  }
37490
37513
  return t;
37491
37514
  }
37492
- function Il(e, t, n, r = {}) {
37515
+ function Rl(e, t, n, r = {}) {
37493
37516
  if (!t || t.isCollapsed || t.rangeCount === 0) return null;
37494
37517
  let i = [...e.matches?.("[data-ooxml-selection-surface]") ? [e] : [], ...e.querySelectorAll("[data-ooxml-selection-surface]")];
37495
37518
  if (i.length === 0) return null;
@@ -37499,7 +37522,7 @@ function Il(e, t, n, r = {}) {
37499
37522
  if (!e.contains(r.startContainer) || !e.contains(r.endContainer) || !a(r.startContainer) || !a(r.endContainer)) return null;
37500
37523
  o.push(r);
37501
37524
  }
37502
- let s = Ml(r.maxChars, Al, "maxTextCharacters"), c = Ml(r.maxLocators, jl, "maxRunLocators"), l = [], u = !1, d = s + 2, f = [], p = 0;
37525
+ let s = Pl(r.maxChars, Ml, "maxTextCharacters"), c = Pl(r.maxLocators, Nl, "maxRunLocators"), l = [], u = !1, d = s + 2, f = [], p = 0;
37503
37526
  for (let t of e.querySelectorAll("[data-ooxml-selection-run]")) {
37504
37527
  if (!o.some((e) => {
37505
37528
  try {
@@ -37509,12 +37532,12 @@ function Il(e, t, n, r = {}) {
37509
37532
  }
37510
37533
  })) continue;
37511
37534
  let e = n(t);
37512
- if (e !== null && (l.length >= c ? u = !0 : l.push(structuredClone(e)), p < d && (p = Fl(f, p, t, o, d)), u && p >= d)) break;
37535
+ if (e !== null && (l.length >= c ? u = !0 : l.push(structuredClone(e)), p < d && (p = Ll(f, p, t, o, d)), u && p >= d)) break;
37513
37536
  }
37514
37537
  if (l.length === 0 && !u) return null;
37515
37538
  let m = f.join("");
37516
37539
  if (m.length === 0) return null;
37517
- let h = Nl(m, s), g = m.length > s;
37540
+ let h = Fl(m, s), g = m.length > s;
37518
37541
  return {
37519
37542
  text: h,
37520
37543
  locators: l,
@@ -37525,7 +37548,7 @@ function Il(e, t, n, r = {}) {
37525
37548
  maxLocators: c
37526
37549
  };
37527
37550
  }
37528
- var Ll = class {
37551
+ var zl = class {
37529
37552
  wrapper;
37530
37553
  originalParent;
37531
37554
  originalNextSibling;
@@ -37546,31 +37569,31 @@ var Ll = class {
37546
37569
  (this.options.restoreMode ?? "display") === "style-and-bitmap" ? (this.originalStyle === null ? this.canvas.removeAttribute("style") : this.canvas.setAttribute("style", this.originalStyle), this.canvas.width = this.originalWidth, this.canvas.height = this.originalHeight) : this.canvas.style.display = this.originalDisplay, this.wrapper.remove();
37547
37570
  }
37548
37571
  }
37549
- }, Rl = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", zl = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", Bl = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;";
37550
- function Vl(e, t) {
37572
+ }, Bl = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", Vl = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", Hl = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;";
37573
+ function Ul(e, t) {
37551
37574
  if (!t) return null;
37552
37575
  let n = (e.ownerDocument ?? document).createElement("div");
37553
- return n.style.cssText = Bl, e.appendChild(n), n;
37576
+ return n.style.cssText = Hl, e.appendChild(n), n;
37554
37577
  }
37555
- function Hl(e, t) {
37578
+ function Wl(e, t) {
37556
37579
  if (!e || (e.innerHTML = "", !t || !Number.isFinite(t.x) || !Number.isFinite(t.y) || !Number.isFinite(t.width) || !Number.isFinite(t.height) || t.width <= 0 || t.height <= 0)) return;
37557
37580
  let n = (e.ownerDocument ?? document).createElement("div"), r = Number.isFinite(t.rotation) ? t.rotation ?? 0 : 0;
37558
37581
  n.style.cssText = `position:absolute;left:${t.x * 100}%;top:${t.y * 100}%;width:${t.width * 100}%;height:${t.height * 100}%;box-sizing:border-box;border:2px solid #1a73e8;background:color-mix(in srgb, #1a73e8 6%, transparent);transform:rotate(${r}deg);transform-origin:center;pointer-events:none;`, e.appendChild(n);
37559
37582
  }
37560
- var Ul = class {
37583
+ var Gl = class {
37561
37584
  textLayer;
37562
37585
  highlightLayer;
37563
37586
  elementLayer;
37564
37587
  constructor(e, t, n = !1) {
37565
37588
  let r = e.ownerDocument ?? document;
37566
- this.textLayer = t ? r.createElement("div") : null, this.textLayer && (this.textLayer.style.cssText = Rl, e.appendChild(this.textLayer)), this.highlightLayer = r.createElement("div"), this.highlightLayer.style.cssText = zl, e.appendChild(this.highlightLayer), this.elementLayer = Vl(e, n);
37589
+ this.textLayer = t ? r.createElement("div") : null, this.textLayer && (this.textLayer.style.cssText = Bl, e.appendChild(this.textLayer)), this.highlightLayer = r.createElement("div"), this.highlightLayer.style.cssText = Vl, e.appendChild(this.highlightLayer), this.elementLayer = Ul(e, n);
37567
37590
  }
37568
37591
  };
37569
- function Wl(e, t, n) {
37592
+ function Kl(e, t, n) {
37570
37593
  if (n && t !== void 0 && t !== n.mode) throw Error(`${e}: opts.mode='${t}' conflicts with the borrowed engine's mode='${n.mode}'. Omit opts.mode when borrowing an engine — the engine owns its render mode.`);
37571
37594
  return n?.mode ?? t ?? "main";
37572
37595
  }
37573
- var Gl = class {
37596
+ var ql = class {
37574
37597
  generation = 0;
37575
37598
  resource;
37576
37599
  ownsResource;
@@ -37622,7 +37645,7 @@ var Gl = class {
37622
37645
  e.destroy();
37623
37646
  } catch {}
37624
37647
  }
37625
- }, Kl = class {
37648
+ }, Jl = class {
37626
37649
  generation = 0;
37627
37650
  destroyed = !1;
37628
37651
  bitmapContext;
@@ -37661,7 +37684,7 @@ var Gl = class {
37661
37684
  destroy() {
37662
37685
  this.destroyed || (this.destroyed = !0, this.generation++);
37663
37686
  }
37664
- }, ql = class {
37687
+ }, Yl = class {
37665
37688
  closed = !1;
37666
37689
  handled = /* @__PURE__ */ new WeakSet();
37667
37690
  backgroundLifecycleOwners = 0;
@@ -37702,23 +37725,68 @@ var Gl = class {
37702
37725
  close() {
37703
37726
  this.closed = !0;
37704
37727
  }
37705
- }, Jl = Object.defineProperty, Yl = (e, t) => {
37728
+ }, Xl = Object.defineProperty, Zl = (e, t) => {
37706
37729
  let n = {};
37707
- for (var r in e) Jl(n, r, {
37730
+ for (var r in e) Xl(n, r, {
37708
37731
  get: e[r],
37709
37732
  enumerable: !0
37710
37733
  });
37711
- return t || Jl(n, Symbol.toStringTag, { value: "Module" }), n;
37734
+ return t || Xl(n, Symbol.toStringTag, { value: "Module" }), n;
37712
37735
  };
37713
37736
  //#endregion
37714
- //#region ../../node_modules/@silurus/ooxml/dist/bounded-raw-part-cache-BfbSxRIL.js
37715
- function Xl(e, t) {
37737
+ //#region ../../node_modules/@silurus/ooxml/dist/cjk-fallback-bLI3z70h.js
37738
+ function Ql(e) {
37739
+ if (!e?.trim()) return null;
37740
+ let t;
37741
+ try {
37742
+ t = new Intl.Locale(e.trim());
37743
+ } catch {
37744
+ return null;
37745
+ }
37746
+ let { language: n, script: r, region: i } = t;
37747
+ return n === "ja" ? !r || [
37748
+ "Jpan",
37749
+ "Hani",
37750
+ "Hira",
37751
+ "Kana"
37752
+ ].includes(r) ? "jp" : null : n === "ko" ? !r || [
37753
+ "Kore",
37754
+ "Hang",
37755
+ "Hani"
37756
+ ].includes(r) ? "kr" : null : n === "zh" ? r === "Hans" ? "sc" : r === "Hant" ? "tc" : r ? null : i === "HK" || i === "MO" ? "hk" : i === "TW" ? "tc" : "sc" : null;
37757
+ }
37758
+ function $l(e = "auto") {
37759
+ if (e !== "auto") {
37760
+ if ([
37761
+ "sc",
37762
+ "tc",
37763
+ "hk",
37764
+ "jp",
37765
+ "kr"
37766
+ ].includes(e)) return e;
37767
+ throw TypeError("cjkFallback must be auto, sc, tc, hk, jp, or kr");
37768
+ }
37769
+ let t = typeof document > "u" ? null : Ql(document.documentElement?.lang);
37770
+ if (t) return t;
37771
+ if (typeof navigator < "u") {
37772
+ for (let e of navigator.languages ?? []) {
37773
+ let t = Ql(e);
37774
+ if (t) return t;
37775
+ }
37776
+ let e = Ql(navigator.language);
37777
+ if (e) return e;
37778
+ }
37779
+ return "jp";
37780
+ }
37781
+ //#endregion
37782
+ //#region ../../node_modules/@silurus/ooxml/dist/bounded-raw-part-cache-Cg1BsSZQ.js
37783
+ function eu(e, t) {
37716
37784
  if (!Number.isSafeInteger(e) || e <= 0) throw TypeError(`${t} must be a positive safe integer`);
37717
37785
  }
37718
- function Zl(e) {
37786
+ function tu(e) {
37719
37787
  if (!Number.isSafeInteger(e) || e < 0) throw TypeError("cache entry weight must be a non-negative safe integer");
37720
37788
  }
37721
- var Ql = class {
37789
+ var nu = class {
37722
37790
  #e;
37723
37791
  #t;
37724
37792
  #n;
@@ -37727,7 +37795,7 @@ var Ql = class {
37727
37795
  #a = /* @__PURE__ */ new Map();
37728
37796
  #o = 0;
37729
37797
  constructor(e) {
37730
- Xl(e.maxEntries, "maxEntries"), Xl(e.maxWeight, "maxWeight"), this.#e = e.maxEntries, this.#t = e.maxWeight, this.#n = e.measure, this.#r = e.onRemove;
37798
+ eu(e.maxEntries, "maxEntries"), eu(e.maxWeight, "maxWeight"), this.#e = e.maxEntries, this.#t = e.maxWeight, this.#n = e.measure, this.#r = e.onRemove;
37731
37799
  }
37732
37800
  get usage() {
37733
37801
  return {
@@ -37773,7 +37841,7 @@ var Ql = class {
37773
37841
  if (this.#a.get(e)?.token !== t) return n;
37774
37842
  let r;
37775
37843
  try {
37776
- r = this.#n(n), Zl(r);
37844
+ r = this.#n(n), tu(r);
37777
37845
  } catch (n) {
37778
37846
  throw this.#s(e, t), n;
37779
37847
  }
@@ -37797,10 +37865,10 @@ var Ql = class {
37797
37865
  this.#r?.(e, t, n);
37798
37866
  } catch {}
37799
37867
  }
37800
- }, $l = class {
37868
+ }, ru = class {
37801
37869
  #e;
37802
37870
  constructor(e) {
37803
- this.#e = new Ql({
37871
+ this.#e = new nu({
37804
37872
  maxEntries: e.maxEntries,
37805
37873
  maxWeight: e.maxBytes,
37806
37874
  measure: (e) => e.size
@@ -37829,4 +37897,4 @@ var Ql = class {
37829
37897
  }
37830
37898
  };
37831
37899
  //#endregion
37832
- export { Fo as $, jo as $t, Il as A, xo as An, _o as At, Aa as B, es as Bt, gl as C, _a as Cn, Wi as Ct, Vl as D, w as Dn, er as Dt, El as E, Sr as En, Oa as Et, Gl as F, Cr as Fn, ue as Ft, Cs as G, go as Gt, Ai as H, me as Ht, Hl as I, Hn as In, fi as It, Do as J, _n as Jt, ke as K, gs as Kt, X as L, ne as Ln, co as Lt, Cl as M, va as Mn, Se as Mt, fl as N, xe as Nn, bo as Nt, kl as O, ws as On, ye as Ot, wl as P, yo as Pn, wr as Pt, Le as Q, Nn as Qt, $o as R, v as Rn, pe as Rt, Bc as S, uo as Sn, Ue as St, _l as T, vo as Tn, Ze as Tt, He as U, fo as Ut, Me as V, nt as Vt, Ci as W, ve as Wt, Ar as X, ja as Xt, jr as Y, ia as Yt, Es as Z, Ne as Zt, Rc as _, ln as _n, T as _t, al as a, pi as an, Ki as at, Ul as b, fe as bn, Ts as bt, ql as c, it as cn, Pe as ct, $c as d, he as dn, Ae as dt, Fr as en, Go as et, Kc as f, _r as fn, Mr as ft, Yc as g, di as gn, Ss as gt, Jc as h, le as hn, Qi as ht, bl as i, de as in, Jo as it, Tl as j, Tr as jn, as as jt, Ll as k, Ce as kn, yn as kt, Qc as l, ce as ln, Ir as lt, dl as m, ra as mn, Po as mt, $l as n, ko as nn, Xe as nt, Wl as o, ge as on, ze as ot, Uc as p, Ye as pn, Os as pt, kn as q, _e as qt, Yl as r, Nr as rn, Zn as rt, Lc as s, ns as sn, Ma as st, Ql as t, je as tn, Re as tt, Vc as u, cn as un, No as ut, Xc as v, ss as vn, De as vt, hl as w, be as wn, qn as wt, Kl as x, mi as xn, Uo as xt, vl as y, rt as yn, kr as yt, ri as z, b as zn, hi as zt };
37900
+ export { We as $, Ne as $t, jl as A, vs as An, Xo as At, nr as B, Ve as Bn, wr as Bt, Jl as C, ai as Cn, De as Ct, yl as D, uo as Dn, Wn as Dt, _l as E, hi as En, Ge as Et, ml as F, xo as Fn, yn as Ft, Dr as G, ta as Gt, Pr as H, v as Hn, un as Ht, El as I, Tr as In, oa as It, Ds as J, ve as Jt, ke as K, me as Kt, ql as L, xe as Ln, ba as Lt, Rl as M, ws as Mn, J as Mt, Dl as N, xa as Nn, $e as Nt, Ol as O, be as On, Qe as Ot, Tl as P, Ce as Pn, ye as Pt, Go as Q, ot as Qt, Wl as R, xn as Rn, Se as Rt, Gl as S, ss as Sn, T as St, vl as T, fe as Tn, Ts as Tt, As as U, b as Un, pe as Ut, Me as V, ne as Vn, ue as Vt, Co as W, gi as Wt, Le as X, yr as Xt, Es as Y, _e as Yt, Fo as Z, is as Zt, Xc as _, vi as _n, Pa as _t, Zl as a, Nr as an, ze as at, Qc as b, at as bn, So as bt, Kl as c, dn as cn, Pe as ct, el as d, mo as dn, Fn as dt, jo as en, Re as et, Uc as f, ns as fn, No as ft, pl as g, he as gn, Os as gt, Gc as h, ce as hn, Mr as ht, $l as i, ko as in, Yn as it, zl as j, w as jn, Ze as jt, Ul as k, vo as kn, $n as kt, zc as l, ls as ln, Ni as lt, Jc as m, sa as mn, Ae as mt, ru as n, je as nn, Yi as nt, Sl as o, de as on, Lo as ot, tl as p, it as pn, Lr as pt, jr as q, _i as qt, Ql as r, jn as rn, qi as rt, sl as s, mi as sn, Ma as st, nu as t, Fr as tn, Io as tt, Yl as u, ge as un, Na as ut, Zc as v, po as vn, Rr as vt, Hc as w, ts as wn, Ei as wt, bl as x, le as xn, Er as xt, Bc as y, qo as yn, Be as yt, X as z, yo as zn, bo as zt };