@sheetxl/io-xlsx 0.8.0-beta.5 → 0.8.0-beta.6
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.
- package/browser/cjs/{DtBN3UOzNJjYBwJ6.cjs → 17tMBnuyu4YIxixh.cjs} +1 -1
- package/browser/cjs/BxU-OlZIQViQl7gX.cjs +1 -0
- package/browser/cjs/DHKWtqZ0vQfXrbq1.cjs +2 -0
- package/browser/cjs/DpZr07y7ifaZGvJ9.cjs +5 -0
- package/browser/cjs/{DULsYP_GcPGLVYSE.cjs → MqKQ_B5qRARrRbO4.cjs} +16 -3
- package/browser/cjs/index.cjs +1 -1
- package/browser/cjs/{DOTve1YXP86VW8ln.cjs → qb-YQ8mGwpogSP08.cjs} +1 -1
- package/browser/esm/{B9qJ5NSreEcSeTPX.mjs → 96C1ntelYWh7kQtW.mjs} +1 -1
- package/browser/esm/{B1yJJD4hEJtoWKFg.mjs → B0E-_6m23g4BDnX6.mjs} +2 -2
- package/browser/esm/{BcWQ-WWSh4k_BbiQ.mjs → B3cYXnqV2Zjaw6Jp.mjs} +4 -4
- package/browser/esm/{BIfJ7hj1nXfdThAg.mjs → BLEHoDT0SLbo8OO2.mjs} +1236 -1150
- package/browser/esm/{DZcQYS8AC3Q4KMNZ.mjs → BYENv_UE3Hv5ghGD.mjs} +599 -597
- package/browser/esm/{EvN99eSJ3aoJPumL.mjs → CGgjL7wM5WHZA6Dt.mjs} +2 -2
- package/browser/esm/{Cka8nUQmzdu2avsT.mjs → D01fs7vrCLlmdHoW.mjs} +899 -795
- package/browser/esm/{DJsvdO0gLkETZXLX.mjs → DdTgGiFy8nAZTQ0d.mjs} +2 -2
- package/browser/esm/{VMf5ikEX-Pl2qTh8.mjs → FwrsLfi1iEAQGIjj.mjs} +246 -154
- package/browser/esm/{CEbxib7xV2WuS-D3.mjs → gicSNvWtBLkvLsIw.mjs} +3 -3
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{CCD-nLdFzaQd6BuH.mjs → k-aEFzUZ8aU9FPf4.mjs} +1 -1
- package/node/esm/{CT9_4oNvQhBAW0fh.mjs → B-g20MoPHbZFapp8.mjs} +1652 -1545
- package/node/esm/{BJHtwV9ss8ol7zme.mjs → Bu9QkKpBW4G2ULAg.mjs} +177 -83
- package/node/esm/{CwK9xIdlW4XaFkip.mjs → CHl-WFsto0oTmBtB.mjs} +380 -288
- package/node/esm/{DqkQZkjIOnAGH7ah.mjs → Co5_sjvEk9d-x9gx.mjs} +576 -574
- package/node/esm/{DmlGXhQHqcwqLA05.mjs → D-l0hqYTXUIEFoTg.mjs} +2 -2
- package/node/esm/{CRjza0eYeRMSvbQf.mjs → DWF_5NYPdrlTVvHi.mjs} +1 -1
- package/node/esm/{CsrSCSuGVvpk7uBv.mjs → ZWSOYqmTKEmEOz2u.mjs} +2 -2
- package/node/esm/{C0lFi5Rstdk8y5VR.mjs → am47EU_k1uSVm7yW.mjs} +2 -2
- package/node/esm/index.mjs +4 -4
- package/package.json +3 -3
- package/types/src/reader/domVisitors/CommentVisitor.d.ts +7 -2
- package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +4 -0
- package/types/src/reader/domVisitors/ThreadedCommentVisitor.d.ts +9 -0
- package/types/src/utils/VmlNoteShapes.d.ts +82 -22
- package/types/src/writer/emitters/CommentsEmitter.d.ts +9 -3
- package/types/src/writer/emitters/ThreadedCommentsEmitter.d.ts +7 -1
- package/browser/cjs/C8oC1tPbhgR0Dqtx.cjs +0 -2
- package/browser/cjs/CUhvQ38mNlw3YIEp.cjs +0 -5
- package/browser/cjs/sNZR19Wk-XQ2xZ9E.cjs +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.6
|
|
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 "./
|
|
8
|
-
import { $ as u, D as
|
|
9
|
-
import { BufferUtils as
|
|
10
|
-
import { AddressUtils as z, CommonUtils as
|
|
11
|
-
import { BlobReader as
|
|
12
|
-
var
|
|
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 "./D-l0hqYTXUIEFoTg.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 "./CHl-WFsto0oTmBtB.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 {
|
|
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 nt = /* @__PURE__ */ new Uint8Array(0), at = 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 ?
|
|
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();
|
|
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 nt = /* @__PURE__ */ new Uint8Array(0), at = 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
|
|
38
|
+
const i = await r.getData(new nt());
|
|
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
|
|
43
|
+
for (const [s, o] of this.entries) !this.buffers.has(s) && t(s, o) && e.push(o.getData(new nt()).then((t) => {
|
|
44
44
|
this.buffers.set(s, t);
|
|
45
45
|
}));
|
|
46
46
|
await Promise.all(e);
|
|
@@ -83,18 +83,18 @@ var nt = /* @__PURE__ */ new Uint8Array(0), at = class t {
|
|
|
83
83
|
async close() {
|
|
84
84
|
await this.zip.close();
|
|
85
85
|
}
|
|
86
|
-
},
|
|
86
|
+
}, ht = class {
|
|
87
87
|
constructor(t) {
|
|
88
|
-
this._sink = t, this._samples = [], this._t0 =
|
|
88
|
+
this._sink = t, this._samples = [], this._t0 = ut(), this._tPrev = this._t0, this._heapPrev = pt();
|
|
89
89
|
}
|
|
90
90
|
mark(t) {
|
|
91
|
-
const e =
|
|
91
|
+
const e = ut(), s = pt(), 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:
|
|
97
|
+
rssBytes: dt()
|
|
98
98
|
};
|
|
99
99
|
this._tPrev = e, this._heapPrev = s, this._samples.push(o), this._sink?.(o);
|
|
100
100
|
}
|
|
@@ -106,91 +106,91 @@ var nt = /* @__PURE__ */ new Uint8Array(0), at = 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 ?
|
|
110
|
-
dHeapMB: void 0 !== t.dHeapBytes ?
|
|
111
|
-
rssMB: void 0 !== t.rssBytes ?
|
|
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) : "—"
|
|
112
112
|
}));
|
|
113
113
|
}
|
|
114
|
-
},
|
|
115
|
-
function
|
|
114
|
+
}, ut = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now();
|
|
115
|
+
function pt() {
|
|
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
|
|
121
|
+
function dt() {
|
|
122
122
|
const t = globalThis.process;
|
|
123
123
|
if ("object" == typeof t && "function" == typeof t.memoryUsage) return t.memoryUsage().rss;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function ft(t) {
|
|
126
126
|
return Math.round(10 * t) / 10;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
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"), [
|
|
129
129
|
32,
|
|
130
130
|
10,
|
|
131
131
|
13,
|
|
132
132
|
9
|
|
133
133
|
]);
|
|
134
|
-
function
|
|
134
|
+
function yt(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
|
|
138
|
-
new RegExp(`^[${
|
|
139
|
-
var
|
|
140
|
-
function
|
|
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) {
|
|
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
|
|
143
|
+
var At = function(t) {
|
|
144
144
|
return 32 === t || 10 === t || 13 === t || 9 === t;
|
|
145
|
-
},
|
|
145
|
+
}, Ot = function(t) {
|
|
146
146
|
return t >= 32 && t <= 55295 || 10 === t || 13 === t || 9 === t || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
147
|
-
},
|
|
148
|
-
return
|
|
149
|
-
},
|
|
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) {
|
|
150
150
|
return t >= 1 && t <= 55295 || t >= 57344 && t <= 65533 || t >= 65536 && t <= 1114111;
|
|
151
|
-
},
|
|
152
|
-
return
|
|
153
|
-
},
|
|
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 = {
|
|
154
154
|
__proto__: null,
|
|
155
|
-
xml:
|
|
156
|
-
xmlns:
|
|
157
|
-
},
|
|
155
|
+
xml: $t,
|
|
156
|
+
xmlns: Rt
|
|
157
|
+
}, Bt = {
|
|
158
158
|
__proto__: null,
|
|
159
159
|
amp: "&",
|
|
160
160
|
gt: ">",
|
|
161
161
|
lt: "<",
|
|
162
162
|
quot: "\"",
|
|
163
163
|
apos: "'"
|
|
164
|
-
},
|
|
165
|
-
...
|
|
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,
|
|
166
166
|
91,
|
|
167
|
-
Xt
|
|
168
|
-
], Jt = [
|
|
169
|
-
...Kt,
|
|
170
|
-
Wt,
|
|
171
167
|
Ut
|
|
172
|
-
],
|
|
168
|
+
], Yt = [
|
|
169
|
+
...Zt,
|
|
173
170
|
zt,
|
|
171
|
+
Kt
|
|
172
|
+
], te = [
|
|
174
173
|
qt,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
174
|
+
Gt,
|
|
175
|
+
...It
|
|
176
|
+
], ee = [
|
|
177
|
+
...It,
|
|
178
|
+
Ut,
|
|
179
179
|
38,
|
|
180
|
-
|
|
180
|
+
zt
|
|
181
181
|
];
|
|
182
|
-
function
|
|
182
|
+
function se(t, e, s) {
|
|
183
183
|
switch (e) {
|
|
184
184
|
case "xml":
|
|
185
|
-
s !==
|
|
185
|
+
s !== $t && t.fail(`xml prefix must be bound to ${$t}.`);
|
|
186
186
|
break;
|
|
187
|
-
case "xmlns": s !==
|
|
187
|
+
case "xmlns": s !== Rt && t.fail(`xmlns prefix must be bound to ${Rt}.`);
|
|
188
188
|
}
|
|
189
189
|
switch (s) {
|
|
190
|
-
case
|
|
191
|
-
t.fail("" === e ? `the default namespace may not be set to ${s}.` : `may not assign a prefix (even "xmlns") to the URI ${
|
|
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}.`);
|
|
192
192
|
break;
|
|
193
|
-
case
|
|
193
|
+
case $t: 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 te(t, e, s) {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
var
|
|
202
|
+
var oe, re = (t) => Nt.test(t), ie = (t) => Dt.test(t), ne = {
|
|
203
203
|
xmldecl: "xmlDeclHandler",
|
|
204
204
|
text: "textHandler",
|
|
205
205
|
processinginstruction: "piHandler",
|
|
@@ -213,7 +213,7 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
213
213
|
error: "errorHandler",
|
|
214
214
|
end: "endHandler",
|
|
215
215
|
ready: "readyHandler"
|
|
216
|
-
},
|
|
216
|
+
}, ae = class {
|
|
217
217
|
get closed() {
|
|
218
218
|
return this._closed;
|
|
219
219
|
}
|
|
@@ -221,15 +221,15 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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 =
|
|
224
|
+
this.nameStartCheck = Vt, this.nameCheck = Lt, this.isName = re, this.processAttribs = this.processAttribsNS, this.pushAttrib = this.pushAttribNS, this.ns = {
|
|
225
225
|
__proto__: null,
|
|
226
|
-
|
|
226
|
+
...jt
|
|
227
227
|
};
|
|
228
228
|
const t = this.opt.additionalNamespaces;
|
|
229
229
|
null != t && (function(t, e) {
|
|
230
|
-
for (const s of Object.keys(e))
|
|
230
|
+
for (const s of Object.keys(e)) se(t, s, e[s]);
|
|
231
231
|
}(this, t), Object.assign(this.ns, t));
|
|
232
|
-
} else this.nameStartCheck =
|
|
232
|
+
} else this.nameStartCheck = Et, this.nameCheck = Pt, this.isName = ie, 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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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 ?
|
|
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;
|
|
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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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(
|
|
294
|
+
}, this.line = 1, this.column = 0, this.ENTITIES = Object.create(Bt), this.readyHandler?.();
|
|
295
295
|
}
|
|
296
296
|
get position() {
|
|
297
297
|
return this.chunkPosition + this.i;
|
|
@@ -300,10 +300,10 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
300
300
|
return this.position - this.positionAtNewLine;
|
|
301
301
|
}
|
|
302
302
|
on(t, e) {
|
|
303
|
-
this[
|
|
303
|
+
this[ne[t]] = e;
|
|
304
304
|
}
|
|
305
305
|
off(t) {
|
|
306
|
-
this[
|
|
306
|
+
this[ne[t]] = void 0;
|
|
307
307
|
}
|
|
308
308
|
makeError(t) {
|
|
309
309
|
let e = this.fileName ?? "";
|
|
@@ -330,13 +330,13 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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
|
|
333
|
+
if (this.prevI = e, this.i++, e >= t.length) return Mt;
|
|
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
|
|
339
|
-
case 13: return t.charCodeAt(e + 1) ===
|
|
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;
|
|
340
340
|
default: return this.fail("disallowed character."), s;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
@@ -346,18 +346,18 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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
|
|
349
|
+
if (this.prevI = e, this.i = e + 1, e >= t.length) return Mt;
|
|
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
|
|
354
|
+
case Xt: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Xt;
|
|
355
355
|
case 13: {
|
|
356
356
|
const s = t.charCodeAt(e + 1);
|
|
357
|
-
s !==
|
|
357
|
+
s !== Xt && 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,
|
|
360
|
+
case 8232: return this.line++, this.column = 0, this.positionAtNewLine = this.position, Ht;
|
|
361
361
|
default: return this.fail("disallowed character."), s;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
@@ -367,7 +367,7 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
367
367
|
}
|
|
368
368
|
getCodeNorm() {
|
|
369
369
|
const t = this.getCode();
|
|
370
|
-
return t ===
|
|
370
|
+
return t === Ht ? Xt : t;
|
|
371
371
|
}
|
|
372
372
|
unGet() {
|
|
373
373
|
this.i = this.prevI, this.column--;
|
|
@@ -376,8 +376,8 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
376
376
|
let { i: e } = this;
|
|
377
377
|
const { chunk: s } = this;
|
|
378
378
|
for (;;) {
|
|
379
|
-
const o = this.getCode(), r = o ===
|
|
380
|
-
if (i ===
|
|
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;
|
|
381
381
|
r && (this.text += `${s.slice(e, this.prevI)}\n`, e = this.i);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
@@ -387,10 +387,10 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
387
387
|
for (;;) {
|
|
388
388
|
let o = this.getCode();
|
|
389
389
|
switch (o) {
|
|
390
|
-
case
|
|
391
|
-
this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o =
|
|
390
|
+
case Ht:
|
|
391
|
+
this.text += `${s.slice(e, this.prevI)}\n`, e = this.i, o = Xt;
|
|
392
392
|
break;
|
|
393
|
-
case
|
|
393
|
+
case Mt: 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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
399
399
|
const { chunk: t, i: e } = this;
|
|
400
400
|
for (;;) {
|
|
401
401
|
const s = this.getCode();
|
|
402
|
-
if (s ===
|
|
403
|
-
if (!
|
|
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;
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
skipSpaces() {
|
|
407
407
|
for (;;) {
|
|
408
408
|
const t = this.getCodeNorm();
|
|
409
|
-
if (t ===
|
|
409
|
+
if (t === Mt || !At(t)) return t;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
setXMLVersion(t) {
|
|
413
|
-
this.currentXMLVersion = t, "1.0" === t ? (this.isChar =
|
|
413
|
+
this.currentXMLVersion = t, "1.0" === t ? (this.isChar = Ot, this.getCode = this.getCode10) : (this.isChar = _t, 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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
418
418
|
sBeginWhitespace() {
|
|
419
419
|
const t = this.i, e = this.skipSpaces();
|
|
420
420
|
switch (this.prevI !== t && (this.xmlDeclPossible = !1), e) {
|
|
421
|
-
case
|
|
421
|
+
case zt:
|
|
422
422
|
if (this.state = 15, 0 !== this.text.length) throw new Error("no-empty text at start");
|
|
423
423
|
break;
|
|
424
|
-
case
|
|
425
|
-
default: this.unGet(), this.state =
|
|
424
|
+
case Mt: break;
|
|
425
|
+
default: this.unGet(), this.state = Ft, this.xmlDeclPossible = !1;
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
sDoctype() {
|
|
429
|
-
const t = this.captureTo(
|
|
429
|
+
const t = this.captureTo(Qt);
|
|
430
430
|
switch (t) {
|
|
431
|
-
case
|
|
432
|
-
this.doctypeHandler?.(this.text), this.text = "", this.state =
|
|
431
|
+
case Ut:
|
|
432
|
+
this.doctypeHandler?.(this.text), this.text = "", this.state = Ft, this.doctype = !0;
|
|
433
433
|
break;
|
|
434
|
-
case
|
|
435
|
-
default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 :
|
|
434
|
+
case Mt: break;
|
|
435
|
+
default: this.text += String.fromCodePoint(t), 91 === t ? this.state = 4 : Jt(t) && (this.state = 3, this.q = t);
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
sDoctypeQuote() {
|
|
@@ -440,8 +440,8 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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(
|
|
444
|
-
t !==
|
|
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));
|
|
445
445
|
}
|
|
446
446
|
sDTDQuoted() {
|
|
447
447
|
const t = this.q;
|
|
@@ -453,7 +453,7 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
453
453
|
case 33:
|
|
454
454
|
this.state = 7, this.openWakaBang = "";
|
|
455
455
|
break;
|
|
456
|
-
case
|
|
456
|
+
case Gt:
|
|
457
457
|
this.state = 11;
|
|
458
458
|
break;
|
|
459
459
|
default: this.state = 4;
|
|
@@ -472,14 +472,14 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
472
472
|
}
|
|
473
473
|
sDTDCommentEnded() {
|
|
474
474
|
const t = this.getCodeNorm();
|
|
475
|
-
this.text += String.fromCodePoint(t), t ===
|
|
475
|
+
this.text += String.fromCodePoint(t), t === Ut ? this.state = 4 : (this.fail("malformed comment."), this.state = 8);
|
|
476
476
|
}
|
|
477
477
|
sDTDPI() {
|
|
478
|
-
this.captureToChar(
|
|
478
|
+
this.captureToChar(Gt) && (this.text += "?", this.state = 12);
|
|
479
479
|
}
|
|
480
480
|
sDTDPIEnding() {
|
|
481
481
|
const t = this.getCodeNorm();
|
|
482
|
-
this.text += String.fromCodePoint(t), t ===
|
|
482
|
+
this.text += String.fromCodePoint(t), t === Ut && (this.state = 4);
|
|
483
483
|
}
|
|
484
484
|
sText() {
|
|
485
485
|
0 !== this.tags.length ? this.handleTextInRoot() : this.handleTextOutsideRoot();
|
|
@@ -488,23 +488,23 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
488
488
|
let { i: t } = this;
|
|
489
489
|
const { chunk: e } = this;
|
|
490
490
|
t: for (;;) switch (this.getCode()) {
|
|
491
|
-
case
|
|
491
|
+
case Ht:
|
|
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 ===
|
|
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);
|
|
498
498
|
break t;
|
|
499
499
|
}
|
|
500
|
-
case
|
|
500
|
+
case Mt:
|
|
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 (
|
|
507
|
+
if (Et(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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
512
512
|
case 33:
|
|
513
513
|
this.state = 16, this.openWakaBang = "", this.xmlDeclPossible = !1;
|
|
514
514
|
break;
|
|
515
|
-
case
|
|
515
|
+
case Gt:
|
|
516
516
|
this.state = 23;
|
|
517
517
|
break;
|
|
518
|
-
default: this.fail("disallowed character in tag name"), this.state =
|
|
518
|
+
default: this.fail("disallowed character in tag name"), this.state = Ft, this.xmlDeclPossible = !1;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
sOpenWakaBang() {
|
|
@@ -541,22 +541,22 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
541
541
|
}
|
|
542
542
|
sCommentEnded() {
|
|
543
543
|
const t = this.getCodeNorm();
|
|
544
|
-
t !==
|
|
544
|
+
t !== Ut ? (this.fail("malformed comment."), this.text += `--${String.fromCodePoint(t)}`, this.state = 17) : this.state = Ft;
|
|
545
545
|
}
|
|
546
546
|
sCData() {
|
|
547
|
-
this.captureToChar(
|
|
547
|
+
this.captureToChar(Kt) && (this.state = 21);
|
|
548
548
|
}
|
|
549
549
|
sCDataEnding() {
|
|
550
550
|
const t = this.getCodeNorm();
|
|
551
|
-
t ===
|
|
551
|
+
t === Kt ? 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 Xt:
|
|
557
|
-
this.cdataHandler?.(this.text), this.text = "", this.state = Bt;
|
|
558
|
-
break;
|
|
559
556
|
case Ut:
|
|
557
|
+
this.cdataHandler?.(this.text), this.text = "", this.state = Ft;
|
|
558
|
+
break;
|
|
559
|
+
case Kt:
|
|
560
560
|
this.text += "]";
|
|
561
561
|
break;
|
|
562
562
|
default: this.text += `]]${String.fromCodePoint(t)}`, this.state = 20;
|
|
@@ -564,17 +564,17 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
564
564
|
}
|
|
565
565
|
sPIFirstChar() {
|
|
566
566
|
const t = this.getCodeNorm();
|
|
567
|
-
this.nameStartCheck(t) ? (this.piTarget += String.fromCodePoint(t), this.state = 24) : t ===
|
|
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);
|
|
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 ===
|
|
573
|
+
if (s === Mt) 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 ===
|
|
577
|
-
o ||
|
|
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));
|
|
578
578
|
break;
|
|
579
579
|
}
|
|
580
580
|
}
|
|
@@ -582,28 +582,28 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
582
582
|
sPIBody() {
|
|
583
583
|
if (0 === this.text.length) {
|
|
584
584
|
const t = this.getCodeNorm();
|
|
585
|
-
t ===
|
|
586
|
-
} else this.captureToChar(
|
|
585
|
+
t === Gt ? this.state = 26 : At(t) || (this.text = String.fromCodePoint(t));
|
|
586
|
+
} else this.captureToChar(Gt) && (this.state = 26);
|
|
587
587
|
}
|
|
588
588
|
sPIEnding() {
|
|
589
589
|
const t = this.getCodeNorm();
|
|
590
|
-
if (t ===
|
|
590
|
+
if (t === Ut) {
|
|
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 =
|
|
596
|
-
} else t ===
|
|
595
|
+
}), this.piTarget = this.text = "", this.state = Ft;
|
|
596
|
+
} else t === Gt ? 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 !==
|
|
601
|
+
t !== Gt ? t !== Mt && (this.state = 28, this.name = String.fromCodePoint(t)) : this.state = Wt;
|
|
602
602
|
}
|
|
603
603
|
sXMLDeclName() {
|
|
604
|
-
const t = this.captureTo(
|
|
605
|
-
if (t ===
|
|
606
|
-
if (
|
|
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) {
|
|
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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
613
613
|
break;
|
|
614
614
|
default: this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`);
|
|
615
615
|
}
|
|
616
|
-
this.state = t ===
|
|
616
|
+
this.state = t === qt ? 30 : 29;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
619
|
sXMLDeclEq() {
|
|
620
620
|
const t = this.getCodeNorm();
|
|
621
|
-
if (t ===
|
|
622
|
-
|
|
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);
|
|
623
623
|
}
|
|
624
624
|
sXMLDeclValueStart() {
|
|
625
625
|
const t = this.getCodeNorm();
|
|
626
|
-
if (t ===
|
|
627
|
-
|
|
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);
|
|
628
628
|
}
|
|
629
629
|
sXMLDeclValue() {
|
|
630
|
-
const t = this.captureTo([this.q,
|
|
631
|
-
if (t ===
|
|
632
|
-
if (t ===
|
|
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;
|
|
633
633
|
const e = this.text;
|
|
634
634
|
switch (this.text = "", this.name) {
|
|
635
635
|
case "version": {
|
|
@@ -647,52 +647,52 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
647
647
|
}
|
|
648
648
|
sXMLDeclSeparator() {
|
|
649
649
|
const t = this.getCodeNorm();
|
|
650
|
-
t !==
|
|
650
|
+
t !== Gt ? (At(t) || (this.fail("whitespace required."), this.unGet()), this.state = 27) : this.state = Wt;
|
|
651
651
|
}
|
|
652
652
|
sXMLDeclEnding() {
|
|
653
|
-
this.getCodeNorm() ===
|
|
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;
|
|
654
654
|
}
|
|
655
655
|
sOpenTag() {
|
|
656
656
|
const t = this.captureNameChars();
|
|
657
|
-
if (t ===
|
|
657
|
+
if (t === Mt) 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
|
|
663
|
+
case Ut:
|
|
664
664
|
this.openTag();
|
|
665
665
|
break;
|
|
666
666
|
case 47:
|
|
667
667
|
this.state = 35;
|
|
668
668
|
break;
|
|
669
|
-
default:
|
|
669
|
+
default: At(t) || this.fail("disallowed character in tag name."), this.state = 36;
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
sOpenTagSlash() {
|
|
673
|
-
this.getCode() ===
|
|
673
|
+
this.getCode() === Ut ? 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 !==
|
|
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."));
|
|
678
678
|
}
|
|
679
679
|
sAttribName() {
|
|
680
680
|
const t = this.captureNameChars();
|
|
681
|
-
t ===
|
|
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.");
|
|
682
682
|
}
|
|
683
683
|
sAttribNameSawWhite() {
|
|
684
684
|
const t = this.skipSpaces();
|
|
685
685
|
switch (t) {
|
|
686
|
-
case
|
|
687
|
-
case
|
|
686
|
+
case Mt: return;
|
|
687
|
+
case qt:
|
|
688
688
|
this.state = 39;
|
|
689
689
|
break;
|
|
690
|
-
default: this.fail("attribute without value."), this.text = "", this.name = "", t ===
|
|
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);
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
sAttribValue() {
|
|
694
694
|
const t = this.getCodeNorm();
|
|
695
|
-
|
|
695
|
+
Jt(t) ? (this.q = t, this.state = 40) : At(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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
704
704
|
case 38:
|
|
705
705
|
this.text += e.slice(s, this.prevI), this.state = 14, this.entityReturnState = 40;
|
|
706
706
|
return;
|
|
707
|
-
case
|
|
708
|
-
case
|
|
707
|
+
case Xt:
|
|
708
|
+
case Ht:
|
|
709
709
|
case 9:
|
|
710
710
|
this.text += `${e.slice(s, this.prevI)} `, s = this.i;
|
|
711
711
|
break;
|
|
712
|
-
case
|
|
712
|
+
case zt:
|
|
713
713
|
this.text += e.slice(s, this.prevI), this.fail("disallowed character.");
|
|
714
714
|
return;
|
|
715
|
-
case
|
|
715
|
+
case Mt:
|
|
716
716
|
this.text += e.slice(s);
|
|
717
717
|
return;
|
|
718
718
|
}
|
|
719
719
|
}
|
|
720
720
|
sAttribValueClosed() {
|
|
721
721
|
const t = this.getCodeNorm();
|
|
722
|
-
|
|
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.");
|
|
723
723
|
}
|
|
724
724
|
sAttribValueUnquoted() {
|
|
725
|
-
const t = this.captureTo(
|
|
725
|
+
const t = this.captureTo(ee);
|
|
726
726
|
switch (t) {
|
|
727
727
|
case 38:
|
|
728
728
|
this.state = 14, this.entityReturnState = 42;
|
|
729
729
|
break;
|
|
730
|
-
case
|
|
730
|
+
case zt:
|
|
731
731
|
this.fail("disallowed character.");
|
|
732
732
|
break;
|
|
733
|
-
case
|
|
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 ===
|
|
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;
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
737
|
sCloseTag() {
|
|
738
738
|
const t = this.captureNameChars();
|
|
739
|
-
t ===
|
|
739
|
+
t === Ut ? this.closeTag() : At(t) ? this.state = 44 : t !== Mt && this.fail("disallowed character in closing tag.");
|
|
740
740
|
}
|
|
741
741
|
sCloseTagSawWhite() {
|
|
742
742
|
switch (this.skipSpaces()) {
|
|
743
|
-
case
|
|
743
|
+
case Ut:
|
|
744
744
|
this.closeTag();
|
|
745
745
|
break;
|
|
746
|
-
case
|
|
746
|
+
case Mt: break;
|
|
747
747
|
default: this.fail("disallowed character in closing tag.");
|
|
748
748
|
}
|
|
749
749
|
}
|
|
@@ -751,7 +751,7 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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
|
|
754
|
+
case zt:
|
|
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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
759
759
|
e = 0;
|
|
760
760
|
break t;
|
|
761
761
|
case 38:
|
|
762
|
-
this.state = 14, this.entityReturnState =
|
|
762
|
+
this.state = 14, this.entityReturnState = Ft, void 0 !== o && (this.text += s.slice(t, this.prevI)), e = 0;
|
|
763
763
|
break t;
|
|
764
|
-
case
|
|
764
|
+
case Kt:
|
|
765
765
|
switch (e) {
|
|
766
766
|
case 0:
|
|
767
767
|
e = 1;
|
|
@@ -773,13 +773,13 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
773
773
|
default: throw new Error("impossible state");
|
|
774
774
|
}
|
|
775
775
|
break;
|
|
776
|
-
case
|
|
776
|
+
case Ut:
|
|
777
777
|
2 === e && this.fail("the string \"]]>\" is disallowed in char data."), e = 0;
|
|
778
778
|
break;
|
|
779
|
-
case
|
|
779
|
+
case Ht:
|
|
780
780
|
void 0 !== o && (this.text += `${s.slice(t, this.prevI)}\n`), t = this.i, e = 0;
|
|
781
781
|
break;
|
|
782
|
-
case
|
|
782
|
+
case Mt:
|
|
783
783
|
void 0 !== o && (this.text += s.slice(t));
|
|
784
784
|
break t;
|
|
785
785
|
default: e = 0;
|
|
@@ -793,22 +793,22 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
793
793
|
t: for (;;) {
|
|
794
794
|
const r = this.getCode();
|
|
795
795
|
switch (r) {
|
|
796
|
-
case
|
|
796
|
+
case zt:
|
|
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 =
|
|
803
|
+
this.state = 14, this.entityReturnState = Ft, void 0 !== s && (this.text += e.slice(t, this.prevI)), o = !0;
|
|
804
804
|
break t;
|
|
805
|
-
case
|
|
805
|
+
case Ht:
|
|
806
806
|
void 0 !== s && (this.text += `${e.slice(t, this.prevI)}\n`), t = this.i;
|
|
807
807
|
break;
|
|
808
|
-
case
|
|
808
|
+
case Mt:
|
|
809
809
|
void 0 !== s && (this.text += e.slice(t));
|
|
810
810
|
break t;
|
|
811
|
-
default:
|
|
811
|
+
default: At(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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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,
|
|
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);
|
|
826
826
|
} else if ("xmlns" === t) {
|
|
827
827
|
const t = e.trim();
|
|
828
|
-
this.topNS[""] = t,
|
|
828
|
+
this.topNS[""] = t, se(this, "", t);
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
831
|
pushAttribPlain(t, e) {
|
|
@@ -842,7 +842,7 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
842
842
|
const e = t.pop();
|
|
843
843
|
this.fail(`unclosed tag: ${e.name}`);
|
|
844
844
|
}
|
|
845
|
-
0 !== this.state && this.state !==
|
|
845
|
+
0 !== this.state && this.state !== Ft && 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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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 ?
|
|
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;
|
|
882
882
|
}
|
|
883
883
|
this.attribList = [];
|
|
884
884
|
}
|
|
@@ -890,16 +890,16 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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 =
|
|
893
|
+
e.isSelfClosing = !1, this.openTagHandler?.(e), t.push(e), this.state = Ft, 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 =
|
|
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 = "";
|
|
899
899
|
}
|
|
900
900
|
closeTag() {
|
|
901
901
|
const { tags: t, name: e } = this;
|
|
902
|
-
if (this.state =
|
|
902
|
+
if (this.state = Ft, 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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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
|
-
},
|
|
920
|
+
}, ce = /&(#x[0-9a-fA-F]+|#[0-9]+|amp|lt|gt|quot|apos);/g, le = {
|
|
921
921
|
amp: "&",
|
|
922
922
|
lt: "<",
|
|
923
923
|
gt: ">",
|
|
924
924
|
quot: "\"",
|
|
925
925
|
apos: "'"
|
|
926
|
-
},
|
|
927
|
-
const s =
|
|
926
|
+
}, he = (t, e) => {
|
|
927
|
+
const s = le[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
|
-
},
|
|
931
|
+
}, ue = (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(
|
|
934
|
-
},
|
|
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) => {
|
|
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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
941
941
|
break;
|
|
942
942
|
}
|
|
943
943
|
}
|
|
944
|
-
return -1 !== e.indexOf("&") && (e = e.replace(
|
|
945
|
-
},
|
|
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 {
|
|
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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
953
953
|
this.NOT_HANDLED = -2;
|
|
954
954
|
}
|
|
955
955
|
static decodeText(t) {
|
|
956
|
-
return
|
|
956
|
+
return ue(t);
|
|
957
957
|
}
|
|
958
958
|
on(t, e) {
|
|
959
959
|
switch (t) {
|
|
@@ -1020,7 +1020,7 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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(
|
|
1023
|
+
void 0 !== e && 0 !== this._tags.length && e(ue(t));
|
|
1024
1024
|
}
|
|
1025
1025
|
_markup(e, s, o) {
|
|
1026
1026
|
if (s + 1 >= o) return -1;
|
|
@@ -1059,7 +1059,7 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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 ||
|
|
1062
|
+
if (62 === i || 47 === i || de(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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
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 && !
|
|
1080
|
+
for (; o < s && (r = t.charCodeAt(o), 62 !== r && 47 !== r && !de(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 &&
|
|
1085
|
+
for (; o < s && de(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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
1098
1098
|
break;
|
|
1099
1099
|
}
|
|
1100
1100
|
const e = o;
|
|
1101
|
-
for (; o < s && (r = t.charCodeAt(o), 61 !== r && 62 !== r && 47 !== r && !
|
|
1101
|
+
for (; o < s && (r = t.charCodeAt(o), 61 !== r && 62 !== r && 47 !== r && !de(r));) o++;
|
|
1102
1102
|
if (o >= s) return -1;
|
|
1103
1103
|
const i = t.slice(e, o);
|
|
1104
|
-
for (; o < s &&
|
|
1104
|
+
for (; o < s && de(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 &&
|
|
1110
|
+
for (o++; o < s && de(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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
const c = t.indexOf(34 === r ? "\"" : "'", o + 1);
|
|
1117
1117
|
if (-1 === c) return -1;
|
|
1118
|
-
"__proto__" !== i && (n[i] =
|
|
1118
|
+
"__proto__" !== i && (n[i] = pe(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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
1155
1155
|
};
|
|
1156
1156
|
t.parseStream = async (t, e, s) => {
|
|
1157
1157
|
if (s?.lean) return (async (t, e) => {
|
|
1158
|
-
const s = new
|
|
1158
|
+
const s = new fe();
|
|
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 ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
1168
1168
|
}
|
|
1169
1169
|
return s.close(), o;
|
|
1170
1170
|
})(t, e);
|
|
1171
|
-
const o = new
|
|
1171
|
+
const o = new ae({
|
|
1172
1172
|
position: !1,
|
|
1173
1173
|
...s
|
|
1174
1174
|
});
|
|
1175
1175
|
let r;
|
|
1176
|
-
e.onOpenTagStart && o.on(
|
|
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);
|
|
1177
1177
|
const i = e.onEnd;
|
|
1178
1178
|
if (i) {
|
|
1179
1179
|
const t = () => {
|
|
1180
1180
|
r = i();
|
|
1181
1181
|
};
|
|
1182
|
-
o.on(
|
|
1182
|
+
o.on(oe.Events.End, t);
|
|
1183
1183
|
}
|
|
1184
1184
|
for (;;) {
|
|
1185
1185
|
const { value: e, done: s } = await t.read();
|
|
@@ -1188,14 +1188,14 @@ var ee, se = (t) => Vt.test(t), oe = (t) => Pt.test(t), re = {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
return o.close(), r;
|
|
1190
1190
|
};
|
|
1191
|
-
})(
|
|
1192
|
-
var
|
|
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) => {
|
|
1193
1193
|
const e = parseInt(t);
|
|
1194
1194
|
return isNaN(e) ? null : e;
|
|
1195
|
-
},
|
|
1195
|
+
}, xe = (t) => {
|
|
1196
1196
|
const e = parseFloat(t);
|
|
1197
1197
|
return isNaN(e) ? null : e;
|
|
1198
|
-
},
|
|
1198
|
+
}, be = null, ye = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), Te = (t) => ye(t).replace(/"/g, """), ve = class {
|
|
1199
1199
|
constructor() {
|
|
1200
1200
|
this._registeredVisitors = /* @__PURE__ */ new Map();
|
|
1201
1201
|
}
|
|
@@ -1224,7 +1224,7 @@ var de = (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
|
-
},
|
|
1227
|
+
}, b = {
|
|
1228
1228
|
getSource: () => p?.source ?? null,
|
|
1229
1229
|
setSource: (t) => {
|
|
1230
1230
|
p.source = t;
|
|
@@ -1234,7 +1234,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1234
1234
|
},
|
|
1235
1235
|
getFrom: () => c,
|
|
1236
1236
|
getAttribute: (t, e) => x(t, e) ?? null,
|
|
1237
|
-
hasAttribute: (t) => null !==
|
|
1237
|
+
hasAttribute: (t) => null !== b.getAttribute(t),
|
|
1238
1238
|
getParent: () => {
|
|
1239
1239
|
const t = h[h.length - 2];
|
|
1240
1240
|
return t.parent ?? t.source;
|
|
@@ -1267,7 +1267,7 @@ var de = (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}="${
|
|
1270
|
+
s += ` ${t}="${Te("string" == typeof o ? o : o?.value ?? "")}"`;
|
|
1271
1271
|
}
|
|
1272
1272
|
return s + ">";
|
|
1273
1273
|
})(t)), n = {
|
|
@@ -1285,7 +1285,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== 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(
|
|
1288
|
+
const t = m.scope(b);
|
|
1289
1289
|
null === t ? x = !0 : t && (r.push(t), n.pushedScope = !0);
|
|
1290
1290
|
}
|
|
1291
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 = {
|
|
@@ -1293,8 +1293,8 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1293
1293
|
source: {},
|
|
1294
1294
|
parent: null
|
|
1295
1295
|
}, n.destination = p, n.pushedDestination = !0, h.push(p))), i.push(n), d = x;
|
|
1296
|
-
const
|
|
1297
|
-
void 0 !==
|
|
1296
|
+
const y = l?.openTag?.(b);
|
|
1297
|
+
void 0 !== y && (p.parent = y), m?.raw && !x && (f = [], g = n);
|
|
1298
1298
|
},
|
|
1299
1299
|
onCloseTag: (t) => {
|
|
1300
1300
|
let e = t.name;
|
|
@@ -1305,24 +1305,24 @@ var de = (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?.(
|
|
1309
|
-
const
|
|
1310
|
-
n = i[i.length - 1] ?? null,
|
|
1311
|
-
const T =
|
|
1312
|
-
if (T &&
|
|
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
1313
|
h.pop(), p = h[h.length - 1] ?? u;
|
|
1314
|
-
const t =
|
|
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 ${
|
|
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
1316
|
} else T || (p = h[h.length - 1] ?? u);
|
|
1317
1317
|
a = n?.local ?? null, c = n?.tag ?? null, l = n?.visitor ?? null, d = !n?.destination;
|
|
1318
1318
|
},
|
|
1319
1319
|
onText: (t) => {
|
|
1320
|
-
f ? f.push(
|
|
1320
|
+
f ? f.push(ye(t)) : l?.text?.(t, b);
|
|
1321
1321
|
},
|
|
1322
1322
|
onEnd: e
|
|
1323
1323
|
};
|
|
1324
1324
|
}
|
|
1325
|
-
},
|
|
1325
|
+
}, we = `IFERROR(${d}(`, Se = we.toUpperCase(), Ce = f.toUpperCase(), ke = { kind: "none" }, Ae = { kind: "spilled" }, Oe = (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 de = (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
|
-
},
|
|
1336
|
+
}, Ee = (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 =
|
|
1342
|
+
const e = Oe(t, s);
|
|
1343
1343
|
if (null === e) break;
|
|
1344
1344
|
s = e.end;
|
|
1345
1345
|
continue;
|
|
@@ -1357,7 +1357,7 @@ var de = (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
|
-
},
|
|
1360
|
+
}, Pe = (t) => {
|
|
1361
1361
|
const e = (e) => {
|
|
1362
1362
|
if (t) return new RegExp(`<(?:[\\w.-]+:)?${e}\\b[^>]*>([^<]*)<`).exec(t)?.[1];
|
|
1363
1363
|
}, s = (t) => {
|
|
@@ -1370,9 +1370,9 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1370
1370
|
x: c(e("colOff") ?? "0") ?? 0,
|
|
1371
1371
|
y: c(e("rowOff") ?? "0") ?? 0
|
|
1372
1372
|
};
|
|
1373
|
-
},
|
|
1374
|
-
const h = new
|
|
1375
|
-
let
|
|
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
1376
|
h.registerVisitor({
|
|
1377
1377
|
from: "autoFilter",
|
|
1378
1378
|
to: "autoTable",
|
|
@@ -1398,7 +1398,7 @@ var de = (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",
|
|
1401
|
+
}, r = t.getAttribute("pivot", ge);
|
|
1402
1402
|
null !== r && (o.pivot = r), t.setSource(o);
|
|
1403
1403
|
}
|
|
1404
1404
|
}), h.registerVisitor({
|
|
@@ -1412,20 +1412,20 @@ var de = (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",
|
|
1416
|
-
const o = t.getAttribute("dxfId",
|
|
1415
|
+
}), t.copyToObject(s, "type", be), t.copyToObject(s, "priority", me), t.copyToObject(s, "stopIfTrue", ge);
|
|
1416
|
+
const o = t.getAttribute("dxfId", me);
|
|
1417
1417
|
if (null !== o) {
|
|
1418
1418
|
let e = r?.get(o);
|
|
1419
1419
|
e || (n?.(`Unable to load conditional color. Invalid dxfI: '${o}' at '${t.getPath()}'.`), e = {}), s.style = e;
|
|
1420
1420
|
}
|
|
1421
|
-
t.copyToObject(s, "aboveAverage",
|
|
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);
|
|
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 =
|
|
1428
|
+
const r = {}, i = P(o, n);
|
|
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
|
});
|
|
@@ -1445,7 +1445,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1445
1445
|
const e = t.getSource(), s = e.colors ?? [], o = T(e);
|
|
1446
1446
|
for (let t = 0; t < o.length; t++) o[t].color = s[t];
|
|
1447
1447
|
t.getParent().scale = {
|
|
1448
|
-
type:
|
|
1448
|
+
type: J.ScaleType.ColorScale,
|
|
1449
1449
|
stops: o
|
|
1450
1450
|
};
|
|
1451
1451
|
}
|
|
@@ -1453,11 +1453,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1453
1453
|
from: "dataBar",
|
|
1454
1454
|
to: {},
|
|
1455
1455
|
openTag: (t) => {
|
|
1456
|
-
t.copyTo("maxLength",
|
|
1456
|
+
t.copyTo("maxLength", me), t.copyTo("minLength", me), t.copyTo("showValue", ge);
|
|
1457
1457
|
},
|
|
1458
1458
|
closeTag: (t) => {
|
|
1459
1459
|
const e = t.getSource(), s = {
|
|
1460
|
-
type:
|
|
1460
|
+
type: J.ScaleType.DataBar,
|
|
1461
1461
|
stops: T(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;
|
|
@@ -1466,11 +1466,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1466
1466
|
from: "iconSet",
|
|
1467
1467
|
to: {},
|
|
1468
1468
|
openTag: (t) => {
|
|
1469
|
-
t.copyTo("iconSet",
|
|
1469
|
+
t.copyTo("iconSet", be), t.copyTo("reverse", ge), t.copyTo("showValue", ge);
|
|
1470
1470
|
},
|
|
1471
1471
|
closeTag: (t) => {
|
|
1472
1472
|
const e = t.getSource(), s = {
|
|
1473
|
-
type:
|
|
1473
|
+
type: J.ScaleType.IconSet,
|
|
1474
1474
|
stops: T(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;
|
|
@@ -1481,7 +1481,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
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(
|
|
1484
|
+
o || (o = [], s.formulas = o), o.push(f(t));
|
|
1485
1485
|
}
|
|
1486
1486
|
}), h.registerVisitor({
|
|
1487
1487
|
from: "cfvo",
|
|
@@ -1490,11 +1490,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== 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",
|
|
1493
|
+
if (e.conditions.push(s), t.copyTo("type", be), s.type === J.ColorStopType.Formula) {
|
|
1494
1494
|
const e = t.getAttribute("val");
|
|
1495
|
-
null != e && (s.value =
|
|
1496
|
-
} else t.copyTo("value",
|
|
1497
|
-
!1 === t.getAttribute("gte",
|
|
1495
|
+
null != e && (s.value = f(String(e)));
|
|
1496
|
+
} else t.copyTo("value", xe, "val");
|
|
1497
|
+
!1 === t.getAttribute("gte", ge) && (s.exclusive = !0);
|
|
1498
1498
|
}
|
|
1499
1499
|
}), h.registerVisitor({
|
|
1500
1500
|
from: "color",
|
|
@@ -1514,11 +1514,11 @@ var de = (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",
|
|
1517
|
+
if (i || (i = [], r.conditions = i), i.push(o), t.getAttribute("hiddenButton", ge) && e) {
|
|
1518
1518
|
let t = e.hiddenButtons;
|
|
1519
1519
|
t || (t = [], e.hiddenButtons = t), t.push(s);
|
|
1520
1520
|
}
|
|
1521
|
-
if (t.getAttribute("showButton",
|
|
1521
|
+
if (t.getAttribute("showButton", ge) && e) {
|
|
1522
1522
|
let t = e.showButtons;
|
|
1523
1523
|
t || (t = [], e.showButtons = t), t.push(s);
|
|
1524
1524
|
}
|
|
@@ -1528,41 +1528,41 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1528
1528
|
from: "colorFilter",
|
|
1529
1529
|
openTag: (t) => {
|
|
1530
1530
|
const e = t.getParent(), s = {};
|
|
1531
|
-
e.operator =
|
|
1531
|
+
e.operator = K.BuiltInOperatorNames.Color, e.param = s, t.copyToObject(s, "cellColor"), t.copyToObject(s, "styleId", me, "dxfId");
|
|
1532
1532
|
}
|
|
1533
1533
|
}), h.registerVisitor({
|
|
1534
1534
|
from: "iconFilter",
|
|
1535
1535
|
openTag: (t) => {
|
|
1536
1536
|
const e = t.getParent(), s = {};
|
|
1537
|
-
e.operator =
|
|
1537
|
+
e.operator = K.BuiltInOperatorNames.Icon, e.param = s, t.copyToObject(s, "iconId", me), t.copyToObject(s, "iconSet", be);
|
|
1538
1538
|
}
|
|
1539
1539
|
}), h.registerVisitor({
|
|
1540
1540
|
from: "top10",
|
|
1541
1541
|
openTag: (t) => {
|
|
1542
1542
|
const e = t.getParent(), s = {};
|
|
1543
|
-
e.operator =
|
|
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");
|
|
1544
1544
|
}
|
|
1545
1545
|
}), h.registerVisitor({
|
|
1546
1546
|
from: "dynamicFilter",
|
|
1547
1547
|
openTag: (t) => {
|
|
1548
1548
|
const e = t.getParent(), s = {};
|
|
1549
|
-
e.operator =
|
|
1549
|
+
e.operator = K.BuiltInOperatorNames.TimePeriod, e.param = s;
|
|
1550
1550
|
let o = t.getAttribute("type");
|
|
1551
|
-
Object.values(
|
|
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");
|
|
1552
1552
|
}
|
|
1553
1553
|
}), h.registerVisitor({
|
|
1554
1554
|
from: "filters",
|
|
1555
1555
|
to: {},
|
|
1556
1556
|
openTag: (t) => {
|
|
1557
1557
|
const e = t.getParent(), s = {};
|
|
1558
|
-
return e.operator =
|
|
1558
|
+
return e.operator = K.BuiltInOperatorNames.InSet, e.param = s, t.copyToObject(s, "blank", ge), t.copyToObject(s, "calendarType", be), s;
|
|
1559
1559
|
}
|
|
1560
1560
|
}), h.registerVisitor({
|
|
1561
1561
|
from: "filter",
|
|
1562
1562
|
openTag: (t) => {
|
|
1563
1563
|
const e = t.getParent();
|
|
1564
1564
|
let s = e.items;
|
|
1565
|
-
s || (s = [], e.items = s), s.push(t.getAttribute("val",
|
|
1565
|
+
s || (s = [], e.items = s), s.push(t.getAttribute("val", be));
|
|
1566
1566
|
}
|
|
1567
1567
|
}), h.registerVisitor({
|
|
1568
1568
|
from: "dateGroupItem",
|
|
@@ -1570,13 +1570,13 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1570
1570
|
openTag: (t) => {
|
|
1571
1571
|
const e = t.getParent();
|
|
1572
1572
|
let s = e.dateGroups;
|
|
1573
|
-
s || (s = [], e.dateGroups = s), s.push(t.getSource()), t.copyTo("group",
|
|
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);
|
|
1574
1574
|
}
|
|
1575
1575
|
}), h.registerVisitor({
|
|
1576
1576
|
from: "customFilters",
|
|
1577
1577
|
openTag: (t) => {
|
|
1578
1578
|
const e = t.getParent(), s = t.getAttribute("and"), o = "and" === s || "1" === s, r = [];
|
|
1579
|
-
return e.operator = o ?
|
|
1579
|
+
return e.operator = o ? K.BuiltInOperatorNames.And : K.BuiltInOperatorNames.Or, e.param = r, t.setSource(e), r;
|
|
1580
1580
|
},
|
|
1581
1581
|
closeTag: (t) => {
|
|
1582
1582
|
const e = t.getSource(), s = e?.param;
|
|
@@ -1590,7 +1590,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1590
1590
|
const e = t.getParent();
|
|
1591
1591
|
let s;
|
|
1592
1592
|
Array.isArray(e) ? (s = {}, e.push(s)) : s = e;
|
|
1593
|
-
const o =
|
|
1593
|
+
const o = _({
|
|
1594
1594
|
operator: t.getAttribute("operator"),
|
|
1595
1595
|
val: t.getAttribute("val")
|
|
1596
1596
|
});
|
|
@@ -1617,11 +1617,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1617
1617
|
const i = t.getAttribute("ref");
|
|
1618
1618
|
let n = 0;
|
|
1619
1619
|
if (i) {
|
|
1620
|
-
const t = z.fastStringToRange(i,
|
|
1620
|
+
const t = z.fastStringToRange(i, Le).colStart, s = e.r, o = s.colStart;
|
|
1621
1621
|
n = s ? t - o : t;
|
|
1622
1622
|
}
|
|
1623
1623
|
const a = {};
|
|
1624
|
-
t.copyToObject(a, "sortOn",
|
|
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;
|
|
1625
1625
|
const c = {
|
|
1626
1626
|
index: n,
|
|
1627
1627
|
criteria: a
|
|
@@ -1630,9 +1630,9 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1630
1630
|
}
|
|
1631
1631
|
});
|
|
1632
1632
|
const v = (e) => {
|
|
1633
|
-
|
|
1633
|
+
y = e.getSource(), e.copyTo("topLeft", be, "topLeftCell");
|
|
1634
1634
|
const s = t(e.getAttribute("defaultGridColor")), o = e.getAttribute("colorId");
|
|
1635
|
-
null === o || s || (e.getSource().gridLineColor = "index" + parseFloat(o)), e.copyTo("showZeros",
|
|
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);
|
|
1636
1636
|
};
|
|
1637
1637
|
h.registerVisitor({
|
|
1638
1638
|
from: "sheetView",
|
|
@@ -1641,7 +1641,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1641
1641
|
v(t);
|
|
1642
1642
|
},
|
|
1643
1643
|
closeTag: () => {
|
|
1644
|
-
|
|
1644
|
+
y = null;
|
|
1645
1645
|
}
|
|
1646
1646
|
}), h.registerVisitor({
|
|
1647
1647
|
from: "customSheetViews",
|
|
@@ -1656,14 +1656,14 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1656
1656
|
v(t);
|
|
1657
1657
|
},
|
|
1658
1658
|
closeTag: () => {
|
|
1659
|
-
|
|
1659
|
+
y = null;
|
|
1660
1660
|
}
|
|
1661
1661
|
}), h.registerVisitor({
|
|
1662
1662
|
from: "selection",
|
|
1663
1663
|
to: "selection",
|
|
1664
1664
|
openTag: (t) => {
|
|
1665
|
-
if (!
|
|
1666
|
-
t.copyTo("cell",
|
|
1665
|
+
if (!y) return;
|
|
1666
|
+
t.copyTo("cell", be, "activeCell"), t.copyTo("rangeIndex", me, "activeCellId");
|
|
1667
1667
|
const e = t.getAttribute("activeCell"), s = t.getAttribute("sqref");
|
|
1668
1668
|
if (s && s !== e) t.getSource().ranges = s.trim().split(/\s+/);
|
|
1669
1669
|
}
|
|
@@ -1671,18 +1671,18 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1671
1671
|
from: "pane",
|
|
1672
1672
|
to: null,
|
|
1673
1673
|
openTag: (t) => {
|
|
1674
|
-
if (!
|
|
1674
|
+
if (!y) return;
|
|
1675
1675
|
if ("frozen" === t.getAttribute("state")) {
|
|
1676
1676
|
const e = {};
|
|
1677
|
-
|
|
1678
|
-
const s = (
|
|
1677
|
+
y.freezePanes = e, t.copyToObject(e, "topLeft", be, "topLeftCell");
|
|
1678
|
+
const s = (y.topLeft ? z.fastStringToCell(y.topLeft) : void 0) ?? {
|
|
1679
1679
|
colIndex: 0,
|
|
1680
1680
|
rowIndex: 0
|
|
1681
1681
|
}, o = {
|
|
1682
1682
|
colIndex: 0,
|
|
1683
1683
|
rowIndex: 0
|
|
1684
1684
|
};
|
|
1685
|
-
t.copyToObject(o, "colIndex",
|
|
1685
|
+
t.copyToObject(o, "colIndex", me, "xSplit"), t.copyToObject(o, "rowIndex", me, "ySplit");
|
|
1686
1686
|
const r = {
|
|
1687
1687
|
colIndex: s.colIndex + o.colIndex,
|
|
1688
1688
|
rowIndex: s.rowIndex + o.rowIndex
|
|
@@ -1695,7 +1695,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1695
1695
|
transparent: !0,
|
|
1696
1696
|
openTag: (t) => {
|
|
1697
1697
|
const s = t.getAttribute("codeName");
|
|
1698
|
-
s && (e.codeName = s), !1 === t.getAttribute("enableFormatConditionsCalculation",
|
|
1698
|
+
s && (e.codeName = s), !1 === t.getAttribute("enableFormatConditionsCalculation", ge) && (e.conditionalFormatCalculation = !1);
|
|
1699
1699
|
}
|
|
1700
1700
|
}), h.registerVisitor({
|
|
1701
1701
|
from: "tabColor",
|
|
@@ -1713,25 +1713,25 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1713
1713
|
to: null,
|
|
1714
1714
|
openTag: (t) => {
|
|
1715
1715
|
const s = {};
|
|
1716
|
-
t.copyToObject(s, "summaryBelow",
|
|
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
1717
|
}
|
|
1718
1718
|
}), h.registerVisitor({
|
|
1719
1719
|
from: "pageMargins",
|
|
1720
1720
|
to: "pageMargins",
|
|
1721
1721
|
openTag: (t) => {
|
|
1722
|
-
t.copyTo("bottom",
|
|
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);
|
|
1723
1723
|
}
|
|
1724
1724
|
}), h.registerVisitor({
|
|
1725
1725
|
from: "pageSetup",
|
|
1726
1726
|
to: "pageSetup",
|
|
1727
1727
|
openTag: (t) => {
|
|
1728
|
-
t.copyTo("blackAndWhite",
|
|
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);
|
|
1729
1729
|
}
|
|
1730
1730
|
}), h.registerVisitor({
|
|
1731
1731
|
from: "printOptions",
|
|
1732
1732
|
to: "printOptions",
|
|
1733
1733
|
openTag: (t) => {
|
|
1734
|
-
t.copyTo("gridLines",
|
|
1734
|
+
t.copyTo("gridLines", ge), t.copyTo("gridLinesSet", ge), t.copyTo("headings", ge), t.copyTo("horizontalCentered", ge), t.copyTo("verticalCentered", ge);
|
|
1735
1735
|
}
|
|
1736
1736
|
}), h.registerVisitor({
|
|
1737
1737
|
from: "headerFoot",
|
|
@@ -1750,7 +1750,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1750
1750
|
t.setSource([]);
|
|
1751
1751
|
}
|
|
1752
1752
|
});
|
|
1753
|
-
const
|
|
1753
|
+
const S = {
|
|
1754
1754
|
from: "dataValidation",
|
|
1755
1755
|
to: [],
|
|
1756
1756
|
openTag: (t) => {
|
|
@@ -1764,28 +1764,28 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1764
1764
|
operator: t.getAttribute("operator") ?? void 0
|
|
1765
1765
|
}
|
|
1766
1766
|
};
|
|
1767
|
-
!0 === t.getAttribute("showDropDown",
|
|
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);
|
|
1768
1768
|
},
|
|
1769
1769
|
closeTag: (t) => {
|
|
1770
1770
|
const e = t.getSource();
|
|
1771
1771
|
if (!e?.rule) return;
|
|
1772
|
-
const s =
|
|
1773
|
-
s && (t.getAttribute("allowBlank",
|
|
1772
|
+
const s = D(e.rule, n);
|
|
1773
|
+
s && (t.getAttribute("allowBlank", ge) && (s.includeBlanks = !0), e.v.condition = s), delete e.rule;
|
|
1774
1774
|
}
|
|
1775
1775
|
};
|
|
1776
|
-
h.registerVisitor(
|
|
1776
|
+
h.registerVisitor(S), h.registerVisitor({
|
|
1777
1777
|
from: "formula1",
|
|
1778
1778
|
to: {},
|
|
1779
1779
|
text: (t, e) => {
|
|
1780
1780
|
const s = e.getParent().rule;
|
|
1781
|
-
s?.type && (s.formula1 =
|
|
1781
|
+
s?.type && (s.formula1 = B(f(t), s.type));
|
|
1782
1782
|
}
|
|
1783
1783
|
}), h.registerVisitor({
|
|
1784
1784
|
from: "formula2",
|
|
1785
1785
|
to: {},
|
|
1786
1786
|
text: (t, e) => {
|
|
1787
1787
|
const s = e.getParent().rule;
|
|
1788
|
-
s?.type && (s.formula2 =
|
|
1788
|
+
s?.type && (s.formula2 = B(f(t), s.type));
|
|
1789
1789
|
}
|
|
1790
1790
|
}), h.registerVisitor({
|
|
1791
1791
|
from: "picture",
|
|
@@ -1797,7 +1797,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1797
1797
|
t.getSource().resId = o;
|
|
1798
1798
|
}
|
|
1799
1799
|
});
|
|
1800
|
-
const
|
|
1800
|
+
const C = {
|
|
1801
1801
|
from: "slicer",
|
|
1802
1802
|
to: {},
|
|
1803
1803
|
openTag: (t) => {
|
|
@@ -1809,8 +1809,8 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1809
1809
|
for (const t of i) r.slicers[t] = o[t];
|
|
1810
1810
|
}
|
|
1811
1811
|
};
|
|
1812
|
-
h.registerVisitor(
|
|
1813
|
-
const
|
|
1812
|
+
h.registerVisitor(C);
|
|
1813
|
+
const A = (t, e) => ({
|
|
1814
1814
|
from: t,
|
|
1815
1815
|
to: {},
|
|
1816
1816
|
openTag: (t) => {
|
|
@@ -1834,14 +1834,14 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1834
1834
|
0 === (t.getSource()?.length ?? 0) && t.setSource(void 0);
|
|
1835
1835
|
}
|
|
1836
1836
|
}), E.set("dataValidation", {
|
|
1837
|
-
...
|
|
1837
|
+
...S,
|
|
1838
1838
|
closeTag: (t) => {
|
|
1839
|
-
|
|
1839
|
+
S.closeTag(t);
|
|
1840
1840
|
const e = t.getSource();
|
|
1841
1841
|
e && !e.r && (t.warn("x14 dataValidation with no xm:sqref was dropped."), t.setSource(void 0));
|
|
1842
1842
|
}
|
|
1843
1843
|
});
|
|
1844
|
-
const
|
|
1844
|
+
const V = (t) => ({
|
|
1845
1845
|
from: t,
|
|
1846
1846
|
to: {},
|
|
1847
1847
|
openTag: (e) => {
|
|
@@ -1851,18 +1851,18 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1851
1851
|
});
|
|
1852
1852
|
}
|
|
1853
1853
|
});
|
|
1854
|
-
E.set("formula1",
|
|
1854
|
+
E.set("formula1", V("formula1")), E.set("formula2", V("formula2")), E.set("f", A("f", (t, e) => {
|
|
1855
1855
|
const s = e.getParent(), o = s?.rule;
|
|
1856
|
-
o && (o[s.key] =
|
|
1857
|
-
})), E.set("sqref",
|
|
1856
|
+
o && (o[s.key] = B(f(t), o.type));
|
|
1857
|
+
})), E.set("sqref", A("sqref", (t, e) => {
|
|
1858
1858
|
const s = e.getParent(), o = t.trim();
|
|
1859
1859
|
s && o && (s.r = o.split(/\s+/).join(","));
|
|
1860
1860
|
}));
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1861
|
+
const L = /* @__PURE__ */ new Map(), N = [], R = /* @__PURE__ */ new Map();
|
|
1862
|
+
R.set("conditionalFormattings", {
|
|
1863
1863
|
from: "conditionalFormattings",
|
|
1864
1864
|
transparent: !0
|
|
1865
|
-
}),
|
|
1865
|
+
}), R.set("conditionalFormatting", {
|
|
1866
1866
|
from: "conditionalFormatting",
|
|
1867
1867
|
to: {},
|
|
1868
1868
|
openTag: (t) => {
|
|
@@ -1872,48 +1872,48 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1872
1872
|
const e = t.getSource(), s = e?.rules ?? [];
|
|
1873
1873
|
for (let t = 0; t < s.length; t++) {
|
|
1874
1874
|
const o = s[t];
|
|
1875
|
-
o.sqref = e.sqref, o.id ?
|
|
1875
|
+
o.sqref = e.sqref, o.id ? L.set(o.id, o) : N.push(o);
|
|
1876
1876
|
}
|
|
1877
1877
|
}
|
|
1878
|
-
}),
|
|
1878
|
+
}), R.set("cfRule", {
|
|
1879
1879
|
from: "cfRule",
|
|
1880
1880
|
to: {},
|
|
1881
1881
|
openTag: (t) => {
|
|
1882
|
-
t.copyTo("id",
|
|
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);
|
|
1883
1883
|
},
|
|
1884
1884
|
closeTag: (t) => {
|
|
1885
1885
|
const e = t.getSource();
|
|
1886
1886
|
e && t.getParent()?.rules?.push(e);
|
|
1887
1887
|
}
|
|
1888
|
-
}),
|
|
1888
|
+
}), R.set("sqref", A("sqref", (t, e) => {
|
|
1889
1889
|
const s = e.getParent(), o = t.trim();
|
|
1890
1890
|
s && o && (s.sqref = o);
|
|
1891
|
-
})),
|
|
1891
|
+
})), R.set("dataBar", {
|
|
1892
1892
|
from: "dataBar",
|
|
1893
1893
|
to: {},
|
|
1894
1894
|
openTag: (t) => {
|
|
1895
|
-
t.copyTo("minLength",
|
|
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);
|
|
1896
1896
|
},
|
|
1897
1897
|
closeTag: (t) => {
|
|
1898
1898
|
t.getParent().dataBar = t.getSource();
|
|
1899
1899
|
}
|
|
1900
|
-
}),
|
|
1900
|
+
}), R.set("iconSet", {
|
|
1901
1901
|
from: "iconSet",
|
|
1902
1902
|
to: {},
|
|
1903
1903
|
openTag: (t) => {
|
|
1904
|
-
t.copyTo("iconSet",
|
|
1904
|
+
t.copyTo("iconSet", be), t.copyTo("custom", ge), t.copyTo("reverse", ge), t.copyTo("showValue", ge);
|
|
1905
1905
|
},
|
|
1906
1906
|
closeTag: (t) => {
|
|
1907
1907
|
t.getParent().iconSet = t.getSource();
|
|
1908
1908
|
}
|
|
1909
1909
|
});
|
|
1910
1910
|
const F = /* @__PURE__ */ new Map();
|
|
1911
|
-
F.set("f",
|
|
1911
|
+
F.set("f", A("f", (t, e) => {
|
|
1912
1912
|
const s = e.getParent();
|
|
1913
1913
|
if (!s) return;
|
|
1914
1914
|
const o = t.trim(), r = Number(o);
|
|
1915
|
-
s.value = o.length > 0 && Number.isFinite(r) ? r :
|
|
1916
|
-
})),
|
|
1915
|
+
s.value = o.length > 0 && Number.isFinite(r) ? r : f(t);
|
|
1916
|
+
})), R.set("cfvo", {
|
|
1917
1917
|
from: "cfvo",
|
|
1918
1918
|
to: {},
|
|
1919
1919
|
scope: () => F,
|
|
@@ -1921,12 +1921,12 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1921
1921
|
const e = t.getParent();
|
|
1922
1922
|
e.conditions || (e.conditions = []);
|
|
1923
1923
|
const s = t.getSource();
|
|
1924
|
-
e.conditions.push(s), t.copyTo("type",
|
|
1924
|
+
e.conditions.push(s), t.copyTo("type", be), !1 === t.getAttribute("gte", ge) && (s.exclusive = !0);
|
|
1925
1925
|
}
|
|
1926
|
-
}),
|
|
1926
|
+
}), R.set("f", A("f", (t, e) => {
|
|
1927
1927
|
const s = e.getParent();
|
|
1928
|
-
s && (s.formulas ??= []).push(
|
|
1929
|
-
})),
|
|
1928
|
+
s && (s.formulas ??= []).push(f(t));
|
|
1929
|
+
})), R.set("dxf", {
|
|
1930
1930
|
from: "dxf",
|
|
1931
1931
|
to: {},
|
|
1932
1932
|
raw: !0,
|
|
@@ -1946,11 +1946,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1946
1946
|
s && (e.getParent()[t] = s);
|
|
1947
1947
|
}
|
|
1948
1948
|
});
|
|
1949
|
-
|
|
1949
|
+
R.set("borderColor", W("borderColor")), R.set("negativeFillColor", W("negativeFillColor")), R.set("negativeBorderColor", W("negativeBorderColor")), R.set("axisColor", W("axisColor")), R.set("cfIcon", {
|
|
1950
1950
|
from: "cfIcon",
|
|
1951
1951
|
to: {},
|
|
1952
1952
|
openTag: (t) => {
|
|
1953
|
-
const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId",
|
|
1953
|
+
const e = t.getAttribute("iconSet"), s = t.getAttribute("iconId", me);
|
|
1954
1954
|
if (null === e || null === s) return;
|
|
1955
1955
|
const o = t.getParent();
|
|
1956
1956
|
o.icons || (o.icons = []), o.icons.push({
|
|
@@ -1960,7 +1960,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1960
1960
|
}
|
|
1961
1961
|
});
|
|
1962
1962
|
const X = /* @__PURE__ */ new Map();
|
|
1963
|
-
X.set("id",
|
|
1963
|
+
X.set("id", A("id", (t, e) => {
|
|
1964
1964
|
const s = e.getParent(), o = t.trim();
|
|
1965
1965
|
s && o && (s.x14Id = o);
|
|
1966
1966
|
}));
|
|
@@ -1968,15 +1968,15 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1968
1968
|
q.set("slicerList", {
|
|
1969
1969
|
from: "slicerList",
|
|
1970
1970
|
transparent: !0
|
|
1971
|
-
}), q.set("slicer",
|
|
1971
|
+
}), q.set("slicer", C);
|
|
1972
1972
|
const U = /* @__PURE__ */ new Map([
|
|
1973
|
-
[
|
|
1974
|
-
[
|
|
1975
|
-
[
|
|
1976
|
-
[
|
|
1977
|
-
[
|
|
1978
|
-
[
|
|
1979
|
-
]),
|
|
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
1980
|
h.registerVisitor({
|
|
1981
1981
|
from: "extLst",
|
|
1982
1982
|
transparent: !0
|
|
@@ -1984,11 +1984,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
1984
1984
|
from: "ext",
|
|
1985
1985
|
transparent: !0,
|
|
1986
1986
|
scope: (t) => {
|
|
1987
|
-
const e = t.getAttribute("uri"), s =
|
|
1987
|
+
const e = t.getAttribute("uri"), s = j(e), o = U.get(s);
|
|
1988
1988
|
if (o) return o;
|
|
1989
|
-
if (!
|
|
1990
|
-
|
|
1991
|
-
const o =
|
|
1989
|
+
if (!w.has(s) && !G.has(s)) {
|
|
1990
|
+
G.add(s);
|
|
1991
|
+
const o = u[s];
|
|
1992
1992
|
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
1993
|
}
|
|
1994
1994
|
return null;
|
|
@@ -2050,15 +2050,15 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2050
2050
|
t.setSource(s(t.getAttribute("r:id"), "legacyDrawing") ?? void 0);
|
|
2051
2051
|
}
|
|
2052
2052
|
});
|
|
2053
|
-
let
|
|
2054
|
-
const Y = /* @__PURE__ */ new Map(),
|
|
2053
|
+
let Z = null, Q = !1;
|
|
2054
|
+
const Y = /* @__PURE__ */ new Map(), tt = {
|
|
2055
2055
|
from: "Fallback",
|
|
2056
2056
|
to: null
|
|
2057
|
-
},
|
|
2057
|
+
}, et = {
|
|
2058
2058
|
from: "Choice",
|
|
2059
2059
|
transparent: !0
|
|
2060
2060
|
};
|
|
2061
|
-
Y.set("Fallback",
|
|
2061
|
+
Y.set("Fallback", tt), Y.set("Choice", et), Y.set("control", {
|
|
2062
2062
|
from: "control",
|
|
2063
2063
|
transparent: !0,
|
|
2064
2064
|
openTag: (t) => {
|
|
@@ -2086,43 +2086,43 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2086
2086
|
json: e
|
|
2087
2087
|
}
|
|
2088
2088
|
};
|
|
2089
|
-
n && (a.name = n),
|
|
2089
|
+
n && (a.content.name = n), Z = {
|
|
2090
2090
|
movable: a,
|
|
2091
2091
|
control: e
|
|
2092
2092
|
};
|
|
2093
2093
|
},
|
|
2094
2094
|
closeTag: () => {
|
|
2095
|
-
|
|
2095
|
+
Z && (e.movables || (e.movables = []), e.movables.push(Z.movable), Z = null);
|
|
2096
2096
|
}
|
|
2097
2097
|
}), Y.set("controlPr", {
|
|
2098
2098
|
from: "controlPr",
|
|
2099
2099
|
transparent: !0,
|
|
2100
2100
|
raw: !0,
|
|
2101
2101
|
openTag: (t) => {
|
|
2102
|
-
if (!
|
|
2102
|
+
if (!Z) return;
|
|
2103
2103
|
const e = t.getFrom().attributes ?? {}, s = {};
|
|
2104
2104
|
for (const t in e) {
|
|
2105
2105
|
const o = e[t];
|
|
2106
2106
|
s[t] = "string" == typeof o ? o : o?.value ?? "";
|
|
2107
2107
|
}
|
|
2108
|
-
Object.keys(s).length > 0 && (
|
|
2108
|
+
Object.keys(s).length > 0 && (Z.control.props = s);
|
|
2109
2109
|
},
|
|
2110
2110
|
closeTag: (t) => {
|
|
2111
|
-
if (!
|
|
2111
|
+
if (!Z) return;
|
|
2112
2112
|
const e = ((t) => {
|
|
2113
2113
|
const e = /<(?:[\w.-]+:)?anchor\b([^>]*)>([\s\S]*?)<\/(?:[\w.-]+:)?anchor>/.exec(t);
|
|
2114
2114
|
if (!e) return null;
|
|
2115
2115
|
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
2116
|
return {
|
|
2117
2117
|
anchor: {
|
|
2118
|
-
tl:
|
|
2119
|
-
br:
|
|
2118
|
+
tl: Pe(o("from")),
|
|
2119
|
+
br: Pe(o("to"))
|
|
2120
2120
|
},
|
|
2121
2121
|
anchorType: i ? n ? "twoCell" : "oneCell" : "absolute",
|
|
2122
2122
|
rest: (t.slice(0, e.index) + t.slice(e.index + e[0].length)).trim()
|
|
2123
2123
|
};
|
|
2124
2124
|
})(t.getRawXml() ?? "");
|
|
2125
|
-
e ? (
|
|
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."));
|
|
2126
2126
|
}
|
|
2127
2127
|
});
|
|
2128
2128
|
const ot = {
|
|
@@ -2132,8 +2132,8 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2132
2132
|
};
|
|
2133
2133
|
h.registerVisitor(ot);
|
|
2134
2134
|
const rt = /* @__PURE__ */ new Map([
|
|
2135
|
-
["Choice",
|
|
2136
|
-
["Fallback",
|
|
2135
|
+
["Choice", et],
|
|
2136
|
+
["Fallback", tt],
|
|
2137
2137
|
["controls", ot]
|
|
2138
2138
|
]);
|
|
2139
2139
|
h.registerVisitor({
|
|
@@ -2166,7 +2166,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2166
2166
|
if ("iconSet" === t.type) {
|
|
2167
2167
|
if (!t.iconSet) return null;
|
|
2168
2168
|
const s = {
|
|
2169
|
-
type:
|
|
2169
|
+
type: J.ScaleType.IconSet,
|
|
2170
2170
|
stops: []
|
|
2171
2171
|
};
|
|
2172
2172
|
return nt(s, t.iconSet), {
|
|
@@ -2175,7 +2175,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2175
2175
|
priority: t.priority
|
|
2176
2176
|
};
|
|
2177
2177
|
}
|
|
2178
|
-
const s =
|
|
2178
|
+
const s = P(t, n);
|
|
2179
2179
|
if (!s) return null;
|
|
2180
2180
|
const o = { condition: s };
|
|
2181
2181
|
return t.style && (o.style = t.style), t.stopIfTrue && (o.stopIfTrue = !0), {
|
|
@@ -2195,13 +2195,13 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2195
2195
|
const e = s[t], o = e.x14Id;
|
|
2196
2196
|
if (!o) continue;
|
|
2197
2197
|
delete e.x14Id;
|
|
2198
|
-
const r =
|
|
2198
|
+
const r = L.get(o);
|
|
2199
2199
|
if (!r) continue;
|
|
2200
|
-
|
|
2200
|
+
L.delete(o);
|
|
2201
2201
|
const i = e.v?.scale;
|
|
2202
|
-
r.dataBar && i?.type ===
|
|
2202
|
+
r.dataBar && i?.type === J.ScaleType.DataBar ? it(i, r.dataBar) : r.iconSet && i?.type === J.ScaleType.IconSet && nt(i, r.iconSet);
|
|
2203
2203
|
}
|
|
2204
|
-
const o = [
|
|
2204
|
+
const o = [...L.values(), ...N], r = /* @__PURE__ */ new Set();
|
|
2205
2205
|
let i = 0;
|
|
2206
2206
|
for (let t = 0; t < o.length; t++) {
|
|
2207
2207
|
const n = at(o[t]);
|
|
@@ -2244,11 +2244,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2244
2244
|
const e = t.getSource();
|
|
2245
2245
|
for (const s of M) {
|
|
2246
2246
|
const o = t.hasAttribute(s.attribute) ? t.getAttribute(s.attribute) : null;
|
|
2247
|
-
e[s.key] =
|
|
2247
|
+
e[s.key] = I(s, o);
|
|
2248
2248
|
}
|
|
2249
2249
|
if (e.sheet) return;
|
|
2250
2250
|
const s = {};
|
|
2251
|
-
if (t.copyToObject(s, "hash",
|
|
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;
|
|
2252
2252
|
}
|
|
2253
2253
|
}), h.registerVisitor({
|
|
2254
2254
|
from: "protectedRanges",
|
|
@@ -2268,7 +2268,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2268
2268
|
};
|
|
2269
2269
|
t.copyToObject(s, "name"), t.copyToObject(s, "securityDescriptor");
|
|
2270
2270
|
const r = {};
|
|
2271
|
-
t.copyToObject(r, "hash",
|
|
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);
|
|
2272
2272
|
},
|
|
2273
2273
|
closeTag: (t) => {
|
|
2274
2274
|
const e = t.getSource();
|
|
@@ -2278,9 +2278,9 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2278
2278
|
from: "sheetFormatPr",
|
|
2279
2279
|
to: "sheetFormatPr",
|
|
2280
2280
|
openTag: (t) => {
|
|
2281
|
-
t.copyToObject(e, "defaultColSize",
|
|
2281
|
+
t.copyToObject(e, "defaultColSize", xe, "defaultColWidth"), t.copyToObject(e, "outlineLevelCol", me, "outlineLevelCol");
|
|
2282
2282
|
const s = t.getAttribute("customHeight");
|
|
2283
|
-
"1" !== s && "true" !== s || t.copyToObject(e, "defaultRowSize",
|
|
2283
|
+
"1" !== s && "true" !== s || t.copyToObject(e, "defaultRowSize", xe, "defaultRowHeight"), t.copyToObject(e, "outlineLevelRow", me, "outlineLevelRow");
|
|
2284
2284
|
}
|
|
2285
2285
|
}), h.registerVisitor({
|
|
2286
2286
|
from: "cols",
|
|
@@ -2295,7 +2295,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2295
2295
|
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
2296
|
e.r = z.runToString(r, i, !0);
|
|
2297
2297
|
const n = {};
|
|
2298
|
-
e.v = n, t.copyToObject(n, "sz",
|
|
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");
|
|
2299
2299
|
}
|
|
2300
2300
|
}), h.registerVisitor({
|
|
2301
2301
|
from: "oleObjects",
|
|
@@ -2309,7 +2309,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2309
2309
|
const e = t.indexOf(":");
|
|
2310
2310
|
return -1 === e ? t : t.slice(e + 1);
|
|
2311
2311
|
};
|
|
2312
|
-
return
|
|
2312
|
+
return Ne(g, e, h.createEventHandler(e, i, n), n, c, {
|
|
2313
2313
|
onOpenTag: (t) => {
|
|
2314
2314
|
ct = !0;
|
|
2315
2315
|
const e = pt(t.name);
|
|
@@ -2324,12 +2324,12 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2324
2324
|
},
|
|
2325
2325
|
onEnd: () => {
|
|
2326
2326
|
if (!ct) return;
|
|
2327
|
-
const t = o(
|
|
2327
|
+
const t = o(H(ut));
|
|
2328
2328
|
return ct = !1, lt = !1, ht = 0, ut = "", t;
|
|
2329
2329
|
},
|
|
2330
2330
|
onError: (t) => {}
|
|
2331
2331
|
}, l);
|
|
2332
|
-
},
|
|
2332
|
+
}, _e = class {
|
|
2333
2333
|
static {
|
|
2334
2334
|
this.Collapsed = 1;
|
|
2335
2335
|
}
|
|
@@ -2366,22 +2366,22 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2366
2366
|
static {
|
|
2367
2367
|
this.ThickTop = 2048;
|
|
2368
2368
|
}
|
|
2369
|
-
},
|
|
2369
|
+
}, Ve = (t, e, s) => {
|
|
2370
2370
|
if (t[0].value[0] === t[1].value[0]) return e;
|
|
2371
|
-
},
|
|
2371
|
+
}, Le = {
|
|
2372
2372
|
colStart: 0,
|
|
2373
2373
|
colEnd: 0,
|
|
2374
2374
|
rowStart: 0,
|
|
2375
2375
|
rowEnd: 0
|
|
2376
|
-
},
|
|
2376
|
+
}, Ne = (t, e, s, o, r, i, n) => {
|
|
2377
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") ??
|
|
2378
|
+
const x = n?.get("richData") ?? q.EmptyArray, b = n?.get("dummyWrapped") ?? null, y = z.normalizeA1ToR1C1, T = U.createConflatingRanges(), v = /* @__PURE__ */ new Map(), w = [];
|
|
2379
2379
|
let S = !1, C = !1, k = null;
|
|
2380
2380
|
let A = !1;
|
|
2381
|
-
const O =
|
|
2381
|
+
const O = U.createConflatingRanges();
|
|
2382
2382
|
let E = !1, P = -1, I = -1, D = null, _ = null, V = null;
|
|
2383
2383
|
const L = [];
|
|
2384
|
-
let N = null, $ = -2, R = 0, j = "",
|
|
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;
|
|
2385
2385
|
const ht = (t) => {
|
|
2386
2386
|
let o = t.name;
|
|
2387
2387
|
const d = o.indexOf(":");
|
|
@@ -2439,12 +2439,12 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2439
2439
|
const a = e.vm;
|
|
2440
2440
|
if (void 0 !== a) {
|
|
2441
2441
|
const t = x[parseInt(a) - 1];
|
|
2442
|
-
if (
|
|
2442
|
+
if (G.isError(t)) {
|
|
2443
2443
|
const e = t.getCode();
|
|
2444
2444
|
D = {
|
|
2445
2445
|
t: "e",
|
|
2446
2446
|
v: e
|
|
2447
|
-
}, S && e ===
|
|
2447
|
+
}, S && e === G.Code.Spill && (C = !0);
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
@@ -2452,18 +2452,18 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2452
2452
|
if (nt && "row" === o) {
|
|
2453
2453
|
a = !0;
|
|
2454
2454
|
const e = t.attributes.r;
|
|
2455
|
-
if (P = parseInt(e) - 1, R = 0,
|
|
2456
|
-
const t = void 0 !==
|
|
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);
|
|
2457
2457
|
ct = e && void 0 !== F ? F : null, e && null === ct && (ct = "0"), N = {
|
|
2458
2458
|
min: P,
|
|
2459
2459
|
max: P,
|
|
2460
2460
|
value: {
|
|
2461
2461
|
sz: void 0 === j ? -1 : parseFloat(j),
|
|
2462
2462
|
csz: t,
|
|
2463
|
-
h: void 0 !==
|
|
2463
|
+
h: void 0 !== M && ("1" === M || "true" === M),
|
|
2464
2464
|
s: null === ct ? void 0 : "0" === ct ? 0 : parseInt(ct),
|
|
2465
2465
|
l: void 0 === W || "0" === W ? 0 : parseInt(W),
|
|
2466
|
-
cl: void 0 !==
|
|
2466
|
+
cl: void 0 !== X && ("1" === X || "true" === X)
|
|
2467
2467
|
}
|
|
2468
2468
|
}, L.push(N);
|
|
2469
2469
|
} else N.max = P;
|
|
@@ -2509,7 +2509,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2509
2509
|
const t = _.attributes.vm;
|
|
2510
2510
|
if (void 0 !== t) {
|
|
2511
2511
|
const e = x[parseInt(t) - 1];
|
|
2512
|
-
if (
|
|
2512
|
+
if (G.isError(e)) {
|
|
2513
2513
|
D = {
|
|
2514
2514
|
t: "e",
|
|
2515
2515
|
v: e.getCode()
|
|
@@ -2518,7 +2518,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
2520
|
}
|
|
2521
|
-
const t =
|
|
2521
|
+
const t = G.getBuiltInByLabel(n);
|
|
2522
2522
|
t ? D = {
|
|
2523
2523
|
t: "e",
|
|
2524
2524
|
v: t.getCode()
|
|
@@ -2537,7 +2537,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2537
2537
|
else {
|
|
2538
2538
|
if (f = v.get(u) ?? null, !f) {
|
|
2539
2539
|
const t = [];
|
|
2540
|
-
d =
|
|
2540
|
+
d = y(n, P, I, t), f = [
|
|
2541
2541
|
d,
|
|
2542
2542
|
t,
|
|
2543
2543
|
n
|
|
@@ -2548,22 +2548,22 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2548
2548
|
u = null;
|
|
2549
2549
|
}
|
|
2550
2550
|
if (h) {
|
|
2551
|
-
if (null !==
|
|
2551
|
+
if (null !== b) {
|
|
2552
2552
|
const t = ((t) => {
|
|
2553
|
-
if (t.length <
|
|
2554
|
-
if (t.slice(0,
|
|
2555
|
-
const e =
|
|
2556
|
-
if (null === e) return
|
|
2557
|
-
if (41 !== t.charCodeAt(e.end)) return
|
|
2558
|
-
if (44 !== t.charCodeAt(e.end + 1)) return
|
|
2559
|
-
if (41 !== t.charCodeAt(t.length - 1)) return
|
|
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;
|
|
2560
2560
|
const s = e.value;
|
|
2561
|
-
return s.toUpperCase() ===
|
|
2561
|
+
return s.toUpperCase() === Ce ? Ae : 0 === s.length ? ke : {
|
|
2562
2562
|
kind: "formula",
|
|
2563
2563
|
formula: s
|
|
2564
2564
|
};
|
|
2565
2565
|
})(n);
|
|
2566
|
-
"none" !== t.kind &&
|
|
2566
|
+
"none" !== t.kind && b.push({
|
|
2567
2567
|
sheet: e,
|
|
2568
2568
|
rowIndex: P,
|
|
2569
2569
|
colIndex: I,
|
|
@@ -2571,7 +2571,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2571
2571
|
});
|
|
2572
2572
|
}
|
|
2573
2573
|
const t = [];
|
|
2574
|
-
d =
|
|
2574
|
+
d = y(n, P, I, t), f = [
|
|
2575
2575
|
d,
|
|
2576
2576
|
t,
|
|
2577
2577
|
n
|
|
@@ -2601,7 +2601,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2601
2601
|
name: "v",
|
|
2602
2602
|
attributes: {},
|
|
2603
2603
|
isSelfClosing: !1
|
|
2604
|
-
},
|
|
2604
|
+
}, bt = {
|
|
2605
2605
|
r: void 0,
|
|
2606
2606
|
s: void 0,
|
|
2607
2607
|
ht: void 0,
|
|
@@ -2610,11 +2610,11 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2610
2610
|
customHeight: void 0,
|
|
2611
2611
|
customFormat: void 0,
|
|
2612
2612
|
outlineLevel: void 0
|
|
2613
|
-
},
|
|
2613
|
+
}, yt = {
|
|
2614
2614
|
name: "row",
|
|
2615
|
-
attributes:
|
|
2615
|
+
attributes: bt,
|
|
2616
2616
|
isSelfClosing: !1
|
|
2617
|
-
}, Tt =
|
|
2617
|
+
}, Tt = fe.NEED_MORE, vt = fe.NOT_HANDLED, wt = fe.decodeText;
|
|
2618
2618
|
let St = !1;
|
|
2619
2619
|
const Ct = (t, e, s, o) => {
|
|
2620
2620
|
for (;;) {
|
|
@@ -2642,18 +2642,18 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2642
2642
|
const h = t.charCodeAt(i);
|
|
2643
2643
|
if (2 === o) switch (n) {
|
|
2644
2644
|
case 1:
|
|
2645
|
-
114 === h ?
|
|
2645
|
+
114 === h ? bt.r = t.slice(c, l) : 115 === h && (bt.s = t.slice(c, l));
|
|
2646
2646
|
break;
|
|
2647
2647
|
case 2:
|
|
2648
|
-
t.startsWith("ht", i) && (
|
|
2648
|
+
t.startsWith("ht", i) && (bt.ht = t.slice(c, l));
|
|
2649
2649
|
break;
|
|
2650
2650
|
case 6:
|
|
2651
|
-
t.startsWith("hidden", i) && (
|
|
2651
|
+
t.startsWith("hidden", i) && (bt.hidden = t.slice(c, l));
|
|
2652
2652
|
break;
|
|
2653
2653
|
case 9:
|
|
2654
|
-
t.startsWith("collapsed", i) && (
|
|
2654
|
+
t.startsWith("collapsed", i) && (bt.collapsed = t.slice(c, l));
|
|
2655
2655
|
break;
|
|
2656
|
-
case 12: t.startsWith("customHeight", i) ?
|
|
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));
|
|
2657
2657
|
}
|
|
2658
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)));
|
|
2659
2659
|
else if (1 === n) 116 === h && (gt.t = t.slice(c, l));
|
|
@@ -2667,7 +2667,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2667
2667
|
...s,
|
|
2668
2668
|
onEnd: () => {
|
|
2669
2669
|
L.length > 0 && (e.rows = z.runsToRefs(L, !1));
|
|
2670
|
-
let o = T.done(
|
|
2670
|
+
let o = T.done(Ve);
|
|
2671
2671
|
const r = o.length;
|
|
2672
2672
|
if (r > 0) {
|
|
2673
2673
|
const t = new Array(r);
|
|
@@ -2689,7 +2689,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2689
2689
|
w.length > 0 && (e.formulaArray = [...w]);
|
|
2690
2690
|
const a = l.length;
|
|
2691
2691
|
if (a > 0) {
|
|
2692
|
-
l.sort(
|
|
2692
|
+
l.sort(U.createRangeComparator(Z.Axis.Column));
|
|
2693
2693
|
let t = l[0], s = t.colStart, o = t.colEnd, r = t.rowEnd, i = t.value;
|
|
2694
2694
|
const n = [];
|
|
2695
2695
|
n.push(t);
|
|
@@ -2753,19 +2753,19 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2753
2753
|
}
|
|
2754
2754
|
}, {
|
|
2755
2755
|
name: "row",
|
|
2756
|
-
openTag:
|
|
2756
|
+
openTag: yt,
|
|
2757
2757
|
scan: (t, e, s) => {
|
|
2758
2758
|
if (!nt || a || null !== _) return vt;
|
|
2759
|
-
|
|
2759
|
+
bt.r = bt.s = bt.ht = bt.hidden = bt.collapsed = bt.customHeight = bt.customFormat = bt.outlineLevel = void 0;
|
|
2760
2760
|
const o = Ct(t, e + 4, s, 2);
|
|
2761
|
-
return o < 0 ? o : St || void 0 ===
|
|
2761
|
+
return o < 0 ? o : St || void 0 === bt.r ? vt : (ht(yt), o);
|
|
2762
2762
|
}
|
|
2763
2763
|
}]
|
|
2764
2764
|
};
|
|
2765
|
-
},
|
|
2765
|
+
}, $e = (t) => {
|
|
2766
2766
|
const e = t.indexOf(":");
|
|
2767
2767
|
return -1 === e ? t : t.slice(e + 1);
|
|
2768
|
-
},
|
|
2768
|
+
}, Re = {
|
|
2769
2769
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": "workbooks",
|
|
2770
2770
|
"application/vnd.ms-excel.sheet.macroEnabled.main+xml": "workbooks",
|
|
2771
2771
|
"application/vnd.ms-excel.sheet.binary.macroEnabled.main": "workbooks",
|
|
@@ -2795,49 +2795,49 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2795
2795
|
"application/vnd.ms-excel.externalLink": "links",
|
|
2796
2796
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml": "links",
|
|
2797
2797
|
"application/vnd.openxmlformats-officedocument.theme+xml": "themes"
|
|
2798
|
-
},
|
|
2799
|
-
const { password: c, onVBA: u, profile: p, calcOnLoad:
|
|
2800
|
-
|
|
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([
|
|
2801
2801
|
t,
|
|
2802
2802
|
e ?? "",
|
|
2803
2803
|
s
|
|
2804
2804
|
]);
|
|
2805
|
-
},
|
|
2806
|
-
let
|
|
2807
|
-
const
|
|
2808
|
-
if (
|
|
2809
|
-
|
|
2810
|
-
const e = Math.min(
|
|
2811
|
-
|
|
2812
|
-
} : void 0,
|
|
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("./Bu9QkKpBW4G2ULAg.mjs");
|
|
2813
2813
|
let M = null;
|
|
2814
2814
|
try {
|
|
2815
2815
|
M = new DOMParser();
|
|
2816
2816
|
} catch (t) {}
|
|
2817
|
-
let
|
|
2817
|
+
let q = null;
|
|
2818
2818
|
try {
|
|
2819
|
-
|
|
2819
|
+
q = new XMLSerializer();
|
|
2820
2820
|
} catch (t) {}
|
|
2821
|
-
let
|
|
2822
|
-
M || (
|
|
2821
|
+
let U, G, K, J = null;
|
|
2822
|
+
M || (J = import("@xmldom/xmldom"));
|
|
2823
2823
|
try {
|
|
2824
|
-
const [t, e] = await Promise.all([
|
|
2825
|
-
|
|
2824
|
+
const [t, e] = await Promise.all([J, B]);
|
|
2825
|
+
U = new e.DOMTransformer(), G = M ?? new t.DOMParser(), K = q ?? new t.XMLSerializer();
|
|
2826
2826
|
} catch (t) {
|
|
2827
2827
|
throw new Error("Unable to load XLSX parser.", { cause: t });
|
|
2828
2828
|
}
|
|
2829
|
-
const Z = (t) =>
|
|
2830
|
-
let
|
|
2829
|
+
const Z = (t) => K.serializeToString(t);
|
|
2830
|
+
let st;
|
|
2831
2831
|
try {
|
|
2832
|
-
|
|
2832
|
+
st = await lt.create(t);
|
|
2833
2833
|
} catch (t) {
|
|
2834
|
-
throw new
|
|
2834
|
+
throw new X("Unable to parse as an Excel document. Try to save as '.xlsx' and try again.", { cause: t });
|
|
2835
2835
|
}
|
|
2836
|
-
|
|
2836
|
+
b?.mark("zip-open");
|
|
2837
2837
|
try {
|
|
2838
|
-
if (!
|
|
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
2839
|
const t = (t) => {
|
|
2840
|
-
const e =
|
|
2840
|
+
const e = st.getEntry(t);
|
|
2841
2841
|
return e ? { content: e } : void 0;
|
|
2842
2842
|
}, a = {
|
|
2843
2843
|
workbooks: [],
|
|
@@ -2872,7 +2872,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2872
2872
|
const e = o.ContentType, s = o.PartName;
|
|
2873
2873
|
if (!e || !s) return;
|
|
2874
2874
|
t.overrides[s.startsWith("/") ? s.slice(1) : s] = e;
|
|
2875
|
-
const r =
|
|
2875
|
+
const r = Re[e], i = r ? t[r] : void 0;
|
|
2876
2876
|
Array.isArray(i) && i.push(s);
|
|
2877
2877
|
} else if ("Default" === s) {
|
|
2878
2878
|
const e = o.Extension, s = o.ContentType;
|
|
@@ -2886,23 +2886,23 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2886
2886
|
e?.(`Error parsing content types: ${t?.message ?? t}`);
|
|
2887
2887
|
}
|
|
2888
2888
|
}))(a, (t) => {
|
|
2889
|
-
|
|
2890
|
-
}), e = await
|
|
2889
|
+
w.push([t, "[Content_Types].xml"]);
|
|
2890
|
+
}), e = await st.getTextStream("[Content_Types].xml");
|
|
2891
2891
|
if (!e) throw new Error("Error parsing content types: '[Content_Types].xml'");
|
|
2892
2892
|
try {
|
|
2893
|
-
await
|
|
2893
|
+
await oe.parseStream(e, t, { xmlns: !1 });
|
|
2894
2894
|
} catch (t) {
|
|
2895
2895
|
throw new Error("Error parsing content types: '[Content_Types].xml'", { cause: t });
|
|
2896
2896
|
}
|
|
2897
|
-
|
|
2898
|
-
}
|
|
2899
|
-
|
|
2900
|
-
const c = a.sst,
|
|
2901
|
-
for (const t of a.sheets)
|
|
2902
|
-
c &&
|
|
2903
|
-
for (const t of
|
|
2904
|
-
if (await
|
|
2905
|
-
const e = r("_rels/.rels", t,
|
|
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
2906
|
if (e) {
|
|
2907
2907
|
for (const t of e.values()) if (t.type === s && t.target) {
|
|
2908
2908
|
a.workbooks.push(t.target);
|
|
@@ -2910,37 +2910,37 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2910
2910
|
}
|
|
2911
2911
|
}
|
|
2912
2912
|
}
|
|
2913
|
-
if (0 === a.workbooks.length) throw new
|
|
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
2914
|
a.richstructure = ["/xl/richData/rdrichvaluestructure.xml"], a.richdata = ["/xl/richData/rdrichvalue.xml"];
|
|
2915
|
-
const
|
|
2916
|
-
|
|
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) => {
|
|
2917
2917
|
if (!t) return;
|
|
2918
|
-
const e =
|
|
2918
|
+
const e = G.parseFromString(`<dxf xmlns:x14="${A}" xmlns:xm="${E}">${t}</dxf>`, "text/xml")?.documentElement;
|
|
2919
2919
|
if (!e) return;
|
|
2920
|
-
const s =
|
|
2920
|
+
const s = U.parseDxf(e, "", O);
|
|
2921
2921
|
return Object.keys(s).length > 0 ? s : void 0;
|
|
2922
2922
|
});
|
|
2923
|
-
const
|
|
2924
|
-
|
|
2925
|
-
const
|
|
2926
|
-
|
|
2927
|
-
const
|
|
2928
|
-
|
|
2929
|
-
},
|
|
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
2930
|
const o = e.lastIndexOf("/"), i = e.substring(0, o + 1) + "_rels/" + e.substring(o + 1, e.length) + ".rels";
|
|
2931
2931
|
let n = s.get(i);
|
|
2932
|
-
return n || (n = r(i, t,
|
|
2933
|
-
},
|
|
2934
|
-
let a =
|
|
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
2935
|
if (!c) return null;
|
|
2936
2936
|
if ("External" === a.targetMode) {
|
|
2937
2937
|
if (!i) return a.target;
|
|
2938
|
-
const t =
|
|
2939
|
-
return t.addReference(M),
|
|
2938
|
+
const t = $.add({ source: { external: a.target } });
|
|
2939
|
+
return t.addReference(M), q.add(t), B.toResourceId(t);
|
|
2940
2940
|
}
|
|
2941
2941
|
const l = r.lastIndexOf("/"), u = r.substring(0, l + 1);
|
|
2942
2942
|
c.startsWith("/") || (c = u + c), c = o(c);
|
|
2943
|
-
const p =
|
|
2943
|
+
const p = U?.getVisitorParamsState().get("dxfs");
|
|
2944
2944
|
let d = n.get(c);
|
|
2945
2945
|
if (!d) {
|
|
2946
2946
|
const s = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet", o = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
|
|
@@ -2948,44 +2948,44 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2948
2948
|
const t = {};
|
|
2949
2949
|
d = t;
|
|
2950
2950
|
const e = async () => {
|
|
2951
|
-
const e =
|
|
2952
|
-
|
|
2953
|
-
}, void 0,
|
|
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
2954
|
if (s) try {
|
|
2955
|
-
await
|
|
2955
|
+
await oe.parseStream(s, e, {
|
|
2956
2956
|
xmlns: !1,
|
|
2957
2957
|
lean: !0
|
|
2958
2958
|
});
|
|
2959
2959
|
} catch (t) {
|
|
2960
2960
|
throw new Error(`Error parsing sheet: '${c}'`, { cause: t });
|
|
2961
2961
|
}
|
|
2962
|
-
const o =
|
|
2962
|
+
const o = ct(c, n);
|
|
2963
2963
|
if (o) {
|
|
2964
|
-
|
|
2964
|
+
ut(t, c, o, n);
|
|
2965
2965
|
const e = [];
|
|
2966
2966
|
o.forEach((t, s) => {
|
|
2967
2967
|
if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" !== t.type) return;
|
|
2968
|
-
const o =
|
|
2968
|
+
const o = dt(s, c, t.type, (t) => "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" !== t);
|
|
2969
2969
|
if (!o?.xml) return;
|
|
2970
2970
|
const r = /<pivotTableDefinition\b[^>]*>/.exec(o.xml)?.[0] ?? "", i = parseInt(/\scacheId="(\d+)"/.exec(r)?.[1] ?? "", 10);
|
|
2971
|
-
if (isNaN(i)) return void
|
|
2971
|
+
if (isNaN(i)) return void w.push([`Pivot table '${o.name}' names no cache and was dropped.`, c]);
|
|
2972
2972
|
const n = /\sname="([^"]*)"/.exec(r)?.[1];
|
|
2973
2973
|
e.push({
|
|
2974
|
-
...n ? { name:
|
|
2974
|
+
...n ? { name: C(n) } : {},
|
|
2975
2975
|
cacheId: i,
|
|
2976
2976
|
part: o
|
|
2977
2977
|
});
|
|
2978
2978
|
}), e.length > 0 && (t.pivotTables = e);
|
|
2979
2979
|
}
|
|
2980
2980
|
};
|
|
2981
|
-
|
|
2981
|
+
it.push(e());
|
|
2982
2982
|
} else if (a.type === o) {
|
|
2983
|
-
const s = e(c, t,
|
|
2983
|
+
const s = e(c, t, G, U, xt);
|
|
2984
2984
|
if (s && 0 !== Object.keys(s).length) {
|
|
2985
2985
|
const t = s, e = t.__bookRelId, o = t.__absoluteUrlRelId;
|
|
2986
2986
|
delete t.__bookRelId, delete t.__absoluteUrlRelId;
|
|
2987
2987
|
const r = [];
|
|
2988
|
-
|
|
2988
|
+
ct(c, n)?.forEach((t, s) => {
|
|
2989
2989
|
if ("External" === t.targetMode && t.type && t.target) {
|
|
2990
2990
|
const i = {
|
|
2991
2991
|
type: t.type,
|
|
@@ -2993,32 +2993,32 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
2993
2993
|
};
|
|
2994
2994
|
s === e ? i.role = "book" : s === o && (i.role = "absoluteUrl"), r.push(i);
|
|
2995
2995
|
}
|
|
2996
|
-
}), r.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), t.sources = r,
|
|
2996
|
+
}), r.sort((t, e) => ("book" === t.role ? 0 : 1) - ("book" === e.role ? 0 : 1)), t.sources = r, at(c), d = t;
|
|
2997
2997
|
} else d = null;
|
|
2998
2998
|
} else d = i ? h(c, t, (t, e) => {
|
|
2999
|
-
const s =
|
|
3000
|
-
return s.addReference(M),
|
|
3001
|
-
}, xt) : e(c, t,
|
|
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);
|
|
3002
3002
|
}
|
|
3003
3003
|
return d;
|
|
3004
|
-
},
|
|
3004
|
+
}, ht = (t, e) => {
|
|
3005
3005
|
if (!t) return null;
|
|
3006
|
-
const s =
|
|
3006
|
+
const s = ct(e, rt)?.get(t);
|
|
3007
3007
|
if (!s?.target || "External" === s.targetMode) return null;
|
|
3008
3008
|
let r = s.target;
|
|
3009
3009
|
return r.startsWith("/") || (r = e.substring(0, e.lastIndexOf("/") + 1) + r), o(r);
|
|
3010
|
-
},
|
|
3010
|
+
}, ut = (t, e, s, o) => {
|
|
3011
3011
|
const r = [], n = /* @__PURE__ */ new Map(), a = [];
|
|
3012
3012
|
s.forEach((t, s) => {
|
|
3013
3013
|
if ("http://schemas.microsoft.com/office/2017/10/relationships/threadedComment" !== t.type) return;
|
|
3014
|
-
const i =
|
|
3014
|
+
const i = lt(s, e, !1, o)?.comments;
|
|
3015
3015
|
if (!i) return;
|
|
3016
3016
|
for (let t = 0; t < i.length; t++) {
|
|
3017
3017
|
const e = i[t];
|
|
3018
3018
|
if (!e?.v?.id) continue;
|
|
3019
3019
|
const { parentId: s, done: o, content: c, ...l } = e.v, h = {
|
|
3020
3020
|
...l,
|
|
3021
|
-
content:
|
|
3021
|
+
content: Me(c)
|
|
3022
3022
|
};
|
|
3023
3023
|
s ? a.push({
|
|
3024
3024
|
parentId: s,
|
|
@@ -3028,8 +3028,8 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3028
3028
|
v: h
|
|
3029
3029
|
}));
|
|
3030
3030
|
}
|
|
3031
|
-
const c =
|
|
3032
|
-
c &&
|
|
3031
|
+
const c = ht(s, e);
|
|
3032
|
+
c && at(c);
|
|
3033
3033
|
});
|
|
3034
3034
|
for (let t = 0; t < a.length; t++) {
|
|
3035
3035
|
const { parentId: e, json: s } = a[t], o = n.get(e);
|
|
@@ -3038,7 +3038,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3038
3038
|
const c = [];
|
|
3039
3039
|
if (s.forEach((t, s) => {
|
|
3040
3040
|
if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" !== t.type) return;
|
|
3041
|
-
const r =
|
|
3041
|
+
const r = lt(s, e, !1, o), a = r?.comments;
|
|
3042
3042
|
if (!a) return;
|
|
3043
3043
|
const l = r?.authors;
|
|
3044
3044
|
for (let t = 0; t < a.length; t++) {
|
|
@@ -3050,7 +3050,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3050
3050
|
s = void 0;
|
|
3051
3051
|
}
|
|
3052
3052
|
const o = {
|
|
3053
|
-
id:
|
|
3053
|
+
id: W.uuidV4().toUpperCase(),
|
|
3054
3054
|
asNote: !0,
|
|
3055
3055
|
content: e.v.content ?? ""
|
|
3056
3056
|
}, r = s ? mt({ displayName: s }) : void 0;
|
|
@@ -3059,12 +3059,12 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3059
3059
|
v: o
|
|
3060
3060
|
});
|
|
3061
3061
|
}
|
|
3062
|
-
const h =
|
|
3063
|
-
h &&
|
|
3062
|
+
const h = ht(s, e);
|
|
3063
|
+
h && at(h);
|
|
3064
3064
|
}), 0 === r.length && 0 === c.length) return;
|
|
3065
3065
|
const l = [...r, ...c], h = t.legacyDrawing;
|
|
3066
3066
|
if (h?.xml) {
|
|
3067
|
-
const { rest: e, notes: s } =
|
|
3067
|
+
const { rest: e, notes: s } = R(h.xml);
|
|
3068
3068
|
if (s.length > 0) {
|
|
3069
3069
|
const o = /* @__PURE__ */ new Map();
|
|
3070
3070
|
for (let t = 0; t < s.length; t++) {
|
|
@@ -3076,56 +3076,76 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3076
3076
|
}
|
|
3077
3077
|
for (let t = 0; t < l.length; t++) {
|
|
3078
3078
|
const e = l[t], s = o.get(String(e.r).toUpperCase());
|
|
3079
|
-
|
|
3079
|
+
if (!s) continue;
|
|
3080
|
+
if (o.delete(String(e.r).toUpperCase()), !e.v.asNote) continue;
|
|
3081
|
+
const r = N(s.xml), i = {};
|
|
3082
|
+
if (r.anchor) {
|
|
3083
|
+
const [t, e, o, n, a, c, l, h] = r.anchor;
|
|
3084
|
+
i.anchor = {
|
|
3085
|
+
tl: {
|
|
3086
|
+
c: t - s.col,
|
|
3087
|
+
x: e,
|
|
3088
|
+
r: o - s.row,
|
|
3089
|
+
y: n
|
|
3090
|
+
},
|
|
3091
|
+
br: {
|
|
3092
|
+
c: a - s.col,
|
|
3093
|
+
x: c,
|
|
3094
|
+
r: l - s.row,
|
|
3095
|
+
y: h
|
|
3096
|
+
}
|
|
3097
|
+
};
|
|
3098
|
+
}
|
|
3099
|
+
r.xml && (i.xml = r.xml), (i.anchor || i.xml) && (e.v.box = i), r.visible && (e.v.shown = !0), r.alt && (e.v.description = r.alt);
|
|
3080
3100
|
}
|
|
3081
3101
|
const r = [];
|
|
3082
3102
|
o.forEach((t) => {
|
|
3083
3103
|
r.push(t.xml);
|
|
3084
3104
|
});
|
|
3085
|
-
const i =
|
|
3105
|
+
const i = V(e, r);
|
|
3086
3106
|
i ? h.xml = i : delete t.legacyDrawing;
|
|
3087
3107
|
}
|
|
3088
3108
|
}
|
|
3089
3109
|
t.comments = l;
|
|
3090
|
-
},
|
|
3091
|
-
const o =
|
|
3110
|
+
}, pt = (e, s) => {
|
|
3111
|
+
const o = ht(e, s);
|
|
3092
3112
|
if (!o) return null;
|
|
3093
|
-
const r = t(
|
|
3113
|
+
const r = t(je(o));
|
|
3094
3114
|
if (!r) return null;
|
|
3095
3115
|
const i = { xml: new TextDecoder("utf-8").decode(r.content) }, n = [];
|
|
3096
|
-
return
|
|
3116
|
+
return ct(o, rt)?.forEach((t, e) => {
|
|
3097
3117
|
if ("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" !== t.type) return;
|
|
3098
|
-
const s =
|
|
3118
|
+
const s = lt(e, o, !0);
|
|
3099
3119
|
"number" == typeof s && n.push({
|
|
3100
3120
|
id: e,
|
|
3101
3121
|
resId: s
|
|
3102
3122
|
});
|
|
3103
|
-
}), n.length > 0 && (i.images = n),
|
|
3104
|
-
},
|
|
3105
|
-
const n =
|
|
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);
|
|
3106
3126
|
if (!n || i.has(n)) return null;
|
|
3107
|
-
const c = o ??
|
|
3127
|
+
const c = o ?? ct(s, rt)?.get(e)?.type;
|
|
3108
3128
|
if (!c) return null;
|
|
3109
|
-
const l = t(
|
|
3129
|
+
const l = t(je(n));
|
|
3110
3130
|
if (!l) return null;
|
|
3111
3131
|
i.add(n);
|
|
3112
|
-
const h = n.substring(n.lastIndexOf("/") + 1), u = a.overrides[
|
|
3132
|
+
const h = n.substring(n.lastIndexOf("/") + 1), u = a.overrides[je(n)] ?? a.defaults[h.substring(h.lastIndexOf(".") + 1).toLowerCase()], p = {
|
|
3113
3133
|
id: e,
|
|
3114
3134
|
type: c,
|
|
3115
3135
|
name: h
|
|
3116
3136
|
};
|
|
3117
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);
|
|
3118
3138
|
else {
|
|
3119
|
-
const t =
|
|
3139
|
+
const t = lt(e, s, !0);
|
|
3120
3140
|
if ("number" != typeof t) return null;
|
|
3121
3141
|
p.resId = t;
|
|
3122
3142
|
}
|
|
3123
3143
|
const d = [];
|
|
3124
|
-
return
|
|
3144
|
+
return ct(n, rt)?.forEach((t, e) => {
|
|
3125
3145
|
if (!t?.type) return;
|
|
3126
3146
|
if (r && !r(t.type)) return;
|
|
3127
3147
|
if ("External" === t.targetMode) {
|
|
3128
|
-
const s =
|
|
3148
|
+
const s = lt(e, n, !0);
|
|
3129
3149
|
"number" == typeof s && d.push({
|
|
3130
3150
|
id: e,
|
|
3131
3151
|
type: t.type,
|
|
@@ -3133,118 +3153,98 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3133
3153
|
});
|
|
3134
3154
|
return;
|
|
3135
3155
|
}
|
|
3136
|
-
const s =
|
|
3156
|
+
const s = dt(e, n, t.type, r, i);
|
|
3137
3157
|
s && d.push(s);
|
|
3138
|
-
}), d.length > 0 && (p.parts = d),
|
|
3158
|
+
}), d.length > 0 && (p.parts = d), at(n), p;
|
|
3139
3159
|
};
|
|
3140
|
-
s("coreprops", a, t,
|
|
3141
|
-
const
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
if (gt = e?.persons, it(t), gt) {
|
|
3146
|
-
const t = gt.length;
|
|
3147
|
-
for (let e = 0; e < t; e++) {
|
|
3148
|
-
const t = gt[e];
|
|
3149
|
-
pt.set(t.id, t), void 0 !== t.displayName && dt.set(t.displayName, t);
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
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);
|
|
3152
3165
|
}
|
|
3153
3166
|
const mt = (t) => {
|
|
3154
|
-
if (
|
|
3155
|
-
if (t.id && pt.has(t.id)) return pt.get(t.id);
|
|
3156
|
-
let e = t.displayName;
|
|
3157
|
-
if (!t.id) {
|
|
3158
|
-
if (e) {
|
|
3159
|
-
const t = dt.get(e);
|
|
3160
|
-
if (t) return t;
|
|
3161
|
-
}
|
|
3162
|
-
t.id = F.uuidV4();
|
|
3163
|
-
}
|
|
3164
|
-
const s = pt.get(t.id);
|
|
3165
|
-
if (s) return s;
|
|
3166
|
-
const o = t;
|
|
3167
|
-
return pt.set(t.id, o), e && dt.set(e, o), gt || (gt = []), gt.push(o), o;
|
|
3167
|
+
if (t) return ft.add(t).toJSON();
|
|
3168
3168
|
}, xt = {
|
|
3169
|
-
paramMap:
|
|
3170
|
-
getRefs:
|
|
3171
|
-
getRef:
|
|
3172
|
-
parsedRefs:
|
|
3173
|
-
readEmbeddedPart: (t, e) =>
|
|
3169
|
+
paramMap: K,
|
|
3170
|
+
getRefs: ct,
|
|
3171
|
+
getRef: lt,
|
|
3172
|
+
parsedRefs: rt,
|
|
3173
|
+
readEmbeddedPart: (t, e) => dt(t, e),
|
|
3174
3174
|
addPerson: mt,
|
|
3175
3175
|
serializeElement: Z,
|
|
3176
|
-
onWarning:
|
|
3177
|
-
},
|
|
3176
|
+
onWarning: k
|
|
3177
|
+
}, bt = [];
|
|
3178
3178
|
if (c) {
|
|
3179
|
-
const t = await
|
|
3179
|
+
const t = await st.getTextStream(c, j);
|
|
3180
3180
|
if (t) {
|
|
3181
3181
|
const e = ((t, e) => {
|
|
3182
3182
|
let s = !1, o = !1, r = 0, i = "";
|
|
3183
3183
|
return {
|
|
3184
3184
|
onOpenTag: (t) => {
|
|
3185
|
-
const e =
|
|
3185
|
+
const e = $e(t.name);
|
|
3186
3186
|
"t" === e ? s && 0 === r && (o = !0) : "si" === e ? (s = !0, i = "", r = 0) : "rPh" !== e && "phoneticPr" !== e || r++;
|
|
3187
3187
|
},
|
|
3188
3188
|
onText: (t) => {
|
|
3189
3189
|
o && (i += t);
|
|
3190
3190
|
},
|
|
3191
3191
|
onCloseTag: (e) => {
|
|
3192
|
-
const n =
|
|
3193
|
-
"t" === n ? o = !1 : "si" === n ? (t(
|
|
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--;
|
|
3194
3194
|
},
|
|
3195
3195
|
onError: (t) => {
|
|
3196
3196
|
e?.(`Error parsing shared strings: ${t?.message ?? t}`);
|
|
3197
3197
|
}
|
|
3198
3198
|
};
|
|
3199
3199
|
})((t) => {
|
|
3200
|
-
|
|
3200
|
+
bt.push(t);
|
|
3201
3201
|
}, (t) => {
|
|
3202
|
-
|
|
3202
|
+
k(t, c);
|
|
3203
3203
|
});
|
|
3204
3204
|
try {
|
|
3205
|
-
await
|
|
3205
|
+
await oe.parseStream(t, e, { xmlns: !1 });
|
|
3206
3206
|
} catch (t) {
|
|
3207
3207
|
throw new Error(`Error parsing shared strings: '${c}'`, { cause: t });
|
|
3208
3208
|
}
|
|
3209
3209
|
}
|
|
3210
3210
|
}
|
|
3211
|
-
|
|
3212
|
-
let
|
|
3211
|
+
b?.mark("shared-strings");
|
|
3212
|
+
let yt = bt.length;
|
|
3213
3213
|
const Tt = /* @__PURE__ */ new Map();
|
|
3214
|
-
let vt =
|
|
3214
|
+
let vt = yt;
|
|
3215
3215
|
const wt = (t) => {
|
|
3216
3216
|
const e = Tt.get(t);
|
|
3217
3217
|
if (void 0 !== e) return e;
|
|
3218
3218
|
const s = vt;
|
|
3219
|
-
return Tt.set(t, vt++),
|
|
3219
|
+
return Tt.set(t, vt++), bt.push(t), s;
|
|
3220
3220
|
}, St = [];
|
|
3221
3221
|
a.slicersCache = St;
|
|
3222
|
-
const Ct =
|
|
3222
|
+
const Ct = st.getNames(), kt = Ct.length;
|
|
3223
3223
|
for (let t = 0; t < kt; t++) {
|
|
3224
3224
|
const e = Ct[t];
|
|
3225
3225
|
e && e.startsWith("xl/slicerCache") && St.push(`/${e}`);
|
|
3226
3226
|
}
|
|
3227
|
-
const At = s("slicersCache", a, t,
|
|
3227
|
+
const At = s("slicersCache", a, t, G, U, xt), Ot = /* @__PURE__ */ new Map();
|
|
3228
3228
|
At.forEach((t) => {
|
|
3229
3229
|
const e = t.name;
|
|
3230
3230
|
delete t.name, Ot.set(e, t);
|
|
3231
|
-
}),
|
|
3232
|
-
const Et = s("themes", a, 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
3233
|
let Pt = null;
|
|
3234
3234
|
if (Et && Et.entries) {
|
|
3235
3235
|
let t = Et.entries().next();
|
|
3236
3236
|
t?.value?.[1] && (Pt = t.value[1]);
|
|
3237
3237
|
}
|
|
3238
|
-
const It = new
|
|
3239
|
-
let Dt = s("styles", a, t,
|
|
3240
|
-
Dt && (Dt = JSON.parse(
|
|
3241
|
-
const _t = s("workbooks", a, t,
|
|
3242
|
-
|
|
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);
|
|
3243
3243
|
{
|
|
3244
|
-
const t = _t.entries().next().value?.[1], e =
|
|
3244
|
+
const t = _t.entries().next().value?.[1], e = y(t?.names), s = t?.sheets ?? [];
|
|
3245
3245
|
for (let t = 0; t < s.length; t++) {
|
|
3246
3246
|
const o = s[t]?.sheet;
|
|
3247
|
-
o &&
|
|
3247
|
+
o && S(o, e);
|
|
3248
3248
|
}
|
|
3249
3249
|
const o = t?.names;
|
|
3250
3250
|
if (o) for (let t = 0; t < o.length; t++) {
|
|
@@ -3252,19 +3252,21 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3252
3252
|
"string" == typeof s && (o[t].ref = e.readDetached(s));
|
|
3253
3253
|
}
|
|
3254
3254
|
}
|
|
3255
|
-
|
|
3255
|
+
I && _ > 0 && (I(D, D), await new Promise((t) => setTimeout(t, 0))), b?.mark("sheets");
|
|
3256
3256
|
const Vt = {
|
|
3257
3257
|
..._t.entries().next().value?.[1],
|
|
3258
3258
|
styles: Dt,
|
|
3259
3259
|
theme: It.toJSON()
|
|
3260
3260
|
};
|
|
3261
|
-
n(Vt,
|
|
3261
|
+
n(Vt, K.get(l)), Vt.calc = {
|
|
3262
3262
|
...Vt.calc ?? {},
|
|
3263
3263
|
legacyIntersect: !0
|
|
3264
|
-
},
|
|
3265
|
-
const Lt =
|
|
3266
|
-
|
|
3267
|
-
|
|
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("./ZWSOYqmTKEmEOz2u.mjs"), e = t.extract(Nt);
|
|
3268
3270
|
if (e) {
|
|
3269
3271
|
const s = /* @__PURE__ */ new Map();
|
|
3270
3272
|
for (const t of Vt.sheets ?? []) {
|
|
@@ -3280,19 +3282,19 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3280
3282
|
a[o.name] || (a[o.name] = e);
|
|
3281
3283
|
}
|
|
3282
3284
|
u?.(e);
|
|
3283
|
-
} else
|
|
3285
|
+
} else w.push(["Unable to parse VBA project.", "xl/vbaProject.bin"]);
|
|
3284
3286
|
} catch (t) {
|
|
3285
|
-
|
|
3287
|
+
w.push([`Error extracting VBA: ${t?.message ?? t}`, "xl/vbaProject.bin"]);
|
|
3286
3288
|
}
|
|
3287
|
-
const
|
|
3288
|
-
...
|
|
3289
|
-
calcOnLoad:
|
|
3290
|
-
resources:
|
|
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: $,
|
|
3291
3293
|
json: Vt
|
|
3292
3294
|
};
|
|
3293
|
-
void 0 ===
|
|
3294
|
-
const Mt = new
|
|
3295
|
-
if (
|
|
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) {
|
|
3296
3298
|
await Mt.whenCalculationReady();
|
|
3297
3299
|
const t = /* @__PURE__ */ new Map(), e = Vt.sheets ?? [], s = Mt.getSheets().getItems();
|
|
3298
3300
|
for (let o = 0; o < e.length; o++) {
|
|
@@ -3316,7 +3318,7 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3316
3318
|
for (const t of e) null === t.formula && n.add(r(t.rowIndex, t.colIndex));
|
|
3317
3319
|
for (const t of e) {
|
|
3318
3320
|
if (null === t.formula) continue;
|
|
3319
|
-
const e =
|
|
3321
|
+
const e = Ee(t.formula);
|
|
3320
3322
|
let s = !0;
|
|
3321
3323
|
for (const t of e) if (!i(t)) {
|
|
3322
3324
|
s = !1;
|
|
@@ -3350,20 +3352,20 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3350
3352
|
}).setValue("=" + t.formula);
|
|
3351
3353
|
}
|
|
3352
3354
|
}
|
|
3353
|
-
})(Mt,
|
|
3355
|
+
})(Mt, J, t);
|
|
3354
3356
|
}
|
|
3355
|
-
if (
|
|
3357
|
+
if (q.forEach((t) => {
|
|
3356
3358
|
t.deleteReference(M);
|
|
3357
|
-
}),
|
|
3358
|
-
|
|
3359
|
+
}), B.endPersist(), x) {
|
|
3360
|
+
v(Mt);
|
|
3359
3361
|
const t = /* @__PURE__ */ new Map();
|
|
3360
3362
|
let e = 0;
|
|
3361
|
-
for (const s of
|
|
3362
|
-
const o =
|
|
3363
|
+
for (const s of st.getNames()) {
|
|
3364
|
+
const o = st.getEntry(s);
|
|
3363
3365
|
if (!o) continue;
|
|
3364
|
-
const r =
|
|
3366
|
+
const r = st.getRawEntry(s), i = r ? {
|
|
3365
3367
|
data: o,
|
|
3366
|
-
uncompressedSize:
|
|
3368
|
+
uncompressedSize: st.uncompressedSize(s),
|
|
3367
3369
|
raw: {
|
|
3368
3370
|
compressedData: r.data,
|
|
3369
3371
|
compressionMethod: r.compressionMethod,
|
|
@@ -3371,14 +3373,14 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3371
3373
|
}
|
|
3372
3374
|
} : {
|
|
3373
3375
|
data: o,
|
|
3374
|
-
uncompressedSize:
|
|
3376
|
+
uncompressedSize: st.uncompressedSize(s)
|
|
3375
3377
|
};
|
|
3376
3378
|
t.set(s, i), e += o.byteLength;
|
|
3377
3379
|
}
|
|
3378
|
-
if (e > 67108864)
|
|
3380
|
+
if (e > 67108864) w.push([`Source package too large to retain (${e} bytes, limit ${L}); unmodeled parts will be dropped on save.`, "SourcePackage"]);
|
|
3379
3381
|
else if (t.size > 0) {
|
|
3380
|
-
const e = new T(t,
|
|
3381
|
-
|
|
3382
|
+
const e = new T(t, nt);
|
|
3383
|
+
g(Mt, e);
|
|
3382
3384
|
let s = Mt.getSheets().getItems();
|
|
3383
3385
|
const o = Mt.getTransactions().addListener({ onCommitEnd: (t) => {
|
|
3384
3386
|
const s = t.getOperation()?.name;
|
|
@@ -3388,23 +3390,23 @@ var de = (t) => !0 === t || "1" === t || "on" === t || "true" === t || !1 !== t
|
|
|
3388
3390
|
(t.length !== s.length || t.some((t, e) => t !== s[e])) && e.markStructuralChange(), s = t;
|
|
3389
3391
|
} });
|
|
3390
3392
|
Mt.addListeners({ onClose: () => {
|
|
3391
|
-
o(), r(),
|
|
3393
|
+
o(), r(), v(Mt);
|
|
3392
3394
|
} });
|
|
3393
3395
|
}
|
|
3394
3396
|
}
|
|
3395
|
-
if (
|
|
3397
|
+
if (w.length && P?.onWarning) {
|
|
3396
3398
|
const t = /* @__PURE__ */ new Set();
|
|
3397
|
-
for (const e of
|
|
3399
|
+
for (const e of w) {
|
|
3398
3400
|
const [s, o, r] = e, i = r ?? s;
|
|
3399
|
-
t.has(i) || (t.add(i),
|
|
3401
|
+
t.has(i) || (t.add(i), P.onWarning(s, o));
|
|
3400
3402
|
}
|
|
3401
3403
|
}
|
|
3402
|
-
return
|
|
3404
|
+
return b && !0 === p && console.table(b.toTable()), Mt;
|
|
3403
3405
|
} catch (t) {
|
|
3404
3406
|
let e = "Unable to parse XLSX.";
|
|
3405
|
-
throw t instanceof
|
|
3407
|
+
throw t instanceof Q && (e = "Unable to open XLSX. There are too many rows or columns."), new Error(e, { cause: t });
|
|
3406
3408
|
} finally {
|
|
3407
|
-
await
|
|
3409
|
+
await st.close().catch(() => {});
|
|
3408
3410
|
}
|
|
3409
3411
|
};
|
|
3410
|
-
export {
|
|
3412
|
+
export { He as readXLSX };
|