(function(i,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(i=typeof globalThis<"u"?globalThis:i||self,a((i["[name]"]=i["[name]"]||{},i["[name]"].umd=i["[name]"].umd||{},i["[name]"].umd.cjs={})))})(this,function(i){"use strict";function a(t){return Object.prototype.toString.call(t)}function X(t){return a(t).match(/\s+(\w+)/)[1]}function j(t){return a(t)==="[object Map]"}function M(t){return a(t)==="[object WeakMap]"}function D(t){return a(t)==="[object Set]"}function q(t){return a(t)==="[object WeakSet]"}function A(t){return a(t)==="[object Date]"}function L(t){return!isNaN(parseFloat(t))&&isFinite(t)}function I(t){return typeof t=="boolean"}function g(t){return typeof t=="string"}function F(t){return typeof t=="function"}function H(t){return a(t)==="[object AsyncFunction]"}function R(t){return typeof t=="symbol"}function p(t){return Array.isArray(t)}function S(t){return t!==null&&typeof t=="object"}function w(t){return a(t)==="[object Object]"}function J(t){return S(t)&&F(t.then)&&F(t.catch)}function T(t){return!t&&t!==0||p(t)&&t.length===0||S(t)&&!Object.keys(t).length}function z(t){const n=typeof t;return n==="string"||n==="boolean"||n==="symbol"||n==="number"}function k(t){return a(t)==="[object ArrayBuffer]"}function G({statement:t,rootData:n,context:e}){if(I(t))return t;if(t&&g(t))try{return!!new Function("$","$ctx",`return ${t}`)(n,e)}catch(r){console.warn(r)}return!1}function Z(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const n=Math.random()*16|0;return(t==="x"?n:n&3|8).toString(16)})}function Q(t){const n=g(t)?document.getElementById(t):t;if(n){if(n.style.backgroundColor="#ffffff",n.requestFullscreen)return n.requestFullscreen();if(n.webkitRequestFullscreen)return n.webkitRequestFullscreen();if(n.mozRequestFullScreen)return n.mozRequestFullScreen();if(n.msRequestFullscreen)return n.msRequestFullscreen();console.warn("浏览器不支持全屏功能")}}function Y(){const t=document;if(t.exitFullscreen)return t.exitFullscreen();if(t.webkitExitFullscreen)return t.webkitExitFullscreen();if(t.mozCancelFullScreen)return t.mozCancelFullScreen();if(t.msExitFullscreen)return t.msExitFullscreen()}function v(t){if(L(t)&&Math.abs(parseFloat(t))>=1e3){const n=t.toString().split("."),e=n[0].replace(/(\d)(?=(?:\d{3})+(?!\S))/g,"$1,");return n.length>1?`${e}.${n[1]}`:e}return t}function B(t){return t.split("-").map((e,r)=>r>0?e.toUpperCase():e).join("")}function tt(t){Object.keys(t).forEach(n=>{/-/.test(n)&&(t[B(n)]=t[n]),Reflect.deleteProperty(t,n)})}function nt(t){return/^[\u4e00-\u9fa5]+$/.test(t)}function et(t){return/^[a-zA-Z0-9]+$/i.test(t)}function rt(t){return/^1[3-9]\d{9}$/.test(t)}function V(t){return/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/.test(t)}function it(t){return/^[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?$/.test(t)}const st={Phone:/^1(3[0-9]|4[57]|5[0-35-9]|7[0135678]|8[0-9]|9[8-9])\d{8}$/,ImageUrl:/^http[s]*:\/\/|\.jpg$|\.png$|\.jpeg$|\.gif$|\.bmp$|\.webp$|^data:image/,IDCard:/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/,Score:/^(\d(\.\d{1,2})?|10(\.0{1,2})?)$/,Money:/^(([1-9]\d*)|0)(\.\d{1,2})?$/,MoneyTenThousand:/^(([1-9]\d*)|0)(\.\d{1,6})?$/,Split:/(?=(?!\b)(\d{3})+$)/,Email:/^[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?$/,Integer:/^-?[1-9]\d*$/,PositiveInteger:/^[1-9]\d*$/,NegativeInteger:/^-[1-9]\d*$/,NonPositiveInteger:/^-[1-9]\d*|0$/,NonNegativeInteger:/^[1-9]\d*|0$/};function W(t){return[].concat(Object.keys(t),Object.getOwnPropertySymbols(t))}function ot(t){if(p(t))return t;if(z(t)){if(g(t)&&V(t)){const n=[];t.replace(/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,function(e,r,u,c){n.push(u?c.replace(/\\(\\)?/g,"$1"):r||e)})}return[t.toString()]}return[]}function ct(t,n){const e={};return!w(t)||T(t)||Object.keys(t).forEach(function(r){n.includes(r)||(e[r]=t[r])}),e}function ut(t,n){const e={};return w(t)&&Object.keys(t).forEach(function(r){n.includes(r)&&(e[r]=t[r])}),e}function at(t,n=0){return Array.from({length:t},(e,r)=>n+r)}function x(t,n=new WeakMap){const e=t.bind({});for(const r in t)t.hasOwnProperty(r)&&(e[r]=typeof t[r]=="function"?x(t[r],n):t[r]);return e}function ft(t){return JSON.parse(JSON.stringify(t))}function y(t,n=new WeakMap){if(S(t)){if(n&&n.get(t))return n.get(t);if(p(t)){const e=t.map(r=>y(r,n));return n.set(t,e),e}if(w(t)){const e={};return W(t).map(r=>{e[r]=y(t[r],n)}),n.set(t,e),e}if(A(t))return new Date(t);if(k(t))return t.slice();if(D(t)||q(t)){const e=new Set;return t.forEach(r=>{e.add(y(r,n))}),e}if(j(t)||M(t)){const e=new Map;return t.forEach((r,u)=>{e.set(u,y(r,n))}),e}}return R(t)?Symbol(t.description):t}function lt(t){return y(t)}function E(t){const n=decodeURIComponent(t).match(/[^/]*$/);return n?(n[0]||"").split("?")[0]:""}function $(t,n){const e=window.URL.createObjectURL(t),r=document.createElement("a");r.href=e,r.download=n,r.click(),window.URL.revokeObjectURL(e)}function dt(t,n){if(!t)throw URIError("链接不能为空");const e=document.createElement("canvas"),r=document.createElement("img");r.setAttribute("crossOrigin","Anonymous"),r.src=t,r.onload=function(){var c;e.width=r.width,e.height=r.height;const u=e.getContext("2d");!u||!e||(u.drawImage(r,0,0,r.width,r.height),(c=e.getContext("2d"))==null||c.drawImage(r,0,0,r.width,r.height),e.toBlob(f=>{if(f){const h=n||E(t)||"download.png";$(f,h)}}))}}function mt(t,n){$(new Blob([t],n),t.name||"下载")}function ht(t,n){if(!t)throw URIError("链接不能为空");const e=n||E(t)||"download.png";if(typeof fetch=="function")fetch(t).then(r=>r.blob()).then(r=>{$(r,e)}).catch(r=>console.error("Error downloading file:",r));else if(XMLHttpRequest){const r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="blob",r.onload=function(){this.status===200?$(this.response,e):console.error("Error fetching resource")},r.send()}else window.open(t,"_blank")}function gt(t=1e3){return new Promise(n=>{setTimeout(n,t)})}function U(...t){const n=[];return t.forEach(e=>{e&&n.push(pt(e))}),n.filter(e=>e).join(" ")}function pt(t){if(g(t))return t;if(p(t))return U(...t);if(w(t)){const n=[];return Object.keys(t).forEach(e=>{e&&t[e]&&n.push(e)}),n.join(" ")}return""}let P="",C="root";const wt="is-",m=(t,n,e,r,u)=>{let c=`${t?`${t}-`:""}${n}`;return e&&(c+=`-${e}`),r&&(c+=`__${r}`),u&&(c+=`--${u}`),c};function yt(t,n){const e=n||P,r=n||C;return{set:s=>{P=s,C=s},get:()=>({defaultNamespace:P,defaultCssNamespace:C}),b:(s="")=>m(e,t,s,"",""),e:s=>s?m(e,t,"",s,""):"",m:s=>s?m(e,t,"","",s):"",be:(s,o)=>s&&o?m(e,t,s,o,""):"",em:(s,o)=>s&&o?m(e,t,"",s,o):"",bm:(s,o)=>s&&o?m(e,t,s,"",o):"",bem:(s,o,d)=>s&&o&&d?m(e,t,s,o,d):"",is:(s,o)=>{if(!s||!o)return"";let d=!0;return F(o)&&(d=o()),d?`${wt}${s}`:""},cssVar:s=>{const o={};for(const d in s)s[d]&&(o[`--${r}-${d}`]=s[d]);return o},cssVarBlock:s=>{const o={};for(const d in s)s[d]&&(o[`--${r}-${t}-${d}`]=s[d]);return o},cssVarName:s=>`--${r}-${s}`,cssVarBlockName:s=>`--${r}-${t}-${s}`}}class $t{constructor({dataList:n,fragmentSize:e}){this._aborted=!1,this._responseData=[],this._dataList=[...n],this._fragmentSize=e||3,this._batchSize=Math.ceil(this._dataList.length/this._fragmentSize)}async startup(){var e,r,u;if(!this._requestFn)throw new Error("缺少 request 函数");if(this._dataList.length===0){(e=this._onDone)==null||e.call(this,[]);return}let n=0;for(let c=0;c{var O;n++,(O=this._onProgressFn)==null||O.call(this,{batch:c+1,current:b,count:n,total:this._dataList.length,percent:Math.floor(n/this._dataList.length*100)})});h.push(K)}}try{const l=await Promise.allSettled(h);this._aborted||(l||[]).forEach(b=>{this._responseData.push(b)})}catch(l){(r=this._onFail)==null||r.call(this,l instanceof Error?l:Error(String(l)))}}(u=this._onDone)==null||u.call(this,this._responseData)}request(n){this._requestFn=n}onProgress(n){this._onProgressFn=n}onDone(n){this._onDone=n}onFail(n){this._onFail=n}abort(){this._aborted=!0,this._dataList=null,this._responseData=null}}const bt={useNamespace:yt,useFragmentLoad:({dataList:t,fragmentSize:n,request:e,onProgress:r,onDone:u,onFail:c})=>{const f=new $t({dataList:t,fragmentSize:n});return f.request(e),f.onProgress(r),{abort:()=>f.abort(),startup:()=>new Promise((h,_)=>{u?f.onDone(u):f.onDone(l=>h(l)),c?f.onFail(c):f.onFail(l=>_(l)),f.startup()})}}};i.baseDownload=$,i.castPath=ot,i.classnames=U,i.deepClone=lt,i.deepCloneFunction=x,i.downloadFile=ht,i.downloadImage=dt,i.execStatement=G,i.exitFullScreen=Y,i.extraFileName=E,i.fileDownload=mt,i.genNumberArray=at,i.getAllKeys=W,i.hooks=bt,i.isAlphanumeric=et,i.isArray=p,i.isAsyncFunction=H,i.isBoolean=I,i.isBuffer=k,i.isChinese=nt,i.isDate=A,i.isDeepProp=V,i.isEmail=it,i.isEmpty=T,i.isFunction=F,i.isKey=z,i.isMap=j,i.isMobile=rt,i.isNumber=L,i.isObject=S,i.isPlainObject=w,i.isPromise=J,i.isSet=D,i.isString=g,i.isSymbol=R,i.isWeakMap=M,i.isWeakSet=q,i.omit=ct,i.pick=ut,i.plainClone=ft,i.propsToCamel=tt,i.regexps=st,i.requestFullScreen=Q,i.sleep=gt,i.snakeToCamel=B,i.thousandSeparatedFormat=v,i.toTypeString=a,i.typeOf=X,i.uuidv4=Z,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})}); //# sourceMappingURL=gadgets.umd.cjs.map