@sheetxl/io-xlsx 0.7.28-beta.4 → 0.8.0-beta.10

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