yq-tools 1.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/yq-tools.es.js +2410 -0
- package/dist/yq-tools.min.js +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,2410 @@
|
|
|
1
|
+
import oe from "axios";
|
|
2
|
+
import { Loading as _e, MessageBox as F, Message as ie } from "element-ui";
|
|
3
|
+
function xe(e) {
|
|
4
|
+
if (typeof e == "object") {
|
|
5
|
+
for (const t in e)
|
|
6
|
+
if (typeof e[t] == "object" && e[t].type === "RECORD" && e[t].list) {
|
|
7
|
+
const n = {}, r = e[t].list, o = /* @__PURE__ */ new Map();
|
|
8
|
+
for (let i = 0; i < r.length; i++)
|
|
9
|
+
n[r[i].code] = r[i].name, o.set(r[i].name, r[i].code);
|
|
10
|
+
e[t].data = n, e[t].map = o;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return e;
|
|
14
|
+
}
|
|
15
|
+
function se() {
|
|
16
|
+
const e = window.document.location.pathname;
|
|
17
|
+
return e.substring(0, e.substr(1).indexOf("/") + 1);
|
|
18
|
+
}
|
|
19
|
+
const H = {
|
|
20
|
+
method: "post",
|
|
21
|
+
timeout: 6e4,
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function C(e, t) {
|
|
27
|
+
if (console.error('发送AJAX请求到"' + t + '"时出错', e), !e.response)
|
|
28
|
+
e.code === "ECONNABORTED" || e.message.indexOf("timeout") !== -1 ? F.alert("请求超时,请检查网络!", "错误", {
|
|
29
|
+
confirmButtonText: "确定",
|
|
30
|
+
type: "error"
|
|
31
|
+
}) : e.message === "Network Error" ? F.alert("网络异常,请刷新页面重试!", "错误", {
|
|
32
|
+
confirmButtonText: "确定",
|
|
33
|
+
type: "error"
|
|
34
|
+
}) : ie.error("ajax请求没有发出或已被取消");
|
|
35
|
+
else {
|
|
36
|
+
const n = e.response.status;
|
|
37
|
+
if (n === 404)
|
|
38
|
+
F.alert("链接[" + t + "]不存在!", "404错误", {
|
|
39
|
+
confirmButtonText: "确定",
|
|
40
|
+
type: "error"
|
|
41
|
+
});
|
|
42
|
+
else if (n === 500)
|
|
43
|
+
F.alert("功能异常,请与管理员联系或稍后再试!", "服务器错误", {
|
|
44
|
+
confirmButtonText: "确定",
|
|
45
|
+
type: "error"
|
|
46
|
+
});
|
|
47
|
+
else {
|
|
48
|
+
const r = e.response.data || e.response.statusText;
|
|
49
|
+
ie.error(typeof r == "string" ? r : "请求失败");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function G(e, t) {
|
|
54
|
+
if (!t || !t.prefix || typeof e != "object")
|
|
55
|
+
return e;
|
|
56
|
+
const n = {};
|
|
57
|
+
for (const r in e) {
|
|
58
|
+
let o = !0;
|
|
59
|
+
t.prefixWhite ? o = t.prefixWhite.indexOf(r) !== -1 : t.prefixBlack && (o = t.prefixBlack.indexOf(r) === -1), o ? n[t.prefix + r] = e[r] : n[r] = e[r];
|
|
60
|
+
}
|
|
61
|
+
return n;
|
|
62
|
+
}
|
|
63
|
+
function be(e) {
|
|
64
|
+
if (!e || e.indexOf("attachment") === -1) return "";
|
|
65
|
+
const t = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(e);
|
|
66
|
+
return t ? decodeURIComponent(t[1].replace(/['"]/g, "")) : "";
|
|
67
|
+
}
|
|
68
|
+
class Ee {
|
|
69
|
+
constructor() {
|
|
70
|
+
this.instance = oe.create(H), this.loadingInstance = null, this.requestCount = 0, this.setupInterceptors();
|
|
71
|
+
}
|
|
72
|
+
showLoading(t) {
|
|
73
|
+
if (t.loading !== !1 && (this.requestCount++, this.requestCount === 1)) {
|
|
74
|
+
const n = {
|
|
75
|
+
lock: !0,
|
|
76
|
+
text: t.loadingText || "加载中...",
|
|
77
|
+
spinner: "el-icon-loading"
|
|
78
|
+
};
|
|
79
|
+
t.target && (n.target = t.target), t.background && (n.background = t.background), this.loadingInstance = _e.service(n);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
hideLoading() {
|
|
83
|
+
this.requestCount--, this.requestCount === 0 && (this.loadingInstance && this.loadingInstance.close(), this.loadingInstance = null);
|
|
84
|
+
}
|
|
85
|
+
setupInterceptors() {
|
|
86
|
+
this.instance.interceptors.request.use(
|
|
87
|
+
(t) => (this.showLoading(t), t),
|
|
88
|
+
(t) => (this.hideLoading(), Promise.reject(t))
|
|
89
|
+
), this.instance.interceptors.response.use(
|
|
90
|
+
(t) => (this.hideLoading(), t.data),
|
|
91
|
+
(t) => (this.hideLoading(), Promise.reject(t))
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
getCtxPath() {
|
|
95
|
+
return se();
|
|
96
|
+
}
|
|
97
|
+
remoteCall(t, n, r, o) {
|
|
98
|
+
let i = n || {};
|
|
99
|
+
i = G(i, o);
|
|
100
|
+
const c = JSON.stringify(i), s = {
|
|
101
|
+
...H,
|
|
102
|
+
...o,
|
|
103
|
+
url: t,
|
|
104
|
+
data: new URLSearchParams({ data: c })
|
|
105
|
+
};
|
|
106
|
+
return this.instance(s).then((a) => (r && r(a), a)).catch((a) => {
|
|
107
|
+
throw C(a, t), a;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
daoCall(t, n, r) {
|
|
111
|
+
r = r || {}, r.loading === void 0 && (r.loading = !1);
|
|
112
|
+
const o = r.contextPath ? r.contextPath.indexOf("/") === -1 ? "/" + r.contextPath : r.contextPath : se();
|
|
113
|
+
r && r.prefix && typeof t == "object" && t.params && (t.params = G(t.params, r));
|
|
114
|
+
const i = JSON.stringify(t), c = o + "/webcall", s = {
|
|
115
|
+
...H,
|
|
116
|
+
...r,
|
|
117
|
+
url: c,
|
|
118
|
+
data: new URLSearchParams({ data: i })
|
|
119
|
+
};
|
|
120
|
+
return this.instance(s).then((a) => (window.yq && window.yq.cfg && window.yq.cfg.recordSort && (a = xe(a)), n && n(a), a)).catch((a) => {
|
|
121
|
+
throw C(a, c), a;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
tableCall(t, n, r, o) {
|
|
125
|
+
n = n || { pageSize: 20, pageIndex: 1, data: {} }, o && o.prefix && typeof n == "object" && n.data && (n.data = G(n.data, o)), typeof n.data == "object" && (n.data = JSON.stringify(n.data));
|
|
126
|
+
const i = {
|
|
127
|
+
...H,
|
|
128
|
+
...o,
|
|
129
|
+
url: t,
|
|
130
|
+
data: new URLSearchParams(n)
|
|
131
|
+
};
|
|
132
|
+
return this.instance(i).then((c) => (r && r(c), c)).catch((c) => {
|
|
133
|
+
throw C(c, t), c;
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
exportCall(t, n, r, o) {
|
|
137
|
+
o = o || {};
|
|
138
|
+
const i = (o.method || "GET").toUpperCase();
|
|
139
|
+
o.onStart && o.onStart();
|
|
140
|
+
const c = {
|
|
141
|
+
url: t,
|
|
142
|
+
method: i,
|
|
143
|
+
responseType: "blob",
|
|
144
|
+
timeout: o.timeout || 6e4
|
|
145
|
+
};
|
|
146
|
+
return n && (i === "GET" ? c.params = n : i === "POST" && (c.data = new URLSearchParams(n), c.headers = { "Content-Type": "application/x-www-form-urlencoded" })), oe(c).then((s) => {
|
|
147
|
+
o.onEnd && o.onEnd();
|
|
148
|
+
const a = s.headers["content-disposition"], u = be(a) || o.defaultFilename || "download", d = s.data, f = document.createElement("a");
|
|
149
|
+
return f.href = window.URL.createObjectURL(d), f.download = u, document.body.appendChild(f), f.click(), document.body.removeChild(f), window.URL.revokeObjectURL(f.href), r && r(u), u;
|
|
150
|
+
}).catch((s) => {
|
|
151
|
+
throw o.onEnd && o.onEnd(), C(s, t), s;
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
get(t, n, r) {
|
|
155
|
+
const o = {
|
|
156
|
+
...r,
|
|
157
|
+
url: t,
|
|
158
|
+
method: "GET",
|
|
159
|
+
params: n
|
|
160
|
+
};
|
|
161
|
+
return this.instance(o).catch((i) => {
|
|
162
|
+
throw C(i, t), i;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
post(t, n, r) {
|
|
166
|
+
r = r || {};
|
|
167
|
+
const o = r.contentType || "form";
|
|
168
|
+
let i = n, c = {};
|
|
169
|
+
o === "json" ? (i = n, c["Content-Type"] = "application/json") : o === "formData" ? i = n : (i = new URLSearchParams(n), c["Content-Type"] = "application/x-www-form-urlencoded");
|
|
170
|
+
const s = {
|
|
171
|
+
...r,
|
|
172
|
+
url: t,
|
|
173
|
+
method: "POST",
|
|
174
|
+
data: i,
|
|
175
|
+
headers: { ...c, ...r.headers }
|
|
176
|
+
};
|
|
177
|
+
return this.instance(s).catch((a) => {
|
|
178
|
+
throw C(a, t), a;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const y = new Ee();
|
|
183
|
+
function Se(e, t = 300, n = !1) {
|
|
184
|
+
let r = null, o;
|
|
185
|
+
const i = function(...c) {
|
|
186
|
+
if (r && clearTimeout(r), n) {
|
|
187
|
+
const s = !r;
|
|
188
|
+
r = setTimeout(() => {
|
|
189
|
+
r = null;
|
|
190
|
+
}, t), s && (o = e.apply(this, c));
|
|
191
|
+
} else
|
|
192
|
+
r = setTimeout(() => {
|
|
193
|
+
e.apply(this, c);
|
|
194
|
+
}, t);
|
|
195
|
+
return o;
|
|
196
|
+
};
|
|
197
|
+
return i.cancel = function() {
|
|
198
|
+
clearTimeout(r), r = null;
|
|
199
|
+
}, i;
|
|
200
|
+
}
|
|
201
|
+
function ve(e, t = 300, n = {}) {
|
|
202
|
+
let r = null, o = 0;
|
|
203
|
+
const { leading: i = !0, trailing: c = !0 } = n, s = function(...a) {
|
|
204
|
+
const u = Date.now();
|
|
205
|
+
!o && !i && (o = u);
|
|
206
|
+
const d = t - (u - o);
|
|
207
|
+
d <= 0 || d > t ? (r && (clearTimeout(r), r = null), o = u, e.apply(this, a)) : !r && c && (r = setTimeout(() => {
|
|
208
|
+
o = i ? Date.now() : 0, r = null, e.apply(this, a);
|
|
209
|
+
}, d));
|
|
210
|
+
};
|
|
211
|
+
return s.cancel = function() {
|
|
212
|
+
clearTimeout(r), o = 0, r = null;
|
|
213
|
+
}, s;
|
|
214
|
+
}
|
|
215
|
+
function At() {
|
|
216
|
+
return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
217
|
+
const t = Math.random() * 16 | 0;
|
|
218
|
+
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function Ct(e = 21) {
|
|
222
|
+
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-";
|
|
223
|
+
let n = "";
|
|
224
|
+
const r = new Uint8Array(e);
|
|
225
|
+
if (typeof crypto < "u" && crypto.getRandomValues)
|
|
226
|
+
crypto.getRandomValues(r);
|
|
227
|
+
else
|
|
228
|
+
for (let o = 0; o < e; o++)
|
|
229
|
+
r[o] = Math.floor(Math.random() * 256);
|
|
230
|
+
for (let o = 0; o < e; o++)
|
|
231
|
+
n += t[r[o] % 64];
|
|
232
|
+
return n;
|
|
233
|
+
}
|
|
234
|
+
function Me(e, t = /* @__PURE__ */ new WeakMap()) {
|
|
235
|
+
if (e === null || typeof e != "object") return e;
|
|
236
|
+
if (e instanceof Date) return new Date(e);
|
|
237
|
+
if (e instanceof RegExp) return new RegExp(e.source, e.flags);
|
|
238
|
+
if (t.has(e)) return t.get(e);
|
|
239
|
+
const n = Array.isArray(e) ? [] : {};
|
|
240
|
+
t.set(e, n);
|
|
241
|
+
for (const r in e)
|
|
242
|
+
Object.prototype.hasOwnProperty.call(e, r) && (n[r] = Me(e[r], t));
|
|
243
|
+
return n;
|
|
244
|
+
}
|
|
245
|
+
function ce(e, ...t) {
|
|
246
|
+
if (!t.length) return e;
|
|
247
|
+
const n = t.shift();
|
|
248
|
+
if (Z(e) && Z(n))
|
|
249
|
+
for (const r in n)
|
|
250
|
+
Object.prototype.hasOwnProperty.call(n, r) && (Z(n[r]) ? (e[r] || Object.assign(e, { [r]: {} }), ce(e[r], n[r])) : Object.assign(e, { [r]: n[r] }));
|
|
251
|
+
return ce(e, ...t);
|
|
252
|
+
}
|
|
253
|
+
function Z(e) {
|
|
254
|
+
return Object.prototype.toString.call(e) === "[object Object]";
|
|
255
|
+
}
|
|
256
|
+
function It(e, t, n) {
|
|
257
|
+
if (e == null || typeof e != "object") return e;
|
|
258
|
+
const r = Array.isArray(t) ? t : t.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
259
|
+
let o = e;
|
|
260
|
+
for (let i = 0; i < r.length - 1; i++) {
|
|
261
|
+
const c = r[i], s = r[i + 1];
|
|
262
|
+
o[c] == null && (o[c] = /^\d+$/.test(s) ? [] : {}), o = o[c];
|
|
263
|
+
}
|
|
264
|
+
return o[r[r.length - 1]] = n, e;
|
|
265
|
+
}
|
|
266
|
+
function kt(e, t) {
|
|
267
|
+
if (e == null) return {};
|
|
268
|
+
const n = { ...e };
|
|
269
|
+
return t.forEach((r) => delete n[r]), n;
|
|
270
|
+
}
|
|
271
|
+
function Ot(e, t) {
|
|
272
|
+
if (e == null) return {};
|
|
273
|
+
const n = {};
|
|
274
|
+
return t.forEach((r) => {
|
|
275
|
+
Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
|
|
276
|
+
}), n;
|
|
277
|
+
}
|
|
278
|
+
function Lt(e, t) {
|
|
279
|
+
if (!Array.isArray(e)) return [];
|
|
280
|
+
if (!t) return [...new Set(e)];
|
|
281
|
+
const n = /* @__PURE__ */ new Set();
|
|
282
|
+
return e.filter((r) => {
|
|
283
|
+
const o = typeof t == "function" ? t(r) : r[t];
|
|
284
|
+
return n.has(o) ? !1 : (n.add(o), !0);
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function $t(e, t) {
|
|
288
|
+
return Array.isArray(e) ? e.reduce((n, r) => {
|
|
289
|
+
const o = typeof t == "function" ? t(r) : r[t];
|
|
290
|
+
return n[o] || (n[o] = []), n[o].push(r), n;
|
|
291
|
+
}, {}) : {};
|
|
292
|
+
}
|
|
293
|
+
function Yt(e, t = 1) {
|
|
294
|
+
if (!Array.isArray(e) || t < 1) return [];
|
|
295
|
+
const n = [];
|
|
296
|
+
for (let r = 0; r < e.length; r += t)
|
|
297
|
+
n.push(e.slice(r, r + t));
|
|
298
|
+
return n;
|
|
299
|
+
}
|
|
300
|
+
function De(e, t = 1) {
|
|
301
|
+
return Array.isArray(e) ? t < 1 ? e.slice() : e.reduce((n, r) => (Array.isArray(r) && t > 0 ? n.push(...De(r, t - 1)) : n.push(r), n), []) : [];
|
|
302
|
+
}
|
|
303
|
+
function Te(e) {
|
|
304
|
+
return new Promise((t) => setTimeout(t, e));
|
|
305
|
+
}
|
|
306
|
+
async function Pt(e, t = 3, n = 1e3) {
|
|
307
|
+
let r;
|
|
308
|
+
for (let o = 0; o < t; o++)
|
|
309
|
+
try {
|
|
310
|
+
return await e();
|
|
311
|
+
} catch (i) {
|
|
312
|
+
r = i, o < t - 1 && await Te(n);
|
|
313
|
+
}
|
|
314
|
+
throw r;
|
|
315
|
+
}
|
|
316
|
+
function Nt(e, t) {
|
|
317
|
+
return e = Math.ceil(e), t = Math.floor(t), Math.floor(Math.random() * (t - e + 1)) + e;
|
|
318
|
+
}
|
|
319
|
+
function Rt(e = 8, t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") {
|
|
320
|
+
let n = "";
|
|
321
|
+
for (let r = 0; r < e; r++)
|
|
322
|
+
n += t.charAt(Math.floor(Math.random() * t.length));
|
|
323
|
+
return n;
|
|
324
|
+
}
|
|
325
|
+
function Ft(e) {
|
|
326
|
+
if (!Array.isArray(e)) return [];
|
|
327
|
+
const t = [...e];
|
|
328
|
+
for (let n = t.length - 1; n > 0; n--) {
|
|
329
|
+
const r = Math.floor(Math.random() * (n + 1));
|
|
330
|
+
[t[n], t[r]] = [t[r], t[n]];
|
|
331
|
+
}
|
|
332
|
+
return t;
|
|
333
|
+
}
|
|
334
|
+
function S(e, t, n) {
|
|
335
|
+
const r = e.data && e.data.on || e.componentInstance && e.componentInstance.$listeners;
|
|
336
|
+
r && r[t] && (typeof r[t] == "function" ? r[t](n) : Array.isArray(r[t]) && r[t].forEach((o) => o(n)));
|
|
337
|
+
}
|
|
338
|
+
function U(e, t) {
|
|
339
|
+
const n = document.createElement("textarea");
|
|
340
|
+
n.value = e, n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.width = "1px", n.style.height = "1px", n.style.padding = "0", n.style.border = "none", n.style.outline = "none", n.style.boxShadow = "none", n.style.background = "transparent", document.body.appendChild(n), n.select(), n.setSelectionRange(0, n.value.length);
|
|
341
|
+
try {
|
|
342
|
+
document.execCommand("copy") ? S(t, "copy-success") : S(t, "copy-error", new Error("复制失败"));
|
|
343
|
+
} catch (r) {
|
|
344
|
+
S(t, "copy-error", r);
|
|
345
|
+
} finally {
|
|
346
|
+
document.body.removeChild(n);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const Ht = {
|
|
350
|
+
inserted(e, t) {
|
|
351
|
+
try {
|
|
352
|
+
const n = arguments[2], r = t.value;
|
|
353
|
+
if (typeof r != "string") {
|
|
354
|
+
console.warn(`[v-auth] 仅接受字符串,例如 v-auth="'a'"、v-auth="'a;b;'" 或 v-auth="'a,b'"`);
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
const o = r.split(/[;,]/).map((c) => c && c.trim()).filter(Boolean);
|
|
358
|
+
if (!o.length) {
|
|
359
|
+
console.warn("[v-auth] 缺少权限ID");
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
const i = o.join(",");
|
|
363
|
+
y.remoteCall(`/cc-base/servlet/menu?action=checkRes&ids=${i}`, {}, (c) => {
|
|
364
|
+
if (!(c && c.state === 1 && c.data)) {
|
|
365
|
+
console.error("[v-auth] 获取权限失败", c);
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
const s = c.data;
|
|
369
|
+
if (t.arg) {
|
|
370
|
+
const u = /\[(.*?)\]/, d = t.rawName && t.rawName.match(u);
|
|
371
|
+
if (d && d[1]) {
|
|
372
|
+
const f = d[1], l = n && n.context;
|
|
373
|
+
l && (l[f] || (l[f] = {}), Array.isArray(s) ? s.forEach(function(h) {
|
|
374
|
+
const T = h && Object.keys(h)[0];
|
|
375
|
+
T && h[T] === "Y" && (l.$set ? l.$set(l[f], T, "Y") : l[f][T] = "Y");
|
|
376
|
+
}) : s && typeof s == "object" && Object.keys(s).forEach((h) => {
|
|
377
|
+
s[h] === "Y" && (l.$set ? l.$set(l[f], h, "Y") : l[f][h] = "Y");
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
let a = !1;
|
|
383
|
+
Array.isArray(s) ? a = s.some((u) => {
|
|
384
|
+
const d = u && Object.keys(u)[0];
|
|
385
|
+
return d && u[d] === "Y";
|
|
386
|
+
}) : s && typeof s == "object" && (a = o.some((u) => s[u] === "Y")), !a && e && e.parentNode && e.parentNode.removeChild(e);
|
|
387
|
+
});
|
|
388
|
+
} catch (n) {
|
|
389
|
+
console.error("[v-auth] 执行出错:", n);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}, Ut = {
|
|
393
|
+
inserted(e, t) {
|
|
394
|
+
const n = typeof t.value == "function" ? t.value : t.value && t.value.handler, r = typeof t.value == "object" ? t.value : {}, o = r.wait || 300, i = !!r.immediate;
|
|
395
|
+
if (typeof n != "function") {
|
|
396
|
+
console.warn("[v-debounce] 需要传入函数或 { handler, wait, immediate } 对象");
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
e.__debounce_handler__ = Se(n, o, i), e.addEventListener("click", e.__debounce_handler__);
|
|
400
|
+
},
|
|
401
|
+
unbind(e) {
|
|
402
|
+
e.__debounce_handler__ && (e.removeEventListener("click", e.__debounce_handler__), delete e.__debounce_handler__);
|
|
403
|
+
}
|
|
404
|
+
}, Bt = {
|
|
405
|
+
inserted(e, t) {
|
|
406
|
+
const n = typeof t.value == "function" ? t.value : t.value && t.value.handler, r = typeof t.value == "object" ? t.value : {}, o = r.wait || 300, i = r.leading !== void 0 ? r.leading : !0, c = r.trailing !== void 0 ? r.trailing : !0;
|
|
407
|
+
if (typeof n != "function") {
|
|
408
|
+
console.warn("[v-throttle] 需要传入函数或 { handler, wait, leading, trailing } 对象");
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
e.__throttle_handler__ = ve(n, o, { leading: i, trailing: c }), e.addEventListener("click", e.__throttle_handler__);
|
|
412
|
+
},
|
|
413
|
+
unbind(e) {
|
|
414
|
+
e.__throttle_handler__ && (e.removeEventListener("click", e.__throttle_handler__), delete e.__throttle_handler__);
|
|
415
|
+
}
|
|
416
|
+
}, Wt = {
|
|
417
|
+
bind(e, t, n) {
|
|
418
|
+
e.$copyHandler = function() {
|
|
419
|
+
const r = t.value;
|
|
420
|
+
if (!r) {
|
|
421
|
+
console.warn("[v-copy] 复制内容不能为空");
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(r).then(() => {
|
|
425
|
+
S(n, "copy-success");
|
|
426
|
+
}).catch((o) => {
|
|
427
|
+
console.error("[v-copy] Clipboard API 失败,使用降级方案", o), U(r, n);
|
|
428
|
+
}) : U(r, n);
|
|
429
|
+
}, e.addEventListener("click", e.$copyHandler);
|
|
430
|
+
},
|
|
431
|
+
update(e, t, n) {
|
|
432
|
+
e.$copyHandler && e.removeEventListener("click", e.$copyHandler), e.$copyHandler = function() {
|
|
433
|
+
const r = t.value;
|
|
434
|
+
if (!r) {
|
|
435
|
+
console.warn("[v-copy] 复制内容不能为空");
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
navigator.clipboard && window.isSecureContext ? navigator.clipboard.writeText(r).then(() => {
|
|
439
|
+
S(n, "copy-success");
|
|
440
|
+
}).catch((o) => {
|
|
441
|
+
console.error("[v-copy] Clipboard API 失败,使用降级方案", o), U(r, n);
|
|
442
|
+
}) : U(r, n);
|
|
443
|
+
}, e.addEventListener("click", e.$copyHandler);
|
|
444
|
+
},
|
|
445
|
+
unbind(e) {
|
|
446
|
+
e.$copyHandler && (e.removeEventListener("click", e.$copyHandler), delete e.$copyHandler);
|
|
447
|
+
}
|
|
448
|
+
}, jt = {
|
|
449
|
+
bind(e, t) {
|
|
450
|
+
const n = typeof t.value == "function" ? t.value : t.value && t.value.handler, r = t.value && t.value.duration || 600, o = (t.value && t.value.preventContextMenu) !== !1;
|
|
451
|
+
if (typeof n != "function") {
|
|
452
|
+
console.warn("[v-longpress] 需要传入函数或 { handler, duration } 对象");
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
let i = null, c = 0, s = 0;
|
|
456
|
+
const a = (f) => {
|
|
457
|
+
f.type === "click" && f.button !== 0 || i === null && (c = f.clientX || f.touches && f.touches[0] && f.touches[0].clientX || 0, s = f.clientY || f.touches && f.touches[0] && f.touches[0].clientY || 0, i = setTimeout(() => {
|
|
458
|
+
n(f);
|
|
459
|
+
}, r));
|
|
460
|
+
}, u = () => {
|
|
461
|
+
i !== null && (clearTimeout(i), i = null);
|
|
462
|
+
}, d = (f) => {
|
|
463
|
+
const l = f.clientX || f.touches && f.touches[0] && f.touches[0].clientX || 0, h = f.clientY || f.touches && f.touches[0] && f.touches[0].clientY || 0;
|
|
464
|
+
(Math.abs(l - c) > 10 || Math.abs(h - s) > 10) && u();
|
|
465
|
+
};
|
|
466
|
+
e.__longpress_start__ = a, e.__longpress_cancel__ = u, e.__longpress_move_cancel__ = d, e.addEventListener("mousedown", a), e.addEventListener("touchstart", a), e.addEventListener("click", u), e.addEventListener("mouseout", u), e.addEventListener("touchend", u), e.addEventListener("touchcancel", u), e.addEventListener("touchmove", d), o && (e.__longpress_contextmenu__ = (f) => f.preventDefault(), e.addEventListener("contextmenu", e.__longpress_contextmenu__));
|
|
467
|
+
},
|
|
468
|
+
unbind(e) {
|
|
469
|
+
e.__longpress_start__ && (e.removeEventListener("mousedown", e.__longpress_start__), e.removeEventListener("touchstart", e.__longpress_start__), delete e.__longpress_start__), e.__longpress_cancel__ && (e.removeEventListener("click", e.__longpress_cancel__), e.removeEventListener("mouseout", e.__longpress_cancel__), e.removeEventListener("touchend", e.__longpress_cancel__), e.removeEventListener("touchcancel", e.__longpress_cancel__), delete e.__longpress_cancel__), e.__longpress_move_cancel__ && (e.removeEventListener("touchmove", e.__longpress_move_cancel__), delete e.__longpress_move_cancel__), e.__longpress_contextmenu__ && (e.removeEventListener("contextmenu", e.__longpress_contextmenu__), delete e.__longpress_contextmenu__);
|
|
470
|
+
}
|
|
471
|
+
}, ae = {
|
|
472
|
+
bind(e, t, n) {
|
|
473
|
+
const r = typeof t.value == "object" ? t.value : {}, o = r.handle, i = r.constraint !== void 0 ? r.constraint : !0, c = r.axis || "both", s = o ? e.querySelector(o) : e;
|
|
474
|
+
if (!s) {
|
|
475
|
+
console.warn("[v-draggable] 未找到拖拽手柄元素");
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
o ? s.style.cursor = "move" : e.style.cursor = "move";
|
|
479
|
+
const a = window.getComputedStyle(e).position;
|
|
480
|
+
if (a !== "absolute" && a !== "fixed") {
|
|
481
|
+
const w = e.getBoundingClientRect(), E = e.parentElement ? e.parentElement.getBoundingClientRect() : { left: 0, top: 0 };
|
|
482
|
+
e.style.position = "absolute", e.style.left || (e.style.left = w.left - E.left + "px"), e.style.top || (e.style.top = w.top - E.top + "px");
|
|
483
|
+
}
|
|
484
|
+
let u = !1, d = 0, f = 0, l = 0, h = 0;
|
|
485
|
+
const T = (w) => {
|
|
486
|
+
u = !0, d = w.clientX, f = w.clientY;
|
|
487
|
+
const E = window.getComputedStyle(e);
|
|
488
|
+
l = parseFloat(E.left) || 0, h = parseFloat(E.top) || 0, e.style.userSelect = "none", s.style.cursor = "move", S(n, "drag-start", { startX: d, startY: f, element: e }), w.preventDefault();
|
|
489
|
+
}, ee = (w) => {
|
|
490
|
+
if (!u) return;
|
|
491
|
+
const E = w.clientX - d, ne = w.clientY - f;
|
|
492
|
+
let Y = l + E, P = h + ne;
|
|
493
|
+
if (c === "x" ? P = h : c === "y" && (Y = l), i && e.parentElement) {
|
|
494
|
+
const re = e.parentElement, ge = re.clientWidth, he = re.clientHeight, ye = e.offsetWidth, we = e.offsetHeight;
|
|
495
|
+
Y = Math.max(0, Math.min(Y, ge - ye)), P = Math.max(0, Math.min(P, he - we));
|
|
496
|
+
}
|
|
497
|
+
c !== "y" && (e.style.left = Y + "px"), c !== "x" && (e.style.top = P + "px"), S(n, "drag-move", { x: Y, y: P, deltaX: E, deltaY: ne, element: e }), w.preventDefault();
|
|
498
|
+
}, te = (w) => {
|
|
499
|
+
u && (u = !1, e.style.userSelect = "", S(n, "drag-end", { x: e.offsetLeft, y: e.offsetTop, element: e }), w.preventDefault());
|
|
500
|
+
};
|
|
501
|
+
s.addEventListener("mousedown", T), document.addEventListener("mousemove", ee), document.addEventListener("mouseup", te), e.$dragHandlers = { handleMouseDown: T, handleMouseMove: ee, handleMouseUp: te, dragHandle: s };
|
|
502
|
+
},
|
|
503
|
+
unbind(e) {
|
|
504
|
+
if (e.$dragHandlers) {
|
|
505
|
+
const { handleMouseDown: t, handleMouseMove: n, handleMouseUp: r, dragHandle: o } = e.$dragHandlers;
|
|
506
|
+
o.removeEventListener("mousedown", t), document.removeEventListener("mousemove", n), document.removeEventListener("mouseup", r), delete e.$dragHandlers;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}, zt = {
|
|
510
|
+
bind(e, t, n) {
|
|
511
|
+
const r = typeof t.value == "object" ? t.value : {}, o = r.constraint !== void 0 ? r.constraint : !1, i = () => {
|
|
512
|
+
let u = null;
|
|
513
|
+
if (n.componentInstance && n.componentInstance.$attrs && (u = n.componentInstance.$attrs["custom-class"]), !u && n.data && n.data.attrs && (u = n.data.attrs["custom-class"]), u)
|
|
514
|
+
return document.querySelector(`.el-dialog.${u}`);
|
|
515
|
+
const d = document.querySelectorAll(".el-dialog");
|
|
516
|
+
return d[d.length - 1];
|
|
517
|
+
}, c = () => {
|
|
518
|
+
setTimeout(() => {
|
|
519
|
+
const u = i();
|
|
520
|
+
if (u && !u.__dialog_drag_applied) {
|
|
521
|
+
u.__dialog_drag_applied = !0;
|
|
522
|
+
const f = window.getComputedStyle(u).marginTop;
|
|
523
|
+
f && f !== "0px" && f !== "auto" && (u.style.marginTop = "0", u.style.top = f), ae.bind(u, {
|
|
524
|
+
value: { handle: ".el-dialog__header", constraint: o }
|
|
525
|
+
}, n);
|
|
526
|
+
const l = u.querySelector(".el-dialog__header");
|
|
527
|
+
l && (l.style.cursor = "move", l.style.userSelect = "none");
|
|
528
|
+
}
|
|
529
|
+
}, 50);
|
|
530
|
+
}, s = () => {
|
|
531
|
+
const u = i();
|
|
532
|
+
u && (delete u.__dialog_drag_applied, u.$dragHandlers && ae.unbind(u));
|
|
533
|
+
};
|
|
534
|
+
e._dialogDragHandlers = { opened: c, closed: s };
|
|
535
|
+
const a = n.componentInstance;
|
|
536
|
+
a && (a.$on("opened", c), a.$on("closed", s));
|
|
537
|
+
},
|
|
538
|
+
unbind(e, t, n) {
|
|
539
|
+
const r = e._dialogDragHandlers;
|
|
540
|
+
if (r) {
|
|
541
|
+
const o = n.componentInstance;
|
|
542
|
+
o && (o.$off("opened", r.opened), o.$off("closed", r.closed)), delete e._dialogDragHandlers;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}, x = {
|
|
546
|
+
VUE: "vue",
|
|
547
|
+
// 新系统(Vue + Vuex + KeepAlive)
|
|
548
|
+
LEGACY: "legacy",
|
|
549
|
+
// 旧系统(layui iframe)
|
|
550
|
+
STANDALONE: "standalone"
|
|
551
|
+
// 独立运行
|
|
552
|
+
};
|
|
553
|
+
let k = null;
|
|
554
|
+
function W() {
|
|
555
|
+
try {
|
|
556
|
+
return window.top || window;
|
|
557
|
+
} catch {
|
|
558
|
+
return window;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
function j() {
|
|
562
|
+
if (k) return k;
|
|
563
|
+
try {
|
|
564
|
+
const e = W();
|
|
565
|
+
if (e.__TAB_MANAGER__ && typeof e.__TAB_MANAGER__.openTab == "function")
|
|
566
|
+
return k = x.VUE, x.VUE;
|
|
567
|
+
if (e._createPage && typeof e._createPage == "function")
|
|
568
|
+
return k = x.LEGACY, x.LEGACY;
|
|
569
|
+
} catch {
|
|
570
|
+
}
|
|
571
|
+
return k = x.STANDALONE, x.STANDALONE;
|
|
572
|
+
}
|
|
573
|
+
function qt() {
|
|
574
|
+
k = null;
|
|
575
|
+
}
|
|
576
|
+
function Xt(e, t, n) {
|
|
577
|
+
let r;
|
|
578
|
+
if (typeof e == "string")
|
|
579
|
+
r = { url: e, title: t, data: n };
|
|
580
|
+
else if (typeof e == "object" && e !== null)
|
|
581
|
+
r = e;
|
|
582
|
+
else {
|
|
583
|
+
console.error("[popup] openTab 参数格式错误");
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
const o = j(), i = W();
|
|
587
|
+
try {
|
|
588
|
+
if (o === x.VUE)
|
|
589
|
+
i.__TAB_MANAGER__.openTab(r);
|
|
590
|
+
else if (o === x.LEGACY)
|
|
591
|
+
i._createPage(r);
|
|
592
|
+
else {
|
|
593
|
+
const c = r.data ? `${r.url}${r.url.includes("?") ? "&" : "?"}${new URLSearchParams(r.data).toString()}` : r.url;
|
|
594
|
+
window.open(c, "_blank");
|
|
595
|
+
}
|
|
596
|
+
typeof r.callback == "function" && r.callback();
|
|
597
|
+
} catch (c) {
|
|
598
|
+
console.error("[popup] 打开标签页失败:", c);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function Gt(e) {
|
|
602
|
+
const t = typeof e == "string" ? { id: e } : e;
|
|
603
|
+
if (!t || !t.id) {
|
|
604
|
+
console.error("[popup] jumpTab 需要提供标签页 ID");
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const n = j(), r = W();
|
|
608
|
+
try {
|
|
609
|
+
n === x.VUE ? r.__TAB_MANAGER__.jumpTab(t) : n === x.LEGACY ? r._jumpPage(t) : console.warn("[popup] 独立运行模式不支持 jumpTab");
|
|
610
|
+
} catch (o) {
|
|
611
|
+
console.error("[popup] 跳转标签页失败:", o);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function Zt(e) {
|
|
615
|
+
const t = typeof e == "string" ? { id: e } : e, n = j(), r = W();
|
|
616
|
+
try {
|
|
617
|
+
n === x.VUE ? r.__TAB_MANAGER__.closeTab(t) : n === x.LEGACY ? r._removePage(t) : window.close();
|
|
618
|
+
} catch (o) {
|
|
619
|
+
console.error("[popup] 关闭标签页失败:", o);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
function Vt() {
|
|
623
|
+
try {
|
|
624
|
+
return window.self !== window.top;
|
|
625
|
+
} catch {
|
|
626
|
+
return !0;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function Jt() {
|
|
630
|
+
return j();
|
|
631
|
+
}
|
|
632
|
+
function p(e) {
|
|
633
|
+
if (e instanceof Date) return new Date(e);
|
|
634
|
+
if (typeof e == "number") return new Date(e);
|
|
635
|
+
if (typeof e == "string") {
|
|
636
|
+
const t = e.replace(/-/g, "/");
|
|
637
|
+
return new Date(t);
|
|
638
|
+
}
|
|
639
|
+
return /* @__PURE__ */ new Date();
|
|
640
|
+
}
|
|
641
|
+
function I(e, t = 2) {
|
|
642
|
+
return String(e).padStart(t, "0");
|
|
643
|
+
}
|
|
644
|
+
function O(e, t = "YYYY-MM-DD HH:mm:ss") {
|
|
645
|
+
const n = p(e);
|
|
646
|
+
if (isNaN(n.getTime())) return "";
|
|
647
|
+
const r = {
|
|
648
|
+
YYYY: n.getFullYear(),
|
|
649
|
+
MM: I(n.getMonth() + 1),
|
|
650
|
+
DD: I(n.getDate()),
|
|
651
|
+
HH: I(n.getHours()),
|
|
652
|
+
mm: I(n.getMinutes()),
|
|
653
|
+
ss: I(n.getSeconds()),
|
|
654
|
+
SSS: I(n.getMilliseconds(), 3)
|
|
655
|
+
};
|
|
656
|
+
return t.replace(/YYYY|MM|DD|HH|mm|ss|SSS/g, (o) => r[o]);
|
|
657
|
+
}
|
|
658
|
+
function Kt(e, t = "HH:mm:ss") {
|
|
659
|
+
return O(e, t);
|
|
660
|
+
}
|
|
661
|
+
function Qt(e) {
|
|
662
|
+
const t = p(e);
|
|
663
|
+
if (isNaN(t.getTime())) return "";
|
|
664
|
+
const r = (/* @__PURE__ */ new Date()).getTime() - t.getTime(), o = Math.floor(r / 1e3), i = Math.floor(o / 60), c = Math.floor(i / 60), s = Math.floor(c / 24);
|
|
665
|
+
return o < 60 ? "刚刚" : i < 60 ? `${i}分钟前` : c < 24 ? `${c}小时前` : s === 1 ? "昨天" : s < 7 ? `${s}天前` : s < 30 ? `${Math.floor(s / 7)}周前` : s < 365 ? `${Math.floor(s / 30)}个月前` : O(t, "YYYY-MM-DD");
|
|
666
|
+
}
|
|
667
|
+
function en(e, t = "YYYY-MM-DD") {
|
|
668
|
+
if (!e) return null;
|
|
669
|
+
const n = t.match(/YYYY|MM|DD|HH|mm|ss/g) || [], r = t.replace(/YYYY/g, "(\\d{4})").replace(/MM|DD|HH|mm|ss/g, "(\\d{2})"), o = e.match(new RegExp(`^${r}$`));
|
|
670
|
+
if (!o) return null;
|
|
671
|
+
const i = { YYYY: 1970, MM: 1, DD: 1, HH: 0, mm: 0, ss: 0 };
|
|
672
|
+
return n.forEach((c, s) => {
|
|
673
|
+
i[c] = parseInt(o[s + 1], 10);
|
|
674
|
+
}), new Date(i.YYYY, i.MM - 1, i.DD, i.HH, i.mm, i.ss);
|
|
675
|
+
}
|
|
676
|
+
function L(e, t) {
|
|
677
|
+
const n = p(e);
|
|
678
|
+
return n.setDate(n.getDate() + t), n;
|
|
679
|
+
}
|
|
680
|
+
function fe(e, t) {
|
|
681
|
+
const n = p(e), r = n.getDate();
|
|
682
|
+
return n.setMonth(n.getMonth() + t), n.getDate() !== r && n.setDate(0), n;
|
|
683
|
+
}
|
|
684
|
+
function Ae(e, t) {
|
|
685
|
+
return fe(e, t * 12);
|
|
686
|
+
}
|
|
687
|
+
function tn(e, t) {
|
|
688
|
+
const n = p(e);
|
|
689
|
+
return n.setHours(n.getHours() + t), n;
|
|
690
|
+
}
|
|
691
|
+
function nn(e, t) {
|
|
692
|
+
const n = p(e);
|
|
693
|
+
return n.setMinutes(n.getMinutes() + t), n;
|
|
694
|
+
}
|
|
695
|
+
function rn(e, t) {
|
|
696
|
+
const n = v(e), r = v(t);
|
|
697
|
+
return Math.round((n.getTime() - r.getTime()) / (1e3 * 60 * 60 * 24));
|
|
698
|
+
}
|
|
699
|
+
function on(e, t) {
|
|
700
|
+
const n = p(e), r = p(t);
|
|
701
|
+
return (n.getFullYear() - r.getFullYear()) * 12 + (n.getMonth() - r.getMonth());
|
|
702
|
+
}
|
|
703
|
+
function sn(e) {
|
|
704
|
+
return V(e, /* @__PURE__ */ new Date());
|
|
705
|
+
}
|
|
706
|
+
function cn(e) {
|
|
707
|
+
return V(e, L(/* @__PURE__ */ new Date(), -1));
|
|
708
|
+
}
|
|
709
|
+
function an(e) {
|
|
710
|
+
return V(e, L(/* @__PURE__ */ new Date(), 1));
|
|
711
|
+
}
|
|
712
|
+
function un(e) {
|
|
713
|
+
const t = p(e).getDay();
|
|
714
|
+
return t === 0 || t === 6;
|
|
715
|
+
}
|
|
716
|
+
function fn(e) {
|
|
717
|
+
return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0;
|
|
718
|
+
}
|
|
719
|
+
function V(e, t) {
|
|
720
|
+
const n = p(e), r = p(t);
|
|
721
|
+
return n.getFullYear() === r.getFullYear() && n.getMonth() === r.getMonth() && n.getDate() === r.getDate();
|
|
722
|
+
}
|
|
723
|
+
function ln(e, t) {
|
|
724
|
+
return p(e).getTime() < p(t).getTime();
|
|
725
|
+
}
|
|
726
|
+
function dn(e, t) {
|
|
727
|
+
return p(e).getTime() > p(t).getTime();
|
|
728
|
+
}
|
|
729
|
+
function v(e) {
|
|
730
|
+
const t = p(e);
|
|
731
|
+
return t.setHours(0, 0, 0, 0), t;
|
|
732
|
+
}
|
|
733
|
+
function $(e) {
|
|
734
|
+
const t = p(e);
|
|
735
|
+
return t.setHours(23, 59, 59, 999), t;
|
|
736
|
+
}
|
|
737
|
+
function mn(e) {
|
|
738
|
+
const t = p(e), n = t.getDay(), r = n === 0 ? -6 : 1 - n;
|
|
739
|
+
return t.setDate(t.getDate() + r), v(t);
|
|
740
|
+
}
|
|
741
|
+
function pn(e) {
|
|
742
|
+
const t = p(e), n = t.getDay(), r = n === 0 ? 0 : 7 - n;
|
|
743
|
+
return t.setDate(t.getDate() + r), $(t);
|
|
744
|
+
}
|
|
745
|
+
function gn(e) {
|
|
746
|
+
const t = p(e);
|
|
747
|
+
return t.setDate(1), v(t);
|
|
748
|
+
}
|
|
749
|
+
function hn(e) {
|
|
750
|
+
const t = p(e);
|
|
751
|
+
return t.setMonth(t.getMonth() + 1, 0), $(t);
|
|
752
|
+
}
|
|
753
|
+
function yn(e, t) {
|
|
754
|
+
return new Date(e, t, 0).getDate();
|
|
755
|
+
}
|
|
756
|
+
function wn(e) {
|
|
757
|
+
const t = p(e), n = new Date(t.getFullYear(), 0, 1), r = Math.floor((t.getTime() - n.getTime()) / (1e3 * 60 * 60 * 24));
|
|
758
|
+
return Math.ceil((r + n.getDay() + 1) / 7);
|
|
759
|
+
}
|
|
760
|
+
function _n(e) {
|
|
761
|
+
const t = p(e), n = new Date(t.getFullYear(), 0, 0);
|
|
762
|
+
return Math.floor((t.getTime() - n.getTime()) / (1e3 * 60 * 60 * 24));
|
|
763
|
+
}
|
|
764
|
+
function xn() {
|
|
765
|
+
const e = $(/* @__PURE__ */ new Date());
|
|
766
|
+
return { start: v(L(/* @__PURE__ */ new Date(), -6)), end: e };
|
|
767
|
+
}
|
|
768
|
+
function bn() {
|
|
769
|
+
const e = $(/* @__PURE__ */ new Date());
|
|
770
|
+
return { start: v(L(/* @__PURE__ */ new Date(), -29)), end: e };
|
|
771
|
+
}
|
|
772
|
+
function En() {
|
|
773
|
+
const e = $(/* @__PURE__ */ new Date());
|
|
774
|
+
return { start: v(fe(/* @__PURE__ */ new Date(), -6)), end: e };
|
|
775
|
+
}
|
|
776
|
+
function Sn() {
|
|
777
|
+
const e = $(/* @__PURE__ */ new Date());
|
|
778
|
+
return { start: v(Ae(/* @__PURE__ */ new Date(), -1)), end: e };
|
|
779
|
+
}
|
|
780
|
+
function vn() {
|
|
781
|
+
return Date.now();
|
|
782
|
+
}
|
|
783
|
+
function Mn(e = "YYYY-MM-DD") {
|
|
784
|
+
return O(/* @__PURE__ */ new Date(), e);
|
|
785
|
+
}
|
|
786
|
+
function Dn(e = "YYYY-MM-DD") {
|
|
787
|
+
return O(L(/* @__PURE__ */ new Date(), -1), e);
|
|
788
|
+
}
|
|
789
|
+
function Tn(e = "YYYY-MM-DD") {
|
|
790
|
+
return O(L(/* @__PURE__ */ new Date(), 1), e);
|
|
791
|
+
}
|
|
792
|
+
function An() {
|
|
793
|
+
return (/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
794
|
+
}
|
|
795
|
+
function Cn() {
|
|
796
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
797
|
+
}
|
|
798
|
+
function Ce(e, t) {
|
|
799
|
+
const n = p(e), o = new Intl.DateTimeFormat("en-US", {
|
|
800
|
+
timeZone: t,
|
|
801
|
+
year: "numeric",
|
|
802
|
+
month: "2-digit",
|
|
803
|
+
day: "2-digit",
|
|
804
|
+
hour: "2-digit",
|
|
805
|
+
minute: "2-digit",
|
|
806
|
+
second: "2-digit",
|
|
807
|
+
hour12: !1
|
|
808
|
+
}).formatToParts(n), i = (c) => {
|
|
809
|
+
var s;
|
|
810
|
+
return ((s = o.find((a) => a.type === c)) == null ? void 0 : s.value) || "0";
|
|
811
|
+
};
|
|
812
|
+
return new Date(
|
|
813
|
+
parseInt(i("year")),
|
|
814
|
+
parseInt(i("month")) - 1,
|
|
815
|
+
parseInt(i("day")),
|
|
816
|
+
parseInt(i("hour")),
|
|
817
|
+
parseInt(i("minute")),
|
|
818
|
+
parseInt(i("second"))
|
|
819
|
+
);
|
|
820
|
+
}
|
|
821
|
+
function In(e, t, n = "YYYY-MM-DD HH:mm:ss") {
|
|
822
|
+
const r = Ce(e, t);
|
|
823
|
+
return O(r, n);
|
|
824
|
+
}
|
|
825
|
+
function kn(e) {
|
|
826
|
+
const t = p(e);
|
|
827
|
+
return new Date(t.getTime() + t.getTimezoneOffset() * 6e4);
|
|
828
|
+
}
|
|
829
|
+
function On(e) {
|
|
830
|
+
const t = p(e);
|
|
831
|
+
return new Date(t.getTime() - t.getTimezoneOffset() * 6e4);
|
|
832
|
+
}
|
|
833
|
+
function Ie(e = window.location.href) {
|
|
834
|
+
if (!e) return "";
|
|
835
|
+
const t = e.indexOf("?");
|
|
836
|
+
if (t === -1) return "";
|
|
837
|
+
const n = e.indexOf("#");
|
|
838
|
+
return n === -1 ? e.slice(t + 1) : e.slice(t + 1, n);
|
|
839
|
+
}
|
|
840
|
+
function z(e = window.location.href) {
|
|
841
|
+
const t = Ie(e);
|
|
842
|
+
return Oe(t);
|
|
843
|
+
}
|
|
844
|
+
function Ln(e, t = window.location.href) {
|
|
845
|
+
const n = z(t);
|
|
846
|
+
return n[e] !== void 0 ? n[e] : null;
|
|
847
|
+
}
|
|
848
|
+
function $n(e, t, n = window.location.href) {
|
|
849
|
+
return ke({ [e]: t }, n);
|
|
850
|
+
}
|
|
851
|
+
function ke(e, t = window.location.href) {
|
|
852
|
+
if (!t) return "";
|
|
853
|
+
const n = t.indexOf("#"), r = n !== -1 ? t.slice(n) : "", o = n !== -1 ? t.slice(0, n) : t, i = o.indexOf("?"), c = i !== -1 ? o.slice(0, i) : o, a = { ...z(o), ...e }, u = le(a);
|
|
854
|
+
return u ? `${c}?${u}${r}` : `${c}${r}`;
|
|
855
|
+
}
|
|
856
|
+
function Yn(e, t = window.location.href) {
|
|
857
|
+
if (!t) return "";
|
|
858
|
+
const n = t.indexOf("#"), r = n !== -1 ? t.slice(n) : "", o = n !== -1 ? t.slice(0, n) : t, i = o.indexOf("?"), c = i !== -1 ? o.slice(0, i) : o, s = z(o);
|
|
859
|
+
delete s[e];
|
|
860
|
+
const a = le(s);
|
|
861
|
+
return a ? `${c}?${a}${r}` : `${c}${r}`;
|
|
862
|
+
}
|
|
863
|
+
function Pn(e, t = window.location.href) {
|
|
864
|
+
const n = z(t);
|
|
865
|
+
return e in n;
|
|
866
|
+
}
|
|
867
|
+
function le(e) {
|
|
868
|
+
if (!e || typeof e != "object") return "";
|
|
869
|
+
const t = [];
|
|
870
|
+
for (const n in e)
|
|
871
|
+
if (Object.prototype.hasOwnProperty.call(e, n)) {
|
|
872
|
+
const r = e[n];
|
|
873
|
+
if (r == null) continue;
|
|
874
|
+
Array.isArray(r) ? r.forEach((o) => {
|
|
875
|
+
t.push(`${encodeURIComponent(n)}=${encodeURIComponent(o)}`);
|
|
876
|
+
}) : t.push(`${encodeURIComponent(n)}=${encodeURIComponent(r)}`);
|
|
877
|
+
}
|
|
878
|
+
return t.join("&");
|
|
879
|
+
}
|
|
880
|
+
function Oe(e) {
|
|
881
|
+
if (!e) return {};
|
|
882
|
+
const t = e.startsWith("?") ? e.slice(1) : e;
|
|
883
|
+
if (!t) return {};
|
|
884
|
+
const n = {}, r = t.split("&");
|
|
885
|
+
for (const o of r) {
|
|
886
|
+
if (!o) continue;
|
|
887
|
+
const [i, c = ""] = o.split("="), s = decodeURIComponent(i), a = decodeURIComponent(c);
|
|
888
|
+
s in n ? Array.isArray(n[s]) ? n[s].push(a) : n[s] = [n[s], a] : n[s] = a;
|
|
889
|
+
}
|
|
890
|
+
return n;
|
|
891
|
+
}
|
|
892
|
+
function Le(...e) {
|
|
893
|
+
return e.filter((t) => t).map((t, n) => {
|
|
894
|
+
let r = String(t);
|
|
895
|
+
return n > 0 && (r = r.replace(/^\/+/, "")), n < e.length - 1 && (r = r.replace(/\/+$/, "")), r;
|
|
896
|
+
}).join("/");
|
|
897
|
+
}
|
|
898
|
+
function de(e) {
|
|
899
|
+
return e ? /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e) : !1;
|
|
900
|
+
}
|
|
901
|
+
function Nn(e) {
|
|
902
|
+
return e ? !de(e) : !1;
|
|
903
|
+
}
|
|
904
|
+
function Rn(e) {
|
|
905
|
+
if (!e) return "";
|
|
906
|
+
try {
|
|
907
|
+
return new URL(e).href;
|
|
908
|
+
} catch {
|
|
909
|
+
return e.replace(/([^:]\/)\/+/g, "$1").replace(/\/+$/, "");
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
function Fn(e, t) {
|
|
913
|
+
if (!e) return t || "";
|
|
914
|
+
if (!t) return e;
|
|
915
|
+
if (de(t)) return t;
|
|
916
|
+
try {
|
|
917
|
+
return new URL(t, e).href;
|
|
918
|
+
} catch {
|
|
919
|
+
return Le(e, t);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
function Hn(e, t = 0) {
|
|
923
|
+
if (!e || !e.getBoundingClientRect) return !1;
|
|
924
|
+
const n = e.getBoundingClientRect(), r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth;
|
|
925
|
+
if (n.bottom < 0 || n.top > r || n.right < 0 || n.left > o)
|
|
926
|
+
return !1;
|
|
927
|
+
if (t === 0) return !0;
|
|
928
|
+
const i = Math.min(n.bottom, r) - Math.max(n.top, 0), c = Math.min(n.right, o) - Math.max(n.left, 0), s = i * c, a = n.height * n.width;
|
|
929
|
+
return a > 0 && s / a >= t;
|
|
930
|
+
}
|
|
931
|
+
function Un(e) {
|
|
932
|
+
if (!e || !e.getBoundingClientRect) return !1;
|
|
933
|
+
const t = e.getBoundingClientRect(), n = window.innerHeight || document.documentElement.clientHeight, r = window.innerWidth || document.documentElement.clientWidth;
|
|
934
|
+
return t.top >= 0 && t.left >= 0 && t.bottom <= n && t.right <= r;
|
|
935
|
+
}
|
|
936
|
+
function Bn(e) {
|
|
937
|
+
if (!e || !e.getBoundingClientRect) return 0;
|
|
938
|
+
const t = e.getBoundingClientRect(), n = window.innerHeight || document.documentElement.clientHeight, r = window.innerWidth || document.documentElement.clientWidth;
|
|
939
|
+
if (t.bottom < 0 || t.top > n || t.right < 0 || t.left > r)
|
|
940
|
+
return 0;
|
|
941
|
+
const o = Math.min(t.bottom, n) - Math.max(t.top, 0), i = Math.min(t.right, r) - Math.max(t.left, 0), c = o * i, s = t.height * t.width;
|
|
942
|
+
return s > 0 ? c / s : 0;
|
|
943
|
+
}
|
|
944
|
+
function Wn(e, t, n = {}) {
|
|
945
|
+
if (!e || typeof t != "function") return null;
|
|
946
|
+
const r = new IntersectionObserver((o) => {
|
|
947
|
+
o.forEach((i) => {
|
|
948
|
+
t({
|
|
949
|
+
isIntersecting: i.isIntersecting,
|
|
950
|
+
ratio: i.intersectionRatio,
|
|
951
|
+
entry: i
|
|
952
|
+
});
|
|
953
|
+
});
|
|
954
|
+
}, {
|
|
955
|
+
threshold: n.threshold || 0,
|
|
956
|
+
rootMargin: n.rootMargin || "0px",
|
|
957
|
+
root: n.root || null
|
|
958
|
+
});
|
|
959
|
+
return r.observe(e), r;
|
|
960
|
+
}
|
|
961
|
+
function jn(e = 300) {
|
|
962
|
+
if (e <= 0) {
|
|
963
|
+
window.scrollTo(0, 0);
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
966
|
+
const t = window.pageYOffset || document.documentElement.scrollTop, n = performance.now(), r = (o) => {
|
|
967
|
+
const i = o - n, c = Math.min(i / e, 1), s = c < 0.5 ? 2 * c * c : 1 - Math.pow(-2 * c + 2, 2) / 2;
|
|
968
|
+
window.scrollTo(0, t * (1 - s)), c < 1 && requestAnimationFrame(r);
|
|
969
|
+
};
|
|
970
|
+
requestAnimationFrame(r);
|
|
971
|
+
}
|
|
972
|
+
function zn(e, t = 0, n = 300) {
|
|
973
|
+
const r = typeof e == "string" ? document.querySelector(e) : e;
|
|
974
|
+
if (!r) return;
|
|
975
|
+
const o = r.getBoundingClientRect().top + window.pageYOffset + t;
|
|
976
|
+
if (n <= 0) {
|
|
977
|
+
window.scrollTo(0, o);
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
const i = window.pageYOffset || document.documentElement.scrollTop, c = o - i, s = performance.now(), a = (u) => {
|
|
981
|
+
const d = u - s, f = Math.min(d / n, 1), l = f < 0.5 ? 2 * f * f : 1 - Math.pow(-2 * f + 2, 2) / 2;
|
|
982
|
+
window.scrollTo(0, i + c * l), f < 1 && requestAnimationFrame(a);
|
|
983
|
+
};
|
|
984
|
+
requestAnimationFrame(a);
|
|
985
|
+
}
|
|
986
|
+
function qn() {
|
|
987
|
+
const e = window.pageYOffset || document.documentElement.scrollTop, t = document.documentElement.scrollHeight - document.documentElement.clientHeight;
|
|
988
|
+
return t <= 0 ? 0 : Math.round(e / t * 100);
|
|
989
|
+
}
|
|
990
|
+
let _ = {
|
|
991
|
+
locked: !1,
|
|
992
|
+
scrollY: 0,
|
|
993
|
+
bodyStyle: {}
|
|
994
|
+
};
|
|
995
|
+
function Xn() {
|
|
996
|
+
_.locked || (_.scrollY = window.pageYOffset, _.bodyStyle = {
|
|
997
|
+
overflow: document.body.style.overflow,
|
|
998
|
+
position: document.body.style.position,
|
|
999
|
+
top: document.body.style.top,
|
|
1000
|
+
width: document.body.style.width
|
|
1001
|
+
}, document.body.style.overflow = "hidden", document.body.style.position = "fixed", document.body.style.top = `-${_.scrollY}px`, document.body.style.width = "100%", _.locked = !0);
|
|
1002
|
+
}
|
|
1003
|
+
function Gn() {
|
|
1004
|
+
_.locked && (document.body.style.overflow = _.bodyStyle.overflow || "", document.body.style.position = _.bodyStyle.position || "", document.body.style.top = _.bodyStyle.top || "", document.body.style.width = _.bodyStyle.width || "", window.scrollTo(0, _.scrollY), _.locked = !1);
|
|
1005
|
+
}
|
|
1006
|
+
function Zn() {
|
|
1007
|
+
const e = document.createElement("div");
|
|
1008
|
+
e.style.cssText = "visibility:hidden;overflow:scroll;width:100px;position:absolute;top:-9999px", document.body.appendChild(e);
|
|
1009
|
+
const t = document.createElement("div");
|
|
1010
|
+
t.style.width = "100%", e.appendChild(t);
|
|
1011
|
+
const n = e.offsetWidth - t.offsetWidth;
|
|
1012
|
+
return document.body.removeChild(e), n;
|
|
1013
|
+
}
|
|
1014
|
+
function $e(e = document.documentElement) {
|
|
1015
|
+
return e.requestFullscreen ? e.requestFullscreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.msRequestFullscreen ? e.msRequestFullscreen() : Promise.reject(new Error("Fullscreen API not supported"));
|
|
1016
|
+
}
|
|
1017
|
+
function Ye() {
|
|
1018
|
+
return document.exitFullscreen ? document.exitFullscreen() : document.webkitExitFullscreen ? document.webkitExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.msExitFullscreen ? document.msExitFullscreen() : Promise.reject(new Error("Fullscreen API not supported"));
|
|
1019
|
+
}
|
|
1020
|
+
function Pe() {
|
|
1021
|
+
return !!(document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement);
|
|
1022
|
+
}
|
|
1023
|
+
function Vn(e = document.documentElement) {
|
|
1024
|
+
return Pe() ? Ye() : $e(e);
|
|
1025
|
+
}
|
|
1026
|
+
const m = typeof navigator < "u" ? navigator.userAgent : "";
|
|
1027
|
+
function N() {
|
|
1028
|
+
if (!m) return { name: "unknown", version: "" };
|
|
1029
|
+
let e = "unknown", t = "";
|
|
1030
|
+
return /Edg\/(\d+[\d.]*)/i.test(m) ? (e = "edge", t = RegExp.$1) : /Chrome\/(\d+[\d.]*)/i.test(m) && !/Edg/i.test(m) ? (e = "chrome", t = RegExp.$1) : /Firefox\/(\d+[\d.]*)/i.test(m) ? (e = "firefox", t = RegExp.$1) : /Safari\/(\d+[\d.]*)/i.test(m) && !/Chrome/i.test(m) ? (e = "safari", /Version\/(\d+[\d.]*)/i.test(m) && (t = RegExp.$1)) : /MSIE\s(\d+[\d.]*)/i.test(m) || /Trident.*rv:(\d+[\d.]*)/i.test(m) ? (e = "ie", t = RegExp.$1) : /Opera|OPR\/(\d+[\d.]*)/i.test(m) && (e = "opera", t = RegExp.$1), { name: e, version: t };
|
|
1031
|
+
}
|
|
1032
|
+
function Jn() {
|
|
1033
|
+
return N().name === "chrome";
|
|
1034
|
+
}
|
|
1035
|
+
function Kn() {
|
|
1036
|
+
return N().name === "firefox";
|
|
1037
|
+
}
|
|
1038
|
+
function Qn() {
|
|
1039
|
+
return N().name === "safari";
|
|
1040
|
+
}
|
|
1041
|
+
function er() {
|
|
1042
|
+
return N().name === "edge";
|
|
1043
|
+
}
|
|
1044
|
+
function tr() {
|
|
1045
|
+
return N().name === "ie";
|
|
1046
|
+
}
|
|
1047
|
+
function nr() {
|
|
1048
|
+
return /MicroMessenger/i.test(m);
|
|
1049
|
+
}
|
|
1050
|
+
function rr() {
|
|
1051
|
+
return /MicroMessenger/i.test(m) && /miniProgram/i.test(m);
|
|
1052
|
+
}
|
|
1053
|
+
function or() {
|
|
1054
|
+
return /AlipayClient/i.test(m);
|
|
1055
|
+
}
|
|
1056
|
+
function ir() {
|
|
1057
|
+
return /DingTalk/i.test(m);
|
|
1058
|
+
}
|
|
1059
|
+
function sr() {
|
|
1060
|
+
return /wxwork/i.test(m);
|
|
1061
|
+
}
|
|
1062
|
+
function R() {
|
|
1063
|
+
if (!m) return { name: "unknown", version: "" };
|
|
1064
|
+
let e = "unknown", t = "";
|
|
1065
|
+
if (/Windows NT (\d+[\d.]*)/i.test(m)) {
|
|
1066
|
+
e = "windows";
|
|
1067
|
+
const n = RegExp.$1;
|
|
1068
|
+
t = {
|
|
1069
|
+
"10.0": "10",
|
|
1070
|
+
"6.3": "8.1",
|
|
1071
|
+
"6.2": "8",
|
|
1072
|
+
"6.1": "7",
|
|
1073
|
+
"6.0": "Vista",
|
|
1074
|
+
"5.1": "XP"
|
|
1075
|
+
}[n] || n;
|
|
1076
|
+
} else /Mac OS X (\d+[._\d]*)/i.test(m) ? (e = "macos", t = RegExp.$1.replace(/_/g, ".")) : /Android[\s/]?(\d+[\d.]*)?/i.test(m) ? (e = "android", t = RegExp.$1 || "") : /iPhone OS (\d+[_\d]*)/i.test(m) || /iPad.*OS (\d+[_\d]*)/i.test(m) ? (e = "ios", t = RegExp.$1.replace(/_/g, ".")) : /Linux/i.test(m) && (e = "linux");
|
|
1077
|
+
return { name: e, version: t };
|
|
1078
|
+
}
|
|
1079
|
+
function cr() {
|
|
1080
|
+
return R().name === "windows";
|
|
1081
|
+
}
|
|
1082
|
+
function Ne() {
|
|
1083
|
+
return R().name === "macos";
|
|
1084
|
+
}
|
|
1085
|
+
function ar() {
|
|
1086
|
+
return R().name === "linux";
|
|
1087
|
+
}
|
|
1088
|
+
function ur() {
|
|
1089
|
+
return R().name === "android";
|
|
1090
|
+
}
|
|
1091
|
+
function fr() {
|
|
1092
|
+
return R().name === "ios";
|
|
1093
|
+
}
|
|
1094
|
+
function J() {
|
|
1095
|
+
return m ? /iPad/i.test(m) || Ne() && "ontouchend" in document || /tablet|playbook|silk/i.test(m) ? "tablet" : /mobile|android|iphone|ipod|blackberry|iemobile|opera mini/i.test(m) ? "mobile" : "desktop" : "desktop";
|
|
1096
|
+
}
|
|
1097
|
+
function lr() {
|
|
1098
|
+
return J() === "mobile";
|
|
1099
|
+
}
|
|
1100
|
+
function dr() {
|
|
1101
|
+
return J() === "tablet";
|
|
1102
|
+
}
|
|
1103
|
+
function mr() {
|
|
1104
|
+
return J() === "desktop";
|
|
1105
|
+
}
|
|
1106
|
+
function pr() {
|
|
1107
|
+
return typeof window > "u" ? !1 : "ontouchstart" in window || navigator.maxTouchPoints > 0;
|
|
1108
|
+
}
|
|
1109
|
+
function gr() {
|
|
1110
|
+
if (typeof document > "u") return !1;
|
|
1111
|
+
try {
|
|
1112
|
+
const e = document.createElement("canvas");
|
|
1113
|
+
return !!(window.WebGLRenderingContext && (e.getContext("webgl") || e.getContext("experimental-webgl")));
|
|
1114
|
+
} catch {
|
|
1115
|
+
return !1;
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
function hr() {
|
|
1119
|
+
return typeof WebSocket < "u";
|
|
1120
|
+
}
|
|
1121
|
+
function yr() {
|
|
1122
|
+
try {
|
|
1123
|
+
const e = "__test_ls__";
|
|
1124
|
+
return localStorage.setItem(e, e), localStorage.removeItem(e), !0;
|
|
1125
|
+
} catch {
|
|
1126
|
+
return !1;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
function wr() {
|
|
1130
|
+
try {
|
|
1131
|
+
const e = "__test_ss__";
|
|
1132
|
+
return sessionStorage.setItem(e, e), sessionStorage.removeItem(e), !0;
|
|
1133
|
+
} catch {
|
|
1134
|
+
return !1;
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
function _r() {
|
|
1138
|
+
return typeof indexedDB < "u";
|
|
1139
|
+
}
|
|
1140
|
+
function xr() {
|
|
1141
|
+
return typeof Worker < "u";
|
|
1142
|
+
}
|
|
1143
|
+
function br() {
|
|
1144
|
+
return "serviceWorker" in navigator;
|
|
1145
|
+
}
|
|
1146
|
+
function Er() {
|
|
1147
|
+
return "Notification" in window;
|
|
1148
|
+
}
|
|
1149
|
+
function Sr() {
|
|
1150
|
+
return "geolocation" in navigator;
|
|
1151
|
+
}
|
|
1152
|
+
function vr() {
|
|
1153
|
+
return navigator.clipboard && typeof navigator.clipboard.writeText == "function";
|
|
1154
|
+
}
|
|
1155
|
+
function Re() {
|
|
1156
|
+
return typeof navigator < "u" ? navigator.onLine : !0;
|
|
1157
|
+
}
|
|
1158
|
+
function ue() {
|
|
1159
|
+
const e = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
|
|
1160
|
+
return e ? e.effectiveType ? e.effectiveType : e.type === "wifi" ? "wifi" : "unknown" : "unknown";
|
|
1161
|
+
}
|
|
1162
|
+
function Mr(e) {
|
|
1163
|
+
if (typeof e != "function") return () => {
|
|
1164
|
+
};
|
|
1165
|
+
const t = () => e({ online: !0, type: ue() }), n = () => e({ online: !1, type: "unknown" });
|
|
1166
|
+
window.addEventListener("online", t), window.addEventListener("offline", n);
|
|
1167
|
+
const r = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
|
|
1168
|
+
return r && r.addEventListener("change", () => {
|
|
1169
|
+
e({ online: Re(), type: ue() });
|
|
1170
|
+
}), () => {
|
|
1171
|
+
window.removeEventListener("online", t), window.removeEventListener("offline", n);
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
function Fe() {
|
|
1175
|
+
return typeof process < "u" && process.env ? process.env.NODE_ENV === "development" : typeof location < "u" ? location.hostname === "localhost" || location.hostname === "127.0.0.1" || location.hostname.startsWith("192.168.") : !1;
|
|
1176
|
+
}
|
|
1177
|
+
function Dr() {
|
|
1178
|
+
return typeof process < "u" && process.env ? process.env.NODE_ENV === "production" : !Fe();
|
|
1179
|
+
}
|
|
1180
|
+
function Tr() {
|
|
1181
|
+
return typeof window > "u";
|
|
1182
|
+
}
|
|
1183
|
+
function Ar() {
|
|
1184
|
+
return typeof window < "u";
|
|
1185
|
+
}
|
|
1186
|
+
const He = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, Ue = /^1[3-9]\d{9}$/, Be = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/, We = /^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/i, je = /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, ze = /^[\u4e00-\u9fa5]+$/;
|
|
1187
|
+
function Cr(e) {
|
|
1188
|
+
return e ? He.test(e) : !1;
|
|
1189
|
+
}
|
|
1190
|
+
function Ir(e) {
|
|
1191
|
+
return e ? Ue.test(e) : !1;
|
|
1192
|
+
}
|
|
1193
|
+
function kr(e) {
|
|
1194
|
+
return e ? /^(?:0\d{2,3}-?)?\d{7,8}(?:-\d{1,4})?$/.test(e) : !1;
|
|
1195
|
+
}
|
|
1196
|
+
function Or(e) {
|
|
1197
|
+
if (!e || !Be.test(e)) return !1;
|
|
1198
|
+
const t = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], n = ["1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"];
|
|
1199
|
+
let r = 0;
|
|
1200
|
+
for (let o = 0; o < 17; o++)
|
|
1201
|
+
r += parseInt(e[o]) * t[o];
|
|
1202
|
+
return n[r % 11] === e[17].toUpperCase();
|
|
1203
|
+
}
|
|
1204
|
+
function Lr(e) {
|
|
1205
|
+
return e ? We.test(e) : !1;
|
|
1206
|
+
}
|
|
1207
|
+
function $r(e) {
|
|
1208
|
+
return qe(e) || Xe(e);
|
|
1209
|
+
}
|
|
1210
|
+
function qe(e) {
|
|
1211
|
+
return e ? je.test(e) : !1;
|
|
1212
|
+
}
|
|
1213
|
+
function Xe(e) {
|
|
1214
|
+
return e ? /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/.test(e) || /^([0-9a-fA-F]{1,4}:){1,7}:$/.test(e) || /^([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}$/.test(e) || /^::([0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4}$/.test(e) : !1;
|
|
1215
|
+
}
|
|
1216
|
+
function Yr(e) {
|
|
1217
|
+
return e === "" || e === null || e === void 0 ? !1 : /^[1-9]\d*$/.test(String(e));
|
|
1218
|
+
}
|
|
1219
|
+
function Pr(e) {
|
|
1220
|
+
return e === "" || e === null || e === void 0 ? !1 : /^-[1-9]\d*$/.test(String(e));
|
|
1221
|
+
}
|
|
1222
|
+
function Nr(e) {
|
|
1223
|
+
return e === "" || e === null || e === void 0 ? !1 : /^-?\d+\.\d+$/.test(String(e));
|
|
1224
|
+
}
|
|
1225
|
+
function Rr(e) {
|
|
1226
|
+
return e === "" || e === null || e === void 0 ? !1 : /^(?:0|[1-9]\d*)(?:\.\d{1,2})?$/.test(String(e));
|
|
1227
|
+
}
|
|
1228
|
+
function Fr(e) {
|
|
1229
|
+
return e ? ze.test(e) : !1;
|
|
1230
|
+
}
|
|
1231
|
+
function Hr(e) {
|
|
1232
|
+
return e ? /^[a-zA-Z]+$/.test(e) : !1;
|
|
1233
|
+
}
|
|
1234
|
+
function Ur(e) {
|
|
1235
|
+
return e ? /^[a-z]+$/.test(e) : !1;
|
|
1236
|
+
}
|
|
1237
|
+
function Br(e) {
|
|
1238
|
+
return e ? /^[A-Z]+$/.test(e) : !1;
|
|
1239
|
+
}
|
|
1240
|
+
function Wr(e) {
|
|
1241
|
+
return e ? /^\d{16,19}$/.test(e.replace(/\s/g, "")) : !1;
|
|
1242
|
+
}
|
|
1243
|
+
function jr(e) {
|
|
1244
|
+
return e ? /^[1-9]\d{5}$/.test(e) : !1;
|
|
1245
|
+
}
|
|
1246
|
+
function zr(e) {
|
|
1247
|
+
return e ? /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][A-HJ-NP-Z0-9]{4,5}[A-HJ-NP-Z0-9挂学警港澳]$/.test(e) : !1;
|
|
1248
|
+
}
|
|
1249
|
+
function qr(e) {
|
|
1250
|
+
if (!e || !/^\d{4}-\d{2}-\d{2}$/.test(e)) return !1;
|
|
1251
|
+
const t = new Date(e);
|
|
1252
|
+
return !isNaN(t.getTime());
|
|
1253
|
+
}
|
|
1254
|
+
function Xr(e) {
|
|
1255
|
+
return e ? /^(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?$/.test(e) : !1;
|
|
1256
|
+
}
|
|
1257
|
+
function Gr(e, t) {
|
|
1258
|
+
return !e || !t ? !1 : t.test(e);
|
|
1259
|
+
}
|
|
1260
|
+
function Zr(e, t) {
|
|
1261
|
+
const n = [];
|
|
1262
|
+
for (const r of t)
|
|
1263
|
+
r.regex.test(e) || n.push(r.message || `${r.name} 校验失败`);
|
|
1264
|
+
return {
|
|
1265
|
+
valid: n.length === 0,
|
|
1266
|
+
errors: n
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
function me(e) {
|
|
1270
|
+
return e && e.split(/[/\\]/).pop() || "";
|
|
1271
|
+
}
|
|
1272
|
+
function D(e) {
|
|
1273
|
+
const n = (typeof e == "string" ? e : (e == null ? void 0 : e.name) || "").match(/\.([^.]+)$/);
|
|
1274
|
+
return n ? n[1].toLowerCase() : "";
|
|
1275
|
+
}
|
|
1276
|
+
function Vr(e) {
|
|
1277
|
+
const t = me(e), n = t.lastIndexOf(".");
|
|
1278
|
+
return n > 0 ? t.slice(0, n) : t;
|
|
1279
|
+
}
|
|
1280
|
+
function Jr(e) {
|
|
1281
|
+
return (e == null ? void 0 : e.size) || 0;
|
|
1282
|
+
}
|
|
1283
|
+
function Kr(e, t = 2) {
|
|
1284
|
+
if (e === 0) return "0 B";
|
|
1285
|
+
const n = 1024, r = ["B", "KB", "MB", "GB", "TB", "PB"], o = Math.floor(Math.log(e) / Math.log(n));
|
|
1286
|
+
return parseFloat((e / Math.pow(n, o)).toFixed(t)) + " " + r[o];
|
|
1287
|
+
}
|
|
1288
|
+
const Ge = ["jpg", "jpeg", "png", "gif", "bmp", "webp", "svg", "ico", "tiff", "heic", "heif"], Ze = ["mp4", "webm", "ogg", "avi", "mov", "wmv", "flv", "mkv", "m4v"], Ve = ["mp3", "wav", "ogg", "aac", "flac", "wma", "m4a"], Je = ["pdf"], Ke = ["doc", "docx"], Qe = ["xls", "xlsx"], et = ["zip", "rar", "7z", "tar", "gz", "bz2"];
|
|
1289
|
+
function tt(e) {
|
|
1290
|
+
return Ge.includes(D(e));
|
|
1291
|
+
}
|
|
1292
|
+
function nt(e) {
|
|
1293
|
+
return Ze.includes(D(e));
|
|
1294
|
+
}
|
|
1295
|
+
function rt(e) {
|
|
1296
|
+
return Ve.includes(D(e));
|
|
1297
|
+
}
|
|
1298
|
+
function ot(e) {
|
|
1299
|
+
return Je.includes(D(e));
|
|
1300
|
+
}
|
|
1301
|
+
function it(e) {
|
|
1302
|
+
return Ke.includes(D(e));
|
|
1303
|
+
}
|
|
1304
|
+
function st(e) {
|
|
1305
|
+
return Qe.includes(D(e));
|
|
1306
|
+
}
|
|
1307
|
+
function ct(e) {
|
|
1308
|
+
return et.includes(D(e));
|
|
1309
|
+
}
|
|
1310
|
+
function Qr(e) {
|
|
1311
|
+
return (e == null ? void 0 : e.type) || "";
|
|
1312
|
+
}
|
|
1313
|
+
function eo(e) {
|
|
1314
|
+
return tt(e) ? "image" : nt(e) ? "video" : rt(e) ? "audio" : ot(e) || it(e) || st(e) ? "document" : ct(e) ? "archive" : "other";
|
|
1315
|
+
}
|
|
1316
|
+
function at(e, t = "UTF-8") {
|
|
1317
|
+
return new Promise((n, r) => {
|
|
1318
|
+
const o = new FileReader();
|
|
1319
|
+
o.onload = () => n(o.result), o.onerror = () => r(new Error("读取文件失败")), o.readAsText(e, t);
|
|
1320
|
+
});
|
|
1321
|
+
}
|
|
1322
|
+
function K(e) {
|
|
1323
|
+
return new Promise((t, n) => {
|
|
1324
|
+
const r = new FileReader();
|
|
1325
|
+
r.onload = () => t(r.result), r.onerror = () => n(new Error("读取文件失败")), r.readAsDataURL(e);
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
function to(e) {
|
|
1329
|
+
return new Promise((t, n) => {
|
|
1330
|
+
const r = new FileReader();
|
|
1331
|
+
r.onload = () => t(r.result), r.onerror = () => n(new Error("读取文件失败")), r.readAsArrayBuffer(e);
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
async function no(e) {
|
|
1335
|
+
const t = await at(e);
|
|
1336
|
+
return JSON.parse(t);
|
|
1337
|
+
}
|
|
1338
|
+
function ut(e, t) {
|
|
1339
|
+
const n = document.createElement("a");
|
|
1340
|
+
n.href = e, n.download = t || me(e), n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
1341
|
+
}
|
|
1342
|
+
function ft(e, t) {
|
|
1343
|
+
const n = URL.createObjectURL(e);
|
|
1344
|
+
ut(n, t), setTimeout(() => URL.revokeObjectURL(n), 100);
|
|
1345
|
+
}
|
|
1346
|
+
function lt(e, t, n = "text/plain") {
|
|
1347
|
+
const r = new Blob([e], { type: n });
|
|
1348
|
+
ft(r, t);
|
|
1349
|
+
}
|
|
1350
|
+
function ro(e, t) {
|
|
1351
|
+
const n = JSON.stringify(e, null, 2);
|
|
1352
|
+
lt(n, t, "application/json");
|
|
1353
|
+
}
|
|
1354
|
+
function oo(e, t) {
|
|
1355
|
+
let n = e, r = t;
|
|
1356
|
+
if (e.includes(",")) {
|
|
1357
|
+
const s = e.split(","), a = s[0].match(/:(.*?);/);
|
|
1358
|
+
r = r || (a ? a[1] : "application/octet-stream"), n = s[1];
|
|
1359
|
+
}
|
|
1360
|
+
const o = atob(n), i = new Array(o.length);
|
|
1361
|
+
for (let s = 0; s < o.length; s++)
|
|
1362
|
+
i[s] = o.charCodeAt(s);
|
|
1363
|
+
const c = new Uint8Array(i);
|
|
1364
|
+
return new Blob([c], { type: r });
|
|
1365
|
+
}
|
|
1366
|
+
function io(e) {
|
|
1367
|
+
return K(e);
|
|
1368
|
+
}
|
|
1369
|
+
function so(e) {
|
|
1370
|
+
return K(e);
|
|
1371
|
+
}
|
|
1372
|
+
async function co(e) {
|
|
1373
|
+
return (await fetch(e)).blob();
|
|
1374
|
+
}
|
|
1375
|
+
function ao(e, t) {
|
|
1376
|
+
const n = e.split(","), r = n[0].match(/:(.*?);/)[1], o = atob(n[1]);
|
|
1377
|
+
let i = o.length;
|
|
1378
|
+
const c = new Uint8Array(i);
|
|
1379
|
+
for (; i--; )
|
|
1380
|
+
c[i] = o.charCodeAt(i);
|
|
1381
|
+
return new File([c], t, { type: r });
|
|
1382
|
+
}
|
|
1383
|
+
async function q(e) {
|
|
1384
|
+
return new Promise((t, n) => {
|
|
1385
|
+
const r = new Image();
|
|
1386
|
+
r.onload = () => t(r), r.onerror = () => n(new Error("图片加载失败")), typeof e == "string" ? r.src = e : K(e).then((o) => {
|
|
1387
|
+
r.src = o;
|
|
1388
|
+
});
|
|
1389
|
+
});
|
|
1390
|
+
}
|
|
1391
|
+
async function uo(e, t = {}) {
|
|
1392
|
+
const { quality: n = 0.8, maxWidth: r, maxHeight: o, type: i = "image/jpeg" } = t, c = await q(e);
|
|
1393
|
+
let { width: s, height: a } = c;
|
|
1394
|
+
r && s > r && (a = a * r / s, s = r), o && a > o && (s = s * o / a, a = o);
|
|
1395
|
+
const u = document.createElement("canvas");
|
|
1396
|
+
return u.width = s, u.height = a, u.getContext("2d").drawImage(c, 0, 0, s, a), new Promise((f) => {
|
|
1397
|
+
u.toBlob((l) => f(l), i, n);
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
async function fo(e, t, n, r) {
|
|
1401
|
+
const o = await q(e), i = document.createElement("canvas");
|
|
1402
|
+
i.width = t, i.height = n, i.getContext("2d").drawImage(o, 0, 0, t, n);
|
|
1403
|
+
const s = r || e.type || "image/png";
|
|
1404
|
+
return new Promise((a) => {
|
|
1405
|
+
i.toBlob((u) => a(u), s);
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
async function dt(e) {
|
|
1409
|
+
const t = await q(e);
|
|
1410
|
+
return { width: t.width, height: t.height };
|
|
1411
|
+
}
|
|
1412
|
+
async function lo(e, t, n) {
|
|
1413
|
+
const r = await q(e), o = document.createElement("canvas"), i = o.getContext("2d"), c = t * Math.PI / 180, s = Math.abs(Math.sin(c)), a = Math.abs(Math.cos(c));
|
|
1414
|
+
o.width = r.width * a + r.height * s, o.height = r.width * s + r.height * a, i.translate(o.width / 2, o.height / 2), i.rotate(c), i.drawImage(r, -r.width / 2, -r.height / 2);
|
|
1415
|
+
const u = n || e.type || "image/png";
|
|
1416
|
+
return new Promise((d) => {
|
|
1417
|
+
o.toBlob((f) => d(f), u);
|
|
1418
|
+
});
|
|
1419
|
+
}
|
|
1420
|
+
function mo(e, t) {
|
|
1421
|
+
return e.size <= t;
|
|
1422
|
+
}
|
|
1423
|
+
function po(e, t) {
|
|
1424
|
+
if (!t) return !0;
|
|
1425
|
+
const n = Array.isArray(t) ? t : t.split(",").map((i) => i.trim()), r = "." + D(e), o = e.type;
|
|
1426
|
+
return n.some((i) => {
|
|
1427
|
+
if (i.startsWith("."))
|
|
1428
|
+
return r.toLowerCase() === i.toLowerCase();
|
|
1429
|
+
if (i.endsWith("/*")) {
|
|
1430
|
+
const c = i.slice(0, -1);
|
|
1431
|
+
return o.startsWith(c);
|
|
1432
|
+
}
|
|
1433
|
+
return o === i;
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
async function go(e, t = {}) {
|
|
1437
|
+
const { minWidth: n, maxWidth: r, minHeight: o, maxHeight: i, width: c, height: s } = t, a = await dt(e);
|
|
1438
|
+
return !(c !== void 0 && a.width !== c || s !== void 0 && a.height !== s || n !== void 0 && a.width < n || r !== void 0 && a.width > r || o !== void 0 && a.height < o || i !== void 0 && a.height > i);
|
|
1439
|
+
}
|
|
1440
|
+
function ho(e, t = null) {
|
|
1441
|
+
try {
|
|
1442
|
+
const n = localStorage.getItem(e);
|
|
1443
|
+
if (n === null) return t;
|
|
1444
|
+
const r = JSON.parse(n);
|
|
1445
|
+
return r && r.__expires__ && Date.now() > r.__expires__ ? (mt(e), t) : r && r.__value__ !== void 0 ? r.__value__ : r;
|
|
1446
|
+
} catch {
|
|
1447
|
+
return t;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
function yo(e, t, n) {
|
|
1451
|
+
try {
|
|
1452
|
+
let r;
|
|
1453
|
+
if (n) {
|
|
1454
|
+
const o = n instanceof Date ? n.getTime() : Date.now() + n;
|
|
1455
|
+
r = { __value__: t, __expires__: o };
|
|
1456
|
+
} else
|
|
1457
|
+
r = t;
|
|
1458
|
+
localStorage.setItem(e, JSON.stringify(r));
|
|
1459
|
+
} catch (r) {
|
|
1460
|
+
console.warn("LocalStorage setItem failed:", r);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
function mt(e) {
|
|
1464
|
+
try {
|
|
1465
|
+
localStorage.removeItem(e);
|
|
1466
|
+
} catch (t) {
|
|
1467
|
+
console.warn("LocalStorage removeItem failed:", t);
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
function wo() {
|
|
1471
|
+
try {
|
|
1472
|
+
localStorage.clear();
|
|
1473
|
+
} catch (e) {
|
|
1474
|
+
console.warn("LocalStorage clear failed:", e);
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
function _o(e) {
|
|
1478
|
+
try {
|
|
1479
|
+
return localStorage.getItem(e) !== null;
|
|
1480
|
+
} catch {
|
|
1481
|
+
return !1;
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
function xo() {
|
|
1485
|
+
try {
|
|
1486
|
+
return Object.keys(localStorage);
|
|
1487
|
+
} catch {
|
|
1488
|
+
return [];
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
function bo(e, t = null) {
|
|
1492
|
+
try {
|
|
1493
|
+
const n = sessionStorage.getItem(e);
|
|
1494
|
+
return n === null ? t : JSON.parse(n);
|
|
1495
|
+
} catch {
|
|
1496
|
+
return t;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
function Eo(e, t) {
|
|
1500
|
+
try {
|
|
1501
|
+
sessionStorage.setItem(e, JSON.stringify(t));
|
|
1502
|
+
} catch (n) {
|
|
1503
|
+
console.warn("SessionStorage setItem failed:", n);
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
function So(e) {
|
|
1507
|
+
try {
|
|
1508
|
+
sessionStorage.removeItem(e);
|
|
1509
|
+
} catch (t) {
|
|
1510
|
+
console.warn("SessionStorage removeItem failed:", t);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
function vo() {
|
|
1514
|
+
try {
|
|
1515
|
+
sessionStorage.clear();
|
|
1516
|
+
} catch (e) {
|
|
1517
|
+
console.warn("SessionStorage clear failed:", e);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
function Mo(e) {
|
|
1521
|
+
try {
|
|
1522
|
+
return sessionStorage.getItem(e) !== null;
|
|
1523
|
+
} catch {
|
|
1524
|
+
return !1;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
function Do() {
|
|
1528
|
+
try {
|
|
1529
|
+
return Object.keys(sessionStorage);
|
|
1530
|
+
} catch {
|
|
1531
|
+
return [];
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
function pt(e) {
|
|
1535
|
+
if (!e) return null;
|
|
1536
|
+
const t = document.cookie.split(";");
|
|
1537
|
+
for (const n of t) {
|
|
1538
|
+
const [r, o] = n.trim().split("=");
|
|
1539
|
+
if (r === e)
|
|
1540
|
+
try {
|
|
1541
|
+
return decodeURIComponent(o);
|
|
1542
|
+
} catch {
|
|
1543
|
+
return o;
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
return null;
|
|
1547
|
+
}
|
|
1548
|
+
function gt(e, t, n = {}) {
|
|
1549
|
+
const {
|
|
1550
|
+
expires: r,
|
|
1551
|
+
path: o = "/",
|
|
1552
|
+
domain: i,
|
|
1553
|
+
secure: c,
|
|
1554
|
+
sameSite: s
|
|
1555
|
+
} = n;
|
|
1556
|
+
let a = `${e}=${encodeURIComponent(t)}`;
|
|
1557
|
+
if (r) {
|
|
1558
|
+
let u;
|
|
1559
|
+
r instanceof Date ? u = r : typeof r == "number" && (u = new Date(Date.now() + r * 24 * 60 * 60 * 1e3)), u && (a += `; expires=${u.toUTCString()}`);
|
|
1560
|
+
}
|
|
1561
|
+
o && (a += `; path=${o}`), i && (a += `; domain=${i}`), c && (a += "; secure"), s && (a += `; SameSite=${s}`), document.cookie = a;
|
|
1562
|
+
}
|
|
1563
|
+
function To(e, t = {}) {
|
|
1564
|
+
gt(e, "", { ...t, expires: /* @__PURE__ */ new Date(0) });
|
|
1565
|
+
}
|
|
1566
|
+
function Ao(e) {
|
|
1567
|
+
return pt(e) !== null;
|
|
1568
|
+
}
|
|
1569
|
+
function Co() {
|
|
1570
|
+
const e = {};
|
|
1571
|
+
return document.cookie.split(";").forEach((t) => {
|
|
1572
|
+
const [n, r] = t.trim().split("=");
|
|
1573
|
+
if (n)
|
|
1574
|
+
try {
|
|
1575
|
+
e[n] = decodeURIComponent(r);
|
|
1576
|
+
} catch {
|
|
1577
|
+
e[n] = r;
|
|
1578
|
+
}
|
|
1579
|
+
}), e;
|
|
1580
|
+
}
|
|
1581
|
+
function Io(e = "local", t = "") {
|
|
1582
|
+
const n = e === "session" ? sessionStorage : localStorage, r = (o) => t ? `${t}:${o}` : o;
|
|
1583
|
+
return {
|
|
1584
|
+
get(o, i = null) {
|
|
1585
|
+
try {
|
|
1586
|
+
const c = n.getItem(r(o));
|
|
1587
|
+
if (c === null) return i;
|
|
1588
|
+
const s = JSON.parse(c);
|
|
1589
|
+
return s && s.__expires__ && Date.now() > s.__expires__ ? (this.remove(o), i) : s && s.__value__ !== void 0 ? s.__value__ : s;
|
|
1590
|
+
} catch {
|
|
1591
|
+
return i;
|
|
1592
|
+
}
|
|
1593
|
+
},
|
|
1594
|
+
set(o, i, c) {
|
|
1595
|
+
try {
|
|
1596
|
+
let s;
|
|
1597
|
+
if (c) {
|
|
1598
|
+
const a = c instanceof Date ? c.getTime() : Date.now() + c;
|
|
1599
|
+
s = { __value__: i, __expires__: a };
|
|
1600
|
+
} else
|
|
1601
|
+
s = i;
|
|
1602
|
+
n.setItem(r(o), JSON.stringify(s));
|
|
1603
|
+
} catch (s) {
|
|
1604
|
+
console.warn("Storage setItem failed:", s);
|
|
1605
|
+
}
|
|
1606
|
+
},
|
|
1607
|
+
remove(o) {
|
|
1608
|
+
try {
|
|
1609
|
+
n.removeItem(r(o));
|
|
1610
|
+
} catch (i) {
|
|
1611
|
+
console.warn("Storage removeItem failed:", i);
|
|
1612
|
+
}
|
|
1613
|
+
},
|
|
1614
|
+
clear() {
|
|
1615
|
+
try {
|
|
1616
|
+
t ? Object.keys(n).forEach((i) => {
|
|
1617
|
+
i.startsWith(`${t}:`) && n.removeItem(i);
|
|
1618
|
+
}) : n.clear();
|
|
1619
|
+
} catch (o) {
|
|
1620
|
+
console.warn("Storage clear failed:", o);
|
|
1621
|
+
}
|
|
1622
|
+
},
|
|
1623
|
+
has(o) {
|
|
1624
|
+
try {
|
|
1625
|
+
return n.getItem(r(o)) !== null;
|
|
1626
|
+
} catch {
|
|
1627
|
+
return !1;
|
|
1628
|
+
}
|
|
1629
|
+
},
|
|
1630
|
+
keys() {
|
|
1631
|
+
try {
|
|
1632
|
+
const o = Object.keys(n);
|
|
1633
|
+
return t ? o.filter((i) => i.startsWith(`${t}:`)).map((i) => i.slice(t.length + 1)) : o;
|
|
1634
|
+
} catch {
|
|
1635
|
+
return [];
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
function ko(e = "local") {
|
|
1641
|
+
try {
|
|
1642
|
+
const t = e === "session" ? sessionStorage : localStorage;
|
|
1643
|
+
let n = 0;
|
|
1644
|
+
for (const o in t)
|
|
1645
|
+
t.hasOwnProperty(o) && (n += (o.length + t.getItem(o).length) * 2);
|
|
1646
|
+
return {
|
|
1647
|
+
used: n,
|
|
1648
|
+
usedFormatted: ((o) => o < 1024 ? o + " B" : o < 1024 * 1024 ? (o / 1024).toFixed(2) + " KB" : (o / (1024 * 1024)).toFixed(2) + " MB")(n)
|
|
1649
|
+
};
|
|
1650
|
+
} catch {
|
|
1651
|
+
return { used: 0, usedFormatted: "0 B" };
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
function Oo(e = "local") {
|
|
1655
|
+
try {
|
|
1656
|
+
if (e === "cookie") {
|
|
1657
|
+
document.cookie = "__test__=1";
|
|
1658
|
+
const r = document.cookie.indexOf("__test__") !== -1;
|
|
1659
|
+
return document.cookie = "__test__=; expires=Thu, 01 Jan 1970 00:00:00 GMT", r;
|
|
1660
|
+
}
|
|
1661
|
+
const t = e === "session" ? sessionStorage : localStorage, n = "__storage_test__";
|
|
1662
|
+
return t.setItem(n, "test"), t.removeItem(n), !0;
|
|
1663
|
+
} catch {
|
|
1664
|
+
return !1;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
function Lo(e, t) {
|
|
1668
|
+
const n = (r) => {
|
|
1669
|
+
if (r.storageArea !== localStorage || e && r.key !== e) return;
|
|
1670
|
+
let o = r.newValue, i = r.oldValue;
|
|
1671
|
+
try {
|
|
1672
|
+
o = JSON.parse(o), o && o.__value__ !== void 0 && (o = o.__value__);
|
|
1673
|
+
} catch {
|
|
1674
|
+
}
|
|
1675
|
+
try {
|
|
1676
|
+
i = JSON.parse(i), i && i.__value__ !== void 0 && (i = i.__value__);
|
|
1677
|
+
} catch {
|
|
1678
|
+
}
|
|
1679
|
+
t(o, i, r.key);
|
|
1680
|
+
};
|
|
1681
|
+
return window.addEventListener("storage", n), () => {
|
|
1682
|
+
window.removeEventListener("storage", n);
|
|
1683
|
+
};
|
|
1684
|
+
}
|
|
1685
|
+
function ht(e) {
|
|
1686
|
+
if (!e) return "";
|
|
1687
|
+
const t = {
|
|
1688
|
+
"&": "&",
|
|
1689
|
+
"<": "<",
|
|
1690
|
+
">": ">",
|
|
1691
|
+
'"': """,
|
|
1692
|
+
"'": "'",
|
|
1693
|
+
"/": "/",
|
|
1694
|
+
"`": "`",
|
|
1695
|
+
"=": "="
|
|
1696
|
+
};
|
|
1697
|
+
return String(e).replace(/[&<>"'`=/]/g, (n) => t[n]);
|
|
1698
|
+
}
|
|
1699
|
+
function $o(e) {
|
|
1700
|
+
if (!e) return "";
|
|
1701
|
+
const t = {
|
|
1702
|
+
"&": "&",
|
|
1703
|
+
"<": "<",
|
|
1704
|
+
">": ">",
|
|
1705
|
+
""": '"',
|
|
1706
|
+
"'": "'",
|
|
1707
|
+
"/": "/",
|
|
1708
|
+
"`": "`",
|
|
1709
|
+
"=": "=",
|
|
1710
|
+
"'": "'"
|
|
1711
|
+
};
|
|
1712
|
+
return String(e).replace(/&(amp|lt|gt|quot|#x27|#x2F|#x60|#x3D|#39);/g, (n) => t[n] || n);
|
|
1713
|
+
}
|
|
1714
|
+
function Yo(e, t = {}) {
|
|
1715
|
+
if (!e) return "";
|
|
1716
|
+
const {
|
|
1717
|
+
allowedTags: n = ["p", "br", "b", "i", "u", "strong", "em", "a", "ul", "ol", "li", "span", "div"],
|
|
1718
|
+
allowedAttrs: r = ["href", "class", "style"]
|
|
1719
|
+
} = t, o = document.createElement("div");
|
|
1720
|
+
o.innerHTML = e;
|
|
1721
|
+
const i = (c) => {
|
|
1722
|
+
Array.from(c.children).forEach((a) => {
|
|
1723
|
+
const u = a.tagName.toLowerCase();
|
|
1724
|
+
if (!n.includes(u)) {
|
|
1725
|
+
a.outerHTML = ht(a.textContent);
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
Array.from(a.attributes).forEach((f) => {
|
|
1729
|
+
if (r.includes(f.name.toLowerCase()) || a.removeAttribute(f.name), f.name.toLowerCase() === "href") {
|
|
1730
|
+
const l = f.value.toLowerCase().trim();
|
|
1731
|
+
(l.startsWith("javascript:") || l.startsWith("data:")) && a.removeAttribute("href");
|
|
1732
|
+
}
|
|
1733
|
+
if (f.name.toLowerCase() === "style") {
|
|
1734
|
+
const l = f.value.toLowerCase();
|
|
1735
|
+
(l.includes("expression") || l.includes("javascript:")) && a.removeAttribute("style");
|
|
1736
|
+
}
|
|
1737
|
+
}), i(a);
|
|
1738
|
+
});
|
|
1739
|
+
};
|
|
1740
|
+
return i(o), o.innerHTML;
|
|
1741
|
+
}
|
|
1742
|
+
function Po(e) {
|
|
1743
|
+
return e ? String(e).replace(/<[^>]*>/g, "") : "";
|
|
1744
|
+
}
|
|
1745
|
+
function No(e) {
|
|
1746
|
+
return e ? String(e).replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/"/g, '\\"').replace(/\x00/g, "\\0").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\x1a/g, "\\Z") : "";
|
|
1747
|
+
}
|
|
1748
|
+
function Ro(e) {
|
|
1749
|
+
return e ? encodeURIComponent(e) : "";
|
|
1750
|
+
}
|
|
1751
|
+
function Fo(e) {
|
|
1752
|
+
if (!e) return "";
|
|
1753
|
+
try {
|
|
1754
|
+
return decodeURIComponent(e);
|
|
1755
|
+
} catch {
|
|
1756
|
+
return e;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
function Ho(e) {
|
|
1760
|
+
if (!e) return !1;
|
|
1761
|
+
try {
|
|
1762
|
+
return new URL(e), !0;
|
|
1763
|
+
} catch {
|
|
1764
|
+
return !1;
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
function yt(e) {
|
|
1768
|
+
if (!e) return !1;
|
|
1769
|
+
const t = e.trim().toLowerCase();
|
|
1770
|
+
return !["javascript:", "data:", "vbscript:"].some((r) => t.startsWith(r));
|
|
1771
|
+
}
|
|
1772
|
+
function Uo(e, t = "#") {
|
|
1773
|
+
return e && yt(e) ? e : t;
|
|
1774
|
+
}
|
|
1775
|
+
function Bo(e) {
|
|
1776
|
+
if (!e) return "";
|
|
1777
|
+
const t = String(e);
|
|
1778
|
+
return t.length < 7 ? t : t.replace(/(\d{3})\d{4}(\d+)/, "$1****$2");
|
|
1779
|
+
}
|
|
1780
|
+
function Wo(e) {
|
|
1781
|
+
if (!e) return "";
|
|
1782
|
+
const t = String(e);
|
|
1783
|
+
return t.length < 8 ? t : t.replace(/^(.{3})(.*)(.{4})$/, (n, r, o, i) => r + "*".repeat(o.length) + i);
|
|
1784
|
+
}
|
|
1785
|
+
function jo(e) {
|
|
1786
|
+
if (!e) return "";
|
|
1787
|
+
const t = String(e), n = t.indexOf("@");
|
|
1788
|
+
if (n < 1) return t;
|
|
1789
|
+
const r = t.slice(0, n), o = t.slice(n);
|
|
1790
|
+
return r.length <= 2 ? r[0] + "*" + o : r[0] + "*".repeat(Math.min(r.length - 2, 3)) + r.slice(-1) + o;
|
|
1791
|
+
}
|
|
1792
|
+
function zo(e) {
|
|
1793
|
+
if (!e) return "";
|
|
1794
|
+
const t = String(e).replace(/\s/g, "");
|
|
1795
|
+
if (t.length < 8) return t;
|
|
1796
|
+
const n = t.slice(0, 4), r = t.slice(-4), o = "*".repeat(t.length - 8);
|
|
1797
|
+
return (n + o + r).replace(/(.{4})/g, "$1 ").trim();
|
|
1798
|
+
}
|
|
1799
|
+
function qo(e) {
|
|
1800
|
+
if (!e) return "";
|
|
1801
|
+
const t = String(e);
|
|
1802
|
+
return t.length <= 1 ? t : t.length === 2 ? t[0] + "*" : t[0] + "*".repeat(t.length - 2) + t.slice(-1);
|
|
1803
|
+
}
|
|
1804
|
+
function Xo(e, t = 3, n = 4, r = "*") {
|
|
1805
|
+
if (!e) return "";
|
|
1806
|
+
const o = String(e);
|
|
1807
|
+
if (o.length <= t + n) return o;
|
|
1808
|
+
const i = o.slice(0, t), c = o.slice(-n), s = r.repeat(o.length - t - n);
|
|
1809
|
+
return i + s + c;
|
|
1810
|
+
}
|
|
1811
|
+
function Go(e) {
|
|
1812
|
+
const t = [];
|
|
1813
|
+
let n = 0;
|
|
1814
|
+
if (!e)
|
|
1815
|
+
return { score: 0, level: "weak", tips: ["请输入密码"] };
|
|
1816
|
+
const r = e.length;
|
|
1817
|
+
return r < 6 ? t.push("密码长度至少 6 位") : r >= 8 && (n += 1, r >= 12 && (n += 1)), /[a-z]/.test(e) && (n += 0.5), /[A-Z]/.test(e) && (n += 0.5), /\d/.test(e) && (n += 1), /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(e) && (n += 1), !/[a-z]/.test(e) && !/[A-Z]/.test(e) && t.push("建议包含字母"), /\d/.test(e) || t.push("建议包含数字"), /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(e) || t.push("建议包含特殊字符"), /(.)\1{2,}/.test(e) && (n -= 1, t.push("避免连续重复字符")), /^(123|abc|qwe|password|admin)/i.test(e) && (n -= 1, t.push("避免使用常见密码")), n = Math.max(0, Math.min(4, Math.floor(n))), {
|
|
1818
|
+
score: n,
|
|
1819
|
+
level: ["weak", "weak", "fair", "good", "strong"][n],
|
|
1820
|
+
tips: t
|
|
1821
|
+
};
|
|
1822
|
+
}
|
|
1823
|
+
function Zo(e, t = {}) {
|
|
1824
|
+
const {
|
|
1825
|
+
minLength: n = 8,
|
|
1826
|
+
requireLowercase: r = !0,
|
|
1827
|
+
requireUppercase: o = !0,
|
|
1828
|
+
requireNumber: i = !0,
|
|
1829
|
+
requireSpecial: c = !1
|
|
1830
|
+
} = t;
|
|
1831
|
+
return !(!e || e.length < n || r && !/[a-z]/.test(e) || o && !/[A-Z]/.test(e) || i && !/\d/.test(e) || c && !/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(e));
|
|
1832
|
+
}
|
|
1833
|
+
const wt = Object.prototype.toString;
|
|
1834
|
+
function b(e) {
|
|
1835
|
+
return wt.call(e);
|
|
1836
|
+
}
|
|
1837
|
+
function Vo(e) {
|
|
1838
|
+
return typeof e == "string";
|
|
1839
|
+
}
|
|
1840
|
+
function Jo(e) {
|
|
1841
|
+
return typeof e == "number" && !Number.isNaN(e);
|
|
1842
|
+
}
|
|
1843
|
+
function Ko(e) {
|
|
1844
|
+
return typeof e == "boolean";
|
|
1845
|
+
}
|
|
1846
|
+
function Qo(e) {
|
|
1847
|
+
return e === null;
|
|
1848
|
+
}
|
|
1849
|
+
function ei(e) {
|
|
1850
|
+
return e === void 0;
|
|
1851
|
+
}
|
|
1852
|
+
function ti(e) {
|
|
1853
|
+
return e == null;
|
|
1854
|
+
}
|
|
1855
|
+
function ni(e) {
|
|
1856
|
+
return typeof e == "symbol";
|
|
1857
|
+
}
|
|
1858
|
+
function ri(e) {
|
|
1859
|
+
return typeof e == "bigint";
|
|
1860
|
+
}
|
|
1861
|
+
function oi(e) {
|
|
1862
|
+
return e !== null && typeof e == "object";
|
|
1863
|
+
}
|
|
1864
|
+
function pe(e) {
|
|
1865
|
+
if (b(e) !== "[object Object]") return !1;
|
|
1866
|
+
const t = Object.getPrototypeOf(e);
|
|
1867
|
+
return t === null || t === Object.prototype;
|
|
1868
|
+
}
|
|
1869
|
+
function ii(e) {
|
|
1870
|
+
return Array.isArray(e);
|
|
1871
|
+
}
|
|
1872
|
+
function si(e) {
|
|
1873
|
+
return typeof e == "function";
|
|
1874
|
+
}
|
|
1875
|
+
function ci(e) {
|
|
1876
|
+
return b(e) === "[object Date]";
|
|
1877
|
+
}
|
|
1878
|
+
function ai(e) {
|
|
1879
|
+
return b(e) === "[object RegExp]";
|
|
1880
|
+
}
|
|
1881
|
+
function ui(e) {
|
|
1882
|
+
return b(e) === "[object Error]" || e instanceof Error;
|
|
1883
|
+
}
|
|
1884
|
+
function fi(e) {
|
|
1885
|
+
return b(e) === "[object Map]";
|
|
1886
|
+
}
|
|
1887
|
+
function li(e) {
|
|
1888
|
+
return b(e) === "[object Set]";
|
|
1889
|
+
}
|
|
1890
|
+
function di(e) {
|
|
1891
|
+
return b(e) === "[object WeakMap]";
|
|
1892
|
+
}
|
|
1893
|
+
function mi(e) {
|
|
1894
|
+
return b(e) === "[object WeakSet]";
|
|
1895
|
+
}
|
|
1896
|
+
function _t(e) {
|
|
1897
|
+
return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function" && typeof e.catch == "function";
|
|
1898
|
+
}
|
|
1899
|
+
function pi(e) {
|
|
1900
|
+
return Number.isNaN(e);
|
|
1901
|
+
}
|
|
1902
|
+
function gi(e) {
|
|
1903
|
+
return Number.isFinite(e);
|
|
1904
|
+
}
|
|
1905
|
+
function hi(e) {
|
|
1906
|
+
return Number.isInteger(e);
|
|
1907
|
+
}
|
|
1908
|
+
function yi(e) {
|
|
1909
|
+
return e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
1910
|
+
}
|
|
1911
|
+
function wi(e) {
|
|
1912
|
+
return e == null ? !0 : typeof e == "string" ? e === "" : Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : pe(e) ? Object.keys(e).length === 0 : !1;
|
|
1913
|
+
}
|
|
1914
|
+
function _i(e) {
|
|
1915
|
+
return pe(e) && Object.keys(e).length === 0;
|
|
1916
|
+
}
|
|
1917
|
+
function xi(e) {
|
|
1918
|
+
return Array.isArray(e) && e.length === 0;
|
|
1919
|
+
}
|
|
1920
|
+
function bi(e) {
|
|
1921
|
+
return !!(e && e.nodeType === 1);
|
|
1922
|
+
}
|
|
1923
|
+
function Ei(e) {
|
|
1924
|
+
return e != null && e === e.window;
|
|
1925
|
+
}
|
|
1926
|
+
function Si(e) {
|
|
1927
|
+
return !!(e && e.nodeType === 9);
|
|
1928
|
+
}
|
|
1929
|
+
function vi(e) {
|
|
1930
|
+
if (e === null) return "null";
|
|
1931
|
+
if (e === void 0) return "undefined";
|
|
1932
|
+
const n = b(e).match(/\[object (\w+)\]/);
|
|
1933
|
+
return n ? n[1].toLowerCase() : "unknown";
|
|
1934
|
+
}
|
|
1935
|
+
function Mi(e) {
|
|
1936
|
+
return e === null ? "null" : Array.isArray(e) ? "array" : e instanceof Date ? "date" : e instanceof RegExp ? "regexp" : e instanceof Map ? "map" : e instanceof Set ? "set" : e instanceof Error ? "error" : _t(e) ? "promise" : typeof e;
|
|
1937
|
+
}
|
|
1938
|
+
function xt(e, t) {
|
|
1939
|
+
if (!g(e)) return "";
|
|
1940
|
+
const n = t !== void 0 ? e.toFixed(t).split(".") : String(e).split(".");
|
|
1941
|
+
return n[0] = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","), n.join(".");
|
|
1942
|
+
}
|
|
1943
|
+
function Di(e, t = "¥", n = 2) {
|
|
1944
|
+
if (!g(e)) return "";
|
|
1945
|
+
const r = xt(Math.abs(e), n);
|
|
1946
|
+
return (e < 0 ? "-" : "") + t + r;
|
|
1947
|
+
}
|
|
1948
|
+
function Ti(e, t = 2, n = !0) {
|
|
1949
|
+
return g(e) ? (n ? e * 100 : e).toFixed(t) + "%" : "";
|
|
1950
|
+
}
|
|
1951
|
+
function Ai(e, t = 2) {
|
|
1952
|
+
return g(e) ? e.toFixed(t) : "";
|
|
1953
|
+
}
|
|
1954
|
+
function Ci(e) {
|
|
1955
|
+
if (!Q(e)) return "";
|
|
1956
|
+
const t = Math.abs(e), n = t % 100, r = t % 10;
|
|
1957
|
+
let o = "th";
|
|
1958
|
+
return (n < 11 || n > 13) && (r === 1 ? o = "st" : r === 2 ? o = "nd" : r === 3 && (o = "rd")), e + o;
|
|
1959
|
+
}
|
|
1960
|
+
function g(e) {
|
|
1961
|
+
return typeof e == "number" && !Number.isNaN(e) && Number.isFinite(e);
|
|
1962
|
+
}
|
|
1963
|
+
function Q(e) {
|
|
1964
|
+
return g(e) && Number.isInteger(e);
|
|
1965
|
+
}
|
|
1966
|
+
function Ii(e) {
|
|
1967
|
+
return g(e) && !Number.isInteger(e);
|
|
1968
|
+
}
|
|
1969
|
+
function ki(e) {
|
|
1970
|
+
return g(e) && e > 0;
|
|
1971
|
+
}
|
|
1972
|
+
function Oi(e) {
|
|
1973
|
+
return g(e) && e < 0;
|
|
1974
|
+
}
|
|
1975
|
+
function Li(e) {
|
|
1976
|
+
return Q(e) && e % 2 === 0;
|
|
1977
|
+
}
|
|
1978
|
+
function $i(e) {
|
|
1979
|
+
return Q(e) && e % 2 !== 0;
|
|
1980
|
+
}
|
|
1981
|
+
function Yi(e, t, n, r = !0) {
|
|
1982
|
+
return !g(e) || !g(t) || !g(n) ? !1 : r ? e >= t && e <= n : e > t && e < n;
|
|
1983
|
+
}
|
|
1984
|
+
function M(e) {
|
|
1985
|
+
const t = String(e), n = t.indexOf(".");
|
|
1986
|
+
return n === -1 ? 0 : t.length - n - 1;
|
|
1987
|
+
}
|
|
1988
|
+
function B(e) {
|
|
1989
|
+
return Number(String(e).replace(".", ""));
|
|
1990
|
+
}
|
|
1991
|
+
function Pi(e, t) {
|
|
1992
|
+
const n = M(e), r = M(t), o = Math.max(n, r), i = Math.pow(10, o);
|
|
1993
|
+
return (Math.round(e * i) + Math.round(t * i)) / i;
|
|
1994
|
+
}
|
|
1995
|
+
function Ni(e, t) {
|
|
1996
|
+
const n = M(e), r = M(t), o = Math.max(n, r), i = Math.pow(10, o);
|
|
1997
|
+
return (Math.round(e * i) - Math.round(t * i)) / i;
|
|
1998
|
+
}
|
|
1999
|
+
function X(e, t) {
|
|
2000
|
+
const n = M(e), r = M(t), o = B(e), i = B(t);
|
|
2001
|
+
return o * i / Math.pow(10, n + r);
|
|
2002
|
+
}
|
|
2003
|
+
function Ri(e, t) {
|
|
2004
|
+
if (t === 0) return NaN;
|
|
2005
|
+
const n = M(e), r = M(t), o = B(e), i = B(t);
|
|
2006
|
+
return X(o / i, Math.pow(10, r - n));
|
|
2007
|
+
}
|
|
2008
|
+
function bt(e, t = 0) {
|
|
2009
|
+
if (!g(e)) return NaN;
|
|
2010
|
+
const n = Math.pow(10, t);
|
|
2011
|
+
return Math.round(X(e, n)) / n;
|
|
2012
|
+
}
|
|
2013
|
+
function Fi(e, t = 0) {
|
|
2014
|
+
if (!g(e)) return NaN;
|
|
2015
|
+
const n = Math.pow(10, t);
|
|
2016
|
+
return Math.floor(X(e, n)) / n;
|
|
2017
|
+
}
|
|
2018
|
+
function Hi(e, t = 0) {
|
|
2019
|
+
if (!g(e)) return NaN;
|
|
2020
|
+
const n = Math.pow(10, t);
|
|
2021
|
+
return Math.ceil(X(e, n)) / n;
|
|
2022
|
+
}
|
|
2023
|
+
function Ui(e, t = 2) {
|
|
2024
|
+
if (e === 0) return "0 B";
|
|
2025
|
+
if (!g(e)) return "";
|
|
2026
|
+
const n = 1024, r = ["B", "KB", "MB", "GB", "TB", "PB"], o = Math.floor(Math.log(e) / Math.log(n));
|
|
2027
|
+
return parseFloat((e / Math.pow(n, o)).toFixed(t)) + " " + r[o];
|
|
2028
|
+
}
|
|
2029
|
+
function Bi(e, t = 2) {
|
|
2030
|
+
return g(e) ? bt(e, t).toFixed(t) : "";
|
|
2031
|
+
}
|
|
2032
|
+
function Wi(e) {
|
|
2033
|
+
return e ? e.charAt(0).toUpperCase() + e.slice(1).toLowerCase() : "";
|
|
2034
|
+
}
|
|
2035
|
+
function ji(e) {
|
|
2036
|
+
return e ? e.replace(/\b\w/g, (t) => t.toUpperCase()) : "";
|
|
2037
|
+
}
|
|
2038
|
+
function Et(e) {
|
|
2039
|
+
return e ? e.replace(/[-_\s]+(.)?/g, (t, n) => n ? n.toUpperCase() : "").replace(/^./, (t) => t.toLowerCase()) : "";
|
|
2040
|
+
}
|
|
2041
|
+
function zi(e) {
|
|
2042
|
+
if (!e) return "";
|
|
2043
|
+
const t = Et(e);
|
|
2044
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
2045
|
+
}
|
|
2046
|
+
function qi(e) {
|
|
2047
|
+
return e ? e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase() : "";
|
|
2048
|
+
}
|
|
2049
|
+
function Xi(e) {
|
|
2050
|
+
return e ? e.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase() : "";
|
|
2051
|
+
}
|
|
2052
|
+
function A(e) {
|
|
2053
|
+
return e == null || e === "";
|
|
2054
|
+
}
|
|
2055
|
+
function St(e) {
|
|
2056
|
+
return e == null || e.trim() === "";
|
|
2057
|
+
}
|
|
2058
|
+
function Gi(e) {
|
|
2059
|
+
return A(e) ? !1 : /^\d+$/.test(e);
|
|
2060
|
+
}
|
|
2061
|
+
function Zi(e) {
|
|
2062
|
+
return A(e) ? !1 : /^[a-zA-Z]+$/.test(e);
|
|
2063
|
+
}
|
|
2064
|
+
function Vi(e) {
|
|
2065
|
+
return A(e) ? !1 : /^[a-zA-Z0-9]+$/.test(e);
|
|
2066
|
+
}
|
|
2067
|
+
function Ji(e) {
|
|
2068
|
+
return A(e) ? 0 : e.length;
|
|
2069
|
+
}
|
|
2070
|
+
function Ki(e) {
|
|
2071
|
+
return St(e) ? 0 : e.trim().split(/\s+/).length;
|
|
2072
|
+
}
|
|
2073
|
+
function Qi(e) {
|
|
2074
|
+
return A(e) ? 0 : e.split(/\r\n|\r|\n/).length;
|
|
2075
|
+
}
|
|
2076
|
+
function es(e, t) {
|
|
2077
|
+
if (A(e) || A(t)) return 0;
|
|
2078
|
+
let n = 0, r = 0;
|
|
2079
|
+
for (; (r = e.indexOf(t, r)) !== -1; )
|
|
2080
|
+
n++, r += t.length;
|
|
2081
|
+
return n;
|
|
2082
|
+
}
|
|
2083
|
+
const vt = "yq-tools", Mt = "1.0.0";
|
|
2084
|
+
console.log(
|
|
2085
|
+
`%c🚀 ${vt} v${Mt}`,
|
|
2086
|
+
"font-size: 14px; font-weight: bold; background: linear-gradient(90deg, #0555CE 0%, #339AF0 100%); color: white; padding: 8px 16px; border-radius: 4px;"
|
|
2087
|
+
);
|
|
2088
|
+
const ts = y.get.bind(y), ns = y.post.bind(y), rs = y.remoteCall.bind(y), os = y.daoCall.bind(y), is = y.tableCall.bind(y), ss = y.exportCall.bind(y);
|
|
2089
|
+
export {
|
|
2090
|
+
x as ENV_TYPE,
|
|
2091
|
+
Ee as Http,
|
|
2092
|
+
ze as REGEX_CHINESE,
|
|
2093
|
+
He as REGEX_EMAIL,
|
|
2094
|
+
Be as REGEX_ID_CARD,
|
|
2095
|
+
je as REGEX_IP,
|
|
2096
|
+
Ue as REGEX_PHONE,
|
|
2097
|
+
We as REGEX_URL,
|
|
2098
|
+
Pi as add,
|
|
2099
|
+
L as addDays,
|
|
2100
|
+
tn as addHours,
|
|
2101
|
+
nn as addMinutes,
|
|
2102
|
+
fe as addMonths,
|
|
2103
|
+
Ae as addYears,
|
|
2104
|
+
Ht as auth,
|
|
2105
|
+
oo as base64ToBlob,
|
|
2106
|
+
io as blobToBase64,
|
|
2107
|
+
Ui as bytesToSize,
|
|
2108
|
+
Wi as capitalize,
|
|
2109
|
+
ji as capitalizeWords,
|
|
2110
|
+
Hi as ceil,
|
|
2111
|
+
Go as checkPasswordStrength,
|
|
2112
|
+
Yt as chunk,
|
|
2113
|
+
wo as clearLocal,
|
|
2114
|
+
vo as clearSession,
|
|
2115
|
+
Zt as closeTab,
|
|
2116
|
+
uo as compressImage,
|
|
2117
|
+
Ce as convertTimezone,
|
|
2118
|
+
Wt as copy,
|
|
2119
|
+
Ji as countChars,
|
|
2120
|
+
Qi as countLines,
|
|
2121
|
+
es as countOccurrences,
|
|
2122
|
+
Ki as countWords,
|
|
2123
|
+
Io as createStorage,
|
|
2124
|
+
os as daoCall,
|
|
2125
|
+
ao as dataURLToFile,
|
|
2126
|
+
Se as debounce,
|
|
2127
|
+
Fo as decodeUrl,
|
|
2128
|
+
Me as deepClone,
|
|
2129
|
+
j as detectEnv,
|
|
2130
|
+
zt as dialogDrag,
|
|
2131
|
+
rn as diffDays,
|
|
2132
|
+
on as diffMonths,
|
|
2133
|
+
Ri as divide,
|
|
2134
|
+
ft as downloadBlob,
|
|
2135
|
+
ut as downloadFile,
|
|
2136
|
+
ro as downloadJSON,
|
|
2137
|
+
lt as downloadText,
|
|
2138
|
+
ae as draggable,
|
|
2139
|
+
Ro as encodeUrl,
|
|
2140
|
+
ht as escapeHtml,
|
|
2141
|
+
No as escapeSql,
|
|
2142
|
+
Ye as exitFullscreen,
|
|
2143
|
+
ss as exportCall,
|
|
2144
|
+
so as fileToBase64,
|
|
2145
|
+
De as flatten,
|
|
2146
|
+
Fi as floor,
|
|
2147
|
+
Di as formatCurrency,
|
|
2148
|
+
O as formatDate,
|
|
2149
|
+
Ai as formatDecimal,
|
|
2150
|
+
Kr as formatFileSize,
|
|
2151
|
+
In as formatInTimezone,
|
|
2152
|
+
xt as formatNumber,
|
|
2153
|
+
Ci as formatOrdinal,
|
|
2154
|
+
Ti as formatPercent,
|
|
2155
|
+
Qt as formatRelative,
|
|
2156
|
+
Kt as formatTime,
|
|
2157
|
+
On as fromUTC,
|
|
2158
|
+
ts as get,
|
|
2159
|
+
Co as getAllCookies,
|
|
2160
|
+
N as getBrowser,
|
|
2161
|
+
pt as getCookie,
|
|
2162
|
+
se as getCtxPath,
|
|
2163
|
+
_n as getDayOfYear,
|
|
2164
|
+
yn as getDaysInMonth,
|
|
2165
|
+
J as getDevice,
|
|
2166
|
+
$ as getEndOfDay,
|
|
2167
|
+
hn as getEndOfMonth,
|
|
2168
|
+
pn as getEndOfWeek,
|
|
2169
|
+
Jt as getEnv,
|
|
2170
|
+
D as getFileExt,
|
|
2171
|
+
me as getFileName,
|
|
2172
|
+
Vr as getFileNameWithoutExt,
|
|
2173
|
+
Jr as getFileSize,
|
|
2174
|
+
eo as getFileType,
|
|
2175
|
+
dt as getImageSize,
|
|
2176
|
+
bn as getLast30Days,
|
|
2177
|
+
xn as getLast7Days,
|
|
2178
|
+
En as getLastHalfYear,
|
|
2179
|
+
Sn as getLastYear,
|
|
2180
|
+
ho as getLocal,
|
|
2181
|
+
xo as getLocalKeys,
|
|
2182
|
+
Qr as getMimeType,
|
|
2183
|
+
ue as getNetworkType,
|
|
2184
|
+
R as getOS,
|
|
2185
|
+
Ln as getQueryParam,
|
|
2186
|
+
z as getQueryParams,
|
|
2187
|
+
Ie as getQueryString,
|
|
2188
|
+
qn as getScrollPercent,
|
|
2189
|
+
Zn as getScrollbarWidth,
|
|
2190
|
+
bo as getSession,
|
|
2191
|
+
Do as getSessionKeys,
|
|
2192
|
+
v as getStartOfDay,
|
|
2193
|
+
gn as getStartOfMonth,
|
|
2194
|
+
mn as getStartOfWeek,
|
|
2195
|
+
ko as getStorageSize,
|
|
2196
|
+
Cn as getTimezoneName,
|
|
2197
|
+
An as getTimezoneOffset,
|
|
2198
|
+
vi as getType,
|
|
2199
|
+
Bn as getVisibleRatio,
|
|
2200
|
+
wn as getWeekOfYear,
|
|
2201
|
+
$t as groupBy,
|
|
2202
|
+
Ao as hasCookie,
|
|
2203
|
+
_o as hasLocal,
|
|
2204
|
+
Pn as hasQueryParam,
|
|
2205
|
+
Mo as hasSession,
|
|
2206
|
+
y as http,
|
|
2207
|
+
Yi as inRange,
|
|
2208
|
+
de as isAbsoluteUrl,
|
|
2209
|
+
dn as isAfter,
|
|
2210
|
+
or as isAlipay,
|
|
2211
|
+
Zi as isAlpha,
|
|
2212
|
+
Vi as isAlphaNumeric,
|
|
2213
|
+
ur as isAndroid,
|
|
2214
|
+
ii as isArray,
|
|
2215
|
+
rt as isAudio,
|
|
2216
|
+
Wr as isBankCard,
|
|
2217
|
+
ln as isBefore,
|
|
2218
|
+
ri as isBigInt,
|
|
2219
|
+
St as isBlank,
|
|
2220
|
+
Ko as isBoolean,
|
|
2221
|
+
zr as isCarNumber,
|
|
2222
|
+
Fr as isChinese,
|
|
2223
|
+
Jn as isChrome,
|
|
2224
|
+
Ar as isClient,
|
|
2225
|
+
ci as isDate,
|
|
2226
|
+
qr as isDateFormat,
|
|
2227
|
+
Nr as isDecimal,
|
|
2228
|
+
mr as isDesktop,
|
|
2229
|
+
Fe as isDev,
|
|
2230
|
+
ir as isDingTalk,
|
|
2231
|
+
Si as isDocument,
|
|
2232
|
+
er as isEdge,
|
|
2233
|
+
bi as isElement,
|
|
2234
|
+
Cr as isEmail,
|
|
2235
|
+
wi as isEmpty,
|
|
2236
|
+
xi as isEmptyArray,
|
|
2237
|
+
_i as isEmptyObject,
|
|
2238
|
+
Hr as isEnglish,
|
|
2239
|
+
ui as isError,
|
|
2240
|
+
Li as isEven,
|
|
2241
|
+
st as isExcel,
|
|
2242
|
+
gi as isFinite,
|
|
2243
|
+
Kn as isFirefox,
|
|
2244
|
+
Ii as isFloat,
|
|
2245
|
+
Pe as isFullscreen,
|
|
2246
|
+
Un as isFullyInViewport,
|
|
2247
|
+
si as isFunction,
|
|
2248
|
+
tr as isIE,
|
|
2249
|
+
fr as isIOS,
|
|
2250
|
+
Or as isIdCard,
|
|
2251
|
+
tt as isImage,
|
|
2252
|
+
Vt as isInIframe,
|
|
2253
|
+
Hn as isInViewport,
|
|
2254
|
+
hi as isInteger,
|
|
2255
|
+
$r as isIp,
|
|
2256
|
+
qe as isIpv4,
|
|
2257
|
+
Xe as isIpv6,
|
|
2258
|
+
fn as isLeapYear,
|
|
2259
|
+
ar as isLinux,
|
|
2260
|
+
Ur as isLowerCase,
|
|
2261
|
+
Ne as isMac,
|
|
2262
|
+
fi as isMap,
|
|
2263
|
+
lr as isMobile,
|
|
2264
|
+
Rr as isMoney,
|
|
2265
|
+
pi as isNaN,
|
|
2266
|
+
Oi as isNegative,
|
|
2267
|
+
Pr as isNegativeInteger,
|
|
2268
|
+
Qo as isNull,
|
|
2269
|
+
ti as isNullOrUndefined,
|
|
2270
|
+
Jo as isNumber,
|
|
2271
|
+
Gi as isNumeric,
|
|
2272
|
+
oi as isObject,
|
|
2273
|
+
$i as isOdd,
|
|
2274
|
+
Re as isOnline,
|
|
2275
|
+
ot as isPDF,
|
|
2276
|
+
Ir as isPhone,
|
|
2277
|
+
pe as isPlainObject,
|
|
2278
|
+
ki as isPositive,
|
|
2279
|
+
Yr as isPositiveInteger,
|
|
2280
|
+
jr as isPostalCode,
|
|
2281
|
+
yi as isPrimitive,
|
|
2282
|
+
Dr as isProd,
|
|
2283
|
+
_t as isPromise,
|
|
2284
|
+
ai as isRegExp,
|
|
2285
|
+
Nn as isRelativeUrl,
|
|
2286
|
+
Qn as isSafari,
|
|
2287
|
+
yt as isSafeUrl,
|
|
2288
|
+
V as isSameDay,
|
|
2289
|
+
Tr as isServer,
|
|
2290
|
+
li as isSet,
|
|
2291
|
+
Oo as isStorageAvailable,
|
|
2292
|
+
Vo as isString,
|
|
2293
|
+
Zo as isStrongPassword,
|
|
2294
|
+
ni as isSymbol,
|
|
2295
|
+
dr as isTablet,
|
|
2296
|
+
kr as isTel,
|
|
2297
|
+
Xr as isTime,
|
|
2298
|
+
sn as isToday,
|
|
2299
|
+
an as isTomorrow,
|
|
2300
|
+
pr as isTouchDevice,
|
|
2301
|
+
ei as isUndefined,
|
|
2302
|
+
Br as isUpperCase,
|
|
2303
|
+
Lr as isUrl,
|
|
2304
|
+
Ho as isValidUrl,
|
|
2305
|
+
nt as isVideo,
|
|
2306
|
+
di as isWeakMap,
|
|
2307
|
+
mi as isWeakSet,
|
|
2308
|
+
nr as isWechat,
|
|
2309
|
+
rr as isWechatMiniProgram,
|
|
2310
|
+
un as isWeekend,
|
|
2311
|
+
Ei as isWindow,
|
|
2312
|
+
cr as isWindows,
|
|
2313
|
+
it as isWord,
|
|
2314
|
+
sr as isWxWork,
|
|
2315
|
+
cn as isYesterday,
|
|
2316
|
+
ct as isZip,
|
|
2317
|
+
Le as joinUrl,
|
|
2318
|
+
Gt as jumpTab,
|
|
2319
|
+
Xn as lockScroll,
|
|
2320
|
+
jt as longpress,
|
|
2321
|
+
Xo as mask,
|
|
2322
|
+
zo as maskBankCard,
|
|
2323
|
+
jo as maskEmail,
|
|
2324
|
+
Wo as maskIdCard,
|
|
2325
|
+
qo as maskName,
|
|
2326
|
+
Bo as maskPhone,
|
|
2327
|
+
ce as merge,
|
|
2328
|
+
X as multiply,
|
|
2329
|
+
Ct as nanoid,
|
|
2330
|
+
Rn as normalizeUrl,
|
|
2331
|
+
vn as now,
|
|
2332
|
+
kt as omit,
|
|
2333
|
+
Wn as onEnterViewport,
|
|
2334
|
+
Mr as onNetworkChange,
|
|
2335
|
+
Xt as openTab,
|
|
2336
|
+
en as parseDate,
|
|
2337
|
+
Oe as parseQuery,
|
|
2338
|
+
Ot as pick,
|
|
2339
|
+
ns as post,
|
|
2340
|
+
Nt as random,
|
|
2341
|
+
Rt as randomString,
|
|
2342
|
+
to as readAsArrayBuffer,
|
|
2343
|
+
K as readAsDataURL,
|
|
2344
|
+
no as readAsJSON,
|
|
2345
|
+
at as readAsText,
|
|
2346
|
+
rs as remoteCall,
|
|
2347
|
+
To as removeCookie,
|
|
2348
|
+
mt as removeLocal,
|
|
2349
|
+
Yn as removeQueryParam,
|
|
2350
|
+
So as removeSession,
|
|
2351
|
+
$e as requestFullscreen,
|
|
2352
|
+
qt as resetEnvCache,
|
|
2353
|
+
fo as resizeImage,
|
|
2354
|
+
Fn as resolveUrl,
|
|
2355
|
+
Pt as retry,
|
|
2356
|
+
lo as rotateImage,
|
|
2357
|
+
bt as round,
|
|
2358
|
+
Yo as sanitizeHtml,
|
|
2359
|
+
Uo as sanitizeUrl,
|
|
2360
|
+
zn as scrollToElement,
|
|
2361
|
+
jn as scrollToTop,
|
|
2362
|
+
It as set,
|
|
2363
|
+
gt as setCookie,
|
|
2364
|
+
yo as setLocal,
|
|
2365
|
+
$n as setQueryParam,
|
|
2366
|
+
ke as setQueryParams,
|
|
2367
|
+
Eo as setSession,
|
|
2368
|
+
Ft as shuffle,
|
|
2369
|
+
Te as sleep,
|
|
2370
|
+
le as stringifyQuery,
|
|
2371
|
+
Po as stripTags,
|
|
2372
|
+
Ni as subtract,
|
|
2373
|
+
vr as supportClipboard,
|
|
2374
|
+
Sr as supportGeolocation,
|
|
2375
|
+
_r as supportIndexedDB,
|
|
2376
|
+
yr as supportLocalStorage,
|
|
2377
|
+
Er as supportNotification,
|
|
2378
|
+
br as supportServiceWorker,
|
|
2379
|
+
wr as supportSessionStorage,
|
|
2380
|
+
gr as supportWebGL,
|
|
2381
|
+
hr as supportWebSocket,
|
|
2382
|
+
xr as supportWorker,
|
|
2383
|
+
is as tableCall,
|
|
2384
|
+
ve as throttle,
|
|
2385
|
+
Et as toCamelCase,
|
|
2386
|
+
p as toDate,
|
|
2387
|
+
Bi as toFixed,
|
|
2388
|
+
qi as toKebabCase,
|
|
2389
|
+
zi as toPascalCase,
|
|
2390
|
+
Xi as toSnakeCase,
|
|
2391
|
+
kn as toUTC,
|
|
2392
|
+
Mn as today,
|
|
2393
|
+
Vn as toggleFullscreen,
|
|
2394
|
+
Tn as tomorrow,
|
|
2395
|
+
Mi as typeOf,
|
|
2396
|
+
$o as unescapeHtml,
|
|
2397
|
+
Lt as unique,
|
|
2398
|
+
Gn as unlockScroll,
|
|
2399
|
+
co as urlToBlob,
|
|
2400
|
+
At as uuid,
|
|
2401
|
+
Ut as vDebounce,
|
|
2402
|
+
Bt as vThrottle,
|
|
2403
|
+
Gr as validate,
|
|
2404
|
+
Zr as validateAll,
|
|
2405
|
+
mo as validateFileSize,
|
|
2406
|
+
po as validateFileType,
|
|
2407
|
+
go as validateImageDimensions,
|
|
2408
|
+
Lo as watchStorage,
|
|
2409
|
+
Dn as yesterday
|
|
2410
|
+
};
|