mazey 5.9.2 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -277,9 +277,9 @@ declare function calLongestCommonSubsequence(aStr: string, bStr: string): number
277
277
  * Usage:
278
278
  *
279
279
  * ```javascript
280
- * import { isHit } from "mazey";
280
+ * import { randomBoolean } from "mazey";
281
281
  *
282
- * const ret = isHit(0.5); // A 50% chance of returning true.
282
+ * const ret = randomBoolean(0.5); // A 50% chance of returning true.
283
283
  * console.log(ret);
284
284
  * ```
285
285
  *
@@ -295,7 +295,7 @@ declare function calLongestCommonSubsequence(aStr: string, bStr: string): number
295
295
  * let trueCount = 0;
296
296
  * let falseCount = 0;
297
297
  * new Array(1000000).fill(0).forEach(() => {
298
- * if (isHit(0.5)) {
298
+ * if (randomBoolean(0.5)) {
299
299
  * trueCount++;
300
300
  * } else {
301
301
  * falseCount++;
@@ -314,9 +314,18 @@ declare function calLongestCommonSubsequence(aStr: string, bStr: string): number
314
314
  * @returns {boolean} Whether the random value is less than the probability.
315
315
  * @category Calculate and Formula
316
316
  */
317
+ declare function randomBoolean(rate: number): boolean;
318
+ /**
319
+ * Deprecated alias of {@link randomBoolean}.
320
+ *
321
+ * @deprecated Use `randomBoolean` instead.
322
+ * @param rate Probability expressed as a value from 0 to 1.
323
+ * @returns Whether the random value is less than the probability.
324
+ * @category Calculate and Formula
325
+ */
317
326
  declare function isHit(rate: number): boolean;
318
327
  /**
319
- * Alias of `isHit`.
328
+ * Compatibility alias of {@link randomBoolean}.
320
329
  *
321
330
  * @hidden
322
331
  */
@@ -535,14 +544,14 @@ declare function formatLocalDateTime(date: Date, options?: {
535
544
  */
536
545
  declare function subYears(date: Date | number, amount: number): Date;
537
546
  /**
538
- * Get the current timestamp in milliseconds.
547
+ * Return the current timestamp in milliseconds.
548
+ *
549
+ * This compatibility helper delegates to native `Date.now()`.
539
550
  *
540
551
  * Usage:
541
552
  *
542
553
  * ```javascript
543
- * import { mNow } from "mazey";
544
- *
545
- * const ret = mNow();
554
+ * const ret = Date.now();
546
555
  * console.log(ret);
547
556
  * ```
548
557
  *
@@ -553,6 +562,7 @@ declare function subYears(date: Date | number, amount: number): Date;
553
562
  * ```
554
563
  *
555
564
  * @returns {number} The current timestamp in milliseconds.
565
+ * @deprecated Use `Date.now()` instead.
556
566
  * @category Util
557
567
  */
558
568
  declare function mNow(): number;
@@ -1560,16 +1570,16 @@ declare function isBool(bool: MazeyObject): boolean;
1560
1570
  */
1561
1571
  declare function isBoolean(bool: MazeyObject): boolean;
1562
1572
  /**
1563
- * Verify the validity of a value.
1573
+ * Return whether a value is exactly `undefined` or `null`.
1564
1574
  *
1565
1575
  * Usage:
1566
1576
  *
1567
1577
  * ```javascript
1568
- * import { isUdfOrNul } from "mazey";
1578
+ * import { isNullish } from "mazey";
1569
1579
  *
1570
- * const ret1 = isUdfOrNul(undefined);
1571
- * const ret2 = isUdfOrNul(null);
1572
- * const ret3 = isUdfOrNul("abc");
1580
+ * const ret1 = isNullish(undefined);
1581
+ * const ret2 = isNullish(null);
1582
+ * const ret3 = isNullish("abc");
1573
1583
  * console.log(ret1, ret2, ret3);
1574
1584
  * ```
1575
1585
  *
@@ -1579,8 +1589,20 @@ declare function isBoolean(bool: MazeyObject): boolean;
1579
1589
  * true true false
1580
1590
  * ```
1581
1591
  *
1592
+ * Other falsy values, including `false`, `0`, `NaN`, and an empty string,
1593
+ * return `false`.
1594
+ *
1582
1595
  * @param {MazeyObject} val The value to verify.
1583
- * @returns {boolean} Return TRUE if the object is undefined or null.
1596
+ * @returns {boolean} Whether the value is `undefined` or `null`.
1597
+ * @category Util
1598
+ */
1599
+ declare function isNullish(val: MazeyObject): boolean;
1600
+ /**
1601
+ * Deprecated alias of {@link isNullish}.
1602
+ *
1603
+ * @deprecated Use `isNullish` instead.
1604
+ * @param val The value to verify.
1605
+ * @returns Whether the value is `undefined` or `null`.
1584
1606
  * @category Util
1585
1607
  */
1586
1608
  declare function isUdfOrNul(val: MazeyObject): boolean;
@@ -2961,12 +2983,12 @@ interface ResolveElementTargetOptions {
2961
2983
  type DomVisibilityTarget = string | Element | Iterable<Element> | ArrayLike<Element> | null | undefined;
2962
2984
  /**
2963
2985
  * Hide every resolved element while preserving its visible inline `display`
2964
- * value for a later call to {@link show}.
2986
+ * value for a later call to {@link showElements}.
2965
2987
  *
2966
2988
  * ```javascript
2967
- * import { hide } from "mazey";
2989
+ * import { hideElements } from "mazey";
2968
2990
  *
2969
- * hide(".notice");
2991
+ * hideElements(".notice");
2970
2992
  * ```
2971
2993
  *
2972
2994
  * @remarks Selectors use the global document. Direct elements and collections
@@ -2976,17 +2998,17 @@ type DomVisibilityTarget = string | Element | Iterable<Element> | ArrayLike<Elem
2976
2998
  * @returns The original target unchanged, to support chaining by the caller.
2977
2999
  * @category DOM
2978
3000
  */
2979
- declare function hide<T extends DomVisibilityTarget>(target: T): T;
3001
+ declare function hideElements<T extends DomVisibilityTarget>(target: T): T;
2980
3002
  /**
2981
3003
  * Show every resolved element by restoring a display value preserved by
2982
- * {@link hide}, or by applying the document-aware default for CSS-hidden
3004
+ * {@link hideElements}, or by applying the document-aware default for CSS-hidden
2983
3005
  * elements.
2984
3006
  *
2985
3007
  * ```javascript
2986
- * import { show } from "mazey";
3008
+ * import { showElements } from "mazey";
2987
3009
  *
2988
3010
  * const notices = document.querySelectorAll(".notice");
2989
- * show(notices);
3011
+ * showElements(notices);
2990
3012
  * ```
2991
3013
  *
2992
3014
  * @remarks Selectors use the global document. Direct elements and collections
@@ -2996,6 +3018,24 @@ declare function hide<T extends DomVisibilityTarget>(target: T): T;
2996
3018
  * @returns The original target unchanged, to support chaining by the caller.
2997
3019
  * @category DOM
2998
3020
  */
3021
+ declare function showElements<T extends DomVisibilityTarget>(target: T): T;
3022
+ /**
3023
+ * Deprecated alias of {@link hideElements}.
3024
+ *
3025
+ * @deprecated Use `hideElements` instead.
3026
+ * @param target Selector, element, iterable, array-like collection, or an empty target.
3027
+ * @returns The original target unchanged.
3028
+ * @category DOM
3029
+ */
3030
+ declare function hide<T extends DomVisibilityTarget>(target: T): T;
3031
+ /**
3032
+ * Deprecated alias of {@link showElements}.
3033
+ *
3034
+ * @deprecated Use `showElements` instead.
3035
+ * @param target Selector, element, iterable, array-like collection, or an empty target.
3036
+ * @returns The original target unchanged.
3037
+ * @category DOM
3038
+ */
2999
3039
  declare function show<T extends DomVisibilityTarget>(target: T): T;
3000
3040
  /**
3001
3041
  * Resolve an element from a direct element, a selector, an optionally
@@ -4615,5 +4655,5 @@ declare const mazeyCon: Console;
4615
4655
  */
4616
4656
  declare const timeCon: Console;
4617
4657
 
4618
- export { addClass, addEvent, addStyle, assignDefined, calLongestCommonSubsequence, calLongestCommonSubstring, calculateAspectRatio, calculateCAGR, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHTML, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, convertHttpToHttps, convertKebabToCamel, convertObjectToQuery, convertToHtmlBreaks, convertUnderToCamel, cutCHSString, cutZHString, debounce, deepCopy, deepCopyObject, deepFreeze, delCookie, derivePackageMetadata, detectVisitorType, doFn, escapeHtmlAttribute, extractElementText, fireEvent, floatFixed, floatToPercent, formatByteSize, formatDate, formatDistanceToNow, formatDurationFromMs, formatLocalDateTime, genBrowserAttrs, genCustomConsole, genHashCode, genRndNumString, genStyleString, genUniqueNumString, generateCalendarVersion, generateRndNum, generateUniqueNum, getAllQueryParams, getBrowserInfo, getCLS, getCookie, getCurrentVersion, getDateDifference, getDefineListeners, getDomain, getFCP, getFID, getFP, getFileSize, getFriendlyInterval, getHashQueryParam, getLCP, getLocalJSON, getLocalStorage, getPageMeta, getPerformance, getQueryParam, getScriptQueryParam, getSessionJSON, getSessionStorage, getSystemTheme, getTTFB, getUrlFileType, getUrlHost, getUrlParam, getUrlPath, hasClass, hide, inRate, injectStyle, invokeEvent, invokeFn, isAndroid, isArray, isBool, isBoolean, isBrowser, isDesktop, isFunction, isHit, isIOS, isJSONString, isJsonString, isLinux, isMacOS, isMobile, isNonEmptyArray, isNonEmptyObject, isNumber, isPhone, isPureObject, isSafePWAEnv, isStandalonePWA, isString, isSupportWebp, isSupportedEntryType, isTablet, isThisHour, isThisMonth, isThisWeek, isThisYear, isToday, isUdfOrNul, isValidCssSelector, isValidData, isValidDate, isValidEmail, isValidHttpUrl, isValidPhoneNumber, isValidUrl, isWindows, listenMediaQueryChanges, loadCSS, loadImage, loadScript, loadScriptIfUndefined, longestComSubsequence, longestComSubstring, mNow, mTrim, mazeyCon, newLine, onEvent, onURLChange, parseGitHubRepository, parseJsonSafe, parseLocalDateTime, removeClass, removeCookie, removeEvent, removeHTML, removeHtml, repeatUntilConditionMet, replaceHttp, resolveElementTarget, resolveLanguagePreference, resolveThemePreference, sanitizeInput, setClass, setCookie, setImgSizeBySrc, setImgWidHeiBySrc, setLanguagePreference, setLocalJSON, setLocalStorage, setSessionJSON, setSessionStorage, setThemePreference, sha256Hex, show, sleep, subYears, throttle, timeCon, toJavaScriptGlobalName, truncateZHString, unsanitize, unsanitizeInput, updateQueryParam, waitTime, watchServiceWorkerUpdates, windowLoaded, zAxiosIsValidRes };
4658
+ export { addClass, addEvent, addStyle, assignDefined, calLongestCommonSubsequence, calLongestCommonSubstring, calculateAspectRatio, calculateCAGR, camelCase2Underscore, camelCaseToKebabCase, cancelBubble, clearHTML, clearHtml, convert10To26, convertCamelToKebab, convertCamelToUnder, convertHttpToHttps, convertKebabToCamel, convertObjectToQuery, convertToHtmlBreaks, convertUnderToCamel, cutCHSString, cutZHString, debounce, deepCopy, deepCopyObject, deepFreeze, delCookie, derivePackageMetadata, detectVisitorType, doFn, escapeHtmlAttribute, extractElementText, fireEvent, floatFixed, floatToPercent, formatByteSize, formatDate, formatDistanceToNow, formatDurationFromMs, formatLocalDateTime, genBrowserAttrs, genCustomConsole, genHashCode, genRndNumString, genStyleString, genUniqueNumString, generateCalendarVersion, generateRndNum, generateUniqueNum, getAllQueryParams, getBrowserInfo, getCLS, getCookie, getCurrentVersion, getDateDifference, getDefineListeners, getDomain, getFCP, getFID, getFP, getFileSize, getFriendlyInterval, getHashQueryParam, getLCP, getLocalJSON, getLocalStorage, getPageMeta, getPerformance, getQueryParam, getScriptQueryParam, getSessionJSON, getSessionStorage, getSystemTheme, getTTFB, getUrlFileType, getUrlHost, getUrlParam, getUrlPath, hasClass, hide, hideElements, inRate, injectStyle, invokeEvent, invokeFn, isAndroid, isArray, isBool, isBoolean, isBrowser, isDesktop, isFunction, isHit, isIOS, isJSONString, isJsonString, isLinux, isMacOS, isMobile, isNonEmptyArray, isNonEmptyObject, isNullish, isNumber, isPhone, isPureObject, isSafePWAEnv, isStandalonePWA, isString, isSupportWebp, isSupportedEntryType, isTablet, isThisHour, isThisMonth, isThisWeek, isThisYear, isToday, isUdfOrNul, isValidCssSelector, isValidData, isValidDate, isValidEmail, isValidHttpUrl, isValidPhoneNumber, isValidUrl, isWindows, listenMediaQueryChanges, loadCSS, loadImage, loadScript, loadScriptIfUndefined, longestComSubsequence, longestComSubstring, mNow, mTrim, mazeyCon, newLine, onEvent, onURLChange, parseGitHubRepository, parseJsonSafe, parseLocalDateTime, randomBoolean, removeClass, removeCookie, removeEvent, removeHTML, removeHtml, repeatUntilConditionMet, replaceHttp, resolveElementTarget, resolveLanguagePreference, resolveThemePreference, sanitizeInput, setClass, setCookie, setImgSizeBySrc, setImgWidHeiBySrc, setLanguagePreference, setLocalJSON, setLocalStorage, setSessionJSON, setSessionStorage, setThemePreference, sha256Hex, show, showElements, sleep, subYears, throttle, timeCon, toJavaScriptGlobalName, truncateZHString, unsanitize, unsanitizeInput, updateQueryParam, waitTime, watchServiceWorkerUpdates, windowLoaded, zAxiosIsValidRes };
4619
4659
  export type { DerivePackageMetadataOptions, DerivedPackageMetadata, DomVisibilityTarget, FormatByteSizeOptions, GitHubRepositoryDetails, InvestmentReturnRate, IsNumberOptions, IsSafePWAEnvOptions, IsStandalonePWAOptions, LocalDateTimePrecision, PWAEnvironment, PackageManager, PackageManifest, PackageManifestAuthor, PreferenceResult, ResolveElementTargetOptions, ResolvedTheme, ServiceWorkerUpdateCallbacks, ServiceWorkerUpdateWatcher, ThemePreference, VisitorType };
package/lib/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Mazey v5.9.2 https://github.com/chengchuu/mazey
2
+ * Mazey v5.10.0 https://github.com/chengchuu/mazey
3
3
  * (c) 2018-2026 Cheng
4
4
  * Released under the MIT License.
5
5
  */
6
- function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,u=!1){const c=new Date(0);return u?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const u=new Date(0);return u.setFullYear(e,t-1,n),u.setHours(r,o,i,s),u}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const u=t.exec(s);if(u){const[e,t,n,i="0",s="0",c="0"]=u.slice(1),[a,l,f,d,p,m]=[e,t,n,i,s,c].map(Number);return r(a,l,f,d,p,m)?o(a,l,f,d,p,m):null}const c=n.exec(s);if(!c)return null;const[a,l,f,d,p,m="0",g="",h]=c.slice(1),y=Number(`${g}00`.slice(0,3));if(!r(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),y,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,u){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===u)return c;const a="+"===u[0]?1:-1,l=60*Number(u.slice(1,3))+Number(u.slice(4,6));return new Date(c.getTime()-a*l*60*1e3)}(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),y,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function u(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function c(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,u,c,a,l="0",f=""]=t.slice(1),d=Number(n),p=Number(i),m=Number(u),g=Number(c),h=Number(a),y=Number(l),w=Number(`${f}00`.slice(0,3));return d<1||!r(d,p,m,g,h,y,w)?null:o(d,p,m,g,h,y,w)}function a(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const c=[u(s,4),u(i.getMonth()+1,2),u(i.getDate(),2)].join("-"),a=[u(i.getHours(),2),u(i.getMinutes(),2)];"minute"!==o&&a.push(u(i.getSeconds(),2));let l=`${c}T${a.join(":")}`;return"millisecond"===o&&(l+=`.${u(i.getMilliseconds(),3)}`),l}function l(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),u=o.getDate(),c=o.getFullYear()-i,a=new Date(o.getTime());a.setFullYear(c,s+1,0);return u>=a.getDate()?a:(o.setFullYear(c,s,u),o)}function f(){return Date.now()}const d={type:"d"};function p(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function m(e=0,t=0,n=d){n=Object.assign({},d,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(p(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(p(t)).getTime());const o=Number(t)-Number(e);let i="",[s,u,c,a]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),u=Math.floor(o/1e3/60/60),c=Math.floor(o/1e3/60),a=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),u=Math.floor(o/1e3/60/60%24),c=Math.floor(o/1e3/60%60),a=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:u,unit:"hour"},{value:c,unit:"minute"},{value:a,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>h(e,t)).join(" ")||h(0,"second");break;default:i=a}return i}function g(e=0,t=0,n=d){return m(e,t,n)}function h(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function y(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?h(t/24/60/60,"day"):t>=3600?h(t/60/60,"hour"):t>=60?h(t/60,"minute"):h(t,"second")}function w(e){return null!==i(e)}function b(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function v(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()}function E(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()}function T(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()}function A(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()}function S(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function $(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?S(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?S(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?S(s/o,"day"):s<45*o?"about 1 month":s<365*o?S(s/(30*o),"month"):s<545*o?"about 1 year":S(s/(365*o),"year")}function N(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function _(e){return N(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")}function x(e,t){if(!Number.isSafeInteger(e))throw new TypeError("width must be a safe integer.");if(!Number.isSafeInteger(t))throw new TypeError("height must be a safe integer.");if(e<=0||t<=0)throw new RangeError("width and height must be greater than zero.");const n=function(e,t){for(;0!==t;){const n=e%t;e=t,t=n}return e}(e,t);return`${e/n}x${t/n}`}function O(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const u=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(u<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=s/864e5,a=Math.pow(1+u,365/c)-1;if(!Number.isFinite(a))throw new RangeError("calculated CAGR must be finite.");return a}function j(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function C(e,t){return j(e,t)}function M(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function D(e,t){return M(e,t)}function k(e){return Math.random()<e}function F(e){return k(e)}const L=Function.prototype.toString.call(Object);function R(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function z(e){return null===e||"object"!=typeof e?e:P(e,new WeakMap)}function P(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&R(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&R(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=P(t.buffer,n),o="undefined"!=typeof DataView&&R(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&R(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(P(r,n),P(t,n))}),e}if("undefined"!=typeof Set&&R(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(P(t,n))}),e}const u=Array.isArray(t),c=Object.getPrototypeOf(t),a=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===L}(r),l=!u&&!a&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!u&&!a&&!l)return n.set(r,t),t;const f=u?new Array(t.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(u&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=P(t.value,n)),Object.defineProperty(f,e,t))}),f}function U(e){return!e||"object"!=typeof e||Object.isFrozen(e)||(Object.freeze(e),Object.values(e).forEach(U)),e}function I(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e}function B(e){return z(e)}function q(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function Y(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t}function W(e){return q(e)}function Z(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function H(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function V(e){return Z(e)}function J(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function G(e){return e.trim()}function Q(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function K(e){return Q(e)}function X(e,t=null){try{return JSON.parse(e)}catch(e){return t}}function ee(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function te(e=5){return ee(e)}function ne(e=3){const[t,n]=[f(),te(e||3)];return t+n}function re(e=3){return ne(e)}function oe(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`}function ie(e,t=0){return parseFloat(String(e)).toFixed(t)}function se(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,u]=[null,0];const c=function(){u=!1===n.leading?0:f(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...a){const l=f();u||!1!==n.leading||(u=l);const d=t-(l-u);return r=this,o=a,d<=0||d>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),d)),s}}function ue(e,t,n){let r=null,o=null,i=null,s=null,u=null;const c=function(){const a=f()-i;a<t&&a>=0?o=setTimeout(c,t-a):(o=null,n||(u=e.apply(r,s),o||(r=s=null)))};return function(...a){r=this,s=a,i=f();const l=n&&!o;return o||(o=setTimeout(c,t)),l&&(u=e.apply(r,s),r=s=null),u}}function ce(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1,integer:i=!1,min:s,max:u}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&(!(!n&&isNaN(e))&&((void 0===s||"number"==typeof s&&!Number.isNaN(s))&&((void 0===u||"number"==typeof u&&!Number.isNaN(u))&&(!(void 0!==s&&void 0!==u&&s>u)&&(!(!0===i&&!Number.isInteger(e))&&((void 0===s&&void 0===u||!Number.isNaN(e))&&!(void 0!==s&&e<s||void 0!==u&&e>u))))))))}function ae(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function le(e,...t){return ae(e,...t)}function fe(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function de(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function pe(e){return"function"==typeof e}function me(e){return"string"==typeof e}function ge(e){return"boolean"==typeof e}function he(e){return ge(e)}function ye(e){return null==e}function we(e){return"[object Array]"===Object.prototype.toString.call(e)}function be(e){return!!de(e)&&0!==Object.keys(e).length}function ve(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function Ee(e){return ve(e)}function Te(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function Ae(e,t={}){return Te(e,t)}function Se(e,t={}){return Te(e,t)}function $e(e,t={}){return Te(e,t)}function Ne(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(n,"&amp;").replace(/[<>"']/g,e=>r[e])}function _e(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])}function xe(e){const 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,e=>t[e])}function Oe(e){return xe(e)}function je(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const u=e.replace(i,"**").length;for(let n=0;n<u&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&u>t&&(o+=n.dotText),o}return""}function Ce(e,t,n=!1){return je(e,t,{hasDot:n})}function Me(e,t,n=!1){return Ce(e,t,n)}function De(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i}function ke(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n}const Fe=["B","KB","MB","GB","TB"];function Le(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<Fe.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${Fe[s]}`:`${i.toFixed(r)} ${Fe[s]}`}function Re(e,t={}){return Le(e,t)}function ze(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}async function Pe(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o}function Ue(e){return/^1\d{10}$/.test(e)}const Ie=Ue;function Be(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)}function qe(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t}function Ye(){return"v4"}function We(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let u=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++u>=o||c()},r)};c()}async function Ze(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}async function He(e){return Ze(e)}let Ve="";function Je(){if(Ve)return"browser"===Ve;const e="undefined"!=typeof window;return e&&(Ve="browser"),e}function Ge(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function Qe(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function Ke(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Ge(n,"version"),description:Ge(n,"description"),license:Ge(n,"license"),author:Qe(n.author),unscopedName:o,iifeGlobal:J(o),installCommand:`${s} ${r}`}}function Xe(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function et(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([Xe(t.slice(0,n)),Xe(t.slice(n+1))]),e},[]):[]}function tt(e,t){return et(e).filter(([e])=>e===t).map(([,e])=>e)}const nt=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,rt=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function ot(){return new Error("The value does not identify one supported GitHub repository")}function it(e,t){const n=t.replace(/\.git$/i,"");if(!nt.test(e)||!rt.test(n))throw ot();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function st(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw ot();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return it(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return it(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw ot();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw ot();let s;try{s=new URL(o)}catch(e){throw ot()}const u=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(u)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw ot();const a=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!a)throw ot();return it(a[1],a[2])}function ut(e){return tt(location.search,e)[0]||""}function ct(e=""){""===e&&(e=location.search);const t={};return et(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t}function at(e,t,n={}){const r=tt(e,t);return n.returnArray?r:r.length?r[0]:null}function lt(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),u=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),a=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const d=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return Xe(-1===r?n:n.slice(0,r))===t?f||(e.push(`${a}=${l}`),f=!0):e.push(n),e},[]);return f||d.push(`${a}=${l}`),`${u}?${d.join("&")}${o}`}function ft(e){const t=location.hash.split("?");return 1===t.length?"":tt(`?${t.slice(1).join("?")}`,e)[0]||""}function dt(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}}function pt(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)}function mt(e){return void 0===e||Number(e)<=65535}function gt(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function ht(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!gt(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function yt(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return ht(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),gt(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function wt(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return ht(r[1])&&mt(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!mt(o[2]))&&yt(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&yt(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function bt(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t}function vt(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=tt(o,e)[0];if(void 0!==t)return t}}return""}function Et(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`}function Tt(e){return e.replace(/^http:/,"https:")}function At(e){return Tt(e)}function St(e){!wt(e)&&wt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}}function $t(e){!wt(e)&&wt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}}function Nt(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},u=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",u),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",u)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const a=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(a),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(a)),n&&s("load"),()=>{i.forEach(e=>e())}}const _t={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function xt(e="",t={..._t}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:u,logFn:c,errorFn:a}=Object.assign({..._t},t);let l=n;!0===r&&(Ot.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),d=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${d()} ${e}`:`${d()}`),u&&(n=n.map(e=>de(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&a(),o&&console.log(`--- ${r} - end ---`)}}),f}const Ot=xt("[Mazey]"),jt=xt("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function Ct(e,t){if(!e)return Ot.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1}function Mt(e,t){if(!e)return void Ot.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function Dt(e,t){Mt(e,t)}function kt(e,t){if(!e)return void Ot.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n}function Ft(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?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}const Lt=Ft;function Rt(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&fe(r)&&r[1]&&t.width(r[1]),o&&fe(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&fe(r)&&r[1]&&(t.style.width=r[1]),o&&fe(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function zt(){return Rt()}function Pt(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`}function Ut(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""}function It(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function Bt(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const qt=new WeakMap,Yt=new WeakMap,Wt={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},Zt=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function Ht(e){if(!Bt(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Vt(e){const t=new Set,n=e=>{const n=Ht(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=Ht(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Jt(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Gt(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=Yt.get(t);r||(r=new Map,Yt.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let u="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),a=t.body||t.documentElement;if(a&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);a.appendChild(e);try{u=Jt(e)||""}finally{a.removeChild(e)}}return u&&"none"!==u||(u=function(e){return Wt[e]?Wt[e]:Zt.has(e)?"block":"inline"}(n)),r.set(i,u),u}function Qt(e){return Vt(e).forEach(e=>{"none"!==Jt(e)&&"none"!==e.style.display&&qt.set(e,e.style.display),e.style.display="none"}),e}function Kt(e){return Vt(e).forEach(e=>{qt.has(e)?(e.style.display=qt.get(e),qt.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Jt(e)&&(e.style.display=Gt(e))}),e}function Xt(e,t){if(void 0===e)return Bt(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),Bt(n)?n:null}function en(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&It(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const u=i.innerText||i.textContent||"";return o?u.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():u}function tn(e){e.stopPropagation()}function nn(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function rn(e,t){const n=nn();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)}const on=rn;function sn(e,t){const n=nn()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function un(e,t){sn(e,t)}function cn(e,t){const n=nn(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]}function an(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function ln(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function fn(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function dn(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const pn=an,mn=ln,gn=fn,hn=dn,yn="__mazey_cookie_name_encoded__-",wn="__mazey_cookie_value_encoded__-";function bn(e){return`${wn}${encodeURIComponent(e)}`}function vn(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(yn)||0===e.indexOf(wn);return t&&!n?e:function(e){return`${yn}${encodeURIComponent(e)}`}(e)}function En(e){const t=vn(e);return t!==e?[t,e]:[e]}function Tn(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function An(e){const t=En(e),n="1"===Tn(bn(e));for(let e=0;e<t.length;e++){const r=Tn(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function Sn(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=vn(e),u=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",a=[`${s}=${i.value}${o}; path=/`,`${bn(e)}=${u}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";a.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),An(e)!==t&&l(`.${f}`)}}function $n(e){const t=En(e),n=t.concat(bn(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==Tn(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==Tn(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===Tn(e))}function Nn(e){$n(e)}function _n(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const xn={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function On(e,t={...xn}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:u,attributes:c,cssUrl:a}=Object.assign({...xn},t);if(a){const t=function(e,t){if(!t)return"";if(wt(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,a);t&&_n(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,a)=>{const l=document.createElement("script");let f=!1,d=null;const p=()=>{l.onload=null,l.onerror=null,null!==d&&(clearTimeout(d),d=null)},m=e=>{f||(f=!0,p(),a(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),u&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,p();try{le(r),t("loaded")}catch(e){a(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(d=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}function jn(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})}function Cn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})}function Mn(e,t){if(window[e])return Promise.resolve("defined");let n=Dn.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,Dn.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&Dn.delete(e)},i=On(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i}const Dn=new Map;function kn(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(fe(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Fn(){return kn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Ln(){return kn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Rn(){return kn("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0}async function zn(){return kn("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0}async function Pn(){return kn("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return ce(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0}async function Un(){if(!kn("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0}async function In(e=!1){if(!kn("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!fe(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,u,c,a,l,f,d,p,m,g,h,y,w,b,v,E,T,A,S]=new Array(19).fill(0);({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:u,redirectEnd:c,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i);let $=0;if(ce(E))$=E;else{if(!ce(T))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));$=T}const[N,_]=await Promise.all([Ln(),Fn()]);function x(){({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:u,redirectEnd:c,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:y,domContentLoadedEventStart:w,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i),ce(E)?$=E:ce(T)&&($=T);const t={source:"PerformanceNavigationTiming",os:O(),osVersion:j(),deviceType:C(),network:M(),screenDirection:D(),unloadTime:s-u,redirectTime:c-a,dnsTime:l-f,tcpTime:d-p,sslTime:k(d,m),responseTime:g-h,downloadTime:y-g,firstPaintTime:N,firstContentfulPaintTime:_,domReadyTime:w-$,onloadTime:b-$,whiteTime:g-$,renderTime:v-$,decodedBodySize:A,encodedBodySize:S};Object.keys(t).forEach(e=>{ce(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),ce(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[V(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function O(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const 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 C(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",u=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",a=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||u||c||a?r||o||i||s||u||c||a?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function M(){let e="";const 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 D(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 k(e,t){let n=0;return t&&(n=e-t),n}return ce(v)&&v>0?x():"complete"===document.readyState?window.setTimeout(x,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){x()},0)}),r}function Bn(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const qn=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),Yn=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function Wn(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function Zn(){const e=Wn();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function Hn(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Bn(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function Vn(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Bn(e,t))return"tablet";const n=Hn(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function Jn(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Vn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Zn())}function Gn(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Hn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Zn())}function Qn(e){return"mobile"===Jn(e)}function Kn(e){return"desktop"===Jn(e)}function Xn(e){return"tablet"===Jn(e)}function er(e){return"ios"===Gn(e)}function tr(e){return"android"===Gn(e)}function nr(e){return"macos"===Gn(e)}function rr(e){return"windows"===Gn(e)}function or(e){return"linux"===Gn(e)}function ir(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function sr(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=Wn();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return ir(t,qn)?"crawler":ir(t,Yn)||function(){const e=Wn();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"}function ur(e){if(void 0===e)return function(){try{return"undefined"==typeof window||"undefined"==typeof navigator?null:{window:window,navigator:navigator,document:"undefined"==typeof document?void 0:document}}catch(e){return null}}();if(null===e||"object"!=typeof e||Array.isArray(e))return null;try{const t=e.window,n=e.navigator,r=e.document;return null===t||"object"!=typeof t||null===n||"object"!=typeof n||void 0!==r&&(null===r||"object"!=typeof r)?null:{window:t,navigator:n,document:r}}catch(e){return null}}function cr(e={}){try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope,r=e.environment;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;const o=ur(r);if(!o)return!1;const{window:i,navigator:s,document:u}=o,c=s.serviceWorker;if(!0!==i.isSecureContext||null===c||"object"!=typeof c)return!1;if(void 0!==n&&!function(e,t){const n=e.trim();if(!n||/[?#]/.test(n))return!1;try{const e=new URL(t.location.href),r=new URL(n,e);if(r.origin!==e.origin||""!==r.search||""!==r.hash)return!1;if(e.pathname===r.pathname)return!0;const o=r.pathname.endsWith("/")?r.pathname:`${r.pathname}/`;return e.pathname.startsWith(o)}catch(e){return!1}}(n,i))return!1;if(!1===t)return!0;if(!u)return!1;const a=u.querySelector('link[rel~="manifest"][href]');return Boolean(a?.getAttribute("href")?.trim())}catch(e){return!1}}function ar(e={}){let t;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;t=e.environment}catch(e){return!1}const n=ur(t);if(!n)return!1;const{window:r,navigator:o}=n;try{const e=r.matchMedia;if("function"==typeof e&&e.call(r,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===o.standalone}catch(e){return!1}}function lr(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=Zn(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&fe(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=Hn(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let u="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?u="2000":r(/windows nt 5.1|windows xp/g)?u="xp":r(/windows nt 5.2|windows 2003/g)?u="2003":r(/windows nt 6.0|windows vista/g)?u="vista":r(/windows nt 6.1|windows 7/g)?u="7":r(/windows nt 6.2|windows 8/g)?u="8":r(/windows nt 6.3|windows 8.1/g)?u="8.1":r(/windows nt 10.0|windows 10/g)&&(u="10"):"macos"===i?u=o(/os x [\d._]+/g):"android"===i?u=o(/android [\d._]+/g):"ios"===i&&(u=o(/os [\d._]+/g)),e={...e,systemVs:u};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let a="",l="";r(/applewebkit/g)?(a="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(a="gecko",l="firefox"):r(/presto/g)?(a="presto",l="opera"):r(/trident|compatible|msie/g)&&(a="trident",l="iexplore"),e={...e,engine:a,supporter:l};let f="";"webkit"===a?f=o(/applewebkit\/[\d._]+/g):"gecko"===a?f=o(/gecko\/[\d._]+/g):"presto"===a?f=o(/presto\/[\d._]+/g):"trident"===a&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let d="";"chrome"===l?d=o(/chrome\/[\d._]+/g):"safari"===l?d=o(/version\/[\d._]+/g):"firefox"===l?d=o(/firefox\/[\d._]+/g):"opera"===l?d=o(/opr\/[\d._]+/g):"iexplore"===l?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(d=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:d};let p="",m="";r(/micromessenger/g)?(p="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),e={...e,shell:p,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return Ot.warn(t),e}}function fr(e="",t="-"){const n=lr(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r}let dr="";function pr(){if(dr)return Promise.resolve("webp"===dr);return new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;dr=n?"webp":"no-webp",e(n)},t.onerror=()=>{dr="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})}function mr(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}}function gr(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,u=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},a=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",a),o=e.installing,o?.addEventListener("statechange",a),a())},f=()=>{r||n.onControllerChange?.()},d=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",a)}catch(e){}if(u){try{t.removeEventListener("controllerchange",f)}catch(e){}u=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),u=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,d(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,d(),o=null,i=null)}}}function hr(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function yr(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function wr(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function br(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const vr=Object.freeze({system:"System",light:"Light",dark:"Dark"});function Er(e){return"light"===e||"dark"===e}function Tr(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function Ar(e,t){return{value:e,label:vr[t]}}function Sr(e){hr(e);const t=yr(e);if(Er(t))return Ar(t,t);const n=wr(e);if(Er(n))return Ar(n,n);const r=Tr();return"system"===n&&r||r?Ar(r,"system"):Ar("light","light")}function $r(e,t){if(hr(e),!function(e){return"system"===e||Er(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return br(e,t)}function Nr(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function _r(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:Nr(t)}return Nr(t)}function xr(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function Or(e){return{value:e,label:xr(e)}}function jr(e){hr(e);const t=_r(yr("lang"));if(t)return Or(t);const n=_r(wr(e));if(n)return Or(n);return Or(_r(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en")}function Cr(e,t){hr(e);const n=_r(t);if(!n)throw new TypeError("language must be a valid language tag.");return br(e,n)}export{Mt as addClass,on as addEvent,Lt as addStyle,I as assignDefined,D as calLongestCommonSubsequence,C as calLongestCommonSubstring,x as calculateAspectRatio,O as calculateCAGR,V as camelCase2Underscore,W as camelCaseToKebabCase,tn as cancelBubble,Se as clearHTML,$e as clearHtml,qe as convert10To26,q as convertCamelToKebab,Z as convertCamelToUnder,Tt as convertHttpToHttps,Y as convertKebabToCamel,Et as convertObjectToQuery,ve as convertToHtmlBreaks,H as convertUnderToCamel,Me as cutCHSString,je as cutZHString,ue as debounce,z as deepCopy,B as deepCopyObject,U as deepFreeze,Nn as delCookie,Ke as derivePackageMetadata,sr as detectVisitorType,le as doFn,Ne as escapeHtmlAttribute,en as extractElementText,sn as fireEvent,ie as floatFixed,oe as floatToPercent,Le as formatByteSize,N as formatDate,$ as formatDistanceToNow,y as formatDurationFromMs,a as formatLocalDateTime,fr as genBrowserAttrs,xt as genCustomConsole,ze as genHashCode,ee as genRndNumString,Pt as genStyleString,ne as genUniqueNumString,_ as generateCalendarVersion,te as generateRndNum,re as generateUniqueNum,ct as getAllQueryParams,lr as getBrowserInfo,Pn as getCLS,An as getCookie,Ye as getCurrentVersion,m as getDateDifference,nn as getDefineListeners,dt as getDomain,Fn as getFCP,zn as getFID,Ln as getFP,Re as getFileSize,g as getFriendlyInterval,ft as getHashQueryParam,Rn as getLCP,dn as getLocalJSON,hn as getLocalStorage,Ut as getPageMeta,In as getPerformance,ut as getQueryParam,vt as getScriptQueryParam,ln as getSessionJSON,mn as getSessionStorage,Tr as getSystemTheme,Un as getTTFB,bt as getUrlFileType,St as getUrlHost,at as getUrlParam,$t as getUrlPath,Ct as hasClass,Qt as hide,F as inRate,Ft as injectStyle,un as invokeEvent,ae as invokeFn,tr as isAndroid,we as isArray,ge as isBool,he as isBoolean,Je as isBrowser,Kn as isDesktop,pe as isFunction,k as isHit,er as isIOS,Q as isJSONString,K as isJsonString,or as isLinux,nr as isMacOS,Ie as isMobile,fe as isNonEmptyArray,be as isNonEmptyObject,ce as isNumber,Qn as isPhone,de as isPureObject,cr as isSafePWAEnv,ar as isStandalonePWA,me as isString,pr as isSupportWebp,kn as isSupportedEntryType,Xn as isTablet,A as isThisHour,E as isThisMonth,T as isThisWeek,v as isThisYear,b as isToday,ye as isUdfOrNul,It as isValidCssSelector,ke as isValidData,w as isValidDate,Be as isValidEmail,wt as isValidHttpUrl,Ue as isValidPhoneNumber,pt as isValidUrl,rr as isWindows,mr as listenMediaQueryChanges,_n as loadCSS,Cn as loadImage,On as loadScript,Mn as loadScriptIfUndefined,M as longestComSubsequence,j as longestComSubstring,f as mNow,G as mTrim,Ot as mazeyCon,Ee as newLine,rn as onEvent,Nt as onURLChange,st as parseGitHubRepository,X as parseJsonSafe,c as parseLocalDateTime,kt as removeClass,$n as removeCookie,cn as removeEvent,Te as removeHTML,Ae as removeHtml,We as repeatUntilConditionMet,At as replaceHttp,Xt as resolveElementTarget,jr as resolveLanguagePreference,Sr as resolveThemePreference,_e as sanitizeInput,Dt as setClass,Sn as setCookie,Rt as setImgSizeBySrc,zt as setImgWidHeiBySrc,Cr as setLanguagePreference,fn as setLocalJSON,gn as setLocalStorage,an as setSessionJSON,pn as setSessionStorage,$r as setThemePreference,Pe as sha256Hex,Kt as show,He as sleep,l as subYears,se as throttle,jt as timeCon,J as toJavaScriptGlobalName,Ce as truncateZHString,Oe as unsanitize,xe as unsanitizeInput,lt as updateQueryParam,Ze as waitTime,gr as watchServiceWorkerUpdates,jn as windowLoaded,De as zAxiosIsValidRes};
6
+ function e(e){try{return Date.prototype.getTime.call(e)}catch(e){return null}}const t=/^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2})(?::(\d{2}))?)?$/,n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})$/;function r(e,t,n,r,o,i,s=0,u=!1){const c=new Date(0);return u?(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getUTCFullYear()===e&&c.getUTCMonth()===t-1&&c.getUTCDate()===n&&c.getUTCHours()===r&&c.getUTCMinutes()===o&&c.getUTCSeconds()===i&&c.getUTCMilliseconds()===s):(c.setFullYear(e,t-1,n),c.setHours(r,o,i,s),Number.isFinite(c.getTime())&&c.getFullYear()===e&&c.getMonth()===t-1&&c.getDate()===n&&c.getHours()===r&&c.getMinutes()===o&&c.getSeconds()===i&&c.getMilliseconds()===s)}function o(e,t,n,r,o,i,s=0){const u=new Date(0);return u.setFullYear(e,t-1,n),u.setHours(r,o,i,s),u}function i(i){if("number"==typeof i){const e=new Date(i);return Number.isFinite(i)&&Number.isFinite(e.getTime())?e:null}if("object"==typeof i&&null!==i){const t=e(i);return null!==t&&Number.isFinite(t)?new Date(t):null}if("string"!=typeof i)return null;const s=i.trim();if(!s)return null;const u=t.exec(s);if(u){const[e,t,n,i="0",s="0",c="0"]=u.slice(1),[a,l,f,d,p,m]=[e,t,n,i,s,c].map(Number);return r(a,l,f,d,p,m)?o(a,l,f,d,p,m):null}const c=n.exec(s);if(!c)return null;const[a,l,f,d,p,m="0",g="",h]=c.slice(1),w=Number(`${g}00`.slice(0,3));if(!r(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),w,!0))return null;if("Z"!==h){const e=Number(h.slice(1,3)),t=Number(h.slice(4,6));if(e>23||t>59)return null}return function(e,t,n,r,o,i,s,u){const c=new Date(0);if(c.setUTCFullYear(e,t-1,n),c.setUTCHours(r,o,i,s),"Z"===u)return c;const a="+"===u[0]?1:-1,l=60*Number(u.slice(1,3))+Number(u.slice(4,6));return new Date(c.getTime()-a*l*60*1e3)}(Number(a),Number(l),Number(f),Number(d),Number(p),Number(m),w,h)}const s=/^(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/;function u(e,t){const n=String(e);return n.length>=t?n:`${"0".repeat(t-n.length)}${n}`}function c(e){if("string"!=typeof e)return null;const t=s.exec(e);if(!t)return null;const[n,i,u,c,a,l="0",f=""]=t.slice(1),d=Number(n),p=Number(i),m=Number(u),g=Number(c),h=Number(a),w=Number(l),y=Number(`${f}00`.slice(0,3));return d<1||!r(d,p,m,g,h,w,y)?null:o(d,p,m,g,h,w,y)}function a(t,n={}){const r="object"==typeof t&&null!==t?e(t):null;if(null===r)throw new TypeError("date must be a Date");if(!Number.isFinite(r))throw new RangeError("Invalid date");const o=n.precision??"minute";if("minute"!==o&&"second"!==o&&"millisecond"!==o)throw new TypeError("precision must be minute, second, or millisecond");const i=new Date(r),s=i.getFullYear();if(s<1)throw new RangeError("Date year must be greater than zero");const c=[u(s,4),u(i.getMonth()+1,2),u(i.getDate(),2)].join("-"),a=[u(i.getHours(),2),u(i.getMinutes(),2)];"minute"!==o&&a.push(u(i.getSeconds(),2));let l=`${c}T${a.join(":")}`;return"millisecond"===o&&(l+=`.${u(i.getMilliseconds(),3)}`),l}function l(t,n){const r="number"==typeof t?t:"object"==typeof t&&null!==t?e(t):null,o=new Date(r??NaN),i="number"==typeof n?n<0?Math.ceil(n):Math.floor(n):NaN;if(!Number.isFinite(o.getTime())||!Number.isFinite(i))return new Date(NaN);if(0===i)return o;const s=o.getMonth(),u=o.getDate(),c=o.getFullYear()-i,a=new Date(o.getTime());a.setFullYear(c,s+1,0);return u>=a.getDate()?a:(o.setFullYear(c,s,u),o)}function f(){return Date.now()}const d={type:"d"};function p(e){return"string"==typeof e&&/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?e.replace(" ","T"):e}function m(e=0,t=0,n=d){n=Object.assign({},d,n);const{type:r}=n;"number"==typeof e&&Number.isFinite(e)||(e=new Date(p(e)).getTime()),"number"==typeof t&&Number.isFinite(t)||(t=new Date(p(t)).getTime());const o=Number(t)-Number(e);let i="",[s,u,c,a]=new Array(4).fill(0);if(o>=0)switch(s=Math.floor(o/1e3/60/60/24),u=Math.floor(o/1e3/60/60),c=Math.floor(o/1e3/60),a=Math.floor(o/1e3),r){case"d":i=s;break;case"text":s=Math.floor(o/1e3/60/60/24),u=Math.floor(o/1e3/60/60%24),c=Math.floor(o/1e3/60%60),a=Math.floor(o/1e3%60),i=[{value:s,unit:"day"},{value:u,unit:"hour"},{value:c,unit:"minute"},{value:a,unit:"second"}].filter(({value:e})=>e>0).map(({value:e,unit:t})=>h(e,t)).join(" ")||h(0,"second");break;default:i=a}return i}function g(e=0,t=0,n=d){return m(e,t,n)}function h(e,t){const n=Math.round(10*e)/10;return`${n} ${1===n?t:`${t}s`}`}function w(e){const t=(Number.isFinite(e)?Math.max(e,0):0)/1e3;return t>=86400?h(t/24/60/60,"day"):t>=3600?h(t/60/60,"hour"):t>=60?h(t/60,"minute"):h(t,"second")}function y(e){return null!==i(e)}function b(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()}function v(e){const t=i(e);return null!==t&&t.getFullYear()===(new Date).getFullYear()}function E(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()}function T(e){const t=i(e);if(!t)return!1;const n=new Date,r=(n.getDay()+6)%7;n.setHours(0,0,0,0),n.setDate(n.getDate()-r);const o=new Date(n.getTime());o.setDate(o.getDate()+7);const s=t.getTime();return s>=n.getTime()&&s<o.getTime()}function A(e){const t=i(e);if(!t)return!1;const n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()&&t.getHours()===n.getHours()}function S(e,t){const n=Math.max(1,Math.round(e));return`about ${n} ${t}${1===n?"":"s"}`}function $(e){const t=i(e);if(!t)return"";const n=6e4,r=36e5,o=864e5,s=Math.abs(t.getTime()-Date.now());return s<3e4?"less than a minute":s<9e4?"about 1 minute":s<27e5?S(s/n,"minute"):s<54e5?"about 1 hour":s<864e5?S(s/r,"hour"):s<1512e5?"about 1 day":s<30*o?S(s/o,"day"):s<45*o?"about 1 month":s<365*o?S(s/(30*o),"month"):s<545*o?"about 1 year":S(s/(365*o),"year")}function N(e,t="yyyy-MM-dd"){void 0===e&&(e=new Date);const n=new Date(e);if(!Number.isFinite(n.getTime()))throw new RangeError("Invalid date");const 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"};let i=t||"yyyy-MM-dd";return Object.keys(o).forEach(e=>{let t=o[e];"MM"===e&&Number(t)<=9&&(t=`0${t}`),i=i.split(e).join(String(t))}),i}function _(e){return N(void 0===e?new Date:new Date(e instanceof Date?e.getTime():e),"yyyy.MMdd.HHmmss").split(".").map(e=>String(Number(e))).join(".")}function x(e,t){if(!Number.isSafeInteger(e))throw new TypeError("width must be a safe integer.");if(!Number.isSafeInteger(t))throw new TypeError("height must be a safe integer.");if(e<=0||t<=0)throw new RangeError("width and height must be greater than zero.");const n=function(e,t){for(;0!==t;){const n=e%t;e=t,t=n}return e}(e,t);return`${e/n}x${t/n}`}function O(e,t,n){const r=i(e);if(!r)throw new TypeError("startDate must be a valid date.");const o=i(t);if(!o)throw new TypeError("endDate must be a valid date.");const s=o.getTime()-r.getTime();if(s<=0)throw new RangeError("endDate must be later than startDate.");const u=function(e){if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError("totalReturnRate must be a finite number or percentage string.");return e}if("string"!=typeof e)throw new TypeError("totalReturnRate must be a finite number or percentage string.");const t=e.trim();if(!t)throw new TypeError("totalReturnRate must not be empty.");const n=t.endsWith("%")?t.slice(0,-1).trim():t;if(!n)throw new TypeError("totalReturnRate must be a valid percentage string.");const r=Number(n);if(!Number.isFinite(r))throw new TypeError("totalReturnRate must be a valid percentage string.");return r/100}(n);if(u<=-1)throw new RangeError("totalReturnRate must be greater than -1.");const c=s/864e5,a=Math.pow(1+u,365/c)-1;if(!Number.isFinite(a))throw new RangeError("calculated CAGR must be finite.");return a}function j(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));let i=0;for(let s=0;s<n;++s)for(let n=0;n<r;++n)if(e[s]===t[n]){let e=0;s>0&&n>0&&(e=o[s-1][n-1]),o[s][n]=e+1,i=Math.max(i,o[s][n])}return i}function C(e,t){return j(e,t)}function M(e,t){const n=e.length,r=t.length;if(0===n||0===r)return 0;const o=Array.from({length:n},()=>new Array(r).fill(0));for(let i=0;i<n;++i)for(let n=0;n<r;++n)if(e[i]===t[n]){let e=0;i>0&&n>0&&(e=o[i-1][n-1]),o[i][n]=e+1}else{let[e,t]=[0,0];n>0&&(e=o[i][n-1]),i>0&&(t=o[i-1][n]),o[i][n]=Math.max(e,t)}return o[n-1][r-1]}function D(e,t){return M(e,t)}function k(e){return Math.random()<e}function F(e){return k(e)}function L(e){return k(e)}const R=Function.prototype.toString.call(Object);function z(e,t,n){const r=Object.getOwnPropertyDescriptor(t,n)?.get;if(!r)return!1;try{return r.call(e),!0}catch(e){return!1}}function P(e){return null===e||"object"!=typeof e?e:U(e,new WeakMap)}function U(t,n){if(null===t||"object"!=typeof t)return t;const r=t,o=n.get(r);if(void 0!==o)return o;const i=e(r);if(null!==i){const e=new Date(i);return n.set(r,e),e}const s=function(e){const t=Object.getOwnPropertyDescriptor(RegExp.prototype,"source")?.get;if(!t)return null;try{return t.call(e)}catch(e){return null}}(r);if(null!==s){const e=t,o=new RegExp(s,function(e){return e.flags}(e));return o.lastIndex=e.lastIndex,n.set(r,o),o}if("undefined"!=typeof ArrayBuffer&&z(r,ArrayBuffer.prototype,"byteLength")){const e=ArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof SharedArrayBuffer&&z(r,SharedArrayBuffer.prototype,"byteLength")){const e=SharedArrayBuffer.prototype.slice.call(t,0);return n.set(r,e),e}if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)){const e=U(t.buffer,n),o="undefined"!=typeof DataView&&z(r,DataView.prototype,"byteLength")?new DataView(e,t.byteOffset,t.byteLength):new t.constructor(e,t.byteOffset,t.length);return n.set(r,o),o}if("undefined"!=typeof Map&&z(r,Map.prototype,"size")){const e=new Map;return n.set(r,e),Map.prototype.forEach.call(t,(t,r)=>{e.set(U(r,n),U(t,n))}),e}if("undefined"!=typeof Set&&z(r,Set.prototype,"size")){const e=new Set;return n.set(r,e),Set.prototype.forEach.call(t,t=>{e.add(U(t,n))}),e}const u=Array.isArray(t),c=Object.getPrototypeOf(t),a=function(e){const t=Object.getPrototypeOf(e);if(null===t)return!0;const n=Object.hasOwn(t,"constructor")?t.constructor:null;return"function"==typeof n&&Function.prototype.toString.call(n)===R}(r),l=!u&&!a&&function(e){const t=Object.getPrototypeOf(e),n=t?.constructor;return"function"==typeof n&&-1===Function.prototype.toString.call(n).indexOf("[native code]")}(r);if(!u&&!a&&!l)return n.set(r,t),t;const f=u?new Array(t.length):Object.create(l?Object.prototype:c);return n.set(r,f),function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}(r).forEach(e=>{if(u&&"length"===e)return;const t=Object.getOwnPropertyDescriptor(r,e);t&&("value"in t&&(t.value=U(t.value,n)),Object.defineProperty(f,e,t))}),f}function I(e){return!e||"object"!=typeof e||Object.isFrozen(e)||(Object.freeze(e),Object.values(e).forEach(I)),e}function B(e,...t){return t.forEach(t=>{void 0!==t&&Object.keys(t).forEach(n=>{const r=t[n];if(void 0!==r){const t=e;"__proto__"!==n||Object.hasOwn(e,n)?t[n]=r:Object.defineProperty(e,n,{configurable:!0,enumerable:!0,value:r,writable:!0})}})}),e}function q(e){return P(e)}function Y(e){const t=e.replace(/([A-Z])/g,"-$1").toLowerCase();return"-"===t[0]?t.substring(1):t}function W(e){const t=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());return t.endsWith("-")?t.slice(0,-1):t}function Z(e){return Y(e)}function H(e){const t=e.replace(/([A-Z])/g,"_$1").toLowerCase();return"_"===t[0]?t.substring(1):t}function V(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function J(e){return H(e)}function G(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.replace(/[^A-Za-z0-9_$]/g,"_").toUpperCase();return/^[A-Za-z_$]/.test(t)?t:`_${t}`}function Q(e){return e.trim()}function K(e){if("string"!=typeof e)return!1;try{return JSON.parse(e),!0}catch(e){}return!1}function X(e){return K(e)}function ee(e,t=null){try{return JSON.parse(e)}catch(e){return t}}function te(e=5){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e--;)t+=Math.floor(10*Math.random());return t}function ne(e=5){return te(e)}function re(e=3){const[t,n]=[Date.now(),ne(e||3)];return t+n}function oe(e=3){return re(e)}function ie(e,t=0){let n="";return n=t?(100*e).toFixed(t):String(Math.floor(100*e)),`${n}%`}function se(e,t=0){return parseFloat(String(e)).toFixed(t)}function ue(e,t,n={}){n=Object.assign({},n);let r=null,o=null,i=null,[s,u]=[null,0];const c=function(){u=!1===n.leading?0:Date.now(),i=null,s=e.apply(this,o),i||(r=o=null)};return function(...a){const l=Date.now();u||!1!==n.leading||(u=l);const f=t-(l-u);return r=this,o=a,f<=0||f>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),f)),s}}function ce(e,t,n){let r=null,o=null,i=null,s=null,u=null;const c=function(){const a=Date.now()-i;a<t&&a>=0?o=setTimeout(c,t-a):(o=null,n||(u=e.apply(r,s),o||(r=s=null)))};return function(...a){r=this,s=a,i=Date.now();const l=n&&!o;return o||(o=setTimeout(c,t)),l&&(u=e.apply(r,s),r=s=null),u}}function ae(e,t={}){const{isNaNAsNumber:n=!1,isInfinityAsNumber:r=!1,isUnFiniteAsNumber:o=!1,integer:i=!1,min:s,max:u}=t;return"number"==typeof e&&(!(!0!==r&&!0!==o&&!isFinite(e))&&(!(!n&&isNaN(e))&&((void 0===s||"number"==typeof s&&!Number.isNaN(s))&&((void 0===u||"number"==typeof u&&!Number.isNaN(u))&&(!(void 0!==s&&void 0!==u&&s>u)&&(!(!0===i&&!Number.isInteger(e))&&((void 0===s&&void 0===u||!Number.isNaN(e))&&!(void 0!==s&&e<s||void 0!==u&&e>u))))))))}function le(e,...t){let n=null;return e&&"function"==typeof e&&(n=e(...t)),n}function fe(e,...t){return le(e,...t)}function de(e){let t=!1;return Array.isArray(e)&&e.length&&(t=!0),t}function pe(e){const t=Boolean(e),n="object"==typeof e,r="[object Object]"===Object.prototype.toString.call(e);return t&&n&&r}function me(e){return"function"==typeof e}function ge(e){return"string"==typeof e}function he(e){return"boolean"==typeof e}function we(e){return he(e)}function ye(e){return null==e}function be(e){return ye(e)}function ve(e){return"[object Array]"===Object.prototype.toString.call(e)}function Ee(e){return!!pe(e)&&0!==Object.keys(e).length}function Te(e){if(!e)return"";const t=new RegExp("\\n","g");return e.replace(t,"<br />")}function Ae(e){return Te(e)}function Se(e,t={}){const{removeNewLine:n=!1}=t;let r="";return e&&(r=e.replace(/<\/?.+?>/g,""),n&&(r=r.replace(/[\r\n]/g,""))),r}function $e(e,t={}){return Se(e,t)}function Ne(e,t={}){return Se(e,t)}function _e(e,t={}){return Se(e,t)}function xe(e,t={}){if("string"!=typeof e)throw new TypeError("value must be a string.");const n=t.preserveEntities?/&(?!(?:#[0-9]+|#x[0-9a-f]+|[a-z][a-z0-9]+);)/gi:/&/g,r={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return e.replace(n,"&amp;").replace(/[<>"']/g,e=>r[e])}function Oe(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"};if("string"!=typeof e)throw new Error("Input must be a string");return e.replace(/[&<>"'/]/g,e=>t[e])}function je(e){const 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,e=>t[e])}function Ce(e){return je(e)}function Me(e,t,n={hasDot:!1,dotText:"..."}){if(n=Object.assign({hasDot:!1,dotText:"..."},n),""!=e&&e){let r=0,o="";const i=/[^\x00-\xff]/g;let s="";const u=e.replace(i,"**").length;for(let n=0;n<u&&(s=e.charAt(n).toString(),null!=s.match(i)?r+=2:r++,!(r>t));n++)o+=s;return n.hasDot&&u>t&&(o+=n.dotText),o}return""}function De(e,t,n=!1){return Me(e,t,{hasDot:n})}function ke(e,t,n=!1){return De(e,t,n)}function Fe(e,t={validStatusRange:[200,300],validCode:[0]}){const n=t||{},{validStatusRange:r=[200,300],validCode:o=[0]}=n;2!==r.length&&console.error("valid validStatusRange is required");let i=!1;if(e&&e.status&&2===r.length&&e.status>=r[0]&&e.status<r[1]){const t=e.data;t&&o.includes(t.code)&&(i=!0)}return i}function Le(e,t,n){if(null===e||"object"!=typeof e)return!1;let r=e;for(const e of t){if(null===r||"object"!=typeof r&&"function"!=typeof r||!Object.hasOwn(r,e))return!1;r=r[e]}return r===n}const Re=["B","KB","MB","GB","TB"];function ze(e,t={}){const{base:n=1024,fractionDigits:r=1,invalidValue:o=""}=t;if(!Number.isFinite(e)||e<0||1e3!==n&&1024!==n||!Number.isInteger(r)||r<0||r>20)return o;let i=e,s=0;for(;i>=n&&s<Re.length-1;)i/=n,s+=1;return 0===s?`${Number(i.toFixed(r))} ${Re[s]}`:`${i.toFixed(r)} ${Re[s]}`}function Pe(e,t={}){return ze(e,t)}function Ue(e){let t,n,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}async function Ie(e){const t="undefined"==typeof crypto?null:crypto;if(!t?.subtle||"function"!=typeof t.subtle.digest)throw new Error("Web Crypto API is not available.");let n=e;if("string"==typeof e){if("undefined"==typeof TextEncoder)throw new Error("TextEncoder is not available.");n=(new TextEncoder).encode(e)}const r=await t.subtle.digest("SHA-256",n);let o="";const i=new Uint8Array(r);for(let e=0;e<i.length;e++){const t=i[e].toString(16);o+=1===t.length?`0${t}`:t}return o}function Be(e){return/^1\d{10}$/.test(e)}const qe=Be;function Ye(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)}function We(e){if(!Number.isFinite(e)||e<=0)return"";e=Math.floor(e);let t="";for(;e>0;){let n=e%26;0===n&&(n=26),t=String.fromCharCode(n+96)+t,e=(e-n)/26}return t}function Ze(){return"v4"}function He(e,t={},n=e=>!0===e){const{interval:r=1e3,times:o=10,context:i,args:s}=t;if("function"!=typeof e)return void console.error("Expected a function.");if(!Number.isFinite(r)||r<0)return void console.error("Expected a non-negative number for interval.");if(!Number.isFinite(o)||o<0)return void console.error("Expected a non-negative number for times.");if(0===o)return;let u=0;const c=()=>{setTimeout(async()=>{const t=await e.apply(i,s);n(t)||++u>=o||c()},r)};c()}async function Ve(e){return new Promise(t=>{setTimeout(()=>{t(e)},e)})}async function Je(e){return Ve(e)}let Ge="";function Qe(){if(Ge)return"browser"===Ge;const e="undefined"!=typeof window;return e&&(Ge="browser"),e}function Ke(e,t){const n=e[t];if(void 0!==n&&"string"!=typeof n)throw new TypeError(`manifest.${t} must be a string when provided`);return n}function Xe(e){if(void 0===e)return{name:""};if("string"==typeof e)return{name:e.trim()};if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest.author must be a string or object");const t=e,n={name:""};for(const e of["name","email","url"]){const r=t[e];if(void 0!==r&&"string"!=typeof r)throw new TypeError(`manifest.author.${e} must be a string when provided`);if("string"==typeof r){const t=r.trim();("name"===e||t)&&(n[e]=t)}}return n}function et(e,t={}){if(null===e||"object"!=typeof e||Array.isArray(e))throw new TypeError("manifest must be an object");if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("options must be an object when provided");const n=e;if("string"!=typeof n.name||!n.name.trim())throw new TypeError("manifest.name must be a non-empty string");const r=n.name.trim(),o=function(e){if(/\s/.test(e))throw new TypeError("manifest.name must not contain whitespace");if(e.startsWith("@")){const t=e.split("/");if(2!==t.length||t[0].length<2||!t[1])throw new TypeError("manifest.name must be a valid scoped package name");return t[1]}if(e.includes("/"))throw new TypeError("manifest.name must be an unscoped or scoped package name");return e}(r),i=t.packageManager??"npm";if("npm"!==i&&"pnpm"!==i&&"yarn"!==i)throw new TypeError('packageManager must be "npm", "pnpm", or "yarn"');const s="npm"===i?"npm install":`${i} add`;return{name:r,version:Ke(n,"version"),description:Ke(n,"description"),license:Ke(n,"license"),author:Xe(n.author),unscopedName:o,iifeGlobal:G(o),installCommand:`${s} ${r}`}}function tt(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}}function nt(e){const t=e.indexOf("#"),n=-1===t?e:e.slice(0,t),r=n.indexOf("?"),o=/^(?:[a-z][a-z\d+.-]*:)?\/\//i.test(n)||"/"===n.charAt(0),i=-1===r?o?"":n:n.slice(r+1);return i?i.split("&").reduce((e,t)=>{if(!t||-1===t.indexOf("="))return e;const n=t.indexOf("=");return e.push([tt(t.slice(0,n)),tt(t.slice(n+1))]),e},[]):[]}function rt(e,t){return nt(e).filter(([e])=>e===t).map(([,e])=>e)}const ot=/^(?=.{1,39}$)(?!.*--)[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$/,it=/^(?=.{1,100}$)(?!\.{1,2}$)[A-Za-z0-9_.-]+$/;function st(){return new Error("The value does not identify one supported GitHub repository")}function ut(e,t){const n=t.replace(/\.git$/i,"");if(!ot.test(e)||!it.test(n))throw st();const r=`${e}/${n}`;return{owner:e,name:n,slug:r,url:`https://github.com/${r}`}}function ct(e){if("string"!=typeof e)throw new TypeError("value must be a string");const t=e.trim();if(!t||/[%\\?#]/.test(t)||function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<=31||127===n)return!0}return!1}(t))throw st();const n=t.match(/^(?:github:)?([^/:\s]+)\/([^/\s]+)$/i);if(n)return ut(n[1],n[2]);const r=t.match(/^git@([^:\s]+):([^/\s]+)\/([^/\s]+)$/);if(r&&"github.com"===r[1].toLowerCase())return ut(r[2],r[3]);const o=t.replace(/^git\+(?=(?:git|ssh|https?):\/\/)/i,""),i=o.match(/^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i);if(!i||/(^|\/)\.{1,2}(?:\/|$)/.test(o.slice(i[0].length)))throw st();if(-1!==i[1].slice(i[1].lastIndexOf("@")+1).indexOf(":"))throw st();let s;try{s=new URL(o)}catch(e){throw st()}const u=s.protocol.toLowerCase(),c=s.hostname.toLowerCase().replace(/^www\./,"");if(!["git:","ssh:","http:","https:"].includes(u)||"github.com"!==c||""!==s.username&&"git"!==s.username||""!==s.password||""!==s.search||""!==s.hash)throw st();const a=s.pathname.match(/^\/([^/]+)\/([^/]+)\/?$/);if(!a)throw st();return ut(a[1],a[2])}function at(e){return rt(location.search,e)[0]||""}function lt(e=""){""===e&&(e=location.search);const t={};return nt(e).forEach(([e,n])=>{Object.hasOwn(t,e)||Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0})}),t}function ft(e,t,n={}){const r=rt(e,t);return n.returnArray?r:r.length?r[0]:null}function dt(e,t,n){const r=e.indexOf("#"),o=-1===r?"":e.slice(r),i=-1===r?e:e.slice(0,r),s=i.indexOf("?"),u=-1===s?i:i.slice(0,s),c=-1===s?"":i.slice(s+1),a=encodeURIComponent(t),l=encodeURIComponent(n);let f=!1;const d=(c?c.split("&").filter(Boolean):[]).reduce((e,n)=>{const r=n.indexOf("=");return tt(-1===r?n:n.slice(0,r))===t?f||(e.push(`${a}=${l}`),f=!0):e.push(n),e},[]);return f||d.push(`${a}=${l}`),`${u}?${d.join("&")}${o}`}function pt(e){const t=location.hash.split("?");return 1===t.length?"":rt(`?${t.slice(1).join("?")}`,e)[0]||""}function mt(e,t=["hostname"]){try{const n=new URL(e,document.baseURI);return t.reduce((e,t)=>e+=n[t],"")}catch(n){const r=document.createElement("a");return r.href=e,t.reduce((e,t)=>e+=r[t],"")}}function gt(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)}function ht(e){return void 0===e||Number(e)<=65535}function wt(e){const t=e.split(".");return 4===t.length&&t.every(e=>/^\d{1,3}$/.test(e)&&(1===e.length||"0"!==e.charAt(0))&&Number(e)<=255)}function yt(e){const t=e.split("::");if(t.length>2)return!1;const n=2===t.length;let r=[];t.forEach(e=>{e&&(r=r.concat(e.split(":")))});let o=0;for(let e=0;e<r.length;e++){const t=r[e];if(-1!==t.indexOf(".")){if(e!==r.length-1||!wt(t))return!1;o+=2}else{if(!/^[0-9a-f]{1,4}$/i.test(t))return!1;o+=1}}return n?o<8:8===o}function bt(e){const t=e.match(/^\[([0-9a-f:.]+)\]$/i);if(t)return yt(t[1]);if("."===e.charAt(e.length-1)&&(e=e.slice(0,-1)),wt(e))return!0;const n=e.split(".");return!(n.length<2||n.some(e=>!e||!/^[a-z\d-]+$/i.test(e)||"-"===e.charAt(0)||"-"===e.charAt(e.length-1)))&&!/^\d+$/.test(n[n.length-1])}function vt(e,t={strict:!0}){if("string"!=typeof e||!e||e.trim()!==e)return!1;const n=/^https?:\/\/[^/\\]/i.test(e),r=/^\/\/[^/\\]/.test(e);if(!n&&(t.strict||!r))return!1;const o=r?`http:${e}`:e;if(!function(e){const t=e.match(/^https?:\/\/([^/?#]+)(?:[/?#][^\s<>"`]*)?$/i);if(!t||-1!==t[1].indexOf("@"))return!1;const n=t[1],r=n.match(/^\[([0-9a-f:.]+)\](?::(\d*))?$/i);if(r)return yt(r[1])&&ht(r[2]);const o=n.match(/^([^:]+)(?::(\d*))?$/);return!(!o||!ht(o[2]))&&bt(o[1])}(o))return!1;try{const e=new URL(o);return("http:"===e.protocol||"https:"===e.protocol)&&bt(e.hostname)&&!e.username&&!e.password}catch(e){return!1}}function Et(e){let t="";if("string"!=typeof e||""==e)return t;const n=e.split(/[?#]/,1)[0],r=/\.[^/]+$/.exec(n);return r?(r[0].length>1&&(t=r[0].substring(1)),t):t}function Tt(e,t=""){t||(t=".js");const n=document.querySelectorAll("script[src]");for(let r=0;r<n.length;r++){const o=n[r].getAttribute("src");if(o&&-1!==o.indexOf(t)){const t=rt(o,e)[0];if(void 0!==t)return t}}return""}function At(e){return e&&0===Object.keys(e).length?"":`?${Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}`}function St(e){return e.replace(/^http:/,"https:")}function $t(e){return St(e)}function Nt(e){!vt(e)&&vt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).host}catch(e){return""}}function _t(e){!vt(e)&&vt(e,{strict:!1})&&e.startsWith("//")&&(e="https:"+e);try{return new URL(e).pathname}catch(e){return""}}function xt(e,t={}){const{fireOnInit:n=!0}=t,r=history;let o=location.href;const i=[],s=t=>{const n=location.href;if(n===o&&"load"!==t)return;const r=o;o=n,e({url:n,oldUrl:r,trigger:t})},u=()=>s("popstate"),c=()=>s("hashchange");window.addEventListener("popstate",u),window.addEventListener("hashchange",c),i.push(()=>window.removeEventListener("popstate",u)),i.push(()=>window.removeEventListener("hashchange",c)),r.__mazeyUrlChangePatched__||(r.__mazeyUrlChangePatched__=!0,r.__mazeyUrlChangeSubscribers__=new Set,r.__mazeyRawPushState__=history.pushState.bind(history),r.__mazeyRawReplaceState__=history.replaceState.bind(history),history.pushState=function(...e){r.__mazeyRawPushState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("pushState"))},history.replaceState=function(...e){r.__mazeyRawReplaceState__(...e),r.__mazeyUrlChangeSubscribers__.forEach(e=>e("replaceState"))});const a=e=>s(e);return r.__mazeyUrlChangeSubscribers__.add(a),i.push(()=>r.__mazeyUrlChangeSubscribers__.delete(a)),n&&s("load"),()=>{i.forEach(e=>e())}}const Ot={enabled:!0,isClosed:!1,showWrap:!1,showDate:!1,locales:"en-US",isStringifyObject:!1,logFn:()=>{},errorFn:()=>{}};function jt(e="",t={...Ot}){const{enabled:n,isClosed:r,showWrap:o,showDate:i,locales:s,isStringifyObject:u,logFn:c,errorFn:a}=Object.assign({...Ot},t);let l=n;!0===r&&(Ct.warn("The options.isClosed is deprecated. Please use options.enabled instead."),l=!1);const f=Object.create(null),d=()=>(new Date).toLocaleDateString(s,{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"});return["log","info","warn","error"].forEach(t=>{f[t]=function(...n){if(!l)return;let r=e,s=e;if("string"==typeof e&&e.length>=2){const t=e.length;r=":"===e[t-1]?e.substring(0,t-1):e}o&&console.log(`--- ${r} - begin ---`),i&&(s=e?`${d()} ${e}`:`${d()}`),u&&(n=n.map(e=>pe(e)?JSON.stringify(e):e)),e||i?console[t](s,...n):console[t](...n),"log"===t&&c(),"error"===t&&a(),o&&console.log(`--- ${r} - end ---`)}}),f}const Ct=jt("[Mazey]"),Mt=jt("",{showDate:!0,locales:"zh-CN",isStringifyObject:!0});function Dt(e,t){if(!e)return Ct.error("The element is not exist."),!1;const n=e.className.split(/\s+/);for(let e=0;e<n.length;e++)if(n[e]===t)return!0;return!1}function kt(e,t){if(!e)return void Ct.error("The element is not exist.");if(Array.isArray(t))return void t.forEach(t=>{t&&e.classList.add(t)});if(!t)return;const n=e.className,r=n.split(/\s+/);for(let e=0;e<r.length;e++)if(r[e]===t)return;let o="",i="";""!==n&&(o=" "),i=n+o+t,e.className=i}function Ft(e,t){kt(e,t)}function Lt(e,t){if(!e)return void Ct.error("The element is not exist.");let n;n=" "+e.className+" ",n=n.replace(/(\s+)/gi," "),n=n.replace(" "+t+" "," "),n=n.replace(/(^\s+)|(\s+$)/g,""),e.className=n}function Rt(e,t={id:""}){if(!e)return!1;const n=document.createDocumentFragment();let r=null,o="";const i=document.createElement("style");return t.id?(o=`${t.id}`,r=document.getElementById(o),r?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}const zt=Rt;function Pt(){const e=window.jQuery||window.$;if(e){const t=e("img");return!(!t||!t.length)&&(t.each(function(){const t=e(this);if(!t)return;const n=t.attr("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&de(r)&&r[1]&&t.width(r[1]),o&&de(o)&&o[1]&&t.height(o[1])}),!0)}{const e=document.getElementsByTagName("img");if(e.length>0)return Array.from(e).forEach(function(e){const t=e;if(!t)return;const n=t.getAttribute("src");if(!(n&&"string"==typeof n&&n.length))return;const r=n.match(/[?&]width=([0-9]+[a-z%]*)/),o=n.match(/[?&]height=([0-9]+[a-z%]*)/);r&&de(r)&&r[1]&&(t.style.width=r[1]),o&&de(o)&&o[1]&&(t.style.height=o[1])}),!0}return!1}function Ut(){return Pt()}function It(e,t){let n="";return t&&t.length>0&&(n=t.join(";")+";"),`${e}{${n}}`}function Bt(e){const t=document.getElementsByTagName("meta");for(let n=0;n<t.length;n++)if(t[n].getAttribute("name")===e)return t[n].getAttribute("content")||"";return""}function qt(e,t={}){if("string"!=typeof e)return!1;const n=e.trim();if(!n)return!0===t.allowEmpty;const r=t.root||("undefined"==typeof document?null:document);if(!r)return!1;try{return r.querySelector(n),!0}catch(e){return!1}}function Yt(e){return Boolean(e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}const Wt=new WeakMap,Zt=new WeakMap,Ht={button:"inline-block",input:"inline-block",select:"inline-block",textarea:"inline-block",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",li:"list-item",summary:"list-item"},Vt=new Set(["address","article","aside","blockquote","body","dd","details","dialog","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","main","nav","ol","p","pre","section","ul"]);function Jt(e){if(!Yt(e))return null;const t=e.style;return t&&"string"==typeof t.display?e:null}function Gt(e){const t=new Set,n=e=>{const n=Jt(e);n&&t.add(n)};if("string"==typeof e){if("undefined"==typeof document)return[];try{document.querySelectorAll(e).forEach(n)}catch(e){return[]}return Array.from(t)}const r=Jt(e);if(r)return[r];if(!e||"object"!=typeof e)return[];if("function"==typeof e[Symbol.iterator]){for(const t of e)n(t);return Array.from(t)}const o=e.length;if(!Number.isSafeInteger(o)||o<0)return[];for(let t=0;t<o;t+=1)n(e[t]);return Array.from(t)}function Qt(e){const t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e).display:null}function Kt(e){const t=e.ownerDocument,n=e.localName.toLowerCase();let r=Zt.get(t);r||(r=new Map,Zt.set(t,r));const o=e.namespaceURI||"",i=`${o}:${n}`,s=r.get(i);if(s)return s;let u="";const c="http://www.w3.org/1999/xhtml"===o&&n.includes("-"),a=t.body||t.documentElement;if(a&&!c){const e=o&&"http://www.w3.org/1999/xhtml"!==o?t.createElementNS(o,n):t.createElement(n);a.appendChild(e);try{u=Qt(e)||""}finally{a.removeChild(e)}}return u&&"none"!==u||(u=function(e){return Ht[e]?Ht[e]:Vt.has(e)?"block":"inline"}(n)),r.set(i,u),u}function Xt(e){return Gt(e).forEach(e=>{"none"!==Qt(e)&&"none"!==e.style.display&&Wt.set(e,e.style.display),e.style.display="none"}),e}function en(e){return Gt(e).forEach(e=>{Wt.has(e)?(e.style.display=Wt.get(e),Wt.delete(e)):"none"===e.style.display&&(e.style.display=""),""===e.style.display&&"none"===Qt(e)&&(e.style.display=Kt(e))}),e}function tn(e){return Xt(e)}function nn(e){return en(e)}function rn(e,t){if(void 0===e)return Yt(t.defaultElement)?t.defaultElement:null;let n=t.unwrap?t.unwrap(e):e;if(null==n)return null;if("string"==typeof n)try{return t.root.querySelector(n)}catch(e){return null}return"object"==typeof n&&"$el"in n&&(n=n.$el),Yt(n)?n:null}function on(e,t={}){const{excludeSelector:n="",replaceImagesWithAlt:r=!0,normalizeWhitespace:o=!0}=t,i=e.cloneNode(!0);r&&Array.from(i.querySelectorAll("img[alt]")).forEach(e=>{const t=e.getAttribute("alt")||"";e.parentNode?.replaceChild(i.ownerDocument.createTextNode(t),e)});const s=n.trim();s&&qt(s,{root:i})&&Array.from(i.querySelectorAll(s)).forEach(e=>e.parentNode?.removeChild(e));const u=i.innerText||i.textContent||"";return o?u.replace(/\u00a0/g," ").replace(/\s+/g," ").trim():u}function sn(e){e.stopPropagation()}function un(){const e=window.MAZEY_DEFINE_LISTENERS;if(e&&"object"==typeof e)return e;const t=Object.create(null);return window.MAZEY_DEFINE_LISTENERS=t,t}function cn(e,t){const n=un();Array.isArray(n[e])||Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:[],writable:!0}),"function"==typeof t&&n[e].push(t)}const an=cn;function ln(e,t){const n=un()[e];if(Array.isArray(n)){const e=n.slice();for(let n=0,r=e.length;n<r;n++)"function"==typeof e[n]&&(void 0===t?e[n]():e[n](t))}}function fn(e,t){ln(e,t)}function dn(e,t){const n=un(),r=n[e];if("string"==typeof e&&Array.isArray(r))if("function"==typeof t){for(let o=0,i=r.length;o<i;o++)if(r[o]===t){n[e].splice(o,1);break}}else delete n[e]}function pn(e,t=null){if(e){const n=JSON.stringify(t);sessionStorage.setItem(e,void 0===n?"null":n)}}function mn(e){let t=null;if(e){const n=sessionStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}function gn(e,t=null){if(e){const n=JSON.stringify(t);localStorage.setItem(e,void 0===n?"null":n)}}function hn(e){let t=null;if(e){const n=localStorage.getItem(e);if(n)try{t=JSON.parse(n)}catch(e){t=n}}return t}const wn=pn,yn=mn,bn=gn,vn=hn,En="__mazey_cookie_name_encoded__-",Tn="__mazey_cookie_value_encoded__-";function An(e){return`${Tn}${encodeURIComponent(e)}`}function Sn(e){const t=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/.test(e),n=0===e.indexOf(En)||0===e.indexOf(Tn);return t&&!n?e:function(e){return`${En}${encodeURIComponent(e)}`}(e)}function $n(e){const t=Sn(e);return t!==e?[t,e]:[e]}function Nn(e){const t=e+"=",n=document.cookie.split(";");for(let e=0;e<n.length;e++){const r=n[e].trim();if(0===r.indexOf(t))return r.substring(t.length)}}function _n(e){const t=$n(e),n="1"===Nn(An(e));for(let e=0;e<t.length;e++){const r=Nn(t[e]);if(void 0!==r){if(n)try{return decodeURIComponent(r)}catch(e){return r}return r}}return""}function xn(e,t,n,r){let o;if(n){const e=new Date;e.setTime(e.getTime()+24*n*60*60*1e3),o="; expires="+e.toUTCString()}else o="";const i=function(e){let t=!0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(!(33===r||r>=35&&r<=43||r>=45&&r<=58||r>=60&&r<=91||r>=93&&r<=126)){t=!1;break}}return{isEncoded:!t,value:t?e:encodeURIComponent(e)}}(t),s=Sn(e),u=i.isEncoded?"1":"",c=i.isEncoded?o:"; expires=Thu, 01 Jan 1970 00:00:00 GMT",a=[`${s}=${i.value}${o}; path=/`,`${An(e)}=${u}${c}; path=/`],l=e=>{const t=e?`; domain=${e}`:"";a.forEach(e=>{document.cookie=`${e}${t}`})},f=location.hostname;if(r)l(r);else if(-1===f.indexOf("."))l();else{const n=f.split(".");n.shift();l("."+n.join(".")),_n(e)!==t&&l(`.${f}`)}}function On(e){const t=$n(e),n=t.concat(An(e)),r=new Date;r.setTime(r.getTime()-1);const o=t.some(e=>void 0!==Nn(e));return n.forEach((e,t)=>{if(n.indexOf(e)===t&&void 0!==Nn(e)){[`${e}=; expires=${r.toUTCString()}`,`${e}=; expires=${r.toUTCString()}; path=/`].forEach(e=>{document.cookie=e;const t=location.hostname;if(-1!==t.indexOf(".")){const n=t.split(".");for(let t=0;t<n.length;t++)document.cookie=`${e}; domain=.${n.slice(t).join(".")}`}})}}),o&&n.every(e=>void 0===Nn(e))}function jn(e){On(e)}function Cn(e,t={id:""}){const{id:n}=t;return new Promise((t,r)=>{const o=document.createElement("link");let i=!1;const s=()=>{o.onload=null,o.onerror=null};o.rel="stylesheet",o.type="text/css",o.href=e,void 0!==n&&(o.id=n),o.onload=()=>{i||(i=!0,s(),t("loaded"))},o.onerror=()=>{i||(i=!0,s(),r(new Error(`Failed to load CSS: ${e}`)))},document.head.appendChild(o)})}const Mn={id:"",callback:function(){},timeout:5e3,isDefer:!1,isAsync:!1,isCrossOrigin:!1,attributes:null,cssUrl:""};function Dn(e,t={...Mn}){const{id:n,callback:r,timeout:o,isDefer:i,isAsync:s,isCrossOrigin:u,attributes:c,cssUrl:a}=Object.assign({...Mn},t);if(a){const t=function(e,t){if(!t)return"";if(vt(t))return t;try{const n=new URL(e,location.href);return new URL(t,n).href}catch(n){const r=e.split("/");return r.pop(),`${r.join("/")}/${t}`}}(e,a);t&&Cn(t).catch(e=>{console.error(`Failed to load CSS from ${t}: ${e?.message}`)})}return new Promise((t,a)=>{const l=document.createElement("script");let f=!1,d=null;const p=()=>{l.onload=null,l.onerror=null,null!==d&&(clearTimeout(d),d=null)},m=e=>{f||(f=!0,p(),a(e))};l.type="text/javascript",l.defer=Boolean(i),l.async=Boolean(s),u&&(l.crossOrigin="anonymous"),n&&(l.id=n),c&&Object.keys(c).forEach(e=>{l.setAttribute(e,c[e])}),l.onload=()=>{if(!f){f=!0,p();try{fe(r),t("loaded")}catch(e){a(e)}}},l.onerror=()=>m(new Error(`Failed to load script: ${e}`)),l.src=e,o&&(d=setTimeout(()=>m(new Error("timeout")),o));const g=document.getElementsByTagName("script")[0];if(g?.parentNode)g.parentNode.insertBefore(l,g);else{(document.head||document.body||document.documentElement).appendChild(l)}})}function kn(e=3e4){return new Promise((t,n)=>{let r=null;const o=()=>{window.removeEventListener("load",i),null!==r&&(clearTimeout(r),r=null)},i=()=>{o(),t("load")};"complete"!==document.readyState?(window.addEventListener("load",i),r=setTimeout(()=>{o(),n(new Error("timeout"))},e)):t("complete")})}function Fn(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.src=e})}function Ln(e,t){if(window[e])return Promise.resolve("defined");let n=Rn.get(e);const r=n?.get(t);if(r)return r;n||(n=new Map,Rn.set(e,n));const o=()=>{n?.delete(t),0===n?.size&&Rn.delete(e)},i=Dn(t).then(e=>(o(),e),e=>{throw o(),e});return n.set(t,i),i}const Rn=new Map;function zn(e){if("undefined"==typeof window)return!1;let t=[];const n=window.PerformanceObserver;return!!n&&(de(n.supportedEntryTypes)&&(t=n.supportedEntryTypes),t.includes(e))}async function Pn(){return zn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-contentful-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function Un(){return zn("paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-paint"===e.name);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"paint",buffered:!0})}):0}async function In(){return zn("largest-contentful-paint")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"largest-contentful-paint"===e.entryType);r&&(t.disconnect(),e(Math.round(r.startTime)))});t.observe({type:"largest-contentful-paint",buffered:!0})}):0}async function Bn(){return zn("first-input")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().find(e=>"first-input"===e.entryType);if(r){t.disconnect();const n=r.processingStart;e(n?Math.round(r.processingStart-r.startTime):0)}});t.observe({type:"first-input",buffered:!0})}):0}async function qn(){return zn("layout-shift")?new Promise(e=>{const t=new window.PerformanceObserver(n=>{const r=n.getEntries().reduce((e,t)=>{let n=0;return ae(t.value)&&(n=t.value),e+n},0);t.disconnect(),e(r)});t.observe({type:"layout-shift",buffered:!0})}):0}async function Yn(){if(!zn("navigation"))return 0;if(!window.performance||!window.performance.getEntriesByType)return 0;const e=window.performance.getEntriesByType("navigation")[0];let t=0;return e?(t=e.responseStart-e.requestStart,Math.round(t)):0}async function Wn(e=!1){if(!zn("navigation"))return Promise.reject(new Error("navigation is not supported"));const t=window.performance;if(!t||"function"!=typeof t.getEntriesByType)return Promise.reject(new Error("performance is not supported"));let n;const r=new Promise(e=>{[n]=[e]}),o=t.getEntriesByType("navigation");if(!de(o))return Promise.reject(new Error("NavigationTiming is not supported"));const i=o[0];let[s,u,c,a,l,f,d,p,m,g,h,w,y,b,v,E,T,A,S]=new Array(19).fill(0);({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:u,redirectEnd:c,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:w,domContentLoadedEventStart:y,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i);let $=0;if(ae(E))$=E;else{if(!ae(T))return Promise.reject(new Error("startTime, navigationStart or fetchStart are required"));$=T}const[N,_]=await Promise.all([Un(),Pn()]);function x(){({decodedBodySize:A,encodedBodySize:S}=i),({unloadEventEnd:s,unloadEventStart:u,redirectEnd:c,redirectStart:a,domainLookupEnd:l,domainLookupStart:f,connectEnd:d,connectStart:p,secureConnectionStart:m,responseStart:g,requestStart:h,responseEnd:w,domContentLoadedEventStart:y,loadEventStart:b,loadEventEnd:v,startTime:E,fetchStart:T}=i),ae(E)?$=E:ae(T)&&($=T);const t={source:"PerformanceNavigationTiming",os:O(),osVersion:j(),deviceType:C(),network:M(),screenDirection:D(),unloadTime:s-u,redirectTime:c-a,dnsTime:l-f,tcpTime:d-p,sslTime:k(d,m),responseTime:g-h,downloadTime:w-g,firstPaintTime:N,firstContentfulPaintTime:_,domReadyTime:y-$,onloadTime:b-$,whiteTime:g-$,renderTime:v-$,decodedBodySize:A,encodedBodySize:S};Object.keys(t).forEach(e=>{ae(t[e])&&(t[e]<0?t[e]=0:t[e]=Math.round(t[e]))}),ae(t.whiteTime)&&t.whiteTime>t.onloadTime&&(t.whiteTime=0);const r={};e||Object.keys(t).forEach(e=>{r[J(e)]=t[e]}),Object.keys(r).length?n(r):n(t)}function O(){let e;return e=navigator.userAgent.indexOf("Android")>-1?"android":navigator.userAgent.indexOf("iPhone")>-1?"ios":navigator.userAgent.indexOf("Windows Phone")>-1?"wp":"others",e}function j(){let e="";const t=navigator.userAgent,n=t.indexOf("Android")>-1,r=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),o=navigator.userAgent.split(";");if(o.length<2)return e;const 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 C(){let e;const 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",s=t.match(/ucweb/i)&&"ucweb",u=t.match(/android/i)&&"android",c=t.match(/windows ce/i)&&"windows ce",a=t.match(/windows mobile/i)&&"windows mobile";return e=n||r||o||i||s||u||c||a?r||o||i||s||u||c||a?"phone":n?"ipad":void 0:"pc",e||(e=""),e}function M(){let e="";const 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 D(){let e="";return window.screen&&window.screen.orientation&&"number"==typeof 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 k(e,t){let n=0;return t&&(n=e-t),n}return ae(v)&&v>0?x():"complete"===document.readyState?window.setTimeout(x,0):window.addEventListener("load",function e(){window.removeEventListener("load",e),window.setTimeout(function(){x()},0)}),r}function Zn(e,t=e.userAgent.trim().toLowerCase()){return/\bmacintosh\b/.test(t)&&"macintel"===e.platform.toLowerCase()&&e.maxTouchPoints>1}const Hn=Object.freeze(["adsbot-google","ahrefsbot","amazonbot","applebot","baiduspider","bingbot","bingpreview","bytespider","ccbot","chatgpt-user","claudebot","discordbot","dotbot","duckduckbot","facebookexternalhit","facebot","google-inspectiontool","googlebot","googleother","gptbot","linkedinbot","mediapartners-google","mj12bot","perplexitybot","petalbot","semrushbot","slackbot","slurp","storebot-google","telegrambot","twitterbot","whatsapp","yandexbot"]),Vn=Object.freeze(["headlesschrome","phantomjs","slimerjs","selenium","puppeteer","playwright"]);function Jn(){try{return"undefined"==typeof navigator?null:navigator}catch(e){return null}}function Gn(){const e=Jn();if(!e)return{userAgent:"",platform:"",maxTouchPoints:0};let t="",n="",r=0;try{const n=e.userAgent;t="string"==typeof n?n:""}catch(e){return{userAgent:"",platform:"",maxTouchPoints:0}}try{const t=e.platform;n="string"==typeof t?t:""}catch(e){n=""}try{const t=e.maxTouchPoints;r=Number.isFinite(t)?t:0}catch(e){r=0}return{userAgent:t,platform:n,maxTouchPoints:r}}function Qn(e){const t=e.userAgent.trim().toLowerCase();return t?/\bandroid\b|\badr\b/.test(t)?"android":/\bios\b|\biphone\b|\bipad\b|\bipod\b|\biwatch\b/.test(t)||Zn(e,t)?"ios":/\bwindows\b|\bwin32\b|\bwin64\b|\bwow32\b|\bwow64\b/.test(t)?"windows":/\bmacintosh\b|\bmacintel\b|\bmac os x\b/.test(t)?"macos":/\blinux\b/.test(t)?"linux":"":""}function Kn(e){const t=e.userAgent.trim().toLowerCase();if(!t)return"";if(/\biwatch\b|\bapple watch\b/.test(t))return"";if(/\bipad\b|\btablet\b/.test(t)||Zn(e,t))return"tablet";const n=Qn(e);return"android"===n?/\bmobile\b/.test(t)?"mobile":"tablet":"ios"===n&&/\biphone\b|\bipod\b/.test(t)?"mobile":"windows"===n||"macos"===n||"linux"===n||/\bcros\b/.test(t)?"desktop":/\bmobile\b/.test(t)?"mobile":""}function Xn(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Kn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Gn())}function er(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");return Qn(void 0!==e?{userAgent:e,platform:"",maxTouchPoints:0}:Gn())}function tr(e){return"mobile"===Xn(e)}function nr(e){return"desktop"===Xn(e)}function rr(e){return"tablet"===Xn(e)}function or(e){return"ios"===er(e)}function ir(e){return"android"===er(e)}function sr(e){return"macos"===er(e)}function ur(e){return"windows"===er(e)}function cr(e){return"linux"===er(e)}function ar(e,t){const n=e.trim().toLowerCase();return t.some(e=>n.includes(e))}function lr(e){if(void 0!==e&&"string"!=typeof e)throw new TypeError("userAgent must be a string when provided.");const t=void 0===e?function(){const e=Jn();if(!e)return"";try{const t=e.userAgent;return"string"==typeof t?t:""}catch(e){return""}}():e;return ar(t,Hn)?"crawler":ar(t,Vn)||function(){const e=Jn();if(!e)return!1;try{return!0===e.webdriver}catch(e){return!1}}()?"automation":"unknown"}function fr(e){if(void 0===e)return function(){try{return"undefined"==typeof window||"undefined"==typeof navigator?null:{window:window,navigator:navigator,document:"undefined"==typeof document?void 0:document}}catch(e){return null}}();if(null===e||"object"!=typeof e||Array.isArray(e))return null;try{const t=e.window,n=e.navigator,r=e.document;return null===t||"object"!=typeof t||null===n||"object"!=typeof n||void 0!==r&&(null===r||"object"!=typeof r)?null:{window:t,navigator:n,document:r}}catch(e){return null}}function dr(e={}){try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=e.requireManifest,n=e.scope,r=e.environment;if(void 0!==t&&"boolean"!=typeof t||void 0!==n&&"string"!=typeof n)return!1;const o=fr(r);if(!o)return!1;const{window:i,navigator:s,document:u}=o,c=s.serviceWorker;if(!0!==i.isSecureContext||null===c||"object"!=typeof c)return!1;if(void 0!==n&&!function(e,t){const n=e.trim();if(!n||/[?#]/.test(n))return!1;try{const e=new URL(t.location.href),r=new URL(n,e);if(r.origin!==e.origin||""!==r.search||""!==r.hash)return!1;if(e.pathname===r.pathname)return!0;const o=r.pathname.endsWith("/")?r.pathname:`${r.pathname}/`;return e.pathname.startsWith(o)}catch(e){return!1}}(n,i))return!1;if(!1===t)return!0;if(!u)return!1;const a=u.querySelector('link[rel~="manifest"][href]');return Boolean(a?.getAttribute("href")?.trim())}catch(e){return!1}}function pr(e={}){let t;try{if(null===e||"object"!=typeof e||Array.isArray(e))return!1;t=e.environment}catch(e){return!1}const n=fr(t);if(!n)return!1;const{window:r,navigator:o}=n;try{const e=r.matchMedia;if("function"==typeof e&&e.call(r,"(display-mode: standalone)").matches)return!0}catch(e){}try{return!0===o.standalone}catch(e){return!1}}function mr(){if(window.MAZEY_BROWSER_INFO&&"object"==typeof window.MAZEY_BROWSER_INFO)return window.MAZEY_BROWSER_INFO;let e={engine:"",engineVs:"",platform:"",supporter:"",supporterVs:"",system:"",systemVs:"",shell:"",shellVs:"",appleType:"",colorScheme:""};try{const t=Gn(),n=t.userAgent.toLowerCase();if(!n)return e;const r=e=>e.test(n),o=e=>{let t="";const r=n.match(e);return r&&de(r)&&(t=r.toString(),t=t.replace(/[^0-9|_.]/g,""),t=t.replace(/_/g,".")),t},i=Qn(t);let s="";"ios"===i&&(r(/ipad/g)?s="ipad":r(/iphone/g)?s="iphone":r(/iwatch/g)?s="iwatch":r(/ipod/g)?s="ipod":"macintel"===t.platform.toLowerCase()&&t.maxTouchPoints>1&&(s="ipad")),e={...e,system:i,appleType:s};let u="";"windows"===i?r(/windows nt 5.0|windows 2000/g)?u="2000":r(/windows nt 5.1|windows xp/g)?u="xp":r(/windows nt 5.2|windows 2003/g)?u="2003":r(/windows nt 6.0|windows vista/g)?u="vista":r(/windows nt 6.1|windows 7/g)?u="7":r(/windows nt 6.2|windows 8/g)?u="8":r(/windows nt 6.3|windows 8.1/g)?u="8.1":r(/windows nt 10.0|windows 10/g)&&(u="10"):"macos"===i?u=o(/os x [\d._]+/g):"android"===i?u=o(/android [\d._]+/g):"ios"===i&&(u=o(/os [\d._]+/g)),e={...e,systemVs:u};let c="";"windows"===i||"macos"===i||"linux"===i?c="desktop":("android"===i||"ios"===i||r(/mobile/g))&&(c="mobile"),e={...e,platform:c};let a="",l="";r(/applewebkit/g)?(a="webkit",r(/edg(?:a|ios)?\//g)||r(/edge\//g)?l="edge":r(/opr/g)?l="opera":r(/chrome/g)?l="chrome":r(/safari/g)&&(l="safari")):r(/gecko/g)&&r(/firefox/g)?(a="gecko",l="firefox"):r(/presto/g)?(a="presto",l="opera"):r(/trident|compatible|msie/g)&&(a="trident",l="iexplore"),e={...e,engine:a,supporter:l};let f="";"webkit"===a?f=o(/applewebkit\/[\d._]+/g):"gecko"===a?f=o(/gecko\/[\d._]+/g):"presto"===a?f=o(/presto\/[\d._]+/g):"trident"===a&&(f=o(/trident\/[\d._]+/g)),e={...e,engineVs:f};let d="";"chrome"===l?d=o(/chrome\/[\d._]+/g):"safari"===l?d=o(/version\/[\d._]+/g):"firefox"===l?d=o(/firefox\/[\d._]+/g):"opera"===l?d=o(/opr\/[\d._]+/g):"iexplore"===l?d=o(/(msie [\d._]+)|(rv:[\d._]+)/g):"edge"===l&&(d=o(/(?:edge|edg|edga|edgios)\/[\d._]+/g)),e={...e,supporterVs:d};let p="",m="";r(/micromessenger/g)?(p="wechat",m=o(/micromessenger\/[\d._]+/g)):r(/qqbrowser/g)?(p="qq_browser",m=o(/qqbrowser\/[\d._]+/g)):r(/\sqq/g)?p="qq_app":r(/ucbrowser/g)?(p="uc",m=o(/ucbrowser\/[\d._]+/g)):r(/qihu 360se/g)?p="360":r(/2345explorer/g)?(p="2345",m=o(/2345explorer\/[\d._]+/g)):r(/metasr/g)?p="sougou":r(/lbbrowser/g)?p="liebao":r(/maxthon/g)?(p="maxthon",m=o(/maxthon\/[\d._]+/g)):r(/biliapp/g)&&(p="bilibili"),e={...e,shell:p,shellVs:m};let g="";if(window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");e.matches?g="dark":t.matches&&(g="light")}return e={...e,colorScheme:g},window.MAZEY_BROWSER_INFO=e,e}catch(t){return Ct.warn(t),e}}function gr(e="",t="-"){const n=mr(),r=[];return["system","platform","engine","supporter","shell","appleType"].forEach(o=>{const i=n[o];if(i){let n="";e&&e.length>0&&(n=`${e}${t}`),r.push(`${n}${i}`)}}),r}let hr="";function wr(){if(hr)return Promise.resolve("webp"===hr);return new Promise(e=>{const t=new Image;t.onload=()=>{const n=t.width>0&&t.height>0;hr=n?"webp":"no-webp",e(n)},t.onerror=()=>{hr="no-webp",e(!1)},t.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA="})}function yr(e,t){if("function"!=typeof t)throw new TypeError("listener must be a function");if(null===e)return()=>{};if("object"!=typeof e)throw new TypeError("media must be a MediaQueryList or null");const n=e.addEventListener,r=e.removeEventListener;let o=null;if("function"==typeof n&&"function"==typeof r){const i=t;n.call(e,"change",i),o=()=>r.call(e,"change",i)}let i=!1;return()=>{i||(i=!0,o?.())}}function br(e,t,n){if(null===e||"object"!=typeof e||"function"!=typeof e.addEventListener||"function"!=typeof e.removeEventListener)throw new TypeError("registration must support event listeners");if(null===t||"object"!=typeof t||"function"!=typeof t.addEventListener||"function"!=typeof t.removeEventListener)throw new TypeError("container must support event listeners");if(null===n||"object"!=typeof n||"function"!=typeof n.onUpdateAvailable||void 0!==n.onControllerChange&&"function"!=typeof n.onControllerChange)throw new TypeError("callbacks must provide onUpdateAvailable");let r=!1,o=null,i=null,s=!1,u=!1;const c=e=>{r||i===e||(i=e,n.onUpdateAvailable(e))},a=()=>{!r&&"installed"===o?.state&&t.controller&&c(o)},l=()=>{r||(o?.removeEventListener("statechange",a),o=e.installing,o?.addEventListener("statechange",a),a())},f=()=>{r||n.onControllerChange?.()},d=()=>{if(s){try{e.removeEventListener("updatefound",l)}catch(e){}s=!1}try{o?.removeEventListener("statechange",a)}catch(e){}if(u){try{t.removeEventListener("controllerchange",f)}catch(e){}u=!1}};try{e.addEventListener("updatefound",l),s=!0,t.addEventListener("controllerchange",f),u=!0,e.waiting&&t.controller&&c(e.waiting),e.installing&&l()}catch(e){throw r=!0,d(),o=null,i=null,e}return{activateWaiting(e={type:"SKIP_WAITING"}){if(r||!i)return!1;try{return i.postMessage(e),!0}catch(e){return!1}},dispose(){r||(r=!0,d(),o=null,i=null)}}}function vr(e){if("string"!=typeof e||""===e.trim())throw new TypeError("storageKey must be a non-empty string.")}function Er(e){if("undefined"==typeof window)return null;try{return new URL(window.location.href).searchParams.get(e)}catch(e){return null}}function Tr(e){if("undefined"==typeof window)return null;try{const t=window.localStorage;return t&&"function"==typeof t.getItem?t.getItem(e):null}catch(e){return null}}function Ar(e,t){if("undefined"==typeof window)return!1;try{const n=window.localStorage;return!(!n||"function"!=typeof n.setItem)&&(n.setItem(e,t),!0)}catch(e){return!1}}const Sr=Object.freeze({system:"System",light:"Light",dark:"Dark"});function $r(e){return"light"===e||"dark"===e}function Nr(){if("undefined"==typeof window)return null;try{const e=window.matchMedia;return"function"!=typeof e?null:e.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}catch(e){return null}}function _r(e,t){return{value:e,label:Sr[t]}}function xr(e){vr(e);const t=Er(e);if($r(t))return _r(t,t);const n=Tr(e);if($r(n))return _r(n,n);const r=Nr();return"system"===n&&r||r?_r(r,"system"):_r("light","light")}function Or(e,t){if(vr(e),!function(e){return"system"===e||$r(e)}(t))throw new TypeError('value must be "system", "light", or "dark".');return Ar(e,t)}function jr(e){const t=e.split("-");if(!/^[a-z]{2,8}$/i.test(t[0]))return null;const n=[t[0].toLowerCase()];let r=1;if(r<t.length&&/^[a-z]{4}$/i.test(t[r])){const e=t[r].toLowerCase();n.push(`${e[0].toUpperCase()}${e.slice(1)}`),r++}for(r<t.length&&(/^[a-z]{2}$/i.test(t[r])||/^\d{3}$/.test(t[r]))&&(n.push(/^[a-z]{2}$/i.test(t[r])?t[r].toUpperCase():t[r]),r++);r<t.length;r++){const e=t[r];if(!/^(?:[a-z0-9]{5,8}|\d[a-z0-9]{3})$/i.test(e))return null;n.push(e.toLowerCase())}return n.join("-")}function Cr(e){if("string"!=typeof e)return null;const t=e.trim().replace(/_/g,"-");if(!t)return null;if("undefined"!=typeof Intl)try{const e=Intl,n=e.getCanonicalLocales;if("function"==typeof n){const r=n.call(e,t)[0];return"string"==typeof r&&r?r:null}}catch(e){return e instanceof RangeError||"object"==typeof e&&null!==e&&"name"in e&&"RangeError"===e.name?null:jr(t)}return jr(t)}function Mr(e){if("undefined"==typeof Intl)return e;try{const t=Intl.DisplayNames;if("function"!=typeof t)return e;const n=new t([e],{type:"language"}).of(e);return"string"==typeof n&&n.trim()?n:e}catch(t){return e}}function Dr(e){return{value:e,label:Mr(e)}}function kr(e){vr(e);const t=Cr(Er("lang"));if(t)return Dr(t);const n=Cr(Tr(e));if(n)return Dr(n);return Dr(Cr(function(){if("undefined"==typeof window||"undefined"==typeof navigator)return null;try{return"string"==typeof navigator.language?navigator.language:null}catch(e){return null}}())??"en")}function Fr(e,t){vr(e);const n=Cr(t);if(!n)throw new TypeError("language must be a valid language tag.");return Ar(e,n)}export{kt as addClass,an as addEvent,zt as addStyle,B as assignDefined,D as calLongestCommonSubsequence,C as calLongestCommonSubstring,x as calculateAspectRatio,O as calculateCAGR,J as camelCase2Underscore,Z as camelCaseToKebabCase,sn as cancelBubble,Ne as clearHTML,_e as clearHtml,We as convert10To26,Y as convertCamelToKebab,H as convertCamelToUnder,St as convertHttpToHttps,W as convertKebabToCamel,At as convertObjectToQuery,Te as convertToHtmlBreaks,V as convertUnderToCamel,ke as cutCHSString,Me as cutZHString,ce as debounce,P as deepCopy,q as deepCopyObject,I as deepFreeze,jn as delCookie,et as derivePackageMetadata,lr as detectVisitorType,fe as doFn,xe as escapeHtmlAttribute,on as extractElementText,ln as fireEvent,se as floatFixed,ie as floatToPercent,ze as formatByteSize,N as formatDate,$ as formatDistanceToNow,w as formatDurationFromMs,a as formatLocalDateTime,gr as genBrowserAttrs,jt as genCustomConsole,Ue as genHashCode,te as genRndNumString,It as genStyleString,re as genUniqueNumString,_ as generateCalendarVersion,ne as generateRndNum,oe as generateUniqueNum,lt as getAllQueryParams,mr as getBrowserInfo,qn as getCLS,_n as getCookie,Ze as getCurrentVersion,m as getDateDifference,un as getDefineListeners,mt as getDomain,Pn as getFCP,Bn as getFID,Un as getFP,Pe as getFileSize,g as getFriendlyInterval,pt as getHashQueryParam,In as getLCP,hn as getLocalJSON,vn as getLocalStorage,Bt as getPageMeta,Wn as getPerformance,at as getQueryParam,Tt as getScriptQueryParam,mn as getSessionJSON,yn as getSessionStorage,Nr as getSystemTheme,Yn as getTTFB,Et as getUrlFileType,Nt as getUrlHost,ft as getUrlParam,_t as getUrlPath,Dt as hasClass,tn as hide,Xt as hideElements,L as inRate,Rt as injectStyle,fn as invokeEvent,le as invokeFn,ir as isAndroid,ve as isArray,he as isBool,we as isBoolean,Qe as isBrowser,nr as isDesktop,me as isFunction,F as isHit,or as isIOS,K as isJSONString,X as isJsonString,cr as isLinux,sr as isMacOS,qe as isMobile,de as isNonEmptyArray,Ee as isNonEmptyObject,ye as isNullish,ae as isNumber,tr as isPhone,pe as isPureObject,dr as isSafePWAEnv,pr as isStandalonePWA,ge as isString,wr as isSupportWebp,zn as isSupportedEntryType,rr as isTablet,A as isThisHour,E as isThisMonth,T as isThisWeek,v as isThisYear,b as isToday,be as isUdfOrNul,qt as isValidCssSelector,Le as isValidData,y as isValidDate,Ye as isValidEmail,vt as isValidHttpUrl,Be as isValidPhoneNumber,gt as isValidUrl,ur as isWindows,yr as listenMediaQueryChanges,Cn as loadCSS,Fn as loadImage,Dn as loadScript,Ln as loadScriptIfUndefined,M as longestComSubsequence,j as longestComSubstring,f as mNow,Q as mTrim,Ct as mazeyCon,Ae as newLine,cn as onEvent,xt as onURLChange,ct as parseGitHubRepository,ee as parseJsonSafe,c as parseLocalDateTime,k as randomBoolean,Lt as removeClass,On as removeCookie,dn as removeEvent,Se as removeHTML,$e as removeHtml,He as repeatUntilConditionMet,$t as replaceHttp,rn as resolveElementTarget,kr as resolveLanguagePreference,xr as resolveThemePreference,Oe as sanitizeInput,Ft as setClass,xn as setCookie,Pt as setImgSizeBySrc,Ut as setImgWidHeiBySrc,Fr as setLanguagePreference,gn as setLocalJSON,bn as setLocalStorage,pn as setSessionJSON,wn as setSessionStorage,Or as setThemePreference,Ie as sha256Hex,nn as show,en as showElements,Je as sleep,l as subYears,ue as throttle,Mt as timeCon,G as toJavaScriptGlobalName,De as truncateZHString,Ce as unsanitize,je as unsanitizeInput,dt as updateQueryParam,Ve as waitTime,br as watchServiceWorkerUpdates,kn as windowLoaded,Fe as zAxiosIsValidRes};