@sheetxl/io-xlsx 0.7.28-beta.3 → 0.8.0-beta.1

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