@silurus/ooxml 0.85.3 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -7
- package/dist/assets/render-worker-BCGnuBLj.js +10 -0
- package/dist/assets/render-worker-CB4DxjXg.js +31 -0
- package/dist/assets/render-worker-CHW0F0n6.js +11 -0
- package/dist/{bounded-raw-part-cache-C6ro6Ezf.js → bounded-raw-part-cache-DVx3Camo.js} +12 -10
- package/dist/{canvas-viewer-mechanics-CDNMJ-Yz.js → canvas-viewer-mechanics-B3A7KLLi.js} +1 -1
- package/dist/{comment-ui-runtime-DAKBCpsM.js → comment-ui-runtime-DEtgcmj7.js} +5 -5
- package/dist/comment-ui-runtime-TLHustXJ.js +2 -0
- package/dist/{comment-ui-runtime-CAbpuWi_.js → comment-ui-runtime-ssI6IE39.js} +4 -4
- package/dist/{comments-Brfxa3hQ.js → comments-CAn2A_Xh.js} +1 -1
- package/dist/delimited-text-worker-host-DcHj_JZt.js +27 -0
- package/dist/{document-pull-client-F3ox_VXK.js → document-pull-client-xZrA2IjM.js} +577 -576
- package/dist/{docx-BYvm3TWw.js → docx-DzDiGvqe.js} +63 -63
- package/dist/docx.mjs +5 -5
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-CDGegIB5.js → dom-interaction-boundary-DK1JLkrz.js} +2 -2
- package/dist/{line-metrics-BGtFM-ec.js → hyperlink-enyPbflR.js} +847 -877
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-BFB575d6.js +1023 -0
- package/dist/line-metrics-CBbw80Ko.js +60 -0
- package/dist/node.mjs +91 -91
- package/dist/{pptx-BqpVTP8p.js → pptx-D_U62nl-.js} +71 -71
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-DeZpRCfx.js → render-DSn0d35X.js} +1 -1
- package/dist/{render-worker-host-CBcQXsR5.js → render-worker-host-BHz9vjxB.js} +1 -1
- package/dist/{render-worker-host-BKtXmlEF.js → render-worker-host-CO0UYoQh.js} +1 -1
- package/dist/{render-worker-host-CNKQ76tu.js → render-worker-host-CbYDBg7U.js} +1 -1
- package/dist/{resource-measurement-D41R-0Bl.js → resource-measurement-Do07ZRcR.js} +7 -7
- package/dist/{session-n2p5_jxV.js → session-C1GYhr6n.js} +77 -77
- package/dist/{slide-pull-client-Dwek7xW8.js → slide-pull-client-DuEaUxPw.js} +732 -732
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +10 -10
- package/dist/types/index.d.ts +38 -18
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +6 -5
- package/dist/types/pptx.d.ts +10 -10
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +34 -14
- package/dist/{worksheet-pull-client-C9sC36Vu.js → worksheet-pull-client-eDiHHEG2.js} +99 -96
- package/dist/{xlsx-DSU6pV1O.js → xlsx-CMHmYTHP.js} +1629 -1469
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-D1O73gYW.js +0 -10
- package/dist/assets/render-worker-DHP0rgcW.js +0 -24
- package/dist/assets/render-worker-V2wWYA4O.js +0 -11
- package/dist/comment-ui-runtime-DTaaZdXC.js +0 -2
- package/dist/line-distribute-BsV4MVZ2.js +0 -1023
- /package/dist/{comment-occurrence-tj54AXXB.js → comment-occurrence-Dhdplprg.js} +0 -0
- /package/dist/{highlight-rect-DBcYVJDv.js → highlight-rect-FuUSmL3a.js} +0 -0
- /package/dist/{read-only-comment-decoration-Mv_SAiHy.js → read-only-comment-decoration-BTnWEeo5.js} +0 -0
- /package/dist/{read-only-comment-margin-Cqu-Ir0C.js → read-only-comment-margin-plStyGfE.js} +0 -0
- /package/dist/{source-key-BkBB3X82.js → source-key-Ktb1GRE5.js} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { $ as e, A as t, At as n, Bt as r,
|
|
2
|
-
import { c as
|
|
3
|
-
import { c as
|
|
4
|
-
import { A as
|
|
5
|
-
import { i as
|
|
1
|
+
import { $ as e, A as t, At as n, Bt as r, Ct as i, D as a, E as o, Et as s, Ft as c, Gt as l, Ht as u, It as d, K as f, O as p, Ot as m, Pt as h, Q as g, Rt as _, S as v, St as y, T as b, Ut as x, Wt as S, Z as C, _ as w, _t as T, a as E, at as D, b as O, bt as k, c as A, et as j, f as M, ft as N, g as ee, h as te, i as P, j as ne, jt as F, k as re, l as ie, lt as I, m as ae, mt as oe, nt as se, o as ce, p as le, pt as ue, rt as de, s as fe, u as pe, ut as me, vt as he, w as ge, wt as _e, x as ve, xt as ye, yt as be, zt as L } from "./hyperlink-enyPbflR.js";
|
|
2
|
+
import { c as xe, o as Se, r as Ce, s as we } from "./bounded-raw-part-cache-DVx3Camo.js";
|
|
3
|
+
import { c as Te, f as Ee, i as De, l as Oe, m as ke, n as Ae, o as je, p as Me, s as R, t as Ne, u as Pe } from "./line-distribute-BFB575d6.js";
|
|
4
|
+
import { A as Fe, D as Ie, g as Le, h as Re, in as ze, j as Be, on as Ve, sn as z, v as He, w as Ue, y as We } from "./plot-area-frame-D5hEOgkJ.js";
|
|
5
|
+
import { i as Ge, l as Ke } from "./pixel-budget-Dgjw269h.js";
|
|
6
6
|
import "./units-EJdC96r6.js";
|
|
7
|
-
import { L as
|
|
8
|
-
import { k as
|
|
9
|
-
import { r as
|
|
10
|
-
import {
|
|
7
|
+
import { L as qe } from "./three-d-YYghQndN.js";
|
|
8
|
+
import { k as Je } from "./renderer-XFSCOT6m.js";
|
|
9
|
+
import { r as Ye, s as Xe } from "./raster-target-ojDdQizC.js";
|
|
10
|
+
import { n as Ze, t as Qe } from "./line-metrics-CBbw80Ko.js";
|
|
11
|
+
import { a as $e, i as et, n as tt, o as B, r as nt, s as rt, t as it } from "./source-key-Ktb1GRE5.js";
|
|
11
12
|
//#region packages/core/src/fonts/canvas-route.ts
|
|
12
13
|
function at(e, t) {
|
|
13
14
|
let n = e.trim();
|
|
@@ -39,8 +40,8 @@ function ct(e, t) {
|
|
|
39
40
|
let { x: n, y: r, w: i, h: a } = t.rect;
|
|
40
41
|
if (e.beginPath(), t.geometry.kind === "preset") {
|
|
41
42
|
let o = [...t.geometry.adjustments];
|
|
42
|
-
|
|
43
|
-
} else
|
|
43
|
+
s(e, t.geometry.name, n, r, i, a, o) || Te(e, t.geometry.name, n, r, i, a, o[0], o[1], o[2], o[3]);
|
|
44
|
+
} else Pe(e, t.geometry.subpaths, n, r, i, a);
|
|
44
45
|
e.clip();
|
|
45
46
|
}
|
|
46
47
|
var lt = new Set([
|
|
@@ -72,45 +73,45 @@ function dt(e) {
|
|
|
72
73
|
return ut.has(e) || e === "line" || e === "straightconnector1" || e.startsWith("bentconnector");
|
|
73
74
|
}
|
|
74
75
|
function ft(e, t, n, r, i) {
|
|
75
|
-
if (
|
|
76
|
-
let n =
|
|
76
|
+
if (Re(e, t, n), t.fill) {
|
|
77
|
+
let n = He(t.fill, e, r.x, r.y, r.w, r.h, i);
|
|
77
78
|
n && (e.strokeStyle = n);
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
function pt(e, t,
|
|
81
|
-
let
|
|
82
|
-
if (!
|
|
83
|
-
let { x:
|
|
84
|
-
if (
|
|
85
|
-
if (dt(
|
|
86
|
-
let n =
|
|
81
|
+
function pt(e, t, n, r) {
|
|
82
|
+
let i = t.stroke;
|
|
83
|
+
if (!i || !lt.has(n) && !ut.has(n)) return;
|
|
84
|
+
let { x: a, y: o, w: s, h: c } = t.rect, l = i.fill ? He(i.fill, e, a, o, s, c, t.transform.rotationDeg) ?? void 0 : void 0, u = m(n, a, o, s, c, [...t.geometry.kind === "preset" ? t.geometry.adjustments : []]);
|
|
85
|
+
if (u) {
|
|
86
|
+
if (dt(n) && u.vertices.length >= 2 && (i.headEnd || i.tailEnd)) {
|
|
87
|
+
let n = u.vertices.map((e) => ({
|
|
87
88
|
x: e.x,
|
|
88
89
|
y: e.y
|
|
89
90
|
}));
|
|
90
|
-
|
|
91
|
+
i.tailEnd && (n[n.length - 1] = R(n[n.length - 1], n[n.length - 2], je(i.tailEnd, i, r))), i.headEnd && (n[0] = R(n[0], n[1], je(i.headEnd, i, r))), ft(e, i, r, t.rect, t.transform.rotationDeg), e.beginPath(), e.moveTo(n[0].x, n[0].y);
|
|
91
92
|
for (let t = 1; t < n.length; t++) e.lineTo(n[t].x, n[t].y);
|
|
92
93
|
e.stroke();
|
|
93
94
|
}
|
|
94
|
-
|
|
95
|
+
i.tailEnd && De(e, u.end.x, u.end.y, u.end.angle, i.tailEnd, i, r, l), i.headEnd && De(e, u.start.x, u.start.y, u.start.angle, i.headEnd, i, r, l);
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
function mt(e, t, n) {
|
|
98
99
|
if (t.geometry.kind !== "custom") return;
|
|
99
100
|
let r = t.stroke;
|
|
100
101
|
if (!r || !r.headEnd && !r.tailEnd) return;
|
|
101
|
-
let i =
|
|
102
|
-
i.start && r.headEnd &&
|
|
102
|
+
let i = Oe(t.geometry.subpaths), { x: a, y: o, w: s, h: c } = t.rect, l = r.fill ? He(r.fill, e, a, o, s, c, t.transform.rotationDeg) ?? void 0 : void 0;
|
|
103
|
+
i.start && r.headEnd && De(e, a + i.start.x * s, o + i.start.y * c, Math.atan2(i.start.dy * c, i.start.dx * s), r.headEnd, r, n, l), i.end && r.tailEnd && De(e, a + i.end.x * s, o + i.end.y * c, Math.atan2(i.end.dy * c, i.end.dx * s), r.tailEnd, r, n, l);
|
|
103
104
|
}
|
|
104
|
-
function ht(e, t,
|
|
105
|
-
let { x:
|
|
105
|
+
function ht(e, t, r) {
|
|
106
|
+
let { x: i, y: a, w: o, h: s } = t.rect;
|
|
106
107
|
st(e, t, () => {
|
|
107
|
-
let
|
|
108
|
-
ft(e,
|
|
108
|
+
let c = He(t.fill, e, i, a, o, s, t.transform.rotationDeg), l = t.stroke, u = l ? () => {
|
|
109
|
+
ft(e, l, r, t.rect, t.transform.rotationDeg), e.stroke();
|
|
109
110
|
} : null;
|
|
110
111
|
if (t.geometry.kind === "preset") {
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
} else e.beginPath(),
|
|
112
|
+
let d = t.geometry.name.toLowerCase(), f = [...t.geometry.adjustments], p = dt(d) && !!(l?.headEnd || l?.tailEnd);
|
|
113
|
+
n(d) && F(e, d, i, a, o, s, f, c, u, () => {}, p ? { skipTrailingStroke: !0 } : void 0) || (e.beginPath(), Te(e, d, i, a, o, s, f[0], f[1], f[2], f[3]), c && d !== "arc" && (e.fillStyle = c, d === "donut" || d === "smileyface" || d === "frame" ? e.fill("evenodd") : e.fill()), u && u()), pt(e, t, d, r);
|
|
114
|
+
} else e.beginPath(), Pe(e, t.geometry.subpaths, i, a, o, s), c && (e.fillStyle = c, e.fill()), u && u(), mt(e, t, r);
|
|
114
115
|
});
|
|
115
116
|
}
|
|
116
117
|
//#endregion
|
|
@@ -673,7 +674,7 @@ function bn() {
|
|
|
673
674
|
return typeof OffscreenCanvas < "u" ? new OffscreenCanvas(1, 1).getContext("2d") : typeof document < "u" && document?.createElement ? document.createElement("canvas").getContext("2d") : null;
|
|
674
675
|
}
|
|
675
676
|
async function xn(e) {
|
|
676
|
-
let t =
|
|
677
|
+
let t = Ce();
|
|
677
678
|
if (!t || typeof FontFace > "u") return {
|
|
678
679
|
faces: [],
|
|
679
680
|
metrics: {}
|
|
@@ -698,7 +699,7 @@ async function xn(e) {
|
|
|
698
699
|
}), i.set(c, l);
|
|
699
700
|
}
|
|
700
701
|
for (let [e, a] of i) {
|
|
701
|
-
let i = yn(e), { face: o } =
|
|
702
|
+
let i = yn(e), { face: o } = xe(e, t, () => {
|
|
702
703
|
let e = a.requests[0], n = new FontFace(i, a.source, {
|
|
703
704
|
weight: String(e.weight),
|
|
704
705
|
style: e.style
|
|
@@ -706,7 +707,7 @@ async function xn(e) {
|
|
|
706
707
|
return t.add(n), n;
|
|
707
708
|
});
|
|
708
709
|
try {
|
|
709
|
-
if (!await
|
|
710
|
+
if (!await Se(o.load()) || o.status !== "loaded") throw Error("local font load timed out");
|
|
710
711
|
let e = !1;
|
|
711
712
|
for (let t of a.requests) {
|
|
712
713
|
let n;
|
|
@@ -732,7 +733,7 @@ async function xn(e) {
|
|
|
732
733
|
if (!e) throw Error("exact local font route unavailable");
|
|
733
734
|
n.push(o);
|
|
734
735
|
} catch {
|
|
735
|
-
|
|
736
|
+
we([o]);
|
|
736
737
|
}
|
|
737
738
|
}
|
|
738
739
|
return {
|
|
@@ -741,7 +742,7 @@ async function xn(e) {
|
|
|
741
742
|
};
|
|
742
743
|
}
|
|
743
744
|
function Sn(e) {
|
|
744
|
-
|
|
745
|
+
we(e);
|
|
745
746
|
}
|
|
746
747
|
//#endregion
|
|
747
748
|
//#region packages/core/src/text/font-advance-metrics.ts
|
|
@@ -1589,7 +1590,7 @@ function ni(e, t, n, r, i) {
|
|
|
1589
1590
|
}).advancePt, l = (e) => {
|
|
1590
1591
|
let n = [
|
|
1591
1592
|
0,
|
|
1592
|
-
...
|
|
1593
|
+
...te(e),
|
|
1593
1594
|
e.length
|
|
1594
1595
|
].filter((e, t, n) => t === 0 || e !== n[t - 1]), r = n.length - 1;
|
|
1595
1596
|
for (; r > 0 && c(`${e.slice(0, n[r])}…`) > t;) --r;
|
|
@@ -1599,7 +1600,7 @@ function ni(e, t, n, r, i) {
|
|
|
1599
1600
|
}, d = (e) => {
|
|
1600
1601
|
let n = [
|
|
1601
1602
|
0,
|
|
1602
|
-
...
|
|
1603
|
+
...te(e),
|
|
1603
1604
|
e.length
|
|
1604
1605
|
].filter((e, t, n) => t === 0 || e !== n[t - 1]), r = 0;
|
|
1605
1606
|
for (; r < n.length - 1;) {
|
|
@@ -2146,7 +2147,7 @@ function Di(e) {
|
|
|
2146
2147
|
//#endregion
|
|
2147
2148
|
//#region packages/docx/src/layout/border-treatment.ts
|
|
2148
2149
|
function Oi(e, t) {
|
|
2149
|
-
let n =
|
|
2150
|
+
let n = We(e, t), r = e === "triple" || /^(?:thinThick|thickThin|thinThickThin)(?:Small|Medium|Large)Gap$/.test(e);
|
|
2150
2151
|
return Object.freeze({
|
|
2151
2152
|
authoredStyle: e,
|
|
2152
2153
|
style: e === "double" ? "double" : r ? "compound" : n.length > 0 ? "dashed" : e.includes("wave") ? "wavy" : "solid",
|
|
@@ -2200,12 +2201,12 @@ function Ni(e, t) {
|
|
|
2200
2201
|
}
|
|
2201
2202
|
function Pi(e, t = {}, n = {}) {
|
|
2202
2203
|
if (!e) return "sans-serif";
|
|
2203
|
-
let
|
|
2204
|
-
if (
|
|
2205
|
-
if (
|
|
2206
|
-
if (
|
|
2207
|
-
let
|
|
2208
|
-
return
|
|
2204
|
+
let i = t[e];
|
|
2205
|
+
if (i === "roman") return "serif";
|
|
2206
|
+
if (i === "swiss") return "sans-serif";
|
|
2207
|
+
if (i === "modern" && n[e] === "fixed") return "monospace";
|
|
2208
|
+
let a = r(e);
|
|
2209
|
+
return a === "mono" ? "monospace" : a === "serif" ? "serif" : "sans-serif";
|
|
2209
2210
|
}
|
|
2210
2211
|
function Fi(e) {
|
|
2211
2212
|
return e === "eastAsia" ? "sans-serif" : "serif";
|
|
@@ -2351,7 +2352,7 @@ function Hi(e) {
|
|
|
2351
2352
|
if (n) return n;
|
|
2352
2353
|
let i = [], o = Object.freeze([...new Set([
|
|
2353
2354
|
0,
|
|
2354
|
-
...
|
|
2355
|
+
...te(e.text),
|
|
2355
2356
|
e.text.length
|
|
2356
2357
|
])].sort((e, t) => e - t)), u = new Set(o), d = 0;
|
|
2357
2358
|
for (let t of e.text) {
|
|
@@ -4421,14 +4422,14 @@ function ks(e) {
|
|
|
4421
4422
|
}
|
|
4422
4423
|
var As = ["Noto Naskh Arabic", "Noto Sans Arabic"];
|
|
4423
4424
|
function js(e) {
|
|
4424
|
-
let t = e && e !== "jp" ?
|
|
4425
|
+
let t = e && e !== "jp" ? _(e, "sans") : [
|
|
4425
4426
|
"Noto Sans JP",
|
|
4426
4427
|
"Hiragino Sans",
|
|
4427
4428
|
"Meiryo",
|
|
4428
|
-
...
|
|
4429
|
+
..._("jp", "sans").slice(1)
|
|
4429
4430
|
];
|
|
4430
4431
|
return e == null ? `${ks([
|
|
4431
|
-
...
|
|
4432
|
+
...h,
|
|
4432
4433
|
"Arial",
|
|
4433
4434
|
"Helvetica",
|
|
4434
4435
|
"Liberation Sans",
|
|
@@ -4437,20 +4438,20 @@ function js(e) {
|
|
|
4437
4438
|
])}, sans-serif` : `${ks([
|
|
4438
4439
|
...t,
|
|
4439
4440
|
...As,
|
|
4440
|
-
...
|
|
4441
|
+
...h
|
|
4441
4442
|
])}, sans-serif`;
|
|
4442
4443
|
}
|
|
4443
4444
|
function Ms(e) {
|
|
4444
|
-
let t = e && e !== "jp" ?
|
|
4445
|
+
let t = e && e !== "jp" ? _(e, "serif") : [
|
|
4445
4446
|
"Yu Mincho",
|
|
4446
4447
|
"YuMincho",
|
|
4447
4448
|
"Hiragino Mincho ProN",
|
|
4448
4449
|
"MS Mincho",
|
|
4449
4450
|
"Noto Serif JP",
|
|
4450
|
-
...
|
|
4451
|
+
..._("jp", "serif").slice(1)
|
|
4451
4452
|
];
|
|
4452
4453
|
return e == null ? `${ks([
|
|
4453
|
-
...
|
|
4454
|
+
...c,
|
|
4454
4455
|
"Times New Roman",
|
|
4455
4456
|
"Cambria",
|
|
4456
4457
|
"Liberation Serif",
|
|
@@ -4459,7 +4460,7 @@ function Ms(e) {
|
|
|
4459
4460
|
])}, serif` : `${ks([
|
|
4460
4461
|
...t,
|
|
4461
4462
|
...As,
|
|
4462
|
-
...
|
|
4463
|
+
...c
|
|
4463
4464
|
])}, serif`;
|
|
4464
4465
|
}
|
|
4465
4466
|
var Ns = /* @__PURE__ */ new WeakMap(), Ps = /* @__PURE__ */ new WeakMap();
|
|
@@ -4478,7 +4479,7 @@ function Is(e, t = {}) {
|
|
|
4478
4479
|
}
|
|
4479
4480
|
function Ls(e, t, n = {}) {
|
|
4480
4481
|
if (!e) return js(null);
|
|
4481
|
-
let i = `"${((e) => e.replace(/"/g, "\\\""))(e)}"`, a = e.toLowerCase(), o =
|
|
4482
|
+
let i = `"${((e) => e.replace(/"/g, "\\\""))(e)}"`, a = e.toLowerCase(), o = L(e);
|
|
4482
4483
|
if (Os(e)) return Ds.has(a) ? `${i}, "Noto Naskh Arabic", "Noto Sans Arabic", "Noto Serif", "Noto Sans JP", "Hiragino Sans", serif` : `${i}, "Noto Sans Arabic", "Noto Naskh Arabic", "Noto Sans JP", "Hiragino Sans", sans-serif`;
|
|
4483
4484
|
let s = t[e];
|
|
4484
4485
|
if (s && s !== "auto") switch (s) {
|
|
@@ -4491,18 +4492,18 @@ function Ls(e, t, n = {}) {
|
|
|
4491
4492
|
"Hiragino Sans",
|
|
4492
4493
|
"Meiryo",
|
|
4493
4494
|
"Noto Sans JP"
|
|
4494
|
-
] :
|
|
4495
|
+
] : _(o, "sans"), "Courier New"])}, monospace`;
|
|
4495
4496
|
break;
|
|
4496
4497
|
default: break;
|
|
4497
4498
|
}
|
|
4498
|
-
let c =
|
|
4499
|
+
let c = r(e);
|
|
4499
4500
|
if (c === "serif") return `${i}, ${Ms(o)}`;
|
|
4500
4501
|
if (c === "mono") return `${i}, "Courier New", monospace`;
|
|
4501
4502
|
if (o == null || o === "jp") {
|
|
4502
4503
|
if (a.includes("meiryo") || e.includes("メイリオ")) return `${i}, "Meiryo UI", "Meiryo", ${js(o)}`;
|
|
4503
4504
|
if (e.includes("游ゴシック") || /\byu\s*gothic\b/i.test(e) || a.includes("yugothic")) return `${i}, "Yu Gothic", "YuGothic", ${js(o)}`;
|
|
4504
4505
|
if (a.includes("ipa")) return `${i}, "IPAexGothic", ${js(o)}`;
|
|
4505
|
-
if (a.includes("segoe")) return `${i}, "Segoe UI", ${ks([...As, ...
|
|
4506
|
+
if (a.includes("segoe")) return `${i}, "Segoe UI", ${ks([...As, ...h])}, sans-serif`;
|
|
4506
4507
|
}
|
|
4507
4508
|
return `${i}, ${js(o)}`;
|
|
4508
4509
|
}
|
|
@@ -4510,10 +4511,10 @@ function Rs(e, t, n, r, i = {}, a) {
|
|
|
4510
4511
|
return a ? ot(a, n, e ? 700 : 400, t ? "italic" : "normal") : `${t ? "italic" : "normal"} ${e ? "bold" : "normal"} ${n}px ${Is(r, i)}`;
|
|
4511
4512
|
}
|
|
4512
4513
|
function zs(e, t, n = !1) {
|
|
4513
|
-
return Math.max(
|
|
4514
|
+
return Math.max(Ze(e.fontFamily, t, n), (e.resolvedLineHeightRatio ?? 0) * t);
|
|
4514
4515
|
}
|
|
4515
4516
|
function Bs(e, t, n = !1) {
|
|
4516
|
-
return Math.max(
|
|
4517
|
+
return Math.max(Ze(e.eaFloorFamily, t, n), (e.resolvedEaFloorLineHeightRatio ?? 0) * t);
|
|
4517
4518
|
}
|
|
4518
4519
|
function Vs(e) {
|
|
4519
4520
|
for (let t of e.runs) if (t.type === "text" || t.type === "field") return t.fontSize;
|
|
@@ -4524,7 +4525,7 @@ function Hs(e, t = !1) {
|
|
|
4524
4525
|
return t && e.defaultFontFamilyEastAsia ? e.defaultFontFamilyEastAsia : e.defaultFontFamily ?? null;
|
|
4525
4526
|
}
|
|
4526
4527
|
function Us(e, t, n) {
|
|
4527
|
-
return
|
|
4528
|
+
return Ze(Hs(e, n), Vs(e) * t, n);
|
|
4528
4529
|
}
|
|
4529
4530
|
function Ws(e, t) {
|
|
4530
4531
|
return !e || e.charSpacePt == null || e.type !== "linesAndChars" && e.type !== "snapToChars" ? 0 : e.charSpacePt * t;
|
|
@@ -4582,14 +4583,14 @@ function nc(e, t, n = 0) {
|
|
|
4582
4583
|
let r = tc(e);
|
|
4583
4584
|
return [
|
|
4584
4585
|
0,
|
|
4585
|
-
...
|
|
4586
|
+
...te(e.text),
|
|
4586
4587
|
e.text.length
|
|
4587
4588
|
].filter((e, t, n) => n.indexOf(e) === t).filter((e) => e >= n && e <= t && !r.has(e)).at(-1) ?? 0;
|
|
4588
4589
|
}
|
|
4589
4590
|
function rc(e) {
|
|
4590
4591
|
if (e.hardJoinPrev !== !0 || e.text.length === 0) return;
|
|
4591
4592
|
let t = tc(e);
|
|
4592
|
-
return [...
|
|
4593
|
+
return [...te(e.text), e.text.length].find((e) => e > 0 && !t.has(e)) ?? e.text.length;
|
|
4593
4594
|
}
|
|
4594
4595
|
function q(e, t, n) {
|
|
4595
4596
|
return {
|
|
@@ -4643,7 +4644,7 @@ function sc(e) {
|
|
|
4643
4644
|
}
|
|
4644
4645
|
let e = r, i = e.punctuationCompressions ?? [], a = new Map(i.map((e, t) => [e.end, t])), o = i.length > 0 ? oc(e) : void 0, s = [
|
|
4645
4646
|
0,
|
|
4646
|
-
...
|
|
4647
|
+
...te(e.text),
|
|
4647
4648
|
e.text.length
|
|
4648
4649
|
];
|
|
4649
4650
|
for (let r = 0; r < s.length - 1; r += 1) {
|
|
@@ -4727,7 +4728,7 @@ function vc(e, t) {
|
|
|
4727
4728
|
};
|
|
4728
4729
|
}
|
|
4729
4730
|
function yc(e, t, n, r, i = !1) {
|
|
4730
|
-
return
|
|
4731
|
+
return Qe(t, r, e.fontBoundingBoxAscent ?? e.actualBoundingBoxAscent ?? n * .8, e.fontBoundingBoxDescent ?? e.actualBoundingBoxDescent ?? n * .2, i);
|
|
4731
4732
|
}
|
|
4732
4733
|
function bc(e, t, n, r, i = !1, a, o = {}, s = e.lineSpacing, c = {}, l, u, d = !1) {
|
|
4733
4734
|
let f = u, p = i || f?.fontHint === "eastAsia", m = f?.complexScript === !0, h = f?.fontSizePt ?? Vs(e), g = Hs(e, p), _ = g ? c[_n(g)] : void 0, v = _?.family ?? g, y, b;
|
|
@@ -4836,7 +4837,7 @@ function Ec(e, t) {
|
|
|
4836
4837
|
function Dc(e) {
|
|
4837
4838
|
for (let t = 0; t < e.length;) {
|
|
4838
4839
|
let n = e.codePointAt(t);
|
|
4839
|
-
if (
|
|
4840
|
+
if (v(n)) return !0;
|
|
4840
4841
|
t += n > 65535 ? 2 : 1;
|
|
4841
4842
|
}
|
|
4842
4843
|
return !1;
|
|
@@ -4929,7 +4930,7 @@ function Ic(e, t) {
|
|
|
4929
4930
|
function Lc(e) {
|
|
4930
4931
|
let t = [], n = null, r = "";
|
|
4931
4932
|
for (let i of e) {
|
|
4932
|
-
let e =
|
|
4933
|
+
let e = v(i.codePointAt(0));
|
|
4933
4934
|
n === null || e === n ? (n = e, r += i) : (t.push({
|
|
4934
4935
|
text: r,
|
|
4935
4936
|
ea: n
|
|
@@ -5024,92 +5025,92 @@ function Gc(e, t) {
|
|
|
5024
5025
|
if (o) return o;
|
|
5025
5026
|
let s = a[i];
|
|
5026
5027
|
return n === 400 && r === "normal" && s ? s : Object.values(a).find((e) => _n(e.requestedFamily ?? "") === i && (e.weight ?? 400) === n && (e.style ?? "normal") === r);
|
|
5027
|
-
},
|
|
5028
|
+
}, i = /* @__PURE__ */ new Map(), a = [];
|
|
5028
5029
|
for (let [t, n] of e.entries()) {
|
|
5029
5030
|
if (n.type !== "text") {
|
|
5030
|
-
|
|
5031
|
+
a.push({
|
|
5031
5032
|
charCount: 0,
|
|
5032
5033
|
naturalWidthPx: 0
|
|
5033
5034
|
});
|
|
5034
5035
|
continue;
|
|
5035
5036
|
}
|
|
5036
5037
|
let e = n.text.split(" ");
|
|
5037
|
-
for (let r = 0; r < e.length; r += 1)
|
|
5038
|
+
for (let r = 0; r < e.length; r += 1) i.set(`${t}:${r}`, a.length), a.push({
|
|
5038
5039
|
fitTextValTwips: n.fitTextVal,
|
|
5039
5040
|
fitTextId: n.fitTextId,
|
|
5040
5041
|
charCount: [...e[r]].length,
|
|
5041
5042
|
naturalWidthPx: 0,
|
|
5042
5043
|
charScale: n.charScale
|
|
5043
|
-
}), r < e.length - 1 &&
|
|
5044
|
+
}), r < e.length - 1 && a.push({
|
|
5044
5045
|
charCount: 0,
|
|
5045
5046
|
naturalWidthPx: 0
|
|
5046
5047
|
});
|
|
5047
5048
|
}
|
|
5048
5049
|
let s = /* @__PURE__ */ new Map();
|
|
5049
|
-
Ui(
|
|
5050
|
+
Ui(a, 1).forEach((e, t) => {
|
|
5050
5051
|
for (let n = e.start; n < e.end; n += 1) s.set(n, t);
|
|
5051
5052
|
});
|
|
5052
|
-
let c = (e,
|
|
5053
|
-
let d =
|
|
5053
|
+
let c = (e, a, o, c, l, u = !1) => {
|
|
5054
|
+
let d = a, f = d.typographyInput, p = (e, t) => e?.status === "valid" && e.value !== null ? e.value : t, m = p(f?.verticalAlign, o ?? void 0) ?? null, h = p(f?.positionPt, d.position), g = f?.characterSpacingPt ?? d.charSpacing, _ = ns(g), v = f?.characterScale ?? d.charScale, y = f?.kerningThresholdPt ?? d.kerning, b = f?.snapToGrid ?? d.snapToGrid, x = !1, S = d.ruby, C = S ? {
|
|
5054
5055
|
text: S.text,
|
|
5055
5056
|
fontSizePt: S.fontSizePt,
|
|
5056
5057
|
...S.hpsRaisePt == null ? {} : { hpsRaisePt: S.hpsRaisePt }
|
|
5057
|
-
} : void 0, w = d.revision, T = d.rtl === !0 ? !0 : void 0, E = l === void 0 ? void 0 :
|
|
5058
|
+
} : void 0, w = d.revision, T = d.rtl === !0 ? !0 : void 0, E = l === void 0 ? void 0 : i.get(`${c}:${l}`), D = E === void 0 ? void 0 : s.get(E), O = d.hyperlink ? {
|
|
5058
5059
|
kind: "external",
|
|
5059
5060
|
url: d.hyperlink
|
|
5060
5061
|
} : d.hyperlinkAnchor ? {
|
|
5061
5062
|
kind: "internal",
|
|
5062
5063
|
ref: d.hyperlinkAnchor
|
|
5063
|
-
} : void 0,
|
|
5064
|
-
if (t.balanceSingleByteDoubleByteWidth && !
|
|
5065
|
-
for (let t of e.split(/(\u3000+)/u).filter(Boolean))
|
|
5064
|
+
} : void 0, k = d.rtl === !0 || d.cs === !0, A = d.fontSizeCs ?? a.fontSize, j = d.fontFamilyCs ?? a.fontFamily, M = d.fontFamilyHighAnsi ?? a.fontFamily, N = d.boldCs ?? !1, ee = d.italicCs ?? !1, P = d.fontFamilyEastAsia ?? a.fontFamily, ne = (k || !!d.rtl) && Ic(d.langBidi, !!d.rtl), F = !0, re = !1, ie = (e, i, o, s, c = !1, l = !1) => {
|
|
5065
|
+
if (t.balanceSingleByteDoubleByteWidth && !i && e.includes(" ") && [...e].some((e) => e !== " ")) {
|
|
5066
|
+
for (let t of e.split(/(\u3000+)/u).filter(Boolean)) ie(t, i, o, void 0, c, l);
|
|
5066
5067
|
return;
|
|
5067
5068
|
}
|
|
5068
5069
|
if (!c && _ && D === void 0) {
|
|
5069
5070
|
let n = [
|
|
5070
5071
|
0,
|
|
5071
|
-
...
|
|
5072
|
+
...te(e),
|
|
5072
5073
|
e.length
|
|
5073
5074
|
];
|
|
5074
5075
|
if (n.slice(0, -1).map((t, r) => e.slice(t, n[r + 1])).some((e) => Ac(e, t.characterSpacingControl))) {
|
|
5075
|
-
|
|
5076
|
+
ie(e, i, o, void 0, !0, l);
|
|
5076
5077
|
return;
|
|
5077
5078
|
}
|
|
5078
5079
|
}
|
|
5079
|
-
let f =
|
|
5080
|
+
let f = i ? N : a.bold, p = i ? ee : a.italic, S = f ? 700 : 400, k = p ? "italic" : "normal", I = Object.freeze({
|
|
5080
5081
|
text: e,
|
|
5081
|
-
fontSizePt:
|
|
5082
|
+
fontSizePt: i ? A : a.fontSize,
|
|
5082
5083
|
fonts: l ? {
|
|
5083
5084
|
ascii: null,
|
|
5084
5085
|
highAnsi: null,
|
|
5085
5086
|
eastAsia: null,
|
|
5086
5087
|
complexScript: null
|
|
5087
5088
|
} : d.fontSlots?.direct ?? {
|
|
5088
|
-
ascii:
|
|
5089
|
-
highAnsi:
|
|
5090
|
-
eastAsia:
|
|
5091
|
-
complexScript:
|
|
5089
|
+
ascii: a.fontFamily,
|
|
5090
|
+
highAnsi: M,
|
|
5091
|
+
eastAsia: P,
|
|
5092
|
+
complexScript: j
|
|
5092
5093
|
},
|
|
5093
5094
|
themeFonts: l ? void 0 : d.fontSlots?.theme,
|
|
5094
5095
|
themeFontPresence: l ? void 0 : d.fontSlots?.themePresent,
|
|
5095
5096
|
weight: S,
|
|
5096
|
-
style:
|
|
5097
|
-
complexScript:
|
|
5097
|
+
style: k,
|
|
5098
|
+
complexScript: i,
|
|
5098
5099
|
fontHint: d.fontHint,
|
|
5099
5100
|
eastAsiaLanguage: d.langEastAsia,
|
|
5100
|
-
kerning: y == null ? void 0 : (
|
|
5101
|
+
kerning: y == null ? void 0 : (i ? A : a.fontSize) >= y,
|
|
5101
5102
|
measure: !1
|
|
5102
|
-
}), ae = s ? { spans: [s] } : t.layoutServices?.text.shape(
|
|
5103
|
+
}), ae = s ? { spans: [s] } : t.layoutServices?.text.shape(I), oe = c && _ ? (() => {
|
|
5103
5104
|
let n = [
|
|
5104
5105
|
0,
|
|
5105
|
-
...
|
|
5106
|
+
...te(e),
|
|
5106
5107
|
e.length
|
|
5107
5108
|
], r = [];
|
|
5108
5109
|
for (let i = 0; i < n.length - 1; i += 1) {
|
|
5109
5110
|
let a = n[i], o = n[i + 1], s = e.slice(a, o);
|
|
5110
5111
|
if (!Ac(s, t.characterSpacingControl)) continue;
|
|
5111
5112
|
let c = t.layoutServices?.text.shape({
|
|
5112
|
-
...
|
|
5113
|
+
...I,
|
|
5113
5114
|
text: s,
|
|
5114
5115
|
measure: !0,
|
|
5115
5116
|
clusterGeometry: !1
|
|
@@ -5117,7 +5118,7 @@ function Gc(e, t) {
|
|
|
5117
5118
|
let e = Math.max(0, Math.min(c.advancePt, c.advancePt - c.inkBounds.xMaxPt));
|
|
5118
5119
|
if (!Oc.has(s)) return e;
|
|
5119
5120
|
let n = c.spans[0]?.fontRoute.fingerprint, r = t.layoutServices?.text.shape({
|
|
5120
|
-
...
|
|
5121
|
+
...I,
|
|
5121
5122
|
text: "一",
|
|
5122
5123
|
fontHint: "eastAsia",
|
|
5123
5124
|
measure: !0,
|
|
@@ -5137,26 +5138,26 @@ function Gc(e, t) {
|
|
|
5137
5138
|
});
|
|
5138
5139
|
}
|
|
5139
5140
|
return r.length === 0 ? void 0 : Object.freeze(r.map((e) => Object.freeze(e)));
|
|
5140
|
-
})() : void 0, se = ae?.spans.some((e) => e.script === "complexScript" !==
|
|
5141
|
+
})() : void 0, se = ae?.spans.some((e) => e.script === "complexScript" !== i) ?? !1;
|
|
5141
5142
|
if (ae && (ae.spans.length > 1 || se)) {
|
|
5142
5143
|
for (let e = 0; e < ae.spans.length; e += 1) {
|
|
5143
|
-
let n = ae.spans[e], r = n.script === "complexScript",
|
|
5144
|
-
|
|
5144
|
+
let n = ae.spans[e], r = n.script === "complexScript", i = r ? j : n.script === "eastAsia" ? P : n.script === "highAnsi" ? M : a.fontFamily, o = _ && c && [...n.text].some((e) => Ac(e, t.characterSpacingControl));
|
|
5145
|
+
ie(n.text, r, i, n, o);
|
|
5145
5146
|
}
|
|
5146
5147
|
return;
|
|
5147
5148
|
}
|
|
5148
5149
|
let ce = ae?.spans[0], le = (e, n) => {
|
|
5149
5150
|
if (!e) return;
|
|
5150
|
-
let r = Object.values(t.layoutServices?.text.localMetrics ?? {}).filter((t) => _n(t.family) === _n(e) && (t.weight ?? 400) === S && (t.style ?? "normal") ===
|
|
5151
|
+
let r = Object.values(t.layoutServices?.text.localMetrics ?? {}).filter((t) => _n(t.family) === _n(e) && (t.weight ?? 400) === S && (t.style ?? "normal") === k);
|
|
5151
5152
|
return r.find((e) => n && _n(e.requestedFamily ?? "") === _n(n)) ?? r[0];
|
|
5152
|
-
}, ue = ce ? le(ce.font.resolvedFamily, ce.font.requestedFamily) : r(o, S,
|
|
5153
|
-
fonts:
|
|
5154
|
-
themeFonts:
|
|
5155
|
-
themeFontPresence:
|
|
5153
|
+
}, ue = ce ? le(ce.font.resolvedFamily, ce.font.requestedFamily) : r(o, S, k), de = t.layoutServices?.text.resolve({
|
|
5154
|
+
fonts: I.fonts,
|
|
5155
|
+
themeFonts: I.themeFonts,
|
|
5156
|
+
themeFontPresence: I.themeFontPresence,
|
|
5156
5157
|
slot: "eastAsia",
|
|
5157
5158
|
weight: S,
|
|
5158
|
-
style:
|
|
5159
|
-
}), fe = de ? le(de.resolvedFamily, de.requestedFamily) : r(
|
|
5159
|
+
style: k
|
|
5160
|
+
}), fe = de ? le(de.resolvedFamily, de.requestedFamily) : r(P, S, k), pe = ue ?? (o ? t.resolvedLocalFonts?.[_n(o)] : void 0), me = fe ?? (P ? t.resolvedLocalFonts?.[_n(P)] : void 0), he = de?.resolvedFamily ?? fe?.family ?? P, ge = t.useFeLayout && (d.fontHint === "eastAsia" || !!he?.trim()), _e = ce?.script ?? s?.script ?? (i ? "complexScript" : Ai.test(e) ? "eastAsia" : "ascii"), ve = t.balanceSingleByteDoubleByteWidth ? es(e, _e) : void 0;
|
|
5160
5161
|
n.push({
|
|
5161
5162
|
text: e,
|
|
5162
5163
|
script: _e,
|
|
@@ -5164,43 +5165,43 @@ function Gc(e, t) {
|
|
|
5164
5165
|
...ge ? { metricEastAsian: !0 } : {},
|
|
5165
5166
|
bold: f,
|
|
5166
5167
|
italic: p,
|
|
5167
|
-
underline:
|
|
5168
|
+
underline: a.underline,
|
|
5168
5169
|
underlineStyle: d.underlineStyle,
|
|
5169
5170
|
underlineColor: d.underlineColor,
|
|
5170
|
-
strikethrough:
|
|
5171
|
-
fontSize:
|
|
5172
|
-
color:
|
|
5171
|
+
strikethrough: a.strikethrough,
|
|
5172
|
+
fontSize: i ? A : a.fontSize,
|
|
5173
|
+
color: a.color,
|
|
5173
5174
|
fontFamily: ce?.font.resolvedFamily ?? ue?.family ?? o,
|
|
5174
5175
|
fontRoute: ce?.fontRoute,
|
|
5175
5176
|
resolvedLineHeightRatio: pe?.lineHeightRatio,
|
|
5176
5177
|
vertAlign: m,
|
|
5177
5178
|
measuredWidth: 0,
|
|
5178
5179
|
textLayoutService: t.layoutServices?.text,
|
|
5179
|
-
textShapeRequest:
|
|
5180
|
+
textShapeRequest: I,
|
|
5180
5181
|
breakBefore: ce?.breakBefore ?? s?.breakBefore ?? !0,
|
|
5181
5182
|
smallCaps: x,
|
|
5182
|
-
joinPrev:
|
|
5183
|
-
hardJoinPrev:
|
|
5184
|
-
doubleStrikethrough:
|
|
5185
|
-
highlight:
|
|
5186
|
-
emphasisMark:
|
|
5187
|
-
background:
|
|
5183
|
+
joinPrev: F && (d.noBreakBefore === !0 || u) || re || s?.breakBefore === !1 ? !0 : void 0,
|
|
5184
|
+
hardJoinPrev: F && (d.noBreakBefore === !0 || u) ? !0 : void 0,
|
|
5185
|
+
doubleStrikethrough: a.doubleStrikethrough ?? !1,
|
|
5186
|
+
highlight: a.highlight ?? null,
|
|
5187
|
+
emphasisMark: a.emphasisMark,
|
|
5188
|
+
background: a.background ?? null,
|
|
5188
5189
|
colorAuto: d.colorAuto ?? !1,
|
|
5189
5190
|
border: d.border ?? null,
|
|
5190
|
-
ruby:
|
|
5191
|
+
ruby: F ? C : void 0,
|
|
5191
5192
|
revision: w,
|
|
5192
5193
|
...w && t.showTrackedChanges === !0 ? { trackChangesMarkup: {
|
|
5193
5194
|
kind: w.kind,
|
|
5194
5195
|
authorColor: t.revisionAuthorColor?.(w.author) ?? "#C00000"
|
|
5195
5196
|
} } : {},
|
|
5196
5197
|
rtl: T,
|
|
5197
|
-
digitsAsAN:
|
|
5198
|
+
digitsAsAN: ne ? !0 : void 0,
|
|
5198
5199
|
eaFloorFamily: he,
|
|
5199
5200
|
eaFloorRoute: de?.route,
|
|
5200
5201
|
resolvedEaFloorLineHeightRatio: me?.lineHeightRatio,
|
|
5201
5202
|
textBoxLineFloor: d.textBoxLineFloor,
|
|
5202
5203
|
textBoxVertical: d.textBoxVertical,
|
|
5203
|
-
hyperlink:
|
|
5204
|
+
hyperlink: O,
|
|
5204
5205
|
snapToCharacterGrid: b !== !1,
|
|
5205
5206
|
charSpacing: g,
|
|
5206
5207
|
punctuationCompressions: oe,
|
|
@@ -5216,33 +5217,33 @@ function Gc(e, t) {
|
|
|
5216
5217
|
tateChuYoko: t.verticalCJK && d.eastAsianVert === !0 ? !0 : void 0,
|
|
5217
5218
|
tateChuYokoCompress: t.verticalCJK && d.eastAsianVert === !0 && d.eastAsianVertCompress === !0 ? !0 : void 0,
|
|
5218
5219
|
verticalRun: t.verticalCJK && d.eastAsianVert !== !0 ? !0 : void 0
|
|
5219
|
-
}),
|
|
5220
|
-
},
|
|
5221
|
-
let n = t === "cs", r = t === "cs" ?
|
|
5222
|
-
if (
|
|
5223
|
-
for (let t of
|
|
5220
|
+
}), F = !1, re = !1;
|
|
5221
|
+
}, I = (e, t) => {
|
|
5222
|
+
let n = t === "cs", r = t === "cs" ? j : t === "ea" ? P : a.fontFamily;
|
|
5223
|
+
if (Ee(r)) {
|
|
5224
|
+
for (let t of ke(e, r)) ie(t.text, n, t.mapped ? null : r, void 0, !1, t.mapped);
|
|
5224
5225
|
return;
|
|
5225
5226
|
}
|
|
5226
|
-
|
|
5227
|
+
ie(e, n, r);
|
|
5227
5228
|
}, ae = (e) => {
|
|
5228
5229
|
if (t.layoutServices?.text) {
|
|
5229
|
-
if (
|
|
5230
|
-
|
|
5230
|
+
if (Ee(a.fontFamily)) {
|
|
5231
|
+
I(e, "latin");
|
|
5231
5232
|
return;
|
|
5232
5233
|
}
|
|
5233
|
-
|
|
5234
|
+
ie(e, !1, a.fontFamily);
|
|
5234
5235
|
return;
|
|
5235
5236
|
}
|
|
5236
|
-
for (let t of Lc(e))
|
|
5237
|
-
}, oe =
|
|
5237
|
+
for (let t of Lc(e)) I(t.text, t.ea ? "ea" : "latin");
|
|
5238
|
+
}, oe = a.smallCaps ? wc(e) : [{
|
|
5238
5239
|
text: e,
|
|
5239
5240
|
reduced: !1
|
|
5240
5241
|
}], se = "";
|
|
5241
5242
|
for (let e of oe) {
|
|
5242
|
-
x = e.reduced,
|
|
5243
|
-
let t =
|
|
5244
|
-
for (let e of zc(t)) if (
|
|
5245
|
-
else
|
|
5243
|
+
x = e.reduced, re = se.length > 0 && !/\s$/.test(se), se = e.text;
|
|
5244
|
+
let t = a.allCaps || a.smallCaps ? e.text.toUpperCase() : e.text;
|
|
5245
|
+
for (let e of zc(t)) if (k) if (ne) for (let t of Rc(e)) I(t, "cs");
|
|
5246
|
+
else I(e, "cs");
|
|
5246
5247
|
else ae(e);
|
|
5247
5248
|
}
|
|
5248
5249
|
}, l = !1;
|
|
@@ -5447,7 +5448,7 @@ function Gc(e, t) {
|
|
|
5447
5448
|
}
|
|
5448
5449
|
let l = /* @__PURE__ */ new Set();
|
|
5449
5450
|
for (let e of o.matchAll(/\S+/gu)) {
|
|
5450
|
-
let t = e[0], n = e.index, r = new Set(
|
|
5451
|
+
let t = e[0], n = e.index, r = new Set(te(t).map((e) => n + e)), i = new Set([...s].filter((e) => e > n && e <= n + t.length).map((e) => e - n)), a = new Set([...r].map((e) => e - n));
|
|
5451
5452
|
for (let e of us(t, a, i)) l.add(n + e);
|
|
5452
5453
|
}
|
|
5453
5454
|
if (l.size === 0) {
|
|
@@ -5514,7 +5515,7 @@ function Gc(e, t) {
|
|
|
5514
5515
|
let t = n[e];
|
|
5515
5516
|
if (!("text" in t) || t.joinPrev) continue;
|
|
5516
5517
|
let r = t.text.codePointAt(0);
|
|
5517
|
-
if (r === void 0 || !
|
|
5518
|
+
if (r === void 0 || !o.lineStartForbidden.has(r)) continue;
|
|
5518
5519
|
let i = n[e - 1];
|
|
5519
5520
|
!("text" in i) || /\s$/.test(i.text) || (t.joinPrev = !0);
|
|
5520
5521
|
}
|
|
@@ -5531,77 +5532,77 @@ function Gc(e, t) {
|
|
|
5531
5532
|
if (!("text" in t) || t.joinPrev || t.externalLinkBreakBefore || t.text.length === 0) continue;
|
|
5532
5533
|
let r = n[e - 1];
|
|
5533
5534
|
if (!("text" in r) || r.text.length === 0 || /\s$/u.test(r.text) || /^\s/u.test(t.text)) continue;
|
|
5534
|
-
let
|
|
5535
|
-
|
|
5535
|
+
let i = [...r.text].at(-1), a = [...t.text][0], o = i?.codePointAt(0), s = a?.codePointAt(0);
|
|
5536
|
+
o === void 0 || s === void 0 || o === 8203 || s === 8203 || le(r.text) || le(t.text) || Dc(r.text) || Dc(t.text) || ve(o, s) && (t.joinPrev = !0);
|
|
5536
5537
|
}
|
|
5537
5538
|
let u = /* @__PURE__ */ new Set();
|
|
5538
5539
|
for (let e of n) !("text" in e) || e.fitTextRegionIndex === void 0 || (u.has(e.fitTextRegionIndex) ? e.joinPrev = !0 : (e.fitTextRegionStart = !0, u.add(e.fitTextRegionIndex)));
|
|
5539
5540
|
return sc(n), n;
|
|
5540
5541
|
}
|
|
5541
|
-
function Kc(e, t, n, r, i, a = [],
|
|
5542
|
-
if (
|
|
5543
|
-
let o = (o,
|
|
5542
|
+
function Kc(e, t, n, r, i, a = [], s, c = {}, l = 0, u = o, d = void 0, f = 36, p = n, m = !1, h = !1, g = !1, _, v = "bounded", y, x = !1, S) {
|
|
5543
|
+
if (S === void 0) {
|
|
5544
|
+
let o = (o, b) => Kc(e, Ho(t), n, r, i, a, s, c, l, u, d, f, p, m, h, g, _, v, y, x, {
|
|
5544
5545
|
probeHeights: o,
|
|
5545
|
-
preparedFloatWrap:
|
|
5546
|
+
preparedFloatWrap: b
|
|
5546
5547
|
});
|
|
5547
|
-
if (!
|
|
5548
|
-
let
|
|
5549
|
-
return Go((e) => o(e,
|
|
5548
|
+
if (!s || v === "intrinsic") return o(null);
|
|
5549
|
+
let b = s.lineWindow ? void 0 : ho(s.floats);
|
|
5550
|
+
return Go((e) => o(e, b), (e) => s.lineBoxH(e.ascent, e.descent, e.hasRuby, e.intendedSingle, e.eastAsian, e.gridCountSingle));
|
|
5550
5551
|
}
|
|
5551
|
-
let { probeHeights:
|
|
5552
|
-
if (
|
|
5553
|
-
let t =
|
|
5552
|
+
let { probeHeights: C, preparedFloatWrap: T } = S, E = [], D = [], k = 0, A = d?.type === "snapToChars" && d.characterPitchPt != null && d.characterPitchPt > 0 ? d.characterPitchPt * i : null, j = null, M = 0, N = 0, P = 0, ne = 0, F = /* @__PURE__ */ new Set(), re = 0, ie = 0, I = 0, oe = 0, se = 0, ce = 0, ue = 0, de = 0, fe = !1, pe = !0, me = n, he = 0, _e = s?.startPageY ?? 0, ve = () => Ra(i), ye = t.length > 0 && t.every((e) => "text" in e && e.metricOnly === !0 || "imagePath" in e && !!e.anchor), be = (e = 0) => {
|
|
5553
|
+
if (j = null, ne = 0, F.clear(), he = 0, me = n, !s) return;
|
|
5554
|
+
let t = C?.[E.length];
|
|
5554
5555
|
if (t === void 0) return;
|
|
5555
5556
|
let r = {
|
|
5556
|
-
xLeftPt:
|
|
5557
|
-
xRightPt: (
|
|
5558
|
-
readingDirection:
|
|
5557
|
+
xLeftPt: s.referenceXPt ?? s.paraX,
|
|
5558
|
+
xRightPt: (s.referenceXPt ?? s.paraX) + (s.referenceWidthPt ?? n),
|
|
5559
|
+
readingDirection: s.readingDirection ?? (m ? "rtl" : "ltr")
|
|
5559
5560
|
};
|
|
5560
|
-
if (
|
|
5561
|
-
let r =
|
|
5562
|
-
topYPt:
|
|
5561
|
+
if (s.lineWindow) {
|
|
5562
|
+
let r = s.lineWindow({
|
|
5563
|
+
topYPt: _e,
|
|
5563
5564
|
minimumStartWidthPt: 1,
|
|
5564
5565
|
squareMinimumStartWidthPt: e,
|
|
5565
5566
|
probeHeightPt: t,
|
|
5566
|
-
paragraphXPt:
|
|
5567
|
+
paragraphXPt: s.paraX,
|
|
5567
5568
|
maximumWidthPt: n,
|
|
5568
|
-
columnXPt:
|
|
5569
|
-
columnWidthPt:
|
|
5569
|
+
columnXPt: s.columnXPt,
|
|
5570
|
+
columnWidthPt: s.columnWidthPt
|
|
5570
5571
|
});
|
|
5571
|
-
|
|
5572
|
+
_e = r.topYPt, he = r.xOffsetPt, me = r.maximumWidthPt;
|
|
5572
5573
|
} else {
|
|
5573
|
-
let i = No(
|
|
5574
|
-
|
|
5574
|
+
let i = No(_e, 1, t, s.paraX, n, T ?? ho(s.floats), s.columnXPt, s.columnXPt + s.columnWidthPt, r, e);
|
|
5575
|
+
_e = i.topY, he = i.xOffset, me = i.maxWidth;
|
|
5575
5576
|
}
|
|
5576
|
-
}, L = () =>
|
|
5577
|
+
}, L = () => v === "intrinsic" ? Infinity : me - (pe ? r : 0), xe = m ? a.map((e) => ({
|
|
5577
5578
|
pos: e.pos * i,
|
|
5578
5579
|
alignment: e.alignment,
|
|
5579
5580
|
leader: e.leader
|
|
5580
|
-
})) : [], Se =
|
|
5581
|
-
if (!
|
|
5582
|
-
let e =
|
|
5581
|
+
})) : [], Se = f * i, Ce = () => {
|
|
5582
|
+
if (!m || !D.some((e) => "isTab" in e)) return;
|
|
5583
|
+
let e = D.map((e) => ({
|
|
5583
5584
|
isTab: "isTab" in e,
|
|
5584
5585
|
width: e.measuredWidth
|
|
5585
5586
|
}));
|
|
5586
|
-
for (let t = 0; t <
|
|
5587
|
-
if (!("isTab" in
|
|
5587
|
+
for (let t = 0; t < D.length; t += 1) {
|
|
5588
|
+
if (!("isTab" in D[t])) continue;
|
|
5588
5589
|
let n = t + 1;
|
|
5589
|
-
for (; n <
|
|
5590
|
-
let r = et(
|
|
5590
|
+
for (; n < D.length && !("isTab" in D[n]);) n += 1;
|
|
5591
|
+
let r = et(D.slice(t + 1, n));
|
|
5591
5592
|
if (!r) continue;
|
|
5592
|
-
let i = t + 1 + r.segmentIndex, a =
|
|
5593
|
+
let i = t + 1 + r.segmentIndex, a = D[i];
|
|
5593
5594
|
"text" in a && (e[i].decimalOffset = Xe(a, a.text.slice(0, r.charOffset)));
|
|
5594
5595
|
}
|
|
5595
|
-
let t = Uc(e,
|
|
5596
|
-
for (let e = 0; e <
|
|
5597
|
-
let r =
|
|
5596
|
+
let t = Uc(e, xe, p - (he + me) + (pe ? r : 0), p + l, Se), n = 0;
|
|
5597
|
+
for (let e = 0; e < D.length; e++) {
|
|
5598
|
+
let r = D[e];
|
|
5598
5599
|
"isTab" in r && (n += t[e].width - r.measuredWidth, r.measuredWidth = t[e].width, r.leader = t[e].leader);
|
|
5599
5600
|
}
|
|
5600
|
-
|
|
5601
|
+
k += n;
|
|
5601
5602
|
}, we = !1, Te = !1, Ee = !1, De = (e, t = !1, n) => {
|
|
5602
5603
|
Ce();
|
|
5603
5604
|
let r, a = !1;
|
|
5604
|
-
for (let e of
|
|
5605
|
+
for (let e of D) {
|
|
5605
5606
|
if ("isTab" in e) continue;
|
|
5606
5607
|
let t = "text" in e ? e.position ?? 0 : 0;
|
|
5607
5608
|
if ("text" in e && e.positionExtendsLineBox === !1) {
|
|
@@ -5615,11 +5616,11 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5615
5616
|
}
|
|
5616
5617
|
}
|
|
5617
5618
|
let o = a ? r ?? 0 : 0;
|
|
5618
|
-
if (o !== 0) for (let e of
|
|
5619
|
-
let
|
|
5620
|
-
|
|
5621
|
-
segments:
|
|
5622
|
-
height:
|
|
5619
|
+
if (o !== 0) for (let e of D) "text" in e && (e.lineRelativePosition = ds(e.position ?? 0, o));
|
|
5620
|
+
let c = e === void 0 ? re || 10 : Math.max(re, e), l = ie > 0 || I > 0, u = l ? ie : c * i * .8, d = l ? I : c * i * .2, f = fe ? ce : u, p = fe ? ue : d, m = fe ? de : oe, h = se || (Te ? gc(oe, c * i) : u + d);
|
|
5621
|
+
E.push({
|
|
5622
|
+
segments: D,
|
|
5623
|
+
height: c,
|
|
5623
5624
|
ascent: u,
|
|
5624
5625
|
descent: d,
|
|
5625
5626
|
visibleAscent: f,
|
|
@@ -5627,43 +5628,43 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5627
5628
|
visibleIntendedSingle: m,
|
|
5628
5629
|
intendedSingle: oe,
|
|
5629
5630
|
gridCountSingle: h,
|
|
5630
|
-
xOffset:
|
|
5631
|
-
availWidth:
|
|
5632
|
-
topY:
|
|
5631
|
+
xOffset: he,
|
|
5632
|
+
availWidth: me,
|
|
5633
|
+
topY: s ? _e : void 0,
|
|
5633
5634
|
hasRuby: we,
|
|
5634
5635
|
eastAsian: Te,
|
|
5635
5636
|
endsWithBreak: t,
|
|
5636
5637
|
consumedEnd: n ?? z[0]?.src ?? Be
|
|
5637
|
-
}),
|
|
5638
|
+
}), s && (_e += s.lineBoxH(u, d, we, oe, Te, h)), D = [], k = 0, M = 0, N = 0, P = 0, ne = 0, F.clear(), re = 0, ie = 0, I = 0, oe = 0, se = 0, ce = 0, ue = 0, de = 0, fe = !1, we = !1, Te = !1, Ee = !1, pe = !1, be(ve());
|
|
5638
5639
|
}, Oe = (e, t = e.text) => Tn(e.fontFamily) * ki(e, i) * cc(e) * [...t].length, ke = (e) => {
|
|
5639
5640
|
let t = e.bold ? 700 : 400, n = e.italic ? "italic" : "normal";
|
|
5640
|
-
return e.fontRoute ? `${e.fontRoute.fingerprint}|${t}|${n}` : `implicit|${Rs(e.bold, e.italic, 1, e.fontFamily,
|
|
5641
|
+
return e.fontRoute ? `${e.fontRoute.fingerprint}|${t}|${n}` : `implicit|${Rs(e.bold, e.italic, 1, e.fontFamily, c)}`;
|
|
5641
5642
|
}, Ae = (e, t, n = t.text) => {
|
|
5642
5643
|
/\S/.test(n) && e.add(ke(t));
|
|
5643
5644
|
}, je = (e) => {
|
|
5644
|
-
let t =
|
|
5645
|
-
for (let n of e)
|
|
5645
|
+
let t = F.size;
|
|
5646
|
+
for (let n of e) F.has(n) || (t += 1);
|
|
5646
5647
|
return t;
|
|
5647
5648
|
}, Me = (e, t) => {
|
|
5648
|
-
let n = fc(e,
|
|
5649
|
-
return !n ||
|
|
5649
|
+
let n = fc(e, d);
|
|
5650
|
+
return !n || A == null ? t : n === "eastAsia" ? pc(t, n, A, Ye(e)) : j?.kind === n ? pc(j.naturalWidthPx + t, n, A) - j.allocatedWidthPx : pc(t, n, A);
|
|
5650
5651
|
}, R = (e, t, n, r, a, o = 0) => {
|
|
5651
5652
|
let s = t;
|
|
5652
5653
|
if ("text" in e) {
|
|
5653
|
-
let n = fc(e,
|
|
5654
|
-
if (n &&
|
|
5655
|
-
else if (
|
|
5656
|
-
let t =
|
|
5657
|
-
|
|
5654
|
+
let n = fc(e, d), r = e.snapGridNaturalWidthPx ?? t;
|
|
5655
|
+
if (n && A != null) if (e.snapGridClass = n, e.snapGridNaturalWidthPx = r, e.snapGridCellPitchPx = A, n === "eastAsia") s = pc(r, n, A, Ye(e)), e.snapGridLeadingPadPx = 0, e.snapGridTrailingPadPx = s - r, e.measuredWidth = s, j = null;
|
|
5656
|
+
else if (j?.kind === n) {
|
|
5657
|
+
let t = j.first.snapGridLeadingPadPx ?? 0, i = j.last.snapGridTrailingPadPx ?? 0, a = j.naturalWidthPx + r, o = pc(a, n, A), c = o - a, l = n === "latin" ? c / 2 : 0, u = c - l;
|
|
5658
|
+
j.first.measuredWidth -= t, j.first.snapGridLeadingPadPx = l, j.first.measuredWidth += l, j.last.measuredWidth -= i, e.snapGridLeadingPadPx = 0, e.snapGridTrailingPadPx = u, e.measuredWidth = r + u, s = o - j.allocatedWidthPx, j = {
|
|
5658
5659
|
kind: n,
|
|
5659
|
-
first:
|
|
5660
|
+
first: j.first,
|
|
5660
5661
|
last: e,
|
|
5661
5662
|
naturalWidthPx: a,
|
|
5662
5663
|
allocatedWidthPx: o
|
|
5663
5664
|
};
|
|
5664
5665
|
} else {
|
|
5665
|
-
let t = pc(r, n,
|
|
5666
|
-
e.snapGridLeadingPadPx = a, e.snapGridTrailingPadPx = o, e.measuredWidth = t, s = t,
|
|
5666
|
+
let t = pc(r, n, A), i = t - r, a = n === "latin" ? i / 2 : 0, o = i - a;
|
|
5667
|
+
e.snapGridLeadingPadPx = a, e.snapGridTrailingPadPx = o, e.measuredWidth = t, s = t, j = {
|
|
5667
5668
|
kind: n,
|
|
5668
5669
|
first: e,
|
|
5669
5670
|
last: e,
|
|
@@ -5671,29 +5672,29 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5671
5672
|
allocatedWidthPx: t
|
|
5672
5673
|
};
|
|
5673
5674
|
}
|
|
5674
|
-
else e.snapGridClass = void 0, e.snapGridLeadingPadPx = void 0, e.snapGridTrailingPadPx = void 0, e.snapGridCellPitchPx = void 0, e.measuredWidth = t,
|
|
5675
|
-
} else
|
|
5676
|
-
if (
|
|
5675
|
+
else e.snapGridClass = void 0, e.snapGridLeadingPadPx = void 0, e.snapGridTrailingPadPx = void 0, e.snapGridCellPitchPx = void 0, e.measuredWidth = t, j = null;
|
|
5676
|
+
} else j = null;
|
|
5677
|
+
if (D.push(e), k += s, "text" in e) {
|
|
5677
5678
|
let t = e.text.length - e.text.replace(/ +$/, "").length, n = t > 0 && t === e.text.length;
|
|
5678
|
-
if (n &&
|
|
5679
|
+
if (n && N > 0) M -= P, N += t, P = 0;
|
|
5679
5680
|
else {
|
|
5680
|
-
|
|
5681
|
-
let e =
|
|
5682
|
-
(n && r || t > 0 && !n) && (
|
|
5681
|
+
N = 0, P = 0;
|
|
5682
|
+
let e = D[D.length - 2], r = e !== void 0 && "text" in e && /\S$/u.test(e.text);
|
|
5683
|
+
(n && r || t > 0 && !n) && (N = t, P = t === 1 ? o : 0, M += P);
|
|
5683
5684
|
}
|
|
5684
|
-
|
|
5685
|
+
ne += Oe(e), Ae(F, e);
|
|
5685
5686
|
}
|
|
5686
|
-
n > re && (re = n), r > ie && (ie = r), a >
|
|
5687
|
+
n > re && (re = n), r > ie && (ie = r), a > I && (I = a);
|
|
5687
5688
|
let c = !("text" in e) || e.metricOnly !== !0;
|
|
5688
|
-
c && (
|
|
5689
|
+
c && (fe = !0, r > ce && (ce = r), a > ue && (ue = a));
|
|
5689
5690
|
let l = 0;
|
|
5690
5691
|
if (!("isTab" in e) && !("imagePath" in e) && !("math" in e)) {
|
|
5691
5692
|
let t = e;
|
|
5692
|
-
t.ruby && (we = !0), t.seaBreaks !== void 0 &&
|
|
5693
|
+
t.ruby && (we = !0), t.seaBreaks !== void 0 && ee(t.text) && (Ee = !0);
|
|
5693
5694
|
let n = t.metricEastAsian === !0 || Ai.test(t.text);
|
|
5694
5695
|
!Te && n && (Te = !0);
|
|
5695
5696
|
let r = t.smallCaps && !t.vertAlign ? t.fontSize * i : Ne(t), a = n && !t.ruby, o = t.textBoxLineFloor && t.ruby ? 0 : Math.max(zs(t, r, a), t.textBoxLineFloor || t.metricEastAsian === !0 ? Bs(t, r, a) : 0);
|
|
5696
|
-
o > oe && (oe = o), c && o >
|
|
5697
|
+
o > oe && (oe = o), c && o > de && (de = o), a && (l = gc(o, r));
|
|
5697
5698
|
} else "isTab" in e || (l = r + a);
|
|
5698
5699
|
l > se && (se = l);
|
|
5699
5700
|
}, Ne = (e) => ki(e, i), Pe = null, Fe = (t) => {
|
|
@@ -5729,16 +5730,16 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5729
5730
|
fontBoundingBoxDescent: e.descentPt
|
|
5730
5731
|
};
|
|
5731
5732
|
}
|
|
5732
|
-
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily,
|
|
5733
|
+
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily, c, t.fontRoute));
|
|
5733
5734
|
let r = Ie(t), i = e.measureText(t.text);
|
|
5734
5735
|
return Le(r), i;
|
|
5735
5736
|
}, ze = (e, t) => {
|
|
5736
5737
|
if (!e.verticalRun) return 0;
|
|
5737
|
-
if (!
|
|
5738
|
-
Fe(Rs(e.bold, e.italic, Ne(e), e.fontFamily,
|
|
5738
|
+
if (!y) throw Error("Vertical glyph measurement capability is required for vertical text");
|
|
5739
|
+
Fe(Rs(e.bold, e.italic, Ne(e), e.fontFamily, c, e.fontRoute));
|
|
5739
5740
|
let n = Ie(e);
|
|
5740
5741
|
try {
|
|
5741
|
-
return
|
|
5742
|
+
return y.measureRunInkExtra(t);
|
|
5742
5743
|
} finally {
|
|
5743
5744
|
Le(n);
|
|
5744
5745
|
}
|
|
@@ -5749,34 +5750,34 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5749
5750
|
if (e.src = {
|
|
5750
5751
|
segIndex: t,
|
|
5751
5752
|
charOffset: 0
|
|
5752
|
-
}, "text" in e &&
|
|
5753
|
+
}, "text" in e && le(e.text)) {
|
|
5753
5754
|
let t = tc(e);
|
|
5754
|
-
e.seaBreaks =
|
|
5755
|
+
e.seaBreaks = O(e.text, {
|
|
5755
5756
|
cjk: !0,
|
|
5756
|
-
kinsoku:
|
|
5757
|
+
kinsoku: u
|
|
5757
5758
|
}).filter((e) => !t.has(e));
|
|
5758
5759
|
}
|
|
5759
5760
|
return e;
|
|
5760
5761
|
}), z;
|
|
5761
|
-
if (!
|
|
5762
|
-
else if (
|
|
5762
|
+
if (!_) z = Ve;
|
|
5763
|
+
else if (_.segIndex >= Ve.length) z = [];
|
|
5763
5764
|
else {
|
|
5764
|
-
let e = Ve[
|
|
5765
|
-
if (
|
|
5765
|
+
let e = Ve[_.segIndex];
|
|
5766
|
+
if (_.charOffset > 0) if (!("text" in e) || _.charOffset > e.text.length) z = [];
|
|
5766
5767
|
else {
|
|
5767
|
-
let t = e.text.slice(
|
|
5768
|
+
let t = e.text.slice(_.charOffset);
|
|
5768
5769
|
z = t ? [{
|
|
5769
5770
|
...e,
|
|
5770
5771
|
text: t,
|
|
5771
5772
|
measuredWidth: 0,
|
|
5772
|
-
src: { ...
|
|
5773
|
+
src: { ..._ },
|
|
5773
5774
|
joinPrev: void 0,
|
|
5774
5775
|
hardJoinPrev: void 0,
|
|
5775
|
-
...q(e,
|
|
5776
|
-
seaBreaks: jc(e.seaBreaks,
|
|
5777
|
-
}, ...Ve.slice(
|
|
5776
|
+
...q(e, _.charOffset, e.text.length),
|
|
5777
|
+
seaBreaks: jc(e.seaBreaks, _.charOffset)
|
|
5778
|
+
}, ...Ve.slice(_.segIndex + 1)] : Ve.slice(_.segIndex + 1);
|
|
5778
5779
|
}
|
|
5779
|
-
else z = Ve.slice(
|
|
5780
|
+
else z = Ve.slice(_.segIndex);
|
|
5780
5781
|
}
|
|
5781
5782
|
let He = 0, Ue = -1, We = [];
|
|
5782
5783
|
for (let e = z.length - 1; e >= 0; --e) {
|
|
@@ -5805,9 +5806,9 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5805
5806
|
e && "text" in e && (e.paragraphFinalIdeographicSpaceTailStart = !0);
|
|
5806
5807
|
}
|
|
5807
5808
|
Wc(z.filter((e) => "text" in e), i, (e) => Re(e).width + ze(e, e.text));
|
|
5808
|
-
let Ge = (e) => dc(e, Re(e).width + ze(e, e.text),
|
|
5809
|
-
let n = fc(e,
|
|
5810
|
-
return !n ||
|
|
5809
|
+
let Ge = (e) => dc(e, Re(e).width + ze(e, e.text), d, i), Ke = (e, t) => {
|
|
5810
|
+
let n = fc(e, d);
|
|
5811
|
+
return !n || A == null || e.text.length === 0 ? t : pc(t, n, A, n === "eastAsia" ? Ye(e) : 1);
|
|
5811
5812
|
}, qe = (e) => Ke(e, Ge(e)), Je = (t, n, r = !1) => {
|
|
5812
5813
|
let a = r ? t.text.length - n.length : 0, o = {
|
|
5813
5814
|
...t,
|
|
@@ -5820,16 +5821,16 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5820
5821
|
fontSizePt: Ne(t),
|
|
5821
5822
|
measure: !0,
|
|
5822
5823
|
clusterGeometry: !1
|
|
5823
|
-
}).advancePt + ze(t, n),
|
|
5824
|
-
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily,
|
|
5825
|
-
let s = Ie(t),
|
|
5826
|
-
return Le(s), dc(o,
|
|
5824
|
+
}).advancePt + ze(t, n), d, i);
|
|
5825
|
+
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily, c, t.fontRoute));
|
|
5826
|
+
let s = Ie(t), l = e.measureText(n).width;
|
|
5827
|
+
return Le(s), dc(o, l + ze(t, n), d, i);
|
|
5827
5828
|
}, Ye = (t) => {
|
|
5828
|
-
if (
|
|
5829
|
+
if (A == null) return 1;
|
|
5829
5830
|
t.textLayoutService && t.textShapeRequest && !t.shapedClusters && Re(t, !0);
|
|
5830
5831
|
let n = t.shapedClusters?.length ? t.shapedClusters : null, r = n == null ? [...new Set([
|
|
5831
5832
|
0,
|
|
5832
|
-
...
|
|
5833
|
+
...te(t.text),
|
|
5833
5834
|
t.text.length
|
|
5834
5835
|
])].sort((e, t) => e - t) : null, a = n?.map((e) => ({
|
|
5835
5836
|
start: e.range.start,
|
|
@@ -5843,18 +5844,18 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5843
5844
|
for (let n of a) {
|
|
5844
5845
|
let { start: r, end: a } = n;
|
|
5845
5846
|
if (a <= r) continue;
|
|
5846
|
-
let s = t.text.slice(r, a),
|
|
5847
|
+
let s = t.text.slice(r, a), l = {
|
|
5847
5848
|
...t,
|
|
5848
5849
|
text: s,
|
|
5849
5850
|
punctuationCompressions: $s(t, r, a)
|
|
5850
5851
|
}, u;
|
|
5851
|
-
if (n.advancePx != null) u = dc(
|
|
5852
|
+
if (n.advancePx != null) u = dc(l, n.advancePx + ze(t, s), d, i);
|
|
5852
5853
|
else {
|
|
5853
|
-
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily,
|
|
5854
|
+
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily, c, t.fontRoute));
|
|
5854
5855
|
let n = Ie(t), r = e.measureText(s).width;
|
|
5855
|
-
Le(n), u = dc(
|
|
5856
|
+
Le(n), u = dc(l, r + ze(t, s), d, i);
|
|
5856
5857
|
}
|
|
5857
|
-
o += Ko(u,
|
|
5858
|
+
o += Ko(u, A);
|
|
5858
5859
|
}
|
|
5859
5860
|
return Math.max(1, o);
|
|
5860
5861
|
}, Xe = (e, t, n = !1) => Ke({
|
|
@@ -5862,7 +5863,7 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5862
5863
|
text: t,
|
|
5863
5864
|
shapedClusters: t === e.text ? e.shapedClusters : void 0
|
|
5864
5865
|
}, Je(e, t, n)), Ze = (t) => {
|
|
5865
|
-
let n = Re(t, fc(t,
|
|
5866
|
+
let n = Re(t, fc(t, d) === "eastAsia"), r = dc(t, n.width + ze(t, t.text), d, i);
|
|
5866
5867
|
t.snapGridNaturalWidthPx = r;
|
|
5867
5868
|
let a = t.fontSize * i, o = n, s = Ne(t);
|
|
5868
5869
|
if (t.smallCaps && !t.vertAlign && s !== a) {
|
|
@@ -5883,20 +5884,20 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5883
5884
|
};
|
|
5884
5885
|
} else {
|
|
5885
5886
|
let n = e.font;
|
|
5886
|
-
e.font = Rs(t.bold, t.italic, a, t.fontFamily,
|
|
5887
|
+
e.font = Rs(t.bold, t.italic, a, t.fontFamily, c, t.fontRoute), o = e.measureText(t.text || "X"), e.font = n;
|
|
5887
5888
|
}
|
|
5888
5889
|
s = a;
|
|
5889
5890
|
}
|
|
5890
|
-
let
|
|
5891
|
+
let l = yc(o, t.fontFamily, a, s, (t.metricEastAsian === !0 || Ai.test(t.text)) && !t.ruby), u = l.ascent, f = l.descent;
|
|
5891
5892
|
if (t.positionExtendsLineBox !== !1) {
|
|
5892
5893
|
let e = (t.position ?? 0) * i;
|
|
5893
|
-
e > 0 ? u += e : e < 0 && (
|
|
5894
|
+
e > 0 ? u += e : e < 0 && (f -= e);
|
|
5894
5895
|
}
|
|
5895
|
-
return t.ruby && (!t.textBoxLineFloor || t.textBoxVertical) && (u += Ts(t.ruby.fontSizePt, t.ruby.hpsRaisePt, i, t, e,
|
|
5896
|
+
return t.ruby && (!t.textBoxLineFloor || t.textBoxVertical) && (u += Ts(t.ruby.fontSizePt, t.ruby.hpsRaisePt, i, t, e, c)), {
|
|
5896
5897
|
width: r,
|
|
5897
5898
|
height: t.fontSize,
|
|
5898
5899
|
ascent: u,
|
|
5899
|
-
descent:
|
|
5900
|
+
descent: f
|
|
5900
5901
|
};
|
|
5901
5902
|
}, Qe = (e) => {
|
|
5902
5903
|
if (/\s$/u.test(e.text) || e.ruby !== void 0 || e.tateChuYoko === !0 || e.fitTextRegionIndex !== void 0) return;
|
|
@@ -5974,18 +5975,18 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
5974
5975
|
decimalPrefixWidth: n
|
|
5975
5976
|
};
|
|
5976
5977
|
}, nt = null;
|
|
5977
|
-
ye
|
|
5978
|
+
be(ye ? s?.paragraphMarkLineStartWidth ?? ve() : ve());
|
|
5978
5979
|
let rt = (t, n, r = !0) => {
|
|
5979
5980
|
let a = tc(t), o = [
|
|
5980
5981
|
0,
|
|
5981
|
-
...
|
|
5982
|
+
...te(t.text),
|
|
5982
5983
|
t.text.length
|
|
5983
5984
|
].filter((e, t, n) => n.indexOf(e) === t), s = 0;
|
|
5984
|
-
if (n > 0) if (Js(t, i) >= 0 && fc(t,
|
|
5985
|
-
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily,
|
|
5985
|
+
if (n > 0) if (Js(t, i) >= 0 && fc(t, d) !== "latin") {
|
|
5986
|
+
Fe(Rs(t.bold, t.italic, Ne(t), t.fontFamily, c, t.fontRoute));
|
|
5986
5987
|
let r = Ie(t);
|
|
5987
5988
|
try {
|
|
5988
|
-
let r = Pc(e, t.text, n, qs(t,
|
|
5989
|
+
let r = Pc(e, t.text, n, qs(t, d, i), cc(t), Js(t, i), t.verticalRun === !0, y, (e) => Xe(t, e)).length;
|
|
5989
5990
|
s = o.filter((e) => e <= r && !a.has(e)).at(-1) ?? 0;
|
|
5990
5991
|
} finally {
|
|
5991
5992
|
Le(r);
|
|
@@ -6014,42 +6015,42 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6014
6015
|
}
|
|
6015
6016
|
});
|
|
6016
6017
|
}, ot = (e) => {
|
|
6017
|
-
let t = e.text.codePointAt(0), n =
|
|
6018
|
-
if (t === void 0 || !
|
|
6019
|
-
let r = n, i = [...r.text], a =
|
|
6018
|
+
let t = e.text.codePointAt(0), n = D[D.length - 1];
|
|
6019
|
+
if (t === void 0 || !u.lineStartForbidden.has(t) || n === void 0 || !("text" in n)) return { kind: "none" };
|
|
6020
|
+
let r = n, i = [...r.text], a = ge(i, u, D.length > 1 ? 0 : 1);
|
|
6020
6021
|
if (a <= 0) return { kind: "none" };
|
|
6021
|
-
let o = i.slice(0, i.length - a).join(""),
|
|
6022
|
-
if (
|
|
6023
|
-
let
|
|
6022
|
+
let o = i.slice(0, i.length - a).join(""), s = o.length;
|
|
6023
|
+
if (s === 0 && r.hardJoinPrev === !0 || tc(r).has(s)) return { kind: "blocked" };
|
|
6024
|
+
let c = r.text.slice(s), l = {
|
|
6024
6025
|
...r,
|
|
6025
6026
|
...ws,
|
|
6026
|
-
text:
|
|
6027
|
-
...q(r,
|
|
6028
|
-
measuredWidth: Xe(r,
|
|
6027
|
+
text: c,
|
|
6028
|
+
...q(r, s, r.text.length),
|
|
6029
|
+
measuredWidth: Xe(r, c, !0),
|
|
6029
6030
|
joinPrev: void 0,
|
|
6030
6031
|
hardJoinPrev: void 0,
|
|
6031
6032
|
src: {
|
|
6032
6033
|
segIndex: r.src.segIndex,
|
|
6033
|
-
charOffset: r.src.charOffset +
|
|
6034
|
+
charOffset: r.src.charOffset + s
|
|
6034
6035
|
},
|
|
6035
|
-
seaBreaks: jc(r.seaBreaks,
|
|
6036
|
+
seaBreaks: jc(r.seaBreaks, s)
|
|
6036
6037
|
};
|
|
6037
6038
|
if (o) {
|
|
6038
6039
|
let e = Xe(r, o);
|
|
6039
|
-
|
|
6040
|
+
k -= r.measuredWidth - e, D[D.length - 1] = {
|
|
6040
6041
|
...r,
|
|
6041
6042
|
...ws,
|
|
6042
6043
|
text: o,
|
|
6043
6044
|
measuredWidth: e,
|
|
6044
|
-
...q(r, 0,
|
|
6045
|
+
...q(r, 0, s)
|
|
6045
6046
|
};
|
|
6046
|
-
} else
|
|
6047
|
+
} else k -= r.measuredWidth, D.pop();
|
|
6047
6048
|
return {
|
|
6048
6049
|
kind: "retracted",
|
|
6049
|
-
tail:
|
|
6050
|
+
tail: l
|
|
6050
6051
|
};
|
|
6051
6052
|
}, st = (e, t, n, r) => {
|
|
6052
|
-
let i =
|
|
6053
|
+
let i = te(e.text)[0] ?? e.text.length;
|
|
6053
6054
|
if (i <= 0) return !1;
|
|
6054
6055
|
let a = e.text.slice(0, i), o = Je(e, a);
|
|
6055
6056
|
return R({
|
|
@@ -6067,27 +6068,27 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6067
6068
|
continue;
|
|
6068
6069
|
}
|
|
6069
6070
|
if (nt = null, "isTab" in t) {
|
|
6070
|
-
if (
|
|
6071
|
+
if (m && !t.ptab) {
|
|
6071
6072
|
t.measuredWidth = 0, R(t, 0, t.fontSize, t.fontSize * i * .8, t.fontSize * i * .2);
|
|
6072
6073
|
continue;
|
|
6073
6074
|
}
|
|
6074
|
-
let e =
|
|
6075
|
+
let e = k + (pe ? r : 0);
|
|
6075
6076
|
if (t.ptab) {
|
|
6076
6077
|
t.resolvedAlignment = t.ptab.alignment;
|
|
6077
|
-
let r = t.ptab.relativeTo === "indent" ? 0 : -
|
|
6078
|
+
let r = t.ptab.relativeTo === "indent" ? 0 : -l, a = t.ptab.relativeTo === "indent" ? n : p, o = t.ptab.alignment === "left" ? r : t.ptab.alignment === "center" ? (r + a) / 2 : a, s = 0;
|
|
6078
6079
|
for (let e of z) {
|
|
6079
6080
|
if ("isTab" in e || "lineBreak" in e) break;
|
|
6080
6081
|
s += $e(e);
|
|
6081
6082
|
}
|
|
6082
|
-
let c = t.ptab.alignment === "center" ? .5 : +(t.ptab.alignment === "right"),
|
|
6083
|
-
if (
|
|
6084
|
-
if (
|
|
6083
|
+
let c = t.ptab.alignment === "center" ? .5 : +(t.ptab.alignment === "right"), u = o - e - s * c;
|
|
6084
|
+
if (u <= 0) {
|
|
6085
|
+
if (D.length > 0) {
|
|
6085
6086
|
De(void 0, !1, t.src), z.unshift(t);
|
|
6086
6087
|
continue;
|
|
6087
6088
|
}
|
|
6088
|
-
|
|
6089
|
+
u = 0;
|
|
6089
6090
|
}
|
|
6090
|
-
if (t.measuredWidth =
|
|
6091
|
+
if (t.measuredWidth = u, R(t, u, t.fontSize, t.fontSize * i * .8, t.fontSize * i * .2), t.ptab.alignment !== "left") for (; z.length > 0;) {
|
|
6091
6092
|
let e = z[0];
|
|
6092
6093
|
if ("isTab" in e || "lineBreak" in e) break;
|
|
6093
6094
|
if (z.shift(), "imagePath" in e) {
|
|
@@ -6095,7 +6096,7 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6095
6096
|
e.measuredWidth = t, R(e, t, e.heightPt, e.heightPt * i, 0);
|
|
6096
6097
|
} else if ("math" in e) R(e, e.measuredWidth || 0, e.fontSize, e.mathAscent || 0, e.mathDescent || 0);
|
|
6097
6098
|
else {
|
|
6098
|
-
let t = Re(e), n = dc(e, t.width + ze(e, e.text),
|
|
6099
|
+
let t = Re(e), n = dc(e, t.width + ze(e, e.text), d, i);
|
|
6099
6100
|
e.measuredWidth = n;
|
|
6100
6101
|
let r = t.fontBoundingBoxAscent ?? t.actualBoundingBoxAscent ?? e.fontSize * i * .8, a = t.fontBoundingBoxDescent ?? t.actualBoundingBoxDescent ?? e.fontSize * i * .2;
|
|
6101
6102
|
R(e, n, e.fontSize, r, a);
|
|
@@ -6103,13 +6104,13 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6103
6104
|
}
|
|
6104
6105
|
continue;
|
|
6105
6106
|
}
|
|
6106
|
-
let o = ji(e +
|
|
6107
|
+
let o = ji(e + l, a.map((e) => ({
|
|
6107
6108
|
pos: e.pos * i,
|
|
6108
6109
|
alignment: e.alignment,
|
|
6109
6110
|
leader: e.leader
|
|
6110
|
-
})),
|
|
6111
|
+
})), f * i);
|
|
6111
6112
|
t.resolvedAlignment = o?.alignment ?? "left";
|
|
6112
|
-
let s = o ? o.pos -
|
|
6113
|
+
let s = o ? o.pos - l : e, c = o ? Hc(o.alignment) : "leading";
|
|
6113
6114
|
if (o && c !== "leading") {
|
|
6114
6115
|
let n = s;
|
|
6115
6116
|
t.leader = o.leader;
|
|
@@ -6122,7 +6123,7 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6122
6123
|
e.measuredWidth = t, R(e, t, e.heightPt, e.heightPt * i, 0);
|
|
6123
6124
|
} else if ("math" in e) R(e, e.measuredWidth || 0, e.fontSize, e.mathAscent || 0, e.mathDescent || 0);
|
|
6124
6125
|
else {
|
|
6125
|
-
let t = Re(e), n = dc(e, t.width + ze(e, e.text),
|
|
6126
|
+
let t = Re(e), n = dc(e, t.width + ze(e, e.text), d, i);
|
|
6126
6127
|
e.measuredWidth = n;
|
|
6127
6128
|
let r = t.fontBoundingBoxAscent ?? t.actualBoundingBoxAscent ?? e.fontSize * i * .8, a = t.fontBoundingBoxDescent ?? t.actualBoundingBoxDescent ?? e.fontSize * i * .2;
|
|
6128
6129
|
R(e, n, e.fontSize, r, a);
|
|
@@ -6130,16 +6131,16 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6130
6131
|
}
|
|
6131
6132
|
continue;
|
|
6132
6133
|
}
|
|
6133
|
-
let
|
|
6134
|
-
if (o && (t.leader = o.leader),
|
|
6134
|
+
let u = s - e;
|
|
6135
|
+
if (o && (t.leader = o.leader), u <= 0) {
|
|
6135
6136
|
De(void 0, !1, t.src), z.unshift(t);
|
|
6136
6137
|
continue;
|
|
6137
6138
|
}
|
|
6138
|
-
if (
|
|
6139
|
+
if (k + u > L() && D.length > 0) {
|
|
6139
6140
|
De(void 0, !1, t.src), z.unshift(t);
|
|
6140
6141
|
continue;
|
|
6141
6142
|
}
|
|
6142
|
-
t.measuredWidth =
|
|
6143
|
+
t.measuredWidth = u, R(t, u, t.fontSize, t.fontSize * i * .8, t.fontSize * i * .2);
|
|
6143
6144
|
continue;
|
|
6144
6145
|
}
|
|
6145
6146
|
if ("imagePath" in t) {
|
|
@@ -6148,61 +6149,61 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6148
6149
|
continue;
|
|
6149
6150
|
}
|
|
6150
6151
|
let e = t.widthPt * i, n = t.heightPt, r = t.heightPt * i;
|
|
6151
|
-
t.measuredWidth = e,
|
|
6152
|
+
t.measuredWidth = e, D.length > 0 && k + e > L() && De(void 0, !1, t.src), R(t, e, n, r, 0);
|
|
6152
6153
|
continue;
|
|
6153
6154
|
}
|
|
6154
6155
|
if ("math" in t) {
|
|
6155
6156
|
let n = t.mathMetadata;
|
|
6156
6157
|
if (!n || n.available === !1) {
|
|
6157
6158
|
let n = t.fontSize * i;
|
|
6158
|
-
Fe(Rs(!1, !1, n, null,
|
|
6159
|
+
Fe(Rs(!1, !1, n, null, c));
|
|
6159
6160
|
let r = e.measureText(t.fallbackText), a = r.width, o = r.fontBoundingBoxAscent ?? r.actualBoundingBoxAscent ?? n * .8, s = r.fontBoundingBoxDescent ?? r.actualBoundingBoxDescent ?? n * .2;
|
|
6160
|
-
t.measuredWidth = a, t.mathAscent = o, t.mathDescent = s,
|
|
6161
|
+
t.measuredWidth = a, t.mathAscent = o, t.mathDescent = s, D.length > 0 && k + a > L() && De(void 0, !1, t.src), R(t, a, t.fontSize, Math.max(o, n * .8), Math.max(s, n * .2));
|
|
6161
6162
|
continue;
|
|
6162
6163
|
}
|
|
6163
6164
|
let r = t.fontSize * i, a = n.widthEm * r, o = n.ascentEm * r, s = n.descentEm * r;
|
|
6164
6165
|
t.measuredWidth = a, t.mathAscent = o, t.mathDescent = s;
|
|
6165
|
-
let
|
|
6166
|
-
|
|
6166
|
+
let l = Math.max(o, r * .8), u = Math.max(s, r * .2);
|
|
6167
|
+
D.length > 0 && k + a > L() && De(void 0, !1, t.src), R(t, a, t.fontSize, l, u);
|
|
6167
6168
|
continue;
|
|
6168
6169
|
}
|
|
6169
|
-
let s = t,
|
|
6170
|
-
if (
|
|
6170
|
+
let s = t, _ = Ze(s), v = _.width, S = Me(s, v), C = _.height, T = _.ascent, E = _.descent, O = s.paragraphFinalIdeographicSpaceTail === !0, A = s.paragraphFinalIdeographicSpaceCount ?? 0, j = s.paragraphFinalIdeographicSpaceLocalCount ?? 0, N = O ? s.text.slice(0, Math.max(0, s.text.length - j)) : s.text;
|
|
6171
|
+
if (O && A > 1 && N.length > 0) {
|
|
6171
6172
|
let e = {
|
|
6172
6173
|
...s,
|
|
6173
6174
|
...ws,
|
|
6174
|
-
text:
|
|
6175
|
+
text: N,
|
|
6175
6176
|
paragraphFinalIdeographicSpaceTail: void 0,
|
|
6176
6177
|
paragraphFinalIdeographicSpaceLocalCount: void 0,
|
|
6177
6178
|
paragraphFinalIdeographicSpaceCount: void 0,
|
|
6178
6179
|
paragraphFinalIdeographicSpaceTailStart: void 0,
|
|
6179
6180
|
measuredWidth: 0,
|
|
6180
|
-
...q(s, 0,
|
|
6181
|
+
...q(s, 0, N.length)
|
|
6181
6182
|
}, t = {
|
|
6182
6183
|
...s,
|
|
6183
6184
|
...ws,
|
|
6184
|
-
text: s.text.slice(
|
|
6185
|
+
text: s.text.slice(N.length),
|
|
6185
6186
|
paragraphFinalIdeographicSpaceLocalCount: j,
|
|
6186
6187
|
joinPrev: void 0,
|
|
6187
6188
|
hardJoinPrev: void 0,
|
|
6188
6189
|
paragraphFinalIdeographicSpaceTailStart: !0,
|
|
6189
6190
|
measuredWidth: 0,
|
|
6190
|
-
...q(s,
|
|
6191
|
+
...q(s, N.length, s.text.length),
|
|
6191
6192
|
src: s.src ? {
|
|
6192
6193
|
segIndex: s.src.segIndex,
|
|
6193
|
-
charOffset: s.src.charOffset +
|
|
6194
|
+
charOffset: s.src.charOffset + N.length
|
|
6194
6195
|
} : void 0
|
|
6195
6196
|
};
|
|
6196
6197
|
z.unshift(t), z.unshift(e);
|
|
6197
6198
|
continue;
|
|
6198
6199
|
}
|
|
6199
|
-
if (
|
|
6200
|
+
if (O && /^\u3000+$/u.test(s.text) && s.paragraphFinalIdeographicSpaceTailStart === !0 && D.some((e) => "text" in e && /[^\u3000]/u.test(e.text))) {
|
|
6200
6201
|
let e = v;
|
|
6201
6202
|
for (let t of z) {
|
|
6202
6203
|
if (!("text" in t) || t.paragraphFinalIdeographicSpaceTail !== !0) break;
|
|
6203
6204
|
e += qe(t);
|
|
6204
6205
|
}
|
|
6205
|
-
if (
|
|
6206
|
+
if (k + e > L()) {
|
|
6206
6207
|
De(void 0, !1, s.src), z.unshift(s);
|
|
6207
6208
|
continue;
|
|
6208
6209
|
}
|
|
@@ -6214,116 +6215,116 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6214
6215
|
if (!("text" in t) || t.fitTextRegionIndex !== s.fitTextRegionIndex) break;
|
|
6215
6216
|
e += qe(t);
|
|
6216
6217
|
}
|
|
6217
|
-
|
|
6218
|
+
D.length > 0 && k + e > L() && De(void 0, !1, s.src);
|
|
6218
6219
|
}
|
|
6219
|
-
s.measuredWidth = v, R(s, v,
|
|
6220
|
+
s.measuredWidth = v, R(s, v, C, T, E);
|
|
6220
6221
|
continue;
|
|
6221
6222
|
}
|
|
6222
|
-
let P = s.text.replace(/ +$/, ""), F = fc(s,
|
|
6223
|
+
let P = s.text.replace(/ +$/, ""), F = fc(s, d) ? 0 : s.text.endsWith(" ") ? v - Xe(s, P) : 0, re = (e) => {
|
|
6223
6224
|
let t = e === void 0 || "lineBreak" in e;
|
|
6224
|
-
return
|
|
6225
|
-
},
|
|
6225
|
+
return h && (!t || g);
|
|
6226
|
+
}, ie = (e, t, r) => ss({
|
|
6226
6227
|
widthPx: e,
|
|
6227
6228
|
trailingSpacePx: t,
|
|
6228
|
-
lineWillJustify:
|
|
6229
|
-
wrapNarrowed:
|
|
6230
|
-
}),
|
|
6231
|
-
Ae(
|
|
6232
|
-
let
|
|
6229
|
+
lineWillJustify: re(r),
|
|
6230
|
+
wrapNarrowed: me !== n || he !== 0
|
|
6231
|
+
}), I = ie(S, F, z[0]), oe = s.seaBreaks !== void 0 && ee(s.text), se = /* @__PURE__ */ new Set();
|
|
6232
|
+
Ae(se, s, P);
|
|
6233
|
+
let ce = (e, t, n) => re(e) ? cs({
|
|
6233
6234
|
biasBudgetPx: t,
|
|
6234
6235
|
resolvedMeasurementRouteCount: je(n)
|
|
6235
|
-
}) : Ee ||
|
|
6236
|
-
if (!s.joinPrev &&
|
|
6237
|
-
let e = v, t = F, n = 0, r =
|
|
6238
|
-
r += Oe(a,
|
|
6236
|
+
}) : Ee || oe ? 0 : M * Bc;
|
|
6237
|
+
if (!s.joinPrev && D.length > 0 && z[0]?.joinPrev && (z[0]?.hardJoinPrev === !0 || !Dc(s.text)) && (z[0]?.hardJoinPrev === !0 || !(s.seaBreaks && s.seaBreaks.length > 0))) {
|
|
6238
|
+
let e = v, t = F, n = 0, r = ne, i = new Set(se), a = s, c = s.text, l = (e, t = e.text) => {
|
|
6239
|
+
r += Oe(a, c), a = e, c = t;
|
|
6239
6240
|
};
|
|
6240
6241
|
for (; n < z.length && z[n].joinPrev; n++) {
|
|
6241
6242
|
let r = z[n], a = rc(r);
|
|
6242
6243
|
if (a !== void 0) {
|
|
6243
6244
|
let n = r.text.slice(0, a), o = Xe(r, n);
|
|
6244
|
-
if (e += o,
|
|
6245
|
+
if (e += o, l(r, n), Ae(i, r, n), t = n.endsWith(" ") ? o - Xe(r, n.replace(/ +$/, "")) : 0, a < r.text.length) break;
|
|
6245
6246
|
continue;
|
|
6246
6247
|
}
|
|
6247
|
-
let
|
|
6248
|
-
if (
|
|
6249
|
-
let n = r.text.slice(0,
|
|
6250
|
-
e += a,
|
|
6248
|
+
let s = r.externalLinkBreakOffsets?.[0];
|
|
6249
|
+
if (s !== void 0) {
|
|
6250
|
+
let n = r.text.slice(0, s), a = Xe(r, n);
|
|
6251
|
+
e += a, l(r, n), Ae(i, r, n), t = 0;
|
|
6251
6252
|
break;
|
|
6252
6253
|
}
|
|
6253
6254
|
if (Dc(r.text)) {
|
|
6254
6255
|
let n = [...r.text], a = 0;
|
|
6255
|
-
for (; a < n.length &&
|
|
6256
|
+
for (; a < n.length && o.lineStartForbidden.has(n[a].codePointAt(0));) a++;
|
|
6256
6257
|
if (a < n.length) {
|
|
6257
6258
|
let o = n.slice(0, a).join(""), s = Xe(r, o);
|
|
6258
|
-
e += s, o.length > 0 && (
|
|
6259
|
+
e += s, o.length > 0 && (l(r, o), Ae(i, r, o)), t = 0;
|
|
6259
6260
|
break;
|
|
6260
6261
|
}
|
|
6261
6262
|
}
|
|
6262
|
-
let
|
|
6263
|
-
e +=
|
|
6264
|
-
let
|
|
6265
|
-
t =
|
|
6263
|
+
let c = qe(r);
|
|
6264
|
+
e += c, l(r), Ae(i, r);
|
|
6265
|
+
let u = r.text.replace(/ +$/, ""), d = r.text.endsWith(" ") ? c - Xe(r, u) : 0;
|
|
6266
|
+
t = u.length === 0 && t > 0 ? t + d : d;
|
|
6266
6267
|
}
|
|
6267
|
-
r += Oe(a,
|
|
6268
|
+
r += Oe(a, c.replace(/ +$/, "")), k + ie(e, t, z[n]) > L() + ce(z[n], r, i) && De(void 0, !1, s.src);
|
|
6268
6269
|
}
|
|
6269
|
-
if (
|
|
6270
|
-
let e =
|
|
6270
|
+
if (oe && D.length > 0 && (() => {
|
|
6271
|
+
let e = D[D.length - 1];
|
|
6271
6272
|
return !("text" in e) || e.text.endsWith(" ");
|
|
6272
6273
|
})()) {
|
|
6273
|
-
let e = v, t = F, n = 0, r =
|
|
6274
|
+
let e = v, t = F, n = 0, r = ne + Oe(s, P), i = new Set(se);
|
|
6274
6275
|
if (!s.text.endsWith(" ")) for (; n < z.length; n++) {
|
|
6275
6276
|
let a = z[n];
|
|
6276
|
-
if (!("text" in a) || a.seaBreaks === void 0 || !
|
|
6277
|
+
if (!("text" in a) || a.seaBreaks === void 0 || !ee(a.text)) break;
|
|
6277
6278
|
let o = a, s = qe(o), c = o.text.replace(/ +$/, "");
|
|
6278
6279
|
if (e += s, t = o.text.endsWith(" ") ? s - Xe(o, c) : 0, r += Oe(o, c), Ae(i, o, c), o.text.endsWith(" ")) {
|
|
6279
6280
|
n++;
|
|
6280
6281
|
break;
|
|
6281
6282
|
}
|
|
6282
6283
|
}
|
|
6283
|
-
let a =
|
|
6284
|
-
|
|
6284
|
+
let a = ie(e, t, z[n]);
|
|
6285
|
+
k + a > L() + ce(z[n], r, i) && a <= me && De(void 0, !1, s.src);
|
|
6285
6286
|
}
|
|
6286
|
-
let
|
|
6287
|
-
if (
|
|
6288
|
-
else if (
|
|
6287
|
+
let le = ce(z[0], ne + Oe(s, P), se), ue = [...P], de = ue.at(-1), fe = ue.slice(0, -1).join(""), ge = x && de !== void 0 && (D.length > 0 || fe.length > 0) && os(de, s.eastAsiaLanguage) && k + Xe(s, fe) <= L() + le;
|
|
6288
|
+
if (k + I <= L() + le) s.measuredWidth = v, R(s, v, C, T, E, F), Qe(s);
|
|
6289
|
+
else if (ge) s.measuredWidth = v, R(s, v, C, T, E, F), Qe(s);
|
|
6289
6290
|
else if (Dc(s.text) && s.seaBreaks === void 0 && s.hardJoinPrev !== !0) {
|
|
6290
|
-
let t = L() -
|
|
6291
|
-
if (t > 0) if (Js(s, i) < 0 || fc(s,
|
|
6291
|
+
let t = L() - k, n = "", r = O ? $o(Nc(s.text), s.paragraphFinalIdeographicSpaceCount ?? 0) : Infinity;
|
|
6292
|
+
if (t > 0) if (Js(s, i) < 0 || fc(s, d) === "latin") n = s.text.slice(0, rt(s, t, !1));
|
|
6292
6293
|
else {
|
|
6293
|
-
Fe(Rs(s.bold, s.italic, Ne(s), s.fontFamily,
|
|
6294
|
+
Fe(Rs(s.bold, s.italic, Ne(s), s.fontFamily, c, s.fontRoute));
|
|
6294
6295
|
let a = Ie(s);
|
|
6295
6296
|
try {
|
|
6296
|
-
n = Pc(e, s.text, t, qs(s,
|
|
6297
|
+
n = Pc(e, s.text, t, qs(s, d, i), cc(s), Js(s, i), s.verticalRun === !0, y, (e) => Xe(s, e), r);
|
|
6297
6298
|
} finally {
|
|
6298
6299
|
Le(a);
|
|
6299
6300
|
}
|
|
6300
6301
|
}
|
|
6301
|
-
let a = [...s.text],
|
|
6302
|
-
if (
|
|
6303
|
-
let e = Je(s,
|
|
6302
|
+
let a = [...s.text], o = [...n].length, l = D.length > 0 ? 0 : 1, f = Mc(a, (x && o < a.length && (D.length > 0 || o > 0) && os(a[o], s.eastAsiaLanguage) ? o + 1 : null) ?? b(a, o, u, l), O && r === 0 ? 0 : r), p = a.slice(0, f).join("").length, m = nc(s, p, +(l > 0)), h = s.text.slice(0, m);
|
|
6303
|
+
if (h.length > 0) {
|
|
6304
|
+
let e = Je(s, h);
|
|
6304
6305
|
R({
|
|
6305
6306
|
...s,
|
|
6306
6307
|
...ws,
|
|
6307
|
-
text:
|
|
6308
|
+
text: h,
|
|
6308
6309
|
measuredWidth: e,
|
|
6309
|
-
...q(s, 0,
|
|
6310
|
-
}, e,
|
|
6311
|
-
let t = s.text.slice(
|
|
6310
|
+
...q(s, 0, h.length)
|
|
6311
|
+
}, e, C, T, E);
|
|
6312
|
+
let t = s.text.slice(h.length);
|
|
6312
6313
|
t ? z.unshift({
|
|
6313
6314
|
...s,
|
|
6314
6315
|
...ws,
|
|
6315
6316
|
text: t,
|
|
6316
|
-
...q(s,
|
|
6317
|
+
...q(s, h.length, s.text.length),
|
|
6317
6318
|
measuredWidth: 0,
|
|
6318
6319
|
src: {
|
|
6319
6320
|
segIndex: s.src.segIndex,
|
|
6320
|
-
charOffset: s.src.charOffset +
|
|
6321
|
+
charOffset: s.src.charOffset + h.length
|
|
6321
6322
|
}
|
|
6322
6323
|
}) : Qe(s);
|
|
6323
|
-
} else if (
|
|
6324
|
+
} else if (D.length > 0) {
|
|
6324
6325
|
let e = ot(s);
|
|
6325
6326
|
if (e.kind === "blocked") {
|
|
6326
|
-
st(s,
|
|
6327
|
+
st(s, C, T, E);
|
|
6327
6328
|
continue;
|
|
6328
6329
|
}
|
|
6329
6330
|
De(void 0, !1, e.kind === "retracted" ? e.tail.src : s.src), z.unshift(s), e.kind === "retracted" && z.unshift(e.tail);
|
|
@@ -6337,7 +6338,7 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6337
6338
|
text: i,
|
|
6338
6339
|
measuredWidth: e,
|
|
6339
6340
|
...q(s, 0, i.length)
|
|
6340
|
-
}, e,
|
|
6341
|
+
}, e, C, T, E);
|
|
6341
6342
|
let t = s.text.slice(i.length);
|
|
6342
6343
|
t ? z.unshift({
|
|
6343
6344
|
...s,
|
|
@@ -6353,7 +6354,7 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6353
6354
|
}
|
|
6354
6355
|
}
|
|
6355
6356
|
} else if (s.seaBreaks !== void 0 && s.hardJoinPrev !== !0) {
|
|
6356
|
-
let e = L() -
|
|
6357
|
+
let e = L() - k, t = (e) => Xe(s, e), n = w(s.text) && Js(s, i) >= 0 && fc(s, d) !== "latin", r = ae(s.text, s.seaBreaks, 0, e, t, n);
|
|
6357
6358
|
if (r > 0) {
|
|
6358
6359
|
let e = s.text.slice(0, r), t = Je(s, e);
|
|
6359
6360
|
R({
|
|
@@ -6362,7 +6363,7 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6362
6363
|
text: e,
|
|
6363
6364
|
measuredWidth: t,
|
|
6364
6365
|
...q(s, 0, e.length)
|
|
6365
|
-
}, t,
|
|
6366
|
+
}, t, C, T, E);
|
|
6366
6367
|
let n = s.text.slice(r);
|
|
6367
6368
|
n && z.unshift({
|
|
6368
6369
|
...s,
|
|
@@ -6376,15 +6377,15 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6376
6377
|
},
|
|
6377
6378
|
seaBreaks: jc(s.seaBreaks, r)
|
|
6378
6379
|
});
|
|
6379
|
-
} else if (
|
|
6380
|
+
} else if (D.length > 0) {
|
|
6380
6381
|
let e = ot(s);
|
|
6381
6382
|
if (e.kind === "blocked") {
|
|
6382
|
-
st(s,
|
|
6383
|
+
st(s, C, T, E);
|
|
6383
6384
|
continue;
|
|
6384
6385
|
}
|
|
6385
6386
|
De(void 0, !1, e.kind === "retracted" ? e.tail.src : s.src), z.unshift(s), e.kind === "retracted" && z.unshift(e.tail);
|
|
6386
6387
|
} else {
|
|
6387
|
-
let r = s.seaBreaks[0] ?? s.text.length, i = s.text.slice(0, r), a =
|
|
6388
|
+
let r = s.seaBreaks[0] ?? s.text.length, i = s.text.slice(0, r), a = te(i), o = ae(i, a, 0, e, t, n);
|
|
6388
6389
|
o <= 0 && (o = a.length > 0 ? a[0] : i.length), o = nc(s, o) || rt(s, e, !0);
|
|
6389
6390
|
let c = s.text.slice(0, o), l = Je(s, c);
|
|
6390
6391
|
R({
|
|
@@ -6393,7 +6394,7 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6393
6394
|
text: c,
|
|
6394
6395
|
measuredWidth: l,
|
|
6395
6396
|
...q(s, 0, c.length)
|
|
6396
|
-
}, l,
|
|
6397
|
+
}, l, C, T, E);
|
|
6397
6398
|
let u = s.text.slice(o);
|
|
6398
6399
|
u && z.unshift({
|
|
6399
6400
|
...s,
|
|
@@ -6408,9 +6409,9 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6408
6409
|
seaBreaks: jc(s.seaBreaks, o)
|
|
6409
6410
|
});
|
|
6410
6411
|
}
|
|
6411
|
-
} else if (
|
|
6412
|
+
} else if (D.length === 0) {
|
|
6412
6413
|
let e = it(s, L()) || rt(s, L());
|
|
6413
|
-
if (e >= s.text.length) s.measuredWidth = v, R(s, v,
|
|
6414
|
+
if (e >= s.text.length) s.measuredWidth = v, R(s, v, C, T, E);
|
|
6414
6415
|
else {
|
|
6415
6416
|
let t = s.text.slice(0, e), n = Je(s, t);
|
|
6416
6417
|
R({
|
|
@@ -6419,10 +6420,10 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6419
6420
|
text: t,
|
|
6420
6421
|
measuredWidth: n,
|
|
6421
6422
|
...q(s, 0, t.length)
|
|
6422
|
-
}, n,
|
|
6423
|
+
}, n, C, T, E), at(s, e);
|
|
6423
6424
|
}
|
|
6424
6425
|
} else {
|
|
6425
|
-
let e = it(s, L() +
|
|
6426
|
+
let e = it(s, L() + le - k);
|
|
6426
6427
|
if (e > 0 && e < s.text.length) {
|
|
6427
6428
|
let t = s.text.slice(0, e), n = Je(s, t);
|
|
6428
6429
|
R({
|
|
@@ -6431,11 +6432,11 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6431
6432
|
text: t,
|
|
6432
6433
|
measuredWidth: n,
|
|
6433
6434
|
...q(s, 0, t.length)
|
|
6434
|
-
}, n,
|
|
6435
|
+
}, n, C, T, E), at(s, e);
|
|
6435
6436
|
continue;
|
|
6436
6437
|
}
|
|
6437
6438
|
if (s.joinPrev) {
|
|
6438
|
-
let e = L() -
|
|
6439
|
+
let e = L() - k, t = rt(s, e, !0);
|
|
6439
6440
|
if ((e > 0 || s.hardJoinPrev === !0) && t > 0 && t < s.text.length) {
|
|
6440
6441
|
let e = s.text.slice(0, t), n = Je(s, e);
|
|
6441
6442
|
R({
|
|
@@ -6444,17 +6445,17 @@ function Kc(e, t, n, r, i, a = [], c, l = {}, u = 0, d = y, f = void 0, p = 36,
|
|
|
6444
6445
|
text: e,
|
|
6445
6446
|
measuredWidth: n,
|
|
6446
6447
|
...q(s, 0, e.length)
|
|
6447
|
-
}, n,
|
|
6448
|
+
}, n, C, T, E), at(s, t);
|
|
6448
6449
|
continue;
|
|
6449
6450
|
}
|
|
6450
|
-
s.measuredWidth = v, R(s, v,
|
|
6451
|
+
s.measuredWidth = v, R(s, v, C, T, E, F);
|
|
6451
6452
|
continue;
|
|
6452
6453
|
}
|
|
6453
6454
|
De(void 0, !1, s.src), z.unshift(s);
|
|
6454
6455
|
}
|
|
6455
6456
|
}
|
|
6456
|
-
if (
|
|
6457
|
-
return
|
|
6457
|
+
if (D.length > 0 ? De() : nt !== null && De(nt), v === "bounded") for (let e of E) for (let t of e.segments) !("text" in t) || t.metricOnly || t.text.length === 0 || (t.shapedClusters = void 0, t.textLayoutService && t.textShapeRequest && Re(t, !0));
|
|
6458
|
+
return E;
|
|
6458
6459
|
}
|
|
6459
6460
|
//#endregion
|
|
6460
6461
|
//#region packages/docx/src/bidi-line.ts
|
|
@@ -6466,7 +6467,7 @@ function Zc(e) {
|
|
|
6466
6467
|
for (let t of e) {
|
|
6467
6468
|
if (Jc(t)) return !0;
|
|
6468
6469
|
let e = qc(t);
|
|
6469
|
-
if (e !== void 0 &&
|
|
6470
|
+
if (e !== void 0 && re(e)) return !0;
|
|
6470
6471
|
}
|
|
6471
6472
|
return !1;
|
|
6472
6473
|
}
|
|
@@ -6492,7 +6493,7 @@ function Qc(e, n) {
|
|
|
6492
6493
|
}
|
|
6493
6494
|
}
|
|
6494
6495
|
if (s) for (; s.length < i.length;) s.push(null);
|
|
6495
|
-
let { levels: l, paragraphLevel: u } =
|
|
6496
|
+
let { levels: l, paragraphLevel: u } = t().computeLevels(i, n ? "rtl" : "ltr", s), d = Array(r), f = Array(r);
|
|
6496
6497
|
for (let e = 0; e < r; e++) {
|
|
6497
6498
|
let t = o[e];
|
|
6498
6499
|
for (; t > a[e] && i[t - 1] === " ";) t--;
|
|
@@ -6513,9 +6514,9 @@ function Qc(e, n) {
|
|
|
6513
6514
|
}
|
|
6514
6515
|
}
|
|
6515
6516
|
}
|
|
6516
|
-
let { order:
|
|
6517
|
+
let { order: m } = p(l, u, f);
|
|
6517
6518
|
return {
|
|
6518
|
-
order:
|
|
6519
|
+
order: m,
|
|
6519
6520
|
rtl: d
|
|
6520
6521
|
};
|
|
6521
6522
|
}
|
|
@@ -6715,7 +6716,7 @@ function dl(e, t, n) {
|
|
|
6715
6716
|
return t.find((t) => ls(e, t)) ?? ji(e, [...t], n);
|
|
6716
6717
|
}
|
|
6717
6718
|
function fl(e, t, n, r, i = !0) {
|
|
6718
|
-
let a = e.picBulletImagePath ? "" :
|
|
6719
|
+
let a = e.picBulletImagePath ? "" : Me(e.text, e.fontFamily ?? null), o = a ? ul(t, a, 1, r, i)?.shape ?? null : null, s = e.picBulletImagePath ? e.picBulletWidthPt ?? t.fontSizePt : o?.advancePt ?? 0, c = e.jc === "right" ? -s : e.jc === "center" ? -s / 2 : 0, l = n.authoredFirstIndentPt + c + s, u = e.suff || "tab", d = l;
|
|
6719
6720
|
if (u === "space") d += ul(t, " ", 1, r, i)?.shape.advancePt ?? 0;
|
|
6720
6721
|
else if (u === "tab" && (d = 0, l > 0)) {
|
|
6721
6722
|
let e = dl(n.physicalIndentLeftPt + l, n.tabStops, n.defaultTabPt);
|
|
@@ -7107,7 +7108,7 @@ function jl(e, t, n, r, i, a) {
|
|
|
7107
7108
|
clusterGeometry: !0
|
|
7108
7109
|
}).clusters : void 0, t = e?.length ? null : [...new Set([
|
|
7109
7110
|
0,
|
|
7110
|
-
...
|
|
7111
|
+
...te(f),
|
|
7111
7112
|
f.length
|
|
7112
7113
|
])].sort((e, t) => e - t), n = e?.map((e) => ({
|
|
7113
7114
|
start: e.range.start,
|
|
@@ -7175,7 +7176,7 @@ function Ml(e, t, n) {
|
|
|
7175
7176
|
}
|
|
7176
7177
|
let d = [
|
|
7177
7178
|
0,
|
|
7178
|
-
...
|
|
7179
|
+
...te(a),
|
|
7179
7180
|
a.length
|
|
7180
7181
|
], f = [];
|
|
7181
7182
|
for (let e = 1; e < d.length; e += 1) f.push({
|
|
@@ -7380,7 +7381,7 @@ function $l(e) {
|
|
|
7380
7381
|
}
|
|
7381
7382
|
function eu(e, t = { normalStyleFontSizePt: 10 }) {
|
|
7382
7383
|
return ql(e.body), {
|
|
7383
|
-
kinsoku:
|
|
7384
|
+
kinsoku: a(e.settings),
|
|
7384
7385
|
defaultTabPt: Vc(e.settings),
|
|
7385
7386
|
characterSpacingControl: e.settings?.characterSpacingControl,
|
|
7386
7387
|
mathDefJc: e.settings?.mathDefJc,
|
|
@@ -8904,7 +8905,7 @@ async function Tf(e, t, n, r, i) {
|
|
|
8904
8905
|
let a = async (n) => {
|
|
8905
8906
|
if (t) throw n instanceof Error ? n : /* @__PURE__ */ Error("2D canvas is unavailable for image color effects");
|
|
8906
8907
|
if (r) return null;
|
|
8907
|
-
let a =
|
|
8908
|
+
let a = Ye(e.width, e.height, i?.targetWidthPx, i?.targetHeightPx);
|
|
8908
8909
|
if (!a) return e;
|
|
8909
8910
|
if (typeof createImageBitmap > "u") throw Error("createImageBitmap is unavailable for duotone fallback resampling");
|
|
8910
8911
|
return createImageBitmap(e, a);
|
|
@@ -8925,27 +8926,27 @@ async function Tf(e, t, n, r, i) {
|
|
|
8925
8926
|
return a(e);
|
|
8926
8927
|
}
|
|
8927
8928
|
if (t && wf(c, t), n) try {
|
|
8928
|
-
|
|
8929
|
+
D(c, n.clr1, n.clr2);
|
|
8929
8930
|
} catch {
|
|
8930
8931
|
if (r) return null;
|
|
8931
8932
|
}
|
|
8932
8933
|
s.putImageData(c, 0, 0);
|
|
8933
|
-
let l =
|
|
8934
|
+
let l = Ye(e.width, e.height, i?.targetWidthPx, i?.targetHeightPx);
|
|
8934
8935
|
return l ? createImageBitmap(o, l) : createImageBitmap(o);
|
|
8935
8936
|
}
|
|
8936
8937
|
async function Ef(e, t, n, r, i = 0, a = 0, o, s = !1, c, l, u) {
|
|
8937
|
-
let d = Math.floor(
|
|
8938
|
+
let d = Math.floor(Ge / (n || o ? 4 : 1)), f = Number.isSafeInteger(u) && (u ?? 0) > 0 ? Math.min(d, u) : d, p = n || o ? me(r, Cf) : void 0, m = {
|
|
8938
8939
|
widthPt: i,
|
|
8939
8940
|
heightPt: a,
|
|
8940
8941
|
suppressBoundaryFrame: !0,
|
|
8941
8942
|
tiff: c,
|
|
8942
8943
|
maxRetainedPixels: f,
|
|
8943
8944
|
...l ?? {}
|
|
8944
|
-
}, h = await
|
|
8945
|
+
}, h = await N(e, t, r, { ...m });
|
|
8945
8946
|
if (!h) return null;
|
|
8946
8947
|
if (!n && !o) return h;
|
|
8947
|
-
let g = await
|
|
8948
|
-
return
|
|
8948
|
+
let g = await T(e, t, r, m, p, h), _ = Ye(h.width, h.height, l?.targetWidthPx, l?.targetHeightPx), v = _ ? `|resize:${_.resizeWidth}x${_.resizeHeight}` : "";
|
|
8949
|
+
return ue(Cf, `${xf(g, n, o)}${v}${s ? "|strict" : ""}`, r, async () => {
|
|
8949
8950
|
let e = await Tf(h, n, o, s, l);
|
|
8950
8951
|
return {
|
|
8951
8952
|
bitmap: e,
|
|
@@ -8967,7 +8968,7 @@ function Df(e, t, n) {
|
|
|
8967
8968
|
for (let e of a) {
|
|
8968
8969
|
let t = i.get(`${e.kind}:${e.resourceKey}`);
|
|
8969
8970
|
if (!t) continue;
|
|
8970
|
-
let a =
|
|
8971
|
+
let a = Ve(e.mimeType, e.srcRect, t.widthPt, t.heightPt);
|
|
8971
8972
|
if (!a) continue;
|
|
8972
8973
|
let o = {
|
|
8973
8974
|
imagePath: e.partPath,
|
|
@@ -8978,7 +8979,7 @@ function Df(e, t, n) {
|
|
|
8978
8979
|
widthPt: a.widthPt,
|
|
8979
8980
|
heightPt: a.heightPt,
|
|
8980
8981
|
hasCrop: e.srcRect != null
|
|
8981
|
-
}, s = n === void 0 ? null :
|
|
8982
|
+
}, s = n === void 0 ? null : z(t.widthPt * n, t.heightPt * n, e.srcRect);
|
|
8982
8983
|
s && (o.targetWidthPx = s.width, o.targetHeightPx = s.height);
|
|
8983
8984
|
let c = Sf(o), l = r.get(c);
|
|
8984
8985
|
l ? (l.widthPt = Math.max(l.widthPt, o.widthPt), l.heightPt = Math.max(l.heightPt, o.heightPt), l.hasCrop ||= o.hasCrop, l.targetWidthPx = Math.max(l.targetWidthPx ?? 0, o.targetWidthPx ?? 0) || void 0, l.targetHeightPx = Math.max(l.targetHeightPx ?? 0, o.targetHeightPx ?? 0) || void 0) : r.set(c, o);
|
|
@@ -8996,16 +8997,16 @@ function Df(e, t, n) {
|
|
|
8996
8997
|
heightPt: e.heightPt,
|
|
8997
8998
|
targetWidthPx: n === void 0 ? void 0 : e.widthPt * n,
|
|
8998
8999
|
targetHeightPx: n === void 0 ? void 0 : e.heightPt * n
|
|
8999
|
-
}, a =
|
|
9000
|
+
}, a = Fe(t.model).map((e) => ({
|
|
9000
9001
|
usage: e,
|
|
9001
|
-
size:
|
|
9002
|
+
size: Ie(e, i)
|
|
9002
9003
|
}));
|
|
9003
9004
|
if (!a.some(({ size: e }) => e === null)) for (let { usage: e, size: t } of a) {
|
|
9004
9005
|
if (!t) continue;
|
|
9005
|
-
let n = e.fill, i =
|
|
9006
|
+
let n = e.fill, i = Ve(n.mimeType, n.srcRect, t.widthPt, t.heightPt);
|
|
9006
9007
|
if (!i) continue;
|
|
9007
9008
|
let a = {
|
|
9008
|
-
cacheKey:
|
|
9009
|
+
cacheKey: Ue(n),
|
|
9009
9010
|
imagePath: n.imagePath,
|
|
9010
9011
|
mimeType: n.mimeType,
|
|
9011
9012
|
...n.svgImagePath === void 0 ? {} : { svgImagePath: n.svgImagePath },
|
|
@@ -9026,72 +9027,72 @@ function Df(e, t, n) {
|
|
|
9026
9027
|
}
|
|
9027
9028
|
return [...r.values()];
|
|
9028
9029
|
}
|
|
9029
|
-
async function Of(e, t, n, r,
|
|
9030
|
+
async function Of(e, t, n, r, a, o, s) {
|
|
9030
9031
|
if (!n) return /* @__PURE__ */ new Map();
|
|
9031
|
-
let
|
|
9032
|
+
let c = be(s), l = (e, t) => o ? I(e, n, {
|
|
9032
9033
|
targetWidthPx: t.targetWidthPx,
|
|
9033
9034
|
targetHeightPx: t.targetHeightPx,
|
|
9034
9035
|
maxRetainedPixels: t.targetWidthPx && t.targetHeightPx ? t.targetWidthPx * t.targetHeightPx : void 0,
|
|
9035
9036
|
workerDecoder: o
|
|
9036
|
-
}) :
|
|
9037
|
+
}) : I(e, n), u = Df(e, t, a), d = k((await Promise.all(u.map(async (e) => {
|
|
9037
9038
|
if (!e.targetWidthPx || !e.targetHeightPx || e.colorReplaceFrom || e.duotone) return null;
|
|
9038
|
-
let t = e.mimeType === "image/svg+xml",
|
|
9039
|
+
let t = e.mimeType === "image/svg+xml", a = {
|
|
9039
9040
|
svgImagePath: e.svgImagePath,
|
|
9040
9041
|
srcRect: e.hasCrop || null
|
|
9041
9042
|
};
|
|
9042
|
-
if (t ||
|
|
9043
|
-
if (
|
|
9043
|
+
if (t || de(a)) return null;
|
|
9044
|
+
if (i(e.mimeType) && (c.resolution === "display" || c.strategy === "adaptive")) return {
|
|
9044
9045
|
key: Sf(e),
|
|
9045
9046
|
targetWidthPx: e.targetWidthPx,
|
|
9046
9047
|
targetHeightPx: e.targetHeightPx,
|
|
9047
9048
|
retainedSurfaceCount: 1
|
|
9048
9049
|
};
|
|
9049
|
-
let
|
|
9050
|
-
return !
|
|
9050
|
+
let o = await oe(e.imagePath, e.mimeType, n).catch(() => null);
|
|
9051
|
+
return !o?.dimensions || !_e(o.format, r !== void 0) ? null : {
|
|
9051
9052
|
key: Sf(e),
|
|
9052
9053
|
targetWidthPx: e.targetWidthPx,
|
|
9053
9054
|
targetHeightPx: e.targetHeightPx,
|
|
9054
|
-
sourceWidthPx:
|
|
9055
|
-
sourceHeightPx:
|
|
9055
|
+
sourceWidthPx: o.dimensions.width,
|
|
9056
|
+
sourceHeightPx: o.dimensions.height,
|
|
9056
9057
|
retainedSurfaceCount: 1
|
|
9057
9058
|
};
|
|
9058
|
-
}))).filter((e) => e !== null),
|
|
9059
|
-
for (let e of
|
|
9060
|
-
if (e.mimeType === "image/svg+xml" || !e.colorReplaceFrom && !e.duotone &&
|
|
9059
|
+
}))).filter((e) => e !== null), c);
|
|
9060
|
+
for (let e of u) {
|
|
9061
|
+
if (e.mimeType === "image/svg+xml" || !e.colorReplaceFrom && !e.duotone && de({
|
|
9061
9062
|
svgImagePath: e.svgImagePath,
|
|
9062
9063
|
srcRect: e.hasCrop || null
|
|
9063
9064
|
})) continue;
|
|
9064
|
-
let t =
|
|
9065
|
+
let t = d.targets.get(Sf(e));
|
|
9065
9066
|
e.targetWidthPx = t?.width, e.targetHeightPx = t?.height, e.plannedPixelLimit = t?.maxRetainedPixels;
|
|
9066
9067
|
}
|
|
9067
|
-
let
|
|
9068
|
+
let f = await Promise.all(u.map(async (e) => {
|
|
9068
9069
|
try {
|
|
9069
9070
|
let t = e.mimeType === "image/svg+xml", i = {
|
|
9070
9071
|
svgImagePath: e.svgImagePath,
|
|
9071
9072
|
srcRect: e.hasCrop || null
|
|
9072
9073
|
}, a;
|
|
9073
|
-
if (
|
|
9074
|
-
a = await
|
|
9074
|
+
if (de(i)) try {
|
|
9075
|
+
a = await l(i.svgImagePath, e);
|
|
9075
9076
|
} catch (i) {
|
|
9076
|
-
let o = t ? await
|
|
9077
|
+
let o = t ? await l(e.imagePath, e) : await Ef(e.imagePath, e.mimeType, e.colorReplaceFrom, n, e.widthPt, e.heightPt, e.duotone, e.failClosedOnDuotoneFailure ?? !1, r, e.targetWidthPx && e.targetHeightPx ? {
|
|
9077
9078
|
targetWidthPx: e.targetWidthPx,
|
|
9078
9079
|
targetHeightPx: e.targetHeightPx
|
|
9079
9080
|
} : void 0, e.plannedPixelLimit);
|
|
9080
9081
|
if (!o) throw i;
|
|
9081
9082
|
a = o;
|
|
9082
9083
|
}
|
|
9083
|
-
else a = t ? await
|
|
9084
|
+
else a = t ? await l(e.imagePath, e) : await Ef(e.imagePath, e.mimeType, e.colorReplaceFrom, n, e.widthPt, e.heightPt, e.duotone, e.failClosedOnDuotoneFailure ?? !1, r, e.targetWidthPx && e.targetHeightPx ? {
|
|
9084
9085
|
targetWidthPx: e.targetWidthPx,
|
|
9085
9086
|
targetHeightPx: e.targetHeightPx
|
|
9086
9087
|
} : void 0, e.plannedPixelLimit);
|
|
9087
9088
|
return a == null ? null : [Sf(e), a];
|
|
9088
9089
|
} catch (t) {
|
|
9089
|
-
if (
|
|
9090
|
+
if (ye(t, "tiff")) return [Sf(e), t];
|
|
9090
9091
|
throw t;
|
|
9091
9092
|
}
|
|
9092
|
-
})),
|
|
9093
|
-
for (let e of
|
|
9094
|
-
return
|
|
9093
|
+
})), p = /* @__PURE__ */ new Map();
|
|
9094
|
+
for (let e of f) e && p.set(e[0], e[1]);
|
|
9095
|
+
return p;
|
|
9095
9096
|
}
|
|
9096
9097
|
//#endregion
|
|
9097
9098
|
//#region packages/docx/src/paint/column-separator-raster.ts
|
|
@@ -9197,7 +9198,7 @@ function Nf(e, t) {
|
|
|
9197
9198
|
continue;
|
|
9198
9199
|
}
|
|
9199
9200
|
if (n.kind === "watermark-text") {
|
|
9200
|
-
let e =
|
|
9201
|
+
let e = He(n.fill, t.ctx, n.rect.xPt, n.rect.yPt, n.rect.widthPt, n.rect.heightPt);
|
|
9201
9202
|
if (e === null) continue;
|
|
9202
9203
|
t.ctx.save();
|
|
9203
9204
|
let r = n.rect.xPt + n.rect.widthPt / 2, i = n.rect.yPt + n.rect.heightPt / 2;
|
|
@@ -9288,16 +9289,16 @@ function If(e, t, n) {
|
|
|
9288
9289
|
function Lf(e) {
|
|
9289
9290
|
return 1 / e.dpr;
|
|
9290
9291
|
}
|
|
9291
|
-
function Rf(t, n
|
|
9292
|
-
let
|
|
9293
|
-
...
|
|
9294
|
-
widthPt:
|
|
9295
|
-
...typeof
|
|
9296
|
-
} :
|
|
9297
|
-
|
|
9298
|
-
let
|
|
9299
|
-
if (
|
|
9300
|
-
|
|
9292
|
+
function Rf(e, t, n = 0) {
|
|
9293
|
+
let r = n / t.scale, i = r > e.widthPt ? {
|
|
9294
|
+
...e,
|
|
9295
|
+
widthPt: r,
|
|
9296
|
+
...typeof e.authoredStyle == "string" ? { dashPatternPt: Object.freeze(We(e.authoredStyle, r)) } : {}
|
|
9297
|
+
} : e, { ctx: a } = t;
|
|
9298
|
+
a.strokeStyle = i.color, a.lineWidth = i.widthPt, a.setLineDash("dashPatternPt" in i && i.dashPatternPt ? [...i.dashPatternPt] : []), a.beginPath();
|
|
9299
|
+
let o = "path" in i && i.path?.length ? i.path : [i.from, i.to], s = o.length === 2 && (o[0].xPt === o[1].xPt || o[0].yPt === o[1].yPt), c = s && o[0].yPt === o[1].yPt, l = s && o[0].xPt === o[1].xPt, u = t.pointToCss ?? Vd(t.scale), d = o.map((e) => Wd(u, e)), f = s ? o[1].xPt - o[0].xPt : 0, p = s ? o[1].yPt - o[0].yPt : 0, m = u.a * f + u.c * p, h = u.b * f + u.d * p, g = s && h === 0, _ = s && m === 0, v = c ? Math.hypot(u.c, u.d) : l ? Math.hypot(u.a, u.b) : 0, y = i.style === "compound" && s && v > 0 ? Pf(i.authoredStyle, i.widthPt * v, t.dpr) : null;
|
|
9300
|
+
if (y) {
|
|
9301
|
+
a.fillStyle = i.color;
|
|
9301
9302
|
let e = (e, t, n, r) => {
|
|
9302
9303
|
let i = [
|
|
9303
9304
|
{
|
|
@@ -9316,25 +9317,25 @@ function Rf(t, n, r = 0) {
|
|
|
9316
9317
|
xPt: e + n,
|
|
9317
9318
|
yPt: t + r
|
|
9318
9319
|
}
|
|
9319
|
-
].map((e) => Gd(
|
|
9320
|
+
].map((e) => Gd(u, e));
|
|
9320
9321
|
if (i.some((e) => e === null)) return;
|
|
9321
|
-
let
|
|
9322
|
-
|
|
9323
|
-
},
|
|
9324
|
-
for (let r of
|
|
9325
|
-
let i = (
|
|
9326
|
-
if (
|
|
9327
|
-
else if (
|
|
9322
|
+
let o = i.filter((e) => e !== null), s = o.map((e) => e.xPt), c = o.map((e) => e.yPt);
|
|
9323
|
+
a.fillRect(Math.min(...s), Math.min(...c), Math.max(...s) - Math.min(...s), Math.max(...c) - Math.min(...c));
|
|
9324
|
+
}, n = Math.round((g ? d[0].yPt : d[0].xPt) * t.dpr - y.spanDev / 2);
|
|
9325
|
+
for (let r of y.bands) {
|
|
9326
|
+
let i = (n + r.offsetDev) / t.dpr, s = r.widthDev / t.dpr;
|
|
9327
|
+
if (g) e(Math.min(d[0].xPt, d[1].xPt), i, Math.abs(m), s);
|
|
9328
|
+
else if (_) e(i, Math.min(d[0].yPt, d[1].yPt), s, Math.abs(h));
|
|
9328
9329
|
else {
|
|
9329
|
-
let e = (r.offsetDev -
|
|
9330
|
-
|
|
9330
|
+
let e = (r.offsetDev - y.spanDev / 2) / t.dpr / v, n = r.widthDev / t.dpr / v;
|
|
9331
|
+
c ? a.fillRect(Math.min(o[0].xPt, o[1].xPt), o[0].yPt + e, Math.abs(o[1].xPt - o[0].xPt), n) : a.fillRect(o[0].xPt + e, Math.min(o[0].yPt, o[1].yPt), n, Math.abs(o[1].yPt - o[0].yPt));
|
|
9331
9332
|
}
|
|
9332
9333
|
}
|
|
9333
|
-
|
|
9334
|
+
a.setLineDash([]);
|
|
9334
9335
|
return;
|
|
9335
9336
|
}
|
|
9336
|
-
if (
|
|
9337
|
-
if (
|
|
9337
|
+
if (i.style === "double" && s && v > 0) {
|
|
9338
|
+
if (a.fillStyle = i.color, g || _) {
|
|
9338
9339
|
let e = (e, t, n, r) => {
|
|
9339
9340
|
let i = [
|
|
9340
9341
|
{
|
|
@@ -9353,48 +9354,48 @@ function Rf(t, n, r = 0) {
|
|
|
9353
9354
|
xPt: e + n,
|
|
9354
9355
|
yPt: t + r
|
|
9355
9356
|
}
|
|
9356
|
-
].map((e) => Gd(
|
|
9357
|
+
].map((e) => Gd(u, e));
|
|
9357
9358
|
if (i.some((e) => e === null)) return;
|
|
9358
|
-
let
|
|
9359
|
-
|
|
9360
|
-
}, { railDev:
|
|
9361
|
-
if (
|
|
9362
|
-
let
|
|
9363
|
-
e(
|
|
9359
|
+
let o = i.filter((e) => e !== null), s = o.map((e) => e.xPt), c = o.map((e) => e.yPt);
|
|
9360
|
+
a.fillRect(Math.min(...s), Math.min(...c), Math.max(...s) - Math.min(...s), Math.max(...c) - Math.min(...c));
|
|
9361
|
+
}, { railDev: n, gapDev: r, spanDev: o } = Ae(i.widthPt * v, t.dpr), s = n / t.dpr;
|
|
9362
|
+
if (g) {
|
|
9363
|
+
let i = Math.round(d[0].yPt * t.dpr - o / 2), a = Math.min(d[0].xPt, d[1].xPt), c = Math.abs(d[1].xPt - d[0].xPt);
|
|
9364
|
+
e(a, i / t.dpr, c, s), e(a, (i + n + r) / t.dpr, c, s);
|
|
9364
9365
|
} else {
|
|
9365
|
-
let
|
|
9366
|
-
e(
|
|
9366
|
+
let i = Math.round(d[0].xPt * t.dpr - o / 2), a = Math.min(d[0].yPt, d[1].yPt), c = Math.abs(d[1].yPt - d[0].yPt);
|
|
9367
|
+
e(i / t.dpr, a, s, c), e((i + n + r) / t.dpr, a, s, c);
|
|
9367
9368
|
}
|
|
9368
9369
|
} else {
|
|
9369
|
-
let { railDev: e, gapDev:
|
|
9370
|
-
if (
|
|
9371
|
-
let e = Math.min(
|
|
9372
|
-
|
|
9370
|
+
let { railDev: e, gapDev: n, spanDev: r } = Ae(i.widthPt * v, t.dpr), s = e / t.dpr / v, l = n / t.dpr / v, u = r / t.dpr / v;
|
|
9371
|
+
if (c) {
|
|
9372
|
+
let e = Math.min(o[0].xPt, o[1].xPt), t = Math.abs(o[1].xPt - o[0].xPt);
|
|
9373
|
+
a.fillRect(e, o[0].yPt - u / 2, t, s), a.fillRect(e, o[0].yPt - u / 2 + s + l, t, s);
|
|
9373
9374
|
} else {
|
|
9374
|
-
let e = Math.min(
|
|
9375
|
-
|
|
9375
|
+
let e = Math.min(o[0].yPt, o[1].yPt), t = Math.abs(o[1].yPt - o[0].yPt);
|
|
9376
|
+
a.fillRect(o[0].xPt - u / 2, e, s, t), a.fillRect(o[0].xPt - u / 2 + s + l, e, s, t);
|
|
9376
9377
|
}
|
|
9377
9378
|
}
|
|
9378
|
-
|
|
9379
|
+
a.setLineDash([]);
|
|
9379
9380
|
return;
|
|
9380
9381
|
}
|
|
9381
|
-
let
|
|
9382
|
-
xPt:
|
|
9382
|
+
let b = Kd(u, _ && v > 0 ? {
|
|
9383
|
+
xPt: C(d[0].xPt, i.widthPt * v, t.dpr),
|
|
9383
9384
|
yPt: 0
|
|
9384
|
-
} :
|
|
9385
|
+
} : g && v > 0 ? {
|
|
9385
9386
|
xPt: 0,
|
|
9386
|
-
yPt:
|
|
9387
|
+
yPt: C(d[0].yPt, i.widthPt * v, t.dpr)
|
|
9387
9388
|
} : {
|
|
9388
9389
|
xPt: 0,
|
|
9389
9390
|
yPt: 0
|
|
9390
9391
|
}) ?? {
|
|
9391
9392
|
xPt: 0,
|
|
9392
9393
|
yPt: 0
|
|
9393
|
-
},
|
|
9394
|
-
|
|
9395
|
-
for (let e of
|
|
9396
|
-
let
|
|
9397
|
-
|
|
9394
|
+
}, x = o[0];
|
|
9395
|
+
a.moveTo(x.xPt + b.xPt, x.yPt + b.yPt);
|
|
9396
|
+
for (let e of o.slice(1)) a.lineTo(e.xPt + b.xPt, e.yPt + b.yPt);
|
|
9397
|
+
let S = i.style === "wavy" && o.length > 2;
|
|
9398
|
+
S && (a.save(), a.lineJoin = "bevel"), a.stroke(), S && a.restore(), a.setLineDash([]);
|
|
9398
9399
|
}
|
|
9399
9400
|
//#endregion
|
|
9400
9401
|
//#region packages/docx/src/paint/deferred-paint-frame.ts
|
|
@@ -9593,7 +9594,7 @@ function Yf(e) {
|
|
|
9593
9594
|
if (r !== "" && !/^\s+$/u.test(r)) throw Error(`Retained glyph slices are incomplete (paint end ${n}/${e.range.end})`);
|
|
9594
9595
|
}
|
|
9595
9596
|
function Xf(e, t) {
|
|
9596
|
-
return e.kind === "explicit" ? e.color : e.kind === "auto" ?
|
|
9597
|
+
return e.kind === "explicit" ? e.color : e.kind === "auto" ? Le(e.background ?? "#FFFFFF") : t.defaultTextColor ?? "#000000";
|
|
9597
9598
|
}
|
|
9598
9599
|
function Zf(e, t) {
|
|
9599
9600
|
return Xf(e.color, t);
|
|
@@ -9687,7 +9688,7 @@ function rp(e, t) {
|
|
|
9687
9688
|
if (t.glyphOrientation === "upright") {
|
|
9688
9689
|
n.save(), n.translate(r, i), n.rotate(-Math.PI / 2), (t.scaleX !== 1 || t.scaleY !== void 0) && (t.writingMode === "vertical-rl" ? n.scale(1, t.scaleX) : n.scale(t.scaleX, t.scaleY ?? 1)), n.textAlign = "center", n.textBaseline = "middle", n.letterSpacing = `${t.letterSpacingPt}px`;
|
|
9689
9690
|
let e = () => n.fillText(t.text, a, o);
|
|
9690
|
-
t.verticalFeature ?
|
|
9691
|
+
t.verticalFeature ? ce(n, e) : e(), n.restore();
|
|
9691
9692
|
} else t.glyphOrientation === "rotate" ? (n.save(), n.translate(r, i), t.scaleX !== 1 && n.scale(t.scaleX, 1), n.textAlign = "center", n.textBaseline = "middle", n.letterSpacing = `${t.letterSpacingPt / t.scaleX}px`, n.fillText(t.text, a, o), n.restore()) : t.scaleX === 1 ? (n.letterSpacing = `${t.letterSpacingPt}px`, n.fillText(t.text, r + a, i + o)) : (n.save(), n.translate(r + a, i + o), n.scale(t.scaleX, 1), n.letterSpacing = `${t.letterSpacingPt / t.scaleX}px`, n.fillText(t.text, 0, 0), n.restore());
|
|
9692
9693
|
}
|
|
9693
9694
|
if (n.letterSpacing = r, n.fontKerning = i, e.ruby) {
|
|
@@ -9970,7 +9971,7 @@ function Cp(e, t, n) {
|
|
|
9970
9971
|
let r = e.descriptor, i = Sp(e), a = vp(e.handle) ? e.handle.placeholder : void 0;
|
|
9971
9972
|
if (!i && !a) return;
|
|
9972
9973
|
let o = (e, o) => {
|
|
9973
|
-
i ?
|
|
9974
|
+
i ? ze(n, i, r.srcRect, e, o, t.widthPt, t.heightPt) : a === "tiff" && y(n, "tiff", {
|
|
9974
9975
|
x: e,
|
|
9975
9976
|
y: o,
|
|
9976
9977
|
width: t.widthPt,
|
|
@@ -9984,7 +9985,7 @@ function Cp(e, t, n) {
|
|
|
9984
9985
|
function wp(e, t, n) {
|
|
9985
9986
|
let r = Sp(e);
|
|
9986
9987
|
if (!r) {
|
|
9987
|
-
vp(e.handle) && e.handle.placeholder === "tiff" &&
|
|
9988
|
+
vp(e.handle) && e.handle.placeholder === "tiff" && y(n, "tiff", {
|
|
9988
9989
|
x: t.xPt,
|
|
9989
9990
|
y: t.yPt,
|
|
9990
9991
|
width: t.widthPt,
|
|
@@ -10000,7 +10001,7 @@ function Tp(e, t, n, r) {
|
|
|
10000
10001
|
Cp(e, t, n);
|
|
10001
10002
|
},
|
|
10002
10003
|
chart(i, a, o) {
|
|
10003
|
-
|
|
10004
|
+
Je(o, i.descriptor.model, {
|
|
10004
10005
|
x: a.xPt,
|
|
10005
10006
|
y: a.yPt,
|
|
10006
10007
|
w: a.widthPt,
|
|
@@ -10022,10 +10023,10 @@ function Op(e) {
|
|
|
10022
10023
|
function kp(e, t) {
|
|
10023
10024
|
return (t ?? e.geometry.widthPt * 1.3333333333333333) / e.geometry.widthPt;
|
|
10024
10025
|
}
|
|
10025
|
-
function Ap(
|
|
10026
|
-
if (
|
|
10027
|
-
let
|
|
10028
|
-
return
|
|
10026
|
+
function Ap(t) {
|
|
10027
|
+
if (e(t)) return t.ownerDocument ?? (typeof document > "u" ? null : document);
|
|
10028
|
+
let n = t.ownerDocument, r = n?.defaultView?.HTMLCanvasElement;
|
|
10029
|
+
return r && t instanceof r ? n : null;
|
|
10029
10030
|
}
|
|
10030
10031
|
function jp(e) {
|
|
10031
10032
|
return Ap(e) !== null;
|
|
@@ -10056,32 +10057,32 @@ async function Np(e, t, n, r) {
|
|
|
10056
10057
|
let t = s.get(e);
|
|
10057
10058
|
if (!t) throw Error(`Missing retained paint resource descriptor: ${e}`);
|
|
10058
10059
|
return t;
|
|
10059
|
-
}) : r.registry.descriptors, l = c.some((e) => e.kind === "image" || e.kind === "picture-bullet" || e.kind === "chart" &&
|
|
10060
|
-
return r.fetchImage && l ?
|
|
10060
|
+
}) : r.registry.descriptors, l = c.some((e) => e.kind === "image" || e.kind === "picture-bullet" || e.kind === "chart" && Fe(e.model).length > 0), u = () => a() ? Promise.resolve() : Pp(e, t, n, r, c, a);
|
|
10061
|
+
return r.fetchImage && l ? he(r.fetchImage, r.imageResources, u) : u();
|
|
10061
10062
|
}
|
|
10062
|
-
async function Pp(e, t, n, r, i,
|
|
10063
|
-
let
|
|
10063
|
+
async function Pp(e, t, n, r, i, a) {
|
|
10064
|
+
let o;
|
|
10064
10065
|
try {
|
|
10065
|
-
let
|
|
10066
|
-
|
|
10067
|
-
let
|
|
10068
|
-
if (!
|
|
10069
|
-
let
|
|
10070
|
-
if (n.width =
|
|
10066
|
+
let s = r.dpr ?? g(), c = Mp(n, !r.parseError && t.layers.capabilities.requiresElementBackedVerticalGlyphPaint), l = c.canvas;
|
|
10067
|
+
o = c.release;
|
|
10068
|
+
let u = l.getContext("2d");
|
|
10069
|
+
if (!u) throw Error("2D canvas is unavailable for DOCX paint");
|
|
10070
|
+
let d = kp(t, r.width), f = t.geometry.widthPt * d, p = t.geometry.heightPt * d, m = qe(f * s, p * s), h = m.clamped ? s * m.scale : s;
|
|
10071
|
+
if (n.width = m.width, n.height = m.height, l !== n && (l.width = m.width, l.height = m.height), jp(n) && (n.style.width = `${f}px`, n.style.height = `${p}px`, n.style.display || (n.style.display = "block")), jp(l) && l !== n && (l.style.width = `${f}px`, l.style.height = `${p}px`), u.scale(h, h), u.fillStyle = "#ffffff", u.fillRect(0, 0, f, p), r.parseError) {
|
|
10071
10072
|
await hp(e, 0, n, {
|
|
10072
|
-
scale:
|
|
10073
|
-
dpr:
|
|
10073
|
+
scale: d,
|
|
10074
|
+
dpr: h
|
|
10074
10075
|
});
|
|
10075
10076
|
return;
|
|
10076
10077
|
}
|
|
10077
10078
|
let _;
|
|
10078
10079
|
try {
|
|
10079
|
-
_ = await Of(i, r.rasterPaintOccurrences, r.fetchImage, r.tiff,
|
|
10080
|
+
_ = await Of(i, r.rasterPaintOccurrences, r.fetchImage, r.tiff, d * h, r.svgDecoder, r.imageResources);
|
|
10080
10081
|
} catch (e) {
|
|
10081
|
-
if (
|
|
10082
|
+
if (a()) return;
|
|
10082
10083
|
throw e;
|
|
10083
10084
|
}
|
|
10084
|
-
if (
|
|
10085
|
+
if (a()) return;
|
|
10085
10086
|
let v = /* @__PURE__ */ new Map();
|
|
10086
10087
|
if (r.fetchImage) {
|
|
10087
10088
|
let e = r.fetchImage, t = /* @__PURE__ */ new Map();
|
|
@@ -10096,11 +10097,11 @@ async function Pp(e, t, n, r, i, o) {
|
|
|
10096
10097
|
let t = {
|
|
10097
10098
|
widthPt: r.widthPt,
|
|
10098
10099
|
heightPt: r.heightPt,
|
|
10099
|
-
targetWidthPx: r.widthPt *
|
|
10100
|
-
targetHeightPx: r.heightPt *
|
|
10100
|
+
targetWidthPx: r.widthPt * d * h,
|
|
10101
|
+
targetHeightPx: r.heightPt * d * h
|
|
10101
10102
|
}, i = [], a = !0;
|
|
10102
|
-
for (let n of
|
|
10103
|
-
let e =
|
|
10103
|
+
for (let n of Fe(e.model)) {
|
|
10104
|
+
let e = Ie(n, t);
|
|
10104
10105
|
if (!e) {
|
|
10105
10106
|
a = !1;
|
|
10106
10107
|
break;
|
|
@@ -10116,10 +10117,10 @@ async function Pp(e, t, n, r, i, o) {
|
|
|
10116
10117
|
usages: i
|
|
10117
10118
|
});
|
|
10118
10119
|
}
|
|
10119
|
-
let
|
|
10120
|
-
for (let e of
|
|
10121
|
-
let { fill: t } = e, n =
|
|
10122
|
-
|
|
10120
|
+
let a = /* @__PURE__ */ new Map();
|
|
10121
|
+
for (let e of Be(n.map(({ descriptor: e }) => e.model), (e, t) => Ie(e, n[t].frame) != null)) {
|
|
10122
|
+
let { fill: t } = e, n = Ue(t);
|
|
10123
|
+
a.has(n) || a.set(n, {
|
|
10123
10124
|
fill: t,
|
|
10124
10125
|
widthPt: 0,
|
|
10125
10126
|
heightPt: 0,
|
|
@@ -10128,84 +10129,84 @@ async function Pp(e, t, n, r, i, o) {
|
|
|
10128
10129
|
});
|
|
10129
10130
|
}
|
|
10130
10131
|
for (let { usages: e } of n) for (let { usage: t, size: n } of e) {
|
|
10131
|
-
let { fill: e } = t, r =
|
|
10132
|
+
let { fill: e } = t, r = Ue(e), i = a.get(r);
|
|
10132
10133
|
if (!i) continue;
|
|
10133
|
-
let
|
|
10134
|
-
|
|
10134
|
+
let o = i.preserveNaturalSize || t.preserveNaturalSize;
|
|
10135
|
+
a.set(r, {
|
|
10135
10136
|
...i,
|
|
10136
10137
|
widthPt: Math.max(i.widthPt, n.widthPt),
|
|
10137
10138
|
heightPt: Math.max(i.heightPt, n.heightPt),
|
|
10138
|
-
targetWidthPx:
|
|
10139
|
-
targetHeightPx:
|
|
10140
|
-
preserveNaturalSize:
|
|
10139
|
+
targetWidthPx: o ? void 0 : Math.max(i.targetWidthPx ?? 0, n.targetWidthPx ?? 0) || void 0,
|
|
10140
|
+
targetHeightPx: o ? void 0 : Math.max(i.targetHeightPx ?? 0, n.targetHeightPx ?? 0) || void 0,
|
|
10141
|
+
preserveNaturalSize: o,
|
|
10141
10142
|
hasSourceCrop: i.hasSourceCrop || t.hasSourceCrop
|
|
10142
10143
|
});
|
|
10143
10144
|
}
|
|
10144
|
-
await Promise.all([...
|
|
10145
|
+
await Promise.all([...a].map(async ([t, n]) => {
|
|
10145
10146
|
if (_.has(t)) {
|
|
10146
10147
|
let e = _.get(t);
|
|
10147
|
-
v.set(t,
|
|
10148
|
+
v.set(t, ye(e, "tiff") ? null : e ?? null);
|
|
10148
10149
|
return;
|
|
10149
10150
|
}
|
|
10150
|
-
let { fill: i, widthPt:
|
|
10151
|
-
targetWidthPx:
|
|
10152
|
-
targetHeightPx:
|
|
10151
|
+
let { fill: i, widthPt: a, heightPt: o, targetWidthPx: s, targetHeightPx: c, hasSourceCrop: l } = n, u = s && c ? {
|
|
10152
|
+
targetWidthPx: s,
|
|
10153
|
+
targetHeightPx: c
|
|
10153
10154
|
} : void 0;
|
|
10154
10155
|
try {
|
|
10155
|
-
let n = (t) => r.svgDecoder ?
|
|
10156
|
-
...
|
|
10156
|
+
let n = (t) => r.svgDecoder ? I(t, e, {
|
|
10157
|
+
...u ?? {},
|
|
10157
10158
|
workerDecoder: r.svgDecoder
|
|
10158
|
-
}) :
|
|
10159
|
+
}) : I(t, e), s = () => i.mimeType === "image/svg+xml" ? i.duotone ? Promise.resolve(null) : n(i.imagePath) : Ef(i.imagePath, i.mimeType, void 0, e, a, o, i.duotone, !0, r.tiff, u), c, d = {
|
|
10159
10160
|
svgImagePath: i.svgImagePath,
|
|
10160
|
-
srcRect:
|
|
10161
|
+
srcRect: l ? !0 : null
|
|
10161
10162
|
};
|
|
10162
|
-
if (!i.duotone &&
|
|
10163
|
-
c = await n(
|
|
10163
|
+
if (!i.duotone && de(d)) try {
|
|
10164
|
+
c = await n(d.svgImagePath);
|
|
10164
10165
|
} catch {
|
|
10165
|
-
c = await
|
|
10166
|
+
c = await s();
|
|
10166
10167
|
}
|
|
10167
|
-
else c = await
|
|
10168
|
+
else c = await s();
|
|
10168
10169
|
v.set(t, c);
|
|
10169
10170
|
} catch (e) {
|
|
10170
|
-
if (
|
|
10171
|
+
if (ye(e, "tiff")) {
|
|
10171
10172
|
v.set(t, null);
|
|
10172
10173
|
return;
|
|
10173
10174
|
}
|
|
10174
|
-
if (
|
|
10175
|
+
if (Ke(e) || Xe(e)) throw e;
|
|
10175
10176
|
v.set(t, null);
|
|
10176
10177
|
}
|
|
10177
10178
|
}));
|
|
10178
10179
|
}
|
|
10179
|
-
if (
|
|
10180
|
+
if (a()) return;
|
|
10180
10181
|
let y = cp(xp(r.registry, (e) => {
|
|
10181
10182
|
if (e.kind === "math") return r.privateResources?.keys.includes(e.resourceKey) ? r.privateResources.resolve(e.resourceKey) : _p("optional math renderer unavailable");
|
|
10182
10183
|
if (e.kind === "image" || e.kind === "picture-bullet") {
|
|
10183
10184
|
let t = _.get(xf(e.partPath, e.colorReplaceFrom, e.duotone));
|
|
10184
|
-
return
|
|
10185
|
+
return ye(t, "tiff") ? _p("optional TIFF codec unavailable", { placeholder: "tiff" }) : t ?? _p(r.fetchImage ? "unsupported image format produced no drawable output" : "image byte source unavailable");
|
|
10185
10186
|
}
|
|
10186
|
-
}), r.threeD || r.regionMap || r.chartEx || v.size > 0 ? Tp(r.threeD, r.regionMap, (e) => v.get(
|
|
10187
|
-
|
|
10187
|
+
}), r.threeD || r.regionMap || r.chartEx || v.size > 0 ? Tp(r.threeD, r.regionMap, (e) => v.get(Ue(e)), r.chartEx) : Ep);
|
|
10188
|
+
u.save();
|
|
10188
10189
|
try {
|
|
10189
|
-
|
|
10190
|
-
ctx:
|
|
10191
|
-
scale:
|
|
10192
|
-
dpr:
|
|
10190
|
+
u.scale(d, d), mp(t, {
|
|
10191
|
+
ctx: u,
|
|
10192
|
+
scale: d,
|
|
10193
|
+
dpr: h,
|
|
10193
10194
|
resources: y,
|
|
10194
10195
|
documentDefaultTextColor: r.defaultTextColor ?? "#000000",
|
|
10195
10196
|
defaultTextColor: r.defaultTextColor ?? "#000000"
|
|
10196
10197
|
});
|
|
10197
10198
|
} finally {
|
|
10198
|
-
|
|
10199
|
+
u.restore();
|
|
10199
10200
|
}
|
|
10200
|
-
if (
|
|
10201
|
-
if (
|
|
10201
|
+
if (l !== n) {
|
|
10202
|
+
if (a()) return;
|
|
10202
10203
|
let e = n.getContext("2d");
|
|
10203
10204
|
if (!e) throw Error("2D canvas is unavailable for DOCX paint projection");
|
|
10204
|
-
e.drawImage(
|
|
10205
|
+
e.drawImage(l, 0, 0);
|
|
10205
10206
|
}
|
|
10206
10207
|
if (r.onTextRun) for (let e of r.textRuns) r.onTextRun(e);
|
|
10207
10208
|
} finally {
|
|
10208
|
-
|
|
10209
|
+
o?.();
|
|
10209
10210
|
}
|
|
10210
10211
|
}
|
|
10211
10212
|
//#endregion
|
|
@@ -11425,7 +11426,7 @@ function Jm(e) {
|
|
|
11425
11426
|
//#endregion
|
|
11426
11427
|
//#region packages/docx/src/text-distribute.ts
|
|
11427
11428
|
function Ym(e, t, n, r, i = -Infinity, a = !0, o = !1) {
|
|
11428
|
-
return
|
|
11429
|
+
return Ne(e, t, {
|
|
11429
11430
|
firstContentSi: n,
|
|
11430
11431
|
lastDrawnSi: r,
|
|
11431
11432
|
minPerGap: i,
|
|
@@ -15373,7 +15374,7 @@ function Xg(e) {
|
|
|
15373
15374
|
mark: h.emphasis.mark,
|
|
15374
15375
|
scaleX: r.basePaintOps[0]?.scaleX ?? 1
|
|
15375
15376
|
})
|
|
15376
|
-
} : void 0, N = m ?? h?.base,
|
|
15377
|
+
} : void 0, N = m ?? h?.base, ee = N ? {
|
|
15377
15378
|
xPt: E,
|
|
15378
15379
|
yPt: t.baselinePt + k - N.ascentPt,
|
|
15379
15380
|
widthPt: s + w,
|
|
@@ -15383,7 +15384,7 @@ function Xg(e) {
|
|
|
15383
15384
|
yPt: t.topPt,
|
|
15384
15385
|
widthPt: s + w,
|
|
15385
15386
|
heightPt: t.advancePt
|
|
15386
|
-
},
|
|
15387
|
+
}, te = {
|
|
15387
15388
|
..._,
|
|
15388
15389
|
kind: "text",
|
|
15389
15390
|
origin: T,
|
|
@@ -15393,7 +15394,7 @@ function Xg(e) {
|
|
|
15393
15394
|
widthPt: s,
|
|
15394
15395
|
heightPt: t.advancePt
|
|
15395
15396
|
},
|
|
15396
|
-
highlightBounds:
|
|
15397
|
+
highlightBounds: ee,
|
|
15397
15398
|
advancePt: s,
|
|
15398
15399
|
clusters: y.clusters,
|
|
15399
15400
|
paintOps: x.map((e) => ({
|
|
@@ -15405,7 +15406,7 @@ function Xg(e) {
|
|
|
15405
15406
|
direction: b,
|
|
15406
15407
|
...w === 0 ? {} : { ownedTrailingSlackPt: w },
|
|
15407
15408
|
..._.highlight || _.background ? { highlightFragments: [{
|
|
15408
|
-
rect: _.highlight ?
|
|
15409
|
+
rect: _.highlight ? ee : {
|
|
15409
15410
|
xPt: E,
|
|
15410
15411
|
yPt: t.topPt,
|
|
15411
15412
|
widthPt: s + w,
|
|
@@ -15423,8 +15424,8 @@ function Xg(e) {
|
|
|
15423
15424
|
}
|
|
15424
15425
|
}))
|
|
15425
15426
|
} } : {}
|
|
15426
|
-
},
|
|
15427
|
-
b === "ltr" &&
|
|
15427
|
+
}, P = d === void 0 ? 0 : Math.max(0, s + w - d);
|
|
15428
|
+
b === "ltr" && P > 0 && O.set(D.length, P), D.push(te);
|
|
15428
15429
|
}
|
|
15429
15430
|
E += s, a?.trailingGap && (E += v);
|
|
15430
15431
|
}
|
|
@@ -15927,7 +15928,7 @@ function v_(e, t, n, r, i, a, o) {
|
|
|
15927
15928
|
};
|
|
15928
15929
|
}
|
|
15929
15930
|
function y_(e) {
|
|
15930
|
-
return e.kind === "explicit" ? e.color : e.kind === "auto" ?
|
|
15931
|
+
return e.kind === "explicit" ? e.color : e.kind === "auto" ? Le(e.background ?? "#FFFFFF") : "#000000";
|
|
15931
15932
|
}
|
|
15932
15933
|
function b_(e) {
|
|
15933
15934
|
return e.inkBounds ?? {
|
|
@@ -16772,8 +16773,8 @@ function G_(e, t, n, r, i, a, o, s, c, l) {
|
|
|
16772
16773
|
}
|
|
16773
16774
|
let j = H_(x, A);
|
|
16774
16775
|
if (g.allowOverlapStatus !== "valid" || g.allowOverlap === null || g.layoutInCellStatus !== "valid" || g.layoutInCell === null) throw Error("resolved anchor frame must retain overlap and cell behavior");
|
|
16775
|
-
let M = j.geometry.wrapBounds, N = !g.allowOverlap,
|
|
16776
|
-
if (N ||
|
|
16776
|
+
let M = j.geometry.wrapBounds, N = !g.allowOverlap, ee = g.allowOverlap && i.ordinaryFlow && M !== null;
|
|
16777
|
+
if (N || ee) {
|
|
16777
16778
|
let t = W_(j, "vertical", g.layoutInCell && i.anchorCellBounds !== void 0), n = l.filter((e) => !Zh(t, g.relativeHeight, e.relativeHeight)), r = (N ? [...c, ...n].filter((t) => t.occurrenceId !== e).map((e) => ({
|
|
16778
16779
|
occurrenceId: e.occurrenceId,
|
|
16779
16780
|
bounds: e.bounds
|
|
@@ -16851,7 +16852,7 @@ function G_(e, t, n, r, i, a, o, s, c, l) {
|
|
|
16851
16852
|
u && (D.push(u), O.push(l));
|
|
16852
16853
|
}
|
|
16853
16854
|
}
|
|
16854
|
-
let
|
|
16855
|
+
let te = {
|
|
16855
16856
|
kind: "drawing",
|
|
16856
16857
|
id: `${i.id}:anchor-drawing:${e}`,
|
|
16857
16858
|
source: $g(i.source, p.runIndex),
|
|
@@ -16876,15 +16877,15 @@ function G_(e, t, n, r, i, a, o, s, c, l) {
|
|
|
16876
16877
|
...g.layoutInCell && Kh(g.allowOverlap, j.geometry.wrap.kind) && i.anchorCellBounds ? { cellContainment: !0 } : {}
|
|
16877
16878
|
},
|
|
16878
16879
|
...O.length ? { textBoxIds: O } : {}
|
|
16879
|
-
},
|
|
16880
|
+
}, P = j.geometry.wrapBounds, ne = P && j.geometry.wrap.kind !== "none" ? {
|
|
16880
16881
|
id: `${i.id}:anchor-exclusion:${e}`,
|
|
16881
16882
|
wrap: j.geometry.wrap.kind,
|
|
16882
16883
|
...j.geometry.wrap.side ? { wrapSide: j.geometry.wrap.side } : {},
|
|
16883
|
-
bounds:
|
|
16884
|
-
polygon: j.geometry.wrap.polygon?.points ?? I_(
|
|
16884
|
+
bounds: P,
|
|
16885
|
+
polygon: j.geometry.wrap.polygon?.points ?? I_(P),
|
|
16885
16886
|
anchorOccurrenceId: e,
|
|
16886
16887
|
verticalOwnership: W_(j, "vertical", g.layoutInCell && i.anchorCellBounds !== void 0)
|
|
16887
|
-
} : void 0,
|
|
16888
|
+
} : void 0, F = {
|
|
16888
16889
|
occurrenceId: e,
|
|
16889
16890
|
bounds: A,
|
|
16890
16891
|
horizontalOwnership: W_(j, "horizontal", g.layoutInCell && i.anchorCellBounds !== void 0),
|
|
@@ -16893,9 +16894,9 @@ function G_(e, t, n, r, i, a, o, s, c, l) {
|
|
|
16893
16894
|
};
|
|
16894
16895
|
return {
|
|
16895
16896
|
result: j,
|
|
16896
|
-
drawing:
|
|
16897
|
-
exclusion:
|
|
16898
|
-
collision:
|
|
16897
|
+
drawing: te,
|
|
16898
|
+
exclusion: ne,
|
|
16899
|
+
collision: F,
|
|
16899
16900
|
textBoxes: D,
|
|
16900
16901
|
...g.layoutInCell && Kh(g.allowOverlap, j.geometry.wrap.kind) && i.anchorCellBounds ? { cellContainmentBounds: A } : {},
|
|
16901
16902
|
hostLineIndex: u,
|
|
@@ -19341,8 +19342,8 @@ function* Ry(e, t, n, r, i, a, o) {
|
|
|
19341
19342
|
}
|
|
19342
19343
|
_.moveAcquisitionCursor(Ey(p));
|
|
19343
19344
|
}
|
|
19344
|
-
let
|
|
19345
|
-
for (let e of
|
|
19345
|
+
let ee = new Set([...C.keys(), ...w.keys()]);
|
|
19346
|
+
for (let e of ee) {
|
|
19346
19347
|
let t = C.get(e) ?? 0, n = (w.get(e) ?? []).reduce((e, t) => e + t.advancePt, 0);
|
|
19347
19348
|
if (t !== n) throw new H("INVALID_GEOMETRY", `Page ${e} footnote reserve ${t} does not equal retained advance ${n}`);
|
|
19348
19349
|
}
|
|
@@ -19492,7 +19493,7 @@ function By(e, t, n, r) {
|
|
|
19492
19493
|
...O.slice(A)
|
|
19493
19494
|
], M = -1;
|
|
19494
19495
|
for (let e = 0; e < j.length; e += 1) j[e].layer === "body" && (M = e);
|
|
19495
|
-
let N = M < 0 ? j.length : M + 1,
|
|
19496
|
+
let N = M < 0 ? j.length : M + 1, ee = [
|
|
19496
19497
|
...j.slice(0, N),
|
|
19497
19498
|
...S.map((e) => ({
|
|
19498
19499
|
layer: "notes",
|
|
@@ -19509,7 +19510,7 @@ function By(e, t, n, r) {
|
|
|
19509
19510
|
return Object.freeze({
|
|
19510
19511
|
...i,
|
|
19511
19512
|
flowDomains: Object.freeze([...i.flowDomains, ...D]),
|
|
19512
|
-
layers: Zr(
|
|
19513
|
+
layers: Zr(ee),
|
|
19513
19514
|
readingOrder: Object.freeze([
|
|
19514
19515
|
...h?.blocks.map((e) => e.id) ?? [],
|
|
19515
19516
|
...i.readingOrder,
|
|
@@ -19810,7 +19811,7 @@ async function ob(e, t) {
|
|
|
19810
19811
|
if (i.has(a.resourceKey)) throw Error(`Duplicate math occurrence: ${a.resourceKey}`);
|
|
19811
19812
|
i.add(a.resourceKey);
|
|
19812
19813
|
try {
|
|
19813
|
-
let e = await t.mathMLToSvg(
|
|
19814
|
+
let e = await t.mathMLToSvg(se(a.nodes, a.display)), i = await j(e, "#000000");
|
|
19814
19815
|
n.push({
|
|
19815
19816
|
resourceKey: a.resourceKey,
|
|
19816
19817
|
widthEm: e.widthEm,
|
|
@@ -21231,7 +21232,7 @@ function dS(e, t, n) {
|
|
|
21231
21232
|
}, M = e.verticalMerge !== "continue" && r.rows.slice(n, o + 1).every((e) => e.heightRule === "exact") ? yl(j, t.availableBounds) : void 0, N = e.verticalMerge === "continue" ? [] : E.blocks.map((e) => ({
|
|
21232
21233
|
...e,
|
|
21233
21234
|
offsetPt: k + e.offsetPt
|
|
21234
|
-
})),
|
|
21235
|
+
})), ee = td([j, ...N.map((e) => uS(e, A.xPt, j.yPt)).map((e) => M ? lS(e, M) : e).filter((e) => e !== null)]) ?? j;
|
|
21235
21236
|
return {
|
|
21236
21237
|
kind: "table-cell",
|
|
21237
21238
|
id: e.id,
|
|
@@ -21239,7 +21240,7 @@ function dS(e, t, n) {
|
|
|
21239
21240
|
flowDomainId: r.flowDomainId,
|
|
21240
21241
|
ordinaryFlow: r.ordinaryFlow,
|
|
21241
21242
|
flowBounds: j,
|
|
21242
|
-
inkBounds:
|
|
21243
|
+
inkBounds: ee,
|
|
21243
21244
|
...M ? { clipBounds: M } : {},
|
|
21244
21245
|
contentBounds: A,
|
|
21245
21246
|
advancePt: T,
|
|
@@ -22535,7 +22536,7 @@ function mC(e) {
|
|
|
22535
22536
|
//#endregion
|
|
22536
22537
|
//#region packages/docx/src/vertical-text.ts
|
|
22537
22538
|
function hC(e) {
|
|
22538
|
-
let t =
|
|
22539
|
+
let t = pe(e);
|
|
22539
22540
|
return t === "U" || t === "Tu" ? "upright" : t === "Tr" ? "rotate" : "sideways";
|
|
22540
22541
|
}
|
|
22541
22542
|
var gC = new Set([65294]);
|
|
@@ -22580,10 +22581,10 @@ function xC(e, t) {
|
|
|
22580
22581
|
return typeof a == "number" && typeof o == "number" ? (a - o) / 2 : 0;
|
|
22581
22582
|
}
|
|
22582
22583
|
function SC(e) {
|
|
22583
|
-
return hC(e) === "rotate" &&
|
|
22584
|
+
return hC(e) === "rotate" && A(e) === null && !M(e);
|
|
22584
22585
|
}
|
|
22585
22586
|
function CC(e) {
|
|
22586
|
-
let t =
|
|
22587
|
+
let t = pe(e);
|
|
22587
22588
|
return t === "Tu" || t === "Tr";
|
|
22588
22589
|
}
|
|
22589
22590
|
function wC(e, t) {
|
|
@@ -22600,7 +22601,7 @@ function wC(e, t) {
|
|
|
22600
22601
|
function TC(e, t, n, r, i, a, o) {
|
|
22601
22602
|
let s = e.textAlign, c = e.textBaseline, l = () => (e.textAlign = n === "sideways" ? "left" : "center", e.textBaseline = n === "sideways" ? "alphabetic" : "middle", e.measureText(t)), u;
|
|
22602
22603
|
try {
|
|
22603
|
-
u = o ?
|
|
22604
|
+
u = o ? ce(e, l) : l();
|
|
22604
22605
|
} finally {
|
|
22605
22606
|
e.textAlign = s, e.textBaseline = c;
|
|
22606
22607
|
}
|
|
@@ -22622,7 +22623,7 @@ function TC(e, t, n, r, i, a, o) {
|
|
|
22622
22623
|
function EC(e, t, n, r, i) {
|
|
22623
22624
|
let a = e.measureText(t).width;
|
|
22624
22625
|
if (CC(n) && r(n)) {
|
|
22625
|
-
let n =
|
|
22626
|
+
let n = P(e, t);
|
|
22626
22627
|
return {
|
|
22627
22628
|
naturalPx: n.cellAdvancePx,
|
|
22628
22629
|
vert: n,
|
|
@@ -22667,7 +22668,7 @@ function DC(e, t, n, r, i = 1, a = !1, o = yC, s = "vertical-rl") {
|
|
|
22667
22668
|
continue;
|
|
22668
22669
|
}
|
|
22669
22670
|
for (let t of f.text) {
|
|
22670
|
-
let l = t.codePointAt(0) ?? 0, f = hC(l), p = f === "rotate" ?
|
|
22671
|
+
let l = t.codePointAt(0) ?? 0, f = hC(l), p = f === "rotate" ? A(l) : null, m = f === "rotate" && p === null && M(l), h = EC(e, t, l, o, a), g = h.naturalPx * i + r, _ = {
|
|
22671
22672
|
start: d,
|
|
22672
22673
|
end: d + t.length
|
|
22673
22674
|
};
|
|
@@ -22687,7 +22688,7 @@ function DC(e, t, n, r, i = 1, a = !1, o = yC, s = "vertical-rl") {
|
|
|
22687
22688
|
...r ? { blockAxisInkBounds: r } : {}
|
|
22688
22689
|
});
|
|
22689
22690
|
} else if (f === "upright" || p !== null || m) {
|
|
22690
|
-
let r = p === null ?
|
|
22691
|
+
let r = p === null ? ie(l) : null, a = p ?? r, o = a === null ? t : String.fromCodePoint(a), d = a === null ? _C(l) : {
|
|
22691
22692
|
dx: 0,
|
|
22692
22693
|
dy: 0
|
|
22693
22694
|
}, f = Cs(r), m = d.dy === 0 && !f ? xC(e, o) / n : 0, h = {
|
|
@@ -22740,7 +22741,7 @@ function OC(e, t, n) {
|
|
|
22740
22741
|
return r - e.measureText(t).width;
|
|
22741
22742
|
}
|
|
22742
22743
|
function kC(e, t) {
|
|
22743
|
-
return OC(e, t, (t) =>
|
|
22744
|
+
return OC(e, t, (t) => E(e, t));
|
|
22744
22745
|
}
|
|
22745
22746
|
function AC(e, t, n, r, i) {
|
|
22746
22747
|
return {
|
|
@@ -23126,21 +23127,21 @@ function jC(e, t, n) {
|
|
|
23126
23127
|
pageAnchorPrescanned: /* @__PURE__ */ new Set()
|
|
23127
23128
|
}, r = Eg(e.acquired);
|
|
23128
23129
|
return y.retainedTableAcquisition.acquireParagraph(n, t, e.acquired.flowBounds.widthPt, e.acquired.source.path, e.acquired.flowDomainId, void 0, r);
|
|
23129
|
-
},
|
|
23130
|
+
}, ee = Av(e.blocks.endnotes), te = /* @__PURE__ */ new Map(), P = (t) => {
|
|
23130
23131
|
if (t.path.length !== 0) throw Error("Story acquisition requires a story-root source");
|
|
23131
23132
|
return e.blocks.storyRoot(t);
|
|
23132
|
-
},
|
|
23133
|
+
}, ne = (t) => {
|
|
23133
23134
|
if (t.path.length === 0 || (t.path.length - 1) % 3 != 0) throw Error("Story block acquisition requires a canonical source path");
|
|
23134
23135
|
return e.blocks.resolve(t);
|
|
23135
|
-
},
|
|
23136
|
+
}, F = (e) => {
|
|
23136
23137
|
let t = JSON.stringify({
|
|
23137
23138
|
source: e.source,
|
|
23138
23139
|
pageIndex: e.pageIndex,
|
|
23139
23140
|
section: e.section,
|
|
23140
23141
|
container: e.container
|
|
23141
|
-
}), n =
|
|
23142
|
+
}), n = te.get(t);
|
|
23142
23143
|
if (n) return n;
|
|
23143
|
-
let r =
|
|
23144
|
+
let r = P(e.source), i = e.source.story === "footnote" || e.source.story === "endnote" ? y.noteNumbers?.get(`${e.source.story}:${e.source.storyInstance}`) : void 0, a = jr(g), s = a.resolveDestinationPage?.(e.pageIndex), c = jb(e.section.textDirection), l = {
|
|
23144
23145
|
...y,
|
|
23145
23146
|
sectionLayout: e.section,
|
|
23146
23147
|
pageIndex: e.pageIndex,
|
|
@@ -23194,7 +23195,7 @@ function jC(e, t, n) {
|
|
|
23194
23195
|
}), f = null;
|
|
23195
23196
|
sy(u, {
|
|
23196
23197
|
layoutParagraph(e, t) {
|
|
23197
|
-
let n =
|
|
23198
|
+
let n = ne(e.source);
|
|
23198
23199
|
if (n.type !== "paragraph") throw Error("Story paragraph source kind mismatch");
|
|
23199
23200
|
let i = e.source.path[0], a = i > 0 ? r[i - 1] : void 0, s = a?.type === "paragraph" ? a : null, c = r[i + 1], u = c?.type === "paragraph" ? c : null, d = f?.spaceAfter ?? 0, p = yg(f, n, d, n.spaceBefore), m = Math.max(t.container.bounds.yPt, t.cursor.yPt - p.overlap);
|
|
23200
23201
|
l.y = m, l.contentX = t.container.bounds.xPt, l.contentW = t.container.bounds.widthPt;
|
|
@@ -23270,7 +23271,7 @@ function jC(e, t, n) {
|
|
|
23270
23271
|
});
|
|
23271
23272
|
}))
|
|
23272
23273
|
});
|
|
23273
|
-
return
|
|
23274
|
+
return te.set(t, h), h;
|
|
23274
23275
|
};
|
|
23275
23276
|
y.acquireCompleteTextBoxStory = (e) => {
|
|
23276
23277
|
let t = e.coordinateSpace === "upright-physical" ? {
|
|
@@ -23278,14 +23279,14 @@ function jC(e, t, n) {
|
|
|
23278
23279
|
geometry: yu(y.sectionLayout.geometry),
|
|
23279
23280
|
textDirection: "lrTb"
|
|
23280
23281
|
} : y.sectionLayout;
|
|
23281
|
-
return
|
|
23282
|
+
return F({
|
|
23282
23283
|
source: e.source,
|
|
23283
23284
|
pageIndex: y.pageIndex,
|
|
23284
23285
|
section: t,
|
|
23285
23286
|
container: e.container
|
|
23286
23287
|
});
|
|
23287
23288
|
};
|
|
23288
|
-
let
|
|
23289
|
+
let re = {
|
|
23289
23290
|
hasPaginationFields: e.hasPaginationFields,
|
|
23290
23291
|
measureParagraph(t) {
|
|
23291
23292
|
A(t.location);
|
|
@@ -23810,11 +23811,11 @@ function jC(e, t, n) {
|
|
|
23810
23811
|
...u.floatingTableRegistryDelta ? { flowRegistryDelta: Object.freeze({ floats: u.floatingTableRegistryDelta }) } : {}
|
|
23811
23812
|
});
|
|
23812
23813
|
},
|
|
23813
|
-
layoutStory:
|
|
23814
|
+
layoutStory: F,
|
|
23814
23815
|
layoutNotes(e) {
|
|
23815
23816
|
let t = [], n = e.container.bounds.yPt, r = e.firstOnPage;
|
|
23816
23817
|
for (let i of e.referenceIds) {
|
|
23817
|
-
if (!(e.kind === "footnote" ? S :
|
|
23818
|
+
if (!(e.kind === "footnote" ? S : ee).has(i)) continue;
|
|
23818
23819
|
let a = {
|
|
23819
23820
|
story: e.kind,
|
|
23820
23821
|
storyInstance: i,
|
|
@@ -23829,7 +23830,7 @@ function jC(e, t, n) {
|
|
|
23829
23830
|
}
|
|
23830
23831
|
}, c;
|
|
23831
23832
|
try {
|
|
23832
|
-
c =
|
|
23833
|
+
c = F({
|
|
23833
23834
|
source: a,
|
|
23834
23835
|
pageIndex: e.pageIndex,
|
|
23835
23836
|
section: e.section,
|
|
@@ -24119,7 +24120,7 @@ function jC(e, t, n) {
|
|
|
24119
24120
|
}), y.floatParaSeq = e.floats.nextParagraphId), O = t;
|
|
24120
24121
|
}
|
|
24121
24122
|
};
|
|
24122
|
-
return Object.freeze(
|
|
24123
|
+
return Object.freeze(re);
|
|
24123
24124
|
} });
|
|
24124
24125
|
}
|
|
24125
24126
|
function d(e, t) {
|
|
@@ -24629,18 +24630,18 @@ function BC(e) {
|
|
|
24629
24630
|
//#endregion
|
|
24630
24631
|
//#region packages/docx/src/google-fonts.ts
|
|
24631
24632
|
var VC = {
|
|
24632
|
-
...
|
|
24633
|
-
...
|
|
24633
|
+
...x,
|
|
24634
|
+
...d
|
|
24634
24635
|
};
|
|
24635
24636
|
function* HC(e) {
|
|
24636
24637
|
for (let t of zC(e)) yield t.text;
|
|
24637
24638
|
}
|
|
24638
24639
|
function UC(e) {
|
|
24639
|
-
let t =
|
|
24640
|
+
let t = L(e.majorFont) ?? L(e.minorFont) ?? null;
|
|
24640
24641
|
return [
|
|
24641
24642
|
e.majorFont,
|
|
24642
24643
|
e.minorFont,
|
|
24643
|
-
...
|
|
24644
|
+
...u(HC(e), t)
|
|
24644
24645
|
];
|
|
24645
24646
|
}
|
|
24646
24647
|
//#endregion
|
|
@@ -26974,15 +26975,15 @@ function sE(e, t = {}) {
|
|
|
26974
26975
|
fingerprint: r === null ? "vertical-glyph-measurement:deterministic-v1" : s ? "vertical-glyph-measurement:dom-vert-probe-v2" : "vertical-glyph-measurement:no-dom-vert-probe-v1",
|
|
26975
26976
|
measureRunInkExtra(e) {
|
|
26976
26977
|
if (r === null) throw Error("Vertical glyph measurement requires a concrete text context");
|
|
26977
|
-
return
|
|
26978
|
+
return fe(r, () => kC(r, e));
|
|
26978
26979
|
},
|
|
26979
26980
|
planRun(e) {
|
|
26980
26981
|
if (r === null) throw Error("Vertical glyph planning requires a concrete text context");
|
|
26981
|
-
return
|
|
26982
|
+
return fe(r, () => {
|
|
26982
26983
|
let t = r.font, n = r.fontKerning;
|
|
26983
26984
|
r.font = e.font, r.fontKerning = e.fontKerning;
|
|
26984
26985
|
try {
|
|
26985
|
-
return DC(r, e.text, e.fontSizePt, e.letterSpacingPt, e.charScale, e.growTrRotateInk, (e) =>
|
|
26986
|
+
return DC(r, e.text, e.fontSizePt, e.letterSpacingPt, e.charScale, e.growTrRotateInk, (e) => E(r, e), e.writingMode);
|
|
26986
26987
|
} finally {
|
|
26987
26988
|
r.font = t, r.fontKerning = n;
|
|
26988
26989
|
}
|
|
@@ -27067,7 +27068,7 @@ function pE(e, t, n) {
|
|
|
27067
27068
|
}
|
|
27068
27069
|
//#endregion
|
|
27069
27070
|
//#region packages/docx/src/document-pull-client.ts
|
|
27070
|
-
var mE = 1024 * 1024, hE = Math.max(
|
|
27071
|
+
var mE = 1024 * 1024, hE = Math.max(S, l);
|
|
27071
27072
|
async function gE(e, t, n = {}) {
|
|
27072
27073
|
let r = [];
|
|
27073
27074
|
return bE(e, t, n, {
|
|
@@ -27108,7 +27109,7 @@ async function yE(e, t, n = {}) {
|
|
|
27108
27109
|
});
|
|
27109
27110
|
}
|
|
27110
27111
|
async function bE(e, t, n, r) {
|
|
27111
|
-
let i = new
|
|
27112
|
+
let i = new ne(e, {
|
|
27112
27113
|
...t,
|
|
27113
27114
|
maxByteCredit: hE,
|
|
27114
27115
|
timeoutMs: n.timeoutMs
|