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