@lntvow/utils 4.1.0 → 4.2.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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @ts-self-types="./esm-bundler.d.ts" */
|
|
2
|
-
function ge(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function A(e){return e!==null&&typeof e=="object"}var V=Object.prototype.toString,h=e=>V.call(e),k=e=>h(e).slice(8,-1),C=e=>typeof e=="string",l=e=>typeof e=="number"&&Number.isFinite(e),he=e=>typeof e=="boolean",Oe=e=>e===null,we=e=>e===void 0,F=e=>typeof e=="symbol",d=Array.isArray,S=e=>typeof e=="function",v=e=>h(e)==="[object Map]",Y=e=>h(e)==="[object Set]",U=e=>h(e)==="[object Date]",K=e=>h(e)==="[object RegExp]",L=e=>A(e)&&S(e?.then)&&S(e?.catch),w=e=>e==null,$e=e=>e!=null,Ae=(e,t)=>e!==t;function y(e){return h(e)==="[object Object]"}function O(e){return d(e)?e:[e]}function Le(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function _e(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=_[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function ze(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=_.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function Ze(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Ge(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function Ve(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function $(e){let t=new WeakMap;function r(n){if(!A(n))return n;if(U(n))return new Date(n);if(K(n))return new RegExp(n);if(L(n))return n;if(t.has(n))return t.get(n);if(v(n)){let a=new Map;return t.set(n,a),n.forEach((f,g)=>a.set(r(g),r(f))),a}if(Y(n)){let a=new Set;return t.set(n,a),n.forEach(f=>a.add(r(f))),a}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let c=Object.getOwnPropertyDescriptors(n);for(let a of Reflect.ownKeys(c)){let f=c[a];f.get||f.set?Object.defineProperty(o,a,f):Object.defineProperty(o,a,{...f,value:r(f.value)})}return o}return r(e)}function W(e,t,r={}){return H(z(e,r),z(t,r),r)}function H(e,t,r){return d(e)?Q(e,t,r):X(e,t,r)}function X(e,t,r){if(!y(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(y(e[o])||d(e[o]))&&(y(t[o])||d(t[o]))?e[o]=H(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Q(e,t,r){let{mergeStrategy:n="replace"}=r;if(d(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function z(e,t){let{deepClone:r=!0}=t;return r?$(e):e}var R=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function m(e,t){throw new R(`[${e}] ${t}`)}function Z(e,t){let r=C(e)?new R(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var at=({from:e,replacement:t,version:r,type:n="API"})=>{Z(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function mt(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${k(n)} with value ${n}.`;m(e,o)}function pt(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${k(n)} with value ${n}.`;Z(e,o)}var j=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},T=(e,...t)=>{j("info",e,...t)};T.info=(e,...t)=>{j("info",e,...t)};T.error=(e,...t)=>{j("error",e,...t)};T.warn=(e,...t)=>{j("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=T);function J(e,t){let{decode:r=!0}=t||{},n={};e.startsWith("?")&&(e=e.slice(1)),e.includes("?")&&(e=e.slice(e.indexOf("?")+1));let o=e.split("&").filter(Boolean);for(let c of o){let[a,f]=c.split("=");n[a]=r?decodeURIComponent(f):f}return n}function G(e,t){let{encode:r=!0}=t||{},n=[];for(let o in e){let c=e[o];n.push(`${o}=${r?encodeURIComponent(c):c}`)}return n.join("&")}function ee(e,t,r){let n=W({encode:!0},{...r}),o=G(t,n);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${o}`:`${e}&${o}`:`${e}?${o}`}var lt={parse:J,stringify:G,appendQueryString:ee};function yt(e,t=500){let r=null;return function(...n){if(w(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function $t(e){return!w(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function At(e){return!w(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function St(e){return!w(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function Rt(e){return/^[\dA-Z_]+$/.test(e)}function q(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:c=!1}=r,a={};return y(e)&&O(t).forEach(g=>{F(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!c&&(n?te(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(a[g]=$(e[g]))}),a}function te(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Bt(e,t){if(!y(e))return{};let r=$(e),n=O(t),o=Object.keys(r).filter(c=>!n.includes(c));return q(r,o)}function or(e,t){return(!l(e)||e<=0)&&m("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),S(t)||m("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function ar(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}import b from"dayjs";import oe from"dayjs/plugin/customParseFormat.js";function u(e){return e[Math.floor(Math.random()*e.length)]}function p(e={}){l(e)&&(e={max:e});let{min:t=1,max:r=u(ne())}=e;re(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function re(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||m("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||m("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&m("getRandomInt",`No integer value found between ${e} and ${t}`),m("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function ne(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}b.extend(oe);function E(e={}){let{start:t="1800-01-01 00:00:00",end:r=b().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!b(t).isValid()||!b(r).isValid())&&m("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let o=b(t).year(),c=b(r).year(),a=p({min:o,max:c}),f=p({min:1,max:12}),g=p({min:1,max:31}),D=p(23),I=p(59),B=p(59),M=b(`${a}-${f}-${g} ${D}:${I}:${B}`);return M.isBefore(b(t))||M.isAfter(b(r))?E(e):M.format(n)}function x(e={}){let t=se(e),r=ae(t);me(r);let{length:n}=t;pe(n.min,n.max);let o=p(n),c=t.prefix||"";for(let a=0;a<o;a++)c+=r.charAt(Math.floor(Math.random()*r.length));return c+(t.suffix||"")}var ie=16,P=1;function se(e){let t=l(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:l(e.length)?{max:e.length,min:e.length}:{max:ie,min:P,...e.length},extra:t?[]:[...new Set(O(e.extra||[]))]}}function ae(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=O(e.extra).join(""),t}function me(e){e.length===0&&m("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function pe(e,t){Number.isInteger(e)||m("getRandomString","min must be an integer"),Number.isInteger(t)||m("getRandomString","max must be an integer"),e<P&&m("getRandomString",`Minimum length cannot be less than ${P}`),t<e&&m("getRandomString","Maximum length cannot be less than minimum length")}function ce(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${x(1)}${x({length:p({max:30,min:1})})}${x(1)}@${u(e)}`;return/\.{2,}/.test(t)?ce():t}function Cr(e={}){l(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`\u6700\u5927\u503C ${r} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${t}`);return Math.random()*(r-t)+t}function N(e,t){(!l(e)||e<=0)&&m("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!d(t)||t.length===0)&&m("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let r="";for(let n=0;n<e;n++)r+=u(t);return r}function Zr(){let e=p({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,E({format:"YYYYMMDD"}),N(3,t),N(1,[...t,"X","x"])].join("")}function Xr(){return u(["13","14","15","16","17","18","19"])+p(999999999).toString().padEnd(9,"0")}function nn(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${x({length:{min:4,max:8}})}`,`?id=${p()}`,`?page=${x({length:{min:2,max:4}})}`,`?query=${x({length:{min:5,max:6}})}`,`?search=${x({length:{min:1,max:4}})}`,`?token=${x({length:{min:16,max:16}})}`];return`${u(e)}${x({length:{min:5,max:25}})}${u(t)}${u(r)}`}function Sn(e){return/^\d+$/.test(e)}function Rn(e){return/^[A-Z]+$/i.test(e)}function jn(e){return/^[A-Z]+$/.test(e)}function Tn(e){return/^[\dA-Z]+$/.test(e)}function Mn(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function kn(e){return/^[a-z]+$/.test(e)}function En(e){return/^[\da-z]+$/.test(e)}function Pn(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function Nn(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function Cn(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Fn(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function vn(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function Yn(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Un(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function _n(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function zn(e){return/^[1-9]\d*$/.test(e)}function Wn(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Hn(e){return/^-[1-9]\d*$/.test(e)}function Zn(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import fe from"dayjs";function Vn(e){return/^1[3-9]\d{9}$/.test(e)}function Xn(e){return/^https?:\/\/\S+$/i.test(e)}function Qn(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function Jn(e){return e===""}function ue(e,t="YYYY-MM-DD HH:mm:ss"){return fe(e,t,!0).isValid()}function eo(e){return/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e)&&ue(e.slice(6,14),"YYYYMMDD")}export{ze as base64Decode,_e as base64Encode,O as castArray,Ze as compose,Ge as composeRight,Ve as debounce,Z as debugWarn,pt as debugWarnInvalidTypeMessage,Le as decimalToBinary,$ as deepClone,W as deepMerge,at as deprecated,or as generateRandomArray,ar as generateRandomColor,E as generateRandomDate,ce as generateRandomEmail,Cr as generateRandomFloat,Zr as generateRandomIdCard,Xr as generateRandomMobilePhone,N as generateRandomStringFromSource,p as getRandomInt,u as getRandomItem,x as getRandomString,nn as getRandomUrl,Ae as hasChanged,d as isArray,he as isBoolean,Nn as isChineseString,U as isDate,ue as isDateString,$e as isDef,Qn as isEmail,Jn as isEmptyString,Rn as isEnglishAphabet,Cn as isFloat,S as isFunction,eo as isIdCard,_n as isInteger,kn as isLowerCase,En as isLowerCaseAndNumber,Pn as isLowerCaseAndNumberAndChinese,v as isMap,Vn as isMobilePhone,Yn as isNegativeFloat,Hn as isNegativeInteger,vn as isNonNegativeFloat,Wn as isNonNegativeInteger,Un as isNonPositiveFloat,Zn as isNonPositiveInteger,Oe as isNull,l as isNumber,Sn as isNumberOrNumberString,ge as isObject,A as isObjectLike,y as isPlainObject,Fn as isPositiveFloat,zn as isPositiveInteger,L as isPromise,K as isRegExp,Y as isSet,C as isString,F as isSymbol,Xn as isURL,w as isUndef,we as isUndefined,jn as isUpperCase,Tn as isUpperCaseAndNumber,Mn as isUpperCaseAndNumberAndChinese,V as objectToString,Bt as omit,q as pick,lt as qs,yt as throttle,m as throwError,mt as throwErrorInvalidTypeMessage,h as toTypeString,k as toTypeValue,At as validatorChineseOrEnglish,$t as validatorChineseOrEnglishOrNumber,St as validatorUppercaseOrNumbersOrSpecial,Rt as validatorUppercaseOrNumbersOrUnderline};
|
|
2
|
+
function he(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function M(e){return e!==null&&typeof e=="object"}var te=Object.prototype.toString,w=e=>te.call(e),C=e=>w(e).slice(8,-1),k=e=>typeof e=="string",p=e=>typeof e=="number"&&Number.isFinite(e),_=e=>typeof e=="boolean",Se=e=>e===null,j=e=>e===void 0,L=e=>typeof e=="symbol",d=Array.isArray,P=e=>typeof e=="function",K=e=>w(e)==="[object Map]",B=e=>w(e)==="[object Set]",W=e=>w(e)==="[object Date]",z=e=>w(e)==="[object RegExp]",G=e=>M(e)&&P(e?.then)&&P(e?.catch),R=e=>e==null,Te=e=>e!=null,Ee=(e,t)=>e!==t;function b(e){return w(e)==="[object Object]"}function A(e){return d(e)?e:[e]}function ze(e){let t=[],r,n="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)n+=t.pop().toString();return n}var H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Ge(e){let t="",r="";for(let o=0;o<e.length;o++)r+=e[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<r.length;o+=6)t+=H[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function He(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=H.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function qe(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Ve(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function et(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function S(e){let t=new WeakMap;function r(n){if(!M(n))return n;if(W(n))return new Date(n);if(z(n))return new RegExp(n);if(G(n))return n;if(t.has(n))return t.get(n);if(K(n)){let m=new Map;return t.set(n,m),n.forEach((f,l)=>m.set(r(l),r(f))),m}if(B(n)){let m=new Set;return t.set(n,m),n.forEach(f=>m.add(r(f))),m}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let c=Object.getOwnPropertyDescriptors(n);for(let m of Reflect.ownKeys(c)){let f=c[m];f.get||f.set?Object.defineProperty(o,m,f):Object.defineProperty(o,m,{...f,value:r(f.value)})}return o}return r(e)}function X(e,t,r={}){return q(Z(e,r),Z(t,r),r)}function q(e,t,r){return d(e)?ne(e,t,r):re(e,t,r)}function re(e,t,r){if(!b(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(b(e[o])||d(e[o]))&&(b(t[o])||d(t[o]))?e[o]=q(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function ne(e,t,r){let{mergeStrategy:n="replace"}=r;if(d(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function Z(e,t){let{deepClone:r=!0}=t;return r?S(e):e}var N=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function a(e,t){throw new N(`[${e}] ${t}`)}function V(e,t){let r=k(e)?new N(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var ut=({from:e,replacement:t,version:r,type:n="API"})=>{V(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function pt(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${C(n)} with value ${n}.`;a(e,o)}function lt(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${C(n)} with value ${n}.`;V(e,o)}var D=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},I=(e,...t)=>{D("info",e,...t)};I.info=(e,...t)=>{D("info",e,...t)};I.error=(e,...t)=>{D("error",e,...t)};I.warn=(e,...t)=>{D("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=I);function oe(e,t){let{decode:r=!0}=t||{},n={};e.startsWith("?")&&(e=e.slice(1)),e.includes("?")&&(e=e.slice(e.indexOf("?")+1));let o=e.split("&").filter(Boolean);for(let c of o){let[m,f]=c.split("=");n[m]=r?decodeURIComponent(f):f}return n}function Q(e,t){let{encode:r=!0}=t||{},n=[];for(let o in e){let c=e[o];n.push(`${o}=${r?encodeURIComponent(c):c}`)}return n.join("&")}function ie(e,t,r){let n=X({encode:!0},{...r}),o=Q(t,n);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${o}`:`${e}&${o}`:`${e}?${o}`}var yt={parse:oe,stringify:Q,appendQueryString:ie};function At(e,t=500){let r=null;return function(...n){if(R(r))return r=Date.now(),e.apply(this,n);let o=Date.now();if(o-r>=t)return r=o,e.apply(this,n)}}function Tt(e){return!R(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function Et(e){return!R(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function jt(e){return!R(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function Mt(e){return/^[\dA-Z_]+$/.test(e)}function It(e){se(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:c}=e,m,f=c?new Promise((T,O)=>{let E=()=>O(new Error("Operation Cancelled"));c.addEventListener("abort",E),m=()=>c.removeEventListener("abort",E)}):null;return new Promise((T,O)=>{(async()=>{for(let y=1;y<=r;y++){if(c?.aborted)return O(new Error("Operation Cancelled"));try{let $=await Promise.race(f?[t(),f]:[t()]);return T($)}catch($){if($ instanceof Error&&$.message==="Operation Cancelled"||y===r)return O($);let U=o?n*2**(y-1):n;log("withRetry",`Attempt ${y}/${r} failed. Retrying in ${U}ms...`),await new Promise(ee=>setTimeout(ee,U))}}})()}).finally(()=>m?.())}function se(e){b(e)||a("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&a("withRetry",'"fn" must be a function that returns a Promise'),!j(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&a("withRetry",'"maxAttempts" must be a positive integer'),!j(e.retryDelay)&&(!p(e.retryDelay)||e.retryDelay<0)&&a("withRetry",'"retryDelay" must be a non-negative number'),!j(e.enableExponentialBackoff)&&!_(e.enableExponentialBackoff)&&a("withRetry",'"enableExponentialBackoff" must be a boolean'),!j(e.signal)&&typeof e.signal!="object"&&a("withRetry",'"signal" must be an AbortSignal')}function J(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:c=!1}=r,m={};return b(e)&&A(t).forEach(l=>{L(l)&&!o||!(n?l in e:Object.hasOwn(e,l))||!c&&(n?ae(e,l):Object.getOwnPropertyDescriptor(e,l))?.enumerable===!1||(m[l]=S(e[l]))}),m}function ae(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function ir(e,t){if(!b(e))return{};let r=S(e),n=A(t),o=Object.keys(r).filter(c=>!n.includes(c));return J(r,o)}function gr(e,t){return(!p(e)||e<=0)&&a("generateRandomArray","num must be greater than 0"),P(t)||a("generateRandomArray","cb must be a function"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function br(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}import h from"dayjs";import fe from"dayjs/plugin/customParseFormat.js";function g(e){return e[Math.floor(Math.random()*e.length)]}function u(e={}){p(e)&&(e={max:e});let{min:t=1,max:r=g(ce())}=e;me(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function me(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||a("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||a("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&a("getRandomInt",`No integer value found between ${e} and ${t}`),a("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function ce(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}h.extend(fe);function v(e={}){let{start:t="1800-01-01 00:00:00",end:r=h().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!h(t).isValid()||!h(r).isValid())&&a("generateRandomDate","start and end parameters must be valid date format");let o=h(t).year(),c=h(r).year(),m=u({min:o,max:c}),f=u({min:1,max:12}),l=u({min:1,max:31}),T=u(23),O=u(59),E=u(59),y=h(`${m}-${f}-${l} ${T}:${O}:${E}`);return y.isBefore(h(t))||y.isAfter(h(r))?v(e):y.format(n)}function x(e={}){let t=pe(e),r=le(t);ge(r);let{length:n}=t;de(n.min,n.max);let o=u(n),c=t.prefix||"";for(let m=0;m<o;m++)c+=r.charAt(Math.floor(Math.random()*r.length));return c+(t.suffix||"")}var ue=16,F=1;function pe(e){let t=p(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:p(e.length)?{max:e.length,min:e.length}:{max:ue,min:F,...e.length},extra:t?[]:[...new Set(A(e.extra||[]))]}}function le(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=A(e.extra).join(""),t}function ge(e){e.length===0&&a("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function de(e,t){Number.isInteger(e)||a("getRandomString","min must be an integer"),Number.isInteger(t)||a("getRandomString","max must be an integer"),e<F&&a("getRandomString",`Minimum length cannot be less than ${F}`),t<e&&a("getRandomString","Maximum length cannot be less than minimum length")}function xe(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${x(1)}${x({length:u({max:30,min:1})})}${x(1)}@${g(e)}`;return/\.{2,}/.test(t)?xe():t}function zr(e={}){p(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if(t===r)return t;if(t>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${t}`);return Math.random()*(r-t)+t}function Y(e,t){(!p(e)||e<=0)&&a("generateRandomStringFromSource","num must be greater than 0"),(!d(t)||t.length===0)&&a("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=g(t);return r}function rn(){let e=u({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,v({format:"YYYYMMDD"}),Y(3,t),Y(1,[...t,"X","x"])].join("")}function mn(){return g(["13","14","15","16","17","18","19"])+u(999999999).toString().padEnd(9,"0")}function gn(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${x({length:{min:4,max:8}})}`,`?id=${u()}`,`?page=${x({length:{min:2,max:4}})}`,`?query=${x({length:{min:5,max:6}})}`,`?search=${x({length:{min:1,max:4}})}`,`?token=${x({length:{min:16,max:16}})}`];return`${g(e)}${x({length:{min:5,max:25}})}${g(t)}${g(r)}`}function In(e){return/^\d+$/.test(e)}function Cn(e){return/^[A-Z]+$/i.test(e)}function vn(e){return/^[A-Z]+$/.test(e)}function Fn(e){return/^[\dA-Z]+$/.test(e)}function Yn(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function Un(e){return/^[a-z]+$/.test(e)}function _n(e){return/^[\da-z]+$/.test(e)}function Ln(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function Kn(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function zn(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Gn(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Hn(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function Zn(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Xn(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Qn(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Jn(e){return/^[1-9]\d*$/.test(e)}function eo(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function to(e){return/^-[1-9]\d*$/.test(e)}function ro(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var so=e=>{if(!k(e))return!1;let t=e.trim();if(t===""||t.includes("e")||t.includes("E")||t.includes("0x")||t.includes("0X")||t.includes("0o")||t.includes("0O")||t.includes("0b")||t.includes("0B"))return!1;let r=Number(t);return!(!Number.isFinite(r)||r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};import be from"dayjs";function fo(e){return/^1[3-9]\d{9}$/.test(e)}function uo(e){return/^https?:\/\/\S+$/i.test(e)}function po(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function lo(e){return e===""}function ye(e,t="YYYY-MM-DD HH:mm:ss"){return be(e,t,!0).isValid()}function go(e){return/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(e)&&ye(e.slice(6,14),"YYYYMMDD")}export{N as UtilsError,He as base64Decode,Ge as base64Encode,A as castArray,qe as compose,Ve as composeRight,et as debounce,V as debugWarn,lt as debugWarnInvalidTypeMessage,ze as decimalToBinary,S as deepClone,X as deepMerge,ut as deprecated,gr as generateRandomArray,br as generateRandomColor,v as generateRandomDate,xe as generateRandomEmail,zr as generateRandomFloat,rn as generateRandomIdCard,mn as generateRandomMobilePhone,Y as generateRandomStringFromSource,u as getRandomInt,g as getRandomItem,x as getRandomString,gn as getRandomUrl,Ee as hasChanged,d as isArray,_ as isBoolean,Kn as isChineseString,W as isDate,ye as isDateString,Te as isDef,po as isEmail,lo as isEmptyString,Cn as isEnglishAphabet,zn as isFloat,P as isFunction,go as isIdCard,Qn as isInteger,Un as isLowerCase,_n as isLowerCaseAndNumber,Ln as isLowerCaseAndNumberAndChinese,K as isMap,fo as isMobilePhone,Zn as isNegativeFloat,to as isNegativeInteger,Hn as isNonNegativeFloat,eo as isNonNegativeInteger,Xn as isNonPositiveFloat,ro as isNonPositiveInteger,Se as isNull,p as isNumber,In as isNumberOrNumberString,he as isObject,M as isObjectLike,b as isPlainObject,Gn as isPositiveFloat,Jn as isPositiveInteger,G as isPromise,z as isRegExp,B as isSet,k as isString,so as isStringNumber,L as isSymbol,uo as isURL,R as isUndef,j as isUndefined,vn as isUpperCase,Fn as isUpperCaseAndNumber,Yn as isUpperCaseAndNumberAndChinese,te as objectToString,ir as omit,J as pick,yt as qs,At as throttle,a as throwError,pt as throwErrorInvalidTypeMessage,w as toTypeString,C as toTypeValue,Et as validatorChineseOrEnglish,Tt as validatorChineseOrEnglishOrNumber,jt as validatorUppercaseOrNumbersOrSpecial,Mt as validatorUppercaseOrNumbersOrUnderline,It as withRetry};
|
package/dist/utils.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lntvowUtils=(()=>{var Bt=Object.create;var ft=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Jt=Object.getOwnPropertyNames;var Qt=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var Lt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ee=(t,e)=>{for(var n in e)ft(t,n,{get:e[n],enumerable:!0})},_t=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Jt(e))!te.call(t,i)&&i!==n&&ft(t,i,{get:()=>e[i],enumerable:!(r=Gt(e,i))||r.enumerable});return t};var Mt=(t,e,n)=>(n=t!=null?Bt(Qt(t)):{},_t(e||!t||!t.__esModule?ft(n,"default",{value:t,enumerable:!0}):n,t)),ne=t=>_t(ft({},"__esModule",{value:!0}),t);var Ct=Lt((Rt,Et)=>{"use strict";(function(t,e){typeof Rt=="object"&&typeof Et<"u"?Et.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Rt,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",y="minute",l="hour",b="day",h="week",T="month",X="quarter",I="year",_="date",at="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,x=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(c){var s=["th","st","nd","rd"],o=c%100;return"["+c+(s[(o-20)%10]||s[o]||s[0])+"]"}},M=function(c,s,o){var u=String(c);return!u||u.length>=s?c:""+Array(s+1-u.length).join(o)+c},W={s:M,z:function(c){var s=-c.utcOffset(),o=Math.abs(s),u=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+M(u,2,"0")+":"+M(a,2,"0")},m:function c(s,o){if(s.date()<o.date())return-c(o,s);var u=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(u,T),f=o-a<0,m=s.clone().add(u+(f?-1:1),T);return+(-(u+(o-a)/(f?a-m:m-a))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:T,y:I,w:h,d:b,D:_,h:l,m:y,s:i,ms:r,Q:X}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},j="en",N={};N[j]=O;var z="$isDayjsObject",P=function(c){return c instanceof Y||!(!c||!c[z])},R=function c(s,o,u){var a;if(!s)return j;if(typeof s=="string"){var f=s.toLowerCase();N[f]&&(a=f),o&&(N[f]=o,a=f);var m=s.split("-");if(!a&&m.length>1)return c(m[0])}else{var d=s.name;N[d]=s,a=d}return!u&&a&&(j=a),a||!u&&j},$=function(c,s){if(P(c))return c.clone();var o=typeof s=="object"?s:{};return o.date=c,o.args=arguments,new Y(o)},g=W;g.l=R,g.i=P,g.w=function(c,s){return $(c,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var Y=function(){function c(o){this.$L=R(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[z]=!0}var s=c.prototype;return s.parse=function(o){this.$d=function(u){var a=u.date,f=u.utc;if(a===null)return new Date(NaN);if(g.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var m=a.match(p);if(m){var d=m[2]-1||0,w=(m[7]||"0").substring(0,3);return f?new Date(Date.UTC(m[1],d,m[3]||1,m[4]||0,m[5]||0,m[6]||0,w)):new Date(m[1],d,m[3]||1,m[4]||0,m[5]||0,m[6]||0,w)}}return new Date(a)}(o),this.init()},s.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},s.$utils=function(){return g},s.isValid=function(){return this.$d.toString()!==at},s.isSame=function(o,u){var a=$(o);return this.startOf(u)<=a&&a<=this.endOf(u)},s.isAfter=function(o,u){return $(o)<this.startOf(u)},s.isBefore=function(o,u){return this.endOf(u)<$(o)},s.$g=function(o,u,a){return g.u(o)?this[u]:this.set(a,o)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(o,u){var a=this,f=!!g.u(u)||u,m=g.p(o),d=function(K,k){var F=g.w(a.$u?Date.UTC(a.$y,k,K):new Date(a.$y,k,K),a);return f?F:F.endOf(b)},w=function(K,k){return g.w(a.toDate()[K].apply(a.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(k)),a)},S=this.$W,v=this.$M,C=this.$D,J="set"+(this.$u?"UTC":"");switch(m){case I:return f?d(1,0):d(31,11);case T:return f?d(1,v):d(0,v+1);case h:var q=this.$locale().weekStart||0,nt=(S<q?S+7:S)-q;return d(f?C-nt:C+(6-nt),v);case b:case _:return w(J+"Hours",0);case l:return w(J+"Minutes",1);case y:return w(J+"Seconds",2);case i:return w(J+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,u){var a,f=g.p(o),m="set"+(this.$u?"UTC":""),d=(a={},a[b]=m+"Date",a[_]=m+"Date",a[T]=m+"Month",a[I]=m+"FullYear",a[l]=m+"Hours",a[y]=m+"Minutes",a[i]=m+"Seconds",a[r]=m+"Milliseconds",a)[f],w=f===b?this.$D+(u-this.$W):u;if(f===T||f===I){var S=this.clone().set(_,1);S.$d[d](w),S.init(),this.$d=S.set(_,Math.min(this.$D,S.daysInMonth())).$d}else d&&this.$d[d](w);return this.init(),this},s.set=function(o,u){return this.clone().$set(o,u)},s.get=function(o){return this[g.p(o)]()},s.add=function(o,u){var a,f=this;o=Number(o);var m=g.p(u),d=function(v){var C=$(f);return g.w(C.date(C.date()+Math.round(v*o)),f)};if(m===T)return this.set(T,this.$M+o);if(m===I)return this.set(I,this.$y+o);if(m===b)return d(1);if(m===h)return d(7);var w=(a={},a[y]=e,a[l]=n,a[i]=t,a)[m]||1,S=this.$d.getTime()+o*w;return g.w(S,this)},s.subtract=function(o,u){return this.add(-1*o,u)},s.format=function(o){var u=this,a=this.$locale();if(!this.isValid())return a.invalidDate||at;var f=o||"YYYY-MM-DDTHH:mm:ssZ",m=g.z(this),d=this.$H,w=this.$m,S=this.$M,v=a.weekdays,C=a.months,J=a.meridiem,q=function(k,F,B,Q){return k&&(k[F]||k(u,f))||B[F].slice(0,Q)},nt=function(k){return g.s(d%12||12,k,"0")},K=J||function(k,F,B){var Q=k<12?"AM":"PM";return B?Q.toLowerCase():Q};return f.replace(x,function(k,F){return F||function(B){switch(B){case"YY":return String(u.$y).slice(-2);case"YYYY":return g.s(u.$y,4,"0");case"M":return S+1;case"MM":return g.s(S+1,2,"0");case"MMM":return q(a.monthsShort,S,C,3);case"MMMM":return q(C,S);case"D":return u.$D;case"DD":return g.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return q(a.weekdaysMin,u.$W,v,2);case"ddd":return q(a.weekdaysShort,u.$W,v,3);case"dddd":return v[u.$W];case"H":return String(d);case"HH":return g.s(d,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return K(d,w,!0);case"A":return K(d,w,!1);case"m":return String(w);case"mm":return g.s(w,2,"0");case"s":return String(u.$s);case"ss":return g.s(u.$s,2,"0");case"SSS":return g.s(u.$ms,3,"0");case"Z":return m}return null}(k)||m.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,u,a){var f,m=this,d=g.p(u),w=$(o),S=(w.utcOffset()-this.utcOffset())*e,v=this-w,C=function(){return g.m(m,w)};switch(d){case I:f=C()/12;break;case T:f=C();break;case X:f=C()/3;break;case h:f=(v-S)/6048e5;break;case b:f=(v-S)/864e5;break;case l:f=v/n;break;case y:f=v/e;break;case i:f=v/t;break;default:f=v}return a?f:g.a(f)},s.daysInMonth=function(){return this.endOf(T).$D},s.$locale=function(){return N[this.$L]},s.locale=function(o,u){if(!o)return this.$L;var a=this.clone(),f=R(o,u,!0);return f&&(a.$L=f),a},s.clone=function(){return g.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},c}(),E=Y.prototype;return $.prototype=E,[["$ms",r],["$s",i],["$m",y],["$H",l],["$W",b],["$M",T],["$y",I],["$D",_]].forEach(function(c){E[c[1]]=function(s){return this.$g(s,c[0],c[1])}}),$.extend=function(c,s){return c.$i||(c(s,Y,$),c.$i=!0),$},$.locale=R,$.isDayjs=P,$.unix=function(c){return $(1e3*c)},$.en=N[j],$.Ls=N,$.p={},$})});var zt=Lt((It,Nt)=>{"use strict";(function(t,e){typeof It=="object"&&typeof Nt<"u"?Nt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(It,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,l={},b=function(p){return(p=+p)+(p>68?1900:2e3)},h=function(p){return function(x){this[p]=+x}},T=[/[+-]\d\d:?(\d\d)?|Z/,function(p){(this.zone||(this.zone={})).offset=function(x){if(!x||x==="Z")return 0;var O=x.match(/([+-]|\d\d)/g),M=60*O[1]+(+O[2]||0);return M===0?0:O[0]==="+"?-M:M}(p)}],X=function(p){var x=l[p];return x&&(x.indexOf?x:x.s.concat(x.f))},I=function(p,x){var O,M=l.meridiem;if(M){for(var W=1;W<=24;W+=1)if(p.indexOf(M(W,0,x))>-1){O=W>12;break}}else O=p===(x?"pm":"PM");return O},_={A:[y,function(p){this.afternoon=I(p,!1)}],a:[y,function(p){this.afternoon=I(p,!0)}],Q:[n,function(p){this.month=3*(p-1)+1}],S:[n,function(p){this.milliseconds=100*+p}],SS:[r,function(p){this.milliseconds=10*+p}],SSS:[/\d{3}/,function(p){this.milliseconds=+p}],s:[i,h("seconds")],ss:[i,h("seconds")],m:[i,h("minutes")],mm:[i,h("minutes")],H:[i,h("hours")],h:[i,h("hours")],HH:[i,h("hours")],hh:[i,h("hours")],D:[i,h("day")],DD:[r,h("day")],Do:[y,function(p){var x=l.ordinal,O=p.match(/\d+/);if(this.day=O[0],x)for(var M=1;M<=31;M+=1)x(M).replace(/\[|\]/g,"")===p&&(this.day=M)}],w:[i,h("week")],ww:[r,h("week")],M:[i,h("month")],MM:[r,h("month")],MMM:[y,function(p){var x=X("months"),O=(X("monthsShort")||x.map(function(M){return M.slice(0,3)})).indexOf(p)+1;if(O<1)throw new Error;this.month=O%12||O}],MMMM:[y,function(p){var x=X("months").indexOf(p)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,h("year")],YY:[r,function(p){this.year=b(p)}],YYYY:[/\d{4}/,h("year")],Z:T,ZZ:T};function at(p){var x,O;x=p,O=l&&l.formats;for(var M=(p=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function($,g,Y){var E=Y&&Y.toUpperCase();return g||O[Y]||t[Y]||O[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,s,o){return s||o.slice(1)})})).match(e),W=M.length,j=0;j<W;j+=1){var N=M[j],z=_[N],P=z&&z[0],R=z&&z[1];M[j]=R?{regex:P,parser:R}:N.replace(/^\[|\]$/g,"")}return function($){for(var g={},Y=0,E=0;Y<W;Y+=1){var c=M[Y];if(typeof c=="string")E+=c.length;else{var s=c.regex,o=c.parser,u=$.slice(E),a=s.exec(u)[0];o.call(g,a),$=$.replace(a,"")}}return function(f){var m=f.afternoon;if(m!==void 0){var d=f.hours;m?d<12&&(f.hours+=12):d===12&&(f.hours=0),delete f.afternoon}}(g),g}}return function(p,x,O){O.p.customParseFormat=!0,p&&p.parseTwoDigitYear&&(b=p.parseTwoDigitYear);var M=x.prototype,W=M.parse;M.parse=function(j){var N=j.date,z=j.utc,P=j.args;this.$u=z;var R=P[1];if(typeof R=="string"){var $=P[2]===!0,g=P[3]===!0,Y=$||g,E=P[2];g&&(E=P[2]),l=this.$locale(),!$&&E&&(l=O.Ls[E]),this.$d=function(u,a,f,m){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*u);var d=at(a)(u),w=d.year,S=d.month,v=d.day,C=d.hours,J=d.minutes,q=d.seconds,nt=d.milliseconds,K=d.zone,k=d.week,F=new Date,B=v||(w||S?1:F.getDate()),Q=w||F.getFullYear(),ut=0;w&&!S||(ut=S>0?S-1:F.getMonth());var ct,xt=C||0,yt=J||0,bt=q||0,$t=nt||0;return K?new Date(Date.UTC(Q,ut,B,xt,yt,bt,$t+60*K.offset*1e3)):f?new Date(Date.UTC(Q,ut,B,xt,yt,bt,$t)):(ct=new Date(Q,ut,B,xt,yt,bt,$t),k&&(ct=m(ct).week(k).toDate()),ct)}catch{return new Date("")}}(N,R,z,O),this.init(),E&&E!==!0&&(this.$L=this.locale(E).$L),Y&&N!=this.format(R)&&(this.$d=new Date("")),l={}}else if(R instanceof Array)for(var c=R.length,s=1;s<=c;s+=1){P[1]=R[s-1];var o=O.apply(this,P);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===c&&(this.$d=new Date(""))}else W.call(this,j)}}})});var ln={};ee(ln,{base64Decode:()=>me,base64Encode:()=>fe,castArray:()=>et,compose:()=>pe,composeRight:()=>de,debounce:()=>le,debugWarn:()=>jt,debugWarnInvalidTypeMessage:()=>be,decimalToBinary:()=>ce,deepClone:()=>ot,deepMerge:()=>kt,deprecated:()=>xe,generateRandomArray:()=>je,generateRandomColor:()=>Ye,generateRandomDate:()=>gt,generateRandomEmail:()=>Vt,generateRandomFloat:()=>_e,generateRandomIdCard:()=>Fe,generateRandomMobilePhone:()=>He,generateRandomStringFromSource:()=>ht,getRandomInt:()=>A,getRandomItem:()=>L,getRandomString:()=>Z,getRandomUrl:()=>Ue,hasChanged:()=>ue,isArray:()=>U,isBoolean:()=>oe,isChineseString:()=>Ge,isDate:()=>vt,isDateString:()=>qt,isDef:()=>ae,isEmail:()=>mn,isEmptyString:()=>pn,isEnglishAphabet:()=>We,isFloat:()=>Je,isFunction:()=>st,isIdCard:()=>dn,isInteger:()=>rn,isLowerCase:()=>Xe,isLowerCaseAndNumber:()=>qe,isLowerCaseAndNumberAndChinese:()=>Be,isMap:()=>St,isMobilePhone:()=>cn,isNegativeFloat:()=>en,isNegativeInteger:()=>an,isNonNegativeFloat:()=>tn,isNonNegativeInteger:()=>sn,isNonPositiveFloat:()=>nn,isNonPositiveInteger:()=>un,isNull:()=>ie,isNumber:()=>H,isNumberOrNumberString:()=>Ze,isObject:()=>re,isObjectLike:()=>it,isPlainObject:()=>G,isPositiveFloat:()=>Qe,isPositiveInteger:()=>on,isPromise:()=>Tt,isRegExp:()=>At,isSet:()=>Dt,isString:()=>wt,isSymbol:()=>Ot,isURL:()=>fn,isUndef:()=>rt,isUndefined:()=>se,isUpperCase:()=>ze,isUpperCaseAndNumber:()=>Ke,isUpperCaseAndNumberAndChinese:()=>Ve,objectToString:()=>Ft,omit:()=>ke,pick:()=>Yt,qs:()=>we,throttle:()=>Oe,throwError:()=>D,throwErrorInvalidTypeMessage:()=>ye,toTypeString:()=>tt,toTypeValue:()=>mt,validatorChineseOrEnglish:()=>De,validatorChineseOrEnglishOrNumber:()=>Se,validatorUppercaseOrNumbersOrSpecial:()=>ve,validatorUppercaseOrNumbersOrUnderline:()=>Ae});function re(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function it(t){return t!==null&&typeof t=="object"}var Ft=Object.prototype.toString,tt=t=>Ft.call(t),mt=t=>tt(t).slice(8,-1),wt=t=>typeof t=="string",H=t=>typeof t=="number"&&Number.isFinite(t),oe=t=>typeof t=="boolean",ie=t=>t===null,se=t=>t===void 0,Ot=t=>typeof t=="symbol",U=Array.isArray,st=t=>typeof t=="function",St=t=>tt(t)==="[object Map]",Dt=t=>tt(t)==="[object Set]",vt=t=>tt(t)==="[object Date]",At=t=>tt(t)==="[object RegExp]",Tt=t=>it(t)&&st(t?.then)&&st(t?.catch),rt=t=>t==null,ae=t=>t!=null,ue=(t,e)=>t!==e;function G(t){return tt(t)==="[object Object]"}function et(t){return U(t)?t:[t]}function ce(t){let e=[],n,r="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)r+=e.pop().toString();return r}var Ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function fe(t){let e="",n="";for(let i=0;i<t.length;i++)n+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<n.length;i+=6)e+=Ht[Number.parseInt(n.slice(i,i+6).padEnd(6,"0"),2)];let r=e.length%4;return r!==0&&(e+="=".repeat(4-r)),e}function me(t){let e="",n="";for(let r=0;r<t.length&&t[r]!=="=";r++)n+=Ht.indexOf(t[r]).toString(2).padStart(6,"0");for(let r=0;r<n.length;r+=8){let i=Number.parseInt(n.slice(r,r+8),2);i&&(e+=String.fromCharCode(i))}return e}function pe(...t){return t.reduce((e,n)=>function(...r){return n(e(...r))})}function de(...t){return t.reduce((e,n)=>function(...r){return e(n(...r))})}function le(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}}function ot(t){let e=new WeakMap;function n(r){if(!it(r))return r;if(vt(r))return new Date(r);if(At(r))return new RegExp(r);if(Tt(r))return r;if(e.has(r))return e.get(r);if(St(r)){let l=new Map;return e.set(r,l),r.forEach((b,h)=>l.set(n(h),n(b))),l}if(Dt(r)){let l=new Set;return e.set(r,l),r.forEach(b=>l.add(n(b))),l}let i=U(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));e.set(r,i);let y=Object.getOwnPropertyDescriptors(r);for(let l of Reflect.ownKeys(y)){let b=y[l];b.get||b.set?Object.defineProperty(i,l,b):Object.defineProperty(i,l,{...b,value:n(b.value)})}return i}return n(t)}function kt(t,e,n={}){return Zt(Ut(t,n),Ut(e,n),n)}function Zt(t,e,n){return U(t)?he(t,e,n):ge(t,e,n)}function ge(t,e,n){if(!G(e))return e;let r=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(G(t[i])||U(t[i]))&&(G(e[i])||U(e[i]))?t[i]=Zt(t[i],e[i],n):Object.defineProperty(t,i,r[i])}),t}function he(t,e,n){let{mergeStrategy:r="replace"}=n;if(U(e))switch(r){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Ut(t,e){let{deepClone:n=!0}=e;return n?ot(t):t}var pt=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function D(t,e){throw new pt(`[${t}] ${e}`)}function jt(t,e){let n=wt(t)?new pt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}var xe=({from:t,replacement:e,version:n,type:r="API"})=>{jt(`${r}`,`${t} is about to be deprecated in version ${n}, please use ${e} instead.`)};function ye(t,e,n,r){let i=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${mt(r)} with value ${r}.`;D(t,i)}function be(t,e,n,r){let i=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${mt(r)} with value ${r}.`;jt(t,i)}var dt=(t,e,...n)=>{if(!e)return;let r=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,r)},lt=(t,...e)=>{dt("info",t,...e)};lt.info=(t,...e)=>{dt("info",t,...e)};lt.error=(t,...e)=>{dt("error",t,...e)};lt.warn=(t,...e)=>{dt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=lt);function $e(t,e){let{decode:n=!0}=e||{},r={};t.startsWith("?")&&(t=t.slice(1)),t.includes("?")&&(t=t.slice(t.indexOf("?")+1));let i=t.split("&").filter(Boolean);for(let y of i){let[l,b]=y.split("=");r[l]=n?decodeURIComponent(b):b}return r}function Wt(t,e){let{encode:n=!0}=e||{},r=[];for(let i in t){let y=t[i];r.push(`${i}=${n?encodeURIComponent(y):y}`)}return r.join("&")}function Me(t,e,n){let r=kt({encode:!0},{...n}),i=Wt(e,r);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${i}`:`${t}&${i}`:`${t}?${i}`}var we={parse:$e,stringify:Wt,appendQueryString:Me};function Oe(t,e=500){let n=null;return function(...r){if(rt(n))return n=Date.now(),t.apply(this,r);let i=Date.now();if(i-n>=e)return n=i,t.apply(this,r)}}function Se(t){return!rt(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function De(t){return!rt(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function ve(t){return!rt(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Ae(t){return/^[\dA-Z_]+$/.test(t)}function Yt(t,e,n={}){let{includeProto:r=!1,includeSymbols:i=!0,includeNonEnum:y=!1}=n,l={};return G(t)&&et(e).forEach(h=>{Ot(h)&&!i||!(r?h in t:Object.hasOwn(t,h))||!y&&(r?Te(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(l[h]=ot(t[h]))}),l}function Te(t,e){let n=t;for(;n!==null;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function ke(t,e){if(!G(t))return{};let n=ot(t),r=et(e),i=Object.keys(n).filter(y=>!r.includes(y));return Yt(n,i)}function je(t,e){return(!H(t)||t<=0)&&D("generateRandomArray","num \u5FC5\u987B\u5927\u4E8E0"),st(e)||D("generateRandomArray","cb \u5FC5\u987B\u662F\u51FD\u6570"),Array.from({length:t}).fill(0).map((n,r)=>e(n,r))}function Ye(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var V=Mt(Ct(),1),Kt=Mt(zt(),1);function L(t){return t[Math.floor(Math.random()*t.length)]}function A(t={}){H(t)&&(t={max:t});let{min:e=1,max:n=L(Ee())}=t;Re(e,n);let r=Math.ceil(e),i=Math.floor(n);return Math.floor(Math.random()*(i-r+1)+r)}function Re(t,e){let n=Math.ceil(t),r=Math.floor(e);Number.isSafeInteger(n)||D("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(r)||D("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),r<n&&(e>=t&&D("getRandomInt",`No integer value found between ${t} and ${e}`),D("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Ee(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let n=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(n)})}V.default.extend(Kt.default);function gt(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,V.default)().format("YYYY-MM-DD HH:mm:ss"),format:r="YYYY-MM-DD HH:mm:ss"}=t;(!(0,V.default)(e).isValid()||!(0,V.default)(n).isValid())&&D("generateRandomDate","start end \u53C2\u6570\u5FC5\u987B\u662F\u5408\u6CD5\u7684\u65F6\u95F4\u683C\u5F0F");let i=(0,V.default)(e).year(),y=(0,V.default)(n).year(),l=A({min:i,max:y}),b=A({min:1,max:12}),h=A({min:1,max:31}),T=A(23),X=A(59),I=A(59),_=(0,V.default)(`${l}-${b}-${h} ${T}:${X}:${I}`);return _.isBefore((0,V.default)(e))||_.isAfter((0,V.default)(n))?gt(t):_.format(r)}function Z(t={}){let e=Ie(t),n=Ne(e);Pe(n);let{length:r}=e;Le(r.min,r.max);let i=A(r),y=e.prefix||"";for(let l=0;l<i;l++)y+=n.charAt(Math.floor(Math.random()*n.length));return y+(e.suffix||"")}var Ce=16,Pt=1;function Ie(t){let e=H(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:H(t.length)?{max:t.length,min:t.length}:{max:Ce,min:Pt,...t.length},extra:e?[]:[...new Set(et(t.extra||[]))]}}function Ne(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=et(t.extra).join(""),e}function Pe(t){t.length===0&&D("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Le(t,e){Number.isInteger(t)||D("getRandomString","min must be an integer"),Number.isInteger(e)||D("getRandomString","max must be an integer"),t<Pt&&D("getRandomString",`Minimum length cannot be less than ${Pt}`),e<t&&D("getRandomString","Maximum length cannot be less than minimum length")}function Vt(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${Z(1)}${Z({length:A({max:30,min:1})})}${Z(1)}@${L(t)}`;return/\.{2,}/.test(e)?Vt():e}function _e(t={}){H(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:r=2}=t;if(e===n)return e;if(e>n)throw new Error(`\u6700\u5927\u503C ${n} \u5E94\u5927\u4E8E\u6700\u5C0F\u503C ${e}`);return Math.random()*(n-e)+e}function ht(t,e){(!H(t)||t<=0)&&D("generateRandomStringFromSource","num \u5FC5\u987B\u5927\u4E8E0"),(!U(e)||e.length===0)&&D("generateRandomStringFromSource","source \u4E0D\u80FD\u4E3A\u7A7A\u6570\u7EC4");let n="";for(let r=0;r<t;r++)n+=L(e);return n}function Fe(){let t=A({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,gt({format:"YYYYMMDD"}),ht(3,e),ht(1,[...e,"X","x"])].join("")}function He(){return L(["13","14","15","16","17","18","19"])+A(999999999).toString().padEnd(9,"0")}function Ue(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${Z({length:{min:4,max:8}})}`,`?id=${A()}`,`?page=${Z({length:{min:2,max:4}})}`,`?query=${Z({length:{min:5,max:6}})}`,`?search=${Z({length:{min:1,max:4}})}`,`?token=${Z({length:{min:16,max:16}})}`];return`${L(t)}${Z({length:{min:5,max:25}})}${L(e)}${L(n)}`}function Ze(t){return/^\d+$/.test(t)}function We(t){return/^[A-Z]+$/i.test(t)}function ze(t){return/^[A-Z]+$/.test(t)}function Ke(t){return/^[\dA-Z]+$/.test(t)}function Ve(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function Xe(t){return/^[a-z]+$/.test(t)}function qe(t){return/^[\da-z]+$/.test(t)}function Be(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function Ge(t){return/^[\u4E00-\u9FA5]+$/.test(t)}function Je(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Qe(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function tn(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function en(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function nn(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function rn(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function on(t){return/^[1-9]\d*$/.test(t)}function sn(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function an(t){return/^-[1-9]\d*$/.test(t)}function un(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var Xt=Mt(Ct(),1);function cn(t){return/^1[3-9]\d{9}$/.test(t)}function fn(t){return/^https?:\/\/\S+$/i.test(t)}function mn(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function pn(t){return t===""}function qt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Xt.default)(t,e,!0).isValid()}function dn(t){return/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t)&&qt(t.slice(6,14),"YYYYMMDD")}return ne(ln);})();
|
|
1
|
+
"use strict";var lntvowUtils=(()=>{var Jt=Object.create;var lt=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var Ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),re=(t,e)=>{for(var n in e)lt(t,n,{get:e[n],enumerable:!0})},Ut=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of te(e))!ne.call(t,o)&&o!==n&<(t,o,{get:()=>e[o],enumerable:!(r=Qt(e,o))||r.enumerable});return t};var Ot=(t,e,n)=>(n=t!=null?Jt(ee(t)):{},Ut(e||!t||!t.__esModule?lt(n,"default",{value:t,enumerable:!0}):n,t)),oe=t=>Ut(lt({},"__esModule",{value:!0}),t);var Ct=Ft((Nt,Pt)=>{"use strict";(function(t,e){typeof Nt=="object"&&typeof Pt<"u"?Pt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Nt,function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",o="second",h="minute",l="hour",x="day",b="week",A="month",j="quarter",R="year",v="date",z="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(c){var s=["th","st","nd","rd"],i=c%100;return"["+c+(s[(i-20)%10]||s[i]||s[0])+"]"}},M=function(c,s,i){var u=String(c);return!u||u.length>=s?c:""+Array(s+1-u.length).join(i)+c},B={s:M,z:function(c){var s=-c.utcOffset(),i=Math.abs(s),u=Math.floor(i/60),a=i%60;return(s<=0?"+":"-")+M(u,2,"0")+":"+M(a,2,"0")},m:function c(s,i){if(s.date()<i.date())return-c(i,s);var u=12*(i.year()-s.year())+(i.month()-s.month()),a=s.clone().add(u,A),f=i-a<0,m=s.clone().add(u+(f?-1:1),A);return+(-(u+(i-a)/(f?a-m:m-a))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:A,y:R,w:b,d:x,D:v,h:l,m:h,s:o,ms:r,Q:j}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},Y="en",L={};L[Y]=S;var V="$isDayjsObject",F=function(c){return c instanceof N||!(!c||!c[V])},P=function c(s,i,u){var a;if(!s)return Y;if(typeof s=="string"){var f=s.toLowerCase();L[f]&&(a=f),i&&(L[f]=i,a=f);var m=s.split("-");if(!a&&m.length>1)return c(m[0])}else{var d=s.name;L[d]=s,a=d}return!u&&a&&(Y=a),a||!u&&Y},w=function(c,s){if(F(c))return c.clone();var i=typeof s=="object"?s:{};return i.date=c,i.args=arguments,new N(i)},g=B;g.l=P,g.i=F,g.w=function(c,s){return w(c,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var N=function(){function c(i){this.$L=P(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[V]=!0}var s=c.prototype;return s.parse=function(i){this.$d=function(u){var a=u.date,f=u.utc;if(a===null)return new Date(NaN);if(g.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var m=a.match(p);if(m){var d=m[2]-1||0,O=(m[7]||"0").substring(0,3);return f?new Date(Date.UTC(m[1],d,m[3]||1,m[4]||0,m[5]||0,m[6]||0,O)):new Date(m[1],d,m[3]||1,m[4]||0,m[5]||0,m[6]||0,O)}}return new Date(a)}(i),this.init()},s.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},s.$utils=function(){return g},s.isValid=function(){return this.$d.toString()!==z},s.isSame=function(i,u){var a=w(i);return this.startOf(u)<=a&&a<=this.endOf(u)},s.isAfter=function(i,u){return w(i)<this.startOf(u)},s.isBefore=function(i,u){return this.endOf(u)<w(i)},s.$g=function(i,u,a){return g.u(i)?this[u]:this.set(a,i)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(i,u){var a=this,f=!!g.u(u)||u,m=g.p(i),d=function(X,E){var H=g.w(a.$u?Date.UTC(a.$y,E,X):new Date(a.$y,E,X),a);return f?H:H.endOf(x)},O=function(X,E){return g.w(a.toDate()[X].apply(a.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(E)),a)},D=this.$W,T=this.$M,I=this.$D,Q="set"+(this.$u?"UTC":"");switch(m){case R:return f?d(1,0):d(31,11);case A:return f?d(1,T):d(0,T+1);case b:var q=this.$locale().weekStart||0,rt=(D<q?D+7:D)-q;return d(f?I-rt:I+(6-rt),T);case x:case v:return O(Q+"Hours",0);case l:return O(Q+"Minutes",1);case h:return O(Q+"Seconds",2);case o:return O(Q+"Milliseconds",3);default:return this.clone()}},s.endOf=function(i){return this.startOf(i,!1)},s.$set=function(i,u){var a,f=g.p(i),m="set"+(this.$u?"UTC":""),d=(a={},a[x]=m+"Date",a[v]=m+"Date",a[A]=m+"Month",a[R]=m+"FullYear",a[l]=m+"Hours",a[h]=m+"Minutes",a[o]=m+"Seconds",a[r]=m+"Milliseconds",a)[f],O=f===x?this.$D+(u-this.$W):u;if(f===A||f===R){var D=this.clone().set(v,1);D.$d[d](O),D.init(),this.$d=D.set(v,Math.min(this.$D,D.daysInMonth())).$d}else d&&this.$d[d](O);return this.init(),this},s.set=function(i,u){return this.clone().$set(i,u)},s.get=function(i){return this[g.p(i)]()},s.add=function(i,u){var a,f=this;i=Number(i);var m=g.p(u),d=function(T){var I=w(f);return g.w(I.date(I.date()+Math.round(T*i)),f)};if(m===A)return this.set(A,this.$M+i);if(m===R)return this.set(R,this.$y+i);if(m===x)return d(1);if(m===b)return d(7);var O=(a={},a[h]=e,a[l]=n,a[o]=t,a)[m]||1,D=this.$d.getTime()+i*O;return g.w(D,this)},s.subtract=function(i,u){return this.add(-1*i,u)},s.format=function(i){var u=this,a=this.$locale();if(!this.isValid())return a.invalidDate||z;var f=i||"YYYY-MM-DDTHH:mm:ssZ",m=g.z(this),d=this.$H,O=this.$m,D=this.$M,T=a.weekdays,I=a.months,Q=a.meridiem,q=function(E,H,J,tt){return E&&(E[H]||E(u,f))||J[H].slice(0,tt)},rt=function(E){return g.s(d%12||12,E,"0")},X=Q||function(E,H,J){var tt=E<12?"AM":"PM";return J?tt.toLowerCase():tt};return f.replace(y,function(E,H){return H||function(J){switch(J){case"YY":return String(u.$y).slice(-2);case"YYYY":return g.s(u.$y,4,"0");case"M":return D+1;case"MM":return g.s(D+1,2,"0");case"MMM":return q(a.monthsShort,D,I,3);case"MMMM":return q(I,D);case"D":return u.$D;case"DD":return g.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return q(a.weekdaysMin,u.$W,T,2);case"ddd":return q(a.weekdaysShort,u.$W,T,3);case"dddd":return T[u.$W];case"H":return String(d);case"HH":return g.s(d,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return X(d,O,!0);case"A":return X(d,O,!1);case"m":return String(O);case"mm":return g.s(O,2,"0");case"s":return String(u.$s);case"ss":return g.s(u.$s,2,"0");case"SSS":return g.s(u.$ms,3,"0");case"Z":return m}return null}(E)||m.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(i,u,a){var f,m=this,d=g.p(u),O=w(i),D=(O.utcOffset()-this.utcOffset())*e,T=this-O,I=function(){return g.m(m,O)};switch(d){case R:f=I()/12;break;case A:f=I();break;case j:f=I()/3;break;case b:f=(T-D)/6048e5;break;case x:f=(T-D)/864e5;break;case l:f=T/n;break;case h:f=T/e;break;case o:f=T/t;break;default:f=T}return a?f:g.a(f)},s.daysInMonth=function(){return this.endOf(A).$D},s.$locale=function(){return L[this.$L]},s.locale=function(i,u){if(!i)return this.$L;var a=this.clone(),f=P(i,u,!0);return f&&(a.$L=f),a},s.clone=function(){return g.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},c}(),C=N.prototype;return w.prototype=C,[["$ms",r],["$s",o],["$m",h],["$H",l],["$W",x],["$M",A],["$y",R],["$D",v]].forEach(function(c){C[c[1]]=function(s){return this.$g(s,c[0],c[1])}}),w.extend=function(c,s){return c.$i||(c(s,N,w),c.$i=!0),w},w.locale=P,w.isDayjs=F,w.unix=function(c){return w(1e3*c)},w.en=L[Y],w.Ls=L,w.p={},w})});var Kt=Ft((It,_t)=>{"use strict";(function(t,e){typeof It=="object"&&typeof _t<"u"?_t.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(It,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,o=/\d\d?/,h=/\d*[^-_:/,()\s\d]+/,l={},x=function(p){return(p=+p)+(p>68?1900:2e3)},b=function(p){return function(y){this[p]=+y}},A=[/[+-]\d\d:?(\d\d)?|Z/,function(p){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var S=y.match(/([+-]|\d\d)/g),M=60*S[1]+(+S[2]||0);return M===0?0:S[0]==="+"?-M:M}(p)}],j=function(p){var y=l[p];return y&&(y.indexOf?y:y.s.concat(y.f))},R=function(p,y){var S,M=l.meridiem;if(M){for(var B=1;B<=24;B+=1)if(p.indexOf(M(B,0,y))>-1){S=B>12;break}}else S=p===(y?"pm":"PM");return S},v={A:[h,function(p){this.afternoon=R(p,!1)}],a:[h,function(p){this.afternoon=R(p,!0)}],Q:[n,function(p){this.month=3*(p-1)+1}],S:[n,function(p){this.milliseconds=100*+p}],SS:[r,function(p){this.milliseconds=10*+p}],SSS:[/\d{3}/,function(p){this.milliseconds=+p}],s:[o,b("seconds")],ss:[o,b("seconds")],m:[o,b("minutes")],mm:[o,b("minutes")],H:[o,b("hours")],h:[o,b("hours")],HH:[o,b("hours")],hh:[o,b("hours")],D:[o,b("day")],DD:[r,b("day")],Do:[h,function(p){var y=l.ordinal,S=p.match(/\d+/);if(this.day=S[0],y)for(var M=1;M<=31;M+=1)y(M).replace(/\[|\]/g,"")===p&&(this.day=M)}],w:[o,b("week")],ww:[r,b("week")],M:[o,b("month")],MM:[r,b("month")],MMM:[h,function(p){var y=j("months"),S=(j("monthsShort")||y.map(function(M){return M.slice(0,3)})).indexOf(p)+1;if(S<1)throw new Error;this.month=S%12||S}],MMMM:[h,function(p){var y=j("months").indexOf(p)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,b("year")],YY:[r,function(p){this.year=x(p)}],YYYY:[/\d{4}/,b("year")],Z:A,ZZ:A};function z(p){var y,S;y=p,S=l&&l.formats;for(var M=(p=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(w,g,N){var C=N&&N.toUpperCase();return g||S[N]||t[N]||S[C].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,s,i){return s||i.slice(1)})})).match(e),B=M.length,Y=0;Y<B;Y+=1){var L=M[Y],V=v[L],F=V&&V[0],P=V&&V[1];M[Y]=P?{regex:F,parser:P}:L.replace(/^\[|\]$/g,"")}return function(w){for(var g={},N=0,C=0;N<B;N+=1){var c=M[N];if(typeof c=="string")C+=c.length;else{var s=c.regex,i=c.parser,u=w.slice(C),a=s.exec(u)[0];i.call(g,a),w=w.replace(a,"")}}return function(f){var m=f.afternoon;if(m!==void 0){var d=f.hours;m?d<12&&(f.hours+=12):d===12&&(f.hours=0),delete f.afternoon}}(g),g}}return function(p,y,S){S.p.customParseFormat=!0,p&&p.parseTwoDigitYear&&(x=p.parseTwoDigitYear);var M=y.prototype,B=M.parse;M.parse=function(Y){var L=Y.date,V=Y.utc,F=Y.args;this.$u=V;var P=F[1];if(typeof P=="string"){var w=F[2]===!0,g=F[3]===!0,N=w||g,C=F[2];g&&(C=F[2]),l=this.$locale(),!w&&C&&(l=S.Ls[C]),this.$d=function(u,a,f,m){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*u);var d=z(a)(u),O=d.year,D=d.month,T=d.day,I=d.hours,Q=d.minutes,q=d.seconds,rt=d.milliseconds,X=d.zone,E=d.week,H=new Date,J=T||(O||D?1:H.getDate()),tt=O||H.getFullYear(),mt=0;O&&!D||(mt=D>0?D-1:H.getMonth());var pt,xt=I||0,$t=Q||0,wt=q||0,Mt=rt||0;return X?new Date(Date.UTC(tt,mt,J,xt,$t,wt,Mt+60*X.offset*1e3)):f?new Date(Date.UTC(tt,mt,J,xt,$t,wt,Mt)):(pt=new Date(tt,mt,J,xt,$t,wt,Mt),E&&(pt=m(pt).week(E).toDate()),pt)}catch{return new Date("")}}(L,P,V,S),this.init(),C&&C!==!0&&(this.$L=this.locale(C).$L),N&&L!=this.format(P)&&(this.$d=new Date("")),l={}}else if(P instanceof Array)for(var c=P.length,s=1;s<=c;s+=1){F[1]=P[s-1];var i=S.apply(this,F);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}s===c&&(this.$d=new Date(""))}else B.call(this,Y)}}})});var bn={};re(bn,{UtilsError:()=>ft,base64Decode:()=>me,base64Encode:()=>fe,castArray:()=>nt,compose:()=>pe,composeRight:()=>le,debounce:()=>de,debugWarn:()=>jt,debugWarnInvalidTypeMessage:()=>xe,decimalToBinary:()=>ce,deepClone:()=>it,deepMerge:()=>Et,deprecated:()=>be,generateRandomArray:()=>je,generateRandomColor:()=>Ye,generateRandomDate:()=>bt,generateRandomEmail:()=>Xt,generateRandomFloat:()=>Ue,generateRandomIdCard:()=>He,generateRandomMobilePhone:()=>We,generateRandomStringFromSource:()=>yt,getRandomInt:()=>k,getRandomItem:()=>U,getRandomString:()=>Z,getRandomUrl:()=>Ze,hasChanged:()=>ue,isArray:()=>W,isBoolean:()=>St,isChineseString:()=>Qe,isDate:()=>Tt,isDateString:()=>qt,isDef:()=>ae,isEmail:()=>dn,isEmptyString:()=>gn,isEnglishAphabet:()=>Be,isFloat:()=>tn,isFunction:()=>ut,isIdCard:()=>hn,isInteger:()=>sn,isLowerCase:()=>Ge,isLowerCaseAndNumber:()=>qe,isLowerCaseAndNumberAndChinese:()=>Je,isMap:()=>At,isMobilePhone:()=>pn,isNegativeFloat:()=>rn,isNegativeInteger:()=>cn,isNonNegativeFloat:()=>nn,isNonNegativeInteger:()=>un,isNonPositiveFloat:()=>on,isNonPositiveInteger:()=>fn,isNull:()=>se,isNumber:()=>_,isNumberOrNumberString:()=>ze,isObject:()=>ie,isObjectLike:()=>at,isPlainObject:()=>K,isPositiveFloat:()=>en,isPositiveInteger:()=>an,isPromise:()=>Rt,isRegExp:()=>kt,isSet:()=>vt,isString:()=>ct,isStringNumber:()=>mn,isSymbol:()=>Dt,isURL:()=>ln,isUndef:()=>ot,isUndefined:()=>st,isUpperCase:()=>Ke,isUpperCaseAndNumber:()=>Ve,isUpperCaseAndNumberAndChinese:()=>Xe,objectToString:()=>Ht,omit:()=>Ee,pick:()=>Yt,qs:()=>Me,throttle:()=>Oe,throwError:()=>$,throwErrorInvalidTypeMessage:()=>ye,toTypeString:()=>et,toTypeValue:()=>dt,validatorChineseOrEnglish:()=>De,validatorChineseOrEnglishOrNumber:()=>Se,validatorUppercaseOrNumbersOrSpecial:()=>Ae,validatorUppercaseOrNumbersOrUnderline:()=>ve,withRetry:()=>Te});function ie(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function at(t){return t!==null&&typeof t=="object"}var Ht=Object.prototype.toString,et=t=>Ht.call(t),dt=t=>et(t).slice(8,-1),ct=t=>typeof t=="string",_=t=>typeof t=="number"&&Number.isFinite(t),St=t=>typeof t=="boolean",se=t=>t===null,st=t=>t===void 0,Dt=t=>typeof t=="symbol",W=Array.isArray,ut=t=>typeof t=="function",At=t=>et(t)==="[object Map]",vt=t=>et(t)==="[object Set]",Tt=t=>et(t)==="[object Date]",kt=t=>et(t)==="[object RegExp]",Rt=t=>at(t)&&ut(t?.then)&&ut(t?.catch),ot=t=>t==null,ae=t=>t!=null,ue=(t,e)=>t!==e;function K(t){return et(t)==="[object Object]"}function nt(t){return W(t)?t:[t]}function ce(t){let e=[],n,r="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)r+=e.pop().toString();return r}var Wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function fe(t){let e="",n="";for(let o=0;o<t.length;o++)n+=t[o].charCodeAt(0).toString(2).padStart(8,"0");for(let o=0;o<n.length;o+=6)e+=Wt[Number.parseInt(n.slice(o,o+6).padEnd(6,"0"),2)];let r=e.length%4;return r!==0&&(e+="=".repeat(4-r)),e}function me(t){let e="",n="";for(let r=0;r<t.length&&t[r]!=="=";r++)n+=Wt.indexOf(t[r]).toString(2).padStart(6,"0");for(let r=0;r<n.length;r+=8){let o=Number.parseInt(n.slice(r,r+8),2);o&&(e+=String.fromCharCode(o))}return e}function pe(...t){return t.reduce((e,n)=>function(...r){return n(e(...r))})}function le(...t){return t.reduce((e,n)=>function(...r){return e(n(...r))})}function de(t,e=500){let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r)},e)}}function it(t){let e=new WeakMap;function n(r){if(!at(r))return r;if(Tt(r))return new Date(r);if(kt(r))return new RegExp(r);if(Rt(r))return r;if(e.has(r))return e.get(r);if(At(r)){let l=new Map;return e.set(r,l),r.forEach((x,b)=>l.set(n(b),n(x))),l}if(vt(r)){let l=new Set;return e.set(r,l),r.forEach(x=>l.add(n(x))),l}let o=W(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));e.set(r,o);let h=Object.getOwnPropertyDescriptors(r);for(let l of Reflect.ownKeys(h)){let x=h[l];x.get||x.set?Object.defineProperty(o,l,x):Object.defineProperty(o,l,{...x,value:n(x.value)})}return o}return n(t)}function Et(t,e,n={}){return zt(Zt(t,n),Zt(e,n),n)}function zt(t,e,n){return W(t)?he(t,e,n):ge(t,e,n)}function ge(t,e,n){if(!K(e))return e;let r=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(o=>{(K(t[o])||W(t[o]))&&(K(e[o])||W(e[o]))?t[o]=zt(t[o],e[o],n):Object.defineProperty(t,o,r[o])}),t}function he(t,e,n){let{mergeStrategy:r="replace"}=n;if(W(e))switch(r){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Zt(t,e){let{deepClone:n=!0}=e;return n?it(t):t}var ft=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function $(t,e){throw new ft(`[${t}] ${e}`)}function jt(t,e){let n=ct(t)?new ft(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}var be=({from:t,replacement:e,version:n,type:r="API"})=>{jt(`${r}`,`${t} is about to be deprecated in version ${n}, please use ${e} instead.`)};function ye(t,e,n,r){let o=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${dt(r)} with value ${r}.`;$(t,o)}function xe(t,e,n,r){let o=`Invalid params: type check failed for params "${e}". Expected ${n}, got ${dt(r)} with value ${r}.`;jt(t,o)}var gt=(t,e,...n)=>{if(!e)return;let r=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,r)},ht=(t,...e)=>{gt("info",t,...e)};ht.info=(t,...e)=>{gt("info",t,...e)};ht.error=(t,...e)=>{gt("error",t,...e)};ht.warn=(t,...e)=>{gt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=ht);function $e(t,e){let{decode:n=!0}=e||{},r={};t.startsWith("?")&&(t=t.slice(1)),t.includes("?")&&(t=t.slice(t.indexOf("?")+1));let o=t.split("&").filter(Boolean);for(let h of o){let[l,x]=h.split("=");r[l]=n?decodeURIComponent(x):x}return r}function Bt(t,e){let{encode:n=!0}=e||{},r=[];for(let o in t){let h=t[o];r.push(`${o}=${n?encodeURIComponent(h):h}`)}return r.join("&")}function we(t,e,n){let r=Et({encode:!0},{...n}),o=Bt(e,r);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${o}`:`${t}&${o}`:`${t}?${o}`}var Me={parse:$e,stringify:Bt,appendQueryString:we};function Oe(t,e=500){let n=null;return function(...r){if(ot(n))return n=Date.now(),t.apply(this,r);let o=Date.now();if(o-n>=e)return n=o,t.apply(this,r)}}function Se(t){return!ot(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function De(t){return!ot(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function Ae(t){return!ot(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function ve(t){return/^[\dA-Z_]+$/.test(t)}function Te(t){ke(t);let{fn:e,maxAttempts:n=3,retryDelay:r=1e3,enableExponentialBackoff:o=!1,signal:h}=t,l,x=h?new Promise((A,j)=>{let R=()=>j(new Error("Operation Cancelled"));h.addEventListener("abort",R),l=()=>h.removeEventListener("abort",R)}):null;return new Promise((A,j)=>{(async()=>{for(let v=1;v<=n;v++){if(h?.aborted)return j(new Error("Operation Cancelled"));try{let z=await Promise.race(x?[e(),x]:[e()]);return A(z)}catch(z){if(z instanceof Error&&z.message==="Operation Cancelled"||v===n)return j(z);let p=o?r*2**(v-1):r;log("withRetry",`Attempt ${v}/${n} failed. Retrying in ${p}ms...`),await new Promise(y=>setTimeout(y,p))}}})()}).finally(()=>l?.())}function ke(t){K(t)||$("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&$("withRetry",'"fn" must be a function that returns a Promise'),!st(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&$("withRetry",'"maxAttempts" must be a positive integer'),!st(t.retryDelay)&&(!_(t.retryDelay)||t.retryDelay<0)&&$("withRetry",'"retryDelay" must be a non-negative number'),!st(t.enableExponentialBackoff)&&!St(t.enableExponentialBackoff)&&$("withRetry",'"enableExponentialBackoff" must be a boolean'),!st(t.signal)&&typeof t.signal!="object"&&$("withRetry",'"signal" must be an AbortSignal')}function Yt(t,e,n={}){let{includeProto:r=!1,includeSymbols:o=!0,includeNonEnum:h=!1}=n,l={};return K(t)&&nt(e).forEach(b=>{Dt(b)&&!o||!(r?b in t:Object.hasOwn(t,b))||!h&&(r?Re(t,b):Object.getOwnPropertyDescriptor(t,b))?.enumerable===!1||(l[b]=it(t[b]))}),l}function Re(t,e){let n=t;for(;n!==null;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Ee(t,e){if(!K(t))return{};let n=it(t),r=nt(e),o=Object.keys(n).filter(h=>!r.includes(h));return Yt(n,o)}function je(t,e){return(!_(t)||t<=0)&&$("generateRandomArray","num must be greater than 0"),ut(e)||$("generateRandomArray","cb must be a function"),Array.from({length:t}).fill(0).map((n,r)=>e(n,r))}function Ye(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var G=Ot(Ct(),1),Vt=Ot(Kt(),1);function U(t){return t[Math.floor(Math.random()*t.length)]}function k(t={}){_(t)&&(t={max:t});let{min:e=1,max:n=U(Pe())}=t;Ne(e,n);let r=Math.ceil(e),o=Math.floor(n);return Math.floor(Math.random()*(o-r+1)+r)}function Ne(t,e){let n=Math.ceil(t),r=Math.floor(e);Number.isSafeInteger(n)||$("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(r)||$("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),r<n&&(e>=t&&$("getRandomInt",`No integer value found between ${t} and ${e}`),$("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Pe(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let n=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(n)})}G.default.extend(Vt.default);function bt(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,G.default)().format("YYYY-MM-DD HH:mm:ss"),format:r="YYYY-MM-DD HH:mm:ss"}=t;(!(0,G.default)(e).isValid()||!(0,G.default)(n).isValid())&&$("generateRandomDate","start and end parameters must be valid date format");let o=(0,G.default)(e).year(),h=(0,G.default)(n).year(),l=k({min:o,max:h}),x=k({min:1,max:12}),b=k({min:1,max:31}),A=k(23),j=k(59),R=k(59),v=(0,G.default)(`${l}-${x}-${b} ${A}:${j}:${R}`);return v.isBefore((0,G.default)(e))||v.isAfter((0,G.default)(n))?bt(t):v.format(r)}function Z(t={}){let e=Ie(t),n=_e(e);Le(n);let{length:r}=e;Fe(r.min,r.max);let o=k(r),h=e.prefix||"";for(let l=0;l<o;l++)h+=n.charAt(Math.floor(Math.random()*n.length));return h+(e.suffix||"")}var Ce=16,Lt=1;function Ie(t){let e=_(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:_(t.length)?{max:t.length,min:t.length}:{max:Ce,min:Lt,...t.length},extra:e?[]:[...new Set(nt(t.extra||[]))]}}function _e(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=nt(t.extra).join(""),e}function Le(t){t.length===0&&$("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Fe(t,e){Number.isInteger(t)||$("getRandomString","min must be an integer"),Number.isInteger(e)||$("getRandomString","max must be an integer"),t<Lt&&$("getRandomString",`Minimum length cannot be less than ${Lt}`),e<t&&$("getRandomString","Maximum length cannot be less than minimum length")}function Xt(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${Z(1)}${Z({length:k({max:30,min:1})})}${Z(1)}@${U(t)}`;return/\.{2,}/.test(e)?Xt():e}function Ue(t={}){_(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:r=2}=t;if(e===n)return e;if(e>n)throw new Error(`Maximum value ${n} should be greater than minimum value ${e}`);return Math.random()*(n-e)+e}function yt(t,e){(!_(t)||t<=0)&&$("generateRandomStringFromSource","num must be greater than 0"),(!W(e)||e.length===0)&&$("generateRandomStringFromSource","source cannot be empty array");let n="";for(let r=0;r<t;r++)n+=U(e);return n}function He(){let t=k({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,bt({format:"YYYYMMDD"}),yt(3,e),yt(1,[...e,"X","x"])].join("")}function We(){return U(["13","14","15","16","17","18","19"])+k(999999999).toString().padEnd(9,"0")}function Ze(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${Z({length:{min:4,max:8}})}`,`?id=${k()}`,`?page=${Z({length:{min:2,max:4}})}`,`?query=${Z({length:{min:5,max:6}})}`,`?search=${Z({length:{min:1,max:4}})}`,`?token=${Z({length:{min:16,max:16}})}`];return`${U(t)}${Z({length:{min:5,max:25}})}${U(e)}${U(n)}`}function ze(t){return/^\d+$/.test(t)}function Be(t){return/^[A-Z]+$/i.test(t)}function Ke(t){return/^[A-Z]+$/.test(t)}function Ve(t){return/^[\dA-Z]+$/.test(t)}function Xe(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function Ge(t){return/^[a-z]+$/.test(t)}function qe(t){return/^[\da-z]+$/.test(t)}function Je(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function Qe(t){return/^[\u4E00-\u9FA5]+$/.test(t)}function tn(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function en(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function nn(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function rn(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function on(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function sn(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function an(t){return/^[1-9]\d*$/.test(t)}function un(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function cn(t){return/^-[1-9]\d*$/.test(t)}function fn(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var mn=t=>{if(!ct(t))return!1;let e=t.trim();if(e===""||e.includes("e")||e.includes("E")||e.includes("0x")||e.includes("0X")||e.includes("0o")||e.includes("0O")||e.includes("0b")||e.includes("0B"))return!1;let n=Number(e);return!(!Number.isFinite(n)||n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)};var Gt=Ot(Ct(),1);function pn(t){return/^1[3-9]\d{9}$/.test(t)}function ln(t){return/^https?:\/\/\S+$/i.test(t)}function dn(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function gn(t){return t===""}function qt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Gt.default)(t,e,!0).isValid()}function hn(t){return/^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dX]$/i.test(t)&&qt(t.slice(6,14),"YYYYMMDD")}return oe(bn);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript utilities",
|
|
6
6
|
"keywords": [
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@commitlint/cli": "^19.8.1",
|
|
33
33
|
"@commitlint/config-conventional": "^19.8.1",
|
|
34
|
-
"@lntvow/eslint-config": "^9.
|
|
34
|
+
"@lntvow/eslint-config": "^9.28.1",
|
|
35
35
|
"@types/node": "^24.0.3",
|
|
36
36
|
"@vitest/coverage-v8": "^3.2.4",
|
|
37
37
|
"@vitest/ui": "^3.2.4",
|
|
38
38
|
"bumpp": "^10.2.0",
|
|
39
39
|
"commitizen": "^4.3.1",
|
|
40
40
|
"cz-conventional-changelog": "^3.3.0",
|
|
41
|
-
"eslint": "^9.
|
|
41
|
+
"eslint": "^9.31.0",
|
|
42
42
|
"lint-staged": "^16.1.2",
|
|
43
43
|
"npm-run-all": "^4.1.5",
|
|
44
44
|
"prettier": "^3.6.2",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"ncu": "ncu -u --reject @types/node && pnpm install",
|
|
54
54
|
"commit": "git add . && git-cz && pnpm release -y",
|
|
55
55
|
"release": "git add . && bumpp package.json jsr.json --all --no-tag --no-print-commits",
|
|
56
|
-
"lint:eslint": "eslint
|
|
56
|
+
"lint:eslint": "eslint --fix --cache --cache-location ./node_modules/.cache/eslintcache",
|
|
57
57
|
"lint:tsc": "tsc --noEmit",
|
|
58
58
|
"lint": "run-p lint:eslint lint:tsc",
|
|
59
59
|
"dev": "vite",
|