@silurus/ooxml 0.78.0 → 0.79.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +39 -1
  2. package/THIRD_PARTY_NOTICES.md +13 -0
  3. package/dist/{canvas-viewer-mechanics-ChxLdOJg.js → canvas-viewer-mechanics-D9tsuHnG.js} +1 -1
  4. package/dist/chart-number-format-tjYUR9eS.js +435 -0
  5. package/dist/dash-Cyc-sevN.js +786 -0
  6. package/dist/{document-pull-client-xsdVDuVD.js → document-pull-client-YiU8M4LO.js} +3283 -3156
  7. package/dist/{docx-CZC3j4s4.js → docx-a1UpmRf8.js} +65 -56
  8. package/dist/docx.mjs +4 -4
  9. package/dist/docx_parser_bg.wasm +0 -0
  10. package/dist/index.mjs +3 -3
  11. package/dist/{line-distribute-HuZyTARz.js → line-distribute-pDqovJpT.js} +1 -1
  12. package/dist/{line-metrics-z9AdgPaZ.js → line-metrics-DjKxiIUD.js} +4097 -3184
  13. package/dist/math.mjs +1 -1
  14. package/dist/node.mjs +322 -322
  15. package/dist/{pptx-c3UgGKIs.js → pptx-t5ABdzfd.js} +192 -183
  16. package/dist/pptx.mjs +5 -5
  17. package/dist/pptx_parser_bg.wasm +0 -0
  18. package/dist/region-map.mjs +12708 -0
  19. package/dist/{render-yhFUeiYl.js → render-BjIEuFIG.js} +1 -1
  20. package/dist/render-worker-host-BB320snY.js +27 -0
  21. package/dist/render-worker-host-BjEPZBwf.js +27 -0
  22. package/dist/render-worker-host-hZ0o4OD7.js +27 -0
  23. package/dist/{resource-measurement-5g27Av6n.js → resource-measurement-D8EiTm_E.js} +1 -1
  24. package/dist/{session-BOuXp10X.js → session-Bhe_eY-s.js} +10 -10
  25. package/dist/{slide-pull-client-DKckZrLx.js → slide-pull-client-BQ8gJPTq.js} +626 -563
  26. package/dist/three-d.mjs +2158 -0
  27. package/dist/types/docx.d.ts +189 -16
  28. package/dist/types/index.d.ts +205 -20
  29. package/dist/types/math.d.ts +1 -1
  30. package/dist/types/node.d.ts +166 -1
  31. package/dist/types/pptx.d.ts +191 -16
  32. package/dist/types/region-map.d.ts +520 -0
  33. package/dist/types/three-d.d.ts +520 -0
  34. package/dist/types/xlsx.d.ts +195 -16
  35. package/dist/{worksheet-pull-client-CMDRPZ5E.js → worksheet-pull-client-T0EzdEEQ.js} +13 -13
  36. package/dist/{xlsx-BAScjxlC.js → xlsx-CsDDMJIK.js} +833 -770
  37. package/dist/xlsx.mjs +5 -5
  38. package/dist/xlsx_parser_bg.wasm +0 -0
  39. package/package.json +13 -1
  40. package/dist/render-worker-host-BzxTAscX.js +0 -27
  41. package/dist/render-worker-host-CBjWHxMb.js +0 -27
  42. package/dist/render-worker-host-Ivhx3KII.js +0 -27
  43. /package/dist/{highlight-rect-CAkCWJ37.js → highlight-rect-cCvVU-MW.js} +0 -0
  44. /package/dist/{mathjax-CMjda8Ip.js → mathjax-Dqo857oC.js} +0 -0
  45. /package/dist/{transfer-DCu4c2BL.js → transfer-3QEJrsJa.js} +0 -0
  46. /package/dist/{visible-index-CgyJLAS_.js → visible-index-CKvgpUrf.js} +0 -0
@@ -1,12 +1,13 @@
1
- import { A as e, At as t, Bt as n, C as r, D as i, Dt as a, Ft as o, Gt as s, Ht as c, K as l, Kt as u, Lt as d, M as f, N as p, Nt as m, O as h, Ot as g, Qt as _, Rt as v, S as y, St as b, Tt as x, Ut as S, Vt as C, Wt as w, Xt as T, Yt as E, _ as D, _t as O, bt as k, c as A, cn as j, ct as M, d as N, dn as P, en as F, f as I, fn as L, g as R, gt as z, h as B, ht as V, i as H, in as U, j as W, jt as G, ln as K, m as q, mn as ee, mt as J, n as te, p as ne, pt as re, qt as ie, r as ae, s as oe, sn as se, u as ce, un as le, vt as ue, w as de, xt as fe, y as pe } from "./line-metrics-z9AdgPaZ.js";
2
- import { a as me, c as he, d as ge, i as _e, l as ve, n as ye, o as be, r as xe, s as Se, t as Ce, u as we } from "./line-distribute-HuZyTARz.js";
3
- import { i as Te } from "./resource-measurement-5g27Av6n.js";
4
- import { t as Ee } from "./mathjax-CMjda8Ip.js";
1
+ import { $t as e, A as t, At as n, Bt as r, C as i, D as a, Dt as o, Ft as s, Gt as c, Ht as l, K as u, Kt as d, Lt as f, M as p, N as m, Nt as h, O as g, Ot as _, Qt as v, Rt as y, S as b, St as x, Tt as S, Ut as C, Vt as w, Wt as T, Xt as E, Yt as D, Zt as O, _ as k, _t as A, an as j, bt as M, c as N, ct as P, d as F, en as I, f as L, g as R, gt as z, h as B, ht as V, i as H, j as U, jt as W, m as G, mt as K, n as q, nn as J, p as ee, pt as te, qt as ne, r as re, rn as ie, s as ae, tn as oe, u as se, vt as ce, w as le, xt as ue, y as de } from "./line-metrics-DjKxiIUD.js";
2
+ import { a as fe, c as pe, d as me, i as he, l as ge, n as _e, o as ve, r as ye, s as be, t as xe, u as Se } from "./line-distribute-pDqovJpT.js";
3
+ import { h as Y, r as Ce } from "./dash-Cyc-sevN.js";
4
+ import { i as we } from "./resource-measurement-D8EiTm_E.js";
5
+ import { t as Te } from "./mathjax-Dqo857oC.js";
5
6
  //#region packages/pptx/src/types.ts
6
- function De(e) {
7
+ function Ee(e) {
7
8
  return e;
8
9
  }
9
- var Oe = {
10
+ var De = {
10
11
  textarchdown: {
11
12
  adj: [["adj", "val 0"]],
12
13
  gd: [
@@ -2388,22 +2389,22 @@ var Oe = {
2388
2389
  ]
2389
2390
  }]
2390
2391
  }
2391
- }, ke = Math.PI * 2 / 216e5, Ae = Oe, je = /* @__PURE__ */ new Map();
2392
- function Me(e) {
2393
- return e.toLowerCase() in Ae;
2392
+ }, Oe = Math.PI * 2 / 216e5, ke = De, Ae = /* @__PURE__ */ new Map();
2393
+ function je(e) {
2394
+ return e.toLowerCase() in ke;
2394
2395
  }
2395
- function Ne(e) {
2396
- let t = je.get(e);
2396
+ function Me(e) {
2397
+ let t = Ae.get(e);
2397
2398
  if (t) return t;
2398
- let n = Ae[e];
2399
+ let n = ke[e];
2399
2400
  return n ? (t = {
2400
- adj: n.adj.map(([e, t]) => [e, w(t)]),
2401
- gd: n.gd.map(([e, t]) => [e, w(t)]),
2401
+ adj: n.adj.map(([e, t]) => [e, T(t)]),
2402
+ gd: n.gd.map(([e, t]) => [e, T(t)]),
2402
2403
  paths: n.paths
2403
- }, je.set(e, t), t) : null;
2404
+ }, Ae.set(e, t), t) : null;
2404
2405
  }
2405
- var Pe = 48;
2406
- function Fe(e, t, n, r) {
2406
+ var Ne = 48;
2407
+ function Pe(e, t, n, r) {
2407
2408
  let i = e.w == null ? 1 : n / e.w, a = e.h == null ? 1 : r / e.h, o = (e) => e * i, s = (e) => e * a, c = [], l = 0, u = 0;
2408
2409
  for (let n of e.cmds) switch (n[0]) {
2409
2410
  case "m":
@@ -2420,8 +2421,8 @@ function Fe(e, t, n, r) {
2420
2421
  break;
2421
2422
  case "C": {
2422
2423
  let e = o(t.resolve(n[1])), r = s(t.resolve(n[2])), i = o(t.resolve(n[3])), a = s(t.resolve(n[4])), d = o(t.resolve(n[5])), f = s(t.resolve(n[6]));
2423
- for (let t = 1; t <= Pe; t++) {
2424
- let n = t / Pe, o = 1 - n, s = o * o * o * l + 3 * o * o * n * e + 3 * o * n * n * i + n * n * n * d, p = o * o * o * u + 3 * o * o * n * r + 3 * o * n * n * a + n * n * n * f;
2424
+ for (let t = 1; t <= Ne; t++) {
2425
+ let n = t / Ne, o = 1 - n, s = o * o * o * l + 3 * o * o * n * e + 3 * o * n * n * i + n * n * n * d, p = o * o * o * u + 3 * o * o * n * r + 3 * o * n * n * a + n * n * n * f;
2425
2426
  c.push({
2426
2427
  x: s,
2427
2428
  y: p
@@ -2432,8 +2433,8 @@ function Fe(e, t, n, r) {
2432
2433
  }
2433
2434
  case "Q": {
2434
2435
  let e = o(t.resolve(n[1])), r = s(t.resolve(n[2])), i = o(t.resolve(n[3])), a = s(t.resolve(n[4]));
2435
- for (let t = 1; t <= Pe; t++) {
2436
- let n = t / Pe, o = 1 - n, s = o * o * l + 2 * o * n * e + n * n * i, d = o * o * u + 2 * o * n * r + n * n * a;
2436
+ for (let t = 1; t <= Ne; t++) {
2437
+ let n = t / Ne, o = 1 - n, s = o * o * l + 2 * o * n * e + n * n * i, d = o * o * u + 2 * o * n * r + n * n * a;
2437
2438
  c.push({
2438
2439
  x: s,
2439
2440
  y: d
@@ -2443,9 +2444,9 @@ function Fe(e, t, n, r) {
2443
2444
  break;
2444
2445
  }
2445
2446
  case "a": {
2446
- let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * ke, f = t.resolve(n[4]) * ke, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
2447
+ let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * Oe, f = t.resolve(n[4]) * Oe, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
2447
2448
  _ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
2448
- let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(Pe, Math.ceil(Math.abs(y) / m * 96));
2449
+ let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(Ne, Math.ceil(Math.abs(y) / m * 96));
2449
2450
  for (let e = 1; e <= S; e++) {
2450
2451
  let t = h + y * e / S;
2451
2452
  c.push({
@@ -2460,7 +2461,7 @@ function Fe(e, t, n, r) {
2460
2461
  }
2461
2462
  return c;
2462
2463
  }
2463
- function Ie(e) {
2464
+ function Fe(e) {
2464
2465
  let t = [0];
2465
2466
  for (let n = 1; n < e.length; n++) {
2466
2467
  let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
@@ -2468,23 +2469,23 @@ function Ie(e) {
2468
2469
  }
2469
2470
  return t;
2470
2471
  }
2471
- function Le(e, t, n, r) {
2472
- let i = Ne(e.toLowerCase());
2472
+ function Ie(e, t, n, r) {
2473
+ let i = Me(e.toLowerCase());
2473
2474
  if (!i || i.paths.length === 0) return null;
2474
- let a = s({
2475
+ let a = c({
2475
2476
  w: n,
2476
2477
  h: r,
2477
2478
  adj: t
2478
- }, i.adj, i.gd), o = i.paths.length === 1, c = Fe(i.paths[0], a, n, r), l = o ? c : Fe(i.paths[i.paths.length - 1], a, n, r);
2479
+ }, i.adj, i.gd), o = i.paths.length === 1, s = Pe(i.paths[0], a, n, r), l = o ? s : Pe(i.paths[i.paths.length - 1], a, n, r);
2479
2480
  return {
2480
- top: c,
2481
+ top: s,
2481
2482
  bottom: l,
2482
- topLen: Ie(c),
2483
- bottomLen: Ie(l),
2483
+ topLen: Fe(s),
2484
+ bottomLen: Fe(l),
2484
2485
  singleEdge: o
2485
2486
  };
2486
2487
  }
2487
- function Re(e, t, n) {
2488
+ function Le(e, t, n) {
2488
2489
  let r = t[t.length - 1];
2489
2490
  if (e.length === 1 || r === 0) return {
2490
2491
  x: e[0].x,
@@ -2505,17 +2506,17 @@ function Re(e, t, n) {
2505
2506
  ty: f / p
2506
2507
  };
2507
2508
  }
2508
- function ze(e) {
2509
+ function Re(e) {
2509
2510
  return e.topLen[e.topLen.length - 1] ?? 0;
2510
2511
  }
2511
- function Be(e, t) {
2512
+ function ze(e, t) {
2512
2513
  if (!e.singleEdge) return 1;
2513
- let n = ze(e);
2514
+ let n = Re(e);
2514
2515
  return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
2515
2516
  }
2516
- function Ve(e, t, n, r) {
2517
+ function Be(e, t, n, r) {
2517
2518
  if (e.singleEdge) {
2518
- let i = Re(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
2519
+ let i = Le(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
2519
2520
  return {
2520
2521
  x: i.x - o * c,
2521
2522
  y: i.y - s * c,
@@ -2524,7 +2525,7 @@ function Ve(e, t, n, r) {
2524
2525
  shear: 0
2525
2526
  };
2526
2527
  }
2527
- let i = Re(e.top, e.topLen, t), a = Re(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
2528
+ let i = Le(e.top, e.topLen, t), a = Le(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
2528
2529
  return {
2529
2530
  x: c,
2530
2531
  y: l,
@@ -2535,10 +2536,10 @@ function Ve(e, t, n, r) {
2535
2536
  }
2536
2537
  //#endregion
2537
2538
  //#region packages/core/src/shape/effects.ts
2538
- function He(e, t) {
2539
+ function Ve(e, t) {
2539
2540
  return [t === "tl" || t === "l" || t === "bl" ? e.x : t === "tr" || t === "r" || t === "br" ? e.x + e.w : e.x + e.w / 2, t === "tl" || t === "t" || t === "tr" ? e.y : t === "l" || t === "ctr" || t === "r" ? e.y + e.h / 2 : e.y + e.h];
2540
2541
  }
2541
- function Y(e, t) {
2542
+ function He(e, t) {
2542
2543
  return e * t;
2543
2544
  }
2544
2545
  function Ue(e) {
@@ -2570,29 +2571,29 @@ function Ge(e, t) {
2570
2571
  });
2571
2572
  }
2572
2573
  function Ke(e, t, n, r, i, a, o, s = 0, c) {
2573
- let l = Math.max(0, Y(r.blur, i)), u = Y(r.dist, i), d = r.rotWithShape === !1 ? 0 : s, f = (r.dir + d) * Math.PI / 180, p = Math.cos(f) * u, m = Math.sin(f) * u, h = We(n, Math.ceil(l * 3 + Math.max(Math.abs(p), Math.abs(m))) + 2, a, o), g = F(h.w, h.h);
2574
+ let l = Math.max(0, He(r.blur, i)), u = He(r.dist, i), d = r.rotWithShape === !1 ? 0 : s, f = (r.dir + d) * Math.PI / 180, p = Math.cos(f) * u, m = Math.sin(f) * u, h = We(n, Math.ceil(l * 3 + Math.max(Math.abs(p), Math.abs(m))) + 2, a, o), g = O(h.w, h.h);
2574
2575
  if (!g) return !1;
2575
2576
  let _ = Ue(g);
2576
2577
  if (!_) return !1;
2577
- t(Ge(_, h)), _.save(), _.setTransform(1, 0, 0, 1, 0, 0), _.globalCompositeOperation = "source-in", _.fillStyle = E(r.color, r.alpha), _.fillRect(0, 0, h.w, h.h), _.restore(), e.save(), l > 0 && (e.filter = `blur(${l}px)`);
2578
- let [v, y] = c ?? He(n, r.algn ?? "b"), b = r.sx ?? 1, x = r.sy ?? 1, S = Math.tan((r.kx ?? 0) * Math.PI / 180), C = Math.tan((r.ky ?? 0) * Math.PI / 180);
2578
+ t(Ge(_, h)), _.save(), _.setTransform(1, 0, 0, 1, 0, 0), _.globalCompositeOperation = "source-in", _.fillStyle = D(r.color, r.alpha), _.fillRect(0, 0, h.w, h.h), _.restore(), e.save(), l > 0 && (e.filter = `blur(${l}px)`);
2579
+ let [v, y] = c ?? Ve(n, r.algn ?? "b"), b = r.sx ?? 1, x = r.sy ?? 1, S = Math.tan((r.kx ?? 0) * Math.PI / 180), C = Math.tan((r.ky ?? 0) * Math.PI / 180);
2579
2580
  return e.translate(p, m), e.translate(v, y), d !== 0 && e.rotate(d * Math.PI / 180), e.transform(b, C, S, x, 0, 0), d !== 0 && e.rotate(-d * Math.PI / 180), e.translate(-v, -y), e.drawImage(g, h.x, h.y), e.restore(), !0;
2580
2581
  }
2581
2582
  function qe(e, t, n, r, i, a, o) {
2582
- let s = Y(r.blur, i), c = Y(r.dist, i), l = r.dir * Math.PI / 180, u = Math.cos(l) * c, d = Math.sin(l) * c, f = We(n, Math.ceil(3 * s + Math.abs(c)) + 2, a, o), p = F(f.w, f.h);
2583
+ let s = He(r.blur, i), c = He(r.dist, i), l = r.dir * Math.PI / 180, u = Math.cos(l) * c, d = Math.sin(l) * c, f = We(n, Math.ceil(3 * s + Math.abs(c)) + 2, a, o), p = O(f.w, f.h);
2583
2584
  if (!p) return;
2584
2585
  let m = Ue(p);
2585
2586
  if (!m) return;
2586
2587
  let h = Ge(m, f);
2587
- h.save(), h.fillStyle = E(r.color, r.alpha), t(h), h.restore(), h.save(), h.globalCompositeOperation = "destination-out", h.filter = s > 0 ? `blur(${s}px)` : "none", h.translate(u, d), h.fillStyle = "#000", t(h), h.restore(), h.save(), h.globalCompositeOperation = "destination-in", h.filter = "none", h.fillStyle = "#000", t(h), h.restore(), e.save(), e.drawImage(p, f.x, f.y), e.restore();
2588
+ h.save(), h.fillStyle = D(r.color, r.alpha), t(h), h.restore(), h.save(), h.globalCompositeOperation = "destination-out", h.filter = s > 0 ? `blur(${s}px)` : "none", h.translate(u, d), h.fillStyle = "#000", t(h), h.restore(), h.save(), h.globalCompositeOperation = "destination-in", h.filter = "none", h.fillStyle = "#000", t(h), h.restore(), e.save(), e.drawImage(p, f.x, f.y), e.restore();
2588
2589
  }
2589
2590
  function Je(e, t, n, r, i, a, o, s) {
2590
- let c = Y(r.radius, i);
2591
+ let c = He(r.radius, i);
2591
2592
  if (c <= 0) {
2592
2593
  t(e);
2593
2594
  return;
2594
2595
  }
2595
- let l = We(n, Math.ceil(c) + 2, a, o), u = n.x - l.x, d = n.y - l.y, f = F(l.w, l.h);
2596
+ let l = We(n, Math.ceil(c) + 2, a, o), u = n.x - l.x, d = n.y - l.y, f = O(l.w, l.h);
2596
2597
  if (!f) {
2597
2598
  t(e);
2598
2599
  return;
@@ -2604,7 +2605,7 @@ function Je(e, t, n, r, i, a, o, s) {
2604
2605
  }
2605
2606
  let m = Ge(p, l), h = s ?? t;
2606
2607
  t(m);
2607
- let g = F(l.w, l.h), _ = F(l.w, l.h), v = g ? Ue(g) : null, y = _ ? Ue(_) : null;
2608
+ let g = O(l.w, l.h), _ = O(l.w, l.h), v = g ? Ue(g) : null, y = _ ? Ue(_) : null;
2608
2609
  if (g && v && _ && y) {
2609
2610
  let t = Ge(v, l);
2610
2611
  t.fillStyle = "#000", h(t), y.drawImage(f, u, d, n.w, n.h, u - c, d - c, n.w + c * 2, n.h + c * 2), y.drawImage(f, 0, 0), y.globalCompositeOperation = "destination-in", y.filter = `blur(${c / 3}px)`, y.drawImage(g, 0, 0), y.filter = "none", y.globalCompositeOperation = "source-over", e.save(), e.drawImage(_, l.x, l.y), e.restore();
@@ -2613,15 +2614,15 @@ function Je(e, t, n, r, i, a, o, s) {
2613
2614
  e.save(), e.drawImage(f, 0, 0), e.restore();
2614
2615
  }
2615
2616
  function Ye(e, t, n, r, i, a, o) {
2616
- let s = F(a, o);
2617
+ let s = O(a, o);
2617
2618
  if (!s) return;
2618
2619
  let c = Ue(s);
2619
2620
  if (!c) return;
2620
- let l = Y(r.blur, i);
2621
+ let l = He(r.blur, i);
2621
2622
  c.save(), l > 0 && (c.filter = `blur(${l}px)`), t(c), c.restore(), c.save(), c.globalCompositeOperation = "destination-in";
2622
2623
  let u = n.y, d = n.y + n.h, f = c.createLinearGradient(0, d, 0, u), p = Xe(r.stPos), m = Xe(r.endPos);
2623
2624
  f.addColorStop(0, `rgba(0,0,0,${r.stA})`), p > 0 && f.addColorStop(p, `rgba(0,0,0,${r.stA})`), m < 1 && m > p && f.addColorStop(m, `rgba(0,0,0,${r.endA})`), f.addColorStop(1, `rgba(0,0,0,${r.endA})`), c.fillStyle = f, c.fillRect(0, 0, a, o), c.restore();
2624
- let h = Y(r.dist, i), g = r.dir * Math.PI / 180, _ = Math.cos(g) * h, v = Math.sin(g) * h;
2625
+ let h = He(r.dist, i), g = r.dir * Math.PI / 180, _ = Math.cos(g) * h, v = Math.sin(g) * h;
2625
2626
  e.save(), e.translate(n.x + _, d + v), e.scale(r.sx, r.sy), e.translate(-n.x, -d), e.drawImage(s, 0, 0), e.restore();
2626
2627
  }
2627
2628
  function Xe(e) {
@@ -2955,7 +2956,7 @@ function St(e, t, n, r, i, a, o, s, c, l) {
2955
2956
  d = Math.floor(d) - 1, f = Math.floor(f) - 1, p = Math.ceil(p) + 1, m = Math.ceil(m) + 1;
2956
2957
  let h = p - d, g = m - f;
2957
2958
  if (h <= 0 || g <= 0) return !1;
2958
- let _ = Math.max(1, Math.ceil(h * xt)), v = Math.max(1, Math.ceil(g * xt)), y = F(_, v);
2959
+ let _ = Math.max(1, Math.ceil(h * xt)), v = Math.max(1, Math.ceil(g * xt)), y = O(_, v);
2959
2960
  if (!y || y.width !== _ || y.height !== v) return !1;
2960
2961
  let b = y.getContext("2d") ?? null;
2961
2962
  if (!b) return !1;
@@ -3305,7 +3306,7 @@ function Jt(e, t, n) {
3305
3306
  //#endregion
3306
3307
  //#region packages/core/src/text/underline.ts
3307
3308
  function Yt(e, t, n, r, i, a, o, s = 1) {
3308
- let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d = J(u, l, s);
3309
+ let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d = K(u, l, s);
3309
3310
  if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
3310
3311
  let n = l, i = l * 6;
3311
3312
  e.beginPath(), e.moveTo(t, u);
@@ -3326,10 +3327,10 @@ function Yt(e, t, n, r, i, a, o, s = 1) {
3326
3327
  }
3327
3328
  if (o === "dbl") {
3328
3329
  let n = l * 1.4, i = u - n / 2, a = u + n / 2;
3329
- e.beginPath(), e.moveTo(t, i + J(i, l, s)), e.lineTo(t + r, i + J(i, l, s)), e.moveTo(t, a + J(a, l, s)), e.lineTo(t + r, a + J(a, l, s)), e.stroke();
3330
+ e.beginPath(), e.moveTo(t, i + K(i, l, s)), e.lineTo(t + r, i + K(i, l, s)), e.moveTo(t, a + K(a, l, s)), e.lineTo(t + r, a + K(a, l, s)), e.stroke();
3330
3331
  return;
3331
3332
  }
3332
- e.setLineDash(_(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
3333
+ e.setLineDash(Ce(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
3333
3334
  }
3334
3335
  //#endregion
3335
3336
  //#region packages/core/src/text/highlight-box.ts
@@ -3385,7 +3386,7 @@ function tn(e, t) {
3385
3386
  ref: n ?? r
3386
3387
  };
3387
3388
  let i = n, a = H(i);
3388
- return a !== null && ae.includes(a) ? {
3389
+ return a !== null && re.includes(a) ? {
3389
3390
  kind: "external",
3390
3391
  url: i
3391
3392
  } : {
@@ -3416,27 +3417,27 @@ var rn = (e) => {
3416
3417
  function on(e) {
3417
3418
  for (let t of e) {
3418
3419
  let e = rn(t);
3419
- if (e !== void 0 && W(e)) return !0;
3420
+ if (e !== void 0 && U(e)) return !0;
3420
3421
  }
3421
3422
  return !1;
3422
3423
  }
3423
- function sn(t, n) {
3424
- let r = t.length;
3424
+ function sn(e, n) {
3425
+ let r = e.length;
3425
3426
  if (r === 0) return {
3426
3427
  order: [],
3427
3428
  rtl: []
3428
3429
  };
3429
3430
  let i = "", a = Array(r), o;
3430
- for (let e = 0; e < r; e++) {
3431
- a[e] = i.length;
3432
- let n = rn(t[e]) ?? "";
3433
- if (i += n.length > 0 ? n : "", an(t[e])) {
3431
+ for (let t = 0; t < r; t++) {
3432
+ a[t] = i.length;
3433
+ let n = rn(e[t]) ?? "";
3434
+ if (i += n.length > 0 ? n : "", an(e[t])) {
3434
3435
  for (o ??= []; o.length < i.length;) o.push(null);
3435
- o[a[e]] = "S";
3436
+ o[a[t]] = "S";
3436
3437
  }
3437
3438
  }
3438
3439
  if (o) for (; o.length < i.length;) o.push(null);
3439
- let { levels: s, paragraphLevel: c } = f().computeLevels(i, n ? "rtl" : "ltr", o), { order: l, segLevels: u } = e(s, c, a), d = Array(r);
3440
+ let { levels: s, paragraphLevel: c } = p().computeLevels(i, n ? "rtl" : "ltr", o), { order: l, segLevels: u } = t(s, c, a), d = Array(r);
3440
3441
  for (let e = 0; e < r; e++) d[e] = (u[e] & 1) == 1;
3441
3442
  return {
3442
3443
  order: l,
@@ -3445,18 +3446,19 @@ function sn(t, n) {
3445
3446
  }
3446
3447
  //#endregion
3447
3448
  //#region packages/pptx/src/cjk-wrap.ts
3448
- function cn(e, t, n, r) {
3449
+ function cn(e, t, n, r, i = 0, o = !1) {
3449
3450
  if (e.length === 0) return 0;
3450
- let a = t === 0, o = 0, s = t;
3451
+ let s = t === 0, c = 0, l = t;
3451
3452
  for (let t of e) {
3452
- if (s + t.w > n) {
3453
- if (o > 0 || !a) break;
3454
- s += t.w, o++;
3453
+ let e = c > 0 || o ? i : 0;
3454
+ if (l + e + t.w > n) {
3455
+ if (c > 0 || !s) break;
3456
+ l += e + t.w, c++;
3455
3457
  break;
3456
3458
  }
3457
- s += t.w, o++;
3459
+ l += e + t.w, c++;
3458
3460
  }
3459
- return o === 0 ? 0 : o >= e.length ? e.length : i(e.map((e) => e.ch), o, r, +!!a);
3461
+ return c === 0 ? 0 : c >= e.length ? e.length : a(e.map((e) => e.ch), c, r, +!!s);
3460
3462
  }
3461
3463
  //#endregion
3462
3464
  //#region packages/pptx/src/text-justify.ts
@@ -3465,10 +3467,10 @@ function un(e, t, n, r, i) {
3465
3467
  if (r === "just" && i) return null;
3466
3468
  let a = t - n;
3467
3469
  if (a <= .5) return null;
3468
- let o = Ce(e, a, {
3470
+ let o = xe(e, a, {
3469
3471
  firstContentSi: 0,
3470
3472
  lastDrawnSi: e.length,
3471
- isGapChar: de,
3473
+ isGapChar: le,
3472
3474
  isWhitespace: ln,
3473
3475
  seaClusterGaps: r === "thaiDist"
3474
3476
  });
@@ -3522,9 +3524,9 @@ function pn(e, t) {
3522
3524
  //#endregion
3523
3525
  //#region packages/pptx/src/smartart-fallback-contrast.ts
3524
3526
  function mn(e) {
3525
- let t = k(e.length === 8 ? e.slice(0, 6) : e);
3527
+ let t = M(e.length === 8 ? e.slice(0, 6) : e);
3526
3528
  if (!t) return null;
3527
- let n = fe(t[0], t[1], t[2]);
3529
+ let n = ue(t[0], t[1], t[2]);
3528
3530
  if (e.length !== 8) return n;
3529
3531
  let r = Number.parseInt(e.slice(6, 8), 16);
3530
3532
  if (Number.isNaN(r)) return null;
@@ -3605,12 +3607,12 @@ function xn(e, t) {
3605
3607
  function Sn(e, t, n, r, i, a, o = "fill", s = yn) {
3606
3608
  let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - bn(e, t, i), f = 0;
3607
3609
  for (let o of t) {
3608
- let t = o.codePointAt(0) ?? 0, l = I(t), p = e.measureText(o).width + a, m = l === "Tr" ? ce(t) : null, h = l === "Tr" && m === null && q(t), g = l === "U" || l === "Tu" || m !== null || h;
3609
- if (ne(t) && s(t)) {
3610
+ let t = o.codePointAt(0) ?? 0, l = L(t), p = e.measureText(o).width + a, m = l === "Tr" ? se(t) : null, h = l === "Tr" && m === null && G(t), g = l === "U" || l === "Tu" || m !== null || h;
3611
+ if (ee(t) && s(t)) {
3610
3612
  let t = n + f + p / 2;
3611
- e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", A(e, () => u(o, 0, 0)), e.restore();
3613
+ e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", N(e, () => u(o, 0, 0)), e.restore();
3612
3614
  } else if (g) {
3613
- let r = m === null && l === "Tu" ? N(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? xn(e, s) / i : 0;
3615
+ let r = m === null && l === "Tu" ? F(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? xn(e, s) / i : 0;
3614
3616
  e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
3615
3617
  } else if (l === "Tr") {
3616
3618
  let t = n + f + p / 2;
@@ -3621,20 +3623,20 @@ function Sn(e, t, n, r, i, a, o = "fill", s = yn) {
3621
3623
  e.textAlign = c, e.textBaseline = l;
3622
3624
  }
3623
3625
  function Cn(e, t, n, r, i, a, o = "fill") {
3624
- Sn(e, t, n, r, i, a, o, (t) => oe(e, t));
3626
+ Sn(e, t, n, r, i, a, o, (t) => ae(e, t));
3625
3627
  }
3626
3628
  //#endregion
3627
3629
  //#region packages/pptx/src/renderer.ts
3628
3630
  function X(e, t) {
3629
3631
  return e * t;
3630
3632
  }
3631
- var Z = E;
3633
+ var Z = D;
3632
3634
  function wn(e, t, n, r, i, a, o) {
3633
3635
  let { top: s, height: c } = Xt(n, i);
3634
3636
  e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
3635
3637
  }
3636
3638
  function Tn(e, t, n, r, i, a, o = 0) {
3637
- return T(e, t, n, r, i, a, o);
3639
+ return E(e, t, n, r, i, a, o);
3638
3640
  }
3639
3641
  var En = /* @__PURE__ */ new WeakMap();
3640
3642
  function Dn(e, t) {
@@ -3672,7 +3674,7 @@ async function Mn(e, t) {
3672
3674
  if (n.length !== 0) {
3673
3675
  await t.loadMathJax();
3674
3676
  for (let e of n) if (!En.has(e.nodes)) try {
3675
- let n = await t.mathMLToSvg(O(e.nodes, e.display)), r = await On(An(Ee(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
3677
+ let n = await t.mathMLToSvg(A(e.nodes, e.display)), r = await On(An(Te(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
3676
3678
  En.set(e.nodes, {
3677
3679
  img: r,
3678
3680
  widthEm: n.widthEm,
@@ -3695,7 +3697,7 @@ var Pn = new Set([
3695
3697
  "system-ui"
3696
3698
  ]);
3697
3699
  function Fn(e) {
3698
- let t = L(e);
3700
+ let t = ie(e);
3699
3701
  return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
3700
3702
  }
3701
3703
  var In = {
@@ -3719,11 +3721,11 @@ function Rn(e) {
3719
3721
  function zn(e) {
3720
3722
  return e.map((e) => `"${e}"`).join(", ");
3721
3723
  }
3722
- function Bn(e) {
3723
- let t = Fn(e), n = In[e.toLowerCase()], r = n ? `"${n}", ` : "";
3724
- if (Rn(e)) return `"${e}", ${r}${Ln}, ${t}`;
3725
- let i = t === "serif" ? "serif" : "sans", a = P(e);
3726
- return `"${e}", ${r}${a ? `${zn(le(a, i))}, ` : ""}${`${zn(i === "serif" ? j : se)}, `}${t}`;
3724
+ function Bn(t) {
3725
+ let n = Fn(t), r = In[t.toLowerCase()], i = r ? `"${r}", ` : "";
3726
+ if (Rn(t)) return `"${t}", ${i}${Ln}, ${n}`;
3727
+ let a = n === "serif" ? "serif" : "sans", o = J(t);
3728
+ return `"${t}", ${i}${o ? `${zn(oe(o, a))}, ` : ""}${`${zn(a === "serif" ? e : v)}, `}${n}`;
3727
3729
  }
3728
3730
  function Vn(e) {
3729
3731
  return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
@@ -3733,12 +3735,12 @@ function Hn(e) {
3733
3735
  return /\b(thin|hairline)\b/.test(t) ? 100 : /\b(extra[- ]?light|ultra[- ]?light)\b/.test(t) ? 200 : /\blight\b/.test(t) ? 300 : /\b(black|heavy)\b/.test(t) ? 900 : /\b(extra[- ]?bold|ultra[- ]?bold)\b/.test(t) ? 800 : /\b(semi[- ]?bold|demi[- ]?bold)\b/.test(t) ? 600 : /\bbold\b/.test(t) ? 700 : /\bmedium\b/.test(t) ? 600 : null;
3734
3736
  }
3735
3737
  function Un(e, t, n, r, i, a, o, s) {
3736
- let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g = F(m, h), _ = g?.getContext("2d");
3738
+ let c = Math.max(0, r.blur * i), l = Math.ceil(c * 3) + 2, u = Math.max(0, Math.floor(n.x - l)), d = Math.max(0, Math.floor(n.y - l)), f = Math.min(o, Math.ceil(n.x + n.w + l)), p = Math.min(s, Math.ceil(n.y + n.h + l)), m = Math.max(1, f - u), h = Math.max(1, p - d), g = O(m, h), _ = g?.getContext("2d");
3737
3739
  if (!g || !_) return;
3738
3740
  _.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
3739
3741
  let v = n.y - d, y = v + n.h, b = g, x = _;
3740
3742
  if (c > 0) {
3741
- let e = F(m, h), t = e?.getContext("2d");
3743
+ let e = O(m, h), t = e?.getContext("2d");
3742
3744
  e && t && (b = e, x = t);
3743
3745
  }
3744
3746
  b !== g && en(x, g, {
@@ -3768,66 +3770,104 @@ function Un(e, t, n, r, i, a, o, s) {
3768
3770
  let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
3769
3771
  e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.translate(n.x + Math.cos(E) * T, D + Math.sin(E) * T), e.scale(r.sx, r.sy), e.translate(-n.x, -D), e.drawImage(b, u, d), e.restore();
3770
3772
  }
3771
- function Q(e, t, n, r, i) {
3773
+ function Wn(e, t, n, r, i) {
3772
3774
  let a = t ? "italic " : "", o = Nn(r, i), s = Hn(o), c = e ? "bold " : s ? `${s} ` : "";
3773
3775
  return Pn.has(o) ? `${a}${c}${n}px ${o}` : `${a}${c}${n}px ${Bn(o)}`;
3774
3776
  }
3775
- function Wn(e) {
3776
- return e.bullet.type === "char" || e.bullet.type === "autoNum" || De(e.bullet).type === "blip";
3777
+ function Gn(e) {
3778
+ return e.bullet.type === "char" || e.bullet.type === "autoNum" || Ee(e.bullet).type === "blip";
3777
3779
  }
3778
- function Gn(e, t) {
3780
+ function Kn(e, t) {
3779
3781
  return e ? 0 : Math.max(0, t);
3780
3782
  }
3781
- function Kn(e, t, n, r, i, a, o) {
3782
- let s = (t.defaultFontSize ?? 18) * U * a;
3783
+ function qn(e, t, n, r, i, a, o) {
3784
+ let s = (t.defaultFontSize ?? 18) * Y * a;
3783
3785
  for (let c of t.paragraphs) {
3784
- let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = Gn(Wn(c), d), p = n - r - i - l - u - f, m = 0;
3786
+ let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = Kn(Gn(c), d), p = n - r - i - l - u - f, m = 0;
3785
3787
  for (let n of c.runs) {
3786
3788
  if (n.type !== "text") continue;
3787
- let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * U * a : n.fontSize * U * a, i = Nn(n.fontFamily ?? c.defFontFamily ?? null, o);
3788
- if (e.font = Q(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, r, i, o), m += e.measureText(n.text).width, m > p) return !0;
3789
+ let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i = Nn(n.fontFamily ?? c.defFontFamily ?? null, o);
3790
+ e.font = Wn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, r, i, o);
3791
+ let l = (n.letterSpacing ?? 0) * Y * a;
3792
+ if (m += Q(e, n.text, l), m > p) return !0;
3789
3793
  }
3790
3794
  }
3791
3795
  return !1;
3792
3796
  }
3793
- function qn(e) {
3794
- for (let t of e) if (de(t.codePointAt(0) ?? 0)) return !0;
3797
+ function Jn(e) {
3798
+ for (let t of e) if (le(t.codePointAt(0) ?? 0)) return !0;
3795
3799
  return !1;
3796
3800
  }
3797
- function Jn(e) {
3801
+ function Yn(e) {
3798
3802
  let t = 0;
3799
3803
  for (let n of e) t++;
3800
3804
  return t;
3801
3805
  }
3802
- function Yn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
3806
+ var Xn = /* @__PURE__ */ new WeakMap();
3807
+ function Zn(e) {
3808
+ let t = Xn.get(e);
3809
+ if (t != null) return t;
3810
+ let n = e, r = n.letterSpacing;
3811
+ if (typeof r != "string") return Xn.set(e, !1), !1;
3812
+ let i = !1;
3813
+ try {
3814
+ n.letterSpacing = "0px";
3815
+ let t = e.measureText("ii").width;
3816
+ n.letterSpacing = "1px";
3817
+ let r = e.measureText("ii").width;
3818
+ i = Number.isFinite(t) && Number.isFinite(r) && r !== t;
3819
+ } catch {
3820
+ i = !1;
3821
+ } finally {
3822
+ try {
3823
+ n.letterSpacing = r;
3824
+ } catch {}
3825
+ }
3826
+ return Xn.set(e, i), i;
3827
+ }
3828
+ function Q(e, t, n) {
3829
+ let r = e, i = r.letterSpacing;
3830
+ if (n !== 0 && Zn(e)) try {
3831
+ r.letterSpacing = `${n}px`;
3832
+ let i = e.measureText(t).width;
3833
+ if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
3834
+ } finally {
3835
+ try {
3836
+ r.letterSpacing = i;
3837
+ } catch {}
3838
+ }
3839
+ let a = Math.max(0, Yn(t) - 1);
3840
+ return e.measureText(t).width + n * a;
3841
+ }
3842
+ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
3803
3843
  themeMajorFont: null,
3804
3844
  themeMinorFont: null,
3805
3845
  dpr: 1
3806
3846
  }, p = 0) {
3807
- let m = [], g = /* @__PURE__ */ new Map(), _ = !0;
3847
+ let m = [], h = /* @__PURE__ */ new Map(), _ = !0;
3808
3848
  for (let e = t.runs.length - 1; e >= 0 && _; e--) {
3809
3849
  let n = t.runs[e];
3810
3850
  if (n.type === "break") continue;
3811
3851
  if (n.type === "math") break;
3812
3852
  let r = n.text.replace(/ +$/u, "");
3813
- r !== n.text && g.set(n, r), (r.length > 0 || n.fieldType != null) && (_ = !1);
3853
+ r !== n.text && h.set(n, r), (r.length > 0 || n.fieldType != null) && (_ = !1);
3814
3854
  }
3815
- let v = () => n - (m.length === 0 ? p : 0), b = { segments: [] }, x = 0, S = !1, C = t.rtl === !0, w = X(t.marR, o), T = (t.tabStops ?? []).map((e) => ({
3855
+ let v = () => n - (m.length === 0 ? p : 0), y = { segments: [] }, x = 0, S = !1, C = t.rtl === !0, w = X(t.marR, o), T = (t.tabStops ?? []).map((e) => ({
3816
3856
  pos: X(e.pos, o),
3817
3857
  algn: e.algn
3818
- })), E = X(t.defTabSz ?? 914400, o), O = !1, k = [], A = 0, j = () => C ? w : s + (m.length === 0 ? p : 0), M = (e = 0) => {
3819
- let t = vn(e > 0 ? [...k, {
3858
+ })), E = X(t.defTabSz ?? 914400, o), D = !1, O = [], A = 0, j = () => C ? w : s + (m.length === 0 ? p : 0), M = (e = 0) => {
3859
+ let t = vn(e > 0 ? [...O, {
3820
3860
  isTab: !1,
3821
3861
  width: e
3822
- }] : k, T, j(), Infinity, A, E), n = 0;
3862
+ }] : O, T, j(), Infinity, A, E), n = 0;
3823
3863
  for (let e of t) n += e;
3824
3864
  return n;
3825
3865
  }, N = (e) => {
3826
3866
  let t = v();
3827
- return Number.isFinite(t) ? O ? M(e) <= t : x + e <= t : !0;
3867
+ return Number.isFinite(t) ? D ? M(e) <= t : x + e <= t : !0;
3828
3868
  }, P = () => {
3829
3869
  let e = v();
3830
- if (!O) return e - x;
3870
+ if (!D) return e - x;
3831
3871
  if (!Number.isFinite(e)) return Infinity;
3832
3872
  if (M(0) >= e) return 0;
3833
3873
  let t = 0, n = e;
@@ -3837,43 +3877,51 @@ function Yn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
3837
3877
  }
3838
3878
  return t;
3839
3879
  }, F = (e = !1) => {
3840
- e && (b.endsWithBreak = !0), m.push(b), b = { segments: [] }, x = 0, O = !1, k = [], S = !1;
3841
- }, I = (t, n, r, i, a, o, s, c) => {
3880
+ e && (y.endsWithBreak = !0), m.push(y), y = { segments: [] }, x = 0, D = !1, O = [], S = !1;
3881
+ }, I = (t, n, r, i) => {
3882
+ e.font = n;
3883
+ let a = Q(e, t, r), o = y.segments.at(-1);
3884
+ return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ? Q(e, o.text + t, r) - Q(e, o.text, r) : a + r;
3885
+ }, L = (t, n, r, i, a, o, s, c) => {
3842
3886
  if (!t) return;
3843
3887
  e.font = n;
3844
- let l = c?.letterSpacingPx ?? 0, u = e.measureText(t).width + l * Jn(t), d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily, y = c?.hyperlink, S = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && Vn(e.hyperlink) === Vn(y);
3845
- x += u, k.push({
3888
+ let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight, v = c?.fontFamily, b = c?.hyperlink, S = (e) => !e.math && !e.isTab && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === m && e.reflection === h && e.outline === g && (e.highlight ?? "") === (_ ?? "") && (e.fontFamily ?? "") === (v ?? "") && Vn(e.hyperlink) === Vn(b) && (l === 0 || e.sourceRunId === u), C = y.segments.at(-1), w = Q(e, t, l);
3889
+ if (C && S(C) ? w = Q(e, C.text + t, l) - Q(e, C.text, l) : C && !C.isTab && !C.math && u != null && C.sourceRunId === u && (w += l), x += w, O.push({
3846
3890
  isTab: !1,
3847
- width: u
3848
- });
3849
- let C = b.segments.at(-1);
3850
- C && S(C) ? C.text += t : b.segments.push({
3851
- text: t,
3852
- font: n,
3853
- fontFamily: v,
3854
- sizePx: r,
3855
- color: i,
3856
- underline: a,
3857
- underlineStyle: f,
3858
- underlineColor: p,
3859
- strikethrough: o,
3860
- strikeDouble: d,
3861
- letterSpacingPx: l || void 0,
3862
- baseline: s,
3863
- shadow: m,
3864
- reflection: h,
3865
- outline: g,
3866
- highlight: _,
3867
- hyperlink: y
3868
- });
3869
- }, L = () => {
3870
- let e = b.segments.at(-1);
3891
+ width: w
3892
+ }), C && S(C)) C.text += t;
3893
+ else {
3894
+ let e = C && !C.isTab && !C.math && u != null && C.sourceRunId === u ? l : 0;
3895
+ y.segments.push({
3896
+ text: t,
3897
+ font: n,
3898
+ fontFamily: v,
3899
+ sizePx: r,
3900
+ color: i,
3901
+ underline: a,
3902
+ underlineStyle: f,
3903
+ underlineColor: p,
3904
+ strikethrough: o,
3905
+ strikeDouble: d,
3906
+ letterSpacingPx: l || void 0,
3907
+ sourceRunId: u,
3908
+ leadingLetterSpacingPx: e || void 0,
3909
+ baseline: s,
3910
+ shadow: m,
3911
+ reflection: h,
3912
+ outline: g,
3913
+ highlight: _,
3914
+ hyperlink: b
3915
+ });
3916
+ }
3917
+ }, z = () => {
3918
+ let e = y.segments.at(-1);
3871
3919
  if (!e || e.math) return !1;
3872
3920
  let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
3873
3921
  if (t) e.text = t[1], n = t[2];
3874
- else if (b.segments.length > 1) b.segments.pop(), n = e.text;
3922
+ else if (y.segments.length > 1) y.segments.pop(), n = e.text;
3875
3923
  else return !1;
3876
- return F(), I(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
3924
+ return F(), L(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
3877
3925
  strikeDouble: e.strikeDouble,
3878
3926
  letterSpacingPx: e.letterSpacingPx,
3879
3927
  underlineStyle: e.underlineStyle,
@@ -3882,215 +3930,211 @@ function Yn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
3882
3930
  reflection: e.reflection,
3883
3931
  outline: e.outline,
3884
3932
  highlight: e.highlight,
3885
- fontFamily: e.fontFamily
3933
+ fontFamily: e.fontFamily,
3934
+ sourceRunId: e.sourceRunId
3886
3935
  }), !0;
3887
3936
  };
3888
- for (let n of t.runs) {
3889
- if (n.type === "break") {
3937
+ for (let [n, s] of t.runs.entries()) {
3938
+ if (s.type === "break") {
3890
3939
  F(!0);
3891
3940
  continue;
3892
3941
  }
3893
- if (n.type === "math") {
3894
- let e = En.get(n.nodes), t = n.fontSize == null ? i : n.fontSize * U * o * u, r = e ? e.widthEm * t : 0, s = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
3895
- (n.display && x > 0 || !N(r) && x > 0) && F(), k.push({
3942
+ if (s.type === "math") {
3943
+ let e = En.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * Y * o * u, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
3944
+ (s.display && x > 0 || !N(n) && x > 0) && F(), O.push({
3896
3945
  isTab: !1,
3897
- width: r
3898
- }), b.segments.push({
3946
+ width: n
3947
+ }), y.segments.push({
3899
3948
  text: "",
3900
3949
  font: `${t}px sans-serif`,
3901
3950
  sizePx: t,
3902
- color: n.color ? Z(n.color) : a,
3951
+ color: s.color ? Z(s.color) : a,
3903
3952
  underline: !1,
3904
3953
  strikethrough: !1,
3905
3954
  math: {
3906
- nodes: n.nodes,
3907
- display: n.display,
3908
- width: r,
3909
- ascent: s,
3955
+ nodes: s.nodes,
3956
+ display: s.display,
3957
+ width: n,
3958
+ ascent: i,
3910
3959
  descent: c
3911
3960
  }
3912
- }), x += r, n.display && F();
3961
+ }), x += n, s.display && F();
3913
3962
  continue;
3914
3963
  }
3915
- let s = n.fontSize == null ? i : n.fontSize * U * o * u, p = Nn(n.fontFamily ?? t.defFontFamily ?? null, f), m = n.fontFamilyEa ? Nn(n.fontFamilyEa, f) : null, _ = n.fontFamilySym ? Nn(n.fontFamilySym, f) : null, C;
3916
- C = n.color ? Z(n.color) : n.hyperlink && f.themeHlinkColor ? Z(f.themeHlinkColor) : a;
3917
- let w = n.bold ?? t.defBold ?? c, T = n.italic ?? t.defItalic ?? l, E = Q(w, T, s, p, f), j = m ? Q(w, T, s, m, f) : E;
3918
- e.font = E;
3919
- let M = n.caps, z = g.get(n) ?? n.text;
3920
- (M === "all" || M === "small") && (z = z.toUpperCase());
3921
- let V = n.fieldType === "slidenum" && d !== void 0 ? String(d) : z, H = n.underline || n.hyperlink !== void 0, W = n.strikeDouble === !0, G = n.letterSpacing == null ? 0 : n.letterSpacing * U * o, K = {
3922
- strikeDouble: W,
3923
- letterSpacingPx: G,
3924
- underlineStyle: n.underlineStyle,
3925
- underlineColor: n.underlineColor ? Z(n.underlineColor) : void 0,
3926
- shadow: n.shadow,
3927
- reflection: n.reflection,
3928
- outline: n.outline,
3929
- fontFamily: p,
3930
- highlight: n.highlight ? Z(n.highlight) : void 0,
3931
- hyperlink: tn(n.hyperlink)
3932
- }, q = V.split(/(\s+)/);
3933
- for (let i of q) {
3934
- if (!i) continue;
3935
- if (/^\t+$/.test(i)) {
3936
- O || (e.font = E, A = e.measureText(" ").width);
3937
- for (let e of i) b.segments.push({
3964
+ let p = s.fontSize == null ? r : s.fontSize * Y * o * u, m = Nn(s.fontFamily ?? t.defFontFamily ?? null, f), _ = s.fontFamilyEa ? Nn(s.fontFamilyEa, f) : null, C = s.fontFamilySym ? Nn(s.fontFamilySym, f) : null, w;
3965
+ w = s.color ? Z(s.color) : s.hyperlink && f.themeHlinkColor ? Z(f.themeHlinkColor) : a;
3966
+ let T = s.bold ?? t.defBold ?? c, E = s.italic ?? t.defItalic ?? l, j = Wn(T, E, p, m, f), M = _ ? Wn(T, E, p, _, f) : j;
3967
+ e.font = j;
3968
+ let V = s.caps, H = h.get(s) ?? s.text;
3969
+ (V === "all" || V === "small") && (H = H.toUpperCase());
3970
+ let U = s.fieldType === "slidenum" && d !== void 0 ? String(d) : H, W = s.underline || s.hyperlink !== void 0, G = s.strikeDouble === !0, K = s.letterSpacing == null ? 0 : s.letterSpacing * Y * o, q = {
3971
+ strikeDouble: G,
3972
+ letterSpacingPx: K,
3973
+ underlineStyle: s.underlineStyle,
3974
+ underlineColor: s.underlineColor ? Z(s.underlineColor) : void 0,
3975
+ shadow: s.shadow,
3976
+ reflection: s.reflection,
3977
+ outline: s.outline,
3978
+ fontFamily: m,
3979
+ highlight: s.highlight ? Z(s.highlight) : void 0,
3980
+ hyperlink: tn(s.hyperlink),
3981
+ sourceRunId: n
3982
+ }, J = U.split(/(\s+)/);
3983
+ for (let r of J) {
3984
+ if (!r) continue;
3985
+ if (/^\t+$/.test(r)) {
3986
+ D || (e.font = j, A = e.measureText(" ").width);
3987
+ for (let e of r) y.segments.push({
3938
3988
  text: "",
3939
3989
  isTab: !0,
3940
- font: E,
3941
- fontFamily: p,
3942
- sizePx: s,
3943
- color: C,
3990
+ font: j,
3991
+ fontFamily: m,
3992
+ sizePx: p,
3993
+ color: w,
3944
3994
  underline: !1,
3945
3995
  strikethrough: !1
3946
- }), k.push({
3996
+ }), O.push({
3947
3997
  isTab: !0,
3948
3998
  width: 0
3949
3999
  });
3950
- O = !0;
4000
+ D = !0;
3951
4001
  continue;
3952
4002
  }
3953
- e.font = E;
3954
- let a = e.measureText(i).width, o = /^\s+$/.test(i), c = /[-]/;
3955
- if (c.test(i) && (_ != null || we(p))) {
3956
- let t = _ ?? p;
3957
- for (let r of i) {
3958
- let i = r, a = E;
3959
- if (c.test(r)) {
3960
- let e = ge(r, t);
3961
- e === r ? a = Q(w, T, s, t, f) : (i = e, a = Q(w, T, s, "sans-serif", f));
4003
+ e.font = j;
4004
+ let a = I(r, j, K, n), o = /^\s+$/.test(r), c = /[-]/;
4005
+ if (c.test(r) && (C != null || Se(m))) {
4006
+ let t = C ?? m;
4007
+ for (let i of r) {
4008
+ let r = i, a = j;
4009
+ if (c.test(i)) {
4010
+ let e = me(i, t);
4011
+ e === i ? a = Wn(T, E, p, t, f) : (r = e, a = Wn(T, E, p, "sans-serif", f));
3962
4012
  }
3963
- e.font = a;
3964
- let o = e.measureText(i).width;
3965
- !N(o) && x > 0 && F(), I(i, a, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
4013
+ e.font = a, !N(I(r, a, K, n)) && x > 0 && F(), L(r, a, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
3966
4014
  }
3967
4015
  continue;
3968
4016
  }
3969
- if (qn(i) && (!B(i) || t.eaLnBrk === !1)) {
3970
- let r = [];
3971
- for (let t of i) {
3972
- let n = de(t.codePointAt(0) ?? 0) && m != null, i = n ? j : E, a = n ? m : p;
3973
- e.font = i, r.push({
4017
+ if (Jn(r) && (!B(r) || t.eaLnBrk === !1)) {
4018
+ let i = [];
4019
+ for (let t of r) {
4020
+ let n = le(t.codePointAt(0) ?? 0) && _ != null, r = n ? M : j, a = n ? _ : m;
4021
+ e.font = r, i.push({
3974
4022
  ch: t,
3975
- w: e.measureText(t).width,
3976
- font: i,
4023
+ w: Q(e, t, 0),
4024
+ font: r,
3977
4025
  family: a
3978
4026
  });
3979
4027
  }
3980
4028
  if (t.eaLnBrk === !1) {
3981
- let e = r.reduce((e, t) => e + t.w, 0);
3982
- x > 0 && !N(e) && F();
3983
- for (let e of r) I(e.ch, e.font, s, C, H, n.strikethrough, n.baseline ?? void 0, {
3984
- ...K,
4029
+ let e = y.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) * K + (t && i.length > 0 ? K : 0);
4030
+ x > 0 && !N(r) && F();
4031
+ for (let e of i) L(e.ch, e.font, p, w, W, s.strikethrough, s.baseline ?? void 0, {
4032
+ ...q,
3985
4033
  fontFamily: e.family
3986
4034
  });
3987
4035
  continue;
3988
4036
  }
3989
- let a = r;
4037
+ let a = i;
3990
4038
  for (; a.length > 0;) {
3991
- let e = Number.isFinite(v()) ? v() - P() : x, t = cn(a, e, v(), h);
3992
- if (t === 0) {
4039
+ let e = Number.isFinite(v()) ? v() - P() : x, t = y.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = cn(a, e, v(), g, K, r);
4040
+ if (i === 0) {
3993
4041
  if (x > 0) {
3994
4042
  F();
3995
4043
  continue;
3996
4044
  }
3997
- t = 1;
4045
+ i = 1;
3998
4046
  }
3999
- for (let e = 0; e < t; e++) {
4047
+ for (let e = 0; e < i; e++) {
4000
4048
  let t = a[e];
4001
- I(t.ch, t.font, s, C, H, n.strikethrough, n.baseline ?? void 0, {
4002
- ...K,
4049
+ L(t.ch, t.font, p, w, W, s.strikethrough, s.baseline ?? void 0, {
4050
+ ...q,
4003
4051
  fontFamily: t.family
4004
4052
  });
4005
4053
  }
4006
- a = a.slice(t), a.length > 0 && F();
4054
+ a = a.slice(i), a.length > 0 && F();
4007
4055
  }
4008
4056
  continue;
4009
4057
  }
4010
- if (B(i)) {
4011
- let t = y(i, {
4058
+ if (B(r)) {
4059
+ let t = b(r, {
4012
4060
  cjk: !0,
4013
- kinsoku: h
4014
- }), r = m != null && j !== E, a = (e) => r && de(e.codePointAt(0) ?? 0), o = (t) => {
4015
- let n = G * Jn(t), r = "", i = null, o = () => {
4016
- r !== "" && (e.font = i ? j : E, n += e.measureText(r).width, r = "");
4061
+ kinsoku: g
4062
+ }), i = _ != null && M !== j, a = (e) => i && le(e.codePointAt(0) ?? 0), o = (t) => {
4063
+ let r = 0, i = y.segments.at(-1), o = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
4064
+ s !== "" && (e.font = c ? M : j, r += Q(e, s, K), o && (r += K), o = !0, s = "");
4017
4065
  };
4018
4066
  for (let e of t) {
4019
4067
  let t = a(e);
4020
- i === null || t === i ? (r += e, i = t) : (o(), r = e, i = t);
4068
+ c === null || t === c ? (s += e, c = t) : (l(), s = e, c = t);
4021
4069
  }
4022
- return o(), n;
4070
+ return l(), r;
4023
4071
  }, c = (e) => {
4024
- let t = "", r = null, i = () => {
4072
+ let t = "", n = null, r = () => {
4025
4073
  if (t === "") return;
4026
- let e = r ? j : E, i = r ? m : p;
4027
- I(t, e, s, C, H, n.strikethrough, n.baseline ?? void 0, {
4028
- ...K,
4029
- fontFamily: i
4074
+ let e = n ? M : j, r = n ? _ : m;
4075
+ L(t, e, p, w, W, s.strikethrough, s.baseline ?? void 0, {
4076
+ ...q,
4077
+ fontFamily: r
4030
4078
  }), t = "";
4031
4079
  };
4032
- for (let n of e) {
4033
- let e = a(n);
4034
- r === null || e === r ? (t += n, r = e) : (i(), t = n, r = e);
4080
+ for (let i of e) {
4081
+ let e = a(i);
4082
+ n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
4035
4083
  }
4036
- i();
4037
- }, l = pe(i), u = i.length, d = 0;
4084
+ r();
4085
+ }, l = de(r), u = r.length, d = 0;
4038
4086
  for (; d < u;) {
4039
- let e = P(), n = R(i, t, d, e, o, l);
4087
+ let e = P(), n = R(r, t, d, e, o, l);
4040
4088
  if (n <= d) {
4041
4089
  if (x > 0) {
4042
4090
  F();
4043
4091
  continue;
4044
4092
  }
4045
- let r = t.find((e) => e > d) ?? u, a = i.slice(d, r), s = D(a), c = R(a, s, 0, e, o, l);
4093
+ let i = t.find((e) => e > d) ?? u, a = r.slice(d, i), s = k(a), c = R(a, s, 0, e, o, l);
4046
4094
  c <= 0 && (c = s.length > 0 ? s[0] : a.length), n = d + c;
4047
4095
  }
4048
- c(i.slice(d, n)), d = n, d < u && F();
4096
+ c(r.slice(d, n)), d = n, d < u && F();
4049
4097
  }
4050
4098
  continue;
4051
4099
  }
4052
- if (N(a)) I(i, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K), o && (S = !0);
4100
+ if (N(a)) L(r, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q), o && (S = !0);
4053
4101
  else if (o) x > 0 && F();
4054
4102
  else if (a > v()) {
4055
4103
  x > 0 && F();
4056
- for (let t of i) {
4057
- e.font = E;
4058
- let r = e.measureText(t).width;
4059
- !N(r) && x > 0 && F(), I(t, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
4060
- }
4061
- } else if (!S) I(i, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
4104
+ for (let t of r) e.font = j, !N(I(t, j, K, n)) && x > 0 && F(), L(t, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
4105
+ } else if (!S) L(r, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
4062
4106
  else {
4063
- let e = b.segments.at(-1)?.text ?? "", t = i.codePointAt(0), a = [...e].at(-1)?.codePointAt(0), o = /\S$/u.test(e) && /^\S/u.test(i) && a !== 8203 && t !== 8203, c = t !== void 0 && h.lineStartForbidden.has(t) && o, l = a !== void 0 && t !== void 0 && o && !B(e) && !B(i) && r(a, t);
4064
- (c || l) && L() || F(), I(i, E, s, C, H, n.strikethrough, n.baseline ?? void 0, K);
4107
+ let e = y.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && g.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !B(e) && !B(r) && i(n, t);
4108
+ (o || c) && z() || F(), L(r, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
4065
4109
  }
4066
4110
  }
4067
4111
  }
4068
- return m.push(b), m;
4112
+ return m.push(y), m;
4069
4113
  }
4070
- async function Xn(e, t, n, r, i, a, o) {
4114
+ async function $n(e, t, n, r, i, a, o) {
4071
4115
  if (t && t.fillType === "image") {
4072
4116
  if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !o) return;
4073
4117
  try {
4074
- let s = await Te(t.imagePath, t.mimeType, t.duotone, o, {
4075
- widthPt: n / i / U,
4076
- heightPt: r / i / U
4118
+ let s = await we(t.imagePath, t.mimeType, t.duotone, o, {
4119
+ widthPt: n / i / Y,
4120
+ heightPt: r / i / Y
4077
4121
  });
4078
4122
  if (a() || !s) return;
4079
- if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) $n(e, s, t.tile, n, r, i);
4123
+ if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) nr(e, s, t.tile, n, r, i);
4080
4124
  else {
4081
4125
  let i = t.fillRect ?? {}, a = i.l ?? 0, o = i.t ?? 0, c = i.r ?? 0, l = i.b ?? 0, u = a * n, d = o * r, f = n * (1 - a - c), p = r * (1 - o - l);
4082
4126
  e.drawImage(s, u, d, f, p);
4083
4127
  }
4084
4128
  e.restore();
4085
4129
  } catch (e) {
4086
- if (d(e)) throw e;
4130
+ if (f(e)) throw e;
4087
4131
  }
4088
4132
  return;
4089
4133
  }
4090
4134
  e.fillStyle = Tn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
4091
4135
  }
4092
- var Zn = 9525;
4093
- function Qn(e, t, n, r, i) {
4136
+ var er = 9525;
4137
+ function tr(e, t, n, r, i) {
4094
4138
  let a;
4095
4139
  a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
4096
4140
  let o;
@@ -4099,10 +4143,10 @@ function Qn(e, t, n, r, i) {
4099
4143
  ay: o
4100
4144
  };
4101
4145
  }
4102
- function $n(e, t, n, r, i, a) {
4103
- let o = t.width * Zn * n.sx * a, s = t.height * Zn * n.sy * a;
4146
+ function nr(e, t, n, r, i, a) {
4147
+ let o = t.width * er * n.sx * a, s = t.height * er * n.sy * a;
4104
4148
  if (!(o > 0) || !(s > 0)) return;
4105
- let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u = F(o * (c ? 2 : 1), s * (l ? 2 : 1));
4149
+ let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u = O(o * (c ? 2 : 1), s * (l ? 2 : 1));
4106
4150
  if (!u) return;
4107
4151
  let d = u.getContext("2d");
4108
4152
  if (!d) return;
@@ -4112,121 +4156,121 @@ function $n(e, t, n, r, i, a) {
4112
4156
  f(0, 0, !1, !1), c && f(o, 0, !0, !1), l && f(0, s, !1, !0), c && l && f(o, s, !0, !0);
4113
4157
  let p = e.createPattern(u, "repeat");
4114
4158
  if (!p) return;
4115
- let { ax: m, ay: h } = Qn(n.algn ?? "tl", r, i, o, s), g = m + X(n.tx, a), _ = h + X(n.ty, a);
4159
+ let { ax: m, ay: h } = tr(n.algn ?? "tl", r, i, o, s), g = m + X(n.tx, a), _ = h + X(n.ty, a);
4116
4160
  typeof p.setTransform == "function" && typeof DOMMatrix < "u" ? (p.setTransform(new DOMMatrix().translateSelf(g, _)), e.fillStyle = p, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(g, _), e.fillStyle = p, e.fillRect(-g, -_, r, i), e.restore());
4117
4161
  }
4118
- function er(e, t, n) {
4162
+ function rr(e, t, n) {
4119
4163
  if (!t) return;
4120
4164
  let r = t.dir * Math.PI / 180, i = X(t.dist, n);
4121
4165
  e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
4122
4166
  }
4123
- function tr(e, t, n) {
4167
+ function ir(e, t, n) {
4124
4168
  t && (e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
4125
4169
  }
4126
- function nr(e) {
4170
+ function ar(e) {
4127
4171
  e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
4128
4172
  }
4129
- var rr = 8, ir = 1, ar = 1, or = 256;
4130
- function sr(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4173
+ var or = 8, sr = 1, cr = 1, lr = 256;
4174
+ function ur(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
4131
4175
  if (r <= 0) return;
4132
- let h = e.measureText(t), g = h.actualBoundingBoxAscent > 0 ? h.actualBoundingBoxAscent : r, _ = h.actualBoundingBoxDescent > 0 ? h.actualBoundingBoxDescent : r * .25, v = h.actualBoundingBoxLeft > 0 ? h.actualBoundingBoxLeft : 0, y = h.actualBoundingBoxRight > 0 ? h.actualBoundingBoxRight : r, b = r * l * i, x = Math.min(or, Math.max(1, Math.round(b / rr))), S = (e) => ur(e, a, r, o, s, c, u, d), C = S(x), w = fr(C, a, o, s, c, u, d, l, i, -g, _);
4133
- for (; w > ar && x < or;) {
4134
- let e = Math.min(or, x * 2), t = S(e), n = fr(t, a, o, s, c, u, d, l, i, -g, _);
4176
+ let h = e.measureText(t), g = h.actualBoundingBoxAscent > 0 ? h.actualBoundingBoxAscent : r, _ = h.actualBoundingBoxDescent > 0 ? h.actualBoundingBoxDescent : r * .25, v = h.actualBoundingBoxLeft > 0 ? h.actualBoundingBoxLeft : 0, y = h.actualBoundingBoxRight > 0 ? h.actualBoundingBoxRight : r, b = r * l * i, x = Math.min(lr, Math.max(1, Math.round(b / or))), S = (e) => pr(e, a, r, o, s, c, u, d), C = S(x), w = hr(C, a, o, s, c, u, d, l, i, -g, _);
4177
+ for (; w > cr && x < lr;) {
4178
+ let e = Math.min(lr, x * 2), t = S(e), n = hr(t, a, o, s, c, u, d, l, i, -g, _);
4135
4179
  if (n >= w * .75) {
4136
4180
  C = t;
4137
4181
  break;
4138
4182
  }
4139
4183
  x = e, C = t, w = n;
4140
4184
  }
4141
- let T = 1e4, E = ir / (l * i), D = C.length - 1, O = (e, t, n) => e === 0 ? -T : t - n - E, k = (e, t, n) => e === D ? T : t - n + E, A = (e, r) => {
4185
+ let T = 1e4, E = sr / (l * i), D = C.length - 1, k = (e, t, n) => e === 0 ? -T : t - n - E, A = (e, t, n) => e === D ? T : t - n + E, j = (e, r) => {
4142
4186
  e.fillStyle = r;
4143
4187
  for (let r = 0; r <= D; r++) {
4144
4188
  let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
4145
4189
  e.save(), e.translate(f + o.x, p + o.y), e.rotate(o.angle), o.shear !== 0 && e.transform(1, 0, o.shear, 1, 0, 0), (l !== 1 || o.vScale !== 1) && e.scale(l, o.vScale), e.beginPath();
4146
- let c = O(r, i, s), u = k(r, a, s);
4190
+ let c = k(r, i, s), u = A(r, a, s);
4147
4191
  e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
4148
4192
  }
4149
- }, j = cr(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
4150
- if (j >= 1 && M >= 1) {
4151
- A(e, m);
4193
+ }, M = dr(m), N = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
4194
+ if (M >= 1 && N >= 1) {
4195
+ j(e, m);
4152
4196
  return;
4153
4197
  }
4154
- if (j <= 0 || M <= 0) return;
4155
- let N = typeof e.getTransform == "function" ? e.getTransform() : null;
4156
- if (!N) {
4157
- A(e, m);
4198
+ if (M <= 0 || N <= 0) return;
4199
+ let P = typeof e.getTransform == "function" ? e.getTransform() : null;
4200
+ if (!P) {
4201
+ j(e, m);
4158
4202
  return;
4159
4203
  }
4160
- let P = Infinity, I = Infinity, L = -Infinity, R = -Infinity;
4204
+ let F = Infinity, I = Infinity, L = -Infinity, R = -Infinity;
4161
4205
  for (let e = 0; e <= D; e++) {
4162
- let { s0: t, s1: r, g: i } = C[e], a = (t + r) / 2, o = -a + n / 2, s = Math.max(O(e, t, a), o - v), c = Math.min(k(e, r, a), o + y);
4206
+ let { s0: t, s1: r, g: i } = C[e], a = (t + r) / 2, o = -a + n / 2, s = Math.max(k(e, t, a), o - v), c = Math.min(A(e, r, a), o + y);
4163
4207
  if (!(c <= s)) for (let [e, t] of [
4164
4208
  [s, -g],
4165
4209
  [c, -g],
4166
4210
  [s, _],
4167
4211
  [c, _]
4168
4212
  ]) {
4169
- let n = dr(i, l, e, t), r = f + n.x, a = p + n.y, o = N.a * r + N.c * a + N.e, s = N.b * r + N.d * a + N.f;
4170
- o < P && (P = o), o > L && (L = o), s < I && (I = s), s > R && (R = s);
4213
+ let n = mr(i, l, e, t), r = f + n.x, a = p + n.y, o = P.a * r + P.c * a + P.e, s = P.b * r + P.d * a + P.f;
4214
+ o < F && (F = o), o > L && (L = o), s < I && (I = s), s > R && (R = s);
4171
4215
  }
4172
4216
  }
4173
- if (!(L > P && R > I)) return;
4174
- let z = Math.floor(P - 2), B = Math.floor(I - 2), V = F(Math.ceil(L + 2) - z, Math.ceil(R + 2) - B), H = V ? V.getContext("2d") : null;
4217
+ if (!(L > F && R > I)) return;
4218
+ let z = Math.floor(F - 2), B = Math.floor(I - 2), V = O(Math.ceil(L + 2) - z, Math.ceil(R + 2) - B), H = V ? V.getContext("2d") : null;
4175
4219
  if (!V || !H) {
4176
- A(e, m);
4220
+ j(e, m);
4177
4221
  return;
4178
4222
  }
4179
- H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(N.a, N.b, N.c, N.d, N.e - z, N.f - B), A(H, lr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(V, z, B), e.restore();
4223
+ H.font = e.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(P.a, P.b, P.c, P.d, P.e - z, P.f - B), j(H, fr(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = N * M, e.drawImage(V, z, B), e.restore();
4180
4224
  }
4181
- function cr(e) {
4225
+ function dr(e) {
4182
4226
  let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
4183
4227
  if (!t) return 1;
4184
4228
  let n = parseFloat(t[1]);
4185
4229
  return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
4186
4230
  }
4187
- function lr(e) {
4231
+ function fr(e) {
4188
4232
  let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
4189
4233
  return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
4190
4234
  }
4191
- function ur(e, t, n, r, i, a, o, s) {
4235
+ function pr(e, t, n, r, i, a, o, s) {
4192
4236
  let c = Array(e);
4193
4237
  for (let l = 0; l < e; l++) {
4194
4238
  let u = l / e * n, d = (l + 1) / e * n;
4195
4239
  c[l] = {
4196
4240
  s0: u,
4197
4241
  s1: d,
4198
- g: Ve(t, (r + (u + d) / 2) / i * a, o, s)
4242
+ g: Be(t, (r + (u + d) / 2) / i * a, o, s)
4199
4243
  };
4200
4244
  }
4201
4245
  return c;
4202
4246
  }
4203
- function dr(e, t, n, r) {
4247
+ function mr(e, t, n, r) {
4204
4248
  let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
4205
4249
  return {
4206
4250
  x: e.x + s * o - c * a,
4207
4251
  y: e.y + c * o + s * a
4208
4252
  };
4209
4253
  }
4210
- function fr(e, t, n, r, i, a, o, s, c, l, u) {
4254
+ function hr(e, t, n, r, i, a, o, s, c, l, u) {
4211
4255
  let d = 0;
4212
4256
  for (let f of e) {
4213
4257
  let e = (f.s0 + f.s1) / 2;
4214
4258
  for (let p of [f.s0, f.s1]) {
4215
- let m = Ve(t, (n + p) / r * i, a, o);
4259
+ let m = Be(t, (n + p) / r * i, a, o);
4216
4260
  for (let t of [l, u]) {
4217
- let n = dr(m, s, 0, t), r = dr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
4261
+ let n = mr(m, s, 0, t), r = mr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
4218
4262
  i > d && (d = i);
4219
4263
  }
4220
4264
  }
4221
4265
  }
4222
4266
  return d;
4223
4267
  }
4224
- function pr(e, t, n, r, i, a, o, s, c, l, u) {
4225
- let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = Le(n, r, p, m);
4268
+ function gr(e, t, n, r, i, a, o, s, c, l, u) {
4269
+ let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = Ie(n, r, p, m);
4226
4270
  if (!h) return;
4227
- let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * U * c, y = [];
4271
+ let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * Y * c, y = [];
4228
4272
  for (let n of t.paragraphs) {
4229
- let t = Yn(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * U * c, n.defColor ? Z(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
4273
+ let t = Qn(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * Y * c, n.defColor ? Z(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
4230
4274
  for (let e of t) y.push(e);
4231
4275
  }
4232
4276
  if (y.length === 0) return;
@@ -4245,10 +4289,10 @@ function pr(e, t, n, r, i, a, o, s, c, l, u) {
4245
4289
  }
4246
4290
  e.font = t.font;
4247
4291
  let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
4248
- a += r.width + n * Jn(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
4292
+ a += r.width + n * Yn(t.text), o = Math.max(o, t.sizePx), r.actualBoundingBoxAscent > 0 && (s = Math.max(s, r.actualBoundingBoxAscent)), r.actualBoundingBoxDescent > 0 && (c = Math.max(c, r.actualBoundingBoxDescent));
4249
4293
  }
4250
4294
  if (a <= 0) continue;
4251
- let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = Be(h, a), b = 0;
4295
+ let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = ze(h, a), b = 0;
4252
4296
  for (let t of n.segments) {
4253
4297
  if (t.math) {
4254
4298
  b += t.math.width;
@@ -4259,17 +4303,17 @@ function pr(e, t, n, r, i, a, o, s, c, l, u) {
4259
4303
  for (let s of o) {
4260
4304
  let o = e.measureText(s).width + n, c = r + u * (i - r);
4261
4305
  if (!h.singleEdge && o > 0) {
4262
- sr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
4306
+ ur(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
4263
4307
  continue;
4264
4308
  }
4265
- let l = Ve(h, (b + o / 2) / a * v, _, c);
4309
+ let l = Be(h, (b + o / 2) / a * v, _, c);
4266
4310
  e.save(), e.translate(d + l.x, f + l.y), e.rotate(l.angle), l.shear !== 0 && e.transform(1, 0, l.shear, 1, 0, 0), (g !== 1 || l.vScale !== 1) && e.scale(g, l.vScale), e.fillText(s, -o / 2 + n / 2, 0), e.restore(), b += o;
4267
4311
  }
4268
4312
  }
4269
4313
  }
4270
4314
  e.restore();
4271
4315
  }
4272
- function mr(e, t, n, r, i, a, o) {
4316
+ function _r(e, t, n, r, i, a, o) {
4273
4317
  let s = Math.min(r, i);
4274
4318
  switch (e) {
4275
4319
  case "rightarrow":
@@ -4299,17 +4343,17 @@ function mr(e, t, n, r, i, a, o) {
4299
4343
  default: return null;
4300
4344
  }
4301
4345
  }
4302
- function hr(e, t) {
4346
+ function vr(e, t) {
4303
4347
  return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null && gn(e) ? t.smartArtFallbackTextColor : null;
4304
4348
  }
4305
- function gr(e, t, n) {
4349
+ function yr(e, t, n) {
4306
4350
  return {
4307
4351
  outerRotation: e,
4308
4352
  localFlipH: t,
4309
4353
  localFlipV: n
4310
4354
  };
4311
4355
  }
4312
- function _r(e, t, n, r, i) {
4356
+ function br(e, t, n, r, i) {
4313
4357
  let a = [
4314
4358
  {
4315
4359
  x: t,
@@ -4338,7 +4382,7 @@ function _r(e, t, n, r, i) {
4338
4382
  h: l - s
4339
4383
  };
4340
4384
  }
4341
- var vr = {
4385
+ var xr = {
4342
4386
  tl: [0, 0],
4343
4387
  t: [.5, 0],
4344
4388
  tr: [1, 0],
@@ -4349,15 +4393,15 @@ var vr = {
4349
4393
  b: [.5, 1],
4350
4394
  br: [1, 1]
4351
4395
  };
4352
- function yr(e, t, n) {
4396
+ function Sr(e, t, n) {
4353
4397
  return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
4354
4398
  }
4355
- function br(e, t, n, r, i, a) {
4356
- let [o, s] = vr[a ?? "b"];
4357
- return yr(e, t + o * r, n + s * i);
4399
+ function Cr(e, t, n, r, i, a) {
4400
+ let [o, s] = xr[a ?? "b"];
4401
+ return Sr(e, t + o * r, n + s * i);
4358
4402
  }
4359
- function xr(e, t, n, r, i, a, o, s) {
4360
- let c = ot(e, i, a).corners, l = (o > 0 ? _t(c, o / i, o / a) ?? c : c).map((e) => yr(t, n + e.x, r + e.y)), u = l.map(([e]) => e), d = l.map(([, e]) => e), f = Math.min(...u), p = Math.min(...d), m = Math.max(...u), h = Math.max(...d), [g, _] = vr[s ?? "b"], v = vt(c, g, _);
4403
+ function wr(e, t, n, r, i, a, o, s) {
4404
+ let c = ot(e, i, a).corners, l = (o > 0 ? _t(c, o / i, o / a) ?? c : c).map((e) => Sr(t, n + e.x, r + e.y)), u = l.map(([e]) => e), d = l.map(([, e]) => e), f = Math.min(...u), p = Math.min(...d), m = Math.max(...u), h = Math.max(...d), [g, _] = xr[s ?? "b"], v = vt(c, g, _);
4361
4405
  return {
4362
4406
  bbox: {
4363
4407
  x: f,
@@ -4365,15 +4409,15 @@ function xr(e, t, n, r, i, a, o, s) {
4365
4409
  w: m - f,
4366
4410
  h: h - p
4367
4411
  },
4368
- anchor: v ? yr(t, n + v.x, r + v.y) : br(t, n, r, i, a, s)
4412
+ anchor: v ? Sr(t, n + v.x, r + v.y) : Cr(t, n, r, i, a, s)
4369
4413
  };
4370
4414
  }
4371
- function Sr(e, t, n, r) {
4415
+ function Tr(e, t, n, r) {
4372
4416
  let i = Math.floor(n.x) - 1, a = Math.floor(n.y) - 1, o = Math.max(1, Math.ceil(n.x + n.w) - i + 1), s = Math.max(1, Math.ceil(n.y + n.h) - a + 1);
4373
- if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || re(o, s).clamped) return e;
4417
+ if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || te(o, s).clamped) return e;
4374
4418
  let c = null;
4375
4419
  try {
4376
- c = F(o, s);
4420
+ c = O(o, s);
4377
4421
  } catch {
4378
4422
  return e;
4379
4423
  }
@@ -4392,7 +4436,7 @@ function Sr(e, t, n, r) {
4392
4436
  e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
4393
4437
  };
4394
4438
  }
4395
- function Cr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4439
+ function Er(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4396
4440
  let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
4397
4441
  a: 1,
4398
4442
  b: 0,
@@ -4407,32 +4451,32 @@ function Cr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
4407
4451
  }, v = (e) => {
4408
4452
  h(e), u(e);
4409
4453
  }, y = !1;
4410
- t.shadow && p ? (e.save(), e.setTransform(m), y = !Ke(e, g, i, t.shadow, s, d, f, Math.atan2(c.b, c.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (y = !0), t.reflection && p && (e.save(), e.setTransform(m), Ye(e, g, i, t.reflection, s, d, f), e.restore()), y ? er(e, t.shadow ?? null, o) : t.glow && tr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Je(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && nr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), qe(e, v, i, t.innerShadow, s, d, f), e.restore());
4454
+ t.shadow && p ? (e.save(), e.setTransform(m), y = !Ke(e, g, i, t.shadow, s, d, f, Math.atan2(c.b, c.a) * 180 / Math.PI, a), e.restore()) : t.shadow && (y = !0), t.reflection && p && (e.save(), e.setTransform(m), Ye(e, g, i, t.reflection, s, d, f), e.restore()), y ? rr(e, t.shadow ?? null, o) : t.glow && ir(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Je(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && ar(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), qe(e, v, i, t.innerShadow, s, d, f), e.restore());
4411
4455
  }
4412
- function wr(e, t, r, i = "#000000", a, o = {
4456
+ function Dr(e, t, n, i = "#000000", a, o = {
4413
4457
  themeMajorFont: null,
4414
4458
  themeMinorFont: null,
4415
4459
  dpr: 1
4416
- }, s, l) {
4417
- let u = X(t.x, r), d = X(t.y, r), f = X(t.width, r), p = X(t.height, r), m = s && t.id !== void 0 ? (e) => s({
4460
+ }, s, c) {
4461
+ let u = X(t.x, n), d = X(t.y, n), f = X(t.width, n), p = X(t.height, n), m = s && t.id !== void 0 ? (e) => s({
4418
4462
  ...e,
4419
4463
  shapeId: t.id
4420
4464
  }) : s;
4421
4465
  if (p === 0 && t.textBody?.verticalAnchor === "b") {
4422
- if (t.stroke && (e.save(), Vr(e, t.stroke, r, {
4466
+ if (t.stroke && (e.save(), Wr(e, t.stroke, n, {
4423
4467
  x: u,
4424
4468
  y: d,
4425
4469
  w: f,
4426
4470
  h: 1
4427
4471
  }, t.rotation), e.beginPath(), e.moveTo(u, d), e.lineTo(u + f, d), e.stroke(), e.restore()), t.textBody) {
4428
- let n = hr(t, o);
4429
- Ar(e, t.textBody, u, d, f, p, r, n, t.rotation, t.flipH, t.flipV, i, a, o, m, !1, l);
4472
+ let r = vr(t, o);
4473
+ Nr(e, t.textBody, u, d, f, p, n, r, t.rotation, t.flipH, t.flipV, i, a, o, m, !1, c);
4430
4474
  }
4431
4475
  return;
4432
4476
  }
4433
4477
  let h = t.scene3d && st(t.scene3d.camera) ? t.scene3d : null;
4434
4478
  if (h && f > 0 && p > 0) {
4435
- let n = e.getTransform(), s = Math.abs(n.a * n.d - n.b * n.c), c = s > 0 ? Math.sqrt(s) : 1, l = jr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Mr(t.sp3d, h.camera, f, p, r, c), g = gr(t.rotation, t.flipH, t.flipV);
4479
+ let r = e.getTransform(), s = Math.abs(r.a * r.d - r.b * r.c), c = s > 0 ? Math.sqrt(s) : 1, l = Pr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, c), m = Fr(t.sp3d, h.camera, f, p, n, c), g = yr(t.rotation, t.flipH, t.flipV);
4436
4480
  e.save(), g.outerRotation !== 0 && (e.translate(u + f / 2, d + p / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(u + f / 2), -(d + p / 2)));
4437
4481
  let _ = {
4438
4482
  ...t,
@@ -4455,21 +4499,21 @@ function wr(e, t, r, i = "#000000", a, o = {
4455
4499
  ..._,
4456
4500
  fill: null,
4457
4501
  stroke: null
4458
- }, b = (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / c : 0) + 2, x = (e, t, n) => Nr(e, h.camera, u, d, f, p, (e) => {
4459
- wr(e, t, r, i, a, o, void 0);
4460
- }, n ? {
4502
+ }, b = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / c : 0) + 2, x = (e, t, r) => Ir(e, h.camera, u, d, f, p, (e) => {
4503
+ Dr(e, t, n, i, a, o, void 0);
4504
+ }, r ? {
4461
4505
  bevels: l,
4462
4506
  extrusion: m ?? void 0,
4463
4507
  edgePadCss: b
4464
4508
  } : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
4465
4509
  if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
4466
- let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), a = i > 0 ? Math.sqrt(i) : 1, o = xr(h.camera, n, u, d, f, p, b, t.shadow?.algn), s = !1, c = Sr((e) => {
4510
+ let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o = wr(h.camera, r, u, d, f, p, b, t.shadow?.algn), s = !1, c = Tr((e) => {
4467
4511
  s = S(e) || s;
4468
- }, n, o.bbox, {
4512
+ }, r, o.bbox, {
4469
4513
  w: e.canvas.width || 0,
4470
4514
  h: e.canvas.height || 0
4471
4515
  });
4472
- if (Cr(e, t, c, c, o.bbox, o.anchor, r, r * a, n, !!t.fill), s) {
4516
+ if (Er(e, t, c, c, o.bbox, o.anchor, n, n * a, r, !!t.fill), s) {
4473
4517
  C(e), e.restore();
4474
4518
  return;
4475
4519
  }
@@ -4481,7 +4525,7 @@ function wr(e, t, r, i = "#000000", a, o = {
4481
4525
  }
4482
4526
  e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(u + f / 2, d + p / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(u + f / 2), -(d + p / 2)));
4483
4527
  let g = t.geometry.toLowerCase(), _ = Tn(t.fill, e, u, d, f, p, t.rotation);
4484
- t.shadow || tr(e, t.glow ?? null, r);
4528
+ t.shadow || ir(e, t.glow ?? null, n);
4485
4529
  let v = new Set([
4486
4530
  "line",
4487
4531
  "straightconnector1",
@@ -4506,22 +4550,22 @@ function wr(e, t, r, i = "#000000", a, o = {
4506
4550
  "accentbordercallout1",
4507
4551
  "accentbordercallout2",
4508
4552
  "accentbordercallout3"
4509
- ]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && c(g), w = (n, i, a = {
4553
+ ]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && l(g), S = (r, i, a = {
4510
4554
  x: u,
4511
4555
  y: d,
4512
4556
  w: f,
4513
4557
  h: p
4514
4558
  }) => {
4515
- let { x: o, y: s, w: c, h: l } = a, m = i ?? (n === e && o === u && s === d && c === f && l === p ? _ : Tn(t.fill, n, o, s, c, l, t.rotation)), h = i ? null : t.stroke ? () => {
4516
- Vr(n, t.stroke, r, {
4559
+ let { x: o, y: s, w: c, h: l } = a, m = i ?? (r === e && o === u && s === d && c === f && l === p ? _ : Tn(t.fill, r, o, s, c, l, t.rotation)), h = i ? null : t.stroke ? () => {
4560
+ Wr(r, t.stroke, n, {
4517
4561
  x: o,
4518
4562
  y: s,
4519
4563
  w: c,
4520
4564
  h: l
4521
- }, t.rotation), n.stroke();
4522
- } : null, v = () => nr(n);
4565
+ }, t.rotation), r.stroke();
4566
+ } : null, v = () => ar(r);
4523
4567
  if (x && !i) {
4524
- S(n, g, o, s, c, l, [
4568
+ C(r, g, o, s, c, l, [
4525
4569
  t.adj,
4526
4570
  t.adj2,
4527
4571
  t.adj3,
@@ -4533,8 +4577,8 @@ function wr(e, t, r, i = "#000000", a, o = {
4533
4577
  ], m, h, v, b(g) ? { skipTrailingStroke: !0 } : void 0);
4534
4578
  return;
4535
4579
  }
4536
- n.beginPath(), t.custGeom && t.custGeom.length > 0 ? Tr(n, t.custGeom, o, s, c, l) : be(n, g, o, s, c, l, t.adj, t.adj2, t.adj3, t.adj4), m && g !== "arc" && (n.fillStyle = m, g === "donut" || g === "smileyface" || g === "frame" ? n.fill("evenodd") : n.fill(), i || v()), h && h();
4537
- }, T = e.getTransform(), E = Math.abs(T.a * T.d - T.b * T.c), D = E > 0 ? Math.sqrt(E) : 1, O = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ? C(g, u, d, f, p, [
4580
+ r.beginPath(), t.custGeom && t.custGeom.length > 0 ? Or(r, t.custGeom, o, s, c, l) : ve(r, g, o, s, c, l, t.adj, t.adj2, t.adj3, t.adj4), m && g !== "arc" && (r.fillStyle = m, g === "donut" || g === "smileyface" || g === "frame" ? r.fill("evenodd") : r.fill(), i || v()), h && h();
4581
+ }, T = e.getTransform(), E = Math.abs(T.a * T.d - T.b * T.c), D = E > 0 ? Math.sqrt(E) : 1, O = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ? w(g, u, d, f, p, [
4538
4582
  t.adj,
4539
4583
  t.adj2,
4540
4584
  t.adj3,
@@ -4543,20 +4587,20 @@ function wr(e, t, r, i = "#000000", a, o = {
4543
4587
  t.adj6,
4544
4588
  t.adj7,
4545
4589
  t.adj8
4546
- ]) : t.custGeom && t.custGeom.length > 0 ? ve(t.custGeom, u, d, f, p) : null : null) ?? {
4590
+ ]) : t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, u, d, f, p) : null : null) ?? {
4547
4591
  x: u,
4548
4592
  y: d,
4549
4593
  w: f,
4550
4594
  h: p
4551
- }, k = t.stroke ? t.stroke.width * r / 2 : 0, A = t.stroke ? Math.max(t.stroke.headEnd ? xe(t.stroke.headEnd, t.stroke, r) : 0, t.stroke.tailEnd ? xe(t.stroke.tailEnd, t.stroke, r) : 0) : 0, j = t.sp3d?.contourW ? t.sp3d.contourW * r : 0, M = Math.max(k, A, j), N = M > 0 ? {
4595
+ }, k = t.stroke ? t.stroke.width * n / 2 : 0, A = t.stroke ? Math.max(t.stroke.headEnd ? ye(t.stroke.headEnd, t.stroke, n) : 0, t.stroke.tailEnd ? ye(t.stroke.tailEnd, t.stroke, n) : 0) : 0, j = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, M = Math.max(k, A, j), N = M > 0 ? {
4552
4596
  x: O.x - M,
4553
4597
  y: O.y - M,
4554
4598
  w: O.w + M * 2,
4555
4599
  h: O.h + M * 2
4556
- } : O, P = _r(T, N.x, N.y, N.w, N.h), F = r * D, I = h ? [] : jr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, D), L = (t.stroke ? t.stroke.width * r / 2 : 0) + 2, R = (e) => {
4600
+ } : O, P = br(T, N.x, N.y, N.w, N.h), F = n * D, I = h ? [] : Pr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, D), L = (t.stroke ? t.stroke.width * n / 2 : 0) + 2, R = (e) => {
4557
4601
  let i = t.stroke?.fill ? Tn(t.stroke.fill, e, u, d, f, p, t.rotation) ?? void 0 : void 0;
4558
4602
  if (t.stroke && (v.has(g) || y.has(g))) {
4559
- let a = n(g, u, d, f, p, [
4603
+ let a = r(g, u, d, f, p, [
4560
4604
  t.adj,
4561
4605
  t.adj2,
4562
4606
  t.adj3,
@@ -4569,67 +4613,67 @@ function wr(e, t, r, i = "#000000", a, o = {
4569
4613
  if (!a) return;
4570
4614
  let o = t.stroke.cmpd, s = g === "line" || g === "straightconnector1";
4571
4615
  if (b(g) && a.vertices.length >= 2 && !(o && s)) {
4572
- let n = a.vertices.map((e) => ({
4616
+ let r = a.vertices.map((e) => ({
4573
4617
  x: e.x,
4574
4618
  y: e.y
4575
4619
  }));
4576
4620
  if (t.stroke.tailEnd) {
4577
- let e = _e(t.stroke.tailEnd, t.stroke, r);
4578
- n[n.length - 1] = me(n[n.length - 1], n[n.length - 2], e);
4621
+ let e = he(t.stroke.tailEnd, t.stroke, n);
4622
+ r[r.length - 1] = fe(r[r.length - 1], r[r.length - 2], e);
4579
4623
  }
4580
4624
  if (t.stroke.headEnd) {
4581
- let e = _e(t.stroke.headEnd, t.stroke, r);
4582
- n[0] = me(n[0], n[1], e);
4625
+ let e = he(t.stroke.headEnd, t.stroke, n);
4626
+ r[0] = fe(r[0], r[1], e);
4583
4627
  }
4584
- Vr(e, t.stroke, r, {
4628
+ Wr(e, t.stroke, n, {
4585
4629
  x: u,
4586
4630
  y: d,
4587
4631
  w: f,
4588
4632
  h: p
4589
- }, t.rotation), e.beginPath(), e.moveTo(n[0].x, n[0].y);
4590
- for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
4633
+ }, t.rotation), e.beginPath(), e.moveTo(r[0].x, r[0].y);
4634
+ for (let t = 1; t < r.length; t++) e.lineTo(r[t].x, r[t].y);
4591
4635
  e.stroke();
4592
4636
  }
4593
- o && s && Br(e, a.start, a.end, t.stroke, o, r, t.rotation), t.stroke.tailEnd && ye(e, a.end.x, a.end.y, a.end.angle, t.stroke.tailEnd, t.stroke, r, i), t.stroke.headEnd && ye(e, a.start.x, a.start.y, a.start.angle, t.stroke.headEnd, t.stroke, r, i);
4637
+ o && s && Ur(e, a.start, a.end, t.stroke, o, n, t.rotation), t.stroke.tailEnd && _e(e, a.end.x, a.end.y, a.end.angle, t.stroke.tailEnd, t.stroke, n, i), t.stroke.headEnd && _e(e, a.start.x, a.start.y, a.start.angle, t.stroke.headEnd, t.stroke, n, i);
4594
4638
  return;
4595
4639
  }
4596
4640
  if (!t.stroke || !t.custGeom || t.custGeom.length === 0 || (!t.stroke.headEnd || t.stroke.headEnd.type === "none") && (!t.stroke.tailEnd || t.stroke.tailEnd.type === "none")) return;
4597
- let { start: a, end: o } = Se(t.custGeom);
4598
- a && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ye(e, u + a.x * f, d + a.y * p, Math.atan2(a.dy * p, a.dx * f), t.stroke.headEnd, t.stroke, r, i), o && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ye(e, u + o.x * f, d + o.y * p, Math.atan2(o.dy * p, o.dx * f), t.stroke.tailEnd, t.stroke, r, i);
4641
+ let { start: a, end: o } = be(t.custGeom);
4642
+ a && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && _e(e, u + a.x * f, d + a.y * p, Math.atan2(a.dy * p, a.dx * f), t.stroke.headEnd, t.stroke, n, i), o && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && _e(e, u + o.x * f, d + o.y * p, Math.atan2(o.dy * p, o.dx * f), t.stroke.tailEnd, t.stroke, n, i);
4599
4643
  }, z = (e) => {
4600
- if (I.length > 0 && Pr(e, u, d, f, p, I, (e, t, n, r, i) => w(e, void 0, {
4644
+ if (I.length > 0 && Lr(e, u, d, f, p, I, (e, t, n, r, i) => S(e, void 0, {
4601
4645
  x: t,
4602
4646
  y: n,
4603
4647
  w: r,
4604
4648
  h: i
4605
4649
  }), void 0, L)) {
4606
- R(e), nr(e);
4650
+ R(e), ar(e);
4607
4651
  return;
4608
4652
  }
4609
- w(e), R(e);
4653
+ S(e), R(e);
4610
4654
  };
4611
- if (Cr(e, t, z, z, P, br(T, u, d, f, p, t.shadow?.algn), r, F, T, !!_, (e) => w(e, "#000")), t.textBody) {
4612
- let n = hr(t, o);
4655
+ if (Er(e, t, z, z, P, Cr(T, u, d, f, p, t.shadow?.algn), n, F, T, !!_, (e) => S(e, "#000")), t.textBody) {
4656
+ let r = vr(t, o);
4613
4657
  if (e.save(), t.flipH || t.flipV) {
4614
4658
  let n = u + f / 2, r = d + p / 2;
4615
4659
  e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
4616
4660
  }
4617
- let s = u, c = d, h = f, _ = p;
4618
- if (t.textRect) s = X(t.textRect.x, r), c = X(t.textRect.y, r), h = X(t.textRect.width, r), _ = X(t.textRect.height, r);
4661
+ let s = u, l = d, h = f, _ = p;
4662
+ if (t.textRect) s = X(t.textRect.x, n), l = X(t.textRect.y, n), h = X(t.textRect.width, n), _ = X(t.textRect.height, n);
4619
4663
  else if (g === "ellipse") {
4620
4664
  let e = f * (1 - 1 / Math.SQRT2) / 2, t = p * (1 - 1 / Math.SQRT2) / 2;
4621
- s = u + e, c = d + t, h = f / Math.SQRT2, _ = p / Math.SQRT2;
4665
+ s = u + e, l = d + t, h = f / Math.SQRT2, _ = p / Math.SQRT2;
4622
4666
  } else {
4623
- let e = mr(g, u, d, f, p, t.adj, t.adj2);
4624
- e && (s = e.tx, c = e.ty, h = e.tw, _ = e.th);
4667
+ let e = _r(g, u, d, f, p, t.adj, t.adj2);
4668
+ e && (s = e.tx, l = e.ty, h = e.tw, _ = e.th);
4625
4669
  }
4626
- Ar(e, t.textBody, s, c, h, _, r, n, t.rotation, !1, !1, i, a, o, m, !1, l), e.restore();
4670
+ Nr(e, t.textBody, s, l, h, _, n, r, t.rotation, !1, !1, i, a, o, m, !1, c), e.restore();
4627
4671
  }
4628
4672
  e.restore();
4629
4673
  }
4630
- var Tr = he;
4631
- function Er(e, t) {
4632
- let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Dr(e).toLowerCase(), o = Dr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
4674
+ var Or = pe;
4675
+ function kr(e, t) {
4676
+ let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Ar(e).toLowerCase(), o = Ar(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
4633
4677
  switch (t) {
4634
4678
  case "arabicPlain": return n;
4635
4679
  case "arabicPeriod": return `${n}.`;
@@ -4656,7 +4700,7 @@ function Er(e, t) {
4656
4700
  default: return `${n}.`;
4657
4701
  }
4658
4702
  }
4659
- function Dr(e) {
4703
+ function Ar(e) {
4660
4704
  let t = [
4661
4705
  1e3,
4662
4706
  900,
@@ -4689,28 +4733,28 @@ function Dr(e) {
4689
4733
  for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
4690
4734
  return r;
4691
4735
  }
4692
- function Or(e) {
4736
+ function jr(e) {
4693
4737
  for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
4694
4738
  return !1;
4695
4739
  }
4696
- function kr(e, t) {
4697
- let n = Or(e);
4698
- if (e.bullet.type === "char") return t.clear(), n ? ge(e.bullet.char, e.bullet.fontFamily ?? null) : "";
4740
+ function Mr(e, t) {
4741
+ let n = jr(e);
4742
+ if (e.bullet.type === "char") return t.clear(), n ? me(e.bullet.char, e.bullet.fontFamily ?? null) : "";
4699
4743
  if (e.bullet.type === "autoNum") {
4700
4744
  if (!n) return "";
4701
4745
  let r = e.lvl;
4702
- return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Er(t.get(r), e.bullet.numType);
4746
+ return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), kr(t.get(r), e.bullet.numType);
4703
4747
  }
4704
4748
  return t.clear(), "";
4705
4749
  }
4706
- function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
4750
+ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000", f, p = {
4707
4751
  themeMajorFont: null,
4708
4752
  themeMinorFont: null,
4709
4753
  dpr: 1
4710
- }, h, g = !1, _, v = !1) {
4754
+ }, m, g = !1, _, v = !1) {
4711
4755
  let y = t.vert === "vert" || t.vert === "eaVert", b = t.vert === "vert270";
4712
4756
  if (y || b) {
4713
- let l = n + i / 2, u = r + a / 2, m = y ? 90 : -90, v = h ? (e) => h({
4757
+ let l = n + i / 2, u = r + a / 2, h = y ? 90 : -90, v = m ? (e) => m({
4714
4758
  ...e,
4715
4759
  inShapeX: e.inShapeX - a / 2 + i / 2,
4716
4760
  inShapeY: e.inShapeY - i / 2 + a / 2,
@@ -4719,56 +4763,56 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4719
4763
  shapeW: i,
4720
4764
  shapeH: a,
4721
4765
  rotation: c,
4722
- textBodyRotation: m
4766
+ textBodyRotation: h
4723
4767
  }) : void 0;
4724
4768
  if (g) return i;
4725
- e.save(), e.translate(l, u), e.rotate(b ? -Math.PI / 2 : Math.PI / 2), Ar(e, {
4769
+ e.save(), e.translate(l, u), e.rotate(b ? -Math.PI / 2 : Math.PI / 2), Nr(e, {
4726
4770
  ...t,
4727
4771
  vert: "horz"
4728
4772
  }, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, d, f, p, v, !1, _, t.vert === "eaVert"), e.restore();
4729
4773
  return;
4730
4774
  }
4731
4775
  let x = t.textWarp;
4732
- if (!g && x && Me(x.preset)) {
4733
- pr(e, t, x.preset, x.adj ?? [], n, r, i, a, o, s ?? d, p);
4776
+ if (!g && x && je(x.preset)) {
4777
+ gr(e, t, x.preset, x.adj ?? [], n, r, i, a, o, s ?? d, p);
4734
4778
  return;
4735
4779
  }
4736
- let S = X(t.lIns, o), C = X(t.rIns, o), w = X(t.tIns, o), T = X(t.bIns, o), E = t.wrap !== "none", D = t.autoFit === "sp" ? E && Kn(e, t, i, S, C, o, p) : E, O = Math.max(1, t.numCol ?? 1), k = X(t.spcCol ?? 0, o), A = t.defaultBold ?? !1, j = t.defaultItalic ?? !1, M = s ?? d, N = (r) => {
4737
- let a = (t.defaultFontSize ?? 18) * U * o * r, s = [], c = 0, l = /* @__PURE__ */ new Map();
4780
+ let S = X(t.lIns, o), C = X(t.rIns, o), w = X(t.tIns, o), T = X(t.bIns, o), E = t.wrap !== "none", D = t.autoFit === "sp" ? E && qn(e, t, i, S, C, o, p) : E, O = Math.max(1, t.numCol ?? 1), k = X(t.spcCol ?? 0, o), A = t.defaultBold ?? !1, j = t.defaultItalic ?? !1, M = s ?? d, N = (r) => {
4781
+ let a = (t.defaultFontSize ?? 18) * Y * o * r, s = [], c = 0, l = /* @__PURE__ */ new Map();
4738
4782
  for (let u = 0; u < t.paragraphs.length; u++) {
4739
- let d = t.paragraphs[u], m = X(d.marL, o), h = X(d.marR, o), g = X(d.indent, o), _ = d.defFontSize == null ? a : d.defFontSize * U * o * r, v = d.defColor ? Z(d.defColor) : M, y = Wn(d), b = (() => {
4783
+ let d = t.paragraphs[u], m = X(d.marL, o), h = X(d.marR, o), g = X(d.indent, o), _ = d.defFontSize == null ? a : d.defFontSize * Y * o * r, v = d.defColor ? Z(d.defColor) : M, y = Gn(d), b = (() => {
4740
4784
  for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
4741
4785
  return null;
4742
- })(), x = b == null ? _ : b * U * o * r, w = (() => {
4786
+ })(), x = b == null ? _ : b * Y * o * r, w = (() => {
4743
4787
  for (let e of d.runs) if (e.type === "text" && e.color) return e.color;
4744
4788
  return null;
4745
4789
  })(), T = w ? Z(w) : v, E = (() => {
4746
4790
  for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
4747
4791
  return d.defFontFamily ?? null;
4748
- })(), N = "", P = Q(!1, !1, x, "sans-serif", p), F = T, I = null;
4749
- N = kr(d, l);
4750
- let L = De(d.bullet);
4792
+ })(), N = "", P = Wn(!1, !1, x, "sans-serif", p), F = T, I = null;
4793
+ N = Mr(d, l);
4794
+ let L = Ee(d.bullet);
4751
4795
  if (L.type === "char") {
4752
4796
  let e = L;
4753
- P = Q(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * U * o * r, N === e.char ? Nn(e.fontFamily ?? null, p) : "sans-serif", p), F = e.color ? Z(e.color) : T;
4797
+ P = Wn(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * Y * o * r, N === e.char ? Nn(e.fontFamily ?? null, p) : "sans-serif", p), F = e.color ? Z(e.color) : T;
4754
4798
  } else if (L.type === "autoNum") {
4755
4799
  let e = L;
4756
- P = Q(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * U * o * r, Nn(e.fontFamily ?? E, p), p), F = L.color ? Z(L.color) : T;
4800
+ P = Wn(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * Y * o * r, Nn(e.fontFamily ?? E, p), p), F = L.color ? Z(L.color) : T;
4757
4801
  } else if (L.type === "blip") {
4758
- let e = L, t = e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * U * o * r;
4802
+ let e = L, t = e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * Y * o * r;
4759
4803
  I = {
4760
4804
  imagePath: e.imagePath,
4761
4805
  mimeType: e.mimeType,
4762
4806
  sizePx: t
4763
4807
  };
4764
4808
  }
4765
- let R = O > 1 ? (i - S - C - (O - 1) * k) / O : i - S - C, z = n + S + m, B = n + S + m + g, V = R - m - h, H = Yn(e, d, D ? V : Infinity, _, v, o, m, A, j, r, f, p, Gn(y, g)), W = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * U * o * r, G = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * U * o * r;
4809
+ let R = O > 1 ? (i - S - C - (O - 1) * k) / O : i - S - C, z = n + S + m, B = n + S + m + g, V = R - m - h, H = Qn(e, d, D ? V : Infinity, _, v, o, m, A, j, r, f, p, Kn(y, g)), U = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * Y * o * r, W = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * Y * o * r;
4766
4810
  for (let n = 0; n < H.length; n++) {
4767
4811
  let r = H[n], i = n === 0, a = n === H.length - 1, l = 0, f = 0;
4768
4812
  for (let e of r.segments) {
4769
4813
  let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
4770
4814
  if (t > l && (l = t), !e.math) {
4771
- let t = te(e.fontFamily, e.sizePx);
4815
+ let t = q(e.fontFamily, e.sizePx);
4772
4816
  t > f && (f = t);
4773
4817
  }
4774
4818
  }
@@ -4779,8 +4823,8 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4779
4823
  }
4780
4824
  i && I && I.sizePx > l && (l = I.sizePx);
4781
4825
  let p = l * 1.2, m = Math.max(p, f), h;
4782
- h = d.spaceLine ? d.spaceLine.type === "pct" ? p * (d.spaceLine.val / 1e5) : d.spaceLine.val * U * o : m, t.autoFit === "norm" && t.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - t.lnSpcReduction);
4783
- let v = h + (a ? G : 0), b = i && u > 0 ? W : 0, x = i ? Gn(y, g) : 0, S = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), C = i && S ? I : null;
4826
+ h = d.spaceLine ? d.spaceLine.type === "pct" ? p * (d.spaceLine.val / 1e5) : d.spaceLine.val * Y * o : m, t.autoFit === "norm" && t.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - t.lnSpcReduction);
4827
+ let v = h + (a ? W : 0), b = i && u > 0 ? U : 0, x = i ? Kn(y, g) : 0, S = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), C = i && S ? I : null;
4784
4828
  s.push({
4785
4829
  line: r,
4786
4830
  linePx: v,
@@ -4822,11 +4866,11 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4822
4866
  a === 0 && I === "b" ? (R = w + F + T, L = r - R) : R = t.autoFit === "sp" ? Math.max(a, w + F + T) : a;
4823
4867
  let z, B = Math.max(0, R - w - T);
4824
4868
  z = I === "ctr" ? L + w + (B - F) / 2 : I === "b" ? L + R - T - F : L + w, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
4825
- let V = z, H = O > 1 ? (i - S - C - (O - 1) * k) / O + k : 0, W = Math.max(0, R - w - T), G = P[P.length - 1], K = G ? Math.max(0, G.linePx - G.lineHeight) : 0, q = F - K, ee = a === 0 || q <= W + .5, ne = O > 1 && !ee ? Math.ceil(P.length / O) : P.length, re = 0, ie = 0;
4869
+ let V = z, H = O > 1 ? (i - S - C - (O - 1) * k) / O + k : 0, U = Math.max(0, R - w - T), W = P[P.length - 1], G = W ? Math.max(0, W.linePx - W.lineHeight) : 0, J = F - G, ee = a === 0 || J <= U + .5, te = O > 1 && !ee ? Math.ceil(P.length / O) : P.length, ne = 0, re = 0;
4826
4870
  for (let s of P) {
4827
4871
  let { line: l, linePx: u, lineHeight: d, topGapPx: f, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = s;
4828
- O > 1 && re < O - 1 && ie >= ne && (re++, ie = 0, z = V), z += f, ie++;
4829
- let T = (t.rtlCol ? O - 1 - re : re) * H, E = s.textX + T, D = s.bulletX + T, k = s.textMaxW, A = s.para.rtl === !0, j = A || on(l.segments), M = l.segments.some((e) => e.isTab);
4872
+ O > 1 && ne < O - 1 && re >= te && (ne++, re = 0, z = V), z += f, re++;
4873
+ let T = (t.rtlCol ? O - 1 - ne : ne) * H, E = s.textX + T, D = s.bulletX + T, k = s.textMaxW, A = s.para.rtl === !0, j = A || on(l.segments), M = l.segments.some((e) => e.isTab);
4830
4874
  if (M) {
4831
4875
  let t = X(s.para.marL, o), n = X(s.para.marR, o), r = A ? n : t + g, i = k + t + n;
4832
4876
  e.font = l.segments.find((e) => e.isTab).font;
@@ -4843,7 +4887,7 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4843
4887
  let n = t.letterSpacingPx ?? 0;
4844
4888
  return {
4845
4889
  isTab: !1,
4846
- width: t.text ? e.measureText(t.text).width + n * Jn(t.text) : 0
4890
+ width: t.text ? (t.leadingLetterSpacingPx ?? 0) + Q(e, t.text, n) : 0
4847
4891
  };
4848
4892
  }), (s.para.tabStops ?? []).map((e) => ({
4849
4893
  pos: X(e.pos, o),
@@ -4863,12 +4907,12 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4863
4907
  }
4864
4908
  e.font = t.font;
4865
4909
  let n = e.measureText(t.text || "M"), r = t.letterSpacingPx ?? 0;
4866
- N += t.text ? n.width + r * Jn(t.text) : 0, n.actualBoundingBoxAscent > 0 && (P = Math.max(P, n.actualBoundingBoxAscent));
4910
+ N += t.leadingLetterSpacingPx ?? 0, N += t.text ? Q(e, t.text, r) : 0, n.actualBoundingBoxAscent > 0 && (P = Math.max(P, n.actualBoundingBoxAscent));
4867
4911
  }
4868
4912
  let F = z + P, I = E + k, L = 0, R = null;
4869
4913
  if (j && A) {
4870
4914
  if (y) e.font = b, L = e.measureText(y).width;
4871
- else if (S && _ && (R = m(S.imagePath, _), R)) {
4915
+ else if (S && _ && (R = h(S.imagePath, _), R)) {
4872
4916
  let e = S.sizePx;
4873
4917
  L = R.height > 0 ? e * (R.width / R.height) : e;
4874
4918
  }
@@ -4878,7 +4922,7 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4878
4922
  e.direction = "rtl", e.fillText(y, I - L, F), e.direction = t;
4879
4923
  } else e.fillText(y, D, F);
4880
4924
  if (S && _) {
4881
- let t = m(S.imagePath, _);
4925
+ let t = h(S.imagePath, _);
4882
4926
  if (t) {
4883
4927
  let n = S.sizePx, r = t.height > 0 ? n * (t.width / t.height) : n, i = F - n;
4884
4928
  j && A ? e.drawImage(t, I - r, i, r, n) : e.drawImage(t, D, i, r, n);
@@ -4886,14 +4930,22 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4886
4930
  }
4887
4931
  let B = E + g, U;
4888
4932
  U = M ? A ? E + k - L - N : B : C === "ctr" ? B + (k - g - N) / 2 : C === "r" ? E + k - L - N : B;
4889
- let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, G = w || (l.endsWithBreak ?? !1), K = (W && !j && !M ? un(l.segments, k - g, N, W, G) : null) ?? l.segments, q = j ? sn(l.segments, A) : null, ee = K.length;
4890
- for (let t = 0; t < ee; t++) {
4891
- let s = q ? q.order[t] : t, l = K[s], u = q ? q.rtl[s] : !1;
4892
- if (j && (e.direction = u ? "rtl" : "ltr"), l.isTab) {
4933
+ let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, G = w || (l.endsWithBreak ?? !1), q = (W && !j && !M ? un(l.segments, k - g, N, W, G) : null) ?? l.segments, J = j ? sn(l.segments, A) : null, ee = (e, t) => {
4934
+ if (Math.abs(e - t) !== 1) return 0;
4935
+ let n = l.segments[Math.min(e, t)], r = l.segments[Math.max(e, t)];
4936
+ return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
4937
+ }, ie = q.length;
4938
+ for (let t = 0; t < ie; t++) {
4939
+ let s = J ? J.order[t] : t, l = q[s], u = J ? J.rtl[s] : !1;
4940
+ if (j && (e.direction = u ? "rtl" : "ltr"), t > 0) {
4941
+ let e = J ? J.order[t - 1] : t - 1;
4942
+ U += ee(e, s);
4943
+ }
4944
+ if (l.isTab) {
4893
4945
  U += l.tabWidthPx ?? 0;
4894
4946
  continue;
4895
4947
  }
4896
- let f = l.jext ?? 0, m = l.splitBefore, g = l.perGap ?? 0, _ = m && m.length > 0 ? m.length * g : 0;
4948
+ let f = l.jext ?? 0, h = l.splitBefore, g = l.perGap ?? 0, _ = h && h.length > 0 ? h.length * g : 0;
4897
4949
  if (l.math) {
4898
4950
  let t = En.get(l.math.nodes), n = l.math.width, r = l.math.ascent + l.math.descent;
4899
4951
  if (t && n > 0 && r > 0) {
@@ -4906,36 +4958,47 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4906
4958
  e.font = l.font, e.fillStyle = l.color;
4907
4959
  let y = F + (l.baseline ? -(l.baseline / 1e5) * l.sizePx : 0), b = l.letterSpacingPx ?? 0;
4908
4960
  if (l.highlight && l.text) {
4909
- let t = e.measureText(l.text).width + (b > 0 ? b * Jn(l.text) : 0) + _ + f;
4961
+ let t = Q(e, l.text, b) + _ + f;
4910
4962
  wn(e, U, y, t, l.sizePx, l.highlight, l.color);
4911
4963
  }
4912
4964
  let x = l.shadow, S = (e, t, n, r) => {
4913
4965
  let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
4914
- if (b > 0 && t.length > 1) {
4966
+ if (b !== 0 && Yn(t) > 1) {
4915
4967
  let r = e, a = r.letterSpacing;
4916
- try {
4917
- r.letterSpacing = `${b}px`;
4918
- } catch {}
4919
- i(t, n, y);
4920
- try {
4921
- r.letterSpacing = a;
4922
- } catch {}
4968
+ if (Zn(e)) {
4969
+ r.letterSpacing = `${b}px`, i(t, n, y);
4970
+ try {
4971
+ r.letterSpacing = a;
4972
+ } catch {}
4973
+ } else {
4974
+ let r = n, a = [...t];
4975
+ for (let t = 0; t < a.length; t++) {
4976
+ let n = a[t];
4977
+ i(n, r, y), t < a.length - 1 && (r += e.measureText(n).width + b);
4978
+ }
4979
+ }
4923
4980
  } else i(t, n, y);
4924
- }, C = (t) => e.measureText(t).width, w = m && m.length > 0 ? Zt([...l.text], m, g, C, b) : null, T = [...l.text], E = !!m && m.length === T.length - 1 && T.length > 1, D = (e, t) => {
4981
+ }, C = (t) => Q(e, t, b), w = h && h.length > 0 ? Zt([...l.text], h, g, C) : null, T = [...l.text], E = !!h && h.length === T.length - 1 && T.length > 1, D = (e, t) => {
4925
4982
  if (v) {
4926
4983
  let n = E ? b + g : b;
4927
4984
  Cn(e, l.text, U, y, l.sizePx, n, t);
4928
4985
  return;
4929
4986
  }
4930
4987
  if (E) {
4931
- let n = e, r = n.letterSpacing;
4932
- try {
4933
- n.letterSpacing = `${b + g}px`;
4934
- } catch {}
4935
- (t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e))(l.text, U, y);
4936
- try {
4937
- n.letterSpacing = r;
4938
- } catch {}
4988
+ let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = b + g;
4989
+ if (Zn(e)) {
4990
+ let t = e, i = t.letterSpacing;
4991
+ t.letterSpacing = `${r}px`, n(l.text, U, y);
4992
+ try {
4993
+ t.letterSpacing = i;
4994
+ } catch {}
4995
+ } else {
4996
+ let t = U;
4997
+ for (let i = 0; i < T.length; i++) {
4998
+ let a = T[i];
4999
+ n(a, t, y), i < T.length - 1 && (t += e.measureText(a).width + r);
5000
+ }
5001
+ }
4939
5002
  } else if (w) for (let { text: n, dx: r } of w) S(e, n, U + r, t);
4940
5003
  else S(e, l.text, U, t);
4941
5004
  }, O = l.reflection;
@@ -4961,8 +5024,8 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4961
5024
  D(e, "fill"), x && e.restore();
4962
5025
  let k = l.outline;
4963
5026
  k && k.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(k.width, o)), e.strokeStyle = k.color ? `#${k.color}` : l.color, e.lineJoin = "round", D(e, "stroke"), e.restore()), e.font = l.font;
4964
- let A = e.measureText(l.text).width + (b > 0 ? b * Jn(l.text) : 0) + _;
4965
- if (h && l.text && h({
5027
+ let A = Q(e, l.text, b) + _;
5028
+ if (m && l.text && m({
4966
5029
  text: l.text,
4967
5030
  inShapeX: U - n,
4968
5031
  inShapeY: z - r,
@@ -4982,9 +5045,9 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4982
5045
  let n = y - l.sizePx * .32;
4983
5046
  if (l.strikeDouble) {
4984
5047
  let r = t * .9, i = n - r, a = n + r;
4985
- e.beginPath(), e.moveTo(U, i + J(i, t, p.dpr)), e.lineTo(U + A + f, i + J(i, t, p.dpr)), e.moveTo(U, a + J(a, t, p.dpr)), e.lineTo(U + A + f, a + J(a, t, p.dpr)), e.stroke();
5048
+ e.beginPath(), e.moveTo(U, i + K(i, t, p.dpr)), e.lineTo(U + A + f, i + K(i, t, p.dpr)), e.moveTo(U, a + K(a, t, p.dpr)), e.lineTo(U + A + f, a + K(a, t, p.dpr)), e.stroke();
4986
5049
  } else {
4987
- let r = n + J(n, t, p.dpr);
5050
+ let r = n + K(n, t, p.dpr);
4988
5051
  e.beginPath(), e.moveTo(U, r), e.lineTo(U + A + f, r), e.stroke();
4989
5052
  }
4990
5053
  }
@@ -4994,7 +5057,7 @@ function Ar(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
4994
5057
  }
4995
5058
  e.restore();
4996
5059
  }
4997
- function jr(e, t, n, r, i) {
5060
+ function Pr(e, t, n, r, i) {
4998
5061
  if (!e) return [];
4999
5062
  let a = Lt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Ut(n), s = r * i, c = [];
5000
5063
  return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
@@ -5012,7 +5075,7 @@ function jr(e, t, n, r, i) {
5012
5075
  bottom: !0
5013
5076
  }), c;
5014
5077
  }
5015
- function Mr(e, t, n, r, i, a) {
5078
+ function Fr(e, t, n, r, i, a) {
5016
5079
  if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
5017
5080
  let o = e.extrusionH * i * a, s = ct(t, n * a, r * a, o);
5018
5081
  if (Math.hypot(s.x, s.y) < .75) return null;
@@ -5035,14 +5098,14 @@ function Mr(e, t, n, r, i, a) {
5035
5098
  rgb: c
5036
5099
  };
5037
5100
  }
5038
- function Nr(e, t, n, r, i, a, o, s = {}) {
5101
+ function Ir(e, t, n, r, i, a, o, s = {}) {
5039
5102
  if (i <= 0 || a <= 0) return !1;
5040
5103
  let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = Math.max(0, Math.ceil((s.edgePadCss ?? 0) * u)), f = ot(t, i, a), p = f.corners;
5041
5104
  if (d > 0) {
5042
5105
  let e = d / u, t = _t(f.corners, e / i, e / a);
5043
5106
  t ? p = t : d = 0;
5044
5107
  }
5045
- let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = F(h, g);
5108
+ let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = O(h, g);
5046
5109
  if (!_) return !1;
5047
5110
  let v = _.getContext("2d");
5048
5111
  if (!v) return !1;
@@ -5063,9 +5126,9 @@ function Nr(e, t, n, r, i, a, o, s = {}) {
5063
5126
  y: r + e.y
5064
5127
  }))), !0;
5065
5128
  }
5066
- function Pr(e, t, n, r, i, a, o, s, c = 0) {
5129
+ function Lr(e, t, n, r, i, a, o, s, c = 0) {
5067
5130
  if (r <= 0 || i <= 0 || a.length === 0) return !1;
5068
- let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = F(m, h);
5131
+ let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = O(m, h);
5069
5132
  if (!g) return !1;
5070
5133
  let _ = g.getContext("2d");
5071
5134
  if (!_) return !1;
@@ -5082,19 +5145,19 @@ function Pr(e, t, n, r, i, a, o, s, c = 0) {
5082
5145
  }
5083
5146
  return s && (_.save(), _.scale(d, d), _.translate(p, p), s(_, 0, 0, r, i), _.restore()), e.drawImage(g, t - p, n - p, m / d, h / d), !0;
5084
5147
  }
5085
- var Fr = /* @__PURE__ */ new WeakMap();
5086
- function Ir(e) {
5087
- let t = Fr.get(e);
5148
+ var Rr = /* @__PURE__ */ new WeakMap();
5149
+ function zr(e) {
5150
+ let t = Rr.get(e);
5088
5151
  return t || (t = async (t, n) => {
5089
5152
  let r = await e(t);
5090
5153
  return r.type === n ? r : new Blob([r], { type: n });
5091
- }, Fr.set(e, t)), t;
5154
+ }, Rr.set(e, t)), t;
5092
5155
  }
5093
- function Lr(e, t, n = Ir(t)) {
5094
- return G("base", e.posterPath, n, async () => {
5156
+ function Br(e, t, n = zr(t)) {
5157
+ return W("base", e.posterPath, n, async () => {
5095
5158
  let n = await t(e.posterPath), r = e.posterMimeType || n.type || "application/octet-stream";
5096
5159
  return {
5097
- bitmap: await o(n.type === r ? n : new Blob([n], { type: r })),
5160
+ bitmap: await s(n.type === r ? n : new Blob([n], { type: r })),
5098
5161
  owned: !0
5099
5162
  };
5100
5163
  }).then((e) => {
@@ -5102,39 +5165,39 @@ function Lr(e, t, n = Ir(t)) {
5102
5165
  return e;
5103
5166
  });
5104
5167
  }
5105
- async function Rr(e, t, n, r, i) {
5168
+ async function Vr(e, t, n, r, i) {
5106
5169
  if (i) try {
5107
- let o = t.mimeType === "image/svg+xml", { widthPt: s, heightPt: l } = x(t.mimeType, t.srcRect, t.width / U, t.height / U), u;
5108
- if (ue(t)) try {
5109
- u = await a(t.svgImagePath, i);
5170
+ let a = t.mimeType === "image/svg+xml", { widthPt: s, heightPt: c } = S(t.mimeType, t.srcRect, t.width / Y, t.height / Y), u;
5171
+ if (ce(t)) try {
5172
+ u = await o(t.svgImagePath, i);
5110
5173
  } catch {
5111
- u = o ? await a(t.imagePath, i) : await Te(t.imagePath, t.mimeType, t.duotone, i, {
5174
+ u = a ? await o(t.imagePath, i) : await we(t.imagePath, t.mimeType, t.duotone, i, {
5112
5175
  widthPt: s,
5113
- heightPt: l
5176
+ heightPt: c
5114
5177
  });
5115
5178
  }
5116
- else u = o ? await a(t.imagePath, i) : await Te(t.imagePath, t.mimeType, t.duotone, i, {
5179
+ else u = a ? await o(t.imagePath, i) : await we(t.imagePath, t.mimeType, t.duotone, i, {
5117
5180
  widthPt: s,
5118
- heightPt: l
5181
+ heightPt: c
5119
5182
  });
5120
5183
  if (!u || r()) return;
5121
5184
  e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
5122
5185
  let d = X(t.x, n), f = X(t.y, n), p = X(t.width, n), m = X(t.height, n);
5123
5186
  (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(d + p / 2, f + m / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(d + p / 2), -(f + m / 2)));
5124
- let h = b(u, t.srcRect), g = (e, n, r, i, a) => {
5125
- t.custGeom && t.custGeom.length > 0 ? Tr(e, t.custGeom, n, r, i, a) : t.prstGeom && v(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
5187
+ let h = x(u, t.srcRect), g = (e, n, r, i, a) => {
5188
+ t.custGeom && t.custGeom.length > 0 ? Or(e, t.custGeom, n, r, i, a) : t.prstGeom && y(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
5126
5189
  }, _ = (e, t, n, r, i) => {
5127
5190
  e.beginPath(), g(e, t, n, r, i);
5128
- }, y = (e, n, r, i, a) => {
5191
+ }, v = (e, n, r, i, a) => {
5129
5192
  (t.prstGeom || t.custGeom && t.custGeom.length > 0) && (_(e, n, r, i, a), e.clip());
5130
- }, S = (e, r, i, a, o) => {
5131
- t.stroke && (e.save(), Vr(e, t.stroke, n, {
5193
+ }, b = (e, r, i, a, o) => {
5194
+ t.stroke && (e.save(), Wr(e, t.stroke, n, {
5132
5195
  x: r,
5133
5196
  y: i,
5134
5197
  w: a,
5135
5198
  h: o
5136
5199
  }, t.rotation), _(e, r, i, a, o), e.stroke(), e.restore());
5137
- }, w = (e, r, i, a, o) => {
5200
+ }, C = (e, r, i, a, o) => {
5138
5201
  let s = t.sp3d;
5139
5202
  if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
5140
5203
  let t = Math.max(.5, s.contourW * n);
@@ -5143,55 +5206,55 @@ async function Rr(e, t, n, r, i) {
5143
5206
  e.rect(r - c, i - c, a + 2 * c, o + 2 * c), g(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), _(e, r, i, a, o), e.strokeStyle = Z(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
5144
5207
  }
5145
5208
  }, T = t.scene3d && st(t.scene3d.camera) ? t.scene3d : null, E = (e, t, n, r, i) => {
5146
- e.save(), y(e, t, n, r, i), h ? e.drawImage(u, h.sx, h.sy, h.sw, h.sh, t, n, r, i) : e.drawImage(u, t, n, r, i), e.restore();
5209
+ e.save(), v(e, t, n, r, i), h ? e.drawImage(u, h.sx, h.sy, h.sw, h.sh, t, n, r, i) : e.drawImage(u, t, n, r, i), e.restore();
5147
5210
  }, D = (e, t, n, r, i) => {
5148
- E(e, t, n, r, i), S(e, t, n, r, i), w(e, t, n, r, i);
5211
+ E(e, t, n, r, i), b(e, t, n, r, i), C(e, t, n, r, i);
5149
5212
  }, O = (e, t, n, r, i) => {
5150
- E(e, t, n, r, i), S(e, t, n, r, i);
5151
- }, k = e.getTransform(), A = Math.abs(k.a * k.d - k.b * k.c), j = A > 0 ? Math.sqrt(A) : 1, M = jr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, j), N = T ? Mr(t.sp3d, T.camera, p, m, n, j) : null, P = t.stroke ? t.stroke.width * n / 2 : 0, F = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, I = N ? Math.hypot(N.offsetX, N.offsetY) / j : 0, L = P + F + I + 2, R = (e) => {
5213
+ E(e, t, n, r, i), b(e, t, n, r, i);
5214
+ }, k = e.getTransform(), A = Math.abs(k.a * k.d - k.b * k.c), j = A > 0 ? Math.sqrt(A) : 1, M = Pr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, j), N = T ? Fr(t.sp3d, T.camera, p, m, n, j) : null, P = t.stroke ? t.stroke.width * n / 2 : 0, F = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, I = N ? Math.hypot(N.offsetX, N.offsetY) / j : 0, L = P + F + I + 2, R = (e) => {
5152
5215
  if (T) {
5153
- if (Nr(e, T.camera, d, f, p, m, O, {
5216
+ if (Ir(e, T.camera, d, f, p, m, O, {
5154
5217
  bevels: M,
5155
5218
  extrusion: N ?? void 0,
5156
- paintEdges: w,
5219
+ paintEdges: C,
5157
5220
  edgePadCss: L
5158
5221
  })) return;
5159
- } else if (M.length > 0 && Pr(e, d, f, p, m, M, O, w, L)) return;
5222
+ } else if (M.length > 0 && Lr(e, d, f, p, m, M, O, C, L)) return;
5160
5223
  D(e, d, f, p, m);
5161
5224
  }, z = (e, t, n, r, i, a) => {
5162
- e.save(), y(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
5225
+ e.save(), v(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
5163
5226
  }, B = (e, t) => {
5164
- T && Nr(e, T.camera, d, f, p, m, (e, n, r, i, a) => z(e, t, n, r, i, a)) || z(e, t, d, f, p, m);
5165
- }, V = e.getTransform(), H = Math.abs(V.a * V.d - V.b * V.c), W = H > 0 ? Math.sqrt(H) : 1, G = P + F, K = (t.custGeom && t.custGeom.length > 0 ? ve(t.custGeom, d, f, p, m) : t.prstGeom && c(t.prstGeom.toLowerCase()) ? C(t.prstGeom.toLowerCase(), d, f, p, m, t.prstAdjust ?? []) : null) ?? {
5227
+ T && Ir(e, T.camera, d, f, p, m, (e, n, r, i, a) => z(e, t, n, r, i, a)) || z(e, t, d, f, p, m);
5228
+ }, V = e.getTransform(), H = Math.abs(V.a * V.d - V.b * V.c), U = H > 0 ? Math.sqrt(H) : 1, W = P + F, G = (t.custGeom && t.custGeom.length > 0 ? ge(t.custGeom, d, f, p, m) : t.prstGeom && l(t.prstGeom.toLowerCase()) ? w(t.prstGeom.toLowerCase(), d, f, p, m, t.prstAdjust ?? []) : null) ?? {
5166
5229
  x: d,
5167
5230
  y: f,
5168
5231
  w: p,
5169
5232
  h: m
5170
- }, q = T ? xr(T.camera, V, d, f, p, m, L, t.shadow?.algn) : {
5171
- bbox: _r(V, K.x - G, K.y - G, K.w + G * 2, K.h + G * 2),
5172
- anchor: br(V, d, f, p, m, t.shadow?.algn)
5173
- }, ee = n * W, J = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), te = (e) => B(e, "#000");
5174
- Cr(e, t, T && J ? Sr(R, V, q.bbox, {
5233
+ }, K = T ? wr(T.camera, V, d, f, p, m, L, t.shadow?.algn) : {
5234
+ bbox: br(V, G.x - W, G.y - W, G.w + W * 2, G.h + W * 2),
5235
+ anchor: Cr(V, d, f, p, m, t.shadow?.algn)
5236
+ }, q = n * U, J = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), ee = (e) => B(e, "#000");
5237
+ Er(e, t, T && J ? Tr(R, V, K.bbox, {
5175
5238
  w: e.canvas.width || 0,
5176
5239
  h: e.canvas.height || 0
5177
- }) : R, T && J ? Sr(te, V, q.bbox, {
5240
+ }) : R, T && J ? Tr(ee, V, K.bbox, {
5178
5241
  w: e.canvas.width || 0,
5179
5242
  h: e.canvas.height || 0
5180
- }) : te, q.bbox, q.anchor, n, ee, V), e.restore();
5243
+ }) : ee, K.bbox, K.anchor, n, q, V), e.restore();
5181
5244
  } catch (e) {
5182
- if (d(e)) throw e;
5245
+ if (f(e)) throw e;
5183
5246
  }
5184
5247
  }
5185
- async function zr(e, t, n, r, i, a, o) {
5186
- let s = X(t.x, n), c = X(t.y, n), l = X(t.width, n), u = X(t.height, n), f;
5248
+ async function Hr(e, t, n, r, i, a, o) {
5249
+ let s = X(t.x, n), c = X(t.y, n), l = X(t.width, n), u = X(t.height, n), d;
5187
5250
  if (t.posterPath && i) try {
5188
- f = await Lr(t, i, o);
5251
+ d = await Br(t, i, o);
5189
5252
  } catch (e) {
5190
- if (d(e)) throw e;
5253
+ if (f(e)) throw e;
5191
5254
  }
5192
- r() || (e.save(), Hr(e, t, n), f ? e.drawImage(f, s, c, l, u) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(s, c, l, u)), a || nn(e, s + l / 2, c + u / 2, l, u, "paused"), e.restore());
5255
+ r() || (e.save(), Gr(e, t, n), d ? e.drawImage(d, s, c, l, u) : (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(s, c, l, u)), a || nn(e, s + l / 2, c + u / 2, l, u, "paused"), e.restore());
5193
5256
  }
5194
- function Br(e, t, n, r, i, a, o) {
5257
+ function Ur(e, t, n, r, i, a, o) {
5195
5258
  let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
5196
5259
  if (u === 0) return;
5197
5260
  let d = -l / u, f = c / u, p;
@@ -5248,23 +5311,23 @@ function Br(e, t, n, r, i, a, o) {
5248
5311
  }
5249
5312
  e.restore();
5250
5313
  }
5251
- function Vr(e, t, n, r, i = 0) {
5252
- if (ie(e, t, n), t?.fill && r) {
5314
+ function Wr(e, t, n, r, i = 0) {
5315
+ if (ne(e, t, n), t?.fill && r) {
5253
5316
  let n = Tn(t.fill, e, r.x, r.y, r.w, r.h, i);
5254
5317
  n && (e.strokeStyle = n);
5255
5318
  }
5256
5319
  }
5257
- function Hr(e, t, n) {
5320
+ function Gr(e, t, n) {
5258
5321
  if (t.rotation === 0 && !t.flipH && !t.flipV) return;
5259
5322
  let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
5260
5323
  e.translate(r + a / 2, i + o / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(r + a / 2), -(i + o / 2));
5261
5324
  }
5262
- function Ur(e, t, n, r, i = {
5325
+ function Kr(e, t, n, r, i = {
5263
5326
  themeMajorFont: null,
5264
5327
  themeMinorFont: null,
5265
5328
  dpr: 1
5266
5329
  }) {
5267
- e.save(), Hr(e, t, n);
5330
+ e.save(), Gr(e, t, n);
5268
5331
  let a = X(t.x, n), o = X(t.y, n), s = t.cols.map((e) => X(e, n)), c = s.length, l = (e, t) => {
5269
5332
  let n = 0;
5270
5333
  for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
@@ -5275,7 +5338,7 @@ function Ur(e, t, n, r, i = {
5275
5338
  for (let t = 0; t < o.cells.length; t++) {
5276
5339
  let s = o.cells[t];
5277
5340
  if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
5278
- let c = l(t, s.gridSpan || 1), d = Ar(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
5341
+ let c = l(t, s.gridSpan || 1), d = Nr(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
5279
5342
  d > u[a] && (u[a] = d);
5280
5343
  }
5281
5344
  }
@@ -5286,7 +5349,7 @@ function Ur(e, t, n, r, i = {
5286
5349
  if (s.hMerge || s.vMerge) continue;
5287
5350
  let c = s.rowSpan || 1;
5288
5351
  if (c <= 1 || !s.textBody) continue;
5289
- let d = l(t, s.gridSpan || 1), f = Ar(e, s.textBody, 0, 0, d, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
5352
+ let d = l(t, s.gridSpan || 1), f = Nr(e, s.textBody, 0, 0, d, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
5290
5353
  for (let e = 0; e < c && a + e < u.length; e++) p += u[a + e];
5291
5354
  if (f > p) {
5292
5355
  let e = (f - p) / c;
@@ -5334,7 +5397,7 @@ function Ur(e, t, n, r, i = {
5334
5397
  let u = Tn(a.fill, e, o, s, c, l, t.rotation);
5335
5398
  if (u && (e.fillStyle = u, e.fillRect(o, s, c, l)), a.textBody) {
5336
5399
  let t = a.textColor ? Z(a.textColor) : null;
5337
- Ar(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i);
5400
+ Nr(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i);
5338
5401
  }
5339
5402
  }
5340
5403
  let _ = i.dpr, v = (e, t) => {
@@ -5342,13 +5405,13 @@ function Ur(e, t, n, r, i = {
5342
5405
  let n = g[e][t];
5343
5406
  return n < 0 ? null : h[n];
5344
5407
  }, y = (r, i, a, o, s) => {
5345
- Vr(e, r, n, {
5408
+ Wr(e, r, n, {
5346
5409
  x: Math.min(i, o),
5347
5410
  y: Math.min(a, s),
5348
5411
  w: Math.max(1, Math.abs(o - i)),
5349
5412
  h: Math.max(1, Math.abs(s - a))
5350
5413
  }, t.rotation);
5351
- let c = i === o ? J(i, e.lineWidth, _) : 0, l = a === s ? J(a, e.lineWidth, _) : 0;
5414
+ let c = i === o ? K(i, e.lineWidth, _) : 0, l = a === s ? K(a, e.lineWidth, _) : 0;
5352
5415
  e.beginPath(), e.moveTo(i + c, a + l), e.lineTo(o + c, s + l), e.stroke();
5353
5416
  };
5354
5417
  for (let r of h) {
@@ -5383,12 +5446,12 @@ function Ur(e, t, n, r, i = {
5383
5446
  o && y(o, e, m[t], e, m[i] + u[i]), t = i + 1;
5384
5447
  }
5385
5448
  }
5386
- i.diagonalTL && (Vr(e, i.diagonalTL, n, {
5449
+ i.diagonalTL && (Wr(e, i.diagonalTL, n, {
5387
5450
  x: a,
5388
5451
  y: o,
5389
5452
  w: s,
5390
5453
  h: d
5391
- }, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (Vr(e, i.diagonalTR, n, {
5454
+ }, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (Wr(e, i.diagonalTR, n, {
5392
5455
  x: a,
5393
5456
  y: o,
5394
5457
  w: s,
@@ -5397,14 +5460,14 @@ function Ur(e, t, n, r, i = {
5397
5460
  }
5398
5461
  e.restore();
5399
5462
  }
5400
- function Wr(e, t, n, r) {
5463
+ function qr(e, t, n, r) {
5401
5464
  e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
5402
5465
  }
5403
- var Gr = /* @__PURE__ */ new WeakMap();
5404
- function Kr(e) {
5405
- Gr.set(e, (Gr.get(e) ?? 0) + 1);
5466
+ var Jr = /* @__PURE__ */ new WeakMap();
5467
+ function Yr(e) {
5468
+ Jr.set(e, (Jr.get(e) ?? 0) + 1);
5406
5469
  }
5407
- function qr(e, t, n, r, i) {
5470
+ function Xr(e, t, n, r, i) {
5408
5471
  e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
5409
5472
  let a = Math.max(12, Math.min(t, n) * .04);
5410
5473
  e.strokeStyle = "#c8ccd2", e.lineWidth = Math.max(1, Math.min(t, n) * .004), e.setLineDash([e.lineWidth * 6, e.lineWidth * 5]), e.strokeRect(a, a, t - a * 2, n - a * 2), e.setLineDash([]);
@@ -5424,86 +5487,86 @@ function qr(e, t, n, r, i) {
5424
5487
  for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
5425
5488
  e.restore();
5426
5489
  }
5427
- async function Jr(e, t, n, r, i = {}, a) {
5428
- let o = i.fetchImage ?? (i.fetchMedia ? Ir(i.fetchMedia) : void 0), s = o ? g(o) : void 0;
5490
+ async function Zr(e, t, n, r, i = {}, a) {
5491
+ let o = i.fetchImage ?? (i.fetchMedia ? zr(i.fetchMedia) : void 0), s = o ? _(o) : void 0;
5429
5492
  try {
5430
- return await Yr(e, t, n, r, i, a, o);
5493
+ return await Qr(e, t, n, r, i, a, o);
5431
5494
  } finally {
5432
5495
  s?.();
5433
5496
  }
5434
5497
  }
5435
- async function Yr(e, n, r, i, o = {}, s, c) {
5436
- let l = (Gr.get(e) ?? 0) + 1;
5437
- Gr.set(e, l);
5438
- let f = () => Gr.get(e) !== l, p = o.width ?? ((z(e) ? e.offsetWidth : 0) || 960), m = p / r, h = Math.round(p), g = Math.round(i * m), _ = o.dpr ?? V(), v = re(h * _, g * _), y = v.clamped ? _ * v.scale : _;
5498
+ async function Qr(e, t, r, i, a = {}, s, c) {
5499
+ let l = (Jr.get(e) ?? 0) + 1;
5500
+ Jr.set(e, l);
5501
+ let u = () => Jr.get(e) !== l, p = a.width ?? ((z(e) ? e.offsetWidth : 0) || 960), m = p / r, h = Math.round(p), g = Math.round(i * m), _ = a.dpr ?? V(), v = te(h * _, g * _), y = v.clamped ? _ * v.scale : _;
5439
5502
  e.width = v.width, e.height = v.height, z(e) && (e.style.width = `${h}px`, e.style.display || (e.style.display = "block"));
5440
5503
  let b = e.getContext("2d");
5441
5504
  if (!b) throw Error("Could not get 2D context");
5442
- if (b.scale(y, y), n.parseError) return qr(b, h, g, n.slideNumber, n.parseError), e;
5443
- let S = o.defaultTextColor ? `#${o.defaultTextColor}` : "#000000", C = {
5444
- themeMajorFont: o.majorFont ?? null,
5445
- themeMinorFont: o.minorFont ?? null,
5446
- themeHlinkColor: o.hlinkColor ?? null,
5505
+ if (b.scale(y, y), t.parseError) return Xr(b, h, g, t.slideNumber, t.parseError), e;
5506
+ let x = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", C = {
5507
+ themeMajorFont: a.majorFont ?? null,
5508
+ themeMinorFont: a.minorFont ?? null,
5509
+ themeHlinkColor: a.hlinkColor ?? null,
5447
5510
  dpr: y,
5448
- smartArtFallbackTextColor: _n(n.background, S)
5511
+ smartArtFallbackTextColor: _n(t.background, x)
5449
5512
  };
5450
- if (await Xn(b, n.background, h, g, m, f, o.fetchImage), f() || (o.math && await Mn(n, o.math), f())) return e;
5451
- let w = n.slideNumber;
5452
- for (let e of n.elements) if (e.type === "picture" && o.fetchImage) {
5513
+ if (await $n(b, t.background, h, g, m, u, a.fetchImage), u() || (a.math && await Mn(t, a.math), u())) return e;
5514
+ let w = t.slideNumber;
5515
+ for (let e of t.elements) if (e.type === "picture" && a.fetchImage) {
5453
5516
  let t = e, n = t.mimeType === "image/svg+xml";
5454
- if (ue(t)) a(t.svgImagePath, o.fetchImage).catch(() => void 0);
5455
- else if (n) a(t.imagePath, o.fetchImage).catch(() => void 0);
5517
+ if (ce(t)) o(t.svgImagePath, a.fetchImage).catch(() => void 0);
5518
+ else if (n) o(t.imagePath, a.fetchImage).catch(() => void 0);
5456
5519
  else {
5457
- let e = x(t.mimeType, t.srcRect, t.width / U, t.height / U);
5458
- Te(t.imagePath, t.mimeType, t.duotone, o.fetchImage, {
5520
+ let e = S(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
5521
+ we(t.imagePath, t.mimeType, t.duotone, a.fetchImage, {
5459
5522
  widthPt: e.widthPt,
5460
5523
  heightPt: e.heightPt
5461
5524
  }).catch(() => void 0);
5462
5525
  }
5463
5526
  } else if (e.type === "media") {
5464
5527
  let t = e;
5465
- t.posterPath && o.fetchMedia && Lr(t, o.fetchMedia, c).catch(() => void 0);
5528
+ t.posterPath && a.fetchMedia && Br(t, a.fetchMedia, c).catch(() => void 0);
5466
5529
  }
5467
- if (o.fetchImage) {
5468
- let r = o.fetchImage, i = /* @__PURE__ */ new Set();
5469
- for (let e of n.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
5470
- let e = De(t.bullet);
5530
+ if (a.fetchImage) {
5531
+ let r = a.fetchImage, i = /* @__PURE__ */ new Set();
5532
+ for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
5533
+ let e = Ee(t.bullet);
5471
5534
  e.type === "blip" && i.add(`${e.imagePath} ${e.mimeType}`);
5472
5535
  }
5473
5536
  if (i.size > 0 && (await Promise.all([...i].map((e) => {
5474
- let [n, i] = e.split(" ");
5475
- return t(n, i, r).catch((e) => {
5476
- if (d(e)) throw e;
5537
+ let [t, i] = e.split(" ");
5538
+ return n(t, i, r).catch((e) => {
5539
+ if (f(e)) throw e;
5477
5540
  });
5478
- })), f())) return e;
5541
+ })), u())) return e;
5479
5542
  }
5480
- for (let [t, r] of n.elements.entries()) {
5481
- if (f()) return e;
5482
- if (r.type === "shape") wr(b, r, m, S, w, C, s ? (e) => s({
5543
+ for (let [n, r] of t.elements.entries()) {
5544
+ if (u()) return e;
5545
+ if (r.type === "shape") Dr(b, r, m, x, w, C, s ? (e) => s({
5483
5546
  ...e,
5484
- elementIndex: t,
5485
- origin: n.elementSources?.[t]?.origin ?? "slide"
5486
- }) : void 0, o.fetchImage);
5487
- else if (r.type === "picture") await Rr(b, r, m, f, o.fetchImage);
5488
- else if (r.type === "table") Ur(b, r, m, w, C);
5489
- else if (r.type === "media") await zr(b, r, m, f, o.fetchMedia, o.skipMediaControls, o.fetchImage);
5547
+ elementIndex: n,
5548
+ origin: t.elementSources?.[n]?.origin ?? "slide"
5549
+ }) : void 0, a.fetchImage);
5550
+ else if (r.type === "picture") await Vr(b, r, m, u, a.fetchImage);
5551
+ else if (r.type === "table") Kr(b, r, m, w, C);
5552
+ else if (r.type === "media") await Hr(b, r, m, u, a.fetchMedia, a.skipMediaControls, a.fetchImage);
5490
5553
  else if (r.type === "chart") {
5491
- let e = U * m;
5492
- b.save(), Hr(b, r, m), u(b, r.chart, {
5554
+ let e = Y * m;
5555
+ b.save(), Gr(b, r, m), d(b, r.chart, {
5493
5556
  x: X(r.x, m),
5494
5557
  y: X(r.y, m),
5495
5558
  w: X(r.width, m),
5496
5559
  h: X(r.height, m)
5497
- }, e, r.rotation), b.restore();
5560
+ }, e, r.rotation, a.threeD, a.regionMap), b.restore();
5498
5561
  }
5499
5562
  }
5500
- return f() || o.dim && Wr(b, o.dim, h, g), e;
5563
+ return u() || a.dim && qr(b, a.dim, h, g), e;
5501
5564
  }
5502
5565
  //#endregion
5503
5566
  //#region packages/pptx/src/google-fonts.ts
5504
- var Xr = {
5505
- ...ee,
5506
- ...K
5567
+ var $r = {
5568
+ ...j,
5569
+ ...I
5507
5570
  };
5508
5571
  Object.freeze({
5509
5572
  archiveEntryCount: 0,
@@ -5514,7 +5577,7 @@ Object.freeze({
5514
5577
  function $(e, t) {
5515
5578
  if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
5516
5579
  }
5517
- function Zr(e, t) {
5580
+ function ei(e, t) {
5518
5581
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
5519
5582
  let n = e;
5520
5583
  if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
@@ -5524,7 +5587,7 @@ function Zr(e, t) {
5524
5587
  ...n.partName === void 0 ? {} : { partName: n.partName }
5525
5588
  });
5526
5589
  }
5527
- function Qr(e) {
5590
+ function ti(e) {
5528
5591
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
5529
5592
  let t = e;
5530
5593
  if (!Number.isSafeInteger(t.slideCount) || (t.slideCount ?? -1) < 0 || !Number.isSafeInteger(t.slideWidth) || (t.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(t.slideHeight) || (t.slideHeight ?? 0) <= 0 || !Array.isArray(t.slides) || t.slides.length !== t.slideCount) throw Error("invalid PPTX presentation bootstrap dimensions or slide count");
@@ -5537,10 +5600,10 @@ function Qr(e) {
5537
5600
  minorFont: t.minorFont,
5538
5601
  hlinkColor: t.hlinkColor,
5539
5602
  folHlinkColor: t.folHlinkColor,
5540
- slides: Object.freeze(t.slides.map(Zr))
5603
+ slides: Object.freeze(t.slides.map(ei))
5541
5604
  });
5542
5605
  }
5543
- function $r(e) {
5606
+ function ni(e) {
5544
5607
  return Object.freeze({
5545
5608
  type: "media",
5546
5609
  x: e.x,
@@ -5557,7 +5620,7 @@ function $r(e) {
5557
5620
  mimeType: e.mimeType
5558
5621
  });
5559
5622
  }
5560
- function ei(e, t) {
5623
+ function ri(e, t) {
5561
5624
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
5562
5625
  let n = e;
5563
5626
  for (let e of [
@@ -5568,9 +5631,9 @@ function ei(e, t) {
5568
5631
  "rotation"
5569
5632
  ]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
5570
5633
  if (n.type !== "media" || typeof n.flipH != "boolean" || typeof n.flipV != "boolean" || n.mediaKind !== "audio" && n.mediaKind !== "video" || typeof n.posterPath != "string" || typeof n.posterMimeType != "string" || typeof n.mediaPath != "string" || typeof n.mimeType != "string") throw Error(`invalid PPTX presentation preflight media fields at slide ${t}`);
5571
- return $r(n);
5634
+ return ni(n);
5572
5635
  }
5573
- function ti(e) {
5636
+ function ii(e) {
5574
5637
  if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
5575
5638
  let t = e;
5576
5639
  if (!Number.isSafeInteger(t.slideCount) || (t.slideCount ?? -1) < 0 || !Number.isSafeInteger(t.slideWidth) || (t.slideWidth ?? 0) <= 0 || !Number.isSafeInteger(t.slideHeight) || (t.slideHeight ?? 0) <= 0 || !Array.isArray(t.slides) || t.slides.length !== t.slideCount || !Array.isArray(t.fontPreloadNames)) throw Error("invalid PPTX presentation preflight dimensions or slide count");
@@ -5584,7 +5647,7 @@ function ti(e) {
5584
5647
  ...n.partName === void 0 ? {} : { partName: n.partName },
5585
5648
  notes: n.notes,
5586
5649
  hidden: n.hidden,
5587
- mediaElements: Object.freeze(n.mediaElements.map((e) => ei(e, t)))
5650
+ mediaElements: Object.freeze(n.mediaElements.map((e) => ri(e, t)))
5588
5651
  });
5589
5652
  }), r = t.fontPreloadNames.map((e, t) => {
5590
5653
  if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
@@ -5603,7 +5666,7 @@ function ti(e) {
5603
5666
  fontPreloadNames: Object.freeze(r)
5604
5667
  });
5605
5668
  }
5606
- function ni(e, t) {
5669
+ function ai(e, t) {
5607
5670
  for (let n of e.slides) for (let e of n.mediaElements) {
5608
5671
  if (e.mediaPath === t) return e.mimeType;
5609
5672
  if (e.posterPath === t) return e.posterMimeType;
@@ -5612,7 +5675,7 @@ function ni(e, t) {
5612
5675
  }
5613
5676
  //#endregion
5614
5677
  //#region packages/pptx/src/slide-pull-client.ts
5615
- var ri = 1024 * 1024, ii = class {
5678
+ var oi = 1024 * 1024, si = class {
5616
5679
  active = /* @__PURE__ */ new Set();
5617
5680
  nextSessionId = 1;
5618
5681
  constructor(e) {
@@ -5625,15 +5688,15 @@ var ri = 1024 * 1024, ii = class {
5625
5688
  sessionId: r,
5626
5689
  operationId: r,
5627
5690
  generation: this.options.generation ?? 1
5628
- }, a = new p(this.options.transport, {
5691
+ }, a = new m(this.options.transport, {
5629
5692
  ...i,
5630
- maxByteCredit: l,
5693
+ maxByteCredit: u,
5631
5694
  timeoutMs: n
5632
5695
  });
5633
5696
  this.active.add(a);
5634
5697
  try {
5635
5698
  await this.options.open(e, i, n);
5636
- let r = await oi(a);
5699
+ let r = await li(a);
5637
5700
  try {
5638
5701
  let e = r.usage ?? a.usageCheckpoint;
5639
5702
  e && this.options.onUsage?.(e);
@@ -5656,20 +5719,20 @@ var ri = 1024 * 1024, ii = class {
5656
5719
  if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
5657
5720
  }
5658
5721
  };
5659
- function ai(e) {
5722
+ function ci(e) {
5660
5723
  return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
5661
5724
  }
5662
- async function oi(e) {
5725
+ async function li(e) {
5663
5726
  try {
5664
- return await e.pull(ri);
5727
+ return await e.pull(oi);
5665
5728
  } catch (t) {
5666
- let n = si(t);
5729
+ let n = ui(t);
5667
5730
  if (n === void 0) throw t;
5668
5731
  return e.pull(n);
5669
5732
  }
5670
5733
  }
5671
- function si(e) {
5672
- return M(e, ri, l);
5734
+ function ui(e) {
5735
+ return P(e, oi, u);
5673
5736
  }
5674
5737
  //#endregion
5675
- export { ti as a, Jr as c, Qr as i, nn as l, ai as n, Xr as o, ni as r, Kr as s, ii as t };
5738
+ export { ii as a, Zr as c, ti as i, nn as l, ci as n, $r as o, ai as r, Yr as s, si as t };