@ivujs/i-utils 2.1.4 → 2.1.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/cjs/clipboard/index.cjs +3 -3
- package/dist/cjs/device/index.cjs +12 -12
- package/dist/cjs/file/index.cjs +9 -8
- package/dist/cjs/storage/localStorage.cjs +4 -4
- package/dist/cjs/storage/sessionStorage.cjs +4 -4
- package/dist/cjs/validate/index.cjs +1 -6
- package/dist/es/clipboard/index.mjs +3 -3
- package/dist/es/device/index.mjs +12 -12
- package/dist/es/file/index.mjs +9 -8
- package/dist/es/storage/localStorage.mjs +4 -4
- package/dist/es/storage/sessionStorage.mjs +4 -4
- package/dist/es/validate/index.mjs +1 -6
- package/dist/lib/index.full.umd.js +34 -38
- package/dist/lib/index.full.umd.min.js +2 -2
- package/dist/lib/index.full.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @ivujs/i-utils v2.1.
|
|
2
|
+
* @ivujs/i-utils v2.1.6
|
|
3
3
|
* Copyright 2021-2026, <gao911222@163.com>
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!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).iUtils={})}(this,(function(t){"use strict";const e={DESC:0,ASC:1,RANDOM:2},n={ROUND:0,ROUND_FLOOR:1},r={CH:/^[\u4E00-\u9FA5]+$/,EN:/^[a-zA-Z]+$/,LOWER_CASE:/^[a-z]+$/,UPPER_CASE:/^[A-Z]+$/,CH_NAME:/^[\u4e00-\u9fa5·]{2,16}$/,EN_NAME:/^[a-zA-Z\s]{1,20}$/,NUMBER:/^([-+])?\d+(\.\d+)?$/,INTEGER:/^(0|[1-9][0-9]*|-[1-9][0-9]*)$/,DECIMAL:/^([-+])?\d+\.\d+$/,INT_OR_FLOAT:/(^[1-9][0-9]*$)|(^[1-9][0-9]*\.[0-9]{1,2}$)|(^0\.[0-9]{1,2}$)|(^0$)/,MOBILE:/^(?:(?:\+|00)86)?1[1-9]\d{9}$/,PHONE:/^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,EMAIL:/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,ID_CARD:/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,ID_CARD15:/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)/,ID_CARD18:/(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,BANK_CARD:/^[1-9]\d{9,29}$/,POST_CODE:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,URL:/^(?:(ftp|https?|ftps):\/\/)?((?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2,6})?)?(?::(\d+))?(?:\/([^\?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,IP:/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,IP6:/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|::([0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}|[0-9a-fA-F]{1,4}::([0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4})$/i,EXTERNAL:/^(http:|https:|ftp:|ftps:|mailto:|tel:)/i},o={AM_PM:{zh:{AM:"上午",PM:"下午"},en:{AM:"AM",PM:"PM"}},WEEK:{zh:{FULL:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],SHORT:["周日","周一","周二","周三","周四","周五","周六"],MINI:["日","一","二","三","四","五","六"]},en:{FULL:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],SHORT:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MINI:["Su","Mo","Tu","We","Th","Fr","Sa"]}},MONTH:{zh:{FULL:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],SHORT:["一","二","三","四","五","六","七","八","九","十","十一","十二"]},en:{FULL:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},QUARTER:{zh:{FULL:["第一季度","第二季度","第三季度","第四季度"],SHORT:["一季度","二季度","三季度","四季度"],MINI:["一","二","三","四"]},en:{FULL:["quarter 1st","quarter 2nd","quarter 3rd","quarter 4th"],SHORT:["Q1th","Q2nd","Q3rd","Q4th"],MINI:["Q1","Q2","Q3","Q4"]}},OVER_TIME:{zh:{YEAR:"年",MONTH:"月",DATE:"日",HOUR:"时",MINUTE:"分",SECOND:"秒",MILLISECOND:"毫秒",DAY:"天",QUARTER:"季度"},en:{YEAR:"year",MONTH:"month",DATE:"date",HOUR:"hour",MINUTE:"minute",SECOND:"second",MILLISECOND:"millisecond",DAY:"day",QUARTER:"quarter"}},PASS_TIME:{zh:{YEAR:"年前",MONTH:"个月前",DAY:"天前",BEFORE_YESTERDAY:"前天",YESTERDAY:"昨天",TODAY:"今天",HOUR:"小时前",MINUTE:"分钟前",JUST:"刚刚"},en:{YEAR:" year ago",MONTH:" month ago",DAY:" day ago",BEFORE_YESTERDAY:"before yesterday",YESTERDAY:" yesterday",TODAY:" today",HOUR:" hour ago",MINUTE:" minute ago",JUST:" just"}},HOLIDAY:{zh:["元旦","春节","清明节","劳动节","端午节","中秋节","国庆节"],en:["New Year‘s Day","Spring Festival","Tomb Sweeping Day","Labor Day","Dragon Boat Festival","Mid-Autumn Day","National Day"]},ZODIAC:{zh:["摩羯座","水瓶座","双鱼座","白羊座","金牛座","双子座","巨蟹座","狮子座","处女座","天秤座","天蝎座","射手座"],en:["Capricorn","Aquarius","Pisces","Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius"]},CHINESE_ZODIAC:{zh:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],en:["Rat","Ox","Tiger","Rabbit","Dragon","Snake","Horse","Goat","Monkey","Rooster","Dog","Pig"]},HEAVENLY_STEMS:{zh:["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],en:["Jia","Yi","Bing","Ding","Wu","Ji","Geng","Xin","Ren","Gui"]},EARTHLY_BRANCHES:{zh:["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],en:["Zi","Chou","Yin","Mao","Chen","Si","Wu","Wei","Shen","You","Xu","Hai"]}},i={8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Caps Lock",27:"Escape",32:"Space",33:"Page Up",34:"Page Down",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",42:"Print Screen",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Windows",93:"Right Click",96:"Numpad 0",97:"Numpad 1",98:"Numpad 2",99:"Numpad 3",100:"Numpad 4",101:"Numpad 5",102:"Numpad 6",103:"Numpad 7",104:"Numpad 8",105:"Numpad 9",106:"Numpad *",107:"Numpad +",109:"Numpad -",110:"Numpad .",111:"Numpad /",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Num Lock",145:"Scroll Lock",182:"My Computer",183:"My Calculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={PROVINCE:{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:"台湾",81:"香港",82:"澳门",91:"国外"},SEX:{MAN:"男",WOMAN:"女"}};function s(t){return Number.isInteger(t)}function u(t){return"String"===Object.prototype.toString.call(t).slice(8,-1)}function c(t){return"Array"===Object.prototype.toString.call(t).slice(8,-1)}function f(t){return"Object"===Object.prototype.toString.call(t).slice(8,-1)}function l(t){return"Date"===Object.prototype.toString.call(t).slice(8,-1)}function h(t){return null==t||"undefined"===t||"null"===t||0===t||!1===t||g(t)}function g(t){return null==t||"boolean"==typeof t||Array.isArray(t)||""===t||window.isNaN(Number(t))}function p(t){return null==t||""===t}function d(t){return!!p(t)||("string"==typeof t||Array.isArray(t)?0===t.length:"object"==typeof t&&(t instanceof Map||t instanceof Set?0===t.size:!(t instanceof Date||t instanceof RegExp||t instanceof Error)&&0===Object.keys(t).length))}function w(t){return d(t)||/^\s*$/.test(t)}function m(t){return void 0===t}function y(t){if(t.indexOf("_")>0){const e=t.replace(/\_(\w)/g,(function(t,e){return e.toUpperCase()}));return e.charAt(0).toUpperCase()+e.slice(1)}if(t.indexOf("-")>0){const e=t.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()}));return e.charAt(0).toUpperCase()+e.slice(1)}if(/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.charAt(0).toUpperCase()+t.slice(1);throw new TypeError("toPascalCase: value should be a string")}function b(t,e=10){return p(t)?0:Number.parseInt(String(t),e)}function A(t){return t.reduce((function(t,e){return t+e}))}function S(t=[],e=0,n=void 0){if(e<0)return t;if(0===t.length)t.push(n);else{if(e>t.length-1)return t;t.splice(e,0,n)}return t}function D(t=[],e=0,n=void 0){if(e<0)return t;if(0===t.length)t.push(n);else{if(e>t.length-1)return t;t.splice(e,0,t.splice(e,1,n)[0])}return t}function E(t){const e=Object.create(null);for(const[n,r]of t)e[n]=r;return e}function M(t){const e=new Map;for(const n of Object.keys(t))e.set(n,t[n]);return e}function T(t){const e=t.match(/^(\w+)\[(\d+)]$/);return{propName:e&&e[1]||void 0,propIndex:e?parseInt(e[2],10):void 0,isArray:!!e}}function C(t=new Date){const e=t.getFullYear();return e%100!=0&&e%4==0||e%400==0}function O(t,e=new Date){return t.getTime()-e.getTime()<0}function R(t,e=new Date){return t.getTime()-e.getTime()>0}function N(t,e){return["getFullYear","getMonth","getDate"].every((n=>t[n]()===e[n]()))}function U(t=new Date,e={format:"yyyy-MM-dd"}){const{format:n}=e;return _(t,{format:n})}function I(t=new Date){return{year:t.getFullYear(),month:t.getMonth()+1,date:t.getDate(),hours:t.getHours(),minutes:t.getMinutes(),seconds:t.getSeconds(),milliseconds:t.getMilliseconds()}}function $(t=new Date){return[7,1,2,3,4,5,6][t.getDay()]}function x(t=new Date){return t.getDate()}function F(t=new Date){return Math.ceil((t.getTime()-new Date(t.getFullYear().toString()).getTime())/864e5)+1}function v(t=new Date){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()}function P(t=new Date){return C(t)?366:365}function L(t){let e=0;const n=_(t).split("-"),r=Number(n[0]),o=Number(n[1]),i=Number(n[2]),a=new Date,s=a.getFullYear(),u=a.getMonth()+1,c=a.getDate(),f=s-r;if(f>0){const t=u-o;e=0===t?c-i<0?f-1:f:t<0?f-1:f}return e}function k(t=new Date,e=1){return t.setFullYear(t.getFullYear()+e),t}function B(t=new Date,e=1){return t.setMonth(t.getMonth()+e),t}function j(t=new Date,e=1){return t.setDate(t.getDate()+e),t}function Y(t=new Date){return new Date(t.getTime()+60*t.getTimezoneOffset()*1e3)}function H(t){if(p(t))throw new TypeError("toDate: value cannot be null or undefined");if(u(t))return new Date(String(t).replace(/-/g,"/"));if(s(t)&&13===String(t).length)return new Date(t);if(s(t)&&10===String(t).length)return new Date(1e3*Number(t));throw new TypeError(`toDate: invalid input type: ${typeof t}, expected string or number`)}function _(t,e={format:"yyyy-MM-dd",lang:"zh"}){const{format:n="yyyy-MM-dd",lang:r="zh"}=e;if(p(t))throw new TypeError("toDateString: date cannot be null or undefined");if(!l(t))throw new TypeError(`toDateString: invalid input type: ${typeof t}, expected Date object`);const i={"(y+)":e=>{const n=t.getFullYear().toString();return 2===e.length?n.slice(-2):n},"(M+)":e=>{const n=t.getMonth()+1;return 1===e.length?n.toString():z(n)},"(d+)":e=>{const n=t.getDate();return 1===e.length?n.toString():z(n)},"(h+)":e=>{const n=t.getHours()%12||12;return 1===e.length?n.toString():z(n)},"(H+)":e=>{const n=t.getHours();return 1===e.length?n.toString():z(n)},"(m+)":e=>{const n=t.getMinutes();return 1===e.length?n.toString():z(n)},"(s+)":e=>{const n=t.getSeconds();return 1===e.length?n.toString():z(n)},"(S+)":e=>t.getMilliseconds().toString().padStart(e.length,"0").slice(0,e.length),"([aA]+)":e=>{const n=t.getHours()<12;return e.length>1?n?o.AM_PM[r].AM:o.AM_PM[r].PM:n?e.toLowerCase():e.toUpperCase()},"(E+)":e=>{const n=t.getDay();return 1===e.length?o.WEEK[r].MINI[n]:2===e.length?o.WEEK[r].SHORT[n]:o.WEEK[r].FULL[n]},"(Q+)":e=>{const n=Math.floor((t.getMonth()+3)/3)-1;return 1===e.length?o.QUARTER[r].MINI[n]:2===e.length?o.QUARTER[r].SHORT[n]:o.QUARTER[r].FULL[n]}};let a=n;return Object.entries(i).forEach((([t,e])=>{const n=new RegExp(t,"g");a=a.replace(n,((t,n)=>e(n)))})),a}function z(t){const e=Number(t);return e>9?String(e):"0"+e}function W(t,e){let n=Math.abs(Number(t)),r=Math.abs(Number(e));for(;0!==r;){const t=r;r=n%r,n=t}return n}function Z(t,e){return new RegExp(e).test(t)}function Q(t,e=String(Date.now())){return new Promise(((e,n)=>{try{const n=t.type,r=n.split("/")[1];e(new File([t],`${Date.now()}.${r}`,{type:n,lastModified:Date.now()}))}catch(t){console.error(t),n(t)}}))}function K(t){return new Promise(((e,n)=>{const r=new FileReader;r.onload=function(t){const n=t.target?.result;e(n)},r.onerror=function(t){n(t)},r.readAsText(t)}))}function V(t){if(t>255)throw"'"+t+"'' is greater than 255(0xff);";return("0"+Number(t).toString(16)).slice(-2)}const J="not a UTF-8 string",q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),X={};for(let t=0;t<64;++t)X[q[t]]=t;X["-"]=62,X._=63;const G="object"==typeof process&&process.versions&&process.versions.node,tt="object"==typeof window&&"function"==typeof window.btoa,et=G?global:"object"==typeof self?self:window,nt=function(t){return t.split("=")[0].replace(/[\r\n]/g,"").replace(/[^A-Za-z0-9+/=_-]/g,"")},rt=function(t){const e=t.length,n=new Array(4*e);let r=0;for(let o=0;o<e;o++){const e=t.charCodeAt(o);if(e<128)n[r++]=e;else if(e<2048)n[r++]=192|e>>6,n[r++]=128|63&e;else if(e<55296||e>=57344)n[r++]=224|e>>12,n[r++]=128|e>>6&63,n[r++]=128|63&e;else{const i=65536+((1023&e)<<10|1023&t.charCodeAt(++o));n[r++]=240|i>>18,n[r++]=128|i>>12&63,n[r++]=128|i>>6&63,n[r++]=128|63&i}}return n.slice(0,r)},ot=function(t){if(!t)return[];const e=(t=nt(t)).length,n=e>>2<<2,r=new Array(Math.floor(3*e/4));let o=0,i=0;for(;i<n;){const e=X[t.charAt(i++)]||0,n=X[t.charAt(i++)]||0,a=X[t.charAt(i++)]||0,s=X[t.charAt(i++)]||0;r[o++]=255&(e<<2|n>>>4),r[o++]=255&(n<<4|a>>>2),r[o++]=255&(a<<6|s)}const a=e-n;if(2===a){const e=X[t.charAt(i++)]||0,n=X[t.charAt(i++)]||0;r[o++]=255&(e<<2|n>>>4)}else if(3===a){const e=X[t.charAt(i++)]||0,n=X[t.charAt(i++)]||0,a=X[t.charAt(i++)]||0;r[o++]=255&(e<<2|n>>>4),r[o++]=255&(n<<4|a>>>2)}return r.slice(0,o)},it=function(t){const e=t.length,n=3*Math.floor(e/3),r=new Array(Math.ceil(4*e/3));let o=0;for(let e=0;e<n;){const n=t[e++],i=t[e++],a=t[e++];r[o++]=q[n>>>2],r[o++]=q[63&(n<<4|i>>>4)],r[o++]=q[63&(i<<2|a>>>6)],r[o++]=q[63&a]}const i=e-n;if(1===i){const e=t[n];r[o++]=q[e>>>2],r[o++]=q[e<<4&63],r[o++]="=",r[o++]="="}else if(2===i){const e=t[n],i=t[n+1];r[o++]=q[e>>>2],r[o++]=q[63&(e<<4|i>>>4)],r[o++]=q[i<<2&63],r[o++]="="}return r.join("")};let at,st,ut=et.btoa,ct=et.atob;G?(ut=function(t){if(!t)return"";const e=Array.from(t).map((t=>t.charCodeAt(0)));return it(e)},ct=function(t){if(!t)return"";const e=ot(t);return String.fromCharCode.apply(null,e)},at=function(t){if(!t)return"";const e=rt(t);return it(e)},st=function(t){if(!t)return"";const e=ot(t),n=[],r=e.length;let o=0;for(;o<r;){const t=e[o++];if(t<=127){n.push(String.fromCharCode(t));continue}let i,a;if(t>191&&t<=223)i=31&t,a=1;else if(t<=239)i=15&t,a=2;else{if(!(t<=247))throw new Error(J);i=7&t,a=3}for(let t=0;t<a;++t){const t=e[o++];if(o>r||t<128||t>191)throw new Error(J);i=(i<<6)+(63&t)}if(i>=55296&&i<=57343)throw new Error(J);if(i>1114111)throw new Error(J);i<=65535?n.push(String.fromCharCode(i)):(i-=65536,n.push(String.fromCharCode(55296+(i>>10)),String.fromCharCode(56320+(1023&i))))}return n.join("")}):tt?(at=function(t){if(!t)return"";const e=[],n=t.length;for(let r=0;r<n;r++){const n=t.charCodeAt(r);if(n<128)e.push(String.fromCharCode(n));else if(n<2048)e.push(String.fromCharCode(192|n>>6),String.fromCharCode(128|63&n));else if(n<55296||n>=57344)e.push(String.fromCharCode(224|n>>12),String.fromCharCode(128|n>>6&63),String.fromCharCode(128|63&n));else{const o=65536+((1023&n)<<10|1023&t.charCodeAt(++r));e.push(String.fromCharCode(240|o>>18),String.fromCharCode(128|o>>12&63),String.fromCharCode(128|o>>6&63),String.fromCharCode(128|63&o))}}return ut(e.join(""))},st=function(t){if(!t)return"";const e=ct(t.replace(/-/g,"+").replace(/_/g,"/"));if(!/[^\u0000-\u007F]/.test(e))return e;const n=[],r=e.length;let o=0;for(;o<r;){const t=e.charCodeAt(o++);if(t<=127){n.push(String.fromCharCode(t));continue}let i,a;if(t>191&&t<=223)i=31&t,a=1;else if(t<=239)i=15&t,a=2;else{if(!(t<=247))throw new Error(J);i=7&t,a=3}for(let t=0;t<a;++t){const t=e.charCodeAt(o++);if(o>r||t<128||t>191)throw new Error(J);i=(i<<6)+(63&t)}if(i>=55296&&i<=57343)throw new Error(J);if(i>1114111)throw new Error(J);i<=65535?n.push(String.fromCharCode(i)):(i-=65536,n.push(String.fromCharCode(55296+(i>>10)),String.fromCharCode(56320+(1023&i))))}return n.join("")}):(ut=function(t){if(!t)return"";const e=Array.from(t).map((t=>t.charCodeAt(0)));return it(e)},ct=function(t){if(!t)return"";const e=ot(t);return String.fromCharCode.apply(null,e)},at=function(t){if(!t)return"";const e=rt(t);return it(e)},st=function(t){if(!t)return"";const e=ot(t),n=[],r=e.length;let o=0;for(;o<r;){const t=e[o++];if(t<=127){n.push(String.fromCharCode(t));continue}let i,a;if(t>191&&t<=223)i=31&t,a=1;else if(t<=239)i=15&t,a=2;else{if(!(t<=247))throw new Error(J);i=7&t,a=3}for(let t=0;t<a;++t){const t=e[o++];if(o>r||t<128||t>191)throw new Error(J);i=(i<<6)+(63&t)}if(i>=55296&&i<=57343)throw new Error(J);if(i>1114111)throw new Error(J);i<=65535?n.push(String.fromCharCode(i)):(i-=65536,n.push(String.fromCharCode(55296+(i>>10)),String.fromCharCode(56320+(1023&i))))}return n.join("")});const ft=function(t,e=!1){if(null==t)return"";let n="";if("string"!=typeof t)t.constructor===et.ArrayBuffer&&(t=new Uint8Array(t)),n=(r=t)&&0!==r.length?it(r):"";else{if(""===t)return"";n=at(t)}var r;return e&&(n=n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")),n},lt=function(t){return null==t||""===t?"":(t=t.replace(/-/g,"+").replace(/_/g,"/"),t=nt(t),st(t))};function ht(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function gt(t,e,n,r,o,i){return ht((a=ht(ht(e,t),ht(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function pt(t,e,n,r,o,i,a){return gt(e&n|~e&r,t,e,o,i,a)}function dt(t,e,n,r,o,i,a){return gt(e&r|n&~r,t,e,o,i,a)}function wt(t,e,n,r,o,i,a){return gt(e^n^r,t,e,o,i,a)}function mt(t,e,n,r,o,i,a){return gt(n^(e|~r),t,e,o,i,a)}function yt(t,e){var n,r,o,i,a;t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;var s=1732584193,u=-271733879,c=-1732584194,f=271733878;for(n=0;n<t.length;n+=16)r=s,o=u,i=c,a=f,s=pt(s,u,c,f,t[n],7,-680876936),f=pt(f,s,u,c,t[n+1],12,-389564586),c=pt(c,f,s,u,t[n+2],17,606105819),u=pt(u,c,f,s,t[n+3],22,-1044525330),s=pt(s,u,c,f,t[n+4],7,-176418897),f=pt(f,s,u,c,t[n+5],12,1200080426),c=pt(c,f,s,u,t[n+6],17,-1473231341),u=pt(u,c,f,s,t[n+7],22,-45705983),s=pt(s,u,c,f,t[n+8],7,1770035416),f=pt(f,s,u,c,t[n+9],12,-1958414417),c=pt(c,f,s,u,t[n+10],17,-42063),u=pt(u,c,f,s,t[n+11],22,-1990404162),s=pt(s,u,c,f,t[n+12],7,1804603682),f=pt(f,s,u,c,t[n+13],12,-40341101),c=pt(c,f,s,u,t[n+14],17,-1502002290),s=dt(s,u=pt(u,c,f,s,t[n+15],22,1236535329),c,f,t[n+1],5,-165796510),f=dt(f,s,u,c,t[n+6],9,-1069501632),c=dt(c,f,s,u,t[n+11],14,643717713),u=dt(u,c,f,s,t[n],20,-373897302),s=dt(s,u,c,f,t[n+5],5,-701558691),f=dt(f,s,u,c,t[n+10],9,38016083),c=dt(c,f,s,u,t[n+15],14,-660478335),u=dt(u,c,f,s,t[n+4],20,-405537848),s=dt(s,u,c,f,t[n+9],5,568446438),f=dt(f,s,u,c,t[n+14],9,-1019803690),c=dt(c,f,s,u,t[n+3],14,-187363961),u=dt(u,c,f,s,t[n+8],20,1163531501),s=dt(s,u,c,f,t[n+13],5,-1444681467),f=dt(f,s,u,c,t[n+2],9,-51403784),c=dt(c,f,s,u,t[n+7],14,1735328473),s=wt(s,u=dt(u,c,f,s,t[n+12],20,-1926607734),c,f,t[n+5],4,-378558),f=wt(f,s,u,c,t[n+8],11,-2022574463),c=wt(c,f,s,u,t[n+11],16,1839030562),u=wt(u,c,f,s,t[n+14],23,-35309556),s=wt(s,u,c,f,t[n+1],4,-1530992060),f=wt(f,s,u,c,t[n+4],11,1272893353),c=wt(c,f,s,u,t[n+7],16,-155497632),u=wt(u,c,f,s,t[n+10],23,-1094730640),s=wt(s,u,c,f,t[n+13],4,681279174),f=wt(f,s,u,c,t[n],11,-358537222),c=wt(c,f,s,u,t[n+3],16,-722521979),u=wt(u,c,f,s,t[n+6],23,76029189),s=wt(s,u,c,f,t[n+9],4,-640364487),f=wt(f,s,u,c,t[n+12],11,-421815835),c=wt(c,f,s,u,t[n+15],16,530742520),s=mt(s,u=wt(u,c,f,s,t[n+2],23,-995338651),c,f,t[n],6,-198630844),f=mt(f,s,u,c,t[n+7],10,1126891415),c=mt(c,f,s,u,t[n+14],15,-1416354905),u=mt(u,c,f,s,t[n+5],21,-57434055),s=mt(s,u,c,f,t[n+12],6,1700485571),f=mt(f,s,u,c,t[n+3],10,-1894986606),c=mt(c,f,s,u,t[n+10],15,-1051523),u=mt(u,c,f,s,t[n+1],21,-2054922799),s=mt(s,u,c,f,t[n+8],6,1873313359),f=mt(f,s,u,c,t[n+15],10,-30611744),c=mt(c,f,s,u,t[n+6],15,-1560198380),u=mt(u,c,f,s,t[n+13],21,1309151649),s=mt(s,u,c,f,t[n+4],6,-145523070),f=mt(f,s,u,c,t[n+11],10,-1120210379),c=mt(c,f,s,u,t[n+2],15,718787259),u=mt(u,c,f,s,t[n+9],21,-343485551),s=ht(s,r),u=ht(u,o),c=ht(c,i),f=ht(f,a);return[s,u,c,f]}function bt(t){var e,n="",r=32*t.length;for(e=0;e<r;e+=8)n+=String.fromCharCode(t[e>>5]>>>e%32&255);return n}function At(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function St(t){var e,n,r="0123456789abcdef",o="";for(n=0;n<t.length;n+=1)e=t.charCodeAt(n),o+=r.charAt(e>>>4&15)+r.charAt(15&e);return o}function Dt(t){return unescape(encodeURIComponent(t))}function Et(t){return function(t){return bt(yt(At(t),8*t.length))}(Dt(t))}function Mt(t,e){return function(t,e){var n,r,o=At(t),i=[],a=[];for(i[15]=a[15]=void 0,o.length>16&&(o=yt(o,8*t.length)),n=0;n<16;n+=1)i[n]=909522486^o[n],a[n]=1549556828^o[n];return r=yt(i.concat(At(e)),512+8*e.length),bt(yt(a.concat(r),640))}(Dt(t),Dt(e))}function Tt(t,e,n){return e?n?Mt(e,t):St(Mt(e,t)):n?Et(t):St(Et(t))}const Ct="input is invalid type",Ot="0123456789abcdef".split(""),Rt=[-2147483648,8388608,32768,128],Nt=[24,16,8,0],Ut=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class It{constructor(t=!1){this.blocks=new Array(17).fill(0),t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}update(t){if(this.finalized)return this;let e=!1;const n=typeof t;if("string"!==n){if("object"!==n)throw new Error(Ct);if(null===t)throw new Error(Ct);if(t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error(Ct);e=!0}let r,o,i=0,a=t.length;const s=this.blocks;for(;i<a;){if(this.hashed&&(this.hashed=!1,s.fill(0),s[0]=this.block),e)for(o=this.start;i<a&&o<64;++i)s[o>>>2]|=t[i]<<Nt[3&o++];else for(o=this.start;i<a&&o<64;++i)r=t.charCodeAt(i),r<128?s[o>>>2]|=r<<Nt[3&o++]:r<2048?(s[o>>>2]|=(192|r>>>6)<<Nt[3&o++],s[o>>>2]|=(128|63&r)<<Nt[3&o++]):r<55296||r>=57344?(s[o>>>2]|=(224|r>>>12)<<Nt[3&o++],s[o>>>2]|=(128|r>>>6&63)<<Nt[3&o++],s[o>>>2]|=(128|63&r)<<Nt[3&o++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++i)),s[o>>>2]|=(240|r>>>18)<<Nt[3&o++],s[o>>>2]|=(128|r>>>12&63)<<Nt[3&o++],s[o>>>2]|=(128|r>>>6&63)<<Nt[3&o++],s[o>>>2]|=(128|63&r)<<Nt[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=s[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}hash(){let t=this.h0,e=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7;const u=this.blocks;let c,f,l,h,g,p,d,w,m,y,b;for(c=16;c<64;++c)g=u[c-15],f=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3,g=u[c-2],l=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,u[c]=u[c-16]+f+u[c-7]+l|0;for(b=e&n,c=0;c<64;c+=4)this.first?(this.is224?(w=300032,g=u[0]-1413257819,s=g-150054599|0,r=g+24177077|0):(w=704751109,g=u[0]-210244248,s=g-1521486534|0,r=g+143694565|0),this.first=!1):(f=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),l=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),w=t&e,h=w^t&n^b,d=o&i^~o&a,g=s+l+d+Ut[c]+u[c],p=f+h,s=r+g|0,r=g+p|0),f=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),l=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),m=r&t,h=m^r&e^w,d=s&o^~s&i,g=a+l+d+Ut[c+1]+u[c+1],p=f+h,a=n+g|0,n=g+p|0,f=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),l=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),y=n&r,h=y^n&t^m,d=a&s^~a&o,g=i+l+d+Ut[c+2]+u[c+2],p=f+h,i=e+g|0,e=g+p|0,f=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),l=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=e&n,h=b^e&r^y,d=i&a^~i&s,g=o+l+d+Ut[c+3]+u[c+3],p=f+h,o=t+g|0,t=g+p|0;this.h0=this.h0+t|0,this.h1=this.h1+e|0,this.h2=this.h2+n|0,this.h3=this.h3+r|0,this.h4=this.h4+o|0,this.h5=this.h5+i|0,this.h6=this.h6+a|0,this.h7=this.h7+s|0}finalize(){if(this.finalized)return this;this.finalized=!0;const t=this.blocks;let e=this.lastByteIndex;return t[16]=this.block,t[e>>>2]|=Rt[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t.fill(0),t[0]=this.block),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash(),this}hex(){this.finalize();const t=this.h0,e=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7;let u="";return u+=Ot[t>>>28&15]+Ot[t>>>24&15]+Ot[t>>>20&15]+Ot[t>>>16&15]+Ot[t>>>12&15]+Ot[t>>>8&15]+Ot[t>>>4&15]+Ot[15&t],u+=Ot[e>>>28&15]+Ot[e>>>24&15]+Ot[e>>>20&15]+Ot[e>>>16&15]+Ot[e>>>12&15]+Ot[e>>>8&15]+Ot[e>>>4&15]+Ot[15&e],u+=Ot[n>>>28&15]+Ot[n>>>24&15]+Ot[n>>>20&15]+Ot[n>>>16&15]+Ot[n>>>12&15]+Ot[n>>>8&15]+Ot[n>>>4&15]+Ot[15&n],u+=Ot[r>>>28&15]+Ot[r>>>24&15]+Ot[r>>>20&15]+Ot[r>>>16&15]+Ot[r>>>12&15]+Ot[r>>>8&15]+Ot[r>>>4&15]+Ot[15&r],u+=Ot[o>>>28&15]+Ot[o>>>24&15]+Ot[o>>>20&15]+Ot[o>>>16&15]+Ot[o>>>12&15]+Ot[o>>>8&15]+Ot[o>>>4&15]+Ot[15&o],u+=Ot[i>>>28&15]+Ot[i>>>24&15]+Ot[i>>>20&15]+Ot[i>>>16&15]+Ot[i>>>12&15]+Ot[i>>>8&15]+Ot[i>>>4&15]+Ot[15&i],u+=Ot[a>>>28&15]+Ot[a>>>24&15]+Ot[a>>>20&15]+Ot[a>>>16&15]+Ot[a>>>12&15]+Ot[a>>>8&15]+Ot[a>>>4&15]+Ot[15&a],this.is224||(u+=Ot[s>>>28&15]+Ot[s>>>24&15]+Ot[s>>>20&15]+Ot[s>>>16&15]+Ot[s>>>12&15]+Ot[s>>>8&15]+Ot[s>>>4&15]+Ot[15&s]),u}digest(){this.finalize();const t=this.h0,e=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,u=[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,o>>>24&255,o>>>16&255,o>>>8&255,255&o,i>>>24&255,i>>>16&255,i>>>8&255,255&i,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||u.push(s>>>24&255,s>>>16&255,s>>>8&255,255&s),u}raw(){this.finalize();const t=this.digest();let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}arrayBuffer(){this.finalize();const t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t}}class $t{constructor(t,e=!1){let n=[];const r=typeof t;if("string"===r){let e,r=0,o=t.length;for(let i=0;i<o;++i)e=t.charCodeAt(i),e<128?n[r++]=e:e<2048?(n[r++]=192|e>>>6,n[r++]=128|63&e):e<55296||e>=57344?(n[r++]=224|e>>>12,n[r++]=128|e>>>6&63,n[r++]=128|63&e):(e=65536+((1023&e)<<10|1023&t.charCodeAt(++i)),n[r++]=240|e>>>18,n[r++]=128|e>>>12&63,n[r++]=128|e>>>6&63,n[r++]=128|63&e)}else{if("object"!==r)throw new Error(Ct);if(null===t)throw new Error(Ct);if(t.constructor===ArrayBuffer)n=Array.from(new Uint8Array(t));else{if(!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error(Ct);n=Array.from(t)}}n.length>64&&(n=new It(e).update(n).digest());const o=[],i=[];for(let t=0;t<64;++t){const e=n[t]||0;o[t]=92^e,i[t]=54^e}this.sha256=new It(e),this.sha256.update(i),this.oKeyPad=o,this.is224=e,this.inner=!0}update(t){return this.sha256.update(t),this}finalize(){if(this.inner){const t=this.sha256.digest();this.sha256=new It(this.is224),this.sha256.update(this.oKeyPad).update(t),this.inner=!1}return this.sha256.finalize(),this}hex(){return this.finalize(),this.sha256.hex()}digest(){return this.finalize(),this.sha256.digest()}raw(){return this.finalize(),this.sha256.raw()}arrayBuffer(){return this.finalize(),this.sha256.arrayBuffer()}}const xt=(t=!1)=>{const e=e=>new It(t).update(e).hex();return e.raw=e=>new It(t).update(e).raw(),e.digest=e=>new It(t).update(e).digest(),e.arrayBuffer=e=>new It(t).update(e).arrayBuffer(),e.create=()=>new It(t),e.update=t=>e.create().update(t),e},Ft=(t=!1)=>{const e=e=>new It(t).update(e).raw();return e.hex=e=>new It(t).update(e).hex(),e.digest=e=>new It(t).update(e).digest(),e.arrayBuffer=e=>new It(t).update(e).arrayBuffer(),e.create=()=>new It(t),e.update=t=>e.create().update(t),e},vt=(t=!1)=>{const e=(e,n)=>new $t(e,t).update(n).hex();return e.raw=(e,n)=>new $t(e,t).update(n).raw(),e.digest=(e,n)=>new $t(e,t).update(n).digest(),e.arrayBuffer=(e,n)=>new $t(e,t).update(n).arrayBuffer(),e.create=e=>new $t(e,t),e.update=(t,n)=>e.create(t).update(n),e},Pt=(t=!1)=>{const e=(e,n)=>new $t(e,t).update(n).raw();return e.hex=(e,n)=>new $t(e,t).update(n).hex(),e.digest=(e,n)=>new $t(e,t).update(n).digest(),e.arrayBuffer=(e,n)=>new $t(e,t).update(n).arrayBuffer(),e.create=e=>new $t(e,t),e.update=(t,n)=>e.create(t).update(n),e},Lt=xt(),kt=Ft(),Bt=vt(),jt=Pt(),Yt=xt(!0),Ht=Ft(!0),_t=vt(!0),zt=Pt(!0);const Wt=64,Zt=new Uint8Array(Wt).fill(54),Qt=new Uint8Array(Wt).fill(92),Kt=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);function Vt(t,e){const n=31&e;return t<<n|t>>>32-n}function Jt(t,e){const n=[];for(let r=t.length-1;r>=0;r--)n[r]=255&(t[r]^e[r]);return n}function qt(t){return t^Vt(t,9)^Vt(t,17)}function Xt(t){return t.map((t=>1===(t=t.toString(16)).length?"0"+t:t)).join("")}function Gt(t){const e=[];let n=t.length;var r,o;n%2!=0&&(o=n+1,t=(r=t).length>=o?r:new Array(o-r.length+1).join("0")+r),n=t.length;for(let r=0;r<n;r+=2)e.push(parseInt(t.substr(r,2),16));return e}function te(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t.codePointAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>>6),e.push(128|63&r);else if(r<=55295||r>=57344&&r<=65535)e.push(224|r>>>12),e.push(128|r>>>6&63),e.push(128|63&r);else{if(!(r>=65536&&r<=1114111))throw e.push(r),new TypeError("utf8ToArray: input is not supported in sm3");n++,e.push(240|r>>>18&28),e.push(128|r>>>12&63),e.push(128|r>>>6&63),e.push(128|63&r)}}return e}function ee(t){let e=8*t.length,n=e%512;n=n>=448?512-n%448-1:448-n-1;const r=new Array((n-7)/8).fill(0),o=new Array(8).fill(0);let i=e.toString(2);for(let t=7;t>=0;t--)if(i.length>8){const e=i.length-8;o[t]=parseInt(i.substr(e),2),i=i.substr(0,e)}else i.length>0&&(o[t]=parseInt(i,2),i="");const a=new Uint8Array([...t,128,...r,...o]),s=new DataView(a.buffer,0),u=a.length/64,c=new Uint32Array(Kt),f=new Uint32Array(68),l=new Uint32Array(64);for(let t=0;t<u;t++){f.fill(0),l.fill(0);const e=16*t;for(let t=0;t<16;t++)f[t]=s.getUint32(4*(e+t),!1);for(let t=16;t<68;t++)f[t]=(h=f[t-16]^f[t-9]^Vt(f[t-3],15))^Vt(h,15)^Vt(h,23)^Vt(f[t-13],7)^f[t-6];for(let t=0;t<64;t++)l[t]=f[t]^f[t+4];const n=2043430169,r=2055708042;let o,i,a,u,g,p=c[0],d=c[1],w=c[2],m=c[3],y=c[4],b=c[5],A=c[6],S=c[7];for(let t=0;t<64;t++){g=t<=15?n:r,o=Vt(Vt(p,12)+y+Vt(g,t)&4294967295,7),i=o^Vt(p,12);const e=t<=15?y^b^A:y&b|~y&A;a=(t<=15?p^d^w:p&d|p&w|d&w)+m+i+l[t]&4294967295,u=e+S+o+f[t]&4294967295,m=w,w=Vt(d,9),d=p,p=a,S=A,A=Vt(b,19),b=y,y=qt(u)}c[0]^=p,c[1]^=d,c[2]^=w,c[3]^=m,c[4]^=y,c[5]^=b,c[6]^=A,c[7]^=S}var h;const g=[];for(let t=0;t<c.length;t++)g.push((4278190080&c[t])>>>24,(16711680&c[t])>>>16,(65280&c[t])>>>8,255&c[t]);return g}function ne(t,e){const n="string"==typeof t?te(t):Array.prototype.slice.call(t);if(e){const t=function(t,e){let n=e.length>Wt?ee(e):[...e];for(;n.length<Wt;)n.push(0);const r=Jt(n,Zt),o=Jt(n,Qt),i=ee([...r,...t]);return ee([...o,...i])}(n,"string"==typeof e?/^[0-9a-fA-F]+$/.test(e)?Gt(e):te(e):Array.prototype.slice.call(e));return Xt(t)}return Xt(ee(n))}const re="ecb",oe="cbc",ie="pkcs#7",ae="hex",se="utf8",ue="array",ce="uint8array",fe="arraybuffer",le=1,he=0,ge=32,pe=16,de=16,we=16,me=new Uint8Array([214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72]),ye=new Uint32Array([462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257]),be=new Uint32Array([2746333894,1453994832,1736282519,2993693404]);function Ae(t){if((t=t.replace(/\s+/g,"")).length%2!=0)throw new TypeError("hexToUint8Array: hex string length must be even from sm4");const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n/2]=255&parseInt(t.substr(n,2),16);return e}function Se(t,e){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(t instanceof Uint8Array)return new Uint8Array(t);if(Array.isArray(t))return new Uint8Array(t);if("string"==typeof t)return e===le?(n=t,(new TextEncoder).encode(n)):Ae(t);var n;throw new TypeError(`normalizeInput: unsupported input type: ${typeof t} from sm4`)}function De(t,e,n){let r;if("string"==typeof t)r=Ae(t);else if(t instanceof ArrayBuffer)r=new Uint8Array(t);else if(t instanceof Uint8Array)r=t;else{if(!Array.isArray(t))throw new TypeError(`normalizeKeyIv: unsupported ${n} type: ${typeof t} from sm4`);r=new Uint8Array(t)}if(r.length!==e)throw new TypeError(`normalizeKeyIv: ${n} must be ${8*e} bits (${e} bytes) from sm4`);return r}function Ee(t,e){const n=31&e;return(t<<n|t>>>32-n)>>>0}function Me(t){return(me[t>>>24&255]<<24|me[t>>>16&255]<<16|me[t>>>8&255]<<8|me[255&t])>>>0}function Te(t){return(t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24))>>>0}function Ce(t){return(t^Ee(t,13)^Ee(t,23))>>>0}function Oe(t,e,n){if(t.length!==pe)throw new TypeError(`sm4BlockCrypt: input block must be ${pe} bytes for block crypt from sm4`);const r=new Uint32Array(4);for(let e=0;e<4;e++){const n=4*e;r[e]=(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}for(let t=0;t<ge;t+=4){let e=(r[1]^r[2]^r[3]^n[t])>>>0;r[0]^=Te(Me(e)),e=(r[2]^r[3]^r[0]^n[t+1])>>>0,r[1]^=Te(Me(e)),e=(r[3]^r[0]^r[1]^n[t+2])>>>0,r[2]^=Te(Me(e)),e=(r[0]^r[1]^r[2]^n[t+3])>>>0,r[3]^=Te(Me(e))}for(let t=0;t<pe;t+=4){const n=3-t/4;e[t]=r[n]>>>24&255,e[t+1]=r[n]>>>16&255,e[t+2]=r[n]>>>8&255,e[t+3]=255&r[n]}}function Re(t,e,n,r={}){const{mode:o=re,iv:i=[],padding:a=ie,output:s=ae}=r;if(![re,oe].includes(o))throw new TypeError(`sm4Core: unsupported mode: ${o}, only 'ecb' and 'cbc' are supported from sm4`);const u=Se(t,n),c=De(e,de,"key");let f=new Uint8Array(we);o===oe&&(f=De(i,we,"IV"));let l=u;if(a===ie&&n===le&&(l=function(t){const e=pe-t.length%pe,n=new Uint8Array(t.length+e);n.set(t);for(let r=0;r<e;r++)n[t.length+r]=255&e;return n}(u),l.length%pe!=0))throw new TypeError("sm4Core: PKCS7 padding failed: data length is not multiple of block size from sm4");const h=new Uint32Array(ge);!function(t,e,n){const r=new Uint32Array(4);for(let e=0;e<4;e++){const n=4*e;r[e]=(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}r[0]^=be[0],r[1]^=be[1],r[2]^=be[2],r[3]^=be[3];for(let t=0;t<ge;t+=4){let n=(r[1]^r[2]^r[3]^ye[t])>>>0;e[t]=r[0]^=Ce(Me(n)),n=(r[2]^r[3]^r[0]^ye[t+1])>>>0,e[t+1]=r[1]^=Ce(Me(n)),n=(r[3]^r[0]^r[1]^ye[t+2])>>>0,e[t+2]=r[2]^=Ce(Me(n)),n=(r[0]^r[1]^r[2]^ye[t+3])>>>0,e[t+3]=r[3]^=Ce(Me(n))}if(n===he)for(let t=0;t<16;t++){const n=e[t];e[t]=e[31-t],e[31-t]=n}}(c,h,n);const g=new Uint8Array(l.length);let p=new Uint8Array(f),d=0;for(;d<l.length;){const t=l.subarray(d,d+pe),e=new Uint8Array(pe);if(o===oe){if(n===le){const n=new Uint8Array(pe);for(let e=0;e<pe;e++)n[e]=255&(t[e]^p[e]);Oe(n,e,h)}else{Oe(t,e,h);for(let t=0;t<pe;t++)e[t]=255&(e[t]^p[t])}p=n===le?e:t}else Oe(t,e,h);g.set(e,d),d+=pe}let w=g;if(a===ie&&n===he&&(w=function(t){const e=255&t[t.length-1];for(let n=1;n<=e;n++)if(t[t.length-n]!==e)throw new TypeError("pkcs7Unpad: invalid PKCS#7 padding from sm4");return t.subarray(0,t.length-e)}(g)),n===he&&s===se)return m=w,new TextDecoder("utf-8").decode(m);var m;switch(s){case ae:return function(t){return Array.from(t).map((t=>{const e=t.toString(16);return 1===e.length?"0"+e:e})).join("")}(w);case ue:return Array.from(w);case ce:return w;case fe:return w.buffer;default:throw new TypeError(`sm4Core: unsupported output format: ${s} from sm4`)}}const Ne={ECB:re,CBC:oe},Ue=ie;const Ie=function(t=ae){if(!window?.crypto?.getRandomValues&&!global?.crypto?.getRandomValues)throw new TypeError("generateKey: the current environment does not support secure random number generation. please upgrade your browser/Node.js from sm4");const e=window?.crypto||global?.crypto,n=new Uint8Array(16);switch(e.getRandomValues(n),t){case ce:return n;case ue:return Array.from(n).map((t=>Number(t)));case fe:return n.buffer;default:return Array.from(n).map((t=>t.toString(16).padStart(2,"0"))).join("")}},$e=function(t=ae){if(!window?.crypto?.getRandomValues)throw new TypeError("generateIv: your browser does not support secure random generation (crypto API) from sm4");const e=new Uint8Array(we);switch(window.crypto.getRandomValues(e),t){case ce:return e;case ue:return Array.from(e).map((t=>Number(t)));case fe:return e.buffer;default:return Array.from(e).map((t=>{const e=t.toString(16);return 1===e.length?`0${e}`:e})).join("")}};function xe(t={},e){const{mode:n=Ne.ECB,iv:r}=t,o=Object.values(Ne);if(!o.includes(n))throw new TypeError(`sm4${e}:unsupported encryption mode "${n}", supports only ${o.join("/")}`);if(n===Ne.CBC&&!r)throw new TypeError(`sm4${e}:the CBC mode must be inputted with an IV (initialization vector)`);if(n===Ne.ECB&&void 0!==r)throw new TypeError(`sm4${e}: the ECB mode does not require an IV to be passed in. Please do not pass the iv parameter`);if(r){let t;if(t="string"==typeof r?32===r.length?16:r.length:r instanceof ArrayBuffer?r.byteLength:r instanceof Uint8Array||Array.isArray(r)?r.length:0,16!==t)throw new TypeError(`sm4${e}:IV must be 16 bytes in length, and the current length is ${t}`)}if(t.padding&&t.padding!==String(Ue))throw new TypeError(`sm4${e}: only pkcs#7 padding mode is supported, currently being input ${String(t.padding)}`)}const Fe={MODE:Ne,PADDING:Ue,OUTPUT:{HEX:ae,UTF8:se,ARRAY:ue,UINT8ARRAY:ce,ARRAYBUFFER:fe}};function ve(t,e,n){if(e>(t=String(t)).length)return t;let r="";return n<0&&(n=0),n>t.length-e&&(n=t.length-e),r=String().padEnd(n,"*"),t.substring(0,e)+r+t.substring(e+n)}function Pe(t){if(!p(t))return 15===t.length?"19"+t.substring(6,8)+"-"+t.substring(8,10)+"-"+t.substring(10,12):18===t.length?t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14):void 0}function Le(t){if(p(t))return;const e=Pe(t);return e?L(H(String(e))):void 0}function ke(t){if(!p(t))return 15===t.length?Number(t.substring(14))%2==0?a.SEX.WOMAN:a.SEX.MAN:18===t.length?Number(t.substring(16,17))%2==0?a.SEX.WOMAN:a.SEX.MAN:void 0}function Be(t){if(p(t))return;const e=t.substring(0,2);return e?a.PROVINCE[e]:void 0}function je(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7}){return Math.ceil((t.total||0)/(t.pageSize||0))}function Ye(t=window.location.href){const e=t.match(r.URL);if(e)return e[5]}function He(t=window.location.href){const e=(Ye(t)||"").split("&"),n={};for(let t=0;t<e.length;t++){const r=e[t].split("=");n[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||"")}return n}function _e(t,e=""){if("object"!=typeof t)return t;const n=[];for(const e in t){const r=t[e];if(c(r))for(let t=0;t<r.length;++t)n.push(encodeURIComponent(e+"["+t+"]")+"="+encodeURIComponent(r[t]));else n.push(encodeURIComponent(e)+"="+encodeURIComponent(t[e]))}return e?e.replace(/(\?.+?)(?=#|$)/,"?"+n.join("&")):n.join("&")}function ze(t,e,n=864e5){"undefined"!=typeof document&&(document.cookie=t+"="+e+";expires="+new Date(Date.now()+n))}function We(t,e){return t.className.indexOf(e)>0}function Ze(t,e){We(t,e)||(t.className+=" "+e)}function Qe(t,e){We(t,e)&&(t.className=t.className.replace(new RegExp(e,"gm"),""))}function Ke(){const t=window.navigator.userAgent;return/Android|webOS|iPhone|iPod|BlackBerry|Windows Phone|IEMobile/i.test(t)}function Ve(t){return new Promise(((e,n)=>{window.navigator.clipboard?window.navigator.clipboard.writeText(t).then((t=>{e(!0)}),(t=>{n(!1)})):console.warn("not support navigator clipboard!")}))}t.DATE=o,t.ID_CARD=a,t.KEYCODE=i,t.LANG={ZH:"zh",EN:"en"},t.MATH=n,t.REGEXP=r,t.SM4=Fe,t.SORT=e,t.add=function(t,e){let n,r;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{r=e.toString().split(".")[1].length}catch(t){r=0}const o=Math.pow(10,Math.max(n,r));return(Number(t)*o+Number(e)*o)/o},t.addClass=Ze,t.addDate=j,t.addHours=function(t=new Date,e=1){return t.setHours(t.getHours()+e),t},t.addMillisecond=function(t=new Date,e=100){return t.setMilliseconds(t.getMilliseconds()+e),t},t.addMinutes=function(t=new Date,e=1){return t.setMinutes(t.getMinutes()+e),t},t.addMonth=B,t.addQuarter=function(t=new Date,e=1){return t.setMonth(t.getMonth()+4*e),t},t.addSeconds=function(t=new Date,e=1){return t.setSeconds(t.getSeconds()+e),t},t.addStyle=function(t,e={}){if(t)for(const[n,r]of Object.entries(e))t.style.setProperty(n,r)},t.addWeek=function(t=new Date,e=1){return t.setDate(t.getDate()+7*e),t},t.addYear=k,t.appendSearchParam=function(t=window.location.href,e,n){const r=(Ye(t)||"").split("&");return r.push(`${e}=${n}`),t.replace(/(\?.+?)(?=#|$)/,"?"+r.join("&"))},t.appendToSearchParam=function(t=window.location.href,e,n,r){const o=(Ye(t)||"").split("&"),i=o.findIndex((t=>t.includes(e))),a=D(o,i,`${n}=${r}`);return t.replace(/(\?.+?)(?=#|$)/,"?"+a.join("&"))},t.arrayAvg=function(t){return A(t)/t.length},t.arrayBottom=function(t=[],e=0){return e<0||e>t.length-1||t.push(t.splice(e,1)[0]),t},t.arrayComplement=function(t,e){return[...[...new Set(t)].filter((t=>!e.includes(t))),...[...new Set(e)].filter((e=>!t.includes(e)))]},t.arrayCreate=function(t=0){return[...Array(t).keys()]},t.arrayDifference=function(t,e){return[...new Set(t)].filter((t=>!e.includes(t)))},t.arrayDown=function(t=[],e=0){return e<0||e>t.length-1||(e<t.length-1?t.splice(e+1,0,t.splice(e,1)[0]):t.unshift(t.splice(e,1)[0])),t},t.arrayEquals=function(t,e){return t===e||t.length===e.length&&t.every(((t,n)=>t===e[n]))},t.arrayInsert=function(t=[],e=0,n=void 0){if(e<0)return t;if(0===t.length)t.push(n);else{if(e>t.length-1)return t;t.splice(e,0,n)}return t},t.arrayInsertAfter=D,t.arrayInsertBefore=S,t.arrayIntersect=function(t,e){return[...new Set(t)].filter((t=>e.includes(t)))},t.arrayMax=function(t){return Math.max.apply(null,t)},t.arrayMin=function(t){return Math.min.apply(null,t)},t.arrayRemove=function(t=[],e=0){return e<0||e>t.length-1||t.splice(e,1),t},t.arrayRemoveAfter=function(t=[],e=0){return e<0||e>t.length-1||t.splice(e+1,1),t},t.arrayRemoveBefore=function(t=[],e=0){return e<=0||e>t.length-1||t.splice(e-1,1),t},t.arrayShuffle=function(t){for(let e=1;e<t.length;e++){const n=Math.floor(Math.random()*(e+1));[t[n],t[e]]=[t[e],t[n]]}return t},t.arraySort=function(t,n=e.ASC){return t.sort(((t,r)=>{switch(n){case e.ASC:return t-r;case e.DESC:return r-t;case e.RANDOM:return Math.random()-.5;default:return 0}}))},t.arraySortBy=function(t,e){return t.sort(((t,n)=>{for(const r of e){let e="",o="asc";if(f(r)?(e=r.prop,o=r.order||"asc"):(e=r,o="asc"),t[e]<n[e])return"asc"===o?-1:1;if(t[e]>n[e])return"asc"===o?1:-1}return 0}))},t.arraySum=A,t.arraySwap=function(t,e,n){return e<0||n<0||e>t.length-1||n>t.length-1||([t[n],t[e]]=[t[e],t[n]]),t},t.arrayToTree=function(t,e={key:"id",parentKey:"pid",childrenKey:"children"}){const n=e.key,r=e.parentKey,o=e.childrenKey;if(!t||0===t.length||!n||""===n)return[];const i=function(t,e,n){return t?(void 0!==n&&(t[e]=n),t[e]):null},a=[],s={};for(let e=0;e<t.length;e++)t[e][o]&&delete t[e][o],s[t[e][n]]=t[e];for(let e=0;e<t.length;e++){const u=s[t[e][r]];if(u&&t[e][n]!==t[e][r]){let n=i(u,o);n||(n=i(u,o,[])),n.push(t[e])}else a.push(t[e])}return a},t.arrayTop=function(t=[],e=0){return e<0||e>t.length-1||t.unshift(t.splice(e,1)[0]),t},t.arrayUnion=function(t,e){return[...new Set(t.concat(e))]},t.arrayUnique=function(t){return d(t)?[]:Array.from(new Set(t))},t.arrayUp=function(t=[],e=0){return e<0||e>t.length-1||(e>0?t.splice(e-1,0,t.splice(e,1)[0]):t.push(t.splice(e,1)[0])),t},t.base64Decode=function(t){return lt(t)},t.base64DecodeURI=function(t){return lt(t)},t.base64Encode=function(t,e=!1){return ft(t,e)},t.base64EncodeURI=function(t){return ft(t,!0)},t.base64FromHex=function(t,e=!1){return function(t,e=!1){if("string"!=typeof t||!/^[0-9a-fA-F]+$/.test(t))throw new TypeError("fromHex: input must be hex string");const n=t.length%2?`0${t}`:t,r=new Array(n.length/2);for(let t=0;t<r.length;t++)r[t]=parseInt(n.substr(2*t,2),16);let o=it(r);return e&&(o=o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")),o}(t,e)},t.base64FromUint8Array=function(t,e=!1){return function(t,e=!1){if(!(t instanceof Uint8Array))throw new TypeError("fromUint8Array: input must be Uint8Array");const n=Array.from(t);let r=it(n);return e&&(r=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")),r}(t,e)},t.base64ToBlob=function(t){return new Promise(((e,n)=>{try{const n=t.split(","),r=n[0]?n[0].match(/:(.+?);/):null,o=r?r[1]:"",i=window.atob(n[1]);let a=i.length;const s=new Uint8Array(a);for(;a--;)s[a]=i.charCodeAt(a);e(new Blob([s],{type:o}))}catch(t){console.error(t),n(t)}}))},t.base64ToFile=function(t,e=String(Date.now())){return new Promise(((n,r)=>{try{const r=t.split(","),o=r[0]?r[0].match(/:(.+?);/):null,i=o?o[1]:"",a=i.split("/")[1],s=window.atob(r[1]);let u=s.length;const c=new Uint8Array(u);for(;u--;)c[u]=s.charCodeAt(u);n(new File([c],`${e}.${a}`,{type:i}))}catch(t){console.error(t),r(t)}}))},t.base64ToHex=function(t,e=!1){return function(t,e=!1){if("string"!=typeof t)throw new TypeError("toHex: input must be string");e&&(t=t.replace(/-/g,"+").replace(/_/g,"/"));const n=ot(t);return Array.from(n).map((t=>t.toString(16).padStart(2,"0"))).join("")}(t,e)},t.base64ToUint8Array=function(t,e=!1){return function(t,e=!1){if("string"!=typeof t)throw new TypeError("toUint8Array: input must be string");e&&(t=t.replace(/-/g,"+").replace(/_/g,"/"));const n=ot(t);return new Uint8Array(n)}(t,e)},t.blobToBase64=function(t){return new Promise(((e,n)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=function(t){const n=t.target?.result;e(n)},r.onerror=function(t){console.error(t),n(t)}}))},t.blobToFile=Q,t.blobToText=K,t.clearClipboard=function(){return new Promise(((t,e)=>{Ve("").then((()=>t(!0))).catch(e)}))},t.clearCookie=function(t=document.domain){const e=document.cookie.match(/[^ =;]+(?==)/g)||[];if(e&&e.length>0)for(let n=e.length;n--;)document.cookie=e[n]+"=0;path=/;"+t?"domain="+t+";":"expires="+new Date(0).toUTCString()},t.clearLocalStorage=function(){window.localStorage.clear()},t.clearSessionStorage=function(){window.sessionStorage.clear()},t.clone=function(t){return null===t||"object"!=typeof t?t:Array.isArray(t)?[...t]:t.constructor===Object?Object.assign({},t):t instanceof Date?new Date(t.getTime()):t instanceof RegExp?new RegExp(t.source,t.flags):t},t.debounce=function(t,e=1e3,n=!0){let r=null;return function(...o){if(r&&clearTimeout(r),n){const n=!r;r=setTimeout((()=>{r=null}),e),n&&t.apply(this,o)}else r=setTimeout((()=>{t.apply(this,o)}),e)}},t.deepClone=function t(e){if(f(e)){const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}if(c(e)){const n=[];for(let r=0,o=e.length;r<o;r++)n[r]=t(e[r]);return n}if(l(e)){const t=new Date;return t.setTime(e.getTime()),t}return e},t.deepCompare=function(t,...e){let n=[],r=[];const o=(t,e)=>{if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(t===e)return!0;if("function"===typeof t&&"function"===typeof e)return t.toString()===e.toString();if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.source===e.source&&t.flags===e.flags;if(t instanceof String&&e instanceof String||t instanceof Number&&e instanceof Number)return t.toString()===e.toString();if(!(t instanceof Object&&e instanceof Object))return!1;if(t.isPrototypeOf(e)||e.isPrototypeOf(t))return!1;if(t.constructor!==e.constructor)return!1;if(t.prototype!==e.prototype)return!1;if(n.includes(t)||r.includes(e))return!1;const i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(const n of a){if(Object.prototype.hasOwnProperty.call(t,n)!==Object.prototype.hasOwnProperty.call(e,n))return!1;if(typeof t[n]!=typeof e[n])return!1}for(const a of i){const i=t[a],s=e[a];if("object"==typeof i||"function"==typeof i){if(n.push(t),r.push(e),!o(i,s))return!1;n.pop(),r.pop()}else if(i!==s)return!1}return!0};if(arguments.length<2)return console.warn("deepCompare 需要至少两个对比参数"),!0;for(const i of e)if(n=[],r=[],!o(t,i))return!1;return!0},t.divide=function(t,e){let n=0,r=0;try{n=t.toString().split(".")[1].length}catch(t){}try{r=e.toString().split(".")[1].length}catch(t){}return Number(t.toString().replace(".",""))/Number(e.toString().replace(".",""))*Math.pow(10,r-n)},t.downloadBlobFile=function(t,e){try{const n=window.URL.createObjectURL(t),r=window.document.createElement("a");r.download=e,r.href=n,r.click(),URL.revokeObjectURL(n)}catch(t){console.error(t)}},t.downloadFileUrl=function(t,e){try{const n=window.document.createElement("a");n.download=e,n.href=t,n.target="_blank",window.document.body.appendChild(n),n.click(),window.document.body.removeChild(n)}catch(t){console.error(t)}},t.equals=function(t,e){return Object.is(t,e)},t.equalsIgnoreCase=function(t,e){return Object.is(t.toLowerCase(),e.toLowerCase())},t.fileToBase64=function(t){return new Promise(((e,n)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=function(t){const n=t.target?.result;e(n)},r.onerror=function(t){console.error(t),n(t)}}))},t.fileToBlob=function(t){return new Promise(((e,n)=>{const r=new FileReader;r.readAsArrayBuffer(t),r.onload=n=>{const r=n.target?.result,o=new Blob([r],{type:t.type});e(o)},r.onerror=function(t){console.error(t),n(t)}}))},t.fileToUrl=function(t){return new Promise(((e,n)=>{try{e(URL.createObjectURL(t))}catch(t){console.error(t),n(t)}}))},t.formatFileSize=function(t){return d(t)?"0B":t<1024?t+"B":t<1048576?(t/1024).toFixed(2)+"KB":t<1073741824?(t/1048576).toFixed(2)+"MB":(t/1073741824).toFixed(2)+"GB"},t.formatRmbChinese=function(t){const e=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],n=["","拾","佰","仟"],r=["","万","亿","兆"],o=["角","分","毫","厘"],i=Number("999999999999999.9999");let a,s,u,c="";if(""===t)return"";if((t=parseFloat(String(t)))>=i)throw new TypeError("formatRmbChinese: calculated number overflow");if(0===t)return c=e[0]+"元整",c;if(-1===(t=t.toString()).indexOf(".")?(a=t,s=""):(u=t.split("."),a=u[0],s=u[1].substr(0,4)),parseInt(a,10)>0){let t=0;const o=a.length;for(let i=0;i<o;i++){const s=a.substr(i,1),u=o-i-1,f=u/4,l=u%4;"0"===s?t++:(t>0&&(c+=e[0]),t=0,c+=e[parseInt(s)]+n[l]),0===l&&t<4&&(c+=r[f])}c+="元"}if(""!==s){const t=s.length;for(let n=0;n<t;n++){const t=s.substr(n,1);"0"!==t&&(c+=e[Number(t)]+o[n])}}return""===c?c+=e[0]+"元整":""===s&&(c+="整"),c},t.formatStartOf=ve,t.formatStartOfBankCard=function(t,e=4,n=11){return ve(t,e,n)},t.formatStartOfIDCard=function(t,e=4,n=8){return ve(t,e,n)},t.formatStartOfMobile=function(t,e=3,n=4){return ve(t,e,n)},t.formatStartOfName=function(t){return 2===t.length?ve(t,1,1):t.length>2?ve(t,1,t.length-2):t},t.formatTemplate=function(t,e){return t?Array.from(t.matchAll(/\{\{(.+?)\}\}/g)).reduce(((t,n)=>t.replace(n[0],e[n[1]])),t):""},t.formatThousand=function(t){if(!parseFloat(String(t)))return String(t);const e=(t=String(t)).indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return t.replace(e,"$1,")},t.formatTitle=function(t){return t?t.split(/(?=[A-Z])|[\.\-\s_]/).map((t=>t.trim())).filter((t=>!!t)).map((t=>y(t.toLowerCase()))).join(" "):""},t.fromDateUTC=function(t=new Date){return new Date(t.getTime()-60*t.getTimezoneOffset()*1e3)},t.gcd=W,t.generateSM4Iv=$e,t.generateSM4Key=Ie,t.getAge=L,t.getAgeByIDCard=Le,t.getBetweenDates=function(t,e){if(p(t)||p(e))return[];const n=[];for(;e.getTime()-t.getTime()>=0;){const e=t.getFullYear(),r=z(t.getMonth()+1),o=z(t.getDate());n.push(e+"-"+r+"-"+o),t.setDate(t.getDate()+1)}return n},t.getBetweenMonths=function(t,e){if(p(t)||p(e))return[];const n=[],r=new Date,o=new Date;r.setFullYear(t.getFullYear(),t.getMonth()+1),o.setFullYear(e.getFullYear(),e.getMonth()+1);const i=r;let a="";for(;i<=o;){const t=i.getMonth();a=0===t?i.getFullYear()-1+"-12":i.getFullYear()+"-"+z(t),n.push(a),i.setMonth(t+1)}return n},t.getBetweenYears=function(t,e){if(p(t)||p(e))return[];const n=[];for(;e.getTime()-t.getTime()>=0;){const e=t.getFullYear();n.push(e),t.setFullYear(t.getFullYear()+1)}return n},t.getBirthdayByIDCard=Pe,t.getBrowserInfo=function(){const t=window.navigator.userAgent.toLowerCase(),e=t.match(/rv:([\d.]+)\) like gecko/)||t.match(/msie ([\d\.]+)/),n=t.match(/edg\/([\d\.]+)/),r=t.match(/firefox\/([\d\.]+)/),o=t.match(/(?:opera|opr).([\d\.]+)/),i=t.match(/chrome\/([\d\.]+)/),a=t.match(/version\/([\d\.]+).*safari/);return e?{name:"ie",version:e[1]}:n?{name:"edge",version:n[1]}:r?{name:"firefox",version:r[1]}:o?{name:"opera",version:o[1]}:i?{name:"chrome",version:i[1]}:a?{name:"safari",version:a[1]}:void 0},t.getChineseZodiac=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"";const r=t.getFullYear();return r<1900?"未知":o.CHINESE_ZODIAC[n][(r-1900)%o.CHINESE_ZODIAC[n].length]},t.getClipboard=function(){return new Promise(((t,e)=>{window.navigator.clipboard?window.navigator.clipboard.read().then((e=>{const n=[];for(const t of e)for(const e of t.types)t.getType(e).then((async t=>{if(t.type.includes("text")){const e=await K(t);n.push({type:t.type,data:e})}else n.push({type:t.type,data:t})}));t(n)})):console.warn("not support navigator clipboard!")}))},t.getClipboardText=function(){return new Promise(((t,e)=>{window.navigator.clipboard?window.navigator.clipboard.readText().then((e=>{t(e)})).catch((t=>{e(t)})):console.warn("not support navigator clipboard!")}))},t.getCookie=function(t){if("undefined"==typeof document)return"";const e=document.cookie?document.cookie.replace(/\s/g,"").split(";"):[];for(const n in e){const r=e[n].split("=");if(r[0]===t)return decodeURIComponent(r[1])}return""},t.getDate=U,t.getDateArray=function(t=new Date){return Object.entries(I(t)).map((([t,e])=>e))},t.getDateObject=I,t.getDateTime=function(t=new Date,e={format:"yyyy-MM-dd HH:mm:ss"}){const{format:n}=e;return _(t,{format:n})},t.getDayOfMonth=x,t.getDayOfWeek=$,t.getDayOfYear=F,t.getDaysOfMonth=v,t.getDaysOfWeek=function(){return 7},t.getDaysOfYear=P,t.getDiffDay=function(t,e){if(p(t)||p(e))return 0;const n=(e.getTime()-t.getTime())/864e5;return n>=0?Math.abs(n):n},t.getDiffMonth=function(t,e){if(p(t)||p(e))return 0;const n=(t.getTime()-e.getTime())/2592e6;return n>=0?Math.abs(n):n},t.getDiffWeek=function(t,e){if(p(t)||p(e))return 0;const n=(e.getTime()-t.getTime())/6048e5;return n>=0?Math.abs(n):n},t.getDiffYear=function(t,e){if(p(t)||p(e))return 0;const n=(e.getTime()-t.getTime())/31104e6;return n>=0?Math.abs(n):n},t.getDrawHex=function(){return"#"+(t=(16777216*Math.random()|0).toString(16),new Array(7-t.length).join("0")+t);var t},t.getDrawRgb=function(){return`rgb(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())})`},t.getDrawRgba=function(){return`rgba(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Number(Math.random()).toFixed(2)})`},t.getFileName=function(t){if(!d(t))return t.substring(0,t.lastIndexOf("."))},t.getFileSuffix=function(t){if(!d(t))return t.substring(t.lastIndexOf(".")+1).toLowerCase()},t.getFirstDateOfMonth=function(t=new Date){return t.setDate(1),_(t)},t.getFirstDateOfWeek=function(t=new Date){const e=Number($(t));return t.setDate(t.getDate()-e+1),_(t)},t.getFirstDateOfYear=function(t=new Date){return _(new Date(t.getFullYear(),0,1))},t.getFullDateOfMonth=function(t=new Date){const e=[],n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()+1,0);for(let t=0;t<r.getDate();t++){const r=new Date(n);r.setDate(n.getDate()+t),e.push(_(r))}return e},t.getFullDateOfWeek=function(t=new Date){const e=[],n=t.getDay(),r=new Date;r.setDate(t.getDate()-(0===n?6:n-1));for(let t=0;t<7;t++){const n=new Date(r);n.setDate(n.getDate()+t),e.push(_(n))}return e},t.getFullDateOfYear=function(t=new Date){const e=[],n=new Date(t.getFullYear(),0,1),r=P();for(let t=0;t<r;t++){const r=new Date(n);r.setDate(n.getDate()+t),e.push(_(r))}return e},t.getGUID=function(){const t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},t.getHost=function(t=window.location.href){const e=t.match(r.URL);if(e)return(e[2]||"")+(e[3]?":"+e[3]:"")},t.getHostName=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[2]},t.getInfoByIDCard=function(t){if(!p(t))return{province:Be(t),birthday:Pe(t),age:Le(t),sex:ke(t)}},t.getKeyCode=function(t){for(const e in i)if(i[e]===t)return e},t.getKeyName=function(t){return i[t]},t.getLastDateOfMonth=function(t=new Date){return _(new Date(t.getFullYear(),t.getMonth()+1,0))},t.getLastDateOfWeek=function(t=new Date){const e=Number($(t));return t.setDate(t.getDate()+(7-e)),_(t)},t.getLastDateOfYear=function(t=new Date){return _(new Date(t.getFullYear(),11,31))},t.getLimit=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7}){return[t.pageSize*(t.page-1),t.pageSize*t.page]},t.getLocalStorage=function(t){return window.localStorage.getItem(t)||void 0},t.getNextPage=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7},e){return new Promise((n=>{const r=t.totalPage>0?t.totalPage:je(t);t.page>0?t.page<r?t.page++:t.page=r:t.page=1,e&&e(t.page),n(t.page)}))},t.getNow=function(){return new Date},t.getOverTime=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"--";const r=new Date,i=t.getTime()-r.getTime();let a=0,s=0,u=0,c=0;return i>=0&&(a=Math.floor(i/1e3/3600/24),s=Math.floor(i/1e3/60/60%24),u=Math.floor(i/1e3/60%60),c=Math.floor(i/1e3%60)),`${a}${o.OVER_TIME[n].DAY} ${s}${o.OVER_TIME[n].HOUR} ${u}${o.OVER_TIME[n].MINUTE} ${c}${o.OVER_TIME[n].SECOND}`},t.getPastTime=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"--";const r=t.getTime(),i=Date.now()-r,a=b(i/31104e6),s=b(i/2592e6),u=b(i/864e5),c=b(i/36e5),f=b(i/6e4);return a?a+o.PASS_TIME[n].YEAR:s?s+o.PASS_TIME[n].MONTH:u?1===u?o.PASS_TIME[n].YESTERDAY:2===u?o.PASS_TIME[n].BEFORE_YESTERDAY:u+o.PASS_TIME[n].DAY:c?c>12?o.PASS_TIME[n].TODAY:c+o.PASS_TIME[n].HOUR:f?f+o.PASS_TIME[n].MINUTE:o.PASS_TIME[n].JUST},t.getPort=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[3]},t.getPrevPage=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7},e){return new Promise((n=>{t.page>1?t.page--:t.page=1,e&&e(t.page),n(t.page)}))},t.getProtocol=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[1]},t.getProvinceByIDCard=Be,t.getQuarter=function(t=new Date,e={format:"Q",lang:"zh"}){const{format:n,lang:r="zh"}=e,i=Number(Math.floor((t.getMonth()+3)/3));return"Q"===n?o.QUARTER[r].MINI[i-1]:"QQ"===n?o.QUARTER[r].SHORT[i-1]:"QQQ"===n?o.QUARTER[r].FULL[i-1]:i},t.getRainbowPager=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7},e){return new Promise((n=>{const r=t.page||1,o=t.totalPage>0?t.totalPage:je(t),i=t.pagerCount||7,a=!(1&i),s=i>>1;let u=i>>1,c=i;a&&u++,o<i&&(c=o);const f=new Array(c);if(o>=i)if(r<=s)for(let t=0;t<f.length;t++)f[t]=t+1;else if(r>o-u)for(let t=0;t<f.length;t++)f[t]=t+o-i+1;else for(let t=0;t<f.length;t++)f[t]=t+r-s+(a?1:0);else for(let t=0;t<f.length;t++)f[t]=t+1;e&&e(f),n(f)}))},t.getRandom=function(t=0,e=9){return Math.floor(Math.random()*(e-t+1)+t)},t.getRandomDigit=function(t=1){return Math.floor((Math.random()+Math.floor(9*Math.random()+1))*Math.pow(10,t-1))},t.getSearchParam=function(t=window.location.href,e=""){e=e.replace(/[[\]]/g,"\\$&"),t=Ye(t)||"";const n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),r=t.substring(0).match(n);if(r)return decodeURIComponent(r[2])},t.getSearchString=Ye,t.getSessionStorage=function(t){return window.sessionStorage.getItem(t)||void 0},t.getSexByIDCard=ke,t.getStyle=function(t,e){if(t)return t.style.getPropertyValue(e)},t.getTimestamp=function(t=new Date){return t.getTime()},t.getTotalPage=je,t.getUUID=function(t=32,e=16){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),r=[];let o=0;if(e=e||n.length,t)for(o=0;o<t;o++)r[o]=n[0|Math.random()*e];else{let t;for(r[8]=r[13]=r[18]=r[23]="-",r[14]="4",o=0;o<36;o++)r[o]||(t=0|16*Math.random(),r[o]=n[19===o?3&t|8:t])}return r.join("")},t.getUnixTimestamp=function(t=new Date){return Math.round(t.getTime()/1e3)},t.getUrlHash=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[6]},t.getUrlPath=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[4]},t.getValueByPath=function(t,e="data"){const n=(e||"data").split(".");let r=t;for(const t in n){const e=n[t],{propName:o,propIndex:i=0,isArray:a}=T(n[t]);if(a){if(i<0||i>=r[o].length)return;r=r[o][i]}else{if(!r||!r.hasOwnProperty(e)||"object"!=typeof r)return;r=r[e]}}return r},t.getWeek=function(t=new Date,e={format:"E",lang:"zh"}){const{format:n,lang:r="zh"}=e;return"E"===n?o.WEEK[r].MINI[t.getDay()]:"EE"===n?o.WEEK[r].SHORT[t.getDay()]:"EEE"===n?o.WEEK[r].FULL[t.getDay()]:$(t)},t.getWeekOfMonth=function(t=new Date){return Math.ceil((t.getDate()+6-Number($(t)))/7)},t.getWeekOfYear=function(t=new Date){const e=new Date(t.getFullYear(),0,1),n=$(e),r=Math.round((t.getTime()-e.getTime())/864e5);return Math.ceil((r+Number(n))/7)},t.getWeeksOfMonth=function(t=new Date){const e=new Date(t.getFullYear(),0,1),n=Number($(e)),r=C(t)?366:365;return 1===n?Math.ceil(r/7):Math.ceil((r-7+n)/7)},t.getWeeksOfYear=function(t=new Date){const e=new Date(t.getFullYear(),0,1),n=Number($(e)),r=C(t)?366:365;return 1===n?Math.ceil(r/7):Math.ceil((r-7+n)/7)},t.getZodiac=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"";const r=t.getMonth()+1;return t.getDate()<[20,19,21,20,21,22,23,23,23,24,23,22][r-1]?o.ZODIAC[n][r-1]:o.ZODIAC[n][r]},t.hasClass=We,t.hasSearchParam=function(t=window.location.href,e){return void 0!==He(t)[e]},t.hexToHsl=function(t){const e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!n)throw new TypeError(`hexToHsl: invalid hex color: ${t}`);const r=parseInt(n[1],16)/255,o=parseInt(n[2],16)/255,i=parseInt(n[3],16)/255,a=Math.max(r,o,i),s=Math.min(r,o,i);let u=0,c=0;const f=(a+s)/2;if(a===s)u=c=0;else{const t=a-s;switch(c=f>.5?t/(2-a-s):t/(a+s),a){case r:u=(o-i)/t+(o<i?6:0);break;case o:u=(i-r)/t+2;break;case i:u=(r-o)/t+4}u/=6}return`hsl(${Math.round(360*u)},${Math.round(100*c)}%,${Math.round(100*f)}%)`},t.hexToRgb=function(t){const e={r:0,g:0,b:0},n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);if(!r)throw new TypeError(`hexToRgb: invalid hex color: ${t}`);return e.r=parseInt(r[1],16),e.g=parseInt(r[2],16),e.b=parseInt(r[3],16),`rgb(${e.r},${e.g},${e.b})`},t.hexToRgba=function(t,e=1){const n={r:0,g:0,b:0,o:0},r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);if(!o)throw new TypeError(`hexToRgba: invalid hex color: ${t}`);return n.r=parseInt(o[1],16),n.g=parseInt(o[2],16),n.b=parseInt(o[3],16),n.o=e,`rgba(${n.r},${n.g},${n.b},${n.o})`},t.htmlDecode=function(t){const e={"<":"<",">":">","&":"&","(":"(",")":")","/":"/"," ":" ",""":'"',"'":"'"};return t.replace(/(<|>|&|(|)|/| |"|')/gi,(function(t,n){return e[n]}))},t.htmlEncode=function(t){const e={"<":"<",">":">","&":"&","(":"(",")":")","/":"/"," ":" ",'"':""","'":"'"};return t.replace(/[<>&|()\/ '"]/g,(function(t){return e[t]}))},t.inArray=function(t,e){return!p(t)&&e.includes(t)},t.inString=function(t,e){return e.includes(t)},t.isAM=function(t=new Date){return t.getHours()<12},t.isAfter=R,t.isAfterTomorrow=function(t=new Date){return 2===b((t.getTime()-Date.now())/864e5)},t.isAndroid=function(){const t=window.navigator.userAgent;return/Android|BlackBerry/i.test(t)},t.isArray=c,t.isAsyncFunction=function(t){return"AsyncFunction"===Object.prototype.toString.call(t).slice(8,-1)},t.isBefore=O,t.isBeforeYesterday=function(t=new Date){const e=t.getTime();return 2===b((Date.now()-e)/864e5)},t.isBetween=function(t,e,n){const r=t.getTime(),o=e.getTime(),i=n.getTime();return r>o&&r<i},t.isBigInt=function(t){return"BigInt"===Object.prototype.toString.call(t).slice(8,-1)},t.isBlank=w,t.isBoolean=function(t){return"boolean"===Object.prototype.toString.call(t).slice(8,-1)},t.isChinese=function(t){return Z(t,r.CH)},t.isCommonYear=function(t=new Date){return!C(t)},t.isDate=l,t.isDecimal=function(t){return/^\d+\.\d+$/.test(t)},t.isEmail=function(t){return Z(t,r.EMAIL)},t.isEmpty=d,t.isEnglish=function(t){return Z(t,r.EN)},t.isError=function(t){return"Error"===Object.prototype.toString.call(t).slice(8,-1)},t.isExternal=function(t){return Z(t,r.EXTERNAL)},t.isFalse=h,t.isFirstDayOfMonth=function(t=new Date){return 1===x(t)},t.isFirstDayOfWeek=function(t=new Date){return 1===$(t)},t.isFirstDayOfYear=function(t=new Date){return 1===F(t)},t.isFunction=function(t){return"Function"===Object.prototype.toString.call(t).slice(8,-1)},t.isFunctionString=function(t){if(!t)return!1;try{return"function"==typeof new Function(`return ${t}`)()}catch(t){return!1}},t.isIdCard=function(t){return Z(t,r.ID_CARD)},t.isInteger=s,t.isIos=function(){const t=window.navigator.userAgent;return/iPhone|iPad|iPod|iOS/i.test(t)},t.isIpad=function(){const t=window.navigator.userAgent;return/iPod/i.test(t)},t.isIphone=function(){const t=window.navigator.userAgent;return/iPhone/i.test(t)},t.isJson=function(t){try{return JSON.parse(t),!0}catch(t){return!1}},t.isLastDayOfMonth=function(t=new Date){return x(t)===v(t)},t.isLastDayOfWeek=function(t=new Date){return 7===$(t)},t.isLastDayOfYear=function(t=new Date){return F(t)===P(t)},t.isLeapYear=C,t.isLinux=function(){const t=window.navigator.userAgent;return/linux/i.test(t)},t.isLowerCase=function(t){return Z(t,r.LOWER_CASE)},t.isMac=function(){const t=window.navigator.userAgent;return/mac/i.test(t)},t.isMap=function(t){return"Map"===Object.prototype.toString.call(t).slice(8,-1)},t.isMobile=function(t){return Z(t,r.MOBILE)},t.isNaN=g,t.isNotBlank=function(t){return!w(t)},t.isNotEmpty=function(t){return!d(t)},t.isNotNaN=function(t){return!g(t)},t.isNotNull=function(t){return!p(t)},t.isNotUndefined=function(t){return!m(t)},t.isNull=p,t.isNumber=function(t){return"Number"===Object.prototype.toString.call(t).slice(8,-1)},t.isObject=f,t.isPM=function(t=new Date){return t.getHours()>=12},t.isPc=function(){return!Ke()},t.isPhone=Ke,t.isPromise=function(t){return"Promise"===Object.prototype.toString.call(t).slice(8,-1)},t.isQQ=function(){const t=window.navigator.userAgent;return/QQ/i.test(t)},t.isRegExp=function(t){return"RegExp"===Object.prototype.toString.call(t).slice(8,-1)},t.isSame=N,t.isSameMonth=function(t,e){return["getFullYear","getMonth"].every((n=>t[n]()===e[n]()))},t.isSameOrAfter=function(t,e){return N(t,e)||R(t,e)},t.isSameOrBefore=function(t,e){return N(t,e)||O(t,e)},t.isSameWeek=function(t,e){const n=t.getTime()/864e5,r=e.getTime()/864e5;return b((n+4)/7)===b((r+4)/7)},t.isSameYear=function(t,e){return["getFullYear"].every((n=>t[n]()===e[n]()))},t.isSet=function(t){return"Set"===Object.prototype.toString.call(t).slice(8,-1)},t.isString=u,t.isSupportCookie=function(){return window.navigator.cookieEnabled},t.isSupportStorage=function(){return!(!window.localStorage||!window.sessionStorage)},t.isSymbol=function(t){return"Symbol"===Object.prototype.toString.call(t).slice(8,-1)},t.isToday=function(t=new Date){const e=new Date;return["getFullYear","getMonth","getDate"].every((n=>e[n]()===t[n]()))},t.isTomorrow=function(t=new Date){return 1===b((t.getTime()-Date.now())/864e5)},t.isTrue=function(t){return!h(t)},t.isUndefined=m,t.isUpperCase=function(t){return Z(t,r.UPPER_CASE)},t.isUrl=function(t){return Z(t,r.URL)},t.isWeakMap=function(t){return"WeakMap"===Object.prototype.toString.call(t).slice(8,-1)},t.isWeakSet=function(t){return"WeakSet"===Object.prototype.toString.call(t).slice(8,-1)},t.isWeekend=function(t=new Date){const e=$(t);return 6===e||7===e},t.isWeixin=function(){const t=window.navigator.userAgent;return/MicroMessenger/i.test(t)},t.isWindows=function(){const t=window.navigator.userAgent;return/win/i.test(t)},t.isWindowsPhone=function(){const t=window.navigator.userAgent;return/Windows Phone/i.test(t)},t.isWorkday=function(t=new Date){const e=$(t);return 6!==e&&7!==e},t.isYesterday=function(t=new Date){const e=t.getTime();return 1===b((Date.now()-e)/864e5)},t.jsonToMap=function(t){return M(JSON.parse(t))},t.lastMonth=function(t=new Date){const e=B(t,-1);return e.getMonth()===t.getMonth()&&e.setDate(0),_(e)},t.lastWeek=function(t=new Date){return _(j(t,-7))},t.lastYear=function(t=new Date){const e=k(t,-1);return e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()||e.setDate(28),_(e)},t.mapToJson=function(t){return JSON.stringify(E(t))},t.mapToObject=E,t.md5=function(t){return Tt(t)},t.md5Hmac=function(t,e){if(!t||!e)throw new TypeError("md5Hmac: missing str or key");return Tt(t,e,!1)},t.md5HmacRaw=function(t,e){if(!t||!e)throw new TypeError("md5HmacRaw: missing str or key");return Tt(t,e,!0)},t.md5Raw=function(t){return Tt(t,void 0,!0)},t.merge=function(t,...e){return null==t||"object"!=typeof t?t:Object.assign(t,...e)},t.modulo=function(t,e){let n=0,r=0,o=0;try{n=t.toString().split(".")[1].length}catch(t){}try{r=e.toString().split(".")[1].length}catch(t){}return o=Math.pow(10,Math.max(n,r)),Math.round(Number(t)*o)%Math.round(Number(e)*o)/o},t.multiply=function(t,e){let n=0;const r=t.toString(),o=e.toString();try{n+=r.split(".")[1].length}catch(t){}try{n+=o.split(".")[1].length}catch(t){}return Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},t.nextMonth=function(t=new Date){const e=B(t,1);return e.getMonth()===t.getMonth()&&e.setDate(0),_(e)},t.nextWeek=function(t=new Date){return _(j(t,7))},t.nextYear=function(t=new Date){const e=k(t,1);return e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()||e.setDate(28),_(e)},t.objectEquals=function t(e,n){if(e===n)return!0;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(!e||!n||"object"!=typeof e&&"object"!=typeof n)return e===n;if(e.prototype!==n.prototype)return!1;const r=Object.keys(e);return r.length===Object.keys(n).length&&r.every((r=>t(e[r],n[r])))},t.objectToMap=M,t.padZeroEnd=function(t,e=2){if(t=String(t).trim(),e<0)throw new TypeError("padZeroEnd: maxLength should be greater than 0");if(p(t)||g(t))throw new TypeError("padZeroEnd: value must be a valid number or numeric string");let n=t.toString().length;for(;n<e;)t+="0",n++;return t},t.padZeroStart=function(t,e=2){if(t=String(t).trim(),e<0)throw new TypeError("padZeroStart: maxLength should be greater than 0");if(p(t)||g(t))throw new TypeError("padZeroStart: value must be a valid number or numeric string");let n=t.toString().length;for(;n<e;)t="0"+t,n++;return t},t.parseFloat=function(t){return p(t)?0:Number.parseFloat(String(t))},t.parseInt=b,t.parseJson=function(t){if(d(t))return null;try{return JSON.parse(t)}catch(t){return console.error(t),null}},t.parseSearchParam=He,t.prependSearchParam=function(t=window.location.href,e,n){const r=(Ye(t)||"").split("&")||[];if(Array.isArray(n)){const t=[];for(let r=0;r<n.length;r++)t.push(`${encodeURIComponent(e)}[${r}]=${encodeURIComponent(n[r])}`);r.unshift(...t)}else r.unshift(`${encodeURIComponent(e)}=${encodeURIComponent(n)}`);return t.replace(/(\?.+?)(?=#|$)/,"?"+r.join("&"))},t.prependToSearchParam=function(t=window.location.href,e,n,r){const o=(Ye(t)||"").split("&"),i=o.findIndex((t=>t.includes(e))),a=S(o,i,`${n}=${r}`);return t.replace(/(\?.+?)(?=#|$)/,"?"+a.join("&"))},t.regexpTest=Z,t.removeClass=Qe,t.removeCookie=function(t){d(t)||ze(t,"",-1)},t.removeLocalStorage=function(t){window.localStorage.removeItem(t)},t.removeSearchParam=function(t=window.location.href,e){const n=(Ye(t)||"").split("&"),r=n.findIndex((t=>t.includes(e)));return r>-1&&n.splice(r,1),t.replace(/(\?.+?)(?=#|$)/,"?"+n.join("&"))},t.removeSessionStorage=function(t){window.sessionStorage.removeItem(t)},t.removeStyle=function(t,e){t&&t.style.removeProperty(e)},t.replaceAll=function(t,e,n){return t.replace(new RegExp(e,"gm"),n)},t.replaceClass=function(t,e,n){Qe(t,n),Ze(t,e)},t.rgbToHex=function(t){const e=t.split(","),n=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),o=parseInt(e[2].split(")")[0]);return"#"+V(n)+V(r)+V(o)},t.rgbaToHex=function(t){const e=t.split(","),n=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),o=parseInt(e[2]),i=parseFloat(e[3].split(")")[0]);return`#${V(Math.round(256*i-1))}${V(n)}${V(r)}${V(o)}`},t.rgbaToHsl=function(t){const e=t.split(","),n=parseInt(e[0].split("(")[1])/255,r=parseInt(e[1])/255,o=parseInt(e[2])/255,i=parseFloat(e[3]&&e[3].split(")")[0]),a=Math.max(n,r,o),s=Math.min(n,r,o);let u=0,c=0;const f=(a+s)/2;if(a===s)u=c=0;else{const t=a-s;switch(c=f>.5?t/(2-a-s):t/(a+s),a){case n:u=(r-o)/t+(r<o?6:0);break;case r:u=(o-n)/t+2;break;case o:u=(n-r)/t+4}u/=6}return i?`hsla(${Math.round(360*u)},${Math.round(100*c)}%,${Math.round(100*f)}%,${i})`:`hsl(${Math.round(360*u)},${Math.round(100*c)}%,${Math.round(100*f)}%)`},t.scm=function(t,e){const n=Number(t),r=Number(e),o=Math.abs(n),i=Math.abs(r);return 0===o||0===i?0:o*i/W(o,i)},t.setClipboard=function(t){return new Promise(((e,n)=>{if(window.navigator.clipboard){let r=null;if("string"==typeof t){const e=new Blob([t],{type:"text/plain"});r=new window.ClipboardItem({"text/plain":e})}else r=new window.ClipboardItem({[t.type]:t});window.navigator.clipboard.write([r]).then((t=>{e(!0)}),(t=>{n(!1)}))}else console.warn("not support navigator clipboard!")}))},t.setClipboardText=Ve,t.setCookie=ze,t.setLocalStorage=function(t,e){window.localStorage.setItem(t,e)},t.setSearchParam=function(t=window.location.href,e="",n){const r=He(t);return r[e]=n,t.replace(/(\?.+?)(?=#|$)/,"?"+_e(r))},t.setSessionStorage=function(t,e){window.sessionStorage.setItem(t,e)},t.setValueByPath=function(t,e="data",n){const r=(e||"data").split(".");let o=t;for(let t=0;t<r.length-1;t++){const e=r[t],n=r[t+1],{propName:i,propIndex:a=0,isArray:s}=T(e);if(s){for(o&&o.hasOwnProperty(i)||(o[i]=[]);o[i].length<=a;)o[i].push({});o=o[i][a]}else o&&o.hasOwnProperty(e)&&"object"==typeof o[e]||(o[e]=g(n)?[]:{}),o=o[e]}const i=r[r.length-1],{propName:a,propIndex:s=0,isArray:u}=T(i);if(u){for(o.hasOwnProperty(a)&&Array.isArray(o[a])||(o[a]=[]);o[a].length<=s;)o[a].push({});o[a][s]=n}else o[i]=n;return t},t.sha224=function(t){return Yt(t)},t.sha224Hmac=function(t,e){if(!t||!e)throw new TypeError("sha224Hmac: missing str or key");return _t(e,t)},t.sha224HmacRaw=function(t,e){if(!t||!e)throw new TypeError("sha224HmacRaw: missing str or key");return zt(e,t)},t.sha224Raw=function(t){return Ht(t)},t.sha256=function(t){return Lt(t)},t.sha256Hmac=function(t,e){if(!t||!e)throw new TypeError("sha256Hmac: missing str or key");return Bt(e,t)},t.sha256HmacRaw=function(t,e){if(!t||!e)throw new TypeError("sha256HmacRaw: missing str or key");return jt(e,t)},t.sha256Raw=function(t){return kt(t)},t.sleep=function(t=1e3){return new Promise((e=>setTimeout(e,t)))},t.sm3Encrypt=function(t){return ne(t)},t.sm3EncryptHmac=function(t,e){if(!t||!e)throw new TypeError("sm3EncryptHmac: missing str or key");return ne(t,e)},t.sm4Decrypt=function(t,e,n){return xe(n,"decrypt"),function(t,e,n={}){const r={output:se,...n};return Re(t,e,he,r)}(t,e,n)},t.sm4Encrypt=function(t,e,n){return xe(n,"encrypt"),function(t,e,n={}){return Re(t,e,le,n)}(t,e,n)},t.stringifyJson=function(t,e=!1){try{return JSON.stringify(t,e?(t,e)=>"function"==typeof e||"symbol"==typeof e?String(e):e:void 0)}catch(t){return console.error("JSON序列化失败:",t),"{}"}},t.stringifySearchParam=_e,t.subtract=function(t,e){let n,r;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{r=e.toString().split(".")[1].length}catch(t){r=0}const o=Math.pow(10,Math.max(n,r)),i=n>=r?n:r;return Number(((Number(t)*o-Number(e)*o)/o).toFixed(i))},t.testLoaded=function(){console.log("loaded successfully!")},t.throttle=function(t,e=1e3){let n=null;return function(...r){n||(n=setTimeout((()=>{n=null,t.apply(this,r)}),e))}},t.toCamelCase=function(t){if(t.indexOf("_")>0)return t.replace(/\_(\w)/g,(function(t,e){return e.toUpperCase()}));if(t.indexOf("-")>0)return t.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()}));if(/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.charAt(0).toLowerCase()+t.slice(1);throw new TypeError("toCamelCase: value should be a string")},t.toDate=H,t.toDateString=_,t.toDateUTC=Y,t.toDateUTCString=function(t=new Date,e={format:"yyyy-MM-dd HH:mm:ss"}){return _(Y(t),e)},t.toDecimal=function(t,e=2,r=n.ROUND){if(r===n.ROUND)return Number(function(t,e=2){if(g(Number(t)))throw new TypeError(`_toDecimalRound: ${t} is not a number`);const n=Math.pow(10,e);return Math.round(Number(t)*n)/n}(t,e));if(r===n.ROUND_FLOOR)return Number(function(t,e=2){if(g(Number(t)))throw new TypeError(`_toDecimalFloor: ${t} is not a number`);const n=Math.pow(10,e);return Math.floor(Number(t)*n)/n}(t,e));throw new TypeError("toDecimal: mode is MATH.ROUND 0 or MATH.ROUND_FLOOR")},t.toFixed=function(t,e=2,r=n.ROUND){if(r===n.ROUND)return function(t,e=2){if(g(Number(t)))return"--";let n=String(t);e||(e=0);-1===n.indexOf(".")&&(n+=".");n+=new Array(e+1).join("0");const r=new RegExp(`^(-|\\+)?(\\d+(\\.\\d{0,${e+1}})?)\\d*$`);if(r.test(n)){let t="0"+RegExp.$2,n=!0;const r=RegExp.$3.length,o=RegExp.$1;if(r===e+2){const r=t.match(/\d/g);if(parseInt(r[r.length-1])>4)for(let t=r.length-2;t>=0&&(r[t]=(parseInt(r[t])+1).toString(),"10"===r[t]);t--)r[t]="0",n=1!==t;t=r.join("").replace(new RegExp(`(\\d+)(\\d{${e}})\\d$`),"$1.$2")}return n&&(t=t.substr(1)),(o+t).replace(/\.$/,"")}return String(t)}(t,e);if(r===n.ROUND_FLOOR)return function(t,e=2){const n=Number(t);if(g(n))throw new TypeError(`${t} is NaN`);if(e<0||e>20)throw new TypeError("_toFixedFloor: decimals places must be between 0 and 20");const r=Math.max(0,Math.floor(e)),o=String(n),i=o.indexOf("."),a=i>-1?o.length-i-1:0;if(-1===i||a<=r){let t=o;if(-1===i){t=`${t}.`;for(let e=0;e<r;e++)t=`${t}0`}else for(let e=0;e<r-a;e++)t=`${t}0`;return t}const[s,u]=o.split(".");return`${s}.${u.substring(0,r)}`}(t,e);throw new TypeError("toFixed: mode is MATH.ROUND 0 or MATH.ROUND_FLOOR")},t.toKebabCase=function(t){if(t.indexOf("_")>0)return t.replace(/_/g,"-").toLowerCase();if(/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.replace(/([A-Z])/g,"-$1").toLowerCase();if(/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0)){return(t.charAt(0).toLowerCase()+t.slice(1)).replace(/([A-Z])/g,"-$1").toLowerCase()}throw new TypeError("toKebabCase: value should be a string")},t.toLowerCase=function(t){return String(t).toLocaleLowerCase()},t.toPascalCase=y,t.toSnakeCase=function(t){if(/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.replace(/([A-Z])/g,"_$1").toLowerCase();if(t.indexOf("-")>0)return t.replace(/-/g,"_").toLowerCase();if(/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return(t=t.charAt(0).toLowerCase()+t.slice(1)).replace(/([A-Z])/g,"_$1").toLowerCase();throw new TypeError("toSnakeCase: value should be a string")},t.toUpperCase=function(t){return String(t).toLocaleUpperCase()},t.today=function(){return U()},t.tomorrow=function(){return _(j(new Date,1))},t.treeToArray=function t(e,n={childrenKey:"children"}){const r=n.childrenKey,o=[];for(const i of e)if(i[r]&&!i[r].length&&delete i[r],o.push(i),i[r]&&i[r].length){const e=t(i[r],n);e&&o.push(...e)}return o},t.trim=function(t){return t.replace(/(^\s*)|(\s*$)/g,"")},t.trimAll=function(t){return t.replace(/\s+/g,"")},t.trimEnd=function(t){return t.replace(/(\s*$)/g,"")},t.trimStart=function(t){return t.replace(/(^\s*)/g,"")},t.urlToBase64=function(t){return new Promise(((e,n)=>{const r=new Image;r.src=t,r.onload=function(){const t=document.createElement("canvas"),n=t.getContext("2d");t.width=r.width,t.height=r.height,n&&n.drawImage(r,0,0,r.width,r.height);const o=t.toDataURL("image/png");e(o)},r.onerror=function(t){console.error(t),n(t)}}))},t.urlToFile=function(t){return new Promise(((e,n)=>{try{window.fetch(t).then((t=>{200===t.status&&t.blob().then((t=>{Q(t).then((t=>{e(t)}))}))}))}catch(t){console.error(t),n(t)}}))},t.yesterday=function(){return _(j(new Date,-1))}}));
|
|
6
|
+
!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).iUtils={})}(this,(function(t){"use strict";const e={DESC:0,ASC:1,RANDOM:2},n={ROUND:0,ROUND_FLOOR:1},r={CH:/^[\u4E00-\u9FA5]+$/,EN:/^[a-zA-Z]+$/,LOWER_CASE:/^[a-z]+$/,UPPER_CASE:/^[A-Z]+$/,CH_NAME:/^[\u4e00-\u9fa5·]{2,16}$/,EN_NAME:/^[a-zA-Z\s]{1,20}$/,NUMBER:/^([-+])?\d+(\.\d+)?$/,INTEGER:/^(0|[1-9][0-9]*|-[1-9][0-9]*)$/,DECIMAL:/^([-+])?\d+\.\d+$/,INT_OR_FLOAT:/(^[1-9][0-9]*$)|(^[1-9][0-9]*\.[0-9]{1,2}$)|(^0\.[0-9]{1,2}$)|(^0$)/,MOBILE:/^(?:(?:\+|00)86)?1[1-9]\d{9}$/,PHONE:/^(?:(?:\d{3}-)?\d{8}|^(?:\d{4}-)?\d{7,8})(?:-\d+)?$/,EMAIL:/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/,ID_CARD:/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)|(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,ID_CARD15:/(^\d{8}(0\d|10|11|12)([0-2]\d|30|31)\d{3}$)/,ID_CARD18:/(^\d{6}(18|19|20)\d{2}(0[1-9]|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$)/,BANK_CARD:/^[1-9]\d{9,29}$/,POST_CODE:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,URL:/^(?:(ftp|https?|ftps):\/\/)?((?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2,6})?)?(?::(\d+))?(?:\/([^\?#]*))?(?:\?([^#]*))?(?:#(.*))?$/,IP:/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,IP6:/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|::([0-9a-fA-F]{1,4}:){0,6}[0-9a-fA-F]{1,4}|[0-9a-fA-F]{1,4}::([0-9a-fA-F]{1,4}:){0,5}[0-9a-fA-F]{1,4})$/i,EXTERNAL:/^(http:|https:|ftp:|ftps:|mailto:|tel:)/i},o={AM_PM:{zh:{AM:"上午",PM:"下午"},en:{AM:"AM",PM:"PM"}},WEEK:{zh:{FULL:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],SHORT:["周日","周一","周二","周三","周四","周五","周六"],MINI:["日","一","二","三","四","五","六"]},en:{FULL:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],SHORT:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],MINI:["Su","Mo","Tu","We","Th","Fr","Sa"]}},MONTH:{zh:{FULL:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],SHORT:["一","二","三","四","五","六","七","八","九","十","十一","十二"]},en:{FULL:["January","February","March","April","May","June","July","August","September","October","November","December"],SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}},QUARTER:{zh:{FULL:["第一季度","第二季度","第三季度","第四季度"],SHORT:["一季度","二季度","三季度","四季度"],MINI:["一","二","三","四"]},en:{FULL:["quarter 1st","quarter 2nd","quarter 3rd","quarter 4th"],SHORT:["Q1th","Q2nd","Q3rd","Q4th"],MINI:["Q1","Q2","Q3","Q4"]}},OVER_TIME:{zh:{YEAR:"年",MONTH:"月",DATE:"日",HOUR:"时",MINUTE:"分",SECOND:"秒",MILLISECOND:"毫秒",DAY:"天",QUARTER:"季度"},en:{YEAR:"year",MONTH:"month",DATE:"date",HOUR:"hour",MINUTE:"minute",SECOND:"second",MILLISECOND:"millisecond",DAY:"day",QUARTER:"quarter"}},PASS_TIME:{zh:{YEAR:"年前",MONTH:"个月前",DAY:"天前",BEFORE_YESTERDAY:"前天",YESTERDAY:"昨天",TODAY:"今天",HOUR:"小时前",MINUTE:"分钟前",JUST:"刚刚"},en:{YEAR:" year ago",MONTH:" month ago",DAY:" day ago",BEFORE_YESTERDAY:"before yesterday",YESTERDAY:" yesterday",TODAY:" today",HOUR:" hour ago",MINUTE:" minute ago",JUST:" just"}},HOLIDAY:{zh:["元旦","春节","清明节","劳动节","端午节","中秋节","国庆节"],en:["New Year‘s Day","Spring Festival","Tomb Sweeping Day","Labor Day","Dragon Boat Festival","Mid-Autumn Day","National Day"]},ZODIAC:{zh:["摩羯座","水瓶座","双鱼座","白羊座","金牛座","双子座","巨蟹座","狮子座","处女座","天秤座","天蝎座","射手座"],en:["Capricorn","Aquarius","Pisces","Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius"]},CHINESE_ZODIAC:{zh:["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"],en:["Rat","Ox","Tiger","Rabbit","Dragon","Snake","Horse","Goat","Monkey","Rooster","Dog","Pig"]},HEAVENLY_STEMS:{zh:["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"],en:["Jia","Yi","Bing","Ding","Wu","Ji","Geng","Xin","Ren","Gui"]},EARTHLY_BRANCHES:{zh:["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"],en:["Zi","Chou","Yin","Mao","Chen","Si","Wu","Wei","Shen","You","Xu","Hai"]}},i={8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"Caps Lock",27:"Escape",32:"Space",33:"Page Up",34:"Page Down",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",42:"Print Screen",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Windows",93:"Right Click",96:"Numpad 0",97:"Numpad 1",98:"Numpad 2",99:"Numpad 3",100:"Numpad 4",101:"Numpad 5",102:"Numpad 6",103:"Numpad 7",104:"Numpad 8",105:"Numpad 9",106:"Numpad *",107:"Numpad +",109:"Numpad -",110:"Numpad .",111:"Numpad /",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Num Lock",145:"Scroll Lock",182:"My Computer",183:"My Calculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={PROVINCE:{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:"台湾",81:"香港",82:"澳门",91:"国外"},SEX:{MAN:"男",WOMAN:"女"}};function s(t){return Number.isInteger(t)}function u(t){return"String"===Object.prototype.toString.call(t).slice(8,-1)}function c(t){return"Array"===Object.prototype.toString.call(t).slice(8,-1)}function f(t){return"Object"===Object.prototype.toString.call(t).slice(8,-1)}function l(t){return"Date"===Object.prototype.toString.call(t).slice(8,-1)}function h(t){return null==t||"undefined"===t||"null"===t||0===t||!1===t||g(t)}function g(t){return null==t||"boolean"==typeof t||Array.isArray(t)||""===t||Number.isNaN(Number(t))}function p(t){return null==t||""===t}function d(t){return!!p(t)||("string"==typeof t||Array.isArray(t)?0===t.length:"object"==typeof t&&(t instanceof Map||t instanceof Set?0===t.size:!(t instanceof Date||t instanceof RegExp||t instanceof Error)&&0===Object.keys(t).length))}function w(t){return d(t)||/^\s*$/.test(t)}function m(t){return void 0===t}function y(t){if(t.indexOf("_")>0){const e=t.replace(/\_(\w)/g,(function(t,e){return e.toUpperCase()}));return e.charAt(0).toUpperCase()+e.slice(1)}if(t.indexOf("-")>0){const e=t.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()}));return e.charAt(0).toUpperCase()+e.slice(1)}if(/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.charAt(0).toUpperCase()+t.slice(1);throw new TypeError("toPascalCase: value should be a string")}function b(t,e=10){return p(t)?0:Number.parseInt(String(t),e)}function A(t){return t.reduce((function(t,e){return t+e}))}function S(t=[],e=0,n=void 0){if(e<0)return t;if(0===t.length)t.push(n);else{if(e>t.length-1)return t;t.splice(e,0,n)}return t}function D(t=[],e=0,n=void 0){if(e<0)return t;if(0===t.length)t.push(n);else{if(e>t.length-1)return t;t.splice(e,0,t.splice(e,1,n)[0])}return t}function E(t){const e=Object.create(null);for(const[n,r]of t)e[n]=r;return e}function M(t){const e=new Map;for(const n of Object.keys(t))e.set(n,t[n]);return e}function T(t){const e=t.match(/^(\w+)\[(\d+)]$/);return{propName:e&&e[1]||void 0,propIndex:e?parseInt(e[2],10):void 0,isArray:!!e}}function C(t=new Date){const e=t.getFullYear();return e%100!=0&&e%4==0||e%400==0}function O(t,e=new Date){return t.getTime()-e.getTime()<0}function R(t,e=new Date){return t.getTime()-e.getTime()>0}function N(t,e){return["getFullYear","getMonth","getDate"].every((n=>t[n]()===e[n]()))}function U(t=new Date,e={format:"yyyy-MM-dd"}){const{format:n}=e;return _(t,{format:n})}function I(t=new Date){return{year:t.getFullYear(),month:t.getMonth()+1,date:t.getDate(),hours:t.getHours(),minutes:t.getMinutes(),seconds:t.getSeconds(),milliseconds:t.getMilliseconds()}}function $(t=new Date){return[7,1,2,3,4,5,6][t.getDay()]}function x(t=new Date){return t.getDate()}function F(t=new Date){return Math.ceil((t.getTime()-new Date(t.getFullYear().toString()).getTime())/864e5)+1}function v(t=new Date){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()}function P(t=new Date){return C(t)?366:365}function L(t){let e=0;const n=_(t).split("-"),r=Number(n[0]),o=Number(n[1]),i=Number(n[2]),a=new Date,s=a.getFullYear(),u=a.getMonth()+1,c=a.getDate(),f=s-r;if(f>0){const t=u-o;e=0===t?c-i<0?f-1:f:t<0?f-1:f}return e}function k(t=new Date,e=1){return t.setFullYear(t.getFullYear()+e),t}function B(t=new Date,e=1){return t.setMonth(t.getMonth()+e),t}function j(t=new Date,e=1){return t.setDate(t.getDate()+e),t}function Y(t=new Date){return new Date(t.getTime()+60*t.getTimezoneOffset()*1e3)}function H(t){if(p(t))throw new TypeError("toDate: value cannot be null or undefined");if(u(t))return new Date(String(t).replace(/-/g,"/"));if(s(t)&&13===String(t).length)return new Date(t);if(s(t)&&10===String(t).length)return new Date(1e3*Number(t));throw new TypeError(`toDate: invalid input type: ${typeof t}, expected string or number`)}function _(t,e={format:"yyyy-MM-dd",lang:"zh"}){const{format:n="yyyy-MM-dd",lang:r="zh"}=e;if(p(t))throw new TypeError("toDateString: date cannot be null or undefined");if(!l(t))throw new TypeError(`toDateString: invalid input type: ${typeof t}, expected Date object`);const i={"(y+)":e=>{const n=t.getFullYear().toString();return 2===e.length?n.slice(-2):n},"(M+)":e=>{const n=t.getMonth()+1;return 1===e.length?n.toString():z(n)},"(d+)":e=>{const n=t.getDate();return 1===e.length?n.toString():z(n)},"(h+)":e=>{const n=t.getHours()%12||12;return 1===e.length?n.toString():z(n)},"(H+)":e=>{const n=t.getHours();return 1===e.length?n.toString():z(n)},"(m+)":e=>{const n=t.getMinutes();return 1===e.length?n.toString():z(n)},"(s+)":e=>{const n=t.getSeconds();return 1===e.length?n.toString():z(n)},"(S+)":e=>t.getMilliseconds().toString().padStart(e.length,"0").slice(0,e.length),"([aA]+)":e=>{const n=t.getHours()<12;return e.length>1?n?o.AM_PM[r].AM:o.AM_PM[r].PM:n?e.toLowerCase():e.toUpperCase()},"(E+)":e=>{const n=t.getDay();return 1===e.length?o.WEEK[r].MINI[n]:2===e.length?o.WEEK[r].SHORT[n]:o.WEEK[r].FULL[n]},"(Q+)":e=>{const n=Math.floor((t.getMonth()+3)/3)-1;return 1===e.length?o.QUARTER[r].MINI[n]:2===e.length?o.QUARTER[r].SHORT[n]:o.QUARTER[r].FULL[n]}};let a=n;return Object.entries(i).forEach((([t,e])=>{const n=new RegExp(t,"g");a=a.replace(n,((t,n)=>e(n)))})),a}function z(t){const e=Number(t);return e>9?String(e):"0"+e}function W(t,e){let n=Math.abs(Number(t)),r=Math.abs(Number(e));for(;0!==r;){const t=r;r=n%r,n=t}return n}function Z(t,e){return new RegExp(e).test(t)}function Q(t,e=String(Date.now())){return new Promise(((e,n)=>{try{const n=t.type,r=n.split("/")[1];e(new File([t],`${Date.now()}.${r}`,{type:n,lastModified:Date.now()}))}catch(t){console.error(t),n(t)}}))}function K(t){return new Promise(((e,n)=>{const r=new FileReader;r.onload=function(t){const n=t.target?.result;e(n)},r.onerror=function(t){n(t)},r.readAsText(t)}))}function V(t){if(t>255)throw"'"+t+"'' is greater than 255(0xff);";return("0"+Number(t).toString(16)).slice(-2)}const J="not a UTF-8 string",q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),X={};for(let t=0;t<64;++t)X[q[t]]=t;X["-"]=62,X._=63;const G="object"==typeof process&&process.versions&&process.versions.node,tt="object"==typeof window&&"function"==typeof window.btoa,et=G?global:"object"==typeof self?self:window,nt=function(t){return t.split("=")[0].replace(/[\r\n]/g,"").replace(/[^A-Za-z0-9+/=_-]/g,"")},rt=function(t){const e=t.length,n=new Array(4*e);let r=0;for(let o=0;o<e;o++){const e=t.charCodeAt(o);if(e<128)n[r++]=e;else if(e<2048)n[r++]=192|e>>6,n[r++]=128|63&e;else if(e<55296||e>=57344)n[r++]=224|e>>12,n[r++]=128|e>>6&63,n[r++]=128|63&e;else{const i=65536+((1023&e)<<10|1023&t.charCodeAt(++o));n[r++]=240|i>>18,n[r++]=128|i>>12&63,n[r++]=128|i>>6&63,n[r++]=128|63&i}}return n.slice(0,r)},ot=function(t){if(!t)return[];const e=(t=nt(t)).length,n=e>>2<<2,r=new Array(Math.floor(3*e/4));let o=0,i=0;for(;i<n;){const e=X[t.charAt(i++)]||0,n=X[t.charAt(i++)]||0,a=X[t.charAt(i++)]||0,s=X[t.charAt(i++)]||0;r[o++]=255&(e<<2|n>>>4),r[o++]=255&(n<<4|a>>>2),r[o++]=255&(a<<6|s)}const a=e-n;if(2===a){const e=X[t.charAt(i++)]||0,n=X[t.charAt(i++)]||0;r[o++]=255&(e<<2|n>>>4)}else if(3===a){const e=X[t.charAt(i++)]||0,n=X[t.charAt(i++)]||0,a=X[t.charAt(i++)]||0;r[o++]=255&(e<<2|n>>>4),r[o++]=255&(n<<4|a>>>2)}return r.slice(0,o)},it=function(t){const e=t.length,n=3*Math.floor(e/3),r=new Array(Math.ceil(4*e/3));let o=0;for(let e=0;e<n;){const n=t[e++],i=t[e++],a=t[e++];r[o++]=q[n>>>2],r[o++]=q[63&(n<<4|i>>>4)],r[o++]=q[63&(i<<2|a>>>6)],r[o++]=q[63&a]}const i=e-n;if(1===i){const e=t[n];r[o++]=q[e>>>2],r[o++]=q[e<<4&63],r[o++]="=",r[o++]="="}else if(2===i){const e=t[n],i=t[n+1];r[o++]=q[e>>>2],r[o++]=q[63&(e<<4|i>>>4)],r[o++]=q[i<<2&63],r[o++]="="}return r.join("")};let at,st,ut=et.btoa,ct=et.atob;G?(ut=function(t){if(!t)return"";const e=Array.from(t).map((t=>t.charCodeAt(0)));return it(e)},ct=function(t){if(!t)return"";const e=ot(t);return String.fromCharCode.apply(null,e)},at=function(t){if(!t)return"";const e=rt(t);return it(e)},st=function(t){if(!t)return"";const e=ot(t),n=[],r=e.length;let o=0;for(;o<r;){const t=e[o++];if(t<=127){n.push(String.fromCharCode(t));continue}let i,a;if(t>191&&t<=223)i=31&t,a=1;else if(t<=239)i=15&t,a=2;else{if(!(t<=247))throw new Error(J);i=7&t,a=3}for(let t=0;t<a;++t){const t=e[o++];if(o>r||t<128||t>191)throw new Error(J);i=(i<<6)+(63&t)}if(i>=55296&&i<=57343)throw new Error(J);if(i>1114111)throw new Error(J);i<=65535?n.push(String.fromCharCode(i)):(i-=65536,n.push(String.fromCharCode(55296+(i>>10)),String.fromCharCode(56320+(1023&i))))}return n.join("")}):tt?(at=function(t){if(!t)return"";const e=[],n=t.length;for(let r=0;r<n;r++){const n=t.charCodeAt(r);if(n<128)e.push(String.fromCharCode(n));else if(n<2048)e.push(String.fromCharCode(192|n>>6),String.fromCharCode(128|63&n));else if(n<55296||n>=57344)e.push(String.fromCharCode(224|n>>12),String.fromCharCode(128|n>>6&63),String.fromCharCode(128|63&n));else{const o=65536+((1023&n)<<10|1023&t.charCodeAt(++r));e.push(String.fromCharCode(240|o>>18),String.fromCharCode(128|o>>12&63),String.fromCharCode(128|o>>6&63),String.fromCharCode(128|63&o))}}return ut(e.join(""))},st=function(t){if(!t)return"";const e=ct(t.replace(/-/g,"+").replace(/_/g,"/"));if(!/[^\u0000-\u007F]/.test(e))return e;const n=[],r=e.length;let o=0;for(;o<r;){const t=e.charCodeAt(o++);if(t<=127){n.push(String.fromCharCode(t));continue}let i,a;if(t>191&&t<=223)i=31&t,a=1;else if(t<=239)i=15&t,a=2;else{if(!(t<=247))throw new Error(J);i=7&t,a=3}for(let t=0;t<a;++t){const t=e.charCodeAt(o++);if(o>r||t<128||t>191)throw new Error(J);i=(i<<6)+(63&t)}if(i>=55296&&i<=57343)throw new Error(J);if(i>1114111)throw new Error(J);i<=65535?n.push(String.fromCharCode(i)):(i-=65536,n.push(String.fromCharCode(55296+(i>>10)),String.fromCharCode(56320+(1023&i))))}return n.join("")}):(ut=function(t){if(!t)return"";const e=Array.from(t).map((t=>t.charCodeAt(0)));return it(e)},ct=function(t){if(!t)return"";const e=ot(t);return String.fromCharCode.apply(null,e)},at=function(t){if(!t)return"";const e=rt(t);return it(e)},st=function(t){if(!t)return"";const e=ot(t),n=[],r=e.length;let o=0;for(;o<r;){const t=e[o++];if(t<=127){n.push(String.fromCharCode(t));continue}let i,a;if(t>191&&t<=223)i=31&t,a=1;else if(t<=239)i=15&t,a=2;else{if(!(t<=247))throw new Error(J);i=7&t,a=3}for(let t=0;t<a;++t){const t=e[o++];if(o>r||t<128||t>191)throw new Error(J);i=(i<<6)+(63&t)}if(i>=55296&&i<=57343)throw new Error(J);if(i>1114111)throw new Error(J);i<=65535?n.push(String.fromCharCode(i)):(i-=65536,n.push(String.fromCharCode(55296+(i>>10)),String.fromCharCode(56320+(1023&i))))}return n.join("")});const ft=function(t,e=!1){if(null==t)return"";let n="";if("string"!=typeof t)t.constructor===et.ArrayBuffer&&(t=new Uint8Array(t)),n=(r=t)&&0!==r.length?it(r):"";else{if(""===t)return"";n=at(t)}var r;return e&&(n=n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")),n},lt=function(t){return null==t||""===t?"":(t=t.replace(/-/g,"+").replace(/_/g,"/"),t=nt(t),st(t))};function ht(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function gt(t,e,n,r,o,i){return ht((a=ht(ht(e,t),ht(r,i)))<<(s=o)|a>>>32-s,n);var a,s}function pt(t,e,n,r,o,i,a){return gt(e&n|~e&r,t,e,o,i,a)}function dt(t,e,n,r,o,i,a){return gt(e&r|n&~r,t,e,o,i,a)}function wt(t,e,n,r,o,i,a){return gt(e^n^r,t,e,o,i,a)}function mt(t,e,n,r,o,i,a){return gt(n^(e|~r),t,e,o,i,a)}function yt(t,e){var n,r,o,i,a;t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;var s=1732584193,u=-271733879,c=-1732584194,f=271733878;for(n=0;n<t.length;n+=16)r=s,o=u,i=c,a=f,s=pt(s,u,c,f,t[n],7,-680876936),f=pt(f,s,u,c,t[n+1],12,-389564586),c=pt(c,f,s,u,t[n+2],17,606105819),u=pt(u,c,f,s,t[n+3],22,-1044525330),s=pt(s,u,c,f,t[n+4],7,-176418897),f=pt(f,s,u,c,t[n+5],12,1200080426),c=pt(c,f,s,u,t[n+6],17,-1473231341),u=pt(u,c,f,s,t[n+7],22,-45705983),s=pt(s,u,c,f,t[n+8],7,1770035416),f=pt(f,s,u,c,t[n+9],12,-1958414417),c=pt(c,f,s,u,t[n+10],17,-42063),u=pt(u,c,f,s,t[n+11],22,-1990404162),s=pt(s,u,c,f,t[n+12],7,1804603682),f=pt(f,s,u,c,t[n+13],12,-40341101),c=pt(c,f,s,u,t[n+14],17,-1502002290),s=dt(s,u=pt(u,c,f,s,t[n+15],22,1236535329),c,f,t[n+1],5,-165796510),f=dt(f,s,u,c,t[n+6],9,-1069501632),c=dt(c,f,s,u,t[n+11],14,643717713),u=dt(u,c,f,s,t[n],20,-373897302),s=dt(s,u,c,f,t[n+5],5,-701558691),f=dt(f,s,u,c,t[n+10],9,38016083),c=dt(c,f,s,u,t[n+15],14,-660478335),u=dt(u,c,f,s,t[n+4],20,-405537848),s=dt(s,u,c,f,t[n+9],5,568446438),f=dt(f,s,u,c,t[n+14],9,-1019803690),c=dt(c,f,s,u,t[n+3],14,-187363961),u=dt(u,c,f,s,t[n+8],20,1163531501),s=dt(s,u,c,f,t[n+13],5,-1444681467),f=dt(f,s,u,c,t[n+2],9,-51403784),c=dt(c,f,s,u,t[n+7],14,1735328473),s=wt(s,u=dt(u,c,f,s,t[n+12],20,-1926607734),c,f,t[n+5],4,-378558),f=wt(f,s,u,c,t[n+8],11,-2022574463),c=wt(c,f,s,u,t[n+11],16,1839030562),u=wt(u,c,f,s,t[n+14],23,-35309556),s=wt(s,u,c,f,t[n+1],4,-1530992060),f=wt(f,s,u,c,t[n+4],11,1272893353),c=wt(c,f,s,u,t[n+7],16,-155497632),u=wt(u,c,f,s,t[n+10],23,-1094730640),s=wt(s,u,c,f,t[n+13],4,681279174),f=wt(f,s,u,c,t[n],11,-358537222),c=wt(c,f,s,u,t[n+3],16,-722521979),u=wt(u,c,f,s,t[n+6],23,76029189),s=wt(s,u,c,f,t[n+9],4,-640364487),f=wt(f,s,u,c,t[n+12],11,-421815835),c=wt(c,f,s,u,t[n+15],16,530742520),s=mt(s,u=wt(u,c,f,s,t[n+2],23,-995338651),c,f,t[n],6,-198630844),f=mt(f,s,u,c,t[n+7],10,1126891415),c=mt(c,f,s,u,t[n+14],15,-1416354905),u=mt(u,c,f,s,t[n+5],21,-57434055),s=mt(s,u,c,f,t[n+12],6,1700485571),f=mt(f,s,u,c,t[n+3],10,-1894986606),c=mt(c,f,s,u,t[n+10],15,-1051523),u=mt(u,c,f,s,t[n+1],21,-2054922799),s=mt(s,u,c,f,t[n+8],6,1873313359),f=mt(f,s,u,c,t[n+15],10,-30611744),c=mt(c,f,s,u,t[n+6],15,-1560198380),u=mt(u,c,f,s,t[n+13],21,1309151649),s=mt(s,u,c,f,t[n+4],6,-145523070),f=mt(f,s,u,c,t[n+11],10,-1120210379),c=mt(c,f,s,u,t[n+2],15,718787259),u=mt(u,c,f,s,t[n+9],21,-343485551),s=ht(s,r),u=ht(u,o),c=ht(c,i),f=ht(f,a);return[s,u,c,f]}function bt(t){var e,n="",r=32*t.length;for(e=0;e<r;e+=8)n+=String.fromCharCode(t[e>>5]>>>e%32&255);return n}function At(t){var e,n=[];for(n[(t.length>>2)-1]=void 0,e=0;e<n.length;e+=1)n[e]=0;var r=8*t.length;for(e=0;e<r;e+=8)n[e>>5]|=(255&t.charCodeAt(e/8))<<e%32;return n}function St(t){var e,n,r="0123456789abcdef",o="";for(n=0;n<t.length;n+=1)e=t.charCodeAt(n),o+=r.charAt(e>>>4&15)+r.charAt(15&e);return o}function Dt(t){return unescape(encodeURIComponent(t))}function Et(t){return function(t){return bt(yt(At(t),8*t.length))}(Dt(t))}function Mt(t,e){return function(t,e){var n,r,o=At(t),i=[],a=[];for(i[15]=a[15]=void 0,o.length>16&&(o=yt(o,8*t.length)),n=0;n<16;n+=1)i[n]=909522486^o[n],a[n]=1549556828^o[n];return r=yt(i.concat(At(e)),512+8*e.length),bt(yt(a.concat(r),640))}(Dt(t),Dt(e))}function Tt(t,e,n){return e?n?Mt(e,t):St(Mt(e,t)):n?Et(t):St(Et(t))}const Ct="input is invalid type",Ot="0123456789abcdef".split(""),Rt=[-2147483648,8388608,32768,128],Nt=[24,16,8,0],Ut=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class It{constructor(t=!1){this.blocks=new Array(17).fill(0),t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}update(t){if(this.finalized)return this;let e=!1;const n=typeof t;if("string"!==n){if("object"!==n)throw new Error(Ct);if(null===t)throw new Error(Ct);if(t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error(Ct);e=!0}let r,o,i=0,a=t.length;const s=this.blocks;for(;i<a;){if(this.hashed&&(this.hashed=!1,s.fill(0),s[0]=this.block),e)for(o=this.start;i<a&&o<64;++i)s[o>>>2]|=t[i]<<Nt[3&o++];else for(o=this.start;i<a&&o<64;++i)r=t.charCodeAt(i),r<128?s[o>>>2]|=r<<Nt[3&o++]:r<2048?(s[o>>>2]|=(192|r>>>6)<<Nt[3&o++],s[o>>>2]|=(128|63&r)<<Nt[3&o++]):r<55296||r>=57344?(s[o>>>2]|=(224|r>>>12)<<Nt[3&o++],s[o>>>2]|=(128|r>>>6&63)<<Nt[3&o++],s[o>>>2]|=(128|63&r)<<Nt[3&o++]):(r=65536+((1023&r)<<10|1023&t.charCodeAt(++i)),s[o>>>2]|=(240|r>>>18)<<Nt[3&o++],s[o>>>2]|=(128|r>>>12&63)<<Nt[3&o++],s[o>>>2]|=(128|r>>>6&63)<<Nt[3&o++],s[o>>>2]|=(128|63&r)<<Nt[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=s[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}hash(){let t=this.h0,e=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7;const u=this.blocks;let c,f,l,h,g,p,d,w,m,y,b;for(c=16;c<64;++c)g=u[c-15],f=(g>>>7|g<<25)^(g>>>18|g<<14)^g>>>3,g=u[c-2],l=(g>>>17|g<<15)^(g>>>19|g<<13)^g>>>10,u[c]=u[c-16]+f+u[c-7]+l|0;for(b=e&n,c=0;c<64;c+=4)this.first?(this.is224?(w=300032,g=u[0]-1413257819,s=g-150054599|0,r=g+24177077|0):(w=704751109,g=u[0]-210244248,s=g-1521486534|0,r=g+143694565|0),this.first=!1):(f=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),l=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),w=t&e,h=w^t&n^b,d=o&i^~o&a,g=s+l+d+Ut[c]+u[c],p=f+h,s=r+g|0,r=g+p|0),f=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),l=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),m=r&t,h=m^r&e^w,d=s&o^~s&i,g=a+l+d+Ut[c+1]+u[c+1],p=f+h,a=n+g|0,n=g+p|0,f=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),l=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),y=n&r,h=y^n&t^m,d=a&s^~a&o,g=i+l+d+Ut[c+2]+u[c+2],p=f+h,i=e+g|0,e=g+p|0,f=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),l=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=e&n,h=b^e&r^y,d=i&a^~i&s,g=o+l+d+Ut[c+3]+u[c+3],p=f+h,o=t+g|0,t=g+p|0;this.h0=this.h0+t|0,this.h1=this.h1+e|0,this.h2=this.h2+n|0,this.h3=this.h3+r|0,this.h4=this.h4+o|0,this.h5=this.h5+i|0,this.h6=this.h6+a|0,this.h7=this.h7+s|0}finalize(){if(this.finalized)return this;this.finalized=!0;const t=this.blocks;let e=this.lastByteIndex;return t[16]=this.block,t[e>>>2]|=Rt[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t.fill(0),t[0]=this.block),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash(),this}hex(){this.finalize();const t=this.h0,e=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7;let u="";return u+=Ot[t>>>28&15]+Ot[t>>>24&15]+Ot[t>>>20&15]+Ot[t>>>16&15]+Ot[t>>>12&15]+Ot[t>>>8&15]+Ot[t>>>4&15]+Ot[15&t],u+=Ot[e>>>28&15]+Ot[e>>>24&15]+Ot[e>>>20&15]+Ot[e>>>16&15]+Ot[e>>>12&15]+Ot[e>>>8&15]+Ot[e>>>4&15]+Ot[15&e],u+=Ot[n>>>28&15]+Ot[n>>>24&15]+Ot[n>>>20&15]+Ot[n>>>16&15]+Ot[n>>>12&15]+Ot[n>>>8&15]+Ot[n>>>4&15]+Ot[15&n],u+=Ot[r>>>28&15]+Ot[r>>>24&15]+Ot[r>>>20&15]+Ot[r>>>16&15]+Ot[r>>>12&15]+Ot[r>>>8&15]+Ot[r>>>4&15]+Ot[15&r],u+=Ot[o>>>28&15]+Ot[o>>>24&15]+Ot[o>>>20&15]+Ot[o>>>16&15]+Ot[o>>>12&15]+Ot[o>>>8&15]+Ot[o>>>4&15]+Ot[15&o],u+=Ot[i>>>28&15]+Ot[i>>>24&15]+Ot[i>>>20&15]+Ot[i>>>16&15]+Ot[i>>>12&15]+Ot[i>>>8&15]+Ot[i>>>4&15]+Ot[15&i],u+=Ot[a>>>28&15]+Ot[a>>>24&15]+Ot[a>>>20&15]+Ot[a>>>16&15]+Ot[a>>>12&15]+Ot[a>>>8&15]+Ot[a>>>4&15]+Ot[15&a],this.is224||(u+=Ot[s>>>28&15]+Ot[s>>>24&15]+Ot[s>>>20&15]+Ot[s>>>16&15]+Ot[s>>>12&15]+Ot[s>>>8&15]+Ot[s>>>4&15]+Ot[15&s]),u}digest(){this.finalize();const t=this.h0,e=this.h1,n=this.h2,r=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,u=[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r,o>>>24&255,o>>>16&255,o>>>8&255,255&o,i>>>24&255,i>>>16&255,i>>>8&255,255&i,a>>>24&255,a>>>16&255,a>>>8&255,255&a];return this.is224||u.push(s>>>24&255,s>>>16&255,s>>>8&255,255&s),u}raw(){this.finalize();const t=this.digest();let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}arrayBuffer(){this.finalize();const t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t}}class $t{constructor(t,e=!1){let n=[];const r=typeof t;if("string"===r){let e,r=0,o=t.length;for(let i=0;i<o;++i)e=t.charCodeAt(i),e<128?n[r++]=e:e<2048?(n[r++]=192|e>>>6,n[r++]=128|63&e):e<55296||e>=57344?(n[r++]=224|e>>>12,n[r++]=128|e>>>6&63,n[r++]=128|63&e):(e=65536+((1023&e)<<10|1023&t.charCodeAt(++i)),n[r++]=240|e>>>18,n[r++]=128|e>>>12&63,n[r++]=128|e>>>6&63,n[r++]=128|63&e)}else{if("object"!==r)throw new Error(Ct);if(null===t)throw new Error(Ct);if(t.constructor===ArrayBuffer)n=Array.from(new Uint8Array(t));else{if(!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error(Ct);n=Array.from(t)}}n.length>64&&(n=new It(e).update(n).digest());const o=[],i=[];for(let t=0;t<64;++t){const e=n[t]||0;o[t]=92^e,i[t]=54^e}this.sha256=new It(e),this.sha256.update(i),this.oKeyPad=o,this.is224=e,this.inner=!0}update(t){return this.sha256.update(t),this}finalize(){if(this.inner){const t=this.sha256.digest();this.sha256=new It(this.is224),this.sha256.update(this.oKeyPad).update(t),this.inner=!1}return this.sha256.finalize(),this}hex(){return this.finalize(),this.sha256.hex()}digest(){return this.finalize(),this.sha256.digest()}raw(){return this.finalize(),this.sha256.raw()}arrayBuffer(){return this.finalize(),this.sha256.arrayBuffer()}}const xt=(t=!1)=>{const e=e=>new It(t).update(e).hex();return e.raw=e=>new It(t).update(e).raw(),e.digest=e=>new It(t).update(e).digest(),e.arrayBuffer=e=>new It(t).update(e).arrayBuffer(),e.create=()=>new It(t),e.update=t=>e.create().update(t),e},Ft=(t=!1)=>{const e=e=>new It(t).update(e).raw();return e.hex=e=>new It(t).update(e).hex(),e.digest=e=>new It(t).update(e).digest(),e.arrayBuffer=e=>new It(t).update(e).arrayBuffer(),e.create=()=>new It(t),e.update=t=>e.create().update(t),e},vt=(t=!1)=>{const e=(e,n)=>new $t(e,t).update(n).hex();return e.raw=(e,n)=>new $t(e,t).update(n).raw(),e.digest=(e,n)=>new $t(e,t).update(n).digest(),e.arrayBuffer=(e,n)=>new $t(e,t).update(n).arrayBuffer(),e.create=e=>new $t(e,t),e.update=(t,n)=>e.create(t).update(n),e},Pt=(t=!1)=>{const e=(e,n)=>new $t(e,t).update(n).raw();return e.hex=(e,n)=>new $t(e,t).update(n).hex(),e.digest=(e,n)=>new $t(e,t).update(n).digest(),e.arrayBuffer=(e,n)=>new $t(e,t).update(n).arrayBuffer(),e.create=e=>new $t(e,t),e.update=(t,n)=>e.create(t).update(n),e},Lt=xt(),kt=Ft(),Bt=vt(),jt=Pt(),Yt=xt(!0),Ht=Ft(!0),_t=vt(!0),zt=Pt(!0);const Wt=64,Zt=new Uint8Array(Wt).fill(54),Qt=new Uint8Array(Wt).fill(92),Kt=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);function Vt(t,e){const n=31&e;return t<<n|t>>>32-n}function Jt(t,e){const n=[];for(let r=t.length-1;r>=0;r--)n[r]=255&(t[r]^e[r]);return n}function qt(t){return t^Vt(t,9)^Vt(t,17)}function Xt(t){return t.map((t=>1===(t=t.toString(16)).length?"0"+t:t)).join("")}function Gt(t){const e=[];let n=t.length;var r,o;n%2!=0&&(o=n+1,t=(r=t).length>=o?r:new Array(o-r.length+1).join("0")+r),n=t.length;for(let r=0;r<n;r+=2)e.push(parseInt(t.substr(r,2),16));return e}function te(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t.codePointAt(n);if(r<=127)e.push(r);else if(r<=2047)e.push(192|r>>>6),e.push(128|63&r);else if(r<=55295||r>=57344&&r<=65535)e.push(224|r>>>12),e.push(128|r>>>6&63),e.push(128|63&r);else{if(!(r>=65536&&r<=1114111))throw e.push(r),new TypeError("utf8ToArray: input is not supported in sm3");n++,e.push(240|r>>>18&28),e.push(128|r>>>12&63),e.push(128|r>>>6&63),e.push(128|63&r)}}return e}function ee(t){let e=8*t.length,n=e%512;n=n>=448?512-n%448-1:448-n-1;const r=new Array((n-7)/8).fill(0),o=new Array(8).fill(0);let i=e.toString(2);for(let t=7;t>=0;t--)if(i.length>8){const e=i.length-8;o[t]=parseInt(i.substr(e),2),i=i.substr(0,e)}else i.length>0&&(o[t]=parseInt(i,2),i="");const a=new Uint8Array([...t,128,...r,...o]),s=new DataView(a.buffer,0),u=a.length/64,c=new Uint32Array(Kt),f=new Uint32Array(68),l=new Uint32Array(64);for(let t=0;t<u;t++){f.fill(0),l.fill(0);const e=16*t;for(let t=0;t<16;t++)f[t]=s.getUint32(4*(e+t),!1);for(let t=16;t<68;t++)f[t]=(h=f[t-16]^f[t-9]^Vt(f[t-3],15))^Vt(h,15)^Vt(h,23)^Vt(f[t-13],7)^f[t-6];for(let t=0;t<64;t++)l[t]=f[t]^f[t+4];const n=2043430169,r=2055708042;let o,i,a,u,g,p=c[0],d=c[1],w=c[2],m=c[3],y=c[4],b=c[5],A=c[6],S=c[7];for(let t=0;t<64;t++){g=t<=15?n:r,o=Vt(Vt(p,12)+y+Vt(g,t)&4294967295,7),i=o^Vt(p,12);const e=t<=15?y^b^A:y&b|~y&A;a=(t<=15?p^d^w:p&d|p&w|d&w)+m+i+l[t]&4294967295,u=e+S+o+f[t]&4294967295,m=w,w=Vt(d,9),d=p,p=a,S=A,A=Vt(b,19),b=y,y=qt(u)}c[0]^=p,c[1]^=d,c[2]^=w,c[3]^=m,c[4]^=y,c[5]^=b,c[6]^=A,c[7]^=S}var h;const g=[];for(let t=0;t<c.length;t++)g.push((4278190080&c[t])>>>24,(16711680&c[t])>>>16,(65280&c[t])>>>8,255&c[t]);return g}function ne(t,e){const n="string"==typeof t?te(t):Array.prototype.slice.call(t);if(e){const t=function(t,e){let n=e.length>Wt?ee(e):[...e];for(;n.length<Wt;)n.push(0);const r=Jt(n,Zt),o=Jt(n,Qt),i=ee([...r,...t]);return ee([...o,...i])}(n,"string"==typeof e?/^[0-9a-fA-F]+$/.test(e)?Gt(e):te(e):Array.prototype.slice.call(e));return Xt(t)}return Xt(ee(n))}const re="ecb",oe="cbc",ie="pkcs#7",ae="hex",se="utf8",ue="array",ce="uint8array",fe="arraybuffer",le=1,he=0,ge=32,pe=16,de=16,we=16,me=new Uint8Array([214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72]),ye=new Uint32Array([462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257]),be=new Uint32Array([2746333894,1453994832,1736282519,2993693404]);function Ae(t){if((t=t.replace(/\s+/g,"")).length%2!=0)throw new TypeError("hexToUint8Array: hex string length must be even from sm4");const e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n/2]=255&parseInt(t.substr(n,2),16);return e}function Se(t,e){if(t instanceof ArrayBuffer)return new Uint8Array(t);if(t instanceof Uint8Array)return new Uint8Array(t);if(Array.isArray(t))return new Uint8Array(t);if("string"==typeof t)return e===le?(n=t,(new TextEncoder).encode(n)):Ae(t);var n;throw new TypeError(`normalizeInput: unsupported input type: ${typeof t} from sm4`)}function De(t,e,n){let r;if("string"==typeof t)r=Ae(t);else if(t instanceof ArrayBuffer)r=new Uint8Array(t);else if(t instanceof Uint8Array)r=t;else{if(!Array.isArray(t))throw new TypeError(`normalizeKeyIv: unsupported ${n} type: ${typeof t} from sm4`);r=new Uint8Array(t)}if(r.length!==e)throw new TypeError(`normalizeKeyIv: ${n} must be ${8*e} bits (${e} bytes) from sm4`);return r}function Ee(t,e){const n=31&e;return(t<<n|t>>>32-n)>>>0}function Me(t){return(me[t>>>24&255]<<24|me[t>>>16&255]<<16|me[t>>>8&255]<<8|me[255&t])>>>0}function Te(t){return(t^Ee(t,2)^Ee(t,10)^Ee(t,18)^Ee(t,24))>>>0}function Ce(t){return(t^Ee(t,13)^Ee(t,23))>>>0}function Oe(t,e,n){if(t.length!==pe)throw new TypeError(`sm4BlockCrypt: input block must be ${pe} bytes for block crypt from sm4`);const r=new Uint32Array(4);for(let e=0;e<4;e++){const n=4*e;r[e]=(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}for(let t=0;t<ge;t+=4){let e=(r[1]^r[2]^r[3]^n[t])>>>0;r[0]^=Te(Me(e)),e=(r[2]^r[3]^r[0]^n[t+1])>>>0,r[1]^=Te(Me(e)),e=(r[3]^r[0]^r[1]^n[t+2])>>>0,r[2]^=Te(Me(e)),e=(r[0]^r[1]^r[2]^n[t+3])>>>0,r[3]^=Te(Me(e))}for(let t=0;t<pe;t+=4){const n=3-t/4;e[t]=r[n]>>>24&255,e[t+1]=r[n]>>>16&255,e[t+2]=r[n]>>>8&255,e[t+3]=255&r[n]}}function Re(t,e,n,r={}){const{mode:o=re,iv:i=[],padding:a=ie,output:s=ae}=r;if(![re,oe].includes(o))throw new TypeError(`sm4Core: unsupported mode: ${o}, only 'ecb' and 'cbc' are supported from sm4`);const u=Se(t,n),c=De(e,de,"key");let f=new Uint8Array(we);o===oe&&(f=De(i,we,"IV"));let l=u;if(a===ie&&n===le&&(l=function(t){const e=pe-t.length%pe,n=new Uint8Array(t.length+e);n.set(t);for(let r=0;r<e;r++)n[t.length+r]=255&e;return n}(u),l.length%pe!=0))throw new TypeError("sm4Core: PKCS7 padding failed: data length is not multiple of block size from sm4");const h=new Uint32Array(ge);!function(t,e,n){const r=new Uint32Array(4);for(let e=0;e<4;e++){const n=4*e;r[e]=(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3])>>>0}r[0]^=be[0],r[1]^=be[1],r[2]^=be[2],r[3]^=be[3];for(let t=0;t<ge;t+=4){let n=(r[1]^r[2]^r[3]^ye[t])>>>0;e[t]=r[0]^=Ce(Me(n)),n=(r[2]^r[3]^r[0]^ye[t+1])>>>0,e[t+1]=r[1]^=Ce(Me(n)),n=(r[3]^r[0]^r[1]^ye[t+2])>>>0,e[t+2]=r[2]^=Ce(Me(n)),n=(r[0]^r[1]^r[2]^ye[t+3])>>>0,e[t+3]=r[3]^=Ce(Me(n))}if(n===he)for(let t=0;t<16;t++){const n=e[t];e[t]=e[31-t],e[31-t]=n}}(c,h,n);const g=new Uint8Array(l.length);let p=new Uint8Array(f),d=0;for(;d<l.length;){const t=l.subarray(d,d+pe),e=new Uint8Array(pe);if(o===oe){if(n===le){const n=new Uint8Array(pe);for(let e=0;e<pe;e++)n[e]=255&(t[e]^p[e]);Oe(n,e,h)}else{Oe(t,e,h);for(let t=0;t<pe;t++)e[t]=255&(e[t]^p[t])}p=n===le?e:t}else Oe(t,e,h);g.set(e,d),d+=pe}let w=g;if(a===ie&&n===he&&(w=function(t){const e=255&t[t.length-1];for(let n=1;n<=e;n++)if(t[t.length-n]!==e)throw new TypeError("pkcs7Unpad: invalid PKCS#7 padding from sm4");return t.subarray(0,t.length-e)}(g)),n===he&&s===se)return m=w,new TextDecoder("utf-8").decode(m);var m;switch(s){case ae:return function(t){return Array.from(t).map((t=>{const e=t.toString(16);return 1===e.length?"0"+e:e})).join("")}(w);case ue:return Array.from(w);case ce:return w;case fe:return w.buffer;default:throw new TypeError(`sm4Core: unsupported output format: ${s} from sm4`)}}const Ne={ECB:re,CBC:oe},Ue=ie;const Ie=function(t=ae){if(!window?.crypto?.getRandomValues&&!global?.crypto?.getRandomValues)throw new TypeError("generateKey: the current environment does not support secure random number generation. please upgrade your browser/Node.js from sm4");const e=window?.crypto||global?.crypto,n=new Uint8Array(16);switch(e.getRandomValues(n),t){case ce:return n;case ue:return Array.from(n).map((t=>Number(t)));case fe:return n.buffer;default:return Array.from(n).map((t=>t.toString(16).padStart(2,"0"))).join("")}},$e=function(t=ae){if(!window?.crypto?.getRandomValues)throw new TypeError("generateIv: your browser does not support secure random generation (crypto API) from sm4");const e=new Uint8Array(we);switch(window.crypto.getRandomValues(e),t){case ce:return e;case ue:return Array.from(e).map((t=>Number(t)));case fe:return e.buffer;default:return Array.from(e).map((t=>{const e=t.toString(16);return 1===e.length?`0${e}`:e})).join("")}};function xe(t={},e){const{mode:n=Ne.ECB,iv:r}=t,o=Object.values(Ne);if(!o.includes(n))throw new TypeError(`sm4${e}:unsupported encryption mode "${n}", supports only ${o.join("/")}`);if(n===Ne.CBC&&!r)throw new TypeError(`sm4${e}:the CBC mode must be inputted with an IV (initialization vector)`);if(n===Ne.ECB&&void 0!==r)throw new TypeError(`sm4${e}: the ECB mode does not require an IV to be passed in. Please do not pass the iv parameter`);if(r){let t;if(t="string"==typeof r?32===r.length?16:r.length:r instanceof ArrayBuffer?r.byteLength:r instanceof Uint8Array||Array.isArray(r)?r.length:0,16!==t)throw new TypeError(`sm4${e}:IV must be 16 bytes in length, and the current length is ${t}`)}if(t.padding&&t.padding!==String(Ue))throw new TypeError(`sm4${e}: only pkcs#7 padding mode is supported, currently being input ${String(t.padding)}`)}const Fe={MODE:Ne,PADDING:Ue,OUTPUT:{HEX:ae,UTF8:se,ARRAY:ue,UINT8ARRAY:ce,ARRAYBUFFER:fe}};function ve(t,e,n){if(e>(t=String(t)).length)return t;let r="";return n<0&&(n=0),n>t.length-e&&(n=t.length-e),r=String().padEnd(n,"*"),t.substring(0,e)+r+t.substring(e+n)}function Pe(t){if(!p(t))return 15===t.length?"19"+t.substring(6,8)+"-"+t.substring(8,10)+"-"+t.substring(10,12):18===t.length?t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14):void 0}function Le(t){if(p(t))return;const e=Pe(t);return e?L(H(String(e))):void 0}function ke(t){if(!p(t))return 15===t.length?Number(t.substring(14))%2==0?a.SEX.WOMAN:a.SEX.MAN:18===t.length?Number(t.substring(16,17))%2==0?a.SEX.WOMAN:a.SEX.MAN:void 0}function Be(t){if(p(t))return;const e=t.substring(0,2);return e?a.PROVINCE[e]:void 0}function je(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7}){return Math.ceil((t.total||0)/(t.pageSize||0))}function Ye(t=window.location.href){const e=t.match(r.URL);if(e)return e[5]}function He(t=window.location.href){const e=(Ye(t)||"").split("&"),n={};for(let t=0;t<e.length;t++){const r=e[t].split("=");n[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||"")}return n}function _e(t,e=""){if("object"!=typeof t)return t;const n=[];for(const e in t){const r=t[e];if(c(r))for(let t=0;t<r.length;++t)n.push(encodeURIComponent(e+"["+t+"]")+"="+encodeURIComponent(r[t]));else n.push(encodeURIComponent(e)+"="+encodeURIComponent(t[e]))}return e?e.replace(/(\?.+?)(?=#|$)/,"?"+n.join("&")):n.join("&")}function ze(t,e,n=864e5){"undefined"!=typeof document&&(document.cookie=t+"="+e+";expires="+new Date(Date.now()+n))}function We(t,e){return t.className.indexOf(e)>0}function Ze(t,e){We(t,e)||(t.className+=" "+e)}function Qe(t,e){We(t,e)&&(t.className=t.className.replace(new RegExp(e,"gm"),""))}function Ke(){const t=window&&window.navigator.userAgent;return/Android|webOS|iPhone|iPod|BlackBerry|Windows Phone|IEMobile/i.test(t)}function Ve(t){return new Promise(((e,n)=>{window&&window.navigator?window.navigator.clipboard.writeText(t).then((t=>{e(!0)}),(t=>{n(!1)})):console.warn("not support navigator clipboard!")}))}t.DATE=o,t.ID_CARD=a,t.KEYCODE=i,t.LANG={ZH:"zh",EN:"en"},t.MATH=n,t.REGEXP=r,t.SM4=Fe,t.SORT=e,t.add=function(t,e){let n,r;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{r=e.toString().split(".")[1].length}catch(t){r=0}const o=Math.pow(10,Math.max(n,r));return(Number(t)*o+Number(e)*o)/o},t.addClass=Ze,t.addDate=j,t.addHours=function(t=new Date,e=1){return t.setHours(t.getHours()+e),t},t.addMillisecond=function(t=new Date,e=100){return t.setMilliseconds(t.getMilliseconds()+e),t},t.addMinutes=function(t=new Date,e=1){return t.setMinutes(t.getMinutes()+e),t},t.addMonth=B,t.addQuarter=function(t=new Date,e=1){return t.setMonth(t.getMonth()+4*e),t},t.addSeconds=function(t=new Date,e=1){return t.setSeconds(t.getSeconds()+e),t},t.addStyle=function(t,e={}){if(t)for(const[n,r]of Object.entries(e))t.style.setProperty(n,r)},t.addWeek=function(t=new Date,e=1){return t.setDate(t.getDate()+7*e),t},t.addYear=k,t.appendSearchParam=function(t=window.location.href,e,n){const r=(Ye(t)||"").split("&");return r.push(`${e}=${n}`),t.replace(/(\?.+?)(?=#|$)/,"?"+r.join("&"))},t.appendToSearchParam=function(t=window.location.href,e,n,r){const o=(Ye(t)||"").split("&"),i=o.findIndex((t=>t.includes(e))),a=D(o,i,`${n}=${r}`);return t.replace(/(\?.+?)(?=#|$)/,"?"+a.join("&"))},t.arrayAvg=function(t){return A(t)/t.length},t.arrayBottom=function(t=[],e=0){return e<0||e>t.length-1||t.push(t.splice(e,1)[0]),t},t.arrayComplement=function(t,e){return[...[...new Set(t)].filter((t=>!e.includes(t))),...[...new Set(e)].filter((e=>!t.includes(e)))]},t.arrayCreate=function(t=0){return[...Array(t).keys()]},t.arrayDifference=function(t,e){return[...new Set(t)].filter((t=>!e.includes(t)))},t.arrayDown=function(t=[],e=0){return e<0||e>t.length-1||(e<t.length-1?t.splice(e+1,0,t.splice(e,1)[0]):t.unshift(t.splice(e,1)[0])),t},t.arrayEquals=function(t,e){return t===e||t.length===e.length&&t.every(((t,n)=>t===e[n]))},t.arrayInsert=function(t=[],e=0,n=void 0){if(e<0)return t;if(0===t.length)t.push(n);else{if(e>t.length-1)return t;t.splice(e,0,n)}return t},t.arrayInsertAfter=D,t.arrayInsertBefore=S,t.arrayIntersect=function(t,e){return[...new Set(t)].filter((t=>e.includes(t)))},t.arrayMax=function(t){return Math.max.apply(null,t)},t.arrayMin=function(t){return Math.min.apply(null,t)},t.arrayRemove=function(t=[],e=0){return e<0||e>t.length-1||t.splice(e,1),t},t.arrayRemoveAfter=function(t=[],e=0){return e<0||e>t.length-1||t.splice(e+1,1),t},t.arrayRemoveBefore=function(t=[],e=0){return e<=0||e>t.length-1||t.splice(e-1,1),t},t.arrayShuffle=function(t){for(let e=1;e<t.length;e++){const n=Math.floor(Math.random()*(e+1));[t[n],t[e]]=[t[e],t[n]]}return t},t.arraySort=function(t,n=e.ASC){return t.sort(((t,r)=>{switch(n){case e.ASC:return t-r;case e.DESC:return r-t;case e.RANDOM:return Math.random()-.5;default:return 0}}))},t.arraySortBy=function(t,e){return t.sort(((t,n)=>{for(const r of e){let e="",o="asc";if(f(r)?(e=r.prop,o=r.order||"asc"):(e=r,o="asc"),t[e]<n[e])return"asc"===o?-1:1;if(t[e]>n[e])return"asc"===o?1:-1}return 0}))},t.arraySum=A,t.arraySwap=function(t,e,n){return e<0||n<0||e>t.length-1||n>t.length-1||([t[n],t[e]]=[t[e],t[n]]),t},t.arrayToTree=function(t,e={key:"id",parentKey:"pid",childrenKey:"children"}){const n=e.key,r=e.parentKey,o=e.childrenKey;if(!t||0===t.length||!n||""===n)return[];const i=function(t,e,n){return t?(void 0!==n&&(t[e]=n),t[e]):null},a=[],s={};for(let e=0;e<t.length;e++)t[e][o]&&delete t[e][o],s[t[e][n]]=t[e];for(let e=0;e<t.length;e++){const u=s[t[e][r]];if(u&&t[e][n]!==t[e][r]){let n=i(u,o);n||(n=i(u,o,[])),n.push(t[e])}else a.push(t[e])}return a},t.arrayTop=function(t=[],e=0){return e<0||e>t.length-1||t.unshift(t.splice(e,1)[0]),t},t.arrayUnion=function(t,e){return[...new Set(t.concat(e))]},t.arrayUnique=function(t){return d(t)?[]:Array.from(new Set(t))},t.arrayUp=function(t=[],e=0){return e<0||e>t.length-1||(e>0?t.splice(e-1,0,t.splice(e,1)[0]):t.push(t.splice(e,1)[0])),t},t.base64Decode=function(t){return lt(t)},t.base64DecodeURI=function(t){return lt(t)},t.base64Encode=function(t,e=!1){return ft(t,e)},t.base64EncodeURI=function(t){return ft(t,!0)},t.base64FromHex=function(t,e=!1){return function(t,e=!1){if("string"!=typeof t||!/^[0-9a-fA-F]+$/.test(t))throw new TypeError("fromHex: input must be hex string");const n=t.length%2?`0${t}`:t,r=new Array(n.length/2);for(let t=0;t<r.length;t++)r[t]=parseInt(n.substr(2*t,2),16);let o=it(r);return e&&(o=o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")),o}(t,e)},t.base64FromUint8Array=function(t,e=!1){return function(t,e=!1){if(!(t instanceof Uint8Array))throw new TypeError("fromUint8Array: input must be Uint8Array");const n=Array.from(t);let r=it(n);return e&&(r=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")),r}(t,e)},t.base64ToBlob=function(t){return new Promise(((e,n)=>{try{const n=t.split(","),r=n[0]?n[0].match(/:(.+?);/):null,o=r?r[1]:"",i=window.atob(n[1]);let a=i.length;const s=new Uint8Array(a);for(;a--;)s[a]=i.charCodeAt(a);e(new Blob([s],{type:o}))}catch(t){console.error(t),n(t)}}))},t.base64ToFile=function(t,e=String(Date.now())){return new Promise(((n,r)=>{try{const r=t.split(","),o=r[0]?r[0].match(/:(.+?);/):null,i=o?o[1]:"",a=i.split("/")[1],s=window.atob(r[1]);let u=s.length;const c=new Uint8Array(u);for(;u--;)c[u]=s.charCodeAt(u);n(new File([c],`${e}.${a}`,{type:i}))}catch(t){console.error(t),r(t)}}))},t.base64ToHex=function(t,e=!1){return function(t,e=!1){if("string"!=typeof t)throw new TypeError("toHex: input must be string");e&&(t=t.replace(/-/g,"+").replace(/_/g,"/"));const n=ot(t);return Array.from(n).map((t=>t.toString(16).padStart(2,"0"))).join("")}(t,e)},t.base64ToUint8Array=function(t,e=!1){return function(t,e=!1){if("string"!=typeof t)throw new TypeError("toUint8Array: input must be string");e&&(t=t.replace(/-/g,"+").replace(/_/g,"/"));const n=ot(t);return new Uint8Array(n)}(t,e)},t.blobToBase64=function(t){return new Promise(((e,n)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=function(t){const n=t.target?.result;e(n)},r.onerror=function(t){console.error(t),n(t)}}))},t.blobToFile=Q,t.blobToText=K,t.clearClipboard=function(){return new Promise(((t,e)=>{Ve("").then((()=>t(!0))).catch(e)}))},t.clearCookie=function(t=document.domain){const e=document.cookie.match(/[^ =;]+(?==)/g)||[];if(e&&e.length>0)for(let n=e.length;n--;)document.cookie=e[n]+"=0;path=/;"+t?"domain="+t+";":"expires="+new Date(0).toUTCString()},t.clearLocalStorage=function(){window&&window.localStorage.clear()},t.clearSessionStorage=function(){window&&window.sessionStorage.clear()},t.clone=function(t){return null===t||"object"!=typeof t?t:Array.isArray(t)?[...t]:t.constructor===Object?Object.assign({},t):t instanceof Date?new Date(t.getTime()):t instanceof RegExp?new RegExp(t.source,t.flags):t},t.debounce=function(t,e=1e3,n=!0){let r=null;return function(...o){if(r&&clearTimeout(r),n){const n=!r;r=setTimeout((()=>{r=null}),e),n&&t.apply(this,o)}else r=setTimeout((()=>{t.apply(this,o)}),e)}},t.deepClone=function t(e){if(f(e)){const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}if(c(e)){const n=[];for(let r=0,o=e.length;r<o;r++)n[r]=t(e[r]);return n}if(l(e)){const t=new Date;return t.setTime(e.getTime()),t}return e},t.deepCompare=function(t,...e){let n=[],r=[];const o=(t,e)=>{if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(t===e)return!0;if("function"===typeof t&&"function"===typeof e)return t.toString()===e.toString();if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(t instanceof RegExp&&e instanceof RegExp)return t.source===e.source&&t.flags===e.flags;if(t instanceof String&&e instanceof String||t instanceof Number&&e instanceof Number)return t.toString()===e.toString();if(!(t instanceof Object&&e instanceof Object))return!1;if(t.isPrototypeOf(e)||e.isPrototypeOf(t))return!1;if(t.constructor!==e.constructor)return!1;if(t.prototype!==e.prototype)return!1;if(n.includes(t)||r.includes(e))return!1;const i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(const n of a){if(Object.prototype.hasOwnProperty.call(t,n)!==Object.prototype.hasOwnProperty.call(e,n))return!1;if(typeof t[n]!=typeof e[n])return!1}for(const a of i){const i=t[a],s=e[a];if("object"==typeof i||"function"==typeof i){if(n.push(t),r.push(e),!o(i,s))return!1;n.pop(),r.pop()}else if(i!==s)return!1}return!0};if(arguments.length<2)return console.warn("deepCompare 需要至少两个对比参数"),!0;for(const i of e)if(n=[],r=[],!o(t,i))return!1;return!0},t.divide=function(t,e){let n=0,r=0;try{n=t.toString().split(".")[1].length}catch(t){}try{r=e.toString().split(".")[1].length}catch(t){}return Number(t.toString().replace(".",""))/Number(e.toString().replace(".",""))*Math.pow(10,r-n)},t.downloadBlobFile=function(t,e){try{const n=window.URL.createObjectURL(t),r=window.document.createElement("a");r.download=e,r.href=n,r.click(),URL.revokeObjectURL(n)}catch(t){console.error(t)}},t.downloadFileUrl=function(t,e){try{const n=window.document.createElement("a");n.download=e,n.href=t,n.target="_blank",window.document.body.appendChild(n),n.click(),window.document.body.removeChild(n)}catch(t){console.error(t)}},t.equals=function(t,e){return Object.is(t,e)},t.equalsIgnoreCase=function(t,e){return Object.is(t.toLowerCase(),e.toLowerCase())},t.fileToBase64=function(t){return new Promise(((e,n)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=function(t){const n=t.target?.result;e(n)},r.onerror=function(t){console.error(t),n(t)}}))},t.fileToBlob=function(t){return new Promise(((e,n)=>{const r=new FileReader;r.readAsArrayBuffer(t),r.onload=n=>{const r=n.target?.result,o=new Blob([r],{type:t.type});e(o)},r.onerror=function(t){console.error(t),n(t)}}))},t.fileToUrl=function(t){return new Promise(((e,n)=>{try{e(URL.createObjectURL(t))}catch(t){console.error(t),n(t)}}))},t.formatFileSize=function(t){return d(t)?"0B":t<1024?t+"B":t<1048576?(t/1024).toFixed(2)+"KB":t<1073741824?(t/1048576).toFixed(2)+"MB":(t/1073741824).toFixed(2)+"GB"},t.formatRmbChinese=function(t){const e=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],n=["","拾","佰","仟"],r=["","万","亿","兆"],o=["角","分","毫","厘"],i=Number("999999999999999.9999");let a,s,u,c="";if(""===t)return"";if((t=parseFloat(String(t)))>=i)throw new TypeError("formatRmbChinese: calculated number overflow");if(0===t)return c=e[0]+"元整",c;if(-1===(t=t.toString()).indexOf(".")?(a=t,s=""):(u=t.split("."),a=u[0],s=u[1].substr(0,4)),parseInt(a,10)>0){let t=0;const o=a.length;for(let i=0;i<o;i++){const s=a.substr(i,1),u=o-i-1,f=u/4,l=u%4;"0"===s?t++:(t>0&&(c+=e[0]),t=0,c+=e[parseInt(s)]+n[l]),0===l&&t<4&&(c+=r[f])}c+="元"}if(""!==s){const t=s.length;for(let n=0;n<t;n++){const t=s.substr(n,1);"0"!==t&&(c+=e[Number(t)]+o[n])}}return""===c?c+=e[0]+"元整":""===s&&(c+="整"),c},t.formatStartOf=ve,t.formatStartOfBankCard=function(t,e=4,n=11){return ve(t,e,n)},t.formatStartOfIDCard=function(t,e=4,n=8){return ve(t,e,n)},t.formatStartOfMobile=function(t,e=3,n=4){return ve(t,e,n)},t.formatStartOfName=function(t){return 2===t.length?ve(t,1,1):t.length>2?ve(t,1,t.length-2):t},t.formatTemplate=function(t,e){return t?Array.from(t.matchAll(/\{\{(.+?)\}\}/g)).reduce(((t,n)=>t.replace(n[0],e[n[1]])),t):""},t.formatThousand=function(t){if(!parseFloat(String(t)))return String(t);const e=(t=String(t)).indexOf(".")>-1?/(\d)(?=(\d{3})+\.)/g:/(\d)(?=(?:\d{3})+$)/g;return t.replace(e,"$1,")},t.formatTitle=function(t){return t?t.split(/(?=[A-Z])|[\.\-\s_]/).map((t=>t.trim())).filter((t=>!!t)).map((t=>y(t.toLowerCase()))).join(" "):""},t.fromDateUTC=function(t=new Date){return new Date(t.getTime()-60*t.getTimezoneOffset()*1e3)},t.gcd=W,t.generateSM4Iv=$e,t.generateSM4Key=Ie,t.getAge=L,t.getAgeByIDCard=Le,t.getBetweenDates=function(t,e){if(p(t)||p(e))return[];const n=[];for(;e.getTime()-t.getTime()>=0;){const e=t.getFullYear(),r=z(t.getMonth()+1),o=z(t.getDate());n.push(e+"-"+r+"-"+o),t.setDate(t.getDate()+1)}return n},t.getBetweenMonths=function(t,e){if(p(t)||p(e))return[];const n=[],r=new Date,o=new Date;r.setFullYear(t.getFullYear(),t.getMonth()+1),o.setFullYear(e.getFullYear(),e.getMonth()+1);const i=r;let a="";for(;i<=o;){const t=i.getMonth();a=0===t?i.getFullYear()-1+"-12":i.getFullYear()+"-"+z(t),n.push(a),i.setMonth(t+1)}return n},t.getBetweenYears=function(t,e){if(p(t)||p(e))return[];const n=[];for(;e.getTime()-t.getTime()>=0;){const e=t.getFullYear();n.push(e),t.setFullYear(t.getFullYear()+1)}return n},t.getBirthdayByIDCard=Pe,t.getBrowserInfo=function(){const t=window&&window.navigator.userAgent.toLowerCase(),e=t.match(/rv:([\d.]+)\) like gecko/)||t.match(/msie ([\d\.]+)/),n=t.match(/edg\/([\d\.]+)/),r=t.match(/firefox\/([\d\.]+)/),o=t.match(/(?:opera|opr).([\d\.]+)/),i=t.match(/chrome\/([\d\.]+)/),a=t.match(/version\/([\d\.]+).*safari/);return e?{name:"ie",version:e[1]}:n?{name:"edge",version:n[1]}:r?{name:"firefox",version:r[1]}:o?{name:"opera",version:o[1]}:i?{name:"chrome",version:i[1]}:a?{name:"safari",version:a[1]}:void 0},t.getChineseZodiac=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"";const r=t.getFullYear();return r<1900?"未知":o.CHINESE_ZODIAC[n][(r-1900)%o.CHINESE_ZODIAC[n].length]},t.getClipboard=function(){return new Promise(((t,e)=>{window.navigator.clipboard?window.navigator.clipboard.read().then((e=>{const n=[];for(const t of e)for(const e of t.types)t.getType(e).then((async t=>{if(t.type.includes("text")){const e=await K(t);n.push({type:t.type,data:e})}else n.push({type:t.type,data:t})}));t(n)})):console.warn("not support navigator clipboard!")}))},t.getClipboardText=function(){return new Promise(((t,e)=>{window&&window.navigator?window.navigator.clipboard.readText().then((e=>{t(e)})).catch((t=>{e(t)})):console.warn("not support navigator clipboard!")}))},t.getCookie=function(t){if("undefined"==typeof document)return"";const e=document.cookie?document.cookie.replace(/\s/g,"").split(";"):[];for(const n in e){const r=e[n].split("=");if(r[0]===t)return decodeURIComponent(r[1])}return""},t.getDate=U,t.getDateArray=function(t=new Date){return Object.entries(I(t)).map((([t,e])=>e))},t.getDateObject=I,t.getDateTime=function(t=new Date,e={format:"yyyy-MM-dd HH:mm:ss"}){const{format:n}=e;return _(t,{format:n})},t.getDayOfMonth=x,t.getDayOfWeek=$,t.getDayOfYear=F,t.getDaysOfMonth=v,t.getDaysOfWeek=function(){return 7},t.getDaysOfYear=P,t.getDiffDay=function(t,e){if(p(t)||p(e))return 0;const n=(e.getTime()-t.getTime())/864e5;return n>=0?Math.abs(n):n},t.getDiffMonth=function(t,e){if(p(t)||p(e))return 0;const n=(t.getTime()-e.getTime())/2592e6;return n>=0?Math.abs(n):n},t.getDiffWeek=function(t,e){if(p(t)||p(e))return 0;const n=(e.getTime()-t.getTime())/6048e5;return n>=0?Math.abs(n):n},t.getDiffYear=function(t,e){if(p(t)||p(e))return 0;const n=(e.getTime()-t.getTime())/31104e6;return n>=0?Math.abs(n):n},t.getDrawHex=function(){return"#"+(t=(16777216*Math.random()|0).toString(16),new Array(7-t.length).join("0")+t);var t},t.getDrawRgb=function(){return`rgb(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())})`},t.getDrawRgba=function(){return`rgba(${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Math.floor(256*Math.random())},${Number(Math.random()).toFixed(2)})`},t.getFileName=function(t){if(!d(t))return t.substring(0,t.lastIndexOf("."))},t.getFileSuffix=function(t){if(!d(t))return t.substring(t.lastIndexOf(".")+1).toLowerCase()},t.getFirstDateOfMonth=function(t=new Date){return t.setDate(1),_(t)},t.getFirstDateOfWeek=function(t=new Date){const e=Number($(t));return t.setDate(t.getDate()-e+1),_(t)},t.getFirstDateOfYear=function(t=new Date){return _(new Date(t.getFullYear(),0,1))},t.getFullDateOfMonth=function(t=new Date){const e=[],n=new Date(t.getFullYear(),t.getMonth(),1),r=new Date(t.getFullYear(),t.getMonth()+1,0);for(let t=0;t<r.getDate();t++){const r=new Date(n);r.setDate(n.getDate()+t),e.push(_(r))}return e},t.getFullDateOfWeek=function(t=new Date){const e=[],n=t.getDay(),r=new Date;r.setDate(t.getDate()-(0===n?6:n-1));for(let t=0;t<7;t++){const n=new Date(r);n.setDate(n.getDate()+t),e.push(_(n))}return e},t.getFullDateOfYear=function(t=new Date){const e=[],n=new Date(t.getFullYear(),0,1),r=P();for(let t=0;t<r;t++){const r=new Date(n);r.setDate(n.getDate()+t),e.push(_(r))}return e},t.getGUID=function(){const t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},t.getHost=function(t=window.location.href){const e=t.match(r.URL);if(e)return(e[2]||"")+(e[3]?":"+e[3]:"")},t.getHostName=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[2]},t.getInfoByIDCard=function(t){if(!p(t))return{province:Be(t),birthday:Pe(t),age:Le(t),sex:ke(t)}},t.getKeyCode=function(t){for(const e in i)if(i[e]===t)return e},t.getKeyName=function(t){return i[t]},t.getLastDateOfMonth=function(t=new Date){return _(new Date(t.getFullYear(),t.getMonth()+1,0))},t.getLastDateOfWeek=function(t=new Date){const e=Number($(t));return t.setDate(t.getDate()+(7-e)),_(t)},t.getLastDateOfYear=function(t=new Date){return _(new Date(t.getFullYear(),11,31))},t.getLimit=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7}){return[t.pageSize*(t.page-1),t.pageSize*t.page]},t.getLocalStorage=function(t){return window&&window.localStorage.getItem(t)||void 0},t.getNextPage=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7},e){return new Promise((n=>{const r=t.totalPage>0?t.totalPage:je(t);t.page>0?t.page<r?t.page++:t.page=r:t.page=1,e&&e(t.page),n(t.page)}))},t.getNow=function(){return new Date},t.getOverTime=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"--";const r=new Date,i=t.getTime()-r.getTime();let a=0,s=0,u=0,c=0;return i>=0&&(a=Math.floor(i/1e3/3600/24),s=Math.floor(i/1e3/60/60%24),u=Math.floor(i/1e3/60%60),c=Math.floor(i/1e3%60)),`${a}${o.OVER_TIME[n].DAY} ${s}${o.OVER_TIME[n].HOUR} ${u}${o.OVER_TIME[n].MINUTE} ${c}${o.OVER_TIME[n].SECOND}`},t.getPastTime=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"--";const r=t.getTime(),i=Date.now()-r,a=b(i/31104e6),s=b(i/2592e6),u=b(i/864e5),c=b(i/36e5),f=b(i/6e4);return a?a+o.PASS_TIME[n].YEAR:s?s+o.PASS_TIME[n].MONTH:u?1===u?o.PASS_TIME[n].YESTERDAY:2===u?o.PASS_TIME[n].BEFORE_YESTERDAY:u+o.PASS_TIME[n].DAY:c?c>12?o.PASS_TIME[n].TODAY:c+o.PASS_TIME[n].HOUR:f?f+o.PASS_TIME[n].MINUTE:o.PASS_TIME[n].JUST},t.getPort=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[3]},t.getPrevPage=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7},e){return new Promise((n=>{t.page>1?t.page--:t.page=1,e&&e(t.page),n(t.page)}))},t.getProtocol=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[1]},t.getProvinceByIDCard=Be,t.getQuarter=function(t=new Date,e={format:"Q",lang:"zh"}){const{format:n,lang:r="zh"}=e,i=Number(Math.floor((t.getMonth()+3)/3));return"Q"===n?o.QUARTER[r].MINI[i-1]:"QQ"===n?o.QUARTER[r].SHORT[i-1]:"QQQ"===n?o.QUARTER[r].FULL[i-1]:i},t.getRainbowPager=function(t={page:1,pageSize:10,total:0,totalPage:0,pagerCount:7},e){return new Promise((n=>{const r=t.page||1,o=t.totalPage>0?t.totalPage:je(t),i=t.pagerCount||7,a=!(1&i),s=i>>1;let u=i>>1,c=i;a&&u++,o<i&&(c=o);const f=new Array(c);if(o>=i)if(r<=s)for(let t=0;t<f.length;t++)f[t]=t+1;else if(r>o-u)for(let t=0;t<f.length;t++)f[t]=t+o-i+1;else for(let t=0;t<f.length;t++)f[t]=t+r-s+(a?1:0);else for(let t=0;t<f.length;t++)f[t]=t+1;e&&e(f),n(f)}))},t.getRandom=function(t=0,e=9){return Math.floor(Math.random()*(e-t+1)+t)},t.getRandomDigit=function(t=1){return Math.floor((Math.random()+Math.floor(9*Math.random()+1))*Math.pow(10,t-1))},t.getSearchParam=function(t=window.location.href,e=""){e=e.replace(/[[\]]/g,"\\$&"),t=Ye(t)||"";const n=new RegExp("(^|&)"+e+"=([^&]*)(&|$)"),r=t.substring(0).match(n);if(r)return decodeURIComponent(r[2])},t.getSearchString=Ye,t.getSessionStorage=function(t){return window&&window.sessionStorage.getItem(t)||void 0},t.getSexByIDCard=ke,t.getStyle=function(t,e){if(t)return t.style.getPropertyValue(e)},t.getTimestamp=function(t=new Date){return t.getTime()},t.getTotalPage=je,t.getUUID=function(t=32,e=16){const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),r=[];let o=0;if(e=e||n.length,t)for(o=0;o<t;o++)r[o]=n[0|Math.random()*e];else{let t;for(r[8]=r[13]=r[18]=r[23]="-",r[14]="4",o=0;o<36;o++)r[o]||(t=0|16*Math.random(),r[o]=n[19===o?3&t|8:t])}return r.join("")},t.getUnixTimestamp=function(t=new Date){return Math.round(t.getTime()/1e3)},t.getUrlHash=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[6]},t.getUrlPath=function(t=window.location.href){const e=t.match(r.URL);if(e)return e[4]},t.getValueByPath=function(t,e="data"){const n=(e||"data").split(".");let r=t;for(const t in n){const e=n[t],{propName:o,propIndex:i=0,isArray:a}=T(n[t]);if(a){if(i<0||i>=r[o].length)return;r=r[o][i]}else{if(!r||!r.hasOwnProperty(e)||"object"!=typeof r)return;r=r[e]}}return r},t.getWeek=function(t=new Date,e={format:"E",lang:"zh"}){const{format:n,lang:r="zh"}=e;return"E"===n?o.WEEK[r].MINI[t.getDay()]:"EE"===n?o.WEEK[r].SHORT[t.getDay()]:"EEE"===n?o.WEEK[r].FULL[t.getDay()]:$(t)},t.getWeekOfMonth=function(t=new Date){return Math.ceil((t.getDate()+6-Number($(t)))/7)},t.getWeekOfYear=function(t=new Date){const e=new Date(t.getFullYear(),0,1),n=$(e),r=Math.round((t.getTime()-e.getTime())/864e5);return Math.ceil((r+Number(n))/7)},t.getWeeksOfMonth=function(t=new Date){const e=new Date(t.getFullYear(),0,1),n=Number($(e)),r=C(t)?366:365;return 1===n?Math.ceil(r/7):Math.ceil((r-7+n)/7)},t.getWeeksOfYear=function(t=new Date){const e=new Date(t.getFullYear(),0,1),n=Number($(e)),r=C(t)?366:365;return 1===n?Math.ceil(r/7):Math.ceil((r-7+n)/7)},t.getZodiac=function(t,e={lang:"zh"}){const{lang:n="zh"}=e;if(p(t))return"";const r=t.getMonth()+1;return t.getDate()<[20,19,21,20,21,22,23,23,23,24,23,22][r-1]?o.ZODIAC[n][r-1]:o.ZODIAC[n][r]},t.hasClass=We,t.hasSearchParam=function(t=window.location.href,e){return void 0!==He(t)[e]},t.hexToHsl=function(t){const e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!n)throw new TypeError(`hexToHsl: invalid hex color: ${t}`);const r=parseInt(n[1],16)/255,o=parseInt(n[2],16)/255,i=parseInt(n[3],16)/255,a=Math.max(r,o,i),s=Math.min(r,o,i);let u=0,c=0;const f=(a+s)/2;if(a===s)u=c=0;else{const t=a-s;switch(c=f>.5?t/(2-a-s):t/(a+s),a){case r:u=(o-i)/t+(o<i?6:0);break;case o:u=(i-r)/t+2;break;case i:u=(r-o)/t+4}u/=6}return`hsl(${Math.round(360*u)},${Math.round(100*c)}%,${Math.round(100*f)}%)`},t.hexToRgb=function(t){const e={r:0,g:0,b:0},n=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(n);if(!r)throw new TypeError(`hexToRgb: invalid hex color: ${t}`);return e.r=parseInt(r[1],16),e.g=parseInt(r[2],16),e.b=parseInt(r[3],16),`rgb(${e.r},${e.g},${e.b})`},t.hexToRgba=function(t,e=1){const n={r:0,g:0,b:0,o:0},r=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,n,r){return e+e+n+n+r+r})),o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r);if(!o)throw new TypeError(`hexToRgba: invalid hex color: ${t}`);return n.r=parseInt(o[1],16),n.g=parseInt(o[2],16),n.b=parseInt(o[3],16),n.o=e,`rgba(${n.r},${n.g},${n.b},${n.o})`},t.htmlDecode=function(t){const e={"<":"<",">":">","&":"&","(":"(",")":")","/":"/"," ":" ",""":'"',"'":"'"};return t.replace(/(<|>|&|(|)|/| |"|')/gi,(function(t,n){return e[n]}))},t.htmlEncode=function(t){const e={"<":"<",">":">","&":"&","(":"(",")":")","/":"/"," ":" ",'"':""","'":"'"};return t.replace(/[<>&|()\/ '"]/g,(function(t){return e[t]}))},t.inArray=function(t,e){return!p(t)&&e.includes(t)},t.inString=function(t,e){return e.includes(t)},t.isAM=function(t=new Date){return t.getHours()<12},t.isAfter=R,t.isAfterTomorrow=function(t=new Date){return 2===b((t.getTime()-Date.now())/864e5)},t.isAndroid=function(){const t=window&&window.navigator.userAgent;return/Android|BlackBerry/i.test(t)},t.isArray=c,t.isAsyncFunction=function(t){return"AsyncFunction"===Object.prototype.toString.call(t).slice(8,-1)},t.isBefore=O,t.isBeforeYesterday=function(t=new Date){const e=t.getTime();return 2===b((Date.now()-e)/864e5)},t.isBetween=function(t,e,n){const r=t.getTime(),o=e.getTime(),i=n.getTime();return r>o&&r<i},t.isBigInt=function(t){return"BigInt"===Object.prototype.toString.call(t).slice(8,-1)},t.isBlank=w,t.isBoolean=function(t){return"boolean"===Object.prototype.toString.call(t).slice(8,-1)},t.isChinese=function(t){return Z(t,r.CH)},t.isCommonYear=function(t=new Date){return!C(t)},t.isDate=l,t.isDecimal=function(t){return/^\d+\.\d+$/.test(t)},t.isEmail=function(t){return Z(t,r.EMAIL)},t.isEmpty=d,t.isEnglish=function(t){return Z(t,r.EN)},t.isError=function(t){return"Error"===Object.prototype.toString.call(t).slice(8,-1)},t.isExternal=function(t){return Z(t,r.EXTERNAL)},t.isFalse=h,t.isFirstDayOfMonth=function(t=new Date){return 1===x(t)},t.isFirstDayOfWeek=function(t=new Date){return 1===$(t)},t.isFirstDayOfYear=function(t=new Date){return 1===F(t)},t.isFunction=function(t){return"Function"===Object.prototype.toString.call(t).slice(8,-1)},t.isFunctionString=function(t){if(!t)return!1;try{return"function"==typeof new Function(`return ${t}`)()}catch(t){return!1}},t.isIdCard=function(t){return Z(t,r.ID_CARD)},t.isInteger=s,t.isIos=function(){const t=window&&window.navigator.userAgent;return/iPhone|iPad|iPod|iOS/i.test(t)},t.isIpad=function(){const t=window&&window.navigator.userAgent;return/iPod/i.test(t)},t.isIphone=function(){const t=window&&window.navigator.userAgent;return/iPhone/i.test(t)},t.isJson=function(t){try{return JSON.parse(t),!0}catch(t){return!1}},t.isLastDayOfMonth=function(t=new Date){return x(t)===v(t)},t.isLastDayOfWeek=function(t=new Date){return 7===$(t)},t.isLastDayOfYear=function(t=new Date){return F(t)===P(t)},t.isLeapYear=C,t.isLinux=function(){const t=window&&window.navigator.userAgent;return/linux/i.test(t)},t.isLowerCase=function(t){return Z(t,r.LOWER_CASE)},t.isMac=function(){const t=window&&window.navigator.userAgent;return/mac/i.test(t)},t.isMap=function(t){return"Map"===Object.prototype.toString.call(t).slice(8,-1)},t.isMobile=function(t){return Z(t,r.MOBILE)},t.isNaN=g,t.isNotBlank=function(t){return!w(t)},t.isNotEmpty=function(t){return!d(t)},t.isNotNaN=function(t){return!g(t)},t.isNotNull=function(t){return!p(t)},t.isNotUndefined=function(t){return!m(t)},t.isNull=p,t.isNumber=function(t){return"Number"===Object.prototype.toString.call(t).slice(8,-1)},t.isObject=f,t.isPM=function(t=new Date){return t.getHours()>=12},t.isPc=function(){return!Ke()},t.isPhone=Ke,t.isPromise=function(t){return"Promise"===Object.prototype.toString.call(t).slice(8,-1)},t.isQQ=function(){const t=window&&window.navigator.userAgent;return/QQ/i.test(t)},t.isRegExp=function(t){return"RegExp"===Object.prototype.toString.call(t).slice(8,-1)},t.isSame=N,t.isSameMonth=function(t,e){return["getFullYear","getMonth"].every((n=>t[n]()===e[n]()))},t.isSameOrAfter=function(t,e){return N(t,e)||R(t,e)},t.isSameOrBefore=function(t,e){return N(t,e)||O(t,e)},t.isSameWeek=function(t,e){const n=t.getTime()/864e5,r=e.getTime()/864e5;return b((n+4)/7)===b((r+4)/7)},t.isSameYear=function(t,e){return["getFullYear"].every((n=>t[n]()===e[n]()))},t.isSet=function(t){return"Set"===Object.prototype.toString.call(t).slice(8,-1)},t.isString=u,t.isSupportCookie=function(){return window.navigator.cookieEnabled},t.isSupportStorage=function(){return!(!window.localStorage||!window.sessionStorage)},t.isSymbol=function(t){return"Symbol"===Object.prototype.toString.call(t).slice(8,-1)},t.isToday=function(t=new Date){const e=new Date;return["getFullYear","getMonth","getDate"].every((n=>e[n]()===t[n]()))},t.isTomorrow=function(t=new Date){return 1===b((t.getTime()-Date.now())/864e5)},t.isTrue=function(t){return!h(t)},t.isUndefined=m,t.isUpperCase=function(t){return Z(t,r.UPPER_CASE)},t.isUrl=function(t){return Z(t,r.URL)},t.isWeakMap=function(t){return"WeakMap"===Object.prototype.toString.call(t).slice(8,-1)},t.isWeakSet=function(t){return"WeakSet"===Object.prototype.toString.call(t).slice(8,-1)},t.isWeekend=function(t=new Date){const e=$(t);return 6===e||7===e},t.isWeixin=function(){const t=window&&window.navigator.userAgent;return/MicroMessenger/i.test(t)},t.isWindows=function(){const t=window&&window.navigator.userAgent;return/win/i.test(t)},t.isWindowsPhone=function(){const t=window&&window.navigator.userAgent;return/Windows Phone/i.test(t)},t.isWorkday=function(t=new Date){const e=$(t);return 6!==e&&7!==e},t.isYesterday=function(t=new Date){const e=t.getTime();return 1===b((Date.now()-e)/864e5)},t.jsonToMap=function(t){return M(JSON.parse(t))},t.lastMonth=function(t=new Date){const e=B(t,-1);return e.getMonth()===t.getMonth()&&e.setDate(0),_(e)},t.lastWeek=function(t=new Date){return _(j(t,-7))},t.lastYear=function(t=new Date){const e=k(t,-1);return e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()||e.setDate(28),_(e)},t.mapToJson=function(t){return JSON.stringify(E(t))},t.mapToObject=E,t.md5=function(t){return Tt(t)},t.md5Hmac=function(t,e){if(!t||!e)throw new TypeError("md5Hmac: missing str or key");return Tt(t,e,!1)},t.md5HmacRaw=function(t,e){if(!t||!e)throw new TypeError("md5HmacRaw: missing str or key");return Tt(t,e,!0)},t.md5Raw=function(t){return Tt(t,void 0,!0)},t.merge=function(t,...e){return null==t||"object"!=typeof t?t:Object.assign(t,...e)},t.modulo=function(t,e){let n=0,r=0,o=0;try{n=t.toString().split(".")[1].length}catch(t){}try{r=e.toString().split(".")[1].length}catch(t){}return o=Math.pow(10,Math.max(n,r)),Math.round(Number(t)*o)%Math.round(Number(e)*o)/o},t.multiply=function(t,e){let n=0;const r=t.toString(),o=e.toString();try{n+=r.split(".")[1].length}catch(t){}try{n+=o.split(".")[1].length}catch(t){}return Number(r.replace(".",""))*Number(o.replace(".",""))/Math.pow(10,n)},t.nextMonth=function(t=new Date){const e=B(t,1);return e.getMonth()===t.getMonth()&&e.setDate(0),_(e)},t.nextWeek=function(t=new Date){return _(j(t,7))},t.nextYear=function(t=new Date){const e=k(t,1);return e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()||e.setDate(28),_(e)},t.objectEquals=function t(e,n){if(e===n)return!0;if(e instanceof Date&&n instanceof Date)return e.getTime()===n.getTime();if(!e||!n||"object"!=typeof e&&"object"!=typeof n)return e===n;if(e.prototype!==n.prototype)return!1;const r=Object.keys(e);return r.length===Object.keys(n).length&&r.every((r=>t(e[r],n[r])))},t.objectToMap=M,t.padZeroEnd=function(t,e=2){if(t=String(t).trim(),e<0)throw new TypeError("padZeroEnd: maxLength should be greater than 0");if(p(t)||g(t))throw new TypeError("padZeroEnd: value must be a valid number or numeric string");let n=t.toString().length;for(;n<e;)t+="0",n++;return t},t.padZeroStart=function(t,e=2){if(t=String(t).trim(),e<0)throw new TypeError("padZeroStart: maxLength should be greater than 0");if(p(t)||g(t))throw new TypeError("padZeroStart: value must be a valid number or numeric string");let n=t.toString().length;for(;n<e;)t="0"+t,n++;return t},t.parseFloat=function(t){return p(t)?0:Number.parseFloat(String(t))},t.parseInt=b,t.parseJson=function(t){if(d(t))return null;try{return JSON.parse(t)}catch(t){return console.error(t),null}},t.parseSearchParam=He,t.prependSearchParam=function(t=window.location.href,e,n){const r=(Ye(t)||"").split("&")||[];if(Array.isArray(n)){const t=[];for(let r=0;r<n.length;r++)t.push(`${encodeURIComponent(e)}[${r}]=${encodeURIComponent(n[r])}`);r.unshift(...t)}else r.unshift(`${encodeURIComponent(e)}=${encodeURIComponent(n)}`);return t.replace(/(\?.+?)(?=#|$)/,"?"+r.join("&"))},t.prependToSearchParam=function(t=window.location.href,e,n,r){const o=(Ye(t)||"").split("&"),i=o.findIndex((t=>t.includes(e))),a=S(o,i,`${n}=${r}`);return t.replace(/(\?.+?)(?=#|$)/,"?"+a.join("&"))},t.regexpTest=Z,t.removeClass=Qe,t.removeCookie=function(t){d(t)||ze(t,"",-1)},t.removeLocalStorage=function(t){window&&window.localStorage.removeItem(t)},t.removeSearchParam=function(t=window.location.href,e){const n=(Ye(t)||"").split("&"),r=n.findIndex((t=>t.includes(e)));return r>-1&&n.splice(r,1),t.replace(/(\?.+?)(?=#|$)/,"?"+n.join("&"))},t.removeSessionStorage=function(t){window&&window.sessionStorage.removeItem(t)},t.removeStyle=function(t,e){t&&t.style.removeProperty(e)},t.replaceAll=function(t,e,n){return t.replace(new RegExp(e,"gm"),n)},t.replaceClass=function(t,e,n){Qe(t,n),Ze(t,e)},t.rgbToHex=function(t){const e=t.split(","),n=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),o=parseInt(e[2].split(")")[0]);return"#"+V(n)+V(r)+V(o)},t.rgbaToHex=function(t){const e=t.split(","),n=parseInt(e[0].split("(")[1]),r=parseInt(e[1]),o=parseInt(e[2]),i=parseFloat(e[3].split(")")[0]);return`#${V(Math.round(256*i-1))}${V(n)}${V(r)}${V(o)}`},t.rgbaToHsl=function(t){const e=t.split(","),n=parseInt(e[0].split("(")[1])/255,r=parseInt(e[1])/255,o=parseInt(e[2])/255,i=parseFloat(e[3]&&e[3].split(")")[0]),a=Math.max(n,r,o),s=Math.min(n,r,o);let u=0,c=0;const f=(a+s)/2;if(a===s)u=c=0;else{const t=a-s;switch(c=f>.5?t/(2-a-s):t/(a+s),a){case n:u=(r-o)/t+(r<o?6:0);break;case r:u=(o-n)/t+2;break;case o:u=(n-r)/t+4}u/=6}return i?`hsla(${Math.round(360*u)},${Math.round(100*c)}%,${Math.round(100*f)}%,${i})`:`hsl(${Math.round(360*u)},${Math.round(100*c)}%,${Math.round(100*f)}%)`},t.scm=function(t,e){const n=Number(t),r=Number(e),o=Math.abs(n),i=Math.abs(r);return 0===o||0===i?0:o*i/W(o,i)},t.setClipboard=function(t){return new Promise(((e,n)=>{if(window&&window.navigator){let r=null;if("string"==typeof t){const e=new Blob([t],{type:"text/plain"});r=new window.ClipboardItem({"text/plain":e})}else r=new window.ClipboardItem({[t.type]:t});window.navigator.clipboard.write([r]).then((t=>{e(!0)}),(t=>{n(!1)}))}else console.warn("not support navigator clipboard!")}))},t.setClipboardText=Ve,t.setCookie=ze,t.setLocalStorage=function(t,e){window&&window.localStorage.setItem(t,e)},t.setSearchParam=function(t=window.location.href,e="",n){const r=He(t);return r[e]=n,t.replace(/(\?.+?)(?=#|$)/,"?"+_e(r))},t.setSessionStorage=function(t,e){window&&window.sessionStorage.setItem(t,e)},t.setValueByPath=function(t,e="data",n){const r=(e||"data").split(".");let o=t;for(let t=0;t<r.length-1;t++){const e=r[t],n=r[t+1],{propName:i,propIndex:a=0,isArray:s}=T(e);if(s){for(o&&o.hasOwnProperty(i)||(o[i]=[]);o[i].length<=a;)o[i].push({});o=o[i][a]}else o&&o.hasOwnProperty(e)&&"object"==typeof o[e]||(o[e]=g(n)?[]:{}),o=o[e]}const i=r[r.length-1],{propName:a,propIndex:s=0,isArray:u}=T(i);if(u){for(o.hasOwnProperty(a)&&Array.isArray(o[a])||(o[a]=[]);o[a].length<=s;)o[a].push({});o[a][s]=n}else o[i]=n;return t},t.sha224=function(t){return Yt(t)},t.sha224Hmac=function(t,e){if(!t||!e)throw new TypeError("sha224Hmac: missing str or key");return _t(e,t)},t.sha224HmacRaw=function(t,e){if(!t||!e)throw new TypeError("sha224HmacRaw: missing str or key");return zt(e,t)},t.sha224Raw=function(t){return Ht(t)},t.sha256=function(t){return Lt(t)},t.sha256Hmac=function(t,e){if(!t||!e)throw new TypeError("sha256Hmac: missing str or key");return Bt(e,t)},t.sha256HmacRaw=function(t,e){if(!t||!e)throw new TypeError("sha256HmacRaw: missing str or key");return jt(e,t)},t.sha256Raw=function(t){return kt(t)},t.sleep=function(t=1e3){return new Promise((e=>setTimeout(e,t)))},t.sm3Encrypt=function(t){return ne(t)},t.sm3EncryptHmac=function(t,e){if(!t||!e)throw new TypeError("sm3EncryptHmac: missing str or key");return ne(t,e)},t.sm4Decrypt=function(t,e,n){return xe(n,"decrypt"),function(t,e,n={}){const r={output:se,...n};return Re(t,e,he,r)}(t,e,n)},t.sm4Encrypt=function(t,e,n){return xe(n,"encrypt"),function(t,e,n={}){return Re(t,e,le,n)}(t,e,n)},t.stringifyJson=function(t,e=!1){try{return JSON.stringify(t,e?(t,e)=>"function"==typeof e||"symbol"==typeof e?String(e):e:void 0)}catch(t){return console.error("JSON序列化失败:",t),"{}"}},t.stringifySearchParam=_e,t.subtract=function(t,e){let n,r;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{r=e.toString().split(".")[1].length}catch(t){r=0}const o=Math.pow(10,Math.max(n,r)),i=n>=r?n:r;return Number(((Number(t)*o-Number(e)*o)/o).toFixed(i))},t.testLoaded=function(){console.log("loaded successfully!")},t.throttle=function(t,e=1e3){let n=null;return function(...r){n||(n=setTimeout((()=>{n=null,t.apply(this,r)}),e))}},t.toCamelCase=function(t){if(t.indexOf("_")>0)return t.replace(/\_(\w)/g,(function(t,e){return e.toUpperCase()}));if(t.indexOf("-")>0)return t.replace(/\-(\w)/g,(function(t,e){return e.toUpperCase()}));if(/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.charAt(0).toLowerCase()+t.slice(1);throw new TypeError("toCamelCase: value should be a string")},t.toDate=H,t.toDateString=_,t.toDateUTC=Y,t.toDateUTCString=function(t=new Date,e={format:"yyyy-MM-dd HH:mm:ss"}){return _(Y(t),e)},t.toDecimal=function(t,e=2,r=n.ROUND){if(r===n.ROUND)return Number(function(t,e=2){if(g(Number(t)))throw new TypeError(`_toDecimalRound: ${t} is not a number`);const n=Math.pow(10,e);return Math.round(Number(t)*n)/n}(t,e));if(r===n.ROUND_FLOOR)return Number(function(t,e=2){if(g(Number(t)))throw new TypeError(`_toDecimalFloor: ${t} is not a number`);const n=Math.pow(10,e);return Math.floor(Number(t)*n)/n}(t,e));throw new TypeError("toDecimal: mode is MATH.ROUND 0 or MATH.ROUND_FLOOR")},t.toFixed=function(t,e=2,r=n.ROUND){if(r===n.ROUND)return function(t,e=2){if(g(Number(t)))return"--";let n=String(t);e||(e=0);-1===n.indexOf(".")&&(n+=".");n+=new Array(e+1).join("0");const r=new RegExp(`^(-|\\+)?(\\d+(\\.\\d{0,${e+1}})?)\\d*$`);if(r.test(n)){let t="0"+RegExp.$2,n=!0;const r=RegExp.$3.length,o=RegExp.$1;if(r===e+2){const r=t.match(/\d/g);if(parseInt(r[r.length-1])>4)for(let t=r.length-2;t>=0&&(r[t]=(parseInt(r[t])+1).toString(),"10"===r[t]);t--)r[t]="0",n=1!==t;t=r.join("").replace(new RegExp(`(\\d+)(\\d{${e}})\\d$`),"$1.$2")}return n&&(t=t.substr(1)),(o+t).replace(/\.$/,"")}return String(t)}(t,e);if(r===n.ROUND_FLOOR)return function(t,e=2){const n=Number(t);if(g(n))throw new TypeError(`${t} is NaN`);if(e<0||e>20)throw new TypeError("_toFixedFloor: decimals places must be between 0 and 20");const r=Math.max(0,Math.floor(e)),o=String(n),i=o.indexOf("."),a=i>-1?o.length-i-1:0;if(-1===i||a<=r){let t=o;if(-1===i){t=`${t}.`;for(let e=0;e<r;e++)t=`${t}0`}else for(let e=0;e<r-a;e++)t=`${t}0`;return t}const[s,u]=o.split(".");return`${s}.${u.substring(0,r)}`}(t,e);throw new TypeError("toFixed: mode is MATH.ROUND 0 or MATH.ROUND_FLOOR")},t.toKebabCase=function(t){if(t.indexOf("_")>0)return t.replace(/_/g,"-").toLowerCase();if(/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.replace(/([A-Z])/g,"-$1").toLowerCase();if(/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0)){return(t.charAt(0).toLowerCase()+t.slice(1)).replace(/([A-Z])/g,"-$1").toLowerCase()}throw new TypeError("toKebabCase: value should be a string")},t.toLowerCase=function(t){return String(t).toLocaleLowerCase()},t.toPascalCase=y,t.toSnakeCase=function(t){if(/^[a-z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return t.replace(/([A-Z])/g,"_$1").toLowerCase();if(t.indexOf("-")>0)return t.replace(/-/g,"_").toLowerCase();if(/^[A-Z]$/.test(t.charAt(0))&&!(t.indexOf("-")>0||t.indexOf("_")>0))return(t=t.charAt(0).toLowerCase()+t.slice(1)).replace(/([A-Z])/g,"_$1").toLowerCase();throw new TypeError("toSnakeCase: value should be a string")},t.toUpperCase=function(t){return String(t).toLocaleUpperCase()},t.today=function(){return U()},t.tomorrow=function(){return _(j(new Date,1))},t.treeToArray=function t(e,n={childrenKey:"children"}){const r=n.childrenKey,o=[];for(const i of e)if(i[r]&&!i[r].length&&delete i[r],o.push(i),i[r]&&i[r].length){const e=t(i[r],n);e&&o.push(...e)}return o},t.trim=function(t){return t.replace(/(^\s*)|(\s*$)/g,"")},t.trimAll=function(t){return t.replace(/\s+/g,"")},t.trimEnd=function(t){return t.replace(/(\s*$)/g,"")},t.trimStart=function(t){return t.replace(/(^\s*)/g,"")},t.urlToBase64=function(t){return new Promise(((e,n)=>{const r=new Image;r.src=t,r.onload=function(){const t=document.createElement("canvas"),n=t.getContext("2d");t.width=r.width,t.height=r.height,n&&n.drawImage(r,0,0,r.width,r.height);const o=t.toDataURL("image/png");e(o)},r.onerror=function(t){console.error(t),n(t)}}))},t.urlToFile=function(t){return new Promise(((e,n)=>{try{window&&window.fetch(t).then((t=>{200===t.status&&t.blob().then((t=>{Q(t).then((t=>{e(t)}))}))}))}catch(t){console.error(t),n(t)}}))},t.yesterday=function(){return _(j(new Date,-1))}}));
|
|
7
7
|
//# sourceMappingURL=index.full.umd.min.js.map
|