@nano-lib/util 1.1.7 → 1.1.8
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/lib/index.js +3 -3
- package/lib/index.mjs +101 -101
- package/lib/utils/face.d.ts +24 -2
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var Os=Object.defineProperty;var Fs=(t,e,n)=>e in t?Os(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var j=(t,e,n)=>Fs(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const As=(t,e,n,r)=>(t/=r/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)),_s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||(t=>window.setTimeout(t,1e3/60));function Is(t,e){if(e){document.querySelector(e).scrollTop=t;return}document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function Bs(t){return t?document.querySelector(t).scrollTop:document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function Cs(t){const{target:e,to:n=0,duration:r=500,callback:s}=t??{},o=Bs(e),c=n-o,f=20;let d=0;const h=function(){d+=f;const l=As(d,o,c,r);Is(l,e),d<r?_s(h):s&&s()};h()}function Ds(t,e){switch(arguments.length){case 1:return parseInt((Math.random()*t+1).toString(),10);case 2:return parseInt((Math.random()*(e-t+1)+t).toString(),10);default:return 0}}function Ps(){let t="";const e=[];for(let n=0;n<=15;n++)e[n]=n.toString(16);for(let n=1;n<=36;n++)n===9||n===14||n===19||n===24?t+="-":n===15?t+=4:n===20?t+=e[Math.random()*4|8]:t+=e[Math.random()*16|0];return t}function Vt(t,e){if(!t)return"-";t.toString().length===10&&(t=+t*1e3),e??(e="YYYY-MM-DD HH:mm:ss");const n=new Date(t),r=(c,f,d=" ")=>{if(c.length>=f)return c;const h=f-c.length;let l=Math.ceil(h/d.length);for(;l>>=1;)d+=d,l===1&&(d+=d);return d.slice(0,h)+c};let s;const o={"Y+":n.getFullYear().toString(),"M+":(n.getMonth()+1).toString(),"D+":n.getDate().toString(),"H+":n.getHours().toString(),"m+":n.getMinutes().toString(),"s+":n.getSeconds().toString()};for(const c in o)s=new RegExp("("+c+")").exec(e),s&&(e=e.replace(s[1],s[1].length==1?o[c]:r(o[c],s[1].length,"0")));return e}function qs(t,e){`${t}`.length===10?t=parseInt(t+"")*1e3:t=+t;const n=new Date(t),s=(Date.now()-Number(n))/1e3;return s<30?"刚刚":s<3600?`${Math.ceil(s/60)}分钟前`:s<3600*24?`${Math.ceil(s/3600)}小时前`:s<3600*24*2?"1天前":e?Vt(t,e):`${n.getMonth()+1}月${n.getDate()}日${n.getHours()}时${n.getMinutes()}分`}function Ms(t){const e=t||new Date,n=new Date(e),r=new Date(e);return n.setHours(0,0,0),r.setHours(23,59,59),{dateRange:[Vt(n),Vt(r)],timestampRange:[n.getTime(),r.getTime()]}}const ct={set(t,e){sessionStorage&&t&&e&&sessionStorage.setItem(t,e)},get(t){return!sessionStorage||!t?null:sessionStorage.getItem(t)},setJSON(t,e){e&&this.set(t,JSON.stringify(e))},getJSON(t){const e=this.get(t);return e?JSON.parse(e):null},remove(t){sessionStorage.removeItem(t)},clear(){sessionStorage.clear()}},mn={set(t,e){localStorage&&t&&e&&localStorage.setItem(t,e)},get(t){return!localStorage||!t?null:localStorage.getItem(t)},setJSON(t,e){e&&this.set(t,JSON.stringify(e))},getJSON(t){const e=this.get(t);return e?JSON.parse(e):null},remove(t){localStorage.removeItem(t)},clear(){localStorage.clear()}};function Ns(t,e){if(!t||!e)return;let n=t.className;const r=n.indexOf(e);r===-1?n+=`${e}`:n=n.substring(0,r)+n.substring(r+e.length),t.className=n}function Re(t,e){return t.className.match(new RegExp("(?:\\s|^)"+e+"(?:\\s|$)"))}function ks(t,e){Re(t,e)||(t.className+=` ${e}`)}function Ls(t,e){if(Re(t,e)){const n=new RegExp("(?:\\s|^)"+e+"(?:\\s|$)");t.className=t.className.replace(n," ")}}function Us(t){let e=!1;return function(...n){e||(e=!0,window.requestAnimationFrame(()=>{t.apply(this,n),e=!1}))}}function Hs(t){t&&(t.oncontextmenu=()=>!1)}function zs(t){return/^(http(s)?:\/\/)/.test(t)}function js(t){return/^(https?:|mailto:|tel:)/.test(t)}function $s(t){return Object.prototype.toString.call(t)==="[object String]"}function Vs(t){return/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t)}function Ys(t){return!Object.keys(t).length}function Ks(t){return/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t)}function Js(t,e=8){return new RegExp(`^S*(?=S{${e}},})(?=S*d)(?=S*[A-Z])(?=S*[a-z])(?=S*[!@#$%^&*?])S*$`).test(t)}function Ws(t){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}function Oe(t){return/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(t)}function Gs(t){return/^0\d{2,3}-?\d{7,8}$/.test(t)}function Zs(t){return/^1[3-9]\d{9}$/.test(t)}const xe=()=>{};function Xs(t){return new Promise(e=>setTimeout(e,t))}function Qs(t,e){return new Promise(n=>{const r=setInterval(()=>{if(t===0)return clearInterval(r),n(!0),!1;e&&e(t),t--},1e3)})}function ti(t,e){const n=t.slice(),r=[];let s=n.length;const o=[];if(e>s)return null;for(;e--;){const c=Math.floor(Math.random()*s);r[e]=n[c in o?o[c]:c],o[c]=--s in o?o[s]:s}return r}function ei(t,e){let n=null;return function(...r){n!==null&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r),n=null},e)}}function ni(t){if(!Oe(t))throw new Error("Please provide a valid ID number!");const e=t.length,n=e===15?t[e-1]:t[e-2];return parseInt(n)%2===1?"1":"2"}function ri(t){if(!Oe(t))throw new Error("Please provide a valid ID number!");return t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14)}function si(t){const{baseUrl:e,initUrl:n,initParams:r,initFn:s}=t;return new Promise(o=>{if(e){o(!0);return}const c={};if(r!==null&&typeof r=="object")Object.assign(c,r);else{const{protocol:f,hostname:d,port:h,pathname:l}=gn();Object.assign(c,{frontendProtocol:f,frontendDomain:d,frontendPort:h,frontendContextPath:l})}s(n,c).then(f=>o(f)).catch(()=>o(!1))})}const gn=(t="443",e="80")=>{const{protocol:n,hostname:r,port:s,pathname:o}=window.location,c=n.replace(":",""),f=s||(c==="https"?t:e),d=yn(o);return{hostname:r,protocol:c,port:f,pathname:d}},yn=t=>{const e="/";if(!t||t===e)return e;const n=t.endsWith("/")?t.slice(0,-1):t,r=n.lastIndexOf("/");return r>0&&n.substring(r+1).includes(".")?n.substring(0,r):n},xn=(t,e="")=>{e||(e=location.origin);const n=new RegExp(/^http(s)?:\/\//),r=new RegExp(/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i);return n.test(t)||r.test(t)?t:e+t},ii=(t,e="")=>{typeof t=="string"&&(t=t===""?[]:t.split(","));for(const n in t)t[n]=xn(t[n],e);return t};function oi(t){if(!t.length)return;let e=0;function n(){requestIdleCallback(r=>{for(;e<t.length&&r.timeRemaining()>0;)t[e++]();e<t.length&&n()})}n()}function ai(t){let e=xe;return(...n)=>new Promise((r,s)=>{e(),e=()=>{r=s=xe},t(...n).then(o=>r(o),o=>s(o))})}function ci(t,e){const n=document.createElement("a");n.download=e,n.href=t,n.click()}function bn(t){const e=[];for(let n=0;n<t.length;n++)t[n]&&e.push(t[n]);return e}function ui(t,e,n=!1){let r=Math.round(t/e*1e4)/100;return Number.isNaN(r)&&(r=0),n?Math.floor(r):r}function fi(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,e.crossOrigin="anonymous",document.getElementsByTagName("head")[0].appendChild(e)}function li(t){return new Promise((e,n)=>{const r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=()=>e(),r.onerror=s=>n(s),document.getElementsByTagName("head")[0].appendChild(r)})}function hi(t,e=48,n=48){const r=t.replace("#","");return`data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${e}" height="${n}"><path d="M787.510356 387.850445c0-152.160515-123.350352-275.511891-275.510868-275.511891S236.487597 235.68993 236.487597 387.850445c0 44.665269 10.640338 86.841857 29.507034 124.151601l-0.010233-0.001023 0.059352 0.100284c5.548366 10.962679 11.812023 21.500687 18.723434 31.56081L511.999488 926.678464l227.234351-383.021463c6.909363-10.057053 13.170974-20.593014 18.71934-31.552623l0.062422-0.104377-0.011256 0.002047C776.870018 474.692303 787.510356 432.515714 787.510356 387.850445zM511.999488 506.802628c-74.596975 0-135.070278-60.47228-135.070278-135.070278 0-74.595952 60.47228-135.069255 135.070278-135.069255 74.595952 0 135.069255 60.473303 135.069255 135.069255C647.068743 446.330348 586.59544 506.802628 511.999488 506.802628z" fill="%23${r}"></path></svg>`}const di=[["date","YYYY-MM-DD"],["daterange","YYYY-MM-DD"],["datetime","YYYY-MM-DD HH:mm:ss"],["datetimerange","YYYY-MM-DD HH:mm:ss"],["month","YYYY-MM"],["monthrange","YYYY-MM"],["year","YYYY"],["yearrange","YYYY"],["time","HH:mm:ss"]],pi={view:"查看",add:"添加",edit:"编辑",delete:"删除",save:"保存",reset:"重置",close:"关闭",confirm:"确定",submit:"提交",cancel:"取消",success:"成功",fail:"失败",open:"启用",disable:"禁用",refresh:"刷新",show:"显示",hide:"隐藏",search:"搜索",expand:"展开",collapse:"收起",upload:"上传",download:"下载",copy:"复制",clear:"清除",fuzzyQuery:"模糊查询",ing:"中",loading:"加载中...",select:"请选择",attachment:"附件",icon:"图标",picture:"图片",start:"开始",end:"结束",range:"范围",date:"日期",month:"月份",year:"年份",time:"时间",yes:"是",no:"否",have:"有",noHave:"无",unfilled:"未填写",selectAll:"全选",all:"全部",export:"导出",import:"导入",tip:"提示",defaultErrorCode:"系统未知错误,请反馈给管理员"},mi={400:"请求失败,请您稍后重试!",401:"认证失败,无法访问系统资源!",403:"当前操作没有权限!",404:"你所访问的资源不存在!",405:"请求错误,禁止访问系统资源!",408:"请求超时,请您稍后重试!",500:"服务异常!",502:"网关错误!",503:"服务不可用!",504:"网关超时!"},gi=new Map(di),dt=pi,yi=mi,wn=["jpg","jpeg","png","bmp","gif"],vn=["mp3","mp4","webm","ogg","3gp"],Tn=["doc","docx","xls","xlsx","ppt","txt","pdf","zip"],xi=[...wn,...vn,...Tn];function En(t){return yi[t]??dt.defaultErrorCode}function bi(t){return t==null?dt.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?dt.yes:dt.no)}function wi(t){return t==null?dt.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?dt.have:dt.noHave)}function vi(t){return t?t.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):""}function Ti(t,e,n){if(e??(e=4),n??(n=4),t){const r=t.length;return t.substring(0,e)+"*".repeat(r-e-n)+t.substring(r-n)}return""}function Ei(t){return t.replace(/( |^)[a-z]/g,e=>e.toUpperCase())}function Si(t){return t.replace(/( |^)[A-Z]/g,e=>e.toLowerCase())}function Ri(t,e){const n=t.find(r=>r.value===e);return n?n.label:""}function Oi(t,e,n){const r=[],s=e.split(","),o=n.split(",");return Array.from(new Set(s)).forEach(f=>{const d=t.find(h=>h.value===f);d&&o.forEach(h=>{var v;const l=(v=d.children)==null?void 0:v.find(O=>O.value===h);l&&r.push(l)})}),r.map(f=>f.label).join()}function Sn(t,e,n){var o;if(!e)return"";const r=e.split(","),s=n.find(c=>c.value===r[t]);return s?((o=s.children)!=null&&o.length&&Sn(t+1,e,s.children),s.label):""}function Fi(t,e,n){if(!t)return"";const r=t.split(","),s=[],o=r.length-1,c=r.findIndex(f=>f===n);if(c!==-1){const f=r[o]===n;r.splice(f?0:c,f?o:1)}return r.forEach(f=>{const d=e.find(h=>h.value===f);d&&s.push(d)}),s.map(f=>f.label).join()}function Rn(t){let e="";for(const n of Object.keys(t)){const r=t[n],s=`${encodeURIComponent(n)}=`;if(r!==null&&typeof r<"u")if(typeof r=="object"){for(const o of Object.keys(r))if(r[o]!==null&&typeof r[o]<"u"){const c=`${n}[${o}]`,f=`${encodeURIComponent(c)}=`;e+=`${f+encodeURIComponent(r[o])}&`}}else e+=`${s+encodeURIComponent(r)}&`}return e}function Ai(t){return t?bn(Object.keys(t).map(e=>t[e]===void 0?"":`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&"):""}function _i(t){const e=decodeURIComponent(t.split("?")[1]).replace(/\+/g," ");if(!e)return{};const n={};return e.split("&").forEach(s=>{const o=s.indexOf("=");if(o!==-1){const c=s.substring(0,o),f=s.substring(o+1,s.length);n[c]=f}}),n}function On(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ii}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:Wt,toStringTag:Fn}=Symbol,Gt=(t=>e=>{const n=Ii.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ut=t=>(t=t.toLowerCase(),e=>Gt(e)===t),Zt=t=>e=>typeof e===t,{isArray:Rt}=Array,Et=Zt("undefined");function Bt(t){return t!==null&&!Et(t)&&t.constructor!==null&&!Et(t.constructor)&&Q(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const An=ut("ArrayBuffer");function Bi(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&An(t.buffer),e}const Ci=Zt("string"),Q=Zt("function"),_n=Zt("number"),Ct=t=>t!==null&&typeof t=="object",Di=t=>t===!0||t===!1,Ht=t=>{if(Gt(t)!=="object")return!1;const e=Fe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Fn in t)&&!(Wt in t)},Pi=t=>{if(!Ct(t)||Bt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},qi=ut("Date"),Mi=ut("File"),Ni=ut("Blob"),ki=ut("FileList"),Li=t=>Ct(t)&&Q(t.pipe),Ui=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Q(t.append)&&((e=Gt(t))==="formdata"||e==="object"&&Q(t.toString)&&t.toString()==="[object FormData]"))},Hi=ut("URLSearchParams"),[zi,ji,$i,Vi]=["ReadableStream","Request","Response","Headers"].map(ut),Yi=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Dt(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),Rt(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(Bt(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),c=o.length;let f;for(r=0;r<c;r++)f=o[r],e.call(null,t[f],f,t)}}function In(t,e){if(Bt(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const xt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Bn=t=>!Et(t)&&t!==xt;function be(){const{caseless:t,skipUndefined:e}=Bn(this)&&this||{},n={},r=(s,o)=>{const c=t&&In(n,o)||o;Ht(n[c])&&Ht(s)?n[c]=be(n[c],s):Ht(s)?n[c]=be({},s):Rt(s)?n[c]=s.slice():(!e||!Et(s))&&(n[c]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Dt(arguments[s],r);return n}const Ki=(t,e,n,{allOwnKeys:r}={})=>(Dt(e,(s,o)=>{n&&Q(s)?t[o]=On(s,n):t[o]=s},{allOwnKeys:r}),t),Ji=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Wi=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Gi=(t,e,n,r)=>{let s,o,c;const f={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)c=s[o],(!r||r(c,t,e))&&!f[c]&&(e[c]=t[c],f[c]=!0);t=n!==!1&&Fe(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Zi=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Xi=t=>{if(!t)return null;if(Rt(t))return t;let e=t.length;if(!_n(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Qi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Fe(Uint8Array)),to=(t,e)=>{const r=(t&&t[Wt]).call(t);let s;for(;(s=r.next())&&!s.done;){const o=s.value;e.call(t,o[0],o[1])}},eo=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},no=ut("HTMLFormElement"),ro=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Le=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),so=ut("RegExp"),Cn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Dt(n,(s,o)=>{let c;(c=e(s,o,t))!==!1&&(r[o]=c||s)}),Object.defineProperties(t,r)},io=t=>{Cn(t,(e,n)=>{if(Q(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Q(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},oo=(t,e)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Rt(t)?r(t):r(String(t).split(e)),n},ao=()=>{},co=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function uo(t){return!!(t&&Q(t.append)&&t[Fn]==="FormData"&&t[Wt])}const fo=t=>{const e=new Array(10),n=(r,s)=>{if(Ct(r)){if(e.indexOf(r)>=0)return;if(Bt(r))return r;if(!("toJSON"in r)){e[s]=r;const o=Rt(r)?[]:{};return Dt(r,(c,f)=>{const d=n(c,s+1);!Et(d)&&(o[f]=d)}),e[s]=void 0,o}}return r};return n(t,0)},lo=ut("AsyncFunction"),ho=t=>t&&(Ct(t)||Q(t))&&Q(t.then)&&Q(t.catch),Dn=((t,e)=>t?setImmediate:e?((n,r)=>(xt.addEventListener("message",({source:s,data:o})=>{s===xt&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),xt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Q(xt.postMessage)),po=typeof queueMicrotask<"u"?queueMicrotask.bind(xt):typeof process<"u"&&process.nextTick||Dn,mo=t=>t!=null&&Q(t[Wt]),y={isArray:Rt,isArrayBuffer:An,isBuffer:Bt,isFormData:Ui,isArrayBufferView:Bi,isString:Ci,isNumber:_n,isBoolean:Di,isObject:Ct,isPlainObject:Ht,isEmptyObject:Pi,isReadableStream:zi,isRequest:ji,isResponse:$i,isHeaders:Vi,isUndefined:Et,isDate:qi,isFile:Mi,isBlob:Ni,isRegExp:so,isFunction:Q,isStream:Li,isURLSearchParams:Hi,isTypedArray:Qi,isFileList:ki,forEach:Dt,merge:be,extend:Ki,trim:Yi,stripBOM:Ji,inherits:Wi,toFlatObject:Gi,kindOf:Gt,kindOfTest:ut,endsWith:Zi,toArray:Xi,forEachEntry:to,matchAll:eo,isHTMLForm:no,hasOwnProperty:Le,hasOwnProp:Le,reduceDescriptors:Cn,freezeMethods:io,toObjectSet:oo,toCamelCase:ro,noop:ao,toFiniteNumber:co,findKey:In,global:xt,isContextDefined:Bn,isSpecCompliantForm:uo,toJSONObject:fo,isAsyncFn:lo,isThenable:ho,setImmediate:Dn,asap:po,isIterable:mo};function M(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}y.inherits(M,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:y.toJSONObject(this.config),code:this.code,status:this.status}}});const Pn=M.prototype,qn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{qn[t]={value:t}});Object.defineProperties(M,qn);Object.defineProperty(Pn,"isAxiosError",{value:!0});M.from=(t,e,n,r,s,o)=>{const c=Object.create(Pn);y.toFlatObject(t,c,function(l){return l!==Error.prototype},h=>h!=="isAxiosError");const f=t&&t.message?t.message:"Error",d=e==null&&t?t.code:e;return M.call(c,f,d,n,r,s),t&&c.cause==null&&Object.defineProperty(c,"cause",{value:t,configurable:!0}),c.name=t&&t.name||"Error",o&&Object.assign(c,o),c};const go=null;function we(t){return y.isPlainObject(t)||y.isArray(t)}function Mn(t){return y.endsWith(t,"[]")?t.slice(0,-2):t}function Ue(t,e,n){return t?t.concat(e).map(function(s,o){return s=Mn(s),!n&&o?"["+s+"]":s}).join(n?".":""):e}function yo(t){return y.isArray(t)&&!t.some(we)}const xo=y.toFlatObject(y,{},null,function(e){return/^is[A-Z]/.test(e)});function Xt(t,e,n){if(!y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(F,m){return!y.isUndefined(m[F])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,c=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(e);if(!y.isFunction(s))throw new TypeError("visitor must be a function");function h(w){if(w===null)return"";if(y.isDate(w))return w.toISOString();if(y.isBoolean(w))return w.toString();if(!d&&y.isBlob(w))throw new M("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(w)||y.isTypedArray(w)?d&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function l(w,F,m){let T=w;if(w&&!m&&typeof w=="object"){if(y.endsWith(F,"{}"))F=r?F:F.slice(0,-2),w=JSON.stringify(w);else if(y.isArray(w)&&yo(w)||(y.isFileList(w)||y.endsWith(F,"[]"))&&(T=y.toArray(w)))return F=Mn(F),T.forEach(function(g,S){!(y.isUndefined(g)||g===null)&&e.append(c===!0?Ue([F],S,o):c===null?F:F+"[]",h(g))}),!1}return we(w)?!0:(e.append(Ue(m,F,o),h(w)),!1)}const v=[],O=Object.assign(xo,{defaultVisitor:l,convertValue:h,isVisitable:we});function B(w,F){if(!y.isUndefined(w)){if(v.indexOf(w)!==-1)throw Error("Circular reference detected in "+F.join("."));v.push(w),y.forEach(w,function(T,b){(!(y.isUndefined(T)||T===null)&&s.call(e,T,y.isString(b)?b.trim():b,F,O))===!0&&B(T,F?F.concat(b):[b])}),v.pop()}}if(!y.isObject(t))throw new TypeError("data must be an object");return B(t),e}function He(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Ae(t,e){this._pairs=[],t&&Xt(t,this,e)}const Nn=Ae.prototype;Nn.append=function(e,n){this._pairs.push([e,n])};Nn.toString=function(e){const n=e?function(r){return e.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function bo(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function kn(t,e,n){if(!e)return t;const r=n&&n.encode||bo;y.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(e,n):o=y.isURLSearchParams(e)?e.toString():new Ae(e,n).toString(r),o){const c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class ze{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){y.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Ln={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wo=typeof URLSearchParams<"u"?URLSearchParams:Ae,vo=typeof FormData<"u"?FormData:null,To=typeof Blob<"u"?Blob:null,Eo={isBrowser:!0,classes:{URLSearchParams:wo,FormData:vo,Blob:To},protocols:["http","https","file","blob","url","data"]},_e=typeof window<"u"&&typeof document<"u",ve=typeof navigator=="object"&&navigator||void 0,So=_e&&(!ve||["ReactNative","NativeScript","NS"].indexOf(ve.product)<0),Ro=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Oo=_e&&window.location.href||"http://localhost",Fo=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_e,hasStandardBrowserEnv:So,hasStandardBrowserWebWorkerEnv:Ro,navigator:ve,origin:Oo},Symbol.toStringTag,{value:"Module"})),W={...Fo,...Eo};function Ao(t,e){return Xt(t,new W.classes.URLSearchParams,{visitor:function(n,r,s,o){return W.isNode&&y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function _o(t){return y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Io(t){const e={},n=Object.keys(t);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],e[o]=t[o];return e}function Un(t){function e(n,r,s,o){let c=n[o++];if(c==="__proto__")return!0;const f=Number.isFinite(+c),d=o>=n.length;return c=!c&&y.isArray(s)?s.length:c,d?(y.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!f):((!s[c]||!y.isObject(s[c]))&&(s[c]=[]),e(n,r,s[c],o)&&y.isArray(s[c])&&(s[c]=Io(s[c])),!f)}if(y.isFormData(t)&&y.isFunction(t.entries)){const n={};return y.forEachEntry(t,(r,s)=>{e(_o(r),s,n,0)}),n}return null}function Bo(t,e,n){if(y.isString(t))try{return(e||JSON.parse)(t),y.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Pt={transitional:Ln,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=y.isObject(e);if(o&&y.isHTMLForm(e)&&(e=new FormData(e)),y.isFormData(e))return s?JSON.stringify(Un(e)):e;if(y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e)||y.isReadableStream(e))return e;if(y.isArrayBufferView(e))return e.buffer;if(y.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let f;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ao(e,this.formSerializer).toString();if((f=y.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Xt(f?{"files[]":e}:e,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Bo(e)):e}],transformResponse:[function(e){const n=this.transitional||Pt.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(y.isResponse(e)||y.isReadableStream(e))return e;if(e&&y.isString(e)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(f){if(c)throw f.name==="SyntaxError"?M.from(f,M.ERR_BAD_RESPONSE,this,null,this.response):f}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:W.classes.FormData,Blob:W.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],t=>{Pt.headers[t]={}});const Co=y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Do=t=>{const e={};let n,r,s;return t&&t.split(`
|
|
1
|
+
"use strict";var Os=Object.defineProperty;var Fs=(t,e,n)=>e in t?Os(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var j=(t,e,n)=>Fs(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const As=(t,e,n,r)=>(t/=r/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)),_s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||(t=>window.setTimeout(t,1e3/60));function Is(t,e){if(e){document.querySelector(e).scrollTop=t;return}document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function Bs(t){return t?document.querySelector(t).scrollTop:document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function Cs(t){const{target:e,to:n=0,duration:r=500,callback:s}=t??{},o=Bs(e),c=n-o,f=20;let d=0;const h=function(){d+=f;const l=As(d,o,c,r);Is(l,e),d<r?_s(h):s&&s()};h()}function Ds(t,e){switch(arguments.length){case 1:return parseInt((Math.random()*t+1).toString(),10);case 2:return parseInt((Math.random()*(e-t+1)+t).toString(),10);default:return 0}}function Ps(){let t="";const e=[];for(let n=0;n<=15;n++)e[n]=n.toString(16);for(let n=1;n<=36;n++)n===9||n===14||n===19||n===24?t+="-":n===15?t+=4:n===20?t+=e[Math.random()*4|8]:t+=e[Math.random()*16|0];return t}function Vt(t,e){if(!t)return"-";t.toString().length===10&&(t=+t*1e3),e??(e="YYYY-MM-DD HH:mm:ss");const n=new Date(t),r=(c,f,d=" ")=>{if(c.length>=f)return c;const h=f-c.length;let l=Math.ceil(h/d.length);for(;l>>=1;)d+=d,l===1&&(d+=d);return d.slice(0,h)+c};let s;const o={"Y+":n.getFullYear().toString(),"M+":(n.getMonth()+1).toString(),"D+":n.getDate().toString(),"H+":n.getHours().toString(),"m+":n.getMinutes().toString(),"s+":n.getSeconds().toString()};for(const c in o)s=new RegExp("("+c+")").exec(e),s&&(e=e.replace(s[1],s[1].length==1?o[c]:r(o[c],s[1].length,"0")));return e}function qs(t,e){`${t}`.length===10?t=parseInt(t+"")*1e3:t=+t;const n=new Date(t),s=(Date.now()-Number(n))/1e3;return s<30?"刚刚":s<3600?`${Math.ceil(s/60)}分钟前`:s<3600*24?`${Math.ceil(s/3600)}小时前`:s<3600*24*2?"1天前":e?Vt(t,e):`${n.getMonth()+1}月${n.getDate()}日${n.getHours()}时${n.getMinutes()}分`}function Ms(t){const e=t||new Date,n=new Date(e),r=new Date(e);return n.setHours(0,0,0),r.setHours(23,59,59),{dateRange:[Vt(n),Vt(r)],timestampRange:[n.getTime(),r.getTime()]}}const ct={set(t,e){sessionStorage&&t&&e&&sessionStorage.setItem(t,e)},get(t){return!sessionStorage||!t?null:sessionStorage.getItem(t)},setJSON(t,e){e&&this.set(t,JSON.stringify(e))},getJSON(t){const e=this.get(t);return e?JSON.parse(e):null},remove(t){sessionStorage.removeItem(t)},clear(){sessionStorage.clear()}},mn={set(t,e){localStorage&&t&&e&&localStorage.setItem(t,e)},get(t){return!localStorage||!t?null:localStorage.getItem(t)},setJSON(t,e){e&&this.set(t,JSON.stringify(e))},getJSON(t){const e=this.get(t);return e?JSON.parse(e):null},remove(t){localStorage.removeItem(t)},clear(){localStorage.clear()}};function Ns(t,e){if(!t||!e)return;let n=t.className;const r=n.indexOf(e);r===-1?n+=`${e}`:n=n.substring(0,r)+n.substring(r+e.length),t.className=n}function Re(t,e){return t.className.match(new RegExp("(?:\\s|^)"+e+"(?:\\s|$)"))}function ks(t,e){Re(t,e)||(t.className+=` ${e}`)}function Ls(t,e){if(Re(t,e)){const n=new RegExp("(?:\\s|^)"+e+"(?:\\s|$)");t.className=t.className.replace(n," ")}}function Us(t){let e=!1;return function(...n){e||(e=!0,window.requestAnimationFrame(()=>{t.apply(this,n),e=!1}))}}function Hs(t){t&&(t.oncontextmenu=()=>!1)}function zs(t){return/^(http(s)?:\/\/)/.test(t)}function js(t){return/^(https?:|mailto:|tel:)/.test(t)}function $s(t){return Object.prototype.toString.call(t)==="[object String]"}function Vs(t){return/^[+-]?(0|([1-9]\d*))(\.\d+)?$/g.test(t)}function Ys(t){return!Object.keys(t).length}function Ks(t){return/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t)}function Js(t,e=8){return new RegExp(`^S*(?=S{${e}},})(?=S*d)(?=S*[A-Z])(?=S*[a-z])(?=S*[!@#$%^&*?])S*$`).test(t)}function Ws(t){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}function Oe(t){return/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/.test(t)}function Zs(t){return/^0\d{2,3}-?\d{7,8}$/.test(t)}function Gs(t){return/^1[3-9]\d{9}$/.test(t)}const xe=()=>{};function Xs(t){return new Promise(e=>setTimeout(e,t))}function Qs(t,e){return new Promise(n=>{const r=setInterval(()=>{if(t===0)return clearInterval(r),n(!0),!1;e&&e(t),t--},1e3)})}function ti(t,e){const n=t.slice(),r=[];let s=n.length;const o=[];if(e>s)return null;for(;e--;){const c=Math.floor(Math.random()*s);r[e]=n[c in o?o[c]:c],o[c]=--s in o?o[s]:s}return r}function ei(t,e){let n=null;return function(...r){n!==null&&clearTimeout(n),n=setTimeout(()=>{t.apply(this,r),n=null},e)}}function ni(t){if(!Oe(t))throw new Error("Please provide a valid ID number!");const e=t.length,n=e===15?t[e-1]:t[e-2];return parseInt(n)%2===1?"1":"2"}function ri(t){if(!Oe(t))throw new Error("Please provide a valid ID number!");return t.substring(6,10)+"-"+t.substring(10,12)+"-"+t.substring(12,14)}function si(t){const{baseUrl:e,initUrl:n,initParams:r,initFn:s}=t;return new Promise(o=>{if(e){o(!0);return}const c={};if(r!==null&&typeof r=="object")Object.assign(c,r);else{const{protocol:f,hostname:d,port:h,pathname:l}=gn();Object.assign(c,{frontendProtocol:f,frontendDomain:d,frontendPort:h,frontendContextPath:l})}s(n,c).then(f=>o(f)).catch(()=>o(!1))})}const gn=(t="443",e="80")=>{const{protocol:n,hostname:r,port:s,pathname:o}=window.location,c=n.replace(":",""),f=s||(c==="https"?t:e),d=yn(o);return{hostname:r,protocol:c,port:f,pathname:d}},yn=t=>{const e="/";if(!t||t===e)return e;const n=t.endsWith("/")?t.slice(0,-1):t,r=n.lastIndexOf("/");return r>0&&n.substring(r+1).includes(".")?n.substring(0,r):n},xn=(t,e="")=>{e||(e=location.origin);const n=new RegExp(/^http(s)?:\/\//),r=new RegExp(/^((?:[a-z]+:)?\/\/|data:image\/)(.*)/i);return n.test(t)||r.test(t)?t:e+t},ii=(t,e="")=>{typeof t=="string"&&(t=t===""?[]:t.split(","));for(const n in t)t[n]=xn(t[n],e);return t};function oi(t){if(!t.length)return;let e=0;function n(){requestIdleCallback(r=>{for(;e<t.length&&r.timeRemaining()>0;)t[e++]();e<t.length&&n()})}n()}function ai(t){let e=xe;return(...n)=>new Promise((r,s)=>{e(),e=()=>{r=s=xe},t(...n).then(o=>r(o),o=>s(o))})}function ci(t,e){const n=document.createElement("a");n.download=e,n.href=t,n.click()}function bn(t){const e=[];for(let n=0;n<t.length;n++)t[n]&&e.push(t[n]);return e}function ui(t,e,n=!1){let r=Math.round(t/e*1e4)/100;return Number.isNaN(r)&&(r=0),n?Math.floor(r):r}function fi(t){const e=document.createElement("link");e.rel="stylesheet",e.href=t,e.crossOrigin="anonymous",document.getElementsByTagName("head")[0].appendChild(e)}function li(t){return new Promise((e,n)=>{const r=document.createElement("script");r.type="text/javascript",r.src=t,r.onload=()=>e(),r.onerror=s=>n(s),document.getElementsByTagName("head")[0].appendChild(r)})}function hi(t,e=48,n=48){const r=t.replace("#","");return`data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="${e}" height="${n}"><path d="M787.510356 387.850445c0-152.160515-123.350352-275.511891-275.510868-275.511891S236.487597 235.68993 236.487597 387.850445c0 44.665269 10.640338 86.841857 29.507034 124.151601l-0.010233-0.001023 0.059352 0.100284c5.548366 10.962679 11.812023 21.500687 18.723434 31.56081L511.999488 926.678464l227.234351-383.021463c6.909363-10.057053 13.170974-20.593014 18.71934-31.552623l0.062422-0.104377-0.011256 0.002047C776.870018 474.692303 787.510356 432.515714 787.510356 387.850445zM511.999488 506.802628c-74.596975 0-135.070278-60.47228-135.070278-135.070278 0-74.595952 60.47228-135.069255 135.070278-135.069255 74.595952 0 135.069255 60.473303 135.069255 135.069255C647.068743 446.330348 586.59544 506.802628 511.999488 506.802628z" fill="%23${r}"></path></svg>`}const di=[["date","YYYY-MM-DD"],["daterange","YYYY-MM-DD"],["datetime","YYYY-MM-DD HH:mm:ss"],["datetimerange","YYYY-MM-DD HH:mm:ss"],["month","YYYY-MM"],["monthrange","YYYY-MM"],["year","YYYY"],["yearrange","YYYY"],["time","HH:mm:ss"]],pi={view:"查看",add:"添加",edit:"编辑",delete:"删除",save:"保存",reset:"重置",close:"关闭",confirm:"确定",submit:"提交",cancel:"取消",success:"成功",fail:"失败",open:"启用",disable:"禁用",refresh:"刷新",show:"显示",hide:"隐藏",search:"搜索",expand:"展开",collapse:"收起",upload:"上传",download:"下载",copy:"复制",clear:"清除",fuzzyQuery:"模糊查询",ing:"中",loading:"加载中...",select:"请选择",attachment:"附件",icon:"图标",picture:"图片",start:"开始",end:"结束",range:"范围",date:"日期",month:"月份",year:"年份",time:"时间",yes:"是",no:"否",have:"有",noHave:"无",unfilled:"未填写",selectAll:"全选",all:"全部",export:"导出",import:"导入",tip:"提示",defaultErrorCode:"系统未知错误,请反馈给管理员"},mi={400:"请求失败,请您稍后重试!",401:"认证失败,无法访问系统资源!",403:"当前操作没有权限!",404:"你所访问的资源不存在!",405:"请求错误,禁止访问系统资源!",408:"请求超时,请您稍后重试!",500:"服务异常!",502:"网关错误!",503:"服务不可用!",504:"网关超时!"},gi=new Map(di),dt=pi,yi=mi,wn=["jpg","jpeg","png","bmp","gif"],vn=["mp3","mp4","webm","ogg","3gp"],Tn=["doc","docx","xls","xlsx","ppt","txt","pdf","zip"],xi=[...wn,...vn,...Tn];function En(t){return yi[t]??dt.defaultErrorCode}function bi(t){return t==null?dt.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?dt.yes:dt.no)}function wi(t){return t==null?dt.unfilled:(t=typeof t=="number"?`${t}`:t,t==="1"?dt.have:dt.noHave)}function vi(t){return t?t.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"):""}function Ti(t,e,n){if(e??(e=4),n??(n=4),t){const r=t.length;return t.substring(0,e)+"*".repeat(r-e-n)+t.substring(r-n)}return""}function Ei(t){return t.replace(/( |^)[a-z]/g,e=>e.toUpperCase())}function Si(t){return t.replace(/( |^)[A-Z]/g,e=>e.toLowerCase())}function Ri(t,e){const n=t.find(r=>r.value===e);return n?n.label:""}function Oi(t,e,n){const r=[],s=e.split(","),o=n.split(",");return Array.from(new Set(s)).forEach(f=>{const d=t.find(h=>h.value===f);d&&o.forEach(h=>{var v;const l=(v=d.children)==null?void 0:v.find(O=>O.value===h);l&&r.push(l)})}),r.map(f=>f.label).join()}function Sn(t,e,n){var o;if(!e)return"";const r=e.split(","),s=n.find(c=>c.value===r[t]);return s?((o=s.children)!=null&&o.length&&Sn(t+1,e,s.children),s.label):""}function Fi(t,e,n){if(!t)return"";const r=t.split(","),s=[],o=r.length-1,c=r.findIndex(f=>f===n);if(c!==-1){const f=r[o]===n;r.splice(f?0:c,f?o:1)}return r.forEach(f=>{const d=e.find(h=>h.value===f);d&&s.push(d)}),s.map(f=>f.label).join()}function Rn(t){let e="";for(const n of Object.keys(t)){const r=t[n],s=`${encodeURIComponent(n)}=`;if(r!==null&&typeof r<"u")if(typeof r=="object"){for(const o of Object.keys(r))if(r[o]!==null&&typeof r[o]<"u"){const c=`${n}[${o}]`,f=`${encodeURIComponent(c)}=`;e+=`${f+encodeURIComponent(r[o])}&`}}else e+=`${s+encodeURIComponent(r)}&`}return e}function Ai(t){return t?bn(Object.keys(t).map(e=>t[e]===void 0?"":`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`)).join("&"):""}function _i(t){const e=decodeURIComponent(t.split("?")[1]).replace(/\+/g," ");if(!e)return{};const n={};return e.split("&").forEach(s=>{const o=s.indexOf("=");if(o!==-1){const c=s.substring(0,o),f=s.substring(o+1,s.length);n[c]=f}}),n}function On(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ii}=Object.prototype,{getPrototypeOf:Fe}=Object,{iterator:Wt,toStringTag:Fn}=Symbol,Zt=(t=>e=>{const n=Ii.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ut=t=>(t=t.toLowerCase(),e=>Zt(e)===t),Gt=t=>e=>typeof e===t,{isArray:Rt}=Array,Et=Gt("undefined");function Bt(t){return t!==null&&!Et(t)&&t.constructor!==null&&!Et(t.constructor)&&Q(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const An=ut("ArrayBuffer");function Bi(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&An(t.buffer),e}const Ci=Gt("string"),Q=Gt("function"),_n=Gt("number"),Ct=t=>t!==null&&typeof t=="object",Di=t=>t===!0||t===!1,Ht=t=>{if(Zt(t)!=="object")return!1;const e=Fe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Fn in t)&&!(Wt in t)},Pi=t=>{if(!Ct(t)||Bt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},qi=ut("Date"),Mi=ut("File"),Ni=ut("Blob"),ki=ut("FileList"),Li=t=>Ct(t)&&Q(t.pipe),Ui=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Q(t.append)&&((e=Zt(t))==="formdata"||e==="object"&&Q(t.toString)&&t.toString()==="[object FormData]"))},Hi=ut("URLSearchParams"),[zi,ji,$i,Vi]=["ReadableStream","Request","Response","Headers"].map(ut),Yi=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Dt(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),Rt(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(Bt(t))return;const o=n?Object.getOwnPropertyNames(t):Object.keys(t),c=o.length;let f;for(r=0;r<c;r++)f=o[r],e.call(null,t[f],f,t)}}function In(t,e){if(Bt(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const xt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Bn=t=>!Et(t)&&t!==xt;function be(){const{caseless:t,skipUndefined:e}=Bn(this)&&this||{},n={},r=(s,o)=>{const c=t&&In(n,o)||o;Ht(n[c])&&Ht(s)?n[c]=be(n[c],s):Ht(s)?n[c]=be({},s):Rt(s)?n[c]=s.slice():(!e||!Et(s))&&(n[c]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Dt(arguments[s],r);return n}const Ki=(t,e,n,{allOwnKeys:r}={})=>(Dt(e,(s,o)=>{n&&Q(s)?t[o]=On(s,n):t[o]=s},{allOwnKeys:r}),t),Ji=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Wi=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Zi=(t,e,n,r)=>{let s,o,c;const f={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)c=s[o],(!r||r(c,t,e))&&!f[c]&&(e[c]=t[c],f[c]=!0);t=n!==!1&&Fe(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Gi=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Xi=t=>{if(!t)return null;if(Rt(t))return t;let e=t.length;if(!_n(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Qi=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Fe(Uint8Array)),to=(t,e)=>{const r=(t&&t[Wt]).call(t);let s;for(;(s=r.next())&&!s.done;){const o=s.value;e.call(t,o[0],o[1])}},eo=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},no=ut("HTMLFormElement"),ro=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Le=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),so=ut("RegExp"),Cn=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Dt(n,(s,o)=>{let c;(c=e(s,o,t))!==!1&&(r[o]=c||s)}),Object.defineProperties(t,r)},io=t=>{Cn(t,(e,n)=>{if(Q(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(Q(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},oo=(t,e)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Rt(t)?r(t):r(String(t).split(e)),n},ao=()=>{},co=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function uo(t){return!!(t&&Q(t.append)&&t[Fn]==="FormData"&&t[Wt])}const fo=t=>{const e=new Array(10),n=(r,s)=>{if(Ct(r)){if(e.indexOf(r)>=0)return;if(Bt(r))return r;if(!("toJSON"in r)){e[s]=r;const o=Rt(r)?[]:{};return Dt(r,(c,f)=>{const d=n(c,s+1);!Et(d)&&(o[f]=d)}),e[s]=void 0,o}}return r};return n(t,0)},lo=ut("AsyncFunction"),ho=t=>t&&(Ct(t)||Q(t))&&Q(t.then)&&Q(t.catch),Dn=((t,e)=>t?setImmediate:e?((n,r)=>(xt.addEventListener("message",({source:s,data:o})=>{s===xt&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),xt.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Q(xt.postMessage)),po=typeof queueMicrotask<"u"?queueMicrotask.bind(xt):typeof process<"u"&&process.nextTick||Dn,mo=t=>t!=null&&Q(t[Wt]),y={isArray:Rt,isArrayBuffer:An,isBuffer:Bt,isFormData:Ui,isArrayBufferView:Bi,isString:Ci,isNumber:_n,isBoolean:Di,isObject:Ct,isPlainObject:Ht,isEmptyObject:Pi,isReadableStream:zi,isRequest:ji,isResponse:$i,isHeaders:Vi,isUndefined:Et,isDate:qi,isFile:Mi,isBlob:Ni,isRegExp:so,isFunction:Q,isStream:Li,isURLSearchParams:Hi,isTypedArray:Qi,isFileList:ki,forEach:Dt,merge:be,extend:Ki,trim:Yi,stripBOM:Ji,inherits:Wi,toFlatObject:Zi,kindOf:Zt,kindOfTest:ut,endsWith:Gi,toArray:Xi,forEachEntry:to,matchAll:eo,isHTMLForm:no,hasOwnProperty:Le,hasOwnProp:Le,reduceDescriptors:Cn,freezeMethods:io,toObjectSet:oo,toCamelCase:ro,noop:ao,toFiniteNumber:co,findKey:In,global:xt,isContextDefined:Bn,isSpecCompliantForm:uo,toJSONObject:fo,isAsyncFn:lo,isThenable:ho,setImmediate:Dn,asap:po,isIterable:mo};function M(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}y.inherits(M,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:y.toJSONObject(this.config),code:this.code,status:this.status}}});const Pn=M.prototype,qn={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{qn[t]={value:t}});Object.defineProperties(M,qn);Object.defineProperty(Pn,"isAxiosError",{value:!0});M.from=(t,e,n,r,s,o)=>{const c=Object.create(Pn);y.toFlatObject(t,c,function(l){return l!==Error.prototype},h=>h!=="isAxiosError");const f=t&&t.message?t.message:"Error",d=e==null&&t?t.code:e;return M.call(c,f,d,n,r,s),t&&c.cause==null&&Object.defineProperty(c,"cause",{value:t,configurable:!0}),c.name=t&&t.name||"Error",o&&Object.assign(c,o),c};const go=null;function we(t){return y.isPlainObject(t)||y.isArray(t)}function Mn(t){return y.endsWith(t,"[]")?t.slice(0,-2):t}function Ue(t,e,n){return t?t.concat(e).map(function(s,o){return s=Mn(s),!n&&o?"["+s+"]":s}).join(n?".":""):e}function yo(t){return y.isArray(t)&&!t.some(we)}const xo=y.toFlatObject(y,{},null,function(e){return/^is[A-Z]/.test(e)});function Xt(t,e,n){if(!y.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=y.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(F,m){return!y.isUndefined(m[F])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,c=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&y.isSpecCompliantForm(e);if(!y.isFunction(s))throw new TypeError("visitor must be a function");function h(w){if(w===null)return"";if(y.isDate(w))return w.toISOString();if(y.isBoolean(w))return w.toString();if(!d&&y.isBlob(w))throw new M("Blob is not supported. Use a Buffer instead.");return y.isArrayBuffer(w)||y.isTypedArray(w)?d&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function l(w,F,m){let T=w;if(w&&!m&&typeof w=="object"){if(y.endsWith(F,"{}"))F=r?F:F.slice(0,-2),w=JSON.stringify(w);else if(y.isArray(w)&&yo(w)||(y.isFileList(w)||y.endsWith(F,"[]"))&&(T=y.toArray(w)))return F=Mn(F),T.forEach(function(g,S){!(y.isUndefined(g)||g===null)&&e.append(c===!0?Ue([F],S,o):c===null?F:F+"[]",h(g))}),!1}return we(w)?!0:(e.append(Ue(m,F,o),h(w)),!1)}const v=[],O=Object.assign(xo,{defaultVisitor:l,convertValue:h,isVisitable:we});function I(w,F){if(!y.isUndefined(w)){if(v.indexOf(w)!==-1)throw Error("Circular reference detected in "+F.join("."));v.push(w),y.forEach(w,function(T,b){(!(y.isUndefined(T)||T===null)&&s.call(e,T,y.isString(b)?b.trim():b,F,O))===!0&&I(T,F?F.concat(b):[b])}),v.pop()}}if(!y.isObject(t))throw new TypeError("data must be an object");return I(t),e}function He(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Ae(t,e){this._pairs=[],t&&Xt(t,this,e)}const Nn=Ae.prototype;Nn.append=function(e,n){this._pairs.push([e,n])};Nn.toString=function(e){const n=e?function(r){return e.call(this,r,He)}:He;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function bo(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function kn(t,e,n){if(!e)return t;const r=n&&n.encode||bo;y.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(e,n):o=y.isURLSearchParams(e)?e.toString():new Ae(e,n).toString(r),o){const c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class ze{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){y.forEach(this.handlers,function(r){r!==null&&e(r)})}}const Ln={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wo=typeof URLSearchParams<"u"?URLSearchParams:Ae,vo=typeof FormData<"u"?FormData:null,To=typeof Blob<"u"?Blob:null,Eo={isBrowser:!0,classes:{URLSearchParams:wo,FormData:vo,Blob:To},protocols:["http","https","file","blob","url","data"]},_e=typeof window<"u"&&typeof document<"u",ve=typeof navigator=="object"&&navigator||void 0,So=_e&&(!ve||["ReactNative","NativeScript","NS"].indexOf(ve.product)<0),Ro=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Oo=_e&&window.location.href||"http://localhost",Fo=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_e,hasStandardBrowserEnv:So,hasStandardBrowserWebWorkerEnv:Ro,navigator:ve,origin:Oo},Symbol.toStringTag,{value:"Module"})),W={...Fo,...Eo};function Ao(t,e){return Xt(t,new W.classes.URLSearchParams,{visitor:function(n,r,s,o){return W.isNode&&y.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function _o(t){return y.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Io(t){const e={},n=Object.keys(t);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],e[o]=t[o];return e}function Un(t){function e(n,r,s,o){let c=n[o++];if(c==="__proto__")return!0;const f=Number.isFinite(+c),d=o>=n.length;return c=!c&&y.isArray(s)?s.length:c,d?(y.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!f):((!s[c]||!y.isObject(s[c]))&&(s[c]=[]),e(n,r,s[c],o)&&y.isArray(s[c])&&(s[c]=Io(s[c])),!f)}if(y.isFormData(t)&&y.isFunction(t.entries)){const n={};return y.forEachEntry(t,(r,s)=>{e(_o(r),s,n,0)}),n}return null}function Bo(t,e,n){if(y.isString(t))try{return(e||JSON.parse)(t),y.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Pt={transitional:Ln,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=y.isObject(e);if(o&&y.isHTMLForm(e)&&(e=new FormData(e)),y.isFormData(e))return s?JSON.stringify(Un(e)):e;if(y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e)||y.isReadableStream(e))return e;if(y.isArrayBufferView(e))return e.buffer;if(y.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let f;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Ao(e,this.formSerializer).toString();if((f=y.isFileList(e))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Xt(f?{"files[]":e}:e,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Bo(e)):e}],transformResponse:[function(e){const n=this.transitional||Pt.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(y.isResponse(e)||y.isReadableStream(e))return e;if(e&&y.isString(e)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(f){if(c)throw f.name==="SyntaxError"?M.from(f,M.ERR_BAD_RESPONSE,this,null,this.response):f}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:W.classes.FormData,Blob:W.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};y.forEach(["delete","get","head","post","put","patch"],t=>{Pt.headers[t]={}});const Co=y.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Do=t=>{const e={};let n,r,s;return t&&t.split(`
|
|
2
2
|
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||e[n]&&Co[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},je=Symbol("internals");function _t(t){return t&&String(t).trim().toLowerCase()}function zt(t){return t===!1||t==null?t:y.isArray(t)?t.map(zt):String(t)}function Po(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const qo=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function oe(t,e,n,r,s){if(y.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!y.isString(e)){if(y.isString(r))return e.indexOf(r)!==-1;if(y.isRegExp(r))return r.test(e)}}function Mo(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function No(t,e){const n=y.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,o,c){return this[r].call(this,e,s,o,c)},configurable:!0})})}let tt=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function o(f,d,h){const l=_t(d);if(!l)throw new Error("header name must be a non-empty string");const v=y.findKey(s,l);(!v||s[v]===void 0||h===!0||h===void 0&&s[v]!==!1)&&(s[v||d]=zt(f))}const c=(f,d)=>y.forEach(f,(h,l)=>o(h,l,d));if(y.isPlainObject(e)||e instanceof this.constructor)c(e,n);else if(y.isString(e)&&(e=e.trim())&&!qo(e))c(Do(e),n);else if(y.isObject(e)&&y.isIterable(e)){let f={},d,h;for(const l of e){if(!y.isArray(l))throw TypeError("Object iterator must return a key-value pair");f[h=l[0]]=(d=f[h])?y.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}c(f,n)}else e!=null&&o(n,e,r);return this}get(e,n){if(e=_t(e),e){const r=y.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return Po(s);if(y.isFunction(n))return n.call(this,s,r);if(y.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=_t(e),e){const r=y.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||oe(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function o(c){if(c=_t(c),c){const f=y.findKey(r,c);f&&(!n||oe(r,r[f],f,n))&&(delete r[f],s=!0)}}return y.isArray(e)?e.forEach(o):o(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!e||oe(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const n=this,r={};return y.forEach(this,(s,o)=>{const c=y.findKey(r,o);if(c){n[c]=zt(s),delete n[o];return}const f=e?Mo(o):String(o).trim();f!==o&&delete n[o],n[f]=zt(s),r[f]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return y.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&y.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[je]=this[je]={accessors:{}}).accessors,s=this.prototype;function o(c){const f=_t(c);r[f]||(No(s,c),r[f]=!0)}return y.isArray(e)?e.forEach(o):o(e),this}};tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);y.reduceDescriptors(tt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});y.freezeMethods(tt);function ae(t,e){const n=this||Pt,r=e||n,s=tt.from(r.headers);let o=r.data;return y.forEach(t,function(f){o=f.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function Hn(t){return!!(t&&t.__CANCEL__)}function Ot(t,e,n){M.call(this,t??"canceled",M.ERR_CANCELED,e,n),this.name="CanceledError"}y.inherits(Ot,M,{__CANCEL__:!0});function zn(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ko(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Lo(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,o=0,c;return e=e!==void 0?e:1e3,function(d){const h=Date.now(),l=r[o];c||(c=h),n[s]=d,r[s]=h;let v=o,O=0;for(;v!==s;)O+=n[v++],v=v%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),h-c<e)return;const B=l&&h-l;return B?Math.round(O*1e3/B):void 0}}function Uo(t,e){let n=0,r=1e3/e,s,o;const c=(h,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),t(...h)};return[(...h)=>{const l=Date.now(),v=l-n;v>=r?c(h,l):(s=h,o||(o=setTimeout(()=>{o=null,c(s)},r-v)))},()=>s&&c(s)]}const Yt=(t,e,n=3)=>{let r=0;const s=Lo(50,250);return Uo(o=>{const c=o.loaded,f=o.lengthComputable?o.total:void 0,d=c-r,h=s(d),l=c<=f;r=c;const v={loaded:c,total:f,progress:f?c/f:void 0,bytes:d,rate:h||void 0,estimated:h&&f&&l?(f-c)/h:void 0,event:o,lengthComputable:f!=null,[e?"download":"upload"]:!0};t(v)},n)},$e=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Ve=t=>(...e)=>y.asap(()=>t(...e)),Ho=W.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,W.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(W.origin),W.navigator&&/(msie|trident)/i.test(W.navigator.userAgent)):()=>!0,zo=W.hasStandardBrowserEnv?{write(t,e,n,r,s,o){const c=[t+"="+encodeURIComponent(e)];y.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),y.isString(r)&&c.push("path="+r),y.isString(s)&&c.push("domain="+s),o===!0&&c.push("secure"),document.cookie=c.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jo(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function $o(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function jn(t,e,n){let r=!jo(e);return t&&(r||n==!1)?$o(t,e):e}const Ye=t=>t instanceof tt?{...t}:t;function wt(t,e){e=e||{};const n={};function r(h,l,v,O){return y.isPlainObject(h)&&y.isPlainObject(l)?y.merge.call({caseless:O},h,l):y.isPlainObject(l)?y.merge({},l):y.isArray(l)?l.slice():l}function s(h,l,v,O){if(y.isUndefined(l)){if(!y.isUndefined(h))return r(void 0,h,v,O)}else return r(h,l,v,O)}function o(h,l){if(!y.isUndefined(l))return r(void 0,l)}function c(h,l){if(y.isUndefined(l)){if(!y.isUndefined(h))return r(void 0,h)}else return r(void 0,l)}function f(h,l,v){if(v in e)return r(h,l);if(v in t)return r(void 0,h)}const d={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:f,headers:(h,l,v)=>s(Ye(h),Ye(l),v,!0)};return y.forEach(Object.keys({...t,...e}),function(l){const v=d[l]||s,O=v(t[l],e[l],l);y.isUndefined(O)&&v!==f||(n[l]=O)}),n}const $n=t=>{const e=wt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:c,auth:f}=e;if(e.headers=c=tt.from(c),e.url=kn(jn(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),f&&c.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),y.isFormData(n)){if(W.hasStandardBrowserEnv||W.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(y.isFunction(n.getHeaders)){const d=n.getHeaders(),h=["content-type","content-length"];Object.entries(d).forEach(([l,v])=>{h.includes(l.toLowerCase())&&c.set(l,v)})}}if(W.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&Ho(e.url))){const d=s&&o&&zo.read(o);d&&c.set(s,d)}return e},Vo=typeof XMLHttpRequest<"u",Yo=Vo&&function(t){return new Promise(function(n,r){const s=$n(t);let o=s.data;const c=tt.from(s.headers).normalize();let{responseType:f,onUploadProgress:d,onDownloadProgress:h}=s,l,v,O,B,w;function F(){B&&B(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function T(){if(!m)return;const g=tt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),x={data:!f||f==="text"||f==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:g,config:t,request:m};zn(function(C){n(C),F()},function(C){r(C),F()},x),m=null}"onloadend"in m?m.onloadend=T:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(T)},m.onabort=function(){m&&(r(new M("Request aborted",M.ECONNABORTED,t,m)),m=null)},m.onerror=function(S){const x=S&&S.message?S.message:"Network Error",A=new M(x,M.ERR_NETWORK,t,m);A.event=S||null,r(A),m=null},m.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const x=s.transitional||Ln;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),r(new M(S,x.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,t,m)),m=null},o===void 0&&c.setContentType(null),"setRequestHeader"in m&&y.forEach(c.toJSON(),function(S,x){m.setRequestHeader(x,S)}),y.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),f&&f!=="json"&&(m.responseType=s.responseType),h&&([O,w]=Yt(h,!0),m.addEventListener("progress",O)),d&&m.upload&&([v,B]=Yt(d),m.upload.addEventListener("progress",v),m.upload.addEventListener("loadend",B)),(s.cancelToken||s.signal)&&(l=g=>{m&&(r(!g||g.type?new Ot(null,t,m):g),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const b=ko(s.url);if(b&&W.protocols.indexOf(b)===-1){r(new M("Unsupported protocol "+b+":",M.ERR_BAD_REQUEST,t));return}m.send(o||null)})},Ko=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const o=function(h){if(!s){s=!0,f();const l=h instanceof Error?h:this.reason;r.abort(l instanceof M?l:new Ot(l instanceof Error?l.message:l))}};let c=e&&setTimeout(()=>{c=null,o(new M(`timeout ${e} of ms exceeded`,M.ETIMEDOUT))},e);const f=()=>{t&&(c&&clearTimeout(c),c=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),t=null)};t.forEach(h=>h.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>y.asap(f),d}},Jo=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},Wo=async function*(t,e){for await(const n of Go(t))yield*Jo(n,e)},Go=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Ke=(t,e,n,r)=>{const s=Wo(t,e);let o=0,c,f=d=>{c||(c=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:h,value:l}=await s.next();if(h){f(),d.close();return}let v=l.byteLength;if(n){let O=o+=v;n(O)}d.enqueue(new Uint8Array(l))}catch(h){throw f(h),h}},cancel(d){return f(d),s.return()}},{highWaterMark:2})},Je=64*1024,{isFunction:Lt}=y,Zo=(({Request:t,Response:e})=>({Request:t,Response:e}))(y.global),{ReadableStream:We,TextEncoder:Ge}=y.global,Ze=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Xo=t=>{t=y.merge.call({skipUndefined:!0},Zo,t);const{fetch:e,Request:n,Response:r}=t,s=e?Lt(e):typeof fetch=="function",o=Lt(n),c=Lt(r);if(!s)return!1;const f=s&&Lt(We),d=s&&(typeof Ge=="function"?(w=>F=>w.encode(F))(new Ge):async w=>new Uint8Array(await new n(w).arrayBuffer())),h=o&&f&&Ze(()=>{let w=!1;const F=new n(W.origin,{body:new We,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!F}),l=c&&f&&Ze(()=>y.isReadableStream(new r("").body)),v={stream:l&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!v[w]&&(v[w]=(F,m)=>{let T=F&&F[w];if(T)return T.call(F);throw new M(`Response type '${w}' is not supported`,M.ERR_NOT_SUPPORT,m)})});const O=async w=>{if(w==null)return 0;if(y.isBlob(w))return w.size;if(y.isSpecCompliantForm(w))return(await new n(W.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(y.isArrayBufferView(w)||y.isArrayBuffer(w))return w.byteLength;if(y.isURLSearchParams(w)&&(w=w+""),y.isString(w))return(await d(w)).byteLength},B=async(w,F)=>{const m=y.toFiniteNumber(w.getContentLength());return m??O(F)};return async w=>{let{url:F,method:m,data:T,signal:b,cancelToken:g,timeout:S,onDownloadProgress:x,onUploadProgress:A,responseType:C,headers:q,withCredentials:N="same-origin",fetchOptions:H}=$n(w),P=e||fetch;C=C?(C+"").toLowerCase():"text";let k=Ko([b,g&&g.toAbortSignal()],S),L=null;const U=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let J;try{if(A&&h&&m!=="get"&&m!=="head"&&(J=await B(q,T))!==0){let et=new n(F,{method:"POST",body:T,duplex:"half"}),D;if(y.isFormData(T)&&(D=et.headers.get("content-type"))&&q.setContentType(D),et.body){const[Ft,Tt]=$e(J,Yt(Ve(A)));T=Ke(et.body,Je,Ft,Tt)}}y.isString(N)||(N=N?"include":"omit");const V=o&&"credentials"in n.prototype,X={...H,signal:k,method:m.toUpperCase(),headers:q.normalize().toJSON(),body:T,duplex:"half",credentials:V?N:void 0};L=o&&new n(F,X);let G=await(o?P(L,H):P(F,X));const pt=l&&(C==="stream"||C==="response");if(l&&(x||pt&&U)){const et={};["status","statusText","headers"].forEach(qt=>{et[qt]=G[qt]});const D=y.toFiniteNumber(G.headers.get("content-length")),[Ft,Tt]=x&&$e(D,Yt(Ve(x),!0))||[];G=new r(Ke(G.body,Je,Ft,()=>{Tt&&Tt(),U&&U()}),et)}C=C||"text";let vt=await v[y.findKey(v,C)||"text"](G,w);return!pt&&U&&U(),await new Promise((et,D)=>{zn(et,D,{data:vt,headers:tt.from(G.headers),status:G.status,statusText:G.statusText,config:w,request:L})})}catch(V){throw U&&U(),V&&V.name==="TypeError"&&/Load failed|fetch/i.test(V.message)?Object.assign(new M("Network Error",M.ERR_NETWORK,w,L),{cause:V.cause||V}):M.from(V,V&&V.code,w,L)}}},Qo=new Map,Vn=t=>{let e=t?t.env:{};const{fetch:n,Request:r,Response:s}=e,o=[r,s,n];let c=o.length,f=c,d,h,l=Qo;for(;f--;)d=o[f],h=l.get(d),h===void 0&&l.set(d,h=f?new Map:Xo(e)),l=h;return h};Vn();const Te={http:go,xhr:Yo,fetch:{get:Vn}};y.forEach(Te,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Xe=t=>`- ${t}`,ta=t=>y.isFunction(t)||t===null||t===!1,Yn={getAdapter:(t,e)=>{t=y.isArray(t)?t:[t];const{length:n}=t;let r,s;const o={};for(let c=0;c<n;c++){r=t[c];let f;if(s=r,!ta(r)&&(s=Te[(f=String(r)).toLowerCase()],s===void 0))throw new M(`Unknown adapter '${f}'`);if(s&&(y.isFunction(s)||(s=s.get(e))))break;o[f||"#"+c]=s}if(!s){const c=Object.entries(o).map(([d,h])=>`adapter ${d} `+(h===!1?"is not supported by the environment":"is not available in the build"));let f=n?c.length>1?`since :
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[je]=this[je]={accessors:{}}).accessors,s=this.prototype;function o(c){const f=_t(c);r[f]||(No(s,c),r[f]=!0)}return y.isArray(e)?e.forEach(o):o(e),this}};tt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);y.reduceDescriptors(tt.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});y.freezeMethods(tt);function ae(t,e){const n=this||Pt,r=e||n,s=tt.from(r.headers);let o=r.data;return y.forEach(t,function(f){o=f.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function Hn(t){return!!(t&&t.__CANCEL__)}function Ot(t,e,n){M.call(this,t??"canceled",M.ERR_CANCELED,e,n),this.name="CanceledError"}y.inherits(Ot,M,{__CANCEL__:!0});function zn(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function ko(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Lo(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,o=0,c;return e=e!==void 0?e:1e3,function(d){const h=Date.now(),l=r[o];c||(c=h),n[s]=d,r[s]=h;let v=o,O=0;for(;v!==s;)O+=n[v++],v=v%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),h-c<e)return;const I=l&&h-l;return I?Math.round(O*1e3/I):void 0}}function Uo(t,e){let n=0,r=1e3/e,s,o;const c=(h,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),t(...h)};return[(...h)=>{const l=Date.now(),v=l-n;v>=r?c(h,l):(s=h,o||(o=setTimeout(()=>{o=null,c(s)},r-v)))},()=>s&&c(s)]}const Yt=(t,e,n=3)=>{let r=0;const s=Lo(50,250);return Uo(o=>{const c=o.loaded,f=o.lengthComputable?o.total:void 0,d=c-r,h=s(d),l=c<=f;r=c;const v={loaded:c,total:f,progress:f?c/f:void 0,bytes:d,rate:h||void 0,estimated:h&&f&&l?(f-c)/h:void 0,event:o,lengthComputable:f!=null,[e?"download":"upload"]:!0};t(v)},n)},$e=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Ve=t=>(...e)=>y.asap(()=>t(...e)),Ho=W.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,W.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(W.origin),W.navigator&&/(msie|trident)/i.test(W.navigator.userAgent)):()=>!0,zo=W.hasStandardBrowserEnv?{write(t,e,n,r,s,o){const c=[t+"="+encodeURIComponent(e)];y.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),y.isString(r)&&c.push("path="+r),y.isString(s)&&c.push("domain="+s),o===!0&&c.push("secure"),document.cookie=c.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jo(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function $o(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function jn(t,e,n){let r=!jo(e);return t&&(r||n==!1)?$o(t,e):e}const Ye=t=>t instanceof tt?{...t}:t;function wt(t,e){e=e||{};const n={};function r(h,l,v,O){return y.isPlainObject(h)&&y.isPlainObject(l)?y.merge.call({caseless:O},h,l):y.isPlainObject(l)?y.merge({},l):y.isArray(l)?l.slice():l}function s(h,l,v,O){if(y.isUndefined(l)){if(!y.isUndefined(h))return r(void 0,h,v,O)}else return r(h,l,v,O)}function o(h,l){if(!y.isUndefined(l))return r(void 0,l)}function c(h,l){if(y.isUndefined(l)){if(!y.isUndefined(h))return r(void 0,h)}else return r(void 0,l)}function f(h,l,v){if(v in e)return r(h,l);if(v in t)return r(void 0,h)}const d={url:o,method:o,data:o,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:f,headers:(h,l,v)=>s(Ye(h),Ye(l),v,!0)};return y.forEach(Object.keys({...t,...e}),function(l){const v=d[l]||s,O=v(t[l],e[l],l);y.isUndefined(O)&&v!==f||(n[l]=O)}),n}const $n=t=>{const e=wt({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:c,auth:f}=e;if(e.headers=c=tt.from(c),e.url=kn(jn(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),f&&c.set("Authorization","Basic "+btoa((f.username||"")+":"+(f.password?unescape(encodeURIComponent(f.password)):""))),y.isFormData(n)){if(W.hasStandardBrowserEnv||W.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(y.isFunction(n.getHeaders)){const d=n.getHeaders(),h=["content-type","content-length"];Object.entries(d).forEach(([l,v])=>{h.includes(l.toLowerCase())&&c.set(l,v)})}}if(W.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&Ho(e.url))){const d=s&&o&&zo.read(o);d&&c.set(s,d)}return e},Vo=typeof XMLHttpRequest<"u",Yo=Vo&&function(t){return new Promise(function(n,r){const s=$n(t);let o=s.data;const c=tt.from(s.headers).normalize();let{responseType:f,onUploadProgress:d,onDownloadProgress:h}=s,l,v,O,I,w;function F(){I&&I(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let m=new XMLHttpRequest;m.open(s.method.toUpperCase(),s.url,!0),m.timeout=s.timeout;function T(){if(!m)return;const g=tt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),x={data:!f||f==="text"||f==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:g,config:t,request:m};zn(function(C){n(C),F()},function(C){r(C),F()},x),m=null}"onloadend"in m?m.onloadend=T:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(T)},m.onabort=function(){m&&(r(new M("Request aborted",M.ECONNABORTED,t,m)),m=null)},m.onerror=function(S){const x=S&&S.message?S.message:"Network Error",A=new M(x,M.ERR_NETWORK,t,m);A.event=S||null,r(A),m=null},m.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const x=s.transitional||Ln;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),r(new M(S,x.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,t,m)),m=null},o===void 0&&c.setContentType(null),"setRequestHeader"in m&&y.forEach(c.toJSON(),function(S,x){m.setRequestHeader(x,S)}),y.isUndefined(s.withCredentials)||(m.withCredentials=!!s.withCredentials),f&&f!=="json"&&(m.responseType=s.responseType),h&&([O,w]=Yt(h,!0),m.addEventListener("progress",O)),d&&m.upload&&([v,I]=Yt(d),m.upload.addEventListener("progress",v),m.upload.addEventListener("loadend",I)),(s.cancelToken||s.signal)&&(l=g=>{m&&(r(!g||g.type?new Ot(null,t,m):g),m.abort(),m=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const b=ko(s.url);if(b&&W.protocols.indexOf(b)===-1){r(new M("Unsupported protocol "+b+":",M.ERR_BAD_REQUEST,t));return}m.send(o||null)})},Ko=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const o=function(h){if(!s){s=!0,f();const l=h instanceof Error?h:this.reason;r.abort(l instanceof M?l:new Ot(l instanceof Error?l.message:l))}};let c=e&&setTimeout(()=>{c=null,o(new M(`timeout ${e} of ms exceeded`,M.ETIMEDOUT))},e);const f=()=>{t&&(c&&clearTimeout(c),c=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),t=null)};t.forEach(h=>h.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>y.asap(f),d}},Jo=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},Wo=async function*(t,e){for await(const n of Zo(t))yield*Jo(n,e)},Zo=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Ke=(t,e,n,r)=>{const s=Wo(t,e);let o=0,c,f=d=>{c||(c=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:h,value:l}=await s.next();if(h){f(),d.close();return}let v=l.byteLength;if(n){let O=o+=v;n(O)}d.enqueue(new Uint8Array(l))}catch(h){throw f(h),h}},cancel(d){return f(d),s.return()}},{highWaterMark:2})},Je=64*1024,{isFunction:Lt}=y,Go=(({Request:t,Response:e})=>({Request:t,Response:e}))(y.global),{ReadableStream:We,TextEncoder:Ze}=y.global,Ge=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Xo=t=>{t=y.merge.call({skipUndefined:!0},Go,t);const{fetch:e,Request:n,Response:r}=t,s=e?Lt(e):typeof fetch=="function",o=Lt(n),c=Lt(r);if(!s)return!1;const f=s&&Lt(We),d=s&&(typeof Ze=="function"?(w=>F=>w.encode(F))(new Ze):async w=>new Uint8Array(await new n(w).arrayBuffer())),h=o&&f&&Ge(()=>{let w=!1;const F=new n(W.origin,{body:new We,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!F}),l=c&&f&&Ge(()=>y.isReadableStream(new r("").body)),v={stream:l&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!v[w]&&(v[w]=(F,m)=>{let T=F&&F[w];if(T)return T.call(F);throw new M(`Response type '${w}' is not supported`,M.ERR_NOT_SUPPORT,m)})});const O=async w=>{if(w==null)return 0;if(y.isBlob(w))return w.size;if(y.isSpecCompliantForm(w))return(await new n(W.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(y.isArrayBufferView(w)||y.isArrayBuffer(w))return w.byteLength;if(y.isURLSearchParams(w)&&(w=w+""),y.isString(w))return(await d(w)).byteLength},I=async(w,F)=>{const m=y.toFiniteNumber(w.getContentLength());return m??O(F)};return async w=>{let{url:F,method:m,data:T,signal:b,cancelToken:g,timeout:S,onDownloadProgress:x,onUploadProgress:A,responseType:C,headers:q,withCredentials:N="same-origin",fetchOptions:H}=$n(w),P=e||fetch;C=C?(C+"").toLowerCase():"text";let k=Ko([b,g&&g.toAbortSignal()],S),L=null;const U=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let J;try{if(A&&h&&m!=="get"&&m!=="head"&&(J=await I(q,T))!==0){let et=new n(F,{method:"POST",body:T,duplex:"half"}),D;if(y.isFormData(T)&&(D=et.headers.get("content-type"))&&q.setContentType(D),et.body){const[Ft,Tt]=$e(J,Yt(Ve(A)));T=Ke(et.body,Je,Ft,Tt)}}y.isString(N)||(N=N?"include":"omit");const V=o&&"credentials"in n.prototype,X={...H,signal:k,method:m.toUpperCase(),headers:q.normalize().toJSON(),body:T,duplex:"half",credentials:V?N:void 0};L=o&&new n(F,X);let Z=await(o?P(L,H):P(F,X));const pt=l&&(C==="stream"||C==="response");if(l&&(x||pt&&U)){const et={};["status","statusText","headers"].forEach(qt=>{et[qt]=Z[qt]});const D=y.toFiniteNumber(Z.headers.get("content-length")),[Ft,Tt]=x&&$e(D,Yt(Ve(x),!0))||[];Z=new r(Ke(Z.body,Je,Ft,()=>{Tt&&Tt(),U&&U()}),et)}C=C||"text";let vt=await v[y.findKey(v,C)||"text"](Z,w);return!pt&&U&&U(),await new Promise((et,D)=>{zn(et,D,{data:vt,headers:tt.from(Z.headers),status:Z.status,statusText:Z.statusText,config:w,request:L})})}catch(V){throw U&&U(),V&&V.name==="TypeError"&&/Load failed|fetch/i.test(V.message)?Object.assign(new M("Network Error",M.ERR_NETWORK,w,L),{cause:V.cause||V}):M.from(V,V&&V.code,w,L)}}},Qo=new Map,Vn=t=>{let e=t?t.env:{};const{fetch:n,Request:r,Response:s}=e,o=[r,s,n];let c=o.length,f=c,d,h,l=Qo;for(;f--;)d=o[f],h=l.get(d),h===void 0&&l.set(d,h=f?new Map:Xo(e)),l=h;return h};Vn();const Te={http:go,xhr:Yo,fetch:{get:Vn}};y.forEach(Te,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Xe=t=>`- ${t}`,ta=t=>y.isFunction(t)||t===null||t===!1,Yn={getAdapter:(t,e)=>{t=y.isArray(t)?t:[t];const{length:n}=t;let r,s;const o={};for(let c=0;c<n;c++){r=t[c];let f;if(s=r,!ta(r)&&(s=Te[(f=String(r)).toLowerCase()],s===void 0))throw new M(`Unknown adapter '${f}'`);if(s&&(y.isFunction(s)||(s=s.get(e))))break;o[f||"#"+c]=s}if(!s){const c=Object.entries(o).map(([d,h])=>`adapter ${d} `+(h===!1?"is not supported by the environment":"is not available in the build"));let f=n?c.length>1?`since :
|
|
4
4
|
`+c.map(Xe).join(`
|
|
5
5
|
`):" "+Xe(c[0]):"as no adapter specified";throw new M("There is no suitable adapter to dispatch the request "+f,"ERR_NOT_SUPPORT")}return s},adapters:Te};function ce(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Ot(null,t)}function Qe(t){return ce(t),t.headers=tt.from(t.headers),t.data=ae.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Yn.getAdapter(t.adapter||Pt.adapter,t)(t).then(function(r){return ce(t),r.data=ae.call(t,t.transformResponse,r),r.headers=tt.from(r.headers),r},function(r){return Hn(r)||(ce(t),r&&r.response&&(r.response.data=ae.call(t,t.transformResponse,r.response),r.response.headers=tt.from(r.response.headers))),Promise.reject(r)})}const Kn="1.12.2",Qt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Qt[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const tn={};Qt.transitional=function(e,n,r){function s(o,c){return"[Axios v"+Kn+"] Transitional option '"+o+"'"+c+(r?". "+r:"")}return(o,c,f)=>{if(e===!1)throw new M(s(c," has been removed"+(n?" in "+n:"")),M.ERR_DEPRECATED);return n&&!tn[c]&&(tn[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,c,f):!0}};Qt.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function ea(t,e,n){if(typeof t!="object")throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],c=e[o];if(c){const f=t[o],d=f===void 0||c(f,o,t);if(d!==!0)throw new M("option "+o+" must be "+d,M.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new M("Unknown option "+o,M.ERR_BAD_OPTION)}}const jt={assertOptions:ea,validators:Qt},ft=jt.validators;let bt=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ze,response:new ze}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
-
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=wt(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&jt.assertOptions(r,{silentJSONParsing:ft.transitional(ft.boolean),forcedJSONParsing:ft.transitional(ft.boolean),clarifyTimeoutError:ft.transitional(ft.boolean)},!1),s!=null&&(y.isFunction(s)?n.paramsSerializer={serialize:s}:jt.assertOptions(s,{encode:ft.function,serialize:ft.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jt.assertOptions(n,{baseUrl:ft.spelling("baseURL"),withXsrfToken:ft.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&y.merge(o.common,o[n.method]);o&&y.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=tt.concat(c,o);const f=[];let d=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(n)===!1||(d=d&&F.synchronous,f.unshift(F.fulfilled,F.rejected))});const h=[];this.interceptors.response.forEach(function(F){h.push(F.fulfilled,F.rejected)});let l,v=0,O;if(!d){const w=[Qe.bind(this),void 0];for(w.unshift(...f),w.push(...h),O=w.length,l=Promise.resolve(n);v<O;)l=l.then(w[v++],w[v++]);return l}O=f.length;let B=n;for(;v<O;){const w=f[v++],F=f[v++];try{B=w(B)}catch(m){F.call(this,m);break}}try{l=Qe.call(this,B)}catch(w){return Promise.reject(w)}for(v=0,O=h.length;v<O;)l=l.then(h[v++],h[v++]);return l}getUri(e){e=wt(this.defaults,e);const n=jn(e.baseURL,e.url,e.allowAbsoluteUrls);return kn(n,e.params,e.paramsSerializer)}};y.forEach(["delete","get","head","options"],function(e){bt.prototype[e]=function(n,r){return this.request(wt(r||{},{method:e,url:n,data:(r||{}).data}))}});y.forEach(["post","put","patch"],function(e){function n(r){return function(o,c,f){return this.request(wt(f||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}bt.prototype[e]=n(),bt.prototype[e+"Form"]=n(!0)});let na=class Jn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const c=new Promise(f=>{r.subscribe(f),o=f}).then(s);return c.cancel=function(){r.unsubscribe(o)},c},e(function(o,c,f){r.reason||(r.reason=new Ot(o,c,f),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Jn(function(s){e=s}),cancel:e}}};function ra(t){return function(n){return t.apply(null,n)}}function sa(t){return y.isObject(t)&&t.isAxiosError===!0}const Ee={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ee).forEach(([t,e])=>{Ee[e]=t});function Wn(t){const e=new bt(t),n=On(bt.prototype.request,e);return y.extend(n,bt.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return Wn(wt(t,s))},n}const $=Wn(Pt);$.Axios=bt;$.CanceledError=Ot;$.CancelToken=na;$.isCancel=Hn;$.VERSION=Kn;$.toFormData=Xt;$.AxiosError=M;$.Cancel=$.CanceledError;$.all=function(e){return Promise.all(e)};$.spread=ra;$.isAxiosError=sa;$.mergeConfig=wt;$.AxiosHeaders=tt;$.formToJSON=t=>Un(y.isHTMLForm(t)?new FormData(t):t);$.getAdapter=Yn.getAdapter;$.HttpStatusCode=Ee;$.default=$;const{Axios:hc,AxiosError:dc,CanceledError:pc,isCancel:mc,CancelToken:gc,VERSION:yc,all:xc,Cancel:bc,isAxiosError:wc,spread:vc,toFormData:Tc,AxiosHeaders:Ec,HttpStatusCode:Sc,formToJSON:Rc,getAdapter:Oc,mergeConfig:Fc}=$;class ia{constructor(){j(this,"pendingMap",new Map)}generateRequestKey(e){const{method:n,url:r,params:s,data:o}=e;return[n,r,JSON.stringify(s),JSON.stringify(o)].join("&")}addPending(e){this.removePending(e);const n=this.generateRequestKey(e),r=new AbortController;e.signal=r.signal,e.requestId=n,this.pendingMap.has(n)||this.pendingMap.set(n,r)}removePending(e){const n=this.generateRequestKey(e);if(this.pendingMap.has(n)){const r=this.pendingMap.get(n);r==null||r.abort("Request canceled due to duplicate request"),this.pendingMap.delete(n)}}clearPending(){this.pendingMap.forEach(e=>{e.abort("Request canceled due to application state change")}),this.pendingMap.clear()}getPendingCount(){return this.pendingMap.size}}class Gn{constructor(){j(this,"TOKEN_KEY","__AUTH_TOKEN");j(this,"REFRESH_TOKEN_KEY","__REFRESH_TOKEN");j(this,"TOKEN_EXPIRES_KEY","__TOKEN_EXPIRES_AT");j(this,"isRefreshing",!1);j(this,"refreshSubscribers",[])}setToken({accessToken:e,refreshToken:n,expiresIn:r}){if(ct.set(this.TOKEN_KEY,e),n&&ct.set(this.REFRESH_TOKEN_KEY,n),r){const s=Date.now()+r*1e3;ct.set(this.TOKEN_EXPIRES_KEY,s.toString())}}getAccessToken(){return ct.get(this.TOKEN_KEY)||""}getRefreshToken(){return ct.get(this.REFRESH_TOKEN_KEY)||""}clearToken(){ct.remove(this.TOKEN_KEY),ct.remove(this.REFRESH_TOKEN_KEY),ct.remove(this.TOKEN_EXPIRES_KEY)}isTokenExpiringSoon(){const e=Number(ct.get(this.TOKEN_EXPIRES_KEY)||0);return e?Date.now()>e-5*60*1e3:!1}subscribeTokenRefresh(e){this.refreshSubscribers.push(e)}onRefreshed(e){this.refreshSubscribers.forEach(n=>n(e)),this.refreshSubscribers=[]}async refreshToken(e,n){if(this.isRefreshing)return new Promise(r=>{this.subscribeTokenRefresh(r)});this.isRefreshing=!0;try{const r=this.getRefreshToken();if(!r)throw new Error("No refresh token available");if(typeof e!="function")throw new Error("No refresh request function provided");const s=await e(r);if(s.code===200&&s.data)return this.setToken(s.data),this.onRefreshed(s.data.accessToken),s.data.accessToken;throw new Error(s.msg||"Token refresh failed")}catch{return this.clearToken(),n&&typeof n=="function"&&n(),""}finally{this.isRefreshing=!1}}}class oa{constructor(e){j(this,"toastInstance");this.toastInstance=e}handleStatusError(e,n,r=!0){const s=En(e)||n||`Unknown error (${e})`;r&&this.toastInstance.error(s),console.error(`[HTTP Error ${e}]: ${s}`)}handleBusinessError(e,n,r=!0){const s=n||`Unknown business error (${e})`;r&&this.toastInstance.error(s),console.error(`[Business Error ${e}]: ${s}`)}handleNetworkError(e,n=!0){if(!navigator.onLine)return;let r="网络连接异常,请检查您的网络";if(e.message.includes("timeout"))r="网络请求超时,请稍后重试";else if(e.message.includes("Network Error"))r="网络连接异常,请检查您的网络";else{if(e.message.includes("canceled"))return;if(e.message.includes("aborted"))return}n&&this.toastInstance.error(r),console.error("[Network Error]:",e)}handleError(e,n=!0){var r;$.isAxiosError(e)?e.response?this.handleStatusError(e.response.status,((r=e.response.data)==null?void 0:r.message)||e.message,n):this.handleNetworkError(e,n):(n&&this.toastInstance.error((e==null?void 0:e.message)||"发生未知错误"),console.error("[Error]:",e))}}class Zn{constructor(e){j(this,"toastInstance");j(this,"status",navigator.onLine?"online":"offline");j(this,"offlineQueue",[]);j(this,"listeners",new Set);j(this,"initialized",!1);this.toastInstance=e,this.init()}init(){this.initialized||(window.addEventListener("online",this.handleOnline.bind(this)),window.addEventListener("offline",this.handleOffline.bind(this)),this.initialized=!0)}handleOnline(){const e=this.status;this.status="online",e!==this.status&&(this.notifyStatusChange(),this.offlineQueue.length>0?(this.toastInstance.info(`网络已恢复,正在处理 ${this.offlineQueue.length} 个待处理请求...`),this.processOfflineQueue()):this.toastInstance.success("网络已恢复连接"))}handleOffline(){const e=this.status;this.status="offline",e!==this.status&&(this.notifyStatusChange(),this.toastInstance.error("网络已断开,请检查您的网络连接",{duration:0}))}notifyStatusChange(){this.listeners.forEach(e=>{e(this.status)})}async processOfflineQueue(){if(this.status!=="online"||this.offlineQueue.length===0)return;const e=[...this.offlineQueue];this.offlineQueue=[];for(const n of e)try{const r=await fetch(n.config.url||"",{method:n.config.method,headers:n.config.headers,body:n.config.data?JSON.stringify(n.config.data):void 0}).then(s=>s.json());n.resolve(r)}catch(r){n.reject(r)}}addStatusChangeListener(e){this.listeners.add(e)}removeStatusChangeListener(e){this.listeners.delete(e)}getStatus(){return this.status}addToOfflineQueue(e){this.offlineQueue.push(e),this.toastInstance.warning(`网络离线中,请求已加入队列,恢复网络后将自动发送 (${this.offlineQueue.length})`)}clearOfflineQueue(){this.offlineQueue.forEach(e=>{e.reject(new Error("Offline request queue cleared"))}),this.offlineQueue=[]}getOfflineQueueLength(){return this.offlineQueue.length}}class aa{constructor(e){j(this,"axiosInstance");j(this,"errorInstance");j(this,"networkInstance");j(this,"cancelInstance");j(this,"tokenInstance");j(this,"loadingInstance");j(this,"requestOptions",{});j(this,"requestInstanceRequestOptions",{});j(this,"defaultRequestOptions",{showLoading:!1,cancelRepeatRequest:!0,needToken:!0,handleErrorStatus:!0,showErrorMessage:!0,queueWhenOffline:!0,retryWhenOnline:!0,maxRetries:0,retryDelay:1e3});j(this,"defaultConfig",{timeout:10*1e3,headers:{"Content-Type":"application/json;charset=utf-8"}});const{config:n={},requestOptions:r={},toastInstance:s,loadingInstance:o}=e;this.errorInstance=new oa(s),this.networkInstance=new Zn(s),this.cancelInstance=new ia,this.tokenInstance=new Gn,o&&(this.loadingInstance=o),this.requestOptions={...this.defaultRequestOptions,...r},this.axiosInstance=$.create({...this.defaultConfig,...n}),this.setupInterceptors(),this.setupNetworkListener()}setupNetworkListener(){this.networkInstance.addStatusChangeListener(e=>{var n;e==="online"?console.log("Network is back online"):e==="offline"&&(console.log("Network is offline"),(n=this.loadingInstance)==null||n.forceHide())})}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>{var O,B;const{showLoading:n,queueWhenOffline:r,cancelRepeatRequest:s,requestConfigHandler:o,needToken:c,refreshToken:f={},loadingOptions:d={}}=this.requestInstanceRequestOptions,{autoRefresh:h,refreshRequest:l,refrechFailed:v}=f;if(this.networkInstance.getStatus()==="offline"&&r)return new Promise((w,F)=>{const m={config:e,resolve:w,reject:F};this.networkInstance.addToOfflineQueue(m)});if(n&&((O=this.loadingInstance)==null||O.show(d)),s&&this.cancelInstance.addPending(e),o&&typeof o=="function"&&o(e,c),((B=e.method)==null?void 0:B.toUpperCase())==="GET"&&e.params){let w=`${e.url}?${Rn(e.params)}`;e.params={_t:new Date().getTime()},e.url=w.slice(0,-1)}return this.tokenInstance.isTokenExpiringSoon()&&h&&this.refreshTokenInBackend(l,v),e},e=>{var n;return(n=this.loadingInstance)==null||n.forceHide(),Promise.reject(e)}),this.axiosInstance.interceptors.response.use(e=>{var h;const n=e.config,{showLoading:r,cancelRepeatRequest:s,showErrorMessage:o,handleErrorStatus:c,businessErrorHandler:f}=this.requestInstanceRequestOptions;s&&this.cancelInstance.removePending(n),r&&((h=this.loadingInstance)==null||h.hide());const d=e.headers["content-type"];if(d!=null&&d.includes("application/octet-stream")||d!=null&&d.includes("application/vnd.ms-excel")||d!=null&&d.includes("application/vnd.openxmlformats-officedocument")||d!=null&&d.includes("application/pdf"))return e;if(e.data&&c){const{code:l,msg:v}=e.data;if(l!==200&&l!==0)return this.errorInstance.handleBusinessError(l,v,o),f&&typeof f=="function"&&f(l,v),Promise.reject(new Error(v))}return e.data},async e=>{var w,F,m,T;const n=e.config;if(!n)return(w=this.loadingInstance)==null||w.forceHide(),Promise.reject(e);const{showLoading:r,cancelRepeatRequest:s,showErrorMessage:o,handleErrorStatus:c,refreshToken:f={},retryDelay:d=1e3,maxRetries:h=0}=this.requestInstanceRequestOptions,{autoRefresh:l,refreshRequest:v,refrechFailed:O}=f,B=n.retryCount||0;if(n&&s&&this.cancelInstance.removePending(n),r&&((F=this.loadingInstance)==null||F.hide()),h>0&&B<h){const b={...n,retryCount:B+1};return await new Promise(g=>setTimeout(g,d)),console.log(`Retrying request (${B+1}/${h}): ${n.url}`),this.axiosInstance(b)}if(((m=e.response)==null?void 0:m.status)===401&&l&&this.tokenInstance.getRefreshToken())try{const b=await this.refreshToken(v,O);if(b&&n)return n.headers=n.headers||{},n.headers.Authorization=`Bearer ${b}`,this.axiosInstance(n)}catch(b){return Promise.reject(b)}return e.response&&c?this.errorInstance.handleStatusError(e.response.status,((T=e.response.data)==null?void 0:T.message)||e.message,o):e.request?this.errorInstance.handleNetworkError(e,o):(this.errorInstance.handleStatusError(909090,e.message,o),console.error("[Request Error]:",e)),Promise.reject(e)})}async refreshTokenInBackend(e,n){try{await this.refreshToken(e,n)}catch(r){console.error("Background token refresh failed:",r)}}async refreshToken(e,n){return this.tokenInstance.refreshToken(e,n)}async request(e,n={}){return this.requestInstanceRequestOptions={...this.requestOptions,...n},this.axiosInstance.request(e)}async get({url:e,params:n,config:r={},requestOptions:s={}}){return this.request({method:"GET",url:e,params:n,...r},s)}async post({url:e,data:n,config:r={},requestOptions:s={}}){return this.request({method:"POST",url:e,data:n,...r},s)}async put({url:e,data:n,config:r={},requestOptions:s={}}){return this.request({method:"PUT",url:e,data:n,...r},s)}async delete({url:e,data:n,config:r={},requestOptions:s={}}){return this.request({method:"DELETE",url:e,data:n,params:r==null?void 0:r.params,...r},s)}async upload({url:e,file:n,config:r={},requestOptions:s={}}){let o;return n instanceof FormData?o=n:(o=new FormData,o.append("file",n)),this.request({method:"POST",url:e,data:o,headers:{"Content-Type":"multipart/form-data"},...r},s)}async uploadMultiple({url:e,files:n,fileField:r="files",config:s={},requestOptions:o={}}){const c=new FormData;return n.forEach((f,d)=>{c.append(`${r}[${d}]`,f)}),this.upload({url:e,file:c,config:s,requestOptions:o})}async download({url:e,params:n,config:r={},requestOptions:s={}}){const o=s==null?void 0:s.fileName,c=await this.request({method:"GET",url:e,params:n,responseType:"blob",...r},s),f=new Blob([c.data]);let d=o;if(!d){const v=c.headers["content-disposition"];if(v){const B=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(v);B!=null&&B[1]&&(d=decodeURIComponent(B[1].replace(/['"]/g,"")))}d=d||"download"}const h=window.URL.createObjectURL(f),l=document.createElement("a");return l.href=h,l.download=d,document.body.appendChild(l),l.click(),document.body.removeChild(l),setTimeout(()=>{window.URL.revokeObjectURL(h)},100),f}async exportExcel({url:e,params:n,config:r={},fileName:s="export.xlsx",requestOptions:o={}}){return this.download({url:e,params:n,config:r,requestOptions:{fileName:s,showLoading:!0,loadingOptions:{text:"正在导出数据,请稍候..."},...o}})}cancelAllRequests(e="Request canceled"){this.cancelInstance.clearPending()}clearOfflineQueue(){this.networkInstance.clearOfflineQueue()}}let yt=null;function ca(t){const{cacheKey:e,cacheMode:n="session",saveState:r=!0,handler:s}=t;return r&&yt||(yt=n==="local"?mn.get(e):ct.get(e),yt&&typeof s=="function"&&(yt=s(yt))),yt}var Xn=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(s,o){return s[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),s=this.__entries__[r];return s&&s[1]},e.prototype.set=function(n,r){var s=t(this.__entries__,n);~s?this.__entries__[s][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,s=t(r,n);~s&&r.splice(s,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(r,c[1],c[0])}},e}()}(),Se=typeof window<"u"&&typeof document<"u"&&window.document===document,Kt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),ua=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Kt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),fa=2;function la(t,e){var n=!1,r=!1,s=0;function o(){n&&(n=!1,t()),r&&f()}function c(){ua(o)}function f(){var d=Date.now();if(n){if(d-s<fa)return;r=!0}else n=!0,r=!1,setTimeout(c,e);s=d}return f}var ha=20,da=["top","right","bottom","left","width","height","size","weight"],pa=typeof MutationObserver<"u",ma=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=la(this.refresh.bind(this),ha)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!Se||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),pa?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!Se||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,s=da.some(function(o){return!!~r.indexOf(o)});s&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Qn=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var s=r[n];Object.defineProperty(t,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return t},St=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Kt},tr=te(0,0,0,0);function Jt(t){return parseFloat(t)||0}function en(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,s){var o=t["border-"+s+"-width"];return r+Jt(o)},0)}function ga(t){for(var e=["top","right","bottom","left"],n={},r=0,s=e;r<s.length;r++){var o=s[r],c=t["padding-"+o];n[o]=Jt(c)}return n}function ya(t){var e=t.getBBox();return te(0,0,e.width,e.height)}function xa(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return tr;var r=St(t).getComputedStyle(t),s=ga(r),o=s.left+s.right,c=s.top+s.bottom,f=Jt(r.width),d=Jt(r.height);if(r.boxSizing==="border-box"&&(Math.round(f+o)!==e&&(f-=en(r,"left","right")+o),Math.round(d+c)!==n&&(d-=en(r,"top","bottom")+c)),!wa(t)){var h=Math.round(f+o)-e,l=Math.round(d+c)-n;Math.abs(h)!==1&&(f-=h),Math.abs(l)!==1&&(d-=l)}return te(s.left,s.top,f,d)}var ba=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof St(t).SVGGraphicsElement}:function(t){return t instanceof St(t).SVGElement&&typeof t.getBBox=="function"}}();function wa(t){return t===St(t).document.documentElement}function va(t){return Se?ba(t)?ya(t):xa(t):tr}function Ta(t){var e=t.x,n=t.y,r=t.width,s=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return Qn(c,{x:e,y:n,width:r,height:s,top:n,right:e+r,bottom:s+n,left:e}),c}function te(t,e,n,r){return{x:t,y:e,width:n,height:r}}var Ea=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=te(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=va(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Sa=function(){function t(e,n){var r=Ta(n);Qn(this,{target:e,contentRect:r})}return t}(),Ra=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new Xn,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof St(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new Ea(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof St(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Sa(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),er=typeof WeakMap<"u"?new WeakMap:new Xn,nr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ma.getInstance(),r=new Ra(e,n,this);er.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){nr.prototype[t]=function(){var e;return(e=er.get(this))[t].apply(e,arguments)}});var Oa=function(){return typeof Kt.ResizeObserver<"u"?Kt.ResizeObserver:nr}();function Fa(t){for(const e of t){const n=e.target.__resizeListeners__||[];n.length&&n.forEach(r=>r())}}function Aa(t,e){typeof window>"u"||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new Oa(Fa),t.__ro__.observe(t)),t.__resizeListeners__.push(e))}function _a(t,e){!t||!t.__resizeListeners__||(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||t.__ro__.disconnect())}var $t={exports:{}},Ia=$t.exports,nn;function ee(){return nn||(nn=1,function(t,e){(function(){var n,r=0xdeadbeefcafe,s=(r&16777215)==15715070;function o(i,a,u){i!=null&&(typeof i=="number"?this.fromNumber(i,a,u):a==null&&typeof i!="string"?this.fromString(i,256):this.fromString(i,a))}function c(){return new o(null)}function f(i,a,u,p,E,R){for(;--R>=0;){var _=a*this[i++]+u[p]+E;E=Math.floor(_/67108864),u[p++]=_&67108863}return E}function d(i,a,u,p,E,R){for(var _=a&32767,I=a>>15;--R>=0;){var z=this[i]&32767,K=this[i++]>>15,st=I*z+K*_;z=_*z+((st&32767)<<15)+u[p]+(E&1073741823),E=(z>>>30)+(st>>>15)+I*K+(E>>>30),u[p++]=z&1073741823}return E}function h(i,a,u,p,E,R){for(var _=a&16383,I=a>>14;--R>=0;){var z=this[i]&16383,K=this[i++]>>14,st=I*z+K*_;z=_*z+((st&16383)<<14)+u[p]+E,E=(z>>28)+(st>>14)+I*K,u[p++]=z&268435455}return E}var l=typeof navigator<"u";l&&s&&navigator.appName=="Microsoft Internet Explorer"?(o.prototype.am=d,n=30):l&&s&&navigator.appName!="Netscape"?(o.prototype.am=f,n=26):(o.prototype.am=h,n=28),o.prototype.DB=n,o.prototype.DM=(1<<n)-1,o.prototype.DV=1<<n;var v=52;o.prototype.FV=Math.pow(2,v),o.prototype.F1=v-n,o.prototype.F2=2*n-v;var O="0123456789abcdefghijklmnopqrstuvwxyz",B=new Array,w,F;for(w=48,F=0;F<=9;++F)B[w++]=F;for(w=97,F=10;F<36;++F)B[w++]=F;for(w=65,F=10;F<36;++F)B[w++]=F;function m(i){return O.charAt(i)}function T(i,a){var u=B[i.charCodeAt(a)];return u??-1}function b(i){for(var a=this.t-1;a>=0;--a)i[a]=this[a];i.t=this.t,i.s=this.s}function g(i){this.t=1,this.s=i<0?-1:0,i>0?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0}function S(i){var a=c();return a.fromInt(i),a}function x(i,a){var u;if(a==16)u=4;else if(a==8)u=3;else if(a==256)u=8;else if(a==2)u=1;else if(a==32)u=5;else if(a==4)u=2;else{this.fromRadix(i,a);return}this.t=0,this.s=0;for(var p=i.length,E=!1,R=0;--p>=0;){var _=u==8?i[p]&255:T(i,p);if(_<0){i.charAt(p)=="-"&&(E=!0);continue}E=!1,R==0?this[this.t++]=_:R+u>this.DB?(this[this.t-1]|=(_&(1<<this.DB-R)-1)<<R,this[this.t++]=_>>this.DB-R):this[this.t-1]|=_<<R,R+=u,R>=this.DB&&(R-=this.DB)}u==8&&(i[0]&128)!=0&&(this.s=-1,R>0&&(this[this.t-1]|=(1<<this.DB-R)-1<<R)),this.clamp(),E&&o.ZERO.subTo(this,this)}function A(){for(var i=this.s&this.DM;this.t>0&&this[this.t-1]==i;)--this.t}function C(i){if(this.s<0)return"-"+this.negate().toString(i);var a;if(i==16)a=4;else if(i==8)a=3;else if(i==2)a=1;else if(i==32)a=5;else if(i==4)a=2;else return this.toRadix(i);var u=(1<<a)-1,p,E=!1,R="",_=this.t,I=this.DB-_*this.DB%a;if(_-- >0)for(I<this.DB&&(p=this[_]>>I)>0&&(E=!0,R=m(p));_>=0;)I<a?(p=(this[_]&(1<<I)-1)<<a-I,p|=this[--_]>>(I+=this.DB-a)):(p=this[_]>>(I-=a)&u,I<=0&&(I+=this.DB,--_)),p>0&&(E=!0),E&&(R+=m(p));return E?R:"0"}function q(){var i=c();return o.ZERO.subTo(this,i),i}function N(){return this.s<0?this.negate():this}function H(i){var a=this.s-i.s;if(a!=0)return a;var u=this.t;if(a=u-i.t,a!=0)return this.s<0?-a:a;for(;--u>=0;)if((a=this[u]-i[u])!=0)return a;return 0}function P(i){var a=1,u;return(u=i>>>16)!=0&&(i=u,a+=16),(u=i>>8)!=0&&(i=u,a+=8),(u=i>>4)!=0&&(i=u,a+=4),(u=i>>2)!=0&&(i=u,a+=2),(u=i>>1)!=0&&(i=u,a+=1),a}function k(){return this.t<=0?0:this.DB*(this.t-1)+P(this[this.t-1]^this.s&this.DM)}function L(i,a){var u;for(u=this.t-1;u>=0;--u)a[u+i]=this[u];for(u=i-1;u>=0;--u)a[u]=0;a.t=this.t+i,a.s=this.s}function U(i,a){for(var u=i;u<this.t;++u)a[u-i]=this[u];a.t=Math.max(this.t-i,0),a.s=this.s}function J(i,a){var u=i%this.DB,p=this.DB-u,E=(1<<p)-1,R=Math.floor(i/this.DB),_=this.s<<u&this.DM,I;for(I=this.t-1;I>=0;--I)a[I+R+1]=this[I]>>p|_,_=(this[I]&E)<<u;for(I=R-1;I>=0;--I)a[I]=0;a[R]=_,a.t=this.t+R+1,a.s=this.s,a.clamp()}function V(i,a){a.s=this.s;var u=Math.floor(i/this.DB);if(u>=this.t){a.t=0;return}var p=i%this.DB,E=this.DB-p,R=(1<<p)-1;a[0]=this[u]>>p;for(var _=u+1;_<this.t;++_)a[_-u-1]|=(this[_]&R)<<E,a[_-u]=this[_]>>p;p>0&&(a[this.t-u-1]|=(this.s&R)<<E),a.t=this.t-u,a.clamp()}function X(i,a){for(var u=0,p=0,E=Math.min(i.t,this.t);u<E;)p+=this[u]-i[u],a[u++]=p&this.DM,p>>=this.DB;if(i.t<this.t){for(p-=i.s;u<this.t;)p+=this[u],a[u++]=p&this.DM,p>>=this.DB;p+=this.s}else{for(p+=this.s;u<i.t;)p-=i[u],a[u++]=p&this.DM,p>>=this.DB;p-=i.s}a.s=p<0?-1:0,p<-1?a[u++]=this.DV+p:p>0&&(a[u++]=p),a.t=u,a.clamp()}function G(i,a){var u=this.abs(),p=i.abs(),E=u.t;for(a.t=E+p.t;--E>=0;)a[E]=0;for(E=0;E<p.t;++E)a[E+u.t]=u.am(0,p[E],a,E,0,u.t);a.s=0,a.clamp(),this.s!=i.s&&o.ZERO.subTo(a,a)}function pt(i){for(var a=this.abs(),u=i.t=2*a.t;--u>=0;)i[u]=0;for(u=0;u<a.t-1;++u){var p=a.am(u,a[u],i,2*u,0,1);(i[u+a.t]+=a.am(u+1,2*a[u],i,2*u+1,p,a.t-u-1))>=a.DV&&(i[u+a.t]-=a.DV,i[u+a.t+1]=1)}i.t>0&&(i[i.t-1]+=a.am(u,a[u],i,2*u,0,1)),i.s=0,i.clamp()}function vt(i,a,u){var p=i.abs();if(!(p.t<=0)){var E=this.abs();if(E.t<p.t){a!=null&&a.fromInt(0),u!=null&&this.copyTo(u);return}u==null&&(u=c());var R=c(),_=this.s,I=i.s,z=this.DB-P(p[p.t-1]);z>0?(p.lShiftTo(z,R),E.lShiftTo(z,u)):(p.copyTo(R),E.copyTo(u));var K=R.t,st=R[K-1];if(st!=0){var rt=st*(1<<this.F1)+(K>1?R[K-2]>>this.F2:0),lt=this.FV/rt,Nt=(1<<this.F1)/rt,ot=1<<this.F2,at=u.t,kt=at-K,ht=a??c();for(R.dlShiftTo(kt,ht),u.compareTo(ht)>=0&&(u[u.t++]=1,u.subTo(ht,u)),o.ONE.dlShiftTo(K,ht),ht.subTo(R,R);R.t<K;)R[R.t++]=0;for(;--kt>=0;){var ie=u[--at]==st?this.DM:Math.floor(u[at]*lt+(u[at-1]+ot)*Nt);if((u[at]+=R.am(0,ie,u,kt,0,K))<ie)for(R.dlShiftTo(kt,ht),u.subTo(ht,u);u[at]<--ie;)u.subTo(ht,u)}a!=null&&(u.drShiftTo(K,a),_!=I&&o.ZERO.subTo(a,a)),u.t=K,u.clamp(),z>0&&u.rShiftTo(z,u),_<0&&o.ZERO.subTo(u,u)}}}function et(i){var a=c();return this.abs().divRemTo(i,null,a),this.s<0&&a.compareTo(o.ZERO)>0&&i.subTo(a,a),a}function D(i){this.m=i}function Ft(i){return i.s<0||i.compareTo(this.m)>=0?i.mod(this.m):i}function Tt(i){return i}function qt(i){i.divRemTo(this.m,null,i)}function ir(i,a,u){i.multiplyTo(a,u),this.reduce(u)}function or(i,a){i.squareTo(a),this.reduce(a)}D.prototype.convert=Ft,D.prototype.revert=Tt,D.prototype.reduce=qt,D.prototype.mulTo=ir,D.prototype.sqrTo=or;function ar(){if(this.t<1)return 0;var i=this[0];if((i&1)==0)return 0;var a=i&3;return a=a*(2-(i&15)*a)&15,a=a*(2-(i&255)*a)&255,a=a*(2-((i&65535)*a&65535))&65535,a=a*(2-i*a%this.DV)%this.DV,a>0?this.DV-a:-a}function mt(i){this.m=i,this.mp=i.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<i.DB-15)-1,this.mt2=2*i.t}function cr(i){var a=c();return i.abs().dlShiftTo(this.m.t,a),a.divRemTo(this.m,null,a),i.s<0&&a.compareTo(o.ZERO)>0&&this.m.subTo(a,a),a}function ur(i){var a=c();return i.copyTo(a),this.reduce(a),a}function fr(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(var a=0;a<this.m.t;++a){var u=i[a]&32767,p=u*this.mpl+((u*this.mph+(i[a]>>15)*this.mpl&this.um)<<15)&i.DM;for(u=a+this.m.t,i[u]+=this.m.am(0,p,i,a,0,this.m.t);i[u]>=i.DV;)i[u]-=i.DV,i[++u]++}i.clamp(),i.drShiftTo(this.m.t,i),i.compareTo(this.m)>=0&&i.subTo(this.m,i)}function lr(i,a){i.squareTo(a),this.reduce(a)}function hr(i,a,u){i.multiplyTo(a,u),this.reduce(u)}mt.prototype.convert=cr,mt.prototype.revert=ur,mt.prototype.reduce=fr,mt.prototype.mulTo=hr,mt.prototype.sqrTo=lr;function dr(){return(this.t>0?this[0]&1:this.s)==0}function pr(i,a){if(i>4294967295||i<1)return o.ONE;var u=c(),p=c(),E=a.convert(this),R=P(i)-1;for(E.copyTo(u);--R>=0;)if(a.sqrTo(u,p),(i&1<<R)>0)a.mulTo(p,E,u);else{var _=u;u=p,p=_}return a.revert(u)}function mr(i,a){var u;return i<256||a.isEven()?u=new D(a):u=new mt(a),this.exp(i,u)}o.prototype.copyTo=b,o.prototype.fromInt=g,o.prototype.fromString=x,o.prototype.clamp=A,o.prototype.dlShiftTo=L,o.prototype.drShiftTo=U,o.prototype.lShiftTo=J,o.prototype.rShiftTo=V,o.prototype.subTo=X,o.prototype.multiplyTo=G,o.prototype.squareTo=pt,o.prototype.divRemTo=vt,o.prototype.invDigit=ar,o.prototype.isEven=dr,o.prototype.exp=pr,o.prototype.toString=C,o.prototype.negate=q,o.prototype.abs=N,o.prototype.compareTo=H,o.prototype.bitLength=k,o.prototype.mod=et,o.prototype.modPowInt=mr,o.ZERO=S(0),o.ONE=S(1);function gr(){var i=c();return this.copyTo(i),i}function yr(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function xr(){return this.t==0?this.s:this[0]<<24>>24}function br(){return this.t==0?this.s:this[0]<<16>>16}function wr(i){return Math.floor(Math.LN2*this.DB/Math.log(i))}function vr(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Tr(i){if(i==null&&(i=10),this.signum()==0||i<2||i>36)return"0";var a=this.chunkSize(i),u=Math.pow(i,a),p=S(u),E=c(),R=c(),_="";for(this.divRemTo(p,E,R);E.signum()>0;)_=(u+R.intValue()).toString(i).substr(1)+_,E.divRemTo(p,E,R);return R.intValue().toString(i)+_}function Er(i,a){this.fromInt(0),a==null&&(a=10);for(var u=this.chunkSize(a),p=Math.pow(a,u),E=!1,R=0,_=0,I=0;I<i.length;++I){var z=T(i,I);if(z<0){i.charAt(I)=="-"&&this.signum()==0&&(E=!0);continue}_=a*_+z,++R>=u&&(this.dMultiply(p),this.dAddOffset(_,0),R=0,_=0)}R>0&&(this.dMultiply(Math.pow(a,R)),this.dAddOffset(_,0)),E&&o.ZERO.subTo(this,this)}function Sr(i,a,u){if(typeof a=="number")if(i<2)this.fromInt(1);else for(this.fromNumber(i,u),this.testBit(i-1)||this.bitwiseTo(o.ONE.shiftLeft(i-1),ne,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(a);)this.dAddOffset(2,0),this.bitLength()>i&&this.subTo(o.ONE.shiftLeft(i-1),this);else{var p=new Array,E=i&7;p.length=(i>>3)+1,a.nextBytes(p),E>0?p[0]&=(1<<E)-1:p[0]=0,this.fromString(p,256)}}function Rr(){var i=this.t,a=new Array;a[0]=this.s;var u=this.DB-i*this.DB%8,p,E=0;if(i-- >0)for(u<this.DB&&(p=this[i]>>u)!=(this.s&this.DM)>>u&&(a[E++]=p|this.s<<this.DB-u);i>=0;)u<8?(p=(this[i]&(1<<u)-1)<<8-u,p|=this[--i]>>(u+=this.DB-8)):(p=this[i]>>(u-=8)&255,u<=0&&(u+=this.DB,--i)),(p&128)!=0&&(p|=-256),E==0&&(this.s&128)!=(p&128)&&++E,(E>0||p!=this.s)&&(a[E++]=p);return a}function Or(i){return this.compareTo(i)==0}function Fr(i){return this.compareTo(i)<0?this:i}function Ar(i){return this.compareTo(i)>0?this:i}function _r(i,a,u){var p,E,R=Math.min(i.t,this.t);for(p=0;p<R;++p)u[p]=a(this[p],i[p]);if(i.t<this.t){for(E=i.s&this.DM,p=R;p<this.t;++p)u[p]=a(this[p],E);u.t=this.t}else{for(E=this.s&this.DM,p=R;p<i.t;++p)u[p]=a(E,i[p]);u.t=i.t}u.s=a(this.s,i.s),u.clamp()}function Ir(i,a){return i&a}function Br(i){var a=c();return this.bitwiseTo(i,Ir,a),a}function ne(i,a){return i|a}function Cr(i){var a=c();return this.bitwiseTo(i,ne,a),a}function Ce(i,a){return i^a}function Dr(i){var a=c();return this.bitwiseTo(i,Ce,a),a}function De(i,a){return i&~a}function Pr(i){var a=c();return this.bitwiseTo(i,De,a),a}function qr(){for(var i=c(),a=0;a<this.t;++a)i[a]=this.DM&~this[a];return i.t=this.t,i.s=~this.s,i}function Mr(i){var a=c();return i<0?this.rShiftTo(-i,a):this.lShiftTo(i,a),a}function Nr(i){var a=c();return i<0?this.lShiftTo(-i,a):this.rShiftTo(i,a),a}function kr(i){if(i==0)return-1;var a=0;return(i&65535)==0&&(i>>=16,a+=16),(i&255)==0&&(i>>=8,a+=8),(i&15)==0&&(i>>=4,a+=4),(i&3)==0&&(i>>=2,a+=2),(i&1)==0&&++a,a}function Lr(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+kr(this[i]);return this.s<0?this.t*this.DB:-1}function Ur(i){for(var a=0;i!=0;)i&=i-1,++a;return a}function Hr(){for(var i=0,a=this.s&this.DM,u=0;u<this.t;++u)i+=Ur(this[u]^a);return i}function zr(i){var a=Math.floor(i/this.DB);return a>=this.t?this.s!=0:(this[a]&1<<i%this.DB)!=0}function jr(i,a){var u=o.ONE.shiftLeft(i);return this.bitwiseTo(u,a,u),u}function $r(i){return this.changeBit(i,ne)}function Vr(i){return this.changeBit(i,De)}function Yr(i){return this.changeBit(i,Ce)}function Kr(i,a){for(var u=0,p=0,E=Math.min(i.t,this.t);u<E;)p+=this[u]+i[u],a[u++]=p&this.DM,p>>=this.DB;if(i.t<this.t){for(p+=i.s;u<this.t;)p+=this[u],a[u++]=p&this.DM,p>>=this.DB;p+=this.s}else{for(p+=this.s;u<i.t;)p+=i[u],a[u++]=p&this.DM,p>>=this.DB;p+=i.s}a.s=p<0?-1:0,p>0?a[u++]=p:p<-1&&(a[u++]=this.DV+p),a.t=u,a.clamp()}function Jr(i){var a=c();return this.addTo(i,a),a}function Wr(i){var a=c();return this.subTo(i,a),a}function Gr(i){var a=c();return this.multiplyTo(i,a),a}function Zr(){var i=c();return this.squareTo(i),i}function Xr(i){var a=c();return this.divRemTo(i,a,null),a}function Qr(i){var a=c();return this.divRemTo(i,null,a),a}function ts(i){var a=c(),u=c();return this.divRemTo(i,a,u),new Array(a,u)}function es(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp()}function ns(i,a){if(i!=0){for(;this.t<=a;)this[this.t++]=0;for(this[a]+=i;this[a]>=this.DV;)this[a]-=this.DV,++a>=this.t&&(this[this.t++]=0),++this[a]}}function At(){}function Pe(i){return i}function rs(i,a,u){i.multiplyTo(a,u)}function ss(i,a){i.squareTo(a)}At.prototype.convert=Pe,At.prototype.revert=Pe,At.prototype.mulTo=rs,At.prototype.sqrTo=ss;function is(i){return this.exp(i,new At)}function os(i,a,u){var p=Math.min(this.t+i.t,a);for(u.s=0,u.t=p;p>0;)u[--p]=0;var E;for(E=u.t-this.t;p<E;++p)u[p+this.t]=this.am(0,i[p],u,p,0,this.t);for(E=Math.min(i.t,a);p<E;++p)this.am(0,i[p],u,p,0,a-p);u.clamp()}function as(i,a,u){--a;var p=u.t=this.t+i.t-a;for(u.s=0;--p>=0;)u[p]=0;for(p=Math.max(a-this.t,0);p<i.t;++p)u[this.t+p-a]=this.am(a-p,i[p],u,0,0,this.t+p-a);u.clamp(),u.drShiftTo(1,u)}function gt(i){this.r2=c(),this.q3=c(),o.ONE.dlShiftTo(2*i.t,this.r2),this.mu=this.r2.divide(i),this.m=i}function cs(i){if(i.s<0||i.t>2*this.m.t)return i.mod(this.m);if(i.compareTo(this.m)<0)return i;var a=c();return i.copyTo(a),this.reduce(a),a}function us(i){return i}function fs(i){for(i.drShiftTo(this.m.t-1,this.r2),i.t>this.m.t+1&&(i.t=this.m.t+1,i.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);i.compareTo(this.r2)<0;)i.dAddOffset(1,this.m.t+1);for(i.subTo(this.r2,i);i.compareTo(this.m)>=0;)i.subTo(this.m,i)}function ls(i,a){i.squareTo(a),this.reduce(a)}function hs(i,a,u){i.multiplyTo(a,u),this.reduce(u)}gt.prototype.convert=cs,gt.prototype.revert=us,gt.prototype.reduce=fs,gt.prototype.mulTo=hs,gt.prototype.sqrTo=ls;function ds(i,a){var u=i.bitLength(),p,E=S(1),R;if(u<=0)return E;u<18?p=1:u<48?p=3:u<144?p=4:u<768?p=5:p=6,u<8?R=new D(a):a.isEven()?R=new gt(a):R=new mt(a);var _=new Array,I=3,z=p-1,K=(1<<p)-1;if(_[1]=R.convert(this),p>1){var st=c();for(R.sqrTo(_[1],st);I<=K;)_[I]=c(),R.mulTo(st,_[I-2],_[I]),I+=2}var rt=i.t-1,lt,Nt=!0,ot=c(),at;for(u=P(i[rt])-1;rt>=0;){for(u>=z?lt=i[rt]>>u-z&K:(lt=(i[rt]&(1<<u+1)-1)<<z-u,rt>0&&(lt|=i[rt-1]>>this.DB+u-z)),I=p;(lt&1)==0;)lt>>=1,--I;if((u-=I)<0&&(u+=this.DB,--rt),Nt)_[lt].copyTo(E),Nt=!1;else{for(;I>1;)R.sqrTo(E,ot),R.sqrTo(ot,E),I-=2;I>0?R.sqrTo(E,ot):(at=E,E=ot,ot=at),R.mulTo(ot,_[lt],E)}for(;rt>=0&&(i[rt]&1<<u)==0;)R.sqrTo(E,ot),at=E,E=ot,ot=at,--u<0&&(u=this.DB-1,--rt)}return R.revert(E)}function ps(i){var a=this.s<0?this.negate():this.clone(),u=i.s<0?i.negate():i.clone();if(a.compareTo(u)<0){var p=a;a=u,u=p}var E=a.getLowestSetBit(),R=u.getLowestSetBit();if(R<0)return a;for(E<R&&(R=E),R>0&&(a.rShiftTo(R,a),u.rShiftTo(R,u));a.signum()>0;)(E=a.getLowestSetBit())>0&&a.rShiftTo(E,a),(E=u.getLowestSetBit())>0&&u.rShiftTo(E,u),a.compareTo(u)>=0?(a.subTo(u,a),a.rShiftTo(1,a)):(u.subTo(a,u),u.rShiftTo(1,u));return R>0&&u.lShiftTo(R,u),u}function ms(i){if(i<=0)return 0;var a=this.DV%i,u=this.s<0?i-1:0;if(this.t>0)if(a==0)u=this[0]%i;else for(var p=this.t-1;p>=0;--p)u=(a*u+this[p])%i;return u}function gs(i){var a=i.isEven();if(this.isEven()&&a||i.signum()==0)return o.ZERO;for(var u=i.clone(),p=this.clone(),E=S(1),R=S(0),_=S(0),I=S(1);u.signum()!=0;){for(;u.isEven();)u.rShiftTo(1,u),a?((!E.isEven()||!R.isEven())&&(E.addTo(this,E),R.subTo(i,R)),E.rShiftTo(1,E)):R.isEven()||R.subTo(i,R),R.rShiftTo(1,R);for(;p.isEven();)p.rShiftTo(1,p),a?((!_.isEven()||!I.isEven())&&(_.addTo(this,_),I.subTo(i,I)),_.rShiftTo(1,_)):I.isEven()||I.subTo(i,I),I.rShiftTo(1,I);u.compareTo(p)>=0?(u.subTo(p,u),a&&E.subTo(_,E),R.subTo(I,R)):(p.subTo(u,p),a&&_.subTo(E,_),I.subTo(R,I))}if(p.compareTo(o.ONE)!=0)return o.ZERO;if(I.compareTo(i)>=0)return I.subtract(i);if(I.signum()<0)I.addTo(i,I);else return I;return I.signum()<0?I.add(i):I}var Z=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ys=(1<<26)/Z[Z.length-1];function xs(i){var a,u=this.abs();if(u.t==1&&u[0]<=Z[Z.length-1]){for(a=0;a<Z.length;++a)if(u[0]==Z[a])return!0;return!1}if(u.isEven())return!1;for(a=1;a<Z.length;){for(var p=Z[a],E=a+1;E<Z.length&&p<ys;)p*=Z[E++];for(p=u.modInt(p);a<E;)if(p%Z[a++]==0)return!1}return u.millerRabin(i)}function bs(i){var a=this.subtract(o.ONE),u=a.getLowestSetBit();if(u<=0)return!1;var p=a.shiftRight(u);i=i+1>>1,i>Z.length&&(i=Z.length);for(var E=c(),R=0;R<i;++R){E.fromInt(Z[Math.floor(Math.random()*Z.length)]);var _=E.modPow(p,this);if(_.compareTo(o.ONE)!=0&&_.compareTo(a)!=0){for(var I=1;I++<u&&_.compareTo(a)!=0;)if(_=_.modPowInt(2,this),_.compareTo(o.ONE)==0)return!1;if(_.compareTo(a)!=0)return!1}}return!0}o.prototype.chunkSize=wr,o.prototype.toRadix=Tr,o.prototype.fromRadix=Er,o.prototype.fromNumber=Sr,o.prototype.bitwiseTo=_r,o.prototype.changeBit=jr,o.prototype.addTo=Kr,o.prototype.dMultiply=es,o.prototype.dAddOffset=ns,o.prototype.multiplyLowerTo=os,o.prototype.multiplyUpperTo=as,o.prototype.modInt=ms,o.prototype.millerRabin=bs,o.prototype.clone=gr,o.prototype.intValue=yr,o.prototype.byteValue=xr,o.prototype.shortValue=br,o.prototype.signum=vr,o.prototype.toByteArray=Rr,o.prototype.equals=Or,o.prototype.min=Fr,o.prototype.max=Ar,o.prototype.and=Br,o.prototype.or=Cr,o.prototype.xor=Dr,o.prototype.andNot=Pr,o.prototype.not=qr,o.prototype.shiftLeft=Mr,o.prototype.shiftRight=Nr,o.prototype.getLowestSetBit=Lr,o.prototype.bitCount=Hr,o.prototype.testBit=zr,o.prototype.setBit=$r,o.prototype.clearBit=Vr,o.prototype.flipBit=Yr,o.prototype.add=Jr,o.prototype.subtract=Wr,o.prototype.multiply=Gr,o.prototype.divide=Xr,o.prototype.remainder=Qr,o.prototype.divideAndRemainder=ts,o.prototype.modPow=ds,o.prototype.modInverse=gs,o.prototype.pow=is,o.prototype.gcd=ps,o.prototype.isProbablePrime=xs,o.prototype.square=Zr,o.prototype.Barrett=gt;var Mt,nt,Y;function ws(i){nt[Y++]^=i&255,nt[Y++]^=i>>8&255,nt[Y++]^=i>>16&255,nt[Y++]^=i>>24&255,Y>=se&&(Y-=se)}function qe(){ws(new Date().getTime())}if(nt==null){nt=new Array,Y=0;var it;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var Me=new Uint8Array(32);for(window.crypto.getRandomValues(Me),it=0;it<32;++it)nt[Y++]=Me[it]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Ne=window.crypto.random(32);for(it=0;it<Ne.length;++it)nt[Y++]=Ne.charCodeAt(it)&255}}for(;Y<se;)it=Math.floor(65536*Math.random()),nt[Y++]=it>>>8,nt[Y++]=it&255;Y=0,qe()}function vs(){if(Mt==null){for(qe(),Mt=Rs(),Mt.init(nt),Y=0;Y<nt.length;++Y)nt[Y]=0;Y=0}return Mt.next()}function Ts(i){var a;for(a=0;a<i.length;++a)i[a]=vs()}function ke(){}ke.prototype.nextBytes=Ts;function re(){this.i=0,this.j=0,this.S=new Array}function Es(i){var a,u,p;for(a=0;a<256;++a)this.S[a]=a;for(u=0,a=0;a<256;++a)u=u+this.S[a]+i[a%i.length]&255,p=this.S[a],this.S[a]=this.S[u],this.S[u]=p;this.i=0,this.j=0}function Ss(){var i;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,i=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=i,this.S[i+this.S[this.i]&255]}re.prototype.init=Es,re.prototype.next=Ss;function Rs(){return new re}var se=256;t.exports={default:o,BigInteger:o,SecureRandom:ke}}).call(Ia)}($t)),$t.exports}var ue,rn;function Ba(){if(rn)return ue;rn=1;const{BigInteger:t}=ee();function e(d){let h=d.toString(16);if(h[0]!=="-")h.length%2===1?h="0"+h:h.match(/^[0-7]/)||(h="00"+h);else{h=h.substr(1);let l=h.length;l%2===1?l+=1:h.match(/^[0-7]/)||(l+=2);let v="";for(let O=0;O<l;O++)v+="f";v=new t(v,16),h=v.xor(d).add(t.ONE),h=h.toString(16).replace(/^-/,"")}return h}class n{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const h=this.v.length/2;let l=h.toString(16);return l.length%2===1&&(l="0"+l),h<128?l:(128+l.length/2).toString(16)+l}getValue(){return""}}class r extends n{constructor(h){super(),this.t="02",h&&(this.v=e(h))}getValue(){return this.v}}class s extends n{constructor(h){super(),this.t="30",this.asn1Array=h}getValue(){return this.v=this.asn1Array.map(h=>h.getEncodedHex()).join(""),this.v}}function o(d,h){return+d[h+2]<8?1:+d.substr(h+2,2)&128}function c(d,h){const l=o(d,h),v=d.substr(h+2,l*2);return v?(+v[0]<8?new t(v,16):new t(v.substr(2),16)).intValue():-1}function f(d,h){const l=o(d,h);return h+(l+1)*2}return ue={encodeDer(d,h){const l=new r(d),v=new r(h);return new s([l,v]).getEncodedHex()},decodeDer(d){const h=f(d,0),l=f(d,h),v=c(d,h),O=d.substr(l,v*2),B=l+O.length,w=f(d,B),F=c(d,B),m=d.substr(w,F*2),T=new t(O,16),b=new t(m,16);return{r:T,s:b}}},ue}var fe,sn;function Ca(){if(sn)return fe;sn=1;const{BigInteger:t}=ee(),e=new t("2"),n=new t("3");class r{constructor(f,d){this.x=d,this.q=f}equals(f){return f===this?!0:this.q.equals(f.q)&&this.x.equals(f.x)}toBigInteger(){return this.x}negate(){return new r(this.q,this.x.negate().mod(this.q))}add(f){return new r(this.q,this.x.add(f.toBigInteger()).mod(this.q))}subtract(f){return new r(this.q,this.x.subtract(f.toBigInteger()).mod(this.q))}multiply(f){return new r(this.q,this.x.multiply(f.toBigInteger()).mod(this.q))}divide(f){return new r(this.q,this.x.multiply(f.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new r(this.q,this.x.square().mod(this.q))}}class s{constructor(f,d,h,l){this.curve=f,this.x=d,this.y=h,this.z=l??t.ONE,this.zinv=null}getX(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(f){return f===this?!0:this.isInfinity()?f.isInfinity():f.isInfinity()?this.isInfinity():f.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(f.z)).mod(this.curve.q).equals(t.ZERO)?f.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(f.z)).mod(this.curve.q).equals(t.ZERO):!1}isInfinity(){return this.x===null&&this.y===null?!0:this.z.equals(t.ZERO)&&!this.y.toBigInteger().equals(t.ZERO)}negate(){return new s(this.curve,this.x,this.y.negate(),this.z)}add(f){if(this.isInfinity())return f;if(f.isInfinity())return this;const d=this.x.toBigInteger(),h=this.y.toBigInteger(),l=this.z,v=f.x.toBigInteger(),O=f.y.toBigInteger(),B=f.z,w=this.curve.q,F=d.multiply(B).mod(w),m=v.multiply(l).mod(w),T=F.subtract(m),b=h.multiply(B).mod(w),g=O.multiply(l).mod(w),S=b.subtract(g);if(t.ZERO.equals(T))return t.ZERO.equals(S)?this.twice():this.curve.infinity;const x=F.add(m),A=l.multiply(B).mod(w),C=T.square().mod(w),q=T.multiply(C).mod(w),N=A.multiply(S.square()).subtract(x.multiply(C)).mod(w),H=T.multiply(N).mod(w),P=S.multiply(C.multiply(F).subtract(N)).subtract(b.multiply(q)).mod(w),k=q.multiply(A).mod(w);return new s(this.curve,this.curve.fromBigInteger(H),this.curve.fromBigInteger(P),k)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const f=this.x.toBigInteger(),d=this.y.toBigInteger(),h=this.z,l=this.curve.q,v=this.curve.a.toBigInteger(),O=f.square().multiply(n).add(v.multiply(h.square())).mod(l),B=d.shiftLeft(1).multiply(h).mod(l),w=d.square().mod(l),F=w.multiply(f).multiply(h).mod(l),m=B.square().mod(l),T=O.square().subtract(F.shiftLeft(3)).mod(l),b=B.multiply(T).mod(l),g=O.multiply(F.shiftLeft(2).subtract(T)).subtract(m.shiftLeft(1).multiply(w)).mod(l),S=B.multiply(m).mod(l);return new s(this.curve,this.curve.fromBigInteger(b),this.curve.fromBigInteger(g),S)}multiply(f){if(this.isInfinity())return this;if(!f.signum())return this.curve.infinity;const d=f.multiply(n),h=this.negate();let l=this;for(let v=d.bitLength()-2;v>0;v--){l=l.twice();const O=d.testBit(v),B=f.testBit(v);O!==B&&(l=l.add(O?this:h))}return l}}class o{constructor(f,d,h){this.q=f,this.a=this.fromBigInteger(d),this.b=this.fromBigInteger(h),this.infinity=new s(this,null,null)}equals(f){return f===this?!0:this.q.equals(f.q)&&this.a.equals(f.a)&&this.b.equals(f.b)}fromBigInteger(f){return new r(this.q,f)}decodePointHex(f){switch(parseInt(f.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const d=this.fromBigInteger(new t(f.substr(2),16));let h=this.fromBigInteger(d.multiply(d.square()).add(d.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new t("4")).add(t.ONE),this.q));return h.toBigInteger().mod(e).equals(new t(f.substr(0,2),16).subtract(e))||(h=h.negate()),new s(this,d,h);case 4:case 6:case 7:const l=(f.length-2)/2,v=f.substr(2,l),O=f.substr(l+2,l);return new s(this,this.fromBigInteger(new t(v,16)),this.fromBigInteger(new t(O,16)));default:return null}}}return fe={ECPointFp:s,ECCurveFp:o},fe}var le,on;function Da(){if(on)return le;on=1;const{BigInteger:t,SecureRandom:e}=ee(),{ECCurveFp:n}=Ca(),r=new e,{curve:s,G:o,n:c}=d();function f(){return s}function d(){const b=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),g=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),S=new t("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),x=new n(b,g,S),q=x.decodePointHex("04"+"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7"+"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),N=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16);return{curve:x,G:q,n:N}}function h(b,g,S){const A=(b?new t(b,g,S):new t(c.bitLength(),r)).mod(c.subtract(t.ONE)).add(t.ONE),C=O(A.toString(16),64),q=o.multiply(A),N=O(q.getX().toBigInteger().toString(16),64),H=O(q.getY().toBigInteger().toString(16),64),P="04"+N+H;return{privateKey:C,publicKey:P}}function l(b){if(b.length!==130)throw new Error("Invalid public key to compress");const g=(b.length-2)/2,S=b.substr(2,g),x=new t(b.substr(g+2,g),16);let A="03";return x.mod(new t("2")).equals(t.ZERO)&&(A="02"),A+S}function v(b){b=unescape(encodeURIComponent(b));const g=b.length,S=[];for(let A=0;A<g;A++)S[A>>>2]|=(b.charCodeAt(A)&255)<<24-A%4*8;const x=[];for(let A=0;A<g;A++){const C=S[A>>>2]>>>24-A%4*8&255;x.push((C>>>4).toString(16)),x.push((C&15).toString(16))}return x.join("")}function O(b,g){return b.length>=g?b:new Array(g-b.length+1).join("0")+b}function B(b){return b.map(g=>(g=g.toString(16),g.length===1?"0"+g:g)).join("")}function w(b){const g=[];let S=0;for(let x=0;x<b.length*2;x+=2)g[x>>>3]|=parseInt(b[S],10)<<24-x%8*4,S++;try{const x=[];for(let A=0;A<b.length;A++){const C=g[A>>>2]>>>24-A%4*8&255;x.push(String.fromCharCode(C))}return decodeURIComponent(escape(x.join("")))}catch{throw new Error("Malformed UTF-8 data")}}function F(b){const g=[];let S=b.length;S%2!==0&&(b=O(b,S+1)),S=b.length;for(let x=0;x<S;x+=2)g.push(parseInt(b.substr(x,2),16));return g}function m(b){const g=s.decodePointHex(b);if(!g)return!1;const S=g.getX();return g.getY().square().equals(S.multiply(S.square()).add(S.multiply(s.a)).add(s.b))}function T(b,g){const S=s.decodePointHex(b);if(!S)return!1;const x=s.decodePointHex(g);return x?S.equals(x):!1}return le={getGlobalCurve:f,generateEcparam:d,generateKeyPairHex:h,compressPublicKeyHex:l,utf8ToHex:v,leftPad:O,arrayToHex:B,arrayToUtf8:w,hexToArray:F,verifyPublicKey:m,comparePublicKeyHex:T},le}var he,an;function rr(){if(an)return he;an=1;const t=new Uint32Array(68),e=new Uint32Array(64);function n(v,O){const B=O&31;return v<<B|v>>>32-B}function r(v,O){const B=[];for(let w=v.length-1;w>=0;w--)B[w]=(v[w]^O[w])&255;return B}function s(v){return v^n(v,9)^n(v,17)}function o(v){return v^n(v,15)^n(v,23)}function c(v){let O=v.length*8,B=O%512;B=B>=448?512-B%448-1:448-B-1;const w=new Array((B-7)/8),F=new Array(8);for(let x=0,A=w.length;x<A;x++)w[x]=0;for(let x=0,A=F.length;x<A;x++)F[x]=0;O=O.toString(2);for(let x=7;x>=0;x--)if(O.length>8){const A=O.length-8;F[x]=parseInt(O.substr(A),2),O=O.substr(0,A)}else O.length>0&&(F[x]=parseInt(O,2),O="");const m=new Uint8Array([...v,128,...w,...F]),T=new DataView(m.buffer,0),b=m.length/64,g=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let x=0;x<b;x++){t.fill(0),e.fill(0);const A=16*x;for(let D=0;D<16;D++)t[D]=T.getUint32((A+D)*4,!1);for(let D=16;D<68;D++)t[D]=o(t[D-16]^t[D-9]^n(t[D-3],15))^n(t[D-13],7)^t[D-6];for(let D=0;D<64;D++)e[D]=t[D]^t[D+4];const C=2043430169,q=2055708042;let N=g[0],H=g[1],P=g[2],k=g[3],L=g[4],U=g[5],J=g[6],V=g[7],X,G,pt,vt,et;for(let D=0;D<64;D++)et=D>=0&&D<=15?C:q,X=n(n(N,12)+L+n(et,D),7),G=X^n(N,12),pt=(D>=0&&D<=15?N^H^P:N&H|N&P|H&P)+k+G+e[D],vt=(D>=0&&D<=15?L^U^J:L&U|~L&J)+V+X+t[D],k=P,P=n(H,9),H=N,N=pt,V=J,J=n(U,19),U=L,L=s(vt);g[0]^=N,g[1]^=H,g[2]^=P,g[3]^=k,g[4]^=L,g[5]^=U,g[6]^=J,g[7]^=V}const S=[];for(let x=0,A=g.length;x<A;x++){const C=g[x];S.push((C&4278190080)>>>24,(C&16711680)>>>16,(C&65280)>>>8,C&255)}return S}const f=64,d=new Uint8Array(f),h=new Uint8Array(f);for(let v=0;v<f;v++)d[v]=54,h[v]=92;function l(v,O){for(O.length>f&&(O=c(O));O.length<f;)O.push(0);const B=r(O,d),w=r(O,h),F=c([...B,...v]);return c([...w,...F])}return he={sm3:c,hmac:l},he}var de,cn;function Pa(){if(cn)return de;cn=1;const{BigInteger:t}=ee(),{encodeDer:e,decodeDer:n}=Ba(),r=Da(),s=rr().sm3,{G:o,curve:c,n:f}=r.generateEcparam(),d=0;function h(m,T,b=1){m=typeof m=="string"?r.hexToArray(r.utf8ToHex(m)):Array.prototype.slice.call(m),T=r.getGlobalCurve().decodePointHex(T);const g=r.generateKeyPairHex(),S=new t(g.privateKey,16);let x=g.publicKey;x.length>128&&(x=x.substr(x.length-128));const A=T.multiply(S),C=r.hexToArray(r.leftPad(A.getX().toBigInteger().toRadix(16),64)),q=r.hexToArray(r.leftPad(A.getY().toBigInteger().toRadix(16),64)),N=r.arrayToHex(s([].concat(C,m,q)));let H=1,P=0,k=[];const L=[].concat(C,q),U=()=>{k=s([...L,H>>24&255,H>>16&255,H>>8&255,H&255]),H++,P=0};U();for(let V=0,X=m.length;V<X;V++)P===k.length&&U(),m[V]^=k[P++]&255;const J=r.arrayToHex(m);return b===d?x+J+N:x+N+J}function l(m,T,b=1,{output:g="string"}={}){T=new t(T,16);let S=m.substr(128,64),x=m.substr(192);b===d&&(S=m.substr(m.length-64),x=m.substr(128,m.length-128-64));const A=r.hexToArray(x),q=r.getGlobalCurve().decodePointHex("04"+m.substr(0,128)).multiply(T),N=r.hexToArray(r.leftPad(q.getX().toBigInteger().toRadix(16),64)),H=r.hexToArray(r.leftPad(q.getY().toBigInteger().toRadix(16),64));let P=1,k=0,L=[];const U=[].concat(N,H),J=()=>{L=s([...U,P>>24&255,P>>16&255,P>>8&255,P&255]),P++,k=0};J();for(let X=0,G=A.length;X<G;X++)k===L.length&&J(),A[X]^=L[k++]&255;return r.arrayToHex(s([].concat(N,A,H)))===S.toLowerCase()?g==="array"?A:r.arrayToUtf8(A):g==="array"?[]:""}function v(m,T,{pointPool:b,der:g,hash:S,publicKey:x,userId:A}={}){let C=typeof m=="string"?r.utf8ToHex(m):r.arrayToHex(m);S&&(x=x||w(T),C=B(C,x,A));const q=new t(T,16),N=new t(C,16);let H=null,P=null,k=null;do{do{let L;b&&b.length?L=b.pop():L=F(),H=L.k,P=N.add(L.x1).mod(f)}while(P.equals(t.ZERO)||P.add(H).equals(f));k=q.add(t.ONE).modInverse(f).multiply(H.subtract(P.multiply(q))).mod(f)}while(k.equals(t.ZERO));return g?e(P,k):r.leftPad(P.toString(16),64)+r.leftPad(k.toString(16),64)}function O(m,T,b,{der:g,hash:S,userId:x}={}){let A=typeof m=="string"?r.utf8ToHex(m):r.arrayToHex(m);S&&(A=B(A,b,x));let C,q;if(g){const U=n(T);C=U.r,q=U.s}else C=new t(T.substring(0,64),16),q=new t(T.substring(64),16);const N=c.decodePointHex(b),H=new t(A,16),P=C.add(q).mod(f);if(P.equals(t.ZERO))return!1;const k=o.multiply(q).add(N.multiply(P)),L=H.add(k.getX().toBigInteger()).mod(f);return C.equals(L)}function B(m,T,b="1234567812345678"){b=r.utf8ToHex(b);const g=r.leftPad(o.curve.a.toBigInteger().toRadix(16),64),S=r.leftPad(o.curve.b.toBigInteger().toRadix(16),64),x=r.leftPad(o.getX().toBigInteger().toRadix(16),64),A=r.leftPad(o.getY().toBigInteger().toRadix(16),64);let C,q;if(T.length===128)C=T.substr(0,64),q=T.substr(64,64);else{const k=o.curve.decodePointHex(T);C=r.leftPad(k.getX().toBigInteger().toRadix(16),64),q=r.leftPad(k.getY().toBigInteger().toRadix(16),64)}const N=r.hexToArray(b+g+S+x+A+C+q),H=b.length*4;N.unshift(H&255),N.unshift(H>>8&255);const P=s(N);return r.arrayToHex(s(P.concat(r.hexToArray(m))))}function w(m){const T=o.multiply(new t(m,16)),b=r.leftPad(T.getX().toBigInteger().toString(16),64),g=r.leftPad(T.getY().toBigInteger().toString(16),64);return"04"+b+g}function F(){const m=r.generateKeyPairHex(),T=c.decodePointHex(m.publicKey);return m.k=new t(m.privateKey,16),m.x1=T.getX().toBigInteger(),m}return de={generateKeyPairHex:r.generateKeyPairHex,compressPublicKeyHex:r.compressPublicKeyHex,comparePublicKeyHex:r.comparePublicKeyHex,doEncrypt:h,doDecrypt:l,doSignature:v,doVerifySignature:O,getPublicKeyFromPrivateKey:w,getPoint:F,verifyPublicKey:r.verifyPublicKey},de}var pe,un;function qa(){if(un)return pe;un=1;const{sm3:t,hmac:e}=rr();function n(c,f){return c.length>=f?c:new Array(f-c.length+1).join("0")+c}function r(c){return c.map(f=>(f=f.toString(16),f.length===1?"0"+f:f)).join("")}function s(c){const f=[];let d=c.length;d%2!==0&&(c=n(c,d+1)),d=c.length;for(let h=0;h<d;h+=2)f.push(parseInt(c.substr(h,2),16));return f}function o(c){const f=[];for(let d=0,h=c.length;d<h;d++){const l=c.codePointAt(d);if(l<=127)f.push(l);else if(l<=2047)f.push(192|l>>>6),f.push(128|l&63);else if(l<=55295||l>=57344&&l<=65535)f.push(224|l>>>12),f.push(128|l>>>6&63),f.push(128|l&63);else if(l>=65536&&l<=1114111)d++,f.push(240|l>>>18&28),f.push(128|l>>>12&63),f.push(128|l>>>6&63),f.push(128|l&63);else throw f.push(l),new Error("input is not supported")}return f}return pe=function(c,f){if(c=typeof c=="string"?o(c):Array.prototype.slice.call(c),f){if((f.mode||"hmac")!=="hmac")throw new Error("invalid mode");let h=f.key;if(!h)throw new Error("invalid key");return h=typeof h=="string"?s(h):Array.prototype.slice.call(h),r(e(c,h))}return r(t(c))},pe}var me,fn;function Ma(){if(fn)return me;fn=1;const t=0,e=32,n=16,r=[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],s=[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];function o(m){const T=[];for(let b=0,g=m.length;b<g;b+=2)T.push(parseInt(m.substr(b,2),16));return T}function c(m){return m.map(T=>(T=T.toString(16),T.length===1?"0"+T:T)).join("")}function f(m){const T=[];for(let b=0,g=m.length;b<g;b++){const S=m.codePointAt(b);if(S<=127)T.push(S);else if(S<=2047)T.push(192|S>>>6),T.push(128|S&63);else if(S<=55295||S>=57344&&S<=65535)T.push(224|S>>>12),T.push(128|S>>>6&63),T.push(128|S&63);else if(S>=65536&&S<=1114111)b++,T.push(240|S>>>18&28),T.push(128|S>>>12&63),T.push(128|S>>>6&63),T.push(128|S&63);else throw T.push(S),new Error("input is not supported")}return T}function d(m){const T=[];for(let b=0,g=m.length;b<g;b++)m[b]>=240&&m[b]<=247?(T.push(String.fromCodePoint(((m[b]&7)<<18)+((m[b+1]&63)<<12)+((m[b+2]&63)<<6)+(m[b+3]&63))),b+=3):m[b]>=224&&m[b]<=239?(T.push(String.fromCodePoint(((m[b]&15)<<12)+((m[b+1]&63)<<6)+(m[b+2]&63))),b+=2):m[b]>=192&&m[b]<=223?(T.push(String.fromCodePoint(((m[b]&31)<<6)+(m[b+1]&63))),b++):T.push(String.fromCodePoint(m[b]));return T.join("")}function h(m,T){const b=T&31;return m<<b|m>>>32-b}function l(m){return(r[m>>>24&255]&255)<<24|(r[m>>>16&255]&255)<<16|(r[m>>>8&255]&255)<<8|r[m&255]&255}function v(m){return m^h(m,2)^h(m,10)^h(m,18)^h(m,24)}function O(m){return m^h(m,13)^h(m,23)}function B(m,T,b){const g=new Array(4),S=new Array(4);for(let x=0;x<4;x++)S[0]=m[4*x]&255,S[1]=m[4*x+1]&255,S[2]=m[4*x+2]&255,S[3]=m[4*x+3]&255,g[x]=S[0]<<24|S[1]<<16|S[2]<<8|S[3];for(let x=0,A;x<32;x+=4)A=g[1]^g[2]^g[3]^b[x+0],g[0]^=v(l(A)),A=g[2]^g[3]^g[0]^b[x+1],g[1]^=v(l(A)),A=g[3]^g[0]^g[1]^b[x+2],g[2]^=v(l(A)),A=g[0]^g[1]^g[2]^b[x+3],g[3]^=v(l(A));for(let x=0;x<16;x+=4)T[x]=g[3-x/4]>>>24&255,T[x+1]=g[3-x/4]>>>16&255,T[x+2]=g[3-x/4]>>>8&255,T[x+3]=g[3-x/4]&255}function w(m,T,b){const g=new Array(4),S=new Array(4);for(let x=0;x<4;x++)S[0]=m[0+4*x]&255,S[1]=m[1+4*x]&255,S[2]=m[2+4*x]&255,S[3]=m[3+4*x]&255,g[x]=S[0]<<24|S[1]<<16|S[2]<<8|S[3];g[0]^=2746333894,g[1]^=1453994832,g[2]^=1736282519,g[3]^=2993693404;for(let x=0,A;x<32;x+=4)A=g[1]^g[2]^g[3]^s[x+0],T[x+0]=g[0]^=O(l(A)),A=g[2]^g[3]^g[0]^s[x+1],T[x+1]=g[1]^=O(l(A)),A=g[3]^g[0]^g[1]^s[x+2],T[x+2]=g[2]^=O(l(A)),A=g[0]^g[1]^g[2]^s[x+3],T[x+3]=g[3]^=O(l(A));if(b===t)for(let x=0,A;x<16;x++)A=T[x],T[x]=T[31-x],T[31-x]=A}function F(m,T,b,{padding:g="pkcs#7",mode:S,iv:x=[],output:A="string"}={}){if(S==="cbc"&&(typeof x=="string"&&(x=o(x)),x.length!==128/8))throw new Error("iv is invalid");if(typeof T=="string"&&(T=o(T)),T.length!==128/8)throw new Error("key is invalid");if(typeof m=="string"?b!==t?m=f(m):m=o(m):m=[...m],(g==="pkcs#5"||g==="pkcs#7")&&b!==t){const k=n-m.length%n;for(let L=0;L<k;L++)m.push(k)}const C=new Array(e);w(T,C,b);const q=[];let N=x,H=m.length,P=0;for(;H>=n;){const k=m.slice(P,P+16),L=new Array(16);if(S==="cbc")for(let U=0;U<n;U++)b!==t&&(k[U]^=N[U]);B(k,L,C);for(let U=0;U<n;U++)S==="cbc"&&b===t&&(L[U]^=N[U]),q[P+U]=L[U];S==="cbc"&&(b!==t?N=L:N=k),H-=n,P+=n}if((g==="pkcs#5"||g==="pkcs#7")&&b===t){const k=q.length,L=q[k-1];for(let U=1;U<=L;U++)if(q[k-U]!==L)throw new Error("padding is invalid");q.splice(k-L,L)}return A!=="array"?b!==t?c(q):d(q):q}return me={encrypt(m,T,b){return F(m,T,1,b)},decrypt(m,T,b){return F(m,T,0,b)}},me}var ge,ln;function Na(){return ln||(ln=1,ge={sm2:Pa(),sm3:qa(),sm4:Ma()}),ge}var sr=Na();const Ie=sr.sm2,Be=sr.sm4,ka=(t,e,n="04")=>n+Ie.doEncrypt(t,e),La=(t,e,n="04")=>Ie.doDecrypt(t.startsWith(n)?t.slice(2):t,e),Ua=(t,e)=>Be.encrypt(t,e),Ha=(t,e)=>Be.decrypt(t,e);let It=[],za={consecutiveFrames:0,lastBlinkTime:0},ja={consecutiveFrames:0,lastBlinkTime:0};const $a=new Map([["nod",[Qa,30,100]],["shake",[Xa,7,100]],["mouth",[Za,.35,100]],["eye",[Ga,.3,100]]]),Va=["nod","shake","mouth","eye"],Ya={nod:"请点点头",shake:"请摇摇头",mouth:"请张张嘴",eye:"请眨眨眼"};function hn(t,e){if(t.length!==e.length)throw new Error("euclideanDistance: arr1.length !== arr2.length");const n=Array.from(t),r=Array.from(e);return Math.sqrt(n.map((s,o)=>s-r[o]).reduce((s,o)=>s+Math.pow(o,2),0))}function*Ka(t,e,n=8,r=0){for(let s=n;s>0;s--)yield t(e,.5,r)}function Ut(t){return[t.x,t.y]}function ye(t,e){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function dn(t){const e=ye(t[1],t[5]),n=ye(t[2],t[4]),r=ye(t[0],t[3]);return(e+n)/(2*r)}function Ja(t){const e=hn(Ut(t[13]),Ut(t[19])),n=hn(Ut(t[0]),Ut(t[6]));return e/n}function Wa(t){const e=t.positions[30],n=t.positions[36],r=t.positions[45],s=(n.x+r.x)/2;return(e.x-s)/(r.x-n.x)*30}function Ga(t,e){const n=Date.now(),r=pn(dn(t.getLeftEye()),e,za,n),s=pn(dn(t.getRightEye()),e,ja,n);return!!(r||s)}function pn(t,e,n,r){if(t<e)n.consecutiveFrames++;else if(n.consecutiveFrames>=3&&r-n.lastBlinkTime>500)return n.lastBlinkTime=r,n.consecutiveFrames=0,!0;return!1}function Za(t,e){return Ja(t.getMouth())>e}function Xa(t,e){const n=Wa(t);return Math.abs(n)>e}function Qa(t,e){const n=It.length,r=t.positions[33];if(n<5)It.push(r.y);else if(n===5){const s=Math.min(...It);if(Math.max(...It)-s>e)return!0;It=[]}return!1}function tc(t,e="blob",n=1){return new Promise(r=>{const s=document.createElement("canvas"),o=s.getContext("2d");s.width=t.videoWidth,s.height=t.videoHeight,o==null||o.drawImage(t,0,0,s.width,s.height),e==="blob"?s.toBlob(c=>{const f=new FileReader;f.onload=()=>r(f.result),f.readAsArrayBuffer(c)},"image/png",n):r(s.toDataURL("image/png",n))})}async function ec(t,e,n,r=5){const[s,o,c]=$a.get(n);if(!s)return!1;const f=[],d=Ka(t,e,r,c);for(const h of d){const l=await h;if(!l)continue;const v=s(l.landmarks,o);f.push(v)}return f.includes(!0)}const nc={DATE_VALUE_FORMAT:gi,COMMON_TEXT:dt,IMAGE_TYPE:wn,MEDIA_TYPE:vn,DOC_TYPE:Tn,FILE_TYPE:xi},rc={encodeURIToParams:Rn,paramsToQueryString:Ai,queryStringToParams:_i,errorCodeToString:En,YNToString:bi,HNToString:wi,valueToLabel:Ri,chargeToLabel:Oi,cascaderToLabel:Sn,multipleSelectToLabel:Fi,phoneToAsterisk:vi,idNumberToAsterisk:Ti,firstLetterToUpperCase:Ei,firstLetterToLowerCase:Si},sc={validHttp:zs,validExternal:js,validString:$s,validNumberStr:Vs,validEmptyObject:Ys,validURL:Ks,validPassword:Js,validEmail:Ws,validIdNumber:Oe,validPhone:Zs,validTel:Gs},ic={scrollTo:Cs,addClass:ks,removeClass:Ls,hasClass:Re,toggleClass:Ns,noContextmenu:Hs,useRafThrottle:Us},oc={parseTime:Vt,getTimeDistance:qs,getDayRange:Ms},ac={local:mn,session:ct},cc={uuid:Ps,randomNum:Ds};exports.CONSTANTS=nc;exports.NOOP=xe;exports.NetworkManager=Zn;exports.Request=aa;exports.TokenManager=Gn;exports.addResizeListener=Aa;exports.cacheUtil=ac;exports.countdownTimer=Qs;exports.creatCancelTask=ai;exports.dateUtil=oc;exports.debounce=ei;exports.downloadFile=ci;exports.elementUtil=ic;exports.faceLivingEvent=Va;exports.faceLivingEventHint=Ya;exports.getArrayFullUrl=ii;exports.getBirthdayByIdNumber=ri;exports.getFaceGestureResult=ec;exports.getFaceVideoFrame=tc;exports.getFullUrl=xn;exports.getGenderByIdNumber=ni;exports.getLocationConfig=gn;exports.getMapLocationIcon=hi;exports.getPercentage=ui;exports.getRandomItemInArray=ti;exports.getRequestBaseUrl=ca;exports.getSystemConfig=si;exports.loadCss=fi;exports.loadJs=li;exports.randomUtil=cc;exports.removeResizeListener=_a;exports.ricTask=oi;exports.sleep=Xs;exports.sm2Crypto=Ie;exports.sm2Decrypt=La;exports.sm2Encrypt=ka;exports.sm4Crypto=Be;exports.sm4Decrypt=Ha;exports.sm4Encrypt=Ua;exports.toUtil=rc;exports.transformPathName=yn;exports.trimArray=bn;exports.validUtil=sc;
|
|
6
|
+
`+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=wt(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&jt.assertOptions(r,{silentJSONParsing:ft.transitional(ft.boolean),forcedJSONParsing:ft.transitional(ft.boolean),clarifyTimeoutError:ft.transitional(ft.boolean)},!1),s!=null&&(y.isFunction(s)?n.paramsSerializer={serialize:s}:jt.assertOptions(s,{encode:ft.function,serialize:ft.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jt.assertOptions(n,{baseUrl:ft.spelling("baseURL"),withXsrfToken:ft.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=o&&y.merge(o.common,o[n.method]);o&&y.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=tt.concat(c,o);const f=[];let d=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(n)===!1||(d=d&&F.synchronous,f.unshift(F.fulfilled,F.rejected))});const h=[];this.interceptors.response.forEach(function(F){h.push(F.fulfilled,F.rejected)});let l,v=0,O;if(!d){const w=[Qe.bind(this),void 0];for(w.unshift(...f),w.push(...h),O=w.length,l=Promise.resolve(n);v<O;)l=l.then(w[v++],w[v++]);return l}O=f.length;let I=n;for(;v<O;){const w=f[v++],F=f[v++];try{I=w(I)}catch(m){F.call(this,m);break}}try{l=Qe.call(this,I)}catch(w){return Promise.reject(w)}for(v=0,O=h.length;v<O;)l=l.then(h[v++],h[v++]);return l}getUri(e){e=wt(this.defaults,e);const n=jn(e.baseURL,e.url,e.allowAbsoluteUrls);return kn(n,e.params,e.paramsSerializer)}};y.forEach(["delete","get","head","options"],function(e){bt.prototype[e]=function(n,r){return this.request(wt(r||{},{method:e,url:n,data:(r||{}).data}))}});y.forEach(["post","put","patch"],function(e){function n(r){return function(o,c,f){return this.request(wt(f||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:c}))}}bt.prototype[e]=n(),bt.prototype[e+"Form"]=n(!0)});let na=class Jn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const c=new Promise(f=>{r.subscribe(f),o=f}).then(s);return c.cancel=function(){r.unsubscribe(o)},c},e(function(o,c,f){r.reason||(r.reason=new Ot(o,c,f),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new Jn(function(s){e=s}),cancel:e}}};function ra(t){return function(n){return t.apply(null,n)}}function sa(t){return y.isObject(t)&&t.isAxiosError===!0}const Ee={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ee).forEach(([t,e])=>{Ee[e]=t});function Wn(t){const e=new bt(t),n=On(bt.prototype.request,e);return y.extend(n,bt.prototype,e,{allOwnKeys:!0}),y.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return Wn(wt(t,s))},n}const $=Wn(Pt);$.Axios=bt;$.CanceledError=Ot;$.CancelToken=na;$.isCancel=Hn;$.VERSION=Kn;$.toFormData=Xt;$.AxiosError=M;$.Cancel=$.CanceledError;$.all=function(e){return Promise.all(e)};$.spread=ra;$.isAxiosError=sa;$.mergeConfig=wt;$.AxiosHeaders=tt;$.formToJSON=t=>Un(y.isHTMLForm(t)?new FormData(t):t);$.getAdapter=Yn.getAdapter;$.HttpStatusCode=Ee;$.default=$;const{Axios:hc,AxiosError:dc,CanceledError:pc,isCancel:mc,CancelToken:gc,VERSION:yc,all:xc,Cancel:bc,isAxiosError:wc,spread:vc,toFormData:Tc,AxiosHeaders:Ec,HttpStatusCode:Sc,formToJSON:Rc,getAdapter:Oc,mergeConfig:Fc}=$;class ia{constructor(){j(this,"pendingMap",new Map)}generateRequestKey(e){const{method:n,url:r,params:s,data:o}=e;return[n,r,JSON.stringify(s),JSON.stringify(o)].join("&")}addPending(e){this.removePending(e);const n=this.generateRequestKey(e),r=new AbortController;e.signal=r.signal,e.requestId=n,this.pendingMap.has(n)||this.pendingMap.set(n,r)}removePending(e){const n=this.generateRequestKey(e);if(this.pendingMap.has(n)){const r=this.pendingMap.get(n);r==null||r.abort("Request canceled due to duplicate request"),this.pendingMap.delete(n)}}clearPending(){this.pendingMap.forEach(e=>{e.abort("Request canceled due to application state change")}),this.pendingMap.clear()}getPendingCount(){return this.pendingMap.size}}class Zn{constructor(){j(this,"TOKEN_KEY","__AUTH_TOKEN");j(this,"REFRESH_TOKEN_KEY","__REFRESH_TOKEN");j(this,"TOKEN_EXPIRES_KEY","__TOKEN_EXPIRES_AT");j(this,"isRefreshing",!1);j(this,"refreshSubscribers",[])}setToken({accessToken:e,refreshToken:n,expiresIn:r}){if(ct.set(this.TOKEN_KEY,e),n&&ct.set(this.REFRESH_TOKEN_KEY,n),r){const s=Date.now()+r*1e3;ct.set(this.TOKEN_EXPIRES_KEY,s.toString())}}getAccessToken(){return ct.get(this.TOKEN_KEY)||""}getRefreshToken(){return ct.get(this.REFRESH_TOKEN_KEY)||""}clearToken(){ct.remove(this.TOKEN_KEY),ct.remove(this.REFRESH_TOKEN_KEY),ct.remove(this.TOKEN_EXPIRES_KEY)}isTokenExpiringSoon(){const e=Number(ct.get(this.TOKEN_EXPIRES_KEY)||0);return e?Date.now()>e-5*60*1e3:!1}subscribeTokenRefresh(e){this.refreshSubscribers.push(e)}onRefreshed(e){this.refreshSubscribers.forEach(n=>n(e)),this.refreshSubscribers=[]}async refreshToken(e,n){if(this.isRefreshing)return new Promise(r=>{this.subscribeTokenRefresh(r)});this.isRefreshing=!0;try{const r=this.getRefreshToken();if(!r)throw new Error("No refresh token available");if(typeof e!="function")throw new Error("No refresh request function provided");const s=await e(r);if(s.code===200&&s.data)return this.setToken(s.data),this.onRefreshed(s.data.accessToken),s.data.accessToken;throw new Error(s.msg||"Token refresh failed")}catch{return this.clearToken(),n&&typeof n=="function"&&n(),""}finally{this.isRefreshing=!1}}}class oa{constructor(e){j(this,"toastInstance");this.toastInstance=e}handleStatusError(e,n,r=!0){const s=En(e)||n||`Unknown error (${e})`;r&&this.toastInstance.error(s),console.error(`[HTTP Error ${e}]: ${s}`)}handleBusinessError(e,n,r=!0){const s=n||`Unknown business error (${e})`;r&&this.toastInstance.error(s),console.error(`[Business Error ${e}]: ${s}`)}handleNetworkError(e,n=!0){if(!navigator.onLine)return;let r="网络连接异常,请检查您的网络";if(e.message.includes("timeout"))r="网络请求超时,请稍后重试";else if(e.message.includes("Network Error"))r="网络连接异常,请检查您的网络";else{if(e.message.includes("canceled"))return;if(e.message.includes("aborted"))return}n&&this.toastInstance.error(r),console.error("[Network Error]:",e)}handleError(e,n=!0){var r;$.isAxiosError(e)?e.response?this.handleStatusError(e.response.status,((r=e.response.data)==null?void 0:r.message)||e.message,n):this.handleNetworkError(e,n):(n&&this.toastInstance.error((e==null?void 0:e.message)||"发生未知错误"),console.error("[Error]:",e))}}class Gn{constructor(e){j(this,"toastInstance");j(this,"status",navigator.onLine?"online":"offline");j(this,"offlineQueue",[]);j(this,"listeners",new Set);j(this,"initialized",!1);this.toastInstance=e,this.init()}init(){this.initialized||(window.addEventListener("online",this.handleOnline.bind(this)),window.addEventListener("offline",this.handleOffline.bind(this)),this.initialized=!0)}handleOnline(){const e=this.status;this.status="online",e!==this.status&&(this.notifyStatusChange(),this.offlineQueue.length>0?(this.toastInstance.info(`网络已恢复,正在处理 ${this.offlineQueue.length} 个待处理请求...`),this.processOfflineQueue()):this.toastInstance.success("网络已恢复连接"))}handleOffline(){const e=this.status;this.status="offline",e!==this.status&&(this.notifyStatusChange(),this.toastInstance.error("网络已断开,请检查您的网络连接",{duration:0}))}notifyStatusChange(){this.listeners.forEach(e=>{e(this.status)})}async processOfflineQueue(){if(this.status!=="online"||this.offlineQueue.length===0)return;const e=[...this.offlineQueue];this.offlineQueue=[];for(const n of e)try{const r=await fetch(n.config.url||"",{method:n.config.method,headers:n.config.headers,body:n.config.data?JSON.stringify(n.config.data):void 0}).then(s=>s.json());n.resolve(r)}catch(r){n.reject(r)}}addStatusChangeListener(e){this.listeners.add(e)}removeStatusChangeListener(e){this.listeners.delete(e)}getStatus(){return this.status}addToOfflineQueue(e){this.offlineQueue.push(e),this.toastInstance.warning(`网络离线中,请求已加入队列,恢复网络后将自动发送 (${this.offlineQueue.length})`)}clearOfflineQueue(){this.offlineQueue.forEach(e=>{e.reject(new Error("Offline request queue cleared"))}),this.offlineQueue=[]}getOfflineQueueLength(){return this.offlineQueue.length}}class aa{constructor(e){j(this,"axiosInstance");j(this,"errorInstance");j(this,"networkInstance");j(this,"cancelInstance");j(this,"tokenInstance");j(this,"loadingInstance");j(this,"requestOptions",{});j(this,"requestInstanceRequestOptions",{});j(this,"defaultRequestOptions",{showLoading:!1,cancelRepeatRequest:!0,needToken:!0,handleErrorStatus:!0,showErrorMessage:!0,queueWhenOffline:!0,retryWhenOnline:!0,maxRetries:0,retryDelay:1e3});j(this,"defaultConfig",{timeout:10*1e3,headers:{"Content-Type":"application/json;charset=utf-8"}});const{config:n={},requestOptions:r={},toastInstance:s,loadingInstance:o}=e;this.errorInstance=new oa(s),this.networkInstance=new Gn(s),this.cancelInstance=new ia,this.tokenInstance=new Zn,o&&(this.loadingInstance=o),this.requestOptions={...this.defaultRequestOptions,...r},this.axiosInstance=$.create({...this.defaultConfig,...n}),this.setupInterceptors(),this.setupNetworkListener()}setupNetworkListener(){this.networkInstance.addStatusChangeListener(e=>{var n;e==="online"?console.log("Network is back online"):e==="offline"&&(console.log("Network is offline"),(n=this.loadingInstance)==null||n.forceHide())})}setupInterceptors(){this.axiosInstance.interceptors.request.use(e=>{var O,I;const{showLoading:n,queueWhenOffline:r,cancelRepeatRequest:s,requestConfigHandler:o,needToken:c,refreshToken:f={},loadingOptions:d={}}=this.requestInstanceRequestOptions,{autoRefresh:h,refreshRequest:l,refrechFailed:v}=f;if(this.networkInstance.getStatus()==="offline"&&r)return new Promise((w,F)=>{const m={config:e,resolve:w,reject:F};this.networkInstance.addToOfflineQueue(m)});if(n&&((O=this.loadingInstance)==null||O.show(d)),s&&this.cancelInstance.addPending(e),o&&typeof o=="function"&&o(e,c),((I=e.method)==null?void 0:I.toUpperCase())==="GET"&&e.params){let w=`${e.url}?${Rn(e.params)}`;e.params={_t:new Date().getTime()},e.url=w.slice(0,-1)}return this.tokenInstance.isTokenExpiringSoon()&&h&&this.refreshTokenInBackend(l,v),e},e=>{var n;return(n=this.loadingInstance)==null||n.forceHide(),Promise.reject(e)}),this.axiosInstance.interceptors.response.use(e=>{var h;const n=e.config,{showLoading:r,cancelRepeatRequest:s,showErrorMessage:o,handleErrorStatus:c,businessErrorHandler:f}=this.requestInstanceRequestOptions;s&&this.cancelInstance.removePending(n),r&&((h=this.loadingInstance)==null||h.hide());const d=e.headers["content-type"];if(d!=null&&d.includes("application/octet-stream")||d!=null&&d.includes("application/vnd.ms-excel")||d!=null&&d.includes("application/vnd.openxmlformats-officedocument")||d!=null&&d.includes("application/pdf"))return e;if(e.data&&c){const{code:l,msg:v}=e.data;if(l!==200&&l!==0)return this.errorInstance.handleBusinessError(l,v,o),f&&typeof f=="function"&&f(l,v),Promise.reject(new Error(v))}return e.data},async e=>{var w,F,m,T;const n=e.config;if(!n)return(w=this.loadingInstance)==null||w.forceHide(),Promise.reject(e);const{showLoading:r,cancelRepeatRequest:s,showErrorMessage:o,handleErrorStatus:c,refreshToken:f={},retryDelay:d=1e3,maxRetries:h=0}=this.requestInstanceRequestOptions,{autoRefresh:l,refreshRequest:v,refrechFailed:O}=f,I=n.retryCount||0;if(n&&s&&this.cancelInstance.removePending(n),r&&((F=this.loadingInstance)==null||F.hide()),h>0&&I<h){const b={...n,retryCount:I+1};return await new Promise(g=>setTimeout(g,d)),console.log(`Retrying request (${I+1}/${h}): ${n.url}`),this.axiosInstance(b)}if(((m=e.response)==null?void 0:m.status)===401&&l&&this.tokenInstance.getRefreshToken())try{const b=await this.refreshToken(v,O);if(b&&n)return n.headers=n.headers||{},n.headers.Authorization=`Bearer ${b}`,this.axiosInstance(n)}catch(b){return Promise.reject(b)}return e.response&&c?this.errorInstance.handleStatusError(e.response.status,((T=e.response.data)==null?void 0:T.message)||e.message,o):e.request?this.errorInstance.handleNetworkError(e,o):(this.errorInstance.handleStatusError(909090,e.message,o),console.error("[Request Error]:",e)),Promise.reject(e)})}async refreshTokenInBackend(e,n){try{await this.refreshToken(e,n)}catch(r){console.error("Background token refresh failed:",r)}}async refreshToken(e,n){return this.tokenInstance.refreshToken(e,n)}async request(e,n={}){return this.requestInstanceRequestOptions={...this.requestOptions,...n},this.axiosInstance.request(e)}async get({url:e,params:n,config:r={},requestOptions:s={}}){return this.request({method:"GET",url:e,params:n,...r},s)}async post({url:e,data:n,config:r={},requestOptions:s={}}){return this.request({method:"POST",url:e,data:n,...r},s)}async put({url:e,data:n,config:r={},requestOptions:s={}}){return this.request({method:"PUT",url:e,data:n,...r},s)}async delete({url:e,data:n,config:r={},requestOptions:s={}}){return this.request({method:"DELETE",url:e,data:n,params:r==null?void 0:r.params,...r},s)}async upload({url:e,file:n,config:r={},requestOptions:s={}}){let o;return n instanceof FormData?o=n:(o=new FormData,o.append("file",n)),this.request({method:"POST",url:e,data:o,headers:{"Content-Type":"multipart/form-data"},...r},s)}async uploadMultiple({url:e,files:n,fileField:r="files",config:s={},requestOptions:o={}}){const c=new FormData;return n.forEach((f,d)=>{c.append(`${r}[${d}]`,f)}),this.upload({url:e,file:c,config:s,requestOptions:o})}async download({url:e,params:n,config:r={},requestOptions:s={}}){const o=s==null?void 0:s.fileName,c=await this.request({method:"GET",url:e,params:n,responseType:"blob",...r},s),f=new Blob([c.data]);let d=o;if(!d){const v=c.headers["content-disposition"];if(v){const I=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(v);I!=null&&I[1]&&(d=decodeURIComponent(I[1].replace(/['"]/g,"")))}d=d||"download"}const h=window.URL.createObjectURL(f),l=document.createElement("a");return l.href=h,l.download=d,document.body.appendChild(l),l.click(),document.body.removeChild(l),setTimeout(()=>{window.URL.revokeObjectURL(h)},100),f}async exportExcel({url:e,params:n,config:r={},fileName:s="export.xlsx",requestOptions:o={}}){return this.download({url:e,params:n,config:r,requestOptions:{fileName:s,showLoading:!0,loadingOptions:{text:"正在导出数据,请稍候..."},...o}})}cancelAllRequests(e="Request canceled"){this.cancelInstance.clearPending()}clearOfflineQueue(){this.networkInstance.clearOfflineQueue()}}let yt=null;function ca(t){const{cacheKey:e,cacheMode:n="session",saveState:r=!0,handler:s}=t;return r&&yt||(yt=n==="local"?mn.get(e):ct.get(e),yt&&typeof s=="function"&&(yt=s(yt))),yt}var Xn=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(s,o){return s[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),s=this.__entries__[r];return s&&s[1]},e.prototype.set=function(n,r){var s=t(this.__entries__,n);~s?this.__entries__[s][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,s=t(r,n);~s&&r.splice(s,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var s=0,o=this.__entries__;s<o.length;s++){var c=o[s];n.call(r,c[1],c[0])}},e}()}(),Se=typeof window<"u"&&typeof document<"u"&&window.document===document,Kt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),ua=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Kt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),fa=2;function la(t,e){var n=!1,r=!1,s=0;function o(){n&&(n=!1,t()),r&&f()}function c(){ua(o)}function f(){var d=Date.now();if(n){if(d-s<fa)return;r=!0}else n=!0,r=!1,setTimeout(c,e);s=d}return f}var ha=20,da=["top","right","bottom","left","width","height","size","weight"],pa=typeof MutationObserver<"u",ma=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=la(this.refresh.bind(this),ha)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!Se||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),pa?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!Se||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,s=da.some(function(o){return!!~r.indexOf(o)});s&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Qn=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var s=r[n];Object.defineProperty(t,s,{value:e[s],enumerable:!1,writable:!1,configurable:!0})}return t},St=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Kt},tr=te(0,0,0,0);function Jt(t){return parseFloat(t)||0}function en(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,s){var o=t["border-"+s+"-width"];return r+Jt(o)},0)}function ga(t){for(var e=["top","right","bottom","left"],n={},r=0,s=e;r<s.length;r++){var o=s[r],c=t["padding-"+o];n[o]=Jt(c)}return n}function ya(t){var e=t.getBBox();return te(0,0,e.width,e.height)}function xa(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return tr;var r=St(t).getComputedStyle(t),s=ga(r),o=s.left+s.right,c=s.top+s.bottom,f=Jt(r.width),d=Jt(r.height);if(r.boxSizing==="border-box"&&(Math.round(f+o)!==e&&(f-=en(r,"left","right")+o),Math.round(d+c)!==n&&(d-=en(r,"top","bottom")+c)),!wa(t)){var h=Math.round(f+o)-e,l=Math.round(d+c)-n;Math.abs(h)!==1&&(f-=h),Math.abs(l)!==1&&(d-=l)}return te(s.left,s.top,f,d)}var ba=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof St(t).SVGGraphicsElement}:function(t){return t instanceof St(t).SVGElement&&typeof t.getBBox=="function"}}();function wa(t){return t===St(t).document.documentElement}function va(t){return Se?ba(t)?ya(t):xa(t):tr}function Ta(t){var e=t.x,n=t.y,r=t.width,s=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return Qn(c,{x:e,y:n,width:r,height:s,top:n,right:e+r,bottom:s+n,left:e}),c}function te(t,e,n,r){return{x:t,y:e,width:n,height:r}}var Ea=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=te(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=va(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),Sa=function(){function t(e,n){var r=Ta(n);Qn(this,{target:e,contentRect:r})}return t}(),Ra=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new Xn,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof St(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new Ea(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof St(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Sa(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),er=typeof WeakMap<"u"?new WeakMap:new Xn,nr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ma.getInstance(),r=new Ra(e,n,this);er.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){nr.prototype[t]=function(){var e;return(e=er.get(this))[t].apply(e,arguments)}});var Oa=function(){return typeof Kt.ResizeObserver<"u"?Kt.ResizeObserver:nr}();function Fa(t){for(const e of t){const n=e.target.__resizeListeners__||[];n.length&&n.forEach(r=>r())}}function Aa(t,e){typeof window>"u"||(t.__resizeListeners__||(t.__resizeListeners__=[],t.__ro__=new Oa(Fa),t.__ro__.observe(t)),t.__resizeListeners__.push(e))}function _a(t,e){!t||!t.__resizeListeners__||(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),t.__resizeListeners__.length||t.__ro__.disconnect())}var $t={exports:{}},Ia=$t.exports,nn;function ee(){return nn||(nn=1,function(t,e){(function(){var n,r=0xdeadbeefcafe,s=(r&16777215)==15715070;function o(i,a,u){i!=null&&(typeof i=="number"?this.fromNumber(i,a,u):a==null&&typeof i!="string"?this.fromString(i,256):this.fromString(i,a))}function c(){return new o(null)}function f(i,a,u,p,E,R){for(;--R>=0;){var _=a*this[i++]+u[p]+E;E=Math.floor(_/67108864),u[p++]=_&67108863}return E}function d(i,a,u,p,E,R){for(var _=a&32767,B=a>>15;--R>=0;){var z=this[i]&32767,K=this[i++]>>15,st=B*z+K*_;z=_*z+((st&32767)<<15)+u[p]+(E&1073741823),E=(z>>>30)+(st>>>15)+B*K+(E>>>30),u[p++]=z&1073741823}return E}function h(i,a,u,p,E,R){for(var _=a&16383,B=a>>14;--R>=0;){var z=this[i]&16383,K=this[i++]>>14,st=B*z+K*_;z=_*z+((st&16383)<<14)+u[p]+E,E=(z>>28)+(st>>14)+B*K,u[p++]=z&268435455}return E}var l=typeof navigator<"u";l&&s&&navigator.appName=="Microsoft Internet Explorer"?(o.prototype.am=d,n=30):l&&s&&navigator.appName!="Netscape"?(o.prototype.am=f,n=26):(o.prototype.am=h,n=28),o.prototype.DB=n,o.prototype.DM=(1<<n)-1,o.prototype.DV=1<<n;var v=52;o.prototype.FV=Math.pow(2,v),o.prototype.F1=v-n,o.prototype.F2=2*n-v;var O="0123456789abcdefghijklmnopqrstuvwxyz",I=new Array,w,F;for(w=48,F=0;F<=9;++F)I[w++]=F;for(w=97,F=10;F<36;++F)I[w++]=F;for(w=65,F=10;F<36;++F)I[w++]=F;function m(i){return O.charAt(i)}function T(i,a){var u=I[i.charCodeAt(a)];return u??-1}function b(i){for(var a=this.t-1;a>=0;--a)i[a]=this[a];i.t=this.t,i.s=this.s}function g(i){this.t=1,this.s=i<0?-1:0,i>0?this[0]=i:i<-1?this[0]=i+this.DV:this.t=0}function S(i){var a=c();return a.fromInt(i),a}function x(i,a){var u;if(a==16)u=4;else if(a==8)u=3;else if(a==256)u=8;else if(a==2)u=1;else if(a==32)u=5;else if(a==4)u=2;else{this.fromRadix(i,a);return}this.t=0,this.s=0;for(var p=i.length,E=!1,R=0;--p>=0;){var _=u==8?i[p]&255:T(i,p);if(_<0){i.charAt(p)=="-"&&(E=!0);continue}E=!1,R==0?this[this.t++]=_:R+u>this.DB?(this[this.t-1]|=(_&(1<<this.DB-R)-1)<<R,this[this.t++]=_>>this.DB-R):this[this.t-1]|=_<<R,R+=u,R>=this.DB&&(R-=this.DB)}u==8&&(i[0]&128)!=0&&(this.s=-1,R>0&&(this[this.t-1]|=(1<<this.DB-R)-1<<R)),this.clamp(),E&&o.ZERO.subTo(this,this)}function A(){for(var i=this.s&this.DM;this.t>0&&this[this.t-1]==i;)--this.t}function C(i){if(this.s<0)return"-"+this.negate().toString(i);var a;if(i==16)a=4;else if(i==8)a=3;else if(i==2)a=1;else if(i==32)a=5;else if(i==4)a=2;else return this.toRadix(i);var u=(1<<a)-1,p,E=!1,R="",_=this.t,B=this.DB-_*this.DB%a;if(_-- >0)for(B<this.DB&&(p=this[_]>>B)>0&&(E=!0,R=m(p));_>=0;)B<a?(p=(this[_]&(1<<B)-1)<<a-B,p|=this[--_]>>(B+=this.DB-a)):(p=this[_]>>(B-=a)&u,B<=0&&(B+=this.DB,--_)),p>0&&(E=!0),E&&(R+=m(p));return E?R:"0"}function q(){var i=c();return o.ZERO.subTo(this,i),i}function N(){return this.s<0?this.negate():this}function H(i){var a=this.s-i.s;if(a!=0)return a;var u=this.t;if(a=u-i.t,a!=0)return this.s<0?-a:a;for(;--u>=0;)if((a=this[u]-i[u])!=0)return a;return 0}function P(i){var a=1,u;return(u=i>>>16)!=0&&(i=u,a+=16),(u=i>>8)!=0&&(i=u,a+=8),(u=i>>4)!=0&&(i=u,a+=4),(u=i>>2)!=0&&(i=u,a+=2),(u=i>>1)!=0&&(i=u,a+=1),a}function k(){return this.t<=0?0:this.DB*(this.t-1)+P(this[this.t-1]^this.s&this.DM)}function L(i,a){var u;for(u=this.t-1;u>=0;--u)a[u+i]=this[u];for(u=i-1;u>=0;--u)a[u]=0;a.t=this.t+i,a.s=this.s}function U(i,a){for(var u=i;u<this.t;++u)a[u-i]=this[u];a.t=Math.max(this.t-i,0),a.s=this.s}function J(i,a){var u=i%this.DB,p=this.DB-u,E=(1<<p)-1,R=Math.floor(i/this.DB),_=this.s<<u&this.DM,B;for(B=this.t-1;B>=0;--B)a[B+R+1]=this[B]>>p|_,_=(this[B]&E)<<u;for(B=R-1;B>=0;--B)a[B]=0;a[R]=_,a.t=this.t+R+1,a.s=this.s,a.clamp()}function V(i,a){a.s=this.s;var u=Math.floor(i/this.DB);if(u>=this.t){a.t=0;return}var p=i%this.DB,E=this.DB-p,R=(1<<p)-1;a[0]=this[u]>>p;for(var _=u+1;_<this.t;++_)a[_-u-1]|=(this[_]&R)<<E,a[_-u]=this[_]>>p;p>0&&(a[this.t-u-1]|=(this.s&R)<<E),a.t=this.t-u,a.clamp()}function X(i,a){for(var u=0,p=0,E=Math.min(i.t,this.t);u<E;)p+=this[u]-i[u],a[u++]=p&this.DM,p>>=this.DB;if(i.t<this.t){for(p-=i.s;u<this.t;)p+=this[u],a[u++]=p&this.DM,p>>=this.DB;p+=this.s}else{for(p+=this.s;u<i.t;)p-=i[u],a[u++]=p&this.DM,p>>=this.DB;p-=i.s}a.s=p<0?-1:0,p<-1?a[u++]=this.DV+p:p>0&&(a[u++]=p),a.t=u,a.clamp()}function Z(i,a){var u=this.abs(),p=i.abs(),E=u.t;for(a.t=E+p.t;--E>=0;)a[E]=0;for(E=0;E<p.t;++E)a[E+u.t]=u.am(0,p[E],a,E,0,u.t);a.s=0,a.clamp(),this.s!=i.s&&o.ZERO.subTo(a,a)}function pt(i){for(var a=this.abs(),u=i.t=2*a.t;--u>=0;)i[u]=0;for(u=0;u<a.t-1;++u){var p=a.am(u,a[u],i,2*u,0,1);(i[u+a.t]+=a.am(u+1,2*a[u],i,2*u+1,p,a.t-u-1))>=a.DV&&(i[u+a.t]-=a.DV,i[u+a.t+1]=1)}i.t>0&&(i[i.t-1]+=a.am(u,a[u],i,2*u,0,1)),i.s=0,i.clamp()}function vt(i,a,u){var p=i.abs();if(!(p.t<=0)){var E=this.abs();if(E.t<p.t){a!=null&&a.fromInt(0),u!=null&&this.copyTo(u);return}u==null&&(u=c());var R=c(),_=this.s,B=i.s,z=this.DB-P(p[p.t-1]);z>0?(p.lShiftTo(z,R),E.lShiftTo(z,u)):(p.copyTo(R),E.copyTo(u));var K=R.t,st=R[K-1];if(st!=0){var rt=st*(1<<this.F1)+(K>1?R[K-2]>>this.F2:0),lt=this.FV/rt,Nt=(1<<this.F1)/rt,ot=1<<this.F2,at=u.t,kt=at-K,ht=a??c();for(R.dlShiftTo(kt,ht),u.compareTo(ht)>=0&&(u[u.t++]=1,u.subTo(ht,u)),o.ONE.dlShiftTo(K,ht),ht.subTo(R,R);R.t<K;)R[R.t++]=0;for(;--kt>=0;){var ie=u[--at]==st?this.DM:Math.floor(u[at]*lt+(u[at-1]+ot)*Nt);if((u[at]+=R.am(0,ie,u,kt,0,K))<ie)for(R.dlShiftTo(kt,ht),u.subTo(ht,u);u[at]<--ie;)u.subTo(ht,u)}a!=null&&(u.drShiftTo(K,a),_!=B&&o.ZERO.subTo(a,a)),u.t=K,u.clamp(),z>0&&u.rShiftTo(z,u),_<0&&o.ZERO.subTo(u,u)}}}function et(i){var a=c();return this.abs().divRemTo(i,null,a),this.s<0&&a.compareTo(o.ZERO)>0&&i.subTo(a,a),a}function D(i){this.m=i}function Ft(i){return i.s<0||i.compareTo(this.m)>=0?i.mod(this.m):i}function Tt(i){return i}function qt(i){i.divRemTo(this.m,null,i)}function ir(i,a,u){i.multiplyTo(a,u),this.reduce(u)}function or(i,a){i.squareTo(a),this.reduce(a)}D.prototype.convert=Ft,D.prototype.revert=Tt,D.prototype.reduce=qt,D.prototype.mulTo=ir,D.prototype.sqrTo=or;function ar(){if(this.t<1)return 0;var i=this[0];if((i&1)==0)return 0;var a=i&3;return a=a*(2-(i&15)*a)&15,a=a*(2-(i&255)*a)&255,a=a*(2-((i&65535)*a&65535))&65535,a=a*(2-i*a%this.DV)%this.DV,a>0?this.DV-a:-a}function mt(i){this.m=i,this.mp=i.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<i.DB-15)-1,this.mt2=2*i.t}function cr(i){var a=c();return i.abs().dlShiftTo(this.m.t,a),a.divRemTo(this.m,null,a),i.s<0&&a.compareTo(o.ZERO)>0&&this.m.subTo(a,a),a}function ur(i){var a=c();return i.copyTo(a),this.reduce(a),a}function fr(i){for(;i.t<=this.mt2;)i[i.t++]=0;for(var a=0;a<this.m.t;++a){var u=i[a]&32767,p=u*this.mpl+((u*this.mph+(i[a]>>15)*this.mpl&this.um)<<15)&i.DM;for(u=a+this.m.t,i[u]+=this.m.am(0,p,i,a,0,this.m.t);i[u]>=i.DV;)i[u]-=i.DV,i[++u]++}i.clamp(),i.drShiftTo(this.m.t,i),i.compareTo(this.m)>=0&&i.subTo(this.m,i)}function lr(i,a){i.squareTo(a),this.reduce(a)}function hr(i,a,u){i.multiplyTo(a,u),this.reduce(u)}mt.prototype.convert=cr,mt.prototype.revert=ur,mt.prototype.reduce=fr,mt.prototype.mulTo=hr,mt.prototype.sqrTo=lr;function dr(){return(this.t>0?this[0]&1:this.s)==0}function pr(i,a){if(i>4294967295||i<1)return o.ONE;var u=c(),p=c(),E=a.convert(this),R=P(i)-1;for(E.copyTo(u);--R>=0;)if(a.sqrTo(u,p),(i&1<<R)>0)a.mulTo(p,E,u);else{var _=u;u=p,p=_}return a.revert(u)}function mr(i,a){var u;return i<256||a.isEven()?u=new D(a):u=new mt(a),this.exp(i,u)}o.prototype.copyTo=b,o.prototype.fromInt=g,o.prototype.fromString=x,o.prototype.clamp=A,o.prototype.dlShiftTo=L,o.prototype.drShiftTo=U,o.prototype.lShiftTo=J,o.prototype.rShiftTo=V,o.prototype.subTo=X,o.prototype.multiplyTo=Z,o.prototype.squareTo=pt,o.prototype.divRemTo=vt,o.prototype.invDigit=ar,o.prototype.isEven=dr,o.prototype.exp=pr,o.prototype.toString=C,o.prototype.negate=q,o.prototype.abs=N,o.prototype.compareTo=H,o.prototype.bitLength=k,o.prototype.mod=et,o.prototype.modPowInt=mr,o.ZERO=S(0),o.ONE=S(1);function gr(){var i=c();return this.copyTo(i),i}function yr(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function xr(){return this.t==0?this.s:this[0]<<24>>24}function br(){return this.t==0?this.s:this[0]<<16>>16}function wr(i){return Math.floor(Math.LN2*this.DB/Math.log(i))}function vr(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Tr(i){if(i==null&&(i=10),this.signum()==0||i<2||i>36)return"0";var a=this.chunkSize(i),u=Math.pow(i,a),p=S(u),E=c(),R=c(),_="";for(this.divRemTo(p,E,R);E.signum()>0;)_=(u+R.intValue()).toString(i).substr(1)+_,E.divRemTo(p,E,R);return R.intValue().toString(i)+_}function Er(i,a){this.fromInt(0),a==null&&(a=10);for(var u=this.chunkSize(a),p=Math.pow(a,u),E=!1,R=0,_=0,B=0;B<i.length;++B){var z=T(i,B);if(z<0){i.charAt(B)=="-"&&this.signum()==0&&(E=!0);continue}_=a*_+z,++R>=u&&(this.dMultiply(p),this.dAddOffset(_,0),R=0,_=0)}R>0&&(this.dMultiply(Math.pow(a,R)),this.dAddOffset(_,0)),E&&o.ZERO.subTo(this,this)}function Sr(i,a,u){if(typeof a=="number")if(i<2)this.fromInt(1);else for(this.fromNumber(i,u),this.testBit(i-1)||this.bitwiseTo(o.ONE.shiftLeft(i-1),ne,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(a);)this.dAddOffset(2,0),this.bitLength()>i&&this.subTo(o.ONE.shiftLeft(i-1),this);else{var p=new Array,E=i&7;p.length=(i>>3)+1,a.nextBytes(p),E>0?p[0]&=(1<<E)-1:p[0]=0,this.fromString(p,256)}}function Rr(){var i=this.t,a=new Array;a[0]=this.s;var u=this.DB-i*this.DB%8,p,E=0;if(i-- >0)for(u<this.DB&&(p=this[i]>>u)!=(this.s&this.DM)>>u&&(a[E++]=p|this.s<<this.DB-u);i>=0;)u<8?(p=(this[i]&(1<<u)-1)<<8-u,p|=this[--i]>>(u+=this.DB-8)):(p=this[i]>>(u-=8)&255,u<=0&&(u+=this.DB,--i)),(p&128)!=0&&(p|=-256),E==0&&(this.s&128)!=(p&128)&&++E,(E>0||p!=this.s)&&(a[E++]=p);return a}function Or(i){return this.compareTo(i)==0}function Fr(i){return this.compareTo(i)<0?this:i}function Ar(i){return this.compareTo(i)>0?this:i}function _r(i,a,u){var p,E,R=Math.min(i.t,this.t);for(p=0;p<R;++p)u[p]=a(this[p],i[p]);if(i.t<this.t){for(E=i.s&this.DM,p=R;p<this.t;++p)u[p]=a(this[p],E);u.t=this.t}else{for(E=this.s&this.DM,p=R;p<i.t;++p)u[p]=a(E,i[p]);u.t=i.t}u.s=a(this.s,i.s),u.clamp()}function Ir(i,a){return i&a}function Br(i){var a=c();return this.bitwiseTo(i,Ir,a),a}function ne(i,a){return i|a}function Cr(i){var a=c();return this.bitwiseTo(i,ne,a),a}function Ce(i,a){return i^a}function Dr(i){var a=c();return this.bitwiseTo(i,Ce,a),a}function De(i,a){return i&~a}function Pr(i){var a=c();return this.bitwiseTo(i,De,a),a}function qr(){for(var i=c(),a=0;a<this.t;++a)i[a]=this.DM&~this[a];return i.t=this.t,i.s=~this.s,i}function Mr(i){var a=c();return i<0?this.rShiftTo(-i,a):this.lShiftTo(i,a),a}function Nr(i){var a=c();return i<0?this.lShiftTo(-i,a):this.rShiftTo(i,a),a}function kr(i){if(i==0)return-1;var a=0;return(i&65535)==0&&(i>>=16,a+=16),(i&255)==0&&(i>>=8,a+=8),(i&15)==0&&(i>>=4,a+=4),(i&3)==0&&(i>>=2,a+=2),(i&1)==0&&++a,a}function Lr(){for(var i=0;i<this.t;++i)if(this[i]!=0)return i*this.DB+kr(this[i]);return this.s<0?this.t*this.DB:-1}function Ur(i){for(var a=0;i!=0;)i&=i-1,++a;return a}function Hr(){for(var i=0,a=this.s&this.DM,u=0;u<this.t;++u)i+=Ur(this[u]^a);return i}function zr(i){var a=Math.floor(i/this.DB);return a>=this.t?this.s!=0:(this[a]&1<<i%this.DB)!=0}function jr(i,a){var u=o.ONE.shiftLeft(i);return this.bitwiseTo(u,a,u),u}function $r(i){return this.changeBit(i,ne)}function Vr(i){return this.changeBit(i,De)}function Yr(i){return this.changeBit(i,Ce)}function Kr(i,a){for(var u=0,p=0,E=Math.min(i.t,this.t);u<E;)p+=this[u]+i[u],a[u++]=p&this.DM,p>>=this.DB;if(i.t<this.t){for(p+=i.s;u<this.t;)p+=this[u],a[u++]=p&this.DM,p>>=this.DB;p+=this.s}else{for(p+=this.s;u<i.t;)p+=i[u],a[u++]=p&this.DM,p>>=this.DB;p+=i.s}a.s=p<0?-1:0,p>0?a[u++]=p:p<-1&&(a[u++]=this.DV+p),a.t=u,a.clamp()}function Jr(i){var a=c();return this.addTo(i,a),a}function Wr(i){var a=c();return this.subTo(i,a),a}function Zr(i){var a=c();return this.multiplyTo(i,a),a}function Gr(){var i=c();return this.squareTo(i),i}function Xr(i){var a=c();return this.divRemTo(i,a,null),a}function Qr(i){var a=c();return this.divRemTo(i,null,a),a}function ts(i){var a=c(),u=c();return this.divRemTo(i,a,u),new Array(a,u)}function es(i){this[this.t]=this.am(0,i-1,this,0,0,this.t),++this.t,this.clamp()}function ns(i,a){if(i!=0){for(;this.t<=a;)this[this.t++]=0;for(this[a]+=i;this[a]>=this.DV;)this[a]-=this.DV,++a>=this.t&&(this[this.t++]=0),++this[a]}}function At(){}function Pe(i){return i}function rs(i,a,u){i.multiplyTo(a,u)}function ss(i,a){i.squareTo(a)}At.prototype.convert=Pe,At.prototype.revert=Pe,At.prototype.mulTo=rs,At.prototype.sqrTo=ss;function is(i){return this.exp(i,new At)}function os(i,a,u){var p=Math.min(this.t+i.t,a);for(u.s=0,u.t=p;p>0;)u[--p]=0;var E;for(E=u.t-this.t;p<E;++p)u[p+this.t]=this.am(0,i[p],u,p,0,this.t);for(E=Math.min(i.t,a);p<E;++p)this.am(0,i[p],u,p,0,a-p);u.clamp()}function as(i,a,u){--a;var p=u.t=this.t+i.t-a;for(u.s=0;--p>=0;)u[p]=0;for(p=Math.max(a-this.t,0);p<i.t;++p)u[this.t+p-a]=this.am(a-p,i[p],u,0,0,this.t+p-a);u.clamp(),u.drShiftTo(1,u)}function gt(i){this.r2=c(),this.q3=c(),o.ONE.dlShiftTo(2*i.t,this.r2),this.mu=this.r2.divide(i),this.m=i}function cs(i){if(i.s<0||i.t>2*this.m.t)return i.mod(this.m);if(i.compareTo(this.m)<0)return i;var a=c();return i.copyTo(a),this.reduce(a),a}function us(i){return i}function fs(i){for(i.drShiftTo(this.m.t-1,this.r2),i.t>this.m.t+1&&(i.t=this.m.t+1,i.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);i.compareTo(this.r2)<0;)i.dAddOffset(1,this.m.t+1);for(i.subTo(this.r2,i);i.compareTo(this.m)>=0;)i.subTo(this.m,i)}function ls(i,a){i.squareTo(a),this.reduce(a)}function hs(i,a,u){i.multiplyTo(a,u),this.reduce(u)}gt.prototype.convert=cs,gt.prototype.revert=us,gt.prototype.reduce=fs,gt.prototype.mulTo=hs,gt.prototype.sqrTo=ls;function ds(i,a){var u=i.bitLength(),p,E=S(1),R;if(u<=0)return E;u<18?p=1:u<48?p=3:u<144?p=4:u<768?p=5:p=6,u<8?R=new D(a):a.isEven()?R=new gt(a):R=new mt(a);var _=new Array,B=3,z=p-1,K=(1<<p)-1;if(_[1]=R.convert(this),p>1){var st=c();for(R.sqrTo(_[1],st);B<=K;)_[B]=c(),R.mulTo(st,_[B-2],_[B]),B+=2}var rt=i.t-1,lt,Nt=!0,ot=c(),at;for(u=P(i[rt])-1;rt>=0;){for(u>=z?lt=i[rt]>>u-z&K:(lt=(i[rt]&(1<<u+1)-1)<<z-u,rt>0&&(lt|=i[rt-1]>>this.DB+u-z)),B=p;(lt&1)==0;)lt>>=1,--B;if((u-=B)<0&&(u+=this.DB,--rt),Nt)_[lt].copyTo(E),Nt=!1;else{for(;B>1;)R.sqrTo(E,ot),R.sqrTo(ot,E),B-=2;B>0?R.sqrTo(E,ot):(at=E,E=ot,ot=at),R.mulTo(ot,_[lt],E)}for(;rt>=0&&(i[rt]&1<<u)==0;)R.sqrTo(E,ot),at=E,E=ot,ot=at,--u<0&&(u=this.DB-1,--rt)}return R.revert(E)}function ps(i){var a=this.s<0?this.negate():this.clone(),u=i.s<0?i.negate():i.clone();if(a.compareTo(u)<0){var p=a;a=u,u=p}var E=a.getLowestSetBit(),R=u.getLowestSetBit();if(R<0)return a;for(E<R&&(R=E),R>0&&(a.rShiftTo(R,a),u.rShiftTo(R,u));a.signum()>0;)(E=a.getLowestSetBit())>0&&a.rShiftTo(E,a),(E=u.getLowestSetBit())>0&&u.rShiftTo(E,u),a.compareTo(u)>=0?(a.subTo(u,a),a.rShiftTo(1,a)):(u.subTo(a,u),u.rShiftTo(1,u));return R>0&&u.lShiftTo(R,u),u}function ms(i){if(i<=0)return 0;var a=this.DV%i,u=this.s<0?i-1:0;if(this.t>0)if(a==0)u=this[0]%i;else for(var p=this.t-1;p>=0;--p)u=(a*u+this[p])%i;return u}function gs(i){var a=i.isEven();if(this.isEven()&&a||i.signum()==0)return o.ZERO;for(var u=i.clone(),p=this.clone(),E=S(1),R=S(0),_=S(0),B=S(1);u.signum()!=0;){for(;u.isEven();)u.rShiftTo(1,u),a?((!E.isEven()||!R.isEven())&&(E.addTo(this,E),R.subTo(i,R)),E.rShiftTo(1,E)):R.isEven()||R.subTo(i,R),R.rShiftTo(1,R);for(;p.isEven();)p.rShiftTo(1,p),a?((!_.isEven()||!B.isEven())&&(_.addTo(this,_),B.subTo(i,B)),_.rShiftTo(1,_)):B.isEven()||B.subTo(i,B),B.rShiftTo(1,B);u.compareTo(p)>=0?(u.subTo(p,u),a&&E.subTo(_,E),R.subTo(B,R)):(p.subTo(u,p),a&&_.subTo(E,_),B.subTo(R,B))}if(p.compareTo(o.ONE)!=0)return o.ZERO;if(B.compareTo(i)>=0)return B.subtract(i);if(B.signum()<0)B.addTo(i,B);else return B;return B.signum()<0?B.add(i):B}var G=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],ys=(1<<26)/G[G.length-1];function xs(i){var a,u=this.abs();if(u.t==1&&u[0]<=G[G.length-1]){for(a=0;a<G.length;++a)if(u[0]==G[a])return!0;return!1}if(u.isEven())return!1;for(a=1;a<G.length;){for(var p=G[a],E=a+1;E<G.length&&p<ys;)p*=G[E++];for(p=u.modInt(p);a<E;)if(p%G[a++]==0)return!1}return u.millerRabin(i)}function bs(i){var a=this.subtract(o.ONE),u=a.getLowestSetBit();if(u<=0)return!1;var p=a.shiftRight(u);i=i+1>>1,i>G.length&&(i=G.length);for(var E=c(),R=0;R<i;++R){E.fromInt(G[Math.floor(Math.random()*G.length)]);var _=E.modPow(p,this);if(_.compareTo(o.ONE)!=0&&_.compareTo(a)!=0){for(var B=1;B++<u&&_.compareTo(a)!=0;)if(_=_.modPowInt(2,this),_.compareTo(o.ONE)==0)return!1;if(_.compareTo(a)!=0)return!1}}return!0}o.prototype.chunkSize=wr,o.prototype.toRadix=Tr,o.prototype.fromRadix=Er,o.prototype.fromNumber=Sr,o.prototype.bitwiseTo=_r,o.prototype.changeBit=jr,o.prototype.addTo=Kr,o.prototype.dMultiply=es,o.prototype.dAddOffset=ns,o.prototype.multiplyLowerTo=os,o.prototype.multiplyUpperTo=as,o.prototype.modInt=ms,o.prototype.millerRabin=bs,o.prototype.clone=gr,o.prototype.intValue=yr,o.prototype.byteValue=xr,o.prototype.shortValue=br,o.prototype.signum=vr,o.prototype.toByteArray=Rr,o.prototype.equals=Or,o.prototype.min=Fr,o.prototype.max=Ar,o.prototype.and=Br,o.prototype.or=Cr,o.prototype.xor=Dr,o.prototype.andNot=Pr,o.prototype.not=qr,o.prototype.shiftLeft=Mr,o.prototype.shiftRight=Nr,o.prototype.getLowestSetBit=Lr,o.prototype.bitCount=Hr,o.prototype.testBit=zr,o.prototype.setBit=$r,o.prototype.clearBit=Vr,o.prototype.flipBit=Yr,o.prototype.add=Jr,o.prototype.subtract=Wr,o.prototype.multiply=Zr,o.prototype.divide=Xr,o.prototype.remainder=Qr,o.prototype.divideAndRemainder=ts,o.prototype.modPow=ds,o.prototype.modInverse=gs,o.prototype.pow=is,o.prototype.gcd=ps,o.prototype.isProbablePrime=xs,o.prototype.square=Gr,o.prototype.Barrett=gt;var Mt,nt,Y;function ws(i){nt[Y++]^=i&255,nt[Y++]^=i>>8&255,nt[Y++]^=i>>16&255,nt[Y++]^=i>>24&255,Y>=se&&(Y-=se)}function qe(){ws(new Date().getTime())}if(nt==null){nt=new Array,Y=0;var it;if(typeof window<"u"&&window.crypto){if(window.crypto.getRandomValues){var Me=new Uint8Array(32);for(window.crypto.getRandomValues(Me),it=0;it<32;++it)nt[Y++]=Me[it]}else if(navigator.appName=="Netscape"&&navigator.appVersion<"5"){var Ne=window.crypto.random(32);for(it=0;it<Ne.length;++it)nt[Y++]=Ne.charCodeAt(it)&255}}for(;Y<se;)it=Math.floor(65536*Math.random()),nt[Y++]=it>>>8,nt[Y++]=it&255;Y=0,qe()}function vs(){if(Mt==null){for(qe(),Mt=Rs(),Mt.init(nt),Y=0;Y<nt.length;++Y)nt[Y]=0;Y=0}return Mt.next()}function Ts(i){var a;for(a=0;a<i.length;++a)i[a]=vs()}function ke(){}ke.prototype.nextBytes=Ts;function re(){this.i=0,this.j=0,this.S=new Array}function Es(i){var a,u,p;for(a=0;a<256;++a)this.S[a]=a;for(u=0,a=0;a<256;++a)u=u+this.S[a]+i[a%i.length]&255,p=this.S[a],this.S[a]=this.S[u],this.S[u]=p;this.i=0,this.j=0}function Ss(){var i;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,i=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=i,this.S[i+this.S[this.i]&255]}re.prototype.init=Es,re.prototype.next=Ss;function Rs(){return new re}var se=256;t.exports={default:o,BigInteger:o,SecureRandom:ke}}).call(Ia)}($t)),$t.exports}var ue,rn;function Ba(){if(rn)return ue;rn=1;const{BigInteger:t}=ee();function e(d){let h=d.toString(16);if(h[0]!=="-")h.length%2===1?h="0"+h:h.match(/^[0-7]/)||(h="00"+h);else{h=h.substr(1);let l=h.length;l%2===1?l+=1:h.match(/^[0-7]/)||(l+=2);let v="";for(let O=0;O<l;O++)v+="f";v=new t(v,16),h=v.xor(d).add(t.ONE),h=h.toString(16).replace(/^-/,"")}return h}class n{constructor(){this.tlv=null,this.t="00",this.l="00",this.v=""}getEncodedHex(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv}getLength(){const h=this.v.length/2;let l=h.toString(16);return l.length%2===1&&(l="0"+l),h<128?l:(128+l.length/2).toString(16)+l}getValue(){return""}}class r extends n{constructor(h){super(),this.t="02",h&&(this.v=e(h))}getValue(){return this.v}}class s extends n{constructor(h){super(),this.t="30",this.asn1Array=h}getValue(){return this.v=this.asn1Array.map(h=>h.getEncodedHex()).join(""),this.v}}function o(d,h){return+d[h+2]<8?1:+d.substr(h+2,2)&128}function c(d,h){const l=o(d,h),v=d.substr(h+2,l*2);return v?(+v[0]<8?new t(v,16):new t(v.substr(2),16)).intValue():-1}function f(d,h){const l=o(d,h);return h+(l+1)*2}return ue={encodeDer(d,h){const l=new r(d),v=new r(h);return new s([l,v]).getEncodedHex()},decodeDer(d){const h=f(d,0),l=f(d,h),v=c(d,h),O=d.substr(l,v*2),I=l+O.length,w=f(d,I),F=c(d,I),m=d.substr(w,F*2),T=new t(O,16),b=new t(m,16);return{r:T,s:b}}},ue}var fe,sn;function Ca(){if(sn)return fe;sn=1;const{BigInteger:t}=ee(),e=new t("2"),n=new t("3");class r{constructor(f,d){this.x=d,this.q=f}equals(f){return f===this?!0:this.q.equals(f.q)&&this.x.equals(f.x)}toBigInteger(){return this.x}negate(){return new r(this.q,this.x.negate().mod(this.q))}add(f){return new r(this.q,this.x.add(f.toBigInteger()).mod(this.q))}subtract(f){return new r(this.q,this.x.subtract(f.toBigInteger()).mod(this.q))}multiply(f){return new r(this.q,this.x.multiply(f.toBigInteger()).mod(this.q))}divide(f){return new r(this.q,this.x.multiply(f.toBigInteger().modInverse(this.q)).mod(this.q))}square(){return new r(this.q,this.x.square().mod(this.q))}}class s{constructor(f,d,h,l){this.curve=f,this.x=d,this.y=h,this.z=l??t.ONE,this.zinv=null}getX(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))}getY(){return this.zinv===null&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))}equals(f){return f===this?!0:this.isInfinity()?f.isInfinity():f.isInfinity()?this.isInfinity():f.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(f.z)).mod(this.curve.q).equals(t.ZERO)?f.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(f.z)).mod(this.curve.q).equals(t.ZERO):!1}isInfinity(){return this.x===null&&this.y===null?!0:this.z.equals(t.ZERO)&&!this.y.toBigInteger().equals(t.ZERO)}negate(){return new s(this.curve,this.x,this.y.negate(),this.z)}add(f){if(this.isInfinity())return f;if(f.isInfinity())return this;const d=this.x.toBigInteger(),h=this.y.toBigInteger(),l=this.z,v=f.x.toBigInteger(),O=f.y.toBigInteger(),I=f.z,w=this.curve.q,F=d.multiply(I).mod(w),m=v.multiply(l).mod(w),T=F.subtract(m),b=h.multiply(I).mod(w),g=O.multiply(l).mod(w),S=b.subtract(g);if(t.ZERO.equals(T))return t.ZERO.equals(S)?this.twice():this.curve.infinity;const x=F.add(m),A=l.multiply(I).mod(w),C=T.square().mod(w),q=T.multiply(C).mod(w),N=A.multiply(S.square()).subtract(x.multiply(C)).mod(w),H=T.multiply(N).mod(w),P=S.multiply(C.multiply(F).subtract(N)).subtract(b.multiply(q)).mod(w),k=q.multiply(A).mod(w);return new s(this.curve,this.curve.fromBigInteger(H),this.curve.fromBigInteger(P),k)}twice(){if(this.isInfinity())return this;if(!this.y.toBigInteger().signum())return this.curve.infinity;const f=this.x.toBigInteger(),d=this.y.toBigInteger(),h=this.z,l=this.curve.q,v=this.curve.a.toBigInteger(),O=f.square().multiply(n).add(v.multiply(h.square())).mod(l),I=d.shiftLeft(1).multiply(h).mod(l),w=d.square().mod(l),F=w.multiply(f).multiply(h).mod(l),m=I.square().mod(l),T=O.square().subtract(F.shiftLeft(3)).mod(l),b=I.multiply(T).mod(l),g=O.multiply(F.shiftLeft(2).subtract(T)).subtract(m.shiftLeft(1).multiply(w)).mod(l),S=I.multiply(m).mod(l);return new s(this.curve,this.curve.fromBigInteger(b),this.curve.fromBigInteger(g),S)}multiply(f){if(this.isInfinity())return this;if(!f.signum())return this.curve.infinity;const d=f.multiply(n),h=this.negate();let l=this;for(let v=d.bitLength()-2;v>0;v--){l=l.twice();const O=d.testBit(v),I=f.testBit(v);O!==I&&(l=l.add(O?this:h))}return l}}class o{constructor(f,d,h){this.q=f,this.a=this.fromBigInteger(d),this.b=this.fromBigInteger(h),this.infinity=new s(this,null,null)}equals(f){return f===this?!0:this.q.equals(f.q)&&this.a.equals(f.a)&&this.b.equals(f.b)}fromBigInteger(f){return new r(this.q,f)}decodePointHex(f){switch(parseInt(f.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:const d=this.fromBigInteger(new t(f.substr(2),16));let h=this.fromBigInteger(d.multiply(d.square()).add(d.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new t("4")).add(t.ONE),this.q));return h.toBigInteger().mod(e).equals(new t(f.substr(0,2),16).subtract(e))||(h=h.negate()),new s(this,d,h);case 4:case 6:case 7:const l=(f.length-2)/2,v=f.substr(2,l),O=f.substr(l+2,l);return new s(this,this.fromBigInteger(new t(v,16)),this.fromBigInteger(new t(O,16)));default:return null}}}return fe={ECPointFp:s,ECCurveFp:o},fe}var le,on;function Da(){if(on)return le;on=1;const{BigInteger:t,SecureRandom:e}=ee(),{ECCurveFp:n}=Ca(),r=new e,{curve:s,G:o,n:c}=d();function f(){return s}function d(){const b=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFF",16),g=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFFFFFFFC",16),S=new t("28E9FA9E9D9F5E344D5A9E4BCF6509A7F39789F515AB8F92DDBCBD414D940E93",16),x=new n(b,g,S),q=x.decodePointHex("04"+"32C4AE2C1F1981195F9904466A39C9948FE30BBFF2660BE1715A4589334C74C7"+"BC3736A2F4F6779C59BDCEE36B692153D0A9877CC62A474002DF32E52139F0A0"),N=new t("FFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFF7203DF6B21C6052B53BBF40939D54123",16);return{curve:x,G:q,n:N}}function h(b,g,S){const A=(b?new t(b,g,S):new t(c.bitLength(),r)).mod(c.subtract(t.ONE)).add(t.ONE),C=O(A.toString(16),64),q=o.multiply(A),N=O(q.getX().toBigInteger().toString(16),64),H=O(q.getY().toBigInteger().toString(16),64),P="04"+N+H;return{privateKey:C,publicKey:P}}function l(b){if(b.length!==130)throw new Error("Invalid public key to compress");const g=(b.length-2)/2,S=b.substr(2,g),x=new t(b.substr(g+2,g),16);let A="03";return x.mod(new t("2")).equals(t.ZERO)&&(A="02"),A+S}function v(b){b=unescape(encodeURIComponent(b));const g=b.length,S=[];for(let A=0;A<g;A++)S[A>>>2]|=(b.charCodeAt(A)&255)<<24-A%4*8;const x=[];for(let A=0;A<g;A++){const C=S[A>>>2]>>>24-A%4*8&255;x.push((C>>>4).toString(16)),x.push((C&15).toString(16))}return x.join("")}function O(b,g){return b.length>=g?b:new Array(g-b.length+1).join("0")+b}function I(b){return b.map(g=>(g=g.toString(16),g.length===1?"0"+g:g)).join("")}function w(b){const g=[];let S=0;for(let x=0;x<b.length*2;x+=2)g[x>>>3]|=parseInt(b[S],10)<<24-x%8*4,S++;try{const x=[];for(let A=0;A<b.length;A++){const C=g[A>>>2]>>>24-A%4*8&255;x.push(String.fromCharCode(C))}return decodeURIComponent(escape(x.join("")))}catch{throw new Error("Malformed UTF-8 data")}}function F(b){const g=[];let S=b.length;S%2!==0&&(b=O(b,S+1)),S=b.length;for(let x=0;x<S;x+=2)g.push(parseInt(b.substr(x,2),16));return g}function m(b){const g=s.decodePointHex(b);if(!g)return!1;const S=g.getX();return g.getY().square().equals(S.multiply(S.square()).add(S.multiply(s.a)).add(s.b))}function T(b,g){const S=s.decodePointHex(b);if(!S)return!1;const x=s.decodePointHex(g);return x?S.equals(x):!1}return le={getGlobalCurve:f,generateEcparam:d,generateKeyPairHex:h,compressPublicKeyHex:l,utf8ToHex:v,leftPad:O,arrayToHex:I,arrayToUtf8:w,hexToArray:F,verifyPublicKey:m,comparePublicKeyHex:T},le}var he,an;function rr(){if(an)return he;an=1;const t=new Uint32Array(68),e=new Uint32Array(64);function n(v,O){const I=O&31;return v<<I|v>>>32-I}function r(v,O){const I=[];for(let w=v.length-1;w>=0;w--)I[w]=(v[w]^O[w])&255;return I}function s(v){return v^n(v,9)^n(v,17)}function o(v){return v^n(v,15)^n(v,23)}function c(v){let O=v.length*8,I=O%512;I=I>=448?512-I%448-1:448-I-1;const w=new Array((I-7)/8),F=new Array(8);for(let x=0,A=w.length;x<A;x++)w[x]=0;for(let x=0,A=F.length;x<A;x++)F[x]=0;O=O.toString(2);for(let x=7;x>=0;x--)if(O.length>8){const A=O.length-8;F[x]=parseInt(O.substr(A),2),O=O.substr(0,A)}else O.length>0&&(F[x]=parseInt(O,2),O="");const m=new Uint8Array([...v,128,...w,...F]),T=new DataView(m.buffer,0),b=m.length/64,g=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]);for(let x=0;x<b;x++){t.fill(0),e.fill(0);const A=16*x;for(let D=0;D<16;D++)t[D]=T.getUint32((A+D)*4,!1);for(let D=16;D<68;D++)t[D]=o(t[D-16]^t[D-9]^n(t[D-3],15))^n(t[D-13],7)^t[D-6];for(let D=0;D<64;D++)e[D]=t[D]^t[D+4];const C=2043430169,q=2055708042;let N=g[0],H=g[1],P=g[2],k=g[3],L=g[4],U=g[5],J=g[6],V=g[7],X,Z,pt,vt,et;for(let D=0;D<64;D++)et=D>=0&&D<=15?C:q,X=n(n(N,12)+L+n(et,D),7),Z=X^n(N,12),pt=(D>=0&&D<=15?N^H^P:N&H|N&P|H&P)+k+Z+e[D],vt=(D>=0&&D<=15?L^U^J:L&U|~L&J)+V+X+t[D],k=P,P=n(H,9),H=N,N=pt,V=J,J=n(U,19),U=L,L=s(vt);g[0]^=N,g[1]^=H,g[2]^=P,g[3]^=k,g[4]^=L,g[5]^=U,g[6]^=J,g[7]^=V}const S=[];for(let x=0,A=g.length;x<A;x++){const C=g[x];S.push((C&4278190080)>>>24,(C&16711680)>>>16,(C&65280)>>>8,C&255)}return S}const f=64,d=new Uint8Array(f),h=new Uint8Array(f);for(let v=0;v<f;v++)d[v]=54,h[v]=92;function l(v,O){for(O.length>f&&(O=c(O));O.length<f;)O.push(0);const I=r(O,d),w=r(O,h),F=c([...I,...v]);return c([...w,...F])}return he={sm3:c,hmac:l},he}var de,cn;function Pa(){if(cn)return de;cn=1;const{BigInteger:t}=ee(),{encodeDer:e,decodeDer:n}=Ba(),r=Da(),s=rr().sm3,{G:o,curve:c,n:f}=r.generateEcparam(),d=0;function h(m,T,b=1){m=typeof m=="string"?r.hexToArray(r.utf8ToHex(m)):Array.prototype.slice.call(m),T=r.getGlobalCurve().decodePointHex(T);const g=r.generateKeyPairHex(),S=new t(g.privateKey,16);let x=g.publicKey;x.length>128&&(x=x.substr(x.length-128));const A=T.multiply(S),C=r.hexToArray(r.leftPad(A.getX().toBigInteger().toRadix(16),64)),q=r.hexToArray(r.leftPad(A.getY().toBigInteger().toRadix(16),64)),N=r.arrayToHex(s([].concat(C,m,q)));let H=1,P=0,k=[];const L=[].concat(C,q),U=()=>{k=s([...L,H>>24&255,H>>16&255,H>>8&255,H&255]),H++,P=0};U();for(let V=0,X=m.length;V<X;V++)P===k.length&&U(),m[V]^=k[P++]&255;const J=r.arrayToHex(m);return b===d?x+J+N:x+N+J}function l(m,T,b=1,{output:g="string"}={}){T=new t(T,16);let S=m.substr(128,64),x=m.substr(192);b===d&&(S=m.substr(m.length-64),x=m.substr(128,m.length-128-64));const A=r.hexToArray(x),q=r.getGlobalCurve().decodePointHex("04"+m.substr(0,128)).multiply(T),N=r.hexToArray(r.leftPad(q.getX().toBigInteger().toRadix(16),64)),H=r.hexToArray(r.leftPad(q.getY().toBigInteger().toRadix(16),64));let P=1,k=0,L=[];const U=[].concat(N,H),J=()=>{L=s([...U,P>>24&255,P>>16&255,P>>8&255,P&255]),P++,k=0};J();for(let X=0,Z=A.length;X<Z;X++)k===L.length&&J(),A[X]^=L[k++]&255;return r.arrayToHex(s([].concat(N,A,H)))===S.toLowerCase()?g==="array"?A:r.arrayToUtf8(A):g==="array"?[]:""}function v(m,T,{pointPool:b,der:g,hash:S,publicKey:x,userId:A}={}){let C=typeof m=="string"?r.utf8ToHex(m):r.arrayToHex(m);S&&(x=x||w(T),C=I(C,x,A));const q=new t(T,16),N=new t(C,16);let H=null,P=null,k=null;do{do{let L;b&&b.length?L=b.pop():L=F(),H=L.k,P=N.add(L.x1).mod(f)}while(P.equals(t.ZERO)||P.add(H).equals(f));k=q.add(t.ONE).modInverse(f).multiply(H.subtract(P.multiply(q))).mod(f)}while(k.equals(t.ZERO));return g?e(P,k):r.leftPad(P.toString(16),64)+r.leftPad(k.toString(16),64)}function O(m,T,b,{der:g,hash:S,userId:x}={}){let A=typeof m=="string"?r.utf8ToHex(m):r.arrayToHex(m);S&&(A=I(A,b,x));let C,q;if(g){const U=n(T);C=U.r,q=U.s}else C=new t(T.substring(0,64),16),q=new t(T.substring(64),16);const N=c.decodePointHex(b),H=new t(A,16),P=C.add(q).mod(f);if(P.equals(t.ZERO))return!1;const k=o.multiply(q).add(N.multiply(P)),L=H.add(k.getX().toBigInteger()).mod(f);return C.equals(L)}function I(m,T,b="1234567812345678"){b=r.utf8ToHex(b);const g=r.leftPad(o.curve.a.toBigInteger().toRadix(16),64),S=r.leftPad(o.curve.b.toBigInteger().toRadix(16),64),x=r.leftPad(o.getX().toBigInteger().toRadix(16),64),A=r.leftPad(o.getY().toBigInteger().toRadix(16),64);let C,q;if(T.length===128)C=T.substr(0,64),q=T.substr(64,64);else{const k=o.curve.decodePointHex(T);C=r.leftPad(k.getX().toBigInteger().toRadix(16),64),q=r.leftPad(k.getY().toBigInteger().toRadix(16),64)}const N=r.hexToArray(b+g+S+x+A+C+q),H=b.length*4;N.unshift(H&255),N.unshift(H>>8&255);const P=s(N);return r.arrayToHex(s(P.concat(r.hexToArray(m))))}function w(m){const T=o.multiply(new t(m,16)),b=r.leftPad(T.getX().toBigInteger().toString(16),64),g=r.leftPad(T.getY().toBigInteger().toString(16),64);return"04"+b+g}function F(){const m=r.generateKeyPairHex(),T=c.decodePointHex(m.publicKey);return m.k=new t(m.privateKey,16),m.x1=T.getX().toBigInteger(),m}return de={generateKeyPairHex:r.generateKeyPairHex,compressPublicKeyHex:r.compressPublicKeyHex,comparePublicKeyHex:r.comparePublicKeyHex,doEncrypt:h,doDecrypt:l,doSignature:v,doVerifySignature:O,getPublicKeyFromPrivateKey:w,getPoint:F,verifyPublicKey:r.verifyPublicKey},de}var pe,un;function qa(){if(un)return pe;un=1;const{sm3:t,hmac:e}=rr();function n(c,f){return c.length>=f?c:new Array(f-c.length+1).join("0")+c}function r(c){return c.map(f=>(f=f.toString(16),f.length===1?"0"+f:f)).join("")}function s(c){const f=[];let d=c.length;d%2!==0&&(c=n(c,d+1)),d=c.length;for(let h=0;h<d;h+=2)f.push(parseInt(c.substr(h,2),16));return f}function o(c){const f=[];for(let d=0,h=c.length;d<h;d++){const l=c.codePointAt(d);if(l<=127)f.push(l);else if(l<=2047)f.push(192|l>>>6),f.push(128|l&63);else if(l<=55295||l>=57344&&l<=65535)f.push(224|l>>>12),f.push(128|l>>>6&63),f.push(128|l&63);else if(l>=65536&&l<=1114111)d++,f.push(240|l>>>18&28),f.push(128|l>>>12&63),f.push(128|l>>>6&63),f.push(128|l&63);else throw f.push(l),new Error("input is not supported")}return f}return pe=function(c,f){if(c=typeof c=="string"?o(c):Array.prototype.slice.call(c),f){if((f.mode||"hmac")!=="hmac")throw new Error("invalid mode");let h=f.key;if(!h)throw new Error("invalid key");return h=typeof h=="string"?s(h):Array.prototype.slice.call(h),r(e(c,h))}return r(t(c))},pe}var me,fn;function Ma(){if(fn)return me;fn=1;const t=0,e=32,n=16,r=[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],s=[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];function o(m){const T=[];for(let b=0,g=m.length;b<g;b+=2)T.push(parseInt(m.substr(b,2),16));return T}function c(m){return m.map(T=>(T=T.toString(16),T.length===1?"0"+T:T)).join("")}function f(m){const T=[];for(let b=0,g=m.length;b<g;b++){const S=m.codePointAt(b);if(S<=127)T.push(S);else if(S<=2047)T.push(192|S>>>6),T.push(128|S&63);else if(S<=55295||S>=57344&&S<=65535)T.push(224|S>>>12),T.push(128|S>>>6&63),T.push(128|S&63);else if(S>=65536&&S<=1114111)b++,T.push(240|S>>>18&28),T.push(128|S>>>12&63),T.push(128|S>>>6&63),T.push(128|S&63);else throw T.push(S),new Error("input is not supported")}return T}function d(m){const T=[];for(let b=0,g=m.length;b<g;b++)m[b]>=240&&m[b]<=247?(T.push(String.fromCodePoint(((m[b]&7)<<18)+((m[b+1]&63)<<12)+((m[b+2]&63)<<6)+(m[b+3]&63))),b+=3):m[b]>=224&&m[b]<=239?(T.push(String.fromCodePoint(((m[b]&15)<<12)+((m[b+1]&63)<<6)+(m[b+2]&63))),b+=2):m[b]>=192&&m[b]<=223?(T.push(String.fromCodePoint(((m[b]&31)<<6)+(m[b+1]&63))),b++):T.push(String.fromCodePoint(m[b]));return T.join("")}function h(m,T){const b=T&31;return m<<b|m>>>32-b}function l(m){return(r[m>>>24&255]&255)<<24|(r[m>>>16&255]&255)<<16|(r[m>>>8&255]&255)<<8|r[m&255]&255}function v(m){return m^h(m,2)^h(m,10)^h(m,18)^h(m,24)}function O(m){return m^h(m,13)^h(m,23)}function I(m,T,b){const g=new Array(4),S=new Array(4);for(let x=0;x<4;x++)S[0]=m[4*x]&255,S[1]=m[4*x+1]&255,S[2]=m[4*x+2]&255,S[3]=m[4*x+3]&255,g[x]=S[0]<<24|S[1]<<16|S[2]<<8|S[3];for(let x=0,A;x<32;x+=4)A=g[1]^g[2]^g[3]^b[x+0],g[0]^=v(l(A)),A=g[2]^g[3]^g[0]^b[x+1],g[1]^=v(l(A)),A=g[3]^g[0]^g[1]^b[x+2],g[2]^=v(l(A)),A=g[0]^g[1]^g[2]^b[x+3],g[3]^=v(l(A));for(let x=0;x<16;x+=4)T[x]=g[3-x/4]>>>24&255,T[x+1]=g[3-x/4]>>>16&255,T[x+2]=g[3-x/4]>>>8&255,T[x+3]=g[3-x/4]&255}function w(m,T,b){const g=new Array(4),S=new Array(4);for(let x=0;x<4;x++)S[0]=m[0+4*x]&255,S[1]=m[1+4*x]&255,S[2]=m[2+4*x]&255,S[3]=m[3+4*x]&255,g[x]=S[0]<<24|S[1]<<16|S[2]<<8|S[3];g[0]^=2746333894,g[1]^=1453994832,g[2]^=1736282519,g[3]^=2993693404;for(let x=0,A;x<32;x+=4)A=g[1]^g[2]^g[3]^s[x+0],T[x+0]=g[0]^=O(l(A)),A=g[2]^g[3]^g[0]^s[x+1],T[x+1]=g[1]^=O(l(A)),A=g[3]^g[0]^g[1]^s[x+2],T[x+2]=g[2]^=O(l(A)),A=g[0]^g[1]^g[2]^s[x+3],T[x+3]=g[3]^=O(l(A));if(b===t)for(let x=0,A;x<16;x++)A=T[x],T[x]=T[31-x],T[31-x]=A}function F(m,T,b,{padding:g="pkcs#7",mode:S,iv:x=[],output:A="string"}={}){if(S==="cbc"&&(typeof x=="string"&&(x=o(x)),x.length!==128/8))throw new Error("iv is invalid");if(typeof T=="string"&&(T=o(T)),T.length!==128/8)throw new Error("key is invalid");if(typeof m=="string"?b!==t?m=f(m):m=o(m):m=[...m],(g==="pkcs#5"||g==="pkcs#7")&&b!==t){const k=n-m.length%n;for(let L=0;L<k;L++)m.push(k)}const C=new Array(e);w(T,C,b);const q=[];let N=x,H=m.length,P=0;for(;H>=n;){const k=m.slice(P,P+16),L=new Array(16);if(S==="cbc")for(let U=0;U<n;U++)b!==t&&(k[U]^=N[U]);I(k,L,C);for(let U=0;U<n;U++)S==="cbc"&&b===t&&(L[U]^=N[U]),q[P+U]=L[U];S==="cbc"&&(b!==t?N=L:N=k),H-=n,P+=n}if((g==="pkcs#5"||g==="pkcs#7")&&b===t){const k=q.length,L=q[k-1];for(let U=1;U<=L;U++)if(q[k-U]!==L)throw new Error("padding is invalid");q.splice(k-L,L)}return A!=="array"?b!==t?c(q):d(q):q}return me={encrypt(m,T,b){return F(m,T,1,b)},decrypt(m,T,b){return F(m,T,0,b)}},me}var ge,ln;function Na(){return ln||(ln=1,ge={sm2:Pa(),sm3:qa(),sm4:Ma()}),ge}var sr=Na();const Ie=sr.sm2,Be=sr.sm4,ka=(t,e,n="04")=>n+Ie.doEncrypt(t,e),La=(t,e,n="04")=>Ie.doDecrypt(t.startsWith(n)?t.slice(2):t,e),Ua=(t,e)=>Be.encrypt(t,e),Ha=(t,e)=>Be.decrypt(t,e);let It=[],za={consecutiveFrames:0,lastBlinkTime:0},ja={consecutiveFrames:0,lastBlinkTime:0};const $a=new Map([["nod",[Qa,30]],["shake",[Xa,7]],["mouth",[Ga,.35]],["eye",[Za,.3]]]),Va=["nod","shake","mouth","eye"],Ya={nod:"请点点头",shake:"请摇摇头",mouth:"请张张嘴",eye:"请眨眨眼"};function hn(t,e){if(t.length!==e.length)throw new Error("euclideanDistance: arr1.length !== arr2.length");const n=Array.from(t),r=Array.from(e);return Math.sqrt(n.map((s,o)=>s-r[o]).reduce((s,o)=>s+Math.pow(o,2),0))}function*Ka(t,e,n,r,s){for(let o=n;o>0;o--)yield t(e,s,r)}function Ut(t){return[t.x,t.y]}function ye(t,e){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function dn(t){const e=ye(t[1],t[5]),n=ye(t[2],t[4]),r=ye(t[0],t[3]);return(e+n)/(2*r)}function Ja(t){const e=hn(Ut(t[13]),Ut(t[19])),n=hn(Ut(t[0]),Ut(t[6]));return e/n}function Wa(t){const e=t.positions[30],n=t.positions[36],r=t.positions[45],s=(n.x+r.x)/2;return(e.x-s)/(r.x-n.x)*30}function Za(t,e){const n=Date.now(),r=pn(dn(t.getLeftEye()),e,za,n),s=pn(dn(t.getRightEye()),e,ja,n);return!!(r||s)}function pn(t,e,n,r){if(t<e)n.consecutiveFrames++;else if(n.consecutiveFrames>=3&&r-n.lastBlinkTime>500)return n.lastBlinkTime=r,n.consecutiveFrames=0,!0;return!1}function Ga(t,e){return Ja(t.getMouth())>e}function Xa(t,e){const n=Wa(t);return Math.abs(n)>e}function Qa(t,e){const n=It.length,r=t.positions[33];if(n<5)It.push(r.y);else if(n===5){const s=Math.min(...It);if(Math.max(...It)-s>e)return!0;It=[]}return!1}function tc(t,e="blob",n=1){return new Promise(r=>{const s=document.createElement("canvas"),o=s.getContext("2d");s.width=t.videoWidth,s.height=t.videoHeight,o==null||o.drawImage(t,0,0,s.width,s.height),e==="blob"?s.toBlob(c=>{const f=new FileReader;f.onload=()=>r(f.result),f.readAsArrayBuffer(c)},"image/png",n):r(s.toDataURL("image/png",n))})}async function ec(t){const{landmarksFn:e,videoEl:n,gesture:r,gestureThreshold:s,generatedNumber:o=5,waitTime:c=100,detectionScore:f=.5}=t,[d,h]=$a.get(r);if(!d)return!1;const l=[],v=Ka(e,n,o,c,f);for(const O of v){const I=await O;if(!I)continue;const w=d(I.landmarks,s??h);l.push(w)}return l.includes(!0)}const nc={DATE_VALUE_FORMAT:gi,COMMON_TEXT:dt,IMAGE_TYPE:wn,MEDIA_TYPE:vn,DOC_TYPE:Tn,FILE_TYPE:xi},rc={encodeURIToParams:Rn,paramsToQueryString:Ai,queryStringToParams:_i,errorCodeToString:En,YNToString:bi,HNToString:wi,valueToLabel:Ri,chargeToLabel:Oi,cascaderToLabel:Sn,multipleSelectToLabel:Fi,phoneToAsterisk:vi,idNumberToAsterisk:Ti,firstLetterToUpperCase:Ei,firstLetterToLowerCase:Si},sc={validHttp:zs,validExternal:js,validString:$s,validNumberStr:Vs,validEmptyObject:Ys,validURL:Ks,validPassword:Js,validEmail:Ws,validIdNumber:Oe,validPhone:Gs,validTel:Zs},ic={scrollTo:Cs,addClass:ks,removeClass:Ls,hasClass:Re,toggleClass:Ns,noContextmenu:Hs,useRafThrottle:Us},oc={parseTime:Vt,getTimeDistance:qs,getDayRange:Ms},ac={local:mn,session:ct},cc={uuid:Ps,randomNum:Ds};exports.CONSTANTS=nc;exports.NOOP=xe;exports.NetworkManager=Gn;exports.Request=aa;exports.TokenManager=Zn;exports.addResizeListener=Aa;exports.cacheUtil=ac;exports.countdownTimer=Qs;exports.creatCancelTask=ai;exports.dateUtil=oc;exports.debounce=ei;exports.downloadFile=ci;exports.elementUtil=ic;exports.faceLivingEvent=Va;exports.faceLivingEventHint=Ya;exports.getArrayFullUrl=ii;exports.getBirthdayByIdNumber=ri;exports.getFaceGestureResult=ec;exports.getFaceVideoFrame=tc;exports.getFullUrl=xn;exports.getGenderByIdNumber=ni;exports.getLocationConfig=gn;exports.getMapLocationIcon=hi;exports.getPercentage=ui;exports.getRandomItemInArray=ti;exports.getRequestBaseUrl=ca;exports.getSystemConfig=si;exports.loadCss=fi;exports.loadJs=li;exports.randomUtil=cc;exports.removeResizeListener=_a;exports.ricTask=oi;exports.sleep=Xs;exports.sm2Crypto=Ie;exports.sm2Decrypt=La;exports.sm2Encrypt=ka;exports.sm4Crypto=Be;exports.sm4Decrypt=Ha;exports.sm4Encrypt=Ua;exports.toUtil=rc;exports.transformPathName=yn;exports.trimArray=bn;exports.validUtil=sc;
|
package/lib/index.mjs
CHANGED
|
@@ -833,7 +833,7 @@ function Xt(t, e, n) {
|
|
|
833
833
|
convertValue: h,
|
|
834
834
|
isVisitable: be
|
|
835
835
|
});
|
|
836
|
-
function
|
|
836
|
+
function I(w, F) {
|
|
837
837
|
if (!y.isUndefined(w)) {
|
|
838
838
|
if (v.indexOf(w) !== -1)
|
|
839
839
|
throw Error("Circular reference detected in " + F.join("."));
|
|
@@ -844,13 +844,13 @@ function Xt(t, e, n) {
|
|
|
844
844
|
y.isString(b) ? b.trim() : b,
|
|
845
845
|
F,
|
|
846
846
|
O
|
|
847
|
-
)) === !0 &&
|
|
847
|
+
)) === !0 && I(T, F ? F.concat(b) : [b]);
|
|
848
848
|
}), v.pop();
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
if (!y.isObject(t))
|
|
852
852
|
throw new TypeError("data must be an object");
|
|
853
|
-
return
|
|
853
|
+
return I(t), e;
|
|
854
854
|
}
|
|
855
855
|
function Le(t) {
|
|
856
856
|
const e = {
|
|
@@ -1334,8 +1334,8 @@ function To(t, e) {
|
|
|
1334
1334
|
O += n[v++], v = v % t;
|
|
1335
1335
|
if (s = (s + 1) % t, s === o && (o = (o + 1) % t), h - c < e)
|
|
1336
1336
|
return;
|
|
1337
|
-
const
|
|
1338
|
-
return
|
|
1337
|
+
const I = l && h - l;
|
|
1338
|
+
return I ? Math.round(O * 1e3 / I) : void 0;
|
|
1339
1339
|
};
|
|
1340
1340
|
}
|
|
1341
1341
|
function Eo(t, e) {
|
|
@@ -1507,9 +1507,9 @@ const kn = (t) => {
|
|
|
1507
1507
|
const s = kn(t);
|
|
1508
1508
|
let o = s.data;
|
|
1509
1509
|
const c = tt.from(s.headers).normalize();
|
|
1510
|
-
let { responseType: f, onUploadProgress: d, onDownloadProgress: h } = s, l, v, O,
|
|
1510
|
+
let { responseType: f, onUploadProgress: d, onDownloadProgress: h } = s, l, v, O, I, w;
|
|
1511
1511
|
function F() {
|
|
1512
|
-
|
|
1512
|
+
I && I(), w && w(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
|
|
1513
1513
|
}
|
|
1514
1514
|
let m = new XMLHttpRequest();
|
|
1515
1515
|
m.open(s.method.toUpperCase(), s.url, !0), m.timeout = s.timeout;
|
|
@@ -1550,7 +1550,7 @@ const kn = (t) => {
|
|
|
1550
1550
|
)), m = null;
|
|
1551
1551
|
}, o === void 0 && c.setContentType(null), "setRequestHeader" in m && y.forEach(c.toJSON(), function(S, x) {
|
|
1552
1552
|
m.setRequestHeader(x, S);
|
|
1553
|
-
}), y.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), f && f !== "json" && (m.responseType = s.responseType), h && ([O, w] = Vt(h, !0), m.addEventListener("progress", O)), d && m.upload && ([v,
|
|
1553
|
+
}), y.isUndefined(s.withCredentials) || (m.withCredentials = !!s.withCredentials), f && f !== "json" && (m.responseType = s.responseType), h && ([O, w] = Vt(h, !0), m.addEventListener("progress", O)), d && m.upload && ([v, I] = Vt(d), m.upload.addEventListener("progress", v), m.upload.addEventListener("loadend", I)), (s.cancelToken || s.signal) && (l = (g) => {
|
|
1554
1554
|
m && (r(!g || g.type ? new Ot(null, t, m) : g), m.abort(), m = null);
|
|
1555
1555
|
}, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
|
|
1556
1556
|
const b = vo(s.url);
|
|
@@ -1694,7 +1694,7 @@ const kn = (t) => {
|
|
|
1694
1694
|
return w.byteLength;
|
|
1695
1695
|
if (y.isURLSearchParams(w) && (w = w + ""), y.isString(w))
|
|
1696
1696
|
return (await d(w)).byteLength;
|
|
1697
|
-
},
|
|
1697
|
+
}, I = async (w, F) => {
|
|
1698
1698
|
const m = y.toFiniteNumber(w.getContentLength());
|
|
1699
1699
|
return m ?? O(F);
|
|
1700
1700
|
};
|
|
@@ -1720,7 +1720,7 @@ const kn = (t) => {
|
|
|
1720
1720
|
});
|
|
1721
1721
|
let J;
|
|
1722
1722
|
try {
|
|
1723
|
-
if (A && h && m !== "get" && m !== "head" && (J = await
|
|
1723
|
+
if (A && h && m !== "get" && m !== "head" && (J = await I(q, T)) !== 0) {
|
|
1724
1724
|
let et = new n(F, {
|
|
1725
1725
|
method: "POST",
|
|
1726
1726
|
body: T,
|
|
@@ -1990,18 +1990,18 @@ let bt = class {
|
|
|
1990
1990
|
return l;
|
|
1991
1991
|
}
|
|
1992
1992
|
O = f.length;
|
|
1993
|
-
let
|
|
1993
|
+
let I = n;
|
|
1994
1994
|
for (; v < O; ) {
|
|
1995
1995
|
const w = f[v++], F = f[v++];
|
|
1996
1996
|
try {
|
|
1997
|
-
|
|
1997
|
+
I = w(I);
|
|
1998
1998
|
} catch (m) {
|
|
1999
1999
|
F.call(this, m);
|
|
2000
2000
|
break;
|
|
2001
2001
|
}
|
|
2002
2002
|
}
|
|
2003
2003
|
try {
|
|
2004
|
-
l = Ge.call(this,
|
|
2004
|
+
l = Ge.call(this, I);
|
|
2005
2005
|
} catch (w) {
|
|
2006
2006
|
return Promise.reject(w);
|
|
2007
2007
|
}
|
|
@@ -2456,7 +2456,7 @@ class uc {
|
|
|
2456
2456
|
setupInterceptors() {
|
|
2457
2457
|
this.axiosInstance.interceptors.request.use(
|
|
2458
2458
|
(e) => {
|
|
2459
|
-
var O,
|
|
2459
|
+
var O, I;
|
|
2460
2460
|
const {
|
|
2461
2461
|
showLoading: n,
|
|
2462
2462
|
queueWhenOffline: r,
|
|
@@ -2471,7 +2471,7 @@ class uc {
|
|
|
2471
2471
|
const m = { config: e, resolve: w, reject: F };
|
|
2472
2472
|
this.networkInstance.addToOfflineQueue(m);
|
|
2473
2473
|
});
|
|
2474
|
-
if (n && ((O = this.loadingInstance) == null || O.show(d)), s && this.cancelInstance.addPending(e), o && typeof o == "function" && o(e, c), ((
|
|
2474
|
+
if (n && ((O = this.loadingInstance) == null || O.show(d)), s && this.cancelInstance.addPending(e), o && typeof o == "function" && o(e, c), ((I = e.method) == null ? void 0 : I.toUpperCase()) === "GET" && e.params) {
|
|
2475
2475
|
let w = `${e.url}?${bn(e.params)}`;
|
|
2476
2476
|
e.params = { _t: (/* @__PURE__ */ new Date()).getTime() }, e.url = w.slice(0, -1);
|
|
2477
2477
|
}
|
|
@@ -2509,13 +2509,13 @@ class uc {
|
|
|
2509
2509
|
refreshToken: f = {},
|
|
2510
2510
|
retryDelay: d = 1e3,
|
|
2511
2511
|
maxRetries: h = 0
|
|
2512
|
-
} = this.requestInstanceRequestOptions, { autoRefresh: l, refreshRequest: v, refrechFailed: O } = f,
|
|
2513
|
-
if (n && s && this.cancelInstance.removePending(n), r && ((F = this.loadingInstance) == null || F.hide()), h > 0 &&
|
|
2512
|
+
} = this.requestInstanceRequestOptions, { autoRefresh: l, refreshRequest: v, refrechFailed: O } = f, I = n.retryCount || 0;
|
|
2513
|
+
if (n && s && this.cancelInstance.removePending(n), r && ((F = this.loadingInstance) == null || F.hide()), h > 0 && I < h) {
|
|
2514
2514
|
const b = {
|
|
2515
2515
|
...n,
|
|
2516
|
-
retryCount:
|
|
2516
|
+
retryCount: I + 1
|
|
2517
2517
|
};
|
|
2518
|
-
return await new Promise((g) => setTimeout(g, d)), console.log(`Retrying request (${
|
|
2518
|
+
return await new Promise((g) => setTimeout(g, d)), console.log(`Retrying request (${I + 1}/${h}): ${n.url}`), this.axiosInstance(b);
|
|
2519
2519
|
}
|
|
2520
2520
|
if (((m = e.response) == null ? void 0 : m.status) === 401 && l && this.tokenInstance.getRefreshToken())
|
|
2521
2521
|
try {
|
|
@@ -2634,8 +2634,8 @@ class uc {
|
|
|
2634
2634
|
if (!d) {
|
|
2635
2635
|
const v = c.headers["content-disposition"];
|
|
2636
2636
|
if (v) {
|
|
2637
|
-
const
|
|
2638
|
-
|
|
2637
|
+
const I = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(v);
|
|
2638
|
+
I != null && I[1] && (d = decodeURIComponent(I[1].replace(/['"]/g, "")));
|
|
2639
2639
|
}
|
|
2640
2640
|
d = d || "download";
|
|
2641
2641
|
}
|
|
@@ -2993,16 +2993,16 @@ function ee() {
|
|
|
2993
2993
|
return E;
|
|
2994
2994
|
}
|
|
2995
2995
|
function d(i, a, u, p, E, R) {
|
|
2996
|
-
for (var _ = a & 32767,
|
|
2997
|
-
var z = this[i] & 32767, K = this[i++] >> 15, st =
|
|
2998
|
-
z = _ * z + ((st & 32767) << 15) + u[p] + (E & 1073741823), E = (z >>> 30) + (st >>> 15) +
|
|
2996
|
+
for (var _ = a & 32767, B = a >> 15; --R >= 0; ) {
|
|
2997
|
+
var z = this[i] & 32767, K = this[i++] >> 15, st = B * z + K * _;
|
|
2998
|
+
z = _ * z + ((st & 32767) << 15) + u[p] + (E & 1073741823), E = (z >>> 30) + (st >>> 15) + B * K + (E >>> 30), u[p++] = z & 1073741823;
|
|
2999
2999
|
}
|
|
3000
3000
|
return E;
|
|
3001
3001
|
}
|
|
3002
3002
|
function h(i, a, u, p, E, R) {
|
|
3003
|
-
for (var _ = a & 16383,
|
|
3004
|
-
var z = this[i] & 16383, K = this[i++] >> 14, st =
|
|
3005
|
-
z = _ * z + ((st & 16383) << 14) + u[p] + E, E = (z >> 28) + (st >> 14) +
|
|
3003
|
+
for (var _ = a & 16383, B = a >> 14; --R >= 0; ) {
|
|
3004
|
+
var z = this[i] & 16383, K = this[i++] >> 14, st = B * z + K * _;
|
|
3005
|
+
z = _ * z + ((st & 16383) << 14) + u[p] + E, E = (z >> 28) + (st >> 14) + B * K, u[p++] = z & 268435455;
|
|
3006
3006
|
}
|
|
3007
3007
|
return E;
|
|
3008
3008
|
}
|
|
@@ -3010,15 +3010,15 @@ function ee() {
|
|
|
3010
3010
|
l && s && navigator.appName == "Microsoft Internet Explorer" ? (o.prototype.am = d, n = 30) : l && s && navigator.appName != "Netscape" ? (o.prototype.am = f, n = 26) : (o.prototype.am = h, n = 28), o.prototype.DB = n, o.prototype.DM = (1 << n) - 1, o.prototype.DV = 1 << n;
|
|
3011
3011
|
var v = 52;
|
|
3012
3012
|
o.prototype.FV = Math.pow(2, v), o.prototype.F1 = v - n, o.prototype.F2 = 2 * n - v;
|
|
3013
|
-
var O = "0123456789abcdefghijklmnopqrstuvwxyz",
|
|
3014
|
-
for (w = 48, F = 0; F <= 9; ++F)
|
|
3015
|
-
for (w = 97, F = 10; F < 36; ++F)
|
|
3016
|
-
for (w = 65, F = 10; F < 36; ++F)
|
|
3013
|
+
var O = "0123456789abcdefghijklmnopqrstuvwxyz", I = new Array(), w, F;
|
|
3014
|
+
for (w = 48, F = 0; F <= 9; ++F) I[w++] = F;
|
|
3015
|
+
for (w = 97, F = 10; F < 36; ++F) I[w++] = F;
|
|
3016
|
+
for (w = 65, F = 10; F < 36; ++F) I[w++] = F;
|
|
3017
3017
|
function m(i) {
|
|
3018
3018
|
return O.charAt(i);
|
|
3019
3019
|
}
|
|
3020
3020
|
function T(i, a) {
|
|
3021
|
-
var u =
|
|
3021
|
+
var u = I[i.charCodeAt(a)];
|
|
3022
3022
|
return u ?? -1;
|
|
3023
3023
|
}
|
|
3024
3024
|
function b(i) {
|
|
@@ -3067,10 +3067,10 @@ function ee() {
|
|
|
3067
3067
|
else if (i == 32) a = 5;
|
|
3068
3068
|
else if (i == 4) a = 2;
|
|
3069
3069
|
else return this.toRadix(i);
|
|
3070
|
-
var u = (1 << a) - 1, p, E = !1, R = "", _ = this.t,
|
|
3070
|
+
var u = (1 << a) - 1, p, E = !1, R = "", _ = this.t, B = this.DB - _ * this.DB % a;
|
|
3071
3071
|
if (_-- > 0)
|
|
3072
|
-
for (
|
|
3073
|
-
|
|
3072
|
+
for (B < this.DB && (p = this[_] >> B) > 0 && (E = !0, R = m(p)); _ >= 0; )
|
|
3073
|
+
B < a ? (p = (this[_] & (1 << B) - 1) << a - B, p |= this[--_] >> (B += this.DB - a)) : (p = this[_] >> (B -= a) & u, B <= 0 && (B += this.DB, --_)), p > 0 && (E = !0), E && (R += m(p));
|
|
3074
3074
|
return E ? R : "0";
|
|
3075
3075
|
}
|
|
3076
3076
|
function q() {
|
|
@@ -3106,10 +3106,10 @@ function ee() {
|
|
|
3106
3106
|
a.t = Math.max(this.t - i, 0), a.s = this.s;
|
|
3107
3107
|
}
|
|
3108
3108
|
function J(i, a) {
|
|
3109
|
-
var u = i % this.DB, p = this.DB - u, E = (1 << p) - 1, R = Math.floor(i / this.DB), _ = this.s << u & this.DM,
|
|
3110
|
-
for (
|
|
3111
|
-
a[
|
|
3112
|
-
for (
|
|
3109
|
+
var u = i % this.DB, p = this.DB - u, E = (1 << p) - 1, R = Math.floor(i / this.DB), _ = this.s << u & this.DM, B;
|
|
3110
|
+
for (B = this.t - 1; B >= 0; --B)
|
|
3111
|
+
a[B + R + 1] = this[B] >> p | _, _ = (this[B] & E) << u;
|
|
3112
|
+
for (B = R - 1; B >= 0; --B) a[B] = 0;
|
|
3113
3113
|
a[R] = _, a.t = this.t + R + 1, a.s = this.s, a.clamp();
|
|
3114
3114
|
}
|
|
3115
3115
|
function Y(i, a) {
|
|
@@ -3162,7 +3162,7 @@ function ee() {
|
|
|
3162
3162
|
return;
|
|
3163
3163
|
}
|
|
3164
3164
|
u == null && (u = c());
|
|
3165
|
-
var R = c(), _ = this.s,
|
|
3165
|
+
var R = c(), _ = this.s, B = i.s, z = this.DB - P(p[p.t - 1]);
|
|
3166
3166
|
z > 0 ? (p.lShiftTo(z, R), E.lShiftTo(z, u)) : (p.copyTo(R), E.copyTo(u));
|
|
3167
3167
|
var K = R.t, st = R[K - 1];
|
|
3168
3168
|
if (st != 0) {
|
|
@@ -3173,7 +3173,7 @@ function ee() {
|
|
|
3173
3173
|
if ((u[at] += R.am(0, ie, u, kt, 0, K)) < ie)
|
|
3174
3174
|
for (R.dlShiftTo(kt, ht), u.subTo(ht, u); u[at] < --ie; ) u.subTo(ht, u);
|
|
3175
3175
|
}
|
|
3176
|
-
a != null && (u.drShiftTo(K, a), _ !=
|
|
3176
|
+
a != null && (u.drShiftTo(K, a), _ != B && o.ZERO.subTo(a, a)), u.t = K, u.clamp(), z > 0 && u.rShiftTo(z, u), _ < 0 && o.ZERO.subTo(u, u);
|
|
3177
3177
|
}
|
|
3178
3178
|
}
|
|
3179
3179
|
}
|
|
@@ -3289,10 +3289,10 @@ function ee() {
|
|
|
3289
3289
|
}
|
|
3290
3290
|
function yr(i, a) {
|
|
3291
3291
|
this.fromInt(0), a == null && (a = 10);
|
|
3292
|
-
for (var u = this.chunkSize(a), p = Math.pow(a, u), E = !1, R = 0, _ = 0,
|
|
3293
|
-
var z = T(i,
|
|
3292
|
+
for (var u = this.chunkSize(a), p = Math.pow(a, u), E = !1, R = 0, _ = 0, B = 0; B < i.length; ++B) {
|
|
3293
|
+
var z = T(i, B);
|
|
3294
3294
|
if (z < 0) {
|
|
3295
|
-
i.charAt(
|
|
3295
|
+
i.charAt(B) == "-" && this.signum() == 0 && (E = !0);
|
|
3296
3296
|
continue;
|
|
3297
3297
|
}
|
|
3298
3298
|
_ = a * _ + z, ++R >= u && (this.dMultiply(p), this.dAddOffset(_, 0), R = 0, _ = 0);
|
|
@@ -3526,22 +3526,22 @@ function ee() {
|
|
|
3526
3526
|
var u = i.bitLength(), p, E = S(1), R;
|
|
3527
3527
|
if (u <= 0) return E;
|
|
3528
3528
|
u < 18 ? p = 1 : u < 48 ? p = 3 : u < 144 ? p = 4 : u < 768 ? p = 5 : p = 6, u < 8 ? R = new D(a) : a.isEven() ? R = new gt(a) : R = new mt(a);
|
|
3529
|
-
var _ = new Array(),
|
|
3529
|
+
var _ = new Array(), B = 3, z = p - 1, K = (1 << p) - 1;
|
|
3530
3530
|
if (_[1] = R.convert(this), p > 1) {
|
|
3531
3531
|
var st = c();
|
|
3532
|
-
for (R.sqrTo(_[1], st);
|
|
3533
|
-
_[
|
|
3532
|
+
for (R.sqrTo(_[1], st); B <= K; )
|
|
3533
|
+
_[B] = c(), R.mulTo(st, _[B - 2], _[B]), B += 2;
|
|
3534
3534
|
}
|
|
3535
3535
|
var rt = i.t - 1, lt, Nt = !0, ot = c(), at;
|
|
3536
3536
|
for (u = P(i[rt]) - 1; rt >= 0; ) {
|
|
3537
|
-
for (u >= z ? lt = i[rt] >> u - z & K : (lt = (i[rt] & (1 << u + 1) - 1) << z - u, rt > 0 && (lt |= i[rt - 1] >> this.DB + u - z)),
|
|
3538
|
-
lt >>= 1, --
|
|
3539
|
-
if ((u -=
|
|
3537
|
+
for (u >= z ? lt = i[rt] >> u - z & K : (lt = (i[rt] & (1 << u + 1) - 1) << z - u, rt > 0 && (lt |= i[rt - 1] >> this.DB + u - z)), B = p; (lt & 1) == 0; )
|
|
3538
|
+
lt >>= 1, --B;
|
|
3539
|
+
if ((u -= B) < 0 && (u += this.DB, --rt), Nt)
|
|
3540
3540
|
_[lt].copyTo(E), Nt = !1;
|
|
3541
3541
|
else {
|
|
3542
|
-
for (;
|
|
3543
|
-
R.sqrTo(E, ot), R.sqrTo(ot, E),
|
|
3544
|
-
|
|
3542
|
+
for (; B > 1; )
|
|
3543
|
+
R.sqrTo(E, ot), R.sqrTo(ot, E), B -= 2;
|
|
3544
|
+
B > 0 ? R.sqrTo(E, ot) : (at = E, E = ot, ot = at), R.mulTo(ot, _[lt], E);
|
|
3545
3545
|
}
|
|
3546
3546
|
for (; rt >= 0 && (i[rt] & 1 << u) == 0; )
|
|
3547
3547
|
R.sqrTo(E, ot), at = E, E = ot, ot = at, --u < 0 && (u = this.DB - 1, --rt);
|
|
@@ -3571,18 +3571,18 @@ function ee() {
|
|
|
3571
3571
|
function fs(i) {
|
|
3572
3572
|
var a = i.isEven();
|
|
3573
3573
|
if (this.isEven() && a || i.signum() == 0) return o.ZERO;
|
|
3574
|
-
for (var u = i.clone(), p = this.clone(), E = S(1), R = S(0), _ = S(0),
|
|
3574
|
+
for (var u = i.clone(), p = this.clone(), E = S(1), R = S(0), _ = S(0), B = S(1); u.signum() != 0; ) {
|
|
3575
3575
|
for (; u.isEven(); )
|
|
3576
3576
|
u.rShiftTo(1, u), a ? ((!E.isEven() || !R.isEven()) && (E.addTo(this, E), R.subTo(i, R)), E.rShiftTo(1, E)) : R.isEven() || R.subTo(i, R), R.rShiftTo(1, R);
|
|
3577
3577
|
for (; p.isEven(); )
|
|
3578
|
-
p.rShiftTo(1, p), a ? ((!_.isEven() || !
|
|
3579
|
-
u.compareTo(p) >= 0 ? (u.subTo(p, u), a && E.subTo(_, E), R.subTo(
|
|
3578
|
+
p.rShiftTo(1, p), a ? ((!_.isEven() || !B.isEven()) && (_.addTo(this, _), B.subTo(i, B)), _.rShiftTo(1, _)) : B.isEven() || B.subTo(i, B), B.rShiftTo(1, B);
|
|
3579
|
+
u.compareTo(p) >= 0 ? (u.subTo(p, u), a && E.subTo(_, E), R.subTo(B, R)) : (p.subTo(u, p), a && _.subTo(E, _), B.subTo(R, B));
|
|
3580
3580
|
}
|
|
3581
3581
|
if (p.compareTo(o.ONE) != 0) return o.ZERO;
|
|
3582
|
-
if (
|
|
3583
|
-
if (
|
|
3584
|
-
else return
|
|
3585
|
-
return
|
|
3582
|
+
if (B.compareTo(i) >= 0) return B.subtract(i);
|
|
3583
|
+
if (B.signum() < 0) B.addTo(i, B);
|
|
3584
|
+
else return B;
|
|
3585
|
+
return B.signum() < 0 ? B.add(i) : B;
|
|
3586
3586
|
}
|
|
3587
3587
|
var G = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997], ls = (1 << 26) / G[G.length - 1];
|
|
3588
3588
|
function hs(i) {
|
|
@@ -3608,7 +3608,7 @@ function ee() {
|
|
|
3608
3608
|
E.fromInt(G[Math.floor(Math.random() * G.length)]);
|
|
3609
3609
|
var _ = E.modPow(p, this);
|
|
3610
3610
|
if (_.compareTo(o.ONE) != 0 && _.compareTo(a) != 0) {
|
|
3611
|
-
for (var
|
|
3611
|
+
for (var B = 1; B++ < u && _.compareTo(a) != 0; )
|
|
3612
3612
|
if (_ = _.modPowInt(2, this), _.compareTo(o.ONE) == 0) return !1;
|
|
3613
3613
|
if (_.compareTo(a) != 0) return !1;
|
|
3614
3614
|
}
|
|
@@ -3761,7 +3761,7 @@ function ha() {
|
|
|
3761
3761
|
* 解析 ASN.1 der,针对 sm2 验签
|
|
3762
3762
|
*/
|
|
3763
3763
|
decodeDer(d) {
|
|
3764
|
-
const h = f(d, 0), l = f(d, h), v = c(d, h), O = d.substr(l, v * 2),
|
|
3764
|
+
const h = f(d, 0), l = f(d, h), v = c(d, h), O = d.substr(l, v * 2), I = l + O.length, w = f(d, I), F = c(d, I), m = d.substr(w, F * 2), T = new t(O, 16), b = new t(m, 16);
|
|
3765
3765
|
return { r: T, s: b };
|
|
3766
3766
|
}
|
|
3767
3767
|
}, ue;
|
|
@@ -3875,10 +3875,10 @@ function da() {
|
|
|
3875
3875
|
add(f) {
|
|
3876
3876
|
if (this.isInfinity()) return f;
|
|
3877
3877
|
if (f.isInfinity()) return this;
|
|
3878
|
-
const d = this.x.toBigInteger(), h = this.y.toBigInteger(), l = this.z, v = f.x.toBigInteger(), O = f.y.toBigInteger(),
|
|
3878
|
+
const d = this.x.toBigInteger(), h = this.y.toBigInteger(), l = this.z, v = f.x.toBigInteger(), O = f.y.toBigInteger(), I = f.z, w = this.curve.q, F = d.multiply(I).mod(w), m = v.multiply(l).mod(w), T = F.subtract(m), b = h.multiply(I).mod(w), g = O.multiply(l).mod(w), S = b.subtract(g);
|
|
3879
3879
|
if (t.ZERO.equals(T))
|
|
3880
3880
|
return t.ZERO.equals(S) ? this.twice() : this.curve.infinity;
|
|
3881
|
-
const x = F.add(m), A = l.multiply(
|
|
3881
|
+
const x = F.add(m), A = l.multiply(I).mod(w), C = T.square().mod(w), q = T.multiply(C).mod(w), N = A.multiply(S.square()).subtract(x.multiply(C)).mod(w), U = T.multiply(N).mod(w), P = S.multiply(C.multiply(F).subtract(N)).subtract(b.multiply(q)).mod(w), k = q.multiply(A).mod(w);
|
|
3882
3882
|
return new s(this.curve, this.curve.fromBigInteger(U), this.curve.fromBigInteger(P), k);
|
|
3883
3883
|
}
|
|
3884
3884
|
/**
|
|
@@ -3899,7 +3899,7 @@ function da() {
|
|
|
3899
3899
|
twice() {
|
|
3900
3900
|
if (this.isInfinity()) return this;
|
|
3901
3901
|
if (!this.y.toBigInteger().signum()) return this.curve.infinity;
|
|
3902
|
-
const f = this.x.toBigInteger(), d = this.y.toBigInteger(), h = this.z, l = this.curve.q, v = this.curve.a.toBigInteger(), O = f.square().multiply(n).add(v.multiply(h.square())).mod(l),
|
|
3902
|
+
const f = this.x.toBigInteger(), d = this.y.toBigInteger(), h = this.z, l = this.curve.q, v = this.curve.a.toBigInteger(), O = f.square().multiply(n).add(v.multiply(h.square())).mod(l), I = d.shiftLeft(1).multiply(h).mod(l), w = d.square().mod(l), F = w.multiply(f).multiply(h).mod(l), m = I.square().mod(l), T = O.square().subtract(F.shiftLeft(3)).mod(l), b = I.multiply(T).mod(l), g = O.multiply(F.shiftLeft(2).subtract(T)).subtract(m.shiftLeft(1).multiply(w)).mod(l), S = I.multiply(m).mod(l);
|
|
3903
3903
|
return new s(this.curve, this.curve.fromBigInteger(b), this.curve.fromBigInteger(g), S);
|
|
3904
3904
|
}
|
|
3905
3905
|
/**
|
|
@@ -3912,8 +3912,8 @@ function da() {
|
|
|
3912
3912
|
let l = this;
|
|
3913
3913
|
for (let v = d.bitLength() - 2; v > 0; v--) {
|
|
3914
3914
|
l = l.twice();
|
|
3915
|
-
const O = d.testBit(v),
|
|
3916
|
-
O !==
|
|
3915
|
+
const O = d.testBit(v), I = f.testBit(v);
|
|
3916
|
+
O !== I && (l = l.add(O ? this : h));
|
|
3917
3917
|
}
|
|
3918
3918
|
return l;
|
|
3919
3919
|
}
|
|
@@ -4004,7 +4004,7 @@ function pa() {
|
|
|
4004
4004
|
function O(b, g) {
|
|
4005
4005
|
return b.length >= g ? b : new Array(g - b.length + 1).join("0") + b;
|
|
4006
4006
|
}
|
|
4007
|
-
function
|
|
4007
|
+
function I(b) {
|
|
4008
4008
|
return b.map((g) => (g = g.toString(16), g.length === 1 ? "0" + g : g)).join("");
|
|
4009
4009
|
}
|
|
4010
4010
|
function w(b) {
|
|
@@ -4050,7 +4050,7 @@ function pa() {
|
|
|
4050
4050
|
compressPublicKeyHex: l,
|
|
4051
4051
|
utf8ToHex: v,
|
|
4052
4052
|
leftPad: O,
|
|
4053
|
-
arrayToHex:
|
|
4053
|
+
arrayToHex: I,
|
|
4054
4054
|
arrayToUtf8: w,
|
|
4055
4055
|
hexToArray: F,
|
|
4056
4056
|
verifyPublicKey: m,
|
|
@@ -4063,13 +4063,13 @@ function Wn() {
|
|
|
4063
4063
|
sn = 1;
|
|
4064
4064
|
const t = new Uint32Array(68), e = new Uint32Array(64);
|
|
4065
4065
|
function n(v, O) {
|
|
4066
|
-
const
|
|
4067
|
-
return v <<
|
|
4066
|
+
const I = O & 31;
|
|
4067
|
+
return v << I | v >>> 32 - I;
|
|
4068
4068
|
}
|
|
4069
4069
|
function r(v, O) {
|
|
4070
|
-
const
|
|
4071
|
-
for (let w = v.length - 1; w >= 0; w--)
|
|
4072
|
-
return
|
|
4070
|
+
const I = [];
|
|
4071
|
+
for (let w = v.length - 1; w >= 0; w--) I[w] = (v[w] ^ O[w]) & 255;
|
|
4072
|
+
return I;
|
|
4073
4073
|
}
|
|
4074
4074
|
function s(v) {
|
|
4075
4075
|
return v ^ n(v, 9) ^ n(v, 17);
|
|
@@ -4078,9 +4078,9 @@ function Wn() {
|
|
|
4078
4078
|
return v ^ n(v, 15) ^ n(v, 23);
|
|
4079
4079
|
}
|
|
4080
4080
|
function c(v) {
|
|
4081
|
-
let O = v.length * 8,
|
|
4082
|
-
|
|
4083
|
-
const w = new Array((
|
|
4081
|
+
let O = v.length * 8, I = O % 512;
|
|
4082
|
+
I = I >= 448 ? 512 - I % 448 - 1 : 448 - I - 1;
|
|
4083
|
+
const w = new Array((I - 7) / 8), F = new Array(8);
|
|
4084
4084
|
for (let x = 0, A = w.length; x < A; x++) w[x] = 0;
|
|
4085
4085
|
for (let x = 0, A = F.length; x < A; x++) F[x] = 0;
|
|
4086
4086
|
O = O.toString(2);
|
|
@@ -4117,7 +4117,7 @@ function Wn() {
|
|
|
4117
4117
|
d[v] = 54, h[v] = 92;
|
|
4118
4118
|
function l(v, O) {
|
|
4119
4119
|
for (O.length > f && (O = c(O)); O.length < f; ) O.push(0);
|
|
4120
|
-
const
|
|
4120
|
+
const I = r(O, d), w = r(O, h), F = c([...I, ...v]);
|
|
4121
4121
|
return c([...w, ...F]);
|
|
4122
4122
|
}
|
|
4123
4123
|
return he = {
|
|
@@ -4170,7 +4170,7 @@ function ma() {
|
|
|
4170
4170
|
userId: A
|
|
4171
4171
|
} = {}) {
|
|
4172
4172
|
let C = typeof m == "string" ? r.utf8ToHex(m) : r.arrayToHex(m);
|
|
4173
|
-
S && (x = x || w(T), C =
|
|
4173
|
+
S && (x = x || w(T), C = I(C, x, A));
|
|
4174
4174
|
const q = new t(T, 16), N = new t(C, 16);
|
|
4175
4175
|
let U = null, P = null, k = null;
|
|
4176
4176
|
do {
|
|
@@ -4184,7 +4184,7 @@ function ma() {
|
|
|
4184
4184
|
}
|
|
4185
4185
|
function O(m, T, b, { der: g, hash: S, userId: x } = {}) {
|
|
4186
4186
|
let A = typeof m == "string" ? r.utf8ToHex(m) : r.arrayToHex(m);
|
|
4187
|
-
S && (A =
|
|
4187
|
+
S && (A = I(A, b, x));
|
|
4188
4188
|
let C, q;
|
|
4189
4189
|
if (g) {
|
|
4190
4190
|
const H = n(T);
|
|
@@ -4196,7 +4196,7 @@ function ma() {
|
|
|
4196
4196
|
const k = o.multiply(q).add(N.multiply(P)), L = U.add(k.getX().toBigInteger()).mod(f);
|
|
4197
4197
|
return C.equals(L);
|
|
4198
4198
|
}
|
|
4199
|
-
function
|
|
4199
|
+
function I(m, T, b = "1234567812345678") {
|
|
4200
4200
|
b = r.utf8ToHex(b);
|
|
4201
4201
|
const g = r.leftPad(o.curve.a.toBigInteger().toRadix(16), 64), S = r.leftPad(o.curve.b.toBigInteger().toRadix(16), 64), x = r.leftPad(o.getX().toBigInteger().toRadix(16), 64), A = r.leftPad(o.getY().toBigInteger().toRadix(16), 64);
|
|
4202
4202
|
let C, q;
|
|
@@ -4618,7 +4618,7 @@ function ya() {
|
|
|
4618
4618
|
function O(m) {
|
|
4619
4619
|
return m ^ h(m, 13) ^ h(m, 23);
|
|
4620
4620
|
}
|
|
4621
|
-
function
|
|
4621
|
+
function I(m, T, b) {
|
|
4622
4622
|
const g = new Array(4), S = new Array(4);
|
|
4623
4623
|
for (let x = 0; x < 4; x++)
|
|
4624
4624
|
S[0] = m[4 * x] & 255, S[1] = m[4 * x + 1] & 255, S[2] = m[4 * x + 2] & 255, S[3] = m[4 * x + 3] & 255, g[x] = S[0] << 24 | S[1] << 16 | S[2] << 8 | S[3];
|
|
@@ -4661,7 +4661,7 @@ function ya() {
|
|
|
4661
4661
|
if (S === "cbc")
|
|
4662
4662
|
for (let H = 0; H < n; H++)
|
|
4663
4663
|
b !== t && (k[H] ^= N[H]);
|
|
4664
|
-
|
|
4664
|
+
I(k, L, C);
|
|
4665
4665
|
for (let H = 0; H < n; H++)
|
|
4666
4666
|
S === "cbc" && b === t && (L[H] ^= N[H]), q[P + H] = L[H];
|
|
4667
4667
|
S === "cbc" && (b !== t ? N = L : N = k), U -= n, P += n;
|
|
@@ -4695,10 +4695,10 @@ var Zn = xa();
|
|
|
4695
4695
|
const Gn = Zn.sm2, Xn = Zn.sm4, dc = (t, e, n = "04") => n + Gn.doEncrypt(t, e), pc = (t, e, n = "04") => Gn.doDecrypt(t.startsWith(n) ? t.slice(2) : t, e), mc = (t, e) => Xn.encrypt(t, e), gc = (t, e) => Xn.decrypt(t, e);
|
|
4696
4696
|
let It = [], ba = { consecutiveFrames: 0, lastBlinkTime: 0 }, wa = { consecutiveFrames: 0, lastBlinkTime: 0 };
|
|
4697
4697
|
const va = /* @__PURE__ */ new Map([
|
|
4698
|
-
["nod", [Aa, 30
|
|
4699
|
-
["shake", [Fa, 7
|
|
4700
|
-
["mouth", [Oa, 0.35
|
|
4701
|
-
["eye", [Ra, 0.3
|
|
4698
|
+
["nod", [Aa, 30]],
|
|
4699
|
+
["shake", [Fa, 7]],
|
|
4700
|
+
["mouth", [Oa, 0.35]],
|
|
4701
|
+
["eye", [Ra, 0.3]]
|
|
4702
4702
|
]), yc = ["nod", "shake", "mouth", "eye"], xc = {
|
|
4703
4703
|
nod: "请点点头",
|
|
4704
4704
|
shake: "请摇摇头",
|
|
@@ -4712,9 +4712,9 @@ function fn(t, e) {
|
|
|
4712
4712
|
n.map((s, o) => s - r[o]).reduce((s, o) => s + Math.pow(o, 2), 0)
|
|
4713
4713
|
);
|
|
4714
4714
|
}
|
|
4715
|
-
function* Ta(t, e, n
|
|
4716
|
-
for (let
|
|
4717
|
-
yield t(e,
|
|
4715
|
+
function* Ta(t, e, n, r, s) {
|
|
4716
|
+
for (let o = n; o > 0; o--)
|
|
4717
|
+
yield t(e, s, r);
|
|
4718
4718
|
}
|
|
4719
4719
|
function Ht(t) {
|
|
4720
4720
|
return [t.x, t.y];
|
|
@@ -4778,17 +4778,17 @@ function bc(t, e = "blob", n = 1) {
|
|
|
4778
4778
|
) : r(s.toDataURL("image/png", n));
|
|
4779
4779
|
});
|
|
4780
4780
|
}
|
|
4781
|
-
async function wc(t
|
|
4782
|
-
const
|
|
4783
|
-
if (!
|
|
4784
|
-
const
|
|
4785
|
-
for (const
|
|
4786
|
-
const
|
|
4787
|
-
if (!
|
|
4788
|
-
const
|
|
4789
|
-
|
|
4790
|
-
}
|
|
4791
|
-
return
|
|
4781
|
+
async function wc(t) {
|
|
4782
|
+
const { landmarksFn: e, videoEl: n, gesture: r, gestureThreshold: s, generatedNumber: o = 5, waitTime: c = 100, detectionScore: f = 0.5 } = t, [d, h] = va.get(r);
|
|
4783
|
+
if (!d) return !1;
|
|
4784
|
+
const l = [], v = Ta(e, n, o, c, f);
|
|
4785
|
+
for (const O of v) {
|
|
4786
|
+
const I = await O;
|
|
4787
|
+
if (!I) continue;
|
|
4788
|
+
const w = d(I.landmarks, s ?? h);
|
|
4789
|
+
l.push(w);
|
|
4790
|
+
}
|
|
4791
|
+
return l.includes(!0);
|
|
4792
4792
|
}
|
|
4793
4793
|
const vc = { DATE_VALUE_FORMAT: Qs, COMMON_TEXT: dt, IMAGE_TYPE: pn, MEDIA_TYPE: mn, DOC_TYPE: gn, FILE_TYPE: ei }, Tc = {
|
|
4794
4794
|
encodeURIToParams: bn,
|
package/lib/utils/face.d.ts
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import { FaceDetection, WithFaceLandmarks } from 'face-api.js';
|
|
2
2
|
export type ImgFormat = 'blob' | 'base64';
|
|
3
3
|
export type FaceGesture = 'nod' | 'shake' | 'mouth' | 'eye';
|
|
4
|
-
type LandmarksFn = (video: HTMLVideoElement,
|
|
4
|
+
type LandmarksFn = (video: HTMLVideoElement, detectionScore?: number, waitTime?: number) => Promise<WithFaceLandmarks<{
|
|
5
5
|
detection: FaceDetection;
|
|
6
6
|
}> | undefined>;
|
|
7
7
|
export declare const faceLivingEvent: FaceGesture[];
|
|
8
8
|
export declare const faceLivingEventHint: Record<FaceGesture, string>;
|
|
9
9
|
export declare function getFaceVideoFrame(video: HTMLVideoElement, format?: ImgFormat, quality?: number): Promise<string | ArrayBuffer>;
|
|
10
|
-
export declare function getFaceGestureResult(
|
|
10
|
+
export declare function getFaceGestureResult(options: {
|
|
11
|
+
landmarksFn: LandmarksFn;
|
|
12
|
+
videoEl: HTMLVideoElement;
|
|
13
|
+
gesture: FaceGesture;
|
|
14
|
+
gestureThreshold?: number;
|
|
15
|
+
generatedNumber?: number;
|
|
16
|
+
detectionScore?: number;
|
|
17
|
+
waitTime?: number;
|
|
18
|
+
}): Promise<boolean>;
|
|
19
|
+
export declare class FacePositionDetector {
|
|
20
|
+
private video;
|
|
21
|
+
private canvas;
|
|
22
|
+
private ctx;
|
|
23
|
+
private faceLandmarksFn;
|
|
24
|
+
private isDetecting;
|
|
25
|
+
constructor(video: HTMLVideoElement, canvas: HTMLCanvasElement, faceLandmarksFn: LandmarksFn);
|
|
26
|
+
startDetection(): Promise<void>;
|
|
27
|
+
stopDetection(): void;
|
|
28
|
+
private checkPosition;
|
|
29
|
+
private isFaceInArea;
|
|
30
|
+
private showMessage;
|
|
31
|
+
private showAdjustmentHint;
|
|
32
|
+
}
|
|
11
33
|
export {};
|