/**
 * Skipped minification because the original files appears to be already minified.
 * Original file: /npm/@zzcpt/zztool@2.6.4/dist/zztool.umd.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).zztool={})}(this,function(e){"use strict";const t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node;function n(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function r(e){return null==e||("string"===n(e)?""===e.trim():"number"!==n(e)&&"boolean"!==n(e)&&"date"!==n(e)&&"function"!==n(e)&&"regexp"!==n(e)&&(Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length))}function o(e){return Array.isArray(e)?e.filter(e=>!r(e)):e}function i(e){return"string"==typeof e&&e&&0!==e.length?e.charAt(0):""}function a(e){if(!e)throw new Error("Invalid param");const t=JSON.stringify(e);return"\\"===i(t)?t.replace(/\\/g,""):t}function u(e,t){if(!e||!t)return!1;const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(n).test(e)}function s(e,t=""){if(!e)return[];if(Array.isArray(e))return[...e];if("object"==typeof e)return Object.values(e);const n="string"==typeof e?e:a(e);if("{"===i(n)||"["===i(n))try{const e=JSON.parse(n);return Array.isArray(e)?e:Object.values(e)}catch(r){}return t?n.split(t):u(n,",")?n.split(","):n.split("")}function l(e){const t=[],n=/([^[\]]+)|(\[\d+\])/g;let r;for(;null!==(r=n.exec(e));){let e=r[0];if(e.startsWith("[")){const n=parseInt(e.slice(1,-1),10);t.push(n)}else e.split(".").forEach(e=>{e&&t.push(e)})}return t}function c(e,t){let n=e;const r=t.slice(0,-1),o=t[t.length-1];for(const i of r){if("object"!=typeof n||null===n)throw new Error(`Invalid path,unable to access properties ${i}`);if("number"==typeof i){if(!Array.isArray(n))throw new Error("Path expects array but obtains other types");if(i<0||i>=n.length)throw new Error(`Array Index Overflow: ${i}`);n=n[i]}else{if(!n.hasOwnProperty(i))throw new Error(`attribute ${i} not exist`);n=n[i]}}return{parent:n,key:o}}function f(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function h(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}const g=function(){let e=null;return(t,n=800)=>{e&&clearTimeout(e),e=setTimeout(t,n)}}();function p(e,t=new WeakMap){if(null===e||"object"!=typeof e)return e;if("function"==typeof e)return e.bind(null);if(t.has(e))return t.get(e);let n;return e instanceof Date?(n=new Date(e),t.set(e,n),n):e instanceof RegExp?(n=new RegExp(e.source,e.flags),t.set(e,n),n):e instanceof Map?(n=new Map,t.set(e,n),e.forEach((e,r)=>{n.set(p(r,t),p(e,t))}),n):e instanceof Set?(n=new Set,t.set(e,n),e.forEach(e=>{n.add(p(e,t))}),n):(n=Array.isArray(e)?[]:{},t.set(e,n),Reflect.ownKeys(e).forEach(r=>{n[r]=p(e[r],t)}),n)}function y(e){const t=e?new Date(e):new Date;if(isNaN(t.getTime()))throw new Error("Invalid date format");const n=e=>e.toString().padStart(2,"0");return{year:t.getFullYear().toString(),month:n(t.getMonth()+1),day:n(t.getDate()),hour:n(t.getHours()),minute:n(t.getMinutes()),second:n(t.getSeconds())}}function d(e,t="Y/M/D h:m:s"){const{year:n,month:r,day:o,hour:i,minute:a,second:u}="object"==typeof e?e:y(e)||{};return t.replace("Y",null!=n?n:"--").replace("M",null!=r?r:"--").replace("D",null!=o?o:"--").replace("h",null!=i?i:"--").replace("m",null!=a?a:"--").replace("s",null!=u?u:"--")}function m(e="",t="Y/M/D h:m:s"){return 0===arguments.length?d(y(new Date),"Y/M/D h:m:s"):1===arguments.length?d(y(new Date),e):d(y(e),t)}function w(e=new Date,t=!0){const n=new Date(e).getTime();return isNaN(n)?NaN:t?n:Math.floor(n/1e3)}function b(e,t){if(!arguments.length)return Math.random();if(void 0!==e&&void 0!==t){if(!Number.isFinite(e)||!Number.isFinite(t)||e>t)throw new Error("Invalid param min <= max and type must be number");return Math.floor(Math.random()*(t-e+1)+e)}return 0}const S=["11","12","13","14","15","21","22","23","31","32","33","34","35","36","37","41","42","43","44","45","46","50","51","52","53","54","61","62","63","64","65","71","81","82","91"],D=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],A=["1","0","X","9","8","7","6","5","4","3","2"],v=function(){let e=0;return(t,n=800)=>{let r=+Date.now();r-e>n&&(t(),e=r)}}(),j=e=>{if("undefined"==typeof window||"undefined"==typeof localStorage)return null;if(!e||"string"!=typeof e)return null;try{const t=e.split(".");let n=JSON.parse(localStorage.getItem(t[0])||"null");for(let e=1;e<t.length;e++){if(null==n)return null;n=n[t[e]]}return n}catch(t){return null}},M=(e,t)=>{if("undefined"==typeof window||"undefined"==typeof localStorage)return null;if(!e||"string"!=typeof e)return null;if(!t)return null;try{const n=e.split(".");if(1===n.length)return void localStorage.setItem(n[0],JSON.stringify(t));let r=JSON.parse(localStorage.getItem(n[0])||"{}"),o=r;for(let e=1;e<n.length-1;e++)"object"==typeof o[n[e]]&&null!==o[n[e]]||(o[n[e]]={}),o=o[n[e]];return o[n[n.length-1]]=t,localStorage.setItem(n[0],JSON.stringify(r)),!0}catch(n){}},O=e=>{if("undefined"==typeof window||"undefined"==typeof localStorage)return null;if(!e||"string"!=typeof e)return null;try{const t=e.split(".");if(1===t.length)return void localStorage.removeItem(t[0]);let n=JSON.parse(localStorage.getItem(t[0])||"null");if(null==n)return;let r=n;for(let e=1;e<t.length-1;e++){if("object"!=typeof r[t[e]]||null===r[t[e]])return;r=r[t[e]]}return delete r[t[t.length-1]],localStorage.setItem(t[0],JSON.stringify(n)),!0}catch(t){}};function $(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=e=>n(e),r.readAsDataURL(e)})}const N="onceStorage_";e.arrayTrim=o,e.chunkArray=function(e,t){if(!Array.isArray(e))throw new Error("Invalid input data.");if(t<=1)return[...e];const n=[],r=Math.ceil(e.length/t);for(let o=0;o<t;o++)n.push(e.slice(o*r,(o+1)*r));return n},e.chunkArrayItem=function(e,t){if(!Array.isArray(e)||0===e.length||!Number.isInteger(t)||t<=0)throw new Error("Invalid input data or size.");if(t<=1)return[...e];const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},e.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)},e.copy=function(e){return t=this,r=function*(){if(!navigator.clipboard||!navigator.clipboard.writeText)return function(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.width="1px",t.style.height="1px",t.style.padding="0",t.style.border="none",t.style.outline="none",t.style.boxShadow="none",t.style.background="transparent",document.body.appendChild(t),t.focus(),t.select();try{const e=document.execCommand("copy");return document.body.removeChild(t),e}catch(n){return document.body.removeChild(t),!1}}(e);try{return yield navigator.clipboard.writeText(e),!0}catch(t){return!1}},new((n=void 0)||(n=Promise))(function(e,o){function i(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(i,a)}u((r=r.apply(t,[])).next())});var t,n,r},e.dataEmpty=function e(t,n=!1,r="",o=new WeakSet){if(!t||"object"!=typeof t)throw new Error("Invalid argument: obj must be an object");if(Array.isArray(t)&&0==t.length)return!0;if("object"==typeof t&&0===Object.keys(t).length)return!0;const i=[];function a(e){return"number"==h(e)?isNaN(e):""===e||null==e||"object"==typeof e&&(Array.isArray(e)?0===e.length:0===Object.keys(e).length)}o.add(t);for(const u of Object.keys(t)){const n=t[u],s=r?`${r}.${u}`:u;if("object"==typeof n&&null!==n){if(a(n)){i.push(s);continue}if(o.has(n))continue;const t=e(n,!0,s,o);Array.isArray(t)&&i.push(...t)}else a(n)&&i.push(s)}return n?i:i.length>0},e.dataFind=function(e,t,n){if(!e||"string"!=typeof t)throw new Error("Invalid argument");const r=[],o=e=>e&&"object"==typeof e?e[t]===n?r.push(e):Object.keys(e).map(t=>o(e[t])).find(Boolean)||null:Array.isArray(e)&&e.map(o).find(Boolean)||null;return o(e),r},e.dataMerge=function(e,t,n=1){if(!Array.isArray(e)||!Array.isArray(t))return[];switch(n){case 1:return Array.from(new Set([...e,...t]));case 2:return e.filter(e=>t.includes(e));case 3:return e.filter(e=>!t.includes(e));case 4:return[...e.filter(e=>!t.includes(e)),...t.filter(t=>!e.includes(t))];default:return[]}},e.debounce=g,e.deepClone=p,e.deepRenameKey=function(e,t,n){if("object"!=typeof e||(r=e,0===Object.keys(r).length&&r.constructor===Object)||!e||!t||!n)throw new Error("Invalid input param.");var r;const o=JSON.parse(JSON.stringify(e)),i=t.split(","),a=n.split(",");if(i.length!==a.length)throw new Error("The number of index and newIndex is not equal.");const u=new Map;for(let s=0;s<i.length;s++)u.set(i[s].trim(),a[s].trim());return function e(t){var n;if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(e);const r={};for(const[o,i]of Object.entries(t))r[null!==(n=u.get(o))&&void 0!==n?n:o]=e(i);return r}(o)},e.equal=function(e,t,n={}){const{returnKeys:r,arrayDiff:o}=Object.assign(Object.assign({},{returnKeys:!1,arrayDiff:!0}),n),i=function e(t,n,r=""){if("object"!=typeof t||"object"!=typeof n||null===t||null===n)throw new Error("Both arguments must be objects or arrays.");const i=[];return new Set([...Object.keys(t),...Object.keys(n)]).forEach(a=>{const u=r?`${r}.${a}`:a,s=t[a],l=n[a];if("object"===h(s)&&"object"===h(l))i.push(...e(s,l,u));else if(Array.isArray(s)&&Array.isArray(l)){if(o){const t=Math.max(s.length,l.length);for(let n=0;n<t;n++){const t=s[n],r=l[n],o=`${u}.${n}`;"object"===h(t)&&"object"===h(r)?i.push(...e(t,r,o)):t!==r&&i.push(o)}}}else s!==l&&i.push(u)}),i}(e,t);return r?i:i.length>0},e.fileToBase64=function(e){return t=this,r=function*(){if("string"==typeof e)try{const t=yield fetch(e);if(!t.ok)throw new Error(`requeest fail: ${e}`);return $(yield t.blob())}catch(n){return t=e,new Promise((e,n)=>{const r=new Image;r.crossOrigin="Anonymous",r.src=t,r.onload=()=>{try{const t=document.createElement("canvas");t.width=r.width,t.height=r.height;const o=t.getContext("2d");if(!o)return n(new Error("Cannot get canvas context"));o.drawImage(r,0,0),e(t.toDataURL("image/png"))}catch(t){n(t)}},r.onerror=()=>n(new Error(`load fail：${t}`))})}var t;return $(e)},new((n=void 0)||(n=Promise))(function(e,o){function i(e){try{u(r.next(e))}catch(t){o(t)}}function a(e){try{u(r.throw(e))}catch(t){o(t)}}function u(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n(function(e){e(r)})).then(i,a)}u((r=r.apply(t,[])).next())});var t,n,r},e.getAllCombinations=function(e,t=1){return 1===t?function(e){const t=[];for(const n of function*(e){for(let t=0;t<e.length;t++){let n="";for(let r=t;r<e.length;r++)n+=e[r],yield n}}(e))t.push(n);return t}(e):2===t?function(e){return[e]}(e):3===t?function(e){if(!e||e.length<1)return"";const t="^#"+e.split("").join("#")+"#$",n=t.length,r=new Array(n).fill(0);let o=0,i=0,a=0,u=0;for(let l=1;l<n-1;l++){let e=2*o-l;for(l<i&&(r[l]=Math.min(i-l,r[e]));t[l+1+r[l]]===t[l-1-r[l]];)r[l]++;l+r[l]>i&&(o=l,i=l+r[l]),r[l]>a&&(a=r[l],u=l)}const s=(u-a)/2;return e.substring(s,s+a)}(e):[]},e.getAllOnceStorage=function(){const e=Object.keys(localStorage).filter(e=>e.startsWith(N));return e.length?e.map(e=>{const t=e.replace(N,"");return{key:t,value:JSON.parse(j(t))}}):[]},e.getBetweenDate=function(e,t,n=!1){const r=864e5,o=w(e),i=w(t);if(isNaN(o)||isNaN(i))return[];const a=Math.abs(o-i)/r+1;return n?a:o===i?[m(new Date(o),"Y-M-D")]:Array.from({length:a},(e,t)=>m(new Date(o>i?i+t*r:o+t*r),"Y-M-D"))},e.getChar=function(e,t,n){return"string"!=typeof e||!e||0===e.length||t<0||n>e.length||t>=n?"":e.substring(t,n)||""},e.getCookie=function(e){const t=document.cookie.match(new RegExp(`(?:^|; )${e.replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")}=([^;]*)`));return t?JSON.parse(decodeURIComponent(t[1])):""},e.getDate=m,e.getDateInfo=y,e.getDateType=d,e.getFirstChar=i,e.getLastChar=function(e){return"string"==typeof e&&e&&0!==e.length?e.charAt(e.length-1):""},e.getMonthDays=function(e=(new Date).getFullYear(),t=(new Date).getMonth()+1){if(!Number.isInteger(e)||!Number.isInteger(t)||t<1||t>12)throw new Error("Invalid date.");return new Date(e,t,0).getDate()},e.getOnceStorage=function(e){return j(N+e)},e.getPercentage=function(e,t,n=2){if(0===t)return"0.00%";if("number"!=typeof e||"number"!=typeof t||"number"!=typeof n)throw new Error("data type error must be number.");return(e/t*100).toFixed(n)+"%"},e.getRandom=b,e.getRandomArray=function(e,t,n){if(!Number.isInteger(e)||e<0)throw new Error("length must be a positive integer");if(1===arguments.length)return Array.from({length:e},()=>b());if(void 0!==t&&void 0!==n){if(!Number.isFinite(t)||!Number.isFinite(n)||t>n)throw new Error("min and max must be finite int and min ≤ max");return Array.from({length:e},()=>b(t,n))}return[]},e.getRandomColor=function(){return`#${Math.floor(16777215*Math.random()).toString(16)}`},e.getRandomIdcard=function(e=1e3,t=9999){const n=S,r=n[Math.floor(Math.random()*n.length)]+String(Math.floor(1e3+8999*Math.random())).substring(0,2)+String(Math.floor(1e3+8999*Math.random())).substring(0,2),o=String(Math.floor(Math.random()*(t-e+1))+e),i=String(Math.floor(12*Math.random())+1).padStart(2,"0"),a=(()=>{const e=new Date(Number(o),Number(i),0).getDate();return String(Math.floor(Math.random()*e)+1).padStart(2,"0")})(),u=r+(o+i+a)+String(Math.floor(999*Math.random())).padStart(3,"0"),s=D,l=A;let c=0;for(let f=0;f<17;f++)c+=Number(u[f])*s[f];return u+l[c%11]},e.getRandomRGBA=function(){return`rgba(${b(0,255)},${b(0,255)},${b(0,255)},${b(0,100)/100})`},e.getRandomRGBColor=function(){return`rgb(${b(0,255)},${b(0,255)},${b(0,255)})`},e.getRecentDate=function(e){let{date:t=new Date,step:n=1,type:r="after",format:o="Y-M-D",option:i={1:3,2:7,3:15,4:30}}=e;const a=864e5;let u=new Date(t).getTime();if(isNaN(u))return[];const s=Object.keys(i);!1===s.includes(n.toString())&&(n=Number(s[0]));const l=i[n]*a;u="before"===r?u-a:u+a;const c="before"===r?u-l:u+l,f=[];for(;"before"===r&&u>c||"after"===r&&u<c;)f.push(d(y(u),o)),u+="before"===r?-a:a;return"before"===r?f.reverse():f},e.getStorage=j,e.getTimeStamp=w,e.getTimeStep=function(e,t,n="01:00",r="hh:mm"){if(![e,t,n].every(e=>/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/.test(e)))throw new Error("Invalid param");const o=e=>e.split(":").map(Number).reduce((e,t,n)=>e+t*[3600,60,1][n],0),i=e=>[Math.floor(e/3600),Math.floor(e%3600/60),e%60].map(e=>String(e).padStart(2,"0")).join(":"),a=o(e),u=o(t),s=o(n);if(a>u)throw new Error("Start time cannot be greater than end time.");const l=[];for(let c=a;c<=u;c+=s)l.push("hh:mm:ss"===r?i(c):i(c).slice(0,5));return l},e.getType=h,e.getUrlParam=function(e=""){return t&&!e?{}:(e||(e=window.location.href),(e.match(/([^?=&]+)(=([^&]*))/g)||[]).reduce((e,t)=>(e[t.slice(0,t.indexOf("="))]=t.slice(t.indexOf("=")+1),e),{}))},e.getValue=function(e,t){return"string"==typeof t&&(t=t.replace(/\[(\d+)\]/g,".$1").split(".")),Array.isArray(t)&&0!==t.length?t.reduce((e,t)=>e&&void 0!==e[t]?e[t]:"",e):""},e.getWeekDay=function(e=new Date){return e=e instanceof Date?e:new Date(e),["日","一","二","三","四","五","六"][new Date(e).getDay()]},e.getWeekTime=function(e=new Date){if(e=e instanceof Date?e:new Date(e),isNaN(e.getTime()))return[];const t=new Date(e),n=t.getDay()||7,r=new Date(t);return r.setDate(t.getDate()-n+1),Array.from({length:7},(e,t)=>{const n=new Date(r);return n.setDate(r.getDate()+t),n.toISOString().split("T")[0]})},e.getYearWeeks=function(e=(new Date).getFullYear()){let t=new Date(e,0,1).getDay();if(t=1==t?0:0==t?1:8-t,e%4==0&&e%100!=0||e%100==0&&e%400==0)var n=366;else n=365;return Math.ceil((n-t)/7)+(0!==t?1:0)},e.groupBy=function(e,t){return Array.isArray(e)&&t?e.reduce((e,n)=>{var r;const o=String(null!==(r=n[t])&&void 0!==r?r:"others");return e[o]||(e[o]=[]),e[o].push(n),e},{}):{}},e.isEmpty=function(e,n={}){const{returnKeys:o=!1,parentKey:i="",checkEmptyFn:a,ignoreKeys:u=[],maxDepth:s=1/0}=n;if(null==e)return!0;if("string"==typeof e&&""===e.trim())return!0;if(Array.isArray(e)&&0===e.length)return!0;if("object"===h(e)&&0===Object.keys(e).length)return!0;const l=new WeakSet,c=a||r;e&&"object"==typeof e&&l.add(e);const f=[];return function e(n,r,o){o>s||(Array.isArray(n)&&n.length>0&&0==Object.entries(n).length&&f.push(r),t&&Buffer.isBuffer(n)&&!n.toString()&&f.push(r),"object"==typeof n&&Object.entries(n).forEach(([t,n])=>{const i=r?`${r}.${t}`:t;u.includes(i)||(c(n)?f.push(i):l.has(n)||e(n,i,o+1))}))}(e,i,1),o?f:f.length>0},e.isToday=e=>{if(!e)throw new Error("date is required");const t=(new Date).toISOString().split("T")[0];return new Date(e).toISOString().split("T")[0]===t},e.isYesterday=e=>{if(!e)throw new Error("date is required");const t=new Date(e),n=new Date((new Date).getTime()-864e5);return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()},e.jsonParse=function(e){try{return JSON.parse(e)}catch(t){return e}},e.jsonStringify=function(e){try{return JSON.stringify(e)}catch(t){return e}},e.moneyFormat=function(e,t=",",n=""){if(null==e||"string"!=typeof e&&"number"!=typeof e)throw new Error("Invalid money format");if(isNaN(Number(e))||"string"==typeof e&&""===e)return"0";let[r,o]=e.toString().split(".");return r=r.replace(/\B(?=(\d{3})+(?!\d))/g,t),n+(o?`${r}.${o}`:r)},e.omitDeep=function(e,t){const n=p(e),r=t;for(const o of r){const e=o.split(".");let t=n;for(let n=0;n<e.length-1&&t[e[n]];n++)t=t[e[n]];null==t||delete t[e[e.length-1]]}return n},e.once=function(e){let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}},e.onceStorage=function(e,t){try{const n=N+e;if(j(n)){const e=j(n);return O(n),JSON.parse(e)}{const e=JSON.stringify(t);return M(n,e),e}}catch(n){throw n}},e.paramformat=function(e,t="url"){var n;if(!e||"object"!=typeof e)return"";if("url"===t)return Object.keys(e).map(t=>{var n;return`${encodeURIComponent(t)}=${encodeURIComponent(null!==(n=e[t])&&void 0!==n?n:"")}`}).join("&");if("json"===t)return JSON.stringify(e);if("formData"===t){const t=new FormData;for(const r in e)t.append(r,null!==(n=e[r])&&void 0!==n?n:"");return t}},e.pick=function(e,t){if("object"!=typeof e||null===e)throw new Error("obj must be an object and not null");if("string"!=typeof t)throw new Error("index must be string");const n=[],r=new WeakSet,o=[{value:e,path:""}];for(;o.length>0;){const{value:e,path:i}=o.pop();if("object"==typeof e&&null!==e){if(r.has(e))continue;r.add(e);for(const r in e)if(e.hasOwnProperty(r)){const a=i?`${i}.${r}`:r,u=e[r];"object"==typeof u&&null!==u&&o.push({value:u,path:a}),r===t&&n.push({key:a,value:u})}}}return n},e.pipe=function(...e){return 0===e.length?e[0]:function(...t){return e.reduce((e,t)=>t(e),t[0])}},e.regEmail=function(e){return/^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/.test(e)},e.regIdcard=function(e){if(!/^\d{17}(\d|X)$/i.test(e))return!1;if(!new Set(S).has(e.substring(0,2)))return!1;const t=parseInt(e.substring(6,10),10),n=parseInt(e.substring(10,12),10),r=parseInt(e.substring(12,14),10),o=new Date(t,n-1,r);if(o.getFullYear()!==t||o.getMonth()+1!==n||o.getDate()!==r)return!1;const i=D,a=A;let u=0;for(let l=0;l<17;l++)u+=Number(e[l])*i[l];const s=a[u%11];return e[17].toUpperCase()===s},e.regIsHas=u,e.regPhone=function(e){return"string"==typeof(e=String(e))&&/^1[3456789]\d{9}$/.test(e)},e.removeAllOnceStorage=function(){Object.keys(localStorage).filter(e=>e.startsWith(N)).forEach(e=>O(e))},e.removeCookie=function(e,t){document.cookie=`${encodeURIComponent(e)}=; expires=${new Date(0).toUTCString()}${t?`; path=${t}`:""}`},e.removeOnceStorage=function(e){try{return O(N+e)}catch(t){throw t}},e.removeStorage=O,e.renameKeysByPath=function(e,t,n){if("object"!=typeof e||(r=e,0===Object.keys(r).length&&r.constructor===Object)||!e||!t||!n)throw new Error("Invalid param.");var r;const o=s(t,","),i=s(n,",");if(o.length!==i.length)throw new Error("index and newIndex length must be equal");const a=JSON.parse(JSON.stringify(e));for(let u=0;u<o.length;u++){const e=o[u],t=i[u],n=l(e),r=l(t);if(0===n.length||0===r.length)throw new Error("Invalid path");if(!f(n.slice(0,-1),r.slice(0,-1)))continue;const{parent:s,key:h}=c(a,n),g=r[r.length-1];if(null===s||"object"!=typeof s)throw new Error("Path parent is invalid");if(s.hasOwnProperty(g))throw new Error('Key "newKey" already exists, cannot rename "oldKey"');s.hasOwnProperty(h)&&(s[g]=s[h],delete s[h])}return a},e.replaceAll=function(e,t,n){return e.replace(new RegExp(t,"g"),n)},e.setCookie=function(e,t,n={}){let r=`${encodeURIComponent(e)}=${encodeURIComponent(JSON.stringify(t))}`;if(n.expires){let e;const t=new Date;t.setTime(t.getTime()+n.expires),e=t.toUTCString(),r+=`; expires=${e}`}n.path&&(r+=`; path=${n.path}`),n.domain&&(r+=`; domain=${n.domain}`),n.secure&&(r+="; secure"),n.sameSite&&(r+=`; samesite=${n.sameSite}`),document.cookie=r},e.setStorage=M,e.shuffleArray=function(e){if(!Array.isArray(e)||e.length<=1)return e;let t=e.slice();for(let n=t.length-1;n>0;n--){const e=Math.floor(Math.random()*(n+1));[t[n],t[e]]=[t[e],t[n]]}return t},e.sleep=function(e){return new Promise(t=>setTimeout(t,e))},e.strReplace=function(e,t,n,r="*"){return!e||0===e.length||!Number.isInteger(t)||!Number.isInteger(n)||t<0||t>=n?e:(n>e.length&&(n=e.length),e.slice(0,t)+r.repeat(n-t)+e.slice(n))},e.stripEmpty=function e(t,n,i=new WeakMap){if("object"!=typeof t||!t||null===t)return t;if(i.has(t))return t;i.set(t,!0);const{checkEmptyFn:a,filterArray:u=!0}=n||{},s=a||r;for(const r in t){const a=t[r],l=h(a);if("object"===l)e(a,n,i),s(a)&&delete t[r];else if("array"===l&&u){for(let t=0;t<a.length;t++){const r=a[t];"object"==typeof r&&null!==r&&e(r,n,i),s(r)}t[r]=o(a),s(t[r])&&delete t[r]}else s(a)&&delete t[r]}return t},e.throttle=v,e.timeAgo=function(e,t){const n=+Date.now()-e,r=Math.floor(n/1e3),o=Math.floor(r/60),i=Math.floor(o/60),a=Math.floor(i/24),u=Math.floor(a/30),s=Math.floor(a/365);return(null==t?void 0:t.open)?null==t?void 0:t.cb({seconds:r,minutes:o,hours:i,days:a,months:u,years:s}):r<60?"刚刚":o<60?`${o} 分钟前`:i<24?`${i} 小时前`:a<30?`${a} 天前`:u<12?`${u} 个月前`:`${s} 年前`},e.timeFromNow=function(e,t){const n=e-+Date.now(),r=Math.floor(n/1e3),o=Math.floor(r/60),i=Math.floor(o/60),a=Math.floor(i/24),u=Math.floor(a/30),s=Math.floor(a/365);return(null==t?void 0:t.open)?null==t?void 0:t.cb({seconds:r,minutes:o,hours:i,days:a,months:u,years:s}):r<0?"已过期":r<60?"刚刚":o<60?`${o} 分钟后`:i<24?`${i} 小时后`:a<30?`${a} 天后`:u<12?`${u} 个月后`:`${s} 年后`},e.toArray=s,e.toString=a,e.toTree=function(e,t){if(!Array.isArray(e))return[];let n=[],r={};return e.forEach(e=>{r[e.id]=Object.assign(Object.assign({},e),{children:[]})}),e.forEach(e=>{r[e[t]]?r[e[t]].children.push(r[e.id]):n.push(r[e.id])}),n},e.uniqueArray=function(e){return Array.isArray(e)?[...new Set(e)]:e},e.weekInMonthCount=function(){let e,t=new Date((new Date).setDate(1)||(new Date).setDate(1));e=0===t.getDay()?6:t.getDay()-1,t.setMonth(t.getMonth()+1),t.setDate(0);let n=t.getDate()+e;return Math.ceil(n/7)},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
