@sheetxl/scripting 0.8.0-beta.11 → 0.8.0-beta.13
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 → CNf-ETo-nO1YJpZd.mjs} +1 -1
- 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/browser/esm/{CV6NN6Ju5xBT1o6B.mjs → tbtsT5bS-wwAAvcu.mjs} +1442 -1387
- 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/CompiledModule.d.ts +1 -1
- 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
|
@@ -5,11 +5,11 @@ var c = class {
|
|
|
5
5
|
start() {
|
|
6
6
|
if (typeof Worker > "u") throw new Error("Web Workers are not supported in this environment.");
|
|
7
7
|
return this._worker || (this._worker = this._workerFactory(), this._worker.onmessage = (t) => {
|
|
8
|
-
const { id: n, result: e, error: r } = t.data,
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
} else
|
|
8
|
+
const { id: n, result: e, error: r } = t.data, i = this._pendingRequests.get(n);
|
|
9
|
+
if (i) if (this._pendingRequests.delete(n), r) {
|
|
10
|
+
const a = new Error(r.message);
|
|
11
|
+
a.stack = r.stack, r.cause && (a.cause = r.cause), i.reject(a);
|
|
12
|
+
} else i.resolve(e);
|
|
13
13
|
}, this._worker.onerror = (t) => {
|
|
14
14
|
console.error("Worker error:", t), this._pendingRequests.forEach((n) => {
|
|
15
15
|
n.reject(new Error(`Worker failed: ${t.message}`));
|
|
@@ -38,46 +38,46 @@ var c = class {
|
|
|
38
38
|
}
|
|
39
39
|
terminate() {
|
|
40
40
|
}
|
|
41
|
-
}, s = `var
|
|
41
|
+
}, s = `var _t = Object.defineProperty, ar = (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
|
+
}, or = (e, t) => {
|
|
49
49
|
let r = {};
|
|
50
|
-
for (var n in e)
|
|
50
|
+
for (var n in e) _t(r, n, {
|
|
51
51
|
get: e[n],
|
|
52
52
|
enumerable: !0
|
|
53
53
|
});
|
|
54
|
-
return t ||
|
|
55
|
-
},
|
|
54
|
+
return t || _t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
55
|
+
}, xt = Object.defineProperty, ge = (e, t) => {
|
|
56
56
|
let r = {};
|
|
57
|
-
for (var n in e)
|
|
57
|
+
for (var n in e) xt(r, n, {
|
|
58
58
|
get: e[n],
|
|
59
59
|
enumerable: !0
|
|
60
60
|
});
|
|
61
|
-
return t ||
|
|
62
|
-
},
|
|
61
|
+
return t || xt(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 Xe(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
71
|
let r, n, i;
|
|
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 (!Xe(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 (!Xe(n[1], t.get(n[0]))) return !1;
|
|
81
81
|
return !0;
|
|
82
82
|
}
|
|
83
83
|
if (e instanceof Set && t instanceof Set) {
|
|
@@ -96,150 +96,150 @@ function ze(e, t) {
|
|
|
96
96
|
if (i = Object.keys(e), r = i.length, r !== Object.keys(t).length) return !1;
|
|
97
97
|
for (n = r; n-- !== 0;) if (!Object.prototype.hasOwnProperty.call(t, i[n])) return !1;
|
|
98
98
|
for (n = r; n-- !== 0;) {
|
|
99
|
-
let
|
|
100
|
-
if ((
|
|
99
|
+
let a = i[n];
|
|
100
|
+
if ((a !== "_owner" || !e.$$typeof) && !Xe(e[a], t[a])) return !1;
|
|
101
101
|
}
|
|
102
102
|
return !0;
|
|
103
103
|
}
|
|
104
104
|
return e != e && t != t;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function un(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 === dn;
|
|
110
110
|
})(e);
|
|
111
111
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
112
|
+
var dn = typeof Symbol == "function" && Symbol.for ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
113
|
+
function fn(e) {
|
|
114
114
|
return /* @__PURE__ */ (function(t) {
|
|
115
115
|
return !!t && typeof t == "object";
|
|
116
|
-
})(e) && !
|
|
116
|
+
})(e) && !un(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 pn(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 Tt(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 Ct(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 mn(e, t, r) {
|
|
142
142
|
let n = {};
|
|
143
|
-
return r.isMergeableObject(e) &&
|
|
144
|
-
n[i] =
|
|
145
|
-
}),
|
|
146
|
-
(function(
|
|
147
|
-
return
|
|
148
|
-
})(e, i) || (
|
|
149
|
-
if (!l.customMerge) return
|
|
150
|
-
let s = l.customMerge(
|
|
151
|
-
return typeof s == "function" ? s :
|
|
152
|
-
})(i, r)(e[i], t[i], r) : n[i] =
|
|
143
|
+
return r.isMergeableObject(e) && Tt(e).forEach(function(i) {
|
|
144
|
+
n[i] = Oe(e[i], r);
|
|
145
|
+
}), Tt(t).forEach(function(i) {
|
|
146
|
+
(function(a, l) {
|
|
147
|
+
return Ct(a, l) && !(Object.hasOwnProperty.call(a, l) && Object.propertyIsEnumerable.call(a, l));
|
|
148
|
+
})(e, i) || (Ct(e, i) && r.isMergeableObject(t[i]) ? n[i] = (function(a, l) {
|
|
149
|
+
if (!l.customMerge) return Ee;
|
|
150
|
+
let s = l.customMerge(a);
|
|
151
|
+
return typeof s == "function" ? s : Ee;
|
|
152
|
+
})(i, r)(e[i], t[i], r) : n[i] = Oe(t[i], r));
|
|
153
153
|
}), n;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
(r ||= {}).arrayMerge = r.arrayMerge ||
|
|
155
|
+
function Ee(e, t, r) {
|
|
156
|
+
(r ||= {}).arrayMerge = r.arrayMerge || pn, r.isMergeableObject = r.isMergeableObject || fn, 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) : mn(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: () =>
|
|
183
|
-
getFromPath: () =>
|
|
184
|
-
getPlatform: () =>
|
|
185
|
-
isDefined: () =>
|
|
186
|
-
isEmpty: () =>
|
|
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
|
|
166
|
+
var lr = ge({
|
|
167
|
+
DonePromise: () => gn,
|
|
168
|
+
EmptyArray: () => De,
|
|
169
|
+
EmptyObject: () => hn,
|
|
170
|
+
OSType: () => pe,
|
|
171
|
+
arrayMove: () => Ln,
|
|
172
|
+
asNumber: () => bn,
|
|
173
|
+
camelToPrettyCase: () => wn,
|
|
174
|
+
castToString: () => Mn,
|
|
175
|
+
cloneObject: () => xn,
|
|
176
|
+
consoleWithNoSource: () => zn,
|
|
177
|
+
deepEqual: () => Xe,
|
|
178
|
+
deepFreeze: () => gr,
|
|
179
|
+
deepMerge: () => Ee,
|
|
180
|
+
diffValues: () => $n,
|
|
181
|
+
findEqualOrGreater: () => Nn,
|
|
182
|
+
findEqualOrLesser: () => kn,
|
|
183
|
+
getFromPath: () => Bn,
|
|
184
|
+
getPlatform: () => qe,
|
|
185
|
+
isDefined: () => On,
|
|
186
|
+
isEmpty: () => Dn,
|
|
187
|
+
isEqualArrays: () => cr,
|
|
188
|
+
isEqualBounds: () => Cn,
|
|
189
|
+
isNullOrUndefined: () => mr,
|
|
190
|
+
isNumeric: () => vn,
|
|
191
|
+
isObject: () => Fe,
|
|
192
|
+
isPromiseLike: () => Fn,
|
|
193
|
+
isRectInsideRect: () => Un,
|
|
194
|
+
isRectIntersect: () => hr,
|
|
195
|
+
mergeContentful: () => Rn,
|
|
196
|
+
removeEmptyProperties: () => ur,
|
|
197
|
+
removeEqualValues: () => fr,
|
|
198
|
+
removeEqualValuesLayered: () => pr,
|
|
199
|
+
removeListenerAll: () => An,
|
|
200
|
+
roundAccurately: () => _n,
|
|
201
|
+
setToPath: () => jn,
|
|
202
|
+
splitNumber: () => En,
|
|
203
|
+
subtractRect: () => Pn,
|
|
204
|
+
textToKey: () => Sn,
|
|
205
|
+
toSafeJSON: () => dt,
|
|
206
|
+
transpose: () => In,
|
|
207
|
+
uuidV4: () => He,
|
|
208
|
+
validEnumValue: () => yn
|
|
209
|
+
}), De = Object.freeze([]), hn = Object.freeze({}), gn = Promise.resolve(), sr = (e) => e;
|
|
210
|
+
function yn(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 wn(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 Sn(e) {
|
|
217
217
|
return e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
|
|
218
218
|
}
|
|
219
|
-
var
|
|
220
|
-
function
|
|
219
|
+
var oe = Array.from({ length: 256 }, (e, t) => (t + 256).toString(16).slice(1));
|
|
220
|
+
function He() {
|
|
221
221
|
let e = globalThis.crypto;
|
|
222
222
|
if (e?.randomUUID) return e.randomUUID();
|
|
223
223
|
if (e?.getRandomValues) {
|
|
224
224
|
let t = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
|
|
225
|
-
return t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128,
|
|
225
|
+
return t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128, oe[t[0]] + oe[t[1]] + oe[t[2]] + oe[t[3]] + "-" + oe[t[4]] + oe[t[5]] + "-" + oe[t[6]] + oe[t[7]] + "-" + oe[t[8]] + oe[t[9]] + "-" + oe[t[10]] + oe[t[11]] + oe[t[12]] + oe[t[13]] + oe[t[14]] + oe[t[15]];
|
|
226
226
|
}
|
|
227
227
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
|
|
228
228
|
let r = 16 * Math.random() | 0;
|
|
229
229
|
return (t === "x" ? r : 3 & r | 8).toString(16);
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function bn(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 vn(e) {
|
|
239
239
|
let t = 1 * e;
|
|
240
240
|
return Number.isFinite(t) && typeof t == "number";
|
|
241
241
|
}
|
|
242
|
-
var
|
|
242
|
+
var et = [
|
|
243
243
|
1,
|
|
244
244
|
10,
|
|
245
245
|
100,
|
|
@@ -258,87 +258,87 @@ var qe = [
|
|
|
258
258
|
0x38d7ea4c68000,
|
|
259
259
|
0x2386f26fc10000
|
|
260
260
|
];
|
|
261
|
-
function
|
|
261
|
+
function En(e) {
|
|
262
262
|
let t = Math.abs(e);
|
|
263
263
|
if (!Number.isFinite(t)) return null;
|
|
264
264
|
let r = Math.trunc(t), n = t - r, i;
|
|
265
|
-
r > 2 ** 53 - 1 ? i = Number(r.toExponential().split("e")[1]) + 1 : (i = Math.ceil(Math.log10(r + 1)),
|
|
266
|
-
let
|
|
265
|
+
r > 2 ** 53 - 1 ? i = Number(r.toExponential().split("e")[1]) + 1 : (i = Math.ceil(Math.log10(r + 1)), et[i] <= r && i++);
|
|
266
|
+
let a = 0, l = 0, s = 15 - i;
|
|
267
267
|
if (n > 0 && s > 0) {
|
|
268
|
-
let c =
|
|
269
|
-
if (
|
|
270
|
-
else if (
|
|
268
|
+
let c = et[s];
|
|
269
|
+
if (a = Math.round(n * c), a === c) r++, a = 0, r >= et[i] && i++;
|
|
270
|
+
else if (a > 0) for (l = s; a % 10 == 0;) a /= 10, l--;
|
|
271
271
|
}
|
|
272
272
|
return {
|
|
273
273
|
ip: e < 0 ? -r : r,
|
|
274
|
-
fp:
|
|
274
|
+
fp: a,
|
|
275
275
|
ipLength: i,
|
|
276
276
|
fpLength: l
|
|
277
277
|
};
|
|
278
278
|
}
|
|
279
|
-
function
|
|
279
|
+
function _n(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 xn(e) {
|
|
285
|
+
return mr(e) ? e : JSON.parse(JSON.stringify(e));
|
|
286
286
|
}
|
|
287
|
-
var
|
|
288
|
-
function
|
|
287
|
+
var Tn = (e, t) => e === t;
|
|
288
|
+
function cr(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 ||= Tn;
|
|
292
292
|
let n = e.length;
|
|
293
293
|
for (let i = 0; i < n; i++) if (!r(e[i], t[i])) return !1;
|
|
294
294
|
return !0;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Cn(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 ur(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" ? ur(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 An(e, t) {
|
|
310
|
+
if (!e) return De;
|
|
311
311
|
let r = e.length;
|
|
312
312
|
for (let n = 0; n < r; n++) {
|
|
313
313
|
let i = e[n];
|
|
314
314
|
i && i(t);
|
|
315
315
|
}
|
|
316
|
-
return
|
|
316
|
+
return De;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function In(e) {
|
|
319
319
|
if (!e) return e;
|
|
320
320
|
let t = e.length, r = e[0].length, n = [];
|
|
321
321
|
for (let i = 0; i < r; i++) n[i] = Array(t);
|
|
322
322
|
for (let i = 0; i < t; i++) {
|
|
323
|
-
let
|
|
324
|
-
for (let l = 0; l < r; l++) n[l][i] =
|
|
323
|
+
let a = e[i];
|
|
324
|
+
for (let l = 0; l < r; l++) n[l][i] = a[l];
|
|
325
325
|
}
|
|
326
326
|
return n;
|
|
327
327
|
}
|
|
328
|
-
var
|
|
329
|
-
function
|
|
328
|
+
var dr = (e, t) => !(e !== t && !cr(e, t)) || !!e.isEqual?.(t);
|
|
329
|
+
function fr(e, t, r = dr) {
|
|
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
332
|
let n = Object.keys(e), i = n.length;
|
|
333
333
|
if (i === 0) return null;
|
|
334
|
-
let
|
|
334
|
+
let a = !1;
|
|
335
335
|
for (let l = 0; l < i; l++) {
|
|
336
336
|
let s = n[l];
|
|
337
|
-
|
|
337
|
+
fr(e[s], t?.[s], r) === null && (a = !0, delete e[s]);
|
|
338
338
|
}
|
|
339
|
-
return
|
|
339
|
+
return a && Object.keys(e).length === 0 ? null : void 0;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function pr(e, t, r = dr) {
|
|
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;
|
|
@@ -347,79 +347,79 @@ function cr(e, t, r = lr) {
|
|
|
347
347
|
}
|
|
348
348
|
let n = Object.keys(e), i = n.length;
|
|
349
349
|
if (i === 0) return !0;
|
|
350
|
-
let
|
|
350
|
+
let a = t.length, l = !1;
|
|
351
351
|
for (let s = 0; s < i; s++) {
|
|
352
352
|
let c = n[s], d = [];
|
|
353
|
-
for (let m = 0; m <
|
|
354
|
-
let
|
|
355
|
-
|
|
353
|
+
for (let m = 0; m < a; m++) {
|
|
354
|
+
let o = t[m]?.[c];
|
|
355
|
+
o !== void 0 && d.push(o);
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
pr(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 Rn(...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: (i, a) => [...a] });
|
|
366
366
|
return r;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function $n(e, t) {
|
|
369
369
|
let r = {}, n = Object.keys(t), i = n.length;
|
|
370
|
-
for (let
|
|
371
|
-
let l = n[
|
|
370
|
+
for (let a = 0; a < i; a++) {
|
|
371
|
+
let l = n[a], 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
|
|
376
|
+
function Nn(e, t, r = sr) {
|
|
377
377
|
let n = 0, i = e.length - 1;
|
|
378
378
|
for (; n <= i;) {
|
|
379
|
-
let
|
|
380
|
-
if (l === t) return
|
|
381
|
-
l < t ? n =
|
|
379
|
+
let a = Math.floor((n + i) / 2), l = r(e[a]);
|
|
380
|
+
if (l === t) return a;
|
|
381
|
+
l < t ? n = a + 1 : i = a - 1;
|
|
382
382
|
}
|
|
383
383
|
return n;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function kn(e, t, r = sr) {
|
|
386
386
|
let n = e.length - 1, i = 0;
|
|
387
387
|
for (; n >= i;) {
|
|
388
|
-
let
|
|
389
|
-
if (l === t) return
|
|
390
|
-
l > t ? n =
|
|
388
|
+
let a = Math.floor((n + i) / 2), l = r(e[a]);
|
|
389
|
+
if (l === t) return a;
|
|
390
|
+
l > t ? n = a - 1 : i = a + 1;
|
|
391
391
|
}
|
|
392
392
|
return n;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function Ln(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 Mn(e) {
|
|
399
399
|
return e == null || e === void 0 ? "" : typeof e == "string" ? e : "" + e;
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function mr(e) {
|
|
402
402
|
return e == null;
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function On(e) {
|
|
405
405
|
return e != null;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function Dn(e) {
|
|
408
408
|
return e == null || e === "";
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function Fn(e) {
|
|
411
411
|
return !!e && typeof e.then == "function";
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function hr(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 Un(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 Pn(e, t, r = !1) {
|
|
420
420
|
if (!t) return [e];
|
|
421
|
-
if (!
|
|
422
|
-
let n = [], i = e,
|
|
421
|
+
if (!hr(e, t)) return [];
|
|
422
|
+
let n = [], i = e, a = () => {
|
|
423
423
|
t.top > i.top && t.top < i.bottom && (n.push({
|
|
424
424
|
...i,
|
|
425
425
|
bottom: t.top
|
|
@@ -452,39 +452,39 @@ function On(e, t, r = !1) {
|
|
|
452
452
|
left: t.left
|
|
453
453
|
});
|
|
454
454
|
};
|
|
455
|
-
return r ? (c(), s(),
|
|
455
|
+
return r ? (c(), s(), a(), l()) : (a(), l(), s(), c()), n;
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function Bn(e, t) {
|
|
458
458
|
let r = t.split("."), n = e, i = r.length;
|
|
459
|
-
for (let
|
|
460
|
-
let l = r[
|
|
459
|
+
for (let a = 0; a < i; a++) {
|
|
460
|
+
let l = r[a];
|
|
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
|
|
468
|
+
function jn(e, t, r) {
|
|
469
469
|
let n = t.split("."), i = e;
|
|
470
470
|
if (!i) throw Error("Can not set path to a null path.");
|
|
471
|
-
let
|
|
472
|
-
for (let l = 0; i && l <
|
|
471
|
+
let a = n.length;
|
|
472
|
+
for (let l = 0; i && l < a - 1; l++) {
|
|
473
473
|
let s = n[l], c = i[s];
|
|
474
|
-
if (c ?? (c = {}, i[s] = c), !
|
|
474
|
+
if (c ?? (c = {}, i[s] = c), !Fe(c)) throw Error("Can not set path to a non object path.");
|
|
475
475
|
i = c;
|
|
476
476
|
}
|
|
477
|
-
if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !
|
|
478
|
-
return i[n[
|
|
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 i[n[a - 1]] = r, e;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function zn(...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 qe() {
|
|
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 gr(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]) || gr(t[r]);
|
|
506
506
|
}), e;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function dt(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) => dt(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] = dt(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: () => yr,
|
|
519
|
+
EmptyRange: () => Kn,
|
|
520
|
+
EmptyRanges: () => Vn,
|
|
521
|
+
EmptySelection: () => Gn,
|
|
522
|
+
InsertCutShift: () => ve,
|
|
523
|
+
cellToRange: () => Wn,
|
|
524
|
+
classifyInsertCut: () => ii,
|
|
525
|
+
columnFirstCellComparator: () => Er,
|
|
526
|
+
columnFirstRangeComparator: () => wr,
|
|
527
|
+
createCellComparator: () => Ar,
|
|
528
|
+
createConflatingRanges: () => ni,
|
|
529
|
+
createRangeComparator: () => Cr,
|
|
530
|
+
defaultRange: () => ei,
|
|
531
|
+
extendRangeToIntersectingRanges: () => Lr,
|
|
532
|
+
extendRangeToUnionRanges: () => qn,
|
|
533
|
+
intersectRanges: () => Nr,
|
|
534
|
+
isCellWithinRange: () => Xn,
|
|
535
|
+
isEqualCells: () => Ir,
|
|
536
|
+
isEqualRanges: () => yt,
|
|
537
|
+
isEqualRangesArrays: () => $r,
|
|
538
|
+
isEqualSelectionCoords: () => kr,
|
|
539
|
+
isRangeWithinRange: () => Rr,
|
|
540
|
+
isRangesIntersect: () => wt,
|
|
541
|
+
isRefusedInsertCut: () => ai,
|
|
542
|
+
isSingleCell: () => Hn,
|
|
543
|
+
isValidRange: () => Yn,
|
|
544
|
+
mergeRangeCoordValues: () => Or,
|
|
545
|
+
reverseColumnFirstCellComparator: () => Tr,
|
|
546
|
+
reverseColumnFirstRangeComparator: () => vr,
|
|
547
|
+
reverseRowFirstCellComparator: () => xr,
|
|
548
|
+
reverseRowFirstRangeComparator: () => br,
|
|
549
|
+
rowFirstCellComparator: () => _r,
|
|
550
|
+
rowFirstRangeComparator: () => Sr,
|
|
551
|
+
sanitizeRange: () => Mr,
|
|
552
|
+
sanitizeRangeArray: () => Qn,
|
|
553
|
+
translateRange: () => Zn,
|
|
554
|
+
unionRanges: () => ft,
|
|
555
|
+
unionRangesArrays: () => Jn
|
|
556
556
|
});
|
|
557
|
-
var
|
|
557
|
+
var yr = Object.freeze({
|
|
558
558
|
colIndex: 0,
|
|
559
559
|
rowIndex: 0
|
|
560
|
-
}),
|
|
560
|
+
}), Kn = Object.freeze({
|
|
561
561
|
colStart: 0,
|
|
562
562
|
rowStart: 0,
|
|
563
563
|
colEnd: 0,
|
|
564
564
|
rowEnd: 0
|
|
565
|
-
}),
|
|
566
|
-
cell:
|
|
567
|
-
ranges:
|
|
565
|
+
}), Vn = De, Gn = Object.freeze({
|
|
566
|
+
cell: yr,
|
|
567
|
+
ranges: De,
|
|
568
568
|
rangeIndex: -1
|
|
569
569
|
});
|
|
570
|
-
function
|
|
570
|
+
function wr(e, t) {
|
|
571
571
|
return e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart;
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function Sr(e, t) {
|
|
574
574
|
return e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function br(e, t) {
|
|
577
577
|
return e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd;
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function vr(e, t) {
|
|
580
580
|
return e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd;
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function Er(e, t) {
|
|
583
583
|
return e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function _r(e, t) {
|
|
586
586
|
return e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex;
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function xr(e, t) {
|
|
589
589
|
return e.rowIndex === t.rowIndex ? t.colIndex - e.colIndex : t.rowIndex - e.rowIndex;
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function Tr(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 Cr(e = ie.Row, t = !1) {
|
|
595
|
+
return t ? e === ie.Column ? vr : br : e === ie.Column ? wr : Sr;
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
return t ? e ===
|
|
597
|
+
function Ar(e = ie.Row, t = !1) {
|
|
598
|
+
return t ? e === ie.Column ? Tr : xr : e === ie.Column ? Er : _r;
|
|
599
599
|
}
|
|
600
|
-
function
|
|
600
|
+
function Ir(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 yt(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 Xn(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 Rr(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 wt(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 $r(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 (!yt(e[r], t[r])) return !1;
|
|
623
623
|
return !0;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Hn(e) {
|
|
626
626
|
return !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function Wn(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 Nr(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), i = Math.max(e.rowStart, t.rowStart),
|
|
638
|
-
return s ? (s.colStart = n, s.rowStart = i, s.colEnd =
|
|
637
|
+
let n = Math.max(e.colStart, t.colStart), i = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), l = Math.min(e.rowEnd, t.rowEnd), s = r;
|
|
638
|
+
return s ? (s.colStart = n, s.rowStart = i, s.colEnd = a, s.rowEnd = l) : s = {
|
|
639
639
|
colStart: n,
|
|
640
640
|
rowStart: i,
|
|
641
|
-
colEnd:
|
|
641
|
+
colEnd: a,
|
|
642
642
|
rowEnd: l
|
|
643
643
|
}, s;
|
|
644
644
|
}
|
|
645
|
-
function
|
|
645
|
+
function ft(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), i = Math.min(e.rowStart, t.rowStart),
|
|
650
|
-
return s ? (s.colStart = n, s.rowStart = i, s.colEnd =
|
|
649
|
+
let n = Math.min(e.colStart, t.colStart), i = Math.min(e.rowStart, t.rowStart), a = Math.max(e.colEnd, t.colEnd), l = Math.max(e.rowEnd, t.rowEnd), s = r;
|
|
650
|
+
return s ? (s.colStart = n, s.rowStart = i, s.colEnd = a, s.rowEnd = l) : s = {
|
|
651
651
|
colStart: n,
|
|
652
652
|
rowStart: i,
|
|
653
|
-
colEnd:
|
|
653
|
+
colEnd: a,
|
|
654
654
|
rowEnd: l
|
|
655
655
|
}, s;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
658
|
-
return e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!
|
|
657
|
+
function kr(e, t) {
|
|
658
|
+
return e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Ir(e.cell, t.cell) && $r(e.ranges, t.ranges);
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function Jn(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 i = 1; i < e.length; i++) n =
|
|
665
|
-
return t && (n =
|
|
664
|
+
for (let i = 1; i < e.length; i++) n = ft(n, e[i], r);
|
|
665
|
+
return t && (n = ft(n, t, r)), n;
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Yn(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 qn(e, t) {
|
|
671
671
|
if (!t || t.length === 0) return e;
|
|
672
672
|
let r = e, n = null;
|
|
673
|
-
for (; !
|
|
673
|
+
for (; !yt(r, n);) n = r, r = Lr(n, t);
|
|
674
674
|
return r;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function Lr(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
680
|
let i = t[n];
|
|
681
|
-
|
|
681
|
+
wt(r, i) && (r.rowStart = Math.min(r.rowStart, i.rowStart), r.colStart = Math.min(r.colStart, i.colStart), r.rowEnd = Math.max(r.rowEnd, i.rowEnd), r.colEnd = Math.max(r.colEnd, i.colEnd));
|
|
682
682
|
}
|
|
683
683
|
return r;
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Zn(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 Mr(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 Qn(e, t) {
|
|
708
708
|
if (!e) return null;
|
|
709
709
|
let r = e.length, n = Array(r);
|
|
710
|
-
for (let i = 0; i < r; i++) n[i] =
|
|
710
|
+
for (let i = 0; i < r; i++) n[i] = Mr(e[i], t);
|
|
711
711
|
return n;
|
|
712
712
|
}
|
|
713
|
-
function
|
|
713
|
+
function ei(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,51 +718,51 @@ function Yn(e, t, r) {
|
|
|
718
718
|
rowEnd: e.rowEnd ?? t.rowEnd
|
|
719
719
|
} : t;
|
|
720
720
|
}
|
|
721
|
-
var
|
|
721
|
+
var ti = [null, null], ri = (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 Or(e, t = 2, r, n = ie.Row, i) {
|
|
725
|
+
let a = [...e];
|
|
726
|
+
if (t <= 0 || e.length <= 1) return a;
|
|
727
|
+
let l = n === ie.Column, s = 0, c = !1;
|
|
728
728
|
do {
|
|
729
|
-
let d =
|
|
730
|
-
|
|
731
|
-
let m = d.length,
|
|
729
|
+
let d = a.sort(Cr(l ? ie.Row : ie.Column));
|
|
730
|
+
a = [], a.push(d[0]);
|
|
731
|
+
let m = d.length, o = 0, f = d[0], b = f.colStart, S = f.rowStart, A = f.colEnd, k = f.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 ? f && S === y.rowStart && k === y.rowEnd && A + 1 === y.colStart : f && b === y.colStart && A === y.colEnd && k + 1 === y.rowStart, w) {
|
|
735
|
+
let D = {
|
|
736
736
|
colStart: b,
|
|
737
|
-
rowStart:
|
|
738
|
-
colEnd: l ?
|
|
739
|
-
rowEnd: l ?
|
|
737
|
+
rowStart: S,
|
|
738
|
+
colEnd: l ? y.colEnd : A,
|
|
739
|
+
rowEnd: l ? k : y.rowEnd
|
|
740
740
|
};
|
|
741
|
-
if (f.value !== void 0 && (
|
|
742
|
-
let
|
|
743
|
-
|
|
741
|
+
if (f.value !== void 0 && (D.value = f.value), r) {
|
|
742
|
+
let K = i ?? [null, null];
|
|
743
|
+
K[0] = f, K[1] = y, D = r(K, D, n);
|
|
744
744
|
}
|
|
745
|
-
if (
|
|
746
|
-
o
|
|
745
|
+
if (D) {
|
|
746
|
+
a[o] = D, c = !0, f = D, b = f.colStart, S = f.rowStart, A = f.colEnd, k = f.rowEnd;
|
|
747
747
|
continue;
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
|
|
750
|
+
a[++o] = y, f = y, b = f.colStart, S = f.rowStart, A = f.colEnd, k = f.rowEnd;
|
|
751
751
|
}
|
|
752
752
|
s++, l = !l, s === 1 && (c = !0);
|
|
753
|
-
} while (s < t && c &&
|
|
754
|
-
return
|
|
753
|
+
} while (s < t && c && a.length > 1);
|
|
754
|
+
return a;
|
|
755
755
|
}
|
|
756
|
-
function
|
|
757
|
-
let r = [], n, i = null,
|
|
756
|
+
function ni(e, t = !1) {
|
|
757
|
+
let r = [], n, i = null, a = -(2 ** 53 - 1), l = -(2 ** 53 - 1);
|
|
758
758
|
return {
|
|
759
759
|
append: (s, c, d) => {
|
|
760
|
-
let m = !0,
|
|
761
|
-
if (
|
|
762
|
-
let
|
|
763
|
-
|
|
760
|
+
let m = !0, o = d !== void 0;
|
|
761
|
+
if (o) {
|
|
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 ===
|
|
765
|
+
if (m && c === l + 1 && s === a) return t ? i.rowEnd = c : i.colEnd = c, l = c, void (n = d);
|
|
766
766
|
i && r.push(i);
|
|
767
767
|
let f = t ? s : c, b = t ? c : s;
|
|
768
768
|
i = {
|
|
@@ -770,25 +770,25 @@ function Qn(e, t = !1) {
|
|
|
770
770
|
rowStart: b,
|
|
771
771
|
colEnd: f,
|
|
772
772
|
rowEnd: b
|
|
773
|
-
},
|
|
773
|
+
}, o && (i.value = d), a = s, l = c, n = d;
|
|
774
774
|
},
|
|
775
|
-
done: (s) => (i &&= (r.push(i), null), s ?
|
|
775
|
+
done: (s) => (i &&= (r.push(i), null), s ? Or(r, 3, s === !0 ? ri : s, t ? ie.Column : ie.Row, ti) : 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 ii(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 ai(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",
|
|
@@ -799,24 +799,24 @@ var Z = {
|
|
|
799
799
|
Png: "image/png"
|
|
800
800
|
};
|
|
801
801
|
ge({
|
|
802
|
-
findNextCellWithinSelection: () =>
|
|
803
|
-
traverseHiddenHeaders: () =>
|
|
802
|
+
findNextCellWithinSelection: () => Dr,
|
|
803
|
+
traverseHiddenHeaders: () => fe
|
|
804
804
|
});
|
|
805
|
-
function
|
|
805
|
+
function fe(e, t, r, n) {
|
|
806
806
|
if (!e) return t;
|
|
807
|
-
let i = t,
|
|
807
|
+
let i = t, a = r === q.Right || r === q.Down;
|
|
808
808
|
for (;;) {
|
|
809
|
-
let l = e(i, !
|
|
809
|
+
let l = e(i, !a);
|
|
810
810
|
if (l === 0) return i;
|
|
811
|
-
let s =
|
|
812
|
-
if (n !== void 0 && (
|
|
811
|
+
let s = a ? i + l : i - l;
|
|
812
|
+
if (n !== void 0 && (a ? s > n : s < n)) return n;
|
|
813
813
|
i = s;
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
|
-
function
|
|
817
|
-
if (
|
|
816
|
+
function Dr(e, t = q.Right, r, n, i, a = null) {
|
|
817
|
+
if (a && kr(a, e)) return e;
|
|
818
818
|
let l = e.ranges, s = e.rangeIndex, c = l[s];
|
|
819
|
-
if (!
|
|
819
|
+
if (!wt({
|
|
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(i, d.colIndex + 1, t, c.colEnd + 1);
|
|
829
829
|
break;
|
|
830
|
-
case
|
|
831
|
-
d.colIndex =
|
|
830
|
+
case q.Left:
|
|
831
|
+
d.colIndex = fe(i, 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
|
|
839
|
-
if (
|
|
838
|
+
let o = (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) o(!0);
|
|
856
|
+
else if (t === q.Left && d.colIndex < c.colStart && d.rowIndex === c.rowStart) o(!1);
|
|
857
|
+
else if (t === q.Down && d.colIndex === c.colEnd && d.rowIndex > c.rowEnd) o(!0);
|
|
858
|
+
else if (t === q.Up && d.colIndex === c.colStart && d.rowIndex < c.rowStart) o(!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(i, 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(i, 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
878
|
let f = r(d);
|
|
879
|
-
if (!
|
|
880
|
-
let
|
|
881
|
-
|
|
879
|
+
if (!Rr(f, c)) {
|
|
880
|
+
let S = Nr(f, c);
|
|
881
|
+
S && (f = S);
|
|
882
882
|
}
|
|
883
883
|
let b = {
|
|
884
|
-
rowStart:
|
|
885
|
-
colStart:
|
|
886
|
-
rowEnd:
|
|
887
|
-
colEnd:
|
|
884
|
+
rowStart: fe(n, f.rowStart, q.Down, f.rowEnd),
|
|
885
|
+
colStart: fe(i, f.colStart, q.Right, f.colEnd),
|
|
886
|
+
rowEnd: fe(n, f.rowEnd, q.Up, f.rowStart),
|
|
887
|
+
colEnd: fe(i, f.colEnd, q.Left, f.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
|
-
return
|
|
902
|
+
return Dr({
|
|
903
903
|
cell: d,
|
|
904
904
|
ranges: e.ranges,
|
|
905
905
|
rangeIndex: m
|
|
906
|
-
}, t, r, n, i,
|
|
906
|
+
}, t, r, n, i, a ?? e);
|
|
907
907
|
}
|
|
908
908
|
return {
|
|
909
909
|
ranges: e.ranges,
|
|
@@ -911,77 +911,77 @@ function Lr(e, t = Z.Right, r, n, i, o = null) {
|
|
|
911
911
|
rangeIndex: m
|
|
912
912
|
};
|
|
913
913
|
}
|
|
914
|
-
var
|
|
914
|
+
var oi, $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), tt = (e) => (Ne.length < e && (Ne = new Int32Array(Math.max(e, 2 * Ne.length))), Ne.fill(0, 0, e), Ne), li = 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
921
|
let i = e.count;
|
|
922
922
|
this._n = i;
|
|
923
|
-
let
|
|
924
|
-
for (let h = 0; h < i; h++) n ? (
|
|
925
|
-
this._M0 =
|
|
926
|
-
let b = r ? t.colStart : t.rowStart,
|
|
923
|
+
let a = new Int32Array(i), l = new Int32Array(i), s = new Int32Array(i), c = new Int32Array(i), d = r ? e.colS : e.rowS, m = r ? e.colE : e.rowE, o = r ? e.rowS : e.colS, f = r ? e.rowE : e.colE;
|
|
924
|
+
for (let h = 0; h < i; h++) n ? (a[h] = -m[h], l[h] = -d[h], s[h] = -f[h], c[h] = -o[h]) : (a[h] = d[h], l[h] = m[h], s[h] = o[h], c[h] = f[h]);
|
|
925
|
+
this._M0 = a, 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, k = new Int32Array(i);
|
|
927
927
|
if (i < 256 || A > 16 * i) {
|
|
928
|
-
for (let h = 0; h < i; h++)
|
|
929
|
-
|
|
928
|
+
for (let h = 0; h < i; h++) k[h] = h;
|
|
929
|
+
k.sort((h, y) => a[h] - a[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 = tt(A + 1);
|
|
932
|
+
for (let w = 0; w < i; w++) y[a[w] - h + 1]++;
|
|
933
|
+
for (let w = 1; w <= A; w++) y[w] += y[w - 1];
|
|
934
|
+
for (let w = 0; w < i; w++) k[y[a[w] - h]++] = w;
|
|
935
935
|
}
|
|
936
|
-
this._order =
|
|
936
|
+
this._order = k, this._active = new Int32Array(Math.min(2 * i, 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, i = 1 & e,
|
|
942
|
+
let r = e >> 1, n = t >> 1, i = 1 & e, a = 1 & t, l = this._m0, s = this._m1, c = i ? s[r] : l[r], d = a ? s[n] : l[n];
|
|
943
943
|
if (c !== d) return c - d;
|
|
944
|
-
if (i !==
|
|
945
|
-
let m = i ? l[r] : s[r],
|
|
946
|
-
return m ===
|
|
944
|
+
if (i !== a) return i - a;
|
|
945
|
+
let m = i ? l[r] : s[r], o = a ? l[n] : s[n];
|
|
946
|
+
return m === o ? this._stable(r) - this._stable(n) : m - o;
|
|
947
947
|
}
|
|
948
948
|
_sortEvents(e, t, r, n) {
|
|
949
949
|
let i = n - r + 1;
|
|
950
|
-
if (t < 256 || i > 16 * t) return e.subarray(0, t).sort((
|
|
951
|
-
let
|
|
950
|
+
if (t < 256 || i > 16 * t) return e.subarray(0, t).sort((o, f) => this._compareEvents(o, f)), e;
|
|
951
|
+
let a = this._m0, l = this._m1, s = e, c = this._scratch;
|
|
952
952
|
c.length < t && (c = this._scratch = new Int32Array(t));
|
|
953
|
-
let d =
|
|
954
|
-
for (let
|
|
955
|
-
let f = s[
|
|
956
|
-
d[(1 & f ?
|
|
953
|
+
let d = tt(i + 1);
|
|
954
|
+
for (let o = 0; o < t; o++) {
|
|
955
|
+
let f = s[o];
|
|
956
|
+
d[(1 & f ? a[f >> 1] : l[f >> 1]) - r + 1]++;
|
|
957
957
|
}
|
|
958
|
-
for (let
|
|
959
|
-
for (let
|
|
960
|
-
let f = s[
|
|
961
|
-
c[d[(1 & f ?
|
|
958
|
+
for (let o = 1; o <= i; o++) d[o] += d[o - 1];
|
|
959
|
+
for (let o = 0; o < t; o++) {
|
|
960
|
+
let f = s[o];
|
|
961
|
+
c[d[(1 & f ? a[f >> 1] : l[f >> 1]) - r]++] = f;
|
|
962
962
|
}
|
|
963
963
|
let m = 0;
|
|
964
|
-
for (let
|
|
965
|
-
for (let
|
|
966
|
-
d =
|
|
967
|
-
for (let
|
|
968
|
-
let f = s[
|
|
969
|
-
d[(1 & f ? l[f >> 1] :
|
|
970
|
-
}
|
|
971
|
-
for (let
|
|
972
|
-
for (let
|
|
973
|
-
let f = s[
|
|
974
|
-
c[d[(1 & f ? l[f >> 1] :
|
|
964
|
+
for (let o = 0; o < t; o++) 1 & c[o] || (s[m++] = c[o]);
|
|
965
|
+
for (let o = 0; o < t; o++) 1 & ~c[o] || (s[m++] = c[o]);
|
|
966
|
+
d = tt(i + 1);
|
|
967
|
+
for (let o = 0; o < t; o++) {
|
|
968
|
+
let f = s[o];
|
|
969
|
+
d[(1 & f ? l[f >> 1] : a[f >> 1]) - r + 1]++;
|
|
970
|
+
}
|
|
971
|
+
for (let o = 1; o <= i; o++) d[o] += d[o - 1];
|
|
972
|
+
for (let o = 0; o < t; o++) {
|
|
973
|
+
let f = s[o];
|
|
974
|
+
c[d[(1 & f ? l[f >> 1] : a[f >> 1]) - r]++] = f;
|
|
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, i,
|
|
979
|
+
let e = this._n, t = this._M0, r = this._M1, n = this._order, i, a = this._active, l = this._activeLen;
|
|
980
980
|
if (this._hasBand) {
|
|
981
|
-
let
|
|
981
|
+
let o = this._bandEnd, f = 0;
|
|
982
982
|
for (let b = 0; b < l; b++) {
|
|
983
|
-
let
|
|
984
|
-
r[
|
|
983
|
+
let S = a[b];
|
|
984
|
+
r[S >> 1] > o && (a[f++] = S);
|
|
985
985
|
}
|
|
986
986
|
l = f;
|
|
987
987
|
}
|
|
@@ -995,59 +995,59 @@ var ri, Ae = (e, t) => {
|
|
|
995
995
|
for (; c < e && t[n[c]] === i;) c++;
|
|
996
996
|
let d = c - s;
|
|
997
997
|
if (d > 0) {
|
|
998
|
-
let
|
|
999
|
-
f.length <
|
|
1000
|
-
let b = this._m0,
|
|
1001
|
-
if (this._isReverse) for (let
|
|
1002
|
-
let L = n[
|
|
1003
|
-
f[h++] = L << 1, f[h++] = L << 1 | 1, b[L] < A && (A = b[L]),
|
|
998
|
+
let o = 2 * d, f = this._events;
|
|
999
|
+
f.length < o && (f = this._events = new Int32Array(Math.max(o, 2 * f.length)));
|
|
1000
|
+
let b = this._m0, S = this._m1, A = 2 ** 53 - 1, k = -(2 ** 53 - 1), h = 0;
|
|
1001
|
+
if (this._isReverse) for (let K = c - 1; K >= s; K--) {
|
|
1002
|
+
let L = n[K];
|
|
1003
|
+
f[h++] = L << 1, f[h++] = L << 1 | 1, b[L] < A && (A = b[L]), S[L] > k && (k = S[L]);
|
|
1004
1004
|
}
|
|
1005
|
-
else for (let
|
|
1006
|
-
let L = n[
|
|
1007
|
-
f[h++] = L << 1, f[h++] = L << 1 | 1, b[L] < A && (A = b[L]),
|
|
1005
|
+
else for (let K = s; K < c; K++) {
|
|
1006
|
+
let L = n[K];
|
|
1007
|
+
f[h++] = L << 1, f[h++] = L << 1 | 1, b[L] < A && (A = b[L]), S[L] > k && (k = S[L]);
|
|
1008
1008
|
}
|
|
1009
|
-
let
|
|
1010
|
-
if ((
|
|
1009
|
+
let y = this._sortEvents(f, o, A, k), w = l + o, D = this._scratch;
|
|
1010
|
+
if ((D === y || D.length < w) && (D = new Int32Array(Math.max(w, 2 * a.length))), l === 0) D.set(y.subarray(0, o));
|
|
1011
1011
|
else {
|
|
1012
|
-
let
|
|
1013
|
-
for (;
|
|
1014
|
-
for (;
|
|
1015
|
-
for (; L <
|
|
1012
|
+
let K = 0, L = 0, R = 0;
|
|
1013
|
+
for (; K < l && L < o;) this._compareEvents(a[K], y[L]) <= 0 ? D[R++] = a[K++] : D[R++] = y[L++];
|
|
1014
|
+
for (; K < l;) D[R++] = a[K++];
|
|
1015
|
+
for (; L < o;) D[R++] = y[L++];
|
|
1016
1016
|
}
|
|
1017
|
-
this._scratch =
|
|
1017
|
+
this._scratch = a.length >= D.length ? a : new Int32Array(D.length), a = 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
|
-
for (let
|
|
1022
|
-
let f = r[o
|
|
1021
|
+
for (let o = 0; o < l; o++) {
|
|
1022
|
+
let f = r[a[o] >> 1];
|
|
1023
1023
|
f < m && (m = f);
|
|
1024
1024
|
}
|
|
1025
1025
|
return this._bandStart = i, 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, i = this._rMinS,
|
|
1029
|
-
|
|
1030
|
-
for (let
|
|
1028
|
+
let e = this._active, t = this._activeLen, r = this._m0, n = this._m1, i = this._rMinS, a = this._rMinE, l = this._rOff, s = this._pool, c = this._overlaps, d = 0, m = 0, o = 0, f = 0, b = (S, A) => {
|
|
1029
|
+
o >= i.length && (i = this._rMinS = $e(i, o + 1), a = this._rMinE = $e(a, o + 1), l = this._rOff = $e(l, i.length + 1)), i[o] = S, a[o] = A, l[o] = m, o++, m + d > s.length && (s = this._pool = $e(s, m + d));
|
|
1030
|
+
for (let k = 0; k < d; k++) s[m++] = c[k];
|
|
1031
1031
|
};
|
|
1032
|
-
for (let
|
|
1033
|
-
let A = e[
|
|
1032
|
+
for (let S = 0; S < t; S++) {
|
|
1033
|
+
let A = e[S], k = A >> 1;
|
|
1034
1034
|
if (1 & A) {
|
|
1035
|
-
let h = n[
|
|
1035
|
+
let h = n[k];
|
|
1036
1036
|
if (f <= h && b(f, h), d > 1) {
|
|
1037
|
-
let
|
|
1038
|
-
for (;
|
|
1039
|
-
|
|
1037
|
+
let y = d - 1;
|
|
1038
|
+
for (; y >= 0 && c[y] !== k;) y--;
|
|
1039
|
+
y !== -1 && (c[y] = c[d - 1]);
|
|
1040
1040
|
}
|
|
1041
1041
|
d--, f = h + 1;
|
|
1042
1042
|
} else {
|
|
1043
|
-
let h = r[
|
|
1044
|
-
d > 0 && f < h && b(f, h - 1), d >= c.length && (c = this._overlaps =
|
|
1043
|
+
let h = r[k];
|
|
1044
|
+
d > 0 && f < h && b(f, h - 1), d >= c.length && (c = this._overlaps = $e(c, d + 1)), c[d++] = k, f = h;
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
l[
|
|
1047
|
+
l[o] = m, this._rCount = o, 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, i = this._rMinS[e],
|
|
1050
|
+
let t = this._isReverse, r = t ? 0 - this._bandEnd : this._bandStart, n = t ? 0 - this._bandStart : this._bandEnd, i = this._rMinS[e], a = this._rMinE[e], l = t ? 0 - a : i, s = t ? 0 - i : a;
|
|
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) {
|
|
@@ -1101,10 +1101,10 @@ 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 a = this._rMinE, l = 0, s = this._rCount;
|
|
1105
1105
|
for (; l < s;) {
|
|
1106
1106
|
let c = l + s >>> 1;
|
|
1107
|
-
|
|
1107
|
+
a[c] < i ? l = c + 1 : s = c;
|
|
1108
1108
|
}
|
|
1109
1109
|
if (l < this._rCount) {
|
|
1110
1110
|
let c = this._rMinS[l];
|
|
@@ -1115,28 +1115,28 @@ var ri, Ae = (e, t) => {
|
|
|
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
|
|
1123
|
+
class t extends li {
|
|
1124
1124
|
constructor(...i) {
|
|
1125
1125
|
super(...i), this._reuseOverlaps = null;
|
|
1126
1126
|
}
|
|
1127
1127
|
_materialize(i) {
|
|
1128
|
-
let
|
|
1128
|
+
let a = this._rOff, l = this._pool, s = this._store.value, c = a[i], d = a[i + 1], m = this._reuseOverlaps;
|
|
1129
1129
|
m ? m.length = 0 : m = [];
|
|
1130
|
-
for (let
|
|
1130
|
+
for (let o = c; o < d; o++) m.push(s[l[o]]);
|
|
1131
1131
|
return m;
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
1134
|
class r {
|
|
1135
|
-
constructor(i,
|
|
1135
|
+
constructor(i, a) {
|
|
1136
1136
|
if (this._sweep = null, this._isByCell = !1, this._cellComparator = null, this._lastCell = null, this._reuse = null, !i || i.length === 0) return;
|
|
1137
1137
|
let l, s = !0, c = !1, d = !1;
|
|
1138
|
-
if (
|
|
1139
|
-
let
|
|
1138
|
+
if (a && (s = (a.axis ?? ie.Column) !== ie.Row, c = a.reverse ?? !1, d = a.byCell ?? !1, l = a.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 = i.length,
|
|
1163
|
+
let m = i.length, o = {
|
|
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
|
-
}, f = 2 ** 53 - 1, b = -(2 ** 53 - 1),
|
|
1173
|
-
for (let
|
|
1174
|
-
let
|
|
1175
|
-
|
|
1172
|
+
}, f = 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 = i[y];
|
|
1175
|
+
o.rowS[y] = w.rowStart, o.rowE[y] = w.rowEnd, o.colS[y] = w.colStart, o.colE[y] = w.colEnd, o.value.push(w), w.rowStart < f && (f = w.rowStart), w.rowEnd > b && (b = w.rowEnd), w.colStart < S && (S = w.colStart), w.colEnd > A && (A = w.colEnd);
|
|
1176
1176
|
}
|
|
1177
|
-
let
|
|
1177
|
+
let k = {
|
|
1178
1178
|
rowStart: f,
|
|
1179
1179
|
rowEnd: b,
|
|
1180
|
-
colStart:
|
|
1180
|
+
colStart: S,
|
|
1181
1181
|
colEnd: A
|
|
1182
|
-
}, h = this._sweep = new t(
|
|
1183
|
-
d ? this._cellComparator =
|
|
1182
|
+
}, h = this._sweep = new t(o, k, s, c);
|
|
1183
|
+
d ? this._cellComparator = Ar(s ? ie.Column : ie.Row, c) : l && (h._reuseOverlaps = []);
|
|
1184
1184
|
}
|
|
1185
1185
|
next(i) {
|
|
1186
|
-
let
|
|
1187
|
-
if (!
|
|
1186
|
+
let a = this._sweep;
|
|
1187
|
+
if (!a) return je;
|
|
1188
1188
|
let l = this._isByCell, s;
|
|
1189
1189
|
if (i) {
|
|
1190
1190
|
if (!l) throw Error("nextCell is only supported when byCell is true");
|
|
1191
|
-
let
|
|
1192
|
-
if (
|
|
1193
|
-
s =
|
|
1194
|
-
} else s = l ?
|
|
1195
|
-
if (!s) return this._sweep = null,
|
|
1191
|
+
let o = this._lastCell;
|
|
1192
|
+
if (o && this._cellComparator(o, i) >= 0) throw Error("nextCell must be after the current iteration cell");
|
|
1193
|
+
s = a.seekCell(i.rowIndex, i.colIndex);
|
|
1194
|
+
} else s = l ? a.nextCell() : a.nextRegion();
|
|
1195
|
+
if (!s) return this._sweep = null, je;
|
|
1196
1196
|
let c = this._reuse;
|
|
1197
1197
|
if (c) {
|
|
1198
|
-
let
|
|
1198
|
+
let o = c.value;
|
|
1199
1199
|
c.done = !1;
|
|
1200
|
-
let f =
|
|
1201
|
-
if (f.colStart =
|
|
1202
|
-
let b =
|
|
1203
|
-
b.colIndex =
|
|
1204
|
-
let
|
|
1205
|
-
|
|
1200
|
+
let f = o.range;
|
|
1201
|
+
if (f.colStart = a.colStart, f.rowStart = a.rowStart, f.colEnd = a.colEnd, f.rowEnd = a.rowEnd, l) {
|
|
1202
|
+
let b = o.cell;
|
|
1203
|
+
b.colIndex = a.cellCol, b.rowIndex = a.cellRow;
|
|
1204
|
+
let S = this._lastCell;
|
|
1205
|
+
S ||= this._lastCell = {
|
|
1206
1206
|
colIndex: 0,
|
|
1207
1207
|
rowIndex: 0
|
|
1208
|
-
},
|
|
1208
|
+
}, S.colIndex = a.cellCol, S.rowIndex = a.cellRow;
|
|
1209
1209
|
}
|
|
1210
|
-
return
|
|
1210
|
+
return o.overlaps = a.intersection, c;
|
|
1211
1211
|
}
|
|
1212
|
-
let d = null, m =
|
|
1212
|
+
let d = null, m = a.intersection;
|
|
1213
1213
|
return l && (d = this._lastCell = {
|
|
1214
|
-
colIndex:
|
|
1215
|
-
rowIndex:
|
|
1214
|
+
colIndex: a.cellCol,
|
|
1215
|
+
rowIndex: a.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: a.colStart,
|
|
1222
|
+
rowStart: a.rowStart,
|
|
1223
|
+
colEnd: a.colEnd,
|
|
1224
|
+
rowEnd: a.rowEnd
|
|
1225
1225
|
},
|
|
1226
1226
|
overlaps: m
|
|
1227
1227
|
}
|
|
1228
1228
|
};
|
|
1229
1229
|
}
|
|
1230
1230
|
return(i) {
|
|
1231
|
-
return
|
|
1231
|
+
return je;
|
|
1232
1232
|
}
|
|
1233
1233
|
throw(i) {
|
|
1234
|
-
return
|
|
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
|
+
})(oi ||= {});
|
|
1242
|
+
var si = 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 a = this._onceMessageKeys;
|
|
1255
|
+
if (a.has(r.onceKey)) return;
|
|
1256
|
+
a.add(r.onceKey);
|
|
1257
1257
|
}
|
|
1258
1258
|
let n = r?.meta, i = this._overrides;
|
|
1259
1259
|
if (i) {
|
|
1260
|
-
let
|
|
1261
|
-
if (
|
|
1260
|
+
let a = i[e];
|
|
1261
|
+
if (a) return void a.bind(i)(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 si();
|
|
1279
|
+
var rt;
|
|
1280
1280
|
ge({
|
|
1281
|
-
EmptyBounds: () =>
|
|
1282
|
-
EmptyRect: () =>
|
|
1283
|
-
EmptyTopLeft: () =>
|
|
1281
|
+
EmptyBounds: () => di,
|
|
1282
|
+
EmptyRect: () => ui,
|
|
1283
|
+
EmptyTopLeft: () => ci
|
|
1284
1284
|
});
|
|
1285
|
-
var
|
|
1285
|
+
var ci = Object.freeze({
|
|
1286
1286
|
left: 0,
|
|
1287
1287
|
top: 0
|
|
1288
|
-
}),
|
|
1288
|
+
}), ui = Object.freeze({
|
|
1289
1289
|
left: 0,
|
|
1290
1290
|
top: 0,
|
|
1291
1291
|
bottom: 0,
|
|
1292
1292
|
right: 0
|
|
1293
|
-
}),
|
|
1293
|
+
}), di = 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: () => Fr,
|
|
1301
|
+
getDPI: () => pi,
|
|
1302
|
+
hasFocus: () => Ur,
|
|
1303
|
+
openFileDialog: () => fi,
|
|
1304
|
+
scrollIntoContainer: () => mi,
|
|
1305
|
+
whenFocus: () => hi
|
|
1306
1306
|
});
|
|
1307
|
-
var
|
|
1308
|
-
if (!
|
|
1307
|
+
var Fr = !(typeof window > "u" || !window.document || !window.document.createElement), fi = (e = "*.*") => new Promise((t, r) => {
|
|
1308
|
+
if (!Fr) 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 i = null,
|
|
1311
|
+
let i = null, a = !1;
|
|
1312
1312
|
globalThis.addEventListener?.("focus", () => {
|
|
1313
1313
|
setTimeout(() => {
|
|
1314
|
-
i ||
|
|
1314
|
+
i || a || (a = !0, t(null));
|
|
1315
1315
|
}, 1e3);
|
|
1316
1316
|
}, {
|
|
1317
1317
|
once: !0,
|
|
1318
1318
|
passive: !0
|
|
1319
1319
|
}), n.onchange = () => {
|
|
1320
1320
|
if (i = n.files?.[0] ?? null, i) {
|
|
1321
|
-
if (
|
|
1321
|
+
if (a) return void console.warn("File open detected after faux cancel.", i);
|
|
1322
1322
|
t(i);
|
|
1323
1323
|
}
|
|
1324
1324
|
}, n.autofocus = !0, n.click();
|
|
1325
|
-
}),
|
|
1325
|
+
}), pi = () => {
|
|
1326
1326
|
let e = 1;
|
|
1327
1327
|
return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
|
|
1328
|
-
},
|
|
1328
|
+
}, Ur = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), mi = (e, t, r = "auto") => {
|
|
1329
1329
|
if ((() => {
|
|
1330
|
-
if (
|
|
1330
|
+
if (rt === 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
|
+
rt = c;
|
|
1338
1338
|
}
|
|
1339
|
-
return
|
|
1339
|
+
return rt;
|
|
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(), i = t.getBoundingClientRect(),
|
|
1347
|
-
i.top <
|
|
1346
|
+
let n = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = n.top + e.clientTop, l = a + e.clientHeight, s = 0;
|
|
1347
|
+
i.top < a ? s = i.top - a : i.bottom > l && (s = Math.min(i.bottom - l, i.top - a)), s !== 0 && e.scrollBy({
|
|
1348
1348
|
top: s,
|
|
1349
1349
|
behavior: r
|
|
1350
1350
|
});
|
|
1351
|
-
},
|
|
1352
|
-
|
|
1351
|
+
}, hi = async (e, t = !1) => new Promise((r) => {
|
|
1352
|
+
Ur(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: () => vi,
|
|
1358
|
+
debounce: () => wi,
|
|
1359
|
+
nextTick: () => bi,
|
|
1360
|
+
rafThrottle: () => Si,
|
|
1361
|
+
requestTimeout: () => Ei,
|
|
1362
|
+
throttle: () => yi
|
|
1363
1363
|
});
|
|
1364
|
-
var
|
|
1365
|
-
function
|
|
1364
|
+
var Ue = globalThis.requestAnimationFrame, gi = globalThis.cancelAnimationFrame;
|
|
1365
|
+
function yi(e, t) {
|
|
1366
1366
|
let r = null;
|
|
1367
1367
|
return (...n) => {
|
|
1368
1368
|
let i = Date.now();
|
|
1369
1369
|
(!r || i - r >= t) && (r = i, e(...n));
|
|
1370
1370
|
};
|
|
1371
1371
|
}
|
|
1372
|
-
function
|
|
1373
|
-
let n, i,
|
|
1372
|
+
function wi(e, t = 300, r = !1) {
|
|
1373
|
+
let n, i, a, 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 || (a = e.apply(i, n), i = n = null));
|
|
1377
1377
|
}
|
|
1378
1378
|
t ??= 100;
|
|
1379
1379
|
let d = function() {
|
|
1380
1380
|
i = 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 && (a = e.apply(i, n), i = n = null), a;
|
|
1383
1383
|
};
|
|
1384
1384
|
return d.clear = function() {
|
|
1385
1385
|
l &&= (clearTimeout(l), null);
|
|
1386
1386
|
}, d.flush = function() {
|
|
1387
|
-
l &&= (
|
|
1387
|
+
l &&= (a = e.apply(i, n), i = n = null, clearTimeout(l), null);
|
|
1388
1388
|
}, d;
|
|
1389
1389
|
}
|
|
1390
|
-
var
|
|
1390
|
+
var Si = (e) => {
|
|
1391
1391
|
let t, r = !1, n = function() {
|
|
1392
1392
|
r = !1, e(t);
|
|
1393
1393
|
};
|
|
1394
1394
|
return function(i) {
|
|
1395
|
-
t = i, t && t.persist && t.persist(), r || (r = !0,
|
|
1395
|
+
t = i, t && t.persist && t.persist(), r || (r = !0, Ue(n));
|
|
1396
1396
|
};
|
|
1397
|
-
},
|
|
1398
|
-
if (typeof
|
|
1397
|
+
}, bi = (e) => {
|
|
1398
|
+
if (typeof Ue == "function") Ue(() => {
|
|
1399
1399
|
e();
|
|
1400
1400
|
});
|
|
1401
1401
|
else {
|
|
@@ -1404,47 +1404,47 @@ var hi = (e) => {
|
|
|
1404
1404
|
e();
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
1407
|
-
},
|
|
1408
|
-
|
|
1409
|
-
},
|
|
1410
|
-
let r =
|
|
1411
|
-
|
|
1407
|
+
}, At = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), vi = (e) => {
|
|
1408
|
+
gi(e.id);
|
|
1409
|
+
}, Ei = (e, t) => {
|
|
1410
|
+
let r = At(), n = { id: Ue(function i() {
|
|
1411
|
+
At() - r >= t ? e.call(null) : n.id = Ue(i);
|
|
1412
1412
|
}) };
|
|
1413
1413
|
return n;
|
|
1414
1414
|
};
|
|
1415
|
-
ge({ MESSAGE_ERROR_INVALID_ARG: () =>
|
|
1416
|
-
var
|
|
1415
|
+
ge({ MESSAGE_ERROR_INVALID_ARG: () => _i });
|
|
1416
|
+
var _i = (e) => \`Invalid argument: '\${e}'.\`;
|
|
1417
1417
|
ge({
|
|
1418
|
-
APP_MIME_TYPE: () =>
|
|
1418
|
+
APP_MIME_TYPE: () => xi,
|
|
1419
1419
|
DEFAULT_MIME_TYPE: () => "*/*",
|
|
1420
|
-
JSONStableStringify: () =>
|
|
1421
|
-
arrayBufferToBase64: () =>
|
|
1422
|
-
base64ToArrayBuffer: () =>
|
|
1423
|
-
blobToString: () =>
|
|
1424
|
-
isLittleEndian: () =>
|
|
1425
|
-
isNodeBuffer: () =>
|
|
1426
|
-
isSharedArrayBufferSupported: () =>
|
|
1420
|
+
JSONStableStringify: () => Ri,
|
|
1421
|
+
arrayBufferToBase64: () => Pr,
|
|
1422
|
+
base64ToArrayBuffer: () => Ii,
|
|
1423
|
+
blobToString: () => pt,
|
|
1424
|
+
isLittleEndian: () => Ai,
|
|
1425
|
+
isNodeBuffer: () => Ti,
|
|
1426
|
+
isSharedArrayBufferSupported: () => Ci
|
|
1427
1427
|
});
|
|
1428
|
-
var
|
|
1429
|
-
let t = typeof globalThis.atob == "function" ? globalThis.atob(e) :
|
|
1428
|
+
var xi = "application/octet-stream", Ae = globalThis.Buffer, Ti = (e) => Ae?.isBuffer(e) ?? !1, Ci = typeof SharedArrayBuffer == "function" && (globalThis.crossOriginIsolated === void 0 || globalThis.crossOriginIsolated === !0), Ai = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1, It = globalThis.FileReader, Ii = (e) => {
|
|
1429
|
+
let t = typeof globalThis.atob == "function" ? globalThis.atob(e) : Ae.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
|
|
1430
1430
|
for (let i = 0; i < r; i++) n[i] = t.charCodeAt(i);
|
|
1431
1431
|
return n.buffer;
|
|
1432
|
-
},
|
|
1432
|
+
}, Pr = (e) => {
|
|
1433
1433
|
let t = new Uint8Array(e), r = t.byteLength, n = "";
|
|
1434
1434
|
for (let i = 0; i < r; i++) n += String.fromCharCode(t[i]);
|
|
1435
1435
|
if (typeof globalThis.btoa == "function") return globalThis.btoa(n);
|
|
1436
|
-
if (
|
|
1436
|
+
if (Ae) return Ae.from(n, "binary").toString("base64");
|
|
1437
1437
|
throw Error("Unsupported environment");
|
|
1438
|
-
},
|
|
1439
|
-
if (e) if (
|
|
1440
|
-
let n = new
|
|
1438
|
+
}, pt = (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 = (i) =>
|
|
1446
|
+
} else if (Ae) {
|
|
1447
|
+
let n = (i) => Ae.from(i).toString("utf-8");
|
|
1448
1448
|
e.arrayBuffer().then((i) => {
|
|
1449
1449
|
t(n(i));
|
|
1450
1450
|
}).catch((i) => {
|
|
@@ -1453,7 +1453,7 @@ var bi = "application/octet-stream", Ce = globalThis.Buffer, vi = (e) => Ce?.isB
|
|
|
1453
1453
|
} else r(/* @__PURE__ */ Error("Unsupported environment"));
|
|
1454
1454
|
else t("");
|
|
1455
1455
|
});
|
|
1456
|
-
function
|
|
1456
|
+
function Ri(e, t) {
|
|
1457
1457
|
t ||= {}, typeof t == "function" && (t = { cmp: t });
|
|
1458
1458
|
let r = typeof t.cycles == "boolean" && t.cycles, n = t.cmp && (i = t.cmp, function(l) {
|
|
1459
1459
|
return function(s, c) {
|
|
@@ -1467,7 +1467,7 @@ function Ti(e, t) {
|
|
|
1467
1467
|
};
|
|
1468
1468
|
});
|
|
1469
1469
|
var i;
|
|
1470
|
-
let
|
|
1470
|
+
let a = [];
|
|
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";
|
|
@@ -1475,30 +1475,31 @@ function Ti(e, t) {
|
|
|
1475
1475
|
let c;
|
|
1476
1476
|
if (Array.isArray(s)) {
|
|
1477
1477
|
c = "[";
|
|
1478
|
-
for (let
|
|
1478
|
+
for (let o = 0; o < s.length; o++) o && (c += ","), c += l(s[o]) || "null";
|
|
1479
1479
|
return c + "]";
|
|
1480
1480
|
}
|
|
1481
1481
|
if (s === null) return "null";
|
|
1482
|
-
if (
|
|
1482
|
+
if (a.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 = a.push(s) - 1, m = Object.keys(s).sort(n && n(s));
|
|
1487
1487
|
c = "";
|
|
1488
|
-
for (let
|
|
1489
|
-
let f = m[
|
|
1488
|
+
for (let o = 0; o < m.length; o++) {
|
|
1489
|
+
let f = m[o], b = l(s[f]);
|
|
1490
1490
|
b && (c && (c += ","), c += JSON.stringify(f) + ":" + b);
|
|
1491
1491
|
}
|
|
1492
|
-
return
|
|
1492
|
+
return a.splice(d, 1), "{" + c + "}";
|
|
1493
1493
|
})(e);
|
|
1494
1494
|
}
|
|
1495
|
-
var
|
|
1495
|
+
var $i;
|
|
1496
1496
|
ge({
|
|
1497
|
-
DATA_URL_PNG_PREFIX: () =>
|
|
1498
|
-
getImageDataUrl: () =>
|
|
1499
|
-
|
|
1497
|
+
DATA_URL_PNG_PREFIX: () => Br,
|
|
1498
|
+
getImageDataUrl: () => Ni,
|
|
1499
|
+
getPngStatedSize: () => ki,
|
|
1500
|
+
loadImageDetails: () => Li
|
|
1500
1501
|
});
|
|
1501
|
-
var
|
|
1502
|
+
var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) => new Promise(async (t, r) => {
|
|
1502
1503
|
let n = null;
|
|
1503
1504
|
try {
|
|
1504
1505
|
let i = n = new Image();
|
|
@@ -1507,127 +1508,145 @@ var Fr = "data:image/png;base64,", Dr = "Unable to resolve image.", It = (e) =>
|
|
|
1507
1508
|
width: i.naturalWidth,
|
|
1508
1509
|
height: i.naturalHeight
|
|
1509
1510
|
});
|
|
1510
|
-
}, { once: !0 }), i.addEventListener("error", function(
|
|
1511
|
+
}, { once: !0 }), i.addEventListener("error", function(a) {
|
|
1511
1512
|
URL.revokeObjectURL(e);
|
|
1512
|
-
let l =
|
|
1513
|
+
let l = a?.error?.message ?? "";
|
|
1513
1514
|
l &&= \`: \${l}\`, r(\`Invalid Image\${l}\`);
|
|
1514
1515
|
}, { once: !0 }), await i.decode();
|
|
1515
1516
|
} catch {
|
|
1516
1517
|
n?.src && URL.revokeObjectURL(n.src);
|
|
1517
1518
|
}
|
|
1518
|
-
n || r(Error(
|
|
1519
|
-
}),
|
|
1519
|
+
n || r(Error(jr));
|
|
1520
|
+
}), Ni = (e, t = 1) => new Promise(async (r, n) => {
|
|
1520
1521
|
let i = null;
|
|
1521
1522
|
try {
|
|
1522
|
-
let
|
|
1523
|
-
|
|
1523
|
+
let a = i = new Image();
|
|
1524
|
+
a.src = e, a.addEventListener("load", function() {
|
|
1524
1525
|
try {
|
|
1525
1526
|
let l = document.createElement("canvas");
|
|
1526
|
-
l.width =
|
|
1527
|
+
l.width = a.naturalWidth, l.height = a.naturalHeight;
|
|
1527
1528
|
let s = l.getContext("2d");
|
|
1528
1529
|
if (!s) throw Error("Unable to create 2d context");
|
|
1529
|
-
s.drawImage(
|
|
1530
|
+
s.drawImage(a, 0, 0);
|
|
1530
1531
|
let c = l.toDataURL("image/png", t);
|
|
1531
1532
|
r({
|
|
1532
|
-
elemImg:
|
|
1533
|
+
elemImg: a,
|
|
1533
1534
|
dataUrl: c
|
|
1534
1535
|
});
|
|
1535
1536
|
} catch (l) {
|
|
1536
1537
|
URL.revokeObjectURL(e), n(l);
|
|
1537
1538
|
}
|
|
1538
|
-
}, { once: !0 }),
|
|
1539
|
+
}, { once: !0 }), a.addEventListener("error", function() {
|
|
1539
1540
|
URL.revokeObjectURL(e), n("Invalid Image");
|
|
1540
|
-
}, { once: !0 }), await
|
|
1541
|
+
}, { once: !0 }), await a.decode();
|
|
1541
1542
|
} catch {
|
|
1542
1543
|
i?.src && URL.revokeObjectURL(i.src);
|
|
1543
1544
|
}
|
|
1544
|
-
i || n(Error(
|
|
1545
|
-
}),
|
|
1545
|
+
i || n(Error(jr));
|
|
1546
|
+
}), $t = [2303741511, 218765834], Nt = 96 / .0254, ki = (e) => {
|
|
1547
|
+
let t = new DataView(e);
|
|
1548
|
+
if (t.byteLength < 24 || t.getUint32(0) !== $t[0] || t.getUint32(4) !== $t[1]) return null;
|
|
1549
|
+
let r = 8;
|
|
1550
|
+
for (; r + 8 <= t.byteLength;) {
|
|
1551
|
+
let n = t.getUint32(r), i = t.getUint32(r + 4);
|
|
1552
|
+
if (i === 1229209940) return null;
|
|
1553
|
+
if (i === 1883789683) {
|
|
1554
|
+
if (n !== 9 || r + 17 > t.byteLength) return null;
|
|
1555
|
+
let a = t.getUint32(r + 8), l = t.getUint32(r + 12);
|
|
1556
|
+
return t.getUint8(r + 16) === 1 && a && l ? {
|
|
1557
|
+
width: Math.max(1, Math.round(t.getUint32(16) * Nt / a)),
|
|
1558
|
+
height: Math.max(1, Math.round(t.getUint32(20) * Nt / l))
|
|
1559
|
+
} : null;
|
|
1560
|
+
}
|
|
1561
|
+
r += 12 + n;
|
|
1562
|
+
}
|
|
1563
|
+
return null;
|
|
1564
|
+
}, nt = "image/svg+xml", Li = async (e, t = null) => {
|
|
1546
1565
|
let r = null, n = async () => {
|
|
1547
1566
|
try {
|
|
1548
|
-
let
|
|
1567
|
+
let a = t ?? "image/*", l = URL.createObjectURL(new Blob([e], { type: a }));
|
|
1549
1568
|
r = {
|
|
1550
|
-
mimeType:
|
|
1551
|
-
naturalSize: await
|
|
1569
|
+
mimeType: a,
|
|
1570
|
+
naturalSize: await Rt(l),
|
|
1552
1571
|
asUrl: l
|
|
1553
1572
|
};
|
|
1554
1573
|
} catch {}
|
|
1555
1574
|
}, i = async () => {
|
|
1556
1575
|
try {
|
|
1557
|
-
let
|
|
1576
|
+
let a = new TextDecoder().decode(e), l = URL.createObjectURL(new Blob([a], { type: nt })), s = await Rt(l);
|
|
1558
1577
|
r = {
|
|
1559
|
-
mimeType: t ??
|
|
1578
|
+
mimeType: t ?? nt,
|
|
1560
1579
|
naturalSize: s,
|
|
1561
1580
|
asUrl: l,
|
|
1562
|
-
asSVGText:
|
|
1581
|
+
asSVGText: a
|
|
1563
1582
|
};
|
|
1564
1583
|
} catch {}
|
|
1565
1584
|
};
|
|
1566
|
-
if (t ===
|
|
1585
|
+
if (t === nt ? await i() : t?.startsWith("image/") ? await n() : (await n(), r || await i()), !r) throw Error("Failed to load image");
|
|
1567
1586
|
return r;
|
|
1568
|
-
},
|
|
1569
|
-
|
|
1587
|
+
}, kt = /* @__PURE__ */ new Set(), Mi = (e) => {
|
|
1588
|
+
kt.has(e) || (kt.add(e), console.warn(\`Unknown property '\${e}' in update; ignoring.\`));
|
|
1570
1589
|
};
|
|
1571
1590
|
(function(e) {
|
|
1572
1591
|
e.PassThrough = Object.freeze({});
|
|
1573
|
-
let t = e.resolveTypedUpdates = (r, n, i,
|
|
1592
|
+
let t = e.resolveTypedUpdates = (r, n, i, a, l = !1) => {
|
|
1574
1593
|
if (r === null) return r;
|
|
1575
|
-
if (r === void 0) return
|
|
1594
|
+
if (r === void 0) return a;
|
|
1576
1595
|
let s = r;
|
|
1577
1596
|
if (n?.shorthand) {
|
|
1578
|
-
let
|
|
1579
|
-
|
|
1597
|
+
let o = n?.shorthand(r, i);
|
|
1598
|
+
o !== void 0 && (s = o);
|
|
1580
1599
|
}
|
|
1581
1600
|
if (s !== null && n?.getSubType) {
|
|
1582
|
-
let
|
|
1583
|
-
|
|
1601
|
+
let o = n.getSubType(s, a);
|
|
1602
|
+
o && (n = o);
|
|
1584
1603
|
}
|
|
1585
1604
|
let c = n?.properties, d = n?.arrayType ?? !1, m = s;
|
|
1586
|
-
if (n && n.merge && m &&
|
|
1605
|
+
if (n && n.merge && m && a) m = n.merge(m, a, i);
|
|
1587
1606
|
else if (!d && c) {
|
|
1588
|
-
let
|
|
1607
|
+
let o = Object.keys({
|
|
1589
1608
|
...s,
|
|
1590
|
-
...
|
|
1609
|
+
...a
|
|
1591
1610
|
});
|
|
1592
1611
|
m = null;
|
|
1593
|
-
let f =
|
|
1612
|
+
let f = o.length;
|
|
1594
1613
|
for (let b = 0; b < f; b++) {
|
|
1595
|
-
let
|
|
1596
|
-
if (
|
|
1597
|
-
let h = c[
|
|
1614
|
+
let S = o[b], A, k = s?.[S];
|
|
1615
|
+
if (k !== void 0) {
|
|
1616
|
+
let h = c[S];
|
|
1598
1617
|
if (!h) {
|
|
1599
|
-
|
|
1618
|
+
Mi(S);
|
|
1600
1619
|
continue;
|
|
1601
1620
|
}
|
|
1602
|
-
A = t(
|
|
1603
|
-
} else A =
|
|
1604
|
-
A == null ? l &&
|
|
1621
|
+
A = t(k, h, i, a?.[S], l);
|
|
1622
|
+
} else A = a?.[S];
|
|
1623
|
+
A == null ? l && k === null && (m ??= {}, m[S] = null) : (m ??= {}, m[S] = A);
|
|
1605
1624
|
}
|
|
1606
1625
|
}
|
|
1607
1626
|
return m;
|
|
1608
1627
|
};
|
|
1609
|
-
})(
|
|
1610
|
-
var
|
|
1628
|
+
})($i ||= {});
|
|
1629
|
+
var St = {
|
|
1611
1630
|
code: "safari",
|
|
1612
1631
|
message: \`The Safari browser does not support advanced copy and paste.
|
|
1613
1632
|
Copy and paste will be limited to within the browser tab.
|
|
1614
1633
|
|
|
1615
1634
|
Please use Chrome or Edge if external copy and paste is required.\`
|
|
1616
|
-
},
|
|
1635
|
+
}, zr = {
|
|
1617
1636
|
code: "perms",
|
|
1618
1637
|
message: \`You do not have permissions to access the clipboard.
|
|
1619
1638
|
All copy and paste operations will be limited to the browser tab.\`
|
|
1620
|
-
},
|
|
1621
|
-
Safari:
|
|
1622
|
-
Perms:
|
|
1623
|
-
PermsWrite:
|
|
1624
|
-
PermsRead:
|
|
1625
|
-
},
|
|
1639
|
+
}, Lt = qe() === pe.Safari ? St : zr, Oi = {
|
|
1640
|
+
Safari: St,
|
|
1641
|
+
Perms: zr,
|
|
1642
|
+
PermsWrite: Lt,
|
|
1643
|
+
PermsRead: Lt
|
|
1644
|
+
}, it = async () => new Promise((e) => {
|
|
1626
1645
|
document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
|
|
1627
1646
|
e();
|
|
1628
1647
|
}, { once: !0 }), document.activeElement.focus?.();
|
|
1629
|
-
}),
|
|
1630
|
-
if (
|
|
1648
|
+
}), at = async (e, t, r) => {
|
|
1649
|
+
if (qe() === pe.Safari) return await r(Error(St.message));
|
|
1631
1650
|
try {
|
|
1632
1651
|
let n = async (l) => {
|
|
1633
1652
|
try {
|
|
@@ -1640,20 +1659,20 @@ All copy and paste operations will be limited to the browser tab.\`
|
|
|
1640
1659
|
name: e,
|
|
1641
1660
|
allowWithoutGesture: !0,
|
|
1642
1661
|
allowWithoutSanitization: !0
|
|
1643
|
-
}),
|
|
1644
|
-
if (i.state === "prompt" && (
|
|
1662
|
+
}), a = !1;
|
|
1663
|
+
if (i.state === "prompt" && (a = await n(t)), a || i.state !== "granted" || (a = await t()), !a) return await r(Error(i.state));
|
|
1645
1664
|
} catch (n) {
|
|
1646
1665
|
return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
|
|
1647
1666
|
}
|
|
1648
|
-
},
|
|
1667
|
+
}, Kr = async (e) => {
|
|
1649
1668
|
if (!e) return null;
|
|
1650
1669
|
try {
|
|
1651
1670
|
return await e.read({ unsanitized: [J.Html] });
|
|
1652
1671
|
} catch {}
|
|
1653
1672
|
return await e.read();
|
|
1654
|
-
},
|
|
1673
|
+
}, Di = async (e, t) => {
|
|
1655
1674
|
if (!e) return null;
|
|
1656
|
-
let r = await
|
|
1675
|
+
let r = await Kr(e), n = !1;
|
|
1657
1676
|
for (let i = 0; !n && r && i < r.length; i++) if (n = r[i].types.includes(t), n) return await r[i].getType(t);
|
|
1658
1677
|
return null;
|
|
1659
1678
|
};
|
|
@@ -1662,12 +1681,12 @@ if (!globalThis.ClipboardItem) {
|
|
|
1662
1681
|
class t {
|
|
1663
1682
|
constructor(n, i) {
|
|
1664
1683
|
this._items = {}, this._types = Object.keys(n);
|
|
1665
|
-
let
|
|
1684
|
+
let a = {}, l = Object.keys(n);
|
|
1666
1685
|
for (let s = 0; s < l.length; s++) {
|
|
1667
1686
|
let c = l[s], d = n[c];
|
|
1668
|
-
|
|
1687
|
+
a[c] = typeof d == "string" ? e(c, d) : d;
|
|
1669
1688
|
}
|
|
1670
|
-
this._items =
|
|
1689
|
+
this._items = a, this._presentationStyle = i?.presentationStyle ?? "unspecified";
|
|
1671
1690
|
}
|
|
1672
1691
|
get types() {
|
|
1673
1692
|
return this._types;
|
|
@@ -1681,22 +1700,22 @@ if (!globalThis.ClipboardItem) {
|
|
|
1681
1700
|
}
|
|
1682
1701
|
globalThis.ClipboardItem = t;
|
|
1683
1702
|
}
|
|
1684
|
-
var
|
|
1703
|
+
var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
1685
1704
|
try {
|
|
1686
|
-
let i = await
|
|
1705
|
+
let i = await Di(e, t);
|
|
1687
1706
|
if (i) {
|
|
1688
|
-
let
|
|
1689
|
-
|
|
1690
|
-
r(
|
|
1691
|
-
},
|
|
1707
|
+
let a = new FileReader();
|
|
1708
|
+
a.onload = () => {
|
|
1709
|
+
r(a.result);
|
|
1710
|
+
}, a.onerror = () => {
|
|
1692
1711
|
r("");
|
|
1693
|
-
},
|
|
1712
|
+
}, a.readAsText(i);
|
|
1694
1713
|
} else r("");
|
|
1695
1714
|
} catch (i) {
|
|
1696
1715
|
n(i);
|
|
1697
1716
|
}
|
|
1698
|
-
}),
|
|
1699
|
-
let r = await
|
|
1717
|
+
}), Ot = async (e, t = J.Html) => {
|
|
1718
|
+
let r = await mt(e, t);
|
|
1700
1719
|
if (!r) return null;
|
|
1701
1720
|
let n = null;
|
|
1702
1721
|
try {
|
|
@@ -1705,28 +1724,28 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1705
1724
|
console.warn("Can't parse html from clipboard.");
|
|
1706
1725
|
}
|
|
1707
1726
|
return n;
|
|
1708
|
-
},
|
|
1727
|
+
}, Fi = async (e) => {
|
|
1709
1728
|
e && await e.writeText("");
|
|
1710
|
-
},
|
|
1729
|
+
}, Pe = "clipboard-uuid", Me = "web text/uuid", Dt = (e) => \`<div style="display:none" \${Pe}="\${e}"/>\`, Ft = { type: J.Plain }, Ut = { type: J.Html }, Pt = { type: Me }, Ui = (e, t) => {
|
|
1711
1730
|
let r = null;
|
|
1712
1731
|
try {
|
|
1713
1732
|
let n = new DOMParser().parseFromString(t, J.Html);
|
|
1714
|
-
n.body.firstElementChild?.setAttribute(
|
|
1733
|
+
n.body.firstElementChild?.setAttribute(Pe, e), r = n.getElementsByTagName("body")[0].innerHTML;
|
|
1715
1734
|
} catch (n) {
|
|
1716
1735
|
console.warn("Can't embed uuid.", n);
|
|
1717
1736
|
}
|
|
1718
1737
|
return r;
|
|
1719
|
-
},
|
|
1738
|
+
}, Bt = (e, t) => {
|
|
1720
1739
|
if (!t || !e) return !1;
|
|
1721
1740
|
try {
|
|
1722
|
-
let r = t.querySelectorAll(\`[\${
|
|
1741
|
+
let r = t.querySelectorAll(\`[\${Pe}="\${e}"]\`);
|
|
1723
1742
|
if (r && r.length === 1) return !0;
|
|
1724
1743
|
if (t.querySelector("parsererror")) throw Error("We are unable to parse node");
|
|
1725
1744
|
return !1;
|
|
1726
1745
|
} catch {
|
|
1727
1746
|
return !1;
|
|
1728
1747
|
}
|
|
1729
|
-
},
|
|
1748
|
+
}, jt = class {
|
|
1730
1749
|
constructor(e) {
|
|
1731
1750
|
if (this._state = null, this._nativeClipboard = null, this._onFocus = null, this._onBlur = null, e?.nativeClipboard === void 0 || e?.nativeClipboard === !0) try {
|
|
1732
1751
|
this._nativeClipboard = globalThis?.navigator.clipboard;
|
|
@@ -1737,14 +1756,14 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1737
1756
|
this._disableCheckOnFocus = e?.disableCheckOnFocus ?? !1, this._init();
|
|
1738
1757
|
}
|
|
1739
1758
|
async _checkForChanges() {
|
|
1740
|
-
this._nativeClipboard && this._state && !this._disableCheckOnFocus && await
|
|
1741
|
-
await
|
|
1742
|
-
let e = await
|
|
1759
|
+
this._nativeClipboard && this._state && !this._disableCheckOnFocus && await at("clipboard-read", async () => {
|
|
1760
|
+
await it();
|
|
1761
|
+
let e = await mt(this._nativeClipboard, Me);
|
|
1743
1762
|
if (!this._state || e && e === this._state.uuid) return !0;
|
|
1744
|
-
let t = await
|
|
1745
|
-
return !this._state || (
|
|
1763
|
+
let t = await Ot(this._nativeClipboard, J.Html);
|
|
1764
|
+
return !this._state || (Bt(this._state.uuid, t) || this.clear(), !0);
|
|
1746
1765
|
}, async (e) => {
|
|
1747
|
-
e?.message === "denied" || e.message?.includes("Document is not focused") ||
|
|
1766
|
+
e?.message === "denied" || e.message?.includes("Document is not focused") || qe() === pe.Safari || console.warn("Unable to detect clipboard changes: ", e);
|
|
1748
1767
|
});
|
|
1749
1768
|
}
|
|
1750
1769
|
_init() {
|
|
@@ -1760,15 +1779,15 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1760
1779
|
async read() {
|
|
1761
1780
|
if (!this._nativeClipboard) return this._state?.items ?? null;
|
|
1762
1781
|
let e = this;
|
|
1763
|
-
return await
|
|
1764
|
-
if (await
|
|
1765
|
-
let t = await
|
|
1782
|
+
return await at("clipboard-read", async () => {
|
|
1783
|
+
if (await it(), this._state?.uuid) {
|
|
1784
|
+
let t = await mt(this._nativeClipboard, Me);
|
|
1766
1785
|
if (t && t === e._state?.uuid) return !0;
|
|
1767
|
-
let r = await
|
|
1768
|
-
if (
|
|
1786
|
+
let r = await Ot(this._nativeClipboard, J.Html);
|
|
1787
|
+
if (Bt(e._state?.uuid, r)) return !0;
|
|
1769
1788
|
}
|
|
1770
1789
|
return e._state = {
|
|
1771
|
-
items: await
|
|
1790
|
+
items: await Kr(this._nativeClipboard),
|
|
1772
1791
|
uuid: null,
|
|
1773
1792
|
ref: null
|
|
1774
1793
|
}, this.dispatchEvent(new Event("clipboardread")), !0;
|
|
@@ -1778,51 +1797,51 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1778
1797
|
}
|
|
1779
1798
|
async write(e) {
|
|
1780
1799
|
return this._write({
|
|
1781
|
-
uuid:
|
|
1800
|
+
uuid: He(),
|
|
1782
1801
|
items: e,
|
|
1783
1802
|
ref: null
|
|
1784
1803
|
});
|
|
1785
1804
|
}
|
|
1786
1805
|
async _write(e) {
|
|
1787
1806
|
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, i = e.items ?? [],
|
|
1807
|
+
let t = this, r = [], n = e.uuid, i = e.items ?? [], a = () => {
|
|
1789
1808
|
t._state = {
|
|
1790
1809
|
uuid: n,
|
|
1791
1810
|
ref: e.ref,
|
|
1792
1811
|
items: r
|
|
1793
1812
|
}, t.dispatchEvent(new Event("clipboardwrite")), t.dispatchEvent(new Event("clipboardchange"));
|
|
1794
1813
|
};
|
|
1795
|
-
await
|
|
1796
|
-
await
|
|
1814
|
+
await at("clipboard-write", async () => {
|
|
1815
|
+
await it(), n && i.length === 0 && (i.push(new ClipboardItem({ [Me]: new Blob([n], Pt) })), i.push(new ClipboardItem({ [J.Html]: new Blob([Dt(n)], Ut) })));
|
|
1797
1816
|
for (let l = 0; l < Math.min(1, i.length); l++) {
|
|
1798
1817
|
let s = i[l], c = s.types.indexOf(J.Html), d = null;
|
|
1799
|
-
if (c !== -1 && (d = await
|
|
1800
|
-
let
|
|
1801
|
-
if (
|
|
1818
|
+
if (c !== -1 && (d = await pt(await s.getType(J.Html)), d &&= Ui(n, d)), !d && s.types.includes(J.Plain)) {
|
|
1819
|
+
let S = await s.getType(J.Plain);
|
|
1820
|
+
if (S) {
|
|
1802
1821
|
let A = null;
|
|
1803
|
-
typeof
|
|
1822
|
+
typeof S == "string" ? (console.warn("text as string", S), A = S) : A = await pt(S), A && (d = \`<div \${Pe}="\${n}">\${A}</div>\`);
|
|
1804
1823
|
}
|
|
1805
1824
|
}
|
|
1806
1825
|
if (!d && s.types.includes(J.Png)) {
|
|
1807
|
-
let
|
|
1808
|
-
d = \`<div \${
|
|
1826
|
+
let S = Pr(await (await s.getType(J.Png)).arrayBuffer());
|
|
1827
|
+
d = \`<div \${Pe}="\${n}"><img src="\${Br + S}"/></div>\`;
|
|
1809
1828
|
}
|
|
1810
|
-
!d && n && (d =
|
|
1811
|
-
let m = new Blob([d ?? ""],
|
|
1812
|
-
for (let
|
|
1813
|
-
let A = f[
|
|
1814
|
-
|
|
1829
|
+
!d && n && (d = Dt(n));
|
|
1830
|
+
let m = new Blob([d ?? ""], Ut), o = {}, f = s.types, b = f.length;
|
|
1831
|
+
for (let S = 0; S < b; S++) {
|
|
1832
|
+
let A = f[S];
|
|
1833
|
+
o[A] = S === c ? m : s.getType(A);
|
|
1815
1834
|
}
|
|
1816
|
-
d && c === -1 && (
|
|
1835
|
+
d && c === -1 && (o[J.Html] = m), n && (o[Me] = new Blob([n], Pt)), r.push(new ClipboardItem(o));
|
|
1817
1836
|
}
|
|
1818
1837
|
try {
|
|
1819
|
-
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await
|
|
1838
|
+
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await Fi(this._nativeClipboard);
|
|
1820
1839
|
} catch (l) {
|
|
1821
1840
|
l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
|
|
1822
1841
|
}
|
|
1823
|
-
return
|
|
1842
|
+
return a(), !0;
|
|
1824
1843
|
}, async (l) => {
|
|
1825
|
-
this.dispatchEvent(new Event("clipboarderrorwrite")),
|
|
1844
|
+
this.dispatchEvent(new Event("clipboarderrorwrite")), a();
|
|
1826
1845
|
});
|
|
1827
1846
|
}
|
|
1828
1847
|
async writeReference(e) {
|
|
@@ -1830,7 +1849,7 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1830
1849
|
let t = null, r = {};
|
|
1831
1850
|
try {
|
|
1832
1851
|
let i = await e.toText?.() ?? null;
|
|
1833
|
-
i && (r[J.Plain] = new Blob([i ?? ""],
|
|
1852
|
+
i && (r[J.Plain] = new Blob([i ?? ""], Ft));
|
|
1834
1853
|
} catch (i) {
|
|
1835
1854
|
t = i;
|
|
1836
1855
|
}
|
|
@@ -1847,7 +1866,7 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1847
1866
|
t = i, console.warn("export to png", i);
|
|
1848
1867
|
}
|
|
1849
1868
|
let n = this._write({
|
|
1850
|
-
uuid:
|
|
1869
|
+
uuid: He(),
|
|
1851
1870
|
ref: e,
|
|
1852
1871
|
items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null
|
|
1853
1872
|
});
|
|
@@ -1872,18 +1891,18 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1872
1891
|
s.types.includes(J.Plain) && (n = await s.getType(J.Plain));
|
|
1873
1892
|
}
|
|
1874
1893
|
if (!n) return void e("");
|
|
1875
|
-
let
|
|
1876
|
-
|
|
1877
|
-
e(
|
|
1878
|
-
},
|
|
1894
|
+
let a = new FileReader();
|
|
1895
|
+
a.onload = () => {
|
|
1896
|
+
e(a.result);
|
|
1897
|
+
}, a.readAsText(n), a.onerror = (l) => {
|
|
1879
1898
|
t(l);
|
|
1880
1899
|
};
|
|
1881
1900
|
});
|
|
1882
1901
|
}
|
|
1883
1902
|
async writeText(e) {
|
|
1884
|
-
let t = [new ClipboardItem({ [J.Plain]: new Blob([e],
|
|
1903
|
+
let t = [new ClipboardItem({ [J.Plain]: new Blob([e], Ft) })];
|
|
1885
1904
|
return this._write({
|
|
1886
|
-
uuid:
|
|
1905
|
+
uuid: He(),
|
|
1887
1906
|
items: t,
|
|
1888
1907
|
ref: null
|
|
1889
1908
|
});
|
|
@@ -1896,9 +1915,9 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1896
1915
|
if (!e) return !1;
|
|
1897
1916
|
let t = (r) => {
|
|
1898
1917
|
let n = r.get(e.type);
|
|
1899
|
-
n && n.forEach((i,
|
|
1918
|
+
n && n.forEach((i, a) => {
|
|
1900
1919
|
try {
|
|
1901
|
-
typeof
|
|
1920
|
+
typeof a == "function" ? a(e) : a.handleEvent && a.handleEvent(e), i.once && n.delete(a);
|
|
1902
1921
|
} catch (l) {
|
|
1903
1922
|
console.warn(l);
|
|
1904
1923
|
}
|
|
@@ -1914,10 +1933,10 @@ var $t, dt = async (e, t = J.Html) => new Promise(async (r, n) => {
|
|
|
1914
1933
|
this._onFocus && globalThis.removeEventListener?.("focus", this._onFocus), this._onBlur && globalThis.removeEventListener?.("blur", this._onBlur);
|
|
1915
1934
|
}
|
|
1916
1935
|
};
|
|
1917
|
-
(
|
|
1936
|
+
(Mt = jt ||= {}).ErrorMessages = Oi, Mt.Global = new jt();
|
|
1918
1937
|
Object.freeze({});
|
|
1919
1938
|
new TextDecoder();
|
|
1920
|
-
const
|
|
1939
|
+
const E = Object.freeze({
|
|
1921
1940
|
/** Exported function has no body. */
|
|
1922
1941
|
NoBody: "SXL1001",
|
|
1923
1942
|
/** Anonymous exported function is not allowed. */
|
|
@@ -1936,8 +1955,6 @@ const _ = Object.freeze({
|
|
|
1936
1955
|
UntypedArray: "SXL2005",
|
|
1937
1956
|
/** A generic type must be supplied exactly one type argument. */
|
|
1938
1957
|
GenericArity: "SXL2006",
|
|
1939
|
-
/** A return type cannot combine multiple modifiers (e.g. async + stream). */
|
|
1940
|
-
MultipleModifiers: "SXL2007",
|
|
1941
1958
|
/** A context parameter must be the first parameter. */
|
|
1942
1959
|
ContextNotFirst: "SXL2010",
|
|
1943
1960
|
/** More than one \`Lambda\` parameter. */
|
|
@@ -2003,53 +2020,86 @@ const _ = Object.freeze({
|
|
|
2003
2020
|
/** An enum member has no doc comment. */
|
|
2004
2021
|
EnumMemberUndocumented: "SXL9005"
|
|
2005
2022
|
});
|
|
2006
|
-
var
|
|
2023
|
+
var Xi;
|
|
2007
2024
|
(function(e) {
|
|
2008
2025
|
e.MAX_TEXT_LENGTH = 32767;
|
|
2009
2026
|
let t = e.MAX_SIGNIFICANT_DIGITS = 15;
|
|
2010
|
-
e.truncateNumberText = function(
|
|
2011
|
-
let
|
|
2012
|
-
if (
|
|
2013
|
-
let
|
|
2014
|
-
for (let
|
|
2015
|
-
let
|
|
2016
|
-
if (
|
|
2017
|
-
if (
|
|
2018
|
-
|
|
2019
|
-
} else if ((
|
|
2020
|
-
}
|
|
2021
|
-
return
|
|
2027
|
+
e.truncateNumberText = function(n) {
|
|
2028
|
+
let i = n.length;
|
|
2029
|
+
if (i <= t) return n;
|
|
2030
|
+
let a = 0, l = null;
|
|
2031
|
+
for (let s = 0; s < i; s++) {
|
|
2032
|
+
let c = n.charCodeAt(s);
|
|
2033
|
+
if (c >= 48 && c <= 57) {
|
|
2034
|
+
if (a === 0 && c === 48) continue;
|
|
2035
|
+
a++, a > t && ((l ??= n.split(""))[s] = "0");
|
|
2036
|
+
} else if ((c === 69 || c === 101) && a > 0) break;
|
|
2037
|
+
}
|
|
2038
|
+
return l === null ? n : l.join("");
|
|
2022
2039
|
};
|
|
2023
|
-
|
|
2024
|
-
|
|
2040
|
+
let r = e.MIN_NUMBER = 22250738585072014e-324;
|
|
2041
|
+
e.flushSubnormal = function(n) {
|
|
2042
|
+
return n > -r && n < r ? 0 : n;
|
|
2043
|
+
}, e.isNumberTextInRange = function(n, i = ".") {
|
|
2044
|
+
let a = n.length;
|
|
2045
|
+
if (a < 309 && n.indexOf("E") < 0 && n.indexOf("e") < 0) return !0;
|
|
2046
|
+
let l = i.charCodeAt(0), s = !1, c = !1, d = !1, m = 0, o = 0, f = 0, b = 0;
|
|
2047
|
+
for (; b < a; b++) {
|
|
2048
|
+
let k = n.charCodeAt(b);
|
|
2049
|
+
if (k >= 48 && k <= 57) s = !0, c ? (f++, d || (k === 48 ? o++ : d = !0)) : (d || k !== 48) && (d = !0, m++);
|
|
2050
|
+
else if (k === l) c = !0;
|
|
2051
|
+
else if ((k === 69 || k === 101) && s) break;
|
|
2052
|
+
}
|
|
2053
|
+
let S = 0;
|
|
2054
|
+
if (b < a) {
|
|
2055
|
+
let k = b + 1, h = !1, y = n.charCodeAt(k);
|
|
2056
|
+
y === 45 ? (h = !0, k++) : y === 43 && k++;
|
|
2057
|
+
let w = 0;
|
|
2058
|
+
for (; k < a; k++) {
|
|
2059
|
+
let D = n.charCodeAt(k);
|
|
2060
|
+
if (D < 48 || D > 57) break;
|
|
2061
|
+
S = 10 * S + (D - 48), w++;
|
|
2062
|
+
}
|
|
2063
|
+
if (w === 0) return !0;
|
|
2064
|
+
h && (S = -S);
|
|
2065
|
+
}
|
|
2066
|
+
if (d) {
|
|
2067
|
+
let k = (m > 0 ? m - 1 : -(o + 1)) + S;
|
|
2068
|
+
return k >= -309 && k <= 307;
|
|
2069
|
+
}
|
|
2070
|
+
let A = S - f;
|
|
2071
|
+
return A >= -308 && A <= 308;
|
|
2072
|
+
};
|
|
2073
|
+
})(Xi ||= {});
|
|
2074
|
+
var Xt, ot, Hi, T, me = {
|
|
2025
2075
|
Number: "number",
|
|
2026
2076
|
String: "string",
|
|
2027
2077
|
Boolean: "boolean",
|
|
2028
2078
|
Error: "error",
|
|
2029
2079
|
RichData: "richData",
|
|
2030
2080
|
Null: "null"
|
|
2031
|
-
},
|
|
2081
|
+
}, Ht = {
|
|
2032
2082
|
...me,
|
|
2033
2083
|
Date: "date"
|
|
2034
|
-
},
|
|
2084
|
+
}, Wt = {
|
|
2035
2085
|
...me,
|
|
2036
2086
|
Reference: "reference",
|
|
2037
2087
|
Array: "array",
|
|
2038
2088
|
Lambda: "lambda",
|
|
2039
2089
|
Omitted: "omitted"
|
|
2040
2090
|
};
|
|
2041
|
-
(
|
|
2091
|
+
(ot = Xt ||= {}).Axis = {
|
|
2042
2092
|
Column: "column",
|
|
2043
2093
|
Row: "row"
|
|
2044
|
-
},
|
|
2045
|
-
...
|
|
2094
|
+
}, ot.AxisSelection = {
|
|
2095
|
+
...Xt.Axis,
|
|
2046
2096
|
Both: "both"
|
|
2047
|
-
},
|
|
2097
|
+
}, ot.Direction = {
|
|
2048
2098
|
Up: "up",
|
|
2049
2099
|
Down: "down",
|
|
2050
2100
|
Left: "left",
|
|
2051
2101
|
Right: "right"
|
|
2052
|
-
}, (
|
|
2102
|
+
}, (Hi ||= {}).Aggregate = {
|
|
2053
2103
|
Count: "count",
|
|
2054
2104
|
NumericalCount: "numericalCount",
|
|
2055
2105
|
Sum: "sum",
|
|
@@ -2101,8 +2151,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2101
2151
|
Timeout: "#TIMEOUT!"
|
|
2102
2152
|
};
|
|
2103
2153
|
class n extends Error {
|
|
2104
|
-
constructor(R,
|
|
2105
|
-
super(
|
|
2154
|
+
constructor(R, F, de, we) {
|
|
2155
|
+
super(de, we), this._label = F, this._code = R, this.details = we;
|
|
2106
2156
|
}
|
|
2107
2157
|
static {
|
|
2108
2158
|
this.code = T.Code.Unknown;
|
|
@@ -2128,8 +2178,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2128
2178
|
}
|
|
2129
2179
|
e.Known = n;
|
|
2130
2180
|
class i extends n {
|
|
2131
|
-
constructor(R,
|
|
2132
|
-
super(t.Parse, r.Parse, R,
|
|
2181
|
+
constructor(R, F) {
|
|
2182
|
+
super(t.Parse, r.Parse, R, F);
|
|
2133
2183
|
}
|
|
2134
2184
|
static {
|
|
2135
2185
|
this.code = T.Code.Parse;
|
|
@@ -2145,18 +2195,18 @@ var Kt, nt, Ki, T, me = {
|
|
|
2145
2195
|
}
|
|
2146
2196
|
}
|
|
2147
2197
|
e.Parse = i;
|
|
2148
|
-
class
|
|
2149
|
-
constructor(R,
|
|
2150
|
-
super(t.Null, r.Null, R,
|
|
2198
|
+
class a extends n {
|
|
2199
|
+
constructor(R, F) {
|
|
2200
|
+
super(t.Null, r.Null, R, F);
|
|
2151
2201
|
}
|
|
2152
2202
|
static {
|
|
2153
2203
|
this.code = T.Code.Null;
|
|
2154
2204
|
}
|
|
2155
2205
|
}
|
|
2156
|
-
e.Null =
|
|
2206
|
+
e.Null = a;
|
|
2157
2207
|
class l extends n {
|
|
2158
|
-
constructor(R,
|
|
2159
|
-
super(t.Div0, r.Div0, R,
|
|
2208
|
+
constructor(R, F) {
|
|
2209
|
+
super(t.Div0, r.Div0, R, F);
|
|
2160
2210
|
}
|
|
2161
2211
|
static {
|
|
2162
2212
|
this.code = T.Code.Div0;
|
|
@@ -2164,8 +2214,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2164
2214
|
}
|
|
2165
2215
|
e.Div0 = l;
|
|
2166
2216
|
class s extends n {
|
|
2167
|
-
constructor(R,
|
|
2168
|
-
super(t.Value, r.Value, R,
|
|
2217
|
+
constructor(R, F) {
|
|
2218
|
+
super(t.Value, r.Value, R, F);
|
|
2169
2219
|
}
|
|
2170
2220
|
static {
|
|
2171
2221
|
this.code = T.Code.Value;
|
|
@@ -2173,8 +2223,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2173
2223
|
}
|
|
2174
2224
|
e.Value = s;
|
|
2175
2225
|
class c extends n {
|
|
2176
|
-
constructor(R,
|
|
2177
|
-
super(t.Ref, r.Ref, R,
|
|
2226
|
+
constructor(R, F) {
|
|
2227
|
+
super(t.Ref, r.Ref, R, F);
|
|
2178
2228
|
}
|
|
2179
2229
|
static {
|
|
2180
2230
|
this.code = T.Code.Ref;
|
|
@@ -2182,8 +2232,8 @@ var Kt, nt, Ki, T, me = {
|
|
|
2182
2232
|
}
|
|
2183
2233
|
e.Ref = c;
|
|
2184
2234
|
class d extends n {
|
|
2185
|
-
constructor(R,
|
|
2186
|
-
super(t.Name, r.Name, R,
|
|
2235
|
+
constructor(R, F) {
|
|
2236
|
+
super(t.Name, r.Name, R, F);
|
|
2187
2237
|
}
|
|
2188
2238
|
static {
|
|
2189
2239
|
this.code = T.Code.Name;
|
|
@@ -2191,26 +2241,26 @@ var Kt, nt, Ki, T, me = {
|
|
|
2191
2241
|
}
|
|
2192
2242
|
e.Name = d;
|
|
2193
2243
|
class m extends n {
|
|
2194
|
-
constructor(R,
|
|
2195
|
-
super(t.Num, r.Num, R,
|
|
2244
|
+
constructor(R, F) {
|
|
2245
|
+
super(t.Num, r.Num, R, F);
|
|
2196
2246
|
}
|
|
2197
2247
|
static {
|
|
2198
2248
|
this.code = T.Code.Num;
|
|
2199
2249
|
}
|
|
2200
2250
|
}
|
|
2201
2251
|
e.Num = m;
|
|
2202
|
-
class
|
|
2203
|
-
constructor(R,
|
|
2204
|
-
super(t.NA, r.NA, R,
|
|
2252
|
+
class o extends n {
|
|
2253
|
+
constructor(R, F) {
|
|
2254
|
+
super(t.NA, r.NA, R, F);
|
|
2205
2255
|
}
|
|
2206
2256
|
static {
|
|
2207
2257
|
this.code = T.Code.NA;
|
|
2208
2258
|
}
|
|
2209
2259
|
}
|
|
2210
|
-
e.NA =
|
|
2260
|
+
e.NA = o;
|
|
2211
2261
|
class f extends n {
|
|
2212
|
-
constructor(R,
|
|
2213
|
-
super(t.GettingData, r.GettingData, R,
|
|
2262
|
+
constructor(R, F) {
|
|
2263
|
+
super(t.GettingData, r.GettingData, R, F);
|
|
2214
2264
|
}
|
|
2215
2265
|
static {
|
|
2216
2266
|
this.code = T.Code.GettingData;
|
|
@@ -2218,96 +2268,96 @@ var Kt, nt, Ki, T, me = {
|
|
|
2218
2268
|
}
|
|
2219
2269
|
e.GettingData = f;
|
|
2220
2270
|
class b extends n {
|
|
2221
|
-
constructor(R,
|
|
2222
|
-
super(t.Spill, r.Spill, R,
|
|
2271
|
+
constructor(R, F) {
|
|
2272
|
+
super(t.Spill, r.Spill, R, F);
|
|
2223
2273
|
}
|
|
2224
2274
|
static {
|
|
2225
2275
|
this.code = T.Code.Spill;
|
|
2226
2276
|
}
|
|
2227
2277
|
}
|
|
2228
2278
|
e.Spill = b;
|
|
2229
|
-
class
|
|
2230
|
-
constructor(R,
|
|
2231
|
-
super(t.Connect, r.Connect, R,
|
|
2279
|
+
class S extends n {
|
|
2280
|
+
constructor(R, F) {
|
|
2281
|
+
super(t.Connect, r.Connect, R, F);
|
|
2232
2282
|
}
|
|
2233
2283
|
static {
|
|
2234
2284
|
this.code = T.Code.Connect;
|
|
2235
2285
|
}
|
|
2236
2286
|
}
|
|
2237
|
-
e.Connect =
|
|
2287
|
+
e.Connect = S;
|
|
2238
2288
|
class A extends n {
|
|
2239
|
-
constructor(R,
|
|
2240
|
-
super(t.Blocked, r.Blocked, R,
|
|
2289
|
+
constructor(R, F) {
|
|
2290
|
+
super(t.Blocked, r.Blocked, R, F);
|
|
2241
2291
|
}
|
|
2242
2292
|
static {
|
|
2243
2293
|
this.code = T.Code.Blocked;
|
|
2244
2294
|
}
|
|
2245
2295
|
}
|
|
2246
2296
|
e.Blocked = A;
|
|
2247
|
-
class
|
|
2248
|
-
constructor(R,
|
|
2249
|
-
super(t.Unknown, r.Unknown, R,
|
|
2297
|
+
class k extends n {
|
|
2298
|
+
constructor(R, F) {
|
|
2299
|
+
super(t.Unknown, r.Unknown, R, F);
|
|
2250
2300
|
}
|
|
2251
2301
|
static {
|
|
2252
2302
|
this.code = T.Code.Unknown;
|
|
2253
2303
|
}
|
|
2254
2304
|
}
|
|
2255
|
-
e.Unknown =
|
|
2305
|
+
e.Unknown = k;
|
|
2256
2306
|
class h extends n {
|
|
2257
|
-
constructor(R,
|
|
2258
|
-
super(t.Field, r.Field, R,
|
|
2307
|
+
constructor(R, F) {
|
|
2308
|
+
super(t.Field, r.Field, R, F);
|
|
2259
2309
|
}
|
|
2260
2310
|
static {
|
|
2261
2311
|
this.code = T.Code.Field;
|
|
2262
2312
|
}
|
|
2263
2313
|
}
|
|
2264
2314
|
e.Field = h;
|
|
2265
|
-
class
|
|
2266
|
-
constructor(R,
|
|
2267
|
-
super(t.Calc, r.Calc, R,
|
|
2315
|
+
class y extends n {
|
|
2316
|
+
constructor(R, F) {
|
|
2317
|
+
super(t.Calc, r.Calc, R, F);
|
|
2268
2318
|
}
|
|
2269
2319
|
static {
|
|
2270
2320
|
this.code = T.Code.Calc;
|
|
2271
2321
|
}
|
|
2272
2322
|
}
|
|
2273
|
-
e.Calc =
|
|
2274
|
-
class
|
|
2275
|
-
constructor(R,
|
|
2276
|
-
super(t.Busy, r.Busy, R,
|
|
2323
|
+
e.Calc = y;
|
|
2324
|
+
class w extends n {
|
|
2325
|
+
constructor(R, F) {
|
|
2326
|
+
super(t.Busy, r.Busy, R, F);
|
|
2277
2327
|
}
|
|
2278
2328
|
static {
|
|
2279
2329
|
this.code = T.Code.Busy;
|
|
2280
2330
|
}
|
|
2281
2331
|
}
|
|
2282
|
-
e.Busy =
|
|
2283
|
-
class
|
|
2284
|
-
constructor(R,
|
|
2285
|
-
super(t.Python, r.Python, R,
|
|
2332
|
+
e.Busy = w;
|
|
2333
|
+
class D extends n {
|
|
2334
|
+
constructor(R, F) {
|
|
2335
|
+
super(t.Python, r.Python, R, F);
|
|
2286
2336
|
}
|
|
2287
2337
|
static {
|
|
2288
2338
|
this.code = T.Code.Python;
|
|
2289
2339
|
}
|
|
2290
2340
|
}
|
|
2291
|
-
e.Python =
|
|
2292
|
-
class
|
|
2293
|
-
constructor(R,
|
|
2294
|
-
super(t.Timeout, r.Timeout, R,
|
|
2341
|
+
e.Python = D;
|
|
2342
|
+
class K extends n {
|
|
2343
|
+
constructor(R, F) {
|
|
2344
|
+
super(t.Timeout, r.Timeout, R, F);
|
|
2295
2345
|
}
|
|
2296
2346
|
static {
|
|
2297
2347
|
this.code = T.Code.Timeout;
|
|
2298
2348
|
}
|
|
2299
2349
|
}
|
|
2300
|
-
e.Timeout =
|
|
2350
|
+
e.Timeout = K;
|
|
2301
2351
|
})(T ||= {});
|
|
2302
|
-
var
|
|
2303
|
-
|
|
2304
|
-
var
|
|
2305
|
-
for (let e = 0; e <
|
|
2306
|
-
let t =
|
|
2307
|
-
|
|
2352
|
+
var ee = {};
|
|
2353
|
+
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;
|
|
2354
|
+
var Xr = /* @__PURE__ */ new Map(), Hr = /* @__PURE__ */ new Map(), Wr = /* @__PURE__ */ new Map(), Jr = /* @__PURE__ */ new Map(), Jt = Object.keys(ee);
|
|
2355
|
+
for (let e = 0; e < Jt.length; e++) {
|
|
2356
|
+
let t = ee[Jt[e]], r = new t();
|
|
2357
|
+
Wr.set(r.getLabel(), t), Jr.set(r.getCode(), t), Xr.set(r.getLabel(), r), Hr.set(r.getCode(), r);
|
|
2308
2358
|
}
|
|
2309
2359
|
(function(e) {
|
|
2310
|
-
let t = e.getBuiltInByCode = (r) =>
|
|
2360
|
+
let t = e.getBuiltInByCode = (r) => Hr.get(r);
|
|
2311
2361
|
e.BuiltIn = {
|
|
2312
2362
|
Parse: t(T.Code.Parse),
|
|
2313
2363
|
Null: t(T.Code.Null),
|
|
@@ -2328,42 +2378,42 @@ for (let e = 0; e < Xt.length; e++) {
|
|
|
2328
2378
|
Python: t(T.Code.Python),
|
|
2329
2379
|
Timeout: t(T.Code.Timeout)
|
|
2330
2380
|
}, e.newTypedError = (r, n, i) => {
|
|
2331
|
-
let
|
|
2332
|
-
return
|
|
2333
|
-
}, e.getBuiltInByLabel = (r) =>
|
|
2381
|
+
let a;
|
|
2382
|
+
return a = typeof r == "string" ? Wr.get(r) : Jr.get(r), a ||= T.Unknown, new a(n, i);
|
|
2383
|
+
}, e.getBuiltInByLabel = (r) => Xr.get(r), e.isError = function(r, n) {
|
|
2334
2384
|
return !!r && r.isFormulaError === !0 && (n === void 0 || r.getCode() === n);
|
|
2335
2385
|
};
|
|
2336
2386
|
})(T ||= {});
|
|
2337
|
-
var
|
|
2387
|
+
var Wi = class {
|
|
2338
2388
|
createRange(e, t, r) {
|
|
2339
|
-
throw
|
|
2389
|
+
throw le("createRange");
|
|
2340
2390
|
}
|
|
2341
2391
|
flattenAreas(e) {
|
|
2342
|
-
throw
|
|
2392
|
+
throw le("flattenAreas");
|
|
2343
2393
|
}
|
|
2344
2394
|
getReference(e, t) {
|
|
2345
|
-
throw
|
|
2395
|
+
throw le("getReference");
|
|
2346
2396
|
}
|
|
2347
2397
|
getResizedReference(e, t, r) {
|
|
2348
|
-
throw
|
|
2398
|
+
throw le("getResizedReference");
|
|
2349
2399
|
}
|
|
2350
2400
|
getNumberFormat(e, t) {
|
|
2351
|
-
throw
|
|
2401
|
+
throw le("getNumberFormat");
|
|
2352
2402
|
}
|
|
2353
2403
|
fromSerialDate(e, t) {
|
|
2354
|
-
throw
|
|
2404
|
+
throw le("fromSerialDate");
|
|
2355
2405
|
}
|
|
2356
2406
|
toSerialDate(e, t) {
|
|
2357
|
-
throw
|
|
2407
|
+
throw le("toSerialDate");
|
|
2358
2408
|
}
|
|
2359
2409
|
getDateParts(e, t) {
|
|
2360
|
-
throw
|
|
2410
|
+
throw le("getDateParts");
|
|
2361
2411
|
}
|
|
2362
|
-
getSerialDate(e, t, r, n, i,
|
|
2363
|
-
throw
|
|
2412
|
+
getSerialDate(e, t, r, n, i, a, l) {
|
|
2413
|
+
throw le("getSerialDate");
|
|
2364
2414
|
}
|
|
2365
2415
|
getNow() {
|
|
2366
|
-
throw
|
|
2416
|
+
throw le("getNow");
|
|
2367
2417
|
}
|
|
2368
2418
|
getRandom() {
|
|
2369
2419
|
return Math.random();
|
|
@@ -2372,10 +2422,10 @@ var zi = class {
|
|
|
2372
2422
|
return null;
|
|
2373
2423
|
}
|
|
2374
2424
|
getEntireCoords() {
|
|
2375
|
-
return
|
|
2425
|
+
return qr;
|
|
2376
2426
|
}
|
|
2377
2427
|
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 >
|
|
2428
|
+
return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]" ? !isNaN(e.getTime()) : !t && typeof e == "number" && !(e < 0 || e > qi);
|
|
2379
2429
|
}
|
|
2380
2430
|
getRow() {
|
|
2381
2431
|
return 0;
|
|
@@ -2399,6 +2449,7 @@ var zi = class {
|
|
|
2399
2449
|
return 1;
|
|
2400
2450
|
}
|
|
2401
2451
|
markVolatile() {}
|
|
2452
|
+
defer(e, t) {}
|
|
2402
2453
|
formatResults(e) {}
|
|
2403
2454
|
filterHidden(e, t) {
|
|
2404
2455
|
return e;
|
|
@@ -2410,22 +2461,22 @@ var zi = class {
|
|
|
2410
2461
|
return null;
|
|
2411
2462
|
}
|
|
2412
2463
|
getAddress(e, t) {
|
|
2413
|
-
throw
|
|
2464
|
+
throw le("getAddress");
|
|
2414
2465
|
}
|
|
2415
2466
|
parseAsSerialDate(e, t) {
|
|
2416
|
-
throw
|
|
2467
|
+
throw le("parseAsSerialDate");
|
|
2417
2468
|
}
|
|
2418
2469
|
parseAsDate(e, t) {
|
|
2419
|
-
throw
|
|
2470
|
+
throw le("parseAsDate");
|
|
2420
2471
|
}
|
|
2421
2472
|
parseAsNumber(e, t) {
|
|
2422
|
-
throw
|
|
2473
|
+
throw le("parseAsNumber");
|
|
2423
2474
|
}
|
|
2424
2475
|
createCriteria(e, t) {
|
|
2425
|
-
throw
|
|
2476
|
+
throw le("createCriteria");
|
|
2426
2477
|
}
|
|
2427
2478
|
createGrouping(e, t) {
|
|
2428
|
-
throw
|
|
2479
|
+
throw le("createGrouping");
|
|
2429
2480
|
}
|
|
2430
2481
|
parseAsLiteral(e) {
|
|
2431
2482
|
let t = e.toUpperCase();
|
|
@@ -2436,16 +2487,19 @@ var zi = class {
|
|
|
2436
2487
|
}
|
|
2437
2488
|
compare(e, t, r) {
|
|
2438
2489
|
if (e === t) return 0;
|
|
2439
|
-
let n =
|
|
2490
|
+
let n = Yt(e), i = Yt(t);
|
|
2440
2491
|
return n === i ? e < t ? -1 : +(e > t) : n < i ? -1 : 1;
|
|
2441
2492
|
}
|
|
2442
2493
|
getRuntime() {
|
|
2443
|
-
return
|
|
2494
|
+
return Yi;
|
|
2444
2495
|
}
|
|
2445
2496
|
getArgs() {
|
|
2446
|
-
throw new
|
|
2497
|
+
throw new Je(Yr);
|
|
2498
|
+
}
|
|
2499
|
+
createRichData(e, t) {
|
|
2500
|
+
throw new Je(Ji);
|
|
2447
2501
|
}
|
|
2448
|
-
},
|
|
2502
|
+
}, Yt = (e) => {
|
|
2449
2503
|
if (e == null) return 0;
|
|
2450
2504
|
switch (typeof e) {
|
|
2451
2505
|
case "number": return 1;
|
|
@@ -2453,19 +2507,19 @@ var zi = class {
|
|
|
2453
2507
|
case "boolean": return 3;
|
|
2454
2508
|
default: return 4;
|
|
2455
2509
|
}
|
|
2456
|
-
},
|
|
2510
|
+
}, le = (e) => new Je(\`FormulaContext.\${e}() is only valid while a function body is running. A deferred executor reads its workbook through ctx.getFormulaContext().\`), Yr = "FormulaContext.getArgs() is only valid while a function body is running", Ji = "FormulaContext.createRichData() needs a workbook being calculated", Je = class extends Error {
|
|
2457
2511
|
constructor(e = "Not implemented in StubbedFormulaContext") {
|
|
2458
2512
|
super(e), this.name = "NotImplementedError";
|
|
2459
2513
|
}
|
|
2460
|
-
},
|
|
2514
|
+
}, qr = Object.freeze({
|
|
2461
2515
|
colStart: 0,
|
|
2462
2516
|
rowStart: 0,
|
|
2463
2517
|
colEnd: 2 ** 14 - 1,
|
|
2464
2518
|
rowEnd: 2 ** 20 - 1
|
|
2465
|
-
}),
|
|
2519
|
+
}), Yi = {
|
|
2466
2520
|
isDate1904: () => !1,
|
|
2467
|
-
getLocale: () =>
|
|
2468
|
-
getLocaleProfile: () =>
|
|
2521
|
+
getLocale: () => qt.tag,
|
|
2522
|
+
getLocaleProfile: () => qt,
|
|
2469
2523
|
isR1C1: () => !1,
|
|
2470
2524
|
getNow: () => 0,
|
|
2471
2525
|
getRandom: () => Math.random(),
|
|
@@ -2474,12 +2528,12 @@ var zi = class {
|
|
|
2474
2528
|
getOS: () => "unknown",
|
|
2475
2529
|
getUser: () => "unidentified",
|
|
2476
2530
|
getDescription: () => "Stubbed Formula Context"
|
|
2477
|
-
},
|
|
2531
|
+
}, qi = 2958465, ke = new Wi(), Zi = class {
|
|
2478
2532
|
constructor() {
|
|
2479
|
-
this._scope =
|
|
2533
|
+
this._scope = ke, this._argsFn = null;
|
|
2480
2534
|
}
|
|
2481
2535
|
_setScope(e) {
|
|
2482
|
-
this._scope = e ??
|
|
2536
|
+
this._scope = e ?? ke;
|
|
2483
2537
|
}
|
|
2484
2538
|
_getScope() {
|
|
2485
2539
|
return this._scope;
|
|
@@ -2491,7 +2545,7 @@ var zi = class {
|
|
|
2491
2545
|
return this._getScope().getNumberFormat(e, t);
|
|
2492
2546
|
}
|
|
2493
2547
|
getEntireCoords() {
|
|
2494
|
-
return this._getScope().getEntireCoords() ??
|
|
2548
|
+
return this._getScope().getEntireCoords() ?? qr;
|
|
2495
2549
|
}
|
|
2496
2550
|
parseAsSerialDate(e, t) {
|
|
2497
2551
|
return this._getScope().parseAsSerialDate(e, t);
|
|
@@ -2510,7 +2564,7 @@ var zi = class {
|
|
|
2510
2564
|
}
|
|
2511
2565
|
parseAsLiteral(e) {
|
|
2512
2566
|
let t = this._getScope();
|
|
2513
|
-
return t.parseAsLiteral ? t.parseAsLiteral(e) :
|
|
2567
|
+
return t.parseAsLiteral ? t.parseAsLiteral(e) : ke.parseAsLiteral(e);
|
|
2514
2568
|
}
|
|
2515
2569
|
toText(e) {
|
|
2516
2570
|
return this._getScope().toText(e);
|
|
@@ -2527,8 +2581,8 @@ var zi = class {
|
|
|
2527
2581
|
getDateParts(e, t) {
|
|
2528
2582
|
return this._getScope().getDateParts(e, t);
|
|
2529
2583
|
}
|
|
2530
|
-
getSerialDate(e, t, r, n = 0, i = 0,
|
|
2531
|
-
return this._getScope().getSerialDate(e, t, r, n, i,
|
|
2584
|
+
getSerialDate(e, t, r, n = 0, i = 0, a = 0, l = 0) {
|
|
2585
|
+
return this._getScope().getSerialDate(e, t, r, n, i, a, l);
|
|
2532
2586
|
}
|
|
2533
2587
|
getNow() {
|
|
2534
2588
|
return this._getScope().getNow();
|
|
@@ -2543,8 +2597,8 @@ var zi = class {
|
|
|
2543
2597
|
if (!Array.isArray(e)) return e;
|
|
2544
2598
|
let t = [];
|
|
2545
2599
|
for (let r = 0; r < e.length; r++) {
|
|
2546
|
-
let n = e[r], { rows: i, columns:
|
|
2547
|
-
for (let l = 0; l < i; l++) for (let s = 0; s <
|
|
2600
|
+
let n = e[r], { rows: i, columns: a } = n.getShape();
|
|
2601
|
+
for (let l = 0; l < i; l++) for (let s = 0; s < a; s++) t.push(n.getValueAt(l, s));
|
|
2548
2602
|
}
|
|
2549
2603
|
return this.createRange(t.length, 1, (r, n) => t[n.rowIndex]);
|
|
2550
2604
|
}
|
|
@@ -2581,6 +2635,9 @@ var zi = class {
|
|
|
2581
2635
|
markVolatile() {
|
|
2582
2636
|
this._getScope().markVolatile?.();
|
|
2583
2637
|
}
|
|
2638
|
+
defer(e, t) {
|
|
2639
|
+
return this._getScope().defer?.(e, t);
|
|
2640
|
+
}
|
|
2584
2641
|
formatResults(e) {
|
|
2585
2642
|
this._getScope().formatResults?.(e);
|
|
2586
2643
|
}
|
|
@@ -2597,14 +2654,18 @@ var zi = class {
|
|
|
2597
2654
|
return this._getScope().getAddress(e, t);
|
|
2598
2655
|
}
|
|
2599
2656
|
compare(e, t, r) {
|
|
2600
|
-
return this._getScope().compare?.(e, t, r) ??
|
|
2657
|
+
return this._getScope().compare?.(e, t, r) ?? ke.compare(e, t, r);
|
|
2601
2658
|
}
|
|
2602
2659
|
getRuntime() {
|
|
2603
2660
|
return this._getScope().getRuntime();
|
|
2604
2661
|
}
|
|
2662
|
+
createRichData(e, t) {
|
|
2663
|
+
let r = this._getScope();
|
|
2664
|
+
return r.createRichData ? r.createRichData(e, t) : ke.createRichData(e, t);
|
|
2665
|
+
}
|
|
2605
2666
|
getArgs() {
|
|
2606
2667
|
let e = this._argsFn, t = e ? e() : null;
|
|
2607
|
-
if (!t) throw new
|
|
2668
|
+
if (!t) throw new Je(Yr);
|
|
2608
2669
|
return t;
|
|
2609
2670
|
}
|
|
2610
2671
|
get [Symbol.toStringTag]() {
|
|
@@ -2613,7 +2674,7 @@ var zi = class {
|
|
|
2613
2674
|
toString() {
|
|
2614
2675
|
return this._getScope()?.toString?.() ?? "{STUB SCOPE}";
|
|
2615
2676
|
}
|
|
2616
|
-
},
|
|
2677
|
+
}, qt = Object.freeze({
|
|
2617
2678
|
tag: "en-US",
|
|
2618
2679
|
numberingSystem: "latn",
|
|
2619
2680
|
decimal: ".",
|
|
@@ -2694,8 +2755,8 @@ var zi = class {
|
|
|
2694
2755
|
numeric: !0
|
|
2695
2756
|
})
|
|
2696
2757
|
});
|
|
2697
|
-
new
|
|
2698
|
-
const
|
|
2758
|
+
new Zi();
|
|
2759
|
+
const Qi = [
|
|
2699
2760
|
{
|
|
2700
2761
|
name: "param",
|
|
2701
2762
|
group: "jsdoc",
|
|
@@ -2753,66 +2814,61 @@ const Hi = [
|
|
|
2753
2814
|
group: "jsdoc",
|
|
2754
2815
|
description: "Reference a related function or link."
|
|
2755
2816
|
}
|
|
2756
|
-
],
|
|
2817
|
+
], ea = (() => {
|
|
2757
2818
|
const e = /* @__PURE__ */ new Map();
|
|
2758
|
-
for (const t of
|
|
2819
|
+
for (const t of Qi) if (e.set(t.name, t), t.aliases) for (const r of t.aliases) e.set(r, t);
|
|
2759
2820
|
return e;
|
|
2760
2821
|
})();
|
|
2761
|
-
function
|
|
2822
|
+
function ta(e) {
|
|
2762
2823
|
if (!e) return;
|
|
2763
2824
|
const t = (e.startsWith("@") ? e.slice(1) : e).toLowerCase();
|
|
2764
|
-
return
|
|
2825
|
+
return ea.get(t);
|
|
2765
2826
|
}
|
|
2766
|
-
function
|
|
2767
|
-
return
|
|
2827
|
+
function ra(e) {
|
|
2828
|
+
return ta(e)?.standalone === !0;
|
|
2768
2829
|
}
|
|
2769
|
-
const
|
|
2830
|
+
const ht = /* @__PURE__ */ new Map([["IReferenceRange", "p"], ["IRange", "r"]]), lt = new Set(Object.values(Wt).filter((e) => e !== Wt.Omitted)), bt = /* @__PURE__ */ new Map([
|
|
2770
2831
|
["IWorkbook", "workbook"],
|
|
2771
2832
|
["IWorksheet", "sheet"],
|
|
2772
2833
|
["ICellRanges", "ranges"],
|
|
2773
2834
|
["ICellRange", "range"]
|
|
2774
|
-
]),
|
|
2835
|
+
]), na = Array.from(bt.keys()), vt = (e, t) => {
|
|
2775
2836
|
Array.from(t.keys()).forEach((r) => {
|
|
2776
2837
|
const n = t.get(r);
|
|
2777
2838
|
t.set(\`\${e}.\${r}\`, n);
|
|
2778
2839
|
});
|
|
2779
|
-
},
|
|
2840
|
+
}, ia = /* @__PURE__ */ new Map([
|
|
2780
2841
|
["Scalar", "*"],
|
|
2781
2842
|
["Lambda", "l"],
|
|
2782
2843
|
["FormulaError.Known", me.Error],
|
|
2783
|
-
["Date",
|
|
2784
|
-
["IRichData",
|
|
2785
|
-
]),
|
|
2786
|
-
if (
|
|
2787
|
-
const t =
|
|
2844
|
+
["Date", Ht.Date],
|
|
2845
|
+
["IRichData", Ht.RichData]
|
|
2846
|
+
]), Zr = /* @__PURE__ */ new Map([["Repeating", "repeating"]]), aa = /* @__PURE__ */ new Set(["Flatten", "SheetXL.Flatten"]), Qr = /* @__PURE__ */ new Set(["AcceptError"]), en = /* @__PURE__ */ new Set(["Omittable"]), tn = /* @__PURE__ */ new Set(["NoLift"]), rn = /* @__PURE__ */ new Set(["NoFilter"]), nn = /* @__PURE__ */ new Set(["Lazy"]), gt = /* @__PURE__ */ new Set(["ReportType"]), Zt = 255, oa = /^[a-zA-Z_-][a-zA-Z0-9_.-]*$/, la = /^([a-z]{1,3})([0-9]+)$/i, sa = /^r[0-9]*c[0-9]*$/i, ca = (e) => {
|
|
2847
|
+
if (sa.test(e)) return !0;
|
|
2848
|
+
const t = la.exec(e);
|
|
2788
2849
|
if (!t) return !1;
|
|
2789
2850
|
let r = 0;
|
|
2790
2851
|
for (const i of t[1].toUpperCase()) r = r * 26 + (i.charCodeAt(0) - 64);
|
|
2791
2852
|
const n = Number(t[2]);
|
|
2792
2853
|
return r <= 16384 && n >= 1 && n <= 1048576;
|
|
2793
|
-
}, se = "SheetXL",
|
|
2854
|
+
}, se = "SheetXL", _e = (e) => {
|
|
2794
2855
|
const t = e.typeName.getText();
|
|
2795
2856
|
return t.startsWith(\`\${se}.\`) ? t.slice(8) : t;
|
|
2796
2857
|
};
|
|
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([
|
|
2858
|
+
vt(se, ht);
|
|
2859
|
+
vt(se, bt);
|
|
2860
|
+
vt(se, Zr);
|
|
2861
|
+
Qr.add(se + ".AcceptError");
|
|
2862
|
+
en.add(\`\${se}.Omittable\`);
|
|
2863
|
+
tn.add(\`\${se}.NoLift\`);
|
|
2864
|
+
rn.add(\`\${se}.NoFilter\`);
|
|
2865
|
+
nn.add(\`\${se}.Lazy\`);
|
|
2866
|
+
gt.add(\`\${se}.ReportType\`);
|
|
2867
|
+
const ua = /* @__PURE__ */ new Map([["Volatile", () => ({ volatile: !0 })], [\`\${se}.Volatile\`, () => ({ volatile: !0 })]]), Qt = "__scriptContext__", er = "script", da = /* @__PURE__ */ new Set([
|
|
2812
2868
|
"IScript.ScriptContext",
|
|
2813
2869
|
\`\${se}.IScript.ScriptContext\`,
|
|
2814
2870
|
"ScriptContext"
|
|
2815
|
-
]),
|
|
2871
|
+
]), tr = (e, t) => {
|
|
2816
2872
|
const r = t.literal;
|
|
2817
2873
|
if (r === void 0) return;
|
|
2818
2874
|
const n = e.SyntaxKind;
|
|
@@ -2825,15 +2881,15 @@ const io = /* @__PURE__ */ new Map([
|
|
|
2825
2881
|
case n.PrefixUnaryExpression: return r.operator === n.MinusToken && r.operand?.kind === n.NumericLiteral ? -parseFloat(r.operand.text) : void 0;
|
|
2826
2882
|
default: return;
|
|
2827
2883
|
}
|
|
2828
|
-
},
|
|
2884
|
+
}, Le = (e) => {
|
|
2829
2885
|
if (!e || e.length === 0) return "";
|
|
2830
2886
|
let t = "";
|
|
2831
2887
|
for (let r = 0; r < e.length; r++) {
|
|
2832
2888
|
const n = e[r], i = n.kind;
|
|
2833
2889
|
if (i !== "link") {
|
|
2834
2890
|
if (i === "linkName") {
|
|
2835
|
-
const
|
|
2836
|
-
if (
|
|
2891
|
+
const a = e[r + 1];
|
|
2892
|
+
if (a?.kind === "linkText" && a.text.trim()) continue;
|
|
2837
2893
|
t += n.text;
|
|
2838
2894
|
continue;
|
|
2839
2895
|
}
|
|
@@ -2849,8 +2905,8 @@ const io = /* @__PURE__ */ new Map([
|
|
|
2849
2905
|
\`).map((n) => n.trim()).filter(Boolean).join(" ")).filter(Boolean).join(\`
|
|
2850
2906
|
\`).trim();
|
|
2851
2907
|
};
|
|
2852
|
-
function
|
|
2853
|
-
const i = n?.builtInNames?.length ? new Set(n.builtInNames.map((u) => u.toUpperCase())) : null,
|
|
2908
|
+
function fa(e, t, r, n) {
|
|
2909
|
+
const i = n?.builtInNames?.length ? new Set(n.builtInNames.map((u) => u.toUpperCase())) : null, a = [], l = /* @__PURE__ */ new Map(), s = [];
|
|
2854
2910
|
let c = null;
|
|
2855
2911
|
const d = (u) => {
|
|
2856
2912
|
if (!u || typeof u.getStart != "function") return {
|
|
@@ -2868,783 +2924,782 @@ function ao(e, t, r, n) {
|
|
|
2868
2924
|
length: 0
|
|
2869
2925
|
};
|
|
2870
2926
|
}
|
|
2871
|
-
}, m = (u,
|
|
2872
|
-
const { start: C, length:
|
|
2927
|
+
}, m = (u, p, v, _) => {
|
|
2928
|
+
const { start: C, length: M } = d(u);
|
|
2873
2929
|
s.push({
|
|
2874
2930
|
start: C,
|
|
2875
|
-
length:
|
|
2876
|
-
severity:
|
|
2877
|
-
code:
|
|
2878
|
-
message:
|
|
2931
|
+
length: M,
|
|
2932
|
+
severity: v,
|
|
2933
|
+
code: p,
|
|
2934
|
+
message: _
|
|
2879
2935
|
});
|
|
2880
|
-
},
|
|
2881
|
-
m(u,
|
|
2882
|
-
}, f = (u) => u?.parent?.name?.escapedText
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
const
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2936
|
+
}, o = (u, p, v) => {
|
|
2937
|
+
m(u, p, "error", v);
|
|
2938
|
+
}, f = (u) => u?.parent?.name?.escapedText;
|
|
2939
|
+
let b = null;
|
|
2940
|
+
const S = (u, p, v, _, C = !1, M = !1, z = !1) => {
|
|
2941
|
+
const U = { count: 0 }, $ = te(u, p, v, _, U, C, M, z);
|
|
2942
|
+
U.count >= 2 && (p.range || (p.range = "m", U.count -= 2), !_ && U.count >= 1 && (U.count -= 1, U.count > 0 && o(u, E.ArrayDepth, \`Arrays of more than 2 dimensions are not supported: '\${f(u)}'.\`))), U.count > 0 && (p.arrayDepth = U.count);
|
|
2943
|
+
const B = p.enum;
|
|
2944
|
+
return B && (U.count > (z ? 1 : 0) || p.range) && !K.has(p) && (p.valueOrRange || (o(u, E.EnumPosition, \`A list cannot hold the enum '\${B.id}': '\${p.name ?? f(u)}'. Its members reach the body as they are, so nothing checks them against the enum. Take one value per argument ('...x: \${B.id}[]'), or type the list by its scalar ('\${B.type}').\`), delete p.enum)), $;
|
|
2945
|
+
}, A = (u, p, v, _, C) => {
|
|
2946
|
+
if (p !== "Lambda" && p !== \`\${se}.Lambda\`) return !1;
|
|
2947
|
+
const M = u.typeArguments;
|
|
2948
|
+
let z = "*";
|
|
2949
|
+
if (M && M.length === 2) if (C && M[0].kind === e.SyntaxKind.TupleType && (v.lambdaArity = M[0].elements.length), M[1].kind === e.SyntaxKind.AnyKeyword) z = "raw";
|
|
2892
2950
|
else {
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2951
|
+
const U = {};
|
|
2952
|
+
te(M[1], U, _, !1, { count: 0 }), z = U.scalar ?? "*";
|
|
2895
2953
|
}
|
|
2896
|
-
else if (
|
|
2954
|
+
else if (M && M.length === 1 && M[0].kind !== e.SyntaxKind.TupleType && M[0].kind !== e.SyntaxKind.ArrayType) if (C && (v.lambdaArity = 2), M[0].kind === e.SyntaxKind.AnyKeyword) z = "raw";
|
|
2897
2955
|
else {
|
|
2898
|
-
const
|
|
2899
|
-
|
|
2956
|
+
const U = {};
|
|
2957
|
+
te(M[0], U, _, !1, { count: 0 }), z = U.scalar ?? "*";
|
|
2900
2958
|
}
|
|
2901
|
-
return
|
|
2902
|
-
},
|
|
2903
|
-
if (!
|
|
2904
|
-
|
|
2959
|
+
return v.lambda = z, !0;
|
|
2960
|
+
}, k = (u, p, v, _) => {
|
|
2961
|
+
if (!_) {
|
|
2962
|
+
o(u, E.FunctionReturn, \`Function type is not a valid return type: '\${f(u)}'. Declare a 'Lambda' return instead.\`);
|
|
2905
2963
|
return;
|
|
2906
2964
|
}
|
|
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 (
|
|
2965
|
+
const C = u.type, M = {};
|
|
2966
|
+
let z = "*";
|
|
2967
|
+
C && (C.kind === e.SyntaxKind.AnyKeyword ? z = "raw" : (te(C, M, v, !1, { count: 0 }), z = M.scalar ?? "*"));
|
|
2968
|
+
const U = u.parameters;
|
|
2969
|
+
U && !U.some(($) => $.dotDotDotToken) && (p.lambdaArity = U.length), p.lambda = z;
|
|
2970
|
+
}, h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new WeakSet(), L = (u) => u !== void 0 && u.getSourceFile() === t, R = (u, p = !1) => {
|
|
2971
|
+
return u.getJsDocTags(r).find((_) => _.name === "name")?.text?.map((_) => _.text).join("").trim() || (p ? lr.camelToPrettyCase(u.name) : u.name);
|
|
2972
|
+
}, F = (u) => {
|
|
2973
|
+
const p = u.getJsDocTags(r).find((v) => v.name === "deprecated");
|
|
2974
|
+
if (p) return p.text?.map((v) => v.text).join("").trim() || !0;
|
|
2975
|
+
}, de = (u, p) => {
|
|
2976
|
+
const v = e.isTypeReferenceNode(u) ? u.typeName : void 0, _ = v ? r.getSymbolAtLocation(v) : void 0, C = _?.declarations?.length ? _ : void 0;
|
|
2977
|
+
if (v) {
|
|
2920
2978
|
if (C && C.flags & e.SymbolFlags.Alias) {
|
|
2921
|
-
|
|
2979
|
+
o(u, E.EnumNotLocal, \`'\${v.getText()}' is imported, so its declaration cannot be read: '\${p}'. An enum must be declared in the module that uses it.\`);
|
|
2922
2980
|
return;
|
|
2923
2981
|
}
|
|
2924
2982
|
if (!C || !(C.flags & e.SymbolFlags.Type)) {
|
|
2925
|
-
const x =
|
|
2983
|
+
const x = v.getText();
|
|
2926
2984
|
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
|
-
|
|
2985
|
+
o(u, E.EnumMissingAlias, \`'\${x}' is a value, not a type: '\${p}'. Pair the object with a same-name type — 'type \${x} = typeof \${x}[keyof typeof \${x}];' — or declare it as 'enum \${x} { … }'.\`);
|
|
2928
2986
|
return;
|
|
2929
2987
|
}
|
|
2930
|
-
const
|
|
2931
|
-
if (
|
|
2932
|
-
if (
|
|
2988
|
+
const g = h.get(C);
|
|
2989
|
+
if (g !== void 0) return g;
|
|
2990
|
+
if (D.has(C)) return;
|
|
2933
2991
|
}
|
|
2934
|
-
const
|
|
2935
|
-
let
|
|
2992
|
+
const M = [];
|
|
2993
|
+
let z = !1;
|
|
2936
2994
|
if (C && C.flags & e.SymbolFlags.Enum) {
|
|
2937
|
-
if (!C.declarations?.some(
|
|
2938
|
-
|
|
2995
|
+
if (!C.declarations?.some(L)) {
|
|
2996
|
+
o(u, E.EnumNotLocal, \`'\${C.name}' is not declared in this module: '\${p}'. An enum must be declared in the module that uses it.\`);
|
|
2939
2997
|
return;
|
|
2940
2998
|
}
|
|
2941
|
-
|
|
2942
|
-
let
|
|
2999
|
+
z = !0;
|
|
3000
|
+
let g = !1;
|
|
2943
3001
|
if (C.exports?.forEach((x) => {
|
|
2944
3002
|
const I = x.valueDeclaration;
|
|
2945
3003
|
if (!I || !e.isEnumMember(I)) return;
|
|
2946
3004
|
const V = r.getConstantValue(I);
|
|
2947
3005
|
if (V === void 0) {
|
|
2948
|
-
|
|
3006
|
+
o(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
3007
|
return;
|
|
2950
3008
|
}
|
|
2951
|
-
|
|
2952
|
-
|
|
3009
|
+
M.push([
|
|
3010
|
+
R(x, !0),
|
|
2953
3011
|
V,
|
|
2954
3012
|
I,
|
|
2955
|
-
|
|
2956
|
-
|
|
3013
|
+
Le(x.getDocumentationComment(r)),
|
|
3014
|
+
F(x)
|
|
2957
3015
|
]);
|
|
2958
|
-
}),
|
|
2959
|
-
|
|
3016
|
+
}), g) {
|
|
3017
|
+
D.add(C);
|
|
2960
3018
|
return;
|
|
2961
3019
|
}
|
|
2962
3020
|
} else {
|
|
2963
|
-
const
|
|
2964
|
-
for (const
|
|
2965
|
-
if (!(
|
|
2966
|
-
V.push(
|
|
3021
|
+
const g = r.getTypeFromTypeNode(u), x = e.TypeFlags.Null | e.TypeFlags.Undefined | e.TypeFlags.Void, I = (g.isUnion() ? g.types : [g]).filter((P) => !(P.flags & x)), V = [];
|
|
3022
|
+
for (const P of I) {
|
|
3023
|
+
if (!(P.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral))) return C && h.set(C, null), null;
|
|
3024
|
+
V.push(P.value);
|
|
2967
3025
|
}
|
|
2968
3026
|
if (V.length === 0) return null;
|
|
2969
|
-
const re = C?.declarations?.find((
|
|
2970
|
-
if (
|
|
2971
|
-
const
|
|
3027
|
+
const re = C?.declarations?.find((P) => e.isTypeAliasDeclaration(P)), Y = e.isUnionTypeNode(u) ? u : re?.type;
|
|
3028
|
+
if (Y && e.isUnionTypeNode(Y)) {
|
|
3029
|
+
const P = Y.types.map((N) => {
|
|
2972
3030
|
const ne = r.getTypeFromTypeNode(N);
|
|
2973
3031
|
return ne.isLiteral() ? ne.value : void 0;
|
|
2974
|
-
}),
|
|
2975
|
-
const ne =
|
|
2976
|
-
return ne < 0 ?
|
|
3032
|
+
}), O = (N) => {
|
|
3033
|
+
const ne = P.indexOf(N);
|
|
3034
|
+
return ne < 0 ? P.length : ne;
|
|
2977
3035
|
};
|
|
2978
|
-
V.sort((N, ne) =>
|
|
3036
|
+
V.sort((N, ne) => O(N) - O(ne));
|
|
2979
3037
|
}
|
|
2980
|
-
const
|
|
2981
|
-
if (C &&
|
|
2982
|
-
const
|
|
3038
|
+
const Q = C && C.flags & e.SymbolFlags.Variable ? C.valueDeclaration : void 0, he = new Set(V);
|
|
3039
|
+
if (C && Q && L(Q)) for (const P of r.getTypeOfSymbolAtLocation(C, Q).getProperties()) {
|
|
3040
|
+
const O = P.valueDeclaration, N = r.getTypeOfSymbolAtLocation(P, O ?? Q);
|
|
2983
3041
|
if (!(N.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral))) continue;
|
|
2984
3042
|
const ne = N.value;
|
|
2985
|
-
V.includes(ne) && (
|
|
2986
|
-
|
|
3043
|
+
V.includes(ne) && (z = !0, he.delete(ne), M.push([
|
|
3044
|
+
R(P, !0),
|
|
2987
3045
|
ne,
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
3046
|
+
O,
|
|
3047
|
+
Le(P.getDocumentationComment(r)),
|
|
3048
|
+
F(P)
|
|
2991
3049
|
]));
|
|
2992
3050
|
}
|
|
2993
|
-
for (const
|
|
2994
|
-
String(
|
|
2995
|
-
|
|
3051
|
+
for (const P of V) he.has(P) && M.push([
|
|
3052
|
+
String(P),
|
|
3053
|
+
P,
|
|
2996
3054
|
void 0,
|
|
2997
3055
|
null
|
|
2998
3056
|
]);
|
|
2999
3057
|
}
|
|
3000
|
-
if (
|
|
3001
|
-
const
|
|
3002
|
-
if (
|
|
3003
|
-
|
|
3058
|
+
if (M.length === 0) return null;
|
|
3059
|
+
const U = typeof M[0][1] == "number";
|
|
3060
|
+
if (M.some(([, g]) => typeof g == "number" !== U)) {
|
|
3061
|
+
o(u, E.EnumMixed, \`'\${C?.name ?? u.getText()}' mixes number and string members: '\${p}'. A parameter has one type, so an enum is all numbers or all strings.\`);
|
|
3004
3062
|
return;
|
|
3005
3063
|
}
|
|
3006
|
-
const $ = C ?
|
|
3007
|
-
if (
|
|
3008
|
-
if (
|
|
3009
|
-
const
|
|
3010
|
-
for (const [x, I, V, re] of
|
|
3011
|
-
const
|
|
3012
|
-
|
|
3064
|
+
const $ = C ? R(C) : M.map(([, g]) => String(g)).join("|"), B = C ? void 0 : y.get($);
|
|
3065
|
+
if (B) return B;
|
|
3066
|
+
if (z) {
|
|
3067
|
+
const g = /* @__PURE__ */ new Map();
|
|
3068
|
+
for (const [x, I, V, re] of M) {
|
|
3069
|
+
const Y = V?.name?.getText() ?? x, Q = g.get(I);
|
|
3070
|
+
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
3071
|
}
|
|
3014
3072
|
}
|
|
3015
|
-
const
|
|
3073
|
+
const X = {
|
|
3016
3074
|
id: $,
|
|
3017
|
-
type:
|
|
3018
|
-
members:
|
|
3019
|
-
|
|
3075
|
+
type: U ? me.Number : me.String,
|
|
3076
|
+
members: M.map(([g, x, , , I]) => I ? [
|
|
3077
|
+
g,
|
|
3020
3078
|
x,
|
|
3021
3079
|
I
|
|
3022
|
-
] : [
|
|
3080
|
+
] : [g, x])
|
|
3023
3081
|
};
|
|
3024
|
-
C ?
|
|
3025
|
-
const
|
|
3026
|
-
for (const [
|
|
3027
|
-
if (
|
|
3028
|
-
const
|
|
3029
|
-
|
|
3030
|
-
}
|
|
3031
|
-
return
|
|
3032
|
-
},
|
|
3033
|
-
const C = (
|
|
3034
|
-
const
|
|
3035
|
-
return
|
|
3082
|
+
C ? h.set(C, X) : y.set($, X);
|
|
3083
|
+
const G = C ? Le(C.getDocumentationComment(r)) : "", j = {};
|
|
3084
|
+
for (const [g, , , x] of M) x && (j[g] = { description: x });
|
|
3085
|
+
if (G || Object.keys(j).length > 0) {
|
|
3086
|
+
const g = {};
|
|
3087
|
+
G && (g.summary = G), Object.keys(j).length > 0 && (g.members = j), w.set(X, g);
|
|
3088
|
+
}
|
|
3089
|
+
return X;
|
|
3090
|
+
}, we = (u, p, v, _) => {
|
|
3091
|
+
const C = (U, $, B) => {
|
|
3092
|
+
const X = { name: U };
|
|
3093
|
+
return S($, X, v, !0), B && (X.optional = !0), _ && !X.acceptError && (X.acceptError = !0), X;
|
|
3036
3094
|
};
|
|
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
|
|
3044
|
-
const
|
|
3045
|
-
if (
|
|
3046
|
-
|
|
3047
|
-
}
|
|
3048
|
-
return
|
|
3049
|
-
},
|
|
3095
|
+
if (u.kind !== e.SyntaxKind.TupleType) return [C(p, u, !1)];
|
|
3096
|
+
const M = u.elements;
|
|
3097
|
+
if (M.length < 2) return o(u, E.RepeatingSlots, \`'\${p}': a repeating group of period \${M.length} must be spelled 'Repeating<T>' without the tuple.\`), null;
|
|
3098
|
+
const z = [];
|
|
3099
|
+
for (let U = 0; U < M.length; U++) {
|
|
3100
|
+
const $ = M[U];
|
|
3101
|
+
if ($.kind !== e.SyntaxKind.NamedTupleMember) return o($, E.RepeatingSlots, \`'\${p}': every slot of a repeating group must be labelled, e.g. 'Repeating<[criteriaRange: IRange, criteria: Scalar]>'.\`), null;
|
|
3102
|
+
const B = !!$.questionToken;
|
|
3103
|
+
if (B && U !== M.length - 1) return o($, E.RepeatingOptional, \`'\${p}': only the LAST slot of a repeating group may be optional (slot '\${$.name?.getText?.()}' is not).\`), null;
|
|
3104
|
+
z.push(C($.name?.getText?.() ?? \`\${U}\`, $.type, B));
|
|
3105
|
+
}
|
|
3106
|
+
return z;
|
|
3107
|
+
}, te = (u, p, v, _, C, M = !1, z = !1, U = !1) => {
|
|
3050
3108
|
if (!u) {
|
|
3051
|
-
|
|
3109
|
+
o(u, E.MissingType, \`Type is not defined for '\${p?.name ?? "return"}'.\`);
|
|
3052
3110
|
return;
|
|
3053
3111
|
}
|
|
3054
|
-
if (u.kind === e.SyntaxKind.ParenthesizedType) return
|
|
3112
|
+
if (u.kind === e.SyntaxKind.ParenthesizedType) return te(u.type, p, v, _, C, M, z, U);
|
|
3055
3113
|
if (u.kind === e.SyntaxKind.UnionType) {
|
|
3056
|
-
const $ = (
|
|
3057
|
-
if (
|
|
3058
|
-
const
|
|
3059
|
-
if (
|
|
3060
|
-
if (
|
|
3061
|
-
|
|
3114
|
+
const $ = (G) => G.kind === e.SyntaxKind.UndefinedKeyword || G.kind === e.SyntaxKind.VoidKeyword || G.kind === e.SyntaxKind.NullKeyword || G.kind === e.SyntaxKind.LiteralType && G.literal?.kind === e.SyntaxKind.NullKeyword, B = u.types.filter((G) => !$(G));
|
|
3115
|
+
if (B.length === 1) return te(B[0], p, v, _, C, M, z, U);
|
|
3116
|
+
const X = de(u, p.name ?? f(u));
|
|
3117
|
+
if (X === void 0) return;
|
|
3118
|
+
if (X !== null) {
|
|
3119
|
+
p.scalar = X.type, _ && (p.enum = X);
|
|
3062
3120
|
return;
|
|
3063
3121
|
}
|
|
3064
|
-
if (!
|
|
3065
|
-
|
|
3122
|
+
if (!_) {
|
|
3123
|
+
p.scalar = "*";
|
|
3066
3124
|
return;
|
|
3067
3125
|
}
|
|
3068
|
-
if (
|
|
3069
|
-
const
|
|
3070
|
-
if (
|
|
3071
|
-
|
|
3126
|
+
if (B.length === 2) {
|
|
3127
|
+
const G = (g) => g.kind !== e.SyntaxKind.TypeReference ? !1 : e.isTypeReferenceNode(g) && _e(g) === "Lambda", j = B.findIndex(G);
|
|
3128
|
+
if (j >= 0 && !G(B[1 - j])) {
|
|
3129
|
+
te(B[1 - j], p, v, _, C, M, z, U), A(B[j], _e(B[j]), p, v, _);
|
|
3072
3130
|
return;
|
|
3073
3131
|
}
|
|
3074
3132
|
}
|
|
3075
|
-
if (
|
|
3076
|
-
const
|
|
3077
|
-
if (!(
|
|
3078
|
-
},
|
|
3079
|
-
if (
|
|
3080
|
-
const
|
|
3081
|
-
if (
|
|
3082
|
-
|
|
3083
|
-
const I =
|
|
3084
|
-
I && (
|
|
3133
|
+
if (_ && B.length === 2) {
|
|
3134
|
+
const G = (g) => {
|
|
3135
|
+
if (!(g.kind !== e.SyntaxKind.TypeReference || g.typeArguments?.length)) return ht.get(_e(g));
|
|
3136
|
+
}, j = B.findIndex((g) => G(g) !== void 0);
|
|
3137
|
+
if (j >= 0 && G(B[1 - j]) === void 0) {
|
|
3138
|
+
const g = {}, x = C.count;
|
|
3139
|
+
if (te(B[1 - j], g, v, _, C, M, !1), g.scalar && !g.range && g.lambda == null && C.count === x) {
|
|
3140
|
+
p.range = G(B[j]), p.scalar = g.scalar, p.valueOrRange = !0;
|
|
3141
|
+
const I = g.enum;
|
|
3142
|
+
I && (p.enum = I);
|
|
3085
3143
|
return;
|
|
3086
3144
|
}
|
|
3087
3145
|
}
|
|
3088
3146
|
}
|
|
3089
|
-
if (
|
|
3090
|
-
const
|
|
3091
|
-
if (
|
|
3092
|
-
const
|
|
3093
|
-
if (
|
|
3094
|
-
if (
|
|
3095
|
-
|
|
3147
|
+
if (_ && B.length === 2) {
|
|
3148
|
+
const G = (g) => g.kind === e.SyntaxKind.TypeReference && !g.typeArguments?.length && _e(g) === "Scalar", j = B.findIndex(G);
|
|
3149
|
+
if (j >= 0 && !G(B[1 - j])) {
|
|
3150
|
+
const g = de(B[1 - j], p.name ?? f(u));
|
|
3151
|
+
if (g === void 0) return;
|
|
3152
|
+
if (g !== null) {
|
|
3153
|
+
p.scalar = "*", p.enum = g;
|
|
3096
3154
|
return;
|
|
3097
3155
|
}
|
|
3098
3156
|
}
|
|
3099
3157
|
}
|
|
3100
|
-
|
|
3158
|
+
o(u, E.InvalidParamType, \`Union parameter types are not supported: '\${f(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
3159
|
return;
|
|
3102
3160
|
}
|
|
3103
|
-
if (u.kind === e.SyntaxKind.NumberKeyword)
|
|
3104
|
-
else if (u.kind === e.SyntaxKind.StringKeyword)
|
|
3105
|
-
else if (u.kind === e.SyntaxKind.BooleanKeyword)
|
|
3161
|
+
if (u.kind === e.SyntaxKind.NumberKeyword) p.scalar = me.Number;
|
|
3162
|
+
else if (u.kind === e.SyntaxKind.StringKeyword) p.scalar = me.String;
|
|
3163
|
+
else if (u.kind === e.SyntaxKind.BooleanKeyword) p.scalar = me.Boolean;
|
|
3106
3164
|
else if (u.kind === e.SyntaxKind.UndefinedKeyword || u.kind === e.SyntaxKind.NullKeyword || u.kind === e.SyntaxKind.VoidKeyword) {
|
|
3107
|
-
if (
|
|
3108
|
-
|
|
3165
|
+
if (_) {
|
|
3166
|
+
o(u, E.UndefinedInput, \`'undefined' is not a valid type for input: '\${f(u)}'.\`);
|
|
3109
3167
|
return;
|
|
3110
3168
|
}
|
|
3111
|
-
|
|
3112
|
-
} else if (u.kind === e.SyntaxKind.BigIntKeyword)
|
|
3113
|
-
else if (u.kind === e.SyntaxKind.AnyKeyword)
|
|
3169
|
+
p.scalar = me.Null;
|
|
3170
|
+
} else if (u.kind === e.SyntaxKind.BigIntKeyword) p.scalar = me.Number;
|
|
3171
|
+
else if (u.kind === e.SyntaxKind.AnyKeyword) _ && (p.range = "*");
|
|
3114
3172
|
else if (u.kind === e.SyntaxKind.ArrayType) {
|
|
3115
3173
|
const $ = u.elementType;
|
|
3116
3174
|
if (!$) {
|
|
3117
|
-
|
|
3175
|
+
o(u, E.UntypedArray, \`'Array' must be typed: '\${f(u)}'.\`);
|
|
3118
3176
|
return;
|
|
3119
3177
|
}
|
|
3120
|
-
if (
|
|
3121
|
-
const
|
|
3122
|
-
delete
|
|
3123
|
-
const
|
|
3124
|
-
|
|
3178
|
+
if (_ && z) {
|
|
3179
|
+
const B = p, X = B.name ?? f(u) ?? "parameter", G = B.acceptError;
|
|
3180
|
+
delete B.acceptError;
|
|
3181
|
+
const j = { name: X };
|
|
3182
|
+
S($, j, v, !0), G && !j.acceptError && (j.acceptError = !0), B.repeating = [j];
|
|
3125
3183
|
return;
|
|
3126
3184
|
}
|
|
3127
|
-
C.count++,
|
|
3185
|
+
C.count++, te($, p, v, _, C);
|
|
3128
3186
|
} else if (u.kind !== e.SyntaxKind.TupleType) if (u.kind === e.SyntaxKind.TypeReference) {
|
|
3129
|
-
const $ =
|
|
3130
|
-
if (
|
|
3131
|
-
const
|
|
3132
|
-
if (!
|
|
3133
|
-
|
|
3187
|
+
const $ = _e(u);
|
|
3188
|
+
if (Qr.has($)) {
|
|
3189
|
+
const g = f(u);
|
|
3190
|
+
if (!_) {
|
|
3191
|
+
o(u, E.InvalidReturnType, \`'\${$}' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3134
3192
|
return;
|
|
3135
3193
|
}
|
|
3136
|
-
const x =
|
|
3194
|
+
const x = p;
|
|
3137
3195
|
if (x.acceptError) {
|
|
3138
|
-
|
|
3196
|
+
o(u, E.InvalidParamType, \`'\${g}' declares 'AcceptError' more than once.\`);
|
|
3139
3197
|
return;
|
|
3140
3198
|
}
|
|
3141
3199
|
const I = u.typeArguments;
|
|
3142
3200
|
if (!I || I.length !== 1) {
|
|
3143
|
-
|
|
3201
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3144
3202
|
return;
|
|
3145
3203
|
}
|
|
3146
|
-
return x.acceptError = !0,
|
|
3204
|
+
return x.acceptError = !0, te(I[0], p, v, _, C, M, z, U);
|
|
3147
3205
|
}
|
|
3148
|
-
if (
|
|
3149
|
-
const
|
|
3150
|
-
if (!
|
|
3151
|
-
|
|
3206
|
+
if (gt.has($)) {
|
|
3207
|
+
const g = p.name ?? f(u);
|
|
3208
|
+
if (!_) {
|
|
3209
|
+
o(u, E.InvalidReturnType, \`'ReportType' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3152
3210
|
return;
|
|
3153
3211
|
}
|
|
3154
3212
|
const x = u.typeArguments;
|
|
3155
3213
|
if (!x || x.length !== 1) {
|
|
3156
|
-
|
|
3214
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3157
3215
|
return;
|
|
3158
3216
|
}
|
|
3159
|
-
return
|
|
3217
|
+
return p.reportType = !0, te(x[0], p, v, _, C, M, z, U);
|
|
3160
3218
|
}
|
|
3161
|
-
if (
|
|
3162
|
-
const
|
|
3163
|
-
if (!
|
|
3164
|
-
|
|
3219
|
+
if (tn.has($)) {
|
|
3220
|
+
const g = p.name ?? f(u);
|
|
3221
|
+
if (!_) {
|
|
3222
|
+
o(u, E.InvalidReturnType, \`'NoLift' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3165
3223
|
return;
|
|
3166
3224
|
}
|
|
3167
3225
|
const x = u.typeArguments;
|
|
3168
3226
|
if (!x || x.length !== 1) {
|
|
3169
|
-
|
|
3227
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3170
3228
|
return;
|
|
3171
3229
|
}
|
|
3172
|
-
const I =
|
|
3230
|
+
const I = p;
|
|
3173
3231
|
I.noLift = !0;
|
|
3174
3232
|
const V = C.count;
|
|
3175
|
-
|
|
3233
|
+
te(x[0], p, v, _, C, M, z, U), (I.range || I.lambda != null || I.repeating || C.count !== V) && o(u, E.InvalidParamType, \`'\${g}': 'NoLift' applies to a SCALAR parameter only - a range, list, repeating or lambda slot never lifts.\`);
|
|
3176
3234
|
return;
|
|
3177
3235
|
}
|
|
3178
|
-
if (
|
|
3179
|
-
const
|
|
3180
|
-
if (!
|
|
3181
|
-
|
|
3236
|
+
if (rn.has($)) {
|
|
3237
|
+
const g = p.name ?? f(u);
|
|
3238
|
+
if (!_) {
|
|
3239
|
+
o(u, E.InvalidReturnType, \`'NoFilter' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3182
3240
|
return;
|
|
3183
3241
|
}
|
|
3184
3242
|
const x = u.typeArguments;
|
|
3185
3243
|
if (!x || x.length !== 1) {
|
|
3186
|
-
|
|
3244
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3187
3245
|
return;
|
|
3188
3246
|
}
|
|
3189
|
-
const I =
|
|
3247
|
+
const I = p;
|
|
3190
3248
|
I.noFilter = !0;
|
|
3191
3249
|
const V = C.count;
|
|
3192
|
-
if (
|
|
3193
|
-
|
|
3250
|
+
if (te(x[0], p, v, _, C, M, z, U), I.range || I.lambda != null || C.count !== V) {
|
|
3251
|
+
o(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a SCALAR slot only - a range, list or lambda slot has no members to coerce.\`);
|
|
3194
3252
|
return;
|
|
3195
3253
|
}
|
|
3196
3254
|
const re = I.repeating;
|
|
3197
3255
|
if (re) {
|
|
3198
3256
|
if (delete I.noFilter, re.length !== 1) {
|
|
3199
|
-
|
|
3257
|
+
o(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
3258
|
return;
|
|
3201
3259
|
}
|
|
3202
3260
|
re[0].noFilter = !0;
|
|
3203
|
-
} else
|
|
3261
|
+
} else z && o(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a REPEATING slot only - a single scalar argument has no members to coerce.\`);
|
|
3204
3262
|
return;
|
|
3205
3263
|
}
|
|
3206
|
-
if (
|
|
3207
|
-
const
|
|
3208
|
-
if (!
|
|
3209
|
-
|
|
3264
|
+
if (en.has($)) {
|
|
3265
|
+
const g = p.name ?? f(u);
|
|
3266
|
+
if (!_) {
|
|
3267
|
+
o(u, E.InvalidReturnType, \`'Omittable' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3210
3268
|
return;
|
|
3211
3269
|
}
|
|
3212
3270
|
const x = u.typeArguments;
|
|
3213
3271
|
if (!x || x.length < 1 || x.length > 2) {
|
|
3214
|
-
|
|
3272
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
|
|
3215
3273
|
return;
|
|
3216
3274
|
}
|
|
3217
|
-
const I =
|
|
3275
|
+
const I = p;
|
|
3218
3276
|
if (I.omittable = !0, x.length === 2) {
|
|
3219
|
-
const
|
|
3220
|
-
if (
|
|
3221
|
-
|
|
3277
|
+
const Y = tr(e, x[1]);
|
|
3278
|
+
if (Y === void 0) {
|
|
3279
|
+
o(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
3280
|
return;
|
|
3223
3281
|
}
|
|
3224
|
-
I.omittedValue =
|
|
3282
|
+
I.omittedValue = Y;
|
|
3225
3283
|
}
|
|
3226
|
-
const V =
|
|
3227
|
-
return I.enum && re !== void 0 && re !== null && !I.enum.members.some(([,
|
|
3284
|
+
const V = te(x[0], p, v, _, C, M, z, U), re = I.omittedValue;
|
|
3285
|
+
return I.enum && re !== void 0 && re !== null && !I.enum.members.some(([, Y]) => Y === re) && o(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
3286
|
}
|
|
3229
|
-
if (
|
|
3230
|
-
const
|
|
3231
|
-
if (!
|
|
3232
|
-
|
|
3287
|
+
if (nn.has($)) {
|
|
3288
|
+
const g = p.name ?? f(u);
|
|
3289
|
+
if (!_) {
|
|
3290
|
+
o(u, E.InvalidReturnType, \`'Lazy' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3233
3291
|
return;
|
|
3234
3292
|
}
|
|
3235
|
-
const x =
|
|
3293
|
+
const x = p;
|
|
3236
3294
|
if (x.lazy) {
|
|
3237
|
-
|
|
3295
|
+
o(u, E.InvalidParamType, \`'\${g}' declares 'Lazy' more than once.\`);
|
|
3238
3296
|
return;
|
|
3239
3297
|
}
|
|
3240
3298
|
const I = u.typeArguments;
|
|
3241
3299
|
if (!I || I.length < 1 || I.length > 2) {
|
|
3242
|
-
|
|
3300
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
|
|
3243
3301
|
return;
|
|
3244
3302
|
}
|
|
3245
3303
|
if (x.lazy = !0, I.length === 2) {
|
|
3246
|
-
const V =
|
|
3304
|
+
const V = tr(e, I[1]);
|
|
3247
3305
|
if (V === void 0) {
|
|
3248
|
-
|
|
3306
|
+
o(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
3307
|
return;
|
|
3250
3308
|
}
|
|
3251
3309
|
x.optional = !0, x.defaultValue = V;
|
|
3252
3310
|
}
|
|
3253
|
-
|
|
3311
|
+
te(I[0], p, v, _, C, M, z, U), x.enum ? (o(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 ? o(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 && o(u, E.InvalidParamType, \`'\${g}': 'Lazy' applies to a VALUE, not to a repeating group - mark the group's slots instead.\`);
|
|
3254
3312
|
return;
|
|
3255
3313
|
}
|
|
3256
|
-
if (
|
|
3257
|
-
const
|
|
3258
|
-
if (!
|
|
3259
|
-
|
|
3314
|
+
if (aa.has($)) {
|
|
3315
|
+
const g = p.name ?? f(u);
|
|
3316
|
+
if (!_) {
|
|
3317
|
+
o(u, E.InvalidReturnType, \`'Flatten' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
|
|
3260
3318
|
return;
|
|
3261
3319
|
}
|
|
3262
3320
|
const x = u.typeArguments;
|
|
3263
3321
|
if (!x || x.length !== 1) {
|
|
3264
|
-
|
|
3322
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
|
|
3265
3323
|
return;
|
|
3266
3324
|
}
|
|
3267
|
-
return C.count++,
|
|
3325
|
+
return C.count++, te(x[0], p, v, _, C, M);
|
|
3268
3326
|
}
|
|
3269
|
-
if (
|
|
3270
|
-
const
|
|
3271
|
-
if (!
|
|
3272
|
-
|
|
3327
|
+
if (Zr.get($) === "repeating") {
|
|
3328
|
+
const g = p.name ?? f(u);
|
|
3329
|
+
if (!_) {
|
|
3330
|
+
o(u, E.RepeatingPosition, \`'Repeating' is not a valid return type: '\${g}'.\`);
|
|
3273
3331
|
return;
|
|
3274
3332
|
}
|
|
3275
3333
|
if (C.count !== 0) {
|
|
3276
|
-
|
|
3334
|
+
o(u, E.RepeatingPosition, \`'Repeating' cannot be nested inside another type: '\${g}'.\`);
|
|
3277
3335
|
return;
|
|
3278
3336
|
}
|
|
3279
|
-
const x =
|
|
3337
|
+
const x = p, I = u.typeArguments;
|
|
3280
3338
|
if (!I || I.length < 1 || I.length > 2) {
|
|
3281
|
-
|
|
3339
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with 1 type, optionally followed by a maximum argument count: '\${g}'.\`);
|
|
3282
3340
|
return;
|
|
3283
3341
|
}
|
|
3284
3342
|
let V;
|
|
3285
3343
|
if (I.length === 2) {
|
|
3286
|
-
const
|
|
3287
|
-
if (!Number.isInteger(
|
|
3288
|
-
|
|
3344
|
+
const Q = I[1], he = Q.kind === e.SyntaxKind.LiteralType ? Q.literal : null, P = he && he.kind === e.SyntaxKind.NumericLiteral ? Number(he.text) : NaN;
|
|
3345
|
+
if (!Number.isInteger(P) || P < 1 || P > Zt) {
|
|
3346
|
+
o(Q, E.RepeatingMax, \`'\${g}': '\${$}'’s maximum must be a whole number between 1 and \${Zt}.\`);
|
|
3289
3347
|
return;
|
|
3290
3348
|
}
|
|
3291
|
-
V =
|
|
3349
|
+
V = P, v.maxArguments = P;
|
|
3292
3350
|
}
|
|
3293
|
-
if (
|
|
3351
|
+
if (U) {
|
|
3294
3352
|
if (V === void 0) {
|
|
3295
|
-
|
|
3353
|
+
o(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
3354
|
return;
|
|
3297
3355
|
}
|
|
3298
|
-
return
|
|
3356
|
+
return te(I[0], p, v, _, C, M, z);
|
|
3299
3357
|
}
|
|
3300
3358
|
const re = x.acceptError;
|
|
3301
3359
|
delete x.acceptError;
|
|
3302
|
-
const
|
|
3303
|
-
|
|
3360
|
+
const Y = we(I[0], g ?? "parameter", v, re);
|
|
3361
|
+
Y && (x.repeating = Y);
|
|
3304
3362
|
return;
|
|
3305
3363
|
}
|
|
3306
|
-
const
|
|
3307
|
-
let
|
|
3308
|
-
|
|
3309
|
-
const
|
|
3310
|
-
if (
|
|
3311
|
-
if (
|
|
3364
|
+
const B = ht.get($);
|
|
3365
|
+
let X = !1;
|
|
3366
|
+
B && (p.range = B, X = !0);
|
|
3367
|
+
const G = ia.get($);
|
|
3368
|
+
if (G && (p.scalar = G), G !== void 0 && (X = !0), A(u, $, p, v, _)) return;
|
|
3369
|
+
if (_) {
|
|
3312
3370
|
if ($ === "Volatile" || $ === \`\${se}.Volatile\`) {
|
|
3313
|
-
|
|
3371
|
+
o(u, E.InvalidParamType, \`'Volatile' is not a valid parameter type: '\${f(u)}'. It describes the function's RESULT, so it belongs on the return type.\`);
|
|
3314
3372
|
return;
|
|
3315
3373
|
}
|
|
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
|
-
}
|
|
3374
|
+
if (da.has($)) return Qt;
|
|
3375
|
+
const g = bt.get($);
|
|
3376
|
+
if (g) return g;
|
|
3377
|
+
} else if ($ === "Promise") b = u, X = !0;
|
|
3378
|
+
else {
|
|
3379
|
+
const g = ua.get($);
|
|
3380
|
+
g && (Object.assign(p, g()), X = !0);
|
|
3330
3381
|
}
|
|
3331
|
-
if (!
|
|
3332
|
-
const
|
|
3333
|
-
if (
|
|
3334
|
-
if (
|
|
3335
|
-
|
|
3382
|
+
if (!X) {
|
|
3383
|
+
const g = de(u, p.name ?? f(u));
|
|
3384
|
+
if (g === void 0) return;
|
|
3385
|
+
if (g !== null) {
|
|
3386
|
+
p.scalar = g.type, _ && (p.enum = g);
|
|
3336
3387
|
return;
|
|
3337
3388
|
}
|
|
3338
3389
|
}
|
|
3339
|
-
if (!
|
|
3340
|
-
const
|
|
3390
|
+
if (!X) {
|
|
3391
|
+
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
3392
|
let I;
|
|
3342
|
-
|
|
3393
|
+
_ ? M ? I = \`'\${$}' is not a valid first parameter: '\${f(u)}'. The first parameter is EITHER a macro target (making this a macro) OR a calculation input (making this a calculation function). Allowed: \${na.join(", ")} (macro target); \${g} (calculation input).\` : I = \`'\${$}' is not a valid parameter type: '\${f(u)}'. Allowed: \${g}.\` : I = \`'\${$}' is not a valid return type: '\${f(u)}'. Allowed: \${x}.\`, o(u, _ ? E.InvalidParamType : E.InvalidReturnType, I);
|
|
3343
3394
|
return;
|
|
3344
3395
|
}
|
|
3345
|
-
const
|
|
3346
|
-
if (
|
|
3347
|
-
if (
|
|
3348
|
-
|
|
3396
|
+
const j = u.typeArguments;
|
|
3397
|
+
if (j) {
|
|
3398
|
+
if (j.length !== 1) {
|
|
3399
|
+
o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${f(u)}'.\`);
|
|
3349
3400
|
return;
|
|
3350
3401
|
}
|
|
3351
|
-
const
|
|
3352
|
-
x &&
|
|
3353
|
-
const V =
|
|
3354
|
-
V && !x && (
|
|
3402
|
+
const g = j[0], x = _ && e.isTypeReferenceNode(g) && gt.has(_e(g)), I = p.reportType;
|
|
3403
|
+
x && K.add(p), S(g, p, v, _), x && I === void 0 && delete p.reportType;
|
|
3404
|
+
const V = p.enum;
|
|
3405
|
+
V && !x && (o(j[0], E.EnumPosition, \`'\${$}' cannot hold the enum '\${V.id}': '\${f(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 p.enum);
|
|
3355
3406
|
}
|
|
3356
|
-
} else u.kind === e.SyntaxKind.FunctionType &&
|
|
3357
|
-
},
|
|
3407
|
+
} else u.kind === e.SyntaxKind.FunctionType && k(u, p, v, _);
|
|
3408
|
+
}, Ze = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Export) !== 0, Ie = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Default) !== 0;
|
|
3358
3409
|
try {
|
|
3359
3410
|
e.forEachChild(t, (u) => {
|
|
3360
|
-
if (
|
|
3361
|
-
const
|
|
3411
|
+
if (Ze(u) && e.isFunctionDeclaration(u)) {
|
|
3412
|
+
const p = u?.name?.getText();
|
|
3362
3413
|
if (!u.body) {
|
|
3363
|
-
|
|
3414
|
+
o(u, E.NoBody, \`'\${p}': function has no body.\`);
|
|
3364
3415
|
return;
|
|
3365
3416
|
}
|
|
3366
|
-
if (!
|
|
3367
|
-
|
|
3417
|
+
if (!p) {
|
|
3418
|
+
o(u, E.Anonymous, "Anonymous exported functions are not allowed.");
|
|
3368
3419
|
return;
|
|
3369
3420
|
}
|
|
3370
|
-
const
|
|
3421
|
+
const v = {}, _ = { parameters: {} };
|
|
3371
3422
|
try {
|
|
3372
|
-
|
|
3373
|
-
const C = r.getSymbolAtLocation(u.name),
|
|
3374
|
-
|
|
3375
|
-
const
|
|
3376
|
-
b(u.type,
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3379
|
-
const $ = /* @__PURE__ */ new Map(),
|
|
3380
|
-
let
|
|
3381
|
-
for (let
|
|
3382
|
-
const
|
|
3383
|
-
N.name =
|
|
3384
|
-
const ne =
|
|
3385
|
-
if (n?.lenient &&
|
|
3386
|
-
|
|
3423
|
+
v.name = p;
|
|
3424
|
+
const C = r.getSymbolAtLocation(u.name), M = Le(C?.getDocumentationComment(r));
|
|
3425
|
+
M && (_.summary = M);
|
|
3426
|
+
const z = {};
|
|
3427
|
+
b = null, S(u.type, z, v, !1), v.returnType = z;
|
|
3428
|
+
const U = {};
|
|
3429
|
+
Ie(u) && (U.default = !0, c = p), v.parameters = [];
|
|
3430
|
+
const $ = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Set();
|
|
3431
|
+
let G = null, j = null, g = null, x = 0, I = !1, V = 0;
|
|
3432
|
+
for (let P = 0; P < u.parameters.length; P++) {
|
|
3433
|
+
const O = u.parameters[P], N = {};
|
|
3434
|
+
N.name = O.name?.getText();
|
|
3435
|
+
const ne = v.parameters.length === 0;
|
|
3436
|
+
if (n?.lenient && P === 0 && !O.type && U.default) {
|
|
3437
|
+
v.context = er;
|
|
3387
3438
|
continue;
|
|
3388
3439
|
}
|
|
3389
|
-
const
|
|
3390
|
-
if (
|
|
3391
|
-
|
|
3440
|
+
const Re = S(O.type, N, v, !0, ne, !O.dotDotDotToken, !!O.dotDotDotToken);
|
|
3441
|
+
if (Re === Qt) {
|
|
3442
|
+
P === 0 && v.context === void 0 && (v.context = er);
|
|
3392
3443
|
continue;
|
|
3393
3444
|
}
|
|
3394
|
-
if (
|
|
3395
|
-
if (
|
|
3396
|
-
|
|
3445
|
+
if (Re) {
|
|
3446
|
+
if (v.parameters.length !== 0) {
|
|
3447
|
+
o(O, E.ContextNotFirst, \`'\${v.name}' contexts must be the first parameter: '\${N.name}'.\`);
|
|
3397
3448
|
return;
|
|
3398
3449
|
}
|
|
3399
|
-
|
|
3450
|
+
v.context = Re;
|
|
3400
3451
|
continue;
|
|
3401
3452
|
}
|
|
3402
3453
|
if (N.lambda !== void 0) {
|
|
3403
|
-
if (
|
|
3404
|
-
|
|
3454
|
+
if (G !== null) {
|
|
3455
|
+
o(O, E.MultipleLambda, \`'\${v.name}' has more than one Lambda parameter ('\${G}' and '\${N.name}'). Only one Lambda parameter is allowed.\`);
|
|
3405
3456
|
return;
|
|
3406
3457
|
}
|
|
3407
|
-
|
|
3408
|
-
} else if (
|
|
3409
|
-
|
|
3458
|
+
G = N.name;
|
|
3459
|
+
} else if (G !== null) {
|
|
3460
|
+
o(O, E.LambdaNotLast, \`'\${v.name}' Lambda parameter ('\${G}') must be the last parameter, but '\${N.name}' follows it.\`);
|
|
3410
3461
|
return;
|
|
3411
3462
|
}
|
|
3412
|
-
const ye = N.optional === !0 || !((
|
|
3463
|
+
const ye = N.optional === !0 || !((O.initializer === void 0 || O.initializer === null) && (O.questionToken === void 0 || O.questionToken === null));
|
|
3413
3464
|
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(
|
|
3465
|
+
if (ye && (N.optional = !0, O.initializer)) try {
|
|
3466
|
+
if (O.initializer.kind === e.SyntaxKind.StringLiteral) ae = O.initializer.text;
|
|
3467
|
+
else if (O.initializer.kind === e.SyntaxKind.NumericLiteral) ae = parseFloat(O.initializer.text);
|
|
3468
|
+
else if (O.initializer.kind === e.SyntaxKind.TrueKeyword || O.initializer.kind === e.SyntaxKind.FalseKeyword) ae = O.initializer.kind === e.SyntaxKind.TrueKeyword;
|
|
3469
|
+
else if (O.initializer.kind === e.SyntaxKind.NullKeyword) ae = null;
|
|
3470
|
+
else if (e.isPrefixUnaryExpression(O.initializer) && O.initializer.operator === e.SyntaxKind.MinusToken && O.initializer.operand.kind === e.SyntaxKind.NumericLiteral) ae = -parseFloat(O.initializer.operand.text);
|
|
3471
|
+
else if (e.isPropertyAccessExpression(O.initializer) || e.isElementAccessExpression(O.initializer)) {
|
|
3472
|
+
const ue = r.getTypeAtLocation(O.initializer);
|
|
3422
3473
|
ue.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral) && (ae = ue.value);
|
|
3423
3474
|
}
|
|
3424
3475
|
} catch (ue) {
|
|
3425
3476
|
console.warn(\`Couldn't extract default value for parameter '\${N.name}'\`, ue);
|
|
3426
3477
|
}
|
|
3427
|
-
|
|
3478
|
+
O.dotDotDotToken && (N.rest = !0);
|
|
3428
3479
|
const H = N.repeating;
|
|
3429
3480
|
if (H) {
|
|
3430
3481
|
if (N.rest) {
|
|
3431
|
-
|
|
3482
|
+
o(O, E.RepeatingPosition, \`'\${v.name}' parameter '\${N.name}' is both a rest parameter and a repeating group. A group already repeats — drop the '...'.\`);
|
|
3432
3483
|
return;
|
|
3433
3484
|
}
|
|
3434
3485
|
if (ye && H.length === 1) {
|
|
3435
|
-
|
|
3486
|
+
o(O, 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
3487
|
return;
|
|
3437
3488
|
}
|
|
3438
|
-
if (
|
|
3439
|
-
|
|
3489
|
+
if (j !== null) {
|
|
3490
|
+
o(O, 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
3491
|
return;
|
|
3441
3492
|
}
|
|
3442
|
-
if (
|
|
3443
|
-
|
|
3493
|
+
if (g !== null) {
|
|
3494
|
+
o(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${g}' is optional and precedes the repeating group '\${N.name}'. Every parameter outside a group must be required.\`);
|
|
3444
3495
|
return;
|
|
3445
3496
|
}
|
|
3446
|
-
|
|
3447
|
-
} else if (
|
|
3448
|
-
|
|
3497
|
+
j = N.name, x = H.length, I = H[H.length - 1].optional === !0;
|
|
3498
|
+
} else if (j !== null && N.rest) {
|
|
3499
|
+
o(O, 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
3500
|
return;
|
|
3450
|
-
} else if (
|
|
3501
|
+
} else if (j !== null && ye) {
|
|
3451
3502
|
if (V >= x - 1) {
|
|
3452
|
-
|
|
3503
|
+
o(O, 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
3504
|
return;
|
|
3454
3505
|
}
|
|
3455
3506
|
if (I) {
|
|
3456
|
-
|
|
3507
|
+
o(O, 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
3508
|
return;
|
|
3458
3509
|
}
|
|
3459
3510
|
V++;
|
|
3460
3511
|
}
|
|
3461
|
-
ye && !H && (
|
|
3462
|
-
const W = (N.range ? 2 : 0) + (N.arrayDepth ?? 0),
|
|
3463
|
-
if (W >
|
|
3464
|
-
|
|
3512
|
+
ye && !H && (g = N.name);
|
|
3513
|
+
const W = (N.range ? 2 : 0) + (N.arrayDepth ?? 0), Be = N.range === "r" || N.range === "p" || N.range === "*", Z = N.rest || Be ? 3 : 2;
|
|
3514
|
+
if (W > Z) {
|
|
3515
|
+
o(O, 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
3516
|
return;
|
|
3466
3517
|
}
|
|
3467
|
-
|
|
3518
|
+
v.parameters.push(N);
|
|
3468
3519
|
const ce = { description: "" };
|
|
3469
|
-
|
|
3470
|
-
const
|
|
3471
|
-
ce.description =
|
|
3520
|
+
_.parameters[N.name] = ce;
|
|
3521
|
+
const Qe = r.getSymbolAtLocation(O.name);
|
|
3522
|
+
ce.description = Le(Qe?.getDocumentationComment(r)), ae !== void 0 && (N.defaultValue = ae);
|
|
3472
3523
|
for (const ue of [N, ...N.repeating ?? []]) {
|
|
3473
|
-
const
|
|
3474
|
-
|
|
3524
|
+
const Se = ue.enum ? w.get(ue.enum) : void 0;
|
|
3525
|
+
Se && ((_.enums ??= {})[ue.enum.id] = Se);
|
|
3475
3526
|
}
|
|
3476
|
-
if ($.set(N.name, N),
|
|
3477
|
-
|
|
3527
|
+
if ($.set(N.name, N), B.set(N.name, O), H && H.length > 1) {
|
|
3528
|
+
X.add(N.name);
|
|
3478
3529
|
for (const ue of H) {
|
|
3479
|
-
const
|
|
3480
|
-
|
|
3530
|
+
const Se = \`\${N.name}.\${ue.name}\`;
|
|
3531
|
+
_.parameters[Se] = { description: "" }, $.set(Se, ue), B.set(Se, O);
|
|
3481
3532
|
}
|
|
3482
3533
|
}
|
|
3483
3534
|
}
|
|
3484
|
-
const re =
|
|
3535
|
+
const re = v.maxArguments;
|
|
3485
3536
|
if (re !== void 0) {
|
|
3486
|
-
const
|
|
3487
|
-
if (!
|
|
3488
|
-
|
|
3537
|
+
const P = v.parameters ?? [];
|
|
3538
|
+
if (!P.some((N) => N.rest === !0 || N.repeating !== void 0)) {
|
|
3539
|
+
o(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but takes a fixed \${P.length}. A maximum only means something on a variadic tail.\`);
|
|
3489
3540
|
return;
|
|
3490
3541
|
}
|
|
3491
|
-
let
|
|
3492
|
-
for (const N of
|
|
3493
|
-
if (re <
|
|
3494
|
-
|
|
3542
|
+
let O = 0;
|
|
3543
|
+
for (const N of P) N.rest === !0 || N.optional === !0 || (O += N.repeating ? N.repeating.length : 1);
|
|
3544
|
+
if (re < O) {
|
|
3545
|
+
o(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but requires \${O}.\`);
|
|
3495
3546
|
return;
|
|
3496
3547
|
}
|
|
3497
3548
|
}
|
|
3498
3549
|
if (u.jsDoc && u.jsDoc.length > 0) {
|
|
3499
|
-
const
|
|
3500
|
-
for (let N = 0; N <
|
|
3501
|
-
const ne =
|
|
3550
|
+
const P = u.jsDoc, O = P.length;
|
|
3551
|
+
for (let N = 0; N < O; N++) {
|
|
3552
|
+
const ne = P[N]?.tags;
|
|
3502
3553
|
if (!ne) continue;
|
|
3503
|
-
const
|
|
3504
|
-
for (let ye = 0; ye <
|
|
3554
|
+
const Re = ne.length;
|
|
3555
|
+
for (let ye = 0; ye < Re; ye++) {
|
|
3505
3556
|
const ae = ne[ye];
|
|
3506
3557
|
let H = ae?.tagName?.text;
|
|
3507
3558
|
if (!H) continue;
|
|
3508
3559
|
H = H.toLowerCase();
|
|
3509
3560
|
let W = ae.comment;
|
|
3510
|
-
const
|
|
3511
|
-
if (typeof W != "string" && !
|
|
3512
|
-
H === "returnkind" &&
|
|
3561
|
+
const Be = ra(H);
|
|
3562
|
+
if (typeof W != "string" && !Be) {
|
|
3563
|
+
H === "returnkind" && o(ae, E.UnknownReturnKind, \`'@returnKind' needs a value kind. Known: \${[...lt].map((Z) => \`'\${Z}'\`).join(", ")}.\`);
|
|
3513
3564
|
continue;
|
|
3514
3565
|
}
|
|
3515
3566
|
if (typeof W == "string" && (W = W.replace(/\\r\\n?/g, \`
|
|
3516
|
-
\`).trim()), !(!
|
|
3567
|
+
\`).trim()), !(!Be && W && (W = W.split(\`
|
|
3517
3568
|
\`)[0].trim(), !W || W.length === 0))) {
|
|
3518
3569
|
if (W && typeof W == "string") {
|
|
3519
|
-
const
|
|
3520
|
-
let ce,
|
|
3521
|
-
for (; (ce =
|
|
3522
|
-
const [
|
|
3523
|
-
|
|
3570
|
+
const Z = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
|
|
3571
|
+
let ce, Qe = W, ue = [];
|
|
3572
|
+
for (; (ce = Z.exec(W)) !== null;) {
|
|
3573
|
+
const [Se, Ra, sn, Et] = ce, cn = [sn.trim()];
|
|
3574
|
+
Et && cn.push(Et.trim());
|
|
3524
3575
|
}
|
|
3525
|
-
W =
|
|
3576
|
+
W = Qe, ue.length > 0 && H === "see" && (_.links || (_.links = []), _.links.push(...ue));
|
|
3526
3577
|
}
|
|
3527
3578
|
if (H === "name") {
|
|
3528
|
-
const
|
|
3529
|
-
|
|
3579
|
+
const Z = W;
|
|
3580
|
+
Z !== p && (_.name = Z);
|
|
3530
3581
|
} else if (H !== "description") {
|
|
3531
3582
|
if (H === "param") {
|
|
3532
|
-
const
|
|
3533
|
-
if (!$.get(
|
|
3534
|
-
|
|
3583
|
+
const Z = ae.name?.getText?.() ?? ae.name?.text;
|
|
3584
|
+
if (!$.get(Z)) {
|
|
3585
|
+
o(ae, E.UnknownParam, \`Parameter '\${Z}' not found in function '\${p}'.\`);
|
|
3535
3586
|
continue;
|
|
3536
3587
|
}
|
|
3537
|
-
const ce =
|
|
3588
|
+
const ce = _.parameters?.[Z];
|
|
3538
3589
|
ce && !ce.description && typeof W == "string" && W && (ce.description = W);
|
|
3539
|
-
} else if (H === "returns" || H === "return")
|
|
3590
|
+
} else if (H === "returns" || H === "return") v.returnType.description = W;
|
|
3540
3591
|
else if (H === "returnkind") {
|
|
3541
|
-
const
|
|
3542
|
-
|
|
3543
|
-
} else if (H === "category")
|
|
3592
|
+
const Z = (W ?? "").trim().toLowerCase();
|
|
3593
|
+
lt.has(Z) ? v.returnType.kind = Z : o(ae, E.UnknownReturnKind, \`'@returnKind \${Z}' is not a known value kind. Known: \${[...lt].map((ce) => \`'\${ce}'\`).join(", ")}.\`);
|
|
3594
|
+
} else if (H === "category") _.category = W;
|
|
3544
3595
|
else if (H === "deprecated" || H === "hidden") {
|
|
3545
|
-
let
|
|
3596
|
+
let Z = !0;
|
|
3546
3597
|
const ce = W?.toLowerCase();
|
|
3547
|
-
ce === "false" ?
|
|
3598
|
+
ce === "false" ? Z = !1 : ce !== "true" && (Z = W), Z !== !1 && (_.deprecated = Z ?? !0, v.hidden = !0);
|
|
3548
3599
|
}
|
|
3549
3600
|
}
|
|
3550
3601
|
}
|
|
3551
3602
|
}
|
|
3552
3603
|
}
|
|
3553
3604
|
}
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
if (q && !eo.test(ee)) {
|
|
3557
|
-
const B = E.name ? \`'@name \${E.name}'\` : \`'\${ee}'\`;
|
|
3558
|
-
a(u.name ?? u, _.InvalidName, \`'\${g}': \${B} cannot be called from a formula. A function name starts with a letter or '_', and continues with letters, digits, '_' or '.'.\` + (E.name ? "" : " Add an '@name' tag to register it under another name."));
|
|
3605
|
+
if (!v.context && b) {
|
|
3606
|
+
o(b, E.InvalidReturnType, \`'\${p}': 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.\`);
|
|
3559
3607
|
return;
|
|
3560
3608
|
}
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3609
|
+
Object.keys(v.returnType).length === 0 && delete v.returnType, Object.keys(U).length > 0 && (v.behavior = U), _.summary || m(u.name ?? u, E.MissingSummary, "warning", \`'\${p}': missing a description. Add a JSDoc comment above the function.\`);
|
|
3610
|
+
const Y = !v.context, Q = Y && _.name || p;
|
|
3611
|
+
if (Y && !oa.test(Q)) {
|
|
3612
|
+
const P = _.name ? \`'@name \${_.name}'\` : \`'\${Q}'\`;
|
|
3613
|
+
o(u.name ?? u, E.InvalidName, \`'\${p}': \${P} 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."));
|
|
3564
3614
|
return;
|
|
3565
3615
|
}
|
|
3566
|
-
|
|
3616
|
+
if (Y && !n?.isBuiltIn && ca(Q)) {
|
|
3617
|
+
const P = _.name ? \`'@name \${_.name}'\` : \`'\${Q}'\`;
|
|
3618
|
+
o(u.name ?? u, E.InvalidName, \`'\${p}': \${P} cannot be called from a formula. It reads as a cell address.\` + (_.name ? "" : " Add an '@name' tag to register it under another name."));
|
|
3619
|
+
return;
|
|
3620
|
+
}
|
|
3621
|
+
const he = l.get(Q.toUpperCase());
|
|
3567
3622
|
if (he !== void 0) {
|
|
3568
|
-
|
|
3623
|
+
o(u.name ?? u, E.DuplicateName, \`'\${p}': '\${Q}' is already the name of '\${he}' in this module.\`);
|
|
3569
3624
|
return;
|
|
3570
3625
|
}
|
|
3571
|
-
if (l.set(
|
|
3572
|
-
|
|
3626
|
+
if (l.set(Q.toUpperCase(), p), Y && i?.has(Q.toUpperCase())) {
|
|
3627
|
+
o(u.name ?? u, E.BuiltInName, \`'\${Q}' is a built-in function. Choose a different name - a calculation function cannot replace a built-in.\`);
|
|
3573
3628
|
return;
|
|
3574
3629
|
}
|
|
3575
|
-
if (
|
|
3576
|
-
const
|
|
3577
|
-
for (const [
|
|
3578
|
-
const ne =
|
|
3579
|
-
m(ne,
|
|
3630
|
+
if (Y) {
|
|
3631
|
+
const P = _.parameters ?? {};
|
|
3632
|
+
for (const [O, N] of Object.entries(P)) if (!X.has(O) && !N.description) {
|
|
3633
|
+
const ne = B.get(O);
|
|
3634
|
+
m(ne, E.MissingParamDescription, "warning", \`'\${p}': parameter '\${O}' is missing a description. Add an '@param \${O}' tag.\`);
|
|
3580
3635
|
}
|
|
3581
3636
|
}
|
|
3582
|
-
|
|
3637
|
+
a.push([v, _]);
|
|
3583
3638
|
} catch (C) {
|
|
3584
|
-
|
|
3639
|
+
o(u, E.ParseError, \`'\${p}': \${C.message}\`);
|
|
3585
3640
|
}
|
|
3586
3641
|
}
|
|
3587
3642
|
});
|
|
3588
3643
|
} catch (u) {
|
|
3589
|
-
|
|
3644
|
+
o(void 0, E.ParseError, \`Unable to analyze module: \${u?.message ?? u}\`);
|
|
3590
3645
|
}
|
|
3591
3646
|
return {
|
|
3592
|
-
functions:
|
|
3647
|
+
functions: a,
|
|
3593
3648
|
autoRun: c,
|
|
3594
3649
|
diagnostics: s
|
|
3595
3650
|
};
|
|
3596
3651
|
}
|
|
3597
|
-
const
|
|
3598
|
-
var
|
|
3599
|
-
async function
|
|
3600
|
-
return
|
|
3652
|
+
const Ye = "__SHEETXL";
|
|
3653
|
+
var pa = /* @__PURE__ */ or({ initialize: () => ma });
|
|
3654
|
+
async function ma() {
|
|
3655
|
+
return Te || (Te = new Promise(async (e, t) => {
|
|
3601
3656
|
try {
|
|
3602
|
-
const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, i = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`,
|
|
3657
|
+
const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, i = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`, a = (await import(
|
|
3603
3658
|
/* webpackIgnore: true */
|
|
3604
3659
|
/* @vite-ignore */
|
|
3605
3660
|
n
|
|
3606
3661
|
)).default;
|
|
3607
|
-
await
|
|
3662
|
+
await a.initialize({
|
|
3608
3663
|
wasmURL: i,
|
|
3609
3664
|
worker: !1
|
|
3610
|
-
}), e(
|
|
3665
|
+
}), e(a);
|
|
3611
3666
|
} catch (r) {
|
|
3612
|
-
console.error("Error initializing esbuild:", r),
|
|
3667
|
+
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
3668
|
}
|
|
3614
|
-
}),
|
|
3669
|
+
}), Te);
|
|
3615
3670
|
}
|
|
3616
|
-
var
|
|
3617
|
-
|
|
3671
|
+
var Te, ha = ar((() => {
|
|
3672
|
+
Te = null;
|
|
3618
3673
|
}));
|
|
3619
|
-
let
|
|
3620
|
-
async function
|
|
3621
|
-
if (
|
|
3622
|
-
if (
|
|
3623
|
-
if (await
|
|
3624
|
-
return
|
|
3674
|
+
let xe = null, Ve = null;
|
|
3675
|
+
async function ga() {
|
|
3676
|
+
if (xe) return xe;
|
|
3677
|
+
if (Ve) {
|
|
3678
|
+
if (await Ve, !xe) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
3679
|
+
return xe;
|
|
3625
3680
|
}
|
|
3626
3681
|
let e, t;
|
|
3627
|
-
|
|
3682
|
+
Ve = new Promise((r, n) => {
|
|
3628
3683
|
e = r, t = n;
|
|
3629
3684
|
});
|
|
3630
3685
|
try {
|
|
3631
|
-
const { initialize: r } = await Promise.resolve().then(() => (
|
|
3632
|
-
return
|
|
3686
|
+
const { initialize: r } = await Promise.resolve().then(() => (ha(), pa));
|
|
3687
|
+
return xe = await r(), e(), xe;
|
|
3633
3688
|
} catch (r) {
|
|
3634
|
-
throw console.error("Failed to import or initialize esbuild:", r),
|
|
3689
|
+
throw console.error("Failed to import or initialize esbuild:", r), Ve = null, t(r), r;
|
|
3635
3690
|
}
|
|
3636
3691
|
}
|
|
3637
|
-
const
|
|
3638
|
-
async function
|
|
3692
|
+
const ya = { compilerOptions: { target: "esnext" } };
|
|
3693
|
+
async function wa(e, t, r = "/script.js", n = Ye, i = !1) {
|
|
3639
3694
|
try {
|
|
3640
|
-
const
|
|
3695
|
+
const a = await ga(), l = "@sheetxl/primitives", s = \`
|
|
3641
3696
|
export const FormulaContext = globalThis.\${n}?.FormulaContext;
|
|
3642
3697
|
export const ScalarType = globalThis.\${n}?.ScalarType;
|
|
3643
3698
|
export const Observable = globalThis.\${n}?.Observable;
|
|
3644
3699
|
export const IRange = globalThis.\${n}?.IRange;
|
|
3645
3700
|
export const FormulaError = globalThis.\${n}?.FormulaError;
|
|
3646
3701
|
// Add more exports as needed
|
|
3647
|
-
\`, c = await
|
|
3702
|
+
\`, c = await a.build({
|
|
3648
3703
|
entryPoints: [r],
|
|
3649
3704
|
bundle: !0,
|
|
3650
3705
|
write: !1,
|
|
@@ -3653,22 +3708,22 @@ async function po(e, t, r = "/script.js", n = Ge, i = !1) {
|
|
|
3653
3708
|
name: "sheetxl-esbuild-in-memory",
|
|
3654
3709
|
setup(d) {
|
|
3655
3710
|
const m = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
|
|
3656
|
-
d.onResolve({ filter: new RegExp(\`^(\${r.replace("/", "\\\\/")}|\${l})$\`) }, (
|
|
3657
|
-
path:
|
|
3711
|
+
d.onResolve({ filter: new RegExp(\`^(\${r.replace("/", "\\\\/")}|\${l})$\`) }, (o) => ({
|
|
3712
|
+
path: o.path,
|
|
3658
3713
|
namespace: m
|
|
3659
|
-
})), d.onResolve({ filter: /.*/ }, (
|
|
3660
|
-
if (
|
|
3661
|
-
path:
|
|
3714
|
+
})), d.onResolve({ filter: /.*/ }, (o) => {
|
|
3715
|
+
if (o.namespace !== m) return console.warn(\`esbuild: Treating import "\${o.path}" as external.\`), {
|
|
3716
|
+
path: o.path,
|
|
3662
3717
|
external: !0
|
|
3663
3718
|
};
|
|
3664
3719
|
}), d.onLoad({
|
|
3665
3720
|
filter: /.*/,
|
|
3666
3721
|
namespace: m
|
|
3667
|
-
}, (
|
|
3722
|
+
}, (o) => {
|
|
3668
3723
|
let f;
|
|
3669
|
-
if (
|
|
3670
|
-
else if (
|
|
3671
|
-
else return { errors: [{ text: \`Cannot load unknown path in \${m}: \${
|
|
3724
|
+
if (o.path === r) f = t;
|
|
3725
|
+
else if (o.path === l) f = s;
|
|
3726
|
+
else return { errors: [{ text: \`Cannot load unknown path in \${m}: \${o.path}\` }] };
|
|
3672
3727
|
return {
|
|
3673
3728
|
contents: f,
|
|
3674
3729
|
loader: "ts"
|
|
@@ -3677,55 +3732,55 @@ async function po(e, t, r = "/script.js", n = Ge, i = !1) {
|
|
|
3677
3732
|
}
|
|
3678
3733
|
}],
|
|
3679
3734
|
sourcemap: "inline",
|
|
3680
|
-
tsconfigRaw:
|
|
3735
|
+
tsconfigRaw: ya,
|
|
3681
3736
|
minify: i,
|
|
3682
3737
|
platform: "neutral"
|
|
3683
3738
|
});
|
|
3684
3739
|
if (c.outputFiles && c.outputFiles.length > 0) return c.outputFiles[0].text;
|
|
3685
3740
|
throw c.errors && c.errors.length > 0 ? /* @__PURE__ */ new Error(\`esbuild bundling failed: \${c.errors.map((d) => d.text).join(\`
|
|
3686
3741
|
\`)}\`) : /* @__PURE__ */ new Error("esbuild did not produce an output file.");
|
|
3687
|
-
} catch (
|
|
3688
|
-
throw console.error("esbuild bundling process failed:",
|
|
3742
|
+
} catch (a) {
|
|
3743
|
+
throw console.error("esbuild bundling process failed:", a), a;
|
|
3689
3744
|
}
|
|
3690
3745
|
}
|
|
3691
|
-
function
|
|
3746
|
+
function Sa(e, t, r) {
|
|
3692
3747
|
return (n) => {
|
|
3693
|
-
const i = n.factory,
|
|
3694
|
-
const f =
|
|
3748
|
+
const i = n.factory, a = () => i.createExpressionStatement(i.createCallChain(i.createPropertyAccessExpression(i.createIdentifier(Ye), "checkRun"), i.createToken(e.SyntaxKind.QuestionDotToken), void 0, [i.createStringLiteral(t), i.createNumericLiteral(r)])), l = (o) => {
|
|
3749
|
+
const f = o.statements;
|
|
3695
3750
|
let b = 0;
|
|
3696
3751
|
for (; b < f.length && e.isExpressionStatement(f[b]) && e.isStringLiteral(f[b].expression);) b++;
|
|
3697
|
-
return i.updateBlock(
|
|
3752
|
+
return i.updateBlock(o, [
|
|
3698
3753
|
...f.slice(0, b),
|
|
3699
|
-
|
|
3754
|
+
a(),
|
|
3700
3755
|
...f.slice(b)
|
|
3701
3756
|
]);
|
|
3702
|
-
}, s = (
|
|
3703
|
-
if (d(
|
|
3704
|
-
const f =
|
|
3705
|
-
return e.visitEachChild(
|
|
3706
|
-
const
|
|
3707
|
-
return b === f ? s(
|
|
3757
|
+
}, s = (o) => e.isBlock(o) ? l(o) : i.createBlock([a(), o], !0), c = (o) => e.isBlock(o) ? l(o) : i.createBlock([a(), i.createReturnStatement(o)], !0), d = (o) => e.isForStatement(o) || e.isForInStatement(o) || e.isForOfStatement(o) || e.isWhileStatement(o) || e.isDoStatement(o), m = (o) => {
|
|
3758
|
+
if (d(o)) {
|
|
3759
|
+
const f = o.statement;
|
|
3760
|
+
return e.visitEachChild(o, (b) => {
|
|
3761
|
+
const S = m(b);
|
|
3762
|
+
return b === f ? s(S) : S;
|
|
3708
3763
|
}, n);
|
|
3709
3764
|
}
|
|
3710
|
-
if (e.isFunctionLike(
|
|
3711
|
-
const f =
|
|
3712
|
-
return e.visitEachChild(
|
|
3713
|
-
const
|
|
3714
|
-
return b === f ? c(
|
|
3765
|
+
if (e.isFunctionLike(o) && o.body) {
|
|
3766
|
+
const f = o.body;
|
|
3767
|
+
return e.visitEachChild(o, (b) => {
|
|
3768
|
+
const S = m(b);
|
|
3769
|
+
return b === f ? c(S) : S;
|
|
3715
3770
|
}, n);
|
|
3716
3771
|
}
|
|
3717
|
-
return e.visitEachChild(
|
|
3772
|
+
return e.visitEachChild(o, m, n);
|
|
3718
3773
|
};
|
|
3719
|
-
return (
|
|
3774
|
+
return (o) => e.visitNode(o, m);
|
|
3720
3775
|
};
|
|
3721
3776
|
}
|
|
3722
|
-
const
|
|
3723
|
-
var
|
|
3724
|
-
initialize: () =>
|
|
3725
|
-
readLibFile: () =>
|
|
3777
|
+
const rr = "//# sourceMappingURL";
|
|
3778
|
+
var an = /* @__PURE__ */ or({
|
|
3779
|
+
initialize: () => ba,
|
|
3780
|
+
readLibFile: () => va
|
|
3726
3781
|
});
|
|
3727
|
-
async function
|
|
3728
|
-
return
|
|
3782
|
+
async function ba() {
|
|
3783
|
+
return Ce || (Ce = new Promise(async (e, t) => {
|
|
3729
3784
|
let r = null;
|
|
3730
3785
|
try {
|
|
3731
3786
|
r = await import(
|
|
@@ -3736,14 +3791,14 @@ async function ho() {
|
|
|
3736
3791
|
} catch (n) {
|
|
3737
3792
|
console.error("Error initializing Browser TypeScript module:", n);
|
|
3738
3793
|
}
|
|
3739
|
-
r || (console.log("use script fallback"),
|
|
3740
|
-
}),
|
|
3794
|
+
r || (console.log("use script fallback"), Ce = null), e(r);
|
|
3795
|
+
}), Ce);
|
|
3741
3796
|
}
|
|
3742
|
-
function
|
|
3743
|
-
var
|
|
3744
|
-
|
|
3797
|
+
function va(e, t) {}
|
|
3798
|
+
var Ce, on = ar((() => {
|
|
3799
|
+
Ce = null;
|
|
3745
3800
|
}));
|
|
3746
|
-
const
|
|
3801
|
+
const Ea = \`
|
|
3747
3802
|
/**
|
|
3748
3803
|
* Represents the completion of an asynchronous operation
|
|
3749
3804
|
*/
|
|
@@ -3756,48 +3811,48 @@ interface Promise<T> {
|
|
|
3756
3811
|
*/
|
|
3757
3812
|
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
3758
3813
|
}
|
|
3759
|
-
\`,
|
|
3814
|
+
\`, _a = \`
|
|
3760
3815
|
interface FirstTest {
|
|
3761
3816
|
isTrue?: boolean;
|
|
3762
3817
|
}
|
|
3763
|
-
\`,
|
|
3764
|
-
let
|
|
3765
|
-
const
|
|
3766
|
-
\`,
|
|
3818
|
+
\`, xa = async () => _a;
|
|
3819
|
+
let Ge = null;
|
|
3820
|
+
const st = "sheetxl.d.ts", nr = "sheetxl-modules.d.ts", Ta = \`declare module '@sheetxl/primitives' { export = SheetXL; }
|
|
3821
|
+
\`, Ca = [
|
|
3767
3822
|
"lib.webworker.d.ts",
|
|
3768
3823
|
"lib.es2020.d.ts",
|
|
3769
3824
|
"lib.esnext.asynciterable.d.ts"
|
|
3770
|
-
],
|
|
3771
|
-
let
|
|
3772
|
-
async function
|
|
3773
|
-
return
|
|
3774
|
-
const t = await
|
|
3825
|
+
], ir = /* @__PURE__ */ new Map();
|
|
3826
|
+
let ct = null, ut = null;
|
|
3827
|
+
async function Aa() {
|
|
3828
|
+
return ut || (ut = Promise.resolve().then(() => (on(), an)).then(async (e) => {
|
|
3829
|
+
const t = await ln();
|
|
3775
3830
|
return e.readLibFile(t, "lib.es5.d.ts") !== void 0 ? e.readLibFile : null;
|
|
3776
|
-
})),
|
|
3831
|
+
})), ut;
|
|
3777
3832
|
}
|
|
3778
|
-
async function
|
|
3779
|
-
if (
|
|
3833
|
+
async function ln() {
|
|
3834
|
+
if (Ge) return Ge;
|
|
3780
3835
|
try {
|
|
3781
|
-
const e = await (await Promise.resolve().then(() => (
|
|
3836
|
+
const e = await (await Promise.resolve().then(() => (on(), an))).initialize();
|
|
3782
3837
|
if (!e) throw new Error("TypeScript could not be loaded. Check your connection and try again.");
|
|
3783
3838
|
return e;
|
|
3784
3839
|
} catch (e) {
|
|
3785
|
-
throw
|
|
3840
|
+
throw Ge = null, e;
|
|
3786
3841
|
} finally {
|
|
3787
|
-
|
|
3842
|
+
Ge = null;
|
|
3788
3843
|
}
|
|
3789
3844
|
}
|
|
3790
|
-
async function
|
|
3845
|
+
async function Ia(e) {
|
|
3791
3846
|
const t = e?.source ?? null;
|
|
3792
3847
|
if (!t) return {
|
|
3793
3848
|
module: null,
|
|
3794
3849
|
diagnostics: []
|
|
3795
3850
|
};
|
|
3796
|
-
const r = (e.disableBundle || e.declarationsOnly) ?? !1, [n, i,
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
e.ambientTypes ?
|
|
3800
|
-
]), l =
|
|
3851
|
+
const r = (e.disableBundle || e.declarationsOnly) ?? !1, [n, i, a] = await Promise.all([
|
|
3852
|
+
xa(),
|
|
3853
|
+
ln(),
|
|
3854
|
+
e.ambientTypes ? Aa() : null
|
|
3855
|
+
]), l = a ? e.ambientTypes ?? null : null;
|
|
3801
3856
|
let s = "";
|
|
3802
3857
|
const c = {
|
|
3803
3858
|
allowJs: !0,
|
|
@@ -3812,98 +3867,98 @@ async function _o(e) {
|
|
|
3812
3867
|
emitDeclarationOnly: !1,
|
|
3813
3868
|
target: i.ScriptTarget.ES2020,
|
|
3814
3869
|
...l ? {
|
|
3815
|
-
lib:
|
|
3870
|
+
lib: Ca,
|
|
3816
3871
|
skipLibCheck: !0,
|
|
3817
3872
|
strict: !0
|
|
3818
3873
|
} : {}
|
|
3819
|
-
}, d = "script", m = \`\${d}.ts\`,
|
|
3874
|
+
}, d = "script", m = \`\${d}.ts\`, o = "lib.d.ts", f = "global.d.ts", b = {
|
|
3820
3875
|
[m]: t,
|
|
3821
|
-
[
|
|
3876
|
+
[o]: Ea,
|
|
3822
3877
|
[f]: n,
|
|
3823
3878
|
...l ? {
|
|
3824
|
-
[
|
|
3825
|
-
[
|
|
3879
|
+
[st]: l,
|
|
3880
|
+
[nr]: Ta
|
|
3826
3881
|
} : {}
|
|
3827
|
-
},
|
|
3828
|
-
getSourceFile: (p,
|
|
3829
|
-
if (p ===
|
|
3882
|
+
}, S = (p) => b[p] ?? (a && p.startsWith("lib.") ? a(i, p) : void 0), A = {
|
|
3883
|
+
getSourceFile: (p, v, _, C) => {
|
|
3884
|
+
if (p === st) return ct?.text !== l && (ct = {
|
|
3830
3885
|
text: l,
|
|
3831
3886
|
file: i.createSourceFile(p, l, i.ScriptTarget.Latest, !1)
|
|
3832
|
-
}),
|
|
3887
|
+
}), ct.file;
|
|
3833
3888
|
if (b[p] === void 0) {
|
|
3834
|
-
let
|
|
3835
|
-
if (!
|
|
3836
|
-
const
|
|
3837
|
-
if (
|
|
3838
|
-
|
|
3889
|
+
let M = ir.get(p);
|
|
3890
|
+
if (!M) {
|
|
3891
|
+
const z = S(p);
|
|
3892
|
+
if (z === void 0) return;
|
|
3893
|
+
M = i.createSourceFile(p, z, i.ScriptTarget.Latest, !1), ir.set(p, M);
|
|
3839
3894
|
}
|
|
3840
|
-
return
|
|
3895
|
+
return M;
|
|
3841
3896
|
}
|
|
3842
3897
|
return i.createSourceFile(p, b[p], i.ScriptTarget.Latest, !0);
|
|
3843
3898
|
},
|
|
3844
|
-
fileExists: (p) =>
|
|
3845
|
-
readFile:
|
|
3846
|
-
writeFile: (p,
|
|
3847
|
-
b[p] =
|
|
3899
|
+
fileExists: (p) => S(p) !== void 0,
|
|
3900
|
+
readFile: S,
|
|
3901
|
+
writeFile: (p, v) => {
|
|
3902
|
+
b[p] = v;
|
|
3848
3903
|
},
|
|
3849
3904
|
getCurrentDirectory: () => "./",
|
|
3850
3905
|
getCanonicalFileName: (p) => p,
|
|
3851
3906
|
useCaseSensitiveFileNames: () => !0,
|
|
3852
|
-
getDefaultLibFileName: (p) =>
|
|
3907
|
+
getDefaultLibFileName: (p) => o,
|
|
3853
3908
|
getNewLine: () => \`
|
|
3854
3909
|
\`
|
|
3855
|
-
},
|
|
3910
|
+
}, k = i.createProgram([
|
|
3856
3911
|
m,
|
|
3857
3912
|
f,
|
|
3858
|
-
...l ? [
|
|
3859
|
-
], c, A), h =
|
|
3860
|
-
|
|
3861
|
-
const
|
|
3913
|
+
...l ? [st, nr] : []
|
|
3914
|
+
], c, A), h = k.getTypeChecker(), y = k.getSourceFile(m), w = e.runGuard;
|
|
3915
|
+
k.emit(void 0, void 0, void 0, void 0, w ? { before: [Sa(i, w.key, w.timeoutMs)] } : void 0), s = b[\`\${d}.js\`] ?? "";
|
|
3916
|
+
const D = (p) => ({
|
|
3862
3917
|
start: p.start ?? 0,
|
|
3863
3918
|
length: p.length ?? 0,
|
|
3864
3919
|
severity: p.category === i.DiagnosticCategory.Warning ? "warning" : "error",
|
|
3865
3920
|
code: \`TS\${p.code}\`,
|
|
3866
3921
|
message: i.flattenDiagnosticMessageText(p.messageText, \`
|
|
3867
3922
|
\`)
|
|
3868
|
-
}),
|
|
3923
|
+
}), K = k.getSyntacticDiagnostics(y).map(D), L = l ? k.getSemanticDiagnostics(y).filter((p) => p.category === i.DiagnosticCategory.Error || p.category === i.DiagnosticCategory.Warning).map(D) : [], R = fa(i, y, h, {
|
|
3869
3924
|
builtInNames: e.builtInNames,
|
|
3870
3925
|
isBuiltIn: e.isBuiltIn,
|
|
3871
3926
|
lenient: e.lenient
|
|
3872
3927
|
});
|
|
3873
|
-
let
|
|
3874
|
-
...
|
|
3928
|
+
let F = [
|
|
3929
|
+
...K,
|
|
3875
3930
|
...L,
|
|
3876
3931
|
...R.diagnostics
|
|
3877
3932
|
];
|
|
3878
|
-
e.lenient && (
|
|
3879
|
-
const
|
|
3880
|
-
let
|
|
3881
|
-
if (
|
|
3933
|
+
e.lenient && (F = F.filter((p) => p.code !== E.MissingType));
|
|
3934
|
+
const de = R.functions, we = R.autoRun, te = F.some((p) => p.severity === "error"), Ze = \`\${lr.uuidV4()}-script\`;
|
|
3935
|
+
let Ie = null;
|
|
3936
|
+
if (te) s = "";
|
|
3882
3937
|
else {
|
|
3883
3938
|
try {
|
|
3884
|
-
r || (s = await
|
|
3939
|
+
r || (s = await wa(i, s, d, void 0, e.minify ?? !1));
|
|
3885
3940
|
} catch {
|
|
3886
3941
|
console.warn("Error bundling script");
|
|
3887
3942
|
}
|
|
3888
|
-
const p = s.indexOf(
|
|
3889
|
-
p > -1 && (
|
|
3943
|
+
const p = s.indexOf(rr);
|
|
3944
|
+
p > -1 && (Ie = s.substring(p + 20 + 1, s.length), s = s.substring(0, p), s = s.replaceAll("globalThis." + Ye, Ye));
|
|
3890
3945
|
}
|
|
3891
|
-
const
|
|
3892
|
-
functions:
|
|
3893
|
-
commitId:
|
|
3946
|
+
const u = {
|
|
3947
|
+
functions: de,
|
|
3948
|
+
commitId: Ze,
|
|
3894
3949
|
source: t,
|
|
3895
3950
|
language: "typescript",
|
|
3896
3951
|
compiled: s
|
|
3897
3952
|
};
|
|
3898
|
-
return
|
|
3899
|
-
module:
|
|
3900
|
-
diagnostics:
|
|
3953
|
+
return Ie && (u.sourceMap = Ie), we && (u.autoRun = we), {
|
|
3954
|
+
module: u,
|
|
3955
|
+
diagnostics: F
|
|
3901
3956
|
};
|
|
3902
3957
|
}
|
|
3903
3958
|
self.addEventListener("message", async (e) => {
|
|
3904
3959
|
const { id: t, params: r } = e.data;
|
|
3905
3960
|
try {
|
|
3906
|
-
const n = await
|
|
3961
|
+
const n = await Ia(r);
|
|
3907
3962
|
self.postMessage({
|
|
3908
3963
|
id: t,
|
|
3909
3964
|
result: n,
|
|
@@ -3921,11 +3976,11 @@ self.addEventListener("message", async (e) => {
|
|
|
3921
3976
|
});
|
|
3922
3977
|
}
|
|
3923
3978
|
});
|
|
3924
|
-
`,
|
|
3979
|
+
`, o = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", s], { type: "text/javascript;charset=utf-8" });
|
|
3925
3980
|
function d(t) {
|
|
3926
3981
|
let n;
|
|
3927
3982
|
try {
|
|
3928
|
-
if (n =
|
|
3983
|
+
if (n = o && (self.URL || self.webkitURL).createObjectURL(o), !n) throw "";
|
|
3929
3984
|
const e = new Worker(n, { type: "module", name: t?.name });
|
|
3930
3985
|
return e.addEventListener("error", () => {
|
|
3931
3986
|
(self.URL || self.webkitURL).revokeObjectURL(n);
|
|
@@ -3934,7 +3989,7 @@ function d(t) {
|
|
|
3934
3989
|
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(s), { type: "module", name: t?.name });
|
|
3935
3990
|
}
|
|
3936
3991
|
}
|
|
3937
|
-
async function
|
|
3992
|
+
async function p() {
|
|
3938
3993
|
if (globalThis.process?.versions?.node && typeof Worker > "u") return await l();
|
|
3939
3994
|
if (typeof Worker < "u") {
|
|
3940
3995
|
const t = new c(() => new d());
|
|
@@ -3947,9 +4002,9 @@ async function m() {
|
|
|
3947
4002
|
return await l();
|
|
3948
4003
|
}
|
|
3949
4004
|
var l = async () => {
|
|
3950
|
-
const { compileModule: t } = await import("./
|
|
4005
|
+
const { compileModule: t } = await import("./CwhaPB7R93eqixfq.mjs"), n = new u((e) => t(e));
|
|
3951
4006
|
return await n.start(), n;
|
|
3952
4007
|
};
|
|
3953
4008
|
export {
|
|
3954
|
-
|
|
4009
|
+
p as createCompilerWorker
|
|
3955
4010
|
};
|