sculp-js 1.13.6 → 1.15.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.
- package/README.md +3 -1
- package/dist/cjs/_virtual/_commonjsHelpers.js +1 -1
- package/dist/cjs/array.js +1 -1
- package/dist/cjs/async.js +1 -1
- package/dist/cjs/base64.js +1 -1
- package/dist/cjs/clipboard.js +1 -1
- package/dist/cjs/cloneDeep.js +1 -1
- package/dist/cjs/concurrentLimit.js +179 -0
- package/dist/cjs/cookie.js +1 -1
- package/dist/cjs/date.js +1 -1
- package/dist/cjs/dom.js +1 -1
- package/dist/cjs/download.js +1 -1
- package/dist/cjs/easing.js +1 -1
- package/dist/cjs/file.js +1 -1
- package/dist/cjs/func.js +1 -1
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/math.js +1 -1
- package/dist/cjs/node_modules/bezier-easing/src/index.js +1 -1
- package/dist/cjs/number.js +2 -4
- package/dist/cjs/object.js +1 -1
- package/dist/cjs/path.js +1 -1
- package/dist/cjs/qs.js +1 -1
- package/dist/cjs/random.js +1 -1
- package/dist/cjs/string.js +1 -1
- package/dist/cjs/tooltip.js +1 -1
- package/dist/cjs/tree.js +73 -5
- package/dist/cjs/type.js +1 -1
- package/dist/cjs/unique.js +1 -1
- package/dist/cjs/url.js +1 -1
- package/dist/cjs/validator.js +1 -1
- package/dist/cjs/variable.js +1 -1
- package/dist/cjs/watermark.js +1 -1
- package/dist/esm/array.js +1 -1
- package/dist/esm/async.js +1 -1
- package/dist/esm/base64.js +1 -1
- package/dist/esm/clipboard.js +1 -1
- package/dist/esm/cloneDeep.js +1 -1
- package/dist/esm/concurrentLimit.js +176 -0
- package/dist/esm/cookie.js +1 -1
- package/dist/esm/date.js +1 -1
- package/dist/esm/dom.js +1 -1
- package/dist/esm/download.js +1 -1
- package/dist/esm/easing.js +1 -1
- package/dist/esm/file.js +1 -1
- package/dist/esm/func.js +1 -1
- package/dist/esm/index.js +12 -2
- package/dist/esm/math.js +1 -1
- package/dist/esm/number.js +3 -5
- package/dist/esm/object.js +1 -1
- package/dist/esm/path.js +1 -1
- package/dist/esm/qs.js +1 -1
- package/dist/esm/random.js +1 -1
- package/dist/esm/string.js +1 -1
- package/dist/esm/tooltip.js +1 -1
- package/dist/esm/tree.js +73 -7
- package/dist/esm/type.js +1 -1
- package/dist/esm/unique.js +1 -1
- package/dist/esm/url.js +1 -1
- package/dist/esm/validator.js +1 -1
- package/dist/esm/variable.js +1 -1
- package/dist/esm/watermark.js +1 -1
- package/dist/types/concurrentLimit.d.ts +65 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/tree.d.ts +36 -0
- package/dist/umd/index.min.js +2 -2
- package/package.json +1 -2
package/dist/umd/index.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* sculp-js v1.
|
|
2
|
+
* sculp-js v1.15.0
|
|
3
3
|
* (c) 2023-present chandq
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).sculpJs={})}(this,(function(e){"use strict";function t(e,t,n=!1){if(n)for(let n=e.length-1;n>=0;n--){const r=t(e[n],n,e);if(!1===r)break}else for(let n=0,r=e.length;n<r;n++){const r=t(e[n],n,e);if(!1===r)break}e=null}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r=.1,o="function"==typeof Float32Array;function i(e,t){return 1-3*t+3*e}function s(e,t){return 3*t-6*e}function a(e){return 3*e}function l(e,t,n){return((i(t,n)*e+s(t,n))*e+a(t))*e}function c(e,t,n){return 3*i(t,n)*e*e+2*s(t,n)*e+a(t)}function u(e){return e}var d=n((function(e,t,n,i){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return u;for(var s=o?new Float32Array(11):new Array(11),a=0;a<11;++a)s[a]=l(a*r,e,n);function d(t){for(var o=0,i=1;10!==i&&s[i]<=t;++i)o+=r;--i;var a=o+(t-s[i])/(s[i+1]-s[i])*r,u=c(a,e,n);return u>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var i=c(t,n,r);if(0===i)return t;t-=(l(t,n,r)-e)/i}return t}(t,a,e,n):0===u?a:function(e,t,n,r,o){var i,s,a=0;do{(i=l(s=t+(n-t)/2,r,o)-e)>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<10);return s}(t,o,o+r,e,n)}return function(e){return 0===e?0:1===e?1:l(d(e),t,i)}}));const{toString:f,hasOwnProperty:h}=Object.prototype;function p(e,t){return h.call(e,t)}function g(e){return!!v(e)||(!!y(e)||!!E(e)&&p(e,"length"))}function m(e){return f.call(e).slice(8,-1)}const y=e=>"string"==typeof e,b=e=>"boolean"==typeof e,w=e=>"number"==typeof e&&!Number.isNaN(e),x=e=>void 0===e,S=e=>null===e;function A(e){return x(e)||S(e)}const E=e=>"Object"===m(e),v=e=>Array.isArray(e),F=e=>"function"==typeof e,C=e=>Number.isNaN(e),$=e=>"Date"===m(e);function T(e){if(A(e)||Number.isNaN(e))return!0;const t=m(e);return g(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length}function R(e){return!x(NodeList)&&NodeList.prototype.isPrototypeOf(e)}const N={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};function I(e){let t;if(v(e))t=d(...e);else{const n=N[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=d(...n)}return e=>t(Math.max(0,Math.min(e,1)))}const j=e=>{if(!E(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function D(e,t){for(const n in e)if(p(e,n)&&!1===t(e[n],n))break;e=null}function P(e,t){const n={};return D(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const k=(e,t,n)=>{if(x(n))return t;if(m(t)!==m(n))return v(n)?k(e,[],n):E(n)?k(e,{},n):n;if(j(n)){const r=e.get(n);return r||(e.set(n,t),D(n,((n,r)=>{t[r]=k(e,t[r],n)})),t)}if(v(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=k(e,t[r],n)})),t)}return n};function M(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=k(n,e,o)}return n.clear(),e}function O(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const L="0123456789",B="abcdefghijklmnopqrstuvwxyz",U="ABCDEFGHIJKLMNOPQRSTUVWXYZ",H=/%[%sdo]/g;const z=/\${(.*?)}/g;const W=(e,t)=>{e.split(/\s+/g).forEach(t)};const q=(e,t,n)=>{E(t)?D(t,((t,n)=>{q(e,n,t)})):e.style.setProperty(O(t),n)};function _(e,t=14,n=!0){let r=0;if(console.assert(y(e),`${e} 不是有效的字符串`),y(e)&&e.length>0){const o="getStrWidth1494304949567";let i=document.querySelector(`#${o}`);if(!i){const n=document.createElement("span");n.id=o,n.style.fontSize=t+"px",n.style.whiteSpace="nowrap",n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.textContent=e,document.body.appendChild(n),i=n}i.textContent=e,r=i.offsetWidth,n&&i.remove()}return r}function G(e){let t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){const n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}function Y(e,t){const{successCallback:n,failCallback:r,container:o=document.body}=A(t)?{}:t;let i=function(e){const t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";const r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top=`${r}px`,n.setAttribute("readonly",""),n.value=e,n}(e);o.appendChild(i),G(i);try{document.execCommand("copy")&&F(n)&&n()}catch(e){F(r)&&r(e)}finally{o.removeChild(i),i=null,window.getSelection()?.removeAllRanges()}}function V(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),w(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else $(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const X=e=>$(e)&&!C(e.getTime()),J=e=>{if(!y(e))return;const t=e.replace(/-/g,"/");return new Date(t)},K=e=>{if(!y(e))return;const t=/([+-])(\d\d)(\d\d)$/,n=t.exec(e);if(!n)return;const r=e.replace(t,"Z"),o=new Date(r);if(!X(o))return;const[,i,s,a]=n,l=parseInt(s,10),c=parseInt(a,10),u=(e,t)=>"+"===i?e-t:e+t;return o.setHours(u(o.getHours(),l)),o.setMinutes(u(o.getMinutes(),c)),o};function Z(e){const t=new Date(e);if(X(t))return t;const n=J(e);if(X(n))return n;const r=K(e);if(X(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function Q(e){const t=Z(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}const ee=e=>{const t=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\.{3,}/g,"..").replace(/\/\.\//g,"/").split("/").map((e=>e.trim())),n=e=>".."===e,r=[];let o=!1;const i=e=>{r.push(e)};return t.forEach((e=>{const t=(e=>"."===e)(e),s=n(e);return o?t?void 0:s?(()=>{if(0===r.length)return;const e=r[r.length-1];n(e)?r.push(".."):r.pop()})():void i(e):(i(e),void(o=!t&&!s))})),r.join("/")},te=(e,...t)=>ee([e,...t].join("/"));function ne(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())x(n[e])?n[e]=r:v(n[e])||(n[e]=t.getAll(e));return n}const re=e=>y(e)?e:w(e)?String(e):b(e)?e?"true":"false":$(e)?e.toISOString():null;function oe(e,t=re){const n=new URLSearchParams;return D(e,((e,r)=>{if(v(e))e.forEach((e=>{const o=t(e);null!==o&&n.append(r.toString(),o)}));else{const o=t(e);if(null===o)return;n.set(r.toString(),o)}})),n.toString()}const ie=(e,t=!0)=>{let n=null;F(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:a,hostname:l,hash:c,search:u,pathname:d}=n,f=te("/",d),h=o&&i?`${o}:${i}`:"",p=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:a,hostname:l,hash:c,search:u,searchParams:ne(p),query:p,pathname:f,path:`${f}${u}`,href:e}},se=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,a=n?`${n}@`:"",l=oe(i),c=l?`?${l}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${a}${r}${o}${c}${u}`},ae=(e,t)=>{const n=ie(e);return Object.assign(n.searchParams,t),se(n)};function le(e,t,n){let r=document.createElement("a");r.download=t,r.style.display="none",r.href=e,document.body.appendChild(r),r.click(),setTimeout((()=>{document.body.removeChild(r),r=null,F(n)&&n()}))}function ce(e,t,n){const r=URL.createObjectURL(e);le(r,t),setTimeout((()=>{URL.revokeObjectURL(r),F(n)&&n()}))}function ue(){return!!document.createElement("canvas").getContext}function de({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r}){let o=n,i=r;return(n>e||r>t)&&(n/r>e/t?(o=e,i=Math.round(e*(r/n))):(i=t,o=Math.round(t*(n/r)))),{width:o,height:i}}function fe(e){return"undefined"!=typeof globalThis?globalThis[e]:"undefined"!=typeof window?window[e]:"undefined"!=typeof global?global[e]:"undefined"!=typeof self?self[e]:void 0}const he=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),pe=`${L}${U}${B}`;const ge=`${L}${U}${B}`,me="undefined"!=typeof BigInt,ye=()=>fe("JSBI"),be=e=>me?BigInt(e):ye().BigInt(e);function we(e,t=ge){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!me)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=be(e);const r=[],{length:o}=t,i=be(o),s=()=>{const e=Number(((e,t)=>me?e%t:ye().remainder(e,t))(n,i));n=((e,t)=>me?e/t:ye().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const xe=(e,t,n={ratio:1e3,decimals:0,separator:" "})=>{const{ratio:r=1e3,decimals:o=0,separator:i=" "}=n,{length:s}=t;if(0===s)throw new Error("At least one unit is required");let a=Number(e),l=0;for(;a>=r&&l<s-1;)a/=r,l++;const c=a.toFixed(o),u=t[l];return String(c)+i+u};function Se(e,t){if(A(t))return parseInt(String(e)).toLocaleString();let n=0;if(!w(t))throw new Error("Decimals must be a positive number not less than zero");return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let Ae=0,Ee=0;const ve=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==Ee&&(Ee=t,Ae=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${he(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(Ae,5);return Ae++,`${n}${r}${i}`},Fe=e=>e[he(0,e.length-1)];function Ce(e,t,n){let r=250,o=13;const i=e.children[0];_(t,12)<230?(i.style.maxWidth=_(t,12)+20+50+"px",r=n.clientX+(_(t,12)+50)-document.body.offsetWidth):(i.style.maxWidth="250px",r=n.clientX+230-document.body.offsetWidth),i.innerHTML=t,r>0&&(o-=r),e.style.top=n.clientY+23+"px",e.style.left=n.clientX+o+"px",e.style.maxWidth="250px";const s=e.getBoundingClientRect().top+i.offsetHeight-document.body.offsetHeight;s>0&&(e.style.top=n.clientY-s+"px")}const $e={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=y(e)?document.querySelector(e):e;if(!i)throw new Error(`${e} is not valid Html Element or element selector`);let s=null;const a="style-tooltip-inner1494304949567";if(!document.querySelector(`#${a}`)){const e=document.createElement("style");e.type="text/css",e.id=a,e.innerHTML=`\n .tooltip-inner1494304949567 {\n max-width: 250px;\n padding: 3px 8px;\n color: ${o};\n text-decoration: none;\n border-radius: 4px;\n text-align: left;\n background-color: ${r};\n }\n `,document.querySelector("head").appendChild(e)}if(s=document.querySelector("#customTitle1494304949567"),s)Ce(s,t,n);else{const e=document.createElement("div");e.id="customTitle1494304949567",e.style.cssText="z-index: 99999999; visibility: hidden; position: absolute;",e.innerHTML='<div class="tooltip-inner1494304949567" style="word-wrap: break-word; max-width: 44px;">皮肤</div>',i.appendChild(e),s=document.querySelector("#customTitle1494304949567"),t&&(Ce(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=y(e)?document.querySelector(e):e;let n=document.querySelector("#customTitle1494304949567");t&&n&&(t.removeChild(n),n=null)}},Te={keyField:"key",childField:"children",pidField:"pid"},Re={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};const Ne=(e,t)=>{let n=0;const r=e.toString(),o=t.toString();return void 0!==r.split(".")[1]&&(n+=r.split(".")[1].length),void 0!==o.split(".")[1]&&(n+=o.split(".")[1].length),Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},Ie=(e,t)=>{let n=0,r=0,o=0;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{r=t.toString().split(".")[1].length}catch(e){r=0}return o=10**Math.max(n,r),(Ne(e,o)+Ne(t,o))/o};const je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",De=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function Pe(e){let t,n,r,o,i="",s=0;const a=(e=String(e)).length,l=a%3;for(;s<a;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");t=n<<16|r<<8|o,i+=je.charAt(t>>18&63)+je.charAt(t>>12&63)+je.charAt(t>>6&63)+je.charAt(63&t)}return l?i.slice(0,l-3)+"===".substring(l):i}function ke(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!De.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");let t,n,r,o="",i=0;for(const s=(e+="==".slice(2-(3&e.length))).length;i<s;)t=je.indexOf(e.charAt(i++))<<18|je.indexOf(e.charAt(i++))<<12|(n=je.indexOf(e.charAt(i++)))<<6|(r=je.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}const Me=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Oe=/^(?:(?:\+|00)86)?1\d{10}$/,Le=/^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1]|8[1-2]|9[1])\d{4}(18|19|20)\d{2}[01]\d[0123]\d{4}[\dxX]$/,Be=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Ue=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,He=/^(?:(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,ze=/^(([\da-fA-F]{1,4}:){7}[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,7}:|([\da-fA-F]{1,4}:){1,6}:[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,5}(:[\da-fA-F]{1,4}){1,2}|([\da-fA-F]{1,4}:){1,4}(:[\da-fA-F]{1,4}){1,3}|([\da-fA-F]{1,4}:){1,3}(:[\da-fA-F]{1,4}){1,4}|([\da-fA-F]{1,4}:){1,2}(:[\da-fA-F]{1,4}){1,5}|[\da-fA-F]{1,4}:((:[\da-fA-F]{1,4}){1,6})|:((:[\da-fA-F]{1,4}){1,7}|:)|fe80:(:[\da-fA-F]{0,4}){0,4}%[\da-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d)|([\da-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d))$/i,We=/^(-?[1-9]\d*|0)$/,qe=e=>We.test(e),_e=/^-?([1-9]\d*|0)\.\d*[1-9]$/,Ge=e=>_e.test(e),Ye=/^\d+$/;function Ve(e){return[...new Set(e.trim().split(""))].join("")}function Xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(e,t){return new RegExp(`${Xe(e.trim())}\\s*([^${Xe(Ve(e))}${Xe(Ve(t))}\\s]*)\\s*${t.trim()}`,"g")}e.EMAIL_REGEX=Me,e.HEX_POOL=ge,e.HTTP_URL_REGEX=Ue,e.IPV4_REGEX=He,e.IPV6_REGEX=ze,e.PHONE_REGEX=Oe,e.STRING_ARABIC_NUMERALS=L,e.STRING_LOWERCASE_ALPHA=B,e.STRING_POOL=pe,e.STRING_UPPERCASE_ALPHA=U,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Be,e.add=Ie,e.addClass=function(e,t){W(t,(t=>e.classList.add(t)))},e.arrayEach=t,e.arrayEachAsync=async function(e,t,n=!1){if(n)for(let n=e.length-1;n>=0&&!1!==await t(e[n],n);n--);else for(let n=0,r=e.length;n<r&&!1!==await t(e[n],n);n++);},e.arrayInsertBefore=function(e,t,n){if(t===n||t+1===n)return;const[r]=e.splice(t,1),o=n<t?n:n-1;e.splice(o,0,r)},e.arrayLike=g,e.arrayRemove=function(e,n){const r=[],o=n;return t(e,((e,t)=>{o(e,t)&&r.push(t)})),r.forEach(((t,n)=>{e.splice(t-n,1)})),e},e.asyncMap=function(e,t,n=1/0){return new Promise(((r,o)=>{const i=e[Symbol.iterator](),s=Math.min(e.length,n),a=[];let l,c=0,u=0;const d=()=>{if(l)return o(l);const n=i.next();if(n.done)return void(c===e.length&&r(a));const s=u++;t(n.value,s,e).then((e=>{c++,a[s]=e,d()})).catch((e=>{l=e,d()}))};for(let e=0;e<s;e++)d()}))},e.b64decode=function(e){const t=A(fe("atob"))?ke(e):fe("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return A(fe("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(fe("TextDecoder"))("utf-8").decode(r)},e.b64encode=function(e){const t=A(fe("TextEncoder"))?function(e){const t=encodeURIComponent(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e):(new(fe("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return A(fe("btoa"))?Pe(n):fe("btoa")(n)},e.calculateDate=function(e,t,n="-"){const r=new Date(e),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()+864e5*parseInt(String(t)),i=new Date(o);return i.getFullYear()+n+String(i.getMonth()+1).padStart(2,"0")+"-"+String(i.getDate()).padStart(2,"0")},e.calculateDateTime=function(e,t,n="-",r=":"){const o=new Date(e),i=n,s=r,a=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),l=new Date(a);return l.getFullYear()+i+String(l.getMonth()+1).padStart(2,"0")+i+String(l.getDate()).padStart(2,"0")+" "+String(l.getHours()).padStart(2,"0")+s+String(l.getMinutes()).padStart(2,"0")+s+String(l.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){let n=document.createElement("input");n.setAttribute("id",String(Date.now())),n.setAttribute("type","file"),n.setAttribute("style","visibility:hidden"),n.setAttribute("accept",e),document.body.appendChild(n),n.click(),n.onchange=e=>{t(e.target.files),setTimeout((()=>{document.body.removeChild(n),n=null}))}},e.cloneDeep=function e(t,n=new WeakMap){if(null===t||"object"!=typeof t)return t;if(n.has(t))return n.get(t);if(t instanceof ArrayBuffer){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),n.set(t,e),e}if(ArrayBuffer.isView(t)){return new(0,t.constructor)(e(t.buffer,n),t.byteOffset,t.length)}if(t instanceof Date){const e=new Date(t.getTime());return n.set(t,e),e}if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,n.set(t,e),e}if(t instanceof Map){const r=new Map;return n.set(t,r),t.forEach(((t,o)=>{r.set(e(o,n),e(t,n))})),r}if(t instanceof Set){const r=new Set;return n.set(t,r),t.forEach((t=>{r.add(e(t,n))})),r}if(Array.isArray(t)){const r=new Array(t.length);n.set(t,r);for(let o=0,i=t.length;o<i;o++)o in t&&(r[o]=e(t[o],n));const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o))Object.defineProperty(r,t,{...o[t],value:e(o[t].value,n)});return r}const r=Object.create(Object.getPrototypeOf(t));n.set(t,r);const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o)){const i=o[t];"value"in i?i.value=e(i.value,n):(i.get&&(i.get=e(i.get,n)),i.set&&(i.set=e(i.set,n))),Object.defineProperty(r,t,i)}return r},e.compressImg=function e(t,n={mime:"image/jpeg",minFileSizeKB:50}){if(!(t instanceof File||t instanceof FileList))throw new Error(`${t} require be File or FileList`);if(!ue())throw new Error("Current runtime environment not support Canvas");const{quality:r,mime:o="image/jpeg",maxSize:i,minFileSizeKB:s=50}=E(n)?n:{};let a,l=r;if(r)l=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));l=e<s?1:e<1024?.85:e<5120?.8:.75}return w(i)&&(a=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:a,mime:o,quality:l})))):t instanceof File?new Promise((e=>{const n=[...t.name.split(".").slice(0,-1),{"image/webp":"webp","image/jpeg":"jpg","image/png":"png"}[o]].join("."),r=+parseInt((t.size/1024).toFixed(2));if(r<s)e({file:t});else{const i=new FileReader;i.onload=({target:{result:i}})=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),u=c.getContext("2d"),d=s.width,f=s.height,{width:h,height:p}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(w(t)){const{width:e,height:s}=de({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:a}=de({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<5120){const e=1400,t=1400,{width:s,height:a}=de({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<10240){const e=1600,t=1600,{width:s,height:a}=de({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:a}=de({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}return{width:o,height:i}}({sizeKB:r,maxSize:a,originWidth:d,originHeight:f});c.width=h,c.height=p,u.clearRect(0,0,h,p),u.drawImage(s,0,0,h,p);const g=c.toDataURL(o,l),m=atob(g.split(",")[1]);let y=m.length;const b=new Uint8Array(new ArrayBuffer(y));for(;y--;)b[y]=m.charCodeAt(y);const x=new File([b],n,{type:o});e({file:x,bufferArray:b,origin:t,beforeSrc:i,afterSrc:g,beforeKB:r,afterKB:Number((x.size/1024).toFixed(2))})},s.src=i},i.readAsDataURL(t)}})):Promise.resolve(null)},e.cookieDel=e=>V(e,"",-1),e.cookieGet=function(e){const{cookie:t}=document;if(!t)return"";const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t],[o,i=""]=r.split("=");if(o===e)return decodeURIComponent(i)}return""},e.cookieSet=V,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=A(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{F(n)&&n()})).catch((n=>{Y(e,t)})):Y(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=A(n)?{successCode:200,successCallback:void 0,failCallback:void 0}:n,s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(){if(s.status===r)ce(s.response,t,o);else if(F(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(y(t)&&t.includes("application/json")){const t=new FileReader;t.onload=()=>{i({status:e,response:t.result})},t.readAsText(s.response)}else i(s)}},s.onerror=e=>{F(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=Z,e.dateToEnd=function(e){const t=Q(e);return t.setDate(t.getDate()+1),Z(t.getTime()-1)},e.dateToStart=Q,e.debounce=(e,t)=>{let n,r=!1;const o=function(...o){r||(clearTimeout(n),n=setTimeout((()=>{e.call(this,...o)}),t))};return o.cancel=()=>{clearTimeout(n),r=!0},o},e.divide=(e,t)=>{let n=0,r=0,o=0,i=0;return void 0!==e.toString().split(".")[1]&&(n=e.toString().split(".")[1].length),void 0!==t.toString().split(".")[1]&&(r=t.toString().split(".")[1].length),o=Number(e.toString().replace(".","")),i=Number(t.toString().replace(".","")),o/i*Math.pow(10,r-n)},e.downloadBlob=ce,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){ce(new Blob([JSON.stringify(e,null,4)]),n)}else{if(!r||!r.length)throw new Error("未传入表头数据");if(!Array.isArray(e))throw new Error("data error! expected array!");const o=r.join(",")+"\n";let i="";e.forEach((e=>{i+=Object.values(e).join(",\t")+",\n"}));le("data:"+{csv:"text/csv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}[t]+";charset=utf-8,\ufeff"+encodeURIComponent(o+i),n)}},e.downloadHref=le,e.downloadURL=function(e,t){window.open(t?ae(e,t):e)},e.easingFunctional=I,e.easingStringify=function(e){let t;if(v(e))t=e;else{const n=N[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=n}return`cubic-bezier(${t.join(",")})`},e.escapeRegExp=Xe,e.executeInScope=function(e,t={}){const n=Object.keys(t),r=n.map((e=>t[e]));try{return new Function(...n,`return (() => { ${e} })()`)(...r)}catch(e){throw new Error(`代码执行失败: ${e.message}`)}},e.fallbackCopyText=Y,e.flatTree=function e(t,n=Te){const{keyField:r="key",childField:o="children",pidField:i="pid"}=E(n)?n:{};let s=[];for(let a=0,l=t.length;a<l;a++){const l=t[a],c={...l,[o]:[]};if(p(c,o)&&delete c[o],s.push(c),l[o]){const t=l[o].map((e=>({...e,[i]:l[r]||e.pid})));s=s.concat(e(t,n))}}return s},e.forEachDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const{childField:r="children",reverse:o=!1,breadthFirst:i=!1,isDomNode:s=!1}=E(n)?n:{};let a=!1;const l=[],c=(n,o,u=0)=>{for(let d=n.length-1;d>=0&&!a;d--){const f=n[d];if(i)l.push({item:f,index:d,array:n,tree:e,parent:o,level:u});else{const i=t(f,d,n,e,o,u);if(!1===i){a=!0;break}if(!0===i)continue;f&&(s?R(f[r]):Array.isArray(f[r]))&&c(f[r],f,u+1)}}if(i)for(;l.length>0&&!a;){const e=l.shift(),{item:n,index:o,array:i,tree:u,parent:d,level:f}=e,h=t(n,o,i,u,d,f);if(!1===h){a=!0;break}!0!==h&&(n&&(s?R(n[r]):Array.isArray(n[r]))&&c(n[r],n,f+1))}},u=(n,o,c=0)=>{for(let d=0,f=n.length;d<f&&!a;d++){const f=n[d];if(i)l.push({item:f,index:d,array:n,tree:e,parent:o,level:c});else{const i=t(f,d,n,e,o,c);if(!1===i){a=!0;break}if(!0===i)continue;f&&(s?R(f[r]):Array.isArray(f[r]))&&u(f[r],f,c+1)}}if(i)for(;l.length>0&&!a;){const e=l.shift();if(!e)break;const{item:n,index:o,array:i,tree:c,parent:d,level:f}=e,h=t(n,o,i,c,d,f);if(!1===h){a=!0;break}!0!==h&&(n&&(s?R(n[r]):Array.isArray(n[r]))&&u(n[r],n,f+1))}};o?c(e,null,0):u(e,null,0),e=null},e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=Z(e);let r,o=t;const i={"Y+":`${n.getFullYear()}`,"y+":`${n.getFullYear()}`,"M+":`${n.getMonth()+1}`,"D+":`${n.getDate()}`,"d+":`${n.getDate()}`,"H+":`${n.getHours()}`,"m+":`${n.getMinutes()}`,"s+":`${n.getSeconds()}`,"S+":`${n.getMilliseconds()}`,"w+":["周日","周一","周二","周三","周四","周五","周六"][n.getDay()]};for(const e in i)r=new RegExp("("+e+")").exec(o),r&&(o=o.replace(r[1],1===r[1].length?i[e]:i[e].padStart(r[1].length,"0")));return o},e.formatMoney=Se,e.formatNumber=Se,e.formatTree=function(e,t=Te){const{keyField:n="key",childField:r="children",pidField:o="pid"}=E(t)?t:{},i=[],s={};for(let t=0,r=e.length;t<r;t++){const r=e[t];s[r[n]]=r}for(let t=0,n=e.length;t<n;t++){const n=e[t],a=s[n[o]];a?(a[r]||(a[r]=[])).push(n):i.push(n)}return e=null,i},e.fuzzySearchTree=function e(t,n,r=Re){if(!p(n,"filter")&&(!p(n,"keyword")||T(n.keyword)))return t;const o=[];for(let i=0,s=t.length;i<s;i++){const s=t[i],a=s[r.childField]&&s[r.childField].length>0?e(s[r.childField]||[],n,r):[];if((p(n,"filter")?n.filter(s):r.ignoreCase?s[r.nameField].toLowerCase().includes(n.keyword.toLowerCase()):s[r.nameField].includes(n.keyword))||a.length>0)if(s[r.childField])if(a.length>0)o.push({...s,[r.childField]:a});else if(r.removeEmptyChild){const{[r.childField]:e,...t}=s;o.push(t)}else o.push({...s,[r.childField]:[]});else{const{[r.childField]:e,...t}=s;o.push(t)}}return o},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="middle",font:l="20px PingFangSC-Medium,PingFang SC",fillStyle:c="rgba(189, 177, 167, .3)",rotate:u=-20,zIndex:d=2147483647,watermarkId:f="__wm"}=A(n)?{}:n,h=y(r)?document.querySelector(r):r;if(!h)throw new Error(`${r} is not valid Html Element or element selector`);const p=document.createElement("canvas");p.setAttribute("width",o),p.setAttribute("height",i);const g=p.getContext("2d");g.textAlign=s,g.textBaseline=a,g.font=l,g.fillStyle=c,g.rotate(Math.PI/180*u),g.fillText(t,parseFloat(o)/4,parseFloat(i)/2);const m=p.toDataURL(),b=document.querySelector(`#${f}`),w=b||document.createElement("div"),x=`opacity: 1 !important; display: block !important; visibility: visible !important; position:absolute; left:0; top:0; width:100%; height:100%; z-index:${d}; pointer-events:none; background-repeat:repeat; background-image:url('${m}')`;w.setAttribute("style",x),w.setAttribute("id",f),w.classList.add("nav-height"),b||(h.style.position="relative",h.appendChild(w));const S=window.MutationObserver||window.WebKitMutationObserver;if(S){let r=new S((function(){let o=document.querySelector(`#${f}`);if(o){const{opacity:i,zIndex:s,display:a,visibility:l}=(e=>{const t=getComputedStyle(e);return{opacity:t.getPropertyValue("opacity"),zIndex:t.getPropertyValue("z-index"),display:t.getPropertyValue("display"),visibility:t.getPropertyValue("visibility")}})(o);(o&&o.getAttribute("style")!==x||!o||"1"!==i||"2147483647"!==s||"block"!==a||"visible"!==l)&&(r.disconnect(),r=null,h.removeChild(o),o=null,e(t,n))}else r.disconnect(),r=null,e(t,n)}));r.observe(h,{attributes:!0,subtree:!0,childList:!0})}},e.getComputedCssVal=function(e,t,n=!0){const r=getComputedStyle(e).getPropertyValue(t)??"";return n?Number(r.replace(/([0-9]*)(.*)/g,"$1")):r},e.getEasing=function(e){return e?N[e]:N},e.getGlobal=fe,e.getStrWidthPx=_,e.getStyle=function(e,t){return getComputedStyle(e).getPropertyValue(t)},e.hasClass=function(e,t){if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},e.humanFileSize=function(e,t={decimals:0,si:!1,separator:" "}){const{decimals:n=0,si:r=!1,separator:o=" ",baseUnit:i,maxUnit:s}=t;let a=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!A(i)){const e=a.findIndex((e=>e===i));-1!==e&&(a=a.slice(e))}if(!A(s)){const e=a.findIndex((e=>e===s));-1!==e&&a.splice(e+1)}return xe(e,a,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=v,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=b,e.isDate=$,e.isDigit=e=>Ye.test(e),e.isEmail=e=>Me.test(e),e.isEmpty=T,e.isError=e=>"Error"===m(e),e.isFloat=Ge,e.isFunction=F,e.isIdNo=e=>{if(!Le.test(e))return!1;const t=Number(e.slice(6,10)),n=Number(e.slice(10,12)),r=Number(e.slice(12,14)),o=new Date(t,n-1,r);if(!(o.getFullYear()===t&&o.getMonth()+1===n&&o.getDate()===r))return!1;const i=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let s=0;for(let t=0;t<17;t++)s+=Number(e.slice(t,t+1))*i[t];return["1","0","X","9","8","7","6","5","4","3","2"][s%11]===e.slice(-1)},e.isInteger=qe,e.isIpV4=e=>He.test(e),e.isIpV6=e=>ze.test(e),e.isJsonString=function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&t}catch(e){return!1}},e.isNaN=C,e.isNodeList=R,e.isNull=S,e.isNullOrUnDef=A,e.isNullish=A,e.isNumber=w,e.isNumerical=e=>qe(e)||Ge(e),e.isObject=E,e.isPhone=e=>Oe.test(e),e.isPlainObject=j,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===m(e),e.isString=y,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=x,e.isUrl=(e,t=!1)=>(t?Be:Ue).test(e),e.isValidDate=X,e.mapDeep=function(e,t,n={childField:"children",reverse:!1}){const{childField:r="children",reverse:o=!1}=E(n)?n:{};let i=!1;const s=[],a=(n,s,l,c=0)=>{if(o)for(let o=n.length-1;o>=0&&!i;o--){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(l.push(P(d,[r])),u&&Array.isArray(u[r])?(l[l.length-1][r]=[],a(u[r],u,l[l.length-1][r],c+1)):delete d[r])}else for(let o=0;o<n.length&&!i;o++){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(l.push(P(d,[r])),u&&Array.isArray(u[r])?(l[l.length-1][r]=[],a(u[r],u,l[l.length-1][r],c+1)):delete d[r])}};return a(e,null,s),e=null,s},e.multiply=Ne,e.numberAbbr=xe,e.numberToHex=we,e.objectAssign=M,e.objectEach=D,e.objectEachAsync=async function(e,t){for(const n in e)if(p(e,n)&&!1===await t(e[n],n))break},e.objectFill=function(e,t,n){const r=n||((e,t,n)=>void 0===e[n]);return D(t,((n,o)=>{r(e,t,o)&&(e[o]=n)})),e},e.objectGet=function(e,t,n=!1){const r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");let o=e,i=0;for(let e=r.length;i<e-1;++i){const e=r[i];if(w(Number(e))&&Array.isArray(o))o=o[e];else{if(!E(o)||!p(o,e)){if(o=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}o=o[e]}}return{p:o,k:o?r[i]:void 0,v:o?o[r[i]]:void 0}},e.objectHas=p,e.objectMap=function(e,t){const n={};for(const r in e)p(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=M,e.objectOmit=P,e.objectPick=function(e,t){const n={};return D(e,((e,r)=>{t.includes(r)&&(n[r]=e)})),e=null,n},e.once=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.call(this,...r)),t}},e.parseQueryParams=function(e=location.search){const t={};return Array.from(e.matchAll(/[&?]?([^=&]+)=?([^=&]*)/g)).forEach(((e,n)=>{t[e[1]]?"string"==typeof t[e[1]]?t[e[1]]=[t[e[1]],e[2]]:t[e[1]].push(e[2]):t[e[1]]=e[2]})),t},e.parseVarFromString=function(e,t="{",n="}"){return Array.from(e.matchAll(Je(t,n))).map((e=>A(e)?void 0:e[1]))},e.pathJoin=te,e.pathNormalize=ee,e.qsParse=ne,e.qsStringify=oe,e.randomNumber=he,e.randomString=(e,t)=>{let n=0,r=pe;y(t)?(n=e,r=t):w(e)?n=e:y(e)&&(r=e);let o=Math.max(n,1),i="";const s=r.length-1;if(s<2)throw new Error("字符串池长度不能少于 2");for(;o--;){i+=r[he(0,s)]}return i},e.randomUuid=function(){if("undefined"==typeof URL||!URL.createObjectURL||"undefined"==typeof Blob){const e="0123456789abcdef",t="xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx";let n="";for(let r=0;r<t.length;r++){const o=he(0,15);n+="-"==t[r]||"4"==t[r]?t[r]:e[o]}return n}return/[^/]+$/.exec(URL.createObjectURL(new Blob).slice())[0]},e.removeClass=function(e,t){W(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Je(n,r)),(function(e,n){return p(t,n)?t[n]:e}))},e.safeAwait=function(e,t){return e.then((e=>[null,e])).catch((e=>{if(t){return[Object.assign({},e,t),void 0]}return[e,void 0]}))},e.searchTreeById=function(e,t,n={childField:"children",keyField:"id"}){const{childField:r="children",keyField:o="id"}=E(n)?n:{},i=(e,t,n)=>e.reduce(((e,s)=>{const a=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...a&&a.length?i(a,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let a=[t],l=[s];for(;n&&n.parentId;)a=[n.parentId,...a],l=[n.parent,...l],n=e.find((e=>e[o]===n.parentId));return[a,l]})(i(e))},e.select=G,e.setEasing=function(e,t){N[e]=t},e.setGlobal=function(e,t){if("undefined"!=typeof globalThis)globalThis[e]=t;else if("undefined"!=typeof window)window[e]=t;else if("undefined"!=typeof global)global[e]=t;else{if("undefined"==typeof self)throw new SyntaxError("当前环境下无法设置全局属性");self[e]=t}},e.setStyle=q,e.smoothScroll=function(e){return new Promise((n=>{const r={el:document,to:0,duration:567,easing:"ease"},{el:o,to:i,duration:s,easing:a}=M(r,e),l=document.documentElement,c=document.body,u=o===window||o===document||o===l||o===c?[l,c]:[o];let d;const f=(()=>{let e=0;return t(u,(t=>{if("scrollTop"in t)return e=t.scrollTop,!1})),e})(),h=i-f,p=I(a),g=()=>{const e=performance.now(),t=(d?e-d:0)/s,r=p(t);var o;d||(d=e),o=f+h*r,u.forEach((e=>{"scrollTop"in e&&(e.scrollTop=o)})),t>=1?n():requestAnimationFrame(g)};g()}))},e.stringAssign=(e,t)=>e.replace(z,((e,n)=>((e,t)=>{try{return new Function(`with(arguments[0]){if(arguments[0].${e} === undefined)throw "";return String(arguments[0].${e})}`)(t)}catch(t){throw new SyntaxError(`无法执行表达式:${e}`)}})(n,t))),e.stringCamelCase=function(e,t){let n=e;return t&&(n=e.replace(/^./,(e=>e.toUpperCase()))),n.replace(/[\s_-](.)/g,((e,t)=>t.toUpperCase()))},e.stringEscapeHtml=e=>{const t={"&":"&","<":"<",">":">",'"':"""};return e.replace(/[&<>"]/g,(e=>t[e]))},e.stringFill=(e,t=" ")=>new Array(e).fill(t).join(""),e.stringFormat=function(e,...t){let n=0;return[e.replace(H,(e=>{const r=t[n++];switch(e){case"%%":return n--,"%";default:case"%s":return String(r);case"%d":return String(Number(r));case"%o":return JSON.stringify(r)}})),...t.splice(n).map(String)].join(" ")},e.stringKebabCase=O,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>Ie(e,-t),e.supportCanvas=ue,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const a=Date.now(),l=()=>{i=a,e.call(this,...s)};if(0===i)return n?l():void(i=a);i+t-a>0?(clearTimeout(r),r=setTimeout((()=>l()),t)):l()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=$e,e.typeIs=m,e.uniqueNumber=ve,e.uniqueString=(e,t)=>{let n=0,r=ge;y(t)?(n=e,r=t):w(e)?n=e:y(e)&&(r=e);let o=we(ve(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=Fe(r);return o},e.uniqueSymbol=Ve,e.urlDelParams=(e,t)=>{const n=ie(e);return t.forEach((e=>delete n.searchParams[e])),se(n)},e.urlParse=ie,e.urlSetParams=ae,e.urlStringify=se,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=ke,e.weBtoa=Pe}));
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).sculpJs={})}(this,(function(e){"use strict";function t(e,t,n=!1){if(n)for(let n=e.length-1;n>=0;n--){const r=t(e[n],n,e);if(!1===r)break}else for(let n=0,r=e.length;n<r;n++){const r=t(e[n],n,e);if(!1===r)break}e=null}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var r=.1,o="function"==typeof Float32Array;function i(e,t){return 1-3*t+3*e}function s(e,t){return 3*t-6*e}function a(e){return 3*e}function l(e,t,n){return((i(t,n)*e+s(t,n))*e+a(t))*e}function c(e,t,n){return 3*i(t,n)*e*e+2*s(t,n)*e+a(t)}function u(e){return e}var d=n((function(e,t,n,i){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===i)return u;for(var s=o?new Float32Array(11):new Array(11),a=0;a<11;++a)s[a]=l(a*r,e,n);function d(t){for(var o=0,i=1;10!==i&&s[i]<=t;++i)o+=r;--i;var a=o+(t-s[i])/(s[i+1]-s[i])*r,u=c(a,e,n);return u>=.001?function(e,t,n,r){for(var o=0;o<4;++o){var i=c(t,n,r);if(0===i)return t;t-=(l(t,n,r)-e)/i}return t}(t,a,e,n):0===u?a:function(e,t,n,r,o){var i,s,a=0;do{(i=l(s=t+(n-t)/2,r,o)-e)>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<10);return s}(t,o,o+r,e,n)}return function(e){return 0===e?0:1===e?1:l(d(e),t,i)}}));const{toString:f,hasOwnProperty:h}=Object.prototype;function p(e,t){return h.call(e,t)}function g(e){return!!E(e)||(!!y(e)||!!v(e)&&p(e,"length"))}function m(e){return f.call(e).slice(8,-1)}const y=e=>"string"==typeof e,b=e=>"boolean"==typeof e,w=e=>"number"==typeof e&&!Number.isNaN(e),x=e=>void 0===e,S=e=>null===e;function A(e){return x(e)||S(e)}const v=e=>"Object"===m(e),E=e=>Array.isArray(e),F=e=>"function"==typeof e,C=e=>Number.isNaN(e),$=e=>"Date"===m(e);function T(e){return!x(NodeList)&&NodeList.prototype.isPrototypeOf(e)}const N={linear:[0,0,1,1],ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]};function R(e){let t;if(E(e))t=d(...e);else{const n=N[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=d(...n)}return e=>t(Math.max(0,Math.min(e,1)))}const P=e=>{if(!v(e))return!1;const t=Object.getPrototypeOf(e);return!t||t===Object.prototype};function k(e,t){for(const n in e)if(p(e,n)&&!1===t(e[n],n))break;e=null}function D(e,t){const n={};return k(e,((e,r)=>{t.includes(r)||(n[r]=e)})),e=null,n}const j=(e,t,n)=>{if(x(n))return t;if(m(t)!==m(n))return E(n)?j(e,[],n):v(n)?j(e,{},n):n;if(P(n)){const r=e.get(n);return r||(e.set(n,t),k(n,((n,r)=>{t[r]=j(e,t[r],n)})),t)}if(E(n)){const r=e.get(n);return r||(e.set(n,t),n.forEach(((n,r)=>{t[r]=j(e,t[r],n)})),t)}return n};function I(e,...t){const n=new Map;for(let r=0,o=t.length;r<o;r++){const o=t[r];e=j(n,e,o)}return n.clear(),e}function M(e,t="-"){return e.replace(/^./,(e=>e.toLowerCase())).replace(/[A-Z]/g,(e=>`${t}${e.toLowerCase()}`))}const L="0123456789",O="abcdefghijklmnopqrstuvwxyz",B="ABCDEFGHIJKLMNOPQRSTUVWXYZ",U=/%[%sdo]/g;const H=/\${(.*?)}/g;const q=(e,t)=>{e.split(/\s+/g).forEach(t)};const z=(e,t,n)=>{v(t)?k(t,((t,n)=>{z(e,n,t)})):e.style.setProperty(M(t),n)};function W(e,t=14,n=!0){let r=0;if(console.assert(y(e),`${e} 不是有效的字符串`),y(e)&&e.length>0){const o="getStrWidth1494304949567";let i=document.querySelector(`#${o}`);if(!i){const n=document.createElement("span");n.id=o,n.style.fontSize=t+"px",n.style.whiteSpace="nowrap",n.style.visibility="hidden",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.textContent=e,document.body.appendChild(n),i=n}i.textContent=e,r=i.offsetWidth,n&&i.remove()}return r}function _(e){let t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){const n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();const n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}function G(e,t){const{successCallback:n,failCallback:r,container:o=document.body}=A(t)?{}:t;let i=function(e){const t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";const r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top=`${r}px`,n.setAttribute("readonly",""),n.value=e,n}(e);o.appendChild(i),_(i);try{document.execCommand("copy")&&F(n)&&n()}catch(e){F(r)&&r(e)}finally{o.removeChild(i),i=null,window.getSelection()?.removeAllRanges()}}function Y(e,t,n){const r=[],o="expires";if(r.push([e,encodeURIComponent(t)]),w(n)){const e=new Date;e.setTime(e.getTime()+n),r.push([o,e.toUTCString()])}else $(n)&&r.push([o,n.toUTCString()]);r.push(["path","/"]),document.cookie=r.map((e=>{const[t,n]=e;return`${t}=${n}`})).join(";")}const V=e=>$(e)&&!C(e.getTime()),X=e=>{if(!y(e))return;const t=e.replace(/-/g,"/");return new Date(t)},J=e=>{if(!y(e))return;const t=/([+-])(\d\d)(\d\d)$/,n=t.exec(e);if(!n)return;const r=e.replace(t,"Z"),o=new Date(r);if(!V(o))return;const[,i,s,a]=n,l=parseInt(s,10),c=parseInt(a,10),u=(e,t)=>"+"===i?e-t:e+t;return o.setHours(u(o.getHours(),l)),o.setMinutes(u(o.getMinutes(),c)),o};function K(e){const t=new Date(e);if(V(t))return t;const n=X(e);if(V(n))return n;const r=J(e);if(V(r))return r;throw new SyntaxError(`${e.toString()} 不是一个合法的日期描述`)}function Z(e){const t=K(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)}const Q=e=>{const t=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/").replace(/\.{3,}/g,"..").replace(/\/\.\//g,"/").split("/").map((e=>e.trim())),n=e=>".."===e,r=[];let o=!1;const i=e=>{r.push(e)};return t.forEach((e=>{const t=(e=>"."===e)(e),s=n(e);return o?t?void 0:s?(()=>{if(0===r.length)return;const e=r[r.length-1];n(e)?r.push(".."):r.pop()})():void i(e):(i(e),void(o=!t&&!s))})),r.join("/")},ee=(e,...t)=>Q([e,...t].join("/"));function te(e){const t=new URLSearchParams(e),n={};for(const[e,r]of t.entries())x(n[e])?n[e]=r:E(n[e])||(n[e]=t.getAll(e));return n}const ne=e=>y(e)?e:w(e)?String(e):b(e)?e?"true":"false":$(e)?e.toISOString():null;function re(e,t=ne){const n=new URLSearchParams;return k(e,((e,r)=>{if(E(e))e.forEach((e=>{const o=t(e);null!==o&&n.append(r.toString(),o)}));else{const o=t(e);if(null===o)return;n.set(r.toString(),o)}})),n.toString()}const oe=(e,t=!0)=>{let n=null;F(URL)&&t?n=new URL(e):(n=document.createElement("a"),n.href=e);const{protocol:r,username:o,password:i,host:s,port:a,hostname:l,hash:c,search:u,pathname:d}=n,f=ee("/",d),h=o&&i?`${o}:${i}`:"",p=u.replace(/^\?/,"");return n=null,{protocol:r,auth:h,username:o,password:i,host:s,port:a,hostname:l,hash:c,search:u,searchParams:te(p),query:p,pathname:f,path:`${f}${u}`,href:e}},ie=e=>{const{protocol:t,auth:n,host:r,pathname:o,searchParams:i,hash:s}=e,a=n?`${n}@`:"",l=re(i),c=l?`?${l}`:"";let u=s.replace(/^#/,"");return u=u?"#"+u:"",`${t}//${a}${r}${o}${c}${u}`},se=(e,t)=>{const n=oe(e);return Object.assign(n.searchParams,t),ie(n)};function ae(e,t,n){let r=document.createElement("a");r.download=t,r.style.display="none",r.href=e,document.body.appendChild(r),r.click(),setTimeout((()=>{document.body.removeChild(r),r=null,F(n)&&n()}))}function le(e,t,n){const r=URL.createObjectURL(e);ae(r,t),setTimeout((()=>{URL.revokeObjectURL(r),F(n)&&n()}))}function ce(){return!!document.createElement("canvas").getContext}function ue({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r}){let o=n,i=r;return(n>e||r>t)&&(n/r>e/t?(o=e,i=Math.round(e*(r/n))):(i=t,o=Math.round(t*(n/r)))),{width:o,height:i}}function de(e){return"undefined"!=typeof globalThis?globalThis[e]:"undefined"!=typeof window?window[e]:"undefined"!=typeof global?global[e]:"undefined"!=typeof self?self[e]:void 0}const fe=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),he=`${L}${B}${O}`;const pe=`${L}${B}${O}`,ge="undefined"!=typeof BigInt,me=()=>de("JSBI"),ye=e=>ge?BigInt(e):me().BigInt(e);function be(e,t=pe){if(t.length<2)throw new Error("进制池长度不能少于 2");if(!ge)throw new Error('需要安装 jsbi 模块并将 JSBI 设置为全局变量:\nimport JSBI from "jsbi"; window.JSBI = JSBI;');let n=ye(e);const r=[],{length:o}=t,i=ye(o),s=()=>{const e=Number(((e,t)=>ge?e%t:me().remainder(e,t))(n,i));n=((e,t)=>ge?e/t:me().divide(e,t))(n,i),r.unshift(t[e]),n>0&&s()};return s(),r.join("")}const we=(e,t,n={ratio:1e3,decimals:0,separator:" "})=>{const{ratio:r=1e3,decimals:o=0,separator:i=" "}=n,{length:s}=t;if(0===s)throw new Error("At least one unit is required");let a=Number(e),l=0;for(;a>=r&&l<s-1;)a/=r,l++;const c=a.toFixed(o),u=t[l];return String(c)+i+u};function xe(e,t){if(A(t))return parseInt(String(e)).toLocaleString();let n=0;return t>0&&(n=t),Number(Number(e).toFixed(n)).toLocaleString("en-US")}let Se=0,Ae=0;const ve=(e=18)=>{const t=Date.now();e=Math.max(e,18),t!==Ae&&(Ae=t,Se=0);const n=`${t}`;let r="";const o=e-5-13;if(o>0){r=`${fe(10**(o-1),10**o-1)}`}const i=((e,t=2)=>String(e).padStart(t,"0"))(Se,5);return Se++,`${n}${r}${i}`},Ee=e=>e[fe(0,e.length-1)];function Fe(e,t,n){let r=250,o=13;const i=e.children[0];W(t,12)<230?(i.style.maxWidth=W(t,12)+20+50+"px",r=n.clientX+(W(t,12)+50)-document.body.offsetWidth):(i.style.maxWidth="250px",r=n.clientX+230-document.body.offsetWidth),i.innerHTML=t,r>0&&(o-=r),e.style.top=n.clientY+23+"px",e.style.left=n.clientX+o+"px",e.style.maxWidth="250px";const s=e.getBoundingClientRect().top+i.offsetHeight-document.body.offsetHeight;s>0&&(e.style.top=n.clientY-s+"px")}const Ce={handleMouseEnter:function({rootContainer:e="#root",title:t,event:n,bgColor:r="#000",color:o="#fff"}){try{const i=y(e)?document.querySelector(e):e;if(!i)throw new Error(`${e} is not valid Html Element or element selector`);let s=null;const a="style-tooltip-inner1494304949567";if(!document.querySelector(`#${a}`)){const e=document.createElement("style");e.type="text/css",e.id=a,e.innerHTML=`\n .tooltip-inner1494304949567 {\n max-width: 250px;\n padding: 3px 8px;\n color: ${o};\n text-decoration: none;\n border-radius: 4px;\n text-align: left;\n background-color: ${r};\n }\n `,document.querySelector("head").appendChild(e)}if(s=document.querySelector("#customTitle1494304949567"),s)Fe(s,t,n);else{const e=document.createElement("div");e.id="customTitle1494304949567",e.style.cssText="z-index: 99999999; visibility: hidden; position: absolute;",e.innerHTML='<div class="tooltip-inner1494304949567" style="word-wrap: break-word; max-width: 44px;">皮肤</div>',i.appendChild(e),s=document.querySelector("#customTitle1494304949567"),t&&(Fe(s,t,n),s.style.visibility="visible")}}catch(e){console.error(e.message)}},handleMouseLeave:function(e="#root"){const t=y(e)?document.querySelector(e):e;let n=document.querySelector("#customTitle1494304949567");t&&n&&(t.removeChild(n),n=null)}},$e={keyField:"key",childField:"children",pidField:"pid"},Te={childField:"children",nameField:"name",removeEmptyChild:!1,ignoreCase:!0};function Ne(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const{childField:r="children",reverse:o=!1,breadthFirst:i=!1,isDomNode:s=!1}=v(n)?n:{};let a=!1;const l=[],c=(n,o,u=0)=>{for(let d=n.length-1;d>=0&&!a;d--){const f=n[d];if(i)l.push({item:f,index:d,array:n,tree:e,parent:o,level:u});else{const i=t(f,d,n,e,o,u);if(!1===i){a=!0;break}if(!0===i)continue;f&&(s?T(f[r]):Array.isArray(f[r]))&&c(f[r],f,u+1)}}if(i)for(;l.length>0&&!a;){const e=l.shift(),{item:n,index:o,array:i,tree:u,parent:d,level:f}=e,h=t(n,o,i,u,d,f);if(!1===h){a=!0;break}!0!==h&&(n&&(s?T(n[r]):Array.isArray(n[r]))&&c(n[r],n,f+1))}},u=(n,o,c=0)=>{for(let d=0,f=n.length;d<f&&!a;d++){const f=n[d];if(i)l.push({item:f,index:d,array:n,tree:e,parent:o,level:c});else{const i=t(f,d,n,e,o,c);if(!1===i){a=!0;break}if(!0===i)continue;f&&(s?T(f[r]):Array.isArray(f[r]))&&u(f[r],f,c+1)}}if(i)for(;l.length>0&&!a;){const e=l.shift();if(!e)break;const{item:n,index:o,array:i,tree:c,parent:d,level:f}=e,h=t(n,o,i,c,d,f);if(!1===h){a=!0;break}!0!==h&&(n&&(s?T(n[r]):Array.isArray(n[r]))&&u(n[r],n,f+1))}};o?c(e,null,0):u(e,null,0),e=null}const Re=(e,t)=>{let n=0;const r=e.toString(),o=t.toString();return void 0!==r.split(".")[1]&&(n+=r.split(".")[1].length),void 0!==o.split(".")[1]&&(n+=o.split(".")[1].length),Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},Pe=(e,t)=>{let n=0,r=0,o=0;try{n=e.toString().split(".")[1].length}catch(e){n=0}try{r=t.toString().split(".")[1].length}catch(e){r=0}return o=10**Math.max(n,r),(Re(e,o)+Re(t,o))/o};const ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",De=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;function je(e){let t,n,r,o,i="",s=0;const a=(e=String(e)).length,l=a%3;for(;s<a;){if((n=e.charCodeAt(s++))>255||(r=e.charCodeAt(s++))>255||(o=e.charCodeAt(s++))>255)throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");t=n<<16|r<<8|o,i+=ke.charAt(t>>18&63)+ke.charAt(t>>12&63)+ke.charAt(t>>6&63)+ke.charAt(63&t)}return l?i.slice(0,l-3)+"===".substring(l):i}function Ie(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!De.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");let t,n,r,o="",i=0;for(const s=(e+="==".slice(2-(3&e.length))).length;i<s;)t=ke.indexOf(e.charAt(i++))<<18|ke.indexOf(e.charAt(i++))<<12|(n=ke.indexOf(e.charAt(i++)))<<6|(r=ke.indexOf(e.charAt(i++))),o+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}const Me=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,Le=/^(?:(?:\+|00)86)?1\d{10}$/,Oe=/^(1[1-5]|2[1-3]|3[1-7]|4[1-6]|5[0-4]|6[1-5]|7[1]|8[1-2]|9[1])\d{4}(18|19|20)\d{2}[01]\d[0123]\d{4}[\dxX]$/,Be=/^(https?|ftp):\/\/([^\s/$.?#].[^\s]*)$/i,Ue=/^https?:\/\/([^\s/$.?#].[^\s]*)$/i,He=/^(?:(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,qe=/^(([\da-fA-F]{1,4}:){7}[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,7}:|([\da-fA-F]{1,4}:){1,6}:[\da-fA-F]{1,4}|([\da-fA-F]{1,4}:){1,5}(:[\da-fA-F]{1,4}){1,2}|([\da-fA-F]{1,4}:){1,4}(:[\da-fA-F]{1,4}){1,3}|([\da-fA-F]{1,4}:){1,3}(:[\da-fA-F]{1,4}){1,4}|([\da-fA-F]{1,4}:){1,2}(:[\da-fA-F]{1,4}){1,5}|[\da-fA-F]{1,4}:((:[\da-fA-F]{1,4}){1,6})|:((:[\da-fA-F]{1,4}){1,7}|:)|fe80:(:[\da-fA-F]{0,4}){0,4}%[\da-zA-Z]+|::(ffff(:0{1,4})?:)?((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d)|([\da-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1?\d)?\d)\.){3}(25[0-5]|(2[0-4]|1?\d)?\d))$/i,ze=/^(-?[1-9]\d*|0)$/,We=e=>ze.test(e),_e=/^-?([1-9]\d*|0)\.\d*[1-9]$/,Ge=e=>_e.test(e),Ye=/^\d+$/;function Ve(e){return[...new Set(e.trim().split(""))].join("")}function Xe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Je(e,t){return new RegExp(`${Xe(e.trim())}\\s*([^${Xe(Ve(e))}${Xe(Ve(t))}\\s]*)\\s*${t.trim()}`,"g")}e.ConcurrentExecutor=class{limit;active;queue;results;isStopped;onProgress;onTaskComplete;constructor(e=5){this.limit=e,this.active=new Map,this.queue=[],this.results=[],this.isStopped=!1,this.onProgress=null,this.onTaskComplete=null}add(e,t={}){const n=this.queue.length;return this.queue.push({task:e,meta:t,id:n}),n}addAll(e){return e.map(((e,t)=>this.add(e,{index:t})))}async run(){if(this.isStopped)throw new Error("Executor has been stopped");this.results=new Array(this.queue.length);let e=0;const t=()=>{this.onProgress&&this.onProgress({completed:e,total:this.queue.length,active:this.active.size,percent:e/this.queue.length*100})},n=async r=>{if(this.isStopped)return;const{task:o,id:i,meta:s}=r,a=Promise.resolve().then((()=>o(s)));this.active.set(i,a);try{const e=await a;this.results[i]={status:"fulfilled",value:e}}catch(e){this.results[i]={status:"rejected",reason:e}}finally{if(this.active.delete(i),e++,t(),this.onTaskComplete&&this.onTaskComplete(i,this.results[i]),this.queue.length>0&&!this.isStopped){const e=this.queue.shift();n(e)}}};for(this.queue.splice(0,this.limit).forEach(n);this.active.size>0&&!this.isStopped;)await Promise.race(this.active.values());if(this.isStopped)throw new Error("Execution was stopped");return this.results}stop(){this.isStopped=!0,this.active.clear(),this.queue=[]}clear(){this.queue=[]}},e.EMAIL_REGEX=Me,e.HEX_POOL=pe,e.HTTP_URL_REGEX=Ue,e.IPV4_REGEX=He,e.IPV6_REGEX=qe,e.PHONE_REGEX=Le,e.STRING_ARABIC_NUMERALS=L,e.STRING_LOWERCASE_ALPHA=O,e.STRING_POOL=he,e.STRING_UPPERCASE_ALPHA=B,e.UNIQUE_NUMBER_SAFE_LENGTH=18,e.URL_REGEX=Be,e.add=Pe,e.addClass=function(e,t){q(t,(t=>e.classList.add(t)))},e.arrayEach=t,e.arrayEachAsync=async function(e,t,n=!1){if(n)for(let n=e.length-1;n>=0&&!1!==await t(e[n],n);n--);else for(let n=0,r=e.length;n<r&&!1!==await t(e[n],n);n++);},e.arrayInsertBefore=function(e,t,n){if(t===n||t+1===n)return;const[r]=e.splice(t,1),o=n<t?n:n-1;e.splice(o,0,r)},e.arrayLike=g,e.arrayRemove=function(e,n){const r=[],o=n;return t(e,((e,t)=>{o(e,t)&&r.push(t)})),r.forEach(((t,n)=>{e.splice(t-n,1)})),e},e.asyncMap=function(e,t,n=1/0){return new Promise(((r,o)=>{const i=e[Symbol.iterator](),s=Math.min(e.length,n),a=[];let l,c=0,u=0;const d=()=>{if(l)return o(l);const n=i.next();if(n.done)return void(c===e.length&&r(a));const s=u++;t(n.value,s,e).then((e=>{c++,a[s]=e,d()})).catch((e=>{l=e,d()}))};for(let e=0;e<s;e++)d()}))},e.b64decode=function(e){const t=A(de("atob"))?Ie(e):de("atob")(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return A(de("TextDecoder"))?function(e){const t=String.fromCharCode.apply(null,e);return decodeURIComponent(t)}(r):new(de("TextDecoder"))("utf-8").decode(r)},e.b64encode=function(e){const t=A(de("TextEncoder"))?function(e){const t=encodeURIComponent(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}(e):(new(de("TextEncoder"))).encode(e);let n="";const r=t.length;for(let e=0;e<r;e++)n+=String.fromCharCode(t[e]);return A(de("btoa"))?je(n):de("btoa")(n)},e.calculateDate=function(e,t,n="-"){const r=new Date(e),o=new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime()+864e5*parseInt(String(t)),i=new Date(o);return i.getFullYear()+n+String(i.getMonth()+1).padStart(2,"0")+"-"+String(i.getDate()).padStart(2,"0")},e.calculateDateTime=function(e,t,n="-",r=":"){const o=new Date(e),i=n,s=r,a=new Date(o.getFullYear(),o.getMonth(),o.getDate(),o.getHours(),o.getMinutes(),o.getSeconds()).getTime()+864e5*parseInt(String(t)),l=new Date(a);return l.getFullYear()+i+String(l.getMonth()+1).padStart(2,"0")+i+String(l.getDate()).padStart(2,"0")+" "+String(l.getHours()).padStart(2,"0")+s+String(l.getMinutes()).padStart(2,"0")+s+String(l.getSeconds()).padStart(2,"0")},e.chooseLocalFile=function(e,t){let n=document.createElement("input");n.setAttribute("id",String(Date.now())),n.setAttribute("type","file"),n.setAttribute("style","visibility:hidden"),n.setAttribute("accept",e),document.body.appendChild(n),n.click(),n.onchange=e=>{t(e.target.files),setTimeout((()=>{document.body.removeChild(n),n=null}))}},e.cloneDeep=function e(t,n=new WeakMap){if(null===t||"object"!=typeof t)return t;if(n.has(t))return n.get(t);if(t instanceof ArrayBuffer){const e=new ArrayBuffer(t.byteLength);return new Uint8Array(e).set(new Uint8Array(t)),n.set(t,e),e}if(ArrayBuffer.isView(t)){return new(0,t.constructor)(e(t.buffer,n),t.byteOffset,t.length)}if(t instanceof Date){const e=new Date(t.getTime());return n.set(t,e),e}if(t instanceof RegExp){const e=new RegExp(t.source,t.flags);return e.lastIndex=t.lastIndex,n.set(t,e),e}if(t instanceof Map){const r=new Map;return n.set(t,r),t.forEach(((t,o)=>{r.set(e(o,n),e(t,n))})),r}if(t instanceof Set){const r=new Set;return n.set(t,r),t.forEach((t=>{r.add(e(t,n))})),r}if(Array.isArray(t)){const r=new Array(t.length);n.set(t,r);for(let o=0,i=t.length;o<i;o++)o in t&&(r[o]=e(t[o],n));const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o))Object.defineProperty(r,t,{...o[t],value:e(o[t].value,n)});return r}const r=Object.create(Object.getPrototypeOf(t));n.set(t,r);const o=Object.getOwnPropertyDescriptors(t);for(const t of Reflect.ownKeys(o)){const i=o[t];"value"in i?i.value=e(i.value,n):(i.get&&(i.get=e(i.get,n)),i.set&&(i.set=e(i.set,n))),Object.defineProperty(r,t,i)}return r},e.compressImg=function e(t,n={mime:"image/jpeg",minFileSizeKB:50}){if(!(t instanceof File||t instanceof FileList))throw new Error(`${t} require be File or FileList`);if(!ce())throw new Error("Current runtime environment not support Canvas");const{quality:r,mime:o="image/jpeg",maxSize:i,minFileSizeKB:s=50}=v(n)?n:{};let a,l=r;if(r)l=r;else if(t instanceof File){const e=+parseInt((t.size/1024).toFixed(2));l=e<s?1:e<1024?.85:e<5120?.8:.75}return w(i)&&(a=i>=1200?i:1200),t instanceof FileList?Promise.all(Array.from(t).map((t=>e(t,{maxSize:a,mime:o,quality:l})))):t instanceof File?new Promise((e=>{const n=[...t.name.split(".").slice(0,-1),{"image/webp":"webp","image/jpeg":"jpg","image/png":"png"}[o]].join("."),r=+parseInt((t.size/1024).toFixed(2));if(r<s)e({file:t});else{const i=new FileReader;i.onload=({target:{result:i}})=>{const s=new Image;s.onload=()=>{const c=document.createElement("canvas"),u=c.getContext("2d"),d=s.width,f=s.height,{width:h,height:p}=function({sizeKB:e,maxSize:t,originWidth:n,originHeight:r}){let o=n,i=r;if(w(t)){const{width:e,height:s}=ue({maxWidth:t,maxHeight:t,originWidth:n,originHeight:r});o=e,i=s}else if(e<500){const e=1200,t=1200,{width:s,height:a}=ue({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<5120){const e=1400,t=1400,{width:s,height:a}=ue({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(e<10240){const e=1600,t=1600,{width:s,height:a}=ue({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}else if(10240<=e){const e=n>15e3?8192:n>1e4?4096:2048,t=r>15e3?8192:r>1e4?4096:2048,{width:s,height:a}=ue({maxWidth:e,maxHeight:t,originWidth:n,originHeight:r});o=s,i=a}return{width:o,height:i}}({sizeKB:r,maxSize:a,originWidth:d,originHeight:f});c.width=h,c.height=p,u.clearRect(0,0,h,p),u.drawImage(s,0,0,h,p);const g=c.toDataURL(o,l),m=atob(g.split(",")[1]);let y=m.length;const b=new Uint8Array(new ArrayBuffer(y));for(;y--;)b[y]=m.charCodeAt(y);const x=new File([b],n,{type:o});e({file:x,bufferArray:b,origin:t,beforeSrc:i,afterSrc:g,beforeKB:r,afterKB:Number((x.size/1024).toFixed(2))})},s.src=i},i.readAsDataURL(t)}})):Promise.resolve(null)},e.concurrentLimit=async function(e,t){if(!Array.isArray(e))throw new Error("tasks must be an array of functions");if("number"!=typeof t||t<=0)throw new Error("limit must be a positive number");for(let t=0;t<e.length;t++)if("function"!=typeof e[t])throw new Error(`task at index ${t} must be a function`);if(0===e.length)return[];const n=new Array(e.length);let r=0;return new Promise((o=>{let i=0,s=0;const a=()=>{for(;i<t&&r<e.length;){const t=r,l=e[r];r++,i++,Promise.resolve().then((()=>l())).then((e=>{n[t]={status:"fulfilled",value:e}})).catch((e=>{n[t]={status:"rejected",reason:e}})).finally((()=>{i--,s++,s===e.length?o(n):a()}))}};a()}))},e.cookieDel=e=>Y(e,"",-1),e.cookieGet=function(e){const{cookie:t}=document;if(!t)return"";const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t],[o,i=""]=r.split("=");if(o===e)return decodeURIComponent(i)}return""},e.cookieSet=Y,e.copyText=function(e,t){const{successCallback:n,failCallback:r}=A(t)?{}:t;navigator.clipboard?navigator.clipboard.writeText(e).then((()=>{F(n)&&n()})).catch((n=>{G(e,t)})):G(e,t)},e.crossOriginDownload=function(e,t,n){const{successCode:r=200,successCallback:o,failCallback:i}=A(n)?{successCode:200,successCallback:void 0,failCallback:void 0}:n,s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(){if(s.status===r)le(s.response,t,o);else if(F(i)){const e=s.status,t=s.getResponseHeader("Content-Type");if(y(t)&&t.includes("application/json")){const t=new FileReader;t.onload=()=>{i({status:e,response:t.result})},t.readAsText(s.response)}else i(s)}},s.onerror=e=>{F(i)&&i({status:0,code:"ERROR_CONNECTION_REFUSED"})},s.send()},e.dateParse=K,e.dateToEnd=function(e){const t=Z(e);return t.setDate(t.getDate()+1),K(t.getTime()-1)},e.dateToStart=Z,e.debounce=(e,t)=>{let n,r=!1;const o=function(...o){r||(clearTimeout(n),n=setTimeout((()=>{e.call(this,...o)}),t))};return o.cancel=()=>{clearTimeout(n),r=!0},o},e.divide=(e,t)=>{let n=0,r=0,o=0,i=0;return void 0!==e.toString().split(".")[1]&&(n=e.toString().split(".")[1].length),void 0!==t.toString().split(".")[1]&&(r=t.toString().split(".")[1].length),o=Number(e.toString().replace(".","")),i=Number(t.toString().replace(".","")),o/i*Math.pow(10,r-n)},e.downloadBlob=le,e.downloadData=function(e,t,n,r){if(n=n.replace(`.${t}`,"")+`.${t}`,"json"===t){le(new Blob([JSON.stringify(e,null,4)]),n)}else{if(!r||!r.length)throw new Error("未传入表头数据");if(!Array.isArray(e))throw new Error("data error! expected array!");const o=r.join(",")+"\n";let i="";e.forEach((e=>{i+=Object.values(e).join(",\t")+",\n"}));ae("data:"+{csv:"text/csv",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}[t]+";charset=utf-8,\ufeff"+encodeURIComponent(o+i),n)}},e.downloadHref=ae,e.downloadURL=function(e,t){window.open(t?se(e,t):e)},e.easingFunctional=R,e.easingStringify=function(e){let t;if(E(e))t=e;else{const n=N[e];if(!n)throw new Error(`${e} 缓冲函数未定义`);t=n}return`cubic-bezier(${t.join(",")})`},e.escapeRegExp=Xe,e.executeInScope=function(e,t={}){const n=Object.keys(t),r=n.map((e=>t[e]));try{return new Function(...n,`return (() => { ${e} })()`)(...r)}catch(e){throw new Error(`代码执行失败: ${e.message}`)}},e.fallbackCopyText=G,e.filterDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){const r=[];return Ne(e,((...e)=>{t(...e)&&r.push(e[0])}),n),r},e.findDeep=function(e,t,n={childField:"children",reverse:!1,breadthFirst:!1,isDomNode:!1}){let r=null;return Ne(e,((...e)=>{if(t(...e))return r=e[0],!1}),n),r},e.flatTree=function e(t,n=$e){const{keyField:r="key",childField:o="children",pidField:i="pid"}=v(n)?n:{};let s=[];for(let a=0,l=t.length;a<l;a++){const l=t[a],c={...l,[o]:[]};if(p(c,o)&&delete c[o],s.push(c),l[o]){const t=l[o].map((e=>({...e,[i]:l[r]||e.pid})));s=s.concat(e(t,n))}}return s},e.forEachDeep=Ne,e.formatDate=function(e,t="YYYY-MM-DD HH:mm:ss"){const n=K(e);let r,o=t;const i={"Y+":`${n.getFullYear()}`,"y+":`${n.getFullYear()}`,"M+":`${n.getMonth()+1}`,"D+":`${n.getDate()}`,"d+":`${n.getDate()}`,"H+":`${n.getHours()}`,"m+":`${n.getMinutes()}`,"s+":`${n.getSeconds()}`,"S+":`${n.getMilliseconds()}`,"w+":["周日","周一","周二","周三","周四","周五","周六"][n.getDay()]};for(const e in i)r=new RegExp("("+e+")").exec(o),r&&(o=o.replace(r[1],1===r[1].length?i[e]:i[e].padStart(r[1].length,"0")));return o},e.formatMoney=xe,e.formatNumber=xe,e.formatTree=function(e,t=$e){const{keyField:n="key",childField:r="children",pidField:o="pid"}=v(t)?t:{},i=[],s={};for(let t=0,r=e.length;t<r;t++){const r=e[t];s[r[n]]=r}for(let t=0,n=e.length;t<n;t++){const n=e[t],a=s[n[o]];a?(a[r]||(a[r]=[])).push(n):i.push(n)}return e=null,i},e.fuzzySearchTree=function e(t,n,r=Te){if(!p(n,"filter")&&!n.keyword)return t;const o=[];for(let i=0,s=t.length;i<s;i++){const s=t[i],a=s[r.childField]&&s[r.childField].length>0?e(s[r.childField]||[],n,r):[];if((p(n,"filter")?n.filter(s):r.ignoreCase?s[r.nameField].toLowerCase().includes(n.keyword.toLowerCase()):s[r.nameField].includes(n.keyword))||a.length>0)if(s[r.childField])if(a.length>0)o.push({...s,[r.childField]:a});else if(r.removeEmptyChild){const{[r.childField]:e,...t}=s;o.push(t)}else o.push({...s,[r.childField]:[]});else{const{[r.childField]:e,...t}=s;o.push(t)}}return o},e.genCanvasWM=function e(t="请勿外传",n){const{rootContainer:r=document.body,width:o="300px",height:i="150px",textAlign:s="center",textBaseline:a="middle",font:l="20px PingFangSC-Medium,PingFang SC",fillStyle:c="rgba(189, 177, 167, .3)",rotate:u=-20,zIndex:d=2147483647,watermarkId:f="__wm"}=A(n)?{}:n,h=y(r)?document.querySelector(r):r;if(!h)throw new Error(`${r} is not valid Html Element or element selector`);const p=document.createElement("canvas");p.setAttribute("width",o),p.setAttribute("height",i);const g=p.getContext("2d");g.textAlign=s,g.textBaseline=a,g.font=l,g.fillStyle=c,g.rotate(Math.PI/180*u),g.fillText(t,parseFloat(o)/4,parseFloat(i)/2);const m=p.toDataURL(),b=document.querySelector(`#${f}`),w=b||document.createElement("div"),x=`opacity: 1 !important; display: block !important; visibility: visible !important; position:absolute; left:0; top:0; width:100%; height:100%; z-index:${d}; pointer-events:none; background-repeat:repeat; background-image:url('${m}')`;w.setAttribute("style",x),w.setAttribute("id",f),w.classList.add("nav-height"),b||(h.style.position="relative",h.appendChild(w));const S=window.MutationObserver||window.WebKitMutationObserver;if(S){let r=new S((function(){let o=document.querySelector(`#${f}`);if(o){const{opacity:i,zIndex:s,display:a,visibility:l}=(e=>{const t=getComputedStyle(e);return{opacity:t.getPropertyValue("opacity"),zIndex:t.getPropertyValue("z-index"),display:t.getPropertyValue("display"),visibility:t.getPropertyValue("visibility")}})(o);(o&&o.getAttribute("style")!==x||!o||"1"!==i||"2147483647"!==s||"block"!==a||"visible"!==l)&&(r.disconnect(),r=null,h.removeChild(o),o=null,e(t,n))}else r.disconnect(),r=null,e(t,n)}));r.observe(h,{attributes:!0,subtree:!0,childList:!0})}},e.getComputedCssVal=function(e,t,n=!0){const r=getComputedStyle(e).getPropertyValue(t)??"";return n?Number(r.replace(/([0-9]*)(.*)/g,"$1")):r},e.getEasing=function(e){return e?N[e]:N},e.getGlobal=de,e.getStrWidthPx=W,e.getStyle=function(e,t){return getComputedStyle(e).getPropertyValue(t)},e.hasClass=function(e,t){if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},e.humanFileSize=function(e,t={decimals:0,si:!1,separator:" "}){const{decimals:n=0,si:r=!1,separator:o=" ",baseUnit:i,maxUnit:s}=t;let a=r?["B","kB","MB","GB","TB","PB","EB","ZB","YB"]:["Byte","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"];if(!A(i)){const e=a.findIndex((e=>e===i));-1!==e&&(a=a.slice(e))}if(!A(s)){const e=a.findIndex((e=>e===s));-1!==e&&a.splice(e+1)}return we(e,a,{ratio:r?1e3:1024,decimals:n,separator:o})},e.isArray=E,e.isBigInt=e=>"bigint"==typeof e,e.isBoolean=b,e.isDate=$,e.isDigit=e=>Ye.test(e),e.isEmail=e=>Me.test(e),e.isEmpty=function(e){if(A(e)||Number.isNaN(e))return!0;const t=m(e);return g(e)||"Arguments"===t?!e.length:"Set"===t||"Map"===t?!e.size:!Object.keys(e).length},e.isError=e=>"Error"===m(e),e.isFloat=Ge,e.isFunction=F,e.isIdNo=e=>{if(!Oe.test(e))return!1;const t=Number(e.slice(6,10)),n=Number(e.slice(10,12)),r=Number(e.slice(12,14)),o=new Date(t,n-1,r);if(!(o.getFullYear()===t&&o.getMonth()+1===n&&o.getDate()===r))return!1;const i=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];let s=0;for(let t=0;t<17;t++)s+=Number(e.slice(t,t+1))*i[t];return["1","0","X","9","8","7","6","5","4","3","2"][s%11]===e.slice(-1)},e.isInteger=We,e.isIpV4=e=>He.test(e),e.isIpV6=e=>qe.test(e),e.isJsonString=function(e){try{const t=JSON.parse(e);return"object"==typeof t&&null!==t&&t}catch(e){return!1}},e.isNaN=C,e.isNodeList=T,e.isNull=S,e.isNullOrUnDef=A,e.isNullish=A,e.isNumber=w,e.isNumerical=e=>We(e)||Ge(e),e.isObject=v,e.isPhone=e=>Le.test(e),e.isPlainObject=P,e.isPrimitive=e=>null===e||"object"!=typeof e,e.isRegExp=e=>"RegExp"===m(e),e.isString=y,e.isSymbol=e=>"symbol"==typeof e,e.isUndefined=x,e.isUrl=(e,t=!1)=>(t?Be:Ue).test(e),e.isValidDate=V,e.mapDeep=function(e,t,n={childField:"children",reverse:!1}){const{childField:r="children",reverse:o=!1}=v(n)?n:{};let i=!1;const s=[],a=(n,s,l,c=0)=>{if(o)for(let o=n.length-1;o>=0&&!i;o--){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(l.push(D(d,[r])),u&&Array.isArray(u[r])?(l[l.length-1][r]=[],a(u[r],u,l[l.length-1][r],c+1)):delete d[r])}else for(let o=0;o<n.length&&!i;o++){const u=n[o],d=t(u,o,n,e,s,c);if(!1===d){i=!0;break}!0!==d&&(l.push(D(d,[r])),u&&Array.isArray(u[r])?(l[l.length-1][r]=[],a(u[r],u,l[l.length-1][r],c+1)):delete d[r])}};return a(e,null,s),e=null,s},e.multiply=Re,e.numberAbbr=we,e.numberToHex=be,e.objectAssign=I,e.objectEach=k,e.objectEachAsync=async function(e,t){for(const n in e)if(p(e,n)&&!1===await t(e[n],n))break},e.objectFill=function(e,t,n){const r=n||((e,t,n)=>void 0===e[n]);return k(t,((n,o)=>{r(e,t,o)&&(e[o]=n)})),e},e.objectGet=function(e,t,n=!1){const r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".");let o=e,i=0;for(let e=r.length;i<e-1;++i){const e=r[i];if(w(Number(e))&&Array.isArray(o))o=o[e];else{if(!v(o)||!p(o,e)){if(o=void 0,n)throw new Error("[Object] objectGet path 路径不正确");break}o=o[e]}}return{p:o,k:o?r[i]:void 0,v:o?o[r[i]]:void 0}},e.objectHas=p,e.objectMap=function(e,t){const n={};for(const r in e)p(e,r)&&(n[r]=t(e[r],r));return e=null,n},e.objectMerge=I,e.objectOmit=D,e.objectPick=function(e,t){const n={};return k(e,((e,r)=>{t.includes(r)&&(n[r]=e)})),e=null,n},e.once=e=>{let t,n=!1;return function(...r){return n||(n=!0,t=e.call(this,...r)),t}},e.parseQueryParams=function(e=location.search){const t={};return Array.from(e.matchAll(/[&?]?([^=&]+)=?([^=&]*)/g)).forEach(((e,n)=>{t[e[1]]?"string"==typeof t[e[1]]?t[e[1]]=[t[e[1]],e[2]]:t[e[1]].push(e[2]):t[e[1]]=e[2]})),t},e.parseVarFromString=function(e,t="{",n="}"){return Array.from(e.matchAll(Je(t,n))).map((e=>A(e)?void 0:e[1]))},e.pathJoin=ee,e.pathNormalize=Q,e.qsParse=te,e.qsStringify=re,e.randomNumber=fe,e.randomString=(e,t)=>{let n=0,r=he;y(t)?(n=e,r=t):w(e)?n=e:y(e)&&(r=e);let o=Math.max(n,1),i="";const s=r.length-1;if(s<2)throw new Error("字符串池长度不能少于 2");for(;o--;){i+=r[fe(0,s)]}return i},e.randomUuid=function(){if("undefined"==typeof URL||!URL.createObjectURL||"undefined"==typeof Blob){const e="0123456789abcdef",t="xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx";let n="";for(let r=0;r<t.length;r++){const o=fe(0,15);n+="-"==t[r]||"4"==t[r]?t[r]:e[o]}return n}return/[^/]+$/.exec(URL.createObjectURL(new Blob).slice())[0]},e.removeClass=function(e,t){q(t,(t=>e.classList.remove(t)))},e.replaceVarFromString=function(e,t,n="{",r="}"){return e.replace(new RegExp(Je(n,r)),(function(e,n){return p(t,n)?t[n]:e}))},e.safeAwait=function(e,t){return e.then((e=>[null,e])).catch((e=>{if(t){return[Object.assign({},e,t),void 0]}return[e,void 0]}))},e.searchTreeById=function(e,t,n={childField:"children",keyField:"id"}){const{childField:r="children",keyField:o="id"}=v(n)?n:{},i=(e,t,n)=>e.reduce(((e,s)=>{const a=s[r];return[...e,t?{...s,parentId:t,parent:n}:s,...a&&a.length?i(a,s[o],s):[]]}),[]);return(e=>{let n=e.find((e=>e[o]===t));const{parent:r,parentId:i,...s}=n;let a=[t],l=[s];for(;n&&n.parentId;)a=[n.parentId,...a],l=[n.parent,...l],n=e.find((e=>e[o]===n.parentId));return[a,l]})(i(e))},e.select=_,e.setEasing=function(e,t){N[e]=t},e.setGlobal=function(e,t){if("undefined"!=typeof globalThis)globalThis[e]=t;else if("undefined"!=typeof window)window[e]=t;else if("undefined"!=typeof global)global[e]=t;else{if("undefined"==typeof self)throw new SyntaxError("当前环境下无法设置全局属性");self[e]=t}},e.setStyle=z,e.smoothScroll=function(e){return new Promise((n=>{const r={el:document,to:0,duration:567,easing:"ease"},{el:o,to:i,duration:s,easing:a}=I(r,e),l=document.documentElement,c=document.body,u=o===window||o===document||o===l||o===c?[l,c]:[o];let d;const f=(()=>{let e=0;return t(u,(t=>{if("scrollTop"in t)return e=t.scrollTop,!1})),e})(),h=i-f,p=R(a),g=()=>{const e=performance.now(),t=(d?e-d:0)/s,r=p(t);var o;d||(d=e),o=f+h*r,u.forEach((e=>{"scrollTop"in e&&(e.scrollTop=o)})),t>=1?n():requestAnimationFrame(g)};g()}))},e.stringAssign=(e,t)=>e.replace(H,((e,n)=>((e,t)=>{try{return new Function(`with(arguments[0]){if(arguments[0].${e} === undefined)throw "";return String(arguments[0].${e})}`)(t)}catch(t){throw new SyntaxError(`无法执行表达式:${e}`)}})(n,t))),e.stringCamelCase=function(e,t){let n=e;return t&&(n=e.replace(/^./,(e=>e.toUpperCase()))),n.replace(/[\s_-](.)/g,((e,t)=>t.toUpperCase()))},e.stringEscapeHtml=e=>{const t={"&":"&","<":"<",">":">",'"':"""};return e.replace(/[&<>"]/g,(e=>t[e]))},e.stringFill=(e,t=" ")=>new Array(e).fill(t).join(""),e.stringFormat=function(e,...t){let n=0;return[e.replace(U,(e=>{const r=t[n++];switch(e){case"%%":return n--,"%";default:case"%s":return String(r);case"%d":return String(Number(r));case"%o":return JSON.stringify(r)}})),...t.splice(n).map(String)].join(" ")},e.stringKebabCase=M,e.strip=function(e,t=15){return+parseFloat(Number(e).toPrecision(t))},e.subtract=(e,t)=>Pe(e,-t),e.supportCanvas=ce,e.throttle=(e,t,n)=>{let r,o=!1,i=0;const s=function(...s){if(o)return;const a=Date.now(),l=()=>{i=a,e.call(this,...s)};if(0===i)return n?l():void(i=a);i+t-a>0?(clearTimeout(r),r=setTimeout((()=>l()),t)):l()};return s.cancel=()=>{clearTimeout(r),o=!0},s},e.tooltipEvent=Ce,e.typeIs=m,e.uniqueNumber=ve,e.uniqueString=(e,t)=>{let n=0,r=pe;y(t)?(n=e,r=t):w(e)?n=e:y(e)&&(r=e);let o=be(ve(),r),i=n-o.length;if(i<=0)return o;for(;i--;)o+=Ee(r);return o},e.uniqueSymbol=Ve,e.urlDelParams=(e,t)=>{const n=oe(e);return t.forEach((e=>delete n.searchParams[e])),ie(n)},e.urlParse=oe,e.urlSetParams=se,e.urlStringify=ie,e.wait=function(e=1){return new Promise((t=>setTimeout(t,e)))},e.weAtob=Ie,e.weBtoa=je}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sculp-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Utils function library for modern javascript",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prepare": "husky install",
|
|
@@ -112,7 +112,6 @@
|
|
|
112
112
|
"require": "./dist/cjs/index.js",
|
|
113
113
|
"types": "./dist/types/index.d.ts"
|
|
114
114
|
},
|
|
115
|
-
"./package.json": "./package.json",
|
|
116
115
|
"./array": {
|
|
117
116
|
"import": "./dist/esm/array.js",
|
|
118
117
|
"require": "./dist/cjs/array.js",
|