@sheetxl/studio-mui 0.1.98
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/LICENSE.md +11 -0
- package/README.md +24 -0
- package/build/browser/cjs/4XrhSt2xtUIXkiCt.cjs +1516 -0
- package/build/browser/cjs/B3EvhaQf456RMc1Q.cjs +6 -0
- package/build/browser/cjs/B3kl467PN2cpvrfz.cjs +12 -0
- package/build/browser/cjs/B5LCoenQbQmzic16.cjs +314 -0
- package/build/browser/cjs/BBuyHZwFlDRvHzBH.cjs +7 -0
- package/build/browser/cjs/BGoG_ROASNB2owBR.cjs +28 -0
- package/build/browser/cjs/BJ6Da8vZLjAl44pz.cjs +6 -0
- package/build/browser/cjs/BL_UVvG75SFsFaT3.cjs +6 -0
- package/build/browser/cjs/BNDoTytIOGtVh5l9.cjs +6 -0
- package/build/browser/cjs/BQOyVCuOdwDja_VV.cjs +42 -0
- package/build/browser/cjs/BRiPktKUmeJipjaa.cjs +6 -0
- package/build/browser/cjs/BabbNVs5iKg49rfk.cjs +6 -0
- package/build/browser/cjs/BcOX5vODdThWbKrR.cjs +6 -0
- package/build/browser/cjs/BchlMljYmXDs0Ol2.cjs +6 -0
- package/build/browser/cjs/BmYZvm13acvbFhOu.cjs +6 -0
- package/build/browser/cjs/BmbsW1n0-CkF3ITF.cjs +6 -0
- package/build/browser/cjs/BnCUyGP_ERKmL3ZR.cjs +6 -0
- package/build/browser/cjs/BtP4E1_yhMjpfbr5.cjs +6 -0
- package/build/browser/cjs/C3E9wmSfmgYmXfJN.cjs +205 -0
- package/build/browser/cjs/C3Hl78e9qfEHxJYc.cjs +6 -0
- package/build/browser/cjs/CEvRH8aOx3etutK_.cjs +17 -0
- package/build/browser/cjs/CLZSdaBnKDfb142R.cjs +6 -0
- package/build/browser/cjs/CN1cS39WcNrcPVqS.cjs +129 -0
- package/build/browser/cjs/CSH1hUnHovjo8Lb8.cjs +6 -0
- package/build/browser/cjs/CTNt3asYQRA-MROc.cjs +47 -0
- package/build/browser/cjs/C_JZEtvgcli6T7Wg.cjs +11 -0
- package/build/browser/cjs/CbaYZmvS8u-p_Z8Z.cjs +6 -0
- package/build/browser/cjs/Cc-4c3DRm96wq5rj.cjs +12 -0
- package/build/browser/cjs/CnY6DbatGmPyylfU.cjs +20 -0
- package/build/browser/cjs/CqkQGfzNax6GmZFo.cjs +6 -0
- package/build/browser/cjs/D2AF0a4vbNKzFxzA.cjs +21 -0
- package/build/browser/cjs/D4y1iYdx8sdwQ50T.cjs +6 -0
- package/build/browser/cjs/D5cF1EnyvnPY2IxS.cjs +150 -0
- package/build/browser/cjs/DA1-OPTYQTepGKEg.cjs +11 -0
- package/build/browser/cjs/DJDMVDpUqlEKYLjt.cjs +6 -0
- package/build/browser/cjs/DLXLJ8SNNjwM5C-P.cjs +6 -0
- package/build/browser/cjs/DV8lOsZBgyx7MTBW.cjs +6 -0
- package/build/browser/cjs/DZAPn_d9mpvfRzsb.cjs +6 -0
- package/build/browser/cjs/DaicqO_9d1hYzyB_.cjs +11 -0
- package/build/browser/cjs/Dfh6eMCbAjW14fdh.cjs +6 -0
- package/build/browser/cjs/DhI2lgDZL8GqBejN.cjs +6 -0
- package/build/browser/cjs/Ds6s8fpzOZsd2m1r.cjs +6 -0
- package/build/browser/cjs/DvIWGmDT5uBVQ5zH.cjs +16 -0
- package/build/browser/cjs/DvLgu20RiaayrJcW.cjs +7 -0
- package/build/browser/cjs/Dvhwt25gyHzxQLrp.cjs +6 -0
- package/build/browser/cjs/DvwApJM_CVrlpLxn.cjs +6 -0
- package/build/browser/cjs/DwVYzo4a05DMfta_.cjs +28 -0
- package/build/browser/cjs/NYdqUauA5i2q33UZ.cjs +6 -0
- package/build/browser/cjs/S2Xfq-KDgoT7ipPC.cjs +25 -0
- package/build/browser/cjs/TOZQZr9ZZ_Q-jdQZ.cjs +6 -0
- package/build/browser/cjs/bJuLOalXTwrshZL3.cjs +16 -0
- package/build/browser/cjs/eh9refYW4Gm25cmW.cjs +6 -0
- package/build/browser/cjs/hKqcVeb_8_4M79xj.cjs +6 -0
- package/build/browser/cjs/index.cjs +7 -0
- package/build/browser/cjs/is17hbP-kpOIBRP3.cjs +6 -0
- package/build/browser/cjs/pNY789kHWwRQXqse.cjs +17 -0
- package/build/browser/cjs/qJcc3ALtLWml32LU.cjs +18 -0
- package/build/browser/cjs/vWgVoELLfZ2ff1xL.cjs +6 -0
- package/build/browser/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
- package/build/browser/esm/7Imk0owJj7oNHR7v.mjs +48 -0
- package/build/browser/esm/AuNwPf0DXe0twn35.mjs +1592 -0
- package/build/browser/esm/B1Kw9U_AxCk0Aq9f.mjs +59 -0
- package/build/browser/esm/B9l1_Tfw_tMhKCNB.mjs +437 -0
- package/build/browser/esm/B9winT3ff8rc4sbn.mjs +490 -0
- package/build/browser/esm/BEo9XX1sHmVjScSm.mjs +16 -0
- package/build/browser/esm/BGTcOBCyrTTlov_i.mjs +13399 -0
- package/build/browser/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
- package/build/browser/esm/BQSa7N7QMGysdZdU.mjs +3932 -0
- package/build/browser/esm/BVEuc_3fLG2GN34k.mjs +16 -0
- package/build/browser/esm/BVh9YUwiSov8wcyY.mjs +1708 -0
- package/build/browser/esm/BZt5yM_TvoPXqdeA.mjs +3867 -0
- package/build/browser/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
- package/build/browser/esm/BjUaiSvRZnas-HJW.mjs +16 -0
- package/build/browser/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
- package/build/browser/esm/BtMqJ5CRpKuAC4UQ.mjs +1486 -0
- package/build/browser/esm/BwvMR2cgGwFn8hAL.mjs +36 -0
- package/build/browser/esm/BxU3eVA-Adrnq7ZJ.mjs +1372 -0
- package/build/browser/esm/C00coampLNiXjWJJ.mjs +436 -0
- package/build/browser/esm/C6nh1rvYnAg2w2V2.mjs +838 -0
- package/build/browser/esm/C8gc149K34Zi2lP2.mjs +16 -0
- package/build/browser/esm/CGSkuCZY1EmTUNlQ.mjs +52 -0
- package/build/browser/esm/CKXzosgZX8Xe3l59.mjs +16 -0
- package/build/browser/esm/CNYANG0Z7mhGYo00.mjs +859 -0
- package/build/browser/esm/CV_FNw2i_aEc5nwA.mjs +16 -0
- package/build/browser/esm/CYSj0-zys2FKWgnb.mjs +18 -0
- package/build/browser/esm/CbTs5cvVaP1vPCYD.mjs +2248 -0
- package/build/browser/esm/CfAob8gGydmX1xQu.mjs +16 -0
- package/build/browser/esm/ChGigf2OPu7d44Km.mjs +16 -0
- package/build/browser/esm/CnzGN0S6zOfL_3SS.mjs +1358 -0
- package/build/browser/esm/CpyeUtXgDmrcMESB.mjs +52 -0
- package/build/browser/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
- package/build/browser/esm/CtrrmHx9YbrOithw.mjs +152 -0
- package/build/browser/esm/CzAM0pDdZ7sjGgn9.mjs +86 -0
- package/build/browser/esm/D0oVDcgRUMZ9MHzu.mjs +41 -0
- package/build/browser/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
- package/build/browser/esm/D78-3ghInxscHLVq.mjs +23 -0
- package/build/browser/esm/DEpR6b4DMs-va6RS.mjs +43734 -0
- package/build/browser/esm/DEsqE49cIQZ8AqCe.mjs +398 -0
- package/build/browser/esm/DGe70xvBhc62ZVZz.mjs +2410 -0
- package/build/browser/esm/DXapJ5_yR4E8vDaK.mjs +1685 -0
- package/build/browser/esm/DjAZeDxBIBZsRTm3.mjs +24 -0
- package/build/browser/esm/DttdPwwDTcRX4uwL.mjs +44 -0
- package/build/browser/esm/FXcO0MVElhw9cc3v.mjs +49 -0
- package/build/browser/esm/GpycqJcrwTRtjEqA.mjs +16 -0
- package/build/browser/esm/HCE-tMxyVd0m-PgN.mjs +16 -0
- package/build/browser/esm/OCdyQRicV8KxUwMt.mjs +16 -0
- package/build/browser/esm/UukTgmLv7or2mhlB.mjs +16 -0
- package/build/browser/esm/_cuE13TWr3oEoKGP.mjs +34 -0
- package/build/browser/esm/aIlK3Ybu-1T4WHPv.mjs +640 -0
- package/build/browser/esm/bFSkTthAEOn7gv5x.mjs +16 -0
- package/build/browser/esm/bOhN6up-rdLRp82s.mjs +5588 -0
- package/build/browser/esm/index.mjs +85 -0
- package/build/browser/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
- package/build/browser/esm/o6U2z4gZ7GE4QKZD.mjs +16 -0
- package/build/browser/esm/psav3cvsBQQczhPL.mjs +16 -0
- package/build/browser/esm/vn0iS301yg2hAbYd.mjs +51 -0
- package/build/licenses/dependencies.txt +1341 -0
- package/build/node/assets/style.css +1 -0
- package/build/node/esm/2kwF7RVUWBY1zsgG.mjs +16 -0
- package/build/node/esm/B-Xlyl81h27-bnvO.mjs +16 -0
- package/build/node/esm/B1_NYsn5D8x9QedP.mjs +307 -0
- package/build/node/esm/BCA5bxOeDA8k1Bm1.mjs +16 -0
- package/build/node/esm/BEo9XX1sHmVjScSm.mjs +16 -0
- package/build/node/esm/BIfdVpnJR1TZwCPR.mjs +1378 -0
- package/build/node/esm/BIqDzNJtkm-dyH0v.mjs +154 -0
- package/build/node/esm/BMGddfMXtKQ9AXQS.mjs +16 -0
- package/build/node/esm/BUOdfqhtCh8lhOhm.mjs +4000 -0
- package/build/node/esm/BYbE15S73xgn7S5E.mjs +88 -0
- package/build/node/esm/BfU8KdaB9wrEPWM-.mjs +16 -0
- package/build/node/esm/BkyivirgeiDKFSjk.mjs +16 -0
- package/build/node/esm/Bm1RqNJ-XvHpJW9z.mjs +831 -0
- package/build/node/esm/BqiVaoAYJJqPrCUZ.mjs +16 -0
- package/build/node/esm/Bx-30HInllXS7M_J.mjs +41 -0
- package/build/node/esm/Bx3lQBEvcqhxffT-.mjs +1726 -0
- package/build/node/esm/BxsKlaBFnb5wNq6R.mjs +53 -0
- package/build/node/esm/C4PMhNAV0KpPsKFj.mjs +24 -0
- package/build/node/esm/C7x3L6HtPhZjSrrZ.mjs +471 -0
- package/build/node/esm/C8gc149K34Zi2lP2.mjs +16 -0
- package/build/node/esm/CK-kn1p9NGRVM_h7.mjs +16 -0
- package/build/node/esm/CKR6snAwSONs7kfL.mjs +19 -0
- package/build/node/esm/CKXzosgZX8Xe3l59.mjs +16 -0
- package/build/node/esm/CLE_RHHvsDeoZ9Zd.mjs +561 -0
- package/build/node/esm/CMKci_5THkcJ-w9a.mjs +80 -0
- package/build/node/esm/CVU9bu6AnxcgkEwq.mjs +13466 -0
- package/build/node/esm/CfAob8gGydmX1xQu.mjs +16 -0
- package/build/node/esm/ChGigf2OPu7d44Km.mjs +16 -0
- package/build/node/esm/CkvkuPSf4R_DqArg.mjs +5648 -0
- package/build/node/esm/CnBMj0oJAyr9ZbjP.mjs +23 -0
- package/build/node/esm/CrEGjvQKhAcdw5sY.mjs +16 -0
- package/build/node/esm/Crx9i_8dm3OQsk_T.mjs +28 -0
- package/build/node/esm/CwUulbiMQH11aF4x.mjs +16 -0
- package/build/node/esm/D0Lh0V1tkdJPxZnI.mjs +392 -0
- package/build/node/esm/D54Fpmnd9MzCzp-Z.mjs +16 -0
- package/build/node/esm/D5bg3v_W8K9MVp0j.mjs +1711 -0
- package/build/node/esm/D8F08tiG98tM_voL.mjs +16 -0
- package/build/node/esm/DR7o1DOIK9zdiBgS.mjs +50 -0
- package/build/node/esm/DYEgm2kd3haV-Ml8.mjs +1246 -0
- package/build/node/esm/DfzhmhZ4I0Zurcqn.mjs +44 -0
- package/build/node/esm/Dg_ERnlsy5hwbzMA.mjs +1498 -0
- package/build/node/esm/Dt4cj_0sWgvt4FGj.mjs +92 -0
- package/build/node/esm/GpycqJcrwTRtjEqA.mjs +16 -0
- package/build/node/esm/LlkIFFfAjLiQ5Or6.mjs +3840 -0
- package/build/node/esm/OCdyQRicV8KxUwMt.mjs +16 -0
- package/build/node/esm/QATDL2FGAYcVnd33.mjs +49 -0
- package/build/node/esm/SvgA2TyqJYOzheuf.mjs +26 -0
- package/build/node/esm/VZ150KIUh5JVRqpk.mjs +52 -0
- package/build/node/esm/XRLHatWlgABiuBDS.mjs +52 -0
- package/build/node/esm/bFSkTthAEOn7gv5x.mjs +16 -0
- package/build/node/esm/index.mjs +44754 -0
- package/build/node/esm/lgtVRbg712G5Ba-x.mjs +60 -0
- package/build/node/esm/ng3JdG4_hi9SgtHk.mjs +16 -0
- package/build/node/esm/psav3cvsBQQczhPL.mjs +16 -0
- package/build/node/esm/zWnN2OzbhzCc6T7u.mjs +86 -0
- package/build/package.json +84 -0
- package/build/types/index.d.ts +1848 -0
- package/package.json +100 -0
|
@@ -0,0 +1,1711 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.0.0
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
import { ay as t, ab as e, ah as s, a as r, ac as o, az as i, aA as n, aB as l, l as a, n as c, aC as u } from "./index.mjs";
|
|
8
|
+
import { c as h, b as p, r as g, t as d, a as m, p as b, d as f } from "./Dg_ERnlsy5hwbzMA.mjs";
|
|
9
|
+
/**
|
|
10
|
+
* @license @sheetxl/io - IO - Import/Export Libraries for SheetXL. - v0.0.0
|
|
11
|
+
*
|
|
12
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
13
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
14
|
+
*/
|
|
15
|
+
class A {
|
|
16
|
+
constructor(t2) {
|
|
17
|
+
this.list = t2;
|
|
18
|
+
}
|
|
19
|
+
get length() {
|
|
20
|
+
return this.list.length;
|
|
21
|
+
}
|
|
22
|
+
item(t2) {
|
|
23
|
+
return this.list[t2];
|
|
24
|
+
}
|
|
25
|
+
forEach(t2, e2) {
|
|
26
|
+
for (let e3 = 0; e3 < this.list.length; e3++) t2(this.list[e3], e3, this);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const y = (t2) => true === t2 || "1" === t2 || "on" === t2 || "true" === t2 || false !== t2 && "0" !== t2 && "off" !== t2 && "false" !== t2 && null, v = (t2) => {
|
|
30
|
+
const e2 = parseInt(t2);
|
|
31
|
+
return isNaN(e2) ? null : e2;
|
|
32
|
+
}, F = (t2) => {
|
|
33
|
+
const e2 = parseFloat(t2);
|
|
34
|
+
return isNaN(e2) ? null : e2;
|
|
35
|
+
}, C = /* @__PURE__ */ new Map();
|
|
36
|
+
class w {
|
|
37
|
+
constructor(t2, e2, s2, r2, o2, i2 = null, n2) {
|
|
38
|
+
const l2 = (t3, e3, s3) => n2?.getRef?.(t3, e3, s3, n2?.parsedRefs), a2 = (t3) => n2?.getRefs?.(t3, n2?.parsedRefs);
|
|
39
|
+
this._parent = t2, this.sharedShared = e2, this.currentPath = s2, this.elemRoot = r2, this.jsonRoot = o2, t2 ? (this._fileLocation = t2._fileLocation, this._getRef = t2._getRef, this._getRefs = t2._getRefs) : (i2 && (this._fileLocation = i2), l2 && a2 && (this._getRef = l2), a2 && (this._getRefs = a2), this._onWarning = n2?.onWarning, this._addPerson = n2?.addPerson);
|
|
40
|
+
}
|
|
41
|
+
getRef(t2, e2 = false) {
|
|
42
|
+
return this._getRef?.(t2, this._fileLocation, e2) ?? null;
|
|
43
|
+
}
|
|
44
|
+
getRelationships() {
|
|
45
|
+
return this._getRefs(this._fileLocation) ?? C;
|
|
46
|
+
}
|
|
47
|
+
getPath() {
|
|
48
|
+
return this.currentPath;
|
|
49
|
+
}
|
|
50
|
+
getElemRoot() {
|
|
51
|
+
return this.elemRoot;
|
|
52
|
+
}
|
|
53
|
+
getJsonRoot() {
|
|
54
|
+
return this.jsonRoot;
|
|
55
|
+
}
|
|
56
|
+
warn(t2) {
|
|
57
|
+
this._onWarning ? this._onWarning(t2) : this._parent ? this._parent?.warn?.(t2) : console.warn(t2);
|
|
58
|
+
}
|
|
59
|
+
addPerson(t2) {
|
|
60
|
+
return this._addPerson ? this._addPerson(t2) : this._parent ? this._parent?._addPerson?.(t2) : null;
|
|
61
|
+
}
|
|
62
|
+
getVisitorParamsState() {
|
|
63
|
+
return this.sharedShared.getVisitorParamsState();
|
|
64
|
+
}
|
|
65
|
+
evaluate(t2, e2) {
|
|
66
|
+
if (!t2) return e2;
|
|
67
|
+
let s2 = [e2];
|
|
68
|
+
const r2 = t2.split("/");
|
|
69
|
+
for (let t3 = 0; t3 < r2.length; t3++) {
|
|
70
|
+
const e3 = r2[t3];
|
|
71
|
+
if ("" === e3 || "." === e3) continue;
|
|
72
|
+
let o2 = [];
|
|
73
|
+
for (let t4 = 0; t4 < s2.length; t4++) {
|
|
74
|
+
const r3 = s2[t4], i2 = r3.childNodes;
|
|
75
|
+
for (let t5 = 0; i2 && t5 < i2.length; t5++) {
|
|
76
|
+
const s3 = r3.childNodes[t5];
|
|
77
|
+
s3.localName !== e3 && "*" !== e3 || o2.push(s3);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
s2 = o2;
|
|
81
|
+
}
|
|
82
|
+
return 1 === s2.length ? s2[0] : 0 === s2.length ? null : new A(s2);
|
|
83
|
+
}
|
|
84
|
+
getFromPath(t2, e2) {
|
|
85
|
+
return c.getFromPath(t2, e2);
|
|
86
|
+
}
|
|
87
|
+
setToPath(t2, e2, s2) {
|
|
88
|
+
return c.setToPath(t2, e2, s2);
|
|
89
|
+
}
|
|
90
|
+
getValAttrAsString(t2, e2) {
|
|
91
|
+
let s2 = this.evaluate(t2, e2);
|
|
92
|
+
return s2 && s2.hasAttribute("val") ? s2.getAttribute("val") ?? null : null;
|
|
93
|
+
}
|
|
94
|
+
getValAttrAsBoolean(t2, e2, s2 = false) {
|
|
95
|
+
let r2 = this.evaluate(t2, e2);
|
|
96
|
+
if (!r2) return null;
|
|
97
|
+
const o2 = r2.hasAttribute("val") ? r2.getAttribute("val") : void 0;
|
|
98
|
+
return null == o2 ? s2 : "1" === o2 || "on" === o2 || "true" === o2 || "0" !== o2 && "off" !== o2 && "false" !== o2 && s2;
|
|
99
|
+
}
|
|
100
|
+
getValAttrAsInteger(t2, e2) {
|
|
101
|
+
let s2 = this.evaluate(t2, e2);
|
|
102
|
+
return s2 && s2.hasAttribute("val") ? parseInt(s2.getAttribute("val")) ?? null : null;
|
|
103
|
+
}
|
|
104
|
+
getValAttrAsFloat(t2, e2) {
|
|
105
|
+
let s2 = this.evaluate(t2, e2);
|
|
106
|
+
return s2 && s2.hasAttribute("val") ? parseFloat(s2.getAttribute("val")) ?? null : null;
|
|
107
|
+
}
|
|
108
|
+
get BOOLEAN_COPY() {
|
|
109
|
+
return y;
|
|
110
|
+
}
|
|
111
|
+
get INT_COPY() {
|
|
112
|
+
return v;
|
|
113
|
+
}
|
|
114
|
+
get FLOAT_COPY() {
|
|
115
|
+
return F;
|
|
116
|
+
}
|
|
117
|
+
copyFromAttribute(t2, e2, s2, r2 = e2, o2 = null) {
|
|
118
|
+
if (!t2 || !s2 || !t2.hasAttribute(e2)) return;
|
|
119
|
+
let i2 = t2.getAttribute(e2);
|
|
120
|
+
if (o2) if (Array.isArray(o2)) for (let t3 = 0; t3 < o2.length; t3++) {
|
|
121
|
+
if (null == i2) return;
|
|
122
|
+
if (i2 = o2[t3](i2), null == i2) return;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
if (null == i2) return;
|
|
126
|
+
if (i2 = o2(i2), null == i2) return;
|
|
127
|
+
}
|
|
128
|
+
this.setToPath(s2, r2, i2);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
class P {
|
|
132
|
+
constructor(t2) {
|
|
133
|
+
this.jsonKey = t2;
|
|
134
|
+
}
|
|
135
|
+
visit(t2, e2, s2) {
|
|
136
|
+
const r2 = {};
|
|
137
|
+
return s2[this.jsonKey] = r2, r2;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
class N {
|
|
141
|
+
visit(t2, e2, s2) {
|
|
142
|
+
if (!e2) return;
|
|
143
|
+
const r2 = e2.childNodes;
|
|
144
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
145
|
+
const o2 = r2.item(e3);
|
|
146
|
+
1 === o2.nodeType && "Relationship" === o2.localName && this.processRelationship(t2, o2, s2);
|
|
147
|
+
}
|
|
148
|
+
return s2;
|
|
149
|
+
}
|
|
150
|
+
processRelationship(t2, e2, s2) {
|
|
151
|
+
const r2 = {};
|
|
152
|
+
t2.copyFromAttribute(e2, "Target", r2, "target"), t2.copyFromAttribute(e2, "Type", r2, "type"), t2.copyFromAttribute(e2, "TargetMode", r2, "targetMode"), s2[e2.getAttribute("Id")] = r2;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const O = (t2, e2) => {
|
|
156
|
+
if (t2 || !t2.hasAttribute("rot")) return;
|
|
157
|
+
const s2 = t2.getAttribute("rot"), r2 = c.roundAccurately(b(s2), 2);
|
|
158
|
+
-1e3 !== r2 && (e2.rotation = r2);
|
|
159
|
+
}, T = (t2, e2, s2, r2, o2) => {
|
|
160
|
+
const i2 = t2.getValAttrAsString(r2, e2);
|
|
161
|
+
null !== i2 && (s2[o2] = i2);
|
|
162
|
+
}, V = (t2, e2, s2, r2, o2 = r2, i2 = null) => {
|
|
163
|
+
const n2 = t2.getValAttrAsBoolean(r2, e2, i2);
|
|
164
|
+
null !== n2 && (s2[o2] = n2);
|
|
165
|
+
}, S = (t2, e2, s2, r2, o2) => {
|
|
166
|
+
const i2 = t2.getValAttrAsInteger(r2, e2);
|
|
167
|
+
null !== i2 && (s2[o2] = i2);
|
|
168
|
+
}, x = (t2, e2, s2, r2, o2, i2 = 1) => {
|
|
169
|
+
const n2 = t2.getValAttrAsFloat(r2, e2);
|
|
170
|
+
null !== n2 && (s2[o2] = n2 * i2);
|
|
171
|
+
};
|
|
172
|
+
class k {
|
|
173
|
+
visit(t2, e2, s2) {
|
|
174
|
+
return V(t2, e2, s2, "roundedCorners", "roundedCorners"), S(t2, e2, s2, ".//AlternateContent/Fallback/style", "styleId"), s2.range = null, s2;
|
|
175
|
+
}
|
|
176
|
+
afterVisit(t2, e2, s2) {
|
|
177
|
+
let r2 = {};
|
|
178
|
+
s2.types = r2;
|
|
179
|
+
let o2 = {}, i2 = 0, n2 = {}, l2 = 0, a2 = t2.getVisitorParamsState().get("axes");
|
|
180
|
+
const c2 = t2.getVisitorParamsState().get("types");
|
|
181
|
+
for (let t3 = 0; t3 < c2.length; t3++) {
|
|
182
|
+
const e3 = c2[t3];
|
|
183
|
+
if (e3.xAxisId) {
|
|
184
|
+
const r3 = e3.xAxisId, n3 = a2.get(r3);
|
|
185
|
+
o2[t3 + ""] = n3, e3.offsetXAxis = t3, delete e3.xAxisId, s2.xAxes = o2, o2.length = ++i2;
|
|
186
|
+
}
|
|
187
|
+
if (e3.yAxisId) {
|
|
188
|
+
const r3 = e3.yAxisId, o3 = a2.get(r3);
|
|
189
|
+
n2[t3 + ""] = o3, e3.offsetYAxis = t3, delete e3.yAxisId, s2.yAxes = n2, n2.length = ++l2;
|
|
190
|
+
}
|
|
191
|
+
r2[t3 + ""] = e3;
|
|
192
|
+
}
|
|
193
|
+
r2.length = c2.length;
|
|
194
|
+
const u2 = t2.getVisitorParamsState().get("series");
|
|
195
|
+
if (!u2 || 0 === u2.length) return;
|
|
196
|
+
const h2 = {};
|
|
197
|
+
s2.series = h2;
|
|
198
|
+
for (let t3 = 0; t3 < u2.length; t3++) h2[t3 + ""] = u2[t3];
|
|
199
|
+
h2.length = u2.length;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
class L {
|
|
203
|
+
visit(t2, e2, s2) {
|
|
204
|
+
return V(t2, e2, s2, "plotVisOnly", "plotVisOnly"), T(t2, e2, s2, "dispBlanksAs", "dispBlanksAs"), V(t2, e2, s2, ".//extLst/ext/dataDisplayOptions16/dispNaAsBlank", "dispNaAsBlank"), V(t2, e2, s2, "showDLblsOverMax", "showDLblsOverMax"), s2;
|
|
205
|
+
}
|
|
206
|
+
afterVisit(t2, e2, s2) {
|
|
207
|
+
try {
|
|
208
|
+
const r2 = t2.getValAttrAsBoolean("autoTitleDeleted", e2), o2 = t2.evaluate("title", e2);
|
|
209
|
+
t2.setToPath(s2, "title.shown", !(true === r2 || !o2));
|
|
210
|
+
const i2 = t2.evaluate("legend", e2);
|
|
211
|
+
t2.setToPath(s2, "legend.shown", null !== i2);
|
|
212
|
+
} catch (t3) {
|
|
213
|
+
throw new Error("Unexpected Error parsing Chart: " + t3);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
class I {
|
|
218
|
+
visit(t2, e2, s2) {
|
|
219
|
+
let r2 = {};
|
|
220
|
+
return s2.plotArea = r2, r2;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
class B {
|
|
224
|
+
EnumMappings() {
|
|
225
|
+
}
|
|
226
|
+
static fromOoxmlGradientType(t2) {
|
|
227
|
+
return "circle" === t2 ? "radial" : t2;
|
|
228
|
+
}
|
|
229
|
+
static fromOoxmlLineCap(t2) {
|
|
230
|
+
if ("rnd" === t2) return "round";
|
|
231
|
+
if ("flat" === t2) return "butt";
|
|
232
|
+
if ("sq" === t2) return "square";
|
|
233
|
+
throw new Error("Invalid lineCap type: " + t2);
|
|
234
|
+
}
|
|
235
|
+
static fromOoxmlCompound(t2) {
|
|
236
|
+
return "sng" === t2 ? "single" : t2;
|
|
237
|
+
}
|
|
238
|
+
static fromOoxmlAlignment(t2) {
|
|
239
|
+
return "ctr" === t2 ? "center" : t2;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
class _ {
|
|
243
|
+
visit(t2, e2, s2) {
|
|
244
|
+
}
|
|
245
|
+
processStroke(t2, e2, s2) {
|
|
246
|
+
const r2 = {}, o2 = t2.evaluate("ln", e2);
|
|
247
|
+
if (o2) {
|
|
248
|
+
o2.hasAttribute("algn") && (r2.align = B.fromOoxmlAlignment(o2.getAttribute("algn"))), o2.hasAttribute("cap") && (r2.lineCap = B.fromOoxmlLineCap(o2.getAttribute("cap"))), o2.hasAttribute("cmpd") && (r2.compound = B.fromOoxmlCompound(o2.getAttribute("cmpd"))), o2.hasAttribute("w") && (r2.width = d(o2.getAttribute("w")));
|
|
249
|
+
const e3 = t2.evaluate("miter", o2);
|
|
250
|
+
e3 && (r2.lineJoin = "miter", e3.hasAttribute("lim") && (r2.miter = parseFloat(e3.getAttribute("lim")))), t2.evaluate("bevel", o2) && (r2.lineJoin = "bevel"), t2.evaluate("round", o2) && (r2.lineJoin = "round");
|
|
251
|
+
const i2 = t2.evaluate("custDash", o2);
|
|
252
|
+
if (i2) {
|
|
253
|
+
const e4 = t2.evaluate("ds", i2);
|
|
254
|
+
if (e4 && e4.length > 0) {
|
|
255
|
+
let t3 = "";
|
|
256
|
+
for (let s3 = 0; s3 < e4.length; s3++) {
|
|
257
|
+
const r3 = e4.item(s3);
|
|
258
|
+
t3 += m(r3.getAttribute("d")) + "," + m(r3.getAttribute("sp"));
|
|
259
|
+
}
|
|
260
|
+
r2.dash = t3;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const n2 = t2.evaluate("prstDash", o2);
|
|
264
|
+
n2 && n2.hasAttribute("val") && (r2.dash = n2.getAttribute("val")), this.parseEndElement(t2, o2, r2, "headEnd", "head"), this.parseEndElement(t2, o2, r2, "tailEnd", "tail");
|
|
265
|
+
const l2 = this.processFill(t2, o2, s2);
|
|
266
|
+
r2.fill = l2;
|
|
267
|
+
}
|
|
268
|
+
return r2;
|
|
269
|
+
}
|
|
270
|
+
parseEndElement(t2, e2, s2, r2, o2) {
|
|
271
|
+
const i2 = t2.evaluate(r2, e2);
|
|
272
|
+
if (i2 && (i2.hasAttribute("type") && (s2[o2 + "Type"] = i2.getAttribute("type")), i2.hasAttribute("len") || i2.hasAttribute("w"))) {
|
|
273
|
+
const t3 = i2.getAttribute("len") ? i2.getAttribute("len") : "med", e3 = i2.getAttribute("w") ? i2.getAttribute("w") : "med";
|
|
274
|
+
s2[o2 + "Size"] = t3 + "-" + e3;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
processFill(t2, e2, s2) {
|
|
278
|
+
const r2 = {};
|
|
279
|
+
if (t2.evaluate("noFill", e2)) return r2.none = true, r2;
|
|
280
|
+
const o2 = t2.evaluate("solidFill", e2);
|
|
281
|
+
if (o2) {
|
|
282
|
+
const e3 = this.processAdjColor(t2, o2);
|
|
283
|
+
return e3 && (r2.solid = e3), r2;
|
|
284
|
+
}
|
|
285
|
+
const i2 = t2.evaluate("gradFill", e2);
|
|
286
|
+
if (i2) {
|
|
287
|
+
i2.hasAttribute("rotWithShape") && (r2.isRotated = "1" === i2.getAttribute("rotWithShape"));
|
|
288
|
+
const e3 = this.processGradFill(t2, i2);
|
|
289
|
+
return r2.gradient = e3, r2;
|
|
290
|
+
}
|
|
291
|
+
const n2 = t2.evaluate("pattFill", e2);
|
|
292
|
+
if (n2) {
|
|
293
|
+
const e3 = this.processPatternFill(t2, n2);
|
|
294
|
+
return r2.pattern = e3, r2;
|
|
295
|
+
}
|
|
296
|
+
const l2 = t2.evaluate("blipFill", e2);
|
|
297
|
+
if (l2) {
|
|
298
|
+
l2.hasAttribute("rotWithShape") && (r2.isRotated = p(l2.getAttribute("rotWithShape"))), l2.hasAttribute("dpi") && (r2.dpi = l2.getAttribute("dpi"));
|
|
299
|
+
const e3 = this.processImageFill(t2, l2);
|
|
300
|
+
return r2.image = e3, r2;
|
|
301
|
+
}
|
|
302
|
+
return r2.none = true, r2;
|
|
303
|
+
}
|
|
304
|
+
processGradFill(t2, e2) {
|
|
305
|
+
const s2 = {}, r2 = t2.evaluate("lin", e2);
|
|
306
|
+
if (r2) {
|
|
307
|
+
if (s2.type = "linear", r2.hasAttribute("ang")) {
|
|
308
|
+
const t3 = b(r2.getAttribute("ang"));
|
|
309
|
+
s2.angle = t3;
|
|
310
|
+
}
|
|
311
|
+
if (r2.hasAttribute("scaled")) {
|
|
312
|
+
const t3 = p(r2.getAttribute("scaled"));
|
|
313
|
+
s2.scaled = t3;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
const o2 = {};
|
|
317
|
+
e2.hasAttribute("flip") && (o2.mirror = e2.getAttribute("flip")), Object.keys(o2).length > 0 && (s2.tile = o2);
|
|
318
|
+
const i2 = t2.evaluate("path", e2);
|
|
319
|
+
if (i2) {
|
|
320
|
+
i2.hasAttribute("path") && (s2.type = B.fromOoxmlGradientType(i2.getAttribute("path")));
|
|
321
|
+
const e3 = t2.evaluate("fillToRect", i2);
|
|
322
|
+
e3 && (s2.fillTo = this.getRect(e3));
|
|
323
|
+
}
|
|
324
|
+
const n2 = t2.evaluate("tileRect", e2);
|
|
325
|
+
n2 && (s2.tile.bounds = this.getRect(n2));
|
|
326
|
+
const l2 = [], a2 = t2.evaluate("gsLst/gs", e2);
|
|
327
|
+
for (let e3 = 0; a2 && e3 < a2.length; e3++) {
|
|
328
|
+
const s3 = a2.item(e3), r3 = { offset: m(s3.getAttribute("pos")), color: this.processAdjColor(t2, s3) };
|
|
329
|
+
l2.push(r3);
|
|
330
|
+
}
|
|
331
|
+
return l2.length > 0 && (s2.stops = l2), s2;
|
|
332
|
+
}
|
|
333
|
+
getRect(t2) {
|
|
334
|
+
const e2 = {};
|
|
335
|
+
return t2.hasAttribute("t") && (e2.t = m(t2.getAttribute("t"))), t2.hasAttribute("l") && (e2.l = m(t2.getAttribute("l"))), t2.hasAttribute("b") && (e2.b = m(t2.getAttribute("b"))), t2.hasAttribute("r") && (e2.r = m(t2.getAttribute("r"))), 0 === Object.keys(e2).length ? null : e2;
|
|
336
|
+
}
|
|
337
|
+
processImageFill(t2, e2) {
|
|
338
|
+
return { ref: "https://cdn.sheetxl.com/public/logo-color-square-onwhite.png", tile: false };
|
|
339
|
+
}
|
|
340
|
+
processPatternFill(t2, e2) {
|
|
341
|
+
const s2 = {}, r2 = e2.getAttribute("prst");
|
|
342
|
+
s2.type = r2;
|
|
343
|
+
const o2 = t2.evaluate("bgClr", e2);
|
|
344
|
+
if (o2) {
|
|
345
|
+
const e3 = this.processAdjColor(t2, o2);
|
|
346
|
+
e3 && (s2.background = e3);
|
|
347
|
+
}
|
|
348
|
+
const i2 = t2.evaluate("fgClr", e2);
|
|
349
|
+
if (i2) {
|
|
350
|
+
let e3 = this.processAdjColor(t2, i2);
|
|
351
|
+
e3 && (s2.foreground = e3);
|
|
352
|
+
}
|
|
353
|
+
return s2;
|
|
354
|
+
}
|
|
355
|
+
processAdjColor(t2, e2) {
|
|
356
|
+
const s2 = t2.evaluate("hslClr", e2);
|
|
357
|
+
if (s2) return this.processHslClr(t2, s2);
|
|
358
|
+
const r2 = t2.evaluate("prstClr", e2);
|
|
359
|
+
if (r2) return this.processClrWithValAttribute(t2, r2);
|
|
360
|
+
const o2 = t2.evaluate("schemeClr", e2);
|
|
361
|
+
if (o2) return this.processClrWithValAttribute(t2, o2);
|
|
362
|
+
const i2 = t2.evaluate("sysClr", e2);
|
|
363
|
+
if (i2) return this.processClrWithValAttribute(t2, i2);
|
|
364
|
+
const n2 = t2.evaluate("scrgbClr", e2);
|
|
365
|
+
if (n2) return this.processScrgbClrElement(t2, n2);
|
|
366
|
+
const l2 = t2.evaluate("srgbClr", e2);
|
|
367
|
+
return l2 ? this.processSrgbClrElement(t2, l2) : null;
|
|
368
|
+
}
|
|
369
|
+
processScrgbClrElement(t2, e2) {
|
|
370
|
+
let s2 = "lrgba(" + m(e2.getAttribute("r")) + "," + m(e2.getAttribute("g")) + "," + m(e2.getAttribute("b")) + ")";
|
|
371
|
+
return s2 += this.processAdjustments(t2, e2), s2;
|
|
372
|
+
}
|
|
373
|
+
processSrgbClrElement(t2, e2) {
|
|
374
|
+
let s2 = e2.getAttribute("val");
|
|
375
|
+
return s2 += this.processAdjustments(t2, e2), s2;
|
|
376
|
+
}
|
|
377
|
+
processHslClr(t2, e2) {
|
|
378
|
+
let s2 = "hsl(" + b(e2.getAttribute("hue")) + "," + m(e2.getAttribute("sat")) + "," + m(e2.getAttribute("lum")) + ")";
|
|
379
|
+
return s2 += this.processAdjustments(t2, e2), s2;
|
|
380
|
+
}
|
|
381
|
+
processClrWithValAttribute(t2, e2) {
|
|
382
|
+
const s2 = e2.getAttribute("val");
|
|
383
|
+
if (!s2) return;
|
|
384
|
+
let r2 = s2;
|
|
385
|
+
return r2 += this.processAdjustments(t2, e2), r2;
|
|
386
|
+
}
|
|
387
|
+
processAdjustments(t2, e2) {
|
|
388
|
+
let s2 = "";
|
|
389
|
+
const r2 = e2.childNodes;
|
|
390
|
+
for (let o2 = 0; o2 < r2.length; o2++) {
|
|
391
|
+
const i2 = r2.item(o2);
|
|
392
|
+
if (1 === i2.nodeType) {
|
|
393
|
+
let r3 = i2.localName;
|
|
394
|
+
s2 += "hue" === r3 || "hueOff" === r3 || "hueMod" === r3 ? this.processAdjustmentElement(t2, e2, r3, 6e4) : "gray" === r3 || "comp" === r3 || "inv" === r3 || "gamma" === r3 || "invGamma" === r3 ? this.processAdjustmentElement(t2, e2, r3, 1) : this.processAdjustmentElement(t2, e2, r3);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return s2;
|
|
398
|
+
}
|
|
399
|
+
processAdjustmentElement(t2, e2, s2, r2 = 1e3) {
|
|
400
|
+
const o2 = t2.evaluate(s2, e2);
|
|
401
|
+
if (!o2) return "";
|
|
402
|
+
const i2 = o2.getAttribute("val");
|
|
403
|
+
return i2 ? ` ${s2} ${!i2 || parseFloat(i2) / r2}` : ` ${s2}`;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
class j extends _ {
|
|
407
|
+
visit(t2, e2, s2) {
|
|
408
|
+
try {
|
|
409
|
+
const r2 = t2.evaluate("xfrm", e2);
|
|
410
|
+
if (r2) {
|
|
411
|
+
O(r2, s2);
|
|
412
|
+
const e3 = { x: 0, y: 0, width: 0, height: 0 }, o3 = t2.evaluate("off", r2);
|
|
413
|
+
o3 && (e3.x = h(o3.getAttribute("x")) ?? 0, e3.y = h(o3.getAttribute("y")) ?? 0);
|
|
414
|
+
const i3 = t2.evaluate("ext", r2);
|
|
415
|
+
o3 && (e3.width = h(i3.getAttribute("cx")) ?? 0, e3.height = h(i3.getAttribute("cy")) ?? 0), s2.bounds = e3;
|
|
416
|
+
}
|
|
417
|
+
const o2 = t2.evaluate("prstGeom", e2);
|
|
418
|
+
o2?.hasAttribute("prst") ? s2.geometry = o2?.getAttribute("prst") : t2.evaluate("customGeom", e2) && console.warn("customGeom not supported yet");
|
|
419
|
+
const i2 = this.processFill(t2, e2, s2);
|
|
420
|
+
i2 && Object.keys(i2).length > 0 && (s2.fill = i2);
|
|
421
|
+
const n2 = this.processStroke(t2, e2, s2);
|
|
422
|
+
return n2 && Object.keys(n2).length > 0 && (s2.stroke = n2), s2;
|
|
423
|
+
} catch (t3) {
|
|
424
|
+
throw console.warn(t3), new Error("Unexpected Error parsing Shape Properties element");
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
class R {
|
|
429
|
+
visit(t2, e2, s2) {
|
|
430
|
+
let r2 = {};
|
|
431
|
+
if (T(t2, e2, r2, "grouping", "grouping"), V(t2, e2, r2, "varyColors", "varyColors"), x(t2, e2, r2, "gapWidth", "gapWidth", 0.01), x(t2, e2, r2, "overlap", "overlap", 0.01), this.parseType(t2, e2, r2), S(t2, e2, r2, "bubbleScale", "bubbleScale"), V(t2, e2, r2, "showNegBubbles", "showNegativeBubbleValues"), V(t2, e2, r2, "sizeRepresents", "bubbleSizeRepresentsWidth"), S(t2, e2, r2, "firstSliceAng", "startAngle"), S(t2, e2, r2, "holeSize", "holeSize"), T(t2, e2, r2, "scatterStyle", "scatterStyle"), this.parseAxisIds(t2, e2, r2), Object.keys(r2).length > 0) {
|
|
432
|
+
let e3 = t2.getVisitorParamsState().get("types");
|
|
433
|
+
e3 || (e3 = [], t2.getVisitorParamsState().set("types", e3)), e3.push(r2);
|
|
434
|
+
}
|
|
435
|
+
return r2;
|
|
436
|
+
}
|
|
437
|
+
parseType(t2, e2, s2) {
|
|
438
|
+
switch (e2.localName) {
|
|
439
|
+
case "areaChart":
|
|
440
|
+
s2.type = "area";
|
|
441
|
+
break;
|
|
442
|
+
case "bubbleChart":
|
|
443
|
+
s2.type = "bubble";
|
|
444
|
+
break;
|
|
445
|
+
case "doughnutChart":
|
|
446
|
+
case "ofPieType":
|
|
447
|
+
case "pieChart":
|
|
448
|
+
s2.type = "pie";
|
|
449
|
+
break;
|
|
450
|
+
case "lineChart":
|
|
451
|
+
s2.type = "line";
|
|
452
|
+
break;
|
|
453
|
+
case "scatterChart":
|
|
454
|
+
s2.type = "scatter";
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
parseAxisIds(t2, e2, s2) {
|
|
458
|
+
const r2 = t2.evaluate("axId", e2);
|
|
459
|
+
if (0 === r2.length) return;
|
|
460
|
+
const o2 = r2.item(0).getAttribute("val");
|
|
461
|
+
s2.xAxisId = o2;
|
|
462
|
+
const i2 = r2.item(1).getAttribute("val");
|
|
463
|
+
s2.yAxisId = i2;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
class E extends R {
|
|
467
|
+
parseType(t2, e2, s2) {
|
|
468
|
+
const r2 = t2.getValAttrAsString("barDir", e2);
|
|
469
|
+
r2 && (s2.type = "col" === r2 ? "column" : "bar");
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
class Y {
|
|
473
|
+
constructor(t2) {
|
|
474
|
+
this.jsonKey = t2;
|
|
475
|
+
}
|
|
476
|
+
visit(t2, e2, s2) {
|
|
477
|
+
let r2 = {}, o2 = r2, i2 = t2.getValAttrAsString("idx", e2);
|
|
478
|
+
null !== i2 && (o2 = {}, o2[i2] = r2);
|
|
479
|
+
const n2 = t2.getValAttrAsBoolean("delete", e2);
|
|
480
|
+
this.parseNumFormat(t2, e2, r2), true === n2 ? (r2.showBubbleSize = false, r2.showCatName = false, r2.showLeaderLines = false, r2.showPercentage = false, r2.showSerName = false, r2.showVal = false, r2.showLegendKey = false) : (V(t2, e2, r2, "showBubbleSize", "showBubbleSize"), V(t2, e2, r2, "showCatName", "showCatName"), V(t2, e2, r2, "showLeaderLines", "showLeaderLines"), V(t2, e2, r2, "showPercent", "showPercentage"), V(t2, e2, r2, "showSerName", "showSerName"), V(t2, e2, r2, "showVal", "showVal"), V(t2, e2, r2, "showLegendKey", "showLegendKey"));
|
|
481
|
+
const l2 = t2.evaluate("separator", e2);
|
|
482
|
+
return null !== l2 && (r2.separator = l2.textContent), T(t2, e2, r2, "dLblPos", "position"), s2[this.jsonKey] = o2, r2;
|
|
483
|
+
}
|
|
484
|
+
parseNumFormat(t2, e2, s2) {
|
|
485
|
+
const r2 = t2.evaluate("numFmt", e2);
|
|
486
|
+
if (r2) {
|
|
487
|
+
const t3 = r2.getAttribute("formatCode");
|
|
488
|
+
s2.formatCode = t3, r2.hasAttribute("sourceLinked") && (s2.sourceLinked = "1" === r2.getAttribute("sourceLinked"));
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
const D = (t2, e2, s2) => {
|
|
493
|
+
if (true === t2.getValAttrAsBoolean("invertIfNegative", e2)) if (t2.evaluate("extLst/ext/invertSolidFillFmt", e2)) {
|
|
494
|
+
if (s2.fill && s2.fillNegative) {
|
|
495
|
+
const e3 = t2.getFromPath(s2, "fill.solid.adjs");
|
|
496
|
+
e3 && t2.setToPath(s2, "fillNegative.solid.adjs", e3);
|
|
497
|
+
}
|
|
498
|
+
} else {
|
|
499
|
+
const t3 = { val: "FFFFFF" }, e3 = {};
|
|
500
|
+
e3.solid = t3, s2.fillNegative = e3;
|
|
501
|
+
const r2 = { val: "000000" }, o2 = {};
|
|
502
|
+
o2.solid = r2;
|
|
503
|
+
const i2 = {};
|
|
504
|
+
i2.fill = o2, s2.strokeNegative = i2;
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
class M {
|
|
508
|
+
visit(t2, e2, s2) {
|
|
509
|
+
const r2 = {};
|
|
510
|
+
S(t2, e2, r2, "explosion", "explosion");
|
|
511
|
+
let o2 = t2.evaluate("cat/*/f", e2);
|
|
512
|
+
o2 || (o2 = t2.evaluate("xVal/*/f", e2));
|
|
513
|
+
let i2 = null;
|
|
514
|
+
null !== o2 && null !== o2.firstChild && (i2 = o2.firstChild.nodeValue), o2 || (o2 = t2.evaluate("cat/strLit", e2), o2 || (o2 = t2.evaluate("cat/numLit", e2)), o2 && (i2 = this.parsePointsAsString(t2, o2))), null !== i2 && (r2.xRange = i2);
|
|
515
|
+
let n2 = t2.evaluate("val/*/f", e2);
|
|
516
|
+
n2 || (n2 = t2.evaluate("yVal/*/f", e2));
|
|
517
|
+
let l2 = null;
|
|
518
|
+
n2 && n2.firstChild && (l2 = n2.firstChild.nodeValue), n2 || (n2 = t2.evaluate("val/numLit", e2), null !== n2 && (l2 = this.parsePointsAsString(t2, n2))), null !== l2 && (r2.valRange = l2), this.parseTitleRangeOrValue(t2, e2, r2), S(t2, e2, r2, "idx", "idx"), V(t2, e2, r2, "smooth", "smooth");
|
|
519
|
+
const a2 = t2.getVisitorParamsState().get("types").length - 1;
|
|
520
|
+
r2.offsetChart = a2;
|
|
521
|
+
let c2 = t2.getVisitorParamsState().get("series");
|
|
522
|
+
return c2 || (c2 = [], t2.getVisitorParamsState().set("series", c2)), c2.push(r2), r2;
|
|
523
|
+
}
|
|
524
|
+
parseTitleRangeOrValue(t2, e2, s2) {
|
|
525
|
+
const r2 = t2.evaluate("tx/strRef/f", e2);
|
|
526
|
+
if (null !== r2) {
|
|
527
|
+
const e3 = r2.firstChild.nodeValue;
|
|
528
|
+
t2.setToPath(s2, "title.range", e3);
|
|
529
|
+
} else {
|
|
530
|
+
const r3 = t2.evaluate("tx/v", e2);
|
|
531
|
+
null !== r3 && t2.setToPath(s2, "title.text.simpleRun", r3.firstChild.nodeValue);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
parsePointsAsString(t2, e2) {
|
|
535
|
+
let s2 = "{";
|
|
536
|
+
const r2 = t2.getValAttrAsInteger("ptCount", e2), o2 = t2.evaluate("pt", e2), i2 = [];
|
|
537
|
+
for (let s3 = 0; o2 && r2 && s3 < r2; s3++) {
|
|
538
|
+
let r3 = null, o3 = t2.evaluate("pt[@idx='" + s3 + "']/v", e2);
|
|
539
|
+
o3 instanceof Node && (r3 = o3.textContent), i2[s3] = r3;
|
|
540
|
+
}
|
|
541
|
+
for (let t3 = 0; t3 < i2.length; t3++) t3 > 0 && (s2 += ","), void 0 !== i2[t3] && (s2 += i2[t3]);
|
|
542
|
+
return s2 += "}", s2;
|
|
543
|
+
}
|
|
544
|
+
afterVisit(t2, e2, s2) {
|
|
545
|
+
D(t2, e2, s2);
|
|
546
|
+
let r2 = t2.getFromPath(s2, "points");
|
|
547
|
+
if (r2) {
|
|
548
|
+
const e3 = Object.keys(r2);
|
|
549
|
+
for (let o2 = 0; o2 < e3.length; o2++) {
|
|
550
|
+
const i2 = e3[o2], n2 = t2.getFromPath(r2, i2);
|
|
551
|
+
if (!n2) continue;
|
|
552
|
+
let l2 = t2.getFromPath(n2, "markers");
|
|
553
|
+
l2 && (t2.setToPath(s2, "markers.points." + i2, l2), delete n2.markers);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
class U {
|
|
559
|
+
DataPointVisitor() {
|
|
560
|
+
}
|
|
561
|
+
visit(t2, e2, s2) {
|
|
562
|
+
let r2 = t2.getFromPath(s2, "points"), o2 = null;
|
|
563
|
+
r2 ? o2 = r2 : (o2 = {}, t2.setToPath(s2, "points", o2));
|
|
564
|
+
let i2 = {}, n2 = t2.getValAttrAsString("idx", e2);
|
|
565
|
+
return null !== n2 && (o2[n2] = i2), V(t2, e2, i2, "bubble3D", "bubble3D"), S(t2, e2, i2, "explosion", "explosion"), D(t2, e2, i2), i2;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
class z {
|
|
569
|
+
visit(t2, e2, s2) {
|
|
570
|
+
const r2 = e2.parentNode.localName;
|
|
571
|
+
if ("ser" === r2 || "dPt" === r2) {
|
|
572
|
+
const r3 = {}, o2 = t2.getValAttrAsString("size", e2);
|
|
573
|
+
null !== o2 && (r3.size = o2);
|
|
574
|
+
const i2 = t2.getValAttrAsString("symbol", e2);
|
|
575
|
+
return i2 && (r3.type = i2), s2.markers = r3, r3;
|
|
576
|
+
}
|
|
577
|
+
return null;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
class G {
|
|
581
|
+
visit(t2, e2, s2) {
|
|
582
|
+
let r2 = {};
|
|
583
|
+
this.parseScaling(t2, e2, r2), x(t2, e2, r2, "majorUnit", "majorUnits"), x(t2, e2, r2, "minorUnit", "minorUnits"), V(t2, e2, r2, "delete", "shown"), this.parseOrientation(t2, e2, r2), this.parseNumFormat(t2, e2, r2), T(t2, e2, r2, "majorTickMark", "majorTickMarks"), T(t2, e2, r2, "minorTickMark", "minorTickMarks"), T(t2, e2, r2, "crosses", "crosses"), x(t2, e2, r2, "crossesAt", "crosses"), T(t2, e2, r2, "crossBetween", "crossBetween"), this.parseLabelAlign(t2, e2, r2), S(t2, e2, r2, "lblOffset", "labelOffset"), T(t2, e2, r2, "tickLblPos", "labelPosition");
|
|
584
|
+
const o2 = t2.getValAttrAsInteger("noMultiLvlLbl", e2);
|
|
585
|
+
r2.labelMultiLevel = null !== o2 && 0 === o2, S(t2, e2, r2, "tickMarkSkip", "tickMarkSkip"), S(t2, e2, r2, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(e2, t2, r2), this.parseTimeUnits(t2, e2, r2, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(t2, e2, r2, "minorUnitDates", "minorTimeUnit", "minorUnit"), T(t2, e2, r2, "baseTimeUnit", "baseUnitDates"), t2.getVisitorParamsState().get("axes") || t2.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map());
|
|
586
|
+
const i2 = t2.getValAttrAsString("axId", e2);
|
|
587
|
+
return t2.getVisitorParamsState().get("axes").set(i2, r2), r2;
|
|
588
|
+
}
|
|
589
|
+
parseTimeUnits(t2, e2, s2, r2, o2, i2) {
|
|
590
|
+
const n2 = {};
|
|
591
|
+
let l2 = t2.getValAttrAsString(o2, e2);
|
|
592
|
+
if (null !== l2) {
|
|
593
|
+
n2.dem = l2;
|
|
594
|
+
let s3 = t2.getValAttrAsString(i2, e2);
|
|
595
|
+
n2.amt = s3;
|
|
596
|
+
}
|
|
597
|
+
Object.keys(n2).length > 0 && (s2[r2] = n2);
|
|
598
|
+
}
|
|
599
|
+
parseDisplayCustOrBuiltInUnit(t2, e2, s2) {
|
|
600
|
+
let r2 = e2.getValAttrAsString("dispUnits/builtInUnit", t2);
|
|
601
|
+
r2 || (r2 = e2.getValAttrAsString("dispUnits/custUnit", t2)), r2 && (s2.displayUnits = r2);
|
|
602
|
+
}
|
|
603
|
+
parseLabelAlign(t2, e2, s2) {
|
|
604
|
+
let r2 = t2.getValAttrAsString("lblAlgn", e2);
|
|
605
|
+
null !== r2 && ("ctr" === r2 ? s2.labelAlign = "center" : "l" === r2 ? s2.labelAlign = "left" : "r" === r2 && (s2.labelAlign = "right"));
|
|
606
|
+
}
|
|
607
|
+
parseOrientation(t2, e2, s2) {
|
|
608
|
+
const r2 = t2.getValAttrAsString("AxPos", e2);
|
|
609
|
+
null !== r2 && ("b" === r2 ? s2.orientation = "bottom" : "l" === r2 ? s2.orientation = "left" : "r" === r2 ? s2.orientation = "right" : "t" === r2 && (s2.orientation = "top"));
|
|
610
|
+
}
|
|
611
|
+
parseNumFormat(t2, e2, s2) {
|
|
612
|
+
const r2 = {}, o2 = t2.evaluate("numFmt", e2);
|
|
613
|
+
null !== o2 && (o2.hasAttribute("formatCode") && (r2.formatCode = o2.getAttribute("formatCode")), o2.hasAttribute("sourceLinked") && (r2.sourceLinked = "1" === o2.getAttribute("sourceLinked"))), Object.keys(r2).length > 0 && (s2.labels = r2);
|
|
614
|
+
}
|
|
615
|
+
parseScaling(t2, e2, s2) {
|
|
616
|
+
const r2 = t2.getValAttrAsString("scaling/orientation", e2);
|
|
617
|
+
null !== r2 && (s2.inverted = "minMax" !== r2);
|
|
618
|
+
const o2 = t2.getValAttrAsFloat("scaling/logBase", e2);
|
|
619
|
+
null !== o2 && (s2.logBase = o2, s2.scaleType = "log"), x(t2, e2, s2, "scaling/max", "max"), x(t2, e2, s2, "scaling/min", "min");
|
|
620
|
+
}
|
|
621
|
+
afterVisit(t2, e2, s2) {
|
|
622
|
+
s2.fill && s2.labels && (s2.labels.fill = s2.fill, delete s2.fill);
|
|
623
|
+
let r2 = t2.getValAttrAsBoolean("delete", e2);
|
|
624
|
+
null !== r2 && (t2.setToPath(s2, "labels.shown", true !== r2), t2.setToPath(s2, "shown", true !== r2));
|
|
625
|
+
const o2 = t2.getFromPath(s2, "dispUnits.displayUnitsLabel");
|
|
626
|
+
o2 && (t2.setToPath(s2, "displayUnitsLabel", o2), delete s2.dispUnits);
|
|
627
|
+
const i2 = t2.evaluate("title", e2);
|
|
628
|
+
t2.setToPath(s2, "title.shown", null !== i2);
|
|
629
|
+
const n2 = t2.evaluate("minorGridlines", e2);
|
|
630
|
+
t2.setToPath(s2, "gridLinesMinor.shown", null !== n2);
|
|
631
|
+
const l2 = t2.evaluate("majorGridlines", e2);
|
|
632
|
+
t2.setToPath(s2, "gridLinesMajor.shown", null !== l2);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
class W {
|
|
636
|
+
constructor(t2 = "text") {
|
|
637
|
+
this._jsonKey = t2;
|
|
638
|
+
}
|
|
639
|
+
getTextPath() {
|
|
640
|
+
return this._jsonKey;
|
|
641
|
+
}
|
|
642
|
+
visit(t2, e2, s2) {
|
|
643
|
+
let r2 = t2.getFromPath(s2, this.getTextPath());
|
|
644
|
+
return r2 || (r2 = {}), this.parseTextElement(t2, e2, r2, false), Object.keys(r2).length > 0 && t2.setToPath(s2, this.getTextPath(), r2), s2;
|
|
645
|
+
}
|
|
646
|
+
parseTextElement(t2, e2, s2, r2) {
|
|
647
|
+
const o2 = t2.evaluate("p/pPr/defRPr", e2) ?? t2.evaluate("defRPr", e2);
|
|
648
|
+
o2 && (this.parseTextProperties(t2, o2, s2), new j().visit(t2, o2, s2));
|
|
649
|
+
let i2 = [], n2 = t2.evaluate("p/r", e2) ?? t2.evaluate("r", e2);
|
|
650
|
+
const l2 = (e3) => {
|
|
651
|
+
const s3 = {};
|
|
652
|
+
let r3 = t2.evaluate("t", e3);
|
|
653
|
+
const o3 = t2.evaluate("rPr", e3);
|
|
654
|
+
o3 && this.parseTextProperties(t2, o3, s3), r3 ? s3.text = r3.firstChild.textContent ?? "" : e3.textContent && (s3.text = e3.textContent ?? ""), i2.push(s3);
|
|
655
|
+
};
|
|
656
|
+
if (void 0 !== n2?.length) for (let t3 = 0; n2 && t3 < n2.length; t3++) l2(n2.item(t3));
|
|
657
|
+
else l2(n2 || e2);
|
|
658
|
+
i2.length > 0 && (s2.runs = i2);
|
|
659
|
+
const a2 = t2.evaluate("bodyPr", e2);
|
|
660
|
+
a2 && O(a2, s2);
|
|
661
|
+
}
|
|
662
|
+
parseTextProperties(e2, s2, r2) {
|
|
663
|
+
if (!s2) return;
|
|
664
|
+
s2.hasAttribute("sz") && (r2.size = parseFloat(s2.getAttribute("sz")) / 100), s2.hasAttribute("b") && (r2.weight = "1" === s2.getAttribute("b") ? 700 : 400), s2.hasAttribute("i") && (r2.italic = "1" === s2.getAttribute("i")), s2.hasAttribute("u") && (r2.underline = s2.getAttribute("u")), s2.hasAttribute("strike") && (r2.strike = s2.getAttribute("strike"));
|
|
665
|
+
const o2 = e2.evaluate("latin", s2);
|
|
666
|
+
if (o2 && !o2.getAttribute("typeface").startsWith("+")) {
|
|
667
|
+
const e3 = r2.font ?? {};
|
|
668
|
+
if (o2.hasAttribute("typeface") && (e3.family = o2.getAttribute("typeface")), o2.hasAttribute("panose")) {
|
|
669
|
+
const s3 = o2.getAttribute("panose");
|
|
670
|
+
s3 && (e3.fallbacks = [t.getPanoseFallback(s3)]);
|
|
671
|
+
}
|
|
672
|
+
o2.hasAttribute("pitchFamily") && (e3.pitch = o2.getAttribute("pitchFamily")), o2.hasAttribute("charset") && (e3.charset = o2.getAttribute("charset")), Object.keys(e3).length > 0 && (r2.font = e3);
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
class X {
|
|
677
|
+
visit(t2, e2, s2) {
|
|
678
|
+
let r2 = t2.getVisitorParamsState().get("series")[t2.getValAttrAsInteger("idx", e2)];
|
|
679
|
+
if (r2) {
|
|
680
|
+
let s3 = t2.getFromPath(r2, "title");
|
|
681
|
+
s3 || (s3 = {}, t2.setToPath(r2, "title", s3));
|
|
682
|
+
let o2 = s3, i2 = t2.getValAttrAsBoolean("delete", e2);
|
|
683
|
+
return null !== i2 && (o2.shown = !i2), o2;
|
|
684
|
+
}
|
|
685
|
+
return s2;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
class $ {
|
|
689
|
+
visit(t2, e2, s2) {
|
|
690
|
+
const r2 = {};
|
|
691
|
+
return V(t2, e2, r2, "overlay", "overlay"), T(t2, e2, r2, "legendPos", "position"), s2.legend = r2, r2;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
class K extends j {
|
|
695
|
+
visit(t2, e2, s2) {
|
|
696
|
+
const r2 = this.processFill(t2, e2, s2);
|
|
697
|
+
Object.keys(r2).length > 0 && (s2.fillNegative = r2);
|
|
698
|
+
const o2 = this.processStroke(t2, e2, s2);
|
|
699
|
+
return Object.keys(o2).length > 0 && (s2.strokeNegative = o2), s2;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
class H extends W {
|
|
703
|
+
constructor(t2 = "title") {
|
|
704
|
+
super(t2);
|
|
705
|
+
}
|
|
706
|
+
parseTitleRangeOrValue(t2, e2, s2) {
|
|
707
|
+
let r2 = t2.evaluate("tx/strRef/f", e2) ?? null;
|
|
708
|
+
if (r2) {
|
|
709
|
+
const e3 = r2.firstElementChild.nodeValue;
|
|
710
|
+
t2.setToPath(s2, "range", e3);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
visit(t2, e2, s2) {
|
|
714
|
+
const r2 = {};
|
|
715
|
+
V(t2, e2, r2, "overlay", "overlay"), s2[this._jsonKey] = r2;
|
|
716
|
+
let o2 = t2.getFromPath(r2, this.getTextPath());
|
|
717
|
+
o2 || (o2 = {}), this.parseTitleRangeOrValue(t2, e2, r2);
|
|
718
|
+
const i2 = t2.evaluate("txPr", e2);
|
|
719
|
+
i2 && this.parseTextElement(t2, i2, o2, false);
|
|
720
|
+
const n2 = t2.evaluate("tx/rich", e2);
|
|
721
|
+
return n2 && this.parseTextElement(t2, n2, o2, true), Object.keys(o2).length > 0 && t2.setToPath(r2, this.getTextPath(), o2), r2;
|
|
722
|
+
}
|
|
723
|
+
afterVisit(t2, e2, s2) {
|
|
724
|
+
if (s2?.text) {
|
|
725
|
+
const t3 = s2.text?.rotation ?? null;
|
|
726
|
+
null !== t3 && (s2.rotation = parseInt(t3), delete s2.title.rotation);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
class q {
|
|
731
|
+
visit(t2, e2, s2) {
|
|
732
|
+
const r2 = t2.evaluate("manualLayout", e2);
|
|
733
|
+
if (r2) {
|
|
734
|
+
let e3 = {};
|
|
735
|
+
x(t2, r2, e3, "x", "x"), x(t2, r2, e3, "y", "y"), x(t2, r2, e3, "w", "w"), x(t2, r2, e3, "h", "h"), T(t2, r2, e3, "xMode", "xMode"), T(t2, r2, e3, "yMode", "yMode"), T(t2, r2, e3, "wMode", "wMode"), T(t2, r2, e3, "hMode", "hMode"), Object.keys(e3).length > 0 && (s2.manualLayout = e3);
|
|
736
|
+
}
|
|
737
|
+
return s2;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
class J {
|
|
741
|
+
visit(t2, e2, s2) {
|
|
742
|
+
return s2.name = e2.getAttribute("name"), s2;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
class Q extends _ {
|
|
746
|
+
visit(t2, e2, s2) {
|
|
747
|
+
const r2 = {};
|
|
748
|
+
r2.name = e2.getAttribute("name");
|
|
749
|
+
const o2 = e2.childNodes;
|
|
750
|
+
for (let s3 = 0; s3 < o2.length; s3++) {
|
|
751
|
+
const i2 = o2.item(s3);
|
|
752
|
+
if (1 === i2.nodeType) {
|
|
753
|
+
let s4 = i2.localName;
|
|
754
|
+
const o3 = t2.evaluate(s4, e2), n2 = this.processAdjColor(t2, o3);
|
|
755
|
+
r2[s4] = n2;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
return Object.keys(r2).length > 0 && (s2.colors = r2), r2;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
class Z {
|
|
762
|
+
visit(t2, e2, s2) {
|
|
763
|
+
const r2 = {};
|
|
764
|
+
r2.name = e2.getAttribute("name");
|
|
765
|
+
const o2 = t2.evaluate("majorFont", e2), i2 = this.processFontElement(t2, o2, {});
|
|
766
|
+
r2.majorFont = i2.family, i2.fallbacks && (r2.majorFallbacks = i2.fallbacks);
|
|
767
|
+
const n2 = t2.evaluate("minorFont", e2), l2 = this.processFontElement(t2, n2, {});
|
|
768
|
+
return r2.minorFont = l2.family, i2.fallbacks && (r2.minorFallbacks = l2.fallbacks), s2.fonts = r2, r2;
|
|
769
|
+
}
|
|
770
|
+
processFontElement(e2, s2, r2) {
|
|
771
|
+
if (!s2) return;
|
|
772
|
+
const o2 = e2.evaluate("latin", s2);
|
|
773
|
+
if (!o2) return;
|
|
774
|
+
const i2 = o2.getAttribute("typeface");
|
|
775
|
+
i2 && (r2.family = i2);
|
|
776
|
+
const n2 = o2.getAttribute("panose");
|
|
777
|
+
return n2 && (r2.fallbacks = [t.getPanoseFallback(n2)]), r2;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
class tt {
|
|
781
|
+
visit(t2, e2, s2) {
|
|
782
|
+
if (!e2) return;
|
|
783
|
+
const r2 = {}, o2 = e2.getAttribute("r:id");
|
|
784
|
+
if (o2) {
|
|
785
|
+
const e3 = t2.getRef(o2);
|
|
786
|
+
"string" == typeof e3 && (r2.address = e3);
|
|
787
|
+
}
|
|
788
|
+
return t2.copyFromAttribute(e2, "tooltip", r2), t2.copyFromAttribute(e2, "history", r2, "history", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "tgtFrame", r2, "target"), s2.hyperlink = r2, r2;
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
class et {
|
|
792
|
+
visit(t2, e2, s2) {
|
|
793
|
+
if (!e2) return;
|
|
794
|
+
const r2 = {};
|
|
795
|
+
return t2.copyFromAttribute(e2, "ref", r2), this.processFilterColumns(t2, e2, r2), Object.keys(r2).length > 0 && (s2.filter = r2), r2;
|
|
796
|
+
}
|
|
797
|
+
processColorFilter(t2, s2) {
|
|
798
|
+
const r2 = { type: e.Type.Color };
|
|
799
|
+
return t2.copyFromAttribute(s2, "cellColor", r2, "cellColor", t2.BOOLEAN_COPY), t2.copyFromAttribute(s2, "dxfId", r2, "styleId", t2.INT_COPY), r2;
|
|
800
|
+
}
|
|
801
|
+
processCustomFilter(t2, e2) {
|
|
802
|
+
const s2 = {};
|
|
803
|
+
return t2.copyFromAttribute(e2, "operator", s2, "operator", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "val", s2, "val"), s2;
|
|
804
|
+
}
|
|
805
|
+
processCustomFilters(t2, s2) {
|
|
806
|
+
const r2 = { type: e.Type.Custom };
|
|
807
|
+
t2.copyFromAttribute(s2, "and", r2, "and", t2.BOOLEAN_COPY);
|
|
808
|
+
const o2 = s2.childNodes;
|
|
809
|
+
r2.filters = [];
|
|
810
|
+
for (let e2 = 0; e2 < o2.length; e2++) {
|
|
811
|
+
const s3 = o2.item(e2);
|
|
812
|
+
if (1 !== s3.nodeType) continue;
|
|
813
|
+
let i2 = null;
|
|
814
|
+
"customFilter" === s3.localName && (i2 = this.processCustomFilter(t2, s3)), i2 && r2.filters.push(i2);
|
|
815
|
+
}
|
|
816
|
+
return r2;
|
|
817
|
+
}
|
|
818
|
+
processDynamicFilter(t2, s2) {
|
|
819
|
+
const r2 = { type: e.Type.Dynamic };
|
|
820
|
+
return t2.copyFromAttribute(s2, "type", r2, "dynamicType"), t2.copyFromAttribute(s2, "val", r2, "val", t2.INT_COPY), t2.copyFromAttribute(s2, "maxVal", r2, "maxVal", t2.INT_COPY), r2;
|
|
821
|
+
}
|
|
822
|
+
processDateGroupItem(t2, e2) {
|
|
823
|
+
const s2 = {};
|
|
824
|
+
return t2.copyFromAttribute(e2, "dateTimeGrouping", s2, "group"), t2.copyFromAttribute(e2, "day", s2, "day", t2.INT_COPY), t2.copyFromAttribute(e2, "hour", s2, "hour", t2.INT_COPY), t2.copyFromAttribute(e2, "minute", s2, "minute", t2.INT_COPY), t2.copyFromAttribute(e2, "month", s2, "month", t2.INT_COPY), t2.copyFromAttribute(e2, "second", s2, "second", t2.INT_COPY), t2.copyFromAttribute(e2, "year", s2, "year", t2.INT_COPY), s2;
|
|
825
|
+
}
|
|
826
|
+
processFilterItem(t2, e2) {
|
|
827
|
+
if (e2.hasAttribute("val")) return e2.getAttribute("val");
|
|
828
|
+
}
|
|
829
|
+
processFilters(t2, s2) {
|
|
830
|
+
const r2 = { type: e.Type.Items };
|
|
831
|
+
t2.copyFromAttribute(s2, "blank", r2, "blank", t2.BOOLEAN_COPY), t2.copyFromAttribute(s2, "calendarType", r2, "calendarType");
|
|
832
|
+
let o2 = [], i2 = [];
|
|
833
|
+
const n2 = s2.childNodes;
|
|
834
|
+
for (let e2 = 0; e2 < n2.length; e2++) {
|
|
835
|
+
const s3 = n2.item(e2);
|
|
836
|
+
if (1 === s3.nodeType) {
|
|
837
|
+
if ("dateGroupItem" === s3.localName) {
|
|
838
|
+
const e3 = this.processDateGroupItem(t2, s3);
|
|
839
|
+
e3 && o2.push(e3);
|
|
840
|
+
} else if ("filter" === s3.localName) {
|
|
841
|
+
const e3 = this.processFilterItem(t2, s3);
|
|
842
|
+
void 0 !== e3 && i2.push(e3);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return o2.length > 0 && (r2.dateGroups = o2), i2.length > 0 && (r2.items = i2), r2;
|
|
847
|
+
}
|
|
848
|
+
processIcon(t2, s2) {
|
|
849
|
+
const r2 = { type: e.Type.Icon };
|
|
850
|
+
return t2.copyFromAttribute(s2, "iconId", r2, "iconId", t2.INT_COPY), t2.copyFromAttribute(s2, "iconSet", r2), r2;
|
|
851
|
+
}
|
|
852
|
+
processTop10(t2, s2) {
|
|
853
|
+
const r2 = { type: e.Type.Top10 };
|
|
854
|
+
return t2.copyFromAttribute(s2, "filterVal", r2, "filterVal", t2.FLOAT_COPY), t2.copyFromAttribute(s2, "percent", r2, "percent", t2.BOOLEAN_COPY), t2.copyFromAttribute(s2, "top", r2, "top", t2.BOOLEAN_COPY), t2.copyFromAttribute(s2, "val", r2, "val", t2.FLOAT_COPY), r2;
|
|
855
|
+
}
|
|
856
|
+
processFilterCriteria(t2, e2, s2) {
|
|
857
|
+
if (!e2) return;
|
|
858
|
+
const r2 = e2.childNodes, o2 = [];
|
|
859
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
860
|
+
const s3 = r2.item(e3);
|
|
861
|
+
if (1 !== s3.nodeType) continue;
|
|
862
|
+
let i2 = null;
|
|
863
|
+
"colorFilter" === s3.localName ? i2 = this.processColorFilter(t2, s3) : "customFilters" === s3.localName ? i2 = this.processCustomFilters(t2, s3) : "dynamicFilter" === s3.localName ? i2 = this.processDynamicFilter(t2, s3) : "filters" === s3.localName ? i2 = this.processFilters(t2, s3) : "iconFilter" === s3.localName ? i2 = this.processIcon(t2, s3) : "top10" === s3.localName && (i2 = this.processTop10(t2, s3)), i2 && o2.push(i2);
|
|
864
|
+
}
|
|
865
|
+
return o2.length > 0 && (s2.criteria = o2), o2;
|
|
866
|
+
}
|
|
867
|
+
processFilterColumn(t2, e2) {
|
|
868
|
+
if (!e2) return null;
|
|
869
|
+
const s2 = {};
|
|
870
|
+
if (!e2.hasAttribute("colId")) return;
|
|
871
|
+
s2.offset = parseInt(e2.getAttribute("colId"));
|
|
872
|
+
let r2 = false;
|
|
873
|
+
return e2.hasAttribute("hiddenButton") && (r2 = p(e2.getAttribute("hiddenButton"))), r2 && (s2.hiddenButton = true), e2.hasAttribute("showButton") && (s2.showButton = p(e2.getAttribute("showButton"))), this.processFilterCriteria(t2, e2, s2), s2;
|
|
874
|
+
}
|
|
875
|
+
processFilterColumns(t2, e2, s2) {
|
|
876
|
+
if (!e2) return;
|
|
877
|
+
const r2 = e2.childNodes, o2 = [];
|
|
878
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
879
|
+
const s3 = r2.item(e3);
|
|
880
|
+
if (1 === s3.nodeType && "filterColumn" === s3.localName) {
|
|
881
|
+
const e4 = this.processFilterColumn(t2, s3);
|
|
882
|
+
e4 && o2.push(e4);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
return o2.length > 0 && (s2.fields = o2), o2;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
class st {
|
|
889
|
+
visit(t2, e2, i2) {
|
|
890
|
+
if (!e2) return;
|
|
891
|
+
const n2 = {};
|
|
892
|
+
if (t2.copyFromAttribute(e2, "ref", n2), e2.hasAttribute("caseSensitive")) {
|
|
893
|
+
const t3 = p(e2.getAttribute("caseSensitive"));
|
|
894
|
+
n2.collatorOptions = t3 ? s.CaseSensitiveOptions : s.CaseInsensitiveOptions;
|
|
895
|
+
}
|
|
896
|
+
const l2 = e2.getAttribute("sortMethod");
|
|
897
|
+
null != l2 && "none" !== l2 && ("stroke" === l2 ? n2.collatorOptions = { ...n2.collatorOptions, collation: "stroke" } : "pinYin" === l2 && (n2.collatorOptions = { ...n2.collatorOptions, collation: "pinyin" })), e2.hasAttribute("columnSort") && p(e2.getAttribute("columnSort")) && (n2.orientation = r.Orientation.Column);
|
|
898
|
+
const a2 = o.fastStringToRange(n2.ref);
|
|
899
|
+
return this.processSortConditions(t2, e2, n2, a2), Object.keys(n2).length > 0 && (i2.sort = n2), n2;
|
|
900
|
+
}
|
|
901
|
+
processSortCondition(t2, e2, s2) {
|
|
902
|
+
if (!e2) return null;
|
|
903
|
+
const r2 = {};
|
|
904
|
+
if (e2.hasAttribute("ref")) {
|
|
905
|
+
if (e2.hasAttribute("ref")) {
|
|
906
|
+
const t3 = e2.getAttribute("ref"), i2 = o.fastStringToRange(t3);
|
|
907
|
+
r2.offset = s2 ? i2.colStart - s2.colStart : i2.colStart;
|
|
908
|
+
}
|
|
909
|
+
return r2.reverse = false, e2.hasAttribute("descending") && (r2.reverse = p(e2.getAttribute("descending"))), t2.copyFromAttribute(e2, "sortBy", r2, "sortOn"), t2.copyFromAttribute(e2, "dxfId", r2), t2.copyFromAttribute(e2, "iconSet", r2), t2.copyFromAttribute(e2, "customList", r2), r2;
|
|
910
|
+
}
|
|
911
|
+
console.warn("no ref for sort conditional", t2.getPath());
|
|
912
|
+
}
|
|
913
|
+
processSortConditions(t2, e2, s2, r2) {
|
|
914
|
+
if (!e2) return;
|
|
915
|
+
const o2 = e2.childNodes, i2 = [];
|
|
916
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
917
|
+
const s3 = o2.item(e3);
|
|
918
|
+
if (1 === s3.nodeType && "sortCondition" === s3.localName) {
|
|
919
|
+
const e4 = this.processSortCondition(t2, s3, r2);
|
|
920
|
+
e4 && i2.push(e4);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
return i2.length > 0 && (s2.fields = i2), i2;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
class rt {
|
|
927
|
+
visit(t2, e2, s2) {
|
|
928
|
+
}
|
|
929
|
+
processDataBarColor(t2, e2, s2, r2, o2 = "dk1") {
|
|
930
|
+
if (!e2) return;
|
|
931
|
+
const i2 = f((t3) => e2.getAttribute(t3), o2);
|
|
932
|
+
return i2 && (s2[r2] = i2), s2;
|
|
933
|
+
}
|
|
934
|
+
processFonts(t2, e2, s2) {
|
|
935
|
+
if (!e2) return;
|
|
936
|
+
const r2 = e2.childNodes;
|
|
937
|
+
let o2 = 0;
|
|
938
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
939
|
+
const i2 = r2.item(e3);
|
|
940
|
+
if (1 === i2.nodeType && "font" === i2.localName) {
|
|
941
|
+
const e4 = {};
|
|
942
|
+
this.processFont(t2, i2, e4), s2[o2++] = e4;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
return s2;
|
|
946
|
+
}
|
|
947
|
+
processFont(e2, s2, r2) {
|
|
948
|
+
e2.getValAttrAsBoolean("b", s2, true) && (r2.weight = 700), e2.getValAttrAsBoolean("i", s2, true) && (r2.style = t.Style.Italic), e2.getValAttrAsBoolean("strike", s2, true) && (r2.strike = true);
|
|
949
|
+
const o2 = e2.evaluate("u", s2);
|
|
950
|
+
if (o2) {
|
|
951
|
+
const e3 = o2.getAttribute("val");
|
|
952
|
+
r2.underline = e3 || t.UnderlineStyle.Single;
|
|
953
|
+
}
|
|
954
|
+
T(e2, s2, r2, "vertAlign", "verticalAlign"), "superscript" === r2.verticalAlign ? r2.verticalAlign = t.VerticalAlignment.Super : "subscript" === r2.verticalAlign && (r2.verticalAlign = t.VerticalAlignment.Sub), x(e2, s2, r2, "sz", "size");
|
|
955
|
+
const i2 = e2.evaluate("color", s2);
|
|
956
|
+
this.processDataBarColor(e2, i2, r2, "fill"), r2.fill || (r2.fill = "dk1"), T(e2, s2, r2, "name", "family"), T(e2, s2, r2, "rFont", "family");
|
|
957
|
+
const n2 = e2.evaluate("family", s2);
|
|
958
|
+
if (n2) {
|
|
959
|
+
const t2 = n2.getAttribute("val");
|
|
960
|
+
if (t2) switch (t2) {
|
|
961
|
+
case "1":
|
|
962
|
+
r2.fallbacks = ["serif"];
|
|
963
|
+
break;
|
|
964
|
+
case "2":
|
|
965
|
+
r2.fallbacks = ["sans-serif"];
|
|
966
|
+
break;
|
|
967
|
+
case "3":
|
|
968
|
+
r2.fallbacks = ["monospace"];
|
|
969
|
+
break;
|
|
970
|
+
case "4":
|
|
971
|
+
r2.fallbacks = ["cursive"];
|
|
972
|
+
break;
|
|
973
|
+
case "5":
|
|
974
|
+
r2.fallbacks = ["fantasy"];
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
return T(e2, s2, r2, "scheme", "scheme"), V(e2, s2, r2, "shadow", "shadow", true), V(e2, s2, r2, "outline", "outline", true), e2.getValAttrAsBoolean("condense", s2, true) && (r2.letterSpacing = -1), e2.getValAttrAsBoolean("extend", s2, true) && (r2.letterSpacing = 1), T(e2, s2, r2, "charset", "charset"), r2;
|
|
978
|
+
}
|
|
979
|
+
processFills(t2, e2, s2) {
|
|
980
|
+
if (!e2) return;
|
|
981
|
+
const r2 = e2.childNodes;
|
|
982
|
+
let o2 = 0;
|
|
983
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
984
|
+
const i2 = r2.item(e3);
|
|
985
|
+
1 === i2.nodeType && "fill" === i2.localName && this.processFill(t2, i2, s2, o2++);
|
|
986
|
+
}
|
|
987
|
+
return s2;
|
|
988
|
+
}
|
|
989
|
+
processFill(t2, e2, s2, r2) {
|
|
990
|
+
const o2 = { type: i.Type.None }, n2 = e2.childNodes;
|
|
991
|
+
let l2 = false;
|
|
992
|
+
for (let e3 = 0; !l2 && e3 < n2.length; e3++) {
|
|
993
|
+
const s3 = n2.item(e3);
|
|
994
|
+
1 === s3.nodeType && ("gradientFill" === s3.localName ? (this.processGradientFill(t2, s3, o2), l2 = true) : "patternFill" === s3.localName && (this.processPatternFill(t2, s3, o2), l2 = true));
|
|
995
|
+
}
|
|
996
|
+
return s2[r2] = o2, s2;
|
|
997
|
+
}
|
|
998
|
+
processGradientFill(t2, e2, s2) {
|
|
999
|
+
if (!e2) return;
|
|
1000
|
+
s2.type = i.Type.Gradient;
|
|
1001
|
+
const r2 = [];
|
|
1002
|
+
s2.stops = r2, s2.angle = 90 + (e2.hasAttribute("degree") ? parseFloat(e2.getAttribute("degree")) : 0);
|
|
1003
|
+
const o2 = e2.getAttribute("type");
|
|
1004
|
+
o2 && (s2.gradientType = o2);
|
|
1005
|
+
const n2 = (t3) => {
|
|
1006
|
+
if (!t3) return 0;
|
|
1007
|
+
const e3 = parseFloat(t3);
|
|
1008
|
+
return isNaN(e3) ? 0 : e3;
|
|
1009
|
+
};
|
|
1010
|
+
(e2.hasAttribute("left") || e2.hasAttribute("top") || e2.hasAttribute("right") || e2.hasAttribute("bottom")) && (s2.fillTo = { left: n2(e2.getAttribute("left")), top: n2(e2.getAttribute("top")), right: n2(e2.getAttribute("right")), bottom: n2(e2.getAttribute("bottom")) });
|
|
1011
|
+
const l2 = e2.childNodes;
|
|
1012
|
+
for (let e3 = 0; e3 < l2.length; e3++) {
|
|
1013
|
+
const s3 = l2.item(e3);
|
|
1014
|
+
if (1 === s3.nodeType && "stop" === s3.localName) {
|
|
1015
|
+
const e4 = {};
|
|
1016
|
+
r2.push(e4);
|
|
1017
|
+
const o3 = parseFloat(s3.getAttribute("position"));
|
|
1018
|
+
e4.offset = o3;
|
|
1019
|
+
const i2 = t2.evaluate("color", s3);
|
|
1020
|
+
this.processDataBarColor(t2, i2, e4, "color");
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
return s2;
|
|
1024
|
+
}
|
|
1025
|
+
processPatternFill(t2, e2, s2) {
|
|
1026
|
+
if (!e2) return;
|
|
1027
|
+
const r2 = t2.getVisitorParamsState().get("processingDXFs"), o2 = e2.getAttribute("patternType") || (r2 ? i.BuiltInSheetPattern.Solid : i.BuiltInSheetPattern.None);
|
|
1028
|
+
if (o2 === i.BuiltInSheetPattern.None) return { none: true };
|
|
1029
|
+
s2.type = i.Type.Pattern, o2 && (s2.patternType = o2);
|
|
1030
|
+
let n2, l2 = "foreground", a2 = "background";
|
|
1031
|
+
const c2 = s2.patternType === i.BuiltInSheetPattern.Solid && r2;
|
|
1032
|
+
if (c2) {
|
|
1033
|
+
n2 = "lt1";
|
|
1034
|
+
const t3 = l2;
|
|
1035
|
+
l2 = a2, a2 = t3;
|
|
1036
|
+
}
|
|
1037
|
+
const u2 = t2.evaluate("fgColor", e2);
|
|
1038
|
+
this.processDataBarColor(t2, u2, s2, l2, n2);
|
|
1039
|
+
const h2 = t2.evaluate("bgColor", e2);
|
|
1040
|
+
return this.processDataBarColor(t2, h2, s2, a2, n2), c2 && !s2.foreground && (s2.foreground = n2), s2;
|
|
1041
|
+
}
|
|
1042
|
+
processBorders(t2, e2, s2, r2) {
|
|
1043
|
+
if (!e2) return;
|
|
1044
|
+
const o2 = e2.childNodes;
|
|
1045
|
+
let i2 = 0;
|
|
1046
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1047
|
+
const n2 = o2.item(e3);
|
|
1048
|
+
1 === n2.nodeType && "border" === n2.localName && this.processBorder(t2, n2, s2, i2++, r2);
|
|
1049
|
+
}
|
|
1050
|
+
return s2;
|
|
1051
|
+
}
|
|
1052
|
+
processBorder(t2, e2, s2, r2, o2) {
|
|
1053
|
+
if (!e2) return;
|
|
1054
|
+
const i2 = {};
|
|
1055
|
+
return this.processBorderStroke(t2, e2, i2, u.Edge.Left), this.processBorderStroke(t2, e2, i2, u.Edge.Right), o2 ? (i2.right || i2.left) && (i2.right ? i2.vertical = { ...i2.right } : i2.vertical = { ...i2.left }) : this.processBorderStroke(t2, e2, i2, u.Edge.Vertical), this.processBorderStroke(t2, e2, i2, u.Edge.Top), this.processBorderStroke(t2, e2, i2, u.Edge.Bottom), o2 ? (i2.bottom || i2.top) && (i2.right ? i2.horizontal = { ...i2.bottom } : i2.horizontal = { ...i2.top }) : this.processBorderStroke(t2, e2, i2, u.Edge.Horizontal), s2[r2] = i2, s2;
|
|
1056
|
+
}
|
|
1057
|
+
processBorderStroke(t2, e2, s2, r2) {
|
|
1058
|
+
if (!e2) return;
|
|
1059
|
+
const o2 = t2.evaluate(r2, e2);
|
|
1060
|
+
if (!o2) return;
|
|
1061
|
+
const i2 = {};
|
|
1062
|
+
o2.hasAttribute("style") && (i2.style = o2.getAttribute("style"));
|
|
1063
|
+
const n2 = t2.evaluate("color", o2);
|
|
1064
|
+
return n2 && this.processDataBarColor(t2, n2, i2, "color"), Object.keys(i2).length > 0 ? s2[r2] = i2 : null;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
class ot extends rt {
|
|
1068
|
+
visit(t2, e2, s2) {
|
|
1069
|
+
this.processNumFmts(t2, t2.evaluate("numFmts", e2), null), t2.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
|
|
1070
|
+
const r2 = { fills: {}, fonts: {}, borders: {} };
|
|
1071
|
+
this.processFonts(t2, t2.evaluate("fonts", e2), r2.fonts), this.processFills(t2, t2.evaluate("fills", e2), r2.fills), this.processBorders(t2, t2.evaluate("borders", e2), r2.borders, true), r2.fills[0] = { type: i.Type.None }, r2.fills[1] = { type: i.Type.Pattern, patternType: i.BuiltInSheetPattern.Gray125 }, r2.borders[0] = {};
|
|
1072
|
+
const o2 = [];
|
|
1073
|
+
this.processXFs(t2, t2.evaluate("cellStyleXfs", e2), o2, r2, null, false);
|
|
1074
|
+
const n2 = /* @__PURE__ */ new Map();
|
|
1075
|
+
if (o2.length > 0) {
|
|
1076
|
+
const r3 = [];
|
|
1077
|
+
this.processCellStyles(t2, t2.evaluate("cellStyles", e2), r3, o2, n2), s2.named = r3;
|
|
1078
|
+
}
|
|
1079
|
+
const l2 = [];
|
|
1080
|
+
this.processXFs(t2, t2.evaluate("cellXfs", e2), l2, r2, n2), Object.keys(l2).length > 0 && (s2.direct = l2);
|
|
1081
|
+
const a2 = [];
|
|
1082
|
+
return this.processDXFs(t2, t2.evaluate("dxfs", e2), a2), this.processTableStyles(t2, t2.evaluate("tableStyles", e2), s2, a2), this.processIndexColors(t2, t2.evaluate("colors/indexedColors", e2), s2), this.processMruColors(t2, t2.evaluate("colors/mruColors", e2), s2), s2;
|
|
1083
|
+
}
|
|
1084
|
+
processIndexColors(t2, e2, s2) {
|
|
1085
|
+
if (!e2) return;
|
|
1086
|
+
const r2 = [], o2 = e2.childNodes;
|
|
1087
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1088
|
+
const s3 = o2.item(e3);
|
|
1089
|
+
if (1 === s3.nodeType && "rgbColor" === s3.localName) {
|
|
1090
|
+
const e4 = { color: null };
|
|
1091
|
+
this.processDataBarColor(t2, s3, e4, "color"), e4.color && r2.push(e4.color);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
s2.indexedColors = r2;
|
|
1095
|
+
}
|
|
1096
|
+
processMruColors(t2, e2, s2) {
|
|
1097
|
+
if (!e2) return;
|
|
1098
|
+
const r2 = [], o2 = e2.childNodes;
|
|
1099
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1100
|
+
const s3 = o2.item(e3);
|
|
1101
|
+
if (1 === s3.nodeType && "color" === s3.localName) {
|
|
1102
|
+
const e4 = { color: null };
|
|
1103
|
+
this.processDataBarColor(t2, s3, e4, "color"), e4.color && r2.push(e4.color);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
r2.length > 0 && (s2.mruColors = r2);
|
|
1107
|
+
}
|
|
1108
|
+
processNumFmts(t2, e2, s2) {
|
|
1109
|
+
if (!e2) return;
|
|
1110
|
+
const r2 = /* @__PURE__ */ new Map();
|
|
1111
|
+
if (t2.getVisitorParamsState().set("numFmts", r2), !e2) return;
|
|
1112
|
+
const o2 = e2.childNodes;
|
|
1113
|
+
for (let t3 = 0; t3 < o2.length; t3++) {
|
|
1114
|
+
const e3 = o2.item(t3);
|
|
1115
|
+
if (1 === e3.nodeType && "numFmt" === e3.localName) {
|
|
1116
|
+
const t4 = e3.getAttribute("numFmtId"), s3 = e3.getAttribute("formatCode");
|
|
1117
|
+
if (t4 && s3) {
|
|
1118
|
+
const e4 = s3.replace(/\\(.)/g, "$1");
|
|
1119
|
+
r2.set(parseInt(t4), e4);
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
processXFs(t2, e2, s2, r2, o2 = null, i2 = true) {
|
|
1125
|
+
if (!e2) return;
|
|
1126
|
+
const n2 = e2.childNodes;
|
|
1127
|
+
for (let e3 = 0; e3 < n2.length; e3++) {
|
|
1128
|
+
const l2 = n2.item(e3);
|
|
1129
|
+
if (1 === l2.nodeType && "xf" === l2.localName) {
|
|
1130
|
+
const e4 = {};
|
|
1131
|
+
this.processXF(t2, l2, e4, r2, o2, i2), s2.push(e4);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
processXF(t2, e2, s2, r2, o2, i2) {
|
|
1136
|
+
if (!e2) return;
|
|
1137
|
+
const l2 = e2.getAttribute("xfId");
|
|
1138
|
+
if (l2 && o2) {
|
|
1139
|
+
const t3 = o2.get(parseInt(l2));
|
|
1140
|
+
t3 && t3 !== n.BuiltInName.Normal && (s2.named = t3);
|
|
1141
|
+
}
|
|
1142
|
+
const a2 = (t3) => !(!i2 && e2.hasAttribute(t3)) || p(e2.getAttribute("applyFont"));
|
|
1143
|
+
if (a2("applyFont")) {
|
|
1144
|
+
const t3 = r2.fonts[e2.getAttribute("fontId")];
|
|
1145
|
+
t3 && (s2.font = t3);
|
|
1146
|
+
}
|
|
1147
|
+
if (a2("applyFill")) {
|
|
1148
|
+
const t3 = r2.fills[e2.getAttribute("fillId")];
|
|
1149
|
+
t3 && Object.keys(t3).length > 0 && (s2.fill = t3);
|
|
1150
|
+
}
|
|
1151
|
+
if (a2("applyBorder")) {
|
|
1152
|
+
const t3 = r2.borders[e2.getAttribute("borderId")];
|
|
1153
|
+
t3 && Object.keys(t3).length > 0 && (s2.border = t3);
|
|
1154
|
+
}
|
|
1155
|
+
if (a2("applyNumberFormat")) {
|
|
1156
|
+
const r3 = e2.getAttribute("numFmtId");
|
|
1157
|
+
if (r3) {
|
|
1158
|
+
const e3 = parseInt(r3);
|
|
1159
|
+
let o3;
|
|
1160
|
+
const i3 = t2.getVisitorParamsState();
|
|
1161
|
+
if (i3) {
|
|
1162
|
+
const t3 = i3.get("numFmts");
|
|
1163
|
+
t3 && (o3 = t3.get(e3)), s2.numberFormat = o3 ?? e3;
|
|
1164
|
+
} else console.warn("no visitor params state");
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
a2("applyAlignment") && this.processAlignment(t2, t2.evaluate("alignment", e2), s2), a2("applyProtection") && this.processProtection(t2, t2.evaluate("protection", e2), s2);
|
|
1168
|
+
const c2 = p(e2.getAttribute("quotePrefix"));
|
|
1169
|
+
c2 && (s2.quotePrefix = c2);
|
|
1170
|
+
}
|
|
1171
|
+
processAlignment(t2, e2, s2) {
|
|
1172
|
+
const r2 = {};
|
|
1173
|
+
if (e2?.hasAttribute("horizontal") ? r2.horizontal = e2.getAttribute("horizontal") : r2.horizontal = l.HorizontalAlignment.General, e2?.hasAttribute("vertical") ? r2.vertical = e2.getAttribute("vertical") : r2.vertical = l.VerticalAlignment.Bottom, e2?.hasAttribute("indent") ? r2.indent = parseInt(e2.getAttribute("indent")) : r2.indent = 0, e2?.hasAttribute("relativeIndent") ? r2.relativeIndent = parseInt(e2.getAttribute("relativeIndent")) : r2.relativeIndent = 0, p(e2?.getAttribute("wrapText")) ? r2.overflow = l.Overflow.Wrap : r2.overflow = l.Overflow.Visible, p(e2?.getAttribute("shrinkToFit")) && (r2.overflow = l.Overflow.Shrink), e2?.hasAttribute("textRotation")) {
|
|
1174
|
+
let t3 = parseFloat(e2.getAttribute("textRotation"));
|
|
1175
|
+
t3 > 0 && t3 <= 90 ? t3 = 360 - t3 : t3 > 90 && t3 <= 180 ? t3 -= 90 : 255 === t3 && (t3 = 0, r2.stacked = true), r2.rotation = t3;
|
|
1176
|
+
} else r2.rotation = 0;
|
|
1177
|
+
e2?.hasAttribute("justifyLastLine") && (r2.justifyLastLine = p(e2.getAttribute("justifyLastLine")));
|
|
1178
|
+
const o2 = e2?.getAttribute("readingOrder");
|
|
1179
|
+
return o2 && ("0" === o2 ? r2.readingDirection = l.ReadingDirection.Auto : "1" === o2 ? r2.readingDirection = l.ReadingDirection.LeftToRight : "2" === o2 ? r2.readingDirection = l.ReadingDirection.RightToLeft : console.warn(`invalid readingOrder: ${o2}`)), Object.keys(r2).length > 0 && (s2.alignment = r2), s2;
|
|
1180
|
+
}
|
|
1181
|
+
processProtection(t2, e2, s2) {
|
|
1182
|
+
if (!e2) return;
|
|
1183
|
+
const r2 = {}, o2 = e2.getAttribute("locked");
|
|
1184
|
+
o2 && !p(o2) && (r2.edit = true);
|
|
1185
|
+
const i2 = e2.getAttribute("hidden");
|
|
1186
|
+
return i2 && p(i2) && (r2.formulaHidden = true), Object.keys(r2).length > 0 && (s2.protection = r2), s2;
|
|
1187
|
+
}
|
|
1188
|
+
processDXF(t2, e2, s2) {
|
|
1189
|
+
if (!e2) return;
|
|
1190
|
+
const r2 = e2.childNodes;
|
|
1191
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
1192
|
+
const o2 = r2.item(e3);
|
|
1193
|
+
if (1 === o2.nodeType && "font" === o2.localName) {
|
|
1194
|
+
const e4 = {};
|
|
1195
|
+
this.processFont(t2, o2, e4), s2.font = e4;
|
|
1196
|
+
} else if (1 === o2.nodeType && "fill" === o2.localName) {
|
|
1197
|
+
const e4 = [];
|
|
1198
|
+
this.processFill(t2, o2, e4, 0), e4.length > 0 && e4[0] && (s2.fill = e4[0]);
|
|
1199
|
+
} else if (1 === o2.nodeType && "border" === o2.localName) {
|
|
1200
|
+
const e4 = [];
|
|
1201
|
+
this.processBorder(t2, o2, e4, 0, false), e4.length > 0 && e4[0] && (s2.border = e4[0]);
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
processDXFs(t2, e2, s2) {
|
|
1206
|
+
if (!e2) return;
|
|
1207
|
+
t2.getVisitorParamsState().set("processingDXFs", true);
|
|
1208
|
+
const r2 = /* @__PURE__ */ new Map();
|
|
1209
|
+
t2.getVisitorParamsState().set("dxfs", r2);
|
|
1210
|
+
const o2 = e2.childNodes;
|
|
1211
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1212
|
+
const i2 = o2.item(e3);
|
|
1213
|
+
if (1 === i2.nodeType && "dxf" === i2.localName) {
|
|
1214
|
+
const e4 = {};
|
|
1215
|
+
this.processDXF(t2, i2, e4);
|
|
1216
|
+
const o3 = s2.length;
|
|
1217
|
+
r2.set(o3, e4), s2.push(e4);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
t2.getVisitorParamsState().delete("processingDXFs");
|
|
1221
|
+
}
|
|
1222
|
+
processTableStyle(t2, e2, s2, r2, o2 = false) {
|
|
1223
|
+
const i2 = e2.getAttribute("name"), n2 = { name: i2 };
|
|
1224
|
+
e2.hasAttribute("table") && (n2.table = p(e2.getAttribute("table"))), e2.hasAttribute("pivot") && (n2.pivot = p(e2.getAttribute("pivot"))), o2 && !n2.pivot && r2.unshift(null);
|
|
1225
|
+
const l2 = e2.childNodes;
|
|
1226
|
+
for (let t3 = 0; t3 < l2.length; t3++) {
|
|
1227
|
+
const e3 = l2.item(t3);
|
|
1228
|
+
if (1 === e3.nodeType && "tableStyleElement" === e3.localName) {
|
|
1229
|
+
const t4 = e3.getAttribute("type"), s3 = e3.getAttribute("dxfId");
|
|
1230
|
+
let o3 = r2?.[s3];
|
|
1231
|
+
o3 || (console.warn("invalid dfx id", s3), o3 = {}), n2[t4] = o3;
|
|
1232
|
+
let i3 = null;
|
|
1233
|
+
e3.hasAttribute("size") && (i3 = parseInt(e3.getAttribute("size"))), i3 && !isNaN(i3) && (o3.size = i3);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
delete n2.name, s2[i2] = n2;
|
|
1237
|
+
}
|
|
1238
|
+
processTableStyles(t2, e2, s2, r2, o2) {
|
|
1239
|
+
if (!e2) return;
|
|
1240
|
+
const i2 = {}, n2 = e2.getAttribute("defaultTableStyle");
|
|
1241
|
+
n2 && (i2.defaultTableStyle = n2);
|
|
1242
|
+
const l2 = e2.getAttribute("defaultPivotStyle");
|
|
1243
|
+
l2 && (i2.defaultPivotStyle = l2);
|
|
1244
|
+
const a2 = e2.childNodes, c2 = {};
|
|
1245
|
+
for (let e3 = 0; e3 < a2.length; e3++) {
|
|
1246
|
+
const s3 = a2.item(e3);
|
|
1247
|
+
1 === s3.nodeType && "tableStyle" === s3.localName && this.processTableStyle(t2, s3, c2, r2, o2);
|
|
1248
|
+
}
|
|
1249
|
+
return Object.keys(c2).length > 0 && (i2.styles = c2), Object.keys(i2).length > 0 && (s2.tables = i2), s2;
|
|
1250
|
+
}
|
|
1251
|
+
processCellStyles(t2, e2, s2, r2, o2) {
|
|
1252
|
+
if (!e2) return;
|
|
1253
|
+
const i2 = e2.childNodes;
|
|
1254
|
+
for (let t3 = 0; t3 < i2.length; t3++) {
|
|
1255
|
+
const e3 = i2.item(t3);
|
|
1256
|
+
if (1 === e3.nodeType && "cellStyle" === e3.localName) {
|
|
1257
|
+
const t4 = parseInt(e3.getAttribute("xfId")), i3 = e3.getAttribute("name");
|
|
1258
|
+
if (o2.set(t4, i3), !r2[t4]) continue;
|
|
1259
|
+
const n2 = { name: i3, style: r2[t4] };
|
|
1260
|
+
e3.getAttribute("hidden") && (n2.hidden = p(e3.getAttribute("hidden"))), e3.getAttribute("iLevel") && (n2.iLevel = parseInt(e3.getAttribute("iLevel"))), s2.push(n2);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
afterVisit(t2, e2, s2) {
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
class it extends rt {
|
|
1268
|
+
visit(t2, e2, s2) {
|
|
1269
|
+
return this.processSheetRefs(t2, t2.evaluate("sheets", e2), s2), this.processBookViews(t2, t2.evaluate("bookViews", e2), s2), this.processDefinedNames(t2, t2.evaluate("definedNames", e2), s2), this.processCalcPr(t2, t2.evaluate("calcPr", e2), s2), this.processWorkbookProtection(t2, t2.evaluate("workbookProtection", e2), s2), this.processWorkbookPr(t2, t2.evaluate("workbookPr", e2), s2), s2;
|
|
1270
|
+
}
|
|
1271
|
+
processPassword(t2, e2, s2, r2 = "password") {
|
|
1272
|
+
if (!e2) return;
|
|
1273
|
+
const o2 = {};
|
|
1274
|
+
t2.copyFromAttribute(e2, "algorithmName", o2, "algorithmName"), t2.copyFromAttribute(e2, "hashValue", o2, "hashValue"), t2.copyFromAttribute(e2, "saltValue", o2, "saltValue", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "spinCount", o2, "spinCount", t2.INT_COPY), Object.keys(o2).length > 0 && (s2[r2] = o2);
|
|
1275
|
+
}
|
|
1276
|
+
processWorkbookProtection(t2, e2, s2) {
|
|
1277
|
+
if (!e2) return;
|
|
1278
|
+
const r2 = {};
|
|
1279
|
+
this.processPassword(t2, t2.evaluate("workbookPassword", e2), r2), this.processPassword(t2, t2.evaluate("revisionsPassword", e2), r2, "revisionsPassword");
|
|
1280
|
+
const o2 = (t3) => true !== t3 && "1" !== t3 && "on" !== t3 && "true" !== t3 && (false === t3 || "0" === t3 || "off" === t3 || "false" === t3 || null);
|
|
1281
|
+
return t2.copyFromAttribute(e2, "lockStructure", r2, "structure", o2), t2.copyFromAttribute(e2, "lockWindows", r2, "windows", o2), t2.copyFromAttribute(e2, "lockRevision", r2, "revision", o2), s2.protection = r2, s2;
|
|
1282
|
+
}
|
|
1283
|
+
processCalcPr(t2, e2, s2) {
|
|
1284
|
+
e2 && (s2.calc = {});
|
|
1285
|
+
}
|
|
1286
|
+
processSheetRefs(t2, e2, s2) {
|
|
1287
|
+
if (!e2) return;
|
|
1288
|
+
const r2 = [], o2 = e2.childNodes;
|
|
1289
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1290
|
+
const s3 = o2.item(e3);
|
|
1291
|
+
1 === s3.nodeType && "sheet" === s3.localName && this.processSheetRef(t2, s3, r2);
|
|
1292
|
+
}
|
|
1293
|
+
s2.sheets = r2;
|
|
1294
|
+
}
|
|
1295
|
+
processSheetRef(t2, e2, s2) {
|
|
1296
|
+
const r2 = {};
|
|
1297
|
+
t2.copyFromAttribute(e2, "name", r2, "name"), t2.copyFromAttribute(e2, "state", r2, "visibility");
|
|
1298
|
+
const o2 = e2.getAttribute("r:id"), i2 = t2.getRef(o2);
|
|
1299
|
+
i2 && (r2.sheet = i2), s2.push(r2);
|
|
1300
|
+
}
|
|
1301
|
+
processBookViews(t2, e2, s2) {
|
|
1302
|
+
if (!e2) return;
|
|
1303
|
+
const r2 = e2.childNodes;
|
|
1304
|
+
let o2 = 0;
|
|
1305
|
+
for (let i2 = 0; o2 < 1 && i2 < e2.childNodes.length; i2++) {
|
|
1306
|
+
const e3 = r2.item(i2);
|
|
1307
|
+
1 === e3.nodeType && "workbookView" === e3.localName && (this.processWorkbookView(t2, e3, s2), o2++);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
processWorkbookView(t2, e2, s2) {
|
|
1311
|
+
if (!e2) return;
|
|
1312
|
+
const r2 = {};
|
|
1313
|
+
t2.copyFromAttribute(e2, "activeTab", r2, "activeSheetId", [t2.INT_COPY, (t3) => t3 + 1]), e2.hasAttribute("activeTab") || (r2.activeSheetId = 1), t2.copyFromAttribute(e2, "showHorizontalScroll", r2, "showHorizontalScrollbar", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "showVerticalScroll", r2, "showVerticalScrollbar", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "showSheetTabs", r2, "showTabs", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "tabRatio", r2, "tabRatio", [t2.FLOAT_COPY, (t3) => t3]), Object.keys(r2).length > 0 && (s2.view = r2);
|
|
1314
|
+
}
|
|
1315
|
+
processDefineName(t2, e2, s2, r2) {
|
|
1316
|
+
if (!e2) return;
|
|
1317
|
+
const o2 = {}, i2 = e2.firstChild;
|
|
1318
|
+
if (i2 && 3 === i2.nodeType && (o2.ref = i2.textContent), t2.copyFromAttribute(e2, "name", o2), t2.copyFromAttribute(e2, "comment", o2), t2.copyFromAttribute(e2, "hidden", o2, "hidden", t2.BOOLEAN_COPY), e2.hasAttribute("localSheetId")) {
|
|
1319
|
+
const t3 = e2.getAttribute("localSheetId");
|
|
1320
|
+
if (!r2[t3]?.name) return void console.warn(`Defined name '${e2.getAttribute("name")}' references a sheet with localSheetId '${t3}' which does not exist.`);
|
|
1321
|
+
o2.scope = r2[t3].name;
|
|
1322
|
+
}
|
|
1323
|
+
t2.copyFromAttribute(e2, "customMenu", o2), t2.copyFromAttribute(e2, "description", o2), t2.copyFromAttribute(e2, "statusBar", o2), t2.copyFromAttribute(e2, "help", o2), t2.copyFromAttribute(e2, "shortcutKey", o2), t2.copyFromAttribute(e2, "function", o2, "function", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "functionGroupId", o2, "functionGroupId", t2.INT_COPY), t2.copyFromAttribute(e2, "publishToServer", o2, "publishToServer", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "vbProcedure", o2, "vbProcedure", t2.BOOLEAN_COPY), t2.copyFromAttribute(e2, "xlm", o2, "xlm", t2.BOOLEAN_COPY), Object.keys(o2).length > 0 && s2.push(o2);
|
|
1324
|
+
}
|
|
1325
|
+
processDefinedNames(t2, e2, s2) {
|
|
1326
|
+
if (!e2) return;
|
|
1327
|
+
const r2 = [], o2 = e2.childNodes;
|
|
1328
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1329
|
+
const i2 = o2.item(e3);
|
|
1330
|
+
1 === i2.nodeType && "definedName" === i2.localName && this.processDefineName(t2, i2, r2, s2.sheets);
|
|
1331
|
+
}
|
|
1332
|
+
r2.length > 0 && (s2.names = r2);
|
|
1333
|
+
}
|
|
1334
|
+
processWorkbookPr(t2, e2, s2) {
|
|
1335
|
+
e2 && t2.copyFromAttribute(e2, "date1904", s2, "date1904", t2.BOOLEAN_COPY);
|
|
1336
|
+
}
|
|
1337
|
+
afterVisit(t2, e2, s2) {
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
class nt {
|
|
1341
|
+
visit(t2, e2, s2) {
|
|
1342
|
+
return t2.copyFromAttribute(e2, "name", s2), t2.copyFromAttribute(e2, "displayName", s2), t2.copyFromAttribute(e2, "ref", s2), t2.copyFromAttribute(e2, "headerRowCount", s2, "headerRowCount", t2.INT_COPY), t2.copyFromAttribute(e2, "totalsRowCount", s2, "totalsRowCount", t2.INT_COPY), this.processTableColumns(t2, e2, s2), this.processTableStyleInfo(t2, e2, s2), s2;
|
|
1343
|
+
}
|
|
1344
|
+
processTableStyleInfo(t2, e2, s2) {
|
|
1345
|
+
if (!e2) return;
|
|
1346
|
+
const r2 = e2.childNodes, o2 = {};
|
|
1347
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
1348
|
+
const s3 = r2.item(e3);
|
|
1349
|
+
1 === s3.nodeType && "tableStyleInfo" === s3.localName && (t2.copyFromAttribute(s3, "name", o2), t2.copyFromAttribute(s3, "showColumnStripes", o2, "showColumnStripes", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "showFirstColumn", o2, "showFirstColumn", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "showLastColumn", o2, "showLastColumn", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "showRowStripes", o2, "showRowStripes", t2.BOOLEAN_COPY));
|
|
1350
|
+
}
|
|
1351
|
+
Object.keys(o2).length > 0 && (s2.styleOptions = o2);
|
|
1352
|
+
}
|
|
1353
|
+
processTableColumn(t2, e2, s2) {
|
|
1354
|
+
if (!e2) return null;
|
|
1355
|
+
const r2 = e2.childNodes;
|
|
1356
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
1357
|
+
const o2 = r2.item(e3);
|
|
1358
|
+
if (1 === o2.nodeType && "tableColumn" === o2.localName) {
|
|
1359
|
+
const e4 = {};
|
|
1360
|
+
t2.copyFromAttribute(o2, "name", e4), t2.copyFromAttribute(o2, "uniqueName", e4), s2.push(e4);
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
return s2;
|
|
1364
|
+
}
|
|
1365
|
+
processTableColumns(t2, e2, s2) {
|
|
1366
|
+
const r2 = e2.childNodes, o2 = [];
|
|
1367
|
+
for (let e3 = 0; e3 < r2.length; e3++) {
|
|
1368
|
+
const s3 = r2.item(e3);
|
|
1369
|
+
1 === s3.nodeType && "tableColumns" === s3.localName && this.processTableColumn(t2, s3, o2);
|
|
1370
|
+
}
|
|
1371
|
+
o2.length > 0 && (s2.columns = o2);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
class lt {
|
|
1375
|
+
visit(t2, e2, s2) {
|
|
1376
|
+
return s2;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
class at {
|
|
1380
|
+
visit(t2, e2, s2) {
|
|
1381
|
+
if (!e2) return;
|
|
1382
|
+
const r2 = {};
|
|
1383
|
+
return t2.copyFromAttribute(e2, "editAs", r2, "anchorType"), r2.anchor = {}, this.processOffsetCoord(t2, t2.evaluate("from", e2), r2.anchor, "from"), this.processOffsetCoord(t2, t2.evaluate("to", e2), r2.anchor, "to"), s2.movables || (s2.movables = []), s2.movables.push(r2), r2;
|
|
1384
|
+
}
|
|
1385
|
+
processOffsetCoord(t2, e2, s2, r2) {
|
|
1386
|
+
if (!e2) return;
|
|
1387
|
+
const o2 = { c: 0, r: 0, x: 0, y: 0 };
|
|
1388
|
+
return t2.evaluate("col", e2) && (o2.c = parseInt(t2.evaluate("col", e2).textContent)), t2.evaluate("row", e2) && (o2.r = parseInt(t2.evaluate("row", e2).textContent)), t2.evaluate("colOff", e2) && (o2.x = h(t2.evaluate("colOff", e2).textContent)), t2.evaluate("rowOff", e2) && (o2.y = h(t2.evaluate("rowOff", e2).textContent)), "from" === r2 ? s2.tl = o2 : s2.br = o2, s2;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
class ct {
|
|
1392
|
+
visit(t2, e2, s2) {
|
|
1393
|
+
if (!e2) return;
|
|
1394
|
+
const r2 = t2.evaluate("*/cNvPr", e2);
|
|
1395
|
+
return r2 && (t2.copyFromAttribute(r2, "name", s2), t2.copyFromAttribute(r2, "desc", s2), t2.copyFromAttribute(r2, "hidden", s2, "hidden", t2.BOOLEAN_COPY), t2.copyFromAttribute(r2, "id", s2)), s2;
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
class ut extends ct {
|
|
1399
|
+
visit(t2, e2, s2) {
|
|
1400
|
+
if (!e2) return;
|
|
1401
|
+
s2 = super.visit(t2, e2, s2);
|
|
1402
|
+
const r2 = t2.evaluate("nvGraphicFramePr/cNvGraphicFramePr", e2);
|
|
1403
|
+
if (r2) {
|
|
1404
|
+
const e3 = t2.evaluate("graphicFrameLocks", r2);
|
|
1405
|
+
if (e3) {
|
|
1406
|
+
e3.hasAttribute("noChangeAspect") && (s2.lockAspect = "1" === e3.getAttribute("noChangeAspect"));
|
|
1407
|
+
const t3 = {};
|
|
1408
|
+
Object.keys(t3).length > 0 && (s2.locks = t3);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
let o2 = { type: "graphicFrame", json: {} };
|
|
1412
|
+
const i2 = t2.evaluate("graphic/graphicData", e2).childNodes;
|
|
1413
|
+
for (let e3 = 0; e3 < i2.length; e3++) {
|
|
1414
|
+
const s3 = i2.item(e3);
|
|
1415
|
+
if (1 === s3.nodeType) try {
|
|
1416
|
+
let e4 = s3.localName;
|
|
1417
|
+
"chart" === e4 && (e4 = "chart"), o2.type = e4;
|
|
1418
|
+
const r3 = s3.getAttribute("r:id");
|
|
1419
|
+
r3 && (o2.json = t2.getRef(r3));
|
|
1420
|
+
} catch (t3) {
|
|
1421
|
+
console.warn("Unable to parse graphicFrame", t3);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
return o2 && (s2.content = o2), o2;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
class ht extends ct {
|
|
1428
|
+
visit(t2, e2, s2) {
|
|
1429
|
+
if (!e2) return;
|
|
1430
|
+
s2 = super.visit(t2, e2, s2);
|
|
1431
|
+
const r2 = t2.evaluate("nvSpPr/cNvSpPr", e2);
|
|
1432
|
+
if (r2) {
|
|
1433
|
+
const e3 = t2.evaluate("spLocks", r2);
|
|
1434
|
+
if (e3) {
|
|
1435
|
+
e3.hasAttribute("noChangeAspect") && (s2.lockAspect = "1" === e3.getAttribute("noChangeAspect"));
|
|
1436
|
+
const t3 = {};
|
|
1437
|
+
Object.keys(t3).length > 0 && (s2.locks = t3);
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
t2.warn(`Unable to import '${s2.name}', shapes are not supported.`);
|
|
1441
|
+
const o2 = {};
|
|
1442
|
+
return s2.content = { type: "sp", json: o2 }, o2;
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
class pt extends ct {
|
|
1446
|
+
visit(t2, e2, s2) {
|
|
1447
|
+
if (!e2) return;
|
|
1448
|
+
const r2 = super.visit(t2, e2, s2), o2 = t2.evaluate("nvPicPr/cNvPicPr", e2);
|
|
1449
|
+
if (o2) {
|
|
1450
|
+
t2.copyFromAttribute(e2, "preferRelativeResize", r2, "preferRelativeResize", t2.BOOLEAN_COPY);
|
|
1451
|
+
const s3 = t2.evaluate("picLocks", o2);
|
|
1452
|
+
if (s3) {
|
|
1453
|
+
s3.hasAttribute("noChangeAspect") && (r2.lockAspect = "1" === s3.getAttribute("noChangeAspect"));
|
|
1454
|
+
const e3 = {};
|
|
1455
|
+
t2.copyFromAttribute(s3, "noChangeArrowheads", r2, "noChangeArrowheads", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noChangeShapeType", r2, "noChangeShapeType", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noEditPoints", r2, "noEditPoints", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noAdjustHandles", r2, "noAdjustHandles", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noCrop", r2, "noCrop", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noGrp", r2, "noGrp", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noMove", r2, "noMove", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noResize", r2, "noResize", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noRot", r2, "noRot", t2.BOOLEAN_COPY), t2.copyFromAttribute(s3, "noSelect", r2, "noSelect", t2.BOOLEAN_COPY), Object.keys(e3).length > 0 && (r2.locks = e3);
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
const i2 = t2.evaluate("blipFill/blip", e2);
|
|
1459
|
+
let n2;
|
|
1460
|
+
if (i2) {
|
|
1461
|
+
const e3 = i2.getAttribute("r:embed") ?? i2.getAttribute("embed");
|
|
1462
|
+
if (!e3) return void console.warn("no rId found for blip", i2);
|
|
1463
|
+
n2 = t2.getRef(e3, true);
|
|
1464
|
+
}
|
|
1465
|
+
const l2 = { resId: n2 };
|
|
1466
|
+
return s2.content = { type: "picture", json: l2 }, r2;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
class gt extends ht {
|
|
1470
|
+
visit(t2, e2, s2) {
|
|
1471
|
+
if (!e2) return;
|
|
1472
|
+
s2 = super.visit(t2, e2, s2);
|
|
1473
|
+
const r2 = t2.evaluate("nvGrpSpPr/cNvGrpSpPr", e2);
|
|
1474
|
+
if (r2) {
|
|
1475
|
+
const e3 = t2.evaluate("grpSpLocks", r2);
|
|
1476
|
+
if (e3) {
|
|
1477
|
+
e3.hasAttribute("noChangeAspect") && (s2.lockAspect = "1" === e3.getAttribute("noChangeAspect"));
|
|
1478
|
+
const t3 = {};
|
|
1479
|
+
Object.keys(t3).length > 0 && (s2.locks = t3);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
t2.warn(`Unable to import '${s2.name}', group shapes are not supported.`);
|
|
1483
|
+
const o2 = {};
|
|
1484
|
+
return s2.content = { type: "grpSp", json: o2 }, o2;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
class dt extends ht {
|
|
1488
|
+
visit(t2, e2, s2) {
|
|
1489
|
+
if (!e2) return;
|
|
1490
|
+
s2 = super.visit(t2, e2, s2);
|
|
1491
|
+
const r2 = t2.evaluate("nvCxnSpPr/cNvCxnSpPr", e2);
|
|
1492
|
+
if (r2) {
|
|
1493
|
+
const e3 = t2.evaluate("cxnSpLocks", r2);
|
|
1494
|
+
if (e3) {
|
|
1495
|
+
e3.hasAttribute("noChangeAspect") && (s2.lockAspect = "1" === e3.getAttribute("noChangeAspect"));
|
|
1496
|
+
const t3 = {};
|
|
1497
|
+
Object.keys(t3).length > 0 && (s2.locks = t3);
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
t2.warn(`Unable to import '${s2.name}', connection shapes are not supported.`);
|
|
1501
|
+
const o2 = {};
|
|
1502
|
+
return s2.content = { type: "cxnSp", json: o2 }, o2;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
const mt = "richTypes";
|
|
1506
|
+
class bt {
|
|
1507
|
+
visit(t2, e2, s2) {
|
|
1508
|
+
let r2 = t2.getVisitorParamsState().get(mt);
|
|
1509
|
+
r2 || (r2 = [], t2.getVisitorParamsState().set(mt, r2));
|
|
1510
|
+
const o2 = e2.childNodes, i2 = o2.length;
|
|
1511
|
+
for (let e3 = 0; e3 < i2; e3++) {
|
|
1512
|
+
const s3 = o2.item(e3);
|
|
1513
|
+
if (1 === s3.nodeType && "s" === s3.localName) {
|
|
1514
|
+
const e4 = { type: s3.getAttribute("t") ?? "n", keys: [] };
|
|
1515
|
+
this.processKeys(t2, s3, e4), r2.push(e4);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
return s2.richTypes = r2, r2;
|
|
1519
|
+
}
|
|
1520
|
+
processKeys(t2, e2, s2) {
|
|
1521
|
+
const r2 = e2.childNodes, o2 = r2.length, i2 = s2.keys;
|
|
1522
|
+
for (let t3 = 0; t3 < o2; t3++) {
|
|
1523
|
+
const e3 = r2.item(t3);
|
|
1524
|
+
if (1 === e3.nodeType && "k" === e3.localName) {
|
|
1525
|
+
const t4 = e3.getAttribute("n"), s3 = e3.getAttribute("t");
|
|
1526
|
+
i2.push([t4, s3]);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
const ft = "richData";
|
|
1532
|
+
class At {
|
|
1533
|
+
visit(t2, e2, s2) {
|
|
1534
|
+
let r2 = t2.getVisitorParamsState().get("richTypes");
|
|
1535
|
+
if (!r2) return void t2.warn("RichValueFound but not type.");
|
|
1536
|
+
let o2 = t2.getVisitorParamsState().get(ft);
|
|
1537
|
+
o2 || (o2 = [], t2.getVisitorParamsState().set(ft, o2));
|
|
1538
|
+
const i2 = e2.childNodes, n2 = i2.length;
|
|
1539
|
+
for (let e3 = 0; e3 < n2; e3++) {
|
|
1540
|
+
const s3 = i2.item(e3);
|
|
1541
|
+
if (1 === s3.nodeType && "rv" === s3.localName) {
|
|
1542
|
+
const e4 = r2[s3.getAttribute("s")], i3 = { type: e4.type };
|
|
1543
|
+
this.processValues(t2, s3, i3, e4);
|
|
1544
|
+
const n3 = this.mapType(t2, i3);
|
|
1545
|
+
o2.push(n3);
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
return s2.richData = o2, o2;
|
|
1549
|
+
}
|
|
1550
|
+
mapType(t2, e2) {
|
|
1551
|
+
if ("_error" === e2.type) {
|
|
1552
|
+
const t3 = e2.errorType;
|
|
1553
|
+
if (t3) try {
|
|
1554
|
+
e2 = a.getBuiltInById(t3 + 1);
|
|
1555
|
+
} catch (t4) {
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
return e2;
|
|
1559
|
+
}
|
|
1560
|
+
processValues(t2, e2, s2, r2) {
|
|
1561
|
+
const o2 = e2.childNodes, i2 = o2.length;
|
|
1562
|
+
r2.type;
|
|
1563
|
+
const n2 = r2.keys;
|
|
1564
|
+
for (let e3 = 0; e3 < i2; e3++) {
|
|
1565
|
+
const r3 = o2.item(e3);
|
|
1566
|
+
if (1 === r3.nodeType && "v" === r3.localName) {
|
|
1567
|
+
const o3 = n2[e3];
|
|
1568
|
+
if (!o3) return void t2.warn("Invalid richData");
|
|
1569
|
+
const i3 = o3[0], l2 = o3[1];
|
|
1570
|
+
let a2 = r3.textContent;
|
|
1571
|
+
"i" === l2 && (a2 = Number(a2)), s2[i3] = a2;
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
class yt {
|
|
1577
|
+
visit(t2, e2, s2) {
|
|
1578
|
+
if (!e2) return;
|
|
1579
|
+
const r2 = [];
|
|
1580
|
+
return this.processAuthors(t2, t2.evaluate("authors", e2), r2), r2.length > 0 && (s2.authors = r2), s2.comments = [], s2;
|
|
1581
|
+
}
|
|
1582
|
+
processAuthors(t2, e2, s2) {
|
|
1583
|
+
if (!e2) return;
|
|
1584
|
+
const r2 = e2.childNodes;
|
|
1585
|
+
for (let t3 = 0; t3 < r2.length; t3++) {
|
|
1586
|
+
const e3 = r2.item(t3);
|
|
1587
|
+
if (1 === e3.nodeType && "author" === e3.localName) {
|
|
1588
|
+
const t4 = e3.firstChild;
|
|
1589
|
+
t4 && 3 === t4.nodeType && s2.push(t4.textContent);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
class vt {
|
|
1595
|
+
visit(t2, e2, s2) {
|
|
1596
|
+
if (!e2) return;
|
|
1597
|
+
const r2 = {};
|
|
1598
|
+
return t2.copyFromAttribute(e2, "ref", r2), t2.copyFromAttribute(e2, "authorId", r2, "authorId", t2.INT_COPY), r2.asNote = true, s2.comments || (s2.comments = []), s2.comments.push(r2), r2;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
class Ft {
|
|
1602
|
+
visit(t2, e2, s2) {
|
|
1603
|
+
if (!e2) return;
|
|
1604
|
+
const r2 = [];
|
|
1605
|
+
return s2.comments = r2, r2;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
class Ct {
|
|
1609
|
+
visit(t2, e2, s2) {
|
|
1610
|
+
if (!e2) return;
|
|
1611
|
+
const r2 = {};
|
|
1612
|
+
return t2.copyFromAttribute(e2, "id", r2, "id", g), t2.copyFromAttribute(e2, "personId", r2, "personId", g), t2.copyFromAttribute(e2, "ref", r2), t2.copyFromAttribute(e2, "parentId", r2, "parentId", g), t2.copyFromAttribute(e2, "dT", r2), e2.hasAttribute("done") && (r2.done = p(e2.getAttribute("done"))), s2.push(r2), r2;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
class wt {
|
|
1616
|
+
visit(t2, e2, s2) {
|
|
1617
|
+
const r2 = [], o2 = e2.childNodes;
|
|
1618
|
+
for (let e3 = 0; e3 < o2.length; e3++) {
|
|
1619
|
+
const s3 = o2.item(e3);
|
|
1620
|
+
if (1 === s3.nodeType && "person" === s3.localName) {
|
|
1621
|
+
const e4 = {};
|
|
1622
|
+
t2.copyFromAttribute(s3, "id", e4, "id", g), t2.copyFromAttribute(s3, "displayName", e4), t2.copyFromAttribute(s3, "userId", e4, "userId", g), t2.copyFromAttribute(s3, "providerId", e4), r2.push(e4);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
return r2.length > 0 && (s2.persons = r2), r2;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
const Pt = {};
|
|
1629
|
+
class Nt {
|
|
1630
|
+
constructor(t2, e2) {
|
|
1631
|
+
this.path = t2, this.visitor = e2;
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
class Ot {
|
|
1635
|
+
constructor() {
|
|
1636
|
+
this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new N()), this.registerVisitor("spPr", new j()), this.registerVisitor("txBody", new W()), this.registerVisitor("txPr", new W()), this.registerVisitor("c:chartSpace", new k()), this.registerVisitor("c:chartSpace", new L(), "chart"), this.registerVisitor("c:plotArea", new I()), this.registerVisitor("c:barChart", new E()), this.registerVisitor("c:doughnutChart", new R()), this.registerVisitor("c:lineChart", new R()), this.registerVisitor("c:ofPieType", new R()), this.registerVisitor("c:pieChart", new R()), this.registerVisitor("c:scatterChart", new R()), this.registerVisitor("c:barChart", new Y("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new Y("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new Y("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new Y("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new Y("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new Y("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new M()), this.registerVisitor("c:dPt", new U()), this.registerVisitor("c:marker", new z()), this.registerVisitor("c:catAx", new G()), this.registerVisitor("c:valAx", new G()), this.registerVisitor("c:dateAx", new G()), this.registerVisitor("c:majorGridlines", new P("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new P("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new W("labels.text"), "txPr"), this.registerVisitor("c:valAx", new W("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new W("labels.text"), "txPr"), this.registerVisitor("c:legend", new $()), this.registerVisitor("c:legend", new W("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new X()), this.registerVisitor("c:ser", new K(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new Y("labels"), "dLbls"), this.registerVisitor("c:dLbl", new Y("points")), this.registerVisitor("c:title", new H()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new q()), this.registerVisitor("c:dispUnits", new P("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new H("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new W(), "tx/rich"), this.registerVisitor("a:theme", new J()), this.registerVisitor("a:theme", new Q(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new Z(), "themeElements/fontScheme"), this.registerVisitor("autoFilter", new et()), this.registerVisitor("sortState", new st()), this.registerVisitor("s:workbook", new it()), this.registerVisitor("styleSheet", new ot()), this.registerVisitor("table", new nt()), this.registerVisitor("hlinkClick", new tt()), this.registerVisitor("wsDr", new lt()), this.registerVisitor("twoCellAnchor", new at()), this.registerVisitor("oneCellAnchor", new at()), this.registerVisitor("absoluteAnchor", new at()), this.registerVisitor("graphicFrame", new ut()), this.registerVisitor("sp", new ht()), this.registerVisitor("grpSp", new gt()), this.registerVisitor("cxnSp", new dt()), this.registerVisitor("pic", new pt()), this.registerVisitor("rvStructures", new bt()), this.registerVisitor("rvData", new At()), this.registerVisitor("comments", new yt()), this.registerVisitor("commentList", new vt(), "comment"), this.registerVisitor("comment", new W("content"), "text"), this.registerVisitor("ThreadedComments", new Ft()), this.registerVisitor("threadedComment", new Ct()), this.registerVisitor("threadedComment", new W("content"), "text"), this.registerVisitor("personList", new wt());
|
|
1637
|
+
}
|
|
1638
|
+
registerVisitor(t2, e2, s2 = null) {
|
|
1639
|
+
-1 === t2.indexOf(":") && (t2 = "*:" + t2);
|
|
1640
|
+
const r2 = t2.split(":"), o2 = r2.length > 1 ? r2[1] : r2[0];
|
|
1641
|
+
if (!s2) return this.visitorsByXmlTagName.set(o2, e2), void this.visitorsByXmlTagName.set(t2, e2);
|
|
1642
|
+
let i2 = this.scopedVisitorsByXmlTagName.get(o2);
|
|
1643
|
+
i2 || (i2 = [], this.scopedVisitorsByXmlTagName.set(o2, i2), this.scopedVisitorsByXmlTagName.set(t2, i2)), i2.push(new Nt(s2, e2));
|
|
1644
|
+
}
|
|
1645
|
+
getVisitorParamsState() {
|
|
1646
|
+
return this.visitorParamsState;
|
|
1647
|
+
}
|
|
1648
|
+
convert(t2, e2, s2 = Pt) {
|
|
1649
|
+
const r2 = t2.documentElement;
|
|
1650
|
+
this.visitorParamsState && !s2?.paramMap || (this.visitorParamsState = s2?.paramMap ?? /* @__PURE__ */ new Map());
|
|
1651
|
+
const o2 = {};
|
|
1652
|
+
let i2 = this.visitorsByXmlTagName.get(r2.nodeName);
|
|
1653
|
+
if (i2 || (i2 = this.visitorsByXmlTagName.get(r2.localName)), !i2) throw new Error(`A visitor for the root element: '${r2.nodeName}' or '${r2.localName}' must be registered.`);
|
|
1654
|
+
const n2 = "/" + r2.localName, l2 = new w(null, this, n2, r2, o2, e2, s2), a2 = [];
|
|
1655
|
+
this._doWalk(i2, l2, a2, r2, o2, e2, s2);
|
|
1656
|
+
for (let t3 = 0; t3 < a2.length; t3++) {
|
|
1657
|
+
const e3 = a2[t3];
|
|
1658
|
+
try {
|
|
1659
|
+
e3.visitor?.afterVisit?.(e3.context, e3.elemParent, e3.jsonParent);
|
|
1660
|
+
} catch (t4) {
|
|
1661
|
+
console.warn(`Error in afterVisit: ${e3.context.getPath()}`, t4);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
return o2;
|
|
1665
|
+
}
|
|
1666
|
+
_walkScoped(t2, e2, s2, r2, o2, i2, n2) {
|
|
1667
|
+
const l2 = this.scopedVisitorsByXmlTagName.get(t2);
|
|
1668
|
+
for (let a2 = 0; l2 && a2 < l2.length; a2++) {
|
|
1669
|
+
const c2 = l2[a2];
|
|
1670
|
+
let u2 = null;
|
|
1671
|
+
try {
|
|
1672
|
+
u2 = e2.evaluate(c2.path, r2);
|
|
1673
|
+
} catch (e3) {
|
|
1674
|
+
console.warn(`"Invalid path '${c2.path}' for '${t2}'.`);
|
|
1675
|
+
}
|
|
1676
|
+
if (!u2) continue;
|
|
1677
|
+
const h2 = (t3) => {
|
|
1678
|
+
let l3 = t3.localName, a3 = t3.parentNode;
|
|
1679
|
+
for (; a3 && a3 !== r2; ) l3 = a3.localName + "/" + l3, a3 = a3.parentNode;
|
|
1680
|
+
const u3 = e2.getPath() + "/" + l3;
|
|
1681
|
+
if (c2.visitor) {
|
|
1682
|
+
const r3 = new w(e2, this, u3, e2.getElemRoot(), e2.getJsonRoot(), i2, n2);
|
|
1683
|
+
this._doWalk(c2.visitor, r3, s2, t3, o2, i2, n2);
|
|
1684
|
+
}
|
|
1685
|
+
};
|
|
1686
|
+
if (u2.length > 0) {
|
|
1687
|
+
const t3 = u2;
|
|
1688
|
+
for (let e3 = 0; e3 < t3.length; e3++) h2(t3.item(e3));
|
|
1689
|
+
} else h2(u2);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
_doWalk(t2, e2, s2, r2, o2, i2, n2) {
|
|
1693
|
+
let l2 = null;
|
|
1694
|
+
t2 && (s2.push({ visitor: t2, context: e2, elemParent: r2, jsonParent: o2 }), l2 = t2.visit(e2, r2, o2)), l2 || (l2 = o2);
|
|
1695
|
+
const a2 = r2.localName;
|
|
1696
|
+
this._walkScoped(a2, e2, s2, r2, l2, i2, n2);
|
|
1697
|
+
const c2 = r2.childNodes;
|
|
1698
|
+
for (let t3 = 0; t3 < c2.length; t3++) {
|
|
1699
|
+
const r3 = c2.item(t3);
|
|
1700
|
+
if (1 === r3.nodeType) {
|
|
1701
|
+
const t4 = r3, a3 = t4.localName, c3 = this.visitorsByXmlTagName.get(a3), u2 = e2.getPath() + "/" + a3, h2 = new w(e2, this, u2, e2.getElemRoot(), e2.getJsonRoot(), i2, n2);
|
|
1702
|
+
this._doWalk(c3, h2, s2, t4, l2 ?? o2, i2, n2);
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
return l2;
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
export {
|
|
1709
|
+
Ot as FromOOXMLConverter,
|
|
1710
|
+
Ot as default
|
|
1711
|
+
};
|