mazey 4.7.10 → 4.7.11

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/README.md CHANGED
@@ -935,7 +935,7 @@ MazeyLog: I am object. {a: 123, b: 456}
935
935
 
936
936
  | Dependency | Version |
937
937
  |------------|----------|
938
- | Node.js | v16.19.0 |
938
+ | Node.js | v16.19.0, v18.12.1 |
939
939
  | TypeScript | v5.1.6 |
940
940
 
941
941
  ### Scripts
package/lib/browser.d.ts CHANGED
@@ -32,6 +32,8 @@ export declare function isSafePWAEnv(): boolean;
32
32
  * Usage:
33
33
  *
34
34
  * ```javascript
35
+ * import { getBrowserInfo } from "mazey";
36
+ *
35
37
  * const ret = getBrowserInfo();
36
38
  * console.log(ret);
37
39
  * ```
@@ -70,11 +72,15 @@ export declare function isSafePWAEnv(): boolean;
70
72
  */
71
73
  export declare function getBrowserInfo(): BrowserInfo;
72
74
  /**
73
- * Generate browser attributes.
75
+ * EN: Generate browser attributes.
76
+ *
77
+ * ZH: 生成浏览器属性。
74
78
  *
75
79
  * Usage:
76
80
  *
77
81
  * ```javascript
82
+ * import { genBrowserAttrs } from "mazey";
83
+ *
78
84
  * const attrs = genBrowserAttrs();
79
85
  * console.log(attrs);
80
86
  * ```
@@ -85,6 +91,7 @@ export declare function getBrowserInfo(): BrowserInfo;
85
91
  * ["windows", "desktop", "webkit", "chrome"]
86
92
  * ```
87
93
  *
94
+ * @environment Browser
88
95
  * @param {string} prefix
89
96
  * @returns {array} Browser attributes
90
97
  * @category Browser Information
@@ -96,6 +103,8 @@ export declare function genBrowserAttrs(prefix?: string, separator?: string): st
96
103
  * Usage:
97
104
  *
98
105
  * ```javascript
106
+ * import { isSupportWebp } from "mazey";
107
+ *
99
108
  * isSupportWebp().then(res => {
100
109
  * console.log("isSupportWebp:", res);
101
110
  * });
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,UAAU,CAAC;AAKlB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAiCtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAkN5C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAK,EAAE,SAAS,SAAM,GAAG,MAAM,EAAE,CAetE;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAmBhD"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,UAAU,CAAC;AAKlB;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAiCtC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAkN5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,MAAM,SAAK,EAAE,SAAS,SAAM,GAAG,MAAM,EAAE,CAetE;AAID;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAmBhD"}
package/lib/calc.d.ts CHANGED
@@ -6,6 +6,8 @@
6
6
  * Usage:
7
7
  *
8
8
  * ```javascript
9
+ * import { longestComSubstring } from "mazey";
10
+ *
9
11
  * const ret = longestComSubstring("fish", "finish");
10
12
  * console.log(ret);
11
13
  * ```
@@ -36,6 +38,8 @@ export declare function calLongestCommonSubstring(aStr: string, bStr: string): n
36
38
  * Usage:
37
39
  *
38
40
  * ```javascript
41
+ * import { longestComSubsequence } from "mazey";
42
+ *
39
43
  * const ret = longestComSubsequence("fish", "finish");
40
44
  * console.log(ret);
41
45
  * ```
@@ -66,6 +70,8 @@ export declare function calLongestCommonSubsequence(aStr: string, bStr: string):
66
70
  * Usage:
67
71
  *
68
72
  * ```javascript
73
+ * import { isHit } from "mazey";
74
+ *
69
75
  * const ret = isHit(0.5); // 0.01 ~ 1 true/false
70
76
  * console.log(ret);
71
77
  * ```
@@ -97,7 +103,7 @@ export declare function calLongestCommonSubsequence(aStr: string, bStr: string):
97
103
  * 499994 500006
98
104
  * ```
99
105
  *
100
- * @param {number} rate -- 0.1 ~ 1 => 1% ~ 100%
106
+ * @param {number} rate 0.1 ~ 1 => 1% ~ 100%
101
107
  * @returns {boolean} true 命中
102
108
  * @category Calculate and Formula
103
109
  */
package/lib/calc.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"calc.d.ts","sourceRoot":"","sources":["../src/calc.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBtE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA8BxE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK3C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C"}
1
+ {"version":3,"file":"calc.d.ts","sourceRoot":"","sources":["../src/calc.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBtE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CA8BxE;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK3C;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5C"}
package/lib/debug.d.ts CHANGED
@@ -6,11 +6,13 @@
6
6
  * Usage:
7
7
  *
8
8
  * ```javascript
9
- * const myConsole = genCustomConsole("[MazeyLog]");
10
- * myConsole.log("I am string.");
11
- * myConsole.info("I am boolean.", true);
12
- * myConsole.info("I am number.", 123, 456);
13
- * myConsole.info("I am object.", { a: 123, b: 456});
9
+ * import { genCustomConsole } from "mazey";
10
+ *
11
+ * const cusConsole = genCustomConsole("[MazeyLog]");
12
+ * cusConsole.log("I am string.");
13
+ * cusConsole.info("I am boolean.", true);
14
+ * cusConsole.info("I am number.", 123, 456);
15
+ * cusConsole.info("I am object.", { a: 123, b: 456});
14
16
  * ```
15
17
  *
16
18
  * Output:
@@ -22,11 +24,16 @@
22
24
  * [MazeyLog] I am object. {a: 123, b: 456}
23
25
  * ```
24
26
  *
25
- * @param {string} prefix 前缀
26
- * @param {string} locales A locale string.
27
- * @param {function} logFn The function with Log.
28
- * @param {function} errorFn The function with Error.
29
- * @returns {object} 新实例
27
+ * @param {string} prefix The prefix string.
28
+ * @param {object} options The options object.
29
+ * @param {boolean} options.isClosed Whether to close the console.
30
+ * @param {boolean} options.showWrap Whether to show the wrap.
31
+ * @param {boolean} options.showDate Whether to show the date.
32
+ * @param {string} options.locales A locale string.
33
+ * @param {boolean} options.isStringifyObject Whether to stringify the object.
34
+ * @param {function} options.logFn The function with Log.
35
+ * @param {function} options.errorFn The function with Error.
36
+ * @returns {object} The custom console object.
30
37
  * @category Debug
31
38
  */
32
39
  export declare function genCustomConsole(prefix?: string, options?: {
@@ -34,6 +41,7 @@ export declare function genCustomConsole(prefix?: string, options?: {
34
41
  showWrap?: boolean;
35
42
  showDate?: boolean;
36
43
  locales?: string;
44
+ isStringifyObject?: boolean;
37
45
  logFn?: () => void;
38
46
  errorFn?: () => void;
39
47
  }): Console;
@@ -1 +1 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,SAAK,EACX,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAQtB,GACA,OAAO,CA0ET;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,SAA8B,CAAC;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,OAAO,SAA6D,CAAC"}
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,SAAK,EACX,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAGtB,GACA,OAAO,CA6ET;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,SAA8B,CAAC;AAEpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,OAAO,SAAsF,CAAC"}
package/lib/dom.d.ts CHANGED
@@ -151,15 +151,20 @@ export declare function addStyle(style: string, options?: {
151
151
  *
152
152
  * Usage:
153
153
  *
154
+ * ```html
155
+ * <img src="image.jpg?width=100px&height=200px">
156
+ * ```
157
+ *
154
158
  * ```javascript
155
- * // Example images with `src` attributes containing `width` and/or `height` values
156
- * const img1 = document.createElement("img");
157
- * img1.setAttribute("src", "https://example.com/example.png?width=2233&height=111");
158
- * document.body.appendChild(img1);
159
- *
160
- * const img2 = document.createElement("img");
161
- * img2.setAttribute("src", "https://example.com/example.png?width=100%&height=auto");
162
- * document.body.appendChild(img2);
159
+ * import { setImgSizeBySrc } from "mazey";
160
+ *
161
+ * setImgSizeBySrc();
162
+ * ```
163
+ *
164
+ * Output:
165
+ *
166
+ * ```html
167
+ * <img src="image.jpg?width=100px&height=200px" width="100px" height="200px">
163
168
  * ```
164
169
  *
165
170
  * @returns {boolean} - Returns `true` if images were found and their dimensions were set, otherwise `false`.
package/lib/dom.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAahE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CA2BxE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAYhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAe,GAAG,OAAO,CA+BtF;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,IAAI,OAAO,CA6CzC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAMlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD"}
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../src/dom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAahE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CA2BxE;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAE5D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAYhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAA;CAAe,GAAG,OAAO,CA+BtF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,IAAI,OAAO,CA6CzC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,CAMlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD"}
package/lib/event.d.ts CHANGED
@@ -5,6 +5,8 @@ import type { DefineListeners, MazeyFn, MazeyObject } from "./typing";
5
5
  * Usage:
6
6
  *
7
7
  * ```javascript
8
+ * import { cancelBubble } from "mazey";
9
+ *
8
10
  * const ret1 = cancelBubble(e);
9
11
  * ```
10
12
  *
@@ -12,12 +14,21 @@ import type { DefineListeners, MazeyFn, MazeyObject } from "./typing";
12
14
  */
13
15
  export declare function cancelBubble(e: Event): void;
14
16
  /**
15
- * Get event container.
17
+ * Get the defined listeners.
16
18
  *
17
19
  * Usage:
18
20
  *
19
21
  * ```javascript
20
- * const ret = getEventContainer();
22
+ * import { getDefineListeners } from "mazey";
23
+ *
24
+ * const ret = getDefineListeners();
25
+ * console.log(ret);
26
+ * ```
27
+ *
28
+ * Output:
29
+ *
30
+ * ```text
31
+ * {}
21
32
  * ```
22
33
  *
23
34
  * @category Event
@@ -55,6 +66,8 @@ export declare function addEvent(type: string, fn: MazeyFn): void;
55
66
  * Usage:
56
67
  *
57
68
  * ```javascript
69
+ * import { fireEvent } from "mazey";
70
+ *
58
71
  * fireEvent("test");
59
72
  * ```
60
73
  *
@@ -75,6 +88,8 @@ export declare function invokeEvent(type: string): void;
75
88
  * Usage:
76
89
  *
77
90
  * ```javascript
91
+ * import { removeEvent } from "mazey";
92
+ *
78
93
  * removeEvent("test");
79
94
  * ```
80
95
  *
@@ -1 +1 @@
1
- {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAS3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAOpD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAQxD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAUlE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAe3D"}
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAS3C;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAOpD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAQxD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAUlE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,CAe3D"}
package/lib/index.cjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Mazey v4.7.10 https://github.com/mazeyqian/mazey
3
- * (c) 2018-2024 Cheng
2
+ * Mazey v4.7.11 https://github.com/mazeyqian/mazey
3
+ * (c) 2018-2025 Cheng
4
4
  * Released under the MIT License.
5
5
  */
6
- "use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(t){if("object"!=typeof t)return t;var n=["string","number","boolean","undefined"];return Object.values(t).every((function(e){return n.includes(typeof e)}))?e({},t):JSON.parse(JSON.stringify(t))}function i(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function a(e){var t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function s(e){return a(e)}function u(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function c(e){void 0===e&&(e=5);for(var t="";e--;)t+=Math.floor(10*Math.random());return t}function f(e){return void 0===e&&(e=5),c(e)}function l(e){void 0===e&&(e=3);var t=[d(),f(e||3)];return t[0]+t[1]}function d(){return Date.now?Date.now():(new Date).getTime()}"function"==typeof SuppressedError&&SuppressedError;var p={type:"d"};function g(e,t){void 0===t&&(t={});var n=t.isNaNAsNumber,r=void 0!==n&&n,o=t.isInfinityAsNumber,i=void 0!==o&&o,a=t.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,t)),r}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return v.apply(void 0,r([e],t,!1))}function h(e){var t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function w(e){var t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function y(e){return"boolean"==typeof e}function x(e){if(!e)return"";var t=new RegExp("\\n","g");return e.replace(t,"<br />")}function b(e,t){void 0===t&&(t={});var n=t.removeNewLine,r=void 0!==n&&n,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o}function S(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x2F;":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&amp;|&lt;|&gt;|&quot;|&#x27;|&#x2F;)/g,(function(e){return t[e]}))}function E(e,t,n){if(void 0===n&&(n={hasDot:!1,dotText:"..."}),n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",s=e.replace(i,"**").length,u=0;u<s&&(null!=(a=e.charAt(u).toString()).match(i)?r+=2:r++,!(r>t));u++)o+=a;return n.hasDot&&s>t&&(o+=n.dotText),o}return""}function A(e,t,n){return void 0===n&&(n=!1),E(e,t,{hasDot:n})}function T(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t(e)}),e)}))]}))}))}var O="";function C(e,t){for(var n=e.length,r=t.length,i=o(new Array(n).fill(new Array(r).fill(0))),a=0;a<n;++a)for(var s=0;s<r;++s)if(e[a]===t[s]){var u=0;a>0&&s>0&&(u=i[a-1][s-1]),i[a][s]=u+1}var c=Array.prototype.concat.apply([],i);return Math.max.apply(Math,c)}function P(e,t){for(var n=e.length,r=t.length,i=o(new Array(n).fill(new Array(r).fill(0))),a=0;a<n;++a)for(var s=0;s<r;++s)if(e[a]===t[s]){var u=0;a>0&&s>0&&(u=i[a-1][s-1]),i[a][s]=u+1}else{var c=[0,0],f=c[0],l=c[1];s>0&&(f=i[a][s-1]),a>0&&(l=i[a-1][s]),i[a][s]=Math.max(f,l)}var d=Array.prototype.concat.apply([],i);return Math.max.apply(Math,d)}function M(e){return Math.random()<e}function k(e,t){void 0===t&&(t={strict:!0});var n=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return t.strict||(n=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),n.test(e)}function N(e){return e.replace(/^http:/,"https:")}function _(e){void 0===e&&(e="");var t=window.URL;if(!t)return!1;if(!t.canParse)return!1;if("function"!=typeof t.canParse)return!1;try{var n=new t("b","http://a");return n.pathname="c d","http://a/c%20d"===n.href&&Boolean(n.searchParams)&&t.canParse(e)}catch(e){return!1}}function j(e,t){void 0===e&&(e=""),void 0===t&&(t={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}});var n=Object.assign({isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",logFn:function(){},errorFn:function(){}},t),o=n.isClosed,i=n.showWrap,a=n.showDate,s=n.locales,u=n.logFn,c=n.errorFn,f=Object.create(null),l=function(){return(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(t){f[t]=function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];if(o)return!1;var f=e,d=e;if("string"==typeof e&&e.length>=2){var p=e.length;f=":"===e[p-1]?e.substring(0,p-1):e}i&&console.log("--- ".concat(f," - begin ---")),a&&(d=e?"".concat(l()," ").concat(e):"".concat(l())),e||a?console[t].apply(console,r([d],n,!1)):console[t].apply(console,n),"log"===t&&u(),"error"===t&&c(),i&&console.log("--- ".concat(f," - end ---"))}})),f}var R=j("[Mazey]"),B=j("",{showDate:!0,locales:"zh-CN"});function L(e,t){if(e)if(Array.isArray(t))t.forEach((function(t){e.classList.add(t)}));else{for(var n=e.className,r=n.split(/\s+/),o=0;o<r.length;o++)if(r[o]===t)return;var i,a="";""!==n&&(a=" "),i=n+a+t,e.className=i}else R.error("The element is not exist.")}function F(){var e,t=window.jQuery||window.$;return t?!(!(e=t("img"))||!e.length)&&(e.each((function(){var e=t(this);if(e){var n=e.attr("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&h(r)&&r[1]&&e.width(r[1]),o&&h(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var t=e;if(t){var n=t.getAttribute("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&h(r)&&r[1]&&(t.style.width=r[1]),o&&h(o)&&o[1]&&(t.style.height=o[1])}}})),!0)}function U(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function D(e,t){var n=U()[e];if(n instanceof Array)for(var r=0,o=n.length;r<o;r++)"function"==typeof n[r]&&(void 0===t?n[r]():n[r](t))}function I(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}function z(e){for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1}var q={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null};function H(t,n){void 0===n&&(n=e({},q));var r,o,i=Object.assign(e({},q),n),a=i.id,s=i.callback,u=i.timeout,c=i.isDefer,f=i.isAsync,l=i.isCrossOrigin,d=i.attributes,p=document.createElement("script");p||Promise.reject("Not support create script element");var g=document.getElementsByTagName("script")[0];return p.type="text/javascript",c&&(p.defer=!0),f&&(p.async=!0),l&&(p.crossOrigin="anonymous"),a&&(p.id=a),d&&Object.keys(d).forEach((function(e){p.setAttribute(e,d[e])})),p.readyState?p.onreadystatechange=function(){"loaded"!==p.readyState&&"complete"!==p.readyState||(p.onreadystatechange=null,m(s),m(r,"loaded"))}:p.onload=function(){m(s),m(r,"loaded")},p.src=t,g&&g.parentNode.insertBefore(p,g),new Promise((function(e,t){var n;r=(n=[e,t])[0],o=n[1],u&&setTimeout(o.bind(null,"timeout"),u)}))}function Z(e){var t=[],n=window.PerformanceObserver;return!!n&&(h(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}function V(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return Z("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function W(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return Z("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}var $="";function J(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var t={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:""};try{var n=navigator.userAgent.toLowerCase();if(!n)return t;var r=function(e){return e.test(n)},o=function(e){var t="",r=n.match(e);return r&&h(r)&&(t=(t=(t=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),t},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),t=e(e({},t),{system:i,appleType:a});var s="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?s="2000":r(/windows nt 5.1|windows xp/g)?s="xp":r(/windows nt 5.2|windows 2003/g)?s="2003":r(/windows nt 6.0|windows vista/g)?s="vista":r(/windows nt 6.1|windows 7/g)?s="7":r(/windows nt 6.2|windows 8/g)?s="8":r(/windows nt 6.3|windows 8.1/g)?s="8.1":r(/windows nt 10.0|windows 10/g)&&(s="10"):"macos"===i?s=o(/os x [\d._]+/g):"android"===i?s=o(/android [\d._]+/g):"ios"===i&&(s=o(/os [\d._]+/g)),t=e(e({},t),{systemVs:s});var u="";"windows"===i||"macos"===i||"linux"===i?u="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(u="mobile"),t=e(e({},t),{platform:u});var c="",f="";r(/applewebkit/g)?(c="webkit",r(/edge/g)?f="edge":r(/opr/g)?f="opera":r(/chrome/g)?f="chrome":r(/safari/g)&&(f="safari")):r(/gecko/g)&&r(/firefox/g)?(c="gecko",f="firefox"):r(/presto/g)?(c="presto",f="opera"):r(/trident|compatible|msie/g)&&(c="trident",f="iexplore"),t=e(e({},t),{engine:c,supporter:f});var l="";"webkit"===c?l=o(/applewebkit\/[\d._]+/g):"gecko"===c?l=o(/gecko\/[\d._]+/g):"presto"===c?l=o(/presto\/[\d._]+/g):"trident"===c&&(l=o(/trident\/[\d._]+/g)),t=e(e({},t),{engineVs:l});var d="";"chrome"===f?d=o(/chrome\/[\d._]+/g):"safari"===f?d=o(/version\/[\d._]+/g):"firefox"===f?d=o(/firefox\/[\d._]+/g):"opera"===f?d=o(/opr\/[\d._]+/g):"iexplore"===f?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===f&&(d=o(/edge\/[\d._]+/g)),t=e(e({},t),{supporterVs:d});var p="",g="";return r(/micromessenger/g)?(p="wechat",g=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",g=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",g=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",g=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",g=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),t=e(e({},t),{shell:p,shellVs:g}),window.MAZEY_BROWSER_INFO=t,t}catch(e){return R.warn(e),t}}var Q="";exports.addClass=L,exports.addEvent=function(e,t){var n=U();void 0===n[e]&&(n[e]=[]),"function"==typeof t&&n[e].push(t)},exports.addStyle=function(e,t){if(void 0===t&&(t={id:""}),!e)return!1;var n=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return t.id?(o="".concat(t.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0},exports.calLongestCommonSubsequence=function(e,t){return P(e,t)},exports.calLongestCommonSubstring=function(e,t){return C(e,t)},exports.camelCase2Underscore=s,exports.camelCaseToKebabCase=function(e){return i(e)},exports.cancelBubble=function(e){var t=e||window.event;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},exports.clearHTML=function(e,t){return void 0===t&&(t={}),b(e,t)},exports.clearHtml=function(e,t){return void 0===t&&(t={}),b(e,t)},exports.convert10To26=function(e){for(var t="";e>0;){var n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=i,exports.convertCamelToUnder=a,exports.convertHttpToHttps=N,exports.convertKebabToCamel=function(e){var t=e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}));return t.endsWith("-")?t.slice(0,-1):t},exports.convertObjectToQuery=function(e){if(e&&0===Object.keys(e).length)return"";var t="?";for(var n in e)t+="".concat(n,"=").concat(e[n],"&");return t.slice(0,-1)},exports.convertToHtmlBreaks=x,exports.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,(function(e,t){return t.toUpperCase()}))},exports.cutCHSString=function(e,t,n){return void 0===n&&(n=!1),A(e,t,n)},exports.cutZHString=E,exports.debounce=function(e,t,n){var r=null,o=null,i=null,a=null,s=null,u=function(){var c=d()-i;c<t&&c>=0?o=setTimeout(u,t-c):(o=null,n||(s=e.apply(r,a),o||(r=a=null)))};return function(){for(var c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];r=this,a=c,i=d();var l=n&&!o;return o||(o=setTimeout(u,t)),l&&(s=e.apply(r,a),r=a=null),s}},exports.deepCopy=o,exports.deepCopyObject=function(e){return o(e)},exports.delCookie=function(e){z(e)},exports.doFn=m,exports.fireEvent=D,exports.floatFixed=function(e,t){return void 0===t&&(t=0),parseFloat(e).toFixed(t)},exports.floatToPercent=function(e,t){void 0===t&&(t=0);var n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),"".concat(n,"%")},exports.formatDate=function(e,t){void 0===t&&(t="yyyy-MM-dd"),e||(e=new Date);var n=new Date(e),r=n.getHours(),o={yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate()<10?"0"+n.getDate():n.getDate(),HH:r<10?"0"+r:r,hh:(r%12||12)<10?"0"+(r%12||12):r%12||12,mm:n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),ss:n.getSeconds()<10?"0"+n.getSeconds():n.getSeconds(),a:r<12?"AM":"PM"},i=t||"yyyy-MM-dd";return Object.keys(o).forEach((function(e){var t=o[e];"MM"===e&&Number(t)<=9&&(t="0".concat(t)),i=i.replace(e,String(t))})),i},exports.genBrowserAttrs=function(e,t){void 0===e&&(e=""),void 0===t&&(t="-");var n=J(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach((function(o){var i=n[o];if(i){var a="";e&&e.length>0&&(a="".concat(e).concat(t)),r.push("".concat(a).concat(i))}})),r},exports.genCustomConsole=j,exports.genHashCode=function(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n},exports.genRndNumString=c,exports.genStyleString=function(e,t){var n="";return t&&t.length>0&&(n=t.join(";")+";"),"".concat(e,"{").concat(n,"}")},exports.genUniqueNumString=l,exports.generateRndNum=f,exports.generateUniqueNum=function(e){return void 0===e&&(e=3),l(e)},exports.getAllQueryParams=function(e){void 0===e&&(e=""),""===e&&(e=location.search);var t={};return e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,n,r){return void 0===t[n]&&(t[n]=decodeURIComponent(r)),""})),t},exports.getBrowserInfo=J,exports.getCLS=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return Z("layout-shift")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().reduce((function(e,t){var n=0;return g(t.value)&&(n=t.value),e+n}),0);t.disconnect(),e(r)}));t.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))},exports.getCookie=I,exports.getCurrentVersion=function(){return"v4"},exports.getDefineListeners=U,exports.getDomain=function(e,t){if(void 0===t&&(t=["hostname"]),_(e)){var n=new window.URL(e);return t.reduce((function(e,t){return e+=n[t]}),"")}var r=document.createElement("a");return r.href=e,t.reduce((function(e,t){return e+=r[t]}),"")},exports.getFCP=V,exports.getFID=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return Z("first-input")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){t.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));t.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))},exports.getFP=W,exports.getFileSize=function(e){var t=function(e){return String(Math.ceil(e))};if(!e||e<0)return"";var n=1024;return e<n?e+" B":e<Math.pow(n,2)?t(e/n)+" KB":e<Math.pow(n,3)?t(e/Math.pow(n,2))+" MB":e<Math.pow(n,4)?t(e/Math.pow(n,3))+" G":t(e/Math.pow(n,4))+" T"},exports.getFriendlyInterval=function(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=p);var r=(n=Object.assign(p,n)).type,o=decodeURIComponent;g(e)||(e=new Date(e).getTime()),g(t)||(t=new Date(t).getTime());var i=Number(t)-Number(e),a="",s=new Array(4).fill(0),u=s[0],c=(s[1],s[2],s[3]),f=o("%20%E5%A4%A9%20"),l=o("%20%E6%97%B6%20"),d=o("%20%E5%88%86%20"),v=o("%20%E7%A7%92");if(i>=0)switch(u=Math.floor(i/1e3/60/60/24),Math.floor(i/1e3/60/60),Math.floor(i/1e3/60),c=Math.floor(i/1e3),r){case"d":a=u;break;case"text":a=(u=Math.floor(i/1e3/60/60/24))+f+Math.floor(i/1e3/60/60%24)+l+Math.floor(i/1e3/60%60)+d+(c=Math.floor(i/1e3%60))+v;break;default:a=c}return a},exports.getHashQueryParam=function(e){var t=location.hash.split("?");if(1===t.length)return"";var n=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=t[1].match(n);return r?r[2]:""},exports.getLCP=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return Z("largest-contentful-paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))},exports.getLocalStorage=function(e){var t=null;if(e){var n=localStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getPageMeta=function(e){var t;return document.querySelector&&(null===(t=document.querySelector('meta[name="'.concat(e,'"]')))||void 0===t?void 0:t.getAttribute("content"))||""},exports.getPerformance=function(e){return void 0===e&&(e=!1),t(this,void 0,void 0,(function(){function t(){var t={source:U,os:r(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:w-y,redirectTime:x-b,dnsTime:S-E,tcpTime:A-T,sslTime:c(A,O),responseTime:C-P,downloadTime:M-C,firstPaintTime:z,firstContentfulPaintTime:q,domReadyTime:k-D,onloadTime:N-D,whiteTime:C-D,renderTime:_-D,decodedBodySize:B,encodedBodySize:L};Object.keys(t).forEach((function(e){g(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))})),g(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);var n={};e||Object.keys(t).forEach((function(e){n[s(e)]=t[e]})),Object.keys(n).length?l(n):l(t)}function r(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",t=navigator.userAgent,n=t.indexOf("Android")>-1||t.indexOf("Linux")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,t=navigator.userAgent.toLowerCase(),n=t.match(/(ipad)/i)&&"ipad",r=t.match(/iphone os/i)&&"iphone os",o=t.match(/midp/i)&&"midp",i=t.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=t.match(/ucweb/i)&&"ucweb",s=t.match(/android/i)&&"android",u=t.match(/windows ce/i)&&"windows ce",c=t.match(/windows mobile/i)&&"windows mobile";return(e=n||r||o||i||a||s||u||c?r||o||i||a||s||u||c?"phone":n?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function c(e,t){var n=0;return t&&(n=e-t),n}var f,l,d,p,v,m,w,y,x,b,S,E,A,T,O,C,P,M,k,N,_,j,R,B,L,F,U,D,I,z,q;return n(this,(function(e){switch(e.label){case 0:if(!Z("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(f=window.performance)||"function"!=typeof f.getEntries||"function"!=typeof f.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(d=new Promise((function(e){l=[e][0]})),p=null,h(v=f.getEntriesByType("navigation"))&&(p=v[0]),m=new Array(19).fill(0),w=m[0],y=m[1],x=m[2],b=m[3],S=m[4],E=m[5],A=m[6],T=m[7],O=m[8],C=m[9],P=m[10],M=m[11],k=m[12],N=m[13],_=m[14],j=m[15],R=m[16],B=m[17],L=m[18],F=f.timing,U="",p)U="PerformanceNavigationTiming",B=p.decodedBodySize,L=p.encodedBodySize,w=p.unloadEventEnd,y=p.unloadEventStart,x=p.redirectEnd,b=p.redirectStart,S=p.domainLookupEnd,E=p.domainLookupStart,A=p.connectEnd,T=p.connectStart,O=p.secureConnectionStart,C=p.responseStart,P=p.requestStart,M=p.responseEnd,k=p.domContentLoadedEventStart,N=p.loadEventStart,_=p.loadEventEnd,j=p.startTime,R=p.fetchStart;else{if(!F)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];U="PerformanceTiming",w=F.unloadEventEnd,y=F.unloadEventStart,x=F.redirectEnd,b=F.redirectStart,S=F.domainLookupEnd,E=F.domainLookupStart,A=F.connectEnd,T=F.connectStart,O=F.secureConnectionStart,C=F.responseStart,P=F.requestStart,M=F.responseEnd,k=F.domContentLoadedEventStart,N=F.loadEventStart,_=F.loadEventEnd,j=F.navigationStart,R=F.fetchStart}if(D=0,g(j))D=j;else{if(!g(R))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];D=R}return[4,Promise.all([W(),V()])];case 1:return I=e.sent(),z=I[0],q=I[1],g(_)&&_>0?t():window.addEventListener("load",(function(){window.setTimeout((function(){t()}),0)})),[2,d]}}))}))},exports.getQueryParam=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=location.search.substring(1).match(t);return null!==n?decodeURIComponent(n[2]):""},exports.getScriptQueryParam=function(e,t){void 0===t&&(t=""),t||(t=".js");for(var n=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(t,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(t)){var a=i.match(n);if(a)return decodeURIComponent(a[1])}}return""},exports.getSessionStorage=function(e){var t=null;if(e){var n=sessionStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getTTFB=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){return Z("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(t=e.responseStart-e.requestStart,[2,Math.round(t)]):[2,0]):[2,0]}))}))},exports.getUrlFileType=function(e){var t="";if("string"!=typeof e||""==e)return t;var n=/\.[^/?#]+$/.exec(e);return n?(n[0].length>1&&(t=n[0].substring(1)),t):t},exports.getUrlHost=function(e){var t="";return!k(e)&&k(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),_(e)&&(t=new URL(e).host),t},exports.getUrlParam=function(e,t,n){void 0===n&&(n={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(t)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,t,n){return void 0!==o[t]?o[t].push(n):o[t]=[n],""})),r=o[t]||[]}return n.returnArray?r:r.length?r[0]:null},exports.getUrlPath=function(e){var t="";return!k(e)&&k(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),_(e)&&(t=new URL(e).pathname),t},exports.hasClass=function(e,t){if(!e)return R.error("The element is not exist."),!1;for(var n=e.className.split(/\s+/),r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},exports.inRate=function(e){return M(e)},exports.invokeEvent=function(e){D(e)},exports.invokeFn=v,exports.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},exports.isBool=y,exports.isBoolean=function(e){return y(e)},exports.isBrowser=function(){if(O)return"browser"===O;var e="undefined"!=typeof window;return e&&(O="browser"),e},exports.isFunction=function(e){return"function"==typeof e},exports.isHit=M,exports.isJSONString=u,exports.isJsonString=function(e){return u(e)},exports.isNonEmptyArray=h,exports.isNonEmptyObject=function(e){return!!w(e)&&0!==Object.keys(e).length},exports.isNumber=g,exports.isPureObject=w,exports.isSafePWAEnv=function(){if($)return"pwa"===$;var e=J();return"serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches)&&!e.shell?($="pwa",!0):($="no-pwa",!1)},exports.isString=function(e){return"string"==typeof e},exports.isSupportWebp=function(){return Q?Promise.resolve("webp"===Q):new Promise((function(e){var t=new Image;t.onload=function(){var n=t.width>0&&t.height>0;Q=n?"webp":"no-webp",e(n)},t.onerror=function(){Q="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))},exports.isSupportedEntryType=Z,exports.isUdfOrNul=function(e){return null==e},exports.isValidData=function(e,t,n){var r=!1;return"object"!=typeof e||t.reduce((function(e,t){return void 0===e[t]?Object.create(null):e=e[t]}),e)===n&&(r=!0),r},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=k,exports.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},exports.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b()!@:%_+.~#?&//=]*)$/.test(e)},exports.loadCSS=function(e,t){void 0===t&&(t={id:""});var n,r=t.id,o=function(){},i=new Promise((function(e,t){var r;n=(r=[e,t])[0],o=r[1]})),a=function(){n("loaded")},s=document.createElement("link");s||o(new Error("Not support create link element"));var u="onload"in s,c=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(s.rel="stylesheet",s.type="text/css",s.href=e,void 0!==r&&(s.id=r),document.getElementsByTagName("head")[0].appendChild(s),c||!u)return setTimeout((function(){l(s,a,0)}),1),i;function f(){s&&(s.onload=s.onerror=s.onreadystatechange=null),s=null,a()}function l(e,t,n){if(e){var r,o=e.sheet;if((n+=1)>3e5)return r=!0,e&&(e=null),void t();if(c)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?t():l(e,t,n)}),20)}}return u?(s.onload=f,s.onerror=function(){f()}):s.onreadystatechange=function(){s&&/loaded|complete/.test(s.readyState)&&f()},i},exports.loadImage=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},exports.loadScript=H,exports.loadScriptIfUndefined=function(e,t){return window[e]?Promise.resolve("defined"):H(t)},exports.longestComSubsequence=P,exports.longestComSubstring=C,exports.mNow=d,exports.mTrim=function(e){for(var t=(e=e.replace(/^\s+/,"")).length-1,n=/\s/;n.test(e.charAt(t));)t--;return e.slice(0,t+1)},exports.mazeyCon=R,exports.newLine=function(e){return x(e)},exports.removeClass=function(e,t){var n;e?(n=(n=(n=(n=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+t+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=n):R.error("The element is not exist.")},exports.removeCookie=z,exports.removeEvent=function(e,t){var n=U(),r=n[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof t){for(var o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.removeHTML=b,exports.removeHtml=function(e,t){return void 0===t&&(t={}),b(e,t)},exports.repeatUntilConditionMet=function(e,r,o){var i=this;void 0===r&&(r={}),void 0===o&&(o=function(e){return!0===e});var a=r.interval,s=void 0===a?1e3:a,u=r.times,c=void 0===u?10:u,f=r.context,l=r.args,d=0,p=function(){setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,e.apply(f,l)];case 1:return t=n.sent(),o(t)||++d>=c?[2]:(p(),[2])}}))}))}),s)};"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof c||c<0)&&console.error("Expected a non-negative number for times."),p()},exports.replaceHttp=function(e){return N(e)},exports.sanitizeInput=function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return t[e]}))},exports.setClass=function(e,t){L(e,t)},exports.setCookie=function(e,t,n,r){var o,i;if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var s=location.host;1===s.split(".").length?document.cookie=e+"="+t+i+"; path=/":((o=s.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+t+i+"; path=/; domain="+r,null!==I(e)&&I(e)===t||(r=r||"."+s,document.cookie=e+"="+t+i+"; path=/; domain="+r))},exports.setImgSizeBySrc=F,exports.setImgWidHeiBySrc=function(){return F()},exports.setLocalStorage=function(e,t){void 0===t&&(t=null),e&&localStorage.setItem(e,JSON.stringify(t))},exports.setSessionStorage=function(e,t){void 0===t&&(t=null),e&&sessionStorage.setItem(e,JSON.stringify(t))},exports.sleep=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,T(e)]}))}))},exports.throttle=function(e,t,n){void 0===n&&(n={}),n=Object.assign({},n);var r=null,o=null,i=null,a=[null,0],s=a[0],u=a[1],c=function(){u=!1===n.leading?0:d(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];var l=d();u||!1!==n.leading||(u=l);var p=t-(l-u);return r=this,o=a,p<=0||p>t?(i&&(clearTimeout(i),i=null),u=l,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),p)),s}},exports.timeCon=B,exports.truncateZHString=A,exports.unsanitize=function(e){return S(e)},exports.unsanitizeInput=S,exports.updateQueryParam=function(e,t,n){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(t,n),r.toString()}var o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+n+"$2"):e+i+t+"="+n},exports.waitTime=T,exports.windowLoaded=function(e){void 0===e&&(e=90);var t,n=function(){},r=new Promise((function(e,r){n=e,t=r}));return"complete"===document.readyState?n("complete"):window.addEventListener("load",(function(){return n("load")})),setTimeout((function(){return t(Error("timeout"))}),1e3*e),r},exports.zAxiosIsValidRes=function(e,t){void 0===t&&(t={validStatusRange:[200,300],validCode:[0]});var n=Object.assign({validStatusRange:[200,300],validCode:[0]},t),r=n.validStatusRange,o=n.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i};
6
+ "use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)};function t(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function n(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function r(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function o(t){if("object"!=typeof t)return t;var n=["string","number","boolean","undefined"];return Object.values(t).every((function(e){return n.includes(typeof e)}))?e({},t):JSON.parse(JSON.stringify(t))}function i(e){var t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function a(e){var t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function s(e){return a(e)}function u(e){try{if("object"==typeof JSON.parse(e))return!0}catch(e){}return!1}function c(e){void 0===e&&(e=5);for(var t="";e--;)t+=Math.floor(10*Math.random());return t}function f(e){return void 0===e&&(e=5),c(e)}function d(e){void 0===e&&(e=3);var t=[l(),f(e||3)];return t[0]+t[1]}function l(){return Date.now?Date.now():(new Date).getTime()}"function"==typeof SuppressedError&&SuppressedError;var p={type:"d"};function g(e,t){void 0===t&&(t={});var n=t.isNaNAsNumber,r=void 0!==n&&n,o=t.isInfinityAsNumber,i=void 0!==o&&o,a=t.isUnFiniteAsNumber;return"number"==typeof e&&(!(!0!==i&&!0!==(void 0!==a&&a)&&!isFinite(e))&&!(!r&&isNaN(e)))}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=null;return e&&"function"==typeof e&&(r=e.apply(void 0,t)),r}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return v.apply(void 0,r([e],t,!1))}function h(e){var t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function w(e){var t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function y(e){return"boolean"==typeof e}function x(e){if(!e)return"";var t=new RegExp("\\n","g");return e.replace(t,"<br />")}function b(e,t){void 0===t&&(t={});var n=t.removeNewLine,r=void 0!==n&&n,o="";return e&&(o=e.replace(/<\/?.+?>/g,""),r&&(o=o.replace(/[\r\n]/g,""))),o}function S(e){var t={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#x27;":"'","&#x2F;":"/"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/(&amp;|&lt;|&gt;|&quot;|&#x27;|&#x2F;)/g,(function(e){return t[e]}))}function E(e,t,n){if(void 0===n&&(n={hasDot:!1,dotText:"..."}),n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){for(var r=0,o="",i=/[^\x00-\xff]/g,a="",s=e.replace(i,"**").length,u=0;u<s&&(null!=(a=e.charAt(u).toString()).match(i)?r+=2:r++,!(r>t));u++)o+=a;return n.hasDot&&s>t&&(o+=n.dotText),o}return""}function A(e,t,n){return void 0===n&&(n=!1),E(e,t,{hasDot:n})}function T(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t){setTimeout((function(){t(e)}),e)}))]}))}))}var O="";function C(e,t){for(var n=e.length,r=t.length,i=o(new Array(n).fill(new Array(r).fill(0))),a=0;a<n;++a)for(var s=0;s<r;++s)if(e[a]===t[s]){var u=0;a>0&&s>0&&(u=i[a-1][s-1]),i[a][s]=u+1}var c=Array.prototype.concat.apply([],i);return Math.max.apply(Math,c)}function P(e,t){for(var n=e.length,r=t.length,i=o(new Array(n).fill(new Array(r).fill(0))),a=0;a<n;++a)for(var s=0;s<r;++s)if(e[a]===t[s]){var u=0;a>0&&s>0&&(u=i[a-1][s-1]),i[a][s]=u+1}else{var c=[0,0],f=c[0],d=c[1];s>0&&(f=i[a][s-1]),a>0&&(d=i[a-1][s]),i[a][s]=Math.max(f,d)}var l=Array.prototype.concat.apply([],i);return Math.max.apply(Math,l)}function M(e){return Math.random()<e}function k(e,t){void 0===t&&(t={strict:!0});var n=/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/;return t.strict||(n=/^(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9\u4E00-\u9FA5()!@:%_+.~#?&//=]*)/),n.test(e)}function N(e){return e.replace(/^http:/,"https:")}function _(e){void 0===e&&(e="");var t=window.URL;if(!t)return!1;if(!t.canParse)return!1;if("function"!=typeof t.canParse)return!1;try{var n=new t("b","http://a");return n.pathname="c d","http://a/c%20d"===n.href&&Boolean(n.searchParams)&&t.canParse(e)}catch(e){return!1}}var j={isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:function(){},errorFn:function(){}};function R(t,n){void 0===t&&(t=""),void 0===n&&(n=e({},j));var o=Object.assign(e({},j),n),i=o.isClosed,a=o.showWrap,s=o.showDate,u=o.locales,c=o.isStringifyObject,f=o.logFn,d=o.errorFn,l=Object.create(null),p=function(){return(new Date).toLocaleDateString(u,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"})};return["log","info","warn","error"].forEach((function(e){l[e]=function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(i)return!1;var u=t,l=t;if("string"==typeof t&&t.length>=2){var g=t.length;u=":"===t[g-1]?t.substring(0,g-1):t}a&&console.log("--- ".concat(u," - begin ---")),s&&(l=t?"".concat(p()," ").concat(t):"".concat(p())),c&&(n=n.map((function(e){return w(e)?JSON.stringify(e):e}))),t||s?console[e].apply(console,r([l],n,!1)):console[e].apply(console,n),"log"===e&&f(),"error"===e&&d(),a&&console.log("--- ".concat(u," - end ---"))}})),l}var B=R("[Mazey]"),L=R("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function F(e,t){if(e)if(Array.isArray(t))t.forEach((function(t){e.classList.add(t)}));else{for(var n=e.className,r=n.split(/\s+/),o=0;o<r.length;o++)if(r[o]===t)return;var i,a="";""!==n&&(a=" "),i=n+a+t,e.className=i}else B.error("The element is not exist.")}function I(){var e,t=window.jQuery||window.$;return t?!(!(e=t("img"))||!e.length)&&(e.each((function(){var e=t(this);if(e){var n=e.attr("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&h(r)&&r[1]&&e.width(r[1]),o&&h(o)&&o[1]&&e.height(o[1])}}})),!0):(e=document.getElementsByTagName("img")).length>0&&(Array.from(e).forEach((function(e){var t=e;if(t){var n=t.getAttribute("src");if(n&&"string"==typeof n&&n.length){var r=n.match(/width=([0-9]+[a-z%]*)/),o=n.match(/height=([0-9]+[a-z%]*)/);r&&h(r)&&r[1]&&(t.style.width=r[1]),o&&h(o)&&o[1]&&(t.style.height=o[1])}}})),!0)}function U(){var e=window.MAZEY_DEFINE_LISTENERS;return"object"!=typeof e&&(e={},window.MAZEY_DEFINE_LISTENERS=e),e}function D(e,t){var n=U()[e];if(n instanceof Array)for(var r=0,o=n.length;r<o;r++)"function"==typeof n[r]&&(void 0===t?n[r]():n[r](t))}function z(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var o=n[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}function q(e){for(var t=document.cookie.split(";"),n=0;n<t.length;n++){var r=t[n].trim();if(r.startsWith("".concat(e,"="))){var o=r.split("=")[0],i=new Date;return i.setTime(i.getTime()-1),document.cookie="".concat(o,"=;expires=").concat(i.toUTCString()),!0}}return!1}var H={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null};function Z(t,n){void 0===n&&(n=e({},H));var r,o,i=Object.assign(e({},H),n),a=i.id,s=i.callback,u=i.timeout,c=i.isDefer,f=i.isAsync,d=i.isCrossOrigin,l=i.attributes,p=document.createElement("script");p||Promise.reject("Not support create script element");var g=document.getElementsByTagName("script")[0];return p.type="text/javascript",c&&(p.defer=!0),f&&(p.async=!0),d&&(p.crossOrigin="anonymous"),a&&(p.id=a),l&&Object.keys(l).forEach((function(e){p.setAttribute(e,l[e])})),p.readyState?p.onreadystatechange=function(){"loaded"!==p.readyState&&"complete"!==p.readyState||(p.onreadystatechange=null,m(s),m(r,"loaded"))}:p.onload=function(){m(s),m(r,"loaded")},p.src=t,g&&g.parentNode.insertBefore(p,g),new Promise((function(e,t){var n;r=(n=[e,t])[0],o=n[1],u&&setTimeout(o.bind(null,"timeout"),u)}))}function V(e){var t=[],n=window.PerformanceObserver;return!!n&&(h(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}function W(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return V("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-contentful-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}function $(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return V("paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-paint"===e.name}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"paint",buffered:!0})}))]:[2,0]}))}))}var J="";function Q(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;var t={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:""};try{var n=navigator.userAgent.toLowerCase();if(!n)return t;var r=function(e){return e.test(n)},o=function(e){var t="",r=n.match(e);return r&&h(r)&&(t=(t=(t=r.toString()).replace(/[^0-9|_.]/g,"")).replace(/_/g,".")),t},i="",a="";r(/windows|win32|win64|wow32|wow64/g)?i="windows":r(/macintosh|macintel/g)?i="macos":r(/x11/g)?i="linux":r(/android|adr/g)?i="android":r(/ios|iphone|ipad|ipod|iwatch/g)&&(i="ios",r(/ipad/g)?a="ipad":r(/iphone/g)?a="iphone":r(/iwatch/g)?a="iwatch":r(/ipod/g)&&(a="ipod")),t=e(e({},t),{system:i,appleType:a});var s="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?s="2000":r(/windows nt 5.1|windows xp/g)?s="xp":r(/windows nt 5.2|windows 2003/g)?s="2003":r(/windows nt 6.0|windows vista/g)?s="vista":r(/windows nt 6.1|windows 7/g)?s="7":r(/windows nt 6.2|windows 8/g)?s="8":r(/windows nt 6.3|windows 8.1/g)?s="8.1":r(/windows nt 10.0|windows 10/g)&&(s="10"):"macos"===i?s=o(/os x [\d._]+/g):"android"===i?s=o(/android [\d._]+/g):"ios"===i&&(s=o(/os [\d._]+/g)),t=e(e({},t),{systemVs:s});var u="";"windows"===i||"macos"===i||"linux"===i?u="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(u="mobile"),t=e(e({},t),{platform:u});var c="",f="";r(/applewebkit/g)?(c="webkit",r(/edge/g)?f="edge":r(/opr/g)?f="opera":r(/chrome/g)?f="chrome":r(/safari/g)&&(f="safari")):r(/gecko/g)&&r(/firefox/g)?(c="gecko",f="firefox"):r(/presto/g)?(c="presto",f="opera"):r(/trident|compatible|msie/g)&&(c="trident",f="iexplore"),t=e(e({},t),{engine:c,supporter:f});var d="";"webkit"===c?d=o(/applewebkit\/[\d._]+/g):"gecko"===c?d=o(/gecko\/[\d._]+/g):"presto"===c?d=o(/presto\/[\d._]+/g):"trident"===c&&(d=o(/trident\/[\d._]+/g)),t=e(e({},t),{engineVs:d});var l="";"chrome"===f?l=o(/chrome\/[\d._]+/g):"safari"===f?l=o(/version\/[\d._]+/g):"firefox"===f?l=o(/firefox\/[\d._]+/g):"opera"===f?l=o(/opr\/[\d._]+/g):"iexplore"===f?l=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===f&&(l=o(/edge\/[\d._]+/g)),t=e(e({},t),{supporterVs:l});var p="",g="";return r(/micromessenger/g)?(p="wechat",g=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",g=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",g=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",g=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",g=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),t=e(e({},t),{shell:p,shellVs:g}),window.MAZEY_BROWSER_INFO=t,t}catch(e){return B.warn(e),t}}var Y="";exports.addClass=F,exports.addEvent=function(e,t){var n=U();void 0===n[e]&&(n[e]=[]),"function"==typeof t&&n[e].push(t)},exports.addStyle=function(e,t){if(void 0===t&&(t={id:""}),!e)return!1;var n=document.createDocumentFragment(),r=null,o="",i=document.createElement("style");return t.id?(o="".concat(t.id),(r=document.getElementById(o))?r.innerHTML=e:(i.setAttribute("id",t.id),i.innerHTML=e,n.appendChild(i),document.head.appendChild(n))):(i.innerHTML=e,n.appendChild(i),document.head.appendChild(n)),!0},exports.calLongestCommonSubsequence=function(e,t){return P(e,t)},exports.calLongestCommonSubstring=function(e,t){return C(e,t)},exports.camelCase2Underscore=s,exports.camelCaseToKebabCase=function(e){return i(e)},exports.cancelBubble=function(e){var t=e||window.event;t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},exports.clearHTML=function(e,t){return void 0===t&&(t={}),b(e,t)},exports.clearHtml=function(e,t){return void 0===t&&(t={}),b(e,t)},exports.convert10To26=function(e){for(var t="";e>0;){var n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t},exports.convertCamelToKebab=i,exports.convertCamelToUnder=a,exports.convertHttpToHttps=N,exports.convertKebabToCamel=function(e){var t=e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}));return t.endsWith("-")?t.slice(0,-1):t},exports.convertObjectToQuery=function(e){if(e&&0===Object.keys(e).length)return"";var t="?";for(var n in e)t+="".concat(n,"=").concat(e[n],"&");return t.slice(0,-1)},exports.convertToHtmlBreaks=x,exports.convertUnderToCamel=function(e){return e.replace(/_([a-z])/g,(function(e,t){return t.toUpperCase()}))},exports.cutCHSString=function(e,t,n){return void 0===n&&(n=!1),A(e,t,n)},exports.cutZHString=E,exports.debounce=function(e,t,n){var r=null,o=null,i=null,a=null,s=null,u=function(){var c=l()-i;c<t&&c>=0?o=setTimeout(u,t-c):(o=null,n||(s=e.apply(r,a),o||(r=a=null)))};return function(){for(var c=[],f=0;f<arguments.length;f++)c[f]=arguments[f];r=this,a=c,i=l();var d=n&&!o;return o||(o=setTimeout(u,t)),d&&(s=e.apply(r,a),r=a=null),s}},exports.deepCopy=o,exports.deepCopyObject=function(e){return o(e)},exports.delCookie=function(e){q(e)},exports.doFn=m,exports.fireEvent=D,exports.floatFixed=function(e,t){return void 0===t&&(t=0),parseFloat(e).toFixed(t)},exports.floatToPercent=function(e,t){void 0===t&&(t=0);var n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),"".concat(n,"%")},exports.formatDate=function(e,t){void 0===t&&(t="yyyy-MM-dd"),e||(e=new Date);var n=new Date(e),r=n.getHours(),o={yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate()<10?"0"+n.getDate():n.getDate(),HH:r<10?"0"+r:r,hh:(r%12||12)<10?"0"+(r%12||12):r%12||12,mm:n.getMinutes()<10?"0"+n.getMinutes():n.getMinutes(),ss:n.getSeconds()<10?"0"+n.getSeconds():n.getSeconds(),a:r<12?"AM":"PM"},i=t||"yyyy-MM-dd";return Object.keys(o).forEach((function(e){var t=o[e];"MM"===e&&Number(t)<=9&&(t="0".concat(t)),i=i.replace(e,String(t))})),i},exports.genBrowserAttrs=function(e,t){void 0===e&&(e=""),void 0===t&&(t="-");var n=Q(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach((function(o){var i=n[o];if(i){var a="";e&&e.length>0&&(a="".concat(e).concat(t)),r.push("".concat(a).concat(i))}})),r},exports.genCustomConsole=R,exports.genHashCode=function(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n},exports.genRndNumString=c,exports.genStyleString=function(e,t){var n="";return t&&t.length>0&&(n=t.join(";")+";"),"".concat(e,"{").concat(n,"}")},exports.genUniqueNumString=d,exports.generateRndNum=f,exports.generateUniqueNum=function(e){return void 0===e&&(e=3),d(e)},exports.getAllQueryParams=function(e){void 0===e&&(e=""),""===e&&(e=location.search);var t={};return e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,n,r){return void 0===t[n]&&(t[n]=decodeURIComponent(r)),""})),t},exports.getBrowserInfo=Q,exports.getCLS=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return V("layout-shift")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().reduce((function(e,t){var n=0;return g(t.value)&&(n=t.value),e+n}),0);t.disconnect(),e(r)}));t.observe({type:"layout-shift",buffered:!0})}))]:[2,0]}))}))},exports.getCookie=z,exports.getCurrentVersion=function(){return"v4"},exports.getDefineListeners=U,exports.getDomain=function(e,t){if(void 0===t&&(t=["hostname"]),_(e)){var n=new window.URL(e);return t.reduce((function(e,t){return e+=n[t]}),"")}var r=document.createElement("a");return r.href=e,t.reduce((function(e,t){return e+=r[t]}),"")},exports.getFCP=W,exports.getFID=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return V("first-input")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"first-input"===e.entryType}));if(r){t.disconnect();var o=r.processingStart;e(o?Math.round(r.processingStart-r.startTime):0)}}));t.observe({type:"first-input",buffered:!0})}))]:[2,0]}))}))},exports.getFP=$,exports.getFileSize=function(e){var t=function(e){return String(Math.ceil(e))};if(!e||e<0)return"";var n=1024;return e<n?e+" B":e<Math.pow(n,2)?t(e/n)+" KB":e<Math.pow(n,3)?t(e/Math.pow(n,2))+" MB":e<Math.pow(n,4)?t(e/Math.pow(n,3))+" G":t(e/Math.pow(n,4))+" T"},exports.getFriendlyInterval=function(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=p);var r=(n=Object.assign(p,n)).type,o=decodeURIComponent;g(e)||(e=new Date(e).getTime()),g(t)||(t=new Date(t).getTime());var i=Number(t)-Number(e),a="",s=new Array(4).fill(0),u=s[0],c=(s[1],s[2],s[3]),f=o("%20%E5%A4%A9%20"),d=o("%20%E6%97%B6%20"),l=o("%20%E5%88%86%20"),v=o("%20%E7%A7%92");if(i>=0)switch(u=Math.floor(i/1e3/60/60/24),Math.floor(i/1e3/60/60),Math.floor(i/1e3/60),c=Math.floor(i/1e3),r){case"d":a=u;break;case"text":a=(u=Math.floor(i/1e3/60/60/24))+f+Math.floor(i/1e3/60/60%24)+d+Math.floor(i/1e3/60%60)+l+(c=Math.floor(i/1e3%60))+v;break;default:a=c}return a},exports.getHashQueryParam=function(e){var t=location.hash.split("?");if(1===t.length)return"";var n=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),r=t[1].match(n);return r?r[2]:""},exports.getLCP=function(){return t(this,void 0,void 0,(function(){return n(this,(function(e){return V("largest-contentful-paint")?[2,new Promise((function(e){var t=new PerformanceObserver((function(n){var r=n.getEntries().find((function(e){return"largest-contentful-paint"===e.entryType}));r&&(t.disconnect(),e(Math.round(r.startTime)))}));t.observe({type:"largest-contentful-paint",buffered:!0})}))]:[2,0]}))}))},exports.getLocalStorage=function(e){var t=null;if(e){var n=localStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getPageMeta=function(e){var t;return document.querySelector&&(null===(t=document.querySelector('meta[name="'.concat(e,'"]')))||void 0===t?void 0:t.getAttribute("content"))||""},exports.getPerformance=function(e){return void 0===e&&(e=!1),t(this,void 0,void 0,(function(){function t(){var t={source:I,os:r(),osVersion:o(),deviceType:i(),network:a(),screenDirection:u(),unloadTime:w-y,redirectTime:x-b,dnsTime:S-E,tcpTime:A-T,sslTime:c(A,O),responseTime:C-P,downloadTime:M-C,firstPaintTime:z,firstContentfulPaintTime:q,domReadyTime:k-U,onloadTime:N-U,whiteTime:C-U,renderTime:_-U,decodedBodySize:B,encodedBodySize:L};Object.keys(t).forEach((function(e){g(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))})),g(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);var n={};e||Object.keys(t).forEach((function(e){n[s(e)]=t[e]})),Object.keys(n).length?d(n):d(t)}function r(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Linux")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others"}function o(){var e="",t=navigator.userAgent,n=t.indexOf("Android")>-1||t.indexOf("Linux")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;var i=o[1];return i?(n&&(e=(i.match(/\d+\.\d+/g)||[])[0]),r&&(e=(i.match(/(\d+)_(\d+)_?(\d+)?/)||[])[0]),e||(e=""),e):e}function i(){var e,t=navigator.userAgent.toLowerCase(),n=t.match(/(ipad)/i)&&"ipad",r=t.match(/iphone os/i)&&"iphone os",o=t.match(/midp/i)&&"midp",i=t.match(/rv:1.2.3.4/i)&&"rv:1.2.3.4",a=t.match(/ucweb/i)&&"ucweb",s=t.match(/android/i)&&"android",u=t.match(/windows ce/i)&&"windows ce",c=t.match(/windows mobile/i)&&"windows mobile";return(e=n||r||o||i||a||s||u||c?r||o||i||a||s||u||c?"phone":n?"ipad":void 0:"pc")||(e=""),e}function a(){var e="",t=window.navigator;if(t.connection&&t.connection.effectiveType)switch(t.connection.effectiveType){case"wifi":e="wifi";break;case"4g":e="4g";break;case"2g":e="2g";break;case"3g":e="3g";break;case"ethernet":e="ethernet";break;case"default":e=void 0}return e||(e=""),e}function u(){var e="";return window.screen&&window.screen.orientation&&window.screen.orientation.angle&&(180!==window.screen.orientation.angle&&0!==window.screen.orientation.angle||(e="|"),90!==window.screen.orientation.angle&&-90!==window.screen.orientation.angle||(e="-")),e}function c(e,t){var n=0;return t&&(n=e-t),n}var f,d,l,p,v,m,w,y,x,b,S,E,A,T,O,C,P,M,k,N,_,j,R,B,L,F,I,U,D,z,q;return n(this,(function(e){switch(e.label){case 0:if(!V("navigation"))return[2,Promise.reject(new Error("navigation is not supported"))];if(!(f=window.performance)||"function"!=typeof f.getEntries||"function"!=typeof f.getEntriesByType)return[2,Promise.reject(new Error("performance is not supported"))];if(l=new Promise((function(e){d=[e][0]})),p=null,h(v=f.getEntriesByType("navigation"))&&(p=v[0]),m=new Array(19).fill(0),w=m[0],y=m[1],x=m[2],b=m[3],S=m[4],E=m[5],A=m[6],T=m[7],O=m[8],C=m[9],P=m[10],M=m[11],k=m[12],N=m[13],_=m[14],j=m[15],R=m[16],B=m[17],L=m[18],F=f.timing,I="",p)I="PerformanceNavigationTiming",B=p.decodedBodySize,L=p.encodedBodySize,w=p.unloadEventEnd,y=p.unloadEventStart,x=p.redirectEnd,b=p.redirectStart,S=p.domainLookupEnd,E=p.domainLookupStart,A=p.connectEnd,T=p.connectStart,O=p.secureConnectionStart,C=p.responseStart,P=p.requestStart,M=p.responseEnd,k=p.domContentLoadedEventStart,N=p.loadEventStart,_=p.loadEventEnd,j=p.startTime,R=p.fetchStart;else{if(!F)return[2,Promise.reject(new Error("NavigationTiming and Timing are not supported"))];I="PerformanceTiming",w=F.unloadEventEnd,y=F.unloadEventStart,x=F.redirectEnd,b=F.redirectStart,S=F.domainLookupEnd,E=F.domainLookupStart,A=F.connectEnd,T=F.connectStart,O=F.secureConnectionStart,C=F.responseStart,P=F.requestStart,M=F.responseEnd,k=F.domContentLoadedEventStart,N=F.loadEventStart,_=F.loadEventEnd,j=F.navigationStart,R=F.fetchStart}if(U=0,g(j))U=j;else{if(!g(R))return[2,Promise.reject(new Error("startTime, navigationStart or fetchStart are required"))];U=R}return[4,Promise.all([$(),W()])];case 1:return D=e.sent(),z=D[0],q=D[1],g(_)&&_>0?t():window.addEventListener("load",(function(){window.setTimeout((function(){t()}),0)})),[2,l]}}))}))},exports.getQueryParam=function(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),n=location.search.substring(1).match(t);return null!==n?decodeURIComponent(n[2]):""},exports.getScriptQueryParam=function(e,t){void 0===t&&(t=""),t||(t=".js");for(var n=new RegExp("[?&]".concat(e,"=([^&]*)")),r=document.querySelectorAll('script[src*="'.concat(t,'"]')),o=0;o<r.length;o++){var i=r[o].getAttribute("src");if(i&&-1!==i.indexOf(t)){var a=i.match(n);if(a)return decodeURIComponent(a[1])}}return""},exports.getSessionStorage=function(e){var t=null;if(e){var n=sessionStorage.getItem(e);n&&(t=JSON.parse(n))}return t},exports.getTTFB=function(){return t(this,void 0,void 0,(function(){var e,t;return n(this,(function(n){return V("navigation")&&window.performance&&window.performance.getEntriesByType?(e=performance.getEntriesByType("navigation")[0],0,e?(t=e.responseStart-e.requestStart,[2,Math.round(t)]):[2,0]):[2,0]}))}))},exports.getUrlFileType=function(e){var t="";if("string"!=typeof e||""==e)return t;var n=/\.[^/?#]+$/.exec(e);return n?(n[0].length>1&&(t=n[0].substring(1)),t):t},exports.getUrlHost=function(e){var t="";return!k(e)&&k(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),_(e)&&(t=new URL(e).host),t},exports.getUrlParam=function(e,t,n){void 0===n&&(n={});var r=null;if(e.includes("#")){r=new URL(e).searchParams.getAll(t)}else{var o={};e.replace(/\??(\w+)=([^&]*)&?/g,(function(e,t,n){return void 0!==o[t]?o[t].push(n):o[t]=[n],""})),r=o[t]||[]}return n.returnArray?r:r.length?r[0]:null},exports.getUrlPath=function(e){var t="";return!k(e)&&k(e,{strict:!1})&&0===e.indexOf("//")&&(e="https:"+e),_(e)&&(t=new URL(e).pathname),t},exports.hasClass=function(e,t){if(!e)return B.error("The element is not exist."),!1;for(var n=e.className.split(/\s+/),r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},exports.inRate=function(e){return M(e)},exports.invokeEvent=function(e){D(e)},exports.invokeFn=v,exports.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},exports.isBool=y,exports.isBoolean=function(e){return y(e)},exports.isBrowser=function(){if(O)return"browser"===O;var e="undefined"!=typeof window;return e&&(O="browser"),e},exports.isFunction=function(e){return"function"==typeof e},exports.isHit=M,exports.isJSONString=u,exports.isJsonString=function(e){return u(e)},exports.isNonEmptyArray=h,exports.isNonEmptyObject=function(e){return!!w(e)&&0!==Object.keys(e).length},exports.isNumber=g,exports.isPureObject=w,exports.isSafePWAEnv=function(){if(J)return"pwa"===J;var e=Q();return"serviceWorker"in navigator&&function(){var e;try{return e=new Function("return async function(){};")(),null!=Object.getPrototypeOf(e).constructor}catch(e){return!1}}()&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")&&Boolean(window.fetch)&&Boolean(window.indexedDB)&&Boolean(window.caches)&&!e.shell?(J="pwa",!0):(J="no-pwa",!1)},exports.isString=function(e){return"string"==typeof e},exports.isSupportWebp=function(){return Y?Promise.resolve("webp"===Y):new Promise((function(e){var t=new Image;t.onload=function(){var n=t.width>0&&t.height>0;Y=n?"webp":"no-webp",e(n)},t.onerror=function(){Y="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="}))},exports.isSupportedEntryType=V,exports.isUdfOrNul=function(e){return null==e},exports.isValidData=function(e,t,n){var r=!1;return"object"!=typeof e||t.reduce((function(e,t){return void 0===e[t]?Object.create(null):e=e[t]}),e)===n&&(r=!0),r},exports.isValidEmail=function(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},exports.isValidHttpUrl=k,exports.isValidPhoneNumber=function(e){return/^1\d{10}$/.test(e)},exports.isValidUrl=function(e){return/^[a-zA-Z0-9]+:\/\/[-a-zA-Z0-9@:%._+~#=]{1,256}\b([-a-zA-Z0-9\u4E00-\u9FA5\u3002\uff1b\uff0c\uff1a\u201c\u201d\uff08\uff09\u3001\uff1f\u300a\u300b()!@:%_+.~#?&//=]*)$/.test(e)},exports.loadCSS=function(e,t){void 0===t&&(t={id:""});var n,r=t.id,o=function(){},i=new Promise((function(e,t){var r;n=(r=[e,t])[0],o=r[1]})),a=function(){n("loaded")},s=document.createElement("link");s||o(new Error("Not support create link element"));var u="onload"in s,c=+navigator.userAgent.replace(/.*(?:AppleWebKit|AndroidWebKit)\/?(\d+).*/i,"$1")<536;if(s.rel="stylesheet",s.type="text/css",s.href=e,void 0!==r&&(s.id=r),document.getElementsByTagName("head")[0].appendChild(s),c||!u)return setTimeout((function(){d(s,a,0)}),1),i;function f(){s&&(s.onload=s.onerror=s.onreadystatechange=null),s=null,a()}function d(e,t,n){if(e){var r,o=e.sheet;if((n+=1)>3e5)return r=!0,e&&(e=null),void t();if(c)o&&(r=!0);else if(o)try{o.cssRules&&(r=!0)}catch(e){var i=e;if(!i.name)return;"NS_ERROR_DOM_SECURITY_ERR"===i.name&&(r=!0)}setTimeout((function(){r?t():d(e,t,n)}),20)}}return u?(s.onload=f,s.onerror=function(){f()}):s.onreadystatechange=function(){s&&/loaded|complete/.test(s.readyState)&&f()},i},exports.loadImage=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))},exports.loadScript=Z,exports.loadScriptIfUndefined=function(e,t){return window[e]?Promise.resolve("defined"):Z(t)},exports.longestComSubsequence=P,exports.longestComSubstring=C,exports.mNow=l,exports.mTrim=function(e){for(var t=(e=e.replace(/^\s+/,"")).length-1,n=/\s/;n.test(e.charAt(t));)t--;return e.slice(0,t+1)},exports.mazeyCon=B,exports.newLine=function(e){return x(e)},exports.removeClass=function(e,t){var n;e?(n=(n=(n=(n=" "+e.className+" ").replace(/(\s+)/gi," ")).replace(" "+t+" "," ")).replace(/(^\s+)|(\s+$)/g,""),e.className=n):B.error("The element is not exist.")},exports.removeCookie=q,exports.removeEvent=function(e,t){var n=U(),r=n[e];if("string"==typeof e&&r instanceof Array)if("function"==typeof t){for(var o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]},exports.removeHTML=b,exports.removeHtml=function(e,t){return void 0===t&&(t={}),b(e,t)},exports.repeatUntilConditionMet=function(e,r,o){var i=this;void 0===r&&(r={}),void 0===o&&(o=function(e){return!0===e});var a=r.interval,s=void 0===a?1e3:a,u=r.times,c=void 0===u?10:u,f=r.context,d=r.args,l=0,p=function(){setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,e.apply(f,d)];case 1:return t=n.sent(),o(t)||++l>=c?[2]:(p(),[2])}}))}))}),s)};"function"!=typeof e&&console.error("Expected a function."),("number"!=typeof s||s<0)&&console.error("Expected a non-negative number for interval."),("number"!=typeof c||c<0)&&console.error("Expected a non-negative number for times."),p()},exports.replaceHttp=function(e){return N(e)},exports.sanitizeInput=function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,(function(e){return t[e]}))},exports.setClass=function(e,t){F(e,t)},exports.setCookie=function(e,t,n,r){var o,i;if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),i="; expires="+a.toUTCString()}else i="";var s=location.host;1===s.split(".").length?document.cookie=e+"="+t+i+"; path=/":((o=s.split(".")).shift(),r=r||"."+o.join("."),document.cookie=e+"="+t+i+"; path=/; domain="+r,null!==z(e)&&z(e)===t||(r=r||"."+s,document.cookie=e+"="+t+i+"; path=/; domain="+r))},exports.setImgSizeBySrc=I,exports.setImgWidHeiBySrc=function(){return I()},exports.setLocalStorage=function(e,t){void 0===t&&(t=null),e&&localStorage.setItem(e,JSON.stringify(t))},exports.setSessionStorage=function(e,t){void 0===t&&(t=null),e&&sessionStorage.setItem(e,JSON.stringify(t))},exports.sleep=function(e){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,T(e)]}))}))},exports.throttle=function(e,t,n){void 0===n&&(n={}),n=Object.assign({},n);var r=null,o=null,i=null,a=[null,0],s=a[0],u=a[1],c=function(){u=!1===n.leading?0:l(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(){for(var a=[],f=0;f<arguments.length;f++)a[f]=arguments[f];var d=l();u||!1!==n.leading||(u=d);var p=t-(d-u);return r=this,o=a,p<=0||p>t?(i&&(clearTimeout(i),i=null),u=d,s=e.apply(r,o),i||(r=o=null)):i||!1===n.trailing||(i=setTimeout(c.bind(r),p)),s}},exports.timeCon=L,exports.truncateZHString=A,exports.unsanitize=function(e){return S(e)},exports.unsanitizeInput=S,exports.updateQueryParam=function(e,t,n){if(e.includes("#")){var r=new URL(e);return r.searchParams.set(t,n),r.toString()}var o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),i=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+n+"$2"):e+i+t+"="+n},exports.waitTime=T,exports.windowLoaded=function(e){void 0===e&&(e=3e4);var t,n=function(){},r=new Promise((function(e,r){n=e,t=r}));return"complete"===document.readyState?n("complete"):window.addEventListener("load",(function(){return n("load")})),setTimeout((function(){return t(Error("timeout"))}),e),r},exports.zAxiosIsValidRes=function(e,t){void 0===t&&(t={validStatusRange:[200,300],validCode:[0]});var n=Object.assign({validStatusRange:[200,300],validCode:[0]},t),r=n.validStatusRange,o=n.validCode;2!==r.length&&console.error("valid validStatusRange is required");var i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){var a=e.data;a&&o.includes(a.code)&&(i=!0)}return i};