@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,4428 +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 "./B9q618XELV7uWJsA.mjs";
8
- import { $ as e, A as t, C as n, E as r, G as i, J as a, L as o, P as s, Q as c, R as l, S as u, U as d, W as f, X as p, Y as m, Z as h, _ as g, a as _, at as v, b as y, c as b, ct as x, f as S, h as C, i as w, it as T, j as E, k as D, l as O, m as ee, n as k, o as A, r as j, s as te, t as M, tt as ne, u as re, w as ie, y as N } from "./BwbMurFOptAFs7gC.mjs";
9
- import { AddressUtils as P, BufferUtils as F, Color as ae, CommonUtils as I, CoordUtils as oe, FormulaError as se, FormulaText as ce, IColor as L, ICondition as R, IConditionalFormat as z, IEffect as le, IFill as B, ISheet as ue, IStroke as de, IStyle as V, ITextFrame as H, LicenseManager as fe, NumberFormat as pe, ScalarType as me } from "@sheetxl/sdk";
10
- var he = "resourcesById", U = class {
11
- constructor(e) {
12
- this._kind = e.kind, this._contentType = e.contentType, this._relTypeUri = e.relTypeUri, this._path = e.path;
13
- }
14
- getKind() {
15
- return this._kind;
16
- }
17
- getContentType(e) {
18
- return this._contentType;
19
- }
20
- getRelTypeUri(e) {
21
- return this._relTypeUri;
22
- }
23
- getPath(e) {
24
- return typeof this._path == "function" ? this._path(e) : this._path;
25
- }
26
- }, ge = class e {
27
- constructor(e, t, n) {
28
- this.zipWriter = e, this.outputKind = t, this.outWritable = n;
29
- }
30
- static createUint8Array(t) {
31
- let n = new i(new h(), t);
32
- return new e(n, "uint8array");
33
- }
34
- static createBlob(t) {
35
- let n = new i(new a("application/zip"), t);
36
- return new e(n, "blob");
37
- }
38
- static createWritableStream(t, n) {
39
- let r = new i(t, n);
40
- return new e(r, "writable", t);
41
- }
42
- async add(e, t, n) {
43
- let r = function(e) {
44
- let t = e.replace(/\\/g, "/").trim();
45
- for (; t.startsWith("/");) t = t.slice(1);
46
- return t;
47
- }(e), i = {
48
- level: n?.level,
49
- password: n?.password,
50
- encryptionStrength: n?.encryptionStrength,
51
- zipCrypto: n?.zipCrypto,
52
- lastModDate: n?.lastModDate,
53
- keepOrder: n?.keepOrder,
54
- uncompressedSize: n?.uncompressedSize,
55
- dataDescriptor: n?.dataDescriptor,
56
- passThrough: n?.passThrough,
57
- compressionMethod: n?.compressionMethod,
58
- signature: n?.signature
59
- };
60
- if (typeof t == "string") return void await this.zipWriter.add(r, new m(t), i);
61
- if (t instanceof Uint8Array || ArrayBuffer.isView(t) || t && typeof t.byteLength == "number" && typeof t.byteOffset == "number") {
62
- try {
63
- await this.zipWriter.add(r, new p(t), i);
64
- } catch (e) {
65
- throw console.log("Error adding Uint8Array source to zip:", r, i), e;
66
- }
67
- return;
68
- }
69
- let a = (o = t) && typeof o.getReader == "function" ? t : function(e) {
70
- let t = e[Symbol.asyncIterator]();
71
- return new ReadableStream({
72
- async pull(e) {
73
- let { value: n, done: r } = await t.next();
74
- r ? e.close() : e.enqueue(n);
75
- },
76
- async cancel(e) {
77
- if (typeof t.return == "function") try {
78
- await t.return(e);
79
- } catch {}
80
- }
81
- });
82
- }(t);
83
- var o;
84
- await this.zipWriter.add(r, a, i);
85
- }
86
- async close(e) {
87
- let t = e?.comment, n = await this.zipWriter.close(t, {});
88
- return this.outputKind === "writable" ? this.outWritable ?? n : n;
89
- }
90
- };
91
- function _e(e) {
92
- let t = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), n = (e) => t(e).replace(/"/g, "&quot;"), r = (e) => {
93
- if (!e) return "";
94
- let t = "";
95
- for (let [r, i] of Object.entries(e)) i !== void 0 && !1 !== i && (t += !0 === i ? ` ${r}="1"` : ` ${r}="${n(String(i))}"`);
96
- return t;
97
- }, i = new TextEncoder(), a = "", o = () => {
98
- a &&= (e.write(i.encode(a)), "");
99
- }, s = (e) => {
100
- a += e, a.length > 65536 && o();
101
- }, c = [], l = null, u = [], d = !0;
102
- return {
103
- decl() {
104
- s("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
105
- },
106
- pushDefaultNamespace(e) {
107
- c.push(e), l = e;
108
- },
109
- getDefaultNamespace: () => c.length > 0 ? c[c.length - 1] : null,
110
- popDefaultNamespace() {
111
- c.length > 0 && (c.pop(), l = c.length > 0 ? c[c.length - 1] : null);
112
- },
113
- start(e, t) {
114
- d && u.push({
115
- tag: e,
116
- attrs: t,
117
- bufferPos: a.length
118
- });
119
- let n = e;
120
- l && e.indexOf(":") === -1 && (n = `${l}:${e}`), s(`<${n}${r(t)}>`);
121
- },
122
- empty(e, t) {
123
- let n = e;
124
- l && e.indexOf(":") === -1 && (n = `${l}:${e}`), s(`<${n}${r(t)}/>`);
125
- },
126
- text(e) {
127
- s(t(String(e)));
128
- },
129
- raw(e) {
130
- s(e);
131
- },
132
- end(e) {
133
- let t;
134
- if (d) {
135
- if (u.length === 0) throw Error(`XML Writer: Unexpected end tag </${e}> - no matching start tag`);
136
- if (t = u[u.length - 1], t.tag !== e) throw Error(`XML Writer: End tag </${e}> does not match start tag <${t.tag}>`);
137
- }
138
- let n = e;
139
- if (l && e.indexOf(":") === -1 && (n = `${l}:${e}`), d) {
140
- let e = a.length, i = `<${n}${r(t.attrs)}>`.length;
141
- e === t.bufferPos + i ? (a = a.slice(0, t.bufferPos), s(`<${n}${r(t.attrs)}/>`)) : s(`</${n}>`), u.pop();
142
- } else s(`</${n}>`);
143
- },
144
- close() {
145
- o();
146
- },
147
- setValidationDisabled(e) {
148
- d = !e;
149
- }
150
- };
151
- }
152
- function ve(e) {
153
- switch (e.kind) {
154
- case "bytes": return e.bytes;
155
- case "text": return e.text;
156
- case "stream": return e.stream;
157
- case "xmlStream": {
158
- let t = [], n = _e({ write: (e) => t.push(e) });
159
- return e.writeXml(n), n.close(), function(e) {
160
- let t = 0;
161
- for (let n of e) t += n.byteLength;
162
- let n = new Uint8Array(t), r = 0;
163
- for (let t of e) n.set(t, r), r += t.byteLength;
164
- return n;
165
- }(t);
166
- }
167
- case "xmlStreamed": return e.write();
168
- }
169
- }
170
- function ye(e) {
171
- let t = be(e);
172
- if (!t) return "_rels/.rels";
173
- let n = t.lastIndexOf("/"), r = n >= 0 ? t.slice(0, n) : "";
174
- return `${r ? `${r}/_rels` : "_rels"}/${n >= 0 ? t.slice(n + 1) : t}.rels`;
175
- }
176
- function be(e) {
177
- let t = (e ?? "").replace(/\\/g, "/").trim();
178
- for (; t.startsWith("/");) t = t.slice(1);
179
- return t;
180
- }
181
- function xe(e) {
182
- let t = (e ?? "").replace(/\\/g, "/").trim();
183
- return t.startsWith("/") || (t = "/" + t), t;
184
- }
185
- function Se(e) {
186
- let t = /^rId(\d+)$/.exec(e);
187
- return t ? parseInt(t[1], 10) : 2 ** 53 - 1;
188
- }
189
- function W(e) {
190
- return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/>/g, "&gt;");
191
- }
192
- function Ce(e, t, n, r = !1) {
193
- let i = t;
194
- if (t.startsWith("/")) i = t.slice(1);
195
- else {
196
- if (!e) throw Error(`Relative path "${t}" cannot be used at root level. Use an absolute path starting with "/" (e.g., "/xl/workbook.xml").`);
197
- i = (e.includes("/") ? e.slice(0, e.lastIndexOf("/") + 1) : "") + t;
198
- }
199
- if (i = we(i), !i.includes("{n}")) {
200
- if (!r && n.has(i)) throw Error(`Path already existing path: ${i}`);
201
- return i;
202
- }
203
- let a, o = 1;
204
- do
205
- if (a = i.replace(/{n}/g, String(o)), o++, o > 1e4) throw Error(`Failed to resolve path template "${t}" after 10000 attempts. This likely indicates a bug or an impossible constraint.`);
206
- while (n.has(a));
207
- return a;
208
- }
209
- function we(e) {
210
- let t = e.split("/"), n = [];
211
- for (let r of t) if (r !== "" && r !== ".") if (r === "..") {
212
- if (n.length === 0) throw Error(`Invalid path: too many ".." segments in "${e}"`);
213
- n.pop();
214
- } else n.push(r);
215
- return n.join("/");
216
- }
217
- function Te(e, t) {
218
- if (!e) return t;
219
- let n = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "", r = n ? n.split("/") : [], i = t.split("/"), a = 0, o = Math.min(r.length, i.length - 1);
220
- for (let e = 0; e < o && r[e] === i[e]; e++) a++;
221
- let s = r.length - a;
222
- return "../".repeat(s) + i.slice(a).join("/");
223
- }
224
- function Ee(e) {
225
- return new TextEncoder().encode(e);
226
- }
227
- function De(e, t) {
228
- return function(e, t = " ") {
229
- let n = "", r = 0, i = e.split(/(<[^>]+>)/g).filter(Boolean);
230
- for (let e = 0; e < i.length; e++) {
231
- let a = i[e];
232
- if (a.trim()) if (a.startsWith("<?")) n += a + "\n";
233
- else if (a.startsWith("</")) r--, r < 0 && console.warn(`XML formatting warning: negative indentation depth: ${a}`), n += t.repeat(Math.max(r, 0)) + a + "\n";
234
- else if (a.startsWith("<")) {
235
- let e = a.endsWith("/>");
236
- n += t.repeat(r) + a + "\n", e || r++;
237
- } else n += t.repeat(r) + a.trim() + "\n";
238
- }
239
- return n;
240
- }(function(e) {
241
- return new TextDecoder("utf-8").decode(e);
242
- }(e), t);
243
- }
244
- var Oe = class {
245
- constructor(e) {
246
- this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.reservedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = be(e);
247
- }
248
- add(e, t, n) {
249
- let r = n?.idHint && !this.usedIds.has(n.idHint) ? n.idHint : void 0;
250
- if (!r) do
251
- r = "rId" + this.nextId++;
252
- while (this.usedIds.has(r) || this.reservedIds.has(r));
253
- let i = /^rId(\d+)$/.exec(r);
254
- return i && (this.nextId = Math.max(this.nextId, parseInt(i[1], 10) + 1)), this.usedIds.add(r), this.rels.push({
255
- id: r,
256
- type: e,
257
- target: t,
258
- targetMode: n?.external ? "External" : void 0
259
- }), r;
260
- }
261
- reserve(e) {
262
- for (let t of e) {
263
- if (!t) continue;
264
- this.reservedIds.add(t);
265
- let e = /^rId(\d+)$/.exec(t);
266
- e && (this.nextId = Math.max(this.nextId, parseInt(e[1], 10) + 1));
267
- }
268
- }
269
- list() {
270
- return this.rels;
271
- }
272
- toXmlBytes() {
273
- let e = [...this.rels].sort((e, t) => Se(t.id) - Se(e.id) || e.id.localeCompare(t.id)), t = [];
274
- t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Relationships xmlns="${ke}">`);
275
- for (let n of e) {
276
- let e = [
277
- `Id="${W(n.id)}"`,
278
- `Type="${W(n.type)}"`,
279
- `Target="${W(n.target)}"`
280
- ];
281
- n.targetMode === "External" && e.push("TargetMode=\"External\""), t.push(`<Relationship ${e.join(" ")}/>`);
282
- }
283
- return t.push("</Relationships>"), Ee(t.join(""));
284
- }
285
- }, ke = "http://schemas.openxmlformats.org/package/2006/relationships", Ae = class {
286
- constructor() {
287
- this._defaultsSet = /* @__PURE__ */ new Set(), this._overridesSet = /* @__PURE__ */ new Set(), this._defaults = [], this._overrides = [];
288
- }
289
- addDefault(e, t) {
290
- let n = function(e) {
291
- let t = (e ?? "").trim().toLowerCase();
292
- return t.startsWith(".") && (t = t.slice(1)), t;
293
- }(e);
294
- this._defaultsSet.has(n) || (this._defaultsSet.add(n), this._defaults.push({
295
- key: n,
296
- content: t
297
- }));
298
- }
299
- addOverride(e, t) {
300
- let n = xe(e);
301
- this._overridesSet.has(n) || (this._overridesSet.add(n), this._overrides.push({
302
- key: n,
303
- content: t
304
- }));
305
- }
306
- replaceOverride(e, t) {
307
- let n = xe(e);
308
- if (!this._overridesSet.has(n)) return;
309
- let r = this._overrides.find((e) => e.key === n);
310
- r && (r.content = t);
311
- }
312
- toXmlBytes() {
313
- let e = [];
314
- e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Types xmlns="${je}">`);
315
- let t = this._defaults.reverse();
316
- this.addDefault("rels", "application/vnd.openxmlformats-package.relationships+xml"), this.addDefault("xml", "application/xml");
317
- for (let { key: n, content: r } of t) e.push(`<Default Extension="${W(n)}" ContentType="${W(r)}"/>`);
318
- let n = this._overrides;
319
- for (let { key: t, content: r } of n) e.push(`<Override PartName="${W(t)}" ContentType="${W(r)}"/>`);
320
- return e.push("</Types>"), Ee(e.join(""));
321
- }
322
- }, je = "http://schemas.openxmlformats.org/package/2006/content-types", Me = class {
323
- constructor(e) {
324
- this.parts = [], this.relsRoot = new Oe(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new Ae(), this.zip = e;
325
- }
326
- addContentType(e, t) {
327
- let n = be(e);
328
- this.contentTypes.addOverride("/" + n, t);
329
- }
330
- addDefaultType(e, t) {
331
- this.contentTypes.addDefault(e, t);
332
- }
333
- replaceContentType(e, t) {
334
- this.contentTypes.replaceOverride("/" + be(e), t);
335
- }
336
- addPart(e, t, n, r) {
337
- let i = be(e);
338
- this.parts.push({
339
- path: i,
340
- body: t,
341
- optionsZip: r
342
- }), n && this.contentTypes.addOverride("/" + i, n);
343
- }
344
- rels(e) {
345
- let t = be(e || "");
346
- if (!t) return this.relsRoot;
347
- let n = this.relsByPart.get(t);
348
- return n || (n = new Oe(t), this.relsByPart.set(t, n)), n;
349
- }
350
- async emit() {
351
- let e = [...this.parts].sort((e, t) => e.path.localeCompare(t.path));
352
- for (let t of e) {
353
- let e = ve(t.body);
354
- await this.zip.add(t.path, e, t.optionsZip);
355
- }
356
- let t = this.relsRoot.toXmlBytes();
357
- await this.zip.add("_rels/.rels", t, {});
358
- let n = [...this.relsByPart.values()].sort((e, t) => e.sourcePart.localeCompare(t.sourcePart));
359
- for (let e of n) {
360
- let t = ye(e.sourcePart), n = e.toXmlBytes();
361
- await this.zip.add(t, n, {});
362
- }
363
- let r = this.contentTypes.toXmlBytes();
364
- await this.zip.add("[Content_Types].xml", r, {});
365
- }
366
- async build(e) {
367
- return await this.emit(), await this.zip.close(e);
368
- }
369
- }, Ne = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), Pe = [/^xl\/slicers\//i, /^xl\/slicerCaches\//i];
370
- function Fe(e) {
371
- return e === "[Content_Types].xml" || Ie.test(e);
372
- }
373
- var Ie = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
374
- function Le(e) {
375
- if (e === "_rels/.rels") return "";
376
- let t = Ie.exec(e);
377
- if (!t) return null;
378
- let n = t[1] ?? "", r = t[2];
379
- return n ? `${n}/${r}` : r;
380
- }
381
- function Re(e) {
382
- return e.startsWith("#");
383
- }
384
- function ze(e, t) {
385
- if (t.startsWith("/")) return we(t);
386
- let n = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "";
387
- return we((n ? n + "/" : "") + t);
388
- }
389
- var Be = class {
390
- constructor(e, t, n) {
391
- this._queue = [], this._scheduledByNodeKey = /* @__PURE__ */ new Map(), this._nodesByPath = /* @__PURE__ */ new Map(), this._writtenPaths = /* @__PURE__ */ new Set(), this._explicitRelTargets = /* @__PURE__ */ new Set(), this._partWriter = new Me(e), this._registry = t, this._options = n ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null, this._macroEnabled = this._options.macroEnabled ?? !1, this._reserveSourceRelIds("");
392
- }
393
- _isSourcePartCarried(e) {
394
- let t = this._sourcePackage;
395
- return !(!t || !t.has(e)) && !Ne.has(e) && !t.isAbsorbed(e) && !(!this._macroEnabled && e === "xl/vbaProject.bin") && !Fe(e) && (!t.hasStructuralChange() || !function(e) {
396
- return Pe.some((t) => t.test(e));
397
- }(e));
398
- }
399
- _reserveSourceRelIds(e) {
400
- let t = this._sourcePackage?.getPart(ye(e));
401
- t && this._partWriter.rels(e).reserve(f(t.data).map((e) => e.id));
402
- }
403
- async waitEmit() {
404
- let e = this._queue;
405
- for (; e.length;) {
406
- let t = e.shift();
407
- await this._processPart(t);
408
- }
409
- }
410
- async build(e) {
411
- return await this.waitEmit(), this._passthroughSourceParts(), this._applyWorkbookContentTypeVariant(), await this._partWriter.build(e ?? {});
412
- }
413
- _passthroughSourceParts() {
414
- let e = this._sourcePackage;
415
- if (!e) return;
416
- let t = new Set(this._writtenPaths), n = [];
417
- for (let r of e.getNames()) t.has(r) || this._isSourcePartCarried(r) && n.push(r);
418
- let r = new Set(t);
419
- for (let e of n) r.add(e);
420
- let i = e.getPart("[Content_Types].xml"), a = i ? d(i.data) : null;
421
- if (a) for (let { ext: e, contentType: t } of a.defaults) this._partWriter.addDefaultType(e, t);
422
- for (let t of n) {
423
- let n = e.getPart(t), r = a?.overrides.get("/" + t);
424
- n.raw ? this._partWriter.addPart(t, {
425
- kind: "bytes",
426
- bytes: n.raw.compressedData
427
- }, r, {
428
- passThrough: !0,
429
- compressionMethod: n.raw.compressionMethod,
430
- signature: n.raw.signature,
431
- uncompressedSize: n.uncompressedSize
432
- }) : this._partWriter.addPart(t, {
433
- kind: "bytes",
434
- bytes: n.data
435
- }, r), this._writtenPaths.add(t);
436
- }
437
- for (let n of e.getNames()) {
438
- if (n === "[Content_Types].xml" || !Fe(n)) continue;
439
- let i = Le(n);
440
- i !== null && (i === "" || r.has(i)) && (e.isAbsorbed(i) || this._mergeSourceRelsInto(i, e.getPart(n).data, t, r));
441
- }
442
- }
443
- _applyWorkbookContentTypeVariant() {
444
- this._macroEnabled && this._partWriter.replaceContentType("xl/workbook.xml", "application/vnd.ms-excel.sheet.macroEnabled.main+xml");
445
- }
446
- _mergeSourceRelsInto(e, t, n, r) {
447
- let i = this._partWriter.rels(e), a = e === "" || n.has(e);
448
- for (let o of f(t)) {
449
- if (o.external || Re(o.target)) {
450
- i.add(o.type, o.target, {
451
- external: o.external,
452
- idHint: o.id
453
- });
454
- continue;
455
- }
456
- let t = ze(e, o.target);
457
- a && (n.has(t) || this._explicitRelTargets.has(`${e}::${t}`)) || (r.has(t) ? i.add(o.type, o.target, { idHint: o.id }) : this._registry.ownsRelType(o.type) || Ne.has(t) || this._sourcePackage?.isAbsorbed(t) || console.warn(`Dropping preserved relationship to missing part '${t}'`, e || "(root)"));
458
- }
459
- }
460
- addPart(e, t, n, r) {
461
- return this._addPartInternal("", e, t, n, r);
462
- }
463
- _addPartInternal(e, t, n, r, i) {
464
- let a = this._registry.get(t);
465
- if (!a) throw Error(`No emitter registered for kind '${t}'.`);
466
- let o = a.getContentType(n), s = a.getRelTypeUri(n), c = r ?? a.getPath?.(n);
467
- if (!c) throw Error("No path provided in either argument or emitter.");
468
- let l = this._writtenPaths, u = Ce(e, c, l), d = `${t}:${u}`, f = this._scheduledByNodeKey.get(d);
469
- if (!f) {
470
- let e;
471
- this._reserveSourceRelIds(u), f = {
472
- kind: t,
473
- key: d,
474
- payload: n,
475
- path: u,
476
- contentType: o,
477
- promise: new Promise((t) => {
478
- e = t;
479
- }),
480
- resolve: e
481
- }, this._scheduledByNodeKey.set(d, f), this._queue.push(f);
482
- }
483
- let p = this._nodesByPath.get(e);
484
- p || (p = /* @__PURE__ */ new Set(), this._nodesByPath.set(e, p)), p.add(d), !o || s || e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", u);
485
- let m = null;
486
- if (s) {
487
- let t = Te(e, f.path);
488
- m = this._partWriter.rels(e).add(s, t, { idHint: i });
489
- }
490
- return l.add(u), {
491
- path: u,
492
- contentTypeUri: o,
493
- relId: m
494
- };
495
- }
496
- addBinary(e, t, n, r, i = !1, a) {
497
- return this._addBinaryInternal("", e, t, n, r, i, a);
498
- }
499
- _addBinaryInternal(e, t, n, r, i, a = !1, o) {
500
- if (!i) throw Error("No path provided for binary.");
501
- if (!n) throw Error("No content type provided for binary.");
502
- let s = this._writtenPaths, c = Ce(e, i, s, a), l = null;
503
- if (r) {
504
- let t = Te(e, c);
505
- l = this._partWriter.rels(e).add(r, t, { idHint: o });
506
- }
507
- if (e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", c), !s.has(c)) {
508
- let e = c.split(".").pop() || "";
509
- e && this._partWriter.addDefaultType(e, n), this._partWriter.addPart(c, {
510
- kind: "bytes",
511
- bytes: t
512
- }, void 0, {
513
- level: 0,
514
- uncompressedSize: t.byteLength,
515
- dataDescriptor: !1
516
- }), s.add(c);
517
- }
518
- return {
519
- path: c,
520
- contentTypeUri: n,
521
- relId: l
522
- };
523
- }
524
- async _waitForDescendants(e) {
525
- let t = this._nodesByPath.get(e);
526
- if (!t || t.size === 0) return;
527
- let n = [];
528
- for (let e of t) {
529
- let t = this._scheduledByNodeKey.get(e);
530
- if (t) {
531
- let e = this._processPart(t);
532
- n.push(e);
533
- }
534
- }
535
- await Promise.all(n);
536
- }
537
- async _processPart(e) {
538
- if (e.processed) return e.promise;
539
- e.processed = !0;
540
- let t = this._registry.get(e.kind), n = e.path;
541
- this._partWriter.addContentType(e.path, e.contentType);
542
- try {
543
- let r = [], i = { write: (e) => {
544
- r.push(e);
545
- } }, a;
546
- await t.emit(e.payload, {
547
- getXMLWriter: () => a || (a = _e(i), a),
548
- addPart: (e, t, r, i) => this._addPartInternal(n, e, t, r, i),
549
- addBinary: (e, t, r, i, a = !1, o) => this._addBinaryInternal(n, e, t, r, i, a, o),
550
- addExternal: (e, t, r) => ({
551
- path: t,
552
- contentTypeUri: null,
553
- relId: this._partWriter.rels(n).add(e, t, {
554
- external: !0,
555
- idHint: r
556
- })
557
- }),
558
- addRelationship: (e, t, r) => {
559
- if (!this._writtenPaths.has(t) && !this._isSourcePartCarried(t)) return null;
560
- let i = Te(n, t), a = this._partWriter.rels(n).add(e, i, { idHint: r });
561
- return this._explicitRelTargets.add(`${n}::${t}`), a;
562
- },
563
- waitEmit: () => this._waitForDescendants(e.path),
564
- getPath: () => e.path,
565
- getSharedStates: () => this._mapState,
566
- warn: (t, n, r) => {
567
- let i = n ?? e.path, a = this._options.onWarning;
568
- a ? a(t, i, r) : console.warn(t, i);
569
- },
570
- log: (t, n) => {
571
- console.warn(t, n ?? e.path);
572
- }
573
- });
574
- let o = function(e) {
575
- let t = 0;
576
- for (let n of e) t += n.byteLength;
577
- let n = new Uint8Array(t), r = 0;
578
- for (let t of e) n.set(t, r), r += t.byteLength;
579
- return n;
580
- }(r), s = this._options.onPartEmitted;
581
- s && await s(e.kind, e.path, o), Ve && (console.log(`\n=== ${e.path} ===`), console.log(De(o))), this._partWriter.addPart(e.path, {
582
- kind: "bytes",
583
- bytes: o
584
- }, e.contentType);
585
- } catch (t) {
586
- throw this._options.onPartError?.(e.kind, e.path, t), t;
587
- } finally {
588
- this._nodesByPath.delete(e.path), this._scheduledByNodeKey.delete(e.key), e.resolve();
589
- }
590
- }
591
- }, Ve = !1, He = class {
592
- constructor() {
593
- this.map = /* @__PURE__ */ new Map();
594
- }
595
- register(e) {
596
- let t = e.getKind();
597
- if (this.map.has(t)) throw Error(`Duplicate part kind: ${t}`);
598
- this.map.set(t, e);
599
- }
600
- get(e) {
601
- let t = this.map.get(e);
602
- if (!t) throw Error(`Unknown part kind: ${e}`);
603
- return t;
604
- }
605
- has(e) {
606
- return this.map.has(e);
607
- }
608
- ownsRelType(e) {
609
- for (let t of this.map.values()) if (t.getRelTypeUri() === e) return !0;
610
- return !1;
611
- }
612
- };
613
- function Ue(e, t, n) {
614
- e && (e.algorithm && (t[n ? `${n}AlgorithmName` : "algorithmName"] = e.algorithm), e.hash && (t[n ? `${n}HashValue` : "hashValue"] = e.hash), e.salt && (t[n ? `${n}SaltValue` : "saltValue"] = e.salt), e.spinCount !== void 0 && (t[n ? `${n}SpinCount` : "spinCount"] = e.spinCount));
615
- }
616
- var We = "hiddenFormulaXfs", Ge = class {
617
- constructor(e, t) {
618
- this._variants = /* @__PURE__ */ new Map(), this._sources = [], this._json = e, this._styles = t, this._directCount = Math.max(1, e?.direct?.length ?? 0);
619
- }
620
- getHiddenXf(e) {
621
- let t = this._variants.get(e);
622
- return t !== void 0 || (this._isShown(e) ? t = e : (t = this._directCount + this._sources.length, this._sources.push(e)), this._variants.set(e, t)), t;
623
- }
624
- getSources() {
625
- return this._sources;
626
- }
627
- _isShown(e) {
628
- let t = this._json?.direct?.[e], n = t?.protection?.showFormulas;
629
- if (n !== void 0) return n;
630
- let r = (e === 0 ? void 0 : t?.named) ?? V.BuiltInName.Normal;
631
- return this._styles.getNamedStyles().getByName(r)?.toJSON().style?.protection?.showFormulas ?? !1;
632
- }
633
- }, Ke = class {
634
- constructor() {
635
- this._daprFMBks = [], this._daprFMBkMap = /* @__PURE__ */ new Map(), this._rvFMBks = [], this._rvFMBkMap = /* @__PURE__ */ new Map(), this._valueMeta = [];
636
- }
637
- registerArrayCell(e) {
638
- let t = +!!e, n = `1,${t}`, r = this._daprFMBkMap.get(n);
639
- return r === void 0 && (r = this._daprFMBks.length, this._daprFMBks.push({
640
- fDynamic: 1,
641
- fCollapsed: t
642
- }), this._daprFMBkMap.set(n, r)), r + 1;
643
- }
644
- registerRichValueCell(e) {
645
- let t = this._rvFMBkMap.get(e);
646
- t === void 0 && (t = this._rvFMBks.length, this._rvFMBks.push(e), this._rvFMBkMap.set(e, t));
647
- let n = this._valueMeta.length;
648
- return this._valueMeta.push(t), n + 1;
649
- }
650
- hasCellMeta() {
651
- return this._daprFMBks.length > 0;
652
- }
653
- hasValueMeta() {
654
- return this._valueMeta.length > 0;
655
- }
656
- hasAny() {
657
- return this.hasCellMeta() || this.hasValueMeta();
658
- }
659
- getDAPRFutureMetadataBlocks() {
660
- return this._daprFMBks;
661
- }
662
- getRVFutureMetadataBlocks() {
663
- return this._rvFMBks;
664
- }
665
- getValueMeta() {
666
- return this._valueMeta;
667
- }
668
- }, qe = class {
669
- constructor(e, t = console.warn) {
670
- this._entries = [], this._keyMap = /* @__PURE__ */ new Map(), this._metaCollector = e, this._onWarn = t;
671
- }
672
- add(e) {
673
- if (e == null) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
674
- if (se.isError(e)) {
675
- let t = e.getCode(), n = this._register(`_error:${t}`, { errorType: "" + (t - 1) }, Je);
676
- return this._metaCollector.registerRichValueCell(n);
677
- }
678
- return e.isIRichData && e.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", e), this._registerFallback();
679
- }
680
- _registerFallback() {
681
- let e = this._register("_error:fallback", { errorType: se.Code.Unknown - 1 }, Je);
682
- return this._metaCollector.registerRichValueCell(e);
683
- }
684
- _register(e, t, n) {
685
- let r = this._keyMap.get(e);
686
- return r === void 0 && (r = this._entries.length, this._entries.push({
687
- handler: n,
688
- rawValue: t
689
- }), this._keyMap.set(e, r)), r;
690
- }
691
- getCount() {
692
- return this._entries.length;
693
- }
694
- hasAny() {
695
- return this._entries.length > 0;
696
- }
697
- getEntries() {
698
- return this._entries;
699
- }
700
- uniqueHandlers() {
701
- let e = /* @__PURE__ */ new Set(), t = [];
702
- for (let n of this._entries) e.has(n.handler) || (e.add(n.handler), t.push(n.handler));
703
- return t;
704
- }
705
- handlerStructureIndex(e) {
706
- let t = 0, n = /* @__PURE__ */ new Set();
707
- for (let r of this._entries) if (!n.has(r.handler)) {
708
- if (r.handler === e) return t;
709
- n.add(r.handler), t++;
710
- }
711
- return -1;
712
- }
713
- }, Je = new class {
714
- constructor(e, t) {
715
- this.type = e, this.props = t;
716
- }
717
- getValues(e) {
718
- return this.props.map(([t, , n = ""]) => {
719
- let r = e?.[t];
720
- return r == null ? n : "" + r;
721
- });
722
- }
723
- }("_error", [[
724
- "errorType",
725
- "i",
726
- ""
727
- ], [
728
- "subType",
729
- "i",
730
- "0"
731
- ]]), Ye = "application/xml", Xe = async (e, t) => {
732
- let n = e.parts, r = n ? n.length : 0;
733
- for (let i = 0; i < r; i++) {
734
- let r = n[i];
735
- try {
736
- await Ze(r, t);
737
- } catch (n) {
738
- t.log(`Unable to write the part '${r.name ?? r.id}' referenced by '${e.name ?? e.id}'`, n);
739
- }
740
- }
741
- }, Ze = async (e, t, n) => {
742
- let r = e.resId === void 0 ? void 0 : t.getSharedStates().get(he)?.get(e.resId);
743
- if (!r) return e.resId === void 0 ? t.addPart("embeddedPart", e, n, e.id) : (t.log(`The part '${e.name ?? e.id}' cites resource ${e.resId}, which is not in the workbook.`), null);
744
- let i = await r.getExternalURI();
745
- if (i) {
746
- let n = t.addExternal(e.type, i, e.id);
747
- return n.relId !== e.id && t.log(`The external reference '${e.id}' was written as '${n.relId}'; the markup will not find it.`), n;
748
- }
749
- let a = await r.toBuffer();
750
- return t.addBinary(new Uint8Array(a), e.contentType || Ye, e.type, n ?? `./${Qe(e.name)}`, !1, e.id);
751
- }, Qe = (e) => {
752
- let t = e && /^[\w.\-~%]+$/.test(e) ? e : "part.xml", n = t.lastIndexOf("."), r = n > 0 ? t.slice(0, n) : t, i = n > 0 ? t.slice(n) : "";
753
- return `${r.replace(/\d+$/, "")}{n}${i}`;
754
- }, $e = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", et = (e, t) => e.getSharedStates().get("pivotCachePaths")?.get(t) ?? null, tt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink", nt = "fileVersion", rt = "sheetParts", it = "externalLinkParts";
755
- function at(e) {
756
- if (!e || e.indexOf("[") === -1) return [];
757
- let t = [], n = e.replace(/"(?:[^"]|"")*"/g, "");
758
- for (let e of n.matchAll(/\[(\d+)\]/g)) {
759
- let n = Number(e[1]);
760
- n > 0 && !t.includes(n) && t.push(n);
761
- }
762
- return t;
763
- }
764
- var ot = {
765
- auto: "auto",
766
- automaticExceptTables: "autoNoTable",
767
- manual: "manual"
768
- };
769
- function G(e, t, n, r) {
770
- if (!n) return;
771
- let i = typeof n == "string" ? t.parseColor(n) : n;
772
- r && e.start(r);
773
- let a = i.getType(), o = i.getVal(), s = i.getAdjustments(), c = s && s.length > 0;
774
- switch (a) {
775
- case "scheme":
776
- c ? (e.start("schemeClr", { val: o }), K(e, s), e.end("schemeClr")) : e.empty("schemeClr", { val: o });
777
- break;
778
- case "named":
779
- if (ae.isSystem(o)) {
780
- let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
781
- c ? (e.start("sysClr", {
782
- val: o,
783
- lastClr: t
784
- }), K(e, s), e.end("sysClr")) : e.empty("sysClr", {
785
- val: o,
786
- lastClr: t
787
- });
788
- } else c ? (e.start("prstClr", { val: o }), K(e, s), e.end("prstClr")) : e.empty("prstClr", { val: o });
789
- break;
790
- case "auto": {
791
- let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
792
- c ? (e.start("sysClr", {
793
- val: "windowText",
794
- lastClr: t
795
- }), K(e, s), e.end("sysClr")) : e.empty("sysClr", {
796
- val: "windowText",
797
- lastClr: t
798
- });
799
- break;
800
- }
801
- case "index":
802
- c ? (e.start("srgbClr", { val: o }), K(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: o });
803
- break;
804
- case "hsl":
805
- let t = i.toHex().toString();
806
- c ? (e.start("srgbClr", { val: t }), K(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: t });
807
- break;
808
- case "rgb":
809
- case "lrgb":
810
- let n = i.toHex().toString();
811
- c ? (e.start("srgbClr", { val: n }), K(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: n });
812
- break;
813
- case "hex":
814
- let r = o.replace("#", "").toUpperCase();
815
- c ? (e.start("srgbClr", { val: r }), K(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: r });
816
- break;
817
- default:
818
- let a = o.replace("#", "").toUpperCase();
819
- e.empty("srgbClr", { val: a });
820
- }
821
- r && e.end(r);
822
- }
823
- function K(e, t) {
824
- if (t && t.length !== 0) for (let n of t) for (let [t, r] of Object.entries(n)) {
825
- if (r == null) continue;
826
- let n = t;
827
- if (n) if (typeof r == "boolean") e.empty(n);
828
- else {
829
- let i;
830
- if (t === "alpha" || t === "alphaOff" || t === "alphaMod") i = Math.round(1e5 * r);
831
- else {
832
- if (t === "eTint") {
833
- if (r < 0) {
834
- e.empty("shade", { val: Math.round(1e5 * (1 + r)).toString() });
835
- continue;
836
- }
837
- e.empty("tint", { val: Math.round(1e5 * r).toString() });
838
- continue;
839
- }
840
- i = Math.round(1e3 * r);
841
- }
842
- e.empty(n, { val: i.toString() });
843
- }
844
- }
845
- }
846
- function q(e, t, n, r, i = !1, a = !1) {
847
- if (!n) return;
848
- let o = typeof n == "string" ? t.parseColor(n) : n, s = () => {
849
- e.empty(r, { rgb: mt(o.toHex().toString(!0)) });
850
- }, c = o.getAdjustments(), l = c && c.length > 0, u = o.getType();
851
- if (u !== L.Type.Auto) {
852
- if (u === L.Type.Scheme) {
853
- let t = o.getVal(), n = st[t] ?? t, i = ut.get(n);
854
- if (i === void 0 && n !== "phClr") return console.warn(`Color scheme not in theme. schemeVal=${t} themeKey=${n}`), s();
855
- let a = {};
856
- if (a.theme = i, l) {
857
- if (!function(e) {
858
- for (let t of e) switch (Object.keys(t)[0]) {
859
- case L.AdjustmentType.Tint:
860
- case L.AdjustmentType.ETint:
861
- case L.AdjustmentType.Shade:
862
- case L.AdjustmentType.Lum:
863
- case L.AdjustmentType.LumOff:
864
- case L.AdjustmentType.LumMod:
865
- case L.AdjustmentType.Alpha:
866
- case L.AdjustmentType.AlphaOff:
867
- case L.AdjustmentType.AlphaMod: continue;
868
- default: return !1;
869
- }
870
- return !0;
871
- }(c)) return s();
872
- let e = c.length === 1 ? c[0][L.AdjustmentType.ETint] : void 0, t;
873
- if (e !== void 0) t = ft(e);
874
- else {
875
- let e = o.getBaseColor().toHex().toString(!0), n = o.toHex().toString(!0);
876
- t = ft(function(e, t) {
877
- let n = dt(e, 0, 255), r = dt(t, 0, 255);
878
- return Math.abs(r - n) < 1e-9 ? 0 : r < n ? n <= 1e-9 ? -1 : dt(r / n - 1, -1, 0) : 255 - n <= 1e-9 ? 0 : dt((r - n) / (255 - n), 0, 1);
879
- }(pt(e), pt(n)));
880
- }
881
- t !== 0 && (a.tint = t);
882
- }
883
- e.empty(r, a);
884
- return;
885
- }
886
- if (u === L.Type.Index) {
887
- let t = o.getVal(), n = t.substring(5, t.length);
888
- e.empty(r, { indexed: Number(n) });
889
- return;
890
- }
891
- return s();
892
- }
893
- e.empty(r, { auto: 1 });
894
- }
895
- var st = {
896
- bg1: "lt1",
897
- tx1: "dk1",
898
- bg2: "lt2",
899
- tx2: "dk2",
900
- accent1: "accent1",
901
- accent2: "accent2",
902
- accent3: "accent3",
903
- accent4: "accent4",
904
- accent5: "accent5",
905
- accent6: "accent6",
906
- hlink: "hlink",
907
- folHlink: "folHlink"
908
- }, ct = Object.freeze([
909
- "lt1",
910
- "dk1",
911
- "lt2",
912
- "dk2",
913
- "accent1",
914
- "accent2",
915
- "accent3",
916
- "accent4",
917
- "accent5",
918
- "accent6",
919
- "hlink",
920
- "folHlink"
921
- ]), lt = Object.freeze([
922
- "dk1",
923
- "lt1",
924
- "dk2",
925
- "lt2",
926
- "accent1",
927
- "accent2",
928
- "accent3",
929
- "accent4",
930
- "accent5",
931
- "accent6",
932
- "hlink",
933
- "folHlink"
934
- ]), ut = new Map(ct.map((e, t) => [e, t]));
935
- function dt(e, t, n) {
936
- return Math.max(t, Math.min(n, e));
937
- }
938
- function ft(e) {
939
- let t = dt(e, -1, 1);
940
- return Math.abs(t) < 1e-12 ? 0 : t;
941
- }
942
- function pt(e) {
943
- let t = function(e) {
944
- let t = e.replace(/^#/, "").toUpperCase();
945
- if (t.length === 8) return t.slice(2);
946
- if (t.length === 6) return t;
947
- throw Error(`Invalid hex: ${e}`);
948
- }(e), n = parseInt(t.slice(0, 2), 16) / 255, r = parseInt(t.slice(2, 4), 16) / 255, i = parseInt(t.slice(4, 6), 16) / 255;
949
- return (Math.max(n, r, i) + Math.min(n, r, i)) / 2 * 255;
950
- }
951
- function mt(e) {
952
- let t = e.replace(/^#/, "").toUpperCase();
953
- if (t.length === 8) return t;
954
- if (t.length === 6) return "FF" + t;
955
- throw Error(`Invalid hex: ${e}`);
956
- }
957
- function ht(e, t = !1) {
958
- let n = e;
959
- return n.length === 8 && (n = n.substring(2, 8)), n.length === 6 && (n = (t ? "00" : "FF") + n), n.toUpperCase();
960
- }
961
- function gt(e) {
962
- return `[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ${e.getContent()}`;
963
- }
964
- function _t(e, t) {
965
- if (typeof t == "string") return void vt(e, t);
966
- let n = t.runs;
967
- for (let t = 0; t < n.length; t++) {
968
- let r = n[t];
969
- e.start("r"), (r.bold || r.italic || r.size !== void 0 || r.font || r.color) && (e.start("rPr"), r.bold && e.empty("b"), r.italic && e.empty("i"), r.size !== void 0 && e.empty("sz", { val: r.size }), r.color && e.empty("color", { rgb: "FF" + r.color.replace(/^#/, "").toUpperCase() }), r.font && e.empty("rFont", { val: r.font }), e.end("rPr")), vt(e, r.text ?? ""), e.end("r");
970
- }
971
- }
972
- function vt(e, t) {
973
- e.start("t", ie.test(t) || /[\n\r]/.test(t) ? n : void 0), e.text(t), e.end("t");
974
- }
975
- function yt(e) {
976
- let t = e.getRanges();
977
- if (t.isInvalid()) return null;
978
- let n = t.getCoords()[0];
979
- return n ? {
980
- ref: P.cellToString({
981
- rowIndex: n.rowStart,
982
- colIndex: n.colStart
983
- }),
984
- row: n.rowStart,
985
- col: n.colStart
986
- } : null;
987
- }
988
- function J(e, t, n, r, i = !1, a = !1) {
989
- let o = r.getTheme();
990
- if (i && t.start("fill"), typeof n == "string" && (n = {
991
- type: B.Type.Solid,
992
- color: n
993
- }), n.type === B.Type.None) i ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
994
- else if (n.type === B.Type.Solid) {
995
- let e = n;
996
- i ? t.start("patternFill", { patternType: "solid" }) : t.start("solidFill"), e.color && (i ? q(t, o, e.color, "fgColor") : G(t, o, e.color)), i ? t.end("patternFill") : t.end("solidFill");
997
- } else if (n.type === B.Type.Pattern) {
998
- let e = n, r = e.patternType || "solid";
999
- t.start("patternFill", { patternType: r }), e.foreground && (i ? q(t, o, a ? e.background : e.foreground, "fgColor") : G(t, o, a ? e.background : e.foreground)), e.background && (i ? q(t, o, a ? e.foreground : e.background, "bgColor") : G(t, o, a ? e.foreground : e.background)), t.end("patternFill");
1000
- } else if (n.type === B.Type.Gradient && i) {
1001
- let e = n, r = {}, i = e.gradientType;
1002
- if (i !== B.GradientType.Path && i !== B.GradientType.Linear || (r.type = i), e.angle !== void 0) {
1003
- let t = (e.angle - 90) % 360;
1004
- t !== 0 && (r.degree = String(t));
1005
- }
1006
- let a = e.focus;
1007
- a && (a.left && (r.left = String(a.left)), a.right && (r.right = String(a.right)), a.top && (r.top = String(a.top)), a.bottom && (r.bottom = String(a.bottom))), t.start("gradientFill", r);
1008
- let s = e.stops;
1009
- if (s && s.length > 0) for (let e of s) {
1010
- let n, r = 0;
1011
- if (typeof e == "string" || typeof e == "object" && !("offset" in e)) n = e, r = 0;
1012
- else {
1013
- let t = e;
1014
- r = t.offset || 0, n = t.color;
1015
- }
1016
- t.start("stop", { position: String(r) }), n && q(t, o, n, "color"), t.end("stop");
1017
- }
1018
- t.end("gradientFill");
1019
- } else if (n.type === B.Type.Gradient) {
1020
- let e = n, r = {};
1021
- e.isRotatedWithShape !== void 0 && (r.rotWithShape = e.isRotatedWithShape ? "1" : "0"), t.start("gradFill", r), t.start("gsLst");
1022
- let i = e.stops;
1023
- if (i && i.length > 0) for (let e of i) {
1024
- let n, r = 0;
1025
- if (typeof e == "string" || typeof e == "object" && !("offset" in e)) n = e;
1026
- else {
1027
- let t = e;
1028
- r = t.offset || 0, n = t.color;
1029
- }
1030
- t.start("gs", { pos: String(I.roundAccurately(1e3 * r, 0)) }), n && G(t, o, n), t.end("gs");
1031
- }
1032
- t.end("gsLst");
1033
- let a = e.gradientType;
1034
- if (a && a !== B.GradientType.Linear) {
1035
- let n = a === "radial" ? "circle" : a;
1036
- t.start("path", { path: n });
1037
- let r = e.focus;
1038
- if (r) {
1039
- let e = {};
1040
- r.t !== void 0 && (e.t = String(I.roundAccurately(1e3 * r.t, 0))), r.l !== void 0 && (e.l = String(I.roundAccurately(1e3 * r.l, 0))), r.b !== void 0 && (e.b = String(I.roundAccurately(1e3 * r.b, 0))), r.r !== void 0 && (e.r = String(I.roundAccurately(1e3 * r.r, 0))), t.empty("fillToRect", e);
1041
- }
1042
- t.end("path");
1043
- } else {
1044
- let n = {};
1045
- e.angle !== void 0 && (n.ang = String(I.roundAccurately(6e4 * e.angle, 0)));
1046
- let r = e.scaled;
1047
- r !== void 0 && (n.scaled = r ? "1" : "0"), t.empty("lin", n);
1048
- }
1049
- t.end("gradFill");
1050
- } else i ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
1051
- i && t.end("fill");
1052
- }
1053
- var bt = (e, t, n, r) => {
1054
- if (!n) return t.start("ln"), t.empty("noFill"), void t.end("ln");
1055
- typeof n == "string" && (n = { fill: n });
1056
- let i = n, a = {};
1057
- if (i.width !== void 0 && (a.w = String(Y(i.width))), i.lineCap !== void 0 && (a.cap = xt(i.lineCap)), i.compound !== void 0 && (a.cmpd = i.compound), i.align !== void 0 && (a.algn = i.align), t.start("ln", a), J(0, t, i.fill ?? Tt, r), Array.isArray(i.dash)) {
1058
- t.start("custDash");
1059
- for (let e = 0; e < i.dash.length; e += 2) t.empty("ds", {
1060
- d: String(I.roundAccurately(1e3 * i.dash[e], 0)),
1061
- sp: String(I.roundAccurately(1e3 * (i.dash[e + 1] ?? 0), 0))
1062
- });
1063
- t.end("custDash");
1064
- } else typeof i.dash == "string" && t.empty("prstDash", { val: i.dash });
1065
- if (i.lineJoin === de.LineJoin.Round) t.empty("round");
1066
- else if (i.lineJoin === de.LineJoin.Bevel) t.empty("bevel");
1067
- else if (i.lineJoin === de.LineJoin.Miter) {
1068
- let e = {};
1069
- i.miterLimit !== void 0 && (e.lim = String(I.roundAccurately(1e5 * i.miterLimit, 0))), t.empty("miter", e);
1070
- }
1071
- t.end("ln");
1072
- }, xt = (e) => e === "round" ? "rnd" : e === "butt" ? "flat" : e === "square" ? "sq" : e, St = (e, t, n, r = void 0, i = !1) => {
1073
- if (!n || !(n.fill || n.stroke || n.effects?.length || i)) return;
1074
- let a = e.getXMLWriter();
1075
- r && a.start(r), a.pushDefaultNamespace("a"), n.fill && J(0, a, n.fill, t), n.stroke && bt(0, a, n.stroke, t), n.effects?.length ? Ct(e, a, t.getTheme(), n.effects) : i && a.empty("effectLst"), a.popDefaultNamespace(), r && a.end(r);
1076
- }, Ct = (e, t, n, r) => {
1077
- t.start("effectLst");
1078
- for (let e of r) wt(t, n, e);
1079
- t.end("effectLst");
1080
- }, wt = (e, t, n) => {
1081
- switch (n.type) {
1082
- case le.Type.OuterShadow: {
1083
- let r = n, i = {};
1084
- r.blur !== void 0 && (i.blurRad = String(Y(r.blur))), r.distance !== void 0 && (i.dist = String(Y(r.distance))), r.angle !== void 0 && (i.dir = String(Z(r.angle))), r.alignment !== void 0 && (i.algn = r.alignment), r.isRotatedWithShape !== void 0 && (i.rotWithShape = r.isRotatedWithShape ? "1" : "0"), r.scaleX !== void 0 && (i.sx = String(I.roundAccurately(1e3 * r.scaleX, 0))), r.scaleY !== void 0 && (i.sy = String(I.roundAccurately(1e3 * r.scaleY, 0))), r.skewX !== void 0 && (i.kx = String(Z(r.skewX))), r.skewY !== void 0 && (i.ky = String(Z(r.skewY))), e.start("outerShdw", i), G(e, t, r.color), e.end("outerShdw");
1085
- break;
1086
- }
1087
- case le.Type.InnerShadow: {
1088
- let r = n, i = {};
1089
- r.blur !== void 0 && (i.blurRad = String(Y(r.blur))), r.distance !== void 0 && (i.dist = String(Y(r.distance))), r.angle !== void 0 && (i.dir = String(Z(r.angle))), e.start("innerShdw", i), G(e, t, r.color), e.end("innerShdw");
1090
- break;
1091
- }
1092
- case le.Type.PresetShadow: {
1093
- let r = n, i = { prst: r.preset };
1094
- r.distance !== void 0 && (i.dist = String(Y(r.distance))), r.angle !== void 0 && (i.dir = String(Z(r.angle))), e.start("prstShdw", i), G(e, t, r.color), e.end("prstShdw");
1095
- break;
1096
- }
1097
- case le.Type.Glow: {
1098
- let r = n, i = {};
1099
- r.radius !== void 0 && (i.rad = String(Y(r.radius))), e.start("glow", i), G(e, t, r.color), e.end("glow");
1100
- break;
1101
- }
1102
- case le.Type.SoftEdge: {
1103
- let t = n, r = {};
1104
- t.radius !== void 0 && (r.rad = String(Y(t.radius))), e.empty("softEdge", r);
1105
- break;
1106
- }
1107
- case le.Type.Reflection: {
1108
- let t = n, r = {};
1109
- t.blur !== void 0 && (r.blurRad = String(Y(t.blur))), t.distance !== void 0 && (r.dist = String(Y(t.distance))), t.angle !== void 0 && (r.dir = String(Z(t.angle))), t.fadeAngle !== void 0 && (r.fadeDir = String(Z(t.fadeAngle))), t.startAlpha !== void 0 && (r.stA = String(I.roundAccurately(1e3 * t.startAlpha, 0))), t.startPosition !== void 0 && (r.stPos = String(I.roundAccurately(1e3 * t.startPosition, 0))), t.endAlpha !== void 0 && (r.endA = String(I.roundAccurately(1e3 * t.endAlpha, 0))), t.endPosition !== void 0 && (r.endPos = String(I.roundAccurately(1e3 * t.endPosition, 0))), t.scaleX !== void 0 && (r.sx = String(I.roundAccurately(1e3 * t.scaleX, 0))), t.scaleY !== void 0 && (r.sy = String(I.roundAccurately(1e3 * t.scaleY, 0))), t.skewX !== void 0 && (r.kx = String(Z(t.skewX))), t.skewY !== void 0 && (r.ky = String(Z(t.skewY))), t.alignment !== void 0 && (r.algn = t.alignment), t.isRotatedWithShape !== void 0 && (r.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.empty("reflection", r);
1110
- break;
1111
- }
1112
- }
1113
- }, Tt = { type: "none" }, Et = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", Dt = "imagesWritten", Ot = {
1114
- mime: "image/png",
1115
- ext: "png"
1116
- }, Y = (e = 0) => I.roundAccurately(12700 * e, 0), X = (e = 0) => I.roundAccurately(9525 * e, 0), Z = (e) => 6e4 * e, kt = (e = 0) => I.roundAccurately(100 * e, 2), At = class {
1117
- constructor() {
1118
- this._dxfs = [], this._byKey = /* @__PURE__ */ new Map();
1119
- }
1120
- add(e) {
1121
- let t = JSON.stringify(e), n = this._byKey.get(t);
1122
- return n === void 0 && (n = this._dxfs.length, this._dxfs.push(e), this._byKey.set(t, n)), n;
1123
- }
1124
- getDxfs() {
1125
- return this._dxfs;
1126
- }
1127
- getCount() {
1128
- return this._dxfs.length;
1129
- }
1130
- }, jt = "cfDxfs", Mt = [
1131
- "font",
1132
- "fill",
1133
- "borders",
1134
- "numberFormat",
1135
- "alignment"
1136
- ];
1137
- function Nt(e, t, n) {
1138
- if (t) {
1139
- if (t.named) {
1140
- let r = t.named, i = r.toLowerCase(), a = n.namedStyleMap;
1141
- if (!a.has(i)) {
1142
- a.set(i, "" + a.size);
1143
- let t = e.getNamedStyles().getByName(r).toJSON();
1144
- Nt(e, t.style ?? I.EmptyObject, n), n.namedStyles.push(t);
1145
- }
1146
- }
1147
- t.font && function(e, t, n) {
1148
- if (!t) return;
1149
- let r = F.JSONStableStringify(t), i = n.fontMap;
1150
- if (!i.has(r)) {
1151
- let e = i.size;
1152
- i.set(r, "" + e), n.fonts.push(t);
1153
- }
1154
- }(0, t.font, n), t.fill && function(e, t, n) {
1155
- if (!t) return;
1156
- let r = F.JSONStableStringify(t), i = n.fillMap;
1157
- if (!i.has(r) && typeof t == "object" && t.type) {
1158
- let e = i.size;
1159
- i.set(r, "" + e), n.fills.push(t);
1160
- }
1161
- }(0, t.fill, n), t.borders && function(e, t, n) {
1162
- if (!t) return;
1163
- let r = F.JSONStableStringify(t), i = n.borderMap;
1164
- if (!i.has(r)) {
1165
- let e = i.size;
1166
- i.set(r, "" + e), n.borders.push(t);
1167
- }
1168
- }(0, t.borders, n), t.numberFormat !== void 0 && function(e, t, n) {
1169
- if (!t) return;
1170
- let r = pe.toBuiltInID(t), i = n.numFmtMap;
1171
- if (!i.has(r)) {
1172
- let e = 0;
1173
- typeof r == "number" ? e = r : (e = n.numFmtsCustom.length + Vt, n.numFmtsCustom.push(r)), i.set(t, "" + e);
1174
- }
1175
- }(0, t.numberFormat, n);
1176
- }
1177
- }
1178
- function Pt(e, t, n) {
1179
- if (!t) return;
1180
- let r = t.name.toLowerCase();
1181
- n.namedStyleMap.has(r) || (n.namedStyleMap.set(r, "" + n.namedStyleMap.size), n.namedStyles.push(t), Nt(e, t.style, n));
1182
- }
1183
- function Ft(e, t, n, r, i = !1) {
1184
- let a = r.getDefaultFontSize(), o = r.getTheme().getFontScheme().getMinorFont() ?? "Calibri", s = r.getNormal().getFont().getColor();
1185
- t.start("font"), n.weight && n.weight >= 700 && t.empty("b"), n.style && n.style !== "normal" && t.empty("i"), n.strike && t.empty("strike"), n.underline && t.empty("u", { val: n.underline }), n.outline && t.empty("outline"), n.shadow && t.empty("shadow"), n.extend && t.empty("extend");
1186
- let c = n.verticalAlign;
1187
- c && (c === "super" && (c = "superscript"), c === "sub" && (c = "subscript"), t.empty("vertAlign", { val: c })), i ? n.size !== void 0 && t.empty("sz", { val: String(n.size) }) : t.empty("sz", { val: String(n.size ?? a) }), q(t, r.getTheme(), n.color ?? s, "color", !i);
1188
- let l = !i || n.family && n.family !== o;
1189
- if (l && (t.empty("name", { val: n.family ?? o }), n.fallbacks && n.fallbacks.length > 0)) {
1190
- let e = n.fallbacks;
1191
- e.includes("serif") ? t.empty("family", { val: 1 }) : e.includes("sans-serif") ? t.empty("family", { val: 2 }) : e.includes("monospace") ? t.empty("family", { val: 3 }) : e.includes("cursive") ? t.empty("family", { val: 4 }) : e.includes("fantasy") && t.empty("family", { val: 5 });
1192
- }
1193
- n.charset !== void 0 && n.charset !== null && t.empty("charset", { val: String(n.charset) });
1194
- let u = n.scheme ?? (n.family === void 0 ? "minor" : void 0);
1195
- l && u !== void 0 && u !== "none" && t.empty("scheme", { val: u }), t.end("font");
1196
- }
1197
- function It(e, t, n, r, i, a = !1) {
1198
- if (!i || i.style === "none" || !i.style) return void (a && !i || t.empty(r));
1199
- t.start(r, { style: i.style });
1200
- let o = i.color;
1201
- o && q(t, n, o, "color", !a, a), t.end(r);
1202
- }
1203
- function Lt(e, t, n, r, i = !1) {
1204
- let a = {};
1205
- i ? (a.diagonalUp = "0", a.diagonalDown = "0") : (n.diagonalUp && (a.diagonalUp = "1"), n.diagonalDown && (a.diagonalDown = "1")), t.start("border", a), It(0, t, r, "left", n.left, i), It(0, t, r, "right", n.right, i), It(0, t, r, "top", n.top, i), It(0, t, r, "bottom", n.bottom, i), i ? (It(0, t, r, "vertical", n.vertical, i), It(0, t, r, "horizontal", n.horizontal, i)) : It(0, t, r, "diagonal", n.diagonalUp ?? n.diagonalDown, i), t.end("border");
1206
- }
1207
- function Rt(e, t, n, r = !1) {
1208
- let i = {};
1209
- n.horizontal && n.horizontal !== H.HorizontalAlignment.General && (i.horizontal = n.horizontal), n.vertical && n.vertical !== H.VerticalAlignment.Bottom && (i.vertical = n.vertical);
1210
- let a = n.rotation;
1211
- n.stacked && (i.textRotation = "255", a = 0), a && (a >= 270 && a < 360 ? a = 360 - a : a > 0 && a <= 90 && (a += 90), i.textRotation = String(a));
1212
- let o = n.overflow;
1213
- switch (o === H.Overflow.Wrap && (i.wrapText = "1"), n.indent && (i.indent = "" + n.indent), n.relativeIndent && (i.relativeIndent = "" + n.relativeIndent), n.justifyLastLine && (i.justifyLastLine = "1"), o === H.Overflow.Shrink && (i.shrinkToFit = "1"), n.readingDirection) {
1214
- case H.ReadingDirection.Auto: break;
1215
- case H.ReadingDirection.LeftToRight:
1216
- i.readingOrder = "1";
1217
- break;
1218
- case H.ReadingDirection.RightToLeft: i.readingOrder = "2";
1219
- }
1220
- return Object.keys(i).length > 0 ? i : null;
1221
- }
1222
- function zt(e, t, n, r, i, a, o = !1) {
1223
- let s = {}, c = null, l = r.named;
1224
- l && (c = n.getNamedStyles().getByName(l).toJSON().style);
1225
- let u = r.font ?? c?.font, d = u ? i.fontMap.get(F.JSONStableStringify(u)) ?? 0 : 0, f = r.fill ?? c?.fill, p = f ? i.fillMap.get(F.JSONStableStringify(f)) ?? 0 : 0, m = r.borders ?? c?.borders, h = m ? i.borderMap.get(F.JSONStableStringify(m)) ?? 0 : 0, g = r.numberFormat ?? c?.numberFormat;
1226
- if (s.numFmtId = (g === void 0 ? void 0 : i.numFmtMap.get(g)) ?? "0", s.fontId = String(d), s.fillId = String(p), s.borderId = String(h), a) {
1227
- let e = r.named ?? V.BuiltInName.Normal;
1228
- s.xfId = i.namedStyleMap.get(e.toLowerCase());
1229
- }
1230
- let _ = null, v = r.alignment ?? c?.alignment;
1231
- v && (_ = Rt(0, 0, v)), r.font && (s.applyFont = "1"), r.fill && (s.applyFill = "1"), r.numberFormat && (s.applyNumberFormat = "1"), r.borders && (s.applyBorder = "1"), _ && (s.applyAlignment = "1");
1232
- let y = null, b = r.protection?.alwaysUnlocked ?? c?.protection?.alwaysUnlocked ?? !1;
1233
- (b || o) && (y = {}, b && (y.locked = "0"), o && (y.hidden = "1"), s.applyProtection = "1"), r.quotePrefix && (s.quotePrefix = "1"), _ || y ? (t.start("xf", s), _ && t.empty("alignment", _), y && t.empty("protection", y), t.end("xf")) : t.empty("xf", s);
1234
- }
1235
- function Bt(e, t, n, r, i, a = "dxf", o = Vt) {
1236
- if (t.start(a), n.font && Ft(0, t, n.font, r, !0), n.numberFormat !== void 0 && n.numberFormat !== null) {
1237
- let e = pe.toBuiltInID(n.numberFormat), r = typeof e == "number", i = r ? pe.builtInFormat(e) : String(e);
1238
- i && t.empty("numFmt", {
1239
- numFmtId: String(r ? e : o++),
1240
- formatCode: i
1241
- });
1242
- }
1243
- if (n.fill && J(0, t, n.fill, r, !0, !0), n.alignment) {
1244
- let e = Rt(0, 0, n.alignment, !0);
1245
- e && t.empty("alignment", e);
1246
- }
1247
- return n.borders && Lt(0, t, n.borders, i, !0), t.end(a), o;
1248
- }
1249
- var Vt = 164, Ht = Object.freeze([
1250
- "wholeTable",
1251
- "headerRow",
1252
- "totalRow",
1253
- "firstColumn",
1254
- "lastColumn",
1255
- "firstRowStripe",
1256
- "secondRowStripe",
1257
- "firstColumnStripe",
1258
- "secondColumnStripe",
1259
- "firstHeaderCell",
1260
- "lastHeaderCell",
1261
- "firstTotalCell",
1262
- "lastTotalCell"
1263
- ]), Ut = R.BuiltInOperatorNames, Wt = (e, t, n, r, i, a) => {
1264
- let o = r.sorts, s = o ? o.length : 0;
1265
- if (s === 0) return;
1266
- let c = {};
1267
- if (s > 0) {
1268
- let e = o[0].criteria?.collatorOptions;
1269
- e && (c.caseSensitive = typeof e != "object" || Array.isArray(e) || e.sensitivity !== "case" && e.sensitivity !== "variant" ? "0" : "1");
1270
- }
1271
- c.ref = n.getRange().toString(), c["xmlns:xlrd2"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2", t.start("sortState", c);
1272
- for (let e = 0; e < s; e++) {
1273
- let n = o[e], r = n.criteria ?? {}, s = n.index + a.colStart, c = {};
1274
- r.reverse && (c.descending = "1"), c.ref = i.getIntersect({
1275
- colStart: s,
1276
- rowStart: a.rowStart,
1277
- colEnd: s,
1278
- rowEnd: a.rowEnd
1279
- }).toString(), r.sortOn && (c.sortBy = r.sortOn), r.dxfId !== void 0 && (c.dxfId = r.dxfId), r.iconSet !== void 0 && (c.iconSet = r.iconSet), r.customList !== void 0 && (c.customList = r.customList), t.empty("sortCondition", c);
1280
- }
1281
- t.end("sortState");
1282
- }, Gt = (e, t, n, r, i = !1) => {
1283
- let a = n.getRange();
1284
- n.isShowTotals() && (a = a.getResizeBy(-1, 0));
1285
- let o = a.getCoords(), s = r.sort, c = r.filter, l = c ? c.conditions : void 0, u = l ? l.length : 0, d = r.hiddenButtons, f = {};
1286
- f.ref = a.toString();
1287
- let p, m = [];
1288
- for (let e = 0; e < u; e++) {
1289
- let t = l[e];
1290
- m[t.index] = { ...t };
1291
- }
1292
- if (Array.isArray(d) && d.length > 0) {
1293
- let e = d.length;
1294
- p = Array(d[e - 1]);
1295
- for (let t = 0; t < e; t++) p[d[t]] = !0;
1296
- }
1297
- if (m || d || p || i) {
1298
- let c = 0;
1299
- r.columns ? c = r.columns.length : i && (c = a.getColumnCount()), t.start("autoFilter", f);
1300
- for (let n = 0; n < c; n++) {
1301
- let r = !0 === d || !0 === p?.[n], i = m[n];
1302
- (i || r) && qt(e, t, n, i, r);
1303
- }
1304
- s && i && Wt(0, t, n, s, a, o), t.end("autoFilter");
1305
- } else t.empty("autoFilter", f);
1306
- s && !i && Wt(0, t, n, s, a, o);
1307
- }, Kt = (e, t, n) => {
1308
- let r = ee(n, (t) => e.warn(t, n));
1309
- if (!r) return;
1310
- let i = { operator: r.operator };
1311
- r.val !== void 0 && (i.val = r.val), t.empty("customFilter", i);
1312
- }, qt = (e, t, n, r, i) => {
1313
- let a = {};
1314
- a.colId = "" + n, i && (a.hiddenButton = "1"), r ? (t.start("filterColumn", a), ((e, t, n) => {
1315
- let r = n.operator;
1316
- if (r !== R.BuiltInOperatorNames.Expression) if (r !== R.BuiltInOperatorNames.Unique) {
1317
- if (r === R.BuiltInOperatorNames.Color) {
1318
- let e = n.param, r = {};
1319
- e.cellColor !== void 0 && (r.cellColor = e.cellColor ? "1" : "0"), e.styleId !== void 0 && (r.dxfId = e.styleId), t.empty("colorFilter", r);
1320
- }
1321
- if (Jt(r)) if (r === "between") {
1322
- let r = n.param;
1323
- t.start("customFilters", { and: "1" }), Kt(e, t, {
1324
- operator: Ut.GreaterThanEqualTo,
1325
- param: r.from
1326
- }), Kt(e, t, {
1327
- operator: Ut.LessThanEqualTo,
1328
- param: r.to
1329
- }), t.end("customFilters");
1330
- } else if (r === R.BuiltInOperatorNames.Not) {
1331
- let r = n.param;
1332
- C(r?.operator) ? (t.start("customFilters"), Kt(e, t, n), t.end("customFilters")) : e.warn("Not rule with non-comparison criteria not supported in OOXML", r);
1333
- } else if (r === R.BuiltInOperatorNames.And || r === R.BuiltInOperatorNames.Or) {
1334
- let i = n.param, a = i.length;
1335
- if (a > 0) {
1336
- let n = {};
1337
- r === R.BuiltInOperatorNames.And && a > 1 && (n.and = "1"), t.start("customFilters", n);
1338
- for (let n = 0; n < a; n++) {
1339
- let r = i[n], a = r.operator === Ut.Not && C(r.param?.operator);
1340
- C(r.operator) || a ? Kt(e, t, r) : e.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", r);
1341
- }
1342
- t.end("customFilters");
1343
- }
1344
- } else C(r) && (t.start("customFilters"), Kt(e, t, n), t.end("customFilters"));
1345
- if (r === R.BuiltInOperatorNames.TimePeriod) {
1346
- let e = n.param, r = {};
1347
- e.type && (r.type = e.type), e.anchorDate !== void 0 && (r.val = "" + e.anchorDate), e.maxVal !== void 0 && (r.maxVal = "" + e.maxVal), t.empty("dynamicFilter", r);
1348
- }
1349
- if (r === R.BuiltInOperatorNames.Average) {
1350
- let e = n.param, r = {}, i = e.type;
1351
- i && (i === R.AverageType.Above ? r.type = "aboveAverage" : i === R.AverageType.Below && (r.type = "belowAverage")), e.stdDevs !== void 0 && (r.val = "" + e.stdDevs), t.empty("dynamicFilter", r);
1352
- }
1353
- if (r === R.BuiltInOperatorNames.InSet) {
1354
- let e = n.param;
1355
- if (e.dateGroups) {
1356
- let n = e.dateGroups, r = n.length;
1357
- t.start("dateGroupItem");
1358
- for (let e = 0; e < r; e++) {
1359
- let r = n[e], i = {};
1360
- r.day !== void 0 && (i.day = "" + r.day), r.hour !== void 0 && (i.hour = "" + r.hour), r.minute !== void 0 && (i.minute = "" + r.minute), r.second !== void 0 && (i.second = "" + r.second), r.year !== void 0 && (i.year = "" + r.year), r.month !== void 0 && (i.month = "" + r.month), i.dateTimeGrouping = r.group, t.empty("dateGroupItem", i);
1361
- }
1362
- t.end("dateGroupItem");
1363
- }
1364
- if (e.items) {
1365
- let n = e.items, r = n.length;
1366
- t.start("filters");
1367
- for (let e = 0; e < r; e++) {
1368
- let r = n[e];
1369
- t.empty("filter", { val: "" + r });
1370
- }
1371
- t.end("filters");
1372
- }
1373
- }
1374
- if (r === R.BuiltInOperatorNames.Icon) {
1375
- let e = n.param, r = {};
1376
- e.iconSet !== void 0 && (r.iconSet = e.iconSet), e.iconId !== void 0 && (r.iconId = "" + e.iconId), t.empty("iconFilter", r);
1377
- }
1378
- if (r === R.BuiltInOperatorNames.TopN) {
1379
- let e = n.param, r = {};
1380
- e.percent && (r.percent = "1"), e.top !== void 0 && (r.top = e.top ? "1" : "0"), e.limit !== void 0 && (r.val = "" + e.limit), e.filterVal !== void 0 && (r.filterVal = "" + e.filterVal), t.empty("top10", r);
1381
- }
1382
- } else e.warn("Unique conditions not supported in Table AutoFilters", n);
1383
- else e.warn("Expression conditions not supported in Table AutoFilters", n);
1384
- })(e, t, r), t.end("filterColumn")) : t.empty("filterColumn", a);
1385
- }, Jt = (e) => e === R.BuiltInOperatorNames.GreaterThan || e === R.BuiltInOperatorNames.GreaterThanEqualTo || e === R.BuiltInOperatorNames.LessThan || e === R.BuiltInOperatorNames.LessThanEqualTo || e === R.BuiltInOperatorNames.EqualTo || e === R.BuiltInOperatorNames.And || e === R.BuiltInOperatorNames.Or || e === R.BuiltInOperatorNames.Not || e === "between", Yt = {
1386
- names: /* @__PURE__ */ new Set(),
1387
- perFormula: [],
1388
- affects: () => !1
1389
- }, Xt = 1048576, Zt = (e, t, n) => {
1390
- if (!n) return [];
1391
- let r = 0;
1392
- for (let i = 0; i < n.length; i++) {
1393
- let a = n[i][0], o = t.getRange(a).getCoords();
1394
- if (r += (o.rowEnd - o.rowStart + 1) * (o.colEnd - o.colStart + 1), r > Xt) return e.warn(`Direct styles cover more than ${Xt} cells; not writing the styles from '${a}' on. A range that size belongs in a column or row style.`), n.slice(0, i);
1395
- }
1396
- return n;
1397
- };
1398
- function Qt(e, t) {
1399
- let n = t.type;
1400
- n === z.ColorStopType.AutoMin ? n = z.ColorStopType.Min : n === z.ColorStopType.AutoMax && (n = z.ColorStopType.Max), e.empty("cfvo", {
1401
- type: n,
1402
- val: t.value,
1403
- gte: t.exclusive ? "0" : void 0
1404
- });
1405
- }
1406
- function $t(e, t) {
1407
- let n = {
1408
- type: t.type,
1409
- gte: t.exclusive ? "0" : void 0
1410
- };
1411
- t.value === void 0 ? e.empty("x14:cfvo", n) : (e.start("x14:cfvo", n), e.start("xm:f"), e.text(t.value), e.end("xm:f"), e.end("x14:cfvo"));
1412
- }
1413
- var en = /* @__PURE__ */ new Set([
1414
- V.IconSet.Arrows3,
1415
- V.IconSet.ArrowsGray3,
1416
- V.IconSet.Flags3,
1417
- V.IconSet.Signs3,
1418
- V.IconSet.Symbols3,
1419
- V.IconSet.Symbols3_2,
1420
- V.IconSet.TrafficLights3,
1421
- V.IconSet.TrafficLights3_2,
1422
- V.IconSet.Arrows4,
1423
- V.IconSet.ArrowsGray4,
1424
- V.IconSet.Rating4,
1425
- V.IconSet.RedToBlack4,
1426
- V.IconSet.TrafficLights4,
1427
- V.IconSet.Arrows5,
1428
- V.IconSet.ArrowsGray5,
1429
- V.IconSet.Quarters5,
1430
- V.IconSet.Rating5
1431
- ]);
1432
- function tn(e) {
1433
- return (e.icon?.length ?? 0) > 0 || e.iconSet !== void 0 && !en.has(e.iconSet);
1434
- }
1435
- function nn(e, t, n, r, i, a, o, s, l) {
1436
- let u = r.scale;
1437
- r.ext && e.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1438
- let d = {
1439
- type: i.type,
1440
- dxfId: r.style && Object.keys(r.style).length > 0 ? s.add(r.style) : void 0,
1441
- priority: o,
1442
- stopIfTrue: Q(r.stopIfTrue),
1443
- aboveAverage: Q(i.aboveAverage),
1444
- equalAverage: Q(i.equalAverage),
1445
- stdDev: i.stdDev,
1446
- bottom: Q(i.bottom),
1447
- percent: Q(i.percent),
1448
- rank: i.rank,
1449
- operator: i.operator,
1450
- text: i.text,
1451
- timePeriod: i.timePeriod
1452
- }, f;
1453
- u?.type === z.ScaleType.DataBar && function(e) {
1454
- if (e.gradient || e.borderColor || e.negativeFillColor || e.negativeBorderColor || e.axisColor || e.axisPosition || e.direction) return !0;
1455
- let t = e.stops, n = t ? t.length : 0;
1456
- for (let e = 0; e < n; e++) {
1457
- let n = t[e].type;
1458
- if (n === z.ColorStopType.AutoMin || n === z.ColorStopType.AutoMax) return !0;
1459
- }
1460
- return !1;
1461
- }(u) && (f = x(I.uuidV4), l.push({
1462
- guid: f,
1463
- sqref: a,
1464
- priority: o,
1465
- scale: u
1466
- }));
1467
- let p = i.formulas, m = p ? p.length : 0;
1468
- if (m !== 0 || u) {
1469
- t.start("cfRule", d);
1470
- for (let e = 0; e < m; e++) t.start("formula"), t.text(p[e]), t.end("formula");
1471
- if (u?.type === z.ScaleType.ColorScale) {
1472
- let e = u.stops ?? [];
1473
- t.start("colorScale");
1474
- for (let n = 0; n < e.length; n++) Qt(t, e[n]);
1475
- for (let r = 0; r < e.length; r++) q(t, n, e[r].color, "color");
1476
- t.end("colorScale");
1477
- } else if (u?.type === z.ScaleType.DataBar) {
1478
- let e = u.stops ?? [];
1479
- t.start("dataBar", {
1480
- minLength: u.minLength,
1481
- maxLength: u.maxLength,
1482
- showValue: Q(u.showValue)
1483
- });
1484
- for (let n = 0; n < e.length; n++) Qt(t, e[n]);
1485
- u.color && q(t, n, u.color, "color"), t.end("dataBar");
1486
- } else if (u?.type === z.ScaleType.IconSet) {
1487
- let e = u.stops ?? [];
1488
- t.start("iconSet", {
1489
- iconSet: u.iconSet,
1490
- reverse: Q(u.reverse),
1491
- showValue: Q(u.showValue)
1492
- });
1493
- for (let n = 0; n < e.length; n++) Qt(t, e[n]);
1494
- t.end("iconSet");
1495
- }
1496
- f && (t.start("extLst"), t.start("ext", {
1497
- uri: c,
1498
- "xmlns:x14": T
1499
- }), t.start("x14:id"), t.text(f), t.end("x14:id"), t.end("ext"), t.end("extLst")), t.end("cfRule");
1500
- } else t.empty("cfRule", d);
1501
- }
1502
- function rn(e) {
1503
- let t = 2 ** 53 - 1, n = 2 ** 53 - 1, r = e.split(" ");
1504
- for (let e = 0; e < r.length; e++) {
1505
- if (!r[e]) continue;
1506
- let i = P.fastStringToRange(r[e]);
1507
- i.rowStart < t && (t = i.rowStart), i.colStart < n && (n = i.colStart);
1508
- }
1509
- return P.cellToString({
1510
- rowIndex: t,
1511
- colIndex: n
1512
- });
1513
- }
1514
- function an(e) {
1515
- if (typeof e == "string") return e.split(",").join(" ");
1516
- if (Array.isArray(e)) {
1517
- let t = [];
1518
- for (let n = 0; n < e.length; n++) {
1519
- let r = P.rangeToString(e[n]);
1520
- r && t.push(r);
1521
- }
1522
- return t.length > 0 ? t.join(" ") : null;
1523
- }
1524
- return P.rangeToString(e);
1525
- }
1526
- function Q(e) {
1527
- if (e !== void 0) return e ? "1" : "0";
1528
- }
1529
- function on(e) {
1530
- if (typeof e != "string") return !1;
1531
- let t = !1;
1532
- for (let n = 0; n < e.length; n++) {
1533
- let r = e[n];
1534
- if (r === "\"") t = !t;
1535
- else if (r === "!" && !t) return !0;
1536
- }
1537
- return !1;
1538
- }
1539
- function sn(e) {
1540
- let t = e.formulas, n = t ? t.length : 0;
1541
- for (let e = 0; e < n; e++) if (on(t[e])) return !0;
1542
- return !1;
1543
- }
1544
- function cn(e) {
1545
- let t = 2 ** 53 - 1, n = 2 ** 53 - 1, r = e.split(" ");
1546
- for (let e = 0; e < r.length; e++) {
1547
- if (!r[e]) continue;
1548
- let i = P.fastStringToRange(r[e]);
1549
- i.rowStart < t && (t = i.rowStart), i.colStart < n && (n = i.colStart);
1550
- }
1551
- return t === 2 ** 53 - 1 ? null : {
1552
- rowIndex: t,
1553
- colIndex: n
1554
- };
1555
- }
1556
- function ln(e, t, n) {
1557
- if (typeof e != "string" || !e || !t || !n) return e;
1558
- try {
1559
- let r = n.parse(e, t);
1560
- return r && ce.image(n.spell(r, !0), { at: t }) || e;
1561
- } catch {
1562
- return e;
1563
- }
1564
- }
1565
- function un(e, t, n) {
1566
- let r = e?.stops;
1567
- if (!r || !n) return e;
1568
- let i;
1569
- for (let e = 0; e < r.length; e++) {
1570
- let a = r[e]?.value;
1571
- if (typeof a != "string") continue;
1572
- let o = ln(a, t, n);
1573
- o !== a && (i ||= [...r], i[e] = {
1574
- ...r[e],
1575
- value: o
1576
- });
1577
- }
1578
- return i ? {
1579
- ...e,
1580
- stops: i
1581
- } : e;
1582
- }
1583
- function dn(e, t, n, r) {
1584
- if (!r?.xml) return;
1585
- let i = e.addPart("legacyDrawing", r);
1586
- t.empty(n, { "r:id": i.relId });
1587
- }
1588
- var fn = (e, t) => {
1589
- if (!t) return e;
1590
- let n = e?.xml ?? null, r = _(n ?? ""), i = [], a = t.comments;
1591
- for (let e = 0; e < a.length; e++) {
1592
- let { comment: t, row: n, col: o } = a[e], s = t.toJSON()?.box, c = s?.xml ? te(s.xml).notes[0] : void 0;
1593
- if (c) {
1594
- let e = A(c.xml);
1595
- e !== null && (r = Math.max(r, e)), i.push(O(c, n, o));
1596
- } else i.push(b(n, o, ++r));
1597
- }
1598
- let o = w(n, i);
1599
- return o ? o === n ? e : e ? {
1600
- ...e,
1601
- xml: o
1602
- } : { xml: o } : e;
1603
- }, pn = (e) => e.content?.type !== "control", mn = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp", hn = (e, t) => {
1604
- if (!e?.xml) return e;
1605
- let n = t.movables;
1606
- if (!n) return e;
1607
- let r = /* @__PURE__ */ new Map(), i = n.length;
1608
- for (let e = 0; e < i; e++) {
1609
- let t = n[e];
1610
- if (pn(t)) continue;
1611
- let i = t.content?.json?.shapeId;
1612
- typeof i == "number" && r.set(i, t);
1613
- }
1614
- if (r.size === 0) return e;
1615
- let a = e.xml.replace(/<v:shape\b[\s\S]*?<\/v:shape>/g, (e) => {
1616
- let t = /\bo:spid="_x0000_s(\d+)"/.exec(e) ?? /\bid="_x0000_s(\d+)"/.exec(e), n = t ? r.get(parseInt(t[1], 10)) : void 0;
1617
- if (!n) return e;
1618
- let i = n.anchor, a = [
1619
- i.tl.c,
1620
- i.tl.r,
1621
- i.br.c,
1622
- i.br.r
1623
- ];
1624
- return e.replace(/(<x:Anchor>)([\s\d,-]*)(<\/x:Anchor>)/, (e, t, n, r) => {
1625
- let i = n.split(",").map((e) => e.trim());
1626
- if (i.length !== 8) return e;
1627
- let o = i.slice();
1628
- for (let e = 0; e < 4; e++) o[2 * e] = String(a[e] ?? 0);
1629
- return o.join(",") === i.join(",") ? e : `${t}${o.join(", ")}${r}`;
1630
- });
1631
- });
1632
- return a === e.xml ? e : {
1633
- ...e,
1634
- xml: a
1635
- };
1636
- }, gn = (e, t, n) => {
1637
- e.start(t), e.start("xdr:col"), e.text(n.c ?? 0), e.end("xdr:col"), e.start("xdr:colOff"), e.text(X(n.x)), e.end("xdr:colOff"), e.start("xdr:row"), e.text(n.r ?? 0), e.end("xdr:row"), e.start("xdr:rowOff"), e.text(X(n.y)), e.end("xdr:rowOff"), e.end(t);
1638
- }, _n = {
1639
- r: void 0,
1640
- s: void 0,
1641
- t: void 0,
1642
- cm: void 0,
1643
- vm: void 0
1644
- }, vn = {
1645
- r: void 0,
1646
- s: void 0,
1647
- customFormat: void 0,
1648
- hidden: void 0,
1649
- ht: void 0,
1650
- customHeight: void 0,
1651
- "x14ac:dyDescent": "0.25",
1652
- outlineLevel: void 0,
1653
- collapsed: void 0
1654
- }, yn = {
1655
- t: void 0,
1656
- aca: void 0,
1657
- ref: void 0,
1658
- ca: void 0,
1659
- si: void 0
1660
- }, bn = {
1661
- t: "shared",
1662
- aca: void 0,
1663
- ref: void 0,
1664
- ca: void 0,
1665
- si: void 0
1666
- }, xn = {
1667
- t: "array",
1668
- aca: void 0,
1669
- ref: void 0,
1670
- ca: void 0,
1671
- si: void 0
1672
- };
1673
- function Sn(e, t, n, r) {
1674
- n && (t.start(r), t.empty("latin", { typeface: n }), t.empty("ea", { typeface: "" }), t.empty("cs", { typeface: "" }), t.end(r));
1675
- }
1676
- var Cn = (e) => e.toISOString().split(".")[0] + "Z", wn = (e, t, n) => {
1677
- switch (t) {
1678
- case "creator":
1679
- e.start("dc:creator"), e.text(n), e.end("dc:creator");
1680
- break;
1681
- case "lastModifiedBy":
1682
- e.start("cp:lastModifiedBy"), e.text(n), e.end("cp:lastModifiedBy");
1683
- break;
1684
- case "created":
1685
- e.start("dcterms:created", { "xsi:type": "dcterms:W3CDTF" }), e.text(n), e.end("dcterms:created");
1686
- break;
1687
- case "modified": e.start("dcterms:modified", { "xsi:type": "dcterms:W3CDTF" }), e.text(n), e.end("dcterms:modified");
1688
- }
1689
- }, $ = (e, t, n, r) => {
1690
- t.start(n), t.text(r), t.end(n);
1691
- }, Tn = (e, t, n) => {
1692
- let r = n.getSheets().getItems({ visibility: ue.Visibility.Hidden }).map((e) => e.getName()), i = n.getNames().getItems({ type: "formula" }).filter((e) => !!e.getRanges?.()).map((e) => e.getName());
1693
- t.start("HeadingPairs"), t.start("vt:vector", {
1694
- size: i.length > 0 ? "4" : "2",
1695
- baseType: "variant"
1696
- }), t.start("vt:variant"), t.start("vt:lpstr"), t.text("Worksheets"), t.end("vt:lpstr"), t.end("vt:variant"), t.start("vt:variant"), t.start("vt:i4"), t.text("" + r.length), t.end("vt:i4"), t.end("vt:variant"), i.length > 0 && (t.start("vt:variant"), t.start("vt:lpstr"), t.text("Named Ranges"), t.end("vt:lpstr"), t.end("vt:variant"), t.start("vt:variant"), t.start("vt:i4"), t.text("" + i.length), t.end("vt:i4"), t.end("vt:variant")), t.end("vt:vector"), t.end("HeadingPairs"), t.start("TitlesOfParts"), t.start("vt:vector", {
1697
- size: "" + (r.length + i.length),
1698
- baseType: "lpstr"
1699
- });
1700
- for (let e of r) t.start("vt:lpstr"), t.text(e), t.end("vt:lpstr");
1701
- for (let e of i) t.start("vt:lpstr"), t.text(e), t.end("vt:lpstr");
1702
- t.end("vt:vector"), t.end("TitlesOfParts");
1703
- }, En = {
1704
- minSupportedVersion: "120000",
1705
- copy: "1",
1706
- pasteAll: "1",
1707
- pasteValues: "1",
1708
- merge: "1",
1709
- splitFirst: "1",
1710
- rowColShift: "1",
1711
- clearFormats: "1",
1712
- clearComments: "1",
1713
- assign: "1",
1714
- coerce: "1"
1715
- }, Dn = (e, t, n = I.EmptyArray) => {
1716
- if (!t) return { ...n };
1717
- let { text: r, runs: i, color: a, size: o, kern: s, weight: c, style: l, b: u, i: d, spc: f, baseline: p, ...m } = t, h = {
1718
- ...n,
1719
- ...m
1720
- };
1721
- return o !== void 0 && (h.sz = "" + kt(o)), u !== void 0 && (h.b = u ? "1" : "0"), c !== void 0 && (h.b = c > 500 ? "1" : "0"), d !== void 0 && (h.i = d ? "1" : "0"), l !== void 0 && (h.i = l === "italic" ? "1" : "0"), s !== void 0 && (h.kern = "" + kt(s)), f !== void 0 && (h.spc = "" + kt(f)), p !== void 0 && (h.baseline = "" + kt(p)), h;
1722
- }, On = (e, t, n) => {
1723
- if (!n) return;
1724
- let r = e.getXMLWriter();
1725
- r.start("txBody"), r.pushDefaultNamespace("a"), An(e, t, {
1726
- vertOverflow: "clip",
1727
- horzOverflow: "clip",
1728
- rtlCol: "0",
1729
- anchor: "ctr"
1730
- }), r.empty("lstStyle"), ((e, t, n) => {
1731
- if (!n) return;
1732
- let r = e.getXMLWriter();
1733
- r.pushDefaultNamespace("a"), typeof n == "string" && (n = { runs: [{ text: n }] }), r.start("p"), r.empty("pPr", { algn: "ctr" });
1734
- let i = Dn(0, n, {
1735
- ...jn,
1736
- size: t.getDefaultFontSize()
1737
- }), a = n?.runs, o = a ? a.length : 0;
1738
- if (o > 0) for (let e = 0; e < o; e++) {
1739
- let n = a[e];
1740
- r.start("r", {});
1741
- let i = Dn(0, n, jn), o = n.color;
1742
- o ? (r.start("rPr", i), J(0, r, o, t), r.end("rPr")) : r.empty("rPr", i), r.start("t"), r.text(n?.text ?? ""), r.end("t"), r.end("r");
1743
- }
1744
- else r.empty("endParaRPr", i);
1745
- r.end("p"), r.popDefaultNamespace();
1746
- })(e, t, n), r.popDefaultNamespace(), r.end("txBody");
1747
- }, kn = (e, t, n) => {
1748
- if (!n) return;
1749
- let r = e.getXMLWriter(), i = Dn(0, n);
1750
- r.empty("defRPr", i);
1751
- }, An = (e, t, n) => {
1752
- if (!n) return;
1753
- let r = e.getXMLWriter(), { spAutoFit: i, ...a } = n;
1754
- i ? (r.start("bodyPr", a), r.empty("spAutoFit"), r.end("bodyPr")) : r.empty("bodyPr", a);
1755
- }, jn = Object.freeze({ lang: "en-US" }), Mn = (e, t) => {
1756
- if (t.length !== 0) {
1757
- e.start("a:extLst");
1758
- for (let n of t) {
1759
- let t = {}, r = n[0];
1760
- r && (t.uri = r), e.start("a:ext", t), e.empty(n[1], n[2]), e.end("a:ext");
1761
- }
1762
- e.end("a:extLst");
1763
- }
1764
- }, Nn = async (e, t, n, r, i) => {
1765
- let a = e.getSharedStates(), o = r.getContent().getResource(), s = await o.getExternalURI(), c;
1766
- if (s) c = e.addExternal(Et, s);
1767
- else if (c = n.get(o), !c) {
1768
- let t = a.get(Dt);
1769
- t || (t = /* @__PURE__ */ new Map(), a.set(Dt, t));
1770
- let r = t.get(o);
1771
- if (!r) {
1772
- let e = await o.toBuffer();
1773
- r = {
1774
- bytes: new Uint8Array(e),
1775
- type: await o.getType() ?? Ot,
1776
- index: t.size + 1
1777
- }, t.set(o, r);
1778
- }
1779
- c = e.addBinary(r.bytes, r.type.mime, Et, `../media/image${r.index}.${r.type.ext}`, !0), n.set(o, c);
1780
- }
1781
- let l = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
1782
- s ? l["r:link"] = c.relId : l["r:embed"] = c.relId;
1783
- let u = [];
1784
- s || u.push([
1785
- "{28A0092B-C50C-407E-A947-70E740481C1C}",
1786
- "a14:useLocalDpi",
1787
- {
1788
- "xmlns:a14": "http://schemas.microsoft.com/office/drawing/2010/main",
1789
- val: "0"
1790
- }
1791
- ]);
1792
- let d = e.getXMLWriter();
1793
- d.start("pic"), d.start("nvPicPr"), Hn(e, d, r, i, t), Wn(e, d, r, i), d.end("nvPicPr"), d.start("blipFill"), d.start("a:blip", l), Mn(d, u), d.end("a:blip"), d.start("a:stretch"), d.empty("a:fillRect"), d.end("a:stretch"), d.end("blipFill"), Bn(e, t, n, r, i), d.end("pic");
1794
- }, Pn = async (e, t, n, r, i, a) => {
1795
- let o = i.content?.json, s = o?.xml, c = o?.part;
1796
- if (!s || !c) return zn(e, t, n, r, i);
1797
- let l = await Ze(c, e, "../charts/chart{n}.xml");
1798
- if (!l?.relId) return zn(e, t, n, r, i);
1799
- let u = l.relId === c.id ? s : s.replace(`r:id="${c.id}"`, `r:id="${l.relId}"`);
1800
- a !== void 0 && typeof i.content?.json?.sourceId == "number" && (u = u.replace(`cNvPr id="${i.content.json.sourceId}"`, `cNvPr id="${a}"`)), e.getXMLWriter().raw(u);
1801
- }, Fn = async (e, t, n, r, i) => zn(e, t, n, r, i), In = async (e, t, n, r, i) => zn(e, t, n, r, i), Ln = async (e, t, n, r, i) => zn(e, t, n, r, i), Rn = async (e, t, n, r, i, a) => {
1802
- let o = i.content?.json, s = o?.xml;
1803
- if (!s) return zn(e, t, n, r, i);
1804
- let c = a !== void 0 && typeof o?.sourceId == "number" ? s.replace(`cNvPr id="${o.sourceId}"`, `cNvPr id="${a}"`) : s;
1805
- e.getXMLWriter().raw(c);
1806
- }, zn = async (e, t, n, r, i) => {
1807
- (async (e, t, n, r, i) => {
1808
- let a = e.getXMLWriter(), o = {}, s = i.content?.json, c = s?.type ?? "sp", l = t.getStyles();
1809
- c === "cxnSp" ? (o.macro = "", a.start("cxnSp", o), a.start("nvCxnSpPr"), Hn(e, a, r, i, t), Un(e, a, r, i, t), a.start("cNvCxnSpPr"), a.empty("a:stCnx", {
1810
- id: "0",
1811
- idx: "0"
1812
- }), a.end("cNvCxnSpPr"), a.end("nvCxnSpPr"), Bn(e, t, n, r, i), Vn(e, t, n, r, i), On(e, l, s?.text), a.end("cxnSp")) : c === "grpSp" || (o.macro = "", o.textlink = "", a.start("sp", o), a.start("nvSpPr"), Hn(e, a, r, i, t), Un(e, a, r, i, t), a.end("nvSpPr"), Bn(e, t, n, r, i), Vn(e, t, n, r, i), On(e, l, s?.text), a.end("sp"));
1813
- })(e, t, n, r, {
1814
- ...i,
1815
- content: {
1816
- type: "shape",
1817
- json: {
1818
- fill: "bg1",
1819
- stroke: {
1820
- width: 2,
1821
- fill: "red"
1822
- },
1823
- text: { runs: [{
1824
- text: "Unsupported Type: " + (i.content?.type ?? "unknown"),
1825
- color: "tx1"
1826
- }] }
1827
- }
1828
- }
1829
- });
1830
- }, Bn = (e, t, n, r, i) => {
1831
- let a = e.getXMLWriter(), o = i.content?.json, s = o?.geometry ?? "rect", c = t.getStyles();
1832
- a.start("spPr"), a.pushDefaultNamespace("a"), Gn(a, r, i), a.start("prstGeom", { prst: s }), a.empty("avLst"), a.end("prstGeom"), St(e, c, o), a.popDefaultNamespace(), a.end("spPr");
1833
- }, Vn = (e, t, n, r, i) => {
1834
- let a = e.getXMLWriter();
1835
- a.start("style"), a.pushDefaultNamespace("a"), a.start("lnRef", { idx: "1" }), a.start("schemeClr", { val: "accent1" }), a.empty("shade", { val: "15000" }), a.end("schemeClr"), a.end("lnRef"), a.start("fillRef", { idx: "1" }), a.empty("schemeClr", { val: "accent1" }), a.end("fillRef"), a.start("effectRef", { idx: "0" }), a.empty("schemeClr", { val: "accent1" }), a.end("effectRef"), a.start("fontRef", { idx: "minor" }), a.empty("schemeClr", { val: "lt1" }), a.end("fontRef"), a.popDefaultNamespace(), a.end("style");
1836
- }, Hn = (e, t, n, r, i) => {
1837
- let a = e.getSharedStates(), o = a.get("uniqueIdCounter");
1838
- o || (o = /* @__PURE__ */ new Map(), a.set("uniqueIdCounter", o));
1839
- let s = o.get(i) ?? 1;
1840
- s++, o.set(i, s);
1841
- let c = {
1842
- id: "" + s,
1843
- name: r.name
1844
- };
1845
- r.description && (c.descr = r.description), r.hidden && (c.hidden = "1");
1846
- let l = [];
1847
- l.push([
1848
- "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}",
1849
- "a16:creationId",
1850
- {
1851
- "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
1852
- id: `{${I.uuidV4().toUpperCase()}}`
1853
- }
1854
- ]), t.start("cNvPr", c), Mn(t, l), t.end("cNvPr");
1855
- }, Un = (e, t, n, r, i) => {
1856
- t.empty("cNvSpPr");
1857
- }, Wn = (e, t, n, r) => {
1858
- let i = {};
1859
- if (r.lockAspect && (i.noChangeAspect = "1"), r.locks) for (let e of Object.keys(r.locks)) !0 === r.locks[e] && (i[e] = "1");
1860
- t.start("cNvPicPr", {}), t.empty("a:picLocks", i), t.end("cNvPicPr");
1861
- }, Gn = (e, t, n) => {
1862
- let r = t.getBounds(), i = {}, a = n.rotation;
1863
- a !== void 0 && a !== 0 && (i.rot = "" + Z(a)), e.start("xfrm", i), e.start("off", {
1864
- x: X(r.x),
1865
- y: X(r.y)
1866
- }), e.end("off"), e.start("ext", {
1867
- cx: X(r.width),
1868
- cy: X(r.height)
1869
- }), e.end("ext"), e.end("xfrm");
1870
- }, Kn = (e, t, n) => {
1871
- e.start(t), e.start("col"), e.text(n.c ?? 0), e.end("col"), e.start("colOff"), e.text(X(n.x)), e.end("colOff"), e.start("row"), e.text(n.r ?? 0), e.end("row"), e.start("rowOff"), e.text(X(n.y)), e.end("rowOff"), e.end(t);
1872
- }, qn = async (e, t, n) => {
1873
- let r = await n.getExternalURI();
1874
- if (r) return void e.addExternal(Et, r);
1875
- let i = e.getSharedStates(), a = i.get(Dt);
1876
- a || (a = /* @__PURE__ */ new Map(), i.set(Dt, a));
1877
- let o = a.get(n);
1878
- if (!o) {
1879
- let e = await n.toBuffer();
1880
- o = {
1881
- bytes: new Uint8Array(e),
1882
- type: await n.getType() ?? Ot,
1883
- index: a.size + 1
1884
- }, a.set(n, o);
1885
- }
1886
- let s = e.addBinary(o.bytes, o.type.mime, Et, `../media/image${o.index}.${o.type.ext}`, !0, t);
1887
- s.relId !== t && e.log(`Legacy drawing image '${t}' was written as '${s.relId}'; the markup will not find it.`);
1888
- };
1889
- function Jn(e, t, r, i, a, o, s, c) {
1890
- let l = {
1891
- ref: t,
1892
- dT: (a ?? /* @__PURE__ */ new Date()).toISOString().replace(/\.\d{3}Z$/, "Z"),
1893
- personId: i ? Yn(i) : void 0,
1894
- id: Yn(r),
1895
- parentId: s ? Yn(s) : void 0,
1896
- done: c ? "1" : void 0
1897
- };
1898
- e.start("threadedComment", l), e.start("text", ie.test(o) || /[\n\r]/.test(o) ? n : void 0), e.text(o), e.end("text"), e.end("threadedComment");
1899
- }
1900
- function Yn(e) {
1901
- return `{${e.replace(/^\{|\}$/g, "").toUpperCase()}}`;
1902
- }
1903
- var Xn = 0, Zn = (e, t, n, r) => {
1904
- let i = r.columns, a = i ? i.length : 0;
1905
- if (a !== 0) {
1906
- t.start("tableColumns", { count: a });
1907
- for (let o = 0; o < a; o++) {
1908
- let a = i[o];
1909
- typeof a == "string" && (a = { name: a });
1910
- let s = {};
1911
- s.id = o + 1, s.name = a.name ?? `Column${o + 1}`;
1912
- let c = null, l = a.totalsRowFormula;
1913
- if (typeof l == "number") {
1914
- let e = er.get(l);
1915
- e ? s.totalsRowFunction = e : c = `SUBTOTAL(${l},${r.name?.trim()}[${s.name}])`;
1916
- } else l && (c = Qn(e, n, o, l.startsWith("=") ? l.substring(1) : l));
1917
- c && (s.totalsRowFunction = "custom"), a.totalsRowLabel && (s.totalsRowLabel = a.totalsRowLabel);
1918
- let u = a.calculatedColumnFormula ? Qn(e, n, o, a.calculatedColumnFormula) : null;
1919
- (c || u) && (t.start("tableColumn", s), u && (t.start("calculatedColumnFormula"), t.text(u), t.end("calculatedColumnFormula"))), c && (t.start("totalsRowFormula"), t.text(c), t.end("totalsRowFormula")), c || u ? t.end("tableColumn") : t.empty("tableColumn", s);
1920
- }
1921
- t.end("tableColumns");
1922
- }
1923
- }, Qn = (e, t, n, r) => {
1924
- let i = e.getSharedStates().get(o);
1925
- if (!i) return r;
1926
- try {
1927
- let e = t.getDataRange().getCoords(), a = {
1928
- rowIndex: e.rowStart,
1929
- colIndex: e.colStart + n
1930
- }, o = i.parse(r, a);
1931
- return o && ce.image(i.spell(o, !1, t.getName()), { at: a }) || r;
1932
- } catch {
1933
- return r;
1934
- }
1935
- }, $n = (e, t, n, r) => {
1936
- let i = {
1937
- name: n.getStyle().getName(),
1938
- showFirstColumn: n.isShowHighlightFirstColumn() ? "1" : "0",
1939
- showLastColumn: n.isShowHighlightLastColumn() ? "1" : "0",
1940
- showRowStripes: n.isShowBandedRows() ? "1" : "0",
1941
- showColumnStripes: n.isShowBandedColumns() ? "1" : "0"
1942
- };
1943
- t.empty("tableStyleInfo", i);
1944
- }, er = /* @__PURE__ */ new Map([
1945
- [101, "average"],
1946
- [102, "countNums"],
1947
- [103, "count"],
1948
- [104, "max"],
1949
- [105, "min"],
1950
- [107, "stdDev"],
1951
- [109, "sum"],
1952
- [110, "var"]
1953
- ]), tr = {
1954
- rowIndex: 0,
1955
- colIndex: 0
1956
- };
1957
- function nr(e, t, n, r) {
1958
- if (r == null) return;
1959
- tr.rowIndex = t, tr.colIndex = n;
1960
- let i = P.cellToString(tr), a, o;
1961
- switch (typeof r) {
1962
- case "number":
1963
- o = "" + r;
1964
- break;
1965
- case "boolean":
1966
- a = "b", o = r ? "1" : "0";
1967
- break;
1968
- case "string":
1969
- a = "str", o = r;
1970
- break;
1971
- default: {
1972
- let e = r;
1973
- if (e.t !== "e") return;
1974
- a = "e", o = se.getBuiltInByCode(e.v)?.getLabel() ?? se.BuiltIn.Value.getLabel();
1975
- }
1976
- }
1977
- e.start("cell", a ? {
1978
- r: i,
1979
- t: a
1980
- } : { r: i }), e.start("v"), e.text(o), e.end("v"), e.end("cell");
1981
- }
1982
- var rr = (e, t, n, r) => {
1983
- t.start("mc:AlternateContent", { "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006" }), t.start("mc:Choice", {
1984
- Requires: "c14",
1985
- "xmlns:c14": "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
1986
- }), t.empty("c14:style", { val: "102" }), t.end("mc:Choice"), t.start("mc:Fallback"), t.empty("c:style", { val: "2" }), t.end("mc:Fallback"), t.end("mc:AlternateContent");
1987
- }, ir = (e, t, n, r, i) => {
1988
- t.start("chart"), ((e, t, n, r, i) => {
1989
- t.start("title"), t.empty("overlay", { val: "0" }), St(e, n, i, "spPr", !0), t.end("title"), t.empty("autoTitleDeleted", { val: "0" });
1990
- })(e, t, n, 0, i), ((e, t, n, r, i) => {
1991
- t.start("plotArea"), t.empty("layout"), St(e, n, i, "spPr", !0), t.end("plotArea");
1992
- })(e, t, n, 0, i), t.empty("plotVisOnly", { val: "1" }), t.empty("dispBlanksAs", { val: "gap" }), t.empty("showDLblsOverMax", { val: "0" }), t.end("chart");
1993
- }, ar = (e, t, n, r) => {
1994
- t.start("printSettings"), t.empty("headerFooter"), t.empty("pageMargins", {
1995
- b: "0.75",
1996
- l: "0.7",
1997
- r: "0.7",
1998
- t: "0.75",
1999
- header: "0.3",
2000
- footer: "0.3"
2001
- }), t.empty("pageSetup"), t.end("printSettings");
2002
- }, or = (e, t, n, r, i, a = "0") => {
2003
- let o = i?.color, s = { idx: i?.idx ?? a };
2004
- o === void 0 ? t.empty(r, s) : (t.start(r, s), o === "auto" ? t.empty("styleClr", { val: "auto" }) : (t.pushDefaultNamespace("a"), G(t, n.getTheme(), o), t.popDefaultNamespace()), t.end(r));
2005
- }, sr = (e, t, n, r) => {
2006
- let i = n.length;
2007
- for (let a = 0; a < i; a++) {
2008
- let i = n[a];
2009
- i.empty ? t.empty(i.type, i.mods) : (t.start(i.type, i.mods), or(0, t, r, "lnRef", i.lineRef, "0"), or(0, t, r, "fillRef", i.fillRef, "0"), or(0, t, r, "effectRef", i.effectRef, "0"), or(0, t, r, "fontRef", i.fontRef, "minor"), St(e, r, i, "spPr"), kn(e, 0, i.defRPr), An(e, r, i.bodyPr), t.end(i.type));
2010
- }
2011
- }, cr = Object.freeze([
2012
- {
2013
- type: "axisTitle",
2014
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2015
- defRPr: {
2016
- size: 10,
2017
- kern: 12
2018
- }
2019
- },
2020
- {
2021
- type: "categoryAxis",
2022
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2023
- stroke: {
2024
- width: .75,
2025
- cap: "flat",
2026
- cmpd: "sng",
2027
- algn: "ctr",
2028
- round: !0,
2029
- fill: "tx1 lumMod 15 lumOff 85"
2030
- },
2031
- defRPr: {
2032
- size: 9,
2033
- kern: 12
2034
- }
2035
- },
2036
- {
2037
- type: "chartArea",
2038
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2039
- fontRef: { color: "tx1" },
2040
- fill: {
2041
- type: "solid",
2042
- color: "bg1"
2043
- },
2044
- stroke: {
2045
- width: .75,
2046
- cap: "flat",
2047
- cmpd: "sng",
2048
- algn: "ctr",
2049
- round: !0,
2050
- fill: "tx1 lumMod 15 lumOff 85"
2051
- },
2052
- defRPr: {
2053
- size: 10,
2054
- kern: 12
2055
- }
2056
- },
2057
- {
2058
- type: "dataLabel",
2059
- fontRef: { color: "tx1 lumMod 75 lumOff 25" },
2060
- defRPr: {
2061
- size: 9,
2062
- kern: 12
2063
- }
2064
- },
2065
- {
2066
- type: "dataLabelCallout",
2067
- fontRef: { color: "dk1 lumMod 65 lumOff 35" },
2068
- fill: {
2069
- type: "solid",
2070
- color: "lt1"
2071
- },
2072
- stroke: { fill: "dk1 lumMod 25 lumOff 75" },
2073
- defRPr: {
2074
- size: 9,
2075
- kern: 12
2076
- },
2077
- bodyPr: {
2078
- rot: "0",
2079
- spcFirstLastPara: "1",
2080
- vertOverflow: "clip",
2081
- horzOverflow: "clip",
2082
- vert: "horz",
2083
- wrap: "square",
2084
- lIns: "36576",
2085
- tIns: "18288",
2086
- rIns: "36576",
2087
- bIns: "18288",
2088
- anchor: "ctr",
2089
- anchorCtr: "1",
2090
- spAutoFit: "true"
2091
- }
2092
- },
2093
- {
2094
- type: "dataPoint",
2095
- fillRef: {
2096
- idx: "1",
2097
- color: "auto"
2098
- },
2099
- fontRef: { color: "tx1" }
2100
- },
2101
- {
2102
- type: "dataPoint3D",
2103
- fillRef: {
2104
- idx: "1",
2105
- color: "auto"
2106
- },
2107
- fontRef: { color: "tx1" }
2108
- },
2109
- {
2110
- type: "dataPointLine",
2111
- lineRef: { color: "auto" },
2112
- fillRef: { idx: "1" },
2113
- fontRef: { color: "tx1" },
2114
- stroke: {
2115
- width: 2.25,
2116
- cap: "rnd",
2117
- fill: "phClr",
2118
- round: !0
2119
- }
2120
- },
2121
- {
2122
- type: "dataPointMarker",
2123
- lineRef: { color: "auto" },
2124
- fillRef: {
2125
- idx: "1",
2126
- color: "auto"
2127
- },
2128
- fontRef: { color: "tx1" },
2129
- stroke: {
2130
- width: .75,
2131
- fill: "phClr"
2132
- }
2133
- },
2134
- {
2135
- type: "dataPointMarkerLayout",
2136
- mods: {
2137
- symbol: "circle",
2138
- size: "5"
2139
- },
2140
- empty: !0
2141
- },
2142
- {
2143
- type: "dataPointWireframe",
2144
- lineRef: { color: "auto" },
2145
- fillRef: { idx: "1" },
2146
- fontRef: { color: "tx1" },
2147
- stroke: {
2148
- width: .75,
2149
- cap: "rnd",
2150
- fill: "phClr",
2151
- round: !0
2152
- }
2153
- },
2154
- {
2155
- type: "dataTable",
2156
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2157
- fill: { type: "none" },
2158
- stroke: {
2159
- width: .75,
2160
- cap: "flat",
2161
- cmpd: "sng",
2162
- algn: "ctr",
2163
- round: !0,
2164
- fill: "tx1 lumMod 15 lumOff 85"
2165
- },
2166
- defRPr: {
2167
- size: 9,
2168
- kern: 12
2169
- }
2170
- },
2171
- {
2172
- type: "downBar",
2173
- fontRef: { color: "tx1" },
2174
- fill: {
2175
- type: "solid",
2176
- color: "dk1 lumMod 75 lumOff 25"
2177
- },
2178
- stroke: {
2179
- width: .75,
2180
- cap: "flat",
2181
- cmpd: "sng",
2182
- algn: "ctr",
2183
- round: !0,
2184
- fill: "tx1 lumMod 65 lumOff 35"
2185
- }
2186
- },
2187
- {
2188
- type: "dropLine",
2189
- fontRef: { color: "tx1" },
2190
- stroke: {
2191
- width: .75,
2192
- cap: "flat",
2193
- cmpd: "sng",
2194
- algn: "ctr",
2195
- round: !0,
2196
- fill: "tx1 lumMod 35 lumOff 65"
2197
- }
2198
- },
2199
- {
2200
- type: "errorBar",
2201
- fontRef: { color: "tx1" },
2202
- stroke: {
2203
- width: .75,
2204
- cap: "flat",
2205
- cmpd: "sng",
2206
- algn: "ctr",
2207
- round: !0,
2208
- fill: "tx1 lumMod 65 lumOff 35"
2209
- }
2210
- },
2211
- {
2212
- type: "floor",
2213
- fontRef: { color: "tx1" },
2214
- fill: { type: "none" },
2215
- stroke: {}
2216
- },
2217
- {
2218
- type: "gridlineMajor",
2219
- fontRef: { color: "tx1" },
2220
- stroke: {
2221
- width: .75,
2222
- cap: "flat",
2223
- cmpd: "sng",
2224
- algn: "ctr",
2225
- round: !0,
2226
- fill: "tx1 lumMod 15 lumOff 85"
2227
- }
2228
- },
2229
- {
2230
- type: "gridlineMinor",
2231
- fontRef: { color: "tx1" },
2232
- stroke: {
2233
- width: .75,
2234
- cap: "flat",
2235
- cmpd: "sng",
2236
- algn: "ctr",
2237
- round: !0,
2238
- fill: "tx1 lumMod 5 lumOff 95"
2239
- }
2240
- },
2241
- {
2242
- type: "hiLoLine",
2243
- fontRef: { color: "tx1" },
2244
- stroke: {
2245
- width: .75,
2246
- cap: "flat",
2247
- cmpd: "sng",
2248
- algn: "ctr",
2249
- round: !0,
2250
- fill: "tx1 lumMod 50 lumOff 50"
2251
- }
2252
- },
2253
- {
2254
- type: "leaderLine",
2255
- fontRef: { color: "tx1" },
2256
- stroke: {
2257
- width: .75,
2258
- cap: "flat",
2259
- cmpd: "sng",
2260
- algn: "ctr",
2261
- round: !0,
2262
- fill: "tx1 lumMod 35 lumOff 65"
2263
- }
2264
- },
2265
- {
2266
- type: "legend",
2267
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2268
- defRPr: {
2269
- size: 9,
2270
- kern: 12
2271
- }
2272
- },
2273
- {
2274
- type: "plotArea",
2275
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2276
- fontRef: { color: "tx1" }
2277
- },
2278
- {
2279
- type: "plotArea3D",
2280
- mods: { mods: "allowNoFillOverride allowNoLineOverride" },
2281
- fontRef: { color: "tx1" }
2282
- },
2283
- {
2284
- type: "seriesAxis",
2285
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2286
- defRPr: {
2287
- size: 9,
2288
- kern: 12
2289
- }
2290
- },
2291
- {
2292
- type: "seriesLine",
2293
- fontRef: { color: "tx1" },
2294
- stroke: {
2295
- width: .75,
2296
- cap: "flat",
2297
- cmpd: "sng",
2298
- algn: "ctr",
2299
- round: !0,
2300
- fill: "tx1 lumMod 35 lumOff 65"
2301
- }
2302
- },
2303
- {
2304
- type: "title",
2305
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2306
- defRPr: {
2307
- size: 14,
2308
- b: !1,
2309
- kern: 12,
2310
- spc: 0,
2311
- baseline: 0
2312
- }
2313
- },
2314
- {
2315
- type: "trendline",
2316
- lineRef: { color: "auto" },
2317
- fontRef: { color: "tx1" },
2318
- stroke: {
2319
- width: 1.5,
2320
- cap: "rnd",
2321
- fill: "phClr",
2322
- prstDash: "sysDot"
2323
- }
2324
- },
2325
- {
2326
- type: "trendlineLabel",
2327
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2328
- defRPr: {
2329
- size: 9,
2330
- kern: 12
2331
- }
2332
- },
2333
- {
2334
- type: "upBar",
2335
- fontRef: { color: "tx1" },
2336
- fill: {
2337
- type: "solid",
2338
- color: "lt1"
2339
- },
2340
- stroke: {
2341
- width: .75,
2342
- cap: "flat",
2343
- cmpd: "sng",
2344
- algn: "ctr",
2345
- round: !0,
2346
- fill: "tx1 lumMod 65 lumOff 35"
2347
- }
2348
- },
2349
- {
2350
- type: "valueAxis",
2351
- fontRef: { color: "tx1 lumMod 65 lumOff 35" },
2352
- defRPr: {
2353
- size: 9,
2354
- kern: 12
2355
- }
2356
- },
2357
- {
2358
- type: "wall",
2359
- fontRef: { color: "tx1" },
2360
- fill: { type: "none" },
2361
- stroke: {}
2362
- }
2363
- ]), lr = (e, t, n) => {
2364
- let r = n.length;
2365
- for (let e = 0; e < r; e++) {
2366
- let r = n[e], i = {}, a = r[0], o = r[1];
2367
- a || o ? (t.start("variation", i), a && t.empty("a:lumMod", { val: a }), o && t.empty("a:lumOff", { val: o }), t.end("variation")) : t.empty("variation", i);
2368
- }
2369
- }, ur = Object.freeze([
2370
- [0, 0],
2371
- [6e4, 0],
2372
- [8e4, 2e4],
2373
- [8e4, 0],
2374
- [6e4, 4e4],
2375
- [5e4, 0],
2376
- [7e4, 3e4],
2377
- [7e4, 0],
2378
- [5e4, 5e4]
2379
- ]), dr = [
2380
- new class extends U {
2381
- constructor() {
2382
- super({
2383
- kind: "workbook",
2384
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",
2385
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",
2386
- path: "/xl/workbook.xml"
2387
- });
2388
- }
2389
- async emit(e, t) {
2390
- let n = t.getXMLWriter();
2391
- n.decl(), n.start("workbook", {
2392
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2393
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2394
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2395
- "mc:Ignorable": "x15 xr xr6 xr10 xr2",
2396
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main",
2397
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
2398
- "xmlns:xr6": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision6",
2399
- "xmlns:xr10": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision10",
2400
- "xmlns:xr2": "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"
2401
- });
2402
- let r = t.getSharedStates().get(he), i = await e.toJSON({
2403
- ignoreData: !0,
2404
- resources: (e, t) => (r?.set(t, e), null),
2405
- includeHeaderStyles: !0,
2406
- splitDirectBorders: !0
2407
- });
2408
- t.getSharedStates().set(o, l(i.names, function(e) {
2409
- let t = [], n = e.sheets ?? [];
2410
- for (let e = 0; e < n.length; e++) {
2411
- let r = n[e]?.sheet?.tables;
2412
- if (r) for (let e = 0; e < r.length; e++) {
2413
- let n = r[e], i = Array.isArray(n) ? n[1]?.name : n?.v?.name;
2414
- i && t.push(String(i));
2415
- }
2416
- }
2417
- return t;
2418
- }(i))), function(e, t) {
2419
- let n = e.getSharedStates().get(nt);
2420
- n && t.empty("fileVersion", n);
2421
- }(t, n), function(e, t, n, r) {
2422
- let i = {}, a = n.getCodeName();
2423
- a && (i.codeName = a), n.getRuntime().isDate1904() && (i.date1904 = "1"), r.updateLinks && (i.updateLinks = r.updateLinks), t.empty("workbookPr", i);
2424
- }(0, n, e, i), function(e, t, n, r) {
2425
- let i = r.protection;
2426
- if (!i || i.workbook) return;
2427
- let a = {};
2428
- Ue(i.password ?? {}, a, "workbook"), Ue(i.revisionsPassword ?? {}, a, "revisions");
2429
- for (let e of y) {
2430
- let t = u(e, i[e.key]);
2431
- t !== null && (a[e.attribute] = t);
2432
- }
2433
- t.empty("workbookProtection", a);
2434
- }(0, n, 0, i), function(e, t, n) {
2435
- t.start("bookViews");
2436
- let r = n.getView(), i = {};
2437
- r.isShowHorizontalScrollbar() || (i.showHorizontalScroll = "0"), r.isShowVerticalScrollbar() || (i.showVerticalScroll = "0"), r.isShowTabs() || (i.showSheetTabs = "0");
2438
- let a = r.getTabRatio();
2439
- a !== 600 && (i.tabRatio = a);
2440
- let o = n.getSelectedSheet().getIndex();
2441
- o !== 0 && (i.activeTab = "" + o), t.empty("workbookView", i), t.end("bookViews");
2442
- }(0, n, e, i.view);
2443
- let a = await (async (e, t) => {
2444
- let n = [], r = t ? t.length : 0;
2445
- if (r === 0) return n;
2446
- let i = /* @__PURE__ */ new Map();
2447
- e.getSharedStates().set("pivotCachePaths", i);
2448
- for (let a = 0; a < r; a++) {
2449
- let r = t[a], o = r.cacheId, s = r.part;
2450
- if (s?.xml && !i.has(o)) try {
2451
- let t = await Ze({
2452
- ...s,
2453
- type: s.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
2454
- contentType: s.contentType || "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
2455
- }, e, "/xl/pivotCache/pivotCacheDefinition{n}.xml");
2456
- if (!t?.relId) continue;
2457
- i.set(o, t.path), n.push({
2458
- cacheId: o,
2459
- relId: t.relId
2460
- });
2461
- } catch (t) {
2462
- e.log(`Unable to write the pivot cache ${o}; the pivot tables on it will be dropped.`, t);
2463
- }
2464
- }
2465
- return n;
2466
- })(t, i.pivotCaches);
2467
- (function(e, t) {
2468
- t.getComments().some((e) => !e.isNote()) && e.addPart("persons", t.getPeople());
2469
- })(t, e), n.start("sheets");
2470
- let s = t.getSharedStates(), c = e.getStrings().beginPersist();
2471
- s.set("persistStrings", c);
2472
- let d = new Ke();
2473
- s.set("metaCollector", d);
2474
- let f = new qe(d, t.log.bind(t));
2475
- s.set("persistRichTypes", f), s.set(We, new Ge(i.styles, e.getStyles()));
2476
- try {
2477
- let r = e.getSheets().getItems({ visibility: ue.Visibility.VeryHidden }), a = i.sheets, o = e.getSelectedSheet(), l = r.length, u = ((e, t) => {
2478
- let n = Array(t), r = /* @__PURE__ */ new Set(), i = 1;
2479
- for (let a = 0; a < t; a++) {
2480
- let t = e?.[a]?.sheetId;
2481
- t === void 0 || !Number.isInteger(t) || t < 1 || r.has(t) || (r.add(t), n[a] = t, t >= i && (i = t + 1));
2482
- }
2483
- for (let e = 0; e < t; e++) if (n[e] === void 0) {
2484
- for (; r.has(i);) i++;
2485
- r.add(i), n[e] = i++;
2486
- }
2487
- return n;
2488
- })(a, l), d = ((e, t, n) => {
2489
- let r = t.length, i = Array(r), a = new Set(n?.values() ?? []), o = /* @__PURE__ */ new Set();
2490
- for (let a = 0; a < r; a++) {
2491
- let r = e?.[a]?.sheetId;
2492
- if (r === void 0 || t[a] !== r) continue;
2493
- let s = n?.get(r);
2494
- s && !o.has(s) && (o.add(s), i[a] = s);
2495
- }
2496
- let s = 1;
2497
- for (let e = 0; e < r; e++) {
2498
- if (i[e]) continue;
2499
- let t;
2500
- do
2501
- t = `xl/worksheets/sheet${s++}.xml`;
2502
- while (a.has(t) || o.has(t));
2503
- o.add(t), i[e] = t;
2504
- }
2505
- return i;
2506
- })(a, u, s.get(rt));
2507
- for (let e = 0; e < l; e++) {
2508
- let i = r[e], s = "" + u[e], l = {
2509
- name: i.getName(),
2510
- sheetId: s
2511
- }, f = i.getVisibility();
2512
- f === "hidden" ? l.state = "hidden" : f === "veryHidden" && (l.state = "veryHidden");
2513
- let p = a[e].sheet;
2514
- l["r:id"] = t.addPart("worksheet", {
2515
- model: i,
2516
- isSelected: o === i,
2517
- json: p,
2518
- persistStrings: c
2519
- }, "/" + d[e]).relId, n.empty("sheet", l);
2520
- }
2521
- await t.waitEmit();
2522
- let f = e.getTheme();
2523
- t.addPart("theme", {
2524
- model: f,
2525
- json: i.theme
2526
- }), await t.waitEmit(), t.addPart("styles", {
2527
- styles: e.getStyles(),
2528
- theme: e.getTheme(),
2529
- json: i.styles
2530
- }), await t.waitEmit();
2531
- let p = await c.toJSONAsync();
2532
- p && p.length > 0 && (t.addPart("sharedStrings", {
2533
- model: p,
2534
- json: p
2535
- }), await t.waitEmit());
2536
- let m = s.get("persistRichTypes");
2537
- m?.hasAny() && (t.addPart("richValue", m), t.addPart("richValueStructure", m), t.addPart("richValueTypes", null), await t.waitEmit());
2538
- let h = s.get("metaCollector");
2539
- h?.hasAny() && (t.addPart("metadata", h), await t.waitEmit()), s.delete("persistRichTypes"), s.delete("metaCollector"), s.delete("persistStrings");
2540
- } catch (e) {
2541
- throw e;
2542
- } finally {
2543
- c.endPersist();
2544
- }
2545
- n.end("sheets"), function(e, t, n) {
2546
- let r = n.externalBooks, i = r ? r.length : 0;
2547
- if (i === 0) return;
2548
- let a = e.getSharedStates().get(it), o = /* @__PURE__ */ new Set();
2549
- if (a) for (let e = 0; e < i; e++) !r[e] && a[e] && o.add(a[e]);
2550
- let s = [], c = 1;
2551
- for (let t = 0; t < i; t++) {
2552
- let n = r[t];
2553
- if (n) {
2554
- let t;
2555
- do
2556
- t = `xl/externalLinks/externalLink${c++}.xml`;
2557
- while (o.has(t));
2558
- s.push(e.addPart("externalLink", n, "/" + t).relId);
2559
- continue;
2560
- }
2561
- let i = a?.[t], l = i ? e.addRelationship(tt, i) : null;
2562
- l ? s.push(l) : e.log(`External link [${t + 1}] cannot be written and is being dropped; later links will renumber.`);
2563
- }
2564
- if (s.length !== 0) {
2565
- t.start("externalReferences");
2566
- for (let e = 0; e < s.length; e++) t.empty("externalReference", { "r:id": s[e] });
2567
- t.end("externalReferences");
2568
- }
2569
- }(t, n, i), function(e, t, n, r) {
2570
- let i = e.getSharedStates().get(o), a = r.names, s = a ? a.length : 0;
2571
- if (s === 0) return;
2572
- let c = r.externalBooks?.length ?? 0, l = /* @__PURE__ */ new Map(), u = n.getSheets().getItems({ visibility: ue.Visibility.VeryHidden });
2573
- for (let e = 0; e < u.length; e++) l.set(u[e].getName().toLowerCase(), e);
2574
- t.start("definedNames");
2575
- for (let n = 0; n < s; n++) {
2576
- let r = a[n], o = { name: r.name };
2577
- if (r.comment && (o.comment = r.comment), r.scope) {
2578
- let t = l.get(r.scope.toLowerCase());
2579
- t === void 0 ? e.log(`Defined name '${r.name}' is scoped to unknown sheet '${r.scope}'; writing it as global.`) : o.localSheetId = "" + t;
2580
- }
2581
- r.hidden && (o.hidden = "1");
2582
- let s = i.writeName(r.ref);
2583
- for (let t of at(s)) t > c && e.log(`Defined name '${r.name}' cites external book [${t}], but only ${c} ${c === 1 ? "is" : "are"} written; Excel will report the file as needing repair.`);
2584
- t.start("definedName", o), t.text(s), t.end("definedName");
2585
- }
2586
- t.end("definedNames");
2587
- }(t, n, e, i), function(e, t, n) {
2588
- let r = n.getCalculation().toJSON(), i = { calcId: e.getSharedStates().get("calcId") ?? "191029" }, a = (e, t) => {
2589
- let n = r[e];
2590
- typeof n == "boolean" && (i[t] = n ? "1" : "0");
2591
- };
2592
- if (r.calcMode) {
2593
- let e = ot[r.calcMode];
2594
- e && e !== "auto" && (i.calcMode = e);
2595
- }
2596
- a("fullCalcOnLoad", "fullCalcOnLoad"), a("calcOnSave", "calcOnSave"), a("calcCompleted", "calcCompleted"), a("fullPrecision", "fullPrecision"), a("forceFullCalc", "forceFullCalc"), a("concurrentCalc", "concurrentCalc"), r.refMode && (i.refMode = r.refMode), r.iterate && (i.iterate = "1"), r.maxIteration !== void 0 && (i.iterateCount = String(r.maxIteration)), r.maxIterateChange !== void 0 && (i.iterateDelta = String(r.maxIterateChange)), t.empty("calcPr", i);
2597
- }(t, n, e), function(e, t) {
2598
- if (t.length !== 0) {
2599
- e.start("pivotCaches");
2600
- for (let n = 0; n < t.length; n++) e.empty("pivotCache", {
2601
- cacheId: t[n].cacheId,
2602
- "r:id": t[n].relId
2603
- });
2604
- e.end("pivotCaches");
2605
- }
2606
- }(n, a), function(e, t) {
2607
- let n = e.getSharedStates().get("calcFeatures") ?? "<ext uri=\"{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}\" xmlns:xcalcf=\"http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures\"><xcalcf:calcFeatures><xcalcf:feature name=\"microsoft.com:RD\"/><xcalcf:feature name=\"microsoft.com:Single\"/><xcalcf:feature name=\"microsoft.com:FV\"/><xcalcf:feature name=\"microsoft.com:CNMTM\"/><xcalcf:feature name=\"microsoft.com:LET_WF\"/><xcalcf:feature name=\"microsoft.com:LAMBDA_WF\"/><xcalcf:feature name=\"microsoft.com:ARRAYTEXT_WF\"/></xcalcf:calcFeatures></ext>";
2608
- t.start("extLst"), t.raw(n), t.end("extLst");
2609
- }(t, n), n.end("workbook"), n.close();
2610
- }
2611
- }(),
2612
- new class extends U {
2613
- constructor() {
2614
- super({
2615
- kind: "worksheet",
2616
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
2617
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
2618
- path: () => "/xl/worksheets/sheet{n}.xml"
2619
- });
2620
- }
2621
- async emit(i, a) {
2622
- let s = a.getXMLWriter(), c = i.model, d = i.json;
2623
- s.decl(), s.start("worksheet", {
2624
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2625
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2626
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
2627
- "mc:Ignorable": "x14ac",
2628
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"
2629
- }), function(e, t, n) {
2630
- let r = n.getTabColor(), i = n.getCodeName(), a = {};
2631
- i && (a.codeName = i), n.isConditionalFormatCalculationEnabled() || (a.enableFormatConditionsCalculation = "0");
2632
- let o = n.getOutlineSettings(), s = {};
2633
- o.summaryBelow || (s.summaryBelow = "0"), o.summaryRight || (s.summaryRight = "0"), o.showOutlineSymbols || (s.showOutlineSymbols = "0"), o.applyStyles && (s.applyStyles = "1");
2634
- let c = Object.keys(s).length > 0, l = !!r || c;
2635
- if (!(!l && Object.keys(a).length === 0)) {
2636
- if (!l) return void t.empty("sheetPr", a);
2637
- t.start("sheetPr", a), r && q(t, n.getStyles().getTheme(), r, "tabColor", !1), c && t.empty("outlinePr", s), t.end("sheetPr");
2638
- }
2639
- }(0, s, c), function(e, t, n, r) {
2640
- let i = n.getUsedRange({ features: [] }), a = i ? i.getCoords() : null, o = k, s = M, c = r.directStyles, l = c ? c.length : 0;
2641
- for (let e = 0; e < l; e++) {
2642
- let t = n.getRange(c[e][0]).getCoords();
2643
- if (t.colEnd === s) {
2644
- let e = a?.colStart ?? 0;
2645
- t = {
2646
- ...t,
2647
- colStart: e,
2648
- colEnd: e
2649
- };
2650
- }
2651
- if (t.rowEnd === o) {
2652
- let e = a?.rowStart ?? 0;
2653
- t = {
2654
- ...t,
2655
- rowStart: e,
2656
- rowEnd: e
2657
- };
2658
- }
2659
- a = oe.unionRanges(a, t);
2660
- }
2661
- let u = r.merges, d = u ? u.length : 0;
2662
- for (let e = 0; e < d; e++) {
2663
- let t = n.getRange(u[e]).getCoords();
2664
- t.colEnd === s && (t = { ...a }, t.colStart = a?.colStart ?? 0, t.colEnd = t.colStart), t.rowEnd === o && (t = { ...t }, t.rowStart = a?.rowStart ?? 0, t.rowEnd = t.rowStart), a = oe.unionRanges(a, t);
2665
- }
2666
- let f = "A1";
2667
- a && (i = n.getRange(a), f = a.colStart === a.colEnd && a.rowStart === a.rowEnd ? i.getAddress() : `${i.getIntersect({
2668
- colStart: a.colStart,
2669
- rowStart: a.rowStart,
2670
- colEnd: a.colStart,
2671
- rowEnd: a.rowStart
2672
- }).getAddress()}:${i.getIntersect({
2673
- colStart: a.colEnd,
2674
- rowStart: a.rowEnd,
2675
- colEnd: a.colEnd,
2676
- rowEnd: a.rowEnd
2677
- }).getAddress()}`), t.empty("dimension", { ref: f });
2678
- }(0, s, c, d), function(e, t, n, r, i) {
2679
- let a = n.getView(), o = a.getTopLeft(), s = n.getRowHeaders().getIndex(o.top), c = n.getColumnHeaders().getIndex(o.left), l = P.cellToString({
2680
- colIndex: c,
2681
- rowIndex: s
2682
- });
2683
- t.start("sheetViews");
2684
- let u = {};
2685
- a.isShowFormulas() && (u.showFormulas = "1"), a.isShowColumnGridlines() || a.isShowRowGridlines() || (u.showGridLines = "0"), a.isShowColumnHeaders() || a.isShowRowHeaders() || (u.showRowColHeaders = "0"), a.isShowZeros() || (u.showZeros = "0"), a.isRightToLeft() && (u.rightToLeft = "1"), i && (u.tabSelected = "1"), l !== "A1" && (u.topLeftCell = l);
2686
- let d = a.getZoomScale();
2687
- d !== 100 && (u.zoomScale = d, u.zoomScaleNormal = d);
2688
- let f = a.getGridLineColor();
2689
- if (f) {
2690
- u.defaultGridColor = "0";
2691
- let e = f.toRGBA(), t = e.red, r = e.green, i = e.blue, a = n.getStyles().getIndexedColors(), o = a.length, s = 0, c = Number.MAX_VALUE;
2692
- for (let e = 0; e < o; e++) {
2693
- let n = a[e].toRGBA(), o = (t - n.red) ** 2 + (r - n.green) ** 2 + (i - n.blue) ** 2;
2694
- o < c && (c = o, s = e);
2695
- }
2696
- u.colorId = "" + s;
2697
- }
2698
- u.workbookViewId = "0";
2699
- let p = n.getSelection().getCoords(), m = P.cellToString(p.cell), h = {}, g = a.getFreezePanes(), _ = g.coords ?? {}, v = _.colIndex ?? 0, y = _.rowIndex ?? 0;
2700
- if (v > 0 || y > 0) {
2701
- let e = g.topLeft ?? {}, r = e.top ?? 0, i = e.left ?? 0, a = n.getRowHeaders().getIndex(r), s = n.getColumnHeaders().getIndex(i), c = v - s, l = y - a, d = Math.max(v, n.getColumnHeaders().getIndex(o.left + n.getColumnHeaders().getOffset(v) - i)), f = Math.max(y, n.getRowHeaders().getIndex(o.top + n.getRowHeaders().getOffset(y) - r)), p = P.cellToString({
2702
- colIndex: s,
2703
- rowIndex: a
2704
- });
2705
- p === "A1" ? delete u.topLeftCell : u.topLeftCell = p, t.start("sheetView", u);
2706
- let m = {};
2707
- if (c > 0 && (m.xSplit = c), l > 0 && (m.ySplit = l), m.topLeftCell = P.cellToString({
2708
- colIndex: d,
2709
- rowIndex: f
2710
- }), m.state = "frozen", v === 0) {
2711
- m.activePane = "bottomLeft", t.empty("pane", m);
2712
- let e = P.cellToString({
2713
- colIndex: d,
2714
- rowIndex: a
2715
- });
2716
- e !== "A1" && t.empty("selection", {
2717
- activeCell: e,
2718
- sqref: e
2719
- }), h.pane = "bottomLeft";
2720
- } else if (y === 0) {
2721
- m.activePane = "topRight", t.empty("pane", m);
2722
- let e = P.cellToString({
2723
- colIndex: s,
2724
- rowIndex: f
2725
- });
2726
- e !== "A1" && t.empty("selection", {
2727
- activeCell: e,
2728
- sqref: e
2729
- }), h.pane = "topRight";
2730
- } else {
2731
- m.activePane = "bottomRight", t.empty("pane", m), p !== "A1" && t.empty("selection", {
2732
- activeCell: p,
2733
- sqref: p
2734
- });
2735
- let e = P.cellToString({
2736
- colIndex: d,
2737
- rowIndex: a
2738
- });
2739
- t.empty("selection", {
2740
- pane: "topRight",
2741
- activeCell: e,
2742
- sqref: e
2743
- });
2744
- let n = P.cellToString({
2745
- colIndex: s,
2746
- rowIndex: f
2747
- });
2748
- t.empty("selection", {
2749
- pane: "bottomLeft",
2750
- activeCell: n,
2751
- sqref: n
2752
- }), h.pane = "bottomRight";
2753
- }
2754
- } else t.start("sheetView", u);
2755
- h.activeCell = m;
2756
- let b = p.ranges, x = b ? b.length : 0;
2757
- if (x > 0) {
2758
- let e = "";
2759
- for (let t = 0; t < x; t++) {
2760
- let n = b[t];
2761
- t > 0 && (e += " "), e += P.rangeToString(n);
2762
- }
2763
- h.sqref = e, (p.rangeIndex ?? 0) > 0 && (h.activeCellId = "" + p.rangeIndex);
2764
- } else m === "A1" ? h = null : h.sqref = m;
2765
- h && t.empty("selection", h), t.end("sheetView"), t.end("sheetViews");
2766
- }(0, s, c, 0, i.isSelected), function(e, t, n, r) {
2767
- let i = r.defaultColSize, a = r.defaultRowSize, o = {};
2768
- i !== void 0 && (o.defaultColWidth = i), o.defaultRowHeight = a ?? .75 * n.getRowHeaders().getDefaultSize(), a !== void 0 && (o.customHeight = "1"), o["x14ac:dyDescent"] = "0.25", t.empty("sheetFormatPr", o);
2769
- }(0, s, c, d);
2770
- let f = !1 === d.protection?.showFormulas ? a.getSharedStates().get("hiddenFormulaXfs") ?? null : null;
2771
- (function(e, t, n, r, i) {
2772
- let a = r.cols ? P.refsToRuns(r.cols, !0) : null, o = a ? a.length : 0;
2773
- n.getEntireRange().getColumnEnd();
2774
- let s = n.getColumnHeaders().getDefaultSizeNative(), c = i ? i.getHiddenXf(0) : 0, l = 1, u = (e) => {
2775
- c !== 0 && e >= l && t.empty("col", {
2776
- min: l,
2777
- max: e,
2778
- width: s,
2779
- style: c
2780
- });
2781
- };
2782
- if (o > 0 || c !== 0) {
2783
- t.start("cols");
2784
- for (let e = 0; e < o; e++) {
2785
- let n = a[e], r = n.min + 1, o = M + 1;
2786
- if (r > o) continue;
2787
- let c = Math.min(n.max + 1, o);
2788
- u(r - 1), l = c + 1;
2789
- let d = {
2790
- min: r,
2791
- max: c
2792
- }, f = n.value, p = f.sz;
2793
- p === void 0 ? d.width = s : p !== 0 && (d.width = Math.round(256 * p) / 256);
2794
- let m = i ? i.getHiddenXf(f.s ?? 0) : f.s;
2795
- m && (d.style = m), f.h !== void 0 && (d.hidden = 1), f.csz && (d.customWidth = 1), f.l !== void 0 && (d.outlineLevel = f.l), f.cl !== void 0 && (d.collapsed = 1), t.empty("col", d);
2796
- }
2797
- u(M + 1), t.end("cols");
2798
- }
2799
- })(0, s, c, d, f), function(e, i, a, o, s, c) {
2800
- let u = e.getSharedStates(), d = u.get("persistStrings"), f = u.get("metaCollector"), p = u.get("persistRichTypes"), m = 0, h = 0, g = a.getUsedRange(), _ = 0, v = o.rows ? P.refsToRuns(o.rows, !1) : null, y = v ? v.length : 0, b = v?.[y - 1]?.max ?? -1, x = o.cols ? P.refsToRuns(o.cols, !0) : null, S = x ? x.length : 0, C = x?.[S - 1]?.max ?? -1;
2801
- if (g || y > 0) {
2802
- let u = .75, g = o.defaultRowSize ?? a.getRowHeaders().getDefaultSize() * u, y = a.getStyles().getNormal().getBestFit().height * u, S = (e, t) => {
2803
- let n = vn;
2804
- if (n.r = "" + (e + 1), n.s = void 0, n.customFormat = void 0, n.hidden = void 0, n.ht = void 0, n.customHeight = void 0, n.outlineLevel = void 0, n.collapsed = void 0, !t) return n;
2805
- let r = t.value;
2806
- r.s !== void 0 && (n.s = "" + (c ? c.getHiddenXf(r.s) : r.s), n.customFormat = "1"), r.h && (n.hidden = "1");
2807
- let i = r.csz ?? !1, a = r.sz ?? g;
2808
- return (a !== y || i) && (n.ht = "" + a), i && (n.customHeight = "1"), r.l !== void 0 && (n.outlineLevel = "" + r.l), r.cl !== void 0 && (n.collapsed = "" + r.cl), n;
2809
- }, w = 0, T = v?.[w] ?? null, D = T?.min ?? 2 ** 53 - 1, O = T?.max ?? 2 ** 53 - 1, ee = T?.value?.s, k = -1, A = 0, j = x?.[A] ?? null, te = j?.min ?? 2 ** 53 - 1, M = j?.max ?? 2 ** 53 - 1, ne = j?.value?.s, re = (e, t = !1) => {
2810
- if (k !== e) {
2811
- for (k !== -1 && (i.end("row"), A !== 0 && (A = 0, j = x?.[A] ?? null, te = j?.min ?? 2 ** 53 - 1, M = j?.max ?? 2 ** 53 - 1, ne = j?.value?.s)); k + 1 <= e;) {
2812
- k++, T && k > O && (T = v[++w] ?? null, T ? (D = T.min, O = T.max, ee = T.value?.s) : (D = 2 ** 53 - 1, O = 2 ** 53 - 1, ee = void 0)), k < D && k < e && (k = T ? Math.min(D, e) : e);
2813
- let n = k < e || t && k === e, r = S(k, T && k >= D && k <= O ? T : null);
2814
- n ? i.empty("row", r) : i.start("row", r);
2815
- }
2816
- if (e < k) {
2817
- let t = S(e, null);
2818
- i.start("row", t);
2819
- }
2820
- }
2821
- };
2822
- i.setValidationDisabled(!0), i.start("sheetData");
2823
- let N = [];
2824
- N.push(Zt(e, a, o.directStyles));
2825
- let F = o.formulas, ae = F ? F.length : 0;
2826
- if (ae > 0) {
2827
- let n = /* @__PURE__ */ new Map();
2828
- if (s.names.size > 0 && o.formulaArray) for (let e of o.formulaArray) try {
2829
- let t = a.getRange(e[0]).getCoords();
2830
- n.set(`${t.rowStart},${t.colStart}`, t);
2831
- } catch {}
2832
- let r = [];
2833
- if (o.formulaArray) for (let e of o.formulaArray) try {
2834
- r.push(a.getRange(e[0]).getCoords());
2835
- } catch {}
2836
- let i = (e) => {
2837
- for (let t = 0; t < r.length; t++) {
2838
- let n = r[t];
2839
- if (n.rowStart <= e.rowEnd && n.rowEnd >= e.rowStart && n.colStart <= e.colEnd && n.colEnd >= e.colStart) return !0;
2840
- }
2841
- return !1;
2842
- }, c = e.getSharedStates().get("xlsxFormulaDialect") ?? l(a.getCalculation().getNamedFormulas().toJSON(), a.getTables().getItems().map((e) => e.getName())), u = a.getEntireRange().getCoords(), d = [];
2843
- for (let e of a.getTables().getItems()) d.push([e.getRange().getCoords(), e.getName()]);
2844
- let f = (e, t) => {
2845
- for (let n = 0; n < d.length; n++) {
2846
- let r = d[n][0];
2847
- if (e >= r.rowStart && e <= r.rowEnd && t >= r.colStart && t <= r.colEnd) return d[n][1];
2848
- }
2849
- return null;
2850
- }, p = /* @__PURE__ */ new Set();
2851
- for (let e = 0; e < r.length; e++) p.add(`${r[e].rowStart},${r[e].colStart}`);
2852
- let m = [];
2853
- for (let r = 0; r < ae; r++) {
2854
- let o = F[r];
2855
- try {
2856
- let e = o[0], l = a.getRange(e), d = l.getCoords(), h = o[1], g = null, v = {
2857
- rowIndex: d.rowStart,
2858
- colIndex: d.colStart
2859
- }, y = c.parse(h, v), b = y ? c.annotate(y) : void 0, x = y ? c.spell(y, p.has(`${d.rowStart},${d.colStart}`), f(d.rowStart, d.colStart)) : null, S = x ? ce.imager(x, { entireCoords: u }) : null;
2860
- S && (h = S(v));
2861
- let C = !0 === b?.cm, w = !0 === b?.ca;
2862
- if (s.affects(r)) {
2863
- g = null, C = !1;
2864
- let e = (e, t, n) => {
2865
- let r = {
2866
- rowStart: e,
2867
- colStart: t,
2868
- rowEnd: e,
2869
- colEnd: t
2870
- };
2871
- m.push([r, {
2872
- coords: r,
2873
- formula: n,
2874
- sharedId: null,
2875
- ref: P.rangeToString(r),
2876
- isDynamicRange: !1,
2877
- isWrapped: !0
2878
- }]);
2879
- }, r = n.get(`${d.rowStart},${d.colStart}`), i = r !== void 0 && (r.rowEnd > r.rowStart || r.colEnd > r.colStart), o = !1;
2880
- if (i) {
2881
- let n = t(h, l.getCell().getValue());
2882
- if (n !== null) for (let t = r.rowStart; t <= r.rowEnd; t++) for (let i = r.colStart; i <= r.colEnd; i++) {
2883
- if (t === r.rowStart && i === r.colStart) {
2884
- e(t, i, n), o = !0;
2885
- continue;
2886
- }
2887
- let s = E(a.getRange(P.rangeToString({
2888
- rowStart: t,
2889
- colStart: i,
2890
- rowEnd: t,
2891
- colEnd: i
2892
- })).getCell().getValue());
2893
- s !== null && e(t, i, s);
2894
- }
2895
- } else l.forEach((n, r) => {
2896
- let i = r.getCoords(), a = t(S?.(i) ?? h, r.getCell().getValue());
2897
- a !== null && (e(i.rowIndex, i.colIndex, a), o = !0);
2898
- }, { includeEmpty: !0 });
2899
- if (o) continue;
2900
- }
2901
- let T = h.indexOf("!") !== -1 || h.indexOf("[") !== -1;
2902
- C || l.isSingleCell() || T || i(d) || (g = "" + _++);
2903
- let D = g !== null || l.isSingleCell() ? null : S, O = [d, {
2904
- coords: d,
2905
- formula: h,
2906
- sharedId: g,
2907
- ref: e,
2908
- isDynamicRange: C,
2909
- isExcelVolatile: w,
2910
- memberImage: D
2911
- }];
2912
- m.push(O);
2913
- } catch (t) {
2914
- e.log(`Could not write the formula '${o[1]}' over '${o[0]}'; those cells are written as values only. ${t}`);
2915
- continue;
2916
- }
2917
- }
2918
- N.push(m);
2919
- } else N.push([]);
2920
- let I = o.volatile, oe = I ? I.length : 0;
2921
- if (oe > 0) {
2922
- let e = Array(oe);
2923
- for (let t = 0; t < oe; t++) {
2924
- let n = I[t];
2925
- try {
2926
- e[t] = [a.getRange(n).getCoords(), !0];
2927
- } catch (e) {
2928
- console.warn(`Failed to parse volatile: ${n}`, e);
2929
- continue;
2930
- }
2931
- }
2932
- N.push(e);
2933
- } else N.push([]);
2934
- let L = o.formulaArray, R = L ? L.length : 0;
2935
- if (R > 0) {
2936
- let e = Array(R);
2937
- for (let t = 0; t < R; t++) {
2938
- let n = L[t];
2939
- try {
2940
- let r = n[0];
2941
- e[t] = [a.getRange(r).getCoords(), {
2942
- ref: r,
2943
- kind: n[1] ?? "dynamic"
2944
- }];
2945
- } catch (e) {
2946
- console.warn(`Failed to parse formula array: ${n}`, e);
2947
- continue;
2948
- }
2949
- }
2950
- N.push(e);
2951
- } else N.push([]);
2952
- a.getEntireRange().forEach((t, a) => {
2953
- let o = a.getCoords(), s = o.rowIndex, l = o.colIndex;
2954
- k !== s && re(s);
2955
- let u = a.getInjectedReference(0);
2956
- if (u === void 0 && ee !== void 0 && s >= D && s <= O && (u = ee), u === void 0) {
2957
- for (; l <= C && l > M;) A++, j = x?.[A] ?? null, te = j?.min ?? 2 ** 53 - 1, M = j?.max ?? 2 ** 53 - 1, ne = j?.value?.s;
2958
- ne !== void 0 && l >= te && l <= M && (u = ne);
2959
- }
2960
- let g = a.getType(), _ = null;
2961
- ae > 0 && (_ = a.getInjectedReference(1) ?? null);
2962
- let v = !1;
2963
- oe > 0 && (v = a.getInjectedReference(2) ?? !1);
2964
- let y = null;
2965
- R > 0 && (y = a.getInjectedReference(3) ?? null);
2966
- let b = y?.kind === "error", S = y?.kind === "fixed", w = _n;
2967
- w.r = a.getAddress(), w.s = void 0, w.t = void 0, w.cm = void 0, w.vm = void 0, c && (u = c.getHiddenXf(u ?? 0)), u !== void 0 && u !== 0 && (w.s = "" + u);
2968
- let T = null, E = null;
2969
- switch (g) {
2970
- case me.Boolean:
2971
- T = t ? "1" : "0", E = "b";
2972
- break;
2973
- case me.Error:
2974
- let e = t.getCode();
2975
- if (E = "e", e > 7) T = se.BuiltIn.Value.getLabel(), w.vm = "" + p.add(t);
2976
- else if (e < 1) {
2977
- let e;
2978
- E = "s", _ ? (e = "=" + _.formula, _ = null) : e = "" + t.getLabel(), T = "" + d.add(e), m++;
2979
- } else T = "" + t.getLabel();
2980
- break;
2981
- case me.Number:
2982
- T = "" + t, E = null;
2983
- break;
2984
- case me.String:
2985
- T = t, _ ? (E = "str", T = t) : (E = "s", T = "" + d.add(T), m++);
2986
- break;
2987
- case me.RichData: E = "e", T = se.BuiltIn.Value.getLabel(), w.vm = "" + p.add(t);
2988
- }
2989
- E && (w.t = E);
2990
- let N = !_?.isWrapped && (y !== null || (_?.isDynamicRange ?? !1));
2991
- if (_ !== null || T !== null) {
2992
- if (N && _ !== null && !S && (w.cm = "" + f.registerArrayCell(b)), i.start("c", w), _) {
2993
- let e = s === _.coords.rowStart && l === _.coords.colStart, t = _.formula;
2994
- _.memberImage && !e && (t = _.memberImage({
2995
- rowIndex: s,
2996
- colIndex: l
2997
- }));
2998
- let n, r = null, a = _.sharedId;
2999
- if (a) {
3000
- n = bn;
3001
- let e = _.coords;
3002
- e.colStart === l && e.rowStart === s ? (n.ref = _.ref, n.si = a, r = _.formula) : (n.ref = void 0, n.si = a);
3003
- } else N ? (n = xn, n.aca = b ? "1" : void 0, n.ref = b ? w.r : y?.ref ?? w.r, r = t) : (n = yn, r = t);
3004
- n.ca = v || b || _.isExcelVolatile ? "1" : void 0, r ? (i.start("f", n), i.text(r), i.end("f")) : i.empty("f", n);
3005
- }
3006
- T !== null && (E === "str" && T ? (i.start("v", ie.test(T) ? n : void 0), i.text(r(T))) : (i.start("v"), T && i.text(T)), i.end("v")), i.end("c");
3007
- } else h++ < Xt ? i.empty("c", w) : h === 1048577 && e.warn(`Reached ${Xt} style-only cells at '${w.r}'; not writing the rest.`);
3008
- }, {
3009
- injectReferences: N,
3010
- features: []
3011
- }), k !== -1 && k >= b ? i.end("row") : re(b, !0), i.end("sheetData"), i.setValidationDisabled(!1);
3012
- } else i.empty("sheetData");
3013
- if (m > 0) {
3014
- let e = u.get("stringsCount") ?? 0;
3015
- u.set("stringsCount", e + m);
3016
- }
3017
- }(a, s, c, d, await (async (e, t) => {
3018
- let n = t ? t.length : 0;
3019
- if (n === 0) return Yt;
3020
- let r = /* @__PURE__ */ new Set(), i = Array(n);
3021
- for (let e = 0; e < n; e++) {
3022
- i[e] = null;
3023
- try {
3024
- let n = ce.parse(t[e][1]);
3025
- if (!n) continue;
3026
- let a = null, o = (e) => {
3027
- let t = null;
3028
- e.type === "function" ? t = String(e.value) : e.type === "call" && e.inputs?.[0]?.type === "named" && (t = String(e.inputs[0].value?.name ?? "")), t && (t = t.toUpperCase(), r.add(t), (a ??= /* @__PURE__ */ new Set()).add(t));
3029
- let n = e.inputs;
3030
- if (n) for (let e = 0; e < n.length; e++) n[e] && o(n[e]);
3031
- };
3032
- o(n), i[e] = a;
3033
- } catch {}
3034
- }
3035
- let a = e.getWorkbook();
3036
- if (!a) return Yt;
3037
- let o = await D(a, r);
3038
- return o.size === 0 ? Yt : {
3039
- names: o,
3040
- perFormula: i,
3041
- affects: (e) => {
3042
- let t = i[e];
3043
- if (!t) return !1;
3044
- for (let e of t) if (o.has(e)) return !0;
3045
- return !1;
3046
- }
3047
- };
3048
- })(c, d.formulas), f), function(e, t, n, r) {
3049
- let i = r.protection;
3050
- if (!i) return;
3051
- let a = {};
3052
- i.sheet || Ue(i.password ?? {}, a);
3053
- for (let e of N) {
3054
- let t = u(e, i[e.key]);
3055
- t !== null && (a[e.attribute] = t);
3056
- }
3057
- t.empty("sheetProtection", a);
3058
- }(0, s, 0, d), function(e, t, n, r) {
3059
- let i = r.protectedRanges, a = i ? i.length : 0;
3060
- if (a === 0) return;
3061
- let o = [];
3062
- for (let t = 0; t < a; t++) {
3063
- let n = i[t], r, a;
3064
- Array.isArray(n) ? (r = n[0], a = n[1]) : (r = n.r, a = n.v);
3065
- let s = an(r);
3066
- if (!s || !a) {
3067
- e.log("Skipping protectedRange with no range.");
3068
- continue;
3069
- }
3070
- if (!a.name) {
3071
- e.log("Skipping protectedRange with no name.");
3072
- continue;
3073
- }
3074
- let c = {};
3075
- Ue(a.password ?? {}, c), c.sqref = s, c.name = a.name, a.securityDescriptor && (c.securityDescriptor = a.securityDescriptor), o.push(c);
3076
- }
3077
- if (o.length !== 0) {
3078
- t.start("protectedRanges");
3079
- for (let e = 0; e < o.length; e++) t.empty("protectedRange", o[e]);
3080
- t.end("protectedRanges");
3081
- }
3082
- }(a, s, 0, d);
3083
- let p = d.autoTable;
3084
- if (p) {
3085
- let e, t = p;
3086
- e = Array.isArray(t) ? t[1] : t.v, Gt(a, s, c.getAutoTable(), e, !0);
3087
- }
3088
- (function(e, t, n, r) {
3089
- let i = r.merges ? r.merges.length : 0;
3090
- if (i > 0) {
3091
- t.start("mergeCells", { count: i });
3092
- for (let e = 0; e < i; e++) {
3093
- let n = r.merges[e], i = typeof n == "string" ? n : P.rangeToString(n);
3094
- t.empty("mergeCell", { ref: i });
3095
- }
3096
- t.end("mergeCells");
3097
- }
3098
- })(0, s, 0, d);
3099
- let m = function(e, t, n, r) {
3100
- let i = [], a = r.conditionals, s = a ? a.length : 0;
3101
- if (s === 0) return i;
3102
- let c = e.getSharedStates(), l = c.get(jt);
3103
- l || (l = new At(), c.set(jt, l));
3104
- let u = n.getStyles().getTheme(), d = c.get(o), f = null, p = 0;
3105
- for (let n = 0; n < s; n++) {
3106
- let r = a[n], o, s;
3107
- Array.isArray(r) ? (o = r[0], s = r[1]) : (o = r.r, s = r.v);
3108
- let c = an(o);
3109
- if (!c || !s) {
3110
- e.log("Skipping conditionalFormatting with no range.");
3111
- continue;
3112
- }
3113
- let m = cn(c), h = un(s.scale, m, d);
3114
- h !== s.scale && (s = {
3115
- ...s,
3116
- scale: h
3117
- });
3118
- let _ = h ? { type: h.type } : g(s.condition, rn(c), (t, n) => e.warn(t, void 0, n));
3119
- _ ? (_.formulas &&= _.formulas.map((e) => ln(e, m, d)), h?.type === z.ScaleType.IconSet && tn(h) ? (p++, i.push({
3120
- guid: x(I.uuidV4),
3121
- sqref: c,
3122
- priority: p,
3123
- scale: h
3124
- })) : h || !sn(_) ? (c !== f && (f !== null && t.end("conditionalFormatting"), t.start("conditionalFormatting", {
3125
- sqref: c,
3126
- pivot: s.pivot ? "1" : void 0
3127
- }), f = c), p++, nn(e, t, u, s, _, c, p, l, i)) : (p++, i.push({
3128
- guid: x(I.uuidV4),
3129
- sqref: c,
3130
- priority: p,
3131
- rule: _,
3132
- style: s.style,
3133
- stopIfTrue: s.stopIfTrue
3134
- }))) : s.condition || e.log("Skipping conditional format with neither a condition nor a scale.");
3135
- }
3136
- return f !== null && t.end("conditionalFormatting"), i;
3137
- }(a, s, c, d), h = function(e, t, n, r) {
3138
- let i = [], a = e.getSharedStates().get(o), s = r.validations, c = s ? s.length : 0;
3139
- if (c === 0) return i;
3140
- let l = [];
3141
- for (let t = 0; t < c; t++) {
3142
- let n = s[t], r, o;
3143
- Array.isArray(n) ? (r = n[0], o = n[1]) : (r = n.r, o = n.v);
3144
- let c = an(r);
3145
- if (!c || !o) {
3146
- e.log("Skipping dataValidation with no range.");
3147
- continue;
3148
- }
3149
- o.ext && e.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
3150
- let u = (t, n) => e.warn(t, void 0, n), d = S(o.condition, u), { type: f, operator: p } = d ?? {}, m = cn(c), h = ln(d?.formula1, m, a), g = ln(d?.formula2, m, a), _ = {
3151
- type: f,
3152
- operator: p,
3153
- allowBlank: Q(o.condition?.includeBlanks ?? !1),
3154
- showDropDown: o.hideDropdown ? "1" : void 0,
3155
- showInputMessage: Q(o.showPromptMessage),
3156
- showErrorMessage: Q(o.showAlertMessage),
3157
- errorStyle: o.alertStyle ?? "stop",
3158
- errorTitle: re(o.alertTitle, "errorTitle", u),
3159
- error: re(o.alert, "error", u),
3160
- promptTitle: re(o.promptTitle, "promptTitle", u),
3161
- prompt: re(o.prompt, "prompt", u),
3162
- imeMode: o.imeMode
3163
- };
3164
- on(h) || on(g) ? i.push({
3165
- attrs: _,
3166
- formula1: h,
3167
- formula2: g,
3168
- sqref: c
3169
- }) : (_.sqref = c, l.push({
3170
- attrs: _,
3171
- formula1: h,
3172
- formula2: g
3173
- }));
3174
- }
3175
- if (l.length === 0) return i;
3176
- t.start("dataValidations", { count: l.length });
3177
- for (let e = 0; e < l.length; e++) {
3178
- let { attrs: n, formula1: r, formula2: i } = l[e];
3179
- r !== void 0 || i !== void 0 ? (t.start("dataValidation", n), r !== void 0 && (t.start("formula1"), t.text(r), t.end("formula1")), i !== void 0 && (t.start("formula2"), t.text(i), t.end("formula2")), t.end("dataValidation")) : t.empty("dataValidation", n);
3180
- }
3181
- return t.end("dataValidations"), i;
3182
- }(a, s, 0, d);
3183
- (function(e, t, n, r) {
3184
- let i = r.hyperlinks, a = i ? i.length : 0;
3185
- if (a !== 0) {
3186
- t.start("hyperlinks");
3187
- for (let n = 0; n < a; n++) {
3188
- let r, a, o = i[n];
3189
- Array.isArray(o) ? (a = o[0], r = o[1]) : (a = o.r, r = o.v), typeof r == "string" && (r = { address: r });
3190
- let s = r.address ?? "", c = s.indexOf("#"), l = c === -1 ? s : s.substring(0, c), u = c === -1 ? "" : s.substring(c + 1), d = {};
3191
- d.ref = a, l && (d["r:id"] = e.addExternal("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", l).relId), u && (d.location = u), r.screenTip && (d.tooltip = r.screenTip), t.empty("hyperlink", d);
3192
- }
3193
- t.end("hyperlinks");
3194
- }
3195
- })(a, s, 0, d), function(e, t, n, r) {
3196
- let i = r.pageMargins;
3197
- t.empty("pageMargins", {
3198
- left: i?.left ?? .7,
3199
- right: i?.right ?? .7,
3200
- top: i?.top ?? .75,
3201
- bottom: i?.bottom ?? .75,
3202
- header: i?.header ?? .3,
3203
- footer: i?.footer ?? .3
3204
- });
3205
- }(0, s, 0, d), function(e, t, n, r) {
3206
- let i = r.movables?.filter(pn);
3207
- if ((i ? i.length : 0) === 0 || !i.some((e) => {
3208
- let t = e.content?.type;
3209
- if (t === "picture" || t === "chart") return !0;
3210
- if (t === "shape") {
3211
- let t = e.content?.json?.type;
3212
- return t === "sp" || t === "cxnSp";
3213
- }
3214
- return !1;
3215
- })) return;
3216
- let a = n.getMovables().getItems().filter((e, t) => pn(r.movables[t])), o = e.addPart("drawing", {
3217
- sheet: n,
3218
- movables: a,
3219
- jsonMovables: i,
3220
- resources: n.getResources()
3221
- });
3222
- t.empty("drawing", { "r:id": o.relId });
3223
- }(a, s, c, d);
3224
- let _ = function(e) {
3225
- let t = e.getComments().toArray();
3226
- if (t.length === 0) return null;
3227
- let n = [];
3228
- for (let e = 0; e < t.length; e++) {
3229
- let r = t[e], i = yt(r);
3230
- i && n.push({
3231
- comment: r,
3232
- ...i
3233
- });
3234
- }
3235
- return n.length === 0 ? null : (n.sort((e, t) => e.row - t.row || e.col - t.col), {
3236
- sheet: e,
3237
- comments: n
3238
- });
3239
- }(c);
3240
- dn(a, s, "legacyDrawing", fn(hn(d.legacyDrawing ?? null, d), _)), dn(a, s, "legacyDrawingHF", d.legacyDrawingHF ?? null), await async function(e, t, n) {
3241
- let r = n.getPicture();
3242
- if (!r) return;
3243
- let i = r.getResource(), a = await i.getExternalURI(), o;
3244
- if (a) o = e.addExternal(Et, a);
3245
- else {
3246
- let t = e.getSharedStates(), n = t.get(Dt);
3247
- n || (n = /* @__PURE__ */ new Map(), t.set(Dt, n));
3248
- let r = n.get(i);
3249
- if (!r) {
3250
- let e = await i.toBuffer();
3251
- r = {
3252
- bytes: new Uint8Array(e),
3253
- type: await i.getType() ?? Ot,
3254
- index: n.size + 1
3255
- }, n.set(i, r);
3256
- }
3257
- o = e.addBinary(r.bytes, r.type.mime, Et, `../media/image${r.index}.${r.type.ext}`, !0);
3258
- }
3259
- t.empty("picture", { "r:id": o.relId });
3260
- }(a, s, c), await async function(e, t, n) {
3261
- let r = n.movables;
3262
- if (!r || r.every(pn)) return;
3263
- let i = [], a = r.length;
3264
- for (let t = 0; t < a; t++) {
3265
- let n = r[t];
3266
- if (pn(n)) continue;
3267
- let a = n.content?.json ?? {}, o = a.part, s;
3268
- if (o) try {
3269
- s = (await Ze(o.type ? o : {
3270
- ...o,
3271
- type: mn
3272
- }, e, "../ctrlProps/ctrlProp{n}.xml"))?.relId ?? void 0;
3273
- } catch (t) {
3274
- e.log(`Unable to write the properties of the control '${n.name}'`, t);
3275
- }
3276
- s ? i.push({
3277
- jsonMovable: n,
3278
- jsonControl: a,
3279
- relId: s
3280
- }) : e.log(`The control '${n.name}' has no properties to write and was dropped.`);
3281
- }
3282
- if (i.length === 0) return;
3283
- t.start("mc:AlternateContent", {
3284
- "xmlns:x14": T,
3285
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
3286
- }), t.start("mc:Choice", { Requires: "x14" }), t.start("controls");
3287
- let o = i.length;
3288
- for (let e = 0; e < o; e++) {
3289
- let { jsonMovable: n, jsonControl: r, relId: a } = i[e];
3290
- t.start("mc:AlternateContent"), t.start("mc:Choice", { Requires: "x14" }), t.start("control", {
3291
- shapeId: r.shapeId,
3292
- "r:id": a,
3293
- name: n.name ?? void 0
3294
- });
3295
- let o = n.anchorType ?? "twoCell";
3296
- t.start("controlPr", r.props), t.start("anchor", {
3297
- moveWithCells: o === "absolute" ? void 0 : "1",
3298
- sizeWithCells: o === "twoCell" ? "1" : void 0
3299
- }), gn(t, "from", n.anchor.tl), gn(t, "to", n.anchor.br), t.end("anchor"), r.xml && t.raw(r.xml), t.end("controlPr"), t.end("control"), t.end("mc:Choice"), t.end("mc:AlternateContent");
3300
- }
3301
- t.end("controls"), t.end("mc:Choice"), t.end("mc:AlternateContent");
3302
- }(a, s, d), function(e, t, n, r) {
3303
- let i = r.tables, a = i ? i.length : 0;
3304
- if (a === 0) return;
3305
- let o = n.getTables().getItems();
3306
- t.start("tableParts", { count: a });
3307
- for (let n = 0; n < a; n++) {
3308
- let r, a, s = i[n];
3309
- Array.isArray(s) ? (a = s[0], r = s[1]) : (a = s.r, r = s.v);
3310
- let c = e.addPart("table", {
3311
- json: r,
3312
- model: o[n],
3313
- ref: a
3314
- }), l = {};
3315
- l["r:id"] = c.relId, t.empty("tablePart", l);
3316
- }
3317
- t.end("tableParts");
3318
- }(a, s, c, d), function(t, n, r, i, a) {
3319
- if (i.length === 0 && a.length === 0) return;
3320
- let o = r.getStyles(), s = o.getTheme();
3321
- if (n.start("extLst"), i.length > 0) {
3322
- n.start("ext", {
3323
- uri: e,
3324
- "xmlns:x14": T
3325
- }), n.start("x14:conditionalFormattings");
3326
- for (let e = 0; e < i.length; e++) {
3327
- let { guid: t, sqref: r, priority: a, scale: c, rule: l, style: u, stopIfTrue: d } = i[e];
3328
- if (n.start("x14:conditionalFormatting", { "xmlns:xm": v }), c) if (c.type === z.ScaleType.DataBar) {
3329
- n.start("x14:cfRule", {
3330
- type: "dataBar",
3331
- id: t
3332
- }), n.start("x14:dataBar", {
3333
- minLength: c.minLength,
3334
- maxLength: c.maxLength,
3335
- gradient: c.gradient ? void 0 : "0",
3336
- border: c.borderColor ? "1" : void 0,
3337
- direction: c.direction,
3338
- negativeBarColorSameAsPositive: c.negativeFillColor ? "0" : "1",
3339
- negativeBarBorderColorSameAsPositive: c.negativeBorderColor ? "0" : void 0,
3340
- axisPosition: c.axisPosition
3341
- });
3342
- let e = c.stops ?? [];
3343
- if (e.length === 0) $t(n, { type: z.ColorStopType.AutoMin }), $t(n, { type: z.ColorStopType.AutoMax });
3344
- else for (let t = 0; t < e.length; t++) $t(n, e[t]);
3345
- c.borderColor && q(n, s, c.borderColor, "x14:borderColor"), c.negativeFillColor && q(n, s, c.negativeFillColor, "x14:negativeFillColor"), c.negativeBorderColor && q(n, s, c.negativeBorderColor, "x14:negativeBorderColor"), c.axisColor && q(n, s, c.axisColor, "x14:axisColor"), n.end("x14:dataBar"), n.end("x14:cfRule");
3346
- } else {
3347
- n.start("x14:cfRule", {
3348
- type: "iconSet",
3349
- priority: a,
3350
- id: t
3351
- }), n.start("x14:iconSet", {
3352
- iconSet: c.iconSet,
3353
- reverse: Q(c.reverse),
3354
- showValue: Q(c.showValue),
3355
- custom: (c.icon?.length ?? 0) > 0 ? "1" : void 0
3356
- });
3357
- let e = c.stops ?? [];
3358
- for (let t = 0; t < e.length; t++) $t(n, e[t]);
3359
- let r = c.icon ?? [];
3360
- for (let e = 0; e < r.length; e++) n.empty("x14:cfIcon", {
3361
- iconSet: r[e].set,
3362
- iconId: r[e].id
3363
- });
3364
- n.end("x14:iconSet"), n.end("x14:cfRule");
3365
- }
3366
- else {
3367
- n.start("x14:cfRule", {
3368
- type: l.type,
3369
- priority: a,
3370
- stopIfTrue: Q(d),
3371
- aboveAverage: Q(l.aboveAverage),
3372
- equalAverage: Q(l.equalAverage),
3373
- stdDev: l.stdDev,
3374
- bottom: Q(l.bottom),
3375
- percent: Q(l.percent),
3376
- rank: l.rank,
3377
- operator: l.operator,
3378
- text: l.text,
3379
- timePeriod: l.timePeriod,
3380
- id: t
3381
- });
3382
- let e = l.formulas ?? [];
3383
- for (let t = 0; t < e.length; t++) n.start("xm:f"), n.text(e[t]), n.end("xm:f");
3384
- u && Object.keys(u).length > 0 && Bt(0, n, u, o, s, "x14:dxf"), n.end("x14:cfRule");
3385
- }
3386
- n.start("xm:sqref"), n.text(r), n.end("xm:sqref"), n.end("x14:conditionalFormatting");
3387
- }
3388
- n.end("x14:conditionalFormattings"), n.end("ext");
3389
- }
3390
- if (a.length > 0) {
3391
- n.start("ext", {
3392
- uri: ne,
3393
- "xmlns:x14": T
3394
- }), n.start("x14:dataValidations", {
3395
- "xmlns:xm": v,
3396
- count: a.length
3397
- });
3398
- for (let e = 0; e < a.length; e++) {
3399
- let { attrs: t, formula1: r, formula2: i, sqref: o } = a[e];
3400
- n.start("x14:dataValidation", t), r !== void 0 && (n.start("x14:formula1"), n.start("xm:f"), n.text(r), n.end("xm:f"), n.end("x14:formula1")), i !== void 0 && (n.start("x14:formula2"), n.start("xm:f"), n.text(i), n.end("xm:f"), n.end("x14:formula2")), n.start("xm:sqref"), n.text(o), n.end("xm:sqref"), n.end("x14:dataValidation");
3401
- }
3402
- n.end("x14:dataValidations"), n.end("ext");
3403
- }
3404
- n.end("extLst");
3405
- }(0, s, c, m, h), function(e, t) {
3406
- let n = t.pivotTables, r = n ? n.length : 0;
3407
- for (let t = 0; t < r; t++) {
3408
- let r = n[t], i = r.part;
3409
- i?.xml && (et(e, r.cacheId) ? e.addPart("pivotTable", r) : e.log(`The pivot table '${i.name ?? ""}' has no cache with id ${r.cacheId} and was dropped.`));
3410
- }
3411
- }(a, d), function(e, t) {
3412
- t && (e.addPart("comments", t), t.comments.some((e) => !e.comment.isNote()) && e.addPart("threadedComments", t));
3413
- }(a, _), s.end("worksheet"), s.close();
3414
- }
3415
- }(),
3416
- new class extends U {
3417
- constructor() {
3418
- super({
3419
- kind: "sharedStrings",
3420
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
3421
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings",
3422
- path: "/xl/sharedStrings.xml"
3423
- });
3424
- }
3425
- async emit(e, t) {
3426
- let i = t.getXMLWriter(), a = e.json, o = a ? a.length : 0, s = t.getSharedStates().get("stringsCount") ?? 0;
3427
- i.decl(), i.start("sst", {
3428
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3429
- count: s,
3430
- uniqueCount: o
3431
- });
3432
- for (let e = 0; e < o; e++) {
3433
- let t = a[e];
3434
- i.start("si");
3435
- let o = ie.test(t) ? n : void 0;
3436
- i.start("t", o), i.text(r(t)), i.end("t"), i.end("si");
3437
- }
3438
- i.end("sst"), i.close();
3439
- }
3440
- }(),
3441
- new class extends U {
3442
- constructor() {
3443
- super({
3444
- kind: "theme",
3445
- contentType: "application/vnd.openxmlformats-officedocument.theme+xml",
3446
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",
3447
- path: "/xl/theme/theme{n}.xml"
3448
- });
3449
- }
3450
- async emit(e, t) {
3451
- let n = t.getXMLWriter(), r = e.model, i = e.json;
3452
- n.decl(), n.pushDefaultNamespace("a"), n.start("theme", {
3453
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
3454
- name: r.getName() || "Office Theme"
3455
- }), n.start("themeElements"), function(e, t, n, r) {
3456
- let i = n?.getColorScheme();
3457
- if (i) {
3458
- t.start(r, { name: i.getName() || "Office" });
3459
- for (let e of lt) t.start(e), G(t, n, i["get" + e.charAt(0).toUpperCase() + e.slice(1)]()), t.end(e);
3460
- t.end(r);
3461
- }
3462
- }(0, n, r, "clrScheme"), function(e, t, n, r) {
3463
- n && (t.start(r, { name: n.getName() || "Office" }), Sn(e, t, n.getMajorFont() || "Calibri Light", "majorFont"), Sn(e, t, n.getMinorFont() || "Calibri", "minorFont"), t.end(r));
3464
- }(t, n, r.getFontScheme(), "fontScheme"), function(e, t, n, r, i) {
3465
- if (i?.fillStyleLst && i?.lnStyleLst && i?.effectStyleLst && i?.bgFillStyleLst) return void function(e, t, n, r, i) {
3466
- let a = { getTheme: () => r };
3467
- t.start(n, { name: "Office" }), t.start("fillStyleLst");
3468
- for (let e of i.fillStyleLst) J(0, t, e, a);
3469
- t.end("fillStyleLst"), t.start("lnStyleLst");
3470
- for (let e of i.lnStyleLst) bt(0, t, e, a);
3471
- t.end("lnStyleLst"), t.start("effectStyleLst");
3472
- for (let n of i.effectStyleLst) t.start("effectStyle"), n.length > 0 ? Ct(e, t, r, n) : t.empty("effectLst"), t.end("effectStyle");
3473
- t.end("effectStyleLst"), t.start("bgFillStyleLst");
3474
- for (let e of i.bgFillStyleLst) J(0, t, e, a);
3475
- t.end("bgFillStyleLst"), t.end(n);
3476
- }(e, t, n, r, i);
3477
- if (i?.formatSchemeXml) return void t.raw(i.formatSchemeXml);
3478
- t.start(n, { name: "Office" }), function(e, t) {
3479
- t.start("fillStyleLst"), t.start("solidFill"), t.empty("schemeClr", { val: "phClr" }), t.end("solidFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "50000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "35000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "37000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "15000" }), t.empty("satMod", { val: "350000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("lin", {
3480
- ang: "16200000",
3481
- scaled: "1"
3482
- }), t.end("gradFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "51000" }), t.empty("satMod", { val: "130000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "80000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "93000" }), t.empty("satMod", { val: "130000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "94000" }), t.empty("satMod", { val: "135000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("lin", {
3483
- ang: "16200000",
3484
- scaled: "0"
3485
- }), t.end("gradFill"), t.end("fillStyleLst");
3486
- }(0, t), function(e, t) {
3487
- t.start("lnStyleLst");
3488
- let n = [
3489
- 9525,
3490
- 25400,
3491
- 38100
3492
- ];
3493
- for (let e = 0; e < 3; e++) t.start("ln", {
3494
- w: n[e].toString(),
3495
- cap: "flat",
3496
- cmpd: "sng",
3497
- algn: "ctr"
3498
- }), t.start("solidFill"), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "95000" }), t.empty("satMod", { val: "105000" }), t.end("schemeClr"), t.end("solidFill"), t.empty("prstDash", { val: "solid" }), t.end("ln");
3499
- t.end("lnStyleLst");
3500
- }(0, t), function(e, t) {
3501
- t.start("effectStyleLst");
3502
- for (let e = 0; e < 3; e++) t.start("effectStyle"), t.start("effectLst"), e === 2 && (t.start("outerShdw", {
3503
- blurRad: "40000",
3504
- dist: "20000",
3505
- dir: "5400000",
3506
- rotWithShape: "0"
3507
- }), t.start("srgbClr", { val: "000000" }), t.empty("alpha", { val: "38000" }), t.end("srgbClr"), t.end("outerShdw")), t.end("effectLst"), t.end("effectStyle");
3508
- t.end("effectStyleLst");
3509
- }(0, t), function(e, t) {
3510
- t.start("bgFillStyleLst"), t.start("solidFill"), t.empty("schemeClr", { val: "phClr" }), t.end("solidFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "40000" }), t.empty("satMod", { val: "350000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "40000" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "45000" }), t.empty("shade", { val: "99000" }), t.empty("satMod", { val: "350000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "20000" }), t.empty("satMod", { val: "255000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("path", { path: "circle" }), t.empty("fillToRect", {
3511
- l: "50000",
3512
- t: "-80000",
3513
- r: "50000",
3514
- b: "180000"
3515
- }), t.end("gradFill"), t.start("gradFill", { rotWithShape: "1" }), t.start("gsLst"), t.start("gs", { pos: "0" }), t.start("schemeClr", { val: "phClr" }), t.empty("tint", { val: "80000" }), t.empty("satMod", { val: "300000" }), t.end("schemeClr"), t.end("gs"), t.start("gs", { pos: "100000" }), t.start("schemeClr", { val: "phClr" }), t.empty("shade", { val: "30000" }), t.empty("satMod", { val: "200000" }), t.end("schemeClr"), t.end("gs"), t.end("gsLst"), t.empty("path", { path: "circle" }), t.empty("fillToRect", {
3516
- l: "50000",
3517
- t: "50000",
3518
- r: "50000",
3519
- b: "50000"
3520
- }), t.end("gradFill"), t.end("bgFillStyleLst");
3521
- }(0, t), t.end(n);
3522
- }(t, n, "fmtScheme", r, i), n.end("themeElements"), n.start("objectDefaults"), n.end("objectDefaults"), n.start("extraClrSchemeLst"), n.end("extraClrSchemeLst"), n.end("theme"), n.close();
3523
- }
3524
- }(),
3525
- new class extends U {
3526
- constructor() {
3527
- super({
3528
- kind: "styles",
3529
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
3530
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",
3531
- path: "/xl/styles.xml"
3532
- });
3533
- }
3534
- async emit(e, t) {
3535
- let n = t.getXMLWriter(), r = e.json, i = (e.theme, e.styles);
3536
- n.decl(), n.start("styleSheet", {
3537
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3538
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3539
- "mc:Ignorable": "x14ac x16r2 xr",
3540
- "xmlns:x14ac": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac",
3541
- "xmlns:x16r2": "http://schemas.microsoft.com/office/spreadsheetml/2015/02/main",
3542
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
3543
- });
3544
- let a = function(e, t) {
3545
- let n = t?.direct;
3546
- n && n.length !== 0 || (n = [{}]);
3547
- let r = n.length, i = Array(r);
3548
- for (let t = 0; t < r; t++) {
3549
- let r = t === 0 ? {
3550
- ...n[t],
3551
- named: V.BuiltInName.Normal
3552
- } : n[t], a = e.resolve(r), o = {};
3553
- r.named !== void 0 && (o.named = r.named), r.quotePrefix !== void 0 && (o.quotePrefix = r.quotePrefix), r.protection !== void 0 && (o.protection = r.protection);
3554
- for (let e = 0; e < Mt.length; e++) {
3555
- let t = Mt[e];
3556
- if (r[t] === void 0 && t !== "alignment") continue;
3557
- let n = a?.[t] ?? r[t];
3558
- n !== void 0 && (o[t] = n);
3559
- }
3560
- i[t] = o;
3561
- }
3562
- return i;
3563
- }(i, r), o = function(e, t, n) {
3564
- let r = {
3565
- fontMap: /* @__PURE__ */ new Map(),
3566
- fonts: [],
3567
- fillMap: /* @__PURE__ */ new Map(),
3568
- fills: [],
3569
- borderMap: /* @__PURE__ */ new Map(),
3570
- borders: [],
3571
- numFmtMap: /* @__PURE__ */ new Map(),
3572
- numFmtsCustom: [],
3573
- namedStyleMap: /* @__PURE__ */ new Map(),
3574
- namedStyles: []
3575
- };
3576
- (function(e, t) {
3577
- let n = (e.getNamedStyles().getByName(V.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3578
- t.fontMap.set(F.JSONStableStringify(n), "0"), t.fonts.push(n);
3579
- })(e, r), function(e) {
3580
- let t = { type: "none" };
3581
- e.fillMap.set(F.JSONStableStringify(t), "0"), e.fills.push(t);
3582
- let n = {
3583
- type: "pattern",
3584
- patternType: "gray125"
3585
- };
3586
- e.fillMap.set(F.JSONStableStringify(n), "1"), e.fills.push(n);
3587
- }(r), function(e) {
3588
- let t = {
3589
- bottom: { style: "none" },
3590
- left: { style: "none" },
3591
- right: { style: "none" },
3592
- top: { style: "none" }
3593
- };
3594
- e.borderMap.set(F.JSONStableStringify(t), "0"), e.borders.push(t);
3595
- }(r), function(e, t) {
3596
- Pt(e, e.getNamedStyles().getByName(V.BuiltInName.Normal).toJSON(), t);
3597
- }(e, r);
3598
- let i = t?.named ?? I.EmptyArray;
3599
- for (let t of i) Pt(e, t, r);
3600
- for (let t of n) Nt(e, t, r);
3601
- return r;
3602
- }(i, r, a), s = t.getSharedStates().get(jt), c = function(e, t = 0) {
3603
- let n = e?.tables;
3604
- if (!n) return null;
3605
- let r = n.styles;
3606
- if (!r) return null;
3607
- let i = [], a = /* @__PURE__ */ new Map(), o = Object.keys(r), s = [...Ht].reverse();
3608
- for (let e of o) {
3609
- let n = r[e];
3610
- for (let r of s) {
3611
- let o = n[r];
3612
- if (!o) continue;
3613
- let s = {};
3614
- if (o.font && (s.font = o.font), o.fill && (s.fill = o.fill), o.borders && (s.borders = o.borders), o.numberFormat !== void 0 && (s.numberFormat = o.numberFormat), Object.keys(s).length === 0) continue;
3615
- let c = t + i.length;
3616
- i.push(s);
3617
- let l = `${e}:${r}`;
3618
- a.set(l, c);
3619
- }
3620
- }
3621
- return {
3622
- dxfs: i,
3623
- dxfIndexMap: a
3624
- };
3625
- }(r, s?.getCount() ?? 0);
3626
- (function(e, t, n) {
3627
- let r = n.numFmtsCustom, i = r.length;
3628
- if (i !== 0) {
3629
- t.start("numFmts", { count: String(i) });
3630
- for (let e = 0; e < i; e++) {
3631
- let n = r[e];
3632
- t.empty("numFmt", {
3633
- numFmtId: String(e + Vt),
3634
- formatCode: n
3635
- });
3636
- }
3637
- t.end("numFmts");
3638
- }
3639
- })(0, n, o), function(e, t, n, r) {
3640
- let i = r.fonts, a = i.length;
3641
- t.start("fonts", {
3642
- count: String(a),
3643
- "x14ac:knownFonts": "1"
3644
- });
3645
- for (let r of i) Ft(e, t, r, n);
3646
- t.end("fonts");
3647
- }(t, n, i, o), function(e, t, n, r) {
3648
- let i = r.fills, a = i.length;
3649
- t.start("fills", { count: String(a) });
3650
- for (let e of i) J(0, t, e, n, !0);
3651
- t.end("fills");
3652
- }(0, n, i, o), function(e, t, n, r) {
3653
- let i = r.borders, a = i.length;
3654
- t.start("borders", { count: String(a) });
3655
- let o = n.getTheme();
3656
- for (let n of i) Lt(e, t, n, o, !1);
3657
- t.end("borders");
3658
- }(t, n, i, o), function(e, t, n, r, i) {
3659
- let a = i.namedStyles, o = a.length;
3660
- t.start("cellStyleXfs", { count: String(o) });
3661
- for (let r of a) zt(e, t, n, r.style ?? I.EmptyObject, i, !1);
3662
- t.end("cellStyleXfs");
3663
- }(t, n, i, 0, o), function(e, t, n, r, i, a) {
3664
- let o = r.length, s = a?.getSources() ?? [];
3665
- t.start("cellXfs", { count: String(o + s.length) });
3666
- for (let a = 0; a < o; a++) zt(e, t, n, r[a], i, !0);
3667
- for (let a = 0; a < s.length; a++) zt(e, t, n, r[s[a]], i, !0, !0);
3668
- t.end("cellXfs");
3669
- }(t, n, i, a, o, t.getSharedStates().get(We)), function(e, t, n, r, i) {
3670
- let a = i.namedStyles, o = a.length;
3671
- t.start("cellStyles", { count: String(o) });
3672
- let s = i.namedStyleMap;
3673
- for (let e = 0; e < o; e++) {
3674
- let r = a[e], i = r.name, o = i.toLowerCase(), c = {
3675
- name: i,
3676
- xfId: s.get(o)
3677
- };
3678
- r.hidden && (c.hidden = "1"), r.iLevel && (c.iLevel = String(r.iLevel));
3679
- let l = null;
3680
- l = o === V.BuiltInName.Normal.toLowerCase() ? 0 : n.getNamedStyles().getByName(i).getBuiltInID(), l !== null && (c.builtinId = String(l), c.customBuiltin = "1"), t.empty("cellStyle", c);
3681
- }
3682
- t.end("cellStyles");
3683
- }(0, n, i, 0, o), function(e, t, n, r, i) {
3684
- let a = [...i?.getDxfs() ?? [], ...r?.dxfs ?? []];
3685
- if (a.length === 0) return void t.empty("dxfs", { count: "0" });
3686
- let o = n.getTheme();
3687
- t.start("dxfs", { count: String(a.length) });
3688
- let s = Vt;
3689
- for (let r of a) s = Bt(e, t, r, n, o, "dxf", s);
3690
- t.end("dxfs");
3691
- }(t, n, i, c, s), function(e, t, n, r, i) {
3692
- let a = r?.tables, o = a?.styles ?? null, s = o ? Object.keys(o) : null, c = s ? s.length : 0, l = {
3693
- count: String(c),
3694
- defaultTableStyle: a?.defaultTableStyle ?? "TableStyleMedium2",
3695
- defaultPivotStyle: a?.defaultPivotStyle ?? "PivotStyleLight16"
3696
- };
3697
- if (c === 0) return void t.empty("tableStyles", l);
3698
- t.start("tableStyles", l);
3699
- for (let e of s) {
3700
- let n = o[e], r = [];
3701
- for (let e of Ht) {
3702
- let t = n[e];
3703
- t && r.push([e, t]);
3704
- }
3705
- let a = {
3706
- name: e,
3707
- pivot: n.pivot ? "1" : "0",
3708
- count: String(r.length)
3709
- };
3710
- t.start("tableStyle", a);
3711
- for (let [n, a] of r) {
3712
- let r = `${e}:${n}`, o = i?.dxfIndexMap.get(r) ?? "0", s = {};
3713
- s.type = n, a.size !== void 0 && (s.size = String(a.size)), s.dxfId = String(o), t.empty("tableStyleElement", s);
3714
- }
3715
- t.end("tableStyle");
3716
- }
3717
- t.end("tableStyles");
3718
- }(0, n, 0, r, c), function(e, t, n, r) {
3719
- let i = r?.indexedColors && r.indexedColors.length > 0, a = r?.mruColors && r.mruColors.length > 0;
3720
- if (!(!i && !a)) {
3721
- if (t.start("colors"), i) {
3722
- t.start("indexedColors");
3723
- for (let e of r.indexedColors) {
3724
- let n = ht(e, !0);
3725
- t.empty("rgbColor", { rgb: n });
3726
- }
3727
- t.end("indexedColors");
3728
- }
3729
- if (a) {
3730
- t.start("mruColors");
3731
- for (let e of r.mruColors) {
3732
- let n = ht(e);
3733
- t.empty("color", { rgb: n });
3734
- }
3735
- t.end("mruColors");
3736
- }
3737
- t.end("colors");
3738
- }
3739
- }(0, n, 0, r), function(e, t) {
3740
- t.start("extLst"), t.start("ext", {
3741
- uri: "{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}",
3742
- "xmlns:x14": "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
3743
- }), t.empty("x14:slicerStyles", { defaultSlicerStyle: "SlicerStyleLight1" }), t.end("ext"), t.start("ext", {
3744
- uri: "{9260A510-F301-46a8-8635-F512D64BE5F5}",
3745
- "xmlns:x15": "http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"
3746
- }), t.empty("x15:timelineStyles", { defaultTimelineStyle: "TimeSlicerStyleLight1" }), t.end("ext"), t.end("extLst");
3747
- }(0, n), n.end("styleSheet"), n.close();
3748
- }
3749
- }(),
3750
- new class extends U {
3751
- constructor() {
3752
- super({
3753
- kind: "propsCore",
3754
- contentType: "application/vnd.openxmlformats-package.core-properties+xml",
3755
- relTypeUri: "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",
3756
- path: "/docProps/core.xml"
3757
- });
3758
- }
3759
- async emit(e, t) {
3760
- let n = t.getXMLWriter();
3761
- n.decl(), n.start("cp:coreProperties", {
3762
- "xmlns:cp": "http://schemas.openxmlformats.org/package/2006/metadata/core-properties",
3763
- "xmlns:dc": "http://purl.org/dc/elements/1.1/",
3764
- "xmlns:dcterms": "http://purl.org/dc/terms/",
3765
- "xmlns:dcmitype": "http://purl.org/dc/dcmitype/",
3766
- "xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
3767
- });
3768
- let r = /* @__PURE__ */ new Date(), i = [
3769
- ["creator", "SheetXL"],
3770
- ["lastModifiedBy", "SheetXL"],
3771
- ["created", Cn(r)],
3772
- ["modified", Cn(r)]
3773
- ];
3774
- for (let e of i) wn(n, e[0], e[1]);
3775
- n.end("cp:coreProperties"), n.close();
3776
- }
3777
- }(),
3778
- new class extends U {
3779
- constructor() {
3780
- super({
3781
- kind: "propsApp",
3782
- contentType: "application/vnd.openxmlformats-officedocument.extended-properties+xml",
3783
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",
3784
- path: "/docProps/app.xml"
3785
- });
3786
- }
3787
- async emit(e, t) {
3788
- let n = t.getXMLWriter(), r = e.model, i = await fe.getDetails(), a = j(i.getBuildVersion()), o = i.getLicensee() || "";
3789
- n.setValidationDisabled(!0), n.decl(), n.start("Properties", {
3790
- xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
3791
- "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
3792
- }), $(t, n, "Application", "SheetXL"), $(t, n, "DocSecurity", "0"), $(t, n, "ScaleCrop", "false"), Tn(t, n, r), $(t, n, "Company", o), $(t, n, "LinksUpToDate", "false"), $(t, n, "SharedDoc", "false"), $(t, n, "HyperlinksChanged", "false"), $(t, n, "AppVersion", a), n.end("Properties"), n.close();
3793
- }
3794
- }(),
3795
- new class extends U {
3796
- constructor() {
3797
- super({
3798
- kind: "metadata",
3799
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",
3800
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata",
3801
- path: "/xl/metadata.xml"
3802
- });
3803
- }
3804
- emit(e, t) {
3805
- let n = t.getXMLWriter(), r = e.hasCellMeta(), i = e.hasValueMeta(), a = e.getDAPRFutureMetadataBlocks(), o = e.getRVFutureMetadataBlocks(), s = e.getValueMeta(), c = 0, l = 0, u = 0;
3806
- r && (c = ++u), i && (l = ++u);
3807
- let d = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
3808
- if (r && (d["xmlns:xda"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"), i && (d["xmlns:xlrd"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"), n.decl(), n.start("metadata", d), n.start("metadataTypes", { count: u }), r && n.empty("metadataType", {
3809
- name: "XLDAPR",
3810
- ...En,
3811
- cellMeta: "1"
3812
- }), i && n.empty("metadataType", {
3813
- name: "XLRICHVALUE",
3814
- ...En
3815
- }), n.end("metadataTypes"), r) {
3816
- n.start("futureMetadata", {
3817
- name: "XLDAPR",
3818
- count: a.length
3819
- });
3820
- for (let e of a) n.start("bk"), n.start("extLst"), n.start("ext", { uri: "{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}" }), n.empty("xda:dynamicArrayProperties", {
3821
- fDynamic: e.fDynamic,
3822
- fCollapsed: e.fCollapsed
3823
- }), n.end("ext"), n.end("extLst"), n.end("bk");
3824
- n.end("futureMetadata");
3825
- }
3826
- if (i) {
3827
- n.start("futureMetadata", {
3828
- name: "XLRICHVALUE",
3829
- count: o.length
3830
- });
3831
- for (let e of o) n.start("bk"), n.start("extLst"), n.start("ext", { uri: "{3e2802c4-a4d2-4d8b-9148-e3be6c30e623}" }), n.empty("xlrd:rvb", { i: e }), n.end("ext"), n.end("extLst"), n.end("bk");
3832
- n.end("futureMetadata");
3833
- }
3834
- if (r) {
3835
- n.start("cellMetadata", { count: a.length });
3836
- for (let e = 0; e < a.length; e++) n.start("bk"), n.empty("rc", {
3837
- t: c,
3838
- v: e
3839
- }), n.end("bk");
3840
- n.end("cellMetadata");
3841
- }
3842
- if (i) {
3843
- n.start("valueMetadata", { count: s.length });
3844
- for (let e of s) n.start("bk"), n.empty("rc", {
3845
- t: l,
3846
- v: e
3847
- }), n.end("bk");
3848
- n.end("valueMetadata");
3849
- }
3850
- n.end("metadata"), n.close();
3851
- }
3852
- }(),
3853
- new class extends U {
3854
- constructor() {
3855
- super({
3856
- kind: "richValue",
3857
- contentType: "application/vnd.ms-excel.rdrichvalue+xml",
3858
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValue",
3859
- path: "./richData/rdrichvalue.xml"
3860
- });
3861
- }
3862
- async emit(e, t) {
3863
- let n = t.getXMLWriter(), r = e.getEntries(), i = r.length;
3864
- n.decl(), n.start("rvData", {
3865
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3866
- count: i
3867
- });
3868
- for (let t of r) {
3869
- let r = e.handlerStructureIndex(t.handler);
3870
- n.start("rv", { s: r });
3871
- let i = t.handler.getValues(t.rawValue);
3872
- for (let e of i) n.start("v"), n.text(e), n.end("v");
3873
- n.end("rv");
3874
- }
3875
- n.end("rvData"), n.close();
3876
- }
3877
- }(),
3878
- new class extends U {
3879
- constructor() {
3880
- super({
3881
- kind: "richValueStructure",
3882
- contentType: "application/vnd.ms-excel.rdrichvaluestructure+xml",
3883
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueStructure",
3884
- path: "./richData/rdrichvaluestructure.xml"
3885
- });
3886
- }
3887
- async emit(e, t) {
3888
- let n = t.getXMLWriter(), r = e.uniqueHandlers(), i = r.length;
3889
- n.decl(), n.start("rvStructures", {
3890
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata",
3891
- count: i
3892
- });
3893
- for (let e of r) {
3894
- n.start("s", { t: e.type });
3895
- for (let [t, r] of e.props) n.empty("k", {
3896
- n: t,
3897
- t: r
3898
- });
3899
- n.end("s");
3900
- }
3901
- n.end("rvStructures"), n.close();
3902
- }
3903
- }(),
3904
- new class extends U {
3905
- constructor() {
3906
- super({
3907
- kind: "richValueTypes",
3908
- contentType: "application/vnd.ms-excel.rdrichvaluetypes+xml",
3909
- relTypeUri: "http://schemas.microsoft.com/office/2017/06/relationships/rdRichValueTypes",
3910
- path: "./richData/rdRichValueTypes.xml"
3911
- });
3912
- }
3913
- async emit(e, t) {
3914
- let n = t.getXMLWriter();
3915
- n.decl(), n.start("rvTypesInfo", {
3916
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata2",
3917
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
3918
- "mc:Ignorable": "x",
3919
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
3920
- });
3921
- let r = [
3922
- ["_self", ["ExcludeFromFile", "ExcludeFromCalcComparison"]],
3923
- ["_DisplayString", ["ExcludeFromCalcComparison"]],
3924
- ["_Flags", ["ExcludeFromCalcComparison"]],
3925
- ["_Format", ["ExcludeFromCalcComparison"]],
3926
- ["_SubLabel", ["ExcludeFromCalcComparison"]],
3927
- ["_Attribution", ["ExcludeFromCalcComparison"]],
3928
- ["_Icons", ["ExcludeFromCalcComparison"]],
3929
- ["_Display", ["ExcludeFromCalcComparison"]],
3930
- ["_CanonicalPropertyNames", ["ExcludeFromCalcComparison"]],
3931
- ["_ClassificationId", ["ExcludeFromCalcComparison"]]
3932
- ];
3933
- n.start("global"), n.start("keyFlags");
3934
- for (let [e, t] of r) {
3935
- n.start("key", { name: e });
3936
- for (let e of t) n.empty("flag", {
3937
- name: e,
3938
- value: "1"
3939
- });
3940
- n.end("key");
3941
- }
3942
- n.end("keyFlags"), n.end("global"), n.end("rvTypesInfo"), n.close();
3943
- }
3944
- }(),
3945
- new class extends U {
3946
- constructor() {
3947
- super({
3948
- kind: "drawing",
3949
- contentType: "application/vnd.openxmlformats-officedocument.drawing+xml",
3950
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
3951
- path: "../drawings/drawing{n}.xml"
3952
- });
3953
- }
3954
- async emit(e, t) {
3955
- let n = t.getXMLWriter();
3956
- n.decl(), n.pushDefaultNamespace("xdr"), n.start("wsDr", {
3957
- "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
3958
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
3959
- });
3960
- let r = /* @__PURE__ */ new Map(), i = e.sheet, a = e.movables, o = e.jsonMovables, s = o ? o.length : 0, c = 0;
3961
- for (let e = 0; e < s; e++) {
3962
- let t = o[e].content?.json?.sourceId;
3963
- typeof t == "number" && t > c && (c = t);
3964
- }
3965
- let l = /* @__PURE__ */ new Map(), u;
3966
- if (c > 0) {
3967
- let e = t.getSharedStates();
3968
- u = e.get("uniqueIdCounter"), u || (u = /* @__PURE__ */ new Map(), e.set("uniqueIdCounter", u)), u.set(i, Math.max(u.get(i) ?? 1, c));
3969
- let n = /* @__PURE__ */ new Set();
3970
- for (let e = 0; e < s; e++) {
3971
- let t = o[e].content?.json?.sourceId;
3972
- if (typeof t == "number") if (n.has(t)) {
3973
- let t = u.get(i) + 1;
3974
- u.set(i, t), l.set(o[e], t);
3975
- } else n.add(t);
3976
- }
3977
- }
3978
- for (let e = 0; e < s; e++) {
3979
- let s = o[e], c = a[e], u = s.content?.type;
3980
- switch (n.start("twoCellAnchor", { editAs: s.anchorType || "twoCell" }), Kn(n, "from", s.anchor.tl), Kn(n, "to", s.anchor.br), u) {
3981
- case "picture":
3982
- await Nn(t, i, r, c, s);
3983
- break;
3984
- case "chart":
3985
- await Pn(t, i, r, c, s, l.get(s));
3986
- break;
3987
- case "shape":
3988
- await Rn(t, i, r, c, s, l.get(s));
3989
- break;
3990
- case "smartArt":
3991
- await Fn(t, i, r, c, s);
3992
- break;
3993
- case "slicer":
3994
- await In(t, i, r, c, s);
3995
- break;
3996
- case "graphicFrame":
3997
- await Ln(t, i, r, c, s);
3998
- break;
3999
- default: await zn(t, i, r, c, s);
4000
- }
4001
- n.empty("clientData"), n.end("twoCellAnchor");
4002
- }
4003
- n.end("wsDr"), n.close();
4004
- }
4005
- }(),
4006
- new class extends U {
4007
- constructor() {
4008
- super({
4009
- kind: "legacyDrawing",
4010
- contentType: "application/vnd.openxmlformats-officedocument.vmlDrawing",
4011
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
4012
- path: "../drawings/vmlDrawing{n}.vml"
4013
- });
4014
- }
4015
- async emit(e, t) {
4016
- let n = e.images, r = n ? n.length : 0;
4017
- if (r > 0) {
4018
- let e = t.getSharedStates().get(he);
4019
- for (let i = 0; i < r; i++) {
4020
- let r = n[i], a = e?.get(r.resId);
4021
- if (a) try {
4022
- await qn(t, r.id, a);
4023
- } catch (e) {
4024
- t.log(`Unable to write legacy drawing image '${r.id}'`, e);
4025
- }
4026
- else t.log(`Legacy drawing image '${r.id}' has no resource ${r.resId} and was not written.`);
4027
- }
4028
- }
4029
- let i = t.getXMLWriter();
4030
- i.setValidationDisabled(!0), i.raw(e.xml), i.close();
4031
- }
4032
- }(),
4033
- new class extends U {
4034
- constructor() {
4035
- super({
4036
- kind: "embeddedPart",
4037
- contentType: Ye,
4038
- relTypeUri: ""
4039
- });
4040
- }
4041
- getContentType(e) {
4042
- return e?.contentType || Ye;
4043
- }
4044
- getRelTypeUri(e) {
4045
- return e?.type ?? "";
4046
- }
4047
- getPath(e) {
4048
- return `./${Qe(e.name)}`;
4049
- }
4050
- async emit(e, t) {
4051
- await Xe(e, t);
4052
- let n = t.getXMLWriter();
4053
- n.setValidationDisabled(!0), n.raw(e.xml ?? ""), n.close();
4054
- }
4055
- }(),
4056
- new class extends U {
4057
- constructor() {
4058
- super({
4059
- kind: "pivotTable",
4060
- contentType: $e,
4061
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
4062
- path: "../pivotTables/pivotTable{n}.xml"
4063
- });
4064
- }
4065
- getContentType(e) {
4066
- return e?.part?.contentType || $e;
4067
- }
4068
- async emit(e, t) {
4069
- let n = e.part;
4070
- await Xe(n, t);
4071
- let r = et(t, e.cacheId);
4072
- if (!r || !t.addRelationship("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition", r)) throw Error(`Pivot table '${n.name ?? ""}' has no cache with id ${e.cacheId}.`);
4073
- let i = t.getXMLWriter();
4074
- i.setValidationDisabled(!0), i.raw(n.xml ?? ""), i.close();
4075
- }
4076
- }(),
4077
- new class extends U {
4078
- constructor() {
4079
- super({
4080
- kind: "comments",
4081
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
4082
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",
4083
- path: "../comments{n}.xml"
4084
- });
4085
- }
4086
- async emit(e, t) {
4087
- let n = t.getXMLWriter();
4088
- n.decl(), n.start("comments", {
4089
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
4090
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4091
- "mc:Ignorable": "xr",
4092
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision"
4093
- });
4094
- let r = [], i = /* @__PURE__ */ new Map(), a = (e) => {
4095
- let t = i.get(e);
4096
- return t === void 0 && (t = r.length, r.push(e), i.set(e, t)), t;
4097
- }, o = e.comments, s = [];
4098
- for (let e = 0; e < o.length; e++) {
4099
- let { comment: t, ref: n } = o[e];
4100
- t.isNote() ? s.push({
4101
- ref: n,
4102
- authorId: a(t.getAuthor()?.getDisplayName() ?? ""),
4103
- content: t.getRichContent() ?? t.getContent()
4104
- }) : s.push({
4105
- ref: n,
4106
- authorId: a(`tc={${t.getId().toUpperCase()}}`),
4107
- content: gt(t)
4108
- });
4109
- }
4110
- n.start("authors");
4111
- for (let e = 0; e < r.length; e++) n.start("author"), n.text(r[e]), n.end("author");
4112
- n.end("authors"), n.start("commentList");
4113
- for (let e = 0; e < s.length; e++) {
4114
- let t = s[e];
4115
- n.start("comment", {
4116
- ref: t.ref,
4117
- authorId: t.authorId,
4118
- shapeId: 0
4119
- }), n.start("text"), _t(n, t.content), n.end("text"), n.end("comment");
4120
- }
4121
- n.end("commentList"), n.end("comments"), n.close();
4122
- }
4123
- }(),
4124
- new class extends U {
4125
- constructor() {
4126
- super({
4127
- kind: "threadedComments",
4128
- contentType: "application/vnd.ms-excel.threadedcomments+xml",
4129
- relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment",
4130
- path: "../threadedComments/threadedComment{n}.xml"
4131
- });
4132
- }
4133
- async emit(e, t) {
4134
- let n = t.getXMLWriter();
4135
- n.decl(), n.start("ThreadedComments", {
4136
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4137
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4138
- });
4139
- let r = e.comments;
4140
- for (let e = 0; e < r.length; e++) {
4141
- let { comment: t, ref: i } = r[e];
4142
- if (t.isNote()) continue;
4143
- Jn(n, i, t.getId(), t.getAuthor()?.getId(), t.getCreationDate(), t.getContent(), null, t.isResolved());
4144
- let a = t.getReplies();
4145
- for (let e = 0; e < a.length; e++) {
4146
- let r = a[e];
4147
- Jn(n, i, r.getId(), r.getAuthor()?.getId(), r.getCreationDate(), r.getContent(), t.getId(), !1);
4148
- }
4149
- }
4150
- n.end("ThreadedComments"), n.close();
4151
- }
4152
- }(),
4153
- new class extends U {
4154
- constructor() {
4155
- super({
4156
- kind: "persons",
4157
- contentType: "application/vnd.ms-excel.person+xml",
4158
- relTypeUri: "http://schemas.microsoft.com/office/2017/10/relationships/person",
4159
- path: "persons/person.xml"
4160
- });
4161
- }
4162
- async emit(e, t) {
4163
- let n = t.getXMLWriter();
4164
- n.decl(), n.start("personList", {
4165
- xmlns: "http://schemas.microsoft.com/office/spreadsheetml/2018/threadedcomments",
4166
- "xmlns:x": "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
4167
- });
4168
- let r = e.toArray();
4169
- for (let e = 0; e < r.length; e++) {
4170
- let t = r[e];
4171
- n.empty("person", {
4172
- displayName: t.getDisplayName(),
4173
- id: Yn(t.getId()),
4174
- userId: t.getUserId() ?? t.getDisplayName(),
4175
- providerId: t.getProviderId() ?? "None"
4176
- });
4177
- }
4178
- n.end("personList"), n.close();
4179
- }
4180
- }(),
4181
- new class extends U {
4182
- constructor() {
4183
- super({
4184
- kind: "table",
4185
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",
4186
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",
4187
- path: "../tables/table{n}.xml"
4188
- });
4189
- }
4190
- async emit(e, t) {
4191
- let n = t.getXMLWriter();
4192
- n.decl();
4193
- let r = {
4194
- xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
4195
- "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
4196
- "mc:Ignorable": "xr xr3",
4197
- "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
4198
- "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"
4199
- }, i = e.json, a = e.model;
4200
- a.isShowHeaders(), r.id = ++Xn, r.name = i.name?.trim(), r.displayName = i.description ?? i.name, r.ref = e.ref, i.headerRowCount !== 1 && (r.headerRowCount = i.headerRowCount), i.totalsRowCount !== 0 && (r.totalsRowCount = i.totalsRowCount), i.totalsRowShown || a.isShowTotals() || (r.totalsRowShown = "0"), n.start("table", r), a.isShowHeaders() && Gt(t, n, a, i), Zn(t, n, a, i), $n(t, n, a, i), n.end("table"), n.close();
4201
- }
4202
- }(),
4203
- new class extends U {
4204
- constructor() {
4205
- super({
4206
- kind: "externalLink",
4207
- contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml",
4208
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink",
4209
- path: "../externalLinks/externalLink{n}.xml"
4210
- });
4211
- }
4212
- async emit(e, t) {
4213
- let n = t.getXMLWriter(), r = e.sources ?? [], i = r.findIndex((e) => e.role === "book");
4214
- i < 0 && r.length > 0 && (i = 0);
4215
- let a = null, o = null;
4216
- for (let e = 0; e < r.length; e++) {
4217
- let n = r[e], s = t.addExternal(n.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath", n.target).relId;
4218
- e === i ? a = s : n.role === "absoluteUrl" && (o = s);
4219
- }
4220
- a || t.log("External book has no path relationship; Excel cannot locate its source.", e.sheetNames), n.decl();
4221
- let s = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
4222
- (e.mceIgnorable || o) && (s["xmlns:mc"] = "http://schemas.openxmlformats.org/markup-compatibility/2006", s["mc:Ignorable"] = "x14 xxl21", s["xmlns:x14"] = "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main", s["xmlns:xxl21"] = "http://schemas.microsoft.com/office/spreadsheetml/2021/extlinks2021"), n.start("externalLink", s);
4223
- let c = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
4224
- a && (c["r:id"] = a), n.start("externalBook", c), o && (n.start("xxl21:alternateUrls"), n.empty("xxl21:absoluteUrl", { "r:id": o }), n.end("xxl21:alternateUrls")), function(e, t) {
4225
- let n = t.sheetNames, r = n ? n.length : 0;
4226
- if (r !== 0) {
4227
- e.start("sheetNames");
4228
- for (let t = 0; t < r; t++) e.empty("sheetName", { val: n[t] });
4229
- e.end("sheetNames");
4230
- }
4231
- }(n, e), function(e, t) {
4232
- let n = t.definedNames, r = n ? n.length : 0;
4233
- if (r !== 0) {
4234
- e.start("definedNames");
4235
- for (let t = 0; t < r; t++) {
4236
- let r = n[t], i = {
4237
- name: r.name,
4238
- refersTo: r.refersTo
4239
- };
4240
- r.sheetIndex !== void 0 && (i.sheetId = "" + r.sheetIndex), e.empty("definedName", i);
4241
- }
4242
- e.end("definedNames");
4243
- }
4244
- }(n, e), function(e, t) {
4245
- let n = t.sheetDataSet, r = n ? n.length : 0;
4246
- if (r !== 0) {
4247
- e.start("sheetDataSet");
4248
- for (let t = 0; t < r; t++) {
4249
- let r = n[t], i = { sheetId: "" + r.sheetIndex };
4250
- r.refreshError && (i.refreshError = "1");
4251
- let a = r.data, o = a ? a.length : 0;
4252
- if (o !== 0) {
4253
- e.start("sheetData", i);
4254
- for (let t = 0; t < o; t++) {
4255
- let [n, r] = a[t];
4256
- e.start("row", { r: "" + (n + 1) });
4257
- let i = r.length;
4258
- for (let t = 0; t < i; t++) {
4259
- let [i, a] = r[t], o = a.length;
4260
- for (let t = 0; t < o; t++) nr(e, n, i + t, a.at(t));
4261
- }
4262
- e.end("row");
4263
- }
4264
- e.end("sheetData");
4265
- } else e.empty("sheetData", i);
4266
- }
4267
- e.end("sheetDataSet");
4268
- }
4269
- }(n, e), n.end("externalBook"), n.end("externalLink"), n.close();
4270
- }
4271
- }(),
4272
- new class extends U {
4273
- constructor() {
4274
- super({
4275
- kind: "chart",
4276
- contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
4277
- relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
4278
- path: "../charts/chart{n}.xml"
4279
- });
4280
- }
4281
- async emit(e, t) {
4282
- let n = t.getXMLWriter();
4283
- n.decl(), n.pushDefaultNamespace("c"), n.start("chartSpace", {
4284
- "xmlns:c": "http://schemas.openxmlformats.org/drawingml/2006/chart",
4285
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4286
- "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
4287
- "xmlns:c16r2": "http://schemas.microsoft.com/office/drawing/2015/06/chart"
4288
- }), n.empty("date1904", { val: "0" }), n.empty("lang", { val: "en-US" }), n.empty("roundedCorners", { val: "0" }), rr(t, n, e.model, e.json), ir(t, n, e.styles, e.model, e.json), ar(t, n, e.model, e.json), n.end("chartSpace"), n.popDefaultNamespace(), n.close(), t.addPart("chartStyle", { styles: e.styles }), t.addPart("chartColors", { styles: e.styles });
4289
- }
4290
- }(),
4291
- new class extends U {
4292
- constructor() {
4293
- super({
4294
- kind: "chartStyle",
4295
- contentType: "application/vnd.ms-office.chartstyle+xml",
4296
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartStyle",
4297
- path: "./style{n}.xml"
4298
- });
4299
- }
4300
- async emit(e, t) {
4301
- let n = t.getXMLWriter();
4302
- n.pushDefaultNamespace("cs"), n.start("chartStyle", {
4303
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
4304
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4305
- id: "297"
4306
- }), sr(t, n, cr, e.styles), n.end("chartStyle"), n.close();
4307
- }
4308
- }(),
4309
- new class extends U {
4310
- constructor() {
4311
- super({
4312
- kind: "chartColors",
4313
- contentType: "application/vnd.ms-office.chartcolorstyle+xml",
4314
- relTypeUri: "http://schemas.microsoft.com/office/2011/relationships/chartColorStyle",
4315
- path: "./colors{n}.xml"
4316
- });
4317
- }
4318
- async emit(e, t) {
4319
- let n = t.getXMLWriter();
4320
- n.pushDefaultNamespace("cs"), n.start("cs:colorStyle", {
4321
- "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
4322
- "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4323
- meth: "cycle",
4324
- id: "10"
4325
- }), n.empty("a:schemeClr", { val: "accent1" }), n.empty("a:schemeClr", { val: "accent2" }), n.empty("a:schemeClr", { val: "accent3" }), n.empty("a:schemeClr", { val: "accent4" }), n.empty("a:schemeClr", { val: "accent5" }), n.empty("a:schemeClr", { val: "accent6" }), lr(t, n, ur), n.end("cs:colorStyle"), n.close();
4326
- }
4327
- }()
4328
- ], fr = (e) => {
4329
- let t = e.getPart("xl/_rels/workbook.xml.rels");
4330
- if (!t) return null;
4331
- let n = /* @__PURE__ */ new Map();
4332
- for (let e of f(t.data)) {
4333
- if (!e.id) continue;
4334
- let t = e.external ? e.target : we(e.target.startsWith("/") ? e.target : "xl/" + e.target);
4335
- n.set(e.id, {
4336
- type: e.type,
4337
- target: t,
4338
- external: e.external
4339
- });
4340
- }
4341
- return n;
4342
- }, pr = (e) => {
4343
- let t = e.getPart("xl/workbook.xml");
4344
- return t ? new TextDecoder("utf-8").decode(t.data) : null;
4345
- }, mr = (e) => {
4346
- let t = hr.get(e);
4347
- if (t !== void 0) return t;
4348
- let n = e.getPart("xl/workbook.xml"), r = n ? new TextDecoder("utf-8").decode(n.data) : null;
4349
- return hr.set(e, r), r;
4350
- }, hr = /* @__PURE__ */ new WeakMap(), gr = async (e, t) => {
4351
- let n = new He();
4352
- for (let e of dr) n.register(e);
4353
- let r = _r, i = ge.createUint8Array({
4354
- lastModDate: new Date(1899, 11, 29, 19, 0, 0),
4355
- level: r
4356
- }), a = t?.format === "Excel" || t?.format === "ExcelMacro" ? s(e) : null, o = /* @__PURE__ */ new Map(), c = a ? ((e) => {
4357
- let t = e.getPart("xl/workbook.xml");
4358
- if (!t) return null;
4359
- let n = new TextDecoder("utf-8").decode(t.data.subarray(0, 4096)).match(/<fileVersion\b([^>]*)\/?>/);
4360
- if (!n) return null;
4361
- let r = {};
4362
- for (let e of n[1].matchAll(/([\w:]+)="([^"]*)"/g)) r[e[1]] = e[2];
4363
- return Object.keys(r).length > 0 ? r : null;
4364
- })(a) : null;
4365
- c && (t?.macroEnabled || delete c.codeName, o.set(nt, c));
4366
- let l = a ? ((e) => {
4367
- let t = mr(e)?.match(/<calcPr\b[^>]*?\bcalcId="([^"]*)"/);
4368
- return t ? t[1] : null;
4369
- })(a) : null;
4370
- l !== null && o.set("calcId", l);
4371
- let u = a ? ((e) => {
4372
- let t = mr(e)?.match(/<ext\b[^>]*>\s*<xcalcf:calcFeatures\b[\s\S]*?<\/xcalcf:calcFeatures>\s*<\/ext>/);
4373
- return t ? t[0] : null;
4374
- })(a) : null;
4375
- u !== null && o.set("calcFeatures", u);
4376
- let d = a ? ((e) => {
4377
- let t = pr(e);
4378
- if (!t) return null;
4379
- let n = /<externalReferences\b[^>]*>([\s\S]*?)<\/externalReferences>/.exec(t);
4380
- if (!n) return null;
4381
- let r = [...n[1].matchAll(/<externalReference\b[^>]*\sr:id="([^"]*)"/g)].map((e) => e[1]);
4382
- if (r.length === 0) return null;
4383
- let i = fr(e);
4384
- return i ? r.map((e) => {
4385
- let t = i.get(e);
4386
- return t && !t.external ? t.target : null;
4387
- }) : null;
4388
- })(a) : null;
4389
- d && o.set(it, d);
4390
- let f = a ? ((e) => {
4391
- let t = pr(e), n = t ? fr(e) : null;
4392
- if (!t || !n) return null;
4393
- let r = /* @__PURE__ */ new Map();
4394
- for (let e of t.matchAll(/<sheet\b([^>]*)\/?>/g)) {
4395
- let t = /\bsheetId="(\d+)"/.exec(e[1])?.[1], i = /\br:id="([^"]*)"/.exec(e[1])?.[1];
4396
- if (!t || !i) continue;
4397
- let a = n.get(i);
4398
- a && !a.external && a.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" && r.set(parseInt(t, 10), a.target);
4399
- }
4400
- return r.size > 0 ? r : null;
4401
- })(a) : null;
4402
- f && o.set(rt, f), o.set(he, /* @__PURE__ */ new Map());
4403
- let p = [], m = new Be(i, n, {
4404
- strictDuplicateChildren: !0,
4405
- onPartEmitted: t?.onPartEmitted,
4406
- onWarning: (e, t, n) => {
4407
- p.push([
4408
- e,
4409
- t,
4410
- n
4411
- ]);
4412
- },
4413
- mapState: o,
4414
- sourcePackage: a,
4415
- macroEnabled: t?.macroEnabled ?? !1
4416
- });
4417
- m.addPart("workbook", e, "/xl/workbook.xml"), await m.waitEmit(), m.addPart("propsCore", {}), m.addPart("propsApp", { model: e });
4418
- let h = await m.build(), g = t?.progress?.onWarning;
4419
- if (p.length && g) {
4420
- let e = /* @__PURE__ */ new Set();
4421
- for (let [n, r, i] of p) {
4422
- let a = i ?? n;
4423
- e.has(a) || (e.add(a), g.call(t.progress, n, r));
4424
- }
4425
- }
4426
- return h.byteOffset === 0 && h.byteLength === h.buffer.byteLength ? h.buffer : h.slice().buffer;
4427
- }, _r = 1;
4428
- export { gr as writeXLSX };