@silurus/ooxml 0.77.1 → 0.78.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 +2 -2
- package/dist/{canvas-viewer-mechanics-D5zXbOrS.js → canvas-viewer-mechanics-ChxLdOJg.js} +1 -1
- package/dist/{document-pull-client-CC8pPuzi.js → document-pull-client-xsdVDuVD.js} +2 -2
- package/dist/{docx-Dg9N9OX4.js → docx-CZC3j4s4.js} +4 -4
- package/dist/docx.mjs +3 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-BtfPlM2A.js → line-distribute-HuZyTARz.js} +1 -1
- package/dist/{line-metrics-B66x33iy.js → line-metrics-z9AdgPaZ.js} +2498 -1724
- package/dist/node.mjs +7 -7
- package/dist/{pptx-BFP7Isgf.js → pptx-c3UgGKIs.js} +5 -5
- package/dist/pptx.mjs +4 -4
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-BzxTAscX.js +27 -0
- package/dist/render-worker-host-CBjWHxMb.js +27 -0
- package/dist/render-worker-host-Ivhx3KII.js +27 -0
- package/dist/{render-D-cOpMLV.js → render-yhFUeiYl.js} +1 -1
- package/dist/{resource-measurement-CVfVTQrt.js → resource-measurement-5g27Av6n.js} +1 -1
- package/dist/{session-DxAVpIP-.js → session-BOuXp10X.js} +2 -2
- package/dist/{slide-pull-client-Lag44QA8.js → slide-pull-client-DKckZrLx.js} +4 -4
- package/dist/types/docx.d.ts +98 -8
- package/dist/types/index.d.ts +80 -12
- package/dist/types/node.d.ts +73 -6
- package/dist/types/pptx.d.ts +72 -8
- package/dist/types/xlsx.d.ts +76 -8
- package/dist/{worksheet-pull-client-D74b_23i.js → worksheet-pull-client-CMDRPZ5E.js} +2 -2
- package/dist/{xlsx-Bik59Raj.js → xlsx-BAScjxlC.js} +965 -673
- package/dist/xlsx.mjs +4 -4
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/render-worker-host-BzpMoFRr.js +0 -27
- package/dist/render-worker-host-CdZ5hW2X.js +0 -27
- package/dist/render-worker-host-quqYq02i.js +0 -27
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { $t as t, A as n, B as r, C as i, Ct as a, D as o, Dt as s, Et as c, It as l, J as u, Kt as d, Lt as f, M as p, O as m, Ot as h, R as g, S as _, T as v, Tt as y, Ut as b, V as x, Xt as S, Yt as C, _ as w, _t as T, a as E, an as D, c as O, cn as k, d as A, dn as j, en as M, f as
|
|
3
|
-
import { C as
|
|
2
|
+
import { $t as t, A as n, B as r, C as i, Ct as a, D as o, Dt as s, Et as c, It as l, J as u, Kt as d, Lt as f, M as p, O as m, Ot as h, R as g, S as _, T as v, Tt as y, Ut as b, V as x, Xt as S, Yt as C, _ as w, _t as T, a as E, an as D, c as O, cn as k, d as A, dn as j, en as M, f as ee, fn as te, g as N, gn as P, gt as F, h as I, hn as L, ht as R, in as z, it as ne, j as B, kt as V, ln as re, m as H, mn as ie, mt as U, n as W, nn as ae, on as G, p as oe, pn as se, pt as ce, q as le, qt as ue, rn as de, s as fe, sn as pe, tn as K, u as q, un as me, vt as J, w as he, y as ge, z as _e } from "./line-metrics-z9AdgPaZ.js";
|
|
3
|
+
import { C as Y, E as ve, S as ye, T as be, _ as xe, a as Se, b as Ce, d as we, f as Te, h as Ee, i as De, l as Oe, m as ke, p as Ae, t as je, u as Me, v as Ne, w as Pe, x as Fe, y as Ie } from "./canvas-viewer-mechanics-ChxLdOJg.js";
|
|
4
4
|
import { a as Le, i as Re, t as ze } from "./bounded-raw-part-cache-C6ro6Ezf.js";
|
|
5
|
-
import { i as Be } from "./resource-measurement-
|
|
5
|
+
import { i as Be } from "./resource-measurement-5g27Av6n.js";
|
|
6
6
|
import { t as Ve } from "./mathjax-CMjda8Ip.js";
|
|
7
7
|
import { n as He, r as Ue, t as We } from "./visible-index-CgyJLAS_.js";
|
|
8
|
-
import { a as Ge, c as Ke, d as qe, i as Je, l as Ye, n as Xe, o as Ze, s as Qe, t as $e, u as et } from "./worksheet-pull-client-
|
|
8
|
+
import { a as Ge, c as Ke, d as qe, i as Je, l as Ye, n as Xe, o as Ze, s as Qe, t as $e, u as et } from "./worksheet-pull-client-CMDRPZ5E.js";
|
|
9
9
|
//#region packages/core/src/sparkline/renderer.ts
|
|
10
10
|
function tt(e, t, n) {
|
|
11
11
|
let { values: r } = n;
|
|
@@ -642,13 +642,13 @@ function Bt(e) {
|
|
|
642
642
|
}
|
|
643
643
|
function Vt() {
|
|
644
644
|
let e = /* @__PURE__ */ new Date();
|
|
645
|
-
return
|
|
645
|
+
return de(new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate())), !1);
|
|
646
646
|
}
|
|
647
647
|
function Ht() {
|
|
648
|
-
return
|
|
648
|
+
return de(new Date(Date.now()), !1);
|
|
649
649
|
}
|
|
650
650
|
function Ut(e, t, n) {
|
|
651
|
-
return Math.floor(
|
|
651
|
+
return Math.floor(de(new Date(Date.UTC(e, t - 1, n)), !1));
|
|
652
652
|
}
|
|
653
653
|
function Wt(e) {
|
|
654
654
|
return ae(Math.floor(e), !1);
|
|
@@ -1156,11 +1156,11 @@ function En(e, t, n) {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
if (r.exp) {
|
|
1158
1158
|
let e = Math.max(r.intSpec.length, 1), t = r.fracSpec.length, n = 0, i = 0;
|
|
1159
|
-
o !== 0 && (i = Math.floor(Math.log10(o)), i = Math.floor(i / e) * e, n = o / 10 ** i, parseFloat(
|
|
1160
|
-
let [s, c = ""] =
|
|
1159
|
+
o !== 0 && (i = Math.floor(Math.log10(o)), i = Math.floor(i / e) * e, n = o / 10 ** i, parseFloat(K(n, t)) >= 10 ** e && (i += e, n = o / 10 ** i));
|
|
1160
|
+
let [s, c = ""] = K(n, t).split(".");
|
|
1161
1161
|
return a + Dn(r, Cn(s, r.intSpec, !1), wn(c, r.fracSpec), "E" + (i < 0 ? "-" : r.exp.plus ? "+" : "") + String(Math.abs(i)).padStart(r.exp.width, "0"));
|
|
1162
1162
|
}
|
|
1163
|
-
let s = r.fracSpec.length, [c, l = ""] =
|
|
1163
|
+
let s = r.fracSpec.length, [c, l = ""] = K(o, s).split("."), u = c.replace(/^0+/, ""), d = /[0]/.test(r.intSpec) || r.intSpec === "" && !1;
|
|
1164
1164
|
return u === "" && d && (u = "0"), a + Dn(r, Cn(u, r.intSpec, r.grouping), wn(l, r.fracSpec), "");
|
|
1165
1165
|
}
|
|
1166
1166
|
function Dn(e, t, n, r) {
|
|
@@ -1211,7 +1211,7 @@ function On(e, t) {
|
|
|
1211
1211
|
var kn = u;
|
|
1212
1212
|
function An(e, t) {
|
|
1213
1213
|
let n = kn;
|
|
1214
|
-
return new
|
|
1214
|
+
return new P(`XLSX renderer ${e.resource} exceeded its hard limit of ${n} entries`, {
|
|
1215
1215
|
stage: "rendering",
|
|
1216
1216
|
violation: {
|
|
1217
1217
|
format: "xlsx",
|
|
@@ -1758,18 +1758,18 @@ function cr(e, t) {
|
|
|
1758
1758
|
//#endregion
|
|
1759
1759
|
//#region packages/xlsx/src/vertical-text.ts
|
|
1760
1760
|
function lr(e, t, n, r, i, a = !1) {
|
|
1761
|
-
let o = t.codePointAt(0) ?? 0, s =
|
|
1761
|
+
let o = t.codePointAt(0) ?? 0, s = ee(o);
|
|
1762
1762
|
if (a && oe(o)) {
|
|
1763
1763
|
e.save(), e.translate(n, r + i / 2), e.textAlign = "center", e.textBaseline = "middle", O(e, () => e.fillText(t, 0, 0)), e.restore();
|
|
1764
1764
|
return;
|
|
1765
1765
|
}
|
|
1766
1766
|
if (s === "Tr") {
|
|
1767
|
-
let a =
|
|
1767
|
+
let a = q(o);
|
|
1768
1768
|
if (a !== null) {
|
|
1769
1769
|
e.fillText(String.fromCodePoint(a), n, r);
|
|
1770
1770
|
return;
|
|
1771
1771
|
}
|
|
1772
|
-
if (
|
|
1772
|
+
if (H(o)) {
|
|
1773
1773
|
e.fillText(t, n, r);
|
|
1774
1774
|
return;
|
|
1775
1775
|
}
|
|
@@ -1789,12 +1789,12 @@ function ur(e) {
|
|
|
1789
1789
|
function dr(e, t) {
|
|
1790
1790
|
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
1791
1791
|
}
|
|
1792
|
-
var fr =
|
|
1792
|
+
var fr = pe.map((e) => `"${e}"`).join(", "), pr = k.map((e) => `"${e}"`).join(", "), mr = `"Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${fr}, sans-serif`, hr = `"Cambria", "Caladea", "Times New Roman", "Liberation Serif", "Noto Naskh Arabic", "Noto Sans Arabic", ${pr}, serif`, gr = "\"Courier New\", \"Liberation Mono\", monospace";
|
|
1793
1793
|
function _r(e) {
|
|
1794
|
-
let t = e ? j(e) : null, n =
|
|
1794
|
+
let t = e ? j(e) : null, n = te(e);
|
|
1795
1795
|
if (!t) return n === "serif" ? hr : n === "mono" ? gr : mr;
|
|
1796
1796
|
let r = n === "serif";
|
|
1797
|
-
return `${
|
|
1797
|
+
return `${me(t, r ? "serif" : "sans").map((e) => `"${e}"`).join(", ")}, "Calibri", "Carlito", "Cambria", "Caladea", Arial, "Noto Naskh Arabic", "Noto Sans Arabic", ${r ? pr : fr}, ${r ? "serif" : "sans-serif"}`;
|
|
1798
1798
|
}
|
|
1799
1799
|
function vr(e) {
|
|
1800
1800
|
return e ? `"${e}", ${_r(e)}` : mr;
|
|
@@ -2213,7 +2213,7 @@ function Kr(e, t, n) {
|
|
|
2213
2213
|
let r = [], i = [], a = 0;
|
|
2214
2214
|
for (; a < t.length;) {
|
|
2215
2215
|
let e = t[a], n = e.codePointAt(0) ?? 0;
|
|
2216
|
-
if (
|
|
2216
|
+
if (he(n)) i.push(e), a += n > 65535 ? 2 : 1;
|
|
2217
2217
|
else if (e === " ") {
|
|
2218
2218
|
let e = a;
|
|
2219
2219
|
for (; e < t.length && t[e] === " ";) e++;
|
|
@@ -2222,10 +2222,10 @@ function Kr(e, t, n) {
|
|
|
2222
2222
|
let e = a;
|
|
2223
2223
|
for (; e < t.length;) {
|
|
2224
2224
|
let n = t[e], r = n.codePointAt(0) ?? 0;
|
|
2225
|
-
if (n === " " ||
|
|
2225
|
+
if (n === " " || he(r)) break;
|
|
2226
2226
|
e += r > 65535 ? 2 : 1;
|
|
2227
2227
|
}
|
|
2228
|
-
let n = t.slice(a, e), r =
|
|
2228
|
+
let n = t.slice(a, e), r = I(n) ? _(n) : null;
|
|
2229
2229
|
if (r && r.length > 0) {
|
|
2230
2230
|
let e = 0;
|
|
2231
2231
|
for (let t of r) i.push(n.slice(e, t)), e = t;
|
|
@@ -2279,7 +2279,7 @@ function qr(e, t, n, r, i) {
|
|
|
2279
2279
|
let a = e.measureText(t).width;
|
|
2280
2280
|
if (o.length > 0 && s + a > i) {
|
|
2281
2281
|
let i = o.flatMap((e) => [...e.text]), a = Ur(i, [...t]);
|
|
2282
|
-
a > 0 ? a = Wr(i, a) : !
|
|
2282
|
+
a > 0 ? a = Wr(i, a) : !I(t) && !I(o[o.length - 1]?.text ?? "") && !/^\s/u.test(t) && !/\s$/u.test(i.at(-1) ?? "") && (a = Gr(i, [...t]));
|
|
2283
2283
|
let u = o[o.length - 1], d = [...u.text];
|
|
2284
2284
|
a > d.length && (a = d.length);
|
|
2285
2285
|
let f = null;
|
|
@@ -2311,15 +2311,15 @@ function qr(e, t, n, r, i) {
|
|
|
2311
2311
|
return;
|
|
2312
2312
|
}
|
|
2313
2313
|
e.font = Ir(Xr(n), r);
|
|
2314
|
-
let o = (t) => e.measureText(t).width, c =
|
|
2314
|
+
let o = (t) => e.measureText(t).width, c = ge(t), l = t.length, u = 0;
|
|
2315
2315
|
for (; u < l;) {
|
|
2316
|
-
let e = i - s, r =
|
|
2316
|
+
let e = i - s, r = N(t, a, u, e, o, c);
|
|
2317
2317
|
if (r <= u) {
|
|
2318
2318
|
if (s > 0) {
|
|
2319
2319
|
p();
|
|
2320
2320
|
continue;
|
|
2321
2321
|
}
|
|
2322
|
-
let n = a.find((e) => e > u) ?? l, i = t.slice(u, n), d = w(i), f =
|
|
2322
|
+
let n = a.find((e) => e > u) ?? l, i = t.slice(u, n), d = w(i), f = N(i, d, 0, e, o, c);
|
|
2323
2323
|
f <= 0 && (f = d.length > 0 ? d[0] : i.length), r = u + f;
|
|
2324
2324
|
}
|
|
2325
2325
|
h(t.slice(u, r), n), u = r, u < l && p();
|
|
@@ -2330,7 +2330,7 @@ function qr(e, t, n, r, i) {
|
|
|
2330
2330
|
for (; i < e.text.length;) {
|
|
2331
2331
|
let t = e.text[i], n = t.codePointAt(0) ?? 0;
|
|
2332
2332
|
if (n === 10) r.push("\n"), i += 1;
|
|
2333
|
-
else if (
|
|
2333
|
+
else if (he(n)) r.push(t), i += n > 65535 ? 2 : 1;
|
|
2334
2334
|
else if (t === " ") {
|
|
2335
2335
|
let t = i;
|
|
2336
2336
|
for (; t < e.text.length && e.text[t] === " ";) t++;
|
|
@@ -2339,13 +2339,13 @@ function qr(e, t, n, r, i) {
|
|
|
2339
2339
|
let t = i;
|
|
2340
2340
|
for (; t < e.text.length;) {
|
|
2341
2341
|
let n = e.text[t], r = n.codePointAt(0) ?? 0;
|
|
2342
|
-
if (n === " " || n === "\n" ||
|
|
2342
|
+
if (n === " " || n === "\n" || he(r)) break;
|
|
2343
2343
|
t += r > 65535 ? 2 : 1;
|
|
2344
2344
|
}
|
|
2345
2345
|
r.push(e.text.slice(i, t)), i = t;
|
|
2346
2346
|
}
|
|
2347
2347
|
}
|
|
2348
|
-
for (let e of r) e === "\n" ? (m(), f++) :
|
|
2348
|
+
for (let e of r) e === "\n" ? (m(), f++) : I(e) ? g(e, t) : h(e, t);
|
|
2349
2349
|
}
|
|
2350
2350
|
return (o.length > 0 || a.length > 0) && m(), a;
|
|
2351
2351
|
}
|
|
@@ -2641,7 +2641,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2641
2641
|
let j = [], M = -l;
|
|
2642
2642
|
for (let e = 0; e < T; e++) j.push(M), M += a[e];
|
|
2643
2643
|
e.save(), e.beginPath(), e.rect(O(f, m), p, m, h), e.clip();
|
|
2644
|
-
let
|
|
2644
|
+
let ee = [], te = [], N = [];
|
|
2645
2645
|
for (let i of t.worksheet.mergeCells ?? []) {
|
|
2646
2646
|
let a = i.top, f = i.left;
|
|
2647
2647
|
if (E.has(a) && D.has(f) || !s.some((e) => e >= i.top && e <= i.bottom) || !o.some((e) => e >= i.left && e <= i.right)) continue;
|
|
@@ -2654,28 +2654,28 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2654
2654
|
let t = Math.max(0, (_ - 4) * M.dataBar.ratio);
|
|
2655
2655
|
Tr(e, M.dataBar.color, m + 2, h + 2, t, v - 4, M.dataBar.gradient);
|
|
2656
2656
|
}
|
|
2657
|
-
let
|
|
2658
|
-
if (
|
|
2659
|
-
let
|
|
2660
|
-
if (!
|
|
2661
|
-
let
|
|
2657
|
+
let ee = Gi(Wi(A, a, f, p.right, p.bottom, t.cellMap, g), M.border);
|
|
2658
|
+
if (te.push(() => qi(e, ee, m, h, _, v, S)), !w) continue;
|
|
2659
|
+
let N = Xt(w, g, M.numFmt, t.worksheet.date1904), P = N.text;
|
|
2660
|
+
if (!P || P === "0" && t.worksheet.showZeros === !1) continue;
|
|
2661
|
+
let F = T.bold || !!M.fontBold, I = T.italic || !!M.fontItalic, L = T.underline || !!M.fontUnderline, R = T.strike || !!M.fontStrike, z = F !== T.bold || I !== T.italic || L !== T.underline || R !== T.strike ? {
|
|
2662
2662
|
...T,
|
|
2663
|
-
bold:
|
|
2664
|
-
italic:
|
|
2663
|
+
bold: F,
|
|
2664
|
+
italic: I,
|
|
2665
2665
|
underline: L,
|
|
2666
2666
|
strike: R
|
|
2667
2667
|
} : T;
|
|
2668
2668
|
e.font = Ir(z, x);
|
|
2669
|
-
let ne = t.hyperlinkMap.get(y) ? "#0563C1" : M.fontColor ??
|
|
2669
|
+
let ne = t.hyperlinkMap.get(y) ? "#0563C1" : M.fontColor ?? N.color ?? T.color;
|
|
2670
2670
|
e.fillStyle = ne ? C(ne) : "#000000";
|
|
2671
|
-
let B = w.value.type === "number", V = j.alignH ?? (B ? "right" : "left"),
|
|
2671
|
+
let B = w.value.type === "number", V = j.alignH ?? (B ? "right" : "left"), re = j.alignV ?? "bottom", H = j.indent ? Math.round(j.indent * 3 * t.mdw) : 0, ie = 3 + (V === "left" || !j.alignH ? H : 0);
|
|
2672
2672
|
e.save(), e.beginPath(), e.rect(m, h, _, v), e.clip();
|
|
2673
2673
|
let U;
|
|
2674
2674
|
V === "right" ? (U = m + _ - 3, e.textAlign = "right") : V === "center" ? (U = m + _ / 2, e.textAlign = "center") : (U = m + ie, e.textAlign = "left");
|
|
2675
2675
|
let W = w.value.type === "text" ? w.value.runs : void 0, ae = W && W.length > 0;
|
|
2676
2676
|
if (j.wrapText && ae) ii(e, W, z, {
|
|
2677
2677
|
alignH: V,
|
|
2678
|
-
alignV:
|
|
2678
|
+
alignV: re,
|
|
2679
2679
|
cx: m,
|
|
2680
2680
|
cy: h,
|
|
2681
2681
|
cellW: _,
|
|
@@ -2687,9 +2687,9 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2687
2687
|
fontColor: M.fontColor,
|
|
2688
2688
|
readingOrder: j.readingOrder
|
|
2689
2689
|
});
|
|
2690
|
-
else if (j.wrapText) ri(e,
|
|
2690
|
+
else if (j.wrapText) ri(e, P, U, z, {
|
|
2691
2691
|
alignH: V,
|
|
2692
|
-
alignV:
|
|
2692
|
+
alignV: re,
|
|
2693
2693
|
cx: m,
|
|
2694
2694
|
cy: h,
|
|
2695
2695
|
cellW: _,
|
|
@@ -2700,7 +2700,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2700
2700
|
}, x);
|
|
2701
2701
|
else if (ae) ni(e, W, z, {
|
|
2702
2702
|
alignH: V,
|
|
2703
|
-
alignV:
|
|
2703
|
+
alignV: re,
|
|
2704
2704
|
cx: m,
|
|
2705
2705
|
cy: h,
|
|
2706
2706
|
cellW: _,
|
|
@@ -2715,7 +2715,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2715
2715
|
else {
|
|
2716
2716
|
let { baseline: t, textY: n } = Yr({
|
|
2717
2717
|
alignH: V,
|
|
2718
|
-
alignV:
|
|
2718
|
+
alignV: re,
|
|
2719
2719
|
cx: m,
|
|
2720
2720
|
cy: h,
|
|
2721
2721
|
cellW: _,
|
|
@@ -2724,13 +2724,16 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2724
2724
|
paddingX: 3,
|
|
2725
2725
|
paddingY: 2
|
|
2726
2726
|
});
|
|
2727
|
-
e.textBaseline = t, e.fillText(
|
|
2727
|
+
e.textBaseline = t, e.fillText(P, U, n);
|
|
2728
2728
|
}
|
|
2729
2729
|
e.restore();
|
|
2730
2730
|
}
|
|
2731
2731
|
for (let n = 0; n < T; n++) {
|
|
2732
2732
|
let r = s[n], c = d + j[n], l = a[n];
|
|
2733
|
-
if (c + l <= p || c >= p + h)
|
|
2733
|
+
if ((c + l <= p || c >= p + h) && !o.some((e) => {
|
|
2734
|
+
let t = v.get(`${r}:${e}`);
|
|
2735
|
+
return t != null && c + t.totalH > p && c < p + h;
|
|
2736
|
+
})) continue;
|
|
2734
2737
|
let T = /* @__PURE__ */ new Set(), E = /* @__PURE__ */ new Set(), D = -1, A = (e) => {
|
|
2735
2738
|
if (D >= 0 && e - D >= 2) {
|
|
2736
2739
|
for (let t = D; t < e - 1; t++) T.add(t);
|
|
@@ -2750,105 +2753,105 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2750
2753
|
t ? n && D >= 0 && e > D ? (A(e), D = e) : D < 0 && (D = e) : A(e);
|
|
2751
2754
|
}
|
|
2752
2755
|
for (let a = 0; a < w; a++) {
|
|
2753
|
-
let s = o[a], d = u + k[a],
|
|
2754
|
-
if (
|
|
2755
|
-
let
|
|
2756
|
-
if (
|
|
2757
|
-
let
|
|
2758
|
-
if (Ar(e,
|
|
2759
|
-
let t = Math.max(0, (
|
|
2760
|
-
Tr(e,
|
|
2756
|
+
let s = o[a], d = u + k[a], D = i[a], A = `${r}:${s}`;
|
|
2757
|
+
if (y.has(A)) continue;
|
|
2758
|
+
let j = v.get(A), M = j ? j.totalW : D, P = j ? j.totalH : l, F = d + M <= f || d >= f + m;
|
|
2759
|
+
if (c + P <= p || c >= p + h || F && !t.overflowTextAnchors.has(A)) continue;
|
|
2760
|
+
let I = O(d, M), L = _.get(A), { font: R, fill: z, border: ne, xf: B } = Vr(g, L?.styleIndex ?? 0), V = Jn(L, r, s, b, g.dxfs ?? []), re = V.fill ?? z, H = t.tableStyleMap.get(A), ie = g.dxfs ?? [], W = (e) => e == null ? void 0 : ie[e], ae = W(H?.wholeTableDxf), G = W(H?.headerRowDxf), se = W(H?.totalRowDxf), ce = W(H?.firstColumnDxf), le = W(H?.lastColumnDxf), ue = W(H?.stripeDxf), de = H?.isHeader && G?.fill?.fgColor ? G : H?.isTotals && se?.fill?.fgColor ? se : H?.isLastCol && le?.fill?.fgColor ? le : H?.isFirstCol && ce?.fill?.fgColor ? ce : ue?.fill?.fgColor ? ue : !H?.isHeader && !H?.isTotals && ae?.fill?.fgColor ? ae : void 0;
|
|
2761
|
+
if (Ar(e, re, I, c, M, P) || (H && de?.fill?.fgColor ? (e.fillStyle = C(de.fill.fgColor), e.fillRect(I, c, M, P)) : H && !H.isCustom && H.isBanded && (e.fillStyle = mi(H.accent), e.fillRect(I, c, M, P))), t.commentCells.has(A) && Nr(e, I, c, M, P), V.dataBar && V.dataBar.ratio > 0) {
|
|
2762
|
+
let t = Math.max(0, (M - 4) * V.dataBar.ratio);
|
|
2763
|
+
Tr(e, V.dataBar.color, I + 2, c + 2, t, P - 4, V.dataBar.gradient);
|
|
2761
2764
|
}
|
|
2762
|
-
let
|
|
2763
|
-
if (
|
|
2764
|
-
x:
|
|
2765
|
+
let pe = t.sparklineMap.get(A);
|
|
2766
|
+
if (pe && tt(e, {
|
|
2767
|
+
x: I,
|
|
2765
2768
|
y: c,
|
|
2766
|
-
w:
|
|
2767
|
-
h:
|
|
2768
|
-
},
|
|
2769
|
+
w: M,
|
|
2770
|
+
h: P
|
|
2771
|
+
}, pe), t.worksheet.showGridlines !== !1) {
|
|
2769
2772
|
if (e.strokeStyle = "#d0d0d0", e.lineWidth = .5, e.beginPath(), !T.has(a)) {
|
|
2770
|
-
let t =
|
|
2771
|
-
e.moveTo(t, c), e.lineTo(t, c +
|
|
2773
|
+
let t = I + M + U(I + M, .5, S);
|
|
2774
|
+
e.moveTo(t, c), e.lineTo(t, c + P);
|
|
2772
2775
|
}
|
|
2773
|
-
let t = c +
|
|
2774
|
-
if (e.moveTo(
|
|
2776
|
+
let t = c + P + U(c + P, .5, S);
|
|
2777
|
+
if (e.moveTo(I, t), e.lineTo(I + M, t), n === 0) {
|
|
2775
2778
|
let t = c + U(c, .5, S);
|
|
2776
|
-
e.moveTo(
|
|
2779
|
+
e.moveTo(I, t), e.lineTo(I + M, t);
|
|
2777
2780
|
}
|
|
2778
2781
|
if (a === 0) {
|
|
2779
|
-
let t =
|
|
2780
|
-
e.moveTo(t, c), e.lineTo(t, c +
|
|
2782
|
+
let t = I + U(I, .5, S);
|
|
2783
|
+
e.moveTo(t, c), e.lineTo(t, c + P);
|
|
2781
2784
|
}
|
|
2782
2785
|
e.stroke();
|
|
2783
2786
|
}
|
|
2784
|
-
let
|
|
2785
|
-
(T.has(a) || E.has(a)) && (
|
|
2786
|
-
...
|
|
2787
|
-
left: E.has(a) ? null :
|
|
2788
|
-
right: T.has(a) ? null :
|
|
2787
|
+
let K = Gi(j ? Wi(ne, r, s, j.right, j.bottom, _, g) : ne, V.border);
|
|
2788
|
+
(T.has(a) || E.has(a)) && (K = {
|
|
2789
|
+
...K,
|
|
2790
|
+
left: E.has(a) ? null : K.left,
|
|
2791
|
+
right: T.has(a) ? null : K.right
|
|
2789
2792
|
});
|
|
2790
|
-
let
|
|
2791
|
-
if (
|
|
2792
|
-
...
|
|
2793
|
-
top:
|
|
2793
|
+
let q = _.get(`${r - 1}:${s}`), me = q ? Vr(g, q.styleIndex ?? 0).border.bottom : null;
|
|
2794
|
+
if (me?.style && (n === 0 || K.top?.style) && (K = {
|
|
2795
|
+
...K,
|
|
2796
|
+
top: Zi(K.top, me)
|
|
2794
2797
|
}), !E.has(a)) {
|
|
2795
2798
|
let e = _.get(`${r}:${s - 1}`), t = e ? Vr(g, e.styleIndex ?? 0).border.right : null;
|
|
2796
|
-
t?.style && (a === 0 ||
|
|
2797
|
-
...
|
|
2798
|
-
left:
|
|
2799
|
+
t?.style && (a === 0 || K.left?.style) && (K = {
|
|
2800
|
+
...K,
|
|
2801
|
+
left: Zi(K.left, t)
|
|
2799
2802
|
});
|
|
2800
2803
|
}
|
|
2801
|
-
let J =
|
|
2804
|
+
let J = H ? fi(H, ae, G, s) : null, he = t.autoFilterCells.has(A), ge = () => {
|
|
2802
2805
|
if (J) {
|
|
2803
|
-
if (J.kind === "dxf")
|
|
2806
|
+
if (J.kind === "dxf") qi(e, J.border, I, c, M, P, S);
|
|
2804
2807
|
else if (J.kind === "accent") {
|
|
2805
2808
|
let t = .5 / S;
|
|
2806
|
-
if (e.strokeStyle = J.color, e.lineWidth = J.lineWidth, e.beginPath(), e.moveTo(
|
|
2809
|
+
if (e.strokeStyle = J.color, e.lineWidth = J.lineWidth, e.beginPath(), e.moveTo(I, c + P - t), e.lineTo(I + M, c + P - t), J.topEdge) {
|
|
2807
2810
|
let t = c + U(c, J.lineWidth, S);
|
|
2808
|
-
e.moveTo(
|
|
2811
|
+
e.moveTo(I, t), e.lineTo(I + M, t);
|
|
2809
2812
|
}
|
|
2810
2813
|
e.stroke();
|
|
2811
2814
|
}
|
|
2812
2815
|
}
|
|
2813
|
-
|
|
2816
|
+
he && ui(e, I, c, D, P);
|
|
2814
2817
|
};
|
|
2815
|
-
if (
|
|
2816
|
-
let t =
|
|
2817
|
-
|
|
2818
|
+
if (j) {
|
|
2819
|
+
let t = K;
|
|
2820
|
+
te.push(() => qi(e, t, I, c, M, P, S)), ge();
|
|
2818
2821
|
} else {
|
|
2819
|
-
let t =
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
+
let t = K;
|
|
2823
|
+
N.push(() => {
|
|
2824
|
+
qi(e, t, I, c, M, P, S), ge();
|
|
2822
2825
|
});
|
|
2823
2826
|
}
|
|
2824
|
-
if (!
|
|
2825
|
-
let
|
|
2826
|
-
!Y || Y === "0" && t.worksheet.showZeros === !1 ||
|
|
2827
|
-
let n =
|
|
2828
|
-
...
|
|
2827
|
+
if (!L) continue;
|
|
2828
|
+
let _e = Xt(L, g, V.numFmt, t.worksheet.date1904), Y = _e.text;
|
|
2829
|
+
!Y || Y === "0" && t.worksheet.showZeros === !1 || ee.push(() => {
|
|
2830
|
+
let n = H?.isHeader ? G : H?.isTotals ? se : H?.isLastCol && le ? le : H?.isFirstCol && ce ? ce : ue || (H ? ae : void 0), l = H ? H.isCustom ? !!n?.font?.bold : H.isHeader || H.isTotals : !1, u = R.bold || !!V.fontBold || l, d = R.italic || !!V.fontItalic, f = R.underline || !!V.fontUnderline, p = R.strike || !!V.fontStrike, m = u !== R.bold || d !== R.italic || f !== R.underline || p !== R.strike ? {
|
|
2831
|
+
...R,
|
|
2829
2832
|
bold: u,
|
|
2830
2833
|
italic: d,
|
|
2831
2834
|
underline: f,
|
|
2832
2835
|
strike: p
|
|
2833
|
-
} :
|
|
2836
|
+
} : R;
|
|
2834
2837
|
e.font = Ir(m, x);
|
|
2835
|
-
let
|
|
2836
|
-
e.fillStyle =
|
|
2837
|
-
let
|
|
2838
|
-
if (
|
|
2838
|
+
let h = t.hyperlinkMap.get(A), b = n?.font?.color ?? null, T = h ? "#0563C1" : V.fontColor ?? _e.color ?? b ?? R.color;
|
|
2839
|
+
e.fillStyle = T ? C(T) : "#000000";
|
|
2840
|
+
let E = L.value.type === "number", D = B.alignH ?? (E ? "right" : "left"), O = B.alignV ?? "bottom", k = B.indent ? Math.round(B.indent * 3 * t.mdw) : 0, ee = V.iconSet ? Math.max(8, Math.round(Math.min(M, P) * .55)) : 0, te = ee > 0 ? ee + 4 : 0, N = 3 + (D === "left" || !B.alignH ? k : 0) + te, F = M, z = a;
|
|
2841
|
+
if (D === "centerContinuous" && !j) for (let e = a + 1; e < w; e++) {
|
|
2839
2842
|
let t = `${r}:${o[e]}`;
|
|
2840
2843
|
if (y.has(t) || v.has(t)) break;
|
|
2841
2844
|
let n = _.get(t);
|
|
2842
2845
|
if (n && n.value.type !== "empty" || Vr(g, n?.styleIndex ?? 0).xf.alignH !== "centerContinuous") break;
|
|
2843
|
-
|
|
2846
|
+
F += i[e], z = e;
|
|
2844
2847
|
}
|
|
2845
|
-
let
|
|
2846
|
-
if (!
|
|
2847
|
-
let n = e.measureText(Y).width, s =
|
|
2848
|
+
let ne = t.rtl ? I - (F - M) : I, re = D === "centerContinuous" ? ne : I, ie = D === "centerContinuous" ? F : M, W = Y.includes("\n");
|
|
2849
|
+
if (!j && !B.wrapText && !B.textRotation && !E && !W) {
|
|
2850
|
+
let n = e.measureText(Y).width, s = D === "centerContinuous", c = s ? n + 6 : n + N + 3, l = s ? F : M;
|
|
2848
2851
|
if (c > l) {
|
|
2849
2852
|
let e = c - l, n = 0, u = 0;
|
|
2850
|
-
|
|
2851
|
-
let d = t.rtl ? -1 : 1, f = t.rtl ? a - 1 :
|
|
2853
|
+
D === "right" ? u = e : D === "center" || s ? (u = e / 2, n = e / 2) : n = e;
|
|
2854
|
+
let d = t.rtl ? -1 : 1, f = t.rtl ? a - 1 : z + 1, p = t.rtl ? 1 : -1, m = t.rtl ? z + 1 : a - 1;
|
|
2852
2855
|
if (n > 0) {
|
|
2853
2856
|
let e = n;
|
|
2854
2857
|
for (let t = f; t >= 0 && t < w && e > 0; t += d) {
|
|
@@ -2856,7 +2859,7 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2856
2859
|
if (y.has(n) || v.has(n)) break;
|
|
2857
2860
|
let a = _.get(n);
|
|
2858
2861
|
if (a && a.value.type !== "empty") break;
|
|
2859
|
-
|
|
2862
|
+
ie += i[t], e -= i[t];
|
|
2860
2863
|
}
|
|
2861
2864
|
}
|
|
2862
2865
|
if (u > 0) {
|
|
@@ -2866,96 +2869,96 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2866
2869
|
if (y.has(n) || v.has(n)) break;
|
|
2867
2870
|
let a = _.get(n);
|
|
2868
2871
|
if (a && a.value.type !== "empty") break;
|
|
2869
|
-
|
|
2872
|
+
re -= i[t], ie += i[t], e -= i[t];
|
|
2870
2873
|
}
|
|
2871
2874
|
}
|
|
2872
2875
|
}
|
|
2873
2876
|
}
|
|
2874
|
-
let
|
|
2875
|
-
if (
|
|
2876
|
-
let t = Math.max(1,
|
|
2877
|
+
let de = Y, pe = 0;
|
|
2878
|
+
if (D === "fill" && !E && Y.length > 0) {
|
|
2879
|
+
let t = Math.max(1, M - 6), n = e.measureText(Y).width;
|
|
2877
2880
|
if (n > 0 && n < t) {
|
|
2878
2881
|
let e = Math.max(1, Math.floor(t / n));
|
|
2879
|
-
|
|
2882
|
+
de = Y.repeat(e);
|
|
2880
2883
|
}
|
|
2881
2884
|
}
|
|
2882
|
-
if (
|
|
2883
|
-
let t = Math.max(1,
|
|
2884
|
-
n < t && (
|
|
2885
|
+
if (D === "distributed" || D === "justify" && !B.wrapText && !W) {
|
|
2886
|
+
let t = Math.max(1, M - 6), n = e.measureText(de).width, r = Math.max(1, [...de].length - 1);
|
|
2887
|
+
n < t && (pe = Math.max(0, (t - n) / r));
|
|
2885
2888
|
}
|
|
2886
|
-
let
|
|
2887
|
-
|
|
2888
|
-
let
|
|
2889
|
-
if (
|
|
2890
|
-
let t = Fr(
|
|
2889
|
+
let K, q;
|
|
2890
|
+
D === "right" ? (K = I + M - 3, q = "right") : D === "center" ? (K = I + M / 2, q = "center") : D === "centerContinuous" ? (K = ne + F / 2, q = "center") : D === "distributed" || D === "justify" && !B.wrapText && !W ? (K = I + 3, q = "left") : (K = I + N, q = "left");
|
|
2891
|
+
let me = B.textRotation ?? 0, J = me === 255, he = me > 0 && me !== 255;
|
|
2892
|
+
if (V.iconSet && ee > 0 && (e.save(), e.beginPath(), e.rect(I, c, M, P), e.clip(), li(e, V.iconSet.name, V.iconSet.index, I + 2, c + (P - ee) / 2, ee), e.restore()), e.save(), e.beginPath(), e.rect(re, c, ie, P), e.clip(), J) {
|
|
2893
|
+
let t = Fr(R.size, x, 1.1), n = [...Y].length * t, r = O === "top" ? c + 2 : O === "center" ? c + (P - n) / 2 : c + P - n - 2;
|
|
2891
2894
|
e.textAlign = "center", e.textBaseline = "top";
|
|
2892
2895
|
for (let n of Y) {
|
|
2893
|
-
let i = n.codePointAt(0) ?? 0, a = oe(i) &&
|
|
2894
|
-
lr(e, n,
|
|
2896
|
+
let i = n.codePointAt(0) ?? 0, a = oe(i) && fe(e, i);
|
|
2897
|
+
lr(e, n, I + M / 2, r, t, a), r += t;
|
|
2895
2898
|
}
|
|
2896
2899
|
e.restore();
|
|
2897
2900
|
return;
|
|
2898
2901
|
}
|
|
2899
|
-
if (
|
|
2900
|
-
let t =
|
|
2901
|
-
e.translate(
|
|
2902
|
+
if (he) {
|
|
2903
|
+
let t = me <= 90 ? -(me * Math.PI / 180) : (me - 90) * Math.PI / 180;
|
|
2904
|
+
e.translate(I + M / 2, c + P / 2), e.rotate(t), e.textAlign = "center", e.textBaseline = "middle", e.fillText(Y, 0, 0), e.restore();
|
|
2902
2905
|
return;
|
|
2903
2906
|
}
|
|
2904
|
-
if (
|
|
2905
|
-
let t = e.measureText(Y).width, n =
|
|
2907
|
+
if (B.shrinkToFit) {
|
|
2908
|
+
let t = e.measureText(Y).width, n = M - N - 3;
|
|
2906
2909
|
if (t > n && t > 0) {
|
|
2907
|
-
let r = n / t, i =
|
|
2910
|
+
let r = n / t, i = D === "right" ? I + M - 3 : D === "center" ? I + M / 2 : I + N;
|
|
2908
2911
|
e.transform(r, 0, 0, 1, i * (1 - r), 0);
|
|
2909
2912
|
}
|
|
2910
2913
|
}
|
|
2911
|
-
if (e.textAlign =
|
|
2912
|
-
e.letterSpacing = `${
|
|
2914
|
+
if (e.textAlign = q, pe > 0) try {
|
|
2915
|
+
e.letterSpacing = `${pe}px`;
|
|
2913
2916
|
} catch {}
|
|
2914
2917
|
try {
|
|
2915
|
-
e.direction = Yn(
|
|
2918
|
+
e.direction = Yn(B.readingOrder, Y) ? "rtl" : "ltr";
|
|
2916
2919
|
} catch {}
|
|
2917
|
-
let
|
|
2918
|
-
if (
|
|
2919
|
-
alignH:
|
|
2920
|
-
alignV:
|
|
2921
|
-
cx:
|
|
2920
|
+
let ge = L.value.type === "text" ? L.value.runs : void 0, ve = ge && ge.length > 0;
|
|
2921
|
+
if (B.wrapText && ve) ii(e, ge, m, {
|
|
2922
|
+
alignH: D,
|
|
2923
|
+
alignV: O,
|
|
2924
|
+
cx: I,
|
|
2922
2925
|
cy: c,
|
|
2923
|
-
cellW:
|
|
2924
|
-
cellH:
|
|
2925
|
-
leftPad:
|
|
2926
|
+
cellW: M,
|
|
2927
|
+
cellH: P,
|
|
2928
|
+
leftPad: N,
|
|
2926
2929
|
paddingX: 3,
|
|
2927
2930
|
paddingY: 2
|
|
2928
2931
|
}, x, S, {
|
|
2929
|
-
fontColor:
|
|
2930
|
-
readingOrder:
|
|
2932
|
+
fontColor: V.fontColor,
|
|
2933
|
+
readingOrder: B.readingOrder
|
|
2931
2934
|
});
|
|
2932
|
-
else if (
|
|
2933
|
-
alignH:
|
|
2934
|
-
alignV:
|
|
2935
|
-
cx:
|
|
2935
|
+
else if (B.wrapText) ri(e, Y, K, m, {
|
|
2936
|
+
alignH: D,
|
|
2937
|
+
alignV: O,
|
|
2938
|
+
cx: I,
|
|
2936
2939
|
cy: c,
|
|
2937
|
-
cellW:
|
|
2938
|
-
cellH:
|
|
2939
|
-
leftPad:
|
|
2940
|
+
cellW: M,
|
|
2941
|
+
cellH: P,
|
|
2942
|
+
leftPad: N,
|
|
2940
2943
|
paddingX: 3,
|
|
2941
2944
|
paddingY: 2
|
|
2942
2945
|
}, x);
|
|
2943
|
-
else if (ve) ni(e,
|
|
2944
|
-
alignH:
|
|
2945
|
-
alignV:
|
|
2946
|
-
cx:
|
|
2946
|
+
else if (ve) ni(e, ge, m, {
|
|
2947
|
+
alignH: D,
|
|
2948
|
+
alignV: O,
|
|
2949
|
+
cx: I,
|
|
2947
2950
|
cy: c,
|
|
2948
|
-
cellW:
|
|
2949
|
-
cellH:
|
|
2950
|
-
leftPad:
|
|
2951
|
+
cellW: M,
|
|
2952
|
+
cellH: P,
|
|
2953
|
+
leftPad: N,
|
|
2951
2954
|
paddingX: 3,
|
|
2952
2955
|
paddingY: 2
|
|
2953
2956
|
}, x, S, {
|
|
2954
|
-
fontColor:
|
|
2955
|
-
readingOrder:
|
|
2957
|
+
fontColor: V.fontColor,
|
|
2958
|
+
readingOrder: B.readingOrder
|
|
2956
2959
|
});
|
|
2957
2960
|
else {
|
|
2958
|
-
let t = m.vertAlign, n = Fr(
|
|
2961
|
+
let t = m.vertAlign, n = Fr(R.size, x), r = 0;
|
|
2959
2962
|
t === "superscript" ? r = -Math.round(n * .35) : t === "subscript" && (r = Math.round(n * .1));
|
|
2960
2963
|
let i = t ? {
|
|
2961
2964
|
...m,
|
|
@@ -2963,63 +2966,63 @@ function hi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
|
2963
2966
|
} : m;
|
|
2964
2967
|
t && (e.font = Ir(i, x));
|
|
2965
2968
|
let a = null, o = () => a ??= e.measureText(Y), s = () => {
|
|
2966
|
-
let e = Math.min(o().width,
|
|
2969
|
+
let e = Math.min(o().width, ie - N - 3);
|
|
2967
2970
|
return {
|
|
2968
|
-
x:
|
|
2971
|
+
x: D === "right" ? I + M - 3 - e : D === "center" ? I + M / 2 - e / 2 : I + N,
|
|
2969
2972
|
width: e
|
|
2970
2973
|
};
|
|
2971
2974
|
}, l = Fr(i.size, x);
|
|
2972
|
-
if (m.underline ||
|
|
2973
|
-
let { x: t, width: n } = s(), i = (
|
|
2975
|
+
if (m.underline || h) {
|
|
2976
|
+
let { x: t, width: n } = s(), i = (O === "top" ? c + 2 + l + 1 : O === "center" ? c + P / 2 + Math.round(l * .55) : c + P - 2 + 1) + r, a = h ? "#0563C1" : T ? C(T) : "#000000", o = m.underlineStyle === "double" || m.underlineStyle === "doubleAccounting";
|
|
2974
2977
|
zr(e, t, t + n, i, a, o, S);
|
|
2975
2978
|
}
|
|
2976
2979
|
if (m.strike) {
|
|
2977
|
-
let { x: t, width: n } = s(), i = (
|
|
2978
|
-
e.save(), e.strokeStyle =
|
|
2980
|
+
let { x: t, width: n } = s(), i = (O === "top" ? c + 2 + Math.round(l * .5) : O === "center" ? c + P / 2 : c + P - 2 - Math.round(l * .35)) + r, a = i + U(i, .5, S);
|
|
2981
|
+
e.save(), e.strokeStyle = T ? C(T) : "#000000", e.lineWidth = .5, e.beginPath(), e.moveTo(t, a), e.lineTo(t + n, a), e.stroke(), e.restore();
|
|
2979
2982
|
}
|
|
2980
2983
|
if (Y.includes("\n")) {
|
|
2981
|
-
let t = Y.split("\n"), n = Fr(
|
|
2982
|
-
|
|
2983
|
-
for (let i = 0; i < t.length; i++) e.fillText(t[i],
|
|
2984
|
+
let t = Y.split("\n"), n = Fr(R.size, x, 1.2, R.name ?? void 0), i = t.length * n, a;
|
|
2985
|
+
O === "top" ? (a = c + 2, e.textBaseline = "top") : O === "center" ? (a = c + (P - i) / 2, e.textBaseline = "top") : (a = c + P - i - 2, e.textBaseline = "top");
|
|
2986
|
+
for (let i = 0; i < t.length; i++) e.fillText(t[i], K, a + i * n + r);
|
|
2984
2987
|
} else {
|
|
2985
2988
|
let { baseline: t, textY: n } = Yr({
|
|
2986
|
-
alignH:
|
|
2987
|
-
alignV:
|
|
2988
|
-
cx:
|
|
2989
|
+
alignH: D,
|
|
2990
|
+
alignV: O,
|
|
2991
|
+
cx: I,
|
|
2989
2992
|
cy: c,
|
|
2990
|
-
cellW:
|
|
2991
|
-
cellH:
|
|
2992
|
-
leftPad:
|
|
2993
|
+
cellW: M,
|
|
2994
|
+
cellH: P,
|
|
2995
|
+
leftPad: N,
|
|
2993
2996
|
paddingX: 3,
|
|
2994
2997
|
paddingY: 2
|
|
2995
2998
|
});
|
|
2996
|
-
e.textBaseline = t, e.fillText(
|
|
2999
|
+
e.textBaseline = t, e.fillText(de, K, n + r);
|
|
2997
3000
|
}
|
|
2998
3001
|
}
|
|
2999
|
-
let ye =
|
|
3000
|
-
if (
|
|
3002
|
+
let ye = L.value.type === "text" ? L.value.phoneticRuns : void 0;
|
|
3003
|
+
if (L.showPhonetic && ye && ye.length > 0 && !Y.includes("\n")) {
|
|
3001
3004
|
let t = Ir(m, x), n = Rr(e, Y, t), r;
|
|
3002
|
-
r =
|
|
3003
|
-
let i =
|
|
3004
|
-
Lr(e, ye,
|
|
3005
|
+
r = D === "right" ? I + M - 3 - n : D === "center" ? I + M / 2 - n / 2 : I + N;
|
|
3006
|
+
let i = T ? C(T) : "#000000";
|
|
3007
|
+
Lr(e, ye, L.value.type === "text" ? L.value.phoneticPr : void 0, Y, t, g, r, c, x, i);
|
|
3005
3008
|
}
|
|
3006
3009
|
e.restore(), Y && t.onTextRun && t.onTextRun({
|
|
3007
3010
|
sheetName: t.worksheet.name,
|
|
3008
3011
|
cellRef: cr(r, s),
|
|
3009
3012
|
text: Y,
|
|
3010
|
-
x:
|
|
3013
|
+
x: I,
|
|
3011
3014
|
y: c,
|
|
3012
|
-
width:
|
|
3013
|
-
height:
|
|
3015
|
+
width: M,
|
|
3016
|
+
height: P,
|
|
3014
3017
|
row: r,
|
|
3015
3018
|
col: s
|
|
3016
3019
|
});
|
|
3017
3020
|
});
|
|
3018
3021
|
}
|
|
3019
3022
|
}
|
|
3020
|
-
for (let e of P) e();
|
|
3021
|
-
for (let e of ee) e();
|
|
3022
3023
|
for (let e of N) e();
|
|
3024
|
+
for (let e of te) e();
|
|
3025
|
+
for (let e of ee) e();
|
|
3023
3026
|
e.restore();
|
|
3024
3027
|
}
|
|
3025
3028
|
var gi = /* @__PURE__ */ new WeakMap();
|
|
@@ -3032,12 +3035,17 @@ function _i(e, t) {
|
|
|
3032
3035
|
function vi(e) {
|
|
3033
3036
|
let t = gi.get(e);
|
|
3034
3037
|
if (t) return t;
|
|
3035
|
-
let n = _i("worksheet-cell-index", "index-worksheet-cells"), r = Nn(e.rows, n), i = /* @__PURE__ */ new
|
|
3038
|
+
let n = _i("worksheet-cell-index", "index-worksheet-cells"), r = Nn(e.rows, n), i = /* @__PURE__ */ new Map();
|
|
3039
|
+
for (let t of e.rows) {
|
|
3040
|
+
let e = t.cells.filter((e) => e.value.type !== "empty").map((e) => e.col).sort((e, t) => e - t);
|
|
3041
|
+
e.length > 0 && i.set(t.index, e);
|
|
3042
|
+
}
|
|
3043
|
+
let a = /* @__PURE__ */ new Set(), o = _i("worksheet-merge-skip-index", "expand-merged-cell-coordinates");
|
|
3036
3044
|
for (let t of e.mergeCells ?? []) {
|
|
3037
|
-
jn(t,
|
|
3038
|
-
for (let e = t.top; e <= t.bottom; e++) for (let n = t.left; n <= t.right; n++) e === t.top && n === t.left || Pn(
|
|
3045
|
+
jn(t, o, 1);
|
|
3046
|
+
for (let e = t.top; e <= t.bottom; e++) for (let n = t.left; n <= t.right; n++) e === t.top && n === t.left || Pn(a, `${e}:${n}`, o);
|
|
3039
3047
|
}
|
|
3040
|
-
let
|
|
3048
|
+
let s = /* @__PURE__ */ new Set();
|
|
3041
3049
|
if (e.autoFilter) {
|
|
3042
3050
|
let t = e.autoFilter, n = _i("worksheet-auto-filter-index", "expand-auto-filter-coordinates");
|
|
3043
3051
|
jn({
|
|
@@ -3046,52 +3054,101 @@ function vi(e) {
|
|
|
3046
3054
|
left: t.left,
|
|
3047
3055
|
right: t.right
|
|
3048
3056
|
}, n);
|
|
3049
|
-
for (let e = t.left; e <= t.right; e++) Pn(
|
|
3057
|
+
for (let e = t.left; e <= t.right; e++) Pn(s, `${t.top}:${e}`, n);
|
|
3050
3058
|
}
|
|
3051
|
-
let
|
|
3052
|
-
for (let t of e.hyperlinks ?? []) t.url && Mn(
|
|
3053
|
-
let
|
|
3059
|
+
let c = /* @__PURE__ */ new Map(), l = _i("worksheet-hyperlink-index", "index-hyperlink-coordinates");
|
|
3060
|
+
for (let t of e.hyperlinks ?? []) t.url && Mn(c, `${t.row}:${t.col}`, t.url, l);
|
|
3061
|
+
let u = /* @__PURE__ */ new Set(), d = _i("worksheet-comment-index", "index-comment-coordinates");
|
|
3054
3062
|
for (let t of e.commentRefs ?? []) {
|
|
3055
3063
|
let e = Mr(t);
|
|
3056
|
-
e && Pn(
|
|
3064
|
+
e && Pn(u, `${e.row}:${e.col}`, d);
|
|
3057
3065
|
}
|
|
3058
|
-
let
|
|
3066
|
+
let f = {
|
|
3059
3067
|
cellMap: r,
|
|
3068
|
+
nonEmptyColsByRow: i,
|
|
3060
3069
|
cfContext: Bn(e, r),
|
|
3061
|
-
mergeSkipSet:
|
|
3062
|
-
autoFilterCells:
|
|
3063
|
-
hyperlinkMap:
|
|
3064
|
-
commentCells:
|
|
3070
|
+
mergeSkipSet: a,
|
|
3071
|
+
autoFilterCells: s,
|
|
3072
|
+
hyperlinkMap: c,
|
|
3073
|
+
commentCells: u,
|
|
3065
3074
|
tableStyleMap: di(e),
|
|
3066
3075
|
sparklineMap: pi(e)
|
|
3067
3076
|
};
|
|
3068
|
-
return gi.set(e,
|
|
3077
|
+
return gi.set(e, f), f;
|
|
3069
3078
|
}
|
|
3070
3079
|
function yi(e, t) {
|
|
3080
|
+
let n = 0, r = e.length;
|
|
3081
|
+
for (; n < r;) {
|
|
3082
|
+
let i = n + r >> 1;
|
|
3083
|
+
e[i] < t ? n = i + 1 : r = i;
|
|
3084
|
+
}
|
|
3085
|
+
return n > 0 ? e[n - 1] : void 0;
|
|
3086
|
+
}
|
|
3087
|
+
function bi(e, t) {
|
|
3088
|
+
let n = 0, r = e.length;
|
|
3089
|
+
for (; n < r;) {
|
|
3090
|
+
let i = n + r >> 1;
|
|
3091
|
+
e[i] <= t ? n = i + 1 : r = i;
|
|
3092
|
+
}
|
|
3093
|
+
return n < e.length ? e[n] : void 0;
|
|
3094
|
+
}
|
|
3095
|
+
function xi(e, t, n, r) {
|
|
3096
|
+
return (e.mergeCells ?? []).some((e) => t >= e.top && t <= e.bottom && e.right >= n && e.left <= r);
|
|
3097
|
+
}
|
|
3098
|
+
function Si(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
3099
|
+
let _ = d, v = f, y = /* @__PURE__ */ new Set(), b = (i, u, d, f) => {
|
|
3100
|
+
let p = `${i}:${u}`, _ = r.get(p);
|
|
3101
|
+
if (!_ || _.value.type === "empty" || s.has(p)) return !1;
|
|
3102
|
+
let { font: v, xf: y } = Vr(n, _.styleIndex ?? 0), b = Jn(_, i, u, a, n.dxfs ?? []), x = Xt(_, n, b.numFmt, t.date1904).text;
|
|
3103
|
+
if (!x || x === "0" && t.showZeros === !1 || _.value.type === "number" || y.wrapText || y.textRotation || x.includes("\n")) return !1;
|
|
3104
|
+
let S = o.get(p), C = S?.isHeader ? S.headerRowDxf : S?.isTotals ? S.totalRowDxf : S?.isLastCol && S.lastColumnDxf != null ? S.lastColumnDxf : S?.isFirstCol && S.firstColumnDxf != null ? S.firstColumnDxf : S?.stripeDxf ?? S?.wholeTableDxf, w = C == null ? void 0 : n.dxfs?.[C], T = !!S && !S.isCustom && (S.isHeader || S.isTotals), E = v.bold || !!b.fontBold || T || !!w?.font?.bold, D = v.italic || !!b.fontItalic;
|
|
3105
|
+
e.font = Ir(E !== v.bold || D !== v.italic ? {
|
|
3106
|
+
...v,
|
|
3107
|
+
bold: E,
|
|
3108
|
+
italic: D
|
|
3109
|
+
} : v, m);
|
|
3110
|
+
let O = y.alignH ?? "left", k = y.indent ? Math.round(y.indent * 3 * h) : 0, A = c.sizeOf(u), j = l.sizeOf(i), M = b.iconSet ? Math.max(8, Math.round(Math.min(A, j) * .55)) : 0, ee = M > 0 ? M + 4 : 0, te = 3 + (O === "left" || !y.alignH ? k : 0) + ee, N = e.measureText(x).width + te + 3, P = Math.max(0, N - A);
|
|
3111
|
+
return P <= 0 ? !1 : (O === "center" || O === "centerContinuous" ? P / 2 : ((g ? d === "higher" ? "left" : "right" : d === "higher" ? "right" : "left") == "left" ? O === "right" : O !== "right") ? P : 0) > f;
|
|
3112
|
+
};
|
|
3113
|
+
for (let e of u) {
|
|
3114
|
+
let n = i.get(e);
|
|
3115
|
+
if (!n) continue;
|
|
3116
|
+
let a = yi(n, d), o = r.get(`${e}:${d}`);
|
|
3117
|
+
a != null && a >= p && (!o || o.value.type === "empty") && !xi(t, e, a + 1, d) && b(e, a, "higher", c.offsetOf(d) - c.offsetOf(a + 1)) && (_ = Math.min(_, a), y.add(`${e}:${a}`));
|
|
3118
|
+
let s = bi(n, f), l = r.get(`${e}:${f}`);
|
|
3119
|
+
s != null && s <= 16384 && (!l || l.value.type === "empty") && !xi(t, e, f, s - 1) && b(e, s, "lower", c.offsetOf(s) - c.offsetOf(f + 1)) && (v = Math.max(v, s), y.add(`${e}:${s}`));
|
|
3120
|
+
}
|
|
3121
|
+
return {
|
|
3122
|
+
startCol: _,
|
|
3123
|
+
endCol: v,
|
|
3124
|
+
anchorKeys: y
|
|
3125
|
+
};
|
|
3126
|
+
}
|
|
3127
|
+
function Ci(e, t) {
|
|
3071
3128
|
gi.set(t, vi(e));
|
|
3072
3129
|
}
|
|
3073
|
-
function
|
|
3130
|
+
function wi(e, t, n, r, i = {}) {
|
|
3074
3131
|
let a = i.dpr ?? 1, o = i.cellScale ?? 1, s = $(t), c = s.maximumDigitWidth, l = e.canvas.width / a, u = e.canvas.height / a;
|
|
3075
3132
|
e.clearRect(0, 0, l, u), e.fillStyle = "#ffffff", e.fillRect(0, 0, l, u);
|
|
3076
|
-
let d = (e) => Math.round(e * o), f = d(50), p = d(22), { row: m, col: h, rows: g, cols: _ } = r, v = (i.scrollOffsetX ?? 0) * o, y = (i.scrollOffsetY ?? 0) * o, { col: b, row: x } = s.axesAtScale(o), S = b.bandsToCover(1, i.freezeCols ?? 0, Math.max(0, l - f)), C = x.bandsToCover(1, i.freezeRows ?? 0, Math.max(0, u - p)), w = C.at(-1)?.index ?? 0, T = S.at(-1)?.index ?? 0, E = S.map(({ index: e }) => e), D = C.map(({ index: e }) => e), O = S.map(({ size: e }) => e), k = C.map(({ size: e }) => e), A = O.reduce((e, t) => e + t, 0), j = k.reduce((e, t) => e + t, 0), M = b.bandsToCover(h, Math.min(16384, h + _ - 1)),
|
|
3133
|
+
let d = (e) => Math.round(e * o), f = d(50), p = d(22), { row: m, col: h, rows: g, cols: _ } = r, v = (i.scrollOffsetX ?? 0) * o, y = (i.scrollOffsetY ?? 0) * o, { col: b, row: x } = s.axesAtScale(o), S = b.bandsToCover(1, i.freezeCols ?? 0, Math.max(0, l - f)), C = x.bandsToCover(1, i.freezeRows ?? 0, Math.max(0, u - p)), w = C.at(-1)?.index ?? 0, T = S.at(-1)?.index ?? 0, E = S.map(({ index: e }) => e), D = C.map(({ index: e }) => e), O = S.map(({ size: e }) => e), k = C.map(({ size: e }) => e), A = O.reduce((e, t) => e + t, 0), j = k.reduce((e, t) => e + t, 0), M = b.bandsToCover(h, Math.min(16384, h + _ - 1)), ee = x.bandsToCover(m, Math.min(1048576, m + g - 1)), te = M.map(({ index: e }) => e), N = ee.map(({ index: e }) => e), P = M.map(({ size: e }) => e), F = ee.map(({ size: e }) => e), { cellMap: I, cfContext: L, mergeSkipSet: R, autoFilterCells: z, hyperlinkMap: ne, commentCells: B, tableStyleMap: V, sparklineMap: re, nonEmptyColsByRow: H } = vi(t), ie = /* @__PURE__ */ new Map(), W = _i("worksheet-merge-anchor-index", "index-merge-anchor-coordinates");
|
|
3077
3134
|
for (let e of t.mergeCells ?? []) {
|
|
3078
3135
|
let t = b.offsetOf(e.right + 1) - b.offsetOf(e.left), n = x.offsetOf(e.bottom + 1) - x.offsetOf(e.top);
|
|
3079
|
-
Mn(
|
|
3136
|
+
Mn(ie, `${e.top}:${e.left}`, {
|
|
3080
3137
|
totalW: t,
|
|
3081
3138
|
totalH: n,
|
|
3082
3139
|
right: e.right,
|
|
3083
3140
|
bottom: e.bottom
|
|
3084
|
-
},
|
|
3141
|
+
}, W);
|
|
3085
3142
|
}
|
|
3086
|
-
let
|
|
3143
|
+
let ae = te[0] ?? h, G = te.at(-1) ?? Math.min(16384, h + _ - 1), oe = Si(e, t, n, I, H, L, V, ie, b, x, [...new Set([...D, ...N])], ae, G, T + 1, o, c, t.rightToLeft === !0), se = b.bandsToCover(oe.startCol, oe.endCol), ce = se.map(({ index: e }) => e), le = se.map(({ size: e }) => e), ue = v + b.offsetOf(ae) - b.offsetOf(oe.startCol), de = {
|
|
3087
3144
|
worksheet: t,
|
|
3088
3145
|
styles: n,
|
|
3089
|
-
cellMap:
|
|
3090
|
-
mergeAnchorMap:
|
|
3146
|
+
cellMap: I,
|
|
3147
|
+
mergeAnchorMap: ie,
|
|
3091
3148
|
mergeSkipSet: R,
|
|
3092
3149
|
cfContext: L,
|
|
3093
|
-
colWidths:
|
|
3094
|
-
rowHeights:
|
|
3150
|
+
colWidths: le,
|
|
3151
|
+
rowHeights: F,
|
|
3095
3152
|
colAxis: b,
|
|
3096
3153
|
rowAxis: x,
|
|
3097
3154
|
frozenColWidths: O,
|
|
@@ -3106,38 +3163,39 @@ function bi(e, t, n, r, i = {}) {
|
|
|
3106
3163
|
hyperlinkMap: ne,
|
|
3107
3164
|
commentCells: B,
|
|
3108
3165
|
tableStyleMap: V,
|
|
3109
|
-
sparklineMap:
|
|
3166
|
+
sparklineMap: re,
|
|
3167
|
+
overflowTextAnchors: oe.anchorKeys,
|
|
3110
3168
|
mdw: c,
|
|
3111
3169
|
onTextRun: i.onTextRun,
|
|
3112
3170
|
rtl: t.rightToLeft === !0,
|
|
3113
3171
|
canvasW: l
|
|
3114
|
-
},
|
|
3115
|
-
w > 0 && T > 0 && hi(e,
|
|
3116
|
-
let
|
|
3172
|
+
}, fe = f, pe = p, K = fe + A, q = pe + j, me = Math.max(0, l - K), J = Math.max(0, u - q);
|
|
3173
|
+
w > 0 && T > 0 && hi(e, de, 1, 1, O, k, E, D, 0, 0, fe, pe, fe, pe, A, j), w > 0 && hi(e, de, 1, oe.startCol, le, k, ce, D, ue, 0, K, pe, K, pe, me, j), T > 0 && hi(e, de, m, 1, O, F, E, N, 0, y, fe, q, fe, q, A, J), hi(e, de, m, oe.startCol, le, F, ce, N, ue, y, K, q, K, q, me, J), Ei(e, t, b, x, i.loadedImages, o, m, h, v, y, K, q, me, J, t.rightToLeft === !0, l), t.slicers && t.slicers.length > 0 && da(e, t, b, x, o, m, h, v, y, K, q, me, J, t.rightToLeft === !0, l), Ti(e, l, u, m, h, g, _, P, F, te, N, v, y, O, k, E, D, A, j, f, p, o, a, i.selectedRowRange ?? null, i.selectedColRange ?? null, t.rightToLeft === !0);
|
|
3174
|
+
let he = t.rightToLeft === !0;
|
|
3117
3175
|
if (w > 0) {
|
|
3118
3176
|
e.save(), e.strokeStyle = Sr, e.lineWidth = .5, e.beginPath();
|
|
3119
|
-
let t =
|
|
3120
|
-
|
|
3177
|
+
let t = q + U(q, .5, a);
|
|
3178
|
+
e.moveTo(0, t), e.lineTo(l, t), e.stroke(), e.restore();
|
|
3121
3179
|
}
|
|
3122
3180
|
if (T > 0) {
|
|
3123
3181
|
e.save(), e.strokeStyle = Sr, e.lineWidth = .5, e.beginPath();
|
|
3124
|
-
let t =
|
|
3182
|
+
let t = he ? l - K : K, n = t + U(t, .5, a);
|
|
3125
3183
|
e.moveTo(n, p), e.lineTo(n, u), e.stroke(), e.restore();
|
|
3126
3184
|
}
|
|
3127
3185
|
}
|
|
3128
|
-
function
|
|
3129
|
-
let E = "#f8f9fa", D = "#e8eaed", O = "#caddf6", k = "#c8ccd0", A = "#5b9bd5", j = "#444", M = (e) => !w || e < w.start || e > w.end ? E : w.strong ? O : D,
|
|
3186
|
+
function Ti(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T) {
|
|
3187
|
+
let E = "#f8f9fa", D = "#e8eaed", O = "#caddf6", k = "#c8ccd0", A = "#5b9bd5", j = "#444", M = (e) => !w || e < w.start || e > w.end ? E : w.strong ? O : D, ee = (e) => !w || e < w.start || e > w.end ? k : w.strong ? A : k, te = (e) => !C || e < C.start || e > C.end ? E : C.strong ? O : D, N = (e) => !C || e < C.start || e > C.end ? k : C.strong ? A : k, P = `${Math.max(1, Math.round(11 * x))}px ${mr}`, F = y + _, I = b + v, L = .5 / S, R = (e, n) => T ? br(e, n, t) : e, z = T ? t - y : 0;
|
|
3130
3188
|
e.fillStyle = E, e.fillRect(z, 0, y, b), e.strokeStyle = k, e.lineWidth = .5, e.beginPath();
|
|
3131
3189
|
let ne = T ? z + U(z, .5, S) : z + y - L;
|
|
3132
|
-
e.moveTo(ne, 0), e.lineTo(ne, b), e.moveTo(z, b - L), e.lineTo(z + y, b - L), e.stroke(), e.font =
|
|
3190
|
+
e.moveTo(ne, 0), e.lineTo(ne, b), e.moveTo(z, b - L), e.lineTo(z + y, b - L), e.stroke(), e.font = P, e.fillStyle = j;
|
|
3133
3191
|
let B = (t, n, r) => {
|
|
3134
3192
|
let i = R(n, r);
|
|
3135
|
-
e.fillStyle = M(t), e.fillRect(i, 0, r, b), e.strokeStyle =
|
|
3193
|
+
e.fillStyle = M(t), e.fillRect(i, 0, r, b), e.strokeStyle = ee(t), e.lineWidth = .5, e.beginPath();
|
|
3136
3194
|
let a = i + U(i, .5, S);
|
|
3137
3195
|
e.moveTo(a, 0), e.lineTo(a, b), e.moveTo(i, b - L), e.lineTo(i + r, b - L), e.stroke(), e.fillStyle = j, e.textAlign = "center", e.textBaseline = "middle", e.fillText(ai(t), i + r / 2, b / 2);
|
|
3138
3196
|
}, V = (t, n, r) => {
|
|
3139
3197
|
let i = z;
|
|
3140
|
-
e.fillStyle =
|
|
3198
|
+
e.fillStyle = te(t), e.fillRect(i, n, y, r), e.strokeStyle = N(t), e.lineWidth = .5, e.beginPath();
|
|
3141
3199
|
let a = n + U(n, .5, S), o = T ? i + U(i, .5, S) : i + y - L;
|
|
3142
3200
|
e.moveTo(o, n), e.lineTo(o, n + r), e.moveTo(i, a), e.lineTo(i + y, a), e.stroke(), e.fillStyle = j, e.textBaseline = "middle";
|
|
3143
3201
|
let s = Math.max(2, Math.round(4 * x));
|
|
@@ -3149,11 +3207,11 @@ function xi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S,
|
|
|
3149
3207
|
for (let e = 0; e < p.length; e++) B(h[e], t, p[e]), t += p[e];
|
|
3150
3208
|
e.restore();
|
|
3151
3209
|
}
|
|
3152
|
-
e.save(), e.beginPath(), e.rect(R(
|
|
3153
|
-
let
|
|
3210
|
+
e.save(), e.beginPath(), e.rect(R(F, t - F), 0, t - F, b), e.clip();
|
|
3211
|
+
let re = F - d;
|
|
3154
3212
|
for (let e = 0; e < s.length; e++) {
|
|
3155
3213
|
let n = s[e];
|
|
3156
|
-
|
|
3214
|
+
re + n > F && re < t && B(l[e], re, n), re += n;
|
|
3157
3215
|
}
|
|
3158
3216
|
if (e.restore(), m.length > 0) {
|
|
3159
3217
|
e.save(), e.beginPath(), e.rect(z, b, y, v), e.clip();
|
|
@@ -3161,66 +3219,91 @@ function xi(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S,
|
|
|
3161
3219
|
for (let e = 0; e < m.length; e++) V(g[e], t, m[e]), t += m[e];
|
|
3162
3220
|
e.restore();
|
|
3163
3221
|
}
|
|
3164
|
-
e.save(), e.beginPath(), e.rect(z,
|
|
3165
|
-
let
|
|
3222
|
+
e.save(), e.beginPath(), e.rect(z, I, y, n - I), e.clip();
|
|
3223
|
+
let H = I - f;
|
|
3166
3224
|
for (let e = 0; e < c.length; e++) {
|
|
3167
3225
|
let t = c[e];
|
|
3168
|
-
|
|
3226
|
+
H + t > I && H < n && V(u[e], H, t), H += t;
|
|
3169
3227
|
}
|
|
3170
3228
|
e.restore();
|
|
3171
3229
|
}
|
|
3172
|
-
function
|
|
3230
|
+
function Ei(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h) {
|
|
3231
|
+
let g = [], _ = 0;
|
|
3232
|
+
if (i) for (let e of t.images ?? []) g.push({
|
|
3233
|
+
kind: "image",
|
|
3234
|
+
zOrder: e.zOrder ?? 2 ** 53 - 1,
|
|
3235
|
+
fallbackOrder: _++,
|
|
3236
|
+
anchor: e
|
|
3237
|
+
});
|
|
3238
|
+
for (let e of t.shapeGroups ?? []) for (let t of e.shapes) g.push({
|
|
3239
|
+
kind: "shape",
|
|
3240
|
+
zOrder: t.zOrder ?? 2 ** 53 - 1,
|
|
3241
|
+
fallbackOrder: _++,
|
|
3242
|
+
anchor: e,
|
|
3243
|
+
shape: t
|
|
3244
|
+
});
|
|
3245
|
+
for (let e of t.charts ?? []) g.push({
|
|
3246
|
+
kind: "chart",
|
|
3247
|
+
zOrder: e.zOrder ?? 2 ** 53 - 1,
|
|
3248
|
+
fallbackOrder: _++,
|
|
3249
|
+
anchor: e
|
|
3250
|
+
});
|
|
3251
|
+
g.sort((e, t) => e.zOrder - t.zOrder || e.fallbackOrder - t.fallbackOrder);
|
|
3252
|
+
for (let _ of g) _.kind === "image" ? ki(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, [_.anchor]) : _.kind === "shape" ? Ai(e, t, n, r, a, o, s, c, l, u, d, f, p, i, m, h, [{
|
|
3253
|
+
..._.anchor,
|
|
3254
|
+
shapes: [_.shape]
|
|
3255
|
+
}]) : Qi(e, t, n, r, a, o, s, c, l, u, d, f, p, m, h, [_.anchor]);
|
|
3256
|
+
}
|
|
3257
|
+
function Di(e, t) {
|
|
3173
3258
|
return e.offsetOf(t);
|
|
3174
3259
|
}
|
|
3175
|
-
function
|
|
3260
|
+
function Oi(e, t) {
|
|
3176
3261
|
return e.offsetOf(t);
|
|
3177
3262
|
}
|
|
3178
|
-
function
|
|
3263
|
+
function ki(e, t, n, r, i, o, s, c, l, u, d, f, p, m, h, g, _ = t.images) {
|
|
3179
3264
|
if (p <= 0 || m <= 0) return;
|
|
3180
|
-
let
|
|
3265
|
+
let v = Di(n, c), y = Oi(r, s);
|
|
3181
3266
|
e.save(), e.beginPath();
|
|
3182
|
-
let
|
|
3183
|
-
e.rect(
|
|
3184
|
-
for (let
|
|
3185
|
-
let
|
|
3186
|
-
if (!
|
|
3187
|
-
let c =
|
|
3188
|
-
if (ur(
|
|
3267
|
+
let b = xr(d, p, g, h);
|
|
3268
|
+
e.rect(b, f, p, m), e.clip();
|
|
3269
|
+
for (let t of _) {
|
|
3270
|
+
let s = i.get(dr(t.imagePath, t.duotone));
|
|
3271
|
+
if (!s) continue;
|
|
3272
|
+
let c = t.fromCol + 1, _ = t.fromRow + 1, x = Di(n, c) + t.fromColOff * o / D, S = Oi(r, _) + t.fromRowOff * o / D, C, w;
|
|
3273
|
+
if (ur(t)) C = t.nativeExtCx * o / D, w = t.nativeExtCy * o / D;
|
|
3189
3274
|
else {
|
|
3190
|
-
let e =
|
|
3191
|
-
C =
|
|
3275
|
+
let e = t.toCol + 1, i = t.toRow + 1, a = Di(n, e) + t.toColOff * o / D, s = Oi(r, i) + t.toRowOff * o / D;
|
|
3276
|
+
C = a - x, w = s - S;
|
|
3192
3277
|
}
|
|
3193
3278
|
if (C <= 0 || w <= 0) continue;
|
|
3194
|
-
let T = xr(d + (x -
|
|
3195
|
-
T + C <
|
|
3279
|
+
let T = xr(d + (x - v) - l, C, g, h), E = f + (S - y) - u;
|
|
3280
|
+
T + C < b || T > b + p || E + w < f || E > f + m || (t.alpha != null && t.alpha < 1 ? (e.save(), e.globalAlpha = t.alpha, a(e, s, t.srcRect, T, E, C, w), e.restore()) : a(e, s, t.srcRect, T, E, C, w));
|
|
3196
3281
|
}
|
|
3197
3282
|
e.restore();
|
|
3198
3283
|
}
|
|
3199
|
-
function
|
|
3200
|
-
if (d <= 0 || f <= 0) return;
|
|
3201
|
-
let
|
|
3202
|
-
if (!g || g.length === 0) return;
|
|
3203
|
-
let _ = Si(n, o), v = Ci(r, a);
|
|
3284
|
+
function Ai(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g = t.shapeGroups ?? []) {
|
|
3285
|
+
if (d <= 0 || f <= 0 || g.length === 0) return;
|
|
3286
|
+
let _ = Di(n, o), v = Oi(r, a);
|
|
3204
3287
|
e.save(), e.beginPath();
|
|
3205
3288
|
let y = xr(l, d, h, m);
|
|
3206
3289
|
e.rect(y, u, d, f), e.clip();
|
|
3207
3290
|
for (let t of g) {
|
|
3208
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, g =
|
|
3291
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, g = Di(n, a) + t.fromColOff * i / D, b = Oi(r, o) + t.fromRowOff * i / D, x, S;
|
|
3209
3292
|
if (ur(t)) x = t.nativeExtCx * i / D, S = t.nativeExtCy * i / D;
|
|
3210
3293
|
else {
|
|
3211
|
-
let e = t.toCol + 1, a = t.toRow + 1, o =
|
|
3294
|
+
let e = t.toCol + 1, a = t.toRow + 1, o = Di(n, e) + t.toColOff * i / D, s = Oi(r, a) + t.toRowOff * i / D;
|
|
3212
3295
|
x = o - g, S = s - b;
|
|
3213
3296
|
}
|
|
3214
3297
|
if (x <= 0 || S <= 0) continue;
|
|
3215
3298
|
let C = xr(l + (g - _) - s, x, h, m), w = u + (b - v) - c;
|
|
3216
3299
|
if (!(C + x < y || C > y + d) && !(w + S < u || w > u + f)) for (let n of t.shapes) {
|
|
3217
3300
|
let t = C + n.x * x, r = w + n.y * S, a = n.w * x, o = n.h * S;
|
|
3218
|
-
a <= 0 || o <= 0 ||
|
|
3301
|
+
a <= 0 || o <= 0 || ji(e, n, t, r, a, o, i, p);
|
|
3219
3302
|
}
|
|
3220
3303
|
}
|
|
3221
3304
|
e.restore();
|
|
3222
3305
|
}
|
|
3223
|
-
function
|
|
3306
|
+
function ji(e, t, n, r, i, o, s, c) {
|
|
3224
3307
|
if (e.save(), t.rot !== 0 || t.flipH || t.flipV ? (e.translate(n + i / 2, r + o / 2), e.rotate(t.rot * Math.PI / 180), e.scale(t.flipH ? -1 : 1, t.flipV ? -1 : 1), e.translate(-i / 2, -o / 2)) : e.translate(n, r), t.geom.type === "custom") for (let n of t.geom.paths) {
|
|
3225
3308
|
if (n.w <= 0 || n.h <= 0) continue;
|
|
3226
3309
|
let r = i / n.w, a = o / n.h;
|
|
@@ -3258,14 +3341,14 @@ function Ei(e, t, n, r, i, o, s, c) {
|
|
|
3258
3341
|
e.closePath(), s = l, c = u;
|
|
3259
3342
|
break;
|
|
3260
3343
|
}
|
|
3261
|
-
|
|
3344
|
+
Vi(e, t, i, o);
|
|
3262
3345
|
}
|
|
3263
3346
|
else if (t.geom.type === "preset") {
|
|
3264
3347
|
let n = S(t.fill ?? (t.fillColor ? {
|
|
3265
3348
|
fillType: "solid",
|
|
3266
3349
|
color: t.fillColor
|
|
3267
|
-
} : null), e, 0, 0, i, o, t.rot), r = t.strokeColor && t.strokeWidth > 0 ? () =>
|
|
3268
|
-
b(e, t.geom.name, 0, 0, i, o, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, o),
|
|
3350
|
+
} : null), e, 0, 0, i, o, t.rot), r = t.strokeColor && t.strokeWidth > 0 ? () => Ui(e, t, i, o) : null;
|
|
3351
|
+
b(e, t.geom.name, 0, 0, i, o, t.geom.adj ?? [], n, r, () => {}) || (e.beginPath(), e.rect(0, 0, i, o), Vi(e, t, i, o));
|
|
3269
3352
|
} else if (t.geom.type === "image") {
|
|
3270
3353
|
let n = c?.get(dr(t.geom.imagePath, t.geom.duotone));
|
|
3271
3354
|
if (n) {
|
|
@@ -3273,10 +3356,10 @@ function Ei(e, t, n, r, i, o, s, c) {
|
|
|
3273
3356
|
r != null && r < 1 ? (e.save(), e.globalAlpha = r, a(e, n, t.geom.srcRect, 0, 0, i, o), e.restore()) : a(e, n, t.geom.srcRect, 0, 0, i, o);
|
|
3274
3357
|
}
|
|
3275
3358
|
}
|
|
3276
|
-
t.text &&
|
|
3359
|
+
t.text && Bi(e, t.text, i, o, s), e.restore();
|
|
3277
3360
|
}
|
|
3278
|
-
var
|
|
3279
|
-
function
|
|
3361
|
+
var Mi = /* @__PURE__ */ new WeakMap();
|
|
3362
|
+
function Ni(e, t) {
|
|
3280
3363
|
let n = e.tinted.get(t);
|
|
3281
3364
|
if (n) return n;
|
|
3282
3365
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -3284,18 +3367,18 @@ function Oi(e, t) {
|
|
|
3284
3367
|
let o = a.getContext("2d");
|
|
3285
3368
|
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
3286
3369
|
}
|
|
3287
|
-
function
|
|
3370
|
+
function Pi(e) {
|
|
3288
3371
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
3289
3372
|
return new Promise((e, r) => {
|
|
3290
3373
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
3291
3374
|
});
|
|
3292
3375
|
}
|
|
3293
|
-
var
|
|
3294
|
-
function
|
|
3295
|
-
let r = Math.max(1, Math.round(t *
|
|
3376
|
+
var Fi = 256;
|
|
3377
|
+
function Ii(e, t, n) {
|
|
3378
|
+
let r = Math.max(1, Math.round(t * Fi)), i = Math.max(1, Math.round(n * Fi));
|
|
3296
3379
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
3297
3380
|
}
|
|
3298
|
-
function
|
|
3381
|
+
function Li(e) {
|
|
3299
3382
|
let t = [];
|
|
3300
3383
|
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({
|
|
3301
3384
|
nodes: e.nodes,
|
|
@@ -3303,17 +3386,17 @@ function Mi(e) {
|
|
|
3303
3386
|
});
|
|
3304
3387
|
return t;
|
|
3305
3388
|
}
|
|
3306
|
-
function
|
|
3307
|
-
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" && !
|
|
3389
|
+
function Ri(e) {
|
|
3390
|
+
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" && !Mi.has(e.nodes)) return !0;
|
|
3308
3391
|
return !1;
|
|
3309
3392
|
}
|
|
3310
|
-
async function
|
|
3311
|
-
let n =
|
|
3393
|
+
async function zi(e, t) {
|
|
3394
|
+
let n = Li(e).filter((e) => !Mi.has(e.nodes));
|
|
3312
3395
|
if (n.length !== 0) {
|
|
3313
3396
|
await t.loadMathJax();
|
|
3314
|
-
for (let e of n) if (!
|
|
3315
|
-
let n = await t.mathMLToSvg(T(e.nodes, e.display)), r = await
|
|
3316
|
-
|
|
3397
|
+
for (let e of n) if (!Mi.has(e.nodes)) try {
|
|
3398
|
+
let n = await t.mathMLToSvg(T(e.nodes, e.display)), r = await Pi(Ii(Ve(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
3399
|
+
Mi.set(e.nodes, {
|
|
3317
3400
|
img: r,
|
|
3318
3401
|
widthEm: n.widthEm,
|
|
3319
3402
|
ascentEm: n.ascentEm,
|
|
@@ -3323,7 +3406,7 @@ async function Pi(e, t) {
|
|
|
3323
3406
|
} catch {}
|
|
3324
3407
|
}
|
|
3325
3408
|
}
|
|
3326
|
-
function
|
|
3409
|
+
function Bi(e, t, n, r, i) {
|
|
3327
3410
|
if (n <= 0 || r <= 0 || t.paragraphs.length === 0) return;
|
|
3328
3411
|
let a = t.lIns / D * i, o = t.rIns / D * i, s = t.tIns / D * i, c = t.bIns / D * i, l = Math.max(0, n - a - o), u = Math.max(0, r - s - c);
|
|
3329
3412
|
if (l <= 0 || u <= 0) return;
|
|
@@ -3364,7 +3447,7 @@ function Fi(e, t, n, r, i) {
|
|
|
3364
3447
|
continue;
|
|
3365
3448
|
}
|
|
3366
3449
|
if (t.type === "math") {
|
|
3367
|
-
let e =
|
|
3450
|
+
let e = Mi.get(t.nodes);
|
|
3368
3451
|
if (!e) continue;
|
|
3369
3452
|
let n = (t.fontSize ?? (E || yr)) * G * i, o = e.widthEm * n, s = e.ascentEm * n, c = e.descentEm * n, l = t.color ?? "#000000";
|
|
3370
3453
|
if (t.display) {
|
|
@@ -3457,7 +3540,7 @@ function Fi(e, t, n, r, i) {
|
|
|
3457
3540
|
for (let r of t.segs) {
|
|
3458
3541
|
if (r.kind === "text") e.font = r.font, e.fillStyle = r.color, e.fillText(r.text, i, n);
|
|
3459
3542
|
else {
|
|
3460
|
-
let t =
|
|
3543
|
+
let t = Ni(r.render, r.color);
|
|
3461
3544
|
e.drawImage(t, i, n - r.ascent, r.w, r.ascent + r.descent);
|
|
3462
3545
|
}
|
|
3463
3546
|
i += r.w;
|
|
@@ -3470,14 +3553,14 @@ function Fi(e, t, n, r, i) {
|
|
|
3470
3553
|
_ += t.height;
|
|
3471
3554
|
}
|
|
3472
3555
|
}
|
|
3473
|
-
function
|
|
3556
|
+
function Vi(e, t, n, r) {
|
|
3474
3557
|
let i = S(t.fill ?? (t.fillColor ? {
|
|
3475
3558
|
fillType: "solid",
|
|
3476
3559
|
color: t.fillColor
|
|
3477
3560
|
} : null), e, 0, 0, n, r, t.rot);
|
|
3478
|
-
i && (e.fillStyle = i, e.fill()),
|
|
3561
|
+
i && (e.fillStyle = i, e.fill()), Ui(e, t, n, r);
|
|
3479
3562
|
}
|
|
3480
|
-
function
|
|
3563
|
+
function Hi(e) {
|
|
3481
3564
|
return !e.strokeColor || e.strokeWidth <= 0 ? null : {
|
|
3482
3565
|
color: e.strokeColor,
|
|
3483
3566
|
width: e.strokeWidth,
|
|
@@ -3493,17 +3576,17 @@ function Li(e) {
|
|
|
3493
3576
|
...e.strokeTailEnd ? { tailEnd: e.strokeTailEnd } : {}
|
|
3494
3577
|
};
|
|
3495
3578
|
}
|
|
3496
|
-
function
|
|
3497
|
-
let i =
|
|
3579
|
+
function Ui(e, t, n, r) {
|
|
3580
|
+
let i = Hi(t);
|
|
3498
3581
|
if (i) {
|
|
3499
|
-
if (
|
|
3582
|
+
if (ue(e, i, 1 / D), i.fill) {
|
|
3500
3583
|
let a = S(i.fill, e, 0, 0, n, r, t.rot);
|
|
3501
3584
|
a && (e.strokeStyle = a);
|
|
3502
3585
|
}
|
|
3503
3586
|
e.stroke();
|
|
3504
3587
|
}
|
|
3505
3588
|
}
|
|
3506
|
-
function
|
|
3589
|
+
function Wi(e, t, n, r, i, a, o) {
|
|
3507
3590
|
if (r === n && i === t) return e;
|
|
3508
3591
|
let s = (e, r) => {
|
|
3509
3592
|
if (e === t && r === n) return null;
|
|
@@ -3523,7 +3606,7 @@ function zi(e, t, n, r, i, a, o) {
|
|
|
3523
3606
|
diagonalDown: e.diagonalDown ?? null
|
|
3524
3607
|
};
|
|
3525
3608
|
}
|
|
3526
|
-
function
|
|
3609
|
+
function Gi(e, t) {
|
|
3527
3610
|
if (!t) return e;
|
|
3528
3611
|
let n = (e, t) => t && t.style ? t : e ?? null;
|
|
3529
3612
|
return {
|
|
@@ -3535,7 +3618,15 @@ function Bi(e, t) {
|
|
|
3535
3618
|
diagonalDown: n(e.diagonalDown, t.diagonalDown)
|
|
3536
3619
|
};
|
|
3537
3620
|
}
|
|
3538
|
-
function
|
|
3621
|
+
function Ki(e, t, n, r, i = 1) {
|
|
3622
|
+
return {
|
|
3623
|
+
outerStart: n ? e - i : e,
|
|
3624
|
+
outerEnd: r ? t + i : t,
|
|
3625
|
+
innerStart: n ? e + i : e,
|
|
3626
|
+
innerEnd: r ? t - i : t
|
|
3627
|
+
};
|
|
3628
|
+
}
|
|
3629
|
+
function qi(e, t, n, r, i, a, o = 1) {
|
|
3539
3630
|
let s = [
|
|
3540
3631
|
{
|
|
3541
3632
|
edge: t.top,
|
|
@@ -3586,36 +3677,36 @@ function Vi(e, t, n, r, i, a, o = 1) {
|
|
|
3586
3677
|
kind: "d"
|
|
3587
3678
|
}
|
|
3588
3679
|
];
|
|
3589
|
-
for (let { edge:
|
|
3590
|
-
if (!
|
|
3591
|
-
let s =
|
|
3592
|
-
if (
|
|
3680
|
+
for (let { edge: c, x1: l, y1: u, x2: d, y2: f, kind: p } of s) {
|
|
3681
|
+
if (!c || !c.style || c.style === "none") continue;
|
|
3682
|
+
let s = c.color ? C(c.color) : "#000000";
|
|
3683
|
+
if (c.style === "double" && p === "d") {
|
|
3593
3684
|
e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]);
|
|
3594
|
-
let t =
|
|
3595
|
-
e.beginPath(), e.moveTo(
|
|
3685
|
+
let t = d - l, n = f - u, r = Math.hypot(t, n), i = -n / r * 1, a = t / r * 1;
|
|
3686
|
+
e.beginPath(), e.moveTo(l + i, u + a), e.lineTo(d + i, f + a), e.moveTo(l - i, u - a), e.lineTo(d - i, f - a), e.stroke();
|
|
3596
3687
|
continue;
|
|
3597
3688
|
}
|
|
3598
|
-
if (
|
|
3599
|
-
if (e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]), e.beginPath(),
|
|
3600
|
-
let
|
|
3601
|
-
e.moveTo(
|
|
3689
|
+
if (c.style === "double" && p !== "d") {
|
|
3690
|
+
if (e.strokeStyle = s, e.lineWidth = 1, e.setLineDash([]), e.beginPath(), p === "h") {
|
|
3691
|
+
let o = u === r, s = o ? r - 1 : r + a + 1, c = o ? r + 1 : r + a - 1, l = Ki(n, n + i, !!t.left?.style && t.left.style !== "none", !!t.right?.style && t.right.style !== "none", 1);
|
|
3692
|
+
e.moveTo(l.outerStart, s), e.lineTo(l.outerEnd, s), e.moveTo(l.innerStart, c), e.lineTo(l.innerEnd, c);
|
|
3602
3693
|
} else {
|
|
3603
|
-
let
|
|
3604
|
-
e.moveTo(
|
|
3694
|
+
let o = l === n, s = o ? n - 1 : n + i + 1, c = o ? n + 1 : n + i - 1, u = Ki(r, r + a, !!t.top?.style && t.top.style !== "none", !!t.bottom?.style && t.bottom.style !== "none", 1);
|
|
3695
|
+
e.moveTo(s, u.outerStart), e.lineTo(s, u.outerEnd), e.moveTo(c, u.innerStart), e.lineTo(c, u.innerEnd);
|
|
3605
3696
|
}
|
|
3606
3697
|
e.stroke();
|
|
3607
3698
|
continue;
|
|
3608
3699
|
}
|
|
3609
3700
|
e.beginPath(), e.strokeStyle = s;
|
|
3610
|
-
let
|
|
3611
|
-
e.lineWidth =
|
|
3612
|
-
let
|
|
3613
|
-
e.setLineDash(
|
|
3614
|
-
let
|
|
3615
|
-
e.moveTo(
|
|
3701
|
+
let m = Ji(c.style);
|
|
3702
|
+
e.lineWidth = m;
|
|
3703
|
+
let h = Yi(c.style);
|
|
3704
|
+
e.setLineDash(h);
|
|
3705
|
+
let g = p === "v" ? U(l, m, o) : 0, _ = p === "h" ? U(u, m, o) : 0;
|
|
3706
|
+
e.moveTo(l + g, u + _), e.lineTo(d + g, f + _), e.stroke(), e.setLineDash([]);
|
|
3616
3707
|
}
|
|
3617
3708
|
}
|
|
3618
|
-
function
|
|
3709
|
+
function Ji(e) {
|
|
3619
3710
|
switch (e) {
|
|
3620
3711
|
case "thick": return 3;
|
|
3621
3712
|
case "medium":
|
|
@@ -3627,10 +3718,10 @@ function Hi(e) {
|
|
|
3627
3718
|
default: return 1;
|
|
3628
3719
|
}
|
|
3629
3720
|
}
|
|
3630
|
-
function
|
|
3721
|
+
function Yi(e) {
|
|
3631
3722
|
return t(e);
|
|
3632
3723
|
}
|
|
3633
|
-
function
|
|
3724
|
+
function Xi(e) {
|
|
3634
3725
|
switch (e) {
|
|
3635
3726
|
case "double": return 13;
|
|
3636
3727
|
case "thick": return 12;
|
|
@@ -3648,21 +3739,21 @@ function Wi(e) {
|
|
|
3648
3739
|
default: return 0;
|
|
3649
3740
|
}
|
|
3650
3741
|
}
|
|
3651
|
-
function
|
|
3652
|
-
let n =
|
|
3742
|
+
function Zi(e, t) {
|
|
3743
|
+
let n = Xi(e?.style), r = Xi(t?.style);
|
|
3653
3744
|
return n === 0 && r === 0 ? null : n >= r ? e ?? null : t ?? null;
|
|
3654
3745
|
}
|
|
3655
|
-
function
|
|
3746
|
+
function Qi(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h, g = t.charts) {
|
|
3656
3747
|
if (f <= 0 || p <= 0) return;
|
|
3657
|
-
let
|
|
3658
|
-
for (let
|
|
3659
|
-
let
|
|
3748
|
+
let _ = Di(n, o), v = Oi(r, a), y = xr(l, f, h, m);
|
|
3749
|
+
for (let t of g) {
|
|
3750
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, g = t.toCol + 1, b = t.toRow + 1, x = Di(n, a) + t.fromColOff * i / D, S = Oi(r, o) + t.fromRowOff * i / D, C = Di(n, g) + t.toColOff * i / D, w = Oi(r, b) + t.toRowOff * i / D, T = C - x, E = w - S;
|
|
3660
3751
|
if (T <= 0 || E <= 0) continue;
|
|
3661
|
-
let O = xr(l + (x -
|
|
3662
|
-
if (O + T <
|
|
3663
|
-
e.save(), e.beginPath(), e.rect(
|
|
3752
|
+
let O = xr(l + (x - _) - s, T, h, m), k = u + (S - v) - c;
|
|
3753
|
+
if (O + T < y || O > y + f || k + E < u || k > u + p) continue;
|
|
3754
|
+
e.save(), e.beginPath(), e.rect(y, u, f, p), e.clip();
|
|
3664
3755
|
let A = G * i;
|
|
3665
|
-
d(e,
|
|
3756
|
+
d(e, t.chart, {
|
|
3666
3757
|
x: O,
|
|
3667
3758
|
y: k,
|
|
3668
3759
|
w: T,
|
|
@@ -3670,52 +3761,52 @@ function Ki(e, t, n, r, i, a, o, s, c, l, u, f, p, m, h) {
|
|
|
3670
3761
|
}, A), e.restore();
|
|
3671
3762
|
}
|
|
3672
3763
|
}
|
|
3673
|
-
var
|
|
3674
|
-
function
|
|
3764
|
+
var $i = "600 12px \"Meiryo UI\", \"Segoe UI\", sans-serif", ea = "11px \"Meiryo UI\", \"Segoe UI\", sans-serif", ta = "#FFFFFF", na = "#BFBFBF", ra = "#F2F2F2", ia = "#404040", aa = "#FFFFFF", oa = "#000000", sa = "#A5A5A5", ca = "#E7E6E6", la = "#A6A6A6", ua = "#C6C6C6";
|
|
3765
|
+
function da(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m) {
|
|
3675
3766
|
if (d <= 0 || f <= 0) return;
|
|
3676
3767
|
let h = t.slicers;
|
|
3677
3768
|
if (!h) return;
|
|
3678
|
-
let g =
|
|
3769
|
+
let g = Di(n, o), _ = Oi(r, a), v = xr(l, d, m, p);
|
|
3679
3770
|
for (let t of h) {
|
|
3680
|
-
let a = t.fromCol + 1, o = t.fromRow + 1, h = t.toCol + 1, y = t.toRow + 1, b =
|
|
3771
|
+
let a = t.fromCol + 1, o = t.fromRow + 1, h = t.toCol + 1, y = t.toRow + 1, b = Di(n, a) + t.fromColOff * i / D, x = Oi(r, o) + t.fromRowOff * i / D, S = Di(n, h) + t.toColOff * i / D, C = Oi(r, y) + t.toRowOff * i / D, w = S - b, T = C - x;
|
|
3681
3772
|
if (w <= 0 || T <= 0) continue;
|
|
3682
3773
|
let E = xr(l + (b - g) - s, w, m, p), O = u + (x - _) - c;
|
|
3683
|
-
E + w < v || E > v + d || O + T < u || O > u + f || (e.save(), e.beginPath(), e.rect(v, u, d, f), e.clip(),
|
|
3774
|
+
E + w < v || E > v + d || O + T < u || O > u + f || (e.save(), e.beginPath(), e.rect(v, u, d, f), e.clip(), fa(e, t.caption, t.items, E, O, w, T, i, t.style), e.restore());
|
|
3684
3775
|
}
|
|
3685
3776
|
}
|
|
3686
|
-
function
|
|
3777
|
+
function fa(e, t, n, r, i, a, o, s, c) {
|
|
3687
3778
|
let l = c != null;
|
|
3688
|
-
e.fillStyle = c?.whole?.fillColor ??
|
|
3689
|
-
let u = l ? c.whole?.borderColor :
|
|
3779
|
+
e.fillStyle = c?.whole?.fillColor ?? ta, e.fillRect(r, i, a, o);
|
|
3780
|
+
let u = l ? c.whole?.borderColor : na;
|
|
3690
3781
|
u && (e.strokeStyle = u, e.lineWidth = 1, e.strokeRect(r + .5, i + .5, a - 1, o - 1));
|
|
3691
|
-
let d = Math.max(20 * s, 14), f = l ? c.header?.fillColor :
|
|
3692
|
-
f && (e.fillStyle = f, e.fillRect(r + 1, i + 1, a - 2, d)), e.fillStyle = c?.header?.fontColor ??
|
|
3782
|
+
let d = Math.max(20 * s, 14), f = l ? c.header?.fillColor : ra;
|
|
3783
|
+
f && (e.fillStyle = f, e.fillRect(r + 1, i + 1, a - 2, d)), e.fillStyle = c?.header?.fontColor ?? ia, e.font = ma(c?.header, $i, s), e.textBaseline = "middle", e.textAlign = "left";
|
|
3693
3784
|
let p = 6 * s;
|
|
3694
|
-
if (
|
|
3785
|
+
if (ga(e, t, r + p, i + d / 2 + 1, a - 2 * p), n.length === 0) return;
|
|
3695
3786
|
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;
|
|
3696
3787
|
if (v <= 0 || y <= 0) return;
|
|
3697
3788
|
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);
|
|
3698
3789
|
if (C <= 0) return;
|
|
3699
|
-
e.font =
|
|
3790
|
+
e.font = ha(ea, s);
|
|
3700
3791
|
let w = 8 * s;
|
|
3701
3792
|
for (let t = 0; t < S; t++) {
|
|
3702
|
-
let r = n[t], i = _ + t * (C + m), a = r.selected, o = a ? c?.selectedItemWithData : c?.unselectedItemWithData, u = o?.fillColor ?? (a ?
|
|
3703
|
-
e.fillStyle = u, l ? (
|
|
3793
|
+
let r = n[t], i = _ + t * (C + m), a = r.selected, o = a ? c?.selectedItemWithData : c?.unselectedItemWithData, u = o?.fillColor ?? (a ? aa : ca), d = l ? o?.borderColor : a ? sa : ua;
|
|
3794
|
+
e.fillStyle = u, l ? (pa(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 = ma(o, ea, s), e.fillStyle = o?.fontColor ?? (a ? oa : la), ga(e, r.name, g + w, i + C / 2 + 1, v - 2 * w);
|
|
3704
3795
|
}
|
|
3705
3796
|
}
|
|
3706
|
-
function
|
|
3797
|
+
function pa(e, t, n, r, i, a) {
|
|
3707
3798
|
let o = Math.max(0, Math.min(a, r / 2, i / 2));
|
|
3708
3799
|
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();
|
|
3709
3800
|
}
|
|
3710
|
-
function
|
|
3711
|
-
if (!e) return
|
|
3801
|
+
function ma(e, t, n) {
|
|
3802
|
+
if (!e) return ha(t, n);
|
|
3712
3803
|
let r = Math.round((e.fontSize ?? 11) * n);
|
|
3713
3804
|
return `${e.fontBold ? "bold " : ""}${r}px ${e.fontFamily ? `"${e.fontFamily}", "Segoe UI", sans-serif` : "\"Meiryo UI\", \"Segoe UI\", sans-serif"}`;
|
|
3714
3805
|
}
|
|
3715
|
-
function
|
|
3806
|
+
function ha(e, t) {
|
|
3716
3807
|
return e.replace(/(\d+(?:\.\d+)?)px/, (e, n) => `${Math.round(Number(n) * t)}px`);
|
|
3717
3808
|
}
|
|
3718
|
-
function
|
|
3809
|
+
function ga(e, t, n, r, i) {
|
|
3719
3810
|
if (i <= 0) return;
|
|
3720
3811
|
let a = t;
|
|
3721
3812
|
if (e.measureText(a).width > i) {
|
|
@@ -3726,14 +3817,14 @@ function ua(e, t, n, r, i) {
|
|
|
3726
3817
|
}
|
|
3727
3818
|
//#endregion
|
|
3728
3819
|
//#region packages/xlsx/src/render-orchestrator.ts
|
|
3729
|
-
var
|
|
3730
|
-
function
|
|
3820
|
+
var _a = Symbol("xlsx-render-commit-guard");
|
|
3821
|
+
function va(e, t) {
|
|
3731
3822
|
return {
|
|
3732
3823
|
...e,
|
|
3733
|
-
[
|
|
3824
|
+
[_a]: t
|
|
3734
3825
|
};
|
|
3735
3826
|
}
|
|
3736
|
-
function
|
|
3827
|
+
function ya(e, t, n, r, i) {
|
|
3737
3828
|
if (!n) return !0;
|
|
3738
3829
|
let a = r ?? $(t), o = i?.scale ?? 1, { col: s, row: c } = a.axesAtScale(o), l = (e, t, n) => e.offsetOf(t + 1) + n * o / D, u = l(s, e.fromCol, e.fromColOff), d = l(c, e.fromRow, e.fromRowOff), f = ur(e), p = f ? u + e.nativeExtCx * o / D : l(s, e.toCol, e.toColOff), m = f ? d + e.nativeExtCy * o / D : l(c, e.toRow, e.toRowOff);
|
|
3739
3830
|
if (p <= u || m <= d) return !1;
|
|
@@ -3754,7 +3845,7 @@ function pa(e, t, n, r, i) {
|
|
|
3754
3845
|
};
|
|
3755
3846
|
return g(u, p, s.offsetOf(h.cols + 1), s.offsetOf(n.col), s.offsetOf(n.col + n.cols)) && g(d, m, c.offsetOf(h.rows + 1), c.offsetOf(n.row), c.offsetOf(n.row + n.rows));
|
|
3756
3847
|
}
|
|
3757
|
-
async function
|
|
3848
|
+
async function ba(e, t, n, r, i = 0, a = 0, o = null, c = null, l) {
|
|
3758
3849
|
let u = t === "image/svg+xml", d = y(t, o, i, a), f = () => Be(e, t, c, r, {
|
|
3759
3850
|
widthPt: d.widthPt,
|
|
3760
3851
|
heightPt: d.heightPt,
|
|
@@ -3763,14 +3854,14 @@ async function ma(e, t, n, r, i = 0, a = 0, o = null, c = null, l) {
|
|
|
3763
3854
|
svgImagePath: n,
|
|
3764
3855
|
srcRect: o
|
|
3765
3856
|
};
|
|
3766
|
-
if (
|
|
3857
|
+
if (J(p)) try {
|
|
3767
3858
|
return await s(p.svgImagePath, r);
|
|
3768
3859
|
} catch {
|
|
3769
3860
|
return u ? s(e, r) : f();
|
|
3770
3861
|
}
|
|
3771
3862
|
return u ? s(e, r) : f();
|
|
3772
3863
|
}
|
|
3773
|
-
async function
|
|
3864
|
+
async function xa(e, t, n, r) {
|
|
3774
3865
|
if (t.clear(), !n) return;
|
|
3775
3866
|
let i = n, a = /* @__PURE__ */ new Map(), o = r?.viewport ? $(e) : void 0, s = r?.viewport && r.width !== void 0 && r.height !== void 0 ? {
|
|
3776
3867
|
width: r.width,
|
|
@@ -3779,7 +3870,7 @@ async function ha(e, t, n, r) {
|
|
|
3779
3870
|
freezeRows: r.freezeRows ?? e.freezeRows ?? 0,
|
|
3780
3871
|
freezeCols: r.freezeCols ?? e.freezeCols ?? 0
|
|
3781
3872
|
} : void 0;
|
|
3782
|
-
if (e.images) for (let t of e.images)
|
|
3873
|
+
if (e.images) for (let t of e.images) ya(t, e, r?.viewport, o, s) && a.set(dr(t.imagePath, t.duotone), {
|
|
3783
3874
|
imagePath: t.imagePath,
|
|
3784
3875
|
mimeType: t.mimeType,
|
|
3785
3876
|
svgImagePath: t.svgImagePath,
|
|
@@ -3789,7 +3880,7 @@ async function ha(e, t, n, r) {
|
|
|
3789
3880
|
duotone: t.duotone ?? null
|
|
3790
3881
|
});
|
|
3791
3882
|
if (e.shapeGroups) {
|
|
3792
|
-
for (let t of e.shapeGroups) if (
|
|
3883
|
+
for (let t of e.shapeGroups) if (ya(t, e, r?.viewport, o, s)) for (let e of t.shapes) e.geom.type === "image" && a.set(dr(e.geom.imagePath, e.geom.duotone), {
|
|
3793
3884
|
imagePath: e.geom.imagePath,
|
|
3794
3885
|
mimeType: e.geom.mimeType,
|
|
3795
3886
|
svgImagePath: e.geom.svgImagePath,
|
|
@@ -3801,7 +3892,7 @@ async function ha(e, t, n, r) {
|
|
|
3801
3892
|
}
|
|
3802
3893
|
a.size !== 0 && await Promise.all([...a.entries()].map(async ([e, n]) => {
|
|
3803
3894
|
try {
|
|
3804
|
-
let a = await
|
|
3895
|
+
let a = await ba(n.imagePath, n.mimeType, n.svgImagePath, i, n.widthPt, n.heightPt, n.srcRect, n.duotone, r?.offscreenFactory);
|
|
3805
3896
|
t.set(e, a);
|
|
3806
3897
|
} catch (n) {
|
|
3807
3898
|
if (f(n)) throw n;
|
|
@@ -3809,41 +3900,41 @@ async function ha(e, t, n, r) {
|
|
|
3809
3900
|
}
|
|
3810
3901
|
}));
|
|
3811
3902
|
}
|
|
3812
|
-
async function
|
|
3903
|
+
async function Sa(e, t, n, r = {}) {
|
|
3813
3904
|
let i = r.fetchImage ? h(r.fetchImage) : void 0;
|
|
3814
3905
|
try {
|
|
3815
|
-
await
|
|
3906
|
+
await Ca(e, t, n, r);
|
|
3816
3907
|
} finally {
|
|
3817
3908
|
i?.();
|
|
3818
3909
|
}
|
|
3819
3910
|
}
|
|
3820
|
-
async function
|
|
3821
|
-
let { ws: i, styles: a } = e, o =
|
|
3822
|
-
if (await
|
|
3911
|
+
async function Ca(e, t, n, r = {}) {
|
|
3912
|
+
let { ws: i, styles: a } = e, o = F(t) ? t.clientWidth || 800 : t.width, s = F(t) ? t.clientHeight || 600 : t.height, c = r.width ?? o, l = r.height ?? s, u = /* @__PURE__ */ new Map();
|
|
3913
|
+
if (await xa(i, u, r.fetchImage, {
|
|
3823
3914
|
viewport: n,
|
|
3824
3915
|
width: c,
|
|
3825
3916
|
height: l,
|
|
3826
3917
|
cellScale: r.cellScale,
|
|
3827
3918
|
freezeRows: r.freezeRows,
|
|
3828
3919
|
freezeCols: r.freezeCols
|
|
3829
|
-
}), e.math &&
|
|
3830
|
-
let d = r.dpr ?? R(), f =
|
|
3831
|
-
if (t.width !== m && (t.width = m), t.height !== h && (t.height = h),
|
|
3920
|
+
}), e.math && Ri(i) && await zi(i, e.math), r[_a]?.() === !1) return;
|
|
3921
|
+
let d = r.dpr ?? R(), f = ce(c * d, l * d), p = f.clamped ? d * f.scale : d, m = f.width, h = f.height;
|
|
3922
|
+
if (t.width !== m && (t.width = m), t.height !== h && (t.height = h), F(t)) {
|
|
3832
3923
|
let e = `${c}px`, n = `${l}px`;
|
|
3833
3924
|
t.style.width !== e && (t.style.width = e), t.style.height !== n && (t.style.height = n);
|
|
3834
3925
|
}
|
|
3835
3926
|
let g = t.getContext("2d");
|
|
3836
3927
|
if (g.setTransform(p, 0, 0, p, 0, 0), i.parseError) {
|
|
3837
|
-
|
|
3928
|
+
wa(g, c, l, i.name, i.parseError);
|
|
3838
3929
|
return;
|
|
3839
3930
|
}
|
|
3840
|
-
|
|
3931
|
+
wi(g, i, a, n, {
|
|
3841
3932
|
...r,
|
|
3842
3933
|
dpr: p,
|
|
3843
3934
|
loadedImages: u
|
|
3844
3935
|
});
|
|
3845
3936
|
}
|
|
3846
|
-
function
|
|
3937
|
+
function wa(e, t, n, r, i) {
|
|
3847
3938
|
e.save(), e.fillStyle = "#f7f7f8", e.fillRect(0, 0, t, n);
|
|
3848
3939
|
let a = t / 2, o = Math.min(t, n), s = Math.max(20, o * .1);
|
|
3849
3940
|
e.fillStyle = "#b23b3b", e.textAlign = "center", e.textBaseline = "middle", e.font = `${s}px sans-serif`, e.fillText("⚠", a, n * .32);
|
|
@@ -3863,21 +3954,21 @@ function va(e, t, n, r, i) {
|
|
|
3863
3954
|
}
|
|
3864
3955
|
//#endregion
|
|
3865
3956
|
//#region packages/xlsx/src/google-fonts.ts
|
|
3866
|
-
var
|
|
3957
|
+
var Ta = {
|
|
3867
3958
|
...ie,
|
|
3868
|
-
...
|
|
3959
|
+
...re
|
|
3869
3960
|
};
|
|
3870
|
-
function*
|
|
3961
|
+
function* Ea(e) {
|
|
3871
3962
|
for (let t of e?.sharedStrings ?? []) if (t.runs && t.runs.length > 0) for (let e of t.runs) yield e.text;
|
|
3872
3963
|
else yield t.text;
|
|
3873
3964
|
}
|
|
3874
|
-
function
|
|
3965
|
+
function Da(e) {
|
|
3875
3966
|
let t = /* @__PURE__ */ new Set(), n = null;
|
|
3876
3967
|
for (let r of e?.styles?.fonts ?? []) r.name && (t.add(r.name), n ??= j(r.name));
|
|
3877
|
-
for (let r of
|
|
3968
|
+
for (let r of se(Ea(e), n)) t.add(r);
|
|
3878
3969
|
return t;
|
|
3879
3970
|
}
|
|
3880
|
-
function
|
|
3971
|
+
function Oa(e) {
|
|
3881
3972
|
let t = (e ?? "").trim();
|
|
3882
3973
|
if (!t) return {
|
|
3883
3974
|
kind: "unresolved",
|
|
@@ -3916,7 +4007,7 @@ function Sa(e) {
|
|
|
3916
4007
|
formula: t
|
|
3917
4008
|
};
|
|
3918
4009
|
}
|
|
3919
|
-
function
|
|
4010
|
+
function ka(e, t) {
|
|
3920
4011
|
if (e.kind === "inline") return {
|
|
3921
4012
|
kind: "values",
|
|
3922
4013
|
values: e.values
|
|
@@ -3935,7 +4026,7 @@ function Ca(e, t) {
|
|
|
3935
4026
|
values: n
|
|
3936
4027
|
};
|
|
3937
4028
|
}
|
|
3938
|
-
function
|
|
4029
|
+
function Aa(e) {
|
|
3939
4030
|
let { cell: t, panel: n, viewport: r, rtl: i } = e, a = t.y + t.h + 2, o = t.y - 2 - n.h, s;
|
|
3940
4031
|
s = a + n.h <= r.h ? a : o >= 0 ? o : a, s = Math.max(0, Math.min(s, r.h - n.h));
|
|
3941
4032
|
let c = i ? t.x + t.w - n.w : t.x;
|
|
@@ -3946,7 +4037,7 @@ function wa(e) {
|
|
|
3946
4037
|
}
|
|
3947
4038
|
//#endregion
|
|
3948
4039
|
//#region packages/xlsx/src/worker-protocol.ts
|
|
3949
|
-
function
|
|
4040
|
+
function ja(e, t) {
|
|
3950
4041
|
if (!t) return;
|
|
3951
4042
|
let n = !1;
|
|
3952
4043
|
if (t.rows) for (let [r, i] of Object.entries(t.rows)) {
|
|
@@ -3959,30 +4050,30 @@ function Ta(e, t) {
|
|
|
3959
4050
|
}
|
|
3960
4051
|
n && or.invalidate(e);
|
|
3961
4052
|
}
|
|
3962
|
-
function
|
|
4053
|
+
function Ma(e, t) {
|
|
3963
4054
|
if (!t) return e;
|
|
3964
4055
|
let n = {
|
|
3965
4056
|
...e,
|
|
3966
4057
|
rowHeights: { ...e.rowHeights },
|
|
3967
4058
|
colWidths: { ...e.colWidths }
|
|
3968
4059
|
};
|
|
3969
|
-
return
|
|
4060
|
+
return ja(n, t), n;
|
|
3970
4061
|
}
|
|
3971
|
-
var
|
|
3972
|
-
function
|
|
4062
|
+
var Na = Symbol("xlsx-viewer-render-context");
|
|
4063
|
+
function Pa(e, t, n) {
|
|
3973
4064
|
if (!Number.isFinite(t) || t <= 0) throw Error("XLSX maximum digit width must be a finite positive number");
|
|
3974
4065
|
return {
|
|
3975
4066
|
...e,
|
|
3976
|
-
[
|
|
4067
|
+
[Na]: {
|
|
3977
4068
|
maximumDigitWidth: t,
|
|
3978
4069
|
worksheet: n?.worksheet,
|
|
3979
4070
|
projection: n?.projection
|
|
3980
4071
|
}
|
|
3981
4072
|
};
|
|
3982
4073
|
}
|
|
3983
|
-
function
|
|
3984
|
-
let t = e[
|
|
3985
|
-
return delete n[
|
|
4074
|
+
function Fa(e) {
|
|
4075
|
+
let t = e[Na], n = { ...e };
|
|
4076
|
+
return delete n[Na], t ? {
|
|
3986
4077
|
opts: n,
|
|
3987
4078
|
layoutMetrics: { maximumDigitWidth: t.maximumDigitWidth },
|
|
3988
4079
|
worksheet: t.worksheet,
|
|
@@ -3991,7 +4082,7 @@ function ka(e) {
|
|
|
3991
4082
|
}
|
|
3992
4083
|
//#endregion
|
|
3993
4084
|
//#region packages/xlsx/src/workbook.ts
|
|
3994
|
-
var
|
|
4085
|
+
var Ia = Symbol("retain-xlsx-viewer-fonts"), La = Symbol("release-xlsx-viewer-projection"), Ra = class e {
|
|
3995
4086
|
metrics = null;
|
|
3996
4087
|
worker;
|
|
3997
4088
|
bridge;
|
|
@@ -4000,7 +4091,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4000
4091
|
sheetLoads = /* @__PURE__ */ new Map();
|
|
4001
4092
|
rawParts = new ze({
|
|
4002
4093
|
maxEntries: 64,
|
|
4003
|
-
maxBytes:
|
|
4094
|
+
maxBytes: le
|
|
4004
4095
|
});
|
|
4005
4096
|
queuedImageLoads = /* @__PURE__ */ new Map();
|
|
4006
4097
|
_fetchImage = (e, t) => this.getImageWithinArchiveOperation(e, t);
|
|
@@ -4022,7 +4113,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4022
4113
|
};
|
|
4023
4114
|
resourceFailure = null;
|
|
4024
4115
|
constructor(e, t, n) {
|
|
4025
|
-
this.worker = e, this._mode = t, this.bridge = new
|
|
4116
|
+
this.worker = e, this._mode = t, this.bridge = new Y(this.worker, {
|
|
4026
4117
|
correlate: (e) => "protocol" in e && e.protocol === "ooxml-pull-v1" ? e.requestId : "id" in e ? e.id : void 0,
|
|
4027
4118
|
toError: (e) => "type" in e && e.type === "error" ? ne(e) : void 0
|
|
4028
4119
|
});
|
|
@@ -4055,7 +4146,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4055
4146
|
s = ve(await be(s, n.password));
|
|
4056
4147
|
let c = s === r;
|
|
4057
4148
|
o.setSourceBytes(s.byteLength), o.checkpoint("container ready");
|
|
4058
|
-
let l = a === "worker" ? (await import("./render-worker-host-
|
|
4149
|
+
let l = a === "worker" ? (await import("./render-worker-host-Ivhx3KII.js")).createRenderWorker() : new ct(), u;
|
|
4059
4150
|
try {
|
|
4060
4151
|
return u = new e(l, a, n.wasmUrl), u.metrics = o, await u._load(s, n, i.policy, (e) => o.observeUsage(e), c), o.checkpoint("workbook index ready"), o.succeed({ sheets: u.sheetCount }), u;
|
|
4061
4152
|
} catch (e) {
|
|
@@ -4094,14 +4185,14 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4094
4185
|
}
|
|
4095
4186
|
this.ensureWorksheetPullClient();
|
|
4096
4187
|
let s = this.parsedWorkbook?.workbook.parseError;
|
|
4097
|
-
s && console.warn(`[ooxml] xlsx opened with a degraded part: ${s}`), t.useGoogleFonts && (this.googleFontNames = [...
|
|
4188
|
+
s && console.warn(`[ooxml] xlsx opened with a degraded part: ${s}`), t.useGoogleFonts && (this.googleFontNames = [...Da(this.parsedWorkbook)], typeof document < "u" && document.fonts && await this.retainFontsInSet(document.fonts));
|
|
4098
4189
|
}
|
|
4099
4190
|
async retainFontsInSet(e) {
|
|
4100
4191
|
if (this.googleFontNames.length === 0 || this.fontsDestroyed) return () => void 0;
|
|
4101
4192
|
let t = this.retainedFontSets.get(e);
|
|
4102
4193
|
if (t) t.refs++;
|
|
4103
4194
|
else {
|
|
4104
|
-
let n = Re(this.googleFontNames,
|
|
4195
|
+
let n = Re(this.googleFontNames, Ta, e);
|
|
4105
4196
|
t = {
|
|
4106
4197
|
refs: 1,
|
|
4107
4198
|
faces: null,
|
|
@@ -4119,7 +4210,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4119
4210
|
r === t && (r.refs--, !(r.refs > 0) && (this.retainedFontSets.delete(e), r.faces ? Le(r.faces) : r.loading.then(Le)));
|
|
4120
4211
|
};
|
|
4121
4212
|
}
|
|
4122
|
-
async [
|
|
4213
|
+
async [Ia](e) {
|
|
4123
4214
|
return await this.retainFontsInSet(e.fonts);
|
|
4124
4215
|
}
|
|
4125
4216
|
get sheetNames() {
|
|
@@ -4154,7 +4245,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4154
4245
|
async getResourceMetrics() {
|
|
4155
4246
|
let e = this.metrics;
|
|
4156
4247
|
if (!e) throw Error("Workbook not loaded");
|
|
4157
|
-
return
|
|
4248
|
+
return _e(e, async (e) => (await this.bridge.request((e) => ({
|
|
4158
4249
|
type: "resourceUsage",
|
|
4159
4250
|
id: e
|
|
4160
4251
|
}), void 0, { timeoutMs: e })).usage);
|
|
@@ -4197,7 +4288,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4197
4288
|
if (!a || !o) throw Error(`XLSX worksheet ${e} did not produce a terminal model`);
|
|
4198
4289
|
return this.retainedSheetUsage = o, this.sheetCache.set(e, a), a;
|
|
4199
4290
|
} catch (e) {
|
|
4200
|
-
throw e instanceof
|
|
4291
|
+
throw e instanceof P && (this.resourceFailure ??= e), e;
|
|
4201
4292
|
}
|
|
4202
4293
|
}
|
|
4203
4294
|
ensureWorksheetPullClient() {
|
|
@@ -4225,7 +4316,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4225
4316
|
try {
|
|
4226
4317
|
return await e();
|
|
4227
4318
|
} catch (e) {
|
|
4228
|
-
throw e instanceof
|
|
4319
|
+
throw e instanceof P && (this.resourceFailure ??= e), e;
|
|
4229
4320
|
}
|
|
4230
4321
|
}, n = (this.archiveOperationTail ?? Promise.resolve()).then(t, t);
|
|
4231
4322
|
return this.archiveOperationTail = n.then(() => void 0, () => void 0), n;
|
|
@@ -4260,8 +4351,8 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4260
4351
|
}
|
|
4261
4352
|
async resolveValidationList(e, t) {
|
|
4262
4353
|
if (this.assertResourceHealthy(), !this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
4263
|
-
let n =
|
|
4264
|
-
if (n.kind !== "range") return
|
|
4354
|
+
let n = Oa(t);
|
|
4355
|
+
if (n.kind !== "range") return ka(n, () => null);
|
|
4265
4356
|
let r = e;
|
|
4266
4357
|
if (n.sheet) {
|
|
4267
4358
|
let e = this.sheetNames.findIndex((e) => e.toLowerCase() === n.sheet?.toLowerCase());
|
|
@@ -4273,7 +4364,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4273
4364
|
}
|
|
4274
4365
|
let i = await this.getWorksheet(r), a = this.parsedWorkbook.styles, o = /* @__PURE__ */ new Map();
|
|
4275
4366
|
for (let e of i.rows) for (let t of e.cells) o.set(`${t.row}:${t.col}`, t);
|
|
4276
|
-
return
|
|
4367
|
+
return ka(n, (e, t) => {
|
|
4277
4368
|
let n = o.get(`${e}:${t}`);
|
|
4278
4369
|
return n ? Yt(n, a, null, i.date1904) : null;
|
|
4279
4370
|
});
|
|
@@ -4284,10 +4375,10 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4284
4375
|
async renderViewport(e, t, n, r = {}) {
|
|
4285
4376
|
if (this.assertResourceHealthy(), this._mode === "worker") throw Error("renderViewport(canvas) is unavailable in mode: 'worker'; use renderViewportToBitmap() and paint it via an ImageBitmapRenderingContext");
|
|
4286
4377
|
if (!this.parsedWorkbook) throw Error("Workbook not loaded");
|
|
4287
|
-
let i = this.parsedWorkbook.styles, a =
|
|
4378
|
+
let i = this.parsedWorkbook.styles, a = Fa(r), { sizeOverrides: o, ...s } = a.opts;
|
|
4288
4379
|
return this.withWorksheetArchiveOperation(t, (t) => {
|
|
4289
|
-
let r = a.worksheet ??
|
|
4290
|
-
return r !== t &&
|
|
4380
|
+
let r = a.worksheet ?? Ma(t, o);
|
|
4381
|
+
return r !== t && Ci(t, r), a.layoutMetrics && or.forWorksheet(r, a.layoutMetrics.maximumDigitWidth), Sa({
|
|
4291
4382
|
ws: r,
|
|
4292
4383
|
styles: i,
|
|
4293
4384
|
math: this.math
|
|
@@ -4299,7 +4390,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4299
4390
|
}
|
|
4300
4391
|
async renderViewportToBitmap(e, t, n) {
|
|
4301
4392
|
this.assertResourceHealthy();
|
|
4302
|
-
let r =
|
|
4393
|
+
let r = Fa(n), i = {
|
|
4303
4394
|
...r.opts,
|
|
4304
4395
|
dpr: n.dpr ?? R()
|
|
4305
4396
|
};
|
|
@@ -4318,7 +4409,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4318
4409
|
let a = new OffscreenCanvas(1, 1);
|
|
4319
4410
|
return await this.renderViewport(a, e, t, i), a.transferToImageBitmap();
|
|
4320
4411
|
}
|
|
4321
|
-
[
|
|
4412
|
+
[La](e) {
|
|
4322
4413
|
this._mode === "worker" && this.bridge.post({
|
|
4323
4414
|
type: "releaseViewProjection",
|
|
4324
4415
|
projectionId: e
|
|
@@ -4357,7 +4448,7 @@ var Aa = Symbol("retain-xlsx-viewer-fonts"), ja = Symbol("release-xlsx-viewer-pr
|
|
|
4357
4448
|
};
|
|
4358
4449
|
//#endregion
|
|
4359
4450
|
//#region packages/xlsx/src/data-validation.ts
|
|
4360
|
-
function
|
|
4451
|
+
function za(e, t, n) {
|
|
4361
4452
|
if (!e) return !1;
|
|
4362
4453
|
for (let r of e.split(/\s+/)) {
|
|
4363
4454
|
if (!r) continue;
|
|
@@ -4374,14 +4465,14 @@ function Na(e, t, n) {
|
|
|
4374
4465
|
}
|
|
4375
4466
|
return !1;
|
|
4376
4467
|
}
|
|
4377
|
-
function
|
|
4468
|
+
function Ba(e, t, n) {
|
|
4378
4469
|
if (!e) return null;
|
|
4379
|
-
for (let r of e) if (r.validationType === "list" &&
|
|
4470
|
+
for (let r of e) if (r.validationType === "list" && za(r.sqref, t, n)) return r;
|
|
4380
4471
|
return null;
|
|
4381
4472
|
}
|
|
4382
4473
|
//#endregion
|
|
4383
4474
|
//#region packages/xlsx/src/element-context.ts
|
|
4384
|
-
function
|
|
4475
|
+
function Va(e, t) {
|
|
4385
4476
|
let n = t.colAxis.offsetOf(e.fromCol + 1) + e.fromColOff * t.scale / D, r = t.rowAxis.offsetOf(e.fromRow + 1) + e.fromRowOff * t.scale / D, i, a;
|
|
4386
4477
|
if (ur(e)) i = e.nativeExtCx * t.scale / D, a = e.nativeExtCy * t.scale / D;
|
|
4387
4478
|
else {
|
|
@@ -4397,18 +4488,18 @@ function Fa(e, t) {
|
|
|
4397
4488
|
height: a
|
|
4398
4489
|
};
|
|
4399
4490
|
}
|
|
4400
|
-
function
|
|
4491
|
+
function Ha(e, t) {
|
|
4401
4492
|
return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
|
|
4402
4493
|
}
|
|
4403
|
-
function
|
|
4494
|
+
function Ua(e, t) {
|
|
4404
4495
|
let n = xr(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
4405
4496
|
return e.x + e.width >= n && e.x <= n + t.scrollAreaW && e.y + e.height >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
4406
4497
|
}
|
|
4407
|
-
function
|
|
4498
|
+
function Wa(e, t) {
|
|
4408
4499
|
let n = xr(t.scrollAreaX, t.scrollAreaW, t.canvasWidth, t.rtl);
|
|
4409
4500
|
return e.x >= n && e.x <= n + t.scrollAreaW && e.y >= t.scrollAreaY && e.y <= t.scrollAreaY + t.scrollAreaH;
|
|
4410
4501
|
}
|
|
4411
|
-
function
|
|
4502
|
+
function Ga(e, t) {
|
|
4412
4503
|
let n = $(e), r = t.cellScale, { col: i, row: a } = n.axesAtScale(r), o = Math.round(50 * r), s = Math.round(22 * r), c = i.bandsToCover(1, t.freezeCols, Math.max(0, t.width - o)), l = a.bandsToCover(1, t.freezeRows, Math.max(0, t.height - s)), u = c.reduce((e, t) => e + t.size, 0), d = l.reduce((e, t) => e + t.size, 0);
|
|
4413
4504
|
return {
|
|
4414
4505
|
colAxis: i,
|
|
@@ -4426,11 +4517,11 @@ function za(e, t) {
|
|
|
4426
4517
|
canvasWidth: t.width
|
|
4427
4518
|
};
|
|
4428
4519
|
}
|
|
4429
|
-
function
|
|
4430
|
-
let r =
|
|
4520
|
+
function Ka(e, t, n) {
|
|
4521
|
+
let r = Ga(e, n), i, a = 0;
|
|
4431
4522
|
if (i = t.elementType === "chart" ? e.charts[t.elementIndex] : t.elementType === "image" ? e.images[t.elementIndex] : (e.shapeGroups ?? [])[t.elementIndex], !i) return null;
|
|
4432
|
-
let o =
|
|
4433
|
-
if (!o || !
|
|
4523
|
+
let o = Va(i, r);
|
|
4524
|
+
if (!o || !Ua(o, r)) return null;
|
|
4434
4525
|
if (t.elementType === "shape") {
|
|
4435
4526
|
let n = (e.shapeGroups ?? [])[t.elementIndex], r = t.shapeIndex === void 0 ? void 0 : n?.shapes[t.shapeIndex];
|
|
4436
4527
|
r && (o = {
|
|
@@ -4452,7 +4543,7 @@ function Ba(e, t, n) {
|
|
|
4452
4543
|
rotation: a
|
|
4453
4544
|
};
|
|
4454
4545
|
}
|
|
4455
|
-
function
|
|
4546
|
+
function qa(e) {
|
|
4456
4547
|
return {
|
|
4457
4548
|
from: {
|
|
4458
4549
|
row: e.fromRow + 1,
|
|
@@ -4468,7 +4559,7 @@ function Va(e) {
|
|
|
4468
4559
|
}
|
|
4469
4560
|
};
|
|
4470
4561
|
}
|
|
4471
|
-
function
|
|
4562
|
+
function Ja(e, t) {
|
|
4472
4563
|
let n = Math.min(e.length, t);
|
|
4473
4564
|
if (n > 0 && n < e.length) {
|
|
4474
4565
|
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
@@ -4476,7 +4567,7 @@ function Ha(e, t) {
|
|
|
4476
4567
|
}
|
|
4477
4568
|
return e.slice(0, n);
|
|
4478
4569
|
}
|
|
4479
|
-
function
|
|
4570
|
+
function Ya(e, t) {
|
|
4480
4571
|
if (!e.text) return {
|
|
4481
4572
|
truncated: !1,
|
|
4482
4573
|
textCharacters: 0
|
|
@@ -4491,7 +4582,7 @@ function Ua(e, t) {
|
|
|
4491
4582
|
n.push("\n"), r++;
|
|
4492
4583
|
}
|
|
4493
4584
|
for (let e of o.runs) {
|
|
4494
|
-
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o =
|
|
4585
|
+
let a = e.type === "text" ? e.text : e.type === "break" ? "\n" : "[equation]", o = Ja(a, Math.max(0, t - r));
|
|
4495
4586
|
if (n.push(o), r += o.length, o.length < a.length) {
|
|
4496
4587
|
i = !0;
|
|
4497
4588
|
break;
|
|
@@ -4505,7 +4596,7 @@ function Ua(e, t) {
|
|
|
4505
4596
|
textCharacters: r
|
|
4506
4597
|
};
|
|
4507
4598
|
}
|
|
4508
|
-
function
|
|
4599
|
+
function Xa(e, t, n, r, i, a, o, s) {
|
|
4509
4600
|
return {
|
|
4510
4601
|
format: "xlsx",
|
|
4511
4602
|
kind: "element",
|
|
@@ -4513,7 +4604,7 @@ function Wa(e, t, n, r, i, a, o, s) {
|
|
|
4513
4604
|
sheetName: e.name,
|
|
4514
4605
|
elementType: n,
|
|
4515
4606
|
elementIndex: r,
|
|
4516
|
-
anchor:
|
|
4607
|
+
anchor: qa(i),
|
|
4517
4608
|
...a === void 0 ? {} : { text: a },
|
|
4518
4609
|
truncated: o,
|
|
4519
4610
|
truncationReasons: o ? ["text"] : [],
|
|
@@ -4521,19 +4612,19 @@ function Wa(e, t, n, r, i, a, o, s) {
|
|
|
4521
4612
|
maxTextCharacters: s
|
|
4522
4613
|
};
|
|
4523
4614
|
}
|
|
4524
|
-
function
|
|
4615
|
+
function Za(e, t, n, r, i) {
|
|
4525
4616
|
for (let a = e.charts.length - 1; a >= 0; a--) {
|
|
4526
|
-
let o = e.charts[a], s =
|
|
4527
|
-
if (!s || !
|
|
4617
|
+
let o = e.charts[a], s = Va(o, r);
|
|
4618
|
+
if (!s || !Ua(s, r) || !Ha(n, s)) continue;
|
|
4528
4619
|
let c = we(o.chart, i);
|
|
4529
4620
|
return {
|
|
4530
|
-
...
|
|
4621
|
+
...Xa(e, t, "chart", a, o, c.text, c.truncated, c.maxTextCharacters),
|
|
4531
4622
|
seriesCount: o.chart.series.length
|
|
4532
4623
|
};
|
|
4533
4624
|
}
|
|
4534
4625
|
return null;
|
|
4535
4626
|
}
|
|
4536
|
-
function
|
|
4627
|
+
function Qa(e, t, n) {
|
|
4537
4628
|
let r = {
|
|
4538
4629
|
x: t.x + n.x * t.width,
|
|
4539
4630
|
y: t.y + n.y * t.height,
|
|
@@ -4545,21 +4636,21 @@ function Ka(e, t, n) {
|
|
|
4545
4636
|
y: u
|
|
4546
4637
|
};
|
|
4547
4638
|
}
|
|
4548
|
-
function
|
|
4639
|
+
function $a(e, t, n, r, i) {
|
|
4549
4640
|
let a = e.shapeGroups ?? [];
|
|
4550
4641
|
for (let o = a.length - 1; o >= 0; o--) {
|
|
4551
|
-
let s = a[o], c =
|
|
4552
|
-
if (!(!c || !
|
|
4642
|
+
let s = a[o], c = Va(s, r);
|
|
4643
|
+
if (!(!c || !Ua(c, r))) for (let r = s.shapes.length - 1; r >= 0; r--) {
|
|
4553
4644
|
let a = s.shapes[r];
|
|
4554
|
-
if (!
|
|
4645
|
+
if (!Ha(Qa(n, c, a), {
|
|
4555
4646
|
x: c.x + a.x * c.width,
|
|
4556
4647
|
y: c.y + a.y * c.height,
|
|
4557
4648
|
width: a.w * c.width,
|
|
4558
4649
|
height: a.h * c.height
|
|
4559
4650
|
})) continue;
|
|
4560
|
-
let l =
|
|
4651
|
+
let l = Ya(a, i);
|
|
4561
4652
|
return {
|
|
4562
|
-
...
|
|
4653
|
+
...Xa(e, t, "shape", o, s, l.text, l.truncated, i),
|
|
4563
4654
|
shapeIndex: r,
|
|
4564
4655
|
shapeCount: s.shapes.length,
|
|
4565
4656
|
...a.geom.type === "image" ? { mimeType: a.geom.mimeType } : {}
|
|
@@ -4568,26 +4659,26 @@ function qa(e, t, n, r, i) {
|
|
|
4568
4659
|
}
|
|
4569
4660
|
return null;
|
|
4570
4661
|
}
|
|
4571
|
-
function
|
|
4662
|
+
function eo(e, t, n, r, i) {
|
|
4572
4663
|
for (let a = e.images.length - 1; a >= 0; a--) {
|
|
4573
|
-
let o = e.images[a], s =
|
|
4574
|
-
if (!(!s || !
|
|
4575
|
-
...
|
|
4664
|
+
let o = e.images[a], s = Va(o, r);
|
|
4665
|
+
if (!(!s || !Ua(s, r) || !Ha(n, s))) return {
|
|
4666
|
+
...Xa(e, t, "image", a, o, void 0, !1, i),
|
|
4576
4667
|
mimeType: o.svgImagePath ? "image/svg+xml" : o.mimeType
|
|
4577
4668
|
};
|
|
4578
4669
|
}
|
|
4579
4670
|
return null;
|
|
4580
4671
|
}
|
|
4581
|
-
function
|
|
4672
|
+
function to(e, t, n, r, i = Me) {
|
|
4582
4673
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) throw RangeError("XLSX hit-test point must contain finite coordinates.");
|
|
4583
4674
|
if (!Number.isFinite(i) || i < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
4584
|
-
let a = Math.min(Me, Math.floor(i)), o =
|
|
4585
|
-
return
|
|
4675
|
+
let a = Math.min(Me, Math.floor(i)), o = Ga(e, r);
|
|
4676
|
+
return Wa(n, o) ? Za(e, t, n, o, a) ?? $a(e, t, n, o, a) ?? eo(e, t, n, o, a) : null;
|
|
4586
4677
|
}
|
|
4587
|
-
function
|
|
4678
|
+
function no(e, t) {
|
|
4588
4679
|
let n = t ?? e.maxTextCharacters;
|
|
4589
4680
|
if (!Number.isFinite(n) || n < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
4590
|
-
let r = Math.min(Me, Math.floor(n)), i = e.text === void 0 ? void 0 :
|
|
4681
|
+
let r = Math.min(Me, Math.floor(n)), i = e.text === void 0 ? void 0 : Ja(e.text, r), a = e.truncated || e.text !== void 0 && i.length < e.text.length;
|
|
4591
4682
|
return {
|
|
4592
4683
|
...structuredClone(e),
|
|
4593
4684
|
...i === void 0 ? {} : { text: i },
|
|
@@ -4599,17 +4690,17 @@ function Xa(e, t) {
|
|
|
4599
4690
|
}
|
|
4600
4691
|
//#endregion
|
|
4601
4692
|
//#region packages/xlsx/src/selection.ts
|
|
4602
|
-
var
|
|
4603
|
-
function
|
|
4693
|
+
var ro = 128, io = 1e4, ao = 8 * 1024 * 1024;
|
|
4694
|
+
function oo(e) {
|
|
4604
4695
|
return e.areas.reduce((e, t) => e + (t.kind === "cells" ? (t.bottom - t.top + 1) * (t.right - t.left + 1) : t.kind === "rows" ? (t.lastRow - t.firstRow + 1) * ar : t.kind === "columns" ? (t.lastColumn - t.firstColumn + 1) * ir : ir * ar), 0);
|
|
4605
4696
|
}
|
|
4606
|
-
function
|
|
4697
|
+
function so(e, t) {
|
|
4607
4698
|
return Number.isInteger(e) && e >= 1 && e <= t;
|
|
4608
4699
|
}
|
|
4609
|
-
function
|
|
4700
|
+
function co(e) {
|
|
4610
4701
|
switch (e.kind) {
|
|
4611
4702
|
case "cells":
|
|
4612
|
-
if (!
|
|
4703
|
+
if (!so(e.top, 1048576) || !so(e.bottom, 1048576) || !so(e.left, 16384) || !so(e.right, 16384)) throw RangeError("Cell selection bounds must be inside the XLSX grid.");
|
|
4613
4704
|
return {
|
|
4614
4705
|
kind: "cells",
|
|
4615
4706
|
top: Math.min(e.top, e.bottom),
|
|
@@ -4618,14 +4709,14 @@ function no(e) {
|
|
|
4618
4709
|
right: Math.max(e.left, e.right)
|
|
4619
4710
|
};
|
|
4620
4711
|
case "rows":
|
|
4621
|
-
if (!
|
|
4712
|
+
if (!so(e.firstRow, 1048576) || !so(e.lastRow, 1048576)) throw RangeError("Row selection bounds must be inside the XLSX grid.");
|
|
4622
4713
|
return {
|
|
4623
4714
|
kind: "rows",
|
|
4624
4715
|
firstRow: Math.min(e.firstRow, e.lastRow),
|
|
4625
4716
|
lastRow: Math.max(e.firstRow, e.lastRow)
|
|
4626
4717
|
};
|
|
4627
4718
|
case "columns":
|
|
4628
|
-
if (!
|
|
4719
|
+
if (!so(e.firstColumn, 16384) || !so(e.lastColumn, 16384)) throw RangeError("Column selection bounds must be inside the XLSX grid.");
|
|
4629
4720
|
return {
|
|
4630
4721
|
kind: "columns",
|
|
4631
4722
|
firstColumn: Math.min(e.firstColumn, e.lastColumn),
|
|
@@ -4634,7 +4725,7 @@ function no(e) {
|
|
|
4634
4725
|
case "sheet": return { kind: "sheet" };
|
|
4635
4726
|
}
|
|
4636
4727
|
}
|
|
4637
|
-
function
|
|
4728
|
+
function lo(e, t) {
|
|
4638
4729
|
switch (e.kind) {
|
|
4639
4730
|
case "cells": return t.row >= e.top && t.row <= e.bottom && t.col >= e.left && t.col <= e.right;
|
|
4640
4731
|
case "rows": return t.row >= e.firstRow && t.row <= e.lastRow;
|
|
@@ -4642,37 +4733,42 @@ function ro(e, t) {
|
|
|
4642
4733
|
case "sheet": return !0;
|
|
4643
4734
|
}
|
|
4644
4735
|
}
|
|
4645
|
-
function
|
|
4646
|
-
if (!
|
|
4736
|
+
function uo(e, t) {
|
|
4737
|
+
if (!so(e.row, 1048576) || !so(e.col, 16384)) throw RangeError(`${t} must be inside the XLSX grid.`);
|
|
4647
4738
|
return {
|
|
4648
4739
|
row: e.row,
|
|
4649
4740
|
col: e.col
|
|
4650
4741
|
};
|
|
4651
4742
|
}
|
|
4652
|
-
function
|
|
4743
|
+
function fo(e) {
|
|
4653
4744
|
if (!Array.isArray(e.areas) || e.areas.length === 0) throw TypeError("A selection must contain at least one area.");
|
|
4654
4745
|
if (e.areas.length > 128) throw RangeError("A selection may contain at most 128 areas.");
|
|
4655
4746
|
if (!Number.isInteger(e.activeAreaIndex) || e.activeAreaIndex < 0 || e.activeAreaIndex >= e.areas.length) throw RangeError("activeAreaIndex must identify an area in the selection.");
|
|
4656
|
-
let t = e.areas.map(
|
|
4657
|
-
|
|
4658
|
-
|
|
4747
|
+
let t = e.areas.map(co), n = [], r = /* @__PURE__ */ new Map(), i = 0;
|
|
4748
|
+
for (let a = 0; a < t.length; a++) {
|
|
4749
|
+
let o = t[a], s = o.kind === "cells" ? `c:${o.top}:${o.left}:${o.bottom}:${o.right}` : o.kind === "rows" ? `r:${o.firstRow}:${o.lastRow}` : o.kind === "columns" ? `k:${o.firstColumn}:${o.lastColumn}` : "s", c = r.get(s);
|
|
4750
|
+
c === void 0 && (c = n.length, r.set(s, c), n.push(o)), a === e.activeAreaIndex && (i = c);
|
|
4751
|
+
}
|
|
4752
|
+
let a = uo(e.activeCell, "activeCell"), o = uo(e.extensionAnchor, "extensionAnchor"), s = n[i];
|
|
4753
|
+
if (!lo(s, a)) throw RangeError("activeCell must be inside the active selection area.");
|
|
4754
|
+
if (!lo(s, o)) throw RangeError("extensionAnchor must be inside the active selection area.");
|
|
4659
4755
|
return {
|
|
4660
|
-
areas:
|
|
4661
|
-
activeAreaIndex:
|
|
4662
|
-
activeCell:
|
|
4663
|
-
extensionAnchor:
|
|
4756
|
+
areas: n,
|
|
4757
|
+
activeAreaIndex: i,
|
|
4758
|
+
activeCell: a,
|
|
4759
|
+
extensionAnchor: o
|
|
4664
4760
|
};
|
|
4665
4761
|
}
|
|
4666
|
-
function
|
|
4762
|
+
function po(e) {
|
|
4667
4763
|
let t = 0;
|
|
4668
4764
|
for (let n of e) t = t * 26 + n.charCodeAt(0) - 64;
|
|
4669
4765
|
return t >= 1 && t <= 16384 ? t : null;
|
|
4670
4766
|
}
|
|
4671
|
-
function
|
|
4767
|
+
function mo(e) {
|
|
4672
4768
|
let t = e.trim().toUpperCase(), n = /^\$?(\d+):\$?(\d+)$/.exec(t);
|
|
4673
4769
|
if (n) {
|
|
4674
4770
|
let e = Number(n[1]), t = Number(n[2]);
|
|
4675
|
-
if (!
|
|
4771
|
+
if (!so(e, 1048576) || !so(t, 1048576)) return null;
|
|
4676
4772
|
let r = Math.min(e, t);
|
|
4677
4773
|
return {
|
|
4678
4774
|
areas: [{
|
|
@@ -4693,7 +4789,7 @@ function so(e) {
|
|
|
4693
4789
|
}
|
|
4694
4790
|
let r = /^\$?([A-Z]+):\$?([A-Z]+)$/.exec(t);
|
|
4695
4791
|
if (r) {
|
|
4696
|
-
let e =
|
|
4792
|
+
let e = po(r[1]), t = po(r[2]);
|
|
4697
4793
|
if (e === null || t === null) return null;
|
|
4698
4794
|
let n = Math.min(e, t);
|
|
4699
4795
|
return {
|
|
@@ -4734,12 +4830,12 @@ function so(e) {
|
|
|
4734
4830
|
extensionAnchor: c
|
|
4735
4831
|
};
|
|
4736
4832
|
}
|
|
4737
|
-
function
|
|
4833
|
+
function ho(e, t) {
|
|
4738
4834
|
return e === t ? !0 : !e || !t || e.activeAreaIndex !== t.activeAreaIndex || e.areas.length !== t.areas.length || e.activeCell.row !== t.activeCell.row || e.activeCell.col !== t.activeCell.col || e.extensionAnchor.row !== t.extensionAnchor.row || e.extensionAnchor.col !== t.extensionAnchor.col ? !1 : e.areas.every((e, n) => JSON.stringify(e) === JSON.stringify(t.areas[n]));
|
|
4739
4835
|
}
|
|
4740
4836
|
//#endregion
|
|
4741
4837
|
//#region packages/xlsx/src/find.ts
|
|
4742
|
-
var
|
|
4838
|
+
var go = class {
|
|
4743
4839
|
_matches = [];
|
|
4744
4840
|
_active = -1;
|
|
4745
4841
|
_generation = 0;
|
|
@@ -4829,7 +4925,7 @@ var lo = class {
|
|
|
4829
4925
|
} : null;
|
|
4830
4926
|
}
|
|
4831
4927
|
};
|
|
4832
|
-
function
|
|
4928
|
+
function _o(e) {
|
|
4833
4929
|
let { cell: t, popup: n, viewport: r, rtl: i } = e, a = t.x + t.w + 8, o = t.x - 8 - n.w, s = a + n.w <= r.w, c = o >= 0, l;
|
|
4834
4930
|
l = i ? c ? o : s ? a : o : s ? a : c ? o : a, l = Math.max(0, Math.min(l, r.w - n.w));
|
|
4835
4931
|
let u = t.y;
|
|
@@ -4838,10 +4934,64 @@ function uo(e) {
|
|
|
4838
4934
|
top: u
|
|
4839
4935
|
};
|
|
4840
4936
|
}
|
|
4841
|
-
function
|
|
4937
|
+
function vo(e) {
|
|
4938
|
+
return 8 + (e - 1) * 14;
|
|
4939
|
+
}
|
|
4940
|
+
function yo(e) {
|
|
4842
4941
|
return e > 0 ? (e + 1) * 19 : 0;
|
|
4843
4942
|
}
|
|
4844
|
-
function
|
|
4943
|
+
function bo(e, t, n, r, i, a, o, s, c = !1) {
|
|
4944
|
+
if (e === "row") {
|
|
4945
|
+
let e = Math.min(s, i + a), c = Math.min(s, i), l = s;
|
|
4946
|
+
return r > 0 && n <= r ? l = e : r > 0 && t > r && (c = e), {
|
|
4947
|
+
x: 0,
|
|
4948
|
+
y: c,
|
|
4949
|
+
w: o,
|
|
4950
|
+
h: Math.max(0, l - c)
|
|
4951
|
+
};
|
|
4952
|
+
}
|
|
4953
|
+
if (!c) {
|
|
4954
|
+
let e = Math.min(o, i + a), c = Math.min(o, i), l = o;
|
|
4955
|
+
return r > 0 && n <= r ? l = e : r > 0 && t > r && (c = e), {
|
|
4956
|
+
x: c,
|
|
4957
|
+
y: 0,
|
|
4958
|
+
w: Math.max(0, l - c),
|
|
4959
|
+
h: s
|
|
4960
|
+
};
|
|
4961
|
+
}
|
|
4962
|
+
let l = Math.max(0, o - i), u = Math.max(0, l - a), d = 0, f = l;
|
|
4963
|
+
return r > 0 && n <= r ? d = u : r > 0 && t > r && (f = u), {
|
|
4964
|
+
x: d,
|
|
4965
|
+
y: 0,
|
|
4966
|
+
w: Math.max(0, f - d),
|
|
4967
|
+
h: s
|
|
4968
|
+
};
|
|
4969
|
+
}
|
|
4970
|
+
function xo(e, t, n, r, i) {
|
|
4971
|
+
let a = Math.min(n, r), o = Math.max(n, r);
|
|
4972
|
+
return e === "row" ? [{
|
|
4973
|
+
x1: t,
|
|
4974
|
+
y1: a,
|
|
4975
|
+
x2: t,
|
|
4976
|
+
y2: o
|
|
4977
|
+
}, {
|
|
4978
|
+
x1: t,
|
|
4979
|
+
y1: n,
|
|
4980
|
+
x2: t + i / 2,
|
|
4981
|
+
y2: n
|
|
4982
|
+
}] : [{
|
|
4983
|
+
x1: a,
|
|
4984
|
+
y1: t,
|
|
4985
|
+
x2: o,
|
|
4986
|
+
y2: t
|
|
4987
|
+
}, {
|
|
4988
|
+
x1: n,
|
|
4989
|
+
y1: t,
|
|
4990
|
+
x2: n,
|
|
4991
|
+
y2: t + i / 2
|
|
4992
|
+
}];
|
|
4993
|
+
}
|
|
4994
|
+
function So(e, t) {
|
|
4845
4995
|
let n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = 0, a = 0;
|
|
4846
4996
|
for (let t of e) t.level > 0 && n.set(t.index, t.level), t.collapsed && r.set(t.index, !0), t.index > i && (i = t.index), t.level > a && (a = t.level);
|
|
4847
4997
|
let o = i, s = [];
|
|
@@ -4855,15 +5005,15 @@ function po(e, t) {
|
|
|
4855
5005
|
for (let i = 1; i <= o + 1; i++) c(i) >= e ? n ? n.end = i : n = {
|
|
4856
5006
|
start: i,
|
|
4857
5007
|
end: i
|
|
4858
|
-
} : n &&= (s.push(
|
|
4859
|
-
n && s.push(
|
|
5008
|
+
} : n &&= (s.push(Co(e, n, t, r, c)), null);
|
|
5009
|
+
n && s.push(Co(e, n, t, r, c));
|
|
4860
5010
|
}
|
|
4861
5011
|
return {
|
|
4862
5012
|
maxLevel: a,
|
|
4863
5013
|
groups: s
|
|
4864
5014
|
};
|
|
4865
5015
|
}
|
|
4866
|
-
function
|
|
5016
|
+
function Co(e, t, n, r, i) {
|
|
4867
5017
|
let a = null;
|
|
4868
5018
|
if (n) {
|
|
4869
5019
|
let n = t.end + 1;
|
|
@@ -4881,7 +5031,7 @@ function mo(e, t, n, r, i) {
|
|
|
4881
5031
|
collapsed: o
|
|
4882
5032
|
};
|
|
4883
5033
|
}
|
|
4884
|
-
function
|
|
5034
|
+
function wo(e, t) {
|
|
4885
5035
|
let n = !e.collapsed, r = /* @__PURE__ */ new Map();
|
|
4886
5036
|
for (let e of t) r.set(e.index, e);
|
|
4887
5037
|
let i = [], a = [];
|
|
@@ -4889,7 +5039,7 @@ function ho(e, t) {
|
|
|
4889
5039
|
else {
|
|
4890
5040
|
let n = /* @__PURE__ */ new Set();
|
|
4891
5041
|
for (let r of t) r.index >= e.start && r.index <= e.end && r.collapsed && n.add(r.index);
|
|
4892
|
-
for (let t = e.start; t <= e.end; t++)
|
|
5042
|
+
for (let t = e.start; t <= e.end; t++) To(t, e, r, n) || a.push(t);
|
|
4893
5043
|
}
|
|
4894
5044
|
return {
|
|
4895
5045
|
hide: i,
|
|
@@ -4897,7 +5047,7 @@ function ho(e, t) {
|
|
|
4897
5047
|
nowCollapsed: n
|
|
4898
5048
|
};
|
|
4899
5049
|
}
|
|
4900
|
-
function
|
|
5050
|
+
function To(e, t, n, r) {
|
|
4901
5051
|
let i = n.get(e)?.level ?? 0;
|
|
4902
5052
|
if (i <= t.level) return !1;
|
|
4903
5053
|
for (let e of r) {
|
|
@@ -4906,7 +5056,7 @@ function go(e, t, n, r) {
|
|
|
4906
5056
|
}
|
|
4907
5057
|
return !1;
|
|
4908
5058
|
}
|
|
4909
|
-
function
|
|
5059
|
+
function Eo(e, t) {
|
|
4910
5060
|
let n = [], r = [];
|
|
4911
5061
|
for (let i of e) i.level >= t ? n.push(i.index) : r.push(i.index);
|
|
4912
5062
|
return {
|
|
@@ -4914,7 +5064,7 @@ function _o(e, t) {
|
|
|
4914
5064
|
show: r
|
|
4915
5065
|
};
|
|
4916
5066
|
}
|
|
4917
|
-
function
|
|
5067
|
+
function Do(e) {
|
|
4918
5068
|
let t = [];
|
|
4919
5069
|
for (let n of e.rows) {
|
|
4920
5070
|
let e = n.outlineLevel ?? 0, r = n.collapsed ?? !1;
|
|
@@ -4927,7 +5077,7 @@ function vo(e) {
|
|
|
4927
5077
|
}
|
|
4928
5078
|
return t;
|
|
4929
5079
|
}
|
|
4930
|
-
function
|
|
5080
|
+
function Oo(e) {
|
|
4931
5081
|
let t = e.colOutlineLevels ?? {}, n = e.colCollapsed ?? {}, r = e.colHidden ?? {}, i = /* @__PURE__ */ new Set();
|
|
4932
5082
|
for (let e of Object.keys(t)) i.add(Number(e));
|
|
4933
5083
|
for (let e of Object.keys(n)) i.add(Number(e));
|
|
@@ -4940,13 +5090,13 @@ function yo(e) {
|
|
|
4940
5090
|
});
|
|
4941
5091
|
return a;
|
|
4942
5092
|
}
|
|
4943
|
-
function
|
|
5093
|
+
function ko(e, t) {
|
|
4944
5094
|
let n = e.outlinePr;
|
|
4945
5095
|
return n ? t === "row" ? n.summaryBelow : n.summaryRight : !0;
|
|
4946
5096
|
}
|
|
4947
5097
|
//#endregion
|
|
4948
5098
|
//#region packages/xlsx/src/internal/sheet-viewer-runtime.ts
|
|
4949
|
-
var
|
|
5099
|
+
var Ao = class {
|
|
4950
5100
|
owner = new Se("SheetAcquisition");
|
|
4951
5101
|
get current() {
|
|
4952
5102
|
return this.owner.current;
|
|
@@ -4961,7 +5111,7 @@ var xo = class {
|
|
|
4961
5111
|
this.owner.close();
|
|
4962
5112
|
}
|
|
4963
5113
|
};
|
|
4964
|
-
function
|
|
5114
|
+
function jo(e) {
|
|
4965
5115
|
return {
|
|
4966
5116
|
...e,
|
|
4967
5117
|
rows: e.rows.map((e) => ({ ...e })),
|
|
@@ -4970,7 +5120,7 @@ function So(e) {
|
|
|
4970
5120
|
colCollapsed: e.colCollapsed ? { ...e.colCollapsed } : void 0
|
|
4971
5121
|
};
|
|
4972
5122
|
}
|
|
4973
|
-
var
|
|
5123
|
+
var Mo = class {
|
|
4974
5124
|
offsetX = 0;
|
|
4975
5125
|
offsetY = 0;
|
|
4976
5126
|
contentWidth = 0;
|
|
@@ -5016,7 +5166,7 @@ var Co = class {
|
|
|
5016
5166
|
reset() {
|
|
5017
5167
|
this.offsetX = 0, this.offsetY = 0;
|
|
5018
5168
|
}
|
|
5019
|
-
},
|
|
5169
|
+
}, No = class {
|
|
5020
5170
|
animationFrame = null;
|
|
5021
5171
|
activeRender = !1;
|
|
5022
5172
|
pendingRender = null;
|
|
@@ -5081,7 +5231,7 @@ var Co = class {
|
|
|
5081
5231
|
destroy() {
|
|
5082
5232
|
this.destroyed || (this.destroyed = !0, this.pendingRender = null, this.animationFrame !== null && this.frameScheduler && (this.frameScheduler.cancelAnimationFrame(this.animationFrame), this.animationFrame = null), this.staticDispatcher?.destroy(), this.generation++);
|
|
5083
5233
|
}
|
|
5084
|
-
},
|
|
5234
|
+
}, Po = class {
|
|
5085
5235
|
state = null;
|
|
5086
5236
|
dragPointerId = null;
|
|
5087
5237
|
get anchor() {
|
|
@@ -5113,10 +5263,10 @@ var Co = class {
|
|
|
5113
5263
|
this.state = null, this.dragPointerId = null;
|
|
5114
5264
|
}
|
|
5115
5265
|
setState(e) {
|
|
5116
|
-
this.state = e ?
|
|
5266
|
+
this.state = e ? fo(e) : null;
|
|
5117
5267
|
}
|
|
5118
5268
|
select(e, t = "cells") {
|
|
5119
|
-
this.state =
|
|
5269
|
+
this.state = fo({
|
|
5120
5270
|
areas: [t === "rows" ? {
|
|
5121
5271
|
kind: "rows",
|
|
5122
5272
|
firstRow: e.row,
|
|
@@ -5137,6 +5287,38 @@ var Co = class {
|
|
|
5137
5287
|
extensionAnchor: e
|
|
5138
5288
|
});
|
|
5139
5289
|
}
|
|
5290
|
+
add(e, t = "cells") {
|
|
5291
|
+
if (!this.state) return this.select(e, t), !0;
|
|
5292
|
+
let n = this.state.areas.findIndex((n) => (t === "rows" ? n.kind === "rows" : t === "cols" ? n.kind === "columns" : t === "all" ? n.kind === "sheet" : n.kind === "cells") && lo(n, e));
|
|
5293
|
+
if (n >= 0) return this.state = fo({
|
|
5294
|
+
...this.state,
|
|
5295
|
+
activeAreaIndex: n,
|
|
5296
|
+
activeCell: e,
|
|
5297
|
+
extensionAnchor: e
|
|
5298
|
+
}), !1;
|
|
5299
|
+
if (this.state.areas.length >= 128) return !1;
|
|
5300
|
+
let r = t === "rows" ? {
|
|
5301
|
+
kind: "rows",
|
|
5302
|
+
firstRow: e.row,
|
|
5303
|
+
lastRow: e.row
|
|
5304
|
+
} : t === "cols" ? {
|
|
5305
|
+
kind: "columns",
|
|
5306
|
+
firstColumn: e.col,
|
|
5307
|
+
lastColumn: e.col
|
|
5308
|
+
} : t === "all" ? { kind: "sheet" } : {
|
|
5309
|
+
kind: "cells",
|
|
5310
|
+
top: e.row,
|
|
5311
|
+
left: e.col,
|
|
5312
|
+
bottom: e.row,
|
|
5313
|
+
right: e.col
|
|
5314
|
+
}, i = [...this.state.areas, r];
|
|
5315
|
+
return this.state = fo({
|
|
5316
|
+
areas: i,
|
|
5317
|
+
activeAreaIndex: i.length - 1,
|
|
5318
|
+
activeCell: e,
|
|
5319
|
+
extensionAnchor: e
|
|
5320
|
+
}), !0;
|
|
5321
|
+
}
|
|
5140
5322
|
extend(e) {
|
|
5141
5323
|
if (!this.state) {
|
|
5142
5324
|
this.select(e);
|
|
@@ -5159,18 +5341,9 @@ var Co = class {
|
|
|
5159
5341
|
bottom: Math.max(t.row, e.row),
|
|
5160
5342
|
right: Math.max(t.col, e.col)
|
|
5161
5343
|
}, i = [...this.state.areas];
|
|
5162
|
-
i[this.state.activeAreaIndex] = r
|
|
5163
|
-
let a = n.kind === "rows" ? {
|
|
5164
|
-
row: e.row,
|
|
5165
|
-
col: this.state.activeCell.col
|
|
5166
|
-
} : n.kind === "columns" ? {
|
|
5167
|
-
row: this.state.activeCell.row,
|
|
5168
|
-
col: e.col
|
|
5169
|
-
} : n.kind === "sheet" ? this.state.activeCell : e;
|
|
5170
|
-
this.state = ao({
|
|
5344
|
+
i[this.state.activeAreaIndex] = r, this.state = fo({
|
|
5171
5345
|
...this.state,
|
|
5172
|
-
areas: i
|
|
5173
|
-
activeCell: a
|
|
5346
|
+
areas: i
|
|
5174
5347
|
});
|
|
5175
5348
|
}
|
|
5176
5349
|
snapshot() {
|
|
@@ -5234,7 +5407,7 @@ var Co = class {
|
|
|
5234
5407
|
};
|
|
5235
5408
|
}
|
|
5236
5409
|
}
|
|
5237
|
-
},
|
|
5410
|
+
}, Fo = class {
|
|
5238
5411
|
cleanups = [];
|
|
5239
5412
|
ownerDocument;
|
|
5240
5413
|
ownerWindow;
|
|
@@ -5269,7 +5442,7 @@ var Co = class {
|
|
|
5269
5442
|
destroy() {
|
|
5270
5443
|
for (let e of this.cleanups.splice(0)) e();
|
|
5271
5444
|
}
|
|
5272
|
-
},
|
|
5445
|
+
}, Io = class {
|
|
5273
5446
|
selection;
|
|
5274
5447
|
find;
|
|
5275
5448
|
comment;
|
|
@@ -5303,17 +5476,17 @@ var Co = class {
|
|
|
5303
5476
|
this.validation.style.left = `${e}px`, this.validation.style.top = `${t}px`, this.validation.style.display = "block";
|
|
5304
5477
|
}
|
|
5305
5478
|
};
|
|
5306
|
-
function
|
|
5479
|
+
function Lo(e, t) {
|
|
5307
5480
|
if (t <= 0) return 0;
|
|
5308
5481
|
let n = Math.min(40, t / 2);
|
|
5309
5482
|
return e < n ? -900 * Math.min(1, Math.max(0, (n - e) / n)) : e > t - n ? 900 * Math.min(1, Math.max(0, (e - (t - n)) / n)) : 0;
|
|
5310
5483
|
}
|
|
5311
|
-
function
|
|
5484
|
+
function Ro(e, t, n, r) {
|
|
5312
5485
|
if (r === "all") return {
|
|
5313
5486
|
x: 0,
|
|
5314
5487
|
y: 0
|
|
5315
5488
|
};
|
|
5316
|
-
let i = r === "rows" ? 0 :
|
|
5489
|
+
let i = r === "rows" ? 0 : Lo(e.x, t.width), a = r === "cols" ? 0 : Lo(e.y, t.height);
|
|
5317
5490
|
return {
|
|
5318
5491
|
x: n ? -i : i,
|
|
5319
5492
|
y: a
|
|
@@ -5321,13 +5494,13 @@ function ko(e, t, n, r) {
|
|
|
5321
5494
|
}
|
|
5322
5495
|
//#endregion
|
|
5323
5496
|
//#region packages/xlsx/src/viewer.ts
|
|
5324
|
-
var
|
|
5325
|
-
function
|
|
5326
|
-
if (!e.head || e.head.querySelector(`style[${
|
|
5497
|
+
var zo = Symbol("XlsxViewer.borrowedWorkbook"), Bo = 150, Vo = 280, Ho = 200, Uo = 240, Wo = 200, Go = 30, Ko = 50, qo = 1, Jo = 1, Yo = .45, Xo = "data-xlsx-viewer-styles", Zo = ".xlsx-tab-strip::-webkit-scrollbar{display:none}[data-xlsx-viewport-input]:focus{outline:none}.xlsx-tab-nav{background:transparent;transition:background 0.1s;}.xlsx-tab-nav:hover{background:rgba(0,0,0,0.08);}.xlsx-zoom-slider{-webkit-appearance:none;appearance:none;background:transparent;height:15px;margin:0;}.xlsx-zoom-slider::-webkit-slider-runnable-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;margin-top:-4px;border-radius:50%;background:#808080;cursor:pointer;}.xlsx-zoom-slider:hover::-webkit-slider-thumb{background:#5f5f5f;}.xlsx-zoom-slider::-moz-range-track{height:4px;background:#c4c4c4;border-radius:2px;}.xlsx-zoom-slider::-moz-range-thumb{width:12px;height:12px;border:none;border-radius:50%;background:#808080;cursor:pointer;}";
|
|
5498
|
+
function Qo(e) {
|
|
5499
|
+
if (!e.head || e.head.querySelector(`style[${Xo}]`)) return;
|
|
5327
5500
|
let t = e.createElement("style");
|
|
5328
|
-
t.setAttribute(
|
|
5501
|
+
t.setAttribute(Xo, ""), t.textContent = Zo, e.head.appendChild(t);
|
|
5329
5502
|
}
|
|
5330
|
-
function
|
|
5503
|
+
function $o(e) {
|
|
5331
5504
|
let t = [...e].sort((e, t) => e.first - t.first || e.last - t.last), n = [];
|
|
5332
5505
|
for (let e of t) {
|
|
5333
5506
|
let t = n.at(-1);
|
|
@@ -5338,7 +5511,7 @@ function Wo(e) {
|
|
|
5338
5511
|
}
|
|
5339
5512
|
return n;
|
|
5340
5513
|
}
|
|
5341
|
-
function
|
|
5514
|
+
function es(e, t) {
|
|
5342
5515
|
let n = 0, r = e.length - 1;
|
|
5343
5516
|
for (; n <= r;) {
|
|
5344
5517
|
let i = n + r >>> 1, a = e[i];
|
|
@@ -5348,7 +5521,7 @@ function Go(e, t) {
|
|
|
5348
5521
|
}
|
|
5349
5522
|
return !1;
|
|
5350
5523
|
}
|
|
5351
|
-
function
|
|
5524
|
+
function ts(e, t, n) {
|
|
5352
5525
|
let r = 0, i = e.length;
|
|
5353
5526
|
for (; r < i;) {
|
|
5354
5527
|
let a = r + i >>> 1;
|
|
@@ -5356,12 +5529,12 @@ function Ko(e, t, n) {
|
|
|
5356
5529
|
}
|
|
5357
5530
|
return r;
|
|
5358
5531
|
}
|
|
5359
|
-
function
|
|
5532
|
+
function ns(e, t) {
|
|
5360
5533
|
for (let n = 1; n < e.length; n++) if (t(e[n - 1]) > t(e[n])) return [...e].sort((e, n) => t(e) - t(n));
|
|
5361
5534
|
return e;
|
|
5362
5535
|
}
|
|
5363
|
-
var
|
|
5364
|
-
function
|
|
5536
|
+
var rs = "#1a73e8", is = 4, as = 5, os = 25e4, ss = 8 * 1024 * 1024, cs = 1 * 1024 * 1024, ls = 65536, us = 65536, ds = 100;
|
|
5537
|
+
function fs(e, t) {
|
|
5365
5538
|
let n = Math.min(e.length, Math.max(0, t));
|
|
5366
5539
|
if (n > 0 && n < e.length) {
|
|
5367
5540
|
let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
|
|
@@ -5369,7 +5542,7 @@ function rs(e, t) {
|
|
|
5369
5542
|
}
|
|
5370
5543
|
return e.slice(0, n);
|
|
5371
5544
|
}
|
|
5372
|
-
function
|
|
5545
|
+
function ps(e, t) {
|
|
5373
5546
|
let n = 0, r = !1;
|
|
5374
5547
|
for (let t = 0; t < e.length; t++) {
|
|
5375
5548
|
let i = e.charCodeAt(t);
|
|
@@ -5377,28 +5550,74 @@ function is(e, t) {
|
|
|
5377
5550
|
}
|
|
5378
5551
|
return e.length + (r ? n + 2 : 0) > t ? null : r ? `"${e.replace(/"/g, "\"\"")}"` : e;
|
|
5379
5552
|
}
|
|
5380
|
-
function
|
|
5553
|
+
function ms(e, t, n, r) {
|
|
5381
5554
|
for (let { index: i, edge: a } of t) if (!(a <= r) && Math.abs(e - a) <= n) return i;
|
|
5382
5555
|
return null;
|
|
5383
5556
|
}
|
|
5384
|
-
function
|
|
5557
|
+
function hs(e) {
|
|
5385
5558
|
return {
|
|
5386
5559
|
border: `2px solid ${e}`,
|
|
5387
5560
|
background: `color-mix(in srgb, ${e} 8%, transparent)`
|
|
5388
5561
|
};
|
|
5389
5562
|
}
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
let n
|
|
5563
|
+
function gs(e) {
|
|
5564
|
+
let t = [];
|
|
5565
|
+
for (let n of e) {
|
|
5566
|
+
let e = n.x + n.width, r = n.y + n.height;
|
|
5567
|
+
n.top && t.push({
|
|
5568
|
+
axis: "h",
|
|
5569
|
+
fixed: n.y,
|
|
5570
|
+
start: n.x,
|
|
5571
|
+
end: e
|
|
5572
|
+
}), n.right && t.push({
|
|
5573
|
+
axis: "v",
|
|
5574
|
+
fixed: e,
|
|
5575
|
+
start: n.y,
|
|
5576
|
+
end: r
|
|
5577
|
+
}), n.bottom && t.push({
|
|
5578
|
+
axis: "h",
|
|
5579
|
+
fixed: r,
|
|
5580
|
+
start: n.x,
|
|
5581
|
+
end: e
|
|
5582
|
+
}), n.left && t.push({
|
|
5583
|
+
axis: "v",
|
|
5584
|
+
fixed: n.x,
|
|
5585
|
+
start: n.y,
|
|
5586
|
+
end: r
|
|
5587
|
+
});
|
|
5588
|
+
}
|
|
5589
|
+
let n = /* @__PURE__ */ new Map();
|
|
5590
|
+
for (let e of t) {
|
|
5591
|
+
let t = `${e.axis}:${e.fixed}`, r = n.get(t);
|
|
5592
|
+
r ? r.push(e) : n.set(t, [e]);
|
|
5593
|
+
}
|
|
5594
|
+
let r = [];
|
|
5595
|
+
for (let e of n.values()) {
|
|
5596
|
+
let t = [...new Set(e.flatMap(({ start: e, end: t }) => [e, t]))].sort((e, t) => e - t), n = null, i = 0, a = () => {
|
|
5597
|
+
if (n === null || i <= n) return;
|
|
5598
|
+
let { axis: t, fixed: a } = e[0];
|
|
5599
|
+
r.push(t === "h" ? `M${n} ${a}H${i}` : `M${a} ${n}V${i}`), n = null;
|
|
5600
|
+
};
|
|
5601
|
+
for (let r = 0; r + 1 < t.length; r++) {
|
|
5602
|
+
let o = t[r], s = t[r + 1], c = e.some((e) => e.start < s && e.end > o);
|
|
5603
|
+
c && n !== null && o === i ? i = s : (a(), c && (n = o, i = s));
|
|
5604
|
+
}
|
|
5605
|
+
a();
|
|
5606
|
+
}
|
|
5607
|
+
return r.join("");
|
|
5608
|
+
}
|
|
5609
|
+
var _s = 0, vs = "color-mix(in srgb, #ffb300 8%, transparent)", ys = "color-mix(in srgb, #fb8c00 8%, transparent)";
|
|
5610
|
+
function bs(e, t = {}) {
|
|
5611
|
+
let n = e ? "#fb8c00" : "#ffb300", r = e ? t.active : t.match, i = r ?? (e ? ys : vs);
|
|
5393
5612
|
return {
|
|
5394
5613
|
border: `2px solid ${r ?? n}`,
|
|
5395
5614
|
background: i
|
|
5396
5615
|
};
|
|
5397
5616
|
}
|
|
5398
|
-
var
|
|
5617
|
+
var xs = class {
|
|
5399
5618
|
hostDocument;
|
|
5400
5619
|
hostWindow;
|
|
5401
|
-
acquisition = new
|
|
5620
|
+
acquisition = new Ao();
|
|
5402
5621
|
viewport;
|
|
5403
5622
|
renderDispatcher;
|
|
5404
5623
|
wrapper;
|
|
@@ -5418,7 +5637,7 @@ var us = class {
|
|
|
5418
5637
|
stashedRowHeights = /* @__PURE__ */ new Map();
|
|
5419
5638
|
stashedColWidths = /* @__PURE__ */ new Map();
|
|
5420
5639
|
sizeOverrideStore = /* @__PURE__ */ new Map();
|
|
5421
|
-
projectionId =
|
|
5640
|
+
projectionId = Jo++;
|
|
5422
5641
|
canvasArea;
|
|
5423
5642
|
scrollHost;
|
|
5424
5643
|
spacer;
|
|
@@ -5468,7 +5687,7 @@ var us = class {
|
|
|
5468
5687
|
this.pendingTap?.pointerId !== e && (this.pendingTap = null), this.pendingClick?.pointerId !== e && (this.pendingClick = null), this.selectionController.beginDrag(e);
|
|
5469
5688
|
}
|
|
5470
5689
|
_pendingZoomAnchor = null;
|
|
5471
|
-
selectionController = new
|
|
5690
|
+
selectionController = new Po();
|
|
5472
5691
|
lastNotifiedSelectionState = null;
|
|
5473
5692
|
emittingSelectionChange = !1;
|
|
5474
5693
|
pendingSelectionChange = !1;
|
|
@@ -5505,18 +5724,18 @@ var us = class {
|
|
|
5505
5724
|
let r = this.hostDocument.defaultView;
|
|
5506
5725
|
if (!r) throw Error("XlsxViewer requires a document with an active Window");
|
|
5507
5726
|
this.hostWindow = r, this.opts = t, this._mountKind = n.kind, this._nativeScrollbars = t.showScrollbars ?? !0;
|
|
5508
|
-
let i = t[
|
|
5509
|
-
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : Oe("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new
|
|
5727
|
+
let i = t[zo];
|
|
5728
|
+
this._borrowed = i !== void 0, this._mode = n.kind === "sheet" ? n.mode : Oe("XlsxViewer", t.mode, i), this._hiddenSheetMode = t.hiddenSheetMode ?? "show", this.viewport = new Mo(t.cellScale ?? 1), this.wrapper = this.hostDocument.createElement("div"), this.wrapper.style.cssText = `position:relative;width:100%;height:100%;background:${n.kind === "composite" ? "#fff" : "transparent"};box-sizing:border-box;font-family:sans-serif;display:flex;flex-direction:column;`, this.gridRegion = this.hostDocument.createElement("div"), this.gridRegion.style.cssText = "position:relative;flex:1;min-height:0;overflow:hidden;";
|
|
5510
5729
|
let a = "position:absolute;top:0;left:0;z-index:3;display:none;background:#f5f5f5;";
|
|
5511
|
-
if (this.cornerGutter = this.hostDocument.createElement("canvas"), this.cornerGutter.style.cssText = a, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = this.hostDocument.createElement("canvas"), this.colGutter.style.cssText = a, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = this.hostDocument.createElement("canvas"), this.rowGutter.style.cssText = a, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new
|
|
5512
|
-
commentMaxWidth:
|
|
5513
|
-
commentMaxHeight:
|
|
5514
|
-
validationMaxWidth:
|
|
5515
|
-
validationMaxHeight:
|
|
5516
|
-
}), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation,
|
|
5517
|
-
this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${
|
|
5730
|
+
if (this.cornerGutter = this.hostDocument.createElement("canvas"), this.cornerGutter.style.cssText = a, this.cornerGutter.setAttribute("data-xlsx-outline", "corner"), this.colGutter = this.hostDocument.createElement("canvas"), this.colGutter.style.cssText = a, this.colGutter.setAttribute("data-xlsx-outline", "col"), this.rowGutter = this.hostDocument.createElement("canvas"), this.rowGutter.style.cssText = a, this.rowGutter.setAttribute("data-xlsx-outline", "row"), this.canvasArea = this.hostDocument.createElement("div"), this.canvasArea.style.cssText = "position:absolute;inset:0;overflow:hidden;", this.canvas = n.kind === "sheet" ? n.canvas : this.hostDocument.createElement("canvas"), this.canvas.style.cssText = "position:absolute;top:0;left:0;z-index:0;display:block;", this.renderDispatcher = new No(this.canvas, this._mode === "worker", this.hostWindow), this.scrollHost = this.hostDocument.createElement("div"), this.scrollHost.setAttribute("data-xlsx-viewport-input", n.kind), this.scrollHost.tabIndex = 0, this.scrollHost.style.cssText = `position:absolute;inset:0;overflow:${this._nativeScrollbars ? "auto" : "clip"};z-index:2;background:transparent;`, this.spacer = this.hostDocument.createElement("div"), this.spacer.style.cssText = "position:absolute;top:0;left:0;pointer-events:none;", this._nativeScrollbars && this.scrollHost.appendChild(this.spacer), this.surface = new Fo(this.canvas, this.canvasArea, this.scrollHost), this.overlayHost = new Io(this.canvasArea, this.canvas, this.scrollHost, {
|
|
5731
|
+
commentMaxWidth: Vo,
|
|
5732
|
+
commentMaxHeight: Ho,
|
|
5733
|
+
validationMaxWidth: Uo,
|
|
5734
|
+
validationMaxHeight: Wo
|
|
5735
|
+
}), this.selectionOverlay = this.overlayHost.selection, this.findOverlay = this.overlayHost.find, this.commentPopup = this.overlayHost.comment, this.validationPanel = this.overlayHost.validation, Qo(this.hostDocument), n.kind === "composite") {
|
|
5736
|
+
this.tabBar = this.hostDocument.createElement("div"), this.tabBar.style.cssText = `display:flex;align-items:flex-end;height:${Go}px;flex-shrink:0;background:#f0f0f0;border-top:1px solid #c8ccd0;`, this.navPrev = this.makeNavButton("◀", "Scroll tabs left", () => this.scrollTabs(-1)), this.navNext = this.makeNavButton("▶", "Scroll tabs right", () => this.scrollTabs(1)), this.navPrev.dataset.xlsxTabNav = "prev", this.navNext.dataset.xlsxTabNav = "next";
|
|
5518
5737
|
let e = this.hostDocument.createElement("div");
|
|
5519
|
-
e.style.cssText = `display:flex;flex-shrink:0;width:${
|
|
5738
|
+
e.style.cssText = `display:flex;flex-shrink:0;width:${Ko}px;height:100%;`, e.appendChild(this.navPrev), e.appendChild(this.navNext), this.tabStrip = this.hostDocument.createElement("div"), this.tabStrip.style.cssText = `position:relative;display:block;flex:1;min-width:0;height:100%;margin-left:${qo}px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;`, this.tabStrip.classList.add("xlsx-tab-strip"), this.tabStrip.addEventListener("scroll", () => this.updateNavButtons()), this.tabList = this.hostDocument.createElement("div"), this.tabList.style.cssText = `display:flex;align-items:flex-end;height:100%;gap:${qo}px;box-sizing:border-box;`, this.tabList.style.width = "max-content", this.tabList.style.minWidth = "100%", this.tabStrip.appendChild(this.tabList), this.tabBar.appendChild(e), this.tabBar.appendChild(this.tabStrip), this.opts.showZoomSlider !== !1 && this.tabBar.appendChild(this.buildZoomControl());
|
|
5520
5739
|
}
|
|
5521
5740
|
this.gridRegion.appendChild(this.canvasArea), this.wrapper.appendChild(this.gridRegion), n.kind === "composite" && this.wrapper.appendChild(this.tabBar), e.appendChild(this.wrapper), this.rowGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "row")), this.colGutter.addEventListener("pointerdown", (e) => this.onGutterPointerDown(e, "col")), this._nativeScrollbars && this.surface.on("scroll", () => {
|
|
5522
5741
|
if (this.pendingTap = null, this.pendingElementClick = null, this.hideCommentPopup(), this.hideValidationPanel(), this.scrollHost.clientWidth > 0) {
|
|
@@ -5532,7 +5751,7 @@ var us = class {
|
|
|
5532
5751
|
};
|
|
5533
5752
|
this.viewport.setViewportSize(this.scrollHost.clientWidth, this.scrollHost.clientHeight), this.setViewportLeft(e.x), this.viewportTop = e.y, this.reanchorHorizontalScroll(), this.layoutGutters(), this.scheduleRender(), this.updateSelectionOverlay(), this.updateFindOverlay(), this.updateNavButtons();
|
|
5534
5753
|
});
|
|
5535
|
-
o.observe(this.gridRegion), this.resizeObserver = o, this.setupSelectionEvents(), this._find = new
|
|
5754
|
+
o.observe(this.gridRegion), this.resizeObserver = o, this.setupSelectionEvents(), this._find = new go(() => this.sheetCount, (e) => this.wb?.sheetNames[e] ?? "", (e) => this._collectSheetCells(e)), i && (this.acquisition.install(i, !1), this._mountKind === "composite" && this.activateWorkbook(i).catch((e) => this._reportRenderError(e)));
|
|
5536
5755
|
}
|
|
5537
5756
|
async _collectSheetCells(e) {
|
|
5538
5757
|
let t = this.wb;
|
|
@@ -5551,7 +5770,7 @@ var us = class {
|
|
|
5551
5770
|
async load(e) {
|
|
5552
5771
|
if (this.assertOpen(), this._borrowed) throw Error(`${this._mountKind === "sheet" ? "XlsxSheetViewer" : "XlsxViewer"}.load() is unsupported on a Viewer created by fromWorkbook(); the borrowed workbook is already loaded.`);
|
|
5553
5772
|
try {
|
|
5554
|
-
let t = await this.acquisition.replace(() =>
|
|
5773
|
+
let t = await this.acquisition.replace(() => Ra.load(e, {
|
|
5555
5774
|
password: this.opts.password,
|
|
5556
5775
|
useGoogleFonts: this.opts.useGoogleFonts,
|
|
5557
5776
|
maxZipEntryBytes: this.opts.maxZipEntryBytes,
|
|
@@ -5577,7 +5796,7 @@ var us = class {
|
|
|
5577
5796
|
}
|
|
5578
5797
|
async ensureHostFonts(e) {
|
|
5579
5798
|
if (this.fontBinding?.workbook === e) return !0;
|
|
5580
|
-
let t = e[
|
|
5799
|
+
let t = e[Ia];
|
|
5581
5800
|
if (typeof t != "function") return !0;
|
|
5582
5801
|
let n = ++this.fontBindingGeneration, r = await t.call(e, this.hostDocument);
|
|
5583
5802
|
return this._destroyed || n !== this.fontBindingGeneration || this.wb !== e ? (r(), !1) : (this.fontBinding?.release(), this.fontBinding = {
|
|
@@ -5607,7 +5826,7 @@ var us = class {
|
|
|
5607
5826
|
try {
|
|
5608
5827
|
if (!await this.ensureHostFonts(n)) return;
|
|
5609
5828
|
let t = await n.getWorksheet(e);
|
|
5610
|
-
r = this.sheetViews.get(e) ??
|
|
5829
|
+
r = this.sheetViews.get(e) ?? jo(t), this.sheetViews.set(e, r);
|
|
5611
5830
|
} catch (e) {
|
|
5612
5831
|
if (!this.isCurrentSheetRequest(t, n)) return;
|
|
5613
5832
|
throw e;
|
|
@@ -5618,12 +5837,12 @@ var us = class {
|
|
|
5618
5837
|
return !this._destroyed && e === this.sheetRequestGeneration && this.wb === t;
|
|
5619
5838
|
}
|
|
5620
5839
|
buildOutline(e) {
|
|
5621
|
-
this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands =
|
|
5622
|
-
let t =
|
|
5840
|
+
this.stashedRowHeights.clear(), this.stashedColWidths.clear(), this.rowOutlineBands = Do(e), this.colOutlineBands = Oo(e);
|
|
5841
|
+
let t = So(this.rowOutlineBands, ko(e, "row")), n = So(this.colOutlineBands, ko(e, "col"));
|
|
5623
5842
|
this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
|
|
5624
5843
|
}
|
|
5625
5844
|
layoutGutters() {
|
|
5626
|
-
let e = this.viewport.scale, t = this.rowOutline ? Math.round(
|
|
5845
|
+
let e = this.viewport.scale, t = this.rowOutline ? Math.round(yo(this.rowOutline.maxLevel) * e) : 0, n = this.colOutline ? Math.round(yo(this.colOutline.maxLevel) * e) : 0;
|
|
5627
5846
|
this.gutter = {
|
|
5628
5847
|
w: t,
|
|
5629
5848
|
h: n
|
|
@@ -5641,45 +5860,55 @@ var us = class {
|
|
|
5641
5860
|
this.currentWorksheet && (this.gutter.h > 0 && this.colOutline && this.paintAxisGutter("col"), this.gutter.w > 0 && this.rowOutline && this.paintAxisGutter("row"), (this.gutter.w > 0 || this.gutter.h > 0) && this.paintCornerGutter());
|
|
5642
5861
|
}
|
|
5643
5862
|
paintAxisGutter(e) {
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5863
|
+
let t = this.currentWorksheet;
|
|
5864
|
+
if (!t) return;
|
|
5865
|
+
let n = this.viewport.scale, r = e === "row", i = r ? this.rowGutter : this.colGutter, a = r ? this.rowOutline : this.colOutline;
|
|
5866
|
+
if (!a) return;
|
|
5867
|
+
let o = parseFloat(i.style.width) || 0, s = parseFloat(i.style.height) || 0;
|
|
5868
|
+
if (o <= 0 || s <= 0) return;
|
|
5869
|
+
let c = this.surface.sizeCanvas(i, o, s), l = i.getContext("2d");
|
|
5870
|
+
if (!l) return;
|
|
5871
|
+
l.setTransform(c, 0, 0, c, 0, 0), l.clearRect(0, 0, o, s), l.fillStyle = "#f5f5f5", l.fillRect(0, 0, o, s);
|
|
5872
|
+
let u = 19 * n;
|
|
5873
|
+
l.strokeStyle = "#808080", l.lineWidth = 1, l.fillStyle = "#404040";
|
|
5874
|
+
let d = $(t), f = d.effectiveFrozenBands({
|
|
5875
|
+
scale: n,
|
|
5876
|
+
width: this.canvasArea.clientWidth,
|
|
5877
|
+
height: this.canvasArea.clientHeight,
|
|
5878
|
+
headerWidth: 50,
|
|
5879
|
+
headerHeight: 22,
|
|
5880
|
+
rows: t.freezeRows ?? 0,
|
|
5881
|
+
cols: t.freezeCols ?? 0
|
|
5882
|
+
}), p = d.axesAtScale(n), m = r ? f.rows : f.cols, h = r ? p.row.offsetOf(f.rows + 1) : p.col.offsetOf(f.cols + 1), g = (r ? 22 : 50) * n, _ = (n, i) => bo(e, n, i, m, g, h, o, s, !r && t.rightToLeft === !0), v = (e, t) => {
|
|
5883
|
+
let n = _(e, t);
|
|
5884
|
+
return n.w <= 0 || n.h <= 0 ? !1 : (l.save(), l.beginPath(), l.rect(n.x, n.y, n.w, n.h), l.clip(), !0);
|
|
5885
|
+
};
|
|
5886
|
+
for (let t of a.groups) {
|
|
5887
|
+
let i = (t.level - 1 + .5) * u, a = r ? this.getCellRect(t.start, 1) : this.getCellRect(1, t.start), o = r ? this.getCellRect(t.end, 1) : this.getCellRect(1, t.end);
|
|
5888
|
+
if (!a || !o) continue;
|
|
5889
|
+
let s = r ? a.y : this.screenX(a.x, a.w), c = r ? o.y + o.h : this.screenX(o.x, o.w) + o.w, d = Math.min(s, c), f = Math.max(s, c);
|
|
5890
|
+
if (!t.collapsed && f - d > 1 && v(t.start, t.end)) {
|
|
5891
|
+
l.beginPath();
|
|
5892
|
+
for (let t of xo(e, i, s, c, u)) l.moveTo(t.x1, t.y1), l.lineTo(t.x2, t.y2);
|
|
5893
|
+
l.stroke(), l.restore();
|
|
5669
5894
|
}
|
|
5670
|
-
if (
|
|
5671
|
-
let
|
|
5672
|
-
if (
|
|
5673
|
-
let a =
|
|
5674
|
-
this.drawToggleBox(
|
|
5895
|
+
if (t.summary != null) {
|
|
5896
|
+
let e = r ? this.getCellRect(t.summary, 1) : this.getCellRect(1, t.summary);
|
|
5897
|
+
if (e) {
|
|
5898
|
+
let a = r ? e.y + e.h / 2 : this.screenX(e.x, e.w) + e.w / 2;
|
|
5899
|
+
v(t.summary, t.summary) && (this.drawToggleBox(l, r ? i : a, r ? a : i, t.collapsed, n), l.restore());
|
|
5675
5900
|
}
|
|
5676
5901
|
}
|
|
5677
5902
|
}
|
|
5678
|
-
let
|
|
5679
|
-
for (let e = 1; e <=
|
|
5680
|
-
let
|
|
5681
|
-
if (
|
|
5682
|
-
this.drawLevelButton(
|
|
5903
|
+
let y = r ? 22 * n / 2 : 50 * n / 2;
|
|
5904
|
+
for (let e = 1; e <= a.maxLevel + 1; e++) {
|
|
5905
|
+
let t = vo(e) * n;
|
|
5906
|
+
if (t + 12 * n / 2 > (r ? o : s) + .5) break;
|
|
5907
|
+
this.drawLevelButton(l, r ? t : y, r ? y : t, String(e), n);
|
|
5908
|
+
}
|
|
5909
|
+
if (m > 0) {
|
|
5910
|
+
let e = r ? g + h : t.rightToLeft === !0 ? o - g - h : g + h;
|
|
5911
|
+
l.save(), l.strokeStyle = "#7a7a7a", l.lineWidth = .5, l.beginPath(), r ? (l.moveTo(0, e), l.lineTo(o, e)) : (l.moveTo(e, 0), l.lineTo(e, s)), l.stroke(), l.restore();
|
|
5683
5912
|
}
|
|
5684
5913
|
}
|
|
5685
5914
|
drawToggleBox(e, t, n, r, i) {
|
|
@@ -5687,7 +5916,7 @@ var us = class {
|
|
|
5687
5916
|
e.save(), e.fillStyle = "#ffffff", e.strokeStyle = "#808080", e.lineWidth = 1, e.fillRect(o + .5, s + .5, a, a), e.strokeRect(o + .5, s + .5, a, a), e.strokeStyle = "#404040", e.beginPath(), e.moveTo(o + 2.5, s + a / 2 + .5), e.lineTo(o + a - 1.5, s + a / 2 + .5), r && (e.moveTo(o + a / 2 + .5, s + 2.5), e.lineTo(o + a / 2 + .5, s + a - 1.5)), e.stroke(), e.restore();
|
|
5688
5917
|
}
|
|
5689
5918
|
drawLevelButton(e, t, n, r, i) {
|
|
5690
|
-
let a = Math.round(
|
|
5919
|
+
let a = Math.round(12 * i), o = Math.round(t - a / 2), s = Math.round(n - a / 2);
|
|
5691
5920
|
e.save(), e.font = `${Math.round(9 * i)}px sans-serif`, e.textAlign = "center", e.textBaseline = "middle", e.fillStyle = "#ffffff", e.strokeStyle = "#808080", e.lineWidth = 1, e.fillRect(o + .5, s + .5, a, a), e.strokeRect(o + .5, s + .5, a, a), e.fillStyle = "#404040", e.fillText(r, t, n + .5), e.restore();
|
|
5692
5921
|
}
|
|
5693
5922
|
paintCornerGutter() {
|
|
@@ -5703,8 +5932,8 @@ var us = class {
|
|
|
5703
5932
|
let i = (n ? this.rowGutter : this.colGutter).getBoundingClientRect(), a = e.clientX - i.left, o = e.clientY - i.top, s = this.viewport.scale, c = 19 * s, l = 7 * s, u = n ? 22 * s / 2 : 50 * s / 2;
|
|
5704
5933
|
if ((n ? o : a) <= (n ? 22 : 50) * s) {
|
|
5705
5934
|
for (let i = 1; i <= r.maxLevel + 1; i++) {
|
|
5706
|
-
let r = (i
|
|
5707
|
-
if (Math.abs(a -
|
|
5935
|
+
let r = vo(i) * s, c = n ? r : u, l = n ? u : r, d = 12 * s / 2;
|
|
5936
|
+
if (Math.abs(a - c) <= d && Math.abs(o - l) <= d) {
|
|
5708
5937
|
e.preventDefault(), this.applyLevelButton(i, t);
|
|
5709
5938
|
return;
|
|
5710
5939
|
}
|
|
@@ -5725,15 +5954,33 @@ var us = class {
|
|
|
5725
5954
|
applyGroupToggle(e, t) {
|
|
5726
5955
|
let n = this.currentWorksheet;
|
|
5727
5956
|
if (!n) return;
|
|
5728
|
-
let { hide: r, show: i, nowCollapsed: a } =
|
|
5957
|
+
let { hide: r, show: i, nowCollapsed: a } = wo(e, t === "row" ? this.rowOutlineBands : this.colOutlineBands);
|
|
5729
5958
|
for (let e of r) this.setBandHidden(t, e, !0);
|
|
5730
5959
|
for (let e of i) this.setBandHidden(t, e, !1);
|
|
5731
|
-
e.summary != null && this.setBandCollapsed(t, e.summary, a), this.afterOutlineMutation(n
|
|
5960
|
+
e.summary != null && this.setBandCollapsed(t, e.summary, a), this.afterOutlineMutation(n, a && e.summary != null ? {
|
|
5961
|
+
axis: t,
|
|
5962
|
+
summary: e.summary
|
|
5963
|
+
} : void 0);
|
|
5964
|
+
}
|
|
5965
|
+
scrollOutlineSummaryToStart(e, t) {
|
|
5966
|
+
let n = this.currentWorksheet;
|
|
5967
|
+
if (!n) return;
|
|
5968
|
+
let r = this.viewport.scale, i = $(n).scrollOffsetForCell(e === "row" ? t : 1, e === "col" ? t : 1, {
|
|
5969
|
+
scale: r,
|
|
5970
|
+
viewportWidth: this.canvasArea.clientWidth,
|
|
5971
|
+
viewportHeight: this.canvasArea.clientHeight,
|
|
5972
|
+
currentX: this.effectiveScrollLeft,
|
|
5973
|
+
currentY: this.viewportTop,
|
|
5974
|
+
headerWidth: 50,
|
|
5975
|
+
headerHeight: 22,
|
|
5976
|
+
align: "start"
|
|
5977
|
+
});
|
|
5978
|
+
e === "row" ? this.viewportTop = i.y : this.setViewportLeft(i.x);
|
|
5732
5979
|
}
|
|
5733
5980
|
applyLevelButton(e, t) {
|
|
5734
5981
|
let n = this.currentWorksheet;
|
|
5735
5982
|
if (!n) return;
|
|
5736
|
-
let { hide: r, show: i } =
|
|
5983
|
+
let { hide: r, show: i } = Eo(t === "row" ? this.rowOutlineBands : this.colOutlineBands, e);
|
|
5737
5984
|
for (let e of r) this.setBandHidden(t, e, !0);
|
|
5738
5985
|
for (let e of i) this.setBandHidden(t, e, !1);
|
|
5739
5986
|
let a = t === "row" ? this.rowOutline : this.colOutline;
|
|
@@ -5788,19 +6035,19 @@ var us = class {
|
|
|
5788
6035
|
e && (e.collapsed = n);
|
|
5789
6036
|
} else r.colCollapsed = r.colCollapsed ?? {}, n ? r.colCollapsed[t] = !0 : delete r.colCollapsed[t];
|
|
5790
6037
|
}
|
|
5791
|
-
afterOutlineMutation(e) {
|
|
5792
|
-
or.invalidate(e), this.buildOutlineLayoutOnly(e), this.updateSpacerSize(e), this.updateSelectionOverlay(), this.scheduleRender();
|
|
6038
|
+
afterOutlineMutation(e, t) {
|
|
6039
|
+
or.invalidate(e), this.buildOutlineLayoutOnly(e), this.updateSpacerSize(e), t && this.scrollOutlineSummaryToStart(t.axis, t.summary), this.updateSelectionOverlay(), this.updateFindOverlay(), this.scheduleRender(), t && this.emitViewportChange();
|
|
5793
6040
|
}
|
|
5794
6041
|
buildOutlineLayoutOnly(e) {
|
|
5795
|
-
this.rowOutlineBands =
|
|
5796
|
-
let t =
|
|
6042
|
+
this.rowOutlineBands = Do(e), this.colOutlineBands = Oo(e);
|
|
6043
|
+
let t = So(this.rowOutlineBands, ko(e, "row")), n = So(this.colOutlineBands, ko(e, "col"));
|
|
5797
6044
|
this.rowOutline = t.maxLevel > 0 ? t : null, this.colOutline = n.maxLevel > 0 ? n : null;
|
|
5798
6045
|
}
|
|
5799
6046
|
get isRtl() {
|
|
5800
6047
|
return this.currentWorksheet?.rightToLeft === !0;
|
|
5801
6048
|
}
|
|
5802
6049
|
updateFooterDirection() {
|
|
5803
|
-
this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${
|
|
6050
|
+
this._mountKind === "composite" && (this.tabBar.style.flexDirection = this.isRtl ? "row-reverse" : "row", this.tabStrip.style.marginLeft = this.isRtl ? "0" : `${qo}px`, this.tabStrip.style.marginRight = this.isRtl ? `${qo}px` : "0", this.tabList.style.flexDirection = this.isRtl ? "row-reverse" : "row");
|
|
5804
6051
|
}
|
|
5805
6052
|
get maxScrollLeft() {
|
|
5806
6053
|
return this.syncNativeViewportExtent(), this.viewport.maxX;
|
|
@@ -5930,7 +6177,7 @@ var us = class {
|
|
|
5930
6177
|
let n = this.currentWorksheet, r = this.elementContextViewport();
|
|
5931
6178
|
if (!n || !r) return null;
|
|
5932
6179
|
let i = this.canvasArea.getBoundingClientRect();
|
|
5933
|
-
return
|
|
6180
|
+
return to(n, this.currentSheet, {
|
|
5934
6181
|
x: e - i.left,
|
|
5935
6182
|
y: t - i.top
|
|
5936
6183
|
}, r);
|
|
@@ -5954,32 +6201,32 @@ var us = class {
|
|
|
5954
6201
|
if (this._destroyed) throw Error("XlsxViewer has been destroyed");
|
|
5955
6202
|
let t;
|
|
5956
6203
|
if (typeof e == "string") {
|
|
5957
|
-
if (t =
|
|
5958
|
-
} else t = e ?
|
|
6204
|
+
if (t = mo(e), !t) throw SyntaxError(`Invalid XLSX selection reference: ${e}`);
|
|
6205
|
+
} else t = e ? fo(e) : null;
|
|
5959
6206
|
this.commitSelection(t);
|
|
5960
6207
|
}
|
|
5961
6208
|
getSelectionContext(e = {}) {
|
|
5962
|
-
if (this.assertOpen(), this.elementContext) return
|
|
6209
|
+
if (this.assertOpen(), this.elementContext) return no(this.elementContext, e.maxTextCharacters);
|
|
5963
6210
|
let t = this.currentWorksheet, n = this.selectionState;
|
|
5964
6211
|
if (!t || !n) return null;
|
|
5965
6212
|
let r = e.maxCells ?? 1e3;
|
|
5966
6213
|
if (!Number.isFinite(r) || r < 0) throw RangeError("maxCells must be a finite non-negative number.");
|
|
5967
|
-
let i = Math.min(
|
|
6214
|
+
let i = Math.min(io, Math.floor(r)), a = e.maxTextCharacters ?? cs;
|
|
5968
6215
|
if (!Number.isFinite(a) || a < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
|
|
5969
|
-
let o = Math.min(
|
|
6216
|
+
let o = Math.min(ao, Math.floor(a)), s = 0, c = !1, l = (e) => {
|
|
5970
6217
|
let t = typeof e == "string" ? [e] : e, n = [], r = 0;
|
|
5971
6218
|
for (let e = 0; e < t.length; e++) {
|
|
5972
|
-
let i = t[e], a = typeof i == "string" ? i : i.text, l = Math.max(0, Math.min(
|
|
6219
|
+
let i = t[e], a = typeof i == "string" ? i : i.text, l = Math.max(0, Math.min(us - r, o - s)), u = fs(a, l);
|
|
5973
6220
|
if (n.push(u), r += u.length, s += u.length, u.length < a.length || e + 1 < t.length && l === 0) {
|
|
5974
6221
|
c = !0;
|
|
5975
6222
|
break;
|
|
5976
6223
|
}
|
|
5977
6224
|
}
|
|
5978
6225
|
return n.join("");
|
|
5979
|
-
}, u = n.areas.some((e) => e.kind === "sheet"), d =
|
|
6226
|
+
}, u = n.areas.some((e) => e.kind === "sheet"), d = $o(n.areas.flatMap((e) => e.kind === "rows" ? [{
|
|
5980
6227
|
first: e.firstRow,
|
|
5981
6228
|
last: e.lastRow
|
|
5982
|
-
}] : [])), f =
|
|
6229
|
+
}] : [])), f = $o(n.areas.flatMap((e) => e.kind === "columns" ? [{
|
|
5983
6230
|
first: e.firstColumn,
|
|
5984
6231
|
last: e.lastColumn
|
|
5985
6232
|
}] : [])), p = n.areas.flatMap((e) => e.kind === "cells" ? [e] : []), m = p.flatMap((e, t) => [{
|
|
@@ -5993,13 +6240,13 @@ var us = class {
|
|
|
5993
6240
|
}]).sort((e, t) => e.row - t.row || Number(e.active) - Number(t.active)), h = /* @__PURE__ */ new Set(), g = 0, _ = [], v = [], y = !1, b = u || f.length > 0 ? [{
|
|
5994
6241
|
first: 1,
|
|
5995
6242
|
last: ir
|
|
5996
|
-
}] :
|
|
6243
|
+
}] : $o([...d, ...p.map((e) => ({
|
|
5997
6244
|
first: e.top,
|
|
5998
6245
|
last: e.bottom
|
|
5999
6246
|
}))]), x = this.selectionContextRows.get(t);
|
|
6000
|
-
x || (x =
|
|
6247
|
+
x || (x = ns(t.rows, (e) => e.index), this.selectionContextRows.set(t, x));
|
|
6001
6248
|
cellScan: for (let e of b) {
|
|
6002
|
-
let n =
|
|
6249
|
+
let n = ts(x, e.first, (e) => e.index);
|
|
6003
6250
|
for (; n < x.length;) {
|
|
6004
6251
|
let r = x[n++];
|
|
6005
6252
|
if (r.index > e.last) break;
|
|
@@ -6008,18 +6255,18 @@ var us = class {
|
|
|
6008
6255
|
let e = m[g++];
|
|
6009
6256
|
e.active ? h.add(e.index) : h.delete(e.index), a = !0;
|
|
6010
6257
|
}
|
|
6011
|
-
a && (_ =
|
|
6258
|
+
a && (_ = $o([...h].map((e) => ({
|
|
6012
6259
|
first: p[e].left,
|
|
6013
6260
|
last: p[e].right
|
|
6014
6261
|
}))));
|
|
6015
|
-
let o = u ||
|
|
6262
|
+
let o = u || es(d, r.index) ? [{
|
|
6016
6263
|
first: 1,
|
|
6017
6264
|
last: ar
|
|
6018
|
-
}] :
|
|
6265
|
+
}] : $o([...f, ..._]);
|
|
6019
6266
|
for (let e of o) {
|
|
6020
6267
|
let n = this.selectionContextCells.get(r);
|
|
6021
|
-
n || (n =
|
|
6022
|
-
let a =
|
|
6268
|
+
n || (n = ns(r.cells, (e) => e.col), this.selectionContextCells.set(r, n));
|
|
6269
|
+
let a = ts(n, e.first, (e) => e.col);
|
|
6023
6270
|
for (; a < n.length;) {
|
|
6024
6271
|
let r = n[a++];
|
|
6025
6272
|
if (r.col > e.last) break;
|
|
@@ -6051,7 +6298,7 @@ var us = class {
|
|
|
6051
6298
|
sheetIndex: this.currentSheet,
|
|
6052
6299
|
sheetName: t.name,
|
|
6053
6300
|
selection: n,
|
|
6054
|
-
coordinateCountUpperBound:
|
|
6301
|
+
coordinateCountUpperBound: oo(n),
|
|
6055
6302
|
cells: v,
|
|
6056
6303
|
truncated: S.length > 0,
|
|
6057
6304
|
truncationReasons: S,
|
|
@@ -6063,7 +6310,7 @@ var us = class {
|
|
|
6063
6310
|
commitSelection(e) {
|
|
6064
6311
|
this.setElementContext(null);
|
|
6065
6312
|
let t = this.selectionState;
|
|
6066
|
-
|
|
6313
|
+
ho(t, e) || (this.hideValidationPanel(), this.selectionController.setState(e), this.updateSelectionOverlay(), this.wb && this.scheduleRender(), this.emitSelectionChange());
|
|
6067
6314
|
}
|
|
6068
6315
|
setElementContext(e) {
|
|
6069
6316
|
return JSON.stringify(this.elementContext) === JSON.stringify(e) ? !1 : (this.elementContext = e ? structuredClone(e) : null, this.updateSelectionOverlay(), this.scheduleSelectionContextNotification(), !0);
|
|
@@ -6072,22 +6319,22 @@ var us = class {
|
|
|
6072
6319
|
if (!this.opts.onSelectionContextChange || this._destroyed || this.selectionContextNotificationFrame !== null || this.selectionContextNotificationMicrotask) return;
|
|
6073
6320
|
let e = () => {
|
|
6074
6321
|
if (this.selectionContextNotificationFrame = null, this.selectionContextNotificationMicrotask = !1, this._destroyed) return;
|
|
6075
|
-
let e = this.getSelectionContext({ maxTextCharacters:
|
|
6322
|
+
let e = this.getSelectionContext({ maxTextCharacters: ls });
|
|
6076
6323
|
this.opts.onSelectionContextChange?.(e ? structuredClone(e) : null);
|
|
6077
6324
|
};
|
|
6078
6325
|
typeof this.hostWindow.requestAnimationFrame == "function" ? this.selectionContextNotificationFrame = this.hostWindow.requestAnimationFrame(e) : (this.selectionContextNotificationMicrotask = !0, queueMicrotask(e));
|
|
6079
6326
|
}
|
|
6080
6327
|
emitSelectionChange() {
|
|
6081
6328
|
let e = this.selectionState;
|
|
6082
|
-
if (
|
|
6329
|
+
if (ho(e, this.lastNotifiedSelectionState) || this.scheduleSelectionContextNotification(), this.emittingSelectionChange) {
|
|
6083
6330
|
this.pendingSelectionChange = !0, this.scheduleSelectionNotification();
|
|
6084
6331
|
return;
|
|
6085
6332
|
}
|
|
6086
|
-
if (this.pendingSelectionChange = !1,
|
|
6333
|
+
if (this.pendingSelectionChange = !1, ho(e, this.lastNotifiedSelectionState)) {
|
|
6087
6334
|
this.finishSelectionNotificationChain();
|
|
6088
6335
|
return;
|
|
6089
6336
|
}
|
|
6090
|
-
if (this.selectionNotificationCount >=
|
|
6337
|
+
if (this.selectionNotificationCount >= ds) {
|
|
6091
6338
|
this.lastNotifiedSelectionState = e ? structuredClone(e) : null, this.finishSelectionNotificationChain();
|
|
6092
6339
|
return;
|
|
6093
6340
|
}
|
|
@@ -6095,7 +6342,7 @@ var us = class {
|
|
|
6095
6342
|
try {
|
|
6096
6343
|
this.opts.onSelectionStateChange?.(e ? structuredClone(e) : null);
|
|
6097
6344
|
} finally {
|
|
6098
|
-
this.emittingSelectionChange = !1, this.pendingSelectionChange || !
|
|
6345
|
+
this.emittingSelectionChange = !1, this.pendingSelectionChange || !ho(this.selectionState, this.lastNotifiedSelectionState) ? this.scheduleSelectionNotification() : this.finishSelectionNotificationChain();
|
|
6099
6346
|
}
|
|
6100
6347
|
}
|
|
6101
6348
|
scheduleSelectionNotification() {
|
|
@@ -6146,7 +6393,7 @@ var us = class {
|
|
|
6146
6393
|
edge: t.x + t.w
|
|
6147
6394
|
}));
|
|
6148
6395
|
}
|
|
6149
|
-
let o =
|
|
6396
|
+
let o = ms(a, i, is, s);
|
|
6150
6397
|
return o === null ? null : {
|
|
6151
6398
|
kind: "col",
|
|
6152
6399
|
index: o,
|
|
@@ -6166,7 +6413,7 @@ var us = class {
|
|
|
6166
6413
|
edge: t.y + t.h
|
|
6167
6414
|
}));
|
|
6168
6415
|
}
|
|
6169
|
-
let a =
|
|
6416
|
+
let a = ms(o, i, is, c);
|
|
6170
6417
|
return a === null ? null : {
|
|
6171
6418
|
kind: "row",
|
|
6172
6419
|
index: a,
|
|
@@ -6181,10 +6428,10 @@ var us = class {
|
|
|
6181
6428
|
if (!n || !r) return;
|
|
6182
6429
|
let i = this.viewport.scale, a = this.canvasArea.getBoundingClientRect();
|
|
6183
6430
|
if (n.kind === "col") {
|
|
6184
|
-
let t = this.screenX(e - a.left, 0), o = Math.max(
|
|
6431
|
+
let t = this.screenX(e - a.left, 0), o = Math.max(as, Math.round((t - n.originScaled) / i));
|
|
6185
6432
|
r.colWidths[n.index] = er(o, n.mdw), this.recordSizeOverride("col", n.index);
|
|
6186
6433
|
} else {
|
|
6187
|
-
let e = t - a.top, o = Math.max(
|
|
6434
|
+
let e = t - a.top, o = Math.max(as, Math.round((e - n.originScaled) / i));
|
|
6188
6435
|
r.rowHeights[n.index] = nr(o), this.recordSizeOverride("row", n.index);
|
|
6189
6436
|
}
|
|
6190
6437
|
or.invalidate(r), this.updateSpacerSize(r), this.updateSelectionOverlay(), this.scheduleRender();
|
|
@@ -6234,12 +6481,12 @@ var us = class {
|
|
|
6234
6481
|
c1: n.left,
|
|
6235
6482
|
c2: n.right
|
|
6236
6483
|
}, l = o - a + 1, u = c - s + 1;
|
|
6237
|
-
if (l > Math.floor(
|
|
6484
|
+
if (l > Math.floor(os / u)) return {
|
|
6238
6485
|
status: "too-large",
|
|
6239
6486
|
limit: "cells"
|
|
6240
6487
|
};
|
|
6241
6488
|
let d = l * u, f = Math.max(0, l - 1) + l * Math.max(0, u - 1);
|
|
6242
|
-
if (f >
|
|
6489
|
+
if (f > ss) return {
|
|
6243
6490
|
status: "too-large",
|
|
6244
6491
|
limit: "text"
|
|
6245
6492
|
};
|
|
@@ -6248,7 +6495,7 @@ var us = class {
|
|
|
6248
6495
|
if (n.col < s || n.col > c) continue;
|
|
6249
6496
|
let r = n.value, i = this.wb?.cellText(e, n) ?? "";
|
|
6250
6497
|
if (this.wb || (r.type === "text" ? i = r.runs ? r.runs.map((e) => e.text).join("") : r.text : r.type === "number" ? i = String(r.number) : r.type === "bool" ? i = r.bool ? "TRUE" : "FALSE" : r.type === "error" && (i = r.error)), i) {
|
|
6251
|
-
let e =
|
|
6498
|
+
let e = ps(i, ss - f);
|
|
6252
6499
|
if (e === null) return {
|
|
6253
6500
|
status: "too-large",
|
|
6254
6501
|
limit: "text"
|
|
@@ -6326,7 +6573,7 @@ var us = class {
|
|
|
6326
6573
|
last: ir,
|
|
6327
6574
|
start: a,
|
|
6328
6575
|
end: s
|
|
6329
|
-
}],
|
|
6576
|
+
}], h = this.opts.selectionColor ?? rs, { background: g } = hs(h), _ = /* @__PURE__ */ new Set(), v = [], y = [];
|
|
6330
6577
|
for (let t of e.areas) {
|
|
6331
6578
|
let e = t.kind === "cells" ? {
|
|
6332
6579
|
top: t.top,
|
|
@@ -6365,55 +6612,82 @@ var us = class {
|
|
|
6365
6612
|
leftEdge: !1,
|
|
6366
6613
|
rightEdge: !1
|
|
6367
6614
|
};
|
|
6368
|
-
for (let
|
|
6369
|
-
if (
|
|
6370
|
-
let
|
|
6371
|
-
if (
|
|
6372
|
-
let
|
|
6373
|
-
if (!
|
|
6374
|
-
let
|
|
6375
|
-
if (
|
|
6376
|
-
let
|
|
6377
|
-
|
|
6378
|
-
|
|
6615
|
+
for (let t of m) for (let n of p) {
|
|
6616
|
+
if (n.end <= n.start || t.end <= t.start) continue;
|
|
6617
|
+
let r = Math.max(e.top, t.first), i = Math.min(e.bottom, t.last), a = Math.max(e.left, n.first), o = Math.min(e.right, n.last);
|
|
6618
|
+
if (r > i || a > o) continue;
|
|
6619
|
+
let s = this.getCellRect(r, a), c = this.getCellRect(i, o);
|
|
6620
|
+
if (!s || !c) continue;
|
|
6621
|
+
let l = s.x, u = s.y, d = c.x + c.w, f = c.y + c.h, p = Math.max(l, n.start), m = Math.max(u, t.start), h = Math.min(d, n.end), g = Math.min(f, t.end), b = h - p, x = g - m;
|
|
6622
|
+
if (b <= 0 || x <= 0) continue;
|
|
6623
|
+
let S = e.topEdge && r === e.top && u >= t.start, C = e.bottomEdge && i === e.bottom && f <= t.end, w = e.leftEdge && a === e.left && l >= n.start, T = e.rightEdge && o === e.right && d <= n.end, E = this.screenX(p, b), D = this.isRtl ? T : w, O = this.isRtl ? w : T, k = [
|
|
6624
|
+
E,
|
|
6625
|
+
m,
|
|
6626
|
+
b,
|
|
6627
|
+
x,
|
|
6379
6628
|
S,
|
|
6629
|
+
O,
|
|
6380
6630
|
C,
|
|
6381
|
-
|
|
6382
|
-
A,
|
|
6383
|
-
T,
|
|
6384
|
-
k
|
|
6631
|
+
D
|
|
6385
6632
|
].join("|");
|
|
6386
|
-
|
|
6387
|
-
|
|
6388
|
-
|
|
6389
|
-
|
|
6633
|
+
_.has(k) || (_.add(k), v.push(`M${E} ${m}h${b}v${x}h${-b}Z`), y.push({
|
|
6634
|
+
x: E,
|
|
6635
|
+
y: m,
|
|
6636
|
+
width: b,
|
|
6637
|
+
height: x,
|
|
6638
|
+
top: S,
|
|
6639
|
+
right: O,
|
|
6640
|
+
bottom: C,
|
|
6641
|
+
left: D
|
|
6642
|
+
}));
|
|
6390
6643
|
}
|
|
6391
6644
|
}
|
|
6392
6645
|
if (v.length > 0) {
|
|
6393
|
-
let
|
|
6394
|
-
|
|
6395
|
-
let
|
|
6396
|
-
|
|
6646
|
+
let t = "http://www.w3.org/2000/svg", n = this.hostDocument.createElementNS(t, "svg");
|
|
6647
|
+
n.setAttribute("data-xlsx-selection-fill", ""), n.style.cssText = "position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none;";
|
|
6648
|
+
let r = e.areas.length > 1, i = this.getCellRect(e.activeCell.row, e.activeCell.col), a = `xlsx-selection-mask-${++_s}`, c = this.hostDocument.createElementNS(t, "defs"), l = this.hostDocument.createElementNS(t, "mask");
|
|
6649
|
+
l.setAttribute("id", a), l.setAttribute("maskUnits", "userSpaceOnUse"), l.setAttribute("x", "0"), l.setAttribute("y", "0"), l.setAttribute("width", String(o)), l.setAttribute("height", String(s));
|
|
6650
|
+
let u = this.hostDocument.createElementNS(t, "path");
|
|
6651
|
+
if (u.setAttribute("d", v.join("")), u.setAttribute("fill", "#fff"), l.appendChild(u), i) for (let e of m) for (let n of p) {
|
|
6652
|
+
let r = Math.max(i.x, n.start), a = Math.max(i.y, e.start), o = Math.min(i.x + i.w, n.end), s = Math.min(i.y + i.h, e.end);
|
|
6653
|
+
if (o <= r || s <= a) continue;
|
|
6654
|
+
let c = this.hostDocument.createElementNS(t, "rect");
|
|
6655
|
+
c.setAttribute("data-xlsx-active-cell-cutout", ""), c.setAttribute("x", String(this.screenX(r, o - r))), c.setAttribute("y", String(a)), c.setAttribute("width", String(o - r)), c.setAttribute("height", String(s - a)), c.setAttribute("fill", "#000"), l.appendChild(c);
|
|
6656
|
+
}
|
|
6657
|
+
c.appendChild(l), n.appendChild(c);
|
|
6658
|
+
let d = this.hostDocument.createElementNS(t, "rect");
|
|
6659
|
+
d.setAttribute("x", "0"), d.setAttribute("y", "0"), d.setAttribute("width", String(o)), d.setAttribute("height", String(s)), d.setAttribute("fill", g), d.setAttribute("mask", `url(#${a})`), n.appendChild(d);
|
|
6660
|
+
let f = r ? "" : gs(y);
|
|
6661
|
+
if (f) {
|
|
6662
|
+
let e = this.hostDocument.createElementNS(t, "path");
|
|
6663
|
+
e.setAttribute("data-xlsx-selection-border", ""), e.setAttribute("d", f), e.setAttribute("fill", "none"), e.setAttribute("stroke", h), e.setAttribute("stroke-width", "2"), e.setAttribute("stroke-linecap", "square"), e.setAttribute("stroke-linejoin", "miter"), n.appendChild(e);
|
|
6664
|
+
}
|
|
6665
|
+
if (i && r) for (let e of m) for (let r of p) {
|
|
6666
|
+
let a = Math.max(i.x, r.start), o = Math.max(i.y, e.start), s = Math.min(i.x + i.w, r.end), c = Math.min(i.y + i.h, e.end);
|
|
6667
|
+
if (s <= a || c <= o) continue;
|
|
6668
|
+
let l = this.hostDocument.createElementNS(t, "rect");
|
|
6669
|
+
l.setAttribute("data-xlsx-active-cell-border", ""), l.setAttribute("x", String(this.screenX(a, s - a))), l.setAttribute("y", String(o)), l.setAttribute("width", String(s - a)), l.setAttribute("height", String(c - o)), l.setAttribute("fill", "none"), l.setAttribute("stroke", h), l.setAttribute("stroke-width", "1"), n.appendChild(l);
|
|
6670
|
+
}
|
|
6671
|
+
this.overlayHost.appendSelection(n);
|
|
6397
6672
|
}
|
|
6398
|
-
for (let e of y) this.overlayHost.appendSelection(e);
|
|
6399
6673
|
this.maybeDrawValidationDropdown();
|
|
6400
6674
|
}
|
|
6401
6675
|
drawElementContextOverlay() {
|
|
6402
6676
|
let e = this.elementContext, t = this.currentWorksheet, n = this.elementContextViewport();
|
|
6403
6677
|
if (!e || !t || !n || e.sheetIndex !== this.currentSheet) return;
|
|
6404
|
-
let r =
|
|
6678
|
+
let r = Ka(t, e, n);
|
|
6405
6679
|
if (!r) return;
|
|
6406
6680
|
let i = this.hostDocument.createElement("div");
|
|
6407
6681
|
i.setAttribute("data-xlsx-element-context-clip", ""), i.style.cssText = `position:absolute;left:${r.clip.x}px;top:${r.clip.y}px;width:${r.clip.width}px;height:${r.clip.height}px;overflow:hidden;pointer-events:none;`;
|
|
6408
6682
|
let a = this.hostDocument.createElement("div");
|
|
6409
6683
|
a.setAttribute("data-xlsx-element-context-outline", e.elementType);
|
|
6410
|
-
let o = this.opts.selectionColor ??
|
|
6684
|
+
let o = this.opts.selectionColor ?? rs;
|
|
6411
6685
|
a.style.cssText = `position:absolute;left:${r.rect.x - r.clip.x}px;top:${r.rect.y - r.clip.y}px;width:${r.rect.width}px;height:${r.rect.height}px;box-sizing:border-box;border:2px solid ${o};background:color-mix(in srgb, ${o} 6%, transparent);transform:rotate(${r.rotation}deg);transform-origin:center;pointer-events:none;`, i.appendChild(a), this.overlayHost.appendSelection(i);
|
|
6412
6686
|
}
|
|
6413
6687
|
maybeDrawValidationDropdown() {
|
|
6414
6688
|
if (this.validationArrowRect = null, this.selectionMode !== "cells") return;
|
|
6415
6689
|
let e = this.currentWorksheet, t = this.activeCell;
|
|
6416
|
-
if (!e || !t || !
|
|
6690
|
+
if (!e || !t || !Ba(e.dataValidations, t.row, t.col)) return;
|
|
6417
6691
|
let n = this.getCellRect(t.row, t.col);
|
|
6418
6692
|
if (!n) return;
|
|
6419
6693
|
let r = this.viewport.scale, i = Math.round(50 * r), a = Math.round(22 * r), o = Math.max(14, Math.min(n.h, 22 * r)), s = n.x + n.w, c = n.y;
|
|
@@ -6432,7 +6706,7 @@ var us = class {
|
|
|
6432
6706
|
this.overlayHost.clearFind();
|
|
6433
6707
|
let e = this.currentWorksheet;
|
|
6434
6708
|
if (!e) return;
|
|
6435
|
-
let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = $(e).roundedFrozenExtent(t), c = r + s.width, l = i + s.height, u =
|
|
6709
|
+
let t = this.viewport.scale, n = (e) => Math.round(e * t), r = n(50), i = n(22), a = e.freezeRows ?? 0, o = e.freezeCols ?? 0, s = $(e).roundedFrozenExtent(t), c = r + s.width, l = i + s.height, u = bs(!1, this.opts.findHighlightColors), d = bs(!0, this.opts.findHighlightColors);
|
|
6436
6710
|
for (let e of this._find.sheetHighlights(this.currentSheet)) {
|
|
6437
6711
|
let t = this.getCellRect(e.row, e.col);
|
|
6438
6712
|
if (!t) continue;
|
|
@@ -6484,7 +6758,7 @@ var us = class {
|
|
|
6484
6758
|
this.hideValidationPanel();
|
|
6485
6759
|
return;
|
|
6486
6760
|
}
|
|
6487
|
-
let r =
|
|
6761
|
+
let r = Ba(e.dataValidations, t.row, t.col);
|
|
6488
6762
|
r && (this.hideValidationPanel(), this.validationPanelKey = n, this.openValidationPanel(t, r.formula1));
|
|
6489
6763
|
}
|
|
6490
6764
|
async openValidationPanel(e, t) {
|
|
@@ -6529,7 +6803,7 @@ var us = class {
|
|
|
6529
6803
|
if (!t) return;
|
|
6530
6804
|
let n = this.screenX(t.x, t.w);
|
|
6531
6805
|
this.validationPanel.style.left = "-9999px", this.validationPanel.style.top = "-9999px", this.validationPanel.style.display = "block";
|
|
6532
|
-
let r =
|
|
6806
|
+
let r = Aa({
|
|
6533
6807
|
cell: {
|
|
6534
6808
|
x: n,
|
|
6535
6809
|
y: t.y,
|
|
@@ -6605,7 +6879,7 @@ var us = class {
|
|
|
6605
6879
|
}
|
|
6606
6880
|
this.commentPopupKey !== t && (this.hideCommentPopup(), this.commentPopupKey = t, this.commentPopupTimer = setTimeout(() => {
|
|
6607
6881
|
this.commentPopupTimer = null, this.renderCommentPopup(e, n);
|
|
6608
|
-
},
|
|
6882
|
+
}, Bo));
|
|
6609
6883
|
}
|
|
6610
6884
|
renderCommentPopup(e, t) {
|
|
6611
6885
|
let n = this.getCellRect(e.row, e.col);
|
|
@@ -6618,7 +6892,7 @@ var us = class {
|
|
|
6618
6892
|
r.textContent = t.text, this.commentPopup.appendChild(r);
|
|
6619
6893
|
let i = this.screenX(n.x, n.w);
|
|
6620
6894
|
this.commentPopup.style.left = "-9999px", this.commentPopup.style.top = "-9999px", this.commentPopup.style.display = "block";
|
|
6621
|
-
let a =
|
|
6895
|
+
let a = _o({
|
|
6622
6896
|
cell: {
|
|
6623
6897
|
x: i,
|
|
6624
6898
|
y: n.y,
|
|
@@ -6640,29 +6914,48 @@ var us = class {
|
|
|
6640
6914
|
hideCommentPopup() {
|
|
6641
6915
|
this.commentPopupTimer !== null && (clearTimeout(this.commentPopupTimer), this.commentPopupTimer = null), this.commentPopupKey = null, this.overlayHost.hideComment();
|
|
6642
6916
|
}
|
|
6643
|
-
applyPointerSelection(e, t, n, r, i) {
|
|
6644
|
-
let
|
|
6645
|
-
if (
|
|
6646
|
-
|
|
6917
|
+
applyPointerSelection(e, t, n, r, i, a) {
|
|
6918
|
+
let o = this.getHeaderHit(e, t);
|
|
6919
|
+
if (o) {
|
|
6920
|
+
if (o.kind === "corner") this.selectionController.select({
|
|
6647
6921
|
row: 1,
|
|
6648
6922
|
col: 1
|
|
6649
|
-
}, "all"), this.selectionController.endDrag()
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
}) : (this.selectionController.select({
|
|
6653
|
-
row: a.row,
|
|
6923
|
+
}, "all"), this.selectionController.endDrag();
|
|
6924
|
+
else if (o.kind === "row") if (n && this.anchorCell && this.selectionMode === "rows") this.selectionController.extend({
|
|
6925
|
+
row: o.row,
|
|
6654
6926
|
col: 1
|
|
6655
|
-
}
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6927
|
+
});
|
|
6928
|
+
else {
|
|
6929
|
+
let e = r ? this.selectionController.add({
|
|
6930
|
+
row: o.row,
|
|
6931
|
+
col: 1
|
|
6932
|
+
}, "rows") : (this.selectionController.select({
|
|
6933
|
+
row: o.row,
|
|
6934
|
+
col: 1
|
|
6935
|
+
}, "rows"), !0);
|
|
6936
|
+
a && e && (this.beginSelectionDrag(i), this.scrollHost.setPointerCapture(i));
|
|
6937
|
+
}
|
|
6938
|
+
else if (n && this.anchorCell && this.selectionMode === "cols") this.selectionController.extend({
|
|
6659
6939
|
row: 1,
|
|
6660
|
-
col:
|
|
6661
|
-
}
|
|
6940
|
+
col: o.col
|
|
6941
|
+
});
|
|
6942
|
+
else {
|
|
6943
|
+
let e = r ? this.selectionController.add({
|
|
6944
|
+
row: 1,
|
|
6945
|
+
col: o.col
|
|
6946
|
+
}, "cols") : (this.selectionController.select({
|
|
6947
|
+
row: 1,
|
|
6948
|
+
col: o.col
|
|
6949
|
+
}, "cols"), !0);
|
|
6950
|
+
a && e && (this.beginSelectionDrag(i), this.scrollHost.setPointerCapture(i));
|
|
6951
|
+
}
|
|
6952
|
+
this.updateSelectionOverlay(), this.renderCurrentSheet().catch((e) => this._reportRenderError(e)), this.emitSelectionChange();
|
|
6662
6953
|
return;
|
|
6663
6954
|
}
|
|
6664
|
-
let
|
|
6665
|
-
|
|
6955
|
+
let s = this.getCellAt(e, t);
|
|
6956
|
+
if (!s) return;
|
|
6957
|
+
let c = !0;
|
|
6958
|
+
n && this.anchorCell && this.selectionMode === "cells" ? this.selectionController.extend(s) : c = r ? this.selectionController.add(s, "cells") : (this.selectionController.select(s, "cells"), !0), a && c && (this.beginSelectionDrag(i), this.scrollHost.setPointerCapture(i)), this.updateSelectionOverlay(), this.wb && this.renderCurrentSheet().catch((e) => this._reportRenderError(e)), this.emitSelectionChange();
|
|
6666
6959
|
}
|
|
6667
6960
|
viewportInputBounds() {
|
|
6668
6961
|
let e = this.canvasArea.getBoundingClientRect(), t = e.left + this.scrollHost.clientLeft, n = e.top + this.scrollHost.clientTop, r = Math.max(0, e.width - this.scrollHost.clientLeft), i = Math.max(0, e.height - this.scrollHost.clientTop);
|
|
@@ -6703,7 +6996,7 @@ var us = class {
|
|
|
6703
6996
|
y: 0
|
|
6704
6997
|
};
|
|
6705
6998
|
let t = this.viewportInputBounds();
|
|
6706
|
-
return
|
|
6999
|
+
return Ro({
|
|
6707
7000
|
x: e.clientX - t.left,
|
|
6708
7001
|
y: e.clientY - t.top
|
|
6709
7002
|
}, {
|
|
@@ -6759,12 +7052,12 @@ var us = class {
|
|
|
6759
7052
|
if (r?.kind === "row") return n.areas.some((e) => e.kind === "sheet" || e.kind === "rows" && r.row >= e.firstRow && r.row <= e.lastRow);
|
|
6760
7053
|
if (r?.kind === "col") return n.areas.some((e) => e.kind === "sheet" || e.kind === "columns" && r.col >= e.firstColumn && r.col <= e.lastColumn);
|
|
6761
7054
|
let i = this.getCellAt(e, t);
|
|
6762
|
-
return i !== null && n.areas.some((e) =>
|
|
7055
|
+
return i !== null && n.areas.some((e) => lo(e, i));
|
|
6763
7056
|
}
|
|
6764
7057
|
resolveContextMenuContext(e) {
|
|
6765
7058
|
if (this._destroyed) return Promise.resolve(null);
|
|
6766
7059
|
let t = this.elementContextAt(e.clientX, e.clientY);
|
|
6767
|
-
t ? this.setElementContext(t) : (this.setElementContext(null), this.contextMenuTargetIsSelected(e.clientX, e.clientY) || this.applyPointerSelection(e.clientX, e.clientY, !1, -1, !1));
|
|
7060
|
+
t ? this.setElementContext(t) : (this.setElementContext(null), this.contextMenuTargetIsSelected(e.clientX, e.clientY) || this.applyPointerSelection(e.clientX, e.clientY, !1, !1, -1, !1));
|
|
6768
7061
|
let n = this.getSelectionContext();
|
|
6769
7062
|
return Promise.resolve(n ? structuredClone(n) : null);
|
|
6770
7063
|
}
|
|
@@ -6776,7 +7069,7 @@ var us = class {
|
|
|
6776
7069
|
getContext: () => t ??= this.resolveContextMenuContext(e)
|
|
6777
7070
|
});
|
|
6778
7071
|
}), this.surface.on("pointerdown", (e) => {
|
|
6779
|
-
if (this.scrollHost.
|
|
7072
|
+
if (this.scrollHost.focus?.({ preventScroll: !0 }), e.button !== 0 || this.isSelecting && e.pointerId !== this.selectionPointerId) return;
|
|
6780
7073
|
let t = this.opts.resizable ?? !0 ? this.getResizeTarget(e.clientX, e.clientY) : null;
|
|
6781
7074
|
if (t) {
|
|
6782
7075
|
e.preventDefault(), this.resizeDrag = {
|
|
@@ -6810,6 +7103,7 @@ var us = class {
|
|
|
6810
7103
|
x: e.clientX,
|
|
6811
7104
|
y: e.clientY,
|
|
6812
7105
|
shiftKey: e.shiftKey,
|
|
7106
|
+
additiveKey: e.ctrlKey || e.metaKey,
|
|
6813
7107
|
pointerId: e.pointerId
|
|
6814
7108
|
};
|
|
6815
7109
|
return;
|
|
@@ -6820,9 +7114,7 @@ var us = class {
|
|
|
6820
7114
|
y: e.clientY,
|
|
6821
7115
|
pointerId: e.pointerId,
|
|
6822
7116
|
cell: c
|
|
6823
|
-
} : null, this.applyPointerSelection(e.clientX, e.clientY, e.shiftKey, e.pointerId, !0);
|
|
6824
|
-
}), this.surface.on("blur", () => {
|
|
6825
|
-
this.scrollHost.removeAttribute("data-xlsx-pointer-focus");
|
|
7117
|
+
} : null, this.applyPointerSelection(e.clientX, e.clientY, e.shiftKey, e.ctrlKey || e.metaKey, e.pointerId, !0);
|
|
6826
7118
|
}), this.surface.on("pointermove", (e) => {
|
|
6827
7119
|
if (this.resizeDrag && this.resizeDrag.pointerId === e.pointerId) {
|
|
6828
7120
|
e.preventDefault(), this.applyResize(e.clientX, e.clientY);
|
|
@@ -6867,7 +7159,7 @@ var us = class {
|
|
|
6867
7159
|
if (this.pendingTap && this.pendingTap.pointerId === e.pointerId) {
|
|
6868
7160
|
let t = e.clientX - this.pendingTap.x, n = e.clientY - this.pendingTap.y;
|
|
6869
7161
|
if (t * t + n * n <= 64) {
|
|
6870
|
-
if (this.applyPointerSelection(e.clientX, e.clientY, this.pendingTap.shiftKey, e.pointerId, !1), e.pointerType !== "mouse" && this.activeCell) {
|
|
7162
|
+
if (this.applyPointerSelection(e.clientX, e.clientY, this.pendingTap.shiftKey, this.pendingTap.additiveKey, e.pointerId, !1), e.pointerType !== "mouse" && this.activeCell) {
|
|
6871
7163
|
let e = `${this.activeCell.row}:${this.activeCell.col}`, t = this.commentMap.get(e);
|
|
6872
7164
|
t ? (this.hideCommentPopup(), this.renderCommentPopup(this.activeCell, t)) : this.hideCommentPopup();
|
|
6873
7165
|
}
|
|
@@ -6958,12 +7250,12 @@ var us = class {
|
|
|
6958
7250
|
this.updateNavButtons();
|
|
6959
7251
|
}
|
|
6960
7252
|
tabStyle(e, t) {
|
|
6961
|
-
let n =
|
|
7253
|
+
let n = Go - 2, r = Go - 5, i = t ? `box-shadow:inset 0 -${e ? 2 : 3}px 0 0 ${t};` : "";
|
|
6962
7254
|
return e ? `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${n}px;font-size:13px;background:#fff;color:#000;border-bottom:1px solid #fff;font-weight:600;top:1px;` + i : `display:inline-block;flex:none;padding:0 14px;position:relative;border:1px solid #c8ccd0;border-bottom:none;border-radius:3px 3px 0 0;cursor:pointer;white-space:nowrap;max-width:160px;overflow:hidden;text-overflow:ellipsis;outline:none;box-sizing:border-box;height:${r}px;font-size:11px;background:#e0e0e0;color:#555;` + i;
|
|
6963
7255
|
}
|
|
6964
7256
|
tabCss(e, t) {
|
|
6965
7257
|
let n = this.tabStyle(t, this.tabColors[e]);
|
|
6966
|
-
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${
|
|
7258
|
+
return this._hiddenSheetMode !== "show" && this.wb?.isHidden(e) && (n += this._hiddenSheetMode === "skip" ? "display:none;" : `opacity:${Yo};`), n;
|
|
6967
7259
|
}
|
|
6968
7260
|
buildZoomControl() {
|
|
6969
7261
|
let e = this.opts.zoomMin ?? .1, t = this.opts.zoomMax ?? 4, n = this.viewport.scale, r = this.hostDocument.createElement("div");
|
|
@@ -7082,7 +7374,7 @@ var us = class {
|
|
|
7082
7374
|
freezeCols: s,
|
|
7083
7375
|
selectedRowRange: f,
|
|
7084
7376
|
selectedColRange: p
|
|
7085
|
-
}, h = this.wireSizeOverrides(), g =
|
|
7377
|
+
}, h = this.wireSizeOverrides(), g = Pa(h ? {
|
|
7086
7378
|
...m,
|
|
7087
7379
|
sizeOverrides: h.overrides
|
|
7088
7380
|
} : m, $(t).maximumDigitWidth, {
|
|
@@ -7095,7 +7387,7 @@ var us = class {
|
|
|
7095
7387
|
if (this._mode === "worker") {
|
|
7096
7388
|
let t = await this.workbook.renderViewportToBitmap(this.currentSheet, l, g);
|
|
7097
7389
|
if (!this.renderDispatcher.commitBitmap(e, t, n, r)) return;
|
|
7098
|
-
} else if (await this.workbook.renderViewport(this.canvas, this.currentSheet, l,
|
|
7390
|
+
} else if (await this.workbook.renderViewport(this.canvas, this.currentSheet, l, va(g, () => !this._destroyed && this.renderDispatcher.isCurrent(e))), !this.renderDispatcher.isCurrent(e) || this._destroyed) return;
|
|
7099
7391
|
this.renderGutters();
|
|
7100
7392
|
}
|
|
7101
7393
|
computeHeaderHighlight() {
|
|
@@ -7114,7 +7406,7 @@ var us = class {
|
|
|
7114
7406
|
destroy() {
|
|
7115
7407
|
if (this._destroyed) return;
|
|
7116
7408
|
this._destroyed = !0, this.selectionContextNotificationFrame !== null && (this.hostWindow.cancelAnimationFrame(this.selectionContextNotificationFrame), this.selectionContextNotificationFrame = null), this.selectionContextNotificationMicrotask = !1, this.stopSelectionAutoScroll(), this.sheetRequestGeneration++, this.resizeObserver?.disconnect(), this.renderDispatcher.destroy(), this.surface.destroy(), this.hideCommentPopup(), this.hideValidationPanel(), this._find.invalidate(), this.releaseHostFonts();
|
|
7117
|
-
let e = this.wb?.[
|
|
7409
|
+
let e = this.wb?.[La];
|
|
7118
7410
|
typeof e == "function" && e.call(this.wb, this.projectionId), this.currentWorksheet = null, this.elementContext = null, this.pendingElementClick = null, this.selectionController.reset(), this.lastNotifiedSelectionState = null, this.finishSelectionNotificationChain(), this.acquisition.destroy(), this.wrapper.remove();
|
|
7119
7411
|
}
|
|
7120
7412
|
assertOpen() {
|
|
@@ -7123,17 +7415,17 @@ var us = class {
|
|
|
7123
7415
|
destroyedError() {
|
|
7124
7416
|
return /* @__PURE__ */ Error(this._mountKind === "sheet" ? "XlsxSheetViewer is destroyed" : "XlsxViewer is destroyed");
|
|
7125
7417
|
}
|
|
7126
|
-
},
|
|
7418
|
+
}, Ss = class e extends xs {
|
|
7127
7419
|
static fromWorkbook(t, n, r = {}) {
|
|
7128
7420
|
return new e(t, {
|
|
7129
7421
|
...r,
|
|
7130
|
-
[
|
|
7422
|
+
[zo]: n
|
|
7131
7423
|
});
|
|
7132
7424
|
}
|
|
7133
7425
|
constructor(e, t = {}) {
|
|
7134
7426
|
super(e, t, { kind: "composite" });
|
|
7135
7427
|
}
|
|
7136
|
-
},
|
|
7428
|
+
}, Cs = class e {
|
|
7137
7429
|
engine;
|
|
7138
7430
|
canvasMount;
|
|
7139
7431
|
destroyed = !1;
|
|
@@ -7142,16 +7434,16 @@ var us = class {
|
|
|
7142
7434
|
static fromWorkbook(t, n, r = {}) {
|
|
7143
7435
|
return new e(t, {
|
|
7144
7436
|
...r,
|
|
7145
|
-
[
|
|
7437
|
+
[zo]: n
|
|
7146
7438
|
});
|
|
7147
7439
|
}
|
|
7148
7440
|
constructor(e, t = {}) {
|
|
7149
7441
|
this.canvasElement = e;
|
|
7150
|
-
let n = t[
|
|
7442
|
+
let n = t[zo], r = Oe("XlsxSheetViewer", t.mode, n), i = e.getBoundingClientRect();
|
|
7151
7443
|
this.canvasMount = new je(e, {
|
|
7152
7444
|
wrapperCssText: `position:relative;display:inline-block;vertical-align:top;overflow:hidden;width:${e.style.width || `${i.width || e.width}px`};height:${e.style.height || `${i.height || e.height}px`};`,
|
|
7153
7445
|
restoreMode: "style-and-bitmap"
|
|
7154
|
-
}), this.engine = new
|
|
7446
|
+
}), this.engine = new xs(this.canvasMount.wrapper, {
|
|
7155
7447
|
...t,
|
|
7156
7448
|
onResourceMetrics: (e) => {
|
|
7157
7449
|
this.lastMetrics = e, t.onResourceMetrics?.(e);
|
|
@@ -7308,20 +7600,20 @@ var us = class {
|
|
|
7308
7600
|
destroyedError() {
|
|
7309
7601
|
return /* @__PURE__ */ Error("XlsxSheetViewer is destroyed");
|
|
7310
7602
|
}
|
|
7311
|
-
},
|
|
7603
|
+
}, ws = /* @__PURE__ */ e({
|
|
7312
7604
|
MAX_SELECTION_AREAS: () => 128,
|
|
7313
|
-
MAX_SELECTION_CONTEXT_CELLS: () =>
|
|
7314
|
-
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () =>
|
|
7605
|
+
MAX_SELECTION_CONTEXT_CELLS: () => io,
|
|
7606
|
+
MAX_SELECTION_CONTEXT_TEXT_CHARACTERS: () => ao,
|
|
7315
7607
|
OoxmlDecodedImageLimitError: () => l,
|
|
7316
7608
|
OoxmlError: () => L,
|
|
7317
|
-
OoxmlResourceLimitError: () =>
|
|
7318
|
-
XlsxSheetViewer: () =>
|
|
7319
|
-
XlsxViewer: () =>
|
|
7320
|
-
XlsxWorkbook: () =>
|
|
7609
|
+
OoxmlResourceLimitError: () => P,
|
|
7610
|
+
XlsxSheetViewer: () => Cs,
|
|
7611
|
+
XlsxViewer: () => Ss,
|
|
7612
|
+
XlsxWorkbook: () => Ra,
|
|
7321
7613
|
autoResize: () => Pe,
|
|
7322
7614
|
isOoxmlDecodedImageLimitError: () => f,
|
|
7323
7615
|
openExternalHyperlink: () => E,
|
|
7324
7616
|
resolveSharedStrings: () => Je
|
|
7325
7617
|
});
|
|
7326
7618
|
//#endregion
|
|
7327
|
-
export {
|
|
7619
|
+
export { io as a, ro as i, Cs as n, ao as o, Ss as r, Ra as s, ws as t };
|