@lntvow/utils 4.2.12 → 4.2.13
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 +1 @@
|
|
|
1
|
-
"use strict";var ce=Object.create;var N=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var ge=(e,t)=>{for(var r in t)N(e,r,{get:t[r],enumerable:!0})},V=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ue(t))!le.call(e,o)&&o!==r&&N(e,o,{get:()=>t[o],enumerable:!(n=fe(t,o))||n.enumerable});return e};var Y=(e,t,r)=>(r=e!=null?ce(pe(e)):{},V(t||!e||!e.__esModule?N(r,"default",{value:e,enumerable:!0}):r,e)),de=e=>V(N({},"__esModule",{value:!0}),e);var Mt={};ge(Mt,{UtilsError:()=>k,base64Decode:()=>Ae,base64Encode:()=>we,castArray:()=>w,compose:()=>$e,composeRight:()=>Re,debounce:()=>Se,debugWarn:()=>H,debugWarnInvalidTypeMessage:()=>Pe,decimalToBinary:()=>Oe,deepClone:()=>$,deepMerge:()=>G,deprecated:()=>Me,generateRandomArray:()=>We,generateRandomColor:()=>ze,generateRandomDate:()=>v,generateRandomEmail:()=>ie,generateRandomFloat:()=>Je,generateRandomIdCard:()=>et,generateRandomMobilePhone:()=>tt,generateRandomStringFromSource:()=>F,getRandomInt:()=>f,getRandomItem:()=>p,getRandomString:()=>d,getRandomUrl:()=>rt,hasChanged:()=>he,isArray:()=>g,isBoolean:()=>_,isChineseString:()=>ut,isDate:()=>B,isDateString:()=>ae,isDef:()=>ye,isEmail:()=>St,isEmptyString:()=>Tt,isEnglishAphabet:()=>ot,isFloat:()=>pt,isFunction:()=>j,isIdCard:()=>Et,isInteger:()=>xt,isLowerCase:()=>mt,isLowerCaseAndNumber:()=>ct,isLowerCaseAndNumberAndChinese:()=>ft,isMap:()=>L,isMobilePhone:()=>$t,isNegativeFloat:()=>dt,isNegativeInteger:()=>Ot,isNonNegativeFloat:()=>gt,isNonNegativeInteger:()=>ht,isNonPositiveFloat:()=>bt,isNonPositiveInteger:()=>wt,isNull:()=>xe,isNumber:()=>u,isNumberOrNumberString:()=>nt,isObject:()=>be,isObjectLike:()=>M,isPlainObject:()=>b,isPositiveFloat:()=>lt,isPositiveInteger:()=>yt,isPromise:()=>z,isRegExp:()=>W,isSet:()=>K,isString:()=>P,isStringNumber:()=>At,isSymbol:()=>U,isURL:()=>Rt,isUndef:()=>A,isUndefined:()=>S,isUpperCase:()=>it,isUpperCaseAndNumber:()=>st,isUpperCaseAndNumberAndChinese:()=>at,objectToString:()=>Q,omit:()=>Be,pick:()=>Z,qs:()=>De,throttle:()=>Ie,throwError:()=>s,throwErrorInvalidTypeMessage:()=>je,toTypeString:()=>O,toTypeValue:()=>D,validatorChineseOrEnglish:()=>ve,validatorChineseOrEnglishOrNumber:()=>Ce,validatorUppercaseOrNumbersOrSpecial:()=>Fe,validatorUppercaseOrNumbersOrUnderline:()=>Ye,withRetry:()=>_e});module.exports=de(Mt);function be(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function M(e){return e!==null&&typeof e=="object"}var Q=Object.prototype.toString,O=e=>Q.call(e),D=e=>O(e).slice(8,-1),P=e=>typeof e=="string",u=e=>typeof e=="number"&&Number.isFinite(e),_=e=>typeof e=="boolean",xe=e=>e===null,S=e=>e===void 0,U=e=>typeof e=="symbol",g=Array.isArray,j=e=>typeof e=="function",L=e=>O(e)==="[object Map]",K=e=>O(e)==="[object Set]",B=e=>O(e)==="[object Date]",W=e=>O(e)==="[object RegExp]",z=e=>M(e)&&j(e?.then)&&j(e?.catch),A=e=>e==null,ye=e=>e!=null,he=(e,t)=>e!==t;function b(e){return O(e)==="[object Object]"}function w(e){return g(e)?e:[e]}function Oe(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 J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function we(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+=J[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 Ae(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=J.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 $e(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Re(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function Se(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(!M(n))return n;if(B(n))return new Date(n);if(W(n))return new RegExp(n);if(z(n))return n;if(t.has(n))return t.get(n);if(L(n)){let a=new Map;return t.set(n,a),n.forEach((c,l)=>a.set(r(l),r(c))),a}if(K(n)){let a=new Set;return t.set(n,a),n.forEach(c=>a.add(r(c))),a}let o=g(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let m=Object.getOwnPropertyDescriptors(n);for(let a of Reflect.ownKeys(m)){let c=m[a];c.get||c.set?Object.defineProperty(o,a,c):Object.defineProperty(o,a,{...c,value:r(c.value)})}return o}return r(e)}function G(e,t,r={}){return te(ee(e,r),ee(t,r),r)}function te(e,t,r){return g(e)?Ee(e,t,r):Te(e,t,r)}function Te(e,t,r){if(!b(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(b(e[o])||g(e[o]))&&(b(t[o])||g(t[o]))?e[o]=te(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Ee(e,t,r){let{mergeStrategy:n="replace"}=r;if(g(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ee(e,t){let{deepClone:r=!0}=t;return r?$(e):e}var k=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function s(e,t){throw new k(`[${e}] ${t}`)}function H(e,t){let r=P(e)?new k(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var Me=({from:e,replacement:t,version:r,type:n="API"})=>{H(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function je(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${D(n)} with value ${n}.`;s(e,o)}function Pe(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${D(n)} with value ${n}.`;H(e,o)}var I=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},C=(e,...t)=>{I("info",e,...t)};C.info=(e,...t)=>{I("info",e,...t)};C.error=(e,...t)=>{I("error",e,...t)};C.warn=(e,...t)=>{I("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=C);function ke(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 m of o){let[a,c]=m.split("=");n[a]=r?decodeURIComponent(c):c}return n}function re(e,t){let{encode:r=!0}=t||{},n=[];for(let o in e){let m=e[o];n.push(`${o}=${r?encodeURIComponent(m):m}`)}return n.join("&")}function Ne(e,t,r){let n=G({encode:!0},{...r}),o=re(t,n);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${o}`:`${e}&${o}`:`${e}?${o}`}var De={parse:ke,stringify:re,appendQueryString:Ne};function Ie(e,t=500){let r=null;return function(...n){if(A(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 Ce(e){return!A(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function ve(e){return!A(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function Fe(e){return!A(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function Ye(e){return/^[\dA-Z_]+$/.test(e)}function _e(e){Ue(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:m}=e,a,c=m?new Promise((T,h)=>{let E=()=>h(ne());m.addEventListener("abort",E),a=()=>m.removeEventListener("abort",E)}):null;return new Promise((T,h)=>{(async()=>{for(let y=1;y<=r;y++){if(m?.aborted)return h(ne());try{let R=await Promise.race(c?[t(),c]:[t()]);return T(R)}catch(R){let q=o?n*2**(y-1):n;if(log("withRetry",`Attempt ${y}/${r} failed. Retrying in ${q}ms...`),R instanceof Error&&R.name==="AbortError"||y===r)return h(R);await new Promise(me=>setTimeout(me,q))}}})()}).finally(()=>a?.())}function Ue(e){b(e)||s("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&s("withRetry",'"fn" must be a function that returns a Promise'),!S(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&s("withRetry",'"maxAttempts" must be a positive integer'),!S(e.retryDelay)&&(!u(e.retryDelay)||e.retryDelay<0)&&s("withRetry",'"retryDelay" must be a non-negative number'),!S(e.enableExponentialBackoff)&&!_(e.enableExponentialBackoff)&&s("withRetry",'"enableExponentialBackoff" must be a boolean'),!S(e.signal)&&typeof e.signal!="object"&&s("withRetry",'"signal" must be an AbortSignal')}var Le="The operation was aborted";function ne(e=Le){let t=new Error(e);return t.name="AbortError",t}function Z(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:m=!1}=r,a={};return b(e)&&w(t).forEach(l=>{U(l)&&!o||!(n?l in e:Object.hasOwn(e,l))||!m&&(n?Ke(e,l):Object.getOwnPropertyDescriptor(e,l))?.enumerable===!1||(a[l]=$(e[l]))}),a}function Ke(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Be(e,t){if(!b(e))return{};let r=$(e),n=w(t),o=Object.keys(r).filter(m=>!n.includes(m));return Z(r,o)}function We(e,t){return(!u(e)||e<=0)&&s("generateRandomArray","num must be greater than 0"),j(t)||s("generateRandomArray","cb must be a function"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function ze(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var x=Y(require("dayjs"),1),oe=Y(require("dayjs/plugin/customParseFormat.js"),1);function p(e){return e[Math.floor(Math.random()*e.length)]}function f(e={}){u(e)&&(e={max:e});let{min:t=1,max:r=p(He())}=e;Ge(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function Ge(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||s("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||s("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&s("getRandomInt",`No integer value found between ${e} and ${t}`),s("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function He(){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)})}x.default.extend(oe.default);function v(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,x.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!(0,x.default)(t).isValid()||!(0,x.default)(r).isValid())&&s("generateRandomDate","start and end parameters must be valid date format");let o=(0,x.default)(t).year(),m=(0,x.default)(r).year(),a=f({min:o,max:m}),c=f({min:1,max:12}),l=f({min:1,max:31}),T=f(23),h=f(59),E=f(59),y=(0,x.default)(`${a}-${c}-${l} ${T}:${h}:${E}`);return y.isBefore((0,x.default)(t))||y.isAfter((0,x.default)(r))?v(e):y.format(n)}function d(e={}){let t=Xe(e),r=qe(t);Ve(r);let{length:n}=t;Qe(n.min,n.max);let o=f(n),m=t.prefix||"";for(let a=0;a<o;a++)m+=r.charAt(Math.floor(Math.random()*r.length));return m+(t.suffix||"")}var Ze=16,X=1;function Xe(e){let t=u(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:u(e.length)?{max:e.length,min:e.length}:{max:Ze,min:X,...e.length},extra:t?[]:[...new Set(w(e.extra||[]))]}}function qe(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=w(e.extra).join(""),t}function Ve(e){e.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Qe(e,t){Number.isInteger(e)||s("getRandomString","min must be an integer"),Number.isInteger(t)||s("getRandomString","max must be an integer"),e<X&&s("getRandomString",`Minimum length cannot be less than ${X}`),t<e&&s("getRandomString","Maximum length cannot be less than minimum length")}function ie(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${d(1)}${d({length:f({max:30,min:1})})}${d(1)}@${p(e)}`;return/\.{2,}/.test(t)?ie():t}function Je(e={}){u(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 F(e,t){(!u(e)||e<=0)&&s("generateRandomStringFromSource","num must be greater than 0"),(!g(t)||t.length===0)&&s("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=p(t);return r}function et(){let e=f({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,v({format:"YYYYMMDD"}),F(3,t),F(1,[...t,"X","x"])].join("")}function tt(){return p(["13","14","15","16","17","18","19"])+f(999999999).toString().padEnd(9,"0")}function rt(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${d({length:{min:4,max:8}})}`,`?id=${f()}`,`?page=${d({length:{min:2,max:4}})}`,`?query=${d({length:{min:5,max:6}})}`,`?search=${d({length:{min:1,max:4}})}`,`?token=${d({length:{min:16,max:16}})}`];return`${p(e)}${d({length:{min:5,max:25}})}${p(t)}${p(r)}`}function nt(e){return/^\d+$/.test(e)}function ot(e){return/^[A-Z]+$/i.test(e)}function it(e){return/^[A-Z]+$/.test(e)}function st(e){return/^[\dA-Z]+$/.test(e)}function at(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function mt(e){return/^[a-z]+$/.test(e)}function ct(e){return/^[\da-z]+$/.test(e)}function ft(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function ut(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function pt(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function lt(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function gt(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function dt(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function bt(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function xt(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function yt(e){return/^[1-9]\d*$/.test(e)}function ht(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Ot(e){return/^-[1-9]\d*$/.test(e)}function wt(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var At=e=>{if(!P(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};var se=Y(require("dayjs"),1);function $t(e){return/^1[3-9]\d{9}$/.test(e)}function Rt(e){return/^https?:\/\/\S+$/i.test(e)}function St(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function Tt(e){return e===""}function ae(e,t="YYYY-MM-DD HH:mm:ss"){return(0,se.default)(e,t,!0).isValid()}function Et(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)&&ae(e.slice(6,14),"YYYYMMDD")}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,debugWarnInvalidTypeMessage,decimalToBinary,deepClone,deepMerge,deprecated,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,isArray,isBoolean,isChineseString,isDate,isDateString,isDef,isEmail,isEmptyString,isEnglishAphabet,isFloat,isFunction,isIdCard,isInteger,isLowerCase,isLowerCaseAndNumber,isLowerCaseAndNumberAndChinese,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isNumberOrNumberString,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,isUndefined,isUpperCase,isUpperCaseAndNumber,isUpperCaseAndNumberAndChinese,objectToString,omit,pick,qs,throttle,throwError,throwErrorInvalidTypeMessage,toTypeString,toTypeValue,validatorChineseOrEnglish,validatorChineseOrEnglishOrNumber,validatorUppercaseOrNumbersOrSpecial,validatorUppercaseOrNumbersOrUnderline,withRetry});
|
|
1
|
+
"use strict";var xe=Object.create;var v=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var $e=(e,t)=>{for(var r in t)v(e,r,{get:t[r],enumerable:!0})},ae=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of we(t))!Ae.call(e,o)&&o!==r&&v(e,o,{get:()=>t[o],enumerable:!(n=he(t,o))||n.enumerable});return e};var q=(e,t,r)=>(r=e!=null?xe(Oe(e)):{},ae(t||!e||!e.__esModule?v(r,"default",{value:e,enumerable:!0}):r,e)),Re=e=>ae(v({},"__esModule",{value:!0}),e);var Ct={};$e(Ct,{UtilsError:()=>L,base64Decode:()=>Ne,base64Encode:()=>je,castArray:()=>P,compose:()=>Me,composeRight:()=>Pe,debounce:()=>De,debugWarn:()=>ne,debugWarnInvalidTypeMessage:()=>Ke,decimalToBinary:()=>Te,deepClone:()=>C,deepMerge:()=>ke,deprecated:()=>Fe,generateRandomArray:()=>Qe,generateRandomColor:()=>Xe,generateRandomDate:()=>z,generateRandomEmail:()=>de,generateRandomFloat:()=>st,generateRandomIdCard:()=>at,generateRandomMobilePhone:()=>mt,generateRandomStringFromSource:()=>G,getRandomInt:()=>p,getRandomItem:()=>w,getRandomString:()=>A,getRandomUrl:()=>ft,hasChanged:()=>Se,hasCircularReference:()=>oe,isArray:()=>d,isBoolean:()=>x,isChineseString:()=>xt,isDate:()=>ee,isDateString:()=>ye,isDef:()=>Ee,isEmail:()=>Dt,isEmptyString:()=>kt,isEnglishAphabet:()=>ut,isFloat:()=>ht,isFunction:()=>U,isIdCard:()=>It,isInteger:()=>Rt,isLowerCase:()=>dt,isLowerCaseAndNumber:()=>bt,isLowerCaseAndNumberAndChinese:()=>yt,isMap:()=>X,isMobilePhone:()=>Mt,isNegativeFloat:()=>At,isNegativeInteger:()=>Tt,isNil:()=>I,isNonNegativeFloat:()=>Ot,isNonNegativeInteger:()=>St,isNonPositiveFloat:()=>$t,isNonPositiveInteger:()=>jt,isNull:()=>B,isNumber:()=>y,isNumberOrNumberString:()=>ct,isObject:()=>S,isObjectLike:()=>_,isPlainObject:()=>h,isPositiveFloat:()=>wt,isPositiveInteger:()=>Et,isPromise:()=>re,isRegExp:()=>te,isSet:()=>J,isString:()=>T,isStringNumber:()=>Nt,isSymbol:()=>Q,isURL:()=>Pt,isUndef:()=>c,isUpperCase:()=>pt,isUpperCaseAndNumber:()=>lt,isUpperCaseAndNumberAndChinese:()=>gt,objectToString:()=>me,omit:()=>qe,pick:()=>ie,qs:()=>pe,qsStringify:()=>_e,throttle:()=>Le,throwError:()=>i,throwErrorInvalidTypeMessage:()=>Ye,toTypeString:()=>M,toTypeValue:()=>H,validatorChineseOrEnglish:()=>He,validatorChineseOrEnglishOrNumber:()=>ve,validatorUppercaseOrNumbersOrSpecial:()=>Be,validatorUppercaseOrNumbersOrUnderline:()=>Ve,withRetry:()=>We});module.exports=Re(Ct);function S(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function _(e){return e!==null&&typeof e=="object"}var me=Object.prototype.toString,M=e=>me.call(e),H=e=>M(e).slice(8,-1),T=e=>typeof e=="string",y=e=>typeof e=="number"&&Number.isFinite(e),x=e=>typeof e=="boolean",B=e=>e===null,c=e=>e===void 0,Q=e=>typeof e=="symbol",d=Array.isArray,U=e=>typeof e=="function",X=e=>M(e)==="[object Map]",J=e=>M(e)==="[object Set]",ee=e=>M(e)==="[object Date]",te=e=>M(e)==="[object RegExp]",re=e=>_(e)&&U(e?.then)&&U(e?.catch),I=e=>e==null,Ee=e=>e!=null,Se=(e,t)=>e!==t;function h(e){return M(e)==="[object Object]"}function P(e){return d(e)?e:[e]}function Te(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 fe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function je(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+=fe[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 Ne(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=fe.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 Me(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Pe(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function De(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function C(e){let t=new WeakMap;function r(n){if(!_(n))return n;if(ee(n))return new Date(n);if(te(n))return new RegExp(n);if(re(n))return n;if(t.has(n))return t.get(n);if(X(n)){let a=new Map;return t.set(n,a),n.forEach((u,g)=>a.set(r(g),r(u))),a}if(J(n)){let a=new Set;return t.set(n,a),n.forEach(u=>a.add(r(u))),a}let o=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let f=Object.getOwnPropertyDescriptors(n);for(let a of Reflect.ownKeys(f)){let u=f[a];u.get||u.set?Object.defineProperty(o,a,u):Object.defineProperty(o,a,{...u,value:r(u.value)})}return o}return r(e)}function ke(e,t,r={}){return ue(ce(e,r),ce(t,r),r)}function ue(e,t,r){return d(e)?Ce(e,t,r):Ie(e,t,r)}function Ie(e,t,r){if(!h(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(h(e[o])||d(e[o]))&&(h(t[o])||d(t[o]))?e[o]=ue(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Ce(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 ce(e,t){let{deepClone:r=!0}=t;return r?C(e):e}var L=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function i(e,t){throw new L(`[${e}] ${t}`)}function ne(e,t){let r=T(e)?new L(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var Fe=({from:e,replacement:t,version:r,type:n="API"})=>{ne(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function Ye(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${H(n)} with value ${n}.`;i(e,o)}function Ke(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${H(n)} with value ${n}.`;ne(e,o)}var V=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},W=(e,...t)=>{V("info",e,...t)};W.info=(e,...t)=>{V("info",e,...t)};W.error=(e,...t)=>{V("error",e,...t)};W.warn=(e,...t)=>{V("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=W);function _e(e,t={}){Ue(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:f=!1,skipNulls:a=!1,strictNullHandling:u=!1,commaRoundTrip:g=!1,allowEmptyArrays:D=!1,addQueryPrefix:$=!1,delimiter:k="&"}=t,O=t.allowDots??!1;f&&c(t.allowDots)&&(O=!0);let b=[],E=m=>r&&!n?encodeURIComponent(m):m,Y=m=>r?encodeURIComponent(m):m;function K(m,l){if(!c(l)){if(B(l)){if(a)return;b.push(`${E(m)}${u?"":"="}`);return}if(d(l)){if(l.length===0){D&&b.push(`${E(m)}[]`);return}if(o==="comma"){let j=n?l.map(Y).join(","):Y(l.join(","));if(l.length===1&&B(l[0])){if(a)return;b.push(`${E(m)}${g?"[]":""}${u?"":"="}`)}else l.length===1?b.push(`${E(m)}${g?"[]":""}=${j}`):b.push(`${E(m)}=${j}`);return}l.forEach((j,F)=>{let N=m;o==="indices"?N=`${m}[${F}]`:o==="brackets"&&(N=`${m}[]`),K(N,j)});return}if(S(l)){Object.keys(l).forEach(j=>{let F=m;f&&(F=F.replace(/\./g,"%2E"));let N=j;O?(f&&(N=N.replace(/\./g,"%2E")),K(`${F}.${N}`,l[j])):K(`${F}[${N}]`,l[j])});return}b.push(`${E(m)}=${Y(l)}`)}}if(!S(e))return"";oe(e)&&i("stringify","Input object contains circular references, cannot stringify"),d(e)?e.forEach((m,l)=>K(`${l}`,m)):Object.keys(e).forEach(m=>K(m,e[m]));let Z=b.join(k);return $&&Z?`?${Z}`:Z}function Ue(e={}){h(e)||i("stringify",'"options" must be a plain object'),!c(e.encode)&&!x(e.encode)&&i("stringify",'"encode" must be a boolean'),!c(e.encodeValuesOnly)&&!x(e.encodeValuesOnly)&&i("stringify",'"encodeValuesOnly" must be a boolean'),!c(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&i("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!c(e.allowDots)&&!x(e.allowDots)&&i("stringify",'"allowDots" must be a boolean'),!c(e.skipNulls)&&!x(e.skipNulls)&&i("stringify",'"skipNulls" must be a boolean'),!c(e.strictNullHandling)&&!x(e.strictNullHandling)&&i("stringify",'"strictNullHandling" must be a boolean'),!c(e.addQueryPrefix)&&!x(e.addQueryPrefix)&&i("stringify",'"addQueryPrefix" must be a boolean'),!c(e.delimiter)&&!T(e.delimiter)&&i("stringify",'"delimiter" must be a string'),!c(e.encodeDotInKeys)&&!x(e.encodeDotInKeys)&&i("stringify",'"encodeDotInKeys" must be a boolean'),!c(e.commaRoundTrip)&&!x(e.commaRoundTrip)&&i("stringify",'"commaRoundTrip" must be a boolean'),!c(e.allowEmptyArrays)&&!x(e.allowEmptyArrays)&&i("stringify",'"allowEmptyArrays" must be a boolean')}var pe={stringify:e=>(S(e)||i("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(T(e)||i("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=pe.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Le(e,t=500){let r=null;return function(...n){if(I(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 ve(e){return!I(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function He(e){return!I(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function Be(e){return!I(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function Ve(e){return/^[\dA-Z_]+$/.test(e)}function We(e){ze(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:f}=e,a,u=f?new Promise((D,$)=>{let k=()=>$(le());f.addEventListener("abort",k),a=()=>f.removeEventListener("abort",k)}):null;return new Promise((D,$)=>{(async()=>{for(let O=1;O<=r;O++){if(f?.aborted)return $(le());try{let b=await Promise.race(u?[t(),u]:[t()]);return D(b)}catch(b){let E=o?n*2**(O-1):n;if(log("withRetry",`Attempt ${O}/${r} failed. Retrying in ${E}ms...`),b instanceof Error&&b.name==="AbortError"||O===r)return $(b);await new Promise(Y=>setTimeout(Y,E))}}})()}).finally(()=>a?.())}function ze(e){h(e)||i("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&i("withRetry",'"fn" must be a function that returns a Promise'),!c(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&i("withRetry",'"maxAttempts" must be a positive integer'),!c(e.retryDelay)&&(!y(e.retryDelay)||e.retryDelay<0)&&i("withRetry",'"retryDelay" must be a non-negative number'),!c(e.enableExponentialBackoff)&&!x(e.enableExponentialBackoff)&&i("withRetry",'"enableExponentialBackoff" must be a boolean'),!c(e.signal)&&typeof e.signal!="object"&&i("withRetry",'"signal" must be an AbortSignal')}var Ge="The operation was aborted";function le(e=Ge){let t=new Error(e);return t.name="AbortError",t}function oe(e){S(e)||i("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(S(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function ie(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:f=!1}=r,a={};return h(e)&&P(t).forEach(g=>{Q(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!f&&(n?Ze(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(a[g]=C(e[g]))}),a}function Ze(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function qe(e,t){if(!h(e))return{};let r=C(e),n=P(t),o=Object.keys(r).filter(f=>!n.includes(f));return ie(r,o)}function Qe(e,t){return(!y(e)||e<=0)&&i("generateRandomArray","num must be greater than 0"),U(t)||i("generateRandomArray","cb must be a function"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function Xe(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var R=q(require("dayjs"),1),ge=q(require("dayjs/plugin/customParseFormat.js"),1);function w(e){return e[Math.floor(Math.random()*e.length)]}function p(e={}){y(e)&&(e={max:e});let{min:t=1,max:r=w(et())}=e;Je(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function Je(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||i("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||i("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&i("getRandomInt",`No integer value found between ${e} and ${t}`),i("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function et(){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)})}R.default.extend(ge.default);function z(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,R.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!(0,R.default)(t).isValid()||!(0,R.default)(r).isValid())&&i("generateRandomDate","start and end parameters must be valid date format");let o=(0,R.default)(t).year(),f=(0,R.default)(r).year(),a=p({min:o,max:f}),u=p({min:1,max:12}),g=p({min:1,max:31}),D=p(23),$=p(59),k=p(59),O=(0,R.default)(`${a}-${u}-${g} ${D}:${$}:${k}`);return O.isBefore((0,R.default)(t))||O.isAfter((0,R.default)(r))?z(e):O.format(n)}function A(e={}){let t=rt(e),r=nt(t);ot(r);let{length:n}=t;it(n.min,n.max);let o=p(n),f=t.prefix||"";for(let a=0;a<o;a++)f+=r.charAt(Math.floor(Math.random()*r.length));return f+(t.suffix||"")}var tt=16,se=1;function rt(e){let t=y(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:y(e.length)?{max:e.length,min:e.length}:{max:tt,min:se,...e.length},extra:t?[]:[...new Set(P(e.extra||[]))]}}function nt(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=P(e.extra).join(""),t}function ot(e){e.length===0&&i("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function it(e,t){Number.isInteger(e)||i("getRandomString","min must be an integer"),Number.isInteger(t)||i("getRandomString","max must be an integer"),e<se&&i("getRandomString",`Minimum length cannot be less than ${se}`),t<e&&i("getRandomString","Maximum length cannot be less than minimum length")}function de(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${A(1)}${A({length:p({max:30,min:1})})}${A(1)}@${w(e)}`;return/\.{2,}/.test(t)?de():t}function st(e={}){y(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 G(e,t){(!y(e)||e<=0)&&i("generateRandomStringFromSource","num must be greater than 0"),(!d(t)||t.length===0)&&i("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=w(t);return r}function at(){let e=p({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,z({format:"YYYYMMDD"}),G(3,t),G(1,[...t,"X","x"])].join("")}function mt(){return w(["13","14","15","16","17","18","19"])+p(999999999).toString().padEnd(9,"0")}function ft(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${A({length:{min:4,max:8}})}`,`?id=${p()}`,`?page=${A({length:{min:2,max:4}})}`,`?query=${A({length:{min:5,max:6}})}`,`?search=${A({length:{min:1,max:4}})}`,`?token=${A({length:{min:16,max:16}})}`];return`${w(e)}${A({length:{min:5,max:25}})}${w(t)}${w(r)}`}function ct(e){return/^\d+$/.test(e)}function ut(e){return/^[A-Z]+$/i.test(e)}function pt(e){return/^[A-Z]+$/.test(e)}function lt(e){return/^[\dA-Z]+$/.test(e)}function gt(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function dt(e){return/^[a-z]+$/.test(e)}function bt(e){return/^[\da-z]+$/.test(e)}function yt(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function xt(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function ht(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function wt(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Ot(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function At(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function $t(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Rt(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Et(e){return/^[1-9]\d*$/.test(e)}function St(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Tt(e){return/^-[1-9]\d*$/.test(e)}function jt(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var Nt=e=>{if(!T(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};var be=q(require("dayjs"),1);function Mt(e){return/^1[3-9]\d{9}$/.test(e)}function Pt(e){return/^https?:\/\/\S+$/i.test(e)}function Dt(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function kt(e){return e===""}function ye(e,t="YYYY-MM-DD HH:mm:ss"){return(0,be.default)(e,t,!0).isValid()}function It(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")}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,debugWarnInvalidTypeMessage,decimalToBinary,deepClone,deepMerge,deprecated,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,hasCircularReference,isArray,isBoolean,isChineseString,isDate,isDateString,isDef,isEmail,isEmptyString,isEnglishAphabet,isFloat,isFunction,isIdCard,isInteger,isLowerCase,isLowerCaseAndNumber,isLowerCaseAndNumberAndChinese,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNil,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isNumberOrNumberString,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,isUpperCase,isUpperCaseAndNumber,isUpperCaseAndNumberAndChinese,objectToString,omit,pick,qs,qsStringify,throttle,throwError,throwErrorInvalidTypeMessage,toTypeString,toTypeValue,validatorChineseOrEnglish,validatorChineseOrEnglishOrNumber,validatorUppercaseOrNumbersOrSpecial,validatorUppercaseOrNumbersOrUnderline,withRetry});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Jt=Object.create;var jt=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ne=(t,e)=>()=>(t&&(e=t(t=0)),e);var Yt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var oe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of te(e))!re.call(t,i)&&i!==r&&jt(t,i,{get:()=>e[i],enumerable:!(n=Qt(e,i))||n.enumerable});return t};var Mt=(t,e,r)=>(r=t!=null?Jt(ee(t)):{},oe(e||!t||!t.__esModule?jt(r,"default",{value:t,enumerable:!0}):r,t));import De from"path";import{fileURLToPath as ve}from"url";var o=ne(()=>{"use strict"});var At=Yt((St,Dt)=>{"use strict";o();(function(t,e){typeof St=="object"&&typeof Dt<"u"?Dt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(St,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",x="minute",h="hour",M="day",$="week",R="month",N="quarter",j="year",k="date",K="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,v={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(f){var a=["th","st","nd","rd"],s=f%100;return"["+f+(a[(s-20)%10]||a[s]||a[0])+"]"}},D=function(f,a,s){var c=String(f);return!c||c.length>=a?f:""+Array(a+1-c.length).join(s)+f},B={s:D,z:function(f){var a=-f.utcOffset(),s=Math.abs(a),c=Math.floor(s/60),u=s%60;return(a<=0?"+":"-")+D(c,2,"0")+":"+D(u,2,"0")},m:function f(a,s){if(a.date()<s.date())return-f(s,a);var c=12*(s.year()-a.year())+(s.month()-a.month()),u=a.clone().add(c,R),m=s-u<0,p=a.clone().add(c+(m?-1:1),R);return+(-(c+(s-u)/(m?u-p:p-u))||0)},a:function(f){return f<0?Math.ceil(f)||0:Math.floor(f)},p:function(f){return{M:R,y:j,w:$,d:M,D:k,h,m:x,s:i,ms:n,Q:N}[f]||String(f||"").toLowerCase().replace(/s$/,"")},u:function(f){return f===void 0}},I="en",U={};U[I]=v;var X="$isDayjsObject",H=function(f){return f instanceof C||!(!f||!f[X])},_=function f(a,s,c){var u;if(!a)return I;if(typeof a=="string"){var m=a.toLowerCase();U[m]&&(u=m),s&&(U[m]=s,u=m);var p=a.split("-");if(!u&&p.length>1)return f(p[0])}else{var y=a.name;U[y]=a,u=y}return!c&&u&&(I=u),u||!c&&I},S=function(f,a){if(H(f))return f.clone();var s=typeof a=="object"?a:{};return s.date=f,s.args=arguments,new C(s)},b=B;b.l=_,b.i=H,b.w=function(f,a){return S(f,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var C=function(){function f(s){this.$L=_(s.locale,null,!0),this.parse(s),this.$x=this.$x||s.x||{},this[X]=!0}var a=f.prototype;return a.parse=function(s){this.$d=function(c){var u=c.date,m=c.utc;if(u===null)return new Date(NaN);if(b.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var p=u.match(l);if(p){var y=p[2]-1||0,A=(p[7]||"0").substring(0,3);return m?new Date(Date.UTC(p[1],y,p[3]||1,p[4]||0,p[5]||0,p[6]||0,A)):new Date(p[1],y,p[3]||1,p[4]||0,p[5]||0,p[6]||0,A)}}return new Date(u)}(s),this.init()},a.init=function(){var s=this.$d;this.$y=s.getFullYear(),this.$M=s.getMonth(),this.$D=s.getDate(),this.$W=s.getDay(),this.$H=s.getHours(),this.$m=s.getMinutes(),this.$s=s.getSeconds(),this.$ms=s.getMilliseconds()},a.$utils=function(){return b},a.isValid=function(){return this.$d.toString()!==K},a.isSame=function(s,c){var u=S(s);return this.startOf(c)<=u&&u<=this.endOf(c)},a.isAfter=function(s,c){return S(s)<this.startOf(c)},a.isBefore=function(s,c){return this.endOf(c)<S(s)},a.$g=function(s,c,u){return b.u(s)?this[c]:this.set(u,s)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(s,c){var u=this,m=!!b.u(c)||c,p=b.p(s),y=function(q,Y){var Z=b.w(u.$u?Date.UTC(u.$y,Y,q):new Date(u.$y,Y,q),u);return m?Z:Z.endOf(M)},A=function(q,Y){return b.w(u.toDate()[q].apply(u.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(Y)),u)},T=this.$W,E=this.$M,F=this.$D,rt="set"+(this.$u?"UTC":"");switch(p){case j:return m?y(1,0):y(31,11);case R:return m?y(1,E):y(0,E+1);case $:var tt=this.$locale().weekStart||0,ot=(T<tt?T+7:T)-tt;return y(m?F-ot:F+(6-ot),E);case M:case k:return A(rt+"Hours",0);case h:return A(rt+"Minutes",1);case x:return A(rt+"Seconds",2);case i:return A(rt+"Milliseconds",3);default:return this.clone()}},a.endOf=function(s){return this.startOf(s,!1)},a.$set=function(s,c){var u,m=b.p(s),p="set"+(this.$u?"UTC":""),y=(u={},u[M]=p+"Date",u[k]=p+"Date",u[R]=p+"Month",u[j]=p+"FullYear",u[h]=p+"Hours",u[x]=p+"Minutes",u[i]=p+"Seconds",u[n]=p+"Milliseconds",u)[m],A=m===M?this.$D+(c-this.$W):c;if(m===R||m===j){var T=this.clone().set(k,1);T.$d[y](A),T.init(),this.$d=T.set(k,Math.min(this.$D,T.daysInMonth())).$d}else y&&this.$d[y](A);return this.init(),this},a.set=function(s,c){return this.clone().$set(s,c)},a.get=function(s){return this[b.p(s)]()},a.add=function(s,c){var u,m=this;s=Number(s);var p=b.p(c),y=function(E){var F=S(m);return b.w(F.date(F.date()+Math.round(E*s)),m)};if(p===R)return this.set(R,this.$M+s);if(p===j)return this.set(j,this.$y+s);if(p===M)return y(1);if(p===$)return y(7);var A=(u={},u[x]=e,u[h]=r,u[i]=t,u)[p]||1,T=this.$d.getTime()+s*A;return b.w(T,this)},a.subtract=function(s,c){return this.add(-1*s,c)},a.format=function(s){var c=this,u=this.$locale();if(!this.isValid())return u.invalidDate||K;var m=s||"YYYY-MM-DDTHH:mm:ssZ",p=b.z(this),y=this.$H,A=this.$m,T=this.$M,E=u.weekdays,F=u.months,rt=u.meridiem,tt=function(Y,Z,et,nt){return Y&&(Y[Z]||Y(c,m))||et[Z].slice(0,nt)},ot=function(Y){return b.s(y%12||12,Y,"0")},q=rt||function(Y,Z,et){var nt=Y<12?"AM":"PM";return et?nt.toLowerCase():nt};return m.replace(w,function(Y,Z){return Z||function(et){switch(et){case"YY":return String(c.$y).slice(-2);case"YYYY":return b.s(c.$y,4,"0");case"M":return T+1;case"MM":return b.s(T+1,2,"0");case"MMM":return tt(u.monthsShort,T,F,3);case"MMMM":return tt(F,T);case"D":return c.$D;case"DD":return b.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return tt(u.weekdaysMin,c.$W,E,2);case"ddd":return tt(u.weekdaysShort,c.$W,E,3);case"dddd":return E[c.$W];case"H":return String(y);case"HH":return b.s(y,2,"0");case"h":return ot(1);case"hh":return ot(2);case"a":return q(y,A,!0);case"A":return q(y,A,!1);case"m":return String(A);case"mm":return b.s(A,2,"0");case"s":return String(c.$s);case"ss":return b.s(c.$s,2,"0");case"SSS":return b.s(c.$ms,3,"0");case"Z":return p}return null}(Y)||p.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(s,c,u){var m,p=this,y=b.p(c),A=S(s),T=(A.utcOffset()-this.utcOffset())*e,E=this-A,F=function(){return b.m(p,A)};switch(y){case j:m=F()/12;break;case R:m=F();break;case N:m=F()/3;break;case $:m=(E-T)/6048e5;break;case M:m=(E-T)/864e5;break;case h:m=E/r;break;case x:m=E/e;break;case i:m=E/t;break;default:m=E}return u?m:b.a(m)},a.daysInMonth=function(){return this.endOf(R).$D},a.$locale=function(){return U[this.$L]},a.locale=function(s,c){if(!s)return this.$L;var u=this.clone(),m=_(s,c,!0);return m&&(u.$L=m),u},a.clone=function(){return b.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},f}(),L=C.prototype;return S.prototype=L,[["$ms",n],["$s",i],["$m",x],["$H",h],["$W",M],["$M",R],["$y",j],["$D",k]].forEach(function(f){L[f[1]]=function(a){return this.$g(a,f[0],f[1])}}),S.extend=function(f,a){return f.$i||(f(a,C,S),f.$i=!0),S},S.locale=_,S.isDayjs=H,S.unix=function(f){return S(1e3*f)},S.en=U[I],S.Ls=U,S.p={},S})});var Vt=Yt((vt,Tt)=>{"use strict";o();(function(t,e){typeof vt=="object"&&typeof Tt<"u"?Tt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(vt,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,r=/\d/,n=/\d\d/,i=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,h={},M=function(l){return(l=+l)+(l>68?1900:2e3)},$=function(l){return function(w){this[l]=+w}},R=[/[+-]\d\d:?(\d\d)?|Z/,function(l){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var v=w.match(/([+-]|\d\d)/g),D=60*v[1]+(+v[2]||0);return D===0?0:v[0]==="+"?-D:D}(l)}],N=function(l){var w=h[l];return w&&(w.indexOf?w:w.s.concat(w.f))},j=function(l,w){var v,D=h.meridiem;if(D){for(var B=1;B<=24;B+=1)if(l.indexOf(D(B,0,w))>-1){v=B>12;break}}else v=l===(w?"pm":"PM");return v},k={A:[x,function(l){this.afternoon=j(l,!1)}],a:[x,function(l){this.afternoon=j(l,!0)}],Q:[r,function(l){this.month=3*(l-1)+1}],S:[r,function(l){this.milliseconds=100*+l}],SS:[n,function(l){this.milliseconds=10*+l}],SSS:[/\d{3}/,function(l){this.milliseconds=+l}],s:[i,$("seconds")],ss:[i,$("seconds")],m:[i,$("minutes")],mm:[i,$("minutes")],H:[i,$("hours")],h:[i,$("hours")],HH:[i,$("hours")],hh:[i,$("hours")],D:[i,$("day")],DD:[n,$("day")],Do:[x,function(l){var w=h.ordinal,v=l.match(/\d+/);if(this.day=v[0],w)for(var D=1;D<=31;D+=1)w(D).replace(/\[|\]/g,"")===l&&(this.day=D)}],w:[i,$("week")],ww:[n,$("week")],M:[i,$("month")],MM:[n,$("month")],MMM:[x,function(l){var w=N("months"),v=(N("monthsShort")||w.map(function(D){return D.slice(0,3)})).indexOf(l)+1;if(v<1)throw new Error;this.month=v%12||v}],MMMM:[x,function(l){var w=N("months").indexOf(l)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,$("year")],YY:[n,function(l){this.year=M(l)}],YYYY:[/\d{4}/,$("year")],Z:R,ZZ:R};function K(l){var w,v;w=l,v=h&&h.formats;for(var D=(l=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,b,C){var L=C&&C.toUpperCase();return b||v[C]||t[C]||v[L].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(f,a,s){return a||s.slice(1)})})).match(e),B=D.length,I=0;I<B;I+=1){var U=D[I],X=k[U],H=X&&X[0],_=X&&X[1];D[I]=_?{regex:H,parser:_}:U.replace(/^\[|\]$/g,"")}return function(S){for(var b={},C=0,L=0;C<B;C+=1){var f=D[C];if(typeof f=="string")L+=f.length;else{var a=f.regex,s=f.parser,c=S.slice(L),u=a.exec(c)[0];s.call(b,u),S=S.replace(u,"")}}return function(m){var p=m.afternoon;if(p!==void 0){var y=m.hours;p?y<12&&(m.hours+=12):y===12&&(m.hours=0),delete m.afternoon}}(b),b}}return function(l,w,v){v.p.customParseFormat=!0,l&&l.parseTwoDigitYear&&(M=l.parseTwoDigitYear);var D=w.prototype,B=D.parse;D.parse=function(I){var U=I.date,X=I.utc,H=I.args;this.$u=X;var _=H[1];if(typeof _=="string"){var S=H[2]===!0,b=H[3]===!0,C=S||b,L=H[2];b&&(L=H[2]),h=this.$locale(),!S&&L&&(h=v.Ls[L]),this.$d=function(c,u,m,p){try{if(["x","X"].indexOf(u)>-1)return new Date((u==="X"?1e3:1)*c);var y=K(u)(c),A=y.year,T=y.month,E=y.day,F=y.hours,rt=y.minutes,tt=y.seconds,ot=y.milliseconds,q=y.zone,Y=y.week,Z=new Date,et=E||(A||T?1:Z.getDate()),nt=A||Z.getFullYear(),ft=0;A&&!T||(ft=T>0?T-1:Z.getMonth());var mt,bt=F||0,xt=rt||0,$t=tt||0,wt=ot||0;return q?new Date(Date.UTC(nt,ft,et,bt,xt,$t,wt+60*q.offset*1e3)):m?new Date(Date.UTC(nt,ft,et,bt,xt,$t,wt)):(mt=new Date(nt,ft,et,bt,xt,$t,wt),Y&&(mt=p(mt).week(Y).toDate()),mt)}catch{return new Date("")}}(U,_,X,v),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),C&&U!=this.format(_)&&(this.$d=new Date("")),h={}}else if(_ instanceof Array)for(var f=_.length,a=1;a<=f;a+=1){H[1]=_[a-1];var s=v.apply(this,H);if(s.isValid()){this.$d=s.$d,this.$L=s.$L,this.init();break}a===f&&(this.$d=new Date(""))}else B.call(this,I)}}})});o();o();o();o();o();function Re(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}o();function pt(t){return t!==null&&typeof t=="object"}o();o();var ie=Object.prototype.toString,it=t=>ie.call(t),Ot=t=>it(t).slice(8,-1),dt=t=>typeof t=="string",W=t=>typeof t=="number"&&Number.isFinite(t),Pt=t=>typeof t=="boolean",Ne=t=>t===null,ct=t=>t===void 0,Nt=t=>typeof t=="symbol",G=Array.isArray,lt=t=>typeof t=="function",It=t=>it(t)==="[object Map]",Ct=t=>it(t)==="[object Set]",_t=t=>it(t)==="[object Date]",Lt=t=>it(t)==="[object RegExp]",Ft=t=>pt(t)&<(t?.then)&<(t?.catch),at=t=>t==null,Ie=t=>t!=null,Ce=(t,e)=>t!==e;function J(t){return it(t)==="[object Object]"}function st(t){return G(t)?t:[t]}o();o();o();o();o();function er(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rr(t){let e="",r="";for(let i=0;i<t.length;i++)r+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<r.length;i+=6)e+=Ut[Number.parseInt(r.slice(i,i+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function nr(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Ut.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let i=Number.parseInt(r.slice(n,n+8),2);i&&(e+=String.fromCharCode(i))}return e}o();function sr(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ar(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}o();function fr(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}o();function ut(t){let e=new WeakMap;function r(n){if(!pt(n))return n;if(_t(n))return new Date(n);if(Lt(n))return new RegExp(n);if(Ft(n))return n;if(e.has(n))return e.get(n);if(It(n)){let h=new Map;return e.set(n,h),n.forEach((M,$)=>h.set(r($),r(M))),h}if(Ct(n)){let h=new Set;return e.set(n,h),n.forEach(M=>h.add(r(M))),h}let i=G(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,i);let x=Object.getOwnPropertyDescriptors(n);for(let h of Reflect.ownKeys(x)){let M=x[h];M.get||M.set?Object.defineProperty(i,h,M):Object.defineProperty(i,h,{...M,value:r(M.value)})}return i}return r(t)}o();function Wt(t,e,r={}){return Zt(Ht(t,r),Ht(e,r),r)}function Zt(t,e,r){return G(t)?ae(t,e,r):se(t,e,r)}function se(t,e,r){if(!J(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(J(t[i])||G(t[i]))&&(J(e[i])||G(e[i]))?t[i]=Zt(t[i],e[i],r):Object.defineProperty(t,i,n[i])}),t}function ae(t,e,r){let{mergeStrategy:n="replace"}=r;if(G(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Ht(t,e){let{deepClone:r=!0}=e;return r?ut(t):t}o();var gt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function O(t,e){throw new gt(`[${t}] ${e}`)}function zt(t,e){let r=dt(t)?new gt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var wr=({from:t,replacement:e,version:r,type:n="API"})=>{zt(`${n}`,`${t} is about to be deprecated in version ${r}, please use ${e} instead.`)};function Mr(t,e,r,n){let i=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${Ot(n)} with value ${n}.`;O(t,i)}function Or(t,e,r,n){let i=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${Ot(n)} with value ${n}.`;zt(t,i)}o();var ht=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},yt=(t,...e)=>{ht("info",t,...e)};yt.info=(t,...e)=>{ht("info",t,...e)};yt.error=(t,...e)=>{ht("error",t,...e)};yt.warn=(t,...e)=>{ht("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=yt);o();function ue(t,e){let{decode:r=!0}=e||{},n={};t.startsWith("?")&&(t=t.slice(1)),t.includes("?")&&(t=t.slice(t.indexOf("?")+1));let i=t.split("&").filter(Boolean);for(let x of i){let[h,M]=x.split("=");n[h]=r?decodeURIComponent(M):M}return n}function Kt(t,e){let{encode:r=!0}=e||{},n=[];for(let i in t){let x=t[i];n.push(`${i}=${r?encodeURIComponent(x):x}`)}return n.join("&")}function ce(t,e,r){let n=Wt({encode:!0},{...r}),i=Kt(e,n);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${i}`:`${t}&${i}`:`${t}?${i}`}var Tr={parse:ue,stringify:Kt,appendQueryString:ce};o();function jr(t,e=500){let r=null;return function(...n){if(at(r))return r=Date.now(),t.apply(this,n);let i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}o();function Ir(t){return!at(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function Cr(t){return!at(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function _r(t){return!at(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Lr(t){return/^[\dA-Z_]+$/.test(t)}o();function Zr(t){fe(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:i=!1,signal:x}=t,h,M=x?new Promise((R,N)=>{let j=()=>N(Bt());x.addEventListener("abort",j),h=()=>x.removeEventListener("abort",j)}):null;return new Promise((R,N)=>{(async()=>{for(let k=1;k<=r;k++){if(x?.aborted)return N(Bt());try{let K=await Promise.race(M?[e(),M]:[e()]);return R(K)}catch(K){let l=i?n*2**(k-1):n;if(log("withRetry",`Attempt ${k}/${r} failed. Retrying in ${l}ms...`),K instanceof Error&&K.name==="AbortError"||k===r)return N(K);await new Promise(w=>setTimeout(w,l))}}})()}).finally(()=>h?.())}function fe(t){J(t)||O("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&O("withRetry",'"fn" must be a function that returns a Promise'),!ct(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&O("withRetry",'"maxAttempts" must be a positive integer'),!ct(t.retryDelay)&&(!W(t.retryDelay)||t.retryDelay<0)&&O("withRetry",'"retryDelay" must be a non-negative number'),!ct(t.enableExponentialBackoff)&&!Pt(t.enableExponentialBackoff)&&O("withRetry",'"enableExponentialBackoff" must be a boolean'),!ct(t.signal)&&typeof t.signal!="object"&&O("withRetry",'"signal" must be an AbortSignal')}var me="The operation was aborted";function Bt(t=me){let e=new Error(t);return e.name="AbortError",e}function Gt(t,e,r={}){let{includeProto:n=!1,includeSymbols:i=!0,includeNonEnum:x=!1}=r,h={};return J(t)&&st(e).forEach($=>{Nt($)&&!i||!(n?$ in t:Object.hasOwn(t,$))||!x&&(n?pe(t,$):Object.getOwnPropertyDescriptor(t,$))?.enumerable===!1||(h[$]=ut(t[$]))}),h}function pe(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function hn(t,e){if(!J(t))return{};let r=ut(t),n=st(e),i=Object.keys(r).filter(x=>!n.includes(x));return Gt(r,i)}o();o();function Dn(t,e){return(!W(t)||t<=0)&&O("generateRandomArray","num must be greater than 0"),lt(e)||O("generateRandomArray","cb must be a function"),Array.from({length:t}).fill(0).map((r,n)=>e(r,n))}o();function Tn(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}o();var Q=Mt(At(),1),Xt=Mt(Vt(),1);o();o();function z(t){return t[Math.floor(Math.random()*t.length)]}function P(t={}){W(t)&&(t={max:t});let{min:e=1,max:r=z(de())}=t;le(e,r);let n=Math.ceil(e),i=Math.floor(r);return Math.floor(Math.random()*(i-n+1)+n)}function le(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||O("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||O("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&O("getRandomInt",`No integer value found between ${t} and ${e}`),O("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function de(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}Q.default.extend(Xt.default);function Rt(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,Q.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=t;(!(0,Q.default)(e).isValid()||!(0,Q.default)(r).isValid())&&O("generateRandomDate","start and end parameters must be valid date format");let i=(0,Q.default)(e).year(),x=(0,Q.default)(r).year(),h=P({min:i,max:x}),M=P({min:1,max:12}),$=P({min:1,max:31}),R=P(23),N=P(59),j=P(59),k=(0,Q.default)(`${h}-${M}-${$} ${R}:${N}:${j}`);return k.isBefore((0,Q.default)(e))||k.isAfter((0,Q.default)(r))?Rt(t):k.format(n)}o();o();function V(t={}){let e=he(t),r=ye(e);be(r);let{length:n}=e;xe(n.min,n.max);let i=P(n),x=e.prefix||"";for(let h=0;h<i;h++)x+=r.charAt(Math.floor(Math.random()*r.length));return x+(e.suffix||"")}var ge=16,kt=1;function he(t){let e=W(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:W(t.length)?{max:t.length,min:t.length}:{max:ge,min:kt,...t.length},extra:e?[]:[...new Set(st(t.extra||[]))]}}function ye(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=st(t.extra).join(""),e}function be(t){t.length===0&&O("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function xe(t,e){Number.isInteger(t)||O("getRandomString","min must be an integer"),Number.isInteger(e)||O("getRandomString","max must be an integer"),t<kt&&O("getRandomString",`Minimum length cannot be less than ${kt}`),e<t&&O("getRandomString","Maximum length cannot be less than minimum length")}function $e(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${V(1)}${V({length:P({max:30,min:1})})}${V(1)}@${z(t)}`;return/\.{2,}/.test(e)?$e():e}o();function ro(t={}){W(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);return Math.random()*(r-e)+e}o();o();function Et(t,e){(!W(t)||t<=0)&&O("generateRandomStringFromSource","num must be greater than 0"),(!G(e)||e.length===0)&&O("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<t;n++)r+=z(e);return r}function lo(){let t=P({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,Rt({format:"YYYYMMDD"}),Et(3,e),Et(1,[...e,"X","x"])].join("")}o();function xo(){return z(["13","14","15","16","17","18","19"])+P(999999999).toString().padEnd(9,"0")}o();function Do(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${V({length:{min:4,max:8}})}`,`?id=${P()}`,`?page=${V({length:{min:2,max:4}})}`,`?query=${V({length:{min:5,max:6}})}`,`?search=${V({length:{min:1,max:4}})}`,`?token=${V({length:{min:16,max:16}})}`];return`${z(t)}${V({length:{min:5,max:25}})}${z(e)}${z(r)}`}o();o();o();o();function zo(t){return/^\d+$/.test(t)}function Ko(t){return/^[A-Z]+$/i.test(t)}function Bo(t){return/^[A-Z]+$/.test(t)}function Go(t){return/^[\dA-Z]+$/.test(t)}function Vo(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function Xo(t){return/^[a-z]+$/.test(t)}function qo(t){return/^[\da-z]+$/.test(t)}function Jo(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function Qo(t){return/^[\u4E00-\u9FA5]+$/.test(t)}o();function ri(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function ni(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function oi(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ii(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function si(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}o();function ci(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function fi(t){return/^[1-9]\d*$/.test(t)}function mi(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function pi(t){return/^-[1-9]\d*$/.test(t)}function li(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}o();var yi=t=>{if(!dt(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};o();var qt=Mt(At(),1);function $i(t){return/^1[3-9]\d{9}$/.test(t)}function wi(t){return/^https?:\/\/\S+$/i.test(t)}function Mi(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function Oi(t){return t===""}function we(t,e="YYYY-MM-DD HH:mm:ss"){return(0,qt.default)(t,e,!0).isValid()}function Si(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)&&we(t.slice(6,14),"YYYYMMDD")}export{gt as UtilsError,nr as base64Decode,rr as base64Encode,st as castArray,sr as compose,ar as composeRight,fr as debounce,zt as debugWarn,Or as debugWarnInvalidTypeMessage,er as decimalToBinary,ut as deepClone,Wt as deepMerge,wr as deprecated,Dn as generateRandomArray,Tn as generateRandomColor,Rt as generateRandomDate,$e as generateRandomEmail,ro as generateRandomFloat,lo as generateRandomIdCard,xo as generateRandomMobilePhone,Et as generateRandomStringFromSource,P as getRandomInt,z as getRandomItem,V as getRandomString,Do as getRandomUrl,Ce as hasChanged,G as isArray,Pt as isBoolean,Qo as isChineseString,_t as isDate,we as isDateString,Ie as isDef,Mi as isEmail,Oi as isEmptyString,Ko as isEnglishAphabet,ri as isFloat,lt as isFunction,Si as isIdCard,ci as isInteger,Xo as isLowerCase,qo as isLowerCaseAndNumber,Jo as isLowerCaseAndNumberAndChinese,It as isMap,$i as isMobilePhone,ii as isNegativeFloat,pi as isNegativeInteger,oi as isNonNegativeFloat,mi as isNonNegativeInteger,si as isNonPositiveFloat,li as isNonPositiveInteger,Ne as isNull,W as isNumber,zo as isNumberOrNumberString,Re as isObject,pt as isObjectLike,J as isPlainObject,ni as isPositiveFloat,fi as isPositiveInteger,Ft as isPromise,Lt as isRegExp,Ct as isSet,dt as isString,yi as isStringNumber,Nt as isSymbol,wi as isURL,at as isUndef,ct as isUndefined,Bo as isUpperCase,Go as isUpperCaseAndNumber,Vo as isUpperCaseAndNumberAndChinese,ie as objectToString,hn as omit,Gt as pick,Tr as qs,jr as throttle,O as throwError,Mr as throwErrorInvalidTypeMessage,it as toTypeString,Ot as toTypeValue,Cr as validatorChineseOrEnglish,Ir as validatorChineseOrEnglishOrNumber,_r as validatorUppercaseOrNumbersOrSpecial,Lr as validatorUppercaseOrNumbersOrUnderline,Zr as withRetry};
|
|
1
|
+
var Jt=Object.create;var Yt=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,ne=Object.prototype.hasOwnProperty;var oe=(t,e)=>()=>(t&&(e=t(t=0)),e);var It=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ie=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ee(e))!ne.call(t,s)&&s!==r&&Yt(t,s,{get:()=>e[s],enumerable:!(n=te(e,s))||n.enumerable});return t};var Dt=(t,e,r)=>(r=t!=null?Jt(re(t)):{},ie(e||!t||!t.__esModule?Yt(r,"default",{value:t,enumerable:!0}):r,t));import Ae from"path";import{fileURLToPath as Re}from"url";var o=oe(()=>{"use strict"});var Et=It((Tt,Rt)=>{"use strict";o();(function(t,e){typeof Tt=="object"&&typeof Rt<"u"?Rt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Tt,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",s="second",O="minute",y="hour",S="day",x="week",v="month",L="quarter",Y="year",P="date",I="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,A={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 a=["th","st","nd","rd"],i=c%100;return"["+c+(a[(i-20)%10]||a[i]||a[0])+"]"}},T=function(c,a,i){var f=String(c);return!f||f.length>=a?c:""+Array(a+1-f.length).join(i)+c},M={s:T,z:function(c){var a=-c.utcOffset(),i=Math.abs(a),f=Math.floor(i/60),u=i%60;return(a<=0?"+":"-")+T(f,2,"0")+":"+T(u,2,"0")},m:function c(a,i){if(a.date()<i.date())return-c(i,a);var f=12*(i.year()-a.year())+(i.month()-a.month()),u=a.clone().add(f,v),l=i-u<0,g=a.clone().add(f+(l?-1:1),v);return+(-(f+(i-u)/(l?u-g:g-u))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:v,y:Y,w:x,d:S,D:P,h:y,m:O,s,ms:n,Q:L}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},D="en",k={};k[D]=A;var F="$isDayjsObject",N=function(c){return c instanceof K||!(!c||!c[F])},W=function c(a,i,f){var u;if(!a)return D;if(typeof a=="string"){var l=a.toLowerCase();k[l]&&(u=l),i&&(k[l]=i,u=l);var g=a.split("-");if(!u&&g.length>1)return c(g[0])}else{var b=a.name;k[b]=a,u=b}return!f&&u&&(D=u),u||!f&&D},R=function(c,a){if(N(c))return c.clone();var i=typeof a=="object"?a:{};return i.date=c,i.args=arguments,new K(i)},$=M;$.l=W,$.i=N,$.w=function(c,a){return R(c,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var K=function(){function c(i){this.$L=W(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[F]=!0}var a=c.prototype;return a.parse=function(i){this.$d=function(f){var u=f.date,l=f.utc;if(u===null)return new Date(NaN);if($.u(u))return new Date;if(u instanceof Date)return new Date(u);if(typeof u=="string"&&!/Z$/i.test(u)){var g=u.match(m);if(g){var b=g[2]-1||0,E=(g[7]||"0").substring(0,3);return l?new Date(Date.UTC(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,E)):new Date(g[1],b,g[3]||1,g[4]||0,g[5]||0,g[6]||0,E)}}return new Date(u)}(i),this.init()},a.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()},a.$utils=function(){return $},a.isValid=function(){return this.$d.toString()!==I},a.isSame=function(i,f){var u=R(i);return this.startOf(f)<=u&&u<=this.endOf(f)},a.isAfter=function(i,f){return R(i)<this.startOf(f)},a.isBefore=function(i,f){return this.endOf(f)<R(i)},a.$g=function(i,f,u){return $.u(i)?this[f]:this.set(u,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,f){var u=this,l=!!$.u(f)||f,g=$.p(i),b=function(tt,H){var G=$.w(u.$u?Date.UTC(u.$y,H,tt):new Date(u.$y,H,tt),u);return l?G:G.endOf(S)},E=function(tt,H){return $.w(u.toDate()[tt].apply(u.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(H)),u)},j=this.$W,_=this.$M,z=this.$D,ot="set"+(this.$u?"UTC":"");switch(g){case Y:return l?b(1,0):b(31,11);case v:return l?b(1,_):b(0,_+1);case x:var rt=this.$locale().weekStart||0,ut=(j<rt?j+7:j)-rt;return b(l?z-ut:z+(6-ut),_);case S:case P:return E(ot+"Hours",0);case y:return E(ot+"Minutes",1);case O:return E(ot+"Seconds",2);case s:return E(ot+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,f){var u,l=$.p(i),g="set"+(this.$u?"UTC":""),b=(u={},u[S]=g+"Date",u[P]=g+"Date",u[v]=g+"Month",u[Y]=g+"FullYear",u[y]=g+"Hours",u[O]=g+"Minutes",u[s]=g+"Seconds",u[n]=g+"Milliseconds",u)[l],E=l===S?this.$D+(f-this.$W):f;if(l===v||l===Y){var j=this.clone().set(P,1);j.$d[b](E),j.init(),this.$d=j.set(P,Math.min(this.$D,j.daysInMonth())).$d}else b&&this.$d[b](E);return this.init(),this},a.set=function(i,f){return this.clone().$set(i,f)},a.get=function(i){return this[$.p(i)]()},a.add=function(i,f){var u,l=this;i=Number(i);var g=$.p(f),b=function(_){var z=R(l);return $.w(z.date(z.date()+Math.round(_*i)),l)};if(g===v)return this.set(v,this.$M+i);if(g===Y)return this.set(Y,this.$y+i);if(g===S)return b(1);if(g===x)return b(7);var E=(u={},u[O]=e,u[y]=r,u[s]=t,u)[g]||1,j=this.$d.getTime()+i*E;return $.w(j,this)},a.subtract=function(i,f){return this.add(-1*i,f)},a.format=function(i){var f=this,u=this.$locale();if(!this.isValid())return u.invalidDate||I;var l=i||"YYYY-MM-DDTHH:mm:ssZ",g=$.z(this),b=this.$H,E=this.$m,j=this.$M,_=u.weekdays,z=u.months,ot=u.meridiem,rt=function(H,G,nt,it){return H&&(H[G]||H(f,l))||nt[G].slice(0,it)},ut=function(H){return $.s(b%12||12,H,"0")},tt=ot||function(H,G,nt){var it=H<12?"AM":"PM";return nt?it.toLowerCase():it};return l.replace(w,function(H,G){return G||function(nt){switch(nt){case"YY":return String(f.$y).slice(-2);case"YYYY":return $.s(f.$y,4,"0");case"M":return j+1;case"MM":return $.s(j+1,2,"0");case"MMM":return rt(u.monthsShort,j,z,3);case"MMMM":return rt(z,j);case"D":return f.$D;case"DD":return $.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return rt(u.weekdaysMin,f.$W,_,2);case"ddd":return rt(u.weekdaysShort,f.$W,_,3);case"dddd":return _[f.$W];case"H":return String(b);case"HH":return $.s(b,2,"0");case"h":return ut(1);case"hh":return ut(2);case"a":return tt(b,E,!0);case"A":return tt(b,E,!1);case"m":return String(E);case"mm":return $.s(E,2,"0");case"s":return String(f.$s);case"ss":return $.s(f.$s,2,"0");case"SSS":return $.s(f.$ms,3,"0");case"Z":return g}return null}(H)||g.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,f,u){var l,g=this,b=$.p(f),E=R(i),j=(E.utcOffset()-this.utcOffset())*e,_=this-E,z=function(){return $.m(g,E)};switch(b){case Y:l=z()/12;break;case v:l=z();break;case L:l=z()/3;break;case x:l=(_-j)/6048e5;break;case S:l=(_-j)/864e5;break;case y:l=_/r;break;case O:l=_/e;break;case s:l=_/t;break;default:l=_}return u?l:$.a(l)},a.daysInMonth=function(){return this.endOf(v).$D},a.$locale=function(){return k[this.$L]},a.locale=function(i,f){if(!i)return this.$L;var u=this.clone(),l=W(i,f,!0);return l&&(u.$L=l),u},a.clone=function(){return $.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},c}(),Z=K.prototype;return R.prototype=Z,[["$ms",n],["$s",s],["$m",O],["$H",y],["$W",S],["$M",v],["$y",Y],["$D",P]].forEach(function(c){Z[c[1]]=function(a){return this.$g(a,c[0],c[1])}}),R.extend=function(c,a){return c.$i||(c(a,K,R),c.$i=!0),R},R.locale=W,R.isDayjs=N,R.unix=function(c){return R(1e3*c)},R.en=k[D],R.Ls=k,R.p={},R})});var Qt=It((jt,vt)=>{"use strict";o();(function(t,e){typeof jt=="object"&&typeof vt<"u"?vt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(jt,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,r=/\d/,n=/\d\d/,s=/\d\d?/,O=/\d*[^-_:/,()\s\d]+/,y={},S=function(m){return(m=+m)+(m>68?1900:2e3)},x=function(m){return function(w){this[m]=+w}},v=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var A=w.match(/([+-]|\d\d)/g),T=60*A[1]+(+A[2]||0);return T===0?0:A[0]==="+"?-T:T}(m)}],L=function(m){var w=y[m];return w&&(w.indexOf?w:w.s.concat(w.f))},Y=function(m,w){var A,T=y.meridiem;if(T){for(var M=1;M<=24;M+=1)if(m.indexOf(T(M,0,w))>-1){A=M>12;break}}else A=m===(w?"pm":"PM");return A},P={A:[O,function(m){this.afternoon=Y(m,!1)}],a:[O,function(m){this.afternoon=Y(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[n,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,x("seconds")],ss:[s,x("seconds")],m:[s,x("minutes")],mm:[s,x("minutes")],H:[s,x("hours")],h:[s,x("hours")],HH:[s,x("hours")],hh:[s,x("hours")],D:[s,x("day")],DD:[n,x("day")],Do:[O,function(m){var w=y.ordinal,A=m.match(/\d+/);if(this.day=A[0],w)for(var T=1;T<=31;T+=1)w(T).replace(/\[|\]/g,"")===m&&(this.day=T)}],w:[s,x("week")],ww:[n,x("week")],M:[s,x("month")],MM:[n,x("month")],MMM:[O,function(m){var w=L("months"),A=(L("monthsShort")||w.map(function(T){return T.slice(0,3)})).indexOf(m)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[O,function(m){var w=L("months").indexOf(m)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,x("year")],YY:[n,function(m){this.year=S(m)}],YYYY:[/\d{4}/,x("year")],Z:v,ZZ:v};function I(m){var w,A;w=m,A=y&&y.formats;for(var T=(m=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,$,K){var Z=K&&K.toUpperCase();return $||A[K]||t[K]||A[Z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,a,i){return a||i.slice(1)})})).match(e),M=T.length,D=0;D<M;D+=1){var k=T[D],F=P[k],N=F&&F[0],W=F&&F[1];T[D]=W?{regex:N,parser:W}:k.replace(/^\[|\]$/g,"")}return function(R){for(var $={},K=0,Z=0;K<M;K+=1){var c=T[K];if(typeof c=="string")Z+=c.length;else{var a=c.regex,i=c.parser,f=R.slice(Z),u=a.exec(f)[0];i.call($,u),R=R.replace(u,"")}}return function(l){var g=l.afternoon;if(g!==void 0){var b=l.hours;g?b<12&&(l.hours+=12):b===12&&(l.hours=0),delete l.afternoon}}($),$}}return function(m,w,A){A.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(S=m.parseTwoDigitYear);var T=w.prototype,M=T.parse;T.parse=function(D){var k=D.date,F=D.utc,N=D.args;this.$u=F;var W=N[1];if(typeof W=="string"){var R=N[2]===!0,$=N[3]===!0,K=R||$,Z=N[2];$&&(Z=N[2]),y=this.$locale(),!R&&Z&&(y=A.Ls[Z]),this.$d=function(f,u,l,g){try{if(["x","X"].indexOf(u)>-1)return new Date((u==="X"?1e3:1)*f);var b=I(u)(f),E=b.year,j=b.month,_=b.day,z=b.hours,ot=b.minutes,rt=b.seconds,ut=b.milliseconds,tt=b.zone,H=b.week,G=new Date,nt=_||(E||j?1:G.getDate()),it=E||G.getFullYear(),pt=0;E&&!j||(pt=j>0?j-1:G.getMonth());var dt,$t=z||0,wt=ot||0,Ot=rt||0,Mt=ut||0;return tt?new Date(Date.UTC(it,pt,nt,$t,wt,Ot,Mt+60*tt.offset*1e3)):l?new Date(Date.UTC(it,pt,nt,$t,wt,Ot,Mt)):(dt=new Date(it,pt,nt,$t,wt,Ot,Mt),H&&(dt=g(dt).week(H).toDate()),dt)}catch{return new Date("")}}(k,W,F,A),this.init(),Z&&Z!==!0&&(this.$L=this.locale(Z).$L),K&&k!=this.format(W)&&(this.$d=new Date("")),y={}}else if(W instanceof Array)for(var c=W.length,a=1;a<=c;a+=1){N[1]=W[a-1];var i=A.apply(this,N);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}a===c&&(this.$d=new Date(""))}else M.call(this,D)}}})});o();o();o();o();o();function st(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}o();function gt(t){return t!==null&&typeof t=="object"}o();o();var se=Object.prototype.toString,ft=t=>se.call(t),St=t=>ft(t).slice(8,-1),at=t=>typeof t=="string",B=t=>typeof t=="number"&&Number.isFinite(t),Q=t=>typeof t=="boolean",At=t=>t===null,C=t=>t===void 0,Ct=t=>typeof t=="symbol",V=Array.isArray,ht=t=>typeof t=="function",_t=t=>ft(t)==="[object Map]",Lt=t=>ft(t)==="[object Set]",Ft=t=>ft(t)==="[object Date]",Ht=t=>ft(t)==="[object RegExp]",Ut=t=>gt(t)&&ht(t?.then)&&ht(t?.catch),mt=t=>t==null,Ye=t=>t!=null,Ie=(t,e)=>t!==e;function X(t){return ft(t)==="[object Object]"}function ct(t){return V(t)?t:[t]}o();o();o();o();function tr(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Kt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function er(t){let e="",r="";for(let s=0;s<t.length;s++)r+=t[s].charCodeAt(0).toString(2).padStart(8,"0");for(let s=0;s<r.length;s+=6)e+=Kt[Number.parseInt(r.slice(s,s+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function rr(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Kt.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let s=Number.parseInt(r.slice(n,n+8),2);s&&(e+=String.fromCharCode(s))}return e}o();function ir(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function sr(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}o();function fr(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}o();function lt(t){let e=new WeakMap;function r(n){if(!gt(n))return n;if(Ft(n))return new Date(n);if(Ht(n))return new RegExp(n);if(Ut(n))return n;if(e.has(n))return e.get(n);if(_t(n)){let y=new Map;return e.set(n,y),n.forEach((S,x)=>y.set(r(x),r(S))),y}if(Lt(n)){let y=new Set;return e.set(n,y),n.forEach(S=>y.add(r(S))),y}let s=V(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,s);let O=Object.getOwnPropertyDescriptors(n);for(let y of Reflect.ownKeys(O)){let S=O[y];S.get||S.set?Object.defineProperty(s,y,S):Object.defineProperty(s,y,{...S,value:r(S.value)})}return s}return r(t)}o();function yr(t,e,r={}){return Zt(Wt(t,r),Wt(e,r),r)}function Zt(t,e,r){return V(t)?ue(t,e,r):ae(t,e,r)}function ae(t,e,r){if(!X(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(s=>{(X(t[s])||V(t[s]))&&(X(e[s])||V(e[s]))?t[s]=Zt(t[s],e[s],r):Object.defineProperty(t,s,n[s])}),t}function ue(t,e,r){let{mergeStrategy:n="replace"}=r;if(V(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Wt(t,e){let{deepClone:r=!0}=e;return r?lt(t):t}o();var yt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function h(t,e){throw new yt(`[${t}] ${e}`)}function zt(t,e){let r=at(t)?new yt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var wr=({from:t,replacement:e,version:r,type:n="API"})=>{zt(`${n}`,`${t} is about to be deprecated in version ${r}, please use ${e} instead.`)};function Or(t,e,r,n){let s=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${St(n)} with value ${n}.`;h(t,s)}function Mr(t,e,r,n){let s=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${St(n)} with value ${n}.`;zt(t,s)}o();var bt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},xt=(t,...e)=>{bt("info",t,...e)};xt.info=(t,...e)=>{bt("info",t,...e)};xt.error=(t,...e)=>{bt("error",t,...e)};xt.warn=(t,...e)=>{bt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=xt);o();function jr(t,e={}){fe(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:s="indices",encodeDotInKeys:O=!1,skipNulls:y=!1,strictNullHandling:S=!1,commaRoundTrip:x=!1,allowEmptyArrays:v=!1,addQueryPrefix:L=!1,delimiter:Y="&"}=e,P=e.allowDots??!1;O&&C(e.allowDots)&&(P=!0);let I=[],m=M=>r&&!n?encodeURIComponent(M):M,w=M=>r?encodeURIComponent(M):M;function A(M,D){if(!C(D)){if(At(D)){if(y)return;I.push(`${m(M)}${S?"":"="}`);return}if(V(D)){if(D.length===0){v&&I.push(`${m(M)}[]`);return}if(s==="comma"){let k=n?D.map(w).join(","):w(D.join(","));if(D.length===1&&At(D[0])){if(y)return;I.push(`${m(M)}${x?"[]":""}${S?"":"="}`)}else D.length===1?I.push(`${m(M)}${x?"[]":""}=${k}`):I.push(`${m(M)}=${k}`);return}D.forEach((k,F)=>{let N=M;s==="indices"?N=`${M}[${F}]`:s==="brackets"&&(N=`${M}[]`),A(N,k)});return}if(st(D)){Object.keys(D).forEach(k=>{let F=M;O&&(F=F.replace(/\./g,"%2E"));let N=k;P?(O&&(N=N.replace(/\./g,"%2E")),A(`${F}.${N}`,D[k])):A(`${F}[${N}]`,D[k])});return}I.push(`${m(M)}=${w(D)}`)}}if(!st(t))return"";Vt(t)&&h("stringify","Input object contains circular references, cannot stringify"),V(t)?t.forEach((M,D)=>A(`${D}`,M)):Object.keys(t).forEach(M=>A(M,t[M]));let T=I.join(Y);return L&&T?`?${T}`:T}function fe(t={}){X(t)||h("stringify",'"options" must be a plain object'),!C(t.encode)&&!Q(t.encode)&&h("stringify",'"encode" must be a boolean'),!C(t.encodeValuesOnly)&&!Q(t.encodeValuesOnly)&&h("stringify",'"encodeValuesOnly" must be a boolean'),!C(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&h("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!C(t.allowDots)&&!Q(t.allowDots)&&h("stringify",'"allowDots" must be a boolean'),!C(t.skipNulls)&&!Q(t.skipNulls)&&h("stringify",'"skipNulls" must be a boolean'),!C(t.strictNullHandling)&&!Q(t.strictNullHandling)&&h("stringify",'"strictNullHandling" must be a boolean'),!C(t.addQueryPrefix)&&!Q(t.addQueryPrefix)&&h("stringify",'"addQueryPrefix" must be a boolean'),!C(t.delimiter)&&!at(t.delimiter)&&h("stringify",'"delimiter" must be a string'),!C(t.encodeDotInKeys)&&!Q(t.encodeDotInKeys)&&h("stringify",'"encodeDotInKeys" must be a boolean'),!C(t.commaRoundTrip)&&!Q(t.commaRoundTrip)&&h("stringify",'"commaRoundTrip" must be a boolean'),!C(t.allowEmptyArrays)&&!Q(t.allowEmptyArrays)&&h("stringify",'"allowEmptyArrays" must be a boolean')}o();var ce={stringify:t=>(st(t)||h("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(at(t)||h("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=ce.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};o();function _r(t,e=500){let r=null;return function(...n){if(mt(r))return r=Date.now(),t.apply(this,n);let s=Date.now();if(s-r>=e)return r=s,t.apply(this,n)}}o();function Ur(t){return!mt(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function Kr(t){return!mt(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function Wr(t){return!mt(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Zr(t){return/^[\dA-Z_]+$/.test(t)}o();function Qr(t){me(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:s=!1,signal:O}=t,y,S=O?new Promise((v,L)=>{let Y=()=>L(Bt());O.addEventListener("abort",Y),y=()=>O.removeEventListener("abort",Y)}):null;return new Promise((v,L)=>{(async()=>{for(let P=1;P<=r;P++){if(O?.aborted)return L(Bt());try{let I=await Promise.race(S?[e(),S]:[e()]);return v(I)}catch(I){let m=s?n*2**(P-1):n;if(log("withRetry",`Attempt ${P}/${r} failed. Retrying in ${m}ms...`),I instanceof Error&&I.name==="AbortError"||P===r)return L(I);await new Promise(w=>setTimeout(w,m))}}})()}).finally(()=>y?.())}function me(t){X(t)||h("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&h("withRetry",'"fn" must be a function that returns a Promise'),!C(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&h("withRetry",'"maxAttempts" must be a positive integer'),!C(t.retryDelay)&&(!B(t.retryDelay)||t.retryDelay<0)&&h("withRetry",'"retryDelay" must be a non-negative number'),!C(t.enableExponentialBackoff)&&!Q(t.enableExponentialBackoff)&&h("withRetry",'"enableExponentialBackoff" must be a boolean'),!C(t.signal)&&typeof t.signal!="object"&&h("withRetry",'"signal" must be an AbortSignal')}var le="The operation was aborted";function Bt(t=le){let e=new Error(t);return e.name="AbortError",e}function Vt(t){st(t)||h("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(st(n)){if(e.has(n))return!0;e.add(n);for(let s of Object.keys(n))if(r(n[s]))return!0;e.delete(n)}return!1}return r(t)}o();o();function Gt(t,e,r={}){let{includeProto:n=!1,includeSymbols:s=!0,includeNonEnum:O=!1}=r,y={};return X(t)&&ct(e).forEach(x=>{Ct(x)&&!s||!(n?x in t:Object.hasOwn(t,x))||!O&&(n?pe(t,x):Object.getOwnPropertyDescriptor(t,x))?.enumerable===!1||(y[x]=lt(t[x]))}),y}function pe(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Tn(t,e){if(!X(t))return{};let r=lt(t),n=ct(e),s=Object.keys(r).filter(O=>!n.includes(O));return Gt(r,s)}o();o();function Cn(t,e){return(!B(t)||t<=0)&&h("generateRandomArray","num must be greater than 0"),ht(e)||h("generateRandomArray","cb must be a function"),Array.from({length:t}).fill(0).map((r,n)=>e(r,n))}o();function Fn(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}o();var et=Dt(Et(),1),Xt=Dt(Qt(),1);o();o();function q(t){return t[Math.floor(Math.random()*t.length)]}function U(t={}){B(t)&&(t={max:t});let{min:e=1,max:r=q(ge())}=t;de(e,r);let n=Math.ceil(e),s=Math.floor(r);return Math.floor(Math.random()*(s-n+1)+n)}function de(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||h("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||h("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&h("getRandomInt",`No integer value found between ${t} and ${e}`),h("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function ge(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}et.default.extend(Xt.default);function kt(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,et.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=t;(!(0,et.default)(e).isValid()||!(0,et.default)(r).isValid())&&h("generateRandomDate","start and end parameters must be valid date format");let s=(0,et.default)(e).year(),O=(0,et.default)(r).year(),y=U({min:s,max:O}),S=U({min:1,max:12}),x=U({min:1,max:31}),v=U(23),L=U(59),Y=U(59),P=(0,et.default)(`${y}-${S}-${x} ${v}:${L}:${Y}`);return P.isBefore((0,et.default)(e))||P.isAfter((0,et.default)(r))?kt(t):P.format(n)}o();o();function J(t={}){let e=ye(t),r=be(e);xe(r);let{length:n}=e;$e(n.min,n.max);let s=U(n),O=e.prefix||"";for(let y=0;y<s;y++)O+=r.charAt(Math.floor(Math.random()*r.length));return O+(e.suffix||"")}var he=16,Nt=1;function ye(t){let e=B(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:B(t.length)?{max:t.length,min:t.length}:{max:he,min:Nt,...t.length},extra:e?[]:[...new Set(ct(t.extra||[]))]}}function be(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=ct(t.extra).join(""),e}function xe(t){t.length===0&&h("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function $e(t,e){Number.isInteger(t)||h("getRandomString","min must be an integer"),Number.isInteger(e)||h("getRandomString","max must be an integer"),t<Nt&&h("getRandomString",`Minimum length cannot be less than ${Nt}`),e<t&&h("getRandomString","Maximum length cannot be less than minimum length")}function we(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${J(1)}${J({length:U({max:30,min:1})})}${J(1)}@${q(t)}`;return/\.{2,}/.test(e)?we():e}o();function go(t={}){B(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);return Math.random()*(r-e)+e}o();o();function Pt(t,e){(!B(t)||t<=0)&&h("generateRandomStringFromSource","num must be greater than 0"),(!V(e)||e.length===0)&&h("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<t;n++)r+=q(e);return r}function Ao(){let t=U({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,kt({format:"YYYYMMDD"}),Pt(3,e),Pt(1,[...e,"X","x"])].join("")}o();function vo(){return q(["13","14","15","16","17","18","19"])+U(999999999).toString().padEnd(9,"0")}o();function Co(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${J({length:{min:4,max:8}})}`,`?id=${U()}`,`?page=${J({length:{min:2,max:4}})}`,`?query=${J({length:{min:5,max:6}})}`,`?search=${J({length:{min:1,max:4}})}`,`?token=${J({length:{min:16,max:16}})}`];return`${q(t)}${J({length:{min:5,max:25}})}${q(e)}${q(r)}`}o();o();o();o();function ni(t){return/^\d+$/.test(t)}function oi(t){return/^[A-Z]+$/i.test(t)}function ii(t){return/^[A-Z]+$/.test(t)}function si(t){return/^[\dA-Z]+$/.test(t)}function ai(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function ui(t){return/^[a-z]+$/.test(t)}function fi(t){return/^[\da-z]+$/.test(t)}function ci(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function mi(t){return/^[\u4E00-\u9FA5]+$/.test(t)}o();function di(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function gi(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function hi(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function yi(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function bi(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}o();function wi(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Oi(t){return/^[1-9]\d*$/.test(t)}function Mi(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Di(t){return/^-[1-9]\d*$/.test(t)}function Si(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}o();var Ei=t=>{if(!at(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};o();var qt=Dt(Et(),1);function ki(t){return/^1[3-9]\d{9}$/.test(t)}function Ni(t){return/^https?:\/\/\S+$/i.test(t)}function Pi(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function Yi(t){return t===""}function Oe(t,e="YYYY-MM-DD HH:mm:ss"){return(0,qt.default)(t,e,!0).isValid()}function Ii(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)&&Oe(t.slice(6,14),"YYYYMMDD")}export{yt as UtilsError,rr as base64Decode,er as base64Encode,ct as castArray,ir as compose,sr as composeRight,fr as debounce,zt as debugWarn,Mr as debugWarnInvalidTypeMessage,tr as decimalToBinary,lt as deepClone,yr as deepMerge,wr as deprecated,Cn as generateRandomArray,Fn as generateRandomColor,kt as generateRandomDate,we as generateRandomEmail,go as generateRandomFloat,Ao as generateRandomIdCard,vo as generateRandomMobilePhone,Pt as generateRandomStringFromSource,U as getRandomInt,q as getRandomItem,J as getRandomString,Co as getRandomUrl,Ie as hasChanged,Vt as hasCircularReference,V as isArray,Q as isBoolean,mi as isChineseString,Ft as isDate,Oe as isDateString,Ye as isDef,Pi as isEmail,Yi as isEmptyString,oi as isEnglishAphabet,di as isFloat,ht as isFunction,Ii as isIdCard,wi as isInteger,ui as isLowerCase,fi as isLowerCaseAndNumber,ci as isLowerCaseAndNumberAndChinese,_t as isMap,ki as isMobilePhone,yi as isNegativeFloat,Di as isNegativeInteger,mt as isNil,hi as isNonNegativeFloat,Mi as isNonNegativeInteger,bi as isNonPositiveFloat,Si as isNonPositiveInteger,At as isNull,B as isNumber,ni as isNumberOrNumberString,st as isObject,gt as isObjectLike,X as isPlainObject,gi as isPositiveFloat,Oi as isPositiveInteger,Ut as isPromise,Ht as isRegExp,Lt as isSet,at as isString,Ei as isStringNumber,Ct as isSymbol,Ni as isURL,C as isUndef,ii as isUpperCase,si as isUpperCaseAndNumber,ai as isUpperCaseAndNumberAndChinese,se as objectToString,Tn as omit,Gt as pick,ce as qs,jr as qsStringify,_r as throttle,h as throwError,Or as throwErrorInvalidTypeMessage,ft as toTypeString,St as toTypeValue,Kr as validatorChineseOrEnglish,Ur as validatorChineseOrEnglishOrNumber,Wr as validatorUppercaseOrNumbersOrSpecial,Zr as validatorUppercaseOrNumbersOrUnderline,Qr as withRetry};
|
|
@@ -131,7 +131,7 @@ declare const isNull: (val: unknown) => val is null;
|
|
|
131
131
|
* @param val The value to check
|
|
132
132
|
* @returns `true` if the value is undefined, otherwise `false`
|
|
133
133
|
*/
|
|
134
|
-
declare const
|
|
134
|
+
declare const isUndef: (val: unknown) => val is undefined;
|
|
135
135
|
/**
|
|
136
136
|
* Checks if a value is a symbol
|
|
137
137
|
* @param val The value to check
|
|
@@ -185,7 +185,7 @@ declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
|
|
|
185
185
|
* @param val The value to check
|
|
186
186
|
* @returns `true` if the value is undefined or null, otherwise `false`
|
|
187
187
|
*/
|
|
188
|
-
declare const
|
|
188
|
+
declare const isNil: (val: unknown) => val is undefined | null;
|
|
189
189
|
/**
|
|
190
190
|
* Checks if a value is defined (not undefined or null)
|
|
191
191
|
* @param val The value to check
|
|
@@ -200,6 +200,34 @@ declare const isDef: <T>(val: T) => val is NonNullable<T>;
|
|
|
200
200
|
*/
|
|
201
201
|
declare const hasChanged: (oldValue: unknown, newValue: unknown) => boolean;
|
|
202
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Checks if an object contains circular references.
|
|
205
|
+
*
|
|
206
|
+
* This utility performs a deep traversal of an object structure to detect circular references,
|
|
207
|
+
* where an object references itself either directly or through a chain of references.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* // Direct circular reference
|
|
211
|
+
* const obj = {}
|
|
212
|
+
* obj.self = obj
|
|
213
|
+
* hasCircularReference(obj) // => true
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* // Array with circular reference
|
|
217
|
+
* const arr = []
|
|
218
|
+
* arr.push(arr)
|
|
219
|
+
* hasCircularReference(arr) // => true
|
|
220
|
+
*
|
|
221
|
+
* @returns True if the object contains circular references, false otherwise
|
|
222
|
+
*
|
|
223
|
+
* @throws {Error} When `obj` is not an object
|
|
224
|
+
*
|
|
225
|
+
* @remarks
|
|
226
|
+
* - Supports both plain objects, function objects, and arrays
|
|
227
|
+
* - Handles nested objects and mixed object/array structures
|
|
228
|
+
*/
|
|
229
|
+
declare function hasCircularReference(obj: AnyObject): boolean;
|
|
230
|
+
|
|
203
231
|
/**
|
|
204
232
|
* Exclude certain properties from an object
|
|
205
233
|
* @param target The target object
|
|
@@ -569,62 +597,264 @@ declare global {
|
|
|
569
597
|
}
|
|
570
598
|
|
|
571
599
|
/**
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
600
|
+
* Converts an object into a URL query string with extensive customization options.
|
|
601
|
+
*
|
|
602
|
+
* This utility transforms JavaScript objects and arrays into URL-encoded query strings,
|
|
603
|
+
* supporting various formatting options including nested objects, arrays, null handling,
|
|
604
|
+
* and encoding strategies. The function provides flexible configuration for
|
|
605
|
+
* different query string formats and encoding requirements.
|
|
606
|
+
*
|
|
575
607
|
* @example
|
|
608
|
+
* // Basic usage with default settings
|
|
609
|
+
* stringify({ name: 'John', age: 30 })
|
|
610
|
+
* // Returns: "name=John&age=30"
|
|
576
611
|
*
|
|
577
|
-
*
|
|
612
|
+
* @example
|
|
613
|
+
* // Array handling with different formats
|
|
614
|
+
* stringify({ colors: ['red', 'blue', 'green'] }, { arrayFormat: 'indices' }) // => "colors[0]=red&colors[1]=blue&colors[2]=green"
|
|
578
615
|
*
|
|
579
|
-
*
|
|
616
|
+
* stringify({ colors: ['red', 'blue'] }, { arrayFormat: 'brackets' }) // => "colors[]=red&colors[]=blue"
|
|
580
617
|
*
|
|
581
|
-
*
|
|
618
|
+
* stringify({ colors: ['red', 'blue'] }, { arrayFormat: 'comma' }) // => "colors=red,blue"
|
|
582
619
|
*
|
|
583
|
-
*
|
|
620
|
+
* @example
|
|
621
|
+
* // Nested objects with dot notation
|
|
622
|
+
* stringify({ user: { name: 'John', profile: { age: 30 } } }, { allowDots: true }) // => "user.name=John&user.profile.age=30"
|
|
584
623
|
*
|
|
585
|
-
* parse('from=%E4%B8%AD%E5%9B%BD', { decode: false }) => { from: '%E4%B8%AD%E5%9B%BD' }
|
|
586
|
-
*/
|
|
587
|
-
declare function parse(str: string, options?: ParseOptions): Record<string, string>;
|
|
588
|
-
/**
|
|
589
|
-
* Convert object to query string
|
|
590
|
-
* @param obj Object to convert
|
|
591
|
-
* @return Converted string
|
|
592
624
|
* @example
|
|
593
|
-
*
|
|
594
|
-
* stringify({
|
|
595
|
-
*
|
|
596
|
-
*/
|
|
597
|
-
declare function stringify(obj: AnyObject, options?: StringifyOptions): string;
|
|
598
|
-
/**
|
|
599
|
-
* Append query string to URL
|
|
600
|
-
* @param url url
|
|
601
|
-
* @param obj Query string object
|
|
602
|
-
* @return URL with appended query string
|
|
625
|
+
* // Encoding and null handling
|
|
626
|
+
* stringify({ key: null, empty: undefined }, { skipNulls: true, strictNullHandling: true }) // => "" (skips null and undefined values)
|
|
627
|
+
*
|
|
603
628
|
* @example
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
}
|
|
629
|
+
* // With query prefix and custom delimiter
|
|
630
|
+
* stringify({ a: 1, b: 2 }, { addQueryPrefix: true, delimiter: ';' }) // => "?a=1;b=2"
|
|
631
|
+
*
|
|
632
|
+
* @returns A URL-encoded query string representation of the input object
|
|
633
|
+
*
|
|
634
|
+
* @throws {Error} When `options` is not a plain object
|
|
635
|
+
* @throws {Error} When `encode` is not a boolean
|
|
636
|
+
* @throws {Error} When `encodeValuesOnly` is not a boolean
|
|
637
|
+
* @throws {Error} When `arrayFormat` is not one of: "indices", "brackets", "repeat", "comma"
|
|
638
|
+
* @throws {Error} When `allowDots` is not a boolean
|
|
639
|
+
* @throws {Error} When `skipNulls` is not a boolean
|
|
640
|
+
* @throws {Error} When `strictNullHandling` is not a boolean
|
|
641
|
+
* @throws {Error} When `addQueryPrefix` is not a boolean
|
|
642
|
+
* @throws {Error} When `delimiter` is not a string
|
|
643
|
+
* @throws {Error} When `encodeDotInKeys` is not a boolean
|
|
644
|
+
* @throws {Error} When `commaRoundTrip` is not a boolean
|
|
645
|
+
* @throws {Error} When `allowEmptyArrays` is not a boolean
|
|
646
|
+
*
|
|
647
|
+
* @remarks
|
|
648
|
+
* - Supports nested objects and arrays with configurable formatting
|
|
649
|
+
* - Handles null, undefined, and empty values according to specified options
|
|
650
|
+
* - Provides multiple array serialization formats (indices, brackets, comma)
|
|
651
|
+
* - Supports both bracket notation and dot notation for nested objects
|
|
652
|
+
* - Uses standard URL encoding with configurable key/value encoding options
|
|
653
|
+
* - Returns empty string for non-object inputs
|
|
654
|
+
* - Preserves key order from the original object
|
|
655
|
+
* - Supports custom delimiters and query prefixes
|
|
656
|
+
*/
|
|
657
|
+
declare function qsStringify(obj: AnyObject, options?: StringifyOptions): string;
|
|
620
658
|
interface StringifyOptions {
|
|
621
659
|
/**
|
|
622
|
-
* Whether to encode
|
|
660
|
+
* Whether to URL-encode the output.
|
|
661
|
+
*
|
|
662
|
+
* When false, no encoding is performed. When true, applies URL encoding
|
|
663
|
+
* according to the `encodeValuesOnly` setting.
|
|
664
|
+
*
|
|
623
665
|
* @default true
|
|
624
666
|
*/
|
|
625
667
|
encode?: boolean;
|
|
668
|
+
/**
|
|
669
|
+
* Whether to encode only values, not keys.
|
|
670
|
+
*
|
|
671
|
+
* When true, only values are URL-encoded while keys remain unencoded.
|
|
672
|
+
* When false, both keys and values are encoded (if `encode` is true).
|
|
673
|
+
*
|
|
674
|
+
* @default false
|
|
675
|
+
*/
|
|
676
|
+
encodeValuesOnly?: boolean;
|
|
677
|
+
/**
|
|
678
|
+
* Format for serializing arrays.
|
|
679
|
+
*
|
|
680
|
+
* - 'indices': Uses indexed format like "key[0]=value1&key[1]=value2"
|
|
681
|
+
* - 'brackets': Uses bracket format like "key[]=value1&key[]=value2"
|
|
682
|
+
* - 'repeat': Uses repeated key format like "key=value1&key=value2"
|
|
683
|
+
* - 'comma': Uses comma-separated format like "key=value1,value2"
|
|
684
|
+
*
|
|
685
|
+
* @default 'indices'
|
|
686
|
+
*/
|
|
687
|
+
arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma';
|
|
688
|
+
/**
|
|
689
|
+
* Whether to use dot notation for nested objects.
|
|
690
|
+
*
|
|
691
|
+
* When true, nested objects use dot notation: "user.name=John&user.age=30".
|
|
692
|
+
* When false, uses bracket notation: "user[name]=John&user[age]=30".
|
|
693
|
+
*
|
|
694
|
+
* @default false
|
|
695
|
+
*/
|
|
696
|
+
allowDots?: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* Whether to skip null values in the output.
|
|
699
|
+
*
|
|
700
|
+
* When true, keys with null values are omitted from the result.
|
|
701
|
+
* When false, null values are included according to `strictNullHandling`.
|
|
702
|
+
*
|
|
703
|
+
* @default false
|
|
704
|
+
*/
|
|
705
|
+
skipNulls?: boolean;
|
|
706
|
+
/**
|
|
707
|
+
* How to handle null values when not skipping them.
|
|
708
|
+
*
|
|
709
|
+
* When true, null values appear as "key" without equals sign.
|
|
710
|
+
* When false, null values appear as "key=" with empty value.
|
|
711
|
+
*
|
|
712
|
+
* @default false
|
|
713
|
+
*/
|
|
714
|
+
strictNullHandling?: boolean;
|
|
715
|
+
/**
|
|
716
|
+
* Whether to add a question mark prefix to the result.
|
|
717
|
+
*
|
|
718
|
+
* When true, the result is prefixed with "?" making it ready for URL usage.
|
|
719
|
+
* When false, returns the raw query string without prefix.
|
|
720
|
+
*
|
|
721
|
+
* @default false
|
|
722
|
+
*/
|
|
723
|
+
addQueryPrefix?: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* Custom delimiter for separating key-value pairs.
|
|
726
|
+
*
|
|
727
|
+
* Allows using alternative separators instead of the standard "&".
|
|
728
|
+
* Common alternatives include ";" for some URL formats.
|
|
729
|
+
*
|
|
730
|
+
* @default '&'
|
|
731
|
+
*/
|
|
732
|
+
delimiter?: string;
|
|
733
|
+
/**
|
|
734
|
+
* Whether to encode dots in object keys.
|
|
735
|
+
*
|
|
736
|
+
* When true, dots in keys will be percent-encoded (%2E) to prevent
|
|
737
|
+
* conflicts with dot notation. Automatically enables `allowDots` if not explicitly set.
|
|
738
|
+
*
|
|
739
|
+
* @default false
|
|
740
|
+
*/
|
|
741
|
+
encodeDotInKeys?: boolean;
|
|
742
|
+
/**
|
|
743
|
+
* Whether to add square brackets for single-item comma arrays.
|
|
744
|
+
*
|
|
745
|
+
* When true and using comma format, single-item arrays will include
|
|
746
|
+
* brackets to distinguish from regular values: "key[]=value" vs "key=value".
|
|
747
|
+
*
|
|
748
|
+
* @default false
|
|
749
|
+
*/
|
|
750
|
+
commaRoundTrip?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Whether to serialize empty arrays.
|
|
753
|
+
*
|
|
754
|
+
* When true, empty arrays will be represented as "key[]" in the output.
|
|
755
|
+
* When false, empty arrays are omitted from the result.
|
|
756
|
+
*
|
|
757
|
+
* @default false
|
|
758
|
+
*/
|
|
759
|
+
allowEmptyArrays?: boolean;
|
|
626
760
|
}
|
|
627
761
|
|
|
762
|
+
/**
|
|
763
|
+
* Utility functions for working with URL query strings.
|
|
764
|
+
*
|
|
765
|
+
* This module provides a simple interface for parsing and stringifying URL query strings
|
|
766
|
+
* using the native URLSearchParams API, suitable for basic use cases.
|
|
767
|
+
*/
|
|
768
|
+
declare const qs: {
|
|
769
|
+
/**
|
|
770
|
+
* Converts a plain object into a URL query string.
|
|
771
|
+
*
|
|
772
|
+
* This utility serializes a flat object into a URL-encoded query string using
|
|
773
|
+
* the native URLSearchParams API. It handles automatic URL encoding and
|
|
774
|
+
* basic value conversion for simple object structures.
|
|
775
|
+
*
|
|
776
|
+
* @example
|
|
777
|
+
* // Basic usage with simple object
|
|
778
|
+
* qs.stringify({ name: 'John', age: 30, active: true }) // => "name=John&age=30&active=true"
|
|
779
|
+
*
|
|
780
|
+
* @example
|
|
781
|
+
* // With special characters that need encoding
|
|
782
|
+
* qs.stringify({ message: 'Hello World!', symbols: '@#$%' }) // => "message=Hello+World%21&symbols=%40%23%24%25"
|
|
783
|
+
*
|
|
784
|
+
* @returns A URL-encoded query string
|
|
785
|
+
*
|
|
786
|
+
* @throws {Error} When `obj` is not an object
|
|
787
|
+
*
|
|
788
|
+
* @remarks
|
|
789
|
+
* - Uses native URLSearchParams for encoding
|
|
790
|
+
* - Only supports flat objects (no nested structures)
|
|
791
|
+
*/
|
|
792
|
+
stringify: (obj: AnyObject) => string;
|
|
793
|
+
/**
|
|
794
|
+
* Parses a URL query string into a plain object.
|
|
795
|
+
*
|
|
796
|
+
* This utility converts URL-encoded query strings into key-value pair objects using
|
|
797
|
+
* the native URLSearchParams API. It handles standard query string formats with automatic URL decoding.
|
|
798
|
+
*
|
|
799
|
+
* @example
|
|
800
|
+
* // Basic usage with simple key-value pairs
|
|
801
|
+
* qs.parse('name=John&age=30') // => { name: 'John', age: '30' }
|
|
802
|
+
*
|
|
803
|
+
* @example
|
|
804
|
+
* // With URL-encoded values
|
|
805
|
+
* qs.parse('message=Hello%20World&special=%21%40%23') // => { message: 'Hello World', special: '!@#' }
|
|
806
|
+
*
|
|
807
|
+
* @example
|
|
808
|
+
* // Empty and undefined values
|
|
809
|
+
* qs.parse('empty=&missing&null=null') // => { empty: '', missing: '', null: 'null' }
|
|
810
|
+
*
|
|
811
|
+
* @returns A plain object containing the parsed key-value pairs as strings
|
|
812
|
+
*
|
|
813
|
+
* @throws {Error} When `str` is not a string
|
|
814
|
+
*
|
|
815
|
+
* @remarks
|
|
816
|
+
* - Uses native URLSearchParams for parsing and decoding
|
|
817
|
+
* - All values are returned as strings (no automatic type conversion)
|
|
818
|
+
* - Handles standard URL encoding/decoding automatically
|
|
819
|
+
* - Does not support nested objects or arrays
|
|
820
|
+
*/
|
|
821
|
+
parse: (str: string) => {
|
|
822
|
+
[k: string]: string;
|
|
823
|
+
};
|
|
824
|
+
/**
|
|
825
|
+
* Appends query parameters to a URL string safely.
|
|
826
|
+
*
|
|
827
|
+
* This utility intelligently appends query parameters to a URL by detecting
|
|
828
|
+
* existing query strings and using appropriate separators.
|
|
829
|
+
*
|
|
830
|
+
* @example
|
|
831
|
+
* // Adding to URL without existing query string
|
|
832
|
+
* qs.appendQueryString('https://api.example.com/users', { page: 1, limit: 10 }) // => "https://api.example.com/users?page=1&limit=10"
|
|
833
|
+
*
|
|
834
|
+
* @example
|
|
835
|
+
* // Adding to URL with existing query string
|
|
836
|
+
* qs.appendQueryString('https://api.example.com/users?sort=name', { page: 2 }) // => "https://api.example.com/users?sort=name&page=2"
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
* // Edge cases with trailing separators
|
|
840
|
+
* qs.appendQueryString('https://example.com?', { test: 'value' }) // => "https://example.com?test=value"
|
|
841
|
+
*
|
|
842
|
+
* qs.appendQueryString('https://example.com?existing=1&', { new: 'param' }) // => "https://example.com?existing=1&new=param"
|
|
843
|
+
*
|
|
844
|
+
* @returns The complete URL with appended query parameters
|
|
845
|
+
*
|
|
846
|
+
* @throws {Error} When `url` is not a string
|
|
847
|
+
* @throws {Error} When `obj` is not an object
|
|
848
|
+
*
|
|
849
|
+
* @remarks
|
|
850
|
+
* - Automatically detects existing query strings and uses appropriate separators
|
|
851
|
+
* - Handles edge cases like trailing '?' or '&' characters
|
|
852
|
+
* - Preserves existing query parameters in the URL
|
|
853
|
+
* - Uses the same encoding rules as the stringify method
|
|
854
|
+
*/
|
|
855
|
+
appendQueryString: (url: string, obj: AnyObject) => string;
|
|
856
|
+
};
|
|
857
|
+
|
|
628
858
|
/**
|
|
629
859
|
* Throttle function
|
|
630
860
|
* @param target Target function
|
|
@@ -1142,4 +1372,4 @@ declare function isDateString(val: string, format?: string): boolean;
|
|
|
1142
1372
|
*/
|
|
1143
1373
|
declare function isIdCard(val: string): boolean;
|
|
1144
1374
|
|
|
1145
|
-
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type
|
|
1375
|
+
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type PlainObject, type StringNumber, type StringifyOptions, UtilsError, type WithRetryOptions, base64Decode, base64Encode, castArray, compose, composeRight, debounce, debugWarn, debugWarnInvalidTypeMessage, decimalToBinary, deepClone, deepMerge, deprecated, generateRandomArray, generateRandomColor, generateRandomDate, generateRandomEmail, generateRandomFloat, generateRandomIdCard, generateRandomMobilePhone, generateRandomStringFromSource, getRandomInt, getRandomItem, getRandomString, getRandomUrl, hasChanged, hasCircularReference, isArray, isBoolean, isChineseString, isDate, isDateString, isDef, isEmail, isEmptyString, isEnglishAphabet, isFloat, isFunction, isIdCard, isInteger, isLowerCase, isLowerCaseAndNumber, isLowerCaseAndNumberAndChinese, isMap, isMobilePhone, isNegativeFloat, isNegativeInteger, isNil, isNonNegativeFloat, isNonNegativeInteger, isNonPositiveFloat, isNonPositiveInteger, isNull, isNumber, isNumberOrNumberString, isObject, isObjectLike, isPlainObject, isPositiveFloat, isPositiveInteger, isPromise, isRegExp, isSet, isString, isStringNumber, isSymbol, isURL, isUndef, isUpperCase, isUpperCaseAndNumber, isUpperCaseAndNumberAndChinese, objectToString, omit, pick, qs, qsStringify, throttle, throwError, throwErrorInvalidTypeMessage, toTypeString, toTypeValue, validatorChineseOrEnglish, validatorChineseOrEnglishOrNumber, validatorUppercaseOrNumbersOrSpecial, validatorUppercaseOrNumbersOrUnderline, withRetry };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @ts-self-types="./esm-bundler.d.ts" */
|
|
2
|
-
function we(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function j(e){return e!==null&&typeof e=="object"}var re=Object.prototype.toString,w=e=>re.call(e),C=e=>w(e).slice(8,-1),k=e=>typeof e=="string",p=e=>typeof e=="number"&&Number.isFinite(e),U=e=>typeof e=="boolean",Ee=e=>e===null,M=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=>j(e)&&P(e?.then)&&P(e?.catch),R=e=>e==null,Me=e=>e!=null,je=(e,t)=>e!==t;function x(e){return w(e)==="[object Object]"}function A(e){return d(e)?e:[e]}function He(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 Ze(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 Xe(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 Je(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function rt(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(!j(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)?oe(e,t,r):ne(e,t,r)}function ne(e,t,r){if(!x(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(x(e[o])||d(e[o]))&&(x(t[o])||d(t[o]))?e[o]=q(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function oe(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 lt=({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 gt(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 dt(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 ie(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 se(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 Ot={parse:ie,stringify:Q,appendQueryString:se};function Rt(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 Mt(e){return!R(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function jt(e){return!R(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function Pt(e){return!R(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function kt(e){return/^[\dA-Z_]+$/.test(e)}function vt(e){ae(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(J());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(J());try{let $=await Promise.race(f?[t(),f]:[t()]);return T($)}catch($){let _=o?n*2**(y-1):n;if(log("withRetry",`Attempt ${y}/${r} failed. Retrying in ${_}ms...`),$ instanceof Error&&$.name==="AbortError"||y===r)return O($);await new Promise(te=>setTimeout(te,_))}}})()}).finally(()=>m?.())}function ae(e){x(e)||a("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&a("withRetry",'"fn" must be a function that returns a Promise'),!M(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&a("withRetry",'"maxAttempts" must be a positive integer'),!M(e.retryDelay)&&(!p(e.retryDelay)||e.retryDelay<0)&&a("withRetry",'"retryDelay" must be a non-negative number'),!M(e.enableExponentialBackoff)&&!U(e.enableExponentialBackoff)&&a("withRetry",'"enableExponentialBackoff" must be a boolean'),!M(e.signal)&&typeof e.signal!="object"&&a("withRetry",'"signal" must be an AbortSignal')}var me="The operation was aborted";function J(e=me){let t=new Error(e);return t.name="AbortError",t}function ee(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:c=!1}=r,m={};return x(e)&&A(t).forEach(l=>{L(l)&&!o||!(n?l in e:Object.hasOwn(e,l))||!c&&(n?ce(e,l):Object.getOwnPropertyDescriptor(e,l))?.enumerable===!1||(m[l]=S(e[l]))}),m}function ce(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function ar(e,t){if(!x(e))return{};let r=S(e),n=A(t),o=Object.keys(r).filter(c=>!n.includes(c));return ee(r,o)}function br(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 hr(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}import h from"dayjs";import pe 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(ue())}=e;fe(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function fe(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 ue(){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(pe);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 b(e={}){let t=ge(e),r=de(t);be(r);let{length:n}=t;xe(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 le=16,F=1;function ge(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:le,min:F,...e.length},extra:t?[]:[...new Set(A(e.extra||[]))]}}function de(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=A(e.extra).join(""),t}function be(e){e.length===0&&a("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function xe(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 ye(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${b(1)}${b({length:u({max:30,min:1})})}${b(1)}@${g(e)}`;return/\.{2,}/.test(t)?ye():t}function Hr(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 on(){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 fn(){return g(["13","14","15","16","17","18","19"])+u(999999999).toString().padEnd(9,"0")}function bn(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${b({length:{min:4,max:8}})}`,`?id=${u()}`,`?page=${b({length:{min:2,max:4}})}`,`?query=${b({length:{min:5,max:6}})}`,`?search=${b({length:{min:1,max:4}})}`,`?token=${b({length:{min:16,max:16}})}`];return`${g(e)}${b({length:{min:5,max:25}})}${g(t)}${g(r)}`}function vn(e){return/^\d+$/.test(e)}function Fn(e){return/^[A-Z]+$/i.test(e)}function Yn(e){return/^[A-Z]+$/.test(e)}function _n(e){return/^[\dA-Z]+$/.test(e)}function Un(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function Ln(e){return/^[a-z]+$/.test(e)}function Kn(e){return/^[\da-z]+$/.test(e)}function Bn(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function Wn(e){return/^[\u4E00-\u9FA5]+$/.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\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Vn(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function eo(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function to(e){return/^[1-9]\d*$/.test(e)}function ro(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function no(e){return/^-[1-9]\d*$/.test(e)}function oo(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var mo=e=>{if(!k(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};import he from"dayjs";function po(e){return/^1[3-9]\d{9}$/.test(e)}function lo(e){return/^https?:\/\/\S+$/i.test(e)}function go(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function bo(e){return e===""}function Oe(e,t="YYYY-MM-DD HH:mm:ss"){return he(e,t,!0).isValid()}function xo(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)&&Oe(e.slice(6,14),"YYYYMMDD")}export{N as UtilsError,Xe as base64Decode,Ze as base64Encode,A as castArray,Qe as compose,Je as composeRight,rt as debounce,V as debugWarn,dt as debugWarnInvalidTypeMessage,He as decimalToBinary,S as deepClone,X as deepMerge,lt as deprecated,br as generateRandomArray,hr as generateRandomColor,v as generateRandomDate,ye as generateRandomEmail,Hr as generateRandomFloat,on as generateRandomIdCard,fn as generateRandomMobilePhone,Y as generateRandomStringFromSource,u as getRandomInt,g as getRandomItem,b as getRandomString,bn as getRandomUrl,je as hasChanged,d as isArray,U as isBoolean,Wn as isChineseString,W as isDate,Oe as isDateString,Me as isDef,go as isEmail,bo as isEmptyString,Fn as isEnglishAphabet,Hn as isFloat,P as isFunction,xo as isIdCard,eo as isInteger,Ln as isLowerCase,Kn as isLowerCaseAndNumber,Bn as isLowerCaseAndNumberAndChinese,K as isMap,po as isMobilePhone,qn as isNegativeFloat,no as isNegativeInteger,Xn as isNonNegativeFloat,ro as isNonNegativeInteger,Vn as isNonPositiveFloat,oo as isNonPositiveInteger,Ee as isNull,p as isNumber,vn as isNumberOrNumberString,we as isObject,j as isObjectLike,x as isPlainObject,Zn as isPositiveFloat,to as isPositiveInteger,G as isPromise,z as isRegExp,B as isSet,k as isString,mo as isStringNumber,L as isSymbol,lo as isURL,R as isUndef,M as isUndefined,Yn as isUpperCase,_n as isUpperCaseAndNumber,Un as isUpperCaseAndNumberAndChinese,re as objectToString,ar as omit,ee as pick,Ot as qs,Rt as throttle,a as throwError,gt as throwErrorInvalidTypeMessage,w as toTypeString,C as toTypeValue,jt as validatorChineseOrEnglish,Mt as validatorChineseOrEnglishOrNumber,Pt as validatorUppercaseOrNumbersOrSpecial,kt as validatorUppercaseOrNumbersOrUnderline,vt as withRetry};
|
|
2
|
+
function N(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function U(e){return e!==null&&typeof e=="object"}var ce=Object.prototype.toString,k=e=>ce.call(e),W=e=>k(e).slice(8,-1),M=e=>typeof e=="string",x=e=>typeof e=="number"&&Number.isFinite(e),w=e=>typeof e=="boolean",z=e=>e===null,u=e=>e===void 0,Q=e=>typeof e=="symbol",y=Array.isArray,L=e=>typeof e=="function",X=e=>k(e)==="[object Map]",J=e=>k(e)==="[object Set]",ee=e=>k(e)==="[object Date]",te=e=>k(e)==="[object RegExp]",re=e=>U(e)&&L(e?.then)&&L(e?.catch),F=e=>e==null,Ie=e=>e!=null,Ce=(e,t)=>e!==t;function O(e){return k(e)==="[object Object]"}function I(e){return y(e)?e:[e]}function Je(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 ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function et(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+=ne[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 tt(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=ne.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 ot(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function it(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function mt(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function Y(e){let t=new WeakMap;function r(n){if(!U(n))return n;if(ee(n))return new Date(n);if(te(n))return new RegExp(n);if(re(n))return n;if(t.has(n))return t.get(n);if(X(n)){let m=new Map;return t.set(n,m),n.forEach((p,d)=>m.set(r(d),r(p))),m}if(J(n)){let m=new Set;return t.set(n,m),n.forEach(p=>m.add(r(p))),m}let o=y(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 p=c[m];p.get||p.set?Object.defineProperty(o,m,p):Object.defineProperty(o,m,{...p,value:r(p.value)})}return o}return r(e)}function bt(e,t,r={}){return ie(oe(e,r),oe(t,r),r)}function ie(e,t,r){return y(e)?pe(e,t,r):ue(e,t,r)}function ue(e,t,r){if(!O(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(O(e[o])||y(e[o]))&&(O(t[o])||y(t[o]))?e[o]=ie(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function pe(e,t,r){let{mergeStrategy:n="replace"}=r;if(y(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function oe(e,t){let{deepClone:r=!0}=t;return r?Y(e):e}var v=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function i(e,t){throw new v(`[${e}] ${t}`)}function se(e,t){let r=M(e)?new v(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var wt=({from:e,replacement:t,version:r,type:n="API"})=>{se(`${n}`,`${e} is about to be deprecated in version ${r}, please use ${t} instead.`)};function Ot(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${W(n)} with value ${n}.`;i(e,o)}function At(e,t,r,n){let o=`Invalid params: type check failed for params "${t}". Expected ${r}, got ${W(n)} with value ${n}.`;se(e,o)}var H=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},B=(e,...t)=>{H("info",e,...t)};B.info=(e,...t)=>{H("info",e,...t)};B.error=(e,...t)=>{H("error",e,...t)};B.warn=(e,...t)=>{H("warn",e,...t)};typeof globalThis<"u"&&(globalThis.log=B);function Nt(e,t={}){le(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:c=!1,skipNulls:m=!1,strictNullHandling:p=!1,commaRoundTrip:d=!1,allowEmptyArrays:P=!1,addQueryPrefix:R=!1,delimiter:D="&"}=t,h=t.allowDots??!1;c&&u(t.allowDots)&&(h=!0);let b=[],E=f=>r&&!n?encodeURIComponent(f):f,K=f=>r?encodeURIComponent(f):f;function _(f,l){if(!u(l)){if(z(l)){if(m)return;b.push(`${E(f)}${p?"":"="}`);return}if(y(l)){if(l.length===0){P&&b.push(`${E(f)}[]`);return}if(o==="comma"){let T=n?l.map(K).join(","):K(l.join(","));if(l.length===1&&z(l[0])){if(m)return;b.push(`${E(f)}${d?"[]":""}${p?"":"="}`)}else l.length===1?b.push(`${E(f)}${d?"[]":""}=${T}`):b.push(`${E(f)}=${T}`);return}l.forEach((T,C)=>{let j=f;o==="indices"?j=`${f}[${C}]`:o==="brackets"&&(j=`${f}[]`),_(j,T)});return}if(N(l)){Object.keys(l).forEach(T=>{let C=f;c&&(C=C.replace(/\./g,"%2E"));let j=T;h?(c&&(j=j.replace(/\./g,"%2E")),_(`${C}.${j}`,l[T])):_(`${C}[${j}]`,l[T])});return}b.push(`${E(f)}=${K(l)}`)}}if(!N(e))return"";ae(e)&&i("stringify","Input object contains circular references, cannot stringify"),y(e)?e.forEach((f,l)=>_(`${l}`,f)):Object.keys(e).forEach(f=>_(f,e[f]));let V=b.join(D);return R&&V?`?${V}`:V}function le(e={}){O(e)||i("stringify",'"options" must be a plain object'),!u(e.encode)&&!w(e.encode)&&i("stringify",'"encode" must be a boolean'),!u(e.encodeValuesOnly)&&!w(e.encodeValuesOnly)&&i("stringify",'"encodeValuesOnly" must be a boolean'),!u(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&i("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!u(e.allowDots)&&!w(e.allowDots)&&i("stringify",'"allowDots" must be a boolean'),!u(e.skipNulls)&&!w(e.skipNulls)&&i("stringify",'"skipNulls" must be a boolean'),!u(e.strictNullHandling)&&!w(e.strictNullHandling)&&i("stringify",'"strictNullHandling" must be a boolean'),!u(e.addQueryPrefix)&&!w(e.addQueryPrefix)&&i("stringify",'"addQueryPrefix" must be a boolean'),!u(e.delimiter)&&!M(e.delimiter)&&i("stringify",'"delimiter" must be a string'),!u(e.encodeDotInKeys)&&!w(e.encodeDotInKeys)&&i("stringify",'"encodeDotInKeys" must be a boolean'),!u(e.commaRoundTrip)&&!w(e.commaRoundTrip)&&i("stringify",'"commaRoundTrip" must be a boolean'),!u(e.allowEmptyArrays)&&!w(e.allowEmptyArrays)&&i("stringify",'"allowEmptyArrays" must be a boolean')}var ge={stringify:e=>(N(e)||i("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(M(e)||i("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=ge.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Yt(e,t=500){let r=null;return function(...n){if(F(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 Lt(e){return!F(e)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(e)}function vt(e){return!F(e)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(e)}function Ht(e){return!F(e)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(e)}function Bt(e){return/^[\dA-Z_]+$/.test(e)}function Zt(e){de(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:c}=e,m,p=c?new Promise((P,R)=>{let D=()=>R(me());c.addEventListener("abort",D),m=()=>c.removeEventListener("abort",D)}):null;return new Promise((P,R)=>{(async()=>{for(let h=1;h<=r;h++){if(c?.aborted)return R(me());try{let b=await Promise.race(p?[t(),p]:[t()]);return P(b)}catch(b){let E=o?n*2**(h-1):n;if(log("withRetry",`Attempt ${h}/${r} failed. Retrying in ${E}ms...`),b instanceof Error&&b.name==="AbortError"||h===r)return R(b);await new Promise(K=>setTimeout(K,E))}}})()}).finally(()=>m?.())}function de(e){O(e)||i("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&i("withRetry",'"fn" must be a function that returns a Promise'),!u(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&i("withRetry",'"maxAttempts" must be a positive integer'),!u(e.retryDelay)&&(!x(e.retryDelay)||e.retryDelay<0)&&i("withRetry",'"retryDelay" must be a non-negative number'),!u(e.enableExponentialBackoff)&&!w(e.enableExponentialBackoff)&&i("withRetry",'"enableExponentialBackoff" must be a boolean'),!u(e.signal)&&typeof e.signal!="object"&&i("withRetry",'"signal" must be an AbortSignal')}var be="The operation was aborted";function me(e=be){let t=new Error(e);return t.name="AbortError",t}function ae(e){N(e)||i("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(N(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function fe(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:c=!1}=r,m={};return O(e)&&I(t).forEach(d=>{Q(d)&&!o||!(n?d in e:Object.hasOwn(e,d))||!c&&(n?ye(e,d):Object.getOwnPropertyDescriptor(e,d))?.enumerable===!1||(m[d]=Y(e[d]))}),m}function ye(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Er(e,t){if(!O(e))return{};let r=Y(e),n=I(t),o=Object.keys(r).filter(c=>!n.includes(c));return fe(r,o)}function Cr(e,t){return(!x(e)||e<=0)&&i("generateRandomArray","num must be greater than 0"),L(t)||i("generateRandomArray","cb must be a function"),Array.from({length:e}).fill(0).map((r,n)=>t(r,n))}function Kr(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}import S from"dayjs";import we from"dayjs/plugin/customParseFormat.js";function A(e){return e[Math.floor(Math.random()*e.length)]}function g(e={}){x(e)&&(e={max:e});let{min:t=1,max:r=A(he())}=e;xe(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function xe(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||i("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||i("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&i("getRandomInt",`No integer value found between ${e} and ${t}`),i("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function he(){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)})}S.extend(we);function G(e={}){let{start:t="1800-01-01 00:00:00",end:r=S().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=e;(!S(t).isValid()||!S(r).isValid())&&i("generateRandomDate","start and end parameters must be valid date format");let o=S(t).year(),c=S(r).year(),m=g({min:o,max:c}),p=g({min:1,max:12}),d=g({min:1,max:31}),P=g(23),R=g(59),D=g(59),h=S(`${m}-${p}-${d} ${P}:${R}:${D}`);return h.isBefore(S(t))||h.isAfter(S(r))?G(e):h.format(n)}function $(e={}){let t=Ae(e),r=$e(t);Re(r);let{length:n}=t;Ee(n.min,n.max);let o=g(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 Oe=16,Z=1;function Ae(e){let t=x(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:x(e.length)?{max:e.length,min:e.length}:{max:Oe,min:Z,...e.length},extra:t?[]:[...new Set(I(e.extra||[]))]}}function $e(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=I(e.extra).join(""),t}function Re(e){e.length===0&&i("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Ee(e,t){Number.isInteger(e)||i("getRandomString","min must be an integer"),Number.isInteger(t)||i("getRandomString","max must be an integer"),e<Z&&i("getRandomString",`Minimum length cannot be less than ${Z}`),t<e&&i("getRandomString","Maximum length cannot be less than minimum length")}function Se(){let e=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],t=`${$(1)}${$({length:g({max:30,min:1})})}${$(1)}@${A(e)}`;return/\.{2,}/.test(t)?Se():t}function ln(e={}){x(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 q(e,t){(!x(e)||e<=0)&&i("generateRandomStringFromSource","num must be greater than 0"),(!y(t)||t.length===0)&&i("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<e;n++)r+=A(t);return r}function Rn(){let e=g({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,G({format:"YYYYMMDD"}),q(3,t),q(1,[...t,"X","x"])].join("")}function Nn(){return A(["13","14","15","16","17","18","19"])+g(999999999).toString().padEnd(9,"0")}function Cn(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${$({length:{min:4,max:8}})}`,`?id=${g()}`,`?page=${$({length:{min:2,max:4}})}`,`?query=${$({length:{min:5,max:6}})}`,`?search=${$({length:{min:1,max:4}})}`,`?token=${$({length:{min:16,max:16}})}`];return`${A(e)}${$({length:{min:5,max:25}})}${A(t)}${A(r)}`}function to(e){return/^\d+$/.test(e)}function ro(e){return/^[A-Z]+$/i.test(e)}function no(e){return/^[A-Z]+$/.test(e)}function oo(e){return/^[\dA-Z]+$/.test(e)}function io(e){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(e)}function so(e){return/^[a-z]+$/.test(e)}function ao(e){return/^[\da-z]+$/.test(e)}function mo(e){return/^[\da-z\u4E00-\u9FA5]+$/.test(e)}function fo(e){return/^[\u4E00-\u9FA5]+$/.test(e)}function po(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function lo(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function go(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function bo(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function yo(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function wo(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Oo(e){return/^[1-9]\d*$/.test(e)}function Ao(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function $o(e){return/^-[1-9]\d*$/.test(e)}function Ro(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var jo=e=>{if(!M(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};import Te from"dayjs";function Do(e){return/^1[3-9]\d{9}$/.test(e)}function ko(e){return/^https?:\/\/\S+$/i.test(e)}function Io(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function Co(e){return e===""}function je(e,t="YYYY-MM-DD HH:mm:ss"){return Te(e,t,!0).isValid()}function Fo(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)&&je(e.slice(6,14),"YYYYMMDD")}export{v as UtilsError,tt as base64Decode,et as base64Encode,I as castArray,ot as compose,it as composeRight,mt as debounce,se as debugWarn,At as debugWarnInvalidTypeMessage,Je as decimalToBinary,Y as deepClone,bt as deepMerge,wt as deprecated,Cr as generateRandomArray,Kr as generateRandomColor,G as generateRandomDate,Se as generateRandomEmail,ln as generateRandomFloat,Rn as generateRandomIdCard,Nn as generateRandomMobilePhone,q as generateRandomStringFromSource,g as getRandomInt,A as getRandomItem,$ as getRandomString,Cn as getRandomUrl,Ce as hasChanged,ae as hasCircularReference,y as isArray,w as isBoolean,fo as isChineseString,ee as isDate,je as isDateString,Ie as isDef,Io as isEmail,Co as isEmptyString,ro as isEnglishAphabet,po as isFloat,L as isFunction,Fo as isIdCard,wo as isInteger,so as isLowerCase,ao as isLowerCaseAndNumber,mo as isLowerCaseAndNumberAndChinese,X as isMap,Do as isMobilePhone,bo as isNegativeFloat,$o as isNegativeInteger,F as isNil,go as isNonNegativeFloat,Ao as isNonNegativeInteger,yo as isNonPositiveFloat,Ro as isNonPositiveInteger,z as isNull,x as isNumber,to as isNumberOrNumberString,N as isObject,U as isObjectLike,O as isPlainObject,lo as isPositiveFloat,Oo as isPositiveInteger,re as isPromise,te as isRegExp,J as isSet,M as isString,jo as isStringNumber,Q as isSymbol,ko as isURL,u as isUndef,no as isUpperCase,oo as isUpperCaseAndNumber,io as isUpperCaseAndNumberAndChinese,ce as objectToString,Er as omit,fe as pick,ge as qs,Nt as qsStringify,Yt as throttle,i as throwError,Ot as throwErrorInvalidTypeMessage,k as toTypeString,W as toTypeValue,vt as validatorChineseOrEnglish,Lt as validatorChineseOrEnglishOrNumber,Ht as validatorUppercaseOrNumbersOrSpecial,Bt as validatorUppercaseOrNumbersOrUnderline,Zt as withRetry};
|
package/dist/utils.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lntvowUtils=(()=>{var Qt=Object.create;var lt=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var Ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),oe=(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 ee(e))!re.call(t,o)&&o!==n&<(t,o,{get:()=>e[o],enumerable:!(r=te(e,o))||r.enumerable});return t};var Ot=(t,e,n)=>(n=t!=null?Qt(ne(t)):{},Ut(e||!t||!t.__esModule?lt(n,"default",{value:t,enumerable:!0}):n,t)),ie=t=>Ut(lt({},"__esModule",{value:!0}),t);var It=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",k="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:k,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 G="$isDayjsObject",F=function(c){return c instanceof N||!(!c||!c[G])},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[G]=!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(V,E){var H=g.w(a.$u?Date.UTC(a.$y,E,V):new Date(a.$y,E,V),a);return f?H:H.endOf(x)},O=function(V,E){return g.w(a.toDate()[V].apply(a.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(E)),a)},D=this.$W,T=this.$M,C=this.$D,Q="set"+(this.$u?"UTC":"");switch(m){case k: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?C-rt:C+(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[k]=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===k){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 C=w(f);return g.w(C.date(C.date()+Math.round(T*i)),f)};if(m===A)return this.set(A,this.$M+i);if(m===k)return this.set(k,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,C=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")},V=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,C,3);case"MMMM":return q(C,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 V(d,O,!0);case"A":return V(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,C=function(){return g.m(m,O)};switch(d){case k:f=C()/12;break;case A:f=C();break;case j:f=C()/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}(),I=N.prototype;return w.prototype=I,[["$ms",r],["$s",o],["$m",h],["$H",l],["$W",x],["$M",A],["$y",k],["$D",v]].forEach(function(c){I[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 Gt=Ft((Ct,_t)=>{"use strict";(function(t,e){typeof Ct=="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()})(Ct,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))},k=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=k(p,!1)}],a:[h,function(p){this.afternoon=k(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 I=N&&N.toUpperCase();return g||S[N]||t[N]||S[I].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],G=v[L],F=G&&G[0],P=G&&G[1];M[Y]=P?{regex:F,parser:P}:L.replace(/^\[|\]$/g,"")}return function(w){for(var g={},N=0,I=0;N<B;N+=1){var c=M[N];if(typeof c=="string")I+=c.length;else{var s=c.regex,i=c.parser,u=w.slice(I),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,G=Y.utc,F=Y.args;this.$u=G;var P=F[1];if(typeof P=="string"){var w=F[2]===!0,g=F[3]===!0,N=w||g,I=F[2];g&&(I=F[2]),l=this.$locale(),!w&&I&&(l=S.Ls[I]),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,C=d.hours,Q=d.minutes,q=d.seconds,rt=d.milliseconds,V=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=C||0,$t=Q||0,wt=q||0,Mt=rt||0;return V?new Date(Date.UTC(tt,mt,J,xt,$t,wt,Mt+60*V.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,G,S),this.init(),I&&I!==!0&&(this.$L=this.locale(I).$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 xn={};oe(xn,{UtilsError:()=>ft,base64Decode:()=>pe,base64Encode:()=>me,castArray:()=>nt,compose:()=>le,composeRight:()=>de,debounce:()=>ge,debugWarn:()=>jt,debugWarnInvalidTypeMessage:()=>$e,decimalToBinary:()=>fe,deepClone:()=>it,deepMerge:()=>Et,deprecated:()=>ye,generateRandomArray:()=>Ne,generateRandomColor:()=>Pe,generateRandomDate:()=>bt,generateRandomEmail:()=>Xt,generateRandomFloat:()=>We,generateRandomIdCard:()=>Ze,generateRandomMobilePhone:()=>ze,generateRandomStringFromSource:()=>yt,getRandomInt:()=>R,getRandomItem:()=>U,getRandomString:()=>Z,getRandomUrl:()=>Be,hasChanged:()=>ce,isArray:()=>W,isBoolean:()=>St,isChineseString:()=>en,isDate:()=>Tt,isDateString:()=>Jt,isDef:()=>ue,isEmail:()=>hn,isEmptyString:()=>bn,isEnglishAphabet:()=>Ge,isFloat:()=>nn,isFunction:()=>ut,isIdCard:()=>yn,isInteger:()=>un,isLowerCase:()=>Je,isLowerCaseAndNumber:()=>Qe,isLowerCaseAndNumberAndChinese:()=>tn,isMap:()=>At,isMobilePhone:()=>dn,isNegativeFloat:()=>sn,isNegativeInteger:()=>mn,isNonNegativeFloat:()=>on,isNonNegativeInteger:()=>fn,isNonPositiveFloat:()=>an,isNonPositiveInteger:()=>pn,isNull:()=>ae,isNumber:()=>_,isNumberOrNumberString:()=>Ke,isObject:()=>se,isObjectLike:()=>at,isPlainObject:()=>K,isPositiveFloat:()=>rn,isPositiveInteger:()=>cn,isPromise:()=>kt,isRegExp:()=>Rt,isSet:()=>vt,isString:()=>ct,isStringNumber:()=>ln,isSymbol:()=>Dt,isURL:()=>gn,isUndef:()=>ot,isUndefined:()=>st,isUpperCase:()=>Ve,isUpperCaseAndNumber:()=>Xe,isUpperCaseAndNumberAndChinese:()=>qe,objectToString:()=>Ht,omit:()=>Ye,pick:()=>Yt,qs:()=>Oe,throttle:()=>Se,throwError:()=>$,throwErrorInvalidTypeMessage:()=>xe,toTypeString:()=>et,toTypeValue:()=>dt,validatorChineseOrEnglish:()=>Ae,validatorChineseOrEnglishOrNumber:()=>De,validatorUppercaseOrNumbersOrSpecial:()=>ve,validatorUppercaseOrNumbersOrUnderline:()=>Te,withRetry:()=>Re});function se(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",ae=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]",Rt=t=>et(t)==="[object RegExp]",kt=t=>at(t)&&ut(t?.then)&&ut(t?.catch),ot=t=>t==null,ue=t=>t!=null,ce=(t,e)=>t!==e;function K(t){return et(t)==="[object Object]"}function nt(t){return W(t)?t:[t]}function fe(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 me(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 pe(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 le(...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 ge(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(Rt(r))return new RegExp(r);if(kt(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)?be(t,e,n):he(t,e,n)}function he(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 be(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 ye=({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 xe(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 $e(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 we(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 Me(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 Oe={parse:we,stringify:Bt,appendQueryString:Me};function Se(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 De(t){return!ot(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function Ae(t){return!ot(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function ve(t){return!ot(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Te(t){return/^[\dA-Z_]+$/.test(t)}function Re(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 k=()=>j(Kt());h.addEventListener("abort",k),l=()=>h.removeEventListener("abort",k)}):null;return new Promise((A,j)=>{(async()=>{for(let v=1;v<=n;v++){if(h?.aborted)return j(Kt());try{let z=await Promise.race(x?[e(),x]:[e()]);return A(z)}catch(z){let p=o?r*2**(v-1):r;if(log("withRetry",`Attempt ${v}/${n} failed. Retrying in ${p}ms...`),z instanceof Error&&z.name==="AbortError"||v===n)return j(z);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')}var Ee="The operation was aborted";function Kt(t=Ee){let e=new Error(t);return e.name="AbortError",e}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?je(t,b):Object.getOwnPropertyDescriptor(t,b))?.enumerable===!1||(l[b]=it(t[b]))}),l}function je(t,e){let n=t;for(;n!==null;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Ye(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 Ne(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 Pe(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var X=Ot(It(),1),Vt=Ot(Gt(),1);function U(t){return t[Math.floor(Math.random()*t.length)]}function R(t={}){_(t)&&(t={max:t});let{min:e=1,max:n=U(Ce())}=t;Ie(e,n);let r=Math.ceil(e),o=Math.floor(n);return Math.floor(Math.random()*(o-r+1)+r)}function Ie(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 Ce(){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)})}X.default.extend(Vt.default);function bt(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,X.default)().format("YYYY-MM-DD HH:mm:ss"),format:r="YYYY-MM-DD HH:mm:ss"}=t;(!(0,X.default)(e).isValid()||!(0,X.default)(n).isValid())&&$("generateRandomDate","start and end parameters must be valid date format");let o=(0,X.default)(e).year(),h=(0,X.default)(n).year(),l=R({min:o,max:h}),x=R({min:1,max:12}),b=R({min:1,max:31}),A=R(23),j=R(59),k=R(59),v=(0,X.default)(`${l}-${x}-${b} ${A}:${j}:${k}`);return v.isBefore((0,X.default)(e))||v.isAfter((0,X.default)(n))?bt(t):v.format(r)}function Z(t={}){let e=Le(t),n=Fe(e);Ue(n);let{length:r}=e;He(r.min,r.max);let o=R(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 _e=16,Lt=1;function Le(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:_e,min:Lt,...t.length},extra:e?[]:[...new Set(nt(t.extra||[]))]}}function Fe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=nt(t.extra).join(""),e}function Ue(t){t.length===0&&$("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function He(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:R({max:30,min:1})})}${Z(1)}@${U(t)}`;return/\.{2,}/.test(e)?Xt():e}function We(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 Ze(){let t=R({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 ze(){return U(["13","14","15","16","17","18","19"])+R(999999999).toString().padEnd(9,"0")}function Be(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${Z({length:{min:4,max:8}})}`,`?id=${R()}`,`?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 Ke(t){return/^\d+$/.test(t)}function Ge(t){return/^[A-Z]+$/i.test(t)}function Ve(t){return/^[A-Z]+$/.test(t)}function Xe(t){return/^[\dA-Z]+$/.test(t)}function qe(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function Je(t){return/^[a-z]+$/.test(t)}function Qe(t){return/^[\da-z]+$/.test(t)}function tn(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function en(t){return/^[\u4E00-\u9FA5]+$/.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\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function an(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function un(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function cn(t){return/^[1-9]\d*$/.test(t)}function fn(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function mn(t){return/^-[1-9]\d*$/.test(t)}function pn(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var ln=t=>{if(!ct(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let n=Number(t);return!(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)};var qt=Ot(It(),1);function dn(t){return/^1[3-9]\d{9}$/.test(t)}function gn(t){return/^https?:\/\/\S+$/i.test(t)}function hn(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function bn(t){return t===""}function Jt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,qt.default)(t,e,!0).isValid()}function yn(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)&&Jt(t.slice(6,14),"YYYYMMDD")}return ie(xn);})();
|
|
1
|
+
"use strict";var lntvowUtils=(()=>{var ee=Object.create;var gt=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Ut=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),se=(t,e)=>{for(var r in e)gt(t,r,{get:e[r],enumerable:!0})},Kt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ne(e))!ie.call(t,i)&&i!==r&>(t,i,{get:()=>e[i],enumerable:!(n=re(e,i))||n.enumerable});return t};var At=(t,e,r)=>(r=t!=null?ee(oe(t)):{},Kt(e||!t||!t.__esModule?gt(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>Kt(gt({},"__esModule",{value:!0}),t);var Lt=Ut((It,Ct)=>{"use strict";(function(t,e){typeof It=="object"&&typeof Ct<"u"?Ct.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(It,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",x="minute",p="hour",M="day",h="week",E="month",C="quarter",N="year",v="date",Y="Invalid Date",c=/^(\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,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(f){var s=["th","st","nd","rd"],o=f%100;return"["+f+(s[(o-20)%10]||s[o]||s[0])+"]"}},D=function(f,s,o){var u=String(f);return!u||u.length>=s?f:""+Array(s+1-u.length).join(o)+f},$={s:D,z:function(f){var s=-f.utcOffset(),o=Math.abs(s),u=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+D(u,2,"0")+":"+D(a,2,"0")},m:function f(s,o){if(s.date()<o.date())return-f(o,s);var u=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(u,E),m=o-a<0,d=s.clone().add(u+(m?-1:1),E);return+(-(u+(o-a)/(m?a-d:d-a))||0)},a:function(f){return f<0?Math.ceil(f)||0:Math.floor(f)},p:function(f){return{M:E,y:N,w:h,d:M,D:v,h:p,m:x,s:i,ms:n,Q:C}[f]||String(f||"").toLowerCase().replace(/s$/,"")},u:function(f){return f===void 0}},w="en",R={};R[w]=O;var L="$isDayjsObject",j=function(f){return f instanceof F||!(!f||!f[L])},U=function f(s,o,u){var a;if(!s)return w;if(typeof s=="string"){var m=s.toLowerCase();R[m]&&(a=m),o&&(R[m]=o,a=m);var d=s.split("-");if(!a&&d.length>1)return f(d[0])}else{var g=s.name;R[g]=s,a=g}return!u&&a&&(w=a),a||!u&&w},S=function(f,s){if(j(f))return f.clone();var o=typeof s=="object"?s:{};return o.date=f,o.args=arguments,new F(o)},b=$;b.l=U,b.i=j,b.w=function(f,s){return S(f,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var F=function(){function f(o){this.$L=U(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[L]=!0}var s=f.prototype;return s.parse=function(o){this.$d=function(u){var a=u.date,m=u.utc;if(a===null)return new Date(NaN);if(b.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var d=a.match(c);if(d){var g=d[2]-1||0,A=(d[7]||"0").substring(0,3);return m?new Date(Date.UTC(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,A)):new Date(d[1],g,d[3]||1,d[4]||0,d[5]||0,d[6]||0,A)}}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 b},s.isValid=function(){return this.$d.toString()!==Y},s.isSame=function(o,u){var a=S(o);return this.startOf(u)<=a&&a<=this.endOf(u)},s.isAfter=function(o,u){return S(o)<this.startOf(u)},s.isBefore=function(o,u){return this.endOf(u)<S(o)},s.$g=function(o,u,a){return b.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,m=!!b.u(u)||u,d=b.p(o),g=function(X,_){var G=b.w(a.$u?Date.UTC(a.$y,_,X):new Date(a.$y,_,X),a);return m?G:G.endOf(M)},A=function(X,_){return b.w(a.toDate()[X].apply(a.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(_)),a)},T=this.$W,P=this.$M,W=this.$D,nt="set"+(this.$u?"UTC":"");switch(d){case N:return m?g(1,0):g(31,11);case E:return m?g(1,P):g(0,P+1);case h:var J=this.$locale().weekStart||0,at=(T<J?T+7:T)-J;return g(m?W-at:W+(6-at),P);case M:case v:return A(nt+"Hours",0);case p:return A(nt+"Minutes",1);case x:return A(nt+"Seconds",2);case i:return A(nt+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,u){var a,m=b.p(o),d="set"+(this.$u?"UTC":""),g=(a={},a[M]=d+"Date",a[v]=d+"Date",a[E]=d+"Month",a[N]=d+"FullYear",a[p]=d+"Hours",a[x]=d+"Minutes",a[i]=d+"Seconds",a[n]=d+"Milliseconds",a)[m],A=m===M?this.$D+(u-this.$W):u;if(m===E||m===N){var T=this.clone().set(v,1);T.$d[g](A),T.init(),this.$d=T.set(v,Math.min(this.$D,T.daysInMonth())).$d}else g&&this.$d[g](A);return this.init(),this},s.set=function(o,u){return this.clone().$set(o,u)},s.get=function(o){return this[b.p(o)]()},s.add=function(o,u){var a,m=this;o=Number(o);var d=b.p(u),g=function(P){var W=S(m);return b.w(W.date(W.date()+Math.round(P*o)),m)};if(d===E)return this.set(E,this.$M+o);if(d===N)return this.set(N,this.$y+o);if(d===M)return g(1);if(d===h)return g(7);var A=(a={},a[x]=e,a[p]=r,a[i]=t,a)[d]||1,T=this.$d.getTime()+o*A;return b.w(T,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||Y;var m=o||"YYYY-MM-DDTHH:mm:ssZ",d=b.z(this),g=this.$H,A=this.$m,T=this.$M,P=a.weekdays,W=a.months,nt=a.meridiem,J=function(_,G,tt,ot){return _&&(_[G]||_(u,m))||tt[G].slice(0,ot)},at=function(_){return b.s(g%12||12,_,"0")},X=nt||function(_,G,tt){var ot=_<12?"AM":"PM";return tt?ot.toLowerCase():ot};return m.replace(y,function(_,G){return G||function(tt){switch(tt){case"YY":return String(u.$y).slice(-2);case"YYYY":return b.s(u.$y,4,"0");case"M":return T+1;case"MM":return b.s(T+1,2,"0");case"MMM":return J(a.monthsShort,T,W,3);case"MMMM":return J(W,T);case"D":return u.$D;case"DD":return b.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return J(a.weekdaysMin,u.$W,P,2);case"ddd":return J(a.weekdaysShort,u.$W,P,3);case"dddd":return P[u.$W];case"H":return String(g);case"HH":return b.s(g,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return X(g,A,!0);case"A":return X(g,A,!1);case"m":return String(A);case"mm":return b.s(A,2,"0");case"s":return String(u.$s);case"ss":return b.s(u.$s,2,"0");case"SSS":return b.s(u.$ms,3,"0");case"Z":return d}return null}(_)||d.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,u,a){var m,d=this,g=b.p(u),A=S(o),T=(A.utcOffset()-this.utcOffset())*e,P=this-A,W=function(){return b.m(d,A)};switch(g){case N:m=W()/12;break;case E:m=W();break;case C:m=W()/3;break;case h:m=(P-T)/6048e5;break;case M:m=(P-T)/864e5;break;case p:m=P/r;break;case x:m=P/e;break;case i:m=P/t;break;default:m=P}return a?m:b.a(m)},s.daysInMonth=function(){return this.endOf(E).$D},s.$locale=function(){return R[this.$L]},s.locale=function(o,u){if(!o)return this.$L;var a=this.clone(),m=U(o,u,!0);return m&&(a.$L=m),a},s.clone=function(){return b.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()},f}(),K=F.prototype;return S.prototype=K,[["$ms",n],["$s",i],["$m",x],["$H",p],["$W",M],["$M",E],["$y",N],["$D",v]].forEach(function(f){K[f[1]]=function(s){return this.$g(s,f[0],f[1])}}),S.extend=function(f,s){return f.$i||(f(s,F,S),f.$i=!0),S},S.locale=U,S.isDayjs=j,S.unix=function(f){return S(1e3*f)},S.en=R[w],S.Ls=R,S.p={},S})});var Qt=Ut((_t,Ft)=>{"use strict";(function(t,e){typeof _t=="object"&&typeof Ft<"u"?Ft.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(_t,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,r=/\d/,n=/\d\d/,i=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,p={},M=function(c){return(c=+c)+(c>68?1900:2e3)},h=function(c){return function(y){this[c]=+y}},E=[/[+-]\d\d:?(\d\d)?|Z/,function(c){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var O=y.match(/([+-]|\d\d)/g),D=60*O[1]+(+O[2]||0);return D===0?0:O[0]==="+"?-D:D}(c)}],C=function(c){var y=p[c];return y&&(y.indexOf?y:y.s.concat(y.f))},N=function(c,y){var O,D=p.meridiem;if(D){for(var $=1;$<=24;$+=1)if(c.indexOf(D($,0,y))>-1){O=$>12;break}}else O=c===(y?"pm":"PM");return O},v={A:[x,function(c){this.afternoon=N(c,!1)}],a:[x,function(c){this.afternoon=N(c,!0)}],Q:[r,function(c){this.month=3*(c-1)+1}],S:[r,function(c){this.milliseconds=100*+c}],SS:[n,function(c){this.milliseconds=10*+c}],SSS:[/\d{3}/,function(c){this.milliseconds=+c}],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:[n,h("day")],Do:[x,function(c){var y=p.ordinal,O=c.match(/\d+/);if(this.day=O[0],y)for(var D=1;D<=31;D+=1)y(D).replace(/\[|\]/g,"")===c&&(this.day=D)}],w:[i,h("week")],ww:[n,h("week")],M:[i,h("month")],MM:[n,h("month")],MMM:[x,function(c){var y=C("months"),O=(C("monthsShort")||y.map(function(D){return D.slice(0,3)})).indexOf(c)+1;if(O<1)throw new Error;this.month=O%12||O}],MMMM:[x,function(c){var y=C("months").indexOf(c)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[n,function(c){this.year=M(c)}],YYYY:[/\d{4}/,h("year")],Z:E,ZZ:E};function Y(c){var y,O;y=c,O=p&&p.formats;for(var D=(c=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,b,F){var K=F&&F.toUpperCase();return b||O[F]||t[F]||O[K].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(f,s,o){return s||o.slice(1)})})).match(e),$=D.length,w=0;w<$;w+=1){var R=D[w],L=v[R],j=L&&L[0],U=L&&L[1];D[w]=U?{regex:j,parser:U}:R.replace(/^\[|\]$/g,"")}return function(S){for(var b={},F=0,K=0;F<$;F+=1){var f=D[F];if(typeof f=="string")K+=f.length;else{var s=f.regex,o=f.parser,u=S.slice(K),a=s.exec(u)[0];o.call(b,a),S=S.replace(a,"")}}return function(m){var d=m.afternoon;if(d!==void 0){var g=m.hours;d?g<12&&(m.hours+=12):g===12&&(m.hours=0),delete m.afternoon}}(b),b}}return function(c,y,O){O.p.customParseFormat=!0,c&&c.parseTwoDigitYear&&(M=c.parseTwoDigitYear);var D=y.prototype,$=D.parse;D.parse=function(w){var R=w.date,L=w.utc,j=w.args;this.$u=L;var U=j[1];if(typeof U=="string"){var S=j[2]===!0,b=j[3]===!0,F=S||b,K=j[2];b&&(K=j[2]),p=this.$locale(),!S&&K&&(p=O.Ls[K]),this.$d=function(u,a,m,d){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*u);var g=Y(a)(u),A=g.year,T=g.month,P=g.day,W=g.hours,nt=g.minutes,J=g.seconds,at=g.milliseconds,X=g.zone,_=g.week,G=new Date,tt=P||(A||T?1:G.getDate()),ot=A||G.getFullYear(),dt=0;A&&!T||(dt=T>0?T-1:G.getMonth());var pt,Mt=W||0,Ot=nt||0,Dt=J||0,St=at||0;return X?new Date(Date.UTC(ot,dt,tt,Mt,Ot,Dt,St+60*X.offset*1e3)):m?new Date(Date.UTC(ot,dt,tt,Mt,Ot,Dt,St)):(pt=new Date(ot,dt,tt,Mt,Ot,Dt,St),_&&(pt=d(pt).week(_).toDate()),pt)}catch{return new Date("")}}(R,U,L,O),this.init(),K&&K!==!0&&(this.$L=this.locale(K).$L),F&&R!=this.format(U)&&(this.$d=new Date("")),p={}}else if(U instanceof Array)for(var f=U.length,s=1;s<=f;s+=1){j[1]=U[s-1];var o=O.apply(this,j);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===f&&(this.$d=new Date(""))}else $.call(this,w)}}})});var yr={};se(yr,{UtilsError:()=>lt,base64Decode:()=>le,base64Encode:()=>me,castArray:()=>st,compose:()=>de,composeRight:()=>pe,debounce:()=>ge,debugWarn:()=>Nt,debugWarnInvalidTypeMessage:()=>we,decimalToBinary:()=>ce,deepClone:()=>ft,deepMerge:()=>he,deprecated:()=>xe,generateRandomArray:()=>Ye,generateRandomColor:()=>Pe,generateRandomDate:()=>$t,generateRandomEmail:()=>qt,generateRandomFloat:()=>Ke,generateRandomIdCard:()=>We,generateRandomMobilePhone:()=>Ze,generateRandomStringFromSource:()=>wt,getRandomInt:()=>I,getRandomItem:()=>B,getRandomString:()=>Q,getRandomUrl:()=>ze,hasChanged:()=>fe,hasCircularReference:()=>Yt,isArray:()=>H,isBoolean:()=>z,isChineseString:()=>er,isDate:()=>jt,isDateString:()=>te,isDef:()=>ue,isEmail:()=>gr,isEmptyString:()=>hr,isEnglishAphabet:()=>Be,isFloat:()=>rr,isFunction:()=>mt,isIdCard:()=>br,isInteger:()=>ar,isLowerCase:()=>qe,isLowerCaseAndNumber:()=>Je,isLowerCaseAndNumberAndChinese:()=>tr,isMap:()=>Et,isMobilePhone:()=>dr,isNegativeFloat:()=>ir,isNegativeInteger:()=>cr,isNil:()=>ut,isNonNegativeFloat:()=>or,isNonNegativeInteger:()=>fr,isNonPositiveFloat:()=>sr,isNonPositiveInteger:()=>mr,isNull:()=>bt,isNumber:()=>Z,isNumberOrNumberString:()=>Ve,isObject:()=>et,isObjectLike:()=>ct,isPlainObject:()=>V,isPositiveFloat:()=>nr,isPositiveInteger:()=>ur,isPromise:()=>kt,isRegExp:()=>vt,isSet:()=>Rt,isString:()=>rt,isStringNumber:()=>lr,isSymbol:()=>Tt,isURL:()=>pr,isUndef:()=>k,isUpperCase:()=>Ge,isUpperCaseAndNumber:()=>Qe,isUpperCaseAndNumberAndChinese:()=>Xe,objectToString:()=>Wt,omit:()=>Ne,pick:()=>Pt,qs:()=>Bt,qsStringify:()=>Me,throttle:()=>De,throwError:()=>l,throwErrorInvalidTypeMessage:()=>$e,toTypeString:()=>it,toTypeValue:()=>ht,validatorChineseOrEnglish:()=>Ae,validatorChineseOrEnglishOrNumber:()=>Se,validatorUppercaseOrNumbersOrSpecial:()=>Te,validatorUppercaseOrNumbersOrUnderline:()=>Ee,withRetry:()=>Re});function et(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ct(t){return t!==null&&typeof t=="object"}var Wt=Object.prototype.toString,it=t=>Wt.call(t),ht=t=>it(t).slice(8,-1),rt=t=>typeof t=="string",Z=t=>typeof t=="number"&&Number.isFinite(t),z=t=>typeof t=="boolean",bt=t=>t===null,k=t=>t===void 0,Tt=t=>typeof t=="symbol",H=Array.isArray,mt=t=>typeof t=="function",Et=t=>it(t)==="[object Map]",Rt=t=>it(t)==="[object Set]",jt=t=>it(t)==="[object Date]",vt=t=>it(t)==="[object RegExp]",kt=t=>ct(t)&&mt(t?.then)&&mt(t?.catch),ut=t=>t==null,ue=t=>t!=null,fe=(t,e)=>t!==e;function V(t){return it(t)==="[object Object]"}function st(t){return H(t)?t:[t]}function ce(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Zt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function me(t){let e="",r="";for(let i=0;i<t.length;i++)r+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<r.length;i+=6)e+=Zt[Number.parseInt(r.slice(i,i+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function le(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Zt.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let i=Number.parseInt(r.slice(n,n+8),2);i&&(e+=String.fromCharCode(i))}return e}function de(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function pe(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function ge(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}function ft(t){let e=new WeakMap;function r(n){if(!ct(n))return n;if(jt(n))return new Date(n);if(vt(n))return new RegExp(n);if(kt(n))return n;if(e.has(n))return e.get(n);if(Et(n)){let p=new Map;return e.set(n,p),n.forEach((M,h)=>p.set(r(h),r(M))),p}if(Rt(n)){let p=new Set;return e.set(n,p),n.forEach(M=>p.add(r(M))),p}let i=H(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,i);let x=Object.getOwnPropertyDescriptors(n);for(let p of Reflect.ownKeys(x)){let M=x[p];M.get||M.set?Object.defineProperty(i,p,M):Object.defineProperty(i,p,{...M,value:r(M.value)})}return i}return r(t)}function he(t,e,r={}){return Vt(zt(t,r),zt(e,r),r)}function Vt(t,e,r){return H(t)?ye(t,e,r):be(t,e,r)}function be(t,e,r){if(!V(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(V(t[i])||H(t[i]))&&(V(e[i])||H(e[i]))?t[i]=Vt(t[i],e[i],r):Object.defineProperty(t,i,n[i])}),t}function ye(t,e,r){let{mergeStrategy:n="replace"}=r;if(H(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function zt(t,e){let{deepClone:r=!0}=e;return r?ft(t):t}var lt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function l(t,e){throw new lt(`[${t}] ${e}`)}function Nt(t,e){let r=rt(t)?new lt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var xe=({from:t,replacement:e,version:r,type:n="API"})=>{Nt(`${n}`,`${t} is about to be deprecated in version ${r}, please use ${e} instead.`)};function $e(t,e,r,n){let i=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${ht(n)} with value ${n}.`;l(t,i)}function we(t,e,r,n){let i=`Invalid params: type check failed for params "${e}". Expected ${r}, got ${ht(n)} with value ${n}.`;Nt(t,i)}var yt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},xt=(t,...e)=>{yt("info",t,...e)};xt.info=(t,...e)=>{yt("info",t,...e)};xt.error=(t,...e)=>{yt("error",t,...e)};xt.warn=(t,...e)=>{yt("warn",t,...e)};typeof globalThis<"u"&&(globalThis.log=xt);function Me(t,e={}){Oe(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:i="indices",encodeDotInKeys:x=!1,skipNulls:p=!1,strictNullHandling:M=!1,commaRoundTrip:h=!1,allowEmptyArrays:E=!1,addQueryPrefix:C=!1,delimiter:N="&"}=e,v=e.allowDots??!1;x&&k(e.allowDots)&&(v=!0);let Y=[],c=$=>r&&!n?encodeURIComponent($):$,y=$=>r?encodeURIComponent($):$;function O($,w){if(!k(w)){if(bt(w)){if(p)return;Y.push(`${c($)}${M?"":"="}`);return}if(H(w)){if(w.length===0){E&&Y.push(`${c($)}[]`);return}if(i==="comma"){let R=n?w.map(y).join(","):y(w.join(","));if(w.length===1&&bt(w[0])){if(p)return;Y.push(`${c($)}${h?"[]":""}${M?"":"="}`)}else w.length===1?Y.push(`${c($)}${h?"[]":""}=${R}`):Y.push(`${c($)}=${R}`);return}w.forEach((R,L)=>{let j=$;i==="indices"?j=`${$}[${L}]`:i==="brackets"&&(j=`${$}[]`),O(j,R)});return}if(et(w)){Object.keys(w).forEach(R=>{let L=$;x&&(L=L.replace(/\./g,"%2E"));let j=R;v?(x&&(j=j.replace(/\./g,"%2E")),O(`${L}.${j}`,w[R])):O(`${L}[${j}]`,w[R])});return}Y.push(`${c($)}=${y(w)}`)}}if(!et(t))return"";Yt(t)&&l("stringify","Input object contains circular references, cannot stringify"),H(t)?t.forEach(($,w)=>O(`${w}`,$)):Object.keys(t).forEach($=>O($,t[$]));let D=Y.join(N);return C&&D?`?${D}`:D}function Oe(t={}){V(t)||l("stringify",'"options" must be a plain object'),!k(t.encode)&&!z(t.encode)&&l("stringify",'"encode" must be a boolean'),!k(t.encodeValuesOnly)&&!z(t.encodeValuesOnly)&&l("stringify",'"encodeValuesOnly" must be a boolean'),!k(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&l("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!k(t.allowDots)&&!z(t.allowDots)&&l("stringify",'"allowDots" must be a boolean'),!k(t.skipNulls)&&!z(t.skipNulls)&&l("stringify",'"skipNulls" must be a boolean'),!k(t.strictNullHandling)&&!z(t.strictNullHandling)&&l("stringify",'"strictNullHandling" must be a boolean'),!k(t.addQueryPrefix)&&!z(t.addQueryPrefix)&&l("stringify",'"addQueryPrefix" must be a boolean'),!k(t.delimiter)&&!rt(t.delimiter)&&l("stringify",'"delimiter" must be a string'),!k(t.encodeDotInKeys)&&!z(t.encodeDotInKeys)&&l("stringify",'"encodeDotInKeys" must be a boolean'),!k(t.commaRoundTrip)&&!z(t.commaRoundTrip)&&l("stringify",'"commaRoundTrip" must be a boolean'),!k(t.allowEmptyArrays)&&!z(t.allowEmptyArrays)&&l("stringify",'"allowEmptyArrays" must be a boolean')}var Bt={stringify:t=>(et(t)||l("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(rt(t)||l("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=Bt.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};function De(t,e=500){let r=null;return function(...n){if(ut(r))return r=Date.now(),t.apply(this,n);let i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}function Se(t){return!ut(t)&&/^[\dA-Z\u4E00-\u9FA5]+$/i.test(t)}function Ae(t){return!ut(t)&&/^[A-Z\u4E00-\u9FA5]+$/i.test(t)}function Te(t){return!ut(t)&&/^[\d!"#$%&'()*+,./:;<=>?@A-Z[\\\]^_`{|}~]+$/.test(t)}function Ee(t){return/^[\dA-Z_]+$/.test(t)}function Re(t){je(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:i=!1,signal:x}=t,p,M=x?new Promise((E,C)=>{let N=()=>C(Gt());x.addEventListener("abort",N),p=()=>x.removeEventListener("abort",N)}):null;return new Promise((E,C)=>{(async()=>{for(let v=1;v<=r;v++){if(x?.aborted)return C(Gt());try{let Y=await Promise.race(M?[e(),M]:[e()]);return E(Y)}catch(Y){let c=i?n*2**(v-1):n;if(log("withRetry",`Attempt ${v}/${r} failed. Retrying in ${c}ms...`),Y instanceof Error&&Y.name==="AbortError"||v===r)return C(Y);await new Promise(y=>setTimeout(y,c))}}})()}).finally(()=>p?.())}function je(t){V(t)||l("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&l("withRetry",'"fn" must be a function that returns a Promise'),!k(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&l("withRetry",'"maxAttempts" must be a positive integer'),!k(t.retryDelay)&&(!Z(t.retryDelay)||t.retryDelay<0)&&l("withRetry",'"retryDelay" must be a non-negative number'),!k(t.enableExponentialBackoff)&&!z(t.enableExponentialBackoff)&&l("withRetry",'"enableExponentialBackoff" must be a boolean'),!k(t.signal)&&typeof t.signal!="object"&&l("withRetry",'"signal" must be an AbortSignal')}var ve="The operation was aborted";function Gt(t=ve){let e=new Error(t);return e.name="AbortError",e}function Yt(t){et(t)||l("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(et(n)){if(e.has(n))return!0;e.add(n);for(let i of Object.keys(n))if(r(n[i]))return!0;e.delete(n)}return!1}return r(t)}function Pt(t,e,r={}){let{includeProto:n=!1,includeSymbols:i=!0,includeNonEnum:x=!1}=r,p={};return V(t)&&st(e).forEach(h=>{Tt(h)&&!i||!(n?h in t:Object.hasOwn(t,h))||!x&&(n?ke(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(p[h]=ft(t[h]))}),p}function ke(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Ne(t,e){if(!V(t))return{};let r=ft(t),n=st(e),i=Object.keys(r).filter(x=>!n.includes(x));return Pt(r,i)}function Ye(t,e){return(!Z(t)||t<=0)&&l("generateRandomArray","num must be greater than 0"),mt(e)||l("generateRandomArray","cb must be a function"),Array.from({length:t}).fill(0).map((r,n)=>e(r,n))}function Pe(){return`#${Math.random().toString(16).slice(2,8).padEnd(6,"0")}`}var q=At(Lt(),1),Xt=At(Qt(),1);function B(t){return t[Math.floor(Math.random()*t.length)]}function I(t={}){Z(t)&&(t={max:t});let{min:e=1,max:r=B(Ce())}=t;Ie(e,r);let n=Math.ceil(e),i=Math.floor(r);return Math.floor(Math.random()*(i-n+1)+n)}function Ie(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||l("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||l("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&l("getRandomInt",`No integer value found between ${t} and ${e}`),l("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Ce(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}q.default.extend(Xt.default);function $t(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,q.default)().format("YYYY-MM-DD HH:mm:ss"),format:n="YYYY-MM-DD HH:mm:ss"}=t;(!(0,q.default)(e).isValid()||!(0,q.default)(r).isValid())&&l("generateRandomDate","start and end parameters must be valid date format");let i=(0,q.default)(e).year(),x=(0,q.default)(r).year(),p=I({min:i,max:x}),M=I({min:1,max:12}),h=I({min:1,max:31}),E=I(23),C=I(59),N=I(59),v=(0,q.default)(`${p}-${M}-${h} ${E}:${C}:${N}`);return v.isBefore((0,q.default)(e))||v.isAfter((0,q.default)(r))?$t(t):v.format(n)}function Q(t={}){let e=_e(t),r=Fe(e);He(r);let{length:n}=e;Ue(n.min,n.max);let i=I(n),x=e.prefix||"";for(let p=0;p<i;p++)x+=r.charAt(Math.floor(Math.random()*r.length));return x+(e.suffix||"")}var Le=16,Ht=1;function _e(t){let e=Z(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:Z(t.length)?{max:t.length,min:t.length}:{max:Le,min:Ht,...t.length},extra:e?[]:[...new Set(st(t.extra||[]))]}}function Fe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=st(t.extra).join(""),e}function He(t){t.length===0&&l("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Ue(t,e){Number.isInteger(t)||l("getRandomString","min must be an integer"),Number.isInteger(e)||l("getRandomString","max must be an integer"),t<Ht&&l("getRandomString",`Minimum length cannot be less than ${Ht}`),e<t&&l("getRandomString","Maximum length cannot be less than minimum length")}function qt(){let t=["gmail.com","outlook.com.cn","example.com","qq.com","163.com","test.com.cn"],e=`${Q(1)}${Q({length:I({max:30,min:1})})}${Q(1)}@${B(t)}`;return/\.{2,}/.test(e)?qt():e}function Ke(t={}){Z(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if(e===r)return e;if(e>r)throw new Error(`Maximum value ${r} should be greater than minimum value ${e}`);return Math.random()*(r-e)+e}function wt(t,e){(!Z(t)||t<=0)&&l("generateRandomStringFromSource","num must be greater than 0"),(!H(e)||e.length===0)&&l("generateRandomStringFromSource","source cannot be empty array");let r="";for(let n=0;n<t;n++)r+=B(e);return r}function We(){let t=I({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,$t({format:"YYYYMMDD"}),wt(3,e),wt(1,[...e,"X","x"])].join("")}function Ze(){return B(["13","14","15","16","17","18","19"])+I(999999999).toString().padEnd(9,"0")}function ze(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${Q({length:{min:4,max:8}})}`,`?id=${I()}`,`?page=${Q({length:{min:2,max:4}})}`,`?query=${Q({length:{min:5,max:6}})}`,`?search=${Q({length:{min:1,max:4}})}`,`?token=${Q({length:{min:16,max:16}})}`];return`${B(t)}${Q({length:{min:5,max:25}})}${B(e)}${B(r)}`}function Ve(t){return/^\d+$/.test(t)}function Be(t){return/^[A-Z]+$/i.test(t)}function Ge(t){return/^[A-Z]+$/.test(t)}function Qe(t){return/^[\dA-Z]+$/.test(t)}function Xe(t){return/^[\dA-Z\u4E00-\u9FA5]+$/.test(t)}function qe(t){return/^[a-z]+$/.test(t)}function Je(t){return/^[\da-z]+$/.test(t)}function tr(t){return/^[\da-z\u4E00-\u9FA5]+$/.test(t)}function er(t){return/^[\u4E00-\u9FA5]+$/.test(t)}function rr(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function nr(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function or(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ir(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function sr(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function ar(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function ur(t){return/^[1-9]\d*$/.test(t)}function fr(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function cr(t){return/^-[1-9]\d*$/.test(t)}function mr(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var lr=t=>{if(!rt(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};var Jt=At(Lt(),1);function dr(t){return/^1[3-9]\d{9}$/.test(t)}function pr(t){return/^https?:\/\/\S+$/i.test(t)}function gr(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function hr(t){return t===""}function te(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Jt.default)(t,e,!0).isValid()}function br(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)&&te(t.slice(6,14),"YYYYMMDD")}return ae(yr);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript utilities",
|
|
6
6
|
"keywords": [
|
|
@@ -31,8 +31,9 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@commitlint/cli": "^19.8.1",
|
|
33
33
|
"@commitlint/config-conventional": "^19.8.1",
|
|
34
|
-
"@lntvow/eslint-config": "^9.28.
|
|
34
|
+
"@lntvow/eslint-config": "^9.28.7",
|
|
35
35
|
"@types/node": "^24.0.3",
|
|
36
|
+
"@types/qs": "^6.14.0",
|
|
36
37
|
"@vitest/coverage-v8": "^3.2.4",
|
|
37
38
|
"@vitest/ui": "^3.2.4",
|
|
38
39
|
"bumpp": "^10.2.0",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"lint-staged": "^16.1.2",
|
|
43
44
|
"npm-run-all": "^4.1.5",
|
|
44
45
|
"prettier": "^3.6.2",
|
|
46
|
+
"qs": "^6.14.0",
|
|
45
47
|
"simple-git-hooks": "^2.13.0",
|
|
46
48
|
"tsup": "^8.5.0",
|
|
47
49
|
"typescript": "^5.8.3",
|