util-helpers 5.2.1 → 5.2.2
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 +18 -17
- package/dist/util-helpers.js +75 -70
- package/dist/util-helpers.js.map +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/dist/util-helpers.min.js.map +1 -1
- package/esm/VERSION.js +1 -1
- package/esm/checkFileType.js +6 -4
- package/esm/getMimeType.js +2 -2
- package/esm/index.js +3 -3
- package/esm/utils/file.util.js +6 -3
- package/lib/VERSION.js +1 -1
- package/lib/checkFileType.js +6 -4
- package/lib/getMimeType.js +2 -2
- package/lib/index.js +6 -6
- package/lib/utils/file.util.js +5 -1
- package/package.json +1 -1
- package/types/VERSION.d.ts +1 -2
- package/types/ajax.d.ts +2 -3
- package/types/bytesToSize.d.ts +0 -1
- package/types/calculateCursorPosition.d.ts +0 -1
- package/types/checkFileType.d.ts +3 -2
- package/types/compressImage.d.ts +1 -1
- package/types/dataURLToBlob.d.ts +1 -2
- package/types/divide.d.ts +0 -1
- package/types/download.d.ts +1 -2
- package/types/fileReader.d.ts +1 -1
- package/types/filterTree.d.ts +0 -1
- package/types/findTreeNode.d.ts +0 -1
- package/types/findTreeNodes.d.ts +0 -1
- package/types/findTreeSelect.d.ts +0 -1
- package/types/formatBankCard.d.ts +0 -1
- package/types/formatMobile.d.ts +0 -1
- package/types/formatMoney.d.ts +0 -1
- package/types/gcd.d.ts +0 -1
- package/types/getFileBlob.d.ts +1 -2
- package/types/getFileType.d.ts +1 -3
- package/types/getImageInfo.d.ts +1 -2
- package/types/getMimeType.d.ts +1 -1
- package/types/index.d.ts +12 -10
- package/types/isBankCard.d.ts +0 -1
- package/types/isBusinessLicense.d.ts +0 -1
- package/types/isChinese.d.ts +0 -1
- package/types/isEmail.d.ts +0 -1
- package/types/isHMCard.d.ts +0 -1
- package/types/isIPv4.d.ts +0 -1
- package/types/isIPv6.d.ts +0 -1
- package/types/isIdCard.d.ts +0 -1
- package/types/isMobile.d.ts +0 -1
- package/types/isPassport.d.ts +0 -1
- package/types/isPassword.d.ts +0 -1
- package/types/isPostcode.d.ts +0 -1
- package/types/isQQ.d.ts +0 -1
- package/types/isSocialCreditCode.d.ts +0 -1
- package/types/isSwiftCode.d.ts +0 -1
- package/types/isTWCard.d.ts +0 -1
- package/types/isTelephone.d.ts +0 -1
- package/types/isUrl.d.ts +0 -1
- package/types/isValidNumber.d.ts +0 -1
- package/types/isVehicle.d.ts +0 -1
- package/types/isWX.d.ts +0 -1
- package/types/lcm.d.ts +0 -1
- package/types/listToTree.d.ts +0 -1
- package/types/loadImage.d.ts +1 -2
- package/types/loadImageWithBlob.d.ts +1 -1
- package/types/loadScript.d.ts +1 -2
- package/types/minus.d.ts +0 -1
- package/types/numberToChinese.d.ts +0 -1
- package/types/padZero.d.ts +0 -1
- package/types/parseIdCard.d.ts +0 -1
- package/types/plus.d.ts +0 -1
- package/types/replaceChar.d.ts +0 -1
- package/types/round.d.ts +0 -1
- package/types/setDataURLPrefix.d.ts +0 -1
- package/types/strlen.d.ts +0 -1
- package/types/times.d.ts +0 -1
- package/types/transformFieldNames.d.ts +0 -1
- package/types/transformObjectValue.d.ts +0 -1
- package/types/treeToList.d.ts +0 -1
- package/types/utils/config.d.ts +0 -1
- package/types/utils/file.util.d.ts +4 -0
- package/types/validatePassword.d.ts +0 -1
- package/types/BlobUrl.d.ts +0 -41
package/dist/util-helpers.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).utilHelpers={})}(this,(function(t){"use strict";var e=void 0,r="undefined",n="object",o=Object.prototype,i=o.toString,a=o.hasOwnProperty,c=o.propertyIsEnumerable,u=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,f=Object.keys,l=Function.prototype.toString,d=typeof Symbol!==r?Symbol.prototype:e,p=Math.min,v=Math.max,h=Math.random,g=Math.floor,m=Math.ceil,y=Number.isFinite,b=typeof globalThis===n&&globalThis,w=typeof global===n&&global,x=typeof self===n&&self,j=Number.MAX_SAFE_INTEGER||9007199254740991,O=Number.MIN_SAFE_INTEGER||-9007199254740991,N=["Function","AsyncFunction","GeneratorFunction","Proxy"].map((function(t){return"[object "+t+"]"}));function E(t){return Array.isArray(t)}function A(t){return null!==t&&"object"==typeof t}function C(t){return"function"==typeof t||A(t)}function k(t){return i.call(t)}function F(t){return"symbol"==typeof t||"[object Symbol]"===k(t)}var T=/^0b[01]+$/i,P=/^0o[0-7]+$/i,S=/^[-+]0x[0-9a-f]+$/i;function M(t){if("number"==typeof t)return t;if(F(t))return NaN;if(C(t)&&(t=Number(t)),"string"!=typeof t)return 0===t?t:+t;t=t.trim();var e=T.test(t);return e||P.test(t)?parseInt(t.slice(2),e?2:8):S.test(t)?NaN:+t}function _(t){return t}function I(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=j}(t.length)&&!function(t){if("function"==typeof t)return!0;var e=k(t);return N.some((function(t){return t===e}))}(t)}function R(t){return t?(t=M(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function B(t,e){void 0===t&&(t=0),void 0===e&&(e=1),t=R(t),e=R(e);var r=m(p(t,e)||0),n=g(v(t,e)||0);if(r>n){var o=r;r=n,n=o}return g(r+h()*(n-r+1))}function L(t){return C(t)?f(t).concat(function(t){return u&&null!==t?u(t).filter((function(e){return c.call(t,e)})):[]}(t)):[]}var $,z=($=1,function(t,e){void 0===e&&(e=_);for(var r=!I(t)&&L(t),n=(r||t).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===e(t[i],i,t))break;o+=$}return t});function U(t){return"number"==typeof t||"[object Number]"===k(t)}var V=d?d.toString:e;function D(t){if("string"==typeof t)return t;if(E(t))return""+t.map(D);if(F(t))return V?V.call(t):"";var e=""+t;return"0"===e&&1/t==-1/0?"-0":e}function K(t){return function(t){return null==t}(t)?"":D(t)}var Z=typeof Blob!==r;function W(t){return!!(Z&&t instanceof Blob)||"[object Blob]"===k(t)}var H=l.call(Object);function X(t){if(!A(t)||"[object Object]"!==k(t))return!1;var e=s(Object(t));if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)===H}var q=typeof File!==r;var G=b&&globalThis.Object===Object&&globalThis,J=w&&global.Object===Object&&global,Q=x&&self.Object===Object&&self,Y=G||J||Q||Function("return this")();function tt(t){return U(t)&&Y.isNaN(t)}function et(t){return C(t)&&"function"==typeof t.then}function rt(t){return"string"==typeof t||"[object String]"===k(t)}function nt(t,e,r){void 0===r&&(r=0);var n=Math[t];if(e=M(e),r=p(function(t){var e=M(t);if(!e||e===1/0||e===-1/0)return e==e?e:0;var r=e%1;return r?e-r:e}(r),292),0===r||!function(t){return y?y(t):"number"==typeof t&&Y.isFinite(t)}(e))return n(e);var o=K(e).split("e");return+((o=K(e=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function ot(t,e){return nt("round",t,e)}var it=0;h().toString(36).substring(2,4);var at=/^1[3456789]\d{9}$/;var ct=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var ut=/^\d{6}$/;var st=/^[1-9]\d{5}(19|20)?\d{2}((0[1-9])|(1[012]))(([0-2][1-9])|10|20|30|31)\d{3}(\d|X)?$/i;var ft=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var lt=/^[1-9]\d{4,10}$/;var dt=/^[a-z]([-_a-z0-9]{5,19})+$/i;var pt=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})|([A-Z0-9]{5}[DF])|([DF][A-Z0-9]{5}))$/;var vt=/^[1-9]\d{9,20}$/,ht=/^\d{8,30}$/;var gt=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,mt="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var yt={disableWarning:!0};function bt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];yt.disableWarning||console.warn.apply(void 0,t)}var wt=/\d/,xt=/[a-z]/,jt=/[A-Z]/,Ot=/[\d|a-z]/gi;function Nt(t){return t.indexOf("\\x")>-1||t.indexOf("\\u")>-1}function Et(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=t;"string"!=typeof t&&(bt("[validatePassword] value must be a string."),u="");var s=0,f=wt.test(u),l=xt.test(u),d=jt.test(u),p=function(t,e){if(!e||!t)return!1;var r=t.replace(Ot,"");if(!r)return!1;var n=Nt(e)?new RegExp("[".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return e.indexOf(t)>-1&&(o=!0),o})),o}(u,c),v=function(t,e){if(!t)return!1;var r=t.replace(Ot,"");if(!r)return!1;if(!e)return!0;var n=Nt(e)?new RegExp("[^".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return-1===e.indexOf(t)&&(o=!0),o})),o}(u,c);return f&&(s+=1),i?(l||d)&&(s+=1):(l&&(s+=1),d&&(s+=1)),p&&(s+=1),{validated:s>=n&&!v,level:s,containes:{number:f,lowerCaseLetter:l,upperCaseLetter:d,specialCharacter:p,unallowableCharacter:v}}}var At=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var Ct,kt="undefined"!=typeof URL,Ft=void 0,Tt=Object.keys,Pt=Object.values,St=kt?URL.createObjectURL:(Ct="",function(){return Ct}),Mt=kt?URL.revokeObjectURL:function(){},_t={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},It=_t.chineseBasic+"+",Rt="^"+_t.chineseBasic+"+$",Bt="(?:"+Pt(_t).join("|")+")",Lt=Bt+"+",$t="^"+Bt+"+$",zt=RegExp.prototype.hasOwnProperty("unicode");var Ut=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;var Vt=/^((([0-9A-F]{1,4}:){7}([0-9A-F]{1,4}|:))|(([0-9A-F]{1,4}:){6}(:[0-9A-F]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){5}(((:[0-9A-F]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){4}(((:[0-9A-F]{1,4}){1,3})|((:[0-9A-F]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){3}(((:[0-9A-F]{1,4}){1,4})|((:[0-9A-F]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){2}(((:[0-9A-F]{1,4}){1,5})|((:[0-9A-F]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){1}(((:[0-9A-F]{1,4}){1,6})|((:[0-9A-F]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(:(((:[0-9A-F]{1,4}){1,7})|((:[0-9A-F]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:)))(%.+)?$/i;var Dt="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",Kt=":\\d+",Zt="\\/.*",Wt="\\?.*",Ht=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(Dt,")(?:").concat(Kt,")?(?:").concat(Zt,")*(?:").concat(Wt,")?(?:").concat("#.*",")?$")),Xt=new RegExp("^(?:".concat(Dt,")(?:").concat(Kt,")?(?:").concat(Zt,")*(?:").concat(Wt,")?(?:").concat("#.*",")?$"));function qt(t){var e=K(t);return Ht.test(e)||Xt.test(e)}var Gt=/^\d{15}$/;var Jt=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var Qt=/^\d{8}$/i,Yt=/^[\da-z]{10,12}$/i;var te=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function ee(t,e){var r;return void 0===e&&(e=!1),"number"==typeof(r=e?"string"==typeof t&&""!==t?Number(t):t:"number"==typeof t?t:F(t)?Number.NaN:Number(t))&&!tt(r)}var re=function(t,e){return re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},re(t,e)};var ne=function(){return ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ne.apply(this,arguments)};function oe(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(t.value).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function ie(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function ae(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function ce(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var ue=/^[-+]?0[b|o|x]\d+/i,se=/^\.\d+/;function fe(t){var e;return rt(t)?""===(e=t.trim())?e=Number(e):ue.test(e)||se.test(e)?e=M(e):tt(Number(e))&&(e=Number.NaN):e=F(t)?Number.NaN:U(t)?t:Number(t),tt(e)?Number.NaN:e}function le(t,e){return void 0===e&&(e=12),+parseFloat(t.toPrecision(e))}function de(t){var e=t.toString().split(/e/i),r=(e[0].split(".")[1]||"").length-+(e[1]||0);return r>0?r:0}function pe(t){var e=String(t);if(!function(t){return/\d+\.?\d*e[+-]*\d+/i.test(t)}(e))return Number(e.replace(".",""));var r=de(t);return r>0?le(+t*Math.pow(10,r)):+t}function ve(t){(+t>j||+t<O)&&bt("".concat(t," is beyond boundary when transfer to integer, the results may not be accurate"))}var he,ge,me,ye=["零","一","二","三","四","五","六","七","八","九"],be=["","十","百","千"],we=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],xe=["","拾","佰","仟"];function je(t){for(var e="",r="",n=!1,o=0;t>0;){var i=t%10;0==i?n&&(n=!1,r=he[i]+r):(n=!0,e=he[i],r=(e+=ge[o])+r),o++,t=Math.floor(t/10)}return r}function Oe(t){for(var e=t+"",r="",n=0,o=e.length;n<o;n++)r+=he[parseInt(e[n])];return r}function Ne(t,e){void 0===e&&(e={});var r=e.spaceMark,n=void 0===r?" ":r,o=e.precision,i=void 0===o?2:o,a="number"!=typeof t?Number(t):t;if(0===a||tt(a))return"0".concat(n,"B");var c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u=Math.floor(Math.log(a)/Math.log(1024));return c[u]?"".concat(Number((a/Math.pow(1024,u)).toFixed(i))).concat(n).concat(c[u]):a+""}var Ee=/^(\d{2})(\d{2})(\d{2})((?:\d{2})?\d{2})(\d{2})(\d{2})\d{2}(\d)(?:\d|X)?$/i,Ae=[["11","北京市"],["12","天津市"],["13","河北省"],["14","山西省"],["15","内蒙古自治区"],["21","辽宁省"],["22","吉林省"],["23","黑龙江省"],["31","上海市"],["32","江苏省"],["33","浙江省"],["34","安徽省"],["35","福建省"],["36","江西省"],["37","山东省"],["41","河南省"],["42","湖北省"],["43","湖南省"],["44","广东省"],["45","广西壮族自治区"],["46","海南省"],["50","重庆市"],["51","四川省"],["52","贵州省"],["53","云南省"],["54","西藏自治区"],["61","陕西省"],["62","甘肃省"],["63","青海省"],["64","宁夏回族自治区"],["65","新疆维吾尔自治区"],["71","台湾省"],["83","台湾省"],["81","香港特别行政区"],["82","澳门特别行政区"]];var Ce={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"};function ke(t){for(var e=t.split(","),r=e[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(e[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}var Fe=function(t,e,r){if(void 0===r&&(r=!0),X(t)){var n={};return z(t,(function(t,o){var i=r&&(X(t)||E(t))?Fe(t,e):e(t,o);n[o]=i})),n}if(E(t)){var o=[];return z(t,(function(t,n){var i=r&&(X(t)||E(t))?Fe(t,e):e(t,n);o.push(i)})),o}return t};function Te(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return Te.apply(void 0,[Te(r,n)].concat(o));if(r=fe(r),n=fe(n),tt(r)||tt(n))return Number.NaN;var i=pe(r),a=pe(n),c=de(r)+de(n),u=i*a;return ve(u),u/Math.pow(10,c)}function Pe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return Pe.apply(void 0,[Pe(r,n)].concat(o));if(r=fe(r),n=fe(n),tt(r)||tt(n))return Number.NaN;var i=pe(r),a=pe(n);return ve(i),ve(a),Te(i/a,le(Math.pow(10,de(n)-de(r))))}function Se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?0:t[1],o=t.slice(2);if(o.length>0)return Se.apply(void 0,[Se(r,n)].concat(o));if(r=Math.abs(ot(r)),n=Math.abs(ot(n)),tt(r)||tt(n))return Number.NaN;if(0===r&&0===n)return 0;if(0===r)return n;if(0===n)return r;var i=n;for(r<n&&(i=r,r=n,n=i);i;)i=r%n,r=n,n=i;return M(r)}function Me(t,e){var r=e||{},n=r.method,o=void 0===n?"get":n,i=r.data,a=void 0===i?null:i,c=r.timeout,u=r.headers,s=r.withCredentials,f=void 0!==s&&s,l=r.async,d=void 0===l||l,p=r.user,v=void 0===p?null:p,h=r.password,g=void 0===h?null:h,m=r.responseType,y=r.onReadyStateChange,b=r.onLoadStart,w=r.onProgress,x=r.onAbort,j=r.onTimeout,O=r.onError,N=r.onLoad,E=r.onLoadEnd;return new Promise((function(e,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),t,d,v,g),y&&(n.onreadystatechange=y),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,m&&(n.responseType=m),"object"==typeof u&&Tt(u).map((function(t){n.setRequestHeader(t,u[t])}));var i,s=function(t){return function(e){r(e),null==t||t.call(n,e)}},l={loadstart:b,progress:w,abort:s(x),timeout:s(j),error:s(O),load:(i=N,function(t){e(t),null==i||i.call(n,t)}),loadend:E};Tt(l).map((function(t){var e=l[t];e&&n.addEventListener(t,e)})),n.send(a)}))}function _e(t,e){return!!t&&t.slice(-e.length)===e}function Ie(t){return!(!A(t)||!rt(t.name))}function Re(t,e){if(!function(t){return!!(q&&t instanceof File)||"[object File]"===k(t)}(t)&&!Ie(t))return!1;if(rt(e)||(e=K(e)),!(e=e.trim())||"*"===e)return!0;var r=!1,n=e.toLowerCase().split(/,(?:\s+)?/),o=t.name.toLowerCase(),i=t.type||"",a=t.url||"";return n.some((function(t){if("*"===t||i===t||0===t.indexOf(".")&&(_e(o,t)||_e(a,t)))r=!0;else if(t.includes("/*")&&i.includes("/")){var e=t.match(/(.*)\/\*/),n=i.split("/")[0];e&&e[1]===n&&(r=!0)}return r})),r}var Be=[200,304];function Le(t,e){return new Promise((function(r,n){W(t)?r(t):Me(t,ne({responseType:"blob"},e)).then((function(e){var o=e.target.status;if(-1!==Be.indexOf(o))r(e.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(t,"'."));console.error(i),n(i)}})).catch((function(t){console.error(new Error("Failed to request file. ".concat(t))),n(t)}))}))}function $e(t){return new Promise((function(e,r){var n=W(t),o=n?St(t):t,i=new Image;n||(i.crossOrigin="anonymous"),i.onload=function(){e(i)},i.onerror=function(e){n&&Mt(o),console.error("[loadImage] The image load failed, '".concat(t,"'.")),r(e)},i.src=o}))}function ze(t,e){return Le(t,e).then((function(t){return $e(t).then((function(e){return{blob:t,image:e}}))}))}function Ue(t,e){void 0===e&&(e="");var r=document.createElement("a");r.href=t,r.style.display="none",r.setAttribute("download",e),r.addEventListener("click",(function t(e){e.stopPropagation(),r.removeEventListener("click",t)})),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Ve={image:"image/*,.jpeg,.jpg,.gif,.bmp,.png,.webp,.svg,.apng,.avif,.ico,.tif,.tiff",audio:"audio/*,.mp3,.wav,.aac,.flac",video:"video/*,.mp4,.webm,.ogg,.mov",pdf:"application/pdf,.pdf",word:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,.doc,.docx",excel:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,.xls,.xlsx"};var De=[["text/plain",["txt"]],["text/css",["css"]],["text/html",["htm","html"]],["text/javascript",["js","mjs"]],["text/csv",["csv"]],["text/markdown",["md","markdown"]],["image/gif",["gif"]],["image/jpeg",["jpg","jpeg","jfif","pjpeg","pjp"]],["image/png",["png"]],["image/svg+xml",["svg"]],["image/webp",["webp"]],["image/apng",["apng"]],["image/avif",["avif"]],["image/bmp",["bmp"]],["image/x-icon",["ico","cur"]],["image/tiff",["tif","tiff"]],["application/xml",["xml"]],["application/zip",["zip"]],["application/pdf",["pdf"]],["application/json",["json"]],["application/yaml",["yaml","yml"]],["application/vnd.openxmlformats-officedocument.wordprocessingml.document",["doc","docx"]],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",["xls","xlsx"]],["audio/mp3",["mp3"]],["audio/wav",["wav"]],["audio/aac",["aac"]],["audio/flac",["flac"]],["video/mp4",["mp4"]],["video/ogg",["ogg"]],["video/webm",["webm"]],["video/quicktime",["mov"]]];var Ke="abcdefghijklmnopqrstuvwxyz",Ze={number:"0123456789",lower:Ke,upper:Ke.toUpperCase()},We=Ze.number+Ze.lower+Ze.upper;function He(t,e,r){for(void 0===r&&(r="");t-- >0;){return He(t,e,r+e[B(0,e.length-1)])}return r}function Xe(t,e){var r=e.childrenField,n=void 0===r?"children":r,o=e.emptyChildrenValue,i=void 0===o?"none":o;t.forEach((function(t){t[n].length<=0?"null"===i?t[n]=null:delete t[n]:Xe(t[n],e)}))}function qe(t,e,r,n){void 0===n&&(n=[]);var o=[];return E(t)&&z(t,(function(t){if(n.push(t),e(t))return o=n,!1;if(C(t)){var i=t[r];if(E(i)&&i.length>0){var a=qe(i,e,r,n);if(a.length>0)return o=a,!1}}n.pop()})),o}var Ge=function(){function t(){this.handlers={}}return t.prototype.eventNames=function(){var t,e=(null===(t=Object.getOwnPropertySymbols)||void 0===t?void 0:t.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(e)},t.prototype.rawListeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.raw})):[]},t.prototype.listeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.wrap})):[]},t.prototype.hasListener=function(t,e){return this.rawListeners(t).some((function(t){return t===e}))},t.prototype._on=function(t,e,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:e,wrap:r,context:n};if(this.handlers[t]){var a=1===o?"push":"unshift";this.handlers[t][a](i)}else this.handlers[t]=[i];return this},t.prototype.prependListener=function(t,e,r){return this._on(t,e,e,r,0)},t.prototype.on=function(t,e,r){return this._on(t,e,e,r)},t.prototype._wrapOnce=function(t,e,r){var n=this;void 0===r&&(r=null);var o=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];e.apply(r,i),n.off(t,o)};return o},t.prototype.once=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r)},t.prototype.prependOnceListener=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r,0)},t.prototype.off=function(t,e){var r=this.handlers[t];if(r)if(e){var n=r.findIndex((function(t){return t.wrap===e||t.raw===e}));-1!==n&&r.splice(n,1)}else delete this.handlers[t];return this},t.prototype.offAll=function(){return this.handlers={},this},t.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this.handlers[t];return!!(n&&n.length>0)&&(n.forEach((function(t){t.wrap.apply(t.context,e)})),!0)},t}(),Je={},Qe=function(){function t(t){void 0===t&&(t="default"),this.scope=t,Je[this.scope]||(Je[this.scope]={}),this.data=Je[this.scope]}return t.prototype.getItem=function(t){return t in this.data?this.data[t]:null},t.prototype.setItem=function(t,e){this.data[t]=e},t.prototype.removeItem=function(t){delete this.data[t]},t.prototype.clear=function(){Je[this.scope]={},this.data=Je[this.scope]},t}();function Ye(t){try{var e="object"==typeof t&&null!==t&&!!t.setItem&&!!t.getItem&&!!t.removeItem;if(e){var r=Math.random().toString(16).substring(2,8)+(new Date).getTime();if(t.setItem(r,"1"),"1"!==t.getItem(r))return!1;t.removeItem(r)}return e}catch(e){return console.error("[cache2] ".concat(t," is not supported. The default memory cache will be used.")),!1}}var tr=function(){function t(t,e){void 0===e&&(e={});var r=!!t&&Ye(t);this.options=ne({needParsed:r,prefix:""},e),this.storage=r?t:new Qe(this.options.memoryScope)}return t.prototype.getKey=function(t){return this.options.prefix+t},t.prototype.get=function(t){var e=this.storage.getItem(this.getKey(t));return this.options.needParsed?function(t,e){try{return JSON.parse(t,e)}catch(e){return t}}(e,this.options.reviver):e},t.prototype.set=function(t,e){this.storage.setItem(this.getKey(t),this.options.needParsed?function(t,e){return JSON.stringify(t,e)}(e,this.options.replacer):e)},t.prototype.del=function(t){this.storage.removeItem(this.getKey(t))},t.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},t}(),er="default",rr=function(t){function e(e,r){var n,o=t.call(this)||this,i=er;return"string"==typeof e?i=e||er:"object"==typeof e&&(n=e),n||"object"!=typeof r||(n=r),o.options=ne({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new tr(o.options.storage,ne({memoryScope:i},o.options)),o.cacheKey=i,o.startCheckperiod(),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}re(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._check=function(t,e){var r=!0;return 0!==e.t&&e.t<Date.now()&&(r=!1,this.del(t),this.emit("expired",t,e.v)),r},e.prototype._wrap=function(t,e){var r=Date.now(),n="number"==typeof e?e:this.options.stdTTL;return{v:t,t:n>0?r+n:0,n:r}},e.prototype._isLimited=function(t){return this.options.max>-1&&t>=this.options.max},e.prototype._getReplaceKey=function(t,e){var r=t[0];return t.forEach((function(t){(e[t].t<e[r].t||e[t].t===e[r].t&&e[t].n<e[r].n)&&(r=t)})),r},Object.defineProperty(e.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),e.prototype.setCacheValues=function(t){this.storage.set(this.cacheKey,t)},e.prototype.get=function(t){var e=this.cacheValues[t];if(e&&this._check(t,e))return e.v},e.prototype.mget=function(t){var e=this,r={};if(!Array.isArray(t))return r;var n=this.cacheValues;return t.forEach((function(t){var o=n[t];o&&e._check(t,o)&&(r[t]=o.v)})),r},e.prototype.getAll=function(){var t=Object.keys(this.cacheValues);return this.mget(t)},e.prototype.set=function(t,e,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[t]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var a=this._getReplaceKey(i,n);this.del(a)}}return n[t]=this._wrap(e,r),this.setCacheValues(n),this.emit("set",t,n[t].v),!0},e.prototype.mset=function(t){var e=this,r=!0;return t.forEach((function(t){var n=e.set(t.key,t.value,t.ttl);r&&!n&&(r=!1)})),r},e.prototype.del=function(t){var e=this,r=this.cacheValues,n=0;return(Array.isArray(t)?t:[t]).forEach((function(t){if(r[t]){n++;var o=r[t];delete r[t],e.emit("del",t,o.v)}})),n>0&&this.setCacheValues(r),n},e.prototype.clear=function(){this.storage.del(this.cacheKey)},e.prototype.keys=function(){var t=this,e=this.cacheValues;return Object.keys(e).filter((function(r){return t._check(r,e[r])}))},e.prototype.has=function(t){var e=this.cacheValues[t];return!(!e||!this._check(t,e))},e.prototype.take=function(t){var e,r=this.cacheValues[t];return r&&this._check(t,r)&&(e=r.v,this.del(t)),e},e.prototype.ttl=function(t,e){var r=this.cacheValues,n=r[t];return!(!n||!this._check(t,n))&&(r[t]=this._wrap(n.v,e),!0)},e.prototype.getTtl=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].t},e.prototype.getLastModified=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].n},e.prototype.startCheckperiod=function(){var t=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout((function(){t.startCheckperiod()}),this.options.checkperiod))},e.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},e}(Ge),nr=function(){function t(t){this.promiseCache={},this.cache=new rr(""+"uh_async_memo"+ ++it,t)}return t.prototype.run=function(t,e,r){var n=this;if(!e||!rt(e))return t();var o=ne({persisted:!0},r);if(o.persisted){var i=this.cache.get(e);if(i)return Promise.resolve(i)}return this.promiseCache[e]||(this.promiseCache[e]=t().then((function(t){return delete n.promiseCache[e],n.cache.set(e,t,o.ttl),t})).catch((function(t){return delete n.promiseCache[e],Promise.reject(t)}))),this.promiseCache[e]},t}();t.AsyncMemo=nr,t.VERSION="5.2.1",t.ajax=Me,t.bytesToSize=Ne,t.calculateCursorPosition=function(t,e,r,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,c=o.maskReg,u=void 0===c?/\D/g:c,s=o.type,f=K(e),l=K(r),d=E(a)?a:[a],p=l.length-f.length,v=t;if(p>0){var h=l.substring(v-p,v).replace(u,"").length;v-=p-h;for(var g=0;h>0;)-1!==d.indexOf(n.charAt(v-h+g))?g++:h--;v+=g}return("mobile"===s&&(4===v||9===v)||"bankCard"===s&&v>0&&v%5==0)&&(v-=1),v},t.checkFileType=Re,t.compressImage=function(t,e){return void 0===e&&(e={}),new Promise((function(r,n){var o=e.width,i=e.height,a=e.rotate,c=e.offset,u=void 0===c?[0,0]:c,s=e.background,f=void 0===s?"#fff":s,l=e.canvasWidth,d=e.canvasHeight,p=e.format,v=void 0===p?"blob":p,h=e.type,g=void 0===h?"image/jpeg":h,m=e.quality,y=void 0===m?.8:m,b=e.beforeCompress,w=e.beforeDraw,x=e.afterDraw,j=e.ajaxOptions;ze(t,j).then((function(t){var c=t.image,s=t.blob,p=M(o),h=M(i),m=M(y);p&&(c.width=p),h&&(c.height=h),null==b||b({image:c,blob:s},e);var j=document.createElement("canvas"),O=j.getContext("2d"),N={image:c,blob:s,canvas:j,context:O},E=M("function"==typeof l?l(N,e):l),A=M("function"==typeof d?d(N,e):d);j.width=E||c.width,j.height=A||c.height;var C="none"===f||"transparent"===f;C?O.clearRect(0,0,j.width,j.height):(O.fillStyle=f,O.fillRect(0,0,j.width,j.height));var k=[0,0];a!==Ft&&(O.translate(c.width/2,c.height/2),k=[-c.width/2,-c.height/2],O.rotate(a*Math.PI/180));var F="function"==typeof u?u(N,e):u;null==w||w(N,e);var T=k[0]+M(F[0]),P=k[1]+M(F[1]);O.drawImage(c,T,P,c.width,c.height),"image/png"===g&&C&&(O.globalCompositeOperation="destination-in",O.drawImage(c,T,P,c.width,c.height)),null==x||x(N,e),"blob"===v?function(t,e,r){return new Promise((function(n){t.toBlob((function(t){n(t)}),e,r)}))}(j,g,m).then(r).catch(n):r(j.toDataURL(g,m))})).catch(n)}))},t.dataURLToBlob=ke,t.divide=Pe,t.download=function t(e,r){return oe(this,void 0,void 0,(function(){var n,o,i,a,c,u,s,f,l,d,p,v,h;return ie(this,(function(g){switch(g.label){case 0:return n="object"==typeof r?r:{},"string"==typeof r&&(n.fileName=r),o=n.fileName,i=n.type,a=n.dataType,c=n.transformRequest,u=n.transformResponse,"string"!=typeof e?[3,8]:a||!/^blob:.*?\/.*/.test(e)?[3,1]:(Ue(e,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(e)?[3,2]:(s=ke(e),[3,7]);case 2:return"url"===a||!a&&qt(e)?(f=function(t){var e="function"==typeof u?u(t):t;return et(e)?e:Promise.resolve(e)},[4,function(t){var e="function"==typeof c?c(t):t;return et(e)?e:Promise.resolve(e)}({responseType:"blob"})]):[3,6];case 3:return l=g.sent(),[4,Me(e,l)];case 4:return d=g.sent(),[4,f(d.target.response)];case 5:return p=g.sent(),v=o||e.split("?")[0].split("#")[0].split("/").pop(),[2,t(p,{fileName:v,type:i||(W(p)?p.type:Ft)})];case 6:s=new Blob([e],{type:i||"text/plain"}),g.label=7;case 7:return[3,9];case 8:e instanceof Blob&&(s=e),g.label=9;case 9:return s||(s=new Blob([e],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(Ue(h=St(s),o),Mt(h)),[2,Promise.resolve()]}}))}))},t.fileReader=function(t,e){void 0===e&&(e="dataURL");var r=Ce[e];return r||(r=Ce.dataURL),new Promise((function(e,n){var o=new FileReader;o[r](t),o.onload=function(){return e(o.result)},o.onerror=function(t){return n(t)}}))},t.filterTree=function t(e,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return E(e)?(e.forEach((function(e){var a=e;if(C(e)&&(a="spread"===o?ne({},e):e),r(a)){if(C(a)){var c=a[n];E(c)&&c.length>0&&(a[n]=t(c,r,n,o))}i.push(a)}})),i):i},t.findTreeNode=function(t,e,r){void 0===r&&(r="children");var n,o=[];return E(t)&&z(t,(function(t){for(o.push(t);o.length;){var i=o.pop();if(e(i)){n=i;break}if(C(i)){var a=i[r];E(a)&&a.length>0&&a.forEach((function(t){o.push(t)}))}}if(n)return!1})),n},t.findTreeNodes=function(t,e,r){void 0===r&&(r="children");var n=[],o=[];return E(t)&&z(t,(function(t){for(n.push(t);n.length;){var i=n.pop();if(e(i)&&o.push(i),C(i)){var a=i[r];E(a)&&a.length>0&&a.forEach((function(t){n.push(t)}))}}})),o},t.findTreeSelect=function(t,e,r){return void 0===r&&(r="children"),qe(t,e,r)},t.formatBankCard=function(t,e){void 0===t&&(t="");var r=e||{},n=r.spaceMark,o=void 0===n?" ":n,i=r.length,a=void 0===i?4:i,c=new RegExp("(.{".concat(a,"})"),"g"),u=new RegExp("".concat(o),"g"),s=K(t).replace(u,""),f=s.replace(c,"$1".concat(o));return s.length%a==0?f.substring(0,f.length-1):f},t.formatMobile=function(t,e){void 0===t&&(t="");var r=(e||{}).spaceMark,n=void 0===r?" ":r,o=new RegExp(n,"g"),i=K(t).replace(o,"").substring(0,11);return i.length>7?i.replace(/^(...)(....)/g,"$1".concat(n,"$2").concat(n)):i.length>3?i.replace(/^(...)/g,"$1".concat(n)):i},t.formatMoney=function(t,e){void 0===e&&(e={});var r=e.precision,n=void 0===r?2:r,o=e.symbol,i=e.thousand,a=void 0===i?",":i,c=e.decimal,u=void 0===c?".":c,s=e.strict,f=void 0===s||s;if(!function(t){return ee(t)?("number"==typeof t&&ve(t),!0):(bt("".concat(t," invalid parameter.")),!1)}(t)||f&&(!rt(t)||""===t)&&!U(t))return"";if("number"==typeof t&&!isFinite(t))return t+"";"number"!=typeof n||tt(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",u="string"==typeof u?u:".";var l=ae((fe(t)+"").split("."),2),d=l[0],p=l[1];return o+function(t,e){var r,n,o="";t="+"===(t=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=t))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?t.substring(1):t;for(var i=Number(t)<0?"-":"",a=i?t.substring(1).split("").reverse():t.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?e:"");return i+o.split("").reverse().join("")}(d,a)+function(t,e,r){if(0===e)return"";var n="";return n=t&&Number(t)>0?parseFloat("0."+t).toFixed(e).substring(2):(0).toFixed(e).substring(2),r+n}(p,n,u)},t.gcd=Se,t.getFileBlob=Le,t.getFileType=function(t){var e;return(W(t)||Ie(t))&&z(Ve,(function(r,n){if(Re(t,r))return e=n,!1})),e},t.getImageInfo=function(t,e){return ze(t,e).then((function(t){var e,r,n,o=t.image,i=t.blob,a=o.width,c=o.height;return{width:a,height:c,contrast:(e=a,r=c,n=Se(e,r),"".concat(Pe(ot(e),n),":").concat(Pe(ot(r),n))),measure:"".concat(a," × ").concat(c," px"),size:Ne(i.size),bytes:i.size,image:o,blob:i}}))},t.getMimeType=function(t){var r,n,o,i=rt(t)&&t.indexOf(".")>0?(n=t.split("."),void 0===(o=-1)&&(o=0),I(n)?n[o+=o<0?n.length:0]:e):"";return i?null===(r=De.find((function(t){return t[1].includes(i)})))||void 0===r?void 0:r[0]:Ft},t.isBankCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.luhn,i=void 0!==o&&o,a=K(t),c=n?ht.test(a):vt.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(function(t){for(var e=(t+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<e.length;n++){var o=parseInt(e[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}(u))}return c},t.isBusinessLicense=function(t,e){void 0===e&&(e={});var r=K(t),n=e.checkCode,o=void 0===n||n,i=Gt.test(r);if(!o||!i)return i;var a=r.substring(0,14),c=r.substring(r.length-1),u=function(t){for(var e=10,r=0;r<14;r++){var n=(e+Number(t[r]))%10;e=2*(n=0===n?10:n)%11}return 1===e?0:11-e}(a);return c===String(u)},t.isChinese=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.useExtend,i=void 0!==o&&o,a=K(t),c=i&&zt;return new RegExp(c?n?Lt:$t:n?It:Rt,c?"u":Ft).test(a)},t.isEmail=function(t){var e=K(t);return ft.test(e)},t.isHMCard=function(t){var e=K(t);return Jt.test(e)},t.isIPv4=function(t){var e=K(t);return Ut.test(e)},t.isIPv6=function(t){var e=K(t);return Vt.test(e)},t.isIdCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.checkCode,i=void 0===o||o,a=K(t);return 15===a.length&&n?st.test(a):!(18!==a.length||!st.test(a))&&(!i||function(t){var e,r;for(r=e=0;e<17;e++)r+=Math.pow(2,17-e)%11*Number(t[e]);var n=(12-r%11)%11;return n<10?n===Number(t[17]):"X"===t[17].toUpperCase()}(a))},t.isMobile=function(t){var e=K(t);return at.test(e)},t.isPassport=function(t){var e=K(t);return At.test(e)},t.isPassword=function(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special;return Et(t,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},t.isPostcode=function(t){var e=K(t);return ut.test(e)},t.isQQ=function(t){var e=K(t);return lt.test(e)},t.isSocialCreditCode=function(t,e){var r=K(t),n=(e||{}).checkCode,o=void 0===n||n,i=gt.test(r);if(!o||!i)return i;var a=r.substring(0,17),c=r.substring(r.length-1),u=function(t){for(var e=0,r=function(r){var n=mt.findIndex((function(e){return e===t[r]})),o=Math.pow(3,r)%31;e+=n*o},n=0;n<17;n++)r(n);var o=e%31;return mt[0!==o?31-o:0]}(a);return c===u},t.isSwiftCode=function(t){var e=K(t);return te.test(e)},t.isTWCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=K(t);return!!Qt.test(o)||!!n&&Yt.test(o)},t.isTelephone=function(t){var e=K(t);return ct.test(e)},t.isUrl=qt,t.isValidNumber=ee,t.isVehicle=function(t){var e=K(t);return pt.test(e)},t.isWX=function(t){var e=K(t);return dt.test(e)},t.lcm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map((function(t){return Math.abs(ot(t))}));return 1===r.length&&(r=r.concat([1])),Pe(r.indexOf(0)>-1?0:Te.apply(void 0,ce([],ae(r),!1)),Se.apply(void 0,ce([],ae(r),!1)))},t.listToTree=function(t,e){void 0===e&&(e={});var r=e.keyField,n=void 0===r?"id":r,o=e.parentField,i=void 0===o?"pid":o,a=e.childrenField,c=void 0===a?"children":a,u=e.emptyChildrenValue,s=void 0===u?"none":u,f=e.nodeAssign,l=void 0===f?"spread":f,d=[],p={};return E(t)?(t.forEach((function(t){if(C(t)){var e="spread"===l?ne({},t):t,r=e[n],o=e[i];p[r]?e[c]=p[r]:e[c]=p[r]=[],o?p[o]?p[o].push(e):p[o]=[e]:d.push(e)}})),"array"!==s&&Xe(d,e),d):d},t.loadImage=$e,t.loadImageWithBlob=ze,t.loadScript=function(t,e){return new Promise((function(r,n){var o=document.head,i=document.createElement("script"),a=e||{},c=a.attrs,u=a.destroyOnError,s=void 0===u||u,f=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(a,["attrs","destroyOnError"]),l=ne(ne({async:!0,type:"text/javascript"},f),{src:t});for(var d in l)"onload"!==d&&"onerror"!==d&&(i[d]=l[d]);"object"==typeof c&&Tt(c).forEach((function(t){i.setAttribute(t,c[t])})),i.onload=function(t){var e;this.onerror=this.onload=null,null===(e=l.onload)||void 0===e||e.call(this,t),r(i)},i.onerror=function(t){var e;this.onerror=this.onload=null,null===(e=l.onerror)||void 0===e||e.call(this,t),s&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},t.minus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=fe(n),o=fe(o),tt(n)||tt(o))return Number.NaN;var a=Math.pow(10,Math.max(de(n),de(o)));return(Te(n,a)-Te(o,a))/a},t.numberToChinese=function(t,e){void 0===e&&(e={});var r=e.big5,n=void 0!==r&&r,o=e.unit,i=void 0===o||o,a=e.zero,c=void 0===a?"":a,u=e.negative,s=void 0===u?"负":u,f=e.unitConfig,l=void 0===f?{}:f,d=e.decimal,p=void 0===d?"":d;if("number"!=typeof t||tt(t))return bt("参数错误 ".concat(t,",请传入数字")),"";ve(t),n?(he=we.slice(),ge=xe.slice(),p=p||"點"):(he=ye.slice(),ge=be.slice(),p=p||"点");var v=(null==l?void 0:l.w)||"万",h=(null==l?void 0:l.y)||"亿";me=["",v,h,v+h],c&&(he[0]=c);var g,m=t<0?s:"",y=Math.abs(t);g=i?function(t){var e=Math.floor(t),r=0,n="",o="",i=!1;if(0===e)return he[0];for(;e>0;){var a=e%1e4;i&&(o=he[0]+o),n=je(a),o=(n+=0!==a?me[r]:me[0])+o,i=a<1e3&&a>0,e=Math.floor(e/1e4),r++}return o}(y):Oe(Math.floor(y));var b=function(t){var e=t+"",r=e.indexOf("."),n="";return r>-1&&(n=Oe(e.slice(r+1))),n}(y);return b?"".concat(m).concat(g).concat(p).concat(b):"".concat(m).concat(g)},t.padZero=function(t,e){void 0===e&&(e=2);var r=K(t),n=r.length;return("number"!=typeof e||e<0)&&(e=0),n<e?"0".repeat(e-n)+r:r},t.parseIdCard=function(t){var e=Ee.exec(t);if(!e)return null;var r={province:e[1],city:e[2],area:e[3],year:e[4],month:e[5],day:e[6],gender:e[7]},n=Ae.find((function(t){return t[0]===r.province}));if(!n)return null;var o="".concat(r.year,"-").concat(r.month,"-").concat(r.day),i=Number(r.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:r}},t.plus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=fe(n),o=fe(o),tt(n)||tt(o))return Number.NaN;var a=Math.pow(10,Math.max(de(n),de(o)));return(Te(n,a)+Te(o,a))/a},t.randomString=function(t,e){var r;return void 0===t&&(t=0),r="string"!=typeof e?We:Ze[e]?Ze[e]:e,He(M(t),r)},t.replaceChar=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.char,n=void 0===r?"*":r,o=e.exclude,i=e.start,a=void 0===i?3:i,c=e.end,u=void 0===c?-4:c,s=e.repeat,f=K(t),l=f.length;if(Math.abs(a)>=l)return f;if((a=a>=0?a:l+a)>=(u=u>=0?u:l+u))return f;var d=f.substring(a,u);if(o){var p=new RegExp("[^".concat(o,"]"),"g");d=d.replace(p,n)}else s="number"==typeof s&&s>=0?s:d.length,d=n.repeat(s);return f.substring(0,a)+d+f.substring(u)},t.round=function(t,e){return void 0===e&&(e=0),ot(t,e)},t.safeDate=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n="string"==typeof t?t.replace(/[\\.-]/g,"/"):t;return e&&e.length>0?new(Date.bind.apply(Date,ce([void 0,n],ae(e),!1))):void 0===n?new Date:new Date(n)},t.setDataURLPrefix=function(t,e,r){return void 0===e&&(e="image/png"),void 0===r&&(r=!0),"data:".concat(e).concat(r?";base64":"",",").concat(t)},t.setDisableWarning=function(t){yt.disableWarning=!!t},t.strlen=function(t){for(var e=K(t),r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},t.times=Te,t.transformFieldNames=function(t,e,r,n){return void 0===n&&(n="spread"),E(t)?t.length<=0?[]:function t(o){return o.map((function(o){if(!C(o))return o;var i="spread"===n?ne({},o):o,a=[];r&&E(i[r])&&i[r].length>0&&(i[r]=t(i[r].slice()));var c=Tt(e);return c.forEach((function(t){var r=e[t];r in i&&(i[t]=i[r],-1===c.indexOf(r)&&a.push(r))})),a.length>0&&a.forEach((function(t){delete i[t]})),i}))}(t.slice()):t},t.transformObjectValue=Fe,t.treeToList=function(t,e){var r=[];return E(t)?(function t(n){n.forEach((function(n){if(C(n)){var o=ne({},n);r.push(o),o[e]&&(E(o[e])&&o[e].length>0&&t(o[e]),delete o[e])}else r.push(n)}))}(t),r):r},t.validatePassword=Et}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).utilHelpers={})}(this,(function(t){"use strict";var e=void 0,r="undefined",n="object",o=Object.prototype,i=o.toString,a=o.hasOwnProperty,c=o.propertyIsEnumerable,u=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,f=Object.keys,l=Function.prototype.toString,d=typeof Symbol!==r?Symbol.prototype:e,p=Math.min,v=Math.max,h=Math.random,g=Math.floor,m=Math.ceil,y=Number.isFinite,b=typeof globalThis===n&&globalThis,w=typeof global===n&&global,x=typeof self===n&&self,j=Number.MAX_SAFE_INTEGER||9007199254740991,O=Number.MIN_SAFE_INTEGER||-9007199254740991,N=["Function","AsyncFunction","GeneratorFunction","Proxy"].map((function(t){return"[object "+t+"]"}));function E(t){return Array.isArray(t)}function A(t){return null!==t&&"object"==typeof t}function C(t){return"function"==typeof t||A(t)}function k(t){return i.call(t)}function F(t){return"symbol"==typeof t||"[object Symbol]"===k(t)}var T=/^0b[01]+$/i,P=/^0o[0-7]+$/i,S=/^[-+]0x[0-9a-f]+$/i;function M(t){if("number"==typeof t)return t;if(F(t))return NaN;if(C(t)&&(t=Number(t)),"string"!=typeof t)return 0===t?t:+t;t=t.trim();var e=T.test(t);return e||P.test(t)?parseInt(t.slice(2),e?2:8):S.test(t)?NaN:+t}function _(t){return t}function I(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=j}(t.length)&&!function(t){if("function"==typeof t)return!0;var e=k(t);return N.some((function(t){return t===e}))}(t)}function R(t){return t?(t=M(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function B(t,e){void 0===t&&(t=0),void 0===e&&(e=1),t=R(t),e=R(e);var r=m(p(t,e)||0),n=g(v(t,e)||0);if(r>n){var o=r;r=n,n=o}return g(r+h()*(n-r+1))}function L(t){return C(t)?f(t).concat(function(t){return u&&null!==t?u(t).filter((function(e){return c.call(t,e)})):[]}(t)):[]}var $,z=($=1,function(t,e){void 0===e&&(e=_);for(var r=!I(t)&&L(t),n=(r||t).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===e(t[i],i,t))break;o+=$}return t});function U(t){return"number"==typeof t||"[object Number]"===k(t)}var V=d?d.toString:e;function D(t){if("string"==typeof t)return t;if(E(t))return""+t.map(D);if(F(t))return V?V.call(t):"";var e=""+t;return"0"===e&&1/t==-1/0?"-0":e}function K(t){return function(t){return null==t}(t)?"":D(t)}var Z=typeof Blob!==r;function W(t){return!!(Z&&t instanceof Blob)||"[object Blob]"===k(t)}var H=l.call(Object);function X(t){if(!A(t)||"[object Object]"!==k(t))return!1;var e=s(Object(t));if(null===e)return!0;var r=a.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)===H}var q=typeof File!==r;var G=b&&globalThis.Object===Object&&globalThis,J=w&&global.Object===Object&&global,Q=x&&self.Object===Object&&self,Y=G||J||Q||Function("return this")();function tt(t){return U(t)&&Y.isNaN(t)}function et(t){return C(t)&&"function"==typeof t.then}function rt(t){return"string"==typeof t||"[object String]"===k(t)}function nt(t,e,r){void 0===r&&(r=0);var n=Math[t];if(e=M(e),r=p(function(t){var e=M(t);if(!e||e===1/0||e===-1/0)return e==e?e:0;var r=e%1;return r?e-r:e}(r),292),0===r||!function(t){return y?y(t):"number"==typeof t&&Y.isFinite(t)}(e))return n(e);var o=K(e).split("e");return+((o=K(e=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function ot(t,e){return nt("round",t,e)}var it=0;h().toString(36).substring(2,4);var at=/^1[3456789]\d{9}$/;var ct=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var ut=/^\d{6}$/;var st=/^[1-9]\d{5}(19|20)?\d{2}((0[1-9])|(1[012]))(([0-2][1-9])|10|20|30|31)\d{3}(\d|X)?$/i;var ft=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var lt=/^[1-9]\d{4,10}$/;var dt=/^[a-z]([-_a-z0-9]{5,19})+$/i;var pt=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})|([A-Z0-9]{5}[DF])|([DF][A-Z0-9]{5}))$/;var vt=/^[1-9]\d{9,20}$/,ht=/^\d{8,30}$/;var gt=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,mt="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");var yt={disableWarning:!0};function bt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];yt.disableWarning||console.warn.apply(void 0,t)}var wt=/\d/,xt=/[a-z]/,jt=/[A-Z]/,Ot=/[\d|a-z]/gi;function Nt(t){return t.indexOf("\\x")>-1||t.indexOf("\\u")>-1}function Et(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=t;"string"!=typeof t&&(bt("[validatePassword] value must be a string."),u="");var s=0,f=wt.test(u),l=xt.test(u),d=jt.test(u),p=function(t,e){if(!e||!t)return!1;var r=t.replace(Ot,"");if(!r)return!1;var n=Nt(e)?new RegExp("[".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return e.indexOf(t)>-1&&(o=!0),o})),o}(u,c),v=function(t,e){if(!t)return!1;var r=t.replace(Ot,"");if(!r)return!1;if(!e)return!0;var n=Nt(e)?new RegExp("[^".concat(e,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some((function(t){return-1===e.indexOf(t)&&(o=!0),o})),o}(u,c);return f&&(s+=1),i?(l||d)&&(s+=1):(l&&(s+=1),d&&(s+=1)),p&&(s+=1),{validated:s>=n&&!v,level:s,containes:{number:f,lowerCaseLetter:l,upperCaseLetter:d,specialCharacter:p,unallowableCharacter:v}}}var At=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var Ct,kt="undefined"!=typeof URL,Ft=void 0,Tt=Object.keys,Pt=Object.values,St=kt?URL.createObjectURL:(Ct="",function(){return Ct}),Mt=kt?URL.revokeObjectURL:function(){},_t={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},It=_t.chineseBasic+"+",Rt="^"+_t.chineseBasic+"+$",Bt="(?:"+Pt(_t).join("|")+")",Lt=Bt+"+",$t="^"+Bt+"+$",zt=RegExp.prototype.hasOwnProperty("unicode");var Ut=/^((\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;var Vt=/^((([0-9A-F]{1,4}:){7}([0-9A-F]{1,4}|:))|(([0-9A-F]{1,4}:){6}(:[0-9A-F]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){5}(((:[0-9A-F]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3})|:))|(([0-9A-F]{1,4}:){4}(((:[0-9A-F]{1,4}){1,3})|((:[0-9A-F]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){3}(((:[0-9A-F]{1,4}){1,4})|((:[0-9A-F]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){2}(((:[0-9A-F]{1,4}){1,5})|((:[0-9A-F]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(([0-9A-F]{1,4}:){1}(((:[0-9A-F]{1,4}){1,6})|((:[0-9A-F]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:))|(:(((:[0-9A-F]{1,4}){1,7})|((:[0-9A-F]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|\d{1,2})(\.(25[0-5]|2[0-4]\d|1\d\d|\d{1,2})){3}))|:)))(%.+)?$/i;var Dt="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",Kt=":\\d+",Zt="\\/.*",Wt="\\?.*",Ht=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(Dt,")(?:").concat(Kt,")?(?:").concat(Zt,")*(?:").concat(Wt,")?(?:").concat("#.*",")?$")),Xt=new RegExp("^(?:".concat(Dt,")(?:").concat(Kt,")?(?:").concat(Zt,")*(?:").concat(Wt,")?(?:").concat("#.*",")?$"));function qt(t){var e=K(t);return Ht.test(e)||Xt.test(e)}var Gt=/^\d{15}$/;var Jt=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var Qt=/^\d{8}$/i,Yt=/^[\da-z]{10,12}$/i;var te=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function ee(t,e){var r;return void 0===e&&(e=!1),"number"==typeof(r=e?"string"==typeof t&&""!==t?Number(t):t:"number"==typeof t?t:F(t)?Number.NaN:Number(t))&&!tt(r)}var re=function(t,e){return re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},re(t,e)};var ne=function(){return ne=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},ne.apply(this,arguments)};function oe(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function c(t){try{u(n.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(t.value).then(a,c)}u((n=n.apply(t,e||[])).next())}))}function ie(t,e){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&c[0]?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,n=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=e.call(t,i)}catch(t){c=[6,t],n=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}function ae(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function ce(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var ue=/^[-+]?0[b|o|x]\d+/i,se=/^\.\d+/;function fe(t){var e;return rt(t)?""===(e=t.trim())?e=Number(e):ue.test(e)||se.test(e)?e=M(e):tt(Number(e))&&(e=Number.NaN):e=F(t)?Number.NaN:U(t)?t:Number(t),tt(e)?Number.NaN:e}function le(t,e){return void 0===e&&(e=12),+parseFloat(t.toPrecision(e))}function de(t){var e=t.toString().split(/e/i),r=(e[0].split(".")[1]||"").length-+(e[1]||0);return r>0?r:0}function pe(t){var e=String(t);if(!function(t){return/\d+\.?\d*e[+-]*\d+/i.test(t)}(e))return Number(e.replace(".",""));var r=de(t);return r>0?le(+t*Math.pow(10,r)):+t}function ve(t){(+t>j||+t<O)&&bt("".concat(t," is beyond boundary when transfer to integer, the results may not be accurate"))}var he,ge,me,ye=["零","一","二","三","四","五","六","七","八","九"],be=["","十","百","千"],we=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],xe=["","拾","佰","仟"];function je(t){for(var e="",r="",n=!1,o=0;t>0;){var i=t%10;0==i?n&&(n=!1,r=he[i]+r):(n=!0,e=he[i],r=(e+=ge[o])+r),o++,t=Math.floor(t/10)}return r}function Oe(t){for(var e=t+"",r="",n=0,o=e.length;n<o;n++)r+=he[parseInt(e[n])];return r}function Ne(t,e){void 0===e&&(e={});var r=e.spaceMark,n=void 0===r?" ":r,o=e.precision,i=void 0===o?2:o,a="number"!=typeof t?Number(t):t;if(0===a||tt(a))return"0".concat(n,"B");var c=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],u=Math.floor(Math.log(a)/Math.log(1024));return c[u]?"".concat(Number((a/Math.pow(1024,u)).toFixed(i))).concat(n).concat(c[u]):a+""}var Ee=/^(\d{2})(\d{2})(\d{2})((?:\d{2})?\d{2})(\d{2})(\d{2})\d{2}(\d)(?:\d|X)?$/i,Ae=[["11","北京市"],["12","天津市"],["13","河北省"],["14","山西省"],["15","内蒙古自治区"],["21","辽宁省"],["22","吉林省"],["23","黑龙江省"],["31","上海市"],["32","江苏省"],["33","浙江省"],["34","安徽省"],["35","福建省"],["36","江西省"],["37","山东省"],["41","河南省"],["42","湖北省"],["43","湖南省"],["44","广东省"],["45","广西壮族自治区"],["46","海南省"],["50","重庆市"],["51","四川省"],["52","贵州省"],["53","云南省"],["54","西藏自治区"],["61","陕西省"],["62","甘肃省"],["63","青海省"],["64","宁夏回族自治区"],["65","新疆维吾尔自治区"],["71","台湾省"],["83","台湾省"],["81","香港特别行政区"],["82","澳门特别行政区"]];var Ce=function(t,e,r){if(void 0===r&&(r=!0),X(t)){var n={};return z(t,(function(t,o){var i=r&&(X(t)||E(t))?Ce(t,e):e(t,o);n[o]=i})),n}if(E(t)){var o=[];return z(t,(function(t,n){var i=r&&(X(t)||E(t))?Ce(t,e):e(t,n);o.push(i)})),o}return t};function ke(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return ke.apply(void 0,[ke(r,n)].concat(o));if(r=fe(r),n=fe(n),tt(r)||tt(n))return Number.NaN;var i=pe(r),a=pe(n),c=de(r)+de(n),u=i*a;return ve(u),u/Math.pow(10,c)}function Fe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?1:t[1],o=t.slice(2);if(o.length>0)return Fe.apply(void 0,[Fe(r,n)].concat(o));if(r=fe(r),n=fe(n),tt(r)||tt(n))return Number.NaN;var i=pe(r),a=pe(n);return ve(i),ve(a),ke(i/a,le(Math.pow(10,de(n)-de(r))))}function Te(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[0],n=void 0===t[1]?0:t[1],o=t.slice(2);if(o.length>0)return Te.apply(void 0,[Te(r,n)].concat(o));if(r=Math.abs(ot(r)),n=Math.abs(ot(n)),tt(r)||tt(n))return Number.NaN;if(0===r&&0===n)return 0;if(0===r)return n;if(0===n)return r;var i=n;for(r<n&&(i=r,r=n,n=i);i;)i=r%n,r=n,n=i;return M(r)}function Pe(t,e){var r=e||{},n=r.method,o=void 0===n?"get":n,i=r.data,a=void 0===i?null:i,c=r.timeout,u=r.headers,s=r.withCredentials,f=void 0!==s&&s,l=r.async,d=void 0===l||l,p=r.user,v=void 0===p?null:p,h=r.password,g=void 0===h?null:h,m=r.responseType,y=r.onReadyStateChange,b=r.onLoadStart,w=r.onProgress,x=r.onAbort,j=r.onTimeout,O=r.onError,N=r.onLoad,E=r.onLoadEnd;return new Promise((function(e,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),t,d,v,g),y&&(n.onreadystatechange=y),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,m&&(n.responseType=m),"object"==typeof u&&Tt(u).map((function(t){n.setRequestHeader(t,u[t])}));var i,s=function(t){return function(e){r(e),null==t||t.call(n,e)}},l={loadstart:b,progress:w,abort:s(x),timeout:s(j),error:s(O),load:(i=N,function(t){e(t),null==i||i.call(n,t)}),loadend:E};Tt(l).map((function(t){var e=l[t];e&&n.addEventListener(t,e)})),n.send(a)}))}function Se(t){return rt(t)&&t.indexOf(".")>0?"."+(r=t.split("."),void 0===(n=-1)&&(n=0),I(r)?r[n+=n<0?r.length:0]:e):"";var r,n}function Me(t,e){return!!t&&Se(t)===e}function _e(t){return!(!A(t)||!rt(t.name))}function Ie(t,e){var r,n,o=function(t){return!!(q&&t instanceof File)||"[object File]"===k(t)}(t);if(!o&&!_e(t))return!1;if(rt(e)||(e=K(e)),!(e=e.trim())||"*"===e)return!0;var i=!1,a=e.toLowerCase().split(/,(?:\s+)?/),c=(t.name||!o&&(t.fileName||(null===(r=t.originFileObj)||void 0===r?void 0:r.name))||"").toLowerCase(),u=t.type||!o&&(null===(n=t.originFileObj)||void 0===n?void 0:n.type)||"",s=!o&&t.url||"";return a.some((function(t){if("*"===t||u===t||0===t.indexOf(".")&&(Me(c,t)||Me(s,t)))i=!0;else if(t.includes("/*")&&u.includes("/")){var e=t.match(/(.*)\/\*/),r=u.split("/")[0];e&&e[1]===r&&(i=!0)}return i})),i}var Re=[200,304];function Be(t,e){return new Promise((function(r,n){W(t)?r(t):Pe(t,ne({responseType:"blob"},e)).then((function(e){var o=e.target.status;if(-1!==Re.indexOf(o))r(e.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(t,"'."));console.error(i),n(i)}})).catch((function(t){console.error(new Error("Failed to request file. ".concat(t))),n(t)}))}))}function Le(t){return new Promise((function(e,r){var n=W(t),o=n?St(t):t,i=new Image;n||(i.crossOrigin="anonymous"),i.onload=function(){e(i)},i.onerror=function(e){n&&Mt(o),console.error("[loadImage] The image load failed, '".concat(t,"'.")),r(e)},i.src=o}))}function $e(t,e){return Be(t,e).then((function(t){return Le(t).then((function(e){return{blob:t,image:e}}))}))}function ze(t){for(var e=t.split(","),r=e[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(e[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}function Ue(t,e){void 0===e&&(e="");var r=document.createElement("a");r.href=t,r.style.display="none",r.setAttribute("download",e),r.addEventListener("click",(function t(e){e.stopPropagation(),r.removeEventListener("click",t)})),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var Ve={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"},De={image:"image/*,.jpeg,.jpg,.gif,.bmp,.png,.webp,.svg,.apng,.avif,.ico,.tif,.tiff",audio:"audio/*,.mp3,.wav,.aac,.flac",video:"video/*,.mp4,.webm,.ogg,.mov",pdf:"application/pdf,.pdf",word:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,.doc,.docx",excel:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel,.xls,.xlsx"};var Ke=[["text/plain",["txt"]],["text/css",["css"]],["text/html",["htm","html"]],["text/javascript",["js","mjs"]],["text/csv",["csv"]],["text/markdown",["md","markdown"]],["image/gif",["gif"]],["image/jpeg",["jpg","jpeg","jfif","pjpeg","pjp"]],["image/png",["png"]],["image/svg+xml",["svg"]],["image/webp",["webp"]],["image/apng",["apng"]],["image/avif",["avif"]],["image/bmp",["bmp"]],["image/x-icon",["ico","cur"]],["image/tiff",["tif","tiff"]],["application/xml",["xml"]],["application/zip",["zip"]],["application/pdf",["pdf"]],["application/json",["json"]],["application/yaml",["yaml","yml"]],["application/vnd.openxmlformats-officedocument.wordprocessingml.document",["doc","docx"]],["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",["xls","xlsx"]],["audio/mp3",["mp3"]],["audio/wav",["wav"]],["audio/aac",["aac"]],["audio/flac",["flac"]],["video/mp4",["mp4"]],["video/ogg",["ogg"]],["video/webm",["webm"]],["video/quicktime",["mov"]]];var Ze="abcdefghijklmnopqrstuvwxyz",We={number:"0123456789",lower:Ze,upper:Ze.toUpperCase()},He=We.number+We.lower+We.upper;function Xe(t,e,r){for(void 0===r&&(r="");t-- >0;){return Xe(t,e,r+e[B(0,e.length-1)])}return r}function qe(t,e){var r=e.childrenField,n=void 0===r?"children":r,o=e.emptyChildrenValue,i=void 0===o?"none":o;t.forEach((function(t){t[n].length<=0?"null"===i?t[n]=null:delete t[n]:qe(t[n],e)}))}function Ge(t,e,r,n){void 0===n&&(n=[]);var o=[];return E(t)&&z(t,(function(t){if(n.push(t),e(t))return o=n,!1;if(C(t)){var i=t[r];if(E(i)&&i.length>0){var a=Ge(i,e,r,n);if(a.length>0)return o=a,!1}}n.pop()})),o}var Je=function(){function t(){this.handlers={}}return t.prototype.eventNames=function(){var t,e=(null===(t=Object.getOwnPropertySymbols)||void 0===t?void 0:t.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(e)},t.prototype.rawListeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.raw})):[]},t.prototype.listeners=function(t){var e=this.handlers[t];return e?e.map((function(t){return t.wrap})):[]},t.prototype.hasListener=function(t,e){return this.rawListeners(t).some((function(t){return t===e}))},t.prototype._on=function(t,e,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:e,wrap:r,context:n};if(this.handlers[t]){var a=1===o?"push":"unshift";this.handlers[t][a](i)}else this.handlers[t]=[i];return this},t.prototype.prependListener=function(t,e,r){return this._on(t,e,e,r,0)},t.prototype.on=function(t,e,r){return this._on(t,e,e,r)},t.prototype._wrapOnce=function(t,e,r){var n=this;void 0===r&&(r=null);var o=function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];e.apply(r,i),n.off(t,o)};return o},t.prototype.once=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r)},t.prototype.prependOnceListener=function(t,e,r){var n=this._wrapOnce(t,e,r);return this._on(t,e,n,r,0)},t.prototype.off=function(t,e){var r=this.handlers[t];if(r)if(e){var n=r.findIndex((function(t){return t.wrap===e||t.raw===e}));-1!==n&&r.splice(n,1)}else delete this.handlers[t];return this},t.prototype.offAll=function(){return this.handlers={},this},t.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this.handlers[t];return!!(n&&n.length>0)&&(n.forEach((function(t){t.wrap.apply(t.context,e)})),!0)},t}(),Qe={},Ye=function(){function t(t){void 0===t&&(t="default"),this.scope=t,Qe[this.scope]||(Qe[this.scope]={}),this.data=Qe[this.scope]}return t.prototype.getItem=function(t){return t in this.data?this.data[t]:null},t.prototype.setItem=function(t,e){this.data[t]=e},t.prototype.removeItem=function(t){delete this.data[t]},t.prototype.clear=function(){Qe[this.scope]={},this.data=Qe[this.scope]},t}();function tr(t){try{var e="object"==typeof t&&null!==t&&!!t.setItem&&!!t.getItem&&!!t.removeItem;if(e){var r=Math.random().toString(16).substring(2,8)+(new Date).getTime();if(t.setItem(r,"1"),"1"!==t.getItem(r))return!1;t.removeItem(r)}return e}catch(e){return console.error("[cache2] ".concat(t," is not supported. The default memory cache will be used.")),!1}}var er=function(){function t(t,e){void 0===e&&(e={});var r=!!t&&tr(t);this.options=ne({needParsed:r,prefix:""},e),this.storage=r?t:new Ye(this.options.memoryScope)}return t.prototype.getKey=function(t){return this.options.prefix+t},t.prototype.get=function(t){var e=this.storage.getItem(this.getKey(t));return this.options.needParsed?function(t,e){try{return JSON.parse(t,e)}catch(e){return t}}(e,this.options.reviver):e},t.prototype.set=function(t,e){this.storage.setItem(this.getKey(t),this.options.needParsed?function(t,e){return JSON.stringify(t,e)}(e,this.options.replacer):e)},t.prototype.del=function(t){this.storage.removeItem(this.getKey(t))},t.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},t}(),rr="default",nr=function(t){function e(e,r){var n,o=t.call(this)||this,i=rr;return"string"==typeof e?i=e||rr:"object"==typeof e&&(n=e),n||"object"!=typeof r||(n=r),o.options=ne({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new er(o.options.storage,ne({memoryScope:i},o.options)),o.cacheKey=i,o.startCheckperiod(),o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}re(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype._check=function(t,e){var r=!0;return 0!==e.t&&e.t<Date.now()&&(r=!1,this.del(t),this.emit("expired",t,e.v)),r},e.prototype._wrap=function(t,e){var r=Date.now(),n="number"==typeof e?e:this.options.stdTTL;return{v:t,t:n>0?r+n:0,n:r}},e.prototype._isLimited=function(t){return this.options.max>-1&&t>=this.options.max},e.prototype._getReplaceKey=function(t,e){var r=t[0];return t.forEach((function(t){(e[t].t<e[r].t||e[t].t===e[r].t&&e[t].n<e[r].n)&&(r=t)})),r},Object.defineProperty(e.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),e.prototype.setCacheValues=function(t){this.storage.set(this.cacheKey,t)},e.prototype.get=function(t){var e=this.cacheValues[t];if(e&&this._check(t,e))return e.v},e.prototype.mget=function(t){var e=this,r={};if(!Array.isArray(t))return r;var n=this.cacheValues;return t.forEach((function(t){var o=n[t];o&&e._check(t,o)&&(r[t]=o.v)})),r},e.prototype.getAll=function(){var t=Object.keys(this.cacheValues);return this.mget(t)},e.prototype.set=function(t,e,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[t]&&this._isLimited(o.length)){var i=this.keys();if(this._isLimited(i.length)){if("replaced"!==this.options.maxStrategy)return!1;var a=this._getReplaceKey(i,n);this.del(a)}}return n[t]=this._wrap(e,r),this.setCacheValues(n),this.emit("set",t,n[t].v),!0},e.prototype.mset=function(t){var e=this,r=!0;return t.forEach((function(t){var n=e.set(t.key,t.value,t.ttl);r&&!n&&(r=!1)})),r},e.prototype.del=function(t){var e=this,r=this.cacheValues,n=0;return(Array.isArray(t)?t:[t]).forEach((function(t){if(r[t]){n++;var o=r[t];delete r[t],e.emit("del",t,o.v)}})),n>0&&this.setCacheValues(r),n},e.prototype.clear=function(){this.storage.del(this.cacheKey)},e.prototype.keys=function(){var t=this,e=this.cacheValues;return Object.keys(e).filter((function(r){return t._check(r,e[r])}))},e.prototype.has=function(t){var e=this.cacheValues[t];return!(!e||!this._check(t,e))},e.prototype.take=function(t){var e,r=this.cacheValues[t];return r&&this._check(t,r)&&(e=r.v,this.del(t)),e},e.prototype.ttl=function(t,e){var r=this.cacheValues,n=r[t];return!(!n||!this._check(t,n))&&(r[t]=this._wrap(n.v,e),!0)},e.prototype.getTtl=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].t},e.prototype.getLastModified=function(t){var e=this.cacheValues,r=e[t];if(r&&this._check(t,r))return e[t].n},e.prototype.startCheckperiod=function(){var t=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout((function(){t.startCheckperiod()}),this.options.checkperiod))},e.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},e}(Je),or=function(){function t(t){this.promiseCache={},this.cache=new nr(""+"uh_async_memo"+ ++it,t)}return t.prototype.run=function(t,e,r){var n=this;if(!e||!rt(e))return t();var o=ne({persisted:!0},r);if(o.persisted){var i=this.cache.get(e);if(i)return Promise.resolve(i)}return this.promiseCache[e]||(this.promiseCache[e]=t().then((function(t){return delete n.promiseCache[e],n.cache.set(e,t,o.ttl),t})).catch((function(t){return delete n.promiseCache[e],Promise.reject(t)}))),this.promiseCache[e]},t}();t.AsyncMemo=or,t.VERSION="5.2.2",t.ajax=Pe,t.bytesToSize=Ne,t.calculateCursorPosition=function(t,e,r,n,o){void 0===o&&(o={});var i=o.placeholderChar,a=void 0===i?" ":i,c=o.maskReg,u=void 0===c?/\D/g:c,s=o.type,f=K(e),l=K(r),d=E(a)?a:[a],p=l.length-f.length,v=t;if(p>0){var h=l.substring(v-p,v).replace(u,"").length;v-=p-h;for(var g=0;h>0;)-1!==d.indexOf(n.charAt(v-h+g))?g++:h--;v+=g}return("mobile"===s&&(4===v||9===v)||"bankCard"===s&&v>0&&v%5==0)&&(v-=1),v},t.checkFileType=Ie,t.compressImage=function(t,e){return void 0===e&&(e={}),new Promise((function(r,n){var o=e.width,i=e.height,a=e.rotate,c=e.offset,u=void 0===c?[0,0]:c,s=e.background,f=void 0===s?"#fff":s,l=e.canvasWidth,d=e.canvasHeight,p=e.format,v=void 0===p?"blob":p,h=e.type,g=void 0===h?"image/jpeg":h,m=e.quality,y=void 0===m?.8:m,b=e.beforeCompress,w=e.beforeDraw,x=e.afterDraw,j=e.ajaxOptions;$e(t,j).then((function(t){var c=t.image,s=t.blob,p=M(o),h=M(i),m=M(y);p&&(c.width=p),h&&(c.height=h),null==b||b({image:c,blob:s},e);var j=document.createElement("canvas"),O=j.getContext("2d"),N={image:c,blob:s,canvas:j,context:O},E=M("function"==typeof l?l(N,e):l),A=M("function"==typeof d?d(N,e):d);j.width=E||c.width,j.height=A||c.height;var C="none"===f||"transparent"===f;C?O.clearRect(0,0,j.width,j.height):(O.fillStyle=f,O.fillRect(0,0,j.width,j.height));var k=[0,0];a!==Ft&&(O.translate(c.width/2,c.height/2),k=[-c.width/2,-c.height/2],O.rotate(a*Math.PI/180));var F="function"==typeof u?u(N,e):u;null==w||w(N,e);var T=k[0]+M(F[0]),P=k[1]+M(F[1]);O.drawImage(c,T,P,c.width,c.height),"image/png"===g&&C&&(O.globalCompositeOperation="destination-in",O.drawImage(c,T,P,c.width,c.height)),null==x||x(N,e),"blob"===v?function(t,e,r){return new Promise((function(n){t.toBlob((function(t){n(t)}),e,r)}))}(j,g,m).then(r).catch(n):r(j.toDataURL(g,m))})).catch(n)}))},t.dataURLToBlob=ze,t.divide=Fe,t.download=function t(e,r){return oe(this,void 0,void 0,(function(){var n,o,i,a,c,u,s,f,l,d,p,v,h;return ie(this,(function(g){switch(g.label){case 0:return n="object"==typeof r?r:{},"string"==typeof r&&(n.fileName=r),o=n.fileName,i=n.type,a=n.dataType,c=n.transformRequest,u=n.transformResponse,"string"!=typeof e?[3,8]:a||!/^blob:.*?\/.*/.test(e)?[3,1]:(Ue(e,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(e)?[3,2]:(s=ze(e),[3,7]);case 2:return"url"===a||!a&&qt(e)?(f=function(t){var e="function"==typeof u?u(t):t;return et(e)?e:Promise.resolve(e)},[4,function(t){var e="function"==typeof c?c(t):t;return et(e)?e:Promise.resolve(e)}({responseType:"blob"})]):[3,6];case 3:return l=g.sent(),[4,Pe(e,l)];case 4:return d=g.sent(),[4,f(d.target.response)];case 5:return p=g.sent(),v=o||e.split("?")[0].split("#")[0].split("/").pop(),[2,t(p,{fileName:v,type:i||(W(p)?p.type:Ft)})];case 6:s=new Blob([e],{type:i||"text/plain"}),g.label=7;case 7:return[3,9];case 8:e instanceof Blob&&(s=e),g.label=9;case 9:return s||(s=new Blob([e],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(Ue(h=St(s),o),Mt(h)),[2,Promise.resolve()]}}))}))},t.fileReader=function(t,e){void 0===e&&(e="dataURL");var r=Ve[e];return r||(r=Ve.dataURL),new Promise((function(e,n){var o=new FileReader;o[r](t),o.onload=function(){return e(o.result)},o.onerror=function(t){return n(t)}}))},t.filterTree=function t(e,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return E(e)?(e.forEach((function(e){var a=e;if(C(e)&&(a="spread"===o?ne({},e):e),r(a)){if(C(a)){var c=a[n];E(c)&&c.length>0&&(a[n]=t(c,r,n,o))}i.push(a)}})),i):i},t.findTreeNode=function(t,e,r){void 0===r&&(r="children");var n,o=[];return E(t)&&z(t,(function(t){for(o.push(t);o.length;){var i=o.pop();if(e(i)){n=i;break}if(C(i)){var a=i[r];E(a)&&a.length>0&&a.forEach((function(t){o.push(t)}))}}if(n)return!1})),n},t.findTreeNodes=function(t,e,r){void 0===r&&(r="children");var n=[],o=[];return E(t)&&z(t,(function(t){for(n.push(t);n.length;){var i=n.pop();if(e(i)&&o.push(i),C(i)){var a=i[r];E(a)&&a.length>0&&a.forEach((function(t){n.push(t)}))}}})),o},t.findTreeSelect=function(t,e,r){return void 0===r&&(r="children"),Ge(t,e,r)},t.formatBankCard=function(t,e){void 0===t&&(t="");var r=e||{},n=r.spaceMark,o=void 0===n?" ":n,i=r.length,a=void 0===i?4:i,c=new RegExp("(.{".concat(a,"})"),"g"),u=new RegExp("".concat(o),"g"),s=K(t).replace(u,""),f=s.replace(c,"$1".concat(o));return s.length%a==0?f.substring(0,f.length-1):f},t.formatMobile=function(t,e){void 0===t&&(t="");var r=(e||{}).spaceMark,n=void 0===r?" ":r,o=new RegExp(n,"g"),i=K(t).replace(o,"").substring(0,11);return i.length>7?i.replace(/^(...)(....)/g,"$1".concat(n,"$2").concat(n)):i.length>3?i.replace(/^(...)/g,"$1".concat(n)):i},t.formatMoney=function(t,e){void 0===e&&(e={});var r=e.precision,n=void 0===r?2:r,o=e.symbol,i=e.thousand,a=void 0===i?",":i,c=e.decimal,u=void 0===c?".":c,s=e.strict,f=void 0===s||s;if(!function(t){return ee(t)?("number"==typeof t&&ve(t),!0):(bt("".concat(t," invalid parameter.")),!1)}(t)||f&&(!rt(t)||""===t)&&!U(t))return"";if("number"==typeof t&&!isFinite(t))return t+"";"number"!=typeof n||tt(n)||n<0?n=2:n>10&&(n=10),o="string"==typeof o?o:"",a="string"==typeof a?a:",",u="string"==typeof u?u:".";var l=ae((fe(t)+"").split("."),2),d=l[0],p=l[1];return o+function(t,e){var r,n,o="";t="+"===(t=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=t))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?t.substring(1):t;for(var i=Number(t)<0?"-":"",a=i?t.substring(1).split("").reverse():t.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?e:"");return i+o.split("").reverse().join("")}(d,a)+function(t,e,r){if(0===e)return"";var n="";return n=t&&Number(t)>0?parseFloat("0."+t).toFixed(e).substring(2):(0).toFixed(e).substring(2),r+n}(p,n,u)},t.gcd=Te,t.getFileBlob=Be,t.getFileType=function(t){var e;return(W(t)||_e(t))&&z(De,(function(r,n){if(Ie(t,r))return e=n,!1})),e},t.getImageInfo=function(t,e){return $e(t,e).then((function(t){var e,r,n,o=t.image,i=t.blob,a=o.width,c=o.height;return{width:a,height:c,contrast:(e=a,r=c,n=Te(e,r),"".concat(Fe(ot(e),n),":").concat(Fe(ot(r),n))),measure:"".concat(a," × ").concat(c," px"),size:Ne(i.size),bytes:i.size,image:o,blob:i}}))},t.getMimeType=function(t){var e,r=Se(t).slice(1);return r?null===(e=Ke.find((function(t){return t[1].includes(r)})))||void 0===e?void 0:e[0]:Ft},t.isBankCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.luhn,i=void 0!==o&&o,a=K(t),c=n?ht.test(a):vt.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(function(t){for(var e=(t+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<e.length;n++){var o=parseInt(e[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}(u))}return c},t.isBusinessLicense=function(t,e){void 0===e&&(e={});var r=K(t),n=e.checkCode,o=void 0===n||n,i=Gt.test(r);if(!o||!i)return i;var a=r.substring(0,14),c=r.substring(r.length-1),u=function(t){for(var e=10,r=0;r<14;r++){var n=(e+Number(t[r]))%10;e=2*(n=0===n?10:n)%11}return 1===e?0:11-e}(a);return c===String(u)},t.isChinese=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.useExtend,i=void 0!==o&&o,a=K(t),c=i&&zt;return new RegExp(c?n?Lt:$t:n?It:Rt,c?"u":Ft).test(a)},t.isEmail=function(t){var e=K(t);return ft.test(e)},t.isHMCard=function(t){var e=K(t);return Jt.test(e)},t.isIPv4=function(t){var e=K(t);return Ut.test(e)},t.isIPv6=function(t){var e=K(t);return Vt.test(e)},t.isIdCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=e.checkCode,i=void 0===o||o,a=K(t);return 15===a.length&&n?st.test(a):!(18!==a.length||!st.test(a))&&(!i||function(t){var e,r;for(r=e=0;e<17;e++)r+=Math.pow(2,17-e)%11*Number(t[e]);var n=(12-r%11)%11;return n<10?n===Number(t[17]):"X"===t[17].toUpperCase()}(a))},t.isMobile=function(t){var e=K(t);return at.test(e)},t.isPassport=function(t){var e=K(t);return At.test(e)},t.isPassword=function(t,e){void 0===e&&(e={});var r=e.level,n=void 0===r?2:r,o=e.ignoreCase,i=void 0!==o&&o,a=e.special;return Et(t,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},t.isPostcode=function(t){var e=K(t);return ut.test(e)},t.isQQ=function(t){var e=K(t);return lt.test(e)},t.isSocialCreditCode=function(t,e){var r=K(t),n=(e||{}).checkCode,o=void 0===n||n,i=gt.test(r);if(!o||!i)return i;var a=r.substring(0,17),c=r.substring(r.length-1),u=function(t){for(var e=0,r=function(r){var n=mt.findIndex((function(e){return e===t[r]})),o=Math.pow(3,r)%31;e+=n*o},n=0;n<17;n++)r(n);var o=e%31;return mt[0!==o?31-o:0]}(a);return c===u},t.isSwiftCode=function(t){var e=K(t);return te.test(e)},t.isTWCard=function(t,e){void 0===e&&(e={});var r=e.loose,n=void 0!==r&&r,o=K(t);return!!Qt.test(o)||!!n&&Yt.test(o)},t.isTelephone=function(t){var e=K(t);return ct.test(e)},t.isUrl=qt,t.isValidNumber=ee,t.isVehicle=function(t){var e=K(t);return pt.test(e)},t.isWX=function(t){var e=K(t);return dt.test(e)},t.lcm=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.map((function(t){return Math.abs(ot(t))}));return 1===r.length&&(r=r.concat([1])),Fe(r.indexOf(0)>-1?0:ke.apply(void 0,ce([],ae(r),!1)),Te.apply(void 0,ce([],ae(r),!1)))},t.listToTree=function(t,e){void 0===e&&(e={});var r=e.keyField,n=void 0===r?"id":r,o=e.parentField,i=void 0===o?"pid":o,a=e.childrenField,c=void 0===a?"children":a,u=e.emptyChildrenValue,s=void 0===u?"none":u,f=e.nodeAssign,l=void 0===f?"spread":f,d=[],p={};return E(t)?(t.forEach((function(t){if(C(t)){var e="spread"===l?ne({},t):t,r=e[n],o=e[i];p[r]?e[c]=p[r]:e[c]=p[r]=[],o?p[o]?p[o].push(e):p[o]=[e]:d.push(e)}})),"array"!==s&&qe(d,e),d):d},t.loadImage=Le,t.loadImageWithBlob=$e,t.loadScript=function(t,e){return new Promise((function(r,n){var o=document.head,i=document.createElement("script"),a=e||{},c=a.attrs,u=a.destroyOnError,s=void 0===u||u,f=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(a,["attrs","destroyOnError"]),l=ne(ne({async:!0,type:"text/javascript"},f),{src:t});for(var d in l)"onload"!==d&&"onerror"!==d&&(i[d]=l[d]);"object"==typeof c&&Tt(c).forEach((function(t){i.setAttribute(t,c[t])})),i.onload=function(t){var e;this.onerror=this.onload=null,null===(e=l.onload)||void 0===e||e.call(this,t),r(i)},i.onerror=function(t){var e;this.onerror=this.onload=null,null===(e=l.onerror)||void 0===e||e.call(this,t),s&&o.removeChild(i),n(new URIError("Failed to load "+this.src))},o.appendChild(i)}))},t.minus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=fe(n),o=fe(o),tt(n)||tt(o))return Number.NaN;var a=Math.pow(10,Math.max(de(n),de(o)));return(ke(n,a)-ke(o,a))/a},t.numberToChinese=function(t,e){void 0===e&&(e={});var r=e.big5,n=void 0!==r&&r,o=e.unit,i=void 0===o||o,a=e.zero,c=void 0===a?"":a,u=e.negative,s=void 0===u?"负":u,f=e.unitConfig,l=void 0===f?{}:f,d=e.decimal,p=void 0===d?"":d;if("number"!=typeof t||tt(t))return bt("参数错误 ".concat(t,",请传入数字")),"";ve(t),n?(he=we.slice(),ge=xe.slice(),p=p||"點"):(he=ye.slice(),ge=be.slice(),p=p||"点");var v=(null==l?void 0:l.w)||"万",h=(null==l?void 0:l.y)||"亿";me=["",v,h,v+h],c&&(he[0]=c);var g,m=t<0?s:"",y=Math.abs(t);g=i?function(t){var e=Math.floor(t),r=0,n="",o="",i=!1;if(0===e)return he[0];for(;e>0;){var a=e%1e4;i&&(o=he[0]+o),n=je(a),o=(n+=0!==a?me[r]:me[0])+o,i=a<1e3&&a>0,e=Math.floor(e/1e4),r++}return o}(y):Oe(Math.floor(y));var b=function(t){var e=t+"",r=e.indexOf("."),n="";return r>-1&&(n=Oe(e.slice(r+1))),n}(y);return b?"".concat(m).concat(g).concat(p).concat(b):"".concat(m).concat(g)},t.padZero=function(t,e){void 0===e&&(e=2);var r=K(t),n=r.length;return("number"!=typeof e||e<0)&&(e=0),n<e?"0".repeat(e-n)+r:r},t.parseIdCard=function(t){var e=Ee.exec(t);if(!e)return null;var r={province:e[1],city:e[2],area:e[3],year:e[4],month:e[5],day:e[6],gender:e[7]},n=Ae.find((function(t){return t[0]===r.province}));if(!n)return null;var o="".concat(r.year,"-").concat(r.month,"-").concat(r.day),i=Number(r.gender)%2==0?"女":"男";return{province:n[1],birthday:o,gender:i,origin:r}},t.plus=function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],o=void 0===e[1]?0:e[1],i=e.slice(2);if(i.length>0)return t.apply(void 0,[t(n,o)].concat(i));if(n=fe(n),o=fe(o),tt(n)||tt(o))return Number.NaN;var a=Math.pow(10,Math.max(de(n),de(o)));return(ke(n,a)+ke(o,a))/a},t.randomString=function(t,e){var r;return void 0===t&&(t=0),r="string"!=typeof e?He:We[e]?We[e]:e,Xe(M(t),r)},t.replaceChar=function(t,e){void 0===t&&(t=""),void 0===e&&(e={});var r=e.char,n=void 0===r?"*":r,o=e.exclude,i=e.start,a=void 0===i?3:i,c=e.end,u=void 0===c?-4:c,s=e.repeat,f=K(t),l=f.length;if(Math.abs(a)>=l)return f;if((a=a>=0?a:l+a)>=(u=u>=0?u:l+u))return f;var d=f.substring(a,u);if(o){var p=new RegExp("[^".concat(o,"]"),"g");d=d.replace(p,n)}else s="number"==typeof s&&s>=0?s:d.length,d=n.repeat(s);return f.substring(0,a)+d+f.substring(u)},t.round=function(t,e){return void 0===e&&(e=0),ot(t,e)},t.safeDate=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n="string"==typeof t?t.replace(/[\\.-]/g,"/"):t;return e&&e.length>0?new(Date.bind.apply(Date,ce([void 0,n],ae(e),!1))):void 0===n?new Date:new Date(n)},t.setDataURLPrefix=function(t,e,r){return void 0===e&&(e="image/png"),void 0===r&&(r=!0),"data:".concat(e).concat(r?";base64":"",",").concat(t)},t.setDisableWarning=function(t){yt.disableWarning=!!t},t.strlen=function(t){for(var e=K(t),r=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},t.times=ke,t.transformFieldNames=function(t,e,r,n){return void 0===n&&(n="spread"),E(t)?t.length<=0?[]:function t(o){return o.map((function(o){if(!C(o))return o;var i="spread"===n?ne({},o):o,a=[];r&&E(i[r])&&i[r].length>0&&(i[r]=t(i[r].slice()));var c=Tt(e);return c.forEach((function(t){var r=e[t];r in i&&(i[t]=i[r],-1===c.indexOf(r)&&a.push(r))})),a.length>0&&a.forEach((function(t){delete i[t]})),i}))}(t.slice()):t},t.transformObjectValue=Ce,t.treeToList=function(t,e){var r=[];return E(t)?(function t(n){n.forEach((function(n){if(C(n)){var o=ne({},n);r.push(o),o[e]&&(E(o[e])&&o[e].length>0&&t(o[e]),delete o[e])}else r.push(n)}))}(t),r):r},t.validatePassword=Et}));
|
|
2
2
|
//# sourceMappingURL=util-helpers.min.js.map
|