| 1 |
- function re(a){return Array.isArray(a)}function oe(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}function Oe(a){return(a??"")===""}function Ee(a){return Oe(a)?!0:oe(a)?Object.keys(a).length===0:re(a)?a.length===0:!1}function Ne(a){return!oe(a)||Object.keys(a).length===0}async function ke(a){if(!a||typeof a.validate!="function")throw new Error("无效的表单校验");return new Promise(p=>{a.validate(d=>{p(!!d)})})}function Le(a,p,d=-1){if(!re(a))return!1;const E=a.indexOf(p);return typeof d=="object"&&(d.value=E),E!==-1}function Ue(a,p,d){return re(a)?a.findIndex(E=>E[p]==d):-1}function Pe(a){return Ae(a,"id")}function Ae(a,p="id",d=","){return re(a)?a.map(E=>E[p]).join(d):""}function Ce(a){return re(a)?a:[]}function Se(a,p=new WeakMap){if(!oe(a))return a;if(p.has(a))return p.get(a);const d=Array.isArray(a)?[]:{};return p.set(a,d),Object.keys(a).forEach(E=>{d[E]=Se(a[E],p)}),d}function Ge(a,p=!1){return oe(a)?p&&Ne(a)?!1:a:p?!1:{}}function qe(a,p=""){return new Promise(d=>{try{const{data:E,headers:g}=a,S=ye(g);let A=new Blob([E],{type:p});const _=window.URL.createObjectURL(A),M=document.createElement("a");M.style.display="none",M.href=_;const k=S.split(";")[1].split("=")[1];M.setAttribute("download",decodeURI(k)),typeof M.download>"u"&&M.setAttribute("target","_blank"),document.body.appendChild(M),M.click(),document.body.removeChild(M),window.URL.revokeObjectURL(_),d({status:!0,msg:"下载成功"})}catch(E){d({status:!1,msg:E.message})}})}const ye=a=>{try{return a["content-disposition"]}catch{return""}},xe="0123456789",_e="abcdefghijklmnopqrstuvwxyz",Ie="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function Me(a=8,p=xe+_e+Ie){return a<=0?"":Array.from({length:a},()=>p[Math.floor(Math.random()*p.length)]).join("")}async function Te(a,p,d={},E=[],g="children"){if(a&&a.length>0)for(const S of a){d[S[p]]={},E.push(S[p]);for(const A of Object.keys(S))A!==g&&(d[S[p]][A]=S[A]),A===g&&S[g]&&S[g].length>0&&await Te(S[g],p,d,E,g)}}function Fe(a,p){let d=p-a,E=Math.floor(d/(24*3600*1e3)),g=d%(24*3600*1e3),S=Math.floor(g/(3600*1e3)),A=g%(3600*1e3),_=Math.floor(A/(60*1e3)),M=A%(60*1e3),k=Math.round(d/1e3);return{leave1:g,leave2:A,leave3:M,days:E,hours:S,minutes:_,seconds:k}}function $e(a,p,d=!1){De({name:a,content:p,session:d})}function Ve(a,p=!1,d=!1){return Be({name:a,debug:p,session:d})}function Xe(a,p=!1){ve({name:a,session:p})}function Be({name:a,debug:p=!1,session:d=!1}){let g=(d?window.sessionStorage:window.localStorage).getItem(a);if(Ee(g))return;try{g=JSON.parse(g)}catch(_){return console.error(`解析缓存数据失败: ${a}`,_),g}if(p)return g;const{dataType:S,content:A}=g;switch(S){case"number":return Number(A);case"boolean":return!!A;case"object":return A;default:return A??""}}function De({name:a,content:p,session:d=!1}){const E={dataType:typeof p,content:p??"",session:d,datetime:new Date().getTime()},g=d?window.sessionStorage:window.localStorage;try{g.setItem(a,JSON.stringify(E))}catch(S){console.error(`存储数据失败: ${a}`,S)}}function ve({name:a,session:p=!1}){(p?window.sessionStorage:window.localStorage).removeItem(a)}function ze(){window.sessionStorage.clear(),window.localStorage.clear()}function He(a){try{const p=Me(),d=document.createElement("a");d.href=a,d.target="_blank",d.id=p,document.getElementById(p)||document.body.appendChild(d),d.click(),document.body.removeChild(d)}catch(p){console.error("打开新窗口失败:",p),window.open(a,"_blank")}}var Re=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,he=Math.ceil,F=Math.floor,P="[BigNumber Error] ",de=P+"Number primitive has more than 15 significant digits: ",X=1e14,N=14,ge=9007199254740991,pe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],J=1e7,R=1e9;function me(a){var p,d,E,g=w.prototype={constructor:w,toString:null,valueOf:null},S=new w(1),A=20,_=4,M=-7,k=21,Y=-1e7,V=1e7,K=!1,b=1,j=0,fe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},Q="0123456789abcdefghijklmnopqrstuvwxyz",se=!0;function w(e,r){var t,l,i,f,u,n,o,c,s=this;if(!(s instanceof w))return new w(e,r);if(r==null){if(e&&e._isBigNumber===!0){s.s=e.s,!e.c||e.e>V?s.c=s.e=null:e.e<Y?s.c=[s.e=0]:(s.e=e.e,s.c=e.c.slice());return}if((n=typeof e=="number")&&e*0==0){if(s.s=1/e<0?(e=-e,-1):1,e===~~e){for(f=0,u=e;u>=10;u/=10,f++);f>V?s.c=s.e=null:(s.e=f,s.c=[e]);return}c=String(e)}else{if(!Re.test(c=String(e)))return E(s,c,n);s.s=c.charCodeAt(0)==45?(c=c.slice(1),-1):1}(f=c.indexOf("."))>-1&&(c=c.replace(".","")),(u=c.search(/e/i))>0?(f<0&&(f=u),f+=+c.slice(u+1),c=c.substring(0,u)):f<0&&(f=c.length)}else{if(T(r,2,Q.length,"Base"),r==10&&se)return s=new w(e),C(s,A+s.e+1,_);if(c=String(e),n=typeof e=="number"){if(e*0!=0)return E(s,c,n,r);if(s.s=1/e<0?(c=c.slice(1),-1):1,w.DEBUG&&c.replace(/^0\.0*|\./,"").length>15)throw Error(de+e)}else s.s=c.charCodeAt(0)===45?(c=c.slice(1),-1):1;for(t=Q.slice(0,r),f=u=0,o=c.length;u<o;u++)if(t.indexOf(l=c.charAt(u))<0){if(l=="."){if(u>f){f=o;continue}}else if(!i&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){i=!0,u=-1,f=0;continue}return E(s,String(e),n,r)}n=!1,c=d(c,r,10,s.s),(f=c.indexOf("."))>-1?c=c.replace(".",""):f=c.length}for(u=0;c.charCodeAt(u)===48;u++);for(o=c.length;c.charCodeAt(--o)===48;);if(c=c.slice(u,++o)){if(o-=u,n&&w.DEBUG&&o>15&&(e>ge||e!==F(e)))throw Error(de+s.s*e);if((f=f-u-1)>V)s.c=s.e=null;else if(f<Y)s.c=[s.e=0];else{if(s.e=f,s.c=[],u=(f+1)%N,f<0&&(u+=N),u<o){for(u&&s.c.push(+c.slice(0,u)),o-=N;u<o;)s.c.push(+c.slice(u,u+=N));u=N-(c=c.slice(u)).length}else u-=o;for(;u--;c+="0");s.c.push(+c)}}else s.c=[s.e=0]}w.clone=me,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(e){var r,t;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(t=e[r],T(t,0,R,r),A=t),e.hasOwnProperty(r="ROUNDING_MODE")&&(t=e[r],T(t,0,8,r),_=t),e.hasOwnProperty(r="EXPONENTIAL_AT")&&(t=e[r],t&&t.pop?(T(t[0],-R,0,r),T(t[1],0,R,r),M=t[0],k=t[1]):(T(t,-R,R,r),M=-(k=t<0?-t:t))),e.hasOwnProperty(r="RANGE"))if(t=e[r],t&&t.pop)T(t[0],-R,-1,r),T(t[1],1,R,r),Y=t[0],V=t[1];else if(T(t,-R,R,r),t)Y=-(V=t<0?-t:t);else throw Error(P+r+" cannot be zero: "+t);if(e.hasOwnProperty(r="CRYPTO"))if(t=e[r],t===!!t)if(t)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))K=t;else throw K=!t,Error(P+"crypto unavailable");else K=t;else throw Error(P+r+" not true or false: "+t);if(e.hasOwnProperty(r="MODULO_MODE")&&(t=e[r],T(t,0,9,r),b=t),e.hasOwnProperty(r="POW_PRECISION")&&(t=e[r],T(t,0,R,r),j=t),e.hasOwnProperty(r="FORMAT"))if(t=e[r],typeof t=="object")fe=t;else throw Error(P+r+" not an object: "+t);if(e.hasOwnProperty(r="ALPHABET"))if(t=e[r],typeof t=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(t))se=t.slice(0,10)=="0123456789",Q=t;else throw Error(P+r+" invalid: "+t)}else throw Error(P+"Object expected: "+e);return{DECIMAL_PLACES:A,ROUNDING_MODE:_,EXPONENTIAL_AT:[M,k],RANGE:[Y,V],CRYPTO:K,MODULO_MODE:b,POW_PRECISION:j,FORMAT:fe,ALPHABET:Q}},w.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!w.DEBUG)return!0;var r,t,l=e.c,i=e.e,f=e.s;e:if({}.toString.call(l)=="[object Array]"){if((f===1||f===-1)&&i>=-R&&i<=R&&i===F(i)){if(l[0]===0){if(i===0&&l.length===1)return!0;break e}if(r=(i+1)%N,r<1&&(r+=N),String(l[0]).length==r){for(r=0;r<l.length;r++)if(t=l[r],t<0||t>=X||t!==F(t))break e;if(t!==0)return!0}}}else if(l===null&&i===null&&(f===null||f===1||f===-1))return!0;throw Error(P+"Invalid BigNumber: "+e)},w.maximum=w.max=function(){return we(arguments,-1)},w.minimum=w.min=function(){return we(arguments,1)},w.random=function(){var e=9007199254740992,r=Math.random()*e&2097151?function(){return F(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(t){var l,i,f,u,n,o=0,c=[],s=new w(S);if(t==null?t=A:T(t,0,R),u=he(t/N),K)if(crypto.getRandomValues){for(l=crypto.getRandomValues(new Uint32Array(u*=2));o<u;)n=l[o]*131072+(l[o+1]>>>11),n>=9e15?(i=crypto.getRandomValues(new Uint32Array(2)),l[o]=i[0],l[o+1]=i[1]):(c.push(n%1e14),o+=2);o=u/2}else if(crypto.randomBytes){for(l=crypto.randomBytes(u*=7);o<u;)n=(l[o]&31)*281474976710656+l[o+1]*1099511627776+l[o+2]*4294967296+l[o+3]*16777216+(l[o+4]<<16)+(l[o+5]<<8)+l[o+6],n>=9e15?crypto.randomBytes(7).copy(l,o):(c.push(n%1e14),o+=7);o=u/7}else throw K=!1,Error(P+"crypto unavailable");if(!K)for(;o<u;)n=r(),n<9e15&&(c[o++]=n%1e14);for(u=c[--o],t%=N,u&&t&&(n=pe[N-t],c[o]=F(u/n)*n);c[o]===0;c.pop(),o--);if(o<0)c=[f=0];else{for(f=-1;c[0]===0;c.splice(0,1),f-=N);for(o=1,n=c[0];n>=10;n/=10,o++);o<N&&(f-=N-o)}return s.e=f,s.c=c,s}}(),w.sum=function(){for(var e=1,r=arguments,t=new w(r[0]);e<r.length;)t=t.plus(r[e++]);return t},d=function(){var e="0123456789";function r(t,l,i,f){for(var u,n=[0],o,c=0,s=t.length;c<s;){for(o=n.length;o--;n[o]*=l);for(n[0]+=f.indexOf(t.charAt(c++)),u=0;u<n.length;u++)n[u]>i-1&&(n[u+1]==null&&(n[u+1]=0),n[u+1]+=n[u]/i|0,n[u]%=i)}return n.reverse()}return function(t,l,i,f,u){var n,o,c,s,h,m,O,x,B=t.indexOf("."),v=A,y=_;for(B>=0&&(s=j,j=0,t=t.replace(".",""),x=new w(l),m=x.pow(t.length-B),j=s,x.c=r(W(q(m.c),m.e,"0"),10,i,e),x.e=x.c.length),O=r(t,l,i,u?(n=Q,e):(n=e,Q)),c=s=O.length;O[--s]==0;O.pop());if(!O[0])return n.charAt(0);if(B<0?--c:(m.c=O,m.e=c,m.s=f,m=p(m,x,v,y,i),O=m.c,h=m.r,c=m.e),o=c+v+1,B=O[o],s=i/2,h=h||o<0||O[o+1]!=null,h=y<4?(B!=null||h)&&(y==0||y==(m.s<0?3:2)):B>s||B==s&&(y==4||h||y==6&&O[o-1]&1||y==(m.s<0?8:7)),o<1||!O[0])t=h?W(n.charAt(1),-v,n.charAt(0)):n.charAt(0);else{if(O.length=o,h)for(--i;++O[--o]>i;)O[o]=0,o||(++c,O=[1].concat(O));for(s=O.length;!O[--s];);for(B=0,t="";B<=s;t+=n.charAt(O[B++]));t=W(t,c,n.charAt(0))}return t}}(),p=function(){function e(l,i,f){var u,n,o,c,s=0,h=l.length,m=i%J,O=i/J|0;for(l=l.slice();h--;)o=l[h]%J,c=l[h]/J|0,u=O*o+c*m,n=m*o+u%J*J+s,s=(n/f|0)+(u/J|0)+O*c,l[h]=n%f;return s&&(l=[s].concat(l)),l}function r(l,i,f,u){var n,o;if(f!=u)o=f>u?1:-1;else for(n=o=0;n<f;n++)if(l[n]!=i[n]){o=l[n]>i[n]?1:-1;break}return o}function t(l,i,f,u){for(var n=0;f--;)l[f]-=n,n=l[f]<i[f]?1:0,l[f]=n*u+l[f]-i[f];for(;!l[0]&&l.length>1;l.splice(0,1));}return function(l,i,f,u,n){var o,c,s,h,m,O,x,B,v,y,I,L,te,ue,ae,z,ee,G=l.s==i.s?1:-1,U=l.c,D=i.c;if(!U||!U[0]||!D||!D[0])return new w(!l.s||!i.s||(U?D&&U[0]==D[0]:!D)?NaN:U&&U[0]==0||!D?G*0:G/0);for(B=new w(G),v=B.c=[],c=l.e-i.e,G=f+c+1,n||(n=X,c=$(l.e/N)-$(i.e/N),G=G/N|0),s=0;D[s]==(U[s]||0);s++);if(D[s]>(U[s]||0)&&c--,G<0)v.push(1),h=!0;else{for(ue=U.length,z=D.length,s=0,G+=2,m=F(n/(D[0]+1)),m>1&&(D=e(D,m,n),U=e(U,m,n),z=D.length,ue=U.length),te=z,y=U.slice(0,z),I=y.length;I<z;y[I++]=0);ee=D.slice(),ee=[0].concat(ee),ae=D[0],D[1]>=n/2&&ae++;do{if(m=0,o=r(D,y,z,I),o<0){if(L=y[0],z!=I&&(L=L*n+(y[1]||0)),m=F(L/ae),m>1)for(m>=n&&(m=n-1),O=e(D,m,n),x=O.length,I=y.length;r(O,y,x,I)==1;)m--,t(O,z<x?ee:D,x,n),x=O.length,o=1;else m==0&&(o=m=1),O=D.slice(),x=O.length;if(x<I&&(O=[0].concat(O)),t(y,O,I,n),I=y.length,o==-1)for(;r(D,y,z,I)<1;)m++,t(y,z<I?ee:D,I,n),I=y.length}else o===0&&(m++,y=[0]);v[s++]=m,y[0]?y[I++]=U[te]||0:(y=[U[te]],I=1)}while((te++<ue||y[0]!=null)&&G--);h=y[0]!=null,v[0]||v.splice(0,1)}if(n==X){for(s=1,G=v[0];G>=10;G/=10,s++);C(B,f+(B.e=s+c*N-1)+1,u,h)}else B.e=c,B.r=+h;return B}}();function le(e,r,t,l){var i,f,u,n,o;if(t==null?t=_:T(t,0,8),!e.c)return e.toString();if(i=e.c[0],u=e.e,r==null)o=q(e.c),o=l==1||l==2&&(u<=M||u>=k)?ie(o,u):W(o,u,"0");else if(e=C(new w(e),r,t),f=e.e,o=q(e.c),n=o.length,l==1||l==2&&(r<=f||f<=M)){for(;n<r;o+="0",n++);o=ie(o,f)}else if(r-=u,o=W(o,f,"0"),f+1>n){if(--r>0)for(o+=".";r--;o+="0");}else if(r+=f-n,r>0)for(f+1==n&&(o+=".");r--;o+="0");return e.s<0&&i?"-"+o:o}function we(e,r){for(var t,l,i=1,f=new w(e[0]);i<e.length;i++)l=new w(e[i]),(!l.s||(t=Z(f,l))===r||t===0&&f.s===r)&&(f=l);return f}function ce(e,r,t){for(var l=1,i=r.length;!r[--i];r.pop());for(i=r[0];i>=10;i/=10,l++);return(t=l+t*N-1)>V?e.c=e.e=null:t<Y?e.c=[e.e=0]:(e.e=t,e.c=r),e}E=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,t=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(f,u,n,o){var c,s=n?u:u.replace(i,"");if(l.test(s))f.s=isNaN(s)?null:s<0?-1:1;else{if(!n&&(s=s.replace(e,function(h,m,O){return c=(O=O.toLowerCase())=="x"?16:O=="b"?2:8,!o||o==c?m:h}),o&&(c=o,s=s.replace(r,"$1").replace(t,"0.$1")),u!=s))return new w(s,c);if(w.DEBUG)throw Error(P+"Not a"+(o?" base "+o:"")+" number: "+u);f.s=null}f.c=f.e=null}}();function C(e,r,t,l){var i,f,u,n,o,c,s,h=e.c,m=pe;if(h){e:{for(i=1,n=h[0];n>=10;n/=10,i++);if(f=r-i,f<0)f+=N,u=r,o=h[c=0],s=F(o/m[i-u-1]%10);else if(c=he((f+1)/N),c>=h.length)if(l){for(;h.length<=c;h.push(0));o=s=0,i=1,f%=N,u=f-N+1}else break e;else{for(o=n=h[c],i=1;n>=10;n/=10,i++);f%=N,u=f-N+i,s=u<0?0:F(o/m[i-u-1]%10)}if(l=l||r<0||h[c+1]!=null||(u<0?o:o%m[i-u-1]),l=t<4?(s||l)&&(t==0||t==(e.s<0?3:2)):s>5||s==5&&(t==4||l||t==6&&(f>0?u>0?o/m[i-u]:0:h[c-1])%10&1||t==(e.s<0?8:7)),r<1||!h[0])return h.length=0,l?(r-=e.e+1,h[0]=m[(N-r%N)%N],e.e=-r||0):h[0]=e.e=0,e;if(f==0?(h.length=c,n=1,c--):(h.length=c+1,n=m[N-f],h[c]=u>0?F(o/m[i-u]%m[u])*n:0),l)for(;;)if(c==0){for(f=1,u=h[0];u>=10;u/=10,f++);for(u=h[0]+=n,n=1;u>=10;u/=10,n++);f!=n&&(e.e++,h[0]==X&&(h[0]=1));break}else{if(h[c]+=n,h[c]!=X)break;h[c--]=0,n=1}for(f=h.length;h[--f]===0;h.pop());}e.e>V?e.c=e.e=null:e.e<Y&&(e.c=[e.e=0])}return e}function H(e){var r,t=e.e;return t===null?e.toString():(r=q(e.c),r=t<=M||t>=k?ie(r,t):W(r,t,"0"),e.s<0?"-"+r:r)}return g.absoluteValue=g.abs=function(){var e=new w(this);return e.s<0&&(e.s=1),e},g.comparedTo=function(e,r){return Z(this,new w(e,r))},g.decimalPlaces=g.dp=function(e,r){var t,l,i,f=this;if(e!=null)return T(e,0,R),r==null?r=_:T(r,0,8),C(new w(f),e+f.e+1,r);if(!(t=f.c))return null;if(l=((i=t.length-1)-$(this.e/N))*N,i=t[i])for(;i%10==0;i/=10,l--);return l<0&&(l=0),l},g.dividedBy=g.div=function(e,r){return p(this,new w(e,r),A,_)},g.dividedToIntegerBy=g.idiv=function(e,r){return p(this,new w(e,r),0,1)},g.exponentiatedBy=g.pow=function(e,r){var t,l,i,f,u,n,o,c,s,h=this;if(e=new w(e),e.c&&!e.isInteger())throw Error(P+"Exponent not an integer: "+H(e));if(r!=null&&(r=new w(r)),n=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return s=new w(Math.pow(+H(h),n?e.s*(2-ne(e)):+H(e))),r?s.mod(r):s;if(o=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new w(NaN);l=!o&&h.isInteger()&&r.isInteger(),l&&(h=h.mod(r))}else{if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||n&&h.c[1]>=24e7:h.c[0]<8e13||n&&h.c[0]<=9999975e7)))return f=h.s<0&&ne(e)?-0:0,h.e>-1&&(f=1/f),new w(o?1/f:f);j&&(f=he(j/N+2))}for(n?(t=new w(.5),o&&(e.s=1),c=ne(e)):(i=Math.abs(+H(e)),c=i%2),s=new w(S);;){if(c){if(s=s.times(h),!s.c)break;f?s.c.length>f&&(s.c.length=f):l&&(s=s.mod(r))}if(i){if(i=F(i/2),i===0)break;c=i%2}else if(e=e.times(t),C(e,e.e+1,1),e.e>14)c=ne(e);else{if(i=+H(e),i===0)break;c=i%2}h=h.times(h),f?h.c&&h.c.length>f&&(h.c.length=f):l&&(h=h.mod(r))}return l?s:(o&&(s=S.div(s)),r?s.mod(r):f?C(s,j,_,u):s)},g.integerValue=function(e){var r=new w(this);return e==null?e=_:T(e,0,8),C(r,r.e+1,e)},g.isEqualTo=g.eq=function(e,r){return Z(this,new w(e,r))===0},g.isFinite=function(){return!!this.c},g.isGreaterThan=g.gt=function(e,r){return Z(this,new w(e,r))>0},g.isGreaterThanOrEqualTo=g.gte=function(e,r){return(r=Z(this,new w(e,r)))===1||r===0},g.isInteger=function(){return!!this.c&&$(this.e/N)>this.c.length-2},g.isLessThan=g.lt=function(e,r){return Z(this,new w(e,r))<0},g.isLessThanOrEqualTo=g.lte=function(e,r){return(r=Z(this,new w(e,r)))===-1||r===0},g.isNaN=function(){return!this.s},g.isNegative=function(){return this.s<0},g.isPositive=function(){return this.s>0},g.isZero=function(){return!!this.c&&this.c[0]==0},g.minus=function(e,r){var t,l,i,f,u=this,n=u.s;if(e=new w(e,r),r=e.s,!n||!r)return new w(NaN);if(n!=r)return e.s=-r,u.plus(e);var o=u.e/N,c=e.e/N,s=u.c,h=e.c;if(!o||!c){if(!s||!h)return s?(e.s=-r,e):new w(h?u:NaN);if(!s[0]||!h[0])return h[0]?(e.s=-r,e):new w(s[0]?u:_==3?-0:0)}if(o=$(o),c=$(c),s=s.slice(),n=o-c){for((f=n<0)?(n=-n,i=s):(c=o,i=h),i.reverse(),r=n;r--;i.push(0));i.reverse()}else for(l=(f=(n=s.length)<(r=h.length))?n:r,n=r=0;r<l;r++)if(s[r]!=h[r]){f=s[r]<h[r];break}if(f&&(i=s,s=h,h=i,e.s=-e.s),r=(l=h.length)-(t=s.length),r>0)for(;r--;s[t++]=0);for(r=X-1;l>n;){if(s[--l]<h[l]){for(t=l;t&&!s[--t];s[t]=r);--s[t],s[l]+=X}s[l]-=h[l]}for(;s[0]==0;s.splice(0,1),--c);return s[0]?ce(e,s,c):(e.s=_==3?-1:1,e.c=[e.e=0],e)},g.modulo=g.mod=function(e,r){var t,l,i=this;return e=new w(e,r),!i.c||!e.s||e.c&&!e.c[0]?new w(NaN):!e.c||i.c&&!i.c[0]?new w(i):(b==9?(l=e.s,e.s=1,t=p(i,e,0,3),e.s=l,t.s*=l):t=p(i,e,0,b),e=i.minus(t.times(e)),!e.c[0]&&b==1&&(e.s=i.s),e)},g.multipliedBy=g.times=function(e,r){var t,l,i,f,u,n,o,c,s,h,m,O,x,B,v,y=this,I=y.c,L=(e=new w(e,r)).c;if(!I||!L||!I[0]||!L[0])return!y.s||!e.s||I&&!I[0]&&!L||L&&!L[0]&&!I?e.c=e.e=e.s=null:(e.s*=y.s,!I||!L?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(l=$(y.e/N)+$(e.e/N),e.s*=y.s,o=I.length,h=L.length,o<h&&(x=I,I=L,L=x,i=o,o=h,h=i),i=o+h,x=[];i--;x.push(0));for(B=X,v=J,i=h;--i>=0;){for(t=0,m=L[i]%v,O=L[i]/v|0,u=o,f=i+u;f>i;)c=I[--u]%v,s=I[u]/v|0,n=O*c+s*m,c=m*c+n%v*v+x[f]+t,t=(c/B|0)+(n/v|0)+O*s,x[f--]=c%B;x[f]=t}return t?++l:x.splice(0,1),ce(e,x,l)},g.negated=function(){var e=new w(this);return e.s=-e.s||null,e},g.plus=function(e,r){var t,l=this,i=l.s;if(e=new w(e,r),r=e.s,!i||!r)return new w(NaN);if(i!=r)return e.s=-r,l.minus(e);var f=l.e/N,u=e.e/N,n=l.c,o=e.c;if(!f||!u){if(!n||!o)return new w(i/0);if(!n[0]||!o[0])return o[0]?e:new w(n[0]?l:i*0)}if(f=$(f),u=$(u),n=n.slice(),i=f-u){for(i>0?(u=f,t=o):(i=-i,t=n),t.reverse();i--;t.push(0));t.reverse()}for(i=n.length,r=o.length,i-r<0&&(t=o,o=n,n=t,r=i),i=0;r;)i=(n[--r]=n[r]+o[r]+i)/X|0,n[r]=X===n[r]?0:n[r]%X;return i&&(n=[i].concat(n),++u),ce(e,n,u)},g.precision=g.sd=function(e,r){var t,l,i,f=this;if(e!=null&&e!==!!e)return T(e,1,R),r==null?r=_:T(r,0,8),C(new w(f),e,r);if(!(t=f.c))return null;if(i=t.length-1,l=i*N+1,i=t[i]){for(;i%10==0;i/=10,l--);for(i=t[0];i>=10;i/=10,l++);}return e&&f.e+1>l&&(l=f.e+1),l},g.shiftedBy=function(e){return T(e,-ge,ge),this.times("1e"+e)},g.squareRoot=g.sqrt=function(){var e,r,t,l,i,f=this,u=f.c,n=f.s,o=f.e,c=A+4,s=new w("0.5");if(n!==1||!u||!u[0])return new w(!n||n<0&&(!u||u[0])?NaN:u?f:1/0);if(n=Math.sqrt(+H(f)),n==0||n==1/0?(r=q(u),(r.length+o)%2==0&&(r+="0"),n=Math.sqrt(+r),o=$((o+1)/2)-(o<0||o%2),n==1/0?r="5e"+o:(r=n.toExponential(),r=r.slice(0,r.indexOf("e")+1)+o),t=new w(r)):t=new w(n+""),t.c[0]){for(o=t.e,n=o+c,n<3&&(n=0);;)if(i=t,t=s.times(i.plus(p(f,i,c,1))),q(i.c).slice(0,n)===(r=q(t.c)).slice(0,n))if(t.e<o&&--n,r=r.slice(n-3,n+1),r=="9999"||!l&&r=="4999"){if(!l&&(C(i,i.e+A+2,0),i.times(i).eq(f))){t=i;break}c+=4,n+=4,l=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(C(t,t.e+A+2,1),e=!t.times(t).eq(f));break}}return C(t,t.e+A+1,_,e)},g.toExponential=function(e,r){return e!=null&&(T(e,0,R),e++),le(this,e,r,1)},g.toFixed=function(e,r){return e!=null&&(T(e,0,R),e=e+this.e+1),le(this,e,r)},g.toFormat=function(e,r,t){var l,i=this;if(t==null)e!=null&&r&&typeof r=="object"?(t=r,r=null):e&&typeof e=="object"?(t=e,e=r=null):t=fe;else if(typeof t!="object")throw Error(P+"Argument not an object: "+t);if(l=i.toFixed(e,r),i.c){var f,u=l.split("."),n=+t.groupSize,o=+t.secondaryGroupSize,c=t.groupSeparator||"",s=u[0],h=u[1],m=i.s<0,O=m?s.slice(1):s,x=O.length;if(o&&(f=n,n=o,o=f,x-=f),n>0&&x>0){for(f=x%n||n,s=O.substr(0,f);f<x;f+=n)s+=c+O.substr(f,n);o>0&&(s+=c+O.slice(f)),m&&(s="-"+s)}l=h?s+(t.decimalSeparator||"")+((o=+t.fractionGroupSize)?h.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+(t.fractionGroupSeparator||"")):h):s}return(t.prefix||"")+l+(t.suffix||"")},g.toFraction=function(e){var r,t,l,i,f,u,n,o,c,s,h,m,O=this,x=O.c;if(e!=null&&(n=new w(e),!n.isInteger()&&(n.c||n.s!==1)||n.lt(S)))throw Error(P+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+H(n));if(!x)return new w(O);for(r=new w(S),c=t=new w(S),l=o=new w(S),m=q(x),f=r.e=m.length-O.e-1,r.c[0]=pe[(u=f%N)<0?N+u:u],e=!e||n.comparedTo(r)>0?f>0?r:c:n,u=V,V=1/0,n=new w(m),o.c[0]=0;s=p(n,r,0,1),i=t.plus(s.times(l)),i.comparedTo(e)!=1;)t=l,l=i,c=o.plus(s.times(i=c)),o=i,r=n.minus(s.times(i=r)),n=i;return i=p(e.minus(t),l,0,1),o=o.plus(i.times(c)),t=t.plus(i.times(l)),o.s=c.s=O.s,f=f*2,h=p(c,l,f,_).minus(O).abs().comparedTo(p(o,t,f,_).minus(O).abs())<1?[c,l]:[o,t],V=u,h},g.toNumber=function(){return+H(this)},g.toPrecision=function(e,r){return e!=null&&T(e,1,R),le(this,e,r,2)},g.toString=function(e){var r,t=this,l=t.s,i=t.e;return i===null?l?(r="Infinity",l<0&&(r="-"+r)):r="NaN":(e==null?r=i<=M||i>=k?ie(q(t.c),i):W(q(t.c),i,"0"):e===10&&se?(t=C(new w(t),A+i+1,_),r=W(q(t.c),t.e,"0")):(T(e,2,Q.length,"Base"),r=d(W(q(t.c),i,"0"),10,e,l,!0)),l<0&&t.c[0]&&(r="-"+r)),r},g.valueOf=g.toJSON=function(){return H(this)},g._isBigNumber=!0,g[Symbol.toStringTag]="BigNumber",g[Symbol.for("nodejs.util.inspect.custom")]=g.valueOf,a!=null&&w.set(a),w}function $(a){var p=a|0;return a>0||a===p?p:p-1}function q(a){for(var p,d,E=1,g=a.length,S=a[0]+"";E<g;){for(p=a[E++]+"",d=N-p.length;d--;p="0"+p);S+=p}for(g=S.length;S.charCodeAt(--g)===48;);return S.slice(0,g+1||1)}function Z(a,p){var d,E,g=a.c,S=p.c,A=a.s,_=p.s,M=a.e,k=p.e;if(!A||!_)return null;if(d=g&&!g[0],E=S&&!S[0],d||E)return d?E?0:-_:A;if(A!=_)return A;if(d=A<0,E=M==k,!g||!S)return E?0:!g^d?1:-1;if(!E)return M>k^d?1:-1;for(_=(M=g.length)<(k=S.length)?M:k,A=0;A<_;A++)if(g[A]!=S[A])return g[A]>S[A]^d?1:-1;return M==k?0:M>k^d?1:-1}function T(a,p,d,E){if(a<p||a>d||a!==F(a))throw Error(P+(E||"Argument")+(typeof a=="number"?a<p||a>d?" out of range: ":" not an integer: ":" not a primitive number: ")+String(a))}function ne(a){var p=a.c.length-1;return $(a.e/N)==p&&a.c[p]%2!=0}function ie(a,p){return(a.length>1?a.charAt(0)+"."+a.slice(1):a)+(p<0?"e":"e+")+p}function W(a,p,d){var E,g;if(p<0){for(g=d+".";++p;g+=d);a=g+a}else if(E=a.length,++p>E){for(g=d,p-=E;--p;g+=d);a+=g}else p<E&&(a=a.slice(0,p)+"."+a.slice(p));return a}me();export{Te as A,Ce as a,Se as b,ze as c,Xe as d,Fe as e,Me as f,Ve as g,Ge as h,Oe as i,ke as j,Ue as k,Pe as l,He as m,qe as n,re as o,Ae as p,Le as q,$e as s};
|