@silurus/ooxml 0.79.1 → 0.80.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/README.md +22 -15
- package/dist/assets/render-worker-BC6Wez97.js +7 -0
- package/dist/assets/render-worker-DidI5svV.js +21 -0
- package/dist/assets/render-worker-n3fNJ5XR.js +8 -0
- package/dist/{canvas-viewer-mechanics-DJ9yfiLN.js → canvas-viewer-mechanics-BdMdqj1R.js} +1 -1
- package/dist/{document-pull-client-DYoybVCn.js → document-pull-client-Dk2EnTL7.js} +2246 -2253
- package/dist/{docx-CSk_-kj_.js → docx-Dw1kxR2M.js} +107 -105
- package/dist/docx.mjs +4 -4
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-vYf5DWek.js +1002 -0
- package/dist/{line-metrics-A77J_KRx.js → line-metrics-BY-aNaLO.js} +2064 -1925
- package/dist/math.mjs +34 -24
- package/dist/node.mjs +186 -186
- package/dist/{pptx-CO1Ut97p.js → pptx-CE7xARJ_.js} +128 -126
- package/dist/pptx.mjs +5 -5
- package/dist/region-map.mjs +75 -74
- package/dist/{render-C5m7Ddwx.js → render-C4IiRZiF.js} +1 -1
- package/dist/render-worker-host-1VHH_HQk.js +9 -0
- package/dist/render-worker-host-BVOjz-oV.js +9 -0
- package/dist/render-worker-host-D9mO9qMj.js +9 -0
- package/dist/renderer-module-contract-BNGz8HvO.js +30 -0
- package/dist/{resource-measurement-COxqtfGk.js → resource-measurement-DOQetcWm.js} +7 -7
- package/dist/{session-CJwZaquG.js → session-BYh13Iu2.js} +9 -9
- package/dist/{slide-pull-client-CFHNk0ek.js → slide-pull-client-v6Feibq1.js} +847 -861
- package/dist/three-d.mjs +339 -325
- package/dist/types/docx.d.ts +7 -7
- package/dist/types/index.d.ts +9 -9
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +2 -2
- package/dist/types/pptx.d.ts +7 -7
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/xlsx.d.ts +7 -7
- package/dist/{worksheet-pull-client-CziyJf24.js → worksheet-pull-client-Nk7nbD3-.js} +13 -13
- package/dist/{xlsx-DHQmjAfh.js → xlsx-zy51yoRg.js} +1206 -1216
- package/dist/xlsx.mjs +5 -5
- package/package.json +4 -1
- package/dist/line-distribute-CU7vu7XS.js +0 -1002
- package/dist/render-worker-host-BhMT5U73.js +0 -27
- package/dist/render-worker-host-DNMxGh5s.js +0 -27
- package/dist/render-worker-host-DWyg7wio.js +0 -27
- /package/dist/{highlight-rect-cCvVU-MW.js → highlight-rect-BuX5rWP4.js} +0 -0
- /package/dist/{mathjax-Dqo857oC.js → mathjax-DgAl7Yi5.js} +0 -0
- /package/dist/{transfer-3QEJrsJa.js → transfer-CKZ79zFw.js} +0 -0
- /package/dist/{visible-index-CKvgpUrf.js → visible-index-BjesVGhg.js} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { $t as e, A as t, At as n, Bt as r, C as i,
|
|
2
|
-
import { a as
|
|
3
|
-
import { b as Y, r as
|
|
4
|
-
import { i as
|
|
5
|
-
import { t as Te } from "./mathjax-Dqo857oC.js";
|
|
1
|
+
import { $t as e, A as t, At as n, Bt as r, C as i, Ct as a, D as o, Dt as s, Ft as c, Gt as l, Ht as u, Jt as d, K as f, Kt as p, Lt as m, M as h, Mt as g, N as _, Nt as v, O as y, Qt as b, S as x, St as S, Ut as C, Wt as w, Yt as T, Zt as E, _ as D, _t as O, an as k, bt as A, c as j, ct as M, d as N, en as P, f as F, g as I, gt as L, h as R, ht as z, i as B, in as V, j as H, kt as U, m as W, mt as G, n as K, nn as q, p as ee, pt as J, qt as te, r as ne, rn as re, s as ie, sn as ae, tn as oe, u as se, vt as ce, w as le, wt as ue, y as de, yt as fe, zt as pe } from "./line-metrics-BY-aNaLO.js";
|
|
2
|
+
import { a as me, c as he, d as ge, i as _e, l as ve, n as ye, o as be, r as xe, s as Se, t as Ce, u as we } from "./line-distribute-vYf5DWek.js";
|
|
3
|
+
import { b as Y, r as Te } from "./dash-CMzZIDz_.js";
|
|
4
|
+
import { i as Ee } from "./resource-measurement-DOQetcWm.js";
|
|
6
5
|
//#region packages/pptx/src/types.ts
|
|
7
|
-
function
|
|
6
|
+
function De(e) {
|
|
8
7
|
return e;
|
|
9
8
|
}
|
|
10
|
-
var
|
|
9
|
+
var Oe = {
|
|
11
10
|
textarchdown: {
|
|
12
11
|
adj: [["adj", "val 0"]],
|
|
13
12
|
gd: [
|
|
@@ -2389,22 +2388,22 @@ var De = {
|
|
|
2389
2388
|
]
|
|
2390
2389
|
}]
|
|
2391
2390
|
}
|
|
2392
|
-
},
|
|
2393
|
-
function je(e) {
|
|
2394
|
-
return e.toLowerCase() in ke;
|
|
2395
|
-
}
|
|
2391
|
+
}, ke = Math.PI * 2 / 216e5, Ae = Oe, je = /* @__PURE__ */ new Map();
|
|
2396
2392
|
function Me(e) {
|
|
2397
|
-
|
|
2393
|
+
return e.toLowerCase() in Ae;
|
|
2394
|
+
}
|
|
2395
|
+
function Ne(e) {
|
|
2396
|
+
let t = je.get(e);
|
|
2398
2397
|
if (t) return t;
|
|
2399
|
-
let n =
|
|
2398
|
+
let n = Ae[e];
|
|
2400
2399
|
return n ? (t = {
|
|
2401
|
-
adj: n.adj.map(([e, t]) => [e,
|
|
2402
|
-
gd: n.gd.map(([e, t]) => [e,
|
|
2400
|
+
adj: n.adj.map(([e, t]) => [e, p(t)]),
|
|
2401
|
+
gd: n.gd.map(([e, t]) => [e, p(t)]),
|
|
2403
2402
|
paths: n.paths
|
|
2404
|
-
},
|
|
2403
|
+
}, je.set(e, t), t) : null;
|
|
2405
2404
|
}
|
|
2406
|
-
var
|
|
2407
|
-
function
|
|
2405
|
+
var Pe = 48;
|
|
2406
|
+
function Fe(e, t, n, r) {
|
|
2408
2407
|
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;
|
|
2409
2408
|
for (let n of e.cmds) switch (n[0]) {
|
|
2410
2409
|
case "m":
|
|
@@ -2421,8 +2420,8 @@ function Pe(e, t, n, r) {
|
|
|
2421
2420
|
break;
|
|
2422
2421
|
case "C": {
|
|
2423
2422
|
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]));
|
|
2424
|
-
for (let t = 1; t <=
|
|
2425
|
-
let n = t /
|
|
2423
|
+
for (let t = 1; t <= Pe; t++) {
|
|
2424
|
+
let n = t / Pe, o = 1 - n, s = o * o * o * l + 3 * o * o * n * e + 3 * o * n * n * i + n * n * n * d, p = o * o * o * u + 3 * o * o * n * r + 3 * o * n * n * a + n * n * n * f;
|
|
2426
2425
|
c.push({
|
|
2427
2426
|
x: s,
|
|
2428
2427
|
y: p
|
|
@@ -2433,8 +2432,8 @@ function Pe(e, t, n, r) {
|
|
|
2433
2432
|
}
|
|
2434
2433
|
case "Q": {
|
|
2435
2434
|
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]));
|
|
2436
|
-
for (let t = 1; t <=
|
|
2437
|
-
let n = t /
|
|
2435
|
+
for (let t = 1; t <= Pe; t++) {
|
|
2436
|
+
let n = t / Pe, o = 1 - n, s = o * o * l + 2 * o * n * e + n * n * i, d = o * o * u + 2 * o * n * r + n * n * a;
|
|
2438
2437
|
c.push({
|
|
2439
2438
|
x: s,
|
|
2440
2439
|
y: d
|
|
@@ -2444,9 +2443,9 @@ function Pe(e, t, n, r) {
|
|
|
2444
2443
|
break;
|
|
2445
2444
|
}
|
|
2446
2445
|
case "a": {
|
|
2447
|
-
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) *
|
|
2446
|
+
let e = t.resolve(n[1]), r = t.resolve(n[2]), o = e * i, s = r * a, d = t.resolve(n[3]) * ke, f = t.resolve(n[4]) * ke, p = (t) => Math.atan2(e * Math.sin(t), r * Math.cos(t)), m = Math.PI * 2, h = p(d), g = Math.trunc(f / m), _ = f - g * m, v = p(d + _) - h;
|
|
2448
2447
|
_ > 0 && v < 0 ? v += m : _ < 0 && v > 0 && (v -= m);
|
|
2449
|
-
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(
|
|
2448
|
+
let y = v + g * m, b = l - o * Math.cos(h), x = u - s * Math.sin(h), S = Math.max(Pe, Math.ceil(Math.abs(y) / m * 96));
|
|
2450
2449
|
for (let e = 1; e <= S; e++) {
|
|
2451
2450
|
let t = h + y * e / S;
|
|
2452
2451
|
c.push({
|
|
@@ -2461,7 +2460,7 @@ function Pe(e, t, n, r) {
|
|
|
2461
2460
|
}
|
|
2462
2461
|
return c;
|
|
2463
2462
|
}
|
|
2464
|
-
function
|
|
2463
|
+
function Ie(e) {
|
|
2465
2464
|
let t = [0];
|
|
2466
2465
|
for (let n = 1; n < e.length; n++) {
|
|
2467
2466
|
let r = e[n].x - e[n - 1].x, i = e[n].y - e[n - 1].y;
|
|
@@ -2469,23 +2468,23 @@ function Fe(e) {
|
|
|
2469
2468
|
}
|
|
2470
2469
|
return t;
|
|
2471
2470
|
}
|
|
2472
|
-
function
|
|
2473
|
-
let i =
|
|
2471
|
+
function Le(e, t, n, r) {
|
|
2472
|
+
let i = Ne(e.toLowerCase());
|
|
2474
2473
|
if (!i || i.paths.length === 0) return null;
|
|
2475
|
-
let a =
|
|
2474
|
+
let a = te({
|
|
2476
2475
|
w: n,
|
|
2477
2476
|
h: r,
|
|
2478
2477
|
adj: t
|
|
2479
|
-
}, i.adj, i.gd), o = i.paths.length === 1, s =
|
|
2478
|
+
}, i.adj, i.gd), o = i.paths.length === 1, s = Fe(i.paths[0], a, n, r), c = o ? s : Fe(i.paths[i.paths.length - 1], a, n, r);
|
|
2480
2479
|
return {
|
|
2481
2480
|
top: s,
|
|
2482
|
-
bottom:
|
|
2483
|
-
topLen:
|
|
2484
|
-
bottomLen:
|
|
2481
|
+
bottom: c,
|
|
2482
|
+
topLen: Ie(s),
|
|
2483
|
+
bottomLen: Ie(c),
|
|
2485
2484
|
singleEdge: o
|
|
2486
2485
|
};
|
|
2487
2486
|
}
|
|
2488
|
-
function
|
|
2487
|
+
function Re(e, t, n) {
|
|
2489
2488
|
let r = t[t.length - 1];
|
|
2490
2489
|
if (e.length === 1 || r === 0) return {
|
|
2491
2490
|
x: e[0].x,
|
|
@@ -2506,17 +2505,17 @@ function Le(e, t, n) {
|
|
|
2506
2505
|
ty: f / p
|
|
2507
2506
|
};
|
|
2508
2507
|
}
|
|
2509
|
-
function
|
|
2508
|
+
function ze(e) {
|
|
2510
2509
|
return e.topLen[e.topLen.length - 1] ?? 0;
|
|
2511
2510
|
}
|
|
2512
|
-
function
|
|
2511
|
+
function Be(e, t) {
|
|
2513
2512
|
if (!e.singleEdge) return 1;
|
|
2514
|
-
let n =
|
|
2513
|
+
let n = ze(e);
|
|
2515
2514
|
return n <= 0 ? 1 : Math.max(0, Math.min(1, t / n));
|
|
2516
2515
|
}
|
|
2517
|
-
function
|
|
2516
|
+
function Ve(e, t, n, r) {
|
|
2518
2517
|
if (e.singleEdge) {
|
|
2519
|
-
let i =
|
|
2518
|
+
let i = Re(e.top, e.topLen, t), a = Math.atan2(i.ty, i.tx), o = i.ty, s = -i.tx, c = n * (1 - r);
|
|
2520
2519
|
return {
|
|
2521
2520
|
x: i.x - o * c,
|
|
2522
2521
|
y: i.y - s * c,
|
|
@@ -2525,7 +2524,7 @@ function Be(e, t, n, r) {
|
|
|
2525
2524
|
shear: 0
|
|
2526
2525
|
};
|
|
2527
2526
|
}
|
|
2528
|
-
let i =
|
|
2527
|
+
let i = Re(e.top, e.topLen, t), a = Re(e.bottom, e.bottomLen, t), o = a.x - i.x, s = a.y - i.y, c = i.x + o * r, l = i.y + s * r, u = i.tx + a.tx, d = i.ty + a.ty, f = Math.atan2(d, u), p = Math.cos(f), m = Math.sin(f), h = (p * o + m * s) / (n > 0 ? n : 1), g = (-m * o + p * s) / (n > 0 ? n : 1);
|
|
2529
2528
|
return {
|
|
2530
2529
|
x: c,
|
|
2531
2530
|
y: l,
|
|
@@ -2536,16 +2535,16 @@ function Be(e, t, n, r) {
|
|
|
2536
2535
|
}
|
|
2537
2536
|
//#endregion
|
|
2538
2537
|
//#region packages/core/src/shape/effects.ts
|
|
2539
|
-
function
|
|
2538
|
+
function He(e, t) {
|
|
2540
2539
|
return [t === "tl" || t === "l" || t === "bl" ? e.x : t === "tr" || t === "r" || t === "br" ? e.x + e.w : e.x + e.w / 2, t === "tl" || t === "t" || t === "tr" ? e.y : t === "l" || t === "ctr" || t === "r" ? e.y + e.h / 2 : e.y + e.h];
|
|
2541
2540
|
}
|
|
2542
|
-
function
|
|
2541
|
+
function Ue(e, t) {
|
|
2543
2542
|
return e * t;
|
|
2544
2543
|
}
|
|
2545
|
-
function
|
|
2544
|
+
function We(e) {
|
|
2546
2545
|
return e.getContext("2d") ?? null;
|
|
2547
2546
|
}
|
|
2548
|
-
function
|
|
2547
|
+
function Ge(e, t, n, r) {
|
|
2549
2548
|
let i = Math.max(0, Math.floor(e.x - t)), a = Math.max(0, Math.floor(e.y - t)), o = Math.min(n, Math.ceil(e.x + e.w + t)), s = Math.min(r, Math.ceil(e.y + e.h + t));
|
|
2550
2549
|
return {
|
|
2551
2550
|
x: i,
|
|
@@ -2554,7 +2553,7 @@ function We(e, t, n, r) {
|
|
|
2554
2553
|
h: Math.max(1, s - a)
|
|
2555
2554
|
};
|
|
2556
2555
|
}
|
|
2557
|
-
function
|
|
2556
|
+
function Ke(e, t) {
|
|
2558
2557
|
if (t.x === 0 && t.y === 0) return e;
|
|
2559
2558
|
let n = t.x, r = t.y;
|
|
2560
2559
|
return new Proxy(e, {
|
|
@@ -2570,67 +2569,67 @@ function Ge(e, t) {
|
|
|
2570
2569
|
}
|
|
2571
2570
|
});
|
|
2572
2571
|
}
|
|
2573
|
-
function
|
|
2574
|
-
let
|
|
2575
|
-
if (!g) return !1;
|
|
2576
|
-
let _ = Ue(g);
|
|
2572
|
+
function qe(t, n, r, i, a, o, s, c = 0, l) {
|
|
2573
|
+
let u = Math.max(0, Ue(i.blur, a)), d = Ue(i.dist, a), f = i.rotWithShape === !1 ? 0 : c, p = (i.dir + f) * Math.PI / 180, m = Math.cos(p) * d, h = Math.sin(p) * d, g = Ge(r, Math.ceil(u * 3 + Math.max(Math.abs(m), Math.abs(h))) + 2, o, s), _ = e(g.w, g.h);
|
|
2577
2574
|
if (!_) return !1;
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
let
|
|
2575
|
+
let v = We(_);
|
|
2576
|
+
if (!v) return !1;
|
|
2577
|
+
n(Ke(v, g)), v.save(), v.setTransform(1, 0, 0, 1, 0, 0), v.globalCompositeOperation = "source-in", v.fillStyle = E(i.color, i.alpha), v.fillRect(0, 0, g.w, g.h), v.restore(), t.save(), u > 0 && (t.filter = `blur(${u}px)`);
|
|
2578
|
+
let [y, b] = l ?? He(r, i.algn ?? "b"), x = i.sx ?? 1, S = i.sy ?? 1, C = Math.tan((i.kx ?? 0) * Math.PI / 180), w = Math.tan((i.ky ?? 0) * Math.PI / 180);
|
|
2579
|
+
return t.translate(m, h), t.translate(y, b), f !== 0 && t.rotate(f * Math.PI / 180), t.transform(x, w, C, S, 0, 0), f !== 0 && t.rotate(-f * Math.PI / 180), t.translate(-y, -b), t.drawImage(_, g.x, g.y), t.restore(), !0;
|
|
2580
|
+
}
|
|
2581
|
+
function Je(t, n, r, i, a, o, s) {
|
|
2582
|
+
let c = Ue(i.blur, a), l = Ue(i.dist, a), u = i.dir * Math.PI / 180, d = Math.cos(u) * l, f = Math.sin(u) * l, p = Ge(r, Math.ceil(3 * c + Math.abs(l)) + 2, o, s), m = e(p.w, p.h);
|
|
2586
2583
|
if (!m) return;
|
|
2587
|
-
let h =
|
|
2588
|
-
|
|
2584
|
+
let h = We(m);
|
|
2585
|
+
if (!h) return;
|
|
2586
|
+
let g = Ke(h, p);
|
|
2587
|
+
g.save(), g.fillStyle = E(i.color, i.alpha), n(g), g.restore(), g.save(), g.globalCompositeOperation = "destination-out", g.filter = c > 0 ? `blur(${c}px)` : "none", g.translate(d, f), g.fillStyle = "#000", n(g), g.restore(), g.save(), g.globalCompositeOperation = "destination-in", g.filter = "none", g.fillStyle = "#000", n(g), g.restore(), t.save(), t.drawImage(m, p.x, p.y), t.restore();
|
|
2589
2588
|
}
|
|
2590
|
-
function
|
|
2591
|
-
let
|
|
2592
|
-
if (
|
|
2593
|
-
t
|
|
2589
|
+
function Ye(t, n, r, i, a, o, s, c) {
|
|
2590
|
+
let l = Ue(i.radius, a);
|
|
2591
|
+
if (l <= 0) {
|
|
2592
|
+
n(t);
|
|
2594
2593
|
return;
|
|
2595
2594
|
}
|
|
2596
|
-
let
|
|
2597
|
-
if (!
|
|
2598
|
-
t
|
|
2595
|
+
let u = Ge(r, Math.ceil(l) + 2, o, s), d = r.x - u.x, f = r.y - u.y, p = e(u.w, u.h);
|
|
2596
|
+
if (!p) {
|
|
2597
|
+
n(t);
|
|
2599
2598
|
return;
|
|
2600
2599
|
}
|
|
2601
|
-
let
|
|
2602
|
-
if (!
|
|
2603
|
-
t
|
|
2600
|
+
let m = We(p);
|
|
2601
|
+
if (!m) {
|
|
2602
|
+
n(t);
|
|
2604
2603
|
return;
|
|
2605
2604
|
}
|
|
2606
|
-
let
|
|
2607
|
-
|
|
2608
|
-
let
|
|
2609
|
-
if (
|
|
2610
|
-
let
|
|
2611
|
-
|
|
2605
|
+
let h = Ke(m, u), g = c ?? n;
|
|
2606
|
+
n(h);
|
|
2607
|
+
let _ = e(u.w, u.h), v = e(u.w, u.h), y = _ ? We(_) : null, b = v ? We(v) : null;
|
|
2608
|
+
if (_ && y && v && b) {
|
|
2609
|
+
let e = Ke(y, u);
|
|
2610
|
+
e.fillStyle = "#000", g(e), b.drawImage(p, d, f, r.w, r.h, d - l, f - l, r.w + l * 2, r.h + l * 2), b.drawImage(p, 0, 0), b.globalCompositeOperation = "destination-in", b.filter = `blur(${l / 3}px)`, b.drawImage(_, 0, 0), b.filter = "none", b.globalCompositeOperation = "source-over", t.save(), t.drawImage(v, u.x, u.y), t.restore();
|
|
2612
2611
|
return;
|
|
2613
2612
|
}
|
|
2614
|
-
|
|
2613
|
+
t.save(), t.drawImage(p, 0, 0), t.restore();
|
|
2615
2614
|
}
|
|
2616
|
-
function
|
|
2617
|
-
let
|
|
2618
|
-
if (!s) return;
|
|
2619
|
-
let c = Ue(s);
|
|
2615
|
+
function Xe(t, n, r, i, a, o, s) {
|
|
2616
|
+
let c = e(o, s);
|
|
2620
2617
|
if (!c) return;
|
|
2621
|
-
let l =
|
|
2622
|
-
|
|
2623
|
-
let u =
|
|
2624
|
-
|
|
2625
|
-
let
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2618
|
+
let l = We(c);
|
|
2619
|
+
if (!l) return;
|
|
2620
|
+
let u = Ue(i.blur, a);
|
|
2621
|
+
l.save(), u > 0 && (l.filter = `blur(${u}px)`), n(l), l.restore(), l.save(), l.globalCompositeOperation = "destination-in";
|
|
2622
|
+
let d = r.y, f = r.y + r.h, p = l.createLinearGradient(0, f, 0, d), m = Ze(i.stPos), h = Ze(i.endPos);
|
|
2623
|
+
p.addColorStop(0, `rgba(0,0,0,${i.stA})`), m > 0 && p.addColorStop(m, `rgba(0,0,0,${i.stA})`), h < 1 && h > m && p.addColorStop(h, `rgba(0,0,0,${i.endA})`), p.addColorStop(1, `rgba(0,0,0,${i.endA})`), l.fillStyle = p, l.fillRect(0, 0, o, s), l.restore();
|
|
2624
|
+
let g = Ue(i.dist, a), _ = i.dir * Math.PI / 180, v = Math.cos(_) * g, y = Math.sin(_) * g;
|
|
2625
|
+
t.save(), t.translate(r.x + v, f + y), t.scale(i.sx, i.sy), t.translate(-r.x, -f), t.drawImage(c, 0, 0), t.restore();
|
|
2626
|
+
}
|
|
2627
|
+
function Ze(e) {
|
|
2629
2628
|
return e < 0 ? 0 : e > 1 ? 1 : e;
|
|
2630
2629
|
}
|
|
2631
2630
|
//#endregion
|
|
2632
2631
|
//#region packages/core/src/shape/scene3d-camera.ts
|
|
2633
|
-
var
|
|
2632
|
+
var Qe = 26, $e = {
|
|
2634
2633
|
orthographicFront: {
|
|
2635
2634
|
kind: "orthographic",
|
|
2636
2635
|
baseLat: 0,
|
|
@@ -2643,52 +2642,52 @@ var Ze = 26, Qe = {
|
|
|
2643
2642
|
baseLat: 0,
|
|
2644
2643
|
baseLon: 0,
|
|
2645
2644
|
baseRev: 0,
|
|
2646
|
-
fovDeg:
|
|
2645
|
+
fovDeg: Qe
|
|
2647
2646
|
},
|
|
2648
2647
|
perspectiveRelaxed: {
|
|
2649
2648
|
kind: "perspective",
|
|
2650
2649
|
baseLat: 0,
|
|
2651
2650
|
baseLon: 0,
|
|
2652
2651
|
baseRev: 0,
|
|
2653
|
-
fovDeg:
|
|
2652
|
+
fovDeg: Qe
|
|
2654
2653
|
},
|
|
2655
2654
|
perspectiveRelaxedModerately: {
|
|
2656
2655
|
kind: "perspective",
|
|
2657
2656
|
baseLat: 0,
|
|
2658
2657
|
baseLon: 0,
|
|
2659
2658
|
baseRev: 0,
|
|
2660
|
-
fovDeg:
|
|
2659
|
+
fovDeg: Qe
|
|
2661
2660
|
},
|
|
2662
2661
|
perspectiveAbove: {
|
|
2663
2662
|
kind: "perspective",
|
|
2664
2663
|
baseLat: -20,
|
|
2665
2664
|
baseLon: 0,
|
|
2666
2665
|
baseRev: 0,
|
|
2667
|
-
fovDeg:
|
|
2666
|
+
fovDeg: Qe
|
|
2668
2667
|
},
|
|
2669
2668
|
perspectiveBelow: {
|
|
2670
2669
|
kind: "perspective",
|
|
2671
2670
|
baseLat: 20,
|
|
2672
2671
|
baseLon: 0,
|
|
2673
2672
|
baseRev: 0,
|
|
2674
|
-
fovDeg:
|
|
2673
|
+
fovDeg: Qe
|
|
2675
2674
|
},
|
|
2676
2675
|
perspectiveLeft: {
|
|
2677
2676
|
kind: "perspective",
|
|
2678
2677
|
baseLat: 0,
|
|
2679
2678
|
baseLon: -20,
|
|
2680
2679
|
baseRev: 0,
|
|
2681
|
-
fovDeg:
|
|
2680
|
+
fovDeg: Qe
|
|
2682
2681
|
},
|
|
2683
2682
|
perspectiveRight: {
|
|
2684
2683
|
kind: "perspective",
|
|
2685
2684
|
baseLat: 0,
|
|
2686
2685
|
baseLon: 20,
|
|
2687
2686
|
baseRev: 0,
|
|
2688
|
-
fovDeg:
|
|
2687
|
+
fovDeg: Qe
|
|
2689
2688
|
}
|
|
2690
2689
|
};
|
|
2691
|
-
function
|
|
2690
|
+
function et(e, t) {
|
|
2692
2691
|
let n = Array(9).fill(0);
|
|
2693
2692
|
for (let r = 0; r < 3; r++) for (let i = 0; i < 3; i++) {
|
|
2694
2693
|
let a = 0;
|
|
@@ -2697,7 +2696,7 @@ function $e(e, t) {
|
|
|
2697
2696
|
}
|
|
2698
2697
|
return n;
|
|
2699
2698
|
}
|
|
2700
|
-
function
|
|
2699
|
+
function tt(e) {
|
|
2701
2700
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2702
2701
|
return [
|
|
2703
2702
|
1,
|
|
@@ -2711,7 +2710,7 @@ function et(e) {
|
|
|
2711
2710
|
n
|
|
2712
2711
|
];
|
|
2713
2712
|
}
|
|
2714
|
-
function
|
|
2713
|
+
function nt(e) {
|
|
2715
2714
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2716
2715
|
return [
|
|
2717
2716
|
n,
|
|
@@ -2725,7 +2724,7 @@ function tt(e) {
|
|
|
2725
2724
|
n
|
|
2726
2725
|
];
|
|
2727
2726
|
}
|
|
2728
|
-
function
|
|
2727
|
+
function rt(e) {
|
|
2729
2728
|
let t = e * Math.PI / 180, n = Math.cos(t), r = Math.sin(t);
|
|
2730
2729
|
return [
|
|
2731
2730
|
n,
|
|
@@ -2739,22 +2738,22 @@ function nt(e) {
|
|
|
2739
2738
|
1
|
|
2740
2739
|
];
|
|
2741
2740
|
}
|
|
2742
|
-
function
|
|
2741
|
+
function it(e, t, n, r) {
|
|
2743
2742
|
return [
|
|
2744
2743
|
e[0] * t + e[1] * n + e[2] * r,
|
|
2745
2744
|
e[3] * t + e[4] * n + e[5] * r,
|
|
2746
2745
|
e[6] * t + e[7] * n + e[8] * r
|
|
2747
2746
|
];
|
|
2748
2747
|
}
|
|
2749
|
-
function
|
|
2748
|
+
function at(e, t) {
|
|
2750
2749
|
let n = t ? t.lat : e.baseLat, r = t ? t.lon : e.baseLon;
|
|
2751
|
-
return
|
|
2750
|
+
return et(rt(-(t ? t.rev : e.baseRev)), et(tt(-n), nt(-r)));
|
|
2752
2751
|
}
|
|
2753
|
-
function
|
|
2754
|
-
return
|
|
2752
|
+
function ot(e) {
|
|
2753
|
+
return $e[e] || (e.startsWith("perspective") ? $e.perspectiveFront : $e.orthographicFront);
|
|
2755
2754
|
}
|
|
2756
|
-
function
|
|
2757
|
-
let r =
|
|
2755
|
+
function st(e, t, n) {
|
|
2756
|
+
let r = ot(e.prst), i = at(r, e.rot);
|
|
2758
2757
|
if (t <= 0 || n <= 0) return {
|
|
2759
2758
|
corners: [
|
|
2760
2759
|
{
|
|
@@ -2786,11 +2785,11 @@ function ot(e, t, n) {
|
|
|
2786
2785
|
if (r.kind === "perspective") {
|
|
2787
2786
|
let t = e.fov ?? r.fovDeg, n = Math.max(1, Math.min(179, t)) * Math.PI / 180, a = l / Math.tan(n / 2);
|
|
2788
2787
|
u = s.map(([e, t]) => {
|
|
2789
|
-
let [n, r, o] =
|
|
2788
|
+
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);
|
|
2790
2789
|
return [n * c, r * c];
|
|
2791
2790
|
});
|
|
2792
2791
|
} else u = s.map(([e, t]) => {
|
|
2793
|
-
let [n, r] =
|
|
2792
|
+
let [n, r] = it(i, e, t, 0);
|
|
2794
2793
|
return [n, r];
|
|
2795
2794
|
});
|
|
2796
2795
|
u = u.map(([e, t]) => [e * c, t * c]);
|
|
@@ -2813,18 +2812,18 @@ function ot(e, t, n) {
|
|
|
2813
2812
|
isIdentity: _
|
|
2814
2813
|
};
|
|
2815
2814
|
}
|
|
2816
|
-
function
|
|
2817
|
-
let { isIdentity: t } =
|
|
2815
|
+
function ct(e) {
|
|
2816
|
+
let { isIdentity: t } = st(e, 1e3, 1e3);
|
|
2818
2817
|
return !t;
|
|
2819
2818
|
}
|
|
2820
|
-
function
|
|
2821
|
-
let i =
|
|
2819
|
+
function lt(e, t, n, r) {
|
|
2820
|
+
let i = ot(e.prst), a = at(i, e.rot);
|
|
2822
2821
|
if (t <= 0 || n <= 0 || r === 0) return {
|
|
2823
2822
|
x: 0,
|
|
2824
2823
|
y: 0
|
|
2825
2824
|
};
|
|
2826
2825
|
let o = t / 2, s = n / 2, c = Math.max(o, s), l = e.zoom ?? 1, u = (t) => {
|
|
2827
|
-
let [n, r, o] =
|
|
2826
|
+
let [n, r, o] = it(a, 0, 0, t);
|
|
2828
2827
|
if (i.kind === "perspective") {
|
|
2829
2828
|
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);
|
|
2830
2829
|
return [n * d * l, r * d * l];
|
|
@@ -2838,7 +2837,7 @@ function ct(e, t, n, r) {
|
|
|
2838
2837
|
}
|
|
2839
2838
|
//#endregion
|
|
2840
2839
|
//#region packages/core/src/shape/scene3d-draw.ts
|
|
2841
|
-
function
|
|
2840
|
+
function ut(e, t, n, r) {
|
|
2842
2841
|
let i = e.x, a = e.y, o = t.x, s = t.y, c = n.x, l = n.y, u = r.x, d = r.y, f = o - c, p = u - c, m = i - o + c - u, h = s - l, g = d - l, _ = a - s + l - d, v, y;
|
|
2843
2842
|
if (Math.abs(m) < 1e-12 && Math.abs(_) < 1e-12) v = 0, y = 0;
|
|
2844
2843
|
else {
|
|
@@ -2858,15 +2857,15 @@ function lt(e, t, n, r) {
|
|
|
2858
2857
|
1
|
|
2859
2858
|
];
|
|
2860
2859
|
}
|
|
2861
|
-
function
|
|
2860
|
+
function dt(e, t, n) {
|
|
2862
2861
|
let r = e[6] * t + e[7] * n + e[8];
|
|
2863
2862
|
return {
|
|
2864
2863
|
x: (e[0] * t + e[1] * n + e[2]) / r,
|
|
2865
2864
|
y: (e[3] * t + e[4] * n + e[5]) / r
|
|
2866
2865
|
};
|
|
2867
2866
|
}
|
|
2868
|
-
var
|
|
2869
|
-
function
|
|
2867
|
+
var ft = 1;
|
|
2868
|
+
function pt(e, t) {
|
|
2870
2869
|
let [n, r, i, a, o, s] = e, [c, l, u, d, f, p] = t;
|
|
2871
2870
|
return [
|
|
2872
2871
|
n * c + i * l,
|
|
@@ -2877,13 +2876,13 @@ function ft(e, t) {
|
|
|
2877
2876
|
r * f + a * p + s
|
|
2878
2877
|
];
|
|
2879
2878
|
}
|
|
2880
|
-
function
|
|
2879
|
+
function mt(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2881
2880
|
let p = c - o, m = l - s;
|
|
2882
2881
|
if (p <= 0 || m <= 0) return;
|
|
2883
|
-
let h = (d.x - u.x) / p, g = (d.y - u.y) / p, _ = (f.x - u.x) / m, v = (f.y - u.y) / m, y = (Math.hypot(d.x - u.x, d.y - u.y) || 1) * a, b = (Math.hypot(f.x - u.x, f.y - u.y) || 1) * a, x =
|
|
2882
|
+
let h = (d.x - u.x) / p, g = (d.y - u.y) / p, _ = (f.x - u.x) / m, v = (f.y - u.y) / m, y = (Math.hypot(d.x - u.x, d.y - u.y) || 1) * a, b = (Math.hypot(f.x - u.x, f.y - u.y) || 1) * a, x = ft * p / y, S = ft * m / b, C = Math.max(0, o - x), w = Math.max(0, s - S), T = Math.min(n, c + x), E = Math.min(r, l + S), D = T - C, O = E - w;
|
|
2884
2883
|
if (D <= 0 || O <= 0) return;
|
|
2885
2884
|
e.save();
|
|
2886
|
-
let [k, A, j, M, N, P] =
|
|
2885
|
+
let [k, A, j, M, N, P] = pt(i, [
|
|
2887
2886
|
h,
|
|
2888
2887
|
g,
|
|
2889
2888
|
_,
|
|
@@ -2893,22 +2892,22 @@ function pt(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
|
2893
2892
|
]);
|
|
2894
2893
|
e.setTransform(k, A, j, M, N, P), e.drawImage(t, C, w, D, O, C, w, D, O), e.restore();
|
|
2895
2894
|
}
|
|
2896
|
-
function
|
|
2897
|
-
let p =
|
|
2895
|
+
function ht(e, t, n, r, i, a, o, s, c, l, u, d, f) {
|
|
2896
|
+
let p = dt(o, s, c), m = dt(o, l, c), h = dt(o, s, u), g = dt(o, l, u), _ = (s + l) / 2, v = (c + u) / 2, y = dt(o, _, v), b = {
|
|
2898
2897
|
x: (p.x + m.x + h.x + g.x) / 4,
|
|
2899
2898
|
y: (p.y + m.y + h.y + g.y) / 4
|
|
2900
|
-
}, x =
|
|
2899
|
+
}, x = _t(i), S = Math.hypot(y.x - b.x, y.y - b.y) * x;
|
|
2901
2900
|
if (f <= 0 || S <= d) {
|
|
2902
|
-
|
|
2901
|
+
mt(e, t, n, r, i, a, s * n, c * r, l * n, u * r, p, m, h);
|
|
2903
2902
|
return;
|
|
2904
2903
|
}
|
|
2905
|
-
l - s >= u - c ? (
|
|
2904
|
+
l - s >= u - c ? (ht(e, t, n, r, i, a, o, s, c, _, u, d, f - 1), ht(e, t, n, r, i, a, o, _, c, l, u, d, f - 1)) : (ht(e, t, n, r, i, a, o, s, c, l, v, d, f - 1), ht(e, t, n, r, i, a, o, s, v, l, u, d, f - 1));
|
|
2906
2905
|
}
|
|
2907
|
-
function
|
|
2906
|
+
function gt(e, t, n, r, i, a = .5) {
|
|
2908
2907
|
if (n <= 0 || r <= 0) return;
|
|
2909
2908
|
let [o, s, c, l] = i;
|
|
2910
2909
|
if (Math.abs(o.x * s.y - s.x * o.y + s.x * c.y - c.x * s.y + c.x * l.y - l.x * c.y + l.x * o.y - o.x * l.y) / 2 < 1e-6) return;
|
|
2911
|
-
let u =
|
|
2910
|
+
let u = ut(i[0], i[1], i[2], i[3]);
|
|
2912
2911
|
if (!u) return;
|
|
2913
2912
|
let d = t.getTransform(), f = [
|
|
2914
2913
|
d.a,
|
|
@@ -2917,14 +2916,14 @@ function ht(e, t, n, r, i, a = .5) {
|
|
|
2917
2916
|
d.d,
|
|
2918
2917
|
d.e,
|
|
2919
2918
|
d.f
|
|
2920
|
-
], p =
|
|
2921
|
-
|
|
2919
|
+
], p = _t(f);
|
|
2920
|
+
Ct(e, t, n, r, i, f, p, u, a, 14) || (xt(), t.save(), t.beginPath(), t.moveTo(i[0].x, i[0].y), t.lineTo(i[1].x, i[1].y), t.lineTo(i[2].x, i[2].y), t.lineTo(i[3].x, i[3].y), t.closePath(), t.clip(), ht(t, e, n, r, f, p, u, 0, 0, 1, 1, a, 14), t.restore());
|
|
2922
2921
|
}
|
|
2923
|
-
function
|
|
2922
|
+
function _t(e) {
|
|
2924
2923
|
return Math.sqrt(Math.abs(e[0] * e[3] - e[1] * e[2])) || 1;
|
|
2925
2924
|
}
|
|
2926
|
-
function
|
|
2927
|
-
let r =
|
|
2925
|
+
function vt(e, t, n) {
|
|
2926
|
+
let r = ut(e[0], e[1], e[2], e[3]);
|
|
2928
2927
|
if (!r) return null;
|
|
2929
2928
|
let i = [
|
|
2930
2929
|
[-t, -n],
|
|
@@ -2934,52 +2933,52 @@ function _t(e, t, n) {
|
|
|
2934
2933
|
], a = [];
|
|
2935
2934
|
for (let [e, t] of i) {
|
|
2936
2935
|
if (!(r[6] * e + r[7] * t + r[8] > 1e-9)) return null;
|
|
2937
|
-
a.push(
|
|
2936
|
+
a.push(dt(r, e, t));
|
|
2938
2937
|
}
|
|
2939
2938
|
return a;
|
|
2940
2939
|
}
|
|
2941
|
-
function
|
|
2942
|
-
let r =
|
|
2943
|
-
return r && r[6] * t + r[7] * n + r[8] > 1e-9 ?
|
|
2944
|
-
}
|
|
2945
|
-
var
|
|
2946
|
-
function
|
|
2947
|
-
|
|
2948
|
-
}
|
|
2949
|
-
var
|
|
2950
|
-
function
|
|
2951
|
-
let
|
|
2952
|
-
x:
|
|
2953
|
-
y:
|
|
2954
|
-
})),
|
|
2955
|
-
for (let e of
|
|
2956
|
-
|
|
2957
|
-
let
|
|
2958
|
-
if (
|
|
2959
|
-
let
|
|
2960
|
-
if (!
|
|
2961
|
-
let
|
|
2962
|
-
if (!
|
|
2963
|
-
let
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
(
|
|
2969
|
-
(
|
|
2940
|
+
function yt(e, t, n) {
|
|
2941
|
+
let r = ut(e[0], e[1], e[2], e[3]);
|
|
2942
|
+
return r && r[6] * t + r[7] * n + r[8] > 1e-9 ? dt(r, t, n) : null;
|
|
2943
|
+
}
|
|
2944
|
+
var bt = !1;
|
|
2945
|
+
function xt() {
|
|
2946
|
+
bt || (bt = !0, typeof console < "u" && typeof console.warn == "function" && console.warn("[ooxml] scene3d: no offscreen canvas available — using the direct warp fallback (per-cell bleed only, no supersample). Textured-source seams may be faintly visible; the silhouette and geometry are unaffected."));
|
|
2947
|
+
}
|
|
2948
|
+
var St = 2;
|
|
2949
|
+
function Ct(t, n, r, i, a, o, s, c, l, u) {
|
|
2950
|
+
let d = a.map((e) => ({
|
|
2951
|
+
x: o[0] * e.x + o[2] * e.y + o[4],
|
|
2952
|
+
y: o[1] * e.x + o[3] * e.y + o[5]
|
|
2953
|
+
})), f = Infinity, p = Infinity, m = -Infinity, h = -Infinity;
|
|
2954
|
+
for (let e of d) e.x < f && (f = e.x), e.y < p && (p = e.y), e.x > m && (m = e.x), e.y > h && (h = e.y);
|
|
2955
|
+
f = Math.floor(f) - 1, p = Math.floor(p) - 1, m = Math.ceil(m) + 1, h = Math.ceil(h) + 1;
|
|
2956
|
+
let g = m - f, _ = h - p;
|
|
2957
|
+
if (g <= 0 || _ <= 0) return !1;
|
|
2958
|
+
let v = Math.max(1, Math.ceil(g * St)), y = Math.max(1, Math.ceil(_ * St)), b = e(v, y);
|
|
2959
|
+
if (!b || b.width !== v || b.height !== y) return !1;
|
|
2960
|
+
let x = b.getContext("2d") ?? null;
|
|
2961
|
+
if (!x) return !1;
|
|
2962
|
+
let S = St, C = [
|
|
2963
|
+
o[0] * S,
|
|
2964
|
+
o[1] * S,
|
|
2965
|
+
o[2] * S,
|
|
2966
|
+
o[3] * S,
|
|
2967
|
+
(o[4] - f) * S,
|
|
2968
|
+
(o[5] - p) * S
|
|
2970
2969
|
];
|
|
2971
|
-
|
|
2972
|
-
let
|
|
2973
|
-
return
|
|
2970
|
+
x.save(), x.setTransform(C[0], C[1], C[2], C[3], C[4], C[5]), x.beginPath(), x.moveTo(a[0].x, a[0].y), x.lineTo(a[1].x, a[1].y), x.lineTo(a[2].x, a[2].y), x.lineTo(a[3].x, a[3].y), x.closePath(), x.clip(), ht(x, t, r, i, C, s, c, 0, 0, 1, 1, l * S, u), x.restore(), n.save(), n.setTransform(1, 0, 0, 1, 0, 0);
|
|
2971
|
+
let w = n.imageSmoothingEnabled, T = n.imageSmoothingQuality;
|
|
2972
|
+
return n.imageSmoothingEnabled = !0, n.imageSmoothingQuality = "high", n.drawImage(b, 0, 0, g * S, _ * S, f, p, g, _), n.imageSmoothingEnabled = w, n.imageSmoothingQuality = T, n.restore(), !0;
|
|
2974
2973
|
}
|
|
2975
2974
|
//#endregion
|
|
2976
2975
|
//#region packages/core/src/shape/bevel-shading.ts
|
|
2977
|
-
function
|
|
2976
|
+
function wt(e, t) {
|
|
2978
2977
|
if (t <= 0) return () => 1;
|
|
2979
2978
|
let n = (e) => Math.max(0, Math.min(1, e / t));
|
|
2980
2979
|
switch (e) {
|
|
2981
2980
|
case "hardEdge": {
|
|
2982
|
-
let e =
|
|
2981
|
+
let e = Mt;
|
|
2983
2982
|
return (t) => {
|
|
2984
2983
|
let r = Math.min(1, n(t) / e);
|
|
2985
2984
|
return r * r * (3 - 2 * r);
|
|
@@ -2999,7 +2998,7 @@ function Ct(e, t) {
|
|
|
2999
2998
|
};
|
|
3000
2999
|
}
|
|
3001
3000
|
}
|
|
3002
|
-
function
|
|
3001
|
+
function Tt(e) {
|
|
3003
3002
|
let t = e.length, n = new Float64Array(t);
|
|
3004
3003
|
if (t === 0) return n;
|
|
3005
3004
|
let r = new Int32Array(t), i = new Float64Array(t + 1), a = 0;
|
|
@@ -3017,7 +3016,7 @@ function wt(e) {
|
|
|
3017
3016
|
}
|
|
3018
3017
|
return n;
|
|
3019
3018
|
}
|
|
3020
|
-
function
|
|
3019
|
+
function Et(e, t = 3) {
|
|
3021
3020
|
if (e <= 0) return Array(t).fill(1);
|
|
3022
3021
|
let n = Math.sqrt(12 * e * e / t + 1), r = Math.floor(n);
|
|
3023
3022
|
r % 2 == 0 && r--;
|
|
@@ -3025,7 +3024,7 @@ function Tt(e, t = 3) {
|
|
|
3025
3024
|
for (let e = 0; e < t; e++) s.push(e < o ? r : i);
|
|
3026
3025
|
return s;
|
|
3027
3026
|
}
|
|
3028
|
-
function
|
|
3027
|
+
function Dt(e, t, n, r, i, a) {
|
|
3029
3028
|
let o = 1 / (2 * i + 1);
|
|
3030
3029
|
if (a) for (let a = 0; a < r; a++) {
|
|
3031
3030
|
let r = a * n, s = 0;
|
|
@@ -3046,29 +3045,29 @@ function Et(e, t, n, r, i, a) {
|
|
|
3046
3045
|
}
|
|
3047
3046
|
}
|
|
3048
3047
|
}
|
|
3049
|
-
function
|
|
3048
|
+
function Ot(e, t, n, r) {
|
|
3050
3049
|
let i = Float64Array.from(e);
|
|
3051
3050
|
if (r <= 0 || t <= 0 || n <= 0) return i;
|
|
3052
3051
|
let a = new Float64Array(t * n);
|
|
3053
|
-
for (let e of
|
|
3052
|
+
for (let e of Et(r, 3)) {
|
|
3054
3053
|
let r = Math.max(1, (e - 1) / 2);
|
|
3055
|
-
|
|
3054
|
+
Dt(i, a, t, n, r, !0), Dt(a, i, t, n, r, !1);
|
|
3056
3055
|
}
|
|
3057
3056
|
return i;
|
|
3058
3057
|
}
|
|
3059
|
-
function
|
|
3058
|
+
function kt(e, t, n, r = 128) {
|
|
3060
3059
|
let i = new Float64Array(t * n);
|
|
3061
3060
|
for (let a = 0; a < t * n; a++) i[a] = (e[a] ?? 0) >= r ? 0x56bc75e2d63100000 : 0;
|
|
3062
3061
|
let a = new Float64Array(n);
|
|
3063
3062
|
for (let e = 0; e < t; e++) {
|
|
3064
3063
|
for (let r = 0; r < n; r++) a[r] = i[r * t + e];
|
|
3065
|
-
let r =
|
|
3064
|
+
let r = Tt(a);
|
|
3066
3065
|
for (let a = 0; a < n; a++) i[a * t + e] = r[a];
|
|
3067
3066
|
}
|
|
3068
3067
|
let o = new Float64Array(t);
|
|
3069
3068
|
for (let e = 0; e < n; e++) {
|
|
3070
3069
|
for (let n = 0; n < t; n++) o[n] = i[e * t + n];
|
|
3071
|
-
let n =
|
|
3070
|
+
let n = Tt(o);
|
|
3072
3071
|
for (let r = 0; r < t; r++) i[e * t + r] = n[r];
|
|
3073
3072
|
}
|
|
3074
3073
|
for (let e = 0; e < n; e++) for (let r = 0; r < t; r++) {
|
|
@@ -3080,15 +3079,15 @@ function Ot(e, t, n, r = 128) {
|
|
|
3080
3079
|
for (let e = 0; e < t * n; e++) i[e] = Math.sqrt(i[e]);
|
|
3081
3080
|
return i;
|
|
3082
3081
|
}
|
|
3083
|
-
var
|
|
3084
|
-
function
|
|
3082
|
+
var At = .25, jt = .35, Mt = .5;
|
|
3083
|
+
function Nt(e, t, n, r, i, a) {
|
|
3085
3084
|
let o = new Float32Array(t * n * 3), s = new Uint8Array(t * n), c = new Float32Array(t * n);
|
|
3086
3085
|
if (t <= 0 || n <= 0) return {
|
|
3087
3086
|
normals: o,
|
|
3088
3087
|
bandMask: s,
|
|
3089
3088
|
bandWeight: c
|
|
3090
3089
|
};
|
|
3091
|
-
let l =
|
|
3090
|
+
let l = kt(e, t, n), u = wt(i, r), d = (n, r) => (e[r * t + n] ?? 0) >= 128, f = (r > 0 ? a / r : 0) * r, p = Ot(l, t, n, Math.max(1, r * At)), m = (e) => {
|
|
3092
3091
|
let t = u(Math.max(0, e - .5));
|
|
3093
3092
|
return u(e + .5) - t;
|
|
3094
3093
|
};
|
|
@@ -3103,9 +3102,9 @@ function Mt(e, t, n, r, i, a) {
|
|
|
3103
3102
|
o[a * 3 + 2] = 1;
|
|
3104
3103
|
continue;
|
|
3105
3104
|
}
|
|
3106
|
-
let g = u / r, _ = 1 -
|
|
3105
|
+
let g = u / r, _ = 1 - jt, v = 1;
|
|
3107
3106
|
if (g > _) {
|
|
3108
|
-
let e = Math.min(1, (g - _) /
|
|
3107
|
+
let e = Math.min(1, (g - _) / jt);
|
|
3109
3108
|
v = 1 - e * e * (3 - 2 * e);
|
|
3110
3109
|
}
|
|
3111
3110
|
c[a] = v;
|
|
@@ -3120,7 +3119,7 @@ function Mt(e, t, n, r, i, a) {
|
|
|
3120
3119
|
bandWeight: c
|
|
3121
3120
|
};
|
|
3122
3121
|
}
|
|
3123
|
-
var
|
|
3122
|
+
var Pt = 35 * Math.PI / 180, Ft = 12 * Math.PI / 180, It = {
|
|
3124
3123
|
t: {
|
|
3125
3124
|
x: 0,
|
|
3126
3125
|
y: -1
|
|
@@ -3154,22 +3153,22 @@ var Nt = 35 * Math.PI / 180, Pt = 12 * Math.PI / 180, Ft = {
|
|
|
3154
3153
|
y: 1
|
|
3155
3154
|
}
|
|
3156
3155
|
};
|
|
3157
|
-
function
|
|
3156
|
+
function Lt(e, t, n) {
|
|
3158
3157
|
let r = n * Math.PI / 180, i = Math.cos(r), a = Math.sin(r);
|
|
3159
3158
|
return {
|
|
3160
3159
|
x: e * i - t * a,
|
|
3161
3160
|
y: e * a + t * i
|
|
3162
3161
|
};
|
|
3163
3162
|
}
|
|
3164
|
-
function
|
|
3165
|
-
let r =
|
|
3166
|
-
return n && n.rev && (r =
|
|
3163
|
+
function Rt(e, t, n) {
|
|
3164
|
+
let r = It[t] ?? It.t;
|
|
3165
|
+
return n && n.rev && (r = Lt(r.x, r.y, n.rev)), Bt(r.x, r.y, Pt);
|
|
3167
3166
|
}
|
|
3168
|
-
function
|
|
3167
|
+
function zt(e) {
|
|
3169
3168
|
let t = Math.hypot(e.x, e.y) || 1;
|
|
3170
|
-
return
|
|
3169
|
+
return Bt(-e.x / t, -e.y / t, Ft);
|
|
3171
3170
|
}
|
|
3172
|
-
function
|
|
3171
|
+
function Bt(e, t, n) {
|
|
3173
3172
|
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;
|
|
3174
3173
|
return {
|
|
3175
3174
|
x: o / l,
|
|
@@ -3177,7 +3176,7 @@ function zt(e, t, n) {
|
|
|
3177
3176
|
z: c / l
|
|
3178
3177
|
};
|
|
3179
3178
|
}
|
|
3180
|
-
var
|
|
3179
|
+
var Vt = 2, Ht = {
|
|
3181
3180
|
matte: {
|
|
3182
3181
|
ambient: .62,
|
|
3183
3182
|
diffuse: .45,
|
|
@@ -3190,8 +3189,8 @@ var Bt = 2, Vt = {
|
|
|
3190
3189
|
specular: .35,
|
|
3191
3190
|
shininess: 22
|
|
3192
3191
|
}
|
|
3193
|
-
},
|
|
3194
|
-
function
|
|
3192
|
+
}, Ut = .8;
|
|
3193
|
+
function Wt(e) {
|
|
3195
3194
|
switch (e) {
|
|
3196
3195
|
case "plastic":
|
|
3197
3196
|
case "metal":
|
|
@@ -3202,8 +3201,8 @@ function Ut(e) {
|
|
|
3202
3201
|
default: return "matte";
|
|
3203
3202
|
}
|
|
3204
3203
|
}
|
|
3205
|
-
function
|
|
3206
|
-
let r =
|
|
3204
|
+
function Gt(e, t, n = !0) {
|
|
3205
|
+
let r = Ht[e], i = {
|
|
3207
3206
|
light: t,
|
|
3208
3207
|
material: e,
|
|
3209
3208
|
ambient: r.ambient,
|
|
@@ -3211,9 +3210,9 @@ function Wt(e, t, n = !0) {
|
|
|
3211
3210
|
specular: r.specular,
|
|
3212
3211
|
shininess: r.shininess
|
|
3213
3212
|
};
|
|
3214
|
-
return n && (i.fillLight =
|
|
3213
|
+
return n && (i.fillLight = zt(t), i.fillDiffuse = i.diffuse * Ut), i;
|
|
3215
3214
|
}
|
|
3216
|
-
function
|
|
3215
|
+
function Kt(e, t) {
|
|
3217
3216
|
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;
|
|
3218
3217
|
if (t.fillLight && t.fillDiffuse) {
|
|
3219
3218
|
let n = e.x * t.fillLight.x + e.y * t.fillLight.y + e.z * t.fillLight.z;
|
|
@@ -3226,7 +3225,7 @@ function Gt(e, t) {
|
|
|
3226
3225
|
}
|
|
3227
3226
|
return Math.max(0, t.ambient + r + i + a);
|
|
3228
3227
|
}
|
|
3229
|
-
function
|
|
3228
|
+
function qt(e, t, n) {
|
|
3230
3229
|
if (!e) return {
|
|
3231
3230
|
x: 0,
|
|
3232
3231
|
y: 0,
|
|
@@ -3241,16 +3240,16 @@ function Kt(e, t, n) {
|
|
|
3241
3240
|
h: Math.max(0, o - i)
|
|
3242
3241
|
};
|
|
3243
3242
|
}
|
|
3244
|
-
function
|
|
3243
|
+
function Jt(e, t, n) {
|
|
3245
3244
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3246
3245
|
if (r <= 0 || i <= 0) return;
|
|
3247
3246
|
let a = t.widthPx;
|
|
3248
3247
|
if (a < .75) return;
|
|
3249
|
-
let { x: o, y: s, w: c, h: l } =
|
|
3248
|
+
let { x: o, y: s, w: c, h: l } = qt(n, r, i);
|
|
3250
3249
|
if (c <= 0 || l <= 0) return;
|
|
3251
3250
|
let u = e.getImageData(o, s, c, l), d = u.data, f = new Uint8ClampedArray(c * l);
|
|
3252
3251
|
for (let e = 0; e < c * l; e++) f[e] = d[e * 4 + 3];
|
|
3253
|
-
let { bandMask: p, bandWeight: m, normals: h } =
|
|
3252
|
+
let { bandMask: p, bandWeight: m, normals: h } = Nt(f, c, l, a, t.prst, t.heightPx), g = Gt(t.material, t.light), _ = Kt({
|
|
3254
3253
|
x: 0,
|
|
3255
3254
|
y: 0,
|
|
3256
3255
|
z: 1
|
|
@@ -3261,13 +3260,13 @@ function qt(e, t, n) {
|
|
|
3261
3260
|
if (n <= 0) continue;
|
|
3262
3261
|
let r = h[e * 3], i = h[e * 3 + 1], a = h[e * 3 + 2];
|
|
3263
3262
|
t.bottom && (r = -r, i = -i);
|
|
3264
|
-
let o = 1 + (
|
|
3263
|
+
let o = 1 + (Kt({
|
|
3265
3264
|
x: r,
|
|
3266
3265
|
y: i,
|
|
3267
3266
|
z: a
|
|
3268
3267
|
}, g) / _ - 1) * n, s = e * 4;
|
|
3269
3268
|
if (o >= 1) {
|
|
3270
|
-
let e = Math.min(1, (o - 1) *
|
|
3269
|
+
let e = Math.min(1, (o - 1) * Vt);
|
|
3271
3270
|
for (let t = 0; t < 3; t++) {
|
|
3272
3271
|
let n = Math.min(255, d[s + t] * o);
|
|
3273
3272
|
d[s + t] = n + (255 - n) * e;
|
|
@@ -3276,12 +3275,12 @@ function qt(e, t, n) {
|
|
|
3276
3275
|
}
|
|
3277
3276
|
e.putImageData(u, o, s);
|
|
3278
3277
|
}
|
|
3279
|
-
function
|
|
3278
|
+
function Yt(e, t, n) {
|
|
3280
3279
|
let r = e.canvas.width, i = e.canvas.height;
|
|
3281
3280
|
if (r <= 0 || i <= 0) return;
|
|
3282
3281
|
let a = t.offsetX, o = t.offsetY, s = Math.hypot(a, o);
|
|
3283
3282
|
if (s < .75) return;
|
|
3284
|
-
let { x: c, y: l, w: u, h: d } =
|
|
3283
|
+
let { x: c, y: l, w: u, h: d } = qt(n, r, i);
|
|
3285
3284
|
if (u <= 0 || d <= 0) return;
|
|
3286
3285
|
let f = e.getImageData(c, l, u, d), p = f.data, m = new Uint8ClampedArray(u * d);
|
|
3287
3286
|
for (let e = 0; e < u * d; e++) m[e] = p[e * 4 + 3];
|
|
@@ -3305,8 +3304,8 @@ function Jt(e, t, n) {
|
|
|
3305
3304
|
}
|
|
3306
3305
|
//#endregion
|
|
3307
3306
|
//#region packages/core/src/text/underline.ts
|
|
3308
|
-
function
|
|
3309
|
-
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d =
|
|
3307
|
+
function Xt(e, t, n, r, i, a, o, s = 1) {
|
|
3308
|
+
let c = Math.max(1, i * .05), l = o === "heavy" || (o?.endsWith("Heavy") ?? !1) ? c * 1.8 : c, u = n + Math.max(2, l), d = J(u, l, s);
|
|
3310
3309
|
if (e.strokeStyle = a, e.lineWidth = l, e.setLineDash([]), o && o.startsWith("wavy")) {
|
|
3311
3310
|
let n = l, i = l * 6;
|
|
3312
3311
|
e.beginPath(), e.moveTo(t, u);
|
|
@@ -3327,14 +3326,14 @@ function Yt(e, t, n, r, i, a, o, s = 1) {
|
|
|
3327
3326
|
}
|
|
3328
3327
|
if (o === "dbl") {
|
|
3329
3328
|
let n = l * 1.4, i = u - n / 2, a = u + n / 2;
|
|
3330
|
-
e.beginPath(), e.moveTo(t, i +
|
|
3329
|
+
e.beginPath(), e.moveTo(t, i + J(i, l, s)), e.lineTo(t + r, i + J(i, l, s)), e.moveTo(t, a + J(a, l, s)), e.lineTo(t + r, a + J(a, l, s)), e.stroke();
|
|
3331
3330
|
return;
|
|
3332
3331
|
}
|
|
3333
|
-
e.setLineDash(
|
|
3332
|
+
e.setLineDash(Te(o ?? "sng", l)), e.beginPath(), e.moveTo(t, u + d), e.lineTo(t + r, u + d), e.stroke(), e.setLineDash([]);
|
|
3334
3333
|
}
|
|
3335
3334
|
//#endregion
|
|
3336
3335
|
//#region packages/core/src/text/highlight-box.ts
|
|
3337
|
-
function
|
|
3336
|
+
function Zt(e, t) {
|
|
3338
3337
|
return {
|
|
3339
3338
|
top: e - t * .85,
|
|
3340
3339
|
height: t * 1.1
|
|
@@ -3342,7 +3341,7 @@ function Xt(e, t) {
|
|
|
3342
3341
|
}
|
|
3343
3342
|
//#endregion
|
|
3344
3343
|
//#region packages/core/src/text/justify-positions.ts
|
|
3345
|
-
function
|
|
3344
|
+
function Qt(e, t, n, r, i = 0) {
|
|
3346
3345
|
let a = [], o = 0, s = 0;
|
|
3347
3346
|
for (let c of t) a.push({
|
|
3348
3347
|
text: e.slice(o, c).join(""),
|
|
@@ -3355,14 +3354,14 @@ function Zt(e, t, n, r, i = 0) {
|
|
|
3355
3354
|
}
|
|
3356
3355
|
//#endregion
|
|
3357
3356
|
//#region packages/pptx/src/reflection-blur.ts
|
|
3358
|
-
var
|
|
3359
|
-
function
|
|
3357
|
+
var $t = .5;
|
|
3358
|
+
function en(e, t) {
|
|
3360
3359
|
if (!(t > 0) || !(e.h > 0)) return [{
|
|
3361
3360
|
y: e.y,
|
|
3362
3361
|
h: Math.max(0, e.h),
|
|
3363
3362
|
radius: 0
|
|
3364
3363
|
}];
|
|
3365
|
-
let n = Math.max(4, Math.min(24, Math.ceil(t /
|
|
3364
|
+
let n = Math.max(4, Math.min(24, Math.ceil(t / $t) + 1)), r = e.y + e.h, i = [];
|
|
3366
3365
|
for (let a = 0; a < n; a++) {
|
|
3367
3366
|
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;
|
|
3368
3367
|
i.push({
|
|
@@ -3373,20 +3372,20 @@ function $t(e, t) {
|
|
|
3373
3372
|
}
|
|
3374
3373
|
return i;
|
|
3375
3374
|
}
|
|
3376
|
-
function
|
|
3377
|
-
for (let a of
|
|
3375
|
+
function tn(e, t, n, r, i) {
|
|
3376
|
+
for (let a of en(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();
|
|
3378
3377
|
}
|
|
3379
3378
|
//#endregion
|
|
3380
3379
|
//#region packages/pptx/src/hyperlink.ts
|
|
3381
|
-
function
|
|
3380
|
+
function nn(e, t) {
|
|
3382
3381
|
let n = e !== void 0 && e !== "" ? e : void 0, r = t !== void 0 && t !== "" ? t : void 0;
|
|
3383
3382
|
if (n === void 0 && r === void 0) return;
|
|
3384
3383
|
if (r !== void 0) return {
|
|
3385
3384
|
kind: "internal",
|
|
3386
3385
|
ref: n ?? r
|
|
3387
3386
|
};
|
|
3388
|
-
let i = n, a =
|
|
3389
|
-
return a !== null &&
|
|
3387
|
+
let i = n, a = B(i);
|
|
3388
|
+
return a !== null && ne.includes(a) ? {
|
|
3390
3389
|
kind: "external",
|
|
3391
3390
|
url: i
|
|
3392
3391
|
} : {
|
|
@@ -3396,7 +3395,7 @@ function tn(e, t) {
|
|
|
3396
3395
|
}
|
|
3397
3396
|
//#endregion
|
|
3398
3397
|
//#region packages/pptx/src/media-chrome.ts
|
|
3399
|
-
function
|
|
3398
|
+
function rn(e, t, n, r, i, a) {
|
|
3400
3399
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
3401
3400
|
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") {
|
|
3402
3401
|
e.beginPath();
|
|
@@ -3410,18 +3409,18 @@ function nn(e, t, n, r, i, a) {
|
|
|
3410
3409
|
}
|
|
3411
3410
|
//#endregion
|
|
3412
3411
|
//#region packages/pptx/src/bidi-line.ts
|
|
3413
|
-
var
|
|
3412
|
+
var an = (e) => {
|
|
3414
3413
|
let t = e.text;
|
|
3415
3414
|
return typeof t == "string" ? t : void 0;
|
|
3416
|
-
},
|
|
3417
|
-
function
|
|
3415
|
+
}, on = (e) => "isTab" in e;
|
|
3416
|
+
function sn(e) {
|
|
3418
3417
|
for (let t of e) {
|
|
3419
|
-
let e =
|
|
3420
|
-
if (e !== void 0 &&
|
|
3418
|
+
let e = an(t);
|
|
3419
|
+
if (e !== void 0 && H(e)) return !0;
|
|
3421
3420
|
}
|
|
3422
3421
|
return !1;
|
|
3423
3422
|
}
|
|
3424
|
-
function
|
|
3423
|
+
function cn(e, n) {
|
|
3425
3424
|
let r = e.length;
|
|
3426
3425
|
if (r === 0) return {
|
|
3427
3426
|
order: [],
|
|
@@ -3430,14 +3429,14 @@ function sn(e, n) {
|
|
|
3430
3429
|
let i = "", a = Array(r), o;
|
|
3431
3430
|
for (let t = 0; t < r; t++) {
|
|
3432
3431
|
a[t] = i.length;
|
|
3433
|
-
let n =
|
|
3434
|
-
if (i += n.length > 0 ? n : "",
|
|
3432
|
+
let n = an(e[t]) ?? "";
|
|
3433
|
+
if (i += n.length > 0 ? n : "", on(e[t])) {
|
|
3435
3434
|
for (o ??= []; o.length < i.length;) o.push(null);
|
|
3436
3435
|
o[a[t]] = "S";
|
|
3437
3436
|
}
|
|
3438
3437
|
}
|
|
3439
3438
|
if (o) for (; o.length < i.length;) o.push(null);
|
|
3440
|
-
let { levels: s, paragraphLevel: c } =
|
|
3439
|
+
let { levels: s, paragraphLevel: c } = h().computeLevels(i, n ? "rtl" : "ltr", o), { order: l, segLevels: u } = t(s, c, a), d = Array(r);
|
|
3441
3440
|
for (let e = 0; e < r; e++) d[e] = (u[e] & 1) == 1;
|
|
3442
3441
|
return {
|
|
3443
3442
|
order: l,
|
|
@@ -3446,11 +3445,11 @@ function sn(e, n) {
|
|
|
3446
3445
|
}
|
|
3447
3446
|
//#endregion
|
|
3448
3447
|
//#region packages/pptx/src/cjk-wrap.ts
|
|
3449
|
-
function
|
|
3448
|
+
function ln(e, t, n, r, i = 0, a = !1) {
|
|
3450
3449
|
if (e.length === 0) return 0;
|
|
3451
3450
|
let s = t === 0, c = 0, l = t;
|
|
3452
3451
|
for (let t of e) {
|
|
3453
|
-
let e = c > 0 ||
|
|
3452
|
+
let e = c > 0 || a ? i : 0;
|
|
3454
3453
|
if (l + e + t.w > n) {
|
|
3455
3454
|
if (c > 0 || !s) break;
|
|
3456
3455
|
l += e + t.w, c++;
|
|
@@ -3458,20 +3457,20 @@ function cn(e, t, n, r, i = 0, o = !1) {
|
|
|
3458
3457
|
}
|
|
3459
3458
|
l += e + t.w, c++;
|
|
3460
3459
|
}
|
|
3461
|
-
return c === 0 ? 0 : c >= e.length ? e.length :
|
|
3460
|
+
return c === 0 ? 0 : c >= e.length ? e.length : o(e.map((e) => e.ch), c, r, +!!s);
|
|
3462
3461
|
}
|
|
3463
3462
|
//#endregion
|
|
3464
3463
|
//#region packages/pptx/src/text-justify.ts
|
|
3465
|
-
var
|
|
3466
|
-
function
|
|
3464
|
+
var un = (e) => /\s/.test(String.fromCodePoint(e));
|
|
3465
|
+
function dn(e, t, n, r, i) {
|
|
3467
3466
|
if (r === "just" && i) return null;
|
|
3468
3467
|
let a = t - n;
|
|
3469
3468
|
if (a <= .5) return null;
|
|
3470
|
-
let o =
|
|
3469
|
+
let o = Ce(e, a, {
|
|
3471
3470
|
firstContentSi: 0,
|
|
3472
3471
|
lastDrawnSi: e.length,
|
|
3473
3472
|
isGapChar: le,
|
|
3474
|
-
isWhitespace:
|
|
3473
|
+
isWhitespace: un,
|
|
3475
3474
|
seaClusterGaps: r === "thaiDist"
|
|
3476
3475
|
});
|
|
3477
3476
|
if (!o) return null;
|
|
@@ -3492,7 +3491,7 @@ function un(e, t, n, r, i) {
|
|
|
3492
3491
|
}
|
|
3493
3492
|
//#endregion
|
|
3494
3493
|
//#region packages/pptx/src/table-border-conflict.ts
|
|
3495
|
-
function
|
|
3494
|
+
function fn(e) {
|
|
3496
3495
|
if (!e) return {
|
|
3497
3496
|
r: 0,
|
|
3498
3497
|
g: 0,
|
|
@@ -3509,37 +3508,37 @@ function dn(e) {
|
|
|
3509
3508
|
b: parseInt(t.slice(4, 6), 16)
|
|
3510
3509
|
};
|
|
3511
3510
|
}
|
|
3512
|
-
function
|
|
3513
|
-
let t =
|
|
3511
|
+
function pn(e) {
|
|
3512
|
+
let t = fn(e);
|
|
3514
3513
|
return .299 * t.r + .587 * t.g + .114 * t.b;
|
|
3515
3514
|
}
|
|
3516
|
-
function
|
|
3515
|
+
function mn(e, t) {
|
|
3517
3516
|
if (!e && !t) return null;
|
|
3518
3517
|
if (!e) return t;
|
|
3519
3518
|
if (!t) return e;
|
|
3520
3519
|
if (e.width !== t.width) return e.width > t.width ? e : t;
|
|
3521
|
-
let n =
|
|
3520
|
+
let n = pn(e.color), r = pn(t.color);
|
|
3522
3521
|
return n === r || n < r ? e : t;
|
|
3523
3522
|
}
|
|
3524
3523
|
//#endregion
|
|
3525
3524
|
//#region packages/pptx/src/smartart-fallback-contrast.ts
|
|
3526
|
-
function
|
|
3527
|
-
let t =
|
|
3525
|
+
function hn(e) {
|
|
3526
|
+
let t = S(e.length === 8 ? e.slice(0, 6) : e);
|
|
3528
3527
|
if (!t) return null;
|
|
3529
|
-
let n =
|
|
3528
|
+
let n = a(t[0], t[1], t[2]);
|
|
3530
3529
|
if (e.length !== 8) return n;
|
|
3531
3530
|
let r = Number.parseInt(e.slice(6, 8), 16);
|
|
3532
3531
|
if (Number.isNaN(r)) return null;
|
|
3533
3532
|
let i = r / 255;
|
|
3534
3533
|
return i * n + (1 - i);
|
|
3535
3534
|
}
|
|
3536
|
-
function
|
|
3535
|
+
function gn(e) {
|
|
3537
3536
|
if (!e) return null;
|
|
3538
|
-
if (e.fillType === "solid") return
|
|
3537
|
+
if (e.fillType === "solid") return hn(e.color);
|
|
3539
3538
|
if (e.fillType === "gradient") {
|
|
3540
3539
|
let t = e.stops.map((e) => ({
|
|
3541
3540
|
p: Math.min(1, Math.max(0, e.position)),
|
|
3542
|
-
l:
|
|
3541
|
+
l: hn(e.color)
|
|
3543
3542
|
})).filter((e) => e.l !== null).sort((e, t) => e.p - t.p);
|
|
3544
3543
|
if (t.length === 0) return null;
|
|
3545
3544
|
let n = t[0], r = t[t.length - 1], i = n.l * n.p + r.l * (1 - r.p);
|
|
@@ -3548,18 +3547,18 @@ function hn(e) {
|
|
|
3548
3547
|
}
|
|
3549
3548
|
return null;
|
|
3550
3549
|
}
|
|
3551
|
-
function
|
|
3550
|
+
function _n(e) {
|
|
3552
3551
|
return e.name === "SmartArt" && e.id === void 0;
|
|
3553
3552
|
}
|
|
3554
|
-
function
|
|
3555
|
-
let n =
|
|
3553
|
+
function vn(e, t) {
|
|
3554
|
+
let n = gn(e);
|
|
3556
3555
|
if (n === null || n >= .5) return null;
|
|
3557
|
-
let r =
|
|
3556
|
+
let r = hn(t.replace(/^#/, ""));
|
|
3558
3557
|
return r !== null && r >= .5 ? null : "#FFFFFF";
|
|
3559
3558
|
}
|
|
3560
3559
|
//#endregion
|
|
3561
3560
|
//#region packages/pptx/src/tab-layout.ts
|
|
3562
|
-
function
|
|
3561
|
+
function yn(e, t, n, r, i, a = 0) {
|
|
3563
3562
|
let o = e.map((e) => e.width), s = (t) => {
|
|
3564
3563
|
let n = 0;
|
|
3565
3564
|
for (let r = t; r < e.length && !e[r].isTab; r++) n += o[r];
|
|
@@ -3587,8 +3586,8 @@ function vn(e, t, n, r, i, a = 0) {
|
|
|
3587
3586
|
}
|
|
3588
3587
|
//#endregion
|
|
3589
3588
|
//#region packages/pptx/src/vertical-text.ts
|
|
3590
|
-
var
|
|
3591
|
-
function
|
|
3589
|
+
var bn = () => !1;
|
|
3590
|
+
function xn(e, t, n) {
|
|
3592
3591
|
let r = e.textBaseline;
|
|
3593
3592
|
e.textBaseline = "alphabetic";
|
|
3594
3593
|
let i = e.measureText(t);
|
|
@@ -3596,7 +3595,7 @@ function bn(e, t, n) {
|
|
|
3596
3595
|
let a = i.fontBoundingBoxAscent, o = i.fontBoundingBoxDescent;
|
|
3597
3596
|
return typeof a == "number" && typeof o == "number" && (a !== 0 || o !== 0) ? (a - o) / 2 : .38 * n;
|
|
3598
3597
|
}
|
|
3599
|
-
function
|
|
3598
|
+
function Sn(e, t) {
|
|
3600
3599
|
let n = e.textAlign, r = e.textBaseline;
|
|
3601
3600
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
3602
3601
|
let i = e.measureText(t);
|
|
@@ -3604,15 +3603,15 @@ function xn(e, t) {
|
|
|
3604
3603
|
let a = i.actualBoundingBoxAscent, o = i.actualBoundingBoxDescent;
|
|
3605
3604
|
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
3606
3605
|
}
|
|
3607
|
-
function
|
|
3608
|
-
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r -
|
|
3606
|
+
function Cn(e, t, n, r, i, a, o = "fill", s = bn) {
|
|
3607
|
+
let c = e.textAlign, l = e.textBaseline, u = o === "stroke" ? e.strokeText.bind(e) : e.fillText.bind(e), d = r - xn(e, t, i), f = 0;
|
|
3609
3608
|
for (let o of t) {
|
|
3610
|
-
let t = o.codePointAt(0) ?? 0, l =
|
|
3609
|
+
let t = o.codePointAt(0) ?? 0, l = F(t), p = e.measureText(o).width + a, m = l === "Tr" ? se(t) : null, h = l === "Tr" && m === null && W(t), g = l === "U" || l === "Tu" || m !== null || h;
|
|
3611
3610
|
if (ee(t) && s(t)) {
|
|
3612
3611
|
let t = n + f + p / 2;
|
|
3613
|
-
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle",
|
|
3612
|
+
e.save(), e.translate(t, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", j(e, () => u(o, 0, 0)), e.restore();
|
|
3614
3613
|
} else if (g) {
|
|
3615
|
-
let r = m === null && l === "Tu" ?
|
|
3614
|
+
let r = m === null && l === "Tu" ? N(t) : null, a = m === null ? r : m, s = a === null ? o : String.fromCodePoint(a), c = n + f + p / 2, h = r === null ? Sn(e, s) / i : 0;
|
|
3616
3615
|
e.save(), e.translate(c, d), e.rotate(-Math.PI / 2), e.textAlign = "center", e.textBaseline = "middle", u(s, 0, h * i), e.restore();
|
|
3617
3616
|
} else if (l === "Tr") {
|
|
3618
3617
|
let t = n + f + p / 2;
|
|
@@ -3622,43 +3621,30 @@ function Sn(e, t, n, r, i, a, o = "fill", s = yn) {
|
|
|
3622
3621
|
}
|
|
3623
3622
|
e.textAlign = c, e.textBaseline = l;
|
|
3624
3623
|
}
|
|
3625
|
-
function
|
|
3626
|
-
|
|
3624
|
+
function wn(e, t, n, r, i, a, o = "fill") {
|
|
3625
|
+
Cn(e, t, n, r, i, a, o, (t) => ie(e, t));
|
|
3627
3626
|
}
|
|
3628
3627
|
//#endregion
|
|
3629
3628
|
//#region packages/pptx/src/renderer.ts
|
|
3630
3629
|
function X(e, t) {
|
|
3631
3630
|
return e * t;
|
|
3632
3631
|
}
|
|
3633
|
-
var Z =
|
|
3634
|
-
function
|
|
3635
|
-
let { top: s, height: c } =
|
|
3632
|
+
var Z = E;
|
|
3633
|
+
function Tn(e, t, n, r, i, a, o) {
|
|
3634
|
+
let { top: s, height: c } = Zt(n, i);
|
|
3636
3635
|
e.fillStyle = a, e.fillRect(t, s, r, c), e.fillStyle = o;
|
|
3637
3636
|
}
|
|
3638
|
-
function
|
|
3639
|
-
return
|
|
3637
|
+
function En(e, t, n, r, i, a, o = 0) {
|
|
3638
|
+
return b(e, t, n, r, i, a, o);
|
|
3640
3639
|
}
|
|
3641
|
-
var
|
|
3642
|
-
function
|
|
3640
|
+
var Dn = /* @__PURE__ */ new WeakMap();
|
|
3641
|
+
function On(e, t) {
|
|
3643
3642
|
let n = e.tinted.get(t);
|
|
3644
3643
|
if (n) return n;
|
|
3645
|
-
let r = e.
|
|
3646
|
-
|
|
3647
|
-
let o = a.getContext("2d");
|
|
3648
|
-
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
3649
|
-
}
|
|
3650
|
-
function On(e) {
|
|
3651
|
-
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
3652
|
-
return new Promise((e, r) => {
|
|
3653
|
-
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
3654
|
-
});
|
|
3644
|
+
let r = O(e.raster, t);
|
|
3645
|
+
return e.tinted.set(t, r), r;
|
|
3655
3646
|
}
|
|
3656
|
-
|
|
3657
|
-
function An(e, t, n) {
|
|
3658
|
-
let r = Math.max(1, Math.round(t * kn)), i = Math.max(1, Math.round(n * kn));
|
|
3659
|
-
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
3660
|
-
}
|
|
3661
|
-
function jn(e) {
|
|
3647
|
+
function kn(e) {
|
|
3662
3648
|
let t = [], n = (e) => {
|
|
3663
3649
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
3664
3650
|
nodes: e.nodes,
|
|
@@ -3669,14 +3655,14 @@ function jn(e) {
|
|
|
3669
3655
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
3670
3656
|
return t;
|
|
3671
3657
|
}
|
|
3672
|
-
async function
|
|
3673
|
-
let n =
|
|
3658
|
+
async function An(e, t) {
|
|
3659
|
+
let n = kn(e);
|
|
3674
3660
|
if (n.length !== 0) {
|
|
3675
3661
|
await t.loadMathJax();
|
|
3676
|
-
for (let e of n) if (!
|
|
3677
|
-
let n = await t.mathMLToSvg(
|
|
3678
|
-
|
|
3679
|
-
|
|
3662
|
+
for (let e of n) if (!Dn.has(e.nodes)) try {
|
|
3663
|
+
let n = await t.mathMLToSvg(fe(e.nodes, e.display)), r = await L(n, "#000000");
|
|
3664
|
+
Dn.set(e.nodes, {
|
|
3665
|
+
raster: r,
|
|
3680
3666
|
widthEm: n.widthEm,
|
|
3681
3667
|
ascentEm: n.ascentEm,
|
|
3682
3668
|
descentEm: n.descentEm,
|
|
@@ -3685,10 +3671,10 @@ async function Mn(e, t) {
|
|
|
3685
3671
|
} catch {}
|
|
3686
3672
|
}
|
|
3687
3673
|
}
|
|
3688
|
-
function
|
|
3674
|
+
function jn(e, t) {
|
|
3689
3675
|
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";
|
|
3690
3676
|
}
|
|
3691
|
-
var
|
|
3677
|
+
var Mn = new Set([
|
|
3692
3678
|
"serif",
|
|
3693
3679
|
"sans-serif",
|
|
3694
3680
|
"monospace",
|
|
@@ -3696,11 +3682,11 @@ var Pn = new Set([
|
|
|
3696
3682
|
"fantasy",
|
|
3697
3683
|
"system-ui"
|
|
3698
3684
|
]);
|
|
3699
|
-
function
|
|
3700
|
-
let t =
|
|
3685
|
+
function Nn(e) {
|
|
3686
|
+
let t = k(e);
|
|
3701
3687
|
return t === "mono" ? "monospace" : t === "serif" ? "serif" : "sans-serif";
|
|
3702
3688
|
}
|
|
3703
|
-
var
|
|
3689
|
+
var Pn = {
|
|
3704
3690
|
calibri: "Carlito",
|
|
3705
3691
|
"calibri light": "Carlito",
|
|
3706
3692
|
cambria: "Caladea",
|
|
@@ -3712,103 +3698,103 @@ var In = {
|
|
|
3712
3698
|
"simplified arabic": "Noto Naskh Arabic",
|
|
3713
3699
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
3714
3700
|
"univers next arabic": "Noto Sans Arabic"
|
|
3715
|
-
},
|
|
3716
|
-
function
|
|
3717
|
-
if (
|
|
3701
|
+
}, Fn = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
3702
|
+
function In(e) {
|
|
3703
|
+
if (Pn[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
3718
3704
|
let t = e.toLowerCase();
|
|
3719
3705
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
3720
3706
|
}
|
|
3721
|
-
function
|
|
3707
|
+
function Ln(e) {
|
|
3722
3708
|
return e.map((e) => `"${e}"`).join(", ");
|
|
3723
3709
|
}
|
|
3724
|
-
function
|
|
3725
|
-
let
|
|
3726
|
-
if (
|
|
3727
|
-
let
|
|
3728
|
-
return `"${
|
|
3710
|
+
function Rn(e) {
|
|
3711
|
+
let t = Nn(e), n = Pn[e.toLowerCase()], r = n ? `"${n}", ` : "";
|
|
3712
|
+
if (In(e)) return `"${e}", ${r}${Fn}, ${t}`;
|
|
3713
|
+
let i = t === "serif" ? "serif" : "sans", a = V(e);
|
|
3714
|
+
return `"${e}", ${r}${a ? `${Ln(re(a, i))}, ` : ""}${`${Ln(i === "serif" ? oe : P)}, `}${t}`;
|
|
3729
3715
|
}
|
|
3730
|
-
function
|
|
3716
|
+
function zn(e) {
|
|
3731
3717
|
return e ? e.kind === "external" ? `e:${e.url}` : `i:${e.ref}` : "";
|
|
3732
3718
|
}
|
|
3733
|
-
function
|
|
3719
|
+
function Bn(e) {
|
|
3734
3720
|
let t = e.toLowerCase();
|
|
3735
3721
|
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;
|
|
3736
3722
|
}
|
|
3737
|
-
function
|
|
3738
|
-
let
|
|
3739
|
-
if (!
|
|
3740
|
-
|
|
3741
|
-
let
|
|
3742
|
-
if (
|
|
3743
|
-
let
|
|
3744
|
-
|
|
3723
|
+
function Vn(t, n, r, i, a, o, s, c) {
|
|
3724
|
+
let l = Math.max(0, i.blur * a), u = Math.ceil(l * 3) + 2, d = Math.max(0, Math.floor(r.x - u)), f = Math.max(0, Math.floor(r.y - u)), p = Math.min(s, Math.ceil(r.x + r.w + u)), m = Math.min(c, Math.ceil(r.y + r.h + u)), h = Math.max(1, p - d), g = Math.max(1, m - f), _ = e(h, g), v = _?.getContext("2d");
|
|
3725
|
+
if (!_ || !v) return;
|
|
3726
|
+
v.save(), v.setTransform(o.a, o.b, o.c, o.d, o.e - d, o.f - f), n(v), v.restore();
|
|
3727
|
+
let y = r.y - f, b = y + r.h, x = _, S = v;
|
|
3728
|
+
if (l > 0) {
|
|
3729
|
+
let t = e(h, g), n = t?.getContext("2d");
|
|
3730
|
+
t && n && (x = t, S = n);
|
|
3745
3731
|
}
|
|
3746
|
-
|
|
3747
|
-
x:
|
|
3748
|
-
y
|
|
3749
|
-
w:
|
|
3750
|
-
h:
|
|
3751
|
-
},
|
|
3752
|
-
let
|
|
3732
|
+
x !== _ && tn(S, _, {
|
|
3733
|
+
x: r.x - d,
|
|
3734
|
+
y,
|
|
3735
|
+
w: r.w,
|
|
3736
|
+
h: r.h
|
|
3737
|
+
}, l, h);
|
|
3738
|
+
let C = Math.max(0, Math.min(1, i.stPos)), w = Math.max(0, Math.min(1, i.endPos)), T = Math.max(1, b - y);
|
|
3753
3739
|
try {
|
|
3754
|
-
let e =
|
|
3755
|
-
for (let t = 0; t <
|
|
3756
|
-
let n = Math.max(0, Math.min(1, (
|
|
3757
|
-
if (n <=
|
|
3758
|
-
else if (n >=
|
|
3740
|
+
let e = S.getImageData(0, 0, h, g);
|
|
3741
|
+
for (let t = 0; t < g; t++) {
|
|
3742
|
+
let n = Math.max(0, Math.min(1, (b - (t + .5)) / T)), r;
|
|
3743
|
+
if (n <= C) r = i.stA;
|
|
3744
|
+
else if (n >= w || w <= C) r = i.endA;
|
|
3759
3745
|
else {
|
|
3760
|
-
let e = (n -
|
|
3761
|
-
|
|
3746
|
+
let e = (n - C) / (w - C);
|
|
3747
|
+
r = i.stA + (i.endA - i.stA) * e;
|
|
3762
3748
|
}
|
|
3763
|
-
let a = Math.max(0, Math.min(1,
|
|
3764
|
-
for (let n = t *
|
|
3749
|
+
let a = Math.max(0, Math.min(1, r));
|
|
3750
|
+
for (let n = t * h * 4 + 3; n < (t + 1) * h * 4; n += 4) e.data[n] = Math.round(e.data[n] * a);
|
|
3765
3751
|
}
|
|
3766
|
-
|
|
3752
|
+
S.putImageData(e, 0, 0);
|
|
3767
3753
|
} catch {
|
|
3768
|
-
|
|
3754
|
+
S.save(), S.globalCompositeOperation = "destination-in", S.fillStyle = `rgba(0,0,0,${Math.max(0, Math.min(1, i.stA))})`, S.fillRect(0, 0, h, g), S.restore();
|
|
3769
3755
|
}
|
|
3770
|
-
let
|
|
3771
|
-
|
|
3756
|
+
let E = i.dist * a, D = i.dir * Math.PI / 180, O = r.y + r.h;
|
|
3757
|
+
t.save(), t.setTransform(1, 0, 0, 1, 0, 0), t.translate(r.x + Math.cos(D) * E, O + Math.sin(D) * E), t.scale(i.sx, i.sy), t.translate(-r.x, -O), t.drawImage(x, d, f), t.restore();
|
|
3772
3758
|
}
|
|
3773
|
-
function
|
|
3774
|
-
let a = t ? "italic " : "", o =
|
|
3775
|
-
return
|
|
3759
|
+
function Hn(e, t, n, r, i) {
|
|
3760
|
+
let a = t ? "italic " : "", o = jn(r, i), s = Bn(o), c = e ? "bold " : s ? `${s} ` : "";
|
|
3761
|
+
return Mn.has(o) ? `${a}${c}${n}px ${o}` : `${a}${c}${n}px ${Rn(o)}`;
|
|
3776
3762
|
}
|
|
3777
|
-
function
|
|
3778
|
-
return e.bullet.type === "char" || e.bullet.type === "autoNum" ||
|
|
3763
|
+
function Un(e) {
|
|
3764
|
+
return e.bullet.type === "char" || e.bullet.type === "autoNum" || De(e.bullet).type === "blip";
|
|
3779
3765
|
}
|
|
3780
|
-
function
|
|
3766
|
+
function Wn(e, t) {
|
|
3781
3767
|
return e ? 0 : Math.max(0, t);
|
|
3782
3768
|
}
|
|
3783
|
-
function
|
|
3769
|
+
function Gn(e, t, n, r, i, a, o) {
|
|
3784
3770
|
let s = (t.defaultFontSize ?? 18) * Y * a;
|
|
3785
3771
|
for (let c of t.paragraphs) {
|
|
3786
|
-
let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f =
|
|
3772
|
+
let l = X(c.marL, a), u = X(c.marR, a), d = X(c.indent, a), f = Wn(Un(c), d), p = n - r - i - l - u - f, m = 0;
|
|
3787
3773
|
for (let n of c.runs) {
|
|
3788
3774
|
if (n.type !== "text") continue;
|
|
3789
|
-
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i =
|
|
3790
|
-
e.font =
|
|
3775
|
+
let r = n.fontSize == null ? c.defFontSize == null ? s : c.defFontSize * Y * a : n.fontSize * Y * a, i = jn(n.fontFamily ?? c.defFontFamily ?? null, o);
|
|
3776
|
+
e.font = Hn(n.bold ?? c.defBold ?? t.defaultBold ?? !1, n.italic ?? c.defItalic ?? t.defaultItalic ?? !1, r, i, o);
|
|
3791
3777
|
let l = (n.letterSpacing ?? 0) * Y * a;
|
|
3792
3778
|
if (m += Q(e, n.text, l), m > p) return !0;
|
|
3793
3779
|
}
|
|
3794
3780
|
}
|
|
3795
3781
|
return !1;
|
|
3796
3782
|
}
|
|
3797
|
-
function
|
|
3783
|
+
function Kn(e) {
|
|
3798
3784
|
for (let t of e) if (le(t.codePointAt(0) ?? 0)) return !0;
|
|
3799
3785
|
return !1;
|
|
3800
3786
|
}
|
|
3801
|
-
function
|
|
3787
|
+
function qn(e) {
|
|
3802
3788
|
let t = 0;
|
|
3803
3789
|
for (let n of e) t++;
|
|
3804
3790
|
return t;
|
|
3805
3791
|
}
|
|
3806
|
-
var
|
|
3807
|
-
function
|
|
3808
|
-
let t =
|
|
3792
|
+
var Jn = /* @__PURE__ */ new WeakMap();
|
|
3793
|
+
function Yn(e) {
|
|
3794
|
+
let t = Jn.get(e);
|
|
3809
3795
|
if (t != null) return t;
|
|
3810
3796
|
let n = e, r = n.letterSpacing;
|
|
3811
|
-
if (typeof r != "string") return
|
|
3797
|
+
if (typeof r != "string") return Jn.set(e, !1), !1;
|
|
3812
3798
|
let i = !1;
|
|
3813
3799
|
try {
|
|
3814
3800
|
n.letterSpacing = "0px";
|
|
@@ -3823,11 +3809,11 @@ function Zn(e) {
|
|
|
3823
3809
|
n.letterSpacing = r;
|
|
3824
3810
|
} catch {}
|
|
3825
3811
|
}
|
|
3826
|
-
return
|
|
3812
|
+
return Jn.set(e, i), i;
|
|
3827
3813
|
}
|
|
3828
3814
|
function Q(e, t, n) {
|
|
3829
3815
|
let r = e, i = r.letterSpacing;
|
|
3830
|
-
if (n !== 0 &&
|
|
3816
|
+
if (n !== 0 && Yn(e)) try {
|
|
3831
3817
|
r.letterSpacing = `${n}px`;
|
|
3832
3818
|
let i = e.measureText(t).width;
|
|
3833
3819
|
if (Number.isFinite(i)) return t.length > 0 ? i - n : i;
|
|
@@ -3836,38 +3822,38 @@ function Q(e, t, n) {
|
|
|
3836
3822
|
r.letterSpacing = i;
|
|
3837
3823
|
} catch {}
|
|
3838
3824
|
}
|
|
3839
|
-
let a = Math.max(0,
|
|
3825
|
+
let a = Math.max(0, qn(t) - 1);
|
|
3840
3826
|
return e.measureText(t).width + n * a;
|
|
3841
3827
|
}
|
|
3842
|
-
function
|
|
3828
|
+
function Xn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
3843
3829
|
themeMajorFont: null,
|
|
3844
3830
|
themeMinorFont: null,
|
|
3845
3831
|
dpr: 1
|
|
3846
3832
|
}, p = 0) {
|
|
3847
|
-
let m = [], h = /* @__PURE__ */ new Map(),
|
|
3848
|
-
for (let e = t.runs.length - 1; e >= 0 &&
|
|
3833
|
+
let m = [], h = /* @__PURE__ */ new Map(), g = !0;
|
|
3834
|
+
for (let e = t.runs.length - 1; e >= 0 && g; e--) {
|
|
3849
3835
|
let n = t.runs[e];
|
|
3850
3836
|
if (n.type === "break") continue;
|
|
3851
3837
|
if (n.type === "math") break;
|
|
3852
3838
|
let r = n.text.replace(/ +$/u, "");
|
|
3853
|
-
r !== n.text && h.set(n, r), (r.length > 0 || n.fieldType != null) && (
|
|
3839
|
+
r !== n.text && h.set(n, r), (r.length > 0 || n.fieldType != null) && (g = !1);
|
|
3854
3840
|
}
|
|
3855
|
-
let
|
|
3841
|
+
let _ = () => n - (m.length === 0 ? p : 0), v = { segments: [] }, b = 0, S = !1, C = t.rtl === !0, w = X(t.marR, o), T = (t.tabStops ?? []).map((e) => ({
|
|
3856
3842
|
pos: X(e.pos, o),
|
|
3857
3843
|
algn: e.algn
|
|
3858
|
-
})), E = X(t.defTabSz ?? 914400, o),
|
|
3859
|
-
let t =
|
|
3844
|
+
})), E = X(t.defTabSz ?? 914400, o), O = !1, k = [], A = 0, j = () => C ? w : s + (m.length === 0 ? p : 0), M = (e = 0) => {
|
|
3845
|
+
let t = yn(e > 0 ? [...k, {
|
|
3860
3846
|
isTab: !1,
|
|
3861
3847
|
width: e
|
|
3862
|
-
}] :
|
|
3848
|
+
}] : k, T, j(), Infinity, A, E), n = 0;
|
|
3863
3849
|
for (let e of t) n += e;
|
|
3864
3850
|
return n;
|
|
3865
3851
|
}, N = (e) => {
|
|
3866
|
-
let t =
|
|
3867
|
-
return Number.isFinite(t) ?
|
|
3852
|
+
let t = _();
|
|
3853
|
+
return Number.isFinite(t) ? O ? M(e) <= t : b + e <= t : !0;
|
|
3868
3854
|
}, P = () => {
|
|
3869
|
-
let e =
|
|
3870
|
-
if (!
|
|
3855
|
+
let e = _();
|
|
3856
|
+
if (!O) return e - b;
|
|
3871
3857
|
if (!Number.isFinite(e)) return Infinity;
|
|
3872
3858
|
if (M(0) >= e) return 0;
|
|
3873
3859
|
let t = 0, n = e;
|
|
@@ -3877,25 +3863,25 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3877
3863
|
}
|
|
3878
3864
|
return t;
|
|
3879
3865
|
}, F = (e = !1) => {
|
|
3880
|
-
e && (
|
|
3881
|
-
},
|
|
3866
|
+
e && (v.endsWithBreak = !0), m.push(v), v = { segments: [] }, b = 0, O = !1, k = [], S = !1;
|
|
3867
|
+
}, L = (t, n, r, i) => {
|
|
3882
3868
|
e.font = n;
|
|
3883
|
-
let a = Q(e, t, r), o =
|
|
3869
|
+
let a = Q(e, t, r), o = v.segments.at(-1);
|
|
3884
3870
|
return !o || o.isTab || o.math || o.sourceRunId !== i ? a : o.font === n && (o.letterSpacingPx ?? 0) === r ? Q(e, o.text + t, r) - Q(e, o.text, r) : a + r;
|
|
3885
|
-
},
|
|
3871
|
+
}, z = (t, n, r, i, a, o, s, c) => {
|
|
3886
3872
|
if (!t) return;
|
|
3887
3873
|
e.font = n;
|
|
3888
|
-
let l = c?.letterSpacingPx ?? 0, u = c?.sourceRunId, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, m = c?.shadow, h = c?.reflection, g = c?.outline, _ = c?.highlight,
|
|
3889
|
-
if (C && S(C) ? w = Q(e, C.text + t, l) - Q(e, C.text, l) : C && !C.isTab && !C.math && u != null && C.sourceRunId === u && (w += l),
|
|
3874
|
+
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, y = c?.fontFamily, x = 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 ?? "") === (y ?? "") && zn(e.hyperlink) === zn(x) && (l === 0 || e.sourceRunId === u), C = v.segments.at(-1), w = Q(e, t, l);
|
|
3875
|
+
if (C && S(C) ? w = Q(e, C.text + t, l) - Q(e, C.text, l) : C && !C.isTab && !C.math && u != null && C.sourceRunId === u && (w += l), b += w, k.push({
|
|
3890
3876
|
isTab: !1,
|
|
3891
3877
|
width: w
|
|
3892
3878
|
}), C && S(C)) C.text += t;
|
|
3893
3879
|
else {
|
|
3894
3880
|
let e = C && !C.isTab && !C.math && u != null && C.sourceRunId === u ? l : 0;
|
|
3895
|
-
|
|
3881
|
+
v.segments.push({
|
|
3896
3882
|
text: t,
|
|
3897
3883
|
font: n,
|
|
3898
|
-
fontFamily:
|
|
3884
|
+
fontFamily: y,
|
|
3899
3885
|
sizePx: r,
|
|
3900
3886
|
color: i,
|
|
3901
3887
|
underline: a,
|
|
@@ -3911,17 +3897,17 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3911
3897
|
reflection: h,
|
|
3912
3898
|
outline: g,
|
|
3913
3899
|
highlight: _,
|
|
3914
|
-
hyperlink:
|
|
3900
|
+
hyperlink: x
|
|
3915
3901
|
});
|
|
3916
3902
|
}
|
|
3917
|
-
},
|
|
3918
|
-
let e =
|
|
3903
|
+
}, B = () => {
|
|
3904
|
+
let e = v.segments.at(-1);
|
|
3919
3905
|
if (!e || e.math) return !1;
|
|
3920
3906
|
let t = /^(.*\s)(\S+)$/s.exec(e.text), n;
|
|
3921
3907
|
if (t) e.text = t[1], n = t[2];
|
|
3922
|
-
else if (
|
|
3908
|
+
else if (v.segments.length > 1) v.segments.pop(), n = e.text;
|
|
3923
3909
|
else return !1;
|
|
3924
|
-
return F(),
|
|
3910
|
+
return F(), z(n, e.font, e.sizePx, e.color, e.underline, e.strikethrough, e.baseline, {
|
|
3925
3911
|
strikeDouble: e.strikeDouble,
|
|
3926
3912
|
letterSpacingPx: e.letterSpacingPx,
|
|
3927
3913
|
underlineStyle: e.underlineStyle,
|
|
@@ -3940,11 +3926,11 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3940
3926
|
continue;
|
|
3941
3927
|
}
|
|
3942
3928
|
if (s.type === "math") {
|
|
3943
|
-
let e =
|
|
3944
|
-
(s.display &&
|
|
3929
|
+
let e = Dn.get(s.nodes), t = s.fontSize == null ? r : s.fontSize * Y * o * u, n = e ? e.widthEm * t : 0, i = e ? e.ascentEm * t : 0, c = e ? e.descentEm * t : 0;
|
|
3930
|
+
(s.display && b > 0 || !N(n) && b > 0) && F(), k.push({
|
|
3945
3931
|
isTab: !1,
|
|
3946
3932
|
width: n
|
|
3947
|
-
}),
|
|
3933
|
+
}), v.segments.push({
|
|
3948
3934
|
text: "",
|
|
3949
3935
|
font: `${t}px sans-serif`,
|
|
3950
3936
|
sizePx: t,
|
|
@@ -3958,12 +3944,12 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3958
3944
|
ascent: i,
|
|
3959
3945
|
descent: c
|
|
3960
3946
|
}
|
|
3961
|
-
}),
|
|
3947
|
+
}), b += n, s.display && F();
|
|
3962
3948
|
continue;
|
|
3963
3949
|
}
|
|
3964
|
-
let p = s.fontSize == null ? r : s.fontSize * Y * o * u, m =
|
|
3950
|
+
let p = s.fontSize == null ? r : s.fontSize * Y * o * u, m = jn(s.fontFamily ?? t.defFontFamily ?? null, f), g = s.fontFamilyEa ? jn(s.fontFamilyEa, f) : null, C = s.fontFamilySym ? jn(s.fontFamilySym, f) : null, w;
|
|
3965
3951
|
w = s.color ? Z(s.color) : s.hyperlink && f.themeHlinkColor ? Z(f.themeHlinkColor) : a;
|
|
3966
|
-
let T = s.bold ?? t.defBold ?? c, E = s.italic ?? t.defItalic ?? l, j =
|
|
3952
|
+
let T = s.bold ?? t.defBold ?? c, E = s.italic ?? t.defItalic ?? l, j = Hn(T, E, p, m, f), M = g ? Hn(T, E, p, g, f) : j;
|
|
3967
3953
|
e.font = j;
|
|
3968
3954
|
let V = s.caps, H = h.get(s) ?? s.text;
|
|
3969
3955
|
(V === "all" || V === "small") && (H = H.toUpperCase());
|
|
@@ -3977,14 +3963,14 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3977
3963
|
outline: s.outline,
|
|
3978
3964
|
fontFamily: m,
|
|
3979
3965
|
highlight: s.highlight ? Z(s.highlight) : void 0,
|
|
3980
|
-
hyperlink:
|
|
3966
|
+
hyperlink: nn(s.hyperlink),
|
|
3981
3967
|
sourceRunId: n
|
|
3982
|
-
},
|
|
3983
|
-
for (let r of
|
|
3968
|
+
}, ee = U.split(/(\s+)/);
|
|
3969
|
+
for (let r of ee) {
|
|
3984
3970
|
if (!r) continue;
|
|
3985
3971
|
if (/^\t+$/.test(r)) {
|
|
3986
|
-
|
|
3987
|
-
for (let e of r)
|
|
3972
|
+
O || (e.font = j, A = e.measureText(" ").width);
|
|
3973
|
+
for (let e of r) v.segments.push({
|
|
3988
3974
|
text: "",
|
|
3989
3975
|
isTab: !0,
|
|
3990
3976
|
font: j,
|
|
@@ -3993,31 +3979,31 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
3993
3979
|
color: w,
|
|
3994
3980
|
underline: !1,
|
|
3995
3981
|
strikethrough: !1
|
|
3996
|
-
}),
|
|
3982
|
+
}), k.push({
|
|
3997
3983
|
isTab: !0,
|
|
3998
3984
|
width: 0
|
|
3999
3985
|
});
|
|
4000
|
-
|
|
3986
|
+
O = !0;
|
|
4001
3987
|
continue;
|
|
4002
3988
|
}
|
|
4003
3989
|
e.font = j;
|
|
4004
|
-
let a =
|
|
4005
|
-
if (c.test(r) && (C != null ||
|
|
3990
|
+
let a = L(r, j, K, n), o = /^\s+$/.test(r), c = /[-]/;
|
|
3991
|
+
if (c.test(r) && (C != null || we(m))) {
|
|
4006
3992
|
let t = C ?? m;
|
|
4007
3993
|
for (let i of r) {
|
|
4008
3994
|
let r = i, a = j;
|
|
4009
3995
|
if (c.test(i)) {
|
|
4010
|
-
let e =
|
|
4011
|
-
e === i ? a =
|
|
3996
|
+
let e = ge(i, t);
|
|
3997
|
+
e === i ? a = Hn(T, E, p, t, f) : (r = e, a = Hn(T, E, p, "sans-serif", f));
|
|
4012
3998
|
}
|
|
4013
|
-
e.font = a, !N(
|
|
3999
|
+
e.font = a, !N(L(r, a, K, n)) && b > 0 && F(), z(r, a, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
4014
4000
|
}
|
|
4015
4001
|
continue;
|
|
4016
4002
|
}
|
|
4017
|
-
if (
|
|
4003
|
+
if (Kn(r) && (!R(r) || t.eaLnBrk === !1)) {
|
|
4018
4004
|
let i = [];
|
|
4019
4005
|
for (let t of r) {
|
|
4020
|
-
let n = le(t.codePointAt(0) ?? 0) &&
|
|
4006
|
+
let n = le(t.codePointAt(0) ?? 0) && g != null, r = n ? M : j, a = n ? g : m;
|
|
4021
4007
|
e.font = r, i.push({
|
|
4022
4008
|
ch: t,
|
|
4023
4009
|
w: Q(e, t, 0),
|
|
@@ -4026,9 +4012,9 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4026
4012
|
});
|
|
4027
4013
|
}
|
|
4028
4014
|
if (t.eaLnBrk === !1) {
|
|
4029
|
-
let e =
|
|
4030
|
-
|
|
4031
|
-
for (let e of i)
|
|
4015
|
+
let e = v.segments.at(-1), t = !!e && !e.isTab && !e.math && e.sourceRunId === n, r = i.reduce((e, t) => e + t.w, 0) + Math.max(0, i.length - 1) * K + (t && i.length > 0 ? K : 0);
|
|
4016
|
+
b > 0 && !N(r) && F();
|
|
4017
|
+
for (let e of i) z(e.ch, e.font, p, w, W, s.strikethrough, s.baseline ?? void 0, {
|
|
4032
4018
|
...q,
|
|
4033
4019
|
fontFamily: e.family
|
|
4034
4020
|
});
|
|
@@ -4036,9 +4022,9 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4036
4022
|
}
|
|
4037
4023
|
let a = i;
|
|
4038
4024
|
for (; a.length > 0;) {
|
|
4039
|
-
let e = Number.isFinite(
|
|
4025
|
+
let e = Number.isFinite(_()) ? _() - P() : b, t = v.segments.at(-1), r = !!t && !t.isTab && !t.math && t.sourceRunId === n, i = ln(a, e, _(), y, K, r);
|
|
4040
4026
|
if (i === 0) {
|
|
4041
|
-
if (
|
|
4027
|
+
if (b > 0) {
|
|
4042
4028
|
F();
|
|
4043
4029
|
continue;
|
|
4044
4030
|
}
|
|
@@ -4046,7 +4032,7 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4046
4032
|
}
|
|
4047
4033
|
for (let e = 0; e < i; e++) {
|
|
4048
4034
|
let t = a[e];
|
|
4049
|
-
|
|
4035
|
+
z(t.ch, t.font, p, w, W, s.strikethrough, s.baseline ?? void 0, {
|
|
4050
4036
|
...q,
|
|
4051
4037
|
fontFamily: t.family
|
|
4052
4038
|
});
|
|
@@ -4055,12 +4041,12 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4055
4041
|
}
|
|
4056
4042
|
continue;
|
|
4057
4043
|
}
|
|
4058
|
-
if (
|
|
4059
|
-
let t =
|
|
4044
|
+
if (R(r)) {
|
|
4045
|
+
let t = x(r, {
|
|
4060
4046
|
cjk: !0,
|
|
4061
|
-
kinsoku:
|
|
4062
|
-
}), i =
|
|
4063
|
-
let r = 0, i =
|
|
4047
|
+
kinsoku: y
|
|
4048
|
+
}), i = g != null && M !== j, a = (e) => i && le(e.codePointAt(0) ?? 0), o = (t) => {
|
|
4049
|
+
let r = 0, i = v.segments.at(-1), o = !!i && !i.isTab && !i.math && i.sourceRunId === n, s = "", c = null, l = () => {
|
|
4064
4050
|
s !== "" && (e.font = c ? M : j, r += Q(e, s, K), o && (r += K), o = !0, s = "");
|
|
4065
4051
|
};
|
|
4066
4052
|
for (let e of t) {
|
|
@@ -4071,8 +4057,8 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4071
4057
|
}, c = (e) => {
|
|
4072
4058
|
let t = "", n = null, r = () => {
|
|
4073
4059
|
if (t === "") return;
|
|
4074
|
-
let e = n ? M : j, r = n ?
|
|
4075
|
-
|
|
4060
|
+
let e = n ? M : j, r = n ? g : m;
|
|
4061
|
+
z(t, e, p, w, W, s.strikethrough, s.baseline ?? void 0, {
|
|
4076
4062
|
...q,
|
|
4077
4063
|
fontFamily: r
|
|
4078
4064
|
}), t = "";
|
|
@@ -4084,57 +4070,57 @@ function Qn(e, t, n, r, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
|
4084
4070
|
r();
|
|
4085
4071
|
}, l = de(r), u = r.length, d = 0;
|
|
4086
4072
|
for (; d < u;) {
|
|
4087
|
-
let e = P(), n =
|
|
4073
|
+
let e = P(), n = I(r, t, d, e, o, l);
|
|
4088
4074
|
if (n <= d) {
|
|
4089
|
-
if (
|
|
4075
|
+
if (b > 0) {
|
|
4090
4076
|
F();
|
|
4091
4077
|
continue;
|
|
4092
4078
|
}
|
|
4093
|
-
let i = t.find((e) => e > d) ?? u, a = r.slice(d, i), s =
|
|
4079
|
+
let i = t.find((e) => e > d) ?? u, a = r.slice(d, i), s = D(a), c = I(a, s, 0, e, o, l);
|
|
4094
4080
|
c <= 0 && (c = s.length > 0 ? s[0] : a.length), n = d + c;
|
|
4095
4081
|
}
|
|
4096
4082
|
c(r.slice(d, n)), d = n, d < u && F();
|
|
4097
4083
|
}
|
|
4098
4084
|
continue;
|
|
4099
4085
|
}
|
|
4100
|
-
if (N(a))
|
|
4101
|
-
else if (o)
|
|
4102
|
-
else if (a >
|
|
4103
|
-
|
|
4104
|
-
for (let t of r) e.font = j, !N(
|
|
4105
|
-
} else if (!S)
|
|
4086
|
+
if (N(a)) z(r, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q), o && (S = !0);
|
|
4087
|
+
else if (o) b > 0 && F();
|
|
4088
|
+
else if (a > _()) {
|
|
4089
|
+
b > 0 && F();
|
|
4090
|
+
for (let t of r) e.font = j, !N(L(t, j, K, n)) && b > 0 && F(), z(t, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
4091
|
+
} else if (!S) z(r, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
4106
4092
|
else {
|
|
4107
|
-
let e =
|
|
4108
|
-
(o || c) &&
|
|
4093
|
+
let e = v.segments.at(-1)?.text ?? "", t = r.codePointAt(0), n = [...e].at(-1)?.codePointAt(0), a = /\S$/u.test(e) && /^\S/u.test(r) && n !== 8203 && t !== 8203, o = t !== void 0 && y.lineStartForbidden.has(t) && a, c = n !== void 0 && t !== void 0 && a && !R(e) && !R(r) && i(n, t);
|
|
4094
|
+
(o || c) && B() || F(), z(r, j, p, w, W, s.strikethrough, s.baseline ?? void 0, q);
|
|
4109
4095
|
}
|
|
4110
4096
|
}
|
|
4111
4097
|
}
|
|
4112
|
-
return m.push(
|
|
4098
|
+
return m.push(v), m;
|
|
4113
4099
|
}
|
|
4114
|
-
async function
|
|
4100
|
+
async function Zn(e, t, n, r, i, a, o) {
|
|
4115
4101
|
if (t && t.fillType === "image") {
|
|
4116
4102
|
if (e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r), !t.imagePath || !t.mimeType || !o) return;
|
|
4117
4103
|
try {
|
|
4118
|
-
let s = await
|
|
4104
|
+
let s = await Ee(t.imagePath, t.mimeType, t.duotone, o, {
|
|
4119
4105
|
widthPt: n / i / Y,
|
|
4120
4106
|
heightPt: r / i / Y
|
|
4121
4107
|
});
|
|
4122
4108
|
if (a() || !s) return;
|
|
4123
|
-
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile)
|
|
4109
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) er(e, s, t.tile, n, r, i);
|
|
4124
4110
|
else {
|
|
4125
4111
|
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);
|
|
4126
4112
|
e.drawImage(s, u, d, f, p);
|
|
4127
4113
|
}
|
|
4128
4114
|
e.restore();
|
|
4129
4115
|
} catch (e) {
|
|
4130
|
-
if (
|
|
4116
|
+
if (pe(e)) throw e;
|
|
4131
4117
|
}
|
|
4132
4118
|
return;
|
|
4133
4119
|
}
|
|
4134
|
-
e.fillStyle =
|
|
4120
|
+
e.fillStyle = En(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
4135
4121
|
}
|
|
4136
|
-
var
|
|
4137
|
-
function
|
|
4122
|
+
var Qn = 9525;
|
|
4123
|
+
function $n(e, t, n, r, i) {
|
|
4138
4124
|
let a;
|
|
4139
4125
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
4140
4126
|
let o;
|
|
@@ -4143,134 +4129,134 @@ function tr(e, t, n, r, i) {
|
|
|
4143
4129
|
ay: o
|
|
4144
4130
|
};
|
|
4145
4131
|
}
|
|
4146
|
-
function
|
|
4147
|
-
let
|
|
4148
|
-
if (!(
|
|
4149
|
-
let
|
|
4150
|
-
if (!u) return;
|
|
4151
|
-
let d = u.getContext("2d");
|
|
4132
|
+
function er(t, n, r, i, a, o) {
|
|
4133
|
+
let s = n.width * Qn * r.sx * o, c = n.height * Qn * r.sy * o;
|
|
4134
|
+
if (!(s > 0) || !(c > 0)) return;
|
|
4135
|
+
let l = r.flip === "x" || r.flip === "xy", u = r.flip === "y" || r.flip === "xy", d = e(s * (l ? 2 : 1), c * (u ? 2 : 1));
|
|
4152
4136
|
if (!d) return;
|
|
4153
|
-
let f = (
|
|
4154
|
-
|
|
4137
|
+
let f = d.getContext("2d");
|
|
4138
|
+
if (!f) return;
|
|
4139
|
+
let p = (e, t, r, i) => {
|
|
4140
|
+
f.save(), f.translate(e + (r ? s : 0), t + (i ? c : 0)), f.scale(r ? -1 : 1, i ? -1 : 1), f.drawImage(n, 0, 0, s, c), f.restore();
|
|
4155
4141
|
};
|
|
4156
|
-
|
|
4157
|
-
let
|
|
4158
|
-
if (!
|
|
4159
|
-
let { ax:
|
|
4160
|
-
typeof
|
|
4142
|
+
p(0, 0, !1, !1), l && p(s, 0, !0, !1), u && p(0, c, !1, !0), l && u && p(s, c, !0, !0);
|
|
4143
|
+
let m = t.createPattern(d, "repeat");
|
|
4144
|
+
if (!m) return;
|
|
4145
|
+
let { ax: h, ay: g } = $n(r.algn ?? "tl", i, a, s, c), _ = h + X(r.tx, o), v = g + X(r.ty, o);
|
|
4146
|
+
typeof m.setTransform == "function" && typeof DOMMatrix < "u" ? (m.setTransform(new DOMMatrix().translateSelf(_, v)), t.fillStyle = m, t.fillRect(0, 0, i, a)) : (t.save(), t.translate(_, v), t.fillStyle = m, t.fillRect(-_, -v, i, a), t.restore());
|
|
4161
4147
|
}
|
|
4162
|
-
function
|
|
4148
|
+
function tr(e, t, n) {
|
|
4163
4149
|
if (!t) return;
|
|
4164
4150
|
let r = t.dir * Math.PI / 180, i = X(t.dist, n);
|
|
4165
4151
|
e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = 0, e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
4166
4152
|
}
|
|
4167
|
-
function
|
|
4153
|
+
function nr(e, t, n) {
|
|
4168
4154
|
t && (e.shadowColor = Z(t.color, t.alpha), e.shadowBlur = X(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
4169
4155
|
}
|
|
4170
|
-
function
|
|
4156
|
+
function rr(e) {
|
|
4171
4157
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
4172
4158
|
}
|
|
4173
|
-
var
|
|
4174
|
-
function
|
|
4175
|
-
if (
|
|
4176
|
-
let
|
|
4177
|
-
for (;
|
|
4178
|
-
let e = Math.min(
|
|
4179
|
-
if (n >=
|
|
4180
|
-
|
|
4159
|
+
var ir = 8, ar = 1, or = 1, sr = 256;
|
|
4160
|
+
function cr(t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
4161
|
+
if (i <= 0) return;
|
|
4162
|
+
let g = t.measureText(n), _ = g.actualBoundingBoxAscent > 0 ? g.actualBoundingBoxAscent : i, v = g.actualBoundingBoxDescent > 0 ? g.actualBoundingBoxDescent : i * .25, y = g.actualBoundingBoxLeft > 0 ? g.actualBoundingBoxLeft : 0, b = g.actualBoundingBoxRight > 0 ? g.actualBoundingBoxRight : i, x = i * u * a, S = Math.min(sr, Math.max(1, Math.round(x / ir))), C = (e) => dr(e, o, i, s, c, l, d, f), w = C(S), T = pr(w, o, s, c, l, d, f, u, a, -_, v);
|
|
4163
|
+
for (; T > or && S < sr;) {
|
|
4164
|
+
let e = Math.min(sr, S * 2), t = C(e), n = pr(t, o, s, c, l, d, f, u, a, -_, v);
|
|
4165
|
+
if (n >= T * .75) {
|
|
4166
|
+
w = t;
|
|
4181
4167
|
break;
|
|
4182
4168
|
}
|
|
4183
|
-
|
|
4169
|
+
S = e, w = t, T = n;
|
|
4184
4170
|
}
|
|
4185
|
-
let
|
|
4186
|
-
e.fillStyle =
|
|
4187
|
-
for (let
|
|
4188
|
-
let { s0: i, s1: a, g: o } =
|
|
4189
|
-
e.save(), e.translate(
|
|
4190
|
-
let c = k(
|
|
4191
|
-
e.rect(c, -
|
|
4171
|
+
let E = 1e4, D = ar / (u * a), O = w.length - 1, k = (e, t, n) => e === 0 ? -E : t - n - D, A = (e, t, n) => e === O ? E : t - n + D, j = (e, t) => {
|
|
4172
|
+
e.fillStyle = t;
|
|
4173
|
+
for (let t = 0; t <= O; t++) {
|
|
4174
|
+
let { s0: i, s1: a, g: o } = w[t], s = (i + a) / 2;
|
|
4175
|
+
e.save(), e.translate(p + o.x, m + o.y), e.rotate(o.angle), o.shear !== 0 && e.transform(1, 0, o.shear, 1, 0, 0), (u !== 1 || o.vScale !== 1) && e.scale(u, o.vScale), e.beginPath();
|
|
4176
|
+
let c = k(t, i, s), l = A(t, a, s);
|
|
4177
|
+
e.rect(c, -E, l - c, 2 * E), e.clip(), e.fillText(n, -s + r / 2, 0), e.restore();
|
|
4192
4178
|
}
|
|
4193
|
-
}, M =
|
|
4179
|
+
}, M = lr(h), N = typeof t.globalAlpha == "number" ? t.globalAlpha : 1;
|
|
4194
4180
|
if (M >= 1 && N >= 1) {
|
|
4195
|
-
j(
|
|
4181
|
+
j(t, h);
|
|
4196
4182
|
return;
|
|
4197
4183
|
}
|
|
4198
4184
|
if (M <= 0 || N <= 0) return;
|
|
4199
|
-
let P = typeof
|
|
4185
|
+
let P = typeof t.getTransform == "function" ? t.getTransform() : null;
|
|
4200
4186
|
if (!P) {
|
|
4201
|
-
j(
|
|
4187
|
+
j(t, h);
|
|
4202
4188
|
return;
|
|
4203
4189
|
}
|
|
4204
4190
|
let F = Infinity, I = Infinity, L = -Infinity, R = -Infinity;
|
|
4205
|
-
for (let e = 0; e <=
|
|
4206
|
-
let { s0: t, s1:
|
|
4191
|
+
for (let e = 0; e <= O; e++) {
|
|
4192
|
+
let { s0: t, s1: n, g: i } = w[e], a = (t + n) / 2, o = -a + r / 2, s = Math.max(k(e, t, a), o - y), c = Math.min(A(e, n, a), o + b);
|
|
4207
4193
|
if (!(c <= s)) for (let [e, t] of [
|
|
4208
|
-
[s, -
|
|
4209
|
-
[c, -
|
|
4210
|
-
[s,
|
|
4211
|
-
[c,
|
|
4194
|
+
[s, -_],
|
|
4195
|
+
[c, -_],
|
|
4196
|
+
[s, v],
|
|
4197
|
+
[c, v]
|
|
4212
4198
|
]) {
|
|
4213
|
-
let n =
|
|
4199
|
+
let n = fr(i, u, e, t), r = p + n.x, a = m + n.y, o = P.a * r + P.c * a + P.e, s = P.b * r + P.d * a + P.f;
|
|
4214
4200
|
o < F && (F = o), o > L && (L = o), s < I && (I = s), s > R && (R = s);
|
|
4215
4201
|
}
|
|
4216
4202
|
}
|
|
4217
4203
|
if (!(L > F && R > I)) return;
|
|
4218
|
-
let z = Math.floor(F - 2), B = Math.floor(I - 2), V =
|
|
4204
|
+
let z = Math.floor(F - 2), B = Math.floor(I - 2), V = e(Math.ceil(L + 2) - z, Math.ceil(R + 2) - B), H = V ? V.getContext("2d") : null;
|
|
4219
4205
|
if (!V || !H) {
|
|
4220
|
-
j(
|
|
4206
|
+
j(t, h);
|
|
4221
4207
|
return;
|
|
4222
4208
|
}
|
|
4223
|
-
H.font =
|
|
4209
|
+
H.font = t.font, H.textAlign = "left", H.textBaseline = "alphabetic", H.setTransform(P.a, P.b, P.c, P.d, P.e - z, P.f - B), j(H, ur(h)), t.save(), t.setTransform(1, 0, 0, 1, 0, 0), t.globalAlpha = N * M, t.drawImage(V, z, B), t.restore();
|
|
4224
4210
|
}
|
|
4225
|
-
function
|
|
4211
|
+
function lr(e) {
|
|
4226
4212
|
let t = /^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*,\s*([\d.]+)\s*\)$/i.exec(e);
|
|
4227
4213
|
if (!t) return 1;
|
|
4228
4214
|
let n = parseFloat(t[1]);
|
|
4229
4215
|
return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 1;
|
|
4230
4216
|
}
|
|
4231
|
-
function
|
|
4217
|
+
function ur(e) {
|
|
4232
4218
|
let t = /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i.exec(e);
|
|
4233
4219
|
return t ? `rgb(${t[1]}, ${t[2]}, ${t[3]})` : e;
|
|
4234
4220
|
}
|
|
4235
|
-
function
|
|
4221
|
+
function dr(e, t, n, r, i, a, o, s) {
|
|
4236
4222
|
let c = Array(e);
|
|
4237
4223
|
for (let l = 0; l < e; l++) {
|
|
4238
4224
|
let u = l / e * n, d = (l + 1) / e * n;
|
|
4239
4225
|
c[l] = {
|
|
4240
4226
|
s0: u,
|
|
4241
4227
|
s1: d,
|
|
4242
|
-
g:
|
|
4228
|
+
g: Ve(t, (r + (u + d) / 2) / i * a, o, s)
|
|
4243
4229
|
};
|
|
4244
4230
|
}
|
|
4245
4231
|
return c;
|
|
4246
4232
|
}
|
|
4247
|
-
function
|
|
4233
|
+
function fr(e, t, n, r) {
|
|
4248
4234
|
let i = n * t, a = r * e.vScale, o = i + e.shear * a, s = Math.cos(e.angle), c = Math.sin(e.angle);
|
|
4249
4235
|
return {
|
|
4250
4236
|
x: e.x + s * o - c * a,
|
|
4251
4237
|
y: e.y + c * o + s * a
|
|
4252
4238
|
};
|
|
4253
4239
|
}
|
|
4254
|
-
function
|
|
4240
|
+
function pr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4255
4241
|
let d = 0;
|
|
4256
4242
|
for (let f of e) {
|
|
4257
4243
|
let e = (f.s0 + f.s1) / 2;
|
|
4258
4244
|
for (let p of [f.s0, f.s1]) {
|
|
4259
|
-
let m =
|
|
4245
|
+
let m = Ve(t, (n + p) / r * i, a, o);
|
|
4260
4246
|
for (let t of [l, u]) {
|
|
4261
|
-
let n =
|
|
4247
|
+
let n = fr(m, s, 0, t), r = fr(f.g, s, p - e, t), i = Math.hypot(r.x - n.x, r.y - n.y) * c;
|
|
4262
4248
|
i > d && (d = i);
|
|
4263
4249
|
}
|
|
4264
4250
|
}
|
|
4265
4251
|
}
|
|
4266
4252
|
return d;
|
|
4267
4253
|
}
|
|
4268
|
-
function
|
|
4269
|
-
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h =
|
|
4254
|
+
function mr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
4255
|
+
let d = i, f = a, p = Math.max(1, o), m = Math.max(1, s), h = Le(n, r, p, m);
|
|
4270
4256
|
if (!h) return;
|
|
4271
4257
|
let g = t.defaultBold ?? !1, _ = t.defaultItalic ?? !1, v = (t.defaultFontSize ?? 18) * Y * c, y = [];
|
|
4272
4258
|
for (let n of t.paragraphs) {
|
|
4273
|
-
let t =
|
|
4259
|
+
let t = Xn(e, n, Infinity, n.defFontSize == null ? v : n.defFontSize * Y * c, n.defColor ? Z(n.defColor) : l, c, 0, g, _, 1, void 0, u, 0);
|
|
4274
4260
|
for (let e of t) y.push(e);
|
|
4275
4261
|
}
|
|
4276
4262
|
if (y.length === 0) return;
|
|
@@ -4289,10 +4275,10 @@ function gr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4289
4275
|
}
|
|
4290
4276
|
e.font = t.font;
|
|
4291
4277
|
let n = t.letterSpacingPx ?? 0, r = e.measureText(t.text);
|
|
4292
|
-
a += r.width + n *
|
|
4278
|
+
a += r.width + n * qn(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));
|
|
4293
4279
|
}
|
|
4294
4280
|
if (a <= 0) continue;
|
|
4295
|
-
let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v =
|
|
4281
|
+
let l = s + c > 0 ? s + c : o, u = h.singleEdge ? .8 : l > 0 ? s / l : .8, g = h.singleEdge ? 1 : p / a, _ = h.singleEdge ? m : l / (i - r), v = Be(h, a), b = 0;
|
|
4296
4282
|
for (let t of n.segments) {
|
|
4297
4283
|
if (t.math) {
|
|
4298
4284
|
b += t.math.width;
|
|
@@ -4303,17 +4289,17 @@ function gr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
4303
4289
|
for (let s of o) {
|
|
4304
4290
|
let o = e.measureText(s).width + n, c = r + u * (i - r);
|
|
4305
4291
|
if (!h.singleEdge && o > 0) {
|
|
4306
|
-
|
|
4292
|
+
cr(e, s, n, o, x(), h, b, a, v, g, _, c, d, f, t.color), b += o;
|
|
4307
4293
|
continue;
|
|
4308
4294
|
}
|
|
4309
|
-
let l =
|
|
4295
|
+
let l = Ve(h, (b + o / 2) / a * v, _, c);
|
|
4310
4296
|
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;
|
|
4311
4297
|
}
|
|
4312
4298
|
}
|
|
4313
4299
|
}
|
|
4314
4300
|
e.restore();
|
|
4315
4301
|
}
|
|
4316
|
-
function
|
|
4302
|
+
function hr(e, t, n, r, i, a, o) {
|
|
4317
4303
|
let s = Math.min(r, i);
|
|
4318
4304
|
switch (e) {
|
|
4319
4305
|
case "rightarrow":
|
|
@@ -4343,17 +4329,17 @@ function _r(e, t, n, r, i, a, o) {
|
|
|
4343
4329
|
default: return null;
|
|
4344
4330
|
}
|
|
4345
4331
|
}
|
|
4346
|
-
function
|
|
4347
|
-
return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null &&
|
|
4332
|
+
function gr(e, t) {
|
|
4333
|
+
return e.defaultTextColor ? Z(e.defaultTextColor) : t.smartArtFallbackTextColor != null && _n(e) ? t.smartArtFallbackTextColor : null;
|
|
4348
4334
|
}
|
|
4349
|
-
function
|
|
4335
|
+
function _r(e, t, n) {
|
|
4350
4336
|
return {
|
|
4351
4337
|
outerRotation: e,
|
|
4352
4338
|
localFlipH: t,
|
|
4353
4339
|
localFlipV: n
|
|
4354
4340
|
};
|
|
4355
4341
|
}
|
|
4356
|
-
function
|
|
4342
|
+
function vr(e, t, n, r, i) {
|
|
4357
4343
|
let a = [
|
|
4358
4344
|
{
|
|
4359
4345
|
x: t,
|
|
@@ -4382,7 +4368,7 @@ function br(e, t, n, r, i) {
|
|
|
4382
4368
|
h: l - s
|
|
4383
4369
|
};
|
|
4384
4370
|
}
|
|
4385
|
-
var
|
|
4371
|
+
var yr = {
|
|
4386
4372
|
tl: [0, 0],
|
|
4387
4373
|
t: [.5, 0],
|
|
4388
4374
|
tr: [1, 0],
|
|
@@ -4393,15 +4379,15 @@ var xr = {
|
|
|
4393
4379
|
b: [.5, 1],
|
|
4394
4380
|
br: [1, 1]
|
|
4395
4381
|
};
|
|
4396
|
-
function
|
|
4382
|
+
function br(e, t, n) {
|
|
4397
4383
|
return [e.a * t + e.c * n + e.e, e.b * t + e.d * n + e.f];
|
|
4398
4384
|
}
|
|
4399
|
-
function
|
|
4400
|
-
let [o, s] =
|
|
4401
|
-
return
|
|
4385
|
+
function xr(e, t, n, r, i, a) {
|
|
4386
|
+
let [o, s] = yr[a ?? "b"];
|
|
4387
|
+
return br(e, t + o * r, n + s * i);
|
|
4402
4388
|
}
|
|
4403
|
-
function
|
|
4404
|
-
let c =
|
|
4389
|
+
function Sr(e, t, n, r, i, a, o, s) {
|
|
4390
|
+
let c = st(e, i, a).corners, l = (o > 0 ? vt(c, o / i, o / a) ?? c : c).map((e) => br(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, _] = yr[s ?? "b"], v = yt(c, g, _);
|
|
4405
4391
|
return {
|
|
4406
4392
|
bbox: {
|
|
4407
4393
|
x: f,
|
|
@@ -4409,22 +4395,22 @@ function wr(e, t, n, r, i, a, o, s) {
|
|
|
4409
4395
|
w: m - f,
|
|
4410
4396
|
h: h - p
|
|
4411
4397
|
},
|
|
4412
|
-
anchor: v ?
|
|
4398
|
+
anchor: v ? br(t, n + v.x, r + v.y) : xr(t, n, r, i, a, s)
|
|
4413
4399
|
};
|
|
4414
4400
|
}
|
|
4415
|
-
function
|
|
4416
|
-
let
|
|
4417
|
-
if (
|
|
4418
|
-
let
|
|
4401
|
+
function Cr(t, n, r, i) {
|
|
4402
|
+
let a = Math.floor(r.x) - 1, o = Math.floor(r.y) - 1, s = Math.max(1, Math.ceil(r.x + r.w) - a + 1), c = Math.max(1, Math.ceil(r.y + r.h) - o + 1);
|
|
4403
|
+
if (i && (a + s <= 0 || o + c <= 0 || a >= i.w || o >= i.h) || ce(s, c).clamped) return t;
|
|
4404
|
+
let l = null;
|
|
4419
4405
|
try {
|
|
4420
|
-
|
|
4406
|
+
l = e(s, c);
|
|
4421
4407
|
} catch {
|
|
4422
|
-
return
|
|
4408
|
+
return t;
|
|
4423
4409
|
}
|
|
4424
|
-
let
|
|
4425
|
-
if (!
|
|
4426
|
-
|
|
4427
|
-
let
|
|
4410
|
+
let u = l?.getContext("2d");
|
|
4411
|
+
if (!l || !u) return t;
|
|
4412
|
+
u.setTransform(n.a, n.b, n.c, n.d, n.e - a, n.f - o), t(u);
|
|
4413
|
+
let d = {
|
|
4428
4414
|
a: 1,
|
|
4429
4415
|
b: 0,
|
|
4430
4416
|
c: 0,
|
|
@@ -4433,10 +4419,10 @@ function Tr(e, t, n, r) {
|
|
|
4433
4419
|
f: 0
|
|
4434
4420
|
};
|
|
4435
4421
|
return (e) => {
|
|
4436
|
-
e.save(), e.setTransform(
|
|
4422
|
+
e.save(), e.setTransform(d), e.drawImage(l, a, o), e.restore();
|
|
4437
4423
|
};
|
|
4438
4424
|
}
|
|
4439
|
-
function
|
|
4425
|
+
function wr(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
4440
4426
|
let d = e.canvas.width || 0, f = e.canvas.height || 0, p = d > 0 && f > 0, m = {
|
|
4441
4427
|
a: 1,
|
|
4442
4428
|
b: 0,
|
|
@@ -4451,33 +4437,33 @@ function Er(e, t, n, r, i, a, o, s, c, l = !0, u = r) {
|
|
|
4451
4437
|
}, v = (e) => {
|
|
4452
4438
|
h(e), u(e);
|
|
4453
4439
|
}, y = !1;
|
|
4454
|
-
t.shadow && p ? (e.save(), e.setTransform(m), y = !
|
|
4440
|
+
t.shadow && p ? (e.save(), e.setTransform(m), y = !qe(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), Xe(e, g, i, t.reflection, s, d, f), e.restore()), y ? tr(e, t.shadow ?? null, o) : t.glow && nr(e, t.glow, o), t.softEdge && p ? (e.save(), e.setTransform(m), Ye(e, g, i, t.softEdge, s, d, f, _), e.restore()) : n(e), (y || t.glow) && rr(e), t.innerShadow && l && p && (e.save(), e.setTransform(m), Je(e, v, i, t.innerShadow, s, d, f), e.restore());
|
|
4455
4441
|
}
|
|
4456
|
-
function
|
|
4442
|
+
function Tr(e, t, n, r = "#000000", i, a = {
|
|
4457
4443
|
themeMajorFont: null,
|
|
4458
4444
|
themeMinorFont: null,
|
|
4459
4445
|
dpr: 1
|
|
4460
|
-
},
|
|
4461
|
-
let
|
|
4446
|
+
}, o, s) {
|
|
4447
|
+
let c = X(t.x, n), d = X(t.y, n), f = X(t.width, n), p = X(t.height, n), m = o && t.id !== void 0 ? (e) => o({
|
|
4462
4448
|
...e,
|
|
4463
4449
|
shapeId: t.id
|
|
4464
|
-
}) :
|
|
4450
|
+
}) : o;
|
|
4465
4451
|
if (p === 0 && t.textBody?.verticalAnchor === "b") {
|
|
4466
|
-
if (t.stroke && (e.save(),
|
|
4467
|
-
x:
|
|
4452
|
+
if (t.stroke && (e.save(), Hr(e, t.stroke, n, {
|
|
4453
|
+
x: c,
|
|
4468
4454
|
y: d,
|
|
4469
4455
|
w: f,
|
|
4470
4456
|
h: 1
|
|
4471
|
-
}, t.rotation), e.beginPath(), e.moveTo(
|
|
4472
|
-
let
|
|
4473
|
-
|
|
4457
|
+
}, t.rotation), e.beginPath(), e.moveTo(c, d), e.lineTo(c + f, d), e.stroke(), e.restore()), t.textBody) {
|
|
4458
|
+
let o = gr(t, a);
|
|
4459
|
+
jr(e, t.textBody, c, d, f, p, n, o, t.rotation, t.flipH, t.flipV, r, i, a, m, !1, s);
|
|
4474
4460
|
}
|
|
4475
4461
|
return;
|
|
4476
4462
|
}
|
|
4477
|
-
let h = t.scene3d &&
|
|
4463
|
+
let h = t.scene3d && ct(t.scene3d.camera) ? t.scene3d : null;
|
|
4478
4464
|
if (h && f > 0 && p > 0) {
|
|
4479
|
-
let
|
|
4480
|
-
e.save(), g.outerRotation !== 0 && (e.translate(
|
|
4465
|
+
let o = e.getTransform(), s = Math.abs(o.a * o.d - o.b * o.c), l = s > 0 ? Math.sqrt(s) : 1, u = Mr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, l), m = Nr(t.sp3d, h.camera, f, p, n, l), g = _r(t.rotation, t.flipH, t.flipV);
|
|
4466
|
+
e.save(), g.outerRotation !== 0 && (e.translate(c + f / 2, d + p / 2), e.rotate(g.outerRotation * Math.PI / 180), e.translate(-(c + f / 2), -(d + p / 2)));
|
|
4481
4467
|
let _ = {
|
|
4482
4468
|
...t,
|
|
4483
4469
|
x: 0,
|
|
@@ -4499,21 +4485,21 @@ function Dr(e, t, n, i = "#000000", a, o = {
|
|
|
4499
4485
|
..._,
|
|
4500
4486
|
fill: null,
|
|
4501
4487
|
stroke: null
|
|
4502
|
-
}, b = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) /
|
|
4503
|
-
|
|
4504
|
-
},
|
|
4505
|
-
bevels:
|
|
4488
|
+
}, b = (t.stroke ? t.stroke.width * n / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * n : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / l : 0) + 2, x = (e, t, o) => Pr(e, h.camera, c, d, f, p, (e) => {
|
|
4489
|
+
Tr(e, t, n, r, i, a, void 0);
|
|
4490
|
+
}, o ? {
|
|
4491
|
+
bevels: u,
|
|
4506
4492
|
extrusion: m ?? void 0,
|
|
4507
4493
|
edgePadCss: b
|
|
4508
4494
|
} : {}), S = (e) => x(e, v, !0), C = (e) => !t.textBody || x(e, y, !1);
|
|
4509
4495
|
if (t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection) {
|
|
4510
|
-
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o =
|
|
4496
|
+
let r = e.getTransform(), i = Math.abs(r.a * r.d - r.b * r.c), a = i > 0 ? Math.sqrt(i) : 1, o = Sr(h.camera, r, c, d, f, p, b, t.shadow?.algn), s = !1, l = Cr((e) => {
|
|
4511
4497
|
s = S(e) || s;
|
|
4512
4498
|
}, r, o.bbox, {
|
|
4513
4499
|
w: e.canvas.width || 0,
|
|
4514
4500
|
h: e.canvas.height || 0
|
|
4515
4501
|
});
|
|
4516
|
-
if (
|
|
4502
|
+
if (wr(e, t, l, l, o.bbox, o.anchor, n, n * a, r, !!t.fill), s) {
|
|
4517
4503
|
C(e), e.restore();
|
|
4518
4504
|
return;
|
|
4519
4505
|
}
|
|
@@ -4523,9 +4509,9 @@ function Dr(e, t, n, i = "#000000", a, o = {
|
|
|
4523
4509
|
}
|
|
4524
4510
|
e.restore();
|
|
4525
4511
|
}
|
|
4526
|
-
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(
|
|
4527
|
-
let g = t.geometry.toLowerCase(), _ =
|
|
4528
|
-
t.shadow ||
|
|
4512
|
+
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + f / 2, d + p / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + f / 2), -(d + p / 2)));
|
|
4513
|
+
let g = t.geometry.toLowerCase(), _ = En(t.fill, e, c, d, f, p, t.rotation);
|
|
4514
|
+
t.shadow || nr(e, t.glow ?? null, n);
|
|
4529
4515
|
let v = new Set([
|
|
4530
4516
|
"line",
|
|
4531
4517
|
"straightconnector1",
|
|
@@ -4550,22 +4536,22 @@ function Dr(e, t, n, i = "#000000", a, o = {
|
|
|
4550
4536
|
"accentbordercallout1",
|
|
4551
4537
|
"accentbordercallout2",
|
|
4552
4538
|
"accentbordercallout3"
|
|
4553
|
-
]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom &&
|
|
4554
|
-
x:
|
|
4539
|
+
]), b = (e) => y.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector"), x = !t.custGeom && w(g), S = (r, i, a = {
|
|
4540
|
+
x: c,
|
|
4555
4541
|
y: d,
|
|
4556
4542
|
w: f,
|
|
4557
4543
|
h: p
|
|
4558
4544
|
}) => {
|
|
4559
|
-
let { x: o, y: s, w:
|
|
4560
|
-
|
|
4545
|
+
let { x: o, y: s, w: u, h: m } = a, h = i ?? (r === e && o === c && s === d && u === f && m === p ? _ : En(t.fill, r, o, s, u, m, t.rotation)), v = i ? null : t.stroke ? () => {
|
|
4546
|
+
Hr(r, t.stroke, n, {
|
|
4561
4547
|
x: o,
|
|
4562
4548
|
y: s,
|
|
4563
|
-
w:
|
|
4564
|
-
h:
|
|
4549
|
+
w: u,
|
|
4550
|
+
h: m
|
|
4565
4551
|
}, t.rotation), r.stroke();
|
|
4566
|
-
} : null,
|
|
4552
|
+
} : null, y = () => rr(r);
|
|
4567
4553
|
if (x && !i) {
|
|
4568
|
-
|
|
4554
|
+
l(r, g, o, s, u, m, [
|
|
4569
4555
|
t.adj,
|
|
4570
4556
|
t.adj2,
|
|
4571
4557
|
t.adj3,
|
|
@@ -4574,11 +4560,11 @@ function Dr(e, t, n, i = "#000000", a, o = {
|
|
|
4574
4560
|
t.adj6,
|
|
4575
4561
|
t.adj7,
|
|
4576
4562
|
t.adj8
|
|
4577
|
-
],
|
|
4563
|
+
], h, v, y, b(g) ? { skipTrailingStroke: !0 } : void 0);
|
|
4578
4564
|
return;
|
|
4579
4565
|
}
|
|
4580
|
-
r.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
4581
|
-
}, T = e.getTransform(), E = Math.abs(T.a * T.d - T.b * T.c), D = E > 0 ? Math.sqrt(E) : 1, O = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ?
|
|
4566
|
+
r.beginPath(), t.custGeom && t.custGeom.length > 0 ? Er(r, t.custGeom, o, s, u, m) : be(r, g, o, s, u, m, t.adj, t.adj2, t.adj3, t.adj4), h && g !== "arc" && (r.fillStyle = h, g === "donut" || g === "smileyface" || g === "frame" ? r.fill("evenodd") : r.fill(), i || y()), v && v();
|
|
4567
|
+
}, T = e.getTransform(), E = Math.abs(T.a * T.d - T.b * T.c), D = E > 0 ? Math.sqrt(E) : 1, O = (t.shadow || t.reflection || t.softEdge || t.innerShadow ? x ? C(g, c, d, f, p, [
|
|
4582
4568
|
t.adj,
|
|
4583
4569
|
t.adj2,
|
|
4584
4570
|
t.adj3,
|
|
@@ -4587,20 +4573,20 @@ function Dr(e, t, n, i = "#000000", a, o = {
|
|
|
4587
4573
|
t.adj6,
|
|
4588
4574
|
t.adj7,
|
|
4589
4575
|
t.adj8
|
|
4590
|
-
]) : t.custGeom && t.custGeom.length > 0 ?
|
|
4591
|
-
x:
|
|
4576
|
+
]) : t.custGeom && t.custGeom.length > 0 ? ve(t.custGeom, c, d, f, p) : null : null) ?? {
|
|
4577
|
+
x: c,
|
|
4592
4578
|
y: d,
|
|
4593
4579
|
w: f,
|
|
4594
4580
|
h: p
|
|
4595
|
-
}, k = t.stroke ? t.stroke.width * n / 2 : 0, A = t.stroke ? Math.max(t.stroke.headEnd ?
|
|
4581
|
+
}, k = t.stroke ? t.stroke.width * n / 2 : 0, A = t.stroke ? Math.max(t.stroke.headEnd ? xe(t.stroke.headEnd, t.stroke, n) : 0, t.stroke.tailEnd ? xe(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 ? {
|
|
4596
4582
|
x: O.x - M,
|
|
4597
4583
|
y: O.y - M,
|
|
4598
4584
|
w: O.w + M * 2,
|
|
4599
4585
|
h: O.h + M * 2
|
|
4600
|
-
} : O, P =
|
|
4601
|
-
let
|
|
4586
|
+
} : O, P = vr(T, N.x, N.y, N.w, N.h), F = n * D, I = h ? [] : Mr(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, n, D), L = (t.stroke ? t.stroke.width * n / 2 : 0) + 2, R = (e) => {
|
|
4587
|
+
let r = t.stroke?.fill ? En(t.stroke.fill, e, c, d, f, p, t.rotation) ?? void 0 : void 0;
|
|
4602
4588
|
if (t.stroke && (v.has(g) || y.has(g))) {
|
|
4603
|
-
let
|
|
4589
|
+
let i = u(g, c, d, f, p, [
|
|
4604
4590
|
t.adj,
|
|
4605
4591
|
t.adj2,
|
|
4606
4592
|
t.adj3,
|
|
@@ -4610,23 +4596,23 @@ function Dr(e, t, n, i = "#000000", a, o = {
|
|
|
4610
4596
|
t.adj7,
|
|
4611
4597
|
t.adj8
|
|
4612
4598
|
]);
|
|
4613
|
-
if (!
|
|
4614
|
-
let
|
|
4615
|
-
if (b(g) &&
|
|
4616
|
-
let r =
|
|
4599
|
+
if (!i) return;
|
|
4600
|
+
let a = t.stroke.cmpd, o = g === "line" || g === "straightconnector1";
|
|
4601
|
+
if (b(g) && i.vertices.length >= 2 && !(a && o)) {
|
|
4602
|
+
let r = i.vertices.map((e) => ({
|
|
4617
4603
|
x: e.x,
|
|
4618
4604
|
y: e.y
|
|
4619
4605
|
}));
|
|
4620
4606
|
if (t.stroke.tailEnd) {
|
|
4621
|
-
let e =
|
|
4622
|
-
r[r.length - 1] =
|
|
4607
|
+
let e = _e(t.stroke.tailEnd, t.stroke, n);
|
|
4608
|
+
r[r.length - 1] = me(r[r.length - 1], r[r.length - 2], e);
|
|
4623
4609
|
}
|
|
4624
4610
|
if (t.stroke.headEnd) {
|
|
4625
|
-
let e =
|
|
4626
|
-
r[0] =
|
|
4611
|
+
let e = _e(t.stroke.headEnd, t.stroke, n);
|
|
4612
|
+
r[0] = me(r[0], r[1], e);
|
|
4627
4613
|
}
|
|
4628
|
-
|
|
4629
|
-
x:
|
|
4614
|
+
Hr(e, t.stroke, n, {
|
|
4615
|
+
x: c,
|
|
4630
4616
|
y: d,
|
|
4631
4617
|
w: f,
|
|
4632
4618
|
h: p
|
|
@@ -4634,46 +4620,46 @@ function Dr(e, t, n, i = "#000000", a, o = {
|
|
|
4634
4620
|
for (let t = 1; t < r.length; t++) e.lineTo(r[t].x, r[t].y);
|
|
4635
4621
|
e.stroke();
|
|
4636
4622
|
}
|
|
4637
|
-
|
|
4623
|
+
a && o && Vr(e, i.start, i.end, t.stroke, a, n, t.rotation), t.stroke.tailEnd && ye(e, i.end.x, i.end.y, i.end.angle, t.stroke.tailEnd, t.stroke, n, r), t.stroke.headEnd && ye(e, i.start.x, i.start.y, i.start.angle, t.stroke.headEnd, t.stroke, n, r);
|
|
4638
4624
|
return;
|
|
4639
4625
|
}
|
|
4640
4626
|
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;
|
|
4641
|
-
let { start:
|
|
4642
|
-
|
|
4627
|
+
let { start: i, end: a } = Se(t.custGeom);
|
|
4628
|
+
i && t.stroke.headEnd && t.stroke.headEnd.type !== "none" && ye(e, c + i.x * f, d + i.y * p, Math.atan2(i.dy * p, i.dx * f), t.stroke.headEnd, t.stroke, n, r), a && t.stroke.tailEnd && t.stroke.tailEnd.type !== "none" && ye(e, c + a.x * f, d + a.y * p, Math.atan2(a.dy * p, a.dx * f), t.stroke.tailEnd, t.stroke, n, r);
|
|
4643
4629
|
}, z = (e) => {
|
|
4644
|
-
if (I.length > 0 &&
|
|
4630
|
+
if (I.length > 0 && Fr(e, c, d, f, p, I, (e, t, n, r, i) => S(e, void 0, {
|
|
4645
4631
|
x: t,
|
|
4646
4632
|
y: n,
|
|
4647
4633
|
w: r,
|
|
4648
4634
|
h: i
|
|
4649
4635
|
}), void 0, L)) {
|
|
4650
|
-
R(e),
|
|
4636
|
+
R(e), rr(e);
|
|
4651
4637
|
return;
|
|
4652
4638
|
}
|
|
4653
4639
|
S(e), R(e);
|
|
4654
4640
|
};
|
|
4655
|
-
if (
|
|
4656
|
-
let
|
|
4641
|
+
if (wr(e, t, z, z, P, xr(T, c, d, f, p, t.shadow?.algn), n, F, T, !!_, (e) => S(e, "#000")), t.textBody) {
|
|
4642
|
+
let o = gr(t, a);
|
|
4657
4643
|
if (e.save(), t.flipH || t.flipV) {
|
|
4658
|
-
let n =
|
|
4644
|
+
let n = c + f / 2, r = d + p / 2;
|
|
4659
4645
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
4660
4646
|
}
|
|
4661
|
-
let
|
|
4662
|
-
if (t.textRect)
|
|
4647
|
+
let l = c, u = d, h = f, _ = p;
|
|
4648
|
+
if (t.textRect) l = X(t.textRect.x, n), u = X(t.textRect.y, n), h = X(t.textRect.width, n), _ = X(t.textRect.height, n);
|
|
4663
4649
|
else if (g === "ellipse") {
|
|
4664
4650
|
let e = f * (1 - 1 / Math.SQRT2) / 2, t = p * (1 - 1 / Math.SQRT2) / 2;
|
|
4665
|
-
|
|
4651
|
+
l = c + e, u = d + t, h = f / Math.SQRT2, _ = p / Math.SQRT2;
|
|
4666
4652
|
} else {
|
|
4667
|
-
let e =
|
|
4668
|
-
e && (
|
|
4653
|
+
let e = hr(g, c, d, f, p, t.adj, t.adj2);
|
|
4654
|
+
e && (l = e.tx, u = e.ty, h = e.tw, _ = e.th);
|
|
4669
4655
|
}
|
|
4670
|
-
|
|
4656
|
+
jr(e, t.textBody, l, u, h, _, n, o, t.rotation, !1, !1, r, i, a, m, !1, s), e.restore();
|
|
4671
4657
|
}
|
|
4672
4658
|
e.restore();
|
|
4673
4659
|
}
|
|
4674
|
-
var
|
|
4675
|
-
function
|
|
4676
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
4660
|
+
var Er = he;
|
|
4661
|
+
function Dr(e, t) {
|
|
4662
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Or(e).toLowerCase(), o = Or(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
4677
4663
|
switch (t) {
|
|
4678
4664
|
case "arabicPlain": return n;
|
|
4679
4665
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -4700,7 +4686,7 @@ function kr(e, t) {
|
|
|
4700
4686
|
default: return `${n}.`;
|
|
4701
4687
|
}
|
|
4702
4688
|
}
|
|
4703
|
-
function
|
|
4689
|
+
function Or(e) {
|
|
4704
4690
|
let t = [
|
|
4705
4691
|
1e3,
|
|
4706
4692
|
900,
|
|
@@ -4733,28 +4719,28 @@ function Ar(e) {
|
|
|
4733
4719
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
4734
4720
|
return r;
|
|
4735
4721
|
}
|
|
4736
|
-
function
|
|
4722
|
+
function kr(e) {
|
|
4737
4723
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
4738
4724
|
return !1;
|
|
4739
4725
|
}
|
|
4740
|
-
function
|
|
4741
|
-
let n =
|
|
4742
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
4726
|
+
function Ar(e, t) {
|
|
4727
|
+
let n = kr(e);
|
|
4728
|
+
if (e.bullet.type === "char") return t.clear(), n ? ge(e.bullet.char, e.bullet.fontFamily ?? null) : "";
|
|
4743
4729
|
if (e.bullet.type === "autoNum") {
|
|
4744
4730
|
if (!n) return "";
|
|
4745
4731
|
let r = e.lvl;
|
|
4746
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
4732
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Dr(t.get(r), e.bullet.numType);
|
|
4747
4733
|
}
|
|
4748
4734
|
return t.clear(), "";
|
|
4749
4735
|
}
|
|
4750
|
-
function
|
|
4736
|
+
function jr(e, t, n, r, i, a, o, s = null, l = 0, u = !1, d = !1, f = "#000000", p, m = {
|
|
4751
4737
|
themeMajorFont: null,
|
|
4752
4738
|
themeMinorFont: null,
|
|
4753
4739
|
dpr: 1
|
|
4754
|
-
},
|
|
4740
|
+
}, h, g = !1, _, v = !1) {
|
|
4755
4741
|
let y = t.vert === "vert" || t.vert === "eaVert", b = t.vert === "vert270";
|
|
4756
4742
|
if (y || b) {
|
|
4757
|
-
let
|
|
4743
|
+
let c = n + i / 2, u = r + a / 2, d = y ? 90 : -90, v = h ? (e) => h({
|
|
4758
4744
|
...e,
|
|
4759
4745
|
inShapeX: e.inShapeX - a / 2 + i / 2,
|
|
4760
4746
|
inShapeY: e.inShapeY - i / 2 + a / 2,
|
|
@@ -4762,25 +4748,25 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4762
4748
|
shapeY: r,
|
|
4763
4749
|
shapeW: i,
|
|
4764
4750
|
shapeH: a,
|
|
4765
|
-
rotation:
|
|
4766
|
-
textBodyRotation:
|
|
4751
|
+
rotation: l,
|
|
4752
|
+
textBodyRotation: d
|
|
4767
4753
|
}) : void 0;
|
|
4768
4754
|
if (g) return i;
|
|
4769
|
-
e.save(), e.translate(
|
|
4755
|
+
e.save(), e.translate(c, u), e.rotate(b ? -Math.PI / 2 : Math.PI / 2), jr(e, {
|
|
4770
4756
|
...t,
|
|
4771
4757
|
vert: "horz"
|
|
4772
|
-
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1,
|
|
4758
|
+
}, -a / 2, -i / 2, a, i, o, s, 0, !1, !1, f, p, m, v, !1, _, t.vert === "eaVert"), e.restore();
|
|
4773
4759
|
return;
|
|
4774
4760
|
}
|
|
4775
4761
|
let x = t.textWarp;
|
|
4776
|
-
if (!g && x &&
|
|
4777
|
-
|
|
4762
|
+
if (!g && x && Me(x.preset)) {
|
|
4763
|
+
mr(e, t, x.preset, x.adj ?? [], n, r, i, a, o, s ?? f, m);
|
|
4778
4764
|
return;
|
|
4779
4765
|
}
|
|
4780
|
-
let S = X(t.lIns, o), C = X(t.rIns, o), w = X(t.tIns, o), T = X(t.bIns, o), E = t.wrap !== "none", D = t.autoFit === "sp" ? E &&
|
|
4766
|
+
let S = X(t.lIns, o), C = X(t.rIns, o), w = X(t.tIns, o), T = X(t.bIns, o), E = t.wrap !== "none", D = t.autoFit === "sp" ? E && Gn(e, t, i, S, C, o, m) : E, O = Math.max(1, t.numCol ?? 1), k = X(t.spcCol ?? 0, o), A = t.defaultBold ?? !1, j = t.defaultItalic ?? !1, M = s ?? f, N = (r) => {
|
|
4781
4767
|
let a = (t.defaultFontSize ?? 18) * Y * o * r, s = [], c = 0, l = /* @__PURE__ */ new Map();
|
|
4782
4768
|
for (let u = 0; u < t.paragraphs.length; u++) {
|
|
4783
|
-
let d = t.paragraphs[u],
|
|
4769
|
+
let d = t.paragraphs[u], f = X(d.marL, o), h = X(d.marR, o), g = X(d.indent, o), _ = d.defFontSize == null ? a : d.defFontSize * Y * o * r, v = d.defColor ? Z(d.defColor) : M, y = Un(d), b = (() => {
|
|
4784
4770
|
for (let e of d.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
4785
4771
|
return null;
|
|
4786
4772
|
})(), x = b == null ? _ : b * Y * o * r, w = (() => {
|
|
@@ -4789,15 +4775,15 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4789
4775
|
})(), T = w ? Z(w) : v, E = (() => {
|
|
4790
4776
|
for (let e of d.runs) if (e.type === "text" && e.fontFamily) return e.fontFamily;
|
|
4791
4777
|
return d.defFontFamily ?? null;
|
|
4792
|
-
})(), N = "", P =
|
|
4793
|
-
N =
|
|
4794
|
-
let L =
|
|
4778
|
+
})(), N = "", P = Hn(!1, !1, x, "sans-serif", m), F = T, I = null;
|
|
4779
|
+
N = Ar(d, l);
|
|
4780
|
+
let L = De(d.bullet);
|
|
4795
4781
|
if (L.type === "char") {
|
|
4796
4782
|
let e = L;
|
|
4797
|
-
P =
|
|
4783
|
+
P = Hn(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * Y * o * r, N === e.char ? jn(e.fontFamily ?? null, m) : "sans-serif", m), F = e.color ? Z(e.color) : T;
|
|
4798
4784
|
} else if (L.type === "autoNum") {
|
|
4799
4785
|
let e = L;
|
|
4800
|
-
P =
|
|
4786
|
+
P = Hn(!1, !1, e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * Y * o * r, jn(e.fontFamily ?? E, m), m), F = L.color ? Z(L.color) : T;
|
|
4801
4787
|
} else if (L.type === "blip") {
|
|
4802
4788
|
let e = L, t = e.sizePts == null ? e.sizePct == null ? x : x * (e.sizePct / 100) : e.sizePts * Y * o * r;
|
|
4803
4789
|
I = {
|
|
@@ -4806,13 +4792,13 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4806
4792
|
sizePx: t
|
|
4807
4793
|
};
|
|
4808
4794
|
}
|
|
4809
|
-
let R = O > 1 ? (i - S - C - (O - 1) * k) / O : i - S - C, z = n + S +
|
|
4795
|
+
let R = O > 1 ? (i - S - C - (O - 1) * k) / O : i - S - C, z = n + S + f, B = n + S + f + g, V = R - f - h, H = Xn(e, d, D ? V : Infinity, _, v, o, f, A, j, r, p, m, Wn(y, g)), U = d.spaceBefore == null ? 0 : d.spaceBefore / 100 * Y * o * r, W = d.spaceAfter == null ? 0 : d.spaceAfter / 100 * Y * o * r;
|
|
4810
4796
|
for (let n = 0; n < H.length; n++) {
|
|
4811
4797
|
let r = H[n], i = n === 0, a = n === H.length - 1, l = 0, f = 0;
|
|
4812
4798
|
for (let e of r.segments) {
|
|
4813
4799
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
4814
4800
|
if (t > l && (l = t), !e.math) {
|
|
4815
|
-
let t =
|
|
4801
|
+
let t = K(e.fontFamily, e.sizePx);
|
|
4816
4802
|
t > f && (f = t);
|
|
4817
4803
|
}
|
|
4818
4804
|
}
|
|
@@ -4824,7 +4810,7 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4824
4810
|
i && I && I.sizePx > l && (l = I.sizePx);
|
|
4825
4811
|
let p = l * 1.2, m = Math.max(p, f), h;
|
|
4826
4812
|
h = d.spaceLine ? d.spaceLine.type === "pct" ? p * (d.spaceLine.val / 1e5) : d.spaceLine.val * Y * o : m, t.autoFit === "norm" && t.lnSpcReduction != null && d.spaceLine?.type !== "pts" && (h *= 1 - t.lnSpcReduction);
|
|
4827
|
-
let v = h + (a ? W : 0), b = i && u > 0 ? U : 0, x = i ?
|
|
4813
|
+
let v = h + (a ? W : 0), b = i && u > 0 ? U : 0, x = i ? Wn(y, g) : 0, S = r.segments.some((e) => e.text && e.text.length > 0 || e.math != null), C = i && S ? I : null;
|
|
4828
4814
|
s.push({
|
|
4829
4815
|
line: r,
|
|
4830
4816
|
linePx: v,
|
|
@@ -4866,15 +4852,15 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4866
4852
|
a === 0 && I === "b" ? (R = w + F + T, L = r - R) : R = t.autoFit === "sp" ? Math.max(a, w + F + T) : a;
|
|
4867
4853
|
let z, B = Math.max(0, R - w - T);
|
|
4868
4854
|
z = I === "ctr" ? L + w + (B - F) / 2 : I === "b" ? L + R - T - F : L + w, e.save(), e.textAlign = "left", e.textBaseline = "alphabetic";
|
|
4869
|
-
let V = z, H = O > 1 ? (i - S - C - (O - 1) * k) / O + k : 0, U = Math.max(0, R - w - T), W = P[P.length - 1], G = W ? Math.max(0, W.linePx - W.lineHeight) : 0,
|
|
4855
|
+
let V = z, H = O > 1 ? (i - S - C - (O - 1) * k) / O + k : 0, U = Math.max(0, R - w - T), W = P[P.length - 1], G = W ? Math.max(0, W.linePx - W.lineHeight) : 0, q = F - G, ee = a === 0 || q <= U + .5, te = O > 1 && !ee ? Math.ceil(P.length / O) : P.length, ne = 0, re = 0;
|
|
4870
4856
|
for (let s of P) {
|
|
4871
|
-
let { line:
|
|
4872
|
-
O > 1 && ne < O - 1 && re >= te && (ne++, re = 0, z = V), z +=
|
|
4873
|
-
let T = (t.rtlCol ? O - 1 - ne : ne) * H, E = s.textX + T, D = s.bulletX + T, k = s.textMaxW, A = s.para.rtl === !0, j = A ||
|
|
4857
|
+
let { line: u, linePx: d, lineHeight: f, topGapPx: p, textXOffset: g, bulletLabel: y, bulletFont: b, bulletColor: x, bulletImage: S, alignment: C, isLastLine: w } = s;
|
|
4858
|
+
O > 1 && ne < O - 1 && re >= te && (ne++, re = 0, z = V), z += p, re++;
|
|
4859
|
+
let T = (t.rtlCol ? O - 1 - ne : ne) * H, E = s.textX + T, D = s.bulletX + T, k = s.textMaxW, A = s.para.rtl === !0, j = A || sn(u.segments), M = u.segments.some((e) => e.isTab);
|
|
4874
4860
|
if (M) {
|
|
4875
4861
|
let t = X(s.para.marL, o), n = X(s.para.marR, o), r = A ? n : t + g, i = k + t + n;
|
|
4876
|
-
e.font =
|
|
4877
|
-
let a = e.measureText(" ").width, c =
|
|
4862
|
+
e.font = u.segments.find((e) => e.isTab).font;
|
|
4863
|
+
let a = e.measureText(" ").width, c = yn(u.segments.map((t) => {
|
|
4878
4864
|
if (t.isTab) return {
|
|
4879
4865
|
isTab: !0,
|
|
4880
4866
|
width: 0
|
|
@@ -4893,10 +4879,10 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4893
4879
|
pos: X(e.pos, o),
|
|
4894
4880
|
algn: e.algn
|
|
4895
4881
|
})), r, i, a, X(s.para.defTabSz ?? 914400, o));
|
|
4896
|
-
for (let e = 0; e <
|
|
4882
|
+
for (let e = 0; e < u.segments.length; e++) u.segments[e].isTab && (u.segments[e].tabWidthPx = c[e]);
|
|
4897
4883
|
}
|
|
4898
|
-
let N = 0, P =
|
|
4899
|
-
for (let t of
|
|
4884
|
+
let N = 0, P = f * .8;
|
|
4885
|
+
for (let t of u.segments) {
|
|
4900
4886
|
if (t.isTab) {
|
|
4901
4887
|
N += t.tabWidthPx ?? 0;
|
|
4902
4888
|
continue;
|
|
@@ -4912,7 +4898,7 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4912
4898
|
let F = z + P, I = E + k, L = 0, R = null;
|
|
4913
4899
|
if (j && A) {
|
|
4914
4900
|
if (y) e.font = b, L = e.measureText(y).width;
|
|
4915
|
-
else if (S && _ && (R =
|
|
4901
|
+
else if (S && _ && (R = c(S.imagePath, _), R)) {
|
|
4916
4902
|
let e = S.sizePx;
|
|
4917
4903
|
L = R.height > 0 ? e * (R.width / R.height) : e;
|
|
4918
4904
|
}
|
|
@@ -4922,7 +4908,7 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4922
4908
|
e.direction = "rtl", e.fillText(y, I - L, F), e.direction = t;
|
|
4923
4909
|
} else e.fillText(y, D, F);
|
|
4924
4910
|
if (S && _) {
|
|
4925
|
-
let t =
|
|
4911
|
+
let t = c(S.imagePath, _);
|
|
4926
4912
|
if (t) {
|
|
4927
4913
|
let n = S.sizePx, r = t.height > 0 ? n * (t.width / t.height) : n, i = F - n;
|
|
4928
4914
|
j && A ? e.drawImage(t, I - r, i, r, n) : e.drawImage(t, D, i, r, n);
|
|
@@ -4930,42 +4916,42 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4930
4916
|
}
|
|
4931
4917
|
let B = E + g, U;
|
|
4932
4918
|
U = M ? A ? E + k - L - N : B : C === "ctr" ? B + (k - g - N) / 2 : C === "r" ? E + k - L - N : B;
|
|
4933
|
-
let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, G = w || (
|
|
4919
|
+
let W = C === "just" || C === "justLow" ? "just" : C === "thaiDist" ? "thaiDist" : C === "dist" ? "dist" : null, G = w || (u.endsWithBreak ?? !1), K = (W && !j && !M ? dn(u.segments, k - g, N, W, G) : null) ?? u.segments, q = j ? cn(u.segments, A) : null, ee = (e, t) => {
|
|
4934
4920
|
if (Math.abs(e - t) !== 1) return 0;
|
|
4935
|
-
let n =
|
|
4921
|
+
let n = u.segments[Math.min(e, t)], r = u.segments[Math.max(e, t)];
|
|
4936
4922
|
return n.isTab || n.math || r.isTab || r.math || n.sourceRunId == null || n.sourceRunId !== r.sourceRunId ? 0 : r.leadingLetterSpacingPx ?? 0;
|
|
4937
|
-
}, ie =
|
|
4923
|
+
}, ie = K.length;
|
|
4938
4924
|
for (let t = 0; t < ie; t++) {
|
|
4939
|
-
let s =
|
|
4925
|
+
let s = q ? q.order[t] : t, c = K[s], u = q ? q.rtl[s] : !1;
|
|
4940
4926
|
if (j && (e.direction = u ? "rtl" : "ltr"), t > 0) {
|
|
4941
|
-
let e =
|
|
4927
|
+
let e = q ? q.order[t - 1] : t - 1;
|
|
4942
4928
|
U += ee(e, s);
|
|
4943
4929
|
}
|
|
4944
|
-
if (
|
|
4945
|
-
U +=
|
|
4930
|
+
if (c.isTab) {
|
|
4931
|
+
U += c.tabWidthPx ?? 0;
|
|
4946
4932
|
continue;
|
|
4947
4933
|
}
|
|
4948
|
-
let
|
|
4949
|
-
if (
|
|
4950
|
-
let t =
|
|
4934
|
+
let d = c.jext ?? 0, p = c.splitBefore, g = c.perGap ?? 0, _ = p && p.length > 0 ? p.length * g : 0;
|
|
4935
|
+
if (c.math) {
|
|
4936
|
+
let t = Dn.get(c.math.nodes), n = c.math.width, r = c.math.ascent + c.math.descent;
|
|
4951
4937
|
if (t && n > 0 && r > 0) {
|
|
4952
|
-
let i = F -
|
|
4938
|
+
let i = F - c.math.ascent, a = On(t, c.color);
|
|
4953
4939
|
e.drawImage(a, U, i, n, r);
|
|
4954
4940
|
}
|
|
4955
|
-
U += n, U +=
|
|
4941
|
+
U += n, U += d;
|
|
4956
4942
|
continue;
|
|
4957
4943
|
}
|
|
4958
|
-
e.font =
|
|
4959
|
-
let y = F + (
|
|
4960
|
-
if (
|
|
4961
|
-
let t = Q(e,
|
|
4962
|
-
|
|
4944
|
+
e.font = c.font, e.fillStyle = c.color;
|
|
4945
|
+
let y = F + (c.baseline ? -(c.baseline / 1e5) * c.sizePx : 0), b = c.letterSpacingPx ?? 0;
|
|
4946
|
+
if (c.highlight && c.text) {
|
|
4947
|
+
let t = Q(e, c.text, b) + _ + d;
|
|
4948
|
+
Tn(e, U, y, t, c.sizePx, c.highlight, c.color);
|
|
4963
4949
|
}
|
|
4964
|
-
let x =
|
|
4950
|
+
let x = c.shadow, S = (e, t, n, r) => {
|
|
4965
4951
|
let i = r === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e);
|
|
4966
|
-
if (b !== 0 &&
|
|
4952
|
+
if (b !== 0 && qn(t) > 1) {
|
|
4967
4953
|
let r = e, a = r.letterSpacing;
|
|
4968
|
-
if (
|
|
4954
|
+
if (Yn(e)) {
|
|
4969
4955
|
r.letterSpacing = `${b}px`, i(t, n, y);
|
|
4970
4956
|
try {
|
|
4971
4957
|
r.letterSpacing = a;
|
|
@@ -4978,17 +4964,17 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
4978
4964
|
}
|
|
4979
4965
|
}
|
|
4980
4966
|
} else i(t, n, y);
|
|
4981
|
-
}, C = (t) => Q(e, t, b), w =
|
|
4967
|
+
}, C = (t) => Q(e, t, b), w = p && p.length > 0 ? Qt([...c.text], p, g, C) : null, T = [...c.text], E = !!p && p.length === T.length - 1 && T.length > 1, D = (e, t) => {
|
|
4982
4968
|
if (v) {
|
|
4983
4969
|
let n = E ? b + g : b;
|
|
4984
|
-
|
|
4970
|
+
wn(e, c.text, U, y, c.sizePx, n, t);
|
|
4985
4971
|
return;
|
|
4986
4972
|
}
|
|
4987
4973
|
if (E) {
|
|
4988
4974
|
let n = t === "fill" ? e.fillText.bind(e) : e.strokeText.bind(e), r = b + g;
|
|
4989
|
-
if (
|
|
4975
|
+
if (Yn(e)) {
|
|
4990
4976
|
let t = e, i = t.letterSpacing;
|
|
4991
|
-
t.letterSpacing = `${r}px`, n(
|
|
4977
|
+
t.letterSpacing = `${r}px`, n(c.text, U, y);
|
|
4992
4978
|
try {
|
|
4993
4979
|
t.letterSpacing = i;
|
|
4994
4980
|
} catch {}
|
|
@@ -5000,21 +4986,21 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
5000
4986
|
}
|
|
5001
4987
|
}
|
|
5002
4988
|
} else if (w) for (let { text: n, dx: r } of w) S(e, n, U + r, t);
|
|
5003
|
-
else S(e,
|
|
5004
|
-
}, O =
|
|
5005
|
-
if (O &&
|
|
4989
|
+
else S(e, c.text, U, t);
|
|
4990
|
+
}, O = c.reflection;
|
|
4991
|
+
if (O && c.text) {
|
|
5006
4992
|
let t = e.canvas.width || 0, n = e.canvas.height || 0;
|
|
5007
4993
|
if (t > 0 && n > 0) {
|
|
5008
|
-
e.font =
|
|
5009
|
-
let r = e.measureText(
|
|
5010
|
-
|
|
5011
|
-
e.font =
|
|
4994
|
+
e.font = c.font;
|
|
4995
|
+
let r = e.measureText(c.text), i = Number.isFinite(r.actualBoundingBoxAscent) ? r.actualBoundingBoxAscent : c.sizePx * .8, a = Number.isFinite(r.actualBoundingBoxDescent) ? r.actualBoundingBoxDescent : c.sizePx * .2, s = 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;
|
|
4996
|
+
Vn(e, (e) => {
|
|
4997
|
+
e.font = c.font, e.fillStyle = c.color, D(e, "fill");
|
|
5012
4998
|
}, {
|
|
5013
4999
|
x: (U - s) * f,
|
|
5014
5000
|
y: (y - i) * f,
|
|
5015
|
-
w: Math.max(1, s +
|
|
5001
|
+
w: Math.max(1, s + l) * f,
|
|
5016
5002
|
h: Math.max(1, i + a) * f
|
|
5017
|
-
}, O, o * f, u, t, n), e.font =
|
|
5003
|
+
}, O, o * f, u, t, n), e.font = c.font, e.fillStyle = c.color;
|
|
5018
5004
|
}
|
|
5019
5005
|
}
|
|
5020
5006
|
if (x) {
|
|
@@ -5022,44 +5008,44 @@ function Nr(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
5022
5008
|
e.save(), e.shadowColor = Z(x.color, x.alpha), e.shadowBlur = X(x.blur, o), e.shadowOffsetX = Math.cos(t) * n, e.shadowOffsetY = Math.sin(t) * n;
|
|
5023
5009
|
}
|
|
5024
5010
|
D(e, "fill"), x && e.restore();
|
|
5025
|
-
let k =
|
|
5026
|
-
k && k.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(k.width, o)), e.strokeStyle = k.color ? `#${k.color}` :
|
|
5027
|
-
let A = Q(e,
|
|
5028
|
-
if (
|
|
5029
|
-
text:
|
|
5011
|
+
let k = c.outline;
|
|
5012
|
+
k && k.width > 0 && (e.save(), e.lineWidth = Math.max(.5, X(k.width, o)), e.strokeStyle = k.color ? `#${k.color}` : c.color, e.lineJoin = "round", D(e, "stroke"), e.restore()), e.font = c.font;
|
|
5013
|
+
let A = Q(e, c.text, b) + _;
|
|
5014
|
+
if (h && c.text && h({
|
|
5015
|
+
text: c.text,
|
|
5030
5016
|
inShapeX: U - n,
|
|
5031
5017
|
inShapeY: z - r,
|
|
5032
|
-
w: A +
|
|
5033
|
-
h:
|
|
5034
|
-
fontSize:
|
|
5035
|
-
font:
|
|
5018
|
+
w: A + d,
|
|
5019
|
+
h: f,
|
|
5020
|
+
fontSize: c.sizePx,
|
|
5021
|
+
font: c.font,
|
|
5036
5022
|
shapeX: n,
|
|
5037
5023
|
shapeY: r,
|
|
5038
5024
|
shapeW: i,
|
|
5039
5025
|
shapeH: a,
|
|
5040
|
-
rotation:
|
|
5041
|
-
hyperlink:
|
|
5042
|
-
}),
|
|
5043
|
-
let t = Math.max(1,
|
|
5044
|
-
e.strokeStyle =
|
|
5045
|
-
let n = y -
|
|
5046
|
-
if (
|
|
5026
|
+
rotation: l,
|
|
5027
|
+
hyperlink: c.hyperlink
|
|
5028
|
+
}), c.underline && Xt(e, U, y, A + d, c.sizePx, c.underlineColor ?? c.color, c.underlineStyle, m.dpr), c.strikethrough) {
|
|
5029
|
+
let t = Math.max(1, c.sizePx * .05);
|
|
5030
|
+
e.strokeStyle = c.color, e.lineWidth = t, e.setLineDash([]);
|
|
5031
|
+
let n = y - c.sizePx * .32;
|
|
5032
|
+
if (c.strikeDouble) {
|
|
5047
5033
|
let r = t * .9, i = n - r, a = n + r;
|
|
5048
|
-
e.beginPath(), e.moveTo(U, i +
|
|
5034
|
+
e.beginPath(), e.moveTo(U, i + J(i, t, m.dpr)), e.lineTo(U + A + d, i + J(i, t, m.dpr)), e.moveTo(U, a + J(a, t, m.dpr)), e.lineTo(U + A + d, a + J(a, t, m.dpr)), e.stroke();
|
|
5049
5035
|
} else {
|
|
5050
|
-
let r = n +
|
|
5051
|
-
e.beginPath(), e.moveTo(U, r), e.lineTo(U + A +
|
|
5036
|
+
let r = n + J(n, t, m.dpr);
|
|
5037
|
+
e.beginPath(), e.moveTo(U, r), e.lineTo(U + A + d, r), e.stroke();
|
|
5052
5038
|
}
|
|
5053
5039
|
}
|
|
5054
|
-
U += A, U +=
|
|
5040
|
+
U += A, U += d;
|
|
5055
5041
|
}
|
|
5056
|
-
j && (e.direction = "ltr"), z +=
|
|
5042
|
+
j && (e.direction = "ltr"), z += d;
|
|
5057
5043
|
}
|
|
5058
5044
|
e.restore();
|
|
5059
5045
|
}
|
|
5060
|
-
function
|
|
5046
|
+
function Mr(e, t, n, r, i) {
|
|
5061
5047
|
if (!e) return [];
|
|
5062
|
-
let a =
|
|
5048
|
+
let a = Rt(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = Wt(n), s = r * i, c = [];
|
|
5063
5049
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
5064
5050
|
widthPx: e.bevelT.w * s,
|
|
5065
5051
|
heightPx: e.bevelT.h * s,
|
|
@@ -5075,9 +5061,9 @@ function Pr(e, t, n, r, i) {
|
|
|
5075
5061
|
bottom: !0
|
|
5076
5062
|
}), c;
|
|
5077
5063
|
}
|
|
5078
|
-
function
|
|
5064
|
+
function Nr(e, t, n, r, i, a) {
|
|
5079
5065
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
5080
|
-
let o = e.extrusionH * i * a, s =
|
|
5066
|
+
let o = e.extrusionH * i * a, s = lt(t, n * a, r * a, o);
|
|
5081
5067
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
5082
5068
|
let c = [
|
|
5083
5069
|
64,
|
|
@@ -5098,66 +5084,66 @@ function Fr(e, t, n, r, i, a) {
|
|
|
5098
5084
|
rgb: c
|
|
5099
5085
|
};
|
|
5100
5086
|
}
|
|
5101
|
-
function
|
|
5102
|
-
if (
|
|
5103
|
-
let
|
|
5104
|
-
if (
|
|
5105
|
-
let e =
|
|
5106
|
-
t ?
|
|
5087
|
+
function Pr(t, n, r, i, a, o, s, c = {}) {
|
|
5088
|
+
if (a <= 0 || o <= 0) return !1;
|
|
5089
|
+
let l = t.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.edgePadCss ?? 0) * d)), p = st(n, a, o), m = p.corners;
|
|
5090
|
+
if (f > 0) {
|
|
5091
|
+
let e = f / d, t = vt(p.corners, e / a, e / o);
|
|
5092
|
+
t ? m = t : f = 0;
|
|
5107
5093
|
}
|
|
5108
|
-
let
|
|
5109
|
-
if (!_) return !1;
|
|
5110
|
-
let v = _.getContext("2d");
|
|
5094
|
+
let h = f / d, g = Math.max(1, Math.ceil(a * d) + 2 * f), _ = Math.max(1, Math.ceil(o * d) + 2 * f), v = e(g, _);
|
|
5111
5095
|
if (!v) return !1;
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5096
|
+
let y = v.getContext("2d");
|
|
5097
|
+
if (!y) return !1;
|
|
5098
|
+
y.save(), y.scale(d, d), y.translate(h, h), s(y, 0, 0, a, o), y.restore();
|
|
5099
|
+
let b = Math.ceil(a * d), x = Math.ceil(o * d), S = (e) => ({
|
|
5100
|
+
x: f - e,
|
|
5101
|
+
y: f - e,
|
|
5102
|
+
w: b + 2 * e,
|
|
5103
|
+
h: x + 2 * e
|
|
5118
5104
|
});
|
|
5119
|
-
if (
|
|
5120
|
-
let e = Math.ceil(Math.hypot(
|
|
5121
|
-
|
|
5105
|
+
if (c.extrusion) {
|
|
5106
|
+
let e = Math.ceil(Math.hypot(c.extrusion.offsetX, c.extrusion.offsetY)) + 2;
|
|
5107
|
+
Yt(y, c.extrusion, S(e));
|
|
5122
5108
|
}
|
|
5123
|
-
if (
|
|
5124
|
-
return
|
|
5125
|
-
x:
|
|
5126
|
-
y:
|
|
5109
|
+
if (c.bevels && c.bevels.length > 0) for (let e of c.bevels) Jt(y, e, S(Math.ceil(e.widthPx) + 2));
|
|
5110
|
+
return c.paintEdges && (y.save(), y.scale(d, d), y.translate(h, h), c.paintEdges(y, 0, 0, a, o), y.restore()), gt(v, t, g, _, m.map((e) => ({
|
|
5111
|
+
x: r + e.x,
|
|
5112
|
+
y: i + e.y
|
|
5127
5113
|
}))), !0;
|
|
5128
5114
|
}
|
|
5129
|
-
function
|
|
5130
|
-
if (
|
|
5131
|
-
let
|
|
5132
|
-
if (!g) return !1;
|
|
5133
|
-
let _ = g.getContext("2d");
|
|
5115
|
+
function Fr(t, n, r, i, a, o, s, c, l = 0) {
|
|
5116
|
+
if (i <= 0 || a <= 0 || o.length === 0) return !1;
|
|
5117
|
+
let u = t.getTransform(), d = Math.abs(u.a * u.d - u.b * u.c), f = d > 0 ? Math.sqrt(d) : 1, p = Math.max(0, Math.ceil(l * f)), m = p / f, h = Math.max(1, Math.ceil(i * f) + 2 * p), g = Math.max(1, Math.ceil(a * f) + 2 * p), _ = e(h, g);
|
|
5134
5118
|
if (!_) return !1;
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5119
|
+
let v = _.getContext("2d");
|
|
5120
|
+
if (!v) return !1;
|
|
5121
|
+
v.save(), v.scale(f, f), v.translate(m, m), s(v, 0, 0, i, a), v.restore();
|
|
5122
|
+
let y = Math.ceil(i * f), b = Math.ceil(a * f);
|
|
5123
|
+
for (let e of o) {
|
|
5138
5124
|
let t = Math.ceil(e.widthPx) + 2;
|
|
5139
|
-
|
|
5140
|
-
x:
|
|
5141
|
-
y:
|
|
5142
|
-
w:
|
|
5143
|
-
h:
|
|
5125
|
+
Jt(v, e, {
|
|
5126
|
+
x: p - t,
|
|
5127
|
+
y: p - t,
|
|
5128
|
+
w: y + 2 * t,
|
|
5129
|
+
h: b + 2 * t
|
|
5144
5130
|
});
|
|
5145
5131
|
}
|
|
5146
|
-
return
|
|
5132
|
+
return c && (v.save(), v.scale(f, f), v.translate(m, m), c(v, 0, 0, i, a), v.restore()), t.drawImage(_, n - m, r - m, h / f, g / f), !0;
|
|
5147
5133
|
}
|
|
5148
|
-
var
|
|
5149
|
-
function
|
|
5150
|
-
let t =
|
|
5134
|
+
var Ir = /* @__PURE__ */ new WeakMap();
|
|
5135
|
+
function Lr(e) {
|
|
5136
|
+
let t = Ir.get(e);
|
|
5151
5137
|
return t || (t = async (t, n) => {
|
|
5152
5138
|
let r = await e(t);
|
|
5153
5139
|
return r.type === n ? r : new Blob([r], { type: n });
|
|
5154
|
-
},
|
|
5140
|
+
}, Ir.set(e, t)), t;
|
|
5155
5141
|
}
|
|
5156
|
-
function
|
|
5157
|
-
return
|
|
5142
|
+
function Rr(e, t, n = Lr(t)) {
|
|
5143
|
+
return v("base", e.posterPath, n, async () => {
|
|
5158
5144
|
let n = await t(e.posterPath), r = e.posterMimeType || n.type || "application/octet-stream";
|
|
5159
5145
|
return {
|
|
5160
|
-
bitmap: await
|
|
5146
|
+
bitmap: await m(n.type === r ? n : new Blob([n], { type: r })),
|
|
5161
5147
|
owned: !0
|
|
5162
5148
|
};
|
|
5163
5149
|
}).then((e) => {
|
|
@@ -5165,39 +5151,39 @@ function Br(e, t, n = zr(t)) {
|
|
|
5165
5151
|
return e;
|
|
5166
5152
|
});
|
|
5167
5153
|
}
|
|
5168
|
-
async function
|
|
5169
|
-
if (
|
|
5170
|
-
let
|
|
5171
|
-
if (
|
|
5172
|
-
u = await
|
|
5154
|
+
async function zr(e, t, n, i, a) {
|
|
5155
|
+
if (a) try {
|
|
5156
|
+
let o = t.mimeType === "image/svg+xml", { widthPt: c, heightPt: l } = s(t.mimeType, t.srcRect, t.width / Y, t.height / Y), u;
|
|
5157
|
+
if (A(t)) try {
|
|
5158
|
+
u = await U(t.svgImagePath, a);
|
|
5173
5159
|
} catch {
|
|
5174
|
-
u =
|
|
5175
|
-
widthPt:
|
|
5176
|
-
heightPt:
|
|
5160
|
+
u = o ? await U(t.imagePath, a) : await Ee(t.imagePath, t.mimeType, t.duotone, a, {
|
|
5161
|
+
widthPt: c,
|
|
5162
|
+
heightPt: l
|
|
5177
5163
|
});
|
|
5178
5164
|
}
|
|
5179
|
-
else u =
|
|
5180
|
-
widthPt:
|
|
5181
|
-
heightPt:
|
|
5165
|
+
else u = o ? await U(t.imagePath, a) : await Ee(t.imagePath, t.mimeType, t.duotone, a, {
|
|
5166
|
+
widthPt: c,
|
|
5167
|
+
heightPt: l
|
|
5182
5168
|
});
|
|
5183
|
-
if (!u ||
|
|
5169
|
+
if (!u || i()) return;
|
|
5184
5170
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
5185
5171
|
let d = X(t.x, n), f = X(t.y, n), p = X(t.width, n), m = X(t.height, n);
|
|
5186
5172
|
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(d + p / 2, f + m / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(d + p / 2), -(f + m / 2)));
|
|
5187
|
-
let h =
|
|
5188
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
5173
|
+
let h = ue(u, t.srcRect), g = (e, n, i, a, o) => {
|
|
5174
|
+
t.custGeom && t.custGeom.length > 0 ? Er(e, t.custGeom, n, i, a, o) : t.prstGeom && r(e, t.prstGeom, n, i, a, o, t.prstAdjust ?? []) || e.rect(n, i, a, o);
|
|
5189
5175
|
}, _ = (e, t, n, r, i) => {
|
|
5190
5176
|
e.beginPath(), g(e, t, n, r, i);
|
|
5191
5177
|
}, v = (e, n, r, i, a) => {
|
|
5192
5178
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (_(e, n, r, i, a), e.clip());
|
|
5193
|
-
},
|
|
5194
|
-
t.stroke && (e.save(),
|
|
5179
|
+
}, y = (e, r, i, a, o) => {
|
|
5180
|
+
t.stroke && (e.save(), Hr(e, t.stroke, n, {
|
|
5195
5181
|
x: r,
|
|
5196
5182
|
y: i,
|
|
5197
5183
|
w: a,
|
|
5198
5184
|
h: o
|
|
5199
5185
|
}, t.rotation), _(e, r, i, a, o), e.stroke(), e.restore());
|
|
5200
|
-
},
|
|
5186
|
+
}, b = (e, r, i, a, o) => {
|
|
5201
5187
|
let s = t.sp3d;
|
|
5202
5188
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
5203
5189
|
let t = Math.max(.5, s.contourW * n);
|
|
@@ -5205,56 +5191,56 @@ async function Vr(e, t, n, r, i) {
|
|
|
5205
5191
|
let c = t * 2 + Math.max(a, o);
|
|
5206
5192
|
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), g(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), _(e, r, i, a, o), e.strokeStyle = Z(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
5207
5193
|
}
|
|
5208
|
-
},
|
|
5194
|
+
}, x = t.scene3d && ct(t.scene3d.camera) ? t.scene3d : null, S = (e, t, n, r, i) => {
|
|
5209
5195
|
e.save(), v(e, t, n, r, i), h ? e.drawImage(u, h.sx, h.sy, h.sw, h.sh, t, n, r, i) : e.drawImage(u, t, n, r, i), e.restore();
|
|
5210
|
-
},
|
|
5211
|
-
|
|
5212
|
-
},
|
|
5213
|
-
|
|
5214
|
-
},
|
|
5215
|
-
if (
|
|
5216
|
-
if (
|
|
5217
|
-
bevels:
|
|
5218
|
-
extrusion:
|
|
5219
|
-
paintEdges:
|
|
5220
|
-
edgePadCss:
|
|
5196
|
+
}, T = (e, t, n, r, i) => {
|
|
5197
|
+
S(e, t, n, r, i), y(e, t, n, r, i), b(e, t, n, r, i);
|
|
5198
|
+
}, E = (e, t, n, r, i) => {
|
|
5199
|
+
S(e, t, n, r, i), y(e, t, n, r, i);
|
|
5200
|
+
}, D = e.getTransform(), O = Math.abs(D.a * D.d - D.b * D.c), k = O > 0 ? Math.sqrt(O) : 1, j = Mr(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, k), M = x ? Nr(t.sp3d, x.camera, p, m, n, k) : null, N = t.stroke ? t.stroke.width * n / 2 : 0, P = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, F = M ? Math.hypot(M.offsetX, M.offsetY) / k : 0, I = N + P + F + 2, L = (e) => {
|
|
5201
|
+
if (x) {
|
|
5202
|
+
if (Pr(e, x.camera, d, f, p, m, E, {
|
|
5203
|
+
bevels: j,
|
|
5204
|
+
extrusion: M ?? void 0,
|
|
5205
|
+
paintEdges: b,
|
|
5206
|
+
edgePadCss: I
|
|
5221
5207
|
})) return;
|
|
5222
|
-
} else if (
|
|
5223
|
-
|
|
5224
|
-
},
|
|
5208
|
+
} else if (j.length > 0 && Fr(e, d, f, p, m, j, E, b, I)) return;
|
|
5209
|
+
T(e, d, f, p, m);
|
|
5210
|
+
}, R = (e, t, n, r, i, a) => {
|
|
5225
5211
|
e.save(), v(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
5226
|
-
},
|
|
5227
|
-
|
|
5228
|
-
},
|
|
5212
|
+
}, z = (e, t) => {
|
|
5213
|
+
x && Pr(e, x.camera, d, f, p, m, (e, n, r, i, a) => R(e, t, n, r, i, a)) || R(e, t, d, f, p, m);
|
|
5214
|
+
}, B = e.getTransform(), V = Math.abs(B.a * B.d - B.b * B.c), H = V > 0 ? Math.sqrt(V) : 1, W = N + P, G = (t.custGeom && t.custGeom.length > 0 ? ve(t.custGeom, d, f, p, m) : t.prstGeom && w(t.prstGeom.toLowerCase()) ? C(t.prstGeom.toLowerCase(), d, f, p, m, t.prstAdjust ?? []) : null) ?? {
|
|
5229
5215
|
x: d,
|
|
5230
5216
|
y: f,
|
|
5231
5217
|
w: p,
|
|
5232
5218
|
h: m
|
|
5233
|
-
}, K =
|
|
5234
|
-
bbox:
|
|
5235
|
-
anchor:
|
|
5236
|
-
}, q = n *
|
|
5237
|
-
|
|
5219
|
+
}, K = x ? Sr(x.camera, B, d, f, p, m, I, t.shadow?.algn) : {
|
|
5220
|
+
bbox: vr(B, G.x - W, G.y - W, G.w + W * 2, G.h + W * 2),
|
|
5221
|
+
anchor: xr(B, d, f, p, m, t.shadow?.algn)
|
|
5222
|
+
}, q = n * H, ee = !!(t.shadow || t.innerShadow || t.glow || t.softEdge || t.reflection), J = (e) => z(e, "#000");
|
|
5223
|
+
wr(e, t, x && ee ? Cr(L, B, K.bbox, {
|
|
5238
5224
|
w: e.canvas.width || 0,
|
|
5239
5225
|
h: e.canvas.height || 0
|
|
5240
|
-
}) :
|
|
5226
|
+
}) : L, x && ee ? Cr(J, B, K.bbox, {
|
|
5241
5227
|
w: e.canvas.width || 0,
|
|
5242
5228
|
h: e.canvas.height || 0
|
|
5243
|
-
}) :
|
|
5229
|
+
}) : J, K.bbox, K.anchor, n, q, B), e.restore();
|
|
5244
5230
|
} catch (e) {
|
|
5245
|
-
if (
|
|
5231
|
+
if (pe(e)) throw e;
|
|
5246
5232
|
}
|
|
5247
5233
|
}
|
|
5248
|
-
async function
|
|
5234
|
+
async function Br(e, t, n, r, i, a, o) {
|
|
5249
5235
|
let s = X(t.x, n), c = X(t.y, n), l = X(t.width, n), u = X(t.height, n), d;
|
|
5250
5236
|
if (t.posterPath && i) try {
|
|
5251
|
-
d = await
|
|
5237
|
+
d = await Rr(t, i, o);
|
|
5252
5238
|
} catch (e) {
|
|
5253
|
-
if (
|
|
5239
|
+
if (pe(e)) throw e;
|
|
5254
5240
|
}
|
|
5255
|
-
r() || (e.save(),
|
|
5241
|
+
r() || (e.save(), Ur(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 || rn(e, s + l / 2, c + u / 2, l, u, "paused"), e.restore());
|
|
5256
5242
|
}
|
|
5257
|
-
function
|
|
5243
|
+
function Vr(e, t, n, r, i, a, o) {
|
|
5258
5244
|
let s = Math.max(.5, X(r.width, a)), c = n.x - t.x, l = n.y - t.y, u = Math.hypot(c, l);
|
|
5259
5245
|
if (u === 0) return;
|
|
5260
5246
|
let d = -l / u, f = c / u, p;
|
|
@@ -5304,30 +5290,30 @@ function Ur(e, t, n, r, i, a, o) {
|
|
|
5304
5290
|
break;
|
|
5305
5291
|
default: return;
|
|
5306
5292
|
}
|
|
5307
|
-
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 ?
|
|
5293
|
+
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 ? En(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) ?? Z(r.color);
|
|
5308
5294
|
for (let r of p) {
|
|
5309
5295
|
let i = d * (s * r.offset), a = f * (s * r.offset);
|
|
5310
5296
|
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();
|
|
5311
5297
|
}
|
|
5312
5298
|
e.restore();
|
|
5313
5299
|
}
|
|
5314
|
-
function
|
|
5315
|
-
if (
|
|
5316
|
-
let n =
|
|
5300
|
+
function Hr(e, t, n, r, i = 0) {
|
|
5301
|
+
if (T(e, t, n), t?.fill && r) {
|
|
5302
|
+
let n = En(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
5317
5303
|
n && (e.strokeStyle = n);
|
|
5318
5304
|
}
|
|
5319
5305
|
}
|
|
5320
|
-
function
|
|
5306
|
+
function Ur(e, t, n) {
|
|
5321
5307
|
if (t.rotation === 0 && !t.flipH && !t.flipV) return;
|
|
5322
5308
|
let r = X(t.x, n), i = X(t.y, n), a = X(t.width, n), o = X(t.height, n);
|
|
5323
5309
|
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));
|
|
5324
5310
|
}
|
|
5325
|
-
function
|
|
5311
|
+
function Wr(e, t, n, r, i = {
|
|
5326
5312
|
themeMajorFont: null,
|
|
5327
5313
|
themeMinorFont: null,
|
|
5328
5314
|
dpr: 1
|
|
5329
5315
|
}) {
|
|
5330
|
-
e.save(),
|
|
5316
|
+
e.save(), Ur(e, t, n);
|
|
5331
5317
|
let a = X(t.x, n), o = X(t.y, n), s = t.cols.map((e) => X(e, n)), c = s.length, l = (e, t) => {
|
|
5332
5318
|
let n = 0;
|
|
5333
5319
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
@@ -5338,7 +5324,7 @@ function Kr(e, t, n, r, i = {
|
|
|
5338
5324
|
for (let t = 0; t < o.cells.length; t++) {
|
|
5339
5325
|
let s = o.cells[t];
|
|
5340
5326
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
5341
|
-
let c = l(t, s.gridSpan || 1), d =
|
|
5327
|
+
let c = l(t, s.gridSpan || 1), d = jr(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
|
|
5342
5328
|
d > u[a] && (u[a] = d);
|
|
5343
5329
|
}
|
|
5344
5330
|
}
|
|
@@ -5349,7 +5335,7 @@ function Kr(e, t, n, r, i = {
|
|
|
5349
5335
|
if (s.hMerge || s.vMerge) continue;
|
|
5350
5336
|
let c = s.rowSpan || 1;
|
|
5351
5337
|
if (c <= 1 || !s.textBody) continue;
|
|
5352
|
-
let d = l(t, s.gridSpan || 1), f =
|
|
5338
|
+
let d = l(t, s.gridSpan || 1), f = jr(e, s.textBody, 0, 0, d, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
|
|
5353
5339
|
for (let e = 0; e < c && a + e < u.length; e++) p += u[a + e];
|
|
5354
5340
|
if (f > p) {
|
|
5355
5341
|
let e = (f - p) / c;
|
|
@@ -5394,10 +5380,10 @@ function Kr(e, t, n, r, i = {
|
|
|
5394
5380
|
}
|
|
5395
5381
|
}
|
|
5396
5382
|
for (let { cell: a, colX: o, rowY: s, cellW: c, cellH: l } of h) {
|
|
5397
|
-
let u =
|
|
5383
|
+
let u = En(a.fill, e, o, s, c, l, t.rotation);
|
|
5398
5384
|
if (u && (e.fillStyle = u, e.fillRect(o, s, c, l)), a.textBody) {
|
|
5399
5385
|
let t = a.textColor ? Z(a.textColor) : null;
|
|
5400
|
-
|
|
5386
|
+
jr(e, a.textBody, o, s, c, l, n, t, 0, !1, !1, "#000000", r, i);
|
|
5401
5387
|
}
|
|
5402
5388
|
}
|
|
5403
5389
|
let _ = i.dpr, v = (e, t) => {
|
|
@@ -5405,13 +5391,13 @@ function Kr(e, t, n, r, i = {
|
|
|
5405
5391
|
let n = g[e][t];
|
|
5406
5392
|
return n < 0 ? null : h[n];
|
|
5407
5393
|
}, y = (r, i, a, o, s) => {
|
|
5408
|
-
|
|
5394
|
+
Hr(e, r, n, {
|
|
5409
5395
|
x: Math.min(i, o),
|
|
5410
5396
|
y: Math.min(a, s),
|
|
5411
5397
|
w: Math.max(1, Math.abs(o - i)),
|
|
5412
5398
|
h: Math.max(1, Math.abs(s - a))
|
|
5413
5399
|
}, t.rotation);
|
|
5414
|
-
let c = i === o ?
|
|
5400
|
+
let c = i === o ? J(i, e.lineWidth, _) : 0, l = a === s ? J(a, e.lineWidth, _) : 0;
|
|
5415
5401
|
e.beginPath(), e.moveTo(i + c, a + l), e.lineTo(o + c, s + l), e.stroke();
|
|
5416
5402
|
};
|
|
5417
5403
|
for (let r of h) {
|
|
@@ -5426,7 +5412,7 @@ function Kr(e, t, n, r, i = {
|
|
|
5426
5412
|
for (; a < n;) {
|
|
5427
5413
|
let r = g[e][a], o = a + 1;
|
|
5428
5414
|
for (; o < n && g[e][o] === r;) o++;
|
|
5429
|
-
let s = v(e, a), c =
|
|
5415
|
+
let s = v(e, a), c = mn(i.borderB, s ? s.cell.borderT : null);
|
|
5430
5416
|
if (c) {
|
|
5431
5417
|
let e = p(a, o - a);
|
|
5432
5418
|
y(c, e, t, e + l(a, o - a), t);
|
|
@@ -5442,16 +5428,16 @@ function Kr(e, t, n, r, i = {
|
|
|
5442
5428
|
for (; t <= r.lastRi;) {
|
|
5443
5429
|
let n = g[t][x], i = t;
|
|
5444
5430
|
for (; i + 1 <= r.lastRi && g[i + 1][x] === n;) i++;
|
|
5445
|
-
let a = v(t, x), o =
|
|
5431
|
+
let a = v(t, x), o = mn(h, a ? S(a.cell) : null);
|
|
5446
5432
|
o && y(o, e, m[t], e, m[i] + u[i]), t = i + 1;
|
|
5447
5433
|
}
|
|
5448
5434
|
}
|
|
5449
|
-
i.diagonalTL && (
|
|
5435
|
+
i.diagonalTL && (Hr(e, i.diagonalTL, n, {
|
|
5450
5436
|
x: a,
|
|
5451
5437
|
y: o,
|
|
5452
5438
|
w: s,
|
|
5453
5439
|
h: d
|
|
5454
|
-
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (
|
|
5440
|
+
}, t.rotation), e.beginPath(), e.moveTo(a, o), e.lineTo(a + s, o + d), e.stroke()), i.diagonalTR && (Hr(e, i.diagonalTR, n, {
|
|
5455
5441
|
x: a,
|
|
5456
5442
|
y: o,
|
|
5457
5443
|
w: s,
|
|
@@ -5460,14 +5446,14 @@ function Kr(e, t, n, r, i = {
|
|
|
5460
5446
|
}
|
|
5461
5447
|
e.restore();
|
|
5462
5448
|
}
|
|
5463
|
-
function
|
|
5449
|
+
function Gr(e, t, n, r) {
|
|
5464
5450
|
e.save(), e.globalAlpha = t.opacity, e.fillStyle = t.color, e.fillRect(0, 0, n, r), e.restore();
|
|
5465
5451
|
}
|
|
5466
|
-
var
|
|
5467
|
-
function
|
|
5468
|
-
|
|
5452
|
+
var Kr = /* @__PURE__ */ new WeakMap();
|
|
5453
|
+
function qr(e) {
|
|
5454
|
+
Kr.set(e, (Kr.get(e) ?? 0) + 1);
|
|
5469
5455
|
}
|
|
5470
|
-
function
|
|
5456
|
+
function Jr(e, t, n, r, i) {
|
|
5471
5457
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
5472
5458
|
let a = Math.max(12, Math.min(t, n) * .04);
|
|
5473
5459
|
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([]);
|
|
@@ -5487,86 +5473,86 @@ function Xr(e, t, n, r, i) {
|
|
|
5487
5473
|
for (let t of f.slice(0, 4)) e.fillText(t, o, h), h += m;
|
|
5488
5474
|
e.restore();
|
|
5489
5475
|
}
|
|
5490
|
-
async function
|
|
5491
|
-
let
|
|
5476
|
+
async function Yr(e, t, r, i, a = {}, o) {
|
|
5477
|
+
let s = a.fetchImage ?? (a.fetchMedia ? Lr(a.fetchMedia) : void 0), c = s ? n(s) : void 0;
|
|
5492
5478
|
try {
|
|
5493
|
-
return await
|
|
5479
|
+
return await Xr(e, t, r, i, a, o, s);
|
|
5494
5480
|
} finally {
|
|
5495
|
-
|
|
5481
|
+
c?.();
|
|
5496
5482
|
}
|
|
5497
5483
|
}
|
|
5498
|
-
async function
|
|
5499
|
-
let
|
|
5500
|
-
|
|
5501
|
-
let
|
|
5502
|
-
e.width =
|
|
5503
|
-
let
|
|
5504
|
-
if (!
|
|
5505
|
-
if (
|
|
5506
|
-
let
|
|
5507
|
-
themeMajorFont:
|
|
5508
|
-
themeMinorFont:
|
|
5509
|
-
themeHlinkColor:
|
|
5510
|
-
dpr:
|
|
5511
|
-
smartArtFallbackTextColor:
|
|
5484
|
+
async function Xr(e, t, n, r, i = {}, a, o) {
|
|
5485
|
+
let c = (Kr.get(e) ?? 0) + 1;
|
|
5486
|
+
Kr.set(e, c);
|
|
5487
|
+
let l = () => Kr.get(e) !== c, u = i.width ?? ((z(e) ? e.offsetWidth : 0) || 960), f = u / n, p = Math.round(u), m = Math.round(r * f), h = i.dpr ?? G(), _ = ce(p * h, m * h), v = _.clamped ? h * _.scale : h;
|
|
5488
|
+
e.width = _.width, e.height = _.height, z(e) && (e.style.width = `${p}px`, e.style.display || (e.style.display = "block"));
|
|
5489
|
+
let y = e.getContext("2d");
|
|
5490
|
+
if (!y) throw Error("Could not get 2D context");
|
|
5491
|
+
if (y.scale(v, v), t.parseError) return Jr(y, p, m, t.slideNumber, t.parseError), e;
|
|
5492
|
+
let b = i.defaultTextColor ? `#${i.defaultTextColor}` : "#000000", x = {
|
|
5493
|
+
themeMajorFont: i.majorFont ?? null,
|
|
5494
|
+
themeMinorFont: i.minorFont ?? null,
|
|
5495
|
+
themeHlinkColor: i.hlinkColor ?? null,
|
|
5496
|
+
dpr: v,
|
|
5497
|
+
smartArtFallbackTextColor: vn(t.background, b)
|
|
5512
5498
|
};
|
|
5513
|
-
if (await
|
|
5514
|
-
let
|
|
5515
|
-
for (let e of t.elements) if (e.type === "picture" &&
|
|
5499
|
+
if (await Zn(y, t.background, p, m, f, l, i.fetchImage), l() || (i.math && await An(t, i.math), l())) return e;
|
|
5500
|
+
let S = t.slideNumber;
|
|
5501
|
+
for (let e of t.elements) if (e.type === "picture" && i.fetchImage) {
|
|
5516
5502
|
let t = e, n = t.mimeType === "image/svg+xml";
|
|
5517
|
-
if (
|
|
5518
|
-
else if (n)
|
|
5503
|
+
if (A(t)) U(t.svgImagePath, i.fetchImage).catch(() => void 0);
|
|
5504
|
+
else if (n) U(t.imagePath, i.fetchImage).catch(() => void 0);
|
|
5519
5505
|
else {
|
|
5520
|
-
let e =
|
|
5521
|
-
|
|
5506
|
+
let e = s(t.mimeType, t.srcRect, t.width / Y, t.height / Y);
|
|
5507
|
+
Ee(t.imagePath, t.mimeType, t.duotone, i.fetchImage, {
|
|
5522
5508
|
widthPt: e.widthPt,
|
|
5523
5509
|
heightPt: e.heightPt
|
|
5524
5510
|
}).catch(() => void 0);
|
|
5525
5511
|
}
|
|
5526
5512
|
} else if (e.type === "media") {
|
|
5527
5513
|
let t = e;
|
|
5528
|
-
t.posterPath &&
|
|
5514
|
+
t.posterPath && i.fetchMedia && Rr(t, i.fetchMedia, o).catch(() => void 0);
|
|
5529
5515
|
}
|
|
5530
|
-
if (
|
|
5531
|
-
let
|
|
5516
|
+
if (i.fetchImage) {
|
|
5517
|
+
let n = i.fetchImage, r = /* @__PURE__ */ new Set();
|
|
5532
5518
|
for (let e of t.elements) if (!(e.type !== "shape" || !e.textBody)) for (let t of e.textBody.paragraphs) {
|
|
5533
|
-
let e =
|
|
5534
|
-
e.type === "blip" &&
|
|
5519
|
+
let e = De(t.bullet);
|
|
5520
|
+
e.type === "blip" && r.add(`${e.imagePath} ${e.mimeType}`);
|
|
5535
5521
|
}
|
|
5536
|
-
if (
|
|
5537
|
-
let [t,
|
|
5538
|
-
return
|
|
5539
|
-
if (
|
|
5522
|
+
if (r.size > 0 && (await Promise.all([...r].map((e) => {
|
|
5523
|
+
let [t, r] = e.split(" ");
|
|
5524
|
+
return g(t, r, n).catch((e) => {
|
|
5525
|
+
if (pe(e)) throw e;
|
|
5540
5526
|
});
|
|
5541
|
-
})),
|
|
5527
|
+
})), l())) return e;
|
|
5542
5528
|
}
|
|
5543
5529
|
for (let [n, r] of t.elements.entries()) {
|
|
5544
|
-
if (
|
|
5545
|
-
if (r.type === "shape")
|
|
5530
|
+
if (l()) return e;
|
|
5531
|
+
if (r.type === "shape") Tr(y, r, f, b, S, x, a ? (e) => a({
|
|
5546
5532
|
...e,
|
|
5547
5533
|
elementIndex: n,
|
|
5548
5534
|
origin: t.elementSources?.[n]?.origin ?? "slide"
|
|
5549
|
-
}) : void 0,
|
|
5550
|
-
else if (r.type === "picture") await
|
|
5551
|
-
else if (r.type === "table")
|
|
5552
|
-
else if (r.type === "media") await
|
|
5535
|
+
}) : void 0, i.fetchImage);
|
|
5536
|
+
else if (r.type === "picture") await zr(y, r, f, l, i.fetchImage);
|
|
5537
|
+
else if (r.type === "table") Wr(y, r, f, S, x);
|
|
5538
|
+
else if (r.type === "media") await Br(y, r, f, l, i.fetchMedia, i.skipMediaControls, i.fetchImage);
|
|
5553
5539
|
else if (r.type === "chart") {
|
|
5554
|
-
let e = Y *
|
|
5555
|
-
|
|
5556
|
-
x: X(r.x,
|
|
5557
|
-
y: X(r.y,
|
|
5558
|
-
w: X(r.width,
|
|
5559
|
-
h: X(r.height,
|
|
5560
|
-
}, e, r.rotation,
|
|
5540
|
+
let e = Y * f;
|
|
5541
|
+
y.save(), Ur(y, r, f), d(y, r.chart, {
|
|
5542
|
+
x: X(r.x, f),
|
|
5543
|
+
y: X(r.y, f),
|
|
5544
|
+
w: X(r.width, f),
|
|
5545
|
+
h: X(r.height, f)
|
|
5546
|
+
}, e, r.rotation, i.threeD, i.regionMap), y.restore();
|
|
5561
5547
|
}
|
|
5562
5548
|
}
|
|
5563
|
-
return
|
|
5549
|
+
return l() || i.dim && Gr(y, i.dim, p, m), e;
|
|
5564
5550
|
}
|
|
5565
5551
|
//#endregion
|
|
5566
5552
|
//#region packages/pptx/src/google-fonts.ts
|
|
5567
|
-
var
|
|
5568
|
-
...
|
|
5569
|
-
...
|
|
5553
|
+
var Zr = {
|
|
5554
|
+
...ae,
|
|
5555
|
+
...q
|
|
5570
5556
|
};
|
|
5571
5557
|
Object.freeze({
|
|
5572
5558
|
archiveEntryCount: 0,
|
|
@@ -5577,7 +5563,7 @@ Object.freeze({
|
|
|
5577
5563
|
function $(e, t) {
|
|
5578
5564
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation bootstrap ${t}`);
|
|
5579
5565
|
}
|
|
5580
|
-
function
|
|
5566
|
+
function Qr(e, t) {
|
|
5581
5567
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation bootstrap slide at ${t}`);
|
|
5582
5568
|
let n = e;
|
|
5583
5569
|
if (n.index !== t) throw Error(`invalid PPTX presentation bootstrap slide index ${n.index}`);
|
|
@@ -5587,7 +5573,7 @@ function ei(e, t) {
|
|
|
5587
5573
|
...n.partName === void 0 ? {} : { partName: n.partName }
|
|
5588
5574
|
});
|
|
5589
5575
|
}
|
|
5590
|
-
function
|
|
5576
|
+
function $r(e) {
|
|
5591
5577
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation bootstrap payload");
|
|
5592
5578
|
let t = e;
|
|
5593
5579
|
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");
|
|
@@ -5600,10 +5586,10 @@ function ti(e) {
|
|
|
5600
5586
|
minorFont: t.minorFont,
|
|
5601
5587
|
hlinkColor: t.hlinkColor,
|
|
5602
5588
|
folHlinkColor: t.folHlinkColor,
|
|
5603
|
-
slides: Object.freeze(t.slides.map(
|
|
5589
|
+
slides: Object.freeze(t.slides.map(Qr))
|
|
5604
5590
|
});
|
|
5605
5591
|
}
|
|
5606
|
-
function
|
|
5592
|
+
function ei(e) {
|
|
5607
5593
|
return Object.freeze({
|
|
5608
5594
|
type: "media",
|
|
5609
5595
|
x: e.x,
|
|
@@ -5620,7 +5606,7 @@ function ni(e) {
|
|
|
5620
5606
|
mimeType: e.mimeType
|
|
5621
5607
|
});
|
|
5622
5608
|
}
|
|
5623
|
-
function
|
|
5609
|
+
function ti(e, t) {
|
|
5624
5610
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error(`invalid PPTX presentation preflight media at slide ${t}`);
|
|
5625
5611
|
let n = e;
|
|
5626
5612
|
for (let e of [
|
|
@@ -5631,9 +5617,9 @@ function ri(e, t) {
|
|
|
5631
5617
|
"rotation"
|
|
5632
5618
|
]) if (typeof n[e] != "number" || !Number.isFinite(n[e])) throw Error(`invalid PPTX presentation preflight media ${e} at slide ${t}`);
|
|
5633
5619
|
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}`);
|
|
5634
|
-
return
|
|
5620
|
+
return ei(n);
|
|
5635
5621
|
}
|
|
5636
|
-
function
|
|
5622
|
+
function ni(e) {
|
|
5637
5623
|
if (!e || typeof e != "object" || Array.isArray(e)) throw Error("invalid PPTX presentation preflight payload");
|
|
5638
5624
|
let t = e;
|
|
5639
5625
|
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");
|
|
@@ -5647,7 +5633,7 @@ function ii(e) {
|
|
|
5647
5633
|
...n.partName === void 0 ? {} : { partName: n.partName },
|
|
5648
5634
|
notes: n.notes,
|
|
5649
5635
|
hidden: n.hidden,
|
|
5650
|
-
mediaElements: Object.freeze(n.mediaElements.map((e) =>
|
|
5636
|
+
mediaElements: Object.freeze(n.mediaElements.map((e) => ti(e, t)))
|
|
5651
5637
|
});
|
|
5652
5638
|
}), r = t.fontPreloadNames.map((e, t) => {
|
|
5653
5639
|
if (e !== null && typeof e != "string") throw Error(`invalid PPTX presentation preflight font at ${t}`);
|
|
@@ -5666,7 +5652,7 @@ function ii(e) {
|
|
|
5666
5652
|
fontPreloadNames: Object.freeze(r)
|
|
5667
5653
|
});
|
|
5668
5654
|
}
|
|
5669
|
-
function
|
|
5655
|
+
function ri(e, t) {
|
|
5670
5656
|
for (let n of e.slides) for (let e of n.mediaElements) {
|
|
5671
5657
|
if (e.mediaPath === t) return e.mimeType;
|
|
5672
5658
|
if (e.posterPath === t) return e.posterMimeType;
|
|
@@ -5675,7 +5661,7 @@ function ai(e, t) {
|
|
|
5675
5661
|
}
|
|
5676
5662
|
//#endregion
|
|
5677
5663
|
//#region packages/pptx/src/slide-pull-client.ts
|
|
5678
|
-
var
|
|
5664
|
+
var ii = 1024 * 1024, ai = class {
|
|
5679
5665
|
active = /* @__PURE__ */ new Set();
|
|
5680
5666
|
nextSessionId = 1;
|
|
5681
5667
|
constructor(e) {
|
|
@@ -5688,15 +5674,15 @@ var oi = 1024 * 1024, si = class {
|
|
|
5688
5674
|
sessionId: r,
|
|
5689
5675
|
operationId: r,
|
|
5690
5676
|
generation: this.options.generation ?? 1
|
|
5691
|
-
}, a = new
|
|
5677
|
+
}, a = new _(this.options.transport, {
|
|
5692
5678
|
...i,
|
|
5693
|
-
maxByteCredit:
|
|
5679
|
+
maxByteCredit: f,
|
|
5694
5680
|
timeoutMs: n
|
|
5695
5681
|
});
|
|
5696
5682
|
this.active.add(a);
|
|
5697
5683
|
try {
|
|
5698
5684
|
await this.options.open(e, i, n);
|
|
5699
|
-
let r = await
|
|
5685
|
+
let r = await si(a);
|
|
5700
5686
|
try {
|
|
5701
5687
|
let e = r.usage ?? a.usageCheckpoint;
|
|
5702
5688
|
e && this.options.onUsage?.(e);
|
|
@@ -5719,20 +5705,20 @@ var oi = 1024 * 1024, si = class {
|
|
|
5719
5705
|
if (!Number.isSafeInteger(e) || e < 0 || e >= this.options.slideCount) throw RangeError(`Slide index ${e} out of range (count: ${this.options.slideCount})`);
|
|
5720
5706
|
}
|
|
5721
5707
|
};
|
|
5722
|
-
function
|
|
5708
|
+
function oi(e) {
|
|
5723
5709
|
return !!e && typeof e == "object" && e.protocol === "ooxml-pull-v1";
|
|
5724
5710
|
}
|
|
5725
|
-
async function
|
|
5711
|
+
async function si(e) {
|
|
5726
5712
|
try {
|
|
5727
|
-
return await e.pull(
|
|
5713
|
+
return await e.pull(ii);
|
|
5728
5714
|
} catch (t) {
|
|
5729
|
-
let n =
|
|
5715
|
+
let n = ci(t);
|
|
5730
5716
|
if (n === void 0) throw t;
|
|
5731
5717
|
return e.pull(n);
|
|
5732
5718
|
}
|
|
5733
5719
|
}
|
|
5734
|
-
function
|
|
5735
|
-
return
|
|
5720
|
+
function ci(e) {
|
|
5721
|
+
return M(e, ii, f);
|
|
5736
5722
|
}
|
|
5737
5723
|
//#endregion
|
|
5738
|
-
export {
|
|
5724
|
+
export { ni as a, Yr as c, $r as i, rn as l, oi as n, Zr as o, ri as r, qr as s, ai as t };
|