nhanh-pure-function 4.6.0 → 4.6.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/Format/index.d.ts +8 -0
- package/dist/Types/index.d.ts +0 -9
- package/dist/Utility/index.d.ts +1 -2
- package/dist/Utility/modules/colorConverter.d.ts +22 -6
- package/dist/index.cjs.js +3 -3
- package/dist/index.es.js +166 -154
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -262,7 +262,7 @@ const ri = {
|
|
|
262
262
|
"正",
|
|
263
263
|
"载",
|
|
264
264
|
"极"
|
|
265
|
-
], qs = ["_self", "_blank", "_parent", "_top"],
|
|
265
|
+
], qs = ["_self", "_blank", "_parent", "_top"], Ie = {
|
|
266
266
|
// 北美标准尺寸 (毫米)
|
|
267
267
|
Letter: { width: 215.9, height: 279.4 },
|
|
268
268
|
// 8.5 × 11 英寸
|
|
@@ -315,7 +315,7 @@ const ri = {
|
|
|
315
315
|
C6: { width: 114, height: 162 },
|
|
316
316
|
C7: { width: 81, height: 114 },
|
|
317
317
|
C8: { width: 57, height: 81 }
|
|
318
|
-
}, Ks = Object.keys(
|
|
318
|
+
}, Ks = Object.keys(Ie).map(
|
|
319
319
|
(r) => ({ value: r, label: r })
|
|
320
320
|
);
|
|
321
321
|
function Ut(r, i = 500) {
|
|
@@ -558,6 +558,9 @@ function cn(r, i) {
|
|
|
558
558
|
}
|
|
559
559
|
return t;
|
|
560
560
|
}
|
|
561
|
+
function hn(r, i, t = "...") {
|
|
562
|
+
return r.length > i ? r.slice(0, i) + t : r;
|
|
563
|
+
}
|
|
561
564
|
function xe(r, i = 2) {
|
|
562
565
|
if (Array.isArray(r) && r.length >= i) {
|
|
563
566
|
for (let e = 0; e < r.length; e++)
|
|
@@ -572,10 +575,10 @@ function Gt(r, i = 1, t = 2) {
|
|
|
572
575
|
} else return !1;
|
|
573
576
|
return !0;
|
|
574
577
|
}
|
|
575
|
-
function
|
|
578
|
+
function un(r, i, t) {
|
|
576
579
|
return Math.abs(r - i) <= t;
|
|
577
580
|
}
|
|
578
|
-
function
|
|
581
|
+
function dn(r, i) {
|
|
579
582
|
let t = !1;
|
|
580
583
|
const { x: e, y: s } = r, n = i.length;
|
|
581
584
|
for (let o = 0, a = n - 1; o < n; a = o++) {
|
|
@@ -584,7 +587,7 @@ function un(r, i) {
|
|
|
584
587
|
}
|
|
585
588
|
return t;
|
|
586
589
|
}
|
|
587
|
-
function
|
|
590
|
+
function fn(r, i, t, e) {
|
|
588
591
|
const s = Math.min(r[0], i[0]), n = Math.max(r[0], i[0]), o = Math.min(r[1], i[1]), a = Math.max(r[1], i[1]), l = [
|
|
589
592
|
[s, o],
|
|
590
593
|
// 左上
|
|
@@ -611,7 +614,7 @@ function dn(r, i, t, e) {
|
|
|
611
614
|
function re(r) {
|
|
612
615
|
return Object.prototype.toString.call(r).slice(8, -1).toLowerCase();
|
|
613
616
|
}
|
|
614
|
-
function
|
|
617
|
+
function mn(r) {
|
|
615
618
|
return [
|
|
616
619
|
"https:",
|
|
617
620
|
// HTTPS协议,用于安全地浏览网页
|
|
@@ -635,7 +638,7 @@ function fn(r) {
|
|
|
635
638
|
// VPN协议,用于创建安全的网络连接
|
|
636
639
|
].some((t) => r.startsWith(t));
|
|
637
640
|
}
|
|
638
|
-
function
|
|
641
|
+
function pn(r) {
|
|
639
642
|
return new Promise((i, t) => {
|
|
640
643
|
if (typeof r != "string" || r.trim() === "" || !r.includes("://")) {
|
|
641
644
|
t(new Error("Invalid URL: Must be a non-empty string"));
|
|
@@ -741,11 +744,11 @@ const ot = class ot {
|
|
|
741
744
|
// 缓存文件扩展名的条目,以提高性能
|
|
742
745
|
d(ot, "cachedEntries", Object.entries(te));
|
|
743
746
|
let _e = ot;
|
|
744
|
-
const li = /\w*(?:\[\d+\])+|\w+/g,
|
|
747
|
+
const li = /\w*(?:\[\d+\])+|\w+/g, Te = /^\w*(?:\[\d+\])+$/, Ne = /\w+|(\[\d+\])/g, He = /\[(\d+)\]/;
|
|
745
748
|
function Fe(r) {
|
|
746
749
|
return r ? r.match(li) || [] : [];
|
|
747
750
|
}
|
|
748
|
-
class
|
|
751
|
+
class gn {
|
|
749
752
|
constructor(i = {}) {
|
|
750
753
|
d(this, "stack", []);
|
|
751
754
|
d(this, "_index", 0);
|
|
@@ -1257,15 +1260,23 @@ class hi {
|
|
|
1257
1260
|
return this.parseColor(i);
|
|
1258
1261
|
}
|
|
1259
1262
|
/**
|
|
1260
|
-
*
|
|
1261
|
-
*
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1263
|
+
* 将颜色输入统一解析为 RGBA 对象。
|
|
1264
|
+
* 字符串走 parseColor,已是对象则直接返回。
|
|
1265
|
+
*/
|
|
1266
|
+
static resolveColorInput(i) {
|
|
1267
|
+
return typeof i == "string" ? this.parseColor(i) : i;
|
|
1268
|
+
}
|
|
1269
|
+
/**
|
|
1270
|
+
* 判断两个颜色是否在允许的色差范围内(基于 RGBA 欧几里得距离)。
|
|
1271
|
+
* 颜色参数支持任意颜色字符串或 { r, g, b, a } 对象。
|
|
1272
|
+
* @param colorA 第一个颜色(字符串或 RGBA 对象)
|
|
1273
|
+
* @param colorB 第二个颜色(字符串或 RGBA 对象)
|
|
1274
|
+
* @param threshold 允许的最大色差值,范围约 0(完全相同)到 510(含 alpha 最大距离)
|
|
1275
|
+
* @param includeAlpha 是否将 alpha 差值纳入计算,默认 true
|
|
1265
1276
|
* @returns true 表示在允许色差内
|
|
1266
1277
|
*/
|
|
1267
1278
|
static isWithinColorDifference(i, t, e, s = !0) {
|
|
1268
|
-
const n = this.
|
|
1279
|
+
const n = this.resolveColorInput(i), o = this.resolveColorInput(t), a = n.r - o.r, l = n.g - o.g, c = n.b - o.b;
|
|
1269
1280
|
let h = a * a + l * l + c * c;
|
|
1270
1281
|
if (s) {
|
|
1271
1282
|
const u = (n.a - o.a) * 255;
|
|
@@ -1327,7 +1338,7 @@ class hi {
|
|
|
1327
1338
|
}
|
|
1328
1339
|
}
|
|
1329
1340
|
d(hi, "DEFAULT_ALPHA", 1);
|
|
1330
|
-
function
|
|
1341
|
+
function vn(r, i = 3e3) {
|
|
1331
1342
|
if (typeof r != "function")
|
|
1332
1343
|
return console.error("非函数:", r);
|
|
1333
1344
|
const t = window.requestIdleCallback, e = function(s) {
|
|
@@ -1394,7 +1405,7 @@ function ze(r, i) {
|
|
|
1394
1405
|
}, i);
|
|
1395
1406
|
};
|
|
1396
1407
|
}
|
|
1397
|
-
function
|
|
1408
|
+
function yn(r, i) {
|
|
1398
1409
|
let t = -1 / 0;
|
|
1399
1410
|
return function(...e) {
|
|
1400
1411
|
const s = performance.now();
|
|
@@ -1408,12 +1419,12 @@ function vn(r, i) {
|
|
|
1408
1419
|
}
|
|
1409
1420
|
};
|
|
1410
1421
|
}
|
|
1411
|
-
function
|
|
1422
|
+
function wn(r, i) {
|
|
1412
1423
|
if (!r || !i) return r;
|
|
1413
1424
|
const t = Fe(i);
|
|
1414
1425
|
return t.length ? t.reduce((e, s, n) => {
|
|
1415
1426
|
const o = n === t.length - 1;
|
|
1416
|
-
if (
|
|
1427
|
+
if (Te.test(s)) {
|
|
1417
1428
|
const a = s.match(Ne) || [];
|
|
1418
1429
|
return a.reduce((l, c, h) => {
|
|
1419
1430
|
if (/^\w+$/.test(c))
|
|
@@ -1425,12 +1436,12 @@ function yn(r, i) {
|
|
|
1425
1436
|
return o ? e[s] : e[s] || {};
|
|
1426
1437
|
}, r) : r;
|
|
1427
1438
|
}
|
|
1428
|
-
function
|
|
1439
|
+
function xn(r, i, t, e) {
|
|
1429
1440
|
if (!r || !i) return t;
|
|
1430
1441
|
const s = Fe(i);
|
|
1431
1442
|
return s.length ? s.reduce((n, o, a) => {
|
|
1432
1443
|
const l = a === s.length - 1;
|
|
1433
|
-
if (
|
|
1444
|
+
if (Te.test(o)) {
|
|
1434
1445
|
const c = o.match(Ne) || [];
|
|
1435
1446
|
return c.reduce((h, u, f) => {
|
|
1436
1447
|
const m = f === c.length - 1;
|
|
@@ -1443,7 +1454,7 @@ function wn(r, i, t, e) {
|
|
|
1443
1454
|
return l ? ((!e || !n.hasOwnProperty(o)) && (n[o] = t), n[o]) : (n.hasOwnProperty(o) || (n[o] = {}), n[o]);
|
|
1444
1455
|
}, r) : t;
|
|
1445
1456
|
}
|
|
1446
|
-
function
|
|
1457
|
+
function bn(r) {
|
|
1447
1458
|
return r.map((i, t) => r.slice(t).concat(r.slice(0, t)));
|
|
1448
1459
|
}
|
|
1449
1460
|
function di(r) {
|
|
@@ -1569,7 +1580,7 @@ function fi(r, i) {
|
|
|
1569
1580
|
), f;
|
|
1570
1581
|
};
|
|
1571
1582
|
}
|
|
1572
|
-
function
|
|
1583
|
+
function Pn(r) {
|
|
1573
1584
|
const i = Date.now();
|
|
1574
1585
|
let t = performance.now();
|
|
1575
1586
|
for (; Date.now() - i < r; ) {
|
|
@@ -1583,7 +1594,7 @@ function bn(r) {
|
|
|
1583
1594
|
return Date.now() - i;
|
|
1584
1595
|
}
|
|
1585
1596
|
var wt = /* @__PURE__ */ ((r) => (r.RESPONSE = "response", r.QUERY = "query", r))(wt || {});
|
|
1586
|
-
class
|
|
1597
|
+
class Cn {
|
|
1587
1598
|
constructor(i, t) {
|
|
1588
1599
|
/** 音效资源地址映射(preload 成功后对应项会替换为 blob: URL) */
|
|
1589
1600
|
d(this, "soundSources");
|
|
@@ -1677,7 +1688,7 @@ function Me(r, i) {
|
|
|
1677
1688
|
for (const t of Object.keys(i))
|
|
1678
1689
|
i[t] !== void 0 && (r[t] = i[t]);
|
|
1679
1690
|
}
|
|
1680
|
-
class
|
|
1691
|
+
class Sn {
|
|
1681
1692
|
constructor(i) {
|
|
1682
1693
|
/** WebSocket地址 */
|
|
1683
1694
|
d(this, "url");
|
|
@@ -1769,7 +1780,7 @@ class Cn {
|
|
|
1769
1780
|
(i = this.socket) == null || i.close(), this.socket = void 0;
|
|
1770
1781
|
}
|
|
1771
1782
|
}
|
|
1772
|
-
function
|
|
1783
|
+
function _n(r, i = 10) {
|
|
1773
1784
|
let t = 0, e = i;
|
|
1774
1785
|
function s() {
|
|
1775
1786
|
if (e > 0)
|
|
@@ -1783,7 +1794,7 @@ function Sn(r, i = 10) {
|
|
|
1783
1794
|
t = Date.now(), s();
|
|
1784
1795
|
});
|
|
1785
1796
|
}
|
|
1786
|
-
function
|
|
1797
|
+
function En(r) {
|
|
1787
1798
|
const i = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
|
|
1788
1799
|
function e() {
|
|
1789
1800
|
return navigator.clipboard.writeText(r).then(i).catch(t);
|
|
@@ -1810,8 +1821,8 @@ function _n(r) {
|
|
|
1810
1821
|
}
|
|
1811
1822
|
return navigator.clipboard ? e().catch(o) : o();
|
|
1812
1823
|
}
|
|
1813
|
-
function
|
|
1814
|
-
const t =
|
|
1824
|
+
function Mn(r, i) {
|
|
1825
|
+
const t = Ie[r];
|
|
1815
1826
|
if (!t) return console.error(`未知纸张类型: ${r}`);
|
|
1816
1827
|
const { width: e, height: s } = t, n = (g) => g / 25.4, a = typeof window < "u" ? window.devicePixelRatio * 96 : 300, l = (g) => Math.round(n(g) * a), c = l(e), h = l(s), u = l(i), f = Math.max(0, c - 2 * u), m = Math.max(0, h - 2 * u);
|
|
1817
1828
|
return {
|
|
@@ -1923,7 +1934,7 @@ d(Ht, "timeout", 150), /**
|
|
|
1923
1934
|
* @param callback 匹配标签页的回调函数
|
|
1924
1935
|
*/
|
|
1925
1936
|
d(Ht, "pendingQueries", /* @__PURE__ */ new Map());
|
|
1926
|
-
class
|
|
1937
|
+
class Dn {
|
|
1927
1938
|
constructor() {
|
|
1928
1939
|
/** 用户状态:active(活跃) / idle(闲置) */
|
|
1929
1940
|
d(this, "status", "active");
|
|
@@ -2030,7 +2041,7 @@ var ae = 9e15, ut = 1e9, le = "0123456789abcdef", Xt = "2.3025850929940456840179
|
|
|
2030
2041
|
// Whether to use cryptographically-secure random number generation, if available.
|
|
2031
2042
|
crypto: !1
|
|
2032
2043
|
// true/false
|
|
2033
|
-
}, Be, st, _ = !0, Kt = "[DecimalError] ", ht = Kt + "Invalid argument: ", Ue = Kt + "Precision limit exceeded", Ge = Kt + "crypto unavailable", Xe = "[object Decimal]", F = Math.floor,
|
|
2044
|
+
}, Be, st, _ = !0, Kt = "[DecimalError] ", ht = Kt + "Invalid argument: ", Ue = Kt + "Precision limit exceeded", Ge = Kt + "crypto unavailable", Xe = "[object Decimal]", F = Math.floor, T = Math.pow, mi = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, pi = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, gi = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Ye = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Z = 1e7, S = 7, vi = 9007199254740991, yi = Xt.length - 1, he = Yt.length - 1, v = { toStringTag: Xe };
|
|
2034
2045
|
v.absoluteValue = v.abs = function() {
|
|
2035
2046
|
var r = new this.constructor(this);
|
|
2036
2047
|
return r.s < 0 && (r.s = 1), C(r);
|
|
@@ -2062,7 +2073,7 @@ v.cosine = v.cos = function() {
|
|
|
2062
2073
|
v.cubeRoot = v.cbrt = function() {
|
|
2063
2074
|
var r, i, t, e, s, n, o, a, l, c, h = this, u = h.constructor;
|
|
2064
2075
|
if (!h.isFinite() || h.isZero()) return new u(h);
|
|
2065
|
-
for (_ = !1, n = h.s *
|
|
2076
|
+
for (_ = !1, n = h.s * T(h.s * h, 1 / 3), !n || Math.abs(n) == 1 / 0 ? (t = N(h.d), r = h.e, (n = (r - t.length + 1) % 3) && (t += n == 1 || n == -2 ? "0" : "00"), n = T(t, 1 / 3), r = F((r + 1) / 3) - (r % 3 == (r < 0 ? -1 : 2)), n == 1 / 0 ? t = "5e" + r : (t = n.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + r), e = new u(t), e.s = h.s) : e = new u(n.toString()), o = (r = u.precision) + 3; ; )
|
|
2066
2077
|
if (a = e, l = a.times(a).times(a), c = l.plus(h), e = A(c.plus(h).times(a), c.plus(l), o + 2, 1), N(a.d).slice(0, o) === (t = N(e.d)).slice(0, o))
|
|
2067
2078
|
if (t = t.slice(o - 3, o + 1), t == "9999" || !s && t == "4999") {
|
|
2068
2079
|
if (!s && (C(a, r + 1, 0), a.times(a).times(a).eq(h))) {
|
|
@@ -2348,7 +2359,7 @@ v.toFixed = function(r, i) {
|
|
|
2348
2359
|
v.toFraction = function(r) {
|
|
2349
2360
|
var i, t, e, s, n, o, a, l, c, h, u, f, m = this, g = m.d, p = m.constructor;
|
|
2350
2361
|
if (!g) return new p(m);
|
|
2351
|
-
if (c = t = new p(1), e = l = new p(0), i = new p(e), n = i.e = $e(g) - m.e - 1, o = n % S, i.d[0] =
|
|
2362
|
+
if (c = t = new p(1), e = l = new p(0), i = new p(e), n = i.e = $e(g) - m.e - 1, o = n % S, i.d[0] = T(10, o < 0 ? S + o : o), r == null)
|
|
2352
2363
|
r = n > 0 ? i : c;
|
|
2353
2364
|
else {
|
|
2354
2365
|
if (a = new p(r), !a.isInt() || a.lt(c)) throw Error(ht + a);
|
|
@@ -2381,7 +2392,7 @@ v.toOctal = function(r, i) {
|
|
|
2381
2392
|
};
|
|
2382
2393
|
v.toPower = v.pow = function(r) {
|
|
2383
2394
|
var i, t, e, s, n, o, a = this, l = a.constructor, c = +(r = new l(r));
|
|
2384
|
-
if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(
|
|
2395
|
+
if (!a.d || !r.d || !a.d[0] || !r.d[0]) return new l(T(+a, c));
|
|
2385
2396
|
if (a = new l(a), a.eq(1)) return a;
|
|
2386
2397
|
if (e = l.precision, n = l.rounding, r.eq(1)) return C(a, e, n);
|
|
2387
2398
|
if (i = F(r.e / S), i >= r.d.length - 1 && (t = c < 0 ? -c : c) <= vi)
|
|
@@ -2391,7 +2402,7 @@ v.toPower = v.pow = function(r) {
|
|
|
2391
2402
|
if (r.d[i] & 1 || (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
2392
2403
|
return a.s = o, a;
|
|
2393
2404
|
}
|
|
2394
|
-
return t =
|
|
2405
|
+
return t = T(+a, c), i = t == 0 || !isFinite(t) ? F(c * (Math.log("0." + N(a.d)) / Math.LN10 + a.e + 1)) : new l(t + "").e, i > l.maxE + 1 || i < l.minE - 1 ? new l(i > 0 ? o / 0 : 0) : (_ = !1, l.rounding = a.s = 1, t = Math.min(12, (i + "").length), s = ue(r.times(lt(a, e + t)), e), s.d && (s = C(s, e + 5, 1), At(s.d, e, n) && (i = e + 10, s = C(ue(r.times(lt(a, i + t)), i), i + 5, 1), +N(s.d).slice(e + 1, e + 15) + 1 == 1e14 && (s = C(s, e + 1, 0)))), s.s = o, _ = !0, l.rounding = n, C(s, e, n));
|
|
2395
2406
|
};
|
|
2396
2407
|
v.toPrecision = function(r, i) {
|
|
2397
2408
|
var t, e = this, s = e.constructor;
|
|
@@ -2430,7 +2441,7 @@ function U(r, i, t) {
|
|
|
2430
2441
|
function At(r, i, t, e) {
|
|
2431
2442
|
var s, n, o, a;
|
|
2432
2443
|
for (n = r[0]; n >= 10; n /= 10) --i;
|
|
2433
|
-
return --i < 0 ? (i += S, s = 0) : (s = Math.ceil((i + 1) / S), i %= S), n =
|
|
2444
|
+
return --i < 0 ? (i += S, s = 0) : (s = Math.ceil((i + 1) / S), i %= S), n = T(10, S - i), a = r[s] % n | 0, e == null ? i < 3 ? (i == 0 ? a = a / 100 | 0 : i == 1 && (a = a / 10 | 0), o = t < 4 && a == 99999 || t > 3 && a == 49999 || a == 5e4 || a == 0) : o = (t < 4 && a + 1 == n || t > 3 && a + 1 == n / 2) && (r[s + 1] / n / 100 | 0) == T(10, i - 2) - 1 || (a == n / 2 || a == 0) && (r[s + 1] / n / 100 | 0) == 0 : i < 4 ? (i == 0 ? a = a / 1e3 | 0 : i == 1 ? a = a / 100 | 0 : i == 2 && (a = a / 10 | 0), o = (e || t < 4) && a == 9999 || !e && t > 3 && a == 4999) : o = ((e || t < 4) && a + 1 == n || !e && t > 3 && a + 1 == n / 2) && (r[s + 1] / n / 1e3 | 0) == T(10, i - 3) - 1, o;
|
|
2434
2445
|
}
|
|
2435
2446
|
function zt(r, i, t) {
|
|
2436
2447
|
for (var e, s = [0], n, o = 0, a = r.length; o < a; ) {
|
|
@@ -2475,17 +2486,17 @@ var A = /* @__PURE__ */ function() {
|
|
|
2475
2486
|
for (; !e[0] && e.length > 1; ) e.shift();
|
|
2476
2487
|
}
|
|
2477
2488
|
return function(e, s, n, o, a, l) {
|
|
2478
|
-
var c, h, u, f, m, g, p, y, w, b, P, E, O, G, Lt, dt, nt, yt, X,
|
|
2489
|
+
var c, h, u, f, m, g, p, y, w, b, P, E, O, G, Lt, dt, nt, yt, X, It, Tt = e.constructor, Jt = e.s == s.s ? 1 : -1, H = e.d, V = s.d;
|
|
2479
2490
|
if (!H || !H[0] || !V || !V[0])
|
|
2480
|
-
return new
|
|
2491
|
+
return new Tt(
|
|
2481
2492
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
2482
2493
|
!e.s || !s.s || (H ? V && H[0] == V[0] : !V) ? NaN : (
|
|
2483
2494
|
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
2484
2495
|
H && H[0] == 0 || !V ? Jt * 0 : Jt / 0
|
|
2485
2496
|
)
|
|
2486
2497
|
);
|
|
2487
|
-
for (l ? (m = 1, h = e.e - s.e) : (l = Z, m = S, h = F(e.e / m) - F(s.e / m)), X = V.length, nt = H.length, w = new
|
|
2488
|
-
if (V[u] > (H[u] || 0) && h--, n == null ? (G = n =
|
|
2498
|
+
for (l ? (m = 1, h = e.e - s.e) : (l = Z, m = S, h = F(e.e / m) - F(s.e / m)), X = V.length, nt = H.length, w = new Tt(Jt), b = w.d = [], u = 0; V[u] == (H[u] || 0); u++) ;
|
|
2499
|
+
if (V[u] > (H[u] || 0) && h--, n == null ? (G = n = Tt.precision, o = Tt.rounding) : a ? G = n + (e.e - s.e) + 1 : G = n, G < 0)
|
|
2489
2500
|
b.push(1), g = !0;
|
|
2490
2501
|
else {
|
|
2491
2502
|
if (G = G / m + 2 | 0, u = 0, X == 1) {
|
|
@@ -2494,9 +2505,9 @@ var A = /* @__PURE__ */ function() {
|
|
|
2494
2505
|
g = f || u < nt;
|
|
2495
2506
|
} else {
|
|
2496
2507
|
for (f = l / (V[0] + 1) | 0, f > 1 && (V = r(V, f, l), H = r(H, f, l), X = V.length, nt = H.length), dt = X, P = H.slice(0, X), E = P.length; E < X; ) P[E++] = 0;
|
|
2497
|
-
|
|
2508
|
+
It = V.slice(), It.unshift(0), yt = V[0], V[1] >= l / 2 && ++yt;
|
|
2498
2509
|
do
|
|
2499
|
-
f = 0, c = i(V, P, X, E), c < 0 ? (O = P[0], X != E && (O = O * l + (P[1] || 0)), f = O / yt | 0, f > 1 ? (f >= l && (f = l - 1), p = r(V, f, l), y = p.length, E = P.length, c = i(p, P, y, E), c == 1 && (f--, t(p, X < y ?
|
|
2510
|
+
f = 0, c = i(V, P, X, E), c < 0 ? (O = P[0], X != E && (O = O * l + (P[1] || 0)), f = O / yt | 0, f > 1 ? (f >= l && (f = l - 1), p = r(V, f, l), y = p.length, E = P.length, c = i(p, P, y, E), c == 1 && (f--, t(p, X < y ? It : V, y, l))) : (f == 0 && (c = f = 1), p = V.slice()), y = p.length, y < E && p.unshift(0), t(P, p, E, l), c == -1 && (E = P.length, c = i(V, P, X, E), c < 1 && (f++, t(P, X < E ? It : V, E, l))), E = P.length) : c === 0 && (f++, P = [0]), b[u++] = f, c && P[0] ? P[E++] = H[dt] || 0 : (P = [H[dt]], E = 1);
|
|
2500
2511
|
while ((dt++ < nt || P[0] !== void 0) && G--);
|
|
2501
2512
|
g = P[0] !== void 0;
|
|
2502
2513
|
}
|
|
@@ -2517,7 +2528,7 @@ function C(r, i, t, e) {
|
|
|
2517
2528
|
if (u = r.d, !u) return r;
|
|
2518
2529
|
for (s = 1, a = u[0]; a >= 10; a /= 10) s++;
|
|
2519
2530
|
if (n = i - s, n < 0)
|
|
2520
|
-
n += S, o = i, h = u[f = 0], l = h /
|
|
2531
|
+
n += S, o = i, h = u[f = 0], l = h / T(10, s - o - 1) % 10 | 0;
|
|
2521
2532
|
else if (f = Math.ceil((n + 1) / S), a = u.length, f >= a)
|
|
2522
2533
|
if (e) {
|
|
2523
2534
|
for (; a++ <= f; ) u.push(0);
|
|
@@ -2526,12 +2537,12 @@ function C(r, i, t, e) {
|
|
|
2526
2537
|
break t;
|
|
2527
2538
|
else {
|
|
2528
2539
|
for (h = a = u[f], s = 1; a >= 10; a /= 10) s++;
|
|
2529
|
-
n %= S, o = n - S + s, l = o < 0 ? 0 : h /
|
|
2540
|
+
n %= S, o = n - S + s, l = o < 0 ? 0 : h / T(10, s - o - 1) % 10 | 0;
|
|
2530
2541
|
}
|
|
2531
|
-
if (e = e || i < 0 || u[f + 1] !== void 0 || (o < 0 ? h : h %
|
|
2532
|
-
(n > 0 ? o > 0 ? h /
|
|
2533
|
-
return u.length = 0, c ? (i -= r.e + 1, u[0] =
|
|
2534
|
-
if (n == 0 ? (u.length = f, a = 1, f--) : (u.length = f + 1, a =
|
|
2542
|
+
if (e = e || i < 0 || u[f + 1] !== void 0 || (o < 0 ? h : h % T(10, s - o - 1)), c = t < 4 ? (l || e) && (t == 0 || t == (r.s < 0 ? 3 : 2)) : l > 5 || l == 5 && (t == 4 || e || t == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
2543
|
+
(n > 0 ? o > 0 ? h / T(10, s - o) : 0 : u[f - 1]) % 10 & 1 || t == (r.s < 0 ? 8 : 7)), i < 1 || !u[0])
|
|
2544
|
+
return u.length = 0, c ? (i -= r.e + 1, u[0] = T(10, (S - i % S) % S), r.e = -i || 0) : u[0] = r.e = 0, r;
|
|
2545
|
+
if (n == 0 ? (u.length = f, a = 1, f--) : (u.length = f + 1, a = T(10, S - n), u[f] = o > 0 ? (h / T(10, s - o) % T(10, o) | 0) * a : 0), c)
|
|
2535
2546
|
for (; ; )
|
|
2536
2547
|
if (f == 0) {
|
|
2537
2548
|
for (n = 1, o = u[0]; o >= 10; o /= 10) n++;
|
|
@@ -2607,7 +2618,7 @@ function ue(r, i) {
|
|
|
2607
2618
|
return new f(r.d ? r.d[0] ? r.s < 0 ? 0 : 1 / 0 : 1 : r.s ? r.s < 0 ? 0 : r : NaN);
|
|
2608
2619
|
for (i == null ? (_ = !1, l = g) : l = i, a = new f(0.03125); r.e > -2; )
|
|
2609
2620
|
r = r.times(a), u += 5;
|
|
2610
|
-
for (e = Math.log(
|
|
2621
|
+
for (e = Math.log(T(2, u)) / Math.LN10 * 2 + 5 | 0, l += e, t = n = o = new f(1), f.precision = l; ; ) {
|
|
2611
2622
|
if (n = C(n.times(r), l, 1), t = t.times(++h), a = o.plus(A(n, t, l, 1)), N(a.d).slice(0, l) === N(o.d).slice(0, l)) {
|
|
2612
2623
|
for (s = u; s--; ) o = C(o.times(o), l, 1);
|
|
2613
2624
|
if (i == null)
|
|
@@ -2677,7 +2688,7 @@ function xi(r, i) {
|
|
|
2677
2688
|
else
|
|
2678
2689
|
throw Error(ht + i);
|
|
2679
2690
|
for (n = i.search(/p/i), n > 0 ? (l = +i.slice(n + 1), i = i.substring(2, n)) : i = i.slice(2), n = i.indexOf("."), o = n >= 0, e = r.constructor, o && (i = i.replace(".", ""), a = i.length, n = a - n, s = je(e, new e(t), n, n * 2)), c = zt(i, t, Z), h = c.length - 1, n = h; c[n] === 0; --n) c.pop();
|
|
2680
|
-
return n < 0 ? new e(r.s * 0) : (r.e = Zt(c, h), r.d = c, _ = !1, o && (r = A(r, s, a * 4)), l && (r = r.times(Math.abs(l) < 54 ?
|
|
2691
|
+
return n < 0 ? new e(r.s * 0) : (r.e = Zt(c, h), r.d = c, _ = !1, o && (r = A(r, s, a * 4)), l && (r = r.times(Math.abs(l) < 54 ? T(2, l) : k.pow(2, l))), _ = !0, r);
|
|
2681
2692
|
}
|
|
2682
2693
|
function bi(r, i) {
|
|
2683
2694
|
var t, e = i.d.length;
|
|
@@ -2833,10 +2844,10 @@ function Li(r) {
|
|
|
2833
2844
|
throw Error(ht + t + ": " + e);
|
|
2834
2845
|
return this;
|
|
2835
2846
|
}
|
|
2836
|
-
function
|
|
2847
|
+
function Ii(r) {
|
|
2837
2848
|
return new this(r).cos();
|
|
2838
2849
|
}
|
|
2839
|
-
function
|
|
2850
|
+
function Ti(r) {
|
|
2840
2851
|
return new this(r).cosh();
|
|
2841
2852
|
}
|
|
2842
2853
|
function Ze(r) {
|
|
@@ -2870,7 +2881,7 @@ function Ze(r) {
|
|
|
2870
2881
|
return n < 0 ? (n = -n, c.s = -1) : c.s = 1, Bt(c, n.toString());
|
|
2871
2882
|
throw Error(ht + n);
|
|
2872
2883
|
}
|
|
2873
|
-
if (s.prototype = v, s.ROUND_UP = 0, s.ROUND_DOWN = 1, s.ROUND_CEIL = 2, s.ROUND_FLOOR = 3, s.ROUND_HALF_UP = 4, s.ROUND_HALF_DOWN = 5, s.ROUND_HALF_EVEN = 6, s.ROUND_HALF_CEIL = 7, s.ROUND_HALF_FLOOR = 8, s.EUCLID = 9, s.config = s.set = Li, s.clone = Ze, s.isDecimal = Re, s.abs = Pi, s.acos = Ci, s.acosh = Si, s.add = _i, s.asin = Ei, s.asinh = Mi, s.atan = Di, s.atanh = ki, s.atan2 = Ri, s.cbrt = Ai, s.ceil = Vi, s.clamp = Oi, s.cos =
|
|
2884
|
+
if (s.prototype = v, s.ROUND_UP = 0, s.ROUND_DOWN = 1, s.ROUND_CEIL = 2, s.ROUND_FLOOR = 3, s.ROUND_HALF_UP = 4, s.ROUND_HALF_DOWN = 5, s.ROUND_HALF_EVEN = 6, s.ROUND_HALF_CEIL = 7, s.ROUND_HALF_FLOOR = 8, s.EUCLID = 9, s.config = s.set = Li, s.clone = Ze, s.isDecimal = Re, s.abs = Pi, s.acos = Ci, s.acosh = Si, s.add = _i, s.asin = Ei, s.asinh = Mi, s.atan = Di, s.atanh = ki, s.atan2 = Ri, s.cbrt = Ai, s.ceil = Vi, s.clamp = Oi, s.cos = Ii, s.cosh = Ti, s.div = Ni, s.exp = Hi, s.floor = Fi, s.hypot = zi, s.ln = Bi, s.log = Ui, s.log10 = Xi, s.log2 = Gi, s.max = Yi, s.min = $i, s.mod = ji, s.mul = Wi, s.pow = qi, s.random = Ki, s.round = Zi, s.sign = Qi, s.sin = Ji, s.sinh = ts, s.sqrt = es, s.sub = is, s.sum = ss, s.tan = ns, s.tanh = rs, s.trunc = os, r === void 0 && (r = {}), r && r.defaults !== !0)
|
|
2874
2885
|
for (e = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], i = 0; i < e.length; ) r.hasOwnProperty(t = e[i++]) || (r[t] = this[t]);
|
|
2875
2886
|
return s.config(r), s;
|
|
2876
2887
|
}
|
|
@@ -2938,7 +2949,7 @@ function Ki(r) {
|
|
|
2938
2949
|
} else
|
|
2939
2950
|
throw Error(Ge);
|
|
2940
2951
|
else for (; n < e; ) a[n++] = Math.random() * 1e7 | 0;
|
|
2941
|
-
for (e = a[--n], r %= S, e && r && (s =
|
|
2952
|
+
for (e = a[--n], r %= S, e && r && (s = T(10, S - r), a[n] = (e / s | 0) * s); a[n] === 0; n--) a.pop();
|
|
2942
2953
|
if (n < 0)
|
|
2943
2954
|
t = 0, a = [0];
|
|
2944
2955
|
else {
|
|
@@ -6537,16 +6548,16 @@ class Es {
|
|
|
6537
6548
|
constructor(i) {
|
|
6538
6549
|
/** 绑定的画布实例 */
|
|
6539
6550
|
d(this, "canvas");
|
|
6540
|
-
d(this, "layerGroup", new
|
|
6551
|
+
d(this, "layerGroup", new I.LayerGroup({
|
|
6541
6552
|
name: "创建覆盖物图层群组"
|
|
6542
6553
|
}));
|
|
6543
6554
|
/** 创建中覆盖物的绘制层(置顶以保证可见) */
|
|
6544
|
-
d(this, "overlayLayer", new
|
|
6555
|
+
d(this, "overlayLayer", new I.Layer({
|
|
6545
6556
|
name: "creator-layer",
|
|
6546
6557
|
zIndex: 9999
|
|
6547
6558
|
}));
|
|
6548
6559
|
/** 该层内的覆盖物分组,便于统一增删 */
|
|
6549
|
-
d(this, "overlayGroup", new
|
|
6560
|
+
d(this, "overlayGroup", new I.OverlayGroup({
|
|
6550
6561
|
name: "creator-group"
|
|
6551
6562
|
}));
|
|
6552
6563
|
/** 当前正在创建的覆盖物(多边形或线),其顶点通过 overlay.value 即坐标轴上的值表示 */
|
|
@@ -6606,10 +6617,10 @@ class Es {
|
|
|
6606
6617
|
}), this.savedLayerGroupInteractive.clear();
|
|
6607
6618
|
}
|
|
6608
6619
|
createLine(i) {
|
|
6609
|
-
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new
|
|
6620
|
+
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new I.Line({ ...i }), this.overlayGroup.addOverlay(this.overlay), this.overlay;
|
|
6610
6621
|
}
|
|
6611
6622
|
createPolygon(i) {
|
|
6612
|
-
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new
|
|
6623
|
+
return this.disableOtherLayerGroups(), this.overlay && this.overlayGroup.removeOverlay(this.overlay), this.axisValueList = [], this.overlay = new I.Polygon({ ...i }), this.overlayGroup.addOverlay(this.overlay), this.overlay;
|
|
6613
6624
|
}
|
|
6614
6625
|
/** 从创建层中移除指定覆盖物,不传则清空该层全部 */
|
|
6615
6626
|
removeOverlay(i) {
|
|
@@ -6625,7 +6636,7 @@ class Es {
|
|
|
6625
6636
|
}
|
|
6626
6637
|
/** 当前类型完成绘制所需的最少顶点数(多边形 3,线 2) */
|
|
6627
6638
|
get minPointCount() {
|
|
6628
|
-
return this.overlay instanceof
|
|
6639
|
+
return this.overlay instanceof I.Polygon ? 3 : this.overlay instanceof I.Line ? 2 : 0;
|
|
6629
6640
|
}
|
|
6630
6641
|
/** 从鼠标事件得到坐标轴上的 [x, y],若设置了限位器则先限位再返回 */
|
|
6631
6642
|
getAxisValueFromEvent(i) {
|
|
@@ -6827,7 +6838,7 @@ class Ve extends Ds {
|
|
|
6827
6838
|
function Ft(r) {
|
|
6828
6839
|
return [r].flat(1 / 0);
|
|
6829
6840
|
}
|
|
6830
|
-
class
|
|
6841
|
+
class I extends Ss {
|
|
6831
6842
|
constructor(t) {
|
|
6832
6843
|
super(t);
|
|
6833
6844
|
/** 按坐标轴值创建覆盖物(多边形/线)的交互管理 */
|
|
@@ -6909,18 +6920,18 @@ class T extends Ss {
|
|
|
6909
6920
|
}
|
|
6910
6921
|
}
|
|
6911
6922
|
/** 视图适配工具:默认缩放、居中计算 */
|
|
6912
|
-
d(
|
|
6913
|
-
d(
|
|
6914
|
-
d(
|
|
6915
|
-
d(
|
|
6916
|
-
d(
|
|
6917
|
-
d(
|
|
6918
|
-
d(
|
|
6919
|
-
d(
|
|
6920
|
-
d(
|
|
6921
|
-
d(
|
|
6922
|
-
d(
|
|
6923
|
-
d(
|
|
6923
|
+
d(I, "ViewFit", Ms), /** 图层群组 */
|
|
6924
|
+
d(I, "LayerGroup", Rt), /** 图层 */
|
|
6925
|
+
d(I, "Layer", $), /** 覆盖物群组 */
|
|
6926
|
+
d(I, "OverlayGroup", Y), /** 文字 */
|
|
6927
|
+
d(I, "Text", fe), /** 点位 */
|
|
6928
|
+
d(I, "Point", vt), /** 线段 */
|
|
6929
|
+
d(I, "Line", me), /** 多边形 */
|
|
6930
|
+
d(I, "Polygon", pe), /** 自定义绘制 */
|
|
6931
|
+
d(I, "Custom", de), /** 圆弧 */
|
|
6932
|
+
d(I, "Arc", ge), /** 圆角 */
|
|
6933
|
+
d(I, "ArcTo", ve), /** 图片 */
|
|
6934
|
+
d(I, "Billboard", Ve);
|
|
6924
6935
|
class ks {
|
|
6925
6936
|
/** @param id canvas DOM id(通过 getElementById 定位) */
|
|
6926
6937
|
constructor(i) {
|
|
@@ -7279,7 +7290,7 @@ class Ls {
|
|
|
7279
7290
|
(i = this.offsetDrag) == null || i.destroy(), (t = this.wheelZoom) == null || t.destroy(), (e = this.mouseTimeReporter) == null || e.destroy(), this.canvasManager.destroy();
|
|
7280
7291
|
}
|
|
7281
7292
|
}
|
|
7282
|
-
class
|
|
7293
|
+
class Rn extends Ls {
|
|
7283
7294
|
/**
|
|
7284
7295
|
* 将填充样式解析为 ctx.fillStyle 可用的值(纯色或线性渐变)
|
|
7285
7296
|
* @param rect 矩形区域,用于计算渐变起止点
|
|
@@ -7333,12 +7344,12 @@ const ye = {
|
|
|
7333
7344
|
function Oe(r) {
|
|
7334
7345
|
return typeof r == "string" ? document.querySelector(r) : r;
|
|
7335
7346
|
}
|
|
7336
|
-
function
|
|
7347
|
+
function Is(r) {
|
|
7337
7348
|
return r.some(
|
|
7338
7349
|
(i) => i === "text/plain" || i.startsWith("text/")
|
|
7339
7350
|
);
|
|
7340
7351
|
}
|
|
7341
|
-
function
|
|
7352
|
+
function Ts(r) {
|
|
7342
7353
|
return r.includes("Files");
|
|
7343
7354
|
}
|
|
7344
7355
|
function Je(r) {
|
|
@@ -7358,7 +7369,7 @@ function Ns(r, i) {
|
|
|
7358
7369
|
});
|
|
7359
7370
|
}
|
|
7360
7371
|
function ie(r, i) {
|
|
7361
|
-
return r ? (Array.isArray(r) ? r : [r]).some((e) => typeof e == "object" && e !== null && "matchTypes" in e ? e.matchTypes(i) : e === "text" ?
|
|
7372
|
+
return r ? (Array.isArray(r) ? r : [r]).some((e) => typeof e == "object" && e !== null && "matchTypes" in e ? e.matchTypes(i) : e === "text" ? Is(i) : Je(e) || e === "file" || e in ye ? Ts(i) : !1) : !0;
|
|
7362
7373
|
}
|
|
7363
7374
|
async function Hs(r, i) {
|
|
7364
7375
|
if (!i) return [];
|
|
@@ -7399,7 +7410,7 @@ async function Hs(r, i) {
|
|
|
7399
7410
|
}
|
|
7400
7411
|
return a;
|
|
7401
7412
|
}
|
|
7402
|
-
class
|
|
7413
|
+
class An {
|
|
7403
7414
|
constructor() {
|
|
7404
7415
|
d(this, "entries", /* @__PURE__ */ new Map());
|
|
7405
7416
|
d(this, "onDragEnter", (i) => {
|
|
@@ -7500,13 +7511,13 @@ function jt(r) {
|
|
|
7500
7511
|
const i = Ot(r), t = document, e = document.fullscreenElement || t.webkitFullscreenElement || t.mozFullScreenElement || t.msFullscreenElement;
|
|
7501
7512
|
return i == e || !r && window.innerWidth == screen.width && window.innerHeight == screen.height;
|
|
7502
7513
|
}
|
|
7503
|
-
function
|
|
7514
|
+
function Vn(r) {
|
|
7504
7515
|
if (r = Ot(r), !!r)
|
|
7505
7516
|
return function() {
|
|
7506
7517
|
jt(r) ? ei() : ti(r);
|
|
7507
7518
|
};
|
|
7508
7519
|
}
|
|
7509
|
-
function
|
|
7520
|
+
function On(r, i) {
|
|
7510
7521
|
const t = Ot(i);
|
|
7511
7522
|
if (!t) return;
|
|
7512
7523
|
const e = () => {
|
|
@@ -7516,7 +7527,7 @@ function Vn(r, i) {
|
|
|
7516
7527
|
document.removeEventListener("fullscreenchange", e), document.removeEventListener("webkitfullscreenchange", e), document.removeEventListener("mozfullscreenchange", e), document.removeEventListener("MSFullscreenChange", e);
|
|
7517
7528
|
};
|
|
7518
7529
|
}
|
|
7519
|
-
class
|
|
7530
|
+
class Ln {
|
|
7520
7531
|
constructor(i, t) {
|
|
7521
7532
|
/** 要全屏展示的目标元素 */
|
|
7522
7533
|
d(this, "targetElement");
|
|
@@ -7578,7 +7589,7 @@ class On {
|
|
|
7578
7589
|
(i = this.detachFullscreenListeners) == null || i.call(this), this.detachFullscreenListeners = void 0, this.targetElement = void 0, this.onFullscreenChange = void 0;
|
|
7579
7590
|
}
|
|
7580
7591
|
}
|
|
7581
|
-
function
|
|
7592
|
+
function In(r) {
|
|
7582
7593
|
const i = ze(r, 100);
|
|
7583
7594
|
let t = 0, e = 0;
|
|
7584
7595
|
return function(s) {
|
|
@@ -7640,7 +7651,7 @@ function Tn(r, i, t) {
|
|
|
7640
7651
|
);
|
|
7641
7652
|
}
|
|
7642
7653
|
var j, ft, mt, bt, Pt, Q, J, it, Ct;
|
|
7643
|
-
class
|
|
7654
|
+
class Nn {
|
|
7644
7655
|
constructor() {
|
|
7645
7656
|
L(this, j);
|
|
7646
7657
|
L(this, ft, !1);
|
|
@@ -7688,7 +7699,7 @@ class In {
|
|
|
7688
7699
|
}
|
|
7689
7700
|
j = new WeakMap(), ft = new WeakMap(), mt = new WeakMap(), bt = new WeakMap(), Pt = new WeakMap(), Q = new WeakMap(), J = new WeakMap(), it = new WeakMap(), Ct = new WeakMap();
|
|
7690
7701
|
var W, pt, gt, St, _t, q, K, B, Et, Mt;
|
|
7691
|
-
class
|
|
7702
|
+
class Hn {
|
|
7692
7703
|
constructor() {
|
|
7693
7704
|
L(this, W);
|
|
7694
7705
|
L(this, pt, !1);
|
|
@@ -7752,7 +7763,7 @@ class Nn {
|
|
|
7752
7763
|
}
|
|
7753
7764
|
}
|
|
7754
7765
|
W = new WeakMap(), pt = new WeakMap(), gt = new WeakMap(), St = new WeakMap(), _t = new WeakMap(), q = new WeakMap(), K = new WeakMap(), B = new WeakMap(), Et = new WeakMap(), Mt = new WeakMap();
|
|
7755
|
-
function
|
|
7766
|
+
function Fn(r, i) {
|
|
7756
7767
|
if (typeof r == "number") return r;
|
|
7757
7768
|
if (/px/.test(r)) return Number(r.replace(/px/, "")) || 0;
|
|
7758
7769
|
const t = document.createElement("div");
|
|
@@ -7760,7 +7771,7 @@ function Hn(r, i) {
|
|
|
7760
7771
|
const e = t.getBoundingClientRect().width;
|
|
7761
7772
|
return i.removeChild(t), e;
|
|
7762
7773
|
}
|
|
7763
|
-
function
|
|
7774
|
+
function zn(r, i) {
|
|
7764
7775
|
if (!r) return;
|
|
7765
7776
|
let t, e;
|
|
7766
7777
|
if (typeof i == "string") {
|
|
@@ -7777,7 +7788,7 @@ function Fn(r, i) {
|
|
|
7777
7788
|
const s = t / e;
|
|
7778
7789
|
return s > r ? [r * e, e] : s < r ? [t, t / r] : [t, e];
|
|
7779
7790
|
}
|
|
7780
|
-
function
|
|
7791
|
+
function Bn(r, i = 5e3) {
|
|
7781
7792
|
return new Promise((t, e) => {
|
|
7782
7793
|
const s = new Image();
|
|
7783
7794
|
s.src = r;
|
|
@@ -7793,7 +7804,7 @@ function zn(r, i = 5e3) {
|
|
|
7793
7804
|
}, s.crossOrigin = "Anonymous";
|
|
7794
7805
|
});
|
|
7795
7806
|
}
|
|
7796
|
-
function
|
|
7807
|
+
function Un(r) {
|
|
7797
7808
|
const t = document.getElementById(r).querySelectorAll("img"), e = t.length, s = [];
|
|
7798
7809
|
let n = 0;
|
|
7799
7810
|
return e === 0 ? Promise.resolve({
|
|
@@ -7835,14 +7846,14 @@ function Bn(r) {
|
|
|
7835
7846
|
});
|
|
7836
7847
|
});
|
|
7837
7848
|
}
|
|
7838
|
-
function
|
|
7849
|
+
function Gn(r) {
|
|
7839
7850
|
return new Promise((i, t) => {
|
|
7840
7851
|
fetch(r).then((e) => i(e.text())).catch((e) => {
|
|
7841
7852
|
console.error("Error fetching :", e), t(e);
|
|
7842
7853
|
});
|
|
7843
7854
|
});
|
|
7844
7855
|
}
|
|
7845
|
-
function
|
|
7856
|
+
function Xn(r) {
|
|
7846
7857
|
const i = document.createElement("input");
|
|
7847
7858
|
return i.type = "file", i.accept = (r == null ? void 0 : r.accept) || "", i.multiple = (r == null ? void 0 : r.multiple) || !1, new Promise((t, e) => {
|
|
7848
7859
|
i.addEventListener("change", (s) => {
|
|
@@ -7890,7 +7901,7 @@ function Fs(r) {
|
|
|
7890
7901
|
!a && l && u();
|
|
7891
7902
|
} };
|
|
7892
7903
|
}
|
|
7893
|
-
function
|
|
7904
|
+
function Yn(r, i, t) {
|
|
7894
7905
|
if (!t) {
|
|
7895
7906
|
let n = i.replace(/^[^.]+./, "");
|
|
7896
7907
|
n = n == i ? "text/plain" : "application/" + n, t = { type: n };
|
|
@@ -7903,7 +7914,7 @@ function Le(r, i) {
|
|
|
7903
7914
|
const t = Math.max(Math.min(r, 180), -180), e = Math.max(Math.min(i, Bs), -85.05112878), s = t * Wt * qt, n = e * Wt, o = Math.log(Math.tan(Math.PI / 4 + n / 2)) * qt;
|
|
7904
7915
|
return [s, o];
|
|
7905
7916
|
}
|
|
7906
|
-
function
|
|
7917
|
+
function $n(r, i) {
|
|
7907
7918
|
const t = r / qt / Wt, e = (2 * Math.atan(Math.exp(i / qt)) - zs) / Wt;
|
|
7908
7919
|
return [t, e];
|
|
7909
7920
|
}
|
|
@@ -7915,14 +7926,14 @@ function Us(r, i, t) {
|
|
|
7915
7926
|
(e - (n + h * (a - n))) ** 2 + (s - (o + h * (l - o))) ** 2
|
|
7916
7927
|
);
|
|
7917
7928
|
}
|
|
7918
|
-
function
|
|
7929
|
+
function jn(r, i, t, e, s, n = 1, o = 1) {
|
|
7919
7930
|
const a = r + t * Math.cos(e) * n, l = i + t * Math.sin(e) * o, c = r + t * Math.cos(s) * n, h = i + t * Math.sin(s) * o;
|
|
7920
7931
|
return [
|
|
7921
7932
|
[a, l],
|
|
7922
7933
|
[c, h]
|
|
7923
7934
|
];
|
|
7924
7935
|
}
|
|
7925
|
-
function
|
|
7936
|
+
function Wn(r, i, t, e) {
|
|
7926
7937
|
const [s, n] = Le(r, i), [o, a] = Le(t, e);
|
|
7927
7938
|
return we(s, n, o, a);
|
|
7928
7939
|
}
|
|
@@ -7933,7 +7944,7 @@ function ii(r, i, t, e) {
|
|
|
7933
7944
|
const s = (r + t) / 2, n = (i + e) / 2;
|
|
7934
7945
|
return { x: s, y: n };
|
|
7935
7946
|
}
|
|
7936
|
-
function
|
|
7947
|
+
function qn(r, i, t, e) {
|
|
7937
7948
|
const [s, n] = r, [o, a] = i;
|
|
7938
7949
|
let l = 1 / 0;
|
|
7939
7950
|
if (o !== 0) {
|
|
@@ -7954,7 +7965,7 @@ const Gs = /* @__PURE__ */ new Set([
|
|
|
7954
7965
|
"acos",
|
|
7955
7966
|
"atan",
|
|
7956
7967
|
"atan2"
|
|
7957
|
-
]),
|
|
7968
|
+
]), Kn = new Proxy(Math, {
|
|
7958
7969
|
get(r, i) {
|
|
7959
7970
|
return Gs.has(i) ? function(...t) {
|
|
7960
7971
|
const e = t.map((s) => s / 180 * Math.PI);
|
|
@@ -7970,7 +7981,7 @@ const Gs = /* @__PURE__ */ new Set([
|
|
|
7970
7981
|
throw new Error("DegreeMath 是只读的,不能删除属性");
|
|
7971
7982
|
}
|
|
7972
7983
|
});
|
|
7973
|
-
function
|
|
7984
|
+
function Zn(r, i) {
|
|
7974
7985
|
const t = r.length;
|
|
7975
7986
|
if (t === 0) return [0, 0, 0];
|
|
7976
7987
|
if (t === 1) return [r[0][0], r[0][1], 0];
|
|
@@ -7988,11 +7999,11 @@ function Kn(r, i) {
|
|
|
7988
7999
|
const n = s[0], o = s[1], a = (1 - e) * n[0] + e * o[0], l = (1 - e) * n[1] + e * o[1], c = o[0] - n[0], h = o[1] - n[1], u = Math.atan2(h, c);
|
|
7989
8000
|
return [a, l, u];
|
|
7990
8001
|
}
|
|
7991
|
-
function
|
|
8002
|
+
function Qn(r, i, t) {
|
|
7992
8003
|
const e = Math.abs(r) || 1, s = i * Math.PI * 2, n = e * Math.cos(s), o = Math.sin(s);
|
|
7993
8004
|
return t ? [(n + e) / (2 * e), (o + 1) / 2] : [n, o];
|
|
7994
8005
|
}
|
|
7995
|
-
function
|
|
8006
|
+
function Jn(r, i, t) {
|
|
7996
8007
|
return Math.min(Math.max(r, i), t);
|
|
7997
8008
|
}
|
|
7998
8009
|
function Xs(r, i, t) {
|
|
@@ -8001,24 +8012,24 @@ function Xs(r, i, t) {
|
|
|
8001
8012
|
function Ys(r, i, t) {
|
|
8002
8013
|
return r === i ? 0 : (t - r) / (i - r);
|
|
8003
8014
|
}
|
|
8004
|
-
function
|
|
8015
|
+
function tr(r, i, t, e, s) {
|
|
8005
8016
|
const n = Ys(i, t, r);
|
|
8006
8017
|
return Xs(e, s, n);
|
|
8007
8018
|
}
|
|
8008
|
-
function
|
|
8019
|
+
function er(r) {
|
|
8009
8020
|
return r / 180 * Math.PI;
|
|
8010
8021
|
}
|
|
8011
|
-
function
|
|
8022
|
+
function ir(r) {
|
|
8012
8023
|
return r / Math.PI * 180;
|
|
8013
8024
|
}
|
|
8014
|
-
function
|
|
8025
|
+
function sr(r, i = !1) {
|
|
8015
8026
|
let t = r % 360;
|
|
8016
8027
|
return t < 0 && (t += 360), i && t >= 180 && (t -= 360), t;
|
|
8017
8028
|
}
|
|
8018
|
-
function
|
|
8029
|
+
function nr(r, i, t, e, s, n) {
|
|
8019
8030
|
return r >= t && r <= t + s && i >= e && i <= e + n;
|
|
8020
8031
|
}
|
|
8021
|
-
function
|
|
8032
|
+
function rr(r, i, t, e, s) {
|
|
8022
8033
|
const n = r - t, o = i - e;
|
|
8023
8034
|
return n * n + o * o <= s * s;
|
|
8024
8035
|
}
|
|
@@ -8114,7 +8125,7 @@ let kt = z;
|
|
|
8114
8125
|
export {
|
|
8115
8126
|
ri as EXTENSION_TO_MIME,
|
|
8116
8127
|
te as FILE_EXTENSIONS,
|
|
8117
|
-
|
|
8128
|
+
Ie as PAPER_SIZE_DEFINITIONS,
|
|
8118
8129
|
Ks as PAPER_SIZE_OPTIONS,
|
|
8119
8130
|
Se as UNIT_LABELS,
|
|
8120
8131
|
qs as WINDOW_TARGET,
|
|
@@ -8123,34 +8134,34 @@ export {
|
|
|
8123
8134
|
oi as _Animate_NumericTransition,
|
|
8124
8135
|
Ut as _Animate_Schedule,
|
|
8125
8136
|
Js as _Blob_ConvertDataToImageUrl,
|
|
8126
|
-
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
|
|
8137
|
+
Mn as _Browser_CalculatePrintableArea,
|
|
8138
|
+
En as _Browser_CopyToClipboard,
|
|
8139
|
+
_n as _Browser_GetFrameRate,
|
|
8140
|
+
Dn as _Browser_IdleDetection,
|
|
8130
8141
|
Ht as _Browser_SameOriginTabManager,
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8142
|
+
Cn as _Browser_SoundEffects,
|
|
8143
|
+
Sn as _Browser_WebSocketClient,
|
|
8144
|
+
I as _Canvas_Axis,
|
|
8145
|
+
Rn as _Canvas_TimeAxis,
|
|
8146
|
+
zn as _Element_CalculateCanvasSize,
|
|
8147
|
+
Un as _Element_CheckImagesLoaded,
|
|
8137
8148
|
Tn as _Element_CloseOnOutsideClick,
|
|
8138
|
-
|
|
8139
|
-
|
|
8149
|
+
Nn as _Element_Drag,
|
|
8150
|
+
An as _Element_DropZoneManager,
|
|
8140
8151
|
ti as _Element_EnterFullscreen,
|
|
8141
8152
|
ei as _Element_ExitFullscreen,
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
|
|
8153
|
+
Vn as _Element_Fullscreen,
|
|
8154
|
+
Ln as _Element_FullscreenController,
|
|
8155
|
+
On as _Element_FullscreenObserver,
|
|
8156
|
+
Fn as _Element_GetOtherSizeInPixels,
|
|
8146
8157
|
jt as _Element_IsFullscreen,
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8158
|
+
Bn as _Element_LoadImage,
|
|
8159
|
+
Hn as _Element_LocalDrag,
|
|
8160
|
+
In as _Element_ScrollEndListener,
|
|
8161
|
+
Yn as _File_CreateAndDownload,
|
|
8151
8162
|
Fs as _File_Download,
|
|
8152
|
-
|
|
8153
|
-
|
|
8163
|
+
Gn as _File_Read,
|
|
8164
|
+
Xn as _File_Select,
|
|
8154
8165
|
rn as _Format_CamelCase,
|
|
8155
8166
|
tn as _Format_CapitalizeFirstLetter,
|
|
8156
8167
|
cn as _Format_ChunkArray,
|
|
@@ -8163,49 +8174,50 @@ export {
|
|
|
8163
8174
|
en as _Format_Percentage,
|
|
8164
8175
|
ai as _Format_Timestamp,
|
|
8165
8176
|
an as _Format_ToggleInvisibleChars,
|
|
8177
|
+
hn as _Format_Truncate,
|
|
8166
8178
|
we as _Math_CalculateDistance2D,
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8179
|
+
Wn as _Math_CalculateDistanceLngLat,
|
|
8180
|
+
Jn as _Math_Clamp,
|
|
8181
|
+
er as _Math_DegToRad,
|
|
8182
|
+
Kn as _Math_Degree,
|
|
8183
|
+
jn as _Math_GetArcPoints,
|
|
8184
|
+
Zn as _Math_GetBezierCurveNodes,
|
|
8185
|
+
qn as _Math_GetBoundaryIntersection,
|
|
8186
|
+
Qn as _Math_GetEllipsePoints,
|
|
8175
8187
|
ii as _Math_GetMidpoint,
|
|
8176
8188
|
Ys as _Math_InverseLerp,
|
|
8177
|
-
|
|
8178
|
-
|
|
8189
|
+
rr as _Math_IsPointInCircle,
|
|
8190
|
+
nr as _Math_IsPointInRect,
|
|
8179
8191
|
Xs as _Math_Lerp,
|
|
8180
8192
|
Le as _Math_LngLatToPlane,
|
|
8181
|
-
|
|
8182
|
-
|
|
8193
|
+
sr as _Math_NormalizeAngle,
|
|
8194
|
+
$n as _Math_PlaneToLngLat,
|
|
8183
8195
|
Us as _Math_PointToLineDistance,
|
|
8184
|
-
|
|
8185
|
-
|
|
8196
|
+
ir as _Math_RadToDeg,
|
|
8197
|
+
tr as _Math_Remap,
|
|
8186
8198
|
kt as _Tip,
|
|
8187
8199
|
di as _Utility_Clone,
|
|
8188
8200
|
hi as _Utility_ColorConverter,
|
|
8189
8201
|
ze as _Utility_Debounce,
|
|
8190
|
-
|
|
8202
|
+
vn as _Utility_ExecuteWhenIdle,
|
|
8191
8203
|
oe as _Utility_GenerateUUID,
|
|
8192
|
-
|
|
8204
|
+
wn as _Utility_GetTargetByPath,
|
|
8193
8205
|
ct as _Utility_MergeObjects,
|
|
8194
|
-
|
|
8195
|
-
|
|
8206
|
+
bn as _Utility_RotateList,
|
|
8207
|
+
xn as _Utility_SetTargetByPath,
|
|
8196
8208
|
Ee as _Utility_ShortcutManager,
|
|
8197
|
-
|
|
8198
|
-
|
|
8209
|
+
Pn as _Utility_Sleep,
|
|
8210
|
+
yn as _Utility_Throttle,
|
|
8199
8211
|
fi as _Utility_TimeConsumption,
|
|
8200
|
-
|
|
8212
|
+
gn as _Utility_UndoRedoHistory,
|
|
8201
8213
|
ui as _Utility_WaitForCondition,
|
|
8202
|
-
|
|
8214
|
+
pn as _Valid_CheckConnectionWithXHR,
|
|
8203
8215
|
re as _Valid_DataType,
|
|
8204
|
-
|
|
8216
|
+
fn as _Valid_DoesInfiniteLineIntersectRectangle,
|
|
8205
8217
|
_e as _Valid_FileTypeChecker,
|
|
8206
8218
|
Gt as _Valid_Is2DNumberArray,
|
|
8207
|
-
|
|
8219
|
+
un as _Valid_IsInMargin,
|
|
8208
8220
|
xe as _Valid_IsNumberArray,
|
|
8209
|
-
|
|
8210
|
-
|
|
8221
|
+
dn as _Valid_IsPointInPolygon,
|
|
8222
|
+
mn as _Valid_IsSecureContext
|
|
8211
8223
|
};
|