util-helpers 5.7.5 → 5.7.6
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/dist/util-helpers.js +1 -1
- package/dist/util-helpers.min.js +1 -1
- package/esm/VERSION.js +1 -1
- package/lib/VERSION.js +1 -1
- package/package.json +2 -1
package/dist/util-helpers.js
CHANGED
package/dist/util-helpers.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!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).utilHelpers={})}(this,function(e){"use strict";var t=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:t,p=Math.min,v=Math.max,h=Math.random,m=Math.floor,g=Math.ceil,y=Number.isFinite,b=typeof globalThis===n&&globalThis,w=typeof global===n&&global,x=typeof self===n&&self,O=Number.MAX_SAFE_INTEGER||9007199254740991,j=Number.MIN_SAFE_INTEGER||-9007199254740991,C="[object ",E=C+"Number]",N=C+"String]",A=C+"Symbol]",k=["Function","AsyncFunction","GeneratorFunction","Proxy"].map(function(e){return C+e+"]"}),F=C+"Blob]",T=C+"File]",S=C+"Object]";function P(e){return Array.isArray(e)}function M(e){return null!==e&&"object"==typeof e}function _(e){return"function"==typeof e||M(e)}function I(e){return i.call(e)}function R(e){return"symbol"==typeof e||I(e)===A}var B=/^0b[01]+$/i,L=/^0o[0-7]+$/i,$=/^[-+]0x[0-9a-f]+$/i;function U(e){if("number"==typeof e)return e;if(R(e))return NaN;if(_(e)&&(e=Number(e)),"string"!=typeof e)return 0===e?e:+e;e=e.trim();var t=B.test(e);return t||L.test(e)?parseInt(e.slice(2),t?2:8):$.test(e)?NaN:+e}function z(e){return e}function V(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=O}(e.length)&&!function(e){if("function"==typeof e)return!0;var t=I(e);return k.some(function(e){return e===t})}(e)}function D(e){return e?(e=U(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function K(e,t){void 0===e&&(e=0),void 0===t&&(t=1),e=D(e),t=D(t);var r=g(p(e,t)||0),n=m(v(e,t)||0);if(r>n){var o=r;r=n,n=o}return m(r+h()*(n-r+1))}function Z(e){return _(e)?f(e).concat(function(e){return u&&null!==e?u(e).filter(function(t){return c.call(e,t)}):[]}(e)):[]}var W,H=(W=1,function(e,t){void 0===t&&(t=z);for(var r=!V(e)&&Z(e),n=(r||e).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===t(e[i],i,e))break;o+=W}return e});function X(e){return"number"==typeof e||I(e)===E}var q=d?d.toString:t;function G(e){if("string"==typeof e)return e;if(P(e))return""+e.map(G);if(R(e))return q?q.call(e):"";var t=""+e;return"0"===t&&1/e==-1/0?"-0":t}function J(e){return function(e){return null==e}(e)?"":G(e)}var Q=function(e,t){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Q(e,t)};var Y=function(){return Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Y.apply(this,arguments)};function ee(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function c(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,c)}u((n=n.apply(e,t||[])).next())})}function te(e,t){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=t.call(e,i)}catch(e){c=[6,e],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 re(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function ne(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var oe=typeof Blob!==r;function ie(e){return!!(oe&&e instanceof Blob)||I(e)===F}var ae=l.call(Object);function ce(e){if(!M(e)||I(e)!==S)return!1;var t=s(Object(e));if(null===t)return!0;var r=a.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)===ae}var ue=typeof File!==r;var se=b&&globalThis.Object===Object&&globalThis,fe=w&&global.Object===Object&&global,le=x&&self.Object===Object&&self,de=se||fe||le||Function("return this")();function pe(e){return X(e)&&de.isNaN(e)}function ve(e){return _(e)&&"function"==typeof e.then}function he(e){return"string"==typeof e||I(e)===N}function me(e,t,r){void 0===r&&(r=0);var n=Math[e];if(t=U(t),r=p(function(e){var t=U(e);if(!t||t===1/0||t===-1/0)return t==t?t:0;var r=t%1;return r?t-r:t}(r),292),0===r||!function(e){return y?y(e):"number"==typeof e&&de.isFinite(e)}(t))return n(t);var o=J(t).split("e");return+((o=J(t=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function ge(e,t){return me("round",e,t)}var ye=/^1[3456789]\d{9}$/;var be=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var we=/^\d{6}$/;var xe=/^[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 Oe=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var je=/^[1-9]\d{4,10}$/;var Ce=/^[a-z]([-_a-z0-9]{5,19})+$/i;var Ee=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领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 Ne=/^[1-9]\d{9,20}$/,Ae=/^\d{8,30}$/;function ke(e){for(var t=(e+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<t.length;n++){var o=parseInt(t[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}function Fe(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.luhn,i=void 0!==o&&o,a=J(e),c=n?Ae.test(a):Ne.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(ke(u))}return c}Fe.sumCheckCode=ke;var Te=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,Se="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");function Pe(e){for(var t=0,r=function(r){var n=Se.findIndex(function(t){return t===e[r]}),o=Math.pow(3,r)%31;t+=n*o},n=0;n<17;n++)r(n);var o=t%31;return Se[0!==o?31-o:0]}function Me(e,t){var r=J(e),n=(t||{}).checkCode,o=void 0===n||n,i=Te.test(r);if(!o||!i)return i;var a=r.substring(0,17);return r.substring(r.length-1)===Pe(a)}Me.sumCheckCode=Pe;var _e=Me,Ie={disableWarning:!0};function Re(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ie.disableWarning||console.warn.apply(void 0,e)}var Be=/\d/,Le=/[a-z]/,$e=/[A-Z]/,Ue=/[\d|a-z]/gi;function ze(e){return e.indexOf("\\x")>-1||e.indexOf("\\u")>-1}function Ve(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=e;"string"!=typeof e&&(Re("[validatePassword] value must be a string."),u="");var s=0,f=Be.test(u),l=Le.test(u),d=$e.test(u),p=function(e,t){if(!t||!e)return!1;var r=e.replace(Ue,"");if(!r)return!1;var n=ze(t)?new RegExp("[".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some(function(e){return t.indexOf(e)>-1&&(o=!0),o}),o}(u,c),v=function(e,t){if(!e)return!1;var r=e.replace(Ue,"");if(!r)return!1;if(!t)return!0;var n=ze(t)?new RegExp("[^".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some(function(e){return-1===t.indexOf(e)&&(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 De=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var Ke,Ze="undefined"!=typeof URL,We=void 0,He=Object.keys,Xe=Object.values,qe=Ze?URL.createObjectURL:(Ke="",function(){return Ke}),Ge=Ze?URL.revokeObjectURL:function(){},Je={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},Qe=Je.chineseBasic+"+",Ye="^"+Je.chineseBasic+"+$",et="(?:"+Xe(Je).join("|")+")",tt=et+"+",rt="^"+et+"+$",nt=RegExp.prototype.hasOwnProperty("unicode");var ot=/^((\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 it=/^((([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 at="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",ct=":\\d+",ut="\\/.*",st="\\?.*",ft=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(at,")(?:").concat(ct,")?(?:").concat(ut,")*(?:").concat(st,")?(?:").concat("#.*",")?$")),lt=new RegExp("^(?:".concat(at,")(?:").concat(ct,")?(?:").concat(ut,")*(?:").concat(st,")?(?:").concat("#.*",")?$"));function dt(e){var t=J(e);return ft.test(t)||lt.test(t)}var pt=/^\d{15}$/;function vt(e){for(var t=10,r=0;r<14;r++){var n=(t+Number(e[r]))%10;t=2*(n=0===n?10:n)%11}return 1===t?0:11-t}function ht(e,t){void 0===t&&(t={});var r=J(e),n=t.checkCode,o=void 0===n||n,i=pt.test(r);if(!o||!i)return i;var a=r.substring(0,14),c=r.substring(r.length-1),u=vt(a);return c===String(u)}ht.sumCheckCode=vt;var mt=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var gt=/^\d{8}$/i,yt=/^[\da-z]{10,12}$/i;var bt=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function wt(e,t){var r;return void 0===t&&(t=!1),"number"==typeof(r=t?"string"==typeof e&&""!==e?Number(e):e:"number"==typeof e?e:R(e)?Number.NaN:Number(e))&&!pe(r)}var xt=/^[-+]?0[b|o|x]\d+/i,Ot=/^\.\d+/;function jt(e){var t;return he(e)?""===(t=e.trim())?t=Number(t):xt.test(t)||Ot.test(t)?t=U(t):pe(Number(t))&&(t=Number.NaN):t=R(e)?Number.NaN:X(e)?e:Number(e),pe(t)?Number.NaN:t}function Ct(e,t){return void 0===t&&(t=12),+parseFloat(e.toPrecision(t))}function Et(e){var t=e.toString().split(/e/i),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function Nt(e){var t=String(e);if(!function(e){return/\d+\.?\d*e[+-]*\d+/i.test(e)}(t))return Number(t.replace(".",""));var r=Et(e);return r>0?Ct(+e*Math.pow(10,r)):+e}function At(e){(+e>O||+e<j)&&Re("".concat(e," is beyond boundary when transfer to integer, the results may not be accurate"))}var kt,Ft,Tt,St=["零","一","二","三","四","五","六","七","八","九"],Pt=["","十","百","千"],Mt=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],_t=["","拾","佰","仟"];function It(e){for(var t="",r="",n=!1,o=0;e>0;){var i=e%10;0==i?n&&(n=!1,r=kt[i]+r):(n=!0,t=kt[i],r=(t+=Ft[o])+r),o++,e=Math.floor(e/10)}return r}function Rt(e){for(var t=e+"",r="",n=0,o=t.length;n<o;n++)r+=kt[parseInt(t[n])];return r}function Bt(e,t){void 0===t&&(t={});var r=t.spaceMark,n=void 0===r?" ":r,o=t.precision,i=void 0===o?2:o,a="number"!=typeof e?Number(e):e;if(0===a||pe(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 Lt=/^(\d{2})(\d{2})(\d{2})((?:\d{2})?\d{2})(\d{2})(\d{2})\d{2}(\d)(?:\d|X)?$/i,$t=[["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 Ut=function(e,t,r){if(void 0===r&&(r=!0),ce(e)){var n={};return H(e,function(e,o){var i=r&&(ce(e)||P(e))?Ut(e,t):t(e,o);n[o]=i}),n}if(P(e)){var o=[];return H(e,function(e,n){var i=r&&(ce(e)||P(e))?Ut(e,t):t(e,n);o.push(i)}),o}return e};function zt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return zt.apply(void 0,[zt(r,n)].concat(o));if(r=jt(r),n=jt(n),pe(r)||pe(n))return Number.NaN;var i=Nt(r),a=Nt(n),c=Et(r)+Et(n),u=i*a;return At(u),u/Math.pow(10,c)}function Vt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Vt.apply(void 0,[Vt(r,n)].concat(o));if(r=jt(r),n=jt(n),pe(r)||pe(n))return Number.NaN;var i=Nt(r),a=Nt(n);return At(i),At(a),zt(i/a,Ct(Math.pow(10,Et(n)-Et(r))))}function Dt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?0:e[1],o=e.slice(2);if(o.length>0)return Dt.apply(void 0,[Dt(r,n)].concat(o));if(r=Math.abs(ge(r)),n=Math.abs(ge(n)),pe(r)||pe(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 U(r)}function Kt(e,t){var r=t||{},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,m=void 0===h?null:h,g=r.responseType,y=r.onReadyStateChange,b=r.onLoadStart,w=r.onProgress,x=r.onAbort,O=r.onTimeout,j=r.onError,C=r.onLoad,E=r.onLoadEnd;return new Promise(function(t,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),e,d,v,m),y&&(n.onreadystatechange=y),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,g&&(n.responseType=g),"object"==typeof u&&He(u).map(function(e){n.setRequestHeader(e,u[e])});var i,s=function(e){return function(t){r(t),null==e||e.call(n,t)}},l={loadstart:b,progress:w,abort:s(x),timeout:s(O),error:s(j),load:(i=C,function(e){t(e),null==i||i.call(n,e)}),loadend:E};He(l).forEach(function(e){var t=l[e];t&&n.addEventListener(e,t)}),n.send(a)})}function Zt(e){return!(!M(e)||!he(e.name))}function Wt(e){return he(e)&&e.indexOf(".")>0?"."+(r=e.split("."),void 0===(n=-1)&&(n=0),V(r)?r[n+=n<0?r.length:0]:t):"";var r,n}function Ht(e,t){var r,n,o=function(e){return!!(ue&&e instanceof File)||I(e)===T}(e);if(!o&&!Zt(e))return!1;if(he(t)||(t=J(t)),!(t=t.trim())||"*"===t)return!0;var i=!1,a=t.toLowerCase().split(/,(?:\s+)?/),c=(e.name||!o&&(e.fileName||(null===(r=e.originFileObj)||void 0===r?void 0:r.name))||"").toLowerCase(),u=e.type||!o&&(null===(n=e.originFileObj)||void 0===n?void 0:n.type)||"",s=!o&&e.url||"";return a.some(function(e){if("*"===e||u===e||0===e.indexOf(".")&&(Wt(c)===e||Wt(s)===e))i=!0;else if(e.includes("/*")&&u.includes("/")){var t=e.match(/(.*)\/\*/),r=u.split("/")[0];t&&t[1]===r&&(i=!0)}return i}),i}var Xt=[200,304];function qt(e,t){return new Promise(function(r,n){ie(e)?r(e):Kt(e,Y({responseType:"blob"},t)).then(function(t){var o=t.target.status;if(-1!==Xt.indexOf(o))r(t.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(e,"'."));console.error(i),n(i)}}).catch(function(e){console.error(new Error("Failed to request file. ".concat(e))),n(e)})})}function Gt(e){return new Promise(function(t,r){var n=ie(e),o=n?qe(e):e,i=new Image;n||(i.crossOrigin="anonymous"),i.onload=function(){t(i)},i.onerror=function(t){n&&Ge(o),console.error("[loadImage] The image load failed, '".concat(e,"'.")),r(t)},i.src=o})}function Jt(e,t){return qt(e,t).then(function(e){return Gt(e).then(function(t){return{blob:e,image:t}})})}function Qt(e){for(var t=e.split(","),r=t[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(t[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}function Yt(e,t){void 0===t&&(t="");var r=document.createElement("a");r.href=e,r.style.display="none",r.setAttribute("download",t),r.addEventListener("click",function e(t){t.stopPropagation(),r.removeEventListener("click",e)}),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var er={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"},tr={image:"image/*,.jpeg,.jpg,.gif,.bmp,.png,.webp,.svg,.apng,.avif,.ico,.cur,.tif,.tiff,.jfif,.pjpeg,.pjp",audio:"audio/*,.mp3,.wav,.aac,.flac",video:"video/*,.mp4,.webm,.ogg,.mov,.mpg,.mpeg,.avi,.mkv,.wmv,.flv,.rm,.rmvb",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 rr=[["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 nr="abcdefghijklmnopqrstuvwxyz",or={number:"0123456789",lower:nr,upper:nr.toUpperCase()},ir=or.number+or.lower+or.upper;function ar(e,t,r){for(void 0===r&&(r="");e-- >0;){return ar(e,t,r+t[K(0,t.length-1)])}return r}function cr(e,t){var r=t.childrenField,n=void 0===r?"children":r,o=t.emptyChildrenValue,i=void 0===o?"none":o;e.forEach(function(e){e[n].length<=0?"null"===i?e[n]=null:delete e[n]:cr(e[n],t)})}function ur(e,t,r,n){void 0===n&&(n=[]);var o=[];return P(e)&&H(e,function(e){if(n.push(e),t(e))return o=n,!1;if(_(e)){var i=e[r];if(P(i)&&i.length>0){var a=ur(i,t,r,n);if(a.length>0)return o=a,!1}}n.pop()}),o}var sr=function(){function e(){this.handlers={}}return e.prototype.eventNames=function(){var e,t=(null===(e=Object.getOwnPropertySymbols)||void 0===e?void 0:e.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(t)},e.prototype.rawListeners=function(e){var t=this.handlers[e];return t?t.map(function(e){return e.raw}):[]},e.prototype.listeners=function(e){var t=this.handlers[e];return t?t.map(function(e){return e.wrap}):[]},e.prototype.hasListener=function(e,t){return this.rawListeners(e).some(function(e){return e===t})},e.prototype._on=function(e,t,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:t,wrap:r,context:n};if(this.handlers[e]){var a=1===o?"push":"unshift";this.handlers[e][a](i)}else this.handlers[e]=[i];return this},e.prototype.prependListener=function(e,t,r){return this._on(e,t,t,r,0)},e.prototype.on=function(e,t,r){return this._on(e,t,t,r)},e.prototype._wrapOnce=function(e,t,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];t.apply(r,i),n.off(e,o)};return o},e.prototype.once=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r)},e.prototype.prependOnceListener=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r,0)},e.prototype.off=function(e,t){var r=this.handlers[e];if(r)if(t){var n=r.findIndex(function(e){return e.wrap===t||e.raw===t});-1!==n&&r.splice(n,1)}else delete this.handlers[e];return this},e.prototype.offAll=function(){return this.handlers={},this},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.handlers[e];return!!(n&&n.length>0)&&(n.forEach(function(e){e.wrap.apply(e.context,t)}),!0)},e}(),fr={},lr=function(){function e(e){void 0===e&&(e="default"),this.scope=e,fr[this.scope]||(fr[this.scope]={}),this.data=fr[this.scope]}return e.prototype.getItem=function(e){return e in this.data?this.data[e]:null},e.prototype.setItem=function(e,t){this.data[e]=t},e.prototype.removeItem=function(e){delete this.data[e]},e.prototype.clear=function(){fr[this.scope]={},this.data=fr[this.scope]},e}();function dr(e){try{var t="object"==typeof e&&null!==e&&!!e.setItem&&!!e.getItem&&!!e.removeItem;if(t){var r=Math.random().toString(16).substring(2,8)+(new Date).getTime();if(e.setItem(r,"1"),"1"!==e.getItem(r))return!1;e.removeItem(r)}return t}catch(t){return console.error("[cache2] ".concat(e," is not supported. The default memory cache will be used.")),!1}}var pr=function(){function e(e,t){void 0===t&&(t={});var r=!!e&&dr(e);this.options=Y({needParsed:r,prefix:""},t),this.storage=r?e:new lr(this.options.memoryScope)}return e.prototype.getKey=function(e){return this.options.prefix+e},e.prototype.get=function(e){var t=this.storage.getItem(this.getKey(e));return this.options.needParsed?function(e,t){try{return JSON.parse(e,t)}catch(t){return e}}(t,this.options.reviver):t},e.prototype.set=function(e,t){this.storage.setItem(this.getKey(e),this.options.needParsed?function(e,t){return JSON.stringify(e,t)}(t,this.options.replacer):t)},e.prototype.del=function(e){this.storage.removeItem(this.getKey(e))},e.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},e}(),vr="default",hr=function(e){function t(t,r){var n,o=e.call(this)||this,i=vr;return"string"==typeof t?i=t||vr:"object"==typeof t&&(n=t),n||"object"!=typeof r||(n=r),o.options=Y({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new pr(o.options.storage,Y({memoryScope:i},o.options)),o.cacheKey=i,o.startCheckperiod(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype._check=function(e,t){var r=!0;return 0!==t.t&&t.t<Date.now()&&(r=!1,this.del(e),this.emit("expired",e,t.v)),r},t.prototype._wrap=function(e,t){var r=Date.now(),n="number"==typeof t?t:this.options.stdTTL;return{v:e,t:n>0?r+n:0,n:r}},t.prototype._isLimited=function(e){return this.options.max>-1&&e>=this.options.max},t.prototype._getReplaceKey=function(e,t){var r=e[0];return e.forEach(function(e){(t[e].t<t[r].t||t[e].t===t[r].t&&t[e].n<t[r].n)&&(r=e)}),r},Object.defineProperty(t.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),t.prototype.setCacheValues=function(e){this.storage.set(this.cacheKey,e)},t.prototype.get=function(e){var t=this.cacheValues[e];if(t&&this._check(e,t))return t.v},t.prototype.mget=function(e){var t=this,r={};if(!Array.isArray(e))return r;var n=this.cacheValues;return e.forEach(function(e){var o=n[e];o&&t._check(e,o)&&(r[e]=o.v)}),r},t.prototype.getAll=function(){var e=Object.keys(this.cacheValues);return this.mget(e)},t.prototype.set=function(e,t,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[e]&&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[e]=this._wrap(t,r),this.setCacheValues(n),this.emit("set",e,n[e].v),!0},t.prototype.mset=function(e){var t=this,r=!0;return e.forEach(function(e){var n=t.set(e.key,e.value,e.ttl);r&&!n&&(r=!1)}),r},t.prototype.del=function(e){var t=this,r=this.cacheValues,n=0;return(Array.isArray(e)?e:[e]).forEach(function(e){if(r[e]){n++;var o=r[e];delete r[e],t.emit("del",e,o.v)}}),n>0&&this.setCacheValues(r),n},t.prototype.clear=function(){this.storage.del(this.cacheKey)},t.prototype.keys=function(){var e=this,t=this.cacheValues;return Object.keys(t).filter(function(r){return e._check(r,t[r])})},t.prototype.has=function(e){var t=this.cacheValues[e];return!(!t||!this._check(e,t))},t.prototype.take=function(e){var t,r=this.cacheValues[e];return r&&this._check(e,r)&&(t=r.v,this.del(e)),t},t.prototype.ttl=function(e,t){var r=this.cacheValues,n=r[e];return!(!n||!this._check(e,n))&&(r[e]=this._wrap(n.v,t),!0)},t.prototype.getTtl=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].t},t.prototype.getLastModified=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].n},t.prototype.startCheckperiod=function(){var e=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout(function(){e.startCheckperiod()},this.options.checkperiod))},t.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},t}(sr),mr=function(){function e(e,t){void 0===t&&(t="uh_async_memo"),this.promiseCache={},this.cache=new hr(t,e)}return e.prototype.run=function(e,t,r){var n=this;if(!t||!he(t))return e();var o=Y({persisted:!0},r);if(o.persisted){var i=this.cache.get(t);if(i)return Promise.resolve(i)}return this.promiseCache[t]||(this.promiseCache[t]=e().then(function(e){return delete n.promiseCache[t],n.cache.set(t,e,o.ttl),e}).catch(function(e){return delete n.promiseCache[t],Promise.reject(e)})),this.promiseCache[t]},e}();e.AsyncMemo=mr,e.VERSION="5.7.5",e.ajax=Kt,e.bytesToSize=Bt,e.calculateCursorPosition=function(e,t,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=J(t),l=J(r),d=P(a)?a:[a],p=l.length-f.length,v=e;if(p>0){var h=l.substring(v-p,v).replace(u,"").length;v-=p-h;for(var m=0;h>0;)-1!==d.indexOf(n.charAt(v-h+m))?m++:h--;v+=m}return("mobile"===s&&(4===v||9===v)||"bankCard"===s&&v>0&&v%5==0)&&(v-=1),v},e.checkFileType=Ht,e.checkResult=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ee(void 0,void 0,void 0,function(){var r,n;return te(this,function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),e instanceof Promise?[4,e]:[3,2];case 1:return r=o.sent(),[3,6];case 2:return"function"!=typeof e?[3,4]:[4,e.apply(void 0,ne([],re(t),!1))];case 3:return n=o.sent(),[3,5];case 4:n=e,o.label=5;case 5:r=n,o.label=6;case 6:return[2,!1!==r];case 7:return o.sent(),[2,!1];case 8:return[2]}})})},e.compressImage=function(e,t){return void 0===t&&(t={}),new Promise(function(r,n){var o=t.width,i=t.height,a=t.rotate,c=t.offset,u=void 0===c?[0,0]:c,s=t.background,f=void 0===s?"#fff":s,l=t.canvasWidth,d=t.canvasHeight,p=t.format,v=void 0===p?"blob":p,h=t.type,m=void 0===h?"image/jpeg":h,g=t.quality,y=void 0===g?.8:g,b=t.beforeCompress,w=t.beforeDraw,x=t.afterDraw,O=t.ajaxOptions;Jt(e,O).then(function(e){var c=e.image,s=e.blob,p=U(o),h=U(i),g=U(y);p&&(c.width=p),h&&(c.height=h),null==b||b({image:c,blob:s},t);var O=document.createElement("canvas"),j=O.getContext("2d"),C={image:c,blob:s,canvas:O,context:j},E=U("function"==typeof l?l(C,t):l),N=U("function"==typeof d?d(C,t):d);O.width=E||c.width,O.height=N||c.height;var A="none"===f||"transparent"===f;A?j.clearRect(0,0,O.width,O.height):(j.fillStyle=f,j.fillRect(0,0,O.width,O.height));var k=[0,0];a!==We&&(j.translate(c.width/2,c.height/2),k=[-c.width/2,-c.height/2],j.rotate(a*Math.PI/180));var F="function"==typeof u?u(C,t):u;null==w||w(C,t);var T=k[0]+U(F[0]),S=k[1]+U(F[1]);j.drawImage(c,T,S,c.width,c.height),"image/png"===m&&A&&(j.globalCompositeOperation="destination-in",j.drawImage(c,T,S,c.width,c.height)),null==x||x(C,t),"blob"===v?function(e,t,r){return new Promise(function(n){e.toBlob(function(e){n(e)},t,r)})}(O,m,g).then(r).catch(n):r(O.toDataURL(m,g))}).catch(n)})},e.dataURLToBlob=Qt,e.divide=Vt,e.download=function e(t,r){return ee(this,void 0,void 0,function(){var n,o,i,a,c,u,s,f,l,d,p,v,h;return te(this,function(m){switch(m.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 t?[3,8]:a||!/^blob:.*?\/.*/.test(t)?[3,1]:(Yt(t,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(t)?[3,2]:(s=Qt(t),[3,7]);case 2:return"url"===a||!a&&dt(t)?(f=function(e){var t="function"==typeof u?u(e):e;return ve(t)?t:Promise.resolve(t)},[4,function(e){var t="function"==typeof c?c(e):e;return ve(t)?t:Promise.resolve(t)}({responseType:"blob"})]):[3,6];case 3:return l=m.sent(),[4,Kt(t,l)];case 4:return d=m.sent(),[4,f(d.target.response)];case 5:return p=m.sent(),v=o||t.split("?")[0].split("#")[0].split("/").pop(),[2,e(p,{fileName:v,type:i||(ie(p)?p.type:We)})];case 6:s=new Blob([t],{type:i||"text/plain"}),m.label=7;case 7:return[3,9];case 8:t instanceof Blob&&(s=t),m.label=9;case 9:return s||(s=new Blob([t],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(Yt(h=qe(s),o),Ge(h)),[2,Promise.resolve()]}})})},e.fileReader=function(e,t){void 0===t&&(t="dataURL");var r=er[t];return r||(r=er.dataURL),new Promise(function(t,n){var o=new FileReader;o[r](e),o.onload=function(){return t(o.result)},o.onerror=function(e){return n(e)}})},e.filterTree=function e(t,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return P(t)?(t.forEach(function(t){var a=t;if(_(t)&&(a="spread"===o?Y({},t):t),r(a)){if(_(a)){var c=a[n];P(c)&&c.length>0&&(a[n]=e(c,r,n,o))}i.push(a)}}),i):i},e.findTreeNode=function(e,t,r){void 0===r&&(r="children");var n,o=[];return P(e)&&H(e,function(e){for(o.push(e);o.length;){var i=o.pop();if(t(i)){n=i;break}if(_(i)){var a=i[r];P(a)&&a.length>0&&a.forEach(function(e){o.push(e)})}}if(n)return!1}),n},e.findTreeNodes=function(e,t,r){void 0===r&&(r="children");var n=[],o=[];return P(e)&&H(e,function(e){for(n.push(e);n.length;){var i=n.pop();if(t(i)&&o.push(i),_(i)){var a=i[r];P(a)&&a.length>0&&a.forEach(function(e){n.push(e)})}}}),o},e.findTreeSelect=function(e,t,r){return void 0===r&&(r="children"),ur(e,t,r)},e.formatBankCard=function(e,t){void 0===e&&(e="");var r=t||{},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=J(e).replace(u,""),f=s.replace(c,"$1".concat(o));return s.length%a===0?f.substring(0,f.length-1):f},e.formatMobile=function(e,t){void 0===e&&(e="");var r=(t||{}).spaceMark,n=void 0===r?" ":r,o=new RegExp(n,"g"),i=J(e).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},e.formatMoney=function(e,t){void 0===t&&(t={});var r=t.precision,n=void 0===r?2:r,o=t.symbol,i=t.thousand,a=void 0===i?",":i,c=t.decimal,u=void 0===c?".":c,s=t.strict,f=void 0===s||s;if(!function(e){return wt(e)?("number"==typeof e&&At(e),!0):(Re("".concat(e," invalid parameter.")),!1)}(e)||f&&(!he(e)||""===e)&&!X(e))return"";if("number"==typeof e&&!isFinite(e))return e+"";"number"!=typeof n||pe(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=re((jt(e)+"").split("."),2),d=l[0],p=l[1];return o+function(e,t){var r,n,o="";e="+"===(e=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=e))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?e.substring(1):e;for(var i=Number(e)<0?"-":"",a=i?e.substring(1).split("").reverse():e.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?t:"");return i+o.split("").reverse().join("")}(d,a)+function(e,t,r){if(0===t)return"";var n="";return n=e&&Number(e)>0?parseFloat("0."+e).toFixed(t).substring(2):(0).toFixed(t).substring(2),r+n}(p,n,u)},e.gcd=Dt,e.getExtname=Wt,e.getFileBlob=qt,e.getFileType=function(e){var t;return(ie(e)||Zt(e))&&H(tr,function(r,n){if(Ht(e,r))return t=n,!1}),t},e.getImageInfo=function(e,t){return Jt(e,t).then(function(e){var t,r,n,o=e.image,i=e.blob,a=o.width,c=o.height;return{width:a,height:c,contrast:(t=a,r=c,n=Dt(t,r),"".concat(Vt(ge(t),n),":").concat(Vt(ge(r),n))),measure:"".concat(a," × ").concat(c," px"),size:Bt(i.size),bytes:i.size,image:o,blob:i}})},e.getMimeType=function(e){var t,r=Wt(e).slice(1).toLowerCase();return r?null===(t=rr.find(function(e){return e[1].includes(r)}))||void 0===t?void 0:t[0]:We},e.injectStyle=function(e,t){var r=t||{},n=r.container,o=void 0===n?document.head||document.getElementsByTagName("head")[0]||document.body:n,i=r.insertAt,a=void 0===i?"top":i,c=r.onBefore,u=document.createElement("style");u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e)),"function"==typeof c&&c(u);var s="top"===a;return s&&o.prepend?o.prepend(u):s&&o.firstChild?o.insertBefore(u,o.firstChild):o.appendChild(u),u},e.isBankCard=Fe,e.isBusinessLicense=ht,e.isChinese=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.useExtend,i=void 0!==o&&o,a=J(e),c=i&&nt;return new RegExp(c?n?tt:rt:n?Qe:Ye,c?"u":We).test(a)},e.isEmail=function(e){var t=J(e);return Oe.test(t)},e.isHMCard=function(e){var t=J(e);return mt.test(t)},e.isIPv4=function(e){var t=J(e);return ot.test(t)},e.isIPv6=function(e){var t=J(e);return it.test(t)},e.isIdCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.checkCode,i=void 0===o||o,a=J(e);return 15===a.length&&n?xe.test(a):!(18!==a.length||!xe.test(a))&&(!i||function(e){var t,r;for(r=t=0;t<17;t++)r+=Math.pow(2,17-t)%11*Number(e[t]);var n=(12-r%11)%11;return n<10?n===Number(e[17]):"X"===e[17].toUpperCase()}(a))},e.isMobile=function(e){var t=J(e);return ye.test(t)},e.isPassport=function(e){var t=J(e);return De.test(t)},e.isPassword=function(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special;return Ve(e,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},e.isPostcode=function(e){var t=J(e);return we.test(t)},e.isQQ=function(e){var t=J(e);return je.test(t)},e.isSocialCreditCode=_e,e.isSwiftCode=function(e){var t=J(e);return bt.test(t)},e.isTWCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=J(e);return!!gt.test(o)||!!n&&yt.test(o)},e.isTelephone=function(e){var t=J(e);return be.test(t)},e.isUnifiedIdentifier=Me,e.isUrl=dt,e.isValidNumber=wt,e.isVehicle=function(e){var t=J(e);return Ee.test(t)},e.isWX=function(e){var t=J(e);return Ce.test(t)},e.lcm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.map(function(e){return Math.abs(ge(e))});return 1===r.length&&(r=r.concat([1])),Vt(r.indexOf(0)>-1?0:zt.apply(void 0,ne([],re(r),!1)),Dt.apply(void 0,ne([],re(r),!1)))},e.listToTree=function(e,t){void 0===t&&(t={});var r=t.keyField,n=void 0===r?"id":r,o=t.parentField,i=void 0===o?"pid":o,a=t.childrenField,c=void 0===a?"children":a,u=t.emptyChildrenValue,s=void 0===u?"none":u,f=t.nodeAssign,l=void 0===f?"spread":f,d=[],p={};return P(e)?(e.forEach(function(e){if(_(e)){var t="spread"===l?Y({},e):e,r=t[n],o=t[i];p[r]?t[c]=p[r]:t[c]=p[r]=[],o?p[o]?p[o].push(t):p[o]=[t]:d.push(t)}}),"array"!==s&&cr(d,t),d):d},e.loadImage=Gt,e.loadImageWithBlob=Jt,e.loadScript=function(e,t){var r;return"object"==typeof e?r=e:"string"==typeof e&&(r=Y({src:e},t)),new Promise(function(e,t){var n=document.head||document.getElementsByTagName("head")[0]||document.body,o=document.createElement("script"),i=r||{},a=i.src,c=i.attrs,u=i.destroyOnError,s=void 0===u||u,f=i.onload,l=i.onerror,d=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(i,["src","attrs","destroyOnError","onload","onerror"]),p=Y({async:!0,type:"text/javascript"},d);for(var v in p)o[v]=p[v];"object"==typeof c&&He(c).forEach(function(e){o.setAttribute(e,c[e])}),a&&(o.src=a,o.onload=function(t){null==f||f.call(this,t),e(o)},o.onerror=function(e){this.onerror=this.onload=null,null==l||l.call(this,e),s&&n.removeChild(o),t(new URIError("Failed to load "+this.src))}),n.appendChild(o),a||e(o)})},e.minus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=jt(n),o=jt(o),pe(n)||pe(o))return Number.NaN;var a=Math.pow(10,Math.max(Et(n),Et(o)));return(zt(n,a)-zt(o,a))/a},e.numberToChinese=function(e,t){void 0===t&&(t={});var r=t.big5,n=void 0!==r&&r,o=t.unit,i=void 0===o||o,a=t.zero,c=void 0===a?"":a,u=t.negative,s=void 0===u?"负":u,f=t.unitConfig,l=void 0===f?{}:f,d=t.decimal,p=void 0===d?"":d;if("number"!=typeof e||pe(e))return Re("参数错误 ".concat(e,",请传入数字")),"";At(e),n?(kt=Mt.slice(),Ft=_t.slice(),p=p||"點"):(kt=St.slice(),Ft=Pt.slice(),p=p||"点");var v=l.w||"万",h=l.y||"亿";Tt=["",v,h,v+h],c&&(kt[0]=c);var m,g=e<0?s:"",y=Math.abs(e);m=i?function(e){var t=Math.floor(e),r=0,n="",o="",i=!1;if(0===t)return kt[0];for(;t>0;){var a=t%1e4;i&&(o=kt[0]+o),n=It(a),o=(n+=0!==a?Tt[r]:Tt[0])+o,i=a<1e3&&a>0,t=Math.floor(t/1e4),r++}return o}(y):Rt(Math.floor(y));var b=function(e){var t=e+"",r=t.indexOf("."),n="";return r>-1&&(n=Rt(t.slice(r+1))),n}(y);return b?"".concat(g).concat(m).concat(p).concat(b):"".concat(g).concat(m)},e.padZero=function(e,t){void 0===t&&(t=2);var r=J(e),n=r.length;return("number"!=typeof t||t<0)&&(t=0),n<t?"0".repeat(t-n)+r:r},e.parseIdCard=function(e){var t=Lt.exec(e);if(!t)return null;var r={province:t[1],city:t[2],area:t[3],year:t[4],month:t[5],day:t[6],gender:t[7]},n=$t.find(function(e){return e[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}},e.plus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=jt(n),o=jt(o),pe(n)||pe(o))return Number.NaN;var a=Math.pow(10,Math.max(Et(n),Et(o)));return(zt(n,a)+zt(o,a))/a},e.randomString=function(e,t){var r;return void 0===e&&(e=0),r="string"!=typeof t?ir:or[t]?or[t]:t,ar(U(e),r)},e.replaceChar=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?"*":r,o=t.exclude,i=t.start,a=void 0===i?3:i,c=t.end,u=void 0===c?-4:c,s=t.repeat,f=J(e),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)},e.round=function(e,t){return void 0===t&&(t=0),ge(e,t)},e.safeDate=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n="string"==typeof e?e.replace(/[\\.-]/g,"/"):e;return t&&t.length>0?new(Date.bind.apply(Date,ne([void 0,n],re(t),!1))):void 0===n?new Date:new Date(n)},e.setDataURLPrefix=function(e,t,r){return void 0===t&&(t="image/png"),void 0===r&&(r=!0),"data:".concat(t).concat(r?";base64":"",",").concat(e)},e.setDisableWarning=function(e){Ie.disableWarning=!!e},e.strlen=function(e){for(var t=J(e),r=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},e.times=zt,e.transformFieldNames=function(e,t,r,n){return void 0===n&&(n="spread"),P(e)?e.length<=0?[]:function e(o){return o.map(function(o){if(!_(o))return o;var i="spread"===n?Y({},o):o,a=[];r&&P(i[r])&&i[r].length>0&&(i[r]=e(i[r].slice()));var c=He(t);return c.forEach(function(e){var r=t[e];r in i&&(i[e]=i[r],-1===c.indexOf(r)&&a.push(r))}),a.length>0&&a.forEach(function(e){delete i[e]}),i})}(e.slice()):e},e.transformObjectValue=Ut,e.treeToList=function(e,t){var r=[];return P(e)?(function e(n){n.forEach(function(n){if(_(n)){var o=Y({},n);r.push(o),o[t]&&(P(o[t])&&o[t].length>0&&e(o[t]),delete o[t])}else r.push(n)})}(e),r):r},e.validatePassword=Ve});
|
|
1
|
+
!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).utilHelpers={})}(this,function(e){"use strict";var t=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:t,p=Math.min,v=Math.max,h=Math.random,m=Math.floor,g=Math.ceil,y=Number.isFinite,b=typeof globalThis===n&&globalThis,w=typeof global===n&&global,x=typeof self===n&&self,O=Number.MAX_SAFE_INTEGER||9007199254740991,j=Number.MIN_SAFE_INTEGER||-9007199254740991,C="[object ",E=C+"Number]",N=C+"String]",A=C+"Symbol]",k=["Function","AsyncFunction","GeneratorFunction","Proxy"].map(function(e){return C+e+"]"}),F=C+"Blob]",T=C+"File]",S=C+"Object]";function P(e){return Array.isArray(e)}function M(e){return null!==e&&"object"==typeof e}function _(e){return"function"==typeof e||M(e)}function I(e){return i.call(e)}function R(e){return"symbol"==typeof e||I(e)===A}var B=/^0b[01]+$/i,L=/^0o[0-7]+$/i,$=/^[-+]0x[0-9a-f]+$/i;function U(e){if("number"==typeof e)return e;if(R(e))return NaN;if(_(e)&&(e=Number(e)),"string"!=typeof e)return 0===e?e:+e;e=e.trim();var t=B.test(e);return t||L.test(e)?parseInt(e.slice(2),t?2:8):$.test(e)?NaN:+e}function z(e){return e}function V(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=O}(e.length)&&!function(e){if("function"==typeof e)return!0;var t=I(e);return k.some(function(e){return e===t})}(e)}function D(e){return e?(e=U(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function K(e,t){void 0===e&&(e=0),void 0===t&&(t=1),e=D(e),t=D(t);var r=g(p(e,t)||0),n=m(v(e,t)||0);if(r>n){var o=r;r=n,n=o}return m(r+h()*(n-r+1))}function Z(e){return _(e)?f(e).concat(function(e){return u&&null!==e?u(e).filter(function(t){return c.call(e,t)}):[]}(e)):[]}var W,H=(W=1,function(e,t){void 0===t&&(t=z);for(var r=!V(e)&&Z(e),n=(r||e).length,o=0;o>=0&&o<n;){var i=r?r[o]:o;if(!1===t(e[i],i,e))break;o+=W}return e});function X(e){return"number"==typeof e||I(e)===E}var q=d?d.toString:t;function G(e){if("string"==typeof e)return e;if(P(e))return""+e.map(G);if(R(e))return q?q.call(e):"";var t=""+e;return"0"===t&&1/e==-1/0?"-0":t}function J(e){return function(e){return null==e}(e)?"":G(e)}var Q=function(e,t){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Q(e,t)};var Y=function(){return Y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Y.apply(this,arguments)};function ee(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function c(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,c)}u((n=n.apply(e,t||[])).next())})}function te(e,t){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=t.call(e,i)}catch(e){c=[6,e],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 re(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function ne(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var oe=typeof Blob!==r;function ie(e){return!!(oe&&e instanceof Blob)||I(e)===F}var ae=l.call(Object);function ce(e){if(!M(e)||I(e)!==S)return!1;var t=s(Object(e));if(null===t)return!0;var r=a.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)===ae}var ue=typeof File!==r;var se=b&&globalThis.Object===Object&&globalThis,fe=w&&global.Object===Object&&global,le=x&&self.Object===Object&&self,de=se||fe||le||Function("return this")();function pe(e){return X(e)&&de.isNaN(e)}function ve(e){return _(e)&&"function"==typeof e.then}function he(e){return"string"==typeof e||I(e)===N}function me(e,t,r){void 0===r&&(r=0);var n=Math[e];if(t=U(t),r=p(function(e){var t=U(e);if(!t||t===1/0||t===-1/0)return t==t?t:0;var r=t%1;return r?t-r:t}(r),292),0===r||!function(e){return y?y(e):"number"==typeof e&&de.isFinite(e)}(t))return n(t);var o=J(t).split("e");return+((o=J(t=n(+(o[0]+"e"+(o[1]?+o[1]+r:r)))).split("e"))[0]+"e"+(o[1]?+o[1]-r:-r))}function ge(e,t){return me("round",e,t)}var ye=/^1[3456789]\d{9}$/;var be=/^(0\d{2,3}-)?([2-9]\d{6,7})(-\d{1,6})?$/;var we=/^\d{6}$/;var xe=/^[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 Oe=/^[\da-z]+([-._]?[\da-z]+)*@[\da-z]+([-.]?[\da-z]+)*(\.[a-z]{2,})+$/i;var je=/^[1-9]\d{4,10}$/;var Ce=/^[a-z]([-_a-z0-9]{5,19})+$/i;var Ee=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领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 Ne=/^[1-9]\d{9,20}$/,Ae=/^\d{8,30}$/;function ke(e){for(var t=(e+"").replace(/\D/g,"").split("").reverse(),r=0,n=0;n<t.length;n++){var o=parseInt(t[n]);r+=n%2==0?2*o-(o>4?9:0):o}var i=r%10;return 0!==i?10-i:0}function Fe(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.luhn,i=void 0!==o&&o,a=J(e),c=n?Ae.test(a):Ne.test(a);if(c&&i){var u=a.substring(0,a.length-1);return a[a.length-1]===String(ke(u))}return c}Fe.sumCheckCode=ke;var Te=/^[\dA-HJ-NPQRTUWXY]{2}\d{6}[\dA-HJ-NPQRTUWXY]{10}$/,Se="0123456789ABCDEFGHJKLMNPQRTUWXY".split("");function Pe(e){for(var t=0,r=function(r){var n=Se.findIndex(function(t){return t===e[r]}),o=Math.pow(3,r)%31;t+=n*o},n=0;n<17;n++)r(n);var o=t%31;return Se[0!==o?31-o:0]}function Me(e,t){var r=J(e),n=(t||{}).checkCode,o=void 0===n||n,i=Te.test(r);if(!o||!i)return i;var a=r.substring(0,17);return r.substring(r.length-1)===Pe(a)}Me.sumCheckCode=Pe;var _e=Me,Ie={disableWarning:!0};function Re(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Ie.disableWarning||console.warn.apply(void 0,e)}var Be=/\d/,Le=/[a-z]/,$e=/[A-Z]/,Ue=/[\d|a-z]/gi;function ze(e){return e.indexOf("\\x")>-1||e.indexOf("\\u")>-1}function Ve(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special,c=void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a,u=e;"string"!=typeof e&&(Re("[validatePassword] value must be a string."),u="");var s=0,f=Be.test(u),l=Le.test(u),d=$e.test(u),p=function(e,t){if(!t||!e)return!1;var r=e.replace(Ue,"");if(!r)return!1;var n=ze(t)?new RegExp("[".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some(function(e){return t.indexOf(e)>-1&&(o=!0),o}),o}(u,c),v=function(e,t){if(!e)return!1;var r=e.replace(Ue,"");if(!r)return!1;if(!t)return!0;var n=ze(t)?new RegExp("[^".concat(t,"]")):null;if(n)return n.test(r);var o=!1;return r.split("").some(function(e){return-1===t.indexOf(e)&&(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 De=/^((e[\da-z])|(de)|(se)|(pe)|([khm][\da-z]))[\da-z]{7}$/i;var Ke,Ze="undefined"!=typeof URL,We=void 0,He=Object.keys,Xe=Object.values,qe=Ze?URL.createObjectURL:(Ke="",function(){return Ke}),Ge=Ze?URL.revokeObjectURL:function(){},Je={chineseBasic:"[一-龥]",chineseExtend:"[麦-鿿]",chineseExtend2:"[豈-龎]",chineseExtendA:"[㐀-䶿]",chineseExtendB:"[𠀀-𪛟]",chineseExtendC:"[𪜀-𫜸]",chineseExtendD:"[𫝀-𫠝]",chineseExtendE:"[𫠠-𬺡]",chineseExtendF:"[𬺰-𮯠]",chineseExtendG:"[𰀀-𱍊]",chineseExtendH:"[𱍐-𲎯]",chineseExtendI:"[-]"},Qe=Je.chineseBasic+"+",Ye="^"+Je.chineseBasic+"+$",et="(?:"+Xe(Je).join("|")+")",tt=et+"+",rt="^"+et+"+$",nt=RegExp.prototype.hasOwnProperty("unicode");var ot=/^((\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 it=/^((([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 at="localhost|(([^\\s:\\/]+?\\.)+?[^\\s:\\/]+)",ct=":\\d+",ut="\\/.*",st="\\?.*",ft=new RegExp("^".concat("[\\w-.]+:\\/\\/","(?:").concat("[-;:&=\\+\\$,\\w]+@",")?(?:").concat(at,")(?:").concat(ct,")?(?:").concat(ut,")*(?:").concat(st,")?(?:").concat("#.*",")?$")),lt=new RegExp("^(?:".concat(at,")(?:").concat(ct,")?(?:").concat(ut,")*(?:").concat(st,")?(?:").concat("#.*",")?$"));function dt(e){var t=J(e);return ft.test(t)||lt.test(t)}var pt=/^\d{15}$/;function vt(e){for(var t=10,r=0;r<14;r++){var n=(t+Number(e[r]))%10;t=2*(n=0===n?10:n)%11}return 1===t?0:11-t}function ht(e,t){void 0===t&&(t={});var r=J(e),n=t.checkCode,o=void 0===n||n,i=pt.test(r);if(!o||!i)return i;var a=r.substring(0,14),c=r.substring(r.length-1),u=vt(a);return c===String(u)}ht.sumCheckCode=vt;var mt=/^[hm]{1}([0-9]{10}|[0-9]{8})$/i;var gt=/^\d{8}$/i,yt=/^[\da-z]{10,12}$/i;var bt=/^[A-Z]{6}[A-Z\d]{2}(?:[A-Z\d]{3})?$/;function wt(e,t){var r;return void 0===t&&(t=!1),"number"==typeof(r=t?"string"==typeof e&&""!==e?Number(e):e:"number"==typeof e?e:R(e)?Number.NaN:Number(e))&&!pe(r)}var xt=/^[-+]?0[b|o|x]\d+/i,Ot=/^\.\d+/;function jt(e){var t;return he(e)?""===(t=e.trim())?t=Number(t):xt.test(t)||Ot.test(t)?t=U(t):pe(Number(t))&&(t=Number.NaN):t=R(e)?Number.NaN:X(e)?e:Number(e),pe(t)?Number.NaN:t}function Ct(e,t){return void 0===t&&(t=12),+parseFloat(e.toPrecision(t))}function Et(e){var t=e.toString().split(/e/i),r=(t[0].split(".")[1]||"").length-+(t[1]||0);return r>0?r:0}function Nt(e){var t=String(e);if(!function(e){return/\d+\.?\d*e[+-]*\d+/i.test(e)}(t))return Number(t.replace(".",""));var r=Et(e);return r>0?Ct(+e*Math.pow(10,r)):+e}function At(e){(+e>O||+e<j)&&Re("".concat(e," is beyond boundary when transfer to integer, the results may not be accurate"))}var kt,Ft,Tt,St=["零","一","二","三","四","五","六","七","八","九"],Pt=["","十","百","千"],Mt=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],_t=["","拾","佰","仟"];function It(e){for(var t="",r="",n=!1,o=0;e>0;){var i=e%10;0==i?n&&(n=!1,r=kt[i]+r):(n=!0,t=kt[i],r=(t+=Ft[o])+r),o++,e=Math.floor(e/10)}return r}function Rt(e){for(var t=e+"",r="",n=0,o=t.length;n<o;n++)r+=kt[parseInt(t[n])];return r}function Bt(e,t){void 0===t&&(t={});var r=t.spaceMark,n=void 0===r?" ":r,o=t.precision,i=void 0===o?2:o,a="number"!=typeof e?Number(e):e;if(0===a||pe(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 Lt=/^(\d{2})(\d{2})(\d{2})((?:\d{2})?\d{2})(\d{2})(\d{2})\d{2}(\d)(?:\d|X)?$/i,$t=[["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 Ut=function(e,t,r){if(void 0===r&&(r=!0),ce(e)){var n={};return H(e,function(e,o){var i=r&&(ce(e)||P(e))?Ut(e,t):t(e,o);n[o]=i}),n}if(P(e)){var o=[];return H(e,function(e,n){var i=r&&(ce(e)||P(e))?Ut(e,t):t(e,n);o.push(i)}),o}return e};function zt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return zt.apply(void 0,[zt(r,n)].concat(o));if(r=jt(r),n=jt(n),pe(r)||pe(n))return Number.NaN;var i=Nt(r),a=Nt(n),c=Et(r)+Et(n),u=i*a;return At(u),u/Math.pow(10,c)}function Vt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?1:e[1],o=e.slice(2);if(o.length>0)return Vt.apply(void 0,[Vt(r,n)].concat(o));if(r=jt(r),n=jt(n),pe(r)||pe(n))return Number.NaN;var i=Nt(r),a=Nt(n);return At(i),At(a),zt(i/a,Ct(Math.pow(10,Et(n)-Et(r))))}function Dt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=void 0===e[1]?0:e[1],o=e.slice(2);if(o.length>0)return Dt.apply(void 0,[Dt(r,n)].concat(o));if(r=Math.abs(ge(r)),n=Math.abs(ge(n)),pe(r)||pe(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 U(r)}function Kt(e,t){var r=t||{},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,m=void 0===h?null:h,g=r.responseType,y=r.onReadyStateChange,b=r.onLoadStart,w=r.onProgress,x=r.onAbort,O=r.onTimeout,j=r.onError,C=r.onLoad,E=r.onLoadEnd;return new Promise(function(t,r){var n=new XMLHttpRequest;n.open(o.toLowerCase(),e,d,v,m),y&&(n.onreadystatechange=y),"number"==typeof c&&c>0&&(n.timeout=c),n.withCredentials=f,g&&(n.responseType=g),"object"==typeof u&&He(u).map(function(e){n.setRequestHeader(e,u[e])});var i,s=function(e){return function(t){r(t),null==e||e.call(n,t)}},l={loadstart:b,progress:w,abort:s(x),timeout:s(O),error:s(j),load:(i=C,function(e){t(e),null==i||i.call(n,e)}),loadend:E};He(l).forEach(function(e){var t=l[e];t&&n.addEventListener(e,t)}),n.send(a)})}function Zt(e){return!(!M(e)||!he(e.name))}function Wt(e){return he(e)&&e.indexOf(".")>0?"."+(r=e.split("."),void 0===(n=-1)&&(n=0),V(r)?r[n+=n<0?r.length:0]:t):"";var r,n}function Ht(e,t){var r,n,o=function(e){return!!(ue&&e instanceof File)||I(e)===T}(e);if(!o&&!Zt(e))return!1;if(he(t)||(t=J(t)),!(t=t.trim())||"*"===t)return!0;var i=!1,a=t.toLowerCase().split(/,(?:\s+)?/),c=(e.name||!o&&(e.fileName||(null===(r=e.originFileObj)||void 0===r?void 0:r.name))||"").toLowerCase(),u=e.type||!o&&(null===(n=e.originFileObj)||void 0===n?void 0:n.type)||"",s=!o&&e.url||"";return a.some(function(e){if("*"===e||u===e||0===e.indexOf(".")&&(Wt(c)===e||Wt(s)===e))i=!0;else if(e.includes("/*")&&u.includes("/")){var t=e.match(/(.*)\/\*/),r=u.split("/")[0];t&&t[1]===r&&(i=!0)}return i}),i}var Xt=[200,304];function qt(e,t){return new Promise(function(r,n){ie(e)?r(e):Kt(e,Y({responseType:"blob"},t)).then(function(t){var o=t.target.status;if(-1!==Xt.indexOf(o))r(t.target.response);else{var i=new Error("The file does not support get requests, responseStatus ".concat(o,", '").concat(e,"'."));console.error(i),n(i)}}).catch(function(e){console.error(new Error("Failed to request file. ".concat(e))),n(e)})})}function Gt(e){return new Promise(function(t,r){var n=ie(e),o=n?qe(e):e,i=new Image;n||(i.crossOrigin="anonymous"),i.onload=function(){t(i)},i.onerror=function(t){n&&Ge(o),console.error("[loadImage] The image load failed, '".concat(e,"'.")),r(t)},i.src=o})}function Jt(e,t){return qt(e,t).then(function(e){return Gt(e).then(function(t){return{blob:e,image:t}})})}function Qt(e){for(var t=e.split(","),r=t[0].substring(5).split(";"),n=r[0],o=(-1!==r.indexOf("base64")?atob:decodeURIComponent)(t[1]),i=o.length,a=new Uint8Array(i);i--;)a[i]=o.charCodeAt(i);return new Blob([a],{type:n})}function Yt(e,t){void 0===t&&(t="");var r=document.createElement("a");r.href=e,r.style.display="none",r.setAttribute("download",t),r.addEventListener("click",function e(t){t.stopPropagation(),r.removeEventListener("click",e)}),document.body.appendChild(r),r.click(),document.body.removeChild(r)}var er={arrayBuffer:"readAsArrayBuffer",binaryString:"readAsBinaryString",dataURL:"readAsDataURL",text:"readAsText"},tr={image:"image/*,.jpeg,.jpg,.gif,.bmp,.png,.webp,.svg,.apng,.avif,.ico,.cur,.tif,.tiff,.jfif,.pjpeg,.pjp",audio:"audio/*,.mp3,.wav,.aac,.flac",video:"video/*,.mp4,.webm,.ogg,.mov,.mpg,.mpeg,.avi,.mkv,.wmv,.flv,.rm,.rmvb",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 rr=[["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 nr="abcdefghijklmnopqrstuvwxyz",or={number:"0123456789",lower:nr,upper:nr.toUpperCase()},ir=or.number+or.lower+or.upper;function ar(e,t,r){for(void 0===r&&(r="");e-- >0;){return ar(e,t,r+t[K(0,t.length-1)])}return r}function cr(e,t){var r=t.childrenField,n=void 0===r?"children":r,o=t.emptyChildrenValue,i=void 0===o?"none":o;e.forEach(function(e){e[n].length<=0?"null"===i?e[n]=null:delete e[n]:cr(e[n],t)})}function ur(e,t,r,n){void 0===n&&(n=[]);var o=[];return P(e)&&H(e,function(e){if(n.push(e),t(e))return o=n,!1;if(_(e)){var i=e[r];if(P(i)&&i.length>0){var a=ur(i,t,r,n);if(a.length>0)return o=a,!1}}n.pop()}),o}var sr=function(){function e(){this.handlers={}}return e.prototype.eventNames=function(){var e,t=(null===(e=Object.getOwnPropertySymbols)||void 0===e?void 0:e.call(Object,this.handlers))||[];return Object.keys(this.handlers).concat(t)},e.prototype.rawListeners=function(e){var t=this.handlers[e];return t?t.map(function(e){return e.raw}):[]},e.prototype.listeners=function(e){var t=this.handlers[e];return t?t.map(function(e){return e.wrap}):[]},e.prototype.hasListener=function(e,t){return this.rawListeners(e).some(function(e){return e===t})},e.prototype._on=function(e,t,r,n,o){void 0===n&&(n=null),void 0===o&&(o=1);var i={raw:t,wrap:r,context:n};if(this.handlers[e]){var a=1===o?"push":"unshift";this.handlers[e][a](i)}else this.handlers[e]=[i];return this},e.prototype.prependListener=function(e,t,r){return this._on(e,t,t,r,0)},e.prototype.on=function(e,t,r){return this._on(e,t,t,r)},e.prototype._wrapOnce=function(e,t,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];t.apply(r,i),n.off(e,o)};return o},e.prototype.once=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r)},e.prototype.prependOnceListener=function(e,t,r){var n=this._wrapOnce(e,t,r);return this._on(e,t,n,r,0)},e.prototype.off=function(e,t){var r=this.handlers[e];if(r)if(t){var n=r.findIndex(function(e){return e.wrap===t||e.raw===t});-1!==n&&r.splice(n,1)}else delete this.handlers[e];return this},e.prototype.offAll=function(){return this.handlers={},this},e.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.handlers[e];return!!(n&&n.length>0)&&(n.forEach(function(e){e.wrap.apply(e.context,t)}),!0)},e}(),fr={},lr=function(){function e(e){void 0===e&&(e="default"),this.scope=e,fr[this.scope]||(fr[this.scope]={}),this.data=fr[this.scope]}return e.prototype.getItem=function(e){return e in this.data?this.data[e]:null},e.prototype.setItem=function(e,t){this.data[e]=t},e.prototype.removeItem=function(e){delete this.data[e]},e.prototype.clear=function(){fr[this.scope]={},this.data=fr[this.scope]},e}();function dr(e){try{var t="object"==typeof e&&null!==e&&!!e.setItem&&!!e.getItem&&!!e.removeItem;if(t){var r=Math.random().toString(16).substring(2,8)+(new Date).getTime();if(e.setItem(r,"1"),"1"!==e.getItem(r))return!1;e.removeItem(r)}return t}catch(t){return console.error("[cache2] ".concat(e," is not supported. The default memory cache will be used.")),!1}}var pr=function(){function e(e,t){void 0===t&&(t={});var r=!!e&&dr(e);this.options=Y({needParsed:r,prefix:""},t),this.storage=r?e:new lr(this.options.memoryScope)}return e.prototype.getKey=function(e){return this.options.prefix+e},e.prototype.get=function(e){var t=this.storage.getItem(this.getKey(e));return this.options.needParsed?function(e,t){try{return JSON.parse(e,t)}catch(t){return e}}(t,this.options.reviver):t},e.prototype.set=function(e,t){this.storage.setItem(this.getKey(e),this.options.needParsed?function(e,t){return JSON.stringify(e,t)}(t,this.options.replacer):t)},e.prototype.del=function(e){this.storage.removeItem(this.getKey(e))},e.prototype.clear=function(){"function"==typeof this.storage.clear&&this.storage.clear()},e}(),vr="default",hr=function(e){function t(t,r){var n,o=e.call(this)||this,i=vr;return"string"==typeof t?i=t||vr:"object"==typeof t&&(n=t),n||"object"!=typeof r||(n=r),o.options=Y({max:-1,stdTTL:0,maxStrategy:"limited",checkperiod:0,prefix:"cache2_"},n),o.storage=new pr(o.options.storage,Y({memoryScope:i},o.options)),o.cacheKey=i,o.startCheckperiod(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype._check=function(e,t){var r=!0;return 0!==t.t&&t.t<Date.now()&&(r=!1,this.del(e),this.emit("expired",e,t.v)),r},t.prototype._wrap=function(e,t){var r=Date.now(),n="number"==typeof t?t:this.options.stdTTL;return{v:e,t:n>0?r+n:0,n:r}},t.prototype._isLimited=function(e){return this.options.max>-1&&e>=this.options.max},t.prototype._getReplaceKey=function(e,t){var r=e[0];return e.forEach(function(e){(t[e].t<t[r].t||t[e].t===t[r].t&&t[e].n<t[r].n)&&(r=e)}),r},Object.defineProperty(t.prototype,"cacheValues",{get:function(){return this.storage.get(this.cacheKey)||{}},enumerable:!1,configurable:!0}),t.prototype.setCacheValues=function(e){this.storage.set(this.cacheKey,e)},t.prototype.get=function(e){var t=this.cacheValues[e];if(t&&this._check(e,t))return t.v},t.prototype.mget=function(e){var t=this,r={};if(!Array.isArray(e))return r;var n=this.cacheValues;return e.forEach(function(e){var o=n[e];o&&t._check(e,o)&&(r[e]=o.v)}),r},t.prototype.getAll=function(){var e=Object.keys(this.cacheValues);return this.mget(e)},t.prototype.set=function(e,t,r){if(0===this.options.max)return!1;var n=this.cacheValues,o=Object.keys(n);if(!n[e]&&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[e]=this._wrap(t,r),this.setCacheValues(n),this.emit("set",e,n[e].v),!0},t.prototype.mset=function(e){var t=this,r=!0;return e.forEach(function(e){var n=t.set(e.key,e.value,e.ttl);r&&!n&&(r=!1)}),r},t.prototype.del=function(e){var t=this,r=this.cacheValues,n=0;return(Array.isArray(e)?e:[e]).forEach(function(e){if(r[e]){n++;var o=r[e];delete r[e],t.emit("del",e,o.v)}}),n>0&&this.setCacheValues(r),n},t.prototype.clear=function(){this.storage.del(this.cacheKey)},t.prototype.keys=function(){var e=this,t=this.cacheValues;return Object.keys(t).filter(function(r){return e._check(r,t[r])})},t.prototype.has=function(e){var t=this.cacheValues[e];return!(!t||!this._check(e,t))},t.prototype.take=function(e){var t,r=this.cacheValues[e];return r&&this._check(e,r)&&(t=r.v,this.del(e)),t},t.prototype.ttl=function(e,t){var r=this.cacheValues,n=r[e];return!(!n||!this._check(e,n))&&(r[e]=this._wrap(n.v,t),!0)},t.prototype.getTtl=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].t},t.prototype.getLastModified=function(e){var t=this.cacheValues,r=t[e];if(r&&this._check(e,r))return t[e].n},t.prototype.startCheckperiod=function(){var e=this;this.keys(),this.options.checkperiod>0&&(clearTimeout(this._checkTimeout),this._checkTimeout=setTimeout(function(){e.startCheckperiod()},this.options.checkperiod))},t.prototype.stopCheckperiod=function(){clearTimeout(this._checkTimeout)},t}(sr),mr=function(){function e(e,t){void 0===t&&(t="uh_async_memo"),this.promiseCache={},this.cache=new hr(t,e)}return e.prototype.run=function(e,t,r){var n=this;if(!t||!he(t))return e();var o=Y({persisted:!0},r);if(o.persisted){var i=this.cache.get(t);if(i)return Promise.resolve(i)}return this.promiseCache[t]||(this.promiseCache[t]=e().then(function(e){return delete n.promiseCache[t],n.cache.set(t,e,o.ttl),e}).catch(function(e){return delete n.promiseCache[t],Promise.reject(e)})),this.promiseCache[t]},e}();e.AsyncMemo=mr,e.VERSION="5.7.6",e.ajax=Kt,e.bytesToSize=Bt,e.calculateCursorPosition=function(e,t,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=J(t),l=J(r),d=P(a)?a:[a],p=l.length-f.length,v=e;if(p>0){var h=l.substring(v-p,v).replace(u,"").length;v-=p-h;for(var m=0;h>0;)-1!==d.indexOf(n.charAt(v-h+m))?m++:h--;v+=m}return("mobile"===s&&(4===v||9===v)||"bankCard"===s&&v>0&&v%5==0)&&(v-=1),v},e.checkFileType=Ht,e.checkResult=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ee(void 0,void 0,void 0,function(){var r,n;return te(this,function(o){switch(o.label){case 0:return o.trys.push([0,7,,8]),e instanceof Promise?[4,e]:[3,2];case 1:return r=o.sent(),[3,6];case 2:return"function"!=typeof e?[3,4]:[4,e.apply(void 0,ne([],re(t),!1))];case 3:return n=o.sent(),[3,5];case 4:n=e,o.label=5;case 5:r=n,o.label=6;case 6:return[2,!1!==r];case 7:return o.sent(),[2,!1];case 8:return[2]}})})},e.compressImage=function(e,t){return void 0===t&&(t={}),new Promise(function(r,n){var o=t.width,i=t.height,a=t.rotate,c=t.offset,u=void 0===c?[0,0]:c,s=t.background,f=void 0===s?"#fff":s,l=t.canvasWidth,d=t.canvasHeight,p=t.format,v=void 0===p?"blob":p,h=t.type,m=void 0===h?"image/jpeg":h,g=t.quality,y=void 0===g?.8:g,b=t.beforeCompress,w=t.beforeDraw,x=t.afterDraw,O=t.ajaxOptions;Jt(e,O).then(function(e){var c=e.image,s=e.blob,p=U(o),h=U(i),g=U(y);p&&(c.width=p),h&&(c.height=h),null==b||b({image:c,blob:s},t);var O=document.createElement("canvas"),j=O.getContext("2d"),C={image:c,blob:s,canvas:O,context:j},E=U("function"==typeof l?l(C,t):l),N=U("function"==typeof d?d(C,t):d);O.width=E||c.width,O.height=N||c.height;var A="none"===f||"transparent"===f;A?j.clearRect(0,0,O.width,O.height):(j.fillStyle=f,j.fillRect(0,0,O.width,O.height));var k=[0,0];a!==We&&(j.translate(c.width/2,c.height/2),k=[-c.width/2,-c.height/2],j.rotate(a*Math.PI/180));var F="function"==typeof u?u(C,t):u;null==w||w(C,t);var T=k[0]+U(F[0]),S=k[1]+U(F[1]);j.drawImage(c,T,S,c.width,c.height),"image/png"===m&&A&&(j.globalCompositeOperation="destination-in",j.drawImage(c,T,S,c.width,c.height)),null==x||x(C,t),"blob"===v?function(e,t,r){return new Promise(function(n){e.toBlob(function(e){n(e)},t,r)})}(O,m,g).then(r).catch(n):r(O.toDataURL(m,g))}).catch(n)})},e.dataURLToBlob=Qt,e.divide=Vt,e.download=function e(t,r){return ee(this,void 0,void 0,function(){var n,o,i,a,c,u,s,f,l,d,p,v,h;return te(this,function(m){switch(m.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 t?[3,8]:a||!/^blob:.*?\/.*/.test(t)?[3,1]:(Yt(t,o),[2,Promise.resolve()]);case 1:return a||!/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(t)?[3,2]:(s=Qt(t),[3,7]);case 2:return"url"===a||!a&&dt(t)?(f=function(e){var t="function"==typeof u?u(e):e;return ve(t)?t:Promise.resolve(t)},[4,function(e){var t="function"==typeof c?c(e):e;return ve(t)?t:Promise.resolve(t)}({responseType:"blob"})]):[3,6];case 3:return l=m.sent(),[4,Kt(t,l)];case 4:return d=m.sent(),[4,f(d.target.response)];case 5:return p=m.sent(),v=o||t.split("?")[0].split("#")[0].split("/").pop(),[2,e(p,{fileName:v,type:i||(ie(p)?p.type:We)})];case 6:s=new Blob([t],{type:i||"text/plain"}),m.label=7;case 7:return[3,9];case 8:t instanceof Blob&&(s=t),m.label=9;case 9:return s||(s=new Blob([t],{type:i})),navigator.msSaveBlob?navigator.msSaveBlob(s,o||"download"):(Yt(h=qe(s),o),Ge(h)),[2,Promise.resolve()]}})})},e.fileReader=function(e,t){void 0===t&&(t="dataURL");var r=er[t];return r||(r=er.dataURL),new Promise(function(t,n){var o=new FileReader;o[r](e),o.onload=function(){return t(o.result)},o.onerror=function(e){return n(e)}})},e.filterTree=function e(t,r,n,o){void 0===n&&(n="children"),void 0===o&&(o="spread");var i=[];return P(t)?(t.forEach(function(t){var a=t;if(_(t)&&(a="spread"===o?Y({},t):t),r(a)){if(_(a)){var c=a[n];P(c)&&c.length>0&&(a[n]=e(c,r,n,o))}i.push(a)}}),i):i},e.findTreeNode=function(e,t,r){void 0===r&&(r="children");var n,o=[];return P(e)&&H(e,function(e){for(o.push(e);o.length;){var i=o.pop();if(t(i)){n=i;break}if(_(i)){var a=i[r];P(a)&&a.length>0&&a.forEach(function(e){o.push(e)})}}if(n)return!1}),n},e.findTreeNodes=function(e,t,r){void 0===r&&(r="children");var n=[],o=[];return P(e)&&H(e,function(e){for(n.push(e);n.length;){var i=n.pop();if(t(i)&&o.push(i),_(i)){var a=i[r];P(a)&&a.length>0&&a.forEach(function(e){n.push(e)})}}}),o},e.findTreeSelect=function(e,t,r){return void 0===r&&(r="children"),ur(e,t,r)},e.formatBankCard=function(e,t){void 0===e&&(e="");var r=t||{},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=J(e).replace(u,""),f=s.replace(c,"$1".concat(o));return s.length%a===0?f.substring(0,f.length-1):f},e.formatMobile=function(e,t){void 0===e&&(e="");var r=(t||{}).spaceMark,n=void 0===r?" ":r,o=new RegExp(n,"g"),i=J(e).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},e.formatMoney=function(e,t){void 0===t&&(t={});var r=t.precision,n=void 0===r?2:r,o=t.symbol,i=t.thousand,a=void 0===i?",":i,c=t.decimal,u=void 0===c?".":c,s=t.strict,f=void 0===s||s;if(!function(e){return wt(e)?("number"==typeof e&&At(e),!0):(Re("".concat(e," invalid parameter.")),!1)}(e)||f&&(!he(e)||""===e)&&!X(e))return"";if("number"==typeof e&&!isFinite(e))return e+"";"number"!=typeof n||pe(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=re((jt(e)+"").split("."),2),d=l[0],p=l[1];return o+function(e,t){var r,n,o="";e="+"===(e=(n=/^([+-])?(0+)([0-9.]+)$/.exec(r=e))?(n[1]||"")+("."===n[3][0]?"0"+n[3]:n[3]):r)[0]?e.substring(1):e;for(var i=Number(e)<0?"-":"",a=i?e.substring(1).split("").reverse():e.split("").reverse(),c=0;c<a.length;c++)o+=a[c]+((c+1)%3==0&&c+1!==a.length?t:"");return i+o.split("").reverse().join("")}(d,a)+function(e,t,r){if(0===t)return"";var n="";return n=e&&Number(e)>0?parseFloat("0."+e).toFixed(t).substring(2):(0).toFixed(t).substring(2),r+n}(p,n,u)},e.gcd=Dt,e.getExtname=Wt,e.getFileBlob=qt,e.getFileType=function(e){var t;return(ie(e)||Zt(e))&&H(tr,function(r,n){if(Ht(e,r))return t=n,!1}),t},e.getImageInfo=function(e,t){return Jt(e,t).then(function(e){var t,r,n,o=e.image,i=e.blob,a=o.width,c=o.height;return{width:a,height:c,contrast:(t=a,r=c,n=Dt(t,r),"".concat(Vt(ge(t),n),":").concat(Vt(ge(r),n))),measure:"".concat(a," × ").concat(c," px"),size:Bt(i.size),bytes:i.size,image:o,blob:i}})},e.getMimeType=function(e){var t,r=Wt(e).slice(1).toLowerCase();return r?null===(t=rr.find(function(e){return e[1].includes(r)}))||void 0===t?void 0:t[0]:We},e.injectStyle=function(e,t){var r=t||{},n=r.container,o=void 0===n?document.head||document.getElementsByTagName("head")[0]||document.body:n,i=r.insertAt,a=void 0===i?"top":i,c=r.onBefore,u=document.createElement("style");u.styleSheet?u.styleSheet.cssText=e:u.appendChild(document.createTextNode(e)),"function"==typeof c&&c(u);var s="top"===a;return s&&o.prepend?o.prepend(u):s&&o.firstChild?o.insertBefore(u,o.firstChild):o.appendChild(u),u},e.isBankCard=Fe,e.isBusinessLicense=ht,e.isChinese=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.useExtend,i=void 0!==o&&o,a=J(e),c=i&&nt;return new RegExp(c?n?tt:rt:n?Qe:Ye,c?"u":We).test(a)},e.isEmail=function(e){var t=J(e);return Oe.test(t)},e.isHMCard=function(e){var t=J(e);return mt.test(t)},e.isIPv4=function(e){var t=J(e);return ot.test(t)},e.isIPv6=function(e){var t=J(e);return it.test(t)},e.isIdCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=t.checkCode,i=void 0===o||o,a=J(e);return 15===a.length&&n?xe.test(a):!(18!==a.length||!xe.test(a))&&(!i||function(e){var t,r;for(r=t=0;t<17;t++)r+=Math.pow(2,17-t)%11*Number(e[t]);var n=(12-r%11)%11;return n<10?n===Number(e[17]):"X"===e[17].toUpperCase()}(a))},e.isMobile=function(e){var t=J(e);return ye.test(t)},e.isPassport=function(e){var t=J(e);return De.test(t)},e.isPassword=function(e,t){void 0===t&&(t={});var r=t.level,n=void 0===r?2:r,o=t.ignoreCase,i=void 0!==o&&o,a=t.special;return Ve(e,{level:n,ignoreCase:i,special:void 0===a?"\\x21-\\x2F\\x3A-\\x40\\x5B-\\x60\\x7B-\\x7E":a}).validated},e.isPostcode=function(e){var t=J(e);return we.test(t)},e.isQQ=function(e){var t=J(e);return je.test(t)},e.isSocialCreditCode=_e,e.isSwiftCode=function(e){var t=J(e);return bt.test(t)},e.isTWCard=function(e,t){void 0===t&&(t={});var r=t.loose,n=void 0!==r&&r,o=J(e);return!!gt.test(o)||!!n&&yt.test(o)},e.isTelephone=function(e){var t=J(e);return be.test(t)},e.isUnifiedIdentifier=Me,e.isUrl=dt,e.isValidNumber=wt,e.isVehicle=function(e){var t=J(e);return Ee.test(t)},e.isWX=function(e){var t=J(e);return Ce.test(t)},e.lcm=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.map(function(e){return Math.abs(ge(e))});return 1===r.length&&(r=r.concat([1])),Vt(r.indexOf(0)>-1?0:zt.apply(void 0,ne([],re(r),!1)),Dt.apply(void 0,ne([],re(r),!1)))},e.listToTree=function(e,t){void 0===t&&(t={});var r=t.keyField,n=void 0===r?"id":r,o=t.parentField,i=void 0===o?"pid":o,a=t.childrenField,c=void 0===a?"children":a,u=t.emptyChildrenValue,s=void 0===u?"none":u,f=t.nodeAssign,l=void 0===f?"spread":f,d=[],p={};return P(e)?(e.forEach(function(e){if(_(e)){var t="spread"===l?Y({},e):e,r=t[n],o=t[i];p[r]?t[c]=p[r]:t[c]=p[r]=[],o?p[o]?p[o].push(t):p[o]=[t]:d.push(t)}}),"array"!==s&&cr(d,t),d):d},e.loadImage=Gt,e.loadImageWithBlob=Jt,e.loadScript=function(e,t){var r;return"object"==typeof e?r=e:"string"==typeof e&&(r=Y({src:e},t)),new Promise(function(e,t){var n=document.head||document.getElementsByTagName("head")[0]||document.body,o=document.createElement("script"),i=r||{},a=i.src,c=i.attrs,u=i.destroyOnError,s=void 0===u||u,f=i.onload,l=i.onerror,d=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(i,["src","attrs","destroyOnError","onload","onerror"]),p=Y({async:!0,type:"text/javascript"},d);for(var v in p)o[v]=p[v];"object"==typeof c&&He(c).forEach(function(e){o.setAttribute(e,c[e])}),a&&(o.src=a,o.onload=function(t){null==f||f.call(this,t),e(o)},o.onerror=function(e){this.onerror=this.onload=null,null==l||l.call(this,e),s&&n.removeChild(o),t(new URIError("Failed to load "+this.src))}),n.appendChild(o),a||e(o)})},e.minus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=jt(n),o=jt(o),pe(n)||pe(o))return Number.NaN;var a=Math.pow(10,Math.max(Et(n),Et(o)));return(zt(n,a)-zt(o,a))/a},e.numberToChinese=function(e,t){void 0===t&&(t={});var r=t.big5,n=void 0!==r&&r,o=t.unit,i=void 0===o||o,a=t.zero,c=void 0===a?"":a,u=t.negative,s=void 0===u?"负":u,f=t.unitConfig,l=void 0===f?{}:f,d=t.decimal,p=void 0===d?"":d;if("number"!=typeof e||pe(e))return Re("参数错误 ".concat(e,",请传入数字")),"";At(e),n?(kt=Mt.slice(),Ft=_t.slice(),p=p||"點"):(kt=St.slice(),Ft=Pt.slice(),p=p||"点");var v=l.w||"万",h=l.y||"亿";Tt=["",v,h,v+h],c&&(kt[0]=c);var m,g=e<0?s:"",y=Math.abs(e);m=i?function(e){var t=Math.floor(e),r=0,n="",o="",i=!1;if(0===t)return kt[0];for(;t>0;){var a=t%1e4;i&&(o=kt[0]+o),n=It(a),o=(n+=0!==a?Tt[r]:Tt[0])+o,i=a<1e3&&a>0,t=Math.floor(t/1e4),r++}return o}(y):Rt(Math.floor(y));var b=function(e){var t=e+"",r=t.indexOf("."),n="";return r>-1&&(n=Rt(t.slice(r+1))),n}(y);return b?"".concat(g).concat(m).concat(p).concat(b):"".concat(g).concat(m)},e.padZero=function(e,t){void 0===t&&(t=2);var r=J(e),n=r.length;return("number"!=typeof t||t<0)&&(t=0),n<t?"0".repeat(t-n)+r:r},e.parseIdCard=function(e){var t=Lt.exec(e);if(!t)return null;var r={province:t[1],city:t[2],area:t[3],year:t[4],month:t[5],day:t[6],gender:t[7]},n=$t.find(function(e){return e[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}},e.plus=function e(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=t[0],o=void 0===t[1]?0:t[1],i=t.slice(2);if(i.length>0)return e.apply(void 0,[e(n,o)].concat(i));if(n=jt(n),o=jt(o),pe(n)||pe(o))return Number.NaN;var a=Math.pow(10,Math.max(Et(n),Et(o)));return(zt(n,a)+zt(o,a))/a},e.randomString=function(e,t){var r;return void 0===e&&(e=0),r="string"!=typeof t?ir:or[t]?or[t]:t,ar(U(e),r)},e.replaceChar=function(e,t){void 0===e&&(e=""),void 0===t&&(t={});var r=t.char,n=void 0===r?"*":r,o=t.exclude,i=t.start,a=void 0===i?3:i,c=t.end,u=void 0===c?-4:c,s=t.repeat,f=J(e),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)},e.round=function(e,t){return void 0===t&&(t=0),ge(e,t)},e.safeDate=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n="string"==typeof e?e.replace(/[\\.-]/g,"/"):e;return t&&t.length>0?new(Date.bind.apply(Date,ne([void 0,n],re(t),!1))):void 0===n?new Date:new Date(n)},e.setDataURLPrefix=function(e,t,r){return void 0===t&&(t="image/png"),void 0===r&&(r=!0),"data:".concat(t).concat(r?";base64":"",",").concat(e)},e.setDisableWarning=function(e){Ie.disableWarning=!!e},e.strlen=function(e){for(var t=J(e),r=0,n=0;n<t.length;n++){var o=t.charCodeAt(n);o>=1&&o<=126||65376<=o&&o<=65439?r++:r+=2}return r},e.times=zt,e.transformFieldNames=function(e,t,r,n){return void 0===n&&(n="spread"),P(e)?e.length<=0?[]:function e(o){return o.map(function(o){if(!_(o))return o;var i="spread"===n?Y({},o):o,a=[];r&&P(i[r])&&i[r].length>0&&(i[r]=e(i[r].slice()));var c=He(t);return c.forEach(function(e){var r=t[e];r in i&&(i[e]=i[r],-1===c.indexOf(r)&&a.push(r))}),a.length>0&&a.forEach(function(e){delete i[e]}),i})}(e.slice()):e},e.transformObjectValue=Ut,e.treeToList=function(e,t){var r=[];return P(e)?(function e(n){n.forEach(function(n){if(_(n)){var o=Y({},n);r.push(o),o[t]&&(P(o[t])&&o[t].length>0&&e(o[t]),delete o[t])}else r.push(n)})}(e),r):r},e.validatePassword=Ve});
|
|
2
2
|
//# sourceMappingURL=util-helpers.min.js.map
|
package/esm/VERSION.js
CHANGED
package/lib/VERSION.js
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "util-helpers",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.6",
|
|
4
4
|
"description": "一个基于业务场景的工具方法库",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"unpkg": "dist/util-helpers.min.js",
|
|
8
|
+
"browser": "dist/util-helpers.min.js",
|
|
8
9
|
"sideEffects": false,
|
|
9
10
|
"types": "types/index.d.ts",
|
|
10
11
|
"scripts": {
|