@silurus/ooxml 0.82.0 → 0.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{render-worker-7-Zr7fSw.js → render-worker-Cy-QsDge.js} +1 -1
- package/dist/assets/{render-worker-B5gsW6b5.js → render-worker-aHayzR7v.js} +4 -4
- package/dist/{comment-ui-runtime-BAe30Ct9.js → comment-ui-runtime-C1RV_3iu.js} +1 -1
- package/dist/comment-ui-runtime-DTGN3Vyy.js +2 -0
- package/dist/{comment-ui-runtime-BUCj4hWn.js → comment-ui-runtime-DgCZpPR0.js} +1 -1
- package/dist/{document-pull-client-BCgmytqI.js → document-pull-client-B1WOjA0z.js} +1 -1
- package/dist/{docx-wokGKYfi.js → docx-HoZXZUPA.js} +3 -3
- package/dist/docx.mjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/node.mjs +5 -5
- package/dist/{pptx-DU8L8I2T.js → pptx-DEUP4Yq5.js} +3 -3
- package/dist/pptx.mjs +2 -2
- package/dist/{read-only-comment-margin-Dn2y55W6.js → read-only-comment-margin-DrUX-YrP.js} +1 -1
- package/dist/{render-CenWM4g1.js → render-BC8p7vZQ.js} +1 -1
- package/dist/{render-worker-host-BmH3kGSj.js → render-worker-host-BNnXCtAu.js} +1 -1
- package/dist/{render-worker-host-BNENN3qP.js → render-worker-host-DhnkTyjj.js} +1 -1
- package/dist/{session-Cky_swUj.js → session-Da7LEQUB.js} +1 -1
- package/dist/{slide-pull-client-CqTVFb3W.js → slide-pull-client-Bg9DusLX.js} +603 -597
- package/dist/types/docx.d.ts +3 -1
- package/dist/types/index.d.ts +9 -3
- package/dist/types/node.d.ts +384 -378
- package/dist/types/pptx.d.ts +3 -1
- package/dist/types/xlsx.d.ts +3 -1
- package/dist/{xlsx-DlV37-0j.js → xlsx-DMWeXT-c.js} +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +2 -1
- package/dist/comment-ui-runtime-F4a3te6p.js +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
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, It as l, K as u, Lt as d, M as f, Mt as p, N as m, O as h, Ot as g, Pt as _, Rt as v, S as y, St as b, Tt as x, Ut as S, Vt as C, Wt as w, _ as T, _t as E, c as D, ct as O, d as k, f as A, g as j, gt as M, h as N, ht as P, i as F, j as I, m as L, mt as R, n as z, p as B, pt as V, qt as H, r as U, s as
|
|
2
|
-
import { a as
|
|
3
|
-
import { S as
|
|
4
|
-
import { r as
|
|
5
|
-
import { A as
|
|
6
|
-
import { k as
|
|
7
|
-
import { i as
|
|
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, It as l, K as u, Lt as d, M as f, Mt as p, N as m, O as h, Ot as g, Pt as _, Rt as v, S as y, St as b, Tt as x, Ut as S, Vt as C, Wt as w, _ as T, _t as E, c as D, ct as O, d as k, f as A, g as j, gt as M, h as N, ht as P, i as F, j as I, m as L, mt as R, n as z, p as B, pt as V, qt as H, r as U, s as ee, u as W, vt as te, w as G, wt as K, xt as q, y as ne, yt as re, zt as ie } from "./line-metrics-B3syvDn2.js";
|
|
2
|
+
import { a as ae, c as oe, d as se, i as ce, l as le, n as ue, o as de, r as fe, s as pe, t as me, u as he } from "./line-distribute-iXsUCIH-.js";
|
|
3
|
+
import { S as ge, _ as _e, an as ve, h as ye, in as be, k as xe, ln as Se, nn as Ce, un as we, v as Te, w as Ee } from "./plot-area-frame-DHV02PJU.js";
|
|
4
|
+
import { r as J } from "./units-BzZ0gAxs.js";
|
|
5
|
+
import { A as De, F as Oe, I as ke, L as Ae, M as je, N as Me, P as Ne, j as Pe } from "./three-d-7MaVzQuZ.js";
|
|
6
|
+
import { k as Fe } from "./renderer-CYr9YTXM.js";
|
|
7
|
+
import { i as Ie } from "./resource-measurement-CsW4_eYt.js";
|
|
8
8
|
//#region packages/pptx/src/types.ts
|
|
9
|
-
function
|
|
9
|
+
function Le(e) {
|
|
10
10
|
return e;
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var Re = {
|
|
13
13
|
textarchdown: {
|
|
14
14
|
adj: [["adj", "val 0"]],
|
|
15
15
|
gd: [
|
|
@@ -2391,22 +2391,22 @@ var Le = {
|
|
|
2391
2391
|
]
|
|
2392
2392
|
}]
|
|
2393
2393
|
}
|
|
2394
|
-
},
|
|
2395
|
-
function Ve(e) {
|
|
2396
|
-
return e.toLowerCase() in ze;
|
|
2397
|
-
}
|
|
2394
|
+
}, ze = Math.PI * 2 / 216e5, Be = Re, Ve = /* @__PURE__ */ new Map();
|
|
2398
2395
|
function He(e) {
|
|
2399
|
-
|
|
2396
|
+
return e.toLowerCase() in Be;
|
|
2397
|
+
}
|
|
2398
|
+
function Ue(e) {
|
|
2399
|
+
let t = Ve.get(e);
|
|
2400
2400
|
if (t) return t;
|
|
2401
|
-
let n =
|
|
2401
|
+
let n = Be[e];
|
|
2402
2402
|
return n ? (t = {
|
|
2403
2403
|
adj: n.adj.map(([e, t]) => [e, v(t)]),
|
|
2404
2404
|
gd: n.gd.map(([e, t]) => [e, v(t)]),
|
|
2405
2405
|
paths: n.paths
|
|
2406
|
-
},
|
|
2406
|
+
}, Ve.set(e, t), t) : null;
|
|
2407
2407
|
}
|
|
2408
|
-
var
|
|
2409
|
-
function
|
|
2408
|
+
var We = 48;
|
|
2409
|
+
function Ge(e, t, n, r) {
|
|
2410
2410
|
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;
|
|
2411
2411
|
for (let n of e.cmds) switch (n[0]) {
|
|
2412
2412
|
case "m":
|
|
@@ -2423,8 +2423,8 @@ function We(e, t, n, r) {
|
|
|
2423
2423
|
break;
|
|
2424
2424
|
case "C": {
|
|
2425
2425
|
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]));
|
|
2426
|
-
for (let t = 1; t <=
|
|
2427
|
-
let n = t /
|
|
2426
|
+
for (let t = 1; t <= We; t++) {
|
|
2427
|
+
let n = t / We, 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;
|
|
2428
2428
|
c.push({
|
|
2429
2429
|
x: s,
|
|
2430
2430
|
y: p
|
|
@@ -2435,8 +2435,8 @@ function We(e, t, n, r) {
|
|
|
2435
2435
|
}
|
|
2436
2436
|
case "Q": {
|
|
2437
2437
|
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]));
|
|
2438
|
-
for (let t = 1; t <=
|
|
2439
|
-
let n = t /
|
|
2438
|
+
for (let t = 1; t <= We; t++) {
|
|
2439
|
+
let n = t / We, 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;
|
|
2440
2440
|
c.push({
|
|
2441
2441
|
x: s,
|
|
2442
2442
|
y: d
|
|
@@ -2446,9 +2446,9 @@ function We(e, t, n, r) {
|
|
|
2446
2446
|
break;
|
|
2447
2447
|
}
|
|
2448
2448
|
case "a": {
|
|
2449
|
-
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) *
|
|
2449
|
+
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * ze, f = t.resolve(n[4]) * ze, 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;
|
|
2450
2450
|
_ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
|
|
2451
|
-
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(
|
|
2451
|
+
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(We, Math.ceil(Math.abs(y) / m * 96));
|
|
2452
2452
|
for (let e = 1; e <= S; e++) {
|
|
2453
2453
|
let t = h + y * e / S;
|
|
2454
2454
|
c.push({
|
|
@@ -2463,7 +2463,7 @@ function We(e, t, n, r) {
|
|
|
2463
2463
|
}
|
|
2464
2464
|
return c;
|
|
2465
2465
|
}
|
|
2466
|
-
function
|
|
2466
|
+
function Ke(e) {
|
|
2467
2467
|
let t = [0];
|
|
2468
2468
|
for (let n = 1; n < e.length; n++) {
|
|
2469
2469
|
let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
|
|
@@ -2471,23 +2471,23 @@ function Ge(e) {
|
|
|
2471
2471
|
}
|
|
2472
2472
|
return t;
|
|
2473
2473
|
}
|
|
2474
|
-
function
|
|
2475
|
-
let i =
|
|
2474
|
+
function qe(e, t, n, r) {
|
|
2475
|
+
let i = Ue(e.toLowerCase());
|
|
2476
2476
|
if (!i || i.paths.length === 0) return null;
|
|
2477
|
-
let a =
|
|
2477
|
+
let a = ie({
|
|
2478
2478
|
w: n,
|
|
2479
2479
|
h: r,
|
|
2480
2480
|
adj: t
|
|
2481
|
-
}, i.adj, i.gd), o = i.paths.length === 1, s =
|
|
2481
|
+
}, i.adj, i.gd), o = i.paths.length === 1, s = Ge(i.paths[0], a, n, r), c = o ? s : Ge(i.paths[i.paths.length - 1], a, n, r);
|
|
2482
2482
|
return {
|
|
2483
2483
|
top: s,
|
|
2484
2484
|
bottom: c,
|
|
2485
|
-
topLen:
|
|
2486
|
-
bottomLen:
|
|
2485
|
+
topLen: Ke(s),
|
|
2486
|
+
bottomLen: Ke(c),
|
|
2487
2487
|
singleEdge: o
|
|
2488
2488
|
};
|
|
2489
2489
|
}
|
|
2490
|
-
function
|
|
2490
|
+
function Je(e, t, n) {
|
|
2491
2491
|
let r = t[t.length - 1];
|
|
2492
2492
|
if (e.length === 1 || r === 0) return {
|
|
2493
2493
|
x: e[0].x,
|
|
@@ -2508,17 +2508,17 @@ function qe(e, t, n) {
|
|
|
2508
2508
|
ty: f / p
|
|
2509
2509
|
};
|
|
2510
2510
|
}
|
|
2511
|
-
function
|
|
2511
|
+
function Ye(e) {
|
|
2512
2512
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2513
2513
|
}
|
|
2514
|
-
function
|
|
2514
|
+
function Xe(e, t) {
|
|
2515
2515
|
if (!e.singleEdge) return 1;
|
|
2516
|
-
let n =
|
|
2516
|
+
let n = Ye(e);
|
|
2517
2517
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2518
2518
|
}
|
|
2519
|
-
function
|
|
2519
|
+
function Ze(e, t, n, r) {
|
|
2520
2520
|
if (e.singleEdge) {
|
|
2521
|
-
let i =
|
|
2521
|
+
let i = Je(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
|
|
2522
2522
|
return {
|
|
2523
2523
|
x: i.x - o * c,
|
|
2524
2524
|
y: i.y - s * c,
|
|
@@ -2527,7 +2527,7 @@ function Xe(e, t, n, r) {
|
|
|
2527
2527
|
shear: 0
|
|
2528
2528
|
};
|
|
2529
2529
|
}
|
|
2530
|
-
let i =
|
|
2530
|
+
let i = Je(e.top, e.topLen, t), a = Je(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);
|
|
2531
2531
|
return {
|
|
2532
2532
|
x: c,
|
|
2533
2533
|
y: l,
|
|
@@ -2538,7 +2538,7 @@ function Xe(e, t, n, r) {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
//#endregion
|
|
2540
2540
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2541
|
-
var
|
|
2541
|
+
var Qe = 26, $e = {
|
|
2542
2542
|
orthographicFront: {
|
|
2543
2543
|
kind: "orthographic",
|
|
2544
2544
|
baseLat: 0,
|
|
@@ -2551,52 +2551,52 @@ var Ze = 26, Qe = {
|
|
|
2551
2551
|
baseLat: 0,
|
|
2552
2552
|
baseLon: 0,
|
|
2553
2553
|
baseRev: 0,
|
|
2554
|
-
fovDeg:
|
|
2554
|
+
fovDeg: Qe
|
|
2555
2555
|
},
|
|
2556
2556
|
perspectiveRelaxed: {
|
|
2557
2557
|
kind: "perspective",
|
|
2558
2558
|
baseLat: 0,
|
|
2559
2559
|
baseLon: 0,
|
|
2560
2560
|
baseRev: 0,
|
|
2561
|
-
fovDeg:
|
|
2561
|
+
fovDeg: Qe
|
|
2562
2562
|
},
|
|
2563
2563
|
perspectiveRelaxedModerately: {
|
|
2564
2564
|
kind: "perspective",
|
|
2565
2565
|
baseLat: 0,
|
|
2566
2566
|
baseLon: 0,
|
|
2567
2567
|
baseRev: 0,
|
|
2568
|
-
fovDeg:
|
|
2568
|
+
fovDeg: Qe
|
|
2569
2569
|
},
|
|
2570
2570
|
perspectiveAbove: {
|
|
2571
2571
|
kind: "perspective",
|
|
2572
2572
|
baseLat: -20,
|
|
2573
2573
|
baseLon: 0,
|
|
2574
2574
|
baseRev: 0,
|
|
2575
|
-
fovDeg:
|
|
2575
|
+
fovDeg: Qe
|
|
2576
2576
|
},
|
|
2577
2577
|
perspectiveBelow: {
|
|
2578
2578
|
kind: "perspective",
|
|
2579
2579
|
baseLat: 20,
|
|
2580
2580
|
baseLon: 0,
|
|
2581
2581
|
baseRev: 0,
|
|
2582
|
-
fovDeg:
|
|
2582
|
+
fovDeg: Qe
|
|
2583
2583
|
},
|
|
2584
2584
|
perspectiveLeft: {
|
|
2585
2585
|
kind: "perspective",
|
|
2586
2586
|
baseLat: 0,
|
|
2587
2587
|
baseLon: -20,
|
|
2588
2588
|
baseRev: 0,
|
|
2589
|
-
fovDeg:
|
|
2589
|
+
fovDeg: Qe
|
|
2590
2590
|
},
|
|
2591
2591
|
perspectiveRight: {
|
|
2592
2592
|
kind: "perspective",
|
|
2593
2593
|
baseLat: 0,
|
|
2594
2594
|
baseLon: 20,
|
|
2595
2595
|
baseRev: 0,
|
|
2596
|
-
fovDeg:
|
|
2596
|
+
fovDeg: Qe
|
|
2597
2597
|
}
|
|
2598
2598
|
};
|
|
2599
|
-
function
|
|
2599
|
+
function et(e, t) {
|
|
2600
2600
|
let n = Array(9).fill(0);
|
|
2601
2601
|
for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
|
|
2602
2602
|
let a = 0;
|
|
@@ -2605,7 +2605,7 @@ function $e(e, t) {
|
|
|
2605
2605
|
}
|
|
2606
2606
|
return n;
|
|
2607
2607
|
}
|
|
2608
|
-
function
|
|
2608
|
+
function tt(e) {
|
|
2609
2609
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2610
2610
|
return [
|
|
2611
2611
|
1,
|
|
@@ -2619,7 +2619,7 @@ function et(e) {
|
|
|
2619
2619
|
n
|
|
2620
2620
|
];
|
|
2621
2621
|
}
|
|
2622
|
-
function
|
|
2622
|
+
function nt(e) {
|
|
2623
2623
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2624
2624
|
return [
|
|
2625
2625
|
n,
|
|
@@ -2633,7 +2633,7 @@ function tt(e) {
|
|
|
2633
2633
|
n
|
|
2634
2634
|
];
|
|
2635
2635
|
}
|
|
2636
|
-
function
|
|
2636
|
+
function rt(e) {
|
|
2637
2637
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2638
2638
|
return [
|
|
2639
2639
|
n,
|
|
@@ -2647,22 +2647,22 @@ function nt(e) {
|
|
|
2647
2647
|
1
|
|
2648
2648
|
];
|
|
2649
2649
|
}
|
|
2650
|
-
function
|
|
2650
|
+
function it(e, t, n, r) {
|
|
2651
2651
|
return [
|
|
2652
2652
|
e[0] * t + e[1] * n + e[2] * r,
|
|
2653
2653
|
e[3] * t + e[4] * n + e[5] * r,
|
|
2654
2654
|
e[6] * t + e[7] * n + e[8] * r
|
|
2655
2655
|
];
|
|
2656
2656
|
}
|
|
2657
|
-
function
|
|
2657
|
+
function at(e, t) {
|
|
2658
2658
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2659
|
-
return
|
|
2659
|
+
return et(rt(-(t ? t.rev : e.baseRev)), et(tt(-n), nt(-r)));
|
|
2660
2660
|
}
|
|
2661
|
-
function
|
|
2662
|
-
return
|
|
2661
|
+
function ot(e) {
|
|
2662
|
+
return $e[e] || (e.startsWith("perspective") ? $e.perspectiveFront : $e.orthographicFront);
|
|
2663
2663
|
}
|
|
2664
|
-
function
|
|
2665
|
-
let r =
|
|
2664
|
+
function st(e, t, n) {
|
|
2665
|
+
let r = ot(e.prst), i = at(r, e.rot);
|
|
2666
2666
|
if (t <= 0 || n <= 0) return {
|
|
2667
2667
|
corners: [
|
|
2668
2668
|
{
|
|
@@ -2694,11 +2694,11 @@ function ot(e, t, n) {
|
|
|
2694
2694
|
if (r.kind === "perspective") {
|
|
2695
2695
|
let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
|
|
2696
2696
|
u = s.map(([e, t]) => {
|
|
2697
|
-
let [n, r, o] =
|
|
2697
|
+
let [n, r, o] = it(i, e, t, 0), s = a - o, c = a / (Math.abs(s) < 1e-6 ? 1e-6 * Math.sign(s || 1) : s);
|
|
2698
2698
|
return [n * c, r * c];
|
|
2699
2699
|
});
|
|
2700
2700
|
} else u = s.map(([e, t]) => {
|
|
2701
|
-
let [n, r] =
|
|
2701
|
+
let [n, r] = it(i, e, t, 0);
|
|
2702
2702
|
return [n, r];
|
|
2703
2703
|
});
|
|
2704
2704
|
u = u.map(([e, t]) => [e * c, t * c]);
|
|
@@ -2721,18 +2721,18 @@ function ot(e, t, n) {
|
|
|
2721
2721
|
isIdentity: _
|
|
2722
2722
|
};
|
|
2723
2723
|
}
|
|
2724
|
-
function
|
|
2725
|
-
let { isIdentity: t } =
|
|
2724
|
+
function ct(e) {
|
|
2725
|
+
let { isIdentity: t } = st(e, 1e3, 1e3);
|
|
2726
2726
|
return !t;
|
|
2727
2727
|
}
|
|
2728
|
-
function
|
|
2729
|
-
let i =
|
|
2728
|
+
function lt(e, t, n, r) {
|
|
2729
|
+
let i = ot(e.prst), a = at(i, e.rot);
|
|
2730
2730
|
if (t <= 0 || n <= 0 || r === 0) return {
|
|
2731
2731
|
x: 0,
|
|
2732
2732
|
y: 0
|
|
2733
2733
|
};
|
|
2734
2734
|
let o = t / 2, s = n / 2, c = Math.max(o, s), l = e.zoom ?? 1, u = (t) => {
|
|
2735
|
-
let [n, r, o] =
|
|
2735
|
+
let [n, r, o] = it(a, 0, 0, t);
|
|
2736
2736
|
if (i.kind === "perspective") {
|
|
2737
2737
|
let t = e.fov ?? i.fovDeg, a = Math.max(1, Math.min(179, t)) * Math.PI / 180, s = c / Math.tan(a / 2), u = s - o, d = s / (Math.abs(u) < 1e-6 ? 1e-6 * Math.sign(u || 1) : u);
|
|
2738
2738
|
return [n * d * l, r * d * l];
|
|
@@ -2746,12 +2746,12 @@ function ct(e, t, n, r) {
|
|
|
2746
2746
|
}
|
|
2747
2747
|
//#endregion
|
|
2748
2748
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
2749
|
-
function
|
|
2749
|
+
function ut(e, t) {
|
|
2750
2750
|
if (t <= 0) return () => 1;
|
|
2751
2751
|
let n = (e) => Math.max(0, Math.min(1, e / t));
|
|
2752
2752
|
switch (e) {
|
|
2753
2753
|
case "hardEdge": {
|
|
2754
|
-
let e =
|
|
2754
|
+
let e = vt;
|
|
2755
2755
|
return (t) => {
|
|
2756
2756
|
let r = Math.min(1, n(t) / e);
|
|
2757
2757
|
return r * r * (3 - 2 * r);
|
|
@@ -2771,7 +2771,7 @@ function lt(e, t) {
|
|
|
2771
2771
|
};
|
|
2772
2772
|
}
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2774
|
+
function dt(e) {
|
|
2775
2775
|
let t = e.length, n = new Float64Array(t);
|
|
2776
2776
|
if (t === 0) return n;
|
|
2777
2777
|
let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
|
|
@@ -2789,7 +2789,7 @@ function ut(e) {
|
|
|
2789
2789
|
}
|
|
2790
2790
|
return n;
|
|
2791
2791
|
}
|
|
2792
|
-
function
|
|
2792
|
+
function ft(e, t = 3) {
|
|
2793
2793
|
if (e <= 0) return Array(t).fill(1);
|
|
2794
2794
|
let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
|
|
2795
2795
|
r % 2 == 0 && r--;
|
|
@@ -2797,7 +2797,7 @@ function dt(e, t = 3) {
|
|
|
2797
2797
|
for (let e = 0; e < t; e++) s.push(e < o ? r : i);
|
|
2798
2798
|
return s;
|
|
2799
2799
|
}
|
|
2800
|
-
function
|
|
2800
|
+
function pt(e, t, n, r, i, a) {
|
|
2801
2801
|
let o = 1 / (2 * i + 1);
|
|
2802
2802
|
if (a) for (let a = 0; a < r; a++) {
|
|
2803
2803
|
let r = a * n, s = 0;
|
|
@@ -2818,29 +2818,29 @@ function ft(e, t, n, r, i, a) {
|
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2821
|
+
function mt(e, t, n, r) {
|
|
2822
2822
|
let i = Float64Array.from(e);
|
|
2823
2823
|
if (r <= 0 || t <= 0 || n <= 0) return i;
|
|
2824
2824
|
let a = new Float64Array(t * n);
|
|
2825
|
-
for (let e of
|
|
2825
|
+
for (let e of ft(r, 3)) {
|
|
2826
2826
|
let r = Math.max(1, (e - 1) / 2);
|
|
2827
|
-
|
|
2827
|
+
pt(i, a, t, n, r, !0), pt(a, i, t, n, r, !1);
|
|
2828
2828
|
}
|
|
2829
2829
|
return i;
|
|
2830
2830
|
}
|
|
2831
|
-
function
|
|
2831
|
+
function ht(e, t, n, r = 128) {
|
|
2832
2832
|
let i = new Float64Array(t * n);
|
|
2833
2833
|
for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
|
|
2834
2834
|
let a = new Float64Array(n);
|
|
2835
2835
|
for (let e = 0; e < t; e++) {
|
|
2836
2836
|
for (let r = 0; r < n; r++) a[r] = i[r * t + e];
|
|
2837
|
-
let r =
|
|
2837
|
+
let r = dt(a);
|
|
2838
2838
|
for (let a = 0; a < n; a++) i[a * t + e] = r[a];
|
|
2839
2839
|
}
|
|
2840
2840
|
let o = new Float64Array(t);
|
|
2841
2841
|
for (let e = 0; e < n; e++) {
|
|
2842
2842
|
for (let n = 0; n < t; n++) o[n] = i[e * t + n];
|
|
2843
|
-
let n =
|
|
2843
|
+
let n = dt(o);
|
|
2844
2844
|
for (let r = 0; r < t; r++) i[e * t + r] = n[r];
|
|
2845
2845
|
}
|
|
2846
2846
|
for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
|
|
@@ -2852,15 +2852,15 @@ function mt(e, t, n, r = 128) {
|
|
|
2852
2852
|
for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
|
|
2853
2853
|
return i;
|
|
2854
2854
|
}
|
|
2855
|
-
var
|
|
2856
|
-
function
|
|
2855
|
+
var gt = .25, _t = .35, vt = .5;
|
|
2856
|
+
function yt(e, t, n, r, i, a) {
|
|
2857
2857
|
let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
|
|
2858
2858
|
if (t <= 0 || n <= 0) return {
|
|
2859
2859
|
normals: o,
|
|
2860
2860
|
bandMask: s,
|
|
2861
2861
|
bandWeight: c
|
|
2862
2862
|
};
|
|
2863
|
-
let l =
|
|
2863
|
+
let l = ht(e, t, n), u = ut(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = mt(l, t, n, Math.max(1, r * gt)), m = (e) => {
|
|
2864
2864
|
let t = u(Math.max(0, e - .5));
|
|
2865
2865
|
return u(e + .5) - t;
|
|
2866
2866
|
};
|
|
@@ -2875,9 +2875,9 @@ function vt(e, t, n, r, i, a) {
|
|
|
2875
2875
|
o[a * 3 + 2] = 1;
|
|
2876
2876
|
continue;
|
|
2877
2877
|
}
|
|
2878
|
-
let g = u / r, _ = 1 -
|
|
2878
|
+
let g = u / r, _ = 1 - _t, v = 1;
|
|
2879
2879
|
if (g > _) {
|
|
2880
|
-
let e = Math.min(1, (g - _) /
|
|
2880
|
+
let e = Math.min(1, (g - _) / _t);
|
|
2881
2881
|
v = 1 - e * e * (3 - 2 * e);
|
|
2882
2882
|
}
|
|
2883
2883
|
c[a] = v;
|
|
@@ -2892,7 +2892,7 @@ function vt(e, t, n, r, i, a) {
|
|
|
2892
2892
|
bandWeight: c
|
|
2893
2893
|
};
|
|
2894
2894
|
}
|
|
2895
|
-
var
|
|
2895
|
+
var bt = 35 * Math.PI / 180, xt = 12 * Math.PI / 180, St = {
|
|
2896
2896
|
t: {
|
|
2897
2897
|
x: 0,
|
|
2898
2898
|
y: -1
|
|
@@ -2926,22 +2926,22 @@ var yt = 35 * Math.PI / 180, bt = 12 * Math.PI / 180, xt = {
|
|
|
2926
2926
|
y: 1
|
|
2927
2927
|
}
|
|
2928
2928
|
};
|
|
2929
|
-
function
|
|
2929
|
+
function Ct(e, t, n) {
|
|
2930
2930
|
let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
|
|
2931
2931
|
return {
|
|
2932
2932
|
x: e * i - t * a,
|
|
2933
2933
|
y: e * a + t * i
|
|
2934
2934
|
};
|
|
2935
2935
|
}
|
|
2936
|
-
function
|
|
2937
|
-
let r =
|
|
2938
|
-
return n && n.rev && (r =
|
|
2936
|
+
function wt(e, t, n) {
|
|
2937
|
+
let r = St[t] ?? St.t;
|
|
2938
|
+
return n && n.rev && (r = Ct(r.x, r.y, n.rev)), Et(r.x, r.y, bt);
|
|
2939
2939
|
}
|
|
2940
|
-
function
|
|
2940
|
+
function Tt(e) {
|
|
2941
2941
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
2942
|
-
return
|
|
2942
|
+
return Et(-e.x / t, -e.y / t, xt);
|
|
2943
2943
|
}
|
|
2944
|
-
function
|
|
2944
|
+
function Et(e, t, n) {
|
|
2945
2945
|
let r = Math.hypot(e, t) || 1, i = Math.cos(n), a = Math.sin(n), o = e / r * i, s = t / r * i, c = a, l = Math.hypot(o, s, c) || 1;
|
|
2946
2946
|
return {
|
|
2947
2947
|
x: o / l,
|
|
@@ -2949,7 +2949,7 @@ function Tt(e, t, n) {
|
|
|
2949
2949
|
z: c / l
|
|
2950
2950
|
};
|
|
2951
2951
|
}
|
|
2952
|
-
var
|
|
2952
|
+
var Dt = 2, Ot = {
|
|
2953
2953
|
matte: {
|
|
2954
2954
|
ambient: .62,
|
|
2955
2955
|
diffuse: .45,
|
|
@@ -2962,8 +2962,8 @@ var Et = 2, Dt = {
|
|
|
2962
2962
|
specular: .35,
|
|
2963
2963
|
shininess: 22
|
|
2964
2964
|
}
|
|
2965
|
-
},
|
|
2966
|
-
function
|
|
2965
|
+
}, kt = .8;
|
|
2966
|
+
function At(e) {
|
|
2967
2967
|
switch (e) {
|
|
2968
2968
|
case "plastic":
|
|
2969
2969
|
case "metal":
|
|
@@ -2974,8 +2974,8 @@ function kt(e) {
|
|
|
2974
2974
|
default: return "matte";
|
|
2975
2975
|
}
|
|
2976
2976
|
}
|
|
2977
|
-
function
|
|
2978
|
-
let r =
|
|
2977
|
+
function jt(e, t, n = !0) {
|
|
2978
|
+
let r = Ot[e], i = {
|
|
2979
2979
|
light: t,
|
|
2980
2980
|
material: e,
|
|
2981
2981
|
ambient: r.ambient,
|
|
@@ -2983,9 +2983,9 @@ function At(e, t, n = !0) {
|
|
|
2983
2983
|
specular: r.specular,
|
|
2984
2984
|
shininess: r.shininess
|
|
2985
2985
|
};
|
|
2986
|
-
return n && (i.fillLight =
|
|
2986
|
+
return n && (i.fillLight = Tt(t), i.fillDiffuse = i.diffuse * kt), i;
|
|
2987
2987
|
}
|
|
2988
|
-
function
|
|
2988
|
+
function Mt(e, t) {
|
|
2989
2989
|
let n = e.x * t.light.x + e.y * t.light.y + e.z * t.light.z, r = t.diffuse * Math.max(0, n), i = 0;
|
|
2990
2990
|
if (t.fillLight && t.fillDiffuse) {
|
|
2991
2991
|
let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
|
|
@@ -2998,7 +2998,7 @@ function jt(e, t) {
|
|
|
2998
2998
|
}
|
|
2999
2999
|
return Math.max(0, t.ambient + r + i + a);
|
|
3000
3000
|
}
|
|
3001
|
-
function
|
|
3001
|
+
function Nt(e, t, n) {
|
|
3002
3002
|
if (!e) return {
|
|
3003
3003
|
x: 0,
|
|
3004
3004
|
y: 0,
|
|
@@ -3013,16 +3013,16 @@ function Mt(e, t, n) {
|
|
|
3013
3013
|
h: Math.max(0, o - i)
|
|
3014
3014
|
};
|
|
3015
3015
|
}
|
|
3016
|
-
function
|
|
3016
|
+
function Pt(e, t, n) {
|
|
3017
3017
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3018
3018
|
if (r <= 0 || i <= 0) return;
|
|
3019
3019
|
let a = t.widthPx;
|
|
3020
3020
|
if (a < .75) return;
|
|
3021
|
-
let { x: o, y: s, w: c, h: l } =
|
|
3021
|
+
let { x: o, y: s, w: c, h: l } = Nt(n, r, i);
|
|
3022
3022
|
if (c <= 0 || l <= 0) return;
|
|
3023
3023
|
let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
|
|
3024
3024
|
for (let e = 0; e < c * l; e++) f[e] = d[e * 4 + 3];
|
|
3025
|
-
let { bandMask: p, bandWeight: m, normals: h } =
|
|
3025
|
+
let { bandMask: p, bandWeight: m, normals: h } = yt(f, c, l, a, t.prst, t.heightPx), g = jt(t.material, t.light), _ = Mt({
|
|
3026
3026
|
x: 0,
|
|
3027
3027
|
y: 0,
|
|
3028
3028
|
z: 1
|
|
@@ -3033,13 +3033,13 @@ function Nt(e, t, n) {
|
|
|
3033
3033
|
if (n <= 0) continue;
|
|
3034
3034
|
let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
|
|
3035
3035
|
t.bottom && (r = -r, i = -i);
|
|
3036
|
-
let o = 1 + (
|
|
3036
|
+
let o = 1 + (Mt({
|
|
3037
3037
|
x: r,
|
|
3038
3038
|
y: i,
|
|
3039
3039
|
z: a
|
|
3040
3040
|
}, g) / _ - 1) * n, s = e * 4;
|
|
3041
3041
|
if (o >= 1) {
|
|
3042
|
-
let e = Math.min(1, (o - 1) *
|
|
3042
|
+
let e = Math.min(1, (o - 1) * Dt);
|
|
3043
3043
|
for (let t = 0; t < 3; t++) {
|
|
3044
3044
|
let n = Math.min(255, d[s + t] * o);
|
|
3045
3045
|
d[s + t] = n + (255 - n) * e;
|
|
@@ -3048,12 +3048,12 @@ function Nt(e, t, n) {
|
|
|
3048
3048
|
}
|
|
3049
3049
|
e.putImageData(u, o, s);
|
|
3050
3050
|
}
|
|
3051
|
-
function
|
|
3051
|
+
function Ft(e, t, n) {
|
|
3052
3052
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3053
3053
|
if (r <= 0 || i <= 0) return;
|
|
3054
3054
|
let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
|
|
3055
3055
|
if (s < .75) return;
|
|
3056
|
-
let { x: c, y: l, w: u, h: d } =
|
|
3056
|
+
let { x: c, y: l, w: u, h: d } = Nt(n, r, i);
|
|
3057
3057
|
if (u <= 0 || d <= 0) return;
|
|
3058
3058
|
let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
|
|
3059
3059
|
for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
|
|
@@ -3077,7 +3077,7 @@ function Pt(e, t, n) {
|
|
|
3077
3077
|
}
|
|
3078
3078
|
//#endregion
|
|
3079
3079
|
//#region packages/core/src/text/underline.ts
|
|
3080
|
-
function
|
|
3080
|
+
function It(e, t, n, r, i, a, o, s = 1) {
|
|
3081
3081
|
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 = V(u, l, s);
|
|
3082
3082
|
if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
|
|
3083
3083
|
let n = l, i = l * 6;
|
|
@@ -3102,11 +3102,11 @@ function Ft(e, t, n, r, i, a, o, s = 1) {
|
|
|
3102
3102
|
e.beginPath(), e.moveTo(t, i + V(i, l, s)), e.lineTo(t + r, i + V(i, l, s)), e.moveTo(t, a + V(a, l, s)), e.lineTo(t + r, a + V(a, l, s)), e.stroke();
|
|
3103
3103
|
return;
|
|
3104
3104
|
}
|
|
3105
|
-
e.setLineDash(
|
|
3105
|
+
e.setLineDash(ge(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
|
|
3106
3106
|
}
|
|
3107
3107
|
//#endregion
|
|
3108
3108
|
//#region packages/core/src/text/highlight-box.ts
|
|
3109
|
-
function
|
|
3109
|
+
function Lt(e, t) {
|
|
3110
3110
|
return {
|
|
3111
3111
|
top: e - t * .85,
|
|
3112
3112
|
height: t * 1.1
|
|
@@ -3114,7 +3114,7 @@ function It(e, t) {
|
|
|
3114
3114
|
}
|
|
3115
3115
|
//#endregion
|
|
3116
3116
|
//#region packages/core/src/text/justify-positions.ts
|
|
3117
|
-
function
|
|
3117
|
+
function Rt(e, t, n, r, i = 0) {
|
|
3118
3118
|
let a = [], o = 0, s = 0;
|
|
3119
3119
|
for (let c of t) a.push({
|
|
3120
3120
|
text: e.slice(o, c).join(""),
|
|
@@ -3127,14 +3127,14 @@ function Lt(e, t, n, r, i = 0) {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
//#endregion
|
|
3129
3129
|
//#region packages/pptx/src/reflection-blur.ts
|
|
3130
|
-
var
|
|
3131
|
-
function
|
|
3130
|
+
var zt = .5;
|
|
3131
|
+
function Bt(e, t) {
|
|
3132
3132
|
if (!(t > 0) || !(e.h > 0)) return [{
|
|
3133
3133
|
y: e.y,
|
|
3134
3134
|
h: Math.max(0, e.h),
|
|
3135
3135
|
radius: 0
|
|
3136
3136
|
}];
|
|
3137
|
-
let n = Math.max(4, Math.min(24, Math.ceil(t /
|
|
3137
|
+
let n = Math.max(4, Math.min(24, Math.ceil(t / zt) + 1)), r = e.y + e.h, i = [];
|
|
3138
3138
|
for (let a = 0; a < n; a++) {
|
|
3139
3139
|
let o = Math.sqrt(a / (n - 1)), s = a === 0 ? 0 : Math.sqrt((a - 1) / (n - 1)), c = a === n - 1 ? 1 : Math.sqrt((a + 1) / (n - 1)), l = a === 0 ? 0 : (s + o) / 2, u = a === n - 1 ? 1 : (o + c) / 2, d = r - u * e.h;
|
|
3140
3140
|
i.push({
|
|
@@ -3145,12 +3145,12 @@ function zt(e, t) {
|
|
|
3145
3145
|
}
|
|
3146
3146
|
return i;
|
|
3147
3147
|
}
|
|
3148
|
-
function
|
|
3149
|
-
for (let a of
|
|
3148
|
+
function Vt(e, t, n, r, i) {
|
|
3149
|
+
for (let a of Bt(n, r)) e.save(), e.beginPath(), e.rect(0, a.y, i, a.h), e.clip(), e.filter = a.radius > 0 ? `blur(${a.radius}px)` : "none", e.drawImage(t, 0, 0), e.restore();
|
|
3150
3150
|
}
|
|
3151
3151
|
//#endregion
|
|
3152
3152
|
//#region packages/pptx/src/hyperlink.ts
|
|
3153
|
-
function
|
|
3153
|
+
function Ht(e, t) {
|
|
3154
3154
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
3155
3155
|
if (n === void 0 && r === void 0) return;
|
|
3156
3156
|
if (r !== void 0) return {
|
|
@@ -3168,7 +3168,7 @@ function Vt(e, t) {
|
|
|
3168
3168
|
}
|
|
3169
3169
|
//#endregion
|
|
3170
3170
|
//#region packages/pptx/src/media-chrome.ts
|
|
3171
|
-
function
|
|
3171
|
+
function Ut(e, t, n, r, i, a) {
|
|
3172
3172
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
3173
3173
|
if (e.save(), e.shadowColor = "rgba(0, 0, 0, 0.3)", e.shadowBlur = o * .35, e.fillStyle = "rgba(20, 20, 20, 0.7)", e.beginPath(), e.arc(t, n, o, 0, Math.PI * 2), e.fill(), e.shadowColor = "transparent", e.shadowBlur = 0, e.fillStyle = "#fff", a === "paused") {
|
|
3174
3174
|
e.beginPath();
|
|
@@ -3182,18 +3182,18 @@ function Ht(e, t, n, r, i, a) {
|
|
|
3182
3182
|
}
|
|
3183
3183
|
//#endregion
|
|
3184
3184
|
//#region packages/pptx/src/bidi-line.ts
|
|
3185
|
-
var
|
|
3185
|
+
var Wt = (e) => {
|
|
3186
3186
|
let t = e.text;
|
|
3187
3187
|
return typeof t == "string" ? t : void 0;
|
|
3188
|
-
},
|
|
3189
|
-
function
|
|
3188
|
+
}, Gt = (e) => "isTab" in e;
|
|
3189
|
+
function Kt(e) {
|
|
3190
3190
|
for (let t of e) {
|
|
3191
|
-
let e =
|
|
3191
|
+
let e = Wt(t);
|
|
3192
3192
|
if (e !== void 0 && I(e)) return !0;
|
|
3193
3193
|
}
|
|
3194
3194
|
return !1;
|
|
3195
3195
|
}
|
|
3196
|
-
function
|
|
3196
|
+
function qt(t, n) {
|
|
3197
3197
|
let r = t.length;
|
|
3198
3198
|
if (r === 0) return {
|
|
3199
3199
|
order: [],
|
|
@@ -3202,8 +3202,8 @@ function Kt(t, n) {
|
|
|
3202
3202
|
let i = "", a = Array(r), o;
|
|
3203
3203
|
for (let e = 0; e < r; e++) {
|
|
3204
3204
|
a[e] = i.length;
|
|
3205
|
-
let n =
|
|
3206
|
-
if (i += n.length > 0 ? n : "",
|
|
3205
|
+
let n = Wt(t[e]) ?? "";
|
|
3206
|
+
if (i += n.length > 0 ? n : "", Gt(t[e])) {
|
|
3207
3207
|
for (o ??= []; o.length < i.length;) o.push(null);
|
|
3208
3208
|
o[a[e]] = "S";
|
|
3209
3209
|
}
|
|
@@ -3218,7 +3218,7 @@ function Kt(t, n) {
|
|
|
3218
3218
|
}
|
|
3219
3219
|
//#endregion
|
|
3220
3220
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3221
|
-
function
|
|
3221
|
+
function Jt(e, t, n, r, a = 0, o = !1) {
|
|
3222
3222
|
if (e.length === 0) return 0;
|
|
3223
3223
|
let s = t === 0, c = 0, l = t;
|
|
3224
3224
|
for (let t of e) {
|
|
@@ -3234,16 +3234,16 @@ function qt(e, t, n, r, a = 0, o = !1) {
|
|
|
3234
3234
|
}
|
|
3235
3235
|
//#endregion
|
|
3236
3236
|
//#region packages/pptx/src/text-justify.ts
|
|
3237
|
-
var
|
|
3238
|
-
function
|
|
3237
|
+
var Yt = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3238
|
+
function Xt(e, t, n, r, i) {
|
|
3239
3239
|
if (r === "just" && i) return null;
|
|
3240
3240
|
let a = t - n;
|
|
3241
3241
|
if (a <= .5) return null;
|
|
3242
|
-
let o =
|
|
3242
|
+
let o = me(e, a, {
|
|
3243
3243
|
firstContentSi: 0,
|
|
3244
3244
|
lastDrawnSi: e.length,
|
|
3245
|
-
isGapChar:
|
|
3246
|
-
isWhitespace:
|
|
3245
|
+
isGapChar: G,
|
|
3246
|
+
isWhitespace: Yt,
|
|
3247
3247
|
seaClusterGaps: r === "thaiDist"
|
|
3248
3248
|
});
|
|
3249
3249
|
if (!o) return null;
|
|
@@ -3264,7 +3264,7 @@ function Yt(e, t, n, r, i) {
|
|
|
3264
3264
|
}
|
|
3265
3265
|
//#endregion
|
|
3266
3266
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3267
|
-
function
|
|
3267
|
+
function Zt(e) {
|
|
3268
3268
|
if (!e) return {
|
|
3269
3269
|
r: 0,
|
|
3270
3270
|
g: 0,
|
|
@@ -3281,22 +3281,22 @@ function Xt(e) {
|
|
|
3281
3281
|
b: parseInt(t.slice(4, 6), 16)
|
|
3282
3282
|
};
|
|
3283
3283
|
}
|
|
3284
|
-
function
|
|
3285
|
-
let t =
|
|
3284
|
+
function Qt(e) {
|
|
3285
|
+
let t = Zt(e);
|
|
3286
3286
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3287
3287
|
}
|
|
3288
|
-
function
|
|
3288
|
+
function $t(e, t) {
|
|
3289
3289
|
if (!e && !t) return null;
|
|
3290
3290
|
if (!e) return t;
|
|
3291
3291
|
if (!t) return e;
|
|
3292
3292
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
3293
|
-
let n =
|
|
3293
|
+
let n = Qt(e.color), r = Qt(t.color);
|
|
3294
3294
|
return n === r || n < r ? e : t;
|
|
3295
3295
|
}
|
|
3296
3296
|
//#endregion
|
|
3297
3297
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3298
|
-
function
|
|
3299
|
-
let t =
|
|
3298
|
+
function en(e) {
|
|
3299
|
+
let t = q(e.length === 8 ? e.slice(0, 6) : e);
|
|
3300
3300
|
if (!t) return null;
|
|
3301
3301
|
let n = b(t[0], t[1], t[2]);
|
|
3302
3302
|
if (e.length !== 8) return n;
|
|
@@ -3305,13 +3305,13 @@ function $t(e) {
|
|
|
3305
3305
|
let i = r / 255;
|
|
3306
3306
|
return i * n + (1 - i);
|
|
3307
3307
|
}
|
|
3308
|
-
function
|
|
3308
|
+
function tn(e) {
|
|
3309
3309
|
if (!e) return null;
|
|
3310
|
-
if (e.fillType === "solid") return
|
|
3310
|
+
if (e.fillType === "solid") return en(e.color);
|
|
3311
3311
|
if (e.fillType === "gradient") {
|
|
3312
3312
|
let t = e.stops.map((e) => ({
|
|
3313
3313
|
p: Math.min(1, Math.max(0, e.position)),
|
|
3314
|
-
l:
|
|
3314
|
+
l: en(e.color)
|
|
3315
3315
|
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
3316
3316
|
if (t.length === 0) return null;
|
|
3317
3317
|
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
@@ -3320,18 +3320,18 @@ function en(e) {
|
|
|
3320
3320
|
}
|
|
3321
3321
|
return null;
|
|
3322
3322
|
}
|
|
3323
|
-
function
|
|
3323
|
+
function nn(e) {
|
|
3324
3324
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3325
3325
|
}
|
|
3326
|
-
function
|
|
3327
|
-
let n =
|
|
3326
|
+
function rn(e, t) {
|
|
3327
|
+
let n = tn(e);
|
|
3328
3328
|
if (n === null || n >= .5) return null;
|
|
3329
|
-
let r =
|
|
3329
|
+
let r = en(t.replace(/^#/, ""));
|
|
3330
3330
|
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
3331
3331
|
}
|
|
3332
3332
|
//#endregion
|
|
3333
3333
|
//#region packages/pptx/src/tab-layout.ts
|
|
3334
|
-
function
|
|
3334
|
+
function an(e, t, n, r, i, a = 0) {
|
|
3335
3335
|
let o = e.map((e) => e.width), s = (t) => {
|
|
3336
3336
|
let n = 0;
|
|
3337
3337
|
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
@@ -3359,8 +3359,8 @@ function rn(e, t, n, r, i, a = 0) {
|
|
|
3359
3359
|
}
|
|
3360
3360
|
//#endregion
|
|
3361
3361
|
//#region packages/pptx/src/vertical-text.ts
|
|
3362
|
-
var
|
|
3363
|
-
function
|
|
3362
|
+
var on = () => !1;
|
|
3363
|
+
function sn(e, t, n) {
|
|
3364
3364
|
let r = e.textBaseline;
|
|
3365
3365
|
e.textBaseline = "alphabetic";
|
|
3366
3366
|
let i = e.measureText(t);
|
|
@@ -3368,7 +3368,7 @@ function on(e, t, n) {
|
|
|
3368
3368
|
let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
|
|
3369
3369
|
return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
|
|
3370
3370
|
}
|
|
3371
|
-
function
|
|
3371
|
+
function cn(e, t) {
|
|
3372
3372
|
let n = e.textAlign, r = e.textBaseline;
|
|
3373
3373
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
3374
3374
|
let i = e.measureText(t);
|
|
@@ -3376,15 +3376,15 @@ function sn(e, t) {
|
|
|
3376
3376
|
let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
|
|
3377
3377
|
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
3378
3378
|
}
|
|
3379
|
-
function
|
|
3380
|
-
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r -
|
|
3379
|
+
function ln(e, t, n, r, i, a, o = "fill", s = on) {
|
|
3380
|
+
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - sn(e, t, i), f = 0;
|
|
3381
3381
|
for (let o of t) {
|
|
3382
|
-
let t = o.codePointAt(0) ?? 0, l = A(t), p = e.measureText(o).width + a, m = l === "Tr" ?
|
|
3382
|
+
let t = o.codePointAt(0) ?? 0, l = A(t), p = e.measureText(o).width + a, m = l === "Tr" ? W(t) : null, h = l === "Tr" && m === null && L(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3383
3383
|
if (B(t) && s(t)) {
|
|
3384
3384
|
let t = n + f + p / 2;
|
|
3385
3385
|
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", D(e, () => u(o, 0, 0)), e.restore();
|
|
3386
3386
|
} else if (g) {
|
|
3387
|
-
let r = m === null && l === "Tu" ? k(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ?
|
|
3387
|
+
let r = m === null && l === "Tu" ? k(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? cn(e, s) / i : 0;
|
|
3388
3388
|
e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
|
|
3389
3389
|
} else if (l === "Tr") {
|
|
3390
3390
|
let t = n + f + p / 2;
|
|
@@ -3394,30 +3394,30 @@ function cn(e, t, n, r, i, a, o = "fill", s = an) {
|
|
|
3394
3394
|
}
|
|
3395
3395
|
e.textAlign = c, e.textBaseline = l;
|
|
3396
3396
|
}
|
|
3397
|
-
function
|
|
3398
|
-
|
|
3397
|
+
function un(e, t, n, r, i, a, o = "fill") {
|
|
3398
|
+
ln(e, t, n, r, i, a, o, (t) => ee(e, t));
|
|
3399
3399
|
}
|
|
3400
3400
|
//#endregion
|
|
3401
3401
|
//#region packages/pptx/src/renderer.ts
|
|
3402
|
-
function
|
|
3402
|
+
function Y(e, t) {
|
|
3403
3403
|
return e * t;
|
|
3404
3404
|
}
|
|
3405
|
-
var
|
|
3406
|
-
function
|
|
3407
|
-
let { top: s, height: c } =
|
|
3405
|
+
var X = _e;
|
|
3406
|
+
function dn(e, t, n, r, i, a, o) {
|
|
3407
|
+
let { top: s, height: c } = Lt(n, i);
|
|
3408
3408
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3409
3409
|
}
|
|
3410
|
-
function
|
|
3411
|
-
return
|
|
3410
|
+
function fn(e, t, n, r, i, a, o = 0) {
|
|
3411
|
+
return Te(e, t, n, r, i, a, o);
|
|
3412
3412
|
}
|
|
3413
|
-
var
|
|
3414
|
-
function
|
|
3413
|
+
var pn = /* @__PURE__ */ new WeakMap();
|
|
3414
|
+
function mn(e, t) {
|
|
3415
3415
|
let n = e.tinted.get(t);
|
|
3416
3416
|
if (n) return n;
|
|
3417
3417
|
let r = E(e.raster, t);
|
|
3418
3418
|
return e.tinted.set(t, r), r;
|
|
3419
3419
|
}
|
|
3420
|
-
function
|
|
3420
|
+
function hn(e) {
|
|
3421
3421
|
let t = [], n = (e) => {
|
|
3422
3422
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3423
3423
|
nodes: e.nodes,
|
|
@@ -3428,13 +3428,13 @@ function mn(e) {
|
|
|
3428
3428
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3429
3429
|
return t;
|
|
3430
3430
|
}
|
|
3431
|
-
async function
|
|
3432
|
-
let n =
|
|
3431
|
+
async function gn(e, t) {
|
|
3432
|
+
let n = hn(e);
|
|
3433
3433
|
if (n.length !== 0) {
|
|
3434
3434
|
await t.loadMathJax();
|
|
3435
|
-
for (let e of n) if (!
|
|
3436
|
-
let n = await t.mathMLToSvg(
|
|
3437
|
-
|
|
3435
|
+
for (let e of n) if (!pn.has(e.nodes)) try {
|
|
3436
|
+
let n = await t.mathMLToSvg(te(e.nodes, e.display)), r = await M(n, "#000000");
|
|
3437
|
+
pn.set(e.nodes, {
|
|
3438
3438
|
raster: r,
|
|
3439
3439
|
widthEm: n.widthEm,
|
|
3440
3440
|
ascentEm: n.ascentEm,
|
|
@@ -3444,10 +3444,10 @@ async function hn(e, t) {
|
|
|
3444
3444
|
} catch {}
|
|
3445
3445
|
}
|
|
3446
3446
|
}
|
|
3447
|
-
function
|
|
3447
|
+
function _n(e, t) {
|
|
3448
3448
|
return e ? e.startsWith("+") ? e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif" : e.split(",")[0].trim() || (t.themeMinorFont ?? "sans-serif") : t.themeMinorFont ?? "sans-serif";
|
|
3449
3449
|
}
|
|
3450
|
-
var
|
|
3450
|
+
var vn = new Set([
|
|
3451
3451
|
"serif",
|
|
3452
3452
|
"sans-serif",
|
|
3453
3453
|
"monospace",
|
|
@@ -3455,11 +3455,11 @@ var _n = new Set([
|
|
|
3455
3455
|
"fantasy",
|
|
3456
3456
|
"system-ui"
|
|
3457
3457
|
]);
|
|
3458
|
-
function
|
|
3458
|
+
function yn(e) {
|
|
3459
3459
|
let t = s(e);
|
|
3460
3460
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3461
3461
|
}
|
|
3462
|
-
var
|
|
3462
|
+
var bn = {
|
|
3463
3463
|
calibri: "Carlito",
|
|
3464
3464
|
"calibri light": "Carlito",
|
|
3465
3465
|
cambria: "Caladea",
|
|
@@ -3471,38 +3471,38 @@ var yn = {
|
|
|
3471
3471
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3472
3472
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3473
3473
|
"univers next arabic": "Noto Sans Arabic"
|
|
3474
|
-
},
|
|
3475
|
-
function
|
|
3476
|
-
if (
|
|
3474
|
+
}, xn = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3475
|
+
function Sn(e) {
|
|
3476
|
+
if (bn[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3477
3477
|
let t = e.toLowerCase();
|
|
3478
3478
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3479
3479
|
}
|
|
3480
|
-
function
|
|
3480
|
+
function Cn(e) {
|
|
3481
3481
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3482
3482
|
}
|
|
3483
|
-
function
|
|
3484
|
-
let t =
|
|
3485
|
-
if (
|
|
3483
|
+
function wn(e) {
|
|
3484
|
+
let t = yn(e), r = bn[e.toLowerCase()], i = r ? `"${r}", ` : "";
|
|
3485
|
+
if (Sn(e)) return `"${e}", ${i}${xn}, ${t}`;
|
|
3486
3486
|
let a = t === "serif" ? "serif" : "sans", o = w(e);
|
|
3487
|
-
return `"${e}", ${i}${o ? `${
|
|
3487
|
+
return `"${e}", ${i}${o ? `${Cn(S(o, a))}, ` : ""}${`${Cn(a === "serif" ? C : n)}, `}${t}`;
|
|
3488
3488
|
}
|
|
3489
|
-
function
|
|
3489
|
+
function Tn(e) {
|
|
3490
3490
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3491
3491
|
}
|
|
3492
|
-
function
|
|
3492
|
+
function En(e) {
|
|
3493
3493
|
let t = e.toLowerCase();
|
|
3494
3494
|
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;
|
|
3495
3495
|
}
|
|
3496
|
-
function
|
|
3497
|
-
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 =
|
|
3496
|
+
function Dn(e, t, n, r, i, a, o, s) {
|
|
3497
|
+
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 = we(m, h), _ = g?.getContext("2d");
|
|
3498
3498
|
if (!g || !_) return;
|
|
3499
3499
|
_.save(), _.setTransform(a.a, a.b, a.c, a.d, a.e - u, a.f - d), t(_), _.restore();
|
|
3500
3500
|
let v = n.y - d, y = v + n.h, b = g, x = _;
|
|
3501
3501
|
if (c > 0) {
|
|
3502
|
-
let e =
|
|
3502
|
+
let e = we(m, h), t = e?.getContext("2d");
|
|
3503
3503
|
e && t && (b = e, x = t);
|
|
3504
3504
|
}
|
|
3505
|
-
b !== g &&
|
|
3505
|
+
b !== g && Vt(x, g, {
|
|
3506
3506
|
x: n.x - u,
|
|
3507
3507
|
y: v,
|
|
3508
3508
|
w: n.w,
|
|
@@ -3529,45 +3529,48 @@ function En(e, t, n, r, i, a, o, s) {
|
|
|
3529
3529
|
let T = r.dist * i, E = r.dir * Math.PI / 180, D = n.y + n.h;
|
|
3530
3530
|
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();
|
|
3531
3531
|
}
|
|
3532
|
-
function
|
|
3533
|
-
let a = t ? "italic " : "", o =
|
|
3534
|
-
return
|
|
3532
|
+
function Z(e, t, n, r, i) {
|
|
3533
|
+
let a = t ? "italic " : "", o = _n(r, i), s = En(o), c = e ? "bold " : s ? `${s} ` : "";
|
|
3534
|
+
return vn.has(o) ? `${a}${c}${n}px ${o}` : `${a}${c}${n}px ${wn(o)}`;
|
|
3535
3535
|
}
|
|
3536
3536
|
function On(e) {
|
|
3537
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3537
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || Le(e.bullet).type === "blip";
|
|
3538
3538
|
}
|
|
3539
3539
|
function kn(e, t) {
|
|
3540
3540
|
return e ? 0 : Math.max(0, t);
|
|
3541
3541
|
}
|
|
3542
|
-
function An(e, t
|
|
3543
|
-
|
|
3542
|
+
function An(e, t) {
|
|
3543
|
+
return t != null && t !== 0 ? e * .65 : e;
|
|
3544
|
+
}
|
|
3545
|
+
function jn(e, t, n, r, i, a, o) {
|
|
3546
|
+
let s = (t.defaultFontSize ?? 18) * J * a;
|
|
3544
3547
|
for (let c of t.paragraphs) {
|
|
3545
|
-
let l =
|
|
3548
|
+
let l = Y(c.marL, a), u = Y(c.marR, a), d = Y(c.indent, a), f = kn(On(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3546
3549
|
for (let n of c.runs) {
|
|
3547
3550
|
if (n.type !== "text") continue;
|
|
3548
|
-
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize *
|
|
3549
|
-
e.font =
|
|
3550
|
-
let l = (n.letterSpacing ?? 0) *
|
|
3551
|
+
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * J * a : n.fontSize * J * a, i = _n(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3552
|
+
e.font = Z(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, An(r, n.baseline ?? void 0), i, o);
|
|
3553
|
+
let l = (n.letterSpacing ?? 0) * J * a;
|
|
3551
3554
|
if (m += Q(e, n.text, l), m > p) return !0;
|
|
3552
3555
|
}
|
|
3553
3556
|
}
|
|
3554
3557
|
return !1;
|
|
3555
3558
|
}
|
|
3556
|
-
function
|
|
3557
|
-
for (let t of e) if (
|
|
3559
|
+
function Mn(e) {
|
|
3560
|
+
for (let t of e) if (G(t.codePointAt(0) ?? 0)) return !0;
|
|
3558
3561
|
return !1;
|
|
3559
3562
|
}
|
|
3560
|
-
function
|
|
3563
|
+
function Nn(e) {
|
|
3561
3564
|
let t = 0;
|
|
3562
3565
|
for (let n of e) t++;
|
|
3563
3566
|
return t;
|
|
3564
3567
|
}
|
|
3565
|
-
var
|
|
3566
|
-
function
|
|
3567
|
-
let t =
|
|
3568
|
+
var Pn = /* @__PURE__ */ new WeakMap();
|
|
3569
|
+
function Fn(e) {
|
|
3570
|
+
let t = Pn.get(e);
|
|
3568
3571
|
if (t != null) return t;
|
|
3569
3572
|
let n = e, r = n.letterSpacing;
|
|
3570
|
-
if (typeof r != "string") return
|
|
3573
|
+
if (typeof r != "string") return Pn.set(e, !1), !1;
|
|
3571
3574
|
let i = !1;
|
|
3572
3575
|
try {
|
|
3573
3576
|
n.letterSpacing = "0px";
|
|
@@ -3582,11 +3585,11 @@ function Pn(e) {
|
|
|
3582
3585
|
n.letterSpacing = r;
|
|
3583
3586
|
} catch {}
|
|
3584
3587
|
}
|
|
3585
|
-
return
|
|
3588
|
+
return Pn.set(e, i), i;
|
|
3586
3589
|
}
|
|
3587
3590
|
function Q(e, t, n) {
|
|
3588
3591
|
let r = e, i = r.letterSpacing;
|
|
3589
|
-
if (n !== 0 &&
|
|
3592
|
+
if (n !== 0 && Fn(e)) try {
|
|
3590
3593
|
r.letterSpacing = `${n}px`;
|
|
3591
3594
|
let i = e.measureText(t).width;
|
|
3592
3595
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -3595,10 +3598,10 @@ function Q(e, t, n) {
|
|
|
3595
3598
|
r.letterSpacing = i;
|
|
3596
3599
|
} catch {}
|
|
3597
3600
|
}
|
|
3598
|
-
let a = Math.max(0,
|
|
3601
|
+
let a = Math.max(0, Nn(t) - 1);
|
|
3599
3602
|
return e.measureText(t).width + n * a;
|
|
3600
3603
|
}
|
|
3601
|
-
function
|
|
3604
|
+
function In(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3602
3605
|
themeMajorFont: null,
|
|
3603
3606
|
themeMinorFont: null,
|
|
3604
3607
|
dpr: 1
|
|
@@ -3611,11 +3614,11 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3611
3614
|
let r = n.text.replace(/ +$/u, "");
|
|
3612
3615
|
r !== n.text && g.set(n, r), (r.length > 0 || n.fieldType != null) && (_ = !1);
|
|
3613
3616
|
}
|
|
3614
|
-
let v = () => n - (m.length === 0 ? p : 0), b = { segments: [] }, x = 0, S = !1, C = t.rtl === !0, w =
|
|
3615
|
-
pos:
|
|
3617
|
+
let v = () => n - (m.length === 0 ? p : 0), b = { segments: [] }, x = 0, S = !1, C = t.rtl === !0, w = Y(t.marR, o), E = (t.tabStops ?? []).map((e) => ({
|
|
3618
|
+
pos: Y(e.pos, o),
|
|
3616
3619
|
algn: e.algn
|
|
3617
|
-
})), D =
|
|
3618
|
-
let t =
|
|
3620
|
+
})), D = Y(t.defTabSz ?? 914400, o), O = !1, k = [], A = 0, M = () => C ? w : s + (m.length === 0 ? p : 0), P = (e = 0) => {
|
|
3621
|
+
let t = an(e > 0 ? [...k, {
|
|
3619
3622
|
isTab: !1,
|
|
3620
3623
|
width: e
|
|
3621
3624
|
}] : k, E, M(), Infinity, A, D), n = 0;
|
|
@@ -3644,18 +3647,19 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3644
3647
|
}, z = (t, n, r, i, a, o, s, c) => {
|
|
3645
3648
|
if (!t) return;
|
|
3646
3649
|
e.font = n;
|
|
3647
|
-
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, 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 ?? "") &&
|
|
3648
|
-
if (
|
|
3650
|
+
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, y = c?.hyperlink, S = c?.drawSizePx ?? r, C = (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 ?? "") && (e.drawSizePx ?? e.sizePx) === S && Tn(e.hyperlink) === Tn(y) && (l === 0 || e.sourceRunId === u), w = b.segments.at(-1), T = Q(e, t, l);
|
|
3651
|
+
if (w && C(w) ? T = Q(e, w.text + t, l) - Q(e, w.text, l) : w && !w.isTab && !w.math && u != null && w.sourceRunId === u && (T += l), x += T, k.push({
|
|
3649
3652
|
isTab: !1,
|
|
3650
|
-
width:
|
|
3651
|
-
}),
|
|
3653
|
+
width: T
|
|
3654
|
+
}), w && C(w)) w.text += t;
|
|
3652
3655
|
else {
|
|
3653
|
-
let e =
|
|
3656
|
+
let e = w && !w.isTab && !w.math && u != null && w.sourceRunId === u ? l : 0;
|
|
3654
3657
|
b.segments.push({
|
|
3655
3658
|
text: t,
|
|
3656
3659
|
font: n,
|
|
3657
3660
|
fontFamily: v,
|
|
3658
3661
|
sizePx: r,
|
|
3662
|
+
drawSizePx: S,
|
|
3659
3663
|
color: i,
|
|
3660
3664
|
underline: a,
|
|
3661
3665
|
underlineStyle: f,
|
|
@@ -3690,7 +3694,8 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3690
3694
|
outline: e.outline,
|
|
3691
3695
|
highlight: e.highlight,
|
|
3692
3696
|
fontFamily: e.fontFamily,
|
|
3693
|
-
sourceRunId: e.sourceRunId
|
|
3697
|
+
sourceRunId: e.sourceRunId,
|
|
3698
|
+
drawSizePx: e.drawSizePx
|
|
3694
3699
|
}), !0;
|
|
3695
3700
|
};
|
|
3696
3701
|
for (let [n, s] of t.runs.entries()) {
|
|
@@ -3699,7 +3704,7 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3699
3704
|
continue;
|
|
3700
3705
|
}
|
|
3701
3706
|
if (s.type === "math") {
|
|
3702
|
-
let e =
|
|
3707
|
+
let e = pn.get(s.nodes), t = s.fontSize == null ? i : s.fontSize * J * o * u, n = e ? e.widthEm * t : 0, r = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
|
|
3703
3708
|
(s.display && x > 0 || !F(n) && x > 0) && L(), k.push({
|
|
3704
3709
|
isTab: !1,
|
|
3705
3710
|
width: n
|
|
@@ -3707,7 +3712,7 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3707
3712
|
text: "",
|
|
3708
3713
|
font: `${t}px sans-serif`,
|
|
3709
3714
|
sizePx: t,
|
|
3710
|
-
color: s.color ?
|
|
3715
|
+
color: s.color ? X(s.color) : a,
|
|
3711
3716
|
underline: !1,
|
|
3712
3717
|
strikethrough: !1,
|
|
3713
3718
|
math: {
|
|
@@ -3720,36 +3725,37 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3720
3725
|
}), x += n, s.display && L();
|
|
3721
3726
|
continue;
|
|
3722
3727
|
}
|
|
3723
|
-
let p = s.fontSize == null ? i : s.fontSize *
|
|
3724
|
-
|
|
3725
|
-
let
|
|
3726
|
-
e.font =
|
|
3727
|
-
let
|
|
3728
|
-
(
|
|
3729
|
-
let
|
|
3730
|
-
strikeDouble:
|
|
3728
|
+
let p = s.fontSize == null ? i : s.fontSize * J * o * u, m = An(p, s.baseline ?? void 0), _ = _n(s.fontFamily ?? t.defFontFamily ?? null, f), C = s.fontFamilyEa ? _n(s.fontFamilyEa, f) : null, w = s.fontFamilySym ? _n(s.fontFamilySym, f) : null, E;
|
|
3729
|
+
E = s.color ? X(s.color) : s.hyperlink && f.themeHlinkColor ? X(f.themeHlinkColor) : a;
|
|
3730
|
+
let D = s.bold ?? t.defBold ?? c, M = s.italic ?? t.defItalic ?? l, P = Z(D, M, m, _, f), V = C ? Z(D, M, m, C, f) : P;
|
|
3731
|
+
e.font = P;
|
|
3732
|
+
let H = s.caps, U = g.get(s) ?? s.text;
|
|
3733
|
+
(H === "all" || H === "small") && (U = U.toUpperCase());
|
|
3734
|
+
let ee = s.fieldType === "slidenum" && d !== void 0 ? String(d) : U, W = s.underline || s.hyperlink !== void 0, te = s.strikeDouble === !0, K = s.letterSpacing == null ? 0 : s.letterSpacing * J * o, q = {
|
|
3735
|
+
strikeDouble: te,
|
|
3731
3736
|
letterSpacingPx: K,
|
|
3732
3737
|
underlineStyle: s.underlineStyle,
|
|
3733
|
-
underlineColor: s.underlineColor ?
|
|
3738
|
+
underlineColor: s.underlineColor ? X(s.underlineColor) : void 0,
|
|
3734
3739
|
shadow: s.shadow,
|
|
3735
3740
|
reflection: s.reflection,
|
|
3736
3741
|
outline: s.outline,
|
|
3737
|
-
fontFamily:
|
|
3738
|
-
highlight: s.highlight ?
|
|
3739
|
-
hyperlink:
|
|
3740
|
-
sourceRunId: n
|
|
3741
|
-
|
|
3742
|
-
|
|
3742
|
+
fontFamily: _,
|
|
3743
|
+
highlight: s.highlight ? X(s.highlight) : void 0,
|
|
3744
|
+
hyperlink: Ht(s.hyperlink),
|
|
3745
|
+
sourceRunId: n,
|
|
3746
|
+
drawSizePx: m
|
|
3747
|
+
}, re = ee.split(/(\s+)/);
|
|
3748
|
+
for (let i of re) {
|
|
3743
3749
|
if (!i) continue;
|
|
3744
3750
|
if (/^\t+$/.test(i)) {
|
|
3745
|
-
O || (e.font =
|
|
3751
|
+
O || (e.font = P, A = e.measureText(" ").width);
|
|
3746
3752
|
for (let e of i) b.segments.push({
|
|
3747
3753
|
text: "",
|
|
3748
3754
|
isTab: !0,
|
|
3749
|
-
font:
|
|
3750
|
-
fontFamily:
|
|
3755
|
+
font: P,
|
|
3756
|
+
fontFamily: _,
|
|
3751
3757
|
sizePx: p,
|
|
3752
|
-
color:
|
|
3758
|
+
color: E,
|
|
3753
3759
|
underline: !1,
|
|
3754
3760
|
strikethrough: !1
|
|
3755
3761
|
}), k.push({
|
|
@@ -3759,24 +3765,24 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3759
3765
|
O = !0;
|
|
3760
3766
|
continue;
|
|
3761
3767
|
}
|
|
3762
|
-
e.font =
|
|
3763
|
-
let a = R(i,
|
|
3764
|
-
if (c.test(i) && (
|
|
3765
|
-
let t =
|
|
3768
|
+
e.font = P;
|
|
3769
|
+
let a = R(i, P, K, n), o = /^\s+$/.test(i), c = /[-]/;
|
|
3770
|
+
if (c.test(i) && (w != null || he(_))) {
|
|
3771
|
+
let t = w ?? _;
|
|
3766
3772
|
for (let r of i) {
|
|
3767
|
-
let i = r, a =
|
|
3773
|
+
let i = r, a = P;
|
|
3768
3774
|
if (c.test(r)) {
|
|
3769
|
-
let e =
|
|
3770
|
-
e === r ? a =
|
|
3775
|
+
let e = se(r, t);
|
|
3776
|
+
e === r ? a = Z(D, M, m, t, f) : (i = e, a = Z(D, M, m, "sans-serif", f));
|
|
3771
3777
|
}
|
|
3772
|
-
e.font = a, !F(R(i, a, K, n)) && x > 0 && L(), z(i, a, p,
|
|
3778
|
+
e.font = a, !F(R(i, a, K, n)) && x > 0 && L(), z(i, a, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3773
3779
|
}
|
|
3774
3780
|
continue;
|
|
3775
3781
|
}
|
|
3776
|
-
if (
|
|
3782
|
+
if (Mn(i) && (!N(i) || t.eaLnBrk === !1)) {
|
|
3777
3783
|
let r = [];
|
|
3778
3784
|
for (let t of i) {
|
|
3779
|
-
let n =
|
|
3785
|
+
let n = G(t.codePointAt(0) ?? 0) && C != null, i = n ? V : P, a = n ? C : _;
|
|
3780
3786
|
e.font = i, r.push({
|
|
3781
3787
|
ch: t,
|
|
3782
3788
|
w: Q(e, t, 0),
|
|
@@ -3787,15 +3793,15 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3787
3793
|
if (t.eaLnBrk === !1) {
|
|
3788
3794
|
let e = b.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, i = r.reduce((e, t) => e + t.w, 0) + Math.max(0, r.length - 1) * K + (t && r.length > 0 ? K : 0);
|
|
3789
3795
|
x > 0 && !F(i) && L();
|
|
3790
|
-
for (let e of r) z(e.ch, e.font, p,
|
|
3791
|
-
...
|
|
3796
|
+
for (let e of r) z(e.ch, e.font, p, E, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3797
|
+
...q,
|
|
3792
3798
|
fontFamily: e.family
|
|
3793
3799
|
});
|
|
3794
3800
|
continue;
|
|
3795
3801
|
}
|
|
3796
3802
|
let a = r;
|
|
3797
3803
|
for (; a.length > 0;) {
|
|
3798
|
-
let e = Number.isFinite(v()) ? v() - I() : x, t = b.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i =
|
|
3804
|
+
let e = Number.isFinite(v()) ? v() - I() : x, t = b.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = Jt(a, e, v(), h, K, r);
|
|
3799
3805
|
if (i === 0) {
|
|
3800
3806
|
if (x > 0) {
|
|
3801
3807
|
L();
|
|
@@ -3805,8 +3811,8 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3805
3811
|
}
|
|
3806
3812
|
for (let e = 0; e < i; e++) {
|
|
3807
3813
|
let t = a[e];
|
|
3808
|
-
z(t.ch, t.font, p,
|
|
3809
|
-
...
|
|
3814
|
+
z(t.ch, t.font, p, E, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3815
|
+
...q,
|
|
3810
3816
|
fontFamily: t.family
|
|
3811
3817
|
});
|
|
3812
3818
|
}
|
|
@@ -3818,9 +3824,9 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3818
3824
|
let t = y(i, {
|
|
3819
3825
|
cjk: !0,
|
|
3820
3826
|
kinsoku: h
|
|
3821
|
-
}), r =
|
|
3827
|
+
}), r = C != null && V !== P, a = (e) => r && G(e.codePointAt(0) ?? 0), o = (t) => {
|
|
3822
3828
|
let r = 0, i = b.segments.at(-1), o = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
|
|
3823
|
-
s !== "" && (e.font = c ?
|
|
3829
|
+
s !== "" && (e.font = c ? V : P, r += Q(e, s, K), o && (r += K), o = !0, s = "");
|
|
3824
3830
|
};
|
|
3825
3831
|
for (let e of t) {
|
|
3826
3832
|
let t = a(e);
|
|
@@ -3830,9 +3836,9 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3830
3836
|
}, c = (e) => {
|
|
3831
3837
|
let t = "", n = null, r = () => {
|
|
3832
3838
|
if (t === "") return;
|
|
3833
|
-
let e = n ?
|
|
3834
|
-
z(t, e, p,
|
|
3835
|
-
...
|
|
3839
|
+
let e = n ? V : P, r = n ? C : _;
|
|
3840
|
+
z(t, e, p, E, W, s.strikethrough, s.baseline ?? void 0, {
|
|
3841
|
+
...q,
|
|
3836
3842
|
fontFamily: r
|
|
3837
3843
|
}), t = "";
|
|
3838
3844
|
};
|
|
@@ -3841,7 +3847,7 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3841
3847
|
n === null || e === n ? (t += i, n = e) : (r(), t = i, n = e);
|
|
3842
3848
|
}
|
|
3843
3849
|
r();
|
|
3844
|
-
}, l =
|
|
3850
|
+
}, l = ne(i), u = i.length, d = 0;
|
|
3845
3851
|
for (; d < u;) {
|
|
3846
3852
|
let e = I(), n = j(i, t, d, e, o, l);
|
|
3847
3853
|
if (n <= d) {
|
|
@@ -3856,44 +3862,44 @@ function Fn(e, t, n, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3856
3862
|
}
|
|
3857
3863
|
continue;
|
|
3858
3864
|
}
|
|
3859
|
-
if (F(a)) z(i,
|
|
3865
|
+
if (F(a)) z(i, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q), o && (S = !0);
|
|
3860
3866
|
else if (o) x > 0 && L();
|
|
3861
3867
|
else if (a > v()) {
|
|
3862
3868
|
x > 0 && L();
|
|
3863
|
-
for (let t of i) e.font =
|
|
3864
|
-
} else if (!S) z(i,
|
|
3869
|
+
for (let t of i) e.font = P, !F(R(t, P, K, n)) && x > 0 && L(), z(t, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3870
|
+
} else if (!S) z(i, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3865
3871
|
else {
|
|
3866
3872
|
let e = b.segments.at(-1)?.text ?? "", t = i.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(i) && n !== 8203 && t !== 8203, o = t !== void 0 && h.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !N(e) && !N(i) && r(n, t);
|
|
3867
|
-
(o || c) && B() || L(), z(i,
|
|
3873
|
+
(o || c) && B() || L(), z(i, P, p, E, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
3868
3874
|
}
|
|
3869
3875
|
}
|
|
3870
3876
|
}
|
|
3871
3877
|
return m.push(b), m;
|
|
3872
3878
|
}
|
|
3873
|
-
async function
|
|
3879
|
+
async function Ln(e, t, n, r, i, a, o) {
|
|
3874
3880
|
if (t && t.fillType === "image") {
|
|
3875
3881
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !o) return;
|
|
3876
3882
|
try {
|
|
3877
|
-
let s = await
|
|
3878
|
-
widthPt: n / i /
|
|
3879
|
-
heightPt: r / i /
|
|
3883
|
+
let s = await Ie(t.imagePath, t.mimeType, t.duotone, o, {
|
|
3884
|
+
widthPt: n / i / J,
|
|
3885
|
+
heightPt: r / i / J
|
|
3880
3886
|
});
|
|
3881
3887
|
if (a() || !s) return;
|
|
3882
|
-
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile)
|
|
3888
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) Bn(e, s, t.tile, n, r, i);
|
|
3883
3889
|
else {
|
|
3884
3890
|
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);
|
|
3885
3891
|
e.drawImage(s, u, d, f, p);
|
|
3886
3892
|
}
|
|
3887
3893
|
e.restore();
|
|
3888
3894
|
} catch (e) {
|
|
3889
|
-
if (
|
|
3895
|
+
if (Se(e)) throw e;
|
|
3890
3896
|
}
|
|
3891
3897
|
return;
|
|
3892
3898
|
}
|
|
3893
|
-
e.fillStyle =
|
|
3899
|
+
e.fillStyle = fn(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
3894
3900
|
}
|
|
3895
|
-
var
|
|
3896
|
-
function
|
|
3901
|
+
var Rn = 9525;
|
|
3902
|
+
function zn(e, t, n, r, i) {
|
|
3897
3903
|
let a;
|
|
3898
3904
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
3899
3905
|
let o;
|
|
@@ -3902,10 +3908,10 @@ function Rn(e, t, n, r, i) {
|
|
|
3902
3908
|
ay: o
|
|
3903
3909
|
};
|
|
3904
3910
|
}
|
|
3905
|
-
function
|
|
3906
|
-
let o = t.width *
|
|
3911
|
+
function Bn(e, t, n, r, i, a) {
|
|
3912
|
+
let o = t.width * Rn * (n.sx ?? 1) * a, s = t.height * Rn * (n.sy ?? 1) * a;
|
|
3907
3913
|
if (!(o > 0) || !(s > 0)) return;
|
|
3908
|
-
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u =
|
|
3914
|
+
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u = we(o * (c ? 2 : 1), s * (l ? 2 : 1));
|
|
3909
3915
|
if (!u) return;
|
|
3910
3916
|
let d = u.getContext("2d");
|
|
3911
3917
|
if (!d) return;
|
|
@@ -3915,33 +3921,33 @@ function zn(e, t, n, r, i, a) {
|
|
|
3915
3921
|
f(0, 0, !1, !1), c && f(o, 0, !0, !1), l && f(0, s, !1, !0), c && l && f(o, s, !0, !0);
|
|
3916
3922
|
let p = e.createPattern(u, "repeat");
|
|
3917
3923
|
if (!p) return;
|
|
3918
|
-
let { ax: m, ay: h } =
|
|
3924
|
+
let { ax: m, ay: h } = zn(n.algn ?? "tl", r, i, o, s), g = m + Y(n.tx ?? 0, a), _ = h + Y(n.ty ?? 0, a);
|
|
3919
3925
|
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());
|
|
3920
3926
|
}
|
|
3921
|
-
function
|
|
3927
|
+
function Vn(e, t, n) {
|
|
3922
3928
|
if (!t) return;
|
|
3923
|
-
let r = t.dir * Math.PI / 180, i =
|
|
3924
|
-
e.shadowColor =
|
|
3929
|
+
let r = t.dir * Math.PI / 180, i = Y(t.dist, n);
|
|
3930
|
+
e.shadowColor = X(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
3925
3931
|
}
|
|
3926
|
-
function
|
|
3927
|
-
t && (e.shadowColor =
|
|
3932
|
+
function Hn(e, t, n) {
|
|
3933
|
+
t && (e.shadowColor = X(t.color, t.alpha), e.shadowBlur = Y(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
3928
3934
|
}
|
|
3929
|
-
function
|
|
3935
|
+
function Un(e) {
|
|
3930
3936
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
3931
3937
|
}
|
|
3932
|
-
var
|
|
3933
|
-
function
|
|
3938
|
+
var Wn = 8, Gn = 1, Kn = 1, qn = 256;
|
|
3939
|
+
function Jn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
3934
3940
|
if (r <= 0) return;
|
|
3935
|
-
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(
|
|
3936
|
-
for (; w >
|
|
3937
|
-
let e = Math.min(
|
|
3941
|
+
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(qn, Math.max(1, Math.round(b / Wn))), S = (e) => Zn(e, a, r, o, s, c, u, d), C = S(x), w = $n(C, a, o, s, c, u, d, l, i, -g, _);
|
|
3942
|
+
for (; w > Kn && x < qn;) {
|
|
3943
|
+
let e = Math.min(qn, x * 2), t = S(e), n = $n(t, a, o, s, c, u, d, l, i, -g, _);
|
|
3938
3944
|
if (n >= w * .75) {
|
|
3939
3945
|
C = t;
|
|
3940
3946
|
break;
|
|
3941
3947
|
}
|
|
3942
3948
|
x = e, C = t, w = n;
|
|
3943
3949
|
}
|
|
3944
|
-
let T = 1e4, E =
|
|
3950
|
+
let T = 1e4, E = Gn / (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) => {
|
|
3945
3951
|
e.fillStyle = r;
|
|
3946
3952
|
for (let r = 0; r <= D; r++) {
|
|
3947
3953
|
let { s0: i, s1: a, g: o } = C[r], s = (i + a) / 2;
|
|
@@ -3949,7 +3955,7 @@ function qn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
3949
3955
|
let c = O(r, i, s), u = k(r, a, s);
|
|
3950
3956
|
e.rect(c, -T, u - c, 2 * T), e.clip(), e.fillText(t, -s + n / 2, 0), e.restore();
|
|
3951
3957
|
}
|
|
3952
|
-
}, j =
|
|
3958
|
+
}, j = Yn(m), M = typeof e.globalAlpha == "number" ? e.globalAlpha : 1;
|
|
3953
3959
|
if (j >= 1 && M >= 1) {
|
|
3954
3960
|
A(e, m);
|
|
3955
3961
|
return;
|
|
@@ -3969,67 +3975,67 @@ function qn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
|
3969
3975
|
[s, _],
|
|
3970
3976
|
[c, _]
|
|
3971
3977
|
]) {
|
|
3972
|
-
let n =
|
|
3978
|
+
let n = Qn(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;
|
|
3973
3979
|
o < P && (P = o), o > I && (I = o), s < F && (F = s), s > L && (L = s);
|
|
3974
3980
|
}
|
|
3975
3981
|
}
|
|
3976
3982
|
if (!(I > P && L > F)) return;
|
|
3977
|
-
let R = Math.floor(P - 2), z = Math.floor(F - 2), B =
|
|
3983
|
+
let R = Math.floor(P - 2), z = Math.floor(F - 2), B = we(Math.ceil(I + 2) - R, Math.ceil(L + 2) - z), V = B ? B.getContext("2d") : null;
|
|
3978
3984
|
if (!B || !V) {
|
|
3979
3985
|
A(e, m);
|
|
3980
3986
|
return;
|
|
3981
3987
|
}
|
|
3982
|
-
V.font = e.font, V.textAlign = "left", V.textBaseline = "alphabetic", V.setTransform(N.a, N.b, N.c, N.d, N.e - R, N.f - z), A(V,
|
|
3988
|
+
V.font = e.font, V.textAlign = "left", V.textBaseline = "alphabetic", V.setTransform(N.a, N.b, N.c, N.d, N.e - R, N.f - z), A(V, Xn(m)), e.save(), e.setTransform(1, 0, 0, 1, 0, 0), e.globalAlpha = M * j, e.drawImage(B, R, z), e.restore();
|
|
3983
3989
|
}
|
|
3984
|
-
function
|
|
3990
|
+
function Yn(e) {
|
|
3985
3991
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
3986
3992
|
if (!t) return 1;
|
|
3987
3993
|
let n = parseFloat(t[1]);
|
|
3988
3994
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
3989
3995
|
}
|
|
3990
|
-
function
|
|
3996
|
+
function Xn(e) {
|
|
3991
3997
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
3992
3998
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
3993
3999
|
}
|
|
3994
|
-
function
|
|
4000
|
+
function Zn(e, t, n, r, i, a, o, s) {
|
|
3995
4001
|
let c = Array(e);
|
|
3996
4002
|
for (let l = 0; l < e; l++) {
|
|
3997
4003
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
3998
4004
|
c[l] = {
|
|
3999
4005
|
s0: u,
|
|
4000
4006
|
s1: d,
|
|
4001
|
-
g:
|
|
4007
|
+
g: Ze(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4002
4008
|
};
|
|
4003
4009
|
}
|
|
4004
4010
|
return c;
|
|
4005
4011
|
}
|
|
4006
|
-
function
|
|
4012
|
+
function Qn(e, t, n, r) {
|
|
4007
4013
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4008
4014
|
return {
|
|
4009
4015
|
x: e.x + s * o - c * a,
|
|
4010
4016
|
y: e.y + c * o + s * a
|
|
4011
4017
|
};
|
|
4012
4018
|
}
|
|
4013
|
-
function
|
|
4019
|
+
function $n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4014
4020
|
let d = 0;
|
|
4015
4021
|
for (let f of e) {
|
|
4016
4022
|
let e = (f.s0 + f.s1) / 2;
|
|
4017
4023
|
for (let p of [f.s0, f.s1]) {
|
|
4018
|
-
let m =
|
|
4024
|
+
let m = Ze(t, (n + p) / r * i, a, o);
|
|
4019
4025
|
for (let t of [l, u]) {
|
|
4020
|
-
let n =
|
|
4026
|
+
let n = Qn(m, s, 0, t), r = Qn(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4021
4027
|
i > d && (d = i);
|
|
4022
4028
|
}
|
|
4023
4029
|
}
|
|
4024
4030
|
}
|
|
4025
4031
|
return d;
|
|
4026
4032
|
}
|
|
4027
|
-
function
|
|
4028
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h =
|
|
4033
|
+
function er(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4034
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = qe(n, r, p, m);
|
|
4029
4035
|
if (!h) return;
|
|
4030
|
-
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) *
|
|
4036
|
+
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * J * c, y = [];
|
|
4031
4037
|
for (let n of t.paragraphs) {
|
|
4032
|
-
let t =
|
|
4038
|
+
let t = In(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * J * c, n.defColor ? X(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4033
4039
|
for (let e of t) y.push(e);
|
|
4034
4040
|
}
|
|
4035
4041
|
if (y.length === 0) return;
|
|
@@ -4048,10 +4054,10 @@ function $n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4048
4054
|
}
|
|
4049
4055
|
e.font = t.font;
|
|
4050
4056
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4051
|
-
a += r.width + n *
|
|
4057
|
+
a += r.width + n * Nn(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));
|
|
4052
4058
|
}
|
|
4053
4059
|
if (a <= 0) continue;
|
|
4054
|
-
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 =
|
|
4060
|
+
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 = Xe(h, a), b = 0;
|
|
4055
4061
|
for (let t of n.segments) {
|
|
4056
4062
|
if (t.math) {
|
|
4057
4063
|
b += t.math.width;
|
|
@@ -4062,17 +4068,17 @@ function $n(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4062
4068
|
for (let s of o) {
|
|
4063
4069
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4064
4070
|
if (!h.singleEdge && o > 0) {
|
|
4065
|
-
|
|
4071
|
+
Jn(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
|
|
4066
4072
|
continue;
|
|
4067
4073
|
}
|
|
4068
|
-
let l =
|
|
4074
|
+
let l = Ze(h, (b + o / 2) / a * v, _, c);
|
|
4069
4075
|
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;
|
|
4070
4076
|
}
|
|
4071
4077
|
}
|
|
4072
4078
|
}
|
|
4073
4079
|
e.restore();
|
|
4074
4080
|
}
|
|
4075
|
-
function
|
|
4081
|
+
function tr(e, t, n, r, i, a, o) {
|
|
4076
4082
|
let s = Math.min(r, i);
|
|
4077
4083
|
switch (e) {
|
|
4078
4084
|
case "rightarrow":
|
|
@@ -4102,17 +4108,17 @@ function er(e, t, n, r, i, a, o) {
|
|
|
4102
4108
|
default: return null;
|
|
4103
4109
|
}
|
|
4104
4110
|
}
|
|
4105
|
-
function
|
|
4106
|
-
return e.defaultTextColor ?
|
|
4111
|
+
function nr(e, t) {
|
|
4112
|
+
return e.defaultTextColor ? X(e.defaultTextColor) : t.smartArtFallbackTextColor != null && nn(e) ? t.smartArtFallbackTextColor : null;
|
|
4107
4113
|
}
|
|
4108
|
-
function
|
|
4114
|
+
function rr(e, t, n) {
|
|
4109
4115
|
return {
|
|
4110
4116
|
outerRotation: e,
|
|
4111
4117
|
localFlipH: t,
|
|
4112
4118
|
localFlipV: n
|
|
4113
4119
|
};
|
|
4114
4120
|
}
|
|
4115
|
-
function
|
|
4121
|
+
function ir(e, t, n, r, i) {
|
|
4116
4122
|
let a = [
|
|
4117
4123
|
{
|
|
4118
4124
|
x: t,
|
|
@@ -4141,7 +4147,7 @@ function rr(e, t, n, r, i) {
|
|
|
4141
4147
|
h: l - s
|
|
4142
4148
|
};
|
|
4143
4149
|
}
|
|
4144
|
-
var
|
|
4150
|
+
var ar = {
|
|
4145
4151
|
tl: [0, 0],
|
|
4146
4152
|
t: [.5, 0],
|
|
4147
4153
|
tr: [1, 0],
|
|
@@ -4152,15 +4158,15 @@ var ir = {
|
|
|
4152
4158
|
b: [.5, 1],
|
|
4153
4159
|
br: [1, 1]
|
|
4154
4160
|
};
|
|
4155
|
-
function
|
|
4161
|
+
function or(e, t, n) {
|
|
4156
4162
|
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
4157
4163
|
}
|
|
4158
|
-
function
|
|
4159
|
-
let [o, s] =
|
|
4160
|
-
return
|
|
4164
|
+
function sr(e, t, n, r, i, a) {
|
|
4165
|
+
let [o, s] = ar[a ?? "b"];
|
|
4166
|
+
return or(e, t + o * r, n + s * i);
|
|
4161
4167
|
}
|
|
4162
|
-
function
|
|
4163
|
-
let c =
|
|
4168
|
+
function cr(e, t, n, r, i, a, o, s) {
|
|
4169
|
+
let c = st(e, i, a).corners, l = (o > 0 ? Pe(c, o / i, o / a) ?? c : c).map((e) => or(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, _] = ar[s ?? "b"], v = je(c, g, _);
|
|
4164
4170
|
return {
|
|
4165
4171
|
bbox: {
|
|
4166
4172
|
x: f,
|
|
@@ -4168,15 +4174,15 @@ function sr(e, t, n, r, i, a, o, s) {
|
|
|
4168
4174
|
w: m - f,
|
|
4169
4175
|
h: h - p
|
|
4170
4176
|
},
|
|
4171
|
-
anchor: v ?
|
|
4177
|
+
anchor: v ? or(t, n + v.x, r + v.y) : sr(t, n, r, i, a, s)
|
|
4172
4178
|
};
|
|
4173
4179
|
}
|
|
4174
|
-
function
|
|
4180
|
+
function lr(e, t, n, r) {
|
|
4175
4181
|
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);
|
|
4176
|
-
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) ||
|
|
4182
|
+
if (r && (i + o <= 0 || a + s <= 0 || i >= r.w || a >= r.h) || Ae(o, s).clamped) return e;
|
|
4177
4183
|
let c = null;
|
|
4178
4184
|
try {
|
|
4179
|
-
c =
|
|
4185
|
+
c = we(o, s);
|
|
4180
4186
|
} catch {
|
|
4181
4187
|
return e;
|
|
4182
4188
|
}
|
|
@@ -4195,7 +4201,7 @@ function cr(e, t, n, r) {
|
|
|
4195
4201
|
e.save(), e.setTransform(u), e.drawImage(c, i, a), e.restore();
|
|
4196
4202
|
};
|
|
4197
4203
|
}
|
|
4198
|
-
function
|
|
4204
|
+
function ur(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
4199
4205
|
let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
|
|
4200
4206
|
a: 1,
|
|
4201
4207
|
b: 0,
|
|
@@ -4210,32 +4216,32 @@ function lr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
|
4210
4216
|
}, v = (e) => {
|
|
4211
4217
|
h(e), u(e);
|
|
4212
4218
|
}, y = !1;
|
|
4213
|
-
t.shadow && p ? (e.save(), e.setTransform(m), y = !
|
|
4219
|
+
t.shadow && p ? (e.save(), e.setTransform(m), y = !Ne(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), Oe(e, g, i, t.reflection, s, d, f), e.restore()), y ? Vn(e, t.shadow ?? null, o) : t.glow && Hn(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), ke(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && Un(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), Me(e, v, i, t.innerShadow, s, d, f), e.restore());
|
|
4214
4220
|
}
|
|
4215
|
-
function
|
|
4221
|
+
function dr(e, t, n, r = "#000000", i, a = {
|
|
4216
4222
|
themeMajorFont: null,
|
|
4217
4223
|
themeMinorFont: null,
|
|
4218
4224
|
dpr: 1
|
|
4219
4225
|
}, s, c) {
|
|
4220
|
-
let u =
|
|
4226
|
+
let u = Y(t.x, n), f = Y(t.y, n), p = Y(t.width, n), m = Y(t.height, n), h = s && t.id !== void 0 ? (e) => s({
|
|
4221
4227
|
...e,
|
|
4222
4228
|
shapeId: t.id
|
|
4223
4229
|
}) : s;
|
|
4224
4230
|
if (m === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4225
|
-
if (t.stroke && (e.save(),
|
|
4231
|
+
if (t.stroke && (e.save(), Or(e, t.stroke, n, {
|
|
4226
4232
|
x: u,
|
|
4227
4233
|
y: f,
|
|
4228
4234
|
w: p,
|
|
4229
4235
|
h: 1
|
|
4230
4236
|
}, t.rotation), e.beginPath(), e.moveTo(u, f), e.lineTo(u + p, f), e.stroke(), e.restore()), t.textBody) {
|
|
4231
|
-
let o =
|
|
4232
|
-
|
|
4237
|
+
let o = nr(t, a);
|
|
4238
|
+
_r(e, t.textBody, u, f, p, m, n, o, t.rotation, t.flipH, t.flipV, r, i, a, h, !1, c);
|
|
4233
4239
|
}
|
|
4234
4240
|
return;
|
|
4235
4241
|
}
|
|
4236
|
-
let g = t.scene3d &&
|
|
4242
|
+
let g = t.scene3d && ct(t.scene3d.camera) ? t.scene3d : null;
|
|
4237
4243
|
if (g && p > 0 && m > 0) {
|
|
4238
|
-
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), c = s > 0 ? Math.sqrt(s) : 1, l =
|
|
4244
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), c = s > 0 ? Math.sqrt(s) : 1, l = vr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, c), d = yr(t.sp3d, g.camera, p, m, n, c), h = rr(t.rotation, t.flipH, t.flipV);
|
|
4239
4245
|
e.save(), h.outerRotation !== 0 && (e.translate(u + p / 2, f + m / 2), e.rotate(h.outerRotation * Math.PI / 180), e.translate(-(u + p / 2), -(f + m / 2)));
|
|
4240
4246
|
let _ = {
|
|
4241
4247
|
...t,
|
|
@@ -4258,21 +4264,21 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4258
4264
|
..._,
|
|
4259
4265
|
fill: null,
|
|
4260
4266
|
stroke: null
|
|
4261
|
-
}, b = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (d ? Math.hypot(d.offsetX, d.offsetY) / c : 0) + 2, x = (e, t, o) =>
|
|
4262
|
-
|
|
4267
|
+
}, b = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (d ? Math.hypot(d.offsetX, d.offsetY) / c : 0) + 2, x = (e, t, o) => br(e, g.camera, u, f, p, m, (e) => {
|
|
4268
|
+
dr(e, t, n, r, i, a, void 0);
|
|
4263
4269
|
}, o ? {
|
|
4264
4270
|
bevels: l,
|
|
4265
4271
|
extrusion: d ?? void 0,
|
|
4266
4272
|
edgePadCss: b
|
|
4267
4273
|
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4268
4274
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4269
|
-
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o =
|
|
4275
|
+
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o = cr(g.camera, r, u, f, p, m, b, t.shadow?.algn), s = !1, c = lr((e) => {
|
|
4270
4276
|
s = S(e) || s;
|
|
4271
4277
|
}, r, o.bbox, {
|
|
4272
4278
|
w: e.canvas.width || 0,
|
|
4273
4279
|
h: e.canvas.height || 0
|
|
4274
4280
|
});
|
|
4275
|
-
if (
|
|
4281
|
+
if (ur(e, t, c, c, o.bbox, o.anchor, n, n * a, r, !!t.fill), s) {
|
|
4276
4282
|
C(e), e.restore();
|
|
4277
4283
|
return;
|
|
4278
4284
|
}
|
|
@@ -4283,8 +4289,8 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4283
4289
|
e.restore();
|
|
4284
4290
|
}
|
|
4285
4291
|
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(u + 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(-(u + p / 2), -(f + m / 2)));
|
|
4286
|
-
let v = t.geometry.toLowerCase(), y =
|
|
4287
|
-
t.shadow ||
|
|
4292
|
+
let v = t.geometry.toLowerCase(), y = fn(t.fill, e, u, f, p, m, t.rotation);
|
|
4293
|
+
t.shadow || Hn(e, t.glow ?? null, n);
|
|
4288
4294
|
let b = new Set([
|
|
4289
4295
|
"line",
|
|
4290
4296
|
"straightconnector1",
|
|
@@ -4315,14 +4321,14 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4315
4321
|
w: p,
|
|
4316
4322
|
h: m
|
|
4317
4323
|
}) => {
|
|
4318
|
-
let { x: o, y: s, w: c, h: l } = a, h = i ?? (r === e && o === u && s === f && c === p && l === m ? y :
|
|
4319
|
-
|
|
4324
|
+
let { x: o, y: s, w: c, h: l } = a, h = i ?? (r === e && o === u && s === f && c === p && l === m ? y : fn(t.fill, r, o, s, c, l, t.rotation)), g = i ? null : t.stroke ? () => {
|
|
4325
|
+
Or(r, t.stroke, n, {
|
|
4320
4326
|
x: o,
|
|
4321
4327
|
y: s,
|
|
4322
4328
|
w: c,
|
|
4323
4329
|
h: l
|
|
4324
4330
|
}, t.rotation), r.stroke();
|
|
4325
|
-
} : null, _ = () =>
|
|
4331
|
+
} : null, _ = () => Un(r);
|
|
4326
4332
|
if (C && !i) {
|
|
4327
4333
|
d(r, v, o, s, c, l, [
|
|
4328
4334
|
t.adj,
|
|
@@ -4336,7 +4342,7 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4336
4342
|
], h, g, _, S(v) ? { skipTrailingStroke: !0 } : void 0);
|
|
4337
4343
|
return;
|
|
4338
4344
|
}
|
|
4339
|
-
r.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4345
|
+
r.beginPath(), t.custGeom && t.custGeom.length > 0 ? fr(r, t.custGeom, o, s, c, l) : de(r, v, o, s, c, l, t.adj, t.adj2, t.adj3, t.adj4), h && v !== "arc" && (r.fillStyle = h, v === "donut" || v === "smileyface" || v === "frame" ? r.fill("evenodd") : r.fill(), i || _()), g && g();
|
|
4340
4346
|
}, 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 ? C ? o(v, u, f, p, m, [
|
|
4341
4347
|
t.adj,
|
|
4342
4348
|
t.adj2,
|
|
@@ -4346,18 +4352,18 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4346
4352
|
t.adj6,
|
|
4347
4353
|
t.adj7,
|
|
4348
4354
|
t.adj8
|
|
4349
|
-
]) : t.custGeom && t.custGeom.length > 0 ?
|
|
4355
|
+
]) : t.custGeom && t.custGeom.length > 0 ? le(t.custGeom, u, f, p, m) : null : null) ?? {
|
|
4350
4356
|
x: u,
|
|
4351
4357
|
y: f,
|
|
4352
4358
|
w: p,
|
|
4353
4359
|
h: m
|
|
4354
|
-
}, k = t.stroke ? t.stroke.width * n / 2 : 0, A = t.stroke ? Math.max(t.stroke.headEnd ?
|
|
4360
|
+
}, k = t.stroke ? t.stroke.width * n / 2 : 0, A = t.stroke ? Math.max(t.stroke.headEnd ? fe(t.stroke.headEnd, t.stroke, n) : 0, t.stroke.tailEnd ? fe(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 ? {
|
|
4355
4361
|
x: O.x - M,
|
|
4356
4362
|
y: O.y - M,
|
|
4357
4363
|
w: O.w + M * 2,
|
|
4358
4364
|
h: O.h + M * 2
|
|
4359
|
-
} : O, P =
|
|
4360
|
-
let r = t.stroke?.fill ?
|
|
4365
|
+
} : O, P = ir(T, N.x, N.y, N.w, N.h), F = n * D, I = g ? [] : vr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, D), L = (t.stroke ? t.stroke.width * n / 2 : 0) + 2, R = (e) => {
|
|
4366
|
+
let r = t.stroke?.fill ? fn(t.stroke.fill, e, u, f, p, m, t.rotation) ?? void 0 : void 0;
|
|
4361
4367
|
if (t.stroke && (b.has(v) || x.has(v))) {
|
|
4362
4368
|
let i = _(v, u, f, p, m, [
|
|
4363
4369
|
t.adj,
|
|
@@ -4377,14 +4383,14 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4377
4383
|
y: e.y
|
|
4378
4384
|
}));
|
|
4379
4385
|
if (t.stroke.tailEnd) {
|
|
4380
|
-
let e =
|
|
4381
|
-
r[r.length - 1] =
|
|
4386
|
+
let e = ce(t.stroke.tailEnd, t.stroke, n);
|
|
4387
|
+
r[r.length - 1] = ae(r[r.length - 1], r[r.length - 2], e);
|
|
4382
4388
|
}
|
|
4383
4389
|
if (t.stroke.headEnd) {
|
|
4384
|
-
let e =
|
|
4385
|
-
r[0] =
|
|
4390
|
+
let e = ce(t.stroke.headEnd, t.stroke, n);
|
|
4391
|
+
r[0] = ae(r[0], r[1], e);
|
|
4386
4392
|
}
|
|
4387
|
-
|
|
4393
|
+
Or(e, t.stroke, n, {
|
|
4388
4394
|
x: u,
|
|
4389
4395
|
y: f,
|
|
4390
4396
|
w: p,
|
|
@@ -4393,46 +4399,46 @@ function ur(e, t, n, r = "#000000", i, a = {
|
|
|
4393
4399
|
for (let t = 1; t < r.length; t++) e.lineTo(r[t].x, r[t].y);
|
|
4394
4400
|
e.stroke();
|
|
4395
4401
|
}
|
|
4396
|
-
a && o &&
|
|
4402
|
+
a && o && Dr(e, i.start, i.end, t.stroke, a, n, t.rotation), t.stroke.tailEnd && ue(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, n, r), t.stroke.headEnd && ue(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, n, r);
|
|
4397
4403
|
return;
|
|
4398
4404
|
}
|
|
4399
4405
|
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;
|
|
4400
|
-
let { start: i, end: a } =
|
|
4401
|
-
i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" &&
|
|
4406
|
+
let { start: i, end: a } = pe(t.custGeom);
|
|
4407
|
+
i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ue(e, u + i.x * p, f + i.y * m, Math.atan2(i.dy * m, i.dx * p), t.stroke.headEnd, t.stroke, n, r), a && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ue(e, u + a.x * p, f + a.y * m, Math.atan2(a.dy * m, a.dx * p), t.stroke.tailEnd, t.stroke, n, r);
|
|
4402
4408
|
}, z = (e) => {
|
|
4403
|
-
if (I.length > 0 &&
|
|
4409
|
+
if (I.length > 0 && xr(e, u, f, p, m, I, (e, t, n, r, i) => w(e, void 0, {
|
|
4404
4410
|
x: t,
|
|
4405
4411
|
y: n,
|
|
4406
4412
|
w: r,
|
|
4407
4413
|
h: i
|
|
4408
4414
|
}), void 0, L)) {
|
|
4409
|
-
R(e),
|
|
4415
|
+
R(e), Un(e);
|
|
4410
4416
|
return;
|
|
4411
4417
|
}
|
|
4412
4418
|
w(e), R(e);
|
|
4413
4419
|
};
|
|
4414
|
-
if (
|
|
4415
|
-
let o =
|
|
4420
|
+
if (ur(e, t, z, z, P, sr(T, u, f, p, m, t.shadow?.algn), n, F, T, !!y, (e) => w(e, "#000")), t.textBody) {
|
|
4421
|
+
let o = nr(t, a);
|
|
4416
4422
|
if (e.save(), t.flipH || t.flipV) {
|
|
4417
4423
|
let n = u + p / 2, r = f + m / 2;
|
|
4418
4424
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4419
4425
|
}
|
|
4420
4426
|
let s = u, l = f, d = p, g = m;
|
|
4421
|
-
if (t.textRect) s =
|
|
4427
|
+
if (t.textRect) s = Y(t.textRect.x, n), l = Y(t.textRect.y, n), d = Y(t.textRect.width, n), g = Y(t.textRect.height, n);
|
|
4422
4428
|
else if (v === "ellipse") {
|
|
4423
4429
|
let e = p * (1 - 1 / Math.SQRT2) / 2, t = m * (1 - 1 / Math.SQRT2) / 2;
|
|
4424
4430
|
s = u + e, l = f + t, d = p / Math.SQRT2, g = m / Math.SQRT2;
|
|
4425
4431
|
} else {
|
|
4426
|
-
let e =
|
|
4432
|
+
let e = tr(v, u, f, p, m, t.adj, t.adj2);
|
|
4427
4433
|
e && (s = e.tx, l = e.ty, d = e.tw, g = e.th);
|
|
4428
4434
|
}
|
|
4429
|
-
|
|
4435
|
+
_r(e, t.textBody, s, l, d, g, n, o, t.rotation, !1, !1, r, i, a, h, !1, c), e.restore();
|
|
4430
4436
|
}
|
|
4431
4437
|
e.restore();
|
|
4432
4438
|
}
|
|
4433
|
-
var
|
|
4434
|
-
function
|
|
4435
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4439
|
+
var fr = oe;
|
|
4440
|
+
function pr(e, t) {
|
|
4441
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = mr(e).toLowerCase(), o = mr(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4436
4442
|
switch (t) {
|
|
4437
4443
|
case "arabicPlain": return n;
|
|
4438
4444
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4459,7 +4465,7 @@ function fr(e, t) {
|
|
|
4459
4465
|
default: return `${n}.`;
|
|
4460
4466
|
}
|
|
4461
4467
|
}
|
|
4462
|
-
function
|
|
4468
|
+
function mr(e) {
|
|
4463
4469
|
let t = [
|
|
4464
4470
|
1e3,
|
|
4465
4471
|
900,
|
|
@@ -4492,21 +4498,21 @@ function pr(e) {
|
|
|
4492
4498
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4493
4499
|
return r;
|
|
4494
4500
|
}
|
|
4495
|
-
function
|
|
4501
|
+
function hr(e) {
|
|
4496
4502
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4497
4503
|
return !1;
|
|
4498
4504
|
}
|
|
4499
|
-
function
|
|
4500
|
-
let n =
|
|
4501
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4505
|
+
function gr(e, t) {
|
|
4506
|
+
let n = hr(e);
|
|
4507
|
+
if (e.bullet.type === "char") return t.clear(), n ? se(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4502
4508
|
if (e.bullet.type === "autoNum") {
|
|
4503
4509
|
if (!n) return "";
|
|
4504
4510
|
let r = e.lvl;
|
|
4505
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4511
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), pr(t.get(r), e.bullet.numType);
|
|
4506
4512
|
}
|
|
4507
4513
|
return t.clear(), "";
|
|
4508
4514
|
}
|
|
4509
|
-
function
|
|
4515
|
+
function _r(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000", p, m = {
|
|
4510
4516
|
themeMajorFont: null,
|
|
4511
4517
|
themeMinorFont: null,
|
|
4512
4518
|
dpr: 1
|
|
@@ -4525,49 +4531,49 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4525
4531
|
textBodyRotation: d
|
|
4526
4532
|
}) : void 0;
|
|
4527
4533
|
if (g) return a;
|
|
4528
|
-
e.save(), e.translate(t, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2),
|
|
4534
|
+
e.save(), e.translate(t, u), e.rotate(x ? -Math.PI / 2 : Math.PI / 2), _r(e, {
|
|
4529
4535
|
...n,
|
|
4530
4536
|
vert: "horz"
|
|
4531
4537
|
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, f, p, m, v, !1, _, n.vert === "eaVert"), e.restore();
|
|
4532
4538
|
return;
|
|
4533
4539
|
}
|
|
4534
4540
|
let S = n.textWarp;
|
|
4535
|
-
if (!g && S &&
|
|
4536
|
-
|
|
4541
|
+
if (!g && S && He(S.preset)) {
|
|
4542
|
+
er(e, n, S.preset, S.adj ?? [], r, i, a, o, s, c ?? f, m);
|
|
4537
4543
|
return;
|
|
4538
4544
|
}
|
|
4539
|
-
let C =
|
|
4540
|
-
let i = (n.defaultFontSize ?? 18) *
|
|
4545
|
+
let C = Y(n.lIns, s), w = Y(n.rIns, s), T = Y(n.tIns, s), E = Y(n.bIns, s), D = n.wrap !== "none", O = n.autoFit === "sp" ? D && jn(e, n, a, C, w, s, m) : D, k = Math.max(1, n.numCol ?? 1), A = Y(n.spcCol ?? 0, s), j = n.defaultBold ?? !1, M = n.defaultItalic ?? !1, N = c ?? f, P = (t) => {
|
|
4546
|
+
let i = (n.defaultFontSize ?? 18) * J * s * t, o = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
4541
4547
|
for (let u = 0; u < n.paragraphs.length; u++) {
|
|
4542
|
-
let d = n.paragraphs[u], f =
|
|
4548
|
+
let d = n.paragraphs[u], f = Y(d.marL, s), h = Y(d.marR, s), _ = Y(d.indent, s), v = d.defFontSize == null ? i : d.defFontSize * J * s * t, b = d.defColor ? X(d.defColor) : N, x = On(d), S = (() => {
|
|
4543
4549
|
for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4544
4550
|
return null;
|
|
4545
|
-
})(), T = S == null ? v : S *
|
|
4551
|
+
})(), T = S == null ? v : S * J * s * t, E = (() => {
|
|
4546
4552
|
for (let e of d.runs) if (e.type === "text" && e.color) return e.color;
|
|
4547
4553
|
return null;
|
|
4548
|
-
})(), D = E ?
|
|
4554
|
+
})(), D = E ? X(E) : b, P = (() => {
|
|
4549
4555
|
for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4550
4556
|
return d.defFontFamily ?? null;
|
|
4551
|
-
})(), F = "", I =
|
|
4552
|
-
F =
|
|
4553
|
-
let B =
|
|
4557
|
+
})(), F = "", I = Z(!1, !1, T, "sans-serif", m), L = D, R = null;
|
|
4558
|
+
F = gr(d, l);
|
|
4559
|
+
let B = Le(d.bullet);
|
|
4554
4560
|
if (B.type === "char") {
|
|
4555
4561
|
let e = B;
|
|
4556
|
-
I =
|
|
4562
|
+
I = Z(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * J * s * t, F === e.char ? _n(e.fontFamily ?? null, m) : "sans-serif", m), L = e.color ? X(e.color) : D;
|
|
4557
4563
|
} else if (B.type === "autoNum") {
|
|
4558
4564
|
let e = B;
|
|
4559
|
-
I =
|
|
4565
|
+
I = Z(!1, !1, e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * J * s * t, _n(e.fontFamily ?? P, m), m), L = B.color ? X(B.color) : D;
|
|
4560
4566
|
} else if (B.type === "blip") {
|
|
4561
|
-
let e = B, n = e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts *
|
|
4567
|
+
let e = B, n = e.sizePts == null ? e.sizePct == null ? T : T * (e.sizePct / 100) : e.sizePts * J * s * t;
|
|
4562
4568
|
R = {
|
|
4563
4569
|
imagePath: e.imagePath,
|
|
4564
4570
|
mimeType: e.mimeType,
|
|
4565
4571
|
sizePx: n
|
|
4566
4572
|
};
|
|
4567
4573
|
}
|
|
4568
|
-
let V = k > 1 ? (a - C - w - (k - 1) * A) / k : a - C - w, H = r + C + f, U = r + C + f + _,
|
|
4569
|
-
for (let t = 0; t <
|
|
4570
|
-
let r =
|
|
4574
|
+
let V = k > 1 ? (a - C - w - (k - 1) * A) / k : a - C - w, H = r + C + f, U = r + C + f + _, ee = V - f - h, W = In(e, d, O ? ee : Infinity, v, b, s, f, j, M, t, p, m, kn(x, _)), te = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * J * s * t, G = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * J * s * t;
|
|
4575
|
+
for (let t = 0; t < W.length; t++) {
|
|
4576
|
+
let r = W[t], i = t === 0, a = t === W.length - 1, l = 0, f = 0;
|
|
4571
4577
|
for (let e of r.segments) {
|
|
4572
4578
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4573
4579
|
if (t > l && (l = t), !e.math) {
|
|
@@ -4582,8 +4588,8 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4582
4588
|
}
|
|
4583
4589
|
i && R && R.sizePx > l && (l = R.sizePx);
|
|
4584
4590
|
let p = l * 1.2, m = Math.max(p, f), h;
|
|
4585
|
-
h = d.spaceLine ? d.spaceLine.type === "pct" ? (g ? l : p) * (d.spaceLine.val / 1e5) : d.spaceLine.val *
|
|
4586
|
-
let b = h + (a ?
|
|
4591
|
+
h = d.spaceLine ? d.spaceLine.type === "pct" ? (g ? l : p) * (d.spaceLine.val / 1e5) : d.spaceLine.val * J * s : g ? y ? p : l : m, n.autoFit === "norm" && n.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - n.lnSpcReduction);
|
|
4592
|
+
let b = h + (a ? G : 0), S = i && u > 0 ? te : 0, C = i ? kn(x, _) : 0, w = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), T = i && w ? R : null;
|
|
4587
4593
|
o.push({
|
|
4588
4594
|
line: r,
|
|
4589
4595
|
linePx: b,
|
|
@@ -4596,7 +4602,7 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4596
4602
|
bulletX: U,
|
|
4597
4603
|
bulletImage: T,
|
|
4598
4604
|
textX: H,
|
|
4599
|
-
textMaxW:
|
|
4605
|
+
textMaxW: ee,
|
|
4600
4606
|
alignment: d.alignment,
|
|
4601
4607
|
isLastLine: a,
|
|
4602
4608
|
para: d
|
|
@@ -4625,15 +4631,15 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4625
4631
|
o === 0 && L === "b" ? (B = T + I + E, R = i - B) : B = n.autoFit === "sp" ? Math.max(o, T + I + E) : o;
|
|
4626
4632
|
let H, U = Math.max(0, B - T - E);
|
|
4627
4633
|
H = L === "ctr" ? R + T + (U - I) / 2 : L === "b" ? R + B - E - I : R + T, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4628
|
-
let
|
|
4634
|
+
let ee = H, W = k > 1 ? (a - C - w - (k - 1) * A) / k + A : 0, te = Math.max(0, B - T - E), G = F[F.length - 1], K = G ? Math.max(0, G.linePx - G.lineHeight) : 0, q = I - K, ne = o === 0 || q <= te + .5, re = k > 1 && !ne ? Math.ceil(F.length / k) : F.length, ie = 0, ae = 0;
|
|
4629
4635
|
for (let c of F) {
|
|
4630
4636
|
let { line: u, linePx: d, lineHeight: f, topGapPx: p, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = c;
|
|
4631
|
-
k > 1 &&
|
|
4632
|
-
let T = (n.rtlCol ? k - 1 -
|
|
4637
|
+
k > 1 && ie < k - 1 && ae >= re && (ie++, ae = 0, H = ee), H += p, ae++;
|
|
4638
|
+
let T = (n.rtlCol ? k - 1 - ie : ie) * W, E = c.textX + T, D = c.bulletX + T, O = c.textMaxW, A = c.para.rtl === !0, j = A || Kt(u.segments), M = u.segments.some((e) => e.isTab);
|
|
4633
4639
|
if (M) {
|
|
4634
|
-
let t =
|
|
4640
|
+
let t = Y(c.para.marL, s), n = Y(c.para.marR, s), r = A ? n : t + g, i = O + t + n;
|
|
4635
4641
|
e.font = u.segments.find((e) => e.isTab).font;
|
|
4636
|
-
let a = e.measureText(" ").width, o =
|
|
4642
|
+
let a = e.measureText(" ").width, o = an(u.segments.map((t) => {
|
|
4637
4643
|
if (t.isTab) return {
|
|
4638
4644
|
isTab: !0,
|
|
4639
4645
|
width: 0
|
|
@@ -4649,9 +4655,9 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4649
4655
|
width: t.text ? (t.leadingLetterSpacingPx ?? 0) + Q(e, t.text, n) : 0
|
|
4650
4656
|
};
|
|
4651
4657
|
}), (c.para.tabStops ?? []).map((e) => ({
|
|
4652
|
-
pos:
|
|
4658
|
+
pos: Y(e.pos, s),
|
|
4653
4659
|
algn: e.algn
|
|
4654
|
-
})), r, i, a,
|
|
4660
|
+
})), r, i, a, Y(c.para.defTabSz ?? 914400, s));
|
|
4655
4661
|
for (let e = 0; e < u.segments.length; e++) u.segments[e].isTab && (u.segments[e].tabWidthPx = o[e]);
|
|
4656
4662
|
}
|
|
4657
4663
|
let N = 0, P = f * .8;
|
|
@@ -4689,16 +4695,16 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4689
4695
|
}
|
|
4690
4696
|
let z = E + g, B;
|
|
4691
4697
|
B = M ? A ? E + O - L - N : z : C === "ctr" ? z + (O - g - N) / 2 : C === "r" ? E + O - L - N : z;
|
|
4692
|
-
let U = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null,
|
|
4698
|
+
let U = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, te = w || (u.endsWithBreak ?? !1), G = (U && !j && !M ? Xt(u.segments, O - g, N, U, te) : null) ?? u.segments, K = j ? qt(u.segments, A) : null, q = (e, t) => {
|
|
4693
4699
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4694
4700
|
let n = u.segments[Math.min(e, t)], r = u.segments[Math.max(e, t)];
|
|
4695
4701
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
4696
|
-
},
|
|
4697
|
-
for (let t = 0; t <
|
|
4698
|
-
let n =
|
|
4702
|
+
}, ne = G.length;
|
|
4703
|
+
for (let t = 0; t < ne; t++) {
|
|
4704
|
+
let n = K ? K.order[t] : t, c = G[n], u = K ? K.rtl[n] : !1;
|
|
4699
4705
|
if (j && (e.direction = u ? "rtl" : "ltr"), t > 0) {
|
|
4700
|
-
let e =
|
|
4701
|
-
B +=
|
|
4706
|
+
let e = K ? K.order[t - 1] : t - 1;
|
|
4707
|
+
B += q(e, n);
|
|
4702
4708
|
}
|
|
4703
4709
|
if (c.isTab) {
|
|
4704
4710
|
B += c.tabWidthPx ?? 0;
|
|
@@ -4706,26 +4712,26 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4706
4712
|
}
|
|
4707
4713
|
let d = c.jext ?? 0, p = c.splitBefore, g = c.perGap ?? 0, _ = p && p.length > 0 ? p.length * g : 0;
|
|
4708
4714
|
if (c.math) {
|
|
4709
|
-
let t =
|
|
4715
|
+
let t = pn.get(c.math.nodes), n = c.math.width, r = c.math.ascent + c.math.descent;
|
|
4710
4716
|
if (t && n > 0 && r > 0) {
|
|
4711
|
-
let i = F - c.math.ascent, a =
|
|
4717
|
+
let i = F - c.math.ascent, a = mn(t, c.color);
|
|
4712
4718
|
e.drawImage(a, B, i, n, r);
|
|
4713
4719
|
}
|
|
4714
4720
|
B += n, B += d;
|
|
4715
4721
|
continue;
|
|
4716
4722
|
}
|
|
4717
4723
|
e.font = c.font, e.fillStyle = c.color;
|
|
4718
|
-
let y = F + (c.baseline ? -(c.baseline / 1e5) * c.sizePx : 0),
|
|
4724
|
+
let y = c.drawSizePx ?? c.sizePx, b = F + (c.baseline ? -(c.baseline / 1e5) * c.sizePx : 0), x = c.letterSpacingPx ?? 0;
|
|
4719
4725
|
if (c.highlight && c.text) {
|
|
4720
|
-
let t = Q(e, c.text,
|
|
4721
|
-
|
|
4726
|
+
let t = Q(e, c.text, x) + _ + d;
|
|
4727
|
+
dn(e, B, b, t, y, c.highlight, c.color);
|
|
4722
4728
|
}
|
|
4723
|
-
let
|
|
4729
|
+
let S = c.shadow, C = (e, t, n, r) => {
|
|
4724
4730
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4725
|
-
if (
|
|
4731
|
+
if (x !== 0 && Nn(t) > 1) {
|
|
4726
4732
|
let r = e, a = r.letterSpacing;
|
|
4727
|
-
if (
|
|
4728
|
-
r.letterSpacing = `${
|
|
4733
|
+
if (Fn(e)) {
|
|
4734
|
+
r.letterSpacing = `${x}px`, i(t, n, b);
|
|
4729
4735
|
try {
|
|
4730
4736
|
r.letterSpacing = a;
|
|
4731
4737
|
} catch {}
|
|
@@ -4733,64 +4739,64 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4733
4739
|
let r = n, a = [...t];
|
|
4734
4740
|
for (let t = 0; t < a.length; t++) {
|
|
4735
4741
|
let n = a[t];
|
|
4736
|
-
i(n, r,
|
|
4742
|
+
i(n, r, b), t < a.length - 1 && (r += e.measureText(n).width + x);
|
|
4737
4743
|
}
|
|
4738
4744
|
}
|
|
4739
|
-
} else i(t, n,
|
|
4740
|
-
},
|
|
4745
|
+
} else i(t, n, b);
|
|
4746
|
+
}, w = (t) => Q(e, t, x), T = p && p.length > 0 ? Rt([...c.text], p, g, w) : null, E = [...c.text], D = !!p && p.length === E.length - 1 && E.length > 1, O = (e, t) => {
|
|
4741
4747
|
if (v) {
|
|
4742
|
-
let n =
|
|
4743
|
-
|
|
4748
|
+
let n = D ? x + g : x;
|
|
4749
|
+
un(e, c.text, B, b, y, n, t);
|
|
4744
4750
|
return;
|
|
4745
4751
|
}
|
|
4746
|
-
if (
|
|
4747
|
-
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r =
|
|
4748
|
-
if (
|
|
4752
|
+
if (D) {
|
|
4753
|
+
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = x + g;
|
|
4754
|
+
if (Fn(e)) {
|
|
4749
4755
|
let t = e, i = t.letterSpacing;
|
|
4750
|
-
t.letterSpacing = `${r}px`, n(c.text, B,
|
|
4756
|
+
t.letterSpacing = `${r}px`, n(c.text, B, b);
|
|
4751
4757
|
try {
|
|
4752
4758
|
t.letterSpacing = i;
|
|
4753
4759
|
} catch {}
|
|
4754
4760
|
} else {
|
|
4755
4761
|
let t = B;
|
|
4756
|
-
for (let i = 0; i <
|
|
4757
|
-
let a =
|
|
4758
|
-
n(a, t,
|
|
4762
|
+
for (let i = 0; i < E.length; i++) {
|
|
4763
|
+
let a = E[i];
|
|
4764
|
+
n(a, t, b), i < E.length - 1 && (t += e.measureText(a).width + r);
|
|
4759
4765
|
}
|
|
4760
4766
|
}
|
|
4761
|
-
} else if (
|
|
4762
|
-
else
|
|
4763
|
-
},
|
|
4764
|
-
if (
|
|
4767
|
+
} else if (T) for (let { text: n, dx: r } of T) C(e, n, B + r, t);
|
|
4768
|
+
else C(e, c.text, B, t);
|
|
4769
|
+
}, k = c.reflection;
|
|
4770
|
+
if (k && c.text) {
|
|
4765
4771
|
let t = e.canvas.width || 0, n = e.canvas.height || 0;
|
|
4766
4772
|
if (t > 0 && n > 0) {
|
|
4767
4773
|
e.font = c.font;
|
|
4768
|
-
let r = e.measureText(c.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent :
|
|
4769
|
-
|
|
4770
|
-
e.font = c.font, e.fillStyle = c.color,
|
|
4774
|
+
let r = e.measureText(c.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : y * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : y * .2, o = Number.isFinite(r.actualBoundingBoxLeft) ? r.actualBoundingBoxLeft : 0, l = Number.isFinite(r.actualBoundingBoxRight) ? r.actualBoundingBoxRight : r.width, u = e.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1;
|
|
4775
|
+
Dn(e, (e) => {
|
|
4776
|
+
e.font = c.font, e.fillStyle = c.color, O(e, "fill");
|
|
4771
4777
|
}, {
|
|
4772
4778
|
x: (B - o) * f,
|
|
4773
|
-
y: (
|
|
4779
|
+
y: (b - i) * f,
|
|
4774
4780
|
w: Math.max(1, o + l) * f,
|
|
4775
4781
|
h: Math.max(1, i + a) * f
|
|
4776
|
-
},
|
|
4782
|
+
}, k, s * f, u, t, n), e.font = c.font, e.fillStyle = c.color;
|
|
4777
4783
|
}
|
|
4778
4784
|
}
|
|
4779
|
-
if (
|
|
4780
|
-
let t =
|
|
4781
|
-
e.save(), e.shadowColor =
|
|
4785
|
+
if (S) {
|
|
4786
|
+
let t = S.dir * Math.PI / 180, n = Y(S.dist, s);
|
|
4787
|
+
e.save(), e.shadowColor = X(S.color, S.alpha), e.shadowBlur = Y(S.blur, s), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
4782
4788
|
}
|
|
4783
|
-
|
|
4784
|
-
let
|
|
4785
|
-
|
|
4786
|
-
let
|
|
4789
|
+
O(e, "fill"), S && e.restore();
|
|
4790
|
+
let A = c.outline;
|
|
4791
|
+
A && A.width > 0 && (e.save(), e.lineWidth = Math.max(.5, Y(A.width, s)), e.strokeStyle = A.color ? `#${A.color}` : c.color, e.lineJoin = "round", O(e, "stroke"), e.restore()), e.font = c.font;
|
|
4792
|
+
let M = Q(e, c.text, x) + _;
|
|
4787
4793
|
if (h && c.text && h({
|
|
4788
4794
|
text: c.text,
|
|
4789
4795
|
inShapeX: B - r,
|
|
4790
4796
|
inShapeY: H - i,
|
|
4791
|
-
w:
|
|
4797
|
+
w: M + d,
|
|
4792
4798
|
h: f,
|
|
4793
|
-
fontSize:
|
|
4799
|
+
fontSize: y,
|
|
4794
4800
|
font: c.font,
|
|
4795
4801
|
shapeX: r,
|
|
4796
4802
|
shapeY: i,
|
|
@@ -4798,27 +4804,27 @@ function gr(e, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000",
|
|
|
4798
4804
|
shapeH: o,
|
|
4799
4805
|
rotation: l,
|
|
4800
4806
|
hyperlink: c.hyperlink
|
|
4801
|
-
}), c.underline &&
|
|
4802
|
-
let t = Math.max(1,
|
|
4807
|
+
}), c.underline && It(e, B, b, M + d, y, c.underlineColor ?? c.color, c.underlineStyle, m.dpr), c.strikethrough) {
|
|
4808
|
+
let t = Math.max(1, y * .05);
|
|
4803
4809
|
e.strokeStyle = c.color, e.lineWidth = t, e.setLineDash([]);
|
|
4804
|
-
let n =
|
|
4810
|
+
let n = b - y * .32;
|
|
4805
4811
|
if (c.strikeDouble) {
|
|
4806
4812
|
let r = t * .9, i = n - r, a = n + r;
|
|
4807
|
-
e.beginPath(), e.moveTo(B, i + V(i, t, m.dpr)), e.lineTo(B +
|
|
4813
|
+
e.beginPath(), e.moveTo(B, i + V(i, t, m.dpr)), e.lineTo(B + M + d, i + V(i, t, m.dpr)), e.moveTo(B, a + V(a, t, m.dpr)), e.lineTo(B + M + d, a + V(a, t, m.dpr)), e.stroke();
|
|
4808
4814
|
} else {
|
|
4809
4815
|
let r = n + V(n, t, m.dpr);
|
|
4810
|
-
e.beginPath(), e.moveTo(B, r), e.lineTo(B +
|
|
4816
|
+
e.beginPath(), e.moveTo(B, r), e.lineTo(B + M + d, r), e.stroke();
|
|
4811
4817
|
}
|
|
4812
4818
|
}
|
|
4813
|
-
B +=
|
|
4819
|
+
B += M, B += d;
|
|
4814
4820
|
}
|
|
4815
4821
|
j && (e.direction = "ltr"), H += d;
|
|
4816
4822
|
}
|
|
4817
4823
|
e.restore();
|
|
4818
4824
|
}
|
|
4819
|
-
function
|
|
4825
|
+
function vr(e, t, n, r, i) {
|
|
4820
4826
|
if (!e) return [];
|
|
4821
|
-
let a =
|
|
4827
|
+
let a = wt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = At(n), s = r * i, c = [];
|
|
4822
4828
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
4823
4829
|
widthPx: e.bevelT.w * s,
|
|
4824
4830
|
heightPx: e.bevelT.h * s,
|
|
@@ -4834,9 +4840,9 @@ function _r(e, t, n, r, i) {
|
|
|
4834
4840
|
bottom: !0
|
|
4835
4841
|
}), c;
|
|
4836
4842
|
}
|
|
4837
|
-
function
|
|
4843
|
+
function yr(e, t, n, r, i, a) {
|
|
4838
4844
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
4839
|
-
let o = e.extrusionH * i * a, s =
|
|
4845
|
+
let o = e.extrusionH * i * a, s = lt(t, n * a, r * a, o);
|
|
4840
4846
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
4841
4847
|
let c = [
|
|
4842
4848
|
64,
|
|
@@ -4857,14 +4863,14 @@ function vr(e, t, n, r, i, a) {
|
|
|
4857
4863
|
rgb: c
|
|
4858
4864
|
};
|
|
4859
4865
|
}
|
|
4860
|
-
function
|
|
4866
|
+
function br(e, t, n, r, i, a, o, s = {}) {
|
|
4861
4867
|
if (i <= 0 || a <= 0) return !1;
|
|
4862
|
-
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 =
|
|
4868
|
+
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 = st(t, i, a), p = f.corners;
|
|
4863
4869
|
if (d > 0) {
|
|
4864
|
-
let e = d / u, t =
|
|
4870
|
+
let e = d / u, t = Pe(f.corners, e / i, e / a);
|
|
4865
4871
|
t ? p = t : d = 0;
|
|
4866
4872
|
}
|
|
4867
|
-
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ =
|
|
4873
|
+
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = we(h, g);
|
|
4868
4874
|
if (!_) return !1;
|
|
4869
4875
|
let v = _.getContext("2d");
|
|
4870
4876
|
if (!v) return !1;
|
|
@@ -4877,17 +4883,17 @@ function yr(e, t, n, r, i, a, o, s = {}) {
|
|
|
4877
4883
|
});
|
|
4878
4884
|
if (s.extrusion) {
|
|
4879
4885
|
let e = Math.ceil(Math.hypot(s.extrusion.offsetX, s.extrusion.offsetY)) + 2;
|
|
4880
|
-
|
|
4886
|
+
Ft(v, s.extrusion, x(e));
|
|
4881
4887
|
}
|
|
4882
|
-
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels)
|
|
4883
|
-
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()),
|
|
4888
|
+
if (s.bevels && s.bevels.length > 0) for (let e of s.bevels) Pt(v, e, x(Math.ceil(e.widthPx) + 2));
|
|
4889
|
+
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), De(_, e, h, g, p.map((e) => ({
|
|
4884
4890
|
x: n + e.x,
|
|
4885
4891
|
y: r + e.y
|
|
4886
4892
|
}))), !0;
|
|
4887
4893
|
}
|
|
4888
|
-
function
|
|
4894
|
+
function xr(e, t, n, r, i, a, o, s, c = 0) {
|
|
4889
4895
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
4890
|
-
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 =
|
|
4896
|
+
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 = we(m, h);
|
|
4891
4897
|
if (!g) return !1;
|
|
4892
4898
|
let _ = g.getContext("2d");
|
|
4893
4899
|
if (!_) return !1;
|
|
@@ -4895,7 +4901,7 @@ function br(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
4895
4901
|
let v = Math.ceil(r * d), y = Math.ceil(i * d);
|
|
4896
4902
|
for (let e of a) {
|
|
4897
4903
|
let t = Math.ceil(e.widthPx) + 2;
|
|
4898
|
-
|
|
4904
|
+
Pt(_, e, {
|
|
4899
4905
|
x: f - t,
|
|
4900
4906
|
y: f - t,
|
|
4901
4907
|
w: v + 2 * t,
|
|
@@ -4904,19 +4910,19 @@ function br(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
4904
4910
|
}
|
|
4905
4911
|
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;
|
|
4906
4912
|
}
|
|
4907
|
-
var
|
|
4908
|
-
function
|
|
4909
|
-
let t =
|
|
4913
|
+
var Sr = /* @__PURE__ */ new WeakMap();
|
|
4914
|
+
function Cr(e) {
|
|
4915
|
+
let t = Sr.get(e);
|
|
4910
4916
|
return t || (t = async (t, n) => {
|
|
4911
4917
|
let r = await e(t);
|
|
4912
4918
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
4913
|
-
},
|
|
4919
|
+
}, Sr.set(e, t)), t;
|
|
4914
4920
|
}
|
|
4915
|
-
function
|
|
4921
|
+
function wr(e, t, n = Cr(t)) {
|
|
4916
4922
|
return g("base", e.posterPath, n, async () => {
|
|
4917
4923
|
let n = await t(e.posterPath), r = e.posterMimeType || n.type || "application/octet-stream";
|
|
4918
4924
|
return {
|
|
4919
|
-
bitmap: await
|
|
4925
|
+
bitmap: await ve(n.type === r ? n : new Blob([n], { type: r })),
|
|
4920
4926
|
owned: !0
|
|
4921
4927
|
};
|
|
4922
4928
|
}).then((e) => {
|
|
@@ -4924,35 +4930,35 @@ function Cr(e, t, n = Sr(t)) {
|
|
|
4924
4930
|
return e;
|
|
4925
4931
|
});
|
|
4926
4932
|
}
|
|
4927
|
-
async function
|
|
4933
|
+
async function Tr(e, t, n, r, i) {
|
|
4928
4934
|
if (i) try {
|
|
4929
|
-
let a = t.mimeType === "image/svg+xml", s =
|
|
4935
|
+
let a = t.mimeType === "image/svg+xml", s = be(t.mimeType, t.srcRect, t.width / J, t.height / J);
|
|
4930
4936
|
if (!s) return;
|
|
4931
4937
|
let { widthPt: c, heightPt: u } = s, d;
|
|
4932
|
-
if (
|
|
4933
|
-
d = await
|
|
4938
|
+
if (re(t)) try {
|
|
4939
|
+
d = await K(t.svgImagePath, i);
|
|
4934
4940
|
} catch {
|
|
4935
|
-
d = a ? await
|
|
4941
|
+
d = a ? await K(t.imagePath, i) : await Ie(t.imagePath, t.mimeType, t.duotone, i, {
|
|
4936
4942
|
widthPt: c,
|
|
4937
4943
|
heightPt: u
|
|
4938
4944
|
});
|
|
4939
4945
|
}
|
|
4940
|
-
else d = a ? await
|
|
4946
|
+
else d = a ? await K(t.imagePath, i) : await Ie(t.imagePath, t.mimeType, t.duotone, i, {
|
|
4941
4947
|
widthPt: c,
|
|
4942
4948
|
heightPt: u
|
|
4943
4949
|
});
|
|
4944
4950
|
if (!d || r()) return;
|
|
4945
4951
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
4946
|
-
let f =
|
|
4952
|
+
let f = Y(t.x, n), m = Y(t.y, n), h = Y(t.width, n), g = Y(t.height, n);
|
|
4947
4953
|
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(f + h / 2, m + g / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(f + h / 2), -(m + g / 2)));
|
|
4948
4954
|
let _ = (e, n, r, i, a) => {
|
|
4949
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
4955
|
+
t.custGeom && t.custGeom.length > 0 ? fr(e, t.custGeom, n, r, i, a) : t.prstGeom && p(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
4950
4956
|
}, v = (e, t, n, r, i) => {
|
|
4951
4957
|
e.beginPath(), _(e, t, n, r, i);
|
|
4952
4958
|
}, y = (e, n, r, i, a) => {
|
|
4953
4959
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (v(e, n, r, i, a), e.clip());
|
|
4954
4960
|
}, b = (e, r, i, a, o) => {
|
|
4955
|
-
t.stroke && (e.save(),
|
|
4961
|
+
t.stroke && (e.save(), Or(e, t.stroke, n, {
|
|
4956
4962
|
x: r,
|
|
4957
4963
|
y: i,
|
|
4958
4964
|
w: a,
|
|
@@ -4964,59 +4970,59 @@ async function wr(e, t, n, r, i) {
|
|
|
4964
4970
|
let t = Math.max(.5, s.contourW * n);
|
|
4965
4971
|
e.save(), e.beginPath();
|
|
4966
4972
|
let c = t * 2 + Math.max(a, o);
|
|
4967
|
-
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), _(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), v(e, r, i, a, o), e.strokeStyle =
|
|
4973
|
+
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), _(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), v(e, r, i, a, o), e.strokeStyle = X(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
4968
4974
|
}
|
|
4969
|
-
}, S = t.scene3d &&
|
|
4970
|
-
e.save(), y(e, n, r, i, a),
|
|
4975
|
+
}, S = t.scene3d && ct(t.scene3d.camera) ? t.scene3d : null, C = (e, n, r, i, a) => {
|
|
4976
|
+
e.save(), y(e, n, r, i, a), Ce(e, d, t.srcRect, n, r, i, a), e.restore();
|
|
4971
4977
|
}, w = (e, t, n, r, i) => {
|
|
4972
4978
|
C(e, t, n, r, i), b(e, t, n, r, i), x(e, t, n, r, i);
|
|
4973
4979
|
}, T = (e, t, n, r, i) => {
|
|
4974
4980
|
C(e, t, n, r, i), b(e, t, n, r, i);
|
|
4975
|
-
}, E = e.getTransform(), D = Math.abs(E.a * E.d - E.b * E.c), O = D > 0 ? Math.sqrt(D) : 1, k =
|
|
4981
|
+
}, E = e.getTransform(), D = Math.abs(E.a * E.d - E.b * E.c), O = D > 0 ? Math.sqrt(D) : 1, k = vr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, O), A = S ? yr(t.sp3d, S.camera, h, g, n, O) : null, j = t.stroke ? t.stroke.width * n / 2 : 0, M = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, N = A ? Math.hypot(A.offsetX, A.offsetY) / O : 0, P = j + M + N + 2, F = (e) => {
|
|
4976
4982
|
if (S) {
|
|
4977
|
-
if (
|
|
4983
|
+
if (br(e, S.camera, f, m, h, g, T, {
|
|
4978
4984
|
bevels: k,
|
|
4979
4985
|
extrusion: A ?? void 0,
|
|
4980
4986
|
paintEdges: x,
|
|
4981
4987
|
edgePadCss: P
|
|
4982
4988
|
})) return;
|
|
4983
|
-
} else if (k.length > 0 &&
|
|
4989
|
+
} else if (k.length > 0 && xr(e, f, m, h, g, k, T, x, P)) return;
|
|
4984
4990
|
w(e, f, m, h, g);
|
|
4985
4991
|
}, I = (e, t, n, r, i, a) => {
|
|
4986
4992
|
e.save(), y(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
4987
4993
|
}, L = (e, t) => {
|
|
4988
|
-
S &&
|
|
4989
|
-
}, R = e.getTransform(), z = Math.abs(R.a * R.d - R.b * R.c), B = z > 0 ? Math.sqrt(z) : 1, V = j + M, H = (t.custGeom && t.custGeom.length > 0 ?
|
|
4994
|
+
S && br(e, S.camera, f, m, h, g, (e, n, r, i, a) => I(e, t, n, r, i, a)) || I(e, t, f, m, h, g);
|
|
4995
|
+
}, R = e.getTransform(), z = Math.abs(R.a * R.d - R.b * R.c), B = z > 0 ? Math.sqrt(z) : 1, V = j + M, H = (t.custGeom && t.custGeom.length > 0 ? le(t.custGeom, f, m, h, g) : t.prstGeom && l(t.prstGeom.toLowerCase()) ? o(t.prstGeom.toLowerCase(), f, m, h, g, t.prstAdjust ?? []) : null) ?? {
|
|
4990
4996
|
x: f,
|
|
4991
4997
|
y: m,
|
|
4992
4998
|
w: h,
|
|
4993
4999
|
h: g
|
|
4994
|
-
}, U = S ?
|
|
4995
|
-
bbox:
|
|
4996
|
-
anchor:
|
|
4997
|
-
},
|
|
4998
|
-
|
|
5000
|
+
}, U = S ? cr(S.camera, R, f, m, h, g, P, t.shadow?.algn) : {
|
|
5001
|
+
bbox: ir(R, H.x - V, H.y - V, H.w + V * 2, H.h + V * 2),
|
|
5002
|
+
anchor: sr(R, f, m, h, g, t.shadow?.algn)
|
|
5003
|
+
}, ee = n * B, W = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), te = (e) => L(e, "#000");
|
|
5004
|
+
ur(e, t, S && W ? lr(F, R, U.bbox, {
|
|
4999
5005
|
w: e.canvas.width || 0,
|
|
5000
5006
|
h: e.canvas.height || 0
|
|
5001
|
-
}) : F, S &&
|
|
5007
|
+
}) : F, S && W ? lr(te, R, U.bbox, {
|
|
5002
5008
|
w: e.canvas.width || 0,
|
|
5003
5009
|
h: e.canvas.height || 0
|
|
5004
|
-
}) :
|
|
5010
|
+
}) : te, U.bbox, U.anchor, n, ee, R), e.restore();
|
|
5005
5011
|
} catch (e) {
|
|
5006
|
-
if (
|
|
5012
|
+
if (Se(e)) throw e;
|
|
5007
5013
|
}
|
|
5008
5014
|
}
|
|
5009
|
-
async function
|
|
5010
|
-
let s =
|
|
5015
|
+
async function Er(e, t, n, r, i, a, o) {
|
|
5016
|
+
let s = Y(t.x, n), c = Y(t.y, n), l = Y(t.width, n), u = Y(t.height, n), d;
|
|
5011
5017
|
if (t.posterPath && i) try {
|
|
5012
|
-
d = await
|
|
5018
|
+
d = await wr(t, i, o);
|
|
5013
5019
|
} catch (e) {
|
|
5014
|
-
if (
|
|
5020
|
+
if (Se(e)) throw e;
|
|
5015
5021
|
}
|
|
5016
|
-
r() || (e.save(),
|
|
5022
|
+
r() || (e.save(), kr(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 || Ut(e, s + l / 2, c + u / 2, l, u, "paused"), e.restore());
|
|
5017
5023
|
}
|
|
5018
|
-
function
|
|
5019
|
-
let s = Math.max(.5,
|
|
5024
|
+
function Dr(e, t, n, r, i, a, o) {
|
|
5025
|
+
let s = Math.max(.5, Y(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5020
5026
|
if (u === 0) return;
|
|
5021
5027
|
let d = -l / u, f = c / u, p;
|
|
5022
5028
|
switch (i) {
|
|
@@ -5065,41 +5071,41 @@ function Er(e, t, n, r, i, a, o) {
|
|
|
5065
5071
|
break;
|
|
5066
5072
|
default: return;
|
|
5067
5073
|
}
|
|
5068
|
-
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ?
|
|
5074
|
+
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = s + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = (r.fill ? fn(r.fill, e, Math.min(t.x, n.x), Math.min(t.y, n.y), Math.max(1, Math.abs(n.x - t.x)), Math.max(1, Math.abs(n.y - t.y)), o) : null) ?? X(r.color);
|
|
5069
5075
|
for (let r of p) {
|
|
5070
5076
|
let i = d * (s * r.offset), a = f * (s * r.offset);
|
|
5071
5077
|
e.lineWidth = Math.max(.5, s * r.widthFrac), e.beginPath(), e.moveTo(t.x + i, t.y + a), e.lineTo(n.x + i, n.y + a), e.stroke();
|
|
5072
5078
|
}
|
|
5073
5079
|
e.restore();
|
|
5074
5080
|
}
|
|
5075
|
-
function
|
|
5076
|
-
if (
|
|
5077
|
-
let n =
|
|
5081
|
+
function Or(e, t, n, r, i = 0) {
|
|
5082
|
+
if (ye(e, t, n), t?.fill && r) {
|
|
5083
|
+
let n = fn(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
5078
5084
|
n && (e.strokeStyle = n);
|
|
5079
5085
|
}
|
|
5080
5086
|
}
|
|
5081
|
-
function
|
|
5087
|
+
function kr(e, t, n) {
|
|
5082
5088
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5083
|
-
let r =
|
|
5089
|
+
let r = Y(t.x, n), i = Y(t.y, n), a = Y(t.width, n), o = Y(t.height, n);
|
|
5084
5090
|
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));
|
|
5085
5091
|
}
|
|
5086
|
-
function
|
|
5092
|
+
function Ar(e, t, n, r, i = {
|
|
5087
5093
|
themeMajorFont: null,
|
|
5088
5094
|
themeMinorFont: null,
|
|
5089
5095
|
dpr: 1
|
|
5090
5096
|
}) {
|
|
5091
|
-
e.save(),
|
|
5092
|
-
let a =
|
|
5097
|
+
e.save(), kr(e, t, n);
|
|
5098
|
+
let a = Y(t.x, n), o = Y(t.y, n), s = t.cols.map((e) => Y(e, n)), c = s.length, l = (e, t) => {
|
|
5093
5099
|
let n = 0;
|
|
5094
5100
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
5095
5101
|
return n;
|
|
5096
|
-
}, u = t.rows.map((e) =>
|
|
5102
|
+
}, u = t.rows.map((e) => Y(e.height, n));
|
|
5097
5103
|
for (let a = 0; a < t.rows.length; a++) {
|
|
5098
5104
|
let o = t.rows[a];
|
|
5099
5105
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5100
5106
|
let s = o.cells[t];
|
|
5101
5107
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5102
|
-
let c = l(t, s.gridSpan || 1), d =
|
|
5108
|
+
let c = l(t, s.gridSpan || 1), d = _r(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, o.height === 0) || 0;
|
|
5103
5109
|
d > u[a] && (u[a] = d);
|
|
5104
5110
|
}
|
|
5105
5111
|
}
|
|
@@ -5110,7 +5116,7 @@ function kr(e, t, n, r, i = {
|
|
|
5110
5116
|
if (c.hMerge || c.vMerge) continue;
|
|
5111
5117
|
let d = c.rowSpan || 1;
|
|
5112
5118
|
if (d <= 1 || !c.textBody) continue;
|
|
5113
|
-
let f = l(s, c.gridSpan || 1), p = t.rows.slice(a, Math.min(t.rows.length, a + d)).some((e) => e.height === 0), m =
|
|
5119
|
+
let f = l(s, c.gridSpan || 1), p = t.rows.slice(a, Math.min(t.rows.length, a + d)).some((e) => e.height === 0), m = _r(e, c.textBody, 0, 0, f, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0, void 0, !1, p) || 0, h = 0;
|
|
5114
5120
|
for (let e = 0; e < d && a + e < u.length; e++) h += u[a + e];
|
|
5115
5121
|
if (m > h) {
|
|
5116
5122
|
let e = (m - h) / d;
|
|
@@ -5155,10 +5161,10 @@ function kr(e, t, n, r, i = {
|
|
|
5155
5161
|
}
|
|
5156
5162
|
}
|
|
5157
5163
|
for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l } of h) {
|
|
5158
|
-
let u =
|
|
5164
|
+
let u = fn(a.fill, e, o, s, c, l, t.rotation);
|
|
5159
5165
|
if (u && (e.fillStyle = u, e.fillRect(o, s, c, l)), a.textBody) {
|
|
5160
|
-
let t = a.textColor ?
|
|
5161
|
-
|
|
5166
|
+
let t = a.textColor ? X(a.textColor) : null;
|
|
5167
|
+
_r(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i);
|
|
5162
5168
|
}
|
|
5163
5169
|
}
|
|
5164
5170
|
let _ = i.dpr, v = (e, t) => {
|
|
@@ -5166,7 +5172,7 @@ function kr(e, t, n, r, i = {
|
|
|
5166
5172
|
let n = g[e][t];
|
|
5167
5173
|
return n < 0 ? null : h[n];
|
|
5168
5174
|
}, y = (r, i, a, o, s) => {
|
|
5169
|
-
|
|
5175
|
+
Or(e, r, n, {
|
|
5170
5176
|
x: Math.min(i, o),
|
|
5171
5177
|
y: Math.min(a, s),
|
|
5172
5178
|
w: Math.max(1, Math.abs(o - i)),
|
|
@@ -5187,7 +5193,7 @@ function kr(e, t, n, r, i = {
|
|
|
5187
5193
|
for (; a < n;) {
|
|
5188
5194
|
let r = g[e][a], o = a + 1;
|
|
5189
5195
|
for (; o < n && g[e][o] === r;) o++;
|
|
5190
|
-
let s = v(e, a), c =
|
|
5196
|
+
let s = v(e, a), c = $t(i.borderB, s ? s.cell.borderT : null);
|
|
5191
5197
|
if (c) {
|
|
5192
5198
|
let e = p(a, o - a);
|
|
5193
5199
|
y(c, e, t, e + l(a, o - a), t);
|
|
@@ -5203,16 +5209,16 @@ function kr(e, t, n, r, i = {
|
|
|
5203
5209
|
for (; t <= r.lastRi;) {
|
|
5204
5210
|
let n = g[t][x], i = t;
|
|
5205
5211
|
for (; i + 1 <= r.lastRi && g[i + 1][x] === n;) i++;
|
|
5206
|
-
let a = v(t, x), o =
|
|
5212
|
+
let a = v(t, x), o = $t(h, a ? S(a.cell) : null);
|
|
5207
5213
|
o && y(o, e, m[t], e, m[i] + u[i]), t = i + 1;
|
|
5208
5214
|
}
|
|
5209
5215
|
}
|
|
5210
|
-
i.diagonalTL && (
|
|
5216
|
+
i.diagonalTL && (Or(e, i.diagonalTL, n, {
|
|
5211
5217
|
x: a,
|
|
5212
5218
|
y: o,
|
|
5213
5219
|
w: s,
|
|
5214
5220
|
h: d
|
|
5215
|
-
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (
|
|
5221
|
+
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (Or(e, i.diagonalTR, n, {
|
|
5216
5222
|
x: a,
|
|
5217
5223
|
y: o,
|
|
5218
5224
|
w: s,
|
|
@@ -5221,14 +5227,14 @@ function kr(e, t, n, r, i = {
|
|
|
5221
5227
|
}
|
|
5222
5228
|
e.restore();
|
|
5223
5229
|
}
|
|
5224
|
-
function
|
|
5230
|
+
function jr(e, t, n, r) {
|
|
5225
5231
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5226
5232
|
}
|
|
5227
|
-
var
|
|
5228
|
-
function
|
|
5229
|
-
|
|
5233
|
+
var Mr = /* @__PURE__ */ new WeakMap();
|
|
5234
|
+
function Nr(e) {
|
|
5235
|
+
Mr.set(e, (Mr.get(e) ?? 0) + 1);
|
|
5230
5236
|
}
|
|
5231
|
-
function
|
|
5237
|
+
function Pr(e, t, n, r, i) {
|
|
5232
5238
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5233
5239
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5234
5240
|
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([]);
|
|
@@ -5248,85 +5254,85 @@ function Nr(e, t, n, r, i) {
|
|
|
5248
5254
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5249
5255
|
e.restore();
|
|
5250
5256
|
}
|
|
5251
|
-
async function
|
|
5252
|
-
let o = i.fetchImage ?? (i.fetchMedia ?
|
|
5257
|
+
async function Fr(e, t, n, r, i = {}, a) {
|
|
5258
|
+
let o = i.fetchImage ?? (i.fetchMedia ? Cr(i.fetchMedia) : void 0), s = o ? x(o) : void 0;
|
|
5253
5259
|
try {
|
|
5254
|
-
return await
|
|
5260
|
+
return await Ir(e, t, n, r, i, a, o);
|
|
5255
5261
|
} finally {
|
|
5256
5262
|
s?.();
|
|
5257
5263
|
}
|
|
5258
5264
|
}
|
|
5259
|
-
async function
|
|
5260
|
-
let c = (
|
|
5261
|
-
|
|
5262
|
-
let l = () =>
|
|
5265
|
+
async function Ir(e, t, n, r, i = {}, o, s) {
|
|
5266
|
+
let c = (Mr.get(e) ?? 0) + 1;
|
|
5267
|
+
Mr.set(e, c);
|
|
5268
|
+
let l = () => Mr.get(e) !== c, u = i.width ?? ((P(e) ? e.offsetWidth : 0) || 960), d = u / n, f = Math.round(u), p = Math.round(r * d), m = i.dpr ?? R(), h = Ae(f * m, p * m), g = h.clamped ? m * h.scale : m;
|
|
5263
5269
|
e.width = h.width, e.height = h.height, P(e) && (e.style.width = `${f}px`, e.style.display || (e.style.display = "block"));
|
|
5264
5270
|
let _ = e.getContext("2d");
|
|
5265
5271
|
if (!_) throw Error("Could not get 2D context");
|
|
5266
|
-
if (_.scale(g, g), t.parseError) return
|
|
5272
|
+
if (_.scale(g, g), t.parseError) return Pr(_, f, p, t.slideNumber, t.parseError), e;
|
|
5267
5273
|
let v = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", y = {
|
|
5268
5274
|
themeMajorFont: i.majorFont ?? null,
|
|
5269
5275
|
themeMinorFont: i.minorFont ?? null,
|
|
5270
5276
|
themeHlinkColor: i.hlinkColor ?? null,
|
|
5271
5277
|
dpr: g,
|
|
5272
|
-
smartArtFallbackTextColor:
|
|
5278
|
+
smartArtFallbackTextColor: rn(t.background, v)
|
|
5273
5279
|
};
|
|
5274
|
-
if (await
|
|
5280
|
+
if (await Ln(_, t.background, f, p, d, l, i.fetchImage), l() || (i.math && await gn(t, i.math), l())) return e;
|
|
5275
5281
|
let b = t.slideNumber;
|
|
5276
5282
|
for (let e of t.elements) if (e.type === "picture" && i.fetchImage) {
|
|
5277
5283
|
let t = e, n = t.mimeType === "image/svg+xml";
|
|
5278
|
-
if (
|
|
5279
|
-
else if (n)
|
|
5284
|
+
if (re(t)) K(t.svgImagePath, i.fetchImage).catch(() => void 0);
|
|
5285
|
+
else if (n) K(t.imagePath, i.fetchImage).catch(() => void 0);
|
|
5280
5286
|
else {
|
|
5281
|
-
let e =
|
|
5287
|
+
let e = be(t.mimeType, t.srcRect, t.width / J, t.height / J);
|
|
5282
5288
|
if (!e) continue;
|
|
5283
|
-
|
|
5289
|
+
Ie(t.imagePath, t.mimeType, t.duotone, i.fetchImage, {
|
|
5284
5290
|
widthPt: e.widthPt,
|
|
5285
5291
|
heightPt: e.heightPt
|
|
5286
5292
|
}).catch(() => void 0);
|
|
5287
5293
|
}
|
|
5288
5294
|
} else if (e.type === "media") {
|
|
5289
5295
|
let t = e;
|
|
5290
|
-
t.posterPath && i.fetchMedia &&
|
|
5296
|
+
t.posterPath && i.fetchMedia && wr(t, i.fetchMedia, s).catch(() => void 0);
|
|
5291
5297
|
}
|
|
5292
5298
|
let x = /* @__PURE__ */ new Map();
|
|
5293
5299
|
if (i.fetchImage) {
|
|
5294
5300
|
let n = i.fetchImage, r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
|
|
5295
|
-
for (let e of
|
|
5296
|
-
let t =
|
|
5301
|
+
for (let e of xe(t.elements.filter((e) => e.type === "chart").map((e) => e.chart))) {
|
|
5302
|
+
let t = Ee(e);
|
|
5297
5303
|
o.has(t) || o.set(t, e);
|
|
5298
5304
|
}
|
|
5299
5305
|
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5300
|
-
let e =
|
|
5306
|
+
let e = Le(t.bullet);
|
|
5301
5307
|
e.type === "blip" && r.add(`${e.imagePath} ${e.mimeType}`);
|
|
5302
5308
|
}
|
|
5303
5309
|
if (r.size > 0 || o.size > 0) {
|
|
5304
5310
|
let t = [...r].map((e) => {
|
|
5305
5311
|
let [t, r] = e.split(" ");
|
|
5306
5312
|
return a(t, r, n).catch((e) => {
|
|
5307
|
-
if (
|
|
5313
|
+
if (Se(e)) throw e;
|
|
5308
5314
|
});
|
|
5309
5315
|
}), i = [...o].map(async ([e, t]) => {
|
|
5310
5316
|
try {
|
|
5311
|
-
let r =
|
|
5317
|
+
let r = be(t.mimeType, t.srcRect, 72, 72);
|
|
5312
5318
|
if (!r) {
|
|
5313
5319
|
x.set(e, null);
|
|
5314
5320
|
return;
|
|
5315
5321
|
}
|
|
5316
|
-
let i = () => t.mimeType === "image/svg+xml" ? t.duotone ? Promise.resolve(null) :
|
|
5322
|
+
let i = () => t.mimeType === "image/svg+xml" ? t.duotone ? Promise.resolve(null) : K(t.imagePath, n) : Ie(t.imagePath, t.mimeType, t.duotone, n, {
|
|
5317
5323
|
widthPt: r.widthPt,
|
|
5318
5324
|
heightPt: r.heightPt,
|
|
5319
5325
|
failClosedOnDuotoneFailure: !0
|
|
5320
5326
|
}), a;
|
|
5321
|
-
if (!t.duotone &&
|
|
5322
|
-
a = await
|
|
5327
|
+
if (!t.duotone && re(t)) try {
|
|
5328
|
+
a = await K(t.svgImagePath, n);
|
|
5323
5329
|
} catch {
|
|
5324
5330
|
a = await i();
|
|
5325
5331
|
}
|
|
5326
5332
|
else a = await i();
|
|
5327
5333
|
x.set(e, a);
|
|
5328
5334
|
} catch (t) {
|
|
5329
|
-
if (
|
|
5335
|
+
if (Se(t)) throw t;
|
|
5330
5336
|
x.set(e, null);
|
|
5331
5337
|
}
|
|
5332
5338
|
});
|
|
@@ -5335,29 +5341,29 @@ async function Fr(e, t, n, r, i = {}, o, s) {
|
|
|
5335
5341
|
}
|
|
5336
5342
|
for (let [n, r] of t.elements.entries()) {
|
|
5337
5343
|
if (l()) return e;
|
|
5338
|
-
if (r.type === "shape")
|
|
5344
|
+
if (r.type === "shape") dr(_, r, d, v, b, y, o ? (e) => o({
|
|
5339
5345
|
...e,
|
|
5340
5346
|
elementIndex: n,
|
|
5341
5347
|
origin: t.elementSources?.[n]?.origin ?? "slide"
|
|
5342
5348
|
}) : void 0, i.fetchImage);
|
|
5343
|
-
else if (r.type === "picture") await
|
|
5344
|
-
else if (r.type === "table")
|
|
5345
|
-
else if (r.type === "media") await
|
|
5349
|
+
else if (r.type === "picture") await Tr(_, r, d, l, i.fetchImage);
|
|
5350
|
+
else if (r.type === "table") Ar(_, r, d, b, y);
|
|
5351
|
+
else if (r.type === "media") await Er(_, r, d, l, i.fetchMedia, i.skipMediaControls, i.fetchImage);
|
|
5346
5352
|
else if (r.type === "chart") {
|
|
5347
|
-
let e =
|
|
5348
|
-
_.save(),
|
|
5349
|
-
x:
|
|
5350
|
-
y:
|
|
5351
|
-
w:
|
|
5352
|
-
h:
|
|
5353
|
-
}, e, r.rotation, i.threeD, i.regionMap, (e) => x.get(
|
|
5353
|
+
let e = J * d;
|
|
5354
|
+
_.save(), kr(_, r, d), Fe(_, r.chart, {
|
|
5355
|
+
x: Y(r.x, d),
|
|
5356
|
+
y: Y(r.y, d),
|
|
5357
|
+
w: Y(r.width, d),
|
|
5358
|
+
h: Y(r.height, d)
|
|
5359
|
+
}, e, r.rotation, i.threeD, i.regionMap, (e) => x.get(Ee(e)), i.chartEx), _.restore();
|
|
5354
5360
|
}
|
|
5355
5361
|
}
|
|
5356
|
-
return l() || i.dim &&
|
|
5362
|
+
return l() || i.dim && jr(_, i.dim, f, p), e;
|
|
5357
5363
|
}
|
|
5358
5364
|
//#endregion
|
|
5359
5365
|
//#region packages/pptx/src/google-fonts.ts
|
|
5360
|
-
var
|
|
5366
|
+
var Lr = {
|
|
5361
5367
|
...H,
|
|
5362
5368
|
...c
|
|
5363
5369
|
};
|
|
@@ -5370,7 +5376,7 @@ Object.freeze({
|
|
|
5370
5376
|
function $(e, t) {
|
|
5371
5377
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5372
5378
|
}
|
|
5373
|
-
function
|
|
5379
|
+
function Rr(e, t) {
|
|
5374
5380
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
|
|
5375
5381
|
let n = e;
|
|
5376
5382
|
if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
|
|
@@ -5380,7 +5386,7 @@ function Lr(e, t) {
|
|
|
5380
5386
|
...n.partName === void 0 ? {} : { partName: n.partName }
|
|
5381
5387
|
});
|
|
5382
5388
|
}
|
|
5383
|
-
function
|
|
5389
|
+
function zr(e) {
|
|
5384
5390
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5385
5391
|
let t = e;
|
|
5386
5392
|
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");
|
|
@@ -5393,10 +5399,10 @@ function Rr(e) {
|
|
|
5393
5399
|
minorFont: t.minorFont,
|
|
5394
5400
|
hlinkColor: t.hlinkColor,
|
|
5395
5401
|
folHlinkColor: t.folHlinkColor,
|
|
5396
|
-
slides: Object.freeze(t.slides.map(
|
|
5402
|
+
slides: Object.freeze(t.slides.map(Rr))
|
|
5397
5403
|
});
|
|
5398
5404
|
}
|
|
5399
|
-
function
|
|
5405
|
+
function Br(e) {
|
|
5400
5406
|
return Object.freeze({
|
|
5401
5407
|
type: "media",
|
|
5402
5408
|
x: e.x,
|
|
@@ -5413,7 +5419,7 @@ function zr(e) {
|
|
|
5413
5419
|
mimeType: e.mimeType
|
|
5414
5420
|
});
|
|
5415
5421
|
}
|
|
5416
|
-
function
|
|
5422
|
+
function Vr(e) {
|
|
5417
5423
|
return Object.freeze({
|
|
5418
5424
|
...e.id === void 0 ? {} : { id: e.id },
|
|
5419
5425
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
@@ -5423,10 +5429,10 @@ function Br(e) {
|
|
|
5423
5429
|
text: e.text
|
|
5424
5430
|
});
|
|
5425
5431
|
}
|
|
5426
|
-
function
|
|
5432
|
+
function Hr(e) {
|
|
5427
5433
|
return Object.freeze({ ...e });
|
|
5428
5434
|
}
|
|
5429
|
-
function
|
|
5435
|
+
function Ur(e) {
|
|
5430
5436
|
return Object.freeze({
|
|
5431
5437
|
...e.authorId === void 0 ? {} : { authorId: e.authorId },
|
|
5432
5438
|
...e.modernAuthorId === void 0 ? {} : { modernAuthorId: e.modernAuthorId },
|
|
@@ -5436,16 +5442,16 @@ function Hr(e) {
|
|
|
5436
5442
|
...e.date === void 0 ? {} : { date: e.date },
|
|
5437
5443
|
...e.x === void 0 ? {} : { x: e.x },
|
|
5438
5444
|
...e.y === void 0 ? {} : { y: e.y },
|
|
5439
|
-
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(
|
|
5445
|
+
...e.anchors?.length ? { anchors: Object.freeze(e.anchors.map(Hr)) } : {},
|
|
5440
5446
|
...e.status === void 0 ? {} : { status: e.status },
|
|
5441
5447
|
text: e.text,
|
|
5442
|
-
...e.replies?.length ? { replies: Object.freeze(e.replies.map(
|
|
5448
|
+
...e.replies?.length ? { replies: Object.freeze(e.replies.map(Vr)) } : {}
|
|
5443
5449
|
});
|
|
5444
5450
|
}
|
|
5445
|
-
function
|
|
5451
|
+
function Wr(e, t, n) {
|
|
5446
5452
|
if (e !== void 0 && typeof e != "string") throw Error(`invalid PPTX presentation preflight comment ${t} at slide ${n}`);
|
|
5447
5453
|
}
|
|
5448
|
-
function
|
|
5454
|
+
function Gr(e, t) {
|
|
5449
5455
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment reply at slide ${t}`);
|
|
5450
5456
|
let n = e;
|
|
5451
5457
|
for (let e of [
|
|
@@ -5454,16 +5460,16 @@ function Wr(e, t) {
|
|
|
5454
5460
|
"author",
|
|
5455
5461
|
"date",
|
|
5456
5462
|
"status"
|
|
5457
|
-
])
|
|
5463
|
+
]) Wr(n[e], e, t);
|
|
5458
5464
|
if (typeof n.text != "string") throw Error(`invalid PPTX presentation preflight comment reply text at slide ${t}`);
|
|
5459
5465
|
if (n.status !== void 0 && ![
|
|
5460
5466
|
"active",
|
|
5461
5467
|
"resolved",
|
|
5462
5468
|
"closed"
|
|
5463
5469
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment reply status at slide ${t}`);
|
|
5464
|
-
return
|
|
5470
|
+
return Vr(n);
|
|
5465
5471
|
}
|
|
5466
|
-
function
|
|
5472
|
+
function Kr(e, t) {
|
|
5467
5473
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment at slide ${t}`);
|
|
5468
5474
|
let n = e;
|
|
5469
5475
|
for (let e of [
|
|
@@ -5472,7 +5478,7 @@ function Gr(e, t) {
|
|
|
5472
5478
|
"author",
|
|
5473
5479
|
"date",
|
|
5474
5480
|
"status"
|
|
5475
|
-
])
|
|
5481
|
+
]) Wr(n[e], e, t);
|
|
5476
5482
|
for (let e of [
|
|
5477
5483
|
"authorId",
|
|
5478
5484
|
"index",
|
|
@@ -5488,23 +5494,23 @@ function Gr(e, t) {
|
|
|
5488
5494
|
"resolved",
|
|
5489
5495
|
"closed"
|
|
5490
5496
|
].includes(n.status)) throw Error(`invalid PPTX presentation preflight comment status at slide ${t}`);
|
|
5491
|
-
return
|
|
5497
|
+
return Ur({
|
|
5492
5498
|
...n,
|
|
5493
|
-
...n.anchors?.length ? { anchors: n.anchors.map((e) =>
|
|
5494
|
-
...n.replies?.length ? { replies: n.replies.map((e) =>
|
|
5499
|
+
...n.anchors?.length ? { anchors: n.anchors.map((e) => qr(e, t)) } : {},
|
|
5500
|
+
...n.replies?.length ? { replies: n.replies.map((e) => Gr(e, t)) } : {}
|
|
5495
5501
|
});
|
|
5496
5502
|
}
|
|
5497
|
-
function
|
|
5503
|
+
function qr(e, t) {
|
|
5498
5504
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight comment anchor at slide ${t}`);
|
|
5499
5505
|
let n = e;
|
|
5500
5506
|
if (n.type === "slide" || n.type === "unknown") return Object.freeze({ type: n.type });
|
|
5501
|
-
if (n.type === "drawingElement") return
|
|
5507
|
+
if (n.type === "drawingElement") return Wr(n.elementId, "anchor.elementId", t), Wr(n.creationId, "anchor.creationId", t), Object.freeze({
|
|
5502
5508
|
type: "drawingElement",
|
|
5503
5509
|
...n.elementId === void 0 ? {} : { elementId: n.elementId },
|
|
5504
5510
|
...n.creationId === void 0 ? {} : { creationId: n.creationId }
|
|
5505
5511
|
});
|
|
5506
5512
|
if (n.type === "textRange") {
|
|
5507
|
-
|
|
5513
|
+
Wr(n.elementId, "anchor.elementId", t);
|
|
5508
5514
|
for (let e of ["start", "length"]) {
|
|
5509
5515
|
let r = n[e];
|
|
5510
5516
|
if (r !== void 0 && (typeof r != "number" || !Number.isSafeInteger(r))) throw Error(`invalid PPTX presentation preflight comment anchor.${e} at slide ${t}`);
|
|
@@ -5518,7 +5524,7 @@ function Kr(e, t) {
|
|
|
5518
5524
|
}
|
|
5519
5525
|
throw Error(`invalid PPTX presentation preflight comment anchor type at slide ${t}`);
|
|
5520
5526
|
}
|
|
5521
|
-
function
|
|
5527
|
+
function Jr(e, t) {
|
|
5522
5528
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
|
|
5523
5529
|
let n = e;
|
|
5524
5530
|
for (let e of [
|
|
@@ -5529,9 +5535,9 @@ function qr(e, t) {
|
|
|
5529
5535
|
"rotation"
|
|
5530
5536
|
]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
|
|
5531
5537
|
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}`);
|
|
5532
|
-
return
|
|
5538
|
+
return Br(n);
|
|
5533
5539
|
}
|
|
5534
|
-
function
|
|
5540
|
+
function Yr(e) {
|
|
5535
5541
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
5536
5542
|
let t = e;
|
|
5537
5543
|
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");
|
|
@@ -5545,8 +5551,8 @@ function Jr(e) {
|
|
|
5545
5551
|
...n.partName === void 0 ? {} : { partName: n.partName },
|
|
5546
5552
|
notes: n.notes,
|
|
5547
5553
|
hidden: n.hidden,
|
|
5548
|
-
mediaElements: Object.freeze(n.mediaElements.map((e) =>
|
|
5549
|
-
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) =>
|
|
5554
|
+
mediaElements: Object.freeze(n.mediaElements.map((e) => Jr(e, t))),
|
|
5555
|
+
...n.comments?.length ? { comments: Object.freeze(n.comments.map((e) => Kr(e, t))) } : {}
|
|
5550
5556
|
});
|
|
5551
5557
|
}), r = t.fontPreloadNames.map((e, t) => {
|
|
5552
5558
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
|
|
@@ -5565,7 +5571,7 @@ function Jr(e) {
|
|
|
5565
5571
|
fontPreloadNames: Object.freeze(r)
|
|
5566
5572
|
});
|
|
5567
5573
|
}
|
|
5568
|
-
function
|
|
5574
|
+
function Xr(e, t) {
|
|
5569
5575
|
for (let n of e.slides) for (let e of n.mediaElements) {
|
|
5570
5576
|
if (e.mediaPath === t) return e.mimeType;
|
|
5571
5577
|
if (e.posterPath === t) return e.posterMimeType;
|
|
@@ -5574,7 +5580,7 @@ function Yr(e, t) {
|
|
|
5574
5580
|
}
|
|
5575
5581
|
//#endregion
|
|
5576
5582
|
//#region packages/pptx/src/slide-pull-client.ts
|
|
5577
|
-
var
|
|
5583
|
+
var Zr = 1024 * 1024, Qr = class {
|
|
5578
5584
|
active = /* @__PURE__ */ new Set();
|
|
5579
5585
|
nextSessionId = 1;
|
|
5580
5586
|
constructor(e) {
|
|
@@ -5595,7 +5601,7 @@ var Xr = 1024 * 1024, Zr = class {
|
|
|
5595
5601
|
this.active.add(a);
|
|
5596
5602
|
try {
|
|
5597
5603
|
await this.options.open(e, i, n);
|
|
5598
|
-
let r = await
|
|
5604
|
+
let r = await ei(a);
|
|
5599
5605
|
try {
|
|
5600
5606
|
let e = r.usage ?? a.usageCheckpoint;
|
|
5601
5607
|
e && this.options.onUsage?.(e);
|
|
@@ -5618,20 +5624,20 @@ var Xr = 1024 * 1024, Zr = class {
|
|
|
5618
5624
|
if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
|
|
5619
5625
|
}
|
|
5620
5626
|
};
|
|
5621
|
-
function
|
|
5627
|
+
function $r(e) {
|
|
5622
5628
|
return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
|
|
5623
5629
|
}
|
|
5624
|
-
async function
|
|
5630
|
+
async function ei(e) {
|
|
5625
5631
|
try {
|
|
5626
|
-
return await e.pull(
|
|
5632
|
+
return await e.pull(Zr);
|
|
5627
5633
|
} catch (t) {
|
|
5628
|
-
let n =
|
|
5634
|
+
let n = ti(t);
|
|
5629
5635
|
if (n === void 0) throw t;
|
|
5630
5636
|
return e.pull(n);
|
|
5631
5637
|
}
|
|
5632
5638
|
}
|
|
5633
|
-
function
|
|
5634
|
-
return O(e,
|
|
5639
|
+
function ti(e) {
|
|
5640
|
+
return O(e, Zr, u);
|
|
5635
5641
|
}
|
|
5636
5642
|
//#endregion
|
|
5637
|
-
export {
|
|
5643
|
+
export { Yr as a, Fr as c, zr as i, Ut as l, $r as n, Lr as o, Xr as r, Nr as s, Qr as t };
|