@silurus/ooxml 0.72.1 → 0.72.2
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/dist/{docx-CM-oHSyZ.js → docx-wLLJuetI.js} +2490 -2077
- package/dist/docx.mjs +2 -2
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{find-cursor-CABDFafh.js → find-cursor-DBifiZop.js} +941 -923
- package/dist/{highlight-rect-DIReGC3z.js → highlight-rect-DTgfiJgA.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{pptx-WoReGPPJ.js → pptx-D3L4FQfI.js} +4 -4
- package/dist/pptx.mjs +2 -2
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/render-worker-host-B5esxBj-.js +27 -0
- package/dist/render-worker-host-BzhGwe0I.js +27 -0
- package/dist/render-worker-host-Cg60RAG_.js +27 -0
- package/dist/{segments-2VsQNClV.js → segments--0hIQLXB.js} +1 -1
- package/dist/types/docx.d.ts +18 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/{visible-index-YRawP6W8.js → visible-index-DSN5XPnm.js} +1 -1
- package/dist/{xlsx-CHfWgWy8.js → xlsx-BWEqRZ25.js} +343 -336
- package/dist/xlsx.mjs +2 -2
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/render-worker-host-BNYGV6vm.js +0 -27
- package/dist/render-worker-host-CJc3E4ej.js +0 -27
- package/dist/render-worker-host-DcfYux0W.js +0 -27
|
@@ -235,13 +235,13 @@ function te(e, t, n, r, i, a) {
|
|
|
235
235
|
if (i < 0 || i + s > c.length) return null;
|
|
236
236
|
let o = Math.min(s, a.size - u);
|
|
237
237
|
l.set(c.subarray(i, i + o), u), u += o;
|
|
238
|
-
let h =
|
|
238
|
+
let h = ne(e, t, n, r, m, d);
|
|
239
239
|
if (h === null) return null;
|
|
240
240
|
d = h;
|
|
241
241
|
}
|
|
242
242
|
return u === a.size ? l : null;
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function ne(e, t, n, r, i, a) {
|
|
245
245
|
let { sectorSize: o } = n, s = Math.floor(a / i), c = a % i, l = n.firstMiniFatSector, u = /* @__PURE__ */ new Set();
|
|
246
246
|
for (let n = 0; n < s; n++) {
|
|
247
247
|
if (!k(l) || u.has(l)) return null;
|
|
@@ -258,7 +258,7 @@ function P(e, t, n, r, i, a) {
|
|
|
258
258
|
}
|
|
259
259
|
//#endregion
|
|
260
260
|
//#region packages/core/src/crypto/encryption-info.ts
|
|
261
|
-
function
|
|
261
|
+
function re(e) {
|
|
262
262
|
if (typeof atob == "function") {
|
|
263
263
|
let t = atob(e), n = new Uint8Array(t.length);
|
|
264
264
|
for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
|
|
@@ -268,19 +268,19 @@ function ne(e) {
|
|
|
268
268
|
if (t) return new Uint8Array(t.from(e, "base64"));
|
|
269
269
|
throw Error("no base64 decoder available");
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function P(e, t, n) {
|
|
272
272
|
let r = RegExp(`<(?:[\\w]+:)?${t}\\b[^>]*>`).exec(e);
|
|
273
273
|
if (!r) return null;
|
|
274
274
|
let i = r[0], a = RegExp(`\\b${n}\\s*=\\s*"([^"]*)"`).exec(i);
|
|
275
275
|
return a ? a[1] : null;
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function F(e) {
|
|
278
278
|
if (e === null) return null;
|
|
279
279
|
let t = Number(e);
|
|
280
280
|
return Number.isFinite(t) ? t : null;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
let n =
|
|
282
|
+
function I(e, t) {
|
|
283
|
+
let n = F(P(e, t, "saltSize")), r = F(P(e, t, "blockSize")), i = F(P(e, t, "keyBits")), a = F(P(e, t, "hashSize")), o = P(e, t, "cipherAlgorithm"), s = P(e, t, "cipherChaining"), c = P(e, t, "hashAlgorithm"), l = P(e, t, "saltValue");
|
|
284
284
|
return n === null || r === null || i === null || a === null || !o || !s || !c || l === null ? null : {
|
|
285
285
|
saltSize: n,
|
|
286
286
|
blockSize: r,
|
|
@@ -289,14 +289,14 @@ function L(e, t) {
|
|
|
289
289
|
cipherAlgorithm: o,
|
|
290
290
|
cipherChaining: s,
|
|
291
291
|
hashAlgorithm: c,
|
|
292
|
-
saltValue:
|
|
292
|
+
saltValue: re(l)
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function L(e) {
|
|
296
296
|
if (e.length < 8) return { kind: "unknown" };
|
|
297
297
|
let t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = t.getUint16(0, !0), r = t.getUint16(2, !0);
|
|
298
298
|
if (n === 4 && r === 4) {
|
|
299
|
-
let t =
|
|
299
|
+
let t = R(e.subarray(8));
|
|
300
300
|
return t ? {
|
|
301
301
|
kind: "agile",
|
|
302
302
|
descriptor: t
|
|
@@ -304,21 +304,21 @@ function R(e) {
|
|
|
304
304
|
}
|
|
305
305
|
return r === 16 && (n === 3 || n === 4) ? { kind: "extensible" } : r === 2 && (n === 2 || n === 3 || n === 4) ? { kind: "standard" } : { kind: "unknown" };
|
|
306
306
|
}
|
|
307
|
-
function
|
|
308
|
-
let t = new TextDecoder("utf-8").decode(e), n =
|
|
307
|
+
function R(e) {
|
|
308
|
+
let t = new TextDecoder("utf-8").decode(e), n = I(t, "keyData"), r = I(t, "encryptedKey");
|
|
309
309
|
if (!n || !r) return null;
|
|
310
|
-
let i =
|
|
310
|
+
let i = F(P(t, "encryptedKey", "spinCount")), a = P(t, "encryptedKey", "encryptedVerifierHashInput"), o = P(t, "encryptedKey", "encryptedVerifierHashValue"), s = P(t, "encryptedKey", "encryptedKeyValue");
|
|
311
311
|
if (i === null || a === null || o === null || s === null) return null;
|
|
312
312
|
let c = {
|
|
313
313
|
...r,
|
|
314
314
|
spinCount: i,
|
|
315
|
-
encryptedVerifierHashInput:
|
|
316
|
-
encryptedVerifierHashValue:
|
|
317
|
-
encryptedKeyValue:
|
|
318
|
-
}, l = null, u =
|
|
315
|
+
encryptedVerifierHashInput: re(a),
|
|
316
|
+
encryptedVerifierHashValue: re(o),
|
|
317
|
+
encryptedKeyValue: re(s)
|
|
318
|
+
}, l = null, u = P(t, "dataIntegrity", "encryptedHmacKey"), d = P(t, "dataIntegrity", "encryptedHmacValue");
|
|
319
319
|
return u !== null && d !== null && (l = {
|
|
320
|
-
encryptedHmacKey:
|
|
321
|
-
encryptedHmacValue:
|
|
320
|
+
encryptedHmacKey: re(u),
|
|
321
|
+
encryptedHmacValue: re(d)
|
|
322
322
|
}), {
|
|
323
323
|
keyData: n,
|
|
324
324
|
passwordKeyEncryptor: c,
|
|
@@ -327,7 +327,7 @@ function z(e) {
|
|
|
327
327
|
}
|
|
328
328
|
//#endregion
|
|
329
329
|
//#region packages/core/src/crypto/agile.ts
|
|
330
|
-
var
|
|
330
|
+
var z = {
|
|
331
331
|
verifierHashInput: new Uint8Array([
|
|
332
332
|
254,
|
|
333
333
|
167,
|
|
@@ -378,32 +378,32 @@ var B = {
|
|
|
378
378
|
132,
|
|
379
379
|
51
|
|
380
380
|
])
|
|
381
|
-
},
|
|
381
|
+
}, B = 54, V = 4096, H = class extends Error {
|
|
382
382
|
reason;
|
|
383
383
|
constructor(e, t) {
|
|
384
384
|
super(t), this.name = "AgileDecryptError", this.reason = e;
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
function
|
|
387
|
+
function U() {
|
|
388
388
|
let e = globalThis.crypto;
|
|
389
|
-
if (!e || !e.subtle) throw new
|
|
389
|
+
if (!e || !e.subtle) throw new H("unsupported-encryption", "WebCrypto (globalThis.crypto.subtle) is unavailable; cannot decrypt.");
|
|
390
390
|
return e.subtle;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function ie(e) {
|
|
393
393
|
switch (e.toUpperCase().replace(/[-_]/g, "")) {
|
|
394
394
|
case "SHA512": return "SHA-512";
|
|
395
395
|
case "SHA384": return "SHA-384";
|
|
396
396
|
case "SHA256": return "SHA-256";
|
|
397
397
|
case "SHA1": return "SHA-1";
|
|
398
|
-
default: throw new
|
|
398
|
+
default: throw new H("unsupported-encryption", `Unsupported hashAlgorithm "${e}" (only SHA-1/256/384/512).`);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
function
|
|
402
|
-
if (e.cipherAlgorithm.toUpperCase() !== "AES") throw new
|
|
403
|
-
if (e.cipherChaining.toLowerCase() !== "chainingmodecbc") throw new
|
|
404
|
-
if (e.keyBits !== 128 && e.keyBits !== 192 && e.keyBits !== 256) throw new
|
|
401
|
+
function W(e) {
|
|
402
|
+
if (e.cipherAlgorithm.toUpperCase() !== "AES") throw new H("unsupported-encryption", `Unsupported cipherAlgorithm "${e.cipherAlgorithm}" (only AES).`);
|
|
403
|
+
if (e.cipherChaining.toLowerCase() !== "chainingmodecbc") throw new H("unsupported-encryption", `Unsupported cipherChaining "${e.cipherChaining}" (only ChainingModeCBC).`);
|
|
404
|
+
if (e.keyBits !== 128 && e.keyBits !== 192 && e.keyBits !== 256) throw new H("unsupported-encryption", `Unsupported keyBits ${e.keyBits} (only 128/192/256).`);
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function G(...e) {
|
|
407
407
|
let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
|
|
408
408
|
for (let t of e) n.set(t, r), r += t.length;
|
|
409
409
|
return n;
|
|
@@ -418,29 +418,29 @@ function oe(e) {
|
|
|
418
418
|
return t;
|
|
419
419
|
}
|
|
420
420
|
async function se(e, t) {
|
|
421
|
-
return new Uint8Array(await
|
|
421
|
+
return new Uint8Array(await U().digest(e, t));
|
|
422
422
|
}
|
|
423
423
|
function ce(e, t) {
|
|
424
424
|
if (e.length > t) return e.slice(0, t);
|
|
425
425
|
let n = new Uint8Array(t);
|
|
426
|
-
return n.set(e), e.length < t && n.fill(
|
|
426
|
+
return n.set(e), e.length < t && n.fill(B, e.length), n;
|
|
427
427
|
}
|
|
428
428
|
async function le(e, t, n, r) {
|
|
429
|
-
let i =
|
|
430
|
-
for (let e = 0; e < n; e++) a = await se(i,
|
|
431
|
-
return ce(await se(i,
|
|
429
|
+
let i = ie(t.hashAlgorithm), a = await se(i, G(t.saltValue, oe(e)));
|
|
430
|
+
for (let e = 0; e < n; e++) a = await se(i, G(ae(e), a));
|
|
431
|
+
return ce(await se(i, G(a, r)), t.keyBits / 8);
|
|
432
432
|
}
|
|
433
433
|
async function K(e, t, n) {
|
|
434
|
-
return ce(n ? await se(
|
|
434
|
+
return ce(n ? await se(ie(e.hashAlgorithm), G(t, n)) : t, e.blockSize);
|
|
435
435
|
}
|
|
436
436
|
async function q(e, t, n) {
|
|
437
437
|
let r = t.length;
|
|
438
438
|
if (n.length === 0) return new Uint8Array();
|
|
439
|
-
if (n.length % r !== 0) throw new
|
|
440
|
-
let i = await
|
|
439
|
+
if (n.length % r !== 0) throw new H("corrupt", "ciphertext length is not a multiple of the block size");
|
|
440
|
+
let i = await U().importKey("raw", e, { name: "AES-CBC" }, !1, ["decrypt"]), a = await U().importKey("raw", e, { name: "AES-CBC" }, !1, ["encrypt"]), o = n.subarray(n.length - r), s = ue(new Uint8Array(r).fill(r), o), c = G(n, new Uint8Array(await U().encrypt({
|
|
441
441
|
name: "AES-CBC",
|
|
442
442
|
iv: new Uint8Array(r)
|
|
443
|
-
}, a, s)).subarray(0, r)), l = new Uint8Array(await
|
|
443
|
+
}, a, s)).subarray(0, r)), l = new Uint8Array(await U().decrypt({
|
|
444
444
|
name: "AES-CBC",
|
|
445
445
|
iv: t
|
|
446
446
|
}, i, c));
|
|
@@ -452,8 +452,8 @@ function ue(e, t) {
|
|
|
452
452
|
return n;
|
|
453
453
|
}
|
|
454
454
|
async function J(e, t) {
|
|
455
|
-
|
|
456
|
-
let n =
|
|
455
|
+
W(t);
|
|
456
|
+
let n = ie(t.hashAlgorithm), r = await q(await le(e, t, t.spinCount, z.verifierHashInput), await K(t, t.saltValue, null), t.encryptedVerifierHashInput), i = await q(await le(e, t, t.spinCount, z.verifierHashValue), await K(t, t.saltValue, null), t.encryptedVerifierHashValue);
|
|
457
457
|
return de((await se(n, r)).subarray(0, t.hashSize), i.subarray(0, t.hashSize));
|
|
458
458
|
}
|
|
459
459
|
function de(e, t) {
|
|
@@ -463,23 +463,23 @@ function de(e, t) {
|
|
|
463
463
|
return n === 0;
|
|
464
464
|
}
|
|
465
465
|
async function fe(e, t) {
|
|
466
|
-
return await q(await le(e, t, t.spinCount,
|
|
466
|
+
return await q(await le(e, t, t.spinCount, z.keyValue), await K(t, t.saltValue, null), t.encryptedKeyValue);
|
|
467
467
|
}
|
|
468
468
|
async function pe(e, t, n) {
|
|
469
|
-
if (
|
|
469
|
+
if (W(t), e.length < 8) throw new H("corrupt", "EncryptedPackage is shorter than its size prefix");
|
|
470
470
|
let r = new DataView(e.buffer, e.byteOffset, e.byteLength), i = Number(r.getBigUint64(0, !0)), a = e.subarray(8);
|
|
471
|
-
if (i > a.length) throw new
|
|
471
|
+
if (i > a.length) throw new H("corrupt", "EncryptedPackage size prefix exceeds the ciphertext");
|
|
472
472
|
let o = n.slice(0, t.keyBits / 8), s = new Uint8Array(i), c = 0, l = 0;
|
|
473
|
-
for (let e = 0; e < a.length; e +=
|
|
474
|
-
let n = a.subarray(e, e +
|
|
473
|
+
for (let e = 0; e < a.length; e += V) {
|
|
474
|
+
let n = a.subarray(e, e + V), r = await q(o, await K(t, t.saltValue, ae(l)), n), u = Math.min(r.length, i - c);
|
|
475
475
|
if (s.set(r.subarray(0, u), c), c += u, l++, c >= i) break;
|
|
476
476
|
}
|
|
477
|
-
if (c !== i) throw new
|
|
477
|
+
if (c !== i) throw new H("corrupt", "decrypted output is shorter than the declared size");
|
|
478
478
|
return s;
|
|
479
479
|
}
|
|
480
480
|
async function me(e, t, n) {
|
|
481
481
|
let { keyData: r, passwordKeyEncryptor: i } = e;
|
|
482
|
-
if (
|
|
482
|
+
if (W(r), W(i), !await J(n, i)) throw new H("invalid-password", "The supplied password is incorrect.");
|
|
483
483
|
return pe(t, r, await fe(n, i));
|
|
484
484
|
}
|
|
485
485
|
//#endregion
|
|
@@ -491,7 +491,7 @@ async function _e(e, t) {
|
|
|
491
491
|
ok: !1,
|
|
492
492
|
reason: "corrupt"
|
|
493
493
|
};
|
|
494
|
-
let i =
|
|
494
|
+
let i = L(n);
|
|
495
495
|
if (i.kind !== "agile") return {
|
|
496
496
|
ok: !1,
|
|
497
497
|
reason: "unsupported-encryption"
|
|
@@ -502,7 +502,7 @@ async function _e(e, t) {
|
|
|
502
502
|
data: await me(i.descriptor, r, t)
|
|
503
503
|
};
|
|
504
504
|
} catch (e) {
|
|
505
|
-
return e instanceof
|
|
505
|
+
return e instanceof H ? {
|
|
506
506
|
ok: !1,
|
|
507
507
|
reason: e.reason
|
|
508
508
|
} : {
|
|
@@ -2013,7 +2013,7 @@ function _n(e, t, n, r) {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
function vn(e, t, n, r, i, a, o, s = null) {
|
|
2015
2015
|
if (s) {
|
|
2016
|
-
|
|
2016
|
+
nr(e, r + a / 2, i + o / 2, s.symbol, o, s.fill, s.line, 1);
|
|
2017
2017
|
return;
|
|
2018
2018
|
}
|
|
2019
2019
|
if (e.fillStyle = n, t === "line") {
|
|
@@ -2024,11 +2024,11 @@ function vn(e, t, n, r, i, a, o, s = null) {
|
|
|
2024
2024
|
e.moveTo(r, s), e.lineTo(r + a, s), e.stroke(), e.lineWidth = t;
|
|
2025
2025
|
} else e.fillRect(r, i, a, o);
|
|
2026
2026
|
}
|
|
2027
|
-
function yn(e, t, n, r = !1) {
|
|
2027
|
+
function yn(e, t, n, r = !1, i = []) {
|
|
2028
2028
|
if (r || ln(t)) {
|
|
2029
|
-
let n = e[0],
|
|
2030
|
-
return Array.from({ length:
|
|
2031
|
-
label: (
|
|
2029
|
+
let n = e[0], a = n ? n.values.length : 0, o = n?.categories ?? i;
|
|
2030
|
+
return Array.from({ length: a }, (n, i) => ({
|
|
2031
|
+
label: (o[i] ?? `Item ${i + 1}`).toString(),
|
|
2032
2032
|
color: dn(t, e, i, r),
|
|
2033
2033
|
marker: null
|
|
2034
2034
|
}));
|
|
@@ -2045,19 +2045,19 @@ var bn = {
|
|
|
2045
2045
|
bold: !1,
|
|
2046
2046
|
sizePx: null
|
|
2047
2047
|
};
|
|
2048
|
-
function xn(e, t, n, r, i, a, o = "vertical", s, c = bn, l, u = !1) {
|
|
2049
|
-
let
|
|
2048
|
+
function xn(e, t, n, r, i, a, o = "vertical", s, c = bn, l, u = !1, d = []) {
|
|
2049
|
+
let f = hn(s), p = yn(t, s, l, u, d), m = c.bold ? "bold " : "";
|
|
2050
2050
|
if (o === "horizontal") {
|
|
2051
2051
|
let t = c.sizePx ?? Math.max(9, Math.min(12, a * .7));
|
|
2052
|
-
e.font = `${
|
|
2053
|
-
let o = Math.max(1,
|
|
2054
|
-
for (let n = 0; n <
|
|
2052
|
+
e.font = `${m}${t}px ${c.fontFamily}`, e.textBaseline = "middle";
|
|
2053
|
+
let o = Math.max(1, p.length), s = i - 10 - 4, l = p.map((t) => Pt(e, t.label, s)), u = l.map((t) => 14 + e.measureText(t).width), d = n + (i - (u.reduce((e, t) => e + t, 0) + 12 * (o - 1))) / 2, h = r + a / 2;
|
|
2054
|
+
for (let n = 0; n < p.length; n++) vn(e, f, p[n].color, d, h - t / 2, 10, t, p[n].marker), e.fillStyle = c.color, e.textAlign = "left", e.fillText(l[n], d + 10 + 4, h), d += u[n] + 12;
|
|
2055
2055
|
return;
|
|
2056
2056
|
}
|
|
2057
|
-
let
|
|
2058
|
-
e.font = `${
|
|
2059
|
-
let
|
|
2060
|
-
for (let t = 0; t <
|
|
2057
|
+
let h = c.sizePx ?? Math.max(9, Math.min(12, a / (p.length + 1)));
|
|
2058
|
+
e.font = `${m}${h}px ${c.fontFamily}`, e.textBaseline = "middle";
|
|
2059
|
+
let g = h + 4, _ = i - 10 - 4, v = r + (a - g * p.length) / 2;
|
|
2060
|
+
for (let t = 0; t < p.length; t++) vn(e, f, p[t].color, n, v, 10, h, p[t].marker), e.fillStyle = c.color, e.textAlign = "left", e.fillText(Pt(e, p[t].label, _), n + 10 + 4, v + h / 2), v += g;
|
|
2061
2061
|
}
|
|
2062
2062
|
function Sn(e) {
|
|
2063
2063
|
let t = cn(e, e.legendFontFace) ?? e.themeMinorFontLatin;
|
|
@@ -2073,21 +2073,21 @@ function Cn(e, t, n, r, i, a, o, s, c, l, u, d) {
|
|
|
2073
2073
|
let f = Sn(t), p = un(t), m = t.legendManualLayout;
|
|
2074
2074
|
if (m && m.xMode === "edge" && m.yMode === "edge" && m.w > 0 && m.h > 0) {
|
|
2075
2075
|
let n = r + m.x * a, s = i + m.y * o, c = m.w * a, l = m.h * o, u = c >= l ? "horizontal" : "vertical";
|
|
2076
|
-
xn(e, t.series, n, s, c, l, u, t.chartType, f, t.scatterStyle, p);
|
|
2076
|
+
xn(e, t.series, n, s, c, l, u, t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2077
2077
|
return;
|
|
2078
2078
|
}
|
|
2079
2079
|
switch (n.side) {
|
|
2080
2080
|
case "r":
|
|
2081
|
-
xn(e, t.series, r + a - n.reserveW + 4, c, n.reserveW - 8, u, "vertical", t.chartType, f, t.scatterStyle, p);
|
|
2081
|
+
xn(e, t.series, r + a - n.reserveW + 4, c, n.reserveW - 8, u, "vertical", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2082
2082
|
break;
|
|
2083
2083
|
case "l":
|
|
2084
|
-
xn(e, t.series, r + 4, c, n.reserveW - 8, u, "vertical", t.chartType, f, t.scatterStyle, p);
|
|
2084
|
+
xn(e, t.series, r + 4, c, n.reserveW - 8, u, "vertical", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2085
2085
|
break;
|
|
2086
2086
|
case "t":
|
|
2087
|
-
xn(e, t.series, s, i + d, l, n.reserveH, "horizontal", t.chartType, f, t.scatterStyle, p);
|
|
2087
|
+
xn(e, t.series, s, i + d, l, n.reserveH, "horizontal", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2088
2088
|
break;
|
|
2089
2089
|
case "b":
|
|
2090
|
-
xn(e, t.series, s, i + o - n.reserveH, l, n.reserveH, "horizontal", t.chartType, f, t.scatterStyle, p);
|
|
2090
|
+
xn(e, t.series, s, i + o - n.reserveH, l, n.reserveH, "horizontal", t.chartType, f, t.scatterStyle, p, t.categories);
|
|
2091
2091
|
break;
|
|
2092
2092
|
}
|
|
2093
2093
|
}
|
|
@@ -2265,40 +2265,40 @@ function Wn(e, t, n, r, i, a, o, s, c, l = !1) {
|
|
|
2265
2265
|
function Gn(e, t, n, r) {
|
|
2266
2266
|
let { x: i, y: a, w: o, h: s } = n, c = t.chartType === "clusteredBarH" || t.chartType === "stackedBarH" || t.chartType === "stackedBarHPct", l = t.chartType.startsWith("stacked"), u = t.chartType === "stackedBarPct" || t.chartType === "stackedBarHPct", d = t.series.filter((e) => e.seriesType !== "line"), f = t.series.filter((e) => e.seriesType === "line"), p = !c && t.secondaryValAxis && f.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, m = Un(t), h = m.length;
|
|
2267
2267
|
if (h === 0) return;
|
|
2268
|
-
let g = un(t), _ = et(t, s, r), v = _.fontPx, y = _.topPad, b = _.bandH, x = Fn(t.catAxisFontSizeHpt, s, r), S = Fn(t.valAxisFontSizeHpt, s, r), C = qe(t, o, s, .22), { legRightW: w, legLeftW: T, legTopH: E, legBottomH: D } = Je(C), O = Ze(t, o, s, r), k = O.catFontPx, A = O.valFontPx, j = O.catBandH, M = O.valBandW, N = b + E + S / 2 + 2, ee = c ? (t.valAxisHidden ? s * .02 : tt(S)) + j + D : tt(x) + j + D, te = s - N - ee,
|
|
2268
|
+
let g = un(t), _ = et(t, s, r), v = _.fontPx, y = _.topPad, b = _.bandH, x = Fn(t.catAxisFontSizeHpt, s, r), S = Fn(t.valAxisFontSizeHpt, s, r), C = qe(t, o, s, .22), { legRightW: w, legLeftW: T, legTopH: E, legBottomH: D } = Je(C), O = Ze(t, o, s, r), k = O.catFontPx, A = O.valFontPx, j = O.catBandH, M = O.valBandW, N = b + E + S / 2 + 2, ee = c ? (t.valAxisHidden ? s * .02 : tt(S)) + j + D : tt(x) + j + D, te = s - N - ee, ne = c ? o - ((t.catAxisHidden ? o * .03 : o * .22) + M + T) - (w + o * .03) : 0, re = (c ? ne : te) / r, P = 0, F = 0;
|
|
2269
2269
|
for (let e = 0; e < h; e++) {
|
|
2270
2270
|
let t = 0, n = 0;
|
|
2271
2271
|
for (let r of d) {
|
|
2272
2272
|
let i = r.values[e] ?? 0;
|
|
2273
|
-
l ? i >= 0 ? t += i : n += i : (
|
|
2273
|
+
l ? i >= 0 ? t += i : n += i : (P = Math.max(P, i), F = Math.min(F, i));
|
|
2274
2274
|
}
|
|
2275
|
-
l && (
|
|
2275
|
+
l && (P = Math.max(P, t), F = Math.min(F, n));
|
|
2276
2276
|
}
|
|
2277
2277
|
if (!u) {
|
|
2278
2278
|
for (let e of f) if (!(p && e.useSecondaryAxis === !0)) for (let t = 0; t < h; t++) {
|
|
2279
2279
|
let n = e.values[t];
|
|
2280
|
-
n != null && (
|
|
2280
|
+
n != null && (P = Math.max(P, n), F = Math.min(F, n));
|
|
2281
2281
|
}
|
|
2282
2282
|
}
|
|
2283
|
-
u && (
|
|
2284
|
-
let
|
|
2283
|
+
u && (P = P > 0 ? 100 : 0, F = F < 0 ? -100 : 0), t.valMax != null && (P = t.valMax), t.valMin != null && (F = t.valMin), P === 0 && F === 0 && (P = 1);
|
|
2284
|
+
let I = Nn(t, F, P, re), { min: L, max: R, step: z } = I, B = Bn(p, f, te / r), V = B ? B.min : 0, H = B ? B.max : 1, U = B ? B.step : 1, ie = Math.max(8, Math.min(11, s / 20)), W = Math.max(8, Math.min(11, te / 20)), G = e.font, ae = 0;
|
|
2285
2285
|
if (!c && !t.valAxisHidden) {
|
|
2286
|
-
e.font = `${
|
|
2287
|
-
let n = 0, r = Math.round((
|
|
2286
|
+
e.font = `${W}px ${X(t, t.valAxisFontFace, "minor")}`;
|
|
2287
|
+
let n = 0, r = Math.round((R - L) / z);
|
|
2288
2288
|
for (let i = 0; i <= r; i++) {
|
|
2289
|
-
let r =
|
|
2289
|
+
let r = L + i * z, a = u ? `${Math.round(r)}%` : Y(r, t.valAxisFormatCode, t.date1904);
|
|
2290
2290
|
n = Math.max(n, e.measureText(a).width);
|
|
2291
2291
|
}
|
|
2292
2292
|
ae = n + 16;
|
|
2293
2293
|
}
|
|
2294
|
-
let oe = p?.fontSizeHpt ? p.fontSizeHpt / 100 * r :
|
|
2294
|
+
let oe = p?.fontSizeHpt ? p.fontSizeHpt / 100 * r : ie, se = 0;
|
|
2295
2295
|
if (p && !p.hidden) {
|
|
2296
2296
|
e.font = `${oe}px sans-serif`;
|
|
2297
|
-
let n = 0, r = Math.round((
|
|
2298
|
-
for (let i = 0; i <= r; i++) n = Math.max(n, e.measureText(Y(
|
|
2297
|
+
let n = 0, r = Math.round((H - V) / U);
|
|
2298
|
+
for (let i = 0; i <= r; i++) n = Math.max(n, e.measureText(Y(V + i * U, p.formatCode ?? null, t.date1904)).width);
|
|
2299
2299
|
se = n + 18;
|
|
2300
2300
|
}
|
|
2301
|
-
e.font =
|
|
2301
|
+
e.font = G;
|
|
2302
2302
|
let ce = p && p.title ? (p.titleFontSizeHpt ? p.titleFontSizeHpt / 100 * r : Math.max(9, s * .05)) + 8 : 0, le = {
|
|
2303
2303
|
t: N,
|
|
2304
2304
|
r: w + o * .03 + se + ce,
|
|
@@ -2314,18 +2314,18 @@ function Gn(e, t, n, r) {
|
|
|
2314
2314
|
});
|
|
2315
2315
|
if (ue <= 0 || J <= 0) return;
|
|
2316
2316
|
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(K, q, ue, J));
|
|
2317
|
-
let de =
|
|
2317
|
+
let de = H - V || 1, fe = R - L || 1, pe = (e) => q + J - I.frac(e) * J, me = (e) => K + I.frac(e) * ue, he = pe(0), ge = me(0), _e = pe, ve = B ? B.makeToY(q, J) : pe, ye = En(t, r), be = Math.round(fe / z);
|
|
2318
2318
|
e.textBaseline = "middle", e.font = `${Math.max(8, Math.min(11, J / 20))}px ${X(t, t.valAxisFontFace, "minor")}`;
|
|
2319
2319
|
let xe = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555";
|
|
2320
2320
|
if (e.fillStyle = xe, !t.valAxisHidden) {
|
|
2321
|
-
for (let t of
|
|
2321
|
+
for (let t of I.minorLines) if (!c) Tn(e, K, ue, pe(t), !1, ye);
|
|
2322
2322
|
else {
|
|
2323
2323
|
let n = me(t);
|
|
2324
2324
|
e.strokeStyle = ye.color, e.lineWidth = ye.width, e.beginPath(), e.moveTo(n, q), e.lineTo(n, q + J), e.stroke();
|
|
2325
2325
|
}
|
|
2326
2326
|
let n = Mn(t), r = t.valAxisTickLabelPos !== "none";
|
|
2327
|
-
for (let i of
|
|
2328
|
-
let a = Math.abs(i) <
|
|
2327
|
+
for (let i of I.majorLines) {
|
|
2328
|
+
let a = Math.abs(i) < z * 1e-9, o = u ? `${Math.round(i)}%` : Y(i, t.valAxisFormatCode, t.date1904);
|
|
2329
2329
|
if (c) {
|
|
2330
2330
|
let t = me(i);
|
|
2331
2331
|
n && (e.strokeStyle = ye.explicit ? ye.color : a ? "#aaa" : ye.color, e.lineWidth = ye.explicit ? ye.width : a ? 1 : ye.width, e.beginPath(), e.moveTo(t, q), e.lineTo(t, q + J), e.stroke()), r && (e.textAlign = "center", e.fillText(o, t, q + J + 10));
|
|
@@ -2353,7 +2353,7 @@ function Gn(e, t, n, r) {
|
|
|
2353
2353
|
e.strokeStyle = a, e.lineWidth = o, e.beginPath(), e.moveTo(t, n), e.lineTo(r, i), e.stroke();
|
|
2354
2354
|
}, De = !t.catAxisHidden && !t.catAxisLineHidden, Oe = !t.valAxisHidden && !t.valAxisLineHidden && t.valAxisLineColor != null, ke = () => {
|
|
2355
2355
|
if (c ? (De && Ee(K, q, K, q + J, Se, Ce), Oe && Ee(K, q + J, K + ue, q + J, we, Te)) : (De && Ee(K, q + J, K + ue, q + J, Se, Ce), Oe && Ee(K, q, K, q + J, we, Te)), !t.valAxisHidden && t.valAxisMajorTickMark && t.valAxisMajorTickMark !== "none") for (let n = 0; n <= be; n++) {
|
|
2356
|
-
let r =
|
|
2356
|
+
let r = L + n * z;
|
|
2357
2357
|
c ? wn(e, t.valAxisMajorTickMark, "cat", q + J, me(r), we, Te) : wn(e, t.valAxisMajorTickMark, "val", K, pe(r), we, Te);
|
|
2358
2358
|
}
|
|
2359
2359
|
if (!t.catAxisHidden && t.catAxisMajorTickMark && t.catAxisMajorTickMark !== "none") {
|
|
@@ -2421,9 +2421,9 @@ function Gn(e, t, n, r) {
|
|
|
2421
2421
|
let n = K + ue, { color: i, width: a } = gt(p.lineColor, p.lineWidthEmu, r);
|
|
2422
2422
|
if (p.lineHidden || Ee(n, q, n, q + J, i, a), !p.hidden) {
|
|
2423
2423
|
e.font = `${oe}px sans-serif`, e.fillStyle = p.fontColor ? `#${p.fontColor}` : xe, e.textAlign = "left", e.textBaseline = "middle";
|
|
2424
|
-
let r = Math.max(1, Math.round(de /
|
|
2424
|
+
let r = Math.max(1, Math.round(de / U));
|
|
2425
2425
|
for (let o = 0; o <= r; o++) {
|
|
2426
|
-
let r =
|
|
2426
|
+
let r = V + o * U, s = ve(r);
|
|
2427
2427
|
wn(e, p.majorTickMark, "val", n, s, i, a, !0), e.fillText(Y(r, p.formatCode ?? null, t.date1904), n + 14, s);
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
@@ -2449,68 +2449,68 @@ function Kn(e, t, n, r) {
|
|
|
2449
2449
|
let r = 0;
|
|
2450
2450
|
for (let i = 0; i <= e; i++) r += t.series[i].values[n] ?? 0;
|
|
2451
2451
|
return d && f ? r / f[n] * 100 : r;
|
|
2452
|
-
}, h = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, g = (e) => h != null && e.useSecondaryAxis === !0, _ = et(t, s, r), v = _.fontPx, y = _.topPad, b = _.bandH, x = qe(t, o, s, .22), { legRightW: S, legLeftW: C, legTopH: w, legBottomH: T } = Je(x), E = Fn(t.catAxisFontSizeHpt, s, r), D = Fn(t.valAxisFontSizeHpt, s, r), O = Ze(t, o, s, r), k = O.catFontPx, A = O.valFontPx, j = O.catBandH, M = O.valBandW, N = b + w + D / 2 + 2, ee = tt(E) + j + T, te = s - N - ee,
|
|
2453
|
-
if (h &&
|
|
2452
|
+
}, h = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, g = (e) => h != null && e.useSecondaryAxis === !0, _ = et(t, s, r), v = _.fontPx, y = _.topPad, b = _.bandH, x = qe(t, o, s, .22), { legRightW: S, legLeftW: C, legTopH: w, legBottomH: T } = Je(x), E = Fn(t.catAxisFontSizeHpt, s, r), D = Fn(t.valAxisFontSizeHpt, s, r), O = Ze(t, o, s, r), k = O.catFontPx, A = O.valFontPx, j = O.catBandH, M = O.valBandW, N = b + w + D / 2 + 2, ee = tt(E) + j + T, te = s - N - ee, ne = Bn(h, t.series, te / r), re = Math.max(8, Math.min(11, s / 20)), P = h?.fontSizeHpt ? h.fontSizeHpt / 100 * r : re, F = 0;
|
|
2453
|
+
if (h && ne && !h.hidden) {
|
|
2454
2454
|
let n = e.font;
|
|
2455
|
-
e.font = `${
|
|
2456
|
-
let r = 0, i = Math.round((
|
|
2457
|
-
for (let n = 0; n <= i; n++) r = Math.max(r, e.measureText(Y(
|
|
2458
|
-
|
|
2455
|
+
e.font = `${P}px sans-serif`;
|
|
2456
|
+
let r = 0, i = Math.round((ne.max - ne.min) / ne.step);
|
|
2457
|
+
for (let n = 0; n <= i; n++) r = Math.max(r, e.measureText(Y(ne.min + n * ne.step, h.formatCode ?? null, t.date1904)).width);
|
|
2458
|
+
F = r + 18, e.font = n;
|
|
2459
2459
|
}
|
|
2460
|
-
let
|
|
2460
|
+
let I = h && h.title ? (h.titleFontSizeHpt ? h.titleFontSizeHpt / 100 * r : Math.max(9, s * .05)) + 8 : 0, L = {
|
|
2461
2461
|
t: N,
|
|
2462
|
-
r: S + o * .05 +
|
|
2462
|
+
r: S + o * .05 + F + I,
|
|
2463
2463
|
b: ee,
|
|
2464
2464
|
l: D * 2.2 + 10 + M + C
|
|
2465
2465
|
};
|
|
2466
2466
|
Hn(e, t, i, a + y, o, v);
|
|
2467
|
-
let { plotRect: { px0:
|
|
2467
|
+
let { plotRect: { px0: R, py0: z, pw: B, ph: V } } = nt(t, i, a, o, s, r, {
|
|
2468
2468
|
titleBand: _,
|
|
2469
2469
|
legendSideReserveFrac: .22,
|
|
2470
|
-
pad:
|
|
2470
|
+
pad: L
|
|
2471
2471
|
});
|
|
2472
|
-
if (
|
|
2473
|
-
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(z, B, V
|
|
2474
|
-
let
|
|
2472
|
+
if (B <= 0 || V <= 0) return;
|
|
2473
|
+
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(R, z, B, V));
|
|
2474
|
+
let H = Infinity, U = -Infinity;
|
|
2475
2475
|
for (let e = 0; e < l; e++) for (let n = 0; n < t.series.length; n++) {
|
|
2476
2476
|
if (g(t.series[n]) || !u && t.series[n].values[e] == null) continue;
|
|
2477
2477
|
let r = m(n, e);
|
|
2478
|
-
|
|
2478
|
+
H = Math.min(H, r), U = Math.max(U, r);
|
|
2479
2479
|
}
|
|
2480
|
-
isFinite(
|
|
2481
|
-
let
|
|
2482
|
-
t.valMin == null ?
|
|
2483
|
-
let
|
|
2484
|
-
if (
|
|
2485
|
-
let
|
|
2480
|
+
isFinite(H) || (H = 0, U = 1);
|
|
2481
|
+
let ie = t.valAxisLogBase != null && t.valAxisLogBase >= 2;
|
|
2482
|
+
t.valMin == null ? H > 0 && !ie && (H = 0) : H = t.valMin, t.valMax == null ? U < 0 && (U = 0) : U = t.valMax, U === H && (U = H + 1);
|
|
2483
|
+
let W = Nn(t, H, U, V / r);
|
|
2484
|
+
if (W.max - W.min === 0) return;
|
|
2485
|
+
let G = (e) => z + V - W.frac(e) * V, ae = ne ? ne.makeToY(z, V) : G, oe = (e) => g(e) ? ae : G, se = vt(t), ce = jn(t), le = se ? (e) => R + ((ce ? l - 1 - e : e) + .5) / l * B : (e) => {
|
|
2486
2486
|
let t = ce ? l - 1 - e : e;
|
|
2487
|
-
return
|
|
2487
|
+
return R + (l === 1 ? B / 2 : t / (l - 1) * B);
|
|
2488
2488
|
};
|
|
2489
2489
|
if (!t.valAxisHidden) {
|
|
2490
2490
|
e.font = `${D}px ${X(t, t.valAxisFontFace, "minor")}`, e.textBaseline = "middle";
|
|
2491
2491
|
let n = En(t, r);
|
|
2492
|
-
for (let t of
|
|
2492
|
+
for (let t of W.minorLines) Tn(e, R, B, G(t), !1, n);
|
|
2493
2493
|
let i = Mn(t), a = t.valAxisTickLabelPos !== "none";
|
|
2494
|
-
for (let r of
|
|
2495
|
-
let o =
|
|
2496
|
-
i && Tn(e,
|
|
2494
|
+
for (let r of W.majorLines) {
|
|
2495
|
+
let o = G(r);
|
|
2496
|
+
i && Tn(e, R, B, o, r === 0, n), wn(e, t.valAxisMajorTickMark, "val", R, o), a && (e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555", e.textAlign = "right", e.fillText(Y(r, t.valAxisFormatCode, t.date1904), R - 6, o));
|
|
2497
2497
|
}
|
|
2498
2498
|
}
|
|
2499
2499
|
if (!t.catAxisHidden && Dn(t)) {
|
|
2500
2500
|
let n = On(t, r);
|
|
2501
2501
|
e.strokeStyle = n.color, e.lineWidth = n.width;
|
|
2502
2502
|
for (let n of kn(t, l)) {
|
|
2503
|
-
let t =
|
|
2504
|
-
e.beginPath(), e.moveTo(t,
|
|
2503
|
+
let t = R + n * B;
|
|
2504
|
+
e.beginPath(), e.moveTo(t, z), e.lineTo(t, z + V), e.stroke();
|
|
2505
2505
|
}
|
|
2506
2506
|
}
|
|
2507
|
-
e.strokeStyle = "#aaa", e.lineWidth = 1, !t.catAxisHidden && !t.catAxisLineHidden && (e.beginPath(), e.moveTo(
|
|
2507
|
+
e.strokeStyle = "#aaa", e.lineWidth = 1, !t.catAxisHidden && !t.catAxisLineHidden && (e.beginPath(), e.moveTo(R, z + V), e.lineTo(R + B, z + V), e.stroke()), !t.valAxisHidden && !t.valAxisLineHidden && (e.beginPath(), e.moveTo(R, z), e.lineTo(R, z + V), e.stroke());
|
|
2508
2508
|
let K = Math.max(1, 2.25 * r), q = Math.max(2, 2.5 * r), ue = Fn(t.dataLabelFontSizeHpt, s, r);
|
|
2509
2509
|
for (let n = 0; n < t.series.length; n++) {
|
|
2510
2510
|
let i = t.series[n], a = an(n, i), o = oe(i);
|
|
2511
2511
|
e.strokeStyle = a, e.lineWidth = K, e.setLineDash([]), e.beginPath();
|
|
2512
2512
|
let s = i.smooth === !0, d = [], f = () => {
|
|
2513
|
-
d.length !== 0 && (e.moveTo(d[0].x, d[0].y),
|
|
2513
|
+
d.length !== 0 && (e.moveTo(d[0].x, d[0].y), sr(e, d, s), d = []);
|
|
2514
2514
|
};
|
|
2515
2515
|
for (let e = 0; e < l; e++) {
|
|
2516
2516
|
if (!u && i.values[e] == null) {
|
|
@@ -2527,9 +2527,9 @@ function Kn(e, t, n, r) {
|
|
|
2527
2527
|
}
|
|
2528
2528
|
f(), e.stroke();
|
|
2529
2529
|
let h = (e) => m(n, e);
|
|
2530
|
-
for (let t of i.errBars ?? [])
|
|
2530
|
+
for (let t of i.errBars ?? []) ur(e, i, t, l, le, o, h, a);
|
|
2531
2531
|
e.fillStyle = a;
|
|
2532
|
-
let g = i.showMarker !== !1, _ =
|
|
2532
|
+
let g = i.showMarker !== !1, _ = lr(i), v = dr(e, i, c, l, le, o, h, V, r, t.date1904 ?? !1, u || p === "zero", X(t, t.dataLabelFontFace, "minor"), t.dataLabelPosition ?? "r");
|
|
2533
2533
|
v && (e.fillStyle = a);
|
|
2534
2534
|
for (let s = 0; s < l; s++) {
|
|
2535
2535
|
if (!u && i.values[s] == null && p !== "zero") continue;
|
|
@@ -2538,85 +2538,85 @@ function Kn(e, t, n, r) {
|
|
|
2538
2538
|
let t = (i.dataPointOverrides ?? []).find((e) => e.idx === s), n = t?.markerSymbol ?? i.markerSymbol ?? "circle";
|
|
2539
2539
|
if (n !== "none") {
|
|
2540
2540
|
let l = t?.markerSize ?? i.markerSize ?? 5, u = t?.markerFill ?? t?.color ?? i.markerFill ?? a, d = t?.markerLine ?? i.markerLine ?? null;
|
|
2541
|
-
|
|
2541
|
+
nr(e, le(s), o(c), n, l, u, d, r);
|
|
2542
2542
|
}
|
|
2543
2543
|
} else e.beginPath(), e.arc(le(s), o(c), q, 0, Math.PI * 2), e.fill();
|
|
2544
|
-
t.showDataLabels && !v && (
|
|
2544
|
+
t.showDataLabels && !v && (ar(e, le(s), o(c), Et(c), t.dataLabelPosition ?? "r", ue, void 0, !1, X(t, t.dataLabelFontFace, "minor"), g ? q + 1 : 2), e.fillStyle = a);
|
|
2545
2545
|
}
|
|
2546
2546
|
Pn(e, i, a, le, o, r);
|
|
2547
2547
|
}
|
|
2548
2548
|
if (!t.catAxisHidden) {
|
|
2549
2549
|
let n = Math.max(1, Math.ceil(l / 8)), r = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555";
|
|
2550
2550
|
e.fillStyle = r, e.textAlign = "center", e.textBaseline = "top", e.font = `${E}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
2551
|
-
let i =
|
|
2551
|
+
let i = B / l * n - 4, a = In(t), o = Rn(t);
|
|
2552
2552
|
for (let s = 0; s < l; s += n) {
|
|
2553
2553
|
let n = le(s);
|
|
2554
|
-
wn(e, t.catAxisMajorTickMark, "cat",
|
|
2554
|
+
wn(e, t.catAxisMajorTickMark, "cat", z + V, n), a && (e.fillStyle = r, zn(e, Pt(e, Dt((c[s] ?? "").toString(), t.catAxisFormatCode, t.date1904), o === 0 ? i : V * .4), n, z + V + 5, o));
|
|
2555
2555
|
}
|
|
2556
2556
|
}
|
|
2557
|
-
if (h &&
|
|
2557
|
+
if (h && ne) {
|
|
2558
2558
|
let n = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555";
|
|
2559
|
-
Vn(e, h,
|
|
2559
|
+
Vn(e, h, ne, ae, R, z, B, V, s, r, P, F, n, t.date1904);
|
|
2560
2560
|
}
|
|
2561
|
-
Cn(e, t, x, i, a, o, s, z, B, V,
|
|
2561
|
+
Cn(e, t, x, i, a, o, s, R, z, B, V, b + 2), mn(e, t, i, a, o, s, R, z, B, V, C, T, k, A);
|
|
2562
2562
|
}
|
|
2563
2563
|
function qn(e, t, n, r) {
|
|
2564
2564
|
let { x: i, y: a, w: o, h: s } = n, c = Un(t), l = c.length;
|
|
2565
2565
|
if (l === 0) return;
|
|
2566
|
-
let u = t.series, d = u.length >= 4, f = d ? 0 : -1, p = +!!d, m = d ? 2 : 1, h = d ? 3 : 2, g = u[p], _ = u[m], v = u[h], y = f >= 0 ? u[f] : void 0, b = et(t, s, r), x = b.fontPx, S = b.topPad, C = b.bandH, w = qe(t, o, s, .22), { legRightW: T, legLeftW: E, legBottomH: D, legTopH: O } = Je(w), k = Fn(t.catAxisFontSizeHpt, s, r), A = Fn(t.valAxisFontSizeHpt, s, r), j = Ze(t, o, s, r), M = j.catFontPx, N = j.valFontPx, ee = j.catBandH, te = j.valBandW,
|
|
2567
|
-
t:
|
|
2566
|
+
let u = t.series, d = u.length >= 4, f = d ? 0 : -1, p = +!!d, m = d ? 2 : 1, h = d ? 3 : 2, g = u[p], _ = u[m], v = u[h], y = f >= 0 ? u[f] : void 0, b = et(t, s, r), x = b.fontPx, S = b.topPad, C = b.bandH, w = qe(t, o, s, .22), { legRightW: T, legLeftW: E, legBottomH: D, legTopH: O } = Je(w), k = Fn(t.catAxisFontSizeHpt, s, r), A = Fn(t.valAxisFontSizeHpt, s, r), j = Ze(t, o, s, r), M = j.catFontPx, N = j.valFontPx, ee = j.catBandH, te = j.valBandW, ne = C + O + A / 2 + 2, re = tt(k) + ee + D, P = {
|
|
2567
|
+
t: ne,
|
|
2568
2568
|
r: T + o * .05,
|
|
2569
|
-
b:
|
|
2569
|
+
b: re,
|
|
2570
2570
|
l: A * 2.2 + 10 + te + E
|
|
2571
2571
|
};
|
|
2572
2572
|
Hn(e, t, i, a + S, o, x);
|
|
2573
|
-
let { plotRect: { px0:
|
|
2573
|
+
let { plotRect: { px0: F, py0: I, pw: L, ph: R } } = nt(t, i, a, o, s, r, {
|
|
2574
2574
|
titleBand: b,
|
|
2575
2575
|
legendSideReserveFrac: .22,
|
|
2576
|
-
pad:
|
|
2576
|
+
pad: P
|
|
2577
2577
|
});
|
|
2578
|
-
if (
|
|
2579
|
-
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(I, L, R
|
|
2580
|
-
let
|
|
2578
|
+
if (L <= 0 || R <= 0) return;
|
|
2579
|
+
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(F, I, L, R));
|
|
2580
|
+
let z = Infinity, B = -Infinity;
|
|
2581
2581
|
for (let e of u) for (let t = 0; t < l; t++) {
|
|
2582
2582
|
let n = e.values[t];
|
|
2583
|
-
n != null && (
|
|
2583
|
+
n != null && (z = Math.min(z, n), B = Math.max(B, n));
|
|
2584
2584
|
}
|
|
2585
|
-
isFinite(
|
|
2586
|
-
let
|
|
2587
|
-
if (
|
|
2588
|
-
let
|
|
2589
|
-
let t =
|
|
2590
|
-
return
|
|
2585
|
+
isFinite(z) || (z = 0, B = 1), t.valMin == null ? z > 0 && (z = 0) : z = t.valMin, t.valMax == null ? B < 0 && (B = 0) : B = t.valMax, B === z && (B = z + 1);
|
|
2586
|
+
let V = Nn(t, z, B, R / r);
|
|
2587
|
+
if (V.max - V.min === 0) return;
|
|
2588
|
+
let H = (e) => I + R - V.frac(e) * R, U = vt(t), ie = jn(t), W = U ? (e) => F + ((ie ? l - 1 - e : e) + .5) / l * L : (e) => {
|
|
2589
|
+
let t = ie ? l - 1 - e : e;
|
|
2590
|
+
return F + (l === 1 ? L / 2 : t / (l - 1) * L);
|
|
2591
2591
|
};
|
|
2592
2592
|
if (!t.valAxisHidden) {
|
|
2593
2593
|
e.font = `${A}px ${X(t, t.valAxisFontFace, "minor")}`, e.textBaseline = "middle";
|
|
2594
2594
|
let n = En(t, r);
|
|
2595
|
-
for (let t of
|
|
2595
|
+
for (let t of V.minorLines) Tn(e, F, L, H(t), !1, n);
|
|
2596
2596
|
let i = Mn(t), a = t.valAxisTickLabelPos !== "none";
|
|
2597
|
-
for (let r of
|
|
2598
|
-
let o =
|
|
2599
|
-
i && Tn(e,
|
|
2597
|
+
for (let r of V.majorLines) {
|
|
2598
|
+
let o = H(r);
|
|
2599
|
+
i && Tn(e, F, L, o, r === 0, n), wn(e, t.valAxisMajorTickMark, "val", F, o), a && (e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555", e.textAlign = "right", e.fillText(Y(r, t.valAxisFormatCode, t.date1904), F - 6, o));
|
|
2600
2600
|
}
|
|
2601
2601
|
}
|
|
2602
|
-
if (e.strokeStyle = "#aaa", e.lineWidth = 1, !t.catAxisHidden && !t.catAxisLineHidden && (e.beginPath(), e.moveTo(
|
|
2602
|
+
if (e.strokeStyle = "#aaa", e.lineWidth = 1, !t.catAxisHidden && !t.catAxisLineHidden && (e.beginPath(), e.moveTo(F, I + R), e.lineTo(F + L, I + R), e.stroke()), !t.valAxisHidden && !t.valAxisLineHidden && (e.beginPath(), e.moveTo(F, I), e.lineTo(F, I + R), e.stroke()), (t.stockHiLowLines ?? !0) && g != null && _ != null && g && _) {
|
|
2603
2603
|
e.strokeStyle = t.stockHiLowLineColor ? `#${t.stockHiLowLineColor}` : "#595959", e.lineWidth = Math.max(1, .75 * r), e.setLineDash([]);
|
|
2604
2604
|
for (let t = 0; t < l; t++) {
|
|
2605
2605
|
let n = g.values[t], r = _.values[t];
|
|
2606
2606
|
if (n == null || r == null) continue;
|
|
2607
|
-
let i =
|
|
2608
|
-
e.beginPath(), e.moveTo(i,
|
|
2607
|
+
let i = W(t);
|
|
2608
|
+
e.beginPath(), e.moveTo(i, H(n)), e.lineTo(i, H(r)), e.stroke();
|
|
2609
2609
|
}
|
|
2610
2610
|
}
|
|
2611
|
-
let
|
|
2611
|
+
let G = (t, n, i) => {
|
|
2612
2612
|
if (!t) return;
|
|
2613
|
-
let a = an(n, t), o = t.markerSymbol ?? null, s = o != null && o !== "none" &&
|
|
2613
|
+
let a = an(n, t), o = t.markerSymbol ?? null, s = o != null && o !== "none" && lr(t), c = Math.max(3, L / l * .22);
|
|
2614
2614
|
for (let n = 0; n < l; n++) {
|
|
2615
2615
|
let l = t.values[n];
|
|
2616
2616
|
if (l == null) continue;
|
|
2617
|
-
let u =
|
|
2617
|
+
let u = W(n), d = H(l);
|
|
2618
2618
|
if (s) {
|
|
2619
|
-
|
|
2619
|
+
nr(e, u, d, o, t.markerSize ?? 3, t.markerFill ?? a, t.markerLine ?? null, r);
|
|
2620
2620
|
continue;
|
|
2621
2621
|
}
|
|
2622
2622
|
e.strokeStyle = a, e.lineWidth = Math.max(1, .75 * r), e.beginPath();
|
|
@@ -2624,17 +2624,17 @@ function qn(e, t, n, r) {
|
|
|
2624
2624
|
e.moveTo(f, d), e.lineTo(p, d), e.stroke();
|
|
2625
2625
|
}
|
|
2626
2626
|
};
|
|
2627
|
-
if (
|
|
2627
|
+
if (G(y, f, "left"), G(v, h, "right"), u.length < 3) for (let e = 0; e < u.length; e++) G(u[e], e, "both");
|
|
2628
2628
|
if (!t.catAxisHidden) {
|
|
2629
2629
|
let n = Math.max(1, Math.ceil(l / 8)), r = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555";
|
|
2630
2630
|
e.fillStyle = r, e.textAlign = "center", e.textBaseline = "top", e.font = `${k}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
2631
|
-
let i =
|
|
2631
|
+
let i = L / l * n - 4, a = In(t), o = Rn(t);
|
|
2632
2632
|
for (let s = 0; s < l; s += n) {
|
|
2633
|
-
let n =
|
|
2634
|
-
wn(e, t.catAxisMajorTickMark, "cat",
|
|
2633
|
+
let n = W(s);
|
|
2634
|
+
wn(e, t.catAxisMajorTickMark, "cat", I + R, n), a && (e.fillStyle = r, zn(e, Pt(e, Dt((c[s] ?? "").toString(), t.catAxisFormatCode, t.date1904), o === 0 ? i : R * .4), n, I + R + 5, o));
|
|
2635
2635
|
}
|
|
2636
2636
|
}
|
|
2637
|
-
Cn(e, t, w, i, a, o, s, I, L, R,
|
|
2637
|
+
Cn(e, t, w, i, a, o, s, F, I, L, R, C + 2), mn(e, t, i, a, o, s, F, I, L, R, E, D, M, N);
|
|
2638
2638
|
}
|
|
2639
2639
|
function Jn(e, t, n, r) {
|
|
2640
2640
|
let { x: i, y: a, w: o, h: s } = n, c = Un(t), l = c.length;
|
|
@@ -2646,71 +2646,71 @@ function Jn(e, t, n, r) {
|
|
|
2646
2646
|
}) : null, p = (e, n) => {
|
|
2647
2647
|
let r = t.series[e].values[n] ?? 0;
|
|
2648
2648
|
return d && f ? r / f[n] * 100 : r;
|
|
2649
|
-
}, m = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, h = (e) => m != null && e.useSecondaryAxis === !0, g = et(t, s, r), _ = g.fontPx, v = g.topPad, y = g.bandH, b = Fn(t.catAxisFontSizeHpt, s, r), x = Fn(t.valAxisFontSizeHpt, s, r), S = qe(t, o, s, .22), { legRightW: C, legLeftW: w, legTopH: T, legBottomH: E } = Je(S), D = Ze(t, o, s, r), O = D.catFontPx, k = D.valFontPx, A = D.catBandH, j = D.valBandW, M = y + T + x / 2 + 2, N = tt(b) + A + E, ee = s - M - N, te = Bn(m, t.series, ee / r),
|
|
2649
|
+
}, m = !u && t.secondaryValAxis && t.series.some((e) => e.useSecondaryAxis === !0) ? t.secondaryValAxis : null, h = (e) => m != null && e.useSecondaryAxis === !0, g = et(t, s, r), _ = g.fontPx, v = g.topPad, y = g.bandH, b = Fn(t.catAxisFontSizeHpt, s, r), x = Fn(t.valAxisFontSizeHpt, s, r), S = qe(t, o, s, .22), { legRightW: C, legLeftW: w, legTopH: T, legBottomH: E } = Je(S), D = Ze(t, o, s, r), O = D.catFontPx, k = D.valFontPx, A = D.catBandH, j = D.valBandW, M = y + T + x / 2 + 2, N = tt(b) + A + E, ee = s - M - N, te = Bn(m, t.series, ee / r), ne = Math.max(8, Math.min(11, s / 20)), re = m?.fontSizeHpt ? m.fontSizeHpt / 100 * r : ne, P = 0;
|
|
2650
2650
|
if (m && te && !m.hidden) {
|
|
2651
2651
|
let n = e.font;
|
|
2652
|
-
e.font = `${
|
|
2652
|
+
e.font = `${re}px sans-serif`;
|
|
2653
2653
|
let r = 0, i = Math.round((te.max - te.min) / te.step);
|
|
2654
2654
|
for (let n = 0; n <= i; n++) r = Math.max(r, e.measureText(Y(te.min + n * te.step, m.formatCode ?? null, t.date1904)).width);
|
|
2655
|
-
|
|
2655
|
+
P = r + 18, e.font = n;
|
|
2656
2656
|
}
|
|
2657
|
-
let
|
|
2657
|
+
let F = m && m.title ? (m.titleFontSizeHpt ? m.titleFontSizeHpt / 100 * r : Math.max(9, s * .05)) + 8 : 0, I = {
|
|
2658
2658
|
t: M,
|
|
2659
|
-
r: C + o * .05 +
|
|
2659
|
+
r: C + o * .05 + P + F,
|
|
2660
2660
|
b: N,
|
|
2661
2661
|
l: o * .12 + j + w
|
|
2662
2662
|
};
|
|
2663
2663
|
Hn(e, t, i, a + v, o, _);
|
|
2664
|
-
let { plotRect: { px0:
|
|
2664
|
+
let { plotRect: { px0: L, py0: R, pw: z, ph: B } } = nt(t, i, a, o, s, r, {
|
|
2665
2665
|
titleBand: g,
|
|
2666
2666
|
legendSideReserveFrac: .22,
|
|
2667
|
-
pad:
|
|
2667
|
+
pad: I
|
|
2668
2668
|
});
|
|
2669
|
-
if (
|
|
2670
|
-
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(R, z, B
|
|
2671
|
-
let
|
|
2669
|
+
if (z <= 0 || B <= 0) return;
|
|
2670
|
+
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(L, R, z, B));
|
|
2671
|
+
let V = 0;
|
|
2672
2672
|
for (let e = 0; e < l; e++) if (u) {
|
|
2673
2673
|
let n = 0;
|
|
2674
2674
|
for (let r = 0; r < t.series.length; r++) n += p(r, e);
|
|
2675
|
-
|
|
2676
|
-
} else for (let n of t.series) h(n) || (
|
|
2677
|
-
d && (
|
|
2678
|
-
let { max:
|
|
2675
|
+
V = Math.max(V, n);
|
|
2676
|
+
} else for (let n of t.series) h(n) || (V = Math.max(V, n.values[e] ?? 0));
|
|
2677
|
+
d && (V = V > 0 ? 100 : 0), t.valMax != null && (V = t.valMax), V === 0 && (V = 1);
|
|
2678
|
+
let { max: H, step: U } = ct(0, V, void 0, t.valMax, B / r, t.valAxisMajorUnit), ie = vt(t), W = ie ? (e) => L + (e + .5) / l * z : (e) => L + (l === 1 ? z / 2 : e / (l - 1) * z), G = (e) => R + B - e / H * B, ae = te ? te.makeToY(R, B) : G, oe = (e) => h(e) ? ae : G, { color: se, width: ce } = gt(t.catAxisLineColor, t.catAxisLineWidthEmu, r), { color: le, width: K } = gt(t.valAxisLineColor, t.valAxisLineWidthEmu, r);
|
|
2679
2679
|
if (!t.valAxisHidden) {
|
|
2680
2680
|
let n = En(t, r), i = t.valAxisMinorUnit;
|
|
2681
|
-
if (t.valAxisMinorGridlines && i != null && isFinite(i) && i > 0 && i <
|
|
2681
|
+
if (t.valAxisMinorGridlines && i != null && isFinite(i) && i > 0 && i < U) for (let t = i; t < H - 1e-9; t += i) Math.abs(t / U - Math.round(t / U)) > 1e-6 && Tn(e, L, z, G(t), !1, n);
|
|
2682
2682
|
if (Mn(t)) {
|
|
2683
|
-
let t = Math.round(
|
|
2684
|
-
for (let r = 0; r <= t; r++) Tn(e,
|
|
2683
|
+
let t = Math.round(H / U);
|
|
2684
|
+
for (let r = 0; r <= t; r++) Tn(e, L, z, G(r * U), r === 0, n);
|
|
2685
2685
|
}
|
|
2686
2686
|
}
|
|
2687
2687
|
if (!t.catAxisHidden && Dn(t)) {
|
|
2688
2688
|
let n = On(t, r);
|
|
2689
2689
|
e.strokeStyle = n.color, e.lineWidth = n.width;
|
|
2690
2690
|
for (let n of kn(t, l)) {
|
|
2691
|
-
let t =
|
|
2692
|
-
e.beginPath(), e.moveTo(t,
|
|
2691
|
+
let t = L + n * z;
|
|
2692
|
+
e.beginPath(), e.moveTo(t, R), e.lineTo(t, R + B), e.stroke();
|
|
2693
2693
|
}
|
|
2694
2694
|
}
|
|
2695
2695
|
let q = u ? Array(l).fill(0) : null;
|
|
2696
2696
|
for (let n = t.series.length - 1; n >= 0; n--) {
|
|
2697
|
-
let r = t.series[n], i = an(n, r), a =
|
|
2697
|
+
let r = t.series[n], i = an(n, r), a = R + B, o = oe(r), s = r.smooth === !0;
|
|
2698
2698
|
if (e.beginPath(), u && q) {
|
|
2699
2699
|
let t = [];
|
|
2700
2700
|
for (let e = 0; e < l; e++) t.push({
|
|
2701
|
-
x:
|
|
2702
|
-
y:
|
|
2701
|
+
x: W(e),
|
|
2702
|
+
y: G(p(n, e) + q[e])
|
|
2703
2703
|
});
|
|
2704
|
-
e.moveTo(t[0].x, t[0].y),
|
|
2705
|
-
for (let t = l - 1; t >= 0; t--) e.lineTo(
|
|
2704
|
+
e.moveTo(t[0].x, t[0].y), sr(e, t, s);
|
|
2705
|
+
for (let t = l - 1; t >= 0; t--) e.lineTo(W(t), G(q[t]));
|
|
2706
2706
|
for (let e = 0; e < l; e++) q[e] += p(n, e);
|
|
2707
2707
|
} else {
|
|
2708
2708
|
let t = [];
|
|
2709
2709
|
for (let e = 0; e < l; e++) t.push({
|
|
2710
|
-
x:
|
|
2710
|
+
x: W(e),
|
|
2711
2711
|
y: o(r.values[e] ?? 0)
|
|
2712
2712
|
});
|
|
2713
|
-
e.moveTo(
|
|
2713
|
+
e.moveTo(W(0), a), e.lineTo(t[0].x, t[0].y), sr(e, t, s), e.lineTo(W(l - 1), a);
|
|
2714
2714
|
}
|
|
2715
2715
|
e.closePath(), e.fillStyle = Xt(i, .6), e.fill(), e.strokeStyle = i, e.lineWidth = 1.5, e.setLineDash([]), e.stroke();
|
|
2716
2716
|
}
|
|
@@ -2725,39 +2725,39 @@ function Jn(e, t, n, r) {
|
|
|
2725
2725
|
};
|
|
2726
2726
|
for (let a = 0; a < t.series.length; a++) {
|
|
2727
2727
|
let o = t.series[a], s = an(a, o), u = oe(o), d = (e) => i(a, e);
|
|
2728
|
-
for (let t of o.errBars ?? [])
|
|
2729
|
-
if (o.showMarker === !0 ||
|
|
2728
|
+
for (let t of o.errBars ?? []) ur(e, o, t, l, W, u, d, s);
|
|
2729
|
+
if (o.showMarker === !0 || lr(o)) for (let t = 0; t < l; t++) {
|
|
2730
2730
|
if (o.values[t] == null) continue;
|
|
2731
2731
|
let i = (o.dataPointOverrides ?? []).find((e) => e.idx === t), a = i?.markerSymbol ?? o.markerSymbol ?? "circle";
|
|
2732
2732
|
if (a === "none") continue;
|
|
2733
|
-
let c =
|
|
2734
|
-
|
|
2733
|
+
let c = W(t), l = u(d(t));
|
|
2734
|
+
lr(o) ? nr(e, c, l, a, i?.markerSize ?? o.markerSize ?? 5, i?.markerFill ?? i?.color ?? o.markerFill ?? s, i?.markerLine ?? o.markerLine ?? null, r) : (e.fillStyle = s, e.beginPath(), e.arc(c, l, n, 0, Math.PI * 2), e.fill());
|
|
2735
2735
|
}
|
|
2736
|
-
|
|
2736
|
+
dr(e, o, c, l, W, u, d, B, r, t.date1904 ?? !1, !0, X(t, t.dataLabelFontFace, "minor"), t.dataLabelPosition ?? "ctr");
|
|
2737
2737
|
}
|
|
2738
2738
|
}
|
|
2739
2739
|
if (!t.valAxisHidden) {
|
|
2740
|
-
e.font = `${Math.max(8, Math.min(11,
|
|
2741
|
-
let n = Math.round(
|
|
2740
|
+
e.font = `${Math.max(8, Math.min(11, B / 20))}px ${X(t, t.valAxisFontFace, "minor")}`, e.textBaseline = "middle";
|
|
2741
|
+
let n = Math.round(H / U);
|
|
2742
2742
|
for (let r = 0; r <= n; r++) {
|
|
2743
|
-
let n = r *
|
|
2744
|
-
wn(e, t.valAxisMajorTickMark, "val",
|
|
2743
|
+
let n = r * U, i = G(n);
|
|
2744
|
+
wn(e, t.valAxisMajorTickMark, "val", L, i, le, K), e.fillStyle = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555", e.textAlign = "right", e.fillText(Y(n, t.valAxisFormatCode, t.date1904), L - 6, i);
|
|
2745
2745
|
}
|
|
2746
2746
|
}
|
|
2747
|
-
if (!t.catAxisHidden && !t.catAxisLineHidden && (e.strokeStyle = se, e.lineWidth = ce, e.beginPath(), e.moveTo(
|
|
2748
|
-
else for (let n = 0; n < l; n++) wn(e, t.catAxisMajorTickMark, "cat",
|
|
2747
|
+
if (!t.catAxisHidden && !t.catAxisLineHidden && (e.strokeStyle = se, e.lineWidth = ce, e.beginPath(), e.moveTo(L, R + B), e.lineTo(L + z, R + B), e.stroke()), !t.valAxisHidden && !t.valAxisLineHidden && t.valAxisLineColor != null && (e.strokeStyle = le, e.lineWidth = K, e.beginPath(), e.moveTo(L, R), e.lineTo(L, R + B), e.stroke()), !t.catAxisHidden && t.catAxisMajorTickMark && t.catAxisMajorTickMark !== "none") if (ie) for (let n = 0; n <= l; n++) wn(e, t.catAxisMajorTickMark, "cat", R + B, L + n / l * z, se, ce);
|
|
2748
|
+
else for (let n = 0; n < l; n++) wn(e, t.catAxisMajorTickMark, "cat", R + B, W(n), se, ce);
|
|
2749
2749
|
if (!t.catAxisHidden) {
|
|
2750
|
-
e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555", e.textAlign = "center", e.textBaseline = "top", e.font = `${Math.max(8, Math.min(11,
|
|
2750
|
+
e.fillStyle = t.catAxisFontColor ? `#${t.catAxisFontColor}` : "#555", e.textAlign = "center", e.textBaseline = "top", e.font = `${Math.max(8, Math.min(11, z / l * .8))}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
2751
2751
|
let n = c.map((e) => Dt((e ?? "").toString(), t.catAxisFormatCode, t.date1904)), r = 0;
|
|
2752
2752
|
for (let t = 0; t < l; t++) r = Math.max(r, e.measureText(n[t] ?? "").width);
|
|
2753
|
-
let i = Math.max(1, Math.ceil((r + 6) / (
|
|
2754
|
-
for (let t = 0; t < l; t += i) e.fillText(Pt(e, n[t] ?? "", a),
|
|
2753
|
+
let i = Math.max(1, Math.ceil((r + 6) / (z / l))), a = z / l * i - 4;
|
|
2754
|
+
for (let t = 0; t < l; t += i) e.fillText(Pt(e, n[t] ?? "", a), W(t), R + B + 3);
|
|
2755
2755
|
}
|
|
2756
2756
|
if (m && te) {
|
|
2757
2757
|
let n = t.valAxisFontColor ? `#${t.valAxisFontColor}` : "#555";
|
|
2758
|
-
Vn(e, m, te, ae, R, z, B,
|
|
2758
|
+
Vn(e, m, te, ae, L, R, z, B, s, r, re, P, n, t.date1904);
|
|
2759
2759
|
}
|
|
2760
|
-
Cn(e, t, S, i, a, o, s, R, z, B,
|
|
2760
|
+
Cn(e, t, S, i, a, o, s, L, R, z, B, y + 2), mn(e, t, i, a, o, s, L, R, z, B, w, E, O, k);
|
|
2761
2761
|
}
|
|
2762
2762
|
var Yn = .88;
|
|
2763
2763
|
function Xn(e, t, n, r, i) {
|
|
@@ -2841,19 +2841,19 @@ function Qn(e, t, n, r, i, a, o, s, c, l, u, d, f, p, m, h, g) {
|
|
|
2841
2841
|
if (O.length === 0) continue;
|
|
2842
2842
|
let k = h?.fontSizeHpt ? h.fontSizeHpt / 100 : y, A = h?.fontBold ?? n.fontBold ?? !1, j = h?.fontColor ? `#${h.fontColor}` : n.fontColor ? `#${n.fontColor}` : "#000", M = h?.labelBox ?? C, N = M?.fill ? `#${M.fill}` : null, ee = M?.borderColor ? `#${M.borderColor}` : null, te = M?.borderWidthEmu ? Math.max(.75, M.borderWidthEmu / ft * f) : 1;
|
|
2843
2843
|
e.font = `${A ? "bold " : ""}${k}px ${d}`;
|
|
2844
|
-
let
|
|
2845
|
-
for (let t of O)
|
|
2846
|
-
let
|
|
2844
|
+
let ne = 0;
|
|
2845
|
+
for (let t of O) ne = Math.max(ne, e.measureText(t).width);
|
|
2846
|
+
let re = k + S, P = ne + b * 2, F = O.length * re - S + x * 2, I = s + Math.cos(m) * l, L = c + Math.sin(m) * l, R = Math.cos(m) < 0, z = Math.max(P, F) * .55 + l * .06, B = I + Math.cos(m) * z, V = L + Math.sin(m) * z;
|
|
2847
2847
|
w.push({
|
|
2848
2848
|
lines: O,
|
|
2849
2849
|
midAngle: m,
|
|
2850
|
-
rimX:
|
|
2851
|
-
rimY:
|
|
2852
|
-
boxW:
|
|
2853
|
-
boxH:
|
|
2854
|
-
cxBox:
|
|
2855
|
-
cyBox:
|
|
2856
|
-
leftSide:
|
|
2850
|
+
rimX: I,
|
|
2851
|
+
rimY: L,
|
|
2852
|
+
boxW: P,
|
|
2853
|
+
boxH: F,
|
|
2854
|
+
cxBox: B,
|
|
2855
|
+
cyBox: V,
|
|
2856
|
+
leftSide: R,
|
|
2857
2857
|
fontColor: j,
|
|
2858
2858
|
boxFill: N,
|
|
2859
2859
|
boxBorder: ee,
|
|
@@ -2978,7 +2978,14 @@ function $n(e, t, n, r) {
|
|
|
2978
2978
|
}
|
|
2979
2979
|
Cn(e, t, d, i, a, o, s, p, m, h, g, u.title.bandH + 2);
|
|
2980
2980
|
}
|
|
2981
|
-
function er(e, t, n
|
|
2981
|
+
function er(e, t, n) {
|
|
2982
|
+
if (n) return t;
|
|
2983
|
+
let r = e[t];
|
|
2984
|
+
if (r == null) return null;
|
|
2985
|
+
let i = parseFloat(r);
|
|
2986
|
+
return Number.isNaN(i) ? null : i;
|
|
2987
|
+
}
|
|
2988
|
+
function tr(e, t, n, r) {
|
|
2982
2989
|
let { x: i, y: a, w: o, h: s } = n, c = et(t, s, r), l = c.fontPx, u = c.topPad, d = Fn(t.catAxisFontSizeHpt, s, r), f = Fn(t.valAxisFontSizeHpt, s, r), p = qe(t, o, s, .22), { legRightW: m, legLeftW: h, legTopH: g, legBottomH: _ } = Je(p), v = Ze(t, o, s, r), y = v.catFontPx, b = v.valFontPx, x = v.catBandH, S = v.valBandW;
|
|
2983
2990
|
if (t.title) {
|
|
2984
2991
|
let n = t.titleManualLayout;
|
|
@@ -2999,46 +3006,57 @@ function er(e, t, n, r) {
|
|
|
2999
3006
|
t.plotAreaBg && (e.fillStyle = `#${t.plotAreaBg}`, e.fillRect(C, w, T, E));
|
|
3000
3007
|
let D = [], O = [];
|
|
3001
3008
|
for (let e of t.series) {
|
|
3002
|
-
let
|
|
3003
|
-
for (let e of
|
|
3009
|
+
let n = e.categories ?? t.categories;
|
|
3010
|
+
for (let e of n) {
|
|
3004
3011
|
let t = parseFloat(e);
|
|
3005
3012
|
isNaN(t) || D.push(t);
|
|
3006
3013
|
}
|
|
3007
|
-
for (let t of e.values) t != null && O.push(t);
|
|
3008
3014
|
}
|
|
3009
3015
|
let k = D.length === 0;
|
|
3010
3016
|
if (k) {
|
|
3011
3017
|
let e = Math.max(...t.series.map((e) => e.values.length));
|
|
3012
3018
|
for (let t = 0; t < e; t++) D.push(t);
|
|
3019
|
+
for (let e of t.series) for (let t of e.values) t != null && O.push(t);
|
|
3020
|
+
} else {
|
|
3021
|
+
D.length = 0;
|
|
3022
|
+
for (let e of t.series) {
|
|
3023
|
+
let n = e.categories ?? t.categories;
|
|
3024
|
+
for (let t = 0; t < e.values.length; t++) {
|
|
3025
|
+
let r = e.values[t];
|
|
3026
|
+
if (r == null) continue;
|
|
3027
|
+
let i = er(n, t, !1);
|
|
3028
|
+
i != null && (D.push(i), O.push(r));
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3013
3031
|
}
|
|
3014
3032
|
let A = Math.min(...D), j = Math.max(...D), M = Math.min(...O), N = Math.max(...O);
|
|
3015
3033
|
A === j && (--A, j += 1), M === N && (--M, N += 1), t.valMin == null ? M > 0 && (M = 0) : M = t.valMin, t.valMax != null && (N = t.valMax);
|
|
3016
|
-
let { min: ee, max: te, step:
|
|
3034
|
+
let { min: ee, max: te, step: ne } = ct(M, N, t.valMin, t.valMax, void 0, t.valAxisMajorUnit);
|
|
3017
3035
|
if (M = ee, N = te, t.catAxisMin != null && (A = t.catAxisMin), t.catAxisMax != null && (j = t.catAxisMax), t.catAxisMin == null || t.catAxisMax == null) {
|
|
3018
3036
|
let e = rt(j - A);
|
|
3019
3037
|
e > 0 && (t.catAxisMin ?? (A = Math.floor(A / e) * e), t.catAxisMax ?? (j = Math.ceil(j / e) * e));
|
|
3020
3038
|
}
|
|
3021
|
-
let
|
|
3039
|
+
let re = (e) => C + (e - A) / (j - A) * T, P = (e) => w + E - (e - M) / (N - M) * E, F = En(t, r);
|
|
3022
3040
|
if (!t.valAxisHidden) {
|
|
3023
3041
|
let n = Math.max(8, Math.min(11, E / 20));
|
|
3024
3042
|
e.font = `${t.valAxisFontBold ? "bold " : ""}${n}px ${X(t, t.valAxisFontFace, "minor")}`;
|
|
3025
|
-
let i = Math.round((N - M) /
|
|
3043
|
+
let i = Math.round((N - M) / ne) + 1;
|
|
3026
3044
|
for (let n = 0; n < i; n++) {
|
|
3027
|
-
let i = M + n *
|
|
3028
|
-
if (i > N +
|
|
3029
|
-
let a =
|
|
3030
|
-
e.strokeStyle =
|
|
3045
|
+
let i = M + n * ne;
|
|
3046
|
+
if (i > N + ne * .01) break;
|
|
3047
|
+
let a = P(i);
|
|
3048
|
+
e.strokeStyle = F.color, e.lineWidth = F.width, e.beginPath(), e.moveTo(C, a), e.lineTo(C + T, a), e.stroke(), e.fillStyle = "#555", e.textAlign = "right", e.textBaseline = "middle", e.fillText(Y(i, t.valAxisFormatCode, t.date1904), C - 4, a);
|
|
3031
3049
|
let o = t.valAxisLineColor ? `#${t.valAxisLineColor}` : void 0;
|
|
3032
3050
|
wn(e, t.valAxisMajorTickMark, "val", C, a, o, ht(t.valAxisLineWidthEmu, r));
|
|
3033
3051
|
}
|
|
3034
3052
|
}
|
|
3035
|
-
let
|
|
3036
|
-
if (t.catAxisCrossesAt != null)
|
|
3053
|
+
let I = w + E;
|
|
3054
|
+
if (t.catAxisCrossesAt != null) I = or(P(t.catAxisCrossesAt), w, w + E);
|
|
3037
3055
|
else {
|
|
3038
3056
|
let e = t.catAxisCrosses ?? "autoZero";
|
|
3039
|
-
e === "autoZero" && M < 0 && N > 0 ?
|
|
3057
|
+
e === "autoZero" && M < 0 && N > 0 ? I = or(P(0), w, w + E) : e === "min" ? I = w + E : e === "max" && (I = w);
|
|
3040
3058
|
}
|
|
3041
|
-
if (!t.catAxisHidden && !t.catAxisLineHidden && (e.save(), e.strokeStyle = t.catAxisLineColor ? `#${t.catAxisLineColor}` : "#888", e.lineWidth = ht(t.catAxisLineWidthEmu, r), e.lineCap = "butt", e.beginPath(), e.moveTo(C,
|
|
3059
|
+
if (!t.catAxisHidden && !t.catAxisLineHidden && (e.save(), e.strokeStyle = t.catAxisLineColor ? `#${t.catAxisLineColor}` : "#888", e.lineWidth = ht(t.catAxisLineWidthEmu, r), e.lineCap = "butt", e.beginPath(), e.moveTo(C, I), e.lineTo(C + T, I), e.stroke(), e.restore()), !t.valAxisHidden && !t.valAxisLineHidden && (e.save(), e.strokeStyle = t.valAxisLineColor ? `#${t.valAxisLineColor}` : "#888", e.lineWidth = ht(t.valAxisLineWidthEmu, r), e.beginPath(), e.moveTo(C, w), e.lineTo(C, w + E), e.stroke(), e.restore()), !t.catAxisHidden) {
|
|
3042
3060
|
let n = Math.max(8, Math.min(11, E / 20));
|
|
3043
3061
|
e.font = `${t.catAxisFontBold ? "bold " : ""}${n}px ${X(t, t.catAxisFontFace, "minor")}`;
|
|
3044
3062
|
let i = rt(j - A), a = Math.round((j - A) / i) + 1;
|
|
@@ -3046,29 +3064,29 @@ function er(e, t, n, r) {
|
|
|
3046
3064
|
for (let n = 0; n < a; n++) {
|
|
3047
3065
|
let a = A + n * i;
|
|
3048
3066
|
if (a > j + i * .01) break;
|
|
3049
|
-
let o =
|
|
3050
|
-
e.fillText(Y(a, t.catAxisFormatCode, t.date1904), o,
|
|
3067
|
+
let o = re(a);
|
|
3068
|
+
e.fillText(Y(a, t.catAxisFormatCode, t.date1904), o, I + 4);
|
|
3051
3069
|
let s = t.catAxisLineColor ? `#${t.catAxisLineColor}` : void 0;
|
|
3052
|
-
wn(e, t.catAxisMajorTickMark, "cat",
|
|
3070
|
+
wn(e, t.catAxisMajorTickMark, "cat", I, o, s, ht(t.catAxisLineWidthEmu, r));
|
|
3053
3071
|
}
|
|
3054
3072
|
}
|
|
3055
|
-
let
|
|
3073
|
+
let L = t.chartType === "bubble", R = L ? "marker" : t.scatterStyle ?? "marker", z = R === "line" || R === "lineMarker" || R === "lineNoMarker", B = R === "smooth" || R === "smoothMarker" || R === "smoothNoMarker", V = R === "lineNoMarker" || R === "smoothNoMarker";
|
|
3056
3074
|
for (let n = 0; n < t.series.length; n++) {
|
|
3057
|
-
let i = t.series[n], a = an(n, i), o = i.categories ??
|
|
3058
|
-
for (let t of i.errBars ?? [])
|
|
3059
|
-
if ((
|
|
3075
|
+
let i = t.series[n], a = an(n, i), o = i.categories ?? t.categories;
|
|
3076
|
+
for (let t of i.errBars ?? []) rr(e, i, t, o, k, re, P, a);
|
|
3077
|
+
if ((z || B) && i.lineHidden !== !0) {
|
|
3060
3078
|
let t = [];
|
|
3061
3079
|
for (let e = 0; e < i.values.length; e++) {
|
|
3062
3080
|
let n = i.values[e];
|
|
3063
3081
|
if (n == null) continue;
|
|
3064
|
-
let r =
|
|
3065
|
-
|
|
3066
|
-
x:
|
|
3067
|
-
y:
|
|
3082
|
+
let r = er(o, e, k);
|
|
3083
|
+
r != null && t.push({
|
|
3084
|
+
x: re(r),
|
|
3085
|
+
y: P(n)
|
|
3068
3086
|
});
|
|
3069
3087
|
}
|
|
3070
3088
|
if (t.length >= 2) {
|
|
3071
|
-
if (e.save(), e.strokeStyle = i.color ? `#${i.color}` : a, e.lineWidth = 1.5, e.beginPath(), e.moveTo(t[0].x, t[0].y),
|
|
3089
|
+
if (e.save(), e.strokeStyle = i.color ? `#${i.color}` : a, e.lineWidth = 1.5, e.beginPath(), e.moveTo(t[0].x, t[0].y), B && t.length >= 3) for (let n = 0; n < t.length - 1; n++) {
|
|
3072
3090
|
let r = t[n - 1] ?? t[n], i = t[n], a = t[n + 1], o = t[n + 2] ?? a, s = i.x + (a.x - r.x) / 6, c = i.y + (a.y - r.y) / 6, l = a.x - (o.x - i.x) / 6, u = a.y - (o.y - i.y) / 6;
|
|
3073
3091
|
e.bezierCurveTo(s, c, l, u, a.x, a.y);
|
|
3074
3092
|
}
|
|
@@ -3076,31 +3094,31 @@ function er(e, t, n, r) {
|
|
|
3076
3094
|
e.stroke(), e.restore();
|
|
3077
3095
|
}
|
|
3078
3096
|
}
|
|
3079
|
-
if (!(
|
|
3097
|
+
if (!(V || i.showMarker === !1 || typeof i.markerSymbol == "string" && i.markerSymbol === "none")) {
|
|
3080
3098
|
let t = 0;
|
|
3081
|
-
if (
|
|
3099
|
+
if (L && i.bubbleSizes && i.bubbleSizes.length > 0) {
|
|
3082
3100
|
let e = Math.max(0, ...i.bubbleSizes.filter((e) => e != null));
|
|
3083
3101
|
e > 0 && (t = Math.min(T, E) / Math.max(8, i.values.length * 1.6) / Math.sqrt(e));
|
|
3084
3102
|
}
|
|
3085
3103
|
for (let n = 0; n < i.values.length; n++) {
|
|
3086
3104
|
let s = i.values[n];
|
|
3087
3105
|
if (s == null) continue;
|
|
3088
|
-
let c =
|
|
3089
|
-
if (
|
|
3106
|
+
let c = er(o, n, k);
|
|
3107
|
+
if (c == null) continue;
|
|
3090
3108
|
let l = (i.dataPointOverrides ?? []).find((e) => e.idx === n), u = l?.markerSymbol ?? i.markerSymbol ?? "circle", d = l?.markerSize ?? i.markerSize ?? 5;
|
|
3091
|
-
if (
|
|
3109
|
+
if (L && t > 0) {
|
|
3092
3110
|
let e = i.bubbleSizes?.[n];
|
|
3093
3111
|
e != null && e > 0 && (d = Math.sqrt(e) * t * 2 / r);
|
|
3094
3112
|
}
|
|
3095
3113
|
let f = l?.markerFill ?? l?.color ?? i.markerFill ?? a, p = l?.markerLine ?? i.markerLine ?? null;
|
|
3096
|
-
|
|
3114
|
+
nr(e, re(c), P(s), u, d, f, p, r);
|
|
3097
3115
|
}
|
|
3098
3116
|
}
|
|
3099
|
-
|
|
3117
|
+
ir(e, i, o, k, re, P, E, r, t.date1904, X(t, t.dataLabelFontFace, "minor"), t.dataLabelPosition ?? "r");
|
|
3100
3118
|
}
|
|
3101
3119
|
Cn(e, t, p, i, a, o, s, C, w, T, E, c.bandH + 2), mn(e, t, i, a, o, s, C, w, T, E, h, _, y, b);
|
|
3102
3120
|
}
|
|
3103
|
-
function
|
|
3121
|
+
function nr(e, t, n, r, i, a, o, s) {
|
|
3104
3122
|
let c = Math.max(2, i * s), l = c / 2, u = a.startsWith("#") ? a : `#${a}`, d = o ? o.startsWith("#") ? o : `#${o}` : null;
|
|
3105
3123
|
switch (e.save(), e.fillStyle = u, d && (e.strokeStyle = d, e.lineWidth = 1), r) {
|
|
3106
3124
|
case "square":
|
|
@@ -3140,14 +3158,14 @@ function tr(e, t, n, r, i, a, o, s) {
|
|
|
3140
3158
|
}
|
|
3141
3159
|
e.restore();
|
|
3142
3160
|
}
|
|
3143
|
-
function
|
|
3144
|
-
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(
|
|
3161
|
+
function rr(e, t, n, r, i, a, o, s) {
|
|
3162
|
+
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(cr(n.dash));
|
|
3145
3163
|
let c = n.barType === "plus" || n.barType === "both", l = n.barType === "minus" || n.barType === "both", u = n.dir === "x", d = e.lineWidth * 1.5;
|
|
3146
3164
|
for (let s = 0; s < t.values.length; s++) {
|
|
3147
3165
|
let f = t.values[s];
|
|
3148
3166
|
if (f == null) continue;
|
|
3149
|
-
let p =
|
|
3150
|
-
if (
|
|
3167
|
+
let p = er(r, s, i);
|
|
3168
|
+
if (p == null) continue;
|
|
3151
3169
|
let m = a(p), h = o(f), g = (t) => {
|
|
3152
3170
|
let r = m, i = h;
|
|
3153
3171
|
u ? r = a(p + t) : i = o(f + t), e.beginPath(), e.moveTo(m, h), e.lineTo(r, i), e.stroke(), n.noEndCap || (e.save(), e.setLineDash([]), e.beginPath(), u ? (e.moveTo(r, i - d), e.lineTo(r, i + d)) : (e.moveTo(r - d, i), e.lineTo(r + d, i)), e.stroke(), e.restore());
|
|
@@ -3163,15 +3181,15 @@ function nr(e, t, n, r, i, a, o, s) {
|
|
|
3163
3181
|
}
|
|
3164
3182
|
e.restore();
|
|
3165
3183
|
}
|
|
3166
|
-
function
|
|
3184
|
+
function ir(e, t, n, r, i, a, o, s, c = !1, l = "sans-serif", u = "r") {
|
|
3167
3185
|
let d = t.dataLabelOverrides ?? [];
|
|
3168
3186
|
if (d.length === 0 && !t.seriesDataLabels) return;
|
|
3169
3187
|
let f = t.seriesDataLabels;
|
|
3170
3188
|
for (let p = 0; p < t.values.length; p++) {
|
|
3171
3189
|
let m = t.values[p];
|
|
3172
3190
|
if (m == null) continue;
|
|
3173
|
-
let h =
|
|
3174
|
-
if (
|
|
3191
|
+
let h = er(n, p, r);
|
|
3192
|
+
if (h == null) continue;
|
|
3175
3193
|
let g = d.find((e) => e.idx === p);
|
|
3176
3194
|
if (g?.deleted) continue;
|
|
3177
3195
|
let _ = g?.showCatName ?? f?.showCatName, v = g?.showSerName ?? f?.showSerName, y = g?.showVal ?? f?.showVal, b;
|
|
@@ -3181,10 +3199,10 @@ function rr(e, t, n, r, i, a, o, s, c = !1, l = "sans-serif", u = "r") {
|
|
|
3181
3199
|
if (_ && !r && e.push(n[p] ?? ""), v && e.push(t.name), y && e.push(Y(m, f?.formatCode ?? null, c)), b = e.filter(Boolean).join(" "), !b) continue;
|
|
3182
3200
|
} else continue;
|
|
3183
3201
|
let x = g?.position ?? f?.position ?? u, S = g?.fontSizeHpt ?? f?.fontSizeHpt, C = S ? S / 100 * s : Math.max(9, Math.min(11, o / 25)), w = g?.fontColor ?? f?.fontColor, T = g?.fontBold ?? f?.fontBold ?? !1;
|
|
3184
|
-
|
|
3202
|
+
ar(e, i(h), a(m), b, x, C, w, T, l);
|
|
3185
3203
|
}
|
|
3186
3204
|
}
|
|
3187
|
-
function
|
|
3205
|
+
function ar(e, t, n, r, i, a, o, s, c = "sans-serif", l = 0) {
|
|
3188
3206
|
e.save(), e.font = `${s ? "bold " : ""}${a}px ${c}`, e.fillStyle = o ? `#${o}` : "#333";
|
|
3189
3207
|
let u = a * .6 + l, d = t, f = n;
|
|
3190
3208
|
switch (i) {
|
|
@@ -3212,17 +3230,17 @@ function ir(e, t, n, r, i, a, o, s, c = "sans-serif", l = 0) {
|
|
|
3212
3230
|
for (let t of p) e.fillText(t, d, g), g += m;
|
|
3213
3231
|
e.restore();
|
|
3214
3232
|
}
|
|
3215
|
-
function
|
|
3233
|
+
function or(e, t, n) {
|
|
3216
3234
|
return e < t ? t : e > n ? n : e;
|
|
3217
3235
|
}
|
|
3218
|
-
function
|
|
3236
|
+
function sr(e, t, n) {
|
|
3219
3237
|
if (t.length !== 0) if (n && t.length >= 3) for (let n = 0; n < t.length - 1; n++) {
|
|
3220
3238
|
let r = t[n - 1] ?? t[n], i = t[n], a = t[n + 1], o = t[n + 2] ?? a, s = i.x + (a.x - r.x) / 6, c = i.y + (a.y - r.y) / 6, l = a.x - (o.x - i.x) / 6, u = a.y - (o.y - i.y) / 6;
|
|
3221
3239
|
e.bezierCurveTo(s, c, l, u, a.x, a.y);
|
|
3222
3240
|
}
|
|
3223
3241
|
else for (let n = 1; n < t.length; n++) e.lineTo(t[n].x, t[n].y);
|
|
3224
3242
|
}
|
|
3225
|
-
function
|
|
3243
|
+
function cr(e) {
|
|
3226
3244
|
if (!e) return [];
|
|
3227
3245
|
switch (e) {
|
|
3228
3246
|
case "solid": return [];
|
|
@@ -3257,13 +3275,13 @@ function sr(e) {
|
|
|
3257
3275
|
default: return [];
|
|
3258
3276
|
}
|
|
3259
3277
|
}
|
|
3260
|
-
function
|
|
3278
|
+
function lr(e) {
|
|
3261
3279
|
return e.markerSymbol != null || e.markerSize != null || e.markerFill != null || e.markerLine != null || e.dataPointOverrides != null && e.dataPointOverrides.length > 0;
|
|
3262
3280
|
}
|
|
3263
|
-
function
|
|
3281
|
+
function ur(e, t, n, r, i, a, o, s) {
|
|
3264
3282
|
if (n.dir === "x") return;
|
|
3265
3283
|
let c = n.barType === "plus" || n.barType === "both", l = n.barType === "minus" || n.barType === "both";
|
|
3266
|
-
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(
|
|
3284
|
+
e.save(), e.strokeStyle = n.color ? `#${n.color}` : s, e.lineWidth = n.lineWidthEmu ? Math.max(.5, n.lineWidthEmu / ft) : 1, e.setLineDash(cr(n.dash));
|
|
3267
3285
|
let u = e.lineWidth * 1.5;
|
|
3268
3286
|
for (let s = 0; s < r; s++) {
|
|
3269
3287
|
if (t.values[s] == null) continue;
|
|
@@ -3282,7 +3300,7 @@ function lr(e, t, n, r, i, a, o, s) {
|
|
|
3282
3300
|
}
|
|
3283
3301
|
e.restore();
|
|
3284
3302
|
}
|
|
3285
|
-
function
|
|
3303
|
+
function dr(e, t, n, r, i, a, o, s, c, l, u, d = "sans-serif", f = "t") {
|
|
3286
3304
|
let p = t.dataLabelOverrides ?? [], m = t.seriesDataLabels;
|
|
3287
3305
|
if (p.length === 0 && !m) return !1;
|
|
3288
3306
|
for (let h = 0; h < r; h++) {
|
|
@@ -3296,11 +3314,11 @@ function ur(e, t, n, r, i, a, o, s, c, l, u, d = "sans-serif", f = "t") {
|
|
|
3296
3314
|
if (_ && e.push(n[h] ?? ""), v && e.push(t.name), y && e.push(Y(r, m?.formatCode ?? null, l)), b = e.filter(Boolean).join(" "), !b) continue;
|
|
3297
3315
|
} else continue;
|
|
3298
3316
|
let x = g?.position ?? m?.position ?? f, S = g?.fontSizeHpt ?? m?.fontSizeHpt, C = S ? S / 100 * c : Math.max(9, Math.min(11, s / 25)), w = g?.fontColor ?? m?.fontColor, T = g?.fontBold ?? m?.fontBold ?? !1;
|
|
3299
|
-
|
|
3317
|
+
ar(e, i(h), a(r), b, x, C, w, T, d);
|
|
3300
3318
|
}
|
|
3301
3319
|
return !0;
|
|
3302
3320
|
}
|
|
3303
|
-
function
|
|
3321
|
+
function fr(e, t, n) {
|
|
3304
3322
|
let { x: r, y: i, w: a, h: o } = n, s = t.plotAreaManualLayout, c, l, u, d;
|
|
3305
3323
|
if (s && s.w != null && s.h != null) c = r + s.x * a, l = i + s.y * o, u = s.w * a, d = s.h * o;
|
|
3306
3324
|
else {
|
|
@@ -3359,7 +3377,7 @@ function dr(e, t, n) {
|
|
|
3359
3377
|
}
|
|
3360
3378
|
e.restore();
|
|
3361
3379
|
}
|
|
3362
|
-
function
|
|
3380
|
+
function pr(e, t, n) {
|
|
3363
3381
|
let r = e.length;
|
|
3364
3382
|
if (r === 0) return 0;
|
|
3365
3383
|
if (r === 1) return e[0];
|
|
@@ -3368,9 +3386,9 @@ function fr(e, t, n) {
|
|
|
3368
3386
|
let a = Math.floor(i), o = i - a;
|
|
3369
3387
|
return a >= r ? e[r - 1] : e[a - 1] + o * (e[a] - e[a - 1]);
|
|
3370
3388
|
}
|
|
3371
|
-
function
|
|
3389
|
+
function mr(e, t) {
|
|
3372
3390
|
if (e.length === 0) return null;
|
|
3373
|
-
let n = [...e].sort((e, t) => e - t), r =
|
|
3391
|
+
let n = [...e].sort((e, t) => e - t), r = pr(n, .25, t), i = pr(n, .5, t), a = pr(n, .75, t), o = a - r, s = r - 1.5 * o, c = a + 1.5 * o, l = [], u = [];
|
|
3374
3392
|
for (let e of n) e < s || e > c ? u.push(e) : l.push(e);
|
|
3375
3393
|
return {
|
|
3376
3394
|
q1: r,
|
|
@@ -3383,7 +3401,7 @@ function pr(e, t) {
|
|
|
3383
3401
|
inner: l
|
|
3384
3402
|
};
|
|
3385
3403
|
}
|
|
3386
|
-
function
|
|
3404
|
+
function hr(e, t, n, r) {
|
|
3387
3405
|
let i = t.chartexBox;
|
|
3388
3406
|
if (!i || i.categories.length === 0 || i.series.length === 0) return;
|
|
3389
3407
|
let { x: a, y: o, w: s, h: c } = n, l = et(t, c, r), u = Fn(t.catAxisFontSizeHpt, c, r), d = Fn(t.valAxisFontSizeHpt, c, r), f = nt(t, a, o, s, c, r, {
|
|
@@ -3416,7 +3434,7 @@ function mr(e, t, n, r) {
|
|
|
3416
3434
|
for (let n = 0; n < v; n++) {
|
|
3417
3435
|
let r = p + k * n + (k - A) / 2;
|
|
3418
3436
|
for (let t = 0; t < y; t++) {
|
|
3419
|
-
let a = i.series[t], o =
|
|
3437
|
+
let a = i.series[t], o = mr(a.valuesByCategory[n] ?? [], a.quartileMethod);
|
|
3420
3438
|
if (!o) continue;
|
|
3421
3439
|
let s = r + t * (M + j), c = s + M / 2, l = N(t), u = sn(l, .8), d = E(o.q1), f = E(o.q3), p = Math.min(d, f), m = Math.max(1, Math.abs(d - f)), h = M * .4;
|
|
3422
3440
|
e.strokeStyle = u, e.lineWidth = 1, e.beginPath(), e.moveTo(c, E(o.whiskerHi)), e.lineTo(c, f), e.moveTo(c, d), e.lineTo(c, E(o.whiskerLo)), e.moveTo(c - h / 2, E(o.whiskerHi)), e.lineTo(c + h / 2, E(o.whiskerHi)), e.moveTo(c - h / 2, E(o.whiskerLo)), e.lineTo(c + h / 2, E(o.whiskerLo)), e.stroke(), e.fillStyle = l, e.fillRect(s, p, M, m), e.strokeStyle = u, e.lineWidth = .75, e.strokeRect(s + .375, p + .375, M - .75, m - .75);
|
|
@@ -3439,7 +3457,7 @@ function mr(e, t, n, r) {
|
|
|
3439
3457
|
}
|
|
3440
3458
|
e.restore();
|
|
3441
3459
|
}
|
|
3442
|
-
function
|
|
3460
|
+
function gr(e) {
|
|
3443
3461
|
let t = {
|
|
3444
3462
|
label: "",
|
|
3445
3463
|
value: 0,
|
|
@@ -3466,19 +3484,19 @@ function hr(e) {
|
|
|
3466
3484
|
}
|
|
3467
3485
|
return t.value = t.children.reduce((e, t) => e + t.value, 0), t;
|
|
3468
3486
|
}
|
|
3469
|
-
function
|
|
3487
|
+
function _r(e) {
|
|
3470
3488
|
let t = e.children.reduce((e, t) => e + t.value, 0);
|
|
3471
3489
|
if (t <= 0) return;
|
|
3472
3490
|
let n = e.a0;
|
|
3473
3491
|
for (let r of e.children) {
|
|
3474
3492
|
let i = (e.a1 - e.a0) * r.value / t;
|
|
3475
|
-
r.a0 = n, r.a1 = n + i, n = r.a1,
|
|
3493
|
+
r.a0 = n, r.a1 = n + i, n = r.a1, _r(r);
|
|
3476
3494
|
}
|
|
3477
3495
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return e.children.length === 0 ? e.depth : Math.max(...e.children.map(
|
|
3496
|
+
function vr(e) {
|
|
3497
|
+
return e.children.length === 0 ? e.depth : Math.max(...e.children.map(vr));
|
|
3480
3498
|
}
|
|
3481
|
-
function
|
|
3499
|
+
function yr(e, t, n, r) {
|
|
3482
3500
|
let i = t.chartexSunburst;
|
|
3483
3501
|
if (!i || i.rows.length === 0) return;
|
|
3484
3502
|
let { x: a, y: o, w: s, h: c } = n, l = nt(t, a, o, s, c, r, {
|
|
@@ -3488,10 +3506,10 @@ function vr(e, t, n, r) {
|
|
|
3488
3506
|
radialGapFrac: .02
|
|
3489
3507
|
});
|
|
3490
3508
|
Hn(e, t, a, o + l.title.topPad, s, l.title.fontPx);
|
|
3491
|
-
let { px0: u, py0: d, pw: f, ph: p } = l.plotRect, m = u + f / 2, h = d + p / 2, g = Math.min(f, p) * .46, _ =
|
|
3509
|
+
let { px0: u, py0: d, pw: f, ph: p } = l.plotRect, m = u + f / 2, h = d + p / 2, g = Math.min(f, p) * .46, _ = gr(i.rows);
|
|
3492
3510
|
if (_.value <= 0 || _.children.length === 0) return;
|
|
3493
|
-
_.a0 = -Math.PI / 2, _.a1 = -Math.PI / 2 + Math.PI * 2,
|
|
3494
|
-
let v =
|
|
3511
|
+
_.a0 = -Math.PI / 2, _.a1 = -Math.PI / 2 + Math.PI * 2, _r(_);
|
|
3512
|
+
let v = vr(_) + 1, y = g * .18, b = (g - y) / v, x = t.chartexAccents, S = (e) => `#${x?.[e % x.length] ?? rn[e % rn.length]}`, C = X(t, t.dataLabelFontFace, "minor"), w = Math.max(7, Math.min(13, g * .075)), T = Array.from({ length: v }, () => []), E = (e) => {
|
|
3495
3513
|
e.depth >= 0 && T[e.depth].push(e), e.children.forEach(E);
|
|
3496
3514
|
};
|
|
3497
3515
|
E(_), e.save();
|
|
@@ -3520,7 +3538,7 @@ function vr(e, t, n, r) {
|
|
|
3520
3538
|
}
|
|
3521
3539
|
e.restore();
|
|
3522
3540
|
}
|
|
3523
|
-
function
|
|
3541
|
+
function br(e, t, n, r = mt) {
|
|
3524
3542
|
e.save();
|
|
3525
3543
|
try {
|
|
3526
3544
|
let { x: i, y: a, w: o, h: s } = n;
|
|
@@ -3564,19 +3582,19 @@ function yr(e, t, n, r = mt) {
|
|
|
3564
3582
|
break;
|
|
3565
3583
|
case "scatter":
|
|
3566
3584
|
case "bubble":
|
|
3567
|
-
|
|
3585
|
+
tr(e, t, n, r);
|
|
3568
3586
|
break;
|
|
3569
3587
|
case "waterfall":
|
|
3570
|
-
|
|
3588
|
+
fr(e, t, n);
|
|
3571
3589
|
break;
|
|
3572
3590
|
case "stock":
|
|
3573
3591
|
qn(e, t, n, r);
|
|
3574
3592
|
break;
|
|
3575
3593
|
case "boxWhisker":
|
|
3576
|
-
|
|
3594
|
+
hr(e, t, n, r);
|
|
3577
3595
|
break;
|
|
3578
3596
|
case "sunburst":
|
|
3579
|
-
|
|
3597
|
+
yr(e, t, n, r);
|
|
3580
3598
|
break;
|
|
3581
3599
|
default: e.fillStyle = "#888", e.font = "11px sans-serif", e.textAlign = "center", e.textBaseline = "middle", e.fillText(`Chart: ${t.chartType}`, i + o / 2, a + s / 2);
|
|
3582
3600
|
}
|
|
@@ -3586,7 +3604,7 @@ function yr(e, t, n, r = mt) {
|
|
|
3586
3604
|
}
|
|
3587
3605
|
//#endregion
|
|
3588
3606
|
//#region packages/core/src/autoResize.ts
|
|
3589
|
-
function
|
|
3607
|
+
function xr(e, t, n = {}) {
|
|
3590
3608
|
let r = n.pauseWhenHidden ?? !0, i = null, a = 0, o = 0, s = null, c = !1, l = !1, u = () => {
|
|
3591
3609
|
if (!l && !(r && typeof document < "u" && document.hidden)) {
|
|
3592
3610
|
if (s) {
|
|
@@ -3621,7 +3639,7 @@ function br(e, t, n = {}) {
|
|
|
3621
3639
|
l = !0, f.disconnect(), i !== null && (cancelAnimationFrame(i), i = null), r && typeof document < "u" && document.removeEventListener("visibilitychange", p);
|
|
3622
3640
|
};
|
|
3623
3641
|
}
|
|
3624
|
-
var
|
|
3642
|
+
var Sr = {
|
|
3625
3643
|
accentbordercallout1: {
|
|
3626
3644
|
adj: [
|
|
3627
3645
|
["adj1", "val 18750"],
|
|
@@ -25484,15 +25502,15 @@ var xr = {
|
|
|
25484
25502
|
]
|
|
25485
25503
|
}]
|
|
25486
25504
|
}
|
|
25487
|
-
},
|
|
25488
|
-
function
|
|
25505
|
+
}, Cr = 216e5, wr = Math.PI * 2 / Cr;
|
|
25506
|
+
function Tr(e) {
|
|
25489
25507
|
let t = e.trim().split(/\s+/);
|
|
25490
25508
|
return {
|
|
25491
25509
|
op: t[0],
|
|
25492
25510
|
argTokens: t.slice(1)
|
|
25493
25511
|
};
|
|
25494
25512
|
}
|
|
25495
|
-
function
|
|
25513
|
+
function Er(e, t, n) {
|
|
25496
25514
|
let { w: r, h: i, adj: a } = e, o = Math.min(r, i), s = Math.max(r, i), c = Object.create(null);
|
|
25497
25515
|
Object.assign(c, {
|
|
25498
25516
|
w: r,
|
|
@@ -25537,14 +25555,14 @@ function Tr(e, t, n) {
|
|
|
25537
25555
|
lsd8: s / 8,
|
|
25538
25556
|
lsd16: s / 16,
|
|
25539
25557
|
lsd32: s / 32,
|
|
25540
|
-
cd:
|
|
25541
|
-
cd2:
|
|
25542
|
-
cd4:
|
|
25543
|
-
cd8:
|
|
25544
|
-
"3cd4": 3 *
|
|
25545
|
-
"3cd8": 3 *
|
|
25546
|
-
"5cd8": 5 *
|
|
25547
|
-
"7cd8": 7 *
|
|
25558
|
+
cd: Cr,
|
|
25559
|
+
cd2: Cr / 2,
|
|
25560
|
+
cd4: Cr / 4,
|
|
25561
|
+
cd8: Cr / 8,
|
|
25562
|
+
"3cd4": 3 * Cr / 4,
|
|
25563
|
+
"3cd8": 3 * Cr / 8,
|
|
25564
|
+
"5cd8": 5 * Cr / 8,
|
|
25565
|
+
"7cd8": 7 * Cr / 8
|
|
25548
25566
|
}), t.forEach(([e, t], n) => {
|
|
25549
25567
|
let r = a[n];
|
|
25550
25568
|
c[e] = typeof r == "number" ? r : u(t), e === "adj" && (c.adj1 = c.adj), e === "adj1" && (c.adj = c.adj1);
|
|
@@ -25581,10 +25599,10 @@ function Tr(e, t, n) {
|
|
|
25581
25599
|
case "pin": return t[1] < t[0] ? t[0] : t[1] > t[2] ? t[2] : t[1];
|
|
25582
25600
|
case "sqrt": return Math.sqrt(Math.max(0, t[0]));
|
|
25583
25601
|
case "mod": return Math.sqrt(t[0] * t[0] + t[1] * t[1] + t[2] * t[2]);
|
|
25584
|
-
case "sin": return t[0] * Math.sin(t[1] *
|
|
25585
|
-
case "cos": return t[0] * Math.cos(t[1] *
|
|
25586
|
-
case "tan": return t[0] * Math.tan(t[1] *
|
|
25587
|
-
case "at2": return Math.atan2(t[1], t[0]) /
|
|
25602
|
+
case "sin": return t[0] * Math.sin(t[1] * wr);
|
|
25603
|
+
case "cos": return t[0] * Math.cos(t[1] * wr);
|
|
25604
|
+
case "tan": return t[0] * Math.tan(t[1] * wr);
|
|
25605
|
+
case "at2": return Math.atan2(t[1], t[0]) / wr;
|
|
25588
25606
|
case "cat2": return t[0] * Math.cos(Math.atan2(t[2], t[1]));
|
|
25589
25607
|
case "sat2": return t[0] * Math.sin(Math.atan2(t[2], t[1]));
|
|
25590
25608
|
default: throw Error(`preset-shape: unknown operator "${e}" in "${[n.op, ...n.argTokens].join(" ")}"`);
|
|
@@ -25593,8 +25611,8 @@ function Tr(e, t, n) {
|
|
|
25593
25611
|
}
|
|
25594
25612
|
//#endregion
|
|
25595
25613
|
//#region packages/core/src/shape/preset-geometry/path-executor.ts
|
|
25596
|
-
var
|
|
25597
|
-
function
|
|
25614
|
+
var Dr = Math.PI * 2 / 216e5;
|
|
25615
|
+
function Or(e, t, n, r, i, a, o) {
|
|
25598
25616
|
let s = t.w == null ? 1 : a / t.w, c = t.h == null ? 1 : o / t.h, l = (e) => r + e * s, u = (e) => i + e * c, d = 0, f = 0;
|
|
25599
25617
|
for (let r of t.cmds) switch (r[0]) {
|
|
25600
25618
|
case "m": {
|
|
@@ -25618,7 +25636,7 @@ function Dr(e, t, n, r, i, a, o) {
|
|
|
25618
25636
|
break;
|
|
25619
25637
|
}
|
|
25620
25638
|
case "a": {
|
|
25621
|
-
let t = n.resolve(r[1]), i = n.resolve(r[2]), a = t * s, o = i * c, l = n.resolve(r[3]) *
|
|
25639
|
+
let t = n.resolve(r[1]), i = n.resolve(r[2]), a = t * s, o = i * c, l = n.resolve(r[3]) * Dr, u = n.resolve(r[4]) * Dr, p = Math.PI * 2, m = (e) => Math.atan2(t * Math.sin(e), i * Math.cos(e)), h = m(l), g = Math.trunc(u / p), _ = u - g * p, v = m(l + _) - h;
|
|
25622
25640
|
_ > 0 && v < 0 ? v += p : _ < 0 && v > 0 && (v -= p);
|
|
25623
25641
|
let y = h + v + g * p, b = d - a * Math.cos(h), x = f - o * Math.sin(h);
|
|
25624
25642
|
Math.abs(a) > 1e-6 && Math.abs(o) > 1e-6 && (e.ellipse(b, x, Math.abs(a), Math.abs(o), 0, h, y, u < 0), d = b + a * Math.cos(y), f = x + o * Math.sin(y));
|
|
@@ -25631,37 +25649,37 @@ function Dr(e, t, n, r, i, a, o) {
|
|
|
25631
25649
|
}
|
|
25632
25650
|
//#endregion
|
|
25633
25651
|
//#region packages/core/src/shape/preset-geometry/index.ts
|
|
25634
|
-
var
|
|
25635
|
-
function
|
|
25636
|
-
let t =
|
|
25652
|
+
var kr = Sr, Ar = /* @__PURE__ */ new WeakMap();
|
|
25653
|
+
function jr(e) {
|
|
25654
|
+
let t = Ar.get(e);
|
|
25637
25655
|
return t || (t = {
|
|
25638
|
-
adj: e.adj.map(([e, t]) => [e,
|
|
25639
|
-
gd: e.gd.map(([e, t]) => [e,
|
|
25640
|
-
},
|
|
25656
|
+
adj: e.adj.map(([e, t]) => [e, Tr(t)]),
|
|
25657
|
+
gd: e.gd.map(([e, t]) => [e, Tr(t)])
|
|
25658
|
+
}, Ar.set(e, t)), t;
|
|
25641
25659
|
}
|
|
25642
|
-
function
|
|
25643
|
-
let i =
|
|
25644
|
-
return
|
|
25660
|
+
function Mr(e, t, n, r) {
|
|
25661
|
+
let i = jr(e);
|
|
25662
|
+
return Er({
|
|
25645
25663
|
w: t,
|
|
25646
25664
|
h: n,
|
|
25647
25665
|
adj: r
|
|
25648
25666
|
}, i.adj, i.gd);
|
|
25649
25667
|
}
|
|
25650
|
-
function
|
|
25651
|
-
return e.toLowerCase() in
|
|
25668
|
+
function Nr(e) {
|
|
25669
|
+
return e.toLowerCase() in kr;
|
|
25652
25670
|
}
|
|
25653
|
-
function
|
|
25654
|
-
let s =
|
|
25671
|
+
function Pr(e, t, n, r, i, a, o = []) {
|
|
25672
|
+
let s = kr[t.toLowerCase()];
|
|
25655
25673
|
if (!s) return !1;
|
|
25656
|
-
let c =
|
|
25657
|
-
for (let t of s.paths)
|
|
25674
|
+
let c = Mr(s, i, a, o);
|
|
25675
|
+
for (let t of s.paths) Or(e, t, c, n, r, i, a);
|
|
25658
25676
|
return !0;
|
|
25659
25677
|
}
|
|
25660
|
-
var
|
|
25678
|
+
var Fr = {
|
|
25661
25679
|
wedgeroundrectcallout: "roundrect",
|
|
25662
25680
|
wedgeellipsecallout: "ellipse",
|
|
25663
25681
|
wedgerectcallout: null
|
|
25664
|
-
},
|
|
25682
|
+
}, Ir = {
|
|
25665
25683
|
adj: [],
|
|
25666
25684
|
gd: [],
|
|
25667
25685
|
paths: [{
|
|
@@ -25695,30 +25713,30 @@ var Pr = {
|
|
|
25695
25713
|
]
|
|
25696
25714
|
}]
|
|
25697
25715
|
};
|
|
25698
|
-
function
|
|
25716
|
+
function Lr(e, t, n) {
|
|
25699
25717
|
let r = e[n];
|
|
25700
25718
|
if (typeof r == "number") return r;
|
|
25701
25719
|
let i = t.adj[n];
|
|
25702
25720
|
return i && Number(i[1].replace(/^val\s+/, "")) || 0;
|
|
25703
25721
|
}
|
|
25704
|
-
function
|
|
25705
|
-
let d = t.toLowerCase(), f =
|
|
25722
|
+
function Rr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
25723
|
+
let d = t.toLowerCase(), f = kr[d];
|
|
25706
25724
|
if (!f) return !1;
|
|
25707
|
-
if (d in
|
|
25708
|
-
let e =
|
|
25725
|
+
if (d in Fr) {
|
|
25726
|
+
let e = Lr(o, f, 0), t = Lr(o, f, 1), n = i / 2 + i * e / 1e5, r = a / 2 + a * t / 1e5;
|
|
25709
25727
|
if (n >= 0 && n <= i && r >= 0 && r <= a) {
|
|
25710
|
-
let e =
|
|
25711
|
-
e === "roundrect" ? (f =
|
|
25728
|
+
let e = Fr[d];
|
|
25729
|
+
e === "roundrect" ? (f = kr.roundrect, o = [Lr(o, kr[d], 2)]) : e && kr[e] ? (f = kr[e], o = []) : (f = Ir, o = []);
|
|
25712
25730
|
}
|
|
25713
25731
|
}
|
|
25714
|
-
let p =
|
|
25732
|
+
let p = Mr(f, i, a, o), m = !1, h = f.paths.length - 1;
|
|
25715
25733
|
for (let t = 0; t < f.paths.length; t++) {
|
|
25716
25734
|
let o = f.paths[t];
|
|
25717
|
-
e.beginPath(),
|
|
25735
|
+
e.beginPath(), Or(e, o, p, n, r, i, a);
|
|
25718
25736
|
let d = o.fill;
|
|
25719
25737
|
if (d !== "none" && s != null) {
|
|
25720
25738
|
e.save(), e.fillStyle = s, e.fill();
|
|
25721
|
-
let t =
|
|
25739
|
+
let t = Br(d);
|
|
25722
25740
|
t && (e.fillStyle = t, e.fill()), e.restore(), m ||= (l(), !0);
|
|
25723
25741
|
}
|
|
25724
25742
|
if (o.stroke && c) {
|
|
@@ -25728,10 +25746,10 @@ function Lr(e, t, n, r, i, a, o, s, c, l, u) {
|
|
|
25728
25746
|
}
|
|
25729
25747
|
return !0;
|
|
25730
25748
|
}
|
|
25731
|
-
function
|
|
25732
|
-
let o =
|
|
25749
|
+
function zr(e, t, n, r, i, a) {
|
|
25750
|
+
let o = kr[e.toLowerCase()];
|
|
25733
25751
|
if (!o || o.paths.length === 0) return null;
|
|
25734
|
-
let s = o.paths[o.paths.length - 1], c =
|
|
25752
|
+
let s = o.paths[o.paths.length - 1], c = Mr(o, r, i, a), l = s.w == null ? 1 : r / s.w, u = s.h == null ? 1 : i / s.h, d = (e) => t + e * l, f = (e) => n + e * u, p = 0, m = 0, h = 0, g = 0, _ = 0, v = 0, y = !1, b = 0, x = 0, S = [];
|
|
25735
25753
|
for (let e of s.cmds) switch (e[0]) {
|
|
25736
25754
|
case "m":
|
|
25737
25755
|
h = d(c.resolve(e[1])), g = f(c.resolve(e[2])), p = h, m = g, S.push({
|
|
@@ -25771,7 +25789,7 @@ function Rr(e, t, n, r, i, a) {
|
|
|
25771
25789
|
vertices: S
|
|
25772
25790
|
};
|
|
25773
25791
|
}
|
|
25774
|
-
function
|
|
25792
|
+
function Br(e) {
|
|
25775
25793
|
switch (e) {
|
|
25776
25794
|
case "lighten": return "rgba(255,255,255,0.30)";
|
|
25777
25795
|
case "lightenLess": return "rgba(255,255,255,0.15)";
|
|
@@ -25782,21 +25800,21 @@ function zr(e) {
|
|
|
25782
25800
|
}
|
|
25783
25801
|
//#endregion
|
|
25784
25802
|
//#region packages/core/src/image/svg-image-by-path.ts
|
|
25785
|
-
var
|
|
25786
|
-
function
|
|
25787
|
-
let t =
|
|
25803
|
+
var Vr = /* @__PURE__ */ new WeakMap(), Hr = 256;
|
|
25804
|
+
function Ur(e) {
|
|
25805
|
+
let t = Vr.get(e);
|
|
25788
25806
|
return t || (t = {
|
|
25789
25807
|
imgs: /* @__PURE__ */ new Map(),
|
|
25790
25808
|
urls: /* @__PURE__ */ new Map()
|
|
25791
|
-
},
|
|
25809
|
+
}, Vr.set(e, t)), t;
|
|
25792
25810
|
}
|
|
25793
|
-
function
|
|
25811
|
+
function Wr(e, t) {
|
|
25794
25812
|
e.imgs.delete(t);
|
|
25795
25813
|
let n = e.urls.get(t);
|
|
25796
25814
|
n && (URL.revokeObjectURL(n), e.urls.delete(t));
|
|
25797
25815
|
}
|
|
25798
|
-
function
|
|
25799
|
-
let n =
|
|
25816
|
+
function Gr(e, t) {
|
|
25817
|
+
let n = Ur(t), r = n.imgs.get(e);
|
|
25800
25818
|
if (r) return n.imgs.delete(e), n.imgs.set(e, r), r;
|
|
25801
25819
|
let i = (async () => {
|
|
25802
25820
|
let r = await t(e, "image/svg+xml"), i = URL.createObjectURL(r);
|
|
@@ -25808,30 +25826,30 @@ function Wr(e, t) {
|
|
|
25808
25826
|
}, a.onerror = () => n(/* @__PURE__ */ Error(`svg load failed: ${e}`)), a.src = i;
|
|
25809
25827
|
}), a;
|
|
25810
25828
|
})();
|
|
25811
|
-
if (i.catch(() =>
|
|
25829
|
+
if (i.catch(() => Wr(n, e)), n.imgs.set(e, i), n.imgs.size > Hr) {
|
|
25812
25830
|
let e = n.imgs.keys().next().value;
|
|
25813
|
-
|
|
25831
|
+
Wr(n, e);
|
|
25814
25832
|
}
|
|
25815
25833
|
return i;
|
|
25816
25834
|
}
|
|
25817
|
-
function
|
|
25818
|
-
let t =
|
|
25835
|
+
function Kr(e) {
|
|
25836
|
+
let t = Vr.get(e);
|
|
25819
25837
|
if (t) {
|
|
25820
25838
|
for (let e of t.urls.values()) URL.revokeObjectURL(e);
|
|
25821
|
-
t.urls.clear(), t.imgs.clear(),
|
|
25839
|
+
t.urls.clear(), t.imgs.clear(), Vr.delete(e);
|
|
25822
25840
|
}
|
|
25823
25841
|
}
|
|
25824
25842
|
//#endregion
|
|
25825
25843
|
//#region packages/core/src/image/pixel-budget.ts
|
|
25826
|
-
var
|
|
25827
|
-
function
|
|
25844
|
+
var qr = 32767, Jr = 1 << 26, Yr = qr, Xr = Jr;
|
|
25845
|
+
function Zr(e, t, n, r, i) {
|
|
25828
25846
|
if (n < 40 || t + 40 > e.byteLength) return null;
|
|
25829
25847
|
let a = e.getUint32(t, !0);
|
|
25830
25848
|
if (a < 40) return null;
|
|
25831
25849
|
let o = e.getInt32(t + 4, !0), s = e.getInt32(t + 8, !0), c = e.getUint16(t + 14, !0);
|
|
25832
25850
|
if (e.getUint32(t + 16, !0) !== 0) return null;
|
|
25833
25851
|
let l = s < 0, u = Math.abs(o), d = Math.abs(s);
|
|
25834
|
-
if (u <= 0 || d <= 0 || u >
|
|
25852
|
+
if (u <= 0 || d <= 0 || u > Yr || d > Yr || u * d > Xr) return null;
|
|
25835
25853
|
let f = new Uint8ClampedArray(u * d * 4), p = u * c + 31 >> 5 << 2 >>> 0;
|
|
25836
25854
|
if (r + p * d > r + i + p && r + p * d > e.byteLength) return null;
|
|
25837
25855
|
let m = null;
|
|
@@ -25891,7 +25909,7 @@ function Xr(e, t, n, r, i) {
|
|
|
25891
25909
|
data: f
|
|
25892
25910
|
};
|
|
25893
25911
|
}
|
|
25894
|
-
function
|
|
25912
|
+
function Qr(e, t, n) {
|
|
25895
25913
|
if (n < 40 || t + 40 > e.byteLength) return null;
|
|
25896
25914
|
let r = e.getUint32(t, !0);
|
|
25897
25915
|
if (r < 40) return null;
|
|
@@ -25901,9 +25919,9 @@ function Zr(e, t, n) {
|
|
|
25901
25919
|
n === 0 && (n = 1 << i), a = n;
|
|
25902
25920
|
} else a = e.getUint32(t + 32, !0);
|
|
25903
25921
|
let o = r + a * 4, s = t + o, c = n - o;
|
|
25904
|
-
return c <= 0 ? null :
|
|
25922
|
+
return c <= 0 ? null : Zr(e, t, o, s, c);
|
|
25905
25923
|
}
|
|
25906
|
-
function
|
|
25924
|
+
function $r(e, t, n, r, i, a) {
|
|
25907
25925
|
try {
|
|
25908
25926
|
let o = It(t.width, t.height);
|
|
25909
25927
|
if (!o) return !1;
|
|
@@ -25970,7 +25988,7 @@ var Z = {
|
|
|
25970
25988
|
EXTCREATEPEN: 95,
|
|
25971
25989
|
BITBLT: 76,
|
|
25972
25990
|
STRETCHDIBITS: 81
|
|
25973
|
-
},
|
|
25991
|
+
}, ei = {
|
|
25974
25992
|
WHITE_BRUSH: 2147483648,
|
|
25975
25993
|
LTGRAY_BRUSH: 2147483649,
|
|
25976
25994
|
GRAY_BRUSH: 2147483650,
|
|
@@ -25982,7 +26000,7 @@ var Z = {
|
|
|
25982
26000
|
NULL_PEN: 2147483656,
|
|
25983
26001
|
DC_BRUSH: 2147483666,
|
|
25984
26002
|
DC_PEN: 2147483662
|
|
25985
|
-
},
|
|
26003
|
+
}, ti = {
|
|
25986
26004
|
TEXT: 1,
|
|
25987
26005
|
LOMETRIC: 2,
|
|
25988
26006
|
HIMETRIC: 3,
|
|
@@ -25991,7 +26009,7 @@ var Z = {
|
|
|
25991
26009
|
TWIPS: 6,
|
|
25992
26010
|
ISOTROPIC: 7,
|
|
25993
26011
|
ANISOTROPIC: 8
|
|
25994
|
-
},
|
|
26012
|
+
}, ni = () => ({
|
|
25995
26013
|
m11: 1,
|
|
25996
26014
|
m12: 0,
|
|
25997
26015
|
m21: 0,
|
|
@@ -25999,7 +26017,7 @@ var Z = {
|
|
|
25999
26017
|
dx: 0,
|
|
26000
26018
|
dy: 0
|
|
26001
26019
|
});
|
|
26002
|
-
function
|
|
26020
|
+
function ri(e, t) {
|
|
26003
26021
|
return {
|
|
26004
26022
|
m11: e.m11 * t.m11 + e.m21 * t.m12,
|
|
26005
26023
|
m12: e.m12 * t.m11 + e.m22 * t.m12,
|
|
@@ -26009,7 +26027,7 @@ function ni(e, t) {
|
|
|
26009
26027
|
dy: e.m12 * t.dx + e.m22 * t.dy + e.dy
|
|
26010
26028
|
};
|
|
26011
26029
|
}
|
|
26012
|
-
var
|
|
26030
|
+
var ii = class {
|
|
26013
26031
|
p;
|
|
26014
26032
|
constructor(e, t, n) {
|
|
26015
26033
|
this.dv = e, this.end = n, this.p = t;
|
|
@@ -26053,137 +26071,137 @@ var ri = class {
|
|
|
26053
26071
|
this.p += e;
|
|
26054
26072
|
}
|
|
26055
26073
|
};
|
|
26056
|
-
function
|
|
26074
|
+
function ai(e, t, n) {
|
|
26057
26075
|
return e.wt.m11 * t + e.wt.m21 * n + e.wt.dx;
|
|
26058
26076
|
}
|
|
26059
|
-
function
|
|
26077
|
+
function oi(e, t, n) {
|
|
26060
26078
|
return e.wt.m12 * t + e.wt.m22 * n + e.wt.dy;
|
|
26061
26079
|
}
|
|
26062
|
-
function oi(e) {
|
|
26063
|
-
return e.winExtX === 0 ? 1 : e.vpExtX / e.winExtX;
|
|
26064
|
-
}
|
|
26065
26080
|
function si(e) {
|
|
26066
|
-
return e.
|
|
26081
|
+
return e.winExtX === 0 ? 1 : e.vpExtX / e.winExtX;
|
|
26067
26082
|
}
|
|
26068
26083
|
function ci(e) {
|
|
26069
|
-
return
|
|
26084
|
+
return e.winExtY === 0 ? 1 : e.vpExtY / e.winExtY;
|
|
26070
26085
|
}
|
|
26071
26086
|
function li(e) {
|
|
26072
|
-
return
|
|
26087
|
+
return Math.min(Math.abs(si(e)), Math.abs(ci(e)));
|
|
26073
26088
|
}
|
|
26074
26089
|
function ui(e) {
|
|
26075
|
-
return e.mapMode ===
|
|
26090
|
+
return e.mapMode === ti.ISOTROPIC ? si(e) < 0 ? -li(e) : li(e) : si(e);
|
|
26076
26091
|
}
|
|
26077
|
-
function di(e
|
|
26078
|
-
return (
|
|
26092
|
+
function di(e) {
|
|
26093
|
+
return e.mapMode === ti.ISOTROPIC ? ci(e) < 0 ? -li(e) : li(e) : ci(e);
|
|
26079
26094
|
}
|
|
26080
26095
|
function fi(e, t) {
|
|
26081
|
-
return (t - e.
|
|
26096
|
+
return (t - e.winOrgX) * ui(e) + e.vpOrgX;
|
|
26097
|
+
}
|
|
26098
|
+
function pi(e, t) {
|
|
26099
|
+
return (t - e.winOrgY) * di(e) + e.vpOrgY;
|
|
26082
26100
|
}
|
|
26083
26101
|
function Q(e, t, n) {
|
|
26084
|
-
let r =
|
|
26102
|
+
let r = fi(e, ai(e, t, n)), i = pi(e, oi(e, t, n));
|
|
26085
26103
|
return [(r - e.left) * e.W / e.boundsW, (i - e.top) * e.H / e.boundsH];
|
|
26086
26104
|
}
|
|
26087
|
-
function pi(e) {
|
|
26088
|
-
return (Math.hypot(e.wt.m11, e.wt.m12) + Math.hypot(e.wt.m21, e.wt.m22)) / 2;
|
|
26089
|
-
}
|
|
26090
26105
|
function mi(e) {
|
|
26091
|
-
return (Math.
|
|
26106
|
+
return (Math.hypot(e.wt.m11, e.wt.m12) + Math.hypot(e.wt.m21, e.wt.m22)) / 2;
|
|
26092
26107
|
}
|
|
26093
26108
|
function hi(e) {
|
|
26094
|
-
return (
|
|
26109
|
+
return (Math.abs(ui(e)) + Math.abs(di(e))) / 2;
|
|
26095
26110
|
}
|
|
26096
26111
|
function gi(e) {
|
|
26097
|
-
return
|
|
26112
|
+
return (e.W / e.boundsW + e.H / e.boundsH) / 2;
|
|
26098
26113
|
}
|
|
26099
26114
|
function _i(e) {
|
|
26115
|
+
return Math.hypot(e.wt.m21, e.wt.m22);
|
|
26116
|
+
}
|
|
26117
|
+
function vi(e) {
|
|
26100
26118
|
return e.H / e.boundsH;
|
|
26101
26119
|
}
|
|
26102
|
-
function
|
|
26103
|
-
let n = t *
|
|
26120
|
+
function yi(e, t) {
|
|
26121
|
+
let n = t * mi(e) * hi(e) * gi(e);
|
|
26104
26122
|
return Math.max(.75, n);
|
|
26105
26123
|
}
|
|
26106
|
-
function
|
|
26107
|
-
if (e.mapMode = t, t ===
|
|
26124
|
+
function bi(e, t) {
|
|
26125
|
+
if (e.mapMode = t, t === ti.TEXT) {
|
|
26108
26126
|
e.winOrgX = 0, e.winOrgY = 0, e.vpOrgX = 0, e.vpOrgY = 0, e.winExtX = 1, e.winExtY = 1, e.vpExtX = 1, e.vpExtY = 1;
|
|
26109
26127
|
return;
|
|
26110
26128
|
}
|
|
26111
|
-
if (t ===
|
|
26112
|
-
let n = 25.4, r = t ===
|
|
26129
|
+
if (t === ti.ANISOTROPIC || t === ti.ISOTROPIC || e.devPxPerMmX <= 0 || e.devPxPerMmY <= 0) return;
|
|
26130
|
+
let n = 25.4, r = t === ti.LOMETRIC ? .1 : t === ti.HIMETRIC ? .01 : t === ti.LOENGLISH ? .01 * n : t === ti.HIENGLISH ? .001 * n : t === ti.TWIPS ? n / 1440 : 0;
|
|
26113
26131
|
r <= 0 || (e.winOrgX = 0, e.winOrgY = 0, e.vpOrgX = 0, e.vpOrgY = 0, e.winExtX = 1, e.winExtY = 1, e.vpExtX = r * e.devPxPerMmX, e.vpExtY = -(r * e.devPxPerMmY));
|
|
26114
26132
|
}
|
|
26115
|
-
var
|
|
26116
|
-
[
|
|
26133
|
+
var xi = {
|
|
26134
|
+
[ei.WHITE_BRUSH]: {
|
|
26117
26135
|
kind: "brush",
|
|
26118
26136
|
fill: "#ffffff"
|
|
26119
26137
|
},
|
|
26120
|
-
[
|
|
26138
|
+
[ei.LTGRAY_BRUSH]: {
|
|
26121
26139
|
kind: "brush",
|
|
26122
26140
|
fill: "#c0c0c0"
|
|
26123
26141
|
},
|
|
26124
|
-
[
|
|
26142
|
+
[ei.GRAY_BRUSH]: {
|
|
26125
26143
|
kind: "brush",
|
|
26126
26144
|
fill: "#808080"
|
|
26127
26145
|
},
|
|
26128
|
-
[
|
|
26146
|
+
[ei.DKGRAY_BRUSH]: {
|
|
26129
26147
|
kind: "brush",
|
|
26130
26148
|
fill: "#404040"
|
|
26131
26149
|
},
|
|
26132
|
-
[
|
|
26150
|
+
[ei.BLACK_BRUSH]: {
|
|
26133
26151
|
kind: "brush",
|
|
26134
26152
|
fill: "#000000"
|
|
26135
26153
|
},
|
|
26136
|
-
[
|
|
26154
|
+
[ei.NULL_BRUSH]: {
|
|
26137
26155
|
kind: "brush",
|
|
26138
26156
|
fill: null
|
|
26139
26157
|
}
|
|
26140
|
-
},
|
|
26141
|
-
[
|
|
26158
|
+
}, Si = {
|
|
26159
|
+
[ei.WHITE_PEN]: {
|
|
26142
26160
|
kind: "pen",
|
|
26143
26161
|
stroke: "#ffffff",
|
|
26144
26162
|
width: 1
|
|
26145
26163
|
},
|
|
26146
|
-
[
|
|
26164
|
+
[ei.BLACK_PEN]: {
|
|
26147
26165
|
kind: "pen",
|
|
26148
26166
|
stroke: "#000000",
|
|
26149
26167
|
width: 1
|
|
26150
26168
|
},
|
|
26151
|
-
[
|
|
26169
|
+
[ei.NULL_PEN]: {
|
|
26152
26170
|
kind: "pen",
|
|
26153
26171
|
stroke: null,
|
|
26154
26172
|
width: 1
|
|
26155
26173
|
},
|
|
26156
|
-
[
|
|
26174
|
+
[ei.DC_PEN]: {
|
|
26157
26175
|
kind: "pen",
|
|
26158
26176
|
stroke: "#000000",
|
|
26159
26177
|
width: 1
|
|
26160
26178
|
}
|
|
26161
26179
|
};
|
|
26162
|
-
function
|
|
26163
|
-
let n =
|
|
26180
|
+
function Ci(e, t) {
|
|
26181
|
+
let n = xi[t];
|
|
26164
26182
|
if (n) {
|
|
26165
26183
|
e.curBrush = n;
|
|
26166
26184
|
return;
|
|
26167
26185
|
}
|
|
26168
|
-
let r =
|
|
26186
|
+
let r = Si[t];
|
|
26169
26187
|
if (r) {
|
|
26170
26188
|
e.curPen = r;
|
|
26171
26189
|
return;
|
|
26172
26190
|
}
|
|
26173
|
-
t ===
|
|
26191
|
+
t === ei.DC_BRUSH && (e.curBrush = e.curBrush ?? {
|
|
26174
26192
|
kind: "brush",
|
|
26175
26193
|
fill: "#000000"
|
|
26176
26194
|
});
|
|
26177
26195
|
}
|
|
26178
|
-
function
|
|
26196
|
+
function wi(e) {
|
|
26179
26197
|
let t = 0, n = 0, r = 0, i = 0;
|
|
26180
26198
|
for (let a = 0; a < e.data.length; a += 4) e.data[a + 3] !== 0 && (t += e.data[a], n += e.data[a + 1], r += e.data[a + 2], i++);
|
|
26181
26199
|
if (i === 0) return "#808080";
|
|
26182
26200
|
let a = (e) => Math.round(e / i).toString(16).padStart(2, "0");
|
|
26183
26201
|
return `#${a(t)}${a(n)}${a(r)}`;
|
|
26184
26202
|
}
|
|
26185
|
-
var
|
|
26186
|
-
function
|
|
26203
|
+
var Ti = (e) => [e.i16(), e.i16()], Ei = (e) => [e.i32(), e.i32()];
|
|
26204
|
+
function Di(e, t, n) {
|
|
26187
26205
|
t.skip(16);
|
|
26188
26206
|
let r = t.u32();
|
|
26189
26207
|
if (r < 2 || r > 1048576 || !e.curPen || e.curPen.stroke == null) return;
|
|
@@ -26194,9 +26212,9 @@ function Ei(e, t, n) {
|
|
|
26194
26212
|
let [r, c] = n(t), [l, u] = Q(e, r, c);
|
|
26195
26213
|
s === 0 ? i.moveTo(l, u) : i.lineTo(l, u), a = r, o = c;
|
|
26196
26214
|
}
|
|
26197
|
-
i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26215
|
+
i.strokeStyle = e.curPen.stroke, i.lineWidth = yi(e, e.curPen.width), i.stroke(), e.drew = !0, e.curX = a, e.curY = o;
|
|
26198
26216
|
}
|
|
26199
|
-
function
|
|
26217
|
+
function Oi(e, t, n) {
|
|
26200
26218
|
t.skip(16);
|
|
26201
26219
|
let r = t.u32();
|
|
26202
26220
|
if (r < 1 || r > 1048576) return;
|
|
@@ -26214,9 +26232,9 @@ function Di(e, t, n) {
|
|
|
26214
26232
|
}
|
|
26215
26233
|
e.curX = r, e.curY = o;
|
|
26216
26234
|
}
|
|
26217
|
-
a && e.curPen && (i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26235
|
+
a && e.curPen && (i.strokeStyle = e.curPen.stroke, i.lineWidth = yi(e, e.curPen.width), i.stroke(), e.drew = !0);
|
|
26218
26236
|
}
|
|
26219
|
-
function
|
|
26237
|
+
function ki(e, t, n) {
|
|
26220
26238
|
t.skip(16);
|
|
26221
26239
|
let r = t.u32();
|
|
26222
26240
|
if (r < 2 || r > 1048576) return;
|
|
@@ -26227,9 +26245,9 @@ function Oi(e, t, n) {
|
|
|
26227
26245
|
let [r, o] = n(t), [s, c] = Q(e, r, o);
|
|
26228
26246
|
a ? i.lineTo(s, c) : (i.moveTo(s, c), a = !0);
|
|
26229
26247
|
}
|
|
26230
|
-
a && (i.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26248
|
+
a && (i.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth = yi(e, e.curPen.width), i.stroke(), e.drew = !0)));
|
|
26231
26249
|
}
|
|
26232
|
-
function
|
|
26250
|
+
function Ai(e, t, n, r) {
|
|
26233
26251
|
t.skip(16);
|
|
26234
26252
|
let i = t.u32();
|
|
26235
26253
|
if (i < 1 || i > 1048576) return;
|
|
@@ -26255,9 +26273,9 @@ function ki(e, t, n, r) {
|
|
|
26255
26273
|
}
|
|
26256
26274
|
e.curX = r[0], e.curY = r[1];
|
|
26257
26275
|
}
|
|
26258
|
-
o && e.curPen && (s.strokeStyle = e.curPen.stroke, s.lineWidth =
|
|
26276
|
+
o && e.curPen && (s.strokeStyle = e.curPen.stroke, s.lineWidth = yi(e, e.curPen.width), s.stroke(), e.drew = !0);
|
|
26259
26277
|
}
|
|
26260
|
-
function
|
|
26278
|
+
function ji(e, t, n, r) {
|
|
26261
26279
|
t.skip(16);
|
|
26262
26280
|
let i = t.u32(), a = t.u32();
|
|
26263
26281
|
if (i <= 0 || i > 65536 || a <= 0 || a > 2097152) return;
|
|
@@ -26280,23 +26298,23 @@ function Ai(e, t, n, r) {
|
|
|
26280
26298
|
}
|
|
26281
26299
|
r && s.closePath(), c = !0;
|
|
26282
26300
|
}
|
|
26283
|
-
!c || e.inPath || (r && e.curBrush && e.curBrush.fill != null && (s.fillStyle = e.curBrush.fill, s.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (s.strokeStyle = e.curPen.stroke, s.lineWidth =
|
|
26301
|
+
!c || e.inPath || (r && e.curBrush && e.curBrush.fill != null && (s.fillStyle = e.curBrush.fill, s.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (s.strokeStyle = e.curPen.stroke, s.lineWidth = yi(e, e.curPen.width), s.stroke(), e.drew = !0));
|
|
26284
26302
|
}
|
|
26285
|
-
function
|
|
26303
|
+
function Mi(e, t, n, r, i) {
|
|
26286
26304
|
let { ctx: a } = e, o = Q(e, t, n), s = Q(e, r, n), c = Q(e, r, i), l = Q(e, t, i);
|
|
26287
|
-
e.inPath || a.beginPath(), a.moveTo(o[0], o[1]), a.lineTo(s[0], s[1]), a.lineTo(c[0], c[1]), a.lineTo(l[0], l[1]), a.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (a.fillStyle = e.curBrush.fill, a.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (a.strokeStyle = e.curPen.stroke, a.lineWidth =
|
|
26305
|
+
e.inPath || a.beginPath(), a.moveTo(o[0], o[1]), a.lineTo(s[0], s[1]), a.lineTo(c[0], c[1]), a.lineTo(l[0], l[1]), a.closePath(), !e.inPath && (e.curBrush && e.curBrush.fill != null && (a.fillStyle = e.curBrush.fill, a.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (a.strokeStyle = e.curPen.stroke, a.lineWidth = yi(e, e.curPen.width), a.stroke(), e.drew = !0));
|
|
26288
26306
|
}
|
|
26289
|
-
function
|
|
26307
|
+
function Ni(e) {
|
|
26290
26308
|
let t = e.u32(), n = e.u32(), r = e.i32();
|
|
26291
26309
|
e.i32();
|
|
26292
26310
|
let i = e.u32();
|
|
26293
26311
|
return [t, {
|
|
26294
26312
|
kind: "pen",
|
|
26295
|
-
stroke: (n & 255) == 5 ? null :
|
|
26313
|
+
stroke: (n & 255) == 5 ? null : la(i),
|
|
26296
26314
|
width: Math.abs(r)
|
|
26297
26315
|
}];
|
|
26298
26316
|
}
|
|
26299
|
-
function
|
|
26317
|
+
function Pi(e) {
|
|
26300
26318
|
let t = e.u32();
|
|
26301
26319
|
e.skip(16);
|
|
26302
26320
|
let n = e.u32(), r = e.u32();
|
|
@@ -26304,31 +26322,31 @@ function Ni(e) {
|
|
|
26304
26322
|
let i = e.u32();
|
|
26305
26323
|
return [t, {
|
|
26306
26324
|
kind: "pen",
|
|
26307
|
-
stroke: (n & 255) == 5 ? null :
|
|
26325
|
+
stroke: (n & 255) == 5 ? null : la(i),
|
|
26308
26326
|
width: Math.abs(r)
|
|
26309
26327
|
}];
|
|
26310
26328
|
}
|
|
26311
|
-
function
|
|
26329
|
+
function Fi(e) {
|
|
26312
26330
|
let t = e.u32(), n = e.u32(), r = e.u32();
|
|
26313
26331
|
return e.u32(), [t, {
|
|
26314
26332
|
kind: "brush",
|
|
26315
|
-
fill: n === 1 ? null :
|
|
26333
|
+
fill: n === 1 ? null : la(r)
|
|
26316
26334
|
}];
|
|
26317
26335
|
}
|
|
26318
|
-
function
|
|
26336
|
+
function Ii(e, t, n) {
|
|
26319
26337
|
let r = e.u32();
|
|
26320
26338
|
e.u32();
|
|
26321
26339
|
let i = e.u32(), a = e.u32(), o = e.u32(), s = e.u32(), c = "#808080";
|
|
26322
26340
|
try {
|
|
26323
|
-
let e =
|
|
26324
|
-
e && (c =
|
|
26341
|
+
let e = Zr(t, n + i, a, n + o, s);
|
|
26342
|
+
e && (c = wi(e));
|
|
26325
26343
|
} catch {}
|
|
26326
26344
|
return [r, {
|
|
26327
26345
|
kind: "brush",
|
|
26328
26346
|
fill: c
|
|
26329
26347
|
}];
|
|
26330
26348
|
}
|
|
26331
|
-
function
|
|
26349
|
+
function Li(e, t, n) {
|
|
26332
26350
|
let r = e.u32(), i = n + 12, a = t.getInt32(i, !0), o = t.getInt32(i + 8, !0), s = t.getInt32(i + 16, !0), c = t.getUint8(i + 20), l = "";
|
|
26333
26351
|
for (let e = 0; e < 32; e++) {
|
|
26334
26352
|
let n = i + 28 + e * 2;
|
|
@@ -26346,7 +26364,7 @@ function Ii(e, t, n) {
|
|
|
26346
26364
|
escapement: o
|
|
26347
26365
|
}];
|
|
26348
26366
|
}
|
|
26349
|
-
function
|
|
26367
|
+
function Ri(e, t, n, r) {
|
|
26350
26368
|
t.skip(16), t.u32(), t.f32(), t.f32();
|
|
26351
26369
|
let i = t.i32(), a = t.i32(), o = t.u32(), s = t.u32();
|
|
26352
26370
|
if (t.u32(), o <= 0 || o > 65536) return;
|
|
@@ -26357,7 +26375,7 @@ function Li(e, t, n, r) {
|
|
|
26357
26375
|
c += String.fromCharCode(n.getUint16(t, !0));
|
|
26358
26376
|
}
|
|
26359
26377
|
if (c.length === 0) return;
|
|
26360
|
-
let l = e.curFont, u = Math.abs(l?.height ?? 0) *
|
|
26378
|
+
let l = e.curFont, u = Math.abs(l?.height ?? 0) * _i(e) * Math.abs(di(e)) * vi(e);
|
|
26361
26379
|
if (!Number.isFinite(u) || u < 1) return;
|
|
26362
26380
|
let { ctx: d } = e, [f, p] = Q(e, i, a);
|
|
26363
26381
|
d.fillStyle = e.textColor;
|
|
@@ -26378,29 +26396,29 @@ function Li(e, t, n, r) {
|
|
|
26378
26396
|
e.drew = !0;
|
|
26379
26397
|
} catch {}
|
|
26380
26398
|
}
|
|
26381
|
-
function
|
|
26399
|
+
function zi(e, t, n, r, i, a, o, s, c, l, u) {
|
|
26382
26400
|
if (i === 0 || o === 0) return;
|
|
26383
|
-
let d =
|
|
26401
|
+
let d = Zr(t, n + r, i, n + a, o);
|
|
26384
26402
|
if (!d) return;
|
|
26385
26403
|
let [f, p] = Q(e, s, c), [m, h] = Q(e, l, u);
|
|
26386
|
-
|
|
26404
|
+
$r(e.ctx, d, f, p, m, h) && (e.drew = !0);
|
|
26387
26405
|
}
|
|
26388
|
-
function
|
|
26406
|
+
function Bi(e, t, n, r) {
|
|
26389
26407
|
t.skip(16);
|
|
26390
26408
|
let i = t.i32(), a = t.i32(), o = t.i32(), s = t.i32();
|
|
26391
|
-
t.u32(), t.i32(), t.i32(), t.skip(24), t.u32(), t.u32(),
|
|
26409
|
+
t.u32(), t.i32(), t.i32(), t.skip(24), t.u32(), t.u32(), zi(e, n, r, t.u32(), t.u32(), t.u32(), t.u32(), i, a, i + o, a + s);
|
|
26392
26410
|
}
|
|
26393
|
-
function
|
|
26411
|
+
function Vi(e, t, n, r) {
|
|
26394
26412
|
t.skip(16);
|
|
26395
26413
|
let i = t.i32(), a = t.i32();
|
|
26396
26414
|
t.i32(), t.i32(), t.i32(), t.i32();
|
|
26397
26415
|
let o = t.u32(), s = t.u32(), c = t.u32(), l = t.u32();
|
|
26398
26416
|
t.u32(), t.u32();
|
|
26399
26417
|
let u = t.i32(), d = t.i32();
|
|
26400
|
-
|
|
26418
|
+
zi(e, n, r, o, s, c, l, i, a, i + u, a + d);
|
|
26401
26419
|
}
|
|
26402
|
-
function
|
|
26403
|
-
if (!
|
|
26420
|
+
function Hi(e, t, n, r) {
|
|
26421
|
+
if (!sa(e) || n <= 0 || r <= 0) return !1;
|
|
26404
26422
|
let i = new DataView(e.buffer, e.byteOffset, e.byteLength), a = {
|
|
26405
26423
|
ctx: t,
|
|
26406
26424
|
W: n,
|
|
@@ -26409,8 +26427,8 @@ function Vi(e, t, n, r) {
|
|
|
26409
26427
|
top: 0,
|
|
26410
26428
|
boundsW: n,
|
|
26411
26429
|
boundsH: r,
|
|
26412
|
-
wt:
|
|
26413
|
-
mapMode:
|
|
26430
|
+
wt: ni(),
|
|
26431
|
+
mapMode: ti.TEXT,
|
|
26414
26432
|
winOrgX: 0,
|
|
26415
26433
|
winOrgY: 0,
|
|
26416
26434
|
winExtX: 1,
|
|
@@ -26440,7 +26458,7 @@ function Vi(e, t, n, r) {
|
|
|
26440
26458
|
if (r < 8 || r & 3) break;
|
|
26441
26459
|
let s = o + r;
|
|
26442
26460
|
if (s > e.length || n === Z.EOF) break;
|
|
26443
|
-
let c = new
|
|
26461
|
+
let c = new ii(i, o + 8, s);
|
|
26444
26462
|
try {
|
|
26445
26463
|
switch (n) {
|
|
26446
26464
|
case Z.HEADER: {
|
|
@@ -26459,11 +26477,11 @@ function Vi(e, t, n, r) {
|
|
|
26459
26477
|
break;
|
|
26460
26478
|
case Z.MODIFYWORLDTRANSFORM: {
|
|
26461
26479
|
let e = c.xform(), t = c.u32();
|
|
26462
|
-
t === 1 ? a.wt =
|
|
26480
|
+
t === 1 ? a.wt = ni() : t === 2 ? a.wt = ri(e, a.wt) : t === 3 ? a.wt = ri(a.wt, e) : t === 4 && (a.wt = e);
|
|
26463
26481
|
break;
|
|
26464
26482
|
}
|
|
26465
26483
|
case Z.SETMAPMODE:
|
|
26466
|
-
|
|
26484
|
+
bi(a, c.u32());
|
|
26467
26485
|
break;
|
|
26468
26486
|
case Z.SETWINDOWORGEX:
|
|
26469
26487
|
a.winOrgX = c.i32(), a.winOrgY = c.i32();
|
|
@@ -26536,7 +26554,7 @@ function Vi(e, t, n, r) {
|
|
|
26536
26554
|
break;
|
|
26537
26555
|
case Z.SELECTOBJECT: {
|
|
26538
26556
|
let e = c.u32();
|
|
26539
|
-
if (e & 2147483648)
|
|
26557
|
+
if (e & 2147483648) Ci(a, e >>> 0);
|
|
26540
26558
|
else {
|
|
26541
26559
|
let t = a.objects.get(e);
|
|
26542
26560
|
t?.kind === "pen" ? a.curPen = t : t?.kind === "brush" ? a.curBrush = t : t?.kind === "font" && (a.curFont = t);
|
|
@@ -26549,72 +26567,72 @@ function Vi(e, t, n, r) {
|
|
|
26549
26567
|
break;
|
|
26550
26568
|
}
|
|
26551
26569
|
case Z.CREATEPEN: {
|
|
26552
|
-
let [e, t] =
|
|
26570
|
+
let [e, t] = Ni(c);
|
|
26553
26571
|
a.objects.set(e, t);
|
|
26554
26572
|
break;
|
|
26555
26573
|
}
|
|
26556
26574
|
case Z.EXTCREATEPEN: {
|
|
26557
|
-
let [e, t] =
|
|
26575
|
+
let [e, t] = Pi(c);
|
|
26558
26576
|
a.objects.set(e, t);
|
|
26559
26577
|
break;
|
|
26560
26578
|
}
|
|
26561
26579
|
case Z.CREATEBRUSHINDIRECT: {
|
|
26562
|
-
let [e, t] =
|
|
26580
|
+
let [e, t] = Fi(c);
|
|
26563
26581
|
a.objects.set(e, t);
|
|
26564
26582
|
break;
|
|
26565
26583
|
}
|
|
26566
26584
|
case Z.CREATEMONOBRUSH:
|
|
26567
26585
|
case Z.CREATEDIBPATTERNBRUSHPT: {
|
|
26568
|
-
let [e, t] =
|
|
26586
|
+
let [e, t] = Ii(c, i, o);
|
|
26569
26587
|
a.objects.set(e, t);
|
|
26570
26588
|
break;
|
|
26571
26589
|
}
|
|
26572
26590
|
case Z.EXTCREATEFONTINDIRECTW: {
|
|
26573
|
-
let [e, t] =
|
|
26591
|
+
let [e, t] = Li(c, i, o);
|
|
26574
26592
|
a.objects.set(e, t);
|
|
26575
26593
|
break;
|
|
26576
26594
|
}
|
|
26577
26595
|
case Z.POLYLINE16:
|
|
26578
|
-
|
|
26596
|
+
Di(a, c, Ti);
|
|
26579
26597
|
break;
|
|
26580
26598
|
case Z.POLYLINE:
|
|
26581
|
-
|
|
26599
|
+
Di(a, c, Ei);
|
|
26582
26600
|
break;
|
|
26583
26601
|
case Z.POLYLINETO16:
|
|
26584
|
-
|
|
26602
|
+
Oi(a, c, Ti);
|
|
26585
26603
|
break;
|
|
26586
26604
|
case Z.POLYLINETO:
|
|
26587
|
-
|
|
26605
|
+
Oi(a, c, Ei);
|
|
26588
26606
|
break;
|
|
26589
26607
|
case Z.POLYGON16:
|
|
26590
|
-
|
|
26608
|
+
ki(a, c, Ti);
|
|
26591
26609
|
break;
|
|
26592
26610
|
case Z.POLYGON:
|
|
26593
|
-
|
|
26611
|
+
ki(a, c, Ei);
|
|
26594
26612
|
break;
|
|
26595
26613
|
case Z.POLYBEZIER16:
|
|
26596
|
-
|
|
26614
|
+
Ai(a, c, Ti, !1);
|
|
26597
26615
|
break;
|
|
26598
26616
|
case Z.POLYBEZIER:
|
|
26599
|
-
|
|
26617
|
+
Ai(a, c, Ei, !1);
|
|
26600
26618
|
break;
|
|
26601
26619
|
case Z.POLYBEZIERTO16:
|
|
26602
|
-
|
|
26620
|
+
Ai(a, c, Ti, !0);
|
|
26603
26621
|
break;
|
|
26604
26622
|
case Z.POLYBEZIERTO:
|
|
26605
|
-
|
|
26623
|
+
Ai(a, c, Ei, !0);
|
|
26606
26624
|
break;
|
|
26607
26625
|
case Z.POLYPOLYGON16:
|
|
26608
|
-
|
|
26626
|
+
ji(a, c, Ti, !0);
|
|
26609
26627
|
break;
|
|
26610
26628
|
case Z.POLYPOLYGON:
|
|
26611
|
-
|
|
26629
|
+
ji(a, c, Ei, !0);
|
|
26612
26630
|
break;
|
|
26613
26631
|
case Z.POLYPOLYLINE16:
|
|
26614
|
-
|
|
26632
|
+
ji(a, c, Ti, !1);
|
|
26615
26633
|
break;
|
|
26616
26634
|
case Z.POLYPOLYLINE:
|
|
26617
|
-
|
|
26635
|
+
ji(a, c, Ei, !1);
|
|
26618
26636
|
break;
|
|
26619
26637
|
case Z.MOVETOEX:
|
|
26620
26638
|
a.curX = c.i32(), a.curY = c.i32();
|
|
@@ -26623,24 +26641,24 @@ function Vi(e, t, n, r) {
|
|
|
26623
26641
|
let e = c.i32(), n = c.i32();
|
|
26624
26642
|
if (a.curPen && a.curPen.stroke != null) {
|
|
26625
26643
|
let [r, i] = Q(a, a.curX, a.curY), [o, s] = Q(a, e, n);
|
|
26626
|
-
t.beginPath(), t.moveTo(r, i), t.lineTo(o, s), t.strokeStyle = a.curPen.stroke, t.lineWidth =
|
|
26644
|
+
t.beginPath(), t.moveTo(r, i), t.lineTo(o, s), t.strokeStyle = a.curPen.stroke, t.lineWidth = yi(a, a.curPen.width), t.stroke(), a.drew = !0;
|
|
26627
26645
|
}
|
|
26628
26646
|
a.curX = e, a.curY = n;
|
|
26629
26647
|
break;
|
|
26630
26648
|
}
|
|
26631
26649
|
case Z.RECTANGLE:
|
|
26632
|
-
|
|
26650
|
+
Mi(a, c.i32(), c.i32(), c.i32(), c.i32());
|
|
26633
26651
|
break;
|
|
26634
26652
|
case Z.ELLIPSE: {
|
|
26635
26653
|
let e = c.i32(), n = c.i32(), r = c.i32(), i = c.i32(), [o, s] = [(e + r) / 2, (n + i) / 2], [l, u] = Q(a, o, s), [d] = Q(a, r, s), [, f] = Q(a, o, i), p = Math.abs(d - l), m = Math.abs(f - u);
|
|
26636
|
-
t.beginPath(), t.ellipse(l, u, p, m, 0, 0, Math.PI * 2), a.curBrush && a.curBrush.fill != null && (t.fillStyle = a.curBrush.fill, t.fill(a.fillRule), a.drew = !0), a.curPen && a.curPen.stroke != null && (t.strokeStyle = a.curPen.stroke, t.lineWidth =
|
|
26654
|
+
t.beginPath(), t.ellipse(l, u, p, m, 0, 0, Math.PI * 2), a.curBrush && a.curBrush.fill != null && (t.fillStyle = a.curBrush.fill, t.fill(a.fillRule), a.drew = !0), a.curPen && a.curPen.stroke != null && (t.strokeStyle = a.curPen.stroke, t.lineWidth = yi(a, a.curPen.width), t.stroke(), a.drew = !0);
|
|
26637
26655
|
break;
|
|
26638
26656
|
}
|
|
26639
26657
|
case Z.SETPOLYFILLMODE:
|
|
26640
26658
|
a.fillRule = c.u32() === 1 ? "evenodd" : "nonzero";
|
|
26641
26659
|
break;
|
|
26642
26660
|
case Z.SETTEXTCOLOR:
|
|
26643
|
-
a.textColor =
|
|
26661
|
+
a.textColor = la(c.u32());
|
|
26644
26662
|
break;
|
|
26645
26663
|
case Z.SETTEXTALIGN:
|
|
26646
26664
|
a.textAlign = c.u32();
|
|
@@ -26649,13 +26667,13 @@ function Vi(e, t, n, r) {
|
|
|
26649
26667
|
a.bkMode = c.u32();
|
|
26650
26668
|
break;
|
|
26651
26669
|
case Z.EXTTEXTOUTW:
|
|
26652
|
-
|
|
26670
|
+
Ri(a, c, i, o);
|
|
26653
26671
|
break;
|
|
26654
26672
|
case Z.BITBLT:
|
|
26655
|
-
|
|
26673
|
+
Bi(a, c, i, o);
|
|
26656
26674
|
break;
|
|
26657
26675
|
case Z.STRETCHDIBITS:
|
|
26658
|
-
|
|
26676
|
+
Vi(a, c, i, o);
|
|
26659
26677
|
break;
|
|
26660
26678
|
default: break;
|
|
26661
26679
|
}
|
|
@@ -26664,55 +26682,55 @@ function Vi(e, t, n, r) {
|
|
|
26664
26682
|
}
|
|
26665
26683
|
return a.drew;
|
|
26666
26684
|
}
|
|
26667
|
-
async function
|
|
26668
|
-
if (!
|
|
26685
|
+
async function Ui(e, t, n) {
|
|
26686
|
+
if (!sa(e) || t <= 0 || n <= 0) return null;
|
|
26669
26687
|
let r = It(t, n);
|
|
26670
26688
|
if (!r) return null;
|
|
26671
26689
|
let i = r.getContext("2d");
|
|
26672
|
-
return !i || (i.lineJoin = "round", i.lineCap = "round", !
|
|
26690
|
+
return !i || (i.lineJoin = "round", i.lineCap = "round", !Hi(e, i, t, n)) ? null : createImageBitmap(r);
|
|
26673
26691
|
}
|
|
26674
26692
|
//#endregion
|
|
26675
26693
|
//#region packages/core/src/image/raster-dimensions.ts
|
|
26676
|
-
function
|
|
26694
|
+
function Wi(e, t) {
|
|
26677
26695
|
return e[t] << 8 | e[t + 1];
|
|
26678
26696
|
}
|
|
26679
|
-
function
|
|
26697
|
+
function Gi(e, t) {
|
|
26680
26698
|
return (e[t] << 24 | e[t + 1] << 16 | e[t + 2] << 8 | e[t + 3]) >>> 0;
|
|
26681
26699
|
}
|
|
26682
|
-
function
|
|
26700
|
+
function Ki(e, t) {
|
|
26683
26701
|
return e[t] | e[t + 1] << 8;
|
|
26684
26702
|
}
|
|
26685
|
-
function
|
|
26703
|
+
function qi(e, t) {
|
|
26686
26704
|
return e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24 | 0;
|
|
26687
26705
|
}
|
|
26688
|
-
function
|
|
26706
|
+
function Ji(e) {
|
|
26689
26707
|
let t = e.length;
|
|
26690
26708
|
return t >= 24 && e[0] === 137 && e[1] === 80 && e[2] === 78 && e[3] === 71 && e[4] === 13 && e[5] === 10 && e[6] === 26 && e[7] === 10 ? e[12] === 73 && e[13] === 72 && e[14] === 68 && e[15] === 82 ? {
|
|
26691
|
-
width:
|
|
26692
|
-
height: Wi(e, 20)
|
|
26693
|
-
} : null : t >= 10 && e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97 ? {
|
|
26694
|
-
width: Gi(e, 6),
|
|
26695
|
-
height: Gi(e, 8)
|
|
26696
|
-
} : t >= 26 && e[0] === 66 && e[1] === 77 ? Ji(e, 14) === 12 ? {
|
|
26697
|
-
width: Gi(e, 18),
|
|
26709
|
+
width: Gi(e, 16),
|
|
26698
26710
|
height: Gi(e, 20)
|
|
26711
|
+
} : null : t >= 10 && e[0] === 71 && e[1] === 73 && e[2] === 70 && e[3] === 56 && (e[4] === 55 || e[4] === 57) && e[5] === 97 ? {
|
|
26712
|
+
width: Ki(e, 6),
|
|
26713
|
+
height: Ki(e, 8)
|
|
26714
|
+
} : t >= 26 && e[0] === 66 && e[1] === 77 ? Yi(e, 14) === 12 ? {
|
|
26715
|
+
width: Ki(e, 18),
|
|
26716
|
+
height: Ki(e, 20)
|
|
26699
26717
|
} : {
|
|
26700
|
-
width: Math.abs(
|
|
26701
|
-
height: Math.abs(
|
|
26702
|
-
} : t >= 16 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ?
|
|
26718
|
+
width: Math.abs(qi(e, 18)),
|
|
26719
|
+
height: Math.abs(qi(e, 22))
|
|
26720
|
+
} : t >= 16 && e[0] === 82 && e[1] === 73 && e[2] === 70 && e[3] === 70 && e[8] === 87 && e[9] === 69 && e[10] === 66 && e[11] === 80 ? Xi(e) : t >= 4 && e[0] === 255 && e[1] === 216 ? Zi(e) : null;
|
|
26703
26721
|
}
|
|
26704
|
-
function
|
|
26722
|
+
function Yi(e, t) {
|
|
26705
26723
|
return (e[t] | e[t + 1] << 8 | e[t + 2] << 16 | e[t + 3] << 24) >>> 0;
|
|
26706
26724
|
}
|
|
26707
|
-
function
|
|
26725
|
+
function Xi(e) {
|
|
26708
26726
|
let t = e.length, n = e[12], r = e[13], i = e[14], a = e[15];
|
|
26709
26727
|
if (n === 86 && r === 80 && i === 56 && a === 32) return t < 30 ? null : {
|
|
26710
|
-
width:
|
|
26711
|
-
height:
|
|
26728
|
+
width: Ki(e, 26) & 16383,
|
|
26729
|
+
height: Ki(e, 28) & 16383
|
|
26712
26730
|
};
|
|
26713
26731
|
if (n === 86 && r === 80 && i === 56 && a === 76) {
|
|
26714
26732
|
if (t < 25 || e[20] !== 47) return null;
|
|
26715
|
-
let n =
|
|
26733
|
+
let n = Yi(e, 21);
|
|
26716
26734
|
return {
|
|
26717
26735
|
width: (n & 16383) + 1,
|
|
26718
26736
|
height: (n >>> 14 & 16383) + 1
|
|
@@ -26723,7 +26741,7 @@ function Yi(e) {
|
|
|
26723
26741
|
height: (e[27] | e[28] << 8 | e[29] << 16) + 1
|
|
26724
26742
|
} : null;
|
|
26725
26743
|
}
|
|
26726
|
-
function
|
|
26744
|
+
function Zi(e) {
|
|
26727
26745
|
let t = e.length, n = 2;
|
|
26728
26746
|
for (; n + 1 < t;) {
|
|
26729
26747
|
if (e[n] !== 255) {
|
|
@@ -26740,12 +26758,12 @@ function Xi(e) {
|
|
|
26740
26758
|
continue;
|
|
26741
26759
|
}
|
|
26742
26760
|
if (r === 217 || n + 3 >= t) return null;
|
|
26743
|
-
let i =
|
|
26761
|
+
let i = Wi(e, n + 2);
|
|
26744
26762
|
if (r >= 192 && r <= 207 && r !== 196 && r !== 200 && r !== 204) {
|
|
26745
26763
|
if (n + 8 >= t) return null;
|
|
26746
|
-
let r =
|
|
26764
|
+
let r = Wi(e, n + 5);
|
|
26747
26765
|
return {
|
|
26748
|
-
width:
|
|
26766
|
+
width: Wi(e, n + 7),
|
|
26749
26767
|
height: r
|
|
26750
26768
|
};
|
|
26751
26769
|
}
|
|
@@ -26754,17 +26772,17 @@ function Xi(e) {
|
|
|
26754
26772
|
}
|
|
26755
26773
|
return null;
|
|
26756
26774
|
}
|
|
26757
|
-
function
|
|
26775
|
+
function Qi(e) {
|
|
26758
26776
|
let { width: t, height: n } = e;
|
|
26759
|
-
return !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 || t > 32767 || n > 32767 ? !0 : t * n >
|
|
26777
|
+
return !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 || t > 32767 || n > 32767 ? !0 : t * n > Jr;
|
|
26760
26778
|
}
|
|
26761
|
-
function
|
|
26762
|
-
let t =
|
|
26763
|
-
return t !== null &&
|
|
26779
|
+
function $i(e) {
|
|
26780
|
+
let t = Ji(e);
|
|
26781
|
+
return t !== null && Qi(t);
|
|
26764
26782
|
}
|
|
26765
26783
|
//#endregion
|
|
26766
26784
|
//#region packages/core/src/image/wmf.ts
|
|
26767
|
-
var
|
|
26785
|
+
var ea = {
|
|
26768
26786
|
EOF: 0,
|
|
26769
26787
|
SETBKMODE: 258,
|
|
26770
26788
|
SETTEXTALIGN: 302,
|
|
@@ -26785,35 +26803,35 @@ var $i = {
|
|
|
26785
26803
|
DIBBITBLT: 2368,
|
|
26786
26804
|
DIBSTRETCHBLT: 2881,
|
|
26787
26805
|
STRETCHDIBITS: 3907
|
|
26788
|
-
},
|
|
26789
|
-
function
|
|
26790
|
-
if (e.length < t +
|
|
26806
|
+
}, ta = 2596720087, na = 22, ra = 18, ia = 1179469088;
|
|
26807
|
+
function aa(e, t) {
|
|
26808
|
+
if (e.length < t + ra) return !1;
|
|
26791
26809
|
let n = e[t] | e[t + 1] << 8, r = e[t + 2] | e[t + 3] << 8;
|
|
26792
26810
|
return (n === 1 || n === 2) && r === 9;
|
|
26793
26811
|
}
|
|
26794
|
-
function aa(e) {
|
|
26795
|
-
return e.length < 4 ? !1 : (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 === ea ? !0 : ia(e, 0);
|
|
26796
|
-
}
|
|
26797
26812
|
function oa(e) {
|
|
26813
|
+
return e.length < 4 ? !1 : (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 === ta ? !0 : aa(e, 0);
|
|
26814
|
+
}
|
|
26815
|
+
function sa(e) {
|
|
26798
26816
|
if (e.length < 44) return !1;
|
|
26799
26817
|
let t = new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
26800
|
-
return t.getUint32(0, !0) === 1 && t.getUint32(40, !0) ===
|
|
26818
|
+
return t.getUint32(0, !0) === 1 && t.getUint32(40, !0) === ia;
|
|
26801
26819
|
}
|
|
26802
|
-
function
|
|
26820
|
+
function ca(e) {
|
|
26803
26821
|
return e === "image/wmf" || e === "image/emf";
|
|
26804
26822
|
}
|
|
26805
|
-
function
|
|
26823
|
+
function la(e) {
|
|
26806
26824
|
let t = e & 255, n = e >>> 8 & 255, r = e >>> 16 & 255, i = (e) => e.toString(16).padStart(2, "0");
|
|
26807
26825
|
return `#${i(t)}${i(n)}${i(r)}`;
|
|
26808
26826
|
}
|
|
26809
|
-
function
|
|
26827
|
+
function ua(e, t) {
|
|
26810
26828
|
for (let n = 0; n < e.length; n++) if (e[n] == null) {
|
|
26811
26829
|
e[n] = t;
|
|
26812
26830
|
return;
|
|
26813
26831
|
}
|
|
26814
26832
|
e.push(t);
|
|
26815
26833
|
}
|
|
26816
|
-
var
|
|
26834
|
+
var da = class {
|
|
26817
26835
|
p = 0;
|
|
26818
26836
|
constructor(e, t, n) {
|
|
26819
26837
|
this.b = e, this.end = n, this.p = t;
|
|
@@ -26844,56 +26862,56 @@ var ua = class {
|
|
|
26844
26862
|
this.p = Math.min(this.p + Math.max(0, e), this.end);
|
|
26845
26863
|
}
|
|
26846
26864
|
};
|
|
26847
|
-
function
|
|
26865
|
+
function fa(e, t) {
|
|
26848
26866
|
return (t - e.orgX) * (e.W / e.extX);
|
|
26849
26867
|
}
|
|
26850
|
-
function
|
|
26868
|
+
function pa(e, t) {
|
|
26851
26869
|
return (t - e.orgY) * (e.H / e.extY);
|
|
26852
26870
|
}
|
|
26853
|
-
function
|
|
26871
|
+
function ma(e, t) {
|
|
26854
26872
|
let n = t * Math.abs(e.W / e.extX);
|
|
26855
26873
|
return n >= 1 ? n : 1;
|
|
26856
26874
|
}
|
|
26857
|
-
var
|
|
26858
|
-
function ha(e, t, n) {
|
|
26859
|
-
return Math.abs(e - t) <= ma || Math.abs(e - n) <= ma;
|
|
26860
|
-
}
|
|
26875
|
+
var ha = .001;
|
|
26861
26876
|
function ga(e, t, n) {
|
|
26877
|
+
return Math.abs(e - t) <= ha || Math.abs(e - n) <= ha;
|
|
26878
|
+
}
|
|
26879
|
+
function _a(e, t, n) {
|
|
26862
26880
|
let r = [], i = n ? t.length : t.length - 1;
|
|
26863
26881
|
for (let n = 0; n < i; n++) {
|
|
26864
|
-
let i = t[n], a = t[(n + 1) % t.length], o = Math.abs(i[0] - a[0]) <=
|
|
26882
|
+
let i = t[n], a = t[(n + 1) % t.length], o = Math.abs(i[0] - a[0]) <= ha && ga(i[0], 0, e.W) && ga(a[0], 0, e.W), s = Math.abs(i[1] - a[1]) <= ha && ga(i[1], 0, e.H) && ga(a[1], 0, e.H);
|
|
26865
26883
|
o || s || r.push([i, a]);
|
|
26866
26884
|
}
|
|
26867
26885
|
return r;
|
|
26868
26886
|
}
|
|
26869
|
-
function
|
|
26887
|
+
function va(e, t, n) {
|
|
26870
26888
|
if (!e.curPen || e.curPen.stroke == null || t.length < 2) return;
|
|
26871
26889
|
let { ctx: r } = e;
|
|
26872
|
-
if (r.strokeStyle = e.curPen.stroke, r.lineWidth =
|
|
26890
|
+
if (r.strokeStyle = e.curPen.stroke, r.lineWidth = ma(e, e.curPen.width), !e.suppressBoundaryFrame) {
|
|
26873
26891
|
r.beginPath(), r.moveTo(t[0][0], t[0][1]);
|
|
26874
26892
|
for (let e = 1; e < t.length; e++) r.lineTo(t[e][0], t[e][1]);
|
|
26875
26893
|
n && r.closePath(), r.stroke(), e.drew = !0;
|
|
26876
26894
|
return;
|
|
26877
26895
|
}
|
|
26878
|
-
let i =
|
|
26896
|
+
let i = _a(e, t, n);
|
|
26879
26897
|
if (i.length === 0) return;
|
|
26880
26898
|
r.beginPath();
|
|
26881
26899
|
let a = null;
|
|
26882
26900
|
for (let [e, t] of i) (!a || a[0] !== e[0] || a[1] !== e[1]) && r.moveTo(e[0], e[1]), r.lineTo(t[0], t[1]), a = t;
|
|
26883
26901
|
r.stroke(), e.drew = !0;
|
|
26884
26902
|
}
|
|
26885
|
-
function
|
|
26903
|
+
function ya(e, t, n) {
|
|
26886
26904
|
let r = [];
|
|
26887
26905
|
for (let i = 0; i < n && !(t.remaining < 4); i++) {
|
|
26888
26906
|
let n = t.i16(), i = t.i16();
|
|
26889
|
-
r.push([
|
|
26907
|
+
r.push([fa(e, n), pa(e, i)]);
|
|
26890
26908
|
}
|
|
26891
26909
|
return r;
|
|
26892
26910
|
}
|
|
26893
|
-
function ya(e, t) {
|
|
26894
|
-
t.length < 2 || !e.curPen || e.curPen.stroke == null || _a(e, t, !1);
|
|
26895
|
-
}
|
|
26896
26911
|
function ba(e, t) {
|
|
26912
|
+
t.length < 2 || !e.curPen || e.curPen.stroke == null || va(e, t, !1);
|
|
26913
|
+
}
|
|
26914
|
+
function xa(e, t) {
|
|
26897
26915
|
if (t.length < 2) return;
|
|
26898
26916
|
let { ctx: n } = e;
|
|
26899
26917
|
if (e.curBrush && e.curBrush.fill != null) {
|
|
@@ -26901,9 +26919,9 @@ function ba(e, t) {
|
|
|
26901
26919
|
for (let e = 1; e < t.length; e++) n.lineTo(t[e][0], t[e][1]);
|
|
26902
26920
|
n.closePath(), n.fillStyle = e.curBrush.fill, n.fill(e.fillRule), e.drew = !0;
|
|
26903
26921
|
}
|
|
26904
|
-
|
|
26922
|
+
va(e, t, !0);
|
|
26905
26923
|
}
|
|
26906
|
-
function
|
|
26924
|
+
function Sa(e, t) {
|
|
26907
26925
|
let n = t.u16();
|
|
26908
26926
|
if (n <= 0 || n > 65536) return;
|
|
26909
26927
|
let r = [];
|
|
@@ -26919,33 +26937,33 @@ function xa(e, t) {
|
|
|
26919
26937
|
for (let e = 0; e < n && t.remaining >= 4; e++) t.i16(), t.i16();
|
|
26920
26938
|
continue;
|
|
26921
26939
|
}
|
|
26922
|
-
let r =
|
|
26940
|
+
let r = ya(e, t, n);
|
|
26923
26941
|
if (!(r.length < 2)) {
|
|
26924
26942
|
i.moveTo(r[0][0], r[0][1]);
|
|
26925
26943
|
for (let e = 1; e < r.length; e++) i.lineTo(r[e][0], r[e][1]);
|
|
26926
26944
|
i.closePath(), a = !0;
|
|
26927
26945
|
}
|
|
26928
26946
|
}
|
|
26929
|
-
a && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth =
|
|
26947
|
+
a && (e.curBrush && e.curBrush.fill != null && (i.fillStyle = e.curBrush.fill, i.fill(e.fillRule), e.drew = !0), e.curPen && e.curPen.stroke != null && (i.strokeStyle = e.curPen.stroke, i.lineWidth = ma(e, e.curPen.width), i.stroke(), e.drew = !0));
|
|
26930
26948
|
}
|
|
26931
|
-
function
|
|
26949
|
+
function Ca(e) {
|
|
26932
26950
|
let t = e.u16(), n = e.i16();
|
|
26933
26951
|
e.i16();
|
|
26934
26952
|
let r = e.u32();
|
|
26935
26953
|
return {
|
|
26936
26954
|
kind: "pen",
|
|
26937
|
-
stroke: (t & 255) == 5 ? null :
|
|
26955
|
+
stroke: (t & 255) == 5 ? null : la(r),
|
|
26938
26956
|
width: Math.abs(n)
|
|
26939
26957
|
};
|
|
26940
26958
|
}
|
|
26941
|
-
function
|
|
26959
|
+
function wa(e) {
|
|
26942
26960
|
let t = e.u16(), n = e.u32();
|
|
26943
26961
|
return e.u16(), {
|
|
26944
26962
|
kind: "brush",
|
|
26945
|
-
fill: t === 1 ? null :
|
|
26963
|
+
fill: t === 1 ? null : la(n)
|
|
26946
26964
|
};
|
|
26947
26965
|
}
|
|
26948
|
-
function
|
|
26966
|
+
function Ta(e) {
|
|
26949
26967
|
let t = e.indexOf(0), n = t >= 0 ? e.subarray(0, t) : e;
|
|
26950
26968
|
if (n.length === 0) return "";
|
|
26951
26969
|
try {
|
|
@@ -26954,7 +26972,7 @@ function wa(e) {
|
|
|
26954
26972
|
return String.fromCharCode(...n);
|
|
26955
26973
|
}
|
|
26956
26974
|
}
|
|
26957
|
-
function
|
|
26975
|
+
function Ea(e) {
|
|
26958
26976
|
let t = Math.abs(e.i16());
|
|
26959
26977
|
e.i16(), e.i16(), e.i16();
|
|
26960
26978
|
let n = e.i16(), r = e.u8() !== 0;
|
|
@@ -26963,12 +26981,12 @@ function Ta(e) {
|
|
|
26963
26981
|
height: t,
|
|
26964
26982
|
weight: n,
|
|
26965
26983
|
italic: r,
|
|
26966
|
-
face:
|
|
26984
|
+
face: Ta(e.bytes(Math.min(32, e.remaining)))
|
|
26967
26985
|
};
|
|
26968
26986
|
}
|
|
26969
|
-
function
|
|
26987
|
+
function Da(e, t, n, r) {
|
|
26970
26988
|
if (t.length === 0) return;
|
|
26971
|
-
let i = e.curFont, a = i?.height || 12, o = Math.abs(
|
|
26989
|
+
let i = e.curFont, a = i?.height || 12, o = Math.abs(pa(e, e.orgY + a) - pa(e, e.orgY));
|
|
26972
26990
|
if (!Number.isFinite(o) || o < 1) return;
|
|
26973
26991
|
let { ctx: s } = e;
|
|
26974
26992
|
try {
|
|
@@ -26976,14 +26994,14 @@ function Ea(e, t, n, r) {
|
|
|
26976
26994
|
let a = i && i.weight >= 700 ? "bold " : "";
|
|
26977
26995
|
s.font = `${i?.italic ? "italic " : ""}${a}${o}px ${i?.face || "sans-serif"}`;
|
|
26978
26996
|
let c = e.textAlign & 6;
|
|
26979
|
-
s.textAlign = c === 2 ? "right" : c === 6 ? "center" : "left", s.textBaseline = (e.textAlign & 24) == 24 ? "alphabetic" : "top", s.fillText(t,
|
|
26997
|
+
s.textAlign = c === 2 ? "right" : c === 6 ? "center" : "left", s.textBaseline = (e.textAlign & 24) == 24 ? "alphabetic" : "top", s.fillText(t, fa(e, n), pa(e, r)), e.drew = !0;
|
|
26980
26998
|
} catch {}
|
|
26981
26999
|
}
|
|
26982
|
-
function
|
|
26983
|
-
if (!
|
|
27000
|
+
function Oa(e, t, n, r, i = !1) {
|
|
27001
|
+
if (!oa(e)) return !1;
|
|
26984
27002
|
let a = 0;
|
|
26985
|
-
(e.length >= 4 ? (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 : 0) ===
|
|
26986
|
-
let o = a +
|
|
27003
|
+
(e.length >= 4 ? (e[0] | e[1] << 8 | e[2] << 16 | e[3] << 24) >>> 0 : 0) === ta && (a = na);
|
|
27004
|
+
let o = a + ra;
|
|
26987
27005
|
if (o > e.length) return !1;
|
|
26988
27006
|
let s = {
|
|
26989
27007
|
ctx: t,
|
|
@@ -27008,189 +27026,189 @@ function Da(e, t, n, r, i = !1) {
|
|
|
27008
27026
|
let t = c.getUint32(o, !0), n = c.getUint16(o + 4, !0);
|
|
27009
27027
|
if (t < 3) break;
|
|
27010
27028
|
let r = t * 2, i = o + r;
|
|
27011
|
-
if (i > e.length || n ===
|
|
27012
|
-
let a = o + 6, l = new
|
|
27029
|
+
if (i > e.length || n === ea.EOF) break;
|
|
27030
|
+
let a = o + 6, l = new da(e, a, i);
|
|
27013
27031
|
switch (n) {
|
|
27014
|
-
case
|
|
27032
|
+
case ea.SETWINDOWORG:
|
|
27015
27033
|
s.orgY = l.i16(), s.orgX = l.i16();
|
|
27016
27034
|
break;
|
|
27017
|
-
case
|
|
27035
|
+
case ea.SETWINDOWEXT: {
|
|
27018
27036
|
let e = l.i16(), t = l.i16();
|
|
27019
27037
|
s.extY = e || 1, s.extX = t || 1, s.haveExt = !0;
|
|
27020
27038
|
break;
|
|
27021
27039
|
}
|
|
27022
|
-
case
|
|
27040
|
+
case ea.SETPOLYFILLMODE:
|
|
27023
27041
|
s.fillRule = l.u16() === 1 ? "evenodd" : "nonzero";
|
|
27024
27042
|
break;
|
|
27025
|
-
case
|
|
27026
|
-
s.textColor =
|
|
27043
|
+
case ea.SETTEXTCOLOR:
|
|
27044
|
+
s.textColor = la(l.u32());
|
|
27027
27045
|
break;
|
|
27028
|
-
case
|
|
27046
|
+
case ea.SETTEXTALIGN:
|
|
27029
27047
|
s.textAlign = l.u16();
|
|
27030
27048
|
break;
|
|
27031
|
-
case
|
|
27032
|
-
|
|
27049
|
+
case ea.CREATEPENINDIRECT:
|
|
27050
|
+
ua(s.objects, Ca(l));
|
|
27033
27051
|
break;
|
|
27034
|
-
case
|
|
27035
|
-
|
|
27052
|
+
case ea.CREATEBRUSHINDIRECT:
|
|
27053
|
+
ua(s.objects, wa(l));
|
|
27036
27054
|
break;
|
|
27037
|
-
case
|
|
27038
|
-
|
|
27055
|
+
case ea.CREATEFONTINDIRECT:
|
|
27056
|
+
ua(s.objects, Ea(l));
|
|
27039
27057
|
break;
|
|
27040
|
-
case
|
|
27058
|
+
case ea.SELECTOBJECT: {
|
|
27041
27059
|
let e = l.u16(), t = s.objects[e];
|
|
27042
27060
|
t?.kind === "pen" ? s.curPen = t : t?.kind === "brush" ? s.curBrush = t : t?.kind === "font" && (s.curFont = t);
|
|
27043
27061
|
break;
|
|
27044
27062
|
}
|
|
27045
|
-
case
|
|
27063
|
+
case ea.DELETEOBJECT: {
|
|
27046
27064
|
let e = l.u16(), t = s.objects[e];
|
|
27047
27065
|
t && (t === s.curPen && (s.curPen = null), t === s.curBrush && (s.curBrush = null), t === s.curFont && (s.curFont = null), s.objects[e] = null);
|
|
27048
27066
|
break;
|
|
27049
27067
|
}
|
|
27050
|
-
case
|
|
27051
|
-
|
|
27068
|
+
case ea.POLYLINE:
|
|
27069
|
+
ba(s, ya(s, l, l.i16()));
|
|
27052
27070
|
break;
|
|
27053
|
-
case
|
|
27054
|
-
|
|
27071
|
+
case ea.POLYGON:
|
|
27072
|
+
xa(s, ya(s, l, l.i16()));
|
|
27055
27073
|
break;
|
|
27056
|
-
case
|
|
27057
|
-
|
|
27074
|
+
case ea.POLYPOLYGON:
|
|
27075
|
+
Sa(s, l);
|
|
27058
27076
|
break;
|
|
27059
|
-
case
|
|
27077
|
+
case ea.RECTANGLE: {
|
|
27060
27078
|
let e = l.i16(), t = l.i16(), n = l.i16(), r = l.i16();
|
|
27061
|
-
|
|
27062
|
-
[
|
|
27063
|
-
[
|
|
27064
|
-
[
|
|
27065
|
-
[
|
|
27079
|
+
xa(s, [
|
|
27080
|
+
[fa(s, r), pa(s, n)],
|
|
27081
|
+
[fa(s, t), pa(s, n)],
|
|
27082
|
+
[fa(s, t), pa(s, e)],
|
|
27083
|
+
[fa(s, r), pa(s, e)]
|
|
27066
27084
|
]);
|
|
27067
27085
|
break;
|
|
27068
27086
|
}
|
|
27069
|
-
case
|
|
27070
|
-
let e = l.u16(), t =
|
|
27087
|
+
case ea.TEXTOUT: {
|
|
27088
|
+
let e = l.u16(), t = Ta(l.bytes(e));
|
|
27071
27089
|
e % 2 != 0 && l.skip(1);
|
|
27072
27090
|
let n = l.i16();
|
|
27073
|
-
|
|
27091
|
+
Da(s, t, l.i16(), n);
|
|
27074
27092
|
break;
|
|
27075
27093
|
}
|
|
27076
|
-
case
|
|
27094
|
+
case ea.STRETCHDIBITS: {
|
|
27077
27095
|
l.u32(), l.i16(), l.i16(), l.i16(), l.i16(), l.u16();
|
|
27078
|
-
let e = l.i16(), t = l.i16(), n = l.i16(), r = l.i16(), o = a + 22, u =
|
|
27096
|
+
let e = l.i16(), t = l.i16(), n = l.i16(), r = l.i16(), o = a + 22, u = Qr(c, o, i - o);
|
|
27079
27097
|
if (u) {
|
|
27080
|
-
let i =
|
|
27081
|
-
|
|
27098
|
+
let i = fa(s, r), a = pa(s, n), o = fa(s, r + t), c = pa(s, n + e);
|
|
27099
|
+
$r(s.ctx, u, i, a, o, c) && (s.drew = !0);
|
|
27082
27100
|
}
|
|
27083
27101
|
break;
|
|
27084
27102
|
}
|
|
27085
|
-
case
|
|
27086
|
-
case
|
|
27087
|
-
case
|
|
27103
|
+
case ea.DIBSTRETCHBLT:
|
|
27104
|
+
case ea.DIBBITBLT:
|
|
27105
|
+
case ea.SETBKMODE: break;
|
|
27088
27106
|
default: break;
|
|
27089
27107
|
}
|
|
27090
27108
|
o = i;
|
|
27091
27109
|
}
|
|
27092
27110
|
return s.drew;
|
|
27093
27111
|
}
|
|
27094
|
-
var
|
|
27095
|
-
function
|
|
27096
|
-
let n = e > 0 ? e : 300, r = t > 0 ? t : 300, i = (e) => Math.max(1, Math.min(
|
|
27112
|
+
var ka = 2e3, Aa = 2;
|
|
27113
|
+
function ja(e, t) {
|
|
27114
|
+
let n = e > 0 ? e : 300, r = t > 0 ? t : 300, i = (e) => Math.max(1, Math.min(ka, Math.round(e)));
|
|
27097
27115
|
return {
|
|
27098
|
-
w: i(n *
|
|
27099
|
-
h: i(r *
|
|
27116
|
+
w: i(n * Aa),
|
|
27117
|
+
h: i(r * Aa)
|
|
27100
27118
|
};
|
|
27101
27119
|
}
|
|
27102
|
-
async function
|
|
27103
|
-
if (!
|
|
27120
|
+
async function Ma(e, t, n, r = !1) {
|
|
27121
|
+
if (!oa(e) || t <= 0 || n <= 0) return null;
|
|
27104
27122
|
let i = It(t, n);
|
|
27105
27123
|
if (!i) return null;
|
|
27106
27124
|
let a = i.getContext("2d");
|
|
27107
|
-
return !a || (a.lineJoin = "round", a.lineCap = "round", !
|
|
27125
|
+
return !a || (a.lineJoin = "round", a.lineCap = "round", !Oa(e, a, t, n, r)) ? null : createImageBitmap(i);
|
|
27108
27126
|
}
|
|
27109
|
-
async function
|
|
27127
|
+
async function Na(e, t = {}) {
|
|
27110
27128
|
let { widthPt: n = 0, heightPt: r = 0, suppressBoundaryFrame: i = !1 } = t, a = new Uint8Array(await e.slice(0, 64 * 1024).arrayBuffer());
|
|
27111
|
-
if (aa(a)) {
|
|
27112
|
-
let { w: t, h: a } = Aa(n, r);
|
|
27113
|
-
return ja(new Uint8Array(await e.arrayBuffer()), t, a, i);
|
|
27114
|
-
}
|
|
27115
27129
|
if (oa(a)) {
|
|
27116
|
-
let { w: t, h:
|
|
27117
|
-
return
|
|
27130
|
+
let { w: t, h: a } = ja(n, r);
|
|
27131
|
+
return Ma(new Uint8Array(await e.arrayBuffer()), t, a, i);
|
|
27132
|
+
}
|
|
27133
|
+
if (sa(a)) {
|
|
27134
|
+
let { w: t, h: i } = ja(n, r);
|
|
27135
|
+
return Ui(new Uint8Array(await e.arrayBuffer()), t, i);
|
|
27118
27136
|
}
|
|
27119
|
-
return
|
|
27137
|
+
return $i(a) ? null : createImageBitmap(e);
|
|
27120
27138
|
}
|
|
27121
27139
|
//#endregion
|
|
27122
27140
|
//#region packages/core/src/image/bitmap-image-by-path.ts
|
|
27123
|
-
var
|
|
27124
|
-
function
|
|
27125
|
-
let t =
|
|
27126
|
-
return t || (t = /* @__PURE__ */ new Map(),
|
|
27127
|
-
}
|
|
27128
|
-
var Ia = /* @__PURE__ */ new WeakMap(), La = /* @__PURE__ */ new WeakSet();
|
|
27129
|
-
function Ra(e) {
|
|
27130
|
-
!e || La.has(e) || (La.add(e), e.close());
|
|
27141
|
+
var Pa = 256, Fa = /* @__PURE__ */ new WeakMap();
|
|
27142
|
+
function Ia(e) {
|
|
27143
|
+
let t = Fa.get(e);
|
|
27144
|
+
return t || (t = /* @__PURE__ */ new Map(), Fa.set(e, t)), t;
|
|
27131
27145
|
}
|
|
27146
|
+
var La = /* @__PURE__ */ new WeakMap(), Ra = /* @__PURE__ */ new WeakSet();
|
|
27132
27147
|
function za(e) {
|
|
27133
|
-
|
|
27148
|
+
!e || Ra.has(e) || (Ra.add(e), e.close());
|
|
27149
|
+
}
|
|
27150
|
+
function Ba(e) {
|
|
27151
|
+
let t = La.get(e);
|
|
27134
27152
|
t || (t = {
|
|
27135
27153
|
count: 0,
|
|
27136
27154
|
deferred: []
|
|
27137
|
-
},
|
|
27155
|
+
}, La.set(e, t));
|
|
27138
27156
|
let n = t;
|
|
27139
27157
|
n.count++;
|
|
27140
27158
|
let r = !1;
|
|
27141
27159
|
return () => {
|
|
27142
27160
|
if (!r && (r = !0, n.count--, !(n.count > 0))) {
|
|
27143
|
-
for (let e of n.deferred) e.then((e) =>
|
|
27144
|
-
n.deferred = [],
|
|
27161
|
+
for (let e of n.deferred) e.then((e) => za(e)).catch(() => {});
|
|
27162
|
+
n.deferred = [], La.delete(e);
|
|
27145
27163
|
}
|
|
27146
27164
|
};
|
|
27147
27165
|
}
|
|
27148
|
-
function
|
|
27149
|
-
let n =
|
|
27166
|
+
function Va(e, t) {
|
|
27167
|
+
let n = La.get(e);
|
|
27150
27168
|
if (n && n.count > 0) {
|
|
27151
27169
|
n.deferred.push(t);
|
|
27152
27170
|
return;
|
|
27153
27171
|
}
|
|
27154
|
-
t.then((e) =>
|
|
27172
|
+
t.then((e) => za(e)).catch(() => {});
|
|
27155
27173
|
}
|
|
27156
|
-
function
|
|
27157
|
-
let { widthPt: i = 0, heightPt: a = 0, suppressBoundaryFrame: o = !1 } = r, s =
|
|
27174
|
+
function Ha(e, t, n, r = {}) {
|
|
27175
|
+
let { widthPt: i = 0, heightPt: a = 0, suppressBoundaryFrame: o = !1 } = r, s = Ia(n), c = s.get(e);
|
|
27158
27176
|
if (c) return s.delete(e), s.set(e, c), c.promise;
|
|
27159
|
-
let l = n(e, t).then((e) =>
|
|
27177
|
+
let l = n(e, t).then((e) => Na(e, {
|
|
27160
27178
|
widthPt: i,
|
|
27161
27179
|
heightPt: a,
|
|
27162
27180
|
suppressBoundaryFrame: o
|
|
27163
27181
|
})), u = { promise: l };
|
|
27164
27182
|
if (l.then((e) => {
|
|
27165
27183
|
u.bitmap = e;
|
|
27166
|
-
}).catch(() => {}), l.catch(() => s.delete(e)), s.set(e, u), s.size >
|
|
27184
|
+
}).catch(() => {}), l.catch(() => s.delete(e)), s.set(e, u), s.size > Pa) {
|
|
27167
27185
|
let e = s.keys().next().value, t = s.get(e);
|
|
27168
|
-
s.delete(e), t &&
|
|
27186
|
+
s.delete(e), t && Va(n, t.promise);
|
|
27169
27187
|
}
|
|
27170
27188
|
return l;
|
|
27171
27189
|
}
|
|
27172
|
-
function
|
|
27173
|
-
return
|
|
27190
|
+
function Ua(e, t) {
|
|
27191
|
+
return Fa.get(t)?.get(e)?.bitmap;
|
|
27174
27192
|
}
|
|
27175
|
-
function
|
|
27176
|
-
let t =
|
|
27193
|
+
function Wa(e) {
|
|
27194
|
+
let t = Fa.get(e);
|
|
27177
27195
|
if (t) {
|
|
27178
|
-
for (let n of t.values())
|
|
27179
|
-
t.clear(),
|
|
27196
|
+
for (let n of t.values()) Va(e, n.promise);
|
|
27197
|
+
t.clear(), Fa.delete(e);
|
|
27180
27198
|
}
|
|
27181
27199
|
}
|
|
27182
27200
|
//#endregion
|
|
27183
27201
|
//#region packages/core/src/image/crop.ts
|
|
27184
|
-
function
|
|
27202
|
+
function Ga(e) {
|
|
27185
27203
|
let t = e;
|
|
27186
27204
|
return {
|
|
27187
27205
|
w: t.naturalWidth || (typeof t.width == "number" ? t.width : 0) || 0,
|
|
27188
27206
|
h: t.naturalHeight || (typeof t.height == "number" ? t.height : 0) || 0
|
|
27189
27207
|
};
|
|
27190
27208
|
}
|
|
27191
|
-
function
|
|
27209
|
+
function Ka(e, t) {
|
|
27192
27210
|
if (!t || !(t.l || t.t || t.r || t.b)) return null;
|
|
27193
|
-
let { w: n, h: r } =
|
|
27211
|
+
let { w: n, h: r } = Ga(e);
|
|
27194
27212
|
if (n <= 0 || r <= 0) return null;
|
|
27195
27213
|
let i = (e) => Math.max(0, Math.min(1, e)), a = i(t.l) * n, o = i(t.t) * r;
|
|
27196
27214
|
return {
|
|
@@ -27200,12 +27218,12 @@ function Ga(e, t) {
|
|
|
27200
27218
|
sh: Math.max(1, r - o - i(t.b) * r)
|
|
27201
27219
|
};
|
|
27202
27220
|
}
|
|
27203
|
-
function
|
|
27204
|
-
let s =
|
|
27221
|
+
function qa(e, t, n, r, i, a, o) {
|
|
27222
|
+
let s = Ka(t, n);
|
|
27205
27223
|
s ? e.drawImage(t, s.sx, s.sy, s.sw, s.sh, r, i, a, o) : e.drawImage(t, r, i, a, o);
|
|
27206
27224
|
}
|
|
27207
|
-
function
|
|
27208
|
-
if (!t || !
|
|
27225
|
+
function Ja(e, t, n, r) {
|
|
27226
|
+
if (!t || !ca(e)) return {
|
|
27209
27227
|
widthPt: n,
|
|
27210
27228
|
heightPt: r
|
|
27211
27229
|
};
|
|
@@ -27217,32 +27235,32 @@ function qa(e, t, n, r) {
|
|
|
27217
27235
|
}
|
|
27218
27236
|
//#endregion
|
|
27219
27237
|
//#region packages/core/src/image/duotone.ts
|
|
27220
|
-
function
|
|
27238
|
+
function Ya(e) {
|
|
27221
27239
|
return /^[0-9a-fA-F]{6}$/.test(e) ? [
|
|
27222
27240
|
parseInt(e.slice(0, 2), 16),
|
|
27223
27241
|
parseInt(e.slice(2, 4), 16),
|
|
27224
27242
|
parseInt(e.slice(4, 6), 16)
|
|
27225
27243
|
] : null;
|
|
27226
27244
|
}
|
|
27227
|
-
function
|
|
27245
|
+
function Xa(e, t, n) {
|
|
27228
27246
|
return (.299 * e + .587 * t + .114 * n) / 255;
|
|
27229
27247
|
}
|
|
27230
|
-
function
|
|
27231
|
-
let r =
|
|
27248
|
+
function Za(e, t, n) {
|
|
27249
|
+
let r = Ya(t), i = Ya(n);
|
|
27232
27250
|
if (!r || !i) return e;
|
|
27233
27251
|
let [a, o, s] = r, [c, l, u] = i, d = e.data;
|
|
27234
27252
|
for (let e = 0; e < d.length; e += 4) {
|
|
27235
27253
|
if (d[e + 3] === 0) continue;
|
|
27236
|
-
let t =
|
|
27254
|
+
let t = Xa(d[e], d[e + 1], d[e + 2]);
|
|
27237
27255
|
d[e] = Math.round(a + (c - a) * t), d[e + 1] = Math.round(o + (l - o) * t), d[e + 2] = Math.round(s + (u - s) * t);
|
|
27238
27256
|
}
|
|
27239
27257
|
return e;
|
|
27240
27258
|
}
|
|
27241
|
-
var
|
|
27242
|
-
async function
|
|
27259
|
+
var Qa = (e, t) => typeof OffscreenCanvas > "u" ? null : new OffscreenCanvas(e, t);
|
|
27260
|
+
async function $a(e, t, n) {
|
|
27243
27261
|
let { width: r, height: i } = n;
|
|
27244
27262
|
if (r <= 0 || i <= 0 || typeof createImageBitmap > "u") return e;
|
|
27245
|
-
let a = (n.offscreenFactory ??
|
|
27263
|
+
let a = (n.offscreenFactory ?? Qa)(r, i);
|
|
27246
27264
|
if (!a) return e;
|
|
27247
27265
|
let o = a.getContext("2d");
|
|
27248
27266
|
if (!o) return e;
|
|
@@ -27253,22 +27271,22 @@ async function Qa(e, t, n) {
|
|
|
27253
27271
|
} catch {
|
|
27254
27272
|
return e;
|
|
27255
27273
|
}
|
|
27256
|
-
return
|
|
27274
|
+
return Za(s, t.clr1, t.clr2), o.putImageData(s, 0, 0), createImageBitmap(a);
|
|
27257
27275
|
}
|
|
27258
27276
|
//#endregion
|
|
27259
27277
|
//#region packages/core/src/image/blip-gate.ts
|
|
27260
|
-
function
|
|
27278
|
+
function eo(e) {
|
|
27261
27279
|
return e.svgImagePath != null && e.srcRect == null;
|
|
27262
27280
|
}
|
|
27263
27281
|
//#endregion
|
|
27264
27282
|
//#region packages/core/src/math/mathml.ts
|
|
27265
|
-
var
|
|
27283
|
+
var to = {
|
|
27266
27284
|
"&": "&",
|
|
27267
27285
|
"<": "<",
|
|
27268
27286
|
">": ">",
|
|
27269
27287
|
"\"": """
|
|
27270
|
-
},
|
|
27271
|
-
function
|
|
27288
|
+
}, no = (e) => e.replace(/[&<>"]/g, (e) => to[e]);
|
|
27289
|
+
function ro(e) {
|
|
27272
27290
|
switch (e) {
|
|
27273
27291
|
case "roman": return "normal";
|
|
27274
27292
|
case "bold": return "bold";
|
|
@@ -27276,10 +27294,10 @@ function no(e) {
|
|
|
27276
27294
|
case "italic": return null;
|
|
27277
27295
|
}
|
|
27278
27296
|
}
|
|
27279
|
-
var
|
|
27280
|
-
function
|
|
27281
|
-
let n =
|
|
27282
|
-
a &&= (i += `<mn${r}>${
|
|
27297
|
+
var io = new Set([..."⏞⏟⎴⎵︷︸⏜⏝{}[]()¯_‾"]), ao = "+−±∓×÷·∗⋅∘∙*/", oo = "=≠<>≤≥≈≡∼≅≃→←↔⇒∈∉⊂⊆⊃⊇∝≪≫⊥≔", so = "([{⟨⌈⌊", co = ")]}⟩⌉⌋", lo = ",;";
|
|
27298
|
+
function uo(e, t) {
|
|
27299
|
+
let n = ro(t), r = n ? ` mathvariant="${n}"` : "", i = "", a = "", o = () => {
|
|
27300
|
+
a &&= (i += `<mn${r}>${no(a)}</mn>`, "");
|
|
27283
27301
|
};
|
|
27284
27302
|
for (let t of e) {
|
|
27285
27303
|
if (t === " ") {
|
|
@@ -27290,56 +27308,56 @@ function lo(e, t) {
|
|
|
27290
27308
|
a += t;
|
|
27291
27309
|
continue;
|
|
27292
27310
|
}
|
|
27293
|
-
o(),
|
|
27311
|
+
o(), ao.includes(t) || oo.includes(t) || lo.includes(t) ? i += `<mo>${no(t)}</mo>` : so.includes(t) || co.includes(t) ? i += `<mo fence="true" stretchy="false">${no(t)}</mo>` : i += `<mi${r}>${no(t)}</mi>`;
|
|
27294
27312
|
}
|
|
27295
27313
|
return o(), i;
|
|
27296
27314
|
}
|
|
27297
|
-
function
|
|
27298
|
-
return e.map(
|
|
27315
|
+
function fo(e) {
|
|
27316
|
+
return e.map(po).join("");
|
|
27299
27317
|
}
|
|
27300
27318
|
function $(e) {
|
|
27301
|
-
return `<mrow>${
|
|
27319
|
+
return `<mrow>${fo(e)}</mrow>`;
|
|
27302
27320
|
}
|
|
27303
|
-
function
|
|
27321
|
+
function po(e) {
|
|
27304
27322
|
switch (e.kind) {
|
|
27305
|
-
case "run": return
|
|
27323
|
+
case "run": return uo(e.text, e.style);
|
|
27306
27324
|
case "group": return $(e.items);
|
|
27307
27325
|
case "fraction": return `<mfrac${e.bar === !1 ? " linethickness=\"0\"" : ""}>${$(e.num)}${$(e.den)}</mfrac>`;
|
|
27308
27326
|
case "sup": return `<msup>${$(e.base)}${$(e.sup ?? [])}</msup>`;
|
|
27309
27327
|
case "sub": return `<msub>${$(e.base)}${$(e.sub ?? [])}</msub>`;
|
|
27310
27328
|
case "subSup": return `<msubsup>${$(e.base)}${$(e.sub ?? [])}${$(e.sup ?? [])}</msubsup>`;
|
|
27311
|
-
case "nary": return
|
|
27312
|
-
case "delimiter": return
|
|
27313
|
-
case "radical": return e.index && e.index.length ? `<mroot>${$(e.radicand)}${$(e.index)}</mroot>` : `<msqrt>${
|
|
27314
|
-
case "limit": return
|
|
27315
|
-
case "array": return
|
|
27329
|
+
case "nary": return So(e);
|
|
27330
|
+
case "delimiter": return Co(e);
|
|
27331
|
+
case "radical": return e.index && e.index.length ? `<mroot>${$(e.radicand)}${$(e.index)}</mroot>` : `<msqrt>${fo(e.radicand)}</msqrt>`;
|
|
27332
|
+
case "limit": return yo(e);
|
|
27333
|
+
case "array": return bo(e);
|
|
27316
27334
|
case "groupChr": {
|
|
27317
|
-
let t = $(e.base), n =
|
|
27335
|
+
let t = $(e.base), n = io.has(e.char), r = e.pos === "top" ? "mover" : "munder", i = `<mo stretchy="${n}">${no(e.char)}</mo>`;
|
|
27318
27336
|
return n ? `<${r}>${t}${i}</${r}>` : `<${r} accent="true">${t}${i}</${r}>`;
|
|
27319
27337
|
}
|
|
27320
27338
|
case "bar": {
|
|
27321
27339
|
let t = $(e.base), n = "<mo stretchy=\"true\">―</mo>";
|
|
27322
27340
|
return e.pos === "bot" ? `<munder>${t}${n}</munder>` : `<mover>${t}${n}</mover>`;
|
|
27323
27341
|
}
|
|
27324
|
-
case "accent": return
|
|
27342
|
+
case "accent": return vo(e);
|
|
27325
27343
|
case "func": return `<mrow>${$(e.name)}<mo>⁡</mo>${$(e.arg)}</mrow>`;
|
|
27326
|
-
case "phant": return
|
|
27344
|
+
case "phant": return mo(e);
|
|
27327
27345
|
case "sPre": return `<mmultiscripts>${$(e.base)}<mprescripts/>${$(e.sub)}${$(e.sup)}</mmultiscripts>`;
|
|
27328
27346
|
case "box": return $(e.base);
|
|
27329
|
-
case "borderBox": return
|
|
27347
|
+
case "borderBox": return ho(e);
|
|
27330
27348
|
}
|
|
27331
27349
|
}
|
|
27332
|
-
function
|
|
27333
|
-
let t = e.show ?
|
|
27350
|
+
function mo(e) {
|
|
27351
|
+
let t = e.show ? fo(e.base) : `<mphantom>${fo(e.base)}</mphantom>`, n = [];
|
|
27334
27352
|
return e.zeroWid && n.push("width=\"0\""), e.zeroAsc && n.push("height=\"0\""), e.zeroDesc && n.push("depth=\"0\""), n.length ? `<mpadded ${n.join(" ")}>${t}</mpadded>` : `<mrow>${t}</mrow>`;
|
|
27335
27353
|
}
|
|
27336
|
-
function
|
|
27354
|
+
function ho(e) {
|
|
27337
27355
|
let t = [], n = !e.hideTop, r = !e.hideBot, i = !e.hideLeft, a = !e.hideRight;
|
|
27338
27356
|
n && r && i && a ? t.push("box") : (n && t.push("top"), r && t.push("bottom"), i && t.push("left"), a && t.push("right")), e.strikeH && t.push("horizontalstrike"), e.strikeV && t.push("verticalstrike"), e.strikeBltr && t.push("updiagonalstrike"), e.strikeTlbr && t.push("downdiagonalstrike");
|
|
27339
|
-
let o =
|
|
27357
|
+
let o = fo(e.base);
|
|
27340
27358
|
return t.length ? `<menclose notation="${t.join(" ")}">${o}</menclose>` : `<mrow>${o}</mrow>`;
|
|
27341
27359
|
}
|
|
27342
|
-
var
|
|
27360
|
+
var go = {
|
|
27343
27361
|
"̀": "`",
|
|
27344
27362
|
"́": "´",
|
|
27345
27363
|
"̂": "^",
|
|
@@ -27350,7 +27368,7 @@ var ho = {
|
|
|
27350
27368
|
"̌": "ˇ",
|
|
27351
27369
|
"⃗": "→",
|
|
27352
27370
|
"⃖": "←"
|
|
27353
|
-
},
|
|
27371
|
+
}, _o = new Set([
|
|
27354
27372
|
"̅",
|
|
27355
27373
|
"̄",
|
|
27356
27374
|
"¯",
|
|
@@ -27358,53 +27376,53 @@ var ho = {
|
|
|
27358
27376
|
"̲",
|
|
27359
27377
|
"̳"
|
|
27360
27378
|
]);
|
|
27361
|
-
function
|
|
27379
|
+
function vo(e) {
|
|
27362
27380
|
let t = $(e.base);
|
|
27363
|
-
if (
|
|
27364
|
-
let n =
|
|
27365
|
-
return `<mover accent="true">${t}<mo stretchy="${n === "→" || n === "←" ? "true" : "false"}">${
|
|
27381
|
+
if (_o.has(e.char)) return `<mover>${t}<mo stretchy="true">―</mo></mover>`;
|
|
27382
|
+
let n = go[e.char] ?? e.char;
|
|
27383
|
+
return `<mover accent="true">${t}<mo stretchy="${n === "→" || n === "←" ? "true" : "false"}">${no(n)}</mo></mover>`;
|
|
27366
27384
|
}
|
|
27367
|
-
function
|
|
27385
|
+
function yo(e) {
|
|
27368
27386
|
let t = $(e.base), n = e.lower && e.lower.length ? $(e.lower) : null, r = e.upper && e.upper.length ? $(e.upper) : null;
|
|
27369
27387
|
return n && r ? `<munderover>${t}${n}${r}</munderover>` : n ? `<munder>${t}${n}</munder>` : r ? `<mover>${t}${r}</mover>` : t;
|
|
27370
27388
|
}
|
|
27371
|
-
function
|
|
27389
|
+
function bo(e) {
|
|
27372
27390
|
let t = Math.max(1, ...e.rows.map((e) => e.length)), n;
|
|
27373
27391
|
n = e.align === "eq" ? Array.from({ length: t }, (e, t) => t % 2 == 0 ? "right" : "left").join(" ") : e.align === "left" ? "left" : "center";
|
|
27374
|
-
let r = e.rows.map((e) => `<mtr>${e.map((e) => `<mtd>${
|
|
27392
|
+
let r = e.rows.map((e) => `<mtr>${e.map((e) => `<mtd>${fo(e)}</mtd>`).join("")}</mtr>`).join("");
|
|
27375
27393
|
return `<mtable columnalign="${n}" rowspacing="0.2em" columnspacing="0.3em">${r}</mtable>`;
|
|
27376
27394
|
}
|
|
27377
|
-
var
|
|
27378
|
-
function xo(e) {
|
|
27379
|
-
let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 : bo.has(e.op), n = `<mo largeop="true">${to(e.op)}</mo>`, r = e.sub ?? [], i = e.sup ?? [], a;
|
|
27380
|
-
return a = t ? r.length && i.length ? `<msubsup>${n}${$(r)}${$(i)}</msubsup>` : r.length ? `<msub>${n}${$(r)}</msub>` : i.length ? `<msup>${n}${$(i)}</msup>` : n : r.length && i.length ? `<munderover>${n}${$(r)}${$(i)}</munderover>` : r.length ? `<munder>${n}${$(r)}</munder>` : i.length ? `<mover>${n}${$(i)}</mover>` : n, `<mrow>${a}${uo(e.body)}</mrow>`;
|
|
27381
|
-
}
|
|
27395
|
+
var xo = new Set([..."∫∬∭∮∯∰∱∲∳⨌⨍⨎⨏⨐⨑⨒⨓⨔⨕⨖⨗"]);
|
|
27382
27396
|
function So(e) {
|
|
27383
|
-
let t = (e)
|
|
27397
|
+
let t = e.limLoc === "subSup" ? !0 : e.limLoc === "undOvr" ? !1 : xo.has(e.op), n = `<mo largeop="true">${no(e.op)}</mo>`, r = e.sub ?? [], i = e.sup ?? [], a;
|
|
27398
|
+
return a = t ? r.length && i.length ? `<msubsup>${n}${$(r)}${$(i)}</msubsup>` : r.length ? `<msub>${n}${$(r)}</msub>` : i.length ? `<msup>${n}${$(i)}</msup>` : n : r.length && i.length ? `<munderover>${n}${$(r)}${$(i)}</munderover>` : r.length ? `<munder>${n}${$(r)}</munder>` : i.length ? `<mover>${n}${$(i)}</mover>` : n, `<mrow>${a}${fo(e.body)}</mrow>`;
|
|
27399
|
+
}
|
|
27400
|
+
function Co(e) {
|
|
27401
|
+
let t = (e) => `<mo fence="true" stretchy="true">${no(e)}</mo>`, n = e.items.map((e) => $(e)).join("<mo separator=\"true\">,</mo>");
|
|
27384
27402
|
return `<mrow>${t(e.begChar)}${n}${t(e.endChar)}</mrow>`;
|
|
27385
27403
|
}
|
|
27386
|
-
function
|
|
27387
|
-
return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="${t ? "block" : "inline"}">${
|
|
27404
|
+
function wo(e, t) {
|
|
27405
|
+
return `<math xmlns="http://www.w3.org/1998/Math/MathML" display="${t ? "block" : "inline"}">${fo(e)}</math>`;
|
|
27388
27406
|
}
|
|
27389
27407
|
//#endregion
|
|
27390
27408
|
//#region packages/core/src/canvas/env.ts
|
|
27391
|
-
function
|
|
27409
|
+
function To(e) {
|
|
27392
27410
|
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement;
|
|
27393
27411
|
}
|
|
27394
|
-
function
|
|
27412
|
+
function Eo(e = 1) {
|
|
27395
27413
|
return typeof window < "u" && window.devicePixelRatio || e;
|
|
27396
27414
|
}
|
|
27397
27415
|
//#endregion
|
|
27398
27416
|
//#region packages/core/src/canvas/crisp.ts
|
|
27399
|
-
function
|
|
27417
|
+
function Do(e, t, n) {
|
|
27400
27418
|
let r = Math.round(t * n) % 2 == 1 ? .5 : 0, i = e * n;
|
|
27401
27419
|
return (Math.round(i - r) + r) / n - e;
|
|
27402
27420
|
}
|
|
27403
27421
|
//#endregion
|
|
27404
27422
|
//#region packages/core/src/canvas/clamp.ts
|
|
27405
|
-
var
|
|
27406
|
-
function
|
|
27407
|
-
let n = Number.isFinite(e) && e > 0 ? Math.max(1, Math.round(e)) : 1, r = Number.isFinite(t) && t > 0 ? Math.max(1, Math.round(t)) : 1, i = Math.min(1,
|
|
27423
|
+
var Oo = 32767, ko = 1 << 24;
|
|
27424
|
+
function Ao(e, t) {
|
|
27425
|
+
let n = Number.isFinite(e) && e > 0 ? Math.max(1, Math.round(e)) : 1, r = Number.isFinite(t) && t > 0 ? Math.max(1, Math.round(t)) : 1, i = Math.min(1, Oo / n, Oo / r), a = n * r, o = a > 16777216 ? Math.sqrt(ko / a) : 1, s = Math.min(i, o);
|
|
27408
27426
|
return s >= 1 ? {
|
|
27409
27427
|
width: n,
|
|
27410
27428
|
height: r,
|
|
@@ -27419,11 +27437,11 @@ function ko(e, t) {
|
|
|
27419
27437
|
}
|
|
27420
27438
|
//#endregion
|
|
27421
27439
|
//#region packages/core/src/worker/bridge.ts
|
|
27422
|
-
function
|
|
27440
|
+
function jo() {
|
|
27423
27441
|
let e = /* @__PURE__ */ Error("worker request aborted");
|
|
27424
27442
|
return e.name = "AbortError", e;
|
|
27425
27443
|
}
|
|
27426
|
-
var
|
|
27444
|
+
var Mo = class {
|
|
27427
27445
|
_worker;
|
|
27428
27446
|
_opts;
|
|
27429
27447
|
_pending = /* @__PURE__ */ new Map();
|
|
@@ -27459,7 +27477,7 @@ var jo = class {
|
|
|
27459
27477
|
let r = this._nextId++, i = n?.timeoutMs ?? this._opts.timeoutMs, a = n?.signal;
|
|
27460
27478
|
return new Promise((n, o) => {
|
|
27461
27479
|
if (a?.aborted) {
|
|
27462
|
-
o(
|
|
27480
|
+
o(jo());
|
|
27463
27481
|
return;
|
|
27464
27482
|
}
|
|
27465
27483
|
let s, c;
|
|
@@ -27474,7 +27492,7 @@ var jo = class {
|
|
|
27474
27492
|
e && (this._pending.delete(r), e.cleanup(), e.reject(/* @__PURE__ */ Error(`worker request timed out after ${i}ms`)));
|
|
27475
27493
|
}, i)), a && (c = () => {
|
|
27476
27494
|
let e = this._pending.get(r);
|
|
27477
|
-
e && (this._pending.delete(r), e.cleanup(), e.reject(
|
|
27495
|
+
e && (this._pending.delete(r), e.cleanup(), e.reject(jo()));
|
|
27478
27496
|
}, a.addEventListener("abort", c)), this._worker.postMessage(e(r), t);
|
|
27479
27497
|
});
|
|
27480
27498
|
}
|
|
@@ -27484,7 +27502,7 @@ var jo = class {
|
|
|
27484
27502
|
terminate() {
|
|
27485
27503
|
this._worker.removeEventListener("message", this._handle), this._worker.removeEventListener("messageerror", this._handleWorkerError), this._worker.removeEventListener("error", this._handleWorkerError), this._worker.terminate(), this._rejectAll(/* @__PURE__ */ Error("Worker terminated"));
|
|
27486
27504
|
}
|
|
27487
|
-
},
|
|
27505
|
+
}, No = [
|
|
27488
27506
|
"L",
|
|
27489
27507
|
"R",
|
|
27490
27508
|
"AL",
|
|
@@ -27508,7 +27526,7 @@ var jo = class {
|
|
|
27508
27526
|
"RLI",
|
|
27509
27527
|
"FSI",
|
|
27510
27528
|
"PDI"
|
|
27511
|
-
],
|
|
27529
|
+
], Po = [
|
|
27512
27530
|
0,
|
|
27513
27531
|
9,
|
|
27514
27532
|
10,
|
|
@@ -28776,7 +28794,7 @@ var jo = class {
|
|
|
28776
28794
|
1048574,
|
|
28777
28795
|
1048576,
|
|
28778
28796
|
1114110
|
|
28779
|
-
],
|
|
28797
|
+
], Fo = [
|
|
28780
28798
|
9,
|
|
28781
28799
|
11,
|
|
28782
28800
|
10,
|
|
@@ -30044,7 +30062,7 @@ var jo = class {
|
|
|
30044
30062
|
9,
|
|
30045
30063
|
0,
|
|
30046
30064
|
9
|
|
30047
|
-
],
|
|
30065
|
+
], Io = [
|
|
30048
30066
|
40,
|
|
30049
30067
|
41,
|
|
30050
30068
|
41,
|
|
@@ -30901,7 +30919,7 @@ var jo = class {
|
|
|
30901
30919
|
65379,
|
|
30902
30920
|
65379,
|
|
30903
30921
|
65378
|
|
30904
|
-
],
|
|
30922
|
+
], Lo = [
|
|
30905
30923
|
40,
|
|
30906
30924
|
41,
|
|
30907
30925
|
0,
|
|
@@ -31289,42 +31307,42 @@ var jo = class {
|
|
|
31289
31307
|
];
|
|
31290
31308
|
//#endregion
|
|
31291
31309
|
//#region packages/core/src/text/bidi/char-data.ts
|
|
31292
|
-
function
|
|
31293
|
-
let t = 0, n =
|
|
31310
|
+
function Ro(e) {
|
|
31311
|
+
let t = 0, n = Po.length - 1;
|
|
31294
31312
|
for (; t < n;) {
|
|
31295
31313
|
let r = t + n + 1 >> 1;
|
|
31296
|
-
|
|
31314
|
+
Po[r] <= e ? t = r : n = r - 1;
|
|
31297
31315
|
}
|
|
31298
|
-
return
|
|
31316
|
+
return Fo[t];
|
|
31299
31317
|
}
|
|
31300
|
-
function
|
|
31301
|
-
return
|
|
31318
|
+
function zo(e) {
|
|
31319
|
+
return No[Ro(e)];
|
|
31302
31320
|
}
|
|
31303
|
-
var
|
|
31321
|
+
var Bo = (() => {
|
|
31304
31322
|
let e = /* @__PURE__ */ new Map();
|
|
31305
|
-
for (let t = 0; t <
|
|
31323
|
+
for (let t = 0; t < Io.length; t += 2) e.set(Io[t], Io[t + 1]);
|
|
31306
31324
|
return e;
|
|
31307
31325
|
})();
|
|
31308
|
-
function
|
|
31309
|
-
return
|
|
31326
|
+
function Vo(e) {
|
|
31327
|
+
return Bo.get(e) ?? null;
|
|
31310
31328
|
}
|
|
31311
|
-
var
|
|
31329
|
+
var Ho = (() => {
|
|
31312
31330
|
let e = /* @__PURE__ */ new Map();
|
|
31313
|
-
for (let t = 0; t <
|
|
31314
|
-
pair:
|
|
31315
|
-
type:
|
|
31331
|
+
for (let t = 0; t < Lo.length; t += 3) e.set(Lo[t], {
|
|
31332
|
+
pair: Lo[t + 1],
|
|
31333
|
+
type: Lo[t + 2] === 0 ? "o" : "c"
|
|
31316
31334
|
});
|
|
31317
31335
|
return e;
|
|
31318
31336
|
})();
|
|
31319
|
-
function
|
|
31320
|
-
return
|
|
31337
|
+
function Uo(e) {
|
|
31338
|
+
return Ho.get(e) ?? null;
|
|
31321
31339
|
}
|
|
31322
|
-
var
|
|
31323
|
-
function
|
|
31340
|
+
var Wo = (e) => e === "RLE" || e === "LRE" || e === "RLO" || e === "LRO" || e === "PDF" || e === "BN", Go = (e) => e === "LRI" || e === "RLI" || e === "FSI", Ko = (e) => e === "B" || e === "S" || e === "WS" || e === "ON" || e === "FSI" || e === "LRI" || e === "RLI" || e === "PDI", qo = (e) => e & 1 ? e + 2 : e + 1, Jo = (e) => e & 1 ? e + 1 : e + 2;
|
|
31341
|
+
function Yo(e, t, n) {
|
|
31324
31342
|
let r = 0;
|
|
31325
31343
|
for (let i = t; i < n; i++) {
|
|
31326
31344
|
let t = e[i];
|
|
31327
|
-
if (
|
|
31345
|
+
if (Go(t)) r++;
|
|
31328
31346
|
else if (t === "PDI") r > 0 && r--;
|
|
31329
31347
|
else if (r === 0) {
|
|
31330
31348
|
if (t === "L") return 0;
|
|
@@ -31333,11 +31351,11 @@ function Jo(e, t, n) {
|
|
|
31333
31351
|
}
|
|
31334
31352
|
return 0;
|
|
31335
31353
|
}
|
|
31336
|
-
function
|
|
31354
|
+
function Xo(e) {
|
|
31337
31355
|
let t = e.length, n = new Int32Array(t).fill(t), r = new Int32Array(t).fill(-1), i = [];
|
|
31338
31356
|
for (let a = 0; a < t; a++) {
|
|
31339
31357
|
let t = e[a];
|
|
31340
|
-
if (
|
|
31358
|
+
if (Go(t)) i.push(a);
|
|
31341
31359
|
else if (t === "PDI" && i.length) {
|
|
31342
31360
|
let e = i.pop();
|
|
31343
31361
|
n[e] = a, r[a] = e;
|
|
@@ -31348,7 +31366,7 @@ function Yo(e) {
|
|
|
31348
31366
|
initOf: r
|
|
31349
31367
|
};
|
|
31350
31368
|
}
|
|
31351
|
-
function
|
|
31369
|
+
function Zo(e, t, n) {
|
|
31352
31370
|
let r = e.length, i = Array(r).fill(t), a = e.slice(), o = [{
|
|
31353
31371
|
level: t,
|
|
31354
31372
|
override: "neutral",
|
|
@@ -31362,7 +31380,7 @@ function Xo(e, t, n) {
|
|
|
31362
31380
|
case "RLO":
|
|
31363
31381
|
case "LRO": {
|
|
31364
31382
|
i[d] = u().level;
|
|
31365
|
-
let e = r === "RLE" || r === "RLO" ?
|
|
31383
|
+
let e = r === "RLE" || r === "RLO" ? qo(u().level) : Jo(u().level);
|
|
31366
31384
|
e <= 125 && s === 0 && c === 0 ? o.push({
|
|
31367
31385
|
level: e,
|
|
31368
31386
|
override: r === "RLO" ? "R" : r === "LRO" ? "L" : "neutral",
|
|
@@ -31377,8 +31395,8 @@ function Xo(e, t, n) {
|
|
|
31377
31395
|
let t = u().override;
|
|
31378
31396
|
t !== "neutral" && (a[d] = t);
|
|
31379
31397
|
let f;
|
|
31380
|
-
f = r === "RLI" ? "R" : r === "LRI" ? "L" :
|
|
31381
|
-
let p = f === "R" ?
|
|
31398
|
+
f = r === "RLI" ? "R" : r === "LRI" ? "L" : Yo(e, d + 1, n[d]) === 1 ? "R" : "L";
|
|
31399
|
+
let p = f === "R" ? qo(u().level) : Jo(u().level);
|
|
31382
31400
|
p <= 125 && s === 0 && c === 0 ? (l++, o.push({
|
|
31383
31401
|
level: p,
|
|
31384
31402
|
override: "neutral",
|
|
@@ -31420,10 +31438,10 @@ function Xo(e, t, n) {
|
|
|
31420
31438
|
types: a
|
|
31421
31439
|
};
|
|
31422
31440
|
}
|
|
31423
|
-
function
|
|
31441
|
+
function Qo(e) {
|
|
31424
31442
|
return e === 9001 ? 12296 : e === 9002 ? 12297 : e;
|
|
31425
31443
|
}
|
|
31426
|
-
function
|
|
31444
|
+
function $o(e, t, n, r, i, a) {
|
|
31427
31445
|
let o = e.length, s = [];
|
|
31428
31446
|
for (let e = 0; e < o; e++) n[e] || s.push(e);
|
|
31429
31447
|
let c = [];
|
|
@@ -31441,7 +31459,7 @@ function Qo(e, t, n, r, i, a) {
|
|
|
31441
31459
|
for (;;) {
|
|
31442
31460
|
for (let e of p) f.push(e);
|
|
31443
31461
|
let t = p[p.length - 1];
|
|
31444
|
-
if (
|
|
31462
|
+
if (Go(e[t]) && i[t] !== o) {
|
|
31445
31463
|
let e = l.get(i[t]);
|
|
31446
31464
|
if (e) {
|
|
31447
31465
|
p = e;
|
|
@@ -31456,7 +31474,7 @@ function Qo(e, t, n, r, i, a) {
|
|
|
31456
31474
|
break;
|
|
31457
31475
|
}
|
|
31458
31476
|
let g = u(Math.max(m, h)), _ = f[f.length - 1], v = r;
|
|
31459
|
-
if (!(
|
|
31477
|
+
if (!(Go(e[_]) && i[_] === o)) {
|
|
31460
31478
|
for (let e = _ + 1; e < o; e++) if (!n[e]) {
|
|
31461
31479
|
v = t[e];
|
|
31462
31480
|
break;
|
|
@@ -31472,8 +31490,8 @@ function Qo(e, t, n, r, i, a) {
|
|
|
31472
31490
|
}
|
|
31473
31491
|
return d;
|
|
31474
31492
|
}
|
|
31475
|
-
var
|
|
31476
|
-
function
|
|
31493
|
+
var es = (e) => e === "L" ? "L" : e === "R" || e === "EN" || e === "AN" ? "R" : null;
|
|
31494
|
+
function ts(e, t, n, r, i) {
|
|
31477
31495
|
let a = e.indices, o = a.length, { sos: s, eos: c, level: l } = e;
|
|
31478
31496
|
for (let e = 0; e < o; e++) {
|
|
31479
31497
|
let t = a[e];
|
|
@@ -31520,15 +31538,15 @@ function es(e, t, n, r, i) {
|
|
|
31520
31538
|
outer: for (let n = 0; n < o; n++) {
|
|
31521
31539
|
let i = a[n];
|
|
31522
31540
|
if (r[i] !== "ON") continue;
|
|
31523
|
-
let o =
|
|
31541
|
+
let o = Uo(t[i]);
|
|
31524
31542
|
if (o) if (o.type === "o") {
|
|
31525
31543
|
if (e.length === 63) break outer;
|
|
31526
31544
|
e.push({
|
|
31527
|
-
expect:
|
|
31545
|
+
expect: Qo(o.pair),
|
|
31528
31546
|
pos: n
|
|
31529
31547
|
});
|
|
31530
31548
|
} else {
|
|
31531
|
-
let r =
|
|
31549
|
+
let r = Qo(t[i]);
|
|
31532
31550
|
for (let t = e.length - 1; t >= 0; t--) if (e[t].expect === r) {
|
|
31533
31551
|
f.push({
|
|
31534
31552
|
open: e[t].pos,
|
|
@@ -31546,7 +31564,7 @@ function es(e, t, n, r, i) {
|
|
|
31546
31564
|
for (let { open: e, close: t } of f) {
|
|
31547
31565
|
let n = !1, i = !1;
|
|
31548
31566
|
for (let o = e + 1; o < t; o++) {
|
|
31549
|
-
let e =
|
|
31567
|
+
let e = es(r[a[o]]);
|
|
31550
31568
|
e === u ? n = !0 : e === d && (i = !0);
|
|
31551
31569
|
}
|
|
31552
31570
|
let o = null;
|
|
@@ -31554,7 +31572,7 @@ function es(e, t, n, r, i) {
|
|
|
31554
31572
|
else if (i) {
|
|
31555
31573
|
let t = s;
|
|
31556
31574
|
for (let n = e - 1; n >= 0; n--) {
|
|
31557
|
-
let e =
|
|
31575
|
+
let e = es(r[a[n]]);
|
|
31558
31576
|
if (e) {
|
|
31559
31577
|
t = e;
|
|
31560
31578
|
break;
|
|
@@ -31565,29 +31583,29 @@ function es(e, t, n, r, i) {
|
|
|
31565
31583
|
o && (r[a[e]] = o, r[a[t]] = o, p(e, o), p(t, o));
|
|
31566
31584
|
}
|
|
31567
31585
|
for (let e = 0; e < o; e++) {
|
|
31568
|
-
if (!
|
|
31586
|
+
if (!Ko(r[a[e]])) continue;
|
|
31569
31587
|
let t = e;
|
|
31570
|
-
for (; t < o &&
|
|
31571
|
-
let n = e > 0 ?
|
|
31588
|
+
for (; t < o && Ko(r[a[t]]);) t++;
|
|
31589
|
+
let n = e > 0 ? es(r[a[e - 1]]) : s, i = t < o ? es(r[a[t]]) : c;
|
|
31572
31590
|
if (n && i && n === i) for (let i = e; i < t; i++) r[a[i]] = n;
|
|
31573
31591
|
e = t - 1;
|
|
31574
31592
|
}
|
|
31575
|
-
for (let e = 0; e < o; e++)
|
|
31593
|
+
for (let e = 0; e < o; e++) Ko(r[a[e]]) && (r[a[e]] = u);
|
|
31576
31594
|
for (let e = 0; e < o; e++) {
|
|
31577
31595
|
let t = a[e], n = r[t];
|
|
31578
31596
|
l & 1 ? (n === "L" || n === "EN" || n === "AN") && (i[t] += 1) : n === "R" ? i[t] += 1 : (n === "AN" || n === "EN") && (i[t] += 2);
|
|
31579
31597
|
}
|
|
31580
31598
|
}
|
|
31581
|
-
function
|
|
31599
|
+
function ns(e, t, n) {
|
|
31582
31600
|
let r = e.length, i = Array(r);
|
|
31583
|
-
for (let t = 0; t < r; t++) i[t] = n?.[t] ??
|
|
31584
|
-
let a = t === "rtl" ? 1 : t === "ltr" ? 0 :
|
|
31585
|
-
for (let e = 0; e < r; e++) u[e] =
|
|
31586
|
-
let d =
|
|
31587
|
-
for (let t of d)
|
|
31601
|
+
for (let t = 0; t < r; t++) i[t] = n?.[t] ?? zo(e[t]);
|
|
31602
|
+
let a = t === "rtl" ? 1 : t === "ltr" ? 0 : Yo(i, 0, r), { pdiOf: o, initOf: s } = Xo(i), { levels: c, types: l } = Zo(i, a, o), u = Array(r);
|
|
31603
|
+
for (let e = 0; e < r; e++) u[e] = Wo(i[e]);
|
|
31604
|
+
let d = $o(i, c, u, a, o, s), f = l.slice();
|
|
31605
|
+
for (let t of d) ts(t, e, i, f, c);
|
|
31588
31606
|
let p = (e) => {
|
|
31589
31607
|
let t = i[e];
|
|
31590
|
-
return t === "WS" ||
|
|
31608
|
+
return t === "WS" || Go(t) || t === "PDI" || u[e];
|
|
31591
31609
|
};
|
|
31592
31610
|
for (let e = 0; e < r; e++) {
|
|
31593
31611
|
let t = i[e];
|
|
@@ -31603,7 +31621,7 @@ function ts(e, t, n) {
|
|
|
31603
31621
|
paragraphLevel: a
|
|
31604
31622
|
};
|
|
31605
31623
|
}
|
|
31606
|
-
function
|
|
31624
|
+
function rs(e, t, n) {
|
|
31607
31625
|
let r = [];
|
|
31608
31626
|
for (let i = t; i < n; i++) {
|
|
31609
31627
|
let t = e[i];
|
|
@@ -31631,7 +31649,7 @@ function ns(e, t, n) {
|
|
|
31631
31649
|
}
|
|
31632
31650
|
//#endregion
|
|
31633
31651
|
//#region packages/core/src/text/bidi/uax9/index.ts
|
|
31634
|
-
function
|
|
31652
|
+
function is(e) {
|
|
31635
31653
|
let t = [], n = [], r = [];
|
|
31636
31654
|
for (let i = 0; i < e.length;) {
|
|
31637
31655
|
let a = e.codePointAt(i), o = a > 65535 ? 2 : 1;
|
|
@@ -31643,9 +31661,9 @@ function rs(e) {
|
|
|
31643
31661
|
starts: r
|
|
31644
31662
|
};
|
|
31645
31663
|
}
|
|
31646
|
-
var
|
|
31664
|
+
var as = class {
|
|
31647
31665
|
computeLevels(e, t, n) {
|
|
31648
|
-
let { cps: r, units: i, starts: a } =
|
|
31666
|
+
let { cps: r, units: i, starts: a } = is(e), { levels: o, paragraphLevel: s } = ns(r, t, n ? r.map((e, t) => n[a[t]] ?? null) : void 0), c = new Uint8Array(e.length), l = 0;
|
|
31649
31667
|
for (let e = 0; e < o.length; e++) {
|
|
31650
31668
|
let t = o[e] === -1 ? 255 : o[e];
|
|
31651
31669
|
for (let n = 0; n < i[e]; n++) c[l++] = t;
|
|
@@ -31656,63 +31674,63 @@ var is = class {
|
|
|
31656
31674
|
};
|
|
31657
31675
|
}
|
|
31658
31676
|
reorderVisual(e, t, n) {
|
|
31659
|
-
return
|
|
31677
|
+
return rs(e, t, n);
|
|
31660
31678
|
}
|
|
31661
31679
|
getMirror(e) {
|
|
31662
|
-
return
|
|
31680
|
+
return Vo(e);
|
|
31663
31681
|
}
|
|
31664
31682
|
};
|
|
31665
|
-
function
|
|
31666
|
-
return new
|
|
31683
|
+
function os() {
|
|
31684
|
+
return new as();
|
|
31667
31685
|
}
|
|
31668
31686
|
//#endregion
|
|
31669
31687
|
//#region packages/core/src/text/bidi/engine.ts
|
|
31670
|
-
var
|
|
31671
|
-
function
|
|
31672
|
-
return
|
|
31688
|
+
var ss = null;
|
|
31689
|
+
function cs() {
|
|
31690
|
+
return ss === null && (ss = os()), ss;
|
|
31673
31691
|
}
|
|
31674
31692
|
//#endregion
|
|
31675
31693
|
//#region packages/core/src/text/bidi/line-order.ts
|
|
31676
|
-
var
|
|
31677
|
-
function
|
|
31678
|
-
return
|
|
31694
|
+
var ls = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]|[\u{10800}-\u{10FFF}\u{1E800}-\u{1EFFF}]/u;
|
|
31695
|
+
function us(e) {
|
|
31696
|
+
return ls.test(e);
|
|
31679
31697
|
}
|
|
31680
|
-
function
|
|
31698
|
+
function ds(e, t, n) {
|
|
31681
31699
|
let r = n.length, i = new Uint8Array(r);
|
|
31682
31700
|
for (let a = 0; a < r; a++) {
|
|
31683
31701
|
let r = e[n[a]];
|
|
31684
31702
|
i[a] = r === 255 ? t : r;
|
|
31685
31703
|
}
|
|
31686
31704
|
return {
|
|
31687
|
-
order:
|
|
31705
|
+
order: cs().reorderVisual(i, 0, r),
|
|
31688
31706
|
segLevels: i
|
|
31689
31707
|
};
|
|
31690
31708
|
}
|
|
31691
31709
|
//#endregion
|
|
31692
31710
|
//#region packages/core/src/text/kinsoku/rules.ts
|
|
31693
|
-
var
|
|
31694
|
-
function
|
|
31711
|
+
var fs = "”’)〕]}〉》」』】〙〗〟⦆»、。,.・:;/?!‐ー゠–〜~ぁぃぅぇぉっゃゅょゎゕゖァィゥェォッャュョヮヵヶㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ゝゞヽヾ゛゜%‰℃°′″。」、・ー゙゚!),.:;?]}⦆", ps = "“‘(〔[{〈《「『【〘〖〝⦅«$¥#£¢([{⦅";
|
|
31712
|
+
function ms(e) {
|
|
31695
31713
|
let t = /* @__PURE__ */ new Set();
|
|
31696
31714
|
for (let n of e) t.add(n.codePointAt(0));
|
|
31697
31715
|
return t;
|
|
31698
31716
|
}
|
|
31699
|
-
function
|
|
31717
|
+
function hs(e) {
|
|
31700
31718
|
return {
|
|
31701
31719
|
enabled: e?.kinsoku !== !1,
|
|
31702
|
-
lineStartForbidden:
|
|
31703
|
-
lineEndForbidden:
|
|
31720
|
+
lineStartForbidden: ms(e?.noLineBreaksBefore ?? fs),
|
|
31721
|
+
lineEndForbidden: ms(e?.noLineBreaksAfter ?? ps)
|
|
31704
31722
|
};
|
|
31705
31723
|
}
|
|
31706
|
-
var
|
|
31724
|
+
var gs = hs();
|
|
31707
31725
|
//#endregion
|
|
31708
31726
|
//#region packages/core/src/text/kinsoku/split.ts
|
|
31709
|
-
function
|
|
31727
|
+
function _s(e, t, n, r = 1) {
|
|
31710
31728
|
if (!n.enabled || t <= 0 || t >= e.length) return t;
|
|
31711
31729
|
let i = (t) => t < e.length && n.lineStartForbidden.has(e[t].codePointAt(0)), a = (t) => t >= 0 && n.lineEndForbidden.has(e[t].codePointAt(0)), o = t;
|
|
31712
31730
|
for (; o > r && (i(o) || a(o - 1));) o--;
|
|
31713
31731
|
return o <= r && (i(o) || a(o - 1)) ? t : o;
|
|
31714
31732
|
}
|
|
31715
|
-
function
|
|
31733
|
+
function vs(e, t, n) {
|
|
31716
31734
|
if (!t.enabled) return 0;
|
|
31717
31735
|
let r = e.length - n;
|
|
31718
31736
|
for (let n = 1; n <= r; n++) {
|
|
@@ -31725,15 +31743,15 @@ function _s(e, t, n) {
|
|
|
31725
31743
|
}
|
|
31726
31744
|
//#endregion
|
|
31727
31745
|
//#region packages/core/src/text/cjk-ranges.ts
|
|
31728
|
-
function
|
|
31746
|
+
function ys(e) {
|
|
31729
31747
|
return e >= 12288 && e <= 40959 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65280 && e <= 65519;
|
|
31730
31748
|
}
|
|
31731
|
-
function
|
|
31732
|
-
return e === 32 || e === 9 || e === 10 || e === 13 ? !1 : !
|
|
31749
|
+
function bs(e) {
|
|
31750
|
+
return e === 32 || e === 9 || e === 10 || e === 13 ? !1 : !ys(e);
|
|
31733
31751
|
}
|
|
31734
31752
|
//#endregion
|
|
31735
31753
|
//#region packages/core/src/text/line-break-class.generated.ts
|
|
31736
|
-
var
|
|
31754
|
+
var xs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB.CL.CP.EB.EM.EX.H2.H3.HL.HH.HY.ID.IN.IS.JL.JT.JV.NS.NU.OP.PO.PR.QU.RI.SY.VF.VI".split("."), Ss = [
|
|
31737
31755
|
0,
|
|
31738
31756
|
9,
|
|
31739
31757
|
10,
|
|
@@ -34356,7 +34374,7 @@ var bs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
34356
34374
|
917632,
|
|
34357
34375
|
917760,
|
|
34358
34376
|
918e3
|
|
34359
|
-
],
|
|
34377
|
+
], Cs = [
|
|
34360
34378
|
1,
|
|
34361
34379
|
15,
|
|
34362
34380
|
4,
|
|
@@ -36979,7 +36997,7 @@ var bs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
36979
36997
|
11,
|
|
36980
36998
|
1,
|
|
36981
36999
|
11
|
|
36982
|
-
],
|
|
37000
|
+
], ws = [
|
|
36983
37001
|
4352,
|
|
36984
37002
|
8361,
|
|
36985
37003
|
8986,
|
|
@@ -37109,7 +37127,7 @@ var bs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
37109
37127
|
129775,
|
|
37110
37128
|
131072,
|
|
37111
37129
|
196608
|
|
37112
|
-
],
|
|
37130
|
+
], Ts = [
|
|
37113
37131
|
4448,
|
|
37114
37132
|
8362,
|
|
37115
37133
|
8988,
|
|
@@ -37242,68 +37260,68 @@ var bs = /* @__PURE__ */ "BK.CM.CR.GL.LF.NL.SP.WJ.ZW.ZWJ.AK.AL.AP.AS.B2.BA.BB.CB
|
|
|
37242
37260
|
];
|
|
37243
37261
|
//#endregion
|
|
37244
37262
|
//#region packages/core/src/text/line-break.ts
|
|
37245
|
-
function
|
|
37246
|
-
let t = 0, n =
|
|
37263
|
+
function Es(e) {
|
|
37264
|
+
let t = 0, n = Ss.length - 1;
|
|
37247
37265
|
for (; t < n;) {
|
|
37248
37266
|
let r = t + n + 1 >> 1;
|
|
37249
|
-
|
|
37267
|
+
Ss[r] <= e ? t = r : n = r - 1;
|
|
37250
37268
|
}
|
|
37251
|
-
return
|
|
37269
|
+
return xs[Cs[t]];
|
|
37252
37270
|
}
|
|
37253
|
-
function
|
|
37254
|
-
let t = 0, n =
|
|
37255
|
-
if (n < 0 || e <
|
|
37271
|
+
function Ds(e) {
|
|
37272
|
+
let t = 0, n = ws.length - 1;
|
|
37273
|
+
if (n < 0 || e < ws[0]) return !1;
|
|
37256
37274
|
for (; t < n;) {
|
|
37257
37275
|
let r = t + n + 1 >> 1;
|
|
37258
|
-
|
|
37276
|
+
ws[r] <= e ? t = r : n = r - 1;
|
|
37259
37277
|
}
|
|
37260
|
-
return e <
|
|
37278
|
+
return e < Ts[t];
|
|
37261
37279
|
}
|
|
37262
|
-
function
|
|
37263
|
-
let n =
|
|
37280
|
+
function Os(e, t) {
|
|
37281
|
+
let n = Es(e);
|
|
37264
37282
|
if (n === "OP") return !0;
|
|
37265
|
-
let r =
|
|
37266
|
-
return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !
|
|
37283
|
+
let r = Es(t), i = n === "AL" || n === "HL", a = r === "AL" || r === "HL";
|
|
37284
|
+
return !!(i && (a || r === "NU" || r === "PR" || r === "PO") || a && (n === "NU" || n === "PR" || n === "PO") || n === "PR" && (r === "ID" || r === "EB" || r === "EM") || (n === "ID" || n === "EB" || n === "EM") && r === "PO" || n === "NU" && (r === "NU" || r === "PO" || r === "PR") || r === "NU" && (n === "PO" || n === "PR" || n === "HY" || n === "IS") || (i || n === "NU") && r === "OP" && !Ds(t) || n === "CP" && !Ds(e) && (a || r === "NU"));
|
|
37267
37285
|
}
|
|
37268
37286
|
//#endregion
|
|
37269
37287
|
//#region packages/core/src/text/sea-break.ts
|
|
37270
|
-
function
|
|
37288
|
+
function ks(e) {
|
|
37271
37289
|
return e === "my" || e === "bo";
|
|
37272
37290
|
}
|
|
37273
|
-
function
|
|
37291
|
+
function As(e) {
|
|
37274
37292
|
return e >= 3584 && e <= 3711 || e >= 3712 && e <= 3839 || e >= 6016 && e <= 6143 || e >= 4096 && e <= 4255 || e >= 43616 && e <= 43647 || e >= 43488 && e <= 43519 || e >= 3840 && e <= 4095;
|
|
37275
37293
|
}
|
|
37276
|
-
function
|
|
37294
|
+
function js(e) {
|
|
37277
37295
|
return e === 3633 || e >= 3635 && e <= 3642 || e >= 3655 && e <= 3662 || e === 3761 || e >= 3763 && e <= 3772 || e >= 3784 && e <= 3790 || e >= 6068 && e <= 6099 || e === 6109;
|
|
37278
37296
|
}
|
|
37279
|
-
function
|
|
37297
|
+
function Ms(e) {
|
|
37280
37298
|
return e <= 3711 ? "th" : e <= 3839 ? "lo" : e <= 4095 ? "bo" : e <= 4255 ? "my" : e <= 6143 ? "km" : "my";
|
|
37281
37299
|
}
|
|
37282
|
-
function
|
|
37283
|
-
for (let t of e) if (
|
|
37300
|
+
function Ns(e) {
|
|
37301
|
+
for (let t of e) if (As(t.codePointAt(0))) return !0;
|
|
37284
37302
|
return !1;
|
|
37285
37303
|
}
|
|
37286
|
-
function
|
|
37304
|
+
function Ps(e) {
|
|
37287
37305
|
for (let t of e) {
|
|
37288
37306
|
let e = t.codePointAt(0);
|
|
37289
|
-
if (
|
|
37307
|
+
if (As(e)) return ks(Ms(e));
|
|
37290
37308
|
}
|
|
37291
37309
|
return !1;
|
|
37292
37310
|
}
|
|
37293
|
-
function
|
|
37311
|
+
function Fs(e) {
|
|
37294
37312
|
let t = !1;
|
|
37295
37313
|
for (let n of e) {
|
|
37296
37314
|
let e = n.codePointAt(0);
|
|
37297
|
-
if (
|
|
37298
|
-
if (
|
|
37315
|
+
if (As(e)) {
|
|
37316
|
+
if (ks(Ms(e))) return !1;
|
|
37299
37317
|
t = !0;
|
|
37300
37318
|
}
|
|
37301
37319
|
}
|
|
37302
37320
|
return t;
|
|
37303
37321
|
}
|
|
37304
|
-
var
|
|
37305
|
-
function
|
|
37306
|
-
let t =
|
|
37322
|
+
var Is, Ls = /* @__PURE__ */ new Map();
|
|
37323
|
+
function Rs(e) {
|
|
37324
|
+
let t = Ls.get(e);
|
|
37307
37325
|
if (t !== void 0) return t;
|
|
37308
37326
|
let n = null;
|
|
37309
37327
|
try {
|
|
@@ -37311,36 +37329,36 @@ function Ls(e) {
|
|
|
37311
37329
|
} catch {
|
|
37312
37330
|
n = null;
|
|
37313
37331
|
}
|
|
37314
|
-
return
|
|
37332
|
+
return Ls.set(e, n), n;
|
|
37315
37333
|
}
|
|
37316
|
-
function
|
|
37317
|
-
if (
|
|
37318
|
-
if (typeof
|
|
37319
|
-
let t =
|
|
37334
|
+
function zs(e) {
|
|
37335
|
+
if (Is === null) return null;
|
|
37336
|
+
if (typeof Is == "function") {
|
|
37337
|
+
let t = Is;
|
|
37320
37338
|
return (n) => t(n, e);
|
|
37321
37339
|
}
|
|
37322
|
-
let t =
|
|
37340
|
+
let t = Rs(e);
|
|
37323
37341
|
return t ? (e) => t.segment(e) : null;
|
|
37324
37342
|
}
|
|
37325
|
-
function
|
|
37326
|
-
if (!
|
|
37343
|
+
function Bs(e) {
|
|
37344
|
+
if (!Ns(e)) return [];
|
|
37327
37345
|
let t = [], n = e.length, r = 0;
|
|
37328
37346
|
for (; r < n;) {
|
|
37329
37347
|
let i = e.codePointAt(r), a = i > 65535 ? 2 : 1;
|
|
37330
|
-
if (!
|
|
37348
|
+
if (!As(i)) {
|
|
37331
37349
|
r += a;
|
|
37332
37350
|
continue;
|
|
37333
37351
|
}
|
|
37334
|
-
let o =
|
|
37352
|
+
let o = Ms(i), s = ks(o), c = r + a;
|
|
37335
37353
|
for (; c < n;) {
|
|
37336
37354
|
let t = e.codePointAt(c);
|
|
37337
|
-
if (!
|
|
37355
|
+
if (!As(t) || ks(Ms(t)) !== s) break;
|
|
37338
37356
|
c += t > 65535 ? 2 : 1;
|
|
37339
37357
|
}
|
|
37340
37358
|
let l = e.slice(r, c);
|
|
37341
|
-
if (s) for (let e of
|
|
37359
|
+
if (s) for (let e of Js(l)) t.push(r + e);
|
|
37342
37360
|
else {
|
|
37343
|
-
let e =
|
|
37361
|
+
let e = zs(o);
|
|
37344
37362
|
if (e) {
|
|
37345
37363
|
let n = [];
|
|
37346
37364
|
try {
|
|
@@ -37353,42 +37371,42 @@ function zs(e) {
|
|
|
37353
37371
|
}
|
|
37354
37372
|
return t;
|
|
37355
37373
|
}
|
|
37356
|
-
function
|
|
37357
|
-
if (!
|
|
37374
|
+
function Vs(e) {
|
|
37375
|
+
if (!Ns(e)) return [];
|
|
37358
37376
|
let t = [], n = e.length, r = e.codePointAt(0), i = r > 65535 ? 2 : 1;
|
|
37359
37377
|
for (; i < n;) {
|
|
37360
37378
|
let n = e.codePointAt(i), a = n > 65535 ? 2 : 1;
|
|
37361
|
-
|
|
37379
|
+
As(r) !== As(n) && !Hs(r) && !Hs(n) && t.push(i), r = n, i += a;
|
|
37362
37380
|
}
|
|
37363
37381
|
return t;
|
|
37364
37382
|
}
|
|
37365
|
-
function
|
|
37383
|
+
function Hs(e) {
|
|
37366
37384
|
return e === 32 || e === 9 || e === 10 || e === 13 || e === 12288 || e === 160 || e === 8199 || e === 8239 || e === 8288 || e === 65279;
|
|
37367
37385
|
}
|
|
37368
|
-
function
|
|
37369
|
-
if (!
|
|
37370
|
-
let n = e.length, r = new Set(
|
|
37386
|
+
function Us(e, t) {
|
|
37387
|
+
if (!Ns(e)) return [];
|
|
37388
|
+
let n = e.length, r = new Set(Bs(e)), i = new Set(Js(e)), a = (e) => {
|
|
37371
37389
|
i.has(e) && r.add(e);
|
|
37372
37390
|
};
|
|
37373
|
-
for (let t of
|
|
37391
|
+
for (let t of Vs(e)) a(t);
|
|
37374
37392
|
if (t?.cjk) {
|
|
37375
37393
|
let t = e.codePointAt(0), r = t > 65535 ? 2 : 1;
|
|
37376
37394
|
for (; r < n;) {
|
|
37377
37395
|
let n = e.codePointAt(r);
|
|
37378
|
-
(
|
|
37396
|
+
(ys(n) || ys(t)) && a(r), t = n, r += n > 65535 ? 2 : 1;
|
|
37379
37397
|
}
|
|
37380
37398
|
}
|
|
37381
37399
|
let o = t?.kinsoku, s = o != null && o.enabled !== !1, c = [];
|
|
37382
37400
|
for (let t of r) if (!(t <= 0 || t >= n)) {
|
|
37383
37401
|
if (s) {
|
|
37384
|
-
let n = e.codePointAt(t), r =
|
|
37402
|
+
let n = e.codePointAt(t), r = Ws(e, t);
|
|
37385
37403
|
if (r !== void 0 && o.lineEndForbidden.has(r) || o.lineStartForbidden.has(n)) continue;
|
|
37386
37404
|
}
|
|
37387
37405
|
c.push(t);
|
|
37388
37406
|
}
|
|
37389
37407
|
return c.sort((e, t) => e - t), c;
|
|
37390
37408
|
}
|
|
37391
|
-
function
|
|
37409
|
+
function Ws(e, t) {
|
|
37392
37410
|
if (t <= 0) return;
|
|
37393
37411
|
let n = e.charCodeAt(t - 1);
|
|
37394
37412
|
if (n >= 56320 && n <= 57343 && t >= 2) {
|
|
@@ -37397,7 +37415,7 @@ function Us(e, t) {
|
|
|
37397
37415
|
}
|
|
37398
37416
|
return n;
|
|
37399
37417
|
}
|
|
37400
|
-
function
|
|
37418
|
+
function Gs(e, t, n, r, i, a = !1) {
|
|
37401
37419
|
let o = e.length;
|
|
37402
37420
|
if (n >= o) return n;
|
|
37403
37421
|
if (a) {
|
|
@@ -37413,19 +37431,19 @@ function Ws(e, t, n, r, i, a = !1) {
|
|
|
37413
37431
|
for (let a of t) a <= n || a >= o || i(e.slice(n, a)) <= r && (s = a);
|
|
37414
37432
|
return i(e.slice(n, o)) <= r && (s = o), s;
|
|
37415
37433
|
}
|
|
37416
|
-
var
|
|
37417
|
-
function
|
|
37418
|
-
if (
|
|
37434
|
+
var Ks;
|
|
37435
|
+
function qs() {
|
|
37436
|
+
if (Ks !== void 0) return Ks;
|
|
37419
37437
|
let e = null;
|
|
37420
37438
|
try {
|
|
37421
37439
|
typeof Intl < "u" && typeof Intl.Segmenter == "function" && (e = new Intl.Segmenter(void 0, { granularity: "grapheme" }));
|
|
37422
37440
|
} catch {
|
|
37423
37441
|
e = null;
|
|
37424
37442
|
}
|
|
37425
|
-
return
|
|
37443
|
+
return Ks = e, e;
|
|
37426
37444
|
}
|
|
37427
|
-
function
|
|
37428
|
-
let t =
|
|
37445
|
+
function Js(e) {
|
|
37446
|
+
let t = qs();
|
|
37429
37447
|
if (t) try {
|
|
37430
37448
|
let n = [];
|
|
37431
37449
|
for (let r of t.segment(e)) r.index > 0 && n.push(r.index);
|
|
@@ -37440,12 +37458,12 @@ function qs(e) {
|
|
|
37440
37458
|
}
|
|
37441
37459
|
//#endregion
|
|
37442
37460
|
//#region packages/core/src/text/vertical-orientation.generated.ts
|
|
37443
|
-
var
|
|
37461
|
+
var Ys = [
|
|
37444
37462
|
"U",
|
|
37445
37463
|
"R",
|
|
37446
37464
|
"Tu",
|
|
37447
37465
|
"Tr"
|
|
37448
|
-
],
|
|
37466
|
+
], Xs = [
|
|
37449
37467
|
0,
|
|
37450
37468
|
167,
|
|
37451
37469
|
168,
|
|
@@ -37726,7 +37744,7 @@ var Js = [
|
|
|
37726
37744
|
1048574,
|
|
37727
37745
|
1048576,
|
|
37728
37746
|
1114110
|
|
37729
|
-
],
|
|
37747
|
+
], Zs = [
|
|
37730
37748
|
1,
|
|
37731
37749
|
0,
|
|
37732
37750
|
1,
|
|
@@ -38010,29 +38028,29 @@ var Js = [
|
|
|
38010
38028
|
];
|
|
38011
38029
|
//#endregion
|
|
38012
38030
|
//#region packages/core/src/text/vertical-orientation.ts
|
|
38013
|
-
function
|
|
38014
|
-
let t = 0, n =
|
|
38031
|
+
function Qs(e) {
|
|
38032
|
+
let t = 0, n = Xs.length - 1;
|
|
38015
38033
|
for (; t < n;) {
|
|
38016
38034
|
let r = t + n + 1 >> 1;
|
|
38017
|
-
|
|
38035
|
+
Xs[r] <= e ? t = r : n = r - 1;
|
|
38018
38036
|
}
|
|
38019
|
-
return
|
|
38020
|
-
}
|
|
38021
|
-
function Qs(e) {
|
|
38022
|
-
return Js[Zs(e)];
|
|
38037
|
+
return Zs[t];
|
|
38023
38038
|
}
|
|
38024
38039
|
function $s(e) {
|
|
38025
|
-
return
|
|
38040
|
+
return Ys[Qs(e)];
|
|
38026
38041
|
}
|
|
38027
|
-
|
|
38042
|
+
function ec(e) {
|
|
38043
|
+
return tc.get(e) ?? null;
|
|
38044
|
+
}
|
|
38045
|
+
var tc = new Map([
|
|
38028
38046
|
[65292, 65040],
|
|
38029
38047
|
[12289, 65041],
|
|
38030
38048
|
[12290, 65042]
|
|
38031
38049
|
]);
|
|
38032
|
-
function
|
|
38033
|
-
return
|
|
38050
|
+
function nc(e) {
|
|
38051
|
+
return rc.get(e) ?? null;
|
|
38034
38052
|
}
|
|
38035
|
-
var
|
|
38053
|
+
var rc = new Map([
|
|
38036
38054
|
[65288, 65077],
|
|
38037
38055
|
[65289, 65078],
|
|
38038
38056
|
[65371, 65079],
|
|
@@ -38051,43 +38069,43 @@ var nc = new Map([
|
|
|
38051
38069
|
[12303, 65092],
|
|
38052
38070
|
[12310, 65047],
|
|
38053
38071
|
[12311, 65048]
|
|
38054
|
-
]),
|
|
38055
|
-
function
|
|
38056
|
-
return
|
|
38072
|
+
]), ic = new Set([65307]);
|
|
38073
|
+
function ac(e) {
|
|
38074
|
+
return ic.has(e);
|
|
38057
38075
|
}
|
|
38058
|
-
var
|
|
38076
|
+
var oc = new Set([
|
|
38059
38077
|
12540,
|
|
38060
38078
|
12316,
|
|
38061
38079
|
65374
|
|
38062
38080
|
]);
|
|
38063
|
-
function
|
|
38064
|
-
return
|
|
38081
|
+
function sc(e) {
|
|
38082
|
+
return oc.has(e);
|
|
38065
38083
|
}
|
|
38066
38084
|
//#endregion
|
|
38067
38085
|
//#region packages/core/src/text/vertical-vert-feature.ts
|
|
38068
|
-
var
|
|
38069
|
-
function
|
|
38086
|
+
var cc = 256, lc = 200, uc = /* @__PURE__ */ new WeakMap();
|
|
38087
|
+
function dc(e) {
|
|
38070
38088
|
return typeof HTMLCanvasElement > "u" ? null : e.canvas instanceof HTMLCanvasElement ? e.canvas : null;
|
|
38071
38089
|
}
|
|
38072
|
-
function
|
|
38090
|
+
function fc(e, t) {
|
|
38073
38091
|
return e.replace(/(^|\s)\d*\.?\d+(?:px|pt|pc|in|cm|mm|q|em|rem|%)(?:\/[^\s]+)?(?=\s)/i, `$1${t}`);
|
|
38074
38092
|
}
|
|
38075
|
-
function
|
|
38093
|
+
function pc(e, t = !0) {
|
|
38076
38094
|
let n = e.trim();
|
|
38077
38095
|
return [...n === "" || n.toLowerCase() === "normal" ? [] : n.split(",").map((e) => e.trim()).filter((e) => !/^(["'])vert\1(?:\s+(?:on|off|\d+))?$/i.test(e)), `"vert" ${+!!t}`].join(", ");
|
|
38078
38096
|
}
|
|
38079
|
-
function
|
|
38097
|
+
function mc(e) {
|
|
38080
38098
|
try {
|
|
38081
38099
|
let t = e.ownerDocument?.defaultView, n = t?.getComputedStyle ? t.getComputedStyle(e) : typeof getComputedStyle == "function" ? getComputedStyle(e) : null;
|
|
38082
38100
|
if (n?.fontFeatureSettings) return n.fontFeatureSettings;
|
|
38083
38101
|
} catch {}
|
|
38084
38102
|
return e.style.fontFeatureSettings;
|
|
38085
38103
|
}
|
|
38086
|
-
function
|
|
38087
|
-
let t =
|
|
38104
|
+
function hc(e) {
|
|
38105
|
+
let t = uc.get(e);
|
|
38088
38106
|
if (t) return t;
|
|
38089
38107
|
let n = e.createElement("canvas");
|
|
38090
|
-
n.width =
|
|
38108
|
+
n.width = cc, n.height = cc, n.setAttribute("aria-hidden", "true"), Object.assign(n.style, {
|
|
38091
38109
|
position: "fixed",
|
|
38092
38110
|
left: "-99999px",
|
|
38093
38111
|
top: "0",
|
|
@@ -38101,9 +38119,9 @@ function mc(e) {
|
|
|
38101
38119
|
}, i = () => {
|
|
38102
38120
|
r.epoch += 1, r.cache.clear();
|
|
38103
38121
|
};
|
|
38104
|
-
return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i),
|
|
38122
|
+
return e.fonts?.addEventListener?.("loadingdone", i), e.fonts?.addEventListener?.("loadingerror", i), uc.set(e, r), r;
|
|
38105
38123
|
}
|
|
38106
|
-
function
|
|
38124
|
+
function gc(e, t) {
|
|
38107
38125
|
let { width: n, height: r } = e.canvas, i = e.getImageData(0, 0, n, r).data, a = new Uint8ClampedArray(n * r), o = n, s = r, c = -1, l = -1, u = 0, d = 0, f = 0;
|
|
38108
38126
|
for (let e = 0; e < r; e += 1) for (let t = 0; t < n; t += 1) {
|
|
38109
38127
|
let r = i[(e * n + t) * 4 + 3];
|
|
@@ -38130,28 +38148,28 @@ function hc(e, t) {
|
|
|
38130
38148
|
]
|
|
38131
38149
|
};
|
|
38132
38150
|
}
|
|
38133
|
-
function
|
|
38151
|
+
function _c(e, t, n) {
|
|
38134
38152
|
let r = e.canvas;
|
|
38135
38153
|
r.style.fontFeatureSettings = n, e.font = e.font, e.clearRect(0, 0, r.width, r.height);
|
|
38136
38154
|
let i = String.fromCodePoint(t);
|
|
38137
|
-
return e.fillText(i, r.width / 2, r.height / 2),
|
|
38155
|
+
return e.fillText(i, r.width / 2, r.height / 2), gc(e, i);
|
|
38138
38156
|
}
|
|
38139
|
-
function
|
|
38157
|
+
function vc(e, t) {
|
|
38140
38158
|
let n = 0, r = Math.min(e.length, t.length);
|
|
38141
38159
|
for (let i = 0; i < r; i += 1) n += Math.abs(e[i] - t[i]);
|
|
38142
38160
|
return n;
|
|
38143
38161
|
}
|
|
38144
|
-
function
|
|
38162
|
+
function yc(e, t, n, r) {
|
|
38145
38163
|
let i = (e, t, n, r) => {
|
|
38146
|
-
let i = Math.max(
|
|
38147
|
-
return Math.min(
|
|
38164
|
+
let i = Math.max(vc(e, t), vc(n, r));
|
|
38165
|
+
return Math.min(vc(e, n), vc(e, r), vc(t, n), vc(t, r)) > i;
|
|
38148
38166
|
};
|
|
38149
38167
|
return i(e.alpha, t.alpha, n.alpha, r.alpha) || i(e.geometry, t.geometry, n.geometry, r.geometry) || i(e.metrics, t.metrics, n.metrics, r.metrics);
|
|
38150
38168
|
}
|
|
38151
|
-
function
|
|
38152
|
-
let n =
|
|
38169
|
+
function bc(e, t) {
|
|
38170
|
+
let n = dc(e);
|
|
38153
38171
|
if (n === null || typeof document > "u") return !1;
|
|
38154
|
-
let r = n.ownerDocument ?? document, i =
|
|
38172
|
+
let r = n.ownerDocument ?? document, i = hc(r), a = mc(n), o = `${i.epoch}:${fc(e.font, "<size>")}:${a}:${t}`, s = i.cache.get(o);
|
|
38155
38173
|
if (s !== void 0) return s;
|
|
38156
38174
|
let c = !1, l = r.body ?? r.documentElement;
|
|
38157
38175
|
if (!l) return !1;
|
|
@@ -38161,9 +38179,9 @@ function yc(e, t) {
|
|
|
38161
38179
|
if (d !== null) {
|
|
38162
38180
|
let n = i.canvas.style.fontFeatureSettings;
|
|
38163
38181
|
try {
|
|
38164
|
-
d.font =
|
|
38165
|
-
let n =
|
|
38166
|
-
c = i !== null && o !== null && s !== null && l !== null &&
|
|
38182
|
+
d.font = fc(e.font, `${lc}px`), d.fillStyle = "#000", d.textAlign = "center", d.textBaseline = "middle";
|
|
38183
|
+
let n = pc(a, !1), r = pc(a, !0), i = _c(d, t, n), o = _c(d, t, n), s = _c(d, t, r), l = _c(d, t, r);
|
|
38184
|
+
c = i !== null && o !== null && s !== null && l !== null && yc(i, o, s, l);
|
|
38167
38185
|
} catch {
|
|
38168
38186
|
c = !1;
|
|
38169
38187
|
} finally {
|
|
@@ -38172,19 +38190,19 @@ function yc(e, t) {
|
|
|
38172
38190
|
}
|
|
38173
38191
|
return i.cache.set(o, c), c;
|
|
38174
38192
|
}
|
|
38175
|
-
function
|
|
38193
|
+
function xc(e, t) {
|
|
38176
38194
|
let n = e.canvas, r = n?.style;
|
|
38177
38195
|
if (!r) return t();
|
|
38178
38196
|
let i = r.fontFeatureSettings;
|
|
38179
|
-
r.fontFeatureSettings =
|
|
38197
|
+
r.fontFeatureSettings = pc(mc(n)), e.font = e.font;
|
|
38180
38198
|
try {
|
|
38181
38199
|
return t();
|
|
38182
38200
|
} finally {
|
|
38183
38201
|
r.fontFeatureSettings = i, e.font = e.font;
|
|
38184
38202
|
}
|
|
38185
38203
|
}
|
|
38186
|
-
function
|
|
38187
|
-
return
|
|
38204
|
+
function Sc(e, t) {
|
|
38205
|
+
return xc(e, () => {
|
|
38188
38206
|
let n = e.textAlign, r = e.textBaseline;
|
|
38189
38207
|
e.textAlign = "center", e.textBaseline = "middle";
|
|
38190
38208
|
try {
|
|
@@ -38203,17 +38221,17 @@ function xc(e, t) {
|
|
|
38203
38221
|
}
|
|
38204
38222
|
//#endregion
|
|
38205
38223
|
//#region packages/core/src/interaction/zoom.ts
|
|
38206
|
-
var
|
|
38207
|
-
function
|
|
38208
|
-
return e * Math.exp(-t *
|
|
38224
|
+
var Cc = .01;
|
|
38225
|
+
function wc(e, t) {
|
|
38226
|
+
return e * Math.exp(-t * Cc);
|
|
38209
38227
|
}
|
|
38210
|
-
function
|
|
38228
|
+
function Tc(e, t, n, r, i) {
|
|
38211
38229
|
let a = n > 0 ? r / n : 1, o = (e + t) * a - t, s = i.maxScroll > 0 ? i.maxScroll : 0;
|
|
38212
38230
|
return o < 0 ? 0 : o > s ? s : o;
|
|
38213
38231
|
}
|
|
38214
38232
|
//#endregion
|
|
38215
38233
|
//#region packages/core/src/interaction/zoomable.ts
|
|
38216
|
-
var
|
|
38234
|
+
var Ec = Object.freeze([
|
|
38217
38235
|
.25,
|
|
38218
38236
|
.33,
|
|
38219
38237
|
.5,
|
|
@@ -38229,22 +38247,22 @@ var Tc = Object.freeze([
|
|
|
38229
38247
|
2.5,
|
|
38230
38248
|
3,
|
|
38231
38249
|
4
|
|
38232
|
-
]),
|
|
38233
|
-
function Dc(e) {
|
|
38234
|
-
for (let t of Tc) if (t > e + Ec) return t;
|
|
38235
|
-
return Tc[Tc.length - 1];
|
|
38236
|
-
}
|
|
38250
|
+
]), Dc = .005;
|
|
38237
38251
|
function Oc(e) {
|
|
38238
|
-
for (let t
|
|
38239
|
-
|
|
38240
|
-
|
|
38252
|
+
for (let t of Ec) if (t > e + Dc) return t;
|
|
38253
|
+
return Ec[Ec.length - 1];
|
|
38254
|
+
}
|
|
38255
|
+
function kc(e) {
|
|
38256
|
+
for (let t = Ec.length - 1; t >= 0; t--) {
|
|
38257
|
+
let n = Ec[t];
|
|
38258
|
+
if (n < e - Dc) return n;
|
|
38241
38259
|
}
|
|
38242
|
-
return
|
|
38260
|
+
return Ec[0];
|
|
38243
38261
|
}
|
|
38244
|
-
function
|
|
38262
|
+
function Ac(e, t, n) {
|
|
38245
38263
|
return e < t ? t : e > n ? n : e;
|
|
38246
38264
|
}
|
|
38247
|
-
function
|
|
38265
|
+
function jc(e, t) {
|
|
38248
38266
|
let { contentWidth: n, contentHeight: r, containerWidth: i, containerHeight: a } = e;
|
|
38249
38267
|
if (n <= 0 || i <= 0) return 0;
|
|
38250
38268
|
let o = i / n;
|
|
@@ -38255,13 +38273,13 @@ function Ac(e, t) {
|
|
|
38255
38273
|
}
|
|
38256
38274
|
//#endregion
|
|
38257
38275
|
//#region packages/core/src/interaction/hyperlink.ts
|
|
38258
|
-
var
|
|
38276
|
+
var Mc = [
|
|
38259
38277
|
"http",
|
|
38260
38278
|
"https",
|
|
38261
38279
|
"mailto",
|
|
38262
38280
|
"tel"
|
|
38263
38281
|
];
|
|
38264
|
-
function
|
|
38282
|
+
function Nc(e) {
|
|
38265
38283
|
let t = "";
|
|
38266
38284
|
for (let n of e) {
|
|
38267
38285
|
let e = n.codePointAt(0);
|
|
@@ -38270,18 +38288,18 @@ function Mc(e) {
|
|
|
38270
38288
|
let n = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(t);
|
|
38271
38289
|
return n ? n[1].toLowerCase() : null;
|
|
38272
38290
|
}
|
|
38273
|
-
function
|
|
38291
|
+
function Pc(e, t = Mc) {
|
|
38274
38292
|
if (e === "") return null;
|
|
38275
|
-
let n =
|
|
38293
|
+
let n = Nc(e);
|
|
38276
38294
|
return n === null || t.includes(n) ? e : null;
|
|
38277
38295
|
}
|
|
38278
|
-
function
|
|
38279
|
-
let r =
|
|
38296
|
+
function Fc(e, t = Mc, n = typeof window < "u" ? window : void 0) {
|
|
38297
|
+
let r = Pc(e, t);
|
|
38280
38298
|
return r === null || !n ? !1 : (n.open(r, "_blank", "noopener,noreferrer"), !0);
|
|
38281
38299
|
}
|
|
38282
38300
|
//#endregion
|
|
38283
38301
|
//#region packages/core/src/text/line-metrics.ts
|
|
38284
|
-
var
|
|
38302
|
+
var Ic = [
|
|
38285
38303
|
[(e) => e.includes("meiryo") || e.includes("メイリオ"), {
|
|
38286
38304
|
asc: 2210 / 2048,
|
|
38287
38305
|
desc: 1059 / 2048
|
|
@@ -38304,22 +38322,22 @@ var Fc = [
|
|
|
38304
38322
|
desc: 501 / 2048
|
|
38305
38323
|
}]
|
|
38306
38324
|
];
|
|
38307
|
-
function
|
|
38325
|
+
function Lc(e, t) {
|
|
38308
38326
|
if (!e) return null;
|
|
38309
38327
|
let n = e.toLowerCase();
|
|
38310
|
-
for (let [e, r] of
|
|
38328
|
+
for (let [e, r] of Ic) if (e(n) && (t || !r.eaOnly)) return r;
|
|
38311
38329
|
return null;
|
|
38312
38330
|
}
|
|
38313
|
-
function
|
|
38314
|
-
let n =
|
|
38331
|
+
function Rc(e, t = !1) {
|
|
38332
|
+
let n = Lc(e, t);
|
|
38315
38333
|
return n === null ? null : n.asc + n.desc;
|
|
38316
38334
|
}
|
|
38317
|
-
function
|
|
38318
|
-
let r =
|
|
38335
|
+
function zc(e, t, n = !1) {
|
|
38336
|
+
let r = Rc(e, n);
|
|
38319
38337
|
return r === null ? 0 : r * t;
|
|
38320
38338
|
}
|
|
38321
|
-
function
|
|
38322
|
-
let a =
|
|
38339
|
+
function Bc(e, t, n, r, i = !1) {
|
|
38340
|
+
let a = Lc(e, i);
|
|
38323
38341
|
if (a === null) return {
|
|
38324
38342
|
ascent: n,
|
|
38325
38343
|
descent: r
|
|
@@ -38335,7 +38353,7 @@ function zc(e, t, n, r, i = !1) {
|
|
|
38335
38353
|
}
|
|
38336
38354
|
//#endregion
|
|
38337
38355
|
//#region packages/core/src/search/text-index.ts
|
|
38338
|
-
function
|
|
38356
|
+
function Vc(e) {
|
|
38339
38357
|
let t = e.toLowerCase();
|
|
38340
38358
|
if (t.length === e.length) return t;
|
|
38341
38359
|
let n = "";
|
|
@@ -38345,17 +38363,17 @@ function Bc(e) {
|
|
|
38345
38363
|
}
|
|
38346
38364
|
return n;
|
|
38347
38365
|
}
|
|
38348
|
-
function
|
|
38366
|
+
function Hc(e) {
|
|
38349
38367
|
let t = Array(e.length), n = 0, r = "";
|
|
38350
38368
|
for (let i = 0; i < e.length; i++) t[i] = n, r += e[i].text, n += e[i].text.length;
|
|
38351
38369
|
return {
|
|
38352
38370
|
text: r,
|
|
38353
|
-
folded:
|
|
38371
|
+
folded: Vc(r),
|
|
38354
38372
|
runStart: t,
|
|
38355
38373
|
runCount: e.length
|
|
38356
38374
|
};
|
|
38357
38375
|
}
|
|
38358
|
-
function
|
|
38376
|
+
function Uc(e, t) {
|
|
38359
38377
|
let { runStart: n } = e, r = 0, i = n.length - 1;
|
|
38360
38378
|
for (; r < i;) {
|
|
38361
38379
|
let e = r + i + 1 >> 1;
|
|
@@ -38363,8 +38381,8 @@ function Hc(e, t) {
|
|
|
38363
38381
|
}
|
|
38364
38382
|
return r;
|
|
38365
38383
|
}
|
|
38366
|
-
function
|
|
38367
|
-
let { runStart: r, runCount: i, text: a } = e, o = [], s =
|
|
38384
|
+
function Wc(e, t, n) {
|
|
38385
|
+
let { runStart: r, runCount: i, text: a } = e, o = [], s = Uc(e, t), c = t;
|
|
38368
38386
|
for (; c < n && s < i;) {
|
|
38369
38387
|
let e = s + 1 < i ? r[s + 1] : a.length, t = Math.min(n, e), l = c - r[s], u = t - r[s];
|
|
38370
38388
|
u > l && o.push({
|
|
@@ -38375,26 +38393,26 @@ function Uc(e, t, n) {
|
|
|
38375
38393
|
}
|
|
38376
38394
|
return o;
|
|
38377
38395
|
}
|
|
38378
|
-
function
|
|
38396
|
+
function Gc(e, t, n = {}) {
|
|
38379
38397
|
if (t.length === 0) return [];
|
|
38380
|
-
let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t :
|
|
38398
|
+
let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t : Vc(t), o = [], s = 0, c = 0;
|
|
38381
38399
|
for (;;) {
|
|
38382
38400
|
let t = i.indexOf(a, s);
|
|
38383
38401
|
if (t === -1) break;
|
|
38384
38402
|
o.push({
|
|
38385
38403
|
matchIndex: c,
|
|
38386
|
-
slices:
|
|
38404
|
+
slices: Wc(e, t, t + a.length)
|
|
38387
38405
|
}), c++, s = t + a.length;
|
|
38388
38406
|
}
|
|
38389
38407
|
return o;
|
|
38390
38408
|
}
|
|
38391
38409
|
//#endregion
|
|
38392
38410
|
//#region packages/core/src/search/find-cursor.ts
|
|
38393
|
-
function
|
|
38411
|
+
function Kc(e, t) {
|
|
38394
38412
|
return t <= 0 ? -1 : e < 0 ? 0 : (e + 1) % t;
|
|
38395
38413
|
}
|
|
38396
|
-
function
|
|
38414
|
+
function qc(e, t) {
|
|
38397
38415
|
return t <= 0 ? -1 : e < 0 ? t - 1 : (e - 1 + t) % t;
|
|
38398
38416
|
}
|
|
38399
38417
|
//#endregion
|
|
38400
|
-
export {
|
|
38418
|
+
export { qa as $, As as A, pt as At, us as B, Pe as Bt, ac as C, Yt as Ct, Fs as D, St as Dt, Js as E, wt as Et, vs as F, Re as Ft, Eo as G, Ce as Gt, Mo as H, Ae as Ht, _s as I, Fe as It, eo as J, be as Jt, To as K, Se as Kt, gs as L, Ie as Lt, Os as M, ze as Mt, ys as N, Be as Nt, Ps as O, Ct as Ot, bs as P, He as Pt, Ka as Q, hs as R, Le as Rt, sc as S, Ht as St, Gs as T, It as Tt, Ao as U, je as Ut, cs as V, Oe as Vt, Do as W, Te as Wt, Ya as X, t as Xt, $a as Y, n as Yt, Xa as Z, bc as _, br as _t, Bc as a, Ha as at, ec as b, Xt as bt, Nc as c, Kr as ct, jc as d, zr as dt, Ga as et, Oc as f, Nr as ft, Sc as g, xr as gt, wc as h, Er as ht, Gc as i, Wa as it, Us as j, mt as jt, js as k, ft as kt, Fc as l, Gr as lt, Tc as m, Tr as mt, qc as n, Ba as nt, zc as o, Ua as ot, kc as p, Rr as pt, wo as q, ye as qt, Hc as r, Va as rt, Mc as s, $i as st, Kc as t, Ja as tt, Ac as u, Pr as ut, xc as v, nn as vt, Ns as w, Wt as wt, $s as x, $t as xt, nc as y, Qt as yt, ds as z, Ue as zt };
|