nhanh-pure-function 2.0.5 → 3.0.0
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/Animate/index.d.ts +45 -0
- package/dist/Animate/type.d.ts +0 -0
- package/dist/Blob/index.d.ts +10 -0
- package/dist/Blob/type.d.ts +0 -0
- package/dist/Browser/index.d.ts +52 -0
- package/dist/Browser/type.d.ts +0 -0
- package/dist/{User → Element}/index.d.ts +11 -11
- package/dist/File/index.d.ts +19 -0
- package/dist/File/type.d.ts +0 -0
- package/dist/Format/index.d.ts +75 -0
- package/dist/Format/type.d.ts +0 -0
- package/dist/Math/index.d.ts +26 -55
- package/dist/Math/type.d.ts +0 -4
- package/dist/Utility/index.d.ts +22 -223
- package/dist/Valid/index.d.ts +122 -0
- package/dist/Valid/type.d.ts +4 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.es.js +719 -624
- package/package.json +1 -1
- /package/dist/{User → Element}/type.d.ts +0 -0
package/dist/index.es.js
CHANGED
|
@@ -1,12 +1,209 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".nhanh-pure-function{--nhanh: 2233}.no-select{-webkit-user-select:none;-ms-user-select:none;user-select:none}")),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
2
|
-
var
|
|
3
|
-
var
|
|
2
|
+
var it = Object.defineProperty;
|
|
3
|
+
var Q = (n) => {
|
|
4
4
|
throw TypeError(n);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var c = (n,
|
|
9
|
-
|
|
6
|
+
var st = (n, e, t) => e in n ? it(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
7
|
+
var E = (n, e, t) => st(n, typeof e != "symbol" ? e + "" : e, t), tt = (n, e, t) => e.has(n) || Q("Cannot " + t);
|
|
8
|
+
var c = (n, e, t) => (tt(n, e, "read from private field"), t ? t.call(n) : e.get(n)), h = (n, e, t) => e.has(n) ? Q("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), m = (n, e, t, o) => (tt(n, e, "write to private field"), o ? o.call(n, t) : e.set(n, t), t);
|
|
9
|
+
function vt(n, e = 500) {
|
|
10
|
+
let t, o = !0;
|
|
11
|
+
function r(i) {
|
|
12
|
+
if (!o) return;
|
|
13
|
+
t || (t = i);
|
|
14
|
+
let s = Math.min((i - t) / e, 1);
|
|
15
|
+
n(s), i - t < e && requestAnimationFrame(r);
|
|
16
|
+
}
|
|
17
|
+
return requestAnimationFrame(r), () => o = !1;
|
|
18
|
+
}
|
|
19
|
+
function bt(n, e, t, o, r = 2) {
|
|
20
|
+
let i = n, s = !1, a = 1, u = n, l = e, d = t;
|
|
21
|
+
const f = () => {
|
|
22
|
+
const x = (l - u) / d;
|
|
23
|
+
return Number(x.toFixed(r));
|
|
24
|
+
};
|
|
25
|
+
let w = f();
|
|
26
|
+
const L = (x) => Math.min(Math.max(x, u), l), A = (x) => Number(x.toFixed(r)), B = (x, X, H) => {
|
|
27
|
+
const I = [];
|
|
28
|
+
return x >= X && I.push("最小值必须小于最大值"), H <= 0 && I.push("分段数必须为正数"), I;
|
|
29
|
+
}, rt = (x, X, H) => {
|
|
30
|
+
const I = B(x, X, H);
|
|
31
|
+
return I.length > 0 ? (console.error(`参数更新失败: ${I.join("; ")}`), !1) : (u = x, l = X, d = H, w = f(), i = L(i), !0);
|
|
32
|
+
}, J = () => {
|
|
33
|
+
s && (a = i >= l ? -1 : i <= u ? 1 : a, i = L(i + w * a), o(A(i)), requestAnimationFrame(J));
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
/** 启动/继续动画 */
|
|
37
|
+
play(x = i) {
|
|
38
|
+
if (i = L(x), B(u, l, d).length)
|
|
39
|
+
return console.warn("配置参数错误", this.getParams());
|
|
40
|
+
s || (s = !0, J());
|
|
41
|
+
},
|
|
42
|
+
/** 暂停动画 */
|
|
43
|
+
pause() {
|
|
44
|
+
s = !1;
|
|
45
|
+
},
|
|
46
|
+
/** 获取当前值 */
|
|
47
|
+
getCurrent: () => A(i),
|
|
48
|
+
/** 是否正在运行 */
|
|
49
|
+
isPlaying: () => s,
|
|
50
|
+
/** 更新参数(不中断动画) */
|
|
51
|
+
updateParams: rt,
|
|
52
|
+
/** 获取当前参数 */
|
|
53
|
+
getParams: () => ({ min: u, max: l, steps: d, precision: r, stepSize: w })
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function _t(n, e, t, o, r = 2) {
|
|
57
|
+
if (t <= 0) return;
|
|
58
|
+
const i = (f) => Number(f.toFixed(r)), s = e - n, a = i(Math.abs(s) / t);
|
|
59
|
+
if (a === 0) return;
|
|
60
|
+
const u = Math.sign(s);
|
|
61
|
+
let l = n;
|
|
62
|
+
const d = () => {
|
|
63
|
+
l = i(l + a * u), (u > 0 ? l < e : l > e) ? (o(l), requestAnimationFrame(d)) : o(e);
|
|
64
|
+
};
|
|
65
|
+
d();
|
|
66
|
+
}
|
|
67
|
+
function Et(n, e = "image/png") {
|
|
68
|
+
try {
|
|
69
|
+
let t, o = e;
|
|
70
|
+
if (n instanceof File)
|
|
71
|
+
return URL.createObjectURL(n);
|
|
72
|
+
if (typeof n == "string") {
|
|
73
|
+
let i = n;
|
|
74
|
+
const s = i.match(/^data:([^;]*)(;base64)?,(.*)$/i);
|
|
75
|
+
if (s) {
|
|
76
|
+
if (!s[2])
|
|
77
|
+
return console.error("无效的数据 URL:缺少 base64 编码声明");
|
|
78
|
+
if (o = s[1] || o, i = s[3], !i)
|
|
79
|
+
return console.error("数据 URL 包含空有效负载");
|
|
80
|
+
}
|
|
81
|
+
i = i.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
82
|
+
const a = atob(i);
|
|
83
|
+
t = new Uint8Array(a.length);
|
|
84
|
+
for (let u = 0; u < a.length; u++)
|
|
85
|
+
t[u] = a.charCodeAt(u);
|
|
86
|
+
} else if (n instanceof ArrayBuffer)
|
|
87
|
+
t = new Uint8Array(n);
|
|
88
|
+
else if (n instanceof Uint8Array)
|
|
89
|
+
t = n;
|
|
90
|
+
else
|
|
91
|
+
return console.error(
|
|
92
|
+
"不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array"
|
|
93
|
+
);
|
|
94
|
+
const r = new Blob([t], { type: o });
|
|
95
|
+
return URL.createObjectURL(r);
|
|
96
|
+
} catch (t) {
|
|
97
|
+
return console.error(
|
|
98
|
+
"数据到 ImageURL 的转换失败:",
|
|
99
|
+
t.message,
|
|
100
|
+
t.stack || "没有可用的堆栈跟踪"
|
|
101
|
+
), null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function Mt(n, e = 10) {
|
|
105
|
+
let t = 0, o = e;
|
|
106
|
+
function r() {
|
|
107
|
+
if (o > 0)
|
|
108
|
+
o--, requestAnimationFrame(r);
|
|
109
|
+
else {
|
|
110
|
+
const s = (+/* @__PURE__ */ new Date() - t) / e, a = 1e3 / s;
|
|
111
|
+
n(Number(a.toFixed(2)), Number(s.toFixed(2)));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
requestAnimationFrame(() => {
|
|
115
|
+
t = +/* @__PURE__ */ new Date(), r();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function Ft(n) {
|
|
119
|
+
const e = () => Promise.resolve(), t = (a) => (console.error(a), Promise.reject(a));
|
|
120
|
+
function o() {
|
|
121
|
+
return navigator.clipboard.writeText(n).then(e).catch(t);
|
|
122
|
+
}
|
|
123
|
+
function r() {
|
|
124
|
+
const a = document.createElement("div");
|
|
125
|
+
a.innerText = n, document.body.appendChild(a);
|
|
126
|
+
const u = document.createRange();
|
|
127
|
+
u.selectNodeContents(a);
|
|
128
|
+
const l = window.getSelection();
|
|
129
|
+
let d = !1;
|
|
130
|
+
return l && (l.removeAllRanges(), l.addRange(u), d = document.execCommand("copy")), document.body.removeChild(a), d ? Promise.resolve() : Promise.reject();
|
|
131
|
+
}
|
|
132
|
+
function i() {
|
|
133
|
+
const a = document.createElement("textarea");
|
|
134
|
+
a.value = n, document.body.appendChild(a), a.select(), a.setSelectionRange(0, n.length);
|
|
135
|
+
let u = !1;
|
|
136
|
+
return document.activeElement === a && (u = document.execCommand("Copy", !0)), document.body.removeChild(a), u ? Promise.resolve() : Promise.reject();
|
|
137
|
+
}
|
|
138
|
+
function s() {
|
|
139
|
+
return r().then(e).catch(() => {
|
|
140
|
+
i().then(e).catch(() => t("复制方式尽皆失效"));
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return navigator.clipboard ? o().catch(s) : s();
|
|
144
|
+
}
|
|
145
|
+
class ct {
|
|
146
|
+
/** 请使用静态方法 */
|
|
147
|
+
constructor() {
|
|
148
|
+
}
|
|
149
|
+
/** 添加已有窗口 */
|
|
150
|
+
static add(e, t) {
|
|
151
|
+
this.keys.set(e, t);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* 根据键打开或聚焦窗口
|
|
155
|
+
* @param key 窗口的唯一键
|
|
156
|
+
* @param url 要打开的URL
|
|
157
|
+
* @param target 窗口的目标
|
|
158
|
+
* @param windowFeatures 新窗口的特性
|
|
159
|
+
* @returns 返回已打开或新打开的窗口
|
|
160
|
+
*/
|
|
161
|
+
static open(e, t, o, r) {
|
|
162
|
+
const i = this.keys.get(e);
|
|
163
|
+
if (i && !i.closed)
|
|
164
|
+
return i.focus(), i;
|
|
165
|
+
{
|
|
166
|
+
const s = window.open(t, o, r);
|
|
167
|
+
if (s)
|
|
168
|
+
return this.keys.set(e, s), s;
|
|
169
|
+
console.error("window.open failed: 可能是浏览器阻止了弹出窗口"), this.keys.delete(e);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* 检查指定键的窗口是否打开
|
|
174
|
+
* @param key 窗口的唯一键
|
|
175
|
+
* @returns 如果窗口打开则返回true,否则返回false
|
|
176
|
+
*/
|
|
177
|
+
static isOpen(e) {
|
|
178
|
+
const t = this.keys.get(e);
|
|
179
|
+
return t != null && t.closed && this.keys.delete(e), this.keys.has(e);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* 获取与指定键关联的窗口
|
|
183
|
+
* @param key 窗口的唯一键
|
|
184
|
+
* @returns 返回对应的窗口,如果窗口已关闭则返回undefined
|
|
185
|
+
*/
|
|
186
|
+
static getWindow(e) {
|
|
187
|
+
if (this.isOpen(e)) return this.keys.get(e);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* 关闭与指定键关联的窗口
|
|
191
|
+
* @param key 窗口的唯一键
|
|
192
|
+
*/
|
|
193
|
+
static close(e) {
|
|
194
|
+
const t = this.keys.get(e);
|
|
195
|
+
t && (t.close(), this.keys.delete(e));
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* 关闭所有打开的窗口并清空Map
|
|
199
|
+
*/
|
|
200
|
+
static closeAll() {
|
|
201
|
+
this.keys.forEach((e, t) => e.close()), this.keys.clear();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// 存储键与对应窗口的Map
|
|
205
|
+
E(ct, "keys", /* @__PURE__ */ new Map());
|
|
206
|
+
const at = {
|
|
10
207
|
/* 常见扩展名映射 */
|
|
11
208
|
".mp3": "audio/mpeg",
|
|
12
209
|
".mp4": "video/mp4",
|
|
@@ -70,7 +267,7 @@ const te = {
|
|
|
70
267
|
".eot": "application/vnd.ms-fontobject",
|
|
71
268
|
".map": "application/json"
|
|
72
269
|
// 可根据需要继续扩展
|
|
73
|
-
},
|
|
270
|
+
}, V = {
|
|
74
271
|
image: [
|
|
75
272
|
".jpg",
|
|
76
273
|
".jpeg",
|
|
@@ -250,7 +447,7 @@ const te = {
|
|
|
250
447
|
".awk",
|
|
251
448
|
".php"
|
|
252
449
|
]
|
|
253
|
-
},
|
|
450
|
+
}, et = [
|
|
254
451
|
"",
|
|
255
452
|
"万",
|
|
256
453
|
"亿",
|
|
@@ -265,67 +462,37 @@ const te = {
|
|
|
265
462
|
"载",
|
|
266
463
|
"极"
|
|
267
464
|
];
|
|
268
|
-
function
|
|
269
|
-
return n
|
|
270
|
-
}
|
|
271
|
-
function ue(n) {
|
|
272
|
-
return !(n === null || typeof n != "object" || Array.isArray(n));
|
|
465
|
+
function Ct(n) {
|
|
466
|
+
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
273
467
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
276
|
-
return console.error("非函数:", n);
|
|
277
|
-
const t = function(e) {
|
|
278
|
-
e.didTimeout || e.timeRemaining() <= 0 ? requestIdleCallback(t) : n();
|
|
279
|
-
};
|
|
280
|
-
requestIdleCallback(t);
|
|
468
|
+
function Pt(n, e, t = 2) {
|
|
469
|
+
return !Number.isFinite(n) || !Number.isFinite(e) || !Number.isFinite(t) ? (console.error("所有参数必须是有限的数字"), "") : e === 0 ? (console.error("分母不能为零"), "") : t < 0 ? (console.error("小数位数不能为负数"), "") : (n / e * 100).toFixed(t) + "%";
|
|
281
470
|
}
|
|
282
|
-
function
|
|
283
|
-
const
|
|
284
|
-
return
|
|
285
|
-
const i = () => {
|
|
286
|
-
if (+/* @__PURE__ */ new Date() - e >= t) return r("超时");
|
|
287
|
-
if (n()) return o("完成");
|
|
288
|
-
requestIdleCallback(i);
|
|
289
|
-
};
|
|
290
|
-
i();
|
|
291
|
-
});
|
|
471
|
+
function Lt(n) {
|
|
472
|
+
const t = n.toString().split("."), o = t[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
473
|
+
return t.length > 1 ? o + "." + t[1] : o;
|
|
292
474
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
|
|
296
|
-
"
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
475
|
+
function Ut(n, e) {
|
|
476
|
+
const t = {
|
|
477
|
+
join: !0,
|
|
478
|
+
suffix: "",
|
|
479
|
+
decimalPlaces: 2
|
|
480
|
+
}, { join: o, suffix: r, decimalPlaces: i } = {
|
|
481
|
+
...t,
|
|
482
|
+
...e || {}
|
|
483
|
+
}, s = Number(n);
|
|
484
|
+
if (isNaN(s)) return o ? `0${r}` : [0, r];
|
|
485
|
+
const a = Math.abs(s), u = s >= 0, l = Math.max(0, Math.floor(Math.log10(a) / 4)), d = Math.pow(1e4, l), f = a / d, w = (u ? 1 : -1) * parseFloat(f.toFixed(Math.max(0, i)));
|
|
486
|
+
return o ? `${w}${et[l]}${r}` : [w, et[l] + r];
|
|
304
487
|
}
|
|
305
|
-
function
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
if (r != i) return t;
|
|
312
|
-
if (r == "object" || r == "array") {
|
|
313
|
-
if (e.some(([s, a]) => s == n && a == t)) return n;
|
|
314
|
-
if (e.push([n, t]), r == "object") {
|
|
315
|
-
for (const s in t)
|
|
316
|
-
if (Object.prototype.hasOwnProperty.call(t, s)) {
|
|
317
|
-
const a = t[s], u = n[s], l = B(u, a, e, o);
|
|
318
|
-
n[s] = l;
|
|
319
|
-
}
|
|
320
|
-
return n;
|
|
321
|
-
} else if (r == "array")
|
|
322
|
-
return t.forEach((s, a) => {
|
|
323
|
-
const u = s, l = n[a], f = B(l, u, e, o);
|
|
324
|
-
n[a] = f;
|
|
325
|
-
}), n;
|
|
326
|
-
} else return t;
|
|
488
|
+
function Tt(n) {
|
|
489
|
+
const e = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
490
|
+
let t = 0;
|
|
491
|
+
for (; n > 1024; )
|
|
492
|
+
n /= 1024, t++;
|
|
493
|
+
return `${Math.round(n * 100) / 100} ${e[t]}`;
|
|
327
494
|
}
|
|
328
|
-
function
|
|
495
|
+
function jt(n, e = "YYYY-MM-DD hh:mm:ss", t = !0) {
|
|
329
496
|
const o = new Date(n);
|
|
330
497
|
if (isNaN(o.getTime()))
|
|
331
498
|
return console.error("Invalid date"), "";
|
|
@@ -339,158 +506,53 @@ function pe(n, t = "YYYY-MM-DD hh:mm:ss", e = !0) {
|
|
|
339
506
|
ss: (i) => i.getSeconds(),
|
|
340
507
|
ms: (i) => i.getMilliseconds()
|
|
341
508
|
};
|
|
342
|
-
return
|
|
509
|
+
return e.replace(/YYYY|MM|DD|hh|mm|ss|ms/g, (i) => {
|
|
343
510
|
const s = r[i](o);
|
|
344
|
-
return
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
function ge(n) {
|
|
348
|
-
return new Promise((t, e) => {
|
|
349
|
-
fetch(n).then((o) => t(o.text())).catch((o) => {
|
|
350
|
-
console.error("Error fetching :", o), e(o);
|
|
351
|
-
});
|
|
511
|
+
return t ? String(s).padStart(2, "0") : String(s);
|
|
352
512
|
});
|
|
353
513
|
}
|
|
354
|
-
function
|
|
355
|
-
if (!n || (n = String(n).trim(), n === "")) return
|
|
356
|
-
const
|
|
357
|
-
return
|
|
514
|
+
function Z(n, e = "file") {
|
|
515
|
+
if (!n || (n = String(n).trim(), n === "")) return e;
|
|
516
|
+
const t = n.split("/");
|
|
517
|
+
return t[t.length - 1].split("?")[0];
|
|
358
518
|
}
|
|
359
|
-
function
|
|
360
|
-
return
|
|
361
|
-
try {
|
|
362
|
-
t = t || H(n, "downloaded_file"), fetch(n).then((r) => (r.ok || o(`文件下载失败,状态码: ${r.status}`), r.blob())).then((r) => {
|
|
363
|
-
const i = URL.createObjectURL(r), s = document.createElement("a");
|
|
364
|
-
s.href = i, s.download = decodeURIComponent(t), document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(i), e(r);
|
|
365
|
-
}).catch(o);
|
|
366
|
-
} catch (r) {
|
|
367
|
-
o(r);
|
|
368
|
-
}
|
|
369
|
-
});
|
|
519
|
+
function Rt(n, e) {
|
|
520
|
+
return n = n.replace(/([^a-zA-Z][a-z])/g, (t) => t.toUpperCase()), e ? n.replace(/[^a-zA-Z]+/g, "") : n;
|
|
370
521
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
n(Number(a.toFixed(2)), Number(s.toFixed(2)));
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
requestAnimationFrame(() => {
|
|
382
|
-
e = +/* @__PURE__ */ new Date(), r();
|
|
522
|
+
function At(n, e, t = ",") {
|
|
523
|
+
const o = new RegExp(
|
|
524
|
+
`(^|${t})${e}(${t}|$)`,
|
|
525
|
+
"g"
|
|
526
|
+
);
|
|
527
|
+
return n.replace(o, function(r, i, s) {
|
|
528
|
+
return i === s ? t : "";
|
|
383
529
|
});
|
|
384
530
|
}
|
|
385
|
-
function
|
|
386
|
-
return n
|
|
387
|
-
}
|
|
388
|
-
function be(n, t, e) {
|
|
389
|
-
if (!e) {
|
|
390
|
-
let s = t.replace(/^[^.]+./, "");
|
|
391
|
-
s = s == t ? "text/plain" : "application/" + s, e = { type: s };
|
|
392
|
-
}
|
|
393
|
-
const o = new Blob(n, e), r = URL.createObjectURL(o), i = document.createElement("a");
|
|
394
|
-
i.href = r, i.download = t, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
|
|
531
|
+
function It(n) {
|
|
532
|
+
return !(n === null || typeof n != "object" || Array.isArray(n));
|
|
395
533
|
}
|
|
396
|
-
function
|
|
397
|
-
return n
|
|
398
|
-
const e = Math.random() * 16 | 0;
|
|
399
|
-
return (t === "x" ? e : e & 3 | 8).toString(16);
|
|
400
|
-
});
|
|
534
|
+
function lt(n, e = 2) {
|
|
535
|
+
return Array.isArray(n) && n.length >= e && n.every((t) => typeof t == "number" && Number.isFinite(t));
|
|
401
536
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
404
|
-
return function(...o) {
|
|
405
|
-
clearTimeout(e), e = setTimeout(() => {
|
|
406
|
-
n(...o), e = void 0;
|
|
407
|
-
}, t);
|
|
408
|
-
};
|
|
537
|
+
function kt(n, e = 1, t = 2) {
|
|
538
|
+
return Array.isArray(n) && n.length >= e && n.every((o) => lt(o, t));
|
|
409
539
|
}
|
|
410
|
-
function
|
|
411
|
-
|
|
412
|
-
return function(...o) {
|
|
413
|
-
const r = performance.now();
|
|
414
|
-
if (r - e > t) {
|
|
415
|
-
e = r;
|
|
416
|
-
try {
|
|
417
|
-
n(...o);
|
|
418
|
-
} catch (i) {
|
|
419
|
-
console.error("Throttled function execution failed:", i);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
}
|
|
424
|
-
function V(n) {
|
|
425
|
-
return Array.isArray(n) ? "array" : n === null ? "null" : typeof n;
|
|
540
|
+
function St(n, e, t) {
|
|
541
|
+
return Math.abs(n - e) <= t;
|
|
426
542
|
}
|
|
427
|
-
function
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const a = document.createElement("div");
|
|
434
|
-
a.innerText = n, document.body.appendChild(a);
|
|
435
|
-
const u = document.createRange();
|
|
436
|
-
u.selectNodeContents(a);
|
|
437
|
-
const l = window.getSelection();
|
|
438
|
-
let f = !1;
|
|
439
|
-
return l && (l.removeAllRanges(), l.addRange(u), f = document.execCommand("copy")), document.body.removeChild(a), f ? Promise.resolve() : Promise.reject();
|
|
440
|
-
}
|
|
441
|
-
function i() {
|
|
442
|
-
const a = document.createElement("textarea");
|
|
443
|
-
a.value = n, document.body.appendChild(a), a.select(), a.setSelectionRange(0, n.length);
|
|
444
|
-
let u = !1;
|
|
445
|
-
return document.activeElement === a && (u = document.execCommand("Copy", !0)), document.body.removeChild(a), u ? Promise.resolve() : Promise.reject();
|
|
446
|
-
}
|
|
447
|
-
function s() {
|
|
448
|
-
return r().then(t).catch(() => {
|
|
449
|
-
i().then(t).catch(() => e("复制方式尽皆失效"));
|
|
450
|
-
});
|
|
543
|
+
function Dt(n, e) {
|
|
544
|
+
let t = !1;
|
|
545
|
+
const { x: o, y: r } = n, i = e.length;
|
|
546
|
+
for (let s = 0, a = i - 1; s < i; a = s++) {
|
|
547
|
+
const u = e[s].x, l = e[s].y, d = e[a].x, f = e[a].y;
|
|
548
|
+
l > r != f > r && o < (d - u) * (r - l) / (f - l) + u && (t = !t);
|
|
451
549
|
}
|
|
452
|
-
return
|
|
550
|
+
return t;
|
|
453
551
|
}
|
|
454
|
-
function
|
|
455
|
-
|
|
456
|
-
return e.reduce((o, r, i) => (r in o || (i === e.length - 1 ? o[r] = void 0 : o[r] = {}), o[r]), n);
|
|
457
|
-
}
|
|
458
|
-
function Me(n, t) {
|
|
459
|
-
const e = t.split(".");
|
|
460
|
-
return e.reduce((o, r, i) => o.hasOwnProperty(r) ? o[r] : o[r] = i == e.length - 1 ? void 0 : {}, n);
|
|
461
|
-
}
|
|
462
|
-
function Te(n, t, e) {
|
|
463
|
-
const o = t.split(".");
|
|
464
|
-
return o.reduce((r, i, s) => (s === o.length - 1 && (r[i] = e), r[i]), n);
|
|
465
|
-
}
|
|
466
|
-
function Le(n) {
|
|
467
|
-
return new Promise((t, e) => {
|
|
468
|
-
if (typeof n != "string" || n.trim() === "" || !n.includes("://")) {
|
|
469
|
-
e(new Error("Invalid URL: Must be a non-empty string"));
|
|
470
|
-
return;
|
|
471
|
-
}
|
|
472
|
-
try {
|
|
473
|
-
new XMLHttpRequest().open("HEAD", n, !0);
|
|
474
|
-
} catch (i) {
|
|
475
|
-
e(new Error(`Invalid URL format: ${i.message}`));
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
const o = new XMLHttpRequest();
|
|
479
|
-
o.open("HEAD", n, !0);
|
|
480
|
-
const r = (i) => {
|
|
481
|
-
e(new Error(`Request failed: ${i.type}`));
|
|
482
|
-
};
|
|
483
|
-
o.onreadystatechange = function() {
|
|
484
|
-
o.readyState === XMLHttpRequest.DONE && (o.status === 0 ? e(new Error("Network error or CORS blocked")) : o.status >= 200 && o.status < 300 ? t(!0) : e(new Error(`HTTP Error: ${o.status}`)));
|
|
485
|
-
}, o.onerror = r, o.onabort = r, o.ontimeout = r;
|
|
486
|
-
try {
|
|
487
|
-
o.send();
|
|
488
|
-
} catch (i) {
|
|
489
|
-
e(new Error(`Request send failed: ${i.message}`));
|
|
490
|
-
}
|
|
491
|
-
});
|
|
552
|
+
function nt(n) {
|
|
553
|
+
return Array.isArray(n) ? "array" : n === null ? "null" : typeof n;
|
|
492
554
|
}
|
|
493
|
-
function
|
|
555
|
+
function zt(n) {
|
|
494
556
|
return [
|
|
495
557
|
"https:",
|
|
496
558
|
// HTTPS协议,用于安全地浏览网页
|
|
@@ -512,24 +574,51 @@ function je(n) {
|
|
|
512
574
|
// Remote Desktop Protocol,用于安全的远程桌面连接
|
|
513
575
|
"vpn:"
|
|
514
576
|
// VPN协议,用于创建安全的网络连接
|
|
515
|
-
].some((
|
|
577
|
+
].some((t) => n.startsWith(t));
|
|
516
578
|
}
|
|
517
|
-
|
|
579
|
+
function Ot(n) {
|
|
580
|
+
return new Promise((e, t) => {
|
|
581
|
+
if (typeof n != "string" || n.trim() === "" || !n.includes("://")) {
|
|
582
|
+
t(new Error("Invalid URL: Must be a non-empty string"));
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
try {
|
|
586
|
+
new XMLHttpRequest().open("HEAD", n, !0);
|
|
587
|
+
} catch (i) {
|
|
588
|
+
t(new Error(`Invalid URL format: ${i.message}`));
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
const o = new XMLHttpRequest();
|
|
592
|
+
o.open("HEAD", n, !0);
|
|
593
|
+
const r = (i) => {
|
|
594
|
+
t(new Error(`Request failed: ${i.type}`));
|
|
595
|
+
};
|
|
596
|
+
o.onreadystatechange = function() {
|
|
597
|
+
o.readyState === XMLHttpRequest.DONE && (o.status === 0 ? t(new Error("Network error or CORS blocked")) : o.status >= 200 && o.status < 300 ? e(!0) : t(new Error(`HTTP Error: ${o.status}`)));
|
|
598
|
+
}, o.onerror = r, o.onabort = r, o.ontimeout = r;
|
|
599
|
+
try {
|
|
600
|
+
o.send();
|
|
601
|
+
} catch (i) {
|
|
602
|
+
t(new Error(`Request send failed: ${i.message}`));
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
const C = class C {
|
|
518
607
|
constructor() {
|
|
519
|
-
if (new.target ===
|
|
608
|
+
if (new.target === C)
|
|
520
609
|
throw new Error("请直接使用静态方法,而不是实例化此类");
|
|
521
610
|
}
|
|
522
|
-
static check(
|
|
523
|
-
if (!
|
|
524
|
-
return console.error("Invalid URL provided"),
|
|
525
|
-
const o =
|
|
526
|
-
if (
|
|
527
|
-
if (!
|
|
528
|
-
return console.error(`Unknown file type: ${
|
|
529
|
-
const r =
|
|
530
|
-
return
|
|
611
|
+
static check(e, t) {
|
|
612
|
+
if (!e || typeof e != "string")
|
|
613
|
+
return console.error("Invalid URL provided"), t ? !1 : "unknown";
|
|
614
|
+
const o = Z(e).toLowerCase();
|
|
615
|
+
if (t) {
|
|
616
|
+
if (!V.hasOwnProperty(t))
|
|
617
|
+
return console.error(`Unknown file type: ${t}`), "unknown";
|
|
618
|
+
const r = V[t];
|
|
619
|
+
return C._checkExtension(o, r);
|
|
531
620
|
}
|
|
532
|
-
return
|
|
621
|
+
return C._detectFileType(o);
|
|
533
622
|
}
|
|
534
623
|
/**
|
|
535
624
|
* 静态方法,用于解析地址信息
|
|
@@ -539,10 +628,10 @@ const F = class F {
|
|
|
539
628
|
* @param {string} url - 以逗号分隔的URL字符串,每个URL代表一个资源的位置
|
|
540
629
|
* @returns {Array} - 包含每个URL及其相关信息(名称和类型)的对象数组
|
|
541
630
|
*/
|
|
542
|
-
static parseAddresses(
|
|
543
|
-
return !
|
|
544
|
-
const o =
|
|
545
|
-
return { url:
|
|
631
|
+
static parseAddresses(e) {
|
|
632
|
+
return !e || typeof e != "string" ? (console.error("Invalid URL provided"), []) : e.split(",").map((t) => {
|
|
633
|
+
const o = Z(t), r = this.check(t);
|
|
634
|
+
return { url: t, name: o, type: r };
|
|
546
635
|
});
|
|
547
636
|
}
|
|
548
637
|
/**
|
|
@@ -551,10 +640,10 @@ const F = class F {
|
|
|
551
640
|
* @param {string} [accept] - 可接受的 MIME 类型模式(如 "image/*, text/plain")
|
|
552
641
|
* @returns {boolean} - 如果类型匹配,则返回 true,否则返回 false
|
|
553
642
|
*/
|
|
554
|
-
static matchesMimeType(
|
|
555
|
-
if (!
|
|
556
|
-
if (typeof
|
|
557
|
-
const o =
|
|
643
|
+
static matchesMimeType(e, t) {
|
|
644
|
+
if (!t) return !0;
|
|
645
|
+
if (typeof e != "string" || typeof t != "string") return !1;
|
|
646
|
+
const o = C._normalizeType(e), r = t.split(",").map((a) => C._normalizeType(a.trim())), [i, s = "*"] = o.split("/");
|
|
558
647
|
return r.some((a) => {
|
|
559
648
|
const [u, l = "*"] = a.split("/");
|
|
560
649
|
return (u === "*" || i === "*" || u === i) && (l === "*" || s === "*" || l === s);
|
|
@@ -568,8 +657,8 @@ const F = class F {
|
|
|
568
657
|
* @param {string} type - 文件类型或MIME类型字符串
|
|
569
658
|
* @returns {string} 标准化的MIME类型字符串,如果无法识别则返回原始输入
|
|
570
659
|
*/
|
|
571
|
-
static _normalizeType(
|
|
572
|
-
return
|
|
660
|
+
static _normalizeType(e) {
|
|
661
|
+
return e.startsWith(".") && !e.includes("/") ? at[e.toLowerCase()] || e : e.includes("/") ? e : `${e}/*`;
|
|
573
662
|
}
|
|
574
663
|
/**
|
|
575
664
|
* 检查URL是否具有任何指定的文件扩展名
|
|
@@ -577,141 +666,133 @@ const F = class F {
|
|
|
577
666
|
* @param {string[]} validExtensions - 有效文件扩展名的数组
|
|
578
667
|
* @returns {boolean} - 如果URL具有任何指定的文件扩展名,则返回true,否则返回false
|
|
579
668
|
*/
|
|
580
|
-
static _checkExtension(
|
|
581
|
-
return
|
|
669
|
+
static _checkExtension(e, t) {
|
|
670
|
+
return t.some((o) => e.endsWith(o));
|
|
582
671
|
}
|
|
583
672
|
/**
|
|
584
673
|
* 检测文件URL的类型
|
|
585
674
|
* @param {string} url - 文件的URL
|
|
586
675
|
* @returns {string} - 如果URL与任何已知类型匹配,则返回文件类型,否则返回"unknown"
|
|
587
676
|
*/
|
|
588
|
-
static _detectFileType(
|
|
589
|
-
for (const [
|
|
590
|
-
if (o.some((r) =>
|
|
591
|
-
return
|
|
677
|
+
static _detectFileType(e) {
|
|
678
|
+
for (const [t, o] of C.cachedEntries)
|
|
679
|
+
if (o.some((r) => e.endsWith(r)))
|
|
680
|
+
return t;
|
|
592
681
|
return "unknown";
|
|
593
682
|
}
|
|
594
683
|
};
|
|
595
684
|
// 缓存文件扩展名的条目,以提高性能
|
|
596
|
-
|
|
597
|
-
let
|
|
598
|
-
function
|
|
599
|
-
|
|
685
|
+
E(C, "cachedEntries", Object.entries(V));
|
|
686
|
+
let ot = C;
|
|
687
|
+
function Nt(n) {
|
|
688
|
+
if (typeof n != "function")
|
|
689
|
+
return console.error("非函数:", n);
|
|
690
|
+
const e = function(t) {
|
|
691
|
+
t.didTimeout || t.timeRemaining() <= 0 ? requestIdleCallback(e) : n();
|
|
692
|
+
};
|
|
693
|
+
requestIdleCallback(e);
|
|
600
694
|
}
|
|
601
|
-
function
|
|
602
|
-
const t =
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
695
|
+
function qt(n, e) {
|
|
696
|
+
const t = +/* @__PURE__ */ new Date();
|
|
697
|
+
return new Promise((o, r) => {
|
|
698
|
+
const i = () => {
|
|
699
|
+
if (+/* @__PURE__ */ new Date() - t >= e) return r("超时");
|
|
700
|
+
if (n()) return o("完成");
|
|
701
|
+
requestIdleCallback(i);
|
|
702
|
+
};
|
|
703
|
+
i();
|
|
704
|
+
});
|
|
608
705
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
*/
|
|
614
|
-
constructor() {
|
|
615
|
-
if (new.target === N)
|
|
616
|
-
throw new Error("请直接使用静态方法,而不是实例化此类");
|
|
706
|
+
function K(n, e, t = [], o = +/* @__PURE__ */ new Date()) {
|
|
707
|
+
if (o < +/* @__PURE__ */ new Date() - 50) {
|
|
708
|
+
console.error("_MergeObjects 合并异常:疑似死循环");
|
|
709
|
+
return;
|
|
617
710
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
711
|
+
const r = nt(n), i = nt(e);
|
|
712
|
+
if (r != i) return e;
|
|
713
|
+
if (r == "object" || r == "array") {
|
|
714
|
+
if (t.some(([s, a]) => s == n && a == e)) return n;
|
|
715
|
+
if (t.push([n, e]), r == "object") {
|
|
716
|
+
for (const s in e)
|
|
717
|
+
if (Object.prototype.hasOwnProperty.call(e, s)) {
|
|
718
|
+
const a = e[s], u = n[s], l = K(
|
|
719
|
+
u,
|
|
720
|
+
a,
|
|
721
|
+
t,
|
|
722
|
+
o
|
|
723
|
+
);
|
|
724
|
+
n[s] = l;
|
|
725
|
+
}
|
|
726
|
+
return n;
|
|
727
|
+
} else if (r == "array")
|
|
728
|
+
return e.forEach((s, a) => {
|
|
729
|
+
const u = s, l = n[a], d = K(
|
|
730
|
+
l,
|
|
731
|
+
u,
|
|
732
|
+
t,
|
|
733
|
+
o
|
|
734
|
+
);
|
|
735
|
+
n[a] = d;
|
|
736
|
+
}), n;
|
|
737
|
+
} else return e;
|
|
738
|
+
}
|
|
739
|
+
function $t(n = "") {
|
|
740
|
+
return n + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
741
|
+
const t = Math.random() * 16 | 0;
|
|
742
|
+
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
function ut(n, e) {
|
|
746
|
+
let t;
|
|
747
|
+
return function(...o) {
|
|
748
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
749
|
+
n(...o), t = void 0;
|
|
750
|
+
}, e);
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
function Yt(n, e) {
|
|
754
|
+
let t = -1 / 0;
|
|
755
|
+
return function(...o) {
|
|
756
|
+
const r = performance.now();
|
|
757
|
+
if (r - t > e) {
|
|
758
|
+
t = r;
|
|
759
|
+
try {
|
|
760
|
+
n(...o);
|
|
761
|
+
} catch (i) {
|
|
762
|
+
console.error("Throttled function execution failed:", i);
|
|
763
|
+
}
|
|
635
764
|
}
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
* 关闭与指定键关联的窗口
|
|
656
|
-
* @param key 窗口的唯一键
|
|
657
|
-
*/
|
|
658
|
-
static close(t) {
|
|
659
|
-
const e = this.keys.get(t);
|
|
660
|
-
e && (e.close(), this.keys.delete(t));
|
|
661
|
-
}
|
|
662
|
-
/**
|
|
663
|
-
* 关闭所有打开的窗口并清空Map
|
|
664
|
-
*/
|
|
665
|
-
static closeAll() {
|
|
666
|
-
this.keys.forEach((t, e) => t.close()), this.keys.clear();
|
|
667
|
-
}
|
|
668
|
-
};
|
|
669
|
-
// 存储键与对应窗口的Map
|
|
670
|
-
y(N, "keys", /* @__PURE__ */ new Map());
|
|
671
|
-
let J = N;
|
|
672
|
-
function Ue(n, t = "image/png") {
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
function Bt(n, e) {
|
|
768
|
+
const t = e.split(".");
|
|
769
|
+
return t.reduce((o, r, i) => (r in o || (i === t.length - 1 ? o[r] = void 0 : o[r] = {}), o[r]), n);
|
|
770
|
+
}
|
|
771
|
+
function Xt(n, e) {
|
|
772
|
+
const t = e.split(".");
|
|
773
|
+
return t.reduce((o, r, i) => o.hasOwnProperty(r) ? o[r] : o[r] = i == t.length - 1 ? void 0 : {}, n);
|
|
774
|
+
}
|
|
775
|
+
function Ht(n, e, t) {
|
|
776
|
+
const o = e.split(".");
|
|
777
|
+
return o.reduce((r, i, s) => (s === o.length - 1 && (r[i] = t), r[i]), n);
|
|
778
|
+
}
|
|
779
|
+
function Wt(n) {
|
|
780
|
+
return n.map((e, t) => n.slice(t).concat(n.slice(0, t)));
|
|
781
|
+
}
|
|
782
|
+
function Gt(n) {
|
|
783
|
+
const e = window.structuredClone, t = (o) => o === null || typeof o != "object" ? o : K(Array.isArray(o) ? [] : {}, o);
|
|
673
784
|
try {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
if (typeof n == "string") {
|
|
678
|
-
let i = n;
|
|
679
|
-
const s = i.match(/^data:([^;]*)(;base64)?,(.*)$/i);
|
|
680
|
-
if (s) {
|
|
681
|
-
if (!s[2])
|
|
682
|
-
throw new Error("无效的数据 URL:缺少 base64 编码声明");
|
|
683
|
-
if (o = s[1] || o, i = s[3], !i)
|
|
684
|
-
throw new Error("数据 URL 包含空有效负载");
|
|
685
|
-
}
|
|
686
|
-
i = i.replace(/[^A-Za-z0-9+/=]/g, "");
|
|
687
|
-
const a = atob(i);
|
|
688
|
-
e = new Uint8Array(a.length);
|
|
689
|
-
for (let u = 0; u < a.length; u++)
|
|
690
|
-
e[u] = a.charCodeAt(u);
|
|
691
|
-
} else if (n instanceof ArrayBuffer)
|
|
692
|
-
e = new Uint8Array(n);
|
|
693
|
-
else if (n instanceof Uint8Array)
|
|
694
|
-
e = n;
|
|
695
|
-
else
|
|
696
|
-
throw new Error(
|
|
697
|
-
"不支持的数据类型。应为 Base64 字符串、ArrayBuffer 或 Uint8Array"
|
|
698
|
-
);
|
|
699
|
-
const r = new Blob([e], { type: o });
|
|
700
|
-
return URL.createObjectURL(r);
|
|
701
|
-
} catch (e) {
|
|
702
|
-
return console.error(
|
|
703
|
-
"数据到 ImageURL 的转换失败:",
|
|
704
|
-
e.message,
|
|
705
|
-
e.stack || "没有可用的堆栈跟踪"
|
|
706
|
-
), null;
|
|
785
|
+
return e ? e(n) : t(n);
|
|
786
|
+
} catch (o) {
|
|
787
|
+
return console.error("structuredClone error:", o), e && t(n);
|
|
707
788
|
}
|
|
708
789
|
}
|
|
709
|
-
function
|
|
790
|
+
function Vt(n, e, t = 30) {
|
|
710
791
|
if (typeof n != "function")
|
|
711
|
-
|
|
712
|
-
if (!Array.isArray(
|
|
713
|
-
|
|
714
|
-
let
|
|
792
|
+
return console.error("第一个参数必须是一个函数。");
|
|
793
|
+
if (!Array.isArray(e))
|
|
794
|
+
return console.error("第二个参数必须是一个数组。");
|
|
795
|
+
let o = [], r = 0;
|
|
715
796
|
const i = (s, a) => {
|
|
716
797
|
for (const [u, l] of a)
|
|
717
798
|
if (s >= u)
|
|
@@ -720,50 +801,63 @@ function Pe(n, t) {
|
|
|
720
801
|
};
|
|
721
802
|
return function(...s) {
|
|
722
803
|
const a = performance.now(), u = n(...s), l = performance.now() - a;
|
|
723
|
-
|
|
724
|
-
const
|
|
804
|
+
o.push(l), o.length > t && o.shift(), r = o.reduce((w, L) => w + L, 0) / o.length || 0;
|
|
805
|
+
const d = i(l, e), f = i(r, e);
|
|
725
806
|
return console.log(
|
|
726
807
|
`%c单次耗时:${l.toFixed(2)}ms
|
|
727
|
-
%c平均耗时(${
|
|
728
|
-
`color: ${
|
|
729
|
-
`color: ${
|
|
808
|
+
%c平均耗时(${o.length}次):${r.toFixed(2)}ms`,
|
|
809
|
+
`color: ${d}; padding: 2px 0;`,
|
|
810
|
+
`color: ${f}; padding: 2px 0;`
|
|
730
811
|
), u;
|
|
731
812
|
};
|
|
732
813
|
}
|
|
733
|
-
function
|
|
734
|
-
const
|
|
735
|
-
let
|
|
814
|
+
function Zt(n) {
|
|
815
|
+
const e = Date.now();
|
|
816
|
+
let t = performance.now();
|
|
817
|
+
for (; Date.now() - e < n; ) {
|
|
818
|
+
t = Math.sin(t) * 1e6, (t > 1e6 || t < -1e6) && (t = 0);
|
|
819
|
+
try {
|
|
820
|
+
const o = t.toString().substring(0, 8);
|
|
821
|
+
history.replaceState(null, "", `#${o}`);
|
|
822
|
+
} catch {
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return Date.now() - e;
|
|
826
|
+
}
|
|
827
|
+
function Kt(n) {
|
|
828
|
+
const e = ut(n, 100);
|
|
829
|
+
let t = 0, o = 0;
|
|
736
830
|
return function(r) {
|
|
737
831
|
const i = r.target;
|
|
738
|
-
if (!i || !(i instanceof
|
|
832
|
+
if (!i || !(i instanceof Element)) return;
|
|
739
833
|
const {
|
|
740
834
|
scrollTop: s,
|
|
741
835
|
scrollHeight: a,
|
|
742
836
|
clientHeight: u,
|
|
743
837
|
scrollLeft: l,
|
|
744
|
-
scrollWidth:
|
|
745
|
-
clientWidth:
|
|
838
|
+
scrollWidth: d,
|
|
839
|
+
clientWidth: f
|
|
746
840
|
} = i;
|
|
747
|
-
function
|
|
748
|
-
if (
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
751
|
-
a - s - u <= 1 &&
|
|
841
|
+
function w() {
|
|
842
|
+
if (t == s) return;
|
|
843
|
+
const A = t > s;
|
|
844
|
+
if (t = s, A) return;
|
|
845
|
+
a - s - u <= 1 && e("vertical");
|
|
752
846
|
}
|
|
753
|
-
function
|
|
847
|
+
function L() {
|
|
754
848
|
if (o == l) return;
|
|
755
|
-
const
|
|
756
|
-
if (o = l,
|
|
757
|
-
|
|
849
|
+
const A = o > l;
|
|
850
|
+
if (o = l, A) return;
|
|
851
|
+
d - l - f <= 1 && e("horizontal");
|
|
758
852
|
}
|
|
759
|
-
|
|
853
|
+
w(), L();
|
|
760
854
|
};
|
|
761
855
|
}
|
|
762
|
-
function
|
|
763
|
-
const { isClickAllowed: o, uiLibrary: r = ["naiveUI", "ElementPlus", "Element"] } =
|
|
856
|
+
function Jt(n, e, t) {
|
|
857
|
+
const { isClickAllowed: o, uiLibrary: r = ["naiveUI", "ElementPlus", "Element"] } = t || {}, i = function(u) {
|
|
764
858
|
const l = [];
|
|
765
|
-
for (const
|
|
766
|
-
Object.hasOwnProperty.call(u,
|
|
859
|
+
for (const d in u)
|
|
860
|
+
Object.hasOwnProperty.call(u, d) && r.includes(d) && l.push(...u[d]);
|
|
767
861
|
return l;
|
|
768
862
|
}({
|
|
769
863
|
naiveUI: [
|
|
@@ -775,37 +869,37 @@ function _e(n, t, e) {
|
|
|
775
869
|
Element: [".el-popper"]
|
|
776
870
|
});
|
|
777
871
|
function s() {
|
|
778
|
-
|
|
872
|
+
e(), document.removeEventListener("mousedown", a);
|
|
779
873
|
}
|
|
780
874
|
function a(u) {
|
|
781
875
|
if (o) {
|
|
782
|
-
const
|
|
783
|
-
if (
|
|
784
|
-
if (
|
|
876
|
+
const f = o(u);
|
|
877
|
+
if (f) return;
|
|
878
|
+
if (f === !1) return s();
|
|
785
879
|
}
|
|
786
880
|
const l = u.target;
|
|
787
|
-
if (!(l instanceof
|
|
788
|
-
n.concat(i).some((
|
|
881
|
+
if (!(l instanceof Element) || !l.isConnected) return;
|
|
882
|
+
n.concat(i).some((f) => !!(l != null && l.closest(f))) || s();
|
|
789
883
|
}
|
|
790
884
|
requestAnimationFrame(
|
|
791
885
|
() => document.addEventListener("mousedown", a)
|
|
792
886
|
);
|
|
793
887
|
}
|
|
794
|
-
var
|
|
795
|
-
class
|
|
888
|
+
var y, U, T, S, D, M, F, P, z;
|
|
889
|
+
class Qt {
|
|
796
890
|
constructor() {
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
891
|
+
h(this, y);
|
|
892
|
+
h(this, U, !1);
|
|
893
|
+
h(this, T, {});
|
|
894
|
+
h(this, S, 0);
|
|
895
|
+
h(this, D, 0);
|
|
896
|
+
h(this, M, 0);
|
|
897
|
+
h(this, F, 0);
|
|
898
|
+
h(this, P);
|
|
899
|
+
h(this, z);
|
|
806
900
|
}
|
|
807
|
-
init(
|
|
808
|
-
m(this,
|
|
901
|
+
init(e, t) {
|
|
902
|
+
m(this, y, e), m(this, P, t == null ? void 0 : t.limit), m(this, z, t == null ? void 0 : t.dragDom), m(this, T, {
|
|
809
903
|
mousedown: this.mousedown.bind(this),
|
|
810
904
|
mousemove: this.mousemove.bind(this),
|
|
811
905
|
mouseup: this.mouseup.bind(this)
|
|
@@ -814,47 +908,47 @@ class ze {
|
|
|
814
908
|
finish() {
|
|
815
909
|
this.bindOrUnbindEvent("unbind");
|
|
816
910
|
}
|
|
817
|
-
bindOrUnbindEvent(
|
|
818
|
-
const
|
|
819
|
-
if (!c(this,
|
|
820
|
-
c(this,
|
|
911
|
+
bindOrUnbindEvent(e) {
|
|
912
|
+
const t = e === "bind" ? "addEventListener" : "removeEventListener";
|
|
913
|
+
if (!c(this, y)) return console.error("No DOM");
|
|
914
|
+
c(this, y)[t]("mousedown", c(this, T).mousedown), document[t]("mousemove", c(this, T).mousemove), document[t]("mouseup", c(this, T).mouseup);
|
|
821
915
|
}
|
|
822
916
|
alterLocation() {
|
|
823
|
-
if (!c(this,
|
|
824
|
-
c(this,
|
|
917
|
+
if (!c(this, y)) return console.error("No DOM");
|
|
918
|
+
c(this, P) && (m(this, M, Math.min(c(this, M), c(this, P).max.top)), m(this, M, Math.max(c(this, M), c(this, P).min.top)), m(this, F, Math.min(c(this, F), c(this, P).max.left)), m(this, F, Math.max(c(this, F), c(this, P).min.left))), c(this, y).style.setProperty("--top", c(this, M) + "px"), c(this, y).style.setProperty("--left", c(this, F) + "px");
|
|
825
919
|
}
|
|
826
|
-
mousedown(
|
|
827
|
-
if (!c(this,
|
|
828
|
-
if (c(this,
|
|
829
|
-
document.body.classList.add("no-select"), m(this,
|
|
830
|
-
const
|
|
831
|
-
m(this,
|
|
920
|
+
mousedown(e) {
|
|
921
|
+
if (!c(this, y)) return console.error("No DOM");
|
|
922
|
+
if (c(this, z) && e.target != c(this, z)) return;
|
|
923
|
+
document.body.classList.add("no-select"), m(this, U, !0);
|
|
924
|
+
const t = c(this, y).getBoundingClientRect(), { pageX: o, pageY: r } = e;
|
|
925
|
+
m(this, S, o), m(this, D, r), m(this, M, t.y), m(this, F, t.x);
|
|
832
926
|
}
|
|
833
|
-
mousemove(
|
|
834
|
-
const { pageX:
|
|
835
|
-
c(this,
|
|
927
|
+
mousemove(e) {
|
|
928
|
+
const { pageX: t, pageY: o } = e;
|
|
929
|
+
c(this, U) && (m(this, M, c(this, M) + (o - c(this, D))), m(this, F, c(this, F) + (t - c(this, S))), m(this, S, t), m(this, D, o), this.alterLocation());
|
|
836
930
|
}
|
|
837
931
|
mouseup() {
|
|
838
|
-
c(this,
|
|
932
|
+
c(this, U) && (m(this, U, !1), document.body.classList.remove("no-select"));
|
|
839
933
|
}
|
|
840
934
|
}
|
|
841
|
-
|
|
842
|
-
var
|
|
843
|
-
class
|
|
935
|
+
y = new WeakMap(), U = new WeakMap(), T = new WeakMap(), S = new WeakMap(), D = new WeakMap(), M = new WeakMap(), F = new WeakMap(), P = new WeakMap(), z = new WeakMap();
|
|
936
|
+
var v, j, R, O, N, b, _, g, q, $;
|
|
937
|
+
class te {
|
|
844
938
|
constructor() {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
939
|
+
h(this, v);
|
|
940
|
+
h(this, j, !1);
|
|
941
|
+
h(this, R, {});
|
|
942
|
+
h(this, O, 0);
|
|
943
|
+
h(this, N, 0);
|
|
944
|
+
h(this, b, 0);
|
|
945
|
+
h(this, _, 0);
|
|
946
|
+
h(this, g);
|
|
947
|
+
h(this, q);
|
|
948
|
+
h(this, $);
|
|
855
949
|
}
|
|
856
|
-
init(
|
|
857
|
-
m(this,
|
|
950
|
+
init(e, t = {}) {
|
|
951
|
+
m(this, v, e), m(this, g, t.limit), m(this, q, t.update_move), m(this, $, t.update_up), m(this, R, {
|
|
858
952
|
mousedown: this.mousedown.bind(this),
|
|
859
953
|
mousemove: this.mousemove.bind(this),
|
|
860
954
|
mouseup: this.mouseup.bind(this)
|
|
@@ -863,315 +957,316 @@ class Ie {
|
|
|
863
957
|
finish() {
|
|
864
958
|
this.bindOrUnbindEvent("unbind");
|
|
865
959
|
}
|
|
866
|
-
bindOrUnbindEvent(
|
|
867
|
-
const
|
|
868
|
-
if (!c(this,
|
|
869
|
-
c(this,
|
|
960
|
+
bindOrUnbindEvent(e) {
|
|
961
|
+
const t = e === "bind" ? "addEventListener" : "removeEventListener";
|
|
962
|
+
if (!c(this, v)) return console.error("No DOM");
|
|
963
|
+
c(this, v)[t]("mousedown", c(this, R).mousedown), document[t]("mousemove", c(this, R).mousemove), document[t]("mouseup", c(this, R).mouseup);
|
|
870
964
|
}
|
|
871
965
|
updateValue() {
|
|
872
|
-
const
|
|
873
|
-
top: c(this,
|
|
874
|
-
left: c(this,
|
|
966
|
+
const e = {
|
|
967
|
+
top: c(this, b),
|
|
968
|
+
left: c(this, _),
|
|
875
969
|
percentage: { top: 0, left: 0 }
|
|
876
970
|
};
|
|
877
971
|
if (c(this, g)) {
|
|
878
|
-
const
|
|
879
|
-
|
|
880
|
-
top:
|
|
881
|
-
left:
|
|
972
|
+
const t = (o) => c(this, g) ? (e[o] - c(this, g).min[o]) / (c(this, g).max[o] - c(this, g).min[o]) : 0;
|
|
973
|
+
e.percentage = {
|
|
974
|
+
top: t("top") || 0,
|
|
975
|
+
left: t("left") || 0
|
|
882
976
|
};
|
|
883
977
|
}
|
|
884
|
-
return
|
|
978
|
+
return e;
|
|
885
979
|
}
|
|
886
980
|
alterLocation() {
|
|
887
|
-
if (!c(this,
|
|
888
|
-
c(this, g) && (m(this,
|
|
981
|
+
if (!c(this, v)) return console.error("No DOM");
|
|
982
|
+
c(this, g) && (m(this, b, Math.min(c(this, b), c(this, g).max.top)), m(this, b, Math.max(c(this, b), c(this, g).min.top)), m(this, _, Math.min(c(this, _), c(this, g).max.left)), m(this, _, Math.max(c(this, _), c(this, g).min.left))), c(this, q) && c(this, q).call(this, this.updateValue()), c(this, v).style.setProperty("--top", c(this, b) + "px"), c(this, v).style.setProperty("--left", c(this, _) + "px");
|
|
889
983
|
}
|
|
890
|
-
mousedown(
|
|
891
|
-
if (!c(this,
|
|
892
|
-
document.body.classList.add("no-select"), m(this,
|
|
893
|
-
const
|
|
894
|
-
m(this,
|
|
895
|
-
const { pageX: o, pageY: r } =
|
|
896
|
-
m(this,
|
|
984
|
+
mousedown(e) {
|
|
985
|
+
if (!c(this, v)) return console.error("No DOM");
|
|
986
|
+
document.body.classList.add("no-select"), m(this, j, !0);
|
|
987
|
+
const t = c(this, v).getBoundingClientRect();
|
|
988
|
+
m(this, N, t.y), m(this, O, t.x);
|
|
989
|
+
const { pageX: o, pageY: r } = e;
|
|
990
|
+
m(this, b, r - c(this, N)), m(this, _, o - c(this, O)), this.alterLocation();
|
|
897
991
|
}
|
|
898
|
-
mousemove(
|
|
899
|
-
const { pageX:
|
|
900
|
-
c(this,
|
|
992
|
+
mousemove(e) {
|
|
993
|
+
const { pageX: t, pageY: o } = e;
|
|
994
|
+
c(this, j) && (m(this, b, o - c(this, N)), m(this, _, t - c(this, O)), this.alterLocation());
|
|
901
995
|
}
|
|
902
996
|
mouseup() {
|
|
903
|
-
c(this,
|
|
997
|
+
c(this, j) && (m(this, j, !1), document.body.classList.remove("no-select"), c(this, $) && c(this, $).call(this, this.updateValue()));
|
|
904
998
|
}
|
|
905
999
|
}
|
|
906
|
-
|
|
907
|
-
function
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
if (n.requestFullscreen)
|
|
911
|
-
return n.requestFullscreen();
|
|
912
|
-
if (t.mozRequestFullScreen)
|
|
913
|
-
return t.mozRequestFullScreen();
|
|
914
|
-
if (t.webkitRequestFullscreen)
|
|
915
|
-
return t.webkitRequestFullscreen();
|
|
916
|
-
if (t.msRequestFullscreen)
|
|
917
|
-
return t.msRequestFullscreen();
|
|
918
|
-
} else return Promise.reject("No DOM");
|
|
919
|
-
return Promise.reject("No Fullscreen API");
|
|
1000
|
+
v = new WeakMap(), j = new WeakMap(), R = new WeakMap(), O = new WeakMap(), N = new WeakMap(), b = new WeakMap(), _ = new WeakMap(), g = new WeakMap(), q = new WeakMap(), $ = new WeakMap();
|
|
1001
|
+
function mt(n) {
|
|
1002
|
+
const e = n || document.documentElement;
|
|
1003
|
+
return e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen() : e.msRequestFullscreen ? e.msRequestFullscreen() : Promise.reject("No Fullscreen API");
|
|
920
1004
|
}
|
|
921
|
-
function
|
|
1005
|
+
function dt() {
|
|
922
1006
|
const n = document;
|
|
923
1007
|
return document.exitFullscreen ? document.exitFullscreen() : n.mozCancelFullScreen ? n.mozCancelFullScreen() : n.webkitExitFullscreen ? n.webkitExitFullscreen() : n.msExitFullscreen ? n.msExitFullscreen() : Promise.reject("No ExitFullscreen API");
|
|
924
1008
|
}
|
|
925
|
-
function
|
|
926
|
-
const
|
|
927
|
-
return document.
|
|
1009
|
+
function ft(n) {
|
|
1010
|
+
const e = document, t = document.fullscreenElement || e.webkitFullscreenElement || e.mozFullScreenElement || e.msFullscreenElement;
|
|
1011
|
+
return n ? n == t : document.documentElement == t || screen.width == window.innerWidth && screen.height == window.innerHeight;
|
|
928
1012
|
}
|
|
929
|
-
function
|
|
1013
|
+
function ee(n) {
|
|
930
1014
|
return function() {
|
|
931
|
-
|
|
1015
|
+
ft(n) ? dt() : mt(n);
|
|
932
1016
|
};
|
|
933
1017
|
}
|
|
934
|
-
function
|
|
1018
|
+
function ne(n, e) {
|
|
935
1019
|
if (typeof n == "number") return n;
|
|
936
1020
|
if (/px/.test(n)) return Number(n.replace(/px/, "")) || 0;
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
const o =
|
|
940
|
-
return
|
|
1021
|
+
const t = document.createElement("div");
|
|
1022
|
+
t.style.width = n, e = e || document.body, e.appendChild(t);
|
|
1023
|
+
const o = t.getBoundingClientRect().width;
|
|
1024
|
+
return e.removeChild(t), o;
|
|
941
1025
|
}
|
|
942
|
-
function
|
|
1026
|
+
function oe(n, e) {
|
|
943
1027
|
if (!n) return;
|
|
944
|
-
let
|
|
945
|
-
if (typeof
|
|
946
|
-
const i = document.querySelector(
|
|
1028
|
+
let t, o;
|
|
1029
|
+
if (typeof e == "string") {
|
|
1030
|
+
const i = document.querySelector(e);
|
|
947
1031
|
if (!i) return;
|
|
948
1032
|
const s = i.getBoundingClientRect();
|
|
949
|
-
|
|
950
|
-
} else if (Array.isArray(
|
|
951
|
-
|
|
1033
|
+
t = s.width, o = s.height;
|
|
1034
|
+
} else if (Array.isArray(e))
|
|
1035
|
+
t = e[0], o = e[1];
|
|
952
1036
|
else {
|
|
953
|
-
const i =
|
|
954
|
-
|
|
1037
|
+
const i = e.getBoundingClientRect();
|
|
1038
|
+
t = i.width, o = i.height;
|
|
955
1039
|
}
|
|
956
|
-
const r =
|
|
957
|
-
return r > n ? [n * o, o] : r < n ? [
|
|
1040
|
+
const r = t / o;
|
|
1041
|
+
return r > n ? [n * o, o] : r < n ? [t, t / n] : [t, o];
|
|
958
1042
|
}
|
|
959
|
-
function
|
|
960
|
-
return new Promise((
|
|
1043
|
+
function re(n, e = 5e3) {
|
|
1044
|
+
return new Promise((t, o) => {
|
|
961
1045
|
const r = new Image();
|
|
962
1046
|
r.src = n;
|
|
963
1047
|
const i = setTimeout(() => {
|
|
964
1048
|
o(new Error("图片加载超时")), r.onload = null, r.onerror = null;
|
|
965
|
-
},
|
|
1049
|
+
}, e);
|
|
966
1050
|
r.onload = () => {
|
|
967
1051
|
clearTimeout(i);
|
|
968
1052
|
const s = r.naturalWidth, a = r.naturalHeight, u = s / a;
|
|
969
|
-
|
|
1053
|
+
t([r, u]);
|
|
970
1054
|
}, r.onerror = () => {
|
|
971
1055
|
clearTimeout(i), o(new Error("图片加载失败"));
|
|
972
1056
|
}, r.crossOrigin = "Anonymous";
|
|
973
1057
|
});
|
|
974
1058
|
}
|
|
975
|
-
function
|
|
976
|
-
return
|
|
1059
|
+
function ie(n) {
|
|
1060
|
+
return new Promise((e, t) => {
|
|
1061
|
+
fetch(n).then((o) => e(o.text())).catch((o) => {
|
|
1062
|
+
console.error("Error fetching :", o), t(o);
|
|
1063
|
+
});
|
|
1064
|
+
});
|
|
977
1065
|
}
|
|
978
|
-
function
|
|
979
|
-
return
|
|
1066
|
+
function ht(n, e) {
|
|
1067
|
+
return new Promise((t, o) => {
|
|
1068
|
+
try {
|
|
1069
|
+
e = e || Z(n, "downloaded_file"), fetch(n).then((r) => (r.ok || o(`文件下载失败,状态码: ${r.status}`), r.blob())).then((r) => {
|
|
1070
|
+
const i = URL.createObjectURL(r), s = document.createElement("a");
|
|
1071
|
+
s.href = i, s.download = decodeURIComponent(e), document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(i), t(r);
|
|
1072
|
+
}).catch(o);
|
|
1073
|
+
} catch (r) {
|
|
1074
|
+
o(r);
|
|
1075
|
+
}
|
|
1076
|
+
});
|
|
980
1077
|
}
|
|
981
|
-
function
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
e || (e = i);
|
|
986
|
-
let s = Math.min((i - e) / t, 1);
|
|
987
|
-
n(s), i - e < t && requestAnimationFrame(r);
|
|
1078
|
+
function se(n, e, t) {
|
|
1079
|
+
if (!t) {
|
|
1080
|
+
let i = e.replace(/^[^.]+./, "");
|
|
1081
|
+
i = i == e ? "text/plain" : "application/" + i, t = { type: i };
|
|
988
1082
|
}
|
|
989
|
-
|
|
1083
|
+
const o = new Blob(n, t), r = URL.createObjectURL(o);
|
|
1084
|
+
ht(r, e);
|
|
990
1085
|
}
|
|
991
|
-
|
|
992
|
-
|
|
1086
|
+
const pt = Math.PI / 2, W = Math.PI / 180, G = 6378137, gt = 85.05112878;
|
|
1087
|
+
function ce(n, e) {
|
|
1088
|
+
const t = Math.max(Math.min(n, 180), -180), o = Math.max(Math.min(e, gt), -85.05112878), r = t * W * G, i = o * W, s = Math.log(Math.tan(Math.PI / 4 + i / 2)) * G;
|
|
1089
|
+
return [r, s];
|
|
993
1090
|
}
|
|
994
|
-
function
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
suffix: "",
|
|
998
|
-
decimalPlaces: 2
|
|
999
|
-
}, { join: o, suffix: r, decimalPlaces: i } = {
|
|
1000
|
-
...e,
|
|
1001
|
-
...t || {}
|
|
1002
|
-
}, s = Number(n);
|
|
1003
|
-
if (isNaN(s)) return o ? `0${r}` : [0, r];
|
|
1004
|
-
const a = Math.abs(s), u = s >= 0, l = Math.max(0, Math.floor(Math.log10(a) / 4)), f = Math.pow(1e4, l), p = a / f, T = (u ? 1 : -1) * parseFloat(p.toFixed(Math.max(0, i)));
|
|
1005
|
-
return o ? `${T}${G[l]}${r}` : [T, G[l] + r];
|
|
1091
|
+
function ae(n, e) {
|
|
1092
|
+
const t = n / G / W, o = (2 * Math.atan(Math.exp(e / G)) - pt) / W;
|
|
1093
|
+
return [t, o];
|
|
1006
1094
|
}
|
|
1007
|
-
function
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
return e;
|
|
1095
|
+
function le(n, e, t) {
|
|
1096
|
+
const [o, r] = n, [i, s] = e, [a, u] = t, l = (a - i) ** 2 + (u - s) ** 2;
|
|
1097
|
+
if (l === 0) return Math.sqrt((o - i) ** 2 + (r - s) ** 2);
|
|
1098
|
+
let d = ((o - i) * (a - i) + (r - s) * (u - s)) / l;
|
|
1099
|
+
return d = Math.max(0, Math.min(1, d)), Math.sqrt(
|
|
1100
|
+
(o - (i + d * (a - i))) ** 2 + (r - (s + d * (u - s))) ** 2
|
|
1101
|
+
);
|
|
1015
1102
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1103
|
+
function ue(n, e, t, o, r) {
|
|
1104
|
+
const i = n + t * Math.cos(o), s = e + t * Math.sin(o), a = n + t * Math.cos(r), u = e + t * Math.sin(r);
|
|
1105
|
+
return [
|
|
1106
|
+
[i, s],
|
|
1107
|
+
[a, u]
|
|
1108
|
+
];
|
|
1022
1109
|
}
|
|
1023
|
-
function
|
|
1024
|
-
return Math.sqrt(Math.pow(
|
|
1110
|
+
function me(n, e, t, o) {
|
|
1111
|
+
return Math.sqrt(Math.pow(t - n, 2) + Math.pow(o - e, 2));
|
|
1025
1112
|
}
|
|
1026
|
-
function
|
|
1027
|
-
const r = (n +
|
|
1113
|
+
function de(n, e, t, o) {
|
|
1114
|
+
const r = (n + t) / 2, i = (e + o) / 2;
|
|
1028
1115
|
return { x: r, y: i };
|
|
1029
1116
|
}
|
|
1030
|
-
class
|
|
1031
|
-
constructor(
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
this.resolve =
|
|
1117
|
+
class k {
|
|
1118
|
+
constructor(e, t) {
|
|
1119
|
+
E(this, "resolve");
|
|
1120
|
+
E(this, "reject");
|
|
1121
|
+
this.resolve = e, this.reject = t;
|
|
1035
1122
|
}
|
|
1036
|
-
run(
|
|
1037
|
-
var
|
|
1038
|
-
return
|
|
1123
|
+
run(e) {
|
|
1124
|
+
var t, o;
|
|
1125
|
+
return e instanceof Promise ? e.then((r) => {
|
|
1039
1126
|
var i;
|
|
1040
1127
|
return (i = this.resolve) == null || i.call(this), r;
|
|
1041
1128
|
}).catch((r) => {
|
|
1042
1129
|
var i;
|
|
1043
1130
|
return (i = this.reject) == null || i.call(this), Promise.reject(r);
|
|
1044
|
-
}) :
|
|
1131
|
+
}) : e ? (t = this.resolve) == null || t.call(this) : (o = this.reject) == null || o.call(this), e;
|
|
1045
1132
|
}
|
|
1046
1133
|
}
|
|
1047
|
-
class
|
|
1048
|
-
constructor(
|
|
1049
|
-
super(), this.resolve =
|
|
1134
|
+
class xt extends k {
|
|
1135
|
+
constructor(e) {
|
|
1136
|
+
super(), this.resolve = e;
|
|
1050
1137
|
}
|
|
1051
|
-
warning(...
|
|
1052
|
-
const
|
|
1138
|
+
warning(...e) {
|
|
1139
|
+
const t = () => {
|
|
1053
1140
|
var o, r;
|
|
1054
|
-
return (r = (o =
|
|
1141
|
+
return (r = (o = Y.tips).warning) == null ? void 0 : r.call(o, ...e);
|
|
1055
1142
|
};
|
|
1056
|
-
return new
|
|
1143
|
+
return new k(this.resolve, t);
|
|
1057
1144
|
}
|
|
1058
|
-
error(...
|
|
1059
|
-
const
|
|
1145
|
+
error(...e) {
|
|
1146
|
+
const t = () => {
|
|
1060
1147
|
var o, r;
|
|
1061
|
-
return (r = (o =
|
|
1148
|
+
return (r = (o = Y.tips).error) == null ? void 0 : r.call(o, ...e);
|
|
1062
1149
|
};
|
|
1063
|
-
return new
|
|
1150
|
+
return new k(this.resolve, t);
|
|
1064
1151
|
}
|
|
1065
1152
|
}
|
|
1066
|
-
class
|
|
1067
|
-
constructor(
|
|
1068
|
-
super(), this.reject =
|
|
1153
|
+
class wt extends k {
|
|
1154
|
+
constructor(e) {
|
|
1155
|
+
super(), this.reject = e;
|
|
1069
1156
|
}
|
|
1070
|
-
info(...
|
|
1071
|
-
const
|
|
1157
|
+
info(...e) {
|
|
1158
|
+
const t = () => {
|
|
1072
1159
|
var o, r;
|
|
1073
|
-
return (r = (o =
|
|
1160
|
+
return (r = (o = Y.tips).info) == null ? void 0 : r.call(o, ...e);
|
|
1074
1161
|
};
|
|
1075
|
-
return new
|
|
1162
|
+
return new k(t, this.reject);
|
|
1076
1163
|
}
|
|
1077
|
-
success(...
|
|
1078
|
-
const
|
|
1164
|
+
success(...e) {
|
|
1165
|
+
const t = () => {
|
|
1079
1166
|
var o, r;
|
|
1080
|
-
return (r = (o =
|
|
1167
|
+
return (r = (o = Y.tips).success) == null ? void 0 : r.call(o, ...e);
|
|
1081
1168
|
};
|
|
1082
|
-
return new
|
|
1169
|
+
return new k(t, this.reject);
|
|
1083
1170
|
}
|
|
1084
1171
|
}
|
|
1085
|
-
const
|
|
1172
|
+
const p = class p {
|
|
1086
1173
|
/**
|
|
1087
1174
|
* 构造函数
|
|
1088
1175
|
* @throws 如果尝试实例化该类,则抛出错误,因为应该使用静态方法
|
|
1089
1176
|
*/
|
|
1090
1177
|
constructor() {
|
|
1091
|
-
if (new.target ===
|
|
1178
|
+
if (new.target === p)
|
|
1092
1179
|
throw new Error("请直接使用静态方法,而不是实例化此类");
|
|
1093
1180
|
}
|
|
1094
|
-
static register(
|
|
1095
|
-
if (typeof
|
|
1181
|
+
static register(e, t) {
|
|
1182
|
+
if (typeof t != "function")
|
|
1096
1183
|
return console.error("TipHandler must be a function");
|
|
1097
|
-
|
|
1184
|
+
p.tips[e] = t;
|
|
1098
1185
|
}
|
|
1099
|
-
static resolveTip(
|
|
1100
|
-
return function(...
|
|
1186
|
+
static resolveTip(e) {
|
|
1187
|
+
return function(...t) {
|
|
1101
1188
|
const o = () => {
|
|
1102
1189
|
var r, i;
|
|
1103
|
-
return (i = (r =
|
|
1190
|
+
return (i = (r = p.tips)[e]) == null ? void 0 : i.call(r, ...t);
|
|
1104
1191
|
};
|
|
1105
|
-
return new
|
|
1192
|
+
return new xt(o);
|
|
1106
1193
|
};
|
|
1107
1194
|
}
|
|
1108
|
-
static rejectTip(
|
|
1109
|
-
return function(...
|
|
1195
|
+
static rejectTip(e) {
|
|
1196
|
+
return function(...t) {
|
|
1110
1197
|
const o = () => {
|
|
1111
1198
|
var r, i;
|
|
1112
|
-
return (i = (r =
|
|
1199
|
+
return (i = (r = p.tips)[e]) == null ? void 0 : i.call(r, ...t);
|
|
1113
1200
|
};
|
|
1114
|
-
return new
|
|
1201
|
+
return new wt(o);
|
|
1115
1202
|
};
|
|
1116
1203
|
}
|
|
1117
1204
|
};
|
|
1118
|
-
|
|
1205
|
+
E(p, "tips", {
|
|
1119
1206
|
info: void 0,
|
|
1120
1207
|
success: void 0,
|
|
1121
1208
|
warning: void 0,
|
|
1122
1209
|
error: void 0
|
|
1123
|
-
}),
|
|
1124
|
-
let
|
|
1210
|
+
}), E(p, "info", p.resolveTip("info")), E(p, "success", p.resolveTip("success")), E(p, "warning", p.rejectTip("warning")), E(p, "error", p.rejectTip("error"));
|
|
1211
|
+
let Y = p;
|
|
1125
1212
|
export {
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1213
|
+
bt as _Animate_CreateOscillator,
|
|
1214
|
+
_t as _Animate_NumericTransition,
|
|
1215
|
+
vt as _Animate_Schedule,
|
|
1216
|
+
Et as _Blob_ConvertDataToImageUrl,
|
|
1217
|
+
Ft as _Browser_CopyToClipboard,
|
|
1218
|
+
Mt as _Browser_GetFrameRate,
|
|
1219
|
+
ct as _Browser_KeyedWindowManager,
|
|
1220
|
+
oe as _Element_CalculateCanvasSize,
|
|
1221
|
+
Jt as _Element_CloseOnOutsideClick,
|
|
1222
|
+
Qt as _Element_Drag,
|
|
1223
|
+
mt as _Element_EnterFullscreen,
|
|
1224
|
+
dt as _Element_ExitFullscreen,
|
|
1225
|
+
ee as _Element_Fullscreen,
|
|
1226
|
+
ne as _Element_GetOtherSizeInPixels,
|
|
1227
|
+
ft as _Element_IsFullscreen,
|
|
1228
|
+
re as _Element_LoadImage,
|
|
1229
|
+
te as _Element_LocalDrag,
|
|
1230
|
+
Kt as _Element_ScrollEndListener,
|
|
1231
|
+
se as _File_CreateAndDownload,
|
|
1232
|
+
ht as _File_Download,
|
|
1233
|
+
ie as _File_Read,
|
|
1234
|
+
Rt as _Format_CamelCase,
|
|
1235
|
+
Ct as _Format_CapitalizeFirstLetter,
|
|
1236
|
+
At as _Format_ExcludeSubstring,
|
|
1237
|
+
Tt as _Format_FileSize,
|
|
1238
|
+
Z as _Format_HrefName,
|
|
1239
|
+
Lt as _Format_NumberWithCommas,
|
|
1240
|
+
Ut as _Format_NumberWithUnit,
|
|
1241
|
+
Pt as _Format_Percentage,
|
|
1242
|
+
jt as _Format_Timestamp,
|
|
1243
|
+
me as _Math_CalculateDistance2D,
|
|
1244
|
+
ue as _Math_GetArcPoints,
|
|
1245
|
+
de as _Math_GetMidpoint,
|
|
1246
|
+
ce as _Math_LngLatToPlane,
|
|
1247
|
+
ae as _Math_PlaneToLngLat,
|
|
1248
|
+
le as _Math_PointToLineDistance,
|
|
1249
|
+
Y as _Tip,
|
|
1250
|
+
Gt as _Utility_Clone,
|
|
1251
|
+
ut as _Utility_Debounce,
|
|
1252
|
+
Nt as _Utility_ExecuteWhenIdle,
|
|
1253
|
+
$t as _Utility_GenerateUUID,
|
|
1254
|
+
Xt as _Utility_GetTargetByPath,
|
|
1255
|
+
Bt as _Utility_InitTargetByPath,
|
|
1256
|
+
K as _Utility_MergeObjects,
|
|
1257
|
+
Wt as _Utility_RotateList,
|
|
1258
|
+
Zt as _Utility_Sleep,
|
|
1259
|
+
Yt as _Utility_Throttle,
|
|
1260
|
+
Vt as _Utility_TimeConsumption,
|
|
1261
|
+
Ht as _Utility_UpdateTargetByPath,
|
|
1262
|
+
qt as _Utility_WaitForCondition,
|
|
1263
|
+
Ot as _Valid_CheckConnectionWithXHR,
|
|
1264
|
+
nt as _Valid_DataType,
|
|
1265
|
+
ot as _Valid_FileTypeChecker,
|
|
1266
|
+
kt as _Valid_Is2DNumberArray,
|
|
1267
|
+
St as _Valid_IsInMargin,
|
|
1268
|
+
lt as _Valid_IsNumberArray,
|
|
1269
|
+
It as _Valid_IsObject,
|
|
1270
|
+
Dt as _Valid_IsPointInPolygon,
|
|
1271
|
+
zt as _Valid_IsSecureContext
|
|
1177
1272
|
};
|