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