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