@sheetxl/io-xlsx 0.8.0-beta.2 → 0.8.0-beta.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 (217) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/{DhqYgh9G2vLn7mIE.mjs → BCQs67LTVZ1xG82R.mjs} +3 -3
  3. package/browser/esm/B_Jfq-O7tght6ixL.mjs +4631 -0
  4. package/browser/esm/{CMHb6pUUmsCP9r_9.mjs → BoTT_U96McOdkuId.mjs} +3 -3
  5. package/browser/esm/{_UDbQq5-pHbU1f82.mjs → CGQXv_OxqwXL3F8q.mjs} +2 -2
  6. package/browser/esm/CNAv3IL7hhyvzLaF.mjs +7011 -0
  7. package/browser/esm/{CMzkLUwbgA73RvCb.mjs → CROAqUhKnVtkbBSm.mjs} +3 -3
  8. package/browser/esm/D74i1p_CJmHw8HKb.mjs +2474 -0
  9. package/browser/esm/DPz0IeW70Nh4n8Wz.mjs +104 -0
  10. package/browser/esm/D_5T8KKyirVCR3RO.mjs +10312 -0
  11. package/browser/esm/cG4z0eDMlE49HJvD.mjs +2433 -0
  12. package/browser/esm/{IZf0hIeLYj3T0Xvu.mjs → f-Z5vnvNnzj-0ujR.mjs} +194 -144
  13. package/browser/esm/index.mjs +3 -4
  14. package/licenses/dependencies.txt +2 -2
  15. package/node/esm/{Bi_kZVtZams7taqa.mjs → Bl5eH7YPk64NxkkI.mjs} +3 -3
  16. package/node/esm/C0q_ulF7hl9zoVQ8.mjs +6957 -0
  17. package/node/esm/CT1rO7_YWIvsG9hs.mjs +4745 -0
  18. package/node/esm/{CB1ijGbhl-e2l6Mm.mjs → CUPNuRm5G47rulaW.mjs} +3 -3
  19. package/node/esm/{CY-pSutJLHskZfXZ.mjs → CoNllGglhnzJ6EJ4.mjs} +2 -2
  20. package/node/esm/CqhoZ8-FRZjS3p-D.mjs +7273 -0
  21. package/node/esm/TN8KqnRPY-7Ln4Ez.mjs +2562 -0
  22. package/node/esm/ZNTwnevSmMslvfiW.mjs +2479 -0
  23. package/node/esm/index.mjs +65 -28
  24. package/package.json +8 -9
  25. package/types/src/AutoFilterRules.d.ts +85 -22
  26. package/types/src/ConditionalFormatRules.d.ts +2 -2
  27. package/types/src/DataTableFormula.d.ts +26 -0
  28. package/types/src/DataValidationRules.d.ts +0 -5
  29. package/types/src/DefinedNameAttributes.d.ts +8 -0
  30. package/types/src/ExcelCalcStamp.d.ts +0 -36
  31. package/types/src/ExcelCompat.d.ts +15 -143
  32. package/types/src/ExcelFunctionFacts.d.ts +0 -272
  33. package/types/src/ExcelReservedNames.d.ts +0 -65
  34. package/types/src/KnownFonts.d.ts +37 -0
  35. package/types/src/LegacyFormula.d.ts +1 -46
  36. package/types/src/OOXMLExtensions.d.ts +30 -2
  37. package/types/src/PageLayoutAttributes.d.ts +8 -0
  38. package/types/src/Plugin.d.ts +15 -3
  39. package/types/src/ProtectionAttributes.d.ts +2 -2
  40. package/types/src/SheetKinds.d.ts +42 -0
  41. package/types/src/SheetViewAttributes.d.ts +4 -0
  42. package/types/src/SortExtent.d.ts +16 -0
  43. package/types/src/SourcePackage.d.ts +0 -44
  44. package/types/src/SparklineGroups.d.ts +52 -0
  45. package/types/src/Types.d.ts +13 -3
  46. package/types/src/XlsxHeader.d.ts +19 -0
  47. package/types/src/chart/ChartExXml.d.ts +38 -0
  48. package/types/src/chart/ChartPartXml.d.ts +47 -0
  49. package/types/src/chart/ChartSpaceXml.d.ts +37 -0
  50. package/types/src/chart/_XmlTree.d.ts +34 -0
  51. package/types/src/chart/_chartCodecs.d.ts +12 -0
  52. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  53. package/types/src/chart/_chartExFold.d.ts +14 -0
  54. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  55. package/types/src/chart/_chartExStyle.d.ts +13 -0
  56. package/types/src/chart/_codec.d.ts +78 -0
  57. package/types/src/chart/_drawingml.d.ts +10 -0
  58. package/types/src/chart/_xml.d.ts +70 -0
  59. package/types/src/pivot/PivotArea.d.ts +20 -0
  60. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  61. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  62. package/types/src/pivot/PivotFilters.d.ts +29 -0
  63. package/types/src/pivot/PivotFormats.d.ts +60 -0
  64. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  65. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  66. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  67. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  68. package/types/src/reader/CellControls.d.ts +18 -0
  69. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  70. package/types/src/reader/DummyFunctionUnwrap.d.ts +43 -23
  71. package/types/src/reader/HeaderStyles.d.ts +15 -0
  72. package/types/src/reader/IsoDateCell.d.ts +20 -0
  73. package/types/src/reader/LibreOfficeDataTable.d.ts +12 -0
  74. package/types/src/reader/PivotButtons.d.ts +14 -0
  75. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  76. package/types/src/reader/SlicerJoin.d.ts +26 -0
  77. package/types/src/reader/ZipReader.d.ts +1 -1
  78. package/types/src/reader/_SlicerRecord.d.ts +59 -0
  79. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  80. package/types/src/reader/dom/DOMTransformer.d.ts +2 -2
  81. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  82. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +8 -3
  83. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +15 -2
  84. package/types/src/reader/domVisitors/CommentVisitor.d.ts +7 -2
  85. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  86. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +34 -1
  87. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +9 -0
  88. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +14 -2
  89. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +30 -2
  90. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  91. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +10 -0
  92. package/types/src/reader/domVisitors/ExternalLinkVisitor.d.ts +1 -11
  93. package/types/src/reader/domVisitors/FeaturePropertyBagVisitor.d.ts +18 -0
  94. package/types/src/reader/domVisitors/FmtSchemeVisitor.d.ts +0 -11
  95. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  96. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  97. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  98. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  99. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  100. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +26 -5
  101. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +11 -2
  102. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +9 -3
  103. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  104. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  105. package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
  106. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  107. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  108. package/types/src/reader/domVisitors/WorkbookVisitor.d.ts +0 -9
  109. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  110. package/types/src/reader/domVisitors/index.d.ts +10 -36
  111. package/types/src/reader/saxVisitors/ContentTypesVisitor.d.ts +1 -0
  112. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +31 -6
  113. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +26 -8
  114. package/types/src/richValue/ErrorRichValueHandler.d.ts +22 -0
  115. package/types/src/richValue/IRichValueHandler.d.ts +109 -0
  116. package/types/src/richValue/LocalImageRichValueHandler.d.ts +18 -0
  117. package/types/src/richValue/RichDataParts.d.ts +69 -0
  118. package/types/src/richValue/RichRecordWriter.d.ts +61 -0
  119. package/types/src/richValue/RichValueHandlers.d.ts +25 -0
  120. package/types/src/richValue/RichValueResolver.d.ts +54 -0
  121. package/types/src/richValue/WebImageRichValueHandler.d.ts +37 -0
  122. package/types/src/richValue/index.d.ts +7 -0
  123. package/types/src/utils/DrawingMLText.d.ts +39 -0
  124. package/types/src/utils/FormControls.d.ts +170 -0
  125. package/types/src/utils/SharedNames.d.ts +13 -0
  126. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  127. package/types/src/utils/VmlNoteShapes.d.ts +88 -35
  128. package/types/src/utils/VmlNoteStyle.d.ts +25 -0
  129. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  130. package/types/src/vba/VBAProject.d.ts +0 -19
  131. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  132. package/types/src/writer/builder/Emitter.d.ts +5 -0
  133. package/types/src/writer/builder/OpcXmlUtils.d.ts +0 -8
  134. package/types/src/writer/builder/PackageBuilder.d.ts +4 -41
  135. package/types/src/writer/builder/Types.d.ts +28 -28
  136. package/types/src/writer/emitters/CommentsEmitter.d.ts +10 -4
  137. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  138. package/types/src/writer/emitters/ExternalLinkEmitter.d.ts +0 -11
  139. package/types/src/writer/emitters/FeaturePropertyBagEmitter.d.ts +8 -0
  140. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  141. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  142. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  143. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  144. package/types/src/writer/emitters/RichValuePartsEmitters.d.ts +36 -0
  145. package/types/src/writer/emitters/RichValueRelEmitter.d.ts +12 -0
  146. package/types/src/writer/emitters/RichValueStructureEmitter.d.ts +4 -3
  147. package/types/src/writer/emitters/RichValueTypesEmitter.d.ts +3 -2
  148. package/types/src/writer/emitters/RichValueWebImageEmitter.d.ts +24 -0
  149. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  150. package/types/src/writer/emitters/SlicerEmitter.d.ts +132 -0
  151. package/types/src/writer/emitters/StylesEmitter.d.ts +35 -2
  152. package/types/src/writer/emitters/TableEmitter.d.ts +14 -0
  153. package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +7 -1
  154. package/types/src/writer/emitters/WorkbookEmitter.d.ts +24 -2
  155. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  156. package/types/src/writer/utils/AutoFilter.d.ts +3 -3
  157. package/types/src/writer/utils/CellControlComplements.d.ts +29 -0
  158. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  159. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  160. package/types/src/writer/utils/DefaultRows.d.ts +22 -0
  161. package/types/src/writer/utils/DrawMLUtils.d.ts +42 -3
  162. package/types/src/writer/utils/DummyFunction.d.ts +0 -25
  163. package/types/src/writer/utils/DxfCollector.d.ts +14 -11
  164. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  165. package/types/src/writer/utils/RichValueCollector.d.ts +81 -129
  166. package/types/src/writer/utils/SheetStyleLayout.d.ts +86 -0
  167. package/types/src/writer/utils/TextUtils.d.ts +26 -2
  168. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  169. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  170. package/browser/cjs/B6sirGz6w-Bm7Ofo.cjs +0 -1
  171. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  172. package/browser/cjs/BzOEBR0jaxXg9wvt.cjs +0 -5
  173. package/browser/cjs/C8oC1tPbhgR0Dqtx.cjs +0 -2
  174. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  175. package/browser/cjs/Ca-xJDjg5bOpUPXX.cjs +0 -1
  176. package/browser/cjs/D3EWCPfCu-qMOIGd.cjs +0 -1
  177. package/browser/cjs/DULsYP_GcPGLVYSE.cjs +0 -11
  178. package/browser/cjs/DtBN3UOzNJjYBwJ6.cjs +0 -1
  179. package/browser/cjs/index.cjs +0 -1
  180. package/browser/cjs/sNZR19Wk-XQ2xZ9E.cjs +0 -1
  181. package/browser/cjs/xQ6-wbTw5UzZUM1Y.cjs +0 -1
  182. package/browser/esm/B9q618XELV7uWJsA.mjs +0 -67
  183. package/browser/esm/BwbMurFOptAFs7gC.mjs +0 -5214
  184. package/browser/esm/D75_rfogFUfXADKc.mjs +0 -3324
  185. package/browser/esm/DfuBawaydlvgZMR-.mjs +0 -4428
  186. package/browser/esm/DoMlKUCnMSlR2qX5.mjs +0 -159
  187. package/browser/esm/DtpWa7tZahylJ3HS.mjs +0 -2310
  188. package/node/esm/BD03jrMQ_UKA196-.mjs +0 -4535
  189. package/node/esm/BxHvzSROx_N_7nJH.mjs +0 -2356
  190. package/node/esm/CO1M1H1N6fB422K-.mjs +0 -2959
  191. package/node/esm/CWpezSa6TERGEv-B.mjs +0 -3410
  192. package/node/esm/Dezt2uIDqlxjiuk5.mjs +0 -170
  193. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  194. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  195. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  196. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  197. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  198. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  199. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  200. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  201. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  202. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  203. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
  204. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  205. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  206. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  207. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  208. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  209. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  210. package/types/src/reader/domVisitors/RichValueDataVisitor.d.ts +0 -7
  211. package/types/src/reader/domVisitors/RichValueStructureVisitor.d.ts +0 -6
  212. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  213. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  214. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  215. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  216. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
  217. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,2356 +0,0 @@
1
- /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.2
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { a as t, c as e, g as s, i as r, m as o, o as i, p as n, r as a, s as l, t as c } from "./Dezt2uIDqlxjiuk5.mjs";
8
- import { b as u, g as h, x as p } from "./CO1M1H1N6fB422K-.mjs";
9
- import { CommonUtils as d } from "@sheetxl/utils";
10
- import { AddressUtils as g, FormulaError as m, IBorders as b, ICondition as f, IEffect as A, IFill as y, IFont as v, IRange as N, IStyle as F, ITextFrame as C, Sort as w, Tuple as P } from "@sheetxl/sdk";
11
- var S = class {
12
- constructor(t) {
13
- this.list = t;
14
- }
15
- get length() {
16
- return this.list.length;
17
- }
18
- item(t) {
19
- return this.list[t];
20
- }
21
- forEach(t, e) {
22
- const s = this.list, r = s.length;
23
- for (let e = 0; e < r; e++) t(s[e], e, this);
24
- }
25
- entries() {
26
- return this.list.entries();
27
- }
28
- keys() {
29
- return this.list.keys();
30
- }
31
- values() {
32
- return this.list.values();
33
- }
34
- [Symbol.iterator]() {
35
- return this.list.values();
36
- }
37
- }, x = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, T = (t) => {
38
- const e = parseInt(t);
39
- return isNaN(e) ? null : e;
40
- }, O = (t) => {
41
- const e = parseFloat(t);
42
- return isNaN(e) ? null : e;
43
- }, k = /* @__PURE__ */ new Map(), V = class {
44
- constructor(t, e, s, r, o, i = null, n = d.EmptyObject) {
45
- this._fileLocation = "";
46
- const a = (t, e, s) => n?.getRef?.(t, e, s, n?.parsedRefs), l = (t) => n?.getRefs?.(t, n?.parsedRefs);
47
- this._parent = t, this.sharedShared = e, this.currentPath = s, this.elemRoot = r, this.jsonRoot = o, t ? (this._fileLocation = t._fileLocation, this._getRef = t._getRef, this._getRefs = t._getRefs, this._serializeElement = t._serializeElement, this._readEmbeddedPart = t._readEmbeddedPart) : (i && (this._fileLocation = i), n?.getRef && (this._getRef = a), n?.getRefs && (this._getRefs = l), this._onWarning = n?.onWarning, this._addPerson = n?.addPerson, this._serializeElement = n?.serializeElement, this._readEmbeddedPart = n?.readEmbeddedPart);
48
- }
49
- getRef(t, e = !1) {
50
- return this._getRef?.(t, this._fileLocation, e) ?? null;
51
- }
52
- readEmbeddedPart(t) {
53
- return this._readEmbeddedPart?.(t, this._fileLocation) ?? null;
54
- }
55
- getRelationships() {
56
- return this._getRefs?.(this._fileLocation) ?? k;
57
- }
58
- getPath() {
59
- return this.currentPath;
60
- }
61
- getFileLocation() {
62
- return this._fileLocation;
63
- }
64
- getElemRoot() {
65
- return this.elemRoot;
66
- }
67
- getJsonRoot() {
68
- return this.jsonRoot;
69
- }
70
- warn(t, e) {
71
- this._raiseWarning(t, this.getFileLocation(), e?.onceKey);
72
- }
73
- _raiseWarning(t, e, s) {
74
- this._onWarning ? this._onWarning(t, e, s) : this._parent ? this._parent._raiseWarning(t, e, s) : console.warn(t);
75
- }
76
- serializeElement(t) {
77
- return this._serializeElement?.(t) ?? null;
78
- }
79
- addPerson(t) {
80
- return "string" == typeof t && (t = { displayName: t }), this._addPerson ? this._addPerson(t) : this._parent ? this._parent?._addPerson?.(t) ?? null : null;
81
- }
82
- getVisitorParamsState() {
83
- return this.sharedShared.getVisitorParamsState();
84
- }
85
- evaluate(t, e) {
86
- if (!t) return e;
87
- let s = [e];
88
- const r = t.split("/"), o = r.length;
89
- for (let t = 0; t < o; t++) {
90
- const e = r[t];
91
- if ("" === e || "." === e) continue;
92
- const i = [], n = ("*" === e || "**" === e) && !(t === o - 1);
93
- for (const o of s) if (o) if (n) {
94
- const e = r[t + 1];
95
- e && "" !== e && "." !== e && (this._findDescendants(o, e, i), t++);
96
- } else if ("*" === e || "**" === e) {
97
- if (!o.childNodes) continue;
98
- const t = o.childNodes, e = t.length;
99
- for (let s = 0; s < e; s++) {
100
- const e = t[s];
101
- 1 === e.nodeType && i.push(e);
102
- }
103
- } else {
104
- if (!o.childNodes) continue;
105
- const t = o.childNodes, s = t.length;
106
- for (let r = 0; r < s; r++) {
107
- const s = t[r];
108
- if (1 !== s.nodeType) continue;
109
- const o = s;
110
- this._matchesElementName(o, e) && i.push(o);
111
- }
112
- }
113
- if (s = i, 0 === s.length) return null;
114
- }
115
- return 1 === s.length ? s[0] : 0 === s.length ? null : new S(s);
116
- }
117
- _matchesElementName(t, e) {
118
- return e.includes(":") ? (t.tagName || t.nodeName) === e : t.localName === e;
119
- }
120
- _findDescendants(t, e, s) {
121
- if (!t || !t.childNodes) return;
122
- const r = t.childNodes, o = r.length;
123
- for (let t = 0; t < o; t++) {
124
- const o = r[t];
125
- if (1 !== o.nodeType) continue;
126
- const i = o;
127
- this._matchesElementName(i, e) && s.push(i), this._findDescendants(i, e, s);
128
- }
129
- }
130
- getFromPath(t, e) {
131
- return d.getFromPath(t, e);
132
- }
133
- setToPath(t, e, s) {
134
- return d.setToPath(t, e, s);
135
- }
136
- getValAttrAsString(t, e) {
137
- let s = this.evaluate(t, e);
138
- return s && s.hasAttribute("val") ? s.getAttribute("val") ?? null : null;
139
- }
140
- getValAttrAsBoolean(t, e, s = !1) {
141
- let r = this.evaluate(t, e);
142
- if (!r) return null;
143
- const o = r.hasAttribute("val") ? r.getAttribute("val") : void 0;
144
- return null == o ? s : "1" === o || "on" === o || "true" === o || "0" !== o && "off" !== o && "false" !== o && s;
145
- }
146
- getValAttrAsInteger(t, e) {
147
- let s = this.evaluate(t, e);
148
- return s && s.hasAttribute("val") ? parseInt(s.getAttribute("val")) ?? null : null;
149
- }
150
- getValAttrAsFloat(t, e) {
151
- let s = this.evaluate(t, e);
152
- return s && s.hasAttribute("val") ? parseFloat(s.getAttribute("val")) ?? null : null;
153
- }
154
- get BOOLEAN_COPY() {
155
- return x;
156
- }
157
- get INT_COPY() {
158
- return T;
159
- }
160
- get FLOAT_COPY() {
161
- return O;
162
- }
163
- copyFromAttribute(t, e, s, r = e, o = null) {
164
- if (!t || !s || !t.hasAttribute(e)) return;
165
- let i = t.getAttribute(e);
166
- if (o) if (Array.isArray(o)) {
167
- const t = o.length;
168
- for (let e = 0; e < t; e++) {
169
- if (null == i) return;
170
- if (i = o[e](i), null == i) return;
171
- }
172
- } else {
173
- if (null == i) return;
174
- if (i = o(i), null == i) return;
175
- }
176
- this.setToPath(s, r, i);
177
- }
178
- }, I = s({
179
- isBlank: () => j,
180
- isNotBlank: () => D,
181
- length: () => Y,
182
- parseRotation: () => L,
183
- parseValAttrAsBoolean: () => B,
184
- parseValAttrAsFloat: () => R,
185
- parseValAttrAsInteger: () => E,
186
- parseValAttrAsString: () => _
187
- }), L = (t, e) => {
188
- if (!t || !t.hasAttribute("rot")) return;
189
- const s = t.getAttribute("rot"), o = d.roundAccurately(r(s), 2);
190
- -1e3 !== o && (e.rotation = o);
191
- }, _ = (t, e, s, r, o) => {
192
- const i = t.getValAttrAsString(r, e);
193
- null !== i && (s[o] = i);
194
- }, B = (t, e, s, r, o = r, i = null) => {
195
- const n = t.getValAttrAsBoolean(r, e, i);
196
- null !== n && (s[o] = n);
197
- }, E = (t, e, s, r, o) => {
198
- const i = t.getValAttrAsInteger(r, e);
199
- null !== i && (s[o] = i);
200
- }, R = (t, e, s, r, o, i = 1) => {
201
- const n = t.getValAttrAsFloat(r, e);
202
- null !== n && (s[o] = n * i);
203
- }, j = (t) => !t || 0 === t.trim().length, D = (t) => !j(t), Y = (t) => t?.length ?? 0, M = class {
204
- constructor(t) {
205
- this.jsonKey = t;
206
- }
207
- visit(t, e, s) {
208
- const r = {};
209
- return s[this.jsonKey] = r, r;
210
- }
211
- }, z = class {
212
- visit(t, e, s) {}
213
- getStroke(t, e) {
214
- const s = t.evaluate("ln", e);
215
- return s ? this.parseLn(t, s) : {};
216
- }
217
- parseLn(t, s) {
218
- const r = {};
219
- s.hasAttribute("algn") && (r.align = s.getAttribute("algn")), s.hasAttribute("cap") && (r.lineCap = X(s.getAttribute("cap"))), s.hasAttribute("cmpd") && (r.compound = s.getAttribute("cmpd")), s.hasAttribute("w") && (r.width = e(s.getAttribute("w")));
220
- const o = t.evaluate("miter", s);
221
- o && (r.lineJoin = "miter", o.hasAttribute("lim") && (r.miterLimit = parseFloat(o.getAttribute("lim")) / 1e5)), t.evaluate("bevel", s) && (r.lineJoin = "bevel"), t.evaluate("round", s) && (r.lineJoin = "round");
222
- const n = t.evaluate("custDash", s);
223
- if (n) {
224
- const e = t.evaluate("ds", n);
225
- if (e && e.length > 0) {
226
- const t = [];
227
- for (let s = 0; s < e.length; s++) {
228
- const r = e.item(s);
229
- t.push(i(r.getAttribute("d") ?? "")), t.push(i(r.getAttribute("sp") ?? ""));
230
- }
231
- r.dash = t;
232
- }
233
- }
234
- const a = t.evaluate("prstDash", s);
235
- a && a.hasAttribute("val") && (r.dash = a.getAttribute("val")), this.parseEndElement(t, s, r, "headEnd", "head"), this.parseEndElement(t, s, r, "tailEnd", "tail");
236
- const l = this.getFill(t, s);
237
- return l && (r.fill = l), r;
238
- }
239
- parseEndElement(t, e, s, r, o) {
240
- const i = t.evaluate(r, e);
241
- if (i && (i.hasAttribute("type") && (s[o + "Type"] = i.getAttribute("type")), i.hasAttribute("len") || i.hasAttribute("w"))) {
242
- const t = i.getAttribute("len") || "med", e = i.getAttribute("w") || "med";
243
- s[o + "Size"] = t + "-" + e;
244
- }
245
- }
246
- getEffects(t, e) {
247
- const s = t.evaluate("effectLst", e);
248
- if (!s) return null;
249
- const r = [], o = s.childNodes, i = o.length;
250
- for (let e = 0; e < i; e++) {
251
- const s = o.item(e);
252
- if (1 !== s.nodeType) continue;
253
- const i = this.processEffectElement(t, s, s.localName);
254
- if (void 0 === i) return;
255
- r.push(i);
256
- }
257
- return r;
258
- }
259
- processEffectElement(s, o, n) {
260
- switch (n) {
261
- case "outerShdw": {
262
- const n = {
263
- type: A.Type.OuterShadow,
264
- color: this.processAdjColor(s, o)
265
- };
266
- return o.hasAttribute("dist") && (n.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (n.angle = r(o.getAttribute("dir"))), o.hasAttribute("blurRad") && (n.blur = e(o.getAttribute("blurRad"))), o.hasAttribute("algn") && (n.alignment = o.getAttribute("algn")), o.hasAttribute("rotWithShape") && (n.isRotatedWithShape = t(o.getAttribute("rotWithShape"))), o.hasAttribute("sx") && (n.scaleX = i(o.getAttribute("sx"))), o.hasAttribute("sy") && (n.scaleY = i(o.getAttribute("sy"))), o.hasAttribute("kx") && (n.skewX = r(o.getAttribute("kx"))), o.hasAttribute("ky") && (n.skewY = r(o.getAttribute("ky"))), n;
267
- }
268
- case "innerShdw": {
269
- const t = {
270
- type: A.Type.InnerShadow,
271
- color: this.processAdjColor(s, o)
272
- };
273
- return o.hasAttribute("dist") && (t.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (t.angle = r(o.getAttribute("dir"))), o.hasAttribute("blurRad") && (t.blur = e(o.getAttribute("blurRad"))), t;
274
- }
275
- case "prstShdw": {
276
- const t = {
277
- type: A.Type.PresetShadow,
278
- color: this.processAdjColor(s, o),
279
- preset: o.getAttribute("prst") ?? void 0
280
- };
281
- return o.hasAttribute("dist") && (t.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (t.angle = r(o.getAttribute("dir"))), t;
282
- }
283
- case "glow": {
284
- const t = {
285
- type: A.Type.Glow,
286
- color: this.processAdjColor(s, o)
287
- };
288
- return o.hasAttribute("rad") && (t.radius = e(o.getAttribute("rad"))), t;
289
- }
290
- case "softEdge": {
291
- const t = { type: A.Type.SoftEdge };
292
- return o.hasAttribute("rad") && (t.radius = e(o.getAttribute("rad"))), t;
293
- }
294
- case "reflection": {
295
- const s = { type: A.Type.Reflection };
296
- return o.hasAttribute("blurRad") && (s.blur = e(o.getAttribute("blurRad"))), o.hasAttribute("dist") && (s.distance = e(o.getAttribute("dist"))), o.hasAttribute("dir") && (s.angle = r(o.getAttribute("dir"))), o.hasAttribute("fadeDir") && (s.fadeAngle = r(o.getAttribute("fadeDir"))), o.hasAttribute("stA") && (s.startAlpha = i(o.getAttribute("stA"))), o.hasAttribute("stPos") && (s.startPosition = i(o.getAttribute("stPos"))), o.hasAttribute("endA") && (s.endAlpha = i(o.getAttribute("endA"))), o.hasAttribute("endPos") && (s.endPosition = i(o.getAttribute("endPos"))), o.hasAttribute("sx") && (s.scaleX = i(o.getAttribute("sx"))), o.hasAttribute("sy") && (s.scaleY = i(o.getAttribute("sy"))), o.hasAttribute("kx") && (s.skewX = r(o.getAttribute("kx"))), o.hasAttribute("ky") && (s.skewY = r(o.getAttribute("ky"))), o.hasAttribute("algn") && (s.alignment = o.getAttribute("algn")), o.hasAttribute("rotWithShape") && (s.isRotatedWithShape = t(o.getAttribute("rotWithShape"))), s;
297
- }
298
- default: return;
299
- }
300
- }
301
- getFill(t, e) {
302
- if (t.evaluate("noFill", e)) return { type: y.Type.None };
303
- const s = t.evaluate("solidFill", e);
304
- if (s) {
305
- const e = this.processAdjColor(t, s);
306
- if (e) return {
307
- type: y.Type.Solid,
308
- color: e
309
- };
310
- }
311
- const r = t.evaluate("gradFill", e);
312
- if (r) return this.processGradFill(t, r);
313
- const o = t.evaluate("pattFill", e);
314
- if (o) return this.processPatternFill(t, o);
315
- const i = t.evaluate("blipFill", e);
316
- return i ? this.processImageFill(t, i) : null;
317
- }
318
- processGradFill(e, s) {
319
- const o = { type: y.Type.Gradient };
320
- s.hasAttribute("rotWithShape") && (o.isRotatedWithShape = "1" === s.getAttribute("rotWithShape"));
321
- const n = e.evaluate("lin", s);
322
- n && (o.gradientType = y.GradientType.Linear, n.hasAttribute("ang") && (o.angle = r(n.getAttribute("ang"))), n.hasAttribute("scaled") && (o.scaled = t(n.getAttribute("scaled"))));
323
- const a = {};
324
- s.hasAttribute("flip") && (a.mirror = s.getAttribute("flip")), Object.keys(a).length > 0 && (o.tile = a);
325
- const l = e.evaluate("path", s);
326
- if (l) {
327
- l.hasAttribute("path") && (o.gradientType = U(l.getAttribute("path")));
328
- const t = e.evaluate("fillToRect", l);
329
- t && (o.focus = this.getRect(t));
330
- }
331
- const c = e.evaluate("tileRect", s);
332
- c && (o.tile || (o.tile = {}), o.tile.bounds = this.getRect(c));
333
- const u = [], h = e.evaluate("gsLst/gs", s), p = h ? h.length : 0;
334
- for (let t = 0; t < p; t++) {
335
- const s = h.item(t), r = {
336
- offset: i(s.getAttribute("pos") ?? ""),
337
- color: this.processAdjColor(e, s)
338
- };
339
- u.push(r);
340
- }
341
- return u.length > 0 && (o.stops = u), o;
342
- }
343
- getRect(t) {
344
- const e = {};
345
- return t.hasAttribute("t") && (e.t = i(t.getAttribute("t"))), t.hasAttribute("l") && (e.l = i(t.getAttribute("l"))), t.hasAttribute("b") && (e.b = i(t.getAttribute("b"))), t.hasAttribute("r") && (e.r = i(t.getAttribute("r"))), 0 === Object.keys(e).length ? null : e;
346
- }
347
- processImageFill(e, s) {
348
- const r = { type: y.Type.Image };
349
- return s.hasAttribute("rotWithShape") && (r.isRotatedWithShape = t(s.getAttribute("rotWithShape"))), s.hasAttribute("dpi") && (r.dpi = s.getAttribute("dpi")), r.ref = "https://www.sheetxl.com/logo-color-padded-white.jpg", r.tile = !1, r;
350
- }
351
- processPatternFill(t, e) {
352
- const s = { type: y.Type.Pattern };
353
- s.patternType = e.getAttribute("prst");
354
- const r = t.evaluate("bgClr", e);
355
- if (r) {
356
- const e = this.processAdjColor(t, r);
357
- e && (s.background = e);
358
- }
359
- const o = t.evaluate("fgClr", e);
360
- if (o) {
361
- let e = this.processAdjColor(t, o);
362
- e && (s.foreground = e);
363
- }
364
- return s;
365
- }
366
- processAdjColor(t, e) {
367
- const s = t.evaluate("hslClr", e);
368
- if (s) return this.processHslClr(t, s);
369
- const r = t.evaluate("prstClr", e);
370
- if (r) return this.processClrWithValAttribute(t, r);
371
- const o = t.evaluate("schemeClr", e);
372
- if (o) return this.processClrWithValAttribute(t, o);
373
- const i = t.evaluate("sysClr", e);
374
- if (i) {
375
- let e = this.processClrWithValAttribute(t, i);
376
- const s = i.getAttribute("lastClr");
377
- return e && s && (e += ` lastClr ${s}`), e;
378
- }
379
- const n = t.evaluate("scrgbClr", e);
380
- if (n) return this.processScrgbClrElement(t, n);
381
- const a = t.evaluate("srgbClr", e);
382
- return a ? this.processSrgbClrElement(t, a) : null;
383
- }
384
- processScrgbClrElement(t, e) {
385
- let s = "lrgba(" + i(e.getAttribute("r") ?? "") + "," + i(e.getAttribute("g") ?? "") + "," + i(e.getAttribute("b") ?? "") + ")";
386
- return s += this.processAdjustments(t, e), s;
387
- }
388
- processSrgbClrElement(t, e) {
389
- let s = e.getAttribute("val");
390
- return s += this.processAdjustments(t, e), s;
391
- }
392
- processHslClr(t, e) {
393
- let s = "hsl(" + r(e.getAttribute("hue") ?? "") + "," + i(e.getAttribute("sat") ?? "") + "," + i(e.getAttribute("lum") ?? "") + ")";
394
- return s += this.processAdjustments(t, e), s;
395
- }
396
- processClrWithValAttribute(t, e) {
397
- const s = e.getAttribute("val");
398
- if (!s) return null;
399
- let r = s;
400
- return r += this.processAdjustments(t, e), r;
401
- }
402
- processAdjustments(t, e) {
403
- let s = "";
404
- const r = e.childNodes, o = r.length;
405
- for (let e = 0; e < o; e++) {
406
- const o = r.item(e);
407
- if (1 === o.nodeType) {
408
- let e = o.localName;
409
- s += "hue" === e || "hueOff" === e || "hueMod" === e ? this.processAdjustmentElement(t, o, e, 6e4) : "gray" === e || "comp" === e || "inv" === e || "gamma" === e || "invGamma" === e ? this.processAdjustmentElement(t, o, e, 1) : "alpha" === e || "alphaOff" === e || "alphaMod" === e ? this.processAdjustmentElement(t, o, e, 1e5) : this.processAdjustmentElement(t, o, e);
410
- }
411
- }
412
- return s;
413
- }
414
- processAdjustmentElement(t, e, s, r = 1e3) {
415
- const o = e.getAttribute("val");
416
- return o ? ` ${s} ${!o || parseFloat(o) / r}` : ` ${s}`;
417
- }
418
- }, U = (t) => "circle" === t ? "radial" : t, X = (t) => {
419
- if ("rnd" === t) return "round";
420
- if ("flat" === t) return "butt";
421
- if ("sq" === t) return "square";
422
- throw new Error("Invalid lineCap type: " + t);
423
- }, W = class extends z {
424
- visit(t, e, s) {
425
- try {
426
- const r = t.evaluate("xfrm", e);
427
- if (r) {
428
- L(r, s);
429
- const e = {
430
- x: 0,
431
- y: 0,
432
- width: 0,
433
- height: 0
434
- }, o = t.evaluate("off", r);
435
- o && (e.x = l(o.getAttribute("x")) ?? 0, e.y = l(o.getAttribute("y")) ?? 0);
436
- const i = t.evaluate("ext", r);
437
- o && (e.width = l(i.getAttribute("cx")) ?? 0, e.height = l(i.getAttribute("cy")) ?? 0), s.bounds = e;
438
- }
439
- const o = t.evaluate("prstGeom", e);
440
- o?.hasAttribute("prst") ? s.geometry = o?.getAttribute("prst") : t.evaluate("customGeom", e) && t.warn("Custom shape geometry is not supported; the shape keeps its bounds only.", { onceKey: "xlsx.shape.customGeometry" });
441
- const i = this.getFill(t, e);
442
- i && Object.keys(i).length > 0 && (s.fill = i);
443
- const n = this.getStroke(t, e);
444
- return n && Object.keys(n).length > 0 && (s.stroke = n), s;
445
- } catch (e) {
446
- t.warn(`Unable to read shape properties: ${e?.message ?? e}`, { onceKey: "xlsx.shape.unreadable" });
447
- }
448
- }
449
- }, G = class {
450
- visit(t, e, s) {
451
- let r = {};
452
- if (_(t, e, r, "grouping", "grouping"), B(t, e, r, "varyColors", "varyColors"), R(t, e, r, "gapWidth", "gapWidth", .01), R(t, e, r, "overlap", "overlap", .01), this.parseType(t, e, r), E(t, e, r, "bubbleScale", "bubbleScale"), B(t, e, r, "showNegBubbles", "showNegativeBubbleValues"), B(t, e, r, "sizeRepresents", "bubbleSizeRepresentsWidth"), E(t, e, r, "firstSliceAng", "startAngle"), E(t, e, r, "holeSize", "holeSize"), _(t, e, r, "scatterStyle", "scatterStyle"), this.parseAxisIds(t, e, r), Object.keys(r).length > 0) {
453
- let e = t.getVisitorParamsState().get("types");
454
- e || (t.warn("A chart type was read outside a chart; its types were started fresh.", { onceKey: "xlsx.chart.typesState" }), e = [], t.getVisitorParamsState().set("types", e)), e.push(r);
455
- }
456
- return r;
457
- }
458
- parseType(t, e, s) {
459
- switch (e.localName) {
460
- case "areaChart":
461
- s.type = "area";
462
- break;
463
- case "bubbleChart":
464
- s.type = "bubble";
465
- break;
466
- case "doughnutChart":
467
- case "ofPieType":
468
- case "pieChart":
469
- s.type = "pie";
470
- break;
471
- case "lineChart":
472
- s.type = "line";
473
- break;
474
- case "scatterChart": s.type = "scatter";
475
- }
476
- }
477
- parseAxisIds(t, e, s) {
478
- const r = t.evaluate("axId", e);
479
- r && 0 !== r.length && (s.xAxisId = r.item(0).getAttribute("val"), s.yAxisId = r.item(1).getAttribute("val"));
480
- }
481
- }, K = (t, e, s) => {
482
- if (!0 === t.getValAttrAsBoolean("invertIfNegative", e)) if (t.evaluate("extLst/ext/invertSolidFillFmt", e)) {
483
- if (s.fill && s.fillNegative) {
484
- const e = t.getFromPath(s, "fill.solid.adjs");
485
- e && t.setToPath(s, "fillNegative.solid.adjs", e);
486
- }
487
- } else {
488
- const t = { val: "FFFFFF" }, e = {};
489
- e.solid = t, s.fillNegative = e;
490
- const r = { val: "000000" }, o = {};
491
- o.solid = r;
492
- const i = {};
493
- i.fill = o, s.strokeNegative = i;
494
- }
495
- }, $ = class extends z {
496
- constructor(t = "text") {
497
- super(), this._jsonKey = t;
498
- }
499
- getTextPath() {
500
- return this._jsonKey;
501
- }
502
- visit(t, e, s) {
503
- let r = t.getFromPath(s, this.getTextPath());
504
- return r || (r = {}), this.parseTextElement(t, e, r, !1), Object.keys(r).length > 0 && t.setToPath(s, this.getTextPath(), r), s;
505
- }
506
- parseTextElement(t, e, s, r) {
507
- const o = t.evaluate("p/pPr/defRPr", e) ?? t.evaluate("defRPr", e), i = void 0 !== o?.length ? o.item(0) : o;
508
- i && (this.parseTextProperties(t, i, s), new W().visit(t, i, s));
509
- const n = s.runs ?? [], a = t.evaluate("p/r", e) ?? t.evaluate("r", e), l = (e) => {
510
- const s = {};
511
- let r = t.evaluate("t", e);
512
- const o = t.evaluate("rPr", e);
513
- o && this.parseTextProperties(t, o, s), r && r.firstChild ? s.text = r.firstChild.textContent ?? "" : e.textContent && (s.text = e.textContent ?? ""), Object.keys(s).length > 0 && n.push(s);
514
- };
515
- if (void 0 !== a?.length) for (let t = 0; a && t < a.length; t++) l(a.item(t));
516
- else l(a || e);
517
- n.length > 0 && (s.runs = n);
518
- const c = t.evaluate("bodyPr", e);
519
- c && L(c, s);
520
- }
521
- parseTextProperties(t, e, s) {
522
- if (!e) return;
523
- e.hasAttribute("sz") && (s.size = parseFloat(e.getAttribute("sz")) / 100), e.hasAttribute("b") && (s.weight = "1" === e.getAttribute("b") ? 700 : 400), e.hasAttribute("i") && (s.italic = "1" === e.getAttribute("i")), e.hasAttribute("u") && (s.underline = e.getAttribute("u")), e.hasAttribute("strike") && (s.strike = e.getAttribute("strike"));
524
- const r = this.getFill(t, e);
525
- r && Object.keys(r).length > 0 && (s.color = r);
526
- const o = t.evaluate("latin", e);
527
- if (o && !o.getAttribute("typeface").startsWith("+")) {
528
- const t = s.font ?? {};
529
- if (o.hasAttribute("typeface") && (t.family = o.getAttribute("typeface")), o.hasAttribute("panose")) {
530
- const e = o.getAttribute("panose");
531
- e && (t.fallbacks = [v.getPanoseFallback(e)]);
532
- }
533
- o.hasAttribute("pitchFamily") && (t.pitch = o.getAttribute("pitchFamily")), o.hasAttribute("charset") && (t.charset = o.getAttribute("charset")), Object.keys(t).length > 0 && (s.font = t);
534
- }
535
- }
536
- }, H = class {
537
- visit(t, e, s) {}
538
- processDataBarColor(t, e, s, r, o = "auto") {
539
- if (!e) return;
540
- const i = n((t) => e.getAttribute(t), o);
541
- return i && (s[r] = i), s;
542
- }
543
- processFonts(t, e, s) {
544
- if (!e) return;
545
- const r = e.childNodes;
546
- let o = 0;
547
- const i = r.length;
548
- for (let e = 0; e < i; e++) {
549
- const i = r.item(e);
550
- if (1 === i.nodeType && "font" === i.localName) {
551
- const e = {};
552
- this.processFont(t, i, e), s[o++] = e;
553
- }
554
- }
555
- return s;
556
- }
557
- processFont(t, e, s) {
558
- t.getValAttrAsBoolean("b", e, !0) && (s.weight = 700), t.getValAttrAsBoolean("i", e, !0) && (s.style = v.Style.Italic), t.getValAttrAsBoolean("strike", e, !0) && (s.strike = !0);
559
- const r = t.evaluate("u", e);
560
- r && (s.underline = r.getAttribute("val") || v.UnderlineStyle.Single), _(t, e, s, "vertAlign", "verticalAlign"), "superscript" === s.verticalAlign ? s.verticalAlign = v.VerticalAlignment.Super : "subscript" === s.verticalAlign && (s.verticalAlign = v.VerticalAlignment.Sub), R(t, e, s, "sz", "size");
561
- const o = t.evaluate("color", e);
562
- this.processDataBarColor(t, o, s, "color"), s.color || (s.color = "auto"), _(t, e, s, "name", "family"), _(t, e, s, "rFont", "family");
563
- const i = t.evaluate("family", e);
564
- if (i) {
565
- const t = i.getAttribute("val");
566
- if (t) switch (t) {
567
- case "1":
568
- s.fallbacks = ["serif"];
569
- break;
570
- case "2":
571
- s.fallbacks = ["sans-serif"];
572
- break;
573
- case "3":
574
- s.fallbacks = ["monospace"];
575
- break;
576
- case "4":
577
- s.fallbacks = ["cursive"];
578
- break;
579
- case "5": s.fallbacks = ["fantasy"];
580
- }
581
- }
582
- return _(t, e, s, "scheme", "scheme"), void 0 !== s.family && void 0 === s.scheme && (s.scheme = v.Scheme.None), B(t, e, s, "shadow", "shadow", !0), B(t, e, s, "outline", "outline", !0), t.getValAttrAsBoolean("condense", e, !0) && (s.letterSpacing = -1), t.getValAttrAsBoolean("extend", e, !0) && (s.letterSpacing = 1), E(t, e, s, "charset", "charset"), s;
583
- }
584
- processFills(t, e, s) {
585
- if (!e) return;
586
- const r = e.childNodes;
587
- let o = 0;
588
- const i = r.length;
589
- for (let e = 0; e < i; e++) {
590
- const i = r.item(e);
591
- 1 === i.nodeType && "fill" === i.localName && this.processFill(t, i, s, o++);
592
- }
593
- return s;
594
- }
595
- processFill(t, e, s, r) {
596
- const o = { type: y.Type.None }, i = e.childNodes;
597
- let n = !1;
598
- const a = i.length;
599
- for (let e = 0; !n && e < a; e++) {
600
- const s = i.item(e);
601
- 1 === s.nodeType && ("gradientFill" === s.localName ? (this.processGradientFill(t, s, o), n = !0) : "patternFill" === s.localName && (this.processPatternFill(t, s, o), n = !0));
602
- }
603
- return s[r] = o, s;
604
- }
605
- processGradientFill(t, e, s) {
606
- if (!e) return;
607
- s.type = y.Type.Gradient;
608
- const r = [];
609
- s.stops = r;
610
- const o = e.getAttribute("type");
611
- o && (s.gradientType = o);
612
- const i = e.hasAttribute("degree") ? parseFloat(e.getAttribute("degree")) : 0;
613
- (i + 90) % 360 != 0 && (s.angle = (i + 90) % 360), (e.hasAttribute("left") || e.hasAttribute("top") || e.hasAttribute("right") || e.hasAttribute("bottom")) && (s.focus = {
614
- left: q(e.getAttribute("left")),
615
- top: q(e.getAttribute("top")),
616
- right: q(e.getAttribute("right")),
617
- bottom: q(e.getAttribute("bottom"))
618
- });
619
- const n = e.childNodes, a = n.length;
620
- for (let e = 0; e < a; e++) {
621
- const s = n.item(e);
622
- if (1 === s.nodeType && "stop" === s.localName) {
623
- const e = {};
624
- r.push(e), e.offset = parseFloat(s.getAttribute("position") ?? "");
625
- const o = t.evaluate("color", s);
626
- this.processDataBarColor(t, o, e, "color");
627
- }
628
- }
629
- return s;
630
- }
631
- processPatternFill(t, e, s) {
632
- if (!e) return;
633
- const r = t.getVisitorParamsState().get("processingDXFs"), o = e.getAttribute("patternType") || (r ? y.BuiltInSheetPattern.Solid : y.BuiltInSheetPattern.None);
634
- if (o === y.BuiltInSheetPattern.None) return { none: !0 };
635
- s.type = y.Type.Pattern, o && (s.patternType = o);
636
- let i = "foreground", n = "background";
637
- const a = s.patternType === y.BuiltInSheetPattern.Solid && r;
638
- let l = a ? "dk1" : "lt1", c = a ? "lt1" : "dk1";
639
- if (a) {
640
- const t = i;
641
- i = n, n = t;
642
- }
643
- const u = t.evaluate("fgColor", e);
644
- this.processDataBarColor(t, u, s, i, l);
645
- const h = t.evaluate("bgColor", e);
646
- return this.processDataBarColor(t, h, s, n, c), a && (s.foreground || (s.foreground = "lt1"), s.background || (s.background = "dk1")), s;
647
- }
648
- processBorders(t, e, s, r) {
649
- if (!e) return;
650
- const o = e.childNodes;
651
- let i = 0;
652
- const n = o.length;
653
- for (let e = 0; e < n; e++) {
654
- const n = o.item(e);
655
- 1 === n.nodeType && "border" === n.localName && this.processBorder(t, n, s, i++, r);
656
- }
657
- return s;
658
- }
659
- processBorder(t, e, s, r, o) {
660
- if (!e) return;
661
- const i = {};
662
- return this.processBorderStroke(t, e, i, b.Edge.Left), this.processBorderStroke(t, e, i, b.Edge.Right), o ? (i.right || i.left) && (i.right ? i.vertical = { ...i.right } : i.vertical = { ...i.left }) : this.processBorderStroke(t, e, i, b.Edge.Vertical), this.processBorderStroke(t, e, i, b.Edge.Top), this.processBorderStroke(t, e, i, b.Edge.Bottom), o ? (i.bottom || i.top) && (i.bottom ? i.horizontal = { ...i.bottom } : i.horizontal = { ...i.top }) : this.processBorderStroke(t, e, i, b.Edge.Horizontal), s[r] = i, s;
663
- }
664
- processBorderStroke(t, e, s, r) {
665
- if (!e) return;
666
- const o = t.evaluate(r, e);
667
- if (!o) return;
668
- const i = {};
669
- o.hasAttribute("style") ? i.style = o.getAttribute("style") : t.getVisitorParamsState().get("processingDXFs") && (i.style = b.StrokeStyle.None);
670
- const n = t.evaluate("color", o);
671
- return n && this.processDataBarColor(t, n, i, "color"), Object.keys(i).length > 0 ? s[r] = i : null;
672
- }
673
- }, q = (t) => {
674
- if (!t) return 0;
675
- const e = parseFloat(t);
676
- return isNaN(e) ? 0 : e;
677
- }, J = {
678
- auto: "auto",
679
- autoNoTable: "automaticExceptTables",
680
- manual: "manual"
681
- }, Q = class {
682
- visit(t, e, s) {
683
- if (!e) return;
684
- let r = t.evaluate("*/cNvPr", e);
685
- return r.item && (r = r.item(0)), r && (t.copyFromAttribute(r, "name", s), t.copyFromAttribute(r, "descr", s, "description"), t.copyFromAttribute(r, "hidden", s, "hidden", t.BOOLEAN_COPY), t.copyFromAttribute(r, "id", s)), s;
686
- }
687
- }, Z = class extends Q {
688
- visit(t, e, s) {
689
- if (!e) return;
690
- if (t.getPath().includes("Fallback") && s.content) {
691
- const r = s.content.json;
692
- return "sp" === s.content.type && r?.xml && void 0 === r.fallbackXml && (r.fallbackXml = t.serializeElement(e) ?? void 0), s;
693
- }
694
- s = super.visit(t, e, s);
695
- const r = t.evaluate("nvSpPr/cNvSpPr", e);
696
- if (r) {
697
- const e = t.evaluate("spLocks", r);
698
- if (e) {
699
- e.hasAttribute("noChangeAspect") && (s.lockAspect = "1" === e.getAttribute("noChangeAspect"));
700
- const t = {};
701
- Object.keys(t).length > 0 && (s.locks = t);
702
- }
703
- }
704
- let o = t.evaluate("*/cNvPr", e);
705
- o?.item && (o = o.item(0));
706
- const i = o?.getAttribute?.("id"), n = i ? parseInt(i, 10) : void 0, a = {
707
- type: "sp",
708
- xml: t.serializeElement(e) ?? void 0,
709
- sourceId: void 0 === n || isNaN(n) ? void 0 : n
710
- };
711
- return s.content = {
712
- type: "sp",
713
- json: a
714
- }, a;
715
- }
716
- }, tt = "richTypes", et = "richData";
717
- function st(t, e) {
718
- const s = t.childNodes;
719
- for (let t = 0; t < s.length; t++) {
720
- const r = s.item(t);
721
- if (1 === r.nodeType) switch (r.localName) {
722
- case "b":
723
- e.bold = "0" !== r.getAttribute("val") && "false" !== r.getAttribute("val");
724
- break;
725
- case "i":
726
- e.italic = "0" !== r.getAttribute("val") && "false" !== r.getAttribute("val");
727
- break;
728
- case "sz": {
729
- const t = parseFloat(r.getAttribute("val") ?? "");
730
- isNaN(t) || (e.size = t);
731
- break;
732
- }
733
- case "rFont": {
734
- const t = r.getAttribute("val");
735
- t && (e.font = t);
736
- break;
737
- }
738
- case "color": {
739
- const t = r.getAttribute("rgb");
740
- t && (e.color = "#" + (8 === t.length ? t.substring(2) : t));
741
- break;
742
- }
743
- }
744
- }
745
- }
746
- var rt = class {
747
- visit(t, e, s) {
748
- if (!e) return;
749
- const r = e.childNodes, o = r.length;
750
- for (let e = 0; e < o; e++) {
751
- const o = r.item(e);
752
- 1 === o.nodeType && "Relationship" === o.localName && this.processRelationship(t, o, s);
753
- }
754
- return s;
755
- }
756
- processRelationship(t, e, s) {
757
- const r = {};
758
- t.copyFromAttribute(e, "Target", r, "target"), t.copyFromAttribute(e, "Type", r, "type"), t.copyFromAttribute(e, "TargetMode", r, "targetMode");
759
- s[e.getAttribute("Id")] = r;
760
- }
761
- }, ot = class {
762
- visit(t, e, s) {
763
- const r = [], o = e.childNodes, i = o.length;
764
- for (let e = 0; e < i; e++) {
765
- const s = o.item(e);
766
- if (1 !== s.nodeType) continue;
767
- const i = this.processProperty(t, s);
768
- i && r.push(i);
769
- }
770
- return r.length > 0 && (s.properties = r), r;
771
- }
772
- processProperty(t, e) {
773
- if (e) return e.getAttribute("xsi:type"), {
774
- key: e.localName,
775
- value: e.textContent || ""
776
- };
777
- }
778
- }, it = class {
779
- visit(t, e, s) {
780
- const r = [], o = e.childNodes, i = o.length;
781
- for (let e = 0; e < i; e++) {
782
- const s = o.item(e);
783
- if (1 !== s.nodeType) continue;
784
- const i = this.processProperty(t, s);
785
- i && r.push(i);
786
- }
787
- return r.length > 0 && (s.properties = r), r;
788
- }
789
- processProperty(t, e) {
790
- if (e) return {
791
- key: e.localName,
792
- value: e.textContent || ""
793
- };
794
- }
795
- }, nt = class {
796
- visit(t, e, s) {
797
- return B(t, e, s, "roundedCorners", "roundedCorners"), E(t, e, s, ".//AlternateContent/Fallback/style", "styleId"), t.getVisitorParamsState().set("types", []), t.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()), s.range = null, s;
798
- }
799
- afterVisit(t, e, s) {
800
- let r = {};
801
- s.types = r;
802
- let o = {}, i = 0, n = {}, a = 0, l = t.getVisitorParamsState().get("axes");
803
- const c = t.getVisitorParamsState().get("types"), u = c.length;
804
- for (let t = 0; t < u; t++) {
805
- const e = c[t];
806
- if (e.xAxisId) {
807
- const r = e.xAxisId, n = l.get(r);
808
- o[t + ""] = n, e.offsetXAxis = t, delete e.xAxisId, s.xAxes = o, o.length = ++i;
809
- }
810
- if (e.yAxisId) {
811
- const r = e.yAxisId, o = l.get(r);
812
- n[t + ""] = o, e.offsetYAxis = t, delete e.yAxisId, s.yAxes = n, n.length = ++a;
813
- }
814
- r[t + ""] = e;
815
- }
816
- r.length = c.length;
817
- const h = t.getVisitorParamsState().get("series");
818
- if (!h || 0 === h.length) return;
819
- const p = {};
820
- s.series = p;
821
- const d = h.length;
822
- for (let t = 0; t < d; t++) p[t + ""] = h[t];
823
- p.length = d, t.getVisitorParamsState().delete("types"), t.getVisitorParamsState().delete("axes"), t.getVisitorParamsState().delete("series");
824
- }
825
- }, at = class {
826
- visit(t, e, s) {
827
- let r = {};
828
- return s.plotArea = r, r;
829
- }
830
- }, lt = W, ct = class extends G {
831
- parseType(t, e, s) {
832
- const r = t.getValAttrAsString("barDir", e);
833
- r && (s.type = "col" === r ? "column" : "bar");
834
- }
835
- }, ut = G, ht = class {
836
- constructor(t) {
837
- this.jsonKey = t;
838
- }
839
- visit(t, e, s) {
840
- let r = {}, o = r, i = t.getValAttrAsString("idx", e);
841
- null !== i && (o = {}, o[i] = r);
842
- const n = t.getValAttrAsBoolean("delete", e);
843
- this.parseNumFormat(t, e, r), !0 === n ? (r.showBubbleSize = !1, r.showCatName = !1, r.showLeaderLines = !1, r.showPercentage = !1, r.showSerName = !1, r.showVal = !1, r.showLegendKey = !1) : (B(t, e, r, "showBubbleSize", "showBubbleSize"), B(t, e, r, "showCatName", "showCatName"), B(t, e, r, "showLeaderLines", "showLeaderLines"), B(t, e, r, "showPercent", "showPercentage"), B(t, e, r, "showSerName", "showSerName"), B(t, e, r, "showVal", "showVal"), B(t, e, r, "showLegendKey", "showLegendKey"));
844
- const a = t.evaluate("separator", e);
845
- return null !== a && (r.separator = a.textContent), _(t, e, r, "dLblPos", "position"), s[this.jsonKey] = o, r;
846
- }
847
- parseNumFormat(t, e, s) {
848
- const r = t.evaluate("numFmt", e);
849
- r && (s.formatCode = r.getAttribute("formatCode"), r.hasAttribute("sourceLinked") && (s.sourceLinked = "1" === r.getAttribute("sourceLinked")));
850
- }
851
- }, pt = class {
852
- visit(t, e, s) {
853
- const r = {};
854
- E(t, e, r, "explosion", "explosion");
855
- let o = t.evaluate("cat/*/f", e);
856
- o || (o = t.evaluate("xVal/*/f", e));
857
- let i = null;
858
- null !== o && null !== o.firstChild && (i = o.firstChild.nodeValue), o || (o = t.evaluate("cat/strLit", e), o || (o = t.evaluate("cat/numLit", e)), o && (i = this.parsePointsAsString(t, o))), null !== i && (r.xRange = i);
859
- let n = t.evaluate("val/*/f", e);
860
- n || (n = t.evaluate("yVal/*/f", e));
861
- let a = null;
862
- n && n.firstChild && (a = n.firstChild.nodeValue), n || (n = t.evaluate("val/numLit", e), null !== n && (a = this.parsePointsAsString(t, n))), null !== a && (r.valRange = a), this.parseTitleRangeOrValue(t, e, r), E(t, e, r, "idx", "idx"), B(t, e, r, "smooth", "smooth"), r.offsetChart = t.getVisitorParamsState().get("types").length - 1;
863
- let l = t.getVisitorParamsState().get("series");
864
- return l || (l = [], t.getVisitorParamsState().set("series", l)), l.push(r), r;
865
- }
866
- parseTitleRangeOrValue(t, e, s) {
867
- const r = t.evaluate("tx/strRef/f", e);
868
- if (null !== r) {
869
- const e = r.firstChild.nodeValue;
870
- t.setToPath(s, "title.range", e);
871
- } else {
872
- const r = t.evaluate("tx/v", e);
873
- null !== r && t.setToPath(s, "title.text.simpleRun", r.firstChild.nodeValue);
874
- }
875
- }
876
- parsePointsAsString(t, e) {
877
- let s = "{";
878
- const r = t.getValAttrAsInteger("ptCount", e), o = t.evaluate("pt", e), i = [];
879
- for (let s = 0; o && r && s < r; s++) {
880
- let r = null;
881
- const o = t.evaluate("pt[@idx='" + s + "']/v", e);
882
- o && (r = o.textContent), i[s] = r;
883
- }
884
- for (let t = 0; t < i.length; t++) t > 0 && (s += ","), void 0 !== i[t] && (s += i[t]);
885
- return s += "}", s;
886
- }
887
- afterVisit(t, e, s) {
888
- K(t, e, s);
889
- let r = t.getFromPath(s, "points");
890
- if (r) {
891
- const e = Object.keys(r);
892
- for (let o = 0; o < e.length; o++) {
893
- const i = e[o], n = t.getFromPath(r, i);
894
- if (!n) continue;
895
- let a = t.getFromPath(n, "markers");
896
- a && (t.setToPath(s, "markers.points." + i, a), delete n.markers);
897
- }
898
- }
899
- }
900
- }, dt = class {
901
- DataPointVisitor() {}
902
- visit(t, e, s) {
903
- let r = t.getFromPath(s, "points"), o = null;
904
- r ? o = r : (o = {}, t.setToPath(s, "points", o));
905
- let i = {}, n = t.getValAttrAsString("idx", e);
906
- return null !== n && (o[n] = i), B(t, e, i, "bubble3D", "bubble3D"), E(t, e, i, "explosion", "explosion"), K(t, e, i), i;
907
- }
908
- }, gt = class {
909
- visit(t, e, s) {
910
- const r = e.parentNode.localName;
911
- if ("ser" === r || "dPt" === r) {
912
- const r = {}, o = t.getValAttrAsString("size", e);
913
- null !== o && (r.size = o);
914
- const i = t.getValAttrAsString("symbol", e);
915
- return i && (r.type = i), s.markers = r, r;
916
- }
917
- return null;
918
- }
919
- }, mt = class {
920
- visit(t, e, s) {
921
- let r = {};
922
- this.parseScaling(t, e, r), R(t, e, r, "majorUnit", "majorUnits"), R(t, e, r, "minorUnit", "minorUnits"), B(t, e, r, "delete", "shown"), this.parseOrientation(t, e, r), this.parseNumFormat(t, e, r), _(t, e, r, "majorTickMark", "majorTickMarks"), _(t, e, r, "minorTickMark", "minorTickMarks"), _(t, e, r, "crosses", "crosses"), R(t, e, r, "crossesAt", "crosses"), _(t, e, r, "crossBetween", "crossBetween"), this.parseLabelAlign(t, e, r), E(t, e, r, "lblOffset", "labelOffset"), _(t, e, r, "tickLblPos", "labelPosition");
923
- const o = t.getValAttrAsInteger("noMultiLvlLbl", e);
924
- r.labelMultiLevel = null !== o && 0 === o, E(t, e, r, "tickMarkSkip", "tickMarkSkip"), E(t, e, r, "tickLblSkip", "labelInterval"), this.parseDisplayCustOrBuiltInUnit(e, t, r), this.parseTimeUnits(t, e, r, "majorUnitDates", "majorTimeUnit", "majorUnit"), this.parseTimeUnits(t, e, r, "minorUnitDates", "minorTimeUnit", "minorUnit"), _(t, e, r, "baseTimeUnit", "baseUnitDates"), t.getVisitorParamsState().get("axes") || (t.warn("An axis was read outside a chart; its axes were started fresh.", { onceKey: "xlsx.chart.axesState" }), t.getVisitorParamsState().set("axes", /* @__PURE__ */ new Map()));
925
- const i = t.getValAttrAsString("axId", e);
926
- return t.getVisitorParamsState().get("axes").set(i, r), r;
927
- }
928
- parseTimeUnits(t, e, s, r, o, i) {
929
- const n = {};
930
- let a = t.getValAttrAsString(o, e);
931
- null !== a && (n.dem = a, n.amt = t.getValAttrAsString(i, e)), Object.keys(n).length > 0 && (s[r] = n);
932
- }
933
- parseDisplayCustOrBuiltInUnit(t, e, s) {
934
- let r = e.getValAttrAsString("dispUnits/builtInUnit", t);
935
- r || (r = e.getValAttrAsString("dispUnits/custUnit", t)), r && (s.displayUnits = r);
936
- }
937
- parseLabelAlign(t, e, s) {
938
- let r = t.getValAttrAsString("lblAlgn", e);
939
- null !== r && ("ctr" === r ? s.labelAlign = "center" : "l" === r ? s.labelAlign = "left" : "r" === r && (s.labelAlign = "right"));
940
- }
941
- parseOrientation(t, e, s) {
942
- const r = t.getValAttrAsString("AxPos", e);
943
- null !== r && ("b" === r ? s.orientation = "bottom" : "l" === r ? s.orientation = "left" : "r" === r ? s.orientation = "right" : "t" === r && (s.orientation = "top"));
944
- }
945
- parseNumFormat(t, e, s) {
946
- const r = {}, o = t.evaluate("numFmt", e);
947
- null !== o && (o.hasAttribute("formatCode") && (r.formatCode = o.getAttribute("formatCode")), o.hasAttribute("sourceLinked") && (r.sourceLinked = "1" === o.getAttribute("sourceLinked"))), Object.keys(r).length > 0 && (s.labels = r);
948
- }
949
- parseScaling(t, e, s) {
950
- const r = t.getValAttrAsString("scaling/orientation", e);
951
- null !== r && (s.inverted = "minMax" !== r);
952
- const o = t.getValAttrAsFloat("scaling/logBase", e);
953
- null !== o && (s.logBase = o, s.scaleType = "log"), R(t, e, s, "scaling/max", "max"), R(t, e, s, "scaling/min", "min");
954
- }
955
- afterVisit(t, e, s) {
956
- s.fill && s.labels && (s.labels.fill = s.fill, delete s.fill);
957
- let r = t.getValAttrAsBoolean("delete", e);
958
- null !== r && (t.setToPath(s, "labels.shown", !0 !== r), t.setToPath(s, "shown", !0 !== r));
959
- const o = t.getFromPath(s, "dispUnits.displayUnitsLabel");
960
- o && (t.setToPath(s, "displayUnitsLabel", o), delete s.dispUnits);
961
- const i = t.evaluate("title", e);
962
- t.setToPath(s, "title.shown", null !== i);
963
- const n = t.evaluate("minorGridlines", e);
964
- t.setToPath(s, "gridLinesMinor.shown", null !== n);
965
- const a = t.evaluate("majorGridlines", e);
966
- t.setToPath(s, "gridLinesMajor.shown", null !== a);
967
- }
968
- }, bt = $, ft = class {
969
- visit(t, e, s) {
970
- const r = t.getVisitorParamsState().get("series");
971
- let o = t.getValAttrAsInteger("idx", e), i = null !== o ? r[o] : void 0;
972
- if (i) {
973
- let s = t.getFromPath(i, "title");
974
- s || (s = {}, t.setToPath(i, "title", s));
975
- let r = s, o = t.getValAttrAsBoolean("delete", e);
976
- return null !== o && (r.shown = !o), r;
977
- }
978
- return s;
979
- }
980
- }, At = class {
981
- visit(t, e, s) {
982
- const r = {};
983
- return B(t, e, r, "overlay", "overlay"), _(t, e, r, "legendPos", "position"), s.legend = r, r;
984
- }
985
- }, yt = class extends W {
986
- visit(t, e, s) {
987
- const r = this.getFill(t, e);
988
- Object.keys(r).length > 0 && (s.fillNegative = r);
989
- const o = this.getStroke(t, e);
990
- return Object.keys(o).length > 0 && (s.strokeNegative = o), s;
991
- }
992
- }, vt = class extends $ {
993
- constructor(t = "title") {
994
- super(t);
995
- }
996
- parseTitleRangeOrValue(t, e, s) {
997
- let r = t.evaluate("tx/strRef/f", e) ?? null;
998
- if (r) {
999
- const e = r.firstElementChild.nodeValue;
1000
- t.setToPath(s, "range", e);
1001
- }
1002
- }
1003
- visit(t, e, s) {
1004
- const r = {};
1005
- B(t, e, r, "overlay", "overlay"), s[this._jsonKey] = r;
1006
- let o = t.getFromPath(r, this.getTextPath());
1007
- o || (o = {}), this.parseTitleRangeOrValue(t, e, r);
1008
- const i = t.evaluate("txPr", e);
1009
- i && this.parseTextElement(t, i, o, !1);
1010
- const n = t.evaluate("tx/rich", e);
1011
- return n && this.parseTextElement(t, n, o, !0), Object.keys(o).length > 0 && t.setToPath(r, "text", o), r;
1012
- }
1013
- afterVisit(t, e, s) {
1014
- if (s?.text) {
1015
- const t = s.text?.rotation ?? null;
1016
- null !== t && (s.rotation = parseInt(t), delete s.title.rotation);
1017
- }
1018
- }
1019
- }, Nt = class {
1020
- visit(t, e, s) {
1021
- const r = t.evaluate("manualLayout", e);
1022
- if (r) {
1023
- let e = {};
1024
- R(t, r, e, "x", "x"), R(t, r, e, "y", "y"), R(t, r, e, "w", "w"), R(t, r, e, "h", "h"), _(t, r, e, "xMode", "xMode"), _(t, r, e, "yMode", "yMode"), _(t, r, e, "wMode", "wMode"), _(t, r, e, "hMode", "hMode"), Object.keys(e).length > 0 && (s.manualLayout = e);
1025
- }
1026
- return s;
1027
- }
1028
- }, Ft = class {
1029
- visit(t, e, s) {
1030
- return s.name = e.getAttribute("name"), s;
1031
- }
1032
- }, Ct = class extends z {
1033
- visit(t, e, s) {
1034
- const r = {};
1035
- r.name = e.getAttribute("name");
1036
- const o = e.childNodes, i = o.length;
1037
- for (let s = 0; s < i; s++) {
1038
- const i = o.item(s);
1039
- if (1 === i.nodeType) {
1040
- let s = i.localName;
1041
- const o = t.evaluate(s, e);
1042
- r[s] = this.processAdjColor(t, o);
1043
- }
1044
- }
1045
- return Object.keys(r).length > 0 && (s.colors = r), r;
1046
- }
1047
- }, wt = class {
1048
- visit(t, e, s) {
1049
- const r = {};
1050
- r.name = e.getAttribute("name");
1051
- const o = t.evaluate("majorFont", e), i = this.processFontElement(t, o, {});
1052
- i && (r.majorFont = i.family, i.fallbacks && (r.majorFallbacks = i.fallbacks));
1053
- const n = t.evaluate("minorFont", e), a = this.processFontElement(t, n, {});
1054
- return a && (r.minorFont = a.family, a.fallbacks && (r.minorFallbacks = a.fallbacks)), s.fonts = r, r;
1055
- }
1056
- processFontElement(t, e, s) {
1057
- if (!e) return;
1058
- const r = t.evaluate("latin", e);
1059
- if (!r) return;
1060
- const o = r.getAttribute("typeface");
1061
- o && (s.family = o);
1062
- const i = r.getAttribute("panose");
1063
- return i && (s.fallbacks = [v.getPanoseFallback(i)]), s;
1064
- }
1065
- }, Pt = class extends z {
1066
- visit(t, e, s) {
1067
- const r = this.parseFillList(t, e, "fillStyleLst"), o = this.parseLnList(t, e, "lnStyleLst"), i = this.parseEffectStyleList(t, e, "effectStyleLst"), n = this.parseFillList(t, e, "bgFillStyleLst");
1068
- if (r && o && i && n) return s.fillStyleLst = r, s.lnStyleLst = o, s.effectStyleLst = i, void (s.bgFillStyleLst = n);
1069
- const a = t.serializeElement(e);
1070
- a && (s.formatSchemeXml = a);
1071
- }
1072
- parseFillList(t, e, s) {
1073
- const r = t.evaluate(s, e);
1074
- if (!r) return;
1075
- const o = [], i = r.childNodes, n = i.length;
1076
- for (let e = 0; e < n; e++) {
1077
- const s = i.item(e);
1078
- if (1 !== s.nodeType) continue;
1079
- const r = this.parseFillListItem(t, s);
1080
- if (void 0 === r) return;
1081
- o.push(r);
1082
- }
1083
- return o;
1084
- }
1085
- parseFillListItem(t, e) {
1086
- switch (e.localName) {
1087
- case "noFill": return { type: y.Type.None };
1088
- case "solidFill": {
1089
- const s = this.processAdjColor(t, e);
1090
- return s ? {
1091
- type: y.Type.Solid,
1092
- color: s
1093
- } : void 0;
1094
- }
1095
- case "gradFill": return this.processGradFill(t, e);
1096
- case "pattFill": return this.processPatternFill(t, e);
1097
- default: return;
1098
- }
1099
- }
1100
- parseLnList(t, e, s) {
1101
- const r = t.evaluate(s, e);
1102
- if (!r) return;
1103
- const o = [], i = r.childNodes, n = i.length;
1104
- for (let e = 0; e < n; e++) {
1105
- const s = i.item(e);
1106
- if (1 === s.nodeType) {
1107
- if (t.evaluate("headEnd", s) || t.evaluate("tailEnd", s)) return;
1108
- o.push(this.parseLn(t, s));
1109
- }
1110
- }
1111
- return o;
1112
- }
1113
- parseEffectStyleList(t, e, s) {
1114
- const r = t.evaluate(s, e);
1115
- if (!r) return;
1116
- const o = [], i = r.childNodes, n = i.length;
1117
- for (let e = 0; e < n; e++) {
1118
- const s = i.item(e);
1119
- if (1 !== s.nodeType) continue;
1120
- if (t.evaluate("scene3d", s) || t.evaluate("sp3d", s)) return;
1121
- const r = this.getEffects(t, s);
1122
- if (void 0 === r) return;
1123
- o.push(r ?? []);
1124
- }
1125
- return o;
1126
- }
1127
- }, St = class {
1128
- visit(t, e, s) {
1129
- if (!e) return;
1130
- const r = {}, o = e.getAttribute("r:id");
1131
- if (o) {
1132
- const e = t.getRef(o);
1133
- "string" == typeof e && (r.address = e);
1134
- }
1135
- return t.copyFromAttribute(e, "tooltip", r, "screenTip"), t.copyFromAttribute(e, "history", r, "history", t.BOOLEAN_COPY), t.copyFromAttribute(e, "tgtFrame", r, "target"), s.hyperlink = r, r;
1136
- }
1137
- }, xt = class {
1138
- visit(t, e, s) {
1139
- if (!e) return;
1140
- const r = {}, o = [];
1141
- return this.processFilterColumns(t, e, o, s), o.length > 0 && (r.conditions = o), Object.keys(r).length > 0 && (s.filter = r), r;
1142
- }
1143
- processColorFilter(t, e) {
1144
- const s = {}, r = {
1145
- operator: f.BuiltInOperatorNames.Color,
1146
- param: s
1147
- };
1148
- return t.copyFromAttribute(e, "cellColor", s, "cellColor", t.BOOLEAN_COPY), t.copyFromAttribute(e, "dxfId", s, "styleId", t.INT_COPY), r;
1149
- }
1150
- processCustomFilter(t, e) {
1151
- return h({
1152
- operator: e.getAttribute("operator"),
1153
- val: e.getAttribute("val")
1154
- });
1155
- }
1156
- processCustomFilters(t, e) {
1157
- const s = e.getAttribute("and"), r = "and" === s || "1" === s;
1158
- e.getAttribute("val");
1159
- const o = [], i = {
1160
- operator: r ? f.BuiltInOperatorNames.And : f.BuiltInOperatorNames.Or,
1161
- param: o
1162
- }, n = e.childNodes, a = n.length;
1163
- for (let e = 0; e < a; e++) {
1164
- const s = n.item(e);
1165
- if (1 !== s.nodeType) continue;
1166
- let r = null;
1167
- "customFilter" === s.localName && (r = this.processCustomFilter(t, s)), r && o.push(r);
1168
- }
1169
- return 1 === o.length ? o[0] : i;
1170
- }
1171
- processDynamicFilter(t, e) {
1172
- const s = {}, r = {
1173
- operator: f.BuiltInOperatorNames.TimePeriod,
1174
- param: s
1175
- };
1176
- let o = e.getAttribute("type");
1177
- return "aboveAverage" === o ? o = f.AverageType.Above : "belowAverage" === o && (o = f.AverageType.Below), Object.values(f.AverageType).includes(o) ? (r.operator = f.BuiltInOperatorNames.Average, t.copyFromAttribute(e, "val", s, "stdDevs", t.INT_COPY)) : t.copyFromAttribute(e, "val", s, "anchorDate", t.INT_COPY), t.copyFromAttribute(e, "type", s, "operator"), t.copyFromAttribute(e, "maxVal", s, "maxVal", t.INT_COPY), r;
1178
- }
1179
- processDateGroupItem(t, e) {
1180
- const s = {};
1181
- return t.copyFromAttribute(e, "dateTimeGrouping", s, "group"), t.copyFromAttribute(e, "day", s, "day", t.INT_COPY), t.copyFromAttribute(e, "hour", s, "hour", t.INT_COPY), t.copyFromAttribute(e, "minute", s, "minute", t.INT_COPY), t.copyFromAttribute(e, "month", s, "month", t.INT_COPY), t.copyFromAttribute(e, "second", s, "second", t.INT_COPY), t.copyFromAttribute(e, "year", s, "year", t.INT_COPY), s;
1182
- }
1183
- processFilterItem(t, e) {
1184
- if (e.hasAttribute("val")) return e.getAttribute("val");
1185
- }
1186
- processFilters(t, e) {
1187
- const s = {}, r = {
1188
- operator: f.BuiltInOperatorNames.InSet,
1189
- param: s
1190
- };
1191
- t.copyFromAttribute(e, "blank", r, "blank", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calendarType", r, "calendarType");
1192
- let o = [], i = [];
1193
- const n = e.childNodes, a = n.length;
1194
- for (let e = 0; e < a; e++) {
1195
- const s = n.item(e);
1196
- if (1 === s.nodeType) {
1197
- if ("dateGroupItem" === s.localName) {
1198
- const e = this.processDateGroupItem(t, s);
1199
- e && o.push(e);
1200
- } else if ("filter" === s.localName) {
1201
- const e = this.processFilterItem(t, s);
1202
- void 0 !== e && i.push(e);
1203
- }
1204
- }
1205
- }
1206
- return o.length > 0 && (s.dateGroups = o), i.length > 0 && (s.items = i), r;
1207
- }
1208
- processIcon(t, e) {
1209
- const s = {}, r = {
1210
- operator: f.BuiltInOperatorNames.Icon,
1211
- param: s
1212
- };
1213
- return t.copyFromAttribute(e, "iconId", s, "iconId", t.INT_COPY), t.copyFromAttribute(e, "iconSet", s), r;
1214
- }
1215
- processTop10(t, e) {
1216
- const s = {}, r = {
1217
- operator: f.BuiltInOperatorNames.TopN,
1218
- param: s
1219
- };
1220
- return t.copyFromAttribute(e, "filterVal", s, "filterVal", t.FLOAT_COPY), t.copyFromAttribute(e, "percent", s, "percent", t.BOOLEAN_COPY), t.copyFromAttribute(e, "top", s, "top", t.BOOLEAN_COPY), t.copyFromAttribute(e, "val", s, "val", t.FLOAT_COPY), r;
1221
- }
1222
- processFilterCriteria(t, e) {
1223
- if (!e) return;
1224
- const s = e.childNodes;
1225
- let r;
1226
- const o = s.length;
1227
- for (let e = 0; e < o; e++) {
1228
- const o = s.item(e);
1229
- 1 === o.nodeType && ("colorFilter" === o.localName ? r = this.processColorFilter(t, o) : "customFilters" === o.localName ? r = this.processCustomFilters(t, o) : "dynamicFilter" === o.localName ? r = this.processDynamicFilter(t, o) : "filters" === o.localName ? r = this.processFilters(t, o) : "iconFilter" === o.localName ? r = this.processIcon(t, o) : "top10" === o.localName && (r = this.processTop10(t, o)));
1230
- }
1231
- return r;
1232
- }
1233
- processFilterColumn(e, s, r) {
1234
- if (!s) return null;
1235
- if (!s.hasAttribute("colId")) return;
1236
- const o = parseInt(s.getAttribute("colId"));
1237
- let i = !1;
1238
- if (s.hasAttribute("hiddenButton") && (i = t(s.getAttribute("hiddenButton"))), i && r) {
1239
- let t = r.hiddenButtons;
1240
- t || (t = [], r.hiddenButtons = t), t.push(o);
1241
- }
1242
- let n = !1;
1243
- if (s.hasAttribute("showButton") && (n = t(s.getAttribute("showButton"))), n && r) {
1244
- let t = r.showButtons;
1245
- !0 !== t && (t || (t = [], r.showButtons = t), t[o] = !0);
1246
- }
1247
- const a = this.processFilterCriteria(e, s);
1248
- return a ? (a.index = o, a) : null;
1249
- }
1250
- processFilterColumns(t, e, s, r) {
1251
- if (!e) return;
1252
- const o = e.childNodes, i = o.length;
1253
- for (let e = 0; e < i; e++) {
1254
- const i = o.item(e);
1255
- if (1 === i.nodeType && "filterColumn" === i.localName) {
1256
- const e = this.processFilterColumn(t, i, r);
1257
- e && s.push(e);
1258
- }
1259
- }
1260
- return s;
1261
- }
1262
- }, Tt = class {
1263
- visit(e, s, r) {
1264
- if (!s) return;
1265
- const o = s.getAttribute("ref"), i = {};
1266
- s.hasAttribute("caseSensitive") && (i.collatorOptions = t(s.getAttribute("caseSensitive")) ? w.CaseSensitiveOptions : w.CaseInsensitiveOptions);
1267
- const n = s.getAttribute("sortMethod");
1268
- null != n && "none" !== n && ("stroke" === n ? i.collatorOptions = {
1269
- ...i.collatorOptions,
1270
- collation: "stroke"
1271
- } : "pinYin" === n && (i.collatorOptions = {
1272
- ...i.collatorOptions,
1273
- collation: "pinyin"
1274
- }));
1275
- const a = {};
1276
- s.hasAttribute("columnSort") && t(s.getAttribute("columnSort")) && (a.axis = N.Axis.Column);
1277
- const l = g.fastStringToRange(o), c = [];
1278
- return this.processSortConditions(e, s, c, l, i), c.length > 0 && (a.sorts = c), Object.keys(c).length > 0 && (r.sort = a), a;
1279
- }
1280
- processSortCondition(e, s, r, o) {
1281
- if (!s) return null;
1282
- const i = {};
1283
- if (!s.hasAttribute("ref")) return void e.warn("A sort condition has no ref; it was dropped.", { onceKey: "xlsx.sheet.sort.noRef" });
1284
- if (s.hasAttribute("ref")) {
1285
- const t = s.getAttribute("ref"), e = g.fastStringToRange(t);
1286
- i.index = r ? e.colStart - r.colStart : e.colStart;
1287
- }
1288
- const n = { ...o };
1289
- return i.criteria = n, n.reverse = !1, s.hasAttribute("descending") && (n.reverse = t(s.getAttribute("descending"))), e.copyFromAttribute(s, "sortBy", n, "sortOn"), e.copyFromAttribute(s, "dxfId", n), e.copyFromAttribute(s, "iconSet", n), e.copyFromAttribute(s, "customList", n), i;
1290
- }
1291
- processSortConditions(t, e, s, r, o) {
1292
- if (!e) return;
1293
- const i = e.childNodes, n = i.length;
1294
- for (let e = 0; e < n; e++) {
1295
- const n = i.item(e);
1296
- if (1 === n.nodeType && "sortCondition" === n.localName) {
1297
- const e = this.processSortCondition(t, n, r, o);
1298
- e && s.push(e);
1299
- }
1300
- }
1301
- }
1302
- }, Ot = class extends H {
1303
- visit(t, e, s) {
1304
- this.processNumFmts(t, t.evaluate("numFmts", e), null), t.getVisitorParamsState().set("colorsToProcess", /* @__PURE__ */ new Set());
1305
- const r = {
1306
- fills: {},
1307
- fonts: {},
1308
- borders: {}
1309
- };
1310
- this.processFonts(t, t.evaluate("fonts", e), r.fonts), this.processFills(t, t.evaluate("fills", e), r.fills), this.processBorders(t, t.evaluate("borders", e), r.borders, !0), r.fills[0] = { type: y.Type.None }, r.fills[1] = {
1311
- type: y.Type.Pattern,
1312
- patternType: y.BuiltInSheetPattern.Gray125
1313
- }, r.borders[0] = {
1314
- bottom: { style: b.StrokeStyle.None },
1315
- left: { style: b.StrokeStyle.None },
1316
- right: { style: b.StrokeStyle.None },
1317
- top: { style: b.StrokeStyle.None }
1318
- };
1319
- const o = [];
1320
- this.processXFs(t, t.evaluate("cellStyleXfs", e), o, r, null, !1);
1321
- const i = /* @__PURE__ */ new Map();
1322
- if (o.length > 0) {
1323
- const r = [];
1324
- this.processCellStyles(t, t.evaluate("cellStyles", e), r, o, i), s.named = r;
1325
- }
1326
- const n = [];
1327
- this.processXFs(t, t.evaluate("cellXfs", e), n, r, i), Object.keys(n).length > 0 && (s.direct = n);
1328
- const a = this.collectHiddenXfs(t.evaluate("cellXfs", e));
1329
- a.size > 0 && t.getVisitorParamsState().set(c, a);
1330
- const l = [];
1331
- return this.processDXFs(t, t.evaluate("dxfs", e), l), this.processTableStyles(t, t.evaluate("tableStyles", e), s, l), this.processIndexColors(t, t.evaluate("colors/indexedColors", e), s), this.processMruColors(t, t.evaluate("colors/mruColors", e), s), s;
1332
- }
1333
- processIndexColors(t, e, s) {
1334
- if (!e) return;
1335
- const r = [], o = e.childNodes, i = o.length;
1336
- for (let e = 0; e < i; e++) {
1337
- const s = o.item(e);
1338
- if (1 === s.nodeType && "rgbColor" === s.localName) {
1339
- const e = { color: null };
1340
- this.processDataBarColor(t, s, e, "color"), e.color && r.push(e.color);
1341
- }
1342
- }
1343
- s.indexedColors = r;
1344
- }
1345
- processMruColors(t, e, s) {
1346
- if (!e) return;
1347
- const r = [], o = e.childNodes, i = o.length;
1348
- for (let e = 0; e < i; e++) {
1349
- const s = o.item(e);
1350
- if (1 === s.nodeType && "color" === s.localName) {
1351
- const e = { color: null };
1352
- this.processDataBarColor(t, s, e, "color"), e.color && r.push(e.color);
1353
- }
1354
- }
1355
- r.length > 0 && (s.mruColors = r);
1356
- }
1357
- processNumFmts(t, e, s) {
1358
- if (!e) return;
1359
- const r = /* @__PURE__ */ new Map();
1360
- if (t.getVisitorParamsState().set("numFmts", r), !e) return;
1361
- const o = e.childNodes, i = o.length;
1362
- for (let t = 0; t < i; t++) {
1363
- const e = o.item(t);
1364
- if (1 === e.nodeType && "numFmt" === e.localName) {
1365
- const t = e.getAttribute("numFmtId"), s = e.getAttribute("formatCode");
1366
- if (t && s) {
1367
- const e = s;
1368
- r.set(parseInt(t), e);
1369
- }
1370
- }
1371
- }
1372
- }
1373
- processXFs(t, e, s, r, o = null, i = !0) {
1374
- if (!e) return;
1375
- const n = e.childNodes, a = n.length;
1376
- for (let e = 0; e < a; e++) {
1377
- const a = n.item(e);
1378
- if (1 === a.nodeType && "xf" === a.localName) {
1379
- const e = {};
1380
- this.processXF(t, a, e, r, o, i), s.push(e);
1381
- }
1382
- }
1383
- }
1384
- processXF(e, s, r, o, i, n) {
1385
- if (!s) return;
1386
- const a = s.getAttribute("xfId");
1387
- if (a && i) {
1388
- const t = i.get(parseInt(a));
1389
- t && t !== F.BuiltInName.Normal && (r.named = t);
1390
- }
1391
- const l = (e) => !(!n && s.hasAttribute(e)) || t(s.getAttribute(e)), c = (e) => !n || s.hasAttribute(e) && t(s.getAttribute(e)), u = "0", h = n ? u : void 0;
1392
- if (l("applyFont")) {
1393
- const t = s.getAttribute("fontId") ?? h;
1394
- if (void 0 !== t && (t !== u || c("applyFont"))) {
1395
- const e = o.fonts[t];
1396
- void 0 !== e && (r.font = e);
1397
- }
1398
- }
1399
- if (l("applyFill")) {
1400
- const t = s.getAttribute("fillId") ?? h;
1401
- if (void 0 !== t && (t !== u || c("applyFill"))) {
1402
- const e = o.fills[t];
1403
- void 0 !== e && Object.keys(e).length > 0 && (r.fill = e);
1404
- }
1405
- }
1406
- if (l("applyBorder")) {
1407
- const t = s.getAttribute("borderId") ?? h;
1408
- if (void 0 !== t && (t !== u || c("applyBorder"))) {
1409
- const e = o.borders[t];
1410
- void 0 !== e && (r.borders = e);
1411
- }
1412
- }
1413
- if (l("applyNumberFormat")) {
1414
- const t = s.getAttribute("numFmtId") ?? h;
1415
- if (void 0 !== t && (t !== u || c("applyNumberFormat"))) {
1416
- const s = parseInt(t);
1417
- let o;
1418
- const i = e.getVisitorParamsState();
1419
- if (i) {
1420
- const t = i.get("numFmts");
1421
- t && (o = t.get(s)), r.numberFormat = o ?? s;
1422
- } else e.warn("Number formats were unavailable; a cell format was not read.", { onceKey: "xlsx.style.numberFormat.state" });
1423
- }
1424
- }
1425
- if (l("applyAlignment")) {
1426
- const t = e.evaluate("alignment", s);
1427
- (t || c("applyAlignment")) && this.processAlignment(e, t, r);
1428
- }
1429
- if (l("applyProtection")) {
1430
- const t = e.evaluate("protection", s);
1431
- (t || c("applyProtection")) && this.processProtection(e, t, r);
1432
- }
1433
- const p = t(s.getAttribute("quotePrefix") ?? "");
1434
- p && (r.quotePrefix = p);
1435
- }
1436
- processAlignment(e, s, r) {
1437
- const o = {};
1438
- if (s?.hasAttribute("horizontal") ? o.horizontal = s.getAttribute("horizontal") : o.horizontal = C.HorizontalAlignment.General, s?.hasAttribute("vertical") ? o.vertical = s.getAttribute("vertical") : o.vertical = C.VerticalAlignment.Bottom, s?.hasAttribute("indent") ? o.indent = parseInt(s.getAttribute("indent")) : o.indent = 0, s?.hasAttribute("relativeIndent") ? o.relativeIndent = parseInt(s.getAttribute("relativeIndent")) : o.relativeIndent = 0, t(s?.getAttribute("wrapText") ?? "") ? o.overflow = C.Overflow.Wrap : o.overflow = C.Overflow.Visible, t(s?.getAttribute("shrinkToFit") ?? "") && (o.overflow = C.Overflow.Shrink), s?.hasAttribute("textRotation")) {
1439
- let t = parseFloat(s.getAttribute("textRotation"));
1440
- t > 0 && t <= 90 ? t = 360 - t : t > 90 && t <= 180 ? t -= 90 : 255 === t && (t = 0, o.stacked = !0), o.rotation = t;
1441
- } else o.rotation = 0;
1442
- s?.hasAttribute("justifyLastLine") && (o.justifyLastLine = t(s.getAttribute("justifyLastLine")));
1443
- const i = s?.getAttribute("readingOrder");
1444
- return i && ("0" === i ? o.readingDirection = C.ReadingDirection.Auto : "1" === i ? o.readingDirection = C.ReadingDirection.LeftToRight : "2" === i ? o.readingDirection = C.ReadingDirection.RightToLeft : e.warn(`Invalid readingOrder '${i}'; the direction was left automatic.`, { onceKey: "xlsx.style.readingOrder" })), Object.keys(o).length > 0 && (r.alignment = o), r;
1445
- }
1446
- collectHiddenXfs(e) {
1447
- const s = /* @__PURE__ */ new Set();
1448
- if (!e) return s;
1449
- const r = e.childNodes;
1450
- let o = 0;
1451
- for (let e = 0; e < r.length; e++) {
1452
- const i = r.item(e);
1453
- if (1 !== i.nodeType || "xf" !== i.localName) continue;
1454
- const n = i.childNodes;
1455
- for (let e = 0; e < n.length; e++) {
1456
- const r = n.item(e);
1457
- 1 === r.nodeType && "protection" === r.localName && t(r.getAttribute("hidden") ?? "") && s.add(o);
1458
- }
1459
- o++;
1460
- }
1461
- return s;
1462
- }
1463
- processProtection(e, s, r) {
1464
- if (!s) return;
1465
- const o = s.getAttribute("locked");
1466
- return r.protection = { alwaysUnlocked: !!o && !t(o) }, r;
1467
- }
1468
- processDXF(t, e, s) {
1469
- if (!e) return;
1470
- const r = e.childNodes, o = r.length;
1471
- for (let e = 0; e < o; e++) {
1472
- const o = r.item(e);
1473
- if (1 === o.nodeType && "font" === o.localName) {
1474
- const e = {};
1475
- this.processFont(t, o, e), s.font = e;
1476
- } else if (1 === o.nodeType && "fill" === o.localName) {
1477
- const e = [];
1478
- this.processFill(t, o, e, 0), e.length > 0 && e[0] && (s.fill = e[0]);
1479
- } else if (1 === o.nodeType && "border" === o.localName) {
1480
- const e = [];
1481
- this.processBorder(t, o, e, 0, !1), e.length > 0 && e[0] && (s.borders = e[0]);
1482
- } else if (1 === o.nodeType && "numFmt" === o.localName) {
1483
- const t = o.getAttribute("formatCode");
1484
- if (t) s.numberFormat = t;
1485
- else {
1486
- const t = o.getAttribute("numFmtId");
1487
- t && (s.numberFormat = Number(t));
1488
- }
1489
- } else 1 === o.nodeType && "alignment" === o.localName && this.processAlignment(t, o, s);
1490
- }
1491
- }
1492
- processDXFs(t, e, s) {
1493
- if (!e) return;
1494
- t.getVisitorParamsState().set("processingDXFs", !0);
1495
- const r = /* @__PURE__ */ new Map();
1496
- t.getVisitorParamsState().set("dxfs", r);
1497
- const o = e.childNodes, i = o.length;
1498
- for (let e = 0; e < i; e++) {
1499
- const i = o.item(e);
1500
- if (1 === i.nodeType && "dxf" === i.localName) {
1501
- const e = {};
1502
- this.processDXF(t, i, e);
1503
- const o = s.length;
1504
- r.set(o, e), s.push(e);
1505
- }
1506
- }
1507
- t.getVisitorParamsState().delete("processingDXFs");
1508
- }
1509
- processTableStyle(e, s, r, o, i = !1) {
1510
- const n = s.getAttribute("name"), a = { name: n };
1511
- s.hasAttribute("table") && (a.table = t(s.getAttribute("table"))), s.hasAttribute("pivot") && (a.pivot = t(s.getAttribute("pivot"))), i && !a.pivot && o.unshift(null);
1512
- const l = s.childNodes, c = l.length;
1513
- for (let t = 0; t < c; t++) {
1514
- const s = l.item(t);
1515
- if (1 === s.nodeType && "tableStyleElement" === s.localName) {
1516
- const t = s.getAttribute("type"), r = s.getAttribute("dxfId");
1517
- let i = null != r ? o?.[r] : void 0;
1518
- i || (e.warn(`A table style names a format that does not exist (dxfId '${r}').`, { onceKey: "xlsx.style.tableStyle.dxf" }), i = {}), a[t] = i;
1519
- let n = null;
1520
- s.hasAttribute("size") && (n = parseInt(s.getAttribute("size"))), n && !isNaN(n) && (i.size = n);
1521
- }
1522
- }
1523
- delete a.name, r[n] = a;
1524
- }
1525
- processTableStyles(t, e, s, r, o) {
1526
- if (!e) return;
1527
- const i = {}, n = e.getAttribute("defaultTableStyle");
1528
- n && (i.defaultTableStyle = n);
1529
- const a = e.getAttribute("defaultPivotStyle");
1530
- a && (i.defaultPivotStyle = a);
1531
- const l = e.childNodes, c = {}, u = l.length;
1532
- for (let e = 0; e < u; e++) {
1533
- const s = l.item(e);
1534
- 1 === s.nodeType && "tableStyle" === s.localName && this.processTableStyle(t, s, c, r, o);
1535
- }
1536
- return Object.keys(c).length > 0 && (i.styles = c), Object.keys(i).length > 0 && (s.tables = i), s;
1537
- }
1538
- processCellStyles(e, s, r, o, i) {
1539
- if (!s) return;
1540
- const n = s.childNodes, a = n.length;
1541
- for (let e = 0; e < a; e++) {
1542
- const s = n.item(e);
1543
- if (1 === s.nodeType && "cellStyle" === s.localName) {
1544
- const e = parseInt(s.getAttribute("xfId") ?? ""), n = s.getAttribute("name"), a = s.getAttribute("builtinId");
1545
- let l = n;
1546
- if (null !== a) {
1547
- const t = F.builtInNameFromId(parseInt(a));
1548
- void 0 !== t && (l = t);
1549
- }
1550
- if (i.set(e, l), !o[e]) continue;
1551
- const c = {
1552
- name: l,
1553
- style: o[e]
1554
- };
1555
- s.getAttribute("hidden") && (c.hidden = t(s.getAttribute("hidden"))), s.getAttribute("iLevel") && (c.iLevel = parseInt(s.getAttribute("iLevel"))), r.push(c);
1556
- }
1557
- }
1558
- }
1559
- afterVisit(t, e, s) {}
1560
- }, kt = class extends H {
1561
- visit(t, e, s) {
1562
- return this.processSheetRefs(t, t.evaluate("sheets", e), s), this.processExternalReferences(t, t.evaluate("externalReferences", e), s), this.processBookViews(t, t.evaluate("bookViews", e), s), this.processDefinedNames(t, t.evaluate("definedNames", e), s), this.processCalcPr(t, t.evaluate("calcPr", e), s), this.processPivotCaches(t, t.evaluate("pivotCaches", e), s), this.processWorkbookProtection(t, t.evaluate("workbookProtection", e), s), this.processWorkbookPr(t, t.evaluate("workbookPr", e), s), s;
1563
- }
1564
- processPassword(t, e, s, r = "workbook", o = "password") {
1565
- if (!e) return;
1566
- const i = {};
1567
- t.copyFromAttribute(e, `${r}AlgorithmName`, i, "algorithm"), t.copyFromAttribute(e, `${r}HashValue`, i, "hash"), t.copyFromAttribute(e, `${r}SaltValue`, i, "salt"), t.copyFromAttribute(e, `${r}SpinCount`, i, "spinCount", t.INT_COPY), Object.keys(i).length > 0 && (s[o] = i);
1568
- }
1569
- processWorkbookProtection(t, e, s) {
1570
- if (!e) return;
1571
- const r = {};
1572
- this.processPassword(t, e, r, "workbook", "password"), this.processPassword(t, e, r, "revisions", "revisionsPassword");
1573
- for (const t of u) r[t.key] = p(t, e.getAttribute(t.attribute));
1574
- return s.protection = r, s;
1575
- }
1576
- processCalcPr(t, e, s) {
1577
- if (!e) return;
1578
- const r = {};
1579
- t.copyFromAttribute(e, "calcMode", r, "calcMode", (t) => J[t] ?? null), t.copyFromAttribute(e, "fullCalcOnLoad", r, "fullCalcOnLoad", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcOnSave", r, "calcOnSave", t.BOOLEAN_COPY), t.copyFromAttribute(e, "calcCompleted", r, "calcCompleted", t.BOOLEAN_COPY), t.copyFromAttribute(e, "fullPrecision", r, "fullPrecision", t.BOOLEAN_COPY), t.copyFromAttribute(e, "forceFullCalc", r, "forceFullCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "concurrentCalc", r, "concurrentCalc", t.BOOLEAN_COPY), t.copyFromAttribute(e, "refMode", r, "refMode"), t.copyFromAttribute(e, "iterate", r, "iterate", t.BOOLEAN_COPY), t.copyFromAttribute(e, "iterateCount", r, "maxIteration", t.INT_COPY), t.copyFromAttribute(e, "iterateDelta", r, "maxIterateChange", t.FLOAT_COPY);
1580
- const o = e.getAttribute("calcId");
1581
- null !== o && t.getVisitorParamsState().set("calcId", o), s.calc = r;
1582
- }
1583
- processSheetRefs(t, e, s) {
1584
- if (!e) return;
1585
- const r = [], o = e.childNodes, i = o.length;
1586
- for (let e = 0; e < i; e++) {
1587
- const s = o.item(e);
1588
- 1 === s.nodeType && "sheet" === s.localName && this.processSheetRef(t, s, r);
1589
- }
1590
- s.sheets = r;
1591
- }
1592
- processSheetRef(t, e, s) {
1593
- const r = {};
1594
- t.copyFromAttribute(e, "name", r, "name"), t.copyFromAttribute(e, "state", r, "visibility"), t.copyFromAttribute(e, "sheetId", r, "sheetId", t.INT_COPY);
1595
- const o = e.getAttribute("r:id"), i = t.getRef(o);
1596
- i && (r.sheet = i), s.push(r);
1597
- }
1598
- processExternalReferences(t, e, s) {
1599
- if (!e) return;
1600
- const r = [], o = e.childNodes, i = o.length;
1601
- for (let e = 0; e < i; e++) {
1602
- const s = o.item(e);
1603
- if (1 === s.nodeType && "externalReference" === s.localName) {
1604
- const e = s.getAttribute("r:id"), o = e ? t.getRef(e) : null;
1605
- r.push(o ?? null);
1606
- }
1607
- }
1608
- r.length > 0 && (s.externalBooks = r);
1609
- }
1610
- processPivotCaches(t, e, s) {
1611
- if (!e) return;
1612
- const r = [], o = e.childNodes, i = o.length;
1613
- for (let e = 0; e < i; e++) {
1614
- const s = o.item(e);
1615
- if (1 !== s.nodeType || "pivotCache" !== s.localName) continue;
1616
- const i = parseInt(s.getAttribute("cacheId") ?? "", 10), n = s.getAttribute("r:id");
1617
- if (isNaN(i) || !n) continue;
1618
- const a = t.readEmbeddedPart(n);
1619
- a && r.push({
1620
- cacheId: i,
1621
- part: a
1622
- });
1623
- }
1624
- r.length > 0 && (s.pivotCaches = r);
1625
- }
1626
- processBookViews(t, e, s) {
1627
- if (!e) return;
1628
- const r = e.childNodes;
1629
- let o = 0;
1630
- const i = r.length;
1631
- for (let e = 0; o < 1 && e < i; e++) {
1632
- const i = r.item(e);
1633
- 1 === i.nodeType && "workbookView" === i.localName && (this.processWorkbookView(t, i, s), o++);
1634
- }
1635
- }
1636
- processWorkbookView(t, e, s) {
1637
- if (!e) return;
1638
- const r = {};
1639
- t.copyFromAttribute(e, "activeTab", r, "activeSheetId", [t.INT_COPY, (t) => t]), e.hasAttribute("activeTab") || (r.activeSheetId = 0), t.copyFromAttribute(e, "showHorizontalScroll", r, "showHorizontalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showVerticalScroll", r, "showVerticalScrollbar", t.BOOLEAN_COPY), t.copyFromAttribute(e, "showSheetTabs", r, "showTabs", t.BOOLEAN_COPY), t.copyFromAttribute(e, "tabRatio", r, "tabRatio", [t.FLOAT_COPY, (t) => t]), Object.keys(r).length > 0 && (s.view = r);
1640
- }
1641
- processDefineName(t, e, s, r) {
1642
- if (!e) return;
1643
- const o = {}, i = e.firstChild;
1644
- if (i && 3 === i.nodeType && (o.ref = i.textContent), t.copyFromAttribute(e, "name", o), t.copyFromAttribute(e, "comment", o), t.copyFromAttribute(e, "hidden", o, "hidden", t.BOOLEAN_COPY), e.hasAttribute("localSheetId")) {
1645
- const s = e.getAttribute("localSheetId");
1646
- if (!r[s]?.name) return void t.warn(`Defined name '${e.getAttribute("name")}' references a sheet with localSheetId '${s}' which does not exist.`);
1647
- o.scope = r[s].name;
1648
- }
1649
- t.copyFromAttribute(e, "customMenu", o), t.copyFromAttribute(e, "description", o), t.copyFromAttribute(e, "statusBar", o), t.copyFromAttribute(e, "help", o), t.copyFromAttribute(e, "shortcutKey", o), t.copyFromAttribute(e, "function", o, "function", t.BOOLEAN_COPY), t.copyFromAttribute(e, "functionGroupId", o, "functionGroupId", t.INT_COPY), t.copyFromAttribute(e, "publishToServer", o, "publishToServer", t.BOOLEAN_COPY), t.copyFromAttribute(e, "vbProcedure", o, "vbProcedure", t.BOOLEAN_COPY), t.copyFromAttribute(e, "xlm", o, "xlm", t.BOOLEAN_COPY), Object.keys(o).length > 0 && s.push(o);
1650
- }
1651
- processDefinedNames(t, e, s) {
1652
- if (!e) return;
1653
- const r = [], o = e.childNodes, i = o.length;
1654
- for (let e = 0; e < i; e++) {
1655
- const i = o.item(e);
1656
- 1 === i.nodeType && "definedName" === i.localName && this.processDefineName(t, i, r, s.sheets);
1657
- }
1658
- r.length > 0 && (s.names = r);
1659
- }
1660
- processWorkbookPr(t, e, s) {
1661
- e && (t.copyFromAttribute(e, "date1904", s, "date1904", t.BOOLEAN_COPY), t.copyFromAttribute(e, "codeName", s, "codeName"), t.copyFromAttribute(e, "updateLinks", s, "updateLinks"));
1662
- }
1663
- afterVisit(t, e, s) {}
1664
- }, Vt = class {
1665
- visit(t, e, s) {
1666
- const r = {};
1667
- return t.copyFromAttribute(e, "ref", s, "r"), t.getVisitorParamsState().set("ref", s.r), s.v = r, t.copyFromAttribute(e, "name", r), t.copyFromAttribute(e, "displayName", r), t.copyFromAttribute(e, "headerRowCount", r, "headerRowCount", t.INT_COPY), t.copyFromAttribute(e, "totalsRowCount", r, "totalsRowCount", t.INT_COPY), this.processTableColumns(t, e, r), this.processTableStyleInfo(t, e, r), t.copyFromAttribute(e, "id", r), t.copyFromAttribute(e, "comment", r, "description"), t.copyFromAttribute(e, "connectionId", r, "connectionId", t.INT_COPY), t.copyFromAttribute(e, "tableType", r), t.copyFromAttribute(e, "published", r, "published", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRow", r, "insertRow", t.BOOLEAN_COPY), t.copyFromAttribute(e, "insertRowShift", r, "insertRowShift", t.BOOLEAN_COPY), r.totalsRowShown = "0" !== e.getAttribute("totalsRowShown"), r;
1668
- }
1669
- afterVisit(t, e, s) {
1670
- const r = s.v;
1671
- if (t.evaluate("autoFilter", e)) {
1672
- if (Array.isArray(r.hiddenButtons)) {
1673
- const t = r.hiddenButtons.length;
1674
- 0 === t ? r.hiddenButtons = !1 : t === r.columns?.length && (r.hiddenButtons = !0);
1675
- }
1676
- } else r.hiddenButtons = !0, r.showButtons = !1;
1677
- return r;
1678
- }
1679
- processTableStyleInfo(t, e, s) {
1680
- if (!e) return;
1681
- const r = e.childNodes, o = {}, i = r.length;
1682
- for (let e = 0; e < i; e++) {
1683
- const s = r.item(e);
1684
- 1 === s.nodeType && "tableStyleInfo" === s.localName && (t.copyFromAttribute(s, "name", o), t.copyFromAttribute(s, "showColumnStripes", o, "showColumnStripes", t.BOOLEAN_COPY), t.copyFromAttribute(s, "showFirstColumn", o, "showFirstColumn", t.BOOLEAN_COPY), t.copyFromAttribute(s, "showLastColumn", o, "showLastColumn", t.BOOLEAN_COPY), t.copyFromAttribute(s, "showRowStripes", o, "showRowStripes", t.BOOLEAN_COPY));
1685
- }
1686
- Object.keys(o).length > 0 && (s.style = o);
1687
- }
1688
- processTableColumn(t, e, s) {
1689
- if (!e) return null;
1690
- const r = e.childNodes, o = r.length;
1691
- for (let e = 0; e < o; e++) {
1692
- const o = r.item(e);
1693
- if (1 === o.nodeType && "tableColumn" === o.localName) {
1694
- const e = {};
1695
- t.copyFromAttribute(o, "name", e), t.copyFromAttribute(o, "id", e), t.copyFromAttribute(o, "uniqueName", e), t.copyFromAttribute(o, "queryTableFieldId", e), t.copyFromAttribute(o, "totalsRowLabel", e);
1696
- let r = o.getAttribute("totalsRowFunction");
1697
- if (null !== r) if ("custom" === r) {
1698
- const s = t.evaluate("totalsRowFormula", o);
1699
- s && (e.totalsRowFormula = s.textContent);
1700
- } else e.totalsRowFormula = r;
1701
- t.copyFromAttribute(o, "totalsRowLabel", e);
1702
- const i = t.evaluate("calculatedColumnFormula", o);
1703
- i?.textContent && (e.calculatedColumnFormula = i.textContent), s.push(e);
1704
- }
1705
- }
1706
- return s;
1707
- }
1708
- processTableColumns(t, e, s) {
1709
- const r = e.childNodes, o = [], i = r.length;
1710
- for (let e = 0; e < i; e++) {
1711
- const s = r.item(e);
1712
- 1 === s.nodeType && "tableColumns" === s.localName && this.processTableColumn(t, s, o);
1713
- }
1714
- o.length > 0 && (s.columns = o);
1715
- }
1716
- }, It = class {
1717
- visit(t, e, s) {
1718
- const r = t.getVisitorParamsState().get("ref");
1719
- if (r) {
1720
- const s = t.getVisitorParamsState().get("descriptions");
1721
- s && (s.add(r, e.getAttribute("altText")), s.add(r, e.getAttribute("altTextSummary")));
1722
- }
1723
- return t.copyFromAttribute(e, "altText", s), t.copyFromAttribute(e, "altTextSummary", s), s;
1724
- }
1725
- }, Lt = class {
1726
- visit(t, e, s) {
1727
- const r = e.childNodes, o = r.length;
1728
- let i = null;
1729
- for (let t = 0; t < o; t++) {
1730
- const e = r.item(t);
1731
- if (1 === e.nodeType) {
1732
- "externalBook" === e.localName && (i = e);
1733
- break;
1734
- }
1735
- }
1736
- if (!i) return s;
1737
- e.getAttribute("mc:Ignorable") && (s.mceIgnorable = !0);
1738
- const n = i.getAttribute("r:id");
1739
- n && (s.__bookRelId = n);
1740
- const a = this._findAbsoluteUrlRelId(i);
1741
- return a && (s.__absoluteUrlRelId = a), s.sheetNames = [], this.processSheetNames(t, i, s), this.processDefinedNames(t, i, s), this.processSheetDataSet(t, i, s), s;
1742
- }
1743
- processSheetNames(t, e, s) {
1744
- const r = this._findChild(e, "sheetNames");
1745
- if (!r) return;
1746
- const o = r.childNodes, i = o.length;
1747
- for (let t = 0; t < i; t++) {
1748
- const e = o.item(t);
1749
- 1 === e.nodeType && "sheetName" === e.localName && s.sheetNames.push(e.getAttribute("val") ?? "");
1750
- }
1751
- }
1752
- processDefinedNames(t, e, s) {
1753
- const r = this._findChild(e, "definedNames");
1754
- if (!r) return;
1755
- const o = [], i = r.childNodes, n = i.length;
1756
- for (let t = 0; t < n; t++) {
1757
- const e = i.item(t);
1758
- if (1 !== e.nodeType || "definedName" !== e.localName) continue;
1759
- const s = e.getAttribute("name");
1760
- if (!s) continue;
1761
- const r = {
1762
- name: s,
1763
- refersTo: e.getAttribute("refersTo") ?? ""
1764
- }, n = e.getAttribute("sheetId");
1765
- null !== n && (r.sheetIndex = parseInt(n, 10)), o.push(r);
1766
- }
1767
- o.length > 0 && (s.definedNames = o);
1768
- }
1769
- processSheetDataSet(t, e, s) {
1770
- const r = this._findChild(e, "sheetDataSet");
1771
- if (!r) return;
1772
- const o = [], i = r.childNodes, n = i.length;
1773
- for (let e = 0; e < n; e++) {
1774
- const s = i.item(e);
1775
- if (1 !== s.nodeType || "sheetData" !== s.localName) continue;
1776
- const r = s.getAttribute("sheetId");
1777
- if (null === r) continue;
1778
- const n = this.processSheetData(t, s);
1779
- n.sheetIndex = parseInt(r, 10), "1" === s.getAttribute("refreshError") && (n.refreshError = !0), o.push(n);
1780
- }
1781
- o.length > 0 && (s.sheetDataSet = o);
1782
- }
1783
- processSheetData(t, e) {
1784
- const s = new P.Builder(), r = e.childNodes, o = r.length;
1785
- for (let t = 0; t < o; t++) {
1786
- const e = r.item(t);
1787
- if (1 !== e.nodeType || "row" !== e.localName) continue;
1788
- const o = e.childNodes, i = o.length;
1789
- for (let t = 0; t < i; t++) {
1790
- const e = o.item(t);
1791
- if (1 !== e.nodeType || "cell" !== e.localName) continue;
1792
- const r = e.getAttribute("r");
1793
- if (!r) continue;
1794
- const i = g.fastStringToCell(r);
1795
- if (void 0 === i?.rowIndex || void 0 === i?.colIndex) continue;
1796
- const n = this._readCellValue(e);
1797
- void 0 !== n && s.pushAt(i.rowIndex, i.colIndex, n);
1798
- }
1799
- }
1800
- return {
1801
- sheetIndex: -1,
1802
- data: s.build()?.tuples ?? []
1803
- };
1804
- }
1805
- _readCellValue(t) {
1806
- const e = this._findChild(t, "v")?.textContent?.trim();
1807
- if (void 0 !== e && "" !== e) switch (t.getAttribute("t")) {
1808
- case null:
1809
- case "n": return parseFloat(e);
1810
- case "b": return "1" === e || "true" === e;
1811
- case "str":
1812
- default: return e;
1813
- case "e": {
1814
- const t = m.getBuiltInByLabel(e);
1815
- return t ? {
1816
- t: "e",
1817
- v: t.getCode()
1818
- } : e;
1819
- }
1820
- }
1821
- }
1822
- _findChild(t, e) {
1823
- const s = t.childNodes, r = s.length;
1824
- for (let t = 0; t < r; t++) {
1825
- const r = s.item(t);
1826
- if (1 === r.nodeType && r.localName === e) return r;
1827
- }
1828
- return null;
1829
- }
1830
- _findAbsoluteUrlRelId(t) {
1831
- const e = this._findChild(t, "alternateUrls");
1832
- return e ? this._findChild(e, "absoluteUrl")?.getAttribute("r:id") ?? null : null;
1833
- }
1834
- }, _t = class {
1835
- visit(t, e, s) {
1836
- t.copyFromAttribute(e, "name", s), t.copyFromAttribute(e, "sourceName", s);
1837
- const r = t.evaluate("*/tableSlicerCache", e);
1838
- return r ? (t.copyFromAttribute(r, "tableId", s), t.copyFromAttribute(r, "column", s, "columnId"), t.copyFromAttribute(r, "crossFilter", s), s) : (t.warn("A slicer names no table; it was not imported.", { onceKey: "xlsx.slicer.cacheDefinition" }), s);
1839
- }
1840
- }, Bt = class {
1841
- visit(t, e, s) {
1842
- let r = s.slicers;
1843
- r || (r = {}, s.slicers = r);
1844
- const o = e.childNodes, i = o.length;
1845
- for (let e = 0; e < i; e++) {
1846
- const s = o.item(e);
1847
- 1 === s.nodeType && "slicer" === s.localName && this.processSlicer(t, s, r);
1848
- }
1849
- return r;
1850
- }
1851
- processSlicer(t, e, s) {
1852
- if (!e) return;
1853
- const r = {};
1854
- s[e.getAttribute("name")] = r;
1855
- const o = e.getAttribute("cache"), i = t.getVisitorParamsState().get("slicerCaches");
1856
- if (o) {
1857
- const t = i.get(o);
1858
- t && (r.columnId = t.columnId, r.tableId = t.tableId);
1859
- }
1860
- t.copyFromAttribute(e, "caption", r), t.copyFromAttribute(e, "startItem", r, "startItem", t.INT_COPY), t.copyFromAttribute(e, "columnCount", r, "columnCount", t.INT_COPY), t.copyFromAttribute(e, "showCaption", r, "showCaption", t.BOOLEAN_COPY), t.copyFromAttribute(e, "level", r, "level", t.INT_COPY), t.copyFromAttribute(e, "style", r), t.copyFromAttribute(e, "locked", r, "locked", t.BOOLEAN_COPY), t.copyFromAttribute(e, "rowHeight", r, "rowHeight", t.INT_COPY);
1861
- }
1862
- }, Et = class {
1863
- visit(t, e, s) {
1864
- return s;
1865
- }
1866
- }, Rt = class {
1867
- visit(t, e, s) {
1868
- if (!e) return;
1869
- const r = {};
1870
- return t.copyFromAttribute(e, "editAs", r, "anchorType"), r.anchor = {}, "absoluteAnchor" === e.localName ? (r.anchorType = "absolute", this.processAbsoluteCoord(t, t.evaluate("xdr:pos", e), r.anchor, "from", "x", "y"), this.processAbsoluteCoord(t, t.evaluate("xdr:ext", e), r.anchor, "to", "cx", "cy")) : "oneCellAnchor" === e.localName ? (this.processOffsetCoord(t, t.evaluate("from", e), r.anchor, "from"), this.processAbsoluteCoord(t, t.evaluate("xdr:ext", e), r.anchor, "to", "cx", "cy")) : (this.processOffsetCoord(t, t.evaluate("from", e), r.anchor, "from"), this.processOffsetCoord(t, t.evaluate("to", e), r.anchor, "to")), s.movables || (s.movables = []), s.movables.push(r), r;
1871
- }
1872
- processAbsoluteCoord(t, e, s, r, o, i) {
1873
- if (!e) return;
1874
- const n = {
1875
- x: 0,
1876
- y: 0
1877
- };
1878
- return n.x = l(e.getAttribute(o)), n.y = l(e.getAttribute(i)), "from" === r ? s.tl = n : s.br = n, s;
1879
- }
1880
- processOffsetCoord(t, e, s, r) {
1881
- if (!e) return;
1882
- const o = {
1883
- c: 0,
1884
- r: 0,
1885
- x: 0,
1886
- y: 0
1887
- };
1888
- return t.evaluate("col", e) && (o.c = parseInt(t.evaluate("col", e).textContent)), t.evaluate("row", e) && (o.r = parseInt(t.evaluate("row", e).textContent)), t.evaluate("colOff", e) && (o.x = l(t.evaluate("colOff", e).textContent)), t.evaluate("rowOff", e) && (o.y = l(t.evaluate("rowOff", e).textContent)), "from" === r ? s.tl = o : s.br = o, s;
1889
- }
1890
- }, jt = class extends Q {
1891
- visit(t, e, s) {
1892
- if (!e) return;
1893
- s = super.visit(t, e, s);
1894
- const r = t.evaluate("nvGraphicFramePr/cNvGraphicFramePr", e);
1895
- if (r) {
1896
- const e = t.evaluate("graphicFrameLocks", r);
1897
- if (e) {
1898
- e.hasAttribute("noChangeAspect") && (s.lockAspect = "1" === e.getAttribute("noChangeAspect"));
1899
- const t = {};
1900
- Object.keys(t).length > 0 && (s.locks = t);
1901
- }
1902
- }
1903
- let o = {
1904
- type: "graphicFrame",
1905
- json: {}
1906
- };
1907
- const i = t.evaluate("graphic/graphicData", e).childNodes, n = i.length;
1908
- for (let s = 0; s < n; s++) {
1909
- const r = i.item(s);
1910
- if (1 === r.nodeType) try {
1911
- let s = r.localName;
1912
- "chart" === s ? s = "chart" : "slicer" === s && (s = "slicer"), o.type = s;
1913
- const i = r.getAttribute("r:id");
1914
- if ("chart" === s && i) {
1915
- let s = t.evaluate("*/cNvPr", e);
1916
- s?.item && (s = s.item(0));
1917
- const r = s?.getAttribute?.("id"), n = r ? parseInt(r, 10) : void 0;
1918
- o.json = {
1919
- xml: t.serializeElement(e) ?? void 0,
1920
- sourceId: void 0 === n || isNaN(n) ? void 0 : n,
1921
- part: t.readEmbeddedPart(i) ?? void 0
1922
- };
1923
- } else i && (o.json = t.getRef(i));
1924
- } catch (e) {
1925
- t.warn(`Unable to read a graphic frame: ${e?.message ?? e}`, { onceKey: "xlsx.drawing.graphicFrame" });
1926
- }
1927
- }
1928
- return o && (s.content = o), o;
1929
- }
1930
- }, Dt = Z, Yt = class extends Q {
1931
- visit(t, e, s) {
1932
- if (!e) return;
1933
- const r = super.visit(t, e, s), o = t.evaluate("nvPicPr/cNvPicPr", e);
1934
- if (o) {
1935
- t.copyFromAttribute(e, "preferRelativeResize", r, "preferRelativeResize", t.BOOLEAN_COPY);
1936
- const s = t.evaluate("picLocks", o);
1937
- if (s) {
1938
- s.hasAttribute("noChangeAspect") && (r.lockAspect = "1" === s.getAttribute("noChangeAspect"));
1939
- const e = {};
1940
- t.copyFromAttribute(s, "noChangeArrowheads", r, "noChangeArrowheads", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noChangeShapeType", r, "noChangeShapeType", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noEditPoints", r, "noEditPoints", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noAdjustHandles", r, "noAdjustHandles", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noCrop", r, "noCrop", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noGrp", r, "noGrp", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noMove", r, "noMove", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noResize", r, "noResize", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noRot", r, "noRot", t.BOOLEAN_COPY), t.copyFromAttribute(s, "noSelect", r, "noSelect", t.BOOLEAN_COPY), Object.keys(e).length > 0 && (r.locks = e);
1941
- }
1942
- }
1943
- const i = t.evaluate("blipFill/blip", e);
1944
- let n;
1945
- if (i) {
1946
- let e;
1947
- if (e = i.getAttribute("r:embed") ?? i.getAttribute("embed"), e || (e = i.getAttribute("r:link") ?? i.getAttribute("link")), !e) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.drawing.picture.noRel" });
1948
- n = t.getRef(e, !0);
1949
- }
1950
- return s.content = {
1951
- type: "picture",
1952
- json: { resId: n }
1953
- }, r;
1954
- }
1955
- }, Mt = class extends Z {
1956
- visit(t, e, s) {
1957
- if (!e) return;
1958
- s = super.visit(t, e, s);
1959
- const r = t.evaluate("nvGrpSpPr/cNvGrpSpPr", e);
1960
- if (r) {
1961
- const e = t.evaluate("grpSpLocks", r);
1962
- if (e) {
1963
- e.hasAttribute("noChangeAspect") && (s.lockAspect = "1" === e.getAttribute("noChangeAspect"));
1964
- const t = {};
1965
- Object.keys(t).length > 0 && (s.locks = t);
1966
- }
1967
- }
1968
- t.warn(`Unable to import '${s.name}', group shapes are not supported.`);
1969
- const o = {};
1970
- return s.content = {
1971
- type: "grpSp",
1972
- json: o
1973
- }, o;
1974
- }
1975
- }, zt = class extends Z {
1976
- visit(t, e, s) {
1977
- if (!e) return;
1978
- s = super.visit(t, e, s);
1979
- const r = t.evaluate("nvCxnSpPr/cNvCxnSpPr", e);
1980
- if (r) {
1981
- const e = t.evaluate("cxnSpLocks", r);
1982
- if (e) {
1983
- e.hasAttribute("noChangeAspect") && (s.lockAspect = "1" === e.getAttribute("noChangeAspect"));
1984
- const t = {};
1985
- Object.keys(t).length > 0 && (s.locks = t);
1986
- }
1987
- }
1988
- let o = t.evaluate("*/cNvPr", e);
1989
- o?.item && (o = o.item(0));
1990
- const i = o?.getAttribute?.("id"), n = i ? parseInt(i, 10) : void 0, a = {
1991
- type: "cxnSp",
1992
- xml: t.serializeElement(e) ?? void 0,
1993
- sourceId: void 0 === n || isNaN(n) ? void 0 : n
1994
- };
1995
- return s.content = {
1996
- type: "cxnSp",
1997
- json: a
1998
- }, a;
1999
- }
2000
- }, Ut = class {
2001
- visit(t, e, s) {
2002
- const r = [], o = /* @__PURE__ */ new Map(), i = {
2003
- cells: [],
2004
- values: []
2005
- }, n = e.childNodes;
2006
- for (let t = 0; t < n.length; t++) {
2007
- const e = n.item(t);
2008
- if (1 === e.nodeType) switch (e.localName) {
2009
- case "metadataTypes":
2010
- this._parseMetadataTypes(e, r, o);
2011
- break;
2012
- case "futureMetadata":
2013
- this._attachFutureMetadata(e, o);
2014
- break;
2015
- case "cellMetadata":
2016
- this._resolveBlocks(e, r, i.cells);
2017
- break;
2018
- case "valueMetadata": this._resolveBlocks(e, r, i.values);
2019
- }
2020
- }
2021
- return s.metadata = i, i;
2022
- }
2023
- _parseMetadataTypes(t, e, s) {
2024
- const r = t.childNodes;
2025
- for (let t = 0; t < r.length; t++) {
2026
- const o = r.item(t);
2027
- if (1 === o.nodeType && "metadataType" === o.localName) {
2028
- const t = this._parseMetadataType(o);
2029
- e.push(t), s.set(t.name, t);
2030
- }
2031
- }
2032
- }
2033
- _parseMetadataType(t) {
2034
- const e = {
2035
- name: t.getAttribute("name") ?? "",
2036
- _blocks: []
2037
- }, s = t.getAttribute("minSupportedVersion");
2038
- null != s && (e.minSupportedVersion = Number(s));
2039
- for (const s of [
2040
- "copy",
2041
- "pasteAll",
2042
- "pasteValues",
2043
- "merge",
2044
- "splitFirst",
2045
- "splitAll",
2046
- "rowColShift",
2047
- "clearFormats",
2048
- "clearComments",
2049
- "assign",
2050
- "coerce",
2051
- "cellMeta",
2052
- "adjust",
2053
- "trans",
2054
- "delete",
2055
- "edit"
2056
- ]) "1" === t.getAttribute(s) && (e[s] = !0);
2057
- return e;
2058
- }
2059
- _attachFutureMetadata(t, e) {
2060
- const s = t.getAttribute("name") ?? "", r = e.get(s);
2061
- if (!r) return;
2062
- const o = t.childNodes;
2063
- for (let t = 0; t < o.length; t++) {
2064
- const e = o.item(t);
2065
- 1 === e.nodeType && "bk" === e.localName && r._blocks.push(this._parseFutureBlock(e));
2066
- }
2067
- }
2068
- _parseFutureBlock(t) {
2069
- const e = {}, s = t.childNodes;
2070
- for (let t = 0; t < s.length; t++) {
2071
- const r = s.item(t);
2072
- if (1 !== r.nodeType || "extLst" !== r.localName) continue;
2073
- const o = r.childNodes;
2074
- for (let t = 0; t < o.length; t++) {
2075
- const s = o.item(t);
2076
- if (1 !== s.nodeType || "ext" !== s.localName) continue;
2077
- const r = s.childNodes;
2078
- for (let t = 0; t < r.length; t++) {
2079
- const s = r.item(t);
2080
- 1 === s.nodeType && ("dynamicArrayProperties" === s.localName ? (e.fDynamic = "1" === s.getAttribute("fDynamic"), e.fCollapsed = "1" === s.getAttribute("fCollapsed")) : "rvb" === s.localName && (e.richValueIndex = Number(s.getAttribute("i") ?? "0")));
2081
- }
2082
- }
2083
- }
2084
- return e;
2085
- }
2086
- _resolveBlocks(t, e, s) {
2087
- const r = t.childNodes;
2088
- for (let t = 0; t < r.length; t++) {
2089
- const o = r.item(t);
2090
- 1 === o.nodeType && "bk" === o.localName && s.push(this._resolveBlock(o, e));
2091
- }
2092
- }
2093
- _resolveBlock(t, e) {
2094
- const s = /* @__PURE__ */ new Map(), r = t.childNodes;
2095
- for (let t = 0; t < r.length; t++) {
2096
- const o = r.item(t);
2097
- if (1 !== o.nodeType || "rc" !== o.localName) continue;
2098
- const i = Number(o.getAttribute("t")), n = Number(o.getAttribute("v")), a = e[i - 1];
2099
- if (!a) continue;
2100
- const { _blocks: l, ...c } = a, u = { ...c };
2101
- for (const t of Object.keys(u)) void 0 === u[t] && delete u[t];
2102
- const h = l[n];
2103
- h && (void 0 !== h.fDynamic && (u.fDynamic = h.fDynamic, u.fCollapsed = h.fCollapsed ?? !1), void 0 !== h.richValueIndex && (u.richValueIndex = h.richValueIndex)), s.set(a.name, u);
2104
- }
2105
- return s;
2106
- }
2107
- }, Xt = class {
2108
- visit(t, e, s) {
2109
- let r = t.getVisitorParamsState().get(tt);
2110
- r || (r = [], t.getVisitorParamsState().set(tt, r));
2111
- const o = e.childNodes, i = o.length;
2112
- for (let e = 0; e < i; e++) {
2113
- const s = o.item(e);
2114
- if (1 === s.nodeType && "s" === s.localName) {
2115
- const e = {
2116
- type: s.getAttribute("t") ?? "n",
2117
- keys: []
2118
- };
2119
- this.processKeys(t, s, e), r.push(e);
2120
- }
2121
- }
2122
- return s.richTypes = r, r;
2123
- }
2124
- processKeys(t, e, s) {
2125
- const r = e.childNodes, o = r.length, i = s.keys;
2126
- for (let t = 0; t < o; t++) {
2127
- const e = r.item(t);
2128
- if (1 === e.nodeType && "k" === e.localName) {
2129
- const t = e.getAttribute("n"), s = e.getAttribute("t");
2130
- i.push([t, s]);
2131
- }
2132
- }
2133
- }
2134
- }, Wt = class {
2135
- visit(t, e, s) {
2136
- let r = t.getVisitorParamsState().get("richTypes");
2137
- if (!r) return void t.warn("RichValueFound but not type.");
2138
- let o = t.getVisitorParamsState().get(et);
2139
- o || (o = [], t.getVisitorParamsState().set(et, o));
2140
- const i = e.childNodes, n = i.length;
2141
- for (let e = 0; e < n; e++) {
2142
- const s = i.item(e);
2143
- if (1 === s.nodeType && "rv" === s.localName) {
2144
- const e = r[s.getAttribute("s")], i = { type: e.type };
2145
- this.processValues(t, s, i, e);
2146
- const n = this.mapType(t, i);
2147
- o.push(n);
2148
- }
2149
- }
2150
- return s.richData = o, o;
2151
- }
2152
- mapType(t, e) {
2153
- if ("_error" === e.type) {
2154
- const t = e.errorType;
2155
- if (t) try {
2156
- e = m.getBuiltInByCode(t + 1) ?? m.BuiltIn.Unknown;
2157
- } catch (t) {}
2158
- }
2159
- return e;
2160
- }
2161
- processValues(t, e, s, r) {
2162
- const o = e.childNodes, i = o.length;
2163
- r.type;
2164
- const n = r.keys;
2165
- for (let e = 0; e < i; e++) {
2166
- const r = o.item(e);
2167
- if (1 === r.nodeType && "v" === r.localName) {
2168
- const o = n[e];
2169
- if (!o) return void t.warn("Invalid richData");
2170
- const i = o[0], a = o[1];
2171
- let l = r.textContent;
2172
- "i" === a && (l = Number(l)), s[i] = l;
2173
- }
2174
- }
2175
- }
2176
- }, Gt = class {
2177
- visit(t, e, s) {
2178
- if (!e) return;
2179
- const r = [];
2180
- this.processAuthors(t, t.evaluate("authors", e), r), r.length > 0 && (s.authors = r);
2181
- const o = [];
2182
- return s.comments = o, o;
2183
- }
2184
- processAuthors(t, e, s) {
2185
- if (!e) return;
2186
- const r = e.childNodes, o = r.length;
2187
- for (let t = 0; t < o; t++) {
2188
- const e = r.item(t);
2189
- if (1 === e.nodeType && "author" === e.localName) {
2190
- const t = e.firstChild;
2191
- t && 3 === t.nodeType && s.push(t.textContent);
2192
- }
2193
- }
2194
- }
2195
- }, Kt = class {
2196
- visit(t, e, s) {
2197
- if (!e) return;
2198
- const r = e.getAttribute("ref");
2199
- if (!r) return;
2200
- const o = { content: "" };
2201
- if (e.hasAttribute("authorId")) {
2202
- const t = parseInt(e.getAttribute("authorId"), 10);
2203
- isNaN(t) || (o.authorId = t);
2204
- }
2205
- return o.content = function(t) {
2206
- if (!t) return "";
2207
- const e = [];
2208
- let s = !0;
2209
- const r = t.childNodes;
2210
- for (let t = 0; t < r.length; t++) {
2211
- const o = r.item(t);
2212
- if (1 === o.nodeType) {
2213
- if ("t" === o.localName) e.push({ text: o.textContent ?? "" });
2214
- else if ("r" === o.localName) {
2215
- const t = { text: "" }, r = o.childNodes;
2216
- for (let e = 0; e < r.length; e++) {
2217
- const s = r.item(e);
2218
- 1 === s.nodeType && ("t" === s.localName ? t.text += s.textContent ?? "" : "rPr" === s.localName && st(s, t));
2219
- }
2220
- Object.keys(t).length > 1 && (s = !1), e.push(t);
2221
- }
2222
- }
2223
- }
2224
- return 0 === e.length ? t.textContent ?? "" : s ? e.map((t) => t.text).join("") : { runs: e };
2225
- }(t.evaluate("text", e)), s.push({
2226
- r,
2227
- v: o
2228
- }), o;
2229
- }
2230
- }, $t = class {
2231
- visit(t, e, s) {
2232
- if (!e) return;
2233
- const r = [];
2234
- return s.comments = r, r;
2235
- }
2236
- }, Ht = class {
2237
- visit(e, s, r) {
2238
- if (!s) return;
2239
- const i = {};
2240
- e.copyFromAttribute(s, "id", i, "id", o);
2241
- const n = s.getAttribute("ref");
2242
- return e.copyFromAttribute(s, "personId", i, "personId", o), e.copyFromAttribute(s, "parentId", i, "parentId", o), e.copyFromAttribute(s, "dT", i, "dt"), s.hasAttribute("done") && (i.done = t(s.getAttribute("done"))), r.push({
2243
- r: n,
2244
- v: i
2245
- }), i;
2246
- }
2247
- }, qt = class {
2248
- visit(t, e, s) {
2249
- const r = [], i = e.childNodes, n = i.length;
2250
- for (let e = 0; e < n; e++) {
2251
- const s = i.item(e);
2252
- if (1 === s.nodeType && "person" === s.localName) {
2253
- const e = {};
2254
- t.copyFromAttribute(s, "id", e, "id", o), t.copyFromAttribute(s, "displayName", e), t.copyFromAttribute(s, "userId", e, "userId", o), t.copyFromAttribute(s, "providerId", e), r.push(e);
2255
- }
2256
- }
2257
- return r.length > 0 && (s.persons = r), r;
2258
- }
2259
- }, Jt = class {
2260
- constructor(t, e) {
2261
- this.path = t, this.visitor = e;
2262
- }
2263
- }, Qt = class {
2264
- constructor() {
2265
- this.visitorsByXmlTagName = /* @__PURE__ */ new Map(), this.scopedVisitorsByXmlTagName = /* @__PURE__ */ new Map(), this.visitorParamsState = null, this.registerVisitor("Relationships", new rt()), this.registerVisitor("cp:coreProperties", new ot()), this.registerVisitor("Properties", new it()), this.registerVisitor("spPr", new lt()), this.registerVisitor("txBody", new bt()), this.registerVisitor("txPr", new bt()), this.registerVisitor("c:chartSpace", new nt()), this.registerVisitor("c:plotArea", new at()), this.registerVisitor("c:barChart", new ct()), this.registerVisitor("c:doughnutChart", new ut()), this.registerVisitor("c:lineChart", new ut()), this.registerVisitor("c:ofPieType", new ut()), this.registerVisitor("c:pieChart", new ut()), this.registerVisitor("c:scatterChart", new ut()), this.registerVisitor("c:barChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:doughnutChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:lineChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:ofPieType", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:pieChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:scatterChart", new ht("dataLabels"), "dLbls"), this.registerVisitor("c:ser", new pt()), this.registerVisitor("c:dPt", new dt()), this.registerVisitor("c:marker", new gt()), this.registerVisitor("c:catAx", new mt()), this.registerVisitor("c:valAx", new mt()), this.registerVisitor("c:dateAx", new mt()), this.registerVisitor("c:majorGridlines", new M("gridLinesMajor")), this.registerVisitor("c:minorGridlines", new M("gridLinesMinor")), this.registerVisitor("c:chartSpace", null, "txPr"), this.registerVisitor("c:catAx", new bt("labels.text"), "txPr"), this.registerVisitor("c:valAx", new bt("labels.text"), "txPr"), this.registerVisitor("c:dateAx", new bt("labels.text"), "txPr"), this.registerVisitor("c:legend", new At()), this.registerVisitor("c:legend", new bt("labels.text"), "txPr"), this.registerVisitor("c:legendEntry", new ft()), this.registerVisitor("c:ser", new yt(), "extLst/ext/invertSolidFillFmt/spPr"), this.registerVisitor("c:ser", new ht("labels"), "dLbls"), this.registerVisitor("c:dLbl", new ht("points")), this.registerVisitor("c:title", new vt()), this.registerVisitor("c:title", null, "tx/rich"), this.registerVisitor("c:title", null, "txPr"), this.registerVisitor("c:layout", new Nt()), this.registerVisitor("c:dispUnits", new M("dispUnits")), this.registerVisitor("c:dispUnitsLbl", new vt("displayUnitsLabel")), this.registerVisitor("c:dispUnitsLbl", new bt(), "tx/rich"), this.registerVisitor("a:theme", new Ft()), this.registerVisitor("a:theme", new Ct(), "themeElements/clrScheme"), this.registerVisitor("a:theme", new wt(), "themeElements/fontScheme"), this.registerVisitor("a:theme", new Pt(), "themeElements/fmtScheme"), this.registerVisitor("autoFilter", new xt()), this.registerVisitor("sortState", new Tt()), this.registerVisitor("s:workbook", new kt()), this.registerVisitor("styleSheet", new Ot()), this.registerVisitor("x14:table", new It()), this.registerVisitor("table", new Vt()), this.registerVisitor("externalLink", new Lt()), this.registerVisitor("hlinkClick", new St()), this.registerVisitor("wsDr", new Et()), this.registerVisitor("twoCellAnchor", new Rt()), this.registerVisitor("oneCellAnchor", new Rt()), this.registerVisitor("absoluteAnchor", new Rt()), this.registerVisitor("graphicFrame", new jt()), this.registerVisitor("sp", new Dt()), this.registerVisitor("grpSp", new Mt()), this.registerVisitor("cxnSp", new zt()), this.registerVisitor("pic", new Yt()), this.registerVisitor("metadata", new Ut()), this.registerVisitor("rvStructures", new Xt()), this.registerVisitor("rvData", new Wt()), this.registerVisitor("comments", new Gt()), this.registerVisitor("comment", new Kt()), this.registerVisitor("ThreadedComments", new $t()), this.registerVisitor("threadedComment", new Ht()), this.registerVisitor("threadedComment", new bt("content"), "text"), this.registerVisitor("personList", new qt()), this.registerVisitor("slicerCacheDefinition", new _t()), this.registerVisitor("slicers", new Bt());
2266
- }
2267
- registerVisitor(t, e, s = null) {
2268
- -1 === t.indexOf(":") && (t = "*:" + t);
2269
- const r = t.split(":"), o = r.length > 1 ? r[1] : r[0];
2270
- if (!s) return this.visitorsByXmlTagName.set(o, e), void this.visitorsByXmlTagName.set(t, e);
2271
- let i = this.scopedVisitorsByXmlTagName.get(o);
2272
- i || (i = [], this.scopedVisitorsByXmlTagName.set(o, i), this.scopedVisitorsByXmlTagName.set(t, i)), i.push(new Jt(s, e));
2273
- }
2274
- parseDxf(t, e = "", s = d.EmptyObject) {
2275
- this.visitorParamsState || (this.visitorParamsState = /* @__PURE__ */ new Map());
2276
- const r = this.visitorParamsState, o = r.get("processingDXFs");
2277
- r.set("processingDXFs", !0);
2278
- try {
2279
- const r = new V(null, this, "/dxf", t, {}, e, s), o = {};
2280
- return new Ot().processDXF(r, t, o), o;
2281
- } finally {
2282
- void 0 === o ? r.delete("processingDXFs") : r.set("processingDXFs", o);
2283
- }
2284
- }
2285
- getVisitorParamsState() {
2286
- return this.visitorParamsState;
2287
- }
2288
- transform(t, e, s = d.EmptyObject) {
2289
- const r = t.documentElement;
2290
- this.visitorParamsState && !s?.paramMap || (this.visitorParamsState = s?.paramMap ?? /* @__PURE__ */ new Map());
2291
- const o = {};
2292
- let i = this.visitorsByXmlTagName.get(r.nodeName);
2293
- if (i || (i = this.visitorsByXmlTagName.get(r.localName)), !i) throw new Error(`A visitor for the root element: '${r.nodeName}' or '${r.localName}' must be registered.`);
2294
- const n = "/" + r.localName, a = new V(null, this, n, r, o, e, s), l = [];
2295
- this._doWalk(i, a, l, r, o, e, s);
2296
- const c = l.length;
2297
- for (let t = 0; t < c; t++) {
2298
- const e = l[t];
2299
- try {
2300
- e.visitor?.afterVisit?.(e.context, e.elemParent, e.jsonParent);
2301
- } catch (t) {
2302
- e.context.warn(`Unable to finish reading '${e.context.getPath()}': ${t?.message ?? t}`, { onceKey: "xlsx.transform.afterVisit" });
2303
- }
2304
- }
2305
- return o;
2306
- }
2307
- _walkScoped(t, e, s, r, o, i, n) {
2308
- const a = this.scopedVisitorsByXmlTagName.get(t), l = a ? a.length : 0;
2309
- for (let c = 0; c < l; c++) {
2310
- const l = a[c];
2311
- let u = null;
2312
- try {
2313
- u = e.evaluate(l.path, r);
2314
- } catch (s) {
2315
- e.warn(`Invalid path '${l.path}' for '${t}'.`, { onceKey: "xlsx.transform.invalidPath" });
2316
- }
2317
- if (!u) continue;
2318
- const h = (t) => {
2319
- let a = t.localName, c = t.parentNode;
2320
- for (; c && c !== r;) a = c.localName + "/" + a, c = c.parentNode;
2321
- const u = e.getPath() + "/" + a;
2322
- if (l.visitor) {
2323
- const r = new V(e, this, u, e.getElemRoot(), e.getJsonRoot(), i, n);
2324
- this._doWalk(l.visitor, r, s, t, o, i, n);
2325
- }
2326
- };
2327
- if (u.length > 0) {
2328
- const t = u, e = t.length;
2329
- for (let s = 0; s < e; s++) h(t.item(s));
2330
- } else h(u);
2331
- }
2332
- }
2333
- _doWalk(t, e, s, r, o, i, n) {
2334
- let a = null;
2335
- t && (s.push({
2336
- visitor: t,
2337
- context: e,
2338
- elemParent: r,
2339
- jsonParent: o
2340
- }), a = t.visit(e, r, o)), a || (a = o);
2341
- const l = r.localName;
2342
- this._walkScoped(l, e, s, r, a, i, n);
2343
- const c = this.visitorsByXmlTagName, u = e.getElemRoot(), h = e.getJsonRoot(), p = r.childNodes, d = p.length;
2344
- for (let t = 0; t < d; t++) {
2345
- const r = p.item(t);
2346
- if (1 !== r.nodeType) continue;
2347
- const l = r;
2348
- let d = l.nodeName, g = c.get(d);
2349
- g || (d = l.localName, g = c.get(d));
2350
- const m = e.getPath() + "/" + d, b = new V(e, this, m, u, h, i, n);
2351
- this._doWalk(g, b, s, l, a ?? o, i, n);
2352
- }
2353
- return a;
2354
- }
2355
- };
2356
- export { Qt as DOMTransformer, V as ExecutionContext, a as NumberUtils, I as VisitorUtils };