minutool 1.0.29 → 1.0.30
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/index.d.ts +12 -12
- package/dist/minutool.js +49 -77
- package/dist/minutool.js.map +1 -1
- package/dist/minutool.umd.cjs +4 -4
- package/dist/minutool.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -191,7 +191,7 @@ export declare const bindKeyUp: (element: EventTarget | string, payload: (event:
|
|
|
191
191
|
* @param element - 要移动的元素
|
|
192
192
|
* @param handle - 拖动句柄,默认为元素本身
|
|
193
193
|
*/
|
|
194
|
-
export declare
|
|
194
|
+
export declare const bindNodeMove: (element: HTMLElement | string, handle?: HTMLElement | string | null) => () => void;
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* 转换 Blob 数据到 Base64 Data URL
|
|
@@ -255,13 +255,13 @@ export declare const calcRemainingMSecs: (progress: number, total: number, start
|
|
|
255
255
|
* camelCase('hello-world') // 'helloWorld'
|
|
256
256
|
* camelCase('hello_world') // 'helloWorld'
|
|
257
257
|
*/
|
|
258
|
-
export declare
|
|
258
|
+
export declare const camelCase: (str: string) => string;
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
261
|
* 取消 el 上正在进行的滚动动画(若有),并还原 CSS 滚动行为
|
|
262
262
|
* @param el 要取消滚动动画的元素
|
|
263
263
|
*/
|
|
264
|
-
export declare
|
|
264
|
+
export declare const cancelScrollAnimation: (el: HTMLElement) => void;
|
|
265
265
|
|
|
266
266
|
/**
|
|
267
267
|
* 首字母大写
|
|
@@ -270,7 +270,7 @@ export declare function cancelScrollAnimation(el: HTMLElement): void;
|
|
|
270
270
|
* @example
|
|
271
271
|
* capitalize('hello') // 'Hello'
|
|
272
272
|
*/
|
|
273
|
-
export declare
|
|
273
|
+
export declare const capitalize: (str: string) => string;
|
|
274
274
|
|
|
275
275
|
/**
|
|
276
276
|
* 将任意数值限制到 [0, 1] 区间,常用于保证动画进度合法
|
|
@@ -375,7 +375,7 @@ export declare const decodeHTMLEntities: (str: string) => string;
|
|
|
375
375
|
* @example
|
|
376
376
|
* deepClone({ a: 1, b: { c: 2 } })
|
|
377
377
|
*/
|
|
378
|
-
export declare
|
|
378
|
+
export declare const deepClone: <T>(obj: T) => T;
|
|
379
379
|
|
|
380
380
|
/**
|
|
381
381
|
* 删除 Cookie
|
|
@@ -893,7 +893,7 @@ export declare const isChinese: (str: string) => boolean;
|
|
|
893
893
|
* isEmptyObject({}) // true
|
|
894
894
|
* isEmptyObject({ a: 1 }) // false
|
|
895
895
|
*/
|
|
896
|
-
export declare
|
|
896
|
+
export declare const isEmptyObject: (obj: object) => boolean;
|
|
897
897
|
|
|
898
898
|
/**
|
|
899
899
|
* 检测是否为 Firefox 浏览器
|
|
@@ -999,7 +999,7 @@ export declare const isUrl: (str: string) => boolean;
|
|
|
999
999
|
* kebabCase('helloWorld') // 'hello-world'
|
|
1000
1000
|
* kebabCase('HelloWorld') // 'hello-world'
|
|
1001
1001
|
*/
|
|
1002
|
-
export declare
|
|
1002
|
+
export declare const kebabCase: (str: string) => string;
|
|
1003
1003
|
|
|
1004
1004
|
/**
|
|
1005
1005
|
* 保持对象尽量在容器内部,优先保证上边、左边显示
|
|
@@ -1505,7 +1505,7 @@ export declare const objectFromEntries: <T extends Record<string | number | symb
|
|
|
1505
1505
|
* get({ a: { b: { c: 1 } } }, 'a.b.c') // 1
|
|
1506
1506
|
* get({ a: { b: 1 } }, 'a.b.c', 0) // 0
|
|
1507
1507
|
*/
|
|
1508
|
-
export declare
|
|
1508
|
+
export declare const objectGet: <T = any>(obj: object, path: string, defaultValue?: T) => T;
|
|
1509
1509
|
|
|
1510
1510
|
/**
|
|
1511
1511
|
* 根据映射关系替换对象的键
|
|
@@ -1525,7 +1525,7 @@ export declare const objectKeyReplace: (obj: Record<string, any>, mapping: Recor
|
|
|
1525
1525
|
* @example
|
|
1526
1526
|
* merge({ a: 1 }, { b: 2 }, { c: 3 }) // { a: 1, b: 2, c: 3 }
|
|
1527
1527
|
*/
|
|
1528
|
-
export declare
|
|
1528
|
+
export declare const objectMerge: <T extends object>(target: T, ...sources: Partial<T>[]) => T;
|
|
1529
1529
|
|
|
1530
1530
|
/**
|
|
1531
1531
|
* 设置对象指定路径的值
|
|
@@ -1535,7 +1535,7 @@ export declare function objectMerge<T extends object>(target: T, ...sources: Par
|
|
|
1535
1535
|
* @example
|
|
1536
1536
|
* set({}, 'a.b.c', 1) // { a: { b: { c: 1 } } }
|
|
1537
1537
|
*/
|
|
1538
|
-
export declare
|
|
1538
|
+
export declare const objectSet: (obj: any, path: string, value: any) => void;
|
|
1539
1539
|
|
|
1540
1540
|
/**
|
|
1541
1541
|
* 交换对象中的键值对
|
|
@@ -1828,7 +1828,7 @@ export declare type ScrollAxis = "scrollLeft" | "scrollTop";
|
|
|
1828
1828
|
* @param target 目标滚动位置
|
|
1829
1829
|
* @param options 动画选项
|
|
1830
1830
|
*/
|
|
1831
|
-
export declare
|
|
1831
|
+
export declare const scrollToAnimated: (el: HTMLElement, target: number, options?: ScrollToAnimatedOptions) => void;
|
|
1832
1832
|
|
|
1833
1833
|
export declare interface ScrollToAnimatedOptions {
|
|
1834
1834
|
/** 动画时长(ms),默认 380 */
|
|
@@ -2056,7 +2056,7 @@ export declare const TRIM_RIGHT = 2;
|
|
|
2056
2056
|
* @example
|
|
2057
2057
|
* truncate('hello world', 5) // 'hello...'
|
|
2058
2058
|
*/
|
|
2059
|
-
export declare
|
|
2059
|
+
export declare const truncate: (str: string, length: number, suffix?: string) => string;
|
|
2060
2060
|
|
|
2061
2061
|
/**
|
|
2062
2062
|
* 反转义 HTML(将 HTML 实体转换为字符)
|
package/dist/minutool.js
CHANGED
|
@@ -81,7 +81,7 @@ const de = (e) => e, xt = (e) => Math.min(1, Math.max(0, e)), he = (e, t, n) =>
|
|
|
81
81
|
return t;
|
|
82
82
|
const n = t.split("-")[0], o = e.find((r) => r.startsWith(n));
|
|
83
83
|
return o || e[0];
|
|
84
|
-
}, an = () => navigator.userAgent.toLowerCase().indexOf("firefox") > -1, sn = (1 + Math.sqrt(5)) / 2 - 1, ne = 96, cn = (e, t = ne) => e / 25.4 * t, ln = (e) => Math.round(e * 56.6929), pn = (e) => e * 2.83464566929, un = (e) => e / 2.83464566929,
|
|
84
|
+
}, an = () => navigator.userAgent.toLowerCase().indexOf("firefox") > -1, sn = (1 + Math.sqrt(5)) / 2 - 1, ne = 96, cn = (e, t = ne) => e / 25.4 * t, ln = (e) => Math.round(e * 56.6929), pn = (e) => e * 2.83464566929, un = (e) => e / 2.83464566929, mn = (e, t = ne) => 25.4 * e / t, fn = (e, t, n) => Math.min(Math.max(e, t), n), v = (e, t, n, o = !0) => o ? e >= t && e <= n : e > t && e < n, dn = (e, t) => Math.floor(Math.random() * (t + 1 - e)) + e, Ee = (e, t = 2) => {
|
|
85
85
|
let n = Math.pow(10, t);
|
|
86
86
|
return Math.round(e * n) / n;
|
|
87
87
|
}, O = (e) => typeof e == "number" ? isFinite(e) : typeof e != "string" ? !1 : /^[+-]?(\d+\.?\d*|\.\d+)$/.test(e), hn = (...e) => {
|
|
@@ -92,11 +92,7 @@ const de = (e) => e, xt = (e) => Math.min(1, Math.max(0, e)), he = (e, t, n) =>
|
|
|
92
92
|
o && (t = Math.max(t, o.length));
|
|
93
93
|
}
|
|
94
94
|
}), t;
|
|
95
|
-
}, gn = (e) => (e = Math.abs(Number(e)), e === 0 ? 1 : Math.floor(Math.log10(e)) + 1)
|
|
96
|
-
function Me(e) {
|
|
97
|
-
return e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
98
|
-
}
|
|
99
|
-
const H = (e, t = "") => {
|
|
95
|
+
}, gn = (e) => (e = Math.abs(Number(e)), e === 0 ? 1 : Math.floor(Math.log10(e)) + 1), Me = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), H = (e, t = "") => {
|
|
100
96
|
if (typeof e == "number")
|
|
101
97
|
return { val: e, unit: t };
|
|
102
98
|
if (O(e))
|
|
@@ -160,17 +156,7 @@ const H = (e, t = "") => {
|
|
|
160
156
|
}, vn = (e, t) => {
|
|
161
157
|
const n = Object.keys(t), o = Object.values(t);
|
|
162
158
|
return new Function(...n, `return \`${e}\`;`)(...o);
|
|
163
|
-
}
|
|
164
|
-
function yn(e) {
|
|
165
|
-
return e.replace(/[-_](.)/g, (t, n) => n.toUpperCase());
|
|
166
|
-
}
|
|
167
|
-
function En(e) {
|
|
168
|
-
return e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
169
|
-
}
|
|
170
|
-
function Mn(e, t, n = "...") {
|
|
171
|
-
return e.length <= t ? e : e.slice(0, t) + n;
|
|
172
|
-
}
|
|
173
|
-
const $ = (e) => (e + "").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1"), Te = (e) => {
|
|
159
|
+
}, yn = (e) => e.replace(/[-_](.)/g, (t, n) => n.toUpperCase()), En = (e) => e.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), Mn = (e, t, n = "...") => e.length <= t ? e : e.slice(0, t) + n, $ = (e) => (e + "").replace(/([\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1"), Te = (e) => {
|
|
174
160
|
let t = "", n = 0, o = 0, r = 0, i = 0;
|
|
175
161
|
for (; n < e.length; )
|
|
176
162
|
o = e.charCodeAt(n), o < 128 ? (t += String.fromCharCode(o), n++) : o > 191 && o < 224 ? (r = e.charCodeAt(n + 1), t += String.fromCharCode((o & 31) << 6 | r & 63), n += 2) : (r = e.charCodeAt(n + 1), i = e.charCodeAt(n + 2), t += String.fromCharCode((o & 15) << 12 | (r & 63) << 6 | i & 63), n += 3);
|
|
@@ -353,8 +339,8 @@ const zn = (e, t) => {
|
|
|
353
339
|
}, Zn = (e, t, n = 50) => {
|
|
354
340
|
let o = !1, r = null, i = null, c = null;
|
|
355
341
|
const a = (x) => {
|
|
356
|
-
let
|
|
357
|
-
i !==
|
|
342
|
+
let m = x.target.value;
|
|
343
|
+
i !== m && (i = m, t(m, x));
|
|
358
344
|
}, s = (x) => {
|
|
359
345
|
const u = x;
|
|
360
346
|
u.isComposing || o || (c = u, r && clearTimeout(r), r = window.setTimeout(() => {
|
|
@@ -468,14 +454,14 @@ const zn = (e, t) => {
|
|
|
468
454
|
return e.width > t.width || e.height > t.height || (e.width + e.left > t.width + t.left && (n.left = e.left - (e.width + e.left - (t.width + t.left))), e.height + e.top > t.height + t.top && (n.top = e.top - (e.height + e.top - (t.height + t.top))), e.left < t.left && (n.left = t.left), e.top < t.top && (n.top = t.top)), n;
|
|
469
455
|
}, po = (e, t) => e.left <= t.left ? e.left + e.width >= t.left && (v(t.top, e.top, e.top + e.height) || v(t.top + t.height, e.top, e.top + e.height) || t.top >= e.top && t.height >= e.height) : t.left + t.width >= e.left && (v(e.top, t.top, t.top + t.height) || v(e.top + e.height, t.top, t.top + t.height) || e.top >= t.top && e.height >= t.height), uo = (e) => e ? !!(e.tabIndex >= 0 || e instanceof HTMLAnchorElement && e.href || e instanceof HTMLButtonElement && !e.disabled || e instanceof HTMLInputElement && !e.disabled || e instanceof HTMLTextAreaElement && !e.disabled) : !1;
|
|
470
456
|
let E = {};
|
|
471
|
-
const
|
|
457
|
+
const mo = (e, t = !1) => (!t && e in E || (E[e] = new Promise((n, o) => {
|
|
472
458
|
let r = document.createElement("link");
|
|
473
459
|
r.rel = "stylesheet", r.href = e, r.onload = () => {
|
|
474
460
|
n();
|
|
475
461
|
}, r.onerror = () => {
|
|
476
462
|
o();
|
|
477
463
|
}, document.head.append(r);
|
|
478
|
-
})), E[e]),
|
|
464
|
+
})), E[e]), fo = (e, t = !1) => (!t && e in E || (E[e] = new Promise((n, o) => {
|
|
479
465
|
let r = document.createElement("script");
|
|
480
466
|
r.src = e, r.onload = () => {
|
|
481
467
|
n();
|
|
@@ -529,33 +515,29 @@ v(e.top + e.height, t.top, t.top + t.height) && v(e.left + e.width, t.left, t.le
|
|
|
529
515
|
o != null && (t[`--${n}`] = `${o}`);
|
|
530
516
|
}
|
|
531
517
|
return t;
|
|
532
|
-
}
|
|
533
|
-
function Eo(e, t = null) {
|
|
518
|
+
}, Eo = (e, t = null) => {
|
|
534
519
|
const n = b(e);
|
|
535
520
|
t = b(t || n);
|
|
536
521
|
const o = n.style.position, r = n.style.left, i = n.style.top, c = n.style.transform;
|
|
537
522
|
let a = !1, s = 0, l = 0;
|
|
538
|
-
const p = (
|
|
539
|
-
a && (n.style.position = "fixed", n.style.transform = "none", n.style.left = `${
|
|
523
|
+
const p = (m) => {
|
|
524
|
+
a && (n.style.position = "fixed", n.style.transform = "none", n.style.left = `${m.clientX - s}px`, n.style.top = `${m.clientY - l}px`);
|
|
540
525
|
}, x = () => {
|
|
541
526
|
a = !1, document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", x);
|
|
542
|
-
}, u = (
|
|
543
|
-
if (
|
|
527
|
+
}, u = (m) => {
|
|
528
|
+
if (m.button !== 0)
|
|
544
529
|
return;
|
|
545
530
|
a = !0;
|
|
546
531
|
const T = n.getBoundingClientRect();
|
|
547
|
-
s =
|
|
532
|
+
s = m.clientX - T.left, l = m.clientY - T.top, document.addEventListener("mousemove", p), document.addEventListener("mouseup", x), m.preventDefault();
|
|
548
533
|
};
|
|
549
534
|
return t.addEventListener("mousedown", u), () => {
|
|
550
535
|
x(), t.removeEventListener("mousedown", u), n.style.position = o, n.style.left = r, n.style.top = i, n.style.transform = c;
|
|
551
536
|
};
|
|
552
|
-
}
|
|
553
|
-
const C = /* @__PURE__ */ new WeakMap();
|
|
554
|
-
function je(e) {
|
|
537
|
+
}, C = /* @__PURE__ */ new WeakMap(), je = (e) => {
|
|
555
538
|
const t = C.get(e);
|
|
556
539
|
t && (cancelAnimationFrame(t.raf), C.delete(e), e.style.scrollBehavior = t.prevBehavior);
|
|
557
|
-
}
|
|
558
|
-
function Mo(e, t, n = {}) {
|
|
540
|
+
}, Mo = (e, t, n = {}) => {
|
|
559
541
|
const { duration: o = 380, axis: r = "scrollLeft", onEnd: i, easingFn: c = ge } = n;
|
|
560
542
|
je(e);
|
|
561
543
|
const a = e.style.scrollBehavior;
|
|
@@ -567,15 +549,14 @@ function Mo(e, t, n = {}) {
|
|
|
567
549
|
u();
|
|
568
550
|
return;
|
|
569
551
|
}
|
|
570
|
-
const
|
|
571
|
-
const D = Math.min(1, (R -
|
|
552
|
+
const m = performance.now(), T = (R) => {
|
|
553
|
+
const D = Math.min(1, (R - m) / o);
|
|
572
554
|
e[r] = p + x * c(D);
|
|
573
555
|
const w = C.get(e);
|
|
574
556
|
D < 1 && w ? w.raf = requestAnimationFrame(T) : (C.delete(e), u());
|
|
575
557
|
};
|
|
576
558
|
C.set(e, { raf: requestAnimationFrame(T), prevBehavior: a });
|
|
577
|
-
}
|
|
578
|
-
const bo = (e) => e.replace(/[\\/:*?"<>|]/g, "_").replace(/[\0-\x1F]/g, "_").replace(/\s+/g, " ").replace(/^\.+/, "").replace(/\.+$/, "").trim(), V = (e) => new Promise((t, n) => {
|
|
559
|
+
}, bo = (e) => e.replace(/[\\/:*?"<>|]/g, "_").replace(/[\0-\x1F]/g, "_").replace(/\s+/g, " ").replace(/^\.+/, "").replace(/\.+$/, "").trim(), V = (e) => new Promise((t, n) => {
|
|
579
560
|
const o = new FileReader();
|
|
580
561
|
o.onload = () => t(o.result), o.onerror = (r) => n(r), o.readAsDataURL(e);
|
|
581
562
|
}), Q = {}, J = (e, t = null) => t !== null ? (Q[e] = t, null) : Q[e] || null, To = async (e) => {
|
|
@@ -804,11 +785,11 @@ const No = (e) => (S || (S = document.createElement("div")), e = e.replace(/<scr
|
|
|
804
785
|
}), M = (e, t) => {
|
|
805
786
|
let n = (e & 65535) + (t & 65535);
|
|
806
787
|
return (e >> 16) + (t >> 16) + (n >> 16) << 16 | n & 65535;
|
|
807
|
-
}, Ve = (e, t) => e << t | e >>> 32 - t, L = (e, t, n, o, r, i) => M(Ve(M(M(t, e), M(o, i)), r), n),
|
|
788
|
+
}, Ve = (e, t) => e << t | e >>> 32 - t, L = (e, t, n, o, r, i) => M(Ve(M(M(t, e), M(o, i)), r), n), f = (e, t, n, o, r, i, c) => L(t & n | ~t & o, e, t, r, i, c), d = (e, t, n, o, r, i, c) => L(t & o | n & ~o, e, t, r, i, c), h = (e, t, n, o, r, i, c) => L(t ^ n ^ o, e, t, r, i, c), g = (e, t, n, o, r, i, c) => L(n ^ (t | ~o), e, t, r, i, c), N = (e, t) => {
|
|
808
789
|
e[t >> 5] |= 128 << t % 32, e[(t + 64 >>> 9 << 4) + 14] = t;
|
|
809
790
|
let n, o, r, i, c, a = 1732584193, s = -271733879, l = -1732584194, p = 271733878;
|
|
810
791
|
for (n = 0; n < e.length; n += 16)
|
|
811
|
-
o = a, r = s, i = l, c = p, a =
|
|
792
|
+
o = a, r = s, i = l, c = p, a = f(a, s, l, p, e[n], 7, -680876936), p = f(p, a, s, l, e[n + 1], 12, -389564586), l = f(l, p, a, s, e[n + 2], 17, 606105819), s = f(s, l, p, a, e[n + 3], 22, -1044525330), a = f(a, s, l, p, e[n + 4], 7, -176418897), p = f(p, a, s, l, e[n + 5], 12, 1200080426), l = f(l, p, a, s, e[n + 6], 17, -1473231341), s = f(s, l, p, a, e[n + 7], 22, -45705983), a = f(a, s, l, p, e[n + 8], 7, 1770035416), p = f(p, a, s, l, e[n + 9], 12, -1958414417), l = f(l, p, a, s, e[n + 10], 17, -42063), s = f(s, l, p, a, e[n + 11], 22, -1990404162), a = f(a, s, l, p, e[n + 12], 7, 1804603682), p = f(p, a, s, l, e[n + 13], 12, -40341101), l = f(l, p, a, s, e[n + 14], 17, -1502002290), s = f(s, l, p, a, e[n + 15], 22, 1236535329), a = d(a, s, l, p, e[n + 1], 5, -165796510), p = d(p, a, s, l, e[n + 6], 9, -1069501632), l = d(l, p, a, s, e[n + 11], 14, 643717713), s = d(s, l, p, a, e[n], 20, -373897302), a = d(a, s, l, p, e[n + 5], 5, -701558691), p = d(p, a, s, l, e[n + 10], 9, 38016083), l = d(l, p, a, s, e[n + 15], 14, -660478335), s = d(s, l, p, a, e[n + 4], 20, -405537848), a = d(a, s, l, p, e[n + 9], 5, 568446438), p = d(p, a, s, l, e[n + 14], 9, -1019803690), l = d(l, p, a, s, e[n + 3], 14, -187363961), s = d(s, l, p, a, e[n + 8], 20, 1163531501), a = d(a, s, l, p, e[n + 13], 5, -1444681467), p = d(p, a, s, l, e[n + 2], 9, -51403784), l = d(l, p, a, s, e[n + 7], 14, 1735328473), s = d(s, l, p, a, e[n + 12], 20, -1926607734), a = h(a, s, l, p, e[n + 5], 4, -378558), p = h(p, a, s, l, e[n + 8], 11, -2022574463), l = h(l, p, a, s, e[n + 11], 16, 1839030562), s = h(s, l, p, a, e[n + 14], 23, -35309556), a = h(a, s, l, p, e[n + 1], 4, -1530992060), p = h(p, a, s, l, e[n + 4], 11, 1272893353), l = h(l, p, a, s, e[n + 7], 16, -155497632), s = h(s, l, p, a, e[n + 10], 23, -1094730640), a = h(a, s, l, p, e[n + 13], 4, 681279174), p = h(p, a, s, l, e[n], 11, -358537222), l = h(l, p, a, s, e[n + 3], 16, -722521979), s = h(s, l, p, a, e[n + 6], 23, 76029189), a = h(a, s, l, p, e[n + 9], 4, -640364487), p = h(p, a, s, l, e[n + 12], 11, -421815835), l = h(l, p, a, s, e[n + 15], 16, 530742520), s = h(s, l, p, a, e[n + 2], 23, -995338651), a = g(a, s, l, p, e[n], 6, -198630844), p = g(p, a, s, l, e[n + 7], 10, 1126891415), l = g(l, p, a, s, e[n + 14], 15, -1416354905), s = g(s, l, p, a, e[n + 5], 21, -57434055), a = g(a, s, l, p, e[n + 12], 6, 1700485571), p = g(p, a, s, l, e[n + 3], 10, -1894986606), l = g(l, p, a, s, e[n + 10], 15, -1051523), s = g(s, l, p, a, e[n + 1], 21, -2054922799), a = g(a, s, l, p, e[n + 8], 6, 1873313359), p = g(p, a, s, l, e[n + 15], 10, -30611744), l = g(l, p, a, s, e[n + 6], 15, -1560198380), s = g(s, l, p, a, e[n + 13], 21, 1309151649), a = g(a, s, l, p, e[n + 4], 6, -145523070), p = g(p, a, s, l, e[n + 11], 10, -1120210379), l = g(l, p, a, s, e[n + 2], 15, 718787259), s = g(s, l, p, a, e[n + 9], 21, -343485551), a = M(a, o), s = M(s, r), l = M(l, i), p = M(p, c);
|
|
812
793
|
return [a, s, l, p];
|
|
813
794
|
}, se = (e) => {
|
|
814
795
|
let t, n = "", o = e.length * 32;
|
|
@@ -1137,9 +1118,9 @@ const No = (e) => (S || (S = document.createElement("div")), e = e.replace(/<scr
|
|
|
1137
1118
|
o && (t[decodeURIComponent(o)] = decodeURIComponent(r || ""));
|
|
1138
1119
|
}), t;
|
|
1139
1120
|
}, nt = (e, t) => {
|
|
1140
|
-
const [n, o] = e.split("?"), i = { ...o ? ue(o) : {}, ...t }, c =
|
|
1121
|
+
const [n, o] = e.split("?"), i = { ...o ? ue(o) : {}, ...t }, c = me(i);
|
|
1141
1122
|
return `${n}?${c}`;
|
|
1142
|
-
},
|
|
1123
|
+
}, me = (e) => {
|
|
1143
1124
|
if (typeof e > "u" || typeof e != "object")
|
|
1144
1125
|
return e;
|
|
1145
1126
|
let t = [];
|
|
@@ -1166,8 +1147,8 @@ const rt = (e, t = {}) => {
|
|
|
1166
1147
|
o !== null && (clearTimeout(o), o = null);
|
|
1167
1148
|
}, i = (a) => {
|
|
1168
1149
|
const s = a, l = s.then.bind(s), p = s.catch.bind(s), x = s.finally.bind(s);
|
|
1169
|
-
return s.then = function(u,
|
|
1170
|
-
return i(l(u,
|
|
1150
|
+
return s.then = function(u, m) {
|
|
1151
|
+
return i(l(u, m));
|
|
1171
1152
|
}, s.catch = function(u) {
|
|
1172
1153
|
return i(p(u));
|
|
1173
1154
|
}, s.finally = function(u) {
|
|
@@ -1248,7 +1229,7 @@ const rt = (e, t = {}) => {
|
|
|
1248
1229
|
case et:
|
|
1249
1230
|
case tt:
|
|
1250
1231
|
default:
|
|
1251
|
-
return
|
|
1232
|
+
return me(e);
|
|
1252
1233
|
}
|
|
1253
1234
|
}, Go = (e, t = null, n = {}) => z(e, t, { ...n, ContentType: _, Accept: _ }).then((o) => o.json()), Wo = (e, t = null, n = {}) => z(e, t, { ...n, method: "POST", ContentType: _, Accept: _ }).then((o) => o.json()), Ko = (e, t, n = null, o = {}) => {
|
|
1254
1235
|
const r = new FormData();
|
|
@@ -1258,8 +1239,7 @@ const rt = (e, t = {}) => {
|
|
|
1258
1239
|
for (let i in n)
|
|
1259
1240
|
n.hasOwnProperty(i) && r.append(i, n[i]);
|
|
1260
1241
|
return z(e, r, { ...o, method: "POST" }).then((i) => i.json());
|
|
1261
|
-
}
|
|
1262
|
-
function ee(e) {
|
|
1242
|
+
}, ee = (e) => {
|
|
1263
1243
|
if (e === null || typeof e != "object") return e;
|
|
1264
1244
|
if (e instanceof Date) return new Date(e.getTime());
|
|
1265
1245
|
if (e instanceof Array) return e.map((t) => ee(t));
|
|
@@ -1270,11 +1250,7 @@ function ee(e) {
|
|
|
1270
1250
|
return t;
|
|
1271
1251
|
}
|
|
1272
1252
|
return e;
|
|
1273
|
-
}
|
|
1274
|
-
function Vo(e) {
|
|
1275
|
-
return Object.keys(e).length === 0;
|
|
1276
|
-
}
|
|
1277
|
-
const Qo = (e, t) => {
|
|
1253
|
+
}, Vo = (e) => Object.keys(e).length === 0, Qo = (e, t) => {
|
|
1278
1254
|
let n = {};
|
|
1279
1255
|
for (let o in e)
|
|
1280
1256
|
t[o] !== void 0 ? n[t[o]] = e[o] : n[o] = e[o];
|
|
@@ -1286,8 +1262,7 @@ const Qo = (e, t) => {
|
|
|
1286
1262
|
t[r] = o;
|
|
1287
1263
|
}
|
|
1288
1264
|
return t;
|
|
1289
|
-
}, Zo = (e) => Object.fromEntries(Object.entries(e).map(([t, n]) => [n, t]))
|
|
1290
|
-
function er(e, t, n) {
|
|
1265
|
+
}, Zo = (e) => Object.fromEntries(Object.entries(e).map(([t, n]) => [n, t])), er = (e, t, n) => {
|
|
1291
1266
|
const o = t.split(".");
|
|
1292
1267
|
let r = e;
|
|
1293
1268
|
for (const i of o) {
|
|
@@ -1296,15 +1271,13 @@ function er(e, t, n) {
|
|
|
1296
1271
|
r = r[i];
|
|
1297
1272
|
}
|
|
1298
1273
|
return r !== void 0 ? r : n;
|
|
1299
|
-
}
|
|
1300
|
-
function tr(e, t, n) {
|
|
1274
|
+
}, tr = (e, t, n) => {
|
|
1301
1275
|
const o = t.split("."), r = o.pop();
|
|
1302
1276
|
let i = e;
|
|
1303
1277
|
for (const c of o)
|
|
1304
1278
|
(!(c in i) || typeof i[c] != "object") && (i[c] = {}), i = i[c];
|
|
1305
1279
|
i[r] = n;
|
|
1306
|
-
}
|
|
1307
|
-
function lt(e, ...t) {
|
|
1280
|
+
}, lt = (e, ...t) => {
|
|
1308
1281
|
for (const n of t)
|
|
1309
1282
|
for (const o in n)
|
|
1310
1283
|
if (n.hasOwnProperty(o)) {
|
|
@@ -1312,13 +1285,12 @@ function lt(e, ...t) {
|
|
|
1312
1285
|
r && typeof r == "object" && !Array.isArray(r) && i && typeof i == "object" && !Array.isArray(i) ? e[o] = lt(i, r) : e[o] = r;
|
|
1313
1286
|
}
|
|
1314
1287
|
return e;
|
|
1315
|
-
}
|
|
1316
|
-
const pt = (e, t = !1) => {
|
|
1288
|
+
}, pt = (e, t = !1) => {
|
|
1317
1289
|
const n = e;
|
|
1318
1290
|
for (const o in n)
|
|
1319
1291
|
n[o] === null ? delete n[o] : t && typeof n[o] == "object" && pt(n[o], !0);
|
|
1320
1292
|
return e;
|
|
1321
|
-
}, nr = (/* @__PURE__ */ new Date()).getFullYear(), or = (/* @__PURE__ */ new Date()).getMonth() + 1, rr = (/* @__PURE__ */ new Date()).getDate(), ir = 60 * 1e3, ar = 60 * 60 * 1e3, I = 24 * 60 * 60 * 1e3, sr = 7 * I, cr = 30 * I, lr = 31 * I, pr = 365 * I, ur = 366 * I,
|
|
1293
|
+
}, nr = (/* @__PURE__ */ new Date()).getFullYear(), or = (/* @__PURE__ */ new Date()).getMonth() + 1, rr = (/* @__PURE__ */ new Date()).getDate(), ir = 60 * 1e3, ar = 60 * 60 * 1e3, I = 24 * 60 * 60 * 1e3, sr = 7 * I, cr = 30 * I, lr = 31 * I, pr = 365 * I, ur = 366 * I, mr = 0, fr = 1, dr = 2, hr = 3, gr = 4, xr = 5, wr = 6, ut = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], mt = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], ft = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], dt = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], vr = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], yr = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"], Er = ["日", "一", "二", "三", "四", "五", "六"], Mr = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"], br = (e, t, n) => {
|
|
1322
1294
|
let o = () => {
|
|
1323
1295
|
if (t && t(e), e-- > 0) {
|
|
1324
1296
|
setTimeout(o, 1e3);
|
|
@@ -1342,7 +1314,7 @@ const pt = (e, t = !1) => {
|
|
|
1342
1314
|
let t = e.getDate();
|
|
1343
1315
|
return (t < 10 ? "0" : "") + t;
|
|
1344
1316
|
},
|
|
1345
|
-
D: (e) =>
|
|
1317
|
+
D: (e) => mt[e.getDay()],
|
|
1346
1318
|
j: (e) => e.getDate(),
|
|
1347
1319
|
l: (e) => ut[e.getDay()],
|
|
1348
1320
|
N: (e) => {
|
|
@@ -1368,7 +1340,7 @@ const pt = (e, t = !1) => {
|
|
|
1368
1340
|
return r < 10 ? "0" + r : r;
|
|
1369
1341
|
},
|
|
1370
1342
|
// Month
|
|
1371
|
-
F: (e) =>
|
|
1343
|
+
F: (e) => ft[e.getMonth()],
|
|
1372
1344
|
m: (e) => {
|
|
1373
1345
|
let t = e.getMonth();
|
|
1374
1346
|
return (t < 9 ? "0" : "") + (t + 1);
|
|
@@ -1444,10 +1416,10 @@ const pt = (e, t = !1) => {
|
|
|
1444
1416
|
},
|
|
1445
1417
|
Z: (e) => -e.getTimezoneOffset() * 60,
|
|
1446
1418
|
// Full Date/Time
|
|
1447
|
-
c: (e) =>
|
|
1419
|
+
c: (e) => fe("Y-m-d\\TH:i:sP", e),
|
|
1448
1420
|
r: (e) => e.toString(),
|
|
1449
1421
|
U: (e) => Math.floor(e.getTime() / 1e3)
|
|
1450
|
-
},
|
|
1422
|
+
}, fe = function(e, t = null) {
|
|
1451
1423
|
let n = null;
|
|
1452
1424
|
return typeof t == "object" && t !== null ? n = t : n = new Date(t || Date.now()), e.replace(/(\\?)(.)/g, function(o, r, i) {
|
|
1453
1425
|
return r === "" && te[i] ? String(te[i](n)) : i;
|
|
@@ -1470,8 +1442,8 @@ const pt = (e, t = !1) => {
|
|
|
1470
1442
|
minute: "numeric",
|
|
1471
1443
|
second: "numeric"
|
|
1472
1444
|
}), r = n.formatToParts(t), i = o.formatToParts(t), c = (p) => {
|
|
1473
|
-
const x = p.find((w) => w.type === "year").value, u = p.find((w) => w.type === "month").value,
|
|
1474
|
-
return Date.UTC(Number(x), Number(u) - 1, Number(
|
|
1445
|
+
const x = p.find((w) => w.type === "year").value, u = p.find((w) => w.type === "month").value, m = p.find((w) => w.type === "day").value, T = p.find((w) => w.type === "hour").value, R = p.find((w) => w.type === "minute").value, D = p.find((w) => w.type === "second").value;
|
|
1446
|
+
return Date.UTC(Number(x), Number(u) - 1, Number(m), Number(T), Number(R), Number(D));
|
|
1475
1447
|
}, a = c(r), s = c(i);
|
|
1476
1448
|
return (a - s) / 1e3 / 60;
|
|
1477
1449
|
}, gt = (e) => {
|
|
@@ -1480,7 +1452,7 @@ const pt = (e, t = !1) => {
|
|
|
1480
1452
|
}, Cr = (e) => {
|
|
1481
1453
|
const t = ht(e);
|
|
1482
1454
|
return gt(t);
|
|
1483
|
-
}, _r = (e) =>
|
|
1455
|
+
}, _r = (e) => fe("W", e);
|
|
1484
1456
|
export {
|
|
1485
1457
|
ot as AbortError,
|
|
1486
1458
|
ae as BLOCK_TAGS,
|
|
@@ -1488,9 +1460,9 @@ export {
|
|
|
1488
1460
|
en as COMMON_DPI,
|
|
1489
1461
|
rr as DATE_NOW,
|
|
1490
1462
|
xr as DAY_FRIDAY,
|
|
1491
|
-
|
|
1463
|
+
fr as DAY_MONDAY,
|
|
1492
1464
|
wr as DAY_SATURDAY,
|
|
1493
|
-
|
|
1465
|
+
mr as DAY_SUNDAY,
|
|
1494
1466
|
gr as DAY_THURSDAY,
|
|
1495
1467
|
dr as DAY_TUESDAY,
|
|
1496
1468
|
hr as DAY_WEDNESDAY,
|
|
@@ -1503,7 +1475,7 @@ export {
|
|
|
1503
1475
|
tt as MIME_MULTIPART,
|
|
1504
1476
|
jo as MIME_TEXT,
|
|
1505
1477
|
vr as MONTH_NAMES_CN,
|
|
1506
|
-
|
|
1478
|
+
ft as MONTH_NAMES_EN,
|
|
1507
1479
|
yr as MONTH_NAMES_SHORT_CN,
|
|
1508
1480
|
dt as MONTH_NAMES_SHORT_EN,
|
|
1509
1481
|
or as MONTH_NOW,
|
|
@@ -1526,7 +1498,7 @@ export {
|
|
|
1526
1498
|
Mr as WEEK_DAY_NAMES_CN,
|
|
1527
1499
|
ut as WEEK_DAY_NAMES_EN,
|
|
1528
1500
|
Er as WEEK_DAY_NAMES_SHORT_CN,
|
|
1529
|
-
|
|
1501
|
+
mt as WEEK_DAY_NAMES_SHORT_EN,
|
|
1530
1502
|
nr as YEAR_NOW,
|
|
1531
1503
|
rt as abortableFetch,
|
|
1532
1504
|
Xt as arrayChunk,
|
|
@@ -1616,7 +1588,7 @@ export {
|
|
|
1616
1588
|
b as findOne,
|
|
1617
1589
|
wo as fixBaseUrl,
|
|
1618
1590
|
be as floatVal,
|
|
1619
|
-
|
|
1591
|
+
fe as formatDate,
|
|
1620
1592
|
On as formatSize,
|
|
1621
1593
|
Ye as getBoundingClientRect,
|
|
1622
1594
|
Rn as getCookie,
|
|
@@ -1651,10 +1623,10 @@ export {
|
|
|
1651
1623
|
En as kebabCase,
|
|
1652
1624
|
lo as keepRectInContainer,
|
|
1653
1625
|
he as lerp,
|
|
1654
|
-
|
|
1626
|
+
fn as limit,
|
|
1655
1627
|
de as linear,
|
|
1656
|
-
|
|
1657
|
-
|
|
1628
|
+
mo as loadCss,
|
|
1629
|
+
fo as loadScript,
|
|
1658
1630
|
io as lockElementInteraction,
|
|
1659
1631
|
ko as markdown2Html,
|
|
1660
1632
|
Uo as md5,
|
|
@@ -1664,7 +1636,7 @@ export {
|
|
|
1664
1636
|
Tr as msToHMS,
|
|
1665
1637
|
$e as mutationEffective,
|
|
1666
1638
|
ao as nodeIndex,
|
|
1667
|
-
|
|
1639
|
+
me as objToQuery,
|
|
1668
1640
|
Jo as objectEntries,
|
|
1669
1641
|
Xo as objectFromEntries,
|
|
1670
1642
|
er as objectGet,
|
|
@@ -1684,7 +1656,7 @@ export {
|
|
|
1684
1656
|
xo as precisionToStep,
|
|
1685
1657
|
qn as printStack,
|
|
1686
1658
|
un as ptToMm,
|
|
1687
|
-
|
|
1659
|
+
mn as pxToMm,
|
|
1688
1660
|
nt as queryReplace,
|
|
1689
1661
|
ue as queryToObj,
|
|
1690
1662
|
dn as randomInt,
|