@sheetxl/io-xlsx 0.8.0-beta.6 → 0.8.0-beta.9

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 (68) hide show
  1. package/browser/cjs/B0Ugu_crqQYpdfQz.cjs +1 -0
  2. package/browser/cjs/{qb-YQ8mGwpogSP08.cjs → BHM3_D9PsNURVAVy.cjs} +1 -1
  3. package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +6 -0
  4. package/browser/cjs/CeuX8p1aBuKTuagi.cjs +2 -0
  5. package/browser/cjs/DSM4q1dhVVXvsgby.cjs +30 -0
  6. package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +1 -0
  7. package/browser/cjs/index.cjs +1 -1
  8. package/browser/cjs/wrpXlaSBGEicQf6_.cjs +6 -0
  9. package/browser/esm/{B3cYXnqV2Zjaw6Jp.mjs → Bu64BYvRAlVftMr1.mjs} +4 -4
  10. package/browser/esm/{B0E-_6m23g4BDnX6.mjs → C-2KaUyV4gs-sDTZ.mjs} +2 -2
  11. package/browser/esm/{CGgjL7wM5WHZA6Dt.mjs → CRrTMRdN_IcSA_pm.mjs} +2 -2
  12. package/browser/esm/{BYENv_UE3Hv5ghGD.mjs → CWt4fDYEbj2hvsl_.mjs} +820 -800
  13. package/browser/esm/{BLEHoDT0SLbo8OO2.mjs → Ccnxz-y2WBEgfvvh.mjs} +2606 -1408
  14. package/browser/esm/{k-aEFzUZ8aU9FPf4.mjs → CxtFawTfwRTCC4Xr.mjs} +1 -1
  15. package/browser/esm/{DdTgGiFy8nAZTQ0d.mjs → D-epcZSoKLbsAIaC.mjs} +2 -2
  16. package/browser/esm/DsSIg46AR7IFBN5N.mjs +2298 -0
  17. package/browser/esm/{D01fs7vrCLlmdHoW.mjs → Dx64JMAGwNNDBkC1.mjs} +1555 -1159
  18. package/browser/esm/Sv4twwEJDb9dZ91h.mjs +149 -0
  19. package/browser/esm/index.mjs +2 -2
  20. package/node/esm/{am47EU_k1uSVm7yW.mjs → BCr4lCI6qQXXN0K1.mjs} +2 -2
  21. package/node/esm/BPn5XBizKkwaUqXB.mjs +4285 -0
  22. package/node/esm/{D-l0hqYTXUIEFoTg.mjs → BVV11IlqF6Lmlv8D.mjs} +53 -69
  23. package/node/esm/{Co5_sjvEk9d-x9gx.mjs → BiJEEgltJzx94zIR.mjs} +930 -909
  24. package/node/esm/{DWF_5NYPdrlTVvHi.mjs → BsTMtvwpQoPNv95M.mjs} +1 -1
  25. package/node/esm/{ZWSOYqmTKEmEOz2u.mjs → CBtj0-a4l2qux2hA.mjs} +2 -2
  26. package/node/esm/CkmZuMvRTpva7eQu.mjs +5074 -0
  27. package/node/esm/index.mjs +4 -4
  28. package/node/esm/j0RE2usgdljRw_gr.mjs +2345 -0
  29. package/package.json +3 -3
  30. package/types/src/AutoFilterRules.d.ts +83 -10
  31. package/types/src/OOXMLExtensions.d.ts +6 -0
  32. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  33. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +13 -0
  34. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +7 -1
  35. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  36. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +23 -1
  37. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +9 -0
  38. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +20 -1
  39. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  40. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +8 -0
  41. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  42. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  43. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  44. package/types/src/reader/domVisitors/index.d.ts +4 -2
  45. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +1 -1
  46. package/types/src/utils/DrawingMLText.d.ts +39 -0
  47. package/types/src/utils/FormControls.d.ts +97 -0
  48. package/types/src/writer/builder/Emitter.d.ts +5 -0
  49. package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
  50. package/types/src/writer/builder/Types.d.ts +10 -0
  51. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  52. package/types/src/writer/utils/DrawMLUtils.d.ts +39 -2
  53. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  54. package/types/src/writer/utils/TextUtils.d.ts +21 -2
  55. package/browser/cjs/17tMBnuyu4YIxixh.cjs +0 -1
  56. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  57. package/browser/cjs/BxU-OlZIQViQl7gX.cjs +0 -1
  58. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  59. package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +0 -2
  60. package/browser/cjs/DpZr07y7ifaZGvJ9.cjs +0 -5
  61. package/browser/cjs/MqKQ_B5qRARrRbO4.cjs +0 -24
  62. package/browser/esm/96C1ntelYWh7kQtW.mjs +0 -24
  63. package/browser/esm/FwrsLfi1iEAQGIjj.mjs +0 -2402
  64. package/browser/esm/gicSNvWtBLkvLsIw.mjs +0 -159
  65. package/node/esm/B-g20MoPHbZFapp8.mjs +0 -4642
  66. package/node/esm/Bu9QkKpBW4G2ULAg.mjs +0 -2450
  67. package/node/esm/CHl-WFsto0oTmBtB.mjs +0 -3051
  68. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
@@ -1,15 +1,18 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.6
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.9
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import "./B3cYXnqV2Zjaw6Jp.mjs";
8
- import { A as e, C as t, H as n, I as r, J as i, L as a, N as o, O as s, Q as c, S as l, T as u, U as d, W as f, X as p, Y as m, Z as h, a as g, c as _, d as v, et as y, g as b, i as x, it as S, k as ee, l as C, m as te, n as w, p as T, q as E, r as ne, rt as D, st as O, t as k, v as A, x as re, y as ie } from "./BLEHoDT0SLbo8OO2.mjs";
9
- import { AddressUtils as j, BufferUtils as M, Color as ae, CommonUtils as N, CoordUtils as oe, FormulaError as se, FormulaText as ce, IColor as P, ICondition as F, IConditionalFormat as I, IEffect as L, IFill as R, IFont as le, ISheet as ue, IStroke as de, IStyle as z, ITextFrame as B, LicenseManager as fe, NumberFormat as pe, ScalarType as me } from "@sheetxl/sdk";
10
- var he = "resourcesById", V = class {
7
+ import { $ as e, B as t, Bt as n, Et as r, F as i, G as a, H as o, I as s, It as c, Jt as l, L as u, Lt as d, Mt as f, Nt as p, P as m, Q as h, R as g, Rt as _, St as v, Tt as y, U as b, Ut as x, V as S, Vt as C, X as w, Z as T, Zt as E, a as D, at as ee, b as O, c as te, ct as ne, d as re, dt as ie, f as ae, g as oe, gt as k, h as A, ht as se, i as ce, it as le, jt as ue, l as de, lt as fe, m as pe, mt as me, n as he, nt as ge, q as _e, qt as ve, r as ye, st as be, t as xe, tt as Se, u as Ce, v as we, z as Te, zt as Ee } from "./Ccnxz-y2WBEgfvvh.mjs";
8
+ import "./Bu64BYvRAlVftMr1.mjs";
9
+ import { AddressUtils as j, BufferUtils as M, Color as De, CommonUtils as N, CoordUtils as Oe, FormulaError as ke, FormulaText as Ae, IColor as P, ICondition as F, IConditionalFormat as I, IEffect as je, IFill as L, IFont as R, IRange as z, IShape as Me, ISheet as Ne, IStroke as Pe, IStyle as B, ITextFrame as V, LicenseManager as Fe, NumberFormat as Ie, ScalarType as Le, ShapeStyleUtils as Re } from "@sheetxl/sdk";
10
+ var ze = "resourcesById", H = class {
11
11
  constructor(e) {
12
- this._kind = e.kind, this._contentType = e.contentType, this._relTypeUri = e.relTypeUri, this._path = e.path;
12
+ this._kind = e.kind, this._contentType = e.contentType, this._relTypeUri = e.relTypeUri, this._path = e.path, this._regeneratesRelationships = e.regeneratesRelationships ?? !1;
13
+ }
14
+ regeneratesRelationships() {
15
+ return this._regeneratesRelationships;
13
16
  }
14
17
  getKind() {
15
18
  return this._kind;
@@ -23,20 +26,20 @@ var he = "resourcesById", V = class {
23
26
  getPath(e) {
24
27
  return typeof this._path == "function" ? this._path(e) : this._path;
25
28
  }
26
- }, ge = class e {
29
+ }, Be = class e {
27
30
  constructor(e, t, n) {
28
31
  this.zipWriter = e, this.outputKind = t, this.outWritable = n;
29
32
  }
30
33
  static createUint8Array(t) {
31
- let n = new f(new p(), t);
34
+ let n = new p(new Ee(), t);
32
35
  return new e(n, "uint8array");
33
36
  }
34
37
  static createBlob(t) {
35
- let n = new f(new E("application/zip"), t);
38
+ let n = new p(new c("application/zip"), t);
36
39
  return new e(n, "blob");
37
40
  }
38
41
  static createWritableStream(t, n) {
39
- let r = new f(t, n);
42
+ let r = new p(t, n);
40
43
  return new e(r, "writable", t);
41
44
  }
42
45
  async add(e, t, n) {
@@ -44,7 +47,7 @@ var he = "resourcesById", V = class {
44
47
  let t = e.replace(/\\/g, "/").trim();
45
48
  for (; t.startsWith("/");) t = t.slice(1);
46
49
  return t;
47
- }(e), a = {
50
+ }(e), i = {
48
51
  level: n?.level,
49
52
  password: n?.password,
50
53
  encryptionStrength: n?.encryptionStrength,
@@ -57,16 +60,16 @@ var he = "resourcesById", V = class {
57
60
  compressionMethod: n?.compressionMethod,
58
61
  signature: n?.signature
59
62
  };
60
- if (typeof t == "string") return void await this.zipWriter.add(r, new i(t), a);
63
+ if (typeof t == "string") return void await this.zipWriter.add(r, new d(t), i);
61
64
  if (t instanceof Uint8Array || ArrayBuffer.isView(t) || t && typeof t.byteLength == "number" && typeof t.byteOffset == "number") {
62
65
  try {
63
- await this.zipWriter.add(r, new m(t), a);
66
+ await this.zipWriter.add(r, new _(t), i);
64
67
  } catch (e) {
65
- throw console.log("Error adding Uint8Array source to zip:", r, a), e;
68
+ throw console.log("Error adding Uint8Array source to zip:", r, i), e;
66
69
  }
67
70
  return;
68
71
  }
69
- let o = (s = t) && typeof s.getReader == "function" ? t : function(e) {
72
+ let a = (o = t) && typeof o.getReader == "function" ? t : function(e) {
70
73
  let t = e[Symbol.asyncIterator]();
71
74
  return new ReadableStream({
72
75
  async pull(e) {
@@ -80,15 +83,15 @@ var he = "resourcesById", V = class {
80
83
  }
81
84
  });
82
85
  }(t);
83
- var s;
84
- await this.zipWriter.add(r, o, a);
86
+ var o;
87
+ await this.zipWriter.add(r, a, i);
85
88
  }
86
89
  async close(e) {
87
90
  let t = e?.comment, n = await this.zipWriter.close(t, {});
88
91
  return this.outputKind === "writable" ? this.outWritable ?? n : n;
89
92
  }
90
93
  };
91
- function _e(e) {
94
+ function Ve(e) {
92
95
  let t = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), n = (e) => t(e).replace(/"/g, "&quot;"), r = (e) => {
93
96
  if (!e) return "";
94
97
  let t = "";
@@ -149,13 +152,13 @@ function _e(e) {
149
152
  }
150
153
  };
151
154
  }
152
- function ve(e) {
155
+ function He(e) {
153
156
  switch (e.kind) {
154
157
  case "bytes": return e.bytes;
155
158
  case "text": return e.text;
156
159
  case "stream": return e.stream;
157
160
  case "xmlStream": {
158
- let t = [], n = _e({ write: (e) => t.push(e) });
161
+ let t = [], n = Ve({ write: (e) => t.push(e) });
159
162
  return e.writeXml(n), n.close(), function(e) {
160
163
  let t = 0;
161
164
  for (let n of e) t += n.byteLength;
@@ -167,36 +170,36 @@ function ve(e) {
167
170
  case "xmlStreamed": return e.write();
168
171
  }
169
172
  }
170
- function ye(e) {
171
- let t = be(e);
173
+ function Ue(e) {
174
+ let t = We(e);
172
175
  if (!t) return "_rels/.rels";
173
176
  let n = t.lastIndexOf("/"), r = n >= 0 ? t.slice(0, n) : "";
174
177
  return `${r ? `${r}/_rels` : "_rels"}/${n >= 0 ? t.slice(n + 1) : t}.rels`;
175
178
  }
176
- function be(e) {
179
+ function We(e) {
177
180
  let t = (e ?? "").replace(/\\/g, "/").trim();
178
181
  for (; t.startsWith("/");) t = t.slice(1);
179
182
  return t;
180
183
  }
181
- function xe(e) {
184
+ function Ge(e) {
182
185
  let t = (e ?? "").replace(/\\/g, "/").trim();
183
186
  return t.startsWith("/") || (t = "/" + t), t;
184
187
  }
185
- function Se(e) {
188
+ function Ke(e) {
186
189
  let t = /^rId(\d+)$/.exec(e);
187
190
  return t ? parseInt(t[1], 10) : 2 ** 53 - 1;
188
191
  }
189
- function H(e) {
192
+ function U(e) {
190
193
  return String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/>/g, "&gt;");
191
194
  }
192
- function Ce(e, t, n, r = !1) {
195
+ function qe(e, t, n, r = !1) {
193
196
  let i = t;
194
197
  if (t.startsWith("/")) i = t.slice(1);
195
198
  else {
196
199
  if (!e) throw Error(`Relative path "${t}" cannot be used at root level. Use an absolute path starting with "/" (e.g., "/xl/workbook.xml").`);
197
200
  i = (e.includes("/") ? e.slice(0, e.lastIndexOf("/") + 1) : "") + t;
198
201
  }
199
- if (i = we(i), !i.includes("{n}")) {
202
+ if (i = Je(i), !i.includes("{n}")) {
200
203
  if (!r && n.has(i)) throw Error(`Path already existing path: ${i}`);
201
204
  return i;
202
205
  }
@@ -206,7 +209,7 @@ function Ce(e, t, n, r = !1) {
206
209
  while (n.has(a));
207
210
  return a;
208
211
  }
209
- function we(e) {
212
+ function Je(e) {
210
213
  let t = e.split("/"), n = [];
211
214
  for (let r of t) if (r !== "" && r !== ".") if (r === "..") {
212
215
  if (n.length === 0) throw Error(`Invalid path: too many ".." segments in "${e}"`);
@@ -214,17 +217,17 @@ function we(e) {
214
217
  } else n.push(r);
215
218
  return n.join("/");
216
219
  }
217
- function Te(e, t) {
220
+ function Ye(e, t) {
218
221
  if (!e) return t;
219
222
  let n = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "", r = n ? n.split("/") : [], i = t.split("/"), a = 0, o = Math.min(r.length, i.length - 1);
220
223
  for (let e = 0; e < o && r[e] === i[e]; e++) a++;
221
224
  let s = r.length - a;
222
225
  return "../".repeat(s) + i.slice(a).join("/");
223
226
  }
224
- function Ee(e) {
227
+ function Xe(e) {
225
228
  return new TextEncoder().encode(e);
226
229
  }
227
- function De(e, t) {
230
+ function Ze(e, t) {
228
231
  return function(e, t = " ") {
229
232
  let n = "", r = 0, i = e.split(/(<[^>]+>)/g).filter(Boolean);
230
233
  for (let e = 0; e < i.length; e++) {
@@ -241,9 +244,9 @@ function De(e, t) {
241
244
  return new TextDecoder("utf-8").decode(e);
242
245
  }(e), t);
243
246
  }
244
- var Oe = class {
247
+ var Qe = class {
245
248
  constructor(e) {
246
- this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.reservedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = be(e);
249
+ this.rels = [], this.usedIds = /* @__PURE__ */ new Set(), this.reservedIds = /* @__PURE__ */ new Set(), this.nextId = 1, this.sourcePart = We(e);
247
250
  }
248
251
  add(e, t, n) {
249
252
  let r = n?.idHint && !this.usedIds.has(n.idHint) ? n.idHint : void 0;
@@ -270,19 +273,19 @@ var Oe = class {
270
273
  return this.rels;
271
274
  }
272
275
  toXmlBytes() {
273
- let e = [...this.rels].sort((e, t) => Se(t.id) - Se(e.id) || e.id.localeCompare(t.id)), t = [];
274
- t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Relationships xmlns="${ke}">`);
276
+ let e = [...this.rels].sort((e, t) => Ke(t.id) - Ke(e.id) || e.id.localeCompare(t.id)), t = [];
277
+ t.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), t.push(`<Relationships xmlns="${$e}">`);
275
278
  for (let n of e) {
276
279
  let e = [
277
- `Id="${H(n.id)}"`,
278
- `Type="${H(n.type)}"`,
279
- `Target="${H(n.target)}"`
280
+ `Id="${U(n.id)}"`,
281
+ `Type="${U(n.type)}"`,
282
+ `Target="${U(n.target)}"`
280
283
  ];
281
284
  n.targetMode === "External" && e.push("TargetMode=\"External\""), t.push(`<Relationship ${e.join(" ")}/>`);
282
285
  }
283
- return t.push("</Relationships>"), Ee(t.join(""));
286
+ return t.push("</Relationships>"), Xe(t.join(""));
284
287
  }
285
- }, ke = "http://schemas.openxmlformats.org/package/2006/relationships", Ae = class {
288
+ }, $e = "http://schemas.openxmlformats.org/package/2006/relationships", et = class {
286
289
  constructor() {
287
290
  this._defaultsSet = /* @__PURE__ */ new Set(), this._overridesSet = /* @__PURE__ */ new Set(), this._defaults = [], this._overrides = [];
288
291
  }
@@ -297,44 +300,44 @@ var Oe = class {
297
300
  }));
298
301
  }
299
302
  addOverride(e, t) {
300
- let n = xe(e);
303
+ let n = Ge(e);
301
304
  this._overridesSet.has(n) || (this._overridesSet.add(n), this._overrides.push({
302
305
  key: n,
303
306
  content: t
304
307
  }));
305
308
  }
306
309
  replaceOverride(e, t) {
307
- let n = xe(e);
310
+ let n = Ge(e);
308
311
  if (!this._overridesSet.has(n)) return;
309
312
  let r = this._overrides.find((e) => e.key === n);
310
313
  r && (r.content = t);
311
314
  }
312
315
  toXmlBytes() {
313
316
  let e = [];
314
- e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Types xmlns="${je}">`);
317
+ e.push("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"), e.push(`<Types xmlns="${tt}">`);
315
318
  let t = this._defaults.reverse();
316
319
  this.addDefault("rels", "application/vnd.openxmlformats-package.relationships+xml"), this.addDefault("xml", "application/xml");
317
- for (let { key: n, content: r } of t) e.push(`<Default Extension="${H(n)}" ContentType="${H(r)}"/>`);
320
+ for (let { key: n, content: r } of t) e.push(`<Default Extension="${U(n)}" ContentType="${U(r)}"/>`);
318
321
  let n = this._overrides;
319
- for (let { key: t, content: r } of n) e.push(`<Override PartName="${H(t)}" ContentType="${H(r)}"/>`);
320
- return e.push("</Types>"), Ee(e.join(""));
322
+ for (let { key: t, content: r } of n) e.push(`<Override PartName="${U(t)}" ContentType="${U(r)}"/>`);
323
+ return e.push("</Types>"), Xe(e.join(""));
321
324
  }
322
- }, je = "http://schemas.openxmlformats.org/package/2006/content-types", Me = class {
325
+ }, tt = "http://schemas.openxmlformats.org/package/2006/content-types", nt = class {
323
326
  constructor(e) {
324
- this.parts = [], this.relsRoot = new Oe(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new Ae(), this.zip = e;
327
+ this.parts = [], this.relsRoot = new Qe(""), this.relsByPart = /* @__PURE__ */ new Map(), this.contentTypes = new et(), this.zip = e;
325
328
  }
326
329
  addContentType(e, t) {
327
- let n = be(e);
330
+ let n = We(e);
328
331
  this.contentTypes.addOverride("/" + n, t);
329
332
  }
330
333
  addDefaultType(e, t) {
331
334
  this.contentTypes.addDefault(e, t);
332
335
  }
333
336
  replaceContentType(e, t) {
334
- this.contentTypes.replaceOverride("/" + be(e), t);
337
+ this.contentTypes.replaceOverride("/" + We(e), t);
335
338
  }
336
339
  addPart(e, t, n, r) {
337
- let i = be(e);
340
+ let i = We(e);
338
341
  this.parts.push({
339
342
  path: i,
340
343
  body: t,
@@ -342,22 +345,22 @@ var Oe = class {
342
345
  }), n && this.contentTypes.addOverride("/" + i, n);
343
346
  }
344
347
  rels(e) {
345
- let t = be(e || "");
348
+ let t = We(e || "");
346
349
  if (!t) return this.relsRoot;
347
350
  let n = this.relsByPart.get(t);
348
- return n || (n = new Oe(t), this.relsByPart.set(t, n)), n;
351
+ return n || (n = new Qe(t), this.relsByPart.set(t, n)), n;
349
352
  }
350
353
  async emit() {
351
354
  let e = [...this.parts].sort((e, t) => e.path.localeCompare(t.path));
352
355
  for (let t of e) {
353
- let e = ve(t.body);
356
+ let e = He(t.body);
354
357
  await this.zip.add(t.path, e, t.optionsZip);
355
358
  }
356
359
  let t = this.relsRoot.toXmlBytes();
357
360
  await this.zip.add("_rels/.rels", t, {});
358
361
  let n = [...this.relsByPart.values()].sort((e, t) => e.sourcePart.localeCompare(t.sourcePart));
359
362
  for (let e of n) {
360
- let t = ye(e.sourcePart), n = e.toXmlBytes();
363
+ let t = Ue(e.sourcePart), n = e.toXmlBytes();
361
364
  await this.zip.add(t, n, {});
362
365
  }
363
366
  let r = this.contentTypes.toXmlBytes();
@@ -366,39 +369,39 @@ var Oe = class {
366
369
  async build(e) {
367
370
  return await this.emit(), await this.zip.close(e);
368
371
  }
369
- }, Ne = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), Pe = [/^xl\/slicers\//i, /^xl\/slicerCaches\//i];
370
- function Fe(e) {
371
- return e === "[Content_Types].xml" || Ie.test(e);
372
+ }, rt = /* @__PURE__ */ new Set(["xl/calcChain.xml"]), it = [/^xl\/slicers\//i, /^xl\/slicerCaches\//i];
373
+ function at(e) {
374
+ return e === "[Content_Types].xml" || ot.test(e);
372
375
  }
373
- var Ie = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
374
- function Le(e) {
376
+ var ot = /^(?:(.*)\/)?_rels\/(.*)\.rels$/;
377
+ function st(e) {
375
378
  if (e === "_rels/.rels") return "";
376
- let t = Ie.exec(e);
379
+ let t = ot.exec(e);
377
380
  if (!t) return null;
378
381
  let n = t[1] ?? "", r = t[2];
379
382
  return n ? `${n}/${r}` : r;
380
383
  }
381
- function Re(e) {
384
+ function ct(e) {
382
385
  return e.startsWith("#");
383
386
  }
384
- function ze(e, t) {
385
- if (t.startsWith("/")) return we(t);
387
+ function lt(e, t) {
388
+ if (t.startsWith("/")) return Je(t);
386
389
  let n = e.includes("/") ? e.slice(0, e.lastIndexOf("/")) : "";
387
- return we((n ? n + "/" : "") + t);
390
+ return Je((n ? n + "/" : "") + t);
388
391
  }
389
- var Be = class {
392
+ var ut = class {
390
393
  constructor(e, t, n) {
391
- this._queue = [], this._scheduledByNodeKey = /* @__PURE__ */ new Map(), this._nodesByPath = /* @__PURE__ */ new Map(), this._writtenPaths = /* @__PURE__ */ new Set(), this._explicitRelTargets = /* @__PURE__ */ new Set(), this._partWriter = new Me(e), this._registry = t, this._options = n ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null, this._macroEnabled = this._options.macroEnabled ?? !1, this._reserveSourceRelIds("");
394
+ this._queue = [], this._scheduledByNodeKey = /* @__PURE__ */ new Map(), this._nodesByPath = /* @__PURE__ */ new Map(), this._writtenPaths = /* @__PURE__ */ new Set(), this._regeneratedPaths = /* @__PURE__ */ new Set(), this._explicitRelTargets = /* @__PURE__ */ new Set(), this._partWriter = new nt(e), this._registry = t, this._options = n ?? {}, this._mapState = this._options.mapState ?? /* @__PURE__ */ new Map(), this._sourcePackage = this._options.sourcePackage ?? null, this._macroEnabled = this._options.macroEnabled ?? !1, this._reserveSourceRelIds("");
392
395
  }
393
396
  _isSourcePartCarried(e) {
394
397
  let t = this._sourcePackage;
395
- return !(!t || !t.has(e)) && !Ne.has(e) && !t.isAbsorbed(e) && !(!this._macroEnabled && e === "xl/vbaProject.bin") && !Fe(e) && (!t.hasStructuralChange() || !function(e) {
396
- return Pe.some((t) => t.test(e));
398
+ return !(!t || !t.has(e)) && !rt.has(e) && !t.isAbsorbed(e) && !(!this._macroEnabled && e === "xl/vbaProject.bin") && !at(e) && (!t.hasStructuralChange() || !function(e) {
399
+ return it.some((t) => t.test(e));
397
400
  }(e));
398
401
  }
399
402
  _reserveSourceRelIds(e) {
400
- let t = this._sourcePackage?.getPart(ye(e));
401
- t && this._partWriter.rels(e).reserve(d(t.data).map((e) => e.id));
403
+ let t = this._sourcePackage?.getPart(Ue(e));
404
+ t && this._partWriter.rels(e).reserve(f(t.data).map((e) => e.id));
402
405
  }
403
406
  async waitEmit() {
404
407
  let e = this._queue;
@@ -413,14 +416,14 @@ var Be = class {
413
416
  _passthroughSourceParts() {
414
417
  let e = this._sourcePackage;
415
418
  if (!e) return;
416
- let t = new Set(this._writtenPaths), r = [];
417
- for (let n of e.getNames()) t.has(n) || this._isSourcePartCarried(n) && r.push(n);
418
- let i = new Set(t);
419
- for (let e of r) i.add(e);
420
- let a = e.getPart("[Content_Types].xml"), o = a ? n(a.data) : null;
421
- if (o) for (let { ext: e, contentType: t } of o.defaults) this._partWriter.addDefaultType(e, t);
422
- for (let t of r) {
423
- let n = e.getPart(t), r = o?.overrides.get("/" + t);
419
+ let t = new Set(this._writtenPaths), n = [];
420
+ for (let r of e.getNames()) t.has(r) || this._isSourcePartCarried(r) && n.push(r);
421
+ let r = new Set(t);
422
+ for (let e of n) r.add(e);
423
+ let i = e.getPart("[Content_Types].xml"), a = i ? ue(i.data) : null;
424
+ if (a) for (let { ext: e, contentType: t } of a.defaults) this._partWriter.addDefaultType(e, t);
425
+ for (let t of n) {
426
+ let n = e.getPart(t), r = a?.overrides.get("/" + t);
424
427
  n.raw ? this._partWriter.addPart(t, {
425
428
  kind: "bytes",
426
429
  bytes: n.raw.compressedData
@@ -435,9 +438,9 @@ var Be = class {
435
438
  }, r), this._writtenPaths.add(t);
436
439
  }
437
440
  for (let n of e.getNames()) {
438
- if (n === "[Content_Types].xml" || !Fe(n)) continue;
439
- let r = Le(n);
440
- r !== null && (r === "" || i.has(r)) && (e.isAbsorbed(r) || this._mergeSourceRelsInto(r, e.getPart(n).data, t, i));
441
+ if (n === "[Content_Types].xml" || !at(n)) continue;
442
+ let i = st(n);
443
+ i !== null && (i === "" || r.has(i)) && (e.isAbsorbed(i) || this._regeneratedPaths.has(i) || this._mergeSourceRelsInto(i, e.getPart(n).data, t, r));
441
444
  }
442
445
  }
443
446
  _applyWorkbookContentTypeVariant() {
@@ -445,16 +448,16 @@ var Be = class {
445
448
  }
446
449
  _mergeSourceRelsInto(e, t, n, r) {
447
450
  let i = this._partWriter.rels(e), a = e === "" || n.has(e);
448
- for (let o of d(t)) {
449
- if (o.external || Re(o.target)) {
451
+ for (let o of f(t)) {
452
+ if (o.external || ct(o.target)) {
450
453
  i.add(o.type, o.target, {
451
454
  external: o.external,
452
455
  idHint: o.id
453
456
  });
454
457
  continue;
455
458
  }
456
- let t = ze(e, o.target);
457
- a && (n.has(t) || this._explicitRelTargets.has(`${e}::${t}`)) || (r.has(t) ? i.add(o.type, o.target, { idHint: o.id }) : this._registry.ownsRelType(o.type) || Ne.has(t) || this._sourcePackage?.isAbsorbed(t) || console.warn(`Dropping preserved relationship to missing part '${t}'`, e || "(root)"));
459
+ let t = lt(e, o.target);
460
+ a && (n.has(t) || this._explicitRelTargets.has(`${e}::${t}`)) || (r.has(t) ? i.add(o.type, o.target, { idHint: o.id }) : this._registry.ownsRelType(o.type) || rt.has(t) || this._sourcePackage?.isAbsorbed(t) || console.warn(`Dropping preserved relationship to missing part '${t}'`, e || "(root)"));
458
461
  }
459
462
  }
460
463
  addPart(e, t, n, r) {
@@ -465,10 +468,10 @@ var Be = class {
465
468
  if (!a) throw Error(`No emitter registered for kind '${t}'.`);
466
469
  let o = a.getContentType(n), s = a.getRelTypeUri(n), c = r ?? a.getPath?.(n);
467
470
  if (!c) throw Error("No path provided in either argument or emitter.");
468
- let l = this._writtenPaths, u = Ce(e, c, l), d = `${t}:${u}`, f = this._scheduledByNodeKey.get(d);
471
+ let l = this._writtenPaths, u = qe(e, c, l), d = `${t}:${u}`, f = this._scheduledByNodeKey.get(d);
469
472
  if (!f) {
470
473
  let e;
471
- this._reserveSourceRelIds(u), f = {
474
+ a.regeneratesRelationships?.() ? this._regeneratedPaths.add(u) : this._reserveSourceRelIds(u), f = {
472
475
  kind: t,
473
476
  key: d,
474
477
  payload: n,
@@ -484,7 +487,7 @@ var Be = class {
484
487
  p || (p = /* @__PURE__ */ new Set(), this._nodesByPath.set(e, p)), p.add(d), !o || s || e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", u);
485
488
  let m = null;
486
489
  if (s) {
487
- let t = Te(e, f.path);
490
+ let t = Ye(e, f.path);
488
491
  m = this._partWriter.rels(e).add(s, t, { idHint: i });
489
492
  }
490
493
  return l.add(u), {
@@ -499,9 +502,9 @@ var Be = class {
499
502
  _addBinaryInternal(e, t, n, r, i, a = !1, o) {
500
503
  if (!i) throw Error("No path provided for binary.");
501
504
  if (!n) throw Error("No content type provided for binary.");
502
- let s = this._writtenPaths, c = Ce(e, i, s, a), l = null;
505
+ let s = this._writtenPaths, c = qe(e, i, s, a), l = null;
503
506
  if (r) {
504
- let t = Te(e, c);
507
+ let t = Ye(e, c);
505
508
  l = this._partWriter.rels(e).add(r, t, { idHint: o });
506
509
  }
507
510
  if (e || this._partWriter.rels("").add("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", c), !s.has(c)) {
@@ -544,20 +547,20 @@ var Be = class {
544
547
  r.push(e);
545
548
  } }, a;
546
549
  await t.emit(e.payload, {
547
- getXMLWriter: () => a || (a = _e(i), a),
550
+ getXMLWriter: () => a || (a = Ve(i), a),
548
551
  addPart: (e, t, r, i) => this._addPartInternal(n, e, t, r, i),
549
552
  addBinary: (e, t, r, i, a = !1, o) => this._addBinaryInternal(n, e, t, r, i, a, o),
550
553
  addExternal: (e, t, r) => ({
551
554
  path: t,
552
555
  contentTypeUri: null,
553
556
  relId: this._partWriter.rels(n).add(e, t, {
554
- external: !0,
557
+ external: !ct(t),
555
558
  idHint: r
556
559
  })
557
560
  }),
558
561
  addRelationship: (e, t, r) => {
559
562
  if (!this._writtenPaths.has(t) && !this._isSourcePartCarried(t)) return null;
560
- let i = Te(n, t), a = this._partWriter.rels(n).add(e, i, { idHint: r });
563
+ let i = Ye(n, t), a = this._partWriter.rels(n).add(e, i, { idHint: r });
561
564
  return this._explicitRelTargets.add(`${n}::${t}`), a;
562
565
  },
563
566
  waitEmit: () => this._waitForDescendants(e.path),
@@ -578,7 +581,7 @@ var Be = class {
578
581
  for (let t of e) n.set(t, r), r += t.byteLength;
579
582
  return n;
580
583
  }(r), s = this._options.onPartEmitted;
581
- s && await s(e.kind, e.path, o), Ve && (console.log(`\n=== ${e.path} ===`), console.log(De(o))), this._partWriter.addPart(e.path, {
584
+ s && await s(e.kind, e.path, o), dt && (console.log(`\n=== ${e.path} ===`), console.log(Ze(o))), this._partWriter.addPart(e.path, {
582
585
  kind: "bytes",
583
586
  bytes: o
584
587
  }, e.contentType);
@@ -588,7 +591,7 @@ var Be = class {
588
591
  this._nodesByPath.delete(e.path), this._scheduledByNodeKey.delete(e.key), e.resolve();
589
592
  }
590
593
  }
591
- }, Ve = !1, He = class {
594
+ }, dt = !1, ft = class {
592
595
  constructor() {
593
596
  this.map = /* @__PURE__ */ new Map();
594
597
  }
@@ -610,10 +613,10 @@ var Be = class {
610
613
  return !1;
611
614
  }
612
615
  };
613
- function Ue(e, t, n) {
616
+ function pt(e, t, n) {
614
617
  e && (e.algorithm && (t[n ? `${n}AlgorithmName` : "algorithmName"] = e.algorithm), e.hash && (t[n ? `${n}HashValue` : "hashValue"] = e.hash), e.salt && (t[n ? `${n}SaltValue` : "saltValue"] = e.salt), e.spinCount !== void 0 && (t[n ? `${n}SpinCount` : "spinCount"] = e.spinCount));
615
618
  }
616
- var We = "hiddenFormulaXfs", Ge = class {
619
+ var mt = "hiddenFormulaXfs", ht = class {
617
620
  constructor(e, t) {
618
621
  this._variants = /* @__PURE__ */ new Map(), this._sources = [], this._json = e, this._styles = t, this._directCount = Math.max(1, e?.direct?.length ?? 0);
619
622
  }
@@ -627,10 +630,10 @@ var We = "hiddenFormulaXfs", Ge = class {
627
630
  _isShown(e) {
628
631
  let t = this._json?.direct?.[e], n = t?.protection?.showFormulas;
629
632
  if (n !== void 0) return n;
630
- let r = (e === 0 ? void 0 : t?.named) ?? z.BuiltInName.Normal;
633
+ let r = (e === 0 ? void 0 : t?.named) ?? B.BuiltInName.Normal;
631
634
  return this._styles.getNamedStyles().getByName(r)?.toJSON().style?.protection?.showFormulas ?? !1;
632
635
  }
633
- }, Ke = class {
636
+ }, gt = class {
634
637
  constructor() {
635
638
  this._daprFMBks = [], this._daprFMBkMap = /* @__PURE__ */ new Map(), this._rvFMBks = [], this._rvFMBkMap = /* @__PURE__ */ new Map(), this._valueMeta = [];
636
639
  }
@@ -665,20 +668,20 @@ var We = "hiddenFormulaXfs", Ge = class {
665
668
  getValueMeta() {
666
669
  return this._valueMeta;
667
670
  }
668
- }, qe = class {
671
+ }, _t = class {
669
672
  constructor(e, t = console.warn) {
670
673
  this._entries = [], this._keyMap = /* @__PURE__ */ new Map(), this._metaCollector = e, this._onWarn = t;
671
674
  }
672
675
  add(e) {
673
676
  if (e == null) return this._onWarn?.("RichValueCollector.add: null/undefined value — falling back to #UNKNOWN!"), this._registerFallback();
674
- if (se.isError(e)) {
675
- let t = e.getCode(), n = this._register(`_error:${t}`, { errorType: "" + (t - 1) }, Je);
677
+ if (ke.isError(e)) {
678
+ let t = e.getCode(), n = this._register(`_error:${t}`, { errorType: "" + (t - 1) }, vt);
676
679
  return this._metaCollector.registerRichValueCell(n);
677
680
  }
678
681
  return e.isIRichData && e.getType(), this._onWarn?.("RichValueCollector.add: unsupported rich value type — falling back to #UNKNOWN!", e), this._registerFallback();
679
682
  }
680
683
  _registerFallback() {
681
- let e = this._register("_error:fallback", { errorType: se.Code.Unknown - 1 }, Je);
684
+ let e = this._register("_error:fallback", { errorType: ke.Code.Unknown - 1 }, vt);
682
685
  return this._metaCollector.registerRichValueCell(e);
683
686
  }
684
687
  _register(e, t, n) {
@@ -710,7 +713,7 @@ var We = "hiddenFormulaXfs", Ge = class {
710
713
  }
711
714
  return -1;
712
715
  }
713
- }, Je = new class {
716
+ }, vt = new class {
714
717
  constructor(e, t) {
715
718
  this.type = e, this.props = t;
716
719
  }
@@ -728,18 +731,18 @@ var We = "hiddenFormulaXfs", Ge = class {
728
731
  "subType",
729
732
  "i",
730
733
  "0"
731
- ]]), Ye = "application/xml", Xe = async (e, t) => {
734
+ ]]), yt = "application/xml", bt = async (e, t) => {
732
735
  let n = e.parts, r = n ? n.length : 0;
733
736
  for (let i = 0; i < r; i++) {
734
737
  let r = n[i];
735
738
  try {
736
- await Ze(r, t);
739
+ await xt(r, t);
737
740
  } catch (n) {
738
741
  t.log(`Unable to write the part '${r.name ?? r.id}' referenced by '${e.name ?? e.id}'`, n);
739
742
  }
740
743
  }
741
- }, Ze = async (e, t, n) => {
742
- let r = e.resId === void 0 ? void 0 : t.getSharedStates().get(he)?.get(e.resId);
744
+ }, xt = async (e, t, n) => {
745
+ let r = e.resId === void 0 ? void 0 : t.getSharedStates().get(ze)?.get(e.resId);
743
746
  if (!r) return e.resId === void 0 ? t.addPart("embeddedPart", e, n, e.id) : (t.log(`The part '${e.name ?? e.id}' cites resource ${e.resId}, which is not in the workbook.`), null);
744
747
  let i = await r.getExternalURI();
745
748
  if (i) {
@@ -747,12 +750,12 @@ var We = "hiddenFormulaXfs", Ge = class {
747
750
  return n.relId !== e.id && t.log(`The external reference '${e.id}' was written as '${n.relId}'; the markup will not find it.`), n;
748
751
  }
749
752
  let a = await r.toBuffer();
750
- return t.addBinary(new Uint8Array(a), e.contentType || Ye, e.type, n ?? `./${Qe(e.name)}`, !1, e.id);
751
- }, Qe = (e) => {
753
+ return t.addBinary(new Uint8Array(a), e.contentType || yt, e.type, n ?? `./${St(e.name)}`, !1, e.id);
754
+ }, St = (e) => {
752
755
  let t = e && /^[\w.\-~%]+$/.test(e) ? e : "part.xml", n = t.lastIndexOf("."), r = n > 0 ? t.slice(0, n) : t, i = n > 0 ? t.slice(n) : "";
753
756
  return `${r.replace(/\d+$/, "")}{n}${i}`;
754
- }, $e = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", et = (e, t) => e.getSharedStates().get("pivotCachePaths")?.get(t) ?? null, tt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink", nt = "fileVersion", rt = "sheetParts", it = "externalLinkParts";
755
- function at(e) {
757
+ }, Ct = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml", wt = (e, t) => e.getSharedStates().get("pivotCachePaths")?.get(t) ?? null, Tt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink", Et = "fileVersion", Dt = "sheetParts", Ot = "externalLinkParts";
758
+ function kt(e) {
756
759
  if (!e || e.indexOf("[") === -1) return [];
757
760
  let t = [], n = e.replace(/"(?:[^"]|"")*"/g, "");
758
761
  for (let e of n.matchAll(/\[(\d+)\]/g)) {
@@ -761,58 +764,69 @@ function at(e) {
761
764
  }
762
765
  return t;
763
766
  }
764
- var ot = {
767
+ var At = {
765
768
  auto: "auto",
766
769
  automaticExceptTables: "autoNoTable",
767
770
  manual: "manual"
768
771
  };
769
- function U(e, t, n, r) {
772
+ function W(e, t, n, r) {
770
773
  if (!n) return;
771
774
  let i = typeof n == "string" ? t.parseColor(n) : n;
772
775
  r && e.start(r);
773
776
  let a = i.getType(), o = i.getVal(), s = i.getAdjustments(), c = s && s.length > 0;
774
777
  switch (a) {
775
778
  case "scheme":
776
- c ? (e.start("schemeClr", { val: o }), W(e, s), e.end("schemeClr")) : e.empty("schemeClr", { val: o });
779
+ c ? (e.start("schemeClr", { val: o }), G(e, s), e.end("schemeClr")) : e.empty("schemeClr", { val: o });
777
780
  break;
778
781
  case "named":
779
- if (ae.isSystem(o)) {
782
+ if (De.isSystem(o)) {
780
783
  let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
781
784
  c ? (e.start("sysClr", {
782
785
  val: o,
783
786
  lastClr: t
784
- }), W(e, s), e.end("sysClr")) : e.empty("sysClr", {
787
+ }), G(e, s), e.end("sysClr")) : e.empty("sysClr", {
785
788
  val: o,
786
789
  lastClr: t
787
790
  });
788
- } else c ? (e.start("prstClr", { val: o }), W(e, s), e.end("prstClr")) : e.empty("prstClr", { val: o });
791
+ } else c ? (e.start("prstClr", { val: o }), G(e, s), e.end("prstClr")) : e.empty("prstClr", { val: o });
789
792
  break;
790
793
  case "auto": {
791
794
  let t = i.getLastColor() ?? i.getBaseColor().toHex().toString(!1).replace("#", "");
792
795
  c ? (e.start("sysClr", {
793
796
  val: "windowText",
794
797
  lastClr: t
795
- }), W(e, s), e.end("sysClr")) : e.empty("sysClr", {
798
+ }), G(e, s), e.end("sysClr")) : e.empty("sysClr", {
796
799
  val: "windowText",
797
800
  lastClr: t
798
801
  });
799
802
  break;
800
803
  }
801
804
  case "index":
802
- c ? (e.start("srgbClr", { val: o }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: o });
805
+ c ? (e.start("srgbClr", { val: o }), G(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: o });
803
806
  break;
804
807
  case "hsl":
805
808
  let t = i.toHex().toString();
806
- c ? (e.start("srgbClr", { val: t }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: t });
809
+ c ? (e.start("srgbClr", { val: t }), G(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: t });
807
810
  break;
811
+ case "lrgb": {
812
+ let t = /^lrgba?\(\s*([-\d.]+)\s*,\s*([-\d.]+)\s*,\s*([-\d.]+)/i.exec(String(o));
813
+ if (t) {
814
+ let n = {
815
+ r: String(Math.round(1e3 * parseFloat(t[1]))),
816
+ g: String(Math.round(1e3 * parseFloat(t[2]))),
817
+ b: String(Math.round(1e3 * parseFloat(t[3])))
818
+ };
819
+ c ? (e.start("scrgbClr", n), G(e, s), e.end("scrgbClr")) : e.empty("scrgbClr", n);
820
+ break;
821
+ }
822
+ }
808
823
  case "rgb":
809
- case "lrgb":
810
824
  let n = i.toHex().toString();
811
- c ? (e.start("srgbClr", { val: n }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: n });
825
+ c ? (e.start("srgbClr", { val: n }), G(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: n });
812
826
  break;
813
827
  case "hex":
814
828
  let r = o.replace("#", "").toUpperCase();
815
- c ? (e.start("srgbClr", { val: r }), W(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: r });
829
+ c ? (e.start("srgbClr", { val: r }), G(e, s), e.end("srgbClr")) : e.empty("srgbClr", { val: r });
816
830
  break;
817
831
  default:
818
832
  let a = o.replace("#", "").toUpperCase();
@@ -820,7 +834,7 @@ function U(e, t, n, r) {
820
834
  }
821
835
  r && e.end(r);
822
836
  }
823
- function W(e, t) {
837
+ function G(e, t) {
824
838
  if (t && t.length !== 0) for (let n of t) for (let [t, r] of Object.entries(n)) {
825
839
  if (r == null) continue;
826
840
  let n = t;
@@ -843,14 +857,14 @@ function W(e, t) {
843
857
  }
844
858
  }
845
859
  }
846
- function G(e, t, n, r, i = !1, a = !1) {
860
+ function K(e, t, n, r, i = !1, a = !1) {
847
861
  if (!n) return;
848
862
  let o = typeof n == "string" ? t.parseColor(n) : n, s = () => {
849
- e.empty(r, { rgb: mt(o.toHex().toString(!0)) });
863
+ e.empty(r, { rgb: Rt(o.toHex().toString(!0)) });
850
864
  }, c = o.getAdjustments(), l = c && c.length > 0, u = o.getType();
851
865
  if (u !== P.Type.Auto) {
852
866
  if (u === P.Type.Scheme) {
853
- let t = o.getVal(), n = st[t] ?? t, i = ut.get(n);
867
+ let t = o.getVal(), n = jt[t] ?? t, i = Pt.get(n);
854
868
  if (i === void 0 && n !== "phClr") return console.warn(`Color scheme not in theme. schemeVal=${t} themeKey=${n}`), s();
855
869
  let a = {};
856
870
  if (a.theme = i, l) {
@@ -870,13 +884,13 @@ function G(e, t, n, r, i = !1, a = !1) {
870
884
  return !0;
871
885
  }(c)) return s();
872
886
  let e = c.length === 1 ? c[0][P.AdjustmentType.ETint] : void 0, t;
873
- if (e !== void 0) t = ft(e);
887
+ if (e !== void 0) t = It(e);
874
888
  else {
875
889
  let e = o.getBaseColor().toHex().toString(!0), n = o.toHex().toString(!0);
876
- t = ft(function(e, t) {
877
- let n = dt(e, 0, 255), r = dt(t, 0, 255);
878
- return Math.abs(r - n) < 1e-9 ? 0 : r < n ? n <= 1e-9 ? -1 : dt(r / n - 1, -1, 0) : 255 - n <= 1e-9 ? 0 : dt((r - n) / (255 - n), 0, 1);
879
- }(pt(e), pt(n)));
890
+ t = It(function(e, t) {
891
+ let n = Ft(e, 0, 255), r = Ft(t, 0, 255);
892
+ return Math.abs(r - n) < 1e-9 ? 0 : r < n ? n <= 1e-9 ? -1 : Ft(r / n - 1, -1, 0) : 255 - n <= 1e-9 ? 0 : Ft((r - n) / (255 - n), 0, 1);
893
+ }(Lt(e), Lt(n)));
880
894
  }
881
895
  t !== 0 && (a.tint = t);
882
896
  }
@@ -892,7 +906,7 @@ function G(e, t, n, r, i = !1, a = !1) {
892
906
  }
893
907
  e.empty(r, { auto: 1 });
894
908
  }
895
- var st = {
909
+ var jt = {
896
910
  bg1: "lt1",
897
911
  tx1: "dk1",
898
912
  bg2: "lt2",
@@ -905,7 +919,7 @@ var st = {
905
919
  accent6: "accent6",
906
920
  hlink: "hlink",
907
921
  folHlink: "folHlink"
908
- }, ct = Object.freeze([
922
+ }, Mt = Object.freeze([
909
923
  "lt1",
910
924
  "dk1",
911
925
  "lt2",
@@ -918,7 +932,7 @@ var st = {
918
932
  "accent6",
919
933
  "hlink",
920
934
  "folHlink"
921
- ]), lt = Object.freeze([
935
+ ]), Nt = Object.freeze([
922
936
  "dk1",
923
937
  "lt1",
924
938
  "dk2",
@@ -931,15 +945,15 @@ var st = {
931
945
  "accent6",
932
946
  "hlink",
933
947
  "folHlink"
934
- ]), ut = new Map(ct.map((e, t) => [e, t]));
935
- function dt(e, t, n) {
948
+ ]), Pt = new Map(Mt.map((e, t) => [e, t]));
949
+ function Ft(e, t, n) {
936
950
  return Math.max(t, Math.min(n, e));
937
951
  }
938
- function ft(e) {
939
- let t = dt(e, -1, 1);
952
+ function It(e) {
953
+ let t = Ft(e, -1, 1);
940
954
  return Math.abs(t) < 1e-12 ? 0 : t;
941
955
  }
942
- function pt(e) {
956
+ function Lt(e) {
943
957
  let t = function(e) {
944
958
  let t = e.replace(/^#/, "").toUpperCase();
945
959
  if (t.length === 8) return t.slice(2);
@@ -948,64 +962,64 @@ function pt(e) {
948
962
  }(e), n = parseInt(t.slice(0, 2), 16) / 255, r = parseInt(t.slice(2, 4), 16) / 255, i = parseInt(t.slice(4, 6), 16) / 255;
949
963
  return (Math.max(n, r, i) + Math.min(n, r, i)) / 2 * 255;
950
964
  }
951
- function mt(e) {
965
+ function Rt(e) {
952
966
  let t = e.replace(/^#/, "").toUpperCase();
953
967
  if (t.length === 8) return t;
954
968
  if (t.length === 6) return "FF" + t;
955
969
  throw Error(`Invalid hex: ${e}`);
956
970
  }
957
- function ht(e, t = !1) {
971
+ function zt(e, t = !1) {
958
972
  let n = e;
959
973
  return n.length === 8 && (n = n.substring(2, 8)), n.length === 6 && (n = (t ? "00" : "FF") + n), n.toUpperCase();
960
974
  }
961
- function gt(e) {
975
+ function Bt(e) {
962
976
  let t = `[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ${e.getContent()}`, n = e.getReplies();
963
977
  for (let e = 0; e < n.length; e++) t += `\nReply:\n ${n[e].getContent()}`;
964
978
  return t;
965
979
  }
966
- function _t(e, t, n) {
967
- if (typeof t == "string") return void bt(e, t);
980
+ function Vt(e, t, n) {
981
+ if (typeof t == "string") return void Wt(e, t);
968
982
  let r = t.runs;
969
983
  for (let t = 0; t < r.length; t++) {
970
984
  let i = r[t];
971
- e.start("r"), i.font && yt(e, i.font, n), bt(e, i.text ?? ""), e.end("r");
985
+ e.start("r"), i.font && Ut(e, i.font, n), Wt(e, i.text ?? ""), e.end("r");
972
986
  }
973
987
  }
974
- var vt = {
988
+ var Ht = {
975
989
  serif: 1,
976
990
  "sans-serif": 2,
977
991
  monospace: 3,
978
992
  cursive: 4,
979
993
  fantasy: 5
980
994
  };
981
- function yt(e, t, n) {
995
+ function Ut(e, t, n) {
982
996
  e.start("rPr");
983
997
  let r = (t, n) => {
984
998
  n !== void 0 && e.empty(t, n ? void 0 : { val: 0 });
985
999
  };
986
- if (r("b", t.weight === void 0 ? void 0 : t.weight >= 700), r("i", t.style === void 0 ? void 0 : t.style !== le.Style.Normal), r("strike", t.strike), r("extend", t.extend), r("outline", t.outline), r("shadow", t.shadow), t.underline && e.empty("u", t.underline === le.UnderlineStyle.Single ? void 0 : { val: t.underline }), t.verticalAlign) {
987
- let n = t.verticalAlign === le.VerticalAlignment.Super ? "superscript" : t.verticalAlign === le.VerticalAlignment.Sub ? "subscript" : t.verticalAlign;
1000
+ if (r("b", t.weight === void 0 ? void 0 : t.weight >= 700), r("i", t.style === void 0 ? void 0 : t.style !== R.Style.Normal), r("strike", t.strike), r("extend", t.extend), r("outline", t.outline), r("shadow", t.shadow), t.underline && e.empty("u", t.underline === R.UnderlineStyle.Single ? void 0 : { val: t.underline }), t.verticalAlign) {
1001
+ let n = t.verticalAlign === R.VerticalAlignment.Super ? "superscript" : t.verticalAlign === R.VerticalAlignment.Sub ? "subscript" : t.verticalAlign;
988
1002
  e.empty("vertAlign", { val: n });
989
1003
  }
990
1004
  t.size !== void 0 && e.empty("sz", { val: t.size }), t.color && function(e, t, n) {
991
1005
  let r = /^index(\d+)$/.exec(t);
992
1006
  if (r) return void e.empty("color", { indexed: Number(r[1]) });
993
- G(e, n, t, "color");
1007
+ K(e, n, t, "color");
994
1008
  }(e, t.color, n), t.family && e.empty("rFont", { val: t.family });
995
1009
  let i = t.fallbacks;
996
1010
  if (i) for (let t = 0; t < i.length; t++) {
997
- let n = vt[i[t]];
1011
+ let n = Ht[i[t]];
998
1012
  if (n !== void 0) {
999
1013
  e.empty("family", { val: n });
1000
1014
  break;
1001
1015
  }
1002
1016
  }
1003
- t.charset !== void 0 && e.empty("charset", { val: t.charset }), t.scheme && t.scheme !== le.Scheme.None && e.empty("scheme", { val: t.scheme }), e.end("rPr");
1017
+ t.charset !== void 0 && e.empty("charset", { val: t.charset }), t.scheme && t.scheme !== R.Scheme.None && e.empty("scheme", { val: t.scheme }), e.end("rPr");
1004
1018
  }
1005
- function bt(e, n) {
1006
- e.start("t", t.test(n) || /[\n\r]/.test(n) ? l : void 0), e.text(n), e.end("t");
1019
+ function Wt(e, t) {
1020
+ e.start("t", fe.test(t) || /[\n\r]/.test(t) ? ne : void 0), e.text(t), e.end("t");
1007
1021
  }
1008
- function xt(e) {
1022
+ function Gt(e) {
1009
1023
  let t = e.getRanges();
1010
1024
  if (t.isInvalid()) return null;
1011
1025
  let n = t.getCoords()[0];
@@ -1018,21 +1032,26 @@ function xt(e) {
1018
1032
  col: n.colStart
1019
1033
  } : null;
1020
1034
  }
1021
- function K(e, t, n, r, i = !1, a = !1) {
1035
+ var Kt = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", qt = (e, t, n, r) => {
1036
+ if (!r) return;
1037
+ let i = typeof r == "string" ? { address: r } : r, a = { "xmlns:r": Kt };
1038
+ i.address && (a["r:id"] = e.addExternal("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink", i.address).relId ?? void 0), a.action = i.action, a.tgtFrame = i.target, a.tooltip = i.screenTip, i.history !== void 0 && (a.history = i.history ? "1" : "0"), t.empty(n, a);
1039
+ };
1040
+ function Jt(e, t, n, r, i = !1, a = !1) {
1022
1041
  let o = r.getTheme();
1023
1042
  if (i && t.start("fill"), typeof n == "string" && (n = {
1024
- type: R.Type.Solid,
1043
+ type: L.Type.Solid,
1025
1044
  color: n
1026
- }), n.type === R.Type.None) i ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
1027
- else if (n.type === R.Type.Solid) {
1045
+ }), n.type !== L.Type.Image || i) if (n.type === L.Type.None || n.type === L.Type.Image) i ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
1046
+ else if (n.type === L.Type.Solid) {
1028
1047
  let e = n;
1029
- i ? t.start("patternFill", { patternType: "solid" }) : t.start("solidFill"), e.color && (i ? G(t, o, e.color, "fgColor") : U(t, o, e.color)), i ? t.end("patternFill") : t.end("solidFill");
1030
- } else if (n.type === R.Type.Pattern) {
1048
+ i ? t.start("patternFill", { patternType: "solid" }) : t.start("solidFill"), e.color && (i ? K(t, o, e.color, "fgColor") : W(t, o, e.color)), i ? t.end("patternFill") : t.end("solidFill");
1049
+ } else if (n.type === L.Type.Pattern) {
1031
1050
  let e = n, r = e.patternType || "solid";
1032
- t.start("patternFill", { patternType: r }), e.foreground && (i ? G(t, o, a ? e.background : e.foreground, "fgColor") : U(t, o, a ? e.background : e.foreground)), e.background && (i ? G(t, o, a ? e.foreground : e.background, "bgColor") : U(t, o, a ? e.foreground : e.background)), t.end("patternFill");
1033
- } else if (n.type === R.Type.Gradient && i) {
1051
+ t.start("patternFill", { patternType: r }), e.foreground && (i ? K(t, o, a ? e.background : e.foreground, "fgColor") : W(t, o, a ? e.background : e.foreground)), e.background && (i ? K(t, o, a ? e.foreground : e.background, "bgColor") : W(t, o, a ? e.foreground : e.background)), t.end("patternFill");
1052
+ } else if (n.type === L.Type.Gradient && i) {
1034
1053
  let e = n, r = {}, i = e.gradientType;
1035
- if (i !== R.GradientType.Path && i !== R.GradientType.Linear || (r.type = i), e.angle !== void 0) {
1054
+ if (i !== L.GradientType.Path && i !== L.GradientType.Linear || (r.type = i), e.angle !== void 0) {
1036
1055
  let t = (e.angle - 90) % 360;
1037
1056
  t !== 0 && (r.degree = String(t));
1038
1057
  }
@@ -1046,10 +1065,10 @@ function K(e, t, n, r, i = !1, a = !1) {
1046
1065
  let t = e;
1047
1066
  r = t.offset || 0, n = t.color;
1048
1067
  }
1049
- t.start("stop", { position: String(r) }), n && G(t, o, n, "color"), t.end("stop");
1068
+ t.start("stop", { position: String(r) }), n && K(t, o, n, "color"), t.end("stop");
1050
1069
  }
1051
1070
  t.end("gradientFill");
1052
- } else if (n.type === R.Type.Gradient) {
1071
+ } else if (n.type === L.Type.Gradient) {
1053
1072
  let e = n, r = {};
1054
1073
  e.isRotatedWithShape !== void 0 && (r.rotWithShape = e.isRotatedWithShape ? "1" : "0"), t.start("gradFill", r), t.start("gsLst");
1055
1074
  let i = e.stops;
@@ -1060,11 +1079,11 @@ function K(e, t, n, r, i = !1, a = !1) {
1060
1079
  let t = e;
1061
1080
  r = t.offset || 0, n = t.color;
1062
1081
  }
1063
- t.start("gs", { pos: String(N.roundAccurately(1e3 * r, 0)) }), n && U(t, o, n), t.end("gs");
1082
+ t.start("gs", { pos: String(N.roundAccurately(1e3 * r, 0)) }), n && W(t, o, n), t.end("gs");
1064
1083
  }
1065
1084
  t.end("gsLst");
1066
1085
  let a = e.gradientType;
1067
- if (a && a !== R.GradientType.Linear) {
1086
+ if (a && a !== L.GradientType.Linear) {
1068
1087
  let n = a === "radial" ? "circle" : a;
1069
1088
  t.start("path", { path: n });
1070
1089
  let r = e.focus;
@@ -1081,13 +1100,14 @@ function K(e, t, n, r, i = !1, a = !1) {
1081
1100
  }
1082
1101
  t.end("gradFill");
1083
1102
  } else i ? t.empty("patternFill", { patternType: "none" }) : t.empty("noFill");
1103
+ else un(e, t, n);
1084
1104
  i && t.end("fill");
1085
1105
  }
1086
- var St = (e, t, n, r) => {
1106
+ var Yt = (e, t, n, r) => {
1087
1107
  if (!n) return t.start("ln"), t.empty("noFill"), void t.end("ln");
1088
1108
  typeof n == "string" && (n = { fill: n });
1089
1109
  let i = n, a = {};
1090
- if (i.width !== void 0 && (a.w = String(q(i.width))), i.lineCap !== void 0 && (a.cap = Ct(i.lineCap)), i.compound !== void 0 && (a.cmpd = i.compound), i.align !== void 0 && (a.algn = i.align), t.start("ln", a), K(0, t, i.fill ?? Dt, r), Array.isArray(i.dash)) {
1110
+ if (i.width !== void 0 && (a.w = String(q(i.width))), i.lineCap !== void 0 && (a.cap = Xt(i.lineCap)), i.compound !== void 0 && (a.cmpd = i.compound), i.align !== void 0 && (a.algn = i.align), t.start("ln", a), i.fill !== void 0 && Jt(e, t, i.fill ?? en, r), Array.isArray(i.dash)) {
1091
1111
  t.start("custDash");
1092
1112
  for (let e = 0; e < i.dash.length; e += 2) t.empty("ds", {
1093
1113
  d: String(N.roundAccurately(1e3 * i.dash[e], 0)),
@@ -1095,58 +1115,123 @@ var St = (e, t, n, r) => {
1095
1115
  });
1096
1116
  t.end("custDash");
1097
1117
  } else typeof i.dash == "string" && t.empty("prstDash", { val: i.dash });
1098
- if (i.lineJoin === de.LineJoin.Round) t.empty("round");
1099
- else if (i.lineJoin === de.LineJoin.Bevel) t.empty("bevel");
1100
- else if (i.lineJoin === de.LineJoin.Miter) {
1118
+ if (i.lineJoin === Pe.LineJoin.Round) t.empty("round");
1119
+ else if (i.lineJoin === Pe.LineJoin.Bevel) t.empty("bevel");
1120
+ else if (i.lineJoin === Pe.LineJoin.Miter) {
1101
1121
  let e = {};
1102
1122
  i.miterLimit !== void 0 && (e.lim = String(N.roundAccurately(1e5 * i.miterLimit, 0))), t.empty("miter", e);
1103
1123
  }
1104
- t.end("ln");
1105
- }, Ct = (e) => e === "round" ? "rnd" : e === "butt" ? "flat" : e === "square" ? "sq" : e, wt = (e, t, n, r = void 0, i = !1) => {
1106
- if (!n || !(n.fill || n.stroke || n.effects?.length || i)) return;
1124
+ for (let [e, n, r, a] of [[
1125
+ "headEnd",
1126
+ i.headType,
1127
+ i.headWidth,
1128
+ i.headLength
1129
+ ], [
1130
+ "tailEnd",
1131
+ i.tailType,
1132
+ i.tailWidth,
1133
+ i.tailLength
1134
+ ]]) {
1135
+ if (n === void 0 && r === void 0 && a === void 0) continue;
1136
+ let i = {};
1137
+ n !== void 0 && (i.type = n), r !== void 0 && (i.w = r), a !== void 0 && (i.len = a), t.empty(e, i);
1138
+ }
1139
+ typeof i.extLst == "string" && t.raw(i.extLst), t.end("ln");
1140
+ }, Xt = (e) => e === "round" ? "rnd" : e === "butt" ? "flat" : e === "square" ? "sq" : e, Zt = (e, t, n, r = void 0, i = !1) => {
1141
+ if (!n || !(n.fill || n.stroke || n.effects || i)) return;
1107
1142
  let a = e.getXMLWriter();
1108
- r && a.start(r), a.pushDefaultNamespace("a"), n.fill && K(0, a, n.fill, t), n.stroke && St(0, a, n.stroke, t), n.effects?.length ? Tt(e, a, t.getTheme(), n.effects) : i && a.empty("effectLst"), a.popDefaultNamespace(), r && a.end(r);
1109
- }, Tt = (e, t, n, r) => {
1143
+ r && a.start(r), a.pushDefaultNamespace("a"), n.fill && Jt(e, a, n.fill, t), n.stroke && Yt(e, a, n.stroke, t), n.effects?.length ? Qt(e, a, t.getTheme(), n.effects) : (i || n.effects) && a.empty("effectLst"), a.popDefaultNamespace(), r && a.end(r);
1144
+ }, Qt = (e, t, n, r) => {
1110
1145
  t.start("effectLst");
1111
- for (let e of r) Et(t, n, e);
1146
+ for (let e of r) $t(t, n, e);
1112
1147
  t.end("effectLst");
1113
- }, Et = (e, t, n) => {
1148
+ }, $t = (e, t, n) => {
1114
1149
  switch (n.type) {
1115
- case L.Type.OuterShadow: {
1150
+ case je.Type.OuterShadow: {
1116
1151
  let r = n, i = {};
1117
- r.blur !== void 0 && (i.blurRad = String(q(r.blur))), r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), r.alignment !== void 0 && (i.algn = r.alignment), r.isRotatedWithShape !== void 0 && (i.rotWithShape = r.isRotatedWithShape ? "1" : "0"), r.scaleX !== void 0 && (i.sx = String(N.roundAccurately(1e3 * r.scaleX, 0))), r.scaleY !== void 0 && (i.sy = String(N.roundAccurately(1e3 * r.scaleY, 0))), r.skewX !== void 0 && (i.kx = String(Y(r.skewX))), r.skewY !== void 0 && (i.ky = String(Y(r.skewY))), e.start("outerShdw", i), U(e, t, r.color), e.end("outerShdw");
1152
+ r.blur !== void 0 && (i.blurRad = String(q(r.blur))), r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), r.alignment !== void 0 && (i.algn = r.alignment), r.isRotatedWithShape !== void 0 && (i.rotWithShape = r.isRotatedWithShape ? "1" : "0"), r.scaleX !== void 0 && (i.sx = String(N.roundAccurately(1e3 * r.scaleX, 0))), r.scaleY !== void 0 && (i.sy = String(N.roundAccurately(1e3 * r.scaleY, 0))), r.skewX !== void 0 && (i.kx = String(Y(r.skewX))), r.skewY !== void 0 && (i.ky = String(Y(r.skewY))), e.start("outerShdw", i), W(e, t, r.color), e.end("outerShdw");
1118
1153
  break;
1119
1154
  }
1120
- case L.Type.InnerShadow: {
1155
+ case je.Type.InnerShadow: {
1121
1156
  let r = n, i = {};
1122
- r.blur !== void 0 && (i.blurRad = String(q(r.blur))), r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), e.start("innerShdw", i), U(e, t, r.color), e.end("innerShdw");
1157
+ r.blur !== void 0 && (i.blurRad = String(q(r.blur))), r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), e.start("innerShdw", i), W(e, t, r.color), e.end("innerShdw");
1123
1158
  break;
1124
1159
  }
1125
- case L.Type.PresetShadow: {
1160
+ case je.Type.PresetShadow: {
1126
1161
  let r = n, i = { prst: r.preset };
1127
- r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), e.start("prstShdw", i), U(e, t, r.color), e.end("prstShdw");
1162
+ r.distance !== void 0 && (i.dist = String(q(r.distance))), r.angle !== void 0 && (i.dir = String(Y(r.angle))), e.start("prstShdw", i), W(e, t, r.color), e.end("prstShdw");
1128
1163
  break;
1129
1164
  }
1130
- case L.Type.Glow: {
1165
+ case je.Type.Glow: {
1131
1166
  let r = n, i = {};
1132
- r.radius !== void 0 && (i.rad = String(q(r.radius))), e.start("glow", i), U(e, t, r.color), e.end("glow");
1167
+ r.radius !== void 0 && (i.rad = String(q(r.radius))), e.start("glow", i), W(e, t, r.color), e.end("glow");
1133
1168
  break;
1134
1169
  }
1135
- case L.Type.SoftEdge: {
1170
+ case je.Type.SoftEdge: {
1136
1171
  let t = n, r = {};
1137
1172
  t.radius !== void 0 && (r.rad = String(q(t.radius))), e.empty("softEdge", r);
1138
1173
  break;
1139
1174
  }
1140
- case L.Type.Reflection: {
1175
+ case je.Type.Reflection: {
1141
1176
  let t = n, r = {};
1142
1177
  t.blur !== void 0 && (r.blurRad = String(q(t.blur))), t.distance !== void 0 && (r.dist = String(q(t.distance))), t.angle !== void 0 && (r.dir = String(Y(t.angle))), t.fadeAngle !== void 0 && (r.fadeDir = String(Y(t.fadeAngle))), t.startAlpha !== void 0 && (r.stA = String(N.roundAccurately(1e3 * t.startAlpha, 0))), t.startPosition !== void 0 && (r.stPos = String(N.roundAccurately(1e3 * t.startPosition, 0))), t.endAlpha !== void 0 && (r.endA = String(N.roundAccurately(1e3 * t.endAlpha, 0))), t.endPosition !== void 0 && (r.endPos = String(N.roundAccurately(1e3 * t.endPosition, 0))), t.scaleX !== void 0 && (r.sx = String(N.roundAccurately(1e3 * t.scaleX, 0))), t.scaleY !== void 0 && (r.sy = String(N.roundAccurately(1e3 * t.scaleY, 0))), t.skewX !== void 0 && (r.kx = String(Y(t.skewX))), t.skewY !== void 0 && (r.ky = String(Y(t.skewY))), t.alignment !== void 0 && (r.algn = t.alignment), t.isRotatedWithShape !== void 0 && (r.rotWithShape = t.isRotatedWithShape ? "1" : "0"), e.empty("reflection", r);
1143
1178
  break;
1144
1179
  }
1145
1180
  }
1146
- }, Dt = { type: "none" }, Ot = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", kt = "imagesWritten", At = {
1181
+ }, en = { type: "none" }, tn = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image", nn = "imagesWritten", rn = /* @__PURE__ */ new WeakMap(), an = async (e, t) => {
1182
+ let n = rn.get(e);
1183
+ n || (n = /* @__PURE__ */ new Map(), rn.set(e, n));
1184
+ let r = n.get(t);
1185
+ if (r) return r;
1186
+ let i = await t.getExternalURI(), a;
1187
+ if (i) a = {
1188
+ relId: e.addExternal(tn, i).relId,
1189
+ external: !0
1190
+ };
1191
+ else {
1192
+ let n = e.getSharedStates(), r = n.get(nn);
1193
+ r || (r = /* @__PURE__ */ new Map(), n.set(nn, r));
1194
+ let i = r.get(t);
1195
+ if (!i) {
1196
+ let e = await t.toBuffer();
1197
+ i = {
1198
+ bytes: new Uint8Array(e),
1199
+ type: await t.getType() ?? fn,
1200
+ index: r.size + 1
1201
+ }, r.set(t, i);
1202
+ }
1203
+ a = {
1204
+ relId: e.addBinary(i.bytes, i.type.mime, tn, `../media/image${i.index}.${i.type.ext}`, !0).relId,
1205
+ external: !1
1206
+ };
1207
+ }
1208
+ return n.set(t, a), a;
1209
+ }, on = (e, t) => t === void 0 ? void 0 : e.getSharedStates().get(ze)?.get(t), sn = async (e, t) => {
1210
+ if (!t) return;
1211
+ let n = t.fill;
1212
+ if (n?.type === L.Type.Image) {
1213
+ let t = on(e, n.resId);
1214
+ t && await an(e, t);
1215
+ }
1216
+ for (let n of t.children ?? []) await sn(e, n);
1217
+ }, cn = (e) => String(Math.round(1e3 * e)), ln = (e) => {
1218
+ let t = {};
1219
+ return e.left !== void 0 && (t.l = cn(e.left)), e.top !== void 0 && (t.t = cn(e.top)), e.right !== void 0 && (t.r = cn(e.right)), e.bottom !== void 0 && (t.b = cn(e.bottom)), t;
1220
+ }, un = (e, t, n) => {
1221
+ let r = on(e, n.resId), i = r ? ((e, t) => rn.get(e)?.get(t))(e, r) : void 0;
1222
+ if (!i) return e.warn("An image fill names no image in the workbook; the shape is written with no fill.", void 0, "xlsx.drawing.imageFill.noResource"), void t.empty("noFill");
1223
+ let a = {};
1224
+ n.dpi !== void 0 && (a.dpi = String(n.dpi)), n.isRotatedWithShape !== void 0 && (a.rotWithShape = n.isRotatedWithShape ? "1" : "0"), t.start("blipFill", a), dn(t, n, i), t.end("blipFill");
1225
+ }, dn = (e, t, n) => {
1226
+ let r = { "xmlns:r": Kt };
1227
+ if (r[n.external ? "r:link" : "r:embed"] = n.relId, t.compressionState !== void 0 && (r.cstate = t.compressionState), t.extLst ? (e.start("blip", r), e.raw(t.extLst), e.end("blip")) : e.empty("blip", r), t.sourceRect && e.empty("srcRect", ln(t.sourceRect)), t.tile) {
1228
+ let n = t.tile, r = {};
1229
+ n.offsetX !== void 0 && (r.tx = String(J(n.offsetX))), n.offsetY !== void 0 && (r.ty = String(J(n.offsetY))), n.scaleX !== void 0 && (r.sx = cn(n.scaleX)), n.scaleY !== void 0 && (r.sy = cn(n.scaleY)), n.flip !== void 0 && (r.flip = n.flip), n.alignment !== void 0 && (r.algn = n.alignment), e.empty("tile", r);
1230
+ } else t.stretch && (e.start("stretch"), e.empty("fillRect", ln(t.stretch)), e.end("stretch"));
1231
+ }, fn = {
1147
1232
  mime: "image/png",
1148
1233
  ext: "png"
1149
- }, q = (e = 0) => N.roundAccurately(12700 * e, 0), J = (e = 0) => N.roundAccurately(9525 * e, 0), Y = (e) => 6e4 * e, jt = (e = 0) => N.roundAccurately(100 * e, 2), Mt = class {
1234
+ }, q = (e = 0) => N.roundAccurately(12700 * e, 0), J = (e = 0) => N.roundAccurately(9525 * e, 0), Y = (e) => N.roundAccurately(6e4 * e, 0), pn = (e = 0) => N.roundAccurately(100 * e, 2), mn = class {
1150
1235
  constructor() {
1151
1236
  this._dxfs = [], this._byKey = /* @__PURE__ */ new Map();
1152
1237
  }
@@ -1160,21 +1245,21 @@ var St = (e, t, n, r) => {
1160
1245
  getCount() {
1161
1246
  return this._dxfs.length;
1162
1247
  }
1163
- }, Nt = "cfDxfs", Pt = [
1248
+ }, hn = "cfDxfs", gn = [
1164
1249
  "font",
1165
1250
  "fill",
1166
1251
  "borders",
1167
1252
  "numberFormat",
1168
1253
  "alignment"
1169
1254
  ];
1170
- function Ft(e, t, n) {
1255
+ function _n(e, t, n) {
1171
1256
  if (t) {
1172
1257
  if (t.named) {
1173
1258
  let r = t.named, i = r.toLowerCase(), a = n.namedStyleMap;
1174
1259
  if (!a.has(i)) {
1175
1260
  a.set(i, "" + a.size);
1176
1261
  let t = e.getNamedStyles().getByName(r).toJSON();
1177
- Ft(e, t.style ?? N.EmptyObject, n), n.namedStyles.push(t);
1262
+ _n(e, t.style ?? N.EmptyObject, n), n.namedStyles.push(t);
1178
1263
  }
1179
1264
  }
1180
1265
  t.font && function(e, t, n) {
@@ -1200,24 +1285,24 @@ function Ft(e, t, n) {
1200
1285
  }
1201
1286
  }(0, t.borders, n), t.numberFormat !== void 0 && function(e, t, n) {
1202
1287
  if (!t) return;
1203
- let r = pe.toBuiltInID(t), i = n.numFmtMap;
1288
+ let r = Ie.toBuiltInID(t), i = n.numFmtMap;
1204
1289
  if (!i.has(r)) {
1205
1290
  let e = 0;
1206
- typeof r == "number" ? e = r : (e = n.numFmtsCustom.length + Ht, n.numFmtsCustom.push(r)), i.set(t, "" + e);
1291
+ typeof r == "number" ? e = r : (e = n.numFmtsCustom.length + Tn, n.numFmtsCustom.push(r)), i.set(t, "" + e);
1207
1292
  }
1208
1293
  }(0, t.numberFormat, n);
1209
1294
  }
1210
1295
  }
1211
- function It(e, t, n) {
1296
+ function vn(e, t, n) {
1212
1297
  if (!t) return;
1213
1298
  let r = t.name.toLowerCase();
1214
- n.namedStyleMap.has(r) || (n.namedStyleMap.set(r, "" + n.namedStyleMap.size), n.namedStyles.push(t), Ft(e, t.style, n));
1299
+ n.namedStyleMap.has(r) || (n.namedStyleMap.set(r, "" + n.namedStyleMap.size), n.namedStyles.push(t), _n(e, t.style, n));
1215
1300
  }
1216
- function Lt(e, t, n, r, i = !1) {
1301
+ function yn(e, t, n, r, i = !1) {
1217
1302
  let a = r.getDefaultFontSize(), o = r.getTheme().getFontScheme().getMinorFont() ?? "Calibri", s = r.getNormal().getFont().getColor();
1218
1303
  t.start("font"), n.weight && n.weight >= 700 && t.empty("b"), n.style && n.style !== "normal" && t.empty("i"), n.strike && t.empty("strike"), n.underline && t.empty("u", { val: n.underline }), n.outline && t.empty("outline"), n.shadow && t.empty("shadow"), n.extend && t.empty("extend");
1219
1304
  let c = n.verticalAlign;
1220
- c && (c === "super" && (c = "superscript"), c === "sub" && (c = "subscript"), t.empty("vertAlign", { val: c })), i ? n.size !== void 0 && t.empty("sz", { val: String(n.size) }) : t.empty("sz", { val: String(n.size ?? a) }), G(t, r.getTheme(), n.color ?? s, "color", !i);
1305
+ c && (c === "super" && (c = "superscript"), c === "sub" && (c = "subscript"), t.empty("vertAlign", { val: c })), i ? n.size !== void 0 && t.empty("sz", { val: String(n.size) }) : t.empty("sz", { val: String(n.size ?? a) }), K(t, r.getTheme(), n.color ?? s, "color", !i);
1221
1306
  let l = !i || n.family && n.family !== o;
1222
1307
  if (l && (t.empty("name", { val: n.family ?? o }), n.fallbacks && n.fallbacks.length > 0)) {
1223
1308
  let e = n.fallbacks;
@@ -1227,59 +1312,59 @@ function Lt(e, t, n, r, i = !1) {
1227
1312
  let u = n.scheme ?? (n.family === void 0 ? "minor" : void 0);
1228
1313
  l && u !== void 0 && u !== "none" && t.empty("scheme", { val: u }), t.end("font");
1229
1314
  }
1230
- function X(e, t, n, r, i, a = !1) {
1315
+ function bn(e, t, n, r, i, a = !1) {
1231
1316
  if (!i || i.style === "none" || !i.style) return void (a && !i || t.empty(r));
1232
1317
  t.start(r, { style: i.style });
1233
1318
  let o = i.color;
1234
- o && G(t, n, o, "color", !a, a), t.end(r);
1319
+ o && K(t, n, o, "color", !a, a), t.end(r);
1235
1320
  }
1236
- function Rt(e, t, n, r, i = !1) {
1321
+ function xn(e, t, n, r, i = !1) {
1237
1322
  let a = {};
1238
- i ? (a.diagonalUp = "0", a.diagonalDown = "0") : (n.diagonalUp && (a.diagonalUp = "1"), n.diagonalDown && (a.diagonalDown = "1")), t.start("border", a), X(0, t, r, "left", n.left, i), X(0, t, r, "right", n.right, i), X(0, t, r, "top", n.top, i), X(0, t, r, "bottom", n.bottom, i), i ? (X(0, t, r, "vertical", n.vertical, i), X(0, t, r, "horizontal", n.horizontal, i)) : X(0, t, r, "diagonal", n.diagonalUp ?? n.diagonalDown, i), t.end("border");
1323
+ i ? (a.diagonalUp = "0", a.diagonalDown = "0") : (n.diagonalUp && (a.diagonalUp = "1"), n.diagonalDown && (a.diagonalDown = "1")), t.start("border", a), bn(0, t, r, "left", n.left, i), bn(0, t, r, "right", n.right, i), bn(0, t, r, "top", n.top, i), bn(0, t, r, "bottom", n.bottom, i), i ? (bn(0, t, r, "vertical", n.vertical, i), bn(0, t, r, "horizontal", n.horizontal, i)) : bn(0, t, r, "diagonal", n.diagonalUp ?? n.diagonalDown, i), t.end("border");
1239
1324
  }
1240
- function zt(e, t, n, r = !1) {
1325
+ function Sn(e, t, n, r = !1) {
1241
1326
  let i = {};
1242
- n.horizontal && n.horizontal !== B.HorizontalAlignment.General && (i.horizontal = n.horizontal), n.vertical && n.vertical !== B.VerticalAlignment.Bottom && (i.vertical = n.vertical);
1327
+ n.horizontal && n.horizontal !== V.HorizontalAlignment.General && (i.horizontal = n.horizontal), n.vertical && n.vertical !== V.VerticalAlignment.Bottom && (i.vertical = n.vertical);
1243
1328
  let a = n.rotation;
1244
1329
  n.stacked && (i.textRotation = "255", a = 0), a && (a >= 270 && a < 360 ? a = 360 - a : a > 0 && a <= 90 && (a += 90), i.textRotation = String(a));
1245
1330
  let o = n.overflow;
1246
- switch (o === B.Overflow.Wrap && (i.wrapText = "1"), n.indent && (i.indent = "" + n.indent), n.relativeIndent && (i.relativeIndent = "" + n.relativeIndent), n.justifyLastLine && (i.justifyLastLine = "1"), o === B.Overflow.Shrink && (i.shrinkToFit = "1"), n.readingDirection) {
1247
- case B.ReadingDirection.Auto: break;
1248
- case B.ReadingDirection.LeftToRight:
1331
+ switch (o === V.Overflow.Wrap && (i.wrapText = "1"), n.indent && (i.indent = "" + n.indent), n.relativeIndent && (i.relativeIndent = "" + n.relativeIndent), n.justifyLastLine && (i.justifyLastLine = "1"), o === V.Overflow.Shrink && (i.shrinkToFit = "1"), n.readingDirection) {
1332
+ case V.ReadingDirection.Auto: break;
1333
+ case V.ReadingDirection.LeftToRight:
1249
1334
  i.readingOrder = "1";
1250
1335
  break;
1251
- case B.ReadingDirection.RightToLeft: i.readingOrder = "2";
1336
+ case V.ReadingDirection.RightToLeft: i.readingOrder = "2";
1252
1337
  }
1253
1338
  return Object.keys(i).length > 0 ? i : null;
1254
1339
  }
1255
- function Bt(e, t, n, r, i, a, o = !1) {
1340
+ function Cn(e, t, n, r, i, a, o = !1) {
1256
1341
  let s = {}, c = null, l = r.named;
1257
1342
  l && (c = n.getNamedStyles().getByName(l).toJSON().style);
1258
1343
  let u = r.font ?? c?.font, d = u ? i.fontMap.get(M.JSONStableStringify(u)) ?? 0 : 0, f = r.fill ?? c?.fill, p = f ? i.fillMap.get(M.JSONStableStringify(f)) ?? 0 : 0, m = r.borders ?? c?.borders, h = m ? i.borderMap.get(M.JSONStableStringify(m)) ?? 0 : 0, g = r.numberFormat ?? c?.numberFormat;
1259
1344
  if (s.numFmtId = (g === void 0 ? void 0 : i.numFmtMap.get(g)) ?? "0", s.fontId = String(d), s.fillId = String(p), s.borderId = String(h), a) {
1260
- let e = r.named ?? z.BuiltInName.Normal;
1345
+ let e = r.named ?? B.BuiltInName.Normal;
1261
1346
  s.xfId = i.namedStyleMap.get(e.toLowerCase());
1262
1347
  }
1263
1348
  let _ = null, v = r.alignment ?? c?.alignment;
1264
- v && (_ = zt(0, 0, v)), r.font && (s.applyFont = "1"), r.fill && (s.applyFill = "1"), r.numberFormat && (s.applyNumberFormat = "1"), r.borders && (s.applyBorder = "1"), _ && (s.applyAlignment = "1");
1349
+ v && (_ = Sn(0, 0, v)), r.font && (s.applyFont = "1"), r.fill && (s.applyFill = "1"), r.numberFormat && (s.applyNumberFormat = "1"), r.borders && (s.applyBorder = "1"), _ && (s.applyAlignment = "1");
1265
1350
  let y = null, b = r.protection?.alwaysUnlocked ?? c?.protection?.alwaysUnlocked ?? !1;
1266
1351
  (b || o) && (y = {}, b && (y.locked = "0"), o && (y.hidden = "1"), s.applyProtection = "1"), r.quotePrefix && (s.quotePrefix = "1"), _ || y ? (t.start("xf", s), _ && t.empty("alignment", _), y && t.empty("protection", y), t.end("xf")) : t.empty("xf", s);
1267
1352
  }
1268
- function Vt(e, t, n, r, i, a = "dxf", o = Ht) {
1269
- if (t.start(a), n.font && Lt(0, t, n.font, r, !0), n.numberFormat !== void 0 && n.numberFormat !== null) {
1270
- let e = pe.toBuiltInID(n.numberFormat), r = typeof e == "number", i = r ? pe.builtInFormat(e) : String(e);
1353
+ function wn(e, t, n, r, i, a = "dxf", o = Tn) {
1354
+ if (t.start(a), n.font && yn(0, t, n.font, r, !0), n.numberFormat !== void 0 && n.numberFormat !== null) {
1355
+ let e = Ie.toBuiltInID(n.numberFormat), r = typeof e == "number", i = r ? Ie.builtInFormat(e) : String(e);
1271
1356
  i && t.empty("numFmt", {
1272
1357
  numFmtId: String(r ? e : o++),
1273
1358
  formatCode: i
1274
1359
  });
1275
1360
  }
1276
- if (n.fill && K(0, t, n.fill, r, !0, !0), n.alignment) {
1277
- let e = zt(0, 0, n.alignment, !0);
1361
+ if (n.fill && Jt(e, t, n.fill, r, !0, !0), n.alignment) {
1362
+ let e = Sn(0, 0, n.alignment, !0);
1278
1363
  e && t.empty("alignment", e);
1279
1364
  }
1280
- return n.borders && Rt(0, t, n.borders, i, !0), t.end(a), o;
1365
+ return n.borders && xn(0, t, n.borders, i, !0), t.end(a), o;
1281
1366
  }
1282
- var Ht = 164, Ut = Object.freeze([
1367
+ var Tn = 164, En = Object.freeze([
1283
1368
  "wholeTable",
1284
1369
  "headerRow",
1285
1370
  "totalRow",
@@ -1293,7 +1378,7 @@ var Ht = 164, Ut = Object.freeze([
1293
1378
  "lastHeaderCell",
1294
1379
  "firstTotalCell",
1295
1380
  "lastTotalCell"
1296
- ]), Wt = F.BuiltInOperatorNames, Gt = (e, t, n, r, i, a) => {
1381
+ ]), Dn = F.BuiltInOperatorNames, On = (e, t, n, r, i, a) => {
1297
1382
  let o = r.sorts, s = o ? o.length : 0;
1298
1383
  if (s === 0) return;
1299
1384
  let c = {};
@@ -1312,7 +1397,7 @@ var Ht = 164, Ut = Object.freeze([
1312
1397
  }).toString(), r.sortOn && (c.sortBy = r.sortOn), r.dxfId !== void 0 && (c.dxfId = r.dxfId), r.iconSet !== void 0 && (c.iconSet = r.iconSet), r.customList !== void 0 && (c.customList = r.customList), t.empty("sortCondition", c);
1313
1398
  }
1314
1399
  t.end("sortState");
1315
- }, Kt = (e, t, n, r, i = !1) => {
1400
+ }, kn = (e, t, n, r, i = !1) => {
1316
1401
  let a = n.getRange();
1317
1402
  n.isShowTotals() && (a = a.getResizeBy(-1, 0));
1318
1403
  let o = a.getCoords(), s = r.sort, c = r.filter, l = c ? c.conditions : void 0, u = l ? l.length : 0, d = r.hiddenButtons, f = {};
@@ -1332,103 +1417,111 @@ var Ht = 164, Ut = Object.freeze([
1332
1417
  r.columns ? c = r.columns.length : i && (c = a.getColumnCount()), t.start("autoFilter", f);
1333
1418
  for (let n = 0; n < c; n++) {
1334
1419
  let r = !0 === d || !0 === p?.[n], i = m[n];
1335
- (i || r) && Jt(e, t, n, i, r);
1420
+ (i || r) && jn(e, t, n, i, r);
1336
1421
  }
1337
- s && i && Gt(0, t, n, s, a, o), t.end("autoFilter");
1422
+ s && i && On(0, t, n, s, a, o), t.end("autoFilter");
1338
1423
  } else t.empty("autoFilter", f);
1339
- s && !i && Gt(0, t, n, s, a, o);
1340
- }, qt = (e, t, n) => {
1341
- let r = T(n, (t) => e.warn(t, n));
1424
+ s && !i && On(0, t, n, s, a, o);
1425
+ }, An = (e, t, n) => {
1426
+ let r = w(n, (t) => e.warn(t, n));
1342
1427
  if (!r) return;
1343
1428
  let i = { operator: r.operator };
1344
1429
  r.val !== void 0 && (i.val = r.val), t.empty("customFilter", i);
1345
- }, Jt = (e, t, n, r, i) => {
1346
- let a = {};
1347
- a.colId = "" + n, i && (a.hiddenButton = "1"), r ? (t.start("filterColumn", a), ((e, t, n) => {
1348
- let r = n.operator;
1349
- if (r !== F.BuiltInOperatorNames.Expression) if (r !== F.BuiltInOperatorNames.Unique) {
1350
- if (r === F.BuiltInOperatorNames.Color) {
1351
- let e = n.param, r = {};
1352
- e.cellColor !== void 0 && (r.cellColor = e.cellColor ? "1" : "0"), e.styleId !== void 0 && (r.dxfId = e.styleId), t.empty("colorFilter", r);
1430
+ }, jn = (t, n, r, i, a) => {
1431
+ let o = {};
1432
+ o.colId = "" + r, a && (o.hiddenButton = "1"), i ? (n.start("filterColumn", o), ((t, n, r) => {
1433
+ let i = r.operator;
1434
+ if (i === F.BuiltInOperatorNames.Expression) return void t.warn("Expression conditions not supported in Table AutoFilters", r);
1435
+ if (i === F.BuiltInOperatorNames.Unique) return void t.warn("Unique conditions not supported in Table AutoFilters", r);
1436
+ if (i === F.BuiltInOperatorNames.Color) {
1437
+ let e = r.param, t = {};
1438
+ e.cellColor !== void 0 && (t.cellColor = e.cellColor ? "1" : "0"), e.styleId !== void 0 && (t.dxfId = e.styleId), n.empty("colorFilter", t);
1439
+ }
1440
+ let a = Se(r);
1441
+ if (a !== null) return void Mn(n, a === "" ? [] : [a], [], a === "" || !0 === r.includeBlanks);
1442
+ let o = e(r);
1443
+ if (o) {
1444
+ n.start("customFilters", o.and ? { and: "1" } : {});
1445
+ for (let e of o.filters) n.empty("customFilter", {
1446
+ operator: e.operator,
1447
+ val: e.val
1448
+ });
1449
+ n.end("customFilters");
1450
+ } else if (i !== Dn.Blank) {
1451
+ if (i === F.BuiltInOperatorNames.InSet) {
1452
+ let e = r.param ?? {};
1453
+ typeof e.items == "string" ? t.warn("A list source is not supported in Table AutoFilters", r) : !e.byDisplay && Array.isArray(e.items) && e.items.some((e) => typeof e == "number") && t.warn("A values list by value is written as General text; it reopens as a list by displayed text", r), Mn(n, Array.isArray(e.items) ? e.items : [], e.dateGroups ?? [], !0 === r.includeBlanks || !0 === e.blank, e.calendarType);
1454
+ return;
1353
1455
  }
1354
- if (Yt(r)) if (r === "between") {
1355
- let r = n.param;
1356
- t.start("customFilters", { and: "1" }), qt(e, t, {
1357
- operator: Wt.GreaterThanEqualTo,
1358
- param: r.from
1359
- }), qt(e, t, {
1360
- operator: Wt.LessThanEqualTo,
1361
- param: r.to
1362
- }), t.end("customFilters");
1363
- } else if (r === F.BuiltInOperatorNames.Not) {
1364
- let r = n.param;
1365
- te(r?.operator) ? (t.start("customFilters"), qt(e, t, n), t.end("customFilters")) : e.warn("Not rule with non-comparison criteria not supported in OOXML", r);
1366
- } else if (r === F.BuiltInOperatorNames.And || r === F.BuiltInOperatorNames.Or) {
1367
- let i = n.param, a = i.length;
1456
+ if (i === Dn.And || i === Dn.Or) {
1457
+ let e = r.param ?? [], a = e.length;
1368
1458
  if (a > 0) {
1369
- let n = {};
1370
- r === F.BuiltInOperatorNames.And && a > 1 && (n.and = "1"), t.start("customFilters", n);
1371
- for (let n = 0; n < a; n++) {
1372
- let r = i[n], a = r.operator === Wt.Not && te(r.param?.operator);
1373
- te(r.operator) || a ? qt(e, t, r) : e.warn("Only Comparison criteria supported in Union conditions for Table AutoFilters", r);
1459
+ let r = {};
1460
+ i === Dn.And && a > 1 && (r.and = "1"), n.start("customFilters", r);
1461
+ for (let r = 0; r < a; r++) {
1462
+ let i = e[r];
1463
+ T(i) ? An(t, n, i) : t.warn("Only comparison and text criteria are supported in combined Table AutoFilters", i);
1374
1464
  }
1375
- t.end("customFilters");
1465
+ n.end("customFilters");
1376
1466
  }
1377
- } else te(r) && (t.start("customFilters"), qt(e, t, n), t.end("customFilters"));
1378
- if (r === F.BuiltInOperatorNames.TimePeriod) {
1379
- let e = n.param, r = {};
1380
- e.type && (r.type = e.type), e.anchorDate !== void 0 && (r.val = "" + e.anchorDate), e.maxVal !== void 0 && (r.maxVal = "" + e.maxVal), t.empty("dynamicFilter", r);
1467
+ } else T(r) ? (n.start("customFilters"), An(t, n, r), n.end("customFilters")) : i === Dn.Not && t.warn("Not rule with non-comparison criteria not supported in OOXML", r.param);
1468
+ if (i === F.BuiltInOperatorNames.TimePeriod) {
1469
+ let e = r.param?.type;
1470
+ e && _e.has(e) ? n.empty("dynamicFilter", { type: e }) : t.warn(`TimePeriod '${e}' has no OOXML dynamicFilter type; not written`, r.param);
1381
1471
  }
1382
- if (r === F.BuiltInOperatorNames.Average) {
1383
- let e = n.param, r = {}, i = e.type;
1384
- i && (i === F.AverageType.Above ? r.type = "aboveAverage" : i === F.AverageType.Below && (r.type = "belowAverage")), e.stdDevs !== void 0 && (r.val = "" + e.stdDevs), t.empty("dynamicFilter", r);
1472
+ if (i === F.BuiltInOperatorNames.Average) {
1473
+ let e = r.param, i = e?.type === F.AverageType.Below ? "belowAverage" : "aboveAverage";
1474
+ e?.stdDevs && t.warn(`Average with stdDevs has no OOXML spelling; written as ${i}`, r.param), n.empty("dynamicFilter", { type: i });
1385
1475
  }
1386
- if (r === F.BuiltInOperatorNames.InSet) {
1387
- let e = n.param;
1388
- if (e.dateGroups) {
1389
- let n = e.dateGroups, r = n.length;
1390
- t.start("dateGroupItem");
1391
- for (let e = 0; e < r; e++) {
1392
- let r = n[e], i = {};
1393
- r.day !== void 0 && (i.day = "" + r.day), r.hour !== void 0 && (i.hour = "" + r.hour), r.minute !== void 0 && (i.minute = "" + r.minute), r.second !== void 0 && (i.second = "" + r.second), r.year !== void 0 && (i.year = "" + r.year), r.month !== void 0 && (i.month = "" + r.month), i.dateTimeGrouping = r.group, t.empty("dateGroupItem", i);
1394
- }
1395
- t.end("dateGroupItem");
1396
- }
1397
- if (e.items) {
1398
- let n = e.items, r = n.length;
1399
- t.start("filters");
1400
- for (let e = 0; e < r; e++) {
1401
- let r = n[e];
1402
- t.empty("filter", { val: "" + r });
1403
- }
1404
- t.end("filters");
1405
- }
1406
- }
1407
- if (r === F.BuiltInOperatorNames.Icon) {
1408
- let e = n.param, r = {};
1409
- e.iconSet !== void 0 && (r.iconSet = e.iconSet), e.iconId !== void 0 && (r.iconId = "" + e.iconId), t.empty("iconFilter", r);
1476
+ if (i === F.BuiltInOperatorNames.Icon) {
1477
+ let e = r.param, t = {};
1478
+ e.iconSet !== void 0 && (t.iconSet = e.iconSet), e.iconId !== void 0 && (t.iconId = "" + e.iconId), n.empty("iconFilter", t);
1410
1479
  }
1411
- if (r === F.BuiltInOperatorNames.TopN) {
1412
- let e = n.param, r = {};
1413
- e.percent && (r.percent = "1"), e.top !== void 0 && (r.top = e.top ? "1" : "0"), e.limit !== void 0 && (r.val = "" + e.limit), e.filterVal !== void 0 && (r.filterVal = "" + e.filterVal), t.empty("top10", r);
1480
+ if (i === F.BuiltInOperatorNames.TopN) {
1481
+ let e = r.param, t = {};
1482
+ e.percent && (t.percent = "1"), e.top !== void 0 && (t.top = e.top ? "1" : "0"), e.limit !== void 0 && (t.val = "" + e.limit), e.filterVal !== void 0 && (t.filterVal = "" + e.filterVal), n.empty("top10", t);
1414
1483
  }
1415
- } else e.warn("Unique conditions not supported in Table AutoFilters", n);
1416
- else e.warn("Expression conditions not supported in Table AutoFilters", n);
1417
- })(e, t, r), t.end("filterColumn")) : t.empty("filterColumn", a);
1418
- }, Yt = (e) => e === F.BuiltInOperatorNames.GreaterThan || e === F.BuiltInOperatorNames.GreaterThanEqualTo || e === F.BuiltInOperatorNames.LessThan || e === F.BuiltInOperatorNames.LessThanEqualTo || e === F.BuiltInOperatorNames.EqualTo || e === F.BuiltInOperatorNames.And || e === F.BuiltInOperatorNames.Or || e === F.BuiltInOperatorNames.Not || e === "between", Xt = {
1484
+ } else Mn(n, [], [], !0);
1485
+ })(t, n, i), n.end("filterColumn")) : n.empty("filterColumn", o);
1486
+ }, Mn = (e, t, n, r, i) => {
1487
+ let a = t.length, o = n.length;
1488
+ if (a === 0 && o === 0 && !r) return;
1489
+ let s = {};
1490
+ if (r && (s.blank = "1"), i !== void 0 && (s.calendarType = i), a !== 0 || o !== 0) {
1491
+ e.start("filters", s);
1492
+ for (let n = 0; n < a; n++) {
1493
+ let r = h(t[n]);
1494
+ r !== void 0 && e.empty("filter", { val: r });
1495
+ }
1496
+ for (let t = 0; t < o; t++) {
1497
+ let r = n[t], i = {};
1498
+ r.year !== void 0 && (i.year = "" + r.year), r.month !== void 0 && (i.month = "" + r.month), r.day !== void 0 && (i.day = "" + r.day), r.hour !== void 0 && (i.hour = "" + r.hour), r.minute !== void 0 && (i.minute = "" + r.minute), r.second !== void 0 && (i.second = "" + r.second), i.dateTimeGrouping = r.group, e.empty("dateGroupItem", i);
1499
+ }
1500
+ e.end("filters");
1501
+ } else e.empty("filters", s);
1502
+ }, Nn = {
1419
1503
  names: /* @__PURE__ */ new Set(),
1420
1504
  perFormula: [],
1421
1505
  affects: () => !1
1422
- }, Zt = 1048576, Qt = (e, t, n) => {
1506
+ };
1507
+ function Pn(e, t) {
1508
+ let n = /* @__PURE__ */ new Set(), r = e.getGroups(t), i = e.getSummaryDirection(t), a = i === z.Direction.Down || i === z.Direction.Right;
1509
+ for (let e = 0; e < r.length; e++) {
1510
+ let t = r[e];
1511
+ t.collapsed && n.add(t.summary ?? (a ? t.end : t.start));
1512
+ }
1513
+ return n;
1514
+ }
1515
+ var Fn = 1048576, In = (e, t, n) => {
1423
1516
  if (!n) return [];
1424
1517
  let r = 0;
1425
1518
  for (let i = 0; i < n.length; i++) {
1426
1519
  let a = n[i][0], o = t.getRange(a).getCoords();
1427
- if (r += (o.rowEnd - o.rowStart + 1) * (o.colEnd - o.colStart + 1), r > Zt) return e.warn(`Direct styles cover more than ${Zt} cells; not writing the styles from '${a}' on. A range that size belongs in a column or row style.`), n.slice(0, i);
1520
+ if (r += (o.rowEnd - o.rowStart + 1) * (o.colEnd - o.colStart + 1), r > Fn) return e.warn(`Direct styles cover more than ${Fn} cells; not writing the styles from '${a}' on. A range that size belongs in a column or row style.`), n.slice(0, i);
1428
1521
  }
1429
1522
  return n;
1430
1523
  };
1431
- function $t(e, t) {
1524
+ function Ln(e, t) {
1432
1525
  let n = t.type;
1433
1526
  n === I.ColorStopType.AutoMin ? n = I.ColorStopType.Min : n === I.ColorStopType.AutoMax && (n = I.ColorStopType.Max), e.empty("cfvo", {
1434
1527
  type: n,
@@ -1436,54 +1529,54 @@ function $t(e, t) {
1436
1529
  gte: t.exclusive ? "0" : void 0
1437
1530
  });
1438
1531
  }
1439
- function en(e, t) {
1532
+ function Rn(e, t) {
1440
1533
  let n = {
1441
1534
  type: t.type,
1442
1535
  gte: t.exclusive ? "0" : void 0
1443
1536
  };
1444
1537
  t.value === void 0 ? e.empty("x14:cfvo", n) : (e.start("x14:cfvo", n), e.start("xm:f"), e.text(t.value), e.end("xm:f"), e.end("x14:cfvo"));
1445
1538
  }
1446
- var tn = /* @__PURE__ */ new Set([
1447
- z.IconSet.Arrows3,
1448
- z.IconSet.ArrowsGray3,
1449
- z.IconSet.Flags3,
1450
- z.IconSet.Signs3,
1451
- z.IconSet.Symbols3,
1452
- z.IconSet.Symbols3_2,
1453
- z.IconSet.TrafficLights3,
1454
- z.IconSet.TrafficLights3_2,
1455
- z.IconSet.Arrows4,
1456
- z.IconSet.ArrowsGray4,
1457
- z.IconSet.Rating4,
1458
- z.IconSet.RedToBlack4,
1459
- z.IconSet.TrafficLights4,
1460
- z.IconSet.Arrows5,
1461
- z.IconSet.ArrowsGray5,
1462
- z.IconSet.Quarters5,
1463
- z.IconSet.Rating5
1539
+ var zn = /* @__PURE__ */ new Set([
1540
+ B.IconSet.Arrows3,
1541
+ B.IconSet.ArrowsGray3,
1542
+ B.IconSet.Flags3,
1543
+ B.IconSet.Signs3,
1544
+ B.IconSet.Symbols3,
1545
+ B.IconSet.Symbols3_2,
1546
+ B.IconSet.TrafficLights3,
1547
+ B.IconSet.TrafficLights3_2,
1548
+ B.IconSet.Arrows4,
1549
+ B.IconSet.ArrowsGray4,
1550
+ B.IconSet.Rating4,
1551
+ B.IconSet.RedToBlack4,
1552
+ B.IconSet.TrafficLights4,
1553
+ B.IconSet.Arrows5,
1554
+ B.IconSet.ArrowsGray5,
1555
+ B.IconSet.Quarters5,
1556
+ B.IconSet.Rating5
1464
1557
  ]);
1465
- function nn(e) {
1466
- return (e.icon?.length ?? 0) > 0 || e.iconSet !== void 0 && !tn.has(e.iconSet);
1558
+ function Bn(e) {
1559
+ return (e.icon?.length ?? 0) > 0 || e.iconSet !== void 0 && !zn.has(e.iconSet);
1467
1560
  }
1468
- function rn(e, t, n, r, i, a, o, s, c) {
1469
- let l = r.scale;
1470
- r.ext && e.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1471
- let u = {
1472
- type: i.type,
1473
- dxfId: r.style && Object.keys(r.style).length > 0 ? s.add(r.style) : void 0,
1474
- priority: o,
1475
- stopIfTrue: Z(r.stopIfTrue),
1476
- aboveAverage: Z(i.aboveAverage),
1477
- equalAverage: Z(i.equalAverage),
1478
- stdDev: i.stdDev,
1479
- bottom: Z(i.bottom),
1480
- percent: Z(i.percent),
1481
- rank: i.rank,
1482
- operator: i.operator,
1483
- text: i.text,
1484
- timePeriod: i.timePeriod
1485
- }, d;
1486
- l?.type === I.ScaleType.DataBar && function(e) {
1561
+ function Vn(e, t, r, i, a, o, s, c, l) {
1562
+ let u = i.scale;
1563
+ i.ext && e.warn("Conditional format extension payload is not written to xlsx; it will be lost.");
1564
+ let d = {
1565
+ type: a.type,
1566
+ dxfId: i.style && Object.keys(i.style).length > 0 ? c.add(i.style) : void 0,
1567
+ priority: s,
1568
+ stopIfTrue: X(i.stopIfTrue),
1569
+ aboveAverage: X(a.aboveAverage),
1570
+ equalAverage: X(a.equalAverage),
1571
+ stdDev: a.stdDev,
1572
+ bottom: X(a.bottom),
1573
+ percent: X(a.percent),
1574
+ rank: a.rank,
1575
+ operator: a.operator,
1576
+ text: a.text,
1577
+ timePeriod: a.timePeriod
1578
+ }, f;
1579
+ u?.type === I.ScaleType.DataBar && function(e) {
1487
1580
  if (e.gradient || e.borderColor || e.negativeFillColor || e.negativeBorderColor || e.axisColor || e.axisPosition || e.direction) return !0;
1488
1581
  let t = e.stops, n = t ? t.length : 0;
1489
1582
  for (let e = 0; e < n; e++) {
@@ -1491,48 +1584,48 @@ function rn(e, t, n, r, i, a, o, s, c) {
1491
1584
  if (n === I.ColorStopType.AutoMin || n === I.ColorStopType.AutoMax) return !0;
1492
1585
  }
1493
1586
  return !1;
1494
- }(l) && (d = O(N.uuidV4), c.push({
1495
- guid: d,
1496
- sqref: a,
1497
- priority: o,
1498
- scale: l
1587
+ }(u) && (f = E(N.uuidV4), l.push({
1588
+ guid: f,
1589
+ sqref: o,
1590
+ priority: s,
1591
+ scale: u
1499
1592
  }));
1500
- let f = i.formulas, p = f ? f.length : 0;
1501
- if (p !== 0 || l) {
1502
- t.start("cfRule", u);
1503
- for (let e = 0; e < p; e++) t.start("formula"), t.text(f[e]), t.end("formula");
1504
- if (l?.type === I.ScaleType.ColorScale) {
1505
- let e = l.stops ?? [];
1593
+ let p = a.formulas, m = p ? p.length : 0;
1594
+ if (m !== 0 || u) {
1595
+ t.start("cfRule", d);
1596
+ for (let e = 0; e < m; e++) t.start("formula"), t.text(p[e]), t.end("formula");
1597
+ if (u?.type === I.ScaleType.ColorScale) {
1598
+ let e = u.stops ?? [];
1506
1599
  t.start("colorScale");
1507
- for (let n = 0; n < e.length; n++) $t(t, e[n]);
1508
- for (let r = 0; r < e.length; r++) G(t, n, e[r].color, "color");
1600
+ for (let n = 0; n < e.length; n++) Ln(t, e[n]);
1601
+ for (let n = 0; n < e.length; n++) K(t, r, e[n].color, "color");
1509
1602
  t.end("colorScale");
1510
- } else if (l?.type === I.ScaleType.DataBar) {
1511
- let e = l.stops ?? [];
1603
+ } else if (u?.type === I.ScaleType.DataBar) {
1604
+ let e = u.stops ?? [];
1512
1605
  t.start("dataBar", {
1513
- minLength: l.minLength,
1514
- maxLength: l.maxLength,
1515
- showValue: Z(l.showValue)
1606
+ minLength: u.minLength,
1607
+ maxLength: u.maxLength,
1608
+ showValue: X(u.showValue)
1516
1609
  });
1517
- for (let n = 0; n < e.length; n++) $t(t, e[n]);
1518
- l.color && G(t, n, l.color, "color"), t.end("dataBar");
1519
- } else if (l?.type === I.ScaleType.IconSet) {
1520
- let e = l.stops ?? [];
1610
+ for (let n = 0; n < e.length; n++) Ln(t, e[n]);
1611
+ u.color && K(t, r, u.color, "color"), t.end("dataBar");
1612
+ } else if (u?.type === I.ScaleType.IconSet) {
1613
+ let e = u.stops ?? [];
1521
1614
  t.start("iconSet", {
1522
- iconSet: l.iconSet,
1523
- reverse: Z(l.reverse),
1524
- showValue: Z(l.showValue)
1615
+ iconSet: u.iconSet,
1616
+ reverse: X(u.reverse),
1617
+ showValue: X(u.showValue)
1525
1618
  });
1526
- for (let n = 0; n < e.length; n++) $t(t, e[n]);
1619
+ for (let n = 0; n < e.length; n++) Ln(t, e[n]);
1527
1620
  t.end("iconSet");
1528
1621
  }
1529
- d && (t.start("extLst"), t.start("ext", {
1530
- uri: h,
1531
- "xmlns:x14": D
1532
- }), t.start("x14:id"), t.text(d), t.end("x14:id"), t.end("ext"), t.end("extLst")), t.end("cfRule");
1533
- } else t.empty("cfRule", u);
1622
+ f && (t.start("extLst"), t.start("ext", {
1623
+ uri: n,
1624
+ "xmlns:x14": ve
1625
+ }), t.start("x14:id"), t.text(f), t.end("x14:id"), t.end("ext"), t.end("extLst")), t.end("cfRule");
1626
+ } else t.empty("cfRule", d);
1534
1627
  }
1535
- function an(e) {
1628
+ function Hn(e) {
1536
1629
  let t = 2 ** 53 - 1, n = 2 ** 53 - 1, r = e.split(" ");
1537
1630
  for (let e = 0; e < r.length; e++) {
1538
1631
  if (!r[e]) continue;
@@ -1544,7 +1637,7 @@ function an(e) {
1544
1637
  colIndex: n
1545
1638
  });
1546
1639
  }
1547
- function on(e) {
1640
+ function Un(e) {
1548
1641
  if (typeof e == "string") return e.split(",").join(" ");
1549
1642
  if (Array.isArray(e)) {
1550
1643
  let t = [];
@@ -1556,10 +1649,10 @@ function on(e) {
1556
1649
  }
1557
1650
  return j.rangeToString(e);
1558
1651
  }
1559
- function Z(e) {
1652
+ function X(e) {
1560
1653
  if (e !== void 0) return e ? "1" : "0";
1561
1654
  }
1562
- function sn(e) {
1655
+ function Wn(e) {
1563
1656
  if (typeof e != "string") return !1;
1564
1657
  let t = !1;
1565
1658
  for (let n = 0; n < e.length; n++) {
@@ -1569,12 +1662,12 @@ function sn(e) {
1569
1662
  }
1570
1663
  return !1;
1571
1664
  }
1572
- function cn(e) {
1665
+ function Gn(e) {
1573
1666
  let t = e.formulas, n = t ? t.length : 0;
1574
- for (let e = 0; e < n; e++) if (sn(t[e])) return !0;
1667
+ for (let e = 0; e < n; e++) if (Wn(t[e])) return !0;
1575
1668
  return !1;
1576
1669
  }
1577
- function ln(e) {
1670
+ function Kn(e) {
1578
1671
  let t = 2 ** 53 - 1, n = 2 ** 53 - 1, r = e.split(" ");
1579
1672
  for (let e = 0; e < r.length; e++) {
1580
1673
  if (!r[e]) continue;
@@ -1586,23 +1679,23 @@ function ln(e) {
1586
1679
  colIndex: n
1587
1680
  };
1588
1681
  }
1589
- function un(e, t, n) {
1682
+ function qn(e, t, n) {
1590
1683
  if (typeof e != "string" || !e || !t || !n) return e;
1591
1684
  try {
1592
1685
  let r = n.parse(e, t);
1593
- return r && ce.image(n.spell(r, !0), { at: t }) || e;
1686
+ return r && Ae.image(n.spell(r, !0), { at: t }) || e;
1594
1687
  } catch {
1595
1688
  return e;
1596
1689
  }
1597
1690
  }
1598
- function dn(e, t, n) {
1691
+ function Jn(e, t, n) {
1599
1692
  let r = e?.stops;
1600
1693
  if (!r || !n) return e;
1601
1694
  let i;
1602
1695
  for (let e = 0; e < r.length; e++) {
1603
1696
  let a = r[e]?.value;
1604
1697
  if (typeof a != "string") continue;
1605
- let o = un(a, t, n);
1698
+ let o = qn(a, t, n);
1606
1699
  o !== a && (i ||= [...r], i[e] = {
1607
1700
  ...r[e],
1608
1701
  value: o
@@ -1613,12 +1706,12 @@ function dn(e, t, n) {
1613
1706
  stops: i
1614
1707
  } : e;
1615
1708
  }
1616
- function fn(e, t, n, r) {
1709
+ function Yn(e, t, n, r) {
1617
1710
  if (!r?.xml) return;
1618
1711
  let i = e.addPart("legacyDrawing", r);
1619
1712
  t.empty(n, { "r:id": i.relId });
1620
1713
  }
1621
- var pn = (e, t, n, r) => {
1714
+ var Xn = (e, t, n, r) => {
1622
1715
  let i = (t, n) => {
1623
1716
  let r = e.getRangeAtBounds({
1624
1717
  x: t,
@@ -1663,12 +1756,12 @@ var pn = (e, t, n, r) => {
1663
1756
  bounds: a,
1664
1757
  anchor: [...i(a.x, a.y), ...i(a.x + a.width, a.y + a.height)]
1665
1758
  };
1666
- }, mn = (e, t) => {
1759
+ }, Zn = (e, t) => {
1667
1760
  if (!t) return e;
1668
- let n = e?.xml ?? null, r = g(n ?? ""), i = [], a = t.comments;
1761
+ let n = e?.xml ?? null, r = D(n ?? ""), i = [], a = t.comments;
1669
1762
  for (let e = 0; e < a.length; e++) {
1670
- let { comment: n, row: o, col: s } = a[e], c = n.isNote() ? n.toJSON() : null, { bounds: l, anchor: u } = pn(t.sheet, n, o, s);
1671
- i.push(_(c?.box?.xml, {
1763
+ let { comment: n, row: o, col: s } = a[e], c = n.isNote() ? n.toJSON() : null, { bounds: l, anchor: u } = Xn(t.sheet, n, o, s);
1764
+ i.push(te(c?.box?.xml, {
1672
1765
  shapeId: ++r,
1673
1766
  zIndex: e + 1,
1674
1767
  row: o,
@@ -1679,26 +1772,23 @@ var pn = (e, t, n, r) => {
1679
1772
  alt: c?.description
1680
1773
  }));
1681
1774
  }
1682
- let o = x(n, i, r);
1775
+ let o = ce(n, i, r);
1683
1776
  return o ? o === n ? e : e ? {
1684
1777
  ...e,
1685
1778
  xml: o
1686
1779
  } : { xml: o } : e;
1687
- }, hn = (e) => e.content?.type !== "control", gn = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp", _n = (e, t) => {
1780
+ }, Qn = (e) => !oe(e.content?.type), $n = (e, t) => {
1688
1781
  if (!e?.xml) return e;
1689
- let n = t.movables;
1690
- if (!n) return e;
1691
- let r = /* @__PURE__ */ new Map(), i = n.length;
1782
+ let n = t.movables ?? [], r = /* @__PURE__ */ new Map(), i = n.length;
1692
1783
  for (let e = 0; e < i; e++) {
1693
1784
  let t = n[e];
1694
- if (hn(t)) continue;
1785
+ if (Qn(t)) continue;
1695
1786
  let i = t.content?.json?.shapeId;
1696
1787
  typeof i == "number" && r.set(i, t);
1697
1788
  }
1698
- if (r.size === 0) return e;
1699
- let a = e.xml.replace(/<v:shape\b[\s\S]*?<\/v:shape>/g, (e) => {
1700
- let t = /\bo:spid="_x0000_s(\d+)"/.exec(e) ?? /\bid="_x0000_s(\d+)"/.exec(e), n = t ? r.get(parseInt(t[1], 10)) : void 0;
1701
- if (!n) return e;
1789
+ let a = we(e.xml, (e, t) => {
1790
+ let n = t === null ? void 0 : r.get(t);
1791
+ if (!n) return null;
1702
1792
  let i = n.anchor, a = [
1703
1793
  i.tl.c,
1704
1794
  i.tl.r,
@@ -1717,15 +1807,15 @@ var pn = (e, t, n, r) => {
1717
1807
  ...e,
1718
1808
  xml: a
1719
1809
  };
1720
- }, vn = (e, t, n) => {
1810
+ }, er = (e, t, n) => {
1721
1811
  e.start(t), e.start("xdr:col"), e.text(n.c ?? 0), e.end("xdr:col"), e.start("xdr:colOff"), e.text(J(n.x)), e.end("xdr:colOff"), e.start("xdr:row"), e.text(n.r ?? 0), e.end("xdr:row"), e.start("xdr:rowOff"), e.text(J(n.y)), e.end("xdr:rowOff"), e.end(t);
1722
- }, yn = {
1812
+ }, tr = {
1723
1813
  r: void 0,
1724
1814
  s: void 0,
1725
1815
  t: void 0,
1726
1816
  cm: void 0,
1727
1817
  vm: void 0
1728
- }, bn = {
1818
+ }, nr = {
1729
1819
  r: void 0,
1730
1820
  s: void 0,
1731
1821
  customFormat: void 0,
@@ -1735,29 +1825,29 @@ var pn = (e, t, n, r) => {
1735
1825
  "x14ac:dyDescent": "0.25",
1736
1826
  outlineLevel: void 0,
1737
1827
  collapsed: void 0
1738
- }, xn = {
1828
+ }, rr = {
1739
1829
  t: void 0,
1740
1830
  aca: void 0,
1741
1831
  ref: void 0,
1742
1832
  ca: void 0,
1743
1833
  si: void 0
1744
- }, Sn = {
1834
+ }, ir = {
1745
1835
  t: "shared",
1746
1836
  aca: void 0,
1747
1837
  ref: void 0,
1748
1838
  ca: void 0,
1749
1839
  si: void 0
1750
- }, Cn = {
1840
+ }, ar = {
1751
1841
  t: "array",
1752
1842
  aca: void 0,
1753
1843
  ref: void 0,
1754
1844
  ca: void 0,
1755
1845
  si: void 0
1756
1846
  };
1757
- function wn(e, t, n, r) {
1847
+ function or(e, t, n, r) {
1758
1848
  n && (t.start(r), t.empty("latin", { typeface: n }), t.empty("ea", { typeface: "" }), t.empty("cs", { typeface: "" }), t.end(r));
1759
1849
  }
1760
- var Tn = (e) => e.toISOString().split(".")[0] + "Z", En = (e, t, n) => {
1850
+ var sr = (e) => e.toISOString().split(".")[0] + "Z", cr = (e, t, n) => {
1761
1851
  switch (t) {
1762
1852
  case "creator":
1763
1853
  e.start("dc:creator"), e.text(n), e.end("dc:creator");
@@ -1770,10 +1860,10 @@ var Tn = (e) => e.toISOString().split(".")[0] + "Z", En = (e, t, n) => {
1770
1860
  break;
1771
1861
  case "modified": e.start("dcterms:modified", { "xsi:type": "dcterms:W3CDTF" }), e.text(n), e.end("dcterms:modified");
1772
1862
  }
1773
- }, Q = (e, t, n, r) => {
1863
+ }, Z = (e, t, n, r) => {
1774
1864
  t.start(n), t.text(r), t.end(n);
1775
- }, Dn = (e, t, n) => {
1776
- let r = n.getSheets().getItems({ visibility: ue.Visibility.Hidden }).map((e) => e.getName()), i = n.getNames().getItems({ type: "formula" }).filter((e) => !!e.getRanges?.()).map((e) => e.getName());
1865
+ }, lr = (e, t, n) => {
1866
+ let r = n.getSheets().getItems({ visibility: Ne.Visibility.Hidden }).map((e) => e.getName()), i = n.getNames().getItems({ type: "formula" }).filter((e) => !!e.getRanges?.()).map((e) => e.getName());
1777
1867
  t.start("HeadingPairs"), t.start("vt:vector", {
1778
1868
  size: i.length > 0 ? "4" : "2",
1779
1869
  baseType: "variant"
@@ -1784,7 +1874,7 @@ var Tn = (e) => e.toISOString().split(".")[0] + "Z", En = (e, t, n) => {
1784
1874
  for (let e of r) t.start("vt:lpstr"), t.text(e), t.end("vt:lpstr");
1785
1875
  for (let e of i) t.start("vt:lpstr"), t.text(e), t.end("vt:lpstr");
1786
1876
  t.end("vt:vector"), t.end("TitlesOfParts");
1787
- }, On = {
1877
+ }, ur = {
1788
1878
  minSupportedVersion: "120000",
1789
1879
  copy: "1",
1790
1880
  pasteAll: "1",
@@ -1796,76 +1886,226 @@ var Tn = (e) => e.toISOString().split(".")[0] + "Z", En = (e, t, n) => {
1796
1886
  clearComments: "1",
1797
1887
  assign: "1",
1798
1888
  coerce: "1"
1799
- }, kn = (e, t, n = N.EmptyArray) => {
1800
- if (!t) return { ...n };
1801
- let { text: r, runs: i, color: a, size: o, kern: s, weight: c, style: l, b: u, i: d, spc: f, baseline: p, ...m } = t, h = {
1802
- ...n,
1803
- ...m
1804
- };
1805
- return o !== void 0 && (h.sz = "" + jt(o)), u !== void 0 && (h.b = u ? "1" : "0"), c !== void 0 && (h.b = c > 500 ? "1" : "0"), d !== void 0 && (h.i = d ? "1" : "0"), l !== void 0 && (h.i = l === "italic" ? "1" : "0"), s !== void 0 && (h.kern = "" + jt(s)), f !== void 0 && (h.spc = "" + jt(f)), p !== void 0 && (h.baseline = "" + jt(p)), h;
1806
- }, An = (e, t, n) => {
1889
+ }, Q = (e) => e === void 0 || e === "_" ? void 0 : e, dr = (e, t) => {
1890
+ let n = t.indexOf(" ");
1891
+ n < 0 || e.empty("gd", {
1892
+ name: t.slice(0, n),
1893
+ fmla: t.slice(n + 1).trim()
1894
+ });
1895
+ }, fr = (e, t, n) => {
1896
+ e.empty("pos", {
1897
+ x: t,
1898
+ y: n
1899
+ });
1900
+ }, pr = (e, t) => {
1901
+ let n = t.split(" ");
1902
+ n[0] === "xy" ? (e.start("ahXY", {
1903
+ gdRefX: Q(n[1]),
1904
+ minX: Q(n[5]),
1905
+ maxX: Q(n[6]),
1906
+ gdRefY: Q(n[2]),
1907
+ minY: Q(n[7]),
1908
+ maxY: Q(n[8])
1909
+ }), fr(e, n[3], n[4]), e.end("ahXY")) : n[0] === "polar" && (e.start("ahPolar", {
1910
+ gdRefR: Q(n[1]),
1911
+ minR: Q(n[5]),
1912
+ maxR: Q(n[6]),
1913
+ gdRefAng: Q(n[2]),
1914
+ minAng: Q(n[7]),
1915
+ maxAng: Q(n[8])
1916
+ }), fr(e, n[3], n[4]), e.end("ahPolar"));
1917
+ }, mr = {
1918
+ M: ["moveTo", 1],
1919
+ L: ["lnTo", 1],
1920
+ Q: ["quadBezTo", 2],
1921
+ C: ["cubicBezTo", 3]
1922
+ }, hr = (e, t) => {
1923
+ e.start("path", {
1924
+ w: t.w,
1925
+ h: t.h,
1926
+ fill: t.f,
1927
+ stroke: t.s === 0 ? "0" : void 0
1928
+ });
1929
+ let n = t.d.split(/\s+/).filter((e) => e !== ""), r = 0;
1930
+ for (; r < n.length;) {
1931
+ let t = n[r++];
1932
+ if (t === "Z") e.empty("close");
1933
+ else if (t === "A") e.empty("arcTo", {
1934
+ wR: n[r],
1935
+ hR: n[r + 1],
1936
+ stAng: n[r + 2],
1937
+ swAng: n[r + 3]
1938
+ }), r += 4;
1939
+ else {
1940
+ let i = mr[t];
1941
+ if (!i) break;
1942
+ e.start(i[0]);
1943
+ for (let t = 0; t < i[1]; t++, r += 2) e.empty("pt", {
1944
+ x: n[r],
1945
+ y: n[r + 1]
1946
+ });
1947
+ e.end(i[0]);
1948
+ }
1949
+ }
1950
+ e.end("path");
1951
+ }, gr = (e) => String(Math.round(1e3 * e)), $ = (e) => e === void 0 ? void 0 : e ? "1" : "0", _r = /* @__PURE__ */ new Set(/* @__PURE__ */ "text.runs.paragraphs.field.color.size.kern.weight.style.b.i.spc.baseline.italic.underline.strike.font.eastAsianFont.complexScriptFont.symbolFont.language.alternateLanguage.kerning.spacing.letterSpacing.capitals.normalizeHeight.highlight.hyperlink.outline.effects.fill.stroke".split(".")), vr = (e, n, r = N.EmptyArray) => {
1952
+ if (!n) return { ...r };
1953
+ let i = { ...r };
1954
+ for (let e of Object.keys(n)) _r.has(e) || n[e] === void 0 || (i[e] = n[e]);
1955
+ let { size: a, kern: o, weight: s, style: c, b: l, i: u, spc: d, baseline: f } = n, p = n;
1956
+ return p.language !== void 0 && (i.lang = p.language), p.alternateLanguage !== void 0 && (i.altLang = p.alternateLanguage), a !== void 0 && (i.sz = "" + pn(a)), l !== void 0 && (i.b = l ? "1" : "0"), s !== void 0 && (i.b = s > 500 ? "1" : "0"), u !== void 0 && (i.i = u ? "1" : "0"), c !== void 0 && (i.i = c === "italic" ? "1" : "0"), n.italic !== void 0 && (i.i = n.italic ? "1" : "0"), p.underline !== void 0 && (i.u = t.write(p.underline)), p.strike !== void 0 && (i.strike = g.write(p.strike)), o !== void 0 && (i.kern = "" + pn(o)), p.kerning !== void 0 && (i.kern = "" + pn(p.kerning)), d !== void 0 && (i.spc = "" + pn(d)), p.letterSpacing !== void 0 && (i.spc = "" + pn(p.letterSpacing)), f !== void 0 && (i.baseline = gr(f)), p.capitals !== void 0 && (i.cap = p.capitals), p.normalizeHeight !== void 0 && (i.normalizeH = $(p.normalizeHeight)), i;
1957
+ }, yr = {
1958
+ latin: "lt",
1959
+ ea: "ea",
1960
+ cs: "cs",
1961
+ sym: "lt",
1962
+ buFont: "lt"
1963
+ }, br = (e, t, n) => {
1964
+ if (!n) return;
1965
+ let r = n.scheme !== void 0 && n.scheme !== R.Scheme.None ? `+${n.scheme === R.Scheme.Major ? "mj" : "mn"}-${yr[t]}` : n.family;
1966
+ r !== void 0 && e.empty(t, {
1967
+ typeface: r,
1968
+ panose: n.panose,
1969
+ pitchFamily: n.pitch,
1970
+ charset: S(n.charset)
1971
+ });
1972
+ }, xr = (e, t, n, r, i = N.EmptyObject) => {
1973
+ let a = e.getXMLWriter(), o = vr(0, r ?? {}, i);
1974
+ r?.outline || r?.color || r?.effects?.length || r?.highlight || r?.font || r?.eastAsianFont || r?.complexScriptFont || r?.symbolFont || r?.hyperlink ? (a.start(n, o), r.outline && Yt(e, a, r.outline, t), r.color && Jt(e, a, r.color, t), r.effects?.length && Qt(e, a, t.getTheme(), r.effects), r.highlight && (a.start("highlight"), W(a, t.getTheme(), r.highlight), a.end("highlight")), br(a, "latin", r.font), br(a, "ea", r.eastAsianFont), br(a, "cs", r.complexScriptFont), br(a, "sym", r.symbolFont), qt(e, a, "hlinkClick", r.hyperlink), a.end(n)) : a.empty(n, o);
1975
+ }, Sr = (e, t, n) => {
1976
+ n && (e.start(t), "percent" in n ? e.empty("spcPct", { val: gr(n.percent) }) : e.empty("spcPts", { val: String(Math.round(100 * n.points)) }), e.end(t));
1977
+ }, Cr = (e, t, n, r) => {
1978
+ let a = e.getXMLWriter(), o = {
1979
+ marL: r.marginLeft === void 0 ? void 0 : String(J(r.marginLeft)),
1980
+ marR: r.marginRight === void 0 ? void 0 : String(J(r.marginRight)),
1981
+ lvl: r.level === void 0 ? void 0 : String(r.level),
1982
+ indent: r.indent === void 0 ? void 0 : String(J(r.indent)),
1983
+ algn: u.write(r.align),
1984
+ defTabSz: r.defaultTabSize === void 0 ? void 0 : String(J(r.defaultTabSize)),
1985
+ rtl: $(r.rightToLeft),
1986
+ eaLnBrk: $(r.eastAsianLineBreak),
1987
+ fontAlgn: i.write(r.fontAlign),
1988
+ latinLnBrk: $(r.latinLineBreak),
1989
+ hangingPunct: $(r.hangingPunctuation)
1990
+ }, s = r.bullet;
1991
+ if (r.lineSpacing || r.spaceBefore || r.spaceAfter || s || r.tabs || r.defaultRun) {
1992
+ if (a.start(n, o), Sr(a, "lnSpc", r.lineSpacing), Sr(a, "spcBef", r.spaceBefore), Sr(a, "spcAft", r.spaceAfter), s) switch (s.colorFollowsText ? a.empty("buClrTx") : s.color && (a.start("buClr"), W(a, t.getTheme(), s.color), a.end("buClr")), s.sizeFollowsText ? a.empty("buSzTx") : s.size && ("percent" in s.size ? a.empty("buSzPct", { val: gr(s.size.percent) }) : a.empty("buSzPts", { val: String(Math.round(100 * s.size.points)) })), s.fontFollowsText ? a.empty("buFontTx") : br(a, "buFont", s.font), s.type) {
1993
+ case "none":
1994
+ a.empty("buNone");
1995
+ break;
1996
+ case "auto":
1997
+ a.empty("buAutoNum", {
1998
+ type: s.autoType ?? "arabicPeriod",
1999
+ startAt: s.startAt === void 0 ? void 0 : String(s.startAt)
2000
+ });
2001
+ break;
2002
+ case "char": a.empty("buChar", { char: s.char ?? "" });
2003
+ }
2004
+ if (r.tabs) {
2005
+ a.start("tabLst");
2006
+ for (let e of r.tabs) a.empty("tab", {
2007
+ pos: String(J(e.position)),
2008
+ algn: Te.write(e.align)
2009
+ });
2010
+ a.end("tabLst");
2011
+ }
2012
+ r.defaultRun && xr(e, t, "defRPr", r.defaultRun), a.end(n);
2013
+ } else a.empty(n, o);
2014
+ }, wr = (e) => e === V.Overflow.Visible ? void 0 : s.write(e), Tr = (e, t, n, r) => {
2015
+ let i = e.getXMLWriter();
2016
+ i.pushDefaultNamespace("a"), i.start("p");
2017
+ let { runs: a, endRun: o, ...s } = r, c = Re.inheritedTextSize(n, r) === void 0 ? (e) => e.size === void 0 ? {
2018
+ ...e,
2019
+ size: Re.TEXT_DEFAULTS.size
2020
+ } : e : (e) => e;
2021
+ ((e) => !!e && Object.keys(e).some((t) => t !== "runs" && t !== "endRun" && e[t] !== void 0))(s) && Cr(e, t, "pPr", s);
2022
+ for (let n of a ?? []) {
2023
+ if (n?.text === "\n") {
2024
+ i.empty("br");
2025
+ continue;
2026
+ }
2027
+ let { text: r, field: a, ...o } = n, s = a ? "fld" : "r";
2028
+ i.start(s, a ? {
2029
+ id: a.id,
2030
+ type: a.type
2031
+ } : {}), xr(e, t, "rPr", c(o)), i.start("t"), i.text(r ?? ""), i.end("t"), i.end(s);
2032
+ }
2033
+ !o && a?.length || xr(e, t, "endParaRPr", c(o ?? {})), i.end("p"), i.popDefaultNamespace();
2034
+ }, Er = (e, t, n) => {
1807
2035
  if (!n) return;
1808
- let r = e.getXMLWriter();
1809
- r.start("txBody"), r.pushDefaultNamespace("a"), Mn(e, t, {
1810
- vertOverflow: "clip",
1811
- horzOverflow: "clip",
1812
- rtlCol: "0",
1813
- anchor: "ctr"
1814
- }), r.empty("lstStyle"), ((e, t, n) => {
1815
- if (!n) return;
2036
+ let r = e.getXMLWriter(), i = ((e) => typeof e == "string" ? { paragraphs: [{ runs: [{ text: e }] }] } : Array.isArray(e?.paragraphs) ? e : { paragraphs: [e] })(n);
2037
+ r.start("txBody"), r.pushDefaultNamespace("a"), ((e, t) => {
2038
+ let n = t.body ?? {}, r = n.insets, i = {
2039
+ rot: t.rotation === void 0 ? void 0 : String(Math.round(6e4 * t.rotation)),
2040
+ spcFirstLastPara: $(n.spaceFirstLastParagraph),
2041
+ vertOverflow: wr(n.verticalOverflow ?? Re.TEXT_DEFAULTS.verticalOverflow),
2042
+ horzOverflow: wr(n.horizontalOverflow ?? Re.TEXT_DEFAULTS.horizontalOverflow),
2043
+ vert: o.write(n.vertical),
2044
+ wrap: n.wrap,
2045
+ lIns: r?.left === void 0 ? void 0 : String(J(r.left)),
2046
+ tIns: r?.top === void 0 ? void 0 : String(J(r.top)),
2047
+ rIns: r?.right === void 0 ? void 0 : String(J(r.right)),
2048
+ bIns: r?.bottom === void 0 ? void 0 : String(J(r.bottom)),
2049
+ numCol: n.columns === void 0 ? void 0 : String(n.columns),
2050
+ spcCol: n.columnSpacing === void 0 ? void 0 : String(J(n.columnSpacing)),
2051
+ rtlCol: $(n.rightToLeftColumns),
2052
+ fromWordArt: $(n.fromWordArt),
2053
+ anchor: m.write(n.anchor),
2054
+ anchorCtr: $(n.anchorCenter),
2055
+ forceAA: $(n.forceAntiAlias),
2056
+ upright: $(n.upright),
2057
+ compatLnSpc: $(n.compatibleLineSpacing)
2058
+ };
2059
+ if (n.warp || n.autoFit || n.extLst) {
2060
+ if (e.start("bodyPr", i), n.warp) {
2061
+ let t = Object.entries(n.warp.adjustments ?? {});
2062
+ if (e.start("prstTxWarp", { prst: n.warp.preset }), t.length === 0) e.empty("avLst");
2063
+ else {
2064
+ e.start("avLst");
2065
+ for (let [n, r] of t) e.empty("gd", {
2066
+ name: n,
2067
+ fmla: `val ${Math.round(r)}`
2068
+ });
2069
+ e.end("avLst");
2070
+ }
2071
+ e.end("prstTxWarp");
2072
+ }
2073
+ switch (n.autoFit) {
2074
+ case V.Autofit.None:
2075
+ e.empty("noAutofit");
2076
+ break;
2077
+ case V.Autofit.Shape:
2078
+ e.empty("spAutoFit");
2079
+ break;
2080
+ case V.Autofit.Normal: e.empty("normAutofit", {
2081
+ fontScale: n.fontScale === void 0 ? void 0 : gr(n.fontScale),
2082
+ lnSpcReduction: n.lineSpacingReduction === void 0 ? void 0 : gr(n.lineSpacingReduction)
2083
+ });
2084
+ }
2085
+ n.extLst && e.raw(n.extLst), e.end("bodyPr");
2086
+ } else e.empty("bodyPr", i);
2087
+ })(r, i), ((e, t, n) => {
1816
2088
  let r = e.getXMLWriter();
1817
- r.pushDefaultNamespace("a"), typeof n == "string" && (n = { runs: [{ text: n }] }), r.start("p"), r.empty("pPr", { algn: "ctr" });
1818
- let i = kn(0, n, {
1819
- ...Nn,
1820
- size: t.getDefaultFontSize()
1821
- }), a = n?.runs, o = a ? a.length : 0;
1822
- if (o > 0) for (let e = 0; e < o; e++) {
1823
- let n = a[e];
1824
- r.start("r", {});
1825
- let i = kn(0, n, Nn), o = n.color;
1826
- o ? (r.start("rPr", i), K(0, r, o, t), r.end("rPr")) : r.empty("rPr", i), r.start("t"), r.text(n?.text ?? ""), r.end("t"), r.end("r");
1827
- }
1828
- else r.empty("endParaRPr", i);
1829
- r.end("p"), r.popDefaultNamespace();
1830
- })(e, t, n), r.popDefaultNamespace(), r.end("txBody");
1831
- }, jn = (e, t, n) => {
2089
+ n && (n.default || n.levels?.some((e) => e)) ? (r.start("lstStyle"), n.default && Cr(e, t, "defPPr", n.default), n.levels?.forEach((n, r) => {
2090
+ n && Cr(e, t, `lvl${r + 1}pPr`, n);
2091
+ }), r.end("lstStyle")) : r.empty("lstStyle");
2092
+ })(e, t, i.listStyle);
2093
+ let a = i.paragraphs.length === 0 ? [{ runs: [] }] : i.paragraphs;
2094
+ for (let n of a) Tr(e, t, i, n);
2095
+ r.popDefaultNamespace(), r.end("txBody");
2096
+ }, Dr = (e, t, n) => {
1832
2097
  if (!n) return;
1833
- let r = e.getXMLWriter(), i = kn(0, n);
2098
+ let r = e.getXMLWriter(), i = vr(0, n);
1834
2099
  r.empty("defRPr", i);
1835
- }, Mn = (e, t, n) => {
2100
+ }, Or = (e, t, n) => {
1836
2101
  if (!n) return;
1837
2102
  let r = e.getXMLWriter(), { spAutoFit: i, ...a } = n;
1838
2103
  i ? (r.start("bodyPr", a), r.empty("spAutoFit"), r.end("bodyPr")) : r.empty("bodyPr", a);
1839
- }, Nn = Object.freeze({ lang: "en-US" }), Pn = (e, t) => {
1840
- if (t.length !== 0) {
1841
- e.start("a:extLst");
1842
- for (let n of t) {
1843
- let t = {}, r = n[0];
1844
- r && (t.uri = r), e.start("a:ext", t), e.empty(n[1], n[2]), e.end("a:ext");
1845
- }
1846
- e.end("a:extLst");
1847
- }
1848
- }, Fn = async (e, t, n, r, i) => {
1849
- let a = e.getSharedStates(), o = r.getContent().getResource(), s = await o.getExternalURI(), c;
1850
- if (s) c = e.addExternal(Ot, s);
1851
- else if (c = n.get(o), !c) {
1852
- let t = a.get(kt);
1853
- t || (t = /* @__PURE__ */ new Map(), a.set(kt, t));
1854
- let r = t.get(o);
1855
- if (!r) {
1856
- let e = await o.toBuffer();
1857
- r = {
1858
- bytes: new Uint8Array(e),
1859
- type: await o.getType() ?? At,
1860
- index: t.size + 1
1861
- }, t.set(o, r);
1862
- }
1863
- c = e.addBinary(r.bytes, r.type.mime, Ot, `../media/image${r.index}.${r.type.ext}`, !0), n.set(o, c);
1864
- }
1865
- let l = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
1866
- s ? l["r:link"] = c.relId : l["r:embed"] = c.relId;
2104
+ }, kr = async (e, t, n, r, i, a, o) => {
2105
+ let { relId: s, external: c } = await an(e, a), l = { "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships" };
2106
+ c ? l["r:link"] = s : l["r:embed"] = s;
1867
2107
  let u = [];
1868
- s || u.push([
2108
+ c || u.push([
1869
2109
  "{28A0092B-C50C-407E-A947-70E740481C1C}",
1870
2110
  "a14:useLocalDpi",
1871
2111
  {
@@ -1873,33 +2113,87 @@ var Tn = (e) => e.toISOString().split(".")[0] + "Z", En = (e, t, n) => {
1873
2113
  val: "0"
1874
2114
  }
1875
2115
  ]);
1876
- let d = e.getXMLWriter();
1877
- d.start("pic"), d.start("nvPicPr"), Un(e, d, r, i, t), Gn(e, d, r, i), d.end("nvPicPr"), d.start("blipFill"), d.start("a:blip", l), Pn(d, u), d.end("a:blip"), d.start("a:stretch"), d.empty("a:fillRect"), d.end("a:stretch"), d.end("blipFill"), Vn(e, t, n, r, i), d.end("pic");
1878
- }, In = async (e, t, n, r, i, a) => {
1879
- let o = i.content?.json, s = o?.xml, c = o?.part;
1880
- if (!s || !c) return $(e, t, n, r, i);
1881
- let l = await Ze(c, e, "../charts/chart{n}.xml");
1882
- if (!l?.relId) return $(e, t, n, r, i);
1883
- let u = l.relId === c.id ? s : s.replace(`r:id="${c.id}"`, `r:id="${l.relId}"`);
1884
- a !== void 0 && typeof i.content?.json?.sourceId == "number" && (u = u.replace(`cNvPr id="${i.content.json.sourceId}"`, `cNvPr id="${a}"`)), e.getXMLWriter().raw(u);
1885
- }, Ln = async (e, t, n, r, i) => $(e, t, n, r, i), Rn = async (e, t, n, r, i) => $(e, t, n, r, i), zn = async (e, t, n, r, i) => $(e, t, n, r, i), Bn = async (e, t, n, r, i, a) => {
1886
- let o = i.content?.json, s = o?.xml;
1887
- if (!s) return $(e, t, n, r, i);
1888
- let c = a !== void 0 && typeof o?.sourceId == "number" ? s.replace(`cNvPr id="${o.sourceId}"`, `cNvPr id="${a}"`) : s;
1889
- e.getXMLWriter().raw(c);
1890
- }, $ = async (e, t, n, r, i) => {
1891
- (async (e, t, n, r, i) => {
1892
- let a = e.getXMLWriter(), o = {}, s = i.content?.json, c = s?.type ?? "sp", l = t.getStyles();
1893
- c === "cxnSp" ? (o.macro = "", a.start("cxnSp", o), a.start("nvCxnSpPr"), Un(e, a, r, i, t), Wn(e, a, r, i, t), a.start("cNvCxnSpPr"), a.empty("a:stCnx", {
1894
- id: "0",
1895
- idx: "0"
1896
- }), a.end("cNvCxnSpPr"), a.end("nvCxnSpPr"), Vn(e, t, n, r, i), Hn(e, t, n, r, i), An(e, l, s?.text), a.end("cxnSp")) : c === "grpSp" || (o.macro = "", o.textlink = "", a.start("sp", o), a.start("nvSpPr"), Un(e, a, r, i, t), Wn(e, a, r, i, t), a.end("nvSpPr"), Vn(e, t, n, r, i), Hn(e, t, n, r, i), An(e, l, s?.text), a.end("sp"));
1897
- })(e, t, n, r, {
1898
- ...i,
2116
+ let d = r.content?.json, f = {};
2117
+ d?.macro !== void 0 && (f.macro = d.macro), d?.published !== void 0 && (f.fPublished = d.published ? "1" : "0");
2118
+ let p = e.getXMLWriter();
2119
+ if (p.start("pic", Object.keys(f).length > 0 ? f : void 0), p.start("nvPicPr"), zr(e, p, n, r, t), Wr(p, Ur(r)), p.end("nvPicPr"), p.start("blipFill"), o) {
2120
+ let e = o.tile || o.stretch ? o : {
2121
+ ...o,
2122
+ stretch: {}
2123
+ };
2124
+ p.pushDefaultNamespace("a"), dn(p, e, {
2125
+ relId: s,
2126
+ external: c
2127
+ }), p.popDefaultNamespace();
2128
+ } else p.start("a:blip", l), ((e, t) => {
2129
+ if (t.length !== 0) {
2130
+ e.start("a:extLst");
2131
+ for (let n of t) {
2132
+ let t = {}, r = n[0];
2133
+ r && (t.uri = r), e.start("a:ext", t), e.empty(n[1], n[2]), e.end("a:ext");
2134
+ }
2135
+ e.end("a:extLst");
2136
+ }
2137
+ })(p, u), p.end("a:blip"), p.start("a:stretch"), p.empty("a:fillRect"), p.end("a:stretch");
2138
+ p.end("blipFill"), Lr(e, t, n, o ? ((e) => {
2139
+ let t = e.content;
2140
+ if (!t?.json) return e;
2141
+ let { fill: n, ...r } = t.json;
2142
+ return {
2143
+ ...e,
2144
+ content: {
2145
+ ...t,
2146
+ json: r
2147
+ }
2148
+ };
2149
+ })(r) : r, i), p.end("pic");
2150
+ }, Ar = async (e, t, n, r, i) => {
2151
+ let a = r.content?.json, o = a?.xml, s = a?.part;
2152
+ if (!o || !s) return Ir(e, t, n, r);
2153
+ let c = await xt(s, e, "../charts/chart{n}.xml");
2154
+ if (!c?.relId) return Ir(e, t, n, r);
2155
+ let l = c.relId === s.id ? o : o.replace(`r:id="${s.id}"`, `r:id="${c.relId}"`);
2156
+ i !== void 0 && typeof r.content?.json?.sourceId == "number" && (l = l.replace(`cNvPr id="${r.content.json.sourceId}"`, `cNvPr id="${i}"`)), e.getXMLWriter().raw(l);
2157
+ }, jr = async (e, t, n, r, i) => {
2158
+ let a = e.getXMLWriter(), o = {}, s = r.content?.json, c = s?.type ?? Me.Type.Shape, l = t.getStyles();
2159
+ if (c === Me.Type.Connector) s?.macro !== void 0 && (o.macro = s.macro), s?.published !== void 0 && (o.fPublished = s.published ? "1" : "0"), a.start("cxnSp", o), a.start("nvCxnSpPr"), zr(e, a, n, r, t), Hr(e, a, n, r, t), a.end("nvCxnSpPr"), Lr(e, t, n, r, i), Rr(e, t, n, r), Er(e, l, s?.text), a.end("cxnSp");
2160
+ else if (c === Me.Type.Group) {
2161
+ a.start("grpSp"), a.start("nvGrpSpPr"), zr(e, a, n, r, t);
2162
+ let o = Vr(r);
2163
+ o ? (a.start("cNvGrpSpPr"), a.empty("a:grpSpLocks", o), a.end("cNvGrpSpPr")) : a.empty("cNvGrpSpPr"), a.end("nvGrpSpPr"), a.start("grpSpPr"), a.pushDefaultNamespace("a"), Gr(a, i, r, s?.childBounds ?? i), Zt(e, l, s), a.popDefaultNamespace(), a.end("grpSpPr");
2164
+ for (let n of s?.children ?? []) await Mr(e, t, n);
2165
+ a.end("grpSp");
2166
+ } else s?.macro !== void 0 && (o.macro = s.macro), s?.textLink !== void 0 && (o.textlink = s.textLink), s?.locksText !== void 0 && (o.fLocksText = s.locksText ? "1" : "0"), s?.published !== void 0 && (o.fPublished = s.published ? "1" : "0"), a.start("sp", o), a.start("nvSpPr"), zr(e, a, n, r, t), Hr(e, a, n, r, t), a.end("nvSpPr"), Lr(e, t, n, r, i), Rr(e, t, n, r), Er(e, l, s?.text), a.end("sp");
2167
+ }, Mr = async (e, t, n) => {
2168
+ let r = n.bounds ?? {
2169
+ x: 0,
2170
+ y: 0,
2171
+ width: 0,
2172
+ height: 0
2173
+ }, i = n.type === Me.Type.Picture, a = {
2174
+ anchor: void 0,
2175
+ content: {
2176
+ type: i ? "picture" : "shape",
2177
+ name: n.name,
2178
+ description: n.description,
2179
+ json: n
2180
+ },
2181
+ hidden: n.hidden,
2182
+ rotation: n.rotation
2183
+ };
2184
+ if (i) {
2185
+ let i = n.fill, o = on(e, i?.resId);
2186
+ o ? await kr(e, t, null, a, r, o, i) : e.warn(`The picture '${n.name ?? ""}' in a group names no image in the workbook; the group is saved without it.`, void 0, "xlsx.drawing.group.picture");
2187
+ return;
2188
+ }
2189
+ await jr(e, t, null, a, r);
2190
+ }, Nr = async (e, t, n, r) => Ir(e, t, n, r), Pr = async (e, t, n, r) => Ir(e, t, n, r), Fr = async (e, t, n, r) => Ir(e, t, n, r), Ir = async (e, t, n, r) => {
2191
+ jr(e, t, n, {
2192
+ ...r,
1899
2193
  content: {
1900
2194
  type: "shape",
1901
- name: i.content?.name,
1902
- description: i.content?.description,
2195
+ name: r.content?.name,
2196
+ description: r.content?.description,
1903
2197
  json: {
1904
2198
  fill: "bg1",
1905
2199
  stroke: {
@@ -1907,90 +2201,168 @@ var Tn = (e) => e.toISOString().split(".")[0] + "Z", En = (e, t, n) => {
1907
2201
  fill: "red"
1908
2202
  },
1909
2203
  text: { runs: [{
1910
- text: "Unsupported Type: " + (i.content?.type ?? "unknown"),
2204
+ text: "Unsupported Type: " + (r.content?.type ?? "unknown"),
1911
2205
  color: "tx1"
1912
2206
  }] }
1913
2207
  }
1914
2208
  }
1915
- });
1916
- }, Vn = (e, t, n, r, i) => {
1917
- let a = e.getXMLWriter(), o = i.content?.json, s = o?.geometry ?? "rect", c = t.getStyles();
1918
- a.start("spPr"), a.pushDefaultNamespace("a"), Kn(a, r, i), a.start("prstGeom", { prst: s }), a.empty("avLst"), a.end("prstGeom"), wt(e, c, o), a.popDefaultNamespace(), a.end("spPr");
1919
- }, Hn = (e, t, n, r, i) => {
1920
- let a = e.getXMLWriter();
1921
- a.start("style"), a.pushDefaultNamespace("a"), a.start("lnRef", { idx: "1" }), a.start("schemeClr", { val: "accent1" }), a.empty("shade", { val: "15000" }), a.end("schemeClr"), a.end("lnRef"), a.start("fillRef", { idx: "1" }), a.empty("schemeClr", { val: "accent1" }), a.end("fillRef"), a.start("effectRef", { idx: "0" }), a.empty("schemeClr", { val: "accent1" }), a.end("effectRef"), a.start("fontRef", { idx: "minor" }), a.empty("schemeClr", { val: "lt1" }), a.end("fontRef"), a.popDefaultNamespace(), a.end("style");
1922
- }, Un = (e, t, n, r, i) => {
1923
- let a = e.getSharedStates(), o = a.get("uniqueIdCounter");
1924
- o || (o = /* @__PURE__ */ new Map(), a.set("uniqueIdCounter", o));
1925
- let s = o.get(i) ?? 1;
1926
- s++, o.set(i, s);
1927
- let c = {
1928
- id: "" + s,
2209
+ }, n.getBounds());
2210
+ }, Lr = (e, t, n, r, i) => {
2211
+ let a = e.getXMLWriter(), o = r.content?.json, s = o?.geometry, c = t.getStyles();
2212
+ if (a.start("spPr"), a.pushDefaultNamespace("a"), Gr(a, i, r), typeof s == "object" && s) ((e, t) => {
2213
+ e.start("custGeom"), e.start("avLst");
2214
+ for (let n of t.av ?? []) dr(e, n);
2215
+ e.end("avLst"), e.start("gdLst");
2216
+ for (let n of t.gd ?? []) dr(e, n);
2217
+ e.end("gdLst"), e.start("ahLst");
2218
+ for (let n of t.ah ?? []) pr(e, n);
2219
+ e.end("ahLst"), e.start("cxnLst");
2220
+ for (let n of Array.isArray(t.cxn) ? t.cxn : []) {
2221
+ let t = n.split(" ");
2222
+ e.start("cxn", { ang: t[0] }), fr(e, t[1], t[2]), e.end("cxn");
2223
+ }
2224
+ if (e.end("cxnLst"), t.rect) {
2225
+ let n = t.rect.split(" ");
2226
+ e.empty("rect", {
2227
+ l: n[0],
2228
+ t: n[1],
2229
+ r: n[2],
2230
+ b: n[3]
2231
+ });
2232
+ }
2233
+ e.start("pathLst");
2234
+ for (let n of t.paths) hr(e, n);
2235
+ e.end("pathLst"), e.end("custGeom");
2236
+ })(a, s);
2237
+ else {
2238
+ a.start("prstGeom", { prst: typeof s == "string" ? s : "rect" });
2239
+ let e = ((e) => e ? Object.keys(e).filter((t) => Number.isFinite(e[t])).map((t) => [t, `val ${Math.round(e[t])}`]) : [])(o?.adjustments);
2240
+ if (e.length === 0) a.empty("avLst");
2241
+ else {
2242
+ a.start("avLst");
2243
+ for (let [t, n] of e) a.empty("gd", {
2244
+ name: t,
2245
+ fmla: n
2246
+ });
2247
+ a.end("avLst");
2248
+ }
2249
+ a.end("prstGeom");
2250
+ }
2251
+ Zt(e, c, o), o?.scene3d && a.raw(o.scene3d), o?.shape3d && a.raw(o.shape3d), o?.extLst?.properties && a.raw(o.extLst.properties), a.popDefaultNamespace(), a.end("spPr");
2252
+ }, Rr = (e, t, n, r) => {
2253
+ let i = e.getXMLWriter(), a = r.content?.json?.style;
2254
+ if (a === null) return;
2255
+ let o = t.getStyles().getTheme(), s = Re.defaultStyleRefs(r.content?.json), c = (e, t) => {
2256
+ t && (i.start(e, { idx: String(t.index) }), t.color && W(i, o, t.color), i.end(e));
2257
+ };
2258
+ i.start("style"), i.pushDefaultNamespace("a"), c("lnRef", a?.stroke ?? s.stroke), c("fillRef", a?.fill ?? s.fill), c("effectRef", a?.effect ?? s.effect), c("fontRef", a?.font ?? s.font), i.popDefaultNamespace(), i.end("style");
2259
+ }, zr = (e, t, n, r, i) => {
2260
+ let a = Br(e, i), o = a.assigned.get(r) ?? (r.content?.json ? a.assignedContent.get(r.content.json) : void 0);
2261
+ if (o === void 0) {
2262
+ let t = e.getSharedStates(), n = t.get("uniqueIdCounter");
2263
+ n || (n = /* @__PURE__ */ new Map(), t.set("uniqueIdCounter", n)), o = (n.get(i) ?? 1) + 1, n.set(i, o);
2264
+ }
2265
+ let s = r.content?.json, c = {
2266
+ id: "" + o,
1929
2267
  name: r.content?.name
1930
2268
  };
1931
- r.content?.description && (c.descr = r.content.description), r.hidden && (c.hidden = "1");
1932
- let l = [];
1933
- l.push([
1934
- "{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}",
1935
- "a16:creationId",
1936
- {
1937
- "xmlns:a16": "http://schemas.microsoft.com/office/drawing/2014/main",
1938
- id: `{${N.uuidV4().toUpperCase()}}`
1939
- }
1940
- ]), t.start("cNvPr", c), Pn(t, l), t.end("cNvPr");
1941
- }, Wn = (e, t, n, r, i) => {
1942
- t.empty("cNvSpPr");
1943
- }, Gn = (e, t, n, r) => {
1944
- let i = {};
1945
- if (r.lockAspect && (i.noChangeAspect = "1"), r.locks) for (let e of Object.keys(r.locks)) !0 === r.locks[e] && (i[e] = "1");
1946
- t.start("cNvPicPr", {}), t.empty("a:picLocks", i), t.end("cNvPicPr");
1947
- }, Kn = (e, t, n) => {
1948
- let r = t.getBounds(), i = {}, a = n.rotation;
1949
- a !== void 0 && a !== 0 && (i.rot = "" + Y(a)), e.start("xfrm", i), e.start("off", {
2269
+ r.content?.description && (c.descr = r.content.description), r.hidden && (c.hidden = "1"), s?.title && (c.title = s.title), t.start("cNvPr", c), qt(e, t, "a:hlinkClick", s?.hyperlink), qt(e, t, "a:hlinkHover", s?.hoverHyperlink), s?.extLst?.nonVisual && t.raw(s.extLst.nonVisual), t.end("cNvPr");
2270
+ }, Br = (e, t) => {
2271
+ let n = e.getSharedStates(), r = n.get("drawingIds");
2272
+ r || (r = /* @__PURE__ */ new Map(), n.set("drawingIds", r));
2273
+ let i = r.get(t);
2274
+ return i || (i = {
2275
+ assigned: /* @__PURE__ */ new Map(),
2276
+ assignedContent: /* @__PURE__ */ new Map(),
2277
+ bySource: /* @__PURE__ */ new Map()
2278
+ }, r.set(t, i)), i;
2279
+ }, Vr = (e) => {
2280
+ let t = { ...e.content?.json?.locks };
2281
+ e.lockAspect !== void 0 && t.noChangeAspect === void 0 && (t.noChangeAspect = e.lockAspect);
2282
+ let n = {};
2283
+ for (let e of Object.keys(t)) t[e] && (n[e] = "1");
2284
+ return Object.keys(n).length > 0 ? n : null;
2285
+ }, Hr = (e, t, n, r, i) => {
2286
+ let a = r.content?.json, o = Vr(r);
2287
+ if (a?.type === Me.Type.Connector) {
2288
+ let n = a.connectorEnds;
2289
+ if (!o && !n) return void t.empty("cNvCxnSpPr");
2290
+ let r = Br(e, i);
2291
+ t.start("cNvCxnSpPr"), o && t.empty("a:cxnSpLocks", o), n?.start && t.empty("a:stCxn", {
2292
+ id: String(r.bySource.get(n.start.id) ?? n.start.id),
2293
+ idx: String(n.start.index)
2294
+ }), n?.end && t.empty("a:endCxn", {
2295
+ id: String(r.bySource.get(n.end.id) ?? n.end.id),
2296
+ idx: String(n.end.index)
2297
+ }), t.end("cNvCxnSpPr");
2298
+ return;
2299
+ }
2300
+ let s = { txBox: a?.textBox ? "1" : void 0 };
2301
+ o ? (t.start("cNvSpPr", s), t.empty("a:spLocks", o), t.end("cNvSpPr")) : t.empty("cNvSpPr", s);
2302
+ }, Ur = (e) => {
2303
+ let t = {};
2304
+ e.lockAspect && (t.noChangeAspect = "1");
2305
+ let n = e.content?.json;
2306
+ for (let r of [e.locks, n?.locks]) if (r) for (let e of Object.keys(r)) !0 === r[e] && (t[e] = "1");
2307
+ return t;
2308
+ }, Wr = (e, t) => {
2309
+ e.start("cNvPicPr", {}), e.empty("a:picLocks", t), e.end("cNvPicPr");
2310
+ }, Gr = (e, t, n, r) => {
2311
+ let i = {}, a = n.content?.json, o = n.rotation;
2312
+ o !== void 0 && o !== 0 && (i.rot = "" + Y(o)), a?.flipH && (i.flipH = "1"), a?.flipV && (i.flipV = "1"), e.start("xfrm", i), e.empty("off", {
2313
+ x: J(t.x),
2314
+ y: J(t.y)
2315
+ }), e.empty("ext", {
2316
+ cx: J(t.width),
2317
+ cy: J(t.height)
2318
+ }), r && (e.empty("chOff", {
1950
2319
  x: J(r.x),
1951
2320
  y: J(r.y)
1952
- }), e.end("off"), e.start("ext", {
2321
+ }), e.empty("chExt", {
1953
2322
  cx: J(r.width),
1954
2323
  cy: J(r.height)
1955
- }), e.end("ext"), e.end("xfrm");
1956
- }, qn = (e, t, n) => {
2324
+ })), e.end("xfrm");
2325
+ }, Kr = (e, t, n) => {
1957
2326
  e.start(t), e.start("col"), e.text(n.c ?? 0), e.end("col"), e.start("colOff"), e.text(J(n.x)), e.end("colOff"), e.start("row"), e.text(n.r ?? 0), e.end("row"), e.start("rowOff"), e.text(J(n.y)), e.end("rowOff"), e.end(t);
1958
- }, Jn = async (e, t, n) => {
2327
+ }, qr = (e, t) => {
2328
+ let n = t.content.json;
2329
+ e.start("mc:AlternateContent", re), e.start("mc:Choice", ae), e.start("twoCellAnchor", { editAs: t.anchorType || "twoCell" }), Kr(e, "from", t.anchor.tl), Kr(e, "to", t.anchor.br), e.raw(A(t.content.type, n, t.content?.name)), e.empty("clientData", { fPrintsWithSheet: "0" }), e.end("twoCellAnchor"), e.end("mc:Choice"), e.empty("mc:Fallback"), e.end("mc:AlternateContent");
2330
+ }, Jr = async (e, t, n) => {
1959
2331
  let r = await n.getExternalURI();
1960
- if (r) return void e.addExternal(Ot, r);
1961
- let i = e.getSharedStates(), a = i.get(kt);
1962
- a || (a = /* @__PURE__ */ new Map(), i.set(kt, a));
2332
+ if (r) return void e.addExternal(tn, r);
2333
+ let i = e.getSharedStates(), a = i.get(nn);
2334
+ a || (a = /* @__PURE__ */ new Map(), i.set(nn, a));
1963
2335
  let o = a.get(n);
1964
2336
  if (!o) {
1965
2337
  let e = await n.toBuffer();
1966
2338
  o = {
1967
2339
  bytes: new Uint8Array(e),
1968
- type: await n.getType() ?? At,
2340
+ type: await n.getType() ?? fn,
1969
2341
  index: a.size + 1
1970
2342
  }, a.set(n, o);
1971
2343
  }
1972
- let s = e.addBinary(o.bytes, o.type.mime, Ot, `../media/image${o.index}.${o.type.ext}`, !0, t);
2344
+ let s = e.addBinary(o.bytes, o.type.mime, tn, `../media/image${o.index}.${o.type.ext}`, !0, t);
1973
2345
  s.relId !== t && e.log(`Legacy drawing image '${t}' was written as '${s.relId}'; the markup will not find it.`);
1974
2346
  };
1975
- function Yn(e) {
2347
+ function Yr(e) {
1976
2348
  return e.toISOString().substring(0, 22);
1977
2349
  }
1978
- function Xn(e, n, r, i, a, o, s, c, u) {
1979
- let d = {
1980
- ref: n,
1981
- dT: Yn(a ?? /* @__PURE__ */ new Date()),
1982
- personId: i ? Zn(i) : void 0,
1983
- id: Zn(r),
1984
- parentId: s ? Zn(s) : void 0,
1985
- done: c ? "1" : void 0
2350
+ function Xr(e, t, n, r, i, a, o, s, c) {
2351
+ let l = {
2352
+ ref: t,
2353
+ dT: Yr(i ?? /* @__PURE__ */ new Date()),
2354
+ personId: r ? Zr(r) : void 0,
2355
+ id: Zr(n),
2356
+ parentId: o ? Zr(o) : void 0,
2357
+ done: s ? "1" : void 0
1986
2358
  };
1987
- if (e.start("threadedComment", d), e.start("text", t.test(o) || /[\n\r]/.test(o) ? l : void 0), e.text(o), e.end("text"), u && u.length > 0) {
2359
+ if (e.start("threadedComment", l), e.start("text", fe.test(a) || /[\n\r]/.test(a) ? ne : void 0), e.text(a), e.end("text"), c && c.length > 0) {
1988
2360
  e.start("mentions");
1989
- for (let t = 0; t < u.length; t++) {
1990
- let n = u[t];
2361
+ for (let t = 0; t < c.length; t++) {
2362
+ let n = c[t];
1991
2363
  e.empty("mention", {
1992
- mentionpersonId: Zn(n.personId),
1993
- mentionId: Zn(n.id),
2364
+ mentionpersonId: Zr(n.personId),
2365
+ mentionId: Zr(n.id),
1994
2366
  startIndex: n.startIndex ?? 0,
1995
2367
  length: n.length ?? 0
1996
2368
  });
@@ -1999,10 +2371,10 @@ function Xn(e, n, r, i, a, o, s, c, u) {
1999
2371
  }
2000
2372
  e.end("threadedComment");
2001
2373
  }
2002
- function Zn(e) {
2374
+ function Zr(e) {
2003
2375
  return `{${e.replace(/^\{|\}$/g, "").toUpperCase()}}`;
2004
2376
  }
2005
- var Qn = 0, $n = (e, t, n, r) => {
2377
+ var Qr = 0, $r = (e, t, n, r) => {
2006
2378
  let i = r.columns, a = i ? i.length : 0;
2007
2379
  if (a !== 0) {
2008
2380
  t.start("tableColumns", { count: a });
@@ -2013,28 +2385,28 @@ var Qn = 0, $n = (e, t, n, r) => {
2013
2385
  s.id = o + 1, s.name = a.name ?? `Column${o + 1}`;
2014
2386
  let c = null, l = a.totalsRowFormula;
2015
2387
  if (typeof l == "number") {
2016
- let e = nr.get(l);
2388
+ let e = ni.get(l);
2017
2389
  e ? s.totalsRowFunction = e : c = `SUBTOTAL(${l},${r.name?.trim()}[${s.name}])`;
2018
- } else l && (c = er(e, n, o, l.startsWith("=") ? l.substring(1) : l));
2390
+ } else l && (c = ei(e, n, o, l.startsWith("=") ? l.substring(1) : l));
2019
2391
  c && (s.totalsRowFunction = "custom"), a.totalsRowLabel && (s.totalsRowLabel = a.totalsRowLabel);
2020
- let u = a.calculatedColumnFormula ? er(e, n, o, a.calculatedColumnFormula) : null;
2392
+ let u = a.calculatedColumnFormula ? ei(e, n, o, a.calculatedColumnFormula) : null;
2021
2393
  (c || u) && (t.start("tableColumn", s), u && (t.start("calculatedColumnFormula"), t.text(u), t.end("calculatedColumnFormula"))), c && (t.start("totalsRowFormula"), t.text(c), t.end("totalsRowFormula")), c || u ? t.end("tableColumn") : t.empty("tableColumn", s);
2022
2394
  }
2023
2395
  t.end("tableColumns");
2024
2396
  }
2025
- }, er = (e, t, n, i) => {
2026
- let a = e.getSharedStates().get(r);
2027
- if (!a) return i;
2397
+ }, ei = (e, t, n, r) => {
2398
+ let i = e.getSharedStates().get(y);
2399
+ if (!i) return r;
2028
2400
  try {
2029
- let e = t.getDataRange().getCoords(), r = {
2401
+ let e = t.getDataRange().getCoords(), a = {
2030
2402
  rowIndex: e.rowStart,
2031
2403
  colIndex: e.colStart + n
2032
- }, o = a.parse(i, r);
2033
- return o && ce.image(a.spell(o, !1, t.getName()), { at: r }) || i;
2404
+ }, o = i.parse(r, a);
2405
+ return o && Ae.image(i.spell(o, !1, t.getName()), { at: a }) || r;
2034
2406
  } catch {
2035
- return i;
2407
+ return r;
2036
2408
  }
2037
- }, tr = (e, t, n, r) => {
2409
+ }, ti = (e, t, n, r) => {
2038
2410
  let i = {
2039
2411
  name: n.getStyle().getName(),
2040
2412
  showFirstColumn: n.isShowHighlightFirstColumn() ? "1" : "0",
@@ -2043,7 +2415,7 @@ var Qn = 0, $n = (e, t, n, r) => {
2043
2415
  showColumnStripes: n.isShowBandedColumns() ? "1" : "0"
2044
2416
  };
2045
2417
  t.empty("tableStyleInfo", i);
2046
- }, nr = /* @__PURE__ */ new Map([
2418
+ }, ni = /* @__PURE__ */ new Map([
2047
2419
  [101, "average"],
2048
2420
  [102, "countNums"],
2049
2421
  [103, "count"],
@@ -2052,14 +2424,14 @@ var Qn = 0, $n = (e, t, n, r) => {
2052
2424
  [107, "stdDev"],
2053
2425
  [109, "sum"],
2054
2426
  [110, "var"]
2055
- ]), rr = {
2427
+ ]), ri = {
2056
2428
  rowIndex: 0,
2057
2429
  colIndex: 0
2058
2430
  };
2059
- function ir(e, t, n, r) {
2431
+ function ii(e, t, n, r) {
2060
2432
  if (r == null) return;
2061
- rr.rowIndex = t, rr.colIndex = n;
2062
- let i = j.cellToString(rr), a, o;
2433
+ ri.rowIndex = t, ri.colIndex = n;
2434
+ let i = j.cellToString(ri), a, o;
2063
2435
  switch (typeof r) {
2064
2436
  case "number":
2065
2437
  o = "" + r;
@@ -2073,7 +2445,7 @@ function ir(e, t, n, r) {
2073
2445
  default: {
2074
2446
  let e = r;
2075
2447
  if (e.t !== "e") return;
2076
- a = "e", o = se.getBuiltInByCode(e.v)?.getLabel() ?? se.BuiltIn.Value.getLabel();
2448
+ a = "e", o = ke.getBuiltInByCode(e.v)?.getLabel() ?? ke.BuiltIn.Value.getLabel();
2077
2449
  }
2078
2450
  }
2079
2451
  e.start("cell", a ? {
@@ -2081,18 +2453,18 @@ function ir(e, t, n, r) {
2081
2453
  t: a
2082
2454
  } : { r: i }), e.start("v"), e.text(o), e.end("v"), e.end("cell");
2083
2455
  }
2084
- var ar = (e, t, n, r) => {
2456
+ var ai = (e, t, n, r) => {
2085
2457
  t.start("mc:AlternateContent", { "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006" }), t.start("mc:Choice", {
2086
2458
  Requires: "c14",
2087
2459
  "xmlns:c14": "http://schemas.microsoft.com/office/drawing/2007/8/2/chart"
2088
2460
  }), t.empty("c14:style", { val: "102" }), t.end("mc:Choice"), t.start("mc:Fallback"), t.empty("c:style", { val: "2" }), t.end("mc:Fallback"), t.end("mc:AlternateContent");
2089
- }, or = (e, t, n, r, i) => {
2461
+ }, oi = (e, t, n, r, i) => {
2090
2462
  t.start("chart"), ((e, t, n, r, i) => {
2091
- t.start("title"), t.empty("overlay", { val: "0" }), wt(e, n, i, "spPr", !0), t.end("title"), t.empty("autoTitleDeleted", { val: "0" });
2463
+ t.start("title"), t.empty("overlay", { val: "0" }), Zt(e, n, i, "spPr", !0), t.end("title"), t.empty("autoTitleDeleted", { val: "0" });
2092
2464
  })(e, t, n, 0, i), ((e, t, n, r, i) => {
2093
- t.start("plotArea"), t.empty("layout"), wt(e, n, i, "spPr", !0), t.end("plotArea");
2465
+ t.start("plotArea"), t.empty("layout"), Zt(e, n, i, "spPr", !0), t.end("plotArea");
2094
2466
  })(e, t, n, 0, i), t.empty("plotVisOnly", { val: "1" }), t.empty("dispBlanksAs", { val: "gap" }), t.empty("showDLblsOverMax", { val: "0" }), t.end("chart");
2095
- }, sr = (e, t, n, r) => {
2467
+ }, si = (e, t, n, r) => {
2096
2468
  t.start("printSettings"), t.empty("headerFooter"), t.empty("pageMargins", {
2097
2469
  b: "0.75",
2098
2470
  l: "0.7",
@@ -2101,16 +2473,16 @@ var ar = (e, t, n, r) => {
2101
2473
  header: "0.3",
2102
2474
  footer: "0.3"
2103
2475
  }), t.empty("pageSetup"), t.end("printSettings");
2104
- }, cr = (e, t, n, r, i, a = "0") => {
2476
+ }, ci = (e, t, n, r, i, a = "0") => {
2105
2477
  let o = i?.color, s = { idx: i?.idx ?? a };
2106
- o === void 0 ? t.empty(r, s) : (t.start(r, s), o === "auto" ? t.empty("styleClr", { val: "auto" }) : (t.pushDefaultNamespace("a"), U(t, n.getTheme(), o), t.popDefaultNamespace()), t.end(r));
2107
- }, lr = (e, t, n, r) => {
2478
+ o === void 0 ? t.empty(r, s) : (t.start(r, s), o === "auto" ? t.empty("styleClr", { val: "auto" }) : (t.pushDefaultNamespace("a"), W(t, n.getTheme(), o), t.popDefaultNamespace()), t.end(r));
2479
+ }, li = (e, t, n, r) => {
2108
2480
  let i = n.length;
2109
2481
  for (let a = 0; a < i; a++) {
2110
2482
  let i = n[a];
2111
- i.empty ? t.empty(i.type, i.mods) : (t.start(i.type, i.mods), cr(0, t, r, "lnRef", i.lineRef, "0"), cr(0, t, r, "fillRef", i.fillRef, "0"), cr(0, t, r, "effectRef", i.effectRef, "0"), cr(0, t, r, "fontRef", i.fontRef, "minor"), wt(e, r, i, "spPr"), jn(e, 0, i.defRPr), Mn(e, r, i.bodyPr), t.end(i.type));
2483
+ i.empty ? t.empty(i.type, i.mods) : (t.start(i.type, i.mods), ci(0, t, r, "lnRef", i.lineRef, "0"), ci(0, t, r, "fillRef", i.fillRef, "0"), ci(0, t, r, "effectRef", i.effectRef, "0"), ci(0, t, r, "fontRef", i.fontRef, "minor"), Zt(e, r, i, "spPr"), Dr(e, 0, i.defRPr), Or(e, 0, i.bodyPr), t.end(i.type));
2112
2484
  }
2113
- }, ur = Object.freeze([
2485
+ }, ui = Object.freeze([
2114
2486
  {
2115
2487
  type: "axisTitle",
2116
2488
  fontRef: { color: "tx1 lumMod 65 lumOff 35" },
@@ -2462,13 +2834,13 @@ var ar = (e, t, n, r) => {
2462
2834
  fill: { type: "none" },
2463
2835
  stroke: {}
2464
2836
  }
2465
- ]), dr = (e, t, n) => {
2837
+ ]), di = (e, t, n) => {
2466
2838
  let r = n.length;
2467
2839
  for (let e = 0; e < r; e++) {
2468
2840
  let r = n[e], i = {}, a = r[0], o = r[1];
2469
2841
  a || o ? (t.start("variation", i), a && t.empty("a:lumMod", { val: a }), o && t.empty("a:lumOff", { val: o }), t.end("variation")) : t.empty("variation", i);
2470
2842
  }
2471
- }, fr = Object.freeze([
2843
+ }, fi = Object.freeze([
2472
2844
  [0, 0],
2473
2845
  [6e4, 0],
2474
2846
  [8e4, 2e4],
@@ -2478,8 +2850,8 @@ var ar = (e, t, n, r) => {
2478
2850
  [7e4, 3e4],
2479
2851
  [7e4, 0],
2480
2852
  [5e4, 5e4]
2481
- ]), pr = [
2482
- new class extends V {
2853
+ ]), pi = [
2854
+ new class extends H {
2483
2855
  constructor() {
2484
2856
  super({
2485
2857
  kind: "workbook",
@@ -2501,13 +2873,13 @@ var ar = (e, t, n, r) => {
2501
2873
  "xmlns:xr10": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision10",
2502
2874
  "xmlns:xr2": "http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"
2503
2875
  });
2504
- let i = t.getSharedStates().get(he), o = await e.toJSON({
2876
+ let i = t.getSharedStates().get(ze), a = await e.toJSON({
2505
2877
  ignoreData: !0,
2506
2878
  resources: (e, t) => (i?.set(t, e), null),
2507
2879
  includeHeaderStyles: !0,
2508
2880
  splitDirectBorders: !0
2509
2881
  });
2510
- t.getSharedStates().set(r, a(o.names, function(e) {
2882
+ t.getSharedStates().set(y, r(a.names, function(e) {
2511
2883
  let t = [], n = e.sheets ?? [];
2512
2884
  for (let e = 0; e < n.length; e++) {
2513
2885
  let r = n[e]?.sheet?.tables;
@@ -2517,23 +2889,23 @@ var ar = (e, t, n, r) => {
2517
2889
  }
2518
2890
  }
2519
2891
  return t;
2520
- }(o))), function(e, t) {
2521
- let n = e.getSharedStates().get(nt);
2892
+ }(a))), function(e, t) {
2893
+ let n = e.getSharedStates().get(Et);
2522
2894
  n && t.empty("fileVersion", n);
2523
2895
  }(t, n), function(e, t, n, r) {
2524
2896
  let i = {}, a = n.getCodeName();
2525
2897
  a && (i.codeName = a), n.getRuntime().isDate1904() && (i.date1904 = "1"), r.updateLinks && (i.updateLinks = r.updateLinks), t.empty("workbookPr", i);
2526
- }(0, n, e, o), function(e, t, n, r) {
2898
+ }(0, n, e, a), function(e, t, n, r) {
2527
2899
  let i = r.protection;
2528
2900
  if (!i || i.workbook) return;
2529
2901
  let a = {};
2530
- Ue(i.password ?? {}, a, "workbook"), Ue(i.revisionsPassword ?? {}, a, "revisions");
2531
- for (let e of ie) {
2532
- let t = re(e, i[e.key]);
2902
+ pt(i.password ?? {}, a, "workbook"), pt(i.revisionsPassword ?? {}, a, "revisions");
2903
+ for (let e of ee) {
2904
+ let t = be(e, i[e.key]);
2533
2905
  t !== null && (a[e.attribute] = t);
2534
2906
  }
2535
2907
  t.empty("workbookProtection", a);
2536
- }(0, n, 0, o), function(e, t, n) {
2908
+ }(0, n, 0, a), function(e, t, n) {
2537
2909
  t.start("bookViews");
2538
2910
  let r = n.getView(), i = {};
2539
2911
  r.isShowHorizontalScrollbar() || (i.showHorizontalScroll = "0"), r.isShowVerticalScrollbar() || (i.showVerticalScroll = "0"), r.isShowTabs() || (i.showSheetTabs = "0");
@@ -2541,8 +2913,8 @@ var ar = (e, t, n, r) => {
2541
2913
  a !== 600 && (i.tabRatio = a);
2542
2914
  let o = n.getSelectedSheet().getIndex();
2543
2915
  o !== 0 && (i.activeTab = "" + o), t.empty("workbookView", i), t.end("bookViews");
2544
- }(0, n, e, o.view);
2545
- let s = await (async (e, t) => {
2916
+ }(0, n, e, a.view);
2917
+ let o = await (async (e, t) => {
2546
2918
  let n = [], r = t ? t.length : 0;
2547
2919
  if (r === 0) return n;
2548
2920
  let i = /* @__PURE__ */ new Map();
@@ -2550,7 +2922,7 @@ var ar = (e, t, n, r) => {
2550
2922
  for (let a = 0; a < r; a++) {
2551
2923
  let r = t[a], o = r.cacheId, s = r.part;
2552
2924
  if (s?.xml && !i.has(o)) try {
2553
- let t = await Ze({
2925
+ let t = await xt({
2554
2926
  ...s,
2555
2927
  type: s.type || "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition",
2556
2928
  contentType: s.contentType || "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml"
@@ -2565,18 +2937,18 @@ var ar = (e, t, n, r) => {
2565
2937
  }
2566
2938
  }
2567
2939
  return n;
2568
- })(t, o.pivotCaches);
2940
+ })(t, a.pivotCaches);
2569
2941
  (function(e, t) {
2570
2942
  t.getComments().some((e) => !e.isNote()) && e.addPart("persons", t.getPeople());
2571
2943
  })(t, e), n.start("sheets");
2572
- let c = t.getSharedStates(), l = e.getStrings().beginPersist();
2573
- c.set("persistStrings", l);
2574
- let u = new Ke();
2575
- c.set("metaCollector", u);
2576
- let d = new qe(u, t.log.bind(t));
2577
- c.set("persistRichTypes", d), c.set(We, new Ge(o.styles, e.getStyles()));
2944
+ let s = t.getSharedStates(), c = e.getStrings().beginPersist();
2945
+ s.set("persistStrings", c);
2946
+ let l = new gt();
2947
+ s.set("metaCollector", l);
2948
+ let u = new _t(l, t.log.bind(t));
2949
+ s.set("persistRichTypes", u), s.set(mt, new ht(a.styles, e.getStyles()));
2578
2950
  try {
2579
- let r = e.getSheets().getItems({ visibility: ue.Visibility.VeryHidden }), i = o.sheets, a = e.getSelectedSheet(), s = r.length, u = ((e, t) => {
2951
+ let r = e.getSheets().getItems({ visibility: Ne.Visibility.VeryHidden }), i = a.sheets, o = e.getSelectedSheet(), l = r.length, u = ((e, t) => {
2580
2952
  let n = Array(t), r = /* @__PURE__ */ new Set(), i = 1;
2581
2953
  for (let a = 0; a < t; a++) {
2582
2954
  let t = e?.[a]?.sheetId;
@@ -2587,7 +2959,7 @@ var ar = (e, t, n, r) => {
2587
2959
  r.add(i), n[e] = i++;
2588
2960
  }
2589
2961
  return n;
2590
- })(i, s), d = ((e, t, n) => {
2962
+ })(i, l), d = ((e, t, n) => {
2591
2963
  let r = t.length, i = Array(r), a = new Set(n?.values() ?? []), o = /* @__PURE__ */ new Set();
2592
2964
  for (let a = 0; a < r; a++) {
2593
2965
  let r = e?.[a]?.sheetId;
@@ -2605,49 +2977,49 @@ var ar = (e, t, n, r) => {
2605
2977
  o.add(t), i[e] = t;
2606
2978
  }
2607
2979
  return i;
2608
- })(i, u, c.get(rt));
2609
- for (let e = 0; e < s; e++) {
2610
- let o = r[e], s = "" + u[e], c = {
2611
- name: o.getName(),
2980
+ })(i, u, s.get(Dt));
2981
+ for (let e = 0; e < l; e++) {
2982
+ let a = r[e], s = "" + u[e], l = {
2983
+ name: a.getName(),
2612
2984
  sheetId: s
2613
- }, f = o.getVisibility();
2614
- f === "hidden" ? c.state = "hidden" : f === "veryHidden" && (c.state = "veryHidden");
2985
+ }, f = a.getVisibility();
2986
+ f === "hidden" ? l.state = "hidden" : f === "veryHidden" && (l.state = "veryHidden");
2615
2987
  let p = i[e].sheet;
2616
- c["r:id"] = t.addPart("worksheet", {
2617
- model: o,
2618
- isSelected: a === o,
2988
+ l["r:id"] = t.addPart("worksheet", {
2989
+ model: a,
2990
+ isSelected: o === a,
2619
2991
  json: p,
2620
- persistStrings: l
2621
- }, "/" + d[e]).relId, n.empty("sheet", c);
2992
+ persistStrings: c
2993
+ }, "/" + d[e]).relId, n.empty("sheet", l);
2622
2994
  }
2623
2995
  await t.waitEmit();
2624
2996
  let f = e.getTheme();
2625
2997
  t.addPart("theme", {
2626
2998
  model: f,
2627
- json: o.theme
2999
+ json: a.theme
2628
3000
  }), await t.waitEmit(), t.addPart("styles", {
2629
3001
  styles: e.getStyles(),
2630
3002
  theme: e.getTheme(),
2631
- json: o.styles
3003
+ json: a.styles
2632
3004
  }), await t.waitEmit();
2633
- let p = await l.toJSONAsync();
3005
+ let p = await c.toJSONAsync();
2634
3006
  p && p.length > 0 && (t.addPart("sharedStrings", {
2635
3007
  model: p,
2636
3008
  json: p
2637
3009
  }), await t.waitEmit());
2638
- let m = c.get("persistRichTypes");
3010
+ let m = s.get("persistRichTypes");
2639
3011
  m?.hasAny() && (t.addPart("richValue", m), t.addPart("richValueStructure", m), t.addPart("richValueTypes", null), await t.waitEmit());
2640
- let h = c.get("metaCollector");
2641
- h?.hasAny() && (t.addPart("metadata", h), await t.waitEmit()), c.delete("persistRichTypes"), c.delete("metaCollector"), c.delete("persistStrings");
3012
+ let h = s.get("metaCollector");
3013
+ h?.hasAny() && (t.addPart("metadata", h), await t.waitEmit()), s.delete("persistRichTypes"), s.delete("metaCollector"), s.delete("persistStrings");
2642
3014
  } catch (e) {
2643
3015
  throw e;
2644
3016
  } finally {
2645
- l.endPersist();
3017
+ c.endPersist();
2646
3018
  }
2647
3019
  n.end("sheets"), function(e, t, n) {
2648
3020
  let r = n.externalBooks, i = r ? r.length : 0;
2649
3021
  if (i === 0) return;
2650
- let a = e.getSharedStates().get(it), o = /* @__PURE__ */ new Set();
3022
+ let a = e.getSharedStates().get(Ot), o = /* @__PURE__ */ new Set();
2651
3023
  if (a) for (let e = 0; e < i; e++) !r[e] && a[e] && o.add(a[e]);
2652
3024
  let s = [], c = 1;
2653
3025
  for (let t = 0; t < i; t++) {
@@ -2660,7 +3032,7 @@ var ar = (e, t, n, r) => {
2660
3032
  s.push(e.addPart("externalLink", n, "/" + t).relId);
2661
3033
  continue;
2662
3034
  }
2663
- let i = a?.[t], l = i ? e.addRelationship(tt, i) : null;
3035
+ let i = a?.[t], l = i ? e.addRelationship(Tt, i) : null;
2664
3036
  l ? s.push(l) : e.log(`External link [${t + 1}] cannot be written and is being dropped; later links will renumber.`);
2665
3037
  }
2666
3038
  if (s.length !== 0) {
@@ -2668,31 +3040,31 @@ var ar = (e, t, n, r) => {
2668
3040
  for (let e = 0; e < s.length; e++) t.empty("externalReference", { "r:id": s[e] });
2669
3041
  t.end("externalReferences");
2670
3042
  }
2671
- }(t, n, o), function(e, t, n, i) {
2672
- let a = e.getSharedStates().get(r), o = i.names, s = o ? o.length : 0;
2673
- if (s === 0) return;
2674
- let c = i.externalBooks?.length ?? 0, l = /* @__PURE__ */ new Map(), u = n.getSheets().getItems({ visibility: ue.Visibility.VeryHidden });
2675
- for (let e = 0; e < u.length; e++) l.set(u[e].getName().toLowerCase(), e);
3043
+ }(t, n, a), function(e, t, n, r) {
3044
+ let i = e.getSharedStates().get(y), a = r.names, o = a ? a.length : 0;
3045
+ if (o === 0) return;
3046
+ let s = r.externalBooks?.length ?? 0, c = /* @__PURE__ */ new Map(), l = n.getSheets().getItems({ visibility: Ne.Visibility.VeryHidden });
3047
+ for (let e = 0; e < l.length; e++) c.set(l[e].getName().toLowerCase(), e);
2676
3048
  t.start("definedNames");
2677
- for (let n = 0; n < s; n++) {
2678
- let r = o[n], i = { name: r.name };
2679
- if (r.comment && (i.comment = r.comment), r.scope) {
2680
- let t = l.get(r.scope.toLowerCase());
2681
- t === void 0 ? e.log(`Defined name '${r.name}' is scoped to unknown sheet '${r.scope}'; writing it as global.`) : i.localSheetId = "" + t;
3049
+ for (let n = 0; n < o; n++) {
3050
+ let r = a[n], o = { name: r.name };
3051
+ if (r.comment && (o.comment = r.comment), r.scope) {
3052
+ let t = c.get(r.scope.toLowerCase());
3053
+ t === void 0 ? e.log(`Defined name '${r.name}' is scoped to unknown sheet '${r.scope}'; writing it as global.`) : o.localSheetId = "" + t;
2682
3054
  }
2683
- r.hidden && (i.hidden = "1");
2684
- let s = a.writeName(r.ref);
2685
- for (let t of at(s)) t > c && e.log(`Defined name '${r.name}' cites external book [${t}], but only ${c} ${c === 1 ? "is" : "are"} written; Excel will report the file as needing repair.`);
2686
- t.start("definedName", i), t.text(s), t.end("definedName");
3055
+ r.hidden && (o.hidden = "1");
3056
+ let l = i.writeName(r.ref);
3057
+ for (let t of kt(l)) t > s && e.log(`Defined name '${r.name}' cites external book [${t}], but only ${s} ${s === 1 ? "is" : "are"} written; Excel will report the file as needing repair.`);
3058
+ t.start("definedName", o), t.text(l), t.end("definedName");
2687
3059
  }
2688
3060
  t.end("definedNames");
2689
- }(t, n, e, o), function(e, t, n) {
3061
+ }(t, n, e, a), function(e, t, n) {
2690
3062
  let r = n.getCalculation().toJSON(), i = { calcId: e.getSharedStates().get("calcId") ?? "191029" }, a = (e, t) => {
2691
3063
  let n = r[e];
2692
3064
  typeof n == "boolean" && (i[t] = n ? "1" : "0");
2693
3065
  };
2694
3066
  if (r.calcMode) {
2695
- let e = ot[r.calcMode];
3067
+ let e = At[r.calcMode];
2696
3068
  e && e !== "auto" && (i.calcMode = e);
2697
3069
  }
2698
3070
  a("fullCalcOnLoad", "fullCalcOnLoad"), a("calcOnSave", "calcOnSave"), a("calcCompleted", "calcCompleted"), a("fullPrecision", "fullPrecision"), a("forceFullCalc", "forceFullCalc"), a("concurrentCalc", "concurrentCalc"), r.refMode && (i.refMode = r.refMode), r.iterate && (i.iterate = "1"), r.maxIteration !== void 0 && (i.iterateCount = String(r.maxIteration)), r.maxIterateChange !== void 0 && (i.iterateDelta = String(r.maxIterateChange)), t.empty("calcPr", i);
@@ -2705,13 +3077,13 @@ var ar = (e, t, n, r) => {
2705
3077
  });
2706
3078
  e.end("pivotCaches");
2707
3079
  }
2708
- }(n, s), function(e, t) {
3080
+ }(n, o), function(e, t) {
2709
3081
  let n = e.getSharedStates().get("calcFeatures") ?? "<ext uri=\"{B58B0392-4F1F-4190-BB64-5DF3571DCE5F}\" xmlns:xcalcf=\"http://schemas.microsoft.com/office/spreadsheetml/2018/calcfeatures\"><xcalcf:calcFeatures><xcalcf:feature name=\"microsoft.com:RD\"/><xcalcf:feature name=\"microsoft.com:Single\"/><xcalcf:feature name=\"microsoft.com:FV\"/><xcalcf:feature name=\"microsoft.com:CNMTM\"/><xcalcf:feature name=\"microsoft.com:LET_WF\"/><xcalcf:feature name=\"microsoft.com:LAMBDA_WF\"/><xcalcf:feature name=\"microsoft.com:ARRAYTEXT_WF\"/></xcalcf:calcFeatures></ext>";
2710
3082
  t.start("extLst"), t.raw(n), t.end("extLst");
2711
3083
  }(t, n), n.end("workbook"), n.close();
2712
3084
  }
2713
3085
  }(),
2714
- new class extends V {
3086
+ new class extends H {
2715
3087
  constructor() {
2716
3088
  super({
2717
3089
  kind: "worksheet",
@@ -2720,9 +3092,9 @@ var ar = (e, t, n, r) => {
2720
3092
  path: () => "/xl/worksheets/sheet{n}.xml"
2721
3093
  });
2722
3094
  }
2723
- async emit(n, i) {
2724
- let o = i.getXMLWriter(), d = n.model, f = n.json;
2725
- o.decl(), o.start("worksheet", {
3095
+ async emit(e, t) {
3096
+ let n = t.getXMLWriter(), i = e.model, o = e.json;
3097
+ n.decl(), n.start("worksheet", {
2726
3098
  xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
2727
3099
  "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
2728
3100
  "xmlns:mc": "http://schemas.openxmlformats.org/markup-compatibility/2006",
@@ -2731,15 +3103,15 @@ var ar = (e, t, n, r) => {
2731
3103
  }), function(e, t, n) {
2732
3104
  let r = n.getTabColor(), i = n.getCodeName(), a = {};
2733
3105
  i && (a.codeName = i), n.isConditionalFormatCalculationEnabled() || (a.enableFormatConditionsCalculation = "0");
2734
- let o = n.getOutlineSettings(), s = {};
2735
- o.summaryBelow || (s.summaryBelow = "0"), o.summaryRight || (s.summaryRight = "0"), o.showOutlineSymbols || (s.showOutlineSymbols = "0"), o.applyStyles && (s.applyStyles = "1");
3106
+ let o = n.getOutline(), s = {};
3107
+ o.getSummaryDirection(z.Axis.Row) === z.Direction.Up && (s.summaryBelow = "0"), o.getSummaryDirection(z.Axis.Column) === z.Direction.Left && (s.summaryRight = "0"), n.getView().isShowOutlineSymbols() || (s.showOutlineSymbols = "0"), o.isAutomaticStyles() && (s.applyStyles = "1");
2736
3108
  let c = Object.keys(s).length > 0, l = !!r || c;
2737
3109
  if (!(!l && Object.keys(a).length === 0)) {
2738
3110
  if (!l) return void t.empty("sheetPr", a);
2739
- t.start("sheetPr", a), r && G(t, n.getStyles().getTheme(), r, "tabColor", !1), c && t.empty("outlinePr", s), t.end("sheetPr");
3111
+ t.start("sheetPr", a), r && K(t, n.getStyles().getTheme(), r, "tabColor", !1), c && t.empty("outlinePr", s), t.end("sheetPr");
2740
3112
  }
2741
- }(0, o, d), function(e, t, n, r) {
2742
- let i = n.getUsedRange({ features: [] }), a = i ? i.getCoords() : null, o = w, s = k, c = r.directStyles, l = c ? c.length : 0;
3113
+ }(0, n, i), function(e, t, n, r) {
3114
+ let i = n.getUsedRange({ features: [] }), a = i ? i.getCoords() : null, o = he, s = xe, c = r.directStyles, l = c ? c.length : 0;
2743
3115
  for (let e = 0; e < l; e++) {
2744
3116
  let t = n.getRange(c[e][0]).getCoords();
2745
3117
  if (t.colEnd === s) {
@@ -2758,12 +3130,12 @@ var ar = (e, t, n, r) => {
2758
3130
  rowEnd: e
2759
3131
  };
2760
3132
  }
2761
- a = oe.unionRanges(a, t);
3133
+ a = Oe.unionRanges(a, t);
2762
3134
  }
2763
3135
  let u = r.merges, d = u ? u.length : 0;
2764
3136
  for (let e = 0; e < d; e++) {
2765
3137
  let t = n.getRange(u[e]).getCoords();
2766
- t.colEnd === s && (t = { ...a }, t.colStart = a?.colStart ?? 0, t.colEnd = t.colStart), t.rowEnd === o && (t = { ...t }, t.rowStart = a?.rowStart ?? 0, t.rowEnd = t.rowStart), a = oe.unionRanges(a, t);
3138
+ t.colEnd === s && (t = { ...a }, t.colStart = a?.colStart ?? 0, t.colEnd = t.colStart), t.rowEnd === o && (t = { ...t }, t.rowStart = a?.rowStart ?? 0, t.rowEnd = t.rowStart), a = Oe.unionRanges(a, t);
2767
3139
  }
2768
3140
  let f = "A1";
2769
3141
  a && (i = n.getRange(a), f = a.colStart === a.colEnd && a.rowStart === a.rowEnd ? i.getAddress() : `${i.getIntersect({
@@ -2777,14 +3149,14 @@ var ar = (e, t, n, r) => {
2777
3149
  colEnd: a.colEnd,
2778
3150
  rowEnd: a.rowEnd
2779
3151
  }).getAddress()}`), t.empty("dimension", { ref: f });
2780
- }(0, o, d, f), function(e, t, n, r, i) {
3152
+ }(0, n, i, o), function(e, t, n, r, i) {
2781
3153
  let a = n.getView(), o = a.getTopLeft(), s = n.getRowHeaders().getIndex(o.top), c = n.getColumnHeaders().getIndex(o.left), l = j.cellToString({
2782
3154
  colIndex: c,
2783
3155
  rowIndex: s
2784
3156
  });
2785
3157
  t.start("sheetViews");
2786
3158
  let u = {};
2787
- a.isShowFormulas() && (u.showFormulas = "1"), a.isShowColumnGridlines() || a.isShowRowGridlines() || (u.showGridLines = "0"), a.isShowColumnHeaders() || a.isShowRowHeaders() || (u.showRowColHeaders = "0"), a.isShowZeros() || (u.showZeros = "0"), a.isRightToLeft() && (u.rightToLeft = "1"), i && (u.tabSelected = "1"), l !== "A1" && (u.topLeftCell = l);
3159
+ a.isShowFormulas() && (u.showFormulas = "1"), a.isShowColumnGridlines() || a.isShowRowGridlines() || (u.showGridLines = "0"), a.isShowColumnHeaders() || a.isShowRowHeaders() || (u.showRowColHeaders = "0"), a.isShowZeros() || (u.showZeros = "0"), a.isRightToLeft() && (u.rightToLeft = "1"), a.isShowOutlineSymbols() || (u.showOutlineSymbols = "0"), i && (u.tabSelected = "1"), l !== "A1" && (u.topLeftCell = l);
2788
3160
  let d = a.getZoomScale();
2789
3161
  d !== 100 && (u.zoomScale = d, u.zoomScaleNormal = d);
2790
3162
  let f = a.getGridLineColor();
@@ -2865,11 +3237,15 @@ var ar = (e, t, n, r) => {
2865
3237
  h.sqref = e, (p.rangeIndex ?? 0) > 0 && (h.activeCellId = "" + p.rangeIndex);
2866
3238
  } else m === "A1" ? h = null : h.sqref = m;
2867
3239
  h && t.empty("selection", h), t.end("sheetView"), t.end("sheetViews");
2868
- }(0, o, d, 0, n.isSelected), function(e, t, n, r) {
3240
+ }(0, n, i, 0, e.isSelected), function(e, t, n, r) {
2869
3241
  let i = r.defaultColSize, a = r.defaultRowSize, o = {};
2870
- i !== void 0 && (o.defaultColWidth = i), o.defaultRowHeight = a ?? .75 * n.getRowHeaders().getDefaultSize(), a !== void 0 && (o.customHeight = "1"), o["x14ac:dyDescent"] = "0.25", t.empty("sheetFormatPr", o);
2871
- }(0, o, d, f);
2872
- let p = !1 === f.protection?.showFormulas ? i.getSharedStates().get("hiddenFormulaXfs") ?? null : null;
3242
+ i !== void 0 && (o.defaultColWidth = i), o.defaultRowHeight = a ?? .75 * n.getRowHeaders().getDefaultSize(), a !== void 0 && (o.customHeight = "1");
3243
+ let s = n.getOutline(), c = s.getLevelCount(z.Axis.Row);
3244
+ c > 0 && (o.outlineLevelRow = c);
3245
+ let l = s.getLevelCount(z.Axis.Column);
3246
+ l > 0 && (o.outlineLevelCol = l), o["x14ac:dyDescent"] = "0.25", t.empty("sheetFormatPr", o);
3247
+ }(0, n, i, o);
3248
+ let s = !1 === o.protection?.showFormulas ? t.getSharedStates().get("hiddenFormulaXfs") ?? null : null;
2873
3249
  (function(e, t, n, r, i) {
2874
3250
  let a = r.cols ? j.refsToRuns(r.cols, !0) : null, o = a ? a.length : 0;
2875
3251
  n.getEntireRange().getColumnEnd();
@@ -2882,95 +3258,96 @@ var ar = (e, t, n, r) => {
2882
3258
  });
2883
3259
  };
2884
3260
  if (o > 0 || c !== 0) {
3261
+ let e = Pn(n.getOutline(), z.Axis.Column);
2885
3262
  t.start("cols");
2886
- for (let e = 0; e < o; e++) {
2887
- let n = a[e], r = n.min + 1, o = k + 1;
2888
- if (r > o) continue;
2889
- let c = Math.min(n.max + 1, o);
2890
- u(r - 1), l = c + 1;
2891
- let d = {
2892
- min: r,
2893
- max: c
2894
- }, f = n.value, p = f.sz;
2895
- p === void 0 ? d.width = s : p !== 0 && (d.width = Math.round(256 * p) / 256);
2896
- let m = i ? i.getHiddenXf(f.s ?? 0) : f.s;
2897
- m && (d.style = m), f.h !== void 0 && (d.hidden = 1), f.csz && (d.customWidth = 1), f.l !== void 0 && (d.outlineLevel = f.l), f.cl !== void 0 && (d.collapsed = 1), t.empty("col", d);
3263
+ for (let n = 0; n < o; n++) {
3264
+ let r = a[n], o = r.min + 1, c = xe + 1;
3265
+ if (o > c) continue;
3266
+ let d = Math.min(r.max + 1, c);
3267
+ u(o - 1), l = d + 1;
3268
+ let f = {
3269
+ min: o,
3270
+ max: d
3271
+ }, p = r.value, m = p.sz;
3272
+ m === void 0 ? f.width = s : m !== 0 && (f.width = Math.round(256 * m) / 256);
3273
+ let h = i ? i.getHiddenXf(p.s ?? 0) : p.s;
3274
+ h && (f.style = h), p.h !== void 0 && (f.hidden = 1), p.csz && (f.customWidth = 1), p.l && (f.outlineLevel = p.l), (r.min === r.max ? e.has(r.min) : p.cl) && (f.collapsed = 1), t.empty("col", f);
2898
3275
  }
2899
- u(k + 1), t.end("cols");
3276
+ u(xe + 1), t.end("cols");
2900
3277
  }
2901
- })(0, o, d, f, p), function(n, r, i, o, s, c) {
2902
- let d = n.getSharedStates(), f = d.get("persistStrings"), p = d.get("metaCollector"), m = d.get("persistRichTypes"), h = 0, g = 0, _ = i.getUsedRange(), v = 0, y = o.rows ? j.refsToRuns(o.rows, !1) : null, b = y ? y.length : 0, x = y?.[b - 1]?.max ?? -1, S = o.cols ? j.refsToRuns(o.cols, !0) : null, C = S ? S.length : 0, te = S?.[C - 1]?.max ?? -1;
2903
- if (_ || b > 0) {
2904
- let d = .75, _ = o.defaultRowSize ?? i.getRowHeaders().getDefaultSize() * d, b = i.getStyles().getNormal().getBestFit().height * d, C = (e, t) => {
2905
- let n = bn;
3278
+ })(0, n, i, o, s), function(e, t, n, i, a, o) {
3279
+ let s = e.getSharedStates(), c = s.get("persistStrings"), l = s.get("metaCollector"), u = s.get("persistRichTypes"), d = 0, f = 0, p = n.getUsedRange(), m = 0, h = i.rows ? j.refsToRuns(i.rows, !1) : null, g = h ? h.length : 0, _ = h?.[g - 1]?.max ?? -1, v = i.cols ? j.refsToRuns(i.cols, !0) : null, y = v ? v.length : 0, b = v?.[y - 1]?.max ?? -1;
3280
+ if (p || g > 0) {
3281
+ let s = .75, p = i.defaultRowSize ?? n.getRowHeaders().getDefaultSize() * s, g = n.getStyles().getNormal().getBestFit().height * s, y = Pn(n.getOutline(), z.Axis.Row), x = (e, t) => {
3282
+ let n = nr;
2906
3283
  if (n.r = "" + (e + 1), n.s = void 0, n.customFormat = void 0, n.hidden = void 0, n.ht = void 0, n.customHeight = void 0, n.outlineLevel = void 0, n.collapsed = void 0, !t) return n;
2907
3284
  let r = t.value;
2908
- r.s !== void 0 && (n.s = "" + (c ? c.getHiddenXf(r.s) : r.s), n.customFormat = "1"), r.h && (n.hidden = "1");
2909
- let i = r.csz ?? !1, a = r.sz ?? _;
2910
- return (a !== b || i) && (n.ht = "" + a), i && (n.customHeight = "1"), r.l !== void 0 && (n.outlineLevel = "" + r.l), r.cl !== void 0 && (n.collapsed = "" + r.cl), n;
2911
- }, w = 0, T = y?.[w] ?? null, E = T?.min ?? 2 ** 53 - 1, ne = T?.max ?? 2 ** 53 - 1, D = T?.value?.s, O = -1, k = 0, A = S?.[k] ?? null, re = A?.min ?? 2 ** 53 - 1, ie = A?.max ?? 2 ** 53 - 1, M = A?.value?.s, ae = (e, t = !1) => {
2912
- if (O !== e) {
2913
- for (O !== -1 && (r.end("row"), k !== 0 && (k = 0, A = S?.[k] ?? null, re = A?.min ?? 2 ** 53 - 1, ie = A?.max ?? 2 ** 53 - 1, M = A?.value?.s)); O + 1 <= e;) {
2914
- O++, T && O > ne && (T = y[++w] ?? null, T ? (E = T.min, ne = T.max, D = T.value?.s) : (E = 2 ** 53 - 1, ne = 2 ** 53 - 1, D = void 0)), O < E && O < e && (O = T ? Math.min(E, e) : e);
2915
- let n = O < e || t && O === e, i = C(O, T && O >= E && O <= ne ? T : null);
2916
- n ? r.empty("row", i) : r.start("row", i);
3285
+ r.s !== void 0 && (n.s = "" + (o ? o.getHiddenXf(r.s) : r.s), n.customFormat = "1"), r.h && (n.hidden = "1");
3286
+ let i = r.csz ?? !1, a = r.sz ?? p;
3287
+ return (a !== g || i) && (n.ht = "" + a), i && (n.customHeight = "1"), r.l && (n.outlineLevel = "" + r.l), y.has(e) && (n.collapsed = "1"), n;
3288
+ }, S = 0, C = h?.[S] ?? null, w = C?.min ?? 2 ** 53 - 1, T = C?.max ?? 2 ** 53 - 1, E = C?.value?.s, D = -1, ee = 0, O = v?.[ee] ?? null, te = O?.min ?? 2 ** 53 - 1, re = O?.max ?? 2 ** 53 - 1, ae = O?.value?.s, oe = (e, n = !1) => {
3289
+ if (D !== e) {
3290
+ for (D !== -1 && (t.end("row"), ee !== 0 && (ee = 0, O = v?.[ee] ?? null, te = O?.min ?? 2 ** 53 - 1, re = O?.max ?? 2 ** 53 - 1, ae = O?.value?.s)); D + 1 <= e;) {
3291
+ D++, C && D > T && (C = h[++S] ?? null, C ? (w = C.min, T = C.max, E = C.value?.s) : (w = 2 ** 53 - 1, T = 2 ** 53 - 1, E = void 0)), D < w && D < e && (D = C ? Math.min(w, e) : e);
3292
+ let r = D < e || n && D === e, i = x(D, C && D >= w && D <= T ? C : null);
3293
+ r ? t.empty("row", i) : t.start("row", i);
2917
3294
  }
2918
- if (e < O) {
2919
- let t = C(e, null);
2920
- r.start("row", t);
3295
+ if (e < D) {
3296
+ let n = x(e, null);
3297
+ t.start("row", n);
2921
3298
  }
2922
3299
  }
2923
3300
  };
2924
- r.setValidationDisabled(!0), r.start("sheetData");
2925
- let N = [];
2926
- N.push(Qt(n, i, o.directStyles));
2927
- let oe = o.formulas, P = oe ? oe.length : 0;
2928
- if (P > 0) {
3301
+ t.setValidationDisabled(!0), t.start("sheetData");
3302
+ let A = [];
3303
+ A.push(In(e, n, i.directStyles));
3304
+ let ce = i.formulas, le = ce ? ce.length : 0;
3305
+ if (le > 0) {
2929
3306
  let t = /* @__PURE__ */ new Map();
2930
- if (s.names.size > 0 && o.formulaArray) for (let e of o.formulaArray) try {
2931
- let n = i.getRange(e[0]).getCoords();
2932
- t.set(`${n.rowStart},${n.colStart}`, n);
3307
+ if (a.names.size > 0 && i.formulaArray) for (let e of i.formulaArray) try {
3308
+ let r = n.getRange(e[0]).getCoords();
3309
+ t.set(`${r.rowStart},${r.colStart}`, r);
2933
3310
  } catch {}
2934
- let r = [];
2935
- if (o.formulaArray) for (let e of o.formulaArray) try {
2936
- r.push(i.getRange(e[0]).getCoords());
3311
+ let o = [];
3312
+ if (i.formulaArray) for (let e of i.formulaArray) try {
3313
+ o.push(n.getRange(e[0]).getCoords());
2937
3314
  } catch {}
2938
- let c = (e) => {
2939
- for (let t = 0; t < r.length; t++) {
2940
- let n = r[t];
3315
+ let s = (e) => {
3316
+ for (let t = 0; t < o.length; t++) {
3317
+ let n = o[t];
2941
3318
  if (n.rowStart <= e.rowEnd && n.rowEnd >= e.rowStart && n.colStart <= e.colEnd && n.colEnd >= e.colStart) return !0;
2942
3319
  }
2943
3320
  return !1;
2944
- }, l = n.getSharedStates().get("xlsxFormulaDialect") ?? a(i.getCalculation().getNamedFormulas().toJSON(), i.getTables().getItems().map((e) => e.getName())), u = i.getEntireRange().getCoords(), d = [];
2945
- for (let e of i.getTables().getItems()) d.push([e.getRange().getCoords(), e.getName()]);
2946
- let f = (e, t) => {
2947
- for (let n = 0; n < d.length; n++) {
2948
- let r = d[n][0];
2949
- if (e >= r.rowStart && e <= r.rowEnd && t >= r.colStart && t <= r.colEnd) return d[n][1];
3321
+ }, c = e.getSharedStates().get("xlsxFormulaDialect") ?? r(n.getCalculation().getNamedFormulas().toJSON(), n.getTables().getItems().map((e) => e.getName())), l = n.getEntireRange().getCoords(), u = [];
3322
+ for (let e of n.getTables().getItems()) u.push([e.getRange().getCoords(), e.getName()]);
3323
+ let d = (e, t) => {
3324
+ for (let n = 0; n < u.length; n++) {
3325
+ let r = u[n][0];
3326
+ if (e >= r.rowStart && e <= r.rowEnd && t >= r.colStart && t <= r.colEnd) return u[n][1];
2950
3327
  }
2951
3328
  return null;
2952
- }, p = /* @__PURE__ */ new Set();
2953
- for (let e = 0; e < r.length; e++) p.add(`${r[e].rowStart},${r[e].colStart}`);
2954
- let m = [];
2955
- for (let r = 0; r < P; r++) {
2956
- let a = oe[r];
3329
+ }, f = /* @__PURE__ */ new Set();
3330
+ for (let e = 0; e < o.length; e++) f.add(`${o[e].rowStart},${o[e].colStart}`);
3331
+ let p = [];
3332
+ for (let r = 0; r < le; r++) {
3333
+ let i = ce[r];
2957
3334
  try {
2958
- let n = a[0], o = i.getRange(n), d = o.getCoords(), h = a[1], g = null, _ = {
2959
- rowIndex: d.rowStart,
2960
- colIndex: d.colStart
2961
- }, y = l.parse(h, _), b = y ? l.annotate(y) : void 0, x = y ? l.spell(y, p.has(`${d.rowStart},${d.colStart}`), f(d.rowStart, d.colStart)) : null, S = x ? ce.imager(x, { entireCoords: u }) : null;
2962
- S && (h = S(_));
2963
- let C = !0 === b?.cm, te = !0 === b?.ca;
2964
- if (s.affects(r)) {
2965
- g = null, C = !1;
2966
- let n = (e, t, n) => {
3335
+ let e = i[0], o = n.getRange(e), u = o.getCoords(), h = i[1], g = null, _ = {
3336
+ rowIndex: u.rowStart,
3337
+ colIndex: u.colStart
3338
+ }, v = c.parse(h, _), y = v ? c.annotate(v) : void 0, b = v ? c.spell(v, f.has(`${u.rowStart},${u.colStart}`), d(u.rowStart, u.colStart)) : null, x = b ? Ae.imager(b, { entireCoords: l }) : null;
3339
+ x && (h = x(_));
3340
+ let S = !0 === y?.cm, C = !0 === y?.ca;
3341
+ if (a.affects(r)) {
3342
+ g = null, S = !1;
3343
+ let e = (e, t, n) => {
2967
3344
  let r = {
2968
3345
  rowStart: e,
2969
3346
  colStart: t,
2970
3347
  rowEnd: e,
2971
3348
  colEnd: t
2972
3349
  };
2973
- m.push([r, {
3350
+ p.push([r, {
2974
3351
  coords: r,
2975
3352
  formula: n,
2976
3353
  sharedId: null,
@@ -2978,152 +3355,152 @@ var ar = (e, t, n, r) => {
2978
3355
  isDynamicRange: !1,
2979
3356
  isWrapped: !0
2980
3357
  }]);
2981
- }, r = t.get(`${d.rowStart},${d.colStart}`), a = r !== void 0 && (r.rowEnd > r.rowStart || r.colEnd > r.colStart), s = !1;
2982
- if (a) {
2983
- let t = ee(h, o.getCell().getValue());
2984
- if (t !== null) for (let a = r.rowStart; a <= r.rowEnd; a++) for (let o = r.colStart; o <= r.colEnd; o++) {
2985
- if (a === r.rowStart && o === r.colStart) {
2986
- n(a, o, t), s = !0;
3358
+ }, r = t.get(`${u.rowStart},${u.colStart}`), i = r !== void 0 && (r.rowEnd > r.rowStart || r.colEnd > r.colStart), a = !1;
3359
+ if (i) {
3360
+ let t = se(h, o.getCell().getValue());
3361
+ if (t !== null) for (let i = r.rowStart; i <= r.rowEnd; i++) for (let o = r.colStart; o <= r.colEnd; o++) {
3362
+ if (i === r.rowStart && o === r.colStart) {
3363
+ e(i, o, t), a = !0;
2987
3364
  continue;
2988
3365
  }
2989
- let c = e(i.getRange(j.rangeToString({
2990
- rowStart: a,
3366
+ let s = k(n.getRange(j.rangeToString({
3367
+ rowStart: i,
2991
3368
  colStart: o,
2992
- rowEnd: a,
3369
+ rowEnd: i,
2993
3370
  colEnd: o
2994
3371
  })).getCell().getValue());
2995
- c !== null && n(a, o, c);
3372
+ s !== null && e(i, o, s);
2996
3373
  }
2997
- } else o.forEach((e, t) => {
2998
- let r = t.getCoords(), i = ee(S?.(r) ?? h, t.getCell().getValue());
2999
- i !== null && (n(r.rowIndex, r.colIndex, i), s = !0);
3374
+ } else o.forEach((t, n) => {
3375
+ let r = n.getCoords(), i = se(x?.(r) ?? h, n.getCell().getValue());
3376
+ i !== null && (e(r.rowIndex, r.colIndex, i), a = !0);
3000
3377
  }, { includeEmpty: !0 });
3001
- if (s) continue;
3378
+ if (a) continue;
3002
3379
  }
3003
3380
  let w = h.indexOf("!") !== -1 || h.indexOf("[") !== -1;
3004
- C || o.isSingleCell() || w || c(d) || (g = "" + v++);
3005
- let T = g !== null || o.isSingleCell() ? null : S, E = [d, {
3006
- coords: d,
3381
+ S || o.isSingleCell() || w || s(u) || (g = "" + m++);
3382
+ let T = g !== null || o.isSingleCell() ? null : x, E = [u, {
3383
+ coords: u,
3007
3384
  formula: h,
3008
3385
  sharedId: g,
3009
- ref: n,
3010
- isDynamicRange: C,
3011
- isExcelVolatile: te,
3386
+ ref: e,
3387
+ isDynamicRange: S,
3388
+ isExcelVolatile: C,
3012
3389
  memberImage: T
3013
3390
  }];
3014
- m.push(E);
3015
- } catch (e) {
3016
- n.log(`Could not write the formula '${a[1]}' over '${a[0]}'; those cells are written as values only. ${e}`);
3391
+ p.push(E);
3392
+ } catch (t) {
3393
+ e.log(`Could not write the formula '${i[1]}' over '${i[0]}'; those cells are written as values only. ${t}`);
3017
3394
  continue;
3018
3395
  }
3019
3396
  }
3020
- N.push(m);
3021
- } else N.push([]);
3022
- let F = o.volatile, I = F ? F.length : 0;
3023
- if (I > 0) {
3024
- let e = Array(I);
3025
- for (let t = 0; t < I; t++) {
3026
- let n = F[t];
3397
+ A.push(p);
3398
+ } else A.push([]);
3399
+ let ue = i.volatile, de = ue ? ue.length : 0;
3400
+ if (de > 0) {
3401
+ let e = Array(de);
3402
+ for (let t = 0; t < de; t++) {
3403
+ let r = ue[t];
3027
3404
  try {
3028
- e[t] = [i.getRange(n).getCoords(), !0];
3405
+ e[t] = [n.getRange(r).getCoords(), !0];
3029
3406
  } catch (e) {
3030
- console.warn(`Failed to parse volatile: ${n}`, e);
3407
+ console.warn(`Failed to parse volatile: ${r}`, e);
3031
3408
  continue;
3032
3409
  }
3033
3410
  }
3034
- N.push(e);
3035
- } else N.push([]);
3036
- let L = o.formulaArray, R = L ? L.length : 0;
3037
- if (R > 0) {
3038
- let e = Array(R);
3039
- for (let t = 0; t < R; t++) {
3040
- let n = L[t];
3411
+ A.push(e);
3412
+ } else A.push([]);
3413
+ let pe = i.formulaArray, me = pe ? pe.length : 0;
3414
+ if (me > 0) {
3415
+ let e = Array(me);
3416
+ for (let t = 0; t < me; t++) {
3417
+ let r = pe[t];
3041
3418
  try {
3042
- let r = n[0];
3043
- e[t] = [i.getRange(r).getCoords(), {
3044
- ref: r,
3045
- kind: n[1] ?? "dynamic"
3419
+ let i = r[0];
3420
+ e[t] = [n.getRange(i).getCoords(), {
3421
+ ref: i,
3422
+ kind: r[1] ?? "dynamic"
3046
3423
  }];
3047
3424
  } catch (e) {
3048
- console.warn(`Failed to parse formula array: ${n}`, e);
3425
+ console.warn(`Failed to parse formula array: ${r}`, e);
3049
3426
  continue;
3050
3427
  }
3051
3428
  }
3052
- N.push(e);
3053
- } else N.push([]);
3054
- i.getEntireRange().forEach((e, i) => {
3055
- let a = i.getCoords(), o = a.rowIndex, s = a.colIndex;
3056
- O !== o && ae(o);
3057
- let d = i.getInjectedReference(0);
3058
- if (d === void 0 && D !== void 0 && o >= E && o <= ne && (d = D), d === void 0) {
3059
- for (; s <= te && s > ie;) k++, A = S?.[k] ?? null, re = A?.min ?? 2 ** 53 - 1, ie = A?.max ?? 2 ** 53 - 1, M = A?.value?.s;
3060
- M !== void 0 && s >= re && s <= ie && (d = M);
3429
+ A.push(e);
3430
+ } else A.push([]);
3431
+ n.getEntireRange().forEach((n, r) => {
3432
+ let i = r.getCoords(), a = i.rowIndex, s = i.colIndex;
3433
+ D !== a && oe(a);
3434
+ let p = r.getInjectedReference(0);
3435
+ if (p === void 0 && E !== void 0 && a >= w && a <= T && (p = E), p === void 0) {
3436
+ for (; s <= b && s > re;) ee++, O = v?.[ee] ?? null, te = O?.min ?? 2 ** 53 - 1, re = O?.max ?? 2 ** 53 - 1, ae = O?.value?.s;
3437
+ ae !== void 0 && s >= te && s <= re && (p = ae);
3061
3438
  }
3062
- let _ = i.getType(), v = null;
3063
- P > 0 && (v = i.getInjectedReference(1) ?? null);
3064
- let y = !1;
3065
- I > 0 && (y = i.getInjectedReference(2) ?? !1);
3066
- let b = null;
3067
- R > 0 && (b = i.getInjectedReference(3) ?? null);
3068
- let x = b?.kind === "error", ee = b?.kind === "fixed", C = yn;
3069
- C.r = i.getAddress(), C.s = void 0, C.t = void 0, C.cm = void 0, C.vm = void 0, c && (d = c.getHiddenXf(d ?? 0)), d !== void 0 && d !== 0 && (C.s = "" + d);
3070
- let w = null, T = null;
3071
- switch (_) {
3072
- case me.Boolean:
3073
- w = e ? "1" : "0", T = "b";
3439
+ let m = r.getType(), h = null;
3440
+ le > 0 && (h = r.getInjectedReference(1) ?? null);
3441
+ let g = !1;
3442
+ de > 0 && (g = r.getInjectedReference(2) ?? !1);
3443
+ let _ = null;
3444
+ me > 0 && (_ = r.getInjectedReference(3) ?? null);
3445
+ let y = _?.kind === "error", x = _?.kind === "fixed", S = tr;
3446
+ S.r = r.getAddress(), S.s = void 0, S.t = void 0, S.cm = void 0, S.vm = void 0, o && (p = o.getHiddenXf(p ?? 0)), p !== void 0 && p !== 0 && (S.s = "" + p);
3447
+ let C = null, k = null;
3448
+ switch (m) {
3449
+ case Le.Boolean:
3450
+ C = n ? "1" : "0", k = "b";
3074
3451
  break;
3075
- case me.Error:
3076
- let t = e.getCode();
3077
- if (T = "e", t > 7) w = se.BuiltIn.Value.getLabel(), C.vm = "" + m.add(e);
3078
- else if (t < 1) {
3079
- let t;
3080
- T = "s", v ? (t = "=" + v.formula, v = null) : t = "" + e.getLabel(), w = "" + f.add(t), h++;
3081
- } else w = "" + e.getLabel();
3452
+ case Le.Error:
3453
+ let e = n.getCode();
3454
+ if (k = "e", e > 7) C = ke.BuiltIn.Value.getLabel(), S.vm = "" + u.add(n);
3455
+ else if (e < 1) {
3456
+ let e;
3457
+ k = "s", h ? (e = "=" + h.formula, h = null) : e = "" + n.getLabel(), C = "" + c.add(e), d++;
3458
+ } else C = "" + n.getLabel();
3082
3459
  break;
3083
- case me.Number:
3084
- w = "" + e, T = null;
3460
+ case Le.Number:
3461
+ C = "" + n, k = null;
3085
3462
  break;
3086
- case me.String:
3087
- w = e, v ? (T = "str", w = e) : (T = "s", w = "" + f.add(w), h++);
3463
+ case Le.String:
3464
+ C = n, h ? (k = "str", C = n) : (k = "s", C = "" + c.add(C), d++);
3088
3465
  break;
3089
- case me.RichData: T = "e", w = se.BuiltIn.Value.getLabel(), C.vm = "" + m.add(e);
3466
+ case Le.RichData: k = "e", C = ke.BuiltIn.Value.getLabel(), S.vm = "" + u.add(n);
3090
3467
  }
3091
- T && (C.t = T);
3092
- let j = !v?.isWrapped && (b !== null || (v?.isDynamicRange ?? !1));
3093
- if (v !== null || w !== null) {
3094
- if (j && v !== null && !ee && (C.cm = "" + p.registerArrayCell(x)), r.start("c", C), v) {
3095
- let e = o === v.coords.rowStart && s === v.coords.colStart, t = v.formula;
3096
- v.memberImage && !e && (t = v.memberImage({
3097
- rowIndex: o,
3468
+ k && (S.t = k);
3469
+ let A = !h?.isWrapped && (_ !== null || (h?.isDynamicRange ?? !1));
3470
+ if (h !== null || C !== null) {
3471
+ if (A && h !== null && !x && (S.cm = "" + l.registerArrayCell(y)), t.start("c", S), h) {
3472
+ let e = a === h.coords.rowStart && s === h.coords.colStart, n = h.formula;
3473
+ h.memberImage && !e && (n = h.memberImage({
3474
+ rowIndex: a,
3098
3475
  colIndex: s
3099
3476
  }));
3100
- let n, i = null, a = v.sharedId;
3101
- if (a) {
3102
- n = Sn;
3103
- let e = v.coords;
3104
- e.colStart === s && e.rowStart === o ? (n.ref = v.ref, n.si = a, i = v.formula) : (n.ref = void 0, n.si = a);
3105
- } else j ? (n = Cn, n.aca = x ? "1" : void 0, n.ref = x ? C.r : b?.ref ?? C.r, i = t) : (n = xn, i = t);
3106
- n.ca = y || x || v.isExcelVolatile ? "1" : void 0, i ? (r.start("f", n), r.text(i), r.end("f")) : r.empty("f", n);
3477
+ let r, i = null, o = h.sharedId;
3478
+ if (o) {
3479
+ r = ir;
3480
+ let e = h.coords;
3481
+ e.colStart === s && e.rowStart === a ? (r.ref = h.ref, r.si = o, i = h.formula) : (r.ref = void 0, r.si = o);
3482
+ } else A ? (r = ar, r.aca = y ? "1" : void 0, r.ref = y ? S.r : _?.ref ?? S.r, i = n) : (r = rr, i = n);
3483
+ r.ca = g || y || h.isExcelVolatile ? "1" : void 0, i ? (t.start("f", r), t.text(i), t.end("f")) : t.empty("f", r);
3107
3484
  }
3108
- w !== null && (T === "str" && w ? (r.start("v", t.test(w) ? l : void 0), r.text(u(w))) : (r.start("v"), w && r.text(w)), r.end("v")), r.end("c");
3109
- } else g++ < Zt ? r.empty("c", C) : g === 1048577 && n.warn(`Reached ${Zt} style-only cells at '${C.r}'; not writing the rest.`);
3485
+ C !== null && (k === "str" && C ? (t.start("v", fe.test(C) ? ne : void 0), t.text(ie(C))) : (t.start("v"), C && t.text(C)), t.end("v")), t.end("c");
3486
+ } else f++ < Fn ? t.empty("c", S) : f === 1048577 && e.warn(`Reached ${Fn} style-only cells at '${S.r}'; not writing the rest.`);
3110
3487
  }, {
3111
- injectReferences: N,
3488
+ injectReferences: A,
3112
3489
  features: []
3113
- }), O !== -1 && O >= x ? r.end("row") : ae(x, !0), r.end("sheetData"), r.setValidationDisabled(!1);
3114
- } else r.empty("sheetData");
3115
- if (h > 0) {
3116
- let e = d.get("stringsCount") ?? 0;
3117
- d.set("stringsCount", e + h);
3490
+ }), D !== -1 && D >= _ ? t.end("row") : oe(_, !0), t.end("sheetData"), t.setValidationDisabled(!1);
3491
+ } else t.empty("sheetData");
3492
+ if (d > 0) {
3493
+ let e = s.get("stringsCount") ?? 0;
3494
+ s.set("stringsCount", e + d);
3118
3495
  }
3119
- }(i, o, d, f, await (async (e, t) => {
3496
+ }(t, n, i, o, await (async (e, t) => {
3120
3497
  let n = t ? t.length : 0;
3121
- if (n === 0) return Xt;
3498
+ if (n === 0) return Nn;
3122
3499
  let r = /* @__PURE__ */ new Set(), i = Array(n);
3123
3500
  for (let e = 0; e < n; e++) {
3124
3501
  i[e] = null;
3125
3502
  try {
3126
- let n = ce.parse(t[e][1]);
3503
+ let n = Ae.parse(t[e][1]);
3127
3504
  if (!n) continue;
3128
3505
  let a = null, o = (e) => {
3129
3506
  let t = null;
@@ -3135,9 +3512,9 @@ var ar = (e, t, n, r) => {
3135
3512
  } catch {}
3136
3513
  }
3137
3514
  let a = e.getWorkbook();
3138
- if (!a) return Xt;
3139
- let o = await s(a, r);
3140
- return o.size === 0 ? Xt : {
3515
+ if (!a) return Nn;
3516
+ let o = await me(a, r);
3517
+ return o.size === 0 ? Nn : {
3141
3518
  names: o,
3142
3519
  perFormula: i,
3143
3520
  affects: (e) => {
@@ -3147,24 +3524,24 @@ var ar = (e, t, n, r) => {
3147
3524
  return !1;
3148
3525
  }
3149
3526
  };
3150
- })(d, f.formulas), p), function(e, t, n, r) {
3527
+ })(i, o.formulas), s), function(e, t, n, r) {
3151
3528
  let i = r.protection;
3152
3529
  if (!i) return;
3153
3530
  let a = {};
3154
- i.sheet || Ue(i.password ?? {}, a);
3155
- for (let e of A) {
3156
- let t = re(e, i[e.key]);
3531
+ i.sheet || pt(i.password ?? {}, a);
3532
+ for (let e of le) {
3533
+ let t = be(e, i[e.key]);
3157
3534
  t !== null && (a[e.attribute] = t);
3158
3535
  }
3159
3536
  t.empty("sheetProtection", a);
3160
- }(0, o, 0, f), function(e, t, n, r) {
3537
+ }(0, n, 0, o), function(e, t, n, r) {
3161
3538
  let i = r.protectedRanges, a = i ? i.length : 0;
3162
3539
  if (a === 0) return;
3163
3540
  let o = [];
3164
3541
  for (let t = 0; t < a; t++) {
3165
3542
  let n = i[t], r, a;
3166
3543
  Array.isArray(n) ? (r = n[0], a = n[1]) : (r = n.r, a = n.v);
3167
- let s = on(r);
3544
+ let s = Un(r);
3168
3545
  if (!s || !a) {
3169
3546
  e.log("Skipping protectedRange with no range.");
3170
3547
  continue;
@@ -3174,18 +3551,18 @@ var ar = (e, t, n, r) => {
3174
3551
  continue;
3175
3552
  }
3176
3553
  let c = {};
3177
- Ue(a.password ?? {}, c), c.sqref = s, c.name = a.name, a.securityDescriptor && (c.securityDescriptor = a.securityDescriptor), o.push(c);
3554
+ pt(a.password ?? {}, c), c.sqref = s, c.name = a.name, a.securityDescriptor && (c.securityDescriptor = a.securityDescriptor), o.push(c);
3178
3555
  }
3179
3556
  if (o.length !== 0) {
3180
3557
  t.start("protectedRanges");
3181
3558
  for (let e = 0; e < o.length; e++) t.empty("protectedRange", o[e]);
3182
3559
  t.end("protectedRanges");
3183
3560
  }
3184
- }(i, o, 0, f);
3185
- let m = f.autoTable;
3186
- if (m) {
3187
- let e, t = m;
3188
- e = Array.isArray(t) ? t[1] : t.v, Kt(i, o, d.getAutoTable(), e, !0);
3561
+ }(t, n, 0, o);
3562
+ let c = o.autoTable;
3563
+ if (c) {
3564
+ let e, r = c;
3565
+ e = Array.isArray(r) ? r[1] : r.v, kn(t, n, i.getAutoTable(), e, !0);
3189
3566
  }
3190
3567
  (function(e, t, n, r) {
3191
3568
  let i = r.merges ? r.merges.length : 0;
@@ -3197,91 +3574,91 @@ var ar = (e, t, n, r) => {
3197
3574
  }
3198
3575
  t.end("mergeCells");
3199
3576
  }
3200
- })(0, o, 0, f);
3201
- let h = function(e, t, n, i) {
3202
- let a = [], o = i.conditionals, s = o ? o.length : 0;
3203
- if (s === 0) return a;
3204
- let c = e.getSharedStates(), l = c.get(Nt);
3205
- l || (l = new Mt(), c.set(Nt, l));
3206
- let u = n.getStyles().getTheme(), d = c.get(r), f = null, p = 0;
3207
- for (let n = 0; n < s; n++) {
3208
- let r = o[n], i, s;
3209
- Array.isArray(r) ? (i = r[0], s = r[1]) : (i = r.r, s = r.v);
3210
- let c = on(i);
3211
- if (!c || !s) {
3577
+ })(0, n, 0, o);
3578
+ let u = function(e, t, n, r) {
3579
+ let i = [], a = r.conditionals, o = a ? a.length : 0;
3580
+ if (o === 0) return i;
3581
+ let s = e.getSharedStates(), c = s.get(hn);
3582
+ c || (c = new mn(), s.set(hn, c));
3583
+ let l = n.getStyles().getTheme(), u = s.get(y), d = null, f = 0;
3584
+ for (let n = 0; n < o; n++) {
3585
+ let r = a[n], o, s;
3586
+ Array.isArray(r) ? (o = r[0], s = r[1]) : (o = r.r, s = r.v);
3587
+ let p = Un(o);
3588
+ if (!p || !s) {
3212
3589
  e.log("Skipping conditionalFormatting with no range.");
3213
3590
  continue;
3214
3591
  }
3215
- let m = ln(c), h = dn(s.scale, m, d);
3592
+ let m = Kn(p), h = Jn(s.scale, m, u);
3216
3593
  h !== s.scale && (s = {
3217
3594
  ...s,
3218
3595
  scale: h
3219
3596
  });
3220
- let g = h ? { type: h.type } : b(s.condition, an(c), (t, n) => e.warn(t, void 0, n));
3221
- g ? (g.formulas &&= g.formulas.map((e) => un(e, m, d)), h?.type === I.ScaleType.IconSet && nn(h) ? (p++, a.push({
3222
- guid: O(N.uuidV4),
3223
- sqref: c,
3224
- priority: p,
3597
+ let g = h ? { type: h.type } : ge(s.condition, Hn(p), (t, n) => e.warn(t, void 0, n));
3598
+ g ? (g.formulas &&= g.formulas.map((e) => qn(e, m, u)), h?.type === I.ScaleType.IconSet && Bn(h) ? (f++, i.push({
3599
+ guid: E(N.uuidV4),
3600
+ sqref: p,
3601
+ priority: f,
3225
3602
  scale: h
3226
- })) : h || !cn(g) ? (c !== f && (f !== null && t.end("conditionalFormatting"), t.start("conditionalFormatting", {
3227
- sqref: c,
3603
+ })) : h || !Gn(g) ? (p !== d && (d !== null && t.end("conditionalFormatting"), t.start("conditionalFormatting", {
3604
+ sqref: p,
3228
3605
  pivot: s.pivot ? "1" : void 0
3229
- }), f = c), p++, rn(e, t, u, s, g, c, p, l, a)) : (p++, a.push({
3230
- guid: O(N.uuidV4),
3231
- sqref: c,
3232
- priority: p,
3606
+ }), d = p), f++, Vn(e, t, l, s, g, p, f, c, i)) : (f++, i.push({
3607
+ guid: E(N.uuidV4),
3608
+ sqref: p,
3609
+ priority: f,
3233
3610
  rule: g,
3234
3611
  style: s.style,
3235
3612
  stopIfTrue: s.stopIfTrue
3236
3613
  }))) : s.condition || e.log("Skipping conditional format with neither a condition nor a scale.");
3237
3614
  }
3238
- return f !== null && t.end("conditionalFormatting"), a;
3239
- }(i, o, d, f), g = function(e, t, n, i) {
3240
- let a = [], o = e.getSharedStates().get(r), s = i.validations, c = s ? s.length : 0;
3241
- if (c === 0) return a;
3615
+ return d !== null && t.end("conditionalFormatting"), i;
3616
+ }(t, n, i, o), d = function(e, t, n, r) {
3617
+ let i = [], o = e.getSharedStates().get(y), s = r.validations, c = s ? s.length : 0;
3618
+ if (c === 0) return i;
3242
3619
  let l = [];
3243
3620
  for (let t = 0; t < c; t++) {
3244
- let n = s[t], r, i;
3245
- Array.isArray(n) ? (r = n[0], i = n[1]) : (r = n.r, i = n.v);
3246
- let c = on(r);
3247
- if (!c || !i) {
3621
+ let n = s[t], r, c;
3622
+ Array.isArray(n) ? (r = n[0], c = n[1]) : (r = n.r, c = n.v);
3623
+ let u = Un(r);
3624
+ if (!u || !c) {
3248
3625
  e.log("Skipping dataValidation with no range.");
3249
3626
  continue;
3250
3627
  }
3251
- i.ext && e.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
3252
- let u = (t, n) => e.warn(t, void 0, n), d = v(i.condition, u), { type: f, operator: p } = d ?? {}, m = ln(c), h = un(d?.formula1, m, o), g = un(d?.formula2, m, o), _ = {
3253
- type: f,
3254
- operator: p,
3255
- allowBlank: Z(i.condition?.includeBlanks ?? !1),
3256
- showDropDown: i.hideDropdown ? "1" : void 0,
3257
- showInputMessage: Z(i.showPromptMessage),
3258
- showErrorMessage: Z(i.showAlertMessage),
3259
- errorStyle: i.alertStyle ?? "stop",
3260
- errorTitle: C(i.alertTitle, "errorTitle", u),
3261
- error: C(i.alert, "error", u),
3262
- promptTitle: C(i.promptTitle, "promptTitle", u),
3263
- prompt: C(i.prompt, "prompt", u),
3264
- imeMode: i.imeMode
3628
+ c.ext && e.warn("DataValidation extension payload is not written to xlsx; it will be lost.");
3629
+ let d = (t, n) => e.warn(t, void 0, n), f = a(c.condition, d), { type: p, operator: m } = f ?? {}, h = Kn(u), g = qn(f?.formula1, h, o), _ = qn(f?.formula2, h, o), v = {
3630
+ type: p,
3631
+ operator: m,
3632
+ allowBlank: X(c.condition?.includeBlanks ?? !1),
3633
+ showDropDown: c.hideDropdown ? "1" : void 0,
3634
+ showInputMessage: X(c.showPromptMessage),
3635
+ showErrorMessage: X(c.showAlertMessage),
3636
+ errorStyle: c.alertStyle ?? "stop",
3637
+ errorTitle: b(c.alertTitle, "errorTitle", d),
3638
+ error: b(c.alert, "error", d),
3639
+ promptTitle: b(c.promptTitle, "promptTitle", d),
3640
+ prompt: b(c.prompt, "prompt", d),
3641
+ imeMode: c.imeMode
3265
3642
  };
3266
- sn(h) || sn(g) ? a.push({
3267
- attrs: _,
3268
- formula1: h,
3269
- formula2: g,
3270
- sqref: c
3271
- }) : (_.sqref = c, l.push({
3272
- attrs: _,
3273
- formula1: h,
3274
- formula2: g
3643
+ Wn(g) || Wn(_) ? i.push({
3644
+ attrs: v,
3645
+ formula1: g,
3646
+ formula2: _,
3647
+ sqref: u
3648
+ }) : (v.sqref = u, l.push({
3649
+ attrs: v,
3650
+ formula1: g,
3651
+ formula2: _
3275
3652
  }));
3276
3653
  }
3277
- if (l.length === 0) return a;
3654
+ if (l.length === 0) return i;
3278
3655
  t.start("dataValidations", { count: l.length });
3279
3656
  for (let e = 0; e < l.length; e++) {
3280
3657
  let { attrs: n, formula1: r, formula2: i } = l[e];
3281
3658
  r !== void 0 || i !== void 0 ? (t.start("dataValidation", n), r !== void 0 && (t.start("formula1"), t.text(r), t.end("formula1")), i !== void 0 && (t.start("formula2"), t.text(i), t.end("formula2")), t.end("dataValidation")) : t.empty("dataValidation", n);
3282
3659
  }
3283
- return t.end("dataValidations"), a;
3284
- }(i, o, 0, f);
3660
+ return t.end("dataValidations"), i;
3661
+ }(t, n, 0, o);
3285
3662
  (function(e, t, n, r) {
3286
3663
  let i = r.hyperlinks, a = i ? i.length : 0;
3287
3664
  if (a !== 0) {
@@ -3294,7 +3671,7 @@ var ar = (e, t, n, r) => {
3294
3671
  }
3295
3672
  t.end("hyperlinks");
3296
3673
  }
3297
- })(i, o, 0, f), function(e, t, n, r) {
3674
+ })(t, n, 0, o), function(e, t, n, r) {
3298
3675
  let i = r.pageMargins;
3299
3676
  t.empty("pageMargins", {
3300
3677
  left: i?.left ?? .7,
@@ -3304,31 +3681,26 @@ var ar = (e, t, n, r) => {
3304
3681
  header: i?.header ?? .3,
3305
3682
  footer: i?.footer ?? .3
3306
3683
  });
3307
- }(0, o, 0, f), function(e, t, n, r) {
3308
- let i = r.movables?.filter(hn);
3684
+ }(0, n, 0, o), function(e, t, n, r) {
3685
+ let i = r.movables;
3309
3686
  if ((i ? i.length : 0) === 0 || !i.some((e) => {
3310
3687
  let t = e.content?.type;
3311
- if (t === "picture" || t === "chart") return !0;
3312
- if (t === "shape") {
3313
- let t = e.content?.json?.type;
3314
- return t === "sp" || t === "cxnSp";
3315
- }
3316
- return !1;
3688
+ return t === "picture" || t === "chart" || t === "shape" || oe(t);
3317
3689
  })) return;
3318
- let a = n.getMovables().getItems().filter((e) => e.getContent().getType() !== "note").filter((e, t) => hn(r.movables[t])), o = e.addPart("drawing", {
3690
+ let a = n.getMovables().getItems().filter((e) => e.getContent().getType() !== "note"), o = e.addPart("drawing", {
3319
3691
  sheet: n,
3320
3692
  movables: a,
3321
3693
  jsonMovables: i,
3322
3694
  resources: n.getResources()
3323
3695
  });
3324
3696
  t.empty("drawing", { "r:id": o.relId });
3325
- }(i, o, d, f);
3326
- let _ = function(e) {
3697
+ }(t, n, i, o);
3698
+ let f = function(e) {
3327
3699
  let t = e.getComments().toArray();
3328
3700
  if (t.length === 0) return null;
3329
3701
  let n = [];
3330
3702
  for (let e = 0; e < t.length; e++) {
3331
- let r = t[e], i = xt(r);
3703
+ let r = t[e], i = Gt(r);
3332
3704
  i && n.push({
3333
3705
  comment: r,
3334
3706
  ...i
@@ -3338,52 +3710,56 @@ var ar = (e, t, n, r) => {
3338
3710
  sheet: e,
3339
3711
  comments: n
3340
3712
  });
3341
- }(d);
3342
- fn(i, o, "legacyDrawing", mn(_n(f.legacyDrawing ?? null, f), _)), fn(i, o, "legacyDrawingHF", f.legacyDrawingHF ?? null), await async function(e, t, n) {
3713
+ }(i);
3714
+ Yn(t, n, "legacyDrawing", Zn($n(o.legacyDrawing ?? null, o), f)), Yn(t, n, "legacyDrawingHF", o.legacyDrawingHF ?? null), await async function(e, t, n) {
3343
3715
  let r = n.getPicture();
3344
3716
  if (!r) return;
3345
3717
  let i = r.getResource(), a = await i.getExternalURI(), o;
3346
- if (a) o = e.addExternal(Ot, a);
3718
+ if (a) o = e.addExternal(tn, a);
3347
3719
  else {
3348
- let t = e.getSharedStates(), n = t.get(kt);
3349
- n || (n = /* @__PURE__ */ new Map(), t.set(kt, n));
3720
+ let t = e.getSharedStates(), n = t.get(nn);
3721
+ n || (n = /* @__PURE__ */ new Map(), t.set(nn, n));
3350
3722
  let r = n.get(i);
3351
3723
  if (!r) {
3352
3724
  let e = await i.toBuffer();
3353
3725
  r = {
3354
3726
  bytes: new Uint8Array(e),
3355
- type: await i.getType() ?? At,
3727
+ type: await i.getType() ?? fn,
3356
3728
  index: n.size + 1
3357
3729
  }, n.set(i, r);
3358
3730
  }
3359
- o = e.addBinary(r.bytes, r.type.mime, Ot, `../media/image${r.index}.${r.type.ext}`, !0);
3731
+ o = e.addBinary(r.bytes, r.type.mime, tn, `../media/image${r.index}.${r.type.ext}`, !0);
3360
3732
  }
3361
3733
  t.empty("picture", { "r:id": o.relId });
3362
- }(i, o, d), await async function(e, t, n) {
3734
+ }(t, n, i), await async function(e, t, n) {
3363
3735
  let r = n.movables;
3364
- if (!r || r.every(hn)) return;
3736
+ if (!r || r.every(Qn)) return;
3365
3737
  let i = [], a = r.length;
3366
3738
  for (let t = 0; t < a; t++) {
3367
3739
  let n = r[t];
3368
- if (hn(n)) continue;
3369
- let a = n.content?.json ?? {}, o = a.part, s;
3370
- if (o) try {
3371
- s = (await Ze(o.type ? o : {
3372
- ...o,
3373
- type: gn
3374
- }, e, "../ctrlProps/ctrlProp{n}.xml"))?.relId ?? void 0;
3740
+ if (Qn(n)) continue;
3741
+ let a = n.content?.json ?? {}, o;
3742
+ try {
3743
+ let t = {
3744
+ id: "",
3745
+ type: Ce,
3746
+ name: "ctrlProp.xml",
3747
+ contentType: de,
3748
+ xml: O(n.content.type, a)
3749
+ };
3750
+ o = e.addPart("embeddedPart", t, "../ctrlProps/ctrlProp{n}.xml").relId ?? void 0;
3375
3751
  } catch (t) {
3376
3752
  e.log(`Unable to write the properties of the control '${n.content?.name}'`, t);
3377
3753
  }
3378
- s ? i.push({
3754
+ o && i.push({
3379
3755
  jsonMovable: n,
3380
3756
  jsonControl: a,
3381
- relId: s
3382
- }) : e.log(`The control '${n.content?.name}' has no properties to write and was dropped.`);
3757
+ relId: o
3758
+ });
3383
3759
  }
3384
3760
  if (i.length === 0) return;
3385
3761
  t.start("mc:AlternateContent", {
3386
- "xmlns:x14": D,
3762
+ "xmlns:x14": ve,
3387
3763
  "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"
3388
3764
  }), t.start("mc:Choice", { Requires: "x14" }), t.start("controls");
3389
3765
  let o = i.length;
@@ -3395,13 +3771,13 @@ var ar = (e, t, n, r) => {
3395
3771
  name: n.content?.name ?? void 0
3396
3772
  });
3397
3773
  let o = n.anchorType ?? "twoCell";
3398
- t.start("controlPr", r.props), t.start("anchor", {
3774
+ t.start("controlPr", pe(r)), t.start("anchor", {
3399
3775
  moveWithCells: o === "absolute" ? void 0 : "1",
3400
3776
  sizeWithCells: o === "twoCell" ? "1" : void 0
3401
- }), vn(t, "from", n.anchor.tl), vn(t, "to", n.anchor.br), t.end("anchor"), r.xml && t.raw(r.xml), t.end("controlPr"), t.end("control"), t.end("mc:Choice"), t.end("mc:AlternateContent");
3777
+ }), er(t, "from", n.anchor.tl), er(t, "to", n.anchor.br), t.end("anchor"), r.xml && t.raw(r.xml), t.end("controlPr"), t.end("control"), t.end("mc:Choice"), t.end("mc:AlternateContent");
3402
3778
  }
3403
3779
  t.end("controls"), t.end("mc:Choice"), t.end("mc:AlternateContent");
3404
- }(i, o, f), function(e, t, n, r) {
3780
+ }(t, n, o), function(e, t, n, r) {
3405
3781
  let i = r.tables, a = i ? i.length : 0;
3406
3782
  if (a === 0) return;
3407
3783
  let o = n.getTables().getItems();
@@ -3417,84 +3793,84 @@ var ar = (e, t, n, r) => {
3417
3793
  l["r:id"] = c.relId, t.empty("tablePart", l);
3418
3794
  }
3419
3795
  t.end("tableParts");
3420
- }(i, o, d, f), function(e, t, n, r, i) {
3796
+ }(t, n, i, o), function(e, t, n, r, i) {
3421
3797
  if (r.length === 0 && i.length === 0) return;
3422
3798
  let a = n.getStyles(), o = a.getTheme();
3423
3799
  if (t.start("extLst"), r.length > 0) {
3424
3800
  t.start("ext", {
3425
- uri: c,
3426
- "xmlns:x14": D
3801
+ uri: C,
3802
+ "xmlns:x14": ve
3427
3803
  }), t.start("x14:conditionalFormattings");
3428
- for (let e = 0; e < r.length; e++) {
3429
- let { guid: n, sqref: i, priority: s, scale: c, rule: l, style: u, stopIfTrue: d } = r[e];
3430
- if (t.start("x14:conditionalFormatting", { "xmlns:xm": S }), c) if (c.type === I.ScaleType.DataBar) {
3804
+ for (let n = 0; n < r.length; n++) {
3805
+ let { guid: i, sqref: s, priority: c, scale: u, rule: d, style: f, stopIfTrue: p } = r[n];
3806
+ if (t.start("x14:conditionalFormatting", { "xmlns:xm": l }), u) if (u.type === I.ScaleType.DataBar) {
3431
3807
  t.start("x14:cfRule", {
3432
3808
  type: "dataBar",
3433
- id: n
3809
+ id: i
3434
3810
  }), t.start("x14:dataBar", {
3435
- minLength: c.minLength,
3436
- maxLength: c.maxLength,
3437
- gradient: c.gradient ? void 0 : "0",
3438
- border: c.borderColor ? "1" : void 0,
3439
- direction: c.direction,
3440
- negativeBarColorSameAsPositive: c.negativeFillColor ? "0" : "1",
3441
- negativeBarBorderColorSameAsPositive: c.negativeBorderColor ? "0" : void 0,
3442
- axisPosition: c.axisPosition
3811
+ minLength: u.minLength,
3812
+ maxLength: u.maxLength,
3813
+ gradient: u.gradient ? void 0 : "0",
3814
+ border: u.borderColor ? "1" : void 0,
3815
+ direction: u.direction,
3816
+ negativeBarColorSameAsPositive: u.negativeFillColor ? "0" : "1",
3817
+ negativeBarBorderColorSameAsPositive: u.negativeBorderColor ? "0" : void 0,
3818
+ axisPosition: u.axisPosition
3443
3819
  });
3444
- let e = c.stops ?? [];
3445
- if (e.length === 0) en(t, { type: I.ColorStopType.AutoMin }), en(t, { type: I.ColorStopType.AutoMax });
3446
- else for (let n = 0; n < e.length; n++) en(t, e[n]);
3447
- c.borderColor && G(t, o, c.borderColor, "x14:borderColor"), c.negativeFillColor && G(t, o, c.negativeFillColor, "x14:negativeFillColor"), c.negativeBorderColor && G(t, o, c.negativeBorderColor, "x14:negativeBorderColor"), c.axisColor && G(t, o, c.axisColor, "x14:axisColor"), t.end("x14:dataBar"), t.end("x14:cfRule");
3820
+ let e = u.stops ?? [];
3821
+ if (e.length === 0) Rn(t, { type: I.ColorStopType.AutoMin }), Rn(t, { type: I.ColorStopType.AutoMax });
3822
+ else for (let n = 0; n < e.length; n++) Rn(t, e[n]);
3823
+ u.borderColor && K(t, o, u.borderColor, "x14:borderColor"), u.negativeFillColor && K(t, o, u.negativeFillColor, "x14:negativeFillColor"), u.negativeBorderColor && K(t, o, u.negativeBorderColor, "x14:negativeBorderColor"), u.axisColor && K(t, o, u.axisColor, "x14:axisColor"), t.end("x14:dataBar"), t.end("x14:cfRule");
3448
3824
  } else {
3449
3825
  t.start("x14:cfRule", {
3450
3826
  type: "iconSet",
3451
- priority: s,
3452
- id: n
3827
+ priority: c,
3828
+ id: i
3453
3829
  }), t.start("x14:iconSet", {
3454
- iconSet: c.iconSet,
3455
- reverse: Z(c.reverse),
3456
- showValue: Z(c.showValue),
3457
- custom: (c.icon?.length ?? 0) > 0 ? "1" : void 0
3830
+ iconSet: u.iconSet,
3831
+ reverse: X(u.reverse),
3832
+ showValue: X(u.showValue),
3833
+ custom: (u.icon?.length ?? 0) > 0 ? "1" : void 0
3458
3834
  });
3459
- let e = c.stops ?? [];
3460
- for (let n = 0; n < e.length; n++) en(t, e[n]);
3461
- let r = c.icon ?? [];
3462
- for (let e = 0; e < r.length; e++) t.empty("x14:cfIcon", {
3463
- iconSet: r[e].set,
3464
- iconId: r[e].id
3835
+ let e = u.stops ?? [];
3836
+ for (let n = 0; n < e.length; n++) Rn(t, e[n]);
3837
+ let n = u.icon ?? [];
3838
+ for (let e = 0; e < n.length; e++) t.empty("x14:cfIcon", {
3839
+ iconSet: n[e].set,
3840
+ iconId: n[e].id
3465
3841
  });
3466
3842
  t.end("x14:iconSet"), t.end("x14:cfRule");
3467
3843
  }
3468
3844
  else {
3469
3845
  t.start("x14:cfRule", {
3470
- type: l.type,
3471
- priority: s,
3472
- stopIfTrue: Z(d),
3473
- aboveAverage: Z(l.aboveAverage),
3474
- equalAverage: Z(l.equalAverage),
3475
- stdDev: l.stdDev,
3476
- bottom: Z(l.bottom),
3477
- percent: Z(l.percent),
3478
- rank: l.rank,
3479
- operator: l.operator,
3480
- text: l.text,
3481
- timePeriod: l.timePeriod,
3482
- id: n
3846
+ type: d.type,
3847
+ priority: c,
3848
+ stopIfTrue: X(p),
3849
+ aboveAverage: X(d.aboveAverage),
3850
+ equalAverage: X(d.equalAverage),
3851
+ stdDev: d.stdDev,
3852
+ bottom: X(d.bottom),
3853
+ percent: X(d.percent),
3854
+ rank: d.rank,
3855
+ operator: d.operator,
3856
+ text: d.text,
3857
+ timePeriod: d.timePeriod,
3858
+ id: i
3483
3859
  });
3484
- let e = l.formulas ?? [];
3485
- for (let n = 0; n < e.length; n++) t.start("xm:f"), t.text(e[n]), t.end("xm:f");
3486
- u && Object.keys(u).length > 0 && Vt(0, t, u, a, o, "x14:dxf"), t.end("x14:cfRule");
3860
+ let n = d.formulas ?? [];
3861
+ for (let e = 0; e < n.length; e++) t.start("xm:f"), t.text(n[e]), t.end("xm:f");
3862
+ f && Object.keys(f).length > 0 && wn(e, t, f, a, o, "x14:dxf"), t.end("x14:cfRule");
3487
3863
  }
3488
- t.start("xm:sqref"), t.text(i), t.end("xm:sqref"), t.end("x14:conditionalFormatting");
3864
+ t.start("xm:sqref"), t.text(s), t.end("xm:sqref"), t.end("x14:conditionalFormatting");
3489
3865
  }
3490
3866
  t.end("x14:conditionalFormattings"), t.end("ext");
3491
3867
  }
3492
3868
  if (i.length > 0) {
3493
3869
  t.start("ext", {
3494
- uri: y,
3495
- "xmlns:x14": D
3870
+ uri: x,
3871
+ "xmlns:x14": ve
3496
3872
  }), t.start("x14:dataValidations", {
3497
- "xmlns:xm": S,
3873
+ "xmlns:xm": l,
3498
3874
  count: i.length
3499
3875
  });
3500
3876
  for (let e = 0; e < i.length; e++) {
@@ -3504,18 +3880,18 @@ var ar = (e, t, n, r) => {
3504
3880
  t.end("x14:dataValidations"), t.end("ext");
3505
3881
  }
3506
3882
  t.end("extLst");
3507
- }(0, o, d, h, g), function(e, t) {
3883
+ }(t, n, i, u, d), function(e, t) {
3508
3884
  let n = t.pivotTables, r = n ? n.length : 0;
3509
3885
  for (let t = 0; t < r; t++) {
3510
3886
  let r = n[t], i = r.part;
3511
- i?.xml && (et(e, r.cacheId) ? e.addPart("pivotTable", r) : e.log(`The pivot table '${i.name ?? ""}' has no cache with id ${r.cacheId} and was dropped.`));
3887
+ i?.xml && (wt(e, r.cacheId) ? e.addPart("pivotTable", r) : e.log(`The pivot table '${i.name ?? ""}' has no cache with id ${r.cacheId} and was dropped.`));
3512
3888
  }
3513
- }(i, f), function(e, t) {
3889
+ }(t, o), function(e, t) {
3514
3890
  t && (e.addPart("comments", t), t.comments.some((e) => !e.comment.isNote()) && e.addPart("threadedComments", t));
3515
- }(i, _), o.end("worksheet"), o.close();
3891
+ }(t, f), n.end("worksheet"), n.close();
3516
3892
  }
3517
3893
  }(),
3518
- new class extends V {
3894
+ new class extends H {
3519
3895
  constructor() {
3520
3896
  super({
3521
3897
  kind: "sharedStrings",
@@ -3524,23 +3900,23 @@ var ar = (e, t, n, r) => {
3524
3900
  path: "/xl/sharedStrings.xml"
3525
3901
  });
3526
3902
  }
3527
- async emit(e, n) {
3528
- let r = n.getXMLWriter(), i = e.json, a = i ? i.length : 0, o = n.getSharedStates().get("stringsCount") ?? 0;
3529
- r.decl(), r.start("sst", {
3903
+ async emit(e, t) {
3904
+ let n = t.getXMLWriter(), r = e.json, i = r ? r.length : 0, a = t.getSharedStates().get("stringsCount") ?? 0;
3905
+ n.decl(), n.start("sst", {
3530
3906
  xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main",
3531
- count: o,
3532
- uniqueCount: a
3907
+ count: a,
3908
+ uniqueCount: i
3533
3909
  });
3534
- for (let e = 0; e < a; e++) {
3535
- let n = i[e];
3536
- r.start("si");
3537
- let a = t.test(n) ? l : void 0;
3538
- r.start("t", a), r.text(u(n)), r.end("t"), r.end("si");
3910
+ for (let e = 0; e < i; e++) {
3911
+ let t = r[e];
3912
+ n.start("si");
3913
+ let i = fe.test(t) ? ne : void 0;
3914
+ n.start("t", i), n.text(ie(t)), n.end("t"), n.end("si");
3539
3915
  }
3540
- r.end("sst"), r.close();
3916
+ n.end("sst"), n.close();
3541
3917
  }
3542
3918
  }(),
3543
- new class extends V {
3919
+ new class extends H {
3544
3920
  constructor() {
3545
3921
  super({
3546
3922
  kind: "theme",
@@ -3558,22 +3934,22 @@ var ar = (e, t, n, r) => {
3558
3934
  let i = n?.getColorScheme();
3559
3935
  if (i) {
3560
3936
  t.start(r, { name: i.getName() || "Office" });
3561
- for (let e of lt) t.start(e), U(t, n, i["get" + e.charAt(0).toUpperCase() + e.slice(1)]()), t.end(e);
3937
+ for (let e of Nt) t.start(e), W(t, n, i["get" + e.charAt(0).toUpperCase() + e.slice(1)]()), t.end(e);
3562
3938
  t.end(r);
3563
3939
  }
3564
3940
  }(0, n, r, "clrScheme"), function(e, t, n, r) {
3565
- n && (t.start(r, { name: n.getName() || "Office" }), wn(e, t, n.getMajorFont() || "Calibri Light", "majorFont"), wn(e, t, n.getMinorFont() || "Calibri", "minorFont"), t.end(r));
3941
+ n && (t.start(r, { name: n.getName() || "Office" }), or(e, t, n.getMajorFont() || "Calibri Light", "majorFont"), or(e, t, n.getMinorFont() || "Calibri", "minorFont"), t.end(r));
3566
3942
  }(t, n, r.getFontScheme(), "fontScheme"), function(e, t, n, r, i) {
3567
3943
  if (i?.fillStyleLst && i?.lnStyleLst && i?.effectStyleLst && i?.bgFillStyleLst) return void function(e, t, n, r, i) {
3568
3944
  let a = { getTheme: () => r };
3569
3945
  t.start(n, { name: "Office" }), t.start("fillStyleLst");
3570
- for (let e of i.fillStyleLst) K(0, t, e, a);
3946
+ for (let n of i.fillStyleLst) Jt(e, t, n, a);
3571
3947
  t.end("fillStyleLst"), t.start("lnStyleLst");
3572
- for (let e of i.lnStyleLst) St(0, t, e, a);
3948
+ for (let n of i.lnStyleLst) Yt(e, t, n, a);
3573
3949
  t.end("lnStyleLst"), t.start("effectStyleLst");
3574
- for (let n of i.effectStyleLst) t.start("effectStyle"), n.length > 0 ? Tt(e, t, r, n) : t.empty("effectLst"), t.end("effectStyle");
3950
+ for (let n of i.effectStyleLst) t.start("effectStyle"), n.length > 0 ? Qt(e, t, r, n) : t.empty("effectLst"), t.end("effectStyle");
3575
3951
  t.end("effectStyleLst"), t.start("bgFillStyleLst");
3576
- for (let e of i.bgFillStyleLst) K(0, t, e, a);
3952
+ for (let n of i.bgFillStyleLst) Jt(e, t, n, a);
3577
3953
  t.end("bgFillStyleLst"), t.end(n);
3578
3954
  }(e, t, n, r, i);
3579
3955
  if (i?.formatSchemeXml) return void t.raw(i.formatSchemeXml);
@@ -3624,7 +4000,7 @@ var ar = (e, t, n, r) => {
3624
4000
  }(t, n, "fmtScheme", r, i), n.end("themeElements"), n.start("objectDefaults"), n.end("objectDefaults"), n.start("extraClrSchemeLst"), n.end("extraClrSchemeLst"), n.end("theme"), n.close();
3625
4001
  }
3626
4002
  }(),
3627
- new class extends V {
4003
+ new class extends H {
3628
4004
  constructor() {
3629
4005
  super({
3630
4006
  kind: "styles",
@@ -3650,11 +4026,11 @@ var ar = (e, t, n, r) => {
3650
4026
  for (let t = 0; t < r; t++) {
3651
4027
  let r = t === 0 ? {
3652
4028
  ...n[t],
3653
- named: z.BuiltInName.Normal
4029
+ named: B.BuiltInName.Normal
3654
4030
  } : n[t], a = e.resolve(r), o = {};
3655
4031
  r.named !== void 0 && (o.named = r.named), r.quotePrefix !== void 0 && (o.quotePrefix = r.quotePrefix), r.protection !== void 0 && (o.protection = r.protection);
3656
- for (let e = 0; e < Pt.length; e++) {
3657
- let t = Pt[e];
4032
+ for (let e = 0; e < gn.length; e++) {
4033
+ let t = gn[e];
3658
4034
  if (r[t] === void 0 && t !== "alignment") continue;
3659
4035
  let n = a?.[t] ?? r[t];
3660
4036
  n !== void 0 && (o[t] = n);
@@ -3676,7 +4052,7 @@ var ar = (e, t, n, r) => {
3676
4052
  namedStyles: []
3677
4053
  };
3678
4054
  (function(e, t) {
3679
- let n = (e.getNamedStyles().getByName(z.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
4055
+ let n = (e.getNamedStyles().getByName(B.BuiltInName.Normal).toJSON().style ?? {}).font ?? {};
3680
4056
  t.fontMap.set(M.JSONStableStringify(n), "0"), t.fonts.push(n);
3681
4057
  })(e, r), function(e) {
3682
4058
  let t = { type: "none" };
@@ -3695,18 +4071,18 @@ var ar = (e, t, n, r) => {
3695
4071
  };
3696
4072
  e.borderMap.set(M.JSONStableStringify(t), "0"), e.borders.push(t);
3697
4073
  }(r), function(e, t) {
3698
- It(e, e.getNamedStyles().getByName(z.BuiltInName.Normal).toJSON(), t);
4074
+ vn(e, e.getNamedStyles().getByName(B.BuiltInName.Normal).toJSON(), t);
3699
4075
  }(e, r);
3700
4076
  let i = t?.named ?? N.EmptyArray;
3701
- for (let t of i) It(e, t, r);
3702
- for (let t of n) Ft(e, t, r);
4077
+ for (let t of i) vn(e, t, r);
4078
+ for (let t of n) _n(e, t, r);
3703
4079
  return r;
3704
- }(i, r, a), s = t.getSharedStates().get(Nt), c = function(e, t = 0) {
4080
+ }(i, r, a), s = t.getSharedStates().get(hn), c = function(e, t = 0) {
3705
4081
  let n = e?.tables;
3706
4082
  if (!n) return null;
3707
4083
  let r = n.styles;
3708
4084
  if (!r) return null;
3709
- let i = [], a = /* @__PURE__ */ new Map(), o = Object.keys(r), s = [...Ut].reverse();
4085
+ let i = [], a = /* @__PURE__ */ new Map(), o = Object.keys(r), s = [...En].reverse();
3710
4086
  for (let e of o) {
3711
4087
  let n = r[e];
3712
4088
  for (let r of s) {
@@ -3732,7 +4108,7 @@ var ar = (e, t, n, r) => {
3732
4108
  for (let e = 0; e < i; e++) {
3733
4109
  let n = r[e];
3734
4110
  t.empty("numFmt", {
3735
- numFmtId: String(e + Ht),
4111
+ numFmtId: String(e + Tn),
3736
4112
  formatCode: n
3737
4113
  });
3738
4114
  }
@@ -3744,31 +4120,31 @@ var ar = (e, t, n, r) => {
3744
4120
  count: String(a),
3745
4121
  "x14ac:knownFonts": "1"
3746
4122
  });
3747
- for (let r of i) Lt(e, t, r, n);
4123
+ for (let r of i) yn(e, t, r, n);
3748
4124
  t.end("fonts");
3749
4125
  }(t, n, i, o), function(e, t, n, r) {
3750
4126
  let i = r.fills, a = i.length;
3751
4127
  t.start("fills", { count: String(a) });
3752
- for (let e of i) K(0, t, e, n, !0);
4128
+ for (let r of i) Jt(e, t, r, n, !0);
3753
4129
  t.end("fills");
3754
- }(0, n, i, o), function(e, t, n, r) {
4130
+ }(t, n, i, o), function(e, t, n, r) {
3755
4131
  let i = r.borders, a = i.length;
3756
4132
  t.start("borders", { count: String(a) });
3757
4133
  let o = n.getTheme();
3758
- for (let n of i) Rt(e, t, n, o, !1);
4134
+ for (let n of i) xn(e, t, n, o, !1);
3759
4135
  t.end("borders");
3760
4136
  }(t, n, i, o), function(e, t, n, r, i) {
3761
4137
  let a = i.namedStyles, o = a.length;
3762
4138
  t.start("cellStyleXfs", { count: String(o) });
3763
- for (let r of a) Bt(e, t, n, r.style ?? N.EmptyObject, i, !1);
4139
+ for (let r of a) Cn(e, t, n, r.style ?? N.EmptyObject, i, !1);
3764
4140
  t.end("cellStyleXfs");
3765
4141
  }(t, n, i, 0, o), function(e, t, n, r, i, a) {
3766
4142
  let o = r.length, s = a?.getSources() ?? [];
3767
4143
  t.start("cellXfs", { count: String(o + s.length) });
3768
- for (let a = 0; a < o; a++) Bt(e, t, n, r[a], i, !0);
3769
- for (let a = 0; a < s.length; a++) Bt(e, t, n, r[s[a]], i, !0, !0);
4144
+ for (let a = 0; a < o; a++) Cn(e, t, n, r[a], i, !0);
4145
+ for (let a = 0; a < s.length; a++) Cn(e, t, n, r[s[a]], i, !0, !0);
3770
4146
  t.end("cellXfs");
3771
- }(t, n, i, a, o, t.getSharedStates().get(We)), function(e, t, n, r, i) {
4147
+ }(t, n, i, a, o, t.getSharedStates().get(mt)), function(e, t, n, r, i) {
3772
4148
  let a = i.namedStyles, o = a.length;
3773
4149
  t.start("cellStyles", { count: String(o) });
3774
4150
  let s = i.namedStyleMap;
@@ -3779,7 +4155,7 @@ var ar = (e, t, n, r) => {
3779
4155
  };
3780
4156
  r.hidden && (c.hidden = "1"), r.iLevel && (c.iLevel = String(r.iLevel));
3781
4157
  let l = null;
3782
- l = o === z.BuiltInName.Normal.toLowerCase() ? 0 : n.getNamedStyles().getByName(i).getBuiltInID(), l !== null && (c.builtinId = String(l), c.customBuiltin = "1"), t.empty("cellStyle", c);
4158
+ l = o === B.BuiltInName.Normal.toLowerCase() ? 0 : n.getNamedStyles().getByName(i).getBuiltInID(), l !== null && (c.builtinId = String(l), c.customBuiltin = "1"), t.empty("cellStyle", c);
3783
4159
  }
3784
4160
  t.end("cellStyles");
3785
4161
  }(0, n, i, 0, o), function(e, t, n, r, i) {
@@ -3787,8 +4163,8 @@ var ar = (e, t, n, r) => {
3787
4163
  if (a.length === 0) return void t.empty("dxfs", { count: "0" });
3788
4164
  let o = n.getTheme();
3789
4165
  t.start("dxfs", { count: String(a.length) });
3790
- let s = Ht;
3791
- for (let r of a) s = Vt(e, t, r, n, o, "dxf", s);
4166
+ let s = Tn;
4167
+ for (let r of a) s = wn(e, t, r, n, o, "dxf", s);
3792
4168
  t.end("dxfs");
3793
4169
  }(t, n, i, c, s), function(e, t, n, r, i) {
3794
4170
  let a = r?.tables, o = a?.styles ?? null, s = o ? Object.keys(o) : null, c = s ? s.length : 0, l = {
@@ -3800,7 +4176,7 @@ var ar = (e, t, n, r) => {
3800
4176
  t.start("tableStyles", l);
3801
4177
  for (let e of s) {
3802
4178
  let n = o[e], r = [];
3803
- for (let e of Ut) {
4179
+ for (let e of En) {
3804
4180
  let t = n[e];
3805
4181
  t && r.push([e, t]);
3806
4182
  }
@@ -3823,7 +4199,7 @@ var ar = (e, t, n, r) => {
3823
4199
  if (t.start("colors"), i) {
3824
4200
  t.start("indexedColors");
3825
4201
  for (let e of r.indexedColors) {
3826
- let n = ht(e, !0);
4202
+ let n = zt(e, !0);
3827
4203
  t.empty("rgbColor", { rgb: n });
3828
4204
  }
3829
4205
  t.end("indexedColors");
@@ -3831,7 +4207,7 @@ var ar = (e, t, n, r) => {
3831
4207
  if (a) {
3832
4208
  t.start("mruColors");
3833
4209
  for (let e of r.mruColors) {
3834
- let n = ht(e);
4210
+ let n = zt(e);
3835
4211
  t.empty("color", { rgb: n });
3836
4212
  }
3837
4213
  t.end("mruColors");
@@ -3849,7 +4225,7 @@ var ar = (e, t, n, r) => {
3849
4225
  }(0, n), n.end("styleSheet"), n.close();
3850
4226
  }
3851
4227
  }(),
3852
- new class extends V {
4228
+ new class extends H {
3853
4229
  constructor() {
3854
4230
  super({
3855
4231
  kind: "propsCore",
@@ -3870,14 +4246,14 @@ var ar = (e, t, n, r) => {
3870
4246
  let r = /* @__PURE__ */ new Date(), i = [
3871
4247
  ["creator", "SheetXL"],
3872
4248
  ["lastModifiedBy", "SheetXL"],
3873
- ["created", Tn(r)],
3874
- ["modified", Tn(r)]
4249
+ ["created", sr(r)],
4250
+ ["modified", sr(r)]
3875
4251
  ];
3876
- for (let e of i) En(n, e[0], e[1]);
4252
+ for (let e of i) cr(n, e[0], e[1]);
3877
4253
  n.end("cp:coreProperties"), n.close();
3878
4254
  }
3879
4255
  }(),
3880
- new class extends V {
4256
+ new class extends H {
3881
4257
  constructor() {
3882
4258
  super({
3883
4259
  kind: "propsApp",
@@ -3887,14 +4263,14 @@ var ar = (e, t, n, r) => {
3887
4263
  });
3888
4264
  }
3889
4265
  async emit(e, t) {
3890
- let n = t.getXMLWriter(), r = e.model, i = await fe.getDetails(), a = ne(i.getBuildVersion()), o = i.getLicensee() || "";
4266
+ let n = t.getXMLWriter(), r = e.model, i = await Fe.getDetails(), a = ye(i.getBuildVersion()), o = i.getLicensee() || "";
3891
4267
  n.setValidationDisabled(!0), n.decl(), n.start("Properties", {
3892
4268
  xmlns: "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",
3893
4269
  "xmlns:vt": "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"
3894
- }), Q(t, n, "Application", "SheetXL"), Q(t, n, "DocSecurity", "0"), Q(t, n, "ScaleCrop", "false"), Dn(t, n, r), Q(t, n, "Company", o), Q(t, n, "LinksUpToDate", "false"), Q(t, n, "SharedDoc", "false"), Q(t, n, "HyperlinksChanged", "false"), Q(t, n, "AppVersion", a), n.end("Properties"), n.close();
4270
+ }), Z(t, n, "Application", "SheetXL"), Z(t, n, "DocSecurity", "0"), Z(t, n, "ScaleCrop", "false"), lr(t, n, r), Z(t, n, "Company", o), Z(t, n, "LinksUpToDate", "false"), Z(t, n, "SharedDoc", "false"), Z(t, n, "HyperlinksChanged", "false"), Z(t, n, "AppVersion", a), n.end("Properties"), n.close();
3895
4271
  }
3896
4272
  }(),
3897
- new class extends V {
4273
+ new class extends H {
3898
4274
  constructor() {
3899
4275
  super({
3900
4276
  kind: "metadata",
@@ -3909,11 +4285,11 @@ var ar = (e, t, n, r) => {
3909
4285
  let d = { xmlns: "http://schemas.openxmlformats.org/spreadsheetml/2006/main" };
3910
4286
  if (r && (d["xmlns:xda"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"), i && (d["xmlns:xlrd"] = "http://schemas.microsoft.com/office/spreadsheetml/2017/richdata"), n.decl(), n.start("metadata", d), n.start("metadataTypes", { count: u }), r && n.empty("metadataType", {
3911
4287
  name: "XLDAPR",
3912
- ...On,
4288
+ ...ur,
3913
4289
  cellMeta: "1"
3914
4290
  }), i && n.empty("metadataType", {
3915
4291
  name: "XLRICHVALUE",
3916
- ...On
4292
+ ...ur
3917
4293
  }), n.end("metadataTypes"), r) {
3918
4294
  n.start("futureMetadata", {
3919
4295
  name: "XLDAPR",
@@ -3952,7 +4328,7 @@ var ar = (e, t, n, r) => {
3952
4328
  n.end("metadata"), n.close();
3953
4329
  }
3954
4330
  }(),
3955
- new class extends V {
4331
+ new class extends H {
3956
4332
  constructor() {
3957
4333
  super({
3958
4334
  kind: "richValue",
@@ -3977,7 +4353,7 @@ var ar = (e, t, n, r) => {
3977
4353
  n.end("rvData"), n.close();
3978
4354
  }
3979
4355
  }(),
3980
- new class extends V {
4356
+ new class extends H {
3981
4357
  constructor() {
3982
4358
  super({
3983
4359
  kind: "richValueStructure",
@@ -4003,7 +4379,7 @@ var ar = (e, t, n, r) => {
4003
4379
  n.end("rvStructures"), n.close();
4004
4380
  }
4005
4381
  }(),
4006
- new class extends V {
4382
+ new class extends H {
4007
4383
  constructor() {
4008
4384
  super({
4009
4385
  kind: "richValueTypes",
@@ -4044,13 +4420,14 @@ var ar = (e, t, n, r) => {
4044
4420
  n.end("keyFlags"), n.end("global"), n.end("rvTypesInfo"), n.close();
4045
4421
  }
4046
4422
  }(),
4047
- new class extends V {
4423
+ new class extends H {
4048
4424
  constructor() {
4049
4425
  super({
4050
4426
  kind: "drawing",
4051
4427
  contentType: "application/vnd.openxmlformats-officedocument.drawing+xml",
4052
4428
  relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
4053
- path: "../drawings/drawing{n}.xml"
4429
+ path: "../drawings/drawing{n}.xml",
4430
+ regeneratesRelationships: !0
4054
4431
  });
4055
4432
  }
4056
4433
  async emit(e, t) {
@@ -4059,53 +4436,72 @@ var ar = (e, t, n, r) => {
4059
4436
  "xmlns:xdr": "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing",
4060
4437
  "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main"
4061
4438
  });
4062
- let r = /* @__PURE__ */ new Map(), i = e.sheet, a = e.movables, o = e.jsonMovables, s = o ? o.length : 0, c = 0;
4063
- for (let e = 0; e < s; e++) {
4064
- let t = o[e].content?.json?.sourceId;
4065
- typeof t == "number" && t > c && (c = t);
4439
+ let r = e.sheet, i = e.movables, a = e.jsonMovables, o = a ? a.length : 0, s = 0;
4440
+ for (let e = 0; e < o; e++) {
4441
+ let t = a[e].content, n = oe(t?.type) ? t.json?.shapeId : t?.json?.sourceId;
4442
+ typeof n == "number" && n > s && (s = n);
4066
4443
  }
4067
- let l = /* @__PURE__ */ new Map(), u;
4068
- if (c > 0) {
4069
- let e = t.getSharedStates();
4070
- u = e.get("uniqueIdCounter"), u || (u = /* @__PURE__ */ new Map(), e.set("uniqueIdCounter", u)), u.set(i, Math.max(u.get(i) ?? 1, c));
4071
- let n = /* @__PURE__ */ new Set();
4072
- for (let e = 0; e < s; e++) {
4073
- let t = o[e].content?.json?.sourceId;
4074
- if (typeof t == "number") if (n.has(t)) {
4075
- let t = u.get(i) + 1;
4076
- u.set(i, t), l.set(o[e], t);
4077
- } else n.add(t);
4444
+ let c = /* @__PURE__ */ new Map(), l = t.getSharedStates(), u = l.get("uniqueIdCounter");
4445
+ if (u || (u = /* @__PURE__ */ new Map(), l.set("uniqueIdCounter", u)), s > 0) {
4446
+ u.set(r, Math.max(u.get(r) ?? 1, s));
4447
+ let e = /* @__PURE__ */ new Set();
4448
+ for (let t = 0; t < o; t++) {
4449
+ let n = a[t].content?.json?.sourceId;
4450
+ if (typeof n == "number") if (e.has(n)) {
4451
+ let e = u.get(r) + 1;
4452
+ u.set(r, e), c.set(a[t], e);
4453
+ } else e.add(n);
4078
4454
  }
4079
4455
  }
4080
- for (let e = 0; e < s; e++) {
4081
- let s = o[e], c = a[e], u = s.content?.type;
4082
- switch (n.start("twoCellAnchor", { editAs: s.anchorType || "twoCell" }), qn(n, "from", s.anchor.tl), qn(n, "to", s.anchor.br), u) {
4083
- case "picture":
4084
- await Fn(t, i, r, c, s);
4085
- break;
4086
- case "chart":
4087
- await In(t, i, r, c, s, l.get(s));
4088
- break;
4089
- case "shape":
4090
- await Bn(t, i, r, c, s, l.get(s));
4091
- break;
4092
- case "smartArt":
4093
- await Ln(t, i, r, c, s);
4094
- break;
4095
- case "slicer":
4096
- await Rn(t, i, r, c, s);
4097
- break;
4098
- case "graphicFrame":
4099
- await zn(t, i, r, c, s);
4100
- break;
4101
- default: await $(t, i, r, c, s);
4456
+ let d = Br(t, r), f = () => {
4457
+ let e = (u.get(r) ?? 1) + 1;
4458
+ return u.set(r, e), e;
4459
+ }, p = (e) => {
4460
+ for (let t of e ?? []) {
4461
+ let e = typeof t.sourceId != "number" || d.bySource.has(t.sourceId) ? f() : t.sourceId;
4462
+ d.assignedContent.set(t, e), typeof t.sourceId != "number" || d.bySource.has(t.sourceId) || d.bySource.set(t.sourceId, e), p(t.children);
4463
+ }
4464
+ };
4465
+ for (let e = 0; e < o; e++) {
4466
+ let t = a[e], n = t.content?.json?.sourceId, r = c.get(t) ?? (typeof n == "number" ? n : void 0);
4467
+ r === void 0 && (r = f()), d.assigned.set(t, r), typeof n != "number" || d.bySource.has(n) || d.bySource.set(n, r), t.content?.type === "shape" && p(t.content.json?.children);
4468
+ }
4469
+ for (let e = 0; e < o; e++) {
4470
+ let n = a[e];
4471
+ n.content?.type === "shape" && await sn(t, n.content.json);
4472
+ }
4473
+ for (let e = 0; e < o; e++) {
4474
+ let o = a[e], s = i[e], l = o.content?.type;
4475
+ if (oe(l)) qr(n, o);
4476
+ else {
4477
+ switch (n.start("twoCellAnchor", { editAs: o.anchorType || "twoCell" }), Kr(n, "from", o.anchor.tl), Kr(n, "to", o.anchor.br), l) {
4478
+ case "picture":
4479
+ await kr(t, r, s, o, s.getBounds(), s.getContent().getResource());
4480
+ break;
4481
+ case "chart":
4482
+ await Ar(t, r, s, o, c.get(o));
4483
+ break;
4484
+ case "shape":
4485
+ await jr(t, r, s, o, s.getBounds());
4486
+ break;
4487
+ case "smartArt":
4488
+ await Nr(t, r, s, o);
4489
+ break;
4490
+ case "slicer":
4491
+ await Pr(t, r, s, o);
4492
+ break;
4493
+ case "graphicFrame":
4494
+ await Fr(t, r, s, o);
4495
+ break;
4496
+ default: await Ir(t, r, s, o);
4497
+ }
4498
+ n.empty("clientData"), n.end("twoCellAnchor");
4102
4499
  }
4103
- n.empty("clientData"), n.end("twoCellAnchor");
4104
4500
  }
4105
4501
  n.end("wsDr"), n.close();
4106
4502
  }
4107
4503
  }(),
4108
- new class extends V {
4504
+ new class extends H {
4109
4505
  constructor() {
4110
4506
  super({
4111
4507
  kind: "legacyDrawing",
@@ -4117,11 +4513,11 @@ var ar = (e, t, n, r) => {
4117
4513
  async emit(e, t) {
4118
4514
  let n = e.images, r = n ? n.length : 0;
4119
4515
  if (r > 0) {
4120
- let e = t.getSharedStates().get(he);
4516
+ let e = t.getSharedStates().get(ze);
4121
4517
  for (let i = 0; i < r; i++) {
4122
4518
  let r = n[i], a = e?.get(r.resId);
4123
4519
  if (a) try {
4124
- await Jn(t, r.id, a);
4520
+ await Jr(t, r.id, a);
4125
4521
  } catch (e) {
4126
4522
  t.log(`Unable to write legacy drawing image '${r.id}'`, e);
4127
4523
  }
@@ -4132,51 +4528,51 @@ var ar = (e, t, n, r) => {
4132
4528
  i.setValidationDisabled(!0), i.raw(e.xml), i.close();
4133
4529
  }
4134
4530
  }(),
4135
- new class extends V {
4531
+ new class extends H {
4136
4532
  constructor() {
4137
4533
  super({
4138
4534
  kind: "embeddedPart",
4139
- contentType: Ye,
4535
+ contentType: yt,
4140
4536
  relTypeUri: ""
4141
4537
  });
4142
4538
  }
4143
4539
  getContentType(e) {
4144
- return e?.contentType || Ye;
4540
+ return e?.contentType || yt;
4145
4541
  }
4146
4542
  getRelTypeUri(e) {
4147
4543
  return e?.type ?? "";
4148
4544
  }
4149
4545
  getPath(e) {
4150
- return `./${Qe(e.name)}`;
4546
+ return `./${St(e.name)}`;
4151
4547
  }
4152
4548
  async emit(e, t) {
4153
- await Xe(e, t);
4549
+ await bt(e, t);
4154
4550
  let n = t.getXMLWriter();
4155
4551
  n.setValidationDisabled(!0), n.raw(e.xml ?? ""), n.close();
4156
4552
  }
4157
4553
  }(),
4158
- new class extends V {
4554
+ new class extends H {
4159
4555
  constructor() {
4160
4556
  super({
4161
4557
  kind: "pivotTable",
4162
- contentType: $e,
4558
+ contentType: Ct,
4163
4559
  relTypeUri: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable",
4164
4560
  path: "../pivotTables/pivotTable{n}.xml"
4165
4561
  });
4166
4562
  }
4167
4563
  getContentType(e) {
4168
- return e?.part?.contentType || $e;
4564
+ return e?.part?.contentType || Ct;
4169
4565
  }
4170
4566
  async emit(e, t) {
4171
4567
  let n = e.part;
4172
- await Xe(n, t);
4173
- let r = et(t, e.cacheId);
4568
+ await bt(n, t);
4569
+ let r = wt(t, e.cacheId);
4174
4570
  if (!r || !t.addRelationship("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition", r)) throw Error(`Pivot table '${n.name ?? ""}' has no cache with id ${e.cacheId}.`);
4175
4571
  let i = t.getXMLWriter();
4176
4572
  i.setValidationDisabled(!0), i.raw(n.xml ?? ""), i.close();
4177
4573
  }
4178
4574
  }(),
4179
- new class extends V {
4575
+ new class extends H {
4180
4576
  constructor() {
4181
4577
  super({
4182
4578
  kind: "comments",
@@ -4206,7 +4602,7 @@ var ar = (e, t, n, r) => {
4206
4602
  }) : s.push({
4207
4603
  ref: n,
4208
4604
  authorId: a(`tc={${t.getId().toUpperCase()}}`),
4209
- content: gt(t)
4605
+ content: Bt(t)
4210
4606
  });
4211
4607
  }
4212
4608
  n.start("authors");
@@ -4220,12 +4616,12 @@ var ar = (e, t, n, r) => {
4220
4616
  ref: t.ref,
4221
4617
  authorId: t.authorId,
4222
4618
  shapeId: 0
4223
- }), n.start("text"), _t(n, t.content, c), n.end("text"), n.end("comment");
4619
+ }), n.start("text"), Vt(n, t.content, c), n.end("text"), n.end("comment");
4224
4620
  }
4225
4621
  n.end("commentList"), n.end("comments"), n.close();
4226
4622
  }
4227
4623
  }(),
4228
- new class extends V {
4624
+ new class extends H {
4229
4625
  constructor() {
4230
4626
  super({
4231
4627
  kind: "threadedComments",
@@ -4244,17 +4640,17 @@ var ar = (e, t, n, r) => {
4244
4640
  for (let e = 0; e < r.length; e++) {
4245
4641
  let { comment: t, ref: i } = r[e];
4246
4642
  if (t.isNote()) continue;
4247
- Xn(n, i, t.getId(), t.getAuthor()?.getId(), t.getCreationDate(), t.getContent(), null, t.isResolved(), t.toJSON()?.mentions);
4643
+ Xr(n, i, t.getId(), t.getAuthor()?.getId(), t.getCreationDate(), t.getContent(), null, t.isResolved(), t.toJSON()?.mentions);
4248
4644
  let a = t.getReplies();
4249
4645
  for (let e = 0; e < a.length; e++) {
4250
4646
  let r = a[e];
4251
- Xn(n, i, r.getId(), r.getAuthor()?.getId(), r.getCreationDate(), r.getContent(), t.getId(), !1, r.toJSON().mentions);
4647
+ Xr(n, i, r.getId(), r.getAuthor()?.getId(), r.getCreationDate(), r.getContent(), t.getId(), !1, r.toJSON().mentions);
4252
4648
  }
4253
4649
  }
4254
4650
  n.end("ThreadedComments"), n.close();
4255
4651
  }
4256
4652
  }(),
4257
- new class extends V {
4653
+ new class extends H {
4258
4654
  constructor() {
4259
4655
  super({
4260
4656
  kind: "persons",
@@ -4274,7 +4670,7 @@ var ar = (e, t, n, r) => {
4274
4670
  let t = r[e];
4275
4671
  n.empty("person", {
4276
4672
  displayName: t.getDisplayName(),
4277
- id: Zn(t.getId()),
4673
+ id: Zr(t.getId()),
4278
4674
  userId: t.getUserId() ?? t.getDisplayName(),
4279
4675
  providerId: t.getProviderId() ?? "None"
4280
4676
  });
@@ -4282,7 +4678,7 @@ var ar = (e, t, n, r) => {
4282
4678
  n.end("personList"), n.close();
4283
4679
  }
4284
4680
  }(),
4285
- new class extends V {
4681
+ new class extends H {
4286
4682
  constructor() {
4287
4683
  super({
4288
4684
  kind: "table",
@@ -4301,10 +4697,10 @@ var ar = (e, t, n, r) => {
4301
4697
  "xmlns:xr": "http://schemas.microsoft.com/office/spreadsheetml/2014/revision",
4302
4698
  "xmlns:xr3": "http://schemas.microsoft.com/office/spreadsheetml/2016/revision3"
4303
4699
  }, i = e.json, a = e.model;
4304
- a.isShowHeaders(), r.id = ++Qn, r.name = i.name?.trim(), r.displayName = i.description ?? i.name, r.ref = e.ref, i.headerRowCount !== 1 && (r.headerRowCount = i.headerRowCount), i.totalsRowCount !== 0 && (r.totalsRowCount = i.totalsRowCount), i.totalsRowShown || a.isShowTotals() || (r.totalsRowShown = "0"), n.start("table", r), a.isShowHeaders() && Kt(t, n, a, i), $n(t, n, a, i), tr(t, n, a, i), n.end("table"), n.close();
4700
+ a.isShowHeaders(), r.id = ++Qr, r.name = i.name?.trim(), r.displayName = i.description ?? i.name, r.ref = e.ref, i.headerRowCount !== 1 && (r.headerRowCount = i.headerRowCount), i.totalsRowCount !== 0 && (r.totalsRowCount = i.totalsRowCount), i.totalsRowShown || a.isShowTotals() || (r.totalsRowShown = "0"), n.start("table", r), a.isShowHeaders() && kn(t, n, a, i), $r(t, n, a, i), ti(t, n, a, i), n.end("table"), n.close();
4305
4701
  }
4306
4702
  }(),
4307
- new class extends V {
4703
+ new class extends H {
4308
4704
  constructor() {
4309
4705
  super({
4310
4706
  kind: "externalLink",
@@ -4361,7 +4757,7 @@ var ar = (e, t, n, r) => {
4361
4757
  let i = r.length;
4362
4758
  for (let t = 0; t < i; t++) {
4363
4759
  let [i, a] = r[t], o = a.length;
4364
- for (let t = 0; t < o; t++) ir(e, n, i + t, a.at(t));
4760
+ for (let t = 0; t < o; t++) ii(e, n, i + t, a.at(t));
4365
4761
  }
4366
4762
  e.end("row");
4367
4763
  }
@@ -4373,7 +4769,7 @@ var ar = (e, t, n, r) => {
4373
4769
  }(n, e), n.end("externalBook"), n.end("externalLink"), n.close();
4374
4770
  }
4375
4771
  }(),
4376
- new class extends V {
4772
+ new class extends H {
4377
4773
  constructor() {
4378
4774
  super({
4379
4775
  kind: "chart",
@@ -4389,10 +4785,10 @@ var ar = (e, t, n, r) => {
4389
4785
  "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4390
4786
  "xmlns:r": "http://schemas.openxmlformats.org/officeDocument/2006/relationships",
4391
4787
  "xmlns:c16r2": "http://schemas.microsoft.com/office/drawing/2015/06/chart"
4392
- }), n.empty("date1904", { val: "0" }), n.empty("lang", { val: "en-US" }), n.empty("roundedCorners", { val: "0" }), ar(t, n, e.model, e.json), or(t, n, e.styles, e.model, e.json), sr(t, n, e.model, e.json), n.end("chartSpace"), n.popDefaultNamespace(), n.close(), t.addPart("chartStyle", { styles: e.styles }), t.addPart("chartColors", { styles: e.styles });
4788
+ }), n.empty("date1904", { val: "0" }), n.empty("lang", { val: "en-US" }), n.empty("roundedCorners", { val: "0" }), ai(t, n, e.model, e.json), oi(t, n, e.styles, e.model, e.json), si(t, n, e.model, e.json), n.end("chartSpace"), n.popDefaultNamespace(), n.close(), t.addPart("chartStyle", { styles: e.styles }), t.addPart("chartColors", { styles: e.styles });
4393
4789
  }
4394
4790
  }(),
4395
- new class extends V {
4791
+ new class extends H {
4396
4792
  constructor() {
4397
4793
  super({
4398
4794
  kind: "chartStyle",
@@ -4407,10 +4803,10 @@ var ar = (e, t, n, r) => {
4407
4803
  "xmlns:cs": "http://schemas.microsoft.com/office/drawing/2012/chartStyle",
4408
4804
  "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4409
4805
  id: "297"
4410
- }), lr(t, n, ur, e.styles), n.end("chartStyle"), n.close();
4806
+ }), li(t, n, ui, e.styles), n.end("chartStyle"), n.close();
4411
4807
  }
4412
4808
  }(),
4413
- new class extends V {
4809
+ new class extends H {
4414
4810
  constructor() {
4415
4811
  super({
4416
4812
  kind: "chartColors",
@@ -4426,16 +4822,16 @@ var ar = (e, t, n, r) => {
4426
4822
  "xmlns:a": "http://schemas.openxmlformats.org/drawingml/2006/main",
4427
4823
  meth: "cycle",
4428
4824
  id: "10"
4429
- }), n.empty("a:schemeClr", { val: "accent1" }), n.empty("a:schemeClr", { val: "accent2" }), n.empty("a:schemeClr", { val: "accent3" }), n.empty("a:schemeClr", { val: "accent4" }), n.empty("a:schemeClr", { val: "accent5" }), n.empty("a:schemeClr", { val: "accent6" }), dr(t, n, fr), n.end("cs:colorStyle"), n.close();
4825
+ }), n.empty("a:schemeClr", { val: "accent1" }), n.empty("a:schemeClr", { val: "accent2" }), n.empty("a:schemeClr", { val: "accent3" }), n.empty("a:schemeClr", { val: "accent4" }), n.empty("a:schemeClr", { val: "accent5" }), n.empty("a:schemeClr", { val: "accent6" }), di(t, n, fi), n.end("cs:colorStyle"), n.close();
4430
4826
  }
4431
4827
  }()
4432
- ], mr = (e) => {
4828
+ ], mi = (e) => {
4433
4829
  let t = e.getPart("xl/_rels/workbook.xml.rels");
4434
4830
  if (!t) return null;
4435
4831
  let n = /* @__PURE__ */ new Map();
4436
- for (let e of d(t.data)) {
4832
+ for (let e of f(t.data)) {
4437
4833
  if (!e.id) continue;
4438
- let t = e.external ? e.target : we(e.target.startsWith("/") ? e.target : "xl/" + e.target);
4834
+ let t = e.external ? e.target : Je(e.target.startsWith("/") ? e.target : "xl/" + e.target);
4439
4835
  n.set(e.id, {
4440
4836
  type: e.type,
4441
4837
  target: t,
@@ -4443,21 +4839,21 @@ var ar = (e, t, n, r) => {
4443
4839
  });
4444
4840
  }
4445
4841
  return n;
4446
- }, hr = (e) => {
4842
+ }, hi = (e) => {
4447
4843
  let t = e.getPart("xl/workbook.xml");
4448
4844
  return t ? new TextDecoder("utf-8").decode(t.data) : null;
4449
- }, gr = (e) => {
4450
- let t = _r.get(e);
4845
+ }, gi = (e) => {
4846
+ let t = _i.get(e);
4451
4847
  if (t !== void 0) return t;
4452
4848
  let n = e.getPart("xl/workbook.xml"), r = n ? new TextDecoder("utf-8").decode(n.data) : null;
4453
- return _r.set(e, r), r;
4454
- }, _r = /* @__PURE__ */ new WeakMap(), vr = async (e, t) => {
4455
- let n = new He();
4456
- for (let e of pr) n.register(e);
4457
- let r = yr, i = ge.createUint8Array({
4849
+ return _i.set(e, r), r;
4850
+ }, _i = /* @__PURE__ */ new WeakMap(), vi = async (e, t) => {
4851
+ let n = new ft();
4852
+ for (let e of pi) n.register(e);
4853
+ let r = yi, i = Be.createUint8Array({
4458
4854
  lastModDate: new Date(1899, 11, 29, 19, 0, 0),
4459
4855
  level: r
4460
- }), a = t?.format === "Excel" || t?.format === "ExcelMacro" ? o(e) : null, s = /* @__PURE__ */ new Map(), c = a ? ((e) => {
4856
+ }), a = t?.format === "Excel" || t?.format === "ExcelMacro" ? v(e) : null, o = /* @__PURE__ */ new Map(), s = a ? ((e) => {
4461
4857
  let t = e.getPart("xl/workbook.xml");
4462
4858
  if (!t) return null;
4463
4859
  let n = new TextDecoder("utf-8").decode(t.data.subarray(0, 4096)).match(/<fileVersion\b([^>]*)\/?>/);
@@ -4466,33 +4862,33 @@ var ar = (e, t, n, r) => {
4466
4862
  for (let e of n[1].matchAll(/([\w:]+)="([^"]*)"/g)) r[e[1]] = e[2];
4467
4863
  return Object.keys(r).length > 0 ? r : null;
4468
4864
  })(a) : null;
4469
- c && (t?.macroEnabled || delete c.codeName, s.set(nt, c));
4470
- let l = a ? ((e) => {
4471
- let t = gr(e)?.match(/<calcPr\b[^>]*?\bcalcId="([^"]*)"/);
4865
+ s && (t?.macroEnabled || delete s.codeName, o.set(Et, s));
4866
+ let c = a ? ((e) => {
4867
+ let t = gi(e)?.match(/<calcPr\b[^>]*?\bcalcId="([^"]*)"/);
4472
4868
  return t ? t[1] : null;
4473
4869
  })(a) : null;
4474
- l !== null && s.set("calcId", l);
4475
- let u = a ? ((e) => {
4476
- let t = gr(e)?.match(/<ext\b[^>]*>\s*<xcalcf:calcFeatures\b[\s\S]*?<\/xcalcf:calcFeatures>\s*<\/ext>/);
4870
+ c !== null && o.set("calcId", c);
4871
+ let l = a ? ((e) => {
4872
+ let t = gi(e)?.match(/<ext\b[^>]*>\s*<xcalcf:calcFeatures\b[\s\S]*?<\/xcalcf:calcFeatures>\s*<\/ext>/);
4477
4873
  return t ? t[0] : null;
4478
4874
  })(a) : null;
4479
- u !== null && s.set("calcFeatures", u);
4480
- let d = a ? ((e) => {
4481
- let t = hr(e);
4875
+ l !== null && o.set("calcFeatures", l);
4876
+ let u = a ? ((e) => {
4877
+ let t = hi(e);
4482
4878
  if (!t) return null;
4483
4879
  let n = /<externalReferences\b[^>]*>([\s\S]*?)<\/externalReferences>/.exec(t);
4484
4880
  if (!n) return null;
4485
4881
  let r = [...n[1].matchAll(/<externalReference\b[^>]*\sr:id="([^"]*)"/g)].map((e) => e[1]);
4486
4882
  if (r.length === 0) return null;
4487
- let i = mr(e);
4883
+ let i = mi(e);
4488
4884
  return i ? r.map((e) => {
4489
4885
  let t = i.get(e);
4490
4886
  return t && !t.external ? t.target : null;
4491
4887
  }) : null;
4492
4888
  })(a) : null;
4493
- d && s.set(it, d);
4494
- let f = a ? ((e) => {
4495
- let t = hr(e), n = t ? mr(e) : null;
4889
+ u && o.set(Ot, u);
4890
+ let d = a ? ((e) => {
4891
+ let t = hi(e), n = t ? mi(e) : null;
4496
4892
  if (!t || !n) return null;
4497
4893
  let r = /* @__PURE__ */ new Map();
4498
4894
  for (let e of t.matchAll(/<sheet\b([^>]*)\/?>/g)) {
@@ -4503,30 +4899,30 @@ var ar = (e, t, n, r) => {
4503
4899
  }
4504
4900
  return r.size > 0 ? r : null;
4505
4901
  })(a) : null;
4506
- f && s.set(rt, f), s.set(he, /* @__PURE__ */ new Map());
4507
- let p = [], m = new Be(i, n, {
4902
+ d && o.set(Dt, d), o.set(ze, /* @__PURE__ */ new Map());
4903
+ let f = [], p = new ut(i, n, {
4508
4904
  strictDuplicateChildren: !0,
4509
4905
  onPartEmitted: t?.onPartEmitted,
4510
4906
  onWarning: (e, t, n) => {
4511
- p.push([
4907
+ f.push([
4512
4908
  e,
4513
4909
  t,
4514
4910
  n
4515
4911
  ]);
4516
4912
  },
4517
- mapState: s,
4913
+ mapState: o,
4518
4914
  sourcePackage: a,
4519
4915
  macroEnabled: t?.macroEnabled ?? !1
4520
4916
  });
4521
- m.addPart("workbook", e, "/xl/workbook.xml"), await m.waitEmit(), m.addPart("propsCore", {}), m.addPart("propsApp", { model: e });
4522
- let h = await m.build(), g = t?.progress?.onWarning;
4523
- if (p.length && g) {
4917
+ p.addPart("workbook", e, "/xl/workbook.xml"), await p.waitEmit(), p.addPart("propsCore", {}), p.addPart("propsApp", { model: e });
4918
+ let m = await p.build(), h = t?.progress?.onWarning;
4919
+ if (f.length && h) {
4524
4920
  let e = /* @__PURE__ */ new Set();
4525
- for (let [n, r, i] of p) {
4921
+ for (let [n, r, i] of f) {
4526
4922
  let a = i ?? n;
4527
- e.has(a) || (e.add(a), g.call(t.progress, n, r));
4923
+ e.has(a) || (e.add(a), h.call(t.progress, n, r));
4528
4924
  }
4529
4925
  }
4530
- return h.byteOffset === 0 && h.byteLength === h.buffer.byteLength ? h.buffer : h.slice().buffer;
4531
- }, yr = 1;
4532
- export { vr as writeXLSX };
4926
+ return m.byteOffset === 0 && m.byteLength === m.buffer.byteLength ? m.buffer : m.slice().buffer;
4927
+ }, yi = 1;
4928
+ export { vi as writeXLSX };