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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/browser/cjs/B0Ugu_crqQYpdfQz.cjs +1 -0
  2. package/browser/cjs/{CDs8etXnw0kbBKKv.cjs → BHM3_D9PsNURVAVy.cjs} +1 -1
  3. package/browser/cjs/BHWdwAQ322YA8JAZ.cjs +6 -0
  4. package/browser/cjs/CeuX8p1aBuKTuagi.cjs +2 -0
  5. package/browser/cjs/DSM4q1dhVVXvsgby.cjs +30 -0
  6. package/browser/cjs/DiAHwNv2I8RHE9GY.cjs +1 -0
  7. package/browser/cjs/index.cjs +1 -1
  8. package/browser/cjs/wrpXlaSBGEicQf6_.cjs +6 -0
  9. package/browser/esm/{BsNoW41d6hdpxTTS.mjs → Bu64BYvRAlVftMr1.mjs} +4 -4
  10. package/browser/esm/{CX3yVwe-BnhCk4FY.mjs → C-2KaUyV4gs-sDTZ.mjs} +2 -2
  11. package/browser/esm/{DUi-V-E_AJwTIqlO.mjs → CRrTMRdN_IcSA_pm.mjs} +2 -2
  12. package/browser/esm/{CjKioy-GzeSf08f8.mjs → CWt4fDYEbj2hvsl_.mjs} +820 -800
  13. package/browser/esm/{dsVZVtt5w_yLb967.mjs → Ccnxz-y2WBEgfvvh.mjs} +2606 -1408
  14. package/browser/esm/{B4eKxNwxJjHLN126.mjs → CxtFawTfwRTCC4Xr.mjs} +1 -1
  15. package/browser/esm/{CGXxwkCRWLc0gcRQ.mjs → D-epcZSoKLbsAIaC.mjs} +2 -2
  16. package/browser/esm/DsSIg46AR7IFBN5N.mjs +2298 -0
  17. package/browser/esm/{cJxidonaVNZHAXiZ.mjs → Dx64JMAGwNNDBkC1.mjs} +1555 -1159
  18. package/browser/esm/Sv4twwEJDb9dZ91h.mjs +149 -0
  19. package/browser/esm/index.mjs +2 -2
  20. package/node/esm/{CMq7eF1vxibUumqT.mjs → BCr4lCI6qQXXN0K1.mjs} +2 -2
  21. package/node/esm/BPn5XBizKkwaUqXB.mjs +4285 -0
  22. package/node/esm/{BRQYaMYO4UfhjJHw.mjs → BVV11IlqF6Lmlv8D.mjs} +53 -69
  23. package/node/esm/{s_yVG0m9KB14YKeN.mjs → BiJEEgltJzx94zIR.mjs} +930 -909
  24. package/node/esm/{C51yFT2l-6il_xXO.mjs → BsTMtvwpQoPNv95M.mjs} +1 -1
  25. package/node/esm/{DLBm8l0jyL2fVlxg.mjs → CBtj0-a4l2qux2hA.mjs} +2 -2
  26. package/node/esm/CkmZuMvRTpva7eQu.mjs +5074 -0
  27. package/node/esm/index.mjs +4 -4
  28. package/node/esm/j0RE2usgdljRw_gr.mjs +2345 -0
  29. package/package.json +3 -3
  30. package/types/src/AutoFilterRules.d.ts +83 -10
  31. package/types/src/OOXMLExtensions.d.ts +6 -0
  32. package/types/src/reader/dom/CustGeomUtils.d.ts +7 -0
  33. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +13 -0
  34. package/types/src/reader/domVisitors/ColorContainerVisitor.d.ts +7 -1
  35. package/types/src/reader/domVisitors/DrawingCxnSpVisitor.d.ts +1 -0
  36. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +23 -1
  37. package/types/src/reader/domVisitors/DrawingGrpSpVisitor.d.ts +9 -0
  38. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +20 -1
  39. package/types/src/reader/domVisitors/DrawingSpVisitor.d.ts +20 -1
  40. package/types/src/reader/domVisitors/DrawingVisitor.d.ts +8 -0
  41. package/types/src/reader/domVisitors/FormControlPrVisitor.d.ts +9 -0
  42. package/types/src/reader/domVisitors/ShapeTextVisitor.d.ts +44 -0
  43. package/types/src/reader/domVisitors/TextPropertiesVisitor.d.ts +13 -1
  44. package/types/src/reader/domVisitors/index.d.ts +4 -2
  45. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +1 -1
  46. package/types/src/utils/DrawingMLText.d.ts +39 -0
  47. package/types/src/utils/FormControls.d.ts +97 -0
  48. package/types/src/writer/builder/Emitter.d.ts +5 -0
  49. package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
  50. package/types/src/writer/builder/Types.d.ts +10 -0
  51. package/types/src/writer/utils/CustGeomUtils.d.ts +5 -0
  52. package/types/src/writer/utils/DrawMLUtils.d.ts +39 -2
  53. package/types/src/writer/utils/PrstGeomUtils.d.ts +6 -0
  54. package/types/src/writer/utils/TextUtils.d.ts +21 -2
  55. package/browser/cjs/17tMBnuyu4YIxixh.cjs +0 -1
  56. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  57. package/browser/cjs/BxU-OlZIQViQl7gX.cjs +0 -1
  58. package/browser/cjs/CIpMN7SDVREKQUQE.cjs +0 -6
  59. package/browser/cjs/CycnxkfuKrDdwoJN.cjs +0 -5
  60. package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +0 -2
  61. package/browser/cjs/MqKQ_B5qRARrRbO4.cjs +0 -24
  62. package/browser/esm/9n64lXAgZUe3aThr.mjs +0 -159
  63. package/browser/esm/BvAptAMpZVyBCx6-.mjs +0 -2402
  64. package/browser/esm/DwcLXqv8-6Tl1zLO.mjs +0 -24
  65. package/node/esm/BlbtH3EvAf3K4foF.mjs +0 -2450
  66. package/node/esm/DhSPOg9wN0kD87Tb.mjs +0 -3051
  67. package/node/esm/KeV-N47eTyh5YE70.mjs +0 -4642
  68. package/types/src/reader/domVisitors/HyperlinkVisitor.d.ts +0 -6
@@ -1,15 +1,15 @@
1
1
  /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.7
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.9
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: The license can be found at https://www.sheetxl.com/license.
6
6
  */
7
- import { a as t, d as e, f as s, h as o, l as r, m as i, n, p as a, s as c, t as l, u as h } from "./BRQYaMYO4UfhjJHw.mjs";
8
- import { $ as u, D as d, E as f, F as g, G as m, J as x, K as b, L as y, M as T, P as v, Q as w, R as S, V as C, W as k, X as A, Y as O, Z as E, _ as P, b as I, f as D, h as _, i as V, j as L, o as N, q as $, s as R, tt as j, u as B, v as M, w as H } from "./DhSPOg9wN0kD87Tb.mjs";
9
- import { BufferUtils as F, CommonUtils as W, ExpectedError as X } from "@sheetxl/utils";
10
- import { AddressUtils as z, CommonUtils as q, CoordUtils as U, FormulaError as G, ICondition as K, IConditionalFormat as J, IRange as Z, OutOfBoundsError as Q, PersonCollection as Y, ResourceCollection as tt, Theme as et, Tuple as st, Workbook as ot } from "@sheetxl/sdk";
11
- import { BlobReader as rt, Uint8ArrayReader as it, Uint8ArrayWriter as nt, ZipReader as at } from "@zip.js/zip.js";
12
- var ct = /* @__PURE__ */ new Uint8Array(0), lt = class t {
7
+ import { At as t, Bt as e, Ct as s, Dt as o, Et as r, Ft as i, Gt as n, Ht as a, It as c, J as l, K as h, Lt as u, Nt as d, Pt as p, Rt as f, Ut as g, Vt as m, W as x, Y as y, _ as b, bt as T, et as v, ft as w, i as S, it as C, o as A, ot as E, p as P, pt as O, rt as I, s as D, ut as _, vt as V, wt as L, xt as N, yt as $, zt as R } from "./BPn5XBizKkwaUqXB.mjs";
8
+ import { a as B, c as j, i as M, l as H, n as F, o as W, r as z, s as X, t as q } from "./BVV11IlqF6Lmlv8D.mjs";
9
+ import { BufferUtils as U, CommonUtils as G, ExpectedError as K } from "@sheetxl/utils";
10
+ import { AddressUtils as J, CommonUtils as Z, CoordUtils as Q, FormulaError as Y, ICondition as tt, IConditionalFormat as et, IRange as st, OutOfBoundsError as ot, PersonCollection as rt, ResourceCollection as it, Theme as nt, Tuple as at, Workbook as ct } from "@sheetxl/sdk";
11
+ import { BlobReader as lt, Uint8ArrayReader as ht, Uint8ArrayWriter as ut, ZipReader as dt } from "@zip.js/zip.js";
12
+ var pt = /* @__PURE__ */ new Uint8Array(0), ft = 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 ct = /* @__PURE__ */ new Uint8Array(0), lt = 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 ? ct : e instanceof Uint8Array ? e : new Uint8Array(e), o = new at(e instanceof Blob ? new rt(e) : new it(s)), r = /* @__PURE__ */ new Map();
20
+ const s = e instanceof Blob ? pt : e instanceof Uint8Array ? e : new Uint8Array(e), o = new dt(e instanceof Blob ? new lt(e) : new ht(s)), r = /* @__PURE__ */ new Map();
21
21
  for (const t of await o.getEntries()) t.directory || r.set(t.filename, t);
22
22
  return new t(o, r, s);
23
23
  }
@@ -35,12 +35,12 @@ var ct = /* @__PURE__ */ new Uint8Array(0), lt = class t {
35
35
  if (o) return o;
36
36
  const r = this.entries.get(s);
37
37
  if (!r) return null;
38
- const i = await r.getData(new nt());
38
+ const i = await r.getData(new ut());
39
39
  return this.buffers.set(s, i), i;
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 nt()).then((t) => {
43
+ for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new ut()).then((t) => {
44
44
  this.buffers.set(s, t);
45
45
  }));
46
46
  await Promise.all(e);
@@ -83,18 +83,18 @@ var ct = /* @__PURE__ */ new Uint8Array(0), lt = class t {
83
83
  async close() {
84
84
  await this.zip.close();
85
85
  }
86
- }, ht = class {
86
+ }, gt = class {
87
87
  constructor(t) {
88
- this._sink = t, this._samples = [], this._t0 = ut(), this._tPrev = this._t0, this._heapPrev = pt();
88
+ this._sink = t, this._samples = [], this._t0 = mt(), this._tPrev = this._t0, this._heapPrev = xt();
89
89
  }
90
90
  mark(t) {
91
- const e = ut(), s = pt(), o = {
91
+ const e = mt(), s = xt(), 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: dt()
97
+ rssBytes: yt()
98
98
  };
99
99
  this._tPrev = e, this._heapPrev = s, this._samples.push(o), this._sink?.(o);
100
100
  }
@@ -106,91 +106,91 @@ var ct = /* @__PURE__ */ new Uint8Array(0), lt = 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 ? ft(t.heapBytes / 1048576) : "—",
110
- dHeapMB: void 0 !== t.dHeapBytes ? ft(t.dHeapBytes / 1048576) : "—",
111
- rssMB: void 0 !== t.rssBytes ? ft(t.rssBytes / 1048576) : "—"
109
+ heapMB: void 0 !== t.heapBytes ? bt(t.heapBytes / 1048576) : "—",
110
+ dHeapMB: void 0 !== t.dHeapBytes ? bt(t.dHeapBytes / 1048576) : "—",
111
+ rssMB: void 0 !== t.rssBytes ? bt(t.rssBytes / 1048576) : "—"
112
112
  }));
113
113
  }
114
- }, ut = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
115
- function pt() {
114
+ }, mt = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
115
+ function xt() {
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 dt() {
121
+ function yt() {
122
122
  const t = globalThis.process;
123
123
  if ("object" == typeof t && "function" == typeof t.memoryUsage) return t.memoryUsage().rss;
124
124
  }
125
- function ft(t) {
125
+ function bt(t) {
126
126
  return Math.round(10 * t) / 10;
127
127
  }
128
- var gt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", mt = `-${gt}.0-9·̀-ͯ‿-⁀`, xt = (new RegExp(`^[${gt}]$`, "u"), new RegExp(`^[${mt}]$`, "u"), new RegExp(`^[${gt}][${mt}]*$`, "u")), bt = (new RegExp(`^[${mt}]+$`, "u"), [
128
+ var Tt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", vt = `-${Tt}.0-9·̀-ͯ‿-⁀`, wt = (new RegExp(`^[${Tt}]$`, "u"), new RegExp(`^[${vt}]$`, "u"), new RegExp(`^[${Tt}][${vt}]*$`, "u")), St = (new RegExp(`^[${vt}]+$`, "u"), [
129
129
  32,
130
130
  10,
131
131
  13,
132
132
  9
133
133
  ]);
134
- function yt(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 Tt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", vt = `-${Tt}.0-9·̀-ͯ‿-⁀`;
138
- new RegExp(`^[${Tt}]$`, "u"), new RegExp(`^[${vt}]$`, "u"), new RegExp(`^[${Tt}][${vt}]*$`, "u"), new RegExp(`^[${vt}]+$`, "u");
139
- var wt = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", St = `-${wt}.0-9·̀-ͯ‿-⁀`, Ct = (new RegExp(`^[${wt}]$`, "u"), new RegExp(`^[${St}]$`, "u"), new RegExp(`^[${wt}][${St}]*$`, "u"));
140
- function kt(t) {
137
+ var kt = ":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", At = `-${kt}.0-9·̀-ͯ‿-⁀`;
138
+ new RegExp(`^[${kt}]$`, "u"), new RegExp(`^[${At}]$`, "u"), new RegExp(`^[${kt}][${At}]*$`, "u"), new RegExp(`^[${At}]+$`, "u");
139
+ var Et = "A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿", Pt = `-${Et}.0-9·̀-ͯ‿-⁀`, Ot = (new RegExp(`^[${Et}]$`, "u"), new RegExp(`^[${Pt}]$`, "u"), new RegExp(`^[${Et}][${Pt}]*$`, "u"));
140
+ function It(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 At = function(t) {
143
+ var Dt = function(t) {
144
144
  return 32 === t || 10 === t || 13 === t || 9 === t;
145
- }, Ot = function(t) {
145
+ }, _t = function(t) {
146
146
  return t >= 32 && t <= 55295 || 10 === t || 13 === t || 9 === t || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
147
- }, Et = yt, Pt = function(t) {
148
- return yt(t) || t >= 48 && t <= 57 || 45 === t || 46 === t || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
149
- }, It = bt, Dt = xt, _t = function(t) {
147
+ }, Vt = Ct, Lt = 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
+ }, Nt = St, $t = wt, Rt = function(t) {
150
150
  return t >= 1 && t <= 55295 || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
151
- }, Vt = kt, Lt = function(t) {
152
- return kt(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
153
- }, Nt = Ct, $t = "http://www.w3.org/XML/1998/namespace", Rt = "http://www.w3.org/2000/xmlns/", jt = {
151
+ }, Bt = It, jt = function(t) {
152
+ return It(t) || 45 === t || 46 === t || t >= 48 && t <= 57 || 183 === t || t >= 768 && t <= 879 || t >= 8255 && t <= 8256;
153
+ }, Mt = Ot, Ht = "http://www.w3.org/XML/1998/namespace", Ft = "http://www.w3.org/2000/xmlns/", Wt = {
154
154
  __proto__: null,
155
- xml: $t,
156
- xmlns: Rt
157
- }, Bt = {
155
+ xml: Ht,
156
+ xmlns: Ft
157
+ }, zt = {
158
158
  __proto__: null,
159
159
  amp: "&",
160
160
  gt: ">",
161
161
  lt: "<",
162
162
  quot: "\"",
163
163
  apos: "'"
164
- }, Mt = -1, Ht = -2, Ft = 13, Wt = 33, Xt = 10, zt = 60, qt = 61, Ut = 62, Gt = 63, Kt = 93, Jt = (t) => 34 === t || 39 === t, Zt = [34, 39], Qt = [
165
- ...Zt,
164
+ }, Xt = -1, qt = -2, Ut = 13, Gt = 33, Kt = 10, Jt = 60, Zt = 61, Qt = 62, Yt = 63, te = 93, ee = (t) => 34 === t || 39 === t, se = [34, 39], oe = [
165
+ ...se,
166
166
  91,
167
- Ut
168
- ], Yt = [
169
- ...Zt,
170
- zt,
171
- Kt
172
- ], te = [
173
- qt,
174
- Gt,
175
- ...It
176
- ], ee = [
177
- ...It,
178
- Ut,
167
+ Qt
168
+ ], re = [
169
+ ...se,
170
+ Jt,
171
+ te
172
+ ], ie = [
173
+ Zt,
174
+ Yt,
175
+ ...Nt
176
+ ], ne = [
177
+ ...Nt,
178
+ Qt,
179
179
  38,
180
- zt
180
+ Jt
181
181
  ];
182
- function se(t, e, s) {
182
+ function ae(t, e, s) {
183
183
  switch (e) {
184
184
  case "xml":
185
- s !== $t && t.fail(`xml prefix must be bound to ${$t}.`);
185
+ s !== Ht && t.fail(`xml prefix must be bound to ${Ht}.`);
186
186
  break;
187
- case "xmlns": s !== Rt && t.fail(`xmlns prefix must be bound to ${Rt}.`);
187
+ case "xmlns": s !== Ft && t.fail(`xmlns prefix must be bound to ${Ft}.`);
188
188
  }
189
189
  switch (s) {
190
- case Rt:
191
- t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Rt}.`);
190
+ case Ft:
191
+ t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${Ft}.`);
192
192
  break;
193
- case $t: switch (e) {
193
+ case Ht: 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 se(t, e, s) {
199
199
  }
200
200
  }
201
201
  }
202
- var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
202
+ var ce, le = (t) => Mt.test(t), he = (t) => $t.test(t), ue = {
203
203
  xmldecl: "xmlDeclHandler",
204
204
  text: "textHandler",
205
205
  processinginstruction: "piHandler",
@@ -213,7 +213,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
213
213
  error: "errorHandler",
214
214
  end: "endHandler",
215
215
  ready: "readyHandler"
216
- }, ae = class {
216
+ }, de = class {
217
217
  get closed() {
218
218
  return this._closed;
219
219
  }
@@ -221,15 +221,15 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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 = Vt, this.nameCheck = Lt, this.isName = re, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
224
+ this.nameStartCheck = Bt, this.nameCheck = jt, this.isName = le, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
225
225
  __proto__: null,
226
- ...jt
226
+ ...Wt
227
227
  };
228
228
  const t = this.opt.additionalNamespaces;
229
229
  null != t && (function(t, e) {
230
- for (const s of Object.keys(e)) se(t, s, e[s]);
230
+ for (const s of Object.keys(e)) ae(t, s, e[s]);
231
231
  }(this, t), Object.assign(this.ns, t));
232
- } else this.nameStartCheck = Et, this.nameCheck = Pt, this.isName = ie, this.processAttribs = this.processAttribsPlain, this.pushAttrib = this.pushAttribPlain;
232
+ } else this.nameStartCheck = Vt, this.nameCheck = Lt, this.isName = he, 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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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 ? Ft : 0, this.reportedTextBeforeRoot = this.reportedTextAfterRoot = this.closedRoot = this.sawRoot = t, this.xmlDeclPossible = !t, this.xmlDeclExpects = ["version"], this.entityReturnState = void 0;
284
+ this.state = t ? Ut : 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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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(Bt), this.readyHandler?.();
294
+ }, this.line = 1, this.column = 0, this.ENTITIES = Object.create(zt), this.readyHandler?.();
295
295
  }
296
296
  get position() {
297
297
  return this.chunkPosition + this.i;
@@ -300,10 +300,10 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
300
300
  return this.position - this.positionAtNewLine;
301
301
  }
302
302
  on(t, e) {
303
- this[ne[t]] = e;
303
+ this[ue[t]] = e;
304
304
  }
305
305
  off(t) {
306
- this[ne[t]] = void 0;
306
+ this[ue[t]] = void 0;
307
307
  }
308
308
  makeError(t) {
309
309
  let e = this.fileName ?? "";
@@ -330,13 +330,13 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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 Mt;
333
+ if (this.prevI = e, this.i++, e >= t.length) return Xt;
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 Xt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Xt;
339
- case 13: return t.charCodeAt(e + 1) === Xt && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, Ht;
338
+ case Kt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Kt;
339
+ case 13: return t.charCodeAt(e + 1) === Kt && (this.i = e + 2), this.line++, this.column = 0, this.positionAtNewLine = this.position, qt;
340
340
  default: return this.fail("disallowed character."), s;
341
341
  }
342
342
  }
@@ -346,18 +346,18 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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 Mt;
349
+ if (this.prevI = e, this.i = e + 1, e >= t.length) return Xt;
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 Xt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Xt;
354
+ case Kt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Kt;
355
355
  case 13: {
356
356
  const s = t.charCodeAt(e + 1);
357
- s !== Xt && 133 !== s || (this.i = e + 2);
357
+ s !== Kt && 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, Ht;
360
+ case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, qt;
361
361
  default: return this.fail("disallowed character."), s;
362
362
  }
363
363
  }
@@ -367,7 +367,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
367
367
  }
368
368
  getCodeNorm() {
369
369
  const t = this.getCode();
370
- return t === Ht ? Xt : t;
370
+ return t === qt ? Kt : t;
371
371
  }
372
372
  unGet() {
373
373
  this.i = this.prevI, this.column--;
@@ -376,8 +376,8 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
376
376
  let { i: e } = this;
377
377
  const { chunk: s } = this;
378
378
  for (;;) {
379
- const o = this.getCode(), r = o === Ht, i = r ? Xt : o;
380
- if (i === Mt || t.includes(i)) return this.text += s.slice(e, this.prevI), i;
379
+ const o = this.getCode(), r = o === qt, i = r ? Kt : o;
380
+ if (i === Xt || t.includes(i)) return this.text += s.slice(e, this.prevI), i;
381
381
  r && (this.text += `${s.slice(e, this.prevI)}\n`, e = this.i);
382
382
  }
383
383
  }
@@ -387,10 +387,10 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
387
387
  for (;;) {
388
388
  let o = this.getCode();
389
389
  switch (o) {
390
- case Ht:
391
- this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = Xt;
390
+ case qt:
391
+ this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = Kt;
392
392
  break;
393
- case Mt: return this.text += s.slice(e), !1;
393
+ case Xt: 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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
399
399
  const { chunk: t, i: e } = this;
400
400
  for (;;) {
401
401
  const s = this.getCode();
402
- if (s === Mt) return this.name += t.slice(e), Mt;
403
- if (!Pt(s)) return this.name += t.slice(e, this.prevI), s === Ht ? Xt : s;
402
+ if (s === Xt) return this.name += t.slice(e), Xt;
403
+ if (!Lt(s)) return this.name += t.slice(e, this.prevI), s === qt ? Kt : s;
404
404
  }
405
405
  }
406
406
  skipSpaces() {
407
407
  for (;;) {
408
408
  const t = this.getCodeNorm();
409
- if (t === Mt || !At(t)) return t;
409
+ if (t === Xt || !Dt(t)) return t;
410
410
  }
411
411
  }
412
412
  setXMLVersion(t) {
413
- this.currentXMLVersion = t, "1.0" === t ? (this.isChar = Ot, this.getCode = this.getCode10) : (this.isChar = _t, this.getCode = this.getCode11);
413
+ this.currentXMLVersion = t, "1.0" === t ? (this.isChar = _t, this.getCode = this.getCode10) : (this.isChar = Rt, 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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
418
418
  sBeginWhitespace() {
419
419
  const t = this.i, e = this.skipSpaces();
420
420
  switch (this.prevI !== t && (this.xmlDeclPossible = !1), e) {
421
- case zt:
421
+ case Jt:
422
422
  if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
423
423
  break;
424
- case Mt: break;
425
- default: this.unGet(), this.state = Ft, this.xmlDeclPossible = !1;
424
+ case Xt: break;
425
+ default: this.unGet(), this.state = Ut, this.xmlDeclPossible = !1;
426
426
  }
427
427
  }
428
428
  sDoctype() {
429
- const t = this.captureTo(Qt);
429
+ const t = this.captureTo(oe);
430
430
  switch (t) {
431
- case Ut:
432
- this.doctypeHandler?.(this.text), this.text = "", this.state = Ft, this.doctype = !0;
431
+ case Qt:
432
+ this.doctypeHandler?.(this.text), this.text = "", this.state = Ut, this.doctype = !0;
433
433
  break;
434
- case Mt: break;
435
- default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : Jt(t) && (this.state = 3, this.q = t);
434
+ case Xt: break;
435
+ default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : ee(t) && (this.state = 3, this.q = t);
436
436
  }
437
437
  }
438
438
  sDoctypeQuote() {
@@ -440,8 +440,8 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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(Yt);
444
- t !== Mt && (this.text += String.fromCodePoint(t), t === Kt ? this.state = 2 : t === zt ? this.state = 6 : Jt(t) && (this.state = 5, this.q = t));
443
+ const t = this.captureTo(re);
444
+ t !== Xt && (this.text += String.fromCodePoint(t), t === te ? this.state = 2 : t === Jt ? this.state = 6 : ee(t) && (this.state = 5, this.q = t));
445
445
  }
446
446
  sDTDQuoted() {
447
447
  const t = this.q;
@@ -453,7 +453,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
453
453
  case 33:
454
454
  this.state = 7, this.openWakaBang = "";
455
455
  break;
456
- case Gt:
456
+ case Yt:
457
457
  this.state = 11;
458
458
  break;
459
459
  default: this.state = 4;
@@ -472,14 +472,14 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
472
472
  }
473
473
  sDTDCommentEnded() {
474
474
  const t = this.getCodeNorm();
475
- this.text += String.fromCodePoint(t), t === Ut ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
475
+ this.text += String.fromCodePoint(t), t === Qt ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
476
476
  }
477
477
  sDTDPI() {
478
- this.captureToChar(Gt) && (this.text += "?", this.state = 12);
478
+ this.captureToChar(Yt) && (this.text += "?", this.state = 12);
479
479
  }
480
480
  sDTDPIEnding() {
481
481
  const t = this.getCodeNorm();
482
- this.text += String.fromCodePoint(t), t === Ut && (this.state = 4);
482
+ this.text += String.fromCodePoint(t), t === Qt && (this.state = 4);
483
483
  }
484
484
  sText() {
485
485
  0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
@@ -488,23 +488,23 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
488
488
  let { i: t } = this;
489
489
  const { chunk: e } = this;
490
490
  t: for (;;) switch (this.getCode()) {
491
- case Ht:
491
+ case qt:
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 r;
497
- this.state = s, "" === o ? (this.fail("empty entity name."), r = "&;") : (r = this.parseEntity(o), this.entity = ""), s === Ft && void 0 === this.textHandler || (this.text += r);
497
+ this.state = s, "" === o ? (this.fail("empty entity name."), r = "&;") : (r = this.parseEntity(o), this.entity = ""), s === Ut && void 0 === this.textHandler || (this.text += r);
498
498
  break t;
499
499
  }
500
- case Mt:
500
+ case Xt:
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 (Et(t)) this.state = 34, this.unGet(), this.xmlDeclPossible = !1;
507
+ if (Vt(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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
512
512
  case 33:
513
513
  this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
514
514
  break;
515
- case Gt:
515
+ case Yt:
516
516
  this.state = 23;
517
517
  break;
518
- default: this.fail("disallowed character in tag name"), this.state = Ft, this.xmlDeclPossible = !1;
518
+ default: this.fail("disallowed character in tag name"), this.state = Ut, this.xmlDeclPossible = !1;
519
519
  }
520
520
  }
521
521
  sOpenWakaBang() {
@@ -541,22 +541,22 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
541
541
  }
542
542
  sCommentEnded() {
543
543
  const t = this.getCodeNorm();
544
- t !== Ut ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = Ft;
544
+ t !== Qt ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = Ut;
545
545
  }
546
546
  sCData() {
547
- this.captureToChar(Kt) && (this.state = 21);
547
+ this.captureToChar(te) && (this.state = 21);
548
548
  }
549
549
  sCDataEnding() {
550
550
  const t = this.getCodeNorm();
551
- t === Kt ? this.state = 22 : (this.text += `]${String.fromCodePoint(t)}`, this.state = 20);
551
+ t === te ? 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 Ut:
557
- this.cdataHandler?.(this.text), this.text = "", this.state = Ft;
556
+ case Qt:
557
+ this.cdataHandler?.(this.text), this.text = "", this.state = Ut;
558
558
  break;
559
- case Kt:
559
+ case te:
560
560
  this.text += "]";
561
561
  break;
562
562
  default: this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
@@ -564,17 +564,17 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
564
564
  }
565
565
  sPIFirstChar() {
566
566
  const t = this.getCodeNorm();
567
- this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t === Gt || At(t) ? (this.fail("processing instruction without a target."), this.state = t === Gt ? 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 === Yt || Dt(t) ? (this.fail("processing instruction without a target."), this.state = t === Yt ? 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 === Mt) return void (this.piTarget += t.slice(e));
573
+ if (s === Xt) 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 === Gt;
577
- o || At(s) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = o ? Wt : 27) : this.state = o ? 26 : 25 : (this.fail("disallowed character in processing instruction name."), this.piTarget += String.fromCodePoint(s));
576
+ const o = s === Yt;
577
+ o || Dt(s) ? "xml" === this.piTarget ? (this.xmlDeclPossible || this.fail("an XML declaration must be at the start of the document."), this.state = o ? Gt : 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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
582
582
  sPIBody() {
583
583
  if (0 === this.text.length) {
584
584
  const t = this.getCodeNorm();
585
- t === Gt ? this.state = 26 : At(t) || (this.text = String.fromCodePoint(t));
586
- } else this.captureToChar(Gt) && (this.state = 26);
585
+ t === Yt ? this.state = 26 : Dt(t) || (this.text = String.fromCodePoint(t));
586
+ } else this.captureToChar(Yt) && (this.state = 26);
587
587
  }
588
588
  sPIEnding() {
589
589
  const t = this.getCodeNorm();
590
- if (t === Ut) {
590
+ if (t === Qt) {
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 = Ft;
596
- } else t === Gt ? this.text += "?" : (this.text += `?${String.fromCodePoint(t)}`, this.state = 25);
595
+ }), this.piTarget = this.text = "", this.state = Ut;
596
+ } else t === Yt ? 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 !== Gt ? t !== Mt && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Wt;
601
+ t !== Yt ? t !== Xt && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Gt;
602
602
  }
603
603
  sXMLDeclName() {
604
- const t = this.captureTo(te);
605
- if (t === Gt) return this.state = Wt, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
606
- if (At(t) || t === qt) {
604
+ const t = this.captureTo(ie);
605
+ if (t === Yt) return this.state = Gt, this.name += this.text, this.text = "", void this.fail("XML declaration is incomplete.");
606
+ if (Dt(t) || t === Zt) {
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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
613
613
  break;
614
614
  default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
615
615
  }
616
- this.state = t === qt ? 30 : 29;
616
+ this.state = t === Zt ? 30 : 29;
617
617
  }
618
618
  }
619
619
  sXMLDeclEq() {
620
620
  const t = this.getCodeNorm();
621
- if (t === Gt) return this.state = Wt, void this.fail("XML declaration is incomplete.");
622
- At(t) || (t !== qt && this.fail("value required."), this.state = 30);
621
+ if (t === Yt) return this.state = Gt, void this.fail("XML declaration is incomplete.");
622
+ Dt(t) || (t !== Zt && this.fail("value required."), this.state = 30);
623
623
  }
624
624
  sXMLDeclValueStart() {
625
625
  const t = this.getCodeNorm();
626
- if (t === Gt) return this.state = Wt, void this.fail("XML declaration is incomplete.");
627
- At(t) || (Jt(t) ? this.q = t : (this.fail("value must be quoted."), this.q = 32), this.state = 31);
626
+ if (t === Yt) return this.state = Gt, void this.fail("XML declaration is incomplete.");
627
+ Dt(t) || (ee(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, Gt]);
631
- if (t === Gt) return this.state = Wt, this.text = "", void this.fail("XML declaration is incomplete.");
632
- if (t === Mt) return;
630
+ const t = this.captureTo([this.q, Yt]);
631
+ if (t === Yt) return this.state = Gt, this.text = "", void this.fail("XML declaration is incomplete.");
632
+ if (t === Xt) return;
633
633
  const e = this.text;
634
634
  switch (this.text = "", this.name) {
635
635
  case "version": {
@@ -647,52 +647,52 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
647
647
  }
648
648
  sXMLDeclSeparator() {
649
649
  const t = this.getCodeNorm();
650
- t !== Gt ? (At(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = Wt;
650
+ t !== Yt ? (Dt(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = Gt;
651
651
  }
652
652
  sXMLDeclEnding() {
653
- this.getCodeNorm() === Ut ? ("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 = Ft) : this.fail("The character ? is disallowed anywhere in XML declarations."), this.xmlDeclPossible = !1;
653
+ this.getCodeNorm() === Qt ? ("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 = Ut) : 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 === Mt) return;
657
+ if (t === Xt) 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 Ut:
663
+ case Qt:
664
664
  this.openTag();
665
665
  break;
666
666
  case 47:
667
667
  this.state = 35;
668
668
  break;
669
- default: At(t) || this.fail("disallowed character in tag name."), this.state = 36;
669
+ default: Dt(t) || this.fail("disallowed character in tag name."), this.state = 36;
670
670
  }
671
671
  }
672
672
  sOpenTagSlash() {
673
- this.getCode() === Ut ? this.openSelfClosingTag() : (this.fail("forward-slash in opening tag not followed by >."), this.state = 36);
673
+ this.getCode() === Qt ? 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 !== Mt && (Et(t) ? (this.unGet(), this.state = 37) : t === Ut ? this.openTag() : 47 === t ? this.state = 35 : this.fail("disallowed character in attribute name."));
677
+ t !== Xt && (Vt(t) ? (this.unGet(), this.state = 37) : t === Qt ? 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 === qt ? this.state = 39 : At(t) ? this.state = 38 : t === Ut ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== Mt && this.fail("disallowed character in attribute name.");
681
+ t === Zt ? this.state = 39 : Dt(t) ? this.state = 38 : t === Qt ? (this.fail("attribute without value."), this.pushAttrib(this.name, this.name), this.name = this.text = "", this.openTag()) : t !== Xt && this.fail("disallowed character in attribute name.");
682
682
  }
683
683
  sAttribNameSawWhite() {
684
684
  const t = this.skipSpaces();
685
685
  switch (t) {
686
- case Mt: return;
687
- case qt:
686
+ case Xt: return;
687
+ case Zt:
688
688
  this.state = 39;
689
689
  break;
690
- default: this.fail("attribute without value."), this.text = "", this.name = "", t === Ut ? this.openTag() : Et(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 === Qt ? this.openTag() : Vt(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
- Jt(t) ? (this.q = t, this.state = 40) : At(t) || (this.fail("unquoted attribute value."), this.state = 42, this.unGet());
695
+ ee(t) ? (this.q = t, this.state = 40) : Dt(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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
704
704
  case 38:
705
705
  this.text += e.slice(s, this.prevI), this.state = 14, this.entityReturnState = 40;
706
706
  return;
707
- case Xt:
708
- case Ht:
707
+ case Kt:
708
+ case qt:
709
709
  case 9:
710
710
  this.text += `${e.slice(s, this.prevI)} `, s = this.i;
711
711
  break;
712
- case zt:
712
+ case Jt:
713
713
  this.text += e.slice(s, this.prevI), this.fail("disallowed character.");
714
714
  return;
715
- case Mt:
715
+ case Xt:
716
716
  this.text += e.slice(s);
717
717
  return;
718
718
  }
719
719
  }
720
720
  sAttribValueClosed() {
721
721
  const t = this.getCodeNorm();
722
- At(t) ? this.state = 36 : t === Ut ? this.openTag() : 47 === t ? this.state = 35 : Et(t) ? (this.fail("no whitespace between attributes."), this.unGet(), this.state = 37) : this.fail("disallowed character in attribute name.");
722
+ Dt(t) ? this.state = 36 : t === Qt ? this.openTag() : 47 === t ? this.state = 35 : Vt(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(ee);
725
+ const t = this.captureTo(ne);
726
726
  switch (t) {
727
727
  case 38:
728
728
  this.state = 14, this.entityReturnState = 42;
729
729
  break;
730
- case zt:
730
+ case Jt:
731
731
  this.fail("disallowed character.");
732
732
  break;
733
- case Mt: 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 === Ut ? this.openTag() : this.state = 36;
733
+ case Xt: 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 === Qt ? this.openTag() : this.state = 36;
735
735
  }
736
736
  }
737
737
  sCloseTag() {
738
738
  const t = this.captureNameChars();
739
- t === Ut ? this.closeTag() : At(t) ? this.state = 44 : t !== Mt && this.fail("disallowed character in closing tag.");
739
+ t === Qt ? this.closeTag() : Dt(t) ? this.state = 44 : t !== Xt && this.fail("disallowed character in closing tag.");
740
740
  }
741
741
  sCloseTagSawWhite() {
742
742
  switch (this.skipSpaces()) {
743
- case Ut:
743
+ case Qt:
744
744
  this.closeTag();
745
745
  break;
746
- case Mt: break;
746
+ case Xt: break;
747
747
  default: this.fail("disallowed character in closing tag.");
748
748
  }
749
749
  }
@@ -751,7 +751,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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 zt:
754
+ case Jt:
755
755
  if (this.state = 15, void 0 !== o) {
756
756
  const { text: e } = this, r = s.slice(t, this.prevI);
757
757
  0 !== e.length ? (o(e + r), this.text = "") : 0 !== r.length && o(r);
@@ -759,9 +759,9 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
759
759
  e = 0;
760
760
  break t;
761
761
  case 38:
762
- this.state = 14, this.entityReturnState = Ft, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
762
+ this.state = 14, this.entityReturnState = Ut, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
763
763
  break t;
764
- case Kt:
764
+ case te:
765
765
  switch (e) {
766
766
  case 0:
767
767
  e = 1;
@@ -773,13 +773,13 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
773
773
  default: throw new Error("impossible state");
774
774
  }
775
775
  break;
776
- case Ut:
776
+ case Qt:
777
777
  2 === e && this.fail("the string \"]]>\" is disallowed in char data."), e = 0;
778
778
  break;
779
- case Ht:
779
+ case qt:
780
780
  void 0 !== o && (this.text += `${s.slice(t, this.prevI)}\n`), t = this.i, e = 0;
781
781
  break;
782
- case Mt:
782
+ case Xt:
783
783
  void 0 !== o && (this.text += s.slice(t));
784
784
  break t;
785
785
  default: e = 0;
@@ -793,22 +793,22 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
793
793
  t: for (;;) {
794
794
  const r = this.getCode();
795
795
  switch (r) {
796
- case zt:
796
+ case Jt:
797
797
  if (this.state = 15, void 0 !== s) {
798
798
  const { text: o } = this, r = e.slice(t, this.prevI);
799
799
  0 !== o.length ? (s(o + r), this.text = "") : 0 !== r.length && s(r);
800
800
  }
801
801
  break t;
802
802
  case 38:
803
- this.state = 14, this.entityReturnState = Ft, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
803
+ this.state = 14, this.entityReturnState = Ut, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
804
804
  break t;
805
- case Ht:
805
+ case qt:
806
806
  void 0 !== s && (this.text += `${e.slice(t, this.prevI)}\n`), t = this.i;
807
807
  break;
808
- case Mt:
808
+ case Xt:
809
809
  void 0 !== s && (this.text += e.slice(t));
810
810
  break t;
811
- default: At(r) || (o = !0);
811
+ default: Dt(r) || (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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
822
822
  };
823
823
  if (this.attribList.push(r), this.attributeHandler?.(r), "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, se(this, o, t);
825
+ "1.0" === this.currentXMLVersion && "" === t && this.fail("invalid attempt to undefine prefix in XML 1.0"), this.topNS[o] = t, ae(this, o, t);
826
826
  } else if ("xmlns" === t) {
827
827
  const t = e.trim();
828
- this.topNS[""] = t, se(this, "", t);
828
+ this.topNS[""] = t, ae(this, "", t);
829
829
  }
830
830
  }
831
831
  pushAttribPlain(t, e) {
@@ -842,7 +842,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
842
842
  const e = t.pop();
843
843
  this.fail(`unclosed tag: ${e.name}`);
844
844
  }
845
- 0 !== this.state && this.state !== Ft && this.fail("unexpected end.");
845
+ 0 !== this.state && this.state !== Ut && 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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
878
878
  for (const e of t) {
879
879
  const { name: t, prefix: r, local: i } = e;
880
880
  let n, a;
881
- "" === r ? (n = "xmlns" === t ? Rt : "", a = t) : (n = this.resolve(r), void 0 === n && (this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`), n = r), a = `{${n}}${i}`), o.has(a) && this.fail(`duplicate attribute: ${a}.`), o.add(a), e.uri = n, s[t] = e;
881
+ "" === r ? (n = "xmlns" === t ? Ft : "", a = t) : (n = this.resolve(r), void 0 === n && (this.fail(`unbound namespace prefix: ${JSON.stringify(r)}.`), n = r), a = `{${n}}${i}`), 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 oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
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 = Ft, this.name = "";
893
+ e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = Ut, 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 = Ft, 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 = Ut, this.name = "";
899
899
  }
900
900
  closeTag() {
901
901
  const { tags: t, name: e } = this;
902
- if (this.state = Ft, this.name = "", "" === e) return this.fail("weird empty close tag."), void (this.text += "</>");
902
+ if (this.state = Ut, 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;) {
@@ -917,21 +917,21 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
917
917
  let e = NaN;
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
- }, ce = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, le = {
920
+ }, pe = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, fe = {
921
921
  amp: "&",
922
922
  lt: "<",
923
923
  gt: ">",
924
924
  quot: "\"",
925
925
  apos: "'"
926
- }, he = (t, e) => {
927
- const s = le[e];
926
+ }, ge = (t, e) => {
927
+ const s = fe[e];
928
928
  if (void 0 !== s) return s;
929
929
  const o = 120 === e.charCodeAt(1) ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
930
930
  return o > 0 && o <= 1114111 ? String.fromCodePoint(o) : t;
931
- }, ue = (t) => {
931
+ }, me = (t) => {
932
932
  let e = t;
933
- return -1 !== e.indexOf("\r") && (e = e.replace(/\r\n?/g, "\n")), -1 !== e.indexOf("&") && (e = e.replace(ce, he)), e;
934
- }, pe = (t) => {
933
+ return -1 !== e.indexOf("\r") && (e = e.replace(/\r\n?/g, "\n")), -1 !== e.indexOf("&") && (e = e.replace(pe, ge)), e;
934
+ }, xe = (t) => {
935
935
  let e = t;
936
936
  const s = e.length;
937
937
  for (let t = 0; t < s; t++) {
@@ -941,8 +941,8 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
941
941
  break;
942
942
  }
943
943
  }
944
- return -1 !== e.indexOf("&") && (e = e.replace(ce, he)), e;
945
- }, de = (t) => 32 === t || 9 === t || 10 === t || 13 === t, fe = class t {
944
+ return -1 !== e.indexOf("&") && (e = e.replace(pe, ge)), e;
945
+ }, ye = (t) => 32 === t || 9 === t || 10 === t || 13 === t, be = class t {
946
946
  constructor() {
947
947
  this._openTagHandler = void 0, this._closeTagHandler = void 0, this._textHandler = void 0, this._cdataHandler = void 0, this._errorHandler = void 0, this._endHandler = void 0, this._scanners = null, this._carry = "", this._text = "", this._tags = [], this._sawRoot = !1, this._closed = !1;
948
948
  }
@@ -953,7 +953,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
953
953
  this.NOT_HANDLED = -2;
954
954
  }
955
955
  static decodeText(t) {
956
- return ue(t);
956
+ return me(t);
957
957
  }
958
958
  on(t, e) {
959
959
  switch (t) {
@@ -1020,7 +1020,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1020
1020
  if (0 === t.length) return;
1021
1021
  this._text = "";
1022
1022
  const e = this._textHandler;
1023
- void 0 !== e && 0 !== this._tags.length && e(ue(t));
1023
+ void 0 !== e && 0 !== this._tags.length && e(me(t));
1024
1024
  }
1025
1025
  _markup(e, s, o) {
1026
1026
  if (s + 1 >= o) return -1;
@@ -1059,7 +1059,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1059
1059
  const r = s + 1 + n.name.length;
1060
1060
  if (r >= o) return -1;
1061
1061
  const i = e.charCodeAt(r);
1062
- if (62 === i || 47 === i || de(i)) {
1062
+ if (62 === i || 47 === i || ye(i)) {
1063
1063
  this._flushText();
1064
1064
  const r = n.scan(e, s, o);
1065
1065
  if (r !== t.NOT_HANDLED) {
@@ -1077,12 +1077,12 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1077
1077
  }
1078
1078
  _openTag(t, e, s) {
1079
1079
  let o = e + 1, r = 0;
1080
- for (; o < s && (r = t.charCodeAt(o), 62 !== r && 47 !== r && !de(r));) o++;
1080
+ for (; o < s && (r = t.charCodeAt(o), 62 !== r && 47 !== r && !ye(r));) o++;
1081
1081
  if (o >= s) return -1;
1082
1082
  const i = t.slice(e + 1, o), n = {};
1083
1083
  let a = !1;
1084
1084
  for (;;) {
1085
- for (; o < s && de(r = t.charCodeAt(o));) o++;
1085
+ for (; o < s && ye(r = t.charCodeAt(o));) o++;
1086
1086
  if (o >= s) return -1;
1087
1087
  if (62 === r) {
1088
1088
  o++;
@@ -1098,16 +1098,16 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1098
1098
  break;
1099
1099
  }
1100
1100
  const e = o;
1101
- for (; o < s && (r = t.charCodeAt(o), 61 !== r && 62 !== r && 47 !== r && !de(r));) o++;
1101
+ for (; o < s && (r = t.charCodeAt(o), 61 !== r && 62 !== r && 47 !== r && !ye(r));) o++;
1102
1102
  if (o >= s) return -1;
1103
1103
  const i = t.slice(e, o);
1104
- for (; o < s && de(r = t.charCodeAt(o));) o++;
1104
+ for (; o < s && ye(r = t.charCodeAt(o));) o++;
1105
1105
  if (o >= s) return -1;
1106
1106
  if (61 !== r) {
1107
1107
  this.fail("attribute without value.");
1108
1108
  continue;
1109
1109
  }
1110
- for (o++; o < s && de(r = t.charCodeAt(o));) o++;
1110
+ for (o++; o < s && ye(r = t.charCodeAt(o));) o++;
1111
1111
  if (o >= s) return -1;
1112
1112
  if (34 !== r && 39 !== r) {
1113
1113
  this.fail("unquoted attribute value.");
@@ -1115,7 +1115,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1115
1115
  }
1116
1116
  const c = t.indexOf(34 === r ? "\"" : "'", o + 1);
1117
1117
  if (-1 === c) return -1;
1118
- "__proto__" !== i && (n[i] = pe(t.slice(o + 1, c))), o = c + 1;
1118
+ "__proto__" !== i && (n[i] = xe(t.slice(o + 1, c))), o = c + 1;
1119
1119
  }
1120
1120
  this._flushText(), this._sawRoot = !0;
1121
1121
  const c = {
@@ -1155,7 +1155,7 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1155
1155
  };
1156
1156
  t.parseStream = async (t, e, s) => {
1157
1157
  if (s?.lean) return (async (t, e) => {
1158
- const s = new fe();
1158
+ const s = new be();
1159
1159
  let o;
1160
1160
  e.elementScanners && s.setElementScanners(e.elementScanners), e.onOpenTag && s.on("opentag", e.onOpenTag), e.onCloseTag && s.on("closetag", e.onCloseTag), e.onText && s.on("text", e.onText), e.onError && s.on("error", e.onError);
1161
1161
  const r = e.onEnd;
@@ -1168,18 +1168,18 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1168
1168
  }
1169
1169
  return s.close(), o;
1170
1170
  })(t, e);
1171
- const o = new ae({
1171
+ const o = new de({
1172
1172
  position: !1,
1173
1173
  ...s
1174
1174
  });
1175
1175
  let r;
1176
- e.onOpenTagStart && o.on(oe.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && o.on(oe.Events.OpenTag, e.onOpenTag), e.onCloseTag && o.on(oe.Events.CloseTag, e.onCloseTag), e.onAttribute && o.on(oe.Events.Attribute, e.onAttribute), e.onText && o.on(oe.Events.Text, e.onText), e.onError && o.on(oe.Events.Error, e.onError);
1176
+ e.onOpenTagStart && o.on(ce.Events.OpenTagStart, e.onOpenTagStart), e.onOpenTag && o.on(ce.Events.OpenTag, e.onOpenTag), e.onCloseTag && o.on(ce.Events.CloseTag, e.onCloseTag), e.onAttribute && o.on(ce.Events.Attribute, e.onAttribute), e.onText && o.on(ce.Events.Text, e.onText), e.onError && o.on(ce.Events.Error, e.onError);
1177
1177
  const i = e.onEnd;
1178
1178
  if (i) {
1179
1179
  const t = () => {
1180
1180
  r = i();
1181
1181
  };
1182
- o.on(oe.Events.End, t);
1182
+ o.on(ce.Events.End, t);
1183
1183
  }
1184
1184
  for (;;) {
1185
1185
  const { value: e, done: s } = await t.read();
@@ -1188,14 +1188,14 @@ var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
1188
1188
  }
1189
1189
  return o.close(), r;
1190
1190
  };
1191
- })(oe || (oe = {}));
1192
- var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, me = (t) => {
1191
+ })(ce || (ce = {}));
1192
+ var Te = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t && "0" !== t && "off" !== t && "false" !== t && null, ve = (t) => {
1193
1193
  const e = parseInt(t);
1194
1194
  return isNaN(e) ? null : e;
1195
- }, xe = (t) => {
1195
+ }, we = (t) => {
1196
1196
  const e = parseFloat(t);
1197
1197
  return isNaN(e) ? null : e;
1198
- }, be = null, ye = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Te = (t) => ye(t).replace(/"/g, "&quot;"), ve = class {
1198
+ }, Se = null, Ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), ke = (t) => Ce(t).replace(/"/g, "&quot;"), Ae = class {
1199
1199
  constructor() {
1200
1200
  this._registeredVisitors = /* @__PURE__ */ new Map();
1201
1201
  }
@@ -1210,7 +1210,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1210
1210
  source: t,
1211
1211
  parent: null
1212
1212
  };
1213
- let p = null, d = !1, f = null, g = null, m = null;
1213
+ let d = null, p = !1, f = null, g = null, m = null;
1214
1214
  const x = (t, e) => {
1215
1215
  let s = c.attributes[t];
1216
1216
  if (e) if (Array.isArray(e)) {
@@ -1224,17 +1224,17 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1224
1224
  if (s = e(s), null == s) return;
1225
1225
  }
1226
1226
  return s;
1227
- }, b = {
1228
- getSource: () => p?.source ?? null,
1227
+ }, y = {
1228
+ getSource: () => d?.source ?? null,
1229
1229
  setSource: (t) => {
1230
- p.source = t;
1230
+ d.source = t;
1231
1231
  },
1232
1232
  setKey: (t) => {
1233
- p.key = t;
1233
+ d.key = t;
1234
1234
  },
1235
1235
  getFrom: () => c,
1236
1236
  getAttribute: (t, e) => x(t, e) ?? null,
1237
- hasAttribute: (t) => null !== b.getAttribute(t),
1237
+ hasAttribute: (t) => null !== y.getAttribute(t),
1238
1238
  getParent: () => {
1239
1239
  const t = h[h.length - 2];
1240
1240
  return t.parent ?? t.source;
@@ -1252,7 +1252,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1252
1252
  },
1253
1253
  copyTo: (t, e, s) => {
1254
1254
  const o = x(s ?? t, e);
1255
- void 0 !== o && (p.source[t] = o);
1255
+ void 0 !== o && (d.source[t] = o);
1256
1256
  },
1257
1257
  warn: (t, e) => {
1258
1258
  s ? s(t, void 0, e?.onceKey) : console.warn(t);
@@ -1267,7 +1267,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1267
1267
  let s = `<${t.name}`;
1268
1268
  for (const t in e) {
1269
1269
  const o = e[t];
1270
- s += ` ${t}="${Te("string" == typeof o ? o : o?.value ?? "")}"`;
1270
+ s += ` ${t}="${ke("string" == typeof o ? o : o?.value ?? "")}"`;
1271
1271
  }
1272
1272
  return s + ">";
1273
1273
  })(t)), n = {
@@ -1281,20 +1281,20 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1281
1281
  visitor: m,
1282
1282
  tag: t,
1283
1283
  destination: null
1284
- }, d) return i.push(n), a = e, void (c = t);
1284
+ }, p) return i.push(n), a = e, void (c = t);
1285
1285
  l = n?.visitor ?? null, a = e, c = t;
1286
1286
  let x = !!m && null === m.to;
1287
1287
  if (m && !x && m.scope) {
1288
- const t = m.scope(b);
1288
+ const t = m.scope(y);
1289
1289
  null === t ? x = !0 : t && (r.push(t), n.pushedScope = !0);
1290
1290
  }
1291
- m && (0 === i.length ? (p = u, n.destination = p, n.pushedDestination = !0, h.push(p)) : x ? (p = null, n.destination = null) : m.transparent ? n.destination = p : (p = {
1291
+ m && (0 === i.length ? (d = u, n.destination = d, n.pushedDestination = !0, h.push(d)) : x ? (d = null, n.destination = null) : m.transparent ? n.destination = d : (d = {
1292
1292
  key: null,
1293
1293
  source: {},
1294
1294
  parent: null
1295
- }, n.destination = p, n.pushedDestination = !0, h.push(p))), i.push(n), d = x;
1296
- const y = l?.openTag?.(b);
1297
- void 0 !== y && (p.parent = y), m?.raw && !x && (f = [], g = n);
1295
+ }, n.destination = d, n.pushedDestination = !0, h.push(d))), i.push(n), p = x;
1296
+ const b = l?.openTag?.(y);
1297
+ void 0 !== b && (d.parent = b), m?.raw && !x && (f = [], g = n);
1298
1298
  },
1299
1299
  onCloseTag: (t) => {
1300
1300
  let e = t.name;
@@ -1305,24 +1305,24 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1305
1305
  if (i[i.length - 1] !== g) return f.push(`</${t.name}>`), i.pop(), n = i[i.length - 1] ?? null, a = n?.local ?? null, void (c = n?.tag ?? null);
1306
1306
  m = f.join(""), f = null, g = null, x = !0;
1307
1307
  }
1308
- d || l?.closeTag?.(b), x && (m = null);
1309
- const y = i.pop() ?? null;
1310
- n = i[i.length - 1] ?? null, y?.pushedScope && r.pop();
1311
- const T = y?.destination;
1312
- if (T && y.pushedDestination) {
1313
- h.pop(), p = h[h.length - 1] ?? u;
1314
- const t = y.visitor;
1315
- t && t.to && void 0 !== T.source && (Array.isArray(t.to) ? p.source.push ? p.source.push(T.source) : s?.(`Unable to parse array for ${t.from} at ${b.getPath()}`) : T.key ? p.source[T.key] = T.source : "string" == typeof t.to && (p.source[t.to] = T.source));
1316
- } else T || (p = h[h.length - 1] ?? u);
1317
- a = n?.local ?? null, c = n?.tag ?? null, l = n?.visitor ?? null, d = !n?.destination;
1308
+ p || l?.closeTag?.(y), x && (m = null);
1309
+ const b = i.pop() ?? null;
1310
+ n = i[i.length - 1] ?? null, b?.pushedScope && r.pop();
1311
+ const T = b?.destination;
1312
+ if (T && b.pushedDestination) {
1313
+ h.pop(), d = h[h.length - 1] ?? u;
1314
+ const t = b.visitor;
1315
+ t && t.to && void 0 !== T.source && (Array.isArray(t.to) ? d.source.push ? d.source.push(T.source) : s?.(`Unable to parse array for ${t.from} at ${y.getPath()}`) : T.key ? d.source[T.key] = T.source : "string" == typeof t.to && (d.source[t.to] = T.source));
1316
+ } else T || (d = h[h.length - 1] ?? u);
1317
+ a = n?.local ?? null, c = n?.tag ?? null, l = n?.visitor ?? null, p = !n?.destination;
1318
1318
  },
1319
1319
  onText: (t) => {
1320
- f ? f.push(ye(t)) : l?.text?.(t, b);
1320
+ f ? f.push(Ce(t)) : l?.text?.(t, y);
1321
1321
  },
1322
1322
  onEnd: e
1323
1323
  };
1324
1324
  }
1325
- }, we = `IFERROR(${d}(`, Se = we.toUpperCase(), Ce = f.toUpperCase(), ke = { kind: "none" }, Ae = { kind: "spilled" }, Oe = (t, e) => {
1325
+ }, Ee = `IFERROR(${O}(`, Pe = Ee.toUpperCase(), Oe = w.toUpperCase(), Ie = { kind: "none" }, De = { kind: "spilled" }, _e = (t, e) => {
1326
1326
  if (34 !== t.charCodeAt(e)) return null;
1327
1327
  let s = "", o = e + 1;
1328
1328
  for (; o < t.length;) if (34 === t.charCodeAt(o)) {
@@ -1333,13 +1333,13 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1333
1333
  s += "\"", o += 2;
1334
1334
  } else s += t[o], o++;
1335
1335
  return null;
1336
- }, Ee = (t) => {
1336
+ }, Ve = (t) => {
1337
1337
  const e = [];
1338
1338
  let s = 0;
1339
1339
  for (; s < t.length;) {
1340
1340
  const o = t.charCodeAt(s);
1341
1341
  if (34 === o) {
1342
- const e = Oe(t, s);
1342
+ const e = _e(t, s);
1343
1343
  if (null === e) break;
1344
1344
  s = e.end;
1345
1345
  continue;
@@ -1357,7 +1357,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1357
1357
  40 === t.charCodeAt(r) && e.push(t.slice(s, r).toUpperCase().replace(/^_XLFN\./, "").replace(/^_XLWS\./, "")), s = r;
1358
1358
  }
1359
1359
  return e;
1360
- }, Pe = (t) => {
1360
+ }, Le = (t) => {
1361
1361
  const e = (e) => {
1362
1362
  if (t) return new RegExp(`<(?:[\\w.-]+:)?${e}\\b[^>]*>([^<]*)<`).exec(t)?.[1];
1363
1363
  }, s = (t) => {
@@ -1367,17 +1367,17 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1367
1367
  return {
1368
1368
  c: s(e("col")),
1369
1369
  r: s(e("row")),
1370
- x: c(e("colOff") ?? "0") ?? 0,
1371
- y: c(e("rowOff") ?? "0") ?? 0
1370
+ x: $(e("colOff") ?? "0") ?? 0,
1371
+ y: $(e("rowOff") ?? "0") ?? 0
1372
1372
  };
1373
- }, Ie = "formulaDialect", De = (e, s, o, r, i, n, c, l) => {
1374
- const h = new ve(), p = l?.get("parseInlineDxf"), d = l?.get(Ie), f = (t) => d && t ? d.readDetached(t) : t, g = new st.TransposedBuilder();
1375
- let y = null;
1376
- h.registerVisitor({
1373
+ }, Ne = "formulaDialect", $e = (t, e, s, o, r, m, T, w) => {
1374
+ const S = new Ae(), k = w?.get("parseInlineDxf"), A = w?.get(Ne), P = (t) => A && t ? A.readDetached(t) : t, O = new at.TransposedBuilder();
1375
+ let D = null;
1376
+ S.registerVisitor({
1377
1377
  from: "autoFilter",
1378
1378
  to: "autoTable",
1379
1379
  openTag: (t) => {
1380
- const e = t.getAttribute("ref"), s = z.fastStringToRange(e);
1380
+ const e = t.getAttribute("ref"), s = J.fastStringToRange(e);
1381
1381
  t.getSource().r = s, t.getSource().v = {};
1382
1382
  },
1383
1383
  closeTag: (t) => {
@@ -1387,7 +1387,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1387
1387
  0 === t ? s.hiddenButtons = !1 : t === i && (s.hiddenButtons = !0);
1388
1388
  }
1389
1389
  }
1390
- }), h.registerVisitor({
1390
+ }), S.registerVisitor({
1391
1391
  from: "conditionalFormatting",
1392
1392
  to: {},
1393
1393
  openTag: (t) => {
@@ -1398,10 +1398,10 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1398
1398
  const o = {
1399
1399
  r: s,
1400
1400
  conditionals: e.conditionals
1401
- }, r = t.getAttribute("pivot", ge);
1401
+ }, r = t.getAttribute("pivot", Te);
1402
1402
  null !== r && (o.pivot = r), t.setSource(o);
1403
1403
  }
1404
- }), h.registerVisitor({
1404
+ }), S.registerVisitor({
1405
1405
  from: "cfRule",
1406
1406
  to: {},
1407
1407
  openTag: (t) => {
@@ -1412,24 +1412,24 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1412
1412
  r: e.r,
1413
1413
  v: null,
1414
1414
  rule: s
1415
- }), t.copyToObject(s, "type", be), t.copyToObject(s, "priority", me), t.copyToObject(s, "stopIfTrue", ge);
1416
- const o = t.getAttribute("dxfId", me);
1417
- if (null !== o) {
1418
- let e = r?.get(o);
1419
- e || (n?.(`Unable to load conditional color. Invalid dxfI: '${o}' at '${t.getPath()}'.`), e = {}), s.style = e;
1415
+ }), t.copyToObject(s, "type", Se), t.copyToObject(s, "priority", ve), t.copyToObject(s, "stopIfTrue", Te);
1416
+ const r = t.getAttribute("dxfId", ve);
1417
+ if (null !== r) {
1418
+ let e = o?.get(r);
1419
+ e || (m?.(`Unable to load conditional color. Invalid dxfI: '${r}' at '${t.getPath()}'.`), e = {}), s.style = e;
1420
1420
  }
1421
- t.copyToObject(s, "aboveAverage", ge), t.copyToObject(s, "equalAverage", ge), t.copyToObject(s, "stdDev", me), t.copyToObject(s, "bottom", ge), t.copyToObject(s, "percent", ge), t.copyToObject(s, "rank", me), t.copyToObject(s, "operator", be), t.copyToObject(s, "text", be), t.copyToObject(s, "timePeriod", be);
1421
+ t.copyToObject(s, "aboveAverage", Te), t.copyToObject(s, "equalAverage", Te), t.copyToObject(s, "stdDev", ve), t.copyToObject(s, "bottom", Te), t.copyToObject(s, "percent", Te), t.copyToObject(s, "rank", ve), t.copyToObject(s, "operator", Se), t.copyToObject(s, "text", Se), t.copyToObject(s, "timePeriod", Se);
1422
1422
  },
1423
1423
  closeTag: (t) => {
1424
1424
  const e = t.getParent();
1425
1425
  if (!e?.r) return;
1426
1426
  const s = e.conditionals[e.conditionals.length - 1], o = s?.rule;
1427
1427
  if (!o) return;
1428
- const r = {}, i = P(o, n);
1428
+ const r = {}, i = I(o, m);
1429
1429
  i && (r.condition = i), o.style && (r.style = o.style), o.scale && (r.scale = o.scale), o.stopIfTrue && (r.stopIfTrue = !0), o.pivot && (r.pivot = !0), s.v = r, s.priority = o.priority, o.x14Id && (s.x14Id = o.x14Id), delete s.rule;
1430
1430
  }
1431
1431
  });
1432
- const T = (t) => {
1432
+ const L = (t) => {
1433
1433
  const e = t.conditions ?? [], s = [];
1434
1434
  for (let t = 0; t < e.length; t++) {
1435
1435
  const o = e[t], r = {};
@@ -1437,75 +1437,75 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1437
1437
  }
1438
1438
  return s;
1439
1439
  };
1440
- h.registerVisitor({
1440
+ S.registerVisitor({
1441
1441
  from: "colorScale",
1442
1442
  to: {},
1443
1443
  openTag: (t) => {},
1444
1444
  closeTag: (t) => {
1445
- const e = t.getSource(), s = e.colors ?? [], o = T(e);
1445
+ const e = t.getSource(), s = e.colors ?? [], o = L(e);
1446
1446
  for (let t = 0; t < o.length; t++) o[t].color = s[t];
1447
1447
  t.getParent().scale = {
1448
- type: J.ScaleType.ColorScale,
1448
+ type: et.ScaleType.ColorScale,
1449
1449
  stops: o
1450
1450
  };
1451
1451
  }
1452
- }), h.registerVisitor({
1452
+ }), S.registerVisitor({
1453
1453
  from: "dataBar",
1454
1454
  to: {},
1455
1455
  openTag: (t) => {
1456
- t.copyTo("maxLength", me), t.copyTo("minLength", me), t.copyTo("showValue", ge);
1456
+ t.copyTo("maxLength", ve), t.copyTo("minLength", ve), t.copyTo("showValue", Te);
1457
1457
  },
1458
1458
  closeTag: (t) => {
1459
1459
  const e = t.getSource(), s = {
1460
- type: J.ScaleType.DataBar,
1461
- stops: T(e)
1460
+ type: et.ScaleType.DataBar,
1461
+ stops: L(e)
1462
1462
  }, o = e.colors?.[0];
1463
1463
  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;
1464
1464
  }
1465
- }), h.registerVisitor({
1465
+ }), S.registerVisitor({
1466
1466
  from: "iconSet",
1467
1467
  to: {},
1468
1468
  openTag: (t) => {
1469
- t.copyTo("iconSet", be), t.copyTo("reverse", ge), t.copyTo("showValue", ge);
1469
+ t.copyTo("iconSet", Se), t.copyTo("reverse", Te), t.copyTo("showValue", Te);
1470
1470
  },
1471
1471
  closeTag: (t) => {
1472
1472
  const e = t.getSource(), s = {
1473
- type: J.ScaleType.IconSet,
1474
- stops: T(e)
1473
+ type: et.ScaleType.IconSet,
1474
+ stops: L(e)
1475
1475
  };
1476
1476
  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;
1477
1477
  }
1478
- }), h.registerVisitor({
1478
+ }), S.registerVisitor({
1479
1479
  from: "formula",
1480
1480
  to: {},
1481
1481
  text: (t, e) => {
1482
1482
  const s = e.getParent();
1483
1483
  let o = s.formulas;
1484
- o || (o = [], s.formulas = o), o.push(f(t));
1484
+ o || (o = [], s.formulas = o), o.push(P(t));
1485
1485
  }
1486
- }), h.registerVisitor({
1486
+ }), S.registerVisitor({
1487
1487
  from: "cfvo",
1488
1488
  to: {},
1489
1489
  openTag: (t) => {
1490
1490
  const e = t.getParent();
1491
1491
  e.conditions || (e.conditions = []);
1492
1492
  const s = t.getSource();
1493
- if (e.conditions.push(s), t.copyTo("type", be), s.type === J.ColorStopType.Formula) {
1493
+ if (e.conditions.push(s), t.copyTo("type", Se), s.type === et.ColorStopType.Formula) {
1494
1494
  const e = t.getAttribute("val");
1495
- null != e && (s.value = f(String(e)));
1496
- } else t.copyTo("value", xe, "val");
1497
- !1 === t.getAttribute("gte", ge) && (s.exclusive = !0);
1495
+ null != e && (s.value = P(String(e)));
1496
+ } else t.copyTo("value", we, "val");
1497
+ !1 === t.getAttribute("gte", Te) && (s.exclusive = !0);
1498
1498
  }
1499
- }), h.registerVisitor({
1499
+ }), S.registerVisitor({
1500
1500
  from: "color",
1501
1501
  to: {},
1502
1502
  openTag: (t) => {
1503
1503
  const e = t.getParent();
1504
1504
  e.colors || (e.colors = []);
1505
- const s = a((e) => t.getAttribute(e));
1505
+ const s = X((e) => t.getAttribute(e));
1506
1506
  e.colors.push(s);
1507
1507
  }
1508
- }), h.registerVisitor({
1508
+ }), S.registerVisitor({
1509
1509
  from: "filterColumn",
1510
1510
  to: {},
1511
1511
  openTag: (t) => {
@@ -1514,89 +1514,98 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1514
1514
  let r = e.filter;
1515
1515
  r || (r = { conditions: [] }, e.filter = r);
1516
1516
  let i = r.conditions;
1517
- if (i || (i = [], r.conditions = i), i.push(o), t.getAttribute("hiddenButton", ge) && e) {
1517
+ if (i || (i = [], r.conditions = i), i.push(o), t.getAttribute("hiddenButton", Te) && e) {
1518
1518
  let t = e.hiddenButtons;
1519
1519
  t || (t = [], e.hiddenButtons = t), t.push(s);
1520
1520
  }
1521
- if (t.getAttribute("showButton", ge) && e) {
1521
+ if (t.getAttribute("showButton", Te) && e) {
1522
1522
  let t = e.showButtons;
1523
1523
  t || (t = [], e.showButtons = t), t.push(s);
1524
1524
  }
1525
1525
  return o;
1526
1526
  }
1527
- }), h.registerVisitor({
1527
+ }), S.registerVisitor({
1528
1528
  from: "colorFilter",
1529
1529
  openTag: (t) => {
1530
1530
  const e = t.getParent(), s = {};
1531
- e.operator = K.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor"), t.copyToObject(s, "styleId", me, "dxfId");
1531
+ e.operator = tt.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor", Te), t.copyToObject(s, "styleId", ve, "dxfId");
1532
1532
  }
1533
- }), h.registerVisitor({
1533
+ }), S.registerVisitor({
1534
1534
  from: "iconFilter",
1535
1535
  openTag: (t) => {
1536
1536
  const e = t.getParent(), s = {};
1537
- e.operator = K.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", me), t.copyToObject(s, "iconSet", be);
1537
+ e.operator = tt.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", ve), t.copyToObject(s, "iconSet", Se);
1538
1538
  }
1539
- }), h.registerVisitor({
1539
+ }), S.registerVisitor({
1540
1540
  from: "top10",
1541
1541
  openTag: (t) => {
1542
1542
  const e = t.getParent(), s = {};
1543
- e.operator = K.BuiltInOperatorNames.TopN, e.param = s, t.copyToObject(s, "filterVal", xe), t.copyToObject(s, "percent", ge), t.copyToObject(s, "top", ge), t.copyToObject(s, "limit", xe, "val");
1543
+ e.operator = tt.BuiltInOperatorNames.TopN, e.param = s, t.copyToObject(s, "filterVal", we), t.copyToObject(s, "percent", Te), t.copyToObject(s, "top", Te), t.copyToObject(s, "limit", we, "val");
1544
1544
  }
1545
- }), h.registerVisitor({
1545
+ }), S.registerVisitor({
1546
1546
  from: "dynamicFilter",
1547
1547
  openTag: (t) => {
1548
- const e = t.getParent(), s = {};
1549
- e.operator = K.BuiltInOperatorNames.TimePeriod, e.param = s;
1550
- let o = t.getAttribute("type");
1551
- Object.values(K.AverageType).includes(o) ? (e.operator = K.BuiltInOperatorNames.Average, t.copyToObject(s, "stdDevs", me, "val")) : t.copyToObject(s, "anchorDate", me, "val"), t.copyToObject(s, "operator", be, "type"), t.copyToObject(s, "maxVal", xe, "maxVal");
1548
+ const e = t.getParent(), s = l(t.getAttribute("type"));
1549
+ e.operator = s.operator, e.param = s.param;
1552
1550
  }
1553
- }), h.registerVisitor({
1551
+ });
1552
+ const N = {
1554
1553
  from: "filters",
1555
1554
  to: {},
1556
1555
  openTag: (t) => {
1557
- const e = t.getParent(), s = {};
1558
- return e.operator = K.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", ge), t.copyToObject(s, "calendarType", be), s;
1556
+ const e = t.getParent(), s = { byDisplay: !0 };
1557
+ return e.operator = tt.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", Te), s.blank && (e.includeBlanks = !0), t.copyToObject(s, "calendarType", Se), s;
1559
1558
  }
1560
- }), h.registerVisitor({
1559
+ };
1560
+ S.registerVisitor(N);
1561
+ const $ = {
1561
1562
  from: "filter",
1562
1563
  openTag: (t) => {
1563
1564
  const e = t.getParent();
1564
1565
  let s = e.items;
1565
- s || (s = [], e.items = s), s.push(t.getAttribute("val", be));
1566
+ s || (s = [], e.items = s), s.push(t.getAttribute("val", Se));
1566
1567
  }
1567
- }), h.registerVisitor({
1568
+ };
1569
+ S.registerVisitor($);
1570
+ const B = {
1568
1571
  from: "dateGroupItem",
1569
1572
  to: {},
1570
1573
  openTag: (t) => {
1571
1574
  const e = t.getParent();
1572
1575
  let s = e.dateGroups;
1573
- s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group", be, "dateTimeGrouping"), t.copyTo("day", me), t.copyTo("hour", me), t.copyTo("minute", me), t.copyTo("month", me), t.copyTo("second", me), t.copyTo("year", me);
1576
+ s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group", Se, "dateTimeGrouping"), t.copyTo("day", ve), t.copyTo("hour", ve), t.copyTo("minute", ve), t.copyTo("month", ve), t.copyTo("second", ve), t.copyTo("year", ve);
1574
1577
  }
1575
- }), h.registerVisitor({
1578
+ };
1579
+ S.registerVisitor(B);
1580
+ const j = /* @__PURE__ */ new Map();
1581
+ j.set("filterColumn", {
1582
+ from: "filterColumn",
1583
+ transparent: !0
1584
+ }), j.set("filters", N), j.set("filter", $), j.set("dateGroupItem", B), S.registerVisitor({
1576
1585
  from: "customFilters",
1577
1586
  openTag: (t) => {
1578
1587
  const e = t.getParent(), s = t.getAttribute("and"), o = "and" === s || "1" === s, r = [];
1579
- return e.operator = o ? K.BuiltInOperatorNames.And : K.BuiltInOperatorNames.Or, e.param = r, t.setSource(e), r;
1588
+ return e.operator = o ? tt.BuiltInOperatorNames.And : tt.BuiltInOperatorNames.Or, e.param = r, t.setSource(e), r;
1580
1589
  },
1581
1590
  closeTag: (t) => {
1582
1591
  const e = t.getSource(), s = e?.param;
1583
- if (1 !== s?.length) return;
1584
- const o = s[0];
1585
- e.operator = o.operator, e.param = o.param;
1592
+ if (!e || !s) return;
1593
+ const o = 1 === s.length ? s[0] : y(e);
1594
+ o !== e && (e.operator = o.operator, e.param = o.param, o.includeBlanks && (e.includeBlanks = !0));
1586
1595
  }
1587
- }), h.registerVisitor({
1596
+ }), S.registerVisitor({
1588
1597
  from: "customFilter",
1589
1598
  openTag: (t) => {
1590
1599
  const e = t.getParent();
1591
1600
  let s;
1592
1601
  Array.isArray(e) ? (s = {}, e.push(s)) : s = e;
1593
- const o = _({
1602
+ const o = v({
1594
1603
  operator: t.getAttribute("operator"),
1595
1604
  val: t.getAttribute("val")
1596
- });
1597
- o && (s.operator = o.operator, s.param = o.param);
1605
+ }, (e) => t.warn(e));
1606
+ o && (s.operator = o.operator, s.param = o.param, o.includeBlanks && (s.includeBlanks = !0));
1598
1607
  }
1599
- }), h.registerVisitor({
1608
+ }), S.registerVisitor({
1600
1609
  from: "sortState",
1601
1610
  to: {},
1602
1611
  openTag: (t) => {
@@ -1604,7 +1613,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1604
1613
  let s = e.v;
1605
1614
  s && (s.sort = {}, t.setSource(e));
1606
1615
  }
1607
- }), h.registerVisitor({
1616
+ }), S.registerVisitor({
1608
1617
  from: "sortCondition",
1609
1618
  to: {},
1610
1619
  openTag: (t) => {
@@ -1617,11 +1626,11 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1617
1626
  const i = t.getAttribute("ref");
1618
1627
  let n = 0;
1619
1628
  if (i) {
1620
- const t = z.fastStringToRange(i, Le).colStart, s = e.r, o = s.colStart;
1629
+ const t = J.fastStringToRange(i, je).colStart, s = e.r, o = s.colStart;
1621
1630
  n = s ? t - o : t;
1622
1631
  }
1623
1632
  const a = {};
1624
- t.copyToObject(a, "sortOn", be, "sortBy"), t.copyToObject(a, "dxfId", be, "sortBy"), t.copyToObject(a, "iconSet", be), t.copyToObject(a, "customList", be), a.reverse = t.getAttribute("descending", ge) ?? !1;
1633
+ t.copyToObject(a, "sortOn", Se, "sortBy"), t.copyToObject(a, "dxfId", Se, "sortBy"), t.copyToObject(a, "iconSet", Se), t.copyToObject(a, "customList", Se), a.reverse = t.getAttribute("descending", Te) ?? !1;
1625
1634
  const c = {
1626
1635
  index: n,
1627
1636
  criteria: a
@@ -1629,128 +1638,134 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1629
1638
  r.push(c);
1630
1639
  }
1631
1640
  });
1632
- const v = (e) => {
1633
- y = e.getSource(), e.copyTo("topLeft", be, "topLeftCell");
1634
- const s = t(e.getAttribute("defaultGridColor")), o = e.getAttribute("colorId");
1635
- null === o || s || (e.getSource().gridLineColor = "index" + parseFloat(o)), e.copyTo("showZeros", ge), e.copyTo("showFormulas", ge), e.copyTo("zoomScale", me), e.copyTo("showRowHeaders", ge, "showRowColHeaders"), e.copyTo("showColumnHeaders", ge, "showRowColHeaders"), e.copyTo("showRowGridlines", ge, "showGridLines"), e.copyTo("showColumnGridlines", ge, "showGridLines"), e.copyTo("rightToLeft", ge);
1641
+ const M = (t) => {
1642
+ D = t.getSource(), t.copyTo("topLeft", Se, "topLeftCell");
1643
+ const e = V(t.getAttribute("defaultGridColor")), s = t.getAttribute("colorId");
1644
+ null === s || e || (t.getSource().gridLineColor = "index" + parseFloat(s)), t.copyTo("showZeros", Te), t.copyTo("showFormulas", Te), t.copyTo("zoomScale", ve), t.copyTo("showRowHeaders", Te, "showRowColHeaders"), t.copyTo("showColumnHeaders", Te, "showRowColHeaders"), t.copyTo("showRowGridlines", Te, "showGridLines"), t.copyTo("showColumnGridlines", Te, "showGridLines"), t.copyTo("rightToLeft", Te), t.copyTo("showOutlineSymbols", Te);
1636
1645
  };
1637
- h.registerVisitor({
1646
+ S.registerVisitor({
1638
1647
  from: "sheetView",
1639
1648
  to: "view",
1640
1649
  openTag: (t) => {
1641
- v(t);
1650
+ M(t);
1642
1651
  },
1643
1652
  closeTag: () => {
1644
- y = null;
1653
+ D = null;
1645
1654
  }
1646
- }), h.registerVisitor({
1655
+ }), S.registerVisitor({
1647
1656
  from: "customSheetViews",
1648
1657
  to: "customSheetViews",
1649
1658
  openTag: (t) => {
1650
1659
  t.setSource([]);
1651
1660
  }
1652
- }), h.registerVisitor({
1661
+ }), S.registerVisitor({
1653
1662
  from: "customSheetView",
1654
1663
  to: [],
1655
1664
  openTag: (t) => {
1656
- v(t);
1665
+ M(t);
1657
1666
  },
1658
1667
  closeTag: () => {
1659
- y = null;
1668
+ D = null;
1660
1669
  }
1661
- }), h.registerVisitor({
1670
+ }), S.registerVisitor({
1662
1671
  from: "selection",
1663
1672
  to: "selection",
1664
1673
  openTag: (t) => {
1665
- if (!y) return;
1666
- t.copyTo("cell", be, "activeCell"), t.copyTo("rangeIndex", me, "activeCellId");
1674
+ if (!D) return;
1675
+ t.copyTo("cell", Se, "activeCell"), t.copyTo("rangeIndex", ve, "activeCellId");
1667
1676
  const e = t.getAttribute("activeCell"), s = t.getAttribute("sqref");
1668
1677
  if (s && s !== e) t.getSource().ranges = s.trim().split(/\s+/);
1669
1678
  }
1670
- }), h.registerVisitor({
1679
+ }), S.registerVisitor({
1671
1680
  from: "pane",
1672
1681
  to: null,
1673
1682
  openTag: (t) => {
1674
- if (!y) return;
1683
+ if (!D) return;
1675
1684
  if ("frozen" === t.getAttribute("state")) {
1676
1685
  const e = {};
1677
- y.freezePanes = e, t.copyToObject(e, "topLeft", be, "topLeftCell");
1678
- const s = (y.topLeft ? z.fastStringToCell(y.topLeft) : void 0) ?? {
1686
+ D.freezePanes = e, t.copyToObject(e, "topLeft", Se, "topLeftCell");
1687
+ const s = (D.topLeft ? J.fastStringToCell(D.topLeft) : void 0) ?? {
1679
1688
  colIndex: 0,
1680
1689
  rowIndex: 0
1681
1690
  }, o = {
1682
1691
  colIndex: 0,
1683
1692
  rowIndex: 0
1684
1693
  };
1685
- t.copyToObject(o, "colIndex", me, "xSplit"), t.copyToObject(o, "rowIndex", me, "ySplit");
1694
+ t.copyToObject(o, "colIndex", ve, "xSplit"), t.copyToObject(o, "rowIndex", ve, "ySplit");
1686
1695
  const r = {
1687
1696
  colIndex: s.colIndex + o.colIndex,
1688
1697
  rowIndex: s.rowIndex + o.rowIndex
1689
1698
  };
1690
- e.coords = z.cellToString(r);
1699
+ e.coords = J.cellToString(r);
1691
1700
  }
1692
1701
  }
1693
- }), h.registerVisitor({
1702
+ }), S.registerVisitor({
1694
1703
  from: "sheetPr",
1695
1704
  transparent: !0,
1696
- openTag: (t) => {
1697
- const s = t.getAttribute("codeName");
1698
- s && (e.codeName = s), !1 === t.getAttribute("enableFormatConditionsCalculation", ge) && (e.conditionalFormatCalculation = !1);
1705
+ openTag: (e) => {
1706
+ const s = e.getAttribute("codeName");
1707
+ s && (t.codeName = s), !1 === e.getAttribute("enableFormatConditionsCalculation", Te) && (t.conditionalFormatCalculation = !1);
1699
1708
  }
1700
- }), h.registerVisitor({
1709
+ }), S.registerVisitor({
1701
1710
  from: "tabColor",
1702
1711
  to: null,
1703
- openTag: (t) => {
1704
- const s = a((e) => t.getAttribute(e));
1705
- s && (e.tabColor = s);
1712
+ openTag: (e) => {
1713
+ const s = X((t) => e.getAttribute(t));
1714
+ s && (t.tabColor = s);
1706
1715
  }
1707
- }), h.registerVisitor({
1716
+ }), S.registerVisitor({
1708
1717
  from: "pageSetUpPr",
1709
1718
  to: "pageSetUpPr",
1710
1719
  openTag: (t) => {}
1711
- }), h.registerVisitor({
1720
+ }), S.registerVisitor({
1712
1721
  from: "outlinePr",
1713
1722
  to: null,
1714
- openTag: (t) => {
1715
- const s = {};
1716
- t.copyToObject(s, "summaryBelow", ge), t.copyToObject(s, "summaryRight", ge), t.copyToObject(s, "showOutlineSymbols", ge), t.copyToObject(s, "applyStyles", ge), Object.keys(s).length > 0 && (e.outline = s);
1717
- }
1718
- }), h.registerVisitor({
1723
+ openTag: (e) => {
1724
+ const s = (t) => {
1725
+ const s = e.getAttribute(t);
1726
+ return "0" === s || "false" === s;
1727
+ }, o = {};
1728
+ s("summaryBelow") && (o.summaryRow = "up"), s("summaryRight") && (o.summaryColumn = "left"), ((t) => {
1729
+ const s = e.getAttribute(t);
1730
+ return "1" === s || "true" === s;
1731
+ })("applyStyles") && (o.automaticStyles = !0), Object.keys(o).length > 0 && (t.outline = o);
1732
+ }
1733
+ }), S.registerVisitor({
1719
1734
  from: "pageMargins",
1720
1735
  to: "pageMargins",
1721
1736
  openTag: (t) => {
1722
- t.copyTo("bottom", xe), t.copyTo("footer", xe), t.copyTo("header", xe), t.copyTo("left", xe), t.copyTo("right", xe), t.copyTo("top", xe), t.copyTo("bottom", xe);
1737
+ t.copyTo("bottom", we), t.copyTo("footer", we), t.copyTo("header", we), t.copyTo("left", we), t.copyTo("right", we), t.copyTo("top", we), t.copyTo("bottom", we);
1723
1738
  }
1724
- }), h.registerVisitor({
1739
+ }), S.registerVisitor({
1725
1740
  from: "pageSetup",
1726
1741
  to: "pageSetup",
1727
1742
  openTag: (t) => {
1728
- t.copyTo("blackAndWhite", ge), t.copyTo("cellComments"), t.copyTo("copies", me), t.copyTo("draft", ge), t.copyTo("errors"), t.copyTo("firstPageNumber", me), t.copyTo("fitToHeight", me), t.copyTo("fitToWidth", me), t.copyTo("horizontalDpi", me), t.copyTo("orientation"), t.copyTo("pageOrder"), t.copyTo("paperSize", me), t.copyTo("scale", me), t.copyTo("useFirstPageNumber", ge), t.copyTo("usePrinterDefaults", ge), t.copyTo("verticalDpi", me);
1743
+ t.copyTo("blackAndWhite", Te), t.copyTo("cellComments"), t.copyTo("copies", ve), t.copyTo("draft", Te), t.copyTo("errors"), t.copyTo("firstPageNumber", ve), t.copyTo("fitToHeight", ve), t.copyTo("fitToWidth", ve), t.copyTo("horizontalDpi", ve), t.copyTo("orientation"), t.copyTo("pageOrder"), t.copyTo("paperSize", ve), t.copyTo("scale", ve), t.copyTo("useFirstPageNumber", Te), t.copyTo("usePrinterDefaults", Te), t.copyTo("verticalDpi", ve);
1729
1744
  }
1730
- }), h.registerVisitor({
1745
+ }), S.registerVisitor({
1731
1746
  from: "printOptions",
1732
1747
  to: "printOptions",
1733
1748
  openTag: (t) => {
1734
- t.copyTo("gridLines", ge), t.copyTo("gridLinesSet", ge), t.copyTo("headings", ge), t.copyTo("horizontalCentered", ge), t.copyTo("verticalCentered", ge);
1749
+ t.copyTo("gridLines", Te), t.copyTo("gridLinesSet", Te), t.copyTo("headings", Te), t.copyTo("horizontalCentered", Te), t.copyTo("verticalCentered", Te);
1735
1750
  }
1736
- }), h.registerVisitor({
1751
+ }), S.registerVisitor({
1737
1752
  from: "headerFoot",
1738
1753
  to: "headerFoot",
1739
1754
  openTag: (t) => {}
1740
- }), h.registerVisitor({
1755
+ }), S.registerVisitor({
1741
1756
  from: "mergeCells",
1742
1757
  to: "merges",
1743
1758
  openTag: (t) => {
1744
1759
  t.setSource([]);
1745
1760
  }
1746
- }), h.registerVisitor({
1761
+ }), S.registerVisitor({
1747
1762
  from: "dataValidations",
1748
1763
  to: "validations",
1749
1764
  openTag: (t) => {
1750
1765
  t.setSource([]);
1751
1766
  }
1752
1767
  });
1753
- const S = {
1768
+ const H = {
1754
1769
  from: "dataValidation",
1755
1770
  to: [],
1756
1771
  openTag: (t) => {
@@ -1764,53 +1779,53 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1764
1779
  operator: t.getAttribute("operator") ?? void 0
1765
1780
  }
1766
1781
  };
1767
- !0 === t.getAttribute("showDropDown", ge) && (s.hideDropdown = !0), t.copyToObject(s, "alert", be, "error"), t.copyToObject(s, "alertTitle", be, "errorTitle"), t.copyToObject(s, "showAlertMessage", ge, "showErrorMessage"), s.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(s, "imeMode"), t.copyToObject(s, "prompt"), t.copyToObject(s, "promptTitle"), t.copyToObject(s, "showPromptMessage", ge, "showInputMessage"), t.setSource(o);
1782
+ !0 === t.getAttribute("showDropDown", Te) && (s.hideDropdown = !0), t.copyToObject(s, "alert", Se, "error"), t.copyToObject(s, "alertTitle", Se, "errorTitle"), t.copyToObject(s, "showAlertMessage", Te, "showErrorMessage"), s.alertStyle = t.getAttribute("errorStyle") ?? "stop", t.copyToObject(s, "imeMode"), t.copyToObject(s, "prompt"), t.copyToObject(s, "promptTitle"), t.copyToObject(s, "showPromptMessage", Te, "showInputMessage"), t.setSource(o);
1768
1783
  },
1769
1784
  closeTag: (t) => {
1770
1785
  const e = t.getSource();
1771
1786
  if (!e?.rule) return;
1772
- const s = D(e.rule, n);
1773
- s && (t.getAttribute("allowBlank", ge) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
1787
+ const s = h(e.rule, m);
1788
+ s && (t.getAttribute("allowBlank", Te) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
1774
1789
  }
1775
1790
  };
1776
- h.registerVisitor(S), h.registerVisitor({
1791
+ S.registerVisitor(H), S.registerVisitor({
1777
1792
  from: "formula1",
1778
1793
  to: {},
1779
1794
  text: (t, e) => {
1780
1795
  const s = e.getParent().rule;
1781
- s?.type && (s.formula1 = B(f(t), s.type));
1796
+ s?.type && (s.formula1 = x(P(t), s.type));
1782
1797
  }
1783
- }), h.registerVisitor({
1798
+ }), S.registerVisitor({
1784
1799
  from: "formula2",
1785
1800
  to: {},
1786
1801
  text: (t, e) => {
1787
1802
  const s = e.getParent().rule;
1788
- s?.type && (s.formula2 = B(f(t), s.type));
1803
+ s?.type && (s.formula2 = x(P(t), s.type));
1789
1804
  }
1790
- }), h.registerVisitor({
1805
+ }), S.registerVisitor({
1791
1806
  from: "picture",
1792
1807
  to: "picture",
1793
1808
  openTag: (t) => {
1794
- const e = t.getAttribute("r:id");
1795
- if (!e) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.sheet.picture.noRel" });
1796
- const o = s(e, "resource");
1809
+ const s = t.getAttribute("r:id");
1810
+ if (!s) return void t.warn("A picture names no image; it was not imported.", { onceKey: "xlsx.sheet.picture.noRel" });
1811
+ const o = e(s, "resource");
1797
1812
  t.getSource().resId = o;
1798
1813
  }
1799
1814
  });
1800
- const C = {
1815
+ const F = {
1801
1816
  from: "slicer",
1802
1817
  to: {},
1803
1818
  openTag: (t) => {
1804
- const e = t.getAttribute("r:id");
1805
- if (!e) return void t.warn("A slicer names no cache; it was not imported.", { onceKey: "xlsx.sheet.slicer.noRel" });
1806
- const o = s(e)?.slicers, r = t.getParent();
1819
+ const s = t.getAttribute("r:id");
1820
+ if (!s) return void t.warn("A slicer names no cache; it was not imported.", { onceKey: "xlsx.sheet.slicer.noRel" });
1821
+ const o = e(s)?.slicers, r = t.getParent();
1807
1822
  r.slicers || (r.slicers = {});
1808
1823
  const i = Object.keys(o);
1809
1824
  for (const t of i) r.slicers[t] = o[t];
1810
1825
  }
1811
1826
  };
1812
- h.registerVisitor(C);
1813
- const A = (t, e) => ({
1827
+ S.registerVisitor(F);
1828
+ const W = (t, e) => ({
1814
1829
  from: t,
1815
1830
  to: {},
1816
1831
  openTag: (t) => {
@@ -1822,8 +1837,8 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1822
1837
  closeTag: (t) => {
1823
1838
  e(String(t.getSource() ?? ""), t);
1824
1839
  }
1825
- }), E = /* @__PURE__ */ new Map();
1826
- E.set("dataValidations", {
1840
+ }), z = /* @__PURE__ */ new Map();
1841
+ z.set("dataValidations", {
1827
1842
  from: "dataValidations",
1828
1843
  to: "validations",
1829
1844
  openTag: (t) => {
@@ -1833,15 +1848,15 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1833
1848
  closeTag: (t) => {
1834
1849
  0 === (t.getSource()?.length ?? 0) && t.setSource(void 0);
1835
1850
  }
1836
- }), E.set("dataValidation", {
1837
- ...S,
1851
+ }), z.set("dataValidation", {
1852
+ ...H,
1838
1853
  closeTag: (t) => {
1839
- S.closeTag(t);
1854
+ H.closeTag(t);
1840
1855
  const e = t.getSource();
1841
1856
  e && !e.r && (t.warn("x14 dataValidation with no xm:sqref was dropped."), t.setSource(void 0));
1842
1857
  }
1843
1858
  });
1844
- const V = (t) => ({
1859
+ const q = (t) => ({
1845
1860
  from: t,
1846
1861
  to: {},
1847
1862
  openTag: (e) => {
@@ -1851,18 +1866,18 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1851
1866
  });
1852
1867
  }
1853
1868
  });
1854
- E.set("formula1", V("formula1")), E.set("formula2", V("formula2")), E.set("f", A("f", (t, e) => {
1869
+ z.set("formula1", q("formula1")), z.set("formula2", q("formula2")), z.set("f", W("f", (t, e) => {
1855
1870
  const s = e.getParent(), o = s?.rule;
1856
- o && (o[s.key] = B(f(t), o.type));
1857
- })), E.set("sqref", A("sqref", (t, e) => {
1871
+ o && (o[s.key] = x(P(t), o.type));
1872
+ })), z.set("sqref", W("sqref", (t, e) => {
1858
1873
  const s = e.getParent(), o = t.trim();
1859
1874
  s && o && (s.r = o.split(/\s+/).join(","));
1860
1875
  }));
1861
- const L = /* @__PURE__ */ new Map(), N = [], R = /* @__PURE__ */ new Map();
1862
- R.set("conditionalFormattings", {
1876
+ const U = /* @__PURE__ */ new Map(), G = [], K = /* @__PURE__ */ new Map();
1877
+ K.set("conditionalFormattings", {
1863
1878
  from: "conditionalFormattings",
1864
1879
  transparent: !0
1865
- }), R.set("conditionalFormatting", {
1880
+ }), K.set("conditionalFormatting", {
1866
1881
  from: "conditionalFormatting",
1867
1882
  to: {},
1868
1883
  openTag: (t) => {
@@ -1872,85 +1887,85 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1872
1887
  const e = t.getSource(), s = e?.rules ?? [];
1873
1888
  for (let t = 0; t < s.length; t++) {
1874
1889
  const o = s[t];
1875
- o.sqref = e.sqref, o.id ? L.set(o.id, o) : N.push(o);
1890
+ o.sqref = e.sqref, o.id ? U.set(o.id, o) : G.push(o);
1876
1891
  }
1877
1892
  }
1878
- }), R.set("cfRule", {
1893
+ }), K.set("cfRule", {
1879
1894
  from: "cfRule",
1880
1895
  to: {},
1881
1896
  openTag: (t) => {
1882
- t.copyTo("id", be), t.copyTo("type", be), t.copyTo("priority", me), t.copyTo("stopIfTrue", ge), t.copyTo("operator", be), t.copyTo("text", be), t.copyTo("timePeriod", be), t.copyTo("aboveAverage", ge), t.copyTo("equalAverage", ge), t.copyTo("stdDev", me), t.copyTo("bottom", ge), t.copyTo("percent", ge), t.copyTo("rank", me);
1897
+ t.copyTo("id", Se), t.copyTo("type", Se), t.copyTo("priority", ve), t.copyTo("stopIfTrue", Te), t.copyTo("operator", Se), t.copyTo("text", Se), t.copyTo("timePeriod", Se), t.copyTo("aboveAverage", Te), t.copyTo("equalAverage", Te), t.copyTo("stdDev", ve), t.copyTo("bottom", Te), t.copyTo("percent", Te), t.copyTo("rank", ve);
1883
1898
  },
1884
1899
  closeTag: (t) => {
1885
1900
  const e = t.getSource();
1886
1901
  e && t.getParent()?.rules?.push(e);
1887
1902
  }
1888
- }), R.set("sqref", A("sqref", (t, e) => {
1903
+ }), K.set("sqref", W("sqref", (t, e) => {
1889
1904
  const s = e.getParent(), o = t.trim();
1890
1905
  s && o && (s.sqref = o);
1891
- })), R.set("dataBar", {
1906
+ })), K.set("dataBar", {
1892
1907
  from: "dataBar",
1893
1908
  to: {},
1894
1909
  openTag: (t) => {
1895
- t.copyTo("minLength", me), t.copyTo("maxLength", me), t.copyTo("gradient", ge), t.copyTo("border", ge), t.copyTo("direction", be), t.copyTo("axisPosition", be), t.copyTo("negativeBarColorSameAsPositive", ge), t.copyTo("negativeBarBorderColorSameAsPositive", ge);
1910
+ t.copyTo("minLength", ve), t.copyTo("maxLength", ve), t.copyTo("gradient", Te), t.copyTo("border", Te), t.copyTo("direction", Se), t.copyTo("axisPosition", Se), t.copyTo("negativeBarColorSameAsPositive", Te), t.copyTo("negativeBarBorderColorSameAsPositive", Te);
1896
1911
  },
1897
1912
  closeTag: (t) => {
1898
1913
  t.getParent().dataBar = t.getSource();
1899
1914
  }
1900
- }), R.set("iconSet", {
1915
+ }), K.set("iconSet", {
1901
1916
  from: "iconSet",
1902
1917
  to: {},
1903
1918
  openTag: (t) => {
1904
- t.copyTo("iconSet", be), t.copyTo("custom", ge), t.copyTo("reverse", ge), t.copyTo("showValue", ge);
1919
+ t.copyTo("iconSet", Se), t.copyTo("custom", Te), t.copyTo("reverse", Te), t.copyTo("showValue", Te);
1905
1920
  },
1906
1921
  closeTag: (t) => {
1907
1922
  t.getParent().iconSet = t.getSource();
1908
1923
  }
1909
1924
  });
1910
- const F = /* @__PURE__ */ new Map();
1911
- F.set("f", A("f", (t, e) => {
1925
+ const Z = /* @__PURE__ */ new Map();
1926
+ Z.set("f", W("f", (t, e) => {
1912
1927
  const s = e.getParent();
1913
1928
  if (!s) return;
1914
1929
  const o = t.trim(), r = Number(o);
1915
- s.value = o.length > 0 && Number.isFinite(r) ? r : f(t);
1916
- })), R.set("cfvo", {
1930
+ s.value = o.length > 0 && Number.isFinite(r) ? r : P(t);
1931
+ })), K.set("cfvo", {
1917
1932
  from: "cfvo",
1918
1933
  to: {},
1919
- scope: () => F,
1934
+ scope: () => Z,
1920
1935
  openTag: (t) => {
1921
1936
  const e = t.getParent();
1922
1937
  e.conditions || (e.conditions = []);
1923
1938
  const s = t.getSource();
1924
- e.conditions.push(s), t.copyTo("type", be), !1 === t.getAttribute("gte", ge) && (s.exclusive = !0);
1939
+ e.conditions.push(s), t.copyTo("type", Se), !1 === t.getAttribute("gte", Te) && (s.exclusive = !0);
1925
1940
  }
1926
- }), R.set("f", A("f", (t, e) => {
1941
+ }), K.set("f", W("f", (t, e) => {
1927
1942
  const s = e.getParent();
1928
- s && (s.formulas ??= []).push(f(t));
1929
- })), R.set("dxf", {
1943
+ s && (s.formulas ??= []).push(P(t));
1944
+ })), K.set("dxf", {
1930
1945
  from: "dxf",
1931
1946
  to: {},
1932
1947
  raw: !0,
1933
1948
  closeTag: (t) => {
1934
- if (!p) return;
1949
+ if (!k) return;
1935
1950
  const e = t.getParent();
1936
1951
  if (!e) return;
1937
- const s = p(t.getRawXml() ?? "");
1952
+ const s = k(t.getRawXml() ?? "");
1938
1953
  s && (e.style = s);
1939
1954
  }
1940
1955
  });
1941
- const W = (t) => ({
1956
+ const Q = (t) => ({
1942
1957
  from: t,
1943
1958
  to: {},
1944
1959
  openTag: (e) => {
1945
- const s = a((t) => e.getAttribute(t));
1960
+ const s = X((t) => e.getAttribute(t));
1946
1961
  s && (e.getParent()[t] = s);
1947
1962
  }
1948
1963
  });
1949
- R.set("borderColor", W("borderColor")), R.set("negativeFillColor", W("negativeFillColor")), R.set("negativeBorderColor", W("negativeBorderColor")), R.set("axisColor", W("axisColor")), R.set("cfIcon", {
1964
+ K.set("borderColor", Q("borderColor")), K.set("negativeFillColor", Q("negativeFillColor")), K.set("negativeBorderColor", Q("negativeBorderColor")), K.set("axisColor", Q("axisColor")), K.set("cfIcon", {
1950
1965
  from: "cfIcon",
1951
1966
  to: {},
1952
1967
  openTag: (t) => {
1953
- const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", me);
1968
+ const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", ve);
1954
1969
  if (null === e || null === s) return;
1955
1970
  const o = t.getParent();
1956
1971
  o.icons || (o.icons = []), o.icons.push({
@@ -1959,61 +1974,62 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
1959
1974
  });
1960
1975
  }
1961
1976
  });
1962
- const X = /* @__PURE__ */ new Map();
1963
- X.set("id", A("id", (t, e) => {
1977
+ const Y = /* @__PURE__ */ new Map();
1978
+ Y.set("id", W("id", (t, e) => {
1964
1979
  const s = e.getParent(), o = t.trim();
1965
1980
  s && o && (s.x14Id = o);
1966
1981
  }));
1967
- const q = /* @__PURE__ */ new Map();
1968
- q.set("slicerList", {
1982
+ const st = /* @__PURE__ */ new Map();
1983
+ st.set("slicerList", {
1969
1984
  from: "slicerList",
1970
1985
  transparent: !0
1971
- }), q.set("slicer", C);
1972
- const U = /* @__PURE__ */ new Map([
1973
- [j($), E],
1974
- [j(m), R],
1975
- [j(b), R],
1976
- [j(k), X],
1977
- [j(x), q],
1978
- [j(O), q]
1979
- ]), G = /* @__PURE__ */ new Set();
1980
- h.registerVisitor({
1986
+ }), st.set("slicer", F);
1987
+ const ot = /* @__PURE__ */ new Map([
1988
+ [n(c), z],
1989
+ [n(p), K],
1990
+ [n(i), K],
1991
+ [n(d), Y],
1992
+ [n(f), st],
1993
+ [n(R), st],
1994
+ [n(u), j]
1995
+ ]), rt = /* @__PURE__ */ new Set();
1996
+ S.registerVisitor({
1981
1997
  from: "extLst",
1982
1998
  transparent: !0
1983
- }), h.registerVisitor({
1999
+ }), S.registerVisitor({
1984
2000
  from: "ext",
1985
2001
  transparent: !0,
1986
2002
  scope: (t) => {
1987
- const e = t.getAttribute("uri"), s = j(e), o = U.get(s);
2003
+ const e = t.getAttribute("uri"), s = n(e), o = ot.get(s);
1988
2004
  if (o) return o;
1989
- if (!w.has(s) && !G.has(s)) {
1990
- G.add(s);
1991
- const o = u[s];
2005
+ if (!a.has(s) && !rt.has(s)) {
2006
+ rt.add(s);
2007
+ const o = g[s];
1992
2008
  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.`);
1993
2009
  }
1994
2010
  return null;
1995
2011
  }
1996
- }), h.registerVisitor({
2012
+ }), S.registerVisitor({
1997
2013
  from: "mergeCell",
1998
2014
  to: [],
1999
2015
  openTag: (t) => {
2000
2016
  const e = t.getAttribute("ref");
2001
2017
  t.setSource(e);
2002
2018
  }
2003
- }), h.registerVisitor({
2019
+ }), S.registerVisitor({
2004
2020
  from: "hyperlinks",
2005
2021
  to: "hyperlinks",
2006
2022
  openTag: (t) => {
2007
2023
  t.setSource([]);
2008
2024
  }
2009
- }), h.registerVisitor({
2025
+ }), S.registerVisitor({
2010
2026
  from: "hyperlink",
2011
2027
  to: [],
2012
2028
  openTag: (t) => {
2013
- const e = t.getAttribute("r:id"), o = t.getAttribute("ref");
2029
+ const s = t.getAttribute("r:id"), o = t.getAttribute("ref");
2014
2030
  if (!o) return void t.warn("A hyperlink has no ref; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.noRef" });
2015
2031
  t.setKey(o);
2016
- let r = e ? s(e) : "";
2032
+ let r = s ? e(s) : "";
2017
2033
  if ("string" != typeof r) return void t.warn("A hyperlink has an invalid address; it was dropped.", { onceKey: "xlsx.sheet.hyperlink.address" });
2018
2034
  r.endsWith("\\") && (r = r.substring(0, r.length - 1));
2019
2035
  const i = t.getAttribute("location");
@@ -2028,45 +2044,45 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2028
2044
  v: n
2029
2045
  });
2030
2046
  }
2031
- }), h.registerVisitor({
2047
+ }), S.registerVisitor({
2032
2048
  from: "drawing",
2033
2049
  to: "movables",
2034
2050
  openTag: (t) => {
2035
- const e = t.getAttribute("r:id");
2036
- if (!e) return;
2037
- const o = s(e);
2051
+ const s = t.getAttribute("r:id");
2052
+ if (!s) return;
2053
+ const o = e(s);
2038
2054
  o ? t.setSource(o.movables) : t.warn("A drawing part is missing; its shapes were not imported.", { onceKey: "xlsx.sheet.drawing.missing" });
2039
2055
  }
2040
- }), h.registerVisitor({
2056
+ }), S.registerVisitor({
2041
2057
  from: "legacyDrawing",
2042
2058
  to: "legacyDrawing",
2043
2059
  openTag: (t) => {
2044
- t.setSource(s(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2060
+ t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2045
2061
  }
2046
- }), h.registerVisitor({
2062
+ }), S.registerVisitor({
2047
2063
  from: "legacyDrawingHF",
2048
2064
  to: "legacyDrawingHF",
2049
2065
  openTag: (t) => {
2050
- t.setSource(s(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2066
+ t.setSource(e(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
2051
2067
  }
2052
2068
  });
2053
- let Z = null, Q = !1;
2054
- const Y = /* @__PURE__ */ new Map(), tt = {
2069
+ let it = null, nt = !1;
2070
+ const ct = /* @__PURE__ */ new Map(), lt = {
2055
2071
  from: "Fallback",
2056
2072
  to: null
2057
- }, et = {
2073
+ }, ht = {
2058
2074
  from: "Choice",
2059
2075
  transparent: !0
2060
2076
  };
2061
- Y.set("Fallback", tt), Y.set("Choice", et), Y.set("control", {
2077
+ ct.set("Fallback", lt), ct.set("Choice", ht), ct.set("control", {
2062
2078
  from: "control",
2063
2079
  transparent: !0,
2064
2080
  openTag: (t) => {
2065
- const e = {}, o = parseInt(t.getAttribute("shapeId") ?? "", 10);
2066
- isNaN(o) || (e.shapeId = o);
2067
- const r = t.getAttribute("r:id"), i = r ? s(r, "part") : null;
2068
- i && (e.part = i);
2069
- const n = t.getAttribute("name"), a = {
2081
+ const s = t.getAttribute("name"), o = t.getAttribute("r:id"), r = o ? e(o, "formControl") : null;
2082
+ if (!r) return t.warn(`The form control '${s ?? ""}' has no properties and was not read.`, { onceKey: "xlsx.sheet.control.noProperties" }), void (it = null);
2083
+ const i = r.json, n = parseInt(t.getAttribute("shapeId") ?? "", 10);
2084
+ isNaN(n) || (i.shapeId = n);
2085
+ const a = {
2070
2086
  anchor: {
2071
2087
  tl: {
2072
2088
  c: 0,
@@ -2082,100 +2098,100 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2082
2098
  }
2083
2099
  },
2084
2100
  content: {
2085
- type: "control",
2086
- json: e
2101
+ type: r.type,
2102
+ json: i
2087
2103
  }
2088
2104
  };
2089
- n && (a.content.name = n), Z = {
2105
+ s && (a.content.name = s), it = {
2090
2106
  movable: a,
2091
- control: e
2107
+ control: i
2092
2108
  };
2093
2109
  },
2094
2110
  closeTag: () => {
2095
- Z && (e.movables || (e.movables = []), e.movables.push(Z.movable), Z = null);
2111
+ it && (t.movables || (t.movables = []), t.movables.push(it.movable), it = null);
2096
2112
  }
2097
- }), Y.set("controlPr", {
2113
+ }), ct.set("controlPr", {
2098
2114
  from: "controlPr",
2099
2115
  transparent: !0,
2100
2116
  raw: !0,
2101
2117
  openTag: (t) => {
2102
- if (!Z) return;
2118
+ if (!it) return;
2103
2119
  const e = t.getFrom().attributes ?? {}, s = {};
2104
2120
  for (const t in e) {
2105
2121
  const o = e[t];
2106
2122
  s[t] = "string" == typeof o ? o : o?.value ?? "";
2107
2123
  }
2108
- Object.keys(s).length > 0 && (Z.control.props = s);
2124
+ b(s, it.control);
2109
2125
  },
2110
2126
  closeTag: (t) => {
2111
- if (!Z) return;
2127
+ if (!it) return;
2112
2128
  const e = ((t) => {
2113
2129
  const e = /<(?:[\w.-]+:)?anchor\b([^>]*)>([\s\S]*?)<\/(?:[\w.-]+:)?anchor>/.exec(t);
2114
2130
  if (!e) return null;
2115
2131
  const s = e[2], o = (t) => new RegExp(`<(?:[\\w.-]+:)?${t}\\b[^>]*>([\\s\\S]*?)<\\/(?:[\\w.-]+:)?${t}>`).exec(s)?.[1], r = e[1], i = /\bmoveWithCells="(?:1|true)"/.test(r), n = /\bsizeWithCells="(?:1|true)"/.test(r);
2116
2132
  return {
2117
2133
  anchor: {
2118
- tl: Pe(o("from")),
2119
- br: Pe(o("to"))
2134
+ tl: Le(o("from")),
2135
+ br: Le(o("to"))
2120
2136
  },
2121
2137
  anchorType: i ? n ? "twoCell" : "oneCell" : "absolute",
2122
2138
  rest: (t.slice(0, e.index) + t.slice(e.index + e[0].length)).trim()
2123
2139
  };
2124
2140
  })(t.getRawXml() ?? "");
2125
- e ? (Z.movable.anchor = e.anchor, "twoCell" !== e.anchorType && (Z.movable.anchorType = e.anchorType), e.rest && (Z.control.xml = e.rest)) : Q || (Q = !0, t.warn("A form control has no anchor; it is placed at the top left of the sheet."));
2141
+ e ? (it.movable.anchor = e.anchor, "twoCell" !== e.anchorType && (it.movable.anchorType = e.anchorType), e.rest && (it.control.xml = e.rest)) : nt || (nt = !0, t.warn("A form control has no anchor; it is placed at the top left of the sheet."));
2126
2142
  }
2127
2143
  });
2128
- const ot = {
2144
+ const ut = {
2129
2145
  from: "controls",
2130
2146
  transparent: !0,
2131
- scope: () => Y
2147
+ scope: () => ct
2132
2148
  };
2133
- h.registerVisitor(ot);
2134
- const rt = /* @__PURE__ */ new Map([
2135
- ["Choice", et],
2136
- ["Fallback", tt],
2137
- ["controls", ot]
2149
+ S.registerVisitor(ut);
2150
+ const dt = /* @__PURE__ */ new Map([
2151
+ ["Choice", ht],
2152
+ ["Fallback", lt],
2153
+ ["controls", ut]
2138
2154
  ]);
2139
- h.registerVisitor({
2155
+ S.registerVisitor({
2140
2156
  from: "AlternateContent",
2141
2157
  transparent: !0,
2142
- scope: () => rt
2143
- }), h.registerVisitor({
2158
+ scope: () => dt
2159
+ }), S.registerVisitor({
2144
2160
  from: "tableParts",
2145
2161
  to: "tables",
2146
2162
  openTag: (t) => {
2147
2163
  t.setSource([]);
2148
2164
  }
2149
- }), h.registerVisitor({
2165
+ }), S.registerVisitor({
2150
2166
  from: "tablePart",
2151
2167
  to: [],
2152
2168
  openTag: (t) => {
2153
- const e = t.getAttribute("r:id");
2154
- if (!e) return;
2155
- const o = s(e);
2169
+ const s = t.getAttribute("r:id");
2170
+ if (!s) return;
2171
+ const o = e(s);
2156
2172
  o ? t.setSource(o) : t.warn("A table part is missing; the table was not imported.", { onceKey: "xlsx.sheet.table.missing" });
2157
2173
  }
2158
2174
  });
2159
- const it = (t, e) => {
2160
- e.conditions?.length && (t.stops = T(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);
2161
- }, nt = (t, e) => {
2162
- e.conditions?.length && (t.stops = T(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);
2163
- }, at = (t) => {
2175
+ const pt = (t, e) => {
2176
+ e.conditions?.length && (t.stops = L(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);
2177
+ }, ft = (t, e) => {
2178
+ e.conditions?.length && (t.stops = L(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);
2179
+ }, gt = (t) => {
2164
2180
  if (!t.sqref) return null;
2165
2181
  const e = t.sqref.split(/\s+/).join(",");
2166
2182
  if ("iconSet" === t.type) {
2167
2183
  if (!t.iconSet) return null;
2168
2184
  const s = {
2169
- type: J.ScaleType.IconSet,
2185
+ type: et.ScaleType.IconSet,
2170
2186
  stops: []
2171
2187
  };
2172
- return nt(s, t.iconSet), {
2188
+ return ft(s, t.iconSet), {
2173
2189
  r: e,
2174
2190
  v: { scale: s },
2175
2191
  priority: t.priority
2176
2192
  };
2177
2193
  }
2178
- const s = P(t, n);
2194
+ const s = I(t, m);
2179
2195
  if (!s) return null;
2180
2196
  const o = { condition: s };
2181
2197
  return t.style && (o.style = t.style), t.stopIfTrue && (o.stopIfTrue = !0), {
@@ -2184,7 +2200,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2184
2200
  priority: t.priority
2185
2201
  };
2186
2202
  };
2187
- h.registerVisitor({
2203
+ S.registerVisitor({
2188
2204
  from: "worksheet",
2189
2205
  to: {},
2190
2206
  openTag: (t) => {},
@@ -2195,28 +2211,28 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2195
2211
  const e = s[t], o = e.x14Id;
2196
2212
  if (!o) continue;
2197
2213
  delete e.x14Id;
2198
- const r = L.get(o);
2214
+ const r = U.get(o);
2199
2215
  if (!r) continue;
2200
- L.delete(o);
2216
+ U.delete(o);
2201
2217
  const i = e.v?.scale;
2202
- r.dataBar && i?.type === J.ScaleType.DataBar ? it(i, r.dataBar) : r.iconSet && i?.type === J.ScaleType.IconSet && nt(i, r.iconSet);
2218
+ r.dataBar && i?.type === et.ScaleType.DataBar ? pt(i, r.dataBar) : r.iconSet && i?.type === et.ScaleType.IconSet && ft(i, r.iconSet);
2203
2219
  }
2204
- const o = [...L.values(), ...N], r = /* @__PURE__ */ new Set();
2220
+ const o = [...U.values(), ...G], r = /* @__PURE__ */ new Set();
2205
2221
  let i = 0;
2206
2222
  for (let t = 0; t < o.length; t++) {
2207
- const n = at(o[t]);
2223
+ const n = gt(o[t]);
2208
2224
  n ? (s || (s = [], e.conditionals = s), s.push(n)) : (r.add(o[t].type ?? "unknown"), i++);
2209
2225
  }
2210
2226
  if (i > 0) {
2211
2227
  const t = [...r].map((t) => `'${t}'`).join(", ");
2212
- n?.(1 === i ? `An x14-only conditional formatting rule (type ${t}) is not read and will be lost on resave.` : `${i} x14-only conditional formatting rules (types ${t}) are not read and will be lost on resave.`);
2228
+ m?.(1 === i ? `An x14-only conditional formatting rule (type ${t}) is not read and will be lost on resave.` : `${i} x14-only conditional formatting rules (types ${t}) are not read and will be lost on resave.`);
2213
2229
  }
2214
2230
  if (s) {
2215
2231
  s.length > 1 && s.sort((t, e) => (t.priority ?? Infinity) - (e.priority ?? Infinity));
2216
2232
  for (let t = 0; t < s.length; t++) delete s[t].priority;
2217
2233
  }
2218
2234
  }
2219
- }), h.registerVisitor({
2235
+ }), S.registerVisitor({
2220
2236
  from: "customProperties",
2221
2237
  to: "customProperties",
2222
2238
  openTag: (t) => {
@@ -2226,37 +2242,37 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2226
2242
  const e = t.getSource();
2227
2243
  if (e.length > 0) t.getParent().customProperties = e;
2228
2244
  }
2229
- }), h.registerVisitor({
2245
+ }), S.registerVisitor({
2230
2246
  from: "customPr",
2231
2247
  to: {},
2232
2248
  openTag: (t) => {
2233
- const e = t.getParent();
2249
+ const s = t.getParent();
2234
2250
  t.copyTo("name");
2235
2251
  const o = t.getAttribute("r:id");
2236
2252
  if (!o) return void t.warn("A custom property names no part; it was not imported.", { onceKey: "xlsx.sheet.customProperty.noRel" });
2237
- const r = s(o, "resource"), i = t.getSource();
2238
- i.resId = r, e.push(i);
2253
+ const r = e(o, "resource"), i = t.getSource();
2254
+ i.resId = r, s.push(i);
2239
2255
  }
2240
- }), h.registerVisitor({
2256
+ }), S.registerVisitor({
2241
2257
  from: "sheetProtection",
2242
2258
  to: "protection",
2243
2259
  openTag: (t) => {
2244
2260
  const e = t.getSource();
2245
- for (const s of M) {
2261
+ for (const s of C) {
2246
2262
  const o = t.hasAttribute(s.attribute) ? t.getAttribute(s.attribute) : null;
2247
- e[s.key] = I(s, o);
2263
+ e[s.key] = E(s, o);
2248
2264
  }
2249
2265
  if (e.sheet) return;
2250
2266
  const s = {};
2251
- if (t.copyToObject(s, "hash", be, "hashValue"), t.copyToObject(s, "algorithm", be, "algorithmName"), t.copyToObject(s, "salt", be, "saltValue"), t.copyToObject(s, "spinCount", me), Object.keys(s).length > 0) t.getSource().password = s;
2267
+ if (t.copyToObject(s, "hash", Se, "hashValue"), t.copyToObject(s, "algorithm", Se, "algorithmName"), t.copyToObject(s, "salt", Se, "saltValue"), t.copyToObject(s, "spinCount", ve), Object.keys(s).length > 0) t.getSource().password = s;
2252
2268
  }
2253
- }), h.registerVisitor({
2269
+ }), S.registerVisitor({
2254
2270
  from: "protectedRanges",
2255
2271
  to: "protectedRanges",
2256
2272
  openTag: (t) => {
2257
2273
  t.setSource([]);
2258
2274
  }
2259
- }), h.registerVisitor({
2275
+ }), S.registerVisitor({
2260
2276
  from: "protectedRange",
2261
2277
  to: [],
2262
2278
  openTag: (t) => {
@@ -2268,68 +2284,68 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2268
2284
  };
2269
2285
  t.copyToObject(s, "name"), t.copyToObject(s, "securityDescriptor");
2270
2286
  const r = {};
2271
- t.copyToObject(r, "hash", be, "hashValue"), t.copyToObject(r, "algorithm", be, "algorithmName"), t.copyToObject(r, "salt", be, "saltValue"), t.copyToObject(r, "spinCount", me), Object.keys(r).length > 0 && (s.password = r), t.setSource(o);
2287
+ t.copyToObject(r, "hash", Se, "hashValue"), t.copyToObject(r, "algorithm", Se, "algorithmName"), t.copyToObject(r, "salt", Se, "saltValue"), t.copyToObject(r, "spinCount", ve), Object.keys(r).length > 0 && (s.password = r), t.setSource(o);
2272
2288
  },
2273
2289
  closeTag: (t) => {
2274
2290
  const e = t.getSource();
2275
2291
  e?.r && e.v.name || t.setSource(void 0);
2276
2292
  }
2277
- }), h.registerVisitor({
2293
+ }), S.registerVisitor({
2278
2294
  from: "sheetFormatPr",
2279
2295
  to: "sheetFormatPr",
2280
- openTag: (t) => {
2281
- t.copyToObject(e, "defaultColSize", xe, "defaultColWidth"), t.copyToObject(e, "outlineLevelCol", me, "outlineLevelCol");
2282
- const s = t.getAttribute("customHeight");
2283
- "1" !== s && "true" !== s || t.copyToObject(e, "defaultRowSize", xe, "defaultRowHeight"), t.copyToObject(e, "outlineLevelRow", me, "outlineLevelRow");
2296
+ openTag: (e) => {
2297
+ e.copyToObject(t, "defaultColSize", we, "defaultColWidth");
2298
+ const s = e.getAttribute("customHeight");
2299
+ "1" !== s && "true" !== s || e.copyToObject(t, "defaultRowSize", we, "defaultRowHeight");
2284
2300
  }
2285
- }), h.registerVisitor({
2301
+ }), S.registerVisitor({
2286
2302
  from: "cols",
2287
2303
  to: "cols",
2288
2304
  openTag: (t) => {
2289
2305
  t.setSource([]);
2290
2306
  }
2291
- }), h.registerVisitor({
2307
+ }), S.registerVisitor({
2292
2308
  from: "col",
2293
2309
  to: [],
2294
2310
  openTag: (t) => {
2295
2311
  const e = t.getSource(), s = t.getAttribute("min"), o = t.getAttribute("max"), r = void 0 === s ? 0 : parseInt(s) - 1, i = void 0 === o ? r : parseInt(o) - 1;
2296
- e.r = z.runToString(r, i, !0);
2312
+ e.r = J.runToString(r, i, !0);
2297
2313
  const n = {};
2298
- e.v = n, t.copyToObject(n, "sz", xe, "width"), t.copyToObject(n, "csz", ge, "customWidth"), t.copyToObject(n, "h", ge, "hidden"), t.copyToObject(n, "l", me, "outlineLevel"), t.copyToObject(n, "s", me, "style");
2314
+ e.v = n, t.copyToObject(n, "sz", we, "width"), t.copyToObject(n, "csz", Te, "customWidth"), t.copyToObject(n, "h", Te, "hidden"), t.copyToObject(n, "l", ve, "outlineLevel"), t.copyToObject(n, "cl", Te, "collapsed"), t.copyToObject(n, "s", ve, "style");
2299
2315
  }
2300
- }), h.registerVisitor({
2316
+ }), S.registerVisitor({
2301
2317
  from: "oleObjects",
2302
2318
  to: null,
2303
2319
  openTag: (t) => {
2304
2320
  t.warn("'OLE Objects' are not supported.");
2305
2321
  }
2306
2322
  });
2307
- let ct = !1, lt = !1, ht = 0, ut = "";
2308
- const pt = (t) => {
2323
+ let mt = !1, xt = !1, yt = 0, bt = "";
2324
+ const Tt = (t) => {
2309
2325
  const e = t.indexOf(":");
2310
2326
  return -1 === e ? t : t.slice(e + 1);
2311
2327
  };
2312
- return Ne(g, e, h.createEventHandler(e, i, n), n, c, {
2328
+ return Me(O, t, S.createEventHandler(t, r, m), m, T, {
2313
2329
  onOpenTag: (t) => {
2314
- ct = !0;
2315
- const e = pt(t.name);
2316
- "t" === e || "v" === e ? 0 === ht && (lt = !0) : "rPh" !== e && "phoneticPr" !== e || ht++;
2330
+ mt = !0;
2331
+ const e = Tt(t.name);
2332
+ "t" === e || "v" === e ? 0 === yt && (xt = !0) : "rPh" !== e && "phoneticPr" !== e || yt++;
2317
2333
  },
2318
2334
  onText: (t) => {
2319
- lt && (ut += t);
2335
+ xt && (bt += t);
2320
2336
  },
2321
2337
  onCloseTag: (t) => {
2322
- const e = pt(t.name);
2323
- "t" === e || "v" === e ? lt = !1 : "rPh" !== e && "phoneticPr" !== e || ht > 0 && ht--;
2338
+ const e = Tt(t.name);
2339
+ "t" === e || "v" === e ? xt = !1 : "rPh" !== e && "phoneticPr" !== e || yt > 0 && yt--;
2324
2340
  },
2325
2341
  onEnd: () => {
2326
- if (!ct) return;
2327
- const t = o(H(ut));
2328
- return ct = !1, lt = !1, ht = 0, ut = "", t;
2342
+ if (!mt) return;
2343
+ const t = s(_(bt));
2344
+ return mt = !1, xt = !1, yt = 0, bt = "", t;
2329
2345
  },
2330
2346
  onError: (t) => {}
2331
- }, l);
2332
- }, _e = class {
2347
+ }, w);
2348
+ }, Re = class {
2333
2349
  static {
2334
2350
  this.Collapsed = 1;
2335
2351
  }
@@ -2366,26 +2382,26 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2366
2382
  static {
2367
2383
  this.ThickTop = 2048;
2368
2384
  }
2369
- }, Ve = (t, e, s) => {
2385
+ }, Be = (t, e, s) => {
2370
2386
  if (t[0].value[0] === t[1].value[0]) return e;
2371
- }, Le = {
2387
+ }, je = {
2372
2388
  colStart: 0,
2373
2389
  colEnd: 0,
2374
2390
  rowStart: 0,
2375
2391
  rowEnd: 0
2376
- }, Ne = (t, e, s, o, r, i, n) => {
2377
- let a = !1, c = !1, l = [], h = !1, u = null, p = null, d = null, f = null, g = null, m = null;
2378
- const x = n?.get("richData") ?? q.EmptyArray, b = n?.get("dummyWrapped") ?? null, y = z.normalizeA1ToR1C1, T = U.createConflatingRanges(), v = /* @__PURE__ */ new Map(), w = [];
2392
+ }, Me = (t, e, s, o, r, i, n) => {
2393
+ let a = !1, c = !1, l = [], h = !1, u = null, d = null, p = null, f = null, g = null, m = null;
2394
+ const x = n?.get("richData") ?? Z.EmptyArray, y = n?.get("dummyWrapped") ?? null, b = J.normalizeA1ToR1C1, T = Q.createConflatingRanges(), v = /* @__PURE__ */ new Map(), w = [];
2379
2395
  let S = !1, C = !1, k = null;
2380
2396
  let A = !1;
2381
- const O = U.createConflatingRanges();
2382
- let E = !1, P = -1, I = -1, D = null, _ = null, V = null;
2397
+ const E = Q.createConflatingRanges();
2398
+ let P = !1, O = -1, I = -1, D = null, _ = null, V = null;
2383
2399
  const L = [];
2384
- let N = null, $ = -2, R = 0, j = "", B = "", M = "", H = "", F = "", W = "", X = "", K = "", J = "", Q = "", Y = "", tt = "", et = "", st = "", ot = !0, rt = null, it = !1, nt = !1, at = !1, ct = null, lt = 0;
2400
+ let N = null, $ = -2, R = 0, B = "", j = "", M = "", H = "", F = "", W = "", z = "", X = "", q = "", U = "", G = "", K = "", tt = "", et = "", ot = !0, rt = null, it = !1, nt = !1, at = !1, ct = null, lt = 0;
2385
2401
  const ht = (t) => {
2386
2402
  let o = t.name;
2387
- const d = o.indexOf(":");
2388
- if (-1 !== d && (o = o.slice(d + 1)), lt++, lt % 196608 == 0 && r?.(lt), _) {
2403
+ const p = o.indexOf(":");
2404
+ if (-1 !== p && (o = o.slice(p + 1)), lt++, lt % 196608 == 0 && r?.(lt), _) {
2389
2405
  const e = t.attributes;
2390
2406
  switch (o) {
2391
2407
  case "v":
@@ -2397,36 +2413,36 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2397
2413
  case "normal": break;
2398
2414
  case "shared":
2399
2415
  const t = e.si;
2400
- p = e.ref, u = t;
2416
+ d = e.ref, u = t;
2401
2417
  break;
2402
2418
  case "array":
2403
- p = e.ref, k = p;
2419
+ d = e.ref, k = d;
2404
2420
  break;
2405
- case "datatable": p = e.ref, h = !0;
2421
+ case "datatable": d = e.ref, h = !0;
2406
2422
  }
2407
2423
  const t = e.ca;
2408
2424
  void 0 !== t && (A = "1" === t);
2409
2425
  break;
2410
2426
  case "is":
2411
- E = !0;
2427
+ P = !0;
2412
2428
  return;
2413
2429
  }
2414
- E && !h && i?.onOpenTag?.(t);
2430
+ P && !h && i?.onOpenTag?.(t);
2415
2431
  return;
2416
2432
  }
2417
2433
  if (a) {
2418
2434
  if ("c" === o) {
2419
2435
  _ = t;
2420
2436
  const e = t.attributes, s = e.r;
2421
- I = z.fastStringToCol(s);
2437
+ I = J.fastStringToCol(s);
2422
2438
  const o = e.t;
2423
- void 0 === o ? V = null : (V = o, "str" === V && (E = !0));
2439
+ void 0 === o ? V = null : (V = o, "str" === V && (P = !0));
2424
2440
  let r = e.s;
2425
2441
  void 0 === r && (null !== ct || at) && (r = "0"), void 0 !== r && (r = parseInt(r), rt && rt.value === r && rt.colEnd + 1 === I ? rt.colEnd = I : (rt = {
2426
2442
  colStart: I,
2427
- rowStart: P,
2443
+ rowStart: O,
2428
2444
  colEnd: I,
2429
- rowEnd: P,
2445
+ rowEnd: O,
2430
2446
  value: r
2431
2447
  }, l.push(rt))), k = null, C = !1;
2432
2448
  const i = e.cm;
@@ -2439,12 +2455,12 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2439
2455
  const a = e.vm;
2440
2456
  if (void 0 !== a) {
2441
2457
  const t = x[parseInt(a) - 1];
2442
- if (G.isError(t)) {
2458
+ if (Y.isError(t)) {
2443
2459
  const e = t.getCode();
2444
2460
  D = {
2445
2461
  t: "e",
2446
2462
  v: e
2447
- }, S && e === G.Code.Spill && (C = !0);
2463
+ }, S && e === Y.Code.Spill && (C = !0);
2448
2464
  }
2449
2465
  }
2450
2466
  }
@@ -2452,22 +2468,22 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2452
2468
  if (nt && "row" === o) {
2453
2469
  a = !0;
2454
2470
  const e = t.attributes.r;
2455
- if (P = parseInt(e) - 1, R = 0, B = t.attributes.customHeight, void 0 !== B && (R |= _e.CustomHeight), B !== J && (ot = !0, J = B), j = t.attributes.ht, void 0 !== j && (R |= _e.Ht), j !== K && (ot = !0, K = j), M = t.attributes.hidden, void 0 !== M && (R |= _e.Hidden), M !== Q && (ot = !0, Q = M), F = t.attributes.s, void 0 !== F && (R |= _e.S), F !== tt && (ot = !0, tt = F), H = t.attributes.customFormat, void 0 !== H && (R |= _e.CustomFormat), H !== Y && (ot = !0, Y = H), W = t.attributes.outlineLevel, void 0 !== W && (R |= _e.OutlineLevel), W !== et && (ot = !0, et = W), X = t.attributes.collapsed, void 0 !== X && (R |= _e.Collapsed), X !== st && (ot = !0, st = X), 0 !== R) if ($ + 1 !== P || ot) {
2456
- const t = void 0 !== B && ("1" === B || "true" === B), e = void 0 !== H && ("1" === H || "true" === H);
2471
+ if (O = parseInt(e) - 1, R = 0, j = t.attributes.customHeight, void 0 !== j && (R |= Re.CustomHeight), j !== q && (ot = !0, q = j), B = t.attributes.ht, void 0 !== B && (R |= Re.Ht), B !== X && (ot = !0, X = B), M = t.attributes.hidden, void 0 !== M && (R |= Re.Hidden), M !== U && (ot = !0, U = M), F = t.attributes.s, void 0 !== F && (R |= Re.S), F !== K && (ot = !0, K = F), H = t.attributes.customFormat, void 0 !== H && (R |= Re.CustomFormat), H !== G && (ot = !0, G = H), W = t.attributes.outlineLevel, void 0 !== W && (R |= Re.OutlineLevel), W !== tt && (ot = !0, tt = W), z = t.attributes.collapsed, void 0 !== z && (R |= Re.Collapsed), z !== et && (ot = !0, et = z), 0 !== R) if ($ + 1 !== O || ot) {
2472
+ const t = void 0 !== j && ("1" === j || "true" === j), e = void 0 !== H && ("1" === H || "true" === H);
2457
2473
  ct = e && void 0 !== F ? F : null, e && null === ct && (ct = "0"), N = {
2458
- min: P,
2459
- max: P,
2474
+ min: O,
2475
+ max: O,
2460
2476
  value: {
2461
- sz: void 0 === j ? -1 : parseFloat(j),
2477
+ sz: void 0 === B ? -1 : parseFloat(B),
2462
2478
  csz: t,
2463
2479
  h: void 0 !== M && ("1" === M || "true" === M),
2464
2480
  s: null === ct ? void 0 : "0" === ct ? 0 : parseInt(ct),
2465
2481
  l: void 0 === W || "0" === W ? 0 : parseInt(W),
2466
- cl: void 0 !== X && ("1" === X || "true" === X)
2482
+ cl: void 0 !== z && ("1" === z || "true" === z)
2467
2483
  }
2468
2484
  }, L.push(N);
2469
- } else N.max = P;
2470
- $ = P, ot = !1;
2485
+ } else N.max = O;
2486
+ $ = O, ot = !1;
2471
2487
  return;
2472
2488
  }
2473
2489
  if ("sheetData" === o && (nt = !0), !it && "sheetData" === o) {
@@ -2479,18 +2495,18 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2479
2495
  }
2480
2496
  }, ut = (e) => {
2481
2497
  let o = e.name;
2482
- if ("sheetData" === o && (nt = !1), !h || "c" !== o && "f" !== o || (u && (f = v.get(u) ?? null), f && (T.append(P, I, f), A && O.append(P, I)), null !== k && w.push([k, S ? C ? "error" : "dynamic" : "fixed"]), h = !1, f = null, u = null, p = null, c = !1, A = !1, k = null, S = !1, C = !1), _) {
2498
+ if ("sheetData" === o && (nt = !1), !h || "c" !== o && "f" !== o || (u && (f = v.get(u) ?? null), f && (T.append(O, I, f), A && E.append(O, I)), null !== k && w.push([k, S ? C ? "error" : "dynamic" : "fixed"]), h = !1, f = null, u = null, d = null, c = !1, A = !1, k = null, S = !1, C = !1), _) {
2483
2499
  const s = o.indexOf(":");
2484
- if (-1 !== s && (o = o.slice(s + 1)), E) if ("is" === o || "v" === o) {
2500
+ if (-1 !== s && (o = o.slice(s + 1)), P) if ("is" === o || "v" === o) {
2485
2501
  const e = i?.onEnd?.();
2486
- null != e && t.pushAt(P, I, "" + e);
2502
+ null != e && t.pushAt(O, I, "" + e);
2487
2503
  } else "f" !== o && i?.onCloseTag?.(e);
2488
- c && (c = !1), "c" === o && (_ = null, E = !1);
2504
+ c && (c = !1), "c" === o && (_ = null, P = !1);
2489
2505
  return;
2490
2506
  }
2491
2507
  if (a) return a = !1, void (rt = null);
2492
2508
  s?.onCloseTag?.(e);
2493
- }, pt = (r) => {
2509
+ }, dt = (r) => {
2494
2510
  const n = r.trim();
2495
2511
  if (c) {
2496
2512
  switch (D = null, V) {
@@ -2509,7 +2525,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2509
2525
  const t = _.attributes.vm;
2510
2526
  if (void 0 !== t) {
2511
2527
  const e = x[parseInt(t) - 1];
2512
- if (G.isError(e)) {
2528
+ if (Y.isError(e)) {
2513
2529
  D = {
2514
2530
  t: "e",
2515
2531
  v: e.getCode()
@@ -2518,27 +2534,27 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2518
2534
  }
2519
2535
  }
2520
2536
  }
2521
- const t = G.getBuiltInByLabel(n);
2537
+ const t = Y.getBuiltInByLabel(n);
2522
2538
  t ? D = {
2523
2539
  t: "e",
2524
2540
  v: t.getCode()
2525
- } : (D = n, o?.(`Unknown formula error '${n}' in cell ${z.cellToString({
2541
+ } : (D = n, o?.(`Unknown formula error '${n}' in cell ${J.cellToString({
2526
2542
  colIndex: I,
2527
- rowIndex: P
2543
+ rowIndex: O
2528
2544
  })}`));
2529
2545
  break;
2530
2546
  case "str":
2531
- case "inlineStr": E = !0;
2547
+ case "inlineStr": P = !0;
2532
2548
  }
2533
- null !== D && t.pushAt(P, I, D);
2549
+ null !== D && t.pushAt(O, I, D);
2534
2550
  }
2535
2551
  if (u) {
2536
2552
  if (g === u) f = m;
2537
2553
  else {
2538
2554
  if (f = v.get(u) ?? null, !f) {
2539
2555
  const t = [];
2540
- d = y(n, P, I, t), f = [
2541
- d,
2556
+ p = b(n, O, I, t), f = [
2557
+ p,
2542
2558
  t,
2543
2559
  n
2544
2560
  ], v.set(u, f);
@@ -2548,37 +2564,37 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2548
2564
  u = null;
2549
2565
  }
2550
2566
  if (h) {
2551
- if (null !== b) {
2567
+ if (null !== y) {
2552
2568
  const t = ((t) => {
2553
- if (t.length < we.length) return ke;
2554
- if (t.slice(0, we.length).toUpperCase() !== Se) return ke;
2555
- const e = Oe(t, we.length);
2556
- if (null === e) return ke;
2557
- if (41 !== t.charCodeAt(e.end)) return ke;
2558
- if (44 !== t.charCodeAt(e.end + 1)) return ke;
2559
- if (41 !== t.charCodeAt(t.length - 1)) return ke;
2569
+ if (t.length < Ee.length) return Ie;
2570
+ if (t.slice(0, Ee.length).toUpperCase() !== Pe) return Ie;
2571
+ const e = _e(t, Ee.length);
2572
+ if (null === e) return Ie;
2573
+ if (41 !== t.charCodeAt(e.end)) return Ie;
2574
+ if (44 !== t.charCodeAt(e.end + 1)) return Ie;
2575
+ if (41 !== t.charCodeAt(t.length - 1)) return Ie;
2560
2576
  const s = e.value;
2561
- return s.toUpperCase() === Ce ? Ae : 0 === s.length ? ke : {
2577
+ return s.toUpperCase() === Oe ? De : 0 === s.length ? Ie : {
2562
2578
  kind: "formula",
2563
2579
  formula: s
2564
2580
  };
2565
2581
  })(n);
2566
- "none" !== t.kind && b.push({
2582
+ "none" !== t.kind && y.push({
2567
2583
  sheet: e,
2568
- rowIndex: P,
2584
+ rowIndex: O,
2569
2585
  colIndex: I,
2570
2586
  formula: "formula" === t.kind ? t.formula : null
2571
2587
  });
2572
2588
  }
2573
2589
  const t = [];
2574
- d = y(n, P, I, t), f = [
2575
- d,
2590
+ p = b(n, O, I, t), f = [
2591
+ p,
2576
2592
  t,
2577
2593
  n
2578
2594
  ];
2579
2595
  }
2580
- E ? i?.onText?.(r) : a || s?.onText?.(n);
2581
- }, dt = {
2596
+ P ? i?.onText?.(r) : a || s?.onText?.(n);
2597
+ }, pt = {
2582
2598
  r: void 0,
2583
2599
  t: void 0,
2584
2600
  s: void 0,
@@ -2586,7 +2602,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2586
2602
  vm: void 0
2587
2603
  }, ft = {
2588
2604
  name: "c",
2589
- attributes: dt,
2605
+ attributes: pt,
2590
2606
  isSelfClosing: !1
2591
2607
  }, gt = {
2592
2608
  t: void 0,
@@ -2601,7 +2617,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2601
2617
  name: "v",
2602
2618
  attributes: {},
2603
2619
  isSelfClosing: !1
2604
- }, bt = {
2620
+ }, yt = {
2605
2621
  r: void 0,
2606
2622
  s: void 0,
2607
2623
  ht: void 0,
@@ -2610,11 +2626,11 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2610
2626
  customHeight: void 0,
2611
2627
  customFormat: void 0,
2612
2628
  outlineLevel: void 0
2613
- }, yt = {
2629
+ }, bt = {
2614
2630
  name: "row",
2615
- attributes: bt,
2631
+ attributes: yt,
2616
2632
  isSelfClosing: !1
2617
- }, Tt = fe.NEED_MORE, vt = fe.NOT_HANDLED, wt = fe.decodeText;
2633
+ }, Tt = be.NEED_MORE, vt = be.NOT_HANDLED, wt = be.decodeText;
2618
2634
  let St = !1;
2619
2635
  const Ct = (t, e, s, o) => {
2620
2636
  for (;;) {
@@ -2642,20 +2658,20 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2642
2658
  const h = t.charCodeAt(i);
2643
2659
  if (2 === o) switch (n) {
2644
2660
  case 1:
2645
- 114 === h ? bt.r = t.slice(c, l) : 115 === h && (bt.s = t.slice(c, l));
2661
+ 114 === h ? yt.r = t.slice(c, l) : 115 === h && (yt.s = t.slice(c, l));
2646
2662
  break;
2647
2663
  case 2:
2648
- t.startsWith("ht", i) && (bt.ht = t.slice(c, l));
2664
+ t.startsWith("ht", i) && (yt.ht = t.slice(c, l));
2649
2665
  break;
2650
2666
  case 6:
2651
- t.startsWith("hidden", i) && (bt.hidden = t.slice(c, l));
2667
+ t.startsWith("hidden", i) && (yt.hidden = t.slice(c, l));
2652
2668
  break;
2653
2669
  case 9:
2654
- t.startsWith("collapsed", i) && (bt.collapsed = t.slice(c, l));
2670
+ t.startsWith("collapsed", i) && (yt.collapsed = t.slice(c, l));
2655
2671
  break;
2656
- case 12: t.startsWith("customHeight", i) ? bt.customHeight = t.slice(c, l) : t.startsWith("customFormat", i) ? bt.customFormat = t.slice(c, l) : t.startsWith("outlineLevel", i) && (bt.outlineLevel = t.slice(c, l));
2672
+ case 12: t.startsWith("customHeight", i) ? yt.customHeight = t.slice(c, l) : t.startsWith("customFormat", i) ? yt.customFormat = t.slice(c, l) : t.startsWith("outlineLevel", i) && (yt.outlineLevel = t.slice(c, l));
2657
2673
  }
2658
- else if (0 === o) 1 === n ? 114 === h ? dt.r = t.slice(c, l) : 116 === h ? dt.t = t.slice(c, l) : 115 === h && (dt.s = t.slice(c, l)) : 2 === n && 109 === t.charCodeAt(i + 1) && (99 === h ? dt.cm = t.slice(c, l) : 118 === h && (dt.vm = t.slice(c, l)));
2674
+ else if (0 === o) 1 === n ? 114 === h ? pt.r = t.slice(c, l) : 116 === h ? pt.t = t.slice(c, l) : 115 === h && (pt.s = t.slice(c, l)) : 2 === n && 109 === t.charCodeAt(i + 1) && (99 === h ? pt.cm = t.slice(c, l) : 118 === h && (pt.vm = t.slice(c, l)));
2659
2675
  else if (1 === n) 116 === h && (gt.t = t.slice(c, l));
2660
2676
  else if (2 === n) {
2661
2677
  const e = t.charCodeAt(i + 1);
@@ -2666,30 +2682,30 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2666
2682
  return {
2667
2683
  ...s,
2668
2684
  onEnd: () => {
2669
- L.length > 0 && (e.rows = z.runsToRefs(L, !1));
2670
- let o = T.done(Ve);
2685
+ L.length > 0 && (e.rows = J.runsToRefs(L, !1));
2686
+ let o = T.done(Be);
2671
2687
  const r = o.length;
2672
2688
  if (r > 0) {
2673
2689
  const t = new Array(r);
2674
2690
  for (let e = 0; e < r; e++) {
2675
- const s = o[e], r = z.rangeToString(s), i = s.value[1];
2676
- t[e] = [r, z.resolveRelativeToA1(i, s.rowStart, s.colStart)];
2691
+ const s = o[e], r = J.rangeToString(s), i = s.value[1];
2692
+ t[e] = [r, J.resolveRelativeToA1(i, s.rowStart, s.colStart)];
2677
2693
  }
2678
2694
  e.formulas = t;
2679
2695
  }
2680
- const i = O.done(!0), n = i.length;
2696
+ const i = E.done(!0), n = i.length;
2681
2697
  if (n > 0) {
2682
2698
  const t = new Array(n);
2683
2699
  for (let e = 0; e < n; e++) {
2684
2700
  const s = i[e];
2685
- t[e] = z.rangeToString(s);
2701
+ t[e] = J.rangeToString(s);
2686
2702
  }
2687
2703
  e.volatile = t;
2688
2704
  }
2689
2705
  w.length > 0 && (e.formulaArray = [...w]);
2690
2706
  const a = l.length;
2691
2707
  if (a > 0) {
2692
- l.sort(U.createRangeComparator(Z.Axis.Column));
2708
+ l.sort(Q.createRangeComparator(st.Axis.Column));
2693
2709
  let t = l[0], s = t.colStart, o = t.colEnd, r = t.rowEnd, i = t.value;
2694
2710
  const n = [];
2695
2711
  n.push(t);
@@ -2698,7 +2714,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2698
2714
  const h = n.length, u = new Array(h);
2699
2715
  for (let t = 0; t < h; t++) {
2700
2716
  const e = n[t];
2701
- u[t] = [z.rangeToString(e), e.value];
2717
+ u[t] = [J.rangeToString(e), e.value];
2702
2718
  }
2703
2719
  e.directStyles = u;
2704
2720
  }
@@ -2707,16 +2723,16 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2707
2723
  },
2708
2724
  onOpenTag: ht,
2709
2725
  onCloseTag: ut,
2710
- onText: pt,
2726
+ onText: dt,
2711
2727
  elementScanners: [{
2712
2728
  name: "c",
2713
2729
  scan: (t, e, s) => {
2714
2730
  if (!a || null !== _) return vt;
2715
- dt.r = dt.t = dt.s = dt.cm = dt.vm = void 0;
2731
+ pt.r = pt.t = pt.s = pt.cm = pt.vm = void 0;
2716
2732
  let o = Ct(t, e + 2, s, 0);
2717
2733
  if (o < 0) return o;
2718
- const r = dt.t;
2719
- if (void 0 === dt.r || "str" === r || "inlineStr" === r) return vt;
2734
+ const r = pt.t;
2735
+ if (void 0 === pt.r || "str" === r || "inlineStr" === r) return vt;
2720
2736
  let i = !1, n = -1, c = -1, l = -1, h = -1, u = o;
2721
2737
  if (!St) for (gt.t = gt.si = gt.ref = gt.ca = void 0;;) {
2722
2738
  const e = t.indexOf("<", o);
@@ -2749,23 +2765,23 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2749
2765
  }
2750
2766
  return vt;
2751
2767
  }
2752
- return ht(ft), i && (ht(mt), c > n && pt(wt(t.slice(n, c))), ut(mt)), -1 !== l && (ht(xt), h > l && pt(wt(t.slice(l, h))), ut(xt)), ut(ft), u;
2768
+ return ht(ft), i && (ht(mt), c > n && dt(wt(t.slice(n, c))), ut(mt)), -1 !== l && (ht(xt), h > l && dt(wt(t.slice(l, h))), ut(xt)), ut(ft), u;
2753
2769
  }
2754
2770
  }, {
2755
2771
  name: "row",
2756
- openTag: yt,
2772
+ openTag: bt,
2757
2773
  scan: (t, e, s) => {
2758
2774
  if (!nt || a || null !== _) return vt;
2759
- bt.r = bt.s = bt.ht = bt.hidden = bt.collapsed = bt.customHeight = bt.customFormat = bt.outlineLevel = void 0;
2775
+ yt.r = yt.s = yt.ht = yt.hidden = yt.collapsed = yt.customHeight = yt.customFormat = yt.outlineLevel = void 0;
2760
2776
  const o = Ct(t, e + 4, s, 2);
2761
- return o < 0 ? o : St || void 0 === bt.r ? vt : (ht(yt), o);
2777
+ return o < 0 ? o : St || void 0 === yt.r ? vt : (ht(bt), o);
2762
2778
  }
2763
2779
  }]
2764
2780
  };
2765
- }, $e = (t) => {
2781
+ }, He = (t) => {
2766
2782
  const e = t.indexOf(":");
2767
2783
  return -1 === e ? t : t.slice(e + 1);
2768
- }, Re = {
2784
+ }, Fe = {
2769
2785
  "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
2770
2786
  "application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
2771
2787
  "application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
@@ -2795,51 +2811,51 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2795
2811
  "application/vnd.ms-excel.externalLink": "links",
2796
2812
  "application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
2797
2813
  "application/vnd.openxmlformats-officedocument.theme+xml": "themes"
2798
- }, je = (t) => t.startsWith("/") ? t.slice(1) : t, Be = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, Me = (t) => "string" == typeof t ? t : (t?.runs ?? []).map((t) => t.text ?? "").join(""), He = async (t, a) => {
2799
- const { password: c, onVBA: u, profile: p, calcOnLoad: d = "auto", createWorkbookOptions: f = {}, ...m } = a ?? {}, x = !!f.origin && "string" != typeof f.origin, b = p ? new ht("function" == typeof p ? p : void 0) : null, w = [], k = (t, e, s) => {
2800
- w.push([
2814
+ }, We = (t) => t.startsWith("/") ? t.slice(1) : t, ze = /^xl\/(worksheets|chartsheets)\/[^/]+\.xml$/i, Xe = (t) => "string" == typeof t ? t : (t?.runs ?? []).map((t) => t.text ?? "").join(""), qe = async (i, n) => {
2815
+ const { password: a, onVBA: c, profile: l, calcOnLoad: h = "auto", createWorkbookOptions: u = {}, ...d } = n ?? {}, p = !!u.origin && "string" != typeof u.origin, f = l ? new gt("function" == typeof l ? l : void 0) : null, g = [], x = (t, e, s) => {
2816
+ g.push([
2801
2817
  t,
2802
2818
  e ?? "",
2803
2819
  s
2804
2820
  ]);
2805
- }, O = { onWarning: k }, P = a?.progress, I = P?.onProgress ? P.onProgress.bind(P) : void 0, D = t.byteLength;
2806
- let _ = 0, $ = 0;
2807
- const j = I ? (t) => {
2808
- if (_ <= 0) return;
2809
- $ += t;
2810
- const e = Math.min(D, Math.round($ / _ * D));
2811
- I(e, D);
2812
- } : void 0, B = import("./BlbtH3EvAf3K4foF.mjs");
2813
- let M = null;
2821
+ }, y = { onWarning: x }, b = n?.progress, v = b?.onProgress ? b.onProgress.bind(b) : void 0, w = i.byteLength;
2822
+ let C = 0, k = 0;
2823
+ const E = v ? (t) => {
2824
+ if (C <= 0) return;
2825
+ k += t;
2826
+ const e = Math.min(w, Math.round(k / C * w));
2827
+ v(e, w);
2828
+ } : void 0, O = import("./j0RE2usgdljRw_gr.mjs");
2829
+ let I = null;
2814
2830
  try {
2815
- M = new DOMParser();
2831
+ I = new DOMParser();
2816
2832
  } catch (t) {}
2817
- let q = null;
2833
+ let V = null;
2818
2834
  try {
2819
- q = new XMLSerializer();
2835
+ V = new XMLSerializer();
2820
2836
  } catch (t) {}
2821
- let U, G, K, J = null;
2822
- M || (J = import("@xmldom/xmldom"));
2837
+ let $, R, X, Z = null;
2838
+ I || (Z = import("@xmldom/xmldom"));
2823
2839
  try {
2824
- const [t, e] = await Promise.all([J, B]);
2825
- U = new e.DOMTransformer(), G = M ?? new t.DOMParser(), K = q ?? new t.XMLSerializer();
2840
+ const [t, e] = await Promise.all([Z, O]);
2841
+ $ = new e.DOMTransformer(), R = I ?? new t.DOMParser(), X = V ?? new t.XMLSerializer();
2826
2842
  } catch (t) {
2827
2843
  throw new Error("Unable to load XLSX parser.", { cause: t });
2828
2844
  }
2829
- const Z = (t) => K.serializeToString(t);
2830
- let st;
2845
+ const Q = (t) => X.serializeToString(t);
2846
+ let Y;
2831
2847
  try {
2832
- st = await lt.create(t);
2848
+ Y = await ft.create(i);
2833
2849
  } catch (t) {
2834
- throw new X("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
2850
+ throw new K("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
2835
2851
  }
2836
- b?.mark("zip-open");
2852
+ f?.mark("zip-open");
2837
2853
  try {
2838
- if (!st.has("[Content_Types].xml")) throw new X("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
2839
- const t = (t) => {
2840
- const e = st.getEntry(t);
2854
+ if (!Y.has("[Content_Types].xml")) throw new K("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
2855
+ const i = (t) => {
2856
+ const e = Y.getEntry(t);
2841
2857
  return e ? { content: e } : void 0;
2842
- }, a = {
2858
+ }, n = {
2843
2859
  workbooks: [],
2844
2860
  sheets: [],
2845
2861
  charts: [],
@@ -2872,7 +2888,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2872
2888
  const e = o.ContentType, s = o.PartName;
2873
2889
  if (!e || !s) return;
2874
2890
  t.overrides[s.startsWith("/") ? s.slice(1) : s] = e;
2875
- const r = Re[e], i = r ? t[r] : void 0;
2891
+ const r = Fe[e], i = r ? t[r] : void 0;
2876
2892
  Array.isArray(i) && i.push(s);
2877
2893
  } else if ("Default" === s) {
2878
2894
  const e = o.Extension, s = o.ContentType;
@@ -2885,200 +2901,200 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
2885
2901
  onError: (t) => {
2886
2902
  e?.(`Error parsing content types: ${t?.message ?? t}`);
2887
2903
  }
2888
- }))(a, (t) => {
2889
- w.push([t, "[Content_Types].xml"]);
2890
- }), e = await st.getTextStream("[Content_Types].xml");
2904
+ }))(n, (t) => {
2905
+ g.push([t, "[Content_Types].xml"]);
2906
+ }), e = await Y.getTextStream("[Content_Types].xml");
2891
2907
  if (!e) throw new Error("Error parsing content types: '[Content_Types].xml'");
2892
2908
  try {
2893
- await oe.parseStream(e, t, { xmlns: !1 });
2909
+ await ce.parseStream(e, t, { xmlns: !1 });
2894
2910
  } catch (t) {
2895
2911
  throw new Error("Error parsing content types: '[Content_Types].xml'", { cause: t });
2896
2912
  }
2897
- x && await st.getBuffer("[Content_Types].xml");
2898
- }
2899
- b?.mark("content-types");
2900
- const c = a.sst, m = /* @__PURE__ */ new Set();
2901
- for (const t of a.sheets) m.add(je(t));
2902
- c && m.add(je(c));
2903
- for (const t of m) _ += st.uncompressedSize(t);
2904
- if (await st.prefetch((t) => !m.has(t) && !Be.test(t)), b?.mark("prefetch-side-parts"), 0 === a.workbooks.length) {
2905
- const e = r("_rels/.rels", t, G, U, O), s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
2906
- if (e) {
2907
- for (const t of e.values()) if (t.type === s && t.target) {
2908
- a.workbooks.push(t.target);
2913
+ p && await Y.getBuffer("[Content_Types].xml");
2914
+ }
2915
+ f?.mark("content-types");
2916
+ const a = n.sst, d = /* @__PURE__ */ new Set();
2917
+ for (const t of n.sheets) d.add(We(t));
2918
+ a && d.add(We(a));
2919
+ for (const t of d) C += Y.uncompressedSize(t);
2920
+ if (await Y.prefetch((t) => !d.has(t) && !ze.test(t)), f?.mark("prefetch-side-parts"), 0 === n.workbooks.length) {
2921
+ const t = z("_rels/.rels", i, R, $, y), e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument";
2922
+ if (t) {
2923
+ for (const s of t.values()) if (s.type === e && s.target) {
2924
+ n.workbooks.push(s.target);
2909
2925
  break;
2910
2926
  }
2911
2927
  }
2912
2928
  }
2913
- if (0 === a.workbooks.length) throw new X("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
2914
- a.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], a.richdata = ["/xl/richData/rdrichvalue.xml"];
2915
- const $ = f?.resources ?? new tt(), B = $.beginPersist(), M = {}, q = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new Map();
2916
- K.set("richTypes", []), K.set("parseInlineDxf", (t) => {
2929
+ if (0 === n.workbooks.length) throw new K("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.");
2930
+ n.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], n.richdata = ["/xl/richData/rdrichvalue.xml"];
2931
+ const k = u?.resources ?? new it(), O = k.beginPersist(), I = {}, V = /* @__PURE__ */ new Set(), X = /* @__PURE__ */ new Map();
2932
+ X.set("richTypes", []), X.set("parseInlineDxf", (t) => {
2917
2933
  if (!t) return;
2918
- const e = G.parseFromString(`<dxf xmlns:x14="${A}" xmlns:xm="${E}">${t}</dxf>`, "text/xml")?.documentElement;
2919
- if (!e) return;
2920
- const s = U.parseDxf(e, "", O);
2921
- return Object.keys(s).length > 0 ? s : void 0;
2934
+ const s = R.parseFromString(`<dxf xmlns:x14="${e}" xmlns:xm="${m}">${t}</dxf>`, "text/xml")?.documentElement;
2935
+ if (!s) return;
2936
+ const o = $.parseDxf(s, "", y);
2937
+ return Object.keys(o).length > 0 ? o : void 0;
2922
2938
  });
2923
- const J = [];
2924
- K.set("dummyWrapped", J);
2925
- const Q = s("metadata", a, t, G, U, O).entries().next()?.value?.[1]?.metadata;
2926
- Q && K.set("metadata", Q), K.set(Ie, y());
2927
- const rt = /* @__PURE__ */ new Map(), it = [], nt = /* @__PURE__ */ new Set(), at = (t) => {
2928
- nt.add(je(t));
2929
- }, ct = (e, s = rt) => {
2930
- const o = e.lastIndexOf("/"), i = e.substring(0, o + 1) + "_rels/" + e.substring(o + 1, e.length) + ".rels";
2931
- let n = s.get(i);
2932
- return n || (n = r(i, t, G, U, xt), s.set(i, n)), n;
2933
- }, lt = (s, r, i, n = rt) => {
2934
- let a = ct(r, n).get(s), c = a?.target;
2935
- if (!c) return null;
2936
- if ("External" === a.targetMode) {
2937
- if (!i) return a.target;
2938
- const t = $.add({ source: { external: a.target } });
2939
- return t.addReference(M), q.add(t), B.toResourceId(t);
2939
+ const Z = [];
2940
+ X.set("dummyWrapped", Z);
2941
+ const tt = W("metadata", n, i, R, $, y).entries().next()?.value?.[1]?.metadata;
2942
+ tt && X.set("metadata", tt), X.set(Ne, r());
2943
+ const et = /* @__PURE__ */ new Map(), st = [], ot = /* @__PURE__ */ new Set(), at = (t) => {
2944
+ ot.add(We(t));
2945
+ }, lt = (t, e = et) => {
2946
+ const s = t.lastIndexOf("/"), o = t.substring(0, s + 1) + "_rels/" + t.substring(s + 1, t.length) + ".rels";
2947
+ let r = e.get(o);
2948
+ return r || (r = z(o, i, R, $, bt), e.set(o, r)), r;
2949
+ }, ht = (e, s, o, r = et) => {
2950
+ let n = lt(s, r).get(e), a = n?.target;
2951
+ if (!a) return null;
2952
+ if ("External" === n.targetMode) {
2953
+ if (!o) return n.target;
2954
+ const t = k.add({ source: { external: n.target } });
2955
+ return t.addReference(I), V.add(t), O.toResourceId(t);
2940
2956
  }
2941
- const l = r.lastIndexOf("/"), u = r.substring(0, l + 1);
2942
- c.startsWith("/") || (c = u + c), c = o(c);
2943
- const p = U?.getVisitorParamsState().get("dxfs");
2944
- let d = n.get(c);
2945
- if (!d) {
2946
- const s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", o = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
2947
- if (a.type === s) {
2948
- const t = {};
2949
- d = t;
2950
- const e = async () => {
2951
- const e = De(t, (t, e) => "legacyDrawing" === e ? pt(t, c) : "part" === e ? dt(t, c) : lt(t, c, "resource" === e) ?? null, wt, p, () => {}, (t, e, s) => {
2952
- k(t, e ? `${e} (${c})` : c, s);
2953
- }, void 0, K), s = await st.getTextStream(c, j);
2954
- if (s) try {
2955
- await oe.parseStream(s, e, {
2957
+ const c = s.lastIndexOf("/"), l = s.substring(0, c + 1);
2958
+ a.startsWith("/") || (a = l + a), a = H(a);
2959
+ const h = $?.getVisitorParamsState().get("dxfs");
2960
+ let u = r.get(a);
2961
+ if (!u) {
2962
+ const e = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
2963
+ if (n.type === e) {
2964
+ const e = {};
2965
+ u = e;
2966
+ const s = async () => {
2967
+ const s = $e(e, (t, e) => "legacyDrawing" === e ? pt(t, a) : "formControl" === e ? ft(t, a) : "part" === e ? gt(t, a) : ht(t, a, "resource" === e) ?? null, Ct, h, () => {}, (t, e, s) => {
2968
+ x(t, e ? `${e} (${a})` : a, s);
2969
+ }, void 0, X), o = await Y.getTextStream(a, E);
2970
+ if (o) try {
2971
+ await ce.parseStream(o, s, {
2956
2972
  xmlns: !1,
2957
2973
  lean: !0
2958
2974
  });
2959
2975
  } catch (t) {
2960
- throw new Error(`Error parsing sheet: '${c}'`, { cause: t });
2976
+ throw new Error(`Error parsing sheet: '${a}'`, { cause: t });
2961
2977
  }
2962
- const o = ct(c, n);
2963
- if (o) {
2964
- ut(t, c, o, n);
2965
- const e = [];
2966
- o.forEach((t, s) => {
2967
- if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" !== t.type) return;
2968
- const o = dt(s, c, t.type, (t) => "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" !== t);
2969
- if (!o?.xml) return;
2970
- const r = /<pivotTableDefinition\b[^>]*>/.exec(o.xml)?.[0] ?? "", i = parseInt(/\scacheId="(\d+)"/.exec(r)?.[1] ?? "", 10);
2971
- if (isNaN(i)) return void w.push([`Pivot table '${o.name}' names no cache and was dropped.`, c]);
2972
- const n = /\sname="([^"]*)"/.exec(r)?.[1];
2973
- e.push({
2974
- ...n ? { name: C(n) } : {},
2975
- cacheId: i,
2976
- part: o
2978
+ const i = lt(a, r);
2979
+ if (i) {
2980
+ dt(e, a, i, r), P(e);
2981
+ const s = [];
2982
+ i.forEach((e, o) => {
2983
+ if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" !== e.type) return;
2984
+ const r = gt(o, a, e.type, (t) => "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" !== t);
2985
+ if (!r?.xml) return;
2986
+ const i = /<pivotTableDefinition\b[^>]*>/.exec(r.xml)?.[0] ?? "", n = parseInt(/\scacheId="(\d+)"/.exec(i)?.[1] ?? "", 10);
2987
+ if (isNaN(n)) return void g.push([`Pivot table '${r.name}' names no cache and was dropped.`, a]);
2988
+ const c = /\sname="([^"]*)"/.exec(i)?.[1];
2989
+ s.push({
2990
+ ...c ? { name: t(c) } : {},
2991
+ cacheId: n,
2992
+ part: r
2977
2993
  });
2978
- }), e.length > 0 && (t.pivotTables = e);
2994
+ }), s.length > 0 && (e.pivotTables = s);
2979
2995
  }
2980
2996
  };
2981
- it.push(e());
2982
- } else if (a.type === o) {
2983
- const s = e(c, t, G, U, xt);
2984
- if (s && 0 !== Object.keys(s).length) {
2985
- const t = s, e = t.__bookRelId, o = t.__absoluteUrlRelId;
2986
- delete t.__bookRelId, delete t.__absoluteUrlRelId;
2987
- const r = [];
2988
- ct(c, n)?.forEach((t, s) => {
2997
+ st.push(s());
2998
+ } else if (n.type === s) {
2999
+ const t = B(a, i, R, $, bt);
3000
+ if (t && 0 !== Object.keys(t).length) {
3001
+ const e = t, s = e.__bookRelId, o = e.__absoluteUrlRelId;
3002
+ delete e.__bookRelId, delete e.__absoluteUrlRelId;
3003
+ const i = [];
3004
+ lt(a, r)?.forEach((t, e) => {
2989
3005
  if ("External" === t.targetMode && t.type && t.target) {
2990
- const i = {
3006
+ const r = {
2991
3007
  type: t.type,
2992
3008
  target: t.target
2993
3009
  };
2994
- s === e ? i.role = "book" : s === o && (i.role = "absoluteUrl"), r.push(i);
3010
+ e === s ? r.role = "book" : e === o && (r.role = "absoluteUrl"), i.push(r);
2995
3011
  }
2996
- }), r.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), t.sources = r, at(c), d = t;
2997
- } else d = null;
2998
- } else d = i ? h(c, t, (t, e) => {
2999
- const s = $.add({ source: { buffer: t } });
3000
- return s.addReference(M), q.add(s), B.toResourceId(s);
3001
- }, xt) : e(c, t, G, U, xt);
3012
+ }), i.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), e.sources = i, at(a), u = e;
3013
+ } else u = null;
3014
+ } else u = o ? M(a, i, (t, e) => {
3015
+ const s = k.add({ source: { buffer: t } });
3016
+ return s.addReference(I), V.add(s), O.toResourceId(s);
3017
+ }, bt) : B(a, i, R, $, bt);
3002
3018
  }
3003
- return d;
3004
- }, ht = (t, e) => {
3019
+ return u;
3020
+ }, ut = (t, e) => {
3005
3021
  if (!t) return null;
3006
- const s = ct(e, rt)?.get(t);
3022
+ const s = lt(e, et)?.get(t);
3007
3023
  if (!s?.target || "External" === s.targetMode) return null;
3008
- let r = s.target;
3009
- return r.startsWith("/") || (r = e.substring(0, e.lastIndexOf("/") + 1) + r), o(r);
3010
- }, ut = (t, e, s, o) => {
3011
- const r = [], n = /* @__PURE__ */ new Map(), a = [];
3024
+ let o = s.target;
3025
+ return o.startsWith("/") || (o = e.substring(0, e.lastIndexOf("/") + 1) + o), H(o);
3026
+ }, dt = (t, e, s, o) => {
3027
+ const r = [], i = /* @__PURE__ */ new Map(), n = [];
3012
3028
  s.forEach((t, s) => {
3013
3029
  if ("http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" !== t.type) return;
3014
- const i = lt(s, e, !1, o)?.comments;
3015
- if (!i) return;
3016
- for (let t = 0; t < i.length; t++) {
3017
- const e = i[t];
3030
+ const a = ht(s, e, !1, o)?.comments;
3031
+ if (!a) return;
3032
+ for (let t = 0; t < a.length; t++) {
3033
+ const e = a[t];
3018
3034
  if (!e?.v?.id) continue;
3019
3035
  const { parentId: s, done: o, content: c, ...l } = e.v, h = {
3020
3036
  ...l,
3021
- content: Me(c)
3037
+ content: Xe(c)
3022
3038
  };
3023
- s ? a.push({
3039
+ s ? n.push({
3024
3040
  parentId: s,
3025
3041
  json: h
3026
- }) : (o && (h.done = !0), n.set(h.id, h), r.push({
3042
+ }) : (o && (h.done = !0), i.set(h.id, h), r.push({
3027
3043
  r: e.r,
3028
3044
  v: h
3029
3045
  }));
3030
3046
  }
3031
- const c = ht(s, e);
3047
+ const c = ut(s, e);
3032
3048
  c && at(c);
3033
3049
  });
3034
- for (let t = 0; t < a.length; t++) {
3035
- const { parentId: e, json: s } = a[t], o = n.get(e);
3050
+ for (let t = 0; t < n.length; t++) {
3051
+ const { parentId: e, json: s } = n[t], o = i.get(e);
3036
3052
  o && (o.replies ??= []).push(s);
3037
3053
  }
3038
- const c = [];
3054
+ const a = [];
3039
3055
  if (s.forEach((t, s) => {
3040
3056
  if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" !== t.type) return;
3041
- const r = lt(s, e, !1, o), a = r?.comments;
3042
- if (!a) return;
3043
- const l = r?.authors;
3044
- for (let t = 0; t < a.length; t++) {
3045
- const e = a[t];
3057
+ const r = ht(s, e, !1, o), n = r?.comments;
3058
+ if (!n) return;
3059
+ const c = r?.authors;
3060
+ for (let t = 0; t < n.length; t++) {
3061
+ const e = n[t];
3046
3062
  if (!e?.r) continue;
3047
- let s = l && void 0 !== e.v.authorId ? l[e.v.authorId] : void 0;
3063
+ let s = c && void 0 !== e.v.authorId ? c[e.v.authorId] : void 0;
3048
3064
  if (s && s.startsWith("tc=")) {
3049
- if (n.has(i(s.substring(3)))) continue;
3065
+ if (i.has(j(s.substring(3)))) continue;
3050
3066
  s = void 0;
3051
3067
  }
3052
3068
  const o = {
3053
- id: W.uuidV4().toUpperCase(),
3069
+ id: G.uuidV4().toUpperCase(),
3054
3070
  asNote: !0,
3055
3071
  content: e.v.content ?? ""
3056
- }, r = s ? mt({ displayName: s }) : void 0;
3057
- r && (o.personId = r.id), c.push({
3072
+ }, r = s ? yt({ displayName: s }) : void 0;
3073
+ r && (o.personId = r.id), a.push({
3058
3074
  r: e.r,
3059
3075
  v: o
3060
3076
  });
3061
3077
  }
3062
- const h = ht(s, e);
3063
- h && at(h);
3064
- }), 0 === r.length && 0 === c.length) return;
3065
- const l = [...r, ...c], h = t.legacyDrawing;
3066
- if (h?.xml) {
3067
- const { rest: e, notes: s } = R(h.xml);
3078
+ const l = ut(s, e);
3079
+ l && at(l);
3080
+ }), 0 === r.length && 0 === a.length) return;
3081
+ const c = [...r, ...a], l = t.legacyDrawing;
3082
+ if (l?.xml) {
3083
+ const { rest: e, notes: s } = D(l.xml);
3068
3084
  if (s.length > 0) {
3069
3085
  const o = /* @__PURE__ */ new Map();
3070
3086
  for (let t = 0; t < s.length; t++) {
3071
3087
  const e = s[t];
3072
- o.set(z.cellToString({
3088
+ o.set(J.cellToString({
3073
3089
  rowIndex: e.row,
3074
3090
  colIndex: e.col
3075
3091
  }), e);
3076
3092
  }
3077
- for (let t = 0; t < l.length; t++) {
3078
- const e = l[t], s = o.get(String(e.r).toUpperCase());
3093
+ for (let t = 0; t < c.length; t++) {
3094
+ const e = c[t], s = o.get(String(e.r).toUpperCase());
3079
3095
  if (!s) continue;
3080
3096
  if (o.delete(String(e.r).toUpperCase()), !e.v.asNote) continue;
3081
- const r = N(s.xml), i = {};
3097
+ const r = A(s.xml), i = {};
3082
3098
  if (r.anchor) {
3083
3099
  const [t, e, o, n, a, c, l, h] = r.anchor;
3084
3100
  i.anchor = {
@@ -3102,174 +3118,179 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3102
3118
  o.forEach((t) => {
3103
3119
  r.push(t.xml);
3104
3120
  });
3105
- const i = V(e, r);
3106
- i ? h.xml = i : delete t.legacyDrawing;
3121
+ const i = S(e, r);
3122
+ i ? l.xml = i : delete t.legacyDrawing;
3107
3123
  }
3108
3124
  }
3109
- t.comments = l;
3110
- }, pt = (e, s) => {
3111
- const o = ht(e, s);
3125
+ t.comments = c;
3126
+ }, pt = (t, e) => {
3127
+ const s = ut(t, e);
3128
+ if (!s) return null;
3129
+ const o = i(We(s));
3112
3130
  if (!o) return null;
3113
- const r = t(je(o));
3114
- if (!r) return null;
3115
- const i = { xml: new TextDecoder("utf-8").decode(r.content) }, n = [];
3116
- return ct(o, rt)?.forEach((t, e) => {
3131
+ const r = { xml: new TextDecoder("utf-8").decode(o.content) }, n = [];
3132
+ return lt(s, et)?.forEach((t, e) => {
3117
3133
  if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" !== t.type) return;
3118
- const s = lt(e, o, !0);
3119
- "number" == typeof s && n.push({
3134
+ const o = ht(e, s, !0);
3135
+ "number" == typeof o && n.push({
3120
3136
  id: e,
3121
- resId: s
3137
+ resId: o
3122
3138
  });
3123
- }), n.length > 0 && (i.images = n), at(o), i;
3124
- }, dt = (e, s, o, r, i = /* @__PURE__ */ new Set()) => {
3125
- const n = ht(e, s);
3126
- if (!n || i.has(n)) return null;
3127
- const c = o ?? ct(s, rt)?.get(e)?.type;
3139
+ }), n.length > 0 && (r.images = n), at(s), r;
3140
+ }, ft = (t, e) => {
3141
+ const s = ut(t, e);
3142
+ if (!s) return null;
3143
+ const o = B(s, i, R, $, bt)?.formControl ?? null;
3144
+ return o && at(s), o;
3145
+ }, gt = (t, e, s, o, r = /* @__PURE__ */ new Set()) => {
3146
+ const a = ut(t, e);
3147
+ if (!a || r.has(a)) return null;
3148
+ const c = s ?? lt(e, et)?.get(t)?.type;
3128
3149
  if (!c) return null;
3129
- const l = t(je(n));
3150
+ const l = i(We(a));
3130
3151
  if (!l) return null;
3131
- i.add(n);
3132
- const h = n.substring(n.lastIndexOf("/") + 1), u = a.overrides[je(n)] ?? a.defaults[h.substring(h.lastIndexOf(".") + 1).toLowerCase()], p = {
3133
- id: e,
3152
+ r.add(a);
3153
+ const h = a.substring(a.lastIndexOf("/") + 1), u = n.overrides[We(a)] ?? n.defaults[h.substring(h.lastIndexOf(".") + 1).toLowerCase()], d = {
3154
+ id: t,
3134
3155
  type: c,
3135
3156
  name: h
3136
3157
  };
3137
- if (u && (p.contentType = u), ((t, e) => t ? t.endsWith("+xml") || "application/xml" === t : /\.(xml|rels|vml)$/i.test(e))(u, h)) p.xml = new TextDecoder("utf-8").decode(l.content);
3158
+ if (u && (d.contentType = u), ((t, e) => t ? t.endsWith("+xml") || "application/xml" === t : /\.(xml|rels|vml)$/i.test(e))(u, h)) d.xml = new TextDecoder("utf-8").decode(l.content);
3138
3159
  else {
3139
- const t = lt(e, s, !0);
3140
- if ("number" != typeof t) return null;
3141
- p.resId = t;
3160
+ const s = ht(t, e, !0);
3161
+ if ("number" != typeof s) return null;
3162
+ d.resId = s;
3142
3163
  }
3143
- const d = [];
3144
- return ct(n, rt)?.forEach((t, e) => {
3164
+ const p = [];
3165
+ return lt(a, et)?.forEach((t, e) => {
3145
3166
  if (!t?.type) return;
3146
- if (r && !r(t.type)) return;
3167
+ if (o && !o(t.type)) return;
3147
3168
  if ("External" === t.targetMode) {
3148
- const s = lt(e, n, !0);
3149
- "number" == typeof s && d.push({
3169
+ const s = ht(e, a, !0);
3170
+ "number" == typeof s && p.push({
3150
3171
  id: e,
3151
3172
  type: t.type,
3152
3173
  resId: s
3153
3174
  });
3154
3175
  return;
3155
3176
  }
3156
- const s = dt(e, n, t.type, r, i);
3157
- s && d.push(s);
3158
- }), d.length > 0 && (p.parts = d), at(n), p;
3177
+ const s = gt(e, a, t.type, o, r);
3178
+ s && p.push(s);
3179
+ }), p.length > 0 && (d.parts = p), at(a), d;
3159
3180
  };
3160
- s("coreprops", a, t, G, U, O), s("extprops", a, t, G, U, O);
3161
- const ft = new Y(), gt = s("people", a, t, G, U, O);
3162
- if (gt.size > 0) {
3163
- const [t, e] = gt.entries().next().value;
3164
- ft.fromJSON(e?.persons), at(t);
3165
- }
3166
- const mt = (t) => {
3167
- if (t) return ft.add(t).toJSON();
3168
- }, xt = {
3169
- paramMap: K,
3170
- getRefs: ct,
3171
- getRef: lt,
3172
- parsedRefs: rt,
3173
- readEmbeddedPart: (t, e) => dt(t, e),
3174
- addPerson: mt,
3175
- serializeElement: Z,
3176
- onWarning: k
3177
- }, bt = [];
3178
- if (c) {
3179
- const t = await st.getTextStream(c, j);
3181
+ W("coreprops", n, i, R, $, y), W("extprops", n, i, R, $, y);
3182
+ const mt = new rt(), xt = W("people", n, i, R, $, y);
3183
+ if (xt.size > 0) {
3184
+ const [t, e] = xt.entries().next().value;
3185
+ mt.fromJSON(e?.persons), at(t);
3186
+ }
3187
+ const yt = (t) => {
3188
+ if (t) return mt.add(t).toJSON();
3189
+ }, bt = {
3190
+ paramMap: X,
3191
+ getRefs: lt,
3192
+ getRef: ht,
3193
+ parsedRefs: et,
3194
+ readEmbeddedPart: (t, e) => gt(t, e),
3195
+ addPerson: yt,
3196
+ serializeElement: Q,
3197
+ onWarning: x
3198
+ }, Tt = [];
3199
+ if (a) {
3200
+ const t = await Y.getTextStream(a, E);
3180
3201
  if (t) {
3181
3202
  const e = ((t, e) => {
3182
3203
  let s = !1, o = !1, r = 0, i = "";
3183
3204
  return {
3184
3205
  onOpenTag: (t) => {
3185
- const e = $e(t.name);
3206
+ const e = He(t.name);
3186
3207
  "t" === e ? s && 0 === r && (o = !0) : "si" === e ? (s = !0, i = "", r = 0) : "rPh" !== e && "phoneticPr" !== e || r++;
3187
3208
  },
3188
3209
  onText: (t) => {
3189
3210
  o && (i += t);
3190
3211
  },
3191
3212
  onCloseTag: (e) => {
3192
- const n = $e(e.name);
3193
- "t" === n ? o = !1 : "si" === n ? (t(H(i)), s = !1, i = "") : "rPh" !== n && "phoneticPr" !== n || r > 0 && r--;
3213
+ const n = He(e.name);
3214
+ "t" === n ? o = !1 : "si" === n ? (t(_(i)), s = !1, i = "") : "rPh" !== n && "phoneticPr" !== n || r > 0 && r--;
3194
3215
  },
3195
3216
  onError: (t) => {
3196
3217
  e?.(`Error parsing shared strings: ${t?.message ?? t}`);
3197
3218
  }
3198
3219
  };
3199
3220
  })((t) => {
3200
- bt.push(t);
3221
+ Tt.push(t);
3201
3222
  }, (t) => {
3202
- k(t, c);
3223
+ x(t, a);
3203
3224
  });
3204
3225
  try {
3205
- await oe.parseStream(t, e, { xmlns: !1 });
3226
+ await ce.parseStream(t, e, { xmlns: !1 });
3206
3227
  } catch (t) {
3207
- throw new Error(`Error parsing shared strings: '${c}'`, { cause: t });
3228
+ throw new Error(`Error parsing shared strings: '${a}'`, { cause: t });
3208
3229
  }
3209
3230
  }
3210
3231
  }
3211
- b?.mark("shared-strings");
3212
- let yt = bt.length;
3213
- const Tt = /* @__PURE__ */ new Map();
3214
- let vt = yt;
3215
- const wt = (t) => {
3216
- const e = Tt.get(t);
3232
+ f?.mark("shared-strings");
3233
+ let vt = Tt.length;
3234
+ const wt = /* @__PURE__ */ new Map();
3235
+ let St = vt;
3236
+ const Ct = (t) => {
3237
+ const e = wt.get(t);
3217
3238
  if (void 0 !== e) return e;
3218
- const s = vt;
3219
- return Tt.set(t, vt++), bt.push(t), s;
3220
- }, St = [];
3221
- a.slicersCache = St;
3222
- const Ct = st.getNames(), kt = Ct.length;
3223
- for (let t = 0; t < kt; t++) {
3224
- const e = Ct[t];
3225
- e && e.startsWith("xl/slicerCache") && St.push(`/${e}`);
3226
- }
3227
- const At = s("slicersCache", a, t, G, U, xt), Ot = /* @__PURE__ */ new Map();
3228
- At.forEach((t) => {
3239
+ const s = St;
3240
+ return wt.set(t, St++), Tt.push(t), s;
3241
+ }, kt = [];
3242
+ n.slicersCache = kt;
3243
+ const At = Y.getNames(), Et = At.length;
3244
+ for (let t = 0; t < Et; t++) {
3245
+ const e = At[t];
3246
+ e && e.startsWith("xl/slicerCache") && kt.push(`/${e}`);
3247
+ }
3248
+ const Pt = W("slicersCache", n, i, R, $, bt), Ot = /* @__PURE__ */ new Map();
3249
+ Pt.forEach((t) => {
3229
3250
  const e = t.name;
3230
3251
  delete t.name, Ot.set(e, t);
3231
- }), K.set("slicerCaches", Ot), s("richstructure", a, t, G, U, xt), s("richdata", a, t, G, U, xt);
3232
- const Et = s("themes", a, t, G, U, xt);
3233
- let Pt = null;
3234
- if (Et && Et.entries) {
3235
- let t = Et.entries().next();
3236
- t?.value?.[1] && (Pt = t.value[1]);
3237
- }
3238
- const It = new et(Pt);
3239
- let Dt = s("styles", a, t, G, U, xt).entries().next()?.value?.[1];
3240
- Dt && (Dt = JSON.parse(F.JSONStableStringify(Dt)));
3241
- const _t = s("workbooks", a, t, G, U, xt);
3242
- b?.mark("side-parts-json"), await Promise.all(it);
3252
+ }), X.set("slicerCaches", Ot), W("richstructure", n, i, R, $, bt), W("richdata", n, i, R, $, bt);
3253
+ const It = W("themes", n, i, R, $, bt);
3254
+ let Dt = null;
3255
+ if (It && It.entries) {
3256
+ let t = It.entries().next();
3257
+ t?.value?.[1] && (Dt = t.value[1]);
3258
+ }
3259
+ const _t = new nt(Dt);
3260
+ let Vt = W("styles", n, i, R, $, bt).entries().next()?.value?.[1];
3261
+ Vt && (Vt = JSON.parse(U.JSONStableStringify(Vt)));
3262
+ const Lt = W("workbooks", n, i, R, $, bt);
3263
+ f?.mark("side-parts-json"), await Promise.all(st);
3243
3264
  {
3244
- const t = _t.entries().next().value?.[1], e = y(t?.names), s = t?.sheets ?? [];
3265
+ const t = Lt.entries().next().value?.[1], e = r(t?.names), s = t?.sheets ?? [];
3245
3266
  for (let t = 0; t < s.length; t++) {
3246
- const o = s[t]?.sheet;
3247
- o && S(o, e);
3267
+ const r = s[t]?.sheet;
3268
+ r && o(r, e);
3248
3269
  }
3249
- const o = t?.names;
3250
- if (o) for (let t = 0; t < o.length; t++) {
3251
- const s = o[t]?.ref;
3252
- "string" == typeof s && (o[t].ref = e.readDetached(s));
3270
+ const i = t?.names;
3271
+ if (i) for (let t = 0; t < i.length; t++) {
3272
+ const s = i[t]?.ref;
3273
+ "string" == typeof s && (i[t].ref = e.readDetached(s));
3253
3274
  }
3254
3275
  }
3255
- I && _ > 0 && (I(D, D), await new Promise((t) => setTimeout(t, 0))), b?.mark("sheets");
3256
- const Vt = {
3257
- ..._t.entries().next().value?.[1],
3258
- styles: Dt,
3259
- theme: It.toJSON()
3276
+ v && C > 0 && (v(w, w), await new Promise((t) => setTimeout(t, 0))), f?.mark("sheets");
3277
+ const Nt = {
3278
+ ...Lt.entries().next().value?.[1],
3279
+ styles: Vt,
3280
+ theme: _t.toJSON()
3260
3281
  };
3261
- n(Vt, K.get(l)), Vt.calc = {
3262
- ...Vt.calc ?? {},
3282
+ F(Nt, X.get(q)), Nt.calc = {
3283
+ ...Nt.calc ?? {},
3263
3284
  legacyIntersect: !0
3264
- }, bt.length > 0 && (Vt.strings = bt);
3265
- const Lt = ft.toJSON();
3266
- Lt && Lt.length > 0 && (Vt.people = Lt);
3267
- const Nt = st.getEntry("xl/vbaProject.bin");
3268
- if (Nt) try {
3269
- const { VBAProject: t } = await import("./DLBm8l0jyL2fVlxg.mjs"), e = t.extract(Nt);
3285
+ }, Tt.length > 0 && (Nt.strings = Tt);
3286
+ const $t = mt.toJSON();
3287
+ $t && $t.length > 0 && (Nt.people = $t);
3288
+ const Rt = Y.getEntry("xl/vbaProject.bin");
3289
+ if (Rt) try {
3290
+ const { VBAProject: t } = await import("./CBtj0-a4l2qux2hA.mjs"), e = t.extract(Rt);
3270
3291
  if (e) {
3271
3292
  const s = /* @__PURE__ */ new Map();
3272
- for (const t of Vt.sheets ?? []) {
3293
+ for (const t of Nt.sheets ?? []) {
3273
3294
  const e = t?.sheet?.codeName;
3274
3295
  e && s.set(e, t.sheet);
3275
3296
  }
@@ -3278,25 +3299,25 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3278
3299
  i && (e.source = i), r && (e.sourceHeader = r);
3279
3300
  const n = "document" === o.type ? s.get(o.name) : void 0;
3280
3301
  n || "document" !== o.type || (e.scope = "workbook");
3281
- const a = n ? n.modules ??= {} : Vt.modules ??= {};
3302
+ const a = n ? n.modules ??= {} : Nt.modules ??= {};
3282
3303
  a[o.name] || (a[o.name] = e);
3283
3304
  }
3284
- u?.(e);
3285
- } else w.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
3305
+ c?.(e);
3306
+ } else g.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
3286
3307
  } catch (t) {
3287
- w.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
3308
+ g.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
3288
3309
  }
3289
- const $t = K.get("calcId"), Rt = void 0 === $t || !(Number($t) >= 191029), jt = f.calcOnLoad ?? ("auto" === d && Rt ? "full" : d), Bt = {
3290
- ...f,
3291
- calcOnLoad: jt,
3292
- resources: $,
3293
- json: Vt
3310
+ const Bt = X.get("calcId"), jt = void 0 === Bt || !(Number(Bt) >= 191029), Mt = u.calcOnLoad ?? ("auto" === h && jt ? "full" : h), Ht = {
3311
+ ...u,
3312
+ calcOnLoad: Mt,
3313
+ resources: k,
3314
+ json: Nt
3294
3315
  };
3295
- void 0 === Bt.disableLoadAutoFit && (Bt.disableLoadAutoFit = !1), b?.mark("json-assembled");
3296
- const Mt = new ot(Bt);
3297
- if (b?.mark("workbook-constructed"), J.length > 0 && "none" !== jt) {
3298
- await Mt.whenCalculationReady();
3299
- const t = /* @__PURE__ */ new Map(), e = Vt.sheets ?? [], s = Mt.getSheets().getItems();
3316
+ void 0 === Ht.disableLoadAutoFit && (Ht.disableLoadAutoFit = !1), f?.mark("json-assembled");
3317
+ const Ft = new ct(Ht);
3318
+ if (f?.mark("workbook-constructed"), Z.length > 0 && "none" !== Mt) {
3319
+ await Ft.whenCalculationReady();
3320
+ const t = /* @__PURE__ */ new Map(), e = Nt.sheets ?? [], s = Ft.getSheets().getItems();
3300
3321
  for (let o = 0; o < e.length; o++) {
3301
3322
  const r = e[o]?.sheet, i = s[o];
3302
3323
  r && i && t.set(r, i);
@@ -3318,7 +3339,7 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3318
3339
  for (const t of e) null === t.formula && n.add(r(t.rowIndex, t.colIndex));
3319
3340
  for (const t of e) {
3320
3341
  if (null === t.formula) continue;
3321
- const e = Ee(t.formula);
3342
+ const e = Ve(t.formula);
3322
3343
  let s = !0;
3323
3344
  for (const t of e) if (!i(t)) {
3324
3345
  s = !1;
@@ -3352,20 +3373,20 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3352
3373
  }).setValue("=" + t.formula);
3353
3374
  }
3354
3375
  }
3355
- })(Mt, J, t);
3376
+ })(Ft, Z, t);
3356
3377
  }
3357
- if (q.forEach((t) => {
3358
- t.deleteReference(M);
3359
- }), B.endPersist(), x) {
3360
- v(Mt);
3378
+ if (V.forEach((t) => {
3379
+ t.deleteReference(I);
3380
+ }), O.endPersist(), p) {
3381
+ s(Ft);
3361
3382
  const t = /* @__PURE__ */ new Map();
3362
3383
  let e = 0;
3363
- for (const s of st.getNames()) {
3364
- const o = st.getEntry(s);
3384
+ for (const s of Y.getNames()) {
3385
+ const o = Y.getEntry(s);
3365
3386
  if (!o) continue;
3366
- const r = st.getRawEntry(s), i = r ? {
3387
+ const r = Y.getRawEntry(s), i = r ? {
3367
3388
  data: o,
3368
- uncompressedSize: st.uncompressedSize(s),
3389
+ uncompressedSize: Y.uncompressedSize(s),
3369
3390
  raw: {
3370
3391
  compressedData: r.data,
3371
3392
  compressionMethod: r.compressionMethod,
@@ -3373,40 +3394,40 @@ var ge = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
3373
3394
  }
3374
3395
  } : {
3375
3396
  data: o,
3376
- uncompressedSize: st.uncompressedSize(s)
3397
+ uncompressedSize: Y.uncompressedSize(s)
3377
3398
  };
3378
3399
  t.set(s, i), e += o.byteLength;
3379
3400
  }
3380
- if (e > 67108864) w.push([`Source package too large to retain (${e} bytes, limit ${L}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
3401
+ if (e > 67108864) g.push([`Source package too large to retain (${e} bytes, limit ${T}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
3381
3402
  else if (t.size > 0) {
3382
- const e = new T(t, nt);
3383
- g(Mt, e);
3384
- let s = Mt.getSheets().getItems();
3385
- const o = Mt.getTransactions().addListener({ onCommitEnd: (t) => {
3403
+ const e = new N(t, ot);
3404
+ L(Ft, e);
3405
+ let o = Ft.getSheets().getItems();
3406
+ const r = Ft.getTransactions().addListener({ onCommitEnd: (t) => {
3386
3407
  const s = t.getOperation()?.name;
3387
3408
  "insertCells" !== s && "deleteCells" !== s || e.markStructuralChange();
3388
- } }), r = Mt.addListeners({ onSheetsChange: () => {
3389
- const t = Mt.getSheets().getItems();
3390
- (t.length !== s.length || t.some((t, e) => t !== s[e])) && e.markStructuralChange(), s = t;
3409
+ } }), i = Ft.addListeners({ onSheetsChange: () => {
3410
+ const t = Ft.getSheets().getItems();
3411
+ (t.length !== o.length || t.some((t, e) => t !== o[e])) && e.markStructuralChange(), o = t;
3391
3412
  } });
3392
- Mt.addListeners({ onClose: () => {
3393
- o(), r(), v(Mt);
3413
+ Ft.addListeners({ onClose: () => {
3414
+ r(), i(), s(Ft);
3394
3415
  } });
3395
3416
  }
3396
3417
  }
3397
- if (w.length && P?.onWarning) {
3418
+ if (g.length && b?.onWarning) {
3398
3419
  const t = /* @__PURE__ */ new Set();
3399
- for (const e of w) {
3420
+ for (const e of g) {
3400
3421
  const [s, o, r] = e, i = r ?? s;
3401
- t.has(i) || (t.add(i), P.onWarning(s, o));
3422
+ t.has(i) || (t.add(i), b.onWarning(s, o));
3402
3423
  }
3403
3424
  }
3404
- return b && !0 === p && console.table(b.toTable()), Mt;
3425
+ return f && !0 === l && console.table(f.toTable()), Ft;
3405
3426
  } catch (t) {
3406
3427
  let e = "Unable to parse XLSX.";
3407
- throw t instanceof Q && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
3428
+ throw t instanceof ot && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
3408
3429
  } finally {
3409
- await st.close().catch(() => {});
3430
+ await Y.close().catch(() => {});
3410
3431
  }
3411
3432
  };
3412
- export { He as readXLSX };
3433
+ export { qe as readXLSX };