@lntvow/utils 4.6.1 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var xe=Object.create;var V=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var we=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Ae=(e,t)=>{for(var r in t)V(e,r,{get:t[r],enumerable:!0})},me=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Oe(t))!Re.call(e,o)&&o!==r&&V(e,o,{get:()=>t[o],enumerable:!(n=he(t,o))||n.enumerable});return e};var v=(e,t,r)=>(r=e!=null?xe(we(e)):{},me(t||!e||!e.__esModule?V(r,"default",{value:e,enumerable:!0}):r,e)),Te=e=>me(V({},"__esModule",{value:!0}),e);var wt={};Ae(wt,{UtilsError:()=>U,base64Decode:()=>Ne,base64Encode:()=>De,castArray:()=>N,compose:()=>Me,composeRight:()=>Pe,debounce:()=>Ie,debugWarn:()=>_e,decimalToBinary:()=>$e,deepClone:()=>M,deepMerge:()=>ke,generateRandomArray:()=>st,generateRandomColor:()=>mt,generateRandomDate:()=>ae,generateRandomEmail:()=>bt,generateRandomFloat:()=>yt,generateRandomIdCard:()=>xt,generateRandomMobilePhone:()=>ht,generateRandomStringFromSource:()=>W,getRandomInt:()=>O,getRandomItem:()=>h,getRandomString:()=>w,getRandomUrl:()=>Ot,hasChanged:()=>Ee,hasCircularReference:()=>te,isArray:()=>d,isBoolean:()=>y,isDate:()=>X,isDateString:()=>oe,isDef:()=>je,isEmail:()=>tt,isEmptyString:()=>rt,isFloat:()=>We,isFunction:()=>L,isIdCard:()=>nt,isInteger:()=>Xe,isMap:()=>q,isMobilePhone:()=>ot,isNegativeFloat:()=>qe,isNegativeInteger:()=>Ze,isNil:()=>ee,isNonNegativeFloat:()=>ze,isNonNegativeInteger:()=>ne,isNonPositiveFloat:()=>Qe,isNonPositiveInteger:()=>et,isNull:()=>H,isNumber:()=>l,isObject:()=>A,isObjectLike:()=>Y,isPlainObject:()=>x,isPositiveFloat:()=>Ge,isPositiveInteger:()=>Je,isPromise:()=>Z,isRegExp:()=>J,isSet:()=>Q,isString:()=>T,isStringNumber:()=>it,isSymbol:()=>z,isURL:()=>at,isUndef:()=>c,log:()=>I,objectToString:()=>fe,omit:()=>He,pick:()=>re,qs:()=>le,qsStringify:()=>Ke,throttle:()=>Le,throwError:()=>i,toTypeString:()=>D,toTypeValue:()=>Se,withRetry:()=>Ue});module.exports=Te(wt);function A(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function Y(e){return e!==null&&typeof e=="object"}var fe=Object.prototype.toString,D=e=>fe.call(e),Se=e=>D(e).slice(8,-1),T=e=>typeof e=="string",l=e=>typeof e=="number"&&Number.isFinite(e),y=e=>typeof e=="boolean",H=e=>e===null,c=e=>e===void 0,z=e=>typeof e=="symbol",d=Array.isArray,L=e=>typeof e=="function",q=e=>D(e)==="[object Map]",Q=e=>D(e)==="[object Set]",X=e=>D(e)==="[object Date]",J=e=>D(e)==="[object RegExp]",Z=e=>Y(e)&&L(e?.then)&&L(e?.catch),ee=e=>e==null,je=e=>e!=null,Ee=(e,t)=>e!==t;function x(e){return D(e)==="[object Object]"}function N(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 ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function De(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+=ce[Number.parseInt(r.slice(o,o+6).padEnd(6,"0"),2)];let n=t.length%4;return n!==0&&(t+="=".repeat(4-n)),t}function Ne(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=ce.indexOf(e[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let o=Number.parseInt(r.slice(n,n+8),2);o&&(t+=String.fromCharCode(o))}return t}function Me(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function Pe(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function Ie(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function M(e){let t=new WeakMap;function r(n){if(!Y(n))return n;if(X(n))return new Date(n);if(J(n))return new RegExp(n);if(Z(n))return n;if(t.has(n))return t.get(n);if(q(n)){let s=new Map;return t.set(n,s),n.forEach((u,g)=>s.set(r(g),r(u))),s}if(Q(n)){let s=new Set;return t.set(n,s),n.forEach(u=>s.add(r(u))),s}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 s of Reflect.ownKeys(m)){let u=m[s];u.get||u.set?Object.defineProperty(o,s,u):Object.defineProperty(o,s,{...u,value:r(u.value)})}return o}return r(e)}function ke(e,t,r={}){return pe(ue(e,r),ue(t,r),r)}function pe(e,t,r){return d(e)?Ce(e,t,r):Fe(e,t,r)}function Fe(e,t,r){if(!x(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(x(e[o])||d(e[o]))&&(x(t[o])||d(t[o]))?e[o]=pe(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function Ce(e,t,r){let{mergeStrategy:n="replace"}=r;if(d(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ue(e,t){let{deepClone:r=!0}=t;return r?M(e):e}var U=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function i(e,t){throw new U(`[${e}] ${t}`)}function _e(e,t){let r=T(e)?new U(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var B=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},I=(e,...t)=>{B("info",e,...t)};I.info=(e,...t)=>{B("info",e,...t)};I.warn=(e,...t)=>{B("warn",e,...t)};I.error=(e,...t)=>{B("error",e,...t)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=e=>B=e);function Ke(e,t={}){Ye(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:m=!1,skipNulls:s=!1,strictNullHandling:u=!1,commaRoundTrip:g=!1,allowEmptyArrays:F=!1,addQueryPrefix:S=!1,delimiter:C="&"}=t,j=t.allowDots??!1;m&&c(t.allowDots)&&(j=!0);let b=[],R=f=>r&&!n?encodeURIComponent(f):f,_=f=>r?encodeURIComponent(f):f;function K(f,p){if(!c(p)){if(H(p)){if(s)return;b.push(`${R(f)}${u?"":"="}`);return}if(d(p)){if(p.length===0){F&&b.push(`${R(f)}[]`);return}if(o==="comma"){let E=n?p.map(_).join(","):_(p.join(","));if(p.length===1&&H(p[0])){if(s)return;b.push(`${R(f)}${g?"[]":""}${u?"":"="}`)}else p.length===1?b.push(`${R(f)}${g?"[]":""}=${E}`):b.push(`${R(f)}=${E}`);return}p.forEach((E,P)=>{let $=f;o==="indices"?$=`${f}[${P}]`:o==="brackets"&&($=`${f}[]`),K($,E)});return}if(A(p)){Object.keys(p).forEach(E=>{let P=f;m&&(P=P.replace(/\./g,"%2E"));let $=E;j?(m&&($=$.replace(/\./g,"%2E")),K(`${P}.${$}`,p[E])):K(`${P}[${$}]`,p[E])});return}b.push(`${R(f)}=${_(p)}`)}}if(!A(e))return"";te(e)&&i("stringify","Input object contains circular references, cannot stringify"),d(e)?e.forEach((f,p)=>K(`${p}`,f)):Object.keys(e).forEach(f=>K(f,e[f]));let G=b.join(C);return S&&G?`?${G}`:G}function Ye(e={}){x(e)||i("stringify",'"options" must be a plain object'),!c(e.encode)&&!y(e.encode)&&i("stringify",'"encode" must be a boolean'),!c(e.encodeValuesOnly)&&!y(e.encodeValuesOnly)&&i("stringify",'"encodeValuesOnly" must be a boolean'),!c(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&i("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!c(e.allowDots)&&!y(e.allowDots)&&i("stringify",'"allowDots" must be a boolean'),!c(e.skipNulls)&&!y(e.skipNulls)&&i("stringify",'"skipNulls" must be a boolean'),!c(e.strictNullHandling)&&!y(e.strictNullHandling)&&i("stringify",'"strictNullHandling" must be a boolean'),!c(e.addQueryPrefix)&&!y(e.addQueryPrefix)&&i("stringify",'"addQueryPrefix" must be a boolean'),!c(e.delimiter)&&!T(e.delimiter)&&i("stringify",'"delimiter" must be a string'),!c(e.encodeDotInKeys)&&!y(e.encodeDotInKeys)&&i("stringify",'"encodeDotInKeys" must be a boolean'),!c(e.commaRoundTrip)&&!y(e.commaRoundTrip)&&i("stringify",'"commaRoundTrip" must be a boolean'),!c(e.allowEmptyArrays)&&!y(e.allowEmptyArrays)&&i("stringify",'"allowEmptyArrays" must be a boolean')}var le={stringify:e=>(A(e)||i("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(T(e)||i("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=le.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Le(e,t=500){let r=null;return function(...n){if(ee(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 Ue(e){Be(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:m}=e,s,u=m?new Promise((F,S)=>{let C=()=>S(ge());m.addEventListener("abort",C),s=()=>m.removeEventListener("abort",C)}):null;return new Promise((F,S)=>{(async()=>{for(let j=1;j<=r;j++){if(m?.aborted)return S(ge());try{let b=await Promise.race(u?[t(),u]:[t()]);return F(b)}catch(b){let R=o?n*2**(j-1):n;if(I("withRetry",`Attempt ${j}/${r} failed. Retrying in ${R}ms...`),b instanceof Error&&b.name==="AbortError"||j===r)return S(b);await new Promise(_=>setTimeout(_,R))}}})()}).finally(()=>s?.())}function Be(e){x(e)||i("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&i("withRetry",'"fn" must be a function that returns a Promise'),!c(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&i("withRetry",'"maxAttempts" must be a positive integer'),!c(e.retryDelay)&&(!l(e.retryDelay)||e.retryDelay<0)&&i("withRetry",'"retryDelay" must be a non-negative number'),!c(e.enableExponentialBackoff)&&!y(e.enableExponentialBackoff)&&i("withRetry",'"enableExponentialBackoff" must be a boolean'),!c(e.signal)&&typeof e.signal!="object"&&i("withRetry",'"signal" must be an AbortSignal')}var Ve="The operation was aborted";function ge(e=Ve){let t=new Error(e);return t.name="AbortError",t}function te(e){A(e)||i("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if(A(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function re(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:m=!1}=r,s={};return x(e)&&N(t).forEach(g=>{z(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!m&&(n?ve(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(s[g]=M(e[g]))}),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 He(e,t){if(!x(e))return{};let r=M(e),n=N(t),o=Object.keys(r).filter(m=>!n.includes(m));return re(r,o)}function We(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Ge(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function ze(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function qe(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Qe(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Xe(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Je(e){return/^[1-9]\d*$/.test(e)}function ne(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Ze(e){return/^-[1-9]\d*$/.test(e)}function et(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var de=v(require("dayjs"),1);function oe(e,t="YYYY-MM-DD HH:mm:ss"){return(0,de.default)(e,t,!0).isValid()}function tt(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function rt(e){return e===""}var ie=v(require("dayjs"),1);function nt(e){if(!/^[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))return!1;let r=e.slice(6,14);return oe(r,"YYYYMMDD")&&(0,ie.default)(r,"YYYYMMDD").isBefore((0,ie.default)())}function ot(e){return/^1[3-9]\d{9}$/.test(e)}var it=e=>{if(!T(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function at(e){return/^https?:\/\/\S+$/i.test(e)}function st(e,t){return(!l(e)||!ne(e.toString()))&&i("generateRandomArray","num must be greater than 0"),L(t)||i("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function mt(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var k=v(require("dayjs"),1),ye=v(require("dayjs/plugin/customParseFormat.js"),1);function h(e){return e[Math.floor(Math.random()*e.length)]}function O(e={}){l(e)&&(e={max:e});let{min:t=1,max:r=h(ct())}=e;ft(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function ft(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||i("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||i("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&i("getRandomInt",`No integer value found between ${e} and ${t}`),i("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function ct(){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)})}k.default.extend(ye.default);function ae(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,k.default)().format(be),format:n=be}=e,o=(0,k.default)(t),m=(0,k.default)(r);(!o.isValid()||!m.isValid())&&i("generateRandomDate","start and end parameters must be valid date format"),o.isAfter(m)&&i("generateRandomDate","start date must be before end date");let s=o.valueOf(),u=m.valueOf(),g=O({min:s,max:u});return(0,k.default)(g).format(n)}var be="YYYY-MM-DD HH:mm:ss";function w(e={}){let t=pt(e),r=lt(t);gt(r);let{length:n}=t;dt(n.min,n.max);let o=O(n),m=t.prefix||"";for(let s=0;s<o;s++)m+=r.charAt(Math.floor(Math.random()*r.length));return m+(t.suffix||"")}var ut=16,se=1;function pt(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:ut,min:se,...e.length},extra:t?[]:[...new Set(N(e.extra||[]))]}}function lt(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=N(e.extra).join(""),t}function gt(e){e.length===0&&i("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function dt(e,t){Number.isInteger(e)||i("getRandomString","min must be an integer"),Number.isInteger(t)||i("getRandomString","max must be an integer"),e<se&&i("getRandomString",`Minimum length cannot be less than ${se}`),t<e&&i("getRandomString","Maximum length cannot be less than minimum length")}function bt(){let e=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],t=O({min:5,max:10}),r=w({length:t,lowerCase:!0,upperCase:!1,number:!0}),n=h(e);return`${r}@${n}`}function yt(e={}){l(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if((!l(t)||!l(r))&&i("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&i("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),t===r)return Number(t.toFixed(n));t>r&&i("generateRandomFloat",`"max" (${r}) must be greater than "min" (${t})`);let o=Math.random()*(r-t)+t;return Number(o.toFixed(n))}function W(e,t){(!l(e)||e<=0)&&i("generateRandomStringFromSource",'"num" must be greater than 0'),(!d(t)||t.length===0)&&i("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<e;n++)r+=h(t);return r}function xt(){let e=O({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,ae({format:"YYYYMMDD"}),W(3,t),W(1,[...t,"X","x"])].join("")}function ht(){return h(["13","14","15","16","17","18","19"])+O(999999999).toString().padEnd(9,"0")}function Ot(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${w({length:{min:4,max:8}})}`,`?id=${O()}`,`?page=${w({length:{min:2,max:4}})}`,`?query=${w({length:{min:5,max:6}})}`,`?search=${w({length:{min:1,max:4}})}`,`?token=${w({length:{min:16,max:16}})}`];return`${h(e)}${w({length:{min:5,max:25}})}${h(t)}${h(r)}`}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,decimalToBinary,deepClone,deepMerge,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,hasCircularReference,isArray,isBoolean,isDate,isDateString,isDef,isEmail,isEmptyString,isFloat,isFunction,isIdCard,isInteger,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNil,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,log,objectToString,omit,pick,qs,qsStringify,throttle,throwError,toTypeString,toTypeValue,withRetry});
|
|
1
|
+
"use strict";var me=Object.create;var $=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var ce=Object.getOwnPropertyNames;var pe=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty;var le=(e,t)=>{for(var r in t)$(e,r,{get:t[r],enumerable:!0})},J=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ce(t))!ue.call(e,n)&&n!==r&&$(e,n,{get:()=>t[n],enumerable:!(o=fe(t,n))||o.enumerable});return e};var k=(e,t,r)=>(r=e!=null?me(pe(e)):{},J(t||!e||!e.__esModule?$(r,"default",{value:e,enumerable:!0}):r,e)),ge=e=>J($({},"__esModule",{value:!0}),e);var lt={};le(lt,{UtilsError:()=>N,base64Decode:()=>we,base64Encode:()=>Oe,castArray:()=>y,compose:()=>Re,composeRight:()=>Ae,debounce:()=>Se,debugWarn:()=>De,decimalToBinary:()=>he,deepClone:()=>O,deepMerge:()=>je,generateRandomArray:()=>ve,generateRandomColor:()=>et,generateRandomDate:()=>q,generateRandomEmail:()=>mt,generateRandomFloat:()=>ft,generateRandomIdCard:()=>ct,generateRandomMobilePhone:()=>pt,generateRandomStringFromSource:()=>I,getRandomInt:()=>l,getRandomItem:()=>u,getRandomString:()=>b,getRandomUrl:()=>ut,hasChanged:()=>ye,hasCircularReference:()=>Ie,isArray:()=>g,isBoolean:()=>_,isDate:()=>K,isDateString:()=>z,isDef:()=>xe,isEmail:()=>Xe,isEmptyString:()=>qe,isFloat:()=>Be,isFunction:()=>D,isIdCard:()=>He,isInteger:()=>We,isMap:()=>Y,isMobilePhone:()=>Qe,isNegativeFloat:()=>Ke,isNegativeInteger:()=>Ve,isNil:()=>G,isNonNegativeFloat:()=>Le,isNonNegativeInteger:()=>V,isNonPositiveFloat:()=>Ue,isNonPositiveInteger:()=>ze,isNull:()=>be,isNumber:()=>p,isObject:()=>A,isObjectLike:()=>M,isPlainObject:()=>d,isPositiveFloat:()=>Ye,isPositiveInteger:()=>Ge,isPromise:()=>W,isRegExp:()=>U,isSet:()=>L,isString:()=>h,isStringNumber:()=>Je,isSymbol:()=>B,isURL:()=>Ze,isUndef:()=>S,log:()=>T,objectToString:()=>Z,omit:()=>Ce,pick:()=>Fe,qs:()=>re,throttle:()=>Ne,throwError:()=>a,toTypeString:()=>x,toTypeValue:()=>de,withRetry:()=>Pe});module.exports=ge(lt);function A(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function M(e){return e!==null&&typeof e=="object"}var Z=Object.prototype.toString,x=e=>Z.call(e),de=e=>x(e).slice(8,-1),h=e=>typeof e=="string",p=e=>typeof e=="number"&&Number.isFinite(e),_=e=>typeof e=="boolean",be=e=>e===null,S=e=>e===void 0,B=e=>typeof e=="symbol",g=Array.isArray,D=e=>typeof e=="function",Y=e=>x(e)==="[object Map]",L=e=>x(e)==="[object Set]",K=e=>x(e)==="[object Date]",U=e=>x(e)==="[object RegExp]",W=e=>M(e)&&D(e?.then)&&D(e?.catch),G=e=>e==null,xe=e=>e!=null,ye=(e,t)=>e!==t;function d(e){return x(e)==="[object Object]"}function y(e){return g(e)?e:[e]}function he(e){let t=[],r,o="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)o+=t.pop().toString();return o}var v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Oe(e){let t="",r="";for(let n=0;n<e.length;n++)r+=e[n].charCodeAt(0).toString(2).padStart(8,"0");for(let n=0;n<r.length;n+=6)t+=v[Number.parseInt(r.slice(n,n+6).padEnd(6,"0"),2)];let o=t.length%4;return o!==0&&(t+="=".repeat(4-o)),t}function we(e){let t="",r="";for(let o=0;o<e.length&&e[o]!=="=";o++)r+=v.indexOf(e[o]).toString(2).padStart(6,"0");for(let o=0;o<r.length;o+=8){let n=Number.parseInt(r.slice(o,o+8),2);n&&(t+=String.fromCharCode(n))}return t}function Re(...e){return e.reduce((t,r)=>function(...o){return r(t(...o))})}function Ae(...e){return e.reduce((t,r)=>function(...o){return t(r(...o))})}function Se(e,t=500){let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,o)},t)}}function O(e){let t=new WeakMap;function r(n){if(!M(n))return n;if(t.has(n))return t.get(n);if(K(n)){let s=new Date(n);return t.set(n,s),s}if(U(n)){let s=new RegExp(n.source,n.flags);return t.set(n,s),s}if(W(n))return n;if(typeof Buffer<"u"&&Buffer.isBuffer(n)){let s=Buffer.allocUnsafe?Buffer.allocUnsafe(n.length):Buffer.from(n);return n.copy(s),t.set(n,s),s}if(n instanceof Error){let s=new n.constructor(n.message);return t.set(n,s),o(n,s),s}if(n instanceof Boolean||n instanceof Number||n instanceof String){let s=n.valueOf(),c=Object(s);return t.set(n,c),o(n,c),c}if(typeof Node<"u"&&n instanceof Node)return{};if(n instanceof WeakMap)return{};if(n instanceof WeakSet)return{};if(n instanceof ArrayBuffer)return n.slice(0);if(n instanceof DataView){let s=n.buffer.slice(0);return new DataView(s,n.byteOffset,n.byteLength)}if(ArrayBuffer.isView(n)){let s=n.constructor;return new s(n)}if(Y(n)){let s=new Map;return t.set(n,s),n.forEach((c,f)=>s.set(r(f),r(c))),s}if(L(n)){let s=new Set;return t.set(n,s),n.forEach(c=>s.add(r(c))),s}let m=g(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));return t.set(n,m),o(n,m),Te(n,m),m}function o(n,m){let s=Object.getOwnPropertyDescriptors(n);for(let c of Reflect.ownKeys(s)){let f=s[c];f.get||f.set?Object.defineProperty(m,c,f):Object.defineProperty(m,c,{...f,value:r(f.value)})}}return r(e)}function Te(e,t){Object.isFrozen(e)?Object.freeze(t):Object.isSealed(e)?Object.seal(t):Object.isExtensible(e)||Object.preventExtensions(t)}function je(e,t,r={}){return te(ee(e,r),ee(t,r),r)}function te(e,t,r){return g(e)?Me(e,t,r):Ee(e,t,r)}function Ee(e,t,r){if(!d(t))return t;let o=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(n=>{(d(e[n])||g(e[n]))&&(d(t[n])||g(t[n]))?e[n]=te(e[n],t[n],r):Object.defineProperty(e,n,o[n])}),e}function Me(e,t,r){let{mergeStrategy:o="replace"}=r;if(g(t))switch(o){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function ee(e,t){let{deepClone:r=!0}=t;return r?O(e):e}var N=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function a(e,t){throw new N(`[${e}] ${t}`)}function De(e,t){let r=h(e)?new N(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var P=(e,t,...r)=>{if(!t)return;let o=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,o)},T=(e,...t)=>{P("info",e,...t)};T.info=(e,...t)=>{P("info",e,...t)};T.warn=(e,...t)=>{P("warn",e,...t)};T.error=(e,...t)=>{P("error",e,...t)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=e=>P=e);var re={stringify:e=>(A(e)||a("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(h(e)||a("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=re.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Ne(e,t=500){let r=null;return function(...o){if(G(r))return r=Date.now(),e.apply(this,o);let n=Date.now();if(n-r>=t)return r=n,e.apply(this,o)}}function Pe(e){$e(e);let{fn:t,maxAttempts:r=3,retryDelay:o=1e3,enableExponentialBackoff:n=!1,signal:m}=e,s,c=m?new Promise((C,w)=>{let F=()=>w(ne());m.addEventListener("abort",F),s=()=>m.removeEventListener("abort",F)}):null;return new Promise((C,w)=>{(async()=>{for(let E=1;E<=r;E++){if(m?.aborted)return w(ne());try{let R=await Promise.race(c?[t(),c]:[t()]);return C(R)}catch(R){let Q=n?o*2**(E-1):o;if(T("withRetry",`Attempt ${E}/${r} failed. Retrying in ${Q}ms...`),R instanceof Error&&R.name==="AbortError"||E===r)return w(R);await new Promise(ae=>setTimeout(ae,Q))}}})()}).finally(()=>s?.())}function $e(e){d(e)||a("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&a("withRetry",'"fn" must be a function that returns a Promise'),!S(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&a("withRetry",'"maxAttempts" must be a positive integer'),!S(e.retryDelay)&&(!p(e.retryDelay)||e.retryDelay<0)&&a("withRetry",'"retryDelay" must be a non-negative number'),!S(e.enableExponentialBackoff)&&!_(e.enableExponentialBackoff)&&a("withRetry",'"enableExponentialBackoff" must be a boolean'),!S(e.signal)&&typeof e.signal!="object"&&a("withRetry",'"signal" must be an AbortSignal')}var ke="The operation was aborted";function ne(e=ke){let t=new Error(e);return t.name="AbortError",t}function Ie(e){A(e)||a("hasCircularReference",'"obj" must be a object');let t=new Set;function r(o){if(A(o)){if(t.has(o))return!0;t.add(o);for(let n of Object.keys(o))if(r(o[n]))return!0;t.delete(o)}return!1}return r(e)}function Ce(e,t){if(!d(e))return{};let r=O(e),o=y(t);for(let n of o)Reflect.deleteProperty(r,n);return r}function Fe(e,t,r={}){let{includeProto:o=!1,includeSymbols:n=!0,includeNonEnum:m=!1}=r,s={};return d(e)&&y(t).forEach(f=>{B(f)&&!n||!(o?f in e:Object.hasOwn(e,f))||!m&&(o?_e(e,f):Object.getOwnPropertyDescriptor(e,f))?.enumerable===!1||(s[f]=O(e[f]))}),s}function _e(e,t){let r=e;for(;r!==null;){let o=Object.getOwnPropertyDescriptor(r,t);if(o)return o;r=Object.getPrototypeOf(r)}}function Be(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Ye(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Le(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function Ke(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Ue(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function We(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Ge(e){return/^[1-9]\d*$/.test(e)}function V(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Ve(e){return/^-[1-9]\d*$/.test(e)}function ze(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}var oe=k(require("dayjs"),1);function z(e,t="YYYY-MM-DD HH:mm:ss"){return(0,oe.default)(e,t,!0).isValid()}function Xe(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function qe(e){return e===""}var X=k(require("dayjs"),1);function He(e){if(!/^[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))return!1;let r=e.slice(6,14);return z(r,"YYYYMMDD")&&(0,X.default)(r,"YYYYMMDD").isBefore((0,X.default)())}function Qe(e){return/^1[3-9]\d{9}$/.test(e)}var Je=e=>{if(!h(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function Ze(e){return/^https?:\/\/\S+$/i.test(e)}function ve(e,t){return(!p(e)||!V(e.toString()))&&a("generateRandomArray","num must be greater than 0"),D(t)||a("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function et(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var j=k(require("dayjs"),1),se=k(require("dayjs/plugin/customParseFormat.js"),1);function u(e){return e[Math.floor(Math.random()*e.length)]}function l(e={}){p(e)&&(e={max:e});let{min:t=1,max:r=u(rt())}=e;tt(t,r);let o=Math.ceil(t),n=Math.floor(r);return Math.floor(Math.random()*(n-o+1)+o)}function tt(e,t){let r=Math.ceil(e),o=Math.floor(t);Number.isSafeInteger(r)||a("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(o)||a("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),o<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 rt(){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)})}j.default.extend(se.default);function q(e={}){let{start:t="1800-01-01 00:00:00",end:r=(0,j.default)().format(ie),format:o=ie}=e,n=(0,j.default)(t),m=(0,j.default)(r);(!n.isValid()||!m.isValid())&&a("generateRandomDate","start and end parameters must be valid date format"),n.isAfter(m)&&a("generateRandomDate","start date must be before end date");let s=n.valueOf(),c=m.valueOf(),f=l({min:s,max:c});return(0,j.default)(f).format(o)}var ie="YYYY-MM-DD HH:mm:ss";function b(e={}){let t=ot(e),r=it(t);st(r);let{length:o}=t;at(o.min,o.max);let n=l(o),m=t.prefix||"";for(let s=0;s<n;s++)m+=r.charAt(Math.floor(Math.random()*r.length));return m+(t.suffix||"")}var nt=16,H=1;function ot(e){let t=p(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:p(e.length)?{max:e.length,min:e.length}:{max:nt,min:H,...e.length},extra:t?[]:[...new Set(y(e.extra||[]))]}}function it(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=y(e.extra).join(""),t}function st(e){e.length===0&&a("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function at(e,t){Number.isInteger(e)||a("getRandomString","min must be an integer"),Number.isInteger(t)||a("getRandomString","max must be an integer"),e<H&&a("getRandomString",`Minimum length cannot be less than ${H}`),t<e&&a("getRandomString","Maximum length cannot be less than minimum length")}function mt(){let e=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],t=l({min:5,max:10}),r=b({length:t,lowerCase:!0,upperCase:!1,number:!0}),o=u(e);return`${r}@${o}`}function ft(e={}){p(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:o=2}=e;if((!p(t)||!p(r))&&a("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(o)||o<0)&&a("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),t===r)return Number(t.toFixed(o));t>r&&a("generateRandomFloat",`"max" (${r}) must be greater than "min" (${t})`);let n=Math.random()*(r-t)+t;return Number(n.toFixed(o))}function I(e,t){(!p(e)||e<=0)&&a("generateRandomStringFromSource",'"num" must be greater than 0'),(!g(t)||t.length===0)&&a("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let o=0;o<e;o++)r+=u(t);return r}function ct(){let e=l({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,q({format:"YYYYMMDD"}),I(3,t),I(1,[...t,"X","x"])].join("")}function pt(){return u(["13","14","15","16","17","18","19"])+l(999999999).toString().padEnd(9,"0")}function ut(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${b({length:{min:4,max:8}})}`,`?id=${l()}`,`?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`${u(e)}${b({length:{min:5,max:25}})}${u(t)}${u(r)}`}0&&(module.exports={UtilsError,base64Decode,base64Encode,castArray,compose,composeRight,debounce,debugWarn,decimalToBinary,deepClone,deepMerge,generateRandomArray,generateRandomColor,generateRandomDate,generateRandomEmail,generateRandomFloat,generateRandomIdCard,generateRandomMobilePhone,generateRandomStringFromSource,getRandomInt,getRandomItem,getRandomString,getRandomUrl,hasChanged,hasCircularReference,isArray,isBoolean,isDate,isDateString,isDef,isEmail,isEmptyString,isFloat,isFunction,isIdCard,isInteger,isMap,isMobilePhone,isNegativeFloat,isNegativeInteger,isNil,isNonNegativeFloat,isNonNegativeInteger,isNonPositiveFloat,isNonPositiveInteger,isNull,isNumber,isObject,isObjectLike,isPlainObject,isPositiveFloat,isPositiveInteger,isPromise,isRegExp,isSet,isString,isStringNumber,isSymbol,isURL,isUndef,log,objectToString,omit,pick,qs,throttle,throwError,toTypeString,toTypeValue,withRetry});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var ee=Object.create;var Nt=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var se=(t,e)=>()=>(t&&(e=t(t=0)),e);var Pt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ae=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ne(e))!ie.call(t,s)&&s!==r&&Nt(t,s,{get:()=>e[s],enumerable:!(n=re(e,s))||n.enumerable});return t};var ht=(t,e,r)=>(r=t!=null?ee(oe(t)):{},ae(e||!t||!t.__esModule?Nt(r,"default",{value:t,enumerable:!0}):r,t));import Te from"path";import{fileURLToPath as Re}from"url";var o=se(()=>{"use strict"});var $t=Pt((Tt,At)=>{"use strict";o();(function(t,e){typeof Tt=="object"&&typeof At<"u"?At.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Tt,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",s="second",O="minute",y="hour",S="day",x="week",N="month",H="quarter",_="year",C="date",P="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,T={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(c){var a=["th","st","nd","rd"],i=c%100;return"["+c+(a[(i-20)%10]||a[i]||a[0])+"]"}},A=function(c,a,i){var u=String(c);return!u||u.length>=a?c:""+Array(a+1-u.length).join(i)+c},M={s:A,z:function(c){var a=-c.utcOffset(),i=Math.abs(a),u=Math.floor(i/60),f=i%60;return(a<=0?"+":"-")+A(u,2,"0")+":"+A(f,2,"0")},m:function c(a,i){if(a.date()<i.date())return-c(i,a);var u=12*(i.year()-a.year())+(i.month()-a.month()),f=a.clone().add(u,N),g=i-f<0,h=a.clone().add(u+(g?-1:1),N);return+(-(u+(i-f)/(g?f-h:h-f))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:N,y:_,w:x,d:S,D:C,h:y,m:O,s,ms:n,Q:H}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},D="en",v={};v[D]=T;var L="$isDayjsObject",k=function(c){return c instanceof U||!(!c||!c[L])},W=function c(a,i,u){var f;if(!a)return D;if(typeof a=="string"){var g=a.toLowerCase();v[g]&&(f=g),i&&(v[g]=i,f=g);var h=a.split("-");if(!f&&h.length>1)return c(h[0])}else{var b=a.name;v[b]=a,f=b}return!u&&f&&(D=f),f||!u&&D},R=function(c,a){if(k(c))return c.clone();var i=typeof a=="object"?a:{};return i.date=c,i.args=arguments,new U(i)},$=M;$.l=W,$.i=k,$.w=function(c,a){return R(c,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var U=function(){function c(i){this.$L=W(i.locale,null,!0),this.parse(i),this.$x=this.$x||i.x||{},this[L]=!0}var a=c.prototype;return a.parse=function(i){this.$d=function(u){var f=u.date,g=u.utc;if(f===null)return new Date(NaN);if($.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var h=f.match(m);if(h){var b=h[2]-1||0,j=(h[7]||"0").substring(0,3);return g?new Date(Date.UTC(h[1],b,h[3]||1,h[4]||0,h[5]||0,h[6]||0,j)):new Date(h[1],b,h[3]||1,h[4]||0,h[5]||0,h[6]||0,j)}}return new Date(f)}(i),this.init()},a.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},a.$utils=function(){return $},a.isValid=function(){return this.$d.toString()!==P},a.isSame=function(i,u){var f=R(i);return this.startOf(u)<=f&&f<=this.endOf(u)},a.isAfter=function(i,u){return R(i)<this.startOf(u)},a.isBefore=function(i,u){return this.endOf(u)<R(i)},a.$g=function(i,u,f){return $.u(i)?this[u]:this.set(f,i)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(i,u){var f=this,g=!!$.u(u)||u,h=$.p(i),b=function(J,F){var Z=$.w(f.$u?Date.UTC(f.$y,F,J):new Date(f.$y,F,J),f);return g?Z:Z.endOf(S)},j=function(J,F){return $.w(f.toDate()[J].apply(f.toDate("s"),(g?[0,0,0,0]:[23,59,59,999]).slice(F)),f)},E=this.$W,I=this.$M,z=this.$D,nt="set"+(this.$u?"UTC":"");switch(h){case _:return g?b(1,0):b(31,11);case N:return g?b(1,I):b(0,I+1);case x:var tt=this.$locale().weekStart||0,at=(E<tt?E+7:E)-tt;return b(g?z-at:z+(6-at),I);case S:case C:return j(nt+"Hours",0);case y:return j(nt+"Minutes",1);case O:return j(nt+"Seconds",2);case s:return j(nt+"Milliseconds",3);default:return this.clone()}},a.endOf=function(i){return this.startOf(i,!1)},a.$set=function(i,u){var f,g=$.p(i),h="set"+(this.$u?"UTC":""),b=(f={},f[S]=h+"Date",f[C]=h+"Date",f[N]=h+"Month",f[_]=h+"FullYear",f[y]=h+"Hours",f[O]=h+"Minutes",f[s]=h+"Seconds",f[n]=h+"Milliseconds",f)[g],j=g===S?this.$D+(u-this.$W):u;if(g===N||g===_){var E=this.clone().set(C,1);E.$d[b](j),E.init(),this.$d=E.set(C,Math.min(this.$D,E.daysInMonth())).$d}else b&&this.$d[b](j);return this.init(),this},a.set=function(i,u){return this.clone().$set(i,u)},a.get=function(i){return this[$.p(i)]()},a.add=function(i,u){var f,g=this;i=Number(i);var h=$.p(u),b=function(I){var z=R(g);return $.w(z.date(z.date()+Math.round(I*i)),g)};if(h===N)return this.set(N,this.$M+i);if(h===_)return this.set(_,this.$y+i);if(h===S)return b(1);if(h===x)return b(7);var j=(f={},f[O]=e,f[y]=r,f[s]=t,f)[h]||1,E=this.$d.getTime()+i*j;return $.w(E,this)},a.subtract=function(i,u){return this.add(-1*i,u)},a.format=function(i){var u=this,f=this.$locale();if(!this.isValid())return f.invalidDate||P;var g=i||"YYYY-MM-DDTHH:mm:ssZ",h=$.z(this),b=this.$H,j=this.$m,E=this.$M,I=f.weekdays,z=f.months,nt=f.meridiem,tt=function(F,Z,et,ot){return F&&(F[Z]||F(u,g))||et[Z].slice(0,ot)},at=function(F){return $.s(b%12||12,F,"0")},J=nt||function(F,Z,et){var ot=F<12?"AM":"PM";return et?ot.toLowerCase():ot};return g.replace(w,function(F,Z){return Z||function(et){switch(et){case"YY":return String(u.$y).slice(-2);case"YYYY":return $.s(u.$y,4,"0");case"M":return E+1;case"MM":return $.s(E+1,2,"0");case"MMM":return tt(f.monthsShort,E,z,3);case"MMMM":return tt(z,E);case"D":return u.$D;case"DD":return $.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return tt(f.weekdaysMin,u.$W,I,2);case"ddd":return tt(f.weekdaysShort,u.$W,I,3);case"dddd":return I[u.$W];case"H":return String(b);case"HH":return $.s(b,2,"0");case"h":return at(1);case"hh":return at(2);case"a":return J(b,j,!0);case"A":return J(b,j,!1);case"m":return String(j);case"mm":return $.s(j,2,"0");case"s":return String(u.$s);case"ss":return $.s(u.$s,2,"0");case"SSS":return $.s(u.$ms,3,"0");case"Z":return h}return null}(F)||h.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(i,u,f){var g,h=this,b=$.p(u),j=R(i),E=(j.utcOffset()-this.utcOffset())*e,I=this-j,z=function(){return $.m(h,j)};switch(b){case _:g=z()/12;break;case N:g=z();break;case H:g=z()/3;break;case x:g=(I-E)/6048e5;break;case S:g=(I-E)/864e5;break;case y:g=I/r;break;case O:g=I/e;break;case s:g=I/t;break;default:g=I}return f?g:$.a(g)},a.daysInMonth=function(){return this.endOf(N).$D},a.$locale=function(){return v[this.$L]},a.locale=function(i,u){if(!i)return this.$L;var f=this.clone(),g=W(i,u,!0);return g&&(f.$L=g),f},a.clone=function(){return $.w(this.$d,this)},a.toDate=function(){return new Date(this.valueOf())},a.toJSON=function(){return this.isValid()?this.toISOString():null},a.toISOString=function(){return this.$d.toISOString()},a.toString=function(){return this.$d.toUTCString()},c}(),V=U.prototype;return R.prototype=V,[["$ms",n],["$s",s],["$m",O],["$H",y],["$W",S],["$M",N],["$y",_],["$D",C]].forEach(function(c){V[c[1]]=function(a){return this.$g(a,c[0],c[1])}}),R.extend=function(c,a){return c.$i||(c(a,U,R),c.$i=!0),R},R.locale=W,R.isDayjs=k,R.unix=function(c){return R(1e3*c)},R.en=v[D],R.Ls=v,R.p={},R})});var Xt=Pt((jt,Et)=>{"use strict";o();(function(t,e){typeof jt=="object"&&typeof Et<"u"?Et.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(jt,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,s=/\d\d?/,O=/\d*[^-_:/,()\s\d]+/,y={},S=function(m){return(m=+m)+(m>68?1900:2e3)},x=function(m){return function(w){this[m]=+w}},N=[/[+-]\d\d:?(\d\d)?|Z/,function(m){(this.zone||(this.zone={})).offset=function(w){if(!w||w==="Z")return 0;var T=w.match(/([+-]|\d\d)/g),A=60*T[1]+(+T[2]||0);return A===0?0:T[0]==="+"?-A:A}(m)}],H=function(m){var w=y[m];return w&&(w.indexOf?w:w.s.concat(w.f))},_=function(m,w){var T,A=y.meridiem;if(A){for(var M=1;M<=24;M+=1)if(m.indexOf(A(M,0,w))>-1){T=M>12;break}}else T=m===(w?"pm":"PM");return T},C={A:[O,function(m){this.afternoon=_(m,!1)}],a:[O,function(m){this.afternoon=_(m,!0)}],Q:[r,function(m){this.month=3*(m-1)+1}],S:[r,function(m){this.milliseconds=100*+m}],SS:[n,function(m){this.milliseconds=10*+m}],SSS:[/\d{3}/,function(m){this.milliseconds=+m}],s:[s,x("seconds")],ss:[s,x("seconds")],m:[s,x("minutes")],mm:[s,x("minutes")],H:[s,x("hours")],h:[s,x("hours")],HH:[s,x("hours")],hh:[s,x("hours")],D:[s,x("day")],DD:[n,x("day")],Do:[O,function(m){var w=y.ordinal,T=m.match(/\d+/);if(this.day=T[0],w)for(var A=1;A<=31;A+=1)w(A).replace(/\[|\]/g,"")===m&&(this.day=A)}],w:[s,x("week")],ww:[n,x("week")],M:[s,x("month")],MM:[n,x("month")],MMM:[O,function(m){var w=H("months"),T=(H("monthsShort")||w.map(function(A){return A.slice(0,3)})).indexOf(m)+1;if(T<1)throw new Error;this.month=T%12||T}],MMMM:[O,function(m){var w=H("months").indexOf(m)+1;if(w<1)throw new Error;this.month=w%12||w}],Y:[/[+-]?\d+/,x("year")],YY:[n,function(m){this.year=S(m)}],YYYY:[/\d{4}/,x("year")],Z:N,ZZ:N};function P(m){var w,T;w=m,T=y&&y.formats;for(var A=(m=w.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,$,U){var V=U&&U.toUpperCase();return $||T[U]||t[U]||T[V].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,a,i){return a||i.slice(1)})})).match(e),M=A.length,D=0;D<M;D+=1){var v=A[D],L=C[v],k=L&&L[0],W=L&&L[1];A[D]=W?{regex:k,parser:W}:v.replace(/^\[|\]$/g,"")}return function(R){for(var $={},U=0,V=0;U<M;U+=1){var c=A[U];if(typeof c=="string")V+=c.length;else{var a=c.regex,i=c.parser,u=R.slice(V),f=a.exec(u)[0];i.call($,f),R=R.replace(f,"")}}return function(g){var h=g.afternoon;if(h!==void 0){var b=g.hours;h?b<12&&(g.hours+=12):b===12&&(g.hours=0),delete g.afternoon}}($),$}}return function(m,w,T){T.p.customParseFormat=!0,m&&m.parseTwoDigitYear&&(S=m.parseTwoDigitYear);var A=w.prototype,M=A.parse;A.parse=function(D){var v=D.date,L=D.utc,k=D.args;this.$u=L;var W=k[1];if(typeof W=="string"){var R=k[2]===!0,$=k[3]===!0,U=R||$,V=k[2];$&&(V=k[2]),y=this.$locale(),!R&&V&&(y=T.Ls[V]),this.$d=function(u,f,g,h){try{if(["x","X"].indexOf(f)>-1)return new Date((f==="X"?1e3:1)*u);var b=P(f)(u),j=b.year,E=b.month,I=b.day,z=b.hours,nt=b.minutes,tt=b.seconds,at=b.milliseconds,J=b.zone,F=b.week,Z=new Date,et=I||(j||E?1:Z.getDate()),ot=j||Z.getFullYear(),dt=0;j&&!E||(dt=E>0?E-1:Z.getMonth());var gt,wt=z||0,Ot=nt||0,Mt=tt||0,Dt=at||0;return J?new Date(Date.UTC(ot,dt,et,wt,Ot,Mt,Dt+60*J.offset*1e3)):g?new Date(Date.UTC(ot,dt,et,wt,Ot,Mt,Dt)):(gt=new Date(ot,dt,et,wt,Ot,Mt,Dt),F&&(gt=h(gt).week(F).toDate()),gt)}catch{return new Date("")}}(v,W,L,T),this.init(),V&&V!==!0&&(this.$L=this.locale(V).$L),U&&v!=this.format(W)&&(this.$d=new Date("")),y={}}else if(W instanceof Array)for(var c=W.length,a=1;a<=c;a+=1){k[1]=W[a-1];var i=T.apply(this,k);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}a===c&&(this.$d=new Date(""))}else M.call(this,D)}}})});o();o();o();o();o();function it(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}o();function yt(t){return t!==null&&typeof t=="object"}o();o();var fe=Object.prototype.toString,ft=t=>fe.call(t),Ye=t=>ft(t).slice(8,-1),st=t=>typeof t=="string",K=t=>typeof t=="number"&&Number.isFinite(t),G=t=>typeof t=="boolean",St=t=>t===null,Y=t=>t===void 0,Yt=t=>typeof t=="symbol",B=Array.isArray,bt=t=>typeof t=="function",It=t=>ft(t)==="[object Map]",_t=t=>ft(t)==="[object Set]",Ct=t=>ft(t)==="[object Date]",Lt=t=>ft(t)==="[object RegExp]",Ft=t=>yt(t)&&bt(t?.then)&&bt(t?.catch),Ht=t=>t==null,Ie=t=>t!=null,_e=(t,e)=>t!==e;function Q(t){return ft(t)==="[object Object]"}function ut(t){return B(t)?t:[t]}o();o();o();o();function er(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var Ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function rr(t){let e="",r="";for(let s=0;s<t.length;s++)r+=t[s].charCodeAt(0).toString(2).padStart(8,"0");for(let s=0;s<r.length;s+=6)e+=Ut[Number.parseInt(r.slice(s,s+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function nr(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=Ut.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let s=Number.parseInt(r.slice(n,n+8),2);s&&(e+=String.fromCharCode(s))}return e}o();function sr(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ar(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}o();function cr(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}o();function ct(t){let e=new WeakMap;function r(n){if(!yt(n))return n;if(Ct(n))return new Date(n);if(Lt(n))return new RegExp(n);if(Ft(n))return n;if(e.has(n))return e.get(n);if(It(n)){let y=new Map;return e.set(n,y),n.forEach((S,x)=>y.set(r(x),r(S))),y}if(_t(n)){let y=new Set;return e.set(n,y),n.forEach(S=>y.add(r(S))),y}let s=B(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,s);let O=Object.getOwnPropertyDescriptors(n);for(let y of Reflect.ownKeys(O)){let S=O[y];S.get||S.set?Object.defineProperty(s,y,S):Object.defineProperty(s,y,{...S,value:r(S.value)})}return s}return r(t)}o();function br(t,e,r={}){return Wt(Kt(t,r),Kt(e,r),r)}function Wt(t,e,r){return B(t)?ce(t,e,r):ue(t,e,r)}function ue(t,e,r){if(!Q(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(s=>{(Q(t[s])||B(t[s]))&&(Q(e[s])||B(e[s]))?t[s]=Wt(t[s],e[s],r):Object.defineProperty(t,s,n[s])}),t}function ce(t,e,r){let{mergeStrategy:n="replace"}=r;if(B(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Kt(t,e){let{deepClone:r=!0}=e;return r?ct(t):t}o();var xt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function d(t,e){throw new xt(`[${t}] ${e}`)}function Or(t,e){let r=st(t)?new xt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}o();var lt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},pt=(t,...e)=>{lt("info",t,...e)};pt.info=(t,...e)=>{lt("info",t,...e)};pt.warn=(t,...e)=>{lt("warn",t,...e)};pt.error=(t,...e)=>{lt("error",t,...e)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=t=>lt=t);o();function Er(t,e={}){me(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:s="indices",encodeDotInKeys:O=!1,skipNulls:y=!1,strictNullHandling:S=!1,commaRoundTrip:x=!1,allowEmptyArrays:N=!1,addQueryPrefix:H=!1,delimiter:_="&"}=e,C=e.allowDots??!1;O&&Y(e.allowDots)&&(C=!0);let P=[],m=M=>r&&!n?encodeURIComponent(M):M,w=M=>r?encodeURIComponent(M):M;function T(M,D){if(!Y(D)){if(St(D)){if(y)return;P.push(`${m(M)}${S?"":"="}`);return}if(B(D)){if(D.length===0){N&&P.push(`${m(M)}[]`);return}if(s==="comma"){let v=n?D.map(w).join(","):w(D.join(","));if(D.length===1&&St(D[0])){if(y)return;P.push(`${m(M)}${x?"[]":""}${S?"":"="}`)}else D.length===1?P.push(`${m(M)}${x?"[]":""}=${v}`):P.push(`${m(M)}=${v}`);return}D.forEach((v,L)=>{let k=M;s==="indices"?k=`${M}[${L}]`:s==="brackets"&&(k=`${M}[]`),T(k,v)});return}if(it(D)){Object.keys(D).forEach(v=>{let L=M;O&&(L=L.replace(/\./g,"%2E"));let k=v;C?(O&&(k=k.replace(/\./g,"%2E")),T(`${L}.${k}`,D[v])):T(`${L}[${k}]`,D[v])});return}P.push(`${m(M)}=${w(D)}`)}}if(!it(t))return"";Vt(t)&&d("stringify","Input object contains circular references, cannot stringify"),B(t)?t.forEach((M,D)=>T(`${D}`,M)):Object.keys(t).forEach(M=>T(M,t[M]));let A=P.join(_);return H&&A?`?${A}`:A}function me(t={}){Q(t)||d("stringify",'"options" must be a plain object'),!Y(t.encode)&&!G(t.encode)&&d("stringify",'"encode" must be a boolean'),!Y(t.encodeValuesOnly)&&!G(t.encodeValuesOnly)&&d("stringify",'"encodeValuesOnly" must be a boolean'),!Y(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&d("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!Y(t.allowDots)&&!G(t.allowDots)&&d("stringify",'"allowDots" must be a boolean'),!Y(t.skipNulls)&&!G(t.skipNulls)&&d("stringify",'"skipNulls" must be a boolean'),!Y(t.strictNullHandling)&&!G(t.strictNullHandling)&&d("stringify",'"strictNullHandling" must be a boolean'),!Y(t.addQueryPrefix)&&!G(t.addQueryPrefix)&&d("stringify",'"addQueryPrefix" must be a boolean'),!Y(t.delimiter)&&!st(t.delimiter)&&d("stringify",'"delimiter" must be a string'),!Y(t.encodeDotInKeys)&&!G(t.encodeDotInKeys)&&d("stringify",'"encodeDotInKeys" must be a boolean'),!Y(t.commaRoundTrip)&&!G(t.commaRoundTrip)&&d("stringify",'"commaRoundTrip" must be a boolean'),!Y(t.allowEmptyArrays)&&!G(t.allowEmptyArrays)&&d("stringify",'"allowEmptyArrays" must be a boolean')}o();var le={stringify:t=>(it(t)||d("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(st(t)||d("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=le.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};o();function Cr(t,e=500){let r=null;return function(...n){if(Ht(r))return r=Date.now(),t.apply(this,n);let s=Date.now();if(s-r>=e)return r=s,t.apply(this,n)}}o();o();function Br(t){pe(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:s=!1,signal:O}=t,y,S=O?new Promise((N,H)=>{let _=()=>H(zt());O.addEventListener("abort",_),y=()=>O.removeEventListener("abort",_)}):null;return new Promise((N,H)=>{(async()=>{for(let C=1;C<=r;C++){if(O?.aborted)return H(zt());try{let P=await Promise.race(S?[e(),S]:[e()]);return N(P)}catch(P){let m=s?n*2**(C-1):n;if(pt("withRetry",`Attempt ${C}/${r} failed. Retrying in ${m}ms...`),P instanceof Error&&P.name==="AbortError"||C===r)return H(P);await new Promise(w=>setTimeout(w,m))}}})()}).finally(()=>y?.())}function pe(t){Q(t)||d("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&d("withRetry",'"fn" must be a function that returns a Promise'),!Y(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&d("withRetry",'"maxAttempts" must be a positive integer'),!Y(t.retryDelay)&&(!K(t.retryDelay)||t.retryDelay<0)&&d("withRetry",'"retryDelay" must be a non-negative number'),!Y(t.enableExponentialBackoff)&&!G(t.enableExponentialBackoff)&&d("withRetry",'"enableExponentialBackoff" must be a boolean'),!Y(t.signal)&&typeof t.signal!="object"&&d("withRetry",'"signal" must be an AbortSignal')}var de="The operation was aborted";function zt(t=de){let e=new Error(t);return e.name="AbortError",e}function Vt(t){it(t)||d("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(it(n)){if(e.has(n))return!0;e.add(n);for(let s of Object.keys(n))if(r(n[s]))return!0;e.delete(n)}return!1}return r(t)}o();o();function Bt(t,e,r={}){let{includeProto:n=!1,includeSymbols:s=!0,includeNonEnum:O=!1}=r,y={};return Q(t)&&ut(e).forEach(x=>{Yt(x)&&!s||!(n?x in t:Object.hasOwn(t,x))||!O&&(n?ge(t,x):Object.getOwnPropertyDescriptor(t,x))?.enumerable===!1||(y[x]=ct(t[x]))}),y}function ge(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Dn(t,e){if(!Q(t))return{};let r=ct(t),n=ut(e),s=Object.keys(r).filter(O=>!n.includes(O));return Bt(r,s)}o();o();o();o();o();function Nn(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Pn(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Yn(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function In(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function _n(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}o();function Fn(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Hn(t){return/^[1-9]\d*$/.test(t)}function Zt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Un(t){return/^-[1-9]\d*$/.test(t)}function Kn(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}o();var Gt=ht($t(),1);function Qt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Gt.default)(t,e,!0).isValid()}o();function Gn(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}o();function qn(t){return t===""}o();var Rt=ht($t(),1);function ro(t){if(!/^[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))return!1;let r=t.slice(6,14);return Qt(r,"YYYYMMDD")&&(0,Rt.default)(r,"YYYYMMDD").isBefore((0,Rt.default)())}o();function io(t){return/^1[3-9]\d{9}$/.test(t)}o();var uo=t=>{if(!st(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};o();function lo(t){return/^https?:\/\/\S+$/i.test(t)}function vo(t,e){return(!K(t)||!Zt(t.toString()))&&d("generateRandomArray","num must be greater than 0"),bt(e)||d("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}o();function Po(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}o();var mt=ht($t(),1),Jt=ht(Xt(),1);o();o();function X(t){return t[Math.floor(Math.random()*t.length)]}function q(t={}){K(t)&&(t={max:t});let{min:e=1,max:r=X(ye())}=t;he(e,r);let n=Math.ceil(e),s=Math.floor(r);return Math.floor(Math.random()*(s-n+1)+n)}function he(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||d("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||d("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(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 ye(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}mt.default.extend(Jt.default);function te(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,mt.default)().format(qt),format:n=qt}=t,s=(0,mt.default)(e),O=(0,mt.default)(r);(!s.isValid()||!O.isValid())&&d("generateRandomDate","start and end parameters must be valid date format"),s.isAfter(O)&&d("generateRandomDate","start date must be before end date");let y=s.valueOf(),S=O.valueOf(),x=q({min:y,max:S});return(0,mt.default)(x).format(n)}var qt="YYYY-MM-DD HH:mm:ss";o();o();function rt(t={}){let e=xe(t),r=$e(e);we(r);let{length:n}=e;Oe(n.min,n.max);let s=q(n),O=e.prefix||"";for(let y=0;y<s;y++)O+=r.charAt(Math.floor(Math.random()*r.length));return O+(e.suffix||"")}var be=16,vt=1;function xe(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:be,min:vt,...t.length},extra:e?[]:[...new Set(ut(t.extra||[]))]}}function $e(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=ut(t.extra).join(""),e}function we(t){t.length===0&&d("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function Oe(t,e){Number.isInteger(t)||d("getRandomString","min must be an integer"),Number.isInteger(e)||d("getRandomString","max must be an integer"),t<vt&&d("getRandomString",`Minimum length cannot be less than ${vt}`),e<t&&d("getRandomString","Maximum length cannot be less than minimum length")}function oi(){let t=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],e=q({min:5,max:10}),r=rt({length:e,lowerCase:!0,upperCase:!1,number:!0}),n=X(t);return`${r}@${n}`}o();function ui(t={}){K(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if((!K(e)||!K(r))&&d("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&d("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),e===r)return Number(e.toFixed(n));e>r&&d("generateRandomFloat",`"max" (${r}) must be greater than "min" (${e})`);let s=Math.random()*(r-e)+e;return Number(s.toFixed(n))}o();o();function kt(t,e){(!K(t)||t<=0)&&d("generateRandomStringFromSource",'"num" must be greater than 0'),(!B(e)||e.length===0)&&d("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<t;n++)r+=X(e);return r}function $i(){let t=q({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,te({format:"YYYYMMDD"}),kt(3,e),kt(1,[...e,"X","x"])].join("")}o();function Si(){return X(["13","14","15","16","17","18","19"])+q(999999999).toString().padEnd(9,"0")}o();function vi(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${rt({length:{min:4,max:8}})}`,`?id=${q()}`,`?page=${rt({length:{min:2,max:4}})}`,`?query=${rt({length:{min:5,max:6}})}`,`?search=${rt({length:{min:1,max:4}})}`,`?token=${rt({length:{min:16,max:16}})}`];return`${X(t)}${rt({length:{min:5,max:25}})}${X(e)}${X(r)}`}o();o();export{xt as UtilsError,nr as base64Decode,rr as base64Encode,ut as castArray,sr as compose,ar as composeRight,cr as debounce,Or as debugWarn,er as decimalToBinary,ct as deepClone,br as deepMerge,vo as generateRandomArray,Po as generateRandomColor,te as generateRandomDate,oi as generateRandomEmail,ui as generateRandomFloat,$i as generateRandomIdCard,Si as generateRandomMobilePhone,kt as generateRandomStringFromSource,q as getRandomInt,X as getRandomItem,rt as getRandomString,vi as getRandomUrl,_e as hasChanged,Vt as hasCircularReference,B as isArray,G as isBoolean,Ct as isDate,Qt as isDateString,Ie as isDef,Gn as isEmail,qn as isEmptyString,Nn as isFloat,bt as isFunction,ro as isIdCard,Fn as isInteger,It as isMap,io as isMobilePhone,In as isNegativeFloat,Un as isNegativeInteger,Ht as isNil,Yn as isNonNegativeFloat,Zt as isNonNegativeInteger,_n as isNonPositiveFloat,Kn as isNonPositiveInteger,St as isNull,K as isNumber,it as isObject,yt as isObjectLike,Q as isPlainObject,Pn as isPositiveFloat,Hn as isPositiveInteger,Ft as isPromise,Lt as isRegExp,_t as isSet,st as isString,uo as isStringNumber,Yt as isSymbol,lo as isURL,Y as isUndef,pt as log,fe as objectToString,Dn as omit,Bt as pick,le as qs,Er as qsStringify,Cr as throttle,d as throwError,ft as toTypeString,Ye as toTypeValue,Br as withRetry};
|
|
1
|
+
var Jt=Object.create;var kt=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ne=(t,e)=>()=>(t&&(e=t(t=0)),e);var Yt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var oe=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of te(e))!re.call(t,r)&&r!==n&&kt(t,r,{get:()=>e[r],enumerable:!(i=Qt(e,r))||i.enumerable});return t};var ht=(t,e,n)=>(n=t!=null?Jt(ee(t)):{},oe(e||!t||!t.__esModule?kt(n,"default",{value:t,enumerable:!0}):n,t));import Oe from"path";import{fileURLToPath as De}from"url";var o=ne(()=>{"use strict"});var xt=Yt((St,Dt)=>{"use strict";o();(function(t,e){typeof St=="object"&&typeof Dt<"u"?Dt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(St,function(){"use strict";var t=1e3,e=6e4,n=36e5,i="millisecond",r="second",$="minute",u="hour",O="day",b="week",R="month",F="quarter",Y="year",I="date",K="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,M=/\[([^\]]+)]|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(m){var a=["th","st","nd","rd"],s=m%100;return"["+m+(a[(s-20)%10]||a[s]||a[0])+"]"}},D=function(m,a,s){var c=String(m);return!c||c.length>=a?m:""+Array(a+1-c.length).join(s)+m},V={s:D,z:function(m){var a=-m.utcOffset(),s=Math.abs(a),c=Math.floor(s/60),f=s%60;return(a<=0?"+":"-")+D(c,2,"0")+":"+D(f,2,"0")},m:function m(a,s){if(a.date()<s.date())return-m(s,a);var c=12*(s.year()-a.year())+(s.month()-a.month()),f=a.clone().add(c,R),d=s-f<0,h=a.clone().add(c+(d?-1:1),R);return+(-(c+(s-f)/(d?f-h:h-f))||0)},a:function(m){return m<0?Math.ceil(m)||0:Math.floor(m)},p:function(m){return{M:R,y:Y,w:b,d:O,D:I,h:u,m:$,s:r,ms:i,Q:F}[m]||String(m||"").toLowerCase().replace(/s$/,"")},u:function(m){return m===void 0}},v="en",U={};U[v]=A;var G="$isDayjsObject",B=function(m){return m instanceof N||!(!m||!m[G])},_=function m(a,s,c){var f;if(!a)return v;if(typeof a=="string"){var d=a.toLowerCase();U[d]&&(f=d),s&&(U[d]=s,f=d);var h=a.split("-");if(!f&&h.length>1)return m(h[0])}else{var y=a.name;U[y]=a,f=y}return!c&&f&&(v=f),f||!c&&v},S=function(m,a){if(B(m))return m.clone();var s=typeof a=="object"?a:{};return s.date=m,s.args=arguments,new N(s)},x=V;x.l=_,x.i=B,x.w=function(m,a){return S(m,{locale:a.$L,utc:a.$u,x:a.$x,$offset:a.$offset})};var N=function(){function m(s){this.$L=_(s.locale,null,!0),this.parse(s),this.$x=this.$x||s.x||{},this[G]=!0}var a=m.prototype;return a.parse=function(s){this.$d=function(c){var f=c.date,d=c.utc;if(f===null)return new Date(NaN);if(x.u(f))return new Date;if(f instanceof Date)return new Date(f);if(typeof f=="string"&&!/Z$/i.test(f)){var h=f.match(g);if(h){var y=h[2]-1||0,T=(h[7]||"0").substring(0,3);return d?new Date(Date.UTC(h[1],y,h[3]||1,h[4]||0,h[5]||0,h[6]||0,T)):new Date(h[1],y,h[3]||1,h[4]||0,h[5]||0,h[6]||0,T)}}return new Date(f)}(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 x},a.isValid=function(){return this.$d.toString()!==K},a.isSame=function(s,c){var f=S(s);return this.startOf(c)<=f&&f<=this.endOf(c)},a.isAfter=function(s,c){return S(s)<this.startOf(c)},a.isBefore=function(s,c){return this.endOf(c)<S(s)},a.$g=function(s,c,f){return x.u(s)?this[c]:this.set(f,s)},a.unix=function(){return Math.floor(this.valueOf()/1e3)},a.valueOf=function(){return this.$d.getTime()},a.startOf=function(s,c){var f=this,d=!!x.u(c)||c,h=x.p(s),y=function(X,k){var H=x.w(f.$u?Date.UTC(f.$y,k,X):new Date(f.$y,k,X),f);return d?H:H.endOf(O)},T=function(X,k){return x.w(f.toDate()[X].apply(f.toDate("s"),(d?[0,0,0,0]:[23,59,59,999]).slice(k)),f)},j=this.$W,E=this.$M,C=this.$D,et="set"+(this.$u?"UTC":"");switch(h){case Y:return d?y(1,0):y(31,11);case R:return d?y(1,E):y(0,E+1);case b:var J=this.$locale().weekStart||0,nt=(j<J?j+7:j)-J;return y(d?C-nt:C+(6-nt),E);case O:case I:return T(et+"Hours",0);case u:return T(et+"Minutes",1);case $:return T(et+"Seconds",2);case r:return T(et+"Milliseconds",3);default:return this.clone()}},a.endOf=function(s){return this.startOf(s,!1)},a.$set=function(s,c){var f,d=x.p(s),h="set"+(this.$u?"UTC":""),y=(f={},f[O]=h+"Date",f[I]=h+"Date",f[R]=h+"Month",f[Y]=h+"FullYear",f[u]=h+"Hours",f[$]=h+"Minutes",f[r]=h+"Seconds",f[i]=h+"Milliseconds",f)[d],T=d===O?this.$D+(c-this.$W):c;if(d===R||d===Y){var j=this.clone().set(I,1);j.$d[y](T),j.init(),this.$d=j.set(I,Math.min(this.$D,j.daysInMonth())).$d}else y&&this.$d[y](T);return this.init(),this},a.set=function(s,c){return this.clone().$set(s,c)},a.get=function(s){return this[x.p(s)]()},a.add=function(s,c){var f,d=this;s=Number(s);var h=x.p(c),y=function(E){var C=S(d);return x.w(C.date(C.date()+Math.round(E*s)),d)};if(h===R)return this.set(R,this.$M+s);if(h===Y)return this.set(Y,this.$y+s);if(h===O)return y(1);if(h===b)return y(7);var T=(f={},f[$]=e,f[u]=n,f[r]=t,f)[h]||1,j=this.$d.getTime()+s*T;return x.w(j,this)},a.subtract=function(s,c){return this.add(-1*s,c)},a.format=function(s){var c=this,f=this.$locale();if(!this.isValid())return f.invalidDate||K;var d=s||"YYYY-MM-DDTHH:mm:ssZ",h=x.z(this),y=this.$H,T=this.$m,j=this.$M,E=f.weekdays,C=f.months,et=f.meridiem,J=function(k,H,Q,rt){return k&&(k[H]||k(c,d))||Q[H].slice(0,rt)},nt=function(k){return x.s(y%12||12,k,"0")},X=et||function(k,H,Q){var rt=k<12?"AM":"PM";return Q?rt.toLowerCase():rt};return d.replace(M,function(k,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 j+1;case"MM":return x.s(j+1,2,"0");case"MMM":return J(f.monthsShort,j,C,3);case"MMMM":return J(C,j);case"D":return c.$D;case"DD":return x.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return J(f.weekdaysMin,c.$W,E,2);case"ddd":return J(f.weekdaysShort,c.$W,E,3);case"dddd":return E[c.$W];case"H":return String(y);case"HH":return x.s(y,2,"0");case"h":return nt(1);case"hh":return nt(2);case"a":return X(y,T,!0);case"A":return X(y,T,!1);case"m":return String(T);case"mm":return x.s(T,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 h}return null}(k)||h.replace(":","")})},a.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},a.diff=function(s,c,f){var d,h=this,y=x.p(c),T=S(s),j=(T.utcOffset()-this.utcOffset())*e,E=this-T,C=function(){return x.m(h,T)};switch(y){case Y:d=C()/12;break;case R:d=C();break;case F:d=C()/3;break;case b:d=(E-j)/6048e5;break;case O:d=(E-j)/864e5;break;case u:d=E/n;break;case $:d=E/e;break;case r:d=E/t;break;default:d=E}return f?d:x.a(d)},a.daysInMonth=function(){return this.endOf(R).$D},a.$locale=function(){return U[this.$L]},a.locale=function(s,c){if(!s)return this.$L;var f=this.clone(),d=_(s,c,!0);return d&&(f.$L=d),f},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()},m}(),L=N.prototype;return S.prototype=L,[["$ms",i],["$s",r],["$m",$],["$H",u],["$W",O],["$M",R],["$y",Y],["$D",I]].forEach(function(m){L[m[1]]=function(a){return this.$g(a,m[0],m[1])}}),S.extend=function(m,a){return m.$i||(m(a,N,S),m.$i=!0),S},S.locale=_,S.isDayjs=B,S.unix=function(m){return S(1e3*m)},S.en=U[v],S.Ls=U,S.p={},S})});var Zt=Yt((At,jt)=>{"use strict";o();(function(t,e){typeof At=="object"&&typeof jt<"u"?jt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(At,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/,i=/\d\d/,r=/\d\d?/,$=/\d*[^-_:/,()\s\d]+/,u={},O=function(g){return(g=+g)+(g>68?1900:2e3)},b=function(g){return function(M){this[g]=+M}},R=[/[+-]\d\d:?(\d\d)?|Z/,function(g){(this.zone||(this.zone={})).offset=function(M){if(!M||M==="Z")return 0;var A=M.match(/([+-]|\d\d)/g),D=60*A[1]+(+A[2]||0);return D===0?0:A[0]==="+"?-D:D}(g)}],F=function(g){var M=u[g];return M&&(M.indexOf?M:M.s.concat(M.f))},Y=function(g,M){var A,D=u.meridiem;if(D){for(var V=1;V<=24;V+=1)if(g.indexOf(D(V,0,M))>-1){A=V>12;break}}else A=g===(M?"pm":"PM");return A},I={A:[$,function(g){this.afternoon=Y(g,!1)}],a:[$,function(g){this.afternoon=Y(g,!0)}],Q:[n,function(g){this.month=3*(g-1)+1}],S:[n,function(g){this.milliseconds=100*+g}],SS:[i,function(g){this.milliseconds=10*+g}],SSS:[/\d{3}/,function(g){this.milliseconds=+g}],s:[r,b("seconds")],ss:[r,b("seconds")],m:[r,b("minutes")],mm:[r,b("minutes")],H:[r,b("hours")],h:[r,b("hours")],HH:[r,b("hours")],hh:[r,b("hours")],D:[r,b("day")],DD:[i,b("day")],Do:[$,function(g){var M=u.ordinal,A=g.match(/\d+/);if(this.day=A[0],M)for(var D=1;D<=31;D+=1)M(D).replace(/\[|\]/g,"")===g&&(this.day=D)}],w:[r,b("week")],ww:[i,b("week")],M:[r,b("month")],MM:[i,b("month")],MMM:[$,function(g){var M=F("months"),A=(F("monthsShort")||M.map(function(D){return D.slice(0,3)})).indexOf(g)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[$,function(g){var M=F("months").indexOf(g)+1;if(M<1)throw new Error;this.month=M%12||M}],Y:[/[+-]?\d+/,b("year")],YY:[i,function(g){this.year=O(g)}],YYYY:[/\d{4}/,b("year")],Z:R,ZZ:R};function K(g){var M,A;M=g,A=u&&u.formats;for(var D=(g=M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,x,N){var L=N&&N.toUpperCase();return x||A[N]||t[N]||A[L].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(m,a,s){return a||s.slice(1)})})).match(e),V=D.length,v=0;v<V;v+=1){var U=D[v],G=I[U],B=G&&G[0],_=G&&G[1];D[v]=_?{regex:B,parser:_}:U.replace(/^\[|\]$/g,"")}return function(S){for(var x={},N=0,L=0;N<V;N+=1){var m=D[N];if(typeof m=="string")L+=m.length;else{var a=m.regex,s=m.parser,c=S.slice(L),f=a.exec(c)[0];s.call(x,f),S=S.replace(f,"")}}return function(d){var h=d.afternoon;if(h!==void 0){var y=d.hours;h?y<12&&(d.hours+=12):y===12&&(d.hours=0),delete d.afternoon}}(x),x}}return function(g,M,A){A.p.customParseFormat=!0,g&&g.parseTwoDigitYear&&(O=g.parseTwoDigitYear);var D=M.prototype,V=D.parse;D.parse=function(v){var U=v.date,G=v.utc,B=v.args;this.$u=G;var _=B[1];if(typeof _=="string"){var S=B[2]===!0,x=B[3]===!0,N=S||x,L=B[2];x&&(L=B[2]),u=this.$locale(),!S&&L&&(u=A.Ls[L]),this.$d=function(c,f,d,h){try{if(["x","X"].indexOf(f)>-1)return new Date((f==="X"?1e3:1)*c);var y=K(f)(c),T=y.year,j=y.month,E=y.day,C=y.hours,et=y.minutes,J=y.seconds,nt=y.milliseconds,X=y.zone,k=y.week,H=new Date,Q=E||(T||j?1:H.getDate()),rt=T||H.getFullYear(),lt=0;T&&!j||(lt=j>0?j-1:H.getMonth());var dt,wt=C||0,$t=et||0,Mt=J||0,Ot=nt||0;return X?new Date(Date.UTC(rt,lt,Q,wt,$t,Mt,Ot+60*X.offset*1e3)):d?new Date(Date.UTC(rt,lt,Q,wt,$t,Mt,Ot)):(dt=new Date(rt,lt,Q,wt,$t,Mt,Ot),k&&(dt=h(dt).week(k).toDate()),dt)}catch{return new Date("")}}(U,_,G,A),this.init(),L&&L!==!0&&(this.$L=this.locale(L).$L),N&&U!=this.format(_)&&(this.$d=new Date("")),u={}}else if(_ instanceof Array)for(var m=_.length,a=1;a<=m;a+=1){B[1]=_[a-1];var s=A.apply(this,B);if(s.isValid()){this.$d=s.$d,this.$L=s.$L,this.init();break}a===m&&(this.$d=new Date(""))}else V.call(this,v)}}})});o();o();o();o();o();function ut(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}o();function gt(t){return t!==null&&typeof t=="object"}o();o();var ie=Object.prototype.toString,ot=t=>ie.call(t),Ye=t=>ot(t).slice(8,-1),st=t=>typeof t=="string",P=t=>typeof t=="number"&&Number.isFinite(t),vt=t=>typeof t=="boolean",ve=t=>t===null,ct=t=>t===void 0,Nt=t=>typeof t=="symbol",Z=Array.isArray,bt=t=>typeof t=="function",Pt=t=>ot(t)==="[object Map]",It=t=>ot(t)==="[object Set]",_t=t=>ot(t)==="[object Date]",Lt=t=>ot(t)==="[object RegExp]",Ct=t=>gt(t)&&bt(t?.then)&&bt(t?.catch),Ft=t=>t==null,Ne=t=>t!=null,Pe=(t,e)=>t!==e;function q(t){return ot(t)==="[object Object]"}function it(t){return Z(t)?t:[t]}o();o();o();o();function Qe(t){let e=[],n,i="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)i+=e.pop().toString();return i}var Ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function tr(t){let e="",n="";for(let r=0;r<t.length;r++)n+=t[r].charCodeAt(0).toString(2).padStart(8,"0");for(let r=0;r<n.length;r+=6)e+=Ut[Number.parseInt(n.slice(r,r+6).padEnd(6,"0"),2)];let i=e.length%4;return i!==0&&(e+="=".repeat(4-i)),e}function er(t){let e="",n="";for(let i=0;i<t.length&&t[i]!=="=";i++)n+=Ut.indexOf(t[i]).toString(2).padStart(6,"0");for(let i=0;i<n.length;i+=8){let r=Number.parseInt(n.slice(i,i+8),2);r&&(e+=String.fromCharCode(r))}return e}o();function or(...t){return t.reduce((e,n)=>function(...i){return n(e(...i))})}function ir(...t){return t.reduce((e,n)=>function(...i){return e(n(...i))})}o();function fr(t,e=500){let n=null;return function(...i){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,i)},e)}}o();function at(t){let e=new WeakMap;function n(r){if(!gt(r))return r;if(e.has(r))return e.get(r);if(_t(r)){let u=new Date(r);return e.set(r,u),u}if(Lt(r)){let u=new RegExp(r.source,r.flags);return e.set(r,u),u}if(Ct(r))return r;if(typeof Buffer<"u"&&Buffer.isBuffer(r)){let u=Buffer.allocUnsafe?Buffer.allocUnsafe(r.length):Buffer.from(r);return r.copy(u),e.set(r,u),u}if(r instanceof Error){let u=new r.constructor(r.message);return e.set(r,u),i(r,u),u}if(r instanceof Boolean||r instanceof Number||r instanceof String){let u=r.valueOf(),O=Object(u);return e.set(r,O),i(r,O),O}if(typeof Node<"u"&&r instanceof Node)return{};if(r instanceof WeakMap)return{};if(r instanceof WeakSet)return{};if(r instanceof ArrayBuffer)return r.slice(0);if(r instanceof DataView){let u=r.buffer.slice(0);return new DataView(u,r.byteOffset,r.byteLength)}if(ArrayBuffer.isView(r)){let u=r.constructor;return new u(r)}if(Pt(r)){let u=new Map;return e.set(r,u),r.forEach((O,b)=>u.set(n(b),n(O))),u}if(It(r)){let u=new Set;return e.set(r,u),r.forEach(O=>u.add(n(O))),u}let $=Z(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));return e.set(r,$),i(r,$),se(r,$),$}function i(r,$){let u=Object.getOwnPropertyDescriptors(r);for(let O of Reflect.ownKeys(u)){let b=u[O];b.get||b.set?Object.defineProperty($,O,b):Object.defineProperty($,O,{...b,value:n(b.value)})}}return n(t)}function se(t,e){Object.isFrozen(t)?Object.freeze(e):Object.isSealed(t)?Object.seal(e):Object.isExtensible(t)||Object.preventExtensions(e)}o();function gr(t,e,n={}){return Ht(Bt(t,n),Bt(e,n),n)}function Ht(t,e,n){return Z(t)?fe(t,e,n):ae(t,e,n)}function ae(t,e,n){if(!q(e))return e;let i=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(r=>{(q(t[r])||Z(t[r]))&&(q(e[r])||Z(e[r]))?t[r]=Ht(t[r],e[r],n):Object.defineProperty(t,r,i[r])}),t}function fe(t,e,n){let{mergeStrategy:i="replace"}=n;if(Z(e))switch(i){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Bt(t,e){let{deepClone:n=!0}=e;return n?at(t):t}o();var yt=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function w(t,e){throw new yt(`[${t}] ${e}`)}function wr(t,e){let n=st(t)?new yt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}o();var mt=(t,e,...n)=>{if(!e)return;let i=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,i)},pt=(t,...e)=>{mt("info",t,...e)};pt.info=(t,...e)=>{mt("info",t,...e)};pt.warn=(t,...e)=>{mt("warn",t,...e)};pt.error=(t,...e)=>{mt("error",t,...e)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=t=>mt=t);o();var ue={stringify:t=>(ut(t)||w("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(st(t)||w("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let n=ue.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${n}`:`${t}&${n}`:`${t}?${n}`}};o();function Er(t,e=500){let n=null;return function(...i){if(Ft(n))return n=Date.now(),t.apply(this,i);let r=Date.now();if(r-n>=e)return n=r,t.apply(this,i)}}o();o();function Cr(t){ce(t);let{fn:e,maxAttempts:n=3,retryDelay:i=1e3,enableExponentialBackoff:r=!1,signal:$}=t,u,O=$?new Promise((R,F)=>{let Y=()=>F(Wt());$.addEventListener("abort",Y),u=()=>$.removeEventListener("abort",Y)}):null;return new Promise((R,F)=>{(async()=>{for(let I=1;I<=n;I++){if($?.aborted)return F(Wt());try{let K=await Promise.race(O?[e(),O]:[e()]);return R(K)}catch(K){let g=r?i*2**(I-1):i;if(pt("withRetry",`Attempt ${I}/${n} failed. Retrying in ${g}ms...`),K instanceof Error&&K.name==="AbortError"||I===n)return F(K);await new Promise(M=>setTimeout(M,g))}}})()}).finally(()=>u?.())}function ce(t){q(t)||w("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&w("withRetry",'"fn" must be a function that returns a Promise'),!ct(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&w("withRetry",'"maxAttempts" must be a positive integer'),!ct(t.retryDelay)&&(!P(t.retryDelay)||t.retryDelay<0)&&w("withRetry",'"retryDelay" must be a non-negative number'),!ct(t.enableExponentialBackoff)&&!vt(t.enableExponentialBackoff)&&w("withRetry",'"enableExponentialBackoff" must be a boolean'),!ct(t.signal)&&typeof t.signal!="object"&&w("withRetry",'"signal" must be an AbortSignal')}var me="The operation was aborted";function Wt(t=me){let e=new Error(t);return e.name="AbortError",e}function nn(t){ut(t)||w("hasCircularReference",'"obj" must be a object');let e=new Set;function n(i){if(ut(i)){if(e.has(i))return!0;e.add(i);for(let r of Object.keys(i))if(n(i[r]))return!0;e.delete(i)}return!1}return n(t)}o();function cn(t,e){if(!q(t))return{};let n=at(t),i=it(e);for(let r of i)Reflect.deleteProperty(n,r);return n}o();function gn(t,e,n={}){let{includeProto:i=!1,includeSymbols:r=!0,includeNonEnum:$=!1}=n,u={};return q(t)&&it(e).forEach(b=>{Nt(b)&&!r||!(i?b in t:Object.hasOwn(t,b))||!$&&(i?pe(t,b):Object.getOwnPropertyDescriptor(t,b))?.enumerable===!1||(u[b]=at(t[b]))}),u}function pe(t,e){let n=t;for(;n!==null;){let i=Object.getOwnPropertyDescriptor(n,e);if(i)return i;n=Object.getPrototypeOf(n)}}o();o();o();o();o();function Dn(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 An(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function jn(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Rn(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}o();function Yn(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function vn(t){return/^[1-9]\d*$/.test(t)}function zt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Nn(t){return/^-[1-9]\d*$/.test(t)}function Pn(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}o();var Kt=ht(xt(),1);function Vt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Kt.default)(t,e,!0).isValid()}o();function Un(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}o();function Wn(t){return t===""}o();var Tt=ht(xt(),1);function Zn(t){if(!/^[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))return!1;let n=t.slice(6,14);return Vt(n,"YYYYMMDD")&&(0,Tt.default)(n,"YYYYMMDD").isBefore((0,Tt.default)())}o();function qn(t){return/^1[3-9]\d{9}$/.test(t)}o();var eo=t=>{if(!st(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let n=Number(t);return!(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)};o();function oo(t){return/^https?:\/\/\S+$/i.test(t)}function Oo(t,e){return(!P(t)||!zt(t.toString()))&&w("generateRandomArray","num must be greater than 0"),bt(e)||w("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}o();function To(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}o();var ft=ht(xt(),1),Xt=ht(Zt(),1);o();o();function W(t){return t[Math.floor(Math.random()*t.length)]}function z(t={}){P(t)&&(t={max:t});let{min:e=1,max:n=W(de())}=t;le(e,n);let i=Math.ceil(e),r=Math.floor(n);return Math.floor(Math.random()*(r-i+1)+i)}function le(t,e){let n=Math.ceil(t),i=Math.floor(e);Number.isSafeInteger(n)||w("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(i)||w("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),i<n&&(e>=t&&w("getRandomInt",`No integer value found between ${t} and ${e}`),w("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function de(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let n=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(n)})}ft.default.extend(Xt.default);function qt(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,ft.default)().format(Gt),format:i=Gt}=t,r=(0,ft.default)(e),$=(0,ft.default)(n);(!r.isValid()||!$.isValid())&&w("generateRandomDate","start and end parameters must be valid date format"),r.isAfter($)&&w("generateRandomDate","start date must be before end date");let u=r.valueOf(),O=$.valueOf(),b=z({min:u,max:O});return(0,ft.default)(b).format(i)}var Gt="YYYY-MM-DD HH:mm:ss";o();o();function tt(t={}){let e=ge(t),n=be(e);ye(n);let{length:i}=e;xe(i.min,i.max);let r=z(i),$=e.prefix||"";for(let u=0;u<r;u++)$+=n.charAt(Math.floor(Math.random()*n.length));return $+(e.suffix||"")}var he=16,Rt=1;function ge(t){let e=P(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:P(t.length)?{max:t.length,min:t.length}:{max:he,min:Rt,...t.length},extra:e?[]:[...new Set(it(t.extra||[]))]}}function be(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=it(t.extra).join(""),e}function ye(t){t.length===0&&w("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function xe(t,e){Number.isInteger(t)||w("getRandomString","min must be an integer"),Number.isInteger(e)||w("getRandomString","max must be an integer"),t<Rt&&w("getRandomString",`Minimum length cannot be less than ${Rt}`),e<t&&w("getRandomString","Maximum length cannot be less than minimum length")}function Xo(){let t=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],e=z({min:5,max:10}),n=tt({length:e,lowerCase:!0,upperCase:!1,number:!0}),i=W(t);return`${n}@${i}`}o();function ei(t={}){P(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:i=2}=t;if((!P(e)||!P(n))&&w("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(i)||i<0)&&w("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),e===n)return Number(e.toFixed(i));e>n&&w("generateRandomFloat",`"max" (${n}) must be greater than "min" (${e})`);let r=Math.random()*(n-e)+e;return Number(r.toFixed(i))}o();o();function Et(t,e){(!P(t)||t<=0)&&w("generateRandomStringFromSource",'"num" must be greater than 0'),(!Z(e)||e.length===0)&&w("generateRandomStringFromSource",'"source" must be a non-empty array');let n="";for(let i=0;i<t;i++)n+=W(e);return n}function pi(){let t=z({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,qt({format:"YYYYMMDD"}),Et(3,e),Et(1,[...e,"X","x"])].join("")}o();function bi(){return W(["13","14","15","16","17","18","19"])+z(999999999).toString().padEnd(9,"0")}o();function Oi(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${tt({length:{min:4,max:8}})}`,`?id=${z()}`,`?page=${tt({length:{min:2,max:4}})}`,`?query=${tt({length:{min:5,max:6}})}`,`?search=${tt({length:{min:1,max:4}})}`,`?token=${tt({length:{min:16,max:16}})}`];return`${W(t)}${tt({length:{min:5,max:25}})}${W(e)}${W(n)}`}o();o();export{yt as UtilsError,er as base64Decode,tr as base64Encode,it as castArray,or as compose,ir as composeRight,fr as debounce,wr as debugWarn,Qe as decimalToBinary,at as deepClone,gr as deepMerge,Oo as generateRandomArray,To as generateRandomColor,qt as generateRandomDate,Xo as generateRandomEmail,ei as generateRandomFloat,pi as generateRandomIdCard,bi as generateRandomMobilePhone,Et as generateRandomStringFromSource,z as getRandomInt,W as getRandomItem,tt as getRandomString,Oi as getRandomUrl,Pe as hasChanged,nn as hasCircularReference,Z as isArray,vt as isBoolean,_t as isDate,Vt as isDateString,Ne as isDef,Un as isEmail,Wn as isEmptyString,Dn as isFloat,bt as isFunction,Zn as isIdCard,Yn as isInteger,Pt as isMap,qn as isMobilePhone,jn as isNegativeFloat,Nn as isNegativeInteger,Ft as isNil,An as isNonNegativeFloat,zt as isNonNegativeInteger,Rn as isNonPositiveFloat,Pn as isNonPositiveInteger,ve as isNull,P as isNumber,ut as isObject,gt as isObjectLike,q as isPlainObject,Tn as isPositiveFloat,vn as isPositiveInteger,Ct as isPromise,Lt as isRegExp,It as isSet,st as isString,eo as isStringNumber,Nt as isSymbol,oo as isURL,ct as isUndef,pt as log,ie as objectToString,cn as omit,gn as pick,ue as qs,Er as throttle,w as throwError,ot as toTypeString,Ye as toTypeValue,Cr as withRetry};
|
|
@@ -51,7 +51,6 @@ declare function castArray<T>(target: Arrayable<T>): T[];
|
|
|
51
51
|
* isObject([1, 2, 3]) // => true
|
|
52
52
|
* isObject(function() {}) // => true
|
|
53
53
|
*
|
|
54
|
-
* @example
|
|
55
54
|
* isObject(null) // => false
|
|
56
55
|
* isObject(undefined) // => false
|
|
57
56
|
* isObject('string') // => false
|
|
@@ -72,7 +71,6 @@ declare function isObject(value: unknown): value is AnyObject;
|
|
|
72
71
|
* isObjectLike([1, 2, 3]) // => true
|
|
73
72
|
* isObjectLike(new Date()) // => true
|
|
74
73
|
*
|
|
75
|
-
* @example
|
|
76
74
|
* isObjectLike(function() {}) // => false
|
|
77
75
|
* isObjectLike(null) // => false
|
|
78
76
|
* isObjectLike('string') // => false
|
|
@@ -94,7 +92,6 @@ declare function isObjectLike(value: unknown): value is AnyObject;
|
|
|
94
92
|
* isPlainObject(Object.create(null)) // => true
|
|
95
93
|
* isPlainObject(new class Foo {}()) // => true
|
|
96
94
|
*
|
|
97
|
-
* @example
|
|
98
95
|
* isPlainObject([1, 2, 3]) // => false
|
|
99
96
|
* isPlainObject(null) // => false
|
|
100
97
|
* isPlainObject(new Date()) // => false
|
|
@@ -714,19 +711,19 @@ declare function composeRight(...fns: ((...args: any[]) => any)[]): (...args: an
|
|
|
714
711
|
declare function debounce(target: Function, wait?: number): (...args: any[]) => void;
|
|
715
712
|
|
|
716
713
|
/**
|
|
717
|
-
* Creates a deep clone of any value, preserving object structure and references.
|
|
714
|
+
* Creates a deep clone of any value, preserving object structure, state, and references.
|
|
718
715
|
*
|
|
719
716
|
* This utility performs a complete deep copy of the input value, handling complex nested structures,
|
|
720
717
|
* circular references, and various JavaScript types. It preserves prototype chains, property descriptors,
|
|
721
|
-
* Symbol properties,
|
|
718
|
+
* Symbol properties, object extensibility states (frozen, sealed, non-extensible), and handles special
|
|
719
|
+
* objects like Date, RegExp, Map, Set, typed arrays, and more.
|
|
722
720
|
*
|
|
723
721
|
* @example
|
|
724
722
|
* deepClone({ name: 'test' }) => { name: 'test' }
|
|
725
723
|
*
|
|
726
|
-
* @example
|
|
727
724
|
* deepClone({ user: { name: 'John', data: [1, 2] } }) => { user: { name: 'John', data: [1, 2] } }
|
|
728
725
|
*
|
|
729
|
-
* @returns A deep clone of the input value with all nested references copied
|
|
726
|
+
* @returns A deep clone of the input value with all nested references copied and object states preserved
|
|
730
727
|
*/
|
|
731
728
|
declare function deepClone<T>(target: T): T;
|
|
732
729
|
|
|
@@ -839,159 +836,6 @@ declare global {
|
|
|
839
836
|
var lntvowSetLogImpl: (newImpl: typeof baseConsole) => void;
|
|
840
837
|
}
|
|
841
838
|
|
|
842
|
-
/**
|
|
843
|
-
* Converts an object into a URL query string with extensive customization options.
|
|
844
|
-
*
|
|
845
|
-
* This utility transforms JavaScript objects and arrays into URL-encoded query strings,
|
|
846
|
-
* supporting various formatting options including nested objects, arrays, null handling,
|
|
847
|
-
* and encoding strategies. The function provides flexible configuration for
|
|
848
|
-
* different query string formats and encoding requirements.
|
|
849
|
-
*
|
|
850
|
-
* @example
|
|
851
|
-
* // Basic usage with default settings
|
|
852
|
-
* stringify({ name: 'John', age: 30 })
|
|
853
|
-
* // Returns: "name=John&age=30"
|
|
854
|
-
*
|
|
855
|
-
* @example
|
|
856
|
-
* // Array handling with different formats
|
|
857
|
-
* stringify({ colors: ['red', 'blue', 'green'] }, { arrayFormat: 'indices' }) // => "colors[0]=red&colors[1]=blue&colors[2]=green"
|
|
858
|
-
*
|
|
859
|
-
* stringify({ colors: ['red', 'blue'] }, { arrayFormat: 'brackets' }) // => "colors[]=red&colors[]=blue"
|
|
860
|
-
*
|
|
861
|
-
* stringify({ colors: ['red', 'blue'] }, { arrayFormat: 'comma' }) // => "colors=red,blue"
|
|
862
|
-
*
|
|
863
|
-
* @example
|
|
864
|
-
* // Nested objects with dot notation
|
|
865
|
-
* stringify({ user: { name: 'John', profile: { age: 30 } } }, { allowDots: true }) // => "user.name=John&user.profile.age=30"
|
|
866
|
-
*
|
|
867
|
-
* @example
|
|
868
|
-
* // Encoding and null handling
|
|
869
|
-
* stringify({ key: null, empty: undefined }, { skipNulls: true, strictNullHandling: true }) // => "" (skips null and undefined values)
|
|
870
|
-
*
|
|
871
|
-
* @example
|
|
872
|
-
* // With query prefix and custom delimiter
|
|
873
|
-
* stringify({ a: 1, b: 2 }, { addQueryPrefix: true, delimiter: ';' }) // => "?a=1;b=2"
|
|
874
|
-
*
|
|
875
|
-
* @returns A URL-encoded query string representation of the input object
|
|
876
|
-
*
|
|
877
|
-
* @throws When `options` is not a plain object
|
|
878
|
-
* @throws When `encode` is not a boolean
|
|
879
|
-
* @throws When `encodeValuesOnly` is not a boolean
|
|
880
|
-
* @throws When `arrayFormat` is not one of: "indices", "brackets", "repeat", "comma"
|
|
881
|
-
* @throws When `allowDots` is not a boolean
|
|
882
|
-
* @throws When `skipNulls` is not a boolean
|
|
883
|
-
* @throws When `strictNullHandling` is not a boolean
|
|
884
|
-
* @throws When `addQueryPrefix` is not a boolean
|
|
885
|
-
* @throws When `delimiter` is not a string
|
|
886
|
-
* @throws When `encodeDotInKeys` is not a boolean
|
|
887
|
-
* @throws When `commaRoundTrip` is not a boolean
|
|
888
|
-
* @throws When `allowEmptyArrays` is not a boolean
|
|
889
|
-
*/
|
|
890
|
-
declare function qsStringify(obj: AnyObject, options?: StringifyOptions): string;
|
|
891
|
-
interface StringifyOptions {
|
|
892
|
-
/**
|
|
893
|
-
* Whether to URL-encode the output.
|
|
894
|
-
*
|
|
895
|
-
* When false, no encoding is performed. When true, applies URL encoding
|
|
896
|
-
* according to the `encodeValuesOnly` setting.
|
|
897
|
-
*
|
|
898
|
-
* @default true
|
|
899
|
-
*/
|
|
900
|
-
encode?: boolean;
|
|
901
|
-
/**
|
|
902
|
-
* Whether to encode only values, not keys.
|
|
903
|
-
*
|
|
904
|
-
* When true, only values are URL-encoded while keys remain unencoded.
|
|
905
|
-
* When false, both keys and values are encoded (if `encode` is true).
|
|
906
|
-
*
|
|
907
|
-
* @default false
|
|
908
|
-
*/
|
|
909
|
-
encodeValuesOnly?: boolean;
|
|
910
|
-
/**
|
|
911
|
-
* Format for serializing arrays.
|
|
912
|
-
*
|
|
913
|
-
* - 'indices': Uses indexed format like "key[0]=value1&key[1]=value2"
|
|
914
|
-
* - 'brackets': Uses bracket format like "key[]=value1&key[]=value2"
|
|
915
|
-
* - 'repeat': Uses repeated key format like "key=value1&key=value2"
|
|
916
|
-
* - 'comma': Uses comma-separated format like "key=value1,value2"
|
|
917
|
-
*
|
|
918
|
-
* @default 'indices'
|
|
919
|
-
*/
|
|
920
|
-
arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma';
|
|
921
|
-
/**
|
|
922
|
-
* Whether to use dot notation for nested objects.
|
|
923
|
-
*
|
|
924
|
-
* When true, nested objects use dot notation: "user.name=John&user.age=30".
|
|
925
|
-
* When false, uses bracket notation: "user[name]=John&user[age]=30".
|
|
926
|
-
*
|
|
927
|
-
* @default false
|
|
928
|
-
*/
|
|
929
|
-
allowDots?: boolean;
|
|
930
|
-
/**
|
|
931
|
-
* Whether to skip null values in the output.
|
|
932
|
-
*
|
|
933
|
-
* When true, keys with null values are omitted from the result.
|
|
934
|
-
* When false, null values are included according to `strictNullHandling`.
|
|
935
|
-
*
|
|
936
|
-
* @default false
|
|
937
|
-
*/
|
|
938
|
-
skipNulls?: boolean;
|
|
939
|
-
/**
|
|
940
|
-
* How to handle null values when not skipping them.
|
|
941
|
-
*
|
|
942
|
-
* When true, null values appear as "key" without equals sign.
|
|
943
|
-
* When false, null values appear as "key=" with empty value.
|
|
944
|
-
*
|
|
945
|
-
* @default false
|
|
946
|
-
*/
|
|
947
|
-
strictNullHandling?: boolean;
|
|
948
|
-
/**
|
|
949
|
-
* Whether to add a question mark prefix to the result.
|
|
950
|
-
*
|
|
951
|
-
* When true, the result is prefixed with "?" making it ready for URL usage.
|
|
952
|
-
* When false, returns the raw query string without prefix.
|
|
953
|
-
*
|
|
954
|
-
* @default false
|
|
955
|
-
*/
|
|
956
|
-
addQueryPrefix?: boolean;
|
|
957
|
-
/**
|
|
958
|
-
* Custom delimiter for separating key-value pairs.
|
|
959
|
-
*
|
|
960
|
-
* Allows using alternative separators instead of the standard "&".
|
|
961
|
-
* Common alternatives include ";" for some URL formats.
|
|
962
|
-
*
|
|
963
|
-
* @default '&'
|
|
964
|
-
*/
|
|
965
|
-
delimiter?: string;
|
|
966
|
-
/**
|
|
967
|
-
* Whether to encode dots in object keys.
|
|
968
|
-
*
|
|
969
|
-
* When true, dots in keys will be percent-encoded (%2E) to prevent
|
|
970
|
-
* conflicts with dot notation. Automatically enables `allowDots` if not explicitly set.
|
|
971
|
-
*
|
|
972
|
-
* @default false
|
|
973
|
-
*/
|
|
974
|
-
encodeDotInKeys?: boolean;
|
|
975
|
-
/**
|
|
976
|
-
* Whether to add square brackets for single-item comma arrays.
|
|
977
|
-
*
|
|
978
|
-
* When true and using comma format, single-item arrays will include
|
|
979
|
-
* brackets to distinguish from regular values: "key[]=value" vs "key=value".
|
|
980
|
-
*
|
|
981
|
-
* @default false
|
|
982
|
-
*/
|
|
983
|
-
commaRoundTrip?: boolean;
|
|
984
|
-
/**
|
|
985
|
-
* Whether to serialize empty arrays.
|
|
986
|
-
*
|
|
987
|
-
* When true, empty arrays will be represented as "key[]" in the output.
|
|
988
|
-
* When false, empty arrays are omitted from the result.
|
|
989
|
-
*
|
|
990
|
-
* @default false
|
|
991
|
-
*/
|
|
992
|
-
allowEmptyArrays?: boolean;
|
|
993
|
-
}
|
|
994
|
-
|
|
995
839
|
/**
|
|
996
840
|
* Utility functions for working with URL query strings.
|
|
997
841
|
*
|
|
@@ -1521,4 +1365,4 @@ declare const isStringNumber: (val: string) => boolean;
|
|
|
1521
1365
|
*/
|
|
1522
1366
|
declare function isURL(val: string): boolean;
|
|
1523
1367
|
|
|
1524
|
-
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type GenerateRandomDateOptions, type GenerateRandomFloatOptions, type PlainObject, type StringNumber,
|
|
1368
|
+
export { type AnyObject, type ArrayItem, type Arrayable, type DeepMergeOptions, type GenerateRandomDateOptions, type GenerateRandomFloatOptions, type PlainObject, type StringNumber, UtilsError, type WithRetryOptions, base64Decode, base64Encode, castArray, compose, composeRight, debounce, debugWarn, decimalToBinary, deepClone, deepMerge, generateRandomArray, generateRandomColor, generateRandomDate, generateRandomEmail, generateRandomFloat, generateRandomIdCard, generateRandomMobilePhone, generateRandomStringFromSource, getRandomInt, getRandomItem, getRandomString, getRandomUrl, hasChanged, hasCircularReference, isArray, isBoolean, isDate, isDateString, isDef, isEmail, isEmptyString, isFloat, isFunction, isIdCard, isInteger, isMap, isMobilePhone, isNegativeFloat, isNegativeInteger, isNil, isNonNegativeFloat, isNonNegativeInteger, isNonPositiveFloat, isNonPositiveInteger, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPositiveFloat, isPositiveInteger, isPromise, isRegExp, isSet, isString, isStringNumber, isSymbol, isURL, isUndef, log, objectToString, omit, pick, qs, throttle, throwError, toTypeString, toTypeValue, withRetry };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* @ts-self-types="./utils.esm-bundler.d.ts" */
|
|
2
|
-
function $(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function U(e){return e!==null&&typeof e=="object"}var pe=Object.prototype.toString,N=e=>pe.call(e),ke=e=>N(e).slice(8,-1),D=e=>typeof e=="string",d=e=>typeof e=="number"&&Number.isFinite(e),x=e=>typeof e=="boolean",H=e=>e===null,u=e=>e===void 0,z=e=>typeof e=="symbol",y=Array.isArray,B=e=>typeof e=="function",q=e=>N(e)==="[object Map]",Q=e=>N(e)==="[object Set]",X=e=>N(e)==="[object Date]",J=e=>N(e)==="[object RegExp]",Z=e=>U(e)&&B(e?.then)&&B(e?.catch),ee=e=>e==null,Fe=e=>e!=null,Ce=(e,t)=>e!==t;function h(e){return N(e)==="[object Object]"}function M(e){return y(e)?e:[e]}function et(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 te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function tt(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+=te[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 rt(e){let t="",r="";for(let n=0;n<e.length&&e[n]!=="=";n++)r+=te.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 it(...e){return e.reduce((t,r)=>function(...n){return r(t(...n))})}function at(...e){return e.reduce((t,r)=>function(...n){return t(r(...n))})}function ft(e,t=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,n)},t)}}function I(e){let t=new WeakMap;function r(n){if(!U(n))return n;if(X(n))return new Date(n);if(J(n))return new RegExp(n);if(Z(n))return n;if(t.has(n))return t.get(n);if(q(n)){let m=new Map;return t.set(n,m),n.forEach((p,g)=>m.set(r(g),r(p))),m}if(Q(n)){let m=new Set;return t.set(n,m),n.forEach(p=>m.add(r(p))),m}let o=y(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));t.set(n,o);let f=Object.getOwnPropertyDescriptors(n);for(let m of Reflect.ownKeys(f)){let p=f[m];p.get||p.set?Object.defineProperty(o,m,p):Object.defineProperty(o,m,{...p,value:r(p.value)})}return o}return r(e)}function yt(e,t,r={}){return ne(re(e,r),re(t,r),r)}function ne(e,t,r){return y(e)?ge(e,t,r):le(e,t,r)}function le(e,t,r){if(!h(t))return t;let n=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(o=>{(h(e[o])||y(e[o]))&&(h(t[o])||y(t[o]))?e[o]=ne(e[o],t[o],r):Object.defineProperty(e,o,n[o])}),e}function ge(e,t,r){let{mergeStrategy:n="replace"}=r;if(y(t))switch(n){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function re(e,t){let{deepClone:r=!0}=t;return r?I(e):e}var V=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function s(e,t){throw new V(`[${e}] ${t}`)}function wt(e,t){let r=D(e)?new V(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var K=(e,t,...r)=>{if(!t)return;let n=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,n)},Y=(e,...t)=>{K("info",e,...t)};Y.info=(e,...t)=>{K("info",e,...t)};Y.warn=(e,...t)=>{K("warn",e,...t)};Y.error=(e,...t)=>{K("error",e,...t)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=e=>K=e);function Dt(e,t={}){de(t);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:o="indices",encodeDotInKeys:f=!1,skipNulls:m=!1,strictNullHandling:p=!1,commaRoundTrip:g=!1,allowEmptyArrays:k=!1,addQueryPrefix:T=!1,delimiter:F="&"}=t,S=t.allowDots??!1;f&&u(t.allowDots)&&(S=!0);let b=[],R=c=>r&&!n?encodeURIComponent(c):c,C=c=>r?encodeURIComponent(c):c;function _(c,l){if(!u(l)){if(H(l)){if(m)return;b.push(`${R(c)}${p?"":"="}`);return}if(y(l)){if(l.length===0){k&&b.push(`${R(c)}[]`);return}if(o==="comma"){let j=n?l.map(C).join(","):C(l.join(","));if(l.length===1&&H(l[0])){if(m)return;b.push(`${R(c)}${g?"[]":""}${p?"":"="}`)}else l.length===1?b.push(`${R(c)}${g?"[]":""}=${j}`):b.push(`${R(c)}=${j}`);return}l.forEach((j,P)=>{let E=c;o==="indices"?E=`${c}[${P}]`:o==="brackets"&&(E=`${c}[]`),_(E,j)});return}if($(l)){Object.keys(l).forEach(j=>{let P=c;f&&(P=P.replace(/\./g,"%2E"));let E=j;S?(f&&(E=E.replace(/\./g,"%2E")),_(`${P}.${E}`,l[j])):_(`${P}[${E}]`,l[j])});return}b.push(`${R(c)}=${C(l)}`)}}if(!$(e))return"";oe(e)&&s("stringify","Input object contains circular references, cannot stringify"),y(e)?e.forEach((c,l)=>_(`${l}`,c)):Object.keys(e).forEach(c=>_(c,e[c]));let v=b.join(F);return T&&v?`?${v}`:v}function de(e={}){h(e)||s("stringify",'"options" must be a plain object'),!u(e.encode)&&!x(e.encode)&&s("stringify",'"encode" must be a boolean'),!u(e.encodeValuesOnly)&&!x(e.encodeValuesOnly)&&s("stringify",'"encodeValuesOnly" must be a boolean'),!u(e.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(e.arrayFormat)&&s("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!u(e.allowDots)&&!x(e.allowDots)&&s("stringify",'"allowDots" must be a boolean'),!u(e.skipNulls)&&!x(e.skipNulls)&&s("stringify",'"skipNulls" must be a boolean'),!u(e.strictNullHandling)&&!x(e.strictNullHandling)&&s("stringify",'"strictNullHandling" must be a boolean'),!u(e.addQueryPrefix)&&!x(e.addQueryPrefix)&&s("stringify",'"addQueryPrefix" must be a boolean'),!u(e.delimiter)&&!D(e.delimiter)&&s("stringify",'"delimiter" must be a string'),!u(e.encodeDotInKeys)&&!x(e.encodeDotInKeys)&&s("stringify",'"encodeDotInKeys" must be a boolean'),!u(e.commaRoundTrip)&&!x(e.commaRoundTrip)&&s("stringify",'"commaRoundTrip" must be a boolean'),!u(e.allowEmptyArrays)&&!x(e.allowEmptyArrays)&&s("stringify",'"allowEmptyArrays" must be a boolean')}var be={stringify:e=>($(e)||s("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(D(e)||s("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=be.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function _t(e,t=500){let r=null;return function(...n){if(ee(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 Wt(e){ye(e);let{fn:t,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:o=!1,signal:f}=e,m,p=f?new Promise((k,T)=>{let F=()=>T(ie());f.addEventListener("abort",F),m=()=>f.removeEventListener("abort",F)}):null;return new Promise((k,T)=>{(async()=>{for(let S=1;S<=r;S++){if(f?.aborted)return T(ie());try{let b=await Promise.race(p?[t(),p]:[t()]);return k(b)}catch(b){let R=o?n*2**(S-1):n;if(Y("withRetry",`Attempt ${S}/${r} failed. Retrying in ${R}ms...`),b instanceof Error&&b.name==="AbortError"||S===r)return T(b);await new Promise(C=>setTimeout(C,R))}}})()}).finally(()=>m?.())}function ye(e){h(e)||s("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&s("withRetry",'"fn" must be a function that returns a Promise'),!u(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&s("withRetry",'"maxAttempts" must be a positive integer'),!u(e.retryDelay)&&(!d(e.retryDelay)||e.retryDelay<0)&&s("withRetry",'"retryDelay" must be a non-negative number'),!u(e.enableExponentialBackoff)&&!x(e.enableExponentialBackoff)&&s("withRetry",'"enableExponentialBackoff" must be a boolean'),!u(e.signal)&&typeof e.signal!="object"&&s("withRetry",'"signal" must be an AbortSignal')}var xe="The operation was aborted";function ie(e=xe){let t=new Error(e);return t.name="AbortError",t}function oe(e){$(e)||s("hasCircularReference",'"obj" must be a object');let t=new Set;function r(n){if($(n)){if(t.has(n))return!0;t.add(n);for(let o of Object.keys(n))if(r(n[o]))return!0;t.delete(n)}return!1}return r(e)}function ae(e,t,r={}){let{includeProto:n=!1,includeSymbols:o=!0,includeNonEnum:f=!1}=r,m={};return h(e)&&M(t).forEach(g=>{z(g)&&!o||!(n?g in e:Object.hasOwn(e,g))||!f&&(n?he(e,g):Object.getOwnPropertyDescriptor(e,g))?.enumerable===!1||(m[g]=I(e[g]))}),m}function he(e,t){let r=e;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Rr(e,t){if(!h(e))return{};let r=I(e),n=M(t),o=Object.keys(r).filter(f=>!n.includes(f));return ae(r,o)}function Mr(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function Pr(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Ir(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function kr(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Fr(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Kr(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Yr(e){return/^[1-9]\d*$/.test(e)}function se(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Lr(e){return/^-[1-9]\d*$/.test(e)}function Ur(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import Oe from"dayjs";function me(e,t="YYYY-MM-DD HH:mm:ss"){return Oe(e,t,!0).isValid()}function Gr(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function Qr(e){return e===""}import fe from"dayjs";function tn(e){if(!/^[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))return!1;let r=e.slice(6,14);return me(r,"YYYYMMDD")&&fe(r,"YYYYMMDD").isBefore(fe())}function on(e){return/^1[3-9]\d{9}$/.test(e)}var fn=e=>{if(!D(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function pn(e){return/^https?:\/\/\S+$/i.test(e)}function Nn(e,t){return(!d(e)||!se(e.toString()))&&s("generateRandomArray","num must be greater than 0"),B(t)||s("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function In(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}import L from"dayjs";import Ae from"dayjs/plugin/customParseFormat.js";function O(e){return e[Math.floor(Math.random()*e.length)]}function w(e={}){d(e)&&(e={max:e});let{min:t=1,max:r=O(Re())}=e;we(t,r);let n=Math.ceil(t),o=Math.floor(r);return Math.floor(Math.random()*(o-n+1)+n)}function we(e,t){let r=Math.ceil(e),n=Math.floor(t);Number.isSafeInteger(r)||s("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(n)||s("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),n<r&&(t>=e&&s("getRandomInt",`No integer value found between ${e} and ${t}`),s("getRandomInt",`The maximum value ${t} should be greater than the minimum value ${e}`))}function Re(){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)})}L.extend(Ae);function ue(e={}){let{start:t="1800-01-01 00:00:00",end:r=L().format(ce),format:n=ce}=e,o=L(t),f=L(r);(!o.isValid()||!f.isValid())&&s("generateRandomDate","start and end parameters must be valid date format"),o.isAfter(f)&&s("generateRandomDate","start date must be before end date");let m=o.valueOf(),p=f.valueOf(),g=w({min:m,max:p});return L(g).format(n)}var ce="YYYY-MM-DD HH:mm:ss";function A(e={}){let t=Se(e),r=je(t);Ee(r);let{length:n}=t;$e(n.min,n.max);let o=w(n),f=t.prefix||"";for(let m=0;m<o;m++)f+=r.charAt(Math.floor(Math.random()*r.length));return f+(t.suffix||"")}var Te=16,W=1;function Se(e){let t=d(e);return{lowerCase:!0,upperCase:!0,number:!0,...t?{}:e,length:t?{max:e,min:e}:d(e.length)?{max:e.length,min:e.length}:{max:Te,min:W,...e.length},extra:t?[]:[...new Set(M(e.extra||[]))]}}function je(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=M(e.extra).join(""),t}function Ee(e){e.length===0&&s("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function $e(e,t){Number.isInteger(e)||s("getRandomString","min must be an integer"),Number.isInteger(t)||s("getRandomString","max must be an integer"),e<W&&s("getRandomString",`Minimum length cannot be less than ${W}`),t<e&&s("getRandomString","Maximum length cannot be less than minimum length")}function oo(){let e=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],t=w({min:5,max:10}),r=A({length:t,lowerCase:!0,upperCase:!1,number:!0}),n=O(e);return`${r}@${n}`}function fo(e={}){d(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:n=2}=e;if((!d(t)||!d(r))&&s("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&s("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),t===r)return Number(t.toFixed(n));t>r&&s("generateRandomFloat",`"max" (${r}) must be greater than "min" (${t})`);let o=Math.random()*(r-t)+t;return Number(o.toFixed(n))}function G(e,t){(!d(e)||e<=0)&&s("generateRandomStringFromSource",'"num" must be greater than 0'),(!y(t)||t.length===0)&&s("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<e;n++)r+=O(t);return r}function wo(){let e=w({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,ue({format:"YYYYMMDD"}),G(3,t),G(1,[...t,"X","x"])].join("")}function jo(){return O(["13","14","15","16","17","18","19"])+w(999999999).toString().padEnd(9,"0")}function Po(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${A({length:{min:4,max:8}})}`,`?id=${w()}`,`?page=${A({length:{min:2,max:4}})}`,`?query=${A({length:{min:5,max:6}})}`,`?search=${A({length:{min:1,max:4}})}`,`?token=${A({length:{min:16,max:16}})}`];return`${O(e)}${A({length:{min:5,max:25}})}${O(t)}${O(r)}`}export{V as UtilsError,rt as base64Decode,tt as base64Encode,M as castArray,it as compose,at as composeRight,ft as debounce,wt as debugWarn,et as decimalToBinary,I as deepClone,yt as deepMerge,Nn as generateRandomArray,In as generateRandomColor,ue as generateRandomDate,oo as generateRandomEmail,fo as generateRandomFloat,wo as generateRandomIdCard,jo as generateRandomMobilePhone,G as generateRandomStringFromSource,w as getRandomInt,O as getRandomItem,A as getRandomString,Po as getRandomUrl,Ce as hasChanged,oe as hasCircularReference,y as isArray,x as isBoolean,X as isDate,me as isDateString,Fe as isDef,Gr as isEmail,Qr as isEmptyString,Mr as isFloat,B as isFunction,tn as isIdCard,Kr as isInteger,q as isMap,on as isMobilePhone,kr as isNegativeFloat,Lr as isNegativeInteger,ee as isNil,Ir as isNonNegativeFloat,se as isNonNegativeInteger,Fr as isNonPositiveFloat,Ur as isNonPositiveInteger,H as isNull,d as isNumber,$ as isObject,U as isObjectLike,h as isPlainObject,Pr as isPositiveFloat,Yr as isPositiveInteger,Z as isPromise,J as isRegExp,Q as isSet,D as isString,fn as isStringNumber,z as isSymbol,pn as isURL,u as isUndef,Y as log,pe as objectToString,Rr as omit,ae as pick,be as qs,Dt as qsStringify,_t as throttle,s as throwError,N as toTypeString,ke as toTypeValue,Wt as withRetry};
|
|
2
|
+
function T(e){let t=typeof e;return e!==null&&(t==="object"||t==="function")}function N(e){return e!==null&&typeof e=="object"}var re=Object.prototype.toString,y=e=>re.call(e),Se=e=>y(e).slice(8,-1),R=e=>typeof e=="string",u=e=>typeof e=="number"&&Number.isFinite(e),B=e=>typeof e=="boolean",Te=e=>e===null,j=e=>e===void 0,Y=e=>typeof e=="symbol",d=Array.isArray,P=e=>typeof e=="function",L=e=>y(e)==="[object Map]",K=e=>y(e)==="[object Set]",U=e=>y(e)==="[object Date]",W=e=>y(e)==="[object RegExp]",G=e=>N(e)&&P(e?.then)&&P(e?.catch),V=e=>e==null,je=e=>e!=null,Ee=(e,t)=>e!==t;function b(e){return y(e)==="[object Object]"}function h(e){return d(e)?e:[e]}function Ve(e){let t=[],r,o="";for(;e>0;)r=Math.floor(e%2),t.push(r),e=Math.floor(e/2);for(;t.length>0;)o+=t.pop().toString();return o}var z="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ze(e){let t="",r="";for(let n=0;n<e.length;n++)r+=e[n].charCodeAt(0).toString(2).padStart(8,"0");for(let n=0;n<r.length;n+=6)t+=z[Number.parseInt(r.slice(n,n+6).padEnd(6,"0"),2)];let o=t.length%4;return o!==0&&(t+="=".repeat(4-o)),t}function Xe(e){let t="",r="";for(let o=0;o<e.length&&e[o]!=="=";o++)r+=z.indexOf(e[o]).toString(2).padStart(6,"0");for(let o=0;o<r.length;o+=8){let n=Number.parseInt(r.slice(o,o+8),2);n&&(t+=String.fromCharCode(n))}return t}function Qe(...e){return e.reduce((t,r)=>function(...o){return r(t(...o))})}function Je(...e){return e.reduce((t,r)=>function(...o){return t(r(...o))})}function et(e,t=500){let r=null;return function(...o){r&&clearTimeout(r),r=setTimeout(()=>{e.apply(this,o)},t)}}function A(e){let t=new WeakMap;function r(n){if(!N(n))return n;if(t.has(n))return t.get(n);if(U(n)){let a=new Date(n);return t.set(n,a),a}if(W(n)){let a=new RegExp(n.source,n.flags);return t.set(n,a),a}if(G(n))return n;if(typeof Buffer<"u"&&Buffer.isBuffer(n)){let a=Buffer.allocUnsafe?Buffer.allocUnsafe(n.length):Buffer.from(n);return n.copy(a),t.set(n,a),a}if(n instanceof Error){let a=new n.constructor(n.message);return t.set(n,a),o(n,a),a}if(n instanceof Boolean||n instanceof Number||n instanceof String){let a=n.valueOf(),p=Object(a);return t.set(n,p),o(n,p),p}if(typeof Node<"u"&&n instanceof Node)return{};if(n instanceof WeakMap)return{};if(n instanceof WeakSet)return{};if(n instanceof ArrayBuffer)return n.slice(0);if(n instanceof DataView){let a=n.buffer.slice(0);return new DataView(a,n.byteOffset,n.byteLength)}if(ArrayBuffer.isView(n)){let a=n.constructor;return new a(n)}if(L(n)){let a=new Map;return t.set(n,a),n.forEach((p,c)=>a.set(r(c),r(p))),a}if(K(n)){let a=new Set;return t.set(n,a),n.forEach(p=>a.add(r(p))),a}let f=d(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));return t.set(n,f),o(n,f),ne(n,f),f}function o(n,f){let a=Object.getOwnPropertyDescriptors(n);for(let p of Reflect.ownKeys(a)){let c=a[p];c.get||c.set?Object.defineProperty(f,p,c):Object.defineProperty(f,p,{...c,value:r(c.value)})}}return r(e)}function ne(e,t){Object.isFrozen(e)?Object.freeze(t):Object.isSealed(e)?Object.seal(t):Object.isExtensible(e)||Object.preventExtensions(t)}function mt(e,t,r={}){return q(X(e,r),X(t,r),r)}function q(e,t,r){return d(e)?ie(e,t,r):oe(e,t,r)}function oe(e,t,r){if(!b(t))return t;let o=Object.getOwnPropertyDescriptors(t);return Reflect.ownKeys(t).forEach(n=>{(b(e[n])||d(e[n]))&&(b(t[n])||d(t[n]))?e[n]=q(e[n],t[n],r):Object.defineProperty(e,n,o[n])}),e}function ie(e,t,r){let{mergeStrategy:o="replace"}=r;if(d(t))switch(o){case"merge":return e.concat(t);case"replace":return t;default:return t}return t}function X(e,t){let{deepClone:r=!0}=t;return r?A(e):e}var $=class extends Error{constructor(t,r="Utils"){super(t),this.name=r}};function m(e,t){throw new $(`[${e}] ${t}`)}function ut(e,t){let r=R(e)?new $(`[${e}] ${t}`,"UtilsWarn"):e;console.warn(r)}var E=(e,t,...r)=>{if(!t)return;let o=r.length===0?"":r.length===1?r[0]:r;console[e](`[Log] ${t}:`,o)},M=(e,...t)=>{E("info",e,...t)};M.info=(e,...t)=>{E("info",e,...t)};M.warn=(e,...t)=>{E("warn",e,...t)};M.error=(e,...t)=>{E("error",e,...t)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=e=>E=e);var se={stringify:e=>(T(e)||m("stringify","Input must be an object"),new URLSearchParams(e).toString()),parse:e=>(R(e)||m("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(e).entries())),appendQueryString:(e,t)=>{let r=se.stringify(t);return e.includes("?")?e.endsWith("?")||e.endsWith("&")?`${e}${r}`:`${e}&${r}`:`${e}?${r}`}};function Rt(e,t=500){let r=null;return function(...o){if(V(r))return r=Date.now(),e.apply(this,o);let n=Date.now();if(n-r>=t)return r=n,e.apply(this,o)}}function Pt(e){ae(e);let{fn:t,maxAttempts:r=3,retryDelay:o=1e3,enableExponentialBackoff:n=!1,signal:f}=e,a,p=f?new Promise((k,O)=>{let I=()=>O(H());f.addEventListener("abort",I),a=()=>f.removeEventListener("abort",I)}):null;return new Promise((k,O)=>{(async()=>{for(let S=1;S<=r;S++){if(f?.aborted)return O(H());try{let w=await Promise.race(p?[t(),p]:[t()]);return k(w)}catch(w){let _=n?o*2**(S-1):o;if(M("withRetry",`Attempt ${S}/${r} failed. Retrying in ${_}ms...`),w instanceof Error&&w.name==="AbortError"||S===r)return O(w);await new Promise(te=>setTimeout(te,_))}}})()}).finally(()=>a?.())}function ae(e){b(e)||m("withRetry",'"Options" must be an object'),typeof e.fn!="function"&&m("withRetry",'"fn" must be a function that returns a Promise'),!j(e.maxAttempts)&&(!Number.isInteger(e.maxAttempts)||e.maxAttempts<1)&&m("withRetry",'"maxAttempts" must be a positive integer'),!j(e.retryDelay)&&(!u(e.retryDelay)||e.retryDelay<0)&&m("withRetry",'"retryDelay" must be a non-negative number'),!j(e.enableExponentialBackoff)&&!B(e.enableExponentialBackoff)&&m("withRetry",'"enableExponentialBackoff" must be a boolean'),!j(e.signal)&&typeof e.signal!="object"&&m("withRetry",'"signal" must be an AbortSignal')}var me="The operation was aborted";function H(e=me){let t=new Error(e);return t.name="AbortError",t}function Ht(e){T(e)||m("hasCircularReference",'"obj" must be a object');let t=new Set;function r(o){if(T(o)){if(t.has(o))return!0;t.add(o);for(let n of Object.keys(o))if(r(o[n]))return!0;t.delete(o)}return!1}return r(e)}function tr(e,t){if(!b(e))return{};let r=A(e),o=h(t);for(let n of o)Reflect.deleteProperty(r,n);return r}function ar(e,t,r={}){let{includeProto:o=!1,includeSymbols:n=!0,includeNonEnum:f=!1}=r,a={};return b(e)&&h(t).forEach(c=>{Y(c)&&!n||!(o?c in e:Object.hasOwn(e,c))||!f&&(o?fe(e,c):Object.getOwnPropertyDescriptor(e,c))?.enumerable===!1||(a[c]=A(e[c]))}),a}function fe(e,t){let r=e;for(;r!==null;){let o=Object.getOwnPropertyDescriptor(r,t);if(o)return o;r=Object.getPrototypeOf(r)}}function br(e){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(e)}function xr(e){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function yr(e){return/^(?:0|[1-9]\d*)\.\d+$/.test(e)}function hr(e){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(e)}function Or(e){return/^-(?:0|[1-9]\d*)\.\d+$/.test(e)}function Ar(e){return/^-?(?:0|[1-9]\d*)$/.test(e)}function Sr(e){return/^[1-9]\d*$/.test(e)}function Q(e){return/^(?:0|[1-9]\d*)$/.test(e)&&!Object.is(e,-0)}function Tr(e){return/^-[1-9]\d*$/.test(e)}function jr(e){return/^-(?:0|[1-9]\d*)$/.test(e)||Object.is(e,-0)}import ce from"dayjs";function J(e,t="YYYY-MM-DD HH:mm:ss"){return ce(e,t,!0).isValid()}function $r(e){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(e)}function Cr(e){return e===""}import Z from"dayjs";function Lr(e){if(!/^[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))return!1;let r=e.slice(6,14);return J(r,"YYYYMMDD")&&Z(r,"YYYYMMDD").isBefore(Z())}function Wr(e){return/^1[3-9]\d{9}$/.test(e)}var Xr=e=>{if(!R(e)||!/^-?\d+(?:\.\d+)?$/.test(e))return!1;let r=Number(e);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function Qr(e){return/^https?:\/\/\S+$/i.test(e)}function dn(e,t){return(!u(e)||!Q(e.toString()))&&m("generateRandomArray","num must be greater than 0"),P(t)||m("generateRandomArray","cb must be a function"),Array.from({length:e},()=>t())}function yn(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}import D from"dayjs";import le from"dayjs/plugin/customParseFormat.js";function l(e){return e[Math.floor(Math.random()*e.length)]}function g(e={}){u(e)&&(e={max:e});let{min:t=1,max:r=l(ue())}=e;pe(t,r);let o=Math.ceil(t),n=Math.floor(r);return Math.floor(Math.random()*(n-o+1)+o)}function pe(e,t){let r=Math.ceil(e),o=Math.floor(t);Number.isSafeInteger(r)||m("getRandomInt",`The minimum value Math.ceil(${e}) should be a safe integer`),Number.isSafeInteger(o)||m("getRandomInt",`The maximum value Math.floor(${t}) should be a safe integer`),o<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 ue(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((e,t)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,t+1);return Number(r)})}D.extend(le);function ee(e={}){let{start:t="1800-01-01 00:00:00",end:r=D().format(v),format:o=v}=e,n=D(t),f=D(r);(!n.isValid()||!f.isValid())&&m("generateRandomDate","start and end parameters must be valid date format"),n.isAfter(f)&&m("generateRandomDate","start date must be before end date");let a=n.valueOf(),p=f.valueOf(),c=g({min:a,max:p});return D(c).format(o)}var v="YYYY-MM-DD HH:mm:ss";function x(e={}){let t=de(e),r=be(t);xe(r);let{length:o}=t;ye(o.min,o.max);let n=g(o),f=t.prefix||"";for(let a=0;a<n;a++)f+=r.charAt(Math.floor(Math.random()*r.length));return f+(t.suffix||"")}var ge=16,C=1;function de(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:ge,min:C,...e.length},extra:t?[]:[...new Set(h(e.extra||[]))]}}function be(e){let t="";return e.lowerCase&&(t+="abcdefghijklmnopqrstuvwxyz"),e.upperCase&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),e.number&&(t+="0123456789"),t+=h(e.extra).join(""),t}function xe(e){e.length===0&&m("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function ye(e,t){Number.isInteger(e)||m("getRandomString","min must be an integer"),Number.isInteger(t)||m("getRandomString","max must be an integer"),e<C&&m("getRandomString",`Minimum length cannot be less than ${C}`),t<e&&m("getRandomString","Maximum length cannot be less than minimum length")}function Wn(){let e=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],t=g({min:5,max:10}),r=x({length:t,lowerCase:!0,upperCase:!1,number:!0}),o=l(e);return`${r}@${o}`}function qn(e={}){u(e)&&(e={max:e});let{min:t=0,max:r=1,fractionDigits:o=2}=e;if((!u(t)||!u(r))&&m("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(o)||o<0)&&m("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),t===r)return Number(t.toFixed(o));t>r&&m("generateRandomFloat",`"max" (${r}) must be greater than "min" (${t})`);let n=Math.random()*(r-t)+t;return Number(n.toFixed(o))}function F(e,t){(!u(e)||e<=0)&&m("generateRandomStringFromSource",'"num" must be greater than 0'),(!d(t)||t.length===0)&&m("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let o=0;o<e;o++)r+=l(t);return r}function io(){let e=g({min:1e5,max:999999}),t=[0,1,2,3,4,5,6,7,8,9];return[e,ee({format:"YYYYMMDD"}),F(3,t),F(1,[...t,"X","x"])].join("")}function co(){return l(["13","14","15","16","17","18","19"])+g(999999999).toString().padEnd(9,"0")}function xo(){let e=["http://","https://"],t=[".com",".net",".org",".cn",".top"],r=[`?name=${x({length:{min:4,max:8}})}`,`?id=${g()}`,`?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)}`}export{$ as UtilsError,Xe as base64Decode,ze as base64Encode,h as castArray,Qe as compose,Je as composeRight,et as debounce,ut as debugWarn,Ve as decimalToBinary,A as deepClone,mt as deepMerge,dn as generateRandomArray,yn as generateRandomColor,ee as generateRandomDate,Wn as generateRandomEmail,qn as generateRandomFloat,io as generateRandomIdCard,co as generateRandomMobilePhone,F as generateRandomStringFromSource,g as getRandomInt,l as getRandomItem,x as getRandomString,xo as getRandomUrl,Ee as hasChanged,Ht as hasCircularReference,d as isArray,B as isBoolean,U as isDate,J as isDateString,je as isDef,$r as isEmail,Cr as isEmptyString,br as isFloat,P as isFunction,Lr as isIdCard,Ar as isInteger,L as isMap,Wr as isMobilePhone,hr as isNegativeFloat,Tr as isNegativeInteger,V as isNil,yr as isNonNegativeFloat,Q as isNonNegativeInteger,Or as isNonPositiveFloat,jr as isNonPositiveInteger,Te as isNull,u as isNumber,T as isObject,N as isObjectLike,b as isPlainObject,xr as isPositiveFloat,Sr as isPositiveInteger,G as isPromise,W as isRegExp,K as isSet,R as isString,Xr as isStringNumber,Y as isSymbol,Qr as isURL,j as isUndef,M as log,re as objectToString,tr as omit,ar as pick,se as qs,Rt as throttle,m as throwError,y as toTypeString,Se as toTypeValue,Pt as withRetry};
|
package/dist/utils.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var lntvowUtils=(()=>{var ee=Object.create;var ht=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Kt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),se=(t,e)=>{for(var r in e)ht(t,r,{get:e[r],enumerable:!0})},Wt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ne(e))!ie.call(t,i)&&i!==r&&ht(t,i,{get:()=>e[i],enumerable:!(n=re(e,i))||n.enumerable});return t};var bt=(t,e,r)=>(r=t!=null?ee(oe(t)):{},Wt(e||!t||!t.__esModule?ht(r,"default",{value:t,enumerable:!0}):r,t)),ae=t=>Wt(ht({},"__esModule",{value:!0}),t);var xt=Kt((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=e()})(Pt,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",x="minute",d="hour",O="day",h="week",E="month",L="quarter",Y="year",P="date",k="Invalid Date",c=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={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(u){var s=["th","st","nd","rd"],o=u%100;return"["+u+(s[(o-20)%10]||s[o]||s[0])+"]"}},D=function(u,s,o){var f=String(u);return!f||f.length>=s?u:""+Array(s+1-f.length).join(o)+u},$={s:D,z:function(u){var s=-u.utcOffset(),o=Math.abs(s),f=Math.floor(o/60),a=o%60;return(s<=0?"+":"-")+D(f,2,"0")+":"+D(a,2,"0")},m:function u(s,o){if(s.date()<o.date())return-u(o,s);var f=12*(o.year()-s.year())+(o.month()-s.month()),a=s.clone().add(f,E),l=o-a<0,p=s.clone().add(f+(l?-1:1),E);return+(-(f+(o-a)/(l?a-p:p-a))||0)},a:function(u){return u<0?Math.ceil(u)||0:Math.floor(u)},p:function(u){return{M:E,y:Y,w:h,d:O,D:P,h:d,m:x,s:i,ms:n,Q:L}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(u){return u===void 0}},w="en",R={};R[w]=M;var I="$isDayjsObject",j=function(u){return u instanceof F||!(!u||!u[I])},U=function u(s,o,f){var a;if(!s)return w;if(typeof s=="string"){var l=s.toLowerCase();R[l]&&(a=l),o&&(R[l]=o,a=l);var p=s.split("-");if(!a&&p.length>1)return u(p[0])}else{var g=s.name;R[g]=s,a=g}return!f&&a&&(w=a),a||!f&&w},S=function(u,s){if(j(u))return u.clone();var o=typeof s=="object"?s:{};return o.date=u,o.args=arguments,new F(o)},b=$;b.l=U,b.i=j,b.w=function(u,s){return S(u,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var F=function(){function u(o){this.$L=U(o.locale,null,!0),this.parse(o),this.$x=this.$x||o.x||{},this[I]=!0}var s=u.prototype;return s.parse=function(o){this.$d=function(f){var a=f.date,l=f.utc;if(a===null)return new Date(NaN);if(b.u(a))return new Date;if(a instanceof Date)return new Date(a);if(typeof a=="string"&&!/Z$/i.test(a)){var p=a.match(c);if(p){var g=p[2]-1||0,A=(p[7]||"0").substring(0,3);return l?new Date(Date.UTC(p[1],g,p[3]||1,p[4]||0,p[5]||0,p[6]||0,A)):new Date(p[1],g,p[3]||1,p[4]||0,p[5]||0,p[6]||0,A)}}return new Date(a)}(o),this.init()},s.init=function(){var o=this.$d;this.$y=o.getFullYear(),this.$M=o.getMonth(),this.$D=o.getDate(),this.$W=o.getDay(),this.$H=o.getHours(),this.$m=o.getMinutes(),this.$s=o.getSeconds(),this.$ms=o.getMilliseconds()},s.$utils=function(){return b},s.isValid=function(){return this.$d.toString()!==k},s.isSame=function(o,f){var a=S(o);return this.startOf(f)<=a&&a<=this.endOf(f)},s.isAfter=function(o,f){return S(o)<this.startOf(f)},s.isBefore=function(o,f){return this.endOf(f)<S(o)},s.$g=function(o,f,a){return b.u(o)?this[f]:this.set(a,o)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(o,f){var a=this,l=!!b.u(f)||f,p=b.p(o),g=function(Q,_){var G=b.w(a.$u?Date.UTC(a.$y,_,Q):new Date(a.$y,_,Q),a);return l?G:G.endOf(O)},A=function(Q,_){return b.w(a.toDate()[Q].apply(a.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(_)),a)},T=this.$W,N=this.$M,W=this.$D,rt="set"+(this.$u?"UTC":"");switch(p){case Y:return l?g(1,0):g(31,11);case E:return l?g(1,N):g(0,N+1);case h:var q=this.$locale().weekStart||0,st=(T<q?T+7:T)-q;return g(l?W-st:W+(6-st),N);case O:case P:return A(rt+"Hours",0);case d:return A(rt+"Minutes",1);case x:return A(rt+"Seconds",2);case i:return A(rt+"Milliseconds",3);default:return this.clone()}},s.endOf=function(o){return this.startOf(o,!1)},s.$set=function(o,f){var a,l=b.p(o),p="set"+(this.$u?"UTC":""),g=(a={},a[O]=p+"Date",a[P]=p+"Date",a[E]=p+"Month",a[Y]=p+"FullYear",a[d]=p+"Hours",a[x]=p+"Minutes",a[i]=p+"Seconds",a[n]=p+"Milliseconds",a)[l],A=l===O?this.$D+(f-this.$W):f;if(l===E||l===Y){var T=this.clone().set(P,1);T.$d[g](A),T.init(),this.$d=T.set(P,Math.min(this.$D,T.daysInMonth())).$d}else g&&this.$d[g](A);return this.init(),this},s.set=function(o,f){return this.clone().$set(o,f)},s.get=function(o){return this[b.p(o)]()},s.add=function(o,f){var a,l=this;o=Number(o);var p=b.p(f),g=function(N){var W=S(l);return b.w(W.date(W.date()+Math.round(N*o)),l)};if(p===E)return this.set(E,this.$M+o);if(p===Y)return this.set(Y,this.$y+o);if(p===O)return g(1);if(p===h)return g(7);var A=(a={},a[x]=e,a[d]=r,a[i]=t,a)[p]||1,T=this.$d.getTime()+o*A;return b.w(T,this)},s.subtract=function(o,f){return this.add(-1*o,f)},s.format=function(o){var f=this,a=this.$locale();if(!this.isValid())return a.invalidDate||k;var l=o||"YYYY-MM-DDTHH:mm:ssZ",p=b.z(this),g=this.$H,A=this.$m,T=this.$M,N=a.weekdays,W=a.months,rt=a.meridiem,q=function(_,G,J,nt){return _&&(_[G]||_(f,l))||J[G].slice(0,nt)},st=function(_){return b.s(g%12||12,_,"0")},Q=rt||function(_,G,J){var nt=_<12?"AM":"PM";return J?nt.toLowerCase():nt};return l.replace(y,function(_,G){return G||function(J){switch(J){case"YY":return String(f.$y).slice(-2);case"YYYY":return b.s(f.$y,4,"0");case"M":return T+1;case"MM":return b.s(T+1,2,"0");case"MMM":return q(a.monthsShort,T,W,3);case"MMMM":return q(W,T);case"D":return f.$D;case"DD":return b.s(f.$D,2,"0");case"d":return String(f.$W);case"dd":return q(a.weekdaysMin,f.$W,N,2);case"ddd":return q(a.weekdaysShort,f.$W,N,3);case"dddd":return N[f.$W];case"H":return String(g);case"HH":return b.s(g,2,"0");case"h":return st(1);case"hh":return st(2);case"a":return Q(g,A,!0);case"A":return Q(g,A,!1);case"m":return String(A);case"mm":return b.s(A,2,"0");case"s":return String(f.$s);case"ss":return b.s(f.$s,2,"0");case"SSS":return b.s(f.$ms,3,"0");case"Z":return p}return null}(_)||p.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(o,f,a){var l,p=this,g=b.p(f),A=S(o),T=(A.utcOffset()-this.utcOffset())*e,N=this-A,W=function(){return b.m(p,A)};switch(g){case Y:l=W()/12;break;case E:l=W();break;case L:l=W()/3;break;case h:l=(N-T)/6048e5;break;case O:l=(N-T)/864e5;break;case d:l=N/r;break;case x:l=N/e;break;case i:l=N/t;break;default:l=N}return a?l:b.a(l)},s.daysInMonth=function(){return this.endOf(E).$D},s.$locale=function(){return R[this.$L]},s.locale=function(o,f){if(!o)return this.$L;var a=this.clone(),l=U(o,f,!0);return l&&(a.$L=l),a},s.clone=function(){return b.w(this.$d,this)},s.toDate=function(){return new Date(this.valueOf())},s.toJSON=function(){return this.isValid()?this.toISOString():null},s.toISOString=function(){return this.$d.toISOString()},s.toString=function(){return this.$d.toUTCString()},u}(),K=F.prototype;return S.prototype=K,[["$ms",n],["$s",i],["$m",x],["$H",d],["$W",O],["$M",E],["$y",Y],["$D",P]].forEach(function(u){K[u[1]]=function(s){return this.$g(s,u[0],u[1])}}),S.extend=function(u,s){return u.$i||(u(s,F,S),u.$i=!0),S},S.locale=U,S.isDayjs=j,S.unix=function(u){return S(1e3*u)},S.en=R[w],S.Ls=R,S.p={},S})});var qt=Kt((Lt,Ft)=>{"use strict";(function(t,e){typeof Lt=="object"&&typeof Ft<"u"?Ft.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(Lt,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,r=/\d/,n=/\d\d/,i=/\d\d?/,x=/\d*[^-_:/,()\s\d]+/,d={},O=function(c){return(c=+c)+(c>68?1900:2e3)},h=function(c){return function(y){this[c]=+y}},E=[/[+-]\d\d:?(\d\d)?|Z/,function(c){(this.zone||(this.zone={})).offset=function(y){if(!y||y==="Z")return 0;var M=y.match(/([+-]|\d\d)/g),D=60*M[1]+(+M[2]||0);return D===0?0:M[0]==="+"?-D:D}(c)}],L=function(c){var y=d[c];return y&&(y.indexOf?y:y.s.concat(y.f))},Y=function(c,y){var M,D=d.meridiem;if(D){for(var $=1;$<=24;$+=1)if(c.indexOf(D($,0,y))>-1){M=$>12;break}}else M=c===(y?"pm":"PM");return M},P={A:[x,function(c){this.afternoon=Y(c,!1)}],a:[x,function(c){this.afternoon=Y(c,!0)}],Q:[r,function(c){this.month=3*(c-1)+1}],S:[r,function(c){this.milliseconds=100*+c}],SS:[n,function(c){this.milliseconds=10*+c}],SSS:[/\d{3}/,function(c){this.milliseconds=+c}],s:[i,h("seconds")],ss:[i,h("seconds")],m:[i,h("minutes")],mm:[i,h("minutes")],H:[i,h("hours")],h:[i,h("hours")],HH:[i,h("hours")],hh:[i,h("hours")],D:[i,h("day")],DD:[n,h("day")],Do:[x,function(c){var y=d.ordinal,M=c.match(/\d+/);if(this.day=M[0],y)for(var D=1;D<=31;D+=1)y(D).replace(/\[|\]/g,"")===c&&(this.day=D)}],w:[i,h("week")],ww:[n,h("week")],M:[i,h("month")],MM:[n,h("month")],MMM:[x,function(c){var y=L("months"),M=(L("monthsShort")||y.map(function(D){return D.slice(0,3)})).indexOf(c)+1;if(M<1)throw new Error;this.month=M%12||M}],MMMM:[x,function(c){var y=L("months").indexOf(c)+1;if(y<1)throw new Error;this.month=y%12||y}],Y:[/[+-]?\d+/,h("year")],YY:[n,function(c){this.year=O(c)}],YYYY:[/\d{4}/,h("year")],Z:E,ZZ:E};function k(c){var y,M;y=c,M=d&&d.formats;for(var D=(c=y.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(S,b,F){var K=F&&F.toUpperCase();return b||M[F]||t[F]||M[K].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(u,s,o){return s||o.slice(1)})})).match(e),$=D.length,w=0;w<$;w+=1){var R=D[w],I=P[R],j=I&&I[0],U=I&&I[1];D[w]=U?{regex:j,parser:U}:R.replace(/^\[|\]$/g,"")}return function(S){for(var b={},F=0,K=0;F<$;F+=1){var u=D[F];if(typeof u=="string")K+=u.length;else{var s=u.regex,o=u.parser,f=S.slice(K),a=s.exec(f)[0];o.call(b,a),S=S.replace(a,"")}}return function(l){var p=l.afternoon;if(p!==void 0){var g=l.hours;p?g<12&&(l.hours+=12):g===12&&(l.hours=0),delete l.afternoon}}(b),b}}return function(c,y,M){M.p.customParseFormat=!0,c&&c.parseTwoDigitYear&&(O=c.parseTwoDigitYear);var D=y.prototype,$=D.parse;D.parse=function(w){var R=w.date,I=w.utc,j=w.args;this.$u=I;var U=j[1];if(typeof U=="string"){var S=j[2]===!0,b=j[3]===!0,F=S||b,K=j[2];b&&(K=j[2]),d=this.$locale(),!S&&K&&(d=M.Ls[K]),this.$d=function(f,a,l,p){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*f);var g=k(a)(f),A=g.year,T=g.month,N=g.day,W=g.hours,rt=g.minutes,q=g.seconds,st=g.milliseconds,Q=g.zone,_=g.week,G=new Date,J=N||(A||T?1:G.getDate()),nt=A||G.getFullYear(),dt=0;A&&!T||(dt=T>0?T-1:G.getMonth());var gt,wt=W||0,Ot=rt||0,Mt=q||0,Dt=st||0;return Q?new Date(Date.UTC(nt,dt,J,wt,Ot,Mt,Dt+60*Q.offset*1e3)):l?new Date(Date.UTC(nt,dt,J,wt,Ot,Mt,Dt)):(gt=new Date(nt,dt,J,wt,Ot,Mt,Dt),_&&(gt=p(gt).week(_).toDate()),gt)}catch{return new Date("")}}(R,U,I,M),this.init(),K&&K!==!0&&(this.$L=this.locale(K).$L),F&&R!=this.format(U)&&(this.$d=new Date("")),d={}}else if(U instanceof Array)for(var u=U.length,s=1;s<=u;s+=1){j[1]=U[s-1];var o=M.apply(this,j);if(o.isValid()){this.$d=o.$d,this.$L=o.$L,this.init();break}s===u&&(this.$d=new Date(""))}else $.call(this,w)}}})});var or={};se(or,{UtilsError:()=>lt,base64Decode:()=>pe,base64Encode:()=>le,castArray:()=>it,compose:()=>de,composeRight:()=>ge,debounce:()=>he,debugWarn:()=>$e,decimalToBinary:()=>me,deepClone:()=>at,deepMerge:()=>be,generateRandomArray:()=>We,generateRandomColor:()=>Ve,generateRandomDate:()=>Ht,generateRandomEmail:()=>Je,generateRandomFloat:()=>tr,generateRandomIdCard:()=>er,generateRandomMobilePhone:()=>rr,generateRandomStringFromSource:()=>$t,getRandomInt:()=>Z,getRandomItem:()=>B,getRandomString:()=>X,getRandomUrl:()=>nr,hasChanged:()=>ce,hasCircularReference:()=>kt,isArray:()=>H,isBoolean:()=>V,isDate:()=>Rt,isDateString:()=>_t,isDef:()=>ue,isEmail:()=>Ce,isEmptyString:()=>Le,isFloat:()=>je,isFunction:()=>mt,isIdCard:()=>Fe,isInteger:()=>Ye,isMap:()=>At,isMobilePhone:()=>He,isNegativeFloat:()=>ke,isNegativeInteger:()=>Ie,isNil:()=>vt,isNonNegativeFloat:()=>ve,isNonNegativeInteger:()=>Yt,isNonPositiveFloat:()=>Ne,isNonPositiveInteger:()=>_e,isNull:()=>yt,isNumber:()=>C,isObject:()=>tt,isObjectLike:()=>ct,isPlainObject:()=>z,isPositiveFloat:()=>Ee,isPositiveInteger:()=>Pe,isPromise:()=>Et,isRegExp:()=>jt,isSet:()=>Tt,isString:()=>et,isStringNumber:()=>Ue,isSymbol:()=>St,isURL:()=>Ke,isUndef:()=>v,log:()=>ft,objectToString:()=>Vt,omit:()=>Re,pick:()=>Nt,qs:()=>Gt,qsStringify:()=>we,throttle:()=>Me,throwError:()=>m,toTypeString:()=>ot,toTypeValue:()=>fe,withRetry:()=>De});function tt(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ct(t){return t!==null&&typeof t=="object"}var Vt=Object.prototype.toString,ot=t=>Vt.call(t),fe=t=>ot(t).slice(8,-1),et=t=>typeof t=="string",C=t=>typeof t=="number"&&Number.isFinite(t),V=t=>typeof t=="boolean",yt=t=>t===null,v=t=>t===void 0,St=t=>typeof t=="symbol",H=Array.isArray,mt=t=>typeof t=="function",At=t=>ot(t)==="[object Map]",Tt=t=>ot(t)==="[object Set]",Rt=t=>ot(t)==="[object Date]",jt=t=>ot(t)==="[object RegExp]",Et=t=>ct(t)&&mt(t?.then)&&mt(t?.catch),vt=t=>t==null,ue=t=>t!=null,ce=(t,e)=>t!==e;function z(t){return ot(t)==="[object Object]"}function it(t){return H(t)?t:[t]}function me(t){let e=[],r,n="";for(;t>0;)r=Math.floor(t%2),e.push(r),t=Math.floor(t/2);for(;e.length>0;)n+=e.pop().toString();return n}var zt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function le(t){let e="",r="";for(let i=0;i<t.length;i++)r+=t[i].charCodeAt(0).toString(2).padStart(8,"0");for(let i=0;i<r.length;i+=6)e+=zt[Number.parseInt(r.slice(i,i+6).padEnd(6,"0"),2)];let n=e.length%4;return n!==0&&(e+="=".repeat(4-n)),e}function pe(t){let e="",r="";for(let n=0;n<t.length&&t[n]!=="=";n++)r+=zt.indexOf(t[n]).toString(2).padStart(6,"0");for(let n=0;n<r.length;n+=8){let i=Number.parseInt(r.slice(n,n+8),2);i&&(e+=String.fromCharCode(i))}return e}function de(...t){return t.reduce((e,r)=>function(...n){return r(e(...n))})}function ge(...t){return t.reduce((e,r)=>function(...n){return e(r(...n))})}function he(t,e=500){let r=null;return function(...n){r&&clearTimeout(r),r=setTimeout(()=>{t.apply(this,n)},e)}}function at(t){let e=new WeakMap;function r(n){if(!ct(n))return n;if(Rt(n))return new Date(n);if(jt(n))return new RegExp(n);if(Et(n))return n;if(e.has(n))return e.get(n);if(At(n)){let d=new Map;return e.set(n,d),n.forEach((O,h)=>d.set(r(h),r(O))),d}if(Tt(n)){let d=new Set;return e.set(n,d),n.forEach(O=>d.add(r(O))),d}let i=H(n)?Object.setPrototypeOf([],Object.getPrototypeOf(n)):Object.create(Object.getPrototypeOf(n));e.set(n,i);let x=Object.getOwnPropertyDescriptors(n);for(let d of Reflect.ownKeys(x)){let O=x[d];O.get||O.set?Object.defineProperty(i,d,O):Object.defineProperty(i,d,{...O,value:r(O.value)})}return i}return r(t)}function be(t,e,r={}){return Zt(Bt(t,r),Bt(e,r),r)}function Zt(t,e,r){return H(t)?xe(t,e,r):ye(t,e,r)}function ye(t,e,r){if(!z(e))return e;let n=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(i=>{(z(t[i])||H(t[i]))&&(z(e[i])||H(e[i]))?t[i]=Zt(t[i],e[i],r):Object.defineProperty(t,i,n[i])}),t}function xe(t,e,r){let{mergeStrategy:n="replace"}=r;if(H(e))switch(n){case"merge":return t.concat(e);case"replace":return e;default:return e}return e}function Bt(t,e){let{deepClone:r=!0}=e;return r?at(t):t}var lt=class extends Error{constructor(e,r="Utils"){super(e),this.name=r}};function m(t,e){throw new lt(`[${t}] ${e}`)}function $e(t,e){let r=et(t)?new lt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(r)}var pt=(t,e,...r)=>{if(!e)return;let n=r.length===0?"":r.length===1?r[0]:r;console[t](`[Log] ${e}:`,n)},ft=(t,...e)=>{pt("info",t,...e)};ft.info=(t,...e)=>{pt("info",t,...e)};ft.warn=(t,...e)=>{pt("warn",t,...e)};ft.error=(t,...e)=>{pt("error",t,...e)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=t=>pt=t);function we(t,e={}){Oe(e);let{encode:r=!0,encodeValuesOnly:n=!1,arrayFormat:i="indices",encodeDotInKeys:x=!1,skipNulls:d=!1,strictNullHandling:O=!1,commaRoundTrip:h=!1,allowEmptyArrays:E=!1,addQueryPrefix:L=!1,delimiter:Y="&"}=e,P=e.allowDots??!1;x&&v(e.allowDots)&&(P=!0);let k=[],c=$=>r&&!n?encodeURIComponent($):$,y=$=>r?encodeURIComponent($):$;function M($,w){if(!v(w)){if(yt(w)){if(d)return;k.push(`${c($)}${O?"":"="}`);return}if(H(w)){if(w.length===0){E&&k.push(`${c($)}[]`);return}if(i==="comma"){let R=n?w.map(y).join(","):y(w.join(","));if(w.length===1&&yt(w[0])){if(d)return;k.push(`${c($)}${h?"[]":""}${O?"":"="}`)}else w.length===1?k.push(`${c($)}${h?"[]":""}=${R}`):k.push(`${c($)}=${R}`);return}w.forEach((R,I)=>{let j=$;i==="indices"?j=`${$}[${I}]`:i==="brackets"&&(j=`${$}[]`),M(j,R)});return}if(tt(w)){Object.keys(w).forEach(R=>{let I=$;x&&(I=I.replace(/\./g,"%2E"));let j=R;P?(x&&(j=j.replace(/\./g,"%2E")),M(`${I}.${j}`,w[R])):M(`${I}[${j}]`,w[R])});return}k.push(`${c($)}=${y(w)}`)}}if(!tt(t))return"";kt(t)&&m("stringify","Input object contains circular references, cannot stringify"),H(t)?t.forEach(($,w)=>M(`${w}`,$)):Object.keys(t).forEach($=>M($,t[$]));let D=k.join(Y);return L&&D?`?${D}`:D}function Oe(t={}){z(t)||m("stringify",'"options" must be a plain object'),!v(t.encode)&&!V(t.encode)&&m("stringify",'"encode" must be a boolean'),!v(t.encodeValuesOnly)&&!V(t.encodeValuesOnly)&&m("stringify",'"encodeValuesOnly" must be a boolean'),!v(t.arrayFormat)&&!["indices","brackets","repeat","comma"].includes(t.arrayFormat)&&m("stringify",'"arrayFormat" must be one of: "indices", "brackets", "repeat", "comma"'),!v(t.allowDots)&&!V(t.allowDots)&&m("stringify",'"allowDots" must be a boolean'),!v(t.skipNulls)&&!V(t.skipNulls)&&m("stringify",'"skipNulls" must be a boolean'),!v(t.strictNullHandling)&&!V(t.strictNullHandling)&&m("stringify",'"strictNullHandling" must be a boolean'),!v(t.addQueryPrefix)&&!V(t.addQueryPrefix)&&m("stringify",'"addQueryPrefix" must be a boolean'),!v(t.delimiter)&&!et(t.delimiter)&&m("stringify",'"delimiter" must be a string'),!v(t.encodeDotInKeys)&&!V(t.encodeDotInKeys)&&m("stringify",'"encodeDotInKeys" must be a boolean'),!v(t.commaRoundTrip)&&!V(t.commaRoundTrip)&&m("stringify",'"commaRoundTrip" must be a boolean'),!v(t.allowEmptyArrays)&&!V(t.allowEmptyArrays)&&m("stringify",'"allowEmptyArrays" must be a boolean')}var Gt={stringify:t=>(tt(t)||m("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(et(t)||m("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let r=Gt.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${r}`:`${t}&${r}`:`${t}?${r}`}};function Me(t,e=500){let r=null;return function(...n){if(vt(r))return r=Date.now(),t.apply(this,n);let i=Date.now();if(i-r>=e)return r=i,t.apply(this,n)}}function De(t){Se(t);let{fn:e,maxAttempts:r=3,retryDelay:n=1e3,enableExponentialBackoff:i=!1,signal:x}=t,d,O=x?new Promise((E,L)=>{let Y=()=>L(Qt());x.addEventListener("abort",Y),d=()=>x.removeEventListener("abort",Y)}):null;return new Promise((E,L)=>{(async()=>{for(let P=1;P<=r;P++){if(x?.aborted)return L(Qt());try{let k=await Promise.race(O?[e(),O]:[e()]);return E(k)}catch(k){let c=i?n*2**(P-1):n;if(ft("withRetry",`Attempt ${P}/${r} failed. Retrying in ${c}ms...`),k instanceof Error&&k.name==="AbortError"||P===r)return L(k);await new Promise(y=>setTimeout(y,c))}}})()}).finally(()=>d?.())}function Se(t){z(t)||m("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&m("withRetry",'"fn" must be a function that returns a Promise'),!v(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&m("withRetry",'"maxAttempts" must be a positive integer'),!v(t.retryDelay)&&(!C(t.retryDelay)||t.retryDelay<0)&&m("withRetry",'"retryDelay" must be a non-negative number'),!v(t.enableExponentialBackoff)&&!V(t.enableExponentialBackoff)&&m("withRetry",'"enableExponentialBackoff" must be a boolean'),!v(t.signal)&&typeof t.signal!="object"&&m("withRetry",'"signal" must be an AbortSignal')}var Ae="The operation was aborted";function Qt(t=Ae){let e=new Error(t);return e.name="AbortError",e}function kt(t){tt(t)||m("hasCircularReference",'"obj" must be a object');let e=new Set;function r(n){if(tt(n)){if(e.has(n))return!0;e.add(n);for(let i of Object.keys(n))if(r(n[i]))return!0;e.delete(n)}return!1}return r(t)}function Nt(t,e,r={}){let{includeProto:n=!1,includeSymbols:i=!0,includeNonEnum:x=!1}=r,d={};return z(t)&&it(e).forEach(h=>{St(h)&&!i||!(n?h in t:Object.hasOwn(t,h))||!x&&(n?Te(t,h):Object.getOwnPropertyDescriptor(t,h))?.enumerable===!1||(d[h]=at(t[h]))}),d}function Te(t,e){let r=t;for(;r!==null;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Re(t,e){if(!z(t))return{};let r=at(t),n=it(e),i=Object.keys(r).filter(x=>!n.includes(x));return Nt(r,i)}function je(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ee(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function ve(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ke(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Ne(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function Ye(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Pe(t){return/^[1-9]\d*$/.test(t)}function Yt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Ie(t){return/^-[1-9]\d*$/.test(t)}function _e(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var Xt=bt(xt(),1);function _t(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Xt.default)(t,e,!0).isValid()}function Ce(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function Le(t){return t===""}var Ct=bt(xt(),1);function Fe(t){if(!/^[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))return!1;let r=t.slice(6,14);return _t(r,"YYYYMMDD")&&(0,Ct.default)(r,"YYYYMMDD").isBefore((0,Ct.default)())}function He(t){return/^1[3-9]\d{9}$/.test(t)}var Ue=t=>{if(!et(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let r=Number(t);return!(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)};function Ke(t){return/^https?:\/\/\S+$/i.test(t)}function We(t,e){return(!C(t)||!Yt(t.toString()))&&m("generateRandomArray","num must be greater than 0"),mt(e)||m("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}function Ve(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var ut=bt(xt(),1),te=bt(qt(),1);function B(t){return t[Math.floor(Math.random()*t.length)]}function Z(t={}){C(t)&&(t={max:t});let{min:e=1,max:r=B(Be())}=t;ze(e,r);let n=Math.ceil(e),i=Math.floor(r);return Math.floor(Math.random()*(i-n+1)+n)}function ze(t,e){let r=Math.ceil(t),n=Math.floor(e);Number.isSafeInteger(r)||m("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(n)||m("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),n<r&&(e>=t&&m("getRandomInt",`No integer value found between ${t} and ${e}`),m("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Be(){return Array.from({length:Number.MAX_SAFE_INTEGER.toString().length}).map((t,e)=>{let r=Number.MAX_SAFE_INTEGER.toString().slice(0,e+1);return Number(r)})}ut.default.extend(te.default);function Ht(t={}){let{start:e="1800-01-01 00:00:00",end:r=(0,ut.default)().format(Jt),format:n=Jt}=t,i=(0,ut.default)(e),x=(0,ut.default)(r);(!i.isValid()||!x.isValid())&&m("generateRandomDate","start and end parameters must be valid date format"),i.isAfter(x)&&m("generateRandomDate","start date must be before end date");let d=i.valueOf(),O=x.valueOf(),h=Z({min:d,max:O});return(0,ut.default)(h).format(n)}var Jt="YYYY-MM-DD HH:mm:ss";function X(t={}){let e=Ge(t),r=Qe(e);Xe(r);let{length:n}=e;qe(n.min,n.max);let i=Z(n),x=e.prefix||"";for(let d=0;d<i;d++)x+=r.charAt(Math.floor(Math.random()*r.length));return x+(e.suffix||"")}var Ze=16,Ut=1;function Ge(t){let e=C(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:C(t.length)?{max:t.length,min:t.length}:{max:Ze,min:Ut,...t.length},extra:e?[]:[...new Set(it(t.extra||[]))]}}function Qe(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=it(t.extra).join(""),e}function Xe(t){t.length===0&&m("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function qe(t,e){Number.isInteger(t)||m("getRandomString","min must be an integer"),Number.isInteger(e)||m("getRandomString","max must be an integer"),t<Ut&&m("getRandomString",`Minimum length cannot be less than ${Ut}`),e<t&&m("getRandomString","Maximum length cannot be less than minimum length")}function Je(){let t=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],e=Z({min:5,max:10}),r=X({length:e,lowerCase:!0,upperCase:!1,number:!0}),n=B(t);return`${r}@${n}`}function tr(t={}){C(t)&&(t={max:t});let{min:e=0,max:r=1,fractionDigits:n=2}=t;if((!C(e)||!C(r))&&m("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(n)||n<0)&&m("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),e===r)return Number(e.toFixed(n));e>r&&m("generateRandomFloat",`"max" (${r}) must be greater than "min" (${e})`);let i=Math.random()*(r-e)+e;return Number(i.toFixed(n))}function $t(t,e){(!C(t)||t<=0)&&m("generateRandomStringFromSource",'"num" must be greater than 0'),(!H(e)||e.length===0)&&m("generateRandomStringFromSource",'"source" must be a non-empty array');let r="";for(let n=0;n<t;n++)r+=B(e);return r}function er(){let t=Z({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,Ht({format:"YYYYMMDD"}),$t(3,e),$t(1,[...e,"X","x"])].join("")}function rr(){return B(["13","14","15","16","17","18","19"])+Z(999999999).toString().padEnd(9,"0")}function nr(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],r=[`?name=${X({length:{min:4,max:8}})}`,`?id=${Z()}`,`?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`${B(t)}${X({length:{min:5,max:25}})}${B(e)}${B(r)}`}return ae(or);})();
|
|
1
|
+
"use strict";var lntvowUtils=(()=>{var Jt=Object.create;var ht=Object.defineProperty;var Qt=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var Ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ne=(t,e)=>{for(var n in e)ht(t,n,{get:e[n],enumerable:!0})},Bt=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of te(e))!re.call(t,r)&&r!==n&&ht(t,r,{get:()=>e[r],enumerable:!(o=Qt(e,r))||o.enumerable});return t};var gt=(t,e,n)=>(n=t!=null?Jt(ee(t)):{},Bt(e||!t||!t.__esModule?ht(n,"default",{value:t,enumerable:!0}):n,t)),oe=t=>Bt(ht({},"__esModule",{value:!0}),t);var bt=Ft((Yt,vt)=>{"use strict";(function(t,e){typeof Yt=="object"&&typeof vt<"u"?vt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(Yt,function(){"use strict";var t=1e3,e=6e4,n=36e5,o="millisecond",r="second",y="minute",f="hour",w="day",l="week",T="month",_="quarter",E="year",v="date",U="Invalid Date",d=/^(\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])+"]"}},M=function(c,s,i){var u=String(c);return!u||u.length>=s?c:""+Array(s+1-u.length).join(i)+c},z={s:M,z:function(c){var s=-c.utcOffset(),i=Math.abs(s),u=Math.floor(i/60),a=i%60;return(s<=0?"+":"-")+M(u,2,"0")+":"+M(a,2,"0")},m:function c(s,i){if(s.date()<i.date())return-c(i,s);var u=12*(i.year()-s.year())+(i.month()-s.month()),a=s.clone().add(u,T),m=i-a<0,p=s.clone().add(u+(m?-1:1),T);return+(-(u+(i-a)/(m?a-p:p-a))||0)},a:function(c){return c<0?Math.ceil(c)||0:Math.floor(c)},p:function(c){return{M:T,y:E,w:l,d:w,D:v,h:f,m:y,s:r,ms:o,Q:_}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(c){return c===void 0}},k="en",L={};L[k]=S;var K="$isDayjsObject",C=function(c){return c instanceof Y||!(!c||!c[K])},N=function c(s,i,u){var a;if(!s)return k;if(typeof s=="string"){var m=s.toLowerCase();L[m]&&(a=m),i&&(L[m]=i,a=m);var p=s.split("-");if(!a&&p.length>1)return c(p[0])}else{var h=s.name;L[h]=s,a=h}return!u&&a&&(k=a),a||!u&&k},$=function(c,s){if(C(c))return c.clone();var i=typeof s=="object"?s:{};return i.date=c,i.args=arguments,new Y(i)},g=z;g.l=N,g.i=C,g.w=function(c,s){return $(c,{locale:s.$L,utc:s.$u,x:s.$x,$offset:s.$offset})};var Y=function(){function c(i){this.$L=N(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,m=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 p=a.match(d);if(p){var h=p[2]-1||0,O=(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,O)):new Date(p[1],h,p[3]||1,p[4]||0,p[5]||0,p[6]||0,O)}}return new Date(a)}(i),this.init()},s.init=function(){var i=this.$d;this.$y=i.getFullYear(),this.$M=i.getMonth(),this.$D=i.getDate(),this.$W=i.getDay(),this.$H=i.getHours(),this.$m=i.getMinutes(),this.$s=i.getSeconds(),this.$ms=i.getMilliseconds()},s.$utils=function(){return g},s.isValid=function(){return this.$d.toString()!==U},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 g.u(i)?this[u]:this.set(a,i)},s.unix=function(){return Math.floor(this.valueOf()/1e3)},s.valueOf=function(){return this.$d.getTime()},s.startOf=function(i,u){var a=this,m=!!g.u(u)||u,p=g.p(i),h=function(Z,j){var H=g.w(a.$u?Date.UTC(a.$y,j,Z):new Date(a.$y,j,Z),a);return m?H:H.endOf(w)},O=function(Z,j){return g.w(a.toDate()[Z].apply(a.toDate("s"),(m?[0,0,0,0]:[23,59,59,999]).slice(j)),a)},D=this.$W,A=this.$M,I=this.$D,J="set"+(this.$u?"UTC":"");switch(p){case E:return m?h(1,0):h(31,11);case T:return m?h(1,A):h(0,A+1);case l:var X=this.$locale().weekStart||0,rt=(D<X?D+7:D)-X;return h(m?I-rt:I+(6-rt),A);case w:case v:return O(J+"Hours",0);case f:return O(J+"Minutes",1);case y:return O(J+"Seconds",2);case r:return O(J+"Milliseconds",3);default:return this.clone()}},s.endOf=function(i){return this.startOf(i,!1)},s.$set=function(i,u){var a,m=g.p(i),p="set"+(this.$u?"UTC":""),h=(a={},a[w]=p+"Date",a[v]=p+"Date",a[T]=p+"Month",a[E]=p+"FullYear",a[f]=p+"Hours",a[y]=p+"Minutes",a[r]=p+"Seconds",a[o]=p+"Milliseconds",a)[m],O=m===w?this.$D+(u-this.$W):u;if(m===T||m===E){var D=this.clone().set(v,1);D.$d[h](O),D.init(),this.$d=D.set(v,Math.min(this.$D,D.daysInMonth())).$d}else h&&this.$d[h](O);return this.init(),this},s.set=function(i,u){return this.clone().$set(i,u)},s.get=function(i){return this[g.p(i)]()},s.add=function(i,u){var a,m=this;i=Number(i);var p=g.p(u),h=function(A){var I=$(m);return g.w(I.date(I.date()+Math.round(A*i)),m)};if(p===T)return this.set(T,this.$M+i);if(p===E)return this.set(E,this.$y+i);if(p===w)return h(1);if(p===l)return h(7);var O=(a={},a[y]=e,a[f]=n,a[r]=t,a)[p]||1,D=this.$d.getTime()+i*O;return g.w(D,this)},s.subtract=function(i,u){return this.add(-1*i,u)},s.format=function(i){var u=this,a=this.$locale();if(!this.isValid())return a.invalidDate||U;var m=i||"YYYY-MM-DDTHH:mm:ssZ",p=g.z(this),h=this.$H,O=this.$m,D=this.$M,A=a.weekdays,I=a.months,J=a.meridiem,X=function(j,H,q,Q){return j&&(j[H]||j(u,m))||q[H].slice(0,Q)},rt=function(j){return g.s(h%12||12,j,"0")},Z=J||function(j,H,q){var Q=j<12?"AM":"PM";return q?Q.toLowerCase():Q};return m.replace(x,function(j,H){return H||function(q){switch(q){case"YY":return String(u.$y).slice(-2);case"YYYY":return g.s(u.$y,4,"0");case"M":return D+1;case"MM":return g.s(D+1,2,"0");case"MMM":return X(a.monthsShort,D,I,3);case"MMMM":return X(I,D);case"D":return u.$D;case"DD":return g.s(u.$D,2,"0");case"d":return String(u.$W);case"dd":return X(a.weekdaysMin,u.$W,A,2);case"ddd":return X(a.weekdaysShort,u.$W,A,3);case"dddd":return A[u.$W];case"H":return String(h);case"HH":return g.s(h,2,"0");case"h":return rt(1);case"hh":return rt(2);case"a":return Z(h,O,!0);case"A":return Z(h,O,!1);case"m":return String(O);case"mm":return g.s(O,2,"0");case"s":return String(u.$s);case"ss":return g.s(u.$s,2,"0");case"SSS":return g.s(u.$ms,3,"0");case"Z":return p}return null}(j)||p.replace(":","")})},s.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},s.diff=function(i,u,a){var m,p=this,h=g.p(u),O=$(i),D=(O.utcOffset()-this.utcOffset())*e,A=this-O,I=function(){return g.m(p,O)};switch(h){case E:m=I()/12;break;case T:m=I();break;case _:m=I()/3;break;case l:m=(A-D)/6048e5;break;case w:m=(A-D)/864e5;break;case f:m=A/n;break;case y:m=A/e;break;case r:m=A/t;break;default:m=A}return a?m:g.a(m)},s.daysInMonth=function(){return this.endOf(T).$D},s.$locale=function(){return L[this.$L]},s.locale=function(i,u){if(!i)return this.$L;var a=this.clone(),m=N(i,u,!0);return m&&(a.$L=m),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}(),P=Y.prototype;return $.prototype=P,[["$ms",o],["$s",r],["$m",y],["$H",f],["$W",w],["$M",T],["$y",E],["$D",v]].forEach(function(c){P[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=N,$.isDayjs=C,$.unix=function(c){return $(1e3*c)},$.en=L[k],$.Ls=L,$.p={},$})});var Gt=Ft((It,_t)=>{"use strict";(function(t,e){typeof It=="object"&&typeof _t<"u"?_t.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs_plugin_customParseFormat=e()})(It,function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,o=/\d\d/,r=/\d\d?/,y=/\d*[^-_:/,()\s\d]+/,f={},w=function(d){return(d=+d)+(d>68?1900:2e3)},l=function(d){return function(x){this[d]=+x}},T=[/[+-]\d\d:?(\d\d)?|Z/,function(d){(this.zone||(this.zone={})).offset=function(x){if(!x||x==="Z")return 0;var S=x.match(/([+-]|\d\d)/g),M=60*S[1]+(+S[2]||0);return M===0?0:S[0]==="+"?-M:M}(d)}],_=function(d){var x=f[d];return x&&(x.indexOf?x:x.s.concat(x.f))},E=function(d,x){var S,M=f.meridiem;if(M){for(var z=1;z<=24;z+=1)if(d.indexOf(M(z,0,x))>-1){S=z>12;break}}else S=d===(x?"pm":"PM");return S},v={A:[y,function(d){this.afternoon=E(d,!1)}],a:[y,function(d){this.afternoon=E(d,!0)}],Q:[n,function(d){this.month=3*(d-1)+1}],S:[n,function(d){this.milliseconds=100*+d}],SS:[o,function(d){this.milliseconds=10*+d}],SSS:[/\d{3}/,function(d){this.milliseconds=+d}],s:[r,l("seconds")],ss:[r,l("seconds")],m:[r,l("minutes")],mm:[r,l("minutes")],H:[r,l("hours")],h:[r,l("hours")],HH:[r,l("hours")],hh:[r,l("hours")],D:[r,l("day")],DD:[o,l("day")],Do:[y,function(d){var x=f.ordinal,S=d.match(/\d+/);if(this.day=S[0],x)for(var M=1;M<=31;M+=1)x(M).replace(/\[|\]/g,"")===d&&(this.day=M)}],w:[r,l("week")],ww:[o,l("week")],M:[r,l("month")],MM:[o,l("month")],MMM:[y,function(d){var x=_("months"),S=(_("monthsShort")||x.map(function(M){return M.slice(0,3)})).indexOf(d)+1;if(S<1)throw new Error;this.month=S%12||S}],MMMM:[y,function(d){var x=_("months").indexOf(d)+1;if(x<1)throw new Error;this.month=x%12||x}],Y:[/[+-]?\d+/,l("year")],YY:[o,function(d){this.year=w(d)}],YYYY:[/\d{4}/,l("year")],Z:T,ZZ:T};function U(d){var x,S;x=d,S=f&&f.formats;for(var M=(d=x.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function($,g,Y){var P=Y&&Y.toUpperCase();return g||S[Y]||t[Y]||S[P].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(c,s,i){return s||i.slice(1)})})).match(e),z=M.length,k=0;k<z;k+=1){var L=M[k],K=v[L],C=K&&K[0],N=K&&K[1];M[k]=N?{regex:C,parser:N}:L.replace(/^\[|\]$/g,"")}return function($){for(var g={},Y=0,P=0;Y<z;Y+=1){var c=M[Y];if(typeof c=="string")P+=c.length;else{var s=c.regex,i=c.parser,u=$.slice(P),a=s.exec(u)[0];i.call(g,a),$=$.replace(a,"")}}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}}(g),g}}return function(d,x,S){S.p.customParseFormat=!0,d&&d.parseTwoDigitYear&&(w=d.parseTwoDigitYear);var M=x.prototype,z=M.parse;M.parse=function(k){var L=k.date,K=k.utc,C=k.args;this.$u=K;var N=C[1];if(typeof N=="string"){var $=C[2]===!0,g=C[3]===!0,Y=$||g,P=C[2];g&&(P=C[2]),f=this.$locale(),!$&&P&&(f=S.Ls[P]),this.$d=function(u,a,m,p){try{if(["x","X"].indexOf(a)>-1)return new Date((a==="X"?1e3:1)*u);var h=U(a)(u),O=h.year,D=h.month,A=h.day,I=h.hours,J=h.minutes,X=h.seconds,rt=h.milliseconds,Z=h.zone,j=h.week,H=new Date,q=A||(O||D?1:H.getDate()),Q=O||H.getFullYear(),dt=0;O&&!D||(dt=D>0?D-1:H.getMonth());var lt,xt=I||0,wt=J||0,$t=X||0,Mt=rt||0;return Z?new Date(Date.UTC(Q,dt,q,xt,wt,$t,Mt+60*Z.offset*1e3)):m?new Date(Date.UTC(Q,dt,q,xt,wt,$t,Mt)):(lt=new Date(Q,dt,q,xt,wt,$t,Mt),j&&(lt=p(lt).week(j).toDate()),lt)}catch{return new Date("")}}(L,N,K,S),this.init(),P&&P!==!0&&(this.$L=this.locale(P).$L),Y&&L!=this.format(N)&&(this.$d=new Date("")),f={}}else if(N instanceof Array)for(var c=N.length,s=1;s<=c;s+=1){C[1]=N[s-1];var i=S.apply(this,C);if(i.isValid()){this.$d=i.$d,this.$L=i.$L,this.init();break}s===c&&(this.$d=new Date(""))}else z.call(this,k)}}})});var nr={};ne(nr,{UtilsError:()=>mt,base64Decode:()=>me,base64Encode:()=>ce,castArray:()=>et,compose:()=>pe,composeRight:()=>de,debounce:()=>le,debugWarn:()=>xe,decimalToBinary:()=>ue,deepClone:()=>ot,deepMerge:()=>ge,generateRandomArray:()=>We,generateRandomColor:()=>Ue,generateRandomDate:()=>Lt,generateRandomEmail:()=>Je,generateRandomFloat:()=>Qe,generateRandomIdCard:()=>tr,generateRandomMobilePhone:()=>er,generateRandomStringFromSource:()=>yt,getRandomInt:()=>B,getRandomItem:()=>F,getRandomString:()=>G,getRandomUrl:()=>rr,hasChanged:()=>fe,hasCircularReference:()=>Se,isArray:()=>W,isBoolean:()=>Ot,isDate:()=>At,isDateString:()=>Nt,isDef:()=>ae,isEmail:()=>_e,isEmptyString:()=>Le,isFloat:()=>je,isFunction:()=>ct,isIdCard:()=>Ce,isInteger:()=>ve,isMap:()=>Dt,isMobilePhone:()=>Fe,isNegativeFloat:()=>ke,isNegativeInteger:()=>Pe,isNil:()=>Et,isNonNegativeFloat:()=>Ee,isNonNegativeInteger:()=>kt,isNonPositiveFloat:()=>Ye,isNonPositiveInteger:()=>Ie,isNull:()=>se,isNumber:()=>R,isObject:()=>it,isObjectLike:()=>ut,isPlainObject:()=>V,isPositiveFloat:()=>Re,isPositiveInteger:()=>Ne,isPromise:()=>Rt,isRegExp:()=>jt,isSet:()=>Tt,isString:()=>nt,isStringNumber:()=>Be,isSymbol:()=>St,isURL:()=>He,isUndef:()=>st,log:()=>at,objectToString:()=>Ht,omit:()=>De,pick:()=>Te,qs:()=>Vt,throttle:()=>we,throwError:()=>b,toTypeString:()=>tt,toTypeValue:()=>ie,withRetry:()=>$e});function it(t){let e=typeof t;return t!==null&&(e==="object"||e==="function")}function ut(t){return t!==null&&typeof t=="object"}var Ht=Object.prototype.toString,tt=t=>Ht.call(t),ie=t=>tt(t).slice(8,-1),nt=t=>typeof t=="string",R=t=>typeof t=="number"&&Number.isFinite(t),Ot=t=>typeof t=="boolean",se=t=>t===null,st=t=>t===void 0,St=t=>typeof t=="symbol",W=Array.isArray,ct=t=>typeof t=="function",Dt=t=>tt(t)==="[object Map]",Tt=t=>tt(t)==="[object Set]",At=t=>tt(t)==="[object Date]",jt=t=>tt(t)==="[object RegExp]",Rt=t=>ut(t)&&ct(t?.then)&&ct(t?.catch),Et=t=>t==null,ae=t=>t!=null,fe=(t,e)=>t!==e;function V(t){return tt(t)==="[object Object]"}function et(t){return W(t)?t:[t]}function ue(t){let e=[],n,o="";for(;t>0;)n=Math.floor(t%2),e.push(n),t=Math.floor(t/2);for(;e.length>0;)o+=e.pop().toString();return o}var Wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function ce(t){let e="",n="";for(let r=0;r<t.length;r++)n+=t[r].charCodeAt(0).toString(2).padStart(8,"0");for(let r=0;r<n.length;r+=6)e+=Wt[Number.parseInt(n.slice(r,r+6).padEnd(6,"0"),2)];let o=e.length%4;return o!==0&&(e+="=".repeat(4-o)),e}function me(t){let e="",n="";for(let o=0;o<t.length&&t[o]!=="=";o++)n+=Wt.indexOf(t[o]).toString(2).padStart(6,"0");for(let o=0;o<n.length;o+=8){let r=Number.parseInt(n.slice(o,o+8),2);r&&(e+=String.fromCharCode(r))}return e}function pe(...t){return t.reduce((e,n)=>function(...o){return n(e(...o))})}function de(...t){return t.reduce((e,n)=>function(...o){return e(n(...o))})}function le(t,e=500){let n=null;return function(...o){n&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,o)},e)}}function ot(t){let e=new WeakMap;function n(r){if(!ut(r))return r;if(e.has(r))return e.get(r);if(At(r)){let f=new Date(r);return e.set(r,f),f}if(jt(r)){let f=new RegExp(r.source,r.flags);return e.set(r,f),f}if(Rt(r))return r;if(typeof Buffer<"u"&&Buffer.isBuffer(r)){let f=Buffer.allocUnsafe?Buffer.allocUnsafe(r.length):Buffer.from(r);return r.copy(f),e.set(r,f),f}if(r instanceof Error){let f=new r.constructor(r.message);return e.set(r,f),o(r,f),f}if(r instanceof Boolean||r instanceof Number||r instanceof String){let f=r.valueOf(),w=Object(f);return e.set(r,w),o(r,w),w}if(typeof Node<"u"&&r instanceof Node)return{};if(r instanceof WeakMap)return{};if(r instanceof WeakSet)return{};if(r instanceof ArrayBuffer)return r.slice(0);if(r instanceof DataView){let f=r.buffer.slice(0);return new DataView(f,r.byteOffset,r.byteLength)}if(ArrayBuffer.isView(r)){let f=r.constructor;return new f(r)}if(Dt(r)){let f=new Map;return e.set(r,f),r.forEach((w,l)=>f.set(n(l),n(w))),f}if(Tt(r)){let f=new Set;return e.set(r,f),r.forEach(w=>f.add(n(w))),f}let y=W(r)?Object.setPrototypeOf([],Object.getPrototypeOf(r)):Object.create(Object.getPrototypeOf(r));return e.set(r,y),o(r,y),he(r,y),y}function o(r,y){let f=Object.getOwnPropertyDescriptors(r);for(let w of Reflect.ownKeys(f)){let l=f[w];l.get||l.set?Object.defineProperty(y,w,l):Object.defineProperty(y,w,{...l,value:n(l.value)})}}return n(t)}function he(t,e){Object.isFrozen(t)?Object.freeze(e):Object.isSealed(t)?Object.seal(e):Object.isExtensible(t)||Object.preventExtensions(e)}function ge(t,e,n={}){return zt(Ut(t,n),Ut(e,n),n)}function zt(t,e,n){return W(t)?ye(t,e,n):be(t,e,n)}function be(t,e,n){if(!V(e))return e;let o=Object.getOwnPropertyDescriptors(e);return Reflect.ownKeys(e).forEach(r=>{(V(t[r])||W(t[r]))&&(V(e[r])||W(e[r]))?t[r]=zt(t[r],e[r],n):Object.defineProperty(t,r,o[r])}),t}function ye(t,e,n){let{mergeStrategy:o="replace"}=n;if(W(e))switch(o){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 mt=class extends Error{constructor(e,n="Utils"){super(e),this.name=n}};function b(t,e){throw new mt(`[${t}] ${e}`)}function xe(t,e){let n=nt(t)?new mt(`[${t}] ${e}`,"UtilsWarn"):t;console.warn(n)}var pt=(t,e,...n)=>{if(!e)return;let o=n.length===0?"":n.length===1?n[0]:n;console[t](`[Log] ${e}:`,o)},at=(t,...e)=>{pt("info",t,...e)};at.info=(t,...e)=>{pt("info",t,...e)};at.warn=(t,...e)=>{pt("warn",t,...e)};at.error=(t,...e)=>{pt("error",t,...e)};typeof globalThis<"u"&&(globalThis.lntvowSetLogImpl=t=>pt=t);var Vt={stringify:t=>(it(t)||b("stringify","Input must be an object"),new URLSearchParams(t).toString()),parse:t=>(nt(t)||b("parse","Input must be a string"),Object.fromEntries(new URLSearchParams(t).entries())),appendQueryString:(t,e)=>{let n=Vt.stringify(e);return t.includes("?")?t.endsWith("?")||t.endsWith("&")?`${t}${n}`:`${t}&${n}`:`${t}?${n}`}};function we(t,e=500){let n=null;return function(...o){if(Et(n))return n=Date.now(),t.apply(this,o);let r=Date.now();if(r-n>=e)return n=r,t.apply(this,o)}}function $e(t){Me(t);let{fn:e,maxAttempts:n=3,retryDelay:o=1e3,enableExponentialBackoff:r=!1,signal:y}=t,f,w=y?new Promise((T,_)=>{let E=()=>_(Kt());y.addEventListener("abort",E),f=()=>y.removeEventListener("abort",E)}):null;return new Promise((T,_)=>{(async()=>{for(let v=1;v<=n;v++){if(y?.aborted)return _(Kt());try{let U=await Promise.race(w?[e(),w]:[e()]);return T(U)}catch(U){let d=r?o*2**(v-1):o;if(at("withRetry",`Attempt ${v}/${n} failed. Retrying in ${d}ms...`),U instanceof Error&&U.name==="AbortError"||v===n)return _(U);await new Promise(x=>setTimeout(x,d))}}})()}).finally(()=>f?.())}function Me(t){V(t)||b("withRetry",'"Options" must be an object'),typeof t.fn!="function"&&b("withRetry",'"fn" must be a function that returns a Promise'),!st(t.maxAttempts)&&(!Number.isInteger(t.maxAttempts)||t.maxAttempts<1)&&b("withRetry",'"maxAttempts" must be a positive integer'),!st(t.retryDelay)&&(!R(t.retryDelay)||t.retryDelay<0)&&b("withRetry",'"retryDelay" must be a non-negative number'),!st(t.enableExponentialBackoff)&&!Ot(t.enableExponentialBackoff)&&b("withRetry",'"enableExponentialBackoff" must be a boolean'),!st(t.signal)&&typeof t.signal!="object"&&b("withRetry",'"signal" must be an AbortSignal')}var Oe="The operation was aborted";function Kt(t=Oe){let e=new Error(t);return e.name="AbortError",e}function Se(t){it(t)||b("hasCircularReference",'"obj" must be a object');let e=new Set;function n(o){if(it(o)){if(e.has(o))return!0;e.add(o);for(let r of Object.keys(o))if(n(o[r]))return!0;e.delete(o)}return!1}return n(t)}function De(t,e){if(!V(t))return{};let n=ot(t),o=et(e);for(let r of o)Reflect.deleteProperty(n,r);return n}function Te(t,e,n={}){let{includeProto:o=!1,includeSymbols:r=!0,includeNonEnum:y=!1}=n,f={};return V(t)&&et(e).forEach(l=>{St(l)&&!r||!(o?l in t:Object.hasOwn(t,l))||!y&&(o?Ae(t,l):Object.getOwnPropertyDescriptor(t,l))?.enumerable===!1||(f[l]=ot(t[l]))}),f}function Ae(t,e){let n=t;for(;n!==null;){let o=Object.getOwnPropertyDescriptor(n,e);if(o)return o;n=Object.getPrototypeOf(n)}}function je(t){return/^-?(?:0|[1-9]\d*)\.\d+$/.test(t)}function Re(t){return/^(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Ee(t){return/^(?:0|[1-9]\d*)\.\d+$/.test(t)}function ke(t){return/^-(?:0\.0*[1-9]\d*|[1-9]\d*\.\d+)$/.test(t)}function Ye(t){return/^-(?:0|[1-9]\d*)\.\d+$/.test(t)}function ve(t){return/^-?(?:0|[1-9]\d*)$/.test(t)}function Ne(t){return/^[1-9]\d*$/.test(t)}function kt(t){return/^(?:0|[1-9]\d*)$/.test(t)&&!Object.is(t,-0)}function Pe(t){return/^-[1-9]\d*$/.test(t)}function Ie(t){return/^-(?:0|[1-9]\d*)$/.test(t)||Object.is(t,-0)}var Zt=gt(bt(),1);function Nt(t,e="YYYY-MM-DD HH:mm:ss"){return(0,Zt.default)(t,e,!0).isValid()}function _e(t){return/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(t)}function Le(t){return t===""}var Pt=gt(bt(),1);function Ce(t){if(!/^[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))return!1;let n=t.slice(6,14);return Nt(n,"YYYYMMDD")&&(0,Pt.default)(n,"YYYYMMDD").isBefore((0,Pt.default)())}function Fe(t){return/^1[3-9]\d{9}$/.test(t)}var Be=t=>{if(!nt(t)||!/^-?\d+(?:\.\d+)?$/.test(t))return!1;let n=Number(t);return!(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)};function He(t){return/^https?:\/\/\S+$/i.test(t)}function We(t,e){return(!R(t)||!kt(t.toString()))&&b("generateRandomArray","num must be greater than 0"),ct(e)||b("generateRandomArray","cb must be a function"),Array.from({length:t},()=>e())}function Ue(){return`#${Math.floor(Math.random()*16777215).toString(16).padStart(6,"0")}`}var ft=gt(bt(),1),qt=gt(Gt(),1);function F(t){return t[Math.floor(Math.random()*t.length)]}function B(t={}){R(t)&&(t={max:t});let{min:e=1,max:n=F(Ve())}=t;ze(e,n);let o=Math.ceil(e),r=Math.floor(n);return Math.floor(Math.random()*(r-o+1)+o)}function ze(t,e){let n=Math.ceil(t),o=Math.floor(e);Number.isSafeInteger(n)||b("getRandomInt",`The minimum value Math.ceil(${t}) should be a safe integer`),Number.isSafeInteger(o)||b("getRandomInt",`The maximum value Math.floor(${e}) should be a safe integer`),o<n&&(e>=t&&b("getRandomInt",`No integer value found between ${t} and ${e}`),b("getRandomInt",`The maximum value ${e} should be greater than the minimum value ${t}`))}function Ve(){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)})}ft.default.extend(qt.default);function Lt(t={}){let{start:e="1800-01-01 00:00:00",end:n=(0,ft.default)().format(Xt),format:o=Xt}=t,r=(0,ft.default)(e),y=(0,ft.default)(n);(!r.isValid()||!y.isValid())&&b("generateRandomDate","start and end parameters must be valid date format"),r.isAfter(y)&&b("generateRandomDate","start date must be before end date");let f=r.valueOf(),w=y.valueOf(),l=B({min:f,max:w});return(0,ft.default)(l).format(o)}var Xt="YYYY-MM-DD HH:mm:ss";function G(t={}){let e=Ze(t),n=Ge(e);Xe(n);let{length:o}=e;qe(o.min,o.max);let r=B(o),y=e.prefix||"";for(let f=0;f<r;f++)y+=n.charAt(Math.floor(Math.random()*n.length));return y+(e.suffix||"")}var Ke=16,Ct=1;function Ze(t){let e=R(t);return{lowerCase:!0,upperCase:!0,number:!0,...e?{}:t,length:e?{max:t,min:t}:R(t.length)?{max:t.length,min:t.length}:{max:Ke,min:Ct,...t.length},extra:e?[]:[...new Set(et(t.extra||[]))]}}function Ge(t){let e="";return t.lowerCase&&(e+="abcdefghijklmnopqrstuvwxyz"),t.upperCase&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.number&&(e+="0123456789"),e+=et(t.extra).join(""),e}function Xe(t){t.length===0&&b("getRandomString","At least one character set (lowercase, uppercase, number) must be enabled or extra characters provided")}function qe(t,e){Number.isInteger(t)||b("getRandomString","min must be an integer"),Number.isInteger(e)||b("getRandomString","max must be an integer"),t<Ct&&b("getRandomString",`Minimum length cannot be less than ${Ct}`),e<t&&b("getRandomString","Maximum length cannot be less than minimum length")}function Je(){let t=["gmail.com","outlook.com","yahoo.com","qq.com","163.com","hotmail.com"],e=B({min:5,max:10}),n=G({length:e,lowerCase:!0,upperCase:!1,number:!0}),o=F(t);return`${n}@${o}`}function Qe(t={}){R(t)&&(t={max:t});let{min:e=0,max:n=1,fractionDigits:o=2}=t;if((!R(e)||!R(n))&&b("generateRandomFloat",'"min" and "max" must be numbers'),(!Number.isInteger(o)||o<0)&&b("generateRandomFloat",'"fractionDigits" must be a non-negative integer'),e===n)return Number(e.toFixed(o));e>n&&b("generateRandomFloat",`"max" (${n}) must be greater than "min" (${e})`);let r=Math.random()*(n-e)+e;return Number(r.toFixed(o))}function yt(t,e){(!R(t)||t<=0)&&b("generateRandomStringFromSource",'"num" must be greater than 0'),(!W(e)||e.length===0)&&b("generateRandomStringFromSource",'"source" must be a non-empty array');let n="";for(let o=0;o<t;o++)n+=F(e);return n}function tr(){let t=B({min:1e5,max:999999}),e=[0,1,2,3,4,5,6,7,8,9];return[t,Lt({format:"YYYYMMDD"}),yt(3,e),yt(1,[...e,"X","x"])].join("")}function er(){return F(["13","14","15","16","17","18","19"])+B(999999999).toString().padEnd(9,"0")}function rr(){let t=["http://","https://"],e=[".com",".net",".org",".cn",".top"],n=[`?name=${G({length:{min:4,max:8}})}`,`?id=${B()}`,`?page=${G({length:{min:2,max:4}})}`,`?query=${G({length:{min:5,max:6}})}`,`?search=${G({length:{min:1,max:4}})}`,`?token=${G({length:{min:16,max:16}})}`];return`${F(t)}${G({length:{min:5,max:25}})}${F(e)}${F(n)}`}return oe(nr);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lntvow/utils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "TypeScript utilities",
|
|
6
6
|
"keywords": [
|
|
@@ -29,24 +29,25 @@
|
|
|
29
29
|
"dayjs": "^1.11.18"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@commitlint/cli": "^
|
|
33
|
-
"@commitlint/config-conventional": "^
|
|
34
|
-
"@lntvow/eslint-config": "^9.
|
|
35
|
-
"@types/node": "^
|
|
32
|
+
"@commitlint/cli": "^20.1.0",
|
|
33
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
34
|
+
"@lntvow/eslint-config": "^9.35.1",
|
|
35
|
+
"@types/node": "^20.19.20",
|
|
36
36
|
"@types/qs": "^6.14.0",
|
|
37
37
|
"@vitest/coverage-v8": "^3.2.4",
|
|
38
38
|
"@vitest/ui": "^3.2.4",
|
|
39
|
-
"bumpp": "^10.
|
|
39
|
+
"bumpp": "^10.3.1",
|
|
40
40
|
"commitizen": "^4.3.1",
|
|
41
41
|
"cz-conventional-changelog": "^3.3.0",
|
|
42
|
-
"eslint": "^9.
|
|
43
|
-
"
|
|
42
|
+
"eslint": "^9.37.0",
|
|
43
|
+
"jsdom": "^27.0.0",
|
|
44
|
+
"lint-staged": "^16.2.3",
|
|
44
45
|
"npm-run-all": "^4.1.5",
|
|
45
46
|
"prettier": "^3.6.2",
|
|
46
47
|
"qs": "^6.14.0",
|
|
47
48
|
"simple-git-hooks": "^2.13.1",
|
|
48
49
|
"tsup": "^8.5.0",
|
|
49
|
-
"typescript": "^5.9.
|
|
50
|
+
"typescript": "^5.9.3",
|
|
50
51
|
"vitest": "^3.2.4"
|
|
51
52
|
},
|
|
52
53
|
"scripts": {
|