@sheetxl/io-xlsx 0.7.28-beta.2 → 0.7.28-beta.4

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 (38) hide show
  1. package/browser/cjs/Bhq8KfEhCnRykWeS.cjs +1 -0
  2. package/browser/cjs/BmG0GOcbuYvt3-R2.cjs +1 -0
  3. package/browser/cjs/{jeOqW5knCg5F4v4u.cjs → D3YH3tTndeltJsh5.cjs} +1 -1
  4. package/browser/cjs/DK9GutW2zPbyNlfU.cjs +2 -0
  5. package/browser/cjs/Dmi-Tsz618B6vKpZ.cjs +5 -0
  6. package/browser/cjs/index.cjs +1 -1
  7. package/browser/esm/{BfG31qdPDPTaVft2.mjs → BXCOn1XvLvYSfpzi.mjs} +2 -2
  8. package/browser/esm/{kPda7Ul-twVT1FjI.mjs → BcnofzmeeuCVzr_M.mjs} +5 -5
  9. package/browser/esm/{CWplWy3gsPGbUAtN.mjs → BhohPLTubb_9rfrh.mjs} +2 -2
  10. package/browser/esm/{CkWprfA-u9b6Wv-6.mjs → BknJ4AeVeFJploh9.mjs} +2 -2
  11. package/browser/esm/{BfsN3ozwrBghVjdf.mjs → C3sYFBc7Tym8l12A.mjs} +1 -1
  12. package/browser/esm/{aZgK0aSXvnNeKhcT.mjs → C7R1lFA0iv-1bZ9i.mjs} +2 -2
  13. package/browser/esm/{5j5FhwFDI6_VA9fj.mjs → CV_L3E5OoPstI9lx.mjs} +260 -242
  14. package/browser/esm/{DVKFoaA2I9k0LZGi.mjs → D8qZcXzj_fdusd0Y.mjs} +1460 -1387
  15. package/browser/esm/{we8Sxc3Pjym3t1X3.mjs → DLEtaZiz_1cZH0dA.mjs} +743 -681
  16. package/browser/esm/{CXm95MW6vwQfZdt2.mjs → DlBlJGlFQJrKovwJ.mjs} +923 -889
  17. package/browser/esm/index.mjs +2 -2
  18. package/browser/esm/{Bd8VZadoCkiBl21c.mjs → saBnxecsRUpY6fGv.mjs} +1 -1
  19. package/node/esm/{DJqA5NiUXFqJIhei.mjs → B6lQXVQjFT_OE3IA.mjs} +2 -2
  20. package/node/esm/{CbGT81jm1I14j0h4.mjs → B9CUp-rqol5K1r1c.mjs} +1 -1
  21. package/node/esm/{vWgkWZWFCvOLFKn7.mjs → BSrW-J3BEH4Tza_S.mjs} +645 -572
  22. package/node/esm/{CkuXHY-kBtG7vsTe.mjs → BYCpXFieBgL_cwTO.mjs} +197 -179
  23. package/node/esm/{C-09SoRaez1R5ECm.mjs → Bqi4c7-14v0oNgFN.mjs} +1 -1
  24. package/node/esm/{CTasRO0iNMl4L5AI.mjs → CfIzBnObj09fDuUX.mjs} +2 -2
  25. package/node/esm/{QcGRYN0g5KXsSD2K.mjs → D0frS50CfyeuXcuz.mjs} +741 -677
  26. package/node/esm/{Bd7xe-v8LNfI_eBw.mjs → DsZ19z4oXoL-d0Lk.mjs} +989 -949
  27. package/node/esm/index.mjs +5 -5
  28. package/package.json +3 -3
  29. package/types/src/AutoFilterRules.d.ts +62 -0
  30. package/types/src/reader/dom/DOMTransformer.d.ts +10 -0
  31. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +1 -1
  32. package/types/src/reader/sax/SaxVisitor.d.ts +14 -0
  33. package/types/src/writer/emitters/StylesEmitter.d.ts +13 -2
  34. package/types/src/writer/utils/AutoFilter.d.ts +3 -2
  35. package/browser/cjs/5QaWZ2tRVhz1rf3W.cjs +0 -1
  36. package/browser/cjs/D-8WoJkvdPf-79sB.cjs +0 -2
  37. package/browser/cjs/Dw2OjBJv3T-RVAoo.cjs +0 -5
  38. package/browser/cjs/sEmMmxaNBSY_o-Zb.cjs +0 -1
@@ -1,25 +1,25 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.7.28-beta.2
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.7.28-beta.4
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 { r as e } from "./Bd8VZadoCkiBl21c.mjs";
8
- import { c as t, d as n, f as r, l as i, p as a, r as o, s, u as c } from "./aZgK0aSXvnNeKhcT.mjs";
9
- import { A as l, B as u, C as d, D as f, M as p, O as m, P as h, S as g, U as _, W as v, _ as ee, a as te, b as ne, f as re, h as ie, i as ae, j as oe, l as se, n as ce, o as le, p as ue, r as y, t as b, u as x, z as S } from "./DVKFoaA2I9k0LZGi.mjs";
10
- import { BufferUtils as de, CommonUtils as C, ExpectedError as fe } from "@sheetxl/utils";
11
- import { AddressUtils as w, CommonUtils as pe, CoordUtils as T, FormulaError as E, ICondition as D, IConditionalFormat as O, IRange as me, OutOfBoundsError as k, ResourceCollection as he, Theme as ge, Tuple as _e, Workbook as ve } from "@sheetxl/sdk";
12
- var A = /* @__PURE__ */ new Uint8Array(), j = class e {
7
+ import { r as e } from "./saBnxecsRUpY6fGv.mjs";
8
+ import { A as t, B as n, C as r, F as i, G as a, H as o, I as s, L as c, P as l, R as u, S as d, T as f, U as p, V as m, W as h, c as g, d as _, j as v, m as y, o as ee, p as b, q as te, r as ne, t as re, v as ie, x as ae, y as oe, z as se } from "./D8qZcXzj_fdusd0Y.mjs";
9
+ import { c as ce, d as x, f as S, l as C, p as le, r as ue, s as de, u as w } from "./C7R1lFA0iv-1bZ9i.mjs";
10
+ import { BufferUtils as T, CommonUtils as E, ExpectedError as D } from "@sheetxl/utils";
11
+ import { AddressUtils as O, CommonUtils as fe, CoordUtils as k, FormulaError as A, ICondition as j, IConditionalFormat as M, IRange as pe, OutOfBoundsError as N, ResourceCollection as me, Theme as he, Tuple as ge, Workbook as _e } from "@sheetxl/sdk";
12
+ var ve = /* @__PURE__ */ new Uint8Array(), ye = class e {
13
13
  constructor(e, t, n) {
14
14
  this.buffers = /* @__PURE__ */ new Map(), this.zip = e, this.entries = t, this.rawBuffer = n;
15
15
  }
16
16
  static normalize(e) {
17
17
  return e.startsWith("/") ? e.slice(1) : e;
18
18
  }
19
- static async create(t) {
20
- let n = t instanceof Blob ? A : t instanceof Uint8Array ? t : new Uint8Array(t), r = new S(t instanceof Blob ? new u(t) : new _(n)), i = /* @__PURE__ */ new Map();
21
- for (let e of await r.getEntries()) e.directory || i.set(e.filename, e);
22
- return new e(r, i, n);
19
+ static async create(n) {
20
+ let r = n instanceof Blob ? ve : n instanceof Uint8Array ? n : new Uint8Array(n), i = new t(n instanceof Blob ? new v(n) : new l(r)), a = /* @__PURE__ */ new Map();
21
+ for (let e of await i.getEntries()) e.directory || a.set(e.filename, e);
22
+ return new e(i, a, r);
23
23
  }
24
24
  getNames() {
25
25
  return [...this.entries.keys()];
@@ -33,14 +33,14 @@ var A = /* @__PURE__ */ new Uint8Array(), j = class e {
33
33
  async getBuffer(t) {
34
34
  let n = e.normalize(t), r = this.buffers.get(n);
35
35
  if (r) return r;
36
- let i = this.entries.get(n);
37
- if (!i) return null;
38
- let a = await i.getData(new v());
39
- return this.buffers.set(n, a), a;
36
+ let a = this.entries.get(n);
37
+ if (!a) return null;
38
+ let o = await a.getData(new i());
39
+ return this.buffers.set(n, o), o;
40
40
  }
41
41
  async prefetch(e) {
42
42
  let t = [];
43
- for (let [n, r] of this.entries) !this.buffers.has(n) && e(n, r) && t.push(r.getData(new v()).then((e) => {
43
+ for (let [n, r] of this.entries) !this.buffers.has(n) && e(n, r) && t.push(r.getData(new i()).then((e) => {
44
44
  this.buffers.set(n, e);
45
45
  }));
46
46
  await Promise.all(t);
@@ -83,18 +83,18 @@ var A = /* @__PURE__ */ new Uint8Array(), j = class e {
83
83
  async close() {
84
84
  await this.zip.close();
85
85
  }
86
- }, ye = class {
86
+ }, be = class {
87
87
  constructor(e) {
88
- this._sink = e, this._samples = [], this._t0 = M(), this._tPrev = this._t0, this._heapPrev = be();
88
+ this._sink = e, this._samples = [], this._t0 = xe(), this._tPrev = this._t0, this._heapPrev = Se();
89
89
  }
90
90
  mark(e) {
91
- let t = M(), n = be(), r = {
91
+ let t = xe(), n = Se(), r = {
92
92
  label: e,
93
93
  tMs: t - this._t0,
94
94
  dtMs: t - this._tPrev,
95
95
  heapBytes: n,
96
96
  dHeapBytes: n !== void 0 && this._heapPrev !== void 0 ? n - this._heapPrev : void 0,
97
- rssBytes: N()
97
+ rssBytes: P()
98
98
  };
99
99
  this._tPrev = t, this._heapPrev = n, this._samples.push(r), this._sink?.(r);
100
100
  }
@@ -106,91 +106,91 @@ var A = /* @__PURE__ */ new Uint8Array(), j = class e {
106
106
  phase: e.label,
107
107
  tMs: Math.round(e.tMs),
108
108
  dtMs: Math.round(e.dtMs),
109
- heapMB: e.heapBytes === void 0 ? "—" : xe(e.heapBytes / 1048576),
110
- dHeapMB: e.dHeapBytes === void 0 ? "—" : xe(e.dHeapBytes / 1048576),
111
- rssMB: e.rssBytes === void 0 ? "—" : xe(e.rssBytes / 1048576)
109
+ heapMB: e.heapBytes === void 0 ? "—" : F(e.heapBytes / 1048576),
110
+ dHeapMB: e.dHeapBytes === void 0 ? "—" : F(e.dHeapBytes / 1048576),
111
+ rssMB: e.rssBytes === void 0 ? "—" : F(e.rssBytes / 1048576)
112
112
  }));
113
113
  }
114
- }, M = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now();
115
- function be() {
114
+ }, xe = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now();
115
+ function Se() {
116
116
  let e = typeof performance == "object" ? performance.memory : void 0;
117
117
  if (e && typeof e.usedJSHeapSize == "number") return e.usedJSHeapSize;
118
118
  let t = globalThis.process;
119
119
  return typeof t == "object" && typeof t.memoryUsage == "function" ? t.memoryUsage().heapUsed : void 0;
120
120
  }
121
- function N() {
121
+ function P() {
122
122
  let e = globalThis.process;
123
123
  if (typeof e == "object" && typeof e.memoryUsage == "function") return e.memoryUsage().rss;
124
124
  }
125
- function xe(e) {
125
+ function F(e) {
126
126
  return Math.round(10 * e) / 10;
127
127
  }
128
- var Se = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ce = `-${Se}.0-9·̀-ͯ‿-⁀`, P = (RegExp(`^[${Se}]$`, "u"), RegExp(`^[${Ce}]$`, "u"), RegExp(`^[${Se}][${Ce}]*$`, "u")), F = (RegExp(`^[${Ce}]+$`, "u"), [
128
+ var I = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ce = `-${I}.0-9·̀-ͯ‿-⁀`, we = (RegExp(`^[${I}]$`, "u"), RegExp(`^[${Ce}]$`, "u"), RegExp(`^[${I}][${Ce}]*$`, "u")), L = (RegExp(`^[${Ce}]+$`, "u"), [
129
129
  32,
130
130
  10,
131
131
  13,
132
132
  9
133
133
  ]);
134
- function I(e) {
134
+ function R(e) {
135
135
  return e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 58 || e === 95 || e === 8204 || e === 8205 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
136
136
  }
137
- var we = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", L = `-${we}.0-9·̀-ͯ‿-⁀`;
138
- RegExp(`^[${we}]$`, "u"), RegExp(`^[${L}]$`, "u"), RegExp(`^[${we}][${L}]*$`, "u"), RegExp(`^[${L}]+$`, "u");
139
- var Te = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", R = `-${Te}.0-9·̀-ͯ‿-⁀`, Ee = (RegExp(`^[${Te}]$`, "u"), RegExp(`^[${R}]$`, "u"), RegExp(`^[${Te}][${R}]*$`, "u"));
140
- function De(e) {
137
+ var Te = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Ee = `-${Te}.0-9·̀-ͯ‿-⁀`;
138
+ RegExp(`^[${Te}]$`, "u"), RegExp(`^[${Ee}]$`, "u"), RegExp(`^[${Te}][${Ee}]*$`, "u"), RegExp(`^[${Ee}]+$`, "u");
139
+ var De = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", z = `-${De}.0-9·̀-ͯ‿-⁀`, Oe = (RegExp(`^[${De}]$`, "u"), RegExp(`^[${z}]$`, "u"), RegExp(`^[${De}][${z}]*$`, "u"));
140
+ function ke(e) {
141
141
  return e >= 65 && e <= 90 || e === 95 || e >= 97 && e <= 122 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 767 || e >= 880 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
142
142
  }
143
- var z = function(e) {
143
+ var B = function(e) {
144
144
  return e === 32 || e === 10 || e === 13 || e === 9;
145
- }, Oe = function(e) {
145
+ }, Ae = function(e) {
146
146
  return e >= 32 && e <= 55295 || e === 10 || e === 13 || e === 9 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
147
- }, B = I, ke = function(e) {
148
- return I(e) || e >= 48 && e <= 57 || e === 45 || e === 46 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
149
- }, V = F, Ae = P, je = function(e) {
147
+ }, V = R, je = function(e) {
148
+ return R(e) || e >= 48 && e <= 57 || e === 45 || e === 46 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
149
+ }, H = L, Me = we, Ne = function(e) {
150
150
  return e >= 1 && e <= 55295 || e >= 57344 && e <= 65533 || e >= 65536 && e <= 1114111;
151
- }, Me = De, Ne = function(e) {
152
- return De(e) || e === 45 || e === 46 || e >= 48 && e <= 57 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
153
- }, Pe = Ee, Fe = "http://www.w3.org/XML/1998/namespace", Ie = "http://www.w3.org/2000/xmlns/", Le = {
151
+ }, Pe = ke, Fe = function(e) {
152
+ return ke(e) || e === 45 || e === 46 || e >= 48 && e <= 57 || e === 183 || e >= 768 && e <= 879 || e >= 8255 && e <= 8256;
153
+ }, Ie = Oe, Le = "http://www.w3.org/XML/1998/namespace", Re = "http://www.w3.org/2000/xmlns/", ze = {
154
154
  __proto__: null,
155
- xml: Fe,
156
- xmlns: Ie
157
- }, Re = {
155
+ xml: Le,
156
+ xmlns: Re
157
+ }, Be = {
158
158
  __proto__: null,
159
159
  amp: "&",
160
160
  gt: ">",
161
161
  lt: "<",
162
162
  quot: "\"",
163
163
  apos: "'"
164
- }, H = -1, U = -2, W = 13, ze = 33, G = 10, Be = 60, K = 61, q = 62, J = 63, Y = 93, Ve = (e) => e === 34 || e === 39, He = [34, 39], Ue = [
165
- ...He,
164
+ }, U = -1, W = -2, G = 13, Ve = 33, K = 10, He = 60, Ue = 61, q = 62, J = 63, Y = 93, We = (e) => e === 34 || e === 39, Ge = [34, 39], Ke = [
165
+ ...Ge,
166
166
  91,
167
167
  q
168
- ], We = [
169
- ...He,
170
- Be,
168
+ ], qe = [
169
+ ...Ge,
170
+ He,
171
171
  Y
172
- ], Ge = [
173
- K,
172
+ ], Je = [
173
+ Ue,
174
174
  J,
175
- ...V
176
- ], Ke = [
177
- ...V,
175
+ ...H
176
+ ], Ye = [
177
+ ...H,
178
178
  q,
179
179
  38,
180
- Be
180
+ He
181
181
  ];
182
- function qe(e, t, n) {
182
+ function Xe(e, t, n) {
183
183
  switch (t) {
184
184
  case "xml":
185
- n !== Fe && e.fail(`xml prefix must be bound to ${Fe}.`);
185
+ n !== Le && e.fail(`xml prefix must be bound to ${Le}.`);
186
186
  break;
187
- case "xmlns": n !== Ie && e.fail(`xmlns prefix must be bound to ${Ie}.`);
187
+ case "xmlns": n !== Re && e.fail(`xmlns prefix must be bound to ${Re}.`);
188
188
  }
189
189
  switch (n) {
190
- case Ie:
191
- e.fail(t === "" ? `the default namespace may not be set to ${n}.` : `may not assign a prefix (even "xmlns") to the URI ${Ie}.`);
190
+ case Re:
191
+ e.fail(t === "" ? `the default namespace may not be set to ${n}.` : `may not assign a prefix (even "xmlns") to the URI ${Re}.`);
192
192
  break;
193
- case Fe: switch (t) {
193
+ case Le: switch (t) {
194
194
  case "xml": break;
195
195
  case "":
196
196
  e.fail(`the default namespace may not be set to ${n}.`);
@@ -199,7 +199,7 @@ function qe(e, t, n) {
199
199
  }
200
200
  }
201
201
  }
202
- var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
202
+ var Ze, Qe, $e = (e) => Ie.test(e), et = (e) => Me.test(e), tt = {
203
203
  xmldecl: "xmlDeclHandler",
204
204
  text: "textHandler",
205
205
  processinginstruction: "piHandler",
@@ -213,7 +213,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
213
213
  error: "errorHandler",
214
214
  end: "endHandler",
215
215
  ready: "readyHandler"
216
- }, $e = class {
216
+ }, nt = class {
217
217
  get closed() {
218
218
  return this._closed;
219
219
  }
@@ -221,15 +221,15 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
221
221
  this.i = 0, this.prevI = 0, this.opt = e ?? {}, this.fragmentOpt = !!this.opt.fragment;
222
222
  let t = this.xmlnsOpt = !!this.opt.xmlns;
223
223
  if (this.trackPosition = !1 !== this.opt.position, this.fileName = this.opt.fileName, t) {
224
- this.nameStartCheck = Me, this.nameCheck = Ne, this.isName = Xe, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
224
+ this.nameStartCheck = Pe, this.nameCheck = Fe, this.isName = $e, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
225
225
  __proto__: null,
226
- ...Le
226
+ ...ze
227
227
  };
228
228
  let e = this.opt.additionalNamespaces;
229
229
  e != null && (function(e, t) {
230
- for (let n of Object.keys(t)) qe(e, n, t[n]);
230
+ for (let n of Object.keys(t)) Xe(e, n, t[n]);
231
231
  }(this, e), Object.assign(this.ns, e));
232
- } else this.nameStartCheck = B, this.nameCheck = ke, this.isName = Ze, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
232
+ } else this.nameStartCheck = V, this.nameCheck = je, this.isName = et, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
233
233
  this.stateTable = [
234
234
  this.sBegin,
235
235
  this.sBeginWhitespace,
@@ -281,7 +281,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
281
281
  _init() {
282
282
  this.openWakaBang = "", this.text = "", this.name = "", this.piTarget = "", this.entity = "", this.q = null, this.tags = [], this.tag = null, this.topNS = null, this.chunk = "", this.chunkPosition = 0, this.i = 0, this.prevI = 0, this.carriedFromPrevious = void 0, this.forbiddenState = 0, this.attribList = [];
283
283
  let { fragmentOpt: e } = this;
284
- this.state = e ? W : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = e, this.xmlDeclPossible = !e, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
284
+ this.state = e ? G : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = e, this.xmlDeclPossible = !e, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
285
285
  let { defaultXMLVersion: t } = this.opt;
286
286
  if (t === void 0) {
287
287
  if (!0 === this.opt.forceXMLVersion) throw Error("forceXMLVersion set but defaultXMLVersion is not set");
@@ -291,7 +291,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
291
291
  version: void 0,
292
292
  encoding: void 0,
293
293
  standalone: void 0
294
- }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Re), this.readyHandler?.();
294
+ }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Be), this.readyHandler?.();
295
295
  }
296
296
  get position() {
297
297
  return this.chunkPosition + this.i;
@@ -300,10 +300,10 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
300
300
  return this.position - this.positionAtNewLine;
301
301
  }
302
302
  on(e, t) {
303
- this[Qe[e]] = t;
303
+ this[tt[e]] = t;
304
304
  }
305
305
  off(e) {
306
- this[Qe[e]] = void 0;
306
+ this[tt[e]] = void 0;
307
307
  }
308
308
  makeError(e) {
309
309
  let t = this.fileName ?? "";
@@ -329,13 +329,13 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
329
329
  }
330
330
  getCode10() {
331
331
  let e = this.chunk, t = this.i;
332
- if (this.prevI = t, this.i++, t >= e.length) return H;
332
+ if (this.prevI = t, this.i++, t >= e.length) return U;
333
333
  let n = e.charCodeAt(t);
334
334
  if (this.column++, n < 55296) {
335
335
  if (n >= 32 || n === 9) return n;
336
336
  switch (n) {
337
- case G: return this.line++, this.column = 0, this.positionAtNewLine = this.position, G;
338
- case 13: return e.charCodeAt(t + 1) === G && (this.i = t + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, U;
337
+ case K: return this.line++, this.column = 0, this.positionAtNewLine = this.position, K;
338
+ case 13: return e.charCodeAt(t + 1) === K && (this.i = t + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, W;
339
339
  default: return this.fail("disallowed character."), n;
340
340
  }
341
341
  }
@@ -345,18 +345,18 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
345
345
  }
346
346
  getCode11() {
347
347
  let { chunk: e, i: t } = this;
348
- if (this.prevI = t, this.i = t + 1, t >= e.length) return H;
348
+ if (this.prevI = t, this.i = t + 1, t >= e.length) return U;
349
349
  let n = e.charCodeAt(t);
350
350
  if (this.column++, n < 55296) {
351
351
  if (n > 31 && n < 127 || n > 159 && n !== 8232 || n === 9) return n;
352
352
  switch (n) {
353
- case G: return this.line++, this.column = 0, this.positionAtNewLine = this.position, G;
353
+ case K: return this.line++, this.column = 0, this.positionAtNewLine = this.position, K;
354
354
  case 13: {
355
355
  let n = e.charCodeAt(t + 1);
356
- n !== G && n !== 133 || (this.i = t + 2);
356
+ n !== K && n !== 133 || (this.i = t + 2);
357
357
  }
358
358
  case 133:
359
- case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, U;
359
+ case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, W;
360
360
  default: return this.fail("disallowed character."), n;
361
361
  }
362
362
  }
@@ -366,7 +366,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
366
366
  }
367
367
  getCodeNorm() {
368
368
  let e = this.getCode();
369
- return e === U ? G : e;
369
+ return e === W ? K : e;
370
370
  }
371
371
  unGet() {
372
372
  this.i = this.prevI, this.column--;
@@ -374,8 +374,8 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
374
374
  captureTo(e) {
375
375
  let { i: t } = this, { chunk: n } = this;
376
376
  for (;;) {
377
- let r = this.getCode(), i = r === U, a = i ? G : r;
378
- if (a === H || e.includes(a)) return this.text += n.slice(t, this.prevI), a;
377
+ let r = this.getCode(), i = r === W, a = i ? K : r;
378
+ if (a === U || e.includes(a)) return this.text += n.slice(t, this.prevI), a;
379
379
  i && (this.text += `${n.slice(t, this.prevI)}\n`, t = this.i);
380
380
  }
381
381
  }
@@ -384,10 +384,10 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
384
384
  for (;;) {
385
385
  let r = this.getCode();
386
386
  switch (r) {
387
- case U:
388
- this.text += `${n.slice(t, this.prevI)}\n`, t = this.i, r = G;
387
+ case W:
388
+ this.text += `${n.slice(t, this.prevI)}\n`, t = this.i, r = K;
389
389
  break;
390
- case H: return this.text += n.slice(t), !1;
390
+ case U: return this.text += n.slice(t), !1;
391
391
  }
392
392
  if (r === e) return this.text += n.slice(t, this.prevI), !0;
393
393
  }
@@ -396,18 +396,18 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
396
396
  let { chunk: e, i: t } = this;
397
397
  for (;;) {
398
398
  let n = this.getCode();
399
- if (n === H) return this.name += e.slice(t), H;
400
- if (!ke(n)) return this.name += e.slice(t, this.prevI), n === U ? G : n;
399
+ if (n === U) return this.name += e.slice(t), U;
400
+ if (!je(n)) return this.name += e.slice(t, this.prevI), n === W ? K : n;
401
401
  }
402
402
  }
403
403
  skipSpaces() {
404
404
  for (;;) {
405
405
  let e = this.getCodeNorm();
406
- if (e === H || !z(e)) return e;
406
+ if (e === U || !B(e)) return e;
407
407
  }
408
408
  }
409
409
  setXMLVersion(e) {
410
- this.currentXMLVersion = e, e === "1.0" ? (this.isChar = Oe, this.getCode = this.getCode10) : (this.isChar = je, this.getCode = this.getCode11);
410
+ this.currentXMLVersion = e, e === "1.0" ? (this.isChar = Ae, this.getCode = this.getCode10) : (this.isChar = Ne, this.getCode = this.getCode11);
411
411
  }
412
412
  sBegin() {
413
413
  this.chunk.charCodeAt(0) === 65279 && (this.i++, this.column++), this.state = 1;
@@ -415,21 +415,21 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
415
415
  sBeginWhitespace() {
416
416
  let e = this.i, t = this.skipSpaces();
417
417
  switch (this.prevI !== e && (this.xmlDeclPossible = !1), t) {
418
- case Be:
418
+ case He:
419
419
  if (this.state = 15, this.text.length !== 0) throw Error("no-empty text at start");
420
420
  break;
421
- case H: break;
422
- default: this.unGet(), this.state = W, this.xmlDeclPossible = !1;
421
+ case U: break;
422
+ default: this.unGet(), this.state = G, this.xmlDeclPossible = !1;
423
423
  }
424
424
  }
425
425
  sDoctype() {
426
- let e = this.captureTo(Ue);
426
+ let e = this.captureTo(Ke);
427
427
  switch (e) {
428
428
  case q:
429
- this.doctypeHandler?.(this.text), this.text = "", this.state = W, this.doctype = !0;
429
+ this.doctypeHandler?.(this.text), this.text = "", this.state = G, this.doctype = !0;
430
430
  break;
431
- case H: break;
432
- default: this.text += String.fromCodePoint(e), e === 91 ? this.state = 4 : Ve(e) && (this.state = 3, this.q = e);
431
+ case U: break;
432
+ default: this.text += String.fromCodePoint(e), e === 91 ? this.state = 4 : We(e) && (this.state = 3, this.q = e);
433
433
  }
434
434
  }
435
435
  sDoctypeQuote() {
@@ -437,8 +437,8 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
437
437
  this.captureToChar(e) && (this.text += String.fromCodePoint(e), this.q = null, this.state = 2);
438
438
  }
439
439
  sDTD() {
440
- let e = this.captureTo(We);
441
- e !== H && (this.text += String.fromCodePoint(e), e === Y ? this.state = 2 : e === Be ? this.state = 6 : Ve(e) && (this.state = 5, this.q = e));
440
+ let e = this.captureTo(qe);
441
+ e !== U && (this.text += String.fromCodePoint(e), e === Y ? this.state = 2 : e === He ? this.state = 6 : We(e) && (this.state = 5, this.q = e));
442
442
  }
443
443
  sDTDQuoted() {
444
444
  let e = this.q;
@@ -484,22 +484,22 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
484
484
  sEntity() {
485
485
  let { i: e } = this, { chunk: t } = this;
486
486
  t: for (;;) switch (this.getCode()) {
487
- case U:
487
+ case W:
488
488
  this.entity += `${t.slice(e, this.prevI)}\n`, e = this.i;
489
489
  break;
490
490
  case 59: {
491
491
  let { entityReturnState: n } = this, r = this.entity + t.slice(e, this.prevI), i;
492
- this.state = n, r === "" ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(r), this.entity = ""), n === W && this.textHandler === void 0 || (this.text += i);
492
+ this.state = n, r === "" ? (this.fail("empty entity name."), i = "&;") : (i = this.parseEntity(r), this.entity = ""), n === G && this.textHandler === void 0 || (this.text += i);
493
493
  break t;
494
494
  }
495
- case H:
495
+ case U:
496
496
  this.entity += t.slice(e);
497
497
  break t;
498
498
  }
499
499
  }
500
500
  sOpenWaka() {
501
501
  let e = this.getCode();
502
- if (B(e)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
502
+ if (V(e)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
503
503
  else switch (e) {
504
504
  case 47:
505
505
  this.state = 43, this.xmlDeclPossible = !1;
@@ -510,7 +510,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
510
510
  case J:
511
511
  this.state = 23;
512
512
  break;
513
- default: this.fail("disallowed character in tag name"), this.state = W, this.xmlDeclPossible = !1;
513
+ default: this.fail("disallowed character in tag name"), this.state = G, this.xmlDeclPossible = !1;
514
514
  }
515
515
  }
516
516
  sOpenWakaBang() {
@@ -536,7 +536,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
536
536
  }
537
537
  sCommentEnded() {
538
538
  let e = this.getCodeNorm();
539
- e === q ? this.state = W : (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(e)}`, this.state = 17);
539
+ e === q ? this.state = G : (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(e)}`, this.state = 17);
540
540
  }
541
541
  sCData() {
542
542
  this.captureToChar(Y) && (this.state = 21);
@@ -549,7 +549,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
549
549
  let e = this.getCodeNorm();
550
550
  switch (e) {
551
551
  case q:
552
- this.cdataHandler?.(this.text), this.text = "", this.state = W;
552
+ this.cdataHandler?.(this.text), this.text = "", this.state = G;
553
553
  break;
554
554
  case Y:
555
555
  this.text += "]";
@@ -559,17 +559,17 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
559
559
  }
560
560
  sPIFirstChar() {
561
561
  let e = this.getCodeNorm();
562
- this.nameStartCheck(e) ? (this.piTarget += String.fromCodePoint(e), this.state = 24) : e === J || z(e) ? (this.fail("processing instruction without a target."), this.state = e === J ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(e), this.state = 24);
562
+ this.nameStartCheck(e) ? (this.piTarget += String.fromCodePoint(e), this.state = 24) : e === J || B(e) ? (this.fail("processing instruction without a target."), this.state = e === J ? 26 : 25) : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(e), this.state = 24);
563
563
  }
564
564
  sPIRest() {
565
565
  let { chunk: e, i: t } = this;
566
566
  for (;;) {
567
567
  let n = this.getCodeNorm();
568
- if (n === H) return void (this.piTarget += e.slice(t));
568
+ if (n === U) return void (this.piTarget += e.slice(t));
569
569
  if (!this.nameCheck(n)) {
570
570
  this.piTarget += e.slice(t, this.prevI);
571
571
  let r = n === J;
572
- r || z(n) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = r ? ze : 27) : this.state = r ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(n));
572
+ r || B(n) ? this.piTarget === "xml" ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = r ? Ve : 27) : this.state = r ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(n));
573
573
  break;
574
574
  }
575
575
  }
@@ -577,7 +577,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
577
577
  sPIBody() {
578
578
  if (this.text.length === 0) {
579
579
  let e = this.getCodeNorm();
580
- e === J ? this.state = 26 : z(e) || (this.text = String.fromCodePoint(e));
580
+ e === J ? this.state = 26 : B(e) || (this.text = String.fromCodePoint(e));
581
581
  } else this.captureToChar(J) && (this.state = 26);
582
582
  }
583
583
  sPIEnding() {
@@ -587,18 +587,18 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
587
587
  e.toLowerCase() === "xml" && this.fail("the XML declaration must appear at the start of the document."), this.piHandler?.({
588
588
  target: e,
589
589
  body: this.text
590
- }), this.piTarget = this.text = "", this.state = W;
590
+ }), this.piTarget = this.text = "", this.state = G;
591
591
  } else e === J ? this.text += "?" : (this.text += `?${String.fromCodePoint(e)}`, this.state = 25);
592
592
  this.xmlDeclPossible = !1;
593
593
  }
594
594
  sXMLDeclNameStart() {
595
595
  let e = this.skipSpaces();
596
- e === J ? this.state = ze : e !== H && (this.state = 28, this.name = String.fromCodePoint(e));
596
+ e === J ? this.state = Ve : e !== U && (this.state = 28, this.name = String.fromCodePoint(e));
597
597
  }
598
598
  sXMLDeclName() {
599
- let e = this.captureTo(Ge);
600
- if (e === J) return this.state = ze, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
601
- if (z(e) || e === K) {
599
+ let e = this.captureTo(Je);
600
+ if (e === J) return this.state = Ve, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
601
+ if (B(e) || e === Ue) {
602
602
  if (this.name += this.text, this.text = "", !this.xmlDeclExpects.includes(this.name)) switch (this.name.length) {
603
603
  case 0:
604
604
  this.fail("did not expect any more name/value pairs.");
@@ -608,23 +608,23 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
608
608
  break;
609
609
  default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
610
610
  }
611
- this.state = e === K ? 30 : 29;
611
+ this.state = e === Ue ? 30 : 29;
612
612
  }
613
613
  }
614
614
  sXMLDeclEq() {
615
615
  let e = this.getCodeNorm();
616
- if (e === J) return this.state = ze, void this.fail("XML declaration is incomplete.");
617
- z(e) || (e !== K && this.fail("value required."), this.state = 30);
616
+ if (e === J) return this.state = Ve, void this.fail("XML declaration is incomplete.");
617
+ B(e) || (e !== Ue && this.fail("value required."), this.state = 30);
618
618
  }
619
619
  sXMLDeclValueStart() {
620
620
  let e = this.getCodeNorm();
621
- if (e === J) return this.state = ze, void this.fail("XML declaration is incomplete.");
622
- z(e) || (Ve(e) ? this.q = e : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
621
+ if (e === J) return this.state = Ve, void this.fail("XML declaration is incomplete.");
622
+ B(e) || (We(e) ? this.q = e : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
623
623
  }
624
624
  sXMLDeclValue() {
625
625
  let e = this.captureTo([this.q, J]);
626
- if (e === J) return this.state = ze, this.text = "", void this.fail("XML declaration is incomplete.");
627
- if (e === H) return;
626
+ if (e === J) return this.state = Ve, this.text = "", void this.fail("XML declaration is incomplete.");
627
+ if (e === U) return;
628
628
  let t = this.text;
629
629
  switch (this.text = "", this.name) {
630
630
  case "version": {
@@ -642,14 +642,14 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
642
642
  }
643
643
  sXMLDeclSeparator() {
644
644
  let e = this.getCodeNorm();
645
- e === J ? this.state = ze : (z(e) || (this.fail("whitespace required."), this.unGet()), this.state = 27);
645
+ e === J ? this.state = Ve : (B(e) || (this.fail("whitespace required."), this.unGet()), this.state = 27);
646
646
  }
647
647
  sXMLDeclEnding() {
648
- this.getCodeNorm() === q ? (this.piTarget === "xml" ? this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version.") : this.fail("processing instructions are not allowed before root."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = W) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
648
+ this.getCodeNorm() === q ? (this.piTarget === "xml" ? this.name !== "version" && this.xmlDeclExpects.includes("version") && this.fail("XML declaration must contain a version.") : this.fail("processing instructions are not allowed before root."), this.xmlDeclHandler?.(this.xmlDecl), this.name = "", this.piTarget = this.text = "", this.state = G) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
649
649
  }
650
650
  sOpenTag() {
651
651
  let e = this.captureNameChars();
652
- if (e === H) return;
652
+ if (e === U) return;
653
653
  let t = this.tag = {
654
654
  name: this.name,
655
655
  attributes: Object.create(null)
@@ -661,7 +661,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
661
661
  case 47:
662
662
  this.state = 35;
663
663
  break;
664
- default: z(e) || this.fail("disallowed character in tag name."), this.state = 36;
664
+ default: B(e) || this.fail("disallowed character in tag name."), this.state = 36;
665
665
  }
666
666
  }
667
667
  sOpenTagSlash() {
@@ -669,25 +669,25 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
669
669
  }
670
670
  sAttrib() {
671
671
  let e = this.skipSpaces();
672
- e !== H && (B(e) ? (this.unGet(), this.state = 37) : e === q ? this.openTag() : e === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
672
+ e !== U && (V(e) ? (this.unGet(), this.state = 37) : e === q ? this.openTag() : e === 47 ? this.state = 35 : this.fail("disallowed character in attribute name."));
673
673
  }
674
674
  sAttribName() {
675
675
  let e = this.captureNameChars();
676
- e === K ? this.state = 39 : z(e) ? this.state = 38 : e === q ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : e !== H && this.fail("disallowed character in attribute name.");
676
+ e === Ue ? this.state = 39 : B(e) ? this.state = 38 : e === q ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : e !== U && this.fail("disallowed character in attribute name.");
677
677
  }
678
678
  sAttribNameSawWhite() {
679
679
  let e = this.skipSpaces();
680
680
  switch (e) {
681
- case H: return;
682
- case K:
681
+ case U: return;
682
+ case Ue:
683
683
  this.state = 39;
684
684
  break;
685
- default: this.fail("attribute without value."), this.text = "", this.name = "", e === q ? this.openTag() : B(e) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
685
+ default: this.fail("attribute without value."), this.text = "", this.name = "", e === q ? this.openTag() : V(e) ? (this.unGet(), this.state = 37) : (this.fail("disallowed character in attribute name."), this.state = 36);
686
686
  }
687
687
  }
688
688
  sAttribValue() {
689
689
  let e = this.getCodeNorm();
690
- Ve(e) ? (this.q = e, this.state = 40) : z(e) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
690
+ We(e) ? (this.q = e, this.state = 40) : B(e) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
691
691
  }
692
692
  sAttribValueQuoted() {
693
693
  let { q: e, chunk: t } = this, { i: n } = this;
@@ -698,53 +698,53 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
698
698
  case 38:
699
699
  this.text += t.slice(n, this.prevI), this.state = 14, this.entityReturnState = 40;
700
700
  return;
701
- case G:
702
- case U:
701
+ case K:
702
+ case W:
703
703
  case 9:
704
704
  this.text += `${t.slice(n, this.prevI)} `, n = this.i;
705
705
  break;
706
- case Be:
706
+ case He:
707
707
  this.text += t.slice(n, this.prevI), this.fail("disallowed character.");
708
708
  return;
709
- case H:
709
+ case U:
710
710
  this.text += t.slice(n);
711
711
  return;
712
712
  }
713
713
  }
714
714
  sAttribValueClosed() {
715
715
  let e = this.getCodeNorm();
716
- z(e) ? this.state = 36 : e === q ? this.openTag() : e === 47 ? this.state = 35 : B(e) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
716
+ B(e) ? this.state = 36 : e === q ? this.openTag() : e === 47 ? this.state = 35 : V(e) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
717
717
  }
718
718
  sAttribValueUnquoted() {
719
- let e = this.captureTo(Ke);
719
+ let e = this.captureTo(Ye);
720
720
  switch (e) {
721
721
  case 38:
722
722
  this.state = 14, this.entityReturnState = 42;
723
723
  break;
724
- case Be:
724
+ case He:
725
725
  this.fail("disallowed character.");
726
726
  break;
727
- case H: break;
727
+ case U: break;
728
728
  default: this.text.includes("]]>") && this.fail("the string \"]]>\" is disallowed in char data."), this.pushAttrib(this.name, this.text), this.name = this.text = "", e === q ? this.openTag() : this.state = 36;
729
729
  }
730
730
  }
731
731
  sCloseTag() {
732
732
  let e = this.captureNameChars();
733
- e === q ? this.closeTag() : z(e) ? this.state = 44 : e !== H && this.fail("disallowed character in closing tag.");
733
+ e === q ? this.closeTag() : B(e) ? this.state = 44 : e !== U && this.fail("disallowed character in closing tag.");
734
734
  }
735
735
  sCloseTagSawWhite() {
736
736
  switch (this.skipSpaces()) {
737
737
  case q:
738
738
  this.closeTag();
739
739
  break;
740
- case H: break;
740
+ case U: break;
741
741
  default: this.fail("disallowed character in closing tag.");
742
742
  }
743
743
  }
744
744
  handleTextInRoot() {
745
745
  let { i: e, forbiddenState: t } = this, { chunk: n, textHandler: r } = this;
746
746
  t: for (;;) switch (this.getCode()) {
747
- case Be:
747
+ case He:
748
748
  if (this.state = 15, r !== void 0) {
749
749
  let { text: t } = this, i = n.slice(e, this.prevI);
750
750
  t.length === 0 ? i.length !== 0 && r(i) : (r(t + i), this.text = "");
@@ -752,7 +752,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
752
752
  t = 0;
753
753
  break t;
754
754
  case 38:
755
- this.state = 14, this.entityReturnState = W, r !== void 0 && (this.text += n.slice(e, this.prevI)), t = 0;
755
+ this.state = 14, this.entityReturnState = G, r !== void 0 && (this.text += n.slice(e, this.prevI)), t = 0;
756
756
  break t;
757
757
  case Y:
758
758
  switch (t) {
@@ -769,10 +769,10 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
769
769
  case q:
770
770
  t === 2 && this.fail("the string \"]]>\" is disallowed in char data."), t = 0;
771
771
  break;
772
- case U:
772
+ case W:
773
773
  r !== void 0 && (this.text += `${n.slice(e, this.prevI)}\n`), e = this.i, t = 0;
774
774
  break;
775
- case H:
775
+ case U:
776
776
  r !== void 0 && (this.text += n.slice(e));
777
777
  break t;
778
778
  default: t = 0;
@@ -784,22 +784,22 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
784
784
  t: for (;;) {
785
785
  let i = this.getCode();
786
786
  switch (i) {
787
- case Be:
787
+ case He:
788
788
  if (this.state = 15, n !== void 0) {
789
789
  let { text: r } = this, i = t.slice(e, this.prevI);
790
790
  r.length === 0 ? i.length !== 0 && n(i) : (n(r + i), this.text = "");
791
791
  }
792
792
  break t;
793
793
  case 38:
794
- this.state = 14, this.entityReturnState = W, n !== void 0 && (this.text += t.slice(e, this.prevI)), r = !0;
794
+ this.state = 14, this.entityReturnState = G, n !== void 0 && (this.text += t.slice(e, this.prevI)), r = !0;
795
795
  break t;
796
- case U:
796
+ case W:
797
797
  n !== void 0 && (this.text += `${t.slice(e, this.prevI)}\n`), e = this.i;
798
798
  break;
799
- case H:
799
+ case U:
800
800
  n !== void 0 && (this.text += t.slice(e));
801
801
  break t;
802
- default: z(i) || (r = !0);
802
+ default: B(i) || (r = !0);
803
803
  }
804
804
  }
805
805
  r && (this.sawRoot || this.reportedTextBeforeRoot || (this.fail("text data outside of root node."), this.reportedTextBeforeRoot = !0), this.closedRoot && !this.reportedTextAfterRoot && (this.fail("text data outside of root node."), this.reportedTextAfterRoot = !0));
@@ -813,10 +813,10 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
813
813
  };
814
814
  if (this.attribList.push(i), this.attributeHandler?.(i), n === "xmlns") {
815
815
  let e = t.trim();
816
- this.currentXMLVersion === "1.0" && e === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[r] = e, qe(this, r, e);
816
+ this.currentXMLVersion === "1.0" && e === "" && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[r] = e, Xe(this, r, e);
817
817
  } else if (e === "xmlns") {
818
818
  let e = t.trim();
819
- this.topNS[""] = e, qe(this, "", e);
819
+ this.topNS[""] = e, Xe(this, "", e);
820
820
  }
821
821
  }
822
822
  pushAttribPlain(e, t) {
@@ -833,7 +833,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
833
833
  let t = e.pop();
834
834
  this.fail(`unclosed tag: ${t.name}`);
835
835
  }
836
- this.state !== 0 && this.state !== W && this.fail("unexpected end.");
836
+ this.state !== 0 && this.state !== G && this.fail("unexpected end.");
837
837
  let { text: t } = this;
838
838
  return t.length !== 0 && (this.textHandler?.(t), this.text = ""), this._closed = !0, this.endHandler?.(), this._init(), this;
839
839
  }
@@ -868,7 +868,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
868
868
  let { attributes: n } = t, r = /* @__PURE__ */ new Set();
869
869
  for (let t of e) {
870
870
  let { name: e, prefix: i, local: a } = t, o, s;
871
- i === "" ? (o = e === "xmlns" ? Ie : "", s = e) : (o = this.resolve(i), o === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`), o = i), s = `{${o}}${a}`), r.has(s) && this.fail(`duplicate attribute: ${s}.`), r.add(s), t.uri = o, n[e] = t;
871
+ i === "" ? (o = e === "xmlns" ? Re : "", s = e) : (o = this.resolve(i), o === void 0 && (this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`), o = i), s = `{${o}}${a}`), r.has(s) && this.fail(`duplicate attribute: ${s}.`), r.add(s), t.uri = o, n[e] = t;
872
872
  }
873
873
  this.attribList = [];
874
874
  }
@@ -880,16 +880,16 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
880
880
  openTag() {
881
881
  this.processAttribs();
882
882
  let { tags: e } = this, t = this.tag;
883
- t.isSelfClosing = !1, this.openTagHandler?.(t), e.push(t), this.state = W, this.name = "";
883
+ t.isSelfClosing = !1, this.openTagHandler?.(t), e.push(t), this.state = G, this.name = "";
884
884
  }
885
885
  openSelfClosingTag() {
886
886
  this.processAttribs();
887
887
  let { tags: e } = this, t = this.tag;
888
- t.isSelfClosing = !0, this.openTagHandler?.(t), this.closeTagHandler?.(t), (this.tag = e[e.length - 1] ?? null) === null && (this.closedRoot = !0), this.state = W, this.name = "";
888
+ t.isSelfClosing = !0, this.openTagHandler?.(t), this.closeTagHandler?.(t), (this.tag = e[e.length - 1] ?? null) === null && (this.closedRoot = !0), this.state = G, this.name = "";
889
889
  }
890
890
  closeTag() {
891
891
  let { tags: e, name: t } = this;
892
- if (this.state = W, this.name = "", t === "") return this.fail("weird empty close tag."), void (this.text += "</>");
892
+ if (this.state = G, this.name = "", t === "") return this.fail("weird empty close tag."), void (this.text += "</>");
893
893
  let n = this.closeTagHandler, r = e.length;
894
894
  for (; r-- > 0;) {
895
895
  let r = this.tag = e.pop();
@@ -907,7 +907,7 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
907
907
  return e[1] === "x" && /^#x[0-9a-f]+$/i.test(e) ? t = parseInt(e.slice(2), 16) : /^#[0-9]+$/.test(e) && (t = parseInt(e.slice(1), 10)), this.isChar(t) ? String.fromCodePoint(t) : (this.fail("malformed character entity."), `&${e};`);
908
908
  }
909
909
  };
910
- (Ye = Je ||= {}).Events = {
910
+ (Qe = Ze ||= {}).Events = {
911
911
  XmlDecl: "xmldecl",
912
912
  Text: "text",
913
913
  ProcessingInstruction: "processinginstruction",
@@ -921,14 +921,14 @@ var Je, Ye, Xe = (e) => Pe.test(e), Ze = (e) => Ae.test(e), Qe = {
921
921
  Error: "error",
922
922
  End: "end",
923
923
  Ready: "ready"
924
- }, Ye.parseStream = async (e, t, n) => {
925
- let r = new $e({
924
+ }, Qe.parseStream = async (e, t, n) => {
925
+ let r = new nt({
926
926
  position: !1,
927
927
  ...n
928
928
  }), i;
929
- t.onOpenTagStart && r.on(Je.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && r.on(Je.Events.OpenTag, t.onOpenTag), t.onCloseTag && r.on(Je.Events.CloseTag, t.onCloseTag), t.onAttribute && r.on(Je.Events.Attribute, t.onAttribute), t.onText && r.on(Je.Events.Text, t.onText), t.onError && r.on(Je.Events.Error, t.onError);
929
+ t.onOpenTagStart && r.on(Ze.Events.OpenTagStart, t.onOpenTagStart), t.onOpenTag && r.on(Ze.Events.OpenTag, t.onOpenTag), t.onCloseTag && r.on(Ze.Events.CloseTag, t.onCloseTag), t.onAttribute && r.on(Ze.Events.Attribute, t.onAttribute), t.onText && r.on(Ze.Events.Text, t.onText), t.onError && r.on(Ze.Events.Error, t.onError);
930
930
  let a = t.onEnd;
931
- for (a && r.on(Je.Events.End, () => {
931
+ for (a && r.on(Ze.Events.End, () => {
932
932
  i = a();
933
933
  });;) {
934
934
  let { value: t, done: n } = await e.read();
@@ -943,7 +943,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
943
943
  }, Q = (e) => {
944
944
  let t = parseFloat(e);
945
945
  return isNaN(t) ? null : t;
946
- }, $ = null, et = class {
946
+ }, $ = null, rt = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), it = (e) => rt(e).replace(/"/g, "&quot;"), at = class {
947
947
  constructor() {
948
948
  this._registeredVisitors = /* @__PURE__ */ new Map();
949
949
  }
@@ -955,7 +955,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
955
955
  key: null,
956
956
  source: e,
957
957
  parent: null
958
- }, f = null, p = !1, m = (e, t) => {
958
+ }, f = null, p = !1, m = null, h = null, g = null, _ = (e, t) => {
959
959
  let n = c.attributes[e];
960
960
  if (t) {
961
961
  if (Array.isArray(t)) {
@@ -964,7 +964,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
964
964
  } else if (n == null || (n = t(n), n == null)) return;
965
965
  }
966
966
  return n;
967
- }, h = {
967
+ }, v = {
968
968
  getSource: () => f?.source ?? null,
969
969
  setSource: (e) => {
970
970
  f.source = e;
@@ -973,8 +973,8 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
973
973
  f.key = e;
974
974
  },
975
975
  getFrom: () => c,
976
- getAttribute: (e, t) => m(e, t) ?? null,
977
- hasAttribute: (e) => h.getAttribute(e) !== null,
976
+ getAttribute: (e, t) => _(e, t) ?? null,
977
+ hasAttribute: (e) => v.getAttribute(e) !== null,
978
978
  getParent: () => {
979
979
  let e = u[u.length - 2];
980
980
  return e.parent ?? e.source;
@@ -984,13 +984,14 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
984
984
  for (let n = 0; n < t; n++) e.push(a[n].local);
985
985
  return e.join("\\");
986
986
  },
987
- parseAttribute: m,
987
+ parseAttribute: _,
988
+ getRawXml: () => g,
988
989
  copyToObject: (e, t, n, r) => {
989
- let i = m(r ?? t, n);
990
+ let i = _(r ?? t, n);
990
991
  i !== void 0 && (e[t] = i);
991
992
  },
992
993
  copyTo: (e, t, n) => {
993
- let r = m(n ?? e, t);
994
+ let r = _(n ?? e, t);
994
995
  r !== void 0 && (f.source[e] = r);
995
996
  },
996
997
  warn: (e) => {
@@ -1000,49 +1001,65 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1000
1001
  return {
1001
1002
  onOpenTag: (e) => {
1002
1003
  let t = e.name, n = t.indexOf(":");
1003
- n !== -1 && (t = t.slice(n + 1));
1004
- let m = (i.length > 0 ? i[i.length - 1] : r).get(t);
1004
+ if (n !== -1 && (t = t.slice(n + 1)), m) return m.push(((e) => {
1005
+ let t = e.attributes ?? {}, n = `<${e.name}`;
1006
+ for (let e in t) {
1007
+ let r = t[e];
1008
+ n += ` ${e}="${it(typeof r == "string" ? r : r?.value ?? "")}"`;
1009
+ }
1010
+ return n + ">";
1011
+ })(e)), o = {
1012
+ local: t,
1013
+ tag: e,
1014
+ destination: null
1015
+ }, a.push(o), s = t, void (c = e);
1016
+ let g = (i.length > 0 ? i[i.length - 1] : r).get(t);
1005
1017
  if (o = {
1006
1018
  local: t,
1007
- visitor: m,
1019
+ visitor: g,
1008
1020
  tag: e,
1009
1021
  destination: null
1010
1022
  }, p) return a.push(o), s = t, void (c = e);
1011
1023
  l = o?.visitor ?? null, s = t, c = e;
1012
- let g = !!m && m.to === null;
1013
- if (m && !g && m.scope) {
1014
- let e = m.scope(h);
1015
- e === null ? g = !0 : e && (i.push(e), o.pushedScope = !0);
1024
+ let _ = !!g && g.to === null;
1025
+ if (g && !_ && g.scope) {
1026
+ let e = g.scope(v);
1027
+ e === null ? _ = !0 : e && (i.push(e), o.pushedScope = !0);
1016
1028
  }
1017
- m && (a.length === 0 ? (f = d, o.destination = f, o.pushedDestination = !0, u.push(f)) : g ? (f = null, o.destination = null) : m.transparent ? o.destination = f : (f = {
1029
+ g && (a.length === 0 ? (f = d, o.destination = f, o.pushedDestination = !0, u.push(f)) : _ ? (f = null, o.destination = null) : g.transparent ? o.destination = f : (f = {
1018
1030
  key: null,
1019
1031
  source: {},
1020
1032
  parent: null
1021
- }, o.destination = f, o.pushedDestination = !0, u.push(f))), a.push(o), p = g;
1022
- let _ = l?.openTag?.(h);
1023
- _ !== void 0 && (f.parent = _);
1033
+ }, o.destination = f, o.pushedDestination = !0, u.push(f))), a.push(o), p = _;
1034
+ let y = l?.openTag?.(v);
1035
+ y !== void 0 && (f.parent = y), g?.raw && !_ && (m = [], h = o);
1024
1036
  },
1025
1037
  onCloseTag: (e) => {
1026
1038
  let t = e.name, r = t.indexOf(":");
1027
1039
  if (r !== -1 && (t = t.slice(r + 1)), t !== s) throw Error(`mismatch open/close tag: '${t}'/'${s}'`);
1028
- p || l?.closeTag?.(h);
1029
- let m = a.pop() ?? null;
1030
- o = a[a.length - 1] ?? null, m?.pushedScope && i.pop();
1031
- let g = m?.destination;
1032
- if (g && m.pushedDestination) {
1040
+ let _ = !1;
1041
+ if (m) {
1042
+ if (a[a.length - 1] !== h) return m.push(`</${e.name}>`), a.pop(), o = a[a.length - 1] ?? null, s = o?.local ?? null, void (c = o?.tag ?? null);
1043
+ g = m.join(""), m = null, h = null, _ = !0;
1044
+ }
1045
+ p || l?.closeTag?.(v), _ && (g = null);
1046
+ let y = a.pop() ?? null;
1047
+ o = a[a.length - 1] ?? null, y?.pushedScope && i.pop();
1048
+ let ee = y?.destination;
1049
+ if (ee && y.pushedDestination) {
1033
1050
  u.pop(), f = u[u.length - 1] ?? d;
1034
- let e = m.visitor;
1035
- e && e.to && g.source !== void 0 && (Array.isArray(e.to) ? f.source.push ? f.source.push(g.source) : n?.(`Unable to parse array for ${e.from} at ${h.getPath()}`) : g.key ? f.source[g.key] = g.source : typeof e.to == "string" && (f.source[e.to] = g.source));
1051
+ let e = y.visitor;
1052
+ e && e.to && ee.source !== void 0 && (Array.isArray(e.to) ? f.source.push ? f.source.push(ee.source) : n?.(`Unable to parse array for ${e.from} at ${v.getPath()}`) : ee.key ? f.source[ee.key] = ee.source : typeof e.to == "string" && (f.source[e.to] = ee.source));
1036
1053
  }
1037
1054
  s = o?.local ?? null, c = o?.tag ?? null, l = o?.visitor ?? null, p = !o?.destination;
1038
1055
  },
1039
1056
  onText: (e) => {
1040
- l?.text?.(e, h);
1057
+ m ? m.push(rt(e)) : l?.text?.(e, v);
1041
1058
  },
1042
1059
  onEnd: t
1043
1060
  };
1044
1061
  }
1045
- }, tt = `IFERROR(${d}(`, nt = tt.toUpperCase(), rt = g.toUpperCase(), it = { kind: "none" }, at = { kind: "spilled" }, ot = (e, t) => {
1062
+ }, ot = `IFERROR(${y}(`, st = ot.toUpperCase(), ct = b.toUpperCase(), lt = { kind: "none" }, ut = { kind: "spilled" }, dt = (e, t) => {
1046
1063
  if (e.charCodeAt(t) !== 34) return null;
1047
1064
  let n = "", r = t + 1;
1048
1065
  for (; r < e.length;) if (e.charCodeAt(r) === 34) {
@@ -1053,12 +1070,12 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1053
1070
  n += "\"", r += 2;
1054
1071
  } else n += e[r], r++;
1055
1072
  return null;
1056
- }, st = (e) => {
1073
+ }, ft = (e) => {
1057
1074
  let t = [], n = 0;
1058
1075
  for (; n < e.length;) {
1059
1076
  let r = e.charCodeAt(n);
1060
1077
  if (r === 34) {
1061
- let t = ot(e, n);
1078
+ let t = dt(e, n);
1062
1079
  if (t === null) break;
1063
1080
  n = t.end;
1064
1081
  continue;
@@ -1076,7 +1093,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1076
1093
  e.charCodeAt(i) === 40 && t.push(e.slice(n, i).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), n = i;
1077
1094
  }
1078
1095
  return t;
1079
- }, ct = (e) => {
1096
+ }, pt = (e) => {
1080
1097
  let t = 0, n = 0;
1081
1098
  for (let r = 0; r < e.length; r++) {
1082
1099
  let i = e[r];
@@ -1102,7 +1119,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1102
1119
  }
1103
1120
  }
1104
1121
  return t === 0 && n === 0;
1105
- }, lt = class {
1122
+ }, mt = class {
1106
1123
  static {
1107
1124
  this.Collapsed = 1;
1108
1125
  }
@@ -1139,146 +1156,146 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1139
1156
  static {
1140
1157
  this.ThickTop = 2048;
1141
1158
  }
1142
- }, ut = (e, t, n) => {
1159
+ }, ht = (e, t, n) => {
1143
1160
  if (e[0].value[0] === e[1].value[0]) return t;
1144
- }, dt = {
1161
+ }, gt = {
1145
1162
  colStart: 0,
1146
1163
  colEnd: 0,
1147
1164
  rowStart: 0,
1148
1165
  rowEnd: 0
1149
- }, ft = (e, t, n, r, i, a, o) => {
1150
- let s = !1, c = !1, l = [], u = !1, d = null, f = null, m = null, h = null, g = null, _ = null, v = o?.get("richData") ?? pe.EmptyArray, ee = o?.get("dummyWrapped") ?? null, te = w.normalizeA1ToR1C1, ne = T.createConflatingRanges(), re = /* @__PURE__ */ new Map(), ie = [], ae = !1, oe = !1, se = null, ce = !1, le = T.createConflatingRanges(), ue = !1, y = -1, b = -1, x = null, S = null, de = null, C = [], fe = null, D = -2, O = 0, k = "", he = "", ge = "", _e = "", ve = "", A = "", j = "", ye = "", M = "", be = "", N = "", xe = "", Se = "", Ce = "", P = !0, F = null, I = !1, we = !1, L = null, Te = 0;
1166
+ }, _t = (e, t, n, i, a, o, s) => {
1167
+ let c = !1, l = !1, u = [], d = !1, f = null, p = null, m = null, h = null, g = null, _ = null, v = s?.get("richData") ?? fe.EmptyArray, y = s?.get("dummyWrapped") ?? null, ee = O.normalizeA1ToR1C1, b = k.createConflatingRanges(), te = /* @__PURE__ */ new Map(), ne = [], re = !1, ie = !1, ae = null, oe = !1, se = k.createConflatingRanges(), ce = !1, x = -1, S = -1, C = null, le = null, ue = null, de = [], w = null, T = -2, E = 0, D = "", j = "", M = "", N = "", me = "", he = "", ge = "", _e = "", ve = "", ye = "", be = "", xe = "", Se = "", P = "", F = !0, I = null, Ce = !1, we = !1, L = null, R = 0;
1151
1168
  return {
1152
1169
  ...n,
1153
1170
  onEnd: () => {
1154
- C.length > 0 && (t.rows = w.runsToRefs(C, !1));
1155
- let r = ne.done(ut), i = r.length;
1156
- if (i > 0) {
1171
+ de.length > 0 && (t.rows = O.runsToRefs(de, !1));
1172
+ let i = b.done(ht), a = i.length;
1173
+ if (a > 0) {
1157
1174
  let e = /* @__PURE__ */ new Set();
1158
- for (let t = 0; t < ie.length; t++) e.add(ie[t][0].split(":")[0]);
1159
- let n = Array(i);
1160
- for (let t = 0; t < i; t++) {
1161
- let i = r[t], a = w.rangeToString(i), o = i.value[1], s = w.resolveRelativeToA1(o, i.rowStart, i.colStart);
1162
- s && !e.has(a.split(":")[0]) && ct(s) && (s = `${p}(${s})`), n[t] = [a, s];
1175
+ for (let t = 0; t < ne.length; t++) e.add(ne[t][0].split(":")[0]);
1176
+ let n = Array(a);
1177
+ for (let t = 0; t < a; t++) {
1178
+ let a = i[t], o = O.rangeToString(a), s = a.value[1], c = O.resolveRelativeToA1(s, a.rowStart, a.colStart);
1179
+ c && !e.has(o.split(":")[0]) && pt(c) && (c = `${r}(${c})`), n[t] = [o, c];
1163
1180
  }
1164
1181
  t.formulas = n;
1165
1182
  }
1166
- let a = le.done(!0), o = a.length;
1167
- if (o > 0) {
1168
- let e = Array(o);
1169
- for (let t = 0; t < o; t++) {
1170
- let n = a[t];
1171
- e[t] = w.rangeToString(n);
1183
+ let o = se.done(!0), s = o.length;
1184
+ if (s > 0) {
1185
+ let e = Array(s);
1186
+ for (let t = 0; t < s; t++) {
1187
+ let n = o[t];
1188
+ e[t] = O.rangeToString(n);
1172
1189
  }
1173
1190
  t.volatile = e;
1174
1191
  }
1175
- ie.length > 0 && (t.formulaArray = [...ie]);
1176
- let s = l.length;
1177
- if (s > 0) {
1178
- l.sort(T.createRangeComparator(me.Axis.Column));
1179
- let e = l[0], n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value, o = [];
1192
+ ne.length > 0 && (t.formulaArray = [...ne]);
1193
+ let c = u.length;
1194
+ if (c > 0) {
1195
+ u.sort(k.createRangeComparator(pe.Axis.Column));
1196
+ let e = u[0], n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value, o = [];
1180
1197
  o.push(e);
1181
- let c = null;
1182
- for (let t = 1; t < s; t++) c = l[t], a !== c.value || n !== c.colStart || r !== c.colEnd || i + 1 !== c.rowEnd ? (o.push(c), e = c, n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value) : (i = c.rowEnd, e.rowEnd = i);
1183
- let u = o.length, d = Array(u);
1184
- for (let e = 0; e < u; e++) {
1198
+ let s = null;
1199
+ for (let t = 1; t < c; t++) s = u[t], a !== s.value || n !== s.colStart || r !== s.colEnd || i + 1 !== s.rowEnd ? (o.push(s), e = s, n = e.colStart, r = e.colEnd, i = e.rowEnd, a = e.value) : (i = s.rowEnd, e.rowEnd = i);
1200
+ let l = o.length, d = Array(l);
1201
+ for (let e = 0; e < l; e++) {
1185
1202
  let t = o[e];
1186
- d[e] = [w.rangeToString(t), t.value];
1203
+ d[e] = [O.rangeToString(t), t.value];
1187
1204
  }
1188
1205
  t.directStyles = d;
1189
1206
  }
1190
- let c = e.build();
1191
- c && (t.data = c.tuples), n?.onEnd?.();
1207
+ let l = e.build();
1208
+ l && (t.data = l.tuples), n?.onEnd?.();
1192
1209
  },
1193
1210
  onOpenTag: (e) => {
1194
- let r = e.name, p = r.indexOf(":");
1195
- if (p !== -1 && (r = r.slice(p + 1)), Te++, Te % 196608 == 0 && i?.(Te), S) {
1211
+ let r = e.name, i = r.indexOf(":");
1212
+ if (i !== -1 && (r = r.slice(i + 1)), R++, R % 196608 == 0 && a?.(R), le) {
1196
1213
  let t = e.attributes;
1197
1214
  switch (r) {
1198
1215
  case "v":
1199
- c = !0;
1216
+ l = !0;
1200
1217
  break;
1201
1218
  case "f":
1202
- switch (u = !0, t.t ?? null) {
1219
+ switch (d = !0, t.t ?? null) {
1203
1220
  case null:
1204
1221
  case "normal": break;
1205
1222
  case "shared":
1206
1223
  let e = t.si;
1207
- f = t.ref, d = e;
1224
+ p = t.ref, f = e;
1208
1225
  break;
1209
1226
  case "array":
1210
- f = t.ref, se = f;
1227
+ p = t.ref, ae = p;
1211
1228
  break;
1212
- case "datatable": f = t.ref, u = !0;
1229
+ case "datatable": p = t.ref, d = !0;
1213
1230
  }
1214
1231
  let e = t.ca;
1215
- e !== void 0 && (ce = e === "1");
1232
+ e !== void 0 && (oe = e === "1");
1216
1233
  break;
1217
1234
  case "is":
1218
- ue = !0;
1235
+ ce = !0;
1219
1236
  return;
1220
1237
  }
1221
- ue && !u && a?.onOpenTag?.(e);
1238
+ ce && !d && o?.onOpenTag?.(e);
1222
1239
  return;
1223
1240
  }
1224
- if (s) {
1241
+ if (c) {
1225
1242
  if (r === "c") {
1226
- S = e;
1243
+ le = e;
1227
1244
  let t = e.attributes, n = t.r;
1228
- b = w.fastStringToCol(n);
1245
+ S = O.fastStringToCol(n);
1229
1246
  let r = t.t;
1230
- r === void 0 ? de = null : (de = r, de === "str" && (ue = !0));
1247
+ r === void 0 ? ue = null : (ue = r, ue === "str" && (ce = !0));
1231
1248
  let i = t.s;
1232
- i === void 0 && (L !== null || we) && (i = "0"), i !== void 0 && (i = parseInt(i), F && F.value === i && F.colEnd + 1 === b ? F.colEnd = b : (F = {
1233
- colStart: b,
1234
- rowStart: y,
1235
- colEnd: b,
1236
- rowEnd: y,
1249
+ i === void 0 && (L !== null || we) && (i = "0"), i !== void 0 && (i = parseInt(i), I && I.value === i && I.colEnd + 1 === S ? I.colEnd = S : (I = {
1250
+ colStart: S,
1251
+ rowStart: x,
1252
+ colEnd: S,
1253
+ rowEnd: x,
1237
1254
  value: i
1238
- }, l.push(F))), se = null, oe = !1;
1255
+ }, u.push(I))), ae = null, ie = !1;
1239
1256
  let a = t.cm;
1240
- ae = a !== void 0 && ((e) => {
1241
- let t = o?.get("metadata")?.cells;
1257
+ re = a !== void 0 && ((e) => {
1258
+ let t = s?.get("metadata")?.cells;
1242
1259
  if (!t) return !1;
1243
1260
  let n = parseInt(e, 10);
1244
1261
  return !(!Number.isFinite(n) || n < 1) && !0 === t[n - 1]?.get("XLDAPR")?.fDynamic;
1245
1262
  })(a);
1246
- let s = t.vm;
1247
- if (s !== void 0) {
1248
- let e = v[parseInt(s) - 1];
1249
- if (E.isError(e)) {
1263
+ let o = t.vm;
1264
+ if (o !== void 0) {
1265
+ let e = v[parseInt(o) - 1];
1266
+ if (A.isError(e)) {
1250
1267
  let t = e.getCode();
1251
- x = {
1268
+ C = {
1252
1269
  t: "e",
1253
1270
  v: t
1254
- }, ae && t === E.Code.Spill && (oe = !0);
1271
+ }, re && t === A.Code.Spill && (ie = !0);
1255
1272
  }
1256
1273
  }
1257
1274
  }
1258
1275
  } else {
1259
1276
  if (r === "row") {
1260
- s = !0;
1277
+ c = !0;
1261
1278
  let t = e.attributes.r;
1262
- if (y = parseInt(t) - 1, O = 0, he = e.attributes.customHeight, he !== void 0 && (O |= lt.CustomHeight), he !== M && (P = !0, M = he), k = e.attributes.ht, k !== void 0 && (O |= lt.Ht), k !== ye && (P = !0, ye = k), ge = e.attributes.hidden, ge !== void 0 && (O |= lt.Hidden), ge !== be && (P = !0, be = ge), ve = e.attributes.s, ve !== void 0 && (O |= lt.S), ve !== xe && (P = !0, xe = ve), _e = e.attributes.customFormat, _e !== void 0 && (O |= lt.CustomFormat), _e !== N && (P = !0, N = _e), A = e.attributes.outlineLevel, A !== void 0 && (O |= lt.OutlineLevel), A !== Se && (P = !0, Se = A), j = e.attributes.collapsed, j !== void 0 && (O |= lt.Collapsed), j !== Ce && (P = !0, Ce = j), O !== 0) if (D + 1 !== y || P) {
1263
- let e = he !== void 0 && (he === "1" || he === "true"), t = _e !== void 0 && (_e === "1" || _e === "true");
1264
- L = t && ve !== void 0 ? ve : null, t && L === null && (L = "0"), fe = {
1265
- min: y,
1266
- max: y,
1279
+ if (x = parseInt(t) - 1, E = 0, j = e.attributes.customHeight, j !== void 0 && (E |= mt.CustomHeight), j !== ve && (F = !0, ve = j), D = e.attributes.ht, D !== void 0 && (E |= mt.Ht), D !== _e && (F = !0, _e = D), M = e.attributes.hidden, M !== void 0 && (E |= mt.Hidden), M !== ye && (F = !0, ye = M), me = e.attributes.s, me !== void 0 && (E |= mt.S), me !== xe && (F = !0, xe = me), N = e.attributes.customFormat, N !== void 0 && (E |= mt.CustomFormat), N !== be && (F = !0, be = N), he = e.attributes.outlineLevel, he !== void 0 && (E |= mt.OutlineLevel), he !== Se && (F = !0, Se = he), ge = e.attributes.collapsed, ge !== void 0 && (E |= mt.Collapsed), ge !== P && (F = !0, P = ge), E !== 0) if (T + 1 !== x || F) {
1280
+ let e = j !== void 0 && (j === "1" || j === "true"), t = N !== void 0 && (N === "1" || N === "true");
1281
+ L = t && me !== void 0 ? me : null, t && L === null && (L = "0"), w = {
1282
+ min: x,
1283
+ max: x,
1267
1284
  value: {
1268
- sz: k === void 0 ? -1 : parseFloat(k),
1285
+ sz: D === void 0 ? -1 : parseFloat(D),
1269
1286
  csz: e,
1270
- h: ge !== void 0 && (ge === "1" || ge === "true"),
1287
+ h: M !== void 0 && (M === "1" || M === "true"),
1271
1288
  s: L === null ? void 0 : L === "0" ? 0 : parseInt(L),
1272
- l: A === void 0 || A === "0" ? 0 : parseInt(A),
1273
- cl: j !== void 0 && (j === "1" || j === "true")
1289
+ l: he === void 0 || he === "0" ? 0 : parseInt(he),
1290
+ cl: ge !== void 0 && (ge === "1" || ge === "true")
1274
1291
  }
1275
- }, C.push(fe);
1276
- } else fe.max = y;
1277
- D = y, P = !1;
1292
+ }, de.push(w);
1293
+ } else w.max = x;
1294
+ T = x, F = !1;
1278
1295
  return;
1279
1296
  }
1280
- if (!I && r === "sheetData") {
1281
- I = !0;
1297
+ if (!Ce && r === "sheetData") {
1298
+ Ce = !0;
1282
1299
  let e = t.cols, n = e ? e.length : 0;
1283
1300
  for (let t = 0; !we && t < n; t++) e[t].v.s && (we = !0);
1284
1301
  }
@@ -1287,39 +1304,39 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1287
1304
  },
1288
1305
  onCloseTag: (t) => {
1289
1306
  let r = t.name;
1290
- if (!u || r !== "c" && r !== "f" || (d && (h = re.get(d) ?? null), h && (ne.append(y, b, h), ce && le.append(y, b)), se !== null && ie.push([se, ae ? oe ? "dynamicSpillError" : "dynamic" : "static"]), u = !1, h = null, d = null, f = null, c = !1, ce = !1, se = null, ae = !1, oe = !1), S) {
1307
+ if (!d || r !== "c" && r !== "f" || (f && (h = te.get(f) ?? null), h && (b.append(x, S, h), oe && se.append(x, S)), ae !== null && ne.push([ae, re ? ie ? "dynamicSpillError" : "dynamic" : "static"]), d = !1, h = null, f = null, p = null, l = !1, oe = !1, ae = null, re = !1, ie = !1), le) {
1291
1308
  let n = r.indexOf(":");
1292
- if (n !== -1 && (r = r.slice(n + 1)), ue) if (r === "is" || r === "v") {
1293
- let t = a?.onEnd?.();
1294
- t != null && e.pushAt(y, b, "" + t);
1295
- } else r !== "f" && a?.onCloseTag?.(t);
1296
- c &&= !1, r === "c" && (S = null, ue = !1);
1309
+ if (n !== -1 && (r = r.slice(n + 1)), ce) if (r === "is" || r === "v") {
1310
+ let t = o?.onEnd?.();
1311
+ t != null && e.pushAt(x, S, "" + t);
1312
+ } else r !== "f" && o?.onCloseTag?.(t);
1313
+ l &&= !1, r === "c" && (le = null, ce = !1);
1297
1314
  return;
1298
1315
  }
1299
- if (s) return s = !1, void (F = null);
1316
+ if (c) return c = !1, void (I = null);
1300
1317
  n?.onCloseTag?.(t);
1301
1318
  },
1302
- onText: (i) => {
1303
- let o = i.trim();
1304
- if (c) {
1305
- switch (x = null, de) {
1319
+ onText: (r) => {
1320
+ let a = r.trim();
1321
+ if (l) {
1322
+ switch (C = null, ue) {
1306
1323
  case null:
1307
1324
  case "n":
1308
- x = parseFloat(o);
1325
+ C = parseFloat(a);
1309
1326
  break;
1310
1327
  case "b":
1311
- x = o === "1" || o === "true";
1328
+ C = a === "1" || a === "true";
1312
1329
  break;
1313
1330
  case "s":
1314
- x = o;
1331
+ C = a;
1315
1332
  break;
1316
1333
  case "e":
1317
- if (o === "#VALUE!") {
1318
- let e = S.attributes.vm;
1334
+ if (a === "#VALUE!") {
1335
+ let e = le.attributes.vm;
1319
1336
  if (e !== void 0) {
1320
1337
  let t = v[parseInt(e) - 1];
1321
- if (E.isError(t)) {
1322
- x = {
1338
+ if (A.isError(t)) {
1339
+ C = {
1323
1340
  t: "e",
1324
1341
  v: t.getCode()
1325
1342
  };
@@ -1327,68 +1344,68 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1327
1344
  }
1328
1345
  }
1329
1346
  }
1330
- let e = E.getBuiltInByLabel(o);
1331
- e ? x = {
1347
+ let e = A.getBuiltInByLabel(a);
1348
+ e ? C = {
1332
1349
  t: "e",
1333
1350
  v: e.getCode()
1334
- } : (x = o, r?.(`Unknown formula error '${o}' in cell ${w.cellToString({
1335
- colIndex: b,
1336
- rowIndex: y
1351
+ } : (C = a, i?.(`Unknown formula error '${a}' in cell ${O.cellToString({
1352
+ colIndex: S,
1353
+ rowIndex: x
1337
1354
  })}`));
1338
1355
  break;
1339
1356
  case "str":
1340
- case "inlineStr": ue = !0;
1357
+ case "inlineStr": ce = !0;
1341
1358
  }
1342
- x !== null && e.pushAt(y, b, x);
1359
+ C !== null && e.pushAt(x, S, C);
1343
1360
  }
1344
- if (d) {
1345
- if (g === d) h = _;
1361
+ if (f) {
1362
+ if (g === f) h = _;
1346
1363
  else {
1347
- if (h = re.get(d) ?? null, !h) {
1364
+ if (h = te.get(f) ?? null, !h) {
1348
1365
  let e = [];
1349
- m = te(o, y, b, e), h = [
1366
+ m = ee(a, x, S, e), h = [
1350
1367
  m,
1351
1368
  e,
1352
- o
1353
- ], re.set(d, h);
1369
+ a
1370
+ ], te.set(f, h);
1354
1371
  }
1355
- g = d, _ = h;
1372
+ g = f, _ = h;
1356
1373
  }
1357
- d = null;
1374
+ f = null;
1358
1375
  }
1359
- if (u) {
1360
- if (ee !== null) {
1376
+ if (d) {
1377
+ if (y !== null) {
1361
1378
  let e = ((e) => {
1362
- if (e.length < tt.length || e.slice(0, tt.length).toUpperCase() !== nt) return it;
1363
- let t = ot(e, tt.length);
1364
- if (t === null || e.charCodeAt(t.end) !== 41 || e.charCodeAt(t.end + 1) !== 44 || e.charCodeAt(e.length - 1) !== 41) return it;
1379
+ if (e.length < ot.length || e.slice(0, ot.length).toUpperCase() !== st) return lt;
1380
+ let t = dt(e, ot.length);
1381
+ if (t === null || e.charCodeAt(t.end) !== 41 || e.charCodeAt(t.end + 1) !== 44 || e.charCodeAt(e.length - 1) !== 41) return lt;
1365
1382
  let n = t.value;
1366
- return n.toUpperCase() === rt ? at : n.length === 0 ? it : {
1383
+ return n.toUpperCase() === ct ? ut : n.length === 0 ? lt : {
1367
1384
  kind: "formula",
1368
1385
  formula: n
1369
1386
  };
1370
- })(o);
1371
- e.kind !== "none" && ee.push({
1387
+ })(a);
1388
+ e.kind !== "none" && y.push({
1372
1389
  sheet: t,
1373
- rowIndex: y,
1374
- colIndex: b,
1390
+ rowIndex: x,
1391
+ colIndex: S,
1375
1392
  formula: e.kind === "formula" ? e.formula : null
1376
1393
  });
1377
1394
  }
1378
1395
  let e = [];
1379
- m = te(o, y, b, e), h = [
1396
+ m = ee(a, x, S, e), h = [
1380
1397
  m,
1381
1398
  e,
1382
- o
1399
+ a
1383
1400
  ];
1384
1401
  }
1385
- ue ? a?.onText?.(i) : s || n?.onText?.(o);
1402
+ ce ? o?.onText?.(r) : c || n?.onText?.(a);
1386
1403
  }
1387
1404
  };
1388
- }, pt = (e) => {
1405
+ }, vt = (e) => {
1389
1406
  let t = e.indexOf(":");
1390
1407
  return t === -1 ? e : e.slice(t + 1);
1391
- }, mt = {
1408
+ }, yt = {
1392
1409
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
1393
1410
  "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
1394
1411
  "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
@@ -1418,41 +1435,41 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1418
1435
  "application/vnd.ms-excel.externalLink": "links",
1419
1436
  "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
1420
1437
  "application/vnd.openxmlformats-officedocument.theme+xml": "themes"
1421
- }, ht = (e) => e.startsWith("/") ? e.slice(1) : e, gt = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, _t = async (u, d) => {
1422
- let { password: p, onVBA: g, profile: _, createWorkbookOptions: v = {}, ...S } = d ?? {}, pe = v.origin && typeof v.origin != "string" ? v.origin : null, T = _ ? new ye(typeof _ == "function" ? _ : void 0) : null, E = [], me = d?.progress, A = me?.onProgress ? me.onProgress.bind(me) : void 0, M = u.byteLength, be = 0, N = 0, xe = A ? (e) => {
1423
- if (be <= 0) return;
1424
- N += e;
1425
- let t = Math.min(M, Math.round(N / be * M));
1426
- A(t, M);
1427
- } : void 0, Se = import("./5j5FhwFDI6_VA9fj.mjs"), Ce = null;
1438
+ }, bt = (e) => e.startsWith("/") ? e.slice(1) : e, xt = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, St = async (t, r) => {
1439
+ let { password: i, onVBA: l, profile: v, createWorkbookOptions: y = {}, ...b } = r ?? {}, fe = y.origin && typeof y.origin != "string" ? y.origin : null, k = v ? new be(typeof v == "function" ? v : void 0) : null, A = [], pe = r?.progress, ve = pe?.onProgress ? pe.onProgress.bind(pe) : void 0, xe = t.byteLength, Se = 0, P = 0, F = ve ? (e) => {
1440
+ if (Se <= 0) return;
1441
+ P += e;
1442
+ let t = Math.min(xe, Math.round(P / Se * xe));
1443
+ ve(t, xe);
1444
+ } : void 0, I = import("./CV_L3E5OoPstI9lx.mjs"), Ce = null;
1428
1445
  try {
1429
1446
  Ce = new DOMParser();
1430
1447
  } catch {}
1431
- let P = null;
1448
+ let we = null;
1432
1449
  try {
1433
- P = new XMLSerializer();
1450
+ we = new XMLSerializer();
1434
1451
  } catch {}
1435
- let F, I, we, L = null;
1436
- Ce || (L = import("./BfG31qdPDPTaVft2.mjs").then((t) => e(t.default, 1)));
1452
+ let L, R, Te, Ee = null;
1453
+ Ce || (Ee = import("./BXCOn1XvLvYSfpzi.mjs").then((t) => e(t.default, 1)));
1437
1454
  try {
1438
- let [e, t] = await Promise.all([L, Se]);
1439
- F = new t.DOMTransformer(), I = Ce ?? new e.DOMParser(), we = P ?? new e.XMLSerializer();
1455
+ let [e, t] = await Promise.all([Ee, I]);
1456
+ L = new t.DOMTransformer(), R = Ce ?? new e.DOMParser(), Te = we ?? new e.XMLSerializer();
1440
1457
  } catch (e) {
1441
1458
  throw Error("Unable to load XLSX parser.", { cause: e });
1442
1459
  }
1443
- let Te = (e) => we.serializeToString(e), R;
1460
+ let De = (e) => Te.serializeToString(e), z;
1444
1461
  try {
1445
- R = await j.create(u);
1462
+ z = await ye.create(t);
1446
1463
  } catch (e) {
1447
- throw new fe("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: e });
1464
+ throw new D("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: e });
1448
1465
  }
1449
- T?.mark("zip-open");
1466
+ k?.mark("zip-open");
1450
1467
  try {
1451
- if (!R.has("[Content_Types].xml")) throw new fe("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1468
+ if (!z.has("[Content_Types].xml")) throw new D("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1452
1469
  let e = (e) => {
1453
- let t = R.getEntry(e);
1470
+ let t = z.getEntry(e);
1454
1471
  return t ? { content: t } : void 0;
1455
- }, u = {
1472
+ }, t = {
1456
1473
  workbooks: [],
1457
1474
  sheets: [],
1458
1475
  charts: [],
@@ -1483,7 +1500,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1483
1500
  if (n === "Override") {
1484
1501
  let t = r.ContentType, n = r.PartName;
1485
1502
  if (!t || !n) return;
1486
- let i = mt[t], a = i ? e[i] : void 0;
1503
+ let i = yt[t], a = i ? e[i] : void 0;
1487
1504
  Array.isArray(a) && a.push(n);
1488
1505
  } else if (n === "Default") {
1489
1506
  let t = r.Extension, n = r.ContentType;
@@ -1496,63 +1513,69 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1496
1513
  onError: (e) => {
1497
1514
  t?.(`Error parsing content types: ${e?.message ?? e}`);
1498
1515
  }
1499
- }))(u, (e) => {
1500
- E.push([e, "[Content_Types].xml"]);
1501
- }), t = await R.getTextStream("[Content_Types].xml");
1502
- if (!t) throw Error("Error parsing content types: '[Content_Types].xml'");
1516
+ }))(t, (e) => {
1517
+ A.push([e, "[Content_Types].xml"]);
1518
+ }), n = await z.getTextStream("[Content_Types].xml");
1519
+ if (!n) throw Error("Error parsing content types: '[Content_Types].xml'");
1503
1520
  try {
1504
- await Je.parseStream(t, e, { xmlns: !1 });
1521
+ await Ze.parseStream(n, e, { xmlns: !1 });
1505
1522
  } catch (e) {
1506
1523
  throw Error("Error parsing content types: '[Content_Types].xml'", { cause: e });
1507
1524
  }
1508
- pe && await R.getBuffer("[Content_Types].xml");
1525
+ fe && await z.getBuffer("[Content_Types].xml");
1509
1526
  }
1510
- T?.mark("content-types");
1511
- let d = u.sst, p = /* @__PURE__ */ new Set();
1512
- for (let e of u.sheets) p.add(ht(e));
1513
- d && p.add(ht(d));
1514
- for (let e of p) be += R.uncompressedSize(e);
1515
- if (await R.prefetch((e) => !p.has(e) && !gt.test(e)), T?.mark("prefetch-side-parts"), u.workbooks.length === 0) {
1516
- let t = s("_rels/.rels", e, I, F);
1517
- if (t) {
1518
- for (let e of t.values()) if (e.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" && e.target) {
1519
- u.workbooks.push(e.target);
1527
+ k?.mark("content-types");
1528
+ let r = t.sst, i = /* @__PURE__ */ new Set();
1529
+ for (let e of t.sheets) i.add(bt(e));
1530
+ r && i.add(bt(r));
1531
+ for (let e of i) Se += z.uncompressedSize(e);
1532
+ if (await z.prefetch((e) => !i.has(e) && !xt.test(e)), k?.mark("prefetch-side-parts"), t.workbooks.length === 0) {
1533
+ let n = de("_rels/.rels", e, R, L);
1534
+ if (n) {
1535
+ for (let e of n.values()) if (e.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" && e.target) {
1536
+ t.workbooks.push(e.target);
1520
1537
  break;
1521
1538
  }
1522
1539
  }
1523
1540
  }
1524
- if (u.workbooks.length === 0) throw new fe("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1525
- u.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], u.richdata = ["/xl/richData/rdrichvalue.xml"];
1526
- let S = v?.resources ?? new he(), k = S.beginPersist(), j = {}, ye = /* @__PURE__ */ new Set(), N = /* @__PURE__ */ new Map();
1527
- N.set("richTypes", []);
1528
- let Se = [];
1529
- N.set("dummyWrapped", Se);
1530
- let Ce = c("metadata", u, e, I, F).entries().next()?.value?.[1]?.metadata;
1531
- Ce && N.set("metadata", Ce);
1532
- let P = /* @__PURE__ */ new Map(), we = [], L = (t, n = P) => {
1541
+ if (t.workbooks.length === 0) throw new D("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
1542
+ t.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], t.richdata = ["/xl/richData/rdrichvalue.xml"];
1543
+ let b = y?.resources ?? new me(), N = b.beginPersist(), ye = {}, be = /* @__PURE__ */ new Set(), P = /* @__PURE__ */ new Map();
1544
+ P.set("richTypes", []), P.set("parseInlineDxf", (e) => {
1545
+ if (!e) return;
1546
+ let t = R.parseFromString(`<dxf xmlns:x14="${o}" xmlns:xm="${p}">${e}</dxf>`, "text/xml")?.documentElement;
1547
+ if (!t) return;
1548
+ let n = L.parseDxf(t);
1549
+ return Object.keys(n).length > 0 ? n : void 0;
1550
+ });
1551
+ let I = [];
1552
+ P.set("dummyWrapped", I);
1553
+ let Ce = w("metadata", t, e, R, L).entries().next()?.value?.[1]?.metadata;
1554
+ Ce && P.set("metadata", Ce);
1555
+ let we = /* @__PURE__ */ new Map(), Te = [], Ee = (t, n = we) => {
1533
1556
  let r = t.lastIndexOf("/"), i = t.substring(0, r + 1) + "_rels/" + t.substring(r + 1, t.length) + ".rels", a = n.get(i);
1534
- return a || (a = s(i, e, I, F, V), n.set(i, a)), a;
1535
- }, Ee = (s, c, l, u = P) => {
1536
- let d = L(c, u).get(s), f = d?.target;
1537
- if (!f) return null;
1538
- if (d.targetMode === "External") {
1539
- if (!l) return d.target;
1540
- let e = S.add({ source: { external: d.target } });
1541
- return e.addReference(j), ye.add(e), k.toResourceId(e);
1557
+ return a || (a = de(i, e, R, L, H), n.set(i, a)), a;
1558
+ }, Oe = (t, r, i, o = we) => {
1559
+ let l = Ee(r, o).get(t), d = l?.target;
1560
+ if (!d) return null;
1561
+ if (l.targetMode === "External") {
1562
+ if (!i) return l.target;
1563
+ let e = b.add({ source: { external: l.target } });
1564
+ return e.addReference(ye), be.add(e), N.toResourceId(e);
1542
1565
  }
1543
- let p = c.lastIndexOf("/"), m = c.substring(0, p + 1);
1544
- f.startsWith("/") || (f = m + f), f = a(f);
1545
- let h = F?.getVisitorParamsState().get("dxfs"), g = u.get(f);
1546
- if (!g) if (d.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
1566
+ let f = r.lastIndexOf("/"), p = r.substring(0, f + 1);
1567
+ d.startsWith("/") || (d = p + d), d = le(d);
1568
+ let v = L?.getVisitorParamsState().get("dxfs"), y = o.get(d);
1569
+ if (!y) if (l.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
1547
1570
  let e = {};
1548
- g = e, we.push((async () => {
1549
- let t = ((e, t, r, i, a, s, c, l) => {
1550
- let u = new et(), d = new _e.TransposedBuilder(), f = null;
1551
- u.registerVisitor({
1571
+ y = e, Te.push((async () => {
1572
+ let t = ((e, t, r, i, o, l, d, f) => {
1573
+ let p = new at(), v = f?.get("parseInlineDxf"), y = new ge.TransposedBuilder(), b = null;
1574
+ p.registerVisitor({
1552
1575
  from: "autoFilter",
1553
1576
  to: "autoTable",
1554
1577
  openTag: (e) => {
1555
- let t = e.getAttribute("ref"), n = w.fastStringToRange(t);
1578
+ let t = e.getAttribute("ref"), n = O.fastStringToRange(t);
1556
1579
  e.getSource().r = n, e.getSource().v = {};
1557
1580
  },
1558
1581
  closeTag: (e) => {
@@ -1562,7 +1585,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1562
1585
  e === 0 ? n.hiddenButtons = !1 : e === a && (n.hiddenButtons = !0);
1563
1586
  }
1564
1587
  }
1565
- }), u.registerVisitor({
1588
+ }), p.registerVisitor({
1566
1589
  from: "conditionalFormatting",
1567
1590
  to: {},
1568
1591
  openTag: (e) => {
@@ -1576,7 +1599,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1576
1599
  }, i = e.getAttribute("pivot", X);
1577
1600
  i !== null && (r.pivot = i), e.setSource(r);
1578
1601
  }
1579
- }), u.registerVisitor({
1602
+ }), p.registerVisitor({
1580
1603
  from: "cfRule",
1581
1604
  to: {},
1582
1605
  openTag: (e) => {
@@ -1591,7 +1614,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1591
1614
  let r = e.getAttribute("dxfId", Z);
1592
1615
  if (r !== null) {
1593
1616
  let t = i?.get(r);
1594
- t ||= (s?.(`Unable to load conditional color. Invalid dxfI: '${r}' at '${e.getPath()}'.`), {}), n.style = t;
1617
+ t ||= (l?.(`Unable to load conditional color. Invalid dxfI: '${r}' at '${e.getPath()}'.`), {}), n.style = t;
1595
1618
  }
1596
1619
  e.copyToObject(n, "aboveAverage", X), e.copyToObject(n, "equalAverage", X), e.copyToObject(n, "stdDev", Z), e.copyToObject(n, "bottom", X), e.copyToObject(n, "percent", X), e.copyToObject(n, "rank", Z), e.copyToObject(n, "operator", $), e.copyToObject(n, "text", $), e.copyToObject(n, "timePeriod", $);
1597
1620
  },
@@ -1600,11 +1623,11 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1600
1623
  if (!t?.r) return;
1601
1624
  let n = t.conditionals[t.conditionals.length - 1], r = n?.rule;
1602
1625
  if (!r) return;
1603
- let i = {}, a = ee(r, s);
1626
+ let i = {}, a = g(r, l);
1604
1627
  a && (i.condition = a), r.style && (i.style = r.style), r.scale && (i.scale = r.scale), r.stopIfTrue && (i.stopIfTrue = !0), r.pivot && (i.pivot = !0), n.v = i, n.priority = r.priority, r.x14Id && (n.x14Id = r.x14Id), delete n.rule;
1605
1628
  }
1606
1629
  });
1607
- let p = (e) => {
1630
+ let ie = (e) => {
1608
1631
  let t = e.conditions ?? [], n = [];
1609
1632
  for (let e = 0; e < t.length; e++) {
1610
1633
  let r = t[e], i = {};
@@ -1612,19 +1635,19 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1612
1635
  }
1613
1636
  return n;
1614
1637
  };
1615
- u.registerVisitor({
1638
+ p.registerVisitor({
1616
1639
  from: "colorScale",
1617
1640
  to: {},
1618
1641
  openTag: (e) => {},
1619
1642
  closeTag: (e) => {
1620
- let t = e.getSource(), n = t.colors ?? [], r = p(t);
1643
+ let t = e.getSource(), n = t.colors ?? [], r = ie(t);
1621
1644
  for (let e = 0; e < r.length; e++) r[e].color = n[e];
1622
1645
  e.getParent().scale = {
1623
- type: O.ScaleType.ColorScale,
1646
+ type: M.ScaleType.ColorScale,
1624
1647
  stops: r
1625
1648
  };
1626
1649
  }
1627
- }), u.registerVisitor({
1650
+ }), p.registerVisitor({
1628
1651
  from: "dataBar",
1629
1652
  to: {},
1630
1653
  openTag: (e) => {
@@ -1632,12 +1655,12 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1632
1655
  },
1633
1656
  closeTag: (e) => {
1634
1657
  let t = e.getSource(), n = {
1635
- type: O.ScaleType.DataBar,
1636
- stops: p(t)
1658
+ type: M.ScaleType.DataBar,
1659
+ stops: ie(t)
1637
1660
  }, r = t.colors?.[0];
1638
1661
  r && (n.color = r), t.minLength !== void 0 && (n.minLength = t.minLength), t.maxLength !== void 0 && (n.maxLength = t.maxLength), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
1639
1662
  }
1640
- }), u.registerVisitor({
1663
+ }), p.registerVisitor({
1641
1664
  from: "iconSet",
1642
1665
  to: {},
1643
1666
  openTag: (e) => {
@@ -1645,37 +1668,37 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1645
1668
  },
1646
1669
  closeTag: (e) => {
1647
1670
  let t = e.getSource(), n = {
1648
- type: O.ScaleType.IconSet,
1649
- stops: p(t)
1671
+ type: M.ScaleType.IconSet,
1672
+ stops: ie(t)
1650
1673
  };
1651
1674
  t.iconSet !== void 0 && (n.iconSet = t.iconSet), t.reverse !== void 0 && (n.reverse = t.reverse), t.showValue !== void 0 && (n.showValue = t.showValue), e.getParent().scale = n;
1652
1675
  }
1653
- }), u.registerVisitor({
1676
+ }), p.registerVisitor({
1654
1677
  from: "formula",
1655
1678
  to: {},
1656
1679
  text: (e, t) => {
1657
1680
  let n = t.getParent(), r = n.formulas;
1658
1681
  r || (r = [], n.formulas = r), r.push(e);
1659
1682
  }
1660
- }), u.registerVisitor({
1683
+ }), p.registerVisitor({
1661
1684
  from: "cfvo",
1662
1685
  to: {},
1663
1686
  openTag: (e) => {
1664
1687
  let t = e.getParent();
1665
1688
  t.conditions ||= [];
1666
1689
  let n = e.getSource();
1667
- t.conditions.push(n), e.copyTo("type", $), n.type === O.ColorStopType.Formula ? e.copyTo("value", $, "val") : e.copyTo("value", Q, "val"), !1 === e.getAttribute("gte", X) && (n.exclusive = !0);
1690
+ t.conditions.push(n), e.copyTo("type", $), n.type === M.ColorStopType.Formula ? e.copyTo("value", $, "val") : e.copyTo("value", Q, "val"), !1 === e.getAttribute("gte", X) && (n.exclusive = !0);
1668
1691
  }
1669
- }), u.registerVisitor({
1692
+ }), p.registerVisitor({
1670
1693
  from: "color",
1671
1694
  to: {},
1672
1695
  openTag: (e) => {
1673
1696
  let t = e.getParent();
1674
1697
  t.colors ||= [];
1675
- let r = n((t) => e.getAttribute(t));
1676
- t.colors.push(r);
1698
+ let n = x((t) => e.getAttribute(t));
1699
+ t.colors.push(n);
1677
1700
  }
1678
- }), u.registerVisitor({
1701
+ }), p.registerVisitor({
1679
1702
  from: "filterColumn",
1680
1703
  to: {},
1681
1704
  openTag: (e) => {
@@ -1694,77 +1717,83 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1694
1717
  }
1695
1718
  return r;
1696
1719
  }
1697
- }), u.registerVisitor({
1720
+ }), p.registerVisitor({
1698
1721
  from: "colorFilter",
1699
1722
  openTag: (e) => {
1700
1723
  let t = e.getParent(), n = {};
1701
- t.operator = D.BuiltInOperatorNames.Color, t.param = n, e.copyToObject(n, "cellColor"), e.copyToObject(n, "styleId", Z, "dxfId");
1724
+ t.operator = j.BuiltInOperatorNames.Color, t.param = n, e.copyToObject(n, "cellColor"), e.copyToObject(n, "styleId", Z, "dxfId");
1702
1725
  }
1703
- }), u.registerVisitor({
1726
+ }), p.registerVisitor({
1704
1727
  from: "iconFilter",
1705
1728
  openTag: (e) => {
1706
1729
  let t = e.getParent(), n = {};
1707
- t.operator = D.BuiltInOperatorNames.Icon, t.param = n, e.copyToObject(n, "iconId", Z), e.copyToObject(n, "iconSet", $);
1730
+ t.operator = j.BuiltInOperatorNames.Icon, t.param = n, e.copyToObject(n, "iconId", Z), e.copyToObject(n, "iconSet", $);
1708
1731
  }
1709
- }), u.registerVisitor({
1732
+ }), p.registerVisitor({
1710
1733
  from: "top10",
1711
1734
  openTag: (e) => {
1712
1735
  let t = e.getParent(), n = {};
1713
- t.operator = D.BuiltInOperatorNames.TopN, t.param = n, e.copyToObject(n, "filterVal", Q), e.copyToObject(n, "percent", X), e.copyToObject(n, "top", X), e.copyToObject(n, "limit", Q, "val");
1736
+ t.operator = j.BuiltInOperatorNames.TopN, t.param = n, e.copyToObject(n, "filterVal", Q), e.copyToObject(n, "percent", X), e.copyToObject(n, "top", X), e.copyToObject(n, "limit", Q, "val");
1714
1737
  }
1715
- }), u.registerVisitor({
1738
+ }), p.registerVisitor({
1716
1739
  from: "dynamicFilter",
1717
1740
  openTag: (e) => {
1718
1741
  let t = e.getParent(), n = {};
1719
- t.operator = D.BuiltInOperatorNames.TimePeriod, t.param = n;
1742
+ t.operator = j.BuiltInOperatorNames.TimePeriod, t.param = n;
1720
1743
  let r = e.getAttribute("type");
1721
- Object.values(D.AverageType).includes(r) ? (t.operator = D.BuiltInOperatorNames.Average, e.copyToObject(n, "stdDevs", Z, "val")) : e.copyToObject(n, "anchorDate", Z, "val"), e.copyToObject(n, "operator", $, "type"), e.copyToObject(n, "maxVal", Q, "maxVal");
1744
+ Object.values(j.AverageType).includes(r) ? (t.operator = j.BuiltInOperatorNames.Average, e.copyToObject(n, "stdDevs", Z, "val")) : e.copyToObject(n, "anchorDate", Z, "val"), e.copyToObject(n, "operator", $, "type"), e.copyToObject(n, "maxVal", Q, "maxVal");
1722
1745
  }
1723
- }), u.registerVisitor({
1746
+ }), p.registerVisitor({
1724
1747
  from: "filters",
1725
1748
  to: {},
1726
1749
  openTag: (e) => {
1727
1750
  let t = e.getParent(), n = {};
1728
- return t.operator = D.BuiltInOperatorNames.InSet, t.param = n, e.copyToObject(n, "blank", X), e.copyToObject(n, "calendarType", $), n;
1751
+ return t.operator = j.BuiltInOperatorNames.InSet, t.param = n, e.copyToObject(n, "blank", X), e.copyToObject(n, "calendarType", $), n;
1729
1752
  }
1730
- }), u.registerVisitor({
1753
+ }), p.registerVisitor({
1731
1754
  from: "filter",
1732
1755
  openTag: (e) => {
1733
1756
  let t = e.getParent(), n = t.items;
1734
1757
  n || (n = [], t.items = n), n.push(e.getAttribute("val", $));
1735
1758
  }
1736
- }), u.registerVisitor({
1759
+ }), p.registerVisitor({
1737
1760
  from: "dateGroupItem",
1738
1761
  to: {},
1739
1762
  openTag: (e) => {
1740
1763
  let t = e.getParent(), n = t.dateGroups;
1741
1764
  n || (n = [], t.dateGroups = n), n.push(e.getSource()), e.copyTo("group", $, "dateTimeGrouping"), e.copyTo("day", Z), e.copyTo("hour", Z), e.copyTo("minute", Z), e.copyTo("month", Z), e.copyTo("second", Z), e.copyTo("year", Z);
1742
1765
  }
1743
- }), u.registerVisitor({
1766
+ }), p.registerVisitor({
1744
1767
  from: "customFilters",
1745
1768
  openTag: (e) => {
1746
- let t = e.getParent(), n = e.getAttribute("and"), r = n === "and" || n === "1";
1747
- e.getAttribute("val");
1748
- let i = [];
1749
- return t.operator = r ? D.BuiltInOperatorNames.And : D.BuiltInOperatorNames.Or, t.param = { conditions: i }, e.setSource(t), i;
1769
+ let t = e.getParent(), n = e.getAttribute("and"), r = n === "and" || n === "1", i = [];
1770
+ return t.operator = r ? j.BuiltInOperatorNames.And : j.BuiltInOperatorNames.Or, t.param = i, e.setSource(t), i;
1750
1771
  },
1751
1772
  closeTag: (e) => {
1752
- e.getSource().param.conditions.length;
1773
+ let t = e.getSource(), n = t?.param;
1774
+ if (n?.length !== 1) return;
1775
+ let r = n[0];
1776
+ t.operator = r.operator, t.param = r.param;
1753
1777
  }
1754
- }), u.registerVisitor({
1778
+ }), p.registerVisitor({
1755
1779
  from: "customFilter",
1756
1780
  openTag: (e) => {
1757
1781
  let t = e.getParent(), n;
1758
- Array.isArray(t) ? (n = {}, t.push(n)) : n = t, e.copyToObject(n, "operator"), e.copyToObject(n, "param", $, "val");
1782
+ Array.isArray(t) ? (n = {}, t.push(n)) : n = t;
1783
+ let r = ee({
1784
+ operator: e.getAttribute("operator"),
1785
+ val: e.getAttribute("val")
1786
+ });
1787
+ r && (n.operator = r.operator, n.param = r.param);
1759
1788
  }
1760
- }), u.registerVisitor({
1789
+ }), p.registerVisitor({
1761
1790
  from: "sortState",
1762
1791
  to: {},
1763
1792
  openTag: (e) => {
1764
1793
  let t = e.getParent(), n = t.v;
1765
1794
  n && (n.sort = {}, e.setSource(t));
1766
1795
  }
1767
- }), u.registerVisitor({
1796
+ }), p.registerVisitor({
1768
1797
  from: "sortCondition",
1769
1798
  to: {},
1770
1799
  openTag: (e) => {
@@ -1776,7 +1805,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1776
1805
  i || (i = [], r.sorts = i);
1777
1806
  let a = e.getAttribute("ref"), o = 0;
1778
1807
  if (a) {
1779
- let e = w.fastStringToRange(a, dt).colStart, n = t.r, r = n.colStart;
1808
+ let e = O.fastStringToRange(a, gt).colStart, n = t.r, r = n.colStart;
1780
1809
  o = n ? e - r : e;
1781
1810
  }
1782
1811
  let s = {};
@@ -1787,56 +1816,56 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1787
1816
  };
1788
1817
  i.push(c);
1789
1818
  }
1790
- }), u.registerVisitor({
1819
+ }), p.registerVisitor({
1791
1820
  from: "AlternateContent",
1792
1821
  to: null
1793
1822
  });
1794
- let m = (e) => {
1795
- f = e.getSource(), e.copyTo("topLeft", $, "topLeftCell");
1796
- let t = o(e.getAttribute("defaultGridColor")), n = e.getAttribute("colorId");
1823
+ let ae = (e) => {
1824
+ b = e.getSource(), e.copyTo("topLeft", $, "topLeftCell");
1825
+ let t = ue(e.getAttribute("defaultGridColor")), n = e.getAttribute("colorId");
1797
1826
  n === null || t || (e.getSource().gridLineColor = "index" + parseFloat(n)), e.copyTo("showZeros", X), e.copyTo("showFormulas", X), e.copyTo("zoomScale", Z), e.copyTo("showRowHeaders", X, "showRowColHeaders"), e.copyTo("showColumnHeaders", X, "showRowColHeaders"), e.copyTo("showRowGridlines", X, "showGridLines"), e.copyTo("showColumnGridlines", X, "showGridLines"), e.copyTo("rightToLeft", X);
1798
1827
  };
1799
- u.registerVisitor({
1828
+ p.registerVisitor({
1800
1829
  from: "sheetView",
1801
1830
  to: "view",
1802
1831
  openTag: (e) => {
1803
- m(e);
1832
+ ae(e);
1804
1833
  },
1805
1834
  closeTag: () => {
1806
- f = null;
1835
+ b = null;
1807
1836
  }
1808
- }), u.registerVisitor({
1837
+ }), p.registerVisitor({
1809
1838
  from: "customSheetViews",
1810
1839
  to: "customSheetViews",
1811
1840
  openTag: (e) => {
1812
1841
  e.setSource([]);
1813
1842
  }
1814
- }), u.registerVisitor({
1843
+ }), p.registerVisitor({
1815
1844
  from: "customSheetView",
1816
1845
  to: [],
1817
1846
  openTag: (e) => {
1818
- m(e);
1847
+ ae(e);
1819
1848
  },
1820
1849
  closeTag: () => {
1821
- f = null;
1850
+ b = null;
1822
1851
  }
1823
- }), u.registerVisitor({
1852
+ }), p.registerVisitor({
1824
1853
  from: "selection",
1825
1854
  to: "selection",
1826
1855
  openTag: (e) => {
1827
- if (!f) return;
1856
+ if (!b) return;
1828
1857
  e.copyTo("cell", $, "activeCell"), e.copyTo("rangeIndex", Z, "activeCellId");
1829
1858
  let t = e.getAttribute("activeCell"), n = e.getAttribute("sqref");
1830
1859
  n && n !== t && (e.getSource().ranges = n.trim().split(/\s+/));
1831
1860
  }
1832
- }), u.registerVisitor({
1861
+ }), p.registerVisitor({
1833
1862
  from: "pane",
1834
1863
  to: null,
1835
1864
  openTag: (e) => {
1836
- if (f && e.getAttribute("state") === "frozen") {
1865
+ if (b && e.getAttribute("state") === "frozen") {
1837
1866
  let t = {};
1838
- f.freezePanes = t, e.copyToObject(t, "topLeft", $, "topLeftCell");
1839
- let n = (f.topLeft ? w.fastStringToCell(f.topLeft) : void 0) ?? {
1867
+ b.freezePanes = t, e.copyToObject(t, "topLeft", $, "topLeftCell");
1868
+ let n = (b.topLeft ? O.fastStringToCell(b.topLeft) : void 0) ?? {
1840
1869
  colIndex: 0,
1841
1870
  rowIndex: 0
1842
1871
  }, r = {
@@ -1848,60 +1877,60 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1848
1877
  colIndex: n.colIndex + r.colIndex,
1849
1878
  rowIndex: n.rowIndex + r.rowIndex
1850
1879
  };
1851
- t.coords = w.cellToString(i);
1880
+ t.coords = O.cellToString(i);
1852
1881
  }
1853
1882
  }
1854
- }), u.registerVisitor({
1883
+ }), p.registerVisitor({
1855
1884
  from: "tabColor",
1856
1885
  to: null,
1857
1886
  openTag: (t) => {
1858
- let r = n((e) => t.getAttribute(e));
1859
- r && (e.tabColor = r);
1887
+ let n = x((e) => t.getAttribute(e));
1888
+ n && (e.tabColor = n);
1860
1889
  }
1861
- }), u.registerVisitor({
1890
+ }), p.registerVisitor({
1862
1891
  from: "pageSetUpPr",
1863
1892
  to: "pageSetUpPr",
1864
1893
  openTag: (e) => {}
1865
- }), u.registerVisitor({
1894
+ }), p.registerVisitor({
1866
1895
  from: "outlinePr",
1867
1896
  to: "outlinePr",
1868
1897
  openTag: (e) => {}
1869
- }), u.registerVisitor({
1898
+ }), p.registerVisitor({
1870
1899
  from: "pageMargins",
1871
1900
  to: "pageMargins",
1872
1901
  openTag: (e) => {
1873
1902
  e.copyTo("bottom", Q), e.copyTo("footer", Q), e.copyTo("header", Q), e.copyTo("left", Q), e.copyTo("right", Q), e.copyTo("top", Q), e.copyTo("bottom", Q);
1874
1903
  }
1875
- }), u.registerVisitor({
1904
+ }), p.registerVisitor({
1876
1905
  from: "pageSetup",
1877
1906
  to: "pageSetup",
1878
1907
  openTag: (e) => {
1879
1908
  e.copyTo("blackAndWhite", X), e.copyTo("cellComments"), e.copyTo("copies", Z), e.copyTo("draft", X), e.copyTo("errors"), e.copyTo("firstPageNumber", Z), e.copyTo("fitToHeight", Z), e.copyTo("fitToWidth", Z), e.copyTo("horizontalDpi", Z), e.copyTo("orientation"), e.copyTo("pageOrder"), e.copyTo("paperSize", Z), e.copyTo("scale", Z), e.copyTo("useFirstPageNumber", X), e.copyTo("usePrinterDefaults", X), e.copyTo("verticalDpi", Z);
1880
1909
  }
1881
- }), u.registerVisitor({
1910
+ }), p.registerVisitor({
1882
1911
  from: "printOptions",
1883
1912
  to: "printOptions",
1884
1913
  openTag: (e) => {
1885
1914
  e.copyTo("gridLines", X), e.copyTo("gridLinesSet", X), e.copyTo("headings", X), e.copyTo("horizontalCentered", X), e.copyTo("verticalCentered", X);
1886
1915
  }
1887
- }), u.registerVisitor({
1916
+ }), p.registerVisitor({
1888
1917
  from: "headerFoot",
1889
1918
  to: "headerFoot",
1890
1919
  openTag: (e) => {}
1891
- }), u.registerVisitor({
1920
+ }), p.registerVisitor({
1892
1921
  from: "mergeCells",
1893
1922
  to: "merges",
1894
1923
  openTag: (e) => {
1895
1924
  e.setSource([]);
1896
1925
  }
1897
- }), u.registerVisitor({
1926
+ }), p.registerVisitor({
1898
1927
  from: "dataValidations",
1899
1928
  to: "validations",
1900
1929
  openTag: (e) => {
1901
1930
  e.setSource([]);
1902
1931
  }
1903
1932
  });
1904
- let h = {
1933
+ let oe = {
1905
1934
  from: "dataValidation",
1906
1935
  to: [],
1907
1936
  openTag: (e) => {
@@ -1920,25 +1949,25 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1920
1949
  closeTag: (e) => {
1921
1950
  let t = e.getSource();
1922
1951
  if (!t?.rule) return;
1923
- let n = ie(t.rule, s);
1952
+ let n = ne(t.rule, l);
1924
1953
  n && (e.getAttribute("allowBlank", X) && (n.includeBlanks = !0), t.v.condition = n), delete t.rule;
1925
1954
  }
1926
1955
  };
1927
- u.registerVisitor(h), u.registerVisitor({
1956
+ p.registerVisitor(oe), p.registerVisitor({
1928
1957
  from: "formula1",
1929
1958
  to: {},
1930
1959
  text: (e, t) => {
1931
1960
  let n = t.getParent().rule;
1932
- n?.type && (n.formula1 = ue(e, n.type));
1961
+ n?.type && (n.formula1 = re(e, n.type));
1933
1962
  }
1934
- }), u.registerVisitor({
1963
+ }), p.registerVisitor({
1935
1964
  from: "formula2",
1936
1965
  to: {},
1937
1966
  text: (e, t) => {
1938
1967
  let n = t.getParent().rule;
1939
- n?.type && (n.formula2 = ue(e, n.type));
1968
+ n?.type && (n.formula2 = re(e, n.type));
1940
1969
  }
1941
- }), u.registerVisitor({
1970
+ }), p.registerVisitor({
1942
1971
  from: "picture",
1943
1972
  to: "picture",
1944
1973
  openTag: (e) => {
@@ -1948,7 +1977,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1948
1977
  e.getSource().resId = r;
1949
1978
  }
1950
1979
  });
1951
- let g = {
1980
+ let ce = {
1952
1981
  from: "slicer",
1953
1982
  to: {},
1954
1983
  openTag: (e) => {
@@ -1960,8 +1989,8 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1960
1989
  for (let e of a) i.slicers[e] = r[e];
1961
1990
  }
1962
1991
  };
1963
- u.registerVisitor(g);
1964
- let _ = (e, t) => ({
1992
+ p.registerVisitor(ce);
1993
+ let S = (e, t) => ({
1965
1994
  from: e,
1966
1995
  to: {},
1967
1996
  openTag: (e) => {
@@ -1973,8 +2002,8 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1973
2002
  closeTag: (e) => {
1974
2003
  t(String(e.getSource() ?? ""), e);
1975
2004
  }
1976
- }), v = /* @__PURE__ */ new Map();
1977
- v.set("dataValidations", {
2005
+ }), C = /* @__PURE__ */ new Map();
2006
+ C.set("dataValidations", {
1978
2007
  from: "dataValidations",
1979
2008
  to: "validations",
1980
2009
  openTag: (e) => {
@@ -1984,15 +2013,15 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
1984
2013
  closeTag: (e) => {
1985
2014
  (e.getSource()?.length ?? 0) === 0 && e.setSource(void 0);
1986
2015
  }
1987
- }), v.set("dataValidation", {
1988
- ...h,
2016
+ }), C.set("dataValidation", {
2017
+ ...oe,
1989
2018
  closeTag: (e) => {
1990
- h.closeTag(e);
2019
+ oe.closeTag(e);
1991
2020
  let t = e.getSource();
1992
2021
  t && !t.r && (e.warn("x14 dataValidation with no xm:sqref was dropped."), e.setSource(void 0));
1993
2022
  }
1994
2023
  });
1995
- let oe = (e) => ({
2024
+ let le = (e) => ({
1996
2025
  from: e,
1997
2026
  to: {},
1998
2027
  openTag: (t) => {
@@ -2002,18 +2031,18 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2002
2031
  });
2003
2032
  }
2004
2033
  });
2005
- v.set("formula1", oe("formula1")), v.set("formula2", oe("formula2")), v.set("f", _("f", (e, t) => {
2034
+ C.set("formula1", le("formula1")), C.set("formula2", le("formula2")), C.set("f", S("f", (e, t) => {
2006
2035
  let n = t.getParent(), r = n?.rule;
2007
- r && (r[n.key] = ue(e, r.type));
2008
- })), v.set("sqref", _("sqref", (e, t) => {
2036
+ r && (r[n.key] = re(e, r.type));
2037
+ })), C.set("sqref", S("sqref", (e, t) => {
2009
2038
  let n = t.getParent(), r = e.trim();
2010
2039
  n && r && (n.r = r.split(/\s+/).join(","));
2011
2040
  }));
2012
- let S = /* @__PURE__ */ new Map(), de = [], C = /* @__PURE__ */ new Map();
2013
- C.set("conditionalFormattings", {
2041
+ let de = /* @__PURE__ */ new Map(), w = [], T = /* @__PURE__ */ new Map();
2042
+ T.set("conditionalFormattings", {
2014
2043
  from: "conditionalFormattings",
2015
2044
  transparent: !0
2016
- }), C.set("conditionalFormatting", {
2045
+ }), T.set("conditionalFormatting", {
2017
2046
  from: "conditionalFormatting",
2018
2047
  to: {},
2019
2048
  openTag: (e) => {
@@ -2023,23 +2052,23 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2023
2052
  let t = e.getSource(), n = t?.rules ?? [];
2024
2053
  for (let e = 0; e < n.length; e++) {
2025
2054
  let r = n[e];
2026
- r.sqref = t.sqref, r.id ? S.set(r.id, r) : de.push(r);
2055
+ r.sqref = t.sqref, r.id ? de.set(r.id, r) : w.push(r);
2027
2056
  }
2028
2057
  }
2029
- }), C.set("cfRule", {
2058
+ }), T.set("cfRule", {
2030
2059
  from: "cfRule",
2031
2060
  to: {},
2032
2061
  openTag: (e) => {
2033
- e.copyTo("id", $), e.copyTo("type", $), e.copyTo("priority", Z);
2062
+ e.copyTo("id", $), e.copyTo("type", $), e.copyTo("priority", Z), e.copyTo("stopIfTrue", X), e.copyTo("operator", $), e.copyTo("text", $), e.copyTo("timePeriod", $), e.copyTo("aboveAverage", X), e.copyTo("equalAverage", X), e.copyTo("stdDev", Z), e.copyTo("bottom", X), e.copyTo("percent", X), e.copyTo("rank", Z);
2034
2063
  },
2035
2064
  closeTag: (e) => {
2036
2065
  let t = e.getSource();
2037
2066
  t && e.getParent()?.rules?.push(t);
2038
2067
  }
2039
- }), C.set("sqref", _("sqref", (e, t) => {
2068
+ }), T.set("sqref", S("sqref", (e, t) => {
2040
2069
  let n = t.getParent(), r = e.trim();
2041
2070
  n && r && (n.sqref = r);
2042
- })), C.set("dataBar", {
2071
+ })), T.set("dataBar", {
2043
2072
  from: "dataBar",
2044
2073
  to: {},
2045
2074
  openTag: (e) => {
@@ -2048,7 +2077,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2048
2077
  closeTag: (e) => {
2049
2078
  e.getParent().dataBar = e.getSource();
2050
2079
  }
2051
- }), C.set("iconSet", {
2080
+ }), T.set("iconSet", {
2052
2081
  from: "iconSet",
2053
2082
  to: {},
2054
2083
  openTag: (e) => {
@@ -2057,30 +2086,47 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2057
2086
  closeTag: (e) => {
2058
2087
  e.getParent().iconSet = e.getSource();
2059
2088
  }
2060
- }), C.set("cfvo", {
2089
+ });
2090
+ let E = /* @__PURE__ */ new Map();
2091
+ E.set("f", S("f", (e, t) => {
2092
+ let n = t.getParent();
2093
+ if (!n) return;
2094
+ let r = e.trim(), i = Number(r);
2095
+ n.value = r.length > 0 && Number.isFinite(i) ? i : e;
2096
+ })), T.set("cfvo", {
2061
2097
  from: "cfvo",
2062
2098
  to: {},
2099
+ scope: () => E,
2063
2100
  openTag: (e) => {
2064
2101
  let t = e.getParent();
2065
2102
  t.conditions ||= [];
2066
2103
  let n = e.getSource();
2067
2104
  t.conditions.push(n), e.copyTo("type", $), !1 === e.getAttribute("gte", X) && (n.exclusive = !0);
2068
2105
  }
2069
- }), C.set("f", _("f", (e, t) => {
2106
+ }), T.set("f", S("f", (e, t) => {
2070
2107
  let n = t.getParent();
2071
- if (!n) return;
2072
- let r = e.trim(), i = Number(r);
2073
- n.value = r.length > 0 && Number.isFinite(i) ? i : e;
2074
- }));
2075
- let fe = (e) => ({
2108
+ n && (n.formulas ??= []).push(e);
2109
+ })), T.set("dxf", {
2110
+ from: "dxf",
2111
+ to: {},
2112
+ raw: !0,
2113
+ closeTag: (e) => {
2114
+ if (!v) return;
2115
+ let t = e.getParent();
2116
+ if (!t) return;
2117
+ let n = v(e.getRawXml() ?? "");
2118
+ n && (t.style = n);
2119
+ }
2120
+ });
2121
+ let D = (e) => ({
2076
2122
  from: e,
2077
2123
  to: {},
2078
2124
  openTag: (t) => {
2079
- let r = n((e) => t.getAttribute(e));
2080
- r && (t.getParent()[e] = r);
2125
+ let n = x((e) => t.getAttribute(e));
2126
+ n && (t.getParent()[e] = n);
2081
2127
  }
2082
2128
  });
2083
- C.set("borderColor", fe("borderColor")), C.set("negativeFillColor", fe("negativeFillColor")), C.set("negativeBorderColor", fe("negativeBorderColor")), C.set("axisColor", fe("axisColor")), C.set("cfIcon", {
2129
+ T.set("borderColor", D("borderColor")), T.set("negativeFillColor", D("negativeFillColor")), T.set("negativeBorderColor", D("negativeBorderColor")), T.set("axisColor", D("axisColor")), T.set("cfIcon", {
2084
2130
  from: "cfIcon",
2085
2131
  to: {},
2086
2132
  openTag: (e) => {
@@ -2093,54 +2139,54 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2093
2139
  });
2094
2140
  }
2095
2141
  });
2096
- let pe = /* @__PURE__ */ new Map();
2097
- pe.set("id", _("id", (e, t) => {
2142
+ let fe = /* @__PURE__ */ new Map();
2143
+ fe.set("id", S("id", (e, t) => {
2098
2144
  let n = t.getParent(), r = e.trim();
2099
2145
  n && r && (n.x14Id = r);
2100
2146
  }));
2101
- let T = /* @__PURE__ */ new Map();
2102
- T.set("slicerList", {
2147
+ let k = /* @__PURE__ */ new Map();
2148
+ k.set("slicerList", {
2103
2149
  from: "slicerList",
2104
2150
  transparent: !0
2105
- }), T.set("slicer", g);
2106
- let E = /* @__PURE__ */ new Map([
2107
- [re(ae), v],
2108
- [re(ce), C],
2109
- [re(y), C],
2110
- [re(b), pe],
2111
- [re(te), T],
2112
- [re(le), T]
2113
- ]), me = /* @__PURE__ */ new Set();
2114
- u.registerVisitor({
2151
+ }), k.set("slicer", ce);
2152
+ let A = /* @__PURE__ */ new Map([
2153
+ [te(se), C],
2154
+ [te(c), T],
2155
+ [te(u), T],
2156
+ [te(s), fe],
2157
+ [te(n), k],
2158
+ [te(m), k]
2159
+ ]), pe = /* @__PURE__ */ new Set();
2160
+ p.registerVisitor({
2115
2161
  from: "extLst",
2116
2162
  transparent: !0
2117
- }), u.registerVisitor({
2163
+ }), p.registerVisitor({
2118
2164
  from: "ext",
2119
2165
  transparent: !0,
2120
2166
  scope: (e) => {
2121
- let t = e.getAttribute("uri"), n = re(t), r = E.get(n);
2167
+ let t = e.getAttribute("uri"), n = te(t), r = A.get(n);
2122
2168
  if (r) return r;
2123
- if (!se.has(n) && !me.has(n)) {
2124
- me.add(n);
2125
- let r = x[n];
2169
+ if (!h.has(n) && !pe.has(n)) {
2170
+ pe.add(n);
2171
+ let r = a[n];
2126
2172
  e.warn(r ? `Extension content '${r}' (${t}) is not read; it will be lost on resave.` : `Unknown extension content (uri ${t}) is not read; it will be lost on resave.`);
2127
2173
  }
2128
2174
  return null;
2129
2175
  }
2130
- }), u.registerVisitor({
2176
+ }), p.registerVisitor({
2131
2177
  from: "mergeCell",
2132
2178
  to: [],
2133
2179
  openTag: (e) => {
2134
2180
  let t = e.getAttribute("ref");
2135
2181
  e.setSource(t);
2136
2182
  }
2137
- }), u.registerVisitor({
2183
+ }), p.registerVisitor({
2138
2184
  from: "hyperlinks",
2139
2185
  to: "hyperlinks",
2140
2186
  openTag: (e) => {
2141
2187
  e.setSource([]);
2142
2188
  }
2143
- }), u.registerVisitor({
2189
+ }), p.registerVisitor({
2144
2190
  from: "hyperlink",
2145
2191
  to: [],
2146
2192
  openTag: (e) => {
@@ -2161,7 +2207,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2161
2207
  v: o
2162
2208
  });
2163
2209
  }
2164
- }), u.registerVisitor({
2210
+ }), p.registerVisitor({
2165
2211
  from: "drawing",
2166
2212
  to: "movables",
2167
2213
  openTag: (e) => {
@@ -2170,13 +2216,13 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2170
2216
  let r = t(n);
2171
2217
  r ? e.setSource(r.movables) : console.warn("no drawing found for rId", n);
2172
2218
  }
2173
- }), u.registerVisitor({
2219
+ }), p.registerVisitor({
2174
2220
  from: "tableParts",
2175
2221
  to: "tables",
2176
2222
  openTag: (e) => {
2177
2223
  e.setSource([]);
2178
2224
  }
2179
- }), u.registerVisitor({
2225
+ }), p.registerVisitor({
2180
2226
  from: "tablePart",
2181
2227
  to: [],
2182
2228
  openTag: (e) => {
@@ -2186,23 +2232,35 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2186
2232
  r ? e.setSource(r) : console.warn("no table found for rId", n);
2187
2233
  }
2188
2234
  });
2189
- let k = (e, t) => {
2190
- t.conditions?.length && (e.stops = p(t)), t.minLength !== void 0 && (e.minLength = t.minLength), t.maxLength !== void 0 && (e.maxLength = t.maxLength), (t.gradient ?? 1) && (e.gradient = !0), t.border && t.borderColor && (e.borderColor = t.borderColor), !t.negativeBarColorSameAsPositive && t.negativeFillColor && (e.negativeFillColor = t.negativeFillColor), !(t.negativeBarBorderColorSameAsPositive ?? 1) && t.negativeBorderColor && (e.negativeBorderColor = t.negativeBorderColor), t.axisColor && (e.axisColor = t.axisColor), t.axisPosition !== "middle" && t.axisPosition !== "none" || (e.axisPosition = t.axisPosition), t.direction !== "leftToRight" && t.direction !== "rightToLeft" || (e.direction = t.direction);
2191
- }, he = (e, t) => {
2192
- t.conditions?.length && (e.stops = p(t)), t.iconSet && t.iconSet !== e.iconSet && (e.iconSet = t.iconSet), t.icons?.length && (e.icon = t.icons), t.reverse !== void 0 && (e.reverse = t.reverse), t.showValue !== void 0 && (e.showValue = t.showValue);
2193
- }, ge = (e) => {
2194
- if (e.type !== "iconSet" || !e.iconSet || !e.sqref) return null;
2195
- let t = {
2196
- type: O.ScaleType.IconSet,
2197
- stops: []
2198
- };
2199
- return he(t, e.iconSet), {
2200
- r: e.sqref.split(/\s+/).join(","),
2201
- v: { scale: t },
2235
+ let N = (e, t) => {
2236
+ t.conditions?.length && (e.stops = ie(t)), t.minLength !== void 0 && (e.minLength = t.minLength), t.maxLength !== void 0 && (e.maxLength = t.maxLength), (t.gradient ?? 1) && (e.gradient = !0), t.border && t.borderColor && (e.borderColor = t.borderColor), !t.negativeBarColorSameAsPositive && t.negativeFillColor && (e.negativeFillColor = t.negativeFillColor), !(t.negativeBarBorderColorSameAsPositive ?? 1) && t.negativeBorderColor && (e.negativeBorderColor = t.negativeBorderColor), t.axisColor && (e.axisColor = t.axisColor), t.axisPosition !== "middle" && t.axisPosition !== "none" || (e.axisPosition = t.axisPosition), t.direction !== "leftToRight" && t.direction !== "rightToLeft" || (e.direction = t.direction);
2237
+ }, me = (e, t) => {
2238
+ t.conditions?.length && (e.stops = ie(t)), t.iconSet && t.iconSet !== e.iconSet && (e.iconSet = t.iconSet), t.icons?.length && (e.icon = t.icons), t.reverse !== void 0 && (e.reverse = t.reverse), t.showValue !== void 0 && (e.showValue = t.showValue);
2239
+ }, he = (e) => {
2240
+ if (!e.sqref) return null;
2241
+ let t = e.sqref.split(/\s+/).join(",");
2242
+ if (e.type === "iconSet") {
2243
+ if (!e.iconSet) return null;
2244
+ let n = {
2245
+ type: M.ScaleType.IconSet,
2246
+ stops: []
2247
+ };
2248
+ return me(n, e.iconSet), {
2249
+ r: t,
2250
+ v: { scale: n },
2251
+ priority: e.priority
2252
+ };
2253
+ }
2254
+ let n = g(e, l);
2255
+ if (!n) return null;
2256
+ let r = { condition: n };
2257
+ return e.style && (r.style = e.style), e.stopIfTrue && (r.stopIfTrue = !0), {
2258
+ r: t,
2259
+ v: r,
2202
2260
  priority: e.priority
2203
2261
  };
2204
2262
  };
2205
- u.registerVisitor({
2263
+ p.registerVisitor({
2206
2264
  from: "worksheet",
2207
2265
  to: {},
2208
2266
  openTag: (e) => {},
@@ -2212,23 +2270,27 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2212
2270
  let t = n[e], r = t.x14Id;
2213
2271
  if (!r) continue;
2214
2272
  delete t.x14Id;
2215
- let i = S.get(r);
2273
+ let i = de.get(r);
2216
2274
  if (!i) continue;
2217
- S.delete(r);
2275
+ de.delete(r);
2218
2276
  let a = t.v?.scale;
2219
- i.dataBar && a?.type === O.ScaleType.DataBar ? k(a, i.dataBar) : i.iconSet && a?.type === O.ScaleType.IconSet && he(a, i.iconSet);
2277
+ i.dataBar && a?.type === M.ScaleType.DataBar ? N(a, i.dataBar) : i.iconSet && a?.type === M.ScaleType.IconSet && me(a, i.iconSet);
2220
2278
  }
2221
- let r = [...S.values(), ...de];
2279
+ let r = [...de.values(), ...w], i = /* @__PURE__ */ new Set(), a = 0;
2222
2280
  for (let e = 0; e < r.length; e++) {
2223
- let i = ge(r[e]);
2224
- i ? (n || (n = [], t.conditionals = n), n.push(i)) : s?.(`x14-only conditional formatting rule (type '${r[e].type ?? "unknown"}') is not read and will be lost on resave.`);
2281
+ let o = he(r[e]);
2282
+ o ? (n || (n = [], t.conditionals = n), n.push(o)) : (i.add(r[e].type ?? "unknown"), a++);
2283
+ }
2284
+ if (a > 0) {
2285
+ let e = [...i].map((e) => `'${e}'`).join(", ");
2286
+ l?.(a === 1 ? `An x14-only conditional formatting rule (type ${e}) is not read and will be lost on resave.` : `${a} x14-only conditional formatting rules (types ${e}) are not read and will be lost on resave.`);
2225
2287
  }
2226
2288
  if (n) {
2227
2289
  n.length > 1 && n.sort((e, t) => (e.priority ?? Infinity) - (t.priority ?? Infinity));
2228
2290
  for (let e = 0; e < n.length; e++) delete n[e].priority;
2229
2291
  }
2230
2292
  }
2231
- }), u.registerVisitor({
2293
+ }), p.registerVisitor({
2232
2294
  from: "customProperties",
2233
2295
  to: "customProperties",
2234
2296
  openTag: (e) => {
@@ -2238,7 +2300,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2238
2300
  let t = e.getSource();
2239
2301
  t.length > 0 && (e.getParent().customProperties = t);
2240
2302
  }
2241
- }), u.registerVisitor({
2303
+ }), p.registerVisitor({
2242
2304
  from: "customPr",
2243
2305
  to: {},
2244
2306
  openTag: (e) => {
@@ -2249,7 +2311,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2249
2311
  let i = t(r, !0), a = e.getSource();
2250
2312
  a.resId = i, n.push(a);
2251
2313
  }
2252
- }), u.registerVisitor({
2314
+ }), p.registerVisitor({
2253
2315
  from: "sheetProtection",
2254
2316
  to: "protection",
2255
2317
  openTag: (e) => {
@@ -2260,13 +2322,13 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2260
2322
  let r = {};
2261
2323
  e.copyToObject(r, "hash", $, "hashValue"), e.copyToObject(r, "algorithm", $, "algorithmName"), e.copyToObject(r, "salt", $, "saltValue"), e.copyToObject(r, "spinCount", Z), Object.keys(r).length > 0 && (e.getSource().password = r);
2262
2324
  }
2263
- }), u.registerVisitor({
2325
+ }), p.registerVisitor({
2264
2326
  from: "protectedRanges",
2265
2327
  to: "protectedRanges",
2266
2328
  openTag: (e) => {
2267
2329
  e.setSource([]);
2268
2330
  }
2269
- }), u.registerVisitor({
2331
+ }), p.registerVisitor({
2270
2332
  from: "protectedRange",
2271
2333
  to: [],
2272
2334
  openTag: (e) => {
@@ -2284,7 +2346,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2284
2346
  let t = e.getSource();
2285
2347
  t?.r && t.v.name || e.setSource(void 0);
2286
2348
  }
2287
- }), u.registerVisitor({
2349
+ }), p.registerVisitor({
2288
2350
  from: "sheetFormatPr",
2289
2351
  to: "sheetFormatPr",
2290
2352
  openTag: (t) => {
@@ -2292,228 +2354,228 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2292
2354
  let n = t.getAttribute("customHeight");
2293
2355
  n !== "1" && n !== "true" || t.copyToObject(e, "defaultRowSize", Q, "defaultRowHeight"), t.copyToObject(e, "outlineLevelRow", Z, "outlineLevelRow");
2294
2356
  }
2295
- }), u.registerVisitor({
2357
+ }), p.registerVisitor({
2296
2358
  from: "cols",
2297
2359
  to: "cols",
2298
2360
  openTag: (e) => {
2299
2361
  e.setSource([]);
2300
2362
  }
2301
- }), u.registerVisitor({
2363
+ }), p.registerVisitor({
2302
2364
  from: "col",
2303
2365
  to: [],
2304
2366
  openTag: (e) => {
2305
2367
  let t = e.getSource(), n = e.getAttribute("min"), r = e.getAttribute("max"), i = n === void 0 ? 0 : parseInt(n) - 1, a = r === void 0 ? i : parseInt(r) - 1;
2306
- t.r = w.runToString(i, a, !0);
2368
+ t.r = O.runToString(i, a, !0);
2307
2369
  let o = {};
2308
2370
  t.v = o, e.copyToObject(o, "sz", Q, "width"), e.copyToObject(o, "csz", X, "customWidth"), e.copyToObject(o, "h", X, "hidden"), e.copyToObject(o, "l", Z, "outlineLevel"), e.copyToObject(o, "s", Z, "style");
2309
2371
  }
2310
- }), u.registerVisitor({
2372
+ }), p.registerVisitor({
2311
2373
  from: "oleObjects",
2312
2374
  to: null,
2313
2375
  openTag: (e) => {
2314
2376
  e.warn("'OLE Objects' are not supported.");
2315
2377
  }
2316
2378
  });
2317
- let ve = !1, A = !1, j = 0, ye = "", M = (e) => {
2379
+ let _e = !1, ve = !1, ye = 0, be = "", xe = (e) => {
2318
2380
  let t = e.indexOf(":");
2319
2381
  return t === -1 ? e : e.slice(t + 1);
2320
2382
  };
2321
- return ft(d, e, u.createEventHandler(e, a, s), s, c, {
2383
+ return _t(y, e, p.createEventHandler(e, o, l), l, d, {
2322
2384
  onOpenTag: (e) => {
2323
- ve = !0;
2324
- let t = M(e.name);
2325
- t === "t" || t === "v" ? j === 0 && (A = !0) : t !== "rPh" && t !== "phoneticPr" || j++;
2385
+ _e = !0;
2386
+ let t = xe(e.name);
2387
+ t === "t" || t === "v" ? ye === 0 && (ve = !0) : t !== "rPh" && t !== "phoneticPr" || ye++;
2326
2388
  },
2327
2389
  onText: (e) => {
2328
- A && (ye += e);
2390
+ ve && (be += e);
2329
2391
  },
2330
2392
  onCloseTag: (e) => {
2331
- let t = M(e.name);
2332
- t === "t" || t === "v" ? A = !1 : t !== "rPh" && t !== "phoneticPr" || j > 0 && j--;
2393
+ let t = xe(e.name);
2394
+ t === "t" || t === "v" ? ve = !1 : t !== "rPh" && t !== "phoneticPr" || ye > 0 && ye--;
2333
2395
  },
2334
2396
  onEnd: () => {
2335
- if (!ve) return;
2336
- let e = r(ne(ye));
2337
- return ve = !1, A = !1, j = 0, ye = "", e;
2397
+ if (!_e) return;
2398
+ let e = r(_(be));
2399
+ return _e = !1, ve = !1, ye = 0, be = "", e;
2338
2400
  },
2339
2401
  onError: (e) => {}
2340
- }, l);
2341
- })(e, (e, t = !1) => Ee(e, f, t) ?? null, Pe, h, () => {}, (e, t) => {
2342
- let n = t ? `${t} (${f})` : f;
2343
- E.push([e, n]);
2344
- }, void 0, N), i = await R.getTextStream(f, xe);
2345
- if (i) try {
2346
- await Je.parseStream(i, t, { xmlns: !1 });
2402
+ }, f);
2403
+ })(e, (e, t = !1) => Oe(e, d, t) ?? null, Ie, v, () => {}, (e, t) => {
2404
+ let n = t ? `${t} (${d})` : d;
2405
+ A.push([e, n]);
2406
+ }, void 0, P), r = await z.getTextStream(d, F);
2407
+ if (r) try {
2408
+ await Ze.parseStream(r, t, { xmlns: !1 });
2347
2409
  } catch (e) {
2348
- throw console.warn(`Error parsing sheet: '${f}'`, e), Error(`Error parsing sheet: '${f}'`, { cause: e });
2410
+ throw console.warn(`Error parsing sheet: '${d}'`, e), Error(`Error parsing sheet: '${d}'`, { cause: e });
2349
2411
  }
2350
- let a = L(f, u), s, c = /* @__PURE__ */ new Map();
2351
- if (a) {
2412
+ let i = Ee(d, o), l, f = /* @__PURE__ */ new Map();
2413
+ if (i) {
2352
2414
  let t;
2353
- if (a.forEach((e, t) => {
2354
- e.type === "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" && (s = Ee(t, f, !1, u)?.comments, s && s.forEach((e) => {
2415
+ if (i.forEach((e, t) => {
2416
+ e.type === "http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" && (l = Oe(t, d, !1, o)?.comments, l && l.forEach((e) => {
2355
2417
  let t = e.v;
2356
- c.set(t.id, e);
2418
+ f.set(t.id, e);
2357
2419
  }));
2358
- }), a.forEach((e, n) => {
2359
- e.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" && (t = Ee(n, f, !1, u));
2360
- }), t || s) {
2361
- let n = s ?? [], i = t?.authors, a = t?.comments, o = a ? a.length : 0;
2362
- if (a) for (let e = 0; e < o; e++) {
2363
- let t = a[e];
2420
+ }), i.forEach((e, n) => {
2421
+ e.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" && (t = Oe(n, d, !1, o));
2422
+ }), t || l) {
2423
+ let n = l ?? [], r = t?.authors, i = t?.comments, a = i ? i.length : 0;
2424
+ if (i) for (let e = 0; e < a; e++) {
2425
+ let t = i[e];
2364
2426
  if (!t) continue;
2365
- let o = t.v, s = i && o.personId !== void 0 ? i[o.personId] : o.personId;
2366
- if (s && s.startsWith("tc=") && (s = r(s.substring(3)), c.has(s))) continue;
2367
- let l = ke({ displayName: s }), u = {
2368
- id: C.uuidV4(),
2369
- personId: l.id,
2427
+ let a = t.v, o = r && a.personId !== void 0 ? r[a.personId] : a.personId;
2428
+ if (o && o.startsWith("tc=") && (o = S(o.substring(3)), f.has(o))) continue;
2429
+ let s = je({ displayName: o }), c = {
2430
+ id: E.uuidV4(),
2431
+ personId: s.id,
2370
2432
  done: !1,
2371
2433
  asNote: !0,
2372
- content: o.content
2434
+ content: a.content
2373
2435
  };
2374
2436
  n.push({
2375
2437
  r: t.r,
2376
- v: u
2438
+ v: c
2377
2439
  });
2378
2440
  }
2379
2441
  e.comments = n;
2380
2442
  }
2381
2443
  }
2382
2444
  })());
2383
- } else if (d.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink") {
2384
- let t = i(f, e, I, F, V);
2445
+ } else if (l.type === "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink") {
2446
+ let t = C(d, e, R, L, H);
2385
2447
  if (t && Object.keys(t).length !== 0) {
2386
2448
  let e = t, n = [];
2387
- L(f, u)?.forEach((e) => {
2449
+ Ee(d, o)?.forEach((e) => {
2388
2450
  e.targetMode === "External" && e.type && e.target && n.push({
2389
2451
  type: e.type,
2390
2452
  target: e.target
2391
2453
  });
2392
- }), e.identity = n, g = e;
2393
- } else g = null;
2394
- } else g = l ? t(f, e, (e, t) => {
2395
- let n = S.add({ source: { buffer: e } });
2396
- return n.addReference(j), ye.add(n), k.toResourceId(n);
2397
- }, V) : i(f, e, I, F, V);
2398
- return g;
2454
+ }), e.identity = n, y = e;
2455
+ } else y = null;
2456
+ } else y = i ? ce(d, e, (e, t) => {
2457
+ let n = b.add({ source: { buffer: e } });
2458
+ return n.addReference(ye), be.add(n), N.toResourceId(n);
2459
+ }, H) : C(d, e, R, L, H);
2460
+ return y;
2399
2461
  };
2400
- c("coreprops", u, e, I, F), c("extprops", u, e, I, F);
2401
- let De = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), Oe = c("people", u, e, I, F), B = null;
2402
- if (Oe.size > 0 && (B = Oe.entries().next()?.value?.[1]?.persons, B)) {
2403
- let e = B.length;
2462
+ w("coreprops", t, e, R, L), w("extprops", t, e, R, L);
2463
+ let ke = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), Ae = w("people", t, e, R, L), V = null;
2464
+ if (Ae.size > 0 && (V = Ae.entries().next()?.value?.[1]?.persons, V)) {
2465
+ let e = V.length;
2404
2466
  for (let t = 0; t < e; t++) {
2405
- let e = B[t];
2406
- De.set(e.id, e), e.displayName !== void 0 && z.set(e.displayName, e);
2467
+ let e = V[t];
2468
+ ke.set(e.id, e), e.displayName !== void 0 && B.set(e.displayName, e);
2407
2469
  }
2408
2470
  }
2409
- let ke = (e) => {
2471
+ let je = (e) => {
2410
2472
  if (!e) return;
2411
- if (e.id && De.has(e.id)) return De.get(e.id);
2473
+ if (e.id && ke.has(e.id)) return ke.get(e.id);
2412
2474
  let t = e.displayName;
2413
2475
  if (!e.id) {
2414
2476
  if (t) {
2415
- let e = z.get(t);
2477
+ let e = B.get(t);
2416
2478
  if (e) return e;
2417
2479
  }
2418
- e.id = C.uuidV4();
2480
+ e.id = E.uuidV4();
2419
2481
  }
2420
- let n = De.get(e.id);
2482
+ let n = ke.get(e.id);
2421
2483
  if (n) return n;
2422
2484
  let r = e;
2423
- return De.set(e.id, r), t && z.set(t, r), B ||= [], B.push(r), r;
2424
- }, V = {
2425
- paramMap: N,
2426
- getRefs: L,
2427
- getRef: Ee,
2428
- parsedRefs: P,
2429
- addPerson: ke,
2430
- serializeElement: Te
2431
- }, Ae = [];
2432
- if (d) {
2433
- let e = await R.getTextStream(d, xe);
2485
+ return ke.set(e.id, r), t && B.set(t, r), V ||= [], V.push(r), r;
2486
+ }, H = {
2487
+ paramMap: P,
2488
+ getRefs: Ee,
2489
+ getRef: Oe,
2490
+ parsedRefs: we,
2491
+ addPerson: je,
2492
+ serializeElement: De
2493
+ }, Me = [];
2494
+ if (r) {
2495
+ let e = await z.getTextStream(r, F);
2434
2496
  if (e) {
2435
2497
  let t = ((e, t) => {
2436
2498
  let n = !1, r = !1, i = 0, a = "";
2437
2499
  return {
2438
2500
  onOpenTag: (e) => {
2439
- let t = pt(e.name);
2501
+ let t = vt(e.name);
2440
2502
  t === "t" ? n && i === 0 && (r = !0) : t === "si" ? (n = !0, a = "", i = 0) : t !== "rPh" && t !== "phoneticPr" || i++;
2441
2503
  },
2442
2504
  onText: (e) => {
2443
2505
  r && (a += e);
2444
2506
  },
2445
2507
  onCloseTag: (t) => {
2446
- let o = pt(t.name);
2447
- o === "t" ? r = !1 : o === "si" ? (e(ne(a)), n = !1, a = "") : o !== "rPh" && o !== "phoneticPr" || i > 0 && i--;
2508
+ let o = vt(t.name);
2509
+ o === "t" ? r = !1 : o === "si" ? (e(_(a)), n = !1, a = "") : o !== "rPh" && o !== "phoneticPr" || i > 0 && i--;
2448
2510
  },
2449
2511
  onError: (e) => {
2450
2512
  t?.(`Error parsing shared strings: ${e?.message ?? e}`);
2451
2513
  }
2452
2514
  };
2453
2515
  })((e) => {
2454
- Ae.push(e);
2516
+ Me.push(e);
2455
2517
  }, (e) => {
2456
- E.push([e, d]);
2518
+ A.push([e, r]);
2457
2519
  });
2458
2520
  try {
2459
- await Je.parseStream(e, t, { xmlns: !1 });
2521
+ await Ze.parseStream(e, t, { xmlns: !1 });
2460
2522
  } catch (e) {
2461
- throw console.warn(`Error parsing shared strings: '${d}'`, e), Error(`Error parsing shared strings: '${d}'`, { cause: e });
2523
+ throw console.warn(`Error parsing shared strings: '${r}'`, e), Error(`Error parsing shared strings: '${r}'`, { cause: e });
2462
2524
  }
2463
2525
  }
2464
2526
  }
2465
- T?.mark("shared-strings");
2466
- let je = Ae.length, Me = /* @__PURE__ */ new Map(), Ne = je, Pe = (e) => {
2467
- let t = Me.get(e);
2527
+ k?.mark("shared-strings");
2528
+ let Ne = Me.length, Pe = /* @__PURE__ */ new Map(), Fe = Ne, Ie = (e) => {
2529
+ let t = Pe.get(e);
2468
2530
  if (t !== void 0) return t;
2469
- let n = Ne;
2470
- return Me.set(e, Ne++), Ae.push(e), n;
2471
- }, Fe = [];
2472
- u.slicersCache = Fe;
2473
- let Ie = R.getNames(), Le = Ie.length;
2474
- for (let e = 0; e < Le; e++) {
2475
- let t = Ie[e];
2476
- t && t.startsWith("xl/slicerCache") && Fe.push(`/${t}`);
2531
+ let n = Fe;
2532
+ return Pe.set(e, Fe++), Me.push(e), n;
2533
+ }, Le = [];
2534
+ t.slicersCache = Le;
2535
+ let Re = z.getNames(), ze = Re.length;
2536
+ for (let e = 0; e < ze; e++) {
2537
+ let t = Re[e];
2538
+ t && t.startsWith("xl/slicerCache") && Le.push(`/${t}`);
2477
2539
  }
2478
- let Re = c("slicersCache", u, e, I, F, V), H = /* @__PURE__ */ new Map();
2479
- Re.forEach((e) => {
2540
+ let Be = w("slicersCache", t, e, R, L, H), U = /* @__PURE__ */ new Map();
2541
+ Be.forEach((e) => {
2480
2542
  let t = e.name;
2481
- delete e.name, H.set(t, e);
2482
- }), N.set("slicerCaches", H), c("richstructure", u, e, I, F, V), c("richdata", u, e, I, F, V);
2483
- let U = c("themes", u, e, I, F, V), W = null;
2484
- if (U && U.entries) {
2485
- let e = U.entries().next();
2486
- e?.value?.[1] && (W = e.value[1]);
2543
+ delete e.name, U.set(t, e);
2544
+ }), P.set("slicerCaches", U), w("richstructure", t, e, R, L, H), w("richdata", t, e, R, L, H);
2545
+ let W = w("themes", t, e, R, L, H), G = null;
2546
+ if (W && W.entries) {
2547
+ let e = W.entries().next();
2548
+ e?.value?.[1] && (G = e.value[1]);
2487
2549
  }
2488
- let ze = new ge(W), G = c("styles", u, e, I, F, V).entries().next()?.value?.[1];
2489
- G &&= JSON.parse(de.JSONStableStringify(G));
2490
- let Be = c("workbooks", u, e, I, F, V);
2491
- T?.mark("side-parts-json"), await Promise.all(we), A && be > 0 && (A(M, M), await new Promise((e) => setTimeout(e, 0))), T?.mark("sheets");
2492
- let K = {
2493
- ...Be.entries().next().value?.[1],
2494
- styles: G,
2495
- theme: ze.toJSON()
2550
+ let Ve = new he(G), K = w("styles", t, e, R, L, H).entries().next()?.value?.[1];
2551
+ K &&= JSON.parse(T.JSONStableStringify(K));
2552
+ let He = w("workbooks", t, e, R, L, H);
2553
+ k?.mark("side-parts-json"), await Promise.all(Te), ve && Se > 0 && (ve(xe, xe), await new Promise((e) => setTimeout(e, 0))), k?.mark("sheets");
2554
+ let Ue = {
2555
+ ...He.entries().next().value?.[1],
2556
+ styles: K,
2557
+ theme: Ve.toJSON()
2496
2558
  };
2497
- if (Ae.length > 0 && (K.strings = Ae), B && B.length > 0 && (K.people = B), g) {
2498
- let e = R.getEntry("xl/vbaProject.bin");
2559
+ if (Me.length > 0 && (Ue.strings = Me), V && V.length > 0 && (Ue.people = V), l) {
2560
+ let e = z.getEntry("xl/vbaProject.bin");
2499
2561
  if (e) try {
2500
- let { VBAProject: t } = await import("./CkWprfA-u9b6Wv-6.mjs"), n = t.extract(e);
2501
- n ? (g?.(n), K.vba = n) : E.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
2562
+ let { VBAProject: t } = await import("./BknJ4AeVeFJploh9.mjs"), n = t.extract(e);
2563
+ n ? (l?.(n), Ue.vba = n) : A.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
2502
2564
  } catch (e) {
2503
- E.push([`Error extracting VBA: ${e?.message ?? e}`, "xl/vbaProject.bin"]);
2565
+ A.push([`Error extracting VBA: ${e?.message ?? e}`, "xl/vbaProject.bin"]);
2504
2566
  }
2505
2567
  }
2506
2568
  let q = null, J = {
2507
- ...v,
2508
- resources: S,
2509
- json: K,
2510
- formulaTransform: h(() => q?.getCalculation())
2569
+ ...y,
2570
+ resources: b,
2571
+ json: Ue,
2572
+ formulaTransform: f(() => q?.getCalculation())
2511
2573
  };
2512
- J.disableLoadAutoFit === void 0 && (J.disableLoadAutoFit = !1), T?.mark("json-assembled");
2513
- let Y = new ve(J);
2514
- if (q = Y, T?.mark("workbook-constructed"), Se.length > 0) {
2574
+ J.disableLoadAutoFit === void 0 && (J.disableLoadAutoFit = !1), k?.mark("json-assembled");
2575
+ let Y = new _e(J);
2576
+ if (q = Y, k?.mark("workbook-constructed"), I.length > 0) {
2515
2577
  await Y.whenCalculationReady();
2516
- let e = /* @__PURE__ */ new Map(), t = K.sheets ?? [], n = Y.getSheets().getItems();
2578
+ let e = /* @__PURE__ */ new Map(), t = Ue.sheets ?? [], n = Y.getSheets().getItems();
2517
2579
  for (let r = 0; r < t.length; r++) {
2518
2580
  let i = t[r]?.sheet, a = n[r];
2519
2581
  i && a && e.set(i, a);
@@ -2535,7 +2597,7 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2535
2597
  for (let e of t) e.formula === null && o.add(i(e.rowIndex, e.colIndex));
2536
2598
  for (let e of t) {
2537
2599
  if (e.formula === null) continue;
2538
- let t = st(e.formula), n = !0;
2600
+ let t = ft(e.formula), n = !0;
2539
2601
  for (let e of t) if (!a(e)) {
2540
2602
  n = !1;
2541
2603
  break;
@@ -2568,19 +2630,19 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2568
2630
  }).setValue("=" + e.formula);
2569
2631
  }
2570
2632
  }
2571
- })(Y, Se, e);
2633
+ })(Y, I, e);
2572
2634
  }
2573
- if (ye.forEach((e) => {
2574
- e.deleteReference(j);
2575
- }), k.endPersist(), pe) {
2576
- l(pe);
2635
+ if (be.forEach((e) => {
2636
+ e.deleteReference(ye);
2637
+ }), N.endPersist(), fe) {
2638
+ ae(fe);
2577
2639
  let e = /* @__PURE__ */ new Map(), t = 0;
2578
- for (let n of R.getNames()) {
2579
- let r = R.getEntry(n);
2640
+ for (let n of z.getNames()) {
2641
+ let r = z.getEntry(n);
2580
2642
  if (!r) continue;
2581
- let i = R.getRawEntry(n), a = i ? {
2643
+ let i = z.getRawEntry(n), a = i ? {
2582
2644
  data: r,
2583
- uncompressedSize: R.uncompressedSize(n),
2645
+ uncompressedSize: z.uncompressedSize(n),
2584
2646
  raw: {
2585
2647
  compressedData: i.data,
2586
2648
  compressionMethod: i.compressionMethod,
@@ -2588,14 +2650,14 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2588
2650
  }
2589
2651
  } : {
2590
2652
  data: r,
2591
- uncompressedSize: R.uncompressedSize(n)
2653
+ uncompressedSize: z.uncompressedSize(n)
2592
2654
  };
2593
2655
  e.set(n, a), t += r.byteLength;
2594
2656
  }
2595
- if (t > 67108864) E.push([`Source package too large to retain (${t} bytes, limit ${f}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
2657
+ if (t > 67108864) A.push([`Source package too large to retain (${t} bytes, limit ${ie}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
2596
2658
  else if (e.size > 0) {
2597
- let t = new m(e);
2598
- oe(pe, t);
2659
+ let t = new oe(e);
2660
+ d(fe, t);
2599
2661
  let n = Y.getSheets().getItems(), r = Y.getTransactions().addListener({ onCommitEnd: (e) => {
2600
2662
  let n = e.getOperation()?.name;
2601
2663
  n !== "insertCells" && n !== "deleteCells" || t.markStructuralChange();
@@ -2604,20 +2666,20 @@ var X = (e) => !0 === e || e === "1" || e === "on" || e === "true" || !1 !== e &
2604
2666
  (e.length !== n.length || e.some((e, t) => e !== n[t])) && t.markStructuralChange(), n = e;
2605
2667
  } });
2606
2668
  Y.addListeners({ onClose: () => {
2607
- r(), i(), l(pe);
2669
+ r(), i(), ae(fe);
2608
2670
  } });
2609
2671
  }
2610
2672
  }
2611
- if (E.length && me?.onWarning) for (let e of E) {
2673
+ if (A.length && pe?.onWarning) for (let e of A) {
2612
2674
  let [t, n] = e;
2613
- me.onWarning(t, n);
2675
+ pe.onWarning(t, n);
2614
2676
  }
2615
- return T && !0 === _ && console.table(T.toTable()), Y;
2677
+ return k && !0 === v && console.table(k.toTable()), Y;
2616
2678
  } catch (e) {
2617
2679
  let t = "Unable to parse XLSX.";
2618
- throw e instanceof k && (t = "Unable to open XLSX. There are too many rows or columns."), Error(t, { cause: e });
2680
+ throw e instanceof N && (t = "Unable to open XLSX. There are too many rows or columns."), Error(t, { cause: e });
2619
2681
  } finally {
2620
- await R.close().catch(() => {});
2682
+ await z.close().catch(() => {});
2621
2683
  }
2622
2684
  };
2623
- export { _t as readXLSX };
2685
+ export { St as readXLSX };