@sheetxl/studio-mui 0.4.19 → 0.4.21

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