@silurus/ooxml 0.89.6 → 0.89.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/render-worker-B3hF7Akg.js +35 -0
- package/dist/assets/render-worker-DNGf06QT.js +15 -0
- package/dist/{comment-ui-runtime-hfewTmVJ.js → comment-ui-runtime-DKlEfBPp.js} +2 -2
- package/dist/{document-model-source-BUTSwkyP.js → document-model-source-xnkMoTZ_.js} +3 -3
- package/dist/{document-pull-client-C_D779tO.js → document-pull-client-CzhPbnY_.js} +6690 -6263
- package/dist/{docx-BC2HQtjg.js → docx-BWyACb-n.js} +3 -3
- package/dist/{docx-BfLZeiwa.js → docx-BgCQiuuN.js} +4 -4
- package/dist/{docx-model-source-IjrOZgnl.js → docx-model-source-DCRFgO7-.js} +2 -2
- package/dist/docx.mjs +1 -1
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{host-layout-measure-DJvccDI3.js → host-layout-measure-CXKOWA5J.js} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internal-companion.mjs +2 -2
- package/dist/node.mjs +2 -2
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-worker-host-D_0g-TQ2.js → render-worker-host-CZHIKTtZ.js} +1 -1
- package/dist/{render-worker-host-DjBotZNL.js → render-worker-host-G1fnymI8.js} +1 -1
- package/dist/{renderer-IFuBkPvF.js → renderer-B4KIpz-2.js} +452 -382
- package/dist/{workbook-model-source-DBfVsWj7.js → workbook-model-source-J9ir5Kov.js} +3 -3
- package/dist/{xlsx-CD1VeDIg.js → xlsx-BbQ7RcNc.js} +1 -1
- package/dist/{xlsx-CCMRAxPB.js → xlsx-ClQiNSrr.js} +4 -4
- package/dist/{xlsx-model-source-udh7Q4WB.js → xlsx-model-source-C-Riw89p.js} +2 -2
- package/dist/xlsx.mjs +1 -1
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-Ba4LYMJd.js +0 -15
- package/dist/assets/render-worker-DkqinUC6.js +0 -35
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Aa as e, An as t, Ao as n, Br as r, Co as i, Dn as a, Do as o, Dr as s, En as c, Eo as l, Kr as u, Mn as d, On as f, Oo as p, So as m, Tn as h, Vr as g, Zr as _, _o as v, ao as y, ar as b, cr as x, do as S, ei as C, fo as w, fr as T, go as E, ja as D, jn as O, kn as k, ko as A, lo as j, mo as M, nr as N, oo as P, or as
|
|
2
|
-
import { $ as
|
|
1
|
+
import { Aa as e, An as t, Ao as n, Br as r, Co as i, Dn as a, Do as o, Dr as s, En as c, Eo as l, Kr as u, Mn as d, On as f, Oo as p, So as m, Tn as h, Vr as g, Zr as _, _o as v, ao as y, ar as b, cr as x, do as S, ei as C, fo as w, fr as T, go as E, ja as D, jn as O, kn as k, ko as A, lo as j, mo as M, nr as N, oo as P, or as ee, po as te, pr as F, qr as I, so as L, u as R, uo as z, wn as B, xr as V, yo as ne } from "./plot-area-frame-D3JtHvov.js";
|
|
2
|
+
import { $ as re, $t as H, C as U, En as W, Ft as G, Q as ie, Qt as K, X as q, Z as ae, _ as oe, at as se, b as ce, bt as le, cn as J, f as ue, g as de, gn as fe, h as pe, it as me, jt as he, o as ge, on as _e, p as ve, r as ye, rn as be, sn as xe, tn as Se, v as Ce, w as we, y as Te } from "./bounded-raw-part-cache-B8t03tSP.js";
|
|
3
3
|
import { H as Ee, r as De } from "./renderer-xdugdcMd.js";
|
|
4
4
|
import { r as Oe } from "./drawingml-shape-BcXkRayC.js";
|
|
5
5
|
import { _ as ke, v as Ae } from "./worksheet-pull-client-Du0MuIro.js";
|
|
@@ -283,13 +283,13 @@ function Dt(e) {
|
|
|
283
283
|
function Ot(e, t) {
|
|
284
284
|
if (e.length === 0 || t.length === 0) return 0;
|
|
285
285
|
let n = [...e, ...t], r = e.length;
|
|
286
|
-
return r -
|
|
286
|
+
return r - U(n, r, we, 1);
|
|
287
287
|
}
|
|
288
288
|
function kt(e, t) {
|
|
289
289
|
let n = t;
|
|
290
290
|
for (; n < e.length;) {
|
|
291
291
|
let t = e[e.length - n - 1], r = e[e.length - n], i = t?.codePointAt(0), a = r?.codePointAt(0);
|
|
292
|
-
if (i !== void 0 && a !== void 0 &&
|
|
292
|
+
if (i !== void 0 && a !== void 0 && J(i) && J(a)) n++;
|
|
293
293
|
else break;
|
|
294
294
|
}
|
|
295
295
|
return n >= e.length ? t : n;
|
|
@@ -297,10 +297,10 @@ function kt(e, t) {
|
|
|
297
297
|
function At(e, t) {
|
|
298
298
|
if (e.length === 0 || t.length === 0) return 0;
|
|
299
299
|
let n = t[0].codePointAt(0), r = e.length - 1, i = e[r].codePointAt(0);
|
|
300
|
-
if (i === void 0 || n === void 0 || i === 8203 || n === 8203 || !
|
|
300
|
+
if (i === void 0 || n === void 0 || i === 8203 || n === 8203 || !ce(i, n)) return 0;
|
|
301
301
|
for (; r > 0;) {
|
|
302
302
|
let t = e[r - 1].codePointAt(0), n = e[r].codePointAt(0);
|
|
303
|
-
if (t === void 0 || n === void 0 || !
|
|
303
|
+
if (t === void 0 || n === void 0 || !ce(t, n)) break;
|
|
304
304
|
r--;
|
|
305
305
|
}
|
|
306
306
|
return r === 0 ? 0 : e.length - r;
|
|
@@ -321,7 +321,7 @@ function jt(e, t, n) {
|
|
|
321
321
|
if (n === " " || xe(r)) break;
|
|
322
322
|
t += r > 65535 ? 2 : 1;
|
|
323
323
|
}
|
|
324
|
-
let n = e.slice(a, t), r =
|
|
324
|
+
let n = e.slice(a, t), r = K(n) ? _e(n) : null;
|
|
325
325
|
if (r && r.length > 0) {
|
|
326
326
|
let e = 0;
|
|
327
327
|
for (let t of r) i.push(n.slice(e, t)), e = t;
|
|
@@ -373,7 +373,7 @@ function Mt(e, t, n, r, i, a, o) {
|
|
|
373
373
|
let i = e.measureText(t).width;
|
|
374
374
|
if (c.length > 0 && l + i > r) {
|
|
375
375
|
let r = c.flatMap((e) => [...e.text]), i = Ot(r, [...t]);
|
|
376
|
-
i > 0 ? i = kt(r, i) : !
|
|
376
|
+
i > 0 ? i = kt(r, i) : !K(t) && !K(c[c.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(r.at(-1) ?? "") && (i = At(r, [...t]));
|
|
377
377
|
let o = c[c.length - 1], s = [...o.text];
|
|
378
378
|
i > s.length && (i = s.length);
|
|
379
379
|
let d = null;
|
|
@@ -407,13 +407,13 @@ function Mt(e, t, n, r, i, a, o) {
|
|
|
407
407
|
a(n, t);
|
|
408
408
|
let o = (t) => e.measureText(t).width, s = be(t), c = t.length, u = 0;
|
|
409
409
|
for (; u < c;) {
|
|
410
|
-
let e = r - l, a =
|
|
410
|
+
let e = r - l, a = H(t, i, u, e, o, s);
|
|
411
411
|
if (a <= u) {
|
|
412
412
|
if (l > 0) {
|
|
413
413
|
p();
|
|
414
414
|
continue;
|
|
415
415
|
}
|
|
416
|
-
let n = i.find((e) => e > u) ?? c, r = t.slice(u, n), d = Se(r), f =
|
|
416
|
+
let n = i.find((e) => e > u) ?? c, r = t.slice(u, n), d = Se(r), f = H(r, d, 0, e, o, s);
|
|
417
417
|
f <= 0 && (f = d.length > 0 ? d[0] : r.length), a = u + f;
|
|
418
418
|
}
|
|
419
419
|
h(t.slice(u, a), n), u = a, u < c && p();
|
|
@@ -439,7 +439,7 @@ function Mt(e, t, n, r, i, a, o) {
|
|
|
439
439
|
r.push(e.text.slice(a, t)), a = t;
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
for (let e of r) e === "\n" ? (m(), f++) :
|
|
442
|
+
for (let e of r) e === "\n" ? (m(), f++) : K(e) ? g(e, t) : h(e, t);
|
|
443
443
|
}
|
|
444
444
|
return (c.length > 0 || s.length > 0) && m(), s;
|
|
445
445
|
}
|
|
@@ -600,7 +600,7 @@ function Rt(e) {
|
|
|
600
600
|
return t;
|
|
601
601
|
}
|
|
602
602
|
function zt(e, t, n, r) {
|
|
603
|
-
return new
|
|
603
|
+
return new ne(`XLSX renderer ${e.resource} exceeded its limit of ${t} entries`, {
|
|
604
604
|
stage: "rendering",
|
|
605
605
|
violation: {
|
|
606
606
|
format: "xlsx",
|
|
@@ -1150,7 +1150,7 @@ function _n(e) {
|
|
|
1150
1150
|
return t ? `-${i}` : i;
|
|
1151
1151
|
}
|
|
1152
1152
|
function vn(e, t, n, r = !1) {
|
|
1153
|
-
if (t === 14 && !n) return yn(
|
|
1153
|
+
if (t === 14 && !n) return yn(B(e, r), e, r);
|
|
1154
1154
|
if (n && n.trim().toLowerCase() === "general") return { text: _n(e) };
|
|
1155
1155
|
if (n) return jn(e, n, r);
|
|
1156
1156
|
let i = dn[t];
|
|
@@ -2668,7 +2668,7 @@ function Ci(e, t) {
|
|
|
2668
2668
|
return `${n}${e}`;
|
|
2669
2669
|
}
|
|
2670
2670
|
function wi(e, t, n, r, i, a = !1, o = (t, n, r) => e.fillText(t, n, r)) {
|
|
2671
|
-
let s = t.codePointAt(0) ?? 0, c =
|
|
2671
|
+
let s = t.codePointAt(0) ?? 0, c = oe(s);
|
|
2672
2672
|
if (a && Ce(s)) {
|
|
2673
2673
|
e.save(), e.translate(n, r + i / 2), e.textAlign = "center", e.textBaseline = "middle", ve(e, () => o(t, 0, 0)), e.restore();
|
|
2674
2674
|
return;
|
|
@@ -2975,7 +2975,7 @@ function ba(e, t, n, r, i, a = /* @__PURE__ */ new Map()) {
|
|
|
2975
2975
|
}
|
|
2976
2976
|
function xa(e, t, n, r = !1) {
|
|
2977
2977
|
ya(e, t), (da.get(t) !== n || ma.get(t) !== r) && Xe.invalidate(t), pa.set(e, r);
|
|
2978
|
-
let i = (
|
|
2978
|
+
let i = (q(e.canvas) ? e.canvas.ownerDocument?.fonts : void 0) ?? W(), a = r ? o(i, St) : /* @__PURE__ */ new Map();
|
|
2979
2979
|
ha.set(e, a), ga.set(t, a), ba(t, n, i, r, e, a), ma.set(t, r), n ? (ua.set(e, n), da.set(t, n)) : (ua.delete(e), da.delete(t));
|
|
2980
2980
|
}
|
|
2981
2981
|
function Sa(e, t) {
|
|
@@ -2983,7 +2983,7 @@ function Sa(e, t) {
|
|
|
2983
2983
|
}
|
|
2984
2984
|
function Ca(e, t, n = !1) {
|
|
2985
2985
|
(da.get(e) !== t || ma.get(e) !== n) && Xe.invalidate(e), t ? da.set(e, t) : da.delete(e), ma.set(e, n);
|
|
2986
|
-
let r =
|
|
2986
|
+
let r = W(), i = n ? o(r, St) : /* @__PURE__ */ new Map();
|
|
2987
2987
|
ga.set(e, i), ba(e, t, r, n, void 0, i);
|
|
2988
2988
|
}
|
|
2989
2989
|
function wa(e, t, n = !1, r = !1) {
|
|
@@ -3013,7 +3013,7 @@ function Da(e, t, n = !1, r = "") {
|
|
|
3013
3013
|
return c(`${d ? `${d}, ` : ""}${l ? sa : oa}`, !1);
|
|
3014
3014
|
}
|
|
3015
3015
|
function Oa(e, t, n = "", r, i = !1, a, o) {
|
|
3016
|
-
let s = e?.trim(), c =
|
|
3016
|
+
let s = e?.trim(), c = te(n) ? t : void 0, l = r && (s?.toLocaleLowerCase("en-US") || "calibri") === r.requestedFamily.trim().toLocaleLowerCase("en-US") ? r : void 0, u = a && a.toLocaleLowerCase("en-US") !== s?.toLocaleLowerCase("en-US") ? `${p(a)}, ` : "", d = o && o.toLocaleLowerCase("en-US") !== s?.toLocaleLowerCase("en-US") ? `${p(o)}, ` : "";
|
|
3017
3017
|
return l ? `${p(l.family)}, ${u}${d}${Da(s, c, i, n)}` : s ? `${p(s)}, ${u}${d}${Da(s, c, i, n)}` : Da(null, c, i, n);
|
|
3018
3018
|
}
|
|
3019
3019
|
var ka = 11;
|
|
@@ -3703,90 +3703,91 @@ function Ao(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, _) {
|
|
|
3703
3703
|
let N = [], P = -l;
|
|
3704
3704
|
for (let e = 0; e < D; e++) N.push(P), P += a[e];
|
|
3705
3705
|
e.save(), e.beginPath(), e.rect(A(f, m), p, m, h), e.clip();
|
|
3706
|
-
let
|
|
3706
|
+
let ee = [], te = [], F = [];
|
|
3707
3707
|
for (let i of t.worksheet.mergeCells ?? []) {
|
|
3708
|
-
let a = i.top,
|
|
3709
|
-
if (O.has(a) && k.has(
|
|
3710
|
-
let
|
|
3711
|
-
if (!
|
|
3712
|
-
let
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3708
|
+
let a = i.top, g = i.left;
|
|
3709
|
+
if (O.has(a) && k.has(g) || !s.some((e) => e >= i.top && e <= i.bottom) || !o.some((e) => e >= i.left && e <= i.right)) continue;
|
|
3710
|
+
let y = t.mergeAnchorMap.get(`${a}:${g}`);
|
|
3711
|
+
if (!y) continue;
|
|
3712
|
+
let x = u - c + t.colAxis.offsetOf(g) - t.colAxis.offsetOf(r), S = d - l + t.rowAxis.offsetOf(a) - t.rowAxis.offsetOf(n), E = y.totalW, D = y.totalH;
|
|
3713
|
+
if (x + E <= f || x >= f + m || S + D <= p || S >= p + h) continue;
|
|
3714
|
+
x = A(x, E);
|
|
3715
|
+
let j = `${a}:${g}`, M = t.cellMap.get(j), { font: N, fill: P, border: ee, xf: F } = ro(v, ao(t.worksheet, M, g)), I = vi(M, a, g, C, v.dxfs ?? []), L = I.fill ?? P, R = t.structuredStyleMap.get(j);
|
|
3716
|
+
if (!Ua(e, L, x, S, E, D) && R?.fill && Ua(e, R.fill, x, S, E, D), I.dataBar && I.dataBar.ratio > 0) {
|
|
3717
|
+
let t = Math.max(0, (E - 4) * I.dataBar.ratio);
|
|
3718
|
+
Ra(e, I.dataBar.color, x + 2, S + 2, t, D - 4, I.dataBar.gradient);
|
|
3718
3719
|
}
|
|
3719
|
-
let
|
|
3720
|
-
if (
|
|
3721
|
-
let
|
|
3722
|
-
if (!
|
|
3723
|
-
let
|
|
3724
|
-
e.font = Qa(e,
|
|
3725
|
-
let
|
|
3726
|
-
e.fillStyle =
|
|
3727
|
-
let
|
|
3728
|
-
if (e.save(), e.beginPath(), e.rect(
|
|
3729
|
-
yo(e,
|
|
3720
|
+
let z = Ts(ws(ee, a, g, y.right, y.bottom, t.cellMap, v), I.border);
|
|
3721
|
+
if (te.push(() => Ds(e, z, x, S, E, D, T)), !M) continue;
|
|
3722
|
+
let B = ln(M, v, I.numFmt, t.worksheet.date1904), V = B.text;
|
|
3723
|
+
if (!V || V === "0" && t.worksheet.showZeros === !1) continue;
|
|
3724
|
+
let ne = Bo(N, I, R);
|
|
3725
|
+
e.font = Qa(e, ne, w, _, V);
|
|
3726
|
+
let re = t.hyperlinkMap.get(j), H = Ro(R, F), U = re ? "#0563C1" : I.fontColor ?? B.color ?? H ?? N.color;
|
|
3727
|
+
e.fillStyle = U ? b(U) : "#000000";
|
|
3728
|
+
let W = F.alignH ?? lo(M.value.type), G = F.alignV ?? "bottom", ie = F.indent ? Math.round(F.indent * 3 * t.mdw) : 0, K = 3 + (W === "left" || !F.alignH ? ie : 0);
|
|
3729
|
+
if (e.save(), e.beginPath(), e.rect(x, S, E, D), e.clip(), B.fill) {
|
|
3730
|
+
yo(e, x, S, E, D, G, ne, w), e.restore();
|
|
3730
3731
|
continue;
|
|
3731
3732
|
}
|
|
3732
|
-
let
|
|
3733
|
-
|
|
3734
|
-
let
|
|
3735
|
-
...
|
|
3736
|
-
color:
|
|
3737
|
-
},
|
|
3738
|
-
if (
|
|
3739
|
-
alignH:
|
|
3740
|
-
alignV:
|
|
3741
|
-
cx:
|
|
3742
|
-
cy:
|
|
3743
|
-
cellW:
|
|
3744
|
-
cellH:
|
|
3745
|
-
leftPad:
|
|
3733
|
+
let q;
|
|
3734
|
+
W === "right" ? (q = x + E - 3, e.textAlign = "right") : W === "center" ? (q = x + E / 2, e.textAlign = "center") : (q = x + K, e.textAlign = "left");
|
|
3735
|
+
let ae = Io(R, F), oe = M.value.type === "text" ? M.value.runs : void 0, se = oe && zo(oe, ae), ce = ae == null ? ne : {
|
|
3736
|
+
...ne,
|
|
3737
|
+
color: ae
|
|
3738
|
+
}, le = se && se.length > 0;
|
|
3739
|
+
if (F.wrapText && le) So(e, se, ce, {
|
|
3740
|
+
alignH: W,
|
|
3741
|
+
alignV: G,
|
|
3742
|
+
cx: x,
|
|
3743
|
+
cy: S,
|
|
3744
|
+
cellW: E,
|
|
3745
|
+
cellH: D,
|
|
3746
|
+
leftPad: K,
|
|
3746
3747
|
paddingX: 3,
|
|
3747
3748
|
paddingY: 2
|
|
3748
3749
|
}, w, T, {
|
|
3749
|
-
fontColor:
|
|
3750
|
-
readingOrder:
|
|
3750
|
+
fontColor: I.fontColor,
|
|
3751
|
+
readingOrder: F.readingOrder
|
|
3751
3752
|
}, _);
|
|
3752
|
-
else if (
|
|
3753
|
-
alignH:
|
|
3754
|
-
alignV:
|
|
3755
|
-
cx:
|
|
3756
|
-
cy:
|
|
3757
|
-
cellW:
|
|
3758
|
-
cellH:
|
|
3759
|
-
leftPad:
|
|
3753
|
+
else if (F.wrapText) xo(e, V, q, ne, {
|
|
3754
|
+
alignH: W,
|
|
3755
|
+
alignV: G,
|
|
3756
|
+
cx: x,
|
|
3757
|
+
cy: S,
|
|
3758
|
+
cellW: E,
|
|
3759
|
+
cellH: D,
|
|
3760
|
+
leftPad: K,
|
|
3760
3761
|
paddingX: 3,
|
|
3761
3762
|
paddingY: 2
|
|
3762
3763
|
}, w);
|
|
3763
|
-
else if (
|
|
3764
|
-
alignH:
|
|
3765
|
-
alignV:
|
|
3766
|
-
cx:
|
|
3767
|
-
cy:
|
|
3768
|
-
cellW:
|
|
3769
|
-
cellH:
|
|
3770
|
-
leftPad:
|
|
3764
|
+
else if (le) bo(e, se, ce, {
|
|
3765
|
+
alignH: W,
|
|
3766
|
+
alignV: G,
|
|
3767
|
+
cx: x,
|
|
3768
|
+
cy: S,
|
|
3769
|
+
cellW: E,
|
|
3770
|
+
cellH: D,
|
|
3771
|
+
leftPad: K,
|
|
3771
3772
|
paddingX: 3,
|
|
3772
3773
|
paddingY: 2
|
|
3773
3774
|
}, w, T, {
|
|
3774
|
-
fontColor:
|
|
3775
|
-
readingOrder:
|
|
3775
|
+
fontColor: I.fontColor,
|
|
3776
|
+
readingOrder: F.readingOrder
|
|
3776
3777
|
}, _);
|
|
3777
3778
|
else {
|
|
3778
3779
|
let { baseline: t, textY: n } = fo({
|
|
3779
|
-
alignH:
|
|
3780
|
-
alignV:
|
|
3781
|
-
cx:
|
|
3782
|
-
cy:
|
|
3783
|
-
cellW:
|
|
3784
|
-
cellH:
|
|
3785
|
-
leftPad:
|
|
3780
|
+
alignH: W,
|
|
3781
|
+
alignV: G,
|
|
3782
|
+
cx: x,
|
|
3783
|
+
cy: S,
|
|
3784
|
+
cellW: E,
|
|
3785
|
+
cellH: D,
|
|
3786
|
+
leftPad: K,
|
|
3786
3787
|
paddingX: 3,
|
|
3787
3788
|
paddingY: 2
|
|
3788
3789
|
});
|
|
3789
|
-
e.textBaseline = t, Za(e,
|
|
3790
|
+
e.textBaseline = t, Za(e, V, q, n, ne, w);
|
|
3790
3791
|
}
|
|
3791
3792
|
e.restore();
|
|
3792
3793
|
}
|
|
@@ -3805,7 +3806,7 @@ function Ao(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, _) {
|
|
|
3805
3806
|
};
|
|
3806
3807
|
for (let e = 0; e <= E; e++) {
|
|
3807
3808
|
let n = !1, i = !1;
|
|
3808
|
-
if (e < E) {
|
|
3809
|
+
if (e < E && o[e] <= t.selectionLastCol) {
|
|
3809
3810
|
let a = `${r}:${o[e]}`;
|
|
3810
3811
|
if (!S.has(a) && !x.has(a)) {
|
|
3811
3812
|
let r = y.get(a);
|
|
@@ -3814,95 +3815,103 @@ function Ao(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, _) {
|
|
|
3814
3815
|
}
|
|
3815
3816
|
n ? i && k >= 0 && e > k ? (M(e), k = e) : k < 0 && (k = e) : M(e);
|
|
3816
3817
|
}
|
|
3818
|
+
let P = !0;
|
|
3817
3819
|
for (let a = 0; a < E; a++) {
|
|
3818
|
-
let s = o[a], d = u + j[a], k = i[a], M = `${r}:${s}`;
|
|
3819
|
-
if (S.has(
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3820
|
+
let s = o[a], d = u + j[a], k = i[a], M = s === t.firstViewportCol && P, N = `${r}:${s}`;
|
|
3821
|
+
if (S.has(N)) {
|
|
3822
|
+
P = d + k <= f || d >= f + m;
|
|
3823
|
+
continue;
|
|
3824
|
+
}
|
|
3825
|
+
let I = x.get(N), L = I ? I.totalW : k, R = I ? I.totalH : l, z = d + L <= f || d >= f + m;
|
|
3826
|
+
if (c + R <= p || c >= p + h || z && !t.overflowTextAnchors.has(N)) {
|
|
3827
|
+
P = !0;
|
|
3828
|
+
continue;
|
|
3826
3829
|
}
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
+
P = !1;
|
|
3831
|
+
let B = A(d, L), V = y.get(N), { font: ne, fill: re, border: H, xf: U } = ro(v, ao(t.worksheet, V, s)), W = vi(V, r, s, C, v.dxfs ?? []), G = Ua(e, W.fill ?? re, B, c, L, R), ie = t.structuredStyleMap.get(N);
|
|
3832
|
+
if (!G && ie?.fill && (G = Ua(e, ie.fill, B, c, L, R)), t.commentCells.has(N) && Ka(e, B, c, L, R), W.dataBar && W.dataBar.ratio > 0) {
|
|
3833
|
+
let t = Math.max(0, (L - 4) * W.dataBar.ratio);
|
|
3834
|
+
Ra(e, W.dataBar.color, B + 2, c + 2, t, R - 4, W.dataBar.gradient);
|
|
3835
|
+
}
|
|
3836
|
+
let K = t.sparklineMap.get(N);
|
|
3837
|
+
if (K && Ze(e, {
|
|
3838
|
+
x: B,
|
|
3830
3839
|
y: c,
|
|
3831
|
-
w:
|
|
3832
|
-
h:
|
|
3833
|
-
},
|
|
3840
|
+
w: L,
|
|
3841
|
+
h: R
|
|
3842
|
+
}, K), t.worksheet.isChartSheet !== !0 && t.worksheet.showGridlines !== !1 && !G) {
|
|
3834
3843
|
if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !D.has(a)) {
|
|
3835
|
-
let t =
|
|
3836
|
-
e.moveTo(t, c), e.lineTo(t, c +
|
|
3844
|
+
let t = B + L + g(B + L, .5, T);
|
|
3845
|
+
e.moveTo(t, c), e.lineTo(t, c + R);
|
|
3837
3846
|
}
|
|
3838
|
-
let t = c +
|
|
3839
|
-
if (e.moveTo(
|
|
3847
|
+
let t = c + R + g(c + R, .5, T);
|
|
3848
|
+
if (e.moveTo(B, t), e.lineTo(B + L, t), n === 0) {
|
|
3840
3849
|
let t = c + g(c, .5, T);
|
|
3841
|
-
e.moveTo(
|
|
3850
|
+
e.moveTo(B, t), e.lineTo(B + L, t);
|
|
3842
3851
|
}
|
|
3843
|
-
if (
|
|
3844
|
-
let t =
|
|
3845
|
-
e.moveTo(t, c), e.lineTo(t, c +
|
|
3852
|
+
if (M) {
|
|
3853
|
+
let t = B + g(B, .5, T);
|
|
3854
|
+
e.moveTo(t, c), e.lineTo(t, c + R);
|
|
3846
3855
|
}
|
|
3847
3856
|
e.stroke();
|
|
3848
3857
|
}
|
|
3849
|
-
let
|
|
3850
|
-
|
|
3851
|
-
...
|
|
3852
|
-
top:
|
|
3853
|
-
bottom:
|
|
3854
|
-
left:
|
|
3855
|
-
right:
|
|
3856
|
-
}), (D.has(a) || O.has(a)) && (
|
|
3857
|
-
...
|
|
3858
|
-
left: O.has(a) ? null :
|
|
3859
|
-
right: D.has(a) ? null :
|
|
3858
|
+
let q = Ts(I ? ws(H, r, s, I.right, I.bottom, y, v) : H, W.border);
|
|
3859
|
+
ie && (q = {
|
|
3860
|
+
...q,
|
|
3861
|
+
top: q.top?.style ? q.top : ie.top ?? q.top,
|
|
3862
|
+
bottom: q.bottom?.style ? q.bottom : ie.bottom ?? q.bottom,
|
|
3863
|
+
left: q.left?.style ? q.left : ie.left ?? q.left,
|
|
3864
|
+
right: q.right?.style ? q.right : ie.right ?? q.right
|
|
3865
|
+
}), (D.has(a) || O.has(a)) && (q = {
|
|
3866
|
+
...q,
|
|
3867
|
+
left: O.has(a) ? null : q.left,
|
|
3868
|
+
right: D.has(a) ? null : q.right
|
|
3860
3869
|
});
|
|
3861
|
-
let
|
|
3862
|
-
if (
|
|
3863
|
-
...
|
|
3864
|
-
top:
|
|
3870
|
+
let ae = y.get(`${r - 1}:${s}`), oe = ae ? ro(v, ao(t.worksheet, ae, s)).border.bottom : null;
|
|
3871
|
+
if (oe?.style && (n === 0 || q.top?.style) && (q = {
|
|
3872
|
+
...q,
|
|
3873
|
+
top: js(q.top, oe)
|
|
3865
3874
|
}), !O.has(a)) {
|
|
3866
3875
|
let e = y.get(`${r}:${s - 1}`), n = e ? ro(v, ao(t.worksheet, e, s - 1)).border.right : null;
|
|
3867
|
-
n?.style && (
|
|
3868
|
-
...
|
|
3869
|
-
left:
|
|
3876
|
+
n?.style && (M || q.left?.style) && (q = {
|
|
3877
|
+
...q,
|
|
3878
|
+
left: js(q.left, n)
|
|
3870
3879
|
});
|
|
3871
3880
|
}
|
|
3872
|
-
let
|
|
3873
|
-
|
|
3881
|
+
let se = t.autoFilterCells.has(N), ce = () => {
|
|
3882
|
+
se && Oo(e, B, c, k, R);
|
|
3874
3883
|
};
|
|
3875
|
-
if (
|
|
3876
|
-
let t =
|
|
3877
|
-
|
|
3884
|
+
if (I) {
|
|
3885
|
+
let t = q;
|
|
3886
|
+
te.push(() => Ds(e, t, B, c, L, R, T)), ce();
|
|
3878
3887
|
} else {
|
|
3879
|
-
let t =
|
|
3880
|
-
|
|
3881
|
-
|
|
3888
|
+
let t = q;
|
|
3889
|
+
F.push(() => {
|
|
3890
|
+
Ds(e, t, B, c, L, R, T), ce();
|
|
3882
3891
|
});
|
|
3883
3892
|
}
|
|
3884
|
-
if (!
|
|
3885
|
-
let
|
|
3886
|
-
!J || J === "0" && t.worksheet.showZeros === !1 ||
|
|
3887
|
-
let n = Bo(ne,
|
|
3893
|
+
if (!V) continue;
|
|
3894
|
+
let le = ln(V, v, W.numFmt, t.worksheet.date1904), J = le.text;
|
|
3895
|
+
!J || J === "0" && t.worksheet.showZeros === !1 || ee.push(() => {
|
|
3896
|
+
let n = Bo(ne, W, ie);
|
|
3888
3897
|
e.font = Qa(e, n, w, _, J);
|
|
3889
|
-
let l = t.hyperlinkMap.get(
|
|
3890
|
-
e.fillStyle =
|
|
3891
|
-
let
|
|
3892
|
-
if (
|
|
3898
|
+
let l = t.hyperlinkMap.get(N), u = Ro(ie, U), f = l ? "#0563C1" : W.fontColor ?? le.color ?? u ?? ne.color;
|
|
3899
|
+
e.fillStyle = f ? b(f) : "#000000";
|
|
3900
|
+
let p = V.value.type === "number", m = U.alignH ?? lo(V.value.type), h = U.alignV ?? "bottom", C = U.indent ? Math.round(U.indent * 3 * t.mdw) : 0, D = W.iconSet ? Math.max(8, Math.round(Math.min(L, R) * .55)) : 0, O = D > 0 ? D + 4 : 0, k = 3 + (m === "left" || !U.alignH ? C : 0) + O, j = L, M = a;
|
|
3901
|
+
if (m === "centerContinuous" && !I) for (let e = a + 1; e < E && o[e] <= t.selectionLastCol; e++) {
|
|
3893
3902
|
let n = `${r}:${o[e]}`;
|
|
3894
3903
|
if (S.has(n) || x.has(n)) break;
|
|
3895
3904
|
let a = y.get(n);
|
|
3896
3905
|
if (a && a.value.type !== "empty" || ro(v, ao(t.worksheet, a, o[e])).xf.alignH !== "centerContinuous") break;
|
|
3897
|
-
|
|
3906
|
+
j += i[e], M = e;
|
|
3898
3907
|
}
|
|
3899
|
-
let
|
|
3900
|
-
if (!
|
|
3901
|
-
let n = e.measureText(J).width, s =
|
|
3908
|
+
let P = t.rtl ? B - (j - L) : B, ee = m === "centerContinuous" ? P : B, te = m === "centerContinuous" ? j : L, F = J.includes("\n");
|
|
3909
|
+
if (!I && !U.wrapText && !U.textRotation && !p && !F) {
|
|
3910
|
+
let n = e.measureText(J).width, s = m === "centerContinuous", c = s ? n + 6 : n + k + 3, l = s ? j : L;
|
|
3902
3911
|
if (c > l) {
|
|
3903
3912
|
let e = c - l, n = 0, u = 0;
|
|
3904
|
-
|
|
3905
|
-
let d = t.rtl ? -1 : 1, f = t.rtl ? a - 1 :
|
|
3913
|
+
m === "right" ? u = e : m === "center" || s ? (u = e / 2, n = e / 2) : n = e;
|
|
3914
|
+
let d = t.rtl ? -1 : 1, f = t.rtl ? a - 1 : M + 1, p = t.rtl ? 1 : -1, h = t.rtl ? M + 1 : a - 1;
|
|
3906
3915
|
if (n > 0) {
|
|
3907
3916
|
let e = n;
|
|
3908
3917
|
for (let t = f; t >= 0 && t < E && e > 0; t += d) {
|
|
@@ -3910,111 +3919,111 @@ function Ao(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, _) {
|
|
|
3910
3919
|
if (S.has(n) || x.has(n)) break;
|
|
3911
3920
|
let a = y.get(n);
|
|
3912
3921
|
if (a && a.value.type !== "empty") break;
|
|
3913
|
-
|
|
3922
|
+
te += i[t], e -= i[t];
|
|
3914
3923
|
}
|
|
3915
3924
|
}
|
|
3916
3925
|
if (u > 0) {
|
|
3917
3926
|
let e = u;
|
|
3918
|
-
for (let t = h; t >= 0 && t < E && e > 0; t +=
|
|
3927
|
+
for (let t = h; t >= 0 && t < E && e > 0; t += p) {
|
|
3919
3928
|
let n = `${r}:${o[t]}`;
|
|
3920
3929
|
if (S.has(n) || x.has(n)) break;
|
|
3921
3930
|
let a = y.get(n);
|
|
3922
3931
|
if (a && a.value.type !== "empty") break;
|
|
3923
|
-
|
|
3932
|
+
ee -= i[t], te += i[t], e -= i[t];
|
|
3924
3933
|
}
|
|
3925
3934
|
}
|
|
3926
3935
|
}
|
|
3927
3936
|
}
|
|
3928
|
-
let
|
|
3929
|
-
if (
|
|
3930
|
-
let t = Math.max(1,
|
|
3937
|
+
let z = J, re = 0;
|
|
3938
|
+
if (m === "fill" && !p && J.length > 0) {
|
|
3939
|
+
let t = Math.max(1, L - 6), n = e.measureText(J).width;
|
|
3931
3940
|
if (n > 0 && n < t) {
|
|
3932
3941
|
let e = Math.max(1, Math.floor(t / n));
|
|
3933
|
-
|
|
3942
|
+
z = J.repeat(e);
|
|
3934
3943
|
}
|
|
3935
3944
|
}
|
|
3936
|
-
if (
|
|
3937
|
-
let t = Math.max(1,
|
|
3938
|
-
n < t && (
|
|
3945
|
+
if (m === "distributed" || m === "justify" && !U.wrapText && !F) {
|
|
3946
|
+
let t = Math.max(1, L - 6), n = e.measureText(z).width, r = Math.max(1, [...z].length - 1);
|
|
3947
|
+
n < t && (re = Math.max(0, (t - n) / r));
|
|
3939
3948
|
}
|
|
3940
|
-
let
|
|
3941
|
-
|
|
3942
|
-
let
|
|
3943
|
-
if (
|
|
3944
|
-
yo(e,
|
|
3949
|
+
let H, G;
|
|
3950
|
+
m === "right" ? (H = B + L - 3, G = "right") : m === "center" ? (H = B + L / 2, G = "center") : m === "centerContinuous" ? (H = P + j / 2, G = "center") : m === "distributed" || m === "justify" && !U.wrapText && !F ? (H = B + 3, G = "left") : (H = B + k, G = "left");
|
|
3951
|
+
let K = U.textRotation ?? 0, q = K === 255, ae = K > 0 && K !== 255;
|
|
3952
|
+
if (W.iconSet && D > 0 && (e.save(), e.beginPath(), e.rect(B, c, L, R), e.clip(), Do(e, W.iconSet.name, W.iconSet.index, B + 2, c + (R - D) / 2, D), e.restore()), e.save(), e.beginPath(), e.rect(ee, c, te, R), e.clip(), le.fill) {
|
|
3953
|
+
yo(e, B, c, L, R, h, n, w), e.restore();
|
|
3945
3954
|
return;
|
|
3946
3955
|
}
|
|
3947
|
-
if (
|
|
3948
|
-
let t = $(ne.size, w, 1.1), r = [...J].length * t, i =
|
|
3956
|
+
if (q) {
|
|
3957
|
+
let t = $(ne.size, w, 1.1), r = [...J].length * t, i = h === "top" ? c + 2 : h === "center" ? c + (R - r) / 2 : c + R - r - 2;
|
|
3949
3958
|
e.textAlign = "center", e.textBaseline = "top";
|
|
3950
3959
|
let a = (t, r, i) => Za(e, t, r, i, n, w);
|
|
3951
3960
|
for (let n of J) {
|
|
3952
3961
|
let r = n.codePointAt(0) ?? 0, o = Ce(r) && ue(e, r);
|
|
3953
|
-
wi(e, n,
|
|
3962
|
+
wi(e, n, B + L / 2, i, t, o, a), i += t;
|
|
3954
3963
|
}
|
|
3955
3964
|
e.restore();
|
|
3956
3965
|
return;
|
|
3957
3966
|
}
|
|
3958
|
-
if (
|
|
3959
|
-
let t =
|
|
3960
|
-
e.translate(
|
|
3967
|
+
if (ae) {
|
|
3968
|
+
let t = K <= 90 ? -(K * Math.PI / 180) : (K - 90) * Math.PI / 180;
|
|
3969
|
+
e.translate(B + L / 2, c + R / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", Za(e, J, 0, 0, n, w), e.restore();
|
|
3961
3970
|
return;
|
|
3962
3971
|
}
|
|
3963
|
-
if (
|
|
3964
|
-
let t = e.measureText(J).width, n =
|
|
3972
|
+
if (U.shrinkToFit) {
|
|
3973
|
+
let t = e.measureText(J).width, n = L - k - 3;
|
|
3965
3974
|
if (t > n && t > 0) {
|
|
3966
|
-
let r = n / t, i =
|
|
3975
|
+
let r = n / t, i = m === "right" ? B + L - 3 : m === "center" ? B + L / 2 : B + k;
|
|
3967
3976
|
e.transform(r, 0, 0, 1, i * (1 - r), 0);
|
|
3968
3977
|
}
|
|
3969
3978
|
}
|
|
3970
|
-
if (e.textAlign =
|
|
3971
|
-
e.letterSpacing = `${
|
|
3979
|
+
if (e.textAlign = G, re > 0) try {
|
|
3980
|
+
e.letterSpacing = `${re}px`;
|
|
3972
3981
|
} catch {}
|
|
3973
3982
|
try {
|
|
3974
|
-
e.direction = yi(
|
|
3983
|
+
e.direction = yi(U.readingOrder, J) ? "rtl" : "ltr";
|
|
3975
3984
|
} catch {}
|
|
3976
|
-
let
|
|
3985
|
+
let oe = Io(ie, U), se = V.value.type === "text" ? V.value.runs : void 0, ce = se && zo(se, oe), de = oe == null ? n : {
|
|
3977
3986
|
...n,
|
|
3978
|
-
color:
|
|
3979
|
-
},
|
|
3980
|
-
if (
|
|
3981
|
-
alignH:
|
|
3982
|
-
alignV:
|
|
3983
|
-
cx:
|
|
3987
|
+
color: oe
|
|
3988
|
+
}, fe = ce && ce.length > 0;
|
|
3989
|
+
if (U.wrapText && fe) So(e, ce, de, {
|
|
3990
|
+
alignH: m,
|
|
3991
|
+
alignV: h,
|
|
3992
|
+
cx: B,
|
|
3984
3993
|
cy: c,
|
|
3985
|
-
cellW:
|
|
3986
|
-
cellH:
|
|
3987
|
-
leftPad:
|
|
3994
|
+
cellW: L,
|
|
3995
|
+
cellH: R,
|
|
3996
|
+
leftPad: k,
|
|
3988
3997
|
paddingX: 3,
|
|
3989
3998
|
paddingY: 2
|
|
3990
3999
|
}, w, T, {
|
|
3991
|
-
fontColor:
|
|
3992
|
-
readingOrder:
|
|
4000
|
+
fontColor: W.fontColor,
|
|
4001
|
+
readingOrder: U.readingOrder
|
|
3993
4002
|
}, _);
|
|
3994
|
-
else if (
|
|
3995
|
-
alignH:
|
|
3996
|
-
alignV:
|
|
3997
|
-
cx:
|
|
4003
|
+
else if (U.wrapText) xo(e, J, H, n, {
|
|
4004
|
+
alignH: m,
|
|
4005
|
+
alignV: h,
|
|
4006
|
+
cx: B,
|
|
3998
4007
|
cy: c,
|
|
3999
|
-
cellW:
|
|
4000
|
-
cellH:
|
|
4001
|
-
leftPad:
|
|
4008
|
+
cellW: L,
|
|
4009
|
+
cellH: R,
|
|
4010
|
+
leftPad: k,
|
|
4002
4011
|
paddingX: 3,
|
|
4003
4012
|
paddingY: 2
|
|
4004
4013
|
}, w);
|
|
4005
|
-
else if (
|
|
4006
|
-
alignH:
|
|
4007
|
-
alignV:
|
|
4008
|
-
cx:
|
|
4014
|
+
else if (fe) bo(e, ce, de, {
|
|
4015
|
+
alignH: m,
|
|
4016
|
+
alignV: h,
|
|
4017
|
+
cx: B,
|
|
4009
4018
|
cy: c,
|
|
4010
|
-
cellW:
|
|
4011
|
-
cellH:
|
|
4012
|
-
leftPad:
|
|
4019
|
+
cellW: L,
|
|
4020
|
+
cellH: R,
|
|
4021
|
+
leftPad: k,
|
|
4013
4022
|
paddingX: 3,
|
|
4014
4023
|
paddingY: 2
|
|
4015
4024
|
}, w, T, {
|
|
4016
|
-
fontColor:
|
|
4017
|
-
readingOrder:
|
|
4025
|
+
fontColor: W.fontColor,
|
|
4026
|
+
readingOrder: U.readingOrder
|
|
4018
4027
|
}, _);
|
|
4019
4028
|
else {
|
|
4020
4029
|
let t = n.vertAlign, r = $(ne.size, w), i = 0;
|
|
@@ -4025,63 +4034,66 @@ function Ao(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, _) {
|
|
|
4025
4034
|
} : n;
|
|
4026
4035
|
t && (e.font = Qa(e, a, w, _, J));
|
|
4027
4036
|
let o = null, s = () => o ??= e.measureText(J), u = () => {
|
|
4028
|
-
let e = Math.min(s().width,
|
|
4037
|
+
let e = Math.min(s().width, te - k - 3);
|
|
4029
4038
|
return {
|
|
4030
|
-
x:
|
|
4039
|
+
x: m === "right" ? B + L - 3 - e : m === "center" ? B + L / 2 - e / 2 : B + k,
|
|
4031
4040
|
width: e
|
|
4032
4041
|
};
|
|
4033
|
-
},
|
|
4042
|
+
}, d = $(a.size, w);
|
|
4034
4043
|
if (n.underline || l) {
|
|
4035
|
-
let { x: t, width: r } = u(), a = (
|
|
4044
|
+
let { x: t, width: r } = u(), a = (h === "top" ? c + 2 + d + 1 : h === "center" ? c + R / 2 + Math.round(d * .55) : c + R - 2 + 1) + i, o = l ? "#0563C1" : f ? b(f) : "#000000", s = n.underlineStyle === "double" || n.underlineStyle === "doubleAccounting";
|
|
4036
4045
|
to(e, t, t + r, a, o, s, T);
|
|
4037
4046
|
}
|
|
4038
4047
|
if (n.strike) {
|
|
4039
|
-
let { x: t, width: n } = u(), r = (
|
|
4040
|
-
e.save(), e.strokeStyle =
|
|
4048
|
+
let { x: t, width: n } = u(), r = (h === "top" ? c + 2 + Math.round(d * .5) : h === "center" ? c + R / 2 : c + R - 2 - Math.round(d * .35)) + i, a = r + g(r, .5, T);
|
|
4049
|
+
e.save(), e.strokeStyle = f ? b(f) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
|
|
4041
4050
|
}
|
|
4042
4051
|
if (J.includes("\n")) {
|
|
4043
4052
|
let t = J.split("\n"), n = $(ne.size, w, 1.2), r = t.length * n, o;
|
|
4044
|
-
|
|
4045
|
-
for (let r = 0; r < t.length; r++) Za(e, t[r],
|
|
4053
|
+
h === "top" ? (o = c + 2, e.textBaseline = "top") : h === "center" ? (o = c + (R - r) / 2, e.textBaseline = "top") : (o = c + R - r - 2, e.textBaseline = "top");
|
|
4054
|
+
for (let r = 0; r < t.length; r++) Za(e, t[r], H, o + r * n + i, a, w);
|
|
4046
4055
|
} else {
|
|
4047
4056
|
let { baseline: t, textY: n } = fo({
|
|
4048
|
-
alignH:
|
|
4049
|
-
alignV:
|
|
4050
|
-
cx:
|
|
4057
|
+
alignH: m,
|
|
4058
|
+
alignV: h,
|
|
4059
|
+
cx: B,
|
|
4051
4060
|
cy: c,
|
|
4052
|
-
cellW:
|
|
4053
|
-
cellH:
|
|
4054
|
-
leftPad:
|
|
4061
|
+
cellW: L,
|
|
4062
|
+
cellH: R,
|
|
4063
|
+
leftPad: k,
|
|
4055
4064
|
paddingX: 3,
|
|
4056
4065
|
paddingY: 2
|
|
4057
4066
|
});
|
|
4058
|
-
e.textBaseline = t, Za(e,
|
|
4067
|
+
e.textBaseline = t, Za(e, z, H, n + i, a, w);
|
|
4059
4068
|
}
|
|
4060
4069
|
}
|
|
4061
|
-
let
|
|
4062
|
-
if (
|
|
4070
|
+
let pe = V.value.type === "text" ? V.value.phoneticRuns : void 0;
|
|
4071
|
+
if (V.showPhonetic && pe && pe.length > 0 && !J.includes("\n")) {
|
|
4063
4072
|
let t = Qa(e, n, w, _, J), r = eo(e, J, t), i;
|
|
4064
|
-
i =
|
|
4065
|
-
let a =
|
|
4066
|
-
$a(e,
|
|
4073
|
+
i = m === "right" ? B + L - 3 - r : m === "center" ? B + L / 2 - r / 2 : B + k;
|
|
4074
|
+
let a = f ? b(f) : "#000000";
|
|
4075
|
+
$a(e, pe, V.value.type === "text" ? V.value.phoneticPr : void 0, J, t, v, i, c, w, a, _);
|
|
4076
|
+
}
|
|
4077
|
+
if (e.restore(), J && t.textRuns) {
|
|
4078
|
+
let e = s >= t.textRunPane.first && s <= t.textRunPane.last, n = e ? t.textRuns.owned : t.textRuns.foreign;
|
|
4079
|
+
n.has(N) || n.set(N, {
|
|
4080
|
+
sheetName: t.worksheet.name,
|
|
4081
|
+
cellRef: Ci(r, s),
|
|
4082
|
+
text: J,
|
|
4083
|
+
x: e ? B : A(d + t.textRunPane.ownerShiftX, L),
|
|
4084
|
+
y: c,
|
|
4085
|
+
width: L,
|
|
4086
|
+
height: R,
|
|
4087
|
+
row: r,
|
|
4088
|
+
col: s
|
|
4089
|
+
});
|
|
4067
4090
|
}
|
|
4068
|
-
e.restore(), J && t.onTextRun && t.onTextRun({
|
|
4069
|
-
sheetName: t.worksheet.name,
|
|
4070
|
-
cellRef: Ci(r, s),
|
|
4071
|
-
text: J,
|
|
4072
|
-
x: R,
|
|
4073
|
-
y: c,
|
|
4074
|
-
width: P,
|
|
4075
|
-
height: I,
|
|
4076
|
-
row: r,
|
|
4077
|
-
col: s
|
|
4078
|
-
});
|
|
4079
4091
|
});
|
|
4080
4092
|
}
|
|
4081
4093
|
}
|
|
4094
|
+
for (let e of F) e();
|
|
4082
4095
|
for (let e of te) e();
|
|
4083
4096
|
for (let e of ee) e();
|
|
4084
|
-
for (let e of F) e();
|
|
4085
4097
|
e.restore();
|
|
4086
4098
|
}
|
|
4087
4099
|
var jo = /* @__PURE__ */ new WeakMap();
|
|
@@ -4277,79 +4289,106 @@ function qo(e, t = []) {
|
|
|
4277
4289
|
for (let [t, a] of n.derived) Ye(Ke(e), t) || r.has(t) || e.rowHeights[t] === a && (delete e.rowHeights[t], i = !0);
|
|
4278
4290
|
Fo.delete(e), i && Xe.invalidate(e);
|
|
4279
4291
|
}
|
|
4280
|
-
|
|
4292
|
+
var Jo = /* @__PURE__ */ new WeakMap();
|
|
4293
|
+
function Yo(e, t) {
|
|
4294
|
+
let n = Jo.get(t);
|
|
4295
|
+
n || (n = /* @__PURE__ */ new WeakMap(), Jo.set(t, n));
|
|
4296
|
+
let r = n.get(e);
|
|
4297
|
+
return r || (r = e.filter((e) => t.sizeOf(e) > 0), n.set(e, r)), r;
|
|
4298
|
+
}
|
|
4299
|
+
function Xo(e, t) {
|
|
4281
4300
|
let n = 0, r = e.length;
|
|
4282
4301
|
for (; n < r;) {
|
|
4283
4302
|
let i = n + r >> 1;
|
|
4284
4303
|
e[i] < t ? n = i + 1 : r = i;
|
|
4285
4304
|
}
|
|
4286
|
-
return n
|
|
4305
|
+
return n - 1;
|
|
4287
4306
|
}
|
|
4288
|
-
function
|
|
4307
|
+
function Zo(e, t) {
|
|
4289
4308
|
let n = 0, r = e.length;
|
|
4290
4309
|
for (; n < r;) {
|
|
4291
4310
|
let i = n + r >> 1;
|
|
4292
4311
|
e[i] <= t ? n = i + 1 : r = i;
|
|
4293
4312
|
}
|
|
4294
|
-
return n
|
|
4313
|
+
return n;
|
|
4295
4314
|
}
|
|
4296
|
-
function
|
|
4297
|
-
|
|
4315
|
+
function Qo(e, t, n) {
|
|
4316
|
+
let r = e[Xo(e, t)];
|
|
4317
|
+
if (r == null || n.sizeOf(r) > 0) return r;
|
|
4318
|
+
let i = Yo(e, n);
|
|
4319
|
+
return i[Xo(i, t)];
|
|
4320
|
+
}
|
|
4321
|
+
function $o(e, t, n) {
|
|
4322
|
+
let r = e[Zo(e, t)];
|
|
4323
|
+
if (r == null || n.sizeOf(r) > 0) return r;
|
|
4324
|
+
let i = Yo(e, n);
|
|
4325
|
+
return i[Zo(i, t)];
|
|
4326
|
+
}
|
|
4327
|
+
function es(e, t, n, r, i) {
|
|
4328
|
+
return (e.mergeCells ?? []).some((e) => {
|
|
4329
|
+
if (t < e.top || t > e.bottom) return !1;
|
|
4330
|
+
let a = Math.max(n, e.left), o = Math.min(r, e.right);
|
|
4331
|
+
return a <= o && i.offsetOf(o + 1) > i.offsetOf(a);
|
|
4332
|
+
});
|
|
4298
4333
|
}
|
|
4299
|
-
function
|
|
4300
|
-
let
|
|
4301
|
-
let
|
|
4302
|
-
if (!v || v.value.type === "empty" || s.has(
|
|
4303
|
-
let { font: y, xf: b } = ro(n, v
|
|
4334
|
+
function ts(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
4335
|
+
let _ = d, v = f, y = /* @__PURE__ */ new Set(), b = (i, u, d, f) => {
|
|
4336
|
+
let _ = `${i}:${u}`, v = r.get(_);
|
|
4337
|
+
if (!v || v.value.type === "empty" || s.has(_)) return !1;
|
|
4338
|
+
let { font: y, xf: b } = ro(n, ao(t, v, u)), x = vi(v, i, u, a, n.dxfs ?? []), S = ln(v, n, x.numFmt, t.date1904).text;
|
|
4304
4339
|
if (!S || S === "0" && t.showZeros === !1 || v.value.type === "number" || b.wrapText || b.textRotation || S.includes("\n")) return !1;
|
|
4305
|
-
let C = o.get(
|
|
4340
|
+
let C = o.get(_), w = x.fontBold ?? (y.bold || !!C?.bold), T = x.fontItalic ?? (y.italic || !!C?.italic);
|
|
4306
4341
|
e.font = Qa(e, w !== y.bold || T !== y.italic ? {
|
|
4307
4342
|
...y,
|
|
4308
4343
|
bold: w,
|
|
4309
4344
|
italic: T
|
|
4310
|
-
} : y,
|
|
4311
|
-
let E = b.alignH ?? lo(v.value.type), D = b.indent ? Math.round(b.indent * 3 *
|
|
4312
|
-
return P <= 0 ? !1 : (E === "center" || E === "centerContinuous" ? P / 2 : ((
|
|
4345
|
+
} : y, p, g, S);
|
|
4346
|
+
let E = b.alignH ?? lo(v.value.type), D = b.indent ? Math.round(b.indent * 3 * m) : 0, O = c.sizeOf(u), k = l.sizeOf(i), A = x.iconSet ? Math.max(8, Math.round(Math.min(O, k) * .55)) : 0, j = A > 0 ? A + 4 : 0, M = 3 + (E === "left" || !b.alignH ? D : 0) + j, N = e.measureText(S).width + M + 3, P = Math.max(0, N - O);
|
|
4347
|
+
return P <= 0 ? !1 : (E === "center" || E === "centerContinuous" ? P / 2 : ((h ? d === "higher" ? "left" : "right" : d === "higher" ? "right" : "left") == "left" ? E === "right" : E !== "right") ? P : 0) > f;
|
|
4313
4348
|
};
|
|
4314
4349
|
for (let e of u) {
|
|
4315
4350
|
let n = i.get(e);
|
|
4316
4351
|
if (!n) continue;
|
|
4317
|
-
let a =
|
|
4318
|
-
a != null &&
|
|
4319
|
-
let s =
|
|
4320
|
-
s != null && s <= 16384 && (!l || l.value.type === "empty") && !
|
|
4352
|
+
let a = Qo(n, d, c), o = r.get(`${e}:${d}`);
|
|
4353
|
+
a != null && (!o || o.value.type === "empty") && !es(t, e, a + 1, d, c) && b(e, a, "higher", c.offsetOf(d) - c.offsetOf(a + 1)) && (_ = Math.min(_, a), y.add(`${e}:${a}`));
|
|
4354
|
+
let s = $o(n, f, c), l = r.get(`${e}:${f}`);
|
|
4355
|
+
s != null && s <= 16384 && (!l || l.value.type === "empty") && !es(t, e, f, s - 1, c) && b(e, s, "lower", c.offsetOf(s) - c.offsetOf(f + 1)) && (v = Math.max(v, s), y.add(`${e}:${s}`));
|
|
4321
4356
|
}
|
|
4322
4357
|
return {
|
|
4323
|
-
startCol:
|
|
4324
|
-
endCol:
|
|
4325
|
-
anchorKeys:
|
|
4358
|
+
startCol: _,
|
|
4359
|
+
endCol: v,
|
|
4360
|
+
anchorKeys: y
|
|
4326
4361
|
};
|
|
4327
4362
|
}
|
|
4328
|
-
function
|
|
4363
|
+
function ns(e, t) {
|
|
4329
4364
|
st(e, t), Ae(e, t), jo.set(t, Po(e));
|
|
4330
4365
|
}
|
|
4331
|
-
function
|
|
4366
|
+
function rs(e, t, n, r, i = {}, a) {
|
|
4332
4367
|
xa(e, t, i.officeFontRoutes, i.googleSubstitutes === !0), Ta(t, i.authoritativeMdw);
|
|
4333
4368
|
let o = i.dpr ?? 1, s = i.cellScale ?? 1, c = t.isChartSheet === !0, l = La(t), u = l.maximumDigitWidth, d = e.canvas.width / o, f = e.canvas.height / o;
|
|
4334
4369
|
e.clearRect(0, 0, d, f), e.fillStyle = "#ffffff", e.fillRect(0, 0, d, f);
|
|
4335
|
-
let p = (e) => Math.round(e * s), m = c ? 0 : p(50), h = c ? 0 : p(22), { rows: _, cols: v } = r, y = Math.max(1, Math.trunc(r.row) || 1), b = Math.max(1, Math.trunc(r.col) || 1), x = (i.scrollOffsetX ?? 0) * s, S = (i.scrollOffsetY ?? 0) * s, { col: C, row: w } = l.axesAtScale(s), T = C.bandsToCover(1, c ? 0 : i.freezeCols ?? 0, Math.max(0, d - m)), E = w.bandsToCover(1, c ? 0 : i.freezeRows ?? 0, Math.max(0, f - h)), D = E.at(-1)?.index ?? 0, O = T.at(-1)?.index ?? 0, k = T.map(({ index: e }) => e), A = E.map(({ index: e }) => e), j = T.map(({ size: e }) => e), M = E.map(({ size: e }) => e), N = j.reduce((e, t) => e + t, 0), P = M.reduce((e, t) => e + t, 0),
|
|
4370
|
+
let p = (e) => Math.round(e * s), m = c ? 0 : p(50), h = c ? 0 : p(22), { rows: _, cols: v } = r, y = Math.max(1, Math.trunc(r.row) || 1), b = Math.max(1, Math.trunc(r.col) || 1), x = (i.scrollOffsetX ?? 0) * s, S = (i.scrollOffsetY ?? 0) * s, { col: C, row: w } = l.axesAtScale(s), T = C.bandsToCover(1, c ? 0 : i.freezeCols ?? 0, Math.max(0, d - m)), E = w.bandsToCover(1, c ? 0 : i.freezeRows ?? 0, Math.max(0, f - h)), D = E.at(-1)?.index ?? 0, O = T.at(-1)?.index ?? 0, k = T.map(({ index: e }) => e), A = E.map(({ index: e }) => e), j = T.map(({ size: e }) => e), M = E.map(({ size: e }) => e), N = j.reduce((e, t) => e + t, 0), P = M.reduce((e, t) => e + t, 0), ee = C.bandsToCover(b, Math.min(16384, b + v - 1)), te = w.bandsToCover(y, Math.min(1048576, y + _ - 1)), F = ee.map(({ index: e }) => e), I = te.map(({ index: e }) => e), L = ee.map(({ size: e }) => e), R = te.map(({ size: e }) => e), { cellMap: z, cfContext: B, mergeSkipSet: V, autoFilterCells: ne, hyperlinkMap: re, commentCells: H, structuredStyleMap: U, sparklineMap: W, nonEmptyColsByRow: G } = Po(t, n), ie = /* @__PURE__ */ new Map(), K = No(t, "worksheet-merge-anchor-index", "index-merge-anchor-coordinates");
|
|
4336
4371
|
for (let e of t.mergeCells ?? []) {
|
|
4337
4372
|
let t = C.offsetOf(e.right + 1) - C.offsetOf(e.left), n = w.offsetOf(e.bottom + 1) - w.offsetOf(e.top);
|
|
4338
|
-
Vt(
|
|
4373
|
+
Vt(ie, `${e.top}:${e.left}`, {
|
|
4339
4374
|
totalW: t,
|
|
4340
4375
|
totalH: n,
|
|
4341
4376
|
right: e.right,
|
|
4342
4377
|
bottom: e.bottom
|
|
4343
|
-
},
|
|
4378
|
+
}, K);
|
|
4344
4379
|
}
|
|
4345
|
-
let
|
|
4380
|
+
let q = F[0] ?? b, ae = F.at(-1) ?? Math.min(16384, b + v - 1), oe = [...new Set([...A, ...I])], se = ts(e, t, n, z, G, B, U, ie, C, w, oe, q, ae, s, u, t.rightToLeft === !0, a), ce = O > 0 ? ts(e, t, n, z, G, B, U, ie, C, w, oe, 1, O, s, u, t.rightToLeft === !0, a) : {
|
|
4381
|
+
startCol: 1,
|
|
4382
|
+
endCol: 0,
|
|
4383
|
+
anchorKeys: /* @__PURE__ */ new Set()
|
|
4384
|
+
}, le = ce.endCol > O ? C.bandsToCover(1, ce.endCol) : T, J = le.map(({ index: e }) => e), ue = le.map(({ size: e }) => e), de = C.bandsToCover(se.startCol, se.endCol), fe = de.map(({ index: e }) => e), pe = de.map(({ size: e }) => e), me = x + C.offsetOf(q) - C.offsetOf(se.startCol), he = {
|
|
4346
4385
|
worksheet: t,
|
|
4347
4386
|
styles: n,
|
|
4348
4387
|
cellMap: z,
|
|
4349
|
-
mergeAnchorMap:
|
|
4350
|
-
mergeSkipSet:
|
|
4351
|
-
cfContext:
|
|
4352
|
-
colWidths:
|
|
4388
|
+
mergeAnchorMap: ie,
|
|
4389
|
+
mergeSkipSet: V,
|
|
4390
|
+
cfContext: B,
|
|
4391
|
+
colWidths: pe,
|
|
4353
4392
|
rowHeights: R,
|
|
4354
4393
|
colAxis: C,
|
|
4355
4394
|
rowAxis: w,
|
|
@@ -4361,76 +4400,107 @@ function $o(e, t, n, r, i = {}, a) {
|
|
|
4361
4400
|
startCol: b,
|
|
4362
4401
|
cs: s,
|
|
4363
4402
|
dpr: o,
|
|
4364
|
-
autoFilterCells:
|
|
4365
|
-
hyperlinkMap:
|
|
4366
|
-
commentCells:
|
|
4367
|
-
structuredStyleMap:
|
|
4368
|
-
sparklineMap:
|
|
4369
|
-
overflowTextAnchors:
|
|
4403
|
+
autoFilterCells: ne,
|
|
4404
|
+
hyperlinkMap: re,
|
|
4405
|
+
commentCells: H,
|
|
4406
|
+
structuredStyleMap: U,
|
|
4407
|
+
sparklineMap: W,
|
|
4408
|
+
overflowTextAnchors: se.anchorKeys,
|
|
4409
|
+
textRunPane: {
|
|
4410
|
+
first: O + 1,
|
|
4411
|
+
last: Infinity,
|
|
4412
|
+
ownerShiftX: 0
|
|
4413
|
+
},
|
|
4414
|
+
firstViewportCol: q,
|
|
4415
|
+
selectionLastCol: Infinity,
|
|
4416
|
+
textRuns: i.onTextRun ? {
|
|
4417
|
+
owned: /* @__PURE__ */ new Map(),
|
|
4418
|
+
foreign: /* @__PURE__ */ new Map()
|
|
4419
|
+
} : void 0,
|
|
4370
4420
|
mdw: u,
|
|
4371
|
-
onTextRun: i.onTextRun,
|
|
4372
4421
|
rtl: t.rightToLeft === !0,
|
|
4373
4422
|
canvasW: d,
|
|
4374
4423
|
threeD: i.threeD
|
|
4375
|
-
},
|
|
4376
|
-
|
|
4377
|
-
|
|
4424
|
+
}, ge = m, _e = h, ve = ge + N, ye = _e + P, be = Math.max(0, d - ve), xe = Math.max(0, f - ye), Se = ge - C.offsetOf(1), Ce = ve - x - C.offsetOf(q), we = c ? 0 : Math.max(0, Math.trunc(i.freezeCols ?? 0)), Te = {
|
|
4425
|
+
...he,
|
|
4426
|
+
textRunPane: {
|
|
4427
|
+
first: we + 1,
|
|
4428
|
+
last: Infinity,
|
|
4429
|
+
ownerShiftX: Se - Ce
|
|
4430
|
+
}
|
|
4431
|
+
}, Ee = {
|
|
4432
|
+
...he,
|
|
4433
|
+
overflowTextAnchors: ce.anchorKeys,
|
|
4434
|
+
textRunPane: {
|
|
4435
|
+
first: 1,
|
|
4436
|
+
last: we,
|
|
4437
|
+
ownerShiftX: Ce - Se
|
|
4438
|
+
},
|
|
4439
|
+
firstViewportCol: k[0] ?? 1,
|
|
4440
|
+
selectionLastCol: O
|
|
4441
|
+
};
|
|
4442
|
+
if (D > 0 && O > 0 && Ao(e, Ee, 1, 1, ue, M, J, A, 0, 0, ge, _e, ge, _e, N, P, a), D > 0 && Ao(e, Te, 1, se.startCol, pe, M, fe, A, me, 0, ve, _e, ve, _e, be, P, a), O > 0 && Ao(e, Ee, y, 1, ue, R, J, I, 0, S, ge, ye, ge, ye, N, xe, a), c || Ao(e, Te, y, se.startCol, pe, R, fe, I, me, S, ve, ye, ve, ye, be, xe, a), he.textRuns && i.onTextRun) {
|
|
4443
|
+
for (let e of he.textRuns.owned.values()) i.onTextRun(e);
|
|
4444
|
+
for (let [e, t] of he.textRuns.foreign) he.textRuns.owned.has(e) || i.onTextRun(t);
|
|
4445
|
+
}
|
|
4446
|
+
as(e, t, C, w, i.loadedImages, s, y, b, x, S, ve, ye, be, xe, t.rightToLeft === !0, d, i.threeD, i.regionMap, i.chartEx, a), !c && t.slicers && t.slicers.length > 0 && Gs(e, t, C, w, s, y, b, x, S, ve, ye, be, xe, t.rightToLeft === !0, d), c || is(e, d, f, y, b, _, v, L, R, F, I, x, S, j, M, k, A, N, P, m, h, s, o, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0, i.chromeColors);
|
|
4447
|
+
let De = t.rightToLeft === !0;
|
|
4378
4448
|
if (D > 0) {
|
|
4379
4449
|
e.save(), e.strokeStyle = Ma, e.lineWidth = .5, e.beginPath();
|
|
4380
|
-
let t =
|
|
4450
|
+
let t = ye + g(ye, .5, o);
|
|
4381
4451
|
e.moveTo(0, t), e.lineTo(d, t), e.stroke(), e.restore();
|
|
4382
4452
|
}
|
|
4383
4453
|
if (O > 0) {
|
|
4384
4454
|
e.save(), e.strokeStyle = Ma, e.lineWidth = .5, e.beginPath();
|
|
4385
|
-
let t =
|
|
4455
|
+
let t = De ? d - ve : ve, n = t + g(t, .5, o);
|
|
4386
4456
|
e.moveTo(n, h), e.lineTo(n, f), e.stroke(), e.restore();
|
|
4387
4457
|
}
|
|
4388
4458
|
}
|
|
4389
|
-
function
|
|
4390
|
-
let O = D?.surface ?? "#f8f9fa", k = D?.mutedSurface ?? "#e8eaed", A = D?.selectedSurface ?? "#caddf6", j = D?.border ?? "#c8ccd0", M = D?.accent ?? "#5b9bd5", N = D?.text ?? "#444", P = (e) => !T || e < T.start || e > T.end ? O : T.strong ? A : k,
|
|
4391
|
-
e.fillStyle = O, e.fillRect(
|
|
4392
|
-
let
|
|
4393
|
-
e.moveTo(
|
|
4394
|
-
let
|
|
4395
|
-
let i =
|
|
4396
|
-
e.fillStyle = P(t), e.fillRect(i, 0, r, x), e.strokeStyle =
|
|
4459
|
+
function is(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, _, v, y, b, x, S, C, w, T, E, D) {
|
|
4460
|
+
let O = D?.surface ?? "#f8f9fa", k = D?.mutedSurface ?? "#e8eaed", A = D?.selectedSurface ?? "#caddf6", j = D?.border ?? "#c8ccd0", M = D?.accent ?? "#5b9bd5", N = D?.text ?? "#444", P = (e) => !T || e < T.start || e > T.end ? O : T.strong ? A : k, ee = (e) => !T || e < T.start || e > T.end ? j : T.strong ? M : j, te = (e) => !w || e < w.start || e > w.end ? O : w.strong ? A : k, F = (e) => !w || e < w.start || e > w.end ? j : w.strong ? M : j, I = `${Math.max(1, Math.round(11 * S))}px ${ia}`, L = b + v, R = x + y, z = .5 / C, B = (e, n) => E ? Aa(e, n, t) : e, V = E ? t - b : 0;
|
|
4461
|
+
e.fillStyle = O, e.fillRect(V, 0, b, x), e.strokeStyle = j, e.lineWidth = .5, e.beginPath();
|
|
4462
|
+
let ne = E ? V + g(V, .5, C) : V + b - z;
|
|
4463
|
+
e.moveTo(ne, 0), e.lineTo(ne, x), e.moveTo(V, x - z), e.lineTo(V + b, x - z), e.stroke(), e.font = I, e.fillStyle = N;
|
|
4464
|
+
let re = (t, n, r) => {
|
|
4465
|
+
let i = B(n, r);
|
|
4466
|
+
e.fillStyle = P(t), e.fillRect(i, 0, r, x), e.strokeStyle = ee(t), e.lineWidth = .5, e.beginPath();
|
|
4397
4467
|
let a = i + g(i, .5, C);
|
|
4398
4468
|
e.moveTo(a, 0), e.lineTo(a, x), e.moveTo(i, x - z), e.lineTo(i + r, x - z), e.stroke(), e.fillStyle = N, e.textAlign = "center", e.textBaseline = "middle", e.fillText(Co(t), i + r / 2, x / 2);
|
|
4399
|
-
},
|
|
4400
|
-
let i =
|
|
4401
|
-
e.fillStyle =
|
|
4469
|
+
}, H = (t, n, r) => {
|
|
4470
|
+
let i = V;
|
|
4471
|
+
e.fillStyle = te(t), e.fillRect(i, n, b, r), e.strokeStyle = F(t), e.lineWidth = .5, e.beginPath();
|
|
4402
4472
|
let a = n + g(n, .5, C), o = E ? i + g(i, .5, C) : i + b - z;
|
|
4403
4473
|
e.moveTo(o, n), e.lineTo(o, n + r), e.moveTo(i, a), e.lineTo(i + b, a), e.stroke(), e.fillStyle = N, e.textBaseline = "middle";
|
|
4404
4474
|
let s = Math.max(2, Math.round(4 * S));
|
|
4405
4475
|
E ? (e.textAlign = "left", e.fillText(String(t), i + s, n + r / 2)) : (e.textAlign = "right", e.fillText(String(t), i + b - s, n + r / 2));
|
|
4406
4476
|
};
|
|
4407
4477
|
if (p.length > 0) {
|
|
4408
|
-
e.save(), e.beginPath(), e.rect(
|
|
4478
|
+
e.save(), e.beginPath(), e.rect(B(b, v), 0, v, x), e.clip();
|
|
4409
4479
|
let t = b;
|
|
4410
|
-
for (let e = 0; e < p.length; e++)
|
|
4480
|
+
for (let e = 0; e < p.length; e++) re(h[e], t, p[e]), t += p[e];
|
|
4411
4481
|
e.restore();
|
|
4412
4482
|
}
|
|
4413
|
-
e.save(), e.beginPath(), e.rect(
|
|
4414
|
-
let
|
|
4483
|
+
e.save(), e.beginPath(), e.rect(B(L, t - L), 0, t - L, x), e.clip();
|
|
4484
|
+
let U = L - d;
|
|
4415
4485
|
for (let e = 0; e < s.length; e++) {
|
|
4416
4486
|
let n = s[e];
|
|
4417
|
-
|
|
4487
|
+
U + n > L && U < t && re(l[e], U, n), U += n;
|
|
4418
4488
|
}
|
|
4419
4489
|
if (e.restore(), m.length > 0) {
|
|
4420
|
-
e.save(), e.beginPath(), e.rect(
|
|
4490
|
+
e.save(), e.beginPath(), e.rect(V, x, b, y), e.clip();
|
|
4421
4491
|
let t = x;
|
|
4422
|
-
for (let e = 0; e < m.length; e++)
|
|
4492
|
+
for (let e = 0; e < m.length; e++) H(_[e], t, m[e]), t += m[e];
|
|
4423
4493
|
e.restore();
|
|
4424
4494
|
}
|
|
4425
|
-
e.save(), e.beginPath(), e.rect(
|
|
4426
|
-
let
|
|
4495
|
+
e.save(), e.beginPath(), e.rect(V, R, b, n - R), e.clip();
|
|
4496
|
+
let W = R - f;
|
|
4427
4497
|
for (let e = 0; e < c.length; e++) {
|
|
4428
4498
|
let t = c[e];
|
|
4429
|
-
|
|
4499
|
+
W + t > R && W < n && H(u[e], W, t), W += t;
|
|
4430
4500
|
}
|
|
4431
4501
|
e.restore();
|
|
4432
4502
|
}
|
|
4433
|
-
function
|
|
4503
|
+
function as(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y) {
|
|
4434
4504
|
let b = [], x = 0;
|
|
4435
4505
|
if (i) for (let e of t.images ?? []) b.push({
|
|
4436
4506
|
kind: "image",
|
|
@@ -4452,17 +4522,17 @@ function ts(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y) {
|
|
|
4452
4522
|
anchor: e
|
|
4453
4523
|
});
|
|
4454
4524
|
b.sort((e, t) => e.zOrder - t.zOrder || e.fallbackOrder - t.fallbackOrder);
|
|
4455
|
-
for (let x of b) x.kind === "image" ?
|
|
4525
|
+
for (let x of b) x.kind === "image" ? cs(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, [x.anchor]) : x.kind === "shape" ? ls(e, t, n, r, a, o, s, c, l, u, d, f, p, i, m, h, [x.anchor], y, x.shape) : Ms(e, t, n, r, a, o, s, c, l, u, d, f, p, m, h, i, [x.anchor], g, _, v);
|
|
4456
4526
|
}
|
|
4457
|
-
function
|
|
4527
|
+
function os(e, t) {
|
|
4458
4528
|
return e.offsetOf(t);
|
|
4459
4529
|
}
|
|
4460
|
-
function
|
|
4530
|
+
function ss(e, t) {
|
|
4461
4531
|
return e.offsetOf(t);
|
|
4462
4532
|
}
|
|
4463
|
-
function
|
|
4533
|
+
function cs(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.images) {
|
|
4464
4534
|
if (f <= 0 || p <= 0) return;
|
|
4465
|
-
let _ =
|
|
4535
|
+
let _ = os(n, s), v = ss(r, o);
|
|
4466
4536
|
e.save(), e.beginPath();
|
|
4467
4537
|
let y = ja(u, f, h, m);
|
|
4468
4538
|
e.rect(y, d, f, p), e.clip();
|
|
@@ -4479,7 +4549,7 @@ function is(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.images) {
|
|
|
4479
4549
|
}, o.rotation);
|
|
4480
4550
|
if (k.x + k.width < y || k.x > y + f || k.y + k.height < d || k.y > d + p) continue;
|
|
4481
4551
|
let A = () => {
|
|
4482
|
-
b ?
|
|
4552
|
+
b ? V(e, b, o.srcRect, E, D, w, T) : Ee(e, "tiff", {
|
|
4483
4553
|
x: E,
|
|
4484
4554
|
y: D,
|
|
4485
4555
|
width: w,
|
|
@@ -4518,9 +4588,9 @@ function is(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.images) {
|
|
|
4518
4588
|
}
|
|
4519
4589
|
e.restore();
|
|
4520
4590
|
}
|
|
4521
|
-
function
|
|
4591
|
+
function ls(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.shapeGroups ?? [], _, v) {
|
|
4522
4592
|
if (d <= 0 || f <= 0 || g.length === 0) return;
|
|
4523
|
-
let y =
|
|
4593
|
+
let y = os(n, o), b = ss(r, a);
|
|
4524
4594
|
e.save(), e.beginPath();
|
|
4525
4595
|
let x = ja(l, d, h, m);
|
|
4526
4596
|
e.rect(x, u, d, f), e.clip();
|
|
@@ -4530,12 +4600,12 @@ function as(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.shapeGroups ??
|
|
|
4530
4600
|
let w = ja(l + (o - y) - s, S, h, m), T = u + (g - b) - c, E = v ? [v] : a.shapes, D = E.some((e) => e.geom?.type === "image" && me(e.geom.blipEffects ?? []));
|
|
4531
4601
|
if (!(!D && (w + S < x || w > x + d)) && !(!D && (T + C < u || T > u + f))) for (let t of E) {
|
|
4532
4602
|
let n = w + t.x * S, r = T + t.y * C, o = t.w * S, s = t.h * C;
|
|
4533
|
-
o <= 0 || s <= 0 ||
|
|
4603
|
+
o <= 0 || s <= 0 || fs(e, t, n, r, o, s, i, p, _, a);
|
|
4534
4604
|
}
|
|
4535
4605
|
}
|
|
4536
4606
|
e.restore();
|
|
4537
4607
|
}
|
|
4538
|
-
function
|
|
4608
|
+
function us(e, t, n, r, i, a) {
|
|
4539
4609
|
if (t.w <= 0 || t.h <= 0) return;
|
|
4540
4610
|
let o = i / t.w, s = a / t.h, c = n, l = r, u = n, d = r;
|
|
4541
4611
|
for (let i of t.commands) switch (i.op) {
|
|
@@ -4571,28 +4641,28 @@ function os(e, t, n, r, i, a) {
|
|
|
4571
4641
|
break;
|
|
4572
4642
|
}
|
|
4573
4643
|
}
|
|
4574
|
-
function
|
|
4575
|
-
if (t.geom.type === "custom") for (let o of t.geom.paths) o.fill !== "none" &&
|
|
4644
|
+
function ds(e, t, n, r, i, a) {
|
|
4645
|
+
if (t.geom.type === "custom") for (let o of t.geom.paths) o.fill !== "none" && us(e, o, n, r, i, a);
|
|
4576
4646
|
else (t.geom.type !== "preset" || !he(e, t.geom.name, n, r, i, a, t.geom.adj ?? [])) && e.rect(n, r, i, a);
|
|
4577
4647
|
}
|
|
4578
|
-
function
|
|
4579
|
-
if (x(t.strokeFill) && (e =
|
|
4580
|
-
let n =
|
|
4648
|
+
function fs(e, t, n, r, i, a, o, s, c, l) {
|
|
4649
|
+
if (x(t.strokeFill) && (e = F(e)), e.save(), t.rot !== 0 || t.flipH || t.flipV ? (e.translate(n + i / 2, r + a / 2), e.rotate(t.rot * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-i / 2, -a / 2)) : e.translate(n, r), t.geom.type === "custom") {
|
|
4650
|
+
let n = bs(e, t, i, a, o);
|
|
4581
4651
|
for (let r of t.geom.paths) if (!(r.w <= 0 || r.h <= 0)) {
|
|
4582
|
-
if (e.beginPath(),
|
|
4583
|
-
let t =
|
|
4652
|
+
if (e.beginPath(), us(e, r, 0, 0, i, a), r.fill !== "none" && xs(e, t, i, a, o, n)) {
|
|
4653
|
+
let t = G(r.fill);
|
|
4584
4654
|
t && (e.fillStyle = t, e.fill());
|
|
4585
4655
|
}
|
|
4586
|
-
r.stroke !== !1 &&
|
|
4656
|
+
r.stroke !== !1 && Cs(e, t, i, a, o);
|
|
4587
4657
|
}
|
|
4588
4658
|
} else if (t.geom.type === "preset") {
|
|
4589
|
-
let n =
|
|
4590
|
-
|
|
4659
|
+
let n = bs(e, t, i, a, o), r = t.strokeColor && t.strokeWidth > 0 ? () => Cs(e, t, i, a, o) : null;
|
|
4660
|
+
le(e, t.geom.name, 0, 0, i, a, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, a), vs(e, t, i, a, o));
|
|
4591
4661
|
} else if (t.geom.type === "image") {
|
|
4592
4662
|
let n = t.geom, r = l ? ea(l, t) : void 0, o = Zi(n.imagePath, ta(n, r), r), c = s?.get(o), u = Gi(s, o, "tiff");
|
|
4593
4663
|
if (c || u) {
|
|
4594
4664
|
let t = n.alpha, r = () => {
|
|
4595
|
-
c ?
|
|
4665
|
+
c ? V(e, c, n.srcRect, 0, 0, i, a) : Ee(e, "tiff", {
|
|
4596
4666
|
x: 0,
|
|
4597
4667
|
y: 0,
|
|
4598
4668
|
width: i,
|
|
@@ -4602,10 +4672,10 @@ function cs(e, t, n, r, i, a, o, s, c, l) {
|
|
|
4602
4672
|
t != null && t < 1 ? (e.save(), e.globalAlpha = t, r(), e.restore()) : r();
|
|
4603
4673
|
}
|
|
4604
4674
|
}
|
|
4605
|
-
t.text && ((t.text.vert === "wordArtVert" || t.text.vert === "wordArtVertRtl") && (t.flipH || t.flipV) ? (e.save(), e.translate(i / 2, a / 2), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), t.flipV && e.rotate(Math.PI), e.translate(-i / 2, -a / 2),
|
|
4675
|
+
t.text && ((t.text.vert === "wordArtVert" || t.text.vert === "wordArtVertRtl") && (t.flipH || t.flipV) ? (e.save(), e.translate(i / 2, a / 2), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), t.flipV && e.rotate(Math.PI), e.translate(-i / 2, -a / 2), _s(e, t.text, i, a, o, c), e.restore()) : _s(e, t.text, i, a, o, c)), e.restore();
|
|
4606
4676
|
}
|
|
4607
|
-
var
|
|
4608
|
-
function
|
|
4677
|
+
var ps = /* @__PURE__ */ new WeakMap();
|
|
4678
|
+
function ms(e) {
|
|
4609
4679
|
let t = [];
|
|
4610
4680
|
for (let n of e.shapeGroups ?? []) for (let e of n.shapes) for (let n of e.text?.paragraphs ?? []) for (let e of n.runs) e.type === "math" && t.push({
|
|
4611
4681
|
nodes: e.nodes,
|
|
@@ -4613,17 +4683,17 @@ function us(e) {
|
|
|
4613
4683
|
});
|
|
4614
4684
|
return t;
|
|
4615
4685
|
}
|
|
4616
|
-
function
|
|
4617
|
-
for (let t of e.shapeGroups ?? []) for (let e of t.shapes) for (let t of e.text?.paragraphs ?? []) for (let e of t.runs) if (e.type === "math" && !
|
|
4686
|
+
function hs(e) {
|
|
4687
|
+
for (let t of e.shapeGroups ?? []) for (let e of t.shapes) for (let t of e.text?.paragraphs ?? []) for (let e of t.runs) if (e.type === "math" && !ps.has(e.nodes)) return !0;
|
|
4618
4688
|
return !1;
|
|
4619
4689
|
}
|
|
4620
|
-
async function
|
|
4621
|
-
let n =
|
|
4690
|
+
async function gs(e, t) {
|
|
4691
|
+
let n = ms(e).filter((e) => !ps.has(e.nodes));
|
|
4622
4692
|
if (n.length !== 0) {
|
|
4623
4693
|
await t.loadMathJax();
|
|
4624
|
-
for (let e of n) if (!
|
|
4625
|
-
let n = await t.mathMLToSvg(
|
|
4626
|
-
|
|
4694
|
+
for (let e of n) if (!ps.has(e.nodes)) try {
|
|
4695
|
+
let n = await t.mathMLToSvg(re(e.nodes, e.display)), r = await ie(n, "#000000");
|
|
4696
|
+
ps.set(e.nodes, {
|
|
4627
4697
|
raster: r,
|
|
4628
4698
|
widthEm: n.widthEm,
|
|
4629
4699
|
ascentEm: n.ascentEm,
|
|
@@ -4633,7 +4703,7 @@ async function fs(e, t) {
|
|
|
4633
4703
|
} catch {}
|
|
4634
4704
|
}
|
|
4635
4705
|
}
|
|
4636
|
-
function
|
|
4706
|
+
function _s(t, n, r, i, a, o) {
|
|
4637
4707
|
if (r <= 0 || i <= 0 || n.paragraphs.length === 0) return;
|
|
4638
4708
|
let s = We(r, i, {
|
|
4639
4709
|
lIns: n.lIns,
|
|
@@ -4663,14 +4733,14 @@ function ps(t, n, r, i, a, o) {
|
|
|
4663
4733
|
face: r
|
|
4664
4734
|
};
|
|
4665
4735
|
}, (n, r) => {
|
|
4666
|
-
let i =
|
|
4736
|
+
let i = ps.get(n.nodes);
|
|
4667
4737
|
if (!i) return;
|
|
4668
4738
|
let o = (n.fontSize ?? r) * D * a * e, s = i.widthEm * o, c = (i.ascentEm + i.descentEm) * o;
|
|
4669
4739
|
return {
|
|
4670
4740
|
width: s,
|
|
4671
4741
|
height: c,
|
|
4672
4742
|
draw: (e, r) => {
|
|
4673
|
-
s > 0 && c > 0 && t.drawImage(
|
|
4743
|
+
s > 0 && c > 0 && t.drawImage(ae(i, n.color ?? "#000000"), e, r, s, c);
|
|
4674
4744
|
}
|
|
4675
4745
|
};
|
|
4676
4746
|
});
|
|
@@ -4698,7 +4768,7 @@ function ps(t, n, r, i, a, o) {
|
|
|
4698
4768
|
continue;
|
|
4699
4769
|
}
|
|
4700
4770
|
if (e.type === "math") {
|
|
4701
|
-
let t =
|
|
4771
|
+
let t = ps.get(e.nodes);
|
|
4702
4772
|
if (!t) continue;
|
|
4703
4773
|
let n = (e.fontSize ?? (h || ka)) * D * a, r = t.ascentEm * n, i = t.descentEm * n, o = {
|
|
4704
4774
|
kind: "math",
|
|
@@ -4790,7 +4860,7 @@ function ps(t, n, r, i, a, o) {
|
|
|
4790
4860
|
height: n.ascent + n.descent,
|
|
4791
4861
|
ascent: n.ascent
|
|
4792
4862
|
};
|
|
4793
|
-
},
|
|
4863
|
+
}, ee = v.length;
|
|
4794
4864
|
for (let [e, t] of x.entries()) {
|
|
4795
4865
|
let n = [], r = 0, a = 0, s = 0, l = 0, d = !1, f = !1;
|
|
4796
4866
|
for (let e of t.segments) {
|
|
@@ -4861,7 +4931,7 @@ function ps(t, n, r, i, a, o) {
|
|
|
4861
4931
|
gapBefore: 0
|
|
4862
4932
|
}), y.push(r);
|
|
4863
4933
|
}
|
|
4864
|
-
v.length >
|
|
4934
|
+
v.length > ee && (b && ee > 0 && (v[ee].gapBefore = Fe(ut(b.spaceAfter), b.lastNaturalHeight, D * a) + Fe(ut(r.spaceBefore), y[ee], D * a)), b = {
|
|
4865
4935
|
spaceAfter: r.spaceAfter,
|
|
4866
4936
|
lastNaturalHeight: y[v.length - 1]
|
|
4867
4937
|
});
|
|
@@ -4890,7 +4960,7 @@ function ps(t, n, r, i, a, o) {
|
|
|
4890
4960
|
let i = e.style;
|
|
4891
4961
|
if (i.kind === "text") t.font = i.font, t.fillStyle = i.color, t.fillText(i.text, r, n);
|
|
4892
4962
|
else if (i.kind === "math") {
|
|
4893
|
-
let e =
|
|
4963
|
+
let e = ae(i.render, i.color);
|
|
4894
4964
|
t.drawImage(e, r, n - i.ascent, i.w, i.ascent + i.descent);
|
|
4895
4965
|
}
|
|
4896
4966
|
});
|
|
@@ -4913,10 +4983,10 @@ function ps(t, n, r, i, a, o) {
|
|
|
4913
4983
|
w += e.height;
|
|
4914
4984
|
}
|
|
4915
4985
|
}
|
|
4916
|
-
function
|
|
4917
|
-
|
|
4986
|
+
function vs(e, t, n, r, i) {
|
|
4987
|
+
xs(e, t, n, r, i), Cs(e, t, n, r, i);
|
|
4918
4988
|
}
|
|
4919
|
-
function
|
|
4989
|
+
function ys(e, t, n) {
|
|
4920
4990
|
if (e.rot === 0 && !e.flipH && !e.flipV) return;
|
|
4921
4991
|
let r = e.rot * Math.PI / 180, i = Math.cos(r), a = Math.sin(r), o = e.flipH ? -1 : 1, s = e.flipV ? -1 : 1, c = o * i, l = -s * a, u = o * a, d = s * i, f = t / 2, p = n / 2;
|
|
4922
4992
|
return {
|
|
@@ -4928,16 +4998,16 @@ function hs(e, t, n) {
|
|
|
4928
4998
|
f: p - l * f - d * p
|
|
4929
4999
|
};
|
|
4930
5000
|
}
|
|
4931
|
-
function
|
|
4932
|
-
return
|
|
5001
|
+
function bs(e, t, n, r, i) {
|
|
5002
|
+
return ee(t.fill ?? (t.fillColor ? {
|
|
4933
5003
|
fillType: "solid",
|
|
4934
5004
|
color: t.fillColor
|
|
4935
|
-
} : null), e, 0, 0, n, r, t.rot, D * i,
|
|
5005
|
+
} : null), e, 0, 0, n, r, t.rot, D * i, ys(t, n, r), (e, n, r, i, a) => ds(e, t, n, r, i, a));
|
|
4936
5006
|
}
|
|
4937
|
-
function
|
|
5007
|
+
function xs(e, t, n, r, i, a = bs(e, t, n, r, i)) {
|
|
4938
5008
|
return a ? (e.fillStyle = a, e.fill(), !0) : !1;
|
|
4939
5009
|
}
|
|
4940
|
-
function
|
|
5010
|
+
function Ss(e) {
|
|
4941
5011
|
return !e.strokeColor || e.strokeWidth <= 0 ? null : {
|
|
4942
5012
|
color: e.strokeColor,
|
|
4943
5013
|
width: e.strokeWidth,
|
|
@@ -4953,17 +5023,17 @@ function vs(e) {
|
|
|
4953
5023
|
...e.strokeTailEnd ? { tailEnd: e.strokeTailEnd } : {}
|
|
4954
5024
|
};
|
|
4955
5025
|
}
|
|
4956
|
-
function
|
|
4957
|
-
let o =
|
|
5026
|
+
function Cs(t, n, r, i, a) {
|
|
5027
|
+
let o = Ss(n);
|
|
4958
5028
|
if (o) {
|
|
4959
5029
|
if (N(t, o, 1 / e), o.fill) {
|
|
4960
|
-
let e =
|
|
5030
|
+
let e = ee(o.fill, t, 0, 0, r, i, n.rot, D * a, ys(n, r, i), void 0, T(t));
|
|
4961
5031
|
e && (t.strokeStyle = e);
|
|
4962
5032
|
}
|
|
4963
5033
|
t.stroke();
|
|
4964
5034
|
}
|
|
4965
5035
|
}
|
|
4966
|
-
function
|
|
5036
|
+
function ws(e, t, n, r, i, a, o) {
|
|
4967
5037
|
if (r === n && i === t) return e;
|
|
4968
5038
|
let s = (e, r) => {
|
|
4969
5039
|
if (e === t && r === n) return null;
|
|
@@ -4983,7 +5053,7 @@ function bs(e, t, n, r, i, a, o) {
|
|
|
4983
5053
|
diagonalDown: e.diagonalDown ?? null
|
|
4984
5054
|
};
|
|
4985
5055
|
}
|
|
4986
|
-
function
|
|
5056
|
+
function Ts(e, t) {
|
|
4987
5057
|
if (!t) return e;
|
|
4988
5058
|
let n = (e, t) => t && t.style ? t : e ?? null;
|
|
4989
5059
|
return {
|
|
@@ -4995,7 +5065,7 @@ function xs(e, t) {
|
|
|
4995
5065
|
diagonalDown: n(e.diagonalDown, t.diagonalDown)
|
|
4996
5066
|
};
|
|
4997
5067
|
}
|
|
4998
|
-
function
|
|
5068
|
+
function Es(e, t, n, r, i = 1) {
|
|
4999
5069
|
return {
|
|
5000
5070
|
outerStart: n ? e - i : e,
|
|
5001
5071
|
outerEnd: r ? t + i : t,
|
|
@@ -5003,7 +5073,7 @@ function Ss(e, t, n, r, i = 1) {
|
|
|
5003
5073
|
innerEnd: r ? t - i : t
|
|
5004
5074
|
};
|
|
5005
5075
|
}
|
|
5006
|
-
function
|
|
5076
|
+
function Ds(e, t, n, r, i, a, o = 1) {
|
|
5007
5077
|
let s = [
|
|
5008
5078
|
{
|
|
5009
5079
|
edge: t.top,
|
|
@@ -5065,25 +5135,25 @@ function Cs(e, t, n, r, i, a, o = 1) {
|
|
|
5065
5135
|
}
|
|
5066
5136
|
if (c.style === "double" && p !== "d") {
|
|
5067
5137
|
if (e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), p === "h") {
|
|
5068
|
-
let o = u === r, s = o ? r - 1 : r + a + 1, c = o ? r + 1 : r + a - 1, l =
|
|
5138
|
+
let o = u === r, s = o ? r - 1 : r + a + 1, c = o ? r + 1 : r + a - 1, l = Es(n, n + i, !!t.left?.style && t.left.style !== "none", !!t.right?.style && t.right.style !== "none", 1);
|
|
5069
5139
|
e.moveTo(l.outerStart, s), e.lineTo(l.outerEnd, s), e.moveTo(l.innerStart, c), e.lineTo(l.innerEnd, c);
|
|
5070
5140
|
} else {
|
|
5071
|
-
let o = l === n, s = o ? n - 1 : n + i + 1, c = o ? n + 1 : n + i - 1, u =
|
|
5141
|
+
let o = l === n, s = o ? n - 1 : n + i + 1, c = o ? n + 1 : n + i - 1, u = Es(r, r + a, !!t.top?.style && t.top.style !== "none", !!t.bottom?.style && t.bottom.style !== "none", 1);
|
|
5072
5142
|
e.moveTo(s, u.outerStart), e.lineTo(s, u.outerEnd), e.moveTo(c, u.innerStart), e.lineTo(c, u.innerEnd);
|
|
5073
5143
|
}
|
|
5074
5144
|
e.stroke();
|
|
5075
5145
|
continue;
|
|
5076
5146
|
}
|
|
5077
5147
|
e.beginPath(), e.strokeStyle = s;
|
|
5078
|
-
let m =
|
|
5148
|
+
let m = Os(c.style);
|
|
5079
5149
|
e.lineWidth = m;
|
|
5080
|
-
let h =
|
|
5150
|
+
let h = ks(c.style);
|
|
5081
5151
|
e.setLineDash(h);
|
|
5082
5152
|
let _ = p === "v" ? g(l, m, o) : 0, v = p === "h" ? g(u, m, o) : 0;
|
|
5083
5153
|
e.moveTo(l + _, u + v), e.lineTo(d + _, f + v), e.stroke(), e.setLineDash([]);
|
|
5084
5154
|
}
|
|
5085
5155
|
}
|
|
5086
|
-
function
|
|
5156
|
+
function Os(e) {
|
|
5087
5157
|
switch (e) {
|
|
5088
5158
|
case "thick": return 3;
|
|
5089
5159
|
case "medium":
|
|
@@ -5095,10 +5165,10 @@ function ws(e) {
|
|
|
5095
5165
|
default: return 1;
|
|
5096
5166
|
}
|
|
5097
5167
|
}
|
|
5098
|
-
function
|
|
5168
|
+
function ks(e) {
|
|
5099
5169
|
return r(e);
|
|
5100
5170
|
}
|
|
5101
|
-
function
|
|
5171
|
+
function As(e) {
|
|
5102
5172
|
switch (e) {
|
|
5103
5173
|
case "double": return 13;
|
|
5104
5174
|
case "thick": return 12;
|
|
@@ -5116,15 +5186,15 @@ function Es(e) {
|
|
|
5116
5186
|
default: return 0;
|
|
5117
5187
|
}
|
|
5118
5188
|
}
|
|
5119
|
-
function
|
|
5120
|
-
let n =
|
|
5189
|
+
function js(e, t) {
|
|
5190
|
+
let n = As(e?.style), r = As(t?.style);
|
|
5121
5191
|
return n === 0 && r === 0 ? null : n >= r ? e ?? null : t ?? null;
|
|
5122
5192
|
}
|
|
5123
|
-
function
|
|
5193
|
+
function Ms(t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _ = n.charts, v, y, b) {
|
|
5124
5194
|
if (f <= 0 || p <= 0) return;
|
|
5125
|
-
let x =
|
|
5195
|
+
let x = os(r, s), S = ss(i, o), C = ja(u, f, h, m);
|
|
5126
5196
|
for (let n of _) {
|
|
5127
|
-
let o = n.fromCol + 1, s = n.fromRow + 1, _ = n.toCol + 1, w = n.toRow + 1, T =
|
|
5197
|
+
let o = n.fromCol + 1, s = n.fromRow + 1, _ = n.toCol + 1, w = n.toRow + 1, T = os(r, o) + n.fromColOff * a / e, E = ss(i, s) + n.fromRowOff * a / e, O = os(r, _) + n.toColOff * a / e, k = ss(i, w) + n.toRowOff * a / e, A = O - T, j = k - E;
|
|
5128
5198
|
if (A <= 0 || j <= 0) continue;
|
|
5129
5199
|
let M = ja(u + (T - x) - c, A, h, m), N = d + (E - S) - l;
|
|
5130
5200
|
M + A < C || M > C + f || N + j < d || N > d + p || (t.save(), t.beginPath(), t.rect(C, d, f, p), t.clip(), t.save(), a !== 1 && t.scale(a, a), De(t, n.chart, a === 1 ? {
|
|
@@ -5140,52 +5210,52 @@ function Os(t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _ = n.charts, v, y,
|
|
|
5140
5210
|
}, D, 0, v, y, g ? R(g) : void 0, b), t.restore(), t.restore());
|
|
5141
5211
|
}
|
|
5142
5212
|
}
|
|
5143
|
-
var
|
|
5144
|
-
function
|
|
5213
|
+
var Ns = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", Ps = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", Fs = "#FFFFFF", Is = "#BFBFBF", Ls = "#F2F2F2", Rs = "#404040", zs = "#FFFFFF", Bs = "#000000", Vs = "#A5A5A5", Hs = "#E7E6E6", Us = "#A6A6A6", Ws = "#C6C6C6";
|
|
5214
|
+
function Gs(t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
5145
5215
|
if (f <= 0 || p <= 0) return;
|
|
5146
5216
|
let g = n.slicers;
|
|
5147
5217
|
if (!g) return;
|
|
5148
|
-
let _ =
|
|
5218
|
+
let _ = os(r, s), v = ss(i, o), y = ja(u, f, h, m);
|
|
5149
5219
|
for (let n of g) {
|
|
5150
|
-
let o = n.fromCol + 1, s = n.fromRow + 1, g = n.toCol + 1, b = n.toRow + 1, x =
|
|
5220
|
+
let o = n.fromCol + 1, s = n.fromRow + 1, g = n.toCol + 1, b = n.toRow + 1, x = os(r, o) + n.fromColOff * a / e, S = ss(i, s) + n.fromRowOff * a / e, C = os(r, g) + n.toColOff * a / e, w = ss(i, b) + n.toRowOff * a / e, T = C - x, E = w - S;
|
|
5151
5221
|
if (T <= 0 || E <= 0) continue;
|
|
5152
5222
|
let D = ja(u + (x - _) - c, T, h, m), O = d + (S - v) - l;
|
|
5153
|
-
D + T < y || D > y + f || O + E < d || O > d + p || (t.save(), t.beginPath(), t.rect(y, d, f, p), t.clip(),
|
|
5223
|
+
D + T < y || D > y + f || O + E < d || O > d + p || (t.save(), t.beginPath(), t.rect(y, d, f, p), t.clip(), Ks(t, n.caption, n.items, D, O, T, E, a, n.style), t.restore());
|
|
5154
5224
|
}
|
|
5155
5225
|
}
|
|
5156
|
-
function
|
|
5226
|
+
function Ks(e, t, n, r, i, a, o, s, c) {
|
|
5157
5227
|
let l = c != null;
|
|
5158
|
-
e.fillStyle = c?.whole?.fillColor ??
|
|
5159
|
-
let u = l ? c.whole?.borderColor :
|
|
5228
|
+
e.fillStyle = c?.whole?.fillColor ?? Fs, e.fillRect(r, i, a, o);
|
|
5229
|
+
let u = l ? c.whole?.borderColor : Is;
|
|
5160
5230
|
u && (e.strokeStyle = u, e.lineWidth = 1, e.strokeRect(r + .5, i + .5, a - 1, o - 1));
|
|
5161
|
-
let d = Math.max(20 * s, 14), f = l ? c.header?.fillColor :
|
|
5162
|
-
f && (e.fillStyle = f, e.fillRect(r + 1, i + 1, a - 2, d)), e.fillStyle = c?.header?.fontColor ??
|
|
5231
|
+
let d = Math.max(20 * s, 14), f = l ? c.header?.fillColor : Ls;
|
|
5232
|
+
f && (e.fillStyle = f, e.fillRect(r + 1, i + 1, a - 2, d)), e.fillStyle = c?.header?.fontColor ?? Rs, e.font = Js(c?.header, Ns, s), e.textBaseline = "middle", e.textAlign = "left";
|
|
5163
5233
|
let p = 6 * s;
|
|
5164
|
-
if (
|
|
5234
|
+
if (Xs(e, t, r + p, i + d / 2 + 1, a - 2 * p), n.length === 0) return;
|
|
5165
5235
|
let m = Math.max(1, Math.round(2 * s)), h = 4 * s, g = r + h, _ = i + d + h, v = a - 2 * h, y = o - d - 2 * h;
|
|
5166
5236
|
if (v <= 0 || y <= 0) return;
|
|
5167
5237
|
let b = Math.max(18 * s, 16), x = Math.max(1, Math.floor((y + m) / (b + m))), S = Math.min(n.length, x), C = Math.min(b, (y - m * (S - 1)) / S);
|
|
5168
5238
|
if (C <= 0) return;
|
|
5169
|
-
e.font =
|
|
5239
|
+
e.font = Ys(Ps, s);
|
|
5170
5240
|
let w = 8 * s;
|
|
5171
5241
|
for (let t = 0; t < S; t++) {
|
|
5172
|
-
let r = n[t], i = _ + t * (C + m), a = r.selected, o = a ? c?.selectedItemWithData : c?.unselectedItemWithData, u = o?.fillColor ?? (a ?
|
|
5173
|
-
e.fillStyle = u, l ? (
|
|
5242
|
+
let r = n[t], i = _ + t * (C + m), a = r.selected, o = a ? c?.selectedItemWithData : c?.unselectedItemWithData, u = o?.fillColor ?? (a ? zs : Hs), d = l ? o?.borderColor : a ? Vs : Ws;
|
|
5243
|
+
e.fillStyle = u, l ? (qs(e, g, i, v, C, Math.min(4 * s, C / 4)), e.fill(), d && (e.strokeStyle = d, e.lineWidth = 1, e.stroke())) : (e.fillRect(g, i, v, C), d && (e.strokeStyle = d, e.lineWidth = 1, e.strokeRect(g + .5, i + .5, v - 1, C - 1))), e.font = Js(o, Ps, s), e.fillStyle = o?.fontColor ?? (a ? Bs : Us), Xs(e, r.name, g + w, i + C / 2 + 1, v - 2 * w);
|
|
5174
5244
|
}
|
|
5175
5245
|
}
|
|
5176
|
-
function
|
|
5246
|
+
function qs(e, t, n, r, i, a) {
|
|
5177
5247
|
let o = Math.max(0, Math.min(a, r / 2, i / 2));
|
|
5178
5248
|
e.beginPath(), e.moveTo(t + o, n), e.lineTo(t + r - o, n), e.quadraticCurveTo(t + r, n, t + r, n + o), e.lineTo(t + r, n + i - o), e.quadraticCurveTo(t + r, n + i, t + r - o, n + i), e.lineTo(t + o, n + i), e.quadraticCurveTo(t, n + i, t, n + i - o), e.lineTo(t, n + o), e.quadraticCurveTo(t, n, t + o, n), e.closePath();
|
|
5179
5249
|
}
|
|
5180
|
-
function
|
|
5181
|
-
if (!e) return
|
|
5250
|
+
function Js(e, t, n) {
|
|
5251
|
+
if (!e) return Ys(t, n);
|
|
5182
5252
|
let r = Math.round((e.fontSize ?? 11) * n);
|
|
5183
5253
|
return `${e.fontBold ? "bold " : ""}${r}px ${e.fontFamily ? `"${e.fontFamily}", "Segoe UI", sans-serif` : "\"Meiryo UI\", \"Segoe UI\", sans-serif"}`;
|
|
5184
5254
|
}
|
|
5185
|
-
function
|
|
5255
|
+
function Ys(e, t) {
|
|
5186
5256
|
return e.replace(/(\d+(?:\.\d+)?)px/, (e, n) => `${Math.round(Number(n) * t)}px`);
|
|
5187
5257
|
}
|
|
5188
|
-
function
|
|
5258
|
+
function Xs(e, t, n, r, i) {
|
|
5189
5259
|
if (i <= 0) return;
|
|
5190
5260
|
let a = t;
|
|
5191
5261
|
if (e.measureText(a).width > i) {
|
|
@@ -5194,4 +5264,4 @@ function Ks(e, t, n, r, i) {
|
|
|
5194
5264
|
}
|
|
5195
5265
|
e.fillText(a, n, r);
|
|
5196
5266
|
}
|
|
5197
|
-
export { Bi as A, at as B, qi as C, Li as D, Ri as E, Tt as F, it as H, wt as I, Et as L, Si as M, cn as N, Pi as O, St as P, Dt as R, Ji as S, Wi as T, st as V,
|
|
5267
|
+
export { Bi as A, at as B, qi as C, Li as D, Ri as E, Tt as F, it as H, wt as I, Et as L, Si as M, cn as N, Pi as O, St as P, Dt as R, Ji as S, Wi as T, st as V, gs as _, Na as a, ja as b, ea as c, Zi as d, ta as f, Ta as g, Mo as h, Qi as i, Ci as j, Vi as k, Go as l, qo as m, xa as n, Ko as o, ns as p, Ca as r, La as s, Wo as t, $i as u, rs as v, Ui as w, hs as x, Aa as y, dt as z };
|