@sheetxl/scripting 0.8.0-beta.11 → 0.8.0-beta.12
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/esm/{_cUijEyyZifD_LZf.mjs → B1fOG8aTlcVjAako.mjs} +1 -1
- package/browser/esm/{CV6NN6Ju5xBT1o6B.mjs → CG8cKOROEp3veyFv.mjs} +1448 -1445
- package/{node/esm/Cgbq_-KJhRYkRJw-.mjs → browser/esm/CUERvTrIURHqOWKm.mjs} +281 -282
- package/browser/esm/{BPtHkO7z1Di3YIjV.mjs → CwhaPB7R93eqixfq.mjs} +2 -2
- package/browser/esm/DfSFyaySrD6y1NJY.mjs +17 -0
- package/browser/esm/index.mjs +3 -3
- package/node/esm/{C8P-wHdBmweFS0Ex.mjs → 2OiXgLd8VwO6IeDg.mjs} +1 -1
- package/node/esm/{ByvsA4Gi2N_jmjO4.mjs → BDIcVjo-h3KFdXXo.mjs} +1 -1
- package/node/esm/BLO91PRuOQIsW_Ow.mjs +580 -0
- package/node/esm/index.mjs +9 -9
- package/node/esm/{CLpM4kzEeZk_kWj4.mjs → oWHIRxwwLexnOwAn.mjs} +1 -1
- package/package.json +3 -3
- package/types/src/type/Diagnostic.d.ts +0 -2
- package/browser/esm/B73J41HhbJvswDz1.mjs +0 -17
- package/browser/esm/Cg2-n5X_c3X8uPPp.mjs +0 -581
|
@@ -7,8 +7,8 @@ var c = class {
|
|
|
7
7
|
return this._worker || (this._worker = this._workerFactory(), this._worker.onmessage = (t) => {
|
|
8
8
|
const { id: n, result: e, error: r } = t.data, o = this._pendingRequests.get(n);
|
|
9
9
|
if (o) if (this._pendingRequests.delete(n), r) {
|
|
10
|
-
const
|
|
11
|
-
|
|
10
|
+
const a = new Error(r.message);
|
|
11
|
+
a.stack = r.stack, r.cause && (a.cause = r.cause), o.reject(a);
|
|
12
12
|
} else o.resolve(e);
|
|
13
13
|
}, this._worker.onerror = (t) => {
|
|
14
14
|
console.error("Worker error:", t), this._pendingRequests.forEach((n) => {
|
|
@@ -38,46 +38,46 @@ var c = class {
|
|
|
38
38
|
}
|
|
39
39
|
terminate() {
|
|
40
40
|
}
|
|
41
|
-
}, s = `var
|
|
41
|
+
}, s = `var Et = Object.defineProperty, rr = (e, t, r) => () => {
|
|
42
42
|
if (r) throw r[0];
|
|
43
43
|
try {
|
|
44
44
|
return e && (t = e(e = 0)), t;
|
|
45
45
|
} catch (n) {
|
|
46
46
|
throw r = [n], n;
|
|
47
47
|
}
|
|
48
|
-
},
|
|
48
|
+
}, nr = (e, t) => {
|
|
49
49
|
let r = {};
|
|
50
|
-
for (var n in e)
|
|
50
|
+
for (var n in e) Et(r, n, {
|
|
51
51
|
get: e[n],
|
|
52
52
|
enumerable: !0
|
|
53
53
|
});
|
|
54
|
-
return t ||
|
|
55
|
-
},
|
|
54
|
+
return t || Et(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
55
|
+
}, _t = Object.defineProperty, ge = (e, t) => {
|
|
56
56
|
let r = {};
|
|
57
|
-
for (var n in e)
|
|
57
|
+
for (var n in e) _t(r, n, {
|
|
58
58
|
get: e[n],
|
|
59
59
|
enumerable: !0
|
|
60
60
|
});
|
|
61
|
-
return t ||
|
|
62
|
-
},
|
|
61
|
+
return t || _t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
62
|
+
}, ie = {
|
|
63
63
|
Column: "column",
|
|
64
64
|
Row: "row"
|
|
65
65
|
};
|
|
66
|
-
({ ...
|
|
67
|
-
function
|
|
66
|
+
({ ...ie });
|
|
67
|
+
function Ge(e, t) {
|
|
68
68
|
if (e === t) return !0;
|
|
69
69
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
70
70
|
if (e.constructor !== t.constructor) return !1;
|
|
71
|
-
let r, n,
|
|
71
|
+
let r, n, o;
|
|
72
72
|
if (Array.isArray(e)) {
|
|
73
73
|
if (r = e.length, r != t.length) return !1;
|
|
74
|
-
for (n = r; n-- !== 0;) if (!
|
|
74
|
+
for (n = r; n-- !== 0;) if (!Ge(e[n], t[n])) return !1;
|
|
75
75
|
return !0;
|
|
76
76
|
}
|
|
77
77
|
if (e instanceof Map && t instanceof Map) {
|
|
78
78
|
if (e.size !== t.size) return !1;
|
|
79
79
|
for (n of e.entries()) if (!t.has(n[0])) return !1;
|
|
80
|
-
for (n of e.entries()) if (!
|
|
80
|
+
for (n of e.entries()) if (!Ge(n[1], t.get(n[0]))) return !1;
|
|
81
81
|
return !0;
|
|
82
82
|
}
|
|
83
83
|
if (e instanceof Set && t instanceof Set) {
|
|
@@ -93,131 +93,131 @@ function ze(e, t) {
|
|
|
93
93
|
if (e.constructor === RegExp) return e.source === t.source && e.flags === t.flags;
|
|
94
94
|
if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === t.valueOf();
|
|
95
95
|
if (e.toString !== Object.prototype.toString) return e.toString() === t.toString();
|
|
96
|
-
if (
|
|
97
|
-
for (n = r; n-- !== 0;) if (!Object.prototype.hasOwnProperty.call(t,
|
|
96
|
+
if (o = Object.keys(e), r = o.length, r !== Object.keys(t).length) return !1;
|
|
97
|
+
for (n = r; n-- !== 0;) if (!Object.prototype.hasOwnProperty.call(t, o[n])) return !1;
|
|
98
98
|
for (n = r; n-- !== 0;) {
|
|
99
|
-
let
|
|
100
|
-
if ((
|
|
99
|
+
let i = o[n];
|
|
100
|
+
if ((i !== "_owner" || !e.$$typeof) && !Ge(e[i], t[i])) return !1;
|
|
101
101
|
}
|
|
102
102
|
return !0;
|
|
103
103
|
}
|
|
104
104
|
return e != e && t != t;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function ln(e) {
|
|
107
107
|
let t = Object.prototype.toString.call(e);
|
|
108
108
|
return t === "[object RegExp]" || t === "[object Date]" || (function(r) {
|
|
109
|
-
return r.$$typeof ===
|
|
109
|
+
return r.$$typeof === sn;
|
|
110
110
|
})(e);
|
|
111
111
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
112
|
+
var sn = typeof Symbol == "function" && Symbol.for ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
113
|
+
function cn(e) {
|
|
114
114
|
return /* @__PURE__ */ (function(t) {
|
|
115
115
|
return !!t && typeof t == "object";
|
|
116
|
-
})(e) && !
|
|
116
|
+
})(e) && !ln(e);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
return t.clone !== !1 && t.isMergeableObject(e) ?
|
|
118
|
+
function Oe(e, t) {
|
|
119
|
+
return t.clone !== !1 && t.isMergeableObject(e) ? Ee((r = e, Array.isArray(r) ? [] : {}), e, t) : e;
|
|
120
120
|
var r;
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function un(e, t, r) {
|
|
123
123
|
return e.concat(t).map(function(n) {
|
|
124
|
-
return
|
|
124
|
+
return Oe(n, r);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function xt(e) {
|
|
128
128
|
return Object.keys(e).concat((function(t) {
|
|
129
129
|
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
|
|
130
130
|
return Object.propertyIsEnumerable.call(t, r);
|
|
131
131
|
}) : [];
|
|
132
132
|
})(e));
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function Tt(e, t) {
|
|
135
135
|
try {
|
|
136
136
|
return t in e;
|
|
137
137
|
} catch {
|
|
138
138
|
return !1;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function dn(e, t, r) {
|
|
142
142
|
let n = {};
|
|
143
|
-
return r.isMergeableObject(e) &&
|
|
144
|
-
n[
|
|
145
|
-
}),
|
|
146
|
-
(function(
|
|
147
|
-
return
|
|
148
|
-
})(e,
|
|
149
|
-
if (!l.customMerge) return
|
|
150
|
-
let s = l.customMerge(
|
|
151
|
-
return typeof s == "function" ? s :
|
|
152
|
-
})(
|
|
143
|
+
return r.isMergeableObject(e) && xt(e).forEach(function(o) {
|
|
144
|
+
n[o] = Oe(e[o], r);
|
|
145
|
+
}), xt(t).forEach(function(o) {
|
|
146
|
+
(function(i, l) {
|
|
147
|
+
return Tt(i, l) && !(Object.hasOwnProperty.call(i, l) && Object.propertyIsEnumerable.call(i, l));
|
|
148
|
+
})(e, o) || (Tt(e, o) && r.isMergeableObject(t[o]) ? n[o] = (function(i, l) {
|
|
149
|
+
if (!l.customMerge) return Ee;
|
|
150
|
+
let s = l.customMerge(i);
|
|
151
|
+
return typeof s == "function" ? s : Ee;
|
|
152
|
+
})(o, r)(e[o], t[o], r) : n[o] = Oe(t[o], r));
|
|
153
153
|
}), n;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
(r ||= {}).arrayMerge = r.arrayMerge ||
|
|
155
|
+
function Ee(e, t, r) {
|
|
156
|
+
(r ||= {}).arrayMerge = r.arrayMerge || un, r.isMergeableObject = r.isMergeableObject || cn, r.cloneUnlessOtherwiseSpecified = Oe;
|
|
157
157
|
let n = Array.isArray(t);
|
|
158
|
-
return n === Array.isArray(e) ? n ? r.arrayMerge(e, t, r) :
|
|
158
|
+
return n === Array.isArray(e) ? n ? r.arrayMerge(e, t, r) : dn(e, t, r) : Oe(t, r);
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
Ee.all = function(e, t) {
|
|
161
161
|
if (!Array.isArray(e)) throw Error("first argument should be an array");
|
|
162
162
|
return e.reduce(function(r, n) {
|
|
163
|
-
return
|
|
163
|
+
return Ee(r, n, t);
|
|
164
164
|
}, {});
|
|
165
165
|
};
|
|
166
|
-
var
|
|
167
|
-
DonePromise: () =>
|
|
168
|
-
EmptyArray: () =>
|
|
169
|
-
EmptyObject: () =>
|
|
170
|
-
OSType: () =>
|
|
171
|
-
arrayMove: () =>
|
|
172
|
-
asNumber: () =>
|
|
173
|
-
camelToPrettyCase: () =>
|
|
174
|
-
castToString: () =>
|
|
175
|
-
cloneObject: () =>
|
|
176
|
-
consoleWithNoSource: () =>
|
|
177
|
-
deepEqual: () =>
|
|
178
|
-
deepFreeze: () =>
|
|
179
|
-
deepMerge: () =>
|
|
180
|
-
diffValues: () =>
|
|
181
|
-
findEqualOrGreater: () =>
|
|
182
|
-
findEqualOrLesser: () =>
|
|
166
|
+
var or = ge({
|
|
167
|
+
DonePromise: () => pn,
|
|
168
|
+
EmptyArray: () => De,
|
|
169
|
+
EmptyObject: () => fn,
|
|
170
|
+
OSType: () => pe,
|
|
171
|
+
arrayMove: () => $n,
|
|
172
|
+
asNumber: () => yn,
|
|
173
|
+
camelToPrettyCase: () => hn,
|
|
174
|
+
castToString: () => Nn,
|
|
175
|
+
cloneObject: () => vn,
|
|
176
|
+
consoleWithNoSource: () => Bn,
|
|
177
|
+
deepEqual: () => Ge,
|
|
178
|
+
deepFreeze: () => pr,
|
|
179
|
+
deepMerge: () => Ee,
|
|
180
|
+
diffValues: () => In,
|
|
181
|
+
findEqualOrGreater: () => An,
|
|
182
|
+
findEqualOrLesser: () => Rn,
|
|
183
183
|
getFromPath: () => Fn,
|
|
184
|
-
getPlatform: () =>
|
|
185
|
-
isDefined: () =>
|
|
184
|
+
getPlatform: () => Ye,
|
|
185
|
+
isDefined: () => kn,
|
|
186
186
|
isEmpty: () => Ln,
|
|
187
|
-
isEqualArrays: () =>
|
|
188
|
-
isEqualBounds: () =>
|
|
189
|
-
isNullOrUndefined: () =>
|
|
190
|
-
isNumeric: () =>
|
|
191
|
-
isObject: () =>
|
|
192
|
-
isPromiseLike: () =>
|
|
193
|
-
isRectInsideRect: () =>
|
|
194
|
-
isRectIntersect: () =>
|
|
195
|
-
mergeContentful: () =>
|
|
196
|
-
removeEmptyProperties: () =>
|
|
197
|
-
removeEqualValues: () =>
|
|
198
|
-
removeEqualValuesLayered: () =>
|
|
199
|
-
removeListenerAll: () =>
|
|
200
|
-
roundAccurately: () =>
|
|
201
|
-
setToPath: () =>
|
|
202
|
-
splitNumber: () =>
|
|
203
|
-
subtractRect: () =>
|
|
204
|
-
textToKey: () =>
|
|
205
|
-
toSafeJSON: () =>
|
|
206
|
-
transpose: () =>
|
|
207
|
-
uuidV4: () =>
|
|
208
|
-
validEnumValue: () =>
|
|
209
|
-
}),
|
|
210
|
-
function
|
|
187
|
+
isEqualArrays: () => ar,
|
|
188
|
+
isEqualBounds: () => _n,
|
|
189
|
+
isNullOrUndefined: () => dr,
|
|
190
|
+
isNumeric: () => wn,
|
|
191
|
+
isObject: () => Fe,
|
|
192
|
+
isPromiseLike: () => Mn,
|
|
193
|
+
isRectInsideRect: () => On,
|
|
194
|
+
isRectIntersect: () => fr,
|
|
195
|
+
mergeContentful: () => Cn,
|
|
196
|
+
removeEmptyProperties: () => lr,
|
|
197
|
+
removeEqualValues: () => cr,
|
|
198
|
+
removeEqualValuesLayered: () => ur,
|
|
199
|
+
removeListenerAll: () => xn,
|
|
200
|
+
roundAccurately: () => bn,
|
|
201
|
+
setToPath: () => Un,
|
|
202
|
+
splitNumber: () => Sn,
|
|
203
|
+
subtractRect: () => Dn,
|
|
204
|
+
textToKey: () => gn,
|
|
205
|
+
toSafeJSON: () => ut,
|
|
206
|
+
transpose: () => Tn,
|
|
207
|
+
uuidV4: () => He,
|
|
208
|
+
validEnumValue: () => mn
|
|
209
|
+
}), De = Object.freeze([]), fn = Object.freeze({}), pn = Promise.resolve(), ir = (e) => e;
|
|
210
|
+
function mn(e, t) {
|
|
211
211
|
if (!Object.values(e).includes(t)) throw Error(\`Invalid type: \${t ?? "null"}. Must be one of: \${Object.values(e).join(", ")}.\`);
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function hn(e) {
|
|
214
214
|
return e ? e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/^./, (t) => t.toUpperCase()) : "";
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function gn(e) {
|
|
217
217
|
return e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
218
218
|
}
|
|
219
219
|
var le = Array.from({ length: 256 }, (e, t) => (t + 256).toString(16).slice(1));
|
|
220
|
-
function
|
|
220
|
+
function He() {
|
|
221
221
|
let e = globalThis.crypto;
|
|
222
222
|
if (e?.randomUUID) return e.randomUUID();
|
|
223
223
|
if (e?.getRandomValues) {
|
|
@@ -229,17 +229,17 @@ function Ve() {
|
|
|
229
229
|
return (t === "x" ? r : 3 & r | 8).toString(16);
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function yn(e) {
|
|
233
233
|
let t = (function(r) {
|
|
234
234
|
return 1 * r;
|
|
235
235
|
})(e);
|
|
236
236
|
return Number.isFinite(t) ? t : 0;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function wn(e) {
|
|
239
239
|
let t = 1 * e;
|
|
240
240
|
return Number.isFinite(t) && typeof t == "number";
|
|
241
241
|
}
|
|
242
|
-
var
|
|
242
|
+
var Qe = [
|
|
243
243
|
1,
|
|
244
244
|
10,
|
|
245
245
|
100,
|
|
@@ -258,233 +258,233 @@ var qe = [
|
|
|
258
258
|
0x38d7ea4c68000,
|
|
259
259
|
0x2386f26fc10000
|
|
260
260
|
];
|
|
261
|
-
function
|
|
261
|
+
function Sn(e) {
|
|
262
262
|
let t = Math.abs(e);
|
|
263
263
|
if (!Number.isFinite(t)) return null;
|
|
264
|
-
let r = Math.trunc(t), n = t - r,
|
|
265
|
-
r > 2 ** 53 - 1 ?
|
|
266
|
-
let
|
|
264
|
+
let r = Math.trunc(t), n = t - r, o;
|
|
265
|
+
r > 2 ** 53 - 1 ? o = Number(r.toExponential().split("e")[1]) + 1 : (o = Math.ceil(Math.log10(r + 1)), Qe[o] <= r && o++);
|
|
266
|
+
let i = 0, l = 0, s = 15 - o;
|
|
267
267
|
if (n > 0 && s > 0) {
|
|
268
|
-
let c =
|
|
269
|
-
if (
|
|
270
|
-
else if (
|
|
268
|
+
let c = Qe[s];
|
|
269
|
+
if (i = Math.round(n * c), i === c) r++, i = 0, r >= Qe[o] && o++;
|
|
270
|
+
else if (i > 0) for (l = s; i % 10 == 0;) i /= 10, l--;
|
|
271
271
|
}
|
|
272
272
|
return {
|
|
273
273
|
ip: e < 0 ? -r : r,
|
|
274
|
-
fp:
|
|
275
|
-
ipLength:
|
|
274
|
+
fp: i,
|
|
275
|
+
ipLength: o,
|
|
276
276
|
fpLength: l
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function bn(e, t = 0) {
|
|
280
280
|
if (e == null || !isFinite(e)) return null;
|
|
281
281
|
let r = 10 ** t;
|
|
282
282
|
return Number(Math.round(e * r) / r);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
285
|
-
return
|
|
284
|
+
function vn(e) {
|
|
285
|
+
return dr(e) ? e : JSON.parse(JSON.stringify(e));
|
|
286
286
|
}
|
|
287
|
-
var
|
|
288
|
-
function
|
|
287
|
+
var En = (e, t) => e === t;
|
|
288
|
+
function ar(e, t, r) {
|
|
289
289
|
if (e === t) return !0;
|
|
290
290
|
if (!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) return !1;
|
|
291
|
-
r ||=
|
|
291
|
+
r ||= En;
|
|
292
292
|
let n = e.length;
|
|
293
|
-
for (let
|
|
293
|
+
for (let o = 0; o < n; o++) if (!r(e[o], t[o])) return !1;
|
|
294
294
|
return !0;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function _n(e, t) {
|
|
297
297
|
return e === t || !(!e || !t) && e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Fe(e) {
|
|
300
300
|
return typeof e == "object" && !Array.isArray(e) && e !== null;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function lr(e) {
|
|
303
303
|
if (typeof e != "object" || Array.isArray(e) || e === null) return e;
|
|
304
304
|
let t = e;
|
|
305
305
|
return Object.keys(t).forEach(function(r) {
|
|
306
|
-
t[r] && typeof t[r] == "object" ?
|
|
306
|
+
t[r] && typeof t[r] == "object" ? lr(t[r]) : t[r] !== null && t[r] !== void 0 || delete t[r], typeof t[r] == "object" && Object.keys(t[r]).length === 0 && delete t[r];
|
|
307
307
|
}), Object.keys(e).length === 0 ? null : e;
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
if (!e) return
|
|
309
|
+
function xn(e, t) {
|
|
310
|
+
if (!e) return De;
|
|
311
311
|
let r = e.length;
|
|
312
312
|
for (let n = 0; n < r; n++) {
|
|
313
|
-
let
|
|
314
|
-
|
|
313
|
+
let o = e[n];
|
|
314
|
+
o && o(t);
|
|
315
315
|
}
|
|
316
|
-
return
|
|
316
|
+
return De;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Tn(e) {
|
|
319
319
|
if (!e) return e;
|
|
320
320
|
let t = e.length, r = e[0].length, n = [];
|
|
321
|
-
for (let
|
|
322
|
-
for (let
|
|
323
|
-
let
|
|
324
|
-
for (let l = 0; l < r; l++) n[l][
|
|
321
|
+
for (let o = 0; o < r; o++) n[o] = Array(t);
|
|
322
|
+
for (let o = 0; o < t; o++) {
|
|
323
|
+
let i = e[o];
|
|
324
|
+
for (let l = 0; l < r; l++) n[l][o] = i[l];
|
|
325
325
|
}
|
|
326
326
|
return n;
|
|
327
327
|
}
|
|
328
|
-
var
|
|
329
|
-
function
|
|
328
|
+
var sr = (e, t) => !(e !== t && !ar(e, t)) || !!e.isEqual?.(t);
|
|
329
|
+
function cr(e, t, r = sr) {
|
|
330
330
|
if (e == null || e === t) return null;
|
|
331
331
|
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return r(e, t) ? null : e;
|
|
332
|
-
let n = Object.keys(e),
|
|
333
|
-
if (
|
|
334
|
-
let
|
|
335
|
-
for (let l = 0; l <
|
|
332
|
+
let n = Object.keys(e), o = n.length;
|
|
333
|
+
if (o === 0) return null;
|
|
334
|
+
let i = !1;
|
|
335
|
+
for (let l = 0; l < o; l++) {
|
|
336
336
|
let s = n[l];
|
|
337
|
-
|
|
337
|
+
cr(e[s], t?.[s], r) === null && (i = !0, delete e[s]);
|
|
338
338
|
}
|
|
339
|
-
return
|
|
339
|
+
return i && Object.keys(e).length === 0 ? null : void 0;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function ur(e, t, r = sr) {
|
|
342
342
|
if (e == null) return !0;
|
|
343
343
|
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) {
|
|
344
344
|
let s, c = !1;
|
|
345
345
|
for (let d = 0; !c && d < t.length; d++) t[d] !== void 0 && (c = !0, s = t[d]);
|
|
346
346
|
return c && (e === s || r(e, s));
|
|
347
347
|
}
|
|
348
|
-
let n = Object.keys(e),
|
|
349
|
-
if (
|
|
350
|
-
let
|
|
351
|
-
for (let s = 0; s <
|
|
348
|
+
let n = Object.keys(e), o = n.length;
|
|
349
|
+
if (o === 0) return !0;
|
|
350
|
+
let i = t.length, l = !1;
|
|
351
|
+
for (let s = 0; s < o; s++) {
|
|
352
352
|
let c = n[s], d = [];
|
|
353
|
-
for (let m = 0; m <
|
|
353
|
+
for (let m = 0; m < i; m++) {
|
|
354
354
|
let a = t[m]?.[c];
|
|
355
355
|
a !== void 0 && d.push(a);
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
ur(e[c], d, r) && (l = !0, delete e[c]);
|
|
358
358
|
}
|
|
359
359
|
return l && Object.keys(e).length === 0;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function Cn(...e) {
|
|
362
362
|
let t = e.length;
|
|
363
|
-
if (t > 0 && e[t - 1] !== void 0 && !
|
|
363
|
+
if (t > 0 && e[t - 1] !== void 0 && !Fe(e[t - 1])) return e[t - 1];
|
|
364
364
|
let r = e[0] || {};
|
|
365
|
-
for (let n = 1; n < t; n++) r =
|
|
365
|
+
for (let n = 1; n < t; n++) r = Ee(r, e[n] || {}, { arrayMerge: (o, i) => [...i] });
|
|
366
366
|
return r;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
369
|
-
let r = {}, n = Object.keys(t),
|
|
370
|
-
for (let
|
|
371
|
-
let l = n[
|
|
368
|
+
function In(e, t) {
|
|
369
|
+
let r = {}, n = Object.keys(t), o = n.length;
|
|
370
|
+
for (let i = 0; i < o; i++) {
|
|
371
|
+
let l = n[i], s = e[l], c = t[l];
|
|
372
372
|
s !== c && (r[l] = s === void 0 ? c : s);
|
|
373
373
|
}
|
|
374
374
|
return Object.keys(r).length === 0 ? null : r;
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
let n = 0,
|
|
378
|
-
for (; n <=
|
|
379
|
-
let
|
|
380
|
-
if (l === t) return
|
|
381
|
-
l < t ? n =
|
|
376
|
+
function An(e, t, r = ir) {
|
|
377
|
+
let n = 0, o = e.length - 1;
|
|
378
|
+
for (; n <= o;) {
|
|
379
|
+
let i = Math.floor((n + o) / 2), l = r(e[i]);
|
|
380
|
+
if (l === t) return i;
|
|
381
|
+
l < t ? n = i + 1 : o = i - 1;
|
|
382
382
|
}
|
|
383
383
|
return n;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
let n = e.length - 1,
|
|
387
|
-
for (; n >=
|
|
388
|
-
let
|
|
389
|
-
if (l === t) return
|
|
390
|
-
l > t ? n =
|
|
385
|
+
function Rn(e, t, r = ir) {
|
|
386
|
+
let n = e.length - 1, o = 0;
|
|
387
|
+
for (; n >= o;) {
|
|
388
|
+
let i = Math.floor((n + o) / 2), l = r(e[i]);
|
|
389
|
+
if (l === t) return i;
|
|
390
|
+
l > t ? n = i - 1 : o = i + 1;
|
|
391
391
|
}
|
|
392
392
|
return n;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function $n(e, t, r) {
|
|
395
395
|
let n = e.slice();
|
|
396
396
|
return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]), n;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function Nn(e) {
|
|
399
399
|
return e == null || e === void 0 ? "" : typeof e == "string" ? e : "" + e;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function dr(e) {
|
|
402
402
|
return e == null;
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function kn(e) {
|
|
405
405
|
return e != null;
|
|
406
406
|
}
|
|
407
407
|
function Ln(e) {
|
|
408
408
|
return e == null || e === "";
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function Mn(e) {
|
|
411
411
|
return !!e && typeof e.then == "function";
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function fr(e, t) {
|
|
414
414
|
return !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top);
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function On(e, t) {
|
|
417
417
|
return e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right;
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function Dn(e, t, r = !1) {
|
|
420
420
|
if (!t) return [e];
|
|
421
|
-
if (!
|
|
422
|
-
let n = [],
|
|
423
|
-
t.top >
|
|
424
|
-
...
|
|
421
|
+
if (!fr(e, t)) return [];
|
|
422
|
+
let n = [], o = e, i = () => {
|
|
423
|
+
t.top > o.top && t.top < o.bottom && (n.push({
|
|
424
|
+
...o,
|
|
425
425
|
bottom: t.top
|
|
426
|
-
}),
|
|
427
|
-
...
|
|
426
|
+
}), o = {
|
|
427
|
+
...o,
|
|
428
428
|
top: t.top
|
|
429
429
|
});
|
|
430
430
|
}, l = () => {
|
|
431
|
-
t.bottom >
|
|
432
|
-
...
|
|
431
|
+
t.bottom > o.top && t.bottom < o.bottom && (n.push({
|
|
432
|
+
...o,
|
|
433
433
|
top: t.bottom
|
|
434
|
-
}),
|
|
435
|
-
...
|
|
434
|
+
}), o = {
|
|
435
|
+
...o,
|
|
436
436
|
bottom: t.bottom
|
|
437
437
|
});
|
|
438
438
|
}, s = () => {
|
|
439
|
-
t.right >
|
|
440
|
-
...
|
|
439
|
+
t.right > o.left && t.right < o.right && (n.push({
|
|
440
|
+
...o,
|
|
441
441
|
left: t.right
|
|
442
|
-
}),
|
|
443
|
-
...
|
|
442
|
+
}), o = {
|
|
443
|
+
...o,
|
|
444
444
|
right: t.right
|
|
445
445
|
});
|
|
446
446
|
}, c = () => {
|
|
447
|
-
t.left >
|
|
448
|
-
...
|
|
447
|
+
t.left > o.left && t.left < o.right && (n.push({
|
|
448
|
+
...o,
|
|
449
449
|
right: t.left
|
|
450
|
-
}),
|
|
451
|
-
...
|
|
450
|
+
}), o = {
|
|
451
|
+
...o,
|
|
452
452
|
left: t.left
|
|
453
453
|
});
|
|
454
454
|
};
|
|
455
|
-
return r ? (c(), s(),
|
|
455
|
+
return r ? (c(), s(), i(), l()) : (i(), l(), s(), c()), n;
|
|
456
456
|
}
|
|
457
457
|
function Fn(e, t) {
|
|
458
|
-
let r = t.split("."), n = e,
|
|
459
|
-
for (let
|
|
460
|
-
let l = r[
|
|
458
|
+
let r = t.split("."), n = e, o = r.length;
|
|
459
|
+
for (let i = 0; i < o; i++) {
|
|
460
|
+
let l = r[i];
|
|
461
461
|
if (!n) return null;
|
|
462
462
|
let s = n[l];
|
|
463
|
-
if (typeof s == "function" && (s = s.bind(n)()), !s || !
|
|
463
|
+
if (typeof s == "function" && (s = s.bind(n)()), !s || !Fe(s)) return s;
|
|
464
464
|
n = s;
|
|
465
465
|
}
|
|
466
466
|
return n ?? null;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
469
|
-
let n = t.split("."),
|
|
470
|
-
if (!
|
|
471
|
-
let
|
|
472
|
-
for (let l = 0;
|
|
473
|
-
let s = n[l], c =
|
|
474
|
-
if (c ?? (c = {},
|
|
475
|
-
|
|
468
|
+
function Un(e, t, r) {
|
|
469
|
+
let n = t.split("."), o = e;
|
|
470
|
+
if (!o) throw Error("Can not set path to a null path.");
|
|
471
|
+
let i = n.length;
|
|
472
|
+
for (let l = 0; o && l < i - 1; l++) {
|
|
473
|
+
let s = n[l], c = o[s];
|
|
474
|
+
if (c ?? (c = {}, o[s] = c), !Fe(c)) throw Error("Can not set path to a non object path.");
|
|
475
|
+
o = c;
|
|
476
476
|
}
|
|
477
|
-
if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !
|
|
478
|
-
return
|
|
477
|
+
if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !Fe(r)) throw Error(\`Can not set path to \${r} that is not a a supported primitive.\`);
|
|
478
|
+
return o[n[i - 1]] = r, e;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function Bn(...e) {
|
|
481
481
|
return new Promise((t) => {
|
|
482
482
|
setTimeout(() => {
|
|
483
483
|
Function("console.log.apply(console, arguments)").apply(null, e), t();
|
|
484
484
|
});
|
|
485
485
|
});
|
|
486
486
|
}
|
|
487
|
-
var
|
|
487
|
+
var pe = {
|
|
488
488
|
Windows: "windows",
|
|
489
489
|
MacOS: "macos",
|
|
490
490
|
IOS: "ios",
|
|
@@ -494,195 +494,195 @@ var fe = {
|
|
|
494
494
|
Firefox: "firefox",
|
|
495
495
|
Unknown: "unknown"
|
|
496
496
|
};
|
|
497
|
-
function
|
|
497
|
+
function Ye() {
|
|
498
498
|
let e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
|
|
499
|
-
return e ? /(win32|win64|windows|wince)/i.test(e) ?
|
|
499
|
+
return e ? /(win32|win64|windows|wince)/i.test(e) ? pe.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? pe.MacOS : /(iphone|ipad|ipod)/i.test(e) ? pe.IOS : /android/.test(e) ? pe.Android : /linux/.test(e) ? pe.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? pe.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? pe.Firefox : pe.Unknown : pe.Unknown;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function pr(e) {
|
|
502
502
|
Object.freeze(e);
|
|
503
503
|
let t = e;
|
|
504
504
|
return Object.keys(t).forEach((r) => {
|
|
505
|
-
typeof t[r] != "object" || t[r] === null || Object.isFrozen(t[r]) ||
|
|
505
|
+
typeof t[r] != "object" || t[r] === null || Object.isFrozen(t[r]) || pr(t[r]);
|
|
506
506
|
}), e;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function ut(e) {
|
|
509
509
|
if (typeof e != "object" || !e) return e;
|
|
510
510
|
if (typeof e.toJSON == "function") return e.toJSON();
|
|
511
|
-
if (Array.isArray(e)) return e.map((r) =>
|
|
511
|
+
if (Array.isArray(e)) return e.map((r) => ut(r));
|
|
512
512
|
if (typeof e.toString == "function" && e.toString !== Object.prototype.toString) return e.toString();
|
|
513
513
|
let t = {};
|
|
514
|
-
for (let r in e) e.hasOwnProperty(r) && (t[r] =
|
|
514
|
+
for (let r in e) e.hasOwnProperty(r) && (t[r] = ut(e[r]));
|
|
515
515
|
return t;
|
|
516
516
|
}
|
|
517
517
|
ge({
|
|
518
|
-
EmptyCell: () =>
|
|
519
|
-
EmptyRange: () =>
|
|
520
|
-
EmptyRanges: () =>
|
|
521
|
-
EmptySelection: () =>
|
|
522
|
-
InsertCutShift: () =>
|
|
523
|
-
cellToRange: () =>
|
|
524
|
-
classifyInsertCut: () =>
|
|
525
|
-
columnFirstCellComparator: () =>
|
|
526
|
-
columnFirstRangeComparator: () =>
|
|
527
|
-
createCellComparator: () =>
|
|
528
|
-
createConflatingRanges: () =>
|
|
529
|
-
createRangeComparator: () =>
|
|
530
|
-
defaultRange: () =>
|
|
531
|
-
extendRangeToIntersectingRanges: () =>
|
|
532
|
-
extendRangeToUnionRanges: () =>
|
|
533
|
-
intersectRanges: () =>
|
|
534
|
-
isCellWithinRange: () =>
|
|
535
|
-
isEqualCells: () =>
|
|
536
|
-
isEqualRanges: () =>
|
|
537
|
-
isEqualRangesArrays: () =>
|
|
538
|
-
isEqualSelectionCoords: () =>
|
|
539
|
-
isRangeWithinRange: () =>
|
|
540
|
-
isRangesIntersect: () =>
|
|
541
|
-
isRefusedInsertCut: () =>
|
|
542
|
-
isSingleCell: () =>
|
|
543
|
-
isValidRange: () =>
|
|
544
|
-
mergeRangeCoordValues: () =>
|
|
545
|
-
reverseColumnFirstCellComparator: () =>
|
|
546
|
-
reverseColumnFirstRangeComparator: () =>
|
|
547
|
-
reverseRowFirstCellComparator: () =>
|
|
548
|
-
reverseRowFirstRangeComparator: () =>
|
|
549
|
-
rowFirstCellComparator: () =>
|
|
550
|
-
rowFirstRangeComparator: () =>
|
|
551
|
-
sanitizeRange: () =>
|
|
552
|
-
sanitizeRangeArray: () =>
|
|
553
|
-
translateRange: () =>
|
|
554
|
-
unionRanges: () =>
|
|
555
|
-
unionRangesArrays: () =>
|
|
518
|
+
EmptyCell: () => mr,
|
|
519
|
+
EmptyRange: () => Pn,
|
|
520
|
+
EmptyRanges: () => jn,
|
|
521
|
+
EmptySelection: () => Kn,
|
|
522
|
+
InsertCutShift: () => ve,
|
|
523
|
+
cellToRange: () => Xn,
|
|
524
|
+
classifyInsertCut: () => to,
|
|
525
|
+
columnFirstCellComparator: () => Sr,
|
|
526
|
+
columnFirstRangeComparator: () => hr,
|
|
527
|
+
createCellComparator: () => xr,
|
|
528
|
+
createConflatingRanges: () => eo,
|
|
529
|
+
createRangeComparator: () => _r,
|
|
530
|
+
defaultRange: () => qn,
|
|
531
|
+
extendRangeToIntersectingRanges: () => $r,
|
|
532
|
+
extendRangeToUnionRanges: () => Wn,
|
|
533
|
+
intersectRanges: () => Ar,
|
|
534
|
+
isCellWithinRange: () => zn,
|
|
535
|
+
isEqualCells: () => Tr,
|
|
536
|
+
isEqualRanges: () => gt,
|
|
537
|
+
isEqualRangesArrays: () => Ir,
|
|
538
|
+
isEqualSelectionCoords: () => Rr,
|
|
539
|
+
isRangeWithinRange: () => Cr,
|
|
540
|
+
isRangesIntersect: () => yt,
|
|
541
|
+
isRefusedInsertCut: () => ro,
|
|
542
|
+
isSingleCell: () => Vn,
|
|
543
|
+
isValidRange: () => Hn,
|
|
544
|
+
mergeRangeCoordValues: () => kr,
|
|
545
|
+
reverseColumnFirstCellComparator: () => Er,
|
|
546
|
+
reverseColumnFirstRangeComparator: () => wr,
|
|
547
|
+
reverseRowFirstCellComparator: () => vr,
|
|
548
|
+
reverseRowFirstRangeComparator: () => yr,
|
|
549
|
+
rowFirstCellComparator: () => br,
|
|
550
|
+
rowFirstRangeComparator: () => gr,
|
|
551
|
+
sanitizeRange: () => Nr,
|
|
552
|
+
sanitizeRangeArray: () => Yn,
|
|
553
|
+
translateRange: () => Jn,
|
|
554
|
+
unionRanges: () => dt,
|
|
555
|
+
unionRangesArrays: () => Gn
|
|
556
556
|
});
|
|
557
|
-
var
|
|
557
|
+
var mr = Object.freeze({
|
|
558
558
|
colIndex: 0,
|
|
559
559
|
rowIndex: 0
|
|
560
|
-
}),
|
|
560
|
+
}), Pn = Object.freeze({
|
|
561
561
|
colStart: 0,
|
|
562
562
|
rowStart: 0,
|
|
563
563
|
colEnd: 0,
|
|
564
564
|
rowEnd: 0
|
|
565
|
-
}),
|
|
566
|
-
cell:
|
|
567
|
-
ranges:
|
|
565
|
+
}), jn = De, Kn = Object.freeze({
|
|
566
|
+
cell: mr,
|
|
567
|
+
ranges: De,
|
|
568
568
|
rangeIndex: -1
|
|
569
569
|
});
|
|
570
|
-
function
|
|
570
|
+
function hr(e, t) {
|
|
571
571
|
return e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function gr(e, t) {
|
|
574
574
|
return e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function yr(e, t) {
|
|
577
577
|
return e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd;
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function wr(e, t) {
|
|
580
580
|
return e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd;
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function Sr(e, t) {
|
|
583
583
|
return e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function br(e, t) {
|
|
586
586
|
return e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function vr(e, t) {
|
|
589
589
|
return e.rowIndex === t.rowIndex ? t.colIndex - e.colIndex : t.rowIndex - e.rowIndex;
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function Er(e, t) {
|
|
592
592
|
return e.colIndex === t.colIndex ? t.rowIndex - e.rowIndex : t.colIndex - e.colIndex;
|
|
593
593
|
}
|
|
594
|
-
function
|
|
595
|
-
return t ? e ===
|
|
594
|
+
function _r(e = ie.Row, t = !1) {
|
|
595
|
+
return t ? e === ie.Column ? wr : yr : e === ie.Column ? hr : gr;
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
return t ? e ===
|
|
597
|
+
function xr(e = ie.Row, t = !1) {
|
|
598
|
+
return t ? e === ie.Column ? Er : vr : e === ie.Column ? Sr : br;
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function Tr(e, t) {
|
|
601
601
|
return e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex && e.scope === t.scope;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function gt(e, t) {
|
|
604
604
|
return e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd && e.scope === t.scope;
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function zn(e, t) {
|
|
607
607
|
if (!e || !t) return !1;
|
|
608
608
|
let r = e.rowIndex;
|
|
609
609
|
if (r < t.rowStart || r > t.rowEnd) return !1;
|
|
610
610
|
let n = e.colIndex;
|
|
611
611
|
return !(n < t.colStart || n > t.colEnd);
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Cr(e, t) {
|
|
614
614
|
return !(!e || !t) && !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd) && !(e.colStart < t.colStart || e.colEnd > t.colEnd);
|
|
615
615
|
}
|
|
616
|
-
function
|
|
616
|
+
function yt(e, t) {
|
|
617
617
|
return !(!e || !t) && !(e.colStart > t.colEnd || t.colStart > e.colEnd) && !(e.rowStart > t.rowEnd || t.rowStart > e.rowEnd);
|
|
618
618
|
}
|
|
619
|
-
function
|
|
619
|
+
function Ir(e, t) {
|
|
620
620
|
if (e === t) return !0;
|
|
621
621
|
if (!e || !t || e.length !== t.length) return !1;
|
|
622
|
-
for (let r = 0; r < e.length; r++) if (!
|
|
622
|
+
for (let r = 0; r < e.length; r++) if (!gt(e[r], t[r])) return !1;
|
|
623
623
|
return !0;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Vn(e) {
|
|
626
626
|
return !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function Xn(e, t) {
|
|
629
629
|
if (!e) return null;
|
|
630
630
|
let r = t;
|
|
631
631
|
return r || (r = { ...e }, delete r.colIndex, delete r.rowIndex), r.colStart = e.colIndex ?? 0, r.rowStart = e.rowIndex ?? 0, r.colEnd = e.colIndex ?? 0, r.rowEnd = e.rowIndex ?? 0, r;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function Ar(e, t, r) {
|
|
634
634
|
if (!e) return r ? t : { ...t };
|
|
635
635
|
if (!t) return r ? e : { ...e };
|
|
636
636
|
if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
|
|
637
|
-
let n = Math.max(e.colStart, t.colStart),
|
|
638
|
-
return s ? (s.colStart = n, s.rowStart =
|
|
637
|
+
let n = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), i = Math.min(e.colEnd, t.colEnd), l = Math.min(e.rowEnd, t.rowEnd), s = r;
|
|
638
|
+
return s ? (s.colStart = n, s.rowStart = o, s.colEnd = i, s.rowEnd = l) : s = {
|
|
639
639
|
colStart: n,
|
|
640
|
-
rowStart:
|
|
641
|
-
colEnd:
|
|
640
|
+
rowStart: o,
|
|
641
|
+
colEnd: i,
|
|
642
642
|
rowEnd: l
|
|
643
643
|
}, s;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function dt(e, t, r) {
|
|
646
646
|
if (!e && !t) return null;
|
|
647
647
|
if (!e) return r ? t : { ...t };
|
|
648
648
|
if (!t) return r ? e : { ...e };
|
|
649
|
-
let n = Math.min(e.colStart, t.colStart),
|
|
650
|
-
return s ? (s.colStart = n, s.rowStart =
|
|
649
|
+
let n = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), i = Math.max(e.colEnd, t.colEnd), l = Math.max(e.rowEnd, t.rowEnd), s = r;
|
|
650
|
+
return s ? (s.colStart = n, s.rowStart = o, s.colEnd = i, s.rowEnd = l) : s = {
|
|
651
651
|
colStart: n,
|
|
652
|
-
rowStart:
|
|
653
|
-
colEnd:
|
|
652
|
+
rowStart: o,
|
|
653
|
+
colEnd: i,
|
|
654
654
|
rowEnd: l
|
|
655
655
|
}, s;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!
|
|
657
|
+
function Rr(e, t) {
|
|
658
|
+
return e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Tr(e.cell, t.cell) && Ir(e.ranges, t.ranges);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function Gn(e, t, r) {
|
|
661
661
|
if (!e || e.length === 0) return null;
|
|
662
662
|
if (e.length === 1 && !t) return e[0];
|
|
663
663
|
let n = e[0];
|
|
664
|
-
for (let
|
|
665
|
-
return t && (n =
|
|
664
|
+
for (let o = 1; o < e.length; o++) n = dt(n, e[o], r);
|
|
665
|
+
return t && (n = dt(n, t, r)), n;
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Hn(e) {
|
|
668
668
|
return !!e && !(typeof e.colStart != "number" || e.colStart < 0) && !(typeof e.colEnd != "number" || e.colEnd < e.colStart) && !(typeof e.rowStart != "number" || e.rowStart < 0) && !(typeof e.rowEnd != "number" || e.rowEnd < e.rowStart);
|
|
669
669
|
}
|
|
670
|
-
function
|
|
670
|
+
function Wn(e, t) {
|
|
671
671
|
if (!t || t.length === 0) return e;
|
|
672
672
|
let r = e, n = null;
|
|
673
|
-
for (; !
|
|
673
|
+
for (; !gt(r, n);) n = r, r = $r(n, t);
|
|
674
674
|
return r;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function $r(e, t) {
|
|
677
677
|
if (!t || t.length === 0) return e;
|
|
678
678
|
let r = { ...e };
|
|
679
679
|
for (let n = 0; n < t.length; n++) {
|
|
680
|
-
let
|
|
681
|
-
|
|
680
|
+
let o = t[n];
|
|
681
|
+
yt(r, o) && (r.rowStart = Math.min(r.rowStart, o.rowStart), r.colStart = Math.min(r.colStart, o.colStart), r.rowEnd = Math.max(r.rowEnd, o.rowEnd), r.colEnd = Math.max(r.colEnd, o.colEnd));
|
|
682
682
|
}
|
|
683
683
|
return r;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Jn(e, t = -e.rowStart, r = -e.colStart, n) {
|
|
686
686
|
return n ? (n.colStart = e.colStart + r, n.rowStart = e.rowStart + t, n.colEnd = e.colEnd + r, n.rowEnd = e.rowEnd + t, n) : {
|
|
687
687
|
colStart: e.colStart + r,
|
|
688
688
|
rowStart: e.rowStart + t,
|
|
@@ -690,7 +690,7 @@ function Wn(e, t = -e.rowStart, r = -e.colStart, n) {
|
|
|
690
690
|
rowEnd: e.rowEnd + t
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
|
-
function
|
|
693
|
+
function Nr(e, t) {
|
|
694
694
|
return e ? e.scope ? {
|
|
695
695
|
colStart: e.colIndex ?? e.colStart ?? t?.colStart ?? 0,
|
|
696
696
|
rowStart: e.rowIndex ?? e.rowStart ?? t?.rowStart ?? 0,
|
|
@@ -704,13 +704,13 @@ function $r(e, t) {
|
|
|
704
704
|
rowEnd: e.rowIndex ?? e.rowEnd ?? t?.rowEnd ?? 0
|
|
705
705
|
} : null;
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function Yn(e, t) {
|
|
708
708
|
if (!e) return null;
|
|
709
709
|
let r = e.length, n = Array(r);
|
|
710
|
-
for (let
|
|
710
|
+
for (let o = 0; o < r; o++) n[o] = Nr(e[o], t);
|
|
711
711
|
return n;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function qn(e, t, r) {
|
|
714
714
|
return e ? r ? (r.colStart = e.colStart ?? t.colStart, r.rowStart = e.rowStart ?? t.rowStart, r.colEnd = e.colEnd ?? t.colEnd, r.rowEnd = e.rowEnd ?? t.rowEnd, r) : {
|
|
715
715
|
colStart: e.colStart ?? t.colStart,
|
|
716
716
|
rowStart: e.rowStart ?? t.rowStart,
|
|
@@ -718,77 +718,77 @@ function Yn(e, t, r) {
|
|
|
718
718
|
rowEnd: e.rowEnd ?? t.rowEnd
|
|
719
719
|
} : t;
|
|
720
720
|
}
|
|
721
|
-
var
|
|
721
|
+
var Zn = [null, null], Qn = (e, t, r) => {
|
|
722
722
|
if (e[0].value === e[1].value) return t;
|
|
723
723
|
};
|
|
724
|
-
function
|
|
725
|
-
let
|
|
726
|
-
if (t <= 0 || e.length <= 1) return
|
|
727
|
-
let l = n ===
|
|
724
|
+
function kr(e, t = 2, r, n = ie.Row, o) {
|
|
725
|
+
let i = [...e];
|
|
726
|
+
if (t <= 0 || e.length <= 1) return i;
|
|
727
|
+
let l = n === ie.Column, s = 0, c = !1;
|
|
728
728
|
do {
|
|
729
|
-
let d =
|
|
730
|
-
|
|
731
|
-
let m = d.length, a = 0,
|
|
729
|
+
let d = i.sort(_r(l ? ie.Row : ie.Column));
|
|
730
|
+
i = [], i.push(d[0]);
|
|
731
|
+
let m = d.length, a = 0, p = d[0], b = p.colStart, S = p.rowStart, A = p.colEnd, U = p.rowEnd;
|
|
732
732
|
for (let h = 1; h < m; h++) {
|
|
733
|
-
let
|
|
734
|
-
if (
|
|
735
|
-
let
|
|
733
|
+
let y = d[h], w = !1;
|
|
734
|
+
if (w = l ? p && S === y.rowStart && U === y.rowEnd && A + 1 === y.colStart : p && b === y.colStart && A === y.colEnd && U + 1 === y.rowStart, w) {
|
|
735
|
+
let D = {
|
|
736
736
|
colStart: b,
|
|
737
|
-
rowStart:
|
|
738
|
-
colEnd: l ?
|
|
739
|
-
rowEnd: l ? U :
|
|
737
|
+
rowStart: S,
|
|
738
|
+
colEnd: l ? y.colEnd : A,
|
|
739
|
+
rowEnd: l ? U : y.rowEnd
|
|
740
740
|
};
|
|
741
|
-
if (
|
|
742
|
-
let z =
|
|
743
|
-
z[0] =
|
|
741
|
+
if (p.value !== void 0 && (D.value = p.value), r) {
|
|
742
|
+
let z = o ?? [null, null];
|
|
743
|
+
z[0] = p, z[1] = y, D = r(z, D, n);
|
|
744
744
|
}
|
|
745
|
-
if (
|
|
746
|
-
|
|
745
|
+
if (D) {
|
|
746
|
+
i[a] = D, c = !0, p = D, b = p.colStart, S = p.rowStart, A = p.colEnd, U = p.rowEnd;
|
|
747
747
|
continue;
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
|
|
750
|
+
i[++a] = y, p = y, b = p.colStart, S = p.rowStart, A = p.colEnd, U = p.rowEnd;
|
|
751
751
|
}
|
|
752
752
|
s++, l = !l, s === 1 && (c = !0);
|
|
753
|
-
} while (s < t && c &&
|
|
754
|
-
return
|
|
753
|
+
} while (s < t && c && i.length > 1);
|
|
754
|
+
return i;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
let r = [], n,
|
|
756
|
+
function eo(e, t = !1) {
|
|
757
|
+
let r = [], n, o = null, i = -(2 ** 53 - 1), l = -(2 ** 53 - 1);
|
|
758
758
|
return {
|
|
759
759
|
append: (s, c, d) => {
|
|
760
760
|
let m = !0, a = d !== void 0;
|
|
761
761
|
if (a) {
|
|
762
|
-
let
|
|
763
|
-
|
|
762
|
+
let S = e ? e(n, d, t) : n === d ? d : void 0;
|
|
763
|
+
S === void 0 ? m = !1 : d = S;
|
|
764
764
|
}
|
|
765
|
-
if (m && c === l + 1 && s ===
|
|
766
|
-
|
|
767
|
-
let
|
|
768
|
-
|
|
769
|
-
colStart:
|
|
765
|
+
if (m && c === l + 1 && s === i) return t ? o.rowEnd = c : o.colEnd = c, l = c, void (n = d);
|
|
766
|
+
o && r.push(o);
|
|
767
|
+
let p = t ? s : c, b = t ? c : s;
|
|
768
|
+
o = {
|
|
769
|
+
colStart: p,
|
|
770
770
|
rowStart: b,
|
|
771
|
-
colEnd:
|
|
771
|
+
colEnd: p,
|
|
772
772
|
rowEnd: b
|
|
773
|
-
}, a && (
|
|
773
|
+
}, a && (o.value = d), i = s, l = c, n = d;
|
|
774
774
|
},
|
|
775
|
-
done: (s) => (
|
|
775
|
+
done: (s) => (o &&= (r.push(o), null), s ? kr(r, 3, s === !0 ? Qn : s, t ? ie.Column : ie.Row, Zn) : r)
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
|
-
var
|
|
778
|
+
var ve = {
|
|
779
779
|
Close: "close",
|
|
780
780
|
Blank: "blank",
|
|
781
781
|
Inside: "inside",
|
|
782
782
|
Tear: "tear"
|
|
783
783
|
};
|
|
784
|
-
function
|
|
785
|
-
let n = r ===
|
|
786
|
-
return (n ? e.colStart === t.colStart && e.colEnd === t.colEnd : e.rowStart === t.rowStart && e.rowEnd === t.rowEnd) ? (n ? t.rowStart > e.rowStart && t.rowStart <= e.rowEnd : t.colStart > e.colStart && t.colStart <= e.colEnd) ?
|
|
784
|
+
function to(e, t, r) {
|
|
785
|
+
let n = r === ie.Row;
|
|
786
|
+
return (n ? e.colStart === t.colStart && e.colEnd === t.colEnd : e.rowStart === t.rowStart && e.rowEnd === t.rowEnd) ? (n ? t.rowStart > e.rowStart && t.rowStart <= e.rowEnd : t.colStart > e.colStart && t.colStart <= e.colEnd) ? ve.Inside : ve.Close : (n ? e.rowEnd >= t.rowStart && e.colStart <= t.colEnd && e.colEnd >= t.colStart : e.colEnd >= t.colStart && e.rowStart <= t.rowEnd && e.rowEnd >= t.rowStart) ? ve.Tear : ve.Blank;
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
return e ===
|
|
788
|
+
function ro(e) {
|
|
789
|
+
return e === ve.Inside || e === ve.Tear;
|
|
790
790
|
}
|
|
791
|
-
var
|
|
791
|
+
var q = {
|
|
792
792
|
Up: "up",
|
|
793
793
|
Down: "down",
|
|
794
794
|
Left: "left",
|
|
@@ -800,23 +800,23 @@ var Z = {
|
|
|
800
800
|
};
|
|
801
801
|
ge({
|
|
802
802
|
findNextCellWithinSelection: () => Lr,
|
|
803
|
-
traverseHiddenHeaders: () =>
|
|
803
|
+
traverseHiddenHeaders: () => fe
|
|
804
804
|
});
|
|
805
|
-
function
|
|
805
|
+
function fe(e, t, r, n) {
|
|
806
806
|
if (!e) return t;
|
|
807
|
-
let
|
|
807
|
+
let o = t, i = r === q.Right || r === q.Down;
|
|
808
808
|
for (;;) {
|
|
809
|
-
let l = e(
|
|
810
|
-
if (l === 0) return
|
|
811
|
-
let s =
|
|
812
|
-
if (n !== void 0 && (
|
|
813
|
-
|
|
809
|
+
let l = e(o, !i);
|
|
810
|
+
if (l === 0) return o;
|
|
811
|
+
let s = i ? o + l : o - l;
|
|
812
|
+
if (n !== void 0 && (i ? s > n : s < n)) return n;
|
|
813
|
+
o = s;
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
-
function Lr(e, t =
|
|
817
|
-
if (
|
|
816
|
+
function Lr(e, t = q.Right, r, n, o, i = null) {
|
|
817
|
+
if (i && Rr(i, e)) return e;
|
|
818
818
|
let l = e.ranges, s = e.rangeIndex, c = l[s];
|
|
819
|
-
if (!
|
|
819
|
+
if (!yt({
|
|
820
820
|
rowStart: e.cell.rowIndex,
|
|
821
821
|
colStart: e.cell.colIndex,
|
|
822
822
|
rowEnd: e.cell.rowIndex,
|
|
@@ -824,19 +824,19 @@ function Lr(e, t = Z.Right, r, n, i, o = null) {
|
|
|
824
824
|
}, c)) return e;
|
|
825
825
|
let d = { ...e.cell }, m = s;
|
|
826
826
|
switch (t) {
|
|
827
|
-
case
|
|
828
|
-
d.colIndex =
|
|
827
|
+
case q.Right:
|
|
828
|
+
d.colIndex = fe(o, d.colIndex + 1, t, c.colEnd + 1);
|
|
829
829
|
break;
|
|
830
|
-
case
|
|
831
|
-
d.colIndex =
|
|
830
|
+
case q.Left:
|
|
831
|
+
d.colIndex = fe(o, d.colIndex - 1, t, c.colStart - 1);
|
|
832
832
|
break;
|
|
833
|
-
case
|
|
834
|
-
d.rowIndex =
|
|
833
|
+
case q.Down:
|
|
834
|
+
d.rowIndex = fe(n, d.rowIndex + 1, t, c.rowEnd + 1);
|
|
835
835
|
break;
|
|
836
|
-
case
|
|
836
|
+
case q.Up: d.rowIndex = fe(n, d.rowIndex - 1, t, c.rowStart - 1);
|
|
837
837
|
}
|
|
838
|
-
let a = (
|
|
839
|
-
if (
|
|
838
|
+
let a = (S) => {
|
|
839
|
+
if (S) {
|
|
840
840
|
m = s >= l.length - 1 ? 0 : s + 1;
|
|
841
841
|
let A = l[m];
|
|
842
842
|
d = {
|
|
@@ -852,58 +852,58 @@ function Lr(e, t = Z.Right, r, n, i, o = null) {
|
|
|
852
852
|
};
|
|
853
853
|
}
|
|
854
854
|
};
|
|
855
|
-
if (t ===
|
|
856
|
-
else if (t ===
|
|
857
|
-
else if (t ===
|
|
858
|
-
else if (t ===
|
|
855
|
+
if (t === q.Right && d.colIndex > c.colEnd && d.rowIndex === c.rowEnd) a(!0);
|
|
856
|
+
else if (t === q.Left && d.colIndex < c.colStart && d.rowIndex === c.rowStart) a(!1);
|
|
857
|
+
else if (t === q.Down && d.colIndex === c.colEnd && d.rowIndex > c.rowEnd) a(!0);
|
|
858
|
+
else if (t === q.Up && d.colIndex === c.colStart && d.rowIndex < c.rowStart) a(!1);
|
|
859
859
|
else {
|
|
860
|
-
let
|
|
860
|
+
let S = d.rowIndex, A = d.colIndex;
|
|
861
861
|
switch (t) {
|
|
862
|
-
case
|
|
863
|
-
A > c.colEnd && (
|
|
862
|
+
case q.Right:
|
|
863
|
+
A > c.colEnd && (S = fe(n, S + 1, t, c.rowEnd + 1), A = c.colStart, S > c.rowEnd && (S = c.rowStart));
|
|
864
864
|
break;
|
|
865
|
-
case
|
|
866
|
-
A < c.colStart && (
|
|
865
|
+
case q.Left:
|
|
866
|
+
A < c.colStart && (S = fe(n, S - 1, t, c.rowStart - 1), A = c.colEnd, S < c.rowStart && (S = c.rowEnd));
|
|
867
867
|
break;
|
|
868
|
-
case
|
|
869
|
-
|
|
868
|
+
case q.Down:
|
|
869
|
+
S > c.rowEnd && (A = fe(o, A + 1, t, c.colEnd + 1), S = c.rowStart, A > c.colEnd && (A = c.colStart));
|
|
870
870
|
break;
|
|
871
|
-
case
|
|
871
|
+
case q.Up: S < c.rowStart && (A = fe(o, A - 1, t, c.colStart - 1), S = c.rowEnd, A < c.colStart && (A = c.colEnd));
|
|
872
872
|
}
|
|
873
873
|
d = {
|
|
874
|
-
rowIndex:
|
|
874
|
+
rowIndex: S,
|
|
875
875
|
colIndex: A
|
|
876
876
|
};
|
|
877
877
|
}
|
|
878
|
-
let
|
|
879
|
-
if (!
|
|
880
|
-
let
|
|
881
|
-
|
|
878
|
+
let p = r(d);
|
|
879
|
+
if (!Cr(p, c)) {
|
|
880
|
+
let S = Ar(p, c);
|
|
881
|
+
S && (p = S);
|
|
882
882
|
}
|
|
883
883
|
let b = {
|
|
884
|
-
rowStart:
|
|
885
|
-
colStart:
|
|
886
|
-
rowEnd:
|
|
887
|
-
colEnd:
|
|
884
|
+
rowStart: fe(n, p.rowStart, q.Down, p.rowEnd),
|
|
885
|
+
colStart: fe(o, p.colStart, q.Right, p.colEnd),
|
|
886
|
+
rowEnd: fe(n, p.rowEnd, q.Up, p.rowStart),
|
|
887
|
+
colEnd: fe(o, p.colEnd, q.Left, p.colStart)
|
|
888
888
|
};
|
|
889
889
|
if (b.rowStart !== d.rowIndex || b.colStart !== d.colIndex) {
|
|
890
890
|
switch (t) {
|
|
891
|
-
case
|
|
891
|
+
case q.Right:
|
|
892
892
|
l[m].colStart === b.colStart && l[m].colEnd === b.colEnd && (d.rowIndex = b.rowEnd), d.colIndex = b.colEnd;
|
|
893
893
|
break;
|
|
894
|
-
case
|
|
894
|
+
case q.Left:
|
|
895
895
|
l[m].colStart === b.colStart && l[m].colEnd === b.colEnd && (d.rowIndex = b.rowStart), d.rowIndex === b.rowStart ? d.colIndex = b.colStart + 1 : d.colIndex = b.colStart;
|
|
896
896
|
break;
|
|
897
|
-
case
|
|
897
|
+
case q.Down:
|
|
898
898
|
l[m].rowStart === b.rowStart && l[m].rowEnd === b.rowEnd && (d.colIndex = b.colEnd), d.rowIndex = b.rowEnd;
|
|
899
899
|
break;
|
|
900
|
-
case
|
|
900
|
+
case q.Up: l[m].rowStart === b.rowStart && l[m].rowEnd === b.rowEnd && (d.colIndex = b.colStart), d.colIndex === b.colStart ? d.rowIndex = b.rowStart + 1 : d.rowIndex = b.rowStart;
|
|
901
901
|
}
|
|
902
902
|
return Lr({
|
|
903
903
|
cell: d,
|
|
904
904
|
ranges: e.ranges,
|
|
905
905
|
rangeIndex: m
|
|
906
|
-
}, t, r, n,
|
|
906
|
+
}, t, r, n, o, i ?? e);
|
|
907
907
|
}
|
|
908
908
|
return {
|
|
909
909
|
ranges: e.ranges,
|
|
@@ -911,143 +911,143 @@ function Lr(e, t = Z.Right, r, n, i, o = null) {
|
|
|
911
911
|
rangeIndex: m
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
var
|
|
914
|
+
var no, $e = (e, t) => {
|
|
915
915
|
if (e.length >= t) return e;
|
|
916
916
|
let r = new Int32Array(Math.max(t, 2 * e.length));
|
|
917
917
|
return r.set(e), r;
|
|
918
|
-
},
|
|
918
|
+
}, Ne = /* @__PURE__ */ new Int32Array(1024), et = (e) => (Ne.length < e && (Ne = new Int32Array(Math.max(e, 2 * Ne.length))), Ne.fill(0, 0, e), Ne), oo = class {
|
|
919
919
|
constructor(e, t, r, n) {
|
|
920
920
|
this._nextOrder = 0, this._activeLen = 0, this._events = /* @__PURE__ */ new Int32Array(64), this._hasBand = !1, this._bandStart = 0, this._bandEnd = 0, this._rMinS = /* @__PURE__ */ new Int32Array(64), this._rMinE = /* @__PURE__ */ new Int32Array(64), this._rOff = /* @__PURE__ */ new Int32Array(65), this._rCount = 0, this._pool = /* @__PURE__ */ new Int32Array(256), this._overlaps = /* @__PURE__ */ new Int32Array(16), this._rInter = null, this._region = -1, this._major = 0, this._minor = 0, this._done = !1, this.rowStart = 0, this.rowEnd = 0, this.colStart = 0, this.colEnd = 0, this.cellRow = 0, this.cellCol = 0, this.intersection = null, this._isColumn = r, this._isReverse = n, this._store = e;
|
|
921
|
-
let
|
|
922
|
-
this._n =
|
|
923
|
-
let
|
|
924
|
-
for (let h = 0; h <
|
|
925
|
-
this._M0 =
|
|
926
|
-
let b = r ? t.colStart : t.rowStart,
|
|
927
|
-
if (
|
|
928
|
-
for (let h = 0; h <
|
|
929
|
-
U.sort((h,
|
|
921
|
+
let o = e.count;
|
|
922
|
+
this._n = o;
|
|
923
|
+
let i = new Int32Array(o), l = new Int32Array(o), s = new Int32Array(o), c = new Int32Array(o), d = r ? e.colS : e.rowS, m = r ? e.colE : e.rowE, a = r ? e.rowS : e.colS, p = r ? e.rowE : e.colE;
|
|
924
|
+
for (let h = 0; h < o; h++) n ? (i[h] = -m[h], l[h] = -d[h], s[h] = -p[h], c[h] = -a[h]) : (i[h] = d[h], l[h] = m[h], s[h] = a[h], c[h] = p[h]);
|
|
925
|
+
this._M0 = i, this._M1 = l, this._m0 = s, this._m1 = c;
|
|
926
|
+
let b = r ? t.colStart : t.rowStart, S = r ? t.colEnd : t.rowEnd, A = S - b + 1, U = new Int32Array(o);
|
|
927
|
+
if (o < 256 || A > 16 * o) {
|
|
928
|
+
for (let h = 0; h < o; h++) U[h] = h;
|
|
929
|
+
U.sort((h, y) => i[h] - i[y] || h - y);
|
|
930
930
|
} else {
|
|
931
|
-
let h = n ? -
|
|
932
|
-
for (let
|
|
933
|
-
for (let
|
|
934
|
-
for (let
|
|
931
|
+
let h = n ? -S : b, y = et(A + 1);
|
|
932
|
+
for (let w = 0; w < o; w++) y[i[w] - h + 1]++;
|
|
933
|
+
for (let w = 1; w <= A; w++) y[w] += y[w - 1];
|
|
934
|
+
for (let w = 0; w < o; w++) U[y[i[w] - h]++] = w;
|
|
935
935
|
}
|
|
936
|
-
this._order = U, this._active = new Int32Array(Math.min(2 *
|
|
936
|
+
this._order = U, this._active = new Int32Array(Math.min(2 * o, 1024)), this._scratch = new Int32Array(this._active.length);
|
|
937
937
|
}
|
|
938
938
|
_stable(e) {
|
|
939
939
|
return this._isReverse ? this._n - 1 - e : e;
|
|
940
940
|
}
|
|
941
941
|
_compareEvents(e, t) {
|
|
942
|
-
let r = e >> 1, n = t >> 1,
|
|
942
|
+
let r = e >> 1, n = t >> 1, o = 1 & e, i = 1 & t, l = this._m0, s = this._m1, c = o ? s[r] : l[r], d = i ? s[n] : l[n];
|
|
943
943
|
if (c !== d) return c - d;
|
|
944
|
-
if (
|
|
945
|
-
let m =
|
|
944
|
+
if (o !== i) return o - i;
|
|
945
|
+
let m = o ? l[r] : s[r], a = i ? l[n] : s[n];
|
|
946
946
|
return m === a ? this._stable(r) - this._stable(n) : m - a;
|
|
947
947
|
}
|
|
948
948
|
_sortEvents(e, t, r, n) {
|
|
949
|
-
let
|
|
950
|
-
if (t < 256 ||
|
|
951
|
-
let
|
|
949
|
+
let o = n - r + 1;
|
|
950
|
+
if (t < 256 || o > 16 * t) return e.subarray(0, t).sort((a, p) => this._compareEvents(a, p)), e;
|
|
951
|
+
let i = this._m0, l = this._m1, s = e, c = this._scratch;
|
|
952
952
|
c.length < t && (c = this._scratch = new Int32Array(t));
|
|
953
|
-
let d =
|
|
953
|
+
let d = et(o + 1);
|
|
954
954
|
for (let a = 0; a < t; a++) {
|
|
955
|
-
let
|
|
956
|
-
d[(1 &
|
|
955
|
+
let p = s[a];
|
|
956
|
+
d[(1 & p ? i[p >> 1] : l[p >> 1]) - r + 1]++;
|
|
957
957
|
}
|
|
958
|
-
for (let a = 1; a <=
|
|
958
|
+
for (let a = 1; a <= o; a++) d[a] += d[a - 1];
|
|
959
959
|
for (let a = 0; a < t; a++) {
|
|
960
|
-
let
|
|
961
|
-
c[d[(1 &
|
|
960
|
+
let p = s[a];
|
|
961
|
+
c[d[(1 & p ? i[p >> 1] : l[p >> 1]) - r]++] = p;
|
|
962
962
|
}
|
|
963
963
|
let m = 0;
|
|
964
964
|
for (let a = 0; a < t; a++) 1 & c[a] || (s[m++] = c[a]);
|
|
965
965
|
for (let a = 0; a < t; a++) 1 & ~c[a] || (s[m++] = c[a]);
|
|
966
|
-
d =
|
|
966
|
+
d = et(o + 1);
|
|
967
967
|
for (let a = 0; a < t; a++) {
|
|
968
|
-
let
|
|
969
|
-
d[(1 &
|
|
968
|
+
let p = s[a];
|
|
969
|
+
d[(1 & p ? l[p >> 1] : i[p >> 1]) - r + 1]++;
|
|
970
970
|
}
|
|
971
|
-
for (let a = 1; a <=
|
|
971
|
+
for (let a = 1; a <= o; a++) d[a] += d[a - 1];
|
|
972
972
|
for (let a = 0; a < t; a++) {
|
|
973
|
-
let
|
|
974
|
-
c[d[(1 &
|
|
973
|
+
let p = s[a];
|
|
974
|
+
c[d[(1 & p ? l[p >> 1] : i[p >> 1]) - r]++] = p;
|
|
975
975
|
}
|
|
976
976
|
return this._scratch = s, this._events = c, c;
|
|
977
977
|
}
|
|
978
978
|
_advanceBand() {
|
|
979
|
-
let e = this._n, t = this._M0, r = this._M1, n = this._order,
|
|
979
|
+
let e = this._n, t = this._M0, r = this._M1, n = this._order, o, i = this._active, l = this._activeLen;
|
|
980
980
|
if (this._hasBand) {
|
|
981
|
-
let a = this._bandEnd,
|
|
981
|
+
let a = this._bandEnd, p = 0;
|
|
982
982
|
for (let b = 0; b < l; b++) {
|
|
983
|
-
let
|
|
984
|
-
r[
|
|
983
|
+
let S = i[b];
|
|
984
|
+
r[S >> 1] > a && (i[p++] = S);
|
|
985
985
|
}
|
|
986
|
-
l =
|
|
986
|
+
l = p;
|
|
987
987
|
}
|
|
988
988
|
let s = this._nextOrder;
|
|
989
|
-
if (l > 0)
|
|
989
|
+
if (l > 0) o = this._bandEnd + 1;
|
|
990
990
|
else {
|
|
991
991
|
if (s >= e) return this._activeLen = 0, this._done = !0, !1;
|
|
992
|
-
|
|
992
|
+
o = t[n[s]];
|
|
993
993
|
}
|
|
994
994
|
let c = s;
|
|
995
|
-
for (; c < e && t[n[c]] ===
|
|
995
|
+
for (; c < e && t[n[c]] === o;) c++;
|
|
996
996
|
let d = c - s;
|
|
997
997
|
if (d > 0) {
|
|
998
|
-
let a = 2 * d,
|
|
999
|
-
|
|
1000
|
-
let b = this._m0,
|
|
998
|
+
let a = 2 * d, p = this._events;
|
|
999
|
+
p.length < a && (p = this._events = new Int32Array(Math.max(a, 2 * p.length)));
|
|
1000
|
+
let b = this._m0, S = this._m1, A = 2 ** 53 - 1, U = -(2 ** 53 - 1), h = 0;
|
|
1001
1001
|
if (this._isReverse) for (let z = c - 1; z >= s; z--) {
|
|
1002
|
-
let
|
|
1003
|
-
|
|
1002
|
+
let k = n[z];
|
|
1003
|
+
p[h++] = k << 1, p[h++] = k << 1 | 1, b[k] < A && (A = b[k]), S[k] > U && (U = S[k]);
|
|
1004
1004
|
}
|
|
1005
1005
|
else for (let z = s; z < c; z++) {
|
|
1006
|
-
let
|
|
1007
|
-
|
|
1006
|
+
let k = n[z];
|
|
1007
|
+
p[h++] = k << 1, p[h++] = k << 1 | 1, b[k] < A && (A = b[k]), S[k] > U && (U = S[k]);
|
|
1008
1008
|
}
|
|
1009
|
-
let
|
|
1010
|
-
if ((
|
|
1009
|
+
let y = this._sortEvents(p, a, A, U), w = l + a, D = this._scratch;
|
|
1010
|
+
if ((D === y || D.length < w) && (D = new Int32Array(Math.max(w, 2 * i.length))), l === 0) D.set(y.subarray(0, a));
|
|
1011
1011
|
else {
|
|
1012
|
-
let z = 0,
|
|
1013
|
-
for (; z < l &&
|
|
1014
|
-
for (; z < l;)
|
|
1015
|
-
for (;
|
|
1012
|
+
let z = 0, k = 0, R = 0;
|
|
1013
|
+
for (; z < l && k < a;) this._compareEvents(i[z], y[k]) <= 0 ? D[R++] = i[z++] : D[R++] = y[k++];
|
|
1014
|
+
for (; z < l;) D[R++] = i[z++];
|
|
1015
|
+
for (; k < a;) D[R++] = y[k++];
|
|
1016
1016
|
}
|
|
1017
|
-
this._scratch =
|
|
1017
|
+
this._scratch = i.length >= D.length ? i : new Int32Array(D.length), i = this._active = D, l = w;
|
|
1018
1018
|
}
|
|
1019
1019
|
this._activeLen = l, this._nextOrder = c;
|
|
1020
1020
|
let m = c < e ? t[n[c]] - 1 : 2 ** 53 - 1;
|
|
1021
1021
|
for (let a = 0; a < l; a++) {
|
|
1022
|
-
let
|
|
1023
|
-
|
|
1022
|
+
let p = r[i[a] >> 1];
|
|
1023
|
+
p < m && (m = p);
|
|
1024
1024
|
}
|
|
1025
|
-
return this._bandStart =
|
|
1025
|
+
return this._bandStart = o, this._bandEnd = m, this._hasBand = !0, this._sweepBand(), !0;
|
|
1026
1026
|
}
|
|
1027
1027
|
_sweepBand() {
|
|
1028
|
-
let e = this._active, t = this._activeLen, r = this._m0, n = this._m1,
|
|
1029
|
-
a >=
|
|
1028
|
+
let e = this._active, t = this._activeLen, r = this._m0, n = this._m1, o = this._rMinS, i = this._rMinE, l = this._rOff, s = this._pool, c = this._overlaps, d = 0, m = 0, a = 0, p = 0, b = (S, A) => {
|
|
1029
|
+
a >= o.length && (o = this._rMinS = $e(o, a + 1), i = this._rMinE = $e(i, a + 1), l = this._rOff = $e(l, o.length + 1)), o[a] = S, i[a] = A, l[a] = m, a++, m + d > s.length && (s = this._pool = $e(s, m + d));
|
|
1030
1030
|
for (let U = 0; U < d; U++) s[m++] = c[U];
|
|
1031
1031
|
};
|
|
1032
|
-
for (let
|
|
1033
|
-
let A = e[
|
|
1032
|
+
for (let S = 0; S < t; S++) {
|
|
1033
|
+
let A = e[S], U = A >> 1;
|
|
1034
1034
|
if (1 & A) {
|
|
1035
1035
|
let h = n[U];
|
|
1036
|
-
if (
|
|
1037
|
-
let
|
|
1038
|
-
for (;
|
|
1039
|
-
|
|
1036
|
+
if (p <= h && b(p, h), d > 1) {
|
|
1037
|
+
let y = d - 1;
|
|
1038
|
+
for (; y >= 0 && c[y] !== U;) y--;
|
|
1039
|
+
y !== -1 && (c[y] = c[d - 1]);
|
|
1040
1040
|
}
|
|
1041
|
-
d--,
|
|
1041
|
+
d--, p = h + 1;
|
|
1042
1042
|
} else {
|
|
1043
1043
|
let h = r[U];
|
|
1044
|
-
d > 0 &&
|
|
1044
|
+
d > 0 && p < h && b(p, h - 1), d >= c.length && (c = this._overlaps = $e(c, d + 1)), c[d++] = U, p = h;
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
l[a] = m, this._rCount = a, this._region = -1, this._rInter = null;
|
|
1048
1048
|
}
|
|
1049
1049
|
_setRegion(e) {
|
|
1050
|
-
let t = this._isReverse, r = t ? 0 - this._bandEnd : this._bandStart, n = t ? 0 - this._bandStart : this._bandEnd,
|
|
1050
|
+
let t = this._isReverse, r = t ? 0 - this._bandEnd : this._bandStart, n = t ? 0 - this._bandStart : this._bandEnd, o = this._rMinS[e], i = this._rMinE[e], l = t ? 0 - i : o, s = t ? 0 - o : i;
|
|
1051
1051
|
this._isColumn ? (this.colStart = r, this.colEnd = n, this.rowStart = l, this.rowEnd = s) : (this.rowStart = r, this.rowEnd = n, this.colStart = l, this.colEnd = s);
|
|
1052
1052
|
let c = this._rInter;
|
|
1053
1053
|
if (c) {
|
|
@@ -1091,8 +1091,8 @@ var ri, Ae = (e, t) => {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
seekCell(e, t) {
|
|
1093
1093
|
if (this._done) return !1;
|
|
1094
|
-
let r = this._isReverse, n = this._isColumn ? t : e,
|
|
1095
|
-
if (r && (n = -n,
|
|
1094
|
+
let r = this._isReverse, n = this._isColumn ? t : e, o = this._isColumn ? e : t;
|
|
1095
|
+
if (r && (n = -n, o = -o), this._hasBand && this._region >= 0 && (n < this._major || n === this._major && o <= this._minor)) return this.nextCell();
|
|
1096
1096
|
for (;;) {
|
|
1097
1097
|
if (!this._hasBand || n > this._bandEnd) {
|
|
1098
1098
|
if (!this._advanceBand()) return !1;
|
|
@@ -1101,42 +1101,42 @@ var ri, Ae = (e, t) => {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
if (n < this._bandStart) return this._major = this._bandStart, this._minor = this._rMinS[0], this._setCell(0), !0;
|
|
1103
1103
|
this._major = n;
|
|
1104
|
-
let
|
|
1104
|
+
let i = this._rMinE, l = 0, s = this._rCount;
|
|
1105
1105
|
for (; l < s;) {
|
|
1106
1106
|
let c = l + s >>> 1;
|
|
1107
|
-
|
|
1107
|
+
i[c] < o ? l = c + 1 : s = c;
|
|
1108
1108
|
}
|
|
1109
1109
|
if (l < this._rCount) {
|
|
1110
1110
|
let c = this._rMinS[l];
|
|
1111
|
-
return this._minor = c >
|
|
1111
|
+
return this._minor = c > o ? c : o, this._setCell(l), !0;
|
|
1112
1112
|
}
|
|
1113
1113
|
if (!(++this._major > this._bandEnd)) return this._minor = this._rMinS[0], this._setCell(0), !0;
|
|
1114
1114
|
if (!this._advanceBand()) return !1;
|
|
1115
1115
|
this._enterBandByCell();
|
|
1116
1116
|
}
|
|
1117
1117
|
}
|
|
1118
|
-
},
|
|
1118
|
+
}, je = Object.freeze({
|
|
1119
1119
|
done: !0,
|
|
1120
1120
|
value: void 0
|
|
1121
1121
|
});
|
|
1122
1122
|
(function(e) {
|
|
1123
|
-
class t extends
|
|
1124
|
-
constructor(...
|
|
1125
|
-
super(...
|
|
1123
|
+
class t extends oo {
|
|
1124
|
+
constructor(...o) {
|
|
1125
|
+
super(...o), this._reuseOverlaps = null;
|
|
1126
1126
|
}
|
|
1127
|
-
_materialize(
|
|
1128
|
-
let
|
|
1127
|
+
_materialize(o) {
|
|
1128
|
+
let i = this._rOff, l = this._pool, s = this._store.value, c = i[o], d = i[o + 1], m = this._reuseOverlaps;
|
|
1129
1129
|
m ? m.length = 0 : m = [];
|
|
1130
1130
|
for (let a = c; a < d; a++) m.push(s[l[a]]);
|
|
1131
1131
|
return m;
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
1134
|
class r {
|
|
1135
|
-
constructor(
|
|
1136
|
-
if (this._sweep = null, this._isByCell = !1, this._cellComparator = null, this._lastCell = null, this._reuse = null, !
|
|
1135
|
+
constructor(o, i) {
|
|
1136
|
+
if (this._sweep = null, this._isByCell = !1, this._cellComparator = null, this._lastCell = null, this._reuse = null, !o || o.length === 0) return;
|
|
1137
1137
|
let l, s = !0, c = !1, d = !1;
|
|
1138
|
-
if (
|
|
1139
|
-
let
|
|
1138
|
+
if (i && (s = (i.axis ?? ie.Column) !== ie.Row, c = i.reverse ?? !1, d = i.byCell ?? !1, l = i.reuseIterator), this._isByCell = d, l) {
|
|
1139
|
+
let y = typeof l == "boolean" ? {
|
|
1140
1140
|
done: !1,
|
|
1141
1141
|
value: {
|
|
1142
1142
|
cell: null,
|
|
@@ -1144,23 +1144,23 @@ var ri, Ae = (e, t) => {
|
|
|
1144
1144
|
overlaps: null
|
|
1145
1145
|
}
|
|
1146
1146
|
} : l;
|
|
1147
|
-
|
|
1148
|
-
let
|
|
1149
|
-
|
|
1147
|
+
y.done = !1;
|
|
1148
|
+
let w = y.value;
|
|
1149
|
+
w ||= y.value = {
|
|
1150
1150
|
cell: null,
|
|
1151
1151
|
range: null,
|
|
1152
1152
|
overlaps: null
|
|
1153
|
-
},
|
|
1153
|
+
}, w.range || (w.range = {
|
|
1154
1154
|
colStart: 0,
|
|
1155
1155
|
rowStart: 0,
|
|
1156
1156
|
colEnd: 0,
|
|
1157
1157
|
rowEnd: 0
|
|
1158
|
-
}),
|
|
1158
|
+
}), w.cell = d ? w.cell ?? {
|
|
1159
1159
|
colIndex: -1,
|
|
1160
1160
|
rowIndex: -1
|
|
1161
|
-
} : null, this._reuse =
|
|
1161
|
+
} : null, this._reuse = y;
|
|
1162
1162
|
}
|
|
1163
|
-
let m =
|
|
1163
|
+
let m = o.length, a = {
|
|
1164
1164
|
count: m,
|
|
1165
1165
|
rowS: new Int32Array(m),
|
|
1166
1166
|
rowE: new Int32Array(m),
|
|
@@ -1169,77 +1169,77 @@ var ri, Ae = (e, t) => {
|
|
|
1169
1169
|
type: new Uint16Array(m),
|
|
1170
1170
|
value: [],
|
|
1171
1171
|
keys: ["range"]
|
|
1172
|
-
},
|
|
1173
|
-
for (let
|
|
1174
|
-
let
|
|
1175
|
-
a.rowS[
|
|
1172
|
+
}, p = 2 ** 53 - 1, b = -(2 ** 53 - 1), S = 2 ** 53 - 1, A = -(2 ** 53 - 1);
|
|
1173
|
+
for (let y = 0; y < m; y++) {
|
|
1174
|
+
let w = o[y];
|
|
1175
|
+
a.rowS[y] = w.rowStart, a.rowE[y] = w.rowEnd, a.colS[y] = w.colStart, a.colE[y] = w.colEnd, a.value.push(w), w.rowStart < p && (p = w.rowStart), w.rowEnd > b && (b = w.rowEnd), w.colStart < S && (S = w.colStart), w.colEnd > A && (A = w.colEnd);
|
|
1176
1176
|
}
|
|
1177
1177
|
let U = {
|
|
1178
|
-
rowStart:
|
|
1178
|
+
rowStart: p,
|
|
1179
1179
|
rowEnd: b,
|
|
1180
|
-
colStart:
|
|
1180
|
+
colStart: S,
|
|
1181
1181
|
colEnd: A
|
|
1182
1182
|
}, h = this._sweep = new t(a, U, s, c);
|
|
1183
|
-
d ? this._cellComparator =
|
|
1183
|
+
d ? this._cellComparator = xr(s ? ie.Column : ie.Row, c) : l && (h._reuseOverlaps = []);
|
|
1184
1184
|
}
|
|
1185
|
-
next(
|
|
1186
|
-
let
|
|
1187
|
-
if (!
|
|
1185
|
+
next(o) {
|
|
1186
|
+
let i = this._sweep;
|
|
1187
|
+
if (!i) return je;
|
|
1188
1188
|
let l = this._isByCell, s;
|
|
1189
|
-
if (
|
|
1189
|
+
if (o) {
|
|
1190
1190
|
if (!l) throw Error("nextCell is only supported when byCell is true");
|
|
1191
1191
|
let a = this._lastCell;
|
|
1192
|
-
if (a && this._cellComparator(a,
|
|
1193
|
-
s =
|
|
1194
|
-
} else s = l ?
|
|
1195
|
-
if (!s) return this._sweep = null,
|
|
1192
|
+
if (a && this._cellComparator(a, o) >= 0) throw Error("nextCell must be after the current iteration cell");
|
|
1193
|
+
s = i.seekCell(o.rowIndex, o.colIndex);
|
|
1194
|
+
} else s = l ? i.nextCell() : i.nextRegion();
|
|
1195
|
+
if (!s) return this._sweep = null, je;
|
|
1196
1196
|
let c = this._reuse;
|
|
1197
1197
|
if (c) {
|
|
1198
1198
|
let a = c.value;
|
|
1199
1199
|
c.done = !1;
|
|
1200
|
-
let
|
|
1201
|
-
if (
|
|
1200
|
+
let p = a.range;
|
|
1201
|
+
if (p.colStart = i.colStart, p.rowStart = i.rowStart, p.colEnd = i.colEnd, p.rowEnd = i.rowEnd, l) {
|
|
1202
1202
|
let b = a.cell;
|
|
1203
|
-
b.colIndex =
|
|
1204
|
-
let
|
|
1205
|
-
|
|
1203
|
+
b.colIndex = i.cellCol, b.rowIndex = i.cellRow;
|
|
1204
|
+
let S = this._lastCell;
|
|
1205
|
+
S ||= this._lastCell = {
|
|
1206
1206
|
colIndex: 0,
|
|
1207
1207
|
rowIndex: 0
|
|
1208
|
-
},
|
|
1208
|
+
}, S.colIndex = i.cellCol, S.rowIndex = i.cellRow;
|
|
1209
1209
|
}
|
|
1210
|
-
return a.overlaps =
|
|
1210
|
+
return a.overlaps = i.intersection, c;
|
|
1211
1211
|
}
|
|
1212
|
-
let d = null, m =
|
|
1212
|
+
let d = null, m = i.intersection;
|
|
1213
1213
|
return l && (d = this._lastCell = {
|
|
1214
|
-
colIndex:
|
|
1215
|
-
rowIndex:
|
|
1214
|
+
colIndex: i.cellCol,
|
|
1215
|
+
rowIndex: i.cellRow
|
|
1216
1216
|
}, m = m.slice()), {
|
|
1217
1217
|
done: !1,
|
|
1218
1218
|
value: {
|
|
1219
1219
|
cell: d,
|
|
1220
1220
|
range: {
|
|
1221
|
-
colStart:
|
|
1222
|
-
rowStart:
|
|
1223
|
-
colEnd:
|
|
1224
|
-
rowEnd:
|
|
1221
|
+
colStart: i.colStart,
|
|
1222
|
+
rowStart: i.rowStart,
|
|
1223
|
+
colEnd: i.colEnd,
|
|
1224
|
+
rowEnd: i.rowEnd
|
|
1225
1225
|
},
|
|
1226
1226
|
overlaps: m
|
|
1227
1227
|
}
|
|
1228
1228
|
};
|
|
1229
1229
|
}
|
|
1230
|
-
return(
|
|
1231
|
-
return
|
|
1230
|
+
return(o) {
|
|
1231
|
+
return je;
|
|
1232
1232
|
}
|
|
1233
|
-
throw(
|
|
1234
|
-
return
|
|
1233
|
+
throw(o) {
|
|
1234
|
+
return je;
|
|
1235
1235
|
}
|
|
1236
1236
|
[Symbol.iterator]() {
|
|
1237
1237
|
return this;
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
1240
|
e.IteratorInstance = r;
|
|
1241
|
-
})(
|
|
1242
|
-
var
|
|
1241
|
+
})(no ||= {});
|
|
1242
|
+
var io = class {
|
|
1243
1243
|
constructor() {
|
|
1244
1244
|
this._onceMessageKeys = /* @__PURE__ */ new Set(), this._overrides = null;
|
|
1245
1245
|
}
|
|
@@ -1251,14 +1251,14 @@ var ii = class {
|
|
|
1251
1251
|
}
|
|
1252
1252
|
_write(e, t, r) {
|
|
1253
1253
|
if (r?.onceKey) {
|
|
1254
|
-
let
|
|
1255
|
-
if (
|
|
1256
|
-
|
|
1254
|
+
let i = this._onceMessageKeys;
|
|
1255
|
+
if (i.has(r.onceKey)) return;
|
|
1256
|
+
i.add(r.onceKey);
|
|
1257
1257
|
}
|
|
1258
|
-
let n = r?.meta,
|
|
1259
|
-
if (
|
|
1260
|
-
let
|
|
1261
|
-
if (
|
|
1258
|
+
let n = r?.meta, o = this._overrides;
|
|
1259
|
+
if (o) {
|
|
1260
|
+
let i = o[e];
|
|
1261
|
+
if (i) return void i.bind(o)(t, r);
|
|
1262
1262
|
}
|
|
1263
1263
|
n === void 0 ? console[e](t) : console[e](t, n);
|
|
1264
1264
|
}
|
|
@@ -1275,127 +1275,127 @@ var ii = class {
|
|
|
1275
1275
|
return this._write("debug", e, t);
|
|
1276
1276
|
}
|
|
1277
1277
|
};
|
|
1278
|
-
new
|
|
1279
|
-
var
|
|
1278
|
+
new io();
|
|
1279
|
+
var tt;
|
|
1280
1280
|
ge({
|
|
1281
|
-
EmptyBounds: () =>
|
|
1282
|
-
EmptyRect: () =>
|
|
1283
|
-
EmptyTopLeft: () =>
|
|
1281
|
+
EmptyBounds: () => so,
|
|
1282
|
+
EmptyRect: () => lo,
|
|
1283
|
+
EmptyTopLeft: () => ao
|
|
1284
1284
|
});
|
|
1285
|
-
var
|
|
1285
|
+
var ao = Object.freeze({
|
|
1286
1286
|
left: 0,
|
|
1287
1287
|
top: 0
|
|
1288
|
-
}),
|
|
1288
|
+
}), lo = Object.freeze({
|
|
1289
1289
|
left: 0,
|
|
1290
1290
|
top: 0,
|
|
1291
1291
|
bottom: 0,
|
|
1292
1292
|
right: 0
|
|
1293
|
-
}),
|
|
1293
|
+
}), so = Object.freeze({
|
|
1294
1294
|
x: 0,
|
|
1295
1295
|
y: 0,
|
|
1296
1296
|
width: 0,
|
|
1297
1297
|
height: 0
|
|
1298
1298
|
});
|
|
1299
1299
|
ge({
|
|
1300
|
-
canUseDOM: () =>
|
|
1301
|
-
getDPI: () =>
|
|
1302
|
-
hasFocus: () =>
|
|
1303
|
-
openFileDialog: () =>
|
|
1304
|
-
scrollIntoContainer: () =>
|
|
1305
|
-
whenFocus: () =>
|
|
1300
|
+
canUseDOM: () => Mr,
|
|
1301
|
+
getDPI: () => uo,
|
|
1302
|
+
hasFocus: () => Or,
|
|
1303
|
+
openFileDialog: () => co,
|
|
1304
|
+
scrollIntoContainer: () => fo,
|
|
1305
|
+
whenFocus: () => po
|
|
1306
1306
|
});
|
|
1307
|
-
var
|
|
1308
|
-
if (!
|
|
1307
|
+
var Mr = !(typeof window > "u" || !window.document || !window.document.createElement), co = (e = "*.*") => new Promise((t, r) => {
|
|
1308
|
+
if (!Mr) return void r("Unable to open dialog with no dom.");
|
|
1309
1309
|
let n = document.createElement("input");
|
|
1310
1310
|
n.type = "file", n.accept = e;
|
|
1311
|
-
let
|
|
1311
|
+
let o = null, i = !1;
|
|
1312
1312
|
globalThis.addEventListener?.("focus", () => {
|
|
1313
1313
|
setTimeout(() => {
|
|
1314
|
-
|
|
1314
|
+
o || i || (i = !0, t(null));
|
|
1315
1315
|
}, 1e3);
|
|
1316
1316
|
}, {
|
|
1317
1317
|
once: !0,
|
|
1318
1318
|
passive: !0
|
|
1319
1319
|
}), n.onchange = () => {
|
|
1320
|
-
if (
|
|
1321
|
-
if (
|
|
1322
|
-
t(
|
|
1320
|
+
if (o = n.files?.[0] ?? null, o) {
|
|
1321
|
+
if (i) return void console.warn("File open detected after faux cancel.", o);
|
|
1322
|
+
t(o);
|
|
1323
1323
|
}
|
|
1324
1324
|
}, n.autofocus = !0, n.click();
|
|
1325
|
-
}),
|
|
1325
|
+
}), uo = () => {
|
|
1326
1326
|
let e = 1;
|
|
1327
1327
|
return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
|
|
1328
|
-
},
|
|
1328
|
+
}, Or = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), fo = (e, t, r = "auto") => {
|
|
1329
1329
|
if ((() => {
|
|
1330
|
-
if (
|
|
1330
|
+
if (tt === void 0) {
|
|
1331
1331
|
let c = !1;
|
|
1332
1332
|
try {
|
|
1333
1333
|
document.createElement("div").scrollIntoView({ get container() {
|
|
1334
1334
|
return c = !0, "nearest";
|
|
1335
1335
|
} });
|
|
1336
1336
|
} catch {}
|
|
1337
|
-
|
|
1337
|
+
tt = c;
|
|
1338
1338
|
}
|
|
1339
|
-
return
|
|
1339
|
+
return tt;
|
|
1340
1340
|
})()) return void t.scrollIntoView({
|
|
1341
1341
|
block: "nearest",
|
|
1342
1342
|
inline: "nearest",
|
|
1343
1343
|
behavior: r,
|
|
1344
1344
|
container: "nearest"
|
|
1345
1345
|
});
|
|
1346
|
-
let n = e.getBoundingClientRect(),
|
|
1347
|
-
|
|
1346
|
+
let n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), i = n.top + e.clientTop, l = i + e.clientHeight, s = 0;
|
|
1347
|
+
o.top < i ? s = o.top - i : o.bottom > l && (s = Math.min(o.bottom - l, o.top - i)), s !== 0 && e.scrollBy({
|
|
1348
1348
|
top: s,
|
|
1349
1349
|
behavior: r
|
|
1350
1350
|
});
|
|
1351
|
-
},
|
|
1352
|
-
|
|
1351
|
+
}, po = async (e, t = !1) => new Promise((r) => {
|
|
1352
|
+
Or(e, t) ? r(!0) : e.addEventListener("focusin", () => {
|
|
1353
1353
|
r(!0);
|
|
1354
1354
|
}, { once: !0 }), e.focus();
|
|
1355
1355
|
});
|
|
1356
1356
|
ge({
|
|
1357
|
-
cancelTimeout: () =>
|
|
1358
|
-
debounce: () =>
|
|
1359
|
-
nextTick: () =>
|
|
1360
|
-
rafThrottle: () =>
|
|
1361
|
-
requestTimeout: () =>
|
|
1362
|
-
throttle: () =>
|
|
1357
|
+
cancelTimeout: () => So,
|
|
1358
|
+
debounce: () => go,
|
|
1359
|
+
nextTick: () => wo,
|
|
1360
|
+
rafThrottle: () => yo,
|
|
1361
|
+
requestTimeout: () => bo,
|
|
1362
|
+
throttle: () => ho
|
|
1363
1363
|
});
|
|
1364
|
-
var
|
|
1365
|
-
function
|
|
1364
|
+
var Ue = globalThis.requestAnimationFrame, mo = globalThis.cancelAnimationFrame;
|
|
1365
|
+
function ho(e, t) {
|
|
1366
1366
|
let r = null;
|
|
1367
1367
|
return (...n) => {
|
|
1368
|
-
let
|
|
1369
|
-
(!r ||
|
|
1368
|
+
let o = Date.now();
|
|
1369
|
+
(!r || o - r >= t) && (r = o, e(...n));
|
|
1370
1370
|
};
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1373
|
-
let n,
|
|
1372
|
+
function go(e, t = 300, r = !1) {
|
|
1373
|
+
let n, o, i, l = null, s = 0;
|
|
1374
1374
|
function c() {
|
|
1375
1375
|
let m = Date.now() - s;
|
|
1376
|
-
m < t && m >= 0 ? l = setTimeout(c, t - m) : (l = null, r || (
|
|
1376
|
+
m < t && m >= 0 ? l = setTimeout(c, t - m) : (l = null, r || (i = e.apply(o, n), o = n = null));
|
|
1377
1377
|
}
|
|
1378
1378
|
t ??= 100;
|
|
1379
1379
|
let d = function() {
|
|
1380
|
-
|
|
1380
|
+
o = globalThis, n = arguments, s = Date.now();
|
|
1381
1381
|
var m = r && !l;
|
|
1382
|
-
return l ||= setTimeout(c, t), m && (
|
|
1382
|
+
return l ||= setTimeout(c, t), m && (i = e.apply(o, n), o = n = null), i;
|
|
1383
1383
|
};
|
|
1384
1384
|
return d.clear = function() {
|
|
1385
1385
|
l &&= (clearTimeout(l), null);
|
|
1386
1386
|
}, d.flush = function() {
|
|
1387
|
-
l &&= (
|
|
1387
|
+
l &&= (i = e.apply(o, n), o = n = null, clearTimeout(l), null);
|
|
1388
1388
|
}, d;
|
|
1389
1389
|
}
|
|
1390
|
-
var
|
|
1390
|
+
var yo = (e) => {
|
|
1391
1391
|
let t, r = !1, n = function() {
|
|
1392
1392
|
r = !1, e(t);
|
|
1393
1393
|
};
|
|
1394
|
-
return function(
|
|
1395
|
-
t =
|
|
1394
|
+
return function(o) {
|
|
1395
|
+
t = o, t && t.persist && t.persist(), r || (r = !0, Ue(n));
|
|
1396
1396
|
};
|
|
1397
|
-
},
|
|
1398
|
-
if (typeof
|
|
1397
|
+
}, wo = (e) => {
|
|
1398
|
+
if (typeof Ue == "function") Ue(() => {
|
|
1399
1399
|
e();
|
|
1400
1400
|
});
|
|
1401
1401
|
else {
|
|
@@ -1404,60 +1404,60 @@ var hi = (e) => {
|
|
|
1404
1404
|
e();
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
1407
|
-
},
|
|
1408
|
-
|
|
1409
|
-
},
|
|
1410
|
-
let r =
|
|
1411
|
-
|
|
1407
|
+
}, Ct = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), So = (e) => {
|
|
1408
|
+
mo(e.id);
|
|
1409
|
+
}, bo = (e, t) => {
|
|
1410
|
+
let r = Ct(), n = { id: Ue(function o() {
|
|
1411
|
+
Ct() - r >= t ? e.call(null) : n.id = Ue(o);
|
|
1412
1412
|
}) };
|
|
1413
1413
|
return n;
|
|
1414
1414
|
};
|
|
1415
|
-
ge({ MESSAGE_ERROR_INVALID_ARG: () =>
|
|
1416
|
-
var
|
|
1415
|
+
ge({ MESSAGE_ERROR_INVALID_ARG: () => vo });
|
|
1416
|
+
var vo = (e) => \`Invalid argument: '\${e}'.\`;
|
|
1417
1417
|
ge({
|
|
1418
|
-
APP_MIME_TYPE: () =>
|
|
1418
|
+
APP_MIME_TYPE: () => Eo,
|
|
1419
1419
|
DEFAULT_MIME_TYPE: () => "*/*",
|
|
1420
|
-
JSONStableStringify: () =>
|
|
1421
|
-
arrayBufferToBase64: () =>
|
|
1422
|
-
base64ToArrayBuffer: () =>
|
|
1423
|
-
blobToString: () =>
|
|
1424
|
-
isLittleEndian: () =>
|
|
1425
|
-
isNodeBuffer: () =>
|
|
1426
|
-
isSharedArrayBufferSupported: () =>
|
|
1420
|
+
JSONStableStringify: () => Io,
|
|
1421
|
+
arrayBufferToBase64: () => Dr,
|
|
1422
|
+
base64ToArrayBuffer: () => Co,
|
|
1423
|
+
blobToString: () => ft,
|
|
1424
|
+
isLittleEndian: () => To,
|
|
1425
|
+
isNodeBuffer: () => _o,
|
|
1426
|
+
isSharedArrayBufferSupported: () => xo
|
|
1427
1427
|
});
|
|
1428
|
-
var
|
|
1429
|
-
let t = typeof globalThis.atob == "function" ? globalThis.atob(e) :
|
|
1430
|
-
for (let
|
|
1428
|
+
var Eo = "application/octet-stream", Ie = globalThis.Buffer, _o = (e) => Ie?.isBuffer(e) ?? !1, xo = typeof SharedArrayBuffer == "function" && (globalThis.crossOriginIsolated === void 0 || globalThis.crossOriginIsolated === !0), To = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1, It = globalThis.FileReader, Co = (e) => {
|
|
1429
|
+
let t = typeof globalThis.atob == "function" ? globalThis.atob(e) : Ie.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
|
|
1430
|
+
for (let o = 0; o < r; o++) n[o] = t.charCodeAt(o);
|
|
1431
1431
|
return n.buffer;
|
|
1432
|
-
},
|
|
1432
|
+
}, Dr = (e) => {
|
|
1433
1433
|
let t = new Uint8Array(e), r = t.byteLength, n = "";
|
|
1434
|
-
for (let
|
|
1434
|
+
for (let o = 0; o < r; o++) n += String.fromCharCode(t[o]);
|
|
1435
1435
|
if (typeof globalThis.btoa == "function") return globalThis.btoa(n);
|
|
1436
|
-
if (
|
|
1436
|
+
if (Ie) return Ie.from(n, "binary").toString("base64");
|
|
1437
1437
|
throw Error("Unsupported environment");
|
|
1438
|
-
},
|
|
1439
|
-
if (e) if (
|
|
1440
|
-
let n = new
|
|
1438
|
+
}, ft = (e) => new Promise((t, r) => {
|
|
1439
|
+
if (e) if (It) {
|
|
1440
|
+
let n = new It();
|
|
1441
1441
|
n.onload = () => {
|
|
1442
1442
|
t(n.result);
|
|
1443
1443
|
}, n.onerror = () => {
|
|
1444
1444
|
r(n.error);
|
|
1445
1445
|
}, n.readAsText(e);
|
|
1446
|
-
} else if (
|
|
1447
|
-
let n = (
|
|
1448
|
-
e.arrayBuffer().then((
|
|
1449
|
-
t(n(
|
|
1450
|
-
}).catch((
|
|
1451
|
-
r(
|
|
1446
|
+
} else if (Ie) {
|
|
1447
|
+
let n = (o) => Ie.from(o).toString("utf-8");
|
|
1448
|
+
e.arrayBuffer().then((o) => {
|
|
1449
|
+
t(n(o));
|
|
1450
|
+
}).catch((o) => {
|
|
1451
|
+
r(o);
|
|
1452
1452
|
});
|
|
1453
1453
|
} else r(/* @__PURE__ */ Error("Unsupported environment"));
|
|
1454
1454
|
else t("");
|
|
1455
1455
|
});
|
|
1456
|
-
function
|
|
1456
|
+
function Io(e, t) {
|
|
1457
1457
|
t ||= {}, typeof t == "function" && (t = { cmp: t });
|
|
1458
|
-
let r = typeof t.cycles == "boolean" && t.cycles, n = t.cmp && (
|
|
1458
|
+
let r = typeof t.cycles == "boolean" && t.cycles, n = t.cmp && (o = t.cmp, function(l) {
|
|
1459
1459
|
return function(s, c) {
|
|
1460
|
-
return
|
|
1460
|
+
return o({
|
|
1461
1461
|
key: s,
|
|
1462
1462
|
value: l[s]
|
|
1463
1463
|
}, {
|
|
@@ -1466,8 +1466,8 @@ function Ti(e, t) {
|
|
|
1466
1466
|
});
|
|
1467
1467
|
};
|
|
1468
1468
|
});
|
|
1469
|
-
var
|
|
1470
|
-
let
|
|
1469
|
+
var o;
|
|
1470
|
+
let i = [];
|
|
1471
1471
|
return (function l(s) {
|
|
1472
1472
|
if (s && s.toJSON && typeof s.toJSON == "function" && (s = s.toJSON()), s === void 0) return;
|
|
1473
1473
|
if (typeof s == "number") return isFinite(s) ? "" + s : "null";
|
|
@@ -1479,155 +1479,155 @@ function Ti(e, t) {
|
|
|
1479
1479
|
return c + "]";
|
|
1480
1480
|
}
|
|
1481
1481
|
if (s === null) return "null";
|
|
1482
|
-
if (
|
|
1482
|
+
if (i.indexOf(s) !== -1) {
|
|
1483
1483
|
if (r) return JSON.stringify("__cycle__");
|
|
1484
1484
|
throw TypeError("Converting circular structure to JSON");
|
|
1485
1485
|
}
|
|
1486
|
-
let d =
|
|
1486
|
+
let d = i.push(s) - 1, m = Object.keys(s).sort(n && n(s));
|
|
1487
1487
|
c = "";
|
|
1488
1488
|
for (let a = 0; a < m.length; a++) {
|
|
1489
|
-
let
|
|
1490
|
-
b && (c && (c += ","), c += JSON.stringify(
|
|
1489
|
+
let p = m[a], b = l(s[p]);
|
|
1490
|
+
b && (c && (c += ","), c += JSON.stringify(p) + ":" + b);
|
|
1491
1491
|
}
|
|
1492
|
-
return
|
|
1492
|
+
return i.splice(d, 1), "{" + c + "}";
|
|
1493
1493
|
})(e);
|
|
1494
1494
|
}
|
|
1495
|
-
var
|
|
1495
|
+
var Ao;
|
|
1496
1496
|
ge({
|
|
1497
1497
|
DATA_URL_PNG_PREFIX: () => Fr,
|
|
1498
|
-
getImageDataUrl: () =>
|
|
1499
|
-
loadImageDetails: () =>
|
|
1498
|
+
getImageDataUrl: () => Ro,
|
|
1499
|
+
loadImageDetails: () => $o
|
|
1500
1500
|
});
|
|
1501
|
-
var Fr = "data:image/png;base64,",
|
|
1501
|
+
var Fr = "data:image/png;base64,", Ur = "Unable to resolve image.", At = (e) => new Promise(async (t, r) => {
|
|
1502
1502
|
let n = null;
|
|
1503
1503
|
try {
|
|
1504
|
-
let
|
|
1505
|
-
|
|
1504
|
+
let o = n = new Image();
|
|
1505
|
+
o.src = e, o.addEventListener("load", function() {
|
|
1506
1506
|
t({
|
|
1507
|
-
width:
|
|
1508
|
-
height:
|
|
1507
|
+
width: o.naturalWidth,
|
|
1508
|
+
height: o.naturalHeight
|
|
1509
1509
|
});
|
|
1510
|
-
}, { once: !0 }),
|
|
1510
|
+
}, { once: !0 }), o.addEventListener("error", function(i) {
|
|
1511
1511
|
URL.revokeObjectURL(e);
|
|
1512
|
-
let l =
|
|
1512
|
+
let l = i?.error?.message ?? "";
|
|
1513
1513
|
l &&= \`: \${l}\`, r(\`Invalid Image\${l}\`);
|
|
1514
|
-
}, { once: !0 }), await
|
|
1514
|
+
}, { once: !0 }), await o.decode();
|
|
1515
1515
|
} catch {
|
|
1516
1516
|
n?.src && URL.revokeObjectURL(n.src);
|
|
1517
1517
|
}
|
|
1518
|
-
n || r(Error(
|
|
1519
|
-
}),
|
|
1520
|
-
let
|
|
1518
|
+
n || r(Error(Ur));
|
|
1519
|
+
}), Ro = (e, t = 1) => new Promise(async (r, n) => {
|
|
1520
|
+
let o = null;
|
|
1521
1521
|
try {
|
|
1522
|
-
let
|
|
1523
|
-
|
|
1522
|
+
let i = o = new Image();
|
|
1523
|
+
i.src = e, i.addEventListener("load", function() {
|
|
1524
1524
|
try {
|
|
1525
1525
|
let l = document.createElement("canvas");
|
|
1526
|
-
l.width =
|
|
1526
|
+
l.width = i.naturalWidth, l.height = i.naturalHeight;
|
|
1527
1527
|
let s = l.getContext("2d");
|
|
1528
1528
|
if (!s) throw Error("Unable to create 2d context");
|
|
1529
|
-
s.drawImage(
|
|
1529
|
+
s.drawImage(i, 0, 0);
|
|
1530
1530
|
let c = l.toDataURL("image/png", t);
|
|
1531
1531
|
r({
|
|
1532
|
-
elemImg:
|
|
1532
|
+
elemImg: i,
|
|
1533
1533
|
dataUrl: c
|
|
1534
1534
|
});
|
|
1535
1535
|
} catch (l) {
|
|
1536
1536
|
URL.revokeObjectURL(e), n(l);
|
|
1537
1537
|
}
|
|
1538
|
-
}, { once: !0 }),
|
|
1538
|
+
}, { once: !0 }), i.addEventListener("error", function() {
|
|
1539
1539
|
URL.revokeObjectURL(e), n("Invalid Image");
|
|
1540
|
-
}, { once: !0 }), await
|
|
1540
|
+
}, { once: !0 }), await i.decode();
|
|
1541
1541
|
} catch {
|
|
1542
|
-
|
|
1542
|
+
o?.src && URL.revokeObjectURL(o.src);
|
|
1543
1543
|
}
|
|
1544
|
-
|
|
1545
|
-
}),
|
|
1544
|
+
o || n(Error(Ur));
|
|
1545
|
+
}), rt = "image/svg+xml", $o = async (e, t = null) => {
|
|
1546
1546
|
let r = null, n = async () => {
|
|
1547
1547
|
try {
|
|
1548
|
-
let
|
|
1548
|
+
let i = t ?? "image/*", l = URL.createObjectURL(new Blob([e], { type: i }));
|
|
1549
1549
|
r = {
|
|
1550
|
-
mimeType:
|
|
1551
|
-
naturalSize: await
|
|
1550
|
+
mimeType: i,
|
|
1551
|
+
naturalSize: await At(l),
|
|
1552
1552
|
asUrl: l
|
|
1553
1553
|
};
|
|
1554
1554
|
} catch {}
|
|
1555
|
-
},
|
|
1555
|
+
}, o = async () => {
|
|
1556
1556
|
try {
|
|
1557
|
-
let
|
|
1557
|
+
let i = new TextDecoder().decode(e), l = URL.createObjectURL(new Blob([i], { type: rt })), s = await At(l);
|
|
1558
1558
|
r = {
|
|
1559
|
-
mimeType: t ??
|
|
1559
|
+
mimeType: t ?? rt,
|
|
1560
1560
|
naturalSize: s,
|
|
1561
1561
|
asUrl: l,
|
|
1562
|
-
asSVGText:
|
|
1562
|
+
asSVGText: i
|
|
1563
1563
|
};
|
|
1564
1564
|
} catch {}
|
|
1565
1565
|
};
|
|
1566
|
-
if (t ===
|
|
1566
|
+
if (t === rt ? await o() : t?.startsWith("image/") ? await n() : (await n(), r || await o()), !r) throw Error("Failed to load image");
|
|
1567
1567
|
return r;
|
|
1568
|
-
},
|
|
1569
|
-
|
|
1568
|
+
}, Rt = /* @__PURE__ */ new Set(), No = (e) => {
|
|
1569
|
+
Rt.has(e) || (Rt.add(e), console.warn(\`Unknown property '\${e}' in update; ignoring.\`));
|
|
1570
1570
|
};
|
|
1571
1571
|
(function(e) {
|
|
1572
1572
|
e.PassThrough = Object.freeze({});
|
|
1573
|
-
let t = e.resolveTypedUpdates = (r, n,
|
|
1573
|
+
let t = e.resolveTypedUpdates = (r, n, o, i, l = !1) => {
|
|
1574
1574
|
if (r === null) return r;
|
|
1575
|
-
if (r === void 0) return
|
|
1575
|
+
if (r === void 0) return i;
|
|
1576
1576
|
let s = r;
|
|
1577
1577
|
if (n?.shorthand) {
|
|
1578
|
-
let a = n?.shorthand(r,
|
|
1578
|
+
let a = n?.shorthand(r, o);
|
|
1579
1579
|
a !== void 0 && (s = a);
|
|
1580
1580
|
}
|
|
1581
1581
|
if (s !== null && n?.getSubType) {
|
|
1582
|
-
let a = n.getSubType(s,
|
|
1582
|
+
let a = n.getSubType(s, i);
|
|
1583
1583
|
a && (n = a);
|
|
1584
1584
|
}
|
|
1585
1585
|
let c = n?.properties, d = n?.arrayType ?? !1, m = s;
|
|
1586
|
-
if (n && n.merge && m &&
|
|
1586
|
+
if (n && n.merge && m && i) m = n.merge(m, i, o);
|
|
1587
1587
|
else if (!d && c) {
|
|
1588
1588
|
let a = Object.keys({
|
|
1589
1589
|
...s,
|
|
1590
|
-
...
|
|
1590
|
+
...i
|
|
1591
1591
|
});
|
|
1592
1592
|
m = null;
|
|
1593
|
-
let
|
|
1594
|
-
for (let b = 0; b <
|
|
1595
|
-
let
|
|
1593
|
+
let p = a.length;
|
|
1594
|
+
for (let b = 0; b < p; b++) {
|
|
1595
|
+
let S = a[b], A, U = s?.[S];
|
|
1596
1596
|
if (U !== void 0) {
|
|
1597
|
-
let h = c[
|
|
1597
|
+
let h = c[S];
|
|
1598
1598
|
if (!h) {
|
|
1599
|
-
|
|
1599
|
+
No(S);
|
|
1600
1600
|
continue;
|
|
1601
1601
|
}
|
|
1602
|
-
A = t(U, h,
|
|
1603
|
-
} else A =
|
|
1604
|
-
A == null ? l && U === null && (m ??= {}, m[
|
|
1602
|
+
A = t(U, h, o, i?.[S], l);
|
|
1603
|
+
} else A = i?.[S];
|
|
1604
|
+
A == null ? l && U === null && (m ??= {}, m[S] = null) : (m ??= {}, m[S] = A);
|
|
1605
1605
|
}
|
|
1606
1606
|
}
|
|
1607
1607
|
return m;
|
|
1608
1608
|
};
|
|
1609
|
-
})(
|
|
1610
|
-
var
|
|
1609
|
+
})(Ao ||= {});
|
|
1610
|
+
var wt = {
|
|
1611
1611
|
code: "safari",
|
|
1612
1612
|
message: \`The Safari browser does not support advanced copy and paste.
|
|
1613
1613
|
Copy and paste will be limited to within the browser tab.
|
|
1614
1614
|
|
|
1615
1615
|
Please use Chrome or Edge if external copy and paste is required.\`
|
|
1616
|
-
},
|
|
1616
|
+
}, Br = {
|
|
1617
1617
|
code: "perms",
|
|
1618
1618
|
message: \`You do not have permissions to access the clipboard.
|
|
1619
1619
|
All copy and paste operations will be limited to the browser tab.\`
|
|
1620
|
-
},
|
|
1621
|
-
Safari:
|
|
1622
|
-
Perms:
|
|
1623
|
-
PermsWrite:
|
|
1624
|
-
PermsRead:
|
|
1625
|
-
},
|
|
1620
|
+
}, $t = Ye() === pe.Safari ? wt : Br, ko = {
|
|
1621
|
+
Safari: wt,
|
|
1622
|
+
Perms: Br,
|
|
1623
|
+
PermsWrite: $t,
|
|
1624
|
+
PermsRead: $t
|
|
1625
|
+
}, nt = async () => new Promise((e) => {
|
|
1626
1626
|
document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
|
|
1627
1627
|
e();
|
|
1628
1628
|
}, { once: !0 }), document.activeElement.focus?.();
|
|
1629
|
-
}),
|
|
1630
|
-
if (
|
|
1629
|
+
}), ot = async (e, t, r) => {
|
|
1630
|
+
if (Ye() === pe.Safari) return await r(Error(wt.message));
|
|
1631
1631
|
try {
|
|
1632
1632
|
let n = async (l) => {
|
|
1633
1633
|
try {
|
|
@@ -1636,38 +1636,38 @@ All copy and paste operations will be limited to the browser tab.\`
|
|
|
1636
1636
|
if (s.message?.includes("Document is not focused")) return !1;
|
|
1637
1637
|
throw s;
|
|
1638
1638
|
}
|
|
1639
|
-
},
|
|
1639
|
+
}, o = await globalThis?.navigator?.permissions?.query({
|
|
1640
1640
|
name: e,
|
|
1641
1641
|
allowWithoutGesture: !0,
|
|
1642
1642
|
allowWithoutSanitization: !0
|
|
1643
|
-
}),
|
|
1644
|
-
if (
|
|
1643
|
+
}), i = !1;
|
|
1644
|
+
if (o.state === "prompt" && (i = await n(t)), i || o.state !== "granted" || (i = await t()), !i) return await r(Error(o.state));
|
|
1645
1645
|
} catch (n) {
|
|
1646
1646
|
return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
|
|
1647
1647
|
}
|
|
1648
|
-
},
|
|
1648
|
+
}, Pr = async (e) => {
|
|
1649
1649
|
if (!e) return null;
|
|
1650
1650
|
try {
|
|
1651
1651
|
return await e.read({ unsanitized: [J.Html] });
|
|
1652
1652
|
} catch {}
|
|
1653
1653
|
return await e.read();
|
|
1654
|
-
},
|
|
1654
|
+
}, Lo = async (e, t) => {
|
|
1655
1655
|
if (!e) return null;
|
|
1656
|
-
let r = await
|
|
1657
|
-
for (let
|
|
1656
|
+
let r = await Pr(e), n = !1;
|
|
1657
|
+
for (let o = 0; !n && r && o < r.length; o++) if (n = r[o].types.includes(t), n) return await r[o].getType(t);
|
|
1658
1658
|
return null;
|
|
1659
1659
|
};
|
|
1660
1660
|
if (!globalThis.ClipboardItem) {
|
|
1661
1661
|
let e = (r, n) => new Blob([n], { type: r });
|
|
1662
1662
|
class t {
|
|
1663
|
-
constructor(n,
|
|
1663
|
+
constructor(n, o) {
|
|
1664
1664
|
this._items = {}, this._types = Object.keys(n);
|
|
1665
|
-
let
|
|
1665
|
+
let i = {}, l = Object.keys(n);
|
|
1666
1666
|
for (let s = 0; s < l.length; s++) {
|
|
1667
1667
|
let c = l[s], d = n[c];
|
|
1668
|
-
|
|
1668
|
+
i[c] = typeof d == "string" ? e(c, d) : d;
|
|
1669
1669
|
}
|
|
1670
|
-
this._items =
|
|
1670
|
+
this._items = i, this._presentationStyle = o?.presentationStyle ?? "unspecified";
|
|
1671
1671
|
}
|
|
1672
1672
|
get types() {
|
|
1673
1673
|
return this._types;
|
|
@@ -1681,22 +1681,22 @@ if (!globalThis.ClipboardItem) {
|
|
|
1681
1681
|
}
|
|
1682
1682
|
globalThis.ClipboardItem = t;
|
|
1683
1683
|
}
|
|
1684
|
-
var
|
|
1684
|
+
var Nt, pt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
1685
1685
|
try {
|
|
1686
|
-
let
|
|
1687
|
-
if (
|
|
1688
|
-
let
|
|
1689
|
-
|
|
1690
|
-
r(
|
|
1691
|
-
},
|
|
1686
|
+
let o = await Lo(e, t);
|
|
1687
|
+
if (o) {
|
|
1688
|
+
let i = new FileReader();
|
|
1689
|
+
i.onload = () => {
|
|
1690
|
+
r(i.result);
|
|
1691
|
+
}, i.onerror = () => {
|
|
1692
1692
|
r("");
|
|
1693
|
-
},
|
|
1693
|
+
}, i.readAsText(o);
|
|
1694
1694
|
} else r("");
|
|
1695
|
-
} catch (
|
|
1696
|
-
n(
|
|
1695
|
+
} catch (o) {
|
|
1696
|
+
n(o);
|
|
1697
1697
|
}
|
|
1698
|
-
}),
|
|
1699
|
-
let r = await
|
|
1698
|
+
}), kt = async (e, t = J.Html) => {
|
|
1699
|
+
let r = await pt(e, t);
|
|
1700
1700
|
if (!r) return null;
|
|
1701
1701
|
let n = null;
|
|
1702
1702
|
try {
|
|
@@ -1705,13 +1705,13 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1705
1705
|
console.warn("Can't parse html from clipboard.");
|
|
1706
1706
|
}
|
|
1707
1707
|
return n;
|
|
1708
|
-
},
|
|
1708
|
+
}, Mo = async (e) => {
|
|
1709
1709
|
e && await e.writeText("");
|
|
1710
|
-
},
|
|
1710
|
+
}, Be = "clipboard-uuid", Me = "web text/uuid", Lt = (e) => \`<div style="display:none" \${Be}="\${e}"/>\`, Mt = { type: J.Plain }, Ot = { type: J.Html }, Dt = { type: Me }, Oo = (e, t) => {
|
|
1711
1711
|
let r = null;
|
|
1712
1712
|
try {
|
|
1713
1713
|
let n = new DOMParser().parseFromString(t, J.Html);
|
|
1714
|
-
n.body.firstElementChild?.setAttribute(
|
|
1714
|
+
n.body.firstElementChild?.setAttribute(Be, e), r = n.getElementsByTagName("body")[0].innerHTML;
|
|
1715
1715
|
} catch (n) {
|
|
1716
1716
|
console.warn("Can't embed uuid.", n);
|
|
1717
1717
|
}
|
|
@@ -1719,14 +1719,14 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1719
1719
|
}, Ft = (e, t) => {
|
|
1720
1720
|
if (!t || !e) return !1;
|
|
1721
1721
|
try {
|
|
1722
|
-
let r = t.querySelectorAll(\`[\${
|
|
1722
|
+
let r = t.querySelectorAll(\`[\${Be}="\${e}"]\`);
|
|
1723
1723
|
if (r && r.length === 1) return !0;
|
|
1724
1724
|
if (t.querySelector("parsererror")) throw Error("We are unable to parse node");
|
|
1725
1725
|
return !1;
|
|
1726
1726
|
} catch {
|
|
1727
1727
|
return !1;
|
|
1728
1728
|
}
|
|
1729
|
-
},
|
|
1729
|
+
}, Ut = class {
|
|
1730
1730
|
constructor(e) {
|
|
1731
1731
|
if (this._state = null, this._nativeClipboard = null, this._onFocus = null, this._onBlur = null, e?.nativeClipboard === void 0 || e?.nativeClipboard === !0) try {
|
|
1732
1732
|
this._nativeClipboard = globalThis?.navigator.clipboard;
|
|
@@ -1737,14 +1737,14 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1737
1737
|
this._disableCheckOnFocus = e?.disableCheckOnFocus ?? !1, this._init();
|
|
1738
1738
|
}
|
|
1739
1739
|
async _checkForChanges() {
|
|
1740
|
-
this._nativeClipboard && this._state && !this._disableCheckOnFocus && await
|
|
1741
|
-
await
|
|
1742
|
-
let e = await
|
|
1740
|
+
this._nativeClipboard && this._state && !this._disableCheckOnFocus && await ot("clipboard-read", async () => {
|
|
1741
|
+
await nt();
|
|
1742
|
+
let e = await pt(this._nativeClipboard, Me);
|
|
1743
1743
|
if (!this._state || e && e === this._state.uuid) return !0;
|
|
1744
|
-
let t = await
|
|
1744
|
+
let t = await kt(this._nativeClipboard, J.Html);
|
|
1745
1745
|
return !this._state || (Ft(this._state.uuid, t) || this.clear(), !0);
|
|
1746
1746
|
}, async (e) => {
|
|
1747
|
-
e?.message === "denied" || e.message?.includes("Document is not focused") ||
|
|
1747
|
+
e?.message === "denied" || e.message?.includes("Document is not focused") || Ye() === pe.Safari || console.warn("Unable to detect clipboard changes: ", e);
|
|
1748
1748
|
});
|
|
1749
1749
|
}
|
|
1750
1750
|
_init() {
|
|
@@ -1760,15 +1760,15 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1760
1760
|
async read() {
|
|
1761
1761
|
if (!this._nativeClipboard) return this._state?.items ?? null;
|
|
1762
1762
|
let e = this;
|
|
1763
|
-
return await
|
|
1764
|
-
if (await
|
|
1765
|
-
let t = await
|
|
1763
|
+
return await ot("clipboard-read", async () => {
|
|
1764
|
+
if (await nt(), this._state?.uuid) {
|
|
1765
|
+
let t = await pt(this._nativeClipboard, Me);
|
|
1766
1766
|
if (t && t === e._state?.uuid) return !0;
|
|
1767
|
-
let r = await
|
|
1767
|
+
let r = await kt(this._nativeClipboard, J.Html);
|
|
1768
1768
|
if (Ft(e._state?.uuid, r)) return !0;
|
|
1769
1769
|
}
|
|
1770
1770
|
return e._state = {
|
|
1771
|
-
items: await
|
|
1771
|
+
items: await Pr(this._nativeClipboard),
|
|
1772
1772
|
uuid: null,
|
|
1773
1773
|
ref: null
|
|
1774
1774
|
}, this.dispatchEvent(new Event("clipboardread")), !0;
|
|
@@ -1778,76 +1778,76 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1778
1778
|
}
|
|
1779
1779
|
async write(e) {
|
|
1780
1780
|
return this._write({
|
|
1781
|
-
uuid:
|
|
1781
|
+
uuid: He(),
|
|
1782
1782
|
items: e,
|
|
1783
1783
|
ref: null
|
|
1784
1784
|
});
|
|
1785
1785
|
}
|
|
1786
1786
|
async _write(e) {
|
|
1787
1787
|
if (!this._nativeClipboard) return this._state = e, this.dispatchEvent(new Event("clipboardwrite")), void this.dispatchEvent(new Event("clipboardchange"));
|
|
1788
|
-
let t = this, r = [], n = e.uuid,
|
|
1788
|
+
let t = this, r = [], n = e.uuid, o = e.items ?? [], i = () => {
|
|
1789
1789
|
t._state = {
|
|
1790
1790
|
uuid: n,
|
|
1791
1791
|
ref: e.ref,
|
|
1792
1792
|
items: r
|
|
1793
1793
|
}, t.dispatchEvent(new Event("clipboardwrite")), t.dispatchEvent(new Event("clipboardchange"));
|
|
1794
1794
|
};
|
|
1795
|
-
await
|
|
1796
|
-
await
|
|
1797
|
-
for (let l = 0; l < Math.min(1,
|
|
1798
|
-
let s =
|
|
1799
|
-
if (c !== -1 && (d = await
|
|
1800
|
-
let
|
|
1801
|
-
if (
|
|
1795
|
+
await ot("clipboard-write", async () => {
|
|
1796
|
+
await nt(), n && o.length === 0 && (o.push(new ClipboardItem({ [Me]: new Blob([n], Dt) })), o.push(new ClipboardItem({ [J.Html]: new Blob([Lt(n)], Ot) })));
|
|
1797
|
+
for (let l = 0; l < Math.min(1, o.length); l++) {
|
|
1798
|
+
let s = o[l], c = s.types.indexOf(J.Html), d = null;
|
|
1799
|
+
if (c !== -1 && (d = await ft(await s.getType(J.Html)), d &&= Oo(n, d)), !d && s.types.includes(J.Plain)) {
|
|
1800
|
+
let S = await s.getType(J.Plain);
|
|
1801
|
+
if (S) {
|
|
1802
1802
|
let A = null;
|
|
1803
|
-
typeof
|
|
1803
|
+
typeof S == "string" ? (console.warn("text as string", S), A = S) : A = await ft(S), A && (d = \`<div \${Be}="\${n}">\${A}</div>\`);
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
1806
|
if (!d && s.types.includes(J.Png)) {
|
|
1807
|
-
let
|
|
1808
|
-
d = \`<div \${
|
|
1807
|
+
let S = Dr(await (await s.getType(J.Png)).arrayBuffer());
|
|
1808
|
+
d = \`<div \${Be}="\${n}"><img src="\${Fr + S}"/></div>\`;
|
|
1809
1809
|
}
|
|
1810
1810
|
!d && n && (d = Lt(n));
|
|
1811
|
-
let m = new Blob([d ?? ""],
|
|
1812
|
-
for (let
|
|
1813
|
-
let A =
|
|
1814
|
-
a[A] =
|
|
1811
|
+
let m = new Blob([d ?? ""], Ot), a = {}, p = s.types, b = p.length;
|
|
1812
|
+
for (let S = 0; S < b; S++) {
|
|
1813
|
+
let A = p[S];
|
|
1814
|
+
a[A] = S === c ? m : s.getType(A);
|
|
1815
1815
|
}
|
|
1816
|
-
d && c === -1 && (a[J.Html] = m), n && (a[
|
|
1816
|
+
d && c === -1 && (a[J.Html] = m), n && (a[Me] = new Blob([n], Dt)), r.push(new ClipboardItem(a));
|
|
1817
1817
|
}
|
|
1818
1818
|
try {
|
|
1819
|
-
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await
|
|
1819
|
+
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await Mo(this._nativeClipboard);
|
|
1820
1820
|
} catch (l) {
|
|
1821
1821
|
l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
|
|
1822
1822
|
}
|
|
1823
|
-
return
|
|
1823
|
+
return i(), !0;
|
|
1824
1824
|
}, async (l) => {
|
|
1825
|
-
this.dispatchEvent(new Event("clipboarderrorwrite")),
|
|
1825
|
+
this.dispatchEvent(new Event("clipboarderrorwrite")), i();
|
|
1826
1826
|
});
|
|
1827
1827
|
}
|
|
1828
1828
|
async writeReference(e) {
|
|
1829
1829
|
if (!e) return void this.clear();
|
|
1830
1830
|
let t = null, r = {};
|
|
1831
1831
|
try {
|
|
1832
|
-
let
|
|
1833
|
-
|
|
1834
|
-
} catch (
|
|
1835
|
-
t =
|
|
1832
|
+
let o = await e.toText?.() ?? null;
|
|
1833
|
+
o && (r[J.Plain] = new Blob([o ?? ""], Mt));
|
|
1834
|
+
} catch (o) {
|
|
1835
|
+
t = o;
|
|
1836
1836
|
}
|
|
1837
1837
|
try {
|
|
1838
|
-
let
|
|
1839
|
-
|
|
1840
|
-
} catch (
|
|
1841
|
-
t =
|
|
1838
|
+
let o = await e.toHtml?.() ?? null;
|
|
1839
|
+
o && (r[J.Html] = new Blob([o], { type: J.Html }));
|
|
1840
|
+
} catch (o) {
|
|
1841
|
+
t = o, console.warn("export to html", o);
|
|
1842
1842
|
}
|
|
1843
1843
|
try {
|
|
1844
|
-
let
|
|
1845
|
-
|
|
1846
|
-
} catch (
|
|
1847
|
-
t =
|
|
1844
|
+
let o = await e.toImage?.() ?? null;
|
|
1845
|
+
o && (r[J.Png] = o);
|
|
1846
|
+
} catch (o) {
|
|
1847
|
+
t = o, console.warn("export to png", o);
|
|
1848
1848
|
}
|
|
1849
1849
|
let n = this._write({
|
|
1850
|
-
uuid:
|
|
1850
|
+
uuid: He(),
|
|
1851
1851
|
ref: e,
|
|
1852
1852
|
items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null
|
|
1853
1853
|
});
|
|
@@ -1866,39 +1866,39 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1866
1866
|
}
|
|
1867
1867
|
readText() {
|
|
1868
1868
|
return new Promise(async (e, t) => {
|
|
1869
|
-
let r = await this.read(), n = null,
|
|
1870
|
-
for (let l = 0; !n && l <
|
|
1869
|
+
let r = await this.read(), n = null, o = r ? r.length : 0;
|
|
1870
|
+
for (let l = 0; !n && l < o; l++) {
|
|
1871
1871
|
let s = r[l];
|
|
1872
1872
|
s.types.includes(J.Plain) && (n = await s.getType(J.Plain));
|
|
1873
1873
|
}
|
|
1874
1874
|
if (!n) return void e("");
|
|
1875
|
-
let
|
|
1876
|
-
|
|
1877
|
-
e(
|
|
1878
|
-
},
|
|
1875
|
+
let i = new FileReader();
|
|
1876
|
+
i.onload = () => {
|
|
1877
|
+
e(i.result);
|
|
1878
|
+
}, i.readAsText(n), i.onerror = (l) => {
|
|
1879
1879
|
t(l);
|
|
1880
1880
|
};
|
|
1881
1881
|
});
|
|
1882
1882
|
}
|
|
1883
1883
|
async writeText(e) {
|
|
1884
|
-
let t = [new ClipboardItem({ [J.Plain]: new Blob([e],
|
|
1884
|
+
let t = [new ClipboardItem({ [J.Plain]: new Blob([e], Mt) })];
|
|
1885
1885
|
return this._write({
|
|
1886
|
-
uuid:
|
|
1886
|
+
uuid: He(),
|
|
1887
1887
|
items: t,
|
|
1888
1888
|
ref: null
|
|
1889
1889
|
});
|
|
1890
1890
|
}
|
|
1891
1891
|
addEventListener(e, t, r = {}) {
|
|
1892
|
-
let n = r?.capture ? this._listenersCapture : this._listeners,
|
|
1893
|
-
|
|
1892
|
+
let n = r?.capture ? this._listenersCapture : this._listeners, o = n.get(e);
|
|
1893
|
+
o || (o = /* @__PURE__ */ new Map(), n.set(e, o)), t && o.set(t, typeof r == "boolean" ? {} : r);
|
|
1894
1894
|
}
|
|
1895
1895
|
dispatchEvent(e) {
|
|
1896
1896
|
if (!e) return !1;
|
|
1897
1897
|
let t = (r) => {
|
|
1898
1898
|
let n = r.get(e.type);
|
|
1899
|
-
n && n.forEach((
|
|
1899
|
+
n && n.forEach((o, i) => {
|
|
1900
1900
|
try {
|
|
1901
|
-
typeof
|
|
1901
|
+
typeof i == "function" ? i(e) : i.handleEvent && i.handleEvent(e), o.once && n.delete(i);
|
|
1902
1902
|
} catch (l) {
|
|
1903
1903
|
console.warn(l);
|
|
1904
1904
|
}
|
|
@@ -1907,17 +1907,17 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1907
1907
|
return t(this._listenersCapture), t(this._listeners), !0;
|
|
1908
1908
|
}
|
|
1909
1909
|
removeEventListener(e, t, r) {
|
|
1910
|
-
let n = r?.capture ? this._listenersCapture : this._listeners,
|
|
1911
|
-
|
|
1910
|
+
let n = r?.capture ? this._listenersCapture : this._listeners, o = n.get(e);
|
|
1911
|
+
o && t && (o.delete(t), o.size === 0 && n.delete(e));
|
|
1912
1912
|
}
|
|
1913
1913
|
close() {
|
|
1914
1914
|
this._onFocus && globalThis.removeEventListener?.("focus", this._onFocus), this._onBlur && globalThis.removeEventListener?.("blur", this._onBlur);
|
|
1915
1915
|
}
|
|
1916
1916
|
};
|
|
1917
|
-
(
|
|
1917
|
+
(Nt = Ut ||= {}).ErrorMessages = ko, Nt.Global = new Ut();
|
|
1918
1918
|
Object.freeze({});
|
|
1919
1919
|
new TextDecoder();
|
|
1920
|
-
const
|
|
1920
|
+
const E = Object.freeze({
|
|
1921
1921
|
/** Exported function has no body. */
|
|
1922
1922
|
NoBody: "SXL1001",
|
|
1923
1923
|
/** Anonymous exported function is not allowed. */
|
|
@@ -1936,8 +1936,6 @@ const _ = Object.freeze({
|
|
|
1936
1936
|
UntypedArray: "SXL2005",
|
|
1937
1937
|
/** A generic type must be supplied exactly one type argument. */
|
|
1938
1938
|
GenericArity: "SXL2006",
|
|
1939
|
-
/** A return type cannot combine multiple modifiers (e.g. async + stream). */
|
|
1940
|
-
MultipleModifiers: "SXL2007",
|
|
1941
1939
|
/** A context parameter must be the first parameter. */
|
|
1942
1940
|
ContextNotFirst: "SXL2010",
|
|
1943
1941
|
/** More than one \`Lambda\` parameter. */
|
|
@@ -2003,53 +2001,53 @@ const _ = Object.freeze({
|
|
|
2003
2001
|
/** An enum member has no doc comment. */
|
|
2004
2002
|
EnumMemberUndocumented: "SXL9005"
|
|
2005
2003
|
});
|
|
2006
|
-
var
|
|
2004
|
+
var zo;
|
|
2007
2005
|
(function(e) {
|
|
2008
2006
|
e.MAX_TEXT_LENGTH = 32767;
|
|
2009
2007
|
let t = e.MAX_SIGNIFICANT_DIGITS = 15;
|
|
2010
2008
|
e.truncateNumberText = function(r) {
|
|
2011
2009
|
let n = r.length;
|
|
2012
2010
|
if (n <= t) return r;
|
|
2013
|
-
let
|
|
2011
|
+
let o = 0, i = null;
|
|
2014
2012
|
for (let l = 0; l < n; l++) {
|
|
2015
2013
|
let s = r.charCodeAt(l);
|
|
2016
2014
|
if (s >= 48 && s <= 57) {
|
|
2017
|
-
if (
|
|
2018
|
-
|
|
2019
|
-
} else if ((s === 69 || s === 101) &&
|
|
2015
|
+
if (o === 0 && s === 48) continue;
|
|
2016
|
+
o++, o > t && ((i ??= r.split(""))[l] = "0");
|
|
2017
|
+
} else if ((s === 69 || s === 101) && o > 0) break;
|
|
2020
2018
|
}
|
|
2021
|
-
return
|
|
2019
|
+
return i === null ? r : i.join("");
|
|
2022
2020
|
};
|
|
2023
|
-
})(
|
|
2024
|
-
var
|
|
2021
|
+
})(zo ||= {});
|
|
2022
|
+
var zt, it, Vo, T, me = {
|
|
2025
2023
|
Number: "number",
|
|
2026
2024
|
String: "string",
|
|
2027
2025
|
Boolean: "boolean",
|
|
2028
2026
|
Error: "error",
|
|
2029
2027
|
RichData: "richData",
|
|
2030
2028
|
Null: "null"
|
|
2031
|
-
},
|
|
2029
|
+
}, Vt = {
|
|
2032
2030
|
...me,
|
|
2033
2031
|
Date: "date"
|
|
2034
|
-
},
|
|
2032
|
+
}, Xt = {
|
|
2035
2033
|
...me,
|
|
2036
2034
|
Reference: "reference",
|
|
2037
2035
|
Array: "array",
|
|
2038
2036
|
Lambda: "lambda",
|
|
2039
2037
|
Omitted: "omitted"
|
|
2040
2038
|
};
|
|
2041
|
-
(
|
|
2039
|
+
(it = zt ||= {}).Axis = {
|
|
2042
2040
|
Column: "column",
|
|
2043
2041
|
Row: "row"
|
|
2044
|
-
},
|
|
2045
|
-
...
|
|
2042
|
+
}, it.AxisSelection = {
|
|
2043
|
+
...zt.Axis,
|
|
2046
2044
|
Both: "both"
|
|
2047
|
-
},
|
|
2045
|
+
}, it.Direction = {
|
|
2048
2046
|
Up: "up",
|
|
2049
2047
|
Down: "down",
|
|
2050
2048
|
Left: "left",
|
|
2051
2049
|
Right: "right"
|
|
2052
|
-
}, (
|
|
2050
|
+
}, (Vo ||= {}).Aggregate = {
|
|
2053
2051
|
Count: "count",
|
|
2054
2052
|
NumericalCount: "numericalCount",
|
|
2055
2053
|
Sum: "sum",
|
|
@@ -2101,8 +2099,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2101
2099
|
Timeout: "#TIMEOUT!"
|
|
2102
2100
|
};
|
|
2103
2101
|
class n extends Error {
|
|
2104
|
-
constructor(R,
|
|
2105
|
-
super(
|
|
2102
|
+
constructor(R, O, de, we) {
|
|
2103
|
+
super(de, we), this._label = O, this._code = R, this.details = we;
|
|
2106
2104
|
}
|
|
2107
2105
|
static {
|
|
2108
2106
|
this.code = T.Code.Unknown;
|
|
@@ -2127,9 +2125,9 @@ var Kt, nt, Ki, T, me = {
|
|
|
2127
2125
|
}
|
|
2128
2126
|
}
|
|
2129
2127
|
e.Known = n;
|
|
2130
|
-
class
|
|
2131
|
-
constructor(R,
|
|
2132
|
-
super(t.Parse, r.Parse, R,
|
|
2128
|
+
class o extends n {
|
|
2129
|
+
constructor(R, O) {
|
|
2130
|
+
super(t.Parse, r.Parse, R, O);
|
|
2133
2131
|
}
|
|
2134
2132
|
static {
|
|
2135
2133
|
this.code = T.Code.Parse;
|
|
@@ -2144,19 +2142,19 @@ var Kt, nt, Ki, T, me = {
|
|
|
2144
2142
|
};
|
|
2145
2143
|
}
|
|
2146
2144
|
}
|
|
2147
|
-
e.Parse =
|
|
2148
|
-
class
|
|
2149
|
-
constructor(R,
|
|
2150
|
-
super(t.Null, r.Null, R,
|
|
2145
|
+
e.Parse = o;
|
|
2146
|
+
class i extends n {
|
|
2147
|
+
constructor(R, O) {
|
|
2148
|
+
super(t.Null, r.Null, R, O);
|
|
2151
2149
|
}
|
|
2152
2150
|
static {
|
|
2153
2151
|
this.code = T.Code.Null;
|
|
2154
2152
|
}
|
|
2155
2153
|
}
|
|
2156
|
-
e.Null =
|
|
2154
|
+
e.Null = i;
|
|
2157
2155
|
class l extends n {
|
|
2158
|
-
constructor(R,
|
|
2159
|
-
super(t.Div0, r.Div0, R,
|
|
2156
|
+
constructor(R, O) {
|
|
2157
|
+
super(t.Div0, r.Div0, R, O);
|
|
2160
2158
|
}
|
|
2161
2159
|
static {
|
|
2162
2160
|
this.code = T.Code.Div0;
|
|
@@ -2164,8 +2162,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2164
2162
|
}
|
|
2165
2163
|
e.Div0 = l;
|
|
2166
2164
|
class s extends n {
|
|
2167
|
-
constructor(R,
|
|
2168
|
-
super(t.Value, r.Value, R,
|
|
2165
|
+
constructor(R, O) {
|
|
2166
|
+
super(t.Value, r.Value, R, O);
|
|
2169
2167
|
}
|
|
2170
2168
|
static {
|
|
2171
2169
|
this.code = T.Code.Value;
|
|
@@ -2173,8 +2171,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2173
2171
|
}
|
|
2174
2172
|
e.Value = s;
|
|
2175
2173
|
class c extends n {
|
|
2176
|
-
constructor(R,
|
|
2177
|
-
super(t.Ref, r.Ref, R,
|
|
2174
|
+
constructor(R, O) {
|
|
2175
|
+
super(t.Ref, r.Ref, R, O);
|
|
2178
2176
|
}
|
|
2179
2177
|
static {
|
|
2180
2178
|
this.code = T.Code.Ref;
|
|
@@ -2182,8 +2180,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2182
2180
|
}
|
|
2183
2181
|
e.Ref = c;
|
|
2184
2182
|
class d extends n {
|
|
2185
|
-
constructor(R,
|
|
2186
|
-
super(t.Name, r.Name, R,
|
|
2183
|
+
constructor(R, O) {
|
|
2184
|
+
super(t.Name, r.Name, R, O);
|
|
2187
2185
|
}
|
|
2188
2186
|
static {
|
|
2189
2187
|
this.code = T.Code.Name;
|
|
@@ -2191,8 +2189,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2191
2189
|
}
|
|
2192
2190
|
e.Name = d;
|
|
2193
2191
|
class m extends n {
|
|
2194
|
-
constructor(R,
|
|
2195
|
-
super(t.Num, r.Num, R,
|
|
2192
|
+
constructor(R, O) {
|
|
2193
|
+
super(t.Num, r.Num, R, O);
|
|
2196
2194
|
}
|
|
2197
2195
|
static {
|
|
2198
2196
|
this.code = T.Code.Num;
|
|
@@ -2200,44 +2198,44 @@ var Kt, nt, Ki, T, me = {
|
|
|
2200
2198
|
}
|
|
2201
2199
|
e.Num = m;
|
|
2202
2200
|
class a extends n {
|
|
2203
|
-
constructor(R,
|
|
2204
|
-
super(t.NA, r.NA, R,
|
|
2201
|
+
constructor(R, O) {
|
|
2202
|
+
super(t.NA, r.NA, R, O);
|
|
2205
2203
|
}
|
|
2206
2204
|
static {
|
|
2207
2205
|
this.code = T.Code.NA;
|
|
2208
2206
|
}
|
|
2209
2207
|
}
|
|
2210
2208
|
e.NA = a;
|
|
2211
|
-
class
|
|
2212
|
-
constructor(R,
|
|
2213
|
-
super(t.GettingData, r.GettingData, R,
|
|
2209
|
+
class p extends n {
|
|
2210
|
+
constructor(R, O) {
|
|
2211
|
+
super(t.GettingData, r.GettingData, R, O);
|
|
2214
2212
|
}
|
|
2215
2213
|
static {
|
|
2216
2214
|
this.code = T.Code.GettingData;
|
|
2217
2215
|
}
|
|
2218
2216
|
}
|
|
2219
|
-
e.GettingData =
|
|
2217
|
+
e.GettingData = p;
|
|
2220
2218
|
class b extends n {
|
|
2221
|
-
constructor(R,
|
|
2222
|
-
super(t.Spill, r.Spill, R,
|
|
2219
|
+
constructor(R, O) {
|
|
2220
|
+
super(t.Spill, r.Spill, R, O);
|
|
2223
2221
|
}
|
|
2224
2222
|
static {
|
|
2225
2223
|
this.code = T.Code.Spill;
|
|
2226
2224
|
}
|
|
2227
2225
|
}
|
|
2228
2226
|
e.Spill = b;
|
|
2229
|
-
class
|
|
2230
|
-
constructor(R,
|
|
2231
|
-
super(t.Connect, r.Connect, R,
|
|
2227
|
+
class S extends n {
|
|
2228
|
+
constructor(R, O) {
|
|
2229
|
+
super(t.Connect, r.Connect, R, O);
|
|
2232
2230
|
}
|
|
2233
2231
|
static {
|
|
2234
2232
|
this.code = T.Code.Connect;
|
|
2235
2233
|
}
|
|
2236
2234
|
}
|
|
2237
|
-
e.Connect =
|
|
2235
|
+
e.Connect = S;
|
|
2238
2236
|
class A extends n {
|
|
2239
|
-
constructor(R,
|
|
2240
|
-
super(t.Blocked, r.Blocked, R,
|
|
2237
|
+
constructor(R, O) {
|
|
2238
|
+
super(t.Blocked, r.Blocked, R, O);
|
|
2241
2239
|
}
|
|
2242
2240
|
static {
|
|
2243
2241
|
this.code = T.Code.Blocked;
|
|
@@ -2245,8 +2243,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2245
2243
|
}
|
|
2246
2244
|
e.Blocked = A;
|
|
2247
2245
|
class U extends n {
|
|
2248
|
-
constructor(R,
|
|
2249
|
-
super(t.Unknown, r.Unknown, R,
|
|
2246
|
+
constructor(R, O) {
|
|
2247
|
+
super(t.Unknown, r.Unknown, R, O);
|
|
2250
2248
|
}
|
|
2251
2249
|
static {
|
|
2252
2250
|
this.code = T.Code.Unknown;
|
|
@@ -2254,44 +2252,44 @@ var Kt, nt, Ki, T, me = {
|
|
|
2254
2252
|
}
|
|
2255
2253
|
e.Unknown = U;
|
|
2256
2254
|
class h extends n {
|
|
2257
|
-
constructor(R,
|
|
2258
|
-
super(t.Field, r.Field, R,
|
|
2255
|
+
constructor(R, O) {
|
|
2256
|
+
super(t.Field, r.Field, R, O);
|
|
2259
2257
|
}
|
|
2260
2258
|
static {
|
|
2261
2259
|
this.code = T.Code.Field;
|
|
2262
2260
|
}
|
|
2263
2261
|
}
|
|
2264
2262
|
e.Field = h;
|
|
2265
|
-
class
|
|
2266
|
-
constructor(R,
|
|
2267
|
-
super(t.Calc, r.Calc, R,
|
|
2263
|
+
class y extends n {
|
|
2264
|
+
constructor(R, O) {
|
|
2265
|
+
super(t.Calc, r.Calc, R, O);
|
|
2268
2266
|
}
|
|
2269
2267
|
static {
|
|
2270
2268
|
this.code = T.Code.Calc;
|
|
2271
2269
|
}
|
|
2272
2270
|
}
|
|
2273
|
-
e.Calc =
|
|
2274
|
-
class
|
|
2275
|
-
constructor(R,
|
|
2276
|
-
super(t.Busy, r.Busy, R,
|
|
2271
|
+
e.Calc = y;
|
|
2272
|
+
class w extends n {
|
|
2273
|
+
constructor(R, O) {
|
|
2274
|
+
super(t.Busy, r.Busy, R, O);
|
|
2277
2275
|
}
|
|
2278
2276
|
static {
|
|
2279
2277
|
this.code = T.Code.Busy;
|
|
2280
2278
|
}
|
|
2281
2279
|
}
|
|
2282
|
-
e.Busy =
|
|
2283
|
-
class
|
|
2284
|
-
constructor(R,
|
|
2285
|
-
super(t.Python, r.Python, R,
|
|
2280
|
+
e.Busy = w;
|
|
2281
|
+
class D extends n {
|
|
2282
|
+
constructor(R, O) {
|
|
2283
|
+
super(t.Python, r.Python, R, O);
|
|
2286
2284
|
}
|
|
2287
2285
|
static {
|
|
2288
2286
|
this.code = T.Code.Python;
|
|
2289
2287
|
}
|
|
2290
2288
|
}
|
|
2291
|
-
e.Python =
|
|
2289
|
+
e.Python = D;
|
|
2292
2290
|
class z extends n {
|
|
2293
|
-
constructor(R,
|
|
2294
|
-
super(t.Timeout, r.Timeout, R,
|
|
2291
|
+
constructor(R, O) {
|
|
2292
|
+
super(t.Timeout, r.Timeout, R, O);
|
|
2295
2293
|
}
|
|
2296
2294
|
static {
|
|
2297
2295
|
this.code = T.Code.Timeout;
|
|
@@ -2299,15 +2297,15 @@ var Kt, nt, Ki, T, me = {
|
|
|
2299
2297
|
}
|
|
2300
2298
|
e.Timeout = z;
|
|
2301
2299
|
})(T ||= {});
|
|
2302
|
-
var
|
|
2303
|
-
|
|
2304
|
-
var
|
|
2305
|
-
for (let e = 0; e <
|
|
2306
|
-
let t =
|
|
2307
|
-
|
|
2300
|
+
var ee = {};
|
|
2301
|
+
ee[T.Code.Parse] = T.Parse, ee[T.Code.Null] = T.Null, ee[T.Code.Div0] = T.Div0, ee[T.Code.Value] = T.Value, ee[T.Code.Ref] = T.Ref, ee[T.Code.Name] = T.Name, ee[T.Code.Num] = T.Num, ee[T.Code.NA] = T.NA, ee[T.Code.GettingData] = T.GettingData, ee[T.Code.Spill] = T.Spill, ee[T.Code.Connect] = T.Connect, ee[T.Code.Blocked] = T.Blocked, ee[T.Code.Unknown] = T.Unknown, ee[T.Code.Field] = T.Field, ee[T.Code.Calc] = T.Calc, ee[T.Code.Busy] = T.Busy, ee[T.Code.Python] = T.Python, ee[T.Code.Timeout] = T.Timeout;
|
|
2302
|
+
var zr = /* @__PURE__ */ new Map(), Vr = /* @__PURE__ */ new Map(), Xr = /* @__PURE__ */ new Map(), Gr = /* @__PURE__ */ new Map(), Gt = Object.keys(ee);
|
|
2303
|
+
for (let e = 0; e < Gt.length; e++) {
|
|
2304
|
+
let t = ee[Gt[e]], r = new t();
|
|
2305
|
+
Xr.set(r.getLabel(), t), Gr.set(r.getCode(), t), zr.set(r.getLabel(), r), Vr.set(r.getCode(), r);
|
|
2308
2306
|
}
|
|
2309
2307
|
(function(e) {
|
|
2310
|
-
let t = e.getBuiltInByCode = (r) =>
|
|
2308
|
+
let t = e.getBuiltInByCode = (r) => Vr.get(r);
|
|
2311
2309
|
e.BuiltIn = {
|
|
2312
2310
|
Parse: t(T.Code.Parse),
|
|
2313
2311
|
Null: t(T.Code.Null),
|
|
@@ -2327,43 +2325,43 @@ for (let e = 0; e < Xt.length; e++) {
|
|
|
2327
2325
|
Busy: t(T.Code.Busy),
|
|
2328
2326
|
Python: t(T.Code.Python),
|
|
2329
2327
|
Timeout: t(T.Code.Timeout)
|
|
2330
|
-
}, e.newTypedError = (r, n,
|
|
2331
|
-
let
|
|
2332
|
-
return
|
|
2333
|
-
}, e.getBuiltInByLabel = (r) =>
|
|
2328
|
+
}, e.newTypedError = (r, n, o) => {
|
|
2329
|
+
let i;
|
|
2330
|
+
return i = typeof r == "string" ? Xr.get(r) : Gr.get(r), i ||= T.Unknown, new i(n, o);
|
|
2331
|
+
}, e.getBuiltInByLabel = (r) => zr.get(r), e.isError = function(r, n) {
|
|
2334
2332
|
return !!r && r.isFormulaError === !0 && (n === void 0 || r.getCode() === n);
|
|
2335
2333
|
};
|
|
2336
2334
|
})(T ||= {});
|
|
2337
|
-
var
|
|
2335
|
+
var Xo = class {
|
|
2338
2336
|
createRange(e, t, r) {
|
|
2339
|
-
throw new
|
|
2337
|
+
throw new oe();
|
|
2340
2338
|
}
|
|
2341
2339
|
flattenAreas(e) {
|
|
2342
|
-
throw new
|
|
2340
|
+
throw new oe();
|
|
2343
2341
|
}
|
|
2344
2342
|
getReference(e, t) {
|
|
2345
|
-
throw new
|
|
2343
|
+
throw new oe();
|
|
2346
2344
|
}
|
|
2347
2345
|
getResizedReference(e, t, r) {
|
|
2348
|
-
throw new
|
|
2346
|
+
throw new oe();
|
|
2349
2347
|
}
|
|
2350
2348
|
getNumberFormat(e, t) {
|
|
2351
|
-
throw new
|
|
2349
|
+
throw new oe();
|
|
2352
2350
|
}
|
|
2353
2351
|
fromSerialDate(e, t) {
|
|
2354
|
-
throw new
|
|
2352
|
+
throw new oe();
|
|
2355
2353
|
}
|
|
2356
2354
|
toSerialDate(e, t) {
|
|
2357
|
-
throw new
|
|
2355
|
+
throw new oe();
|
|
2358
2356
|
}
|
|
2359
2357
|
getDateParts(e, t) {
|
|
2360
|
-
throw new
|
|
2358
|
+
throw new oe();
|
|
2361
2359
|
}
|
|
2362
|
-
getSerialDate(e, t, r, n,
|
|
2363
|
-
throw new
|
|
2360
|
+
getSerialDate(e, t, r, n, o, i, l) {
|
|
2361
|
+
throw new oe();
|
|
2364
2362
|
}
|
|
2365
2363
|
getNow() {
|
|
2366
|
-
throw new
|
|
2364
|
+
throw new oe();
|
|
2367
2365
|
}
|
|
2368
2366
|
getRandom() {
|
|
2369
2367
|
return Math.random();
|
|
@@ -2372,10 +2370,10 @@ var zi = class {
|
|
|
2372
2370
|
return null;
|
|
2373
2371
|
}
|
|
2374
2372
|
getEntireCoords() {
|
|
2375
|
-
return
|
|
2373
|
+
return Wr;
|
|
2376
2374
|
}
|
|
2377
2375
|
isValidDate(e, t) {
|
|
2378
|
-
return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]" ? !isNaN(e.getTime()) : !t && typeof e == "number" && !(e < 0 || e >
|
|
2376
|
+
return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]" ? !isNaN(e.getTime()) : !t && typeof e == "number" && !(e < 0 || e > Wo);
|
|
2379
2377
|
}
|
|
2380
2378
|
getRow() {
|
|
2381
2379
|
return 0;
|
|
@@ -2399,6 +2397,7 @@ var zi = class {
|
|
|
2399
2397
|
return 1;
|
|
2400
2398
|
}
|
|
2401
2399
|
markVolatile() {}
|
|
2400
|
+
defer(e, t) {}
|
|
2402
2401
|
formatResults(e) {}
|
|
2403
2402
|
filterHidden(e, t) {
|
|
2404
2403
|
return e;
|
|
@@ -2410,22 +2409,22 @@ var zi = class {
|
|
|
2410
2409
|
return null;
|
|
2411
2410
|
}
|
|
2412
2411
|
getAddress(e, t) {
|
|
2413
|
-
throw new
|
|
2412
|
+
throw new oe();
|
|
2414
2413
|
}
|
|
2415
2414
|
parseAsSerialDate(e, t) {
|
|
2416
|
-
throw new
|
|
2415
|
+
throw new oe();
|
|
2417
2416
|
}
|
|
2418
2417
|
parseAsDate(e, t) {
|
|
2419
|
-
throw new
|
|
2418
|
+
throw new oe();
|
|
2420
2419
|
}
|
|
2421
2420
|
parseAsNumber(e, t) {
|
|
2422
|
-
throw new
|
|
2421
|
+
throw new oe();
|
|
2423
2422
|
}
|
|
2424
2423
|
createCriteria(e, t) {
|
|
2425
|
-
throw new
|
|
2424
|
+
throw new oe();
|
|
2426
2425
|
}
|
|
2427
2426
|
createGrouping(e, t) {
|
|
2428
|
-
throw new
|
|
2427
|
+
throw new oe();
|
|
2429
2428
|
}
|
|
2430
2429
|
parseAsLiteral(e) {
|
|
2431
2430
|
let t = e.toUpperCase();
|
|
@@ -2436,16 +2435,19 @@ var zi = class {
|
|
|
2436
2435
|
}
|
|
2437
2436
|
compare(e, t, r) {
|
|
2438
2437
|
if (e === t) return 0;
|
|
2439
|
-
let n =
|
|
2440
|
-
return n ===
|
|
2438
|
+
let n = Ht(e), o = Ht(t);
|
|
2439
|
+
return n === o ? e < t ? -1 : +(e > t) : n < o ? -1 : 1;
|
|
2441
2440
|
}
|
|
2442
2441
|
getRuntime() {
|
|
2443
|
-
return
|
|
2442
|
+
return Ho;
|
|
2444
2443
|
}
|
|
2445
2444
|
getArgs() {
|
|
2446
|
-
throw new
|
|
2445
|
+
throw new oe(Hr);
|
|
2447
2446
|
}
|
|
2448
|
-
|
|
2447
|
+
createRichData(e, t) {
|
|
2448
|
+
throw new oe(Go);
|
|
2449
|
+
}
|
|
2450
|
+
}, Ht = (e) => {
|
|
2449
2451
|
if (e == null) return 0;
|
|
2450
2452
|
switch (typeof e) {
|
|
2451
2453
|
case "number": return 1;
|
|
@@ -2453,19 +2455,19 @@ var zi = class {
|
|
|
2453
2455
|
case "boolean": return 3;
|
|
2454
2456
|
default: return 4;
|
|
2455
2457
|
}
|
|
2456
|
-
},
|
|
2458
|
+
}, Hr = "FormulaContext.getArgs() is only valid while a function body is running", Go = "FormulaContext.createRichData() needs a workbook being calculated", oe = class extends Error {
|
|
2457
2459
|
constructor(e = "Not implemented in StubbedFormulaContext") {
|
|
2458
2460
|
super(e), this.name = "NotImplementedError";
|
|
2459
2461
|
}
|
|
2460
|
-
},
|
|
2462
|
+
}, Wr = Object.freeze({
|
|
2461
2463
|
colStart: 0,
|
|
2462
2464
|
rowStart: 0,
|
|
2463
2465
|
colEnd: 2 ** 14 - 1,
|
|
2464
2466
|
rowEnd: 2 ** 20 - 1
|
|
2465
|
-
}),
|
|
2467
|
+
}), Ho = {
|
|
2466
2468
|
isDate1904: () => !1,
|
|
2467
|
-
getLocale: () =>
|
|
2468
|
-
getLocaleProfile: () =>
|
|
2469
|
+
getLocale: () => Wt.tag,
|
|
2470
|
+
getLocaleProfile: () => Wt,
|
|
2469
2471
|
isR1C1: () => !1,
|
|
2470
2472
|
getNow: () => 0,
|
|
2471
2473
|
getRandom: () => Math.random(),
|
|
@@ -2474,12 +2476,12 @@ var zi = class {
|
|
|
2474
2476
|
getOS: () => "unknown",
|
|
2475
2477
|
getUser: () => "unidentified",
|
|
2476
2478
|
getDescription: () => "Stubbed Formula Context"
|
|
2477
|
-
},
|
|
2479
|
+
}, Wo = 2958465, ke = new Xo(), Jo = class {
|
|
2478
2480
|
constructor() {
|
|
2479
|
-
this._scope =
|
|
2481
|
+
this._scope = ke, this._argsFn = null;
|
|
2480
2482
|
}
|
|
2481
2483
|
_setScope(e) {
|
|
2482
|
-
this._scope = e ??
|
|
2484
|
+
this._scope = e ?? ke;
|
|
2483
2485
|
}
|
|
2484
2486
|
_getScope() {
|
|
2485
2487
|
return this._scope;
|
|
@@ -2491,7 +2493,7 @@ var zi = class {
|
|
|
2491
2493
|
return this._getScope().getNumberFormat(e, t);
|
|
2492
2494
|
}
|
|
2493
2495
|
getEntireCoords() {
|
|
2494
|
-
return this._getScope().getEntireCoords() ??
|
|
2496
|
+
return this._getScope().getEntireCoords() ?? Wr;
|
|
2495
2497
|
}
|
|
2496
2498
|
parseAsSerialDate(e, t) {
|
|
2497
2499
|
return this._getScope().parseAsSerialDate(e, t);
|
|
@@ -2510,7 +2512,7 @@ var zi = class {
|
|
|
2510
2512
|
}
|
|
2511
2513
|
parseAsLiteral(e) {
|
|
2512
2514
|
let t = this._getScope();
|
|
2513
|
-
return t.parseAsLiteral ? t.parseAsLiteral(e) :
|
|
2515
|
+
return t.parseAsLiteral ? t.parseAsLiteral(e) : ke.parseAsLiteral(e);
|
|
2514
2516
|
}
|
|
2515
2517
|
toText(e) {
|
|
2516
2518
|
return this._getScope().toText(e);
|
|
@@ -2527,8 +2529,8 @@ var zi = class {
|
|
|
2527
2529
|
getDateParts(e, t) {
|
|
2528
2530
|
return this._getScope().getDateParts(e, t);
|
|
2529
2531
|
}
|
|
2530
|
-
getSerialDate(e, t, r, n = 0,
|
|
2531
|
-
return this._getScope().getSerialDate(e, t, r, n,
|
|
2532
|
+
getSerialDate(e, t, r, n = 0, o = 0, i = 0, l = 0) {
|
|
2533
|
+
return this._getScope().getSerialDate(e, t, r, n, o, i, l);
|
|
2532
2534
|
}
|
|
2533
2535
|
getNow() {
|
|
2534
2536
|
return this._getScope().getNow();
|
|
@@ -2543,8 +2545,8 @@ var zi = class {
|
|
|
2543
2545
|
if (!Array.isArray(e)) return e;
|
|
2544
2546
|
let t = [];
|
|
2545
2547
|
for (let r = 0; r < e.length; r++) {
|
|
2546
|
-
let n = e[r], { rows:
|
|
2547
|
-
for (let l = 0; l <
|
|
2548
|
+
let n = e[r], { rows: o, columns: i } = n.getShape();
|
|
2549
|
+
for (let l = 0; l < o; l++) for (let s = 0; s < i; s++) t.push(n.getValueAt(l, s));
|
|
2548
2550
|
}
|
|
2549
2551
|
return this.createRange(t.length, 1, (r, n) => t[n.rowIndex]);
|
|
2550
2552
|
}
|
|
@@ -2581,6 +2583,9 @@ var zi = class {
|
|
|
2581
2583
|
markVolatile() {
|
|
2582
2584
|
this._getScope().markVolatile?.();
|
|
2583
2585
|
}
|
|
2586
|
+
defer(e, t) {
|
|
2587
|
+
return this._getScope().defer?.(e, t);
|
|
2588
|
+
}
|
|
2584
2589
|
formatResults(e) {
|
|
2585
2590
|
this._getScope().formatResults?.(e);
|
|
2586
2591
|
}
|
|
@@ -2597,14 +2602,18 @@ var zi = class {
|
|
|
2597
2602
|
return this._getScope().getAddress(e, t);
|
|
2598
2603
|
}
|
|
2599
2604
|
compare(e, t, r) {
|
|
2600
|
-
return this._getScope().compare?.(e, t, r) ??
|
|
2605
|
+
return this._getScope().compare?.(e, t, r) ?? ke.compare(e, t, r);
|
|
2601
2606
|
}
|
|
2602
2607
|
getRuntime() {
|
|
2603
2608
|
return this._getScope().getRuntime();
|
|
2604
2609
|
}
|
|
2610
|
+
createRichData(e, t) {
|
|
2611
|
+
let r = this._getScope();
|
|
2612
|
+
return r.createRichData ? r.createRichData(e, t) : ke.createRichData(e, t);
|
|
2613
|
+
}
|
|
2605
2614
|
getArgs() {
|
|
2606
2615
|
let e = this._argsFn, t = e ? e() : null;
|
|
2607
|
-
if (!t) throw new
|
|
2616
|
+
if (!t) throw new oe(Hr);
|
|
2608
2617
|
return t;
|
|
2609
2618
|
}
|
|
2610
2619
|
get [Symbol.toStringTag]() {
|
|
@@ -2613,7 +2622,7 @@ var zi = class {
|
|
|
2613
2622
|
toString() {
|
|
2614
2623
|
return this._getScope()?.toString?.() ?? "{STUB SCOPE}";
|
|
2615
2624
|
}
|
|
2616
|
-
},
|
|
2625
|
+
}, Wt = Object.freeze({
|
|
2617
2626
|
tag: "en-US",
|
|
2618
2627
|
numberingSystem: "latn",
|
|
2619
2628
|
decimal: ".",
|
|
@@ -2694,8 +2703,8 @@ var zi = class {
|
|
|
2694
2703
|
numeric: !0
|
|
2695
2704
|
})
|
|
2696
2705
|
});
|
|
2697
|
-
new
|
|
2698
|
-
const
|
|
2706
|
+
new Jo();
|
|
2707
|
+
const Yo = [
|
|
2699
2708
|
{
|
|
2700
2709
|
name: "param",
|
|
2701
2710
|
group: "jsdoc",
|
|
@@ -2753,66 +2762,61 @@ const Hi = [
|
|
|
2753
2762
|
group: "jsdoc",
|
|
2754
2763
|
description: "Reference a related function or link."
|
|
2755
2764
|
}
|
|
2756
|
-
],
|
|
2765
|
+
], qo = (() => {
|
|
2757
2766
|
const e = /* @__PURE__ */ new Map();
|
|
2758
|
-
for (const t of
|
|
2767
|
+
for (const t of Yo) if (e.set(t.name, t), t.aliases) for (const r of t.aliases) e.set(r, t);
|
|
2759
2768
|
return e;
|
|
2760
2769
|
})();
|
|
2761
|
-
function
|
|
2770
|
+
function Zo(e) {
|
|
2762
2771
|
if (!e) return;
|
|
2763
2772
|
const t = (e.startsWith("@") ? e.slice(1) : e).toLowerCase();
|
|
2764
|
-
return
|
|
2773
|
+
return qo.get(t);
|
|
2765
2774
|
}
|
|
2766
|
-
function
|
|
2767
|
-
return
|
|
2775
|
+
function Qo(e) {
|
|
2776
|
+
return Zo(e)?.standalone === !0;
|
|
2768
2777
|
}
|
|
2769
|
-
const
|
|
2778
|
+
const mt = /* @__PURE__ */ new Map([["IReferenceRange", "p"], ["IRange", "r"]]), at = new Set(Object.values(Xt).filter((e) => e !== Xt.Omitted)), St = /* @__PURE__ */ new Map([
|
|
2770
2779
|
["IWorkbook", "workbook"],
|
|
2771
2780
|
["IWorksheet", "sheet"],
|
|
2772
2781
|
["ICellRanges", "ranges"],
|
|
2773
2782
|
["ICellRange", "range"]
|
|
2774
|
-
]),
|
|
2783
|
+
]), ei = Array.from(St.keys()), bt = (e, t) => {
|
|
2775
2784
|
Array.from(t.keys()).forEach((r) => {
|
|
2776
2785
|
const n = t.get(r);
|
|
2777
2786
|
t.set(\`\${e}.\${r}\`, n);
|
|
2778
2787
|
});
|
|
2779
|
-
},
|
|
2788
|
+
}, ti = /* @__PURE__ */ new Map([
|
|
2780
2789
|
["Scalar", "*"],
|
|
2781
2790
|
["Lambda", "l"],
|
|
2782
2791
|
["FormulaError.Known", me.Error],
|
|
2783
|
-
["Date",
|
|
2784
|
-
["IRichData",
|
|
2785
|
-
]),
|
|
2786
|
-
if (
|
|
2787
|
-
const t =
|
|
2792
|
+
["Date", Vt.Date],
|
|
2793
|
+
["IRichData", Vt.RichData]
|
|
2794
|
+
]), Jr = /* @__PURE__ */ new Map([["Repeating", "repeating"]]), ri = /* @__PURE__ */ new Set(["Flatten", "SheetXL.Flatten"]), Yr = /* @__PURE__ */ new Set(["AcceptError"]), qr = /* @__PURE__ */ new Set(["Omittable"]), Zr = /* @__PURE__ */ new Set(["NoLift"]), Qr = /* @__PURE__ */ new Set(["NoFilter"]), en = /* @__PURE__ */ new Set(["Lazy"]), ht = /* @__PURE__ */ new Set(["ReportType"]), Jt = 255, ni = /^[a-zA-Z_-][a-zA-Z0-9_.-]*$/, oi = /^([a-z]{1,3})([0-9]+)$/i, ii = /^r[0-9]*c[0-9]*$/i, ai = (e) => {
|
|
2795
|
+
if (ii.test(e)) return !0;
|
|
2796
|
+
const t = oi.exec(e);
|
|
2788
2797
|
if (!t) return !1;
|
|
2789
2798
|
let r = 0;
|
|
2790
|
-
for (const
|
|
2799
|
+
for (const o of t[1].toUpperCase()) r = r * 26 + (o.charCodeAt(0) - 64);
|
|
2791
2800
|
const n = Number(t[2]);
|
|
2792
2801
|
return r <= 16384 && n >= 1 && n <= 1048576;
|
|
2793
|
-
}, se = "SheetXL",
|
|
2802
|
+
}, se = "SheetXL", _e = (e) => {
|
|
2794
2803
|
const t = e.typeName.getText();
|
|
2795
2804
|
return t.startsWith(\`\${se}.\`) ? t.slice(8) : t;
|
|
2796
2805
|
};
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
const
|
|
2807
|
-
["Promise", () => ({ async: !0 })],
|
|
2808
|
-
["Observable", () => ({ stream: !0 })],
|
|
2809
|
-
["Volatile", () => ({ volatile: !0 })],
|
|
2810
|
-
[\`\${se}.Volatile\`, () => ({ volatile: !0 })]
|
|
2811
|
-
]), Jt = "__scriptContext__", Yt = "script", oo = /* @__PURE__ */ new Set([
|
|
2806
|
+
bt(se, mt);
|
|
2807
|
+
bt(se, St);
|
|
2808
|
+
bt(se, Jr);
|
|
2809
|
+
Yr.add(se + ".AcceptError");
|
|
2810
|
+
qr.add(\`\${se}.Omittable\`);
|
|
2811
|
+
Zr.add(\`\${se}.NoLift\`);
|
|
2812
|
+
Qr.add(\`\${se}.NoFilter\`);
|
|
2813
|
+
en.add(\`\${se}.Lazy\`);
|
|
2814
|
+
ht.add(\`\${se}.ReportType\`);
|
|
2815
|
+
const li = /* @__PURE__ */ new Map([["Volatile", () => ({ volatile: !0 })], [\`\${se}.Volatile\`, () => ({ volatile: !0 })]]), Yt = "__scriptContext__", qt = "script", si = /* @__PURE__ */ new Set([
|
|
2812
2816
|
"IScript.ScriptContext",
|
|
2813
2817
|
\`\${se}.IScript.ScriptContext\`,
|
|
2814
2818
|
"ScriptContext"
|
|
2815
|
-
]),
|
|
2819
|
+
]), Zt = (e, t) => {
|
|
2816
2820
|
const r = t.literal;
|
|
2817
2821
|
if (r === void 0) return;
|
|
2818
2822
|
const n = e.SyntaxKind;
|
|
@@ -2825,19 +2829,19 @@ const io = /* @__PURE__ */ new Map([
|
|
|
2825
2829
|
case n.PrefixUnaryExpression: return r.operator === n.MinusToken && r.operand?.kind === n.NumericLiteral ? -parseFloat(r.operand.text) : void 0;
|
|
2826
2830
|
default: return;
|
|
2827
2831
|
}
|
|
2828
|
-
},
|
|
2832
|
+
}, Le = (e) => {
|
|
2829
2833
|
if (!e || e.length === 0) return "";
|
|
2830
2834
|
let t = "";
|
|
2831
2835
|
for (let r = 0; r < e.length; r++) {
|
|
2832
|
-
const n = e[r],
|
|
2833
|
-
if (
|
|
2834
|
-
if (
|
|
2835
|
-
const
|
|
2836
|
-
if (
|
|
2836
|
+
const n = e[r], o = n.kind;
|
|
2837
|
+
if (o !== "link") {
|
|
2838
|
+
if (o === "linkName") {
|
|
2839
|
+
const i = e[r + 1];
|
|
2840
|
+
if (i?.kind === "linkText" && i.text.trim()) continue;
|
|
2837
2841
|
t += n.text;
|
|
2838
2842
|
continue;
|
|
2839
2843
|
}
|
|
2840
|
-
if (
|
|
2844
|
+
if (o === "linkText") {
|
|
2841
2845
|
t += n.text.trim();
|
|
2842
2846
|
continue;
|
|
2843
2847
|
}
|
|
@@ -2849,8 +2853,8 @@ const io = /* @__PURE__ */ new Map([
|
|
|
2849
2853
|
\`).map((n) => n.trim()).filter(Boolean).join(" ")).filter(Boolean).join(\`
|
|
2850
2854
|
\`).trim();
|
|
2851
2855
|
};
|
|
2852
|
-
function
|
|
2853
|
-
const
|
|
2856
|
+
function ci(e, t, r, n) {
|
|
2857
|
+
const o = n?.builtInNames?.length ? new Set(n.builtInNames.map((u) => u.toUpperCase())) : null, i = [], l = /* @__PURE__ */ new Map(), s = [];
|
|
2854
2858
|
let c = null;
|
|
2855
2859
|
const d = (u) => {
|
|
2856
2860
|
if (!u || typeof u.getStart != "function") return {
|
|
@@ -2868,783 +2872,782 @@ function ao(e, t, r, n) {
|
|
|
2868
2872
|
length: 0
|
|
2869
2873
|
};
|
|
2870
2874
|
}
|
|
2871
|
-
}, m = (u,
|
|
2872
|
-
const { start: C, length:
|
|
2875
|
+
}, m = (u, f, v, _) => {
|
|
2876
|
+
const { start: C, length: L } = d(u);
|
|
2873
2877
|
s.push({
|
|
2874
2878
|
start: C,
|
|
2875
|
-
length:
|
|
2876
|
-
severity:
|
|
2877
|
-
code:
|
|
2878
|
-
message:
|
|
2879
|
+
length: L,
|
|
2880
|
+
severity: v,
|
|
2881
|
+
code: f,
|
|
2882
|
+
message: _
|
|
2879
2883
|
});
|
|
2880
|
-
}, a = (u,
|
|
2881
|
-
m(u,
|
|
2882
|
-
},
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
const
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2884
|
+
}, a = (u, f, v) => {
|
|
2885
|
+
m(u, f, "error", v);
|
|
2886
|
+
}, p = (u) => u?.parent?.name?.escapedText;
|
|
2887
|
+
let b = null;
|
|
2888
|
+
const S = (u, f, v, _, C = !1, L = !1, K = !1) => {
|
|
2889
|
+
const F = { count: 0 }, $ = te(u, f, v, _, F, C, L, K);
|
|
2890
|
+
F.count >= 2 && (f.range || (f.range = "m", F.count -= 2), !_ && F.count >= 1 && (F.count -= 1, F.count > 0 && a(u, E.ArrayDepth, \`Arrays of more than 2 dimensions are not supported: '\${p(u)}'.\`))), F.count > 0 && (f.arrayDepth = F.count);
|
|
2891
|
+
const P = f.enum;
|
|
2892
|
+
return P && (F.count > (K ? 1 : 0) || f.range) && !z.has(f) && (f.valueOrRange || (a(u, E.EnumPosition, \`A list cannot hold the enum '\${P.id}': '\${f.name ?? p(u)}'. Its members reach the body as they are, so nothing checks them against the enum. Take one value per argument ('...x: \${P.id}[]'), or type the list by its scalar ('\${P.type}').\`), delete f.enum)), $;
|
|
2893
|
+
}, A = (u, f, v, _, C) => {
|
|
2894
|
+
if (f !== "Lambda" && f !== \`\${se}.Lambda\`) return !1;
|
|
2895
|
+
const L = u.typeArguments;
|
|
2896
|
+
let K = "*";
|
|
2897
|
+
if (L && L.length === 2) if (C && L[0].kind === e.SyntaxKind.TupleType && (v.lambdaArity = L[0].elements.length), L[1].kind === e.SyntaxKind.AnyKeyword) K = "raw";
|
|
2892
2898
|
else {
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2899
|
+
const F = {};
|
|
2900
|
+
te(L[1], F, _, !1, { count: 0 }), K = F.scalar ?? "*";
|
|
2895
2901
|
}
|
|
2896
|
-
else if (
|
|
2902
|
+
else if (L && L.length === 1 && L[0].kind !== e.SyntaxKind.TupleType && L[0].kind !== e.SyntaxKind.ArrayType) if (C && (v.lambdaArity = 2), L[0].kind === e.SyntaxKind.AnyKeyword) K = "raw";
|
|
2897
2903
|
else {
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2904
|
+
const F = {};
|
|
2905
|
+
te(L[0], F, _, !1, { count: 0 }), K = F.scalar ?? "*";
|
|
2900
2906
|
}
|
|
2901
|
-
return
|
|
2902
|
-
},
|
|
2903
|
-
if (!
|
|
2904
|
-
a(u,
|
|
2907
|
+
return v.lambda = K, !0;
|
|
2908
|
+
}, U = (u, f, v, _) => {
|
|
2909
|
+
if (!_) {
|
|
2910
|
+
a(u, E.FunctionReturn, \`Function type is not a valid return type: '\${p(u)}'. Declare a 'Lambda' return instead.\`);
|
|
2905
2911
|
return;
|
|
2906
2912
|
}
|
|
2907
|
-
const C = u.type,
|
|
2908
|
-
let
|
|
2909
|
-
C && (C.kind === e.SyntaxKind.AnyKeyword ?
|
|
2910
|
-
const
|
|
2911
|
-
|
|
2912
|
-
},
|
|
2913
|
-
return u.getJsDocTags(r).find((
|
|
2914
|
-
},
|
|
2915
|
-
const
|
|
2916
|
-
if (
|
|
2917
|
-
},
|
|
2918
|
-
const
|
|
2919
|
-
if (
|
|
2913
|
+
const C = u.type, L = {};
|
|
2914
|
+
let K = "*";
|
|
2915
|
+
C && (C.kind === e.SyntaxKind.AnyKeyword ? K = "raw" : (te(C, L, v, !1, { count: 0 }), K = L.scalar ?? "*"));
|
|
2916
|
+
const F = u.parameters;
|
|
2917
|
+
F && !F.some(($) => $.dotDotDotToken) && (f.lambdaArity = F.length), f.lambda = K;
|
|
2918
|
+
}, h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Set(), z = /* @__PURE__ */ new WeakSet(), k = (u) => u !== void 0 && u.getSourceFile() === t, R = (u, f = !1) => {
|
|
2919
|
+
return u.getJsDocTags(r).find((_) => _.name === "name")?.text?.map((_) => _.text).join("").trim() || (f ? or.camelToPrettyCase(u.name) : u.name);
|
|
2920
|
+
}, O = (u) => {
|
|
2921
|
+
const f = u.getJsDocTags(r).find((v) => v.name === "deprecated");
|
|
2922
|
+
if (f) return f.text?.map((v) => v.text).join("").trim() || !0;
|
|
2923
|
+
}, de = (u, f) => {
|
|
2924
|
+
const v = e.isTypeReferenceNode(u) ? u.typeName : void 0, _ = v ? r.getSymbolAtLocation(v) : void 0, C = _?.declarations?.length ? _ : void 0;
|
|
2925
|
+
if (v) {
|
|
2920
2926
|
if (C && C.flags & e.SymbolFlags.Alias) {
|
|
2921
|
-
a(u,
|
|
2927
|
+
a(u, E.EnumNotLocal, \`'\${v.getText()}' is imported, so its declaration cannot be read: '\${f}'. An enum must be declared in the module that uses it.\`);
|
|
2922
2928
|
return;
|
|
2923
2929
|
}
|
|
2924
2930
|
if (!C || !(C.flags & e.SymbolFlags.Type)) {
|
|
2925
|
-
const x =
|
|
2931
|
+
const x = v.getText();
|
|
2926
2932
|
if (!(C ? (C.flags & e.SymbolFlags.Variable) !== 0 : t.statements.some((I) => e.isVariableStatement(I) && I.declarationList.declarations.some((V) => e.isIdentifier(V.name) && V.name.text === x)))) return null;
|
|
2927
|
-
a(u,
|
|
2933
|
+
a(u, E.EnumMissingAlias, \`'\${x}' is a value, not a type: '\${f}'. Pair the object with a same-name type — 'type \${x} = typeof \${x}[keyof typeof \${x}];' — or declare it as 'enum \${x} { … }'.\`);
|
|
2928
2934
|
return;
|
|
2929
2935
|
}
|
|
2930
|
-
const
|
|
2931
|
-
if (
|
|
2932
|
-
if (
|
|
2936
|
+
const g = h.get(C);
|
|
2937
|
+
if (g !== void 0) return g;
|
|
2938
|
+
if (D.has(C)) return;
|
|
2933
2939
|
}
|
|
2934
|
-
const
|
|
2935
|
-
let
|
|
2940
|
+
const L = [];
|
|
2941
|
+
let K = !1;
|
|
2936
2942
|
if (C && C.flags & e.SymbolFlags.Enum) {
|
|
2937
|
-
if (!C.declarations?.some(
|
|
2938
|
-
a(u,
|
|
2943
|
+
if (!C.declarations?.some(k)) {
|
|
2944
|
+
a(u, E.EnumNotLocal, \`'\${C.name}' is not declared in this module: '\${f}'. An enum must be declared in the module that uses it.\`);
|
|
2939
2945
|
return;
|
|
2940
2946
|
}
|
|
2941
|
-
|
|
2942
|
-
let
|
|
2947
|
+
K = !0;
|
|
2948
|
+
let g = !1;
|
|
2943
2949
|
if (C.exports?.forEach((x) => {
|
|
2944
2950
|
const I = x.valueDeclaration;
|
|
2945
2951
|
if (!I || !e.isEnumMember(I)) return;
|
|
2946
2952
|
const V = r.getConstantValue(I);
|
|
2947
2953
|
if (V === void 0) {
|
|
2948
|
-
a(I,
|
|
2954
|
+
a(I, E.EnumMemberNotConstant, \`'\${C.name}.\${x.name}' is not a constant number or string. A formula passes the VALUE, so every member needs one that can be read at compile time.\`), g = !0;
|
|
2949
2955
|
return;
|
|
2950
2956
|
}
|
|
2951
|
-
|
|
2952
|
-
|
|
2957
|
+
L.push([
|
|
2958
|
+
R(x, !0),
|
|
2953
2959
|
V,
|
|
2954
2960
|
I,
|
|
2955
|
-
|
|
2956
|
-
|
|
2961
|
+
Le(x.getDocumentationComment(r)),
|
|
2962
|
+
O(x)
|
|
2957
2963
|
]);
|
|
2958
|
-
}),
|
|
2959
|
-
|
|
2964
|
+
}), g) {
|
|
2965
|
+
D.add(C);
|
|
2960
2966
|
return;
|
|
2961
2967
|
}
|
|
2962
2968
|
} else {
|
|
2963
|
-
const
|
|
2969
|
+
const g = r.getTypeFromTypeNode(u), x = e.TypeFlags.Null | e.TypeFlags.Undefined | e.TypeFlags.Void, I = (g.isUnion() ? g.types : [g]).filter((B) => !(B.flags & x)), V = [];
|
|
2964
2970
|
for (const B of I) {
|
|
2965
|
-
if (!(B.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral))) return C &&
|
|
2971
|
+
if (!(B.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral))) return C && h.set(C, null), null;
|
|
2966
2972
|
V.push(B.value);
|
|
2967
2973
|
}
|
|
2968
2974
|
if (V.length === 0) return null;
|
|
2969
|
-
const re = C?.declarations?.find((B) => e.isTypeAliasDeclaration(B)),
|
|
2970
|
-
if (
|
|
2971
|
-
const B =
|
|
2975
|
+
const re = C?.declarations?.find((B) => e.isTypeAliasDeclaration(B)), Y = e.isUnionTypeNode(u) ? u : re?.type;
|
|
2976
|
+
if (Y && e.isUnionTypeNode(Y)) {
|
|
2977
|
+
const B = Y.types.map((N) => {
|
|
2972
2978
|
const ne = r.getTypeFromTypeNode(N);
|
|
2973
2979
|
return ne.isLiteral() ? ne.value : void 0;
|
|
2974
|
-
}),
|
|
2980
|
+
}), M = (N) => {
|
|
2975
2981
|
const ne = B.indexOf(N);
|
|
2976
2982
|
return ne < 0 ? B.length : ne;
|
|
2977
2983
|
};
|
|
2978
|
-
V.sort((N, ne) =>
|
|
2984
|
+
V.sort((N, ne) => M(N) - M(ne));
|
|
2979
2985
|
}
|
|
2980
|
-
const
|
|
2981
|
-
if (C &&
|
|
2982
|
-
const
|
|
2986
|
+
const Q = C && C.flags & e.SymbolFlags.Variable ? C.valueDeclaration : void 0, he = new Set(V);
|
|
2987
|
+
if (C && Q && k(Q)) for (const B of r.getTypeOfSymbolAtLocation(C, Q).getProperties()) {
|
|
2988
|
+
const M = B.valueDeclaration, N = r.getTypeOfSymbolAtLocation(B, M ?? Q);
|
|
2983
2989
|
if (!(N.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral))) continue;
|
|
2984
2990
|
const ne = N.value;
|
|
2985
|
-
V.includes(ne) && (
|
|
2986
|
-
|
|
2991
|
+
V.includes(ne) && (K = !0, he.delete(ne), L.push([
|
|
2992
|
+
R(B, !0),
|
|
2987
2993
|
ne,
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2994
|
+
M,
|
|
2995
|
+
Le(B.getDocumentationComment(r)),
|
|
2996
|
+
O(B)
|
|
2991
2997
|
]));
|
|
2992
2998
|
}
|
|
2993
|
-
for (const B of V) he.has(B) &&
|
|
2999
|
+
for (const B of V) he.has(B) && L.push([
|
|
2994
3000
|
String(B),
|
|
2995
3001
|
B,
|
|
2996
3002
|
void 0,
|
|
2997
3003
|
null
|
|
2998
3004
|
]);
|
|
2999
3005
|
}
|
|
3000
|
-
if (
|
|
3001
|
-
const
|
|
3002
|
-
if (
|
|
3003
|
-
a(u,
|
|
3006
|
+
if (L.length === 0) return null;
|
|
3007
|
+
const F = typeof L[0][1] == "number";
|
|
3008
|
+
if (L.some(([, g]) => typeof g == "number" !== F)) {
|
|
3009
|
+
a(u, E.EnumMixed, \`'\${C?.name ?? u.getText()}' mixes number and string members: '\${f}'. A parameter has one type, so an enum is all numbers or all strings.\`);
|
|
3004
3010
|
return;
|
|
3005
3011
|
}
|
|
3006
|
-
const $ = C ?
|
|
3012
|
+
const $ = C ? R(C) : L.map(([, g]) => String(g)).join("|"), P = C ? void 0 : y.get($);
|
|
3007
3013
|
if (P) return P;
|
|
3008
|
-
if (
|
|
3009
|
-
const
|
|
3010
|
-
for (const [x, I, V, re] of
|
|
3011
|
-
const
|
|
3012
|
-
|
|
3014
|
+
if (K) {
|
|
3015
|
+
const g = /* @__PURE__ */ new Map();
|
|
3016
|
+
for (const [x, I, V, re] of L) {
|
|
3017
|
+
const Y = V?.name?.getText() ?? x, Q = g.get(I);
|
|
3018
|
+
Q !== void 0 ? m(V ?? u, E.EnumDuplicateValue, "warning", \`'\${$}.\${Y}' has the same value as '\${$}.\${Q}' (\${JSON.stringify(I)}). A formula passes the value, so the two cannot be told apart.\`) : g.set(I, Y), re === "" && m(V ?? u, E.EnumMemberUndocumented, "warning", \`'\${$}.\${Y}' is missing a description. Add a doc comment above the member — it is what the argument dropdown shows.\`);
|
|
3013
3019
|
}
|
|
3014
3020
|
}
|
|
3015
3021
|
const G = {
|
|
3016
3022
|
id: $,
|
|
3017
|
-
type:
|
|
3018
|
-
members:
|
|
3019
|
-
|
|
3023
|
+
type: F ? me.Number : me.String,
|
|
3024
|
+
members: L.map(([g, x, , , I]) => I ? [
|
|
3025
|
+
g,
|
|
3020
3026
|
x,
|
|
3021
3027
|
I
|
|
3022
|
-
] : [
|
|
3028
|
+
] : [g, x])
|
|
3023
3029
|
};
|
|
3024
|
-
C ?
|
|
3025
|
-
const X = C ?
|
|
3026
|
-
for (const [
|
|
3027
|
-
if (X || Object.keys(
|
|
3028
|
-
const
|
|
3029
|
-
X && (
|
|
3030
|
+
C ? h.set(C, G) : y.set($, G);
|
|
3031
|
+
const X = C ? Le(C.getDocumentationComment(r)) : "", j = {};
|
|
3032
|
+
for (const [g, , , x] of L) x && (j[g] = { description: x });
|
|
3033
|
+
if (X || Object.keys(j).length > 0) {
|
|
3034
|
+
const g = {};
|
|
3035
|
+
X && (g.summary = X), Object.keys(j).length > 0 && (g.members = j), w.set(G, g);
|
|
3030
3036
|
}
|
|
3031
3037
|
return G;
|
|
3032
|
-
},
|
|
3033
|
-
const C = (
|
|
3034
|
-
const G = { name:
|
|
3035
|
-
return
|
|
3038
|
+
}, we = (u, f, v, _) => {
|
|
3039
|
+
const C = (F, $, P) => {
|
|
3040
|
+
const G = { name: F };
|
|
3041
|
+
return S($, G, v, !0), P && (G.optional = !0), _ && !G.acceptError && (G.acceptError = !0), G;
|
|
3036
3042
|
};
|
|
3037
|
-
if (u.kind !== e.SyntaxKind.TupleType) return [C(
|
|
3038
|
-
const
|
|
3039
|
-
if (
|
|
3040
|
-
const
|
|
3041
|
-
for (let
|
|
3042
|
-
const $ =
|
|
3043
|
-
if ($.kind !== e.SyntaxKind.NamedTupleMember) return a($,
|
|
3043
|
+
if (u.kind !== e.SyntaxKind.TupleType) return [C(f, u, !1)];
|
|
3044
|
+
const L = u.elements;
|
|
3045
|
+
if (L.length < 2) return a(u, E.RepeatingSlots, \`'\${f}': a repeating group of period \${L.length} must be spelled 'Repeating<T>' without the tuple.\`), null;
|
|
3046
|
+
const K = [];
|
|
3047
|
+
for (let F = 0; F < L.length; F++) {
|
|
3048
|
+
const $ = L[F];
|
|
3049
|
+
if ($.kind !== e.SyntaxKind.NamedTupleMember) return a($, E.RepeatingSlots, \`'\${f}': every slot of a repeating group must be labelled, e.g. 'Repeating<[criteriaRange: IRange, criteria: Scalar]>'.\`), null;
|
|
3044
3050
|
const P = !!$.questionToken;
|
|
3045
|
-
if (P &&
|
|
3046
|
-
|
|
3051
|
+
if (P && F !== L.length - 1) return a($, E.RepeatingOptional, \`'\${f}': only the LAST slot of a repeating group may be optional (slot '\${$.name?.getText?.()}' is not).\`), null;
|
|
3052
|
+
K.push(C($.name?.getText?.() ?? \`\${F}\`, $.type, P));
|
|
3047
3053
|
}
|
|
3048
|
-
return
|
|
3049
|
-
},
|
|
3054
|
+
return K;
|
|
3055
|
+
}, te = (u, f, v, _, C, L = !1, K = !1, F = !1) => {
|
|
3050
3056
|
if (!u) {
|
|
3051
|
-
a(u,
|
|
3057
|
+
a(u, E.MissingType, \`Type is not defined for '\${f?.name ?? "return"}'.\`);
|
|
3052
3058
|
return;
|
|
3053
3059
|
}
|
|
3054
|
-
if (u.kind === e.SyntaxKind.ParenthesizedType) return
|
|
3060
|
+
if (u.kind === e.SyntaxKind.ParenthesizedType) return te(u.type, f, v, _, C, L, K, F);
|
|
3055
3061
|
if (u.kind === e.SyntaxKind.UnionType) {
|
|
3056
3062
|
const $ = (X) => X.kind === e.SyntaxKind.UndefinedKeyword || X.kind === e.SyntaxKind.VoidKeyword || X.kind === e.SyntaxKind.NullKeyword || X.kind === e.SyntaxKind.LiteralType && X.literal?.kind === e.SyntaxKind.NullKeyword, P = u.types.filter((X) => !$(X));
|
|
3057
|
-
if (P.length === 1) return
|
|
3058
|
-
const G =
|
|
3063
|
+
if (P.length === 1) return te(P[0], f, v, _, C, L, K, F);
|
|
3064
|
+
const G = de(u, f.name ?? p(u));
|
|
3059
3065
|
if (G === void 0) return;
|
|
3060
3066
|
if (G !== null) {
|
|
3061
|
-
|
|
3067
|
+
f.scalar = G.type, _ && (f.enum = G);
|
|
3062
3068
|
return;
|
|
3063
3069
|
}
|
|
3064
|
-
if (!
|
|
3065
|
-
|
|
3070
|
+
if (!_) {
|
|
3071
|
+
f.scalar = "*";
|
|
3066
3072
|
return;
|
|
3067
3073
|
}
|
|
3068
3074
|
if (P.length === 2) {
|
|
3069
|
-
const X = (
|
|
3070
|
-
if (
|
|
3071
|
-
|
|
3075
|
+
const X = (g) => g.kind !== e.SyntaxKind.TypeReference ? !1 : e.isTypeReferenceNode(g) && _e(g) === "Lambda", j = P.findIndex(X);
|
|
3076
|
+
if (j >= 0 && !X(P[1 - j])) {
|
|
3077
|
+
te(P[1 - j], f, v, _, C, L, K, F), A(P[j], _e(P[j]), f, v, _);
|
|
3072
3078
|
return;
|
|
3073
3079
|
}
|
|
3074
3080
|
}
|
|
3075
|
-
if (
|
|
3076
|
-
const X = (
|
|
3077
|
-
if (!(
|
|
3078
|
-
},
|
|
3079
|
-
if (
|
|
3080
|
-
const
|
|
3081
|
-
if (
|
|
3082
|
-
|
|
3083
|
-
const I =
|
|
3084
|
-
I && (
|
|
3081
|
+
if (_ && P.length === 2) {
|
|
3082
|
+
const X = (g) => {
|
|
3083
|
+
if (!(g.kind !== e.SyntaxKind.TypeReference || g.typeArguments?.length)) return mt.get(_e(g));
|
|
3084
|
+
}, j = P.findIndex((g) => X(g) !== void 0);
|
|
3085
|
+
if (j >= 0 && X(P[1 - j]) === void 0) {
|
|
3086
|
+
const g = {}, x = C.count;
|
|
3087
|
+
if (te(P[1 - j], g, v, _, C, L, !1), g.scalar && !g.range && g.lambda == null && C.count === x) {
|
|
3088
|
+
f.range = X(P[j]), f.scalar = g.scalar, f.valueOrRange = !0;
|
|
3089
|
+
const I = g.enum;
|
|
3090
|
+
I && (f.enum = I);
|
|
3085
3091
|
return;
|
|
3086
3092
|
}
|
|
3087
3093
|
}
|
|
3088
3094
|
}
|
|
3089
|
-
if (
|
|
3090
|
-
const X = (
|
|
3091
|
-
if (
|
|
3092
|
-
const
|
|
3093
|
-
if (
|
|
3094
|
-
if (
|
|
3095
|
-
|
|
3095
|
+
if (_ && P.length === 2) {
|
|
3096
|
+
const X = (g) => g.kind === e.SyntaxKind.TypeReference && !g.typeArguments?.length && _e(g) === "Scalar", j = P.findIndex(X);
|
|
3097
|
+
if (j >= 0 && !X(P[1 - j])) {
|
|
3098
|
+
const g = de(P[1 - j], f.name ?? p(u));
|
|
3099
|
+
if (g === void 0) return;
|
|
3100
|
+
if (g !== null) {
|
|
3101
|
+
f.scalar = "*", f.enum = g;
|
|
3096
3102
|
return;
|
|
3097
3103
|
}
|
|
3098
3104
|
}
|
|
3099
3105
|
}
|
|
3100
|
-
a(u,
|
|
3106
|
+
a(u, E.InvalidParamType, \`Union parameter types are not supported: '\${p(u)}'. Use a single type, optionally with '| null' or '| undefined', 'T | Lambda<…>' for a value-or-lambda slot, 'IRange | Scalar' for a value-or-range slot, or 'E | Scalar' for an uncoerced slot whose values an enum documents.\`);
|
|
3101
3107
|
return;
|
|
3102
3108
|
}
|
|
3103
|
-
if (u.kind === e.SyntaxKind.NumberKeyword)
|
|
3104
|
-
else if (u.kind === e.SyntaxKind.StringKeyword)
|
|
3105
|
-
else if (u.kind === e.SyntaxKind.BooleanKeyword)
|
|
3109
|
+
if (u.kind === e.SyntaxKind.NumberKeyword) f.scalar = me.Number;
|
|
3110
|
+
else if (u.kind === e.SyntaxKind.StringKeyword) f.scalar = me.String;
|
|
3111
|
+
else if (u.kind === e.SyntaxKind.BooleanKeyword) f.scalar = me.Boolean;
|
|
3106
3112
|
else if (u.kind === e.SyntaxKind.UndefinedKeyword || u.kind === e.SyntaxKind.NullKeyword || u.kind === e.SyntaxKind.VoidKeyword) {
|
|
3107
|
-
if (
|
|
3108
|
-
a(u,
|
|
3113
|
+
if (_) {
|
|
3114
|
+
a(u, E.UndefinedInput, \`'undefined' is not a valid type for input: '\${p(u)}'.\`);
|
|
3109
3115
|
return;
|
|
3110
3116
|
}
|
|
3111
|
-
|
|
3112
|
-
} else if (u.kind === e.SyntaxKind.BigIntKeyword)
|
|
3113
|
-
else if (u.kind === e.SyntaxKind.AnyKeyword)
|
|
3117
|
+
f.scalar = me.Null;
|
|
3118
|
+
} else if (u.kind === e.SyntaxKind.BigIntKeyword) f.scalar = me.Number;
|
|
3119
|
+
else if (u.kind === e.SyntaxKind.AnyKeyword) _ && (f.range = "*");
|
|
3114
3120
|
else if (u.kind === e.SyntaxKind.ArrayType) {
|
|
3115
3121
|
const $ = u.elementType;
|
|
3116
3122
|
if (!$) {
|
|
3117
|
-
a(u,
|
|
3123
|
+
a(u, E.UntypedArray, \`'Array' must be typed: '\${p(u)}'.\`);
|
|
3118
3124
|
return;
|
|
3119
3125
|
}
|
|
3120
|
-
if (
|
|
3121
|
-
const P =
|
|
3126
|
+
if (_ && K) {
|
|
3127
|
+
const P = f, G = P.name ?? p(u) ?? "parameter", X = P.acceptError;
|
|
3122
3128
|
delete P.acceptError;
|
|
3123
|
-
const
|
|
3124
|
-
|
|
3129
|
+
const j = { name: G };
|
|
3130
|
+
S($, j, v, !0), X && !j.acceptError && (j.acceptError = !0), P.repeating = [j];
|
|
3125
3131
|
return;
|
|
3126
3132
|
}
|
|
3127
|
-
C.count++,
|
|
3133
|
+
C.count++, te($, f, v, _, C);
|
|
3128
3134
|
} else if (u.kind !== e.SyntaxKind.TupleType) if (u.kind === e.SyntaxKind.TypeReference) {
|
|
3129
|
-
const $ =
|
|
3130
|
-
if (
|
|
3131
|
-
const
|
|
3132
|
-
if (!
|
|
3133
|
-
a(u,
|
|
3135
|
+
const $ = _e(u);
|
|
3136
|
+
if (Yr.has($)) {
|
|
3137
|
+
const g = p(u);
|
|
3138
|
+
if (!_) {
|
|
3139
|
+
a(u, E.InvalidReturnType, \`'\${$}' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3134
3140
|
return;
|
|
3135
3141
|
}
|
|
3136
|
-
const x =
|
|
3142
|
+
const x = f;
|
|
3137
3143
|
if (x.acceptError) {
|
|
3138
|
-
a(u,
|
|
3144
|
+
a(u, E.InvalidParamType, \`'\${g}' declares 'AcceptError' more than once.\`);
|
|
3139
3145
|
return;
|
|
3140
3146
|
}
|
|
3141
3147
|
const I = u.typeArguments;
|
|
3142
3148
|
if (!I || I.length !== 1) {
|
|
3143
|
-
a(u,
|
|
3149
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3144
3150
|
return;
|
|
3145
3151
|
}
|
|
3146
|
-
return x.acceptError = !0,
|
|
3152
|
+
return x.acceptError = !0, te(I[0], f, v, _, C, L, K, F);
|
|
3147
3153
|
}
|
|
3148
|
-
if (
|
|
3149
|
-
const
|
|
3150
|
-
if (!
|
|
3151
|
-
a(u,
|
|
3154
|
+
if (ht.has($)) {
|
|
3155
|
+
const g = f.name ?? p(u);
|
|
3156
|
+
if (!_) {
|
|
3157
|
+
a(u, E.InvalidReturnType, \`'ReportType' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3152
3158
|
return;
|
|
3153
3159
|
}
|
|
3154
3160
|
const x = u.typeArguments;
|
|
3155
3161
|
if (!x || x.length !== 1) {
|
|
3156
|
-
a(u,
|
|
3162
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3157
3163
|
return;
|
|
3158
3164
|
}
|
|
3159
|
-
return
|
|
3165
|
+
return f.reportType = !0, te(x[0], f, v, _, C, L, K, F);
|
|
3160
3166
|
}
|
|
3161
|
-
if (
|
|
3162
|
-
const
|
|
3163
|
-
if (!
|
|
3164
|
-
a(u,
|
|
3167
|
+
if (Zr.has($)) {
|
|
3168
|
+
const g = f.name ?? p(u);
|
|
3169
|
+
if (!_) {
|
|
3170
|
+
a(u, E.InvalidReturnType, \`'NoLift' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3165
3171
|
return;
|
|
3166
3172
|
}
|
|
3167
3173
|
const x = u.typeArguments;
|
|
3168
3174
|
if (!x || x.length !== 1) {
|
|
3169
|
-
a(u,
|
|
3175
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3170
3176
|
return;
|
|
3171
3177
|
}
|
|
3172
|
-
const I =
|
|
3178
|
+
const I = f;
|
|
3173
3179
|
I.noLift = !0;
|
|
3174
3180
|
const V = C.count;
|
|
3175
|
-
|
|
3181
|
+
te(x[0], f, v, _, C, L, K, F), (I.range || I.lambda != null || I.repeating || C.count !== V) && a(u, E.InvalidParamType, \`'\${g}': 'NoLift' applies to a SCALAR parameter only - a range, list, repeating or lambda slot never lifts.\`);
|
|
3176
3182
|
return;
|
|
3177
3183
|
}
|
|
3178
|
-
if (
|
|
3179
|
-
const
|
|
3180
|
-
if (!
|
|
3181
|
-
a(u,
|
|
3184
|
+
if (Qr.has($)) {
|
|
3185
|
+
const g = f.name ?? p(u);
|
|
3186
|
+
if (!_) {
|
|
3187
|
+
a(u, E.InvalidReturnType, \`'NoFilter' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3182
3188
|
return;
|
|
3183
3189
|
}
|
|
3184
3190
|
const x = u.typeArguments;
|
|
3185
3191
|
if (!x || x.length !== 1) {
|
|
3186
|
-
a(u,
|
|
3192
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3187
3193
|
return;
|
|
3188
3194
|
}
|
|
3189
|
-
const I =
|
|
3195
|
+
const I = f;
|
|
3190
3196
|
I.noFilter = !0;
|
|
3191
3197
|
const V = C.count;
|
|
3192
|
-
if (
|
|
3193
|
-
a(u,
|
|
3198
|
+
if (te(x[0], f, v, _, C, L, K, F), I.range || I.lambda != null || C.count !== V) {
|
|
3199
|
+
a(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a SCALAR slot only - a range, list or lambda slot has no members to coerce.\`);
|
|
3194
3200
|
return;
|
|
3195
3201
|
}
|
|
3196
3202
|
const re = I.repeating;
|
|
3197
3203
|
if (re) {
|
|
3198
3204
|
if (delete I.noFilter, re.length !== 1) {
|
|
3199
|
-
a(u,
|
|
3205
|
+
a(u, E.InvalidParamType, \`'\${g}': 'NoFilter' over a repeating group applies to a period-1 group only - write it on the slot that takes the members.\`);
|
|
3200
3206
|
return;
|
|
3201
3207
|
}
|
|
3202
3208
|
re[0].noFilter = !0;
|
|
3203
|
-
} else
|
|
3209
|
+
} else K && a(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a REPEATING slot only - a single scalar argument has no members to coerce.\`);
|
|
3204
3210
|
return;
|
|
3205
3211
|
}
|
|
3206
|
-
if (
|
|
3207
|
-
const
|
|
3208
|
-
if (!
|
|
3209
|
-
a(u,
|
|
3212
|
+
if (qr.has($)) {
|
|
3213
|
+
const g = f.name ?? p(u);
|
|
3214
|
+
if (!_) {
|
|
3215
|
+
a(u, E.InvalidReturnType, \`'Omittable' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3210
3216
|
return;
|
|
3211
3217
|
}
|
|
3212
3218
|
const x = u.typeArguments;
|
|
3213
3219
|
if (!x || x.length < 1 || x.length > 2) {
|
|
3214
|
-
a(u,
|
|
3220
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
|
|
3215
3221
|
return;
|
|
3216
3222
|
}
|
|
3217
|
-
const I =
|
|
3223
|
+
const I = f;
|
|
3218
3224
|
if (I.omittable = !0, x.length === 2) {
|
|
3219
|
-
const
|
|
3220
|
-
if (
|
|
3221
|
-
a(u,
|
|
3225
|
+
const Y = Zt(e, x[1]);
|
|
3226
|
+
if (Y === void 0) {
|
|
3227
|
+
a(u, E.InvalidParamType, \`'\${g}' declares '\${$}' with a second type that is not a literal value. Use a number, string, boolean or null - the engine substitutes it for an omitted argument.\`);
|
|
3222
3228
|
return;
|
|
3223
3229
|
}
|
|
3224
|
-
I.omittedValue =
|
|
3230
|
+
I.omittedValue = Y;
|
|
3225
3231
|
}
|
|
3226
|
-
const V =
|
|
3227
|
-
return I.enum && re !== void 0 && re !== null && !I.enum.members.some(([,
|
|
3232
|
+
const V = te(x[0], f, v, _, C, L, K, F), re = I.omittedValue;
|
|
3233
|
+
return I.enum && re !== void 0 && re !== null && !I.enum.members.some(([, Y]) => Y === re) && a(x[1], E.EnumOmittedValue, \`'\${g}': \${JSON.stringify(re)} is not a member of '\${I.enum.id}'. An omitted argument must mean a member (\${I.enum.members.map(([, Y]) => JSON.stringify(Y)).join(", ")}) or null.\`), V;
|
|
3228
3234
|
}
|
|
3229
|
-
if (
|
|
3230
|
-
const
|
|
3231
|
-
if (!
|
|
3232
|
-
a(u,
|
|
3235
|
+
if (en.has($)) {
|
|
3236
|
+
const g = f.name ?? p(u);
|
|
3237
|
+
if (!_) {
|
|
3238
|
+
a(u, E.InvalidReturnType, \`'Lazy' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3233
3239
|
return;
|
|
3234
3240
|
}
|
|
3235
|
-
const x =
|
|
3241
|
+
const x = f;
|
|
3236
3242
|
if (x.lazy) {
|
|
3237
|
-
a(u,
|
|
3243
|
+
a(u, E.InvalidParamType, \`'\${g}' declares 'Lazy' more than once.\`);
|
|
3238
3244
|
return;
|
|
3239
3245
|
}
|
|
3240
3246
|
const I = u.typeArguments;
|
|
3241
3247
|
if (!I || I.length < 1 || I.length > 2) {
|
|
3242
|
-
a(u,
|
|
3248
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
|
|
3243
3249
|
return;
|
|
3244
3250
|
}
|
|
3245
3251
|
if (x.lazy = !0, I.length === 2) {
|
|
3246
|
-
const V =
|
|
3252
|
+
const V = Zt(e, I[1]);
|
|
3247
3253
|
if (V === void 0) {
|
|
3248
|
-
a(u,
|
|
3254
|
+
a(u, E.InvalidParamType, \`'\${g}' declares '\${$}' with a second type that is not a literal value. Use a number, string, boolean or null - the engine substitutes it for an absent argument.\`);
|
|
3249
3255
|
return;
|
|
3250
3256
|
}
|
|
3251
3257
|
x.optional = !0, x.defaultValue = V;
|
|
3252
3258
|
}
|
|
3253
|
-
|
|
3259
|
+
te(I[0], f, v, _, C, L, K, F), x.enum ? (a(u, E.EnumPosition, \`'\${g}': 'Lazy' cannot hold the enum '\${x.enum.id}'. The argument may never be evaluated, so there is no point at which it could be checked against the members.\`), delete x.enum) : x.lambda != null ? a(u, E.InvalidParamType, \`'\${g}': 'Lazy' cannot be combined with a Lambda parameter - a callable slot is already the body's to call, or not.\`) : x.repeating && a(u, E.InvalidParamType, \`'\${g}': 'Lazy' applies to a VALUE, not to a repeating group - mark the group's slots instead.\`);
|
|
3254
3260
|
return;
|
|
3255
3261
|
}
|
|
3256
|
-
if (
|
|
3257
|
-
const
|
|
3258
|
-
if (!
|
|
3259
|
-
a(u,
|
|
3262
|
+
if (ri.has($)) {
|
|
3263
|
+
const g = f.name ?? p(u);
|
|
3264
|
+
if (!_) {
|
|
3265
|
+
a(u, E.InvalidReturnType, \`'Flatten' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3260
3266
|
return;
|
|
3261
3267
|
}
|
|
3262
3268
|
const x = u.typeArguments;
|
|
3263
3269
|
if (!x || x.length !== 1) {
|
|
3264
|
-
a(u,
|
|
3270
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3265
3271
|
return;
|
|
3266
3272
|
}
|
|
3267
|
-
return C.count++,
|
|
3273
|
+
return C.count++, te(x[0], f, v, _, C, L);
|
|
3268
3274
|
}
|
|
3269
|
-
if (
|
|
3270
|
-
const
|
|
3271
|
-
if (!
|
|
3272
|
-
a(u,
|
|
3275
|
+
if (Jr.get($) === "repeating") {
|
|
3276
|
+
const g = f.name ?? p(u);
|
|
3277
|
+
if (!_) {
|
|
3278
|
+
a(u, E.RepeatingPosition, \`'Repeating' is not a valid return type: '\${g}'.\`);
|
|
3273
3279
|
return;
|
|
3274
3280
|
}
|
|
3275
3281
|
if (C.count !== 0) {
|
|
3276
|
-
a(u,
|
|
3282
|
+
a(u, E.RepeatingPosition, \`'Repeating' cannot be nested inside another type: '\${g}'.\`);
|
|
3277
3283
|
return;
|
|
3278
3284
|
}
|
|
3279
|
-
const x =
|
|
3285
|
+
const x = f, I = u.typeArguments;
|
|
3280
3286
|
if (!I || I.length < 1 || I.length > 2) {
|
|
3281
|
-
a(u,
|
|
3287
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with 1 type, optionally followed by a maximum argument count: '\${g}'.\`);
|
|
3282
3288
|
return;
|
|
3283
3289
|
}
|
|
3284
3290
|
let V;
|
|
3285
3291
|
if (I.length === 2) {
|
|
3286
|
-
const
|
|
3287
|
-
if (!Number.isInteger(B) || B < 1 || B >
|
|
3288
|
-
a(
|
|
3292
|
+
const Q = I[1], he = Q.kind === e.SyntaxKind.LiteralType ? Q.literal : null, B = he && he.kind === e.SyntaxKind.NumericLiteral ? Number(he.text) : NaN;
|
|
3293
|
+
if (!Number.isInteger(B) || B < 1 || B > Jt) {
|
|
3294
|
+
a(Q, E.RepeatingMax, \`'\${g}': '\${$}'’s maximum must be a whole number between 1 and \${Jt}.\`);
|
|
3289
3295
|
return;
|
|
3290
3296
|
}
|
|
3291
|
-
V = B,
|
|
3297
|
+
V = B, v.maxArguments = B;
|
|
3292
3298
|
}
|
|
3293
|
-
if (
|
|
3299
|
+
if (F) {
|
|
3294
3300
|
if (V === void 0) {
|
|
3295
|
-
a(u,
|
|
3301
|
+
a(u, E.RepeatingPosition, \`'\${g}' is a rest parameter and a repeating group. A group already repeats — drop the '...', or give the group a maximum ('Repeating<T, 254>') if the ceiling is all you meant.\`);
|
|
3296
3302
|
return;
|
|
3297
3303
|
}
|
|
3298
|
-
return
|
|
3304
|
+
return te(I[0], f, v, _, C, L, K);
|
|
3299
3305
|
}
|
|
3300
3306
|
const re = x.acceptError;
|
|
3301
3307
|
delete x.acceptError;
|
|
3302
|
-
const
|
|
3303
|
-
|
|
3308
|
+
const Y = we(I[0], g ?? "parameter", v, re);
|
|
3309
|
+
Y && (x.repeating = Y);
|
|
3304
3310
|
return;
|
|
3305
3311
|
}
|
|
3306
|
-
const P =
|
|
3312
|
+
const P = mt.get($);
|
|
3307
3313
|
let G = !1;
|
|
3308
|
-
P && (
|
|
3309
|
-
const X =
|
|
3310
|
-
if (X && (
|
|
3311
|
-
if (
|
|
3314
|
+
P && (f.range = P, G = !0);
|
|
3315
|
+
const X = ti.get($);
|
|
3316
|
+
if (X && (f.scalar = X), X !== void 0 && (G = !0), A(u, $, f, v, _)) return;
|
|
3317
|
+
if (_) {
|
|
3312
3318
|
if ($ === "Volatile" || $ === \`\${se}.Volatile\`) {
|
|
3313
|
-
a(u,
|
|
3319
|
+
a(u, E.InvalidParamType, \`'Volatile' is not a valid parameter type: '\${p(u)}'. It describes the function's RESULT, so it belongs on the return type.\`);
|
|
3314
3320
|
return;
|
|
3315
3321
|
}
|
|
3316
|
-
if (
|
|
3317
|
-
const
|
|
3318
|
-
if (
|
|
3319
|
-
} else
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
let I = 0;
|
|
3324
|
-
if (x.async && I++, x.stream && I++, I > 1) {
|
|
3325
|
-
a(u, _.MultipleModifiers, \`'\${$}' cannot have multiple modifiers: '\${f(u)}'.\`);
|
|
3326
|
-
return;
|
|
3327
|
-
}
|
|
3328
|
-
G = !0;
|
|
3329
|
-
}
|
|
3322
|
+
if (si.has($)) return Yt;
|
|
3323
|
+
const g = St.get($);
|
|
3324
|
+
if (g) return g;
|
|
3325
|
+
} else if ($ === "Promise") b = u, G = !0;
|
|
3326
|
+
else {
|
|
3327
|
+
const g = li.get($);
|
|
3328
|
+
g && (Object.assign(f, g()), G = !0);
|
|
3330
3329
|
}
|
|
3331
3330
|
if (!G) {
|
|
3332
|
-
const
|
|
3333
|
-
if (
|
|
3334
|
-
if (
|
|
3335
|
-
|
|
3331
|
+
const g = de(u, f.name ?? p(u));
|
|
3332
|
+
if (g === void 0) return;
|
|
3333
|
+
if (g !== null) {
|
|
3334
|
+
f.scalar = g.type, _ && (f.enum = g);
|
|
3336
3335
|
return;
|
|
3337
3336
|
}
|
|
3338
3337
|
}
|
|
3339
3338
|
if (!G) {
|
|
3340
|
-
const
|
|
3339
|
+
const g = "number, string, boolean, Scalar, Lambda, Date, FormulaError.Known, IRichData, IRange, IReferenceRange (and arrays of these; optionally wrapped in AcceptError<T>, or grouped with Repeating<T>)", x = "number, string, boolean, Scalar, Date, FormulaError.Known, IRichData, IRange, Volatile<T> (and arrays of these)";
|
|
3341
3340
|
let I;
|
|
3342
|
-
|
|
3341
|
+
_ ? L ? I = \`'\${$}' is not a valid first parameter: '\${p(u)}'. The first parameter is EITHER a macro target (making this a macro) OR a calculation input (making this a calculation function). Allowed: \${ei.join(", ")} (macro target); \${g} (calculation input).\` : I = \`'\${$}' is not a valid parameter type: '\${p(u)}'. Allowed: \${g}.\` : I = \`'\${$}' is not a valid return type: '\${p(u)}'. Allowed: \${x}.\`, a(u, _ ? E.InvalidParamType : E.InvalidReturnType, I);
|
|
3343
3342
|
return;
|
|
3344
3343
|
}
|
|
3345
|
-
const
|
|
3346
|
-
if (
|
|
3347
|
-
if (
|
|
3348
|
-
a(u,
|
|
3344
|
+
const j = u.typeArguments;
|
|
3345
|
+
if (j) {
|
|
3346
|
+
if (j.length !== 1) {
|
|
3347
|
+
a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${p(u)}'.\`);
|
|
3349
3348
|
return;
|
|
3350
3349
|
}
|
|
3351
|
-
const
|
|
3352
|
-
x &&
|
|
3353
|
-
const V =
|
|
3354
|
-
V && !x && (a(
|
|
3350
|
+
const g = j[0], x = _ && e.isTypeReferenceNode(g) && ht.has(_e(g)), I = f.reportType;
|
|
3351
|
+
x && z.add(f), S(g, f, v, _), x && I === void 0 && delete f.reportType;
|
|
3352
|
+
const V = f.enum;
|
|
3353
|
+
V && !x && (a(j[0], E.EnumPosition, \`'\${$}' cannot hold the enum '\${V.id}': '\${p(u)}'. The members of a range reach the body as they are, so nothing checks them against the enum. Take the enum as a value, or type the range by its scalar ('\${$}<\${V.type}>').\`), delete f.enum);
|
|
3355
3354
|
}
|
|
3356
|
-
} else u.kind === e.SyntaxKind.FunctionType &&
|
|
3357
|
-
},
|
|
3355
|
+
} else u.kind === e.SyntaxKind.FunctionType && U(u, f, v, _);
|
|
3356
|
+
}, qe = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Export) !== 0, Ae = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Default) !== 0;
|
|
3358
3357
|
try {
|
|
3359
3358
|
e.forEachChild(t, (u) => {
|
|
3360
|
-
if (
|
|
3361
|
-
const
|
|
3359
|
+
if (qe(u) && e.isFunctionDeclaration(u)) {
|
|
3360
|
+
const f = u?.name?.getText();
|
|
3362
3361
|
if (!u.body) {
|
|
3363
|
-
a(u,
|
|
3362
|
+
a(u, E.NoBody, \`'\${f}': function has no body.\`);
|
|
3364
3363
|
return;
|
|
3365
3364
|
}
|
|
3366
|
-
if (!
|
|
3367
|
-
a(u,
|
|
3365
|
+
if (!f) {
|
|
3366
|
+
a(u, E.Anonymous, "Anonymous exported functions are not allowed.");
|
|
3368
3367
|
return;
|
|
3369
3368
|
}
|
|
3370
|
-
const
|
|
3369
|
+
const v = {}, _ = { parameters: {} };
|
|
3371
3370
|
try {
|
|
3372
|
-
|
|
3373
|
-
const C = r.getSymbolAtLocation(u.name),
|
|
3374
|
-
|
|
3375
|
-
const
|
|
3376
|
-
b(u.type,
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3371
|
+
v.name = f;
|
|
3372
|
+
const C = r.getSymbolAtLocation(u.name), L = Le(C?.getDocumentationComment(r));
|
|
3373
|
+
L && (_.summary = L);
|
|
3374
|
+
const K = {};
|
|
3375
|
+
b = null, S(u.type, K, v, !1), v.returnType = K;
|
|
3376
|
+
const F = {};
|
|
3377
|
+
Ae(u) && (F.default = !0, c = f), v.parameters = [];
|
|
3379
3378
|
const $ = /* @__PURE__ */ new Map(), P = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Set();
|
|
3380
|
-
let X = null,
|
|
3379
|
+
let X = null, j = null, g = null, x = 0, I = !1, V = 0;
|
|
3381
3380
|
for (let B = 0; B < u.parameters.length; B++) {
|
|
3382
|
-
const
|
|
3383
|
-
N.name =
|
|
3384
|
-
const ne =
|
|
3385
|
-
if (n?.lenient && B === 0 && !
|
|
3386
|
-
|
|
3381
|
+
const M = u.parameters[B], N = {};
|
|
3382
|
+
N.name = M.name?.getText();
|
|
3383
|
+
const ne = v.parameters.length === 0;
|
|
3384
|
+
if (n?.lenient && B === 0 && !M.type && F.default) {
|
|
3385
|
+
v.context = qt;
|
|
3387
3386
|
continue;
|
|
3388
3387
|
}
|
|
3389
|
-
const
|
|
3390
|
-
if (
|
|
3391
|
-
B === 0 &&
|
|
3388
|
+
const Re = S(M.type, N, v, !0, ne, !M.dotDotDotToken, !!M.dotDotDotToken);
|
|
3389
|
+
if (Re === Yt) {
|
|
3390
|
+
B === 0 && v.context === void 0 && (v.context = qt);
|
|
3392
3391
|
continue;
|
|
3393
3392
|
}
|
|
3394
|
-
if (
|
|
3395
|
-
if (
|
|
3396
|
-
a(
|
|
3393
|
+
if (Re) {
|
|
3394
|
+
if (v.parameters.length !== 0) {
|
|
3395
|
+
a(M, E.ContextNotFirst, \`'\${v.name}' contexts must be the first parameter: '\${N.name}'.\`);
|
|
3397
3396
|
return;
|
|
3398
3397
|
}
|
|
3399
|
-
|
|
3398
|
+
v.context = Re;
|
|
3400
3399
|
continue;
|
|
3401
3400
|
}
|
|
3402
3401
|
if (N.lambda !== void 0) {
|
|
3403
3402
|
if (X !== null) {
|
|
3404
|
-
a(
|
|
3403
|
+
a(M, E.MultipleLambda, \`'\${v.name}' has more than one Lambda parameter ('\${X}' and '\${N.name}'). Only one Lambda parameter is allowed.\`);
|
|
3405
3404
|
return;
|
|
3406
3405
|
}
|
|
3407
3406
|
X = N.name;
|
|
3408
3407
|
} else if (X !== null) {
|
|
3409
|
-
a(
|
|
3408
|
+
a(M, E.LambdaNotLast, \`'\${v.name}' Lambda parameter ('\${X}') must be the last parameter, but '\${N.name}' follows it.\`);
|
|
3410
3409
|
return;
|
|
3411
3410
|
}
|
|
3412
|
-
const ye = N.optional === !0 || !((
|
|
3411
|
+
const ye = N.optional === !0 || !((M.initializer === void 0 || M.initializer === null) && (M.questionToken === void 0 || M.questionToken === null));
|
|
3413
3412
|
let ae;
|
|
3414
|
-
if (ye && (N.optional = !0,
|
|
3415
|
-
if (
|
|
3416
|
-
else if (
|
|
3417
|
-
else if (
|
|
3418
|
-
else if (
|
|
3419
|
-
else if (e.isPrefixUnaryExpression(
|
|
3420
|
-
else if (e.isPropertyAccessExpression(
|
|
3421
|
-
const ue = r.getTypeAtLocation(
|
|
3413
|
+
if (ye && (N.optional = !0, M.initializer)) try {
|
|
3414
|
+
if (M.initializer.kind === e.SyntaxKind.StringLiteral) ae = M.initializer.text;
|
|
3415
|
+
else if (M.initializer.kind === e.SyntaxKind.NumericLiteral) ae = parseFloat(M.initializer.text);
|
|
3416
|
+
else if (M.initializer.kind === e.SyntaxKind.TrueKeyword || M.initializer.kind === e.SyntaxKind.FalseKeyword) ae = M.initializer.kind === e.SyntaxKind.TrueKeyword;
|
|
3417
|
+
else if (M.initializer.kind === e.SyntaxKind.NullKeyword) ae = null;
|
|
3418
|
+
else if (e.isPrefixUnaryExpression(M.initializer) && M.initializer.operator === e.SyntaxKind.MinusToken && M.initializer.operand.kind === e.SyntaxKind.NumericLiteral) ae = -parseFloat(M.initializer.operand.text);
|
|
3419
|
+
else if (e.isPropertyAccessExpression(M.initializer) || e.isElementAccessExpression(M.initializer)) {
|
|
3420
|
+
const ue = r.getTypeAtLocation(M.initializer);
|
|
3422
3421
|
ue.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral) && (ae = ue.value);
|
|
3423
3422
|
}
|
|
3424
3423
|
} catch (ue) {
|
|
3425
3424
|
console.warn(\`Couldn't extract default value for parameter '\${N.name}'\`, ue);
|
|
3426
3425
|
}
|
|
3427
|
-
|
|
3426
|
+
M.dotDotDotToken && (N.rest = !0);
|
|
3428
3427
|
const H = N.repeating;
|
|
3429
3428
|
if (H) {
|
|
3430
3429
|
if (N.rest) {
|
|
3431
|
-
a(
|
|
3430
|
+
a(M, E.RepeatingPosition, \`'\${v.name}' parameter '\${N.name}' is both a rest parameter and a repeating group. A group already repeats — drop the '...'.\`);
|
|
3432
3431
|
return;
|
|
3433
3432
|
}
|
|
3434
3433
|
if (ye && H.length === 1) {
|
|
3435
|
-
a(
|
|
3434
|
+
a(M, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' cannot be an optional repeating group. Use '...\${N.name}: T[]' for zero-or-more, or drop the '?' for one-or-more.\`);
|
|
3436
3435
|
return;
|
|
3437
3436
|
}
|
|
3438
|
-
if (
|
|
3439
|
-
a(
|
|
3437
|
+
if (j !== null) {
|
|
3438
|
+
a(M, E.MultipleRepeating, \`'\${v.name}' has more than one repeating group ('\${j}' and '\${N.name}'). Only one is allowed — two would make the argument count ambiguous.\`);
|
|
3440
3439
|
return;
|
|
3441
3440
|
}
|
|
3442
|
-
if (
|
|
3443
|
-
a(
|
|
3441
|
+
if (g !== null) {
|
|
3442
|
+
a(M, E.RepeatingOptional, \`'\${v.name}' parameter '\${g}' is optional and precedes the repeating group '\${N.name}'. Every parameter outside a group must be required.\`);
|
|
3444
3443
|
return;
|
|
3445
3444
|
}
|
|
3446
|
-
|
|
3447
|
-
} else if (
|
|
3448
|
-
a(
|
|
3445
|
+
j = N.name, x = H.length, I = H[H.length - 1].optional === !0;
|
|
3446
|
+
} else if (j !== null && N.rest) {
|
|
3447
|
+
a(M, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' is a rest parameter and follows the repeating group '\${j}'. Two variadic tails would make the argument count ambiguous.\`);
|
|
3449
3448
|
return;
|
|
3450
|
-
} else if (
|
|
3449
|
+
} else if (j !== null && ye) {
|
|
3451
3450
|
if (V >= x - 1) {
|
|
3452
|
-
a(
|
|
3451
|
+
a(M, E.RepeatingOptional, x === 1 ? \`'\${v.name}' parameter '\${N.name}' is optional and follows the period-1 repeating group '\${j}'. One more argument is indistinguishable from one more repetition — make it required, or give the group a period.\` : \`'\${v.name}' has \${V + 1} optional parameters after the repeating group '\${j}', which has period \${x}. At most \${x - 1} may be optional, or the argument count no longer decides the parse.\`);
|
|
3453
3452
|
return;
|
|
3454
3453
|
}
|
|
3455
3454
|
if (I) {
|
|
3456
|
-
a(
|
|
3455
|
+
a(M, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' is optional and follows '\${j}', whose own last slot is already optional. Both omissions reach the same argument count — drop one.\`);
|
|
3457
3456
|
return;
|
|
3458
3457
|
}
|
|
3459
3458
|
V++;
|
|
3460
3459
|
}
|
|
3461
|
-
ye && !H && (
|
|
3462
|
-
const W = (N.range ? 2 : 0) + (N.arrayDepth ?? 0),
|
|
3463
|
-
if (W >
|
|
3464
|
-
a(
|
|
3460
|
+
ye && !H && (g = N.name);
|
|
3461
|
+
const W = (N.range ? 2 : 0) + (N.arrayDepth ?? 0), Pe = N.range === "r" || N.range === "p" || N.range === "*", Z = N.rest || Pe ? 3 : 2;
|
|
3462
|
+
if (W > Z) {
|
|
3463
|
+
a(M, E.ArrayDepth, \`'\${v.name}' parameter '\${N.name}' has an array depth of \${W}; the maximum is \${Z}\${N.rest ? " for a rest parameter" : " (use a rest parameter for one more level, or an IRange)"}.\`);
|
|
3465
3464
|
return;
|
|
3466
3465
|
}
|
|
3467
|
-
|
|
3466
|
+
v.parameters.push(N);
|
|
3468
3467
|
const ce = { description: "" };
|
|
3469
|
-
|
|
3470
|
-
const
|
|
3471
|
-
ce.description =
|
|
3468
|
+
_.parameters[N.name] = ce;
|
|
3469
|
+
const Ze = r.getSymbolAtLocation(M.name);
|
|
3470
|
+
ce.description = Le(Ze?.getDocumentationComment(r)), ae !== void 0 && (N.defaultValue = ae);
|
|
3472
3471
|
for (const ue of [N, ...N.repeating ?? []]) {
|
|
3473
|
-
const
|
|
3474
|
-
|
|
3472
|
+
const Se = ue.enum ? w.get(ue.enum) : void 0;
|
|
3473
|
+
Se && ((_.enums ??= {})[ue.enum.id] = Se);
|
|
3475
3474
|
}
|
|
3476
|
-
if ($.set(N.name, N), P.set(N.name,
|
|
3475
|
+
if ($.set(N.name, N), P.set(N.name, M), H && H.length > 1) {
|
|
3477
3476
|
G.add(N.name);
|
|
3478
3477
|
for (const ue of H) {
|
|
3479
|
-
const
|
|
3480
|
-
|
|
3478
|
+
const Se = \`\${N.name}.\${ue.name}\`;
|
|
3479
|
+
_.parameters[Se] = { description: "" }, $.set(Se, ue), P.set(Se, M);
|
|
3481
3480
|
}
|
|
3482
3481
|
}
|
|
3483
3482
|
}
|
|
3484
|
-
const re =
|
|
3483
|
+
const re = v.maxArguments;
|
|
3485
3484
|
if (re !== void 0) {
|
|
3486
|
-
const B =
|
|
3485
|
+
const B = v.parameters ?? [];
|
|
3487
3486
|
if (!B.some((N) => N.rest === !0 || N.repeating !== void 0)) {
|
|
3488
|
-
a(u,
|
|
3487
|
+
a(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but takes a fixed \${B.length}. A maximum only means something on a variadic tail.\`);
|
|
3489
3488
|
return;
|
|
3490
3489
|
}
|
|
3491
|
-
let
|
|
3492
|
-
for (const N of B) N.rest === !0 || N.optional === !0 || (
|
|
3493
|
-
if (re <
|
|
3494
|
-
a(u,
|
|
3490
|
+
let M = 0;
|
|
3491
|
+
for (const N of B) N.rest === !0 || N.optional === !0 || (M += N.repeating ? N.repeating.length : 1);
|
|
3492
|
+
if (re < M) {
|
|
3493
|
+
a(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but requires \${M}.\`);
|
|
3495
3494
|
return;
|
|
3496
3495
|
}
|
|
3497
3496
|
}
|
|
3498
3497
|
if (u.jsDoc && u.jsDoc.length > 0) {
|
|
3499
|
-
const B = u.jsDoc,
|
|
3500
|
-
for (let N = 0; N <
|
|
3498
|
+
const B = u.jsDoc, M = B.length;
|
|
3499
|
+
for (let N = 0; N < M; N++) {
|
|
3501
3500
|
const ne = B[N]?.tags;
|
|
3502
3501
|
if (!ne) continue;
|
|
3503
|
-
const
|
|
3504
|
-
for (let ye = 0; ye <
|
|
3502
|
+
const Re = ne.length;
|
|
3503
|
+
for (let ye = 0; ye < Re; ye++) {
|
|
3505
3504
|
const ae = ne[ye];
|
|
3506
3505
|
let H = ae?.tagName?.text;
|
|
3507
3506
|
if (!H) continue;
|
|
3508
3507
|
H = H.toLowerCase();
|
|
3509
3508
|
let W = ae.comment;
|
|
3510
|
-
const
|
|
3511
|
-
if (typeof W != "string" && !
|
|
3512
|
-
H === "returnkind" && a(ae,
|
|
3509
|
+
const Pe = Qo(H);
|
|
3510
|
+
if (typeof W != "string" && !Pe) {
|
|
3511
|
+
H === "returnkind" && a(ae, E.UnknownReturnKind, \`'@returnKind' needs a value kind. Known: \${[...at].map((Z) => \`'\${Z}'\`).join(", ")}.\`);
|
|
3513
3512
|
continue;
|
|
3514
3513
|
}
|
|
3515
3514
|
if (typeof W == "string" && (W = W.replace(/\\r\\n?/g, \`
|
|
3516
|
-
\`).trim()), !(!
|
|
3515
|
+
\`).trim()), !(!Pe && W && (W = W.split(\`
|
|
3517
3516
|
\`)[0].trim(), !W || W.length === 0))) {
|
|
3518
3517
|
if (W && typeof W == "string") {
|
|
3519
|
-
const
|
|
3520
|
-
let ce,
|
|
3521
|
-
for (; (ce =
|
|
3522
|
-
const [
|
|
3523
|
-
|
|
3518
|
+
const Z = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
|
|
3519
|
+
let ce, Ze = W, ue = [];
|
|
3520
|
+
for (; (ce = Z.exec(W)) !== null;) {
|
|
3521
|
+
const [Se, Ci, on, vt] = ce, an = [on.trim()];
|
|
3522
|
+
vt && an.push(vt.trim());
|
|
3524
3523
|
}
|
|
3525
|
-
W =
|
|
3524
|
+
W = Ze, ue.length > 0 && H === "see" && (_.links || (_.links = []), _.links.push(...ue));
|
|
3526
3525
|
}
|
|
3527
3526
|
if (H === "name") {
|
|
3528
|
-
const
|
|
3529
|
-
|
|
3527
|
+
const Z = W;
|
|
3528
|
+
Z !== f && (_.name = Z);
|
|
3530
3529
|
} else if (H !== "description") {
|
|
3531
3530
|
if (H === "param") {
|
|
3532
|
-
const
|
|
3533
|
-
if (!$.get(
|
|
3534
|
-
a(ae,
|
|
3531
|
+
const Z = ae.name?.getText?.() ?? ae.name?.text;
|
|
3532
|
+
if (!$.get(Z)) {
|
|
3533
|
+
a(ae, E.UnknownParam, \`Parameter '\${Z}' not found in function '\${f}'.\`);
|
|
3535
3534
|
continue;
|
|
3536
3535
|
}
|
|
3537
|
-
const ce =
|
|
3536
|
+
const ce = _.parameters?.[Z];
|
|
3538
3537
|
ce && !ce.description && typeof W == "string" && W && (ce.description = W);
|
|
3539
|
-
} else if (H === "returns" || H === "return")
|
|
3538
|
+
} else if (H === "returns" || H === "return") v.returnType.description = W;
|
|
3540
3539
|
else if (H === "returnkind") {
|
|
3541
|
-
const
|
|
3542
|
-
|
|
3543
|
-
} else if (H === "category")
|
|
3540
|
+
const Z = (W ?? "").trim().toLowerCase();
|
|
3541
|
+
at.has(Z) ? v.returnType.kind = Z : a(ae, E.UnknownReturnKind, \`'@returnKind \${Z}' is not a known value kind. Known: \${[...at].map((ce) => \`'\${ce}'\`).join(", ")}.\`);
|
|
3542
|
+
} else if (H === "category") _.category = W;
|
|
3544
3543
|
else if (H === "deprecated" || H === "hidden") {
|
|
3545
|
-
let
|
|
3544
|
+
let Z = !0;
|
|
3546
3545
|
const ce = W?.toLowerCase();
|
|
3547
|
-
ce === "false" ?
|
|
3546
|
+
ce === "false" ? Z = !1 : ce !== "true" && (Z = W), Z !== !1 && (_.deprecated = Z ?? !0, v.hidden = !0);
|
|
3548
3547
|
}
|
|
3549
3548
|
}
|
|
3550
3549
|
}
|
|
3551
3550
|
}
|
|
3552
3551
|
}
|
|
3553
3552
|
}
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3553
|
+
if (!v.context && b) {
|
|
3554
|
+
a(b, E.InvalidReturnType, \`'\${f}': Promise<T> is not a valid return type for a calculation function. Return the value the cell shows now, and call FormulaContext.defer(executor, payload) to deliver the result later.\`);
|
|
3555
|
+
return;
|
|
3556
|
+
}
|
|
3557
|
+
Object.keys(v.returnType).length === 0 && delete v.returnType, Object.keys(F).length > 0 && (v.behavior = F), _.summary || m(u.name ?? u, E.MissingSummary, "warning", \`'\${f}': missing a description. Add a JSDoc comment above the function.\`);
|
|
3558
|
+
const Y = !v.context, Q = Y && _.name || f;
|
|
3559
|
+
if (Y && !ni.test(Q)) {
|
|
3560
|
+
const B = _.name ? \`'@name \${_.name}'\` : \`'\${Q}'\`;
|
|
3561
|
+
a(u.name ?? u, E.InvalidName, \`'\${f}': \${B} cannot be called from a formula. A function name starts with a letter or '_', and continues with letters, digits, '_' or '.'.\` + (_.name ? "" : " Add an '@name' tag to register it under another name."));
|
|
3559
3562
|
return;
|
|
3560
3563
|
}
|
|
3561
|
-
if (
|
|
3562
|
-
const B =
|
|
3563
|
-
a(u.name ?? u,
|
|
3564
|
+
if (Y && !n?.isBuiltIn && ai(Q)) {
|
|
3565
|
+
const B = _.name ? \`'@name \${_.name}'\` : \`'\${Q}'\`;
|
|
3566
|
+
a(u.name ?? u, E.InvalidName, \`'\${f}': \${B} cannot be called from a formula. It reads as a cell address.\` + (_.name ? "" : " Add an '@name' tag to register it under another name."));
|
|
3564
3567
|
return;
|
|
3565
3568
|
}
|
|
3566
|
-
const he = l.get(
|
|
3569
|
+
const he = l.get(Q.toUpperCase());
|
|
3567
3570
|
if (he !== void 0) {
|
|
3568
|
-
a(u.name ?? u,
|
|
3571
|
+
a(u.name ?? u, E.DuplicateName, \`'\${f}': '\${Q}' is already the name of '\${he}' in this module.\`);
|
|
3569
3572
|
return;
|
|
3570
3573
|
}
|
|
3571
|
-
if (l.set(
|
|
3572
|
-
a(u.name ?? u,
|
|
3574
|
+
if (l.set(Q.toUpperCase(), f), Y && o?.has(Q.toUpperCase())) {
|
|
3575
|
+
a(u.name ?? u, E.BuiltInName, \`'\${Q}' is a built-in function. Choose a different name - a calculation function cannot replace a built-in.\`);
|
|
3573
3576
|
return;
|
|
3574
3577
|
}
|
|
3575
|
-
if (
|
|
3576
|
-
const B =
|
|
3577
|
-
for (const [
|
|
3578
|
-
const ne = P.get(
|
|
3579
|
-
m(ne,
|
|
3578
|
+
if (Y) {
|
|
3579
|
+
const B = _.parameters ?? {};
|
|
3580
|
+
for (const [M, N] of Object.entries(B)) if (!G.has(M) && !N.description) {
|
|
3581
|
+
const ne = P.get(M);
|
|
3582
|
+
m(ne, E.MissingParamDescription, "warning", \`'\${f}': parameter '\${M}' is missing a description. Add an '@param \${M}' tag.\`);
|
|
3580
3583
|
}
|
|
3581
3584
|
}
|
|
3582
|
-
|
|
3585
|
+
i.push([v, _]);
|
|
3583
3586
|
} catch (C) {
|
|
3584
|
-
a(u,
|
|
3587
|
+
a(u, E.ParseError, \`'\${f}': \${C.message}\`);
|
|
3585
3588
|
}
|
|
3586
3589
|
}
|
|
3587
3590
|
});
|
|
3588
3591
|
} catch (u) {
|
|
3589
|
-
a(void 0,
|
|
3592
|
+
a(void 0, E.ParseError, \`Unable to analyze module: \${u?.message ?? u}\`);
|
|
3590
3593
|
}
|
|
3591
3594
|
return {
|
|
3592
|
-
functions:
|
|
3595
|
+
functions: i,
|
|
3593
3596
|
autoRun: c,
|
|
3594
3597
|
diagnostics: s
|
|
3595
3598
|
};
|
|
3596
3599
|
}
|
|
3597
|
-
const
|
|
3598
|
-
var
|
|
3599
|
-
async function
|
|
3600
|
-
return
|
|
3600
|
+
const Je = "__SHEETXL";
|
|
3601
|
+
var ui = /* @__PURE__ */ nr({ initialize: () => di });
|
|
3602
|
+
async function di() {
|
|
3603
|
+
return Te || (Te = new Promise(async (e, t) => {
|
|
3601
3604
|
try {
|
|
3602
|
-
const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`,
|
|
3605
|
+
const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, o = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`, i = (await import(
|
|
3603
3606
|
/* webpackIgnore: true */
|
|
3604
3607
|
/* @vite-ignore */
|
|
3605
3608
|
n
|
|
3606
3609
|
)).default;
|
|
3607
|
-
await
|
|
3608
|
-
wasmURL:
|
|
3610
|
+
await i.initialize({
|
|
3611
|
+
wasmURL: o,
|
|
3609
3612
|
worker: !1
|
|
3610
|
-
}), e(
|
|
3613
|
+
}), e(i);
|
|
3611
3614
|
} catch (r) {
|
|
3612
|
-
console.error("Error initializing esbuild:", r),
|
|
3615
|
+
console.error("Error initializing esbuild:", r), Te = null, t(new Error("The script bundler could not be loaded. Check your connection and try again.", { cause: r }));
|
|
3613
3616
|
}
|
|
3614
|
-
}),
|
|
3617
|
+
}), Te);
|
|
3615
3618
|
}
|
|
3616
|
-
var
|
|
3617
|
-
|
|
3619
|
+
var Te, fi = rr((() => {
|
|
3620
|
+
Te = null;
|
|
3618
3621
|
}));
|
|
3619
|
-
let
|
|
3620
|
-
async function
|
|
3621
|
-
if (
|
|
3622
|
-
if (
|
|
3623
|
-
if (await
|
|
3624
|
-
return
|
|
3622
|
+
let xe = null, Ve = null;
|
|
3623
|
+
async function pi() {
|
|
3624
|
+
if (xe) return xe;
|
|
3625
|
+
if (Ve) {
|
|
3626
|
+
if (await Ve, !xe) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
3627
|
+
return xe;
|
|
3625
3628
|
}
|
|
3626
3629
|
let e, t;
|
|
3627
|
-
|
|
3630
|
+
Ve = new Promise((r, n) => {
|
|
3628
3631
|
e = r, t = n;
|
|
3629
3632
|
});
|
|
3630
3633
|
try {
|
|
3631
|
-
const { initialize: r } = await Promise.resolve().then(() => (
|
|
3632
|
-
return
|
|
3634
|
+
const { initialize: r } = await Promise.resolve().then(() => (fi(), ui));
|
|
3635
|
+
return xe = await r(), e(), xe;
|
|
3633
3636
|
} catch (r) {
|
|
3634
|
-
throw console.error("Failed to import or initialize esbuild:", r),
|
|
3637
|
+
throw console.error("Failed to import or initialize esbuild:", r), Ve = null, t(r), r;
|
|
3635
3638
|
}
|
|
3636
3639
|
}
|
|
3637
|
-
const
|
|
3638
|
-
async function
|
|
3640
|
+
const mi = { compilerOptions: { target: "esnext" } };
|
|
3641
|
+
async function hi(e, t, r = "/script.js", n = Je, o = !1) {
|
|
3639
3642
|
try {
|
|
3640
|
-
const
|
|
3643
|
+
const i = await pi(), l = "@sheetxl/primitives", s = \`
|
|
3641
3644
|
export const FormulaContext = globalThis.\${n}?.FormulaContext;
|
|
3642
3645
|
export const ScalarType = globalThis.\${n}?.ScalarType;
|
|
3643
3646
|
export const Observable = globalThis.\${n}?.Observable;
|
|
3644
3647
|
export const IRange = globalThis.\${n}?.IRange;
|
|
3645
3648
|
export const FormulaError = globalThis.\${n}?.FormulaError;
|
|
3646
3649
|
// Add more exports as needed
|
|
3647
|
-
\`, c = await
|
|
3650
|
+
\`, c = await i.build({
|
|
3648
3651
|
entryPoints: [r],
|
|
3649
3652
|
bundle: !0,
|
|
3650
3653
|
write: !1,
|
|
@@ -3665,53 +3668,53 @@ async function po(e, t, r = "/script.js", n = Ge, i = !1) {
|
|
|
3665
3668
|
filter: /.*/,
|
|
3666
3669
|
namespace: m
|
|
3667
3670
|
}, (a) => {
|
|
3668
|
-
let
|
|
3669
|
-
if (a.path === r)
|
|
3670
|
-
else if (a.path === l)
|
|
3671
|
+
let p;
|
|
3672
|
+
if (a.path === r) p = t;
|
|
3673
|
+
else if (a.path === l) p = s;
|
|
3671
3674
|
else return { errors: [{ text: \`Cannot load unknown path in \${m}: \${a.path}\` }] };
|
|
3672
3675
|
return {
|
|
3673
|
-
contents:
|
|
3676
|
+
contents: p,
|
|
3674
3677
|
loader: "ts"
|
|
3675
3678
|
};
|
|
3676
3679
|
});
|
|
3677
3680
|
}
|
|
3678
3681
|
}],
|
|
3679
3682
|
sourcemap: "inline",
|
|
3680
|
-
tsconfigRaw:
|
|
3681
|
-
minify:
|
|
3683
|
+
tsconfigRaw: mi,
|
|
3684
|
+
minify: o,
|
|
3682
3685
|
platform: "neutral"
|
|
3683
3686
|
});
|
|
3684
3687
|
if (c.outputFiles && c.outputFiles.length > 0) return c.outputFiles[0].text;
|
|
3685
3688
|
throw c.errors && c.errors.length > 0 ? /* @__PURE__ */ new Error(\`esbuild bundling failed: \${c.errors.map((d) => d.text).join(\`
|
|
3686
3689
|
\`)}\`) : /* @__PURE__ */ new Error("esbuild did not produce an output file.");
|
|
3687
|
-
} catch (
|
|
3688
|
-
throw console.error("esbuild bundling process failed:",
|
|
3690
|
+
} catch (i) {
|
|
3691
|
+
throw console.error("esbuild bundling process failed:", i), i;
|
|
3689
3692
|
}
|
|
3690
3693
|
}
|
|
3691
|
-
function
|
|
3694
|
+
function gi(e, t, r) {
|
|
3692
3695
|
return (n) => {
|
|
3693
|
-
const
|
|
3694
|
-
const
|
|
3696
|
+
const o = n.factory, i = () => o.createExpressionStatement(o.createCallChain(o.createPropertyAccessExpression(o.createIdentifier(Je), "checkRun"), o.createToken(e.SyntaxKind.QuestionDotToken), void 0, [o.createStringLiteral(t), o.createNumericLiteral(r)])), l = (a) => {
|
|
3697
|
+
const p = a.statements;
|
|
3695
3698
|
let b = 0;
|
|
3696
|
-
for (; b <
|
|
3697
|
-
return
|
|
3698
|
-
...
|
|
3699
|
-
|
|
3700
|
-
...
|
|
3699
|
+
for (; b < p.length && e.isExpressionStatement(p[b]) && e.isStringLiteral(p[b].expression);) b++;
|
|
3700
|
+
return o.updateBlock(a, [
|
|
3701
|
+
...p.slice(0, b),
|
|
3702
|
+
i(),
|
|
3703
|
+
...p.slice(b)
|
|
3701
3704
|
]);
|
|
3702
|
-
}, s = (a) => e.isBlock(a) ? l(a) :
|
|
3705
|
+
}, s = (a) => e.isBlock(a) ? l(a) : o.createBlock([i(), a], !0), c = (a) => e.isBlock(a) ? l(a) : o.createBlock([i(), o.createReturnStatement(a)], !0), d = (a) => e.isForStatement(a) || e.isForInStatement(a) || e.isForOfStatement(a) || e.isWhileStatement(a) || e.isDoStatement(a), m = (a) => {
|
|
3703
3706
|
if (d(a)) {
|
|
3704
|
-
const
|
|
3707
|
+
const p = a.statement;
|
|
3705
3708
|
return e.visitEachChild(a, (b) => {
|
|
3706
|
-
const
|
|
3707
|
-
return b ===
|
|
3709
|
+
const S = m(b);
|
|
3710
|
+
return b === p ? s(S) : S;
|
|
3708
3711
|
}, n);
|
|
3709
3712
|
}
|
|
3710
3713
|
if (e.isFunctionLike(a) && a.body) {
|
|
3711
|
-
const
|
|
3714
|
+
const p = a.body;
|
|
3712
3715
|
return e.visitEachChild(a, (b) => {
|
|
3713
|
-
const
|
|
3714
|
-
return b ===
|
|
3716
|
+
const S = m(b);
|
|
3717
|
+
return b === p ? c(S) : S;
|
|
3715
3718
|
}, n);
|
|
3716
3719
|
}
|
|
3717
3720
|
return e.visitEachChild(a, m, n);
|
|
@@ -3719,13 +3722,13 @@ function mo(e, t, r) {
|
|
|
3719
3722
|
return (a) => e.visitNode(a, m);
|
|
3720
3723
|
};
|
|
3721
3724
|
}
|
|
3722
|
-
const
|
|
3723
|
-
var
|
|
3724
|
-
initialize: () =>
|
|
3725
|
-
readLibFile: () =>
|
|
3725
|
+
const Qt = "//# sourceMappingURL";
|
|
3726
|
+
var tn = /* @__PURE__ */ nr({
|
|
3727
|
+
initialize: () => yi,
|
|
3728
|
+
readLibFile: () => wi
|
|
3726
3729
|
});
|
|
3727
|
-
async function
|
|
3728
|
-
return
|
|
3730
|
+
async function yi() {
|
|
3731
|
+
return Ce || (Ce = new Promise(async (e, t) => {
|
|
3729
3732
|
let r = null;
|
|
3730
3733
|
try {
|
|
3731
3734
|
r = await import(
|
|
@@ -3736,14 +3739,14 @@ async function ho() {
|
|
|
3736
3739
|
} catch (n) {
|
|
3737
3740
|
console.error("Error initializing Browser TypeScript module:", n);
|
|
3738
3741
|
}
|
|
3739
|
-
r || (console.log("use script fallback"),
|
|
3740
|
-
}),
|
|
3742
|
+
r || (console.log("use script fallback"), Ce = null), e(r);
|
|
3743
|
+
}), Ce);
|
|
3741
3744
|
}
|
|
3742
|
-
function
|
|
3743
|
-
var
|
|
3744
|
-
|
|
3745
|
+
function wi(e, t) {}
|
|
3746
|
+
var Ce, rn = rr((() => {
|
|
3747
|
+
Ce = null;
|
|
3745
3748
|
}));
|
|
3746
|
-
const
|
|
3749
|
+
const Si = \`
|
|
3747
3750
|
/**
|
|
3748
3751
|
* Represents the completion of an asynchronous operation
|
|
3749
3752
|
*/
|
|
@@ -3756,48 +3759,48 @@ interface Promise<T> {
|
|
|
3756
3759
|
*/
|
|
3757
3760
|
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
3758
3761
|
}
|
|
3759
|
-
\`,
|
|
3762
|
+
\`, bi = \`
|
|
3760
3763
|
interface FirstTest {
|
|
3761
3764
|
isTrue?: boolean;
|
|
3762
3765
|
}
|
|
3763
|
-
\`,
|
|
3764
|
-
let
|
|
3765
|
-
const
|
|
3766
|
-
\`,
|
|
3766
|
+
\`, vi = async () => bi;
|
|
3767
|
+
let Xe = null;
|
|
3768
|
+
const lt = "sheetxl.d.ts", er = "sheetxl-modules.d.ts", Ei = \`declare module '@sheetxl/primitives' { export = SheetXL; }
|
|
3769
|
+
\`, _i = [
|
|
3767
3770
|
"lib.webworker.d.ts",
|
|
3768
3771
|
"lib.es2020.d.ts",
|
|
3769
3772
|
"lib.esnext.asynciterable.d.ts"
|
|
3770
|
-
],
|
|
3771
|
-
let
|
|
3772
|
-
async function
|
|
3773
|
-
return
|
|
3774
|
-
const t = await
|
|
3773
|
+
], tr = /* @__PURE__ */ new Map();
|
|
3774
|
+
let st = null, ct = null;
|
|
3775
|
+
async function xi() {
|
|
3776
|
+
return ct || (ct = Promise.resolve().then(() => (rn(), tn)).then(async (e) => {
|
|
3777
|
+
const t = await nn();
|
|
3775
3778
|
return e.readLibFile(t, "lib.es5.d.ts") !== void 0 ? e.readLibFile : null;
|
|
3776
|
-
})),
|
|
3779
|
+
})), ct;
|
|
3777
3780
|
}
|
|
3778
|
-
async function
|
|
3779
|
-
if (
|
|
3781
|
+
async function nn() {
|
|
3782
|
+
if (Xe) return Xe;
|
|
3780
3783
|
try {
|
|
3781
|
-
const e = await (await Promise.resolve().then(() => (
|
|
3784
|
+
const e = await (await Promise.resolve().then(() => (rn(), tn))).initialize();
|
|
3782
3785
|
if (!e) throw new Error("TypeScript could not be loaded. Check your connection and try again.");
|
|
3783
3786
|
return e;
|
|
3784
3787
|
} catch (e) {
|
|
3785
|
-
throw
|
|
3788
|
+
throw Xe = null, e;
|
|
3786
3789
|
} finally {
|
|
3787
|
-
|
|
3790
|
+
Xe = null;
|
|
3788
3791
|
}
|
|
3789
3792
|
}
|
|
3790
|
-
async function
|
|
3793
|
+
async function Ti(e) {
|
|
3791
3794
|
const t = e?.source ?? null;
|
|
3792
3795
|
if (!t) return {
|
|
3793
3796
|
module: null,
|
|
3794
3797
|
diagnostics: []
|
|
3795
3798
|
};
|
|
3796
|
-
const r = (e.disableBundle || e.declarationsOnly) ?? !1, [n,
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
e.ambientTypes ?
|
|
3800
|
-
]), l =
|
|
3799
|
+
const r = (e.disableBundle || e.declarationsOnly) ?? !1, [n, o, i] = await Promise.all([
|
|
3800
|
+
vi(),
|
|
3801
|
+
nn(),
|
|
3802
|
+
e.ambientTypes ? xi() : null
|
|
3803
|
+
]), l = i ? e.ambientTypes ?? null : null;
|
|
3801
3804
|
let s = "";
|
|
3802
3805
|
const c = {
|
|
3803
3806
|
allowJs: !0,
|
|
@@ -3810,100 +3813,100 @@ async function _o(e) {
|
|
|
3810
3813
|
module: 99,
|
|
3811
3814
|
noResolve: !0,
|
|
3812
3815
|
emitDeclarationOnly: !1,
|
|
3813
|
-
target:
|
|
3816
|
+
target: o.ScriptTarget.ES2020,
|
|
3814
3817
|
...l ? {
|
|
3815
|
-
lib:
|
|
3818
|
+
lib: _i,
|
|
3816
3819
|
skipLibCheck: !0,
|
|
3817
3820
|
strict: !0
|
|
3818
3821
|
} : {}
|
|
3819
|
-
}, d = "script", m = \`\${d}.ts\`, a = "lib.d.ts",
|
|
3822
|
+
}, d = "script", m = \`\${d}.ts\`, a = "lib.d.ts", p = "global.d.ts", b = {
|
|
3820
3823
|
[m]: t,
|
|
3821
|
-
[a]:
|
|
3822
|
-
[
|
|
3824
|
+
[a]: Si,
|
|
3825
|
+
[p]: n,
|
|
3823
3826
|
...l ? {
|
|
3824
|
-
[
|
|
3825
|
-
[
|
|
3827
|
+
[lt]: l,
|
|
3828
|
+
[er]: Ei
|
|
3826
3829
|
} : {}
|
|
3827
|
-
},
|
|
3828
|
-
getSourceFile: (
|
|
3829
|
-
if (
|
|
3830
|
+
}, S = (f) => b[f] ?? (i && f.startsWith("lib.") ? i(o, f) : void 0), A = {
|
|
3831
|
+
getSourceFile: (f, v, _, C) => {
|
|
3832
|
+
if (f === lt) return st?.text !== l && (st = {
|
|
3830
3833
|
text: l,
|
|
3831
|
-
file:
|
|
3832
|
-
}),
|
|
3833
|
-
if (b[
|
|
3834
|
-
let
|
|
3835
|
-
if (!
|
|
3836
|
-
const
|
|
3837
|
-
if (
|
|
3838
|
-
|
|
3834
|
+
file: o.createSourceFile(f, l, o.ScriptTarget.Latest, !1)
|
|
3835
|
+
}), st.file;
|
|
3836
|
+
if (b[f] === void 0) {
|
|
3837
|
+
let L = tr.get(f);
|
|
3838
|
+
if (!L) {
|
|
3839
|
+
const K = S(f);
|
|
3840
|
+
if (K === void 0) return;
|
|
3841
|
+
L = o.createSourceFile(f, K, o.ScriptTarget.Latest, !1), tr.set(f, L);
|
|
3839
3842
|
}
|
|
3840
|
-
return
|
|
3843
|
+
return L;
|
|
3841
3844
|
}
|
|
3842
|
-
return
|
|
3845
|
+
return o.createSourceFile(f, b[f], o.ScriptTarget.Latest, !0);
|
|
3843
3846
|
},
|
|
3844
|
-
fileExists: (
|
|
3845
|
-
readFile:
|
|
3846
|
-
writeFile: (
|
|
3847
|
-
b[
|
|
3847
|
+
fileExists: (f) => S(f) !== void 0,
|
|
3848
|
+
readFile: S,
|
|
3849
|
+
writeFile: (f, v) => {
|
|
3850
|
+
b[f] = v;
|
|
3848
3851
|
},
|
|
3849
3852
|
getCurrentDirectory: () => "./",
|
|
3850
|
-
getCanonicalFileName: (
|
|
3853
|
+
getCanonicalFileName: (f) => f,
|
|
3851
3854
|
useCaseSensitiveFileNames: () => !0,
|
|
3852
|
-
getDefaultLibFileName: (
|
|
3855
|
+
getDefaultLibFileName: (f) => a,
|
|
3853
3856
|
getNewLine: () => \`
|
|
3854
3857
|
\`
|
|
3855
|
-
}, U =
|
|
3858
|
+
}, U = o.createProgram([
|
|
3856
3859
|
m,
|
|
3857
|
-
|
|
3858
|
-
...l ? [
|
|
3859
|
-
], c, A), h = U.getTypeChecker(),
|
|
3860
|
-
U.emit(void 0, void 0, void 0, void 0,
|
|
3861
|
-
const
|
|
3862
|
-
start:
|
|
3863
|
-
length:
|
|
3864
|
-
severity:
|
|
3865
|
-
code: \`TS\${
|
|
3866
|
-
message:
|
|
3860
|
+
p,
|
|
3861
|
+
...l ? [lt, er] : []
|
|
3862
|
+
], c, A), h = U.getTypeChecker(), y = U.getSourceFile(m), w = e.runGuard;
|
|
3863
|
+
U.emit(void 0, void 0, void 0, void 0, w ? { before: [gi(o, w.key, w.timeoutMs)] } : void 0), s = b[\`\${d}.js\`] ?? "";
|
|
3864
|
+
const D = (f) => ({
|
|
3865
|
+
start: f.start ?? 0,
|
|
3866
|
+
length: f.length ?? 0,
|
|
3867
|
+
severity: f.category === o.DiagnosticCategory.Warning ? "warning" : "error",
|
|
3868
|
+
code: \`TS\${f.code}\`,
|
|
3869
|
+
message: o.flattenDiagnosticMessageText(f.messageText, \`
|
|
3867
3870
|
\`)
|
|
3868
|
-
}), z = U.getSyntacticDiagnostics(
|
|
3871
|
+
}), z = U.getSyntacticDiagnostics(y).map(D), k = l ? U.getSemanticDiagnostics(y).filter((f) => f.category === o.DiagnosticCategory.Error || f.category === o.DiagnosticCategory.Warning).map(D) : [], R = ci(o, y, h, {
|
|
3869
3872
|
builtInNames: e.builtInNames,
|
|
3870
3873
|
isBuiltIn: e.isBuiltIn,
|
|
3871
3874
|
lenient: e.lenient
|
|
3872
3875
|
});
|
|
3873
|
-
let
|
|
3876
|
+
let O = [
|
|
3874
3877
|
...z,
|
|
3875
|
-
...
|
|
3878
|
+
...k,
|
|
3876
3879
|
...R.diagnostics
|
|
3877
3880
|
];
|
|
3878
|
-
e.lenient && (
|
|
3879
|
-
const
|
|
3880
|
-
let
|
|
3881
|
-
if (
|
|
3881
|
+
e.lenient && (O = O.filter((f) => f.code !== E.MissingType));
|
|
3882
|
+
const de = R.functions, we = R.autoRun, te = O.some((f) => f.severity === "error"), qe = \`\${or.uuidV4()}-script\`;
|
|
3883
|
+
let Ae = null;
|
|
3884
|
+
if (te) s = "";
|
|
3882
3885
|
else {
|
|
3883
3886
|
try {
|
|
3884
|
-
r || (s = await
|
|
3887
|
+
r || (s = await hi(o, s, d, void 0, e.minify ?? !1));
|
|
3885
3888
|
} catch {
|
|
3886
3889
|
console.warn("Error bundling script");
|
|
3887
3890
|
}
|
|
3888
|
-
const
|
|
3889
|
-
|
|
3891
|
+
const f = s.indexOf(Qt);
|
|
3892
|
+
f > -1 && (Ae = s.substring(f + 20 + 1, s.length), s = s.substring(0, f), s = s.replaceAll("globalThis." + Je, Je));
|
|
3890
3893
|
}
|
|
3891
|
-
const
|
|
3892
|
-
functions:
|
|
3893
|
-
commitId:
|
|
3894
|
+
const u = {
|
|
3895
|
+
functions: de,
|
|
3896
|
+
commitId: qe,
|
|
3894
3897
|
source: t,
|
|
3895
3898
|
language: "typescript",
|
|
3896
3899
|
compiled: s
|
|
3897
3900
|
};
|
|
3898
|
-
return
|
|
3899
|
-
module:
|
|
3900
|
-
diagnostics:
|
|
3901
|
+
return Ae && (u.sourceMap = Ae), we && (u.autoRun = we), {
|
|
3902
|
+
module: u,
|
|
3903
|
+
diagnostics: O
|
|
3901
3904
|
};
|
|
3902
3905
|
}
|
|
3903
3906
|
self.addEventListener("message", async (e) => {
|
|
3904
3907
|
const { id: t, params: r } = e.data;
|
|
3905
3908
|
try {
|
|
3906
|
-
const n = await
|
|
3909
|
+
const n = await Ti(r);
|
|
3907
3910
|
self.postMessage({
|
|
3908
3911
|
id: t,
|
|
3909
3912
|
result: n,
|
|
@@ -3921,11 +3924,11 @@ self.addEventListener("message", async (e) => {
|
|
|
3921
3924
|
});
|
|
3922
3925
|
}
|
|
3923
3926
|
});
|
|
3924
|
-
`,
|
|
3927
|
+
`, i = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", s], { type: "text/javascript;charset=utf-8" });
|
|
3925
3928
|
function d(t) {
|
|
3926
3929
|
let n;
|
|
3927
3930
|
try {
|
|
3928
|
-
if (n =
|
|
3931
|
+
if (n = i && (self.URL || self.webkitURL).createObjectURL(i), !n) throw "";
|
|
3929
3932
|
const e = new Worker(n, { type: "module", name: t?.name });
|
|
3930
3933
|
return e.addEventListener("error", () => {
|
|
3931
3934
|
(self.URL || self.webkitURL).revokeObjectURL(n);
|
|
@@ -3934,7 +3937,7 @@ function d(t) {
|
|
|
3934
3937
|
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(s), { type: "module", name: t?.name });
|
|
3935
3938
|
}
|
|
3936
3939
|
}
|
|
3937
|
-
async function
|
|
3940
|
+
async function p() {
|
|
3938
3941
|
if (globalThis.process?.versions?.node && typeof Worker > "u") return await l();
|
|
3939
3942
|
if (typeof Worker < "u") {
|
|
3940
3943
|
const t = new c(() => new d());
|
|
@@ -3947,9 +3950,9 @@ async function m() {
|
|
|
3947
3950
|
return await l();
|
|
3948
3951
|
}
|
|
3949
3952
|
var l = async () => {
|
|
3950
|
-
const { compileModule: t } = await import("./
|
|
3953
|
+
const { compileModule: t } = await import("./CwhaPB7R93eqixfq.mjs"), n = new u((e) => t(e));
|
|
3951
3954
|
return await n.start(), n;
|
|
3952
3955
|
};
|
|
3953
3956
|
export {
|
|
3954
|
-
|
|
3957
|
+
p as createCompilerWorker
|
|
3955
3958
|
};
|